summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bzrignore17
-rw-r--r--BUILD/Makefile.am2
-rwxr-xr-xBUILD/SETUP.sh27
-rwxr-xr-xBUILD/check-cpu6
-rwxr-xr-xBUILD/compile-amd64-gcov17
-rwxr-xr-xBUILD/compile-amd64-gprof9
-rw-r--r--BUILD/compile-amd64-max-sci8
-rwxr-xr-xBUILD/compile-dist13
-rwxr-xr-xBUILD/compile-pentium-gcov12
-rwxr-xr-xBUILD/compile-pentium-gprof4
-rwxr-xr-xBUILD/compile-pentium64-gcov17
-rwxr-xr-xBUILD/compile-pentium64-gprof9
-rw-r--r--BUILD/compile-pentium64-max-sci9
-rwxr-xr-xBUILD/compile-solaris-sparc-debug2
-rwxr-xr-xBUILD/compile-solaris-sparc-forte15
-rwxr-xr-xBitKeeper/triggers/post-commit46
-rwxr-xr-xBitKeeper/triggers/pre-commit1
-rwxr-xr-xBitKeeper/triggers/pre-outgoing.crash-protect.pl1
-rwxr-xr-xBitKeeper/triggers/pre-resolve.crash-protect.pl1
-rwxr-xr-x[-rw-r--r--]CMakeLists.txt151
-rw-r--r--Makefile.am51
-rwxr-xr-x[-rw-r--r--]client/CMakeLists.txt90
-rw-r--r--client/client_priv.h10
-rw-r--r--client/completion_hash.cc2
-rw-r--r--client/my_readline.h2
-rw-r--r--client/mysql.cc278
-rw-r--r--client/mysql_upgrade.c123
-rw-r--r--client/mysqladmin.cc91
-rw-r--r--client/mysqlbinlog.cc156
-rw-r--r--client/mysqlcheck.c82
-rw-r--r--client/mysqldump.c1289
-rw-r--r--client/mysqlimport.c97
-rw-r--r--client/mysqlshow.c68
-rw-r--r--client/mysqlslap.c296
-rw-r--r--client/mysqltest.c1550
-rw-r--r--client/readline.cc34
-rw-r--r--client/sql_string.cc14
-rw-r--r--cmd-line-utils/libedit/Makefile.am10
-rw-r--r--cmd-line-utils/libedit/el_term.h10
-rw-r--r--cmd-line-utils/readline/Makefile.am8
-rw-r--r--cmd-line-utils/readline/rltty.c3
-rw-r--r--config/ac-macros/compiler_flag.m42
-rw-r--r--config/ac-macros/ha_ndbcluster.m410
-rw-r--r--config/ac-macros/large_file.m411
-rw-r--r--config/ac-macros/misc.m418
-rw-r--r--config/ac-macros/ssl.m419
-rw-r--r--config/ac-macros/zlib.m47
-rw-r--r--configure.in230
-rwxr-xr-x[-rw-r--r--]dbug/CMakeLists.txt12
-rw-r--r--dbug/dbug.c42
-rwxr-xr-x[-rw-r--r--]extra/CMakeLists.txt8
-rw-r--r--extra/Makefile.am1
-rw-r--r--extra/comp_err.c64
-rw-r--r--extra/innochecksum.c14
-rw-r--r--extra/my_print_defaults.c16
-rw-r--r--extra/mysql_waitpid.c2
-rw-r--r--extra/perror.c30
-rw-r--r--extra/replace.c112
-rw-r--r--extra/resolve_stack_dump.c16
-rw-r--r--extra/resolveip.c4
-rwxr-xr-x[-rw-r--r--]extra/yassl/CMakeLists.txt12
-rw-r--r--extra/yassl/include/openssl/crypto.h1
-rw-r--r--extra/yassl/include/openssl/des_old.h1
-rw-r--r--extra/yassl/include/openssl/evp.h10
-rw-r--r--extra/yassl/include/openssl/hmac.h1
-rw-r--r--extra/yassl/include/openssl/objects.h1
-rw-r--r--extra/yassl/include/openssl/prefix_ssl.h3
-rw-r--r--extra/yassl/include/openssl/sha.h1
-rw-r--r--extra/yassl/include/openssl/ssl.h5
-rw-r--r--extra/yassl/include/yassl_int.hpp3
-rw-r--r--extra/yassl/src/handshake.cpp4
-rw-r--r--extra/yassl/src/socket_wrapper.cpp4
-rw-r--r--extra/yassl/src/ssl.cpp24
-rw-r--r--extra/yassl/src/yassl_int.cpp15
-rwxr-xr-x[-rw-r--r--]extra/yassl/taocrypt/CMakeLists.txt8
-rw-r--r--extra/yassl/taocrypt/src/coding.cpp3
-rw-r--r--extra/yassl/taocrypt/src/crypto.cpp5
-rw-r--r--include/Makefile.am19
-rw-r--r--include/config-netware.h2
-rw-r--r--include/config-win.h20
-rw-r--r--include/decimal.h4
-rw-r--r--include/ft_global.h6
-rw-r--r--include/hash.h32
-rw-r--r--include/heap.h59
-rw-r--r--include/keycache.h29
-rw-r--r--include/m_ctype.h262
-rw-r--r--include/m_string.h68
-rw-r--r--include/my_alloc.h4
-rw-r--r--include/my_base.h19
-rw-r--r--include/my_bitmap.h12
-rw-r--r--include/my_dbug.h8
-rw-r--r--include/my_getopt.h16
-rw-r--r--include/my_global.h226
-rw-r--r--include/my_list.h4
-rw-r--r--include/my_md5.h (renamed from include/md5.h)0
-rw-r--r--include/my_nosys.h5
-rw-r--r--include/my_pthread.h99
-rw-r--r--include/my_sys.h307
-rw-r--r--include/my_tree.h4
-rw-r--r--include/my_trie.h16
-rw-r--r--include/my_user.h6
-rw-r--r--include/my_vle.h4
-rw-r--r--include/my_xml.h16
-rw-r--r--include/myisam.h42
-rw-r--r--include/myisammrg.h22
-rw-r--r--include/mysql.h77
-rw-r--r--include/mysql/plugin.h468
-rw-r--r--include/mysql_com.h46
-rw-r--r--include/mysql_h.ic739
-rw-r--r--include/mysys_err.h1
-rw-r--r--include/queues.h12
-rw-r--r--include/sql_common.h6
-rw-r--r--include/sslopt-longopts.h14
-rw-r--r--include/thr_lock.h5
-rw-r--r--include/typelib.h1
-rw-r--r--include/violite.h23
-rwxr-xr-x[-rw-r--r--]libmysql/CMakeLists.txt91
-rw-r--r--libmysql/Makefile.am1
-rw-r--r--libmysql/Makefile.shared2
-rw-r--r--libmysql/client_settings.h4
-rw-r--r--libmysql/libmysql.c147
-rw-r--r--libmysql/manager.c8
-rw-r--r--libmysql_r/Makefile.am3
-rw-r--r--libmysqld/CMakeLists.txt234
-rw-r--r--libmysqld/Makefile.am6
-rw-r--r--libmysqld/emb_qcache.cc16
-rw-r--r--libmysqld/emb_qcache.h8
-rw-r--r--libmysqld/examples/CMakeLists.txt20
-rw-r--r--libmysqld/examples/Makefile.am14
-rw-r--r--libmysqld/lib_sql.cc43
-rw-r--r--libmysqld/libmysqld.def20
-rw-r--r--mysql-test/Makefile.am30
-rw-r--r--mysql-test/extra/binlog_tests/binlog.test63
-rw-r--r--mysql-test/extra/binlog_tests/blackhole.test22
-rw-r--r--mysql-test/extra/binlog_tests/ctype_cp932.test22
-rw-r--r--mysql-test/extra/binlog_tests/ctype_cp932_binlog.test1
-rw-r--r--mysql-test/extra/binlog_tests/ctype_ucs_binlog.test1
-rw-r--r--mysql-test/extra/binlog_tests/drop_temp_table.test2
-rw-r--r--mysql-test/extra/binlog_tests/insert_select-binlog.test5
-rw-r--r--mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test22
-rw-r--r--mysql-test/extra/rpl_tests/rpl_auto_increment.test4
-rw-r--r--mysql-test/extra/rpl_tests/rpl_commit_after_flush.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_deadlock.test4
-rw-r--r--mysql-test/extra/rpl_tests/rpl_delete_no_where.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test506
-rw-r--r--mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test107
-rw-r--r--mysql-test/extra/rpl_tests/rpl_foreign_key.test4
-rw-r--r--mysql-test/extra/rpl_tests/rpl_insert_delayed.test58
-rw-r--r--mysql-test/extra/rpl_tests/rpl_insert_id.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_insert_id_pk.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_insert_ignore.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_loaddata.test24
-rw-r--r--mysql-test/extra/rpl_tests/rpl_log.test11
-rw-r--r--mysql-test/extra/rpl_tests/rpl_max_relay_size.test36
-rw-r--r--mysql-test/extra/rpl_tests/rpl_multi_update2.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_multi_update3.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_ndb_2multi_basic.test119
-rw-r--r--mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test290
-rw-r--r--mysql-test/extra/rpl_tests/rpl_relayrotate.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_reset_slave.test16
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_001.test3
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_UUID.test6
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_basic.test9
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_blob.test4
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_charset.test4
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_func003.test5
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_sp003.test5
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_sp006.test4
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_tabledefs.test34
-rw-r--r--mysql-test/extra/rpl_tests/rpl_stm_000001.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test4
-rw-r--r--mysql-test/extra/rpl_tests/rpl_trig004.test2
-rw-r--r--mysql-test/include/ddl_i18n.check_events.inc48
-rw-r--r--mysql-test/include/ddl_i18n.check_sp.inc83
-rw-r--r--mysql-test/include/ddl_i18n.check_triggers.inc106
-rw-r--r--mysql-test/include/ddl_i18n.check_views.inc32
-rw-r--r--mysql-test/include/deadlock.inc27
-rw-r--r--mysql-test/include/federated.inc1
-rw-r--r--mysql-test/include/grant_cache.inc203
-rw-r--r--mysql-test/include/handler.inc33
-rw-r--r--mysql-test/include/have_archive.inc2
-rw-r--r--mysql-test/include/have_binlog_format_mixed.inc2
-rw-r--r--mysql-test/include/have_binlog_format_mixed_or_row.inc2
-rw-r--r--mysql-test/include/have_binlog_format_mixed_or_statement.inc3
-rw-r--r--mysql-test/include/have_binlog_format_row.inc2
-rw-r--r--mysql-test/include/have_binlog_format_statement.inc2
-rw-r--r--mysql-test/include/have_blackhole.inc2
-rw-r--r--mysql-test/include/have_bug25714.inc7
-rw-r--r--mysql-test/include/have_cp1251.inc7
-rw-r--r--mysql-test/include/have_cp866.inc7
-rw-r--r--mysql-test/include/have_csv.inc2
-rw-r--r--mysql-test/include/have_exampledb.inc2
-rw-r--r--mysql-test/include/have_federated_db.inc2
-rw-r--r--mysql-test/include/have_innodb.inc2
-rw-r--r--mysql-test/include/have_koi8r.inc7
-rw-r--r--mysql-test/include/have_log_bin.inc4
-rw-r--r--mysql-test/include/have_multi_ndb.inc10
-rw-r--r--mysql-test/include/have_ndb.inc17
-rw-r--r--mysql-test/include/have_outfile.inc2
-rw-r--r--mysql-test/include/have_utf8.inc7
-rw-r--r--mysql-test/include/index_merge1.inc48
-rw-r--r--mysql-test/include/innodb_trx_weight.inc51
-rw-r--r--mysql-test/include/is_debug_build.inc4
-rw-r--r--mysql-test/include/master-slave.inc3
-rw-r--r--mysql-test/include/mix1.inc584
-rw-r--r--mysql-test/include/mix2.inc28
-rw-r--r--mysql-test/include/ndb_master-slave.inc20
-rw-r--r--mysql-test/include/ndb_not_readonly.inc47
-rw-r--r--mysql-test/include/partition_layout.inc1
-rw-r--r--mysql-test/include/ps_modify.inc4
-rw-r--r--mysql-test/include/query_cache.inc2
-rw-r--r--mysql-test/include/query_cache_sql_prepare.inc497
-rw-r--r--mysql-test/include/read_many_rows.inc106
-rw-r--r--mysql-test/include/rpl_events.inc81
-rw-r--r--mysql-test/include/rpl_multi_engine2.inc91
-rw-r--r--mysql-test/include/rpl_udf.inc20
-rw-r--r--mysql-test/include/select_ndb_apply_status.inc13
-rw-r--r--mysql-test/include/show_binlog_using_logname.inc13
-rw-r--r--mysql-test/include/show_slave_status.inc6
-rw-r--r--mysql-test/include/test_fieldsize.inc40
-rw-r--r--mysql-test/include/tpcb.inc155
-rw-r--r--mysql-test/include/tpcb_disk_data.inc166
-rw-r--r--mysql-test/include/unsafe_binlog.inc22
-rw-r--r--mysql-test/include/uses_vardir.inc14
-rw-r--r--mysql-test/include/varchar.inc12
-rw-r--r--mysql-test/include/wait_condition.inc5
-rw-r--r--mysql-test/include/wait_for_slave_io_to_stop.inc33
-rw-r--r--mysql-test/include/wait_for_slave_param.inc26
-rw-r--r--mysql-test/include/wait_for_slave_sql_to_stop.inc30
-rw-r--r--mysql-test/include/wait_for_slave_to_start.inc35
-rw-r--r--mysql-test/include/wait_for_slave_to_stop.inc39
-rw-r--r--mysql-test/lib/mtr_cases.pl271
-rw-r--r--mysql-test/lib/mtr_io.pl6
-rw-r--r--mysql-test/lib/mtr_misc.pl79
-rw-r--r--mysql-test/lib/mtr_process.pl229
-rw-r--r--mysql-test/lib/mtr_report.pl243
-rw-r--r--mysql-test/lib/mtr_timer.pl36
-rw-r--r--mysql-test/mysql-test-run-shell.sh9
-rwxr-xr-xmysql-test/mysql-test-run.pl554
-rw-r--r--mysql-test/ndb/ndb_config_1_node.ini9
-rw-r--r--mysql-test/ndb/ndb_config_2_node.ini9
-rw-r--r--mysql-test/ndb/ndb_config_4_node.ini6
-rw-r--r--mysql-test/r/alter_table-big.result41
-rw-r--r--mysql-test/r/alter_table.result110
-rw-r--r--mysql-test/r/analyse.result24
-rw-r--r--mysql-test/r/archive-big.result19
-rw-r--r--mysql-test/r/archive.result7
-rw-r--r--mysql-test/r/archive_gis.result4
-rw-r--r--mysql-test/r/backup.result42
-rw-r--r--mysql-test/r/bigint.result46
-rw-r--r--mysql-test/r/binary.result38
-rw-r--r--mysql-test/r/binlog_row_binlog.result339
-rw-r--r--mysql-test/r/binlog_row_blackhole.result152
-rw-r--r--mysql-test/r/binlog_row_ctype_cp932.result11377
-rw-r--r--mysql-test/r/binlog_stm_binlog.result237
-rw-r--r--mysql-test/r/binlog_stm_blackhole.result152
-rwxr-xr-xmysql-test/r/binlog_stm_ctype_cp932.result11377
-rw-r--r--mysql-test/r/binlog_stm_mix_innodb_myisam.result382
-rw-r--r--mysql-test/r/binlog_tx_isolation.result48
-rw-r--r--mysql-test/r/binlog_unsafe.result13
-rw-r--r--mysql-test/r/cast.result11
-rw-r--r--mysql-test/r/check.result11
-rw-r--r--mysql-test/r/comments.result27
-rw-r--r--mysql-test/r/compress.result6
-rw-r--r--mysql-test/r/create-big.result247
-rw-r--r--mysql-test/r/create.result771
-rw-r--r--mysql-test/r/csv.result76
-rw-r--r--mysql-test/r/ctype_ascii.result177
-rw-r--r--mysql-test/r/ctype_big5.result15
-rw-r--r--mysql-test/r/ctype_collate.result18
-rw-r--r--mysql-test/r/ctype_cp932_binlog_stm.result19
-rw-r--r--mysql-test/r/ctype_latin1.result4
-rw-r--r--mysql-test/r/ctype_ldml.result296
-rw-r--r--mysql-test/r/ctype_recoding.result14
-rw-r--r--mysql-test/r/ctype_uca.result92
-rw-r--r--mysql-test/r/ctype_ucs.result57
-rw-r--r--mysql-test/r/ctype_ucs2_def.result15
-rw-r--r--mysql-test/r/ctype_ujis_ucs2.result19159
-rw-r--r--mysql-test/r/ctype_utf8.result77
-rw-r--r--mysql-test/r/date_formats.result76
-rw-r--r--mysql-test/r/ddl_i18n_koi8r.result2795
-rw-r--r--mysql-test/r/ddl_i18n_utf8.result2795
-rw-r--r--mysql-test/r/deadlock_innodb.result11
-rw-r--r--mysql-test/r/default.result2
-rw-r--r--mysql-test/r/delete.result48
-rw-r--r--mysql-test/r/derived.result20
-rw-r--r--mysql-test/r/distinct.result34
-rw-r--r--mysql-test/r/endspace.result2
-rw-r--r--mysql-test/r/error_simulation.result19
-rw-r--r--mysql-test/r/errors.result14
-rw-r--r--mysql-test/r/events.result168
-rw-r--r--mysql-test/r/events_bugs.result188
-rw-r--r--mysql-test/r/events_grant.result24
-rw-r--r--mysql-test/r/events_logs_tests.result164
-rw-r--r--mysql-test/r/events_restart_phase3.result6
-rw-r--r--mysql-test/r/events_trans.result2
-rw-r--r--mysql-test/r/federated.result123
-rw-r--r--mysql-test/r/federated_bug_25714.result56
-rw-r--r--mysql-test/r/federated_innodb.result34
-rw-r--r--mysql-test/r/flush.result16
-rw-r--r--mysql-test/r/flush2.result2
-rw-r--r--mysql-test/r/fulltext.result12
-rw-r--r--mysql-test/r/fulltext3.result17
-rw-r--r--mysql-test/r/func_date_add.result11
-rw-r--r--mysql-test/r/func_gconcat.result82
-rw-r--r--mysql-test/r/func_group.result55
-rw-r--r--mysql-test/r/func_group_innodb.result8
-rw-r--r--mysql-test/r/func_in.result38
-rw-r--r--mysql-test/r/func_misc.result11
-rw-r--r--mysql-test/r/func_str.result92
-rw-r--r--mysql-test/r/func_time.result23
-rw-r--r--mysql-test/r/gis-rtree.result13
-rw-r--r--mysql-test/r/gis.result50
-rw-r--r--mysql-test/r/grant.result43
-rw-r--r--mysql-test/r/grant2.result42
-rw-r--r--mysql-test/r/grant_cache.result210
-rw-r--r--mysql-test/r/grant_cache_no_prot.result218
-rw-r--r--mysql-test/r/grant_cache_ps_prot.result218
-rw-r--r--mysql-test/r/greedy_optimizer.result440
-rw-r--r--mysql-test/r/group_by.result164
-rw-r--r--mysql-test/r/group_min_max.result35
-rw-r--r--mysql-test/r/handler_innodb.result20
-rw-r--r--mysql-test/r/handler_myisam.result20
-rw-r--r--mysql-test/r/have_bug25714.require2
-rw-r--r--mysql-test/r/have_cp1251.require2
-rw-r--r--mysql-test/r/have_cp866.require2
-rw-r--r--mysql-test/r/have_koi8r.require2
-rw-r--r--mysql-test/r/have_log_bin.require2
-rw-r--r--mysql-test/r/have_utf8.require2
-rw-r--r--mysql-test/r/having.result19
-rw-r--r--mysql-test/r/heap_hash.result16
-rw-r--r--mysql-test/r/im_options.result149
-rw-r--r--mysql-test/r/im_utils.result96
-rw-r--r--mysql-test/r/index_merge_myisam.result77
-rw-r--r--mysql-test/r/information_schema.result242
-rw-r--r--mysql-test/r/information_schema_db.result32
-rw-r--r--mysql-test/r/information_schema_part.result54
-rw-r--r--mysql-test/r/innodb.result45
-rw-r--r--mysql-test/r/innodb_gis.result4
-rw-r--r--mysql-test/r/innodb_mysql.result788
-rw-r--r--mysql-test/r/innodb_trx_weight.result1
-rw-r--r--mysql-test/r/insert.result116
-rw-r--r--mysql-test/r/insert_notembedded.result19
-rw-r--r--mysql-test/r/insert_select.result57
-rw-r--r--mysql-test/r/insert_update.result71
-rw-r--r--mysql-test/r/join.result4
-rw-r--r--mysql-test/r/join_nested.result163
-rw-r--r--mysql-test/r/join_outer.result15
-rw-r--r--mysql-test/r/key.result22
-rw-r--r--mysql-test/r/key_cache.result31
-rw-r--r--mysql-test/r/key_diff.result4
-rw-r--r--mysql-test/r/kill.result86
-rw-r--r--mysql-test/r/limit.result11
-rw-r--r--mysql-test/r/loaddata.result87
-rw-r--r--mysql-test/r/lock.result73
-rw-r--r--mysql-test/r/lock_multi.result25
-rw-r--r--mysql-test/r/log_state.result28
-rw-r--r--mysql-test/r/log_tables.result373
-rw-r--r--mysql-test/r/long_tmpdir.result3
-rw-r--r--mysql-test/r/lowercase_table3.result8
-rw-r--r--mysql-test/r/lowercase_view.result12
-rw-r--r--mysql-test/r/merge.result34
-rw-r--r--mysql-test/r/metadata.result52
-rw-r--r--mysql-test/r/multi_update.result35
-rw-r--r--mysql-test/r/myisam.result38
-rw-r--r--mysql-test/r/mysql.result7
-rw-r--r--mysql-test/r/mysql_upgrade.result53
-rw-r--r--mysql-test/r/mysqlbinlog.result13
-rw-r--r--mysql-test/r/mysqlbinlog2.result26
-rw-r--r--mysql-test/r/mysqldump-compat.result4
-rw-r--r--mysql-test/r/mysqldump-max.result36
-rw-r--r--mysql-test/r/mysqldump.result758
-rw-r--r--mysql-test/r/mysqlslap.result46
-rw-r--r--mysql-test/r/mysqltest.result162
-rw-r--r--mysql-test/r/ndb_alter_table.result401
-rw-r--r--mysql-test/r/ndb_autodiscover.result397
-rw-r--r--mysql-test/r/ndb_basic.result867
-rw-r--r--mysql-test/r/ndb_binlog_basic.result51
-rw-r--r--mysql-test/r/ndb_binlog_basic2.result12
-rw-r--r--mysql-test/r/ndb_binlog_multi.result84
-rw-r--r--mysql-test/r/ndb_condition_pushdown.result1892
-rw-r--r--mysql-test/r/ndb_dd_alter.result560
-rw-r--r--mysql-test/r/ndb_dd_backuprestore.result487
-rw-r--r--mysql-test/r/ndb_dd_basic.result510
-rw-r--r--mysql-test/r/ndb_dd_ddl.result240
-rw-r--r--mysql-test/r/ndb_dd_dump.result218
-rw-r--r--mysql-test/r/ndb_gis.result1100
-rw-r--r--mysql-test/r/ndb_insert.result659
-rw-r--r--mysql-test/r/ndb_partition_range.result263
-rw-r--r--mysql-test/r/ndb_read_multi_range.result475
-rw-r--r--mysql-test/r/ndb_restore.result485
-rw-r--r--mysql-test/r/ndb_restore_compat.result114
-rw-r--r--mysql-test/r/ndb_row_format.result65
-rw-r--r--mysql-test/r/ndb_single_user.result119
-rw-r--r--mysql-test/r/ndb_sp.result44
-rw-r--r--mysql-test/r/ndb_temporary.result21
-rw-r--r--mysql-test/r/ndb_trigger.result315
-rw-r--r--mysql-test/r/ndb_update.result42
-rw-r--r--mysql-test/r/olap.result4
-rw-r--r--mysql-test/r/openssl_1.result13
-rw-r--r--mysql-test/r/order_by.result58
-rw-r--r--mysql-test/r/parser.result10
-rw-r--r--mysql-test/r/parser_precedence.result747
-rw-r--r--mysql-test/r/partition.result34
-rw-r--r--mysql-test/r/partition_bug18198.result173
-rw-r--r--mysql-test/r/partition_charset.result4
-rw-r--r--mysql-test/r/partition_error.result10
-rw-r--r--mysql-test/r/partition_hash.result14
-rw-r--r--mysql-test/r/partition_innodb.result1
-rw-r--r--mysql-test/r/partition_list.result4
-rw-r--r--mysql-test/r/partition_mgm.result6
-rw-r--r--mysql-test/r/partition_pruning.result94
-rw-r--r--mysql-test/r/partition_range.result78
-rw-r--r--mysql-test/r/plugin.result6
-rw-r--r--mysql-test/r/preload.result13
-rw-r--r--mysql-test/r/ps.result358
-rw-r--r--mysql-test/r/ps_1general.result25
-rw-r--r--mysql-test/r/ps_2myisam.result514
-rw-r--r--mysql-test/r/ps_3innodb.result514
-rw-r--r--mysql-test/r/ps_4heap.result514
-rw-r--r--mysql-test/r/ps_5merge.result1028
-rw-r--r--mysql-test/r/ps_7ndb.result3127
-rw-r--r--mysql-test/r/query_cache.result392
-rw-r--r--mysql-test/r/query_cache_ps_no_prot.result533
-rw-r--r--mysql-test/r/query_cache_ps_ps_prot.result533
-rw-r--r--mysql-test/r/query_cache_sql_prepare.result204
-rw-r--r--mysql-test/r/query_cache_with_views.result (renamed from mysql-test/r/view_query_cache.result)0
-rw-r--r--mysql-test/r/range.result32
-rw-r--r--mysql-test/r/read_many_rows_innodb.result66
-rw-r--r--mysql-test/r/repair.result14
-rw-r--r--mysql-test/r/row.result4
-rw-r--r--mysql-test/r/rpl_000015.result34
-rw-r--r--mysql-test/r/rpl_change_master.result26
-rw-r--r--mysql-test/r/rpl_colSize.result179
-rw-r--r--mysql-test/r/rpl_deadlock_innodb.result199
-rw-r--r--mysql-test/r/rpl_empty_master_crash.result12
-rw-r--r--mysql-test/r/rpl_events.result159
-rw-r--r--mysql-test/r/rpl_extraCol_innodb.result749
-rw-r--r--mysql-test/r/rpl_extraCol_myisam.result749
-rw-r--r--mysql-test/r/rpl_extraColmaster_innodb.resultbin0 -> 24418 bytes
-rw-r--r--mysql-test/r/rpl_extraColmaster_myisam.resultbin0 -> 24418 bytes
-rw-r--r--mysql-test/r/rpl_failed_optimize.result25
-rw-r--r--mysql-test/r/rpl_flushlog_loop.result54
-rw-r--r--mysql-test/r/rpl_incident.result107
-rw-r--r--mysql-test/r/rpl_innodb.result37
-rw-r--r--mysql-test/r/rpl_known_bugs_detection.result135
-rw-r--r--mysql-test/r/rpl_loaddata.result88
-rw-r--r--mysql-test/r/rpl_log_pos.result46
-rw-r--r--mysql-test/r/rpl_misc_functions.result46
-rw-r--r--mysql-test/r/rpl_ndb_UUID.result40
-rw-r--r--mysql-test/r/rpl_ndb_basic.result227
-rw-r--r--mysql-test/r/rpl_ndb_circular.result95
-rw-r--r--mysql-test/r/rpl_ndb_circular_simplex.result97
-rw-r--r--mysql-test/r/rpl_ndb_dd_advance.result417
-rw-r--r--mysql-test/r/rpl_ndb_dd_basic.result72
-rw-r--r--mysql-test/r/rpl_ndb_dd_partitions.result726
-rw-r--r--mysql-test/r/rpl_ndb_extraCol.result750
-rw-r--r--mysql-test/r/rpl_ndb_idempotent.result73
-rw-r--r--mysql-test/r/rpl_ndb_log.result151
-rw-r--r--mysql-test/r/rpl_ndb_stm_innodb.result37
-rw-r--r--mysql-test/r/rpl_ndb_sync.result96
-rw-r--r--mysql-test/r/rpl_packet.result32
-rw-r--r--mysql-test/r/rpl_ps.result30
-rw-r--r--mysql-test/r/rpl_rbr_to_sbr.result67
-rw-r--r--mysql-test/r/rpl_redirect.result41
-rw-r--r--mysql-test/r/rpl_replicate_do.result77
-rw-r--r--mysql-test/r/rpl_rotate_logs.result94
-rw-r--r--mysql-test/r/rpl_row_UUID.result40
-rw-r--r--mysql-test/r/rpl_row_basic_11bugs.result220
-rw-r--r--mysql-test/r/rpl_row_create_table.result403
-rw-r--r--mysql-test/r/rpl_row_flsh_tbls.result33
-rw-r--r--mysql-test/r/rpl_row_inexist_tbl.result55
-rw-r--r--mysql-test/r/rpl_row_insert_delayed.result48
-rw-r--r--mysql-test/r/rpl_row_log.result116
-rw-r--r--mysql-test/r/rpl_row_log_innodb.result124
-rw-r--r--mysql-test/r/rpl_row_max_relay_size.result281
-rw-r--r--mysql-test/r/rpl_row_mysqlbinlog.result276
-rw-r--r--mysql-test/r/rpl_row_reset_slave.result32
-rw-r--r--mysql-test/r/rpl_row_tabledefs_2myisam.result389
-rw-r--r--mysql-test/r/rpl_row_tabledefs_3innodb.result389
-rw-r--r--mysql-test/r/rpl_row_until.result62
-rw-r--r--mysql-test/r/rpl_server_id1.result19
-rw-r--r--mysql-test/r/rpl_server_id2.result21
-rw-r--r--mysql-test/r/rpl_session_var.result43
-rw-r--r--mysql-test/r/rpl_skip_error.result16
-rw-r--r--mysql-test/r/rpl_slave_status.result58
-rw-r--r--mysql-test/r/rpl_sp.result536
-rw-r--r--mysql-test/r/rpl_ssl.result98
-rw-r--r--mysql-test/r/rpl_ssl1.result146
-rw-r--r--mysql-test/r/rpl_stm_insert_delayed.result88
-rw-r--r--mysql-test/r/rpl_stm_log.result115
-rw-r--r--mysql-test/r/rpl_stm_max_relay_size.result279
-rw-r--r--mysql-test/r/rpl_stm_reset_slave.result32
-rw-r--r--mysql-test/r/rpl_stm_until.result190
-rw-r--r--mysql-test/r/rpl_switch_stm_row_mixed.result1029
-rw-r--r--mysql-test/r/rpl_timezone.result107
-rw-r--r--mysql-test/r/rpl_trigger.result973
-rw-r--r--mysql-test/r/rpl_truncate_7ndb.result95
-rw-r--r--mysql-test/r/rpl_truncate_7ndb_2.result91
-rw-r--r--mysql-test/r/rpl_udf.result310
-rw-r--r--mysql-test/r/rpl_user_variables.result257
-rw-r--r--mysql-test/r/rpl_view.result98
-rw-r--r--mysql-test/r/select.result152
-rw-r--r--mysql-test/r/select_found.result2
-rw-r--r--mysql-test/r/show_check.result755
-rw-r--r--mysql-test/r/skip_grants.result12
-rw-r--r--mysql-test/r/sp-code.result113
-rw-r--r--mysql-test/r/sp-destruct.result19
-rw-r--r--mysql-test/r/sp-dynamic.result18
-rw-r--r--mysql-test/r/sp-error.result34
-rw-r--r--mysql-test/r/sp-prelocking.result65
-rw-r--r--mysql-test/r/sp-security.result36
-rw-r--r--mysql-test/r/sp-vars.result67
-rw-r--r--mysql-test/r/sp.result588
-rw-r--r--mysql-test/r/sp_gis.result4
-rw-r--r--mysql-test/r/sp_notembedded.result23
-rw-r--r--mysql-test/r/sp_trans.result2
-rw-r--r--mysql-test/r/sql_mode.result43
-rw-r--r--mysql-test/r/ssl-big.result3
-rw-r--r--mysql-test/r/ssl.result4
-rw-r--r--mysql-test/r/ssl_8k_key.result2
-rw-r--r--mysql-test/r/ssl_compress.result4
-rw-r--r--mysql-test/r/status.result75
-rw-r--r--mysql-test/r/strict.result32
-rw-r--r--mysql-test/r/subselect.result110
-rw-r--r--mysql-test/r/subselect3.result53
-rw-r--r--mysql-test/r/subselect_notembedded.result2
-rw-r--r--mysql-test/r/symlink.result22
-rw-r--r--mysql-test/r/system_mysql_db.result8
-rw-r--r--mysql-test/r/temp_table.result4
-rw-r--r--mysql-test/r/trigger-compat.result6
-rw-r--r--mysql-test/r/trigger-grant.result18
-rw-r--r--mysql-test/r/trigger-trans.result59
-rw-r--r--mysql-test/r/trigger.result581
-rw-r--r--mysql-test/r/type_bit.result80
-rw-r--r--mysql-test/r/type_date.result27
-rw-r--r--mysql-test/r/type_datetime.result133
-rw-r--r--mysql-test/r/type_decimal.result9
-rw-r--r--mysql-test/r/type_enum.result78
-rw-r--r--mysql-test/r/type_float.result33
-rw-r--r--mysql-test/r/type_newdecimal.result69
-rw-r--r--mysql-test/r/type_ranges.result26
-rw-r--r--mysql-test/r/type_time.result43
-rw-r--r--mysql-test/r/type_timestamp.result14
-rw-r--r--mysql-test/r/udf.result47
-rw-r--r--mysql-test/r/union.result4
-rw-r--r--mysql-test/r/unsafe_binlog_innodb.result2
-rw-r--r--mysql-test/r/user_var.result38
-rw-r--r--mysql-test/r/varbinary.result16
-rw-r--r--mysql-test/r/variables.result31
-rw-r--r--mysql-test/r/view.result423
-rw-r--r--mysql-test/r/view_grant.result84
-rw-r--r--mysql-test/r/warnings.result2
-rw-r--r--mysql-test/r/windows_shm.result2
-rw-r--r--mysql-test/r/xml.result146
-rw-r--r--mysql-test/std_data/Index.xml71
-rw-r--r--mysql-test/std_data/ndb_backup50/BACKUP-2-0.1.Databin0 -> 19084 bytes
-rw-r--r--mysql-test/std_data/ndb_backup50/BACKUP-2-0.2.Databin0 -> 16392 bytes
-rw-r--r--mysql-test/std_data/ndb_backup50/BACKUP-2.1.ctlbin0 -> 2592 bytes
-rw-r--r--mysql-test/std_data/ndb_backup50/BACKUP-2.1.logbin0 -> 44 bytes
-rw-r--r--mysql-test/std_data/ndb_backup50/BACKUP-2.2.ctlbin0 -> 2592 bytes
-rw-r--r--mysql-test/std_data/ndb_backup50/BACKUP-2.2.logbin0 -> 44 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51_data_be/BACKUP-1-0.1.Databin0 -> 43068 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51_data_be/BACKUP-1-0.2.Databin0 -> 30276 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.1.ctlbin0 -> 33964 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.1.logbin0 -> 44 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.2.ctlbin0 -> 33964 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.2.logbin0 -> 44 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51_data_le/BACKUP-1-0.1.Databin0 -> 23788 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51_data_le/BACKUP-1-0.2.Databin0 -> 49556 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.1.ctlbin0 -> 33964 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.1.logbin0 -> 44 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.2.ctlbin0 -> 33964 bytes
-rw-r--r--mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.2.logbin0 -> 44 bytes
-rw-r--r--mysql-test/std_data/parts/part_supported_sql_funcs_int_ch1.inc (renamed from mysql-test/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc)0
-rw-r--r--mysql-test/std_data/parts/part_supported_sql_funcs_int_date.inc (renamed from mysql-test/suite/parts/inc/part_supported_sql_funcs_int_date.inc)0
-rw-r--r--mysql-test/std_data/parts/part_supported_sql_funcs_int_float.inc (renamed from mysql-test/suite/parts/inc/part_supported_sql_funcs_int_float.inc)0
-rw-r--r--mysql-test/std_data/parts/part_supported_sql_funcs_int_int.inc (renamed from mysql-test/suite/parts/inc/part_supported_sql_funcs_int_int.inc)0
-rw-r--r--mysql-test/std_data/parts/part_supported_sql_funcs_int_time.inc (renamed from mysql-test/suite/parts/inc/part_supported_sql_funcs_int_time.inc)0
-rw-r--r--mysql-test/std_data/server8k-cert.pem51
-rw-r--r--mysql-test/std_data/server8k-key.pem99
-rw-r--r--mysql-test/suite/binlog/r/binlog_innodb.result171
-rw-r--r--mysql-test/suite/binlog/r/binlog_killed.result12
-rw-r--r--mysql-test/suite/binlog/r/binlog_multi_engine.result86
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_binlog.result1177
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result11393
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result (renamed from mysql-test/r/binlog_row_ctype_ucs.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result (renamed from mysql-test/r/binlog_row_drop_tmp_tbl.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_innodb_stat.result (renamed from mysql-test/r/binlog_row_innodb_stat.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_insert_select.result (renamed from mysql-test/r/binlog_row_insert_select.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result (renamed from mysql-test/r/binlog_row_mix_innodb_myisam.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result (renamed from mysql-test/r/binlog_statement_insert_delayed.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_binlog.result672
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_blackhole.result155
-rwxr-xr-xmysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result11393
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result (renamed from mysql-test/r/binlog_stm_ctype_ucs.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result (renamed from mysql-test/r/binlog_stm_drop_tmp_tbl.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result (renamed from mysql-test/r/binlog_stm_innodb_stat.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_insert_select.result (renamed from mysql-test/r/binlog_stm_insert_select.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result487
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_ps.result20
-rw-r--r--mysql-test/suite/binlog/t/binlog_innodb.test172
-rw-r--r--mysql-test/suite/binlog/t/binlog_killed.test248
-rw-r--r--mysql-test/suite/binlog/t/binlog_multi_engine.test91
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_binlog-master.opt (renamed from mysql-test/t/binlog_row_binlog-master.opt)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_binlog.test (renamed from mysql-test/t/binlog_row_binlog.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_ctype_cp932.test (renamed from mysql-test/t/binlog_row_ctype_cp932.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_ctype_ucs.test (renamed from mysql-test/t/binlog_row_ctype_ucs.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_drop_tmp_tbl.test (renamed from mysql-test/t/binlog_row_drop_tmp_tbl.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_innodb_stat-master.opt (renamed from mysql-test/t/binlog_row_innodb_stat-master.opt)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_innodb_stat.test (renamed from mysql-test/t/binlog_row_innodb_stat.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_insert_select.test (renamed from mysql-test/t/binlog_row_insert_select.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam-master.opt1
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam.test33
-rw-r--r--mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test (renamed from mysql-test/t/binlog_statement_insert_delayed.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_binlog-master.opt (renamed from mysql-test/t/binlog_stm_binlog-master.opt)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_binlog.test (renamed from mysql-test/t/binlog_stm_binlog.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_blackhole.test (renamed from mysql-test/t/binlog_stm_blackhole.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_ctype_cp932.test (renamed from mysql-test/t/binlog_stm_ctype_cp932.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_ctype_ucs.test (renamed from mysql-test/t/binlog_stm_ctype_ucs.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_drop_tmp_tbl.test (renamed from mysql-test/t/binlog_stm_drop_tmp_tbl.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_innodb_stat-master.opt (renamed from mysql-test/t/binlog_stm_innodb_stat-master.opt)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test (renamed from mysql-test/t/binlog_stm_innodb_stat.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_insert_select.test (renamed from mysql-test/t/binlog_stm_insert_select.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam-master.opt1
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test146
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_ps.test26
-rw-r--r--mysql-test/suite/binlog/t/disabled.def11
-rw-r--r--mysql-test/suite/funcs_1/README.txt29
-rw-r--r--mysql-test/suite/funcs_1/datadict/datadict_load.inc17
-rw-r--r--mysql-test/suite/funcs_1/datadict/datadict_master.inc470
-rw-r--r--mysql-test/suite/funcs_1/datadict/datadict_priv.inc107
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/datadict/datadict_tables_error_1044.inc0
-rw-r--r--mysql-test/suite/funcs_1/datadict/processlist_priv.inc434
-rw-r--r--mysql-test/suite/funcs_1/datadict/processlist_val.inc333
-rw-r--r--mysql-test/suite/funcs_1/include/ndb_tb2.inc2
-rw-r--r--mysql-test/suite/funcs_1/r/a_processlist_priv_no_prot.result471
-rw-r--r--mysql-test/suite/funcs_1/r/a_processlist_val_no_prot.result174
-rw-r--r--mysql-test/suite/funcs_1/r/b_processlist_priv_ps.result471
-rw-r--r--mysql-test/suite/funcs_1/r/b_processlist_val_ps.result174
-rw-r--r--mysql-test/suite/funcs_1/r/datadict_help_tables_build.result22
-rw-r--r--mysql-test/suite/funcs_1/r/datadict_help_tables_dev.result18
-rw-r--r--mysql-test/suite/funcs_1/r/innodb__datadict.result936
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_func_view.result1334
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/r/innodb_storedproc_02.result0
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/r/innodb_storedproc_03.result0
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_storedproc_06.result3
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/r/innodb_storedproc_07.result8
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/r/innodb_storedproc_08.result108
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/r/innodb_storedproc_10.result4
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_0102.result2
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_03e.result26
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_08.result5
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_views.result587
-rw-r--r--mysql-test/suite/funcs_1/r/memory__datadict.result768
-rw-r--r--mysql-test/suite/funcs_1/r/memory_func_view.result1334
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/r/memory_storedproc_02.result0
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/r/memory_storedproc_03.result0
-rw-r--r--mysql-test/suite/funcs_1/r/memory_storedproc_06.result3
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/r/memory_storedproc_07.result8
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/r/memory_storedproc_08.result108
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/r/memory_storedproc_10.result4
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_0102.result2
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_03e.result26
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_08.result5
-rw-r--r--mysql-test/suite/funcs_1/r/memory_views.result587
-rw-r--r--mysql-test/suite/funcs_1/r/myisam__datadict.result768
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_func_view.result1334
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/r/myisam_storedproc_02.result0
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/r/myisam_storedproc_03.result0
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_storedproc_06.result3
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/r/myisam_storedproc_07.result8
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/r/myisam_storedproc_08.result108
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/r/myisam_storedproc_10.result4
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_0102.result2
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_03e.result26
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_08.result5
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_views.result545
-rw-r--r--mysql-test/suite/funcs_1/r/ndb__datadict.result1226
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_cursors.result2
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_func_view.result1334
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_storedproc_06.result3
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_storedproc_07.result8
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_storedproc_08.result108
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_storedproc_10.result4
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_trig_0102.result4
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_trig_03.result2
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_trig_03e.result26
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_trig_0407.result2
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_trig_08.result7
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_trig_09.result2
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_trig_1011ext.result2
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_views.result643
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/storedproc/storedproc_02.inc0
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/storedproc/storedproc_03.inc0
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/storedproc/storedproc_06.inc5
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/storedproc/storedproc_07.inc0
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/storedproc/storedproc_08.inc0
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/storedproc/storedproc_08_show.inc0
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/storedproc/storedproc_10.inc4
-rw-r--r--mysql-test/suite/funcs_1/t/a_processlist_priv_no_prot.test36
-rw-r--r--mysql-test/suite/funcs_1/t/a_processlist_val_no_prot.test31
-rw-r--r--mysql-test/suite/funcs_1/t/b_processlist_priv_ps.test35
-rw-r--r--mysql-test/suite/funcs_1/t/b_processlist_val_ps.test30
-rw-r--r--mysql-test/suite/funcs_1/t/datadict_help_tables_build.test73
-rw-r--r--mysql-test/suite/funcs_1/t/datadict_help_tables_dev.test27
-rw-r--r--mysql-test/suite/funcs_1/t/innodb__datadict.test4
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/t/innodb_storedproc_02.test0
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/t/innodb_storedproc_03.test0
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/t/innodb_storedproc_06.test0
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/t/innodb_storedproc_07.test0
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/t/innodb_storedproc_08.test0
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/t/innodb_storedproc_10.test0
-rw-r--r--mysql-test/suite/funcs_1/t/memory__datadict.test4
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/t/memory_storedproc_02.test0
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/t/memory_storedproc_03.test0
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/t/memory_storedproc_06.test0
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/t/memory_storedproc_07.test0
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/t/memory_storedproc_08.test0
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/t/memory_storedproc_10.test0
-rw-r--r--mysql-test/suite/funcs_1/t/myisam__datadict.test5
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/t/myisam_storedproc_02.test0
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/t/myisam_storedproc_03.test0
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/t/myisam_storedproc_06.test0
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/t/myisam_storedproc_07.test0
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/t/myisam_storedproc_08.test0
-rwxr-xr-x[-rw-r--r--]mysql-test/suite/funcs_1/t/myisam_storedproc_10.test0
-rw-r--r--mysql-test/suite/funcs_1/t/ndb__datadict.test4
-rw-r--r--mysql-test/suite/funcs_1/t/suite.opt2
-rw-r--r--mysql-test/suite/funcs_1/triggers/triggers_0102.inc2
-rw-r--r--mysql-test/suite/funcs_1/views/func_view.inc3
-rw-r--r--mysql-test/suite/funcs_1/views/views_master.inc148
-rw-r--r--mysql-test/suite/funcs_2/r/ndb_charset.result248
-rw-r--r--mysql-test/suite/funcs_2/t/suite.opt2
-rw-r--r--mysql-test/suite/im/r/im_cmd_line.result (renamed from mysql-test/r/im_cmd_line.result)0
-rw-r--r--mysql-test/suite/im/r/im_daemon_life_cycle.result (renamed from mysql-test/r/im_daemon_life_cycle.result)0
-rw-r--r--mysql-test/suite/im/r/im_instance_conf.result (renamed from mysql-test/r/im_instance_conf.result)0
-rw-r--r--mysql-test/suite/im/r/im_life_cycle.result (renamed from mysql-test/r/im_life_cycle.result)0
-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.inc (renamed from mysql-test/include/im_check_env.inc)0
-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.opt (renamed from mysql-test/t/im_daemon_life_cycle-im.opt)0
-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.opt (renamed from mysql-test/t/im_instance_conf-im.opt)0
-rw-r--r--mysql-test/suite/im/t/im_instance_conf.imtest244
-rw-r--r--mysql-test/suite/im/t/im_life_cycle-im.opt (renamed from mysql-test/t/im_life_cycle-im.opt)0
-rw-r--r--mysql-test/suite/im/t/im_life_cycle.imtest205
-rw-r--r--mysql-test/suite/im/t/im_options-im.opt (renamed from mysql-test/t/im_options-im.opt)0
-rw-r--r--mysql-test/suite/im/t/im_options.imtest248
-rw-r--r--mysql-test/suite/im/t/im_utils-im.opt (renamed from mysql-test/t/im_utils-im.opt)0
-rw-r--r--mysql-test/suite/im/t/im_utils.imtest107
-rwxr-xr-xmysql-test/suite/im/t/kill_n_check.sh (renamed from mysql-test/t/kill_n_check.sh)0
-rwxr-xr-xmysql-test/suite/im/t/log.sh (renamed from mysql-test/t/log.sh)0
-rw-r--r--mysql-test/suite/im/t/utils.sh (renamed from mysql-test/t/utils.sh)0
-rwxr-xr-xmysql-test/suite/im/t/wait_for_process.sh (renamed from mysql-test/t/wait_for_process.sh)0
-rwxr-xr-xmysql-test/suite/im/t/wait_for_socket.sh (renamed from mysql-test/t/wait_for_socket.sh)0
-rw-r--r--mysql-test/suite/large_tests/README.TXT13
-rw-r--r--mysql-test/suite/large_tests/r/alter_table.result37
-rw-r--r--mysql-test/suite/large_tests/t/alter_table.test47
-rw-r--r--mysql-test/suite/ndb/r/loaddata_autocom_ndb.result (renamed from mysql-test/r/loaddata_autocom_ndb.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_alter_table.result401
-rw-r--r--mysql-test/suite/ndb/r/ndb_alter_table2.result (renamed from mysql-test/r/ndb_alter_table2.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_alter_table3.result (renamed from mysql-test/r/ndb_alter_table3.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_backup_print.result65
-rw-r--r--mysql-test/suite/ndb/r/ndb_basic.result901
-rw-r--r--mysql-test/suite/ndb/r/ndb_binlog_basic.result48
-rw-r--r--mysql-test/suite/ndb/r/ndb_binlog_ddl_multi.result (renamed from mysql-test/r/ndb_binlog_ddl_multi.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_binlog_discover.result (renamed from mysql-test/r/ndb_binlog_discover.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_binlog_format.result30
-rw-r--r--mysql-test/suite/ndb/r/ndb_binlog_ignore_db.result (renamed from mysql-test/r/ndb_binlog_ignore_db.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_binlog_log_bin.result (renamed from mysql-test/r/ndb_binlog_log_bin.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_binlog_multi.result80
-rw-r--r--mysql-test/suite/ndb/r/ndb_bitfield.result (renamed from mysql-test/r/ndb_bitfield.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_blob.result (renamed from mysql-test/r/ndb_blob.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_blob_partition.result (renamed from mysql-test/r/ndb_blob_partition.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_bug26793.result8
-rw-r--r--mysql-test/suite/ndb/r/ndb_cache.result (renamed from mysql-test/r/ndb_cache.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_cache2.result (renamed from mysql-test/r/ndb_cache2.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_cache_multi.result (renamed from mysql-test/r/ndb_cache_multi.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_cache_multi2.result (renamed from mysql-test/r/ndb_cache_multi2.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_charset.result (renamed from mysql-test/r/ndb_charset.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_condition_pushdown.result1892
-rw-r--r--mysql-test/suite/ndb/r/ndb_config.result (renamed from mysql-test/r/ndb_config.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_config2.result (renamed from mysql-test/r/ndb_config2.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_cursor.result (renamed from mysql-test/r/ndb_cursor.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_database.result (renamed from mysql-test/r/ndb_database.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_dd_alter.result560
-rw-r--r--mysql-test/suite/ndb/r/ndb_dd_backuprestore.result487
-rw-r--r--mysql-test/suite/ndb/r/ndb_dd_basic.result513
-rw-r--r--mysql-test/suite/ndb/r/ndb_dd_ddl.result238
-rw-r--r--mysql-test/suite/ndb/r/ndb_dd_disk2memory.result (renamed from mysql-test/r/ndb_dd_disk2memory.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_dd_dump.result452
-rw-r--r--mysql-test/suite/ndb/r/ndb_dd_sql_features.result (renamed from mysql-test/r/ndb_dd_sql_features.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_gis.result1100
-rw-r--r--mysql-test/suite/ndb/r/ndb_grant.result (renamed from mysql-test/r/ndb_grant.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_index.result (renamed from mysql-test/r/ndb_index.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_index_ordered.result (renamed from mysql-test/r/ndb_index_ordered.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_index_unique.result (renamed from mysql-test/r/ndb_index_unique.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_insert.result828
-rw-r--r--mysql-test/suite/ndb/r/ndb_limit.result (renamed from mysql-test/r/ndb_limit.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_load.result (renamed from mysql-test/r/ndb_load.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_loaddatalocal.result (renamed from mysql-test/r/ndb_loaddatalocal.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_lock.result (renamed from mysql-test/r/ndb_lock.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_minmax.result (renamed from mysql-test/r/ndb_minmax.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_multi.result (renamed from mysql-test/r/ndb_multi.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_multi_row.result (renamed from mysql-test/r/ndb_multi_row.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_partition_error.result (renamed from mysql-test/r/ndb_partition_error.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_partition_error2.result (renamed from mysql-test/r/ndb_partition_error2.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_partition_key.result (renamed from mysql-test/r/ndb_partition_key.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_partition_list.result (renamed from mysql-test/r/ndb_partition_list.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_partition_range.result263
-rw-r--r--mysql-test/suite/ndb/r/ndb_read_multi_range.result494
-rw-r--r--mysql-test/suite/ndb/r/ndb_rename.result (renamed from mysql-test/r/ndb_rename.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_replace.result (renamed from mysql-test/r/ndb_replace.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_restore.result490
-rw-r--r--mysql-test/suite/ndb/r/ndb_restore_compat.result119
-rw-r--r--mysql-test/suite/ndb/r/ndb_restore_different_endian_data.result200
-rw-r--r--mysql-test/suite/ndb/r/ndb_restore_partition.result (renamed from mysql-test/r/ndb_restore_partition.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_restore_print.result (renamed from mysql-test/r/ndb_restore_print.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_row_format.result65
-rw-r--r--mysql-test/suite/ndb/r/ndb_single_user.result119
-rw-r--r--mysql-test/suite/ndb/r/ndb_sp.result44
-rw-r--r--mysql-test/suite/ndb/r/ndb_subquery.result (renamed from mysql-test/r/ndb_subquery.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_temporary.result21
-rw-r--r--mysql-test/suite/ndb/r/ndb_transaction.result (renamed from mysql-test/r/ndb_transaction.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_trigger.result315
-rw-r--r--mysql-test/suite/ndb/r/ndb_truncate.result (renamed from mysql-test/r/ndb_truncate.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_types.result (renamed from mysql-test/r/ndb_types.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_update.result88
-rw-r--r--mysql-test/suite/ndb/r/ndb_view.result (renamed from mysql-test/r/ndb_view.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndbapi.result (renamed from mysql-test/r/ndbapi.result)0
-rw-r--r--mysql-test/suite/ndb/r/partition_03ndb.result (renamed from mysql-test/r/partition_03ndb.result)0
-rw-r--r--mysql-test/suite/ndb/r/ps_7ndb.result3127
-rw-r--r--mysql-test/suite/ndb/r/strict_autoinc_5ndb.result (renamed from mysql-test/r/strict_autoinc_5ndb.result)0
-rw-r--r--mysql-test/suite/ndb/t/disabled.def21
-rw-r--r--mysql-test/suite/ndb/t/loaddata_autocom_ndb.test (renamed from mysql-test/t/loaddata_autocom_ndb.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_alter_table.test438
-rw-r--r--mysql-test/suite/ndb/t/ndb_alter_table2.test84
-rw-r--r--mysql-test/suite/ndb/t/ndb_alter_table3.test48
-rw-r--r--mysql-test/suite/ndb/t/ndb_backup_print.test68
-rw-r--r--mysql-test/suite/ndb/t/ndb_basic.test843
-rw-r--r--mysql-test/suite/ndb/t/ndb_binlog_basic.test80
-rw-r--r--mysql-test/suite/ndb/t/ndb_binlog_ddl_multi.test190
-rw-r--r--mysql-test/suite/ndb/t/ndb_binlog_discover.test36
-rw-r--r--mysql-test/suite/ndb/t/ndb_binlog_format.test33
-rw-r--r--mysql-test/suite/ndb/t/ndb_binlog_ignore_db-master.opt (renamed from mysql-test/t/ndb_binlog_ignore_db-master.opt)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_binlog_ignore_db.test16
-rw-r--r--mysql-test/suite/ndb/t/ndb_binlog_log_bin.test49
-rw-r--r--mysql-test/suite/ndb/t/ndb_binlog_multi.test82
-rw-r--r--mysql-test/suite/ndb/t/ndb_bitfield.test (renamed from mysql-test/t/ndb_bitfield.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_blob.test (renamed from mysql-test/t/ndb_blob.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_blob_partition.test (renamed from mysql-test/t/ndb_blob_partition.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_bug26793.test35
-rw-r--r--mysql-test/suite/ndb/t/ndb_cache.test (renamed from mysql-test/t/ndb_cache.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_cache2.test (renamed from mysql-test/t/ndb_cache2.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_cache_multi.test71
-rw-r--r--mysql-test/suite/ndb/t/ndb_cache_multi2.test125
-rw-r--r--mysql-test/suite/ndb/t/ndb_charset.test257
-rw-r--r--mysql-test/suite/ndb/t/ndb_condition_pushdown.test (renamed from mysql-test/t/ndb_condition_pushdown.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_config.test (renamed from mysql-test/t/ndb_config.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_config2.test (renamed from mysql-test/t/ndb_config2.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_cursor.test (renamed from mysql-test/t/ndb_cursor.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_database.test (renamed from mysql-test/t/ndb_database.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_dd_alter.test (renamed from mysql-test/t/ndb_dd_alter.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_dd_backuprestore.test (renamed from mysql-test/t/ndb_dd_backuprestore.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_dd_basic.test460
-rw-r--r--mysql-test/suite/ndb/t/ndb_dd_ddl.test370
-rw-r--r--mysql-test/suite/ndb/t/ndb_dd_disk2memory.test (renamed from mysql-test/t/ndb_dd_disk2memory.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_dd_dump.test289
-rw-r--r--mysql-test/suite/ndb/t/ndb_dd_sql_features.test (renamed from mysql-test/t/ndb_dd_sql_features.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_gis.test (renamed from mysql-test/t/ndb_gis.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_grant.later (renamed from mysql-test/t/ndb_grant.later)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_index.test (renamed from mysql-test/t/ndb_index.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_index_ordered.test (renamed from mysql-test/t/ndb_index_ordered.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_index_unique.test361
-rw-r--r--mysql-test/suite/ndb/t/ndb_insert.test779
-rw-r--r--mysql-test/suite/ndb/t/ndb_limit.test (renamed from mysql-test/t/ndb_limit.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_load.test (renamed from mysql-test/t/ndb_load.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_loaddatalocal.test (renamed from mysql-test/t/ndb_loaddatalocal.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_lock.test (renamed from mysql-test/t/ndb_lock.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_minmax.test (renamed from mysql-test/t/ndb_minmax.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_multi.test125
-rw-r--r--mysql-test/suite/ndb/t/ndb_multi_row.test75
-rw-r--r--mysql-test/suite/ndb/t/ndb_partition_error.test (renamed from mysql-test/t/ndb_partition_error.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_partition_error2-master.opt (renamed from mysql-test/t/ndb_partition_error2-master.opt)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_partition_error2.test (renamed from mysql-test/t/ndb_partition_error2.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_partition_key.test (renamed from mysql-test/t/ndb_partition_key.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_partition_list.test (renamed from mysql-test/t/ndb_partition_list.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_partition_range.test (renamed from mysql-test/t/ndb_partition_range.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_read_multi_range.test340
-rw-r--r--mysql-test/suite/ndb/t/ndb_rename.test (renamed from mysql-test/t/ndb_rename.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_replace.test104
-rw-r--r--mysql-test/suite/ndb/t/ndb_restore.test408
-rw-r--r--mysql-test/suite/ndb/t/ndb_restore_compat.test67
-rw-r--r--mysql-test/suite/ndb/t/ndb_restore_different_endian_data.test185
-rw-r--r--mysql-test/suite/ndb/t/ndb_restore_partition-master.opt (renamed from mysql-test/t/ndb_restore_partition-master.opt)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_restore_partition.test (renamed from mysql-test/t/ndb_restore_partition.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_restore_print.test (renamed from mysql-test/t/ndb_restore_print.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_row_format.test (renamed from mysql-test/t/ndb_row_format.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_single_user.test173
-rw-r--r--mysql-test/suite/ndb/t/ndb_sp.test (renamed from mysql-test/t/ndb_sp.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_subquery.test (renamed from mysql-test/t/ndb_subquery.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_temporary.test (renamed from mysql-test/t/ndb_temporary.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_transaction.test (renamed from mysql-test/t/ndb_transaction.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_trigger.test221
-rw-r--r--mysql-test/suite/ndb/t/ndb_truncate.test (renamed from mysql-test/t/ndb_truncate.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_types.test (renamed from mysql-test/t/ndb_types.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_update.test89
-rw-r--r--mysql-test/suite/ndb/t/ndb_view.test (renamed from mysql-test/t/ndb_view.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndbapi.test (renamed from mysql-test/t/ndbapi.test)0
-rw-r--r--mysql-test/suite/ndb/t/partition_03ndb.test (renamed from mysql-test/t/partition_03ndb.test)0
-rw-r--r--mysql-test/suite/ndb/t/ps_7ndb.test (renamed from mysql-test/t/ps_7ndb.test)0
-rw-r--r--mysql-test/suite/ndb/t/strict_autoinc_5ndb.test (renamed from mysql-test/t/strict_autoinc_5ndb.test)0
-rw-r--r--mysql-test/suite/ndb_team/r/ndb_autodiscover.result397
-rw-r--r--mysql-test/suite/ndb_team/r/ndb_autodiscover2.result (renamed from mysql-test/r/ndb_autodiscover2.result)0
-rw-r--r--mysql-test/suite/ndb_team/r/ndb_autodiscover3.result (renamed from mysql-test/r/ndb_autodiscover3.result)0
-rw-r--r--mysql-test/suite/ndb_team/t/disabled.def17
-rw-r--r--mysql-test/suite/ndb_team/t/ndb_autodiscover.test (renamed from mysql-test/t/ndb_autodiscover.test)0
-rw-r--r--mysql-test/suite/ndb_team/t/ndb_autodiscover2-master.opt (renamed from mysql-test/t/ndb_autodiscover2-master.opt)0
-rw-r--r--mysql-test/suite/ndb_team/t/ndb_autodiscover2.test (renamed from mysql-test/t/ndb_autodiscover2.test)0
-rw-r--r--mysql-test/suite/ndb_team/t/ndb_autodiscover3.test104
-rw-r--r--mysql-test/suite/parts/inc/part_blocked_sql_funcs_main.inc24
-rw-r--r--mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc66
-rw-r--r--mysql-test/suite/parts/inc/partition_alter3.inc6
-rw-r--r--mysql-test/suite/parts/inc/partition_alter_1.inc9
-rw-r--r--mysql-test/suite/parts/inc/partition_blocked_sql_funcs.inc34
-rw-r--r--mysql-test/suite/parts/inc/partition_check.inc18
-rw-r--r--mysql-test/suite/parts/inc/partition_date.inc4
-rw-r--r--mysql-test/suite/parts/inc/partition_datetime.inc4
-rw-r--r--mysql-test/suite/parts/inc/partition_decimal.inc14
-rw-r--r--mysql-test/suite/parts/inc/partition_directory.inc27
-rw-r--r--mysql-test/suite/parts/inc/partition_double.inc14
-rw-r--r--mysql-test/suite/parts/inc/partition_enum.inc27
-rw-r--r--mysql-test/suite/parts/inc/partition_float.inc14
-rw-r--r--mysql-test/suite/parts/inc/partition_layout_check1.inc1
-rw-r--r--mysql-test/suite/parts/inc/partition_layout_check2.inc1
-rw-r--r--mysql-test/suite/parts/inc/partition_methods1.inc32
-rw-r--r--mysql-test/suite/parts/inc/partition_set.inc38
-rw-r--r--mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc11
-rw-r--r--mysql-test/suite/parts/inc/partition_syntax.inc10
-rw-r--r--mysql-test/suite/parts/inc/partition_syntax_1.inc24
-rw-r--r--mysql-test/suite/parts/inc/partition_time.inc4
-rw-r--r--mysql-test/suite/parts/inc/partition_timestamp.inc4
-rw-r--r--mysql-test/suite/parts/inc/partition_value.inc12
-rw-r--r--mysql-test/suite/parts/r/part_blocked_sql_func_innodb.result996
-rw-r--r--mysql-test/suite/parts/r/part_blocked_sql_func_myisam.result996
-rw-r--r--mysql-test/suite/parts/r/part_supported_sql_func_innodb.result4268
-rw-r--r--mysql-test/suite/parts/r/part_supported_sql_func_myisam.result4268
-rw-r--r--mysql-test/suite/parts/r/partition_alter3_innodb.result157
-rw-r--r--mysql-test/suite/parts/r/partition_alter3_myisam.result533
-rw-r--r--mysql-test/suite/parts/r/partition_basic_innodb.result1343
-rw-r--r--mysql-test/suite/parts/r/partition_basic_myisam.result1049
-rw-r--r--mysql-test/suite/parts/r/partition_datetime_innodb.result32
-rw-r--r--mysql-test/suite/parts/r/partition_datetime_myisam.result32
-rw-r--r--mysql-test/suite/parts/r/partition_decimal_innodb.result92
-rw-r--r--mysql-test/suite/parts/r/partition_decimal_myisam.result92
-rw-r--r--mysql-test/suite/parts/r/partition_float_myisam.result292
-rw-r--r--mysql-test/suite/parts/r/partition_syntax_innodb.result10
-rw-r--r--mysql-test/suite/parts/r/partition_syntax_myisam.result10
-rw-r--r--mysql-test/suite/parts/r/rpl_partition.result173
-rw-r--r--mysql-test/suite/parts/t/disabled.def6
-rw-r--r--mysql-test/suite/parts/t/partition_char_innodb.test1
-rw-r--r--mysql-test/suite/parts/t/partition_datetime_innodb.test1
-rw-r--r--mysql-test/suite/parts/t/partition_decimal_innodb.test2
-rw-r--r--mysql-test/suite/parts/t/partition_float_innodb.test2
-rw-r--r--mysql-test/suite/parts/t/partition_int_innodb.test1
-rw-r--r--mysql-test/suite/parts/t/partition_special_innodb.test1
-rw-r--r--mysql-test/suite/parts/t/rpl_partition.test161
-rw-r--r--mysql-test/suite/row_lock/include/row_lock.inc83
-rw-r--r--mysql-test/suite/row_lock/include/row_lock_big_tab.inc94
-rw-r--r--mysql-test/suite/row_lock/include/row_lock_big_tab_1.inc93
-rw-r--r--mysql-test/suite/row_lock/include/row_lock_big_tab_2.inc93
-rw-r--r--mysql-test/suite/row_lock/include/row_lock_trig.inc96
-rw-r--r--mysql-test/suite/row_lock/include/row_lock_view.inc89
-rw-r--r--mysql-test/suite/row_lock/include/row_lock_view_mix.inc92
-rw-r--r--mysql-test/suite/row_lock/include/row_lock_view_storedp.inc126
-rw-r--r--mysql-test/suite/row_lock/include/row_lock_view_trig.inc99
-rw-r--r--mysql-test/suite/row_lock/r/innodb_row_lock_1.result142
-rw-r--r--mysql-test/suite/row_lock/r/innodb_row_lock_2.result32
-rw-r--r--mysql-test/suite/row_lock/r/innodb_row_lock_3.result32
-rw-r--r--mysql-test/suite/row_lock/r/innodb_row_lock_4.result142
-rw-r--r--mysql-test/suite/row_lock/r/innodb_row_lock_5.result32
-rw-r--r--mysql-test/suite/row_lock/r/innodb_row_lock_big_tab.result97
-rw-r--r--mysql-test/suite/row_lock/r/innodb_row_lock_big_tab_1.result145
-rw-r--r--mysql-test/suite/row_lock/r/innodb_row_lock_big_tab_2.result113
-rw-r--r--mysql-test/suite/row_lock/r/innodb_row_lock_trig_1.result151
-rw-r--r--mysql-test/suite/row_lock/r/innodb_row_lock_trig_2.result37
-rw-r--r--mysql-test/suite/row_lock/r/innodb_row_lock_view_1.result34
-rw-r--r--mysql-test/suite/row_lock/r/innodb_row_lock_view_2.result40
-rw-r--r--mysql-test/suite/row_lock/r/innodb_row_lock_view_mix_1.result48
-rw-r--r--mysql-test/suite/row_lock/r/innodb_row_lock_view_mix_2.result40
-rw-r--r--mysql-test/suite/row_lock/r/innodb_row_lock_view_storedp_1.result312
-rw-r--r--mysql-test/suite/row_lock/r/innodb_row_lock_view_storedp_2.result47
-rw-r--r--mysql-test/suite/row_lock/r/innodb_row_lock_view_trig_1.result183
-rw-r--r--mysql-test/suite/row_lock/r/innodb_row_lock_view_trig_2.result38
-rw-r--r--mysql-test/suite/row_lock/r/ndb_row_lock_1.result139
-rw-r--r--mysql-test/suite/row_lock/r/ndb_row_lock_2.result31
-rw-r--r--mysql-test/suite/row_lock/r/ndb_row_lock_3.result30
-rw-r--r--mysql-test/suite/row_lock/r/ndb_row_lock_4.result139
-rw-r--r--mysql-test/suite/row_lock/r/ndb_row_lock_5.result30
-rw-r--r--mysql-test/suite/row_lock/r/ndb_row_lock_big_tab.result177
-rw-r--r--mysql-test/suite/row_lock/r/ndb_row_lock_big_tab_1.result357
-rw-r--r--mysql-test/suite/row_lock/r/ndb_row_lock_big_tab_2.result255
-rw-r--r--mysql-test/suite/row_lock/r/ndb_row_lock_trig_1.result148
-rw-r--r--mysql-test/suite/row_lock/r/ndb_row_lock_trig_2.result35
-rw-r--r--mysql-test/suite/row_lock/r/ndb_row_lock_view_1.result194
-rw-r--r--mysql-test/suite/row_lock/r/ndb_row_lock_view_2.result200
-rw-r--r--mysql-test/suite/row_lock/r/ndb_row_lock_view_mix_1.result169
-rw-r--r--mysql-test/suite/row_lock/r/ndb_row_lock_view_mix_2.result38
-rw-r--r--mysql-test/suite/row_lock/r/ndb_row_lock_view_storedp_1.result309
-rw-r--r--mysql-test/suite/row_lock/r/ndb_row_lock_view_storedp_2.result46
-rw-r--r--mysql-test/suite/row_lock/r/ndb_row_lock_view_trig_1.result180
-rw-r--r--mysql-test/suite/row_lock/r/ndb_row_lock_view_trig_2.result36
-rw-r--r--mysql-test/suite/row_lock/readme.txt9
-rw-r--r--mysql-test/suite/row_lock/summary_of_sel_test.txt36
-rw-r--r--mysql-test/suite/row_lock/t/innodb_row_lock_1.test9
-rw-r--r--mysql-test/suite/row_lock/t/innodb_row_lock_2.test9
-rw-r--r--mysql-test/suite/row_lock/t/innodb_row_lock_3.test9
-rw-r--r--mysql-test/suite/row_lock/t/innodb_row_lock_4.test9
-rw-r--r--mysql-test/suite/row_lock/t/innodb_row_lock_5.test9
-rw-r--r--mysql-test/suite/row_lock/t/innodb_row_lock_big_tab.test9
-rw-r--r--mysql-test/suite/row_lock/t/innodb_row_lock_big_tab_1.test10
-rw-r--r--mysql-test/suite/row_lock/t/innodb_row_lock_big_tab_2.test10
-rw-r--r--mysql-test/suite/row_lock/t/innodb_row_lock_trig_1.test9
-rw-r--r--mysql-test/suite/row_lock/t/innodb_row_lock_trig_2.test9
-rw-r--r--mysql-test/suite/row_lock/t/innodb_row_lock_view_1.test9
-rw-r--r--mysql-test/suite/row_lock/t/innodb_row_lock_view_2.test9
-rw-r--r--mysql-test/suite/row_lock/t/innodb_row_lock_view_mix_1.test9
-rw-r--r--mysql-test/suite/row_lock/t/innodb_row_lock_view_mix_2.test10
-rw-r--r--mysql-test/suite/row_lock/t/innodb_row_lock_view_storedp_1.test9
-rw-r--r--mysql-test/suite/row_lock/t/innodb_row_lock_view_storedp_2.test9
-rw-r--r--mysql-test/suite/row_lock/t/innodb_row_lock_view_trig_1.test9
-rw-r--r--mysql-test/suite/row_lock/t/innodb_row_lock_view_trig_2.test9
-rw-r--r--mysql-test/suite/row_lock/t/ndb_row_lock_1.test6
-rw-r--r--mysql-test/suite/row_lock/t/ndb_row_lock_2.test6
-rw-r--r--mysql-test/suite/row_lock/t/ndb_row_lock_3.test6
-rw-r--r--mysql-test/suite/row_lock/t/ndb_row_lock_4.test6
-rw-r--r--mysql-test/suite/row_lock/t/ndb_row_lock_5.test6
-rw-r--r--mysql-test/suite/row_lock/t/ndb_row_lock_big_tab.test6
-rw-r--r--mysql-test/suite/row_lock/t/ndb_row_lock_big_tab_1.test7
-rw-r--r--mysql-test/suite/row_lock/t/ndb_row_lock_big_tab_2.test7
-rw-r--r--mysql-test/suite/row_lock/t/ndb_row_lock_trig_1.test6
-rw-r--r--mysql-test/suite/row_lock/t/ndb_row_lock_trig_2.test6
-rw-r--r--mysql-test/suite/row_lock/t/ndb_row_lock_view_1.test7
-rw-r--r--mysql-test/suite/row_lock/t/ndb_row_lock_view_2.test6
-rw-r--r--mysql-test/suite/row_lock/t/ndb_row_lock_view_mix_1.test6
-rw-r--r--mysql-test/suite/row_lock/t/ndb_row_lock_view_mix_2.test6
-rw-r--r--mysql-test/suite/row_lock/t/ndb_row_lock_view_storedp_1.test6
-rw-r--r--mysql-test/suite/row_lock/t/ndb_row_lock_view_storedp_2.test6
-rw-r--r--mysql-test/suite/row_lock/t/ndb_row_lock_view_trig_1.test6
-rw-r--r--mysql-test/suite/row_lock/t/ndb_row_lock_view_trig_2.test6
-rw-r--r--mysql-test/suite/rpl/include/rpl_mixed_ddl.inc4
-rw-r--r--mysql-test/suite/rpl/include/rpl_mixed_dml.inc10
-rw-r--r--mysql-test/suite/rpl/r/rpl000001.a.result (renamed from mysql-test/r/rpl000001.a.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl000001.b.result (renamed from mysql-test/r/rpl000001.b.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl000010.result (renamed from mysql-test/r/rpl000010.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl000011.result (renamed from mysql-test/r/rpl000011.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl000013.result (renamed from mysql-test/r/rpl000013.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl000017.result (renamed from mysql-test/r/rpl000017.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_000015.result141
-rw-r--r--mysql-test/suite/rpl/r/rpl_EE_err.result (renamed from mysql-test/r/rpl_EE_err.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_LD_INFILE.result (renamed from mysql-test/r/rpl_LD_INFILE.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_alter.result (renamed from mysql-test/r/rpl_alter.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_alter_db.result (renamed from mysql-test/r/rpl_alter_db.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_auto_increment.result (renamed from mysql-test/r/rpl_auto_increment.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_auto_increment_11932.result (renamed from mysql-test/r/rpl_auto_increment_11932.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_binlog_grant.result50
-rw-r--r--mysql-test/suite/rpl/r/rpl_bit.result (renamed from mysql-test/r/rpl_bit.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_bit_npk.result (renamed from mysql-test/r/rpl_bit_npk.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_bug31076.result65
-rw-r--r--mysql-test/suite/rpl/r/rpl_change_master.result98
-rw-r--r--mysql-test/suite/rpl/r/rpl_charset_sjis.result (renamed from mysql-test/r/rpl_charset_sjis.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_colSize.result179
-rw-r--r--mysql-test/suite/rpl/r/rpl_commit_after_flush.result (renamed from mysql-test/r/rpl_commit_after_flush.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_database.result (renamed from mysql-test/r/rpl_create_database.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_critical_errors.result (renamed from mysql-test/r/rpl_critical_errors.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_critical_errors.result.txt (renamed from mysql-test/r/rpl_critical_errors.result.txt)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_ddl.result (renamed from mysql-test/r/rpl_ddl.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_deadlock_innodb.result211
-rw-r--r--mysql-test/suite/rpl/r/rpl_delete_no_where.result (renamed from mysql-test/r/rpl_delete_no_where.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_do_grant.result (renamed from mysql-test/r/rpl_do_grant.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_drop.result (renamed from mysql-test/r/rpl_drop.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_drop_db.result (renamed from mysql-test/r/rpl_drop_db.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_drop_temp.result (renamed from mysql-test/r/rpl_drop_temp.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_dual_pos_advance.result (renamed from mysql-test/r/rpl_dual_pos_advance.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_empty_master_crash.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_err_ignoredtable.result (renamed from mysql-test/r/rpl_err_ignoredtable.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_events.result203
-rw-r--r--mysql-test/suite/rpl/r/rpl_extraCol_innodb.result848
-rw-r--r--mysql-test/suite/rpl/r/rpl_extraCol_myisam.result848
-rw-r--r--mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.resultbin0 -> 38226 bytes
-rw-r--r--mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.resultbin0 -> 38226 bytes
-rw-r--r--mysql-test/suite/rpl/r/rpl_failed_optimize.result24
-rw-r--r--mysql-test/suite/rpl/r/rpl_flushlog_loop.result58
-rw-r--r--mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result (renamed from mysql-test/r/rpl_foreign_key_innodb.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_free_items.result (renamed from mysql-test/r/rpl_free_items.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_get_lock.result (renamed from mysql-test/r/rpl_get_lock.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_grant.result82
-rw-r--r--mysql-test/suite/rpl/r/rpl_ignore_grant.result (renamed from mysql-test/r/rpl_ignore_grant.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_ignore_revoke.result (renamed from mysql-test/r/rpl_ignore_revoke.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_ignore_table.result (renamed from mysql-test/r/rpl_ignore_table.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_ignore_table_update.result (renamed from mysql-test/r/rpl_ignore_table_update.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_incident.result114
-rw-r--r--mysql-test/suite/rpl/r/rpl_init_slave.result (renamed from mysql-test/r/rpl_init_slave.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb.result83
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_bug28430.result167
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_bug30888.result35
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_bug30919.result1043
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result50
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert.result (renamed from mysql-test/r/rpl_insert.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_id.result (renamed from mysql-test/r/rpl_insert_id.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_id_pk.result (renamed from mysql-test/r/rpl_insert_id_pk.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_ignore.result (renamed from mysql-test/r/rpl_insert_ignore.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_select.result (renamed from mysql-test/r/rpl_insert_select.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_invoked_features.result451
-rw-r--r--mysql-test/suite/rpl/r/rpl_known_bugs_detection.result147
-rw-r--r--mysql-test/suite/rpl/r/rpl_load_from_master.result (renamed from mysql-test/r/rpl_load_from_master.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_load_table_from_master.result (renamed from mysql-test/r/rpl_load_table_from_master.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata.result92
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_charset.result (renamed from mysql-test/r/rpl_loaddata_charset.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_fatal.result90
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_m.result (renamed from mysql-test/r/rpl_loaddata_m.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_s.result (renamed from mysql-test/r/rpl_loaddata_s.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_simple.result (renamed from mysql-test/r/rpl_loaddata_simple.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddatalocal.result (renamed from mysql-test/r/rpl_loaddatalocal.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_loadfile.result (renamed from mysql-test/r/rpl_loadfile.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_locale.result (renamed from mysql-test/r/rpl_locale.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_log_pos.result107
-rw-r--r--mysql-test/suite/rpl/r/rpl_many_optimize.result (renamed from mysql-test/r/rpl_many_optimize.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_master_pos_wait.result (renamed from mysql-test/r/rpl_master_pos_wait.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_misc_functions.result55
-rw-r--r--mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result (renamed from mysql-test/r/rpl_mixed_ddl_dml.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_delete.result (renamed from mysql-test/r/rpl_multi_delete.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_delete2.result (renamed from mysql-test/r/rpl_multi_delete2.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_engine.result (renamed from mysql-test/r/rpl_multi_engine.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_update.result (renamed from mysql-test/r/rpl_multi_update.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_update2.result (renamed from mysql-test/r/rpl_multi_update2.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_update3.result (renamed from mysql-test/r/rpl_multi_update3.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_update4.result (renamed from mysql-test/r/rpl_multi_update4.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_optimize.result (renamed from mysql-test/r/rpl_optimize.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_packet.result32
-rw-r--r--mysql-test/suite/rpl/r/rpl_ps.result80
-rw-r--r--mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result71
-rw-r--r--mysql-test/suite/rpl/r/rpl_read_only.result (renamed from mysql-test/r/rpl_read_only.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_redirect.result40
-rw-r--r--mysql-test/suite/rpl/r/rpl_relay_space_innodb.result (renamed from mysql-test/r/rpl_relay_space_innodb.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_relay_space_myisam.result (renamed from mysql-test/r/rpl_relay_space_myisam.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_relayrotate.result (renamed from mysql-test/r/rpl_relayrotate.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_relayspace.result (renamed from mysql-test/r/rpl_relayspace.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_replicate_do.result113
-rw-r--r--mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result (renamed from mysql-test/r/rpl_replicate_ignore_db.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_rewrt_db.result (renamed from mysql-test/r/rpl_rewrt_db.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_rotate_logs.result213
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_001.result (renamed from mysql-test/r/rpl_row_001.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_4_bytes.result (renamed from mysql-test/r/rpl_row_4_bytes.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_NOW.result (renamed from mysql-test/r/rpl_row_NOW.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_USER.result (renamed from mysql-test/r/rpl_row_USER.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_UUID.result40
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_11bugs-master.opt (renamed from mysql-test/r/rpl_row_basic_11bugs-master.opt)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_11bugs-slave.opt (renamed from mysql-test/r/rpl_row_basic_11bugs-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result244
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result (renamed from mysql-test/r/rpl_row_basic_2myisam.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result (renamed from mysql-test/r/rpl_row_basic_3innodb.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_8partition.result (renamed from mysql-test/r/rpl_row_basic_8partition.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_blob_innodb.result (renamed from mysql-test/r/rpl_row_blob_innodb.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_blob_myisam.result (renamed from mysql-test/r/rpl_row_blob_myisam.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_charset.result (renamed from mysql-test/r/rpl_row_charset.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_colSize.result754
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_create_table.result411
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_delayed_ins.result (renamed from mysql-test/r/rpl_row_delayed_ins.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_drop.result (renamed from mysql-test/r/rpl_row_drop.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_err_ignoredtable.result (renamed from mysql-test/r/rpl_row_err_ignoredtable.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_extraColmaster_ndb.resultbin0 -> 19129 bytes
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result33
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_func001.result (renamed from mysql-test/r/rpl_row_func001.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_func002.result (renamed from mysql-test/r/rpl_row_func002.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_func003.result (renamed from mysql-test/r/rpl_row_func003.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result59
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_insert_delayed.result62
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_loaddata_m.result (renamed from mysql-test/r/rpl_row_loaddata_m.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_log.result294
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_log_innodb.result302
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_max_relay_size.result305
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_multi_query.result (renamed from mysql-test/r/rpl_row_multi_query.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result352
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_mystery22.result (renamed from mysql-test/r/rpl_row_mystery22.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_reset_slave.result176
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp001.result (renamed from mysql-test/r/rpl_row_sp001.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result (renamed from mysql-test/r/rpl_row_sp002_innodb.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp003.result (renamed from mysql-test/r/rpl_row_sp003.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp005.result (renamed from mysql-test/r/rpl_row_sp005.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result (renamed from mysql-test/r/rpl_row_sp006_InnoDB.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result (renamed from mysql-test/r/rpl_row_sp007_innodb.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp008.result (renamed from mysql-test/r/rpl_row_sp008.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp009.result (renamed from mysql-test/r/rpl_row_sp009.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp010.result (renamed from mysql-test/r/rpl_row_sp010.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp011.result (renamed from mysql-test/r/rpl_row_sp011.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp012.result (renamed from mysql-test/r/rpl_row_sp012.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_stop_middle.result (renamed from mysql-test/r/rpl_row_stop_middle.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result (renamed from mysql-test/r/rpl_row_stop_middle_update.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result419
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result419
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_tabledefs_7ndb.result (renamed from mysql-test/r/rpl_row_tabledefs_7ndb.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_trig001.result (renamed from mysql-test/r/rpl_row_trig001.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_trig002.result (renamed from mysql-test/r/rpl_row_trig002.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_trig003.result (renamed from mysql-test/r/rpl_row_trig003.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_trig004.result (renamed from mysql-test/r/rpl_row_trig004.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_unsafe_funcs.result22
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_until.result206
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_view01.result (renamed from mysql-test/r/rpl_row_view01.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_server_id1.result55
-rw-r--r--mysql-test/suite/rpl/r/rpl_server_id2.result57
-rw-r--r--mysql-test/suite/rpl/r/rpl_session_var.result53
-rw-r--r--mysql-test/suite/rpl/r/rpl_set_charset.result (renamed from mysql-test/r/rpl_set_charset.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_sf.result (renamed from mysql-test/r/rpl_sf.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_skip_error.result36
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_skip.result144
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_status.result62
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp.result560
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp004.result (renamed from mysql-test/r/rpl_sp004.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp_effects.result (renamed from mysql-test/r/rpl_sp_effects.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_sporadic_master.result (renamed from mysql-test/r/rpl_sporadic_master.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_ssl.result107
-rw-r--r--mysql-test/suite/rpl/r/rpl_ssl1.result158
-rw-r--r--mysql-test/suite/rpl/r/rpl_start_stop_slave.result (renamed from mysql-test/r/rpl_start_stop_slave.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_000001.result (renamed from mysql-test/r/rpl_stm_000001.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_EE_err2.result (renamed from mysql-test/r/rpl_stm_EE_err2.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_charset.result (renamed from mysql-test/r/rpl_stm_charset.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result (renamed from mysql-test/r/rpl_stm_flsh_tbls.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result140
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_log.result293
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result303
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_multi_query.result (renamed from mysql-test/r/rpl_stm_multi_query.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_mystery22.result (renamed from mysql-test/r/rpl_stm_mystery22.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_no_op.result (renamed from mysql-test/r/rpl_stm_no_op.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_reset_slave.result176
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_until.result206
-rw-r--r--mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result1017
-rw-r--r--mysql-test/suite/rpl/r/rpl_temp_table.result (renamed from mysql-test/r/rpl_temp_table.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporary.result (renamed from mysql-test/r/rpl_temporary.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_timezone.result125
-rw-r--r--mysql-test/suite/rpl/r/rpl_trigger.result973
-rw-r--r--mysql-test/suite/rpl/r/rpl_trunc_temp.result (renamed from mysql-test/r/rpl_trunc_temp.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_truncate_2myisam.result (renamed from mysql-test/r/rpl_truncate_2myisam.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_truncate_3innodb.result (renamed from mysql-test/r/rpl_truncate_3innodb.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_truncate_7ndb_2.result91
-rw-r--r--mysql-test/suite/rpl/r/rpl_udf.result318
-rw-r--r--mysql-test/suite/rpl/r/rpl_user_variables.result266
-rw-r--r--mysql-test/suite/rpl/r/rpl_variables.result (renamed from mysql-test/r/rpl_variables.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_view.result104
-rw-r--r--mysql-test/suite/rpl/t/disabled.def17
-rw-r--r--mysql-test/suite/rpl/t/rpl000010-slave.opt (renamed from mysql-test/t/rpl000010-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl000010.test (renamed from mysql-test/t/rpl000010.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl000011.test (renamed from mysql-test/t/rpl000011.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl000013.test (renamed from mysql-test/t/rpl000013.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl000017-slave.opt (renamed from mysql-test/t/rpl000017-slave.opt)0
-rwxr-xr-xmysql-test/suite/rpl/t/rpl000017-slave.sh (renamed from mysql-test/t/rpl000017-slave.sh)0
-rw-r--r--mysql-test/suite/rpl/t/rpl000017.test (renamed from mysql-test/t/rpl000017.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl000018-master.opt (renamed from mysql-test/t/rpl000018-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl000018-slave.opt (renamed from mysql-test/t/rpl000018-slave.opt)0
-rwxr-xr-xmysql-test/suite/rpl/t/rpl_000015-slave.sh (renamed from mysql-test/t/rpl_000015-slave.sh)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_000015.slave-mi (renamed from mysql-test/t/rpl_000015.slave-mi)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_000015.test40
-rw-r--r--mysql-test/suite/rpl/t/rpl_EE_err.test (renamed from mysql-test/t/rpl_EE_err.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_LD_INFILE.test (renamed from mysql-test/t/rpl_LD_INFILE.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_alter.test (renamed from mysql-test/t/rpl_alter.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_alter_db.test (renamed from mysql-test/t/rpl_alter_db.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_auto_increment-master.opt (renamed from mysql-test/t/rpl_auto_increment-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_auto_increment.test (renamed from mysql-test/t/rpl_auto_increment.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_auto_increment_11932.test (renamed from mysql-test/t/rpl_auto_increment_11932.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_grant.test43
-rw-r--r--mysql-test/suite/rpl/t/rpl_bit.test (renamed from mysql-test/t/rpl_bit.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_bit_npk.test (renamed from mysql-test/t/rpl_bit_npk.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_bug31076.test117
-rw-r--r--mysql-test/suite/rpl/t/rpl_change_master.test37
-rw-r--r--mysql-test/suite/rpl/t/rpl_charset_sjis.test (renamed from mysql-test/t/rpl_charset_sjis.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_colSize.test216
-rw-r--r--mysql-test/suite/rpl/t/rpl_commit_after_flush.test12
-rw-r--r--mysql-test/suite/rpl/t/rpl_create_database-master.opt (renamed from mysql-test/t/rpl_create_database-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_create_database-slave.opt (renamed from mysql-test/t/rpl_create_database-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_create_database.test (renamed from mysql-test/t/rpl_create_database.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_critical_errors.test66
-rw-r--r--mysql-test/suite/rpl/t/rpl_ddl.test (renamed from mysql-test/t/rpl_ddl.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_deadlock_innodb-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_deadlock_innodb.test (renamed from mysql-test/t/rpl_deadlock_innodb.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_delete_no_where.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_do_grant.test (renamed from mysql-test/t/rpl_do_grant.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_drop.test (renamed from mysql-test/t/rpl_drop.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_drop_db.test (renamed from mysql-test/t/rpl_drop_db.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_drop_temp-slave.opt (renamed from mysql-test/t/rpl_drop_temp-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_drop_temp.test (renamed from mysql-test/t/rpl_drop_temp.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_dual_pos_advance-master.opt (renamed from mysql-test/t/rpl_dual_pos_advance-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_dual_pos_advance.test114
-rw-r--r--mysql-test/suite/rpl/t/rpl_empty_master_crash-master.opt (renamed from mysql-test/t/rpl_empty_master_crash-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_empty_master_crash.test14
-rw-r--r--mysql-test/suite/rpl/t/rpl_err_ignoredtable-slave.opt (renamed from mysql-test/t/rpl_err_ignoredtable-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_err_ignoredtable.test66
-rw-r--r--mysql-test/suite/rpl/t/rpl_events.test47
-rw-r--r--mysql-test/suite/rpl/t/rpl_extraCol_innodb-master.opt (renamed from mysql-test/t/rpl_extraCol_innodb-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_extraCol_innodb-slave.opt (renamed from mysql-test/t/rpl_extraCol_innodb-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_extraCol_innodb.test (renamed from mysql-test/t/rpl_extraCol_innodb.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_extraCol_myisam.test (renamed from mysql-test/t/rpl_extraCol_myisam.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_extraColmaster_innodb-master.opt (renamed from mysql-test/t/rpl_auto_increment-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_extraColmaster_innodb-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_extraColmaster_innodb.test15
-rw-r--r--mysql-test/suite/rpl/t/rpl_extraColmaster_myisam.test13
-rw-r--r--mysql-test/suite/rpl/t/rpl_failed_optimize-master.opt (renamed from mysql-test/t/rpl_failed_optimize-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_failed_optimize.test (renamed from mysql-test/t/rpl_failed_optimize.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt (renamed from mysql-test/t/rpl_flushlog_loop-master.opt)0
-rwxr-xr-xmysql-test/suite/rpl/t/rpl_flushlog_loop-master.sh (renamed from mysql-test/t/rpl_flushlog_loop-master.sh)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt (renamed from mysql-test/t/rpl_flushlog_loop-slave.opt)0
-rwxr-xr-xmysql-test/suite/rpl/t/rpl_flushlog_loop-slave.sh (renamed from mysql-test/t/rpl_flushlog_loop-slave.sh)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_flushlog_loop.test49
-rw-r--r--mysql-test/suite/rpl/t/rpl_foreign_key_innodb-slave.opt (renamed from mysql-test/t/rpl_foreign_key_innodb-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test (renamed from mysql-test/t/rpl_foreign_key_innodb.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_free_items-slave.opt (renamed from mysql-test/t/rpl_free_items-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_free_items.test (renamed from mysql-test/t/rpl_free_items.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_get_lock.test (renamed from mysql-test/t/rpl_get_lock.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_grant.test42
-rw-r--r--mysql-test/suite/rpl/t/rpl_ignore_grant-slave.opt (renamed from mysql-test/t/rpl_ignore_grant-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_ignore_grant.test (renamed from mysql-test/t/rpl_ignore_grant.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_ignore_revoke-slave.opt (renamed from mysql-test/t/rpl_ignore_revoke-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_ignore_revoke.test (renamed from mysql-test/t/rpl_ignore_revoke.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_ignore_table-slave.opt (renamed from mysql-test/t/rpl_ignore_table-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_ignore_table.test (renamed from mysql-test/t/rpl_ignore_table.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_ignore_table_update-slave.opt (renamed from mysql-test/t/rpl_ignore_table_update-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_ignore_table_update.test (renamed from mysql-test/t/rpl_ignore_table_update.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_incident-master.opt (renamed from mysql-test/t/rpl_incident-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_incident.test42
-rw-r--r--mysql-test/suite/rpl/t/rpl_init_slave-slave.opt (renamed from mysql-test/t/rpl_init_slave-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_init_slave.test (renamed from mysql-test/t/rpl_init_slave.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb.test115
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb_bug28430-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb_bug28430-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb_bug28430.test154
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb_bug30888.test66
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb_bug30919-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb_bug30919.test67
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb_mixed_ddl.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb_mixed_dml.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert.test (renamed from mysql-test/t/rpl_insert.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_id-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_id.test (renamed from mysql-test/t/rpl_insert_id.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_id_pk-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_id_pk.test (renamed from mysql-test/t/rpl_insert_id_pk.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_ignore-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_ignore.test9
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_select.test (renamed from mysql-test/t/rpl_insert_select.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_invoked_features-master.opt (renamed from mysql-test/t/rpl_insert_id-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_invoked_features-slave.opt (renamed from mysql-test/t/rpl_insert_id_pk-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_invoked_features.test282
-rw-r--r--mysql-test/suite/rpl/t/rpl_known_bugs_detection-master.opt (renamed from mysql-test/t/rpl_known_bugs_detection-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_known_bugs_detection.test93
-rw-r--r--mysql-test/suite/rpl/t/rpl_load_from_master-slave.opt (renamed from mysql-test/t/rpl_load_from_master-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_load_from_master.test (renamed from mysql-test/t/rpl_load_from_master.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_load_table_from_master.test (renamed from mysql-test/t/rpl_load_table_from_master.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata.test (renamed from mysql-test/t/rpl_loaddata.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_charset.test (renamed from mysql-test/t/rpl_loaddata_charset.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_fatal-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_fatal.test29
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_m-master.opt (renamed from mysql-test/t/rpl_loaddata_m-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_m.test (renamed from mysql-test/t/rpl_loaddata_m.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_s-slave.opt (renamed from mysql-test/t/rpl_loaddata_s-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_s.test (renamed from mysql-test/t/rpl_loaddata_s.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_simple.test (renamed from mysql-test/t/rpl_loaddata_simple.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddatalocal.test (renamed from mysql-test/t/rpl_loaddatalocal.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_loadfile.test (renamed from mysql-test/t/rpl_loadfile.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_locale.test (renamed from mysql-test/t/rpl_locale.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_log_pos.test50
-rw-r--r--mysql-test/suite/rpl/t/rpl_many_optimize.test (renamed from mysql-test/t/rpl_many_optimize.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_master_pos_wait.test (renamed from mysql-test/t/rpl_master_pos_wait.test)0
-rwxr-xr-xmysql-test/suite/rpl/t/rpl_misc_functions-slave.sh (renamed from mysql-test/t/rpl_misc_functions-slave.sh)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_misc_functions.test114
-rw-r--r--mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test (renamed from mysql-test/t/rpl_mixed_ddl_dml.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_delete-slave.opt (renamed from mysql-test/t/rpl_multi_delete-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_delete.test (renamed from mysql-test/t/rpl_multi_delete.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_delete2-slave.opt (renamed from mysql-test/t/rpl_multi_delete2-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_delete2.test (renamed from mysql-test/t/rpl_multi_delete2.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_engine-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_engine.test (renamed from mysql-test/t/rpl_multi_engine.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_update.test (renamed from mysql-test/t/rpl_multi_update.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_update2-slave.opt (renamed from mysql-test/t/rpl_multi_update2-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_update2.test10
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_update3.test10
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_update4-slave.opt (renamed from mysql-test/t/rpl_multi_update4-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_update4.test (renamed from mysql-test/t/rpl_multi_update4.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_optimize.test (renamed from mysql-test/t/rpl_optimize.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_packet-master.opt (renamed from mysql-test/t/rpl_packet-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_packet-slave.opt (renamed from mysql-test/t/rpl_packet-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_packet.test81
-rw-r--r--mysql-test/suite/rpl/t/rpl_ps.test146
-rw-r--r--mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test47
-rw-r--r--mysql-test/suite/rpl/t/rpl_read_only-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_read_only.test (renamed from mysql-test/t/rpl_read_only.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_redirect.test45
-rw-r--r--mysql-test/suite/rpl/t/rpl_relay_space_innodb-master.opt (renamed from mysql-test/t/rpl_relay_space_innodb-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_relay_space_innodb-slave.opt (renamed from mysql-test/t/rpl_relay_space_innodb-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_relay_space_innodb.test (renamed from mysql-test/t/rpl_relay_space_innodb.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_relay_space_myisam.test (renamed from mysql-test/t/rpl_relay_space_myisam.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_relayrotate-slave.opt3
-rw-r--r--mysql-test/suite/rpl/t/rpl_relayrotate.test11
-rw-r--r--mysql-test/suite/rpl/t/rpl_relayspace-slave.opt (renamed from mysql-test/t/rpl_relayspace-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_relayspace.test50
-rw-r--r--mysql-test/suite/rpl/t/rpl_replicate_do-slave.opt (renamed from mysql-test/t/rpl_replicate_do-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_replicate_do.test92
-rw-r--r--mysql-test/suite/rpl/t/rpl_replicate_ignore_db-slave.opt (renamed from mysql-test/t/rpl_replicate_ignore_db-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_replicate_ignore_db.test (renamed from mysql-test/t/rpl_replicate_ignore_db.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_rewrt_db-slave.opt (renamed from mysql-test/t/rpl_rewrt_db-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_rewrt_db.test (renamed from mysql-test/t/rpl_rewrt_db.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_rotate_logs-master.opt (renamed from mysql-test/t/rpl_rotate_logs-master.opt)0
-rwxr-xr-xmysql-test/suite/rpl/t/rpl_rotate_logs-slave.sh (renamed from mysql-test/t/rpl_rotate_logs-slave.sh)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_rotate_logs.slave-mi (renamed from mysql-test/t/rpl_rotate_logs.slave-mi)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_rotate_logs.test181
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_001.test9
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_4_bytes-master.opt (renamed from mysql-test/t/rpl_row_4_bytes-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_4_bytes.test (renamed from mysql-test/t/rpl_row_4_bytes.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_NOW.test (renamed from mysql-test/t/rpl_row_NOW.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_USER.test (renamed from mysql-test/t/rpl_row_USER.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_UUID.test9
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_11bugs-master.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_11bugs-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test225
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_2myisam.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_3innodb-slave.opt (renamed from mysql-test/t/rpl_row_basic_3innodb-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test8
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_8partition.test (renamed from mysql-test/t/rpl_row_basic_8partition.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_blob_innodb-slave.opt (renamed from mysql-test/t/rpl_row_blob_innodb-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_blob_innodb.test14
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_blob_myisam.test13
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_charset.test9
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_colSize.test168
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_create_table-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_create_table.test236
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_delayed_ins.test (renamed from mysql-test/t/rpl_row_delayed_ins.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_drop.test (renamed from mysql-test/t/rpl_row_drop.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_err_daisychain-master.opt (renamed from mysql-test/t/rpl_row_err_daisychain-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_err_daisychain-slave.opt (renamed from mysql-test/t/rpl_row_err_daisychain-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_extraColmaster_ndb.test12
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test17
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_func001.test (renamed from mysql-test/t/rpl_row_func001.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_func002.test (renamed from mysql-test/t/rpl_row_func002.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_func003-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_func003.test13
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_inexist_tbl-slave.opt (renamed from mysql-test/t/rpl_row_inexist_tbl-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test33
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_insert_delayed.test (renamed from mysql-test/t/rpl_row_insert_delayed.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_log-master.opt (renamed from mysql-test/t/rpl_row_log-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_log-slave.opt (renamed from mysql-test/t/rpl_row_log-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_log.test17
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_log_innodb-master.opt (renamed from mysql-test/t/rpl_row_log_innodb-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_log_innodb-slave.opt (renamed from mysql-test/t/rpl_row_log_innodb-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_log_innodb.test14
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_max_relay_size.test (renamed from mysql-test/t/rpl_row_max_relay_size.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_mysqlbinlog-master.opt (renamed from mysql-test/t/rpl_row_mysqlbinlog-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test348
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_mystery22.test (renamed from mysql-test/t/rpl_row_mystery22.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_reset_slave.test (renamed from mysql-test/t/rpl_row_reset_slave.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp001.test (renamed from mysql-test/t/rpl_row_sp001.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp002_innodb-master.opt (renamed from mysql-test/t/rpl_row_sp002_innodb-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp002_innodb-slave.opt (renamed from mysql-test/t/rpl_row_sp002_innodb-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp002_innodb.test (renamed from mysql-test/t/rpl_row_sp002_innodb.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp003-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp003-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp003.test13
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp005.test (renamed from mysql-test/t/rpl_row_sp005.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB-slave.opt (renamed from mysql-test/t/rpl_row_sp006_InnoDB-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test13
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp007_innodb-slave.opt (renamed from mysql-test/t/rpl_row_sp007_innodb-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp007_innodb.test (renamed from mysql-test/t/rpl_row_sp007_innodb.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp008.test (renamed from mysql-test/t/rpl_row_sp008.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp009.test (renamed from mysql-test/t/rpl_row_sp009.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp010.test (renamed from mysql-test/t/rpl_row_sp010.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp011.test (renamed from mysql-test/t/rpl_row_sp011.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp012.test (renamed from mysql-test/t/rpl_row_sp012.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_stop_middle.test (renamed from mysql-test/t/rpl_row_stop_middle.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_stop_middle_update-master.opt (renamed from mysql-test/t/rpl_row_stop_middle_update-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_stop_middle_update-slave.opt (renamed from mysql-test/t/rpl_row_stop_middle_update-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test (renamed from mysql-test/t/rpl_row_stop_middle_update.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test (renamed from mysql-test/t/rpl_row_tabledefs_2myisam.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb-slave.opt (renamed from mysql-test/t/rpl_row_tabledefs_3innodb-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test (renamed from mysql-test/t/rpl_row_tabledefs_3innodb.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_trig001.test (renamed from mysql-test/t/rpl_row_trig001.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_trig002.test (renamed from mysql-test/t/rpl_row_trig002.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_trig003.test (renamed from mysql-test/t/rpl_row_trig003.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_trig004.test (renamed from mysql-test/t/rpl_row_trig004.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_unsafe_funcs.test35
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_until.test76
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_view01.test (renamed from mysql-test/t/rpl_row_view01.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_server_id1.test26
-rw-r--r--mysql-test/suite/rpl/t/rpl_server_id2-slave.opt (renamed from mysql-test/t/rpl_server_id2-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_server_id2.test26
-rw-r--r--mysql-test/suite/rpl/t/rpl_session_var.test64
-rw-r--r--mysql-test/suite/rpl/t/rpl_set_charset.test (renamed from mysql-test/t/rpl_set_charset.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_sf.test70
-rw-r--r--mysql-test/suite/rpl/t/rpl_skip_error-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_skip_error.test51
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_skip.test71
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_status.test58
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp-master.opt (renamed from mysql-test/t/rpl_sp-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp-slave.opt (renamed from mysql-test/t/rpl_sp-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp.test585
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp004.test (renamed from mysql-test/t/rpl_sp004.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp_effects-master.opt (renamed from mysql-test/t/rpl_sp_effects-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp_effects-slave.opt (renamed from mysql-test/t/rpl_sp_effects-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp_effects.test (renamed from mysql-test/t/rpl_sp_effects.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_sporadic_master-master.opt (renamed from mysql-test/t/rpl_sporadic_master-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_sporadic_master.test (renamed from mysql-test/t/rpl_sporadic_master.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_ssl.test86
-rw-r--r--mysql-test/suite/rpl/t/rpl_ssl1.test97
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_stop_slave.test (renamed from mysql-test/t/rpl_start_stop_slave.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_000001-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_000001.test (renamed from mysql-test/t/rpl_stm_000001.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_EE_err2.test (renamed from mysql-test/t/rpl_stm_EE_err2.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_charset.test (renamed from mysql-test/t/rpl_stm_charset.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_extraColmaster_ndb.test13
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test (renamed from mysql-test/t/rpl_stm_flsh_tbls.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test (renamed from mysql-test/t/rpl_stm_insert_delayed.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_log-master.opt (renamed from mysql-test/t/rpl_stm_log-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_log-slave.opt (renamed from mysql-test/t/rpl_stm_log-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_log.test9
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_max_relay_size.test (renamed from mysql-test/t/rpl_stm_max_relay_size.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_multi_query.test (renamed from mysql-test/t/rpl_stm_multi_query.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_mystery22.test (renamed from mysql-test/t/rpl_stm_mystery22.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_no_op.test (renamed from mysql-test/t/rpl_stm_no_op.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_reset_slave.test (renamed from mysql-test/t/rpl_stm_reset_slave.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_until.test77
-rw-r--r--mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test (renamed from mysql-test/t/rpl_switch_stm_row_mixed.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_temp_table.test (renamed from mysql-test/t/rpl_temp_table.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_temporary.test (renamed from mysql-test/t/rpl_temporary.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_timezone-master.opt (renamed from mysql-test/t/rpl_timezone-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_timezone-slave.opt (renamed from mysql-test/t/rpl_timezone-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_timezone.test169
-rw-r--r--mysql-test/suite/rpl/t/rpl_trigger.test (renamed from mysql-test/t/rpl_trigger.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_trunc_temp.test (renamed from mysql-test/t/rpl_trunc_temp.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_truncate_2myisam.test (renamed from mysql-test/t/rpl_truncate_2myisam.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_truncate_3innodb.test (renamed from mysql-test/t/rpl_truncate_3innodb.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_truncate_7ndb_2-master.opt (renamed from mysql-test/t/rpl_truncate_7ndb_2-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_truncate_7ndb_2.test (renamed from mysql-test/t/rpl_truncate_7ndb_2.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_udf-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_udf-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_udf.test (renamed from mysql-test/t/rpl_udf.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_user_variables.test362
-rw-r--r--mysql-test/suite/rpl/t/rpl_variables-master.opt (renamed from mysql-test/t/rpl_variables-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_variables.test (renamed from mysql-test/t/rpl_variables.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_view-slave.opt (renamed from mysql-test/t/rpl_view-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_view.test167
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result (renamed from mysql-test/r/rpl_ndb_2innodb.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result (renamed from mysql-test/r/rpl_ndb_2myisam.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result1189
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_UUID.result40
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_auto_inc.result (renamed from mysql-test/r/rpl_ndb_auto_inc.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_bank.result (renamed from mysql-test/r/rpl_ndb_bank.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result231
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_blob.result (renamed from mysql-test/r/rpl_ndb_blob.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_blob2.result (renamed from mysql-test/r/rpl_ndb_blob2.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_charset.result (renamed from mysql-test/r/rpl_ndb_charset.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result103
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result104
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_commit_afterflush.result (renamed from mysql-test/r/rpl_ndb_commit_afterflush.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result9
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_advance.result327
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_basic.result72
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result726
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_ddl.result (renamed from mysql-test/r/rpl_ndb_ddl.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_delete_nowhere.result (renamed from mysql-test/r/rpl_ndb_delete_nowhere.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_do_db.result (renamed from mysql-test/r/rpl_ndb_do_db.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_do_table.result (renamed from mysql-test/r/rpl_ndb_do_table.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result849
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_func003.result (renamed from mysql-test/r/rpl_ndb_func003.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result73
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result855
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb_trans.result (renamed from mysql-test/r/rpl_ndb_innodb_trans.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_insert_ignore.result (renamed from mysql-test/r/rpl_ndb_insert_ignore.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_load.result (renamed from mysql-test/r/rpl_ndb_load.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result326
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_mix_innodb.result129
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result (renamed from mysql-test/r/rpl_ndb_multi.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update2.result (renamed from mysql-test/r/rpl_ndb_multi_update2.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update3.result (renamed from mysql-test/r/rpl_ndb_multi_update3.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result855
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_relayrotate.result (renamed from mysql-test/r/rpl_ndb_relayrotate.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_rep_ignore.result (renamed from mysql-test/r/rpl_ndb_rep_ignore.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result (renamed from mysql-test/r/rpl_ndb_row_001.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_sp003.result (renamed from mysql-test/r/rpl_ndb_sp003.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result (renamed from mysql-test/r/rpl_ndb_sp006.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result129
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result132
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_trig004.result (renamed from mysql-test/r/rpl_ndb_trig004.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndbapi_multi.result (renamed from mysql-test/r/rpl_ndbapi_multi.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result (renamed from mysql-test/r/rpl_row_basic_7ndb.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result91
-rw-r--r--mysql-test/suite/rpl_ndb/t/disabled.def27
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-master.opt (renamed from mysql-test/t/rpl_ndb_2innodb-master.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-slave.opt (renamed from mysql-test/t/rpl_ndb_2innodb-slave.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test16
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-master.opt (renamed from mysql-test/t/rpl_ndb_2myisam-master.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-slave.opt (renamed from mysql-test/t/rpl_ndb_2myisam-slave.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test13
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_2other-slave.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_2other.test35
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_UUID.test8
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_auto_inc.test118
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_bank.test181
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test260
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test141
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test10
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_charset.test8
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test56
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test80
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test10
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def-master.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test42
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_advance.test430
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_basic.test85
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions-master.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions-slave.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions.test310
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_ddl.test33
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test8
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db-slave.opt (renamed from mysql-test/t/rpl_ndb_do_db-slave.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test56
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table-slave.opt (renamed from mysql-test/t/rpl_ndb_do_table-slave.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test45
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_extraCol.test13
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test13
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test117
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-master.opt (renamed from mysql-test/t/rpl_ndb_innodb2ndb-master.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-slave.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test15
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans-slave.opt (renamed from mysql-test/t/rpl_ndb_innodb_trans-slave.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test66
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test8
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_load.test66
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_log-master.opt (renamed from mysql-test/t/rpl_ndb_log-master.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_log.test13
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb-master.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb.test36
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test70
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2-slave.opt (renamed from mysql-test/t/rpl_ndb_multi_update2-slave.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2.test13
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test8
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-slave.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test14
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate-slave.opt3
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate.test9
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore-slave.opt (renamed from mysql-test/t/rpl_ndb_rep_ignore-slave.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test57
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test7
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test10
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test10
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb-master.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test35
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test104
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test14
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndbapi_multi.test11
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_row_basic_7ndb.test8
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test71
-rw-r--r--mysql-test/suite/stress/include/ddl.cln4
-rw-r--r--mysql-test/suite/stress/include/ddl.pre21
-rw-r--r--mysql-test/suite/stress/include/ddl1.inc277
-rw-r--r--mysql-test/suite/stress/include/ddl2.inc259
-rw-r--r--mysql-test/suite/stress/include/ddl3.inc242
-rw-r--r--mysql-test/suite/stress/include/ddl4.inc339
-rw-r--r--mysql-test/suite/stress/include/ddl5.inc227
-rw-r--r--mysql-test/suite/stress/include/ddl6.inc266
-rw-r--r--mysql-test/suite/stress/include/ddl7.inc274
-rw-r--r--mysql-test/suite/stress/include/ddl8.inc302
-rw-r--r--mysql-test/suite/stress/r/ddl_archive.result79
-rw-r--r--mysql-test/suite/stress/r/ddl_csv.result55
-rw-r--r--mysql-test/suite/stress/r/ddl_innodb.result251
-rw-r--r--mysql-test/suite/stress/r/ddl_memory.result251
-rw-r--r--mysql-test/suite/stress/r/ddl_myisam.result251
-rw-r--r--mysql-test/suite/stress/r/ddl_ndb.result216
-rw-r--r--mysql-test/suite/stress/t/ddl_archive.test51
-rw-r--r--mysql-test/suite/stress/t/ddl_csv.test51
-rw-r--r--mysql-test/suite/stress/t/ddl_innodb.test49
-rw-r--r--mysql-test/suite/stress/t/ddl_memory.test48
-rw-r--r--mysql-test/suite/stress/t/ddl_myisam.test48
-rw-r--r--mysql-test/suite/stress/t/ddl_ndb.test56
-rw-r--r--mysql-test/t/alter_table-big.test90
-rw-r--r--mysql-test/t/alter_table.test101
-rw-r--r--mysql-test/t/archive-big.test25
-rw-r--r--mysql-test/t/archive.test9
-rw-r--r--mysql-test/t/auto_increment.test10
-rw-r--r--mysql-test/t/backup.test16
-rw-r--r--mysql-test/t/bigint.test30
-rw-r--r--mysql-test/t/binary.test38
-rw-r--r--mysql-test/t/binlog_row_blackhole.test11
-rw-r--r--mysql-test/t/binlog_row_mix_innodb_myisam-master.opt1
-rw-r--r--mysql-test/t/binlog_row_mix_innodb_myisam.test32
-rw-r--r--mysql-test/t/binlog_stm_mix_innodb_myisam-master.opt1
-rw-r--r--mysql-test/t/binlog_stm_mix_innodb_myisam.test24
-rw-r--r--mysql-test/t/binlog_unsafe.test18
-rw-r--r--mysql-test/t/bootstrap.test7
-rw-r--r--mysql-test/t/cast.test17
-rw-r--r--mysql-test/t/check.test12
-rw-r--r--mysql-test/t/comments.test46
-rw-r--r--mysql-test/t/create-big.test392
-rw-r--r--mysql-test/t/create.test492
-rw-r--r--mysql-test/t/create_not_windows.test1
-rw-r--r--mysql-test/t/create_select_tmp.test8
-rw-r--r--mysql-test/t/csv.test75
-rw-r--r--mysql-test/t/ctype_ascii.test13
-rw-r--r--mysql-test/t/ctype_big5.test19
-rw-r--r--mysql-test/t/ctype_collate.test22
-rw-r--r--mysql-test/t/ctype_cp932_binlog_stm.test12
-rw-r--r--mysql-test/t/ctype_latin1.test6
-rw-r--r--mysql-test/t/ctype_ldml-master.opt2
-rw-r--r--mysql-test/t/ctype_ldml.test63
-rw-r--r--mysql-test/t/ctype_recoding.test10
-rw-r--r--mysql-test/t/ctype_uca.test54
-rw-r--r--mysql-test/t/ctype_ucs.test57
-rw-r--r--mysql-test/t/ctype_ucs2_def.test26
-rw-r--r--mysql-test/t/ctype_ujis_ucs2.test1306
-rw-r--r--mysql-test/t/ctype_utf8.test155
-rw-r--r--mysql-test/t/date_formats.test6
-rw-r--r--mysql-test/t/ddl_i18n_koi8r.test1114
-rw-r--r--mysql-test/t/ddl_i18n_utf8.test1114
-rw-r--r--mysql-test/t/delayed.test2
-rw-r--r--mysql-test/t/delete.test58
-rw-r--r--mysql-test/t/disabled.def29
-rw-r--r--mysql-test/t/distinct.test2
-rw-r--r--mysql-test/t/error_simulation-master.opt1
-rw-r--r--mysql-test/t/error_simulation.test30
-rw-r--r--mysql-test/t/errors.test13
-rw-r--r--mysql-test/t/events.test94
-rw-r--r--mysql-test/t/events_bugs.test126
-rw-r--r--mysql-test/t/events_grant.test10
-rw-r--r--mysql-test/t/events_logs_tests.test176
-rw-r--r--mysql-test/t/events_restart_phase3.test7
-rw-r--r--mysql-test/t/events_scheduling.test10
-rw-r--r--mysql-test/t/events_stress.test1
-rw-r--r--mysql-test/t/events_time_zone.test6
-rw-r--r--mysql-test/t/events_trans.test6
-rw-r--r--mysql-test/t/events_trans_notembedded.test5
-rw-r--r--mysql-test/t/federated.test142
-rw-r--r--mysql-test/t/federated_bug_25714.test47
-rw-r--r--mysql-test/t/federated_innodb-slave.opt (renamed from mysql-test/t/rpl_insert_ignore-slave.opt)0
-rw-r--r--mysql-test/t/federated_innodb.test34
-rw-r--r--mysql-test/t/federated_transactions-slave.opt2
-rw-r--r--mysql-test/t/flush.test26
-rw-r--r--mysql-test/t/flush_block_commit_notembedded.test4
-rw-r--r--mysql-test/t/fulltext.test10
-rw-r--r--mysql-test/t/fulltext3.test34
-rw-r--r--mysql-test/t/func_date_add.test10
-rw-r--r--mysql-test/t/func_gconcat.test55
-rw-r--r--mysql-test/t/func_group.test34
-rw-r--r--mysql-test/t/func_in.test31
-rw-r--r--mysql-test/t/func_misc.test23
-rw-r--r--mysql-test/t/func_str.test48
-rw-r--r--mysql-test/t/func_time.test33
-rw-r--r--mysql-test/t/gis-rtree.test19
-rw-r--r--mysql-test/t/gis.test33
-rw-r--r--mysql-test/t/grant.test41
-rw-r--r--mysql-test/t/grant2.test74
-rw-r--r--mysql-test/t/grant_cache.test185
-rw-r--r--mysql-test/t/grant_cache_no_prot.test25
-rw-r--r--mysql-test/t/grant_cache_ps_prot.test24
-rw-r--r--mysql-test/t/greedy_optimizer.test4
-rw-r--r--mysql-test/t/group_by.test73
-rw-r--r--mysql-test/t/group_min_max.test22
-rw-r--r--mysql-test/t/having.test26
-rw-r--r--mysql-test/t/heap.test28
-rw-r--r--mysql-test/t/heap_btree.test2
-rw-r--r--mysql-test/t/heap_hash.test27
-rw-r--r--mysql-test/t/im_cmd_line.imtest68
-rw-r--r--mysql-test/t/im_daemon_life_cycle.imtest98
-rw-r--r--mysql-test/t/im_instance_conf.imtest244
-rw-r--r--mysql-test/t/im_life_cycle.imtest203
-rw-r--r--mysql-test/t/im_options.imtest248
-rw-r--r--mysql-test/t/im_utils.imtest105
-rw-r--r--mysql-test/t/information_schema.test105
-rw-r--r--mysql-test/t/information_schema_chmod.test2
-rw-r--r--mysql-test/t/innodb.test99
-rw-r--r--mysql-test/t/innodb_trx_weight.test108
-rw-r--r--mysql-test/t/insert.test139
-rw-r--r--mysql-test/t/insert_notembedded.test35
-rw-r--r--mysql-test/t/insert_select.test57
-rw-r--r--mysql-test/t/insert_update.test63
-rw-r--r--mysql-test/t/join.test6
-rw-r--r--mysql-test/t/join_nested.test114
-rw-r--r--mysql-test/t/join_outer.test18
-rw-r--r--mysql-test/t/key.test12
-rw-r--r--mysql-test/t/key_cache.test27
-rw-r--r--mysql-test/t/kill.test189
-rw-r--r--mysql-test/t/limit.test17
-rw-r--r--mysql-test/t/loaddata.test92
-rw-r--r--mysql-test/t/lock.test65
-rw-r--r--mysql-test/t/lock_multi.test134
-rw-r--r--mysql-test/t/log_state.test57
-rw-r--r--mysql-test/t/log_tables.test489
-rw-r--r--mysql-test/t/long_tmpdir-master.opt1
-rw-r--r--mysql-test/t/long_tmpdir-master.sh3
-rw-r--r--mysql-test/t/long_tmpdir.test9
-rw-r--r--mysql-test/t/lowercase_table3.test6
-rw-r--r--mysql-test/t/merge.test25
-rw-r--r--mysql-test/t/metadata.test32
-rw-r--r--mysql-test/t/multi_update.test48
-rw-r--r--mysql-test/t/myisam-blob-master.opt2
-rw-r--r--mysql-test/t/myisam.test22
-rw-r--r--mysql-test/t/mysql.test17
-rw-r--r--mysql-test/t/mysql_upgrade.test13
-rw-r--r--mysql-test/t/mysqladmin.test3
-rw-r--r--mysql-test/t/mysqlbinlog-cp932.test1
-rw-r--r--mysql-test/t/mysqlbinlog.test41
-rw-r--r--mysql-test/t/mysqlbinlog2.test5
-rw-r--r--mysql-test/t/mysqldump-compat.opt1
-rw-r--r--mysql-test/t/mysqldump-compat.test13
-rw-r--r--mysql-test/t/mysqldump.test119
-rw-r--r--mysql-test/t/mysqlslap.test4
-rw-r--r--mysql-test/t/mysqltest.test397
-rw-r--r--mysql-test/t/ndb_alter_table.test439
-rw-r--r--mysql-test/t/ndb_alter_table2.test85
-rw-r--r--mysql-test/t/ndb_alter_table3.test49
-rw-r--r--mysql-test/t/ndb_autodiscover3.test86
-rw-r--r--mysql-test/t/ndb_basic.test820
-rw-r--r--mysql-test/t/ndb_binlog_basic.test72
-rw-r--r--mysql-test/t/ndb_binlog_basic2.test14
-rw-r--r--mysql-test/t/ndb_binlog_ddl_multi.test191
-rw-r--r--mysql-test/t/ndb_binlog_discover.test36
-rw-r--r--mysql-test/t/ndb_binlog_ignore_db.test16
-rw-r--r--mysql-test/t/ndb_binlog_log_bin.test50
-rw-r--r--mysql-test/t/ndb_binlog_multi.test83
-rw-r--r--mysql-test/t/ndb_cache_multi.test72
-rw-r--r--mysql-test/t/ndb_cache_multi2.test126
-rw-r--r--mysql-test/t/ndb_charset.test257
-rw-r--r--mysql-test/t/ndb_dd_basic.test454
-rw-r--r--mysql-test/t/ndb_dd_ddl.test363
-rw-r--r--mysql-test/t/ndb_dd_dump.test288
-rw-r--r--mysql-test/t/ndb_index_unique.test361
-rw-r--r--mysql-test/t/ndb_insert.test642
-rw-r--r--mysql-test/t/ndb_multi.test126
-rw-r--r--mysql-test/t/ndb_multi_row.test76
-rw-r--r--mysql-test/t/ndb_read_multi_range.test319
-rw-r--r--mysql-test/t/ndb_replace.test104
-rw-r--r--mysql-test/t/ndb_restore.test403
-rw-r--r--mysql-test/t/ndb_restore_compat.test61
-rw-r--r--mysql-test/t/ndb_single_user.test174
-rw-r--r--mysql-test/t/ndb_trigger.test221
-rw-r--r--mysql-test/t/ndb_update.test41
-rw-r--r--mysql-test/t/order_by.test44
-rw-r--r--mysql-test/t/outfile.test12
-rw-r--r--mysql-test/t/parser.test22
-rw-r--r--mysql-test/t/parser_precedence.test333
-rw-r--r--mysql-test/t/partition.test57
-rw-r--r--mysql-test/t/partition_bug18198.test219
-rw-r--r--mysql-test/t/partition_charset.test8
-rw-r--r--mysql-test/t/partition_error.test11
-rw-r--r--mysql-test/t/partition_grant.test4
-rw-r--r--mysql-test/t/partition_hash.test13
-rw-r--r--mysql-test/t/partition_list.test4
-rw-r--r--mysql-test/t/partition_mgm.test2
-rw-r--r--mysql-test/t/partition_pruning.test99
-rw-r--r--mysql-test/t/partition_range.test128
-rw-r--r--mysql-test/t/plugin-master.opt1
-rw-r--r--mysql-test/t/plugin.test6
-rw-r--r--mysql-test/t/ps.test214
-rw-r--r--mysql-test/t/ps_1general.test18
-rw-r--r--mysql-test/t/query_cache.test408
-rw-r--r--mysql-test/t/query_cache_ps_no_prot.test26
-rw-r--r--mysql-test/t/query_cache_ps_ps_prot.test25
-rw-r--r--mysql-test/t/query_cache_sql_prepare.test146
-rw-r--r--mysql-test/t/query_cache_with_views.test (renamed from mysql-test/t/view_query_cache.test)0
-rw-r--r--mysql-test/t/replace.test4
-rw-r--r--mysql-test/t/row.test2
-rw-r--r--mysql-test/t/rpl_000015.test47
-rw-r--r--mysql-test/t/rpl_change_master.test37
-rw-r--r--mysql-test/t/rpl_commit_after_flush.test11
-rw-r--r--mysql-test/t/rpl_critical_errors.test66
-rw-r--r--mysql-test/t/rpl_deadlock_innodb-slave.opt1
-rw-r--r--mysql-test/t/rpl_delete_no_where.test6
-rw-r--r--mysql-test/t/rpl_dual_pos_advance.test114
-rw-r--r--mysql-test/t/rpl_empty_master_crash.test15
-rw-r--r--mysql-test/t/rpl_err_ignoredtable.test66
-rw-r--r--mysql-test/t/rpl_events.test24
-rw-r--r--mysql-test/t/rpl_flushlog_loop.test50
-rw-r--r--mysql-test/t/rpl_incident.test43
-rw-r--r--mysql-test/t/rpl_innodb.test48
-rw-r--r--mysql-test/t/rpl_insert_ignore.test8
-rw-r--r--mysql-test/t/rpl_known_bugs_detection.test93
-rw-r--r--mysql-test/t/rpl_log_pos.test60
-rw-r--r--mysql-test/t/rpl_misc_functions.test103
-rw-r--r--mysql-test/t/rpl_multi_engine-slave.opt1
-rw-r--r--mysql-test/t/rpl_multi_update2.test9
-rw-r--r--mysql-test/t/rpl_multi_update3.test9
-rw-r--r--mysql-test/t/rpl_ndb_2innodb.test16
-rw-r--r--mysql-test/t/rpl_ndb_2myisam.test13
-rw-r--r--mysql-test/t/rpl_ndb_UUID.test6
-rw-r--r--mysql-test/t/rpl_ndb_auto_inc.test118
-rw-r--r--mysql-test/t/rpl_ndb_bank.test181
-rw-r--r--mysql-test/t/rpl_ndb_basic.test261
-rw-r--r--mysql-test/t/rpl_ndb_blob.test142
-rw-r--r--mysql-test/t/rpl_ndb_blob2.test9
-rw-r--r--mysql-test/t/rpl_ndb_charset.test6
-rw-r--r--mysql-test/t/rpl_ndb_circular.test57
-rw-r--r--mysql-test/t/rpl_ndb_circular_simplex.test82
-rw-r--r--mysql-test/t/rpl_ndb_commit_afterflush.test9
-rw-r--r--mysql-test/t/rpl_ndb_dd_advance.test581
-rw-r--r--mysql-test/t/rpl_ndb_dd_basic.test85
-rw-r--r--mysql-test/t/rpl_ndb_dd_partitions.test310
-rw-r--r--mysql-test/t/rpl_ndb_ddl.test32
-rw-r--r--mysql-test/t/rpl_ndb_delete_nowhere.test8
-rw-r--r--mysql-test/t/rpl_ndb_do_db.test57
-rw-r--r--mysql-test/t/rpl_ndb_do_table.test46
-rw-r--r--mysql-test/t/rpl_ndb_extraCol.test13
-rw-r--r--mysql-test/t/rpl_ndb_func003.test12
-rw-r--r--mysql-test/t/rpl_ndb_idempotent.test117
-rw-r--r--mysql-test/t/rpl_ndb_innodb2ndb-slave.opt1
-rw-r--r--mysql-test/t/rpl_ndb_innodb2ndb.test16
-rw-r--r--mysql-test/t/rpl_ndb_innodb_trans.test66
-rw-r--r--mysql-test/t/rpl_ndb_insert_ignore.test8
-rw-r--r--mysql-test/t/rpl_ndb_load.test66
-rw-r--r--mysql-test/t/rpl_ndb_log.test12
-rw-r--r--mysql-test/t/rpl_ndb_multi.test71
-rw-r--r--mysql-test/t/rpl_ndb_multi_update2.test12
-rw-r--r--mysql-test/t/rpl_ndb_multi_update3.test8
-rw-r--r--mysql-test/t/rpl_ndb_myisam2ndb-master.opt1
-rw-r--r--mysql-test/t/rpl_ndb_myisam2ndb-slave.opt1
-rw-r--r--mysql-test/t/rpl_ndb_myisam2ndb.test15
-rw-r--r--mysql-test/t/rpl_ndb_relayrotate-slave.opt3
-rw-r--r--mysql-test/t/rpl_ndb_relayrotate.test8
-rw-r--r--mysql-test/t/rpl_ndb_rep_ignore.test58
-rw-r--r--mysql-test/t/rpl_ndb_row_001.test6
-rw-r--r--mysql-test/t/rpl_ndb_sp003.test9
-rw-r--r--mysql-test/t/rpl_ndb_sp006.test9
-rw-r--r--mysql-test/t/rpl_ndb_stm_innodb-master.opt1
-rw-r--r--mysql-test/t/rpl_ndb_stm_innodb.test62
-rw-r--r--mysql-test/t/rpl_ndb_sync.test104
-rw-r--r--mysql-test/t/rpl_ndb_trig004.test15
-rw-r--r--mysql-test/t/rpl_ndbapi_multi.test11
-rw-r--r--mysql-test/t/rpl_packet.test80
-rw-r--r--mysql-test/t/rpl_ps.test51
-rw-r--r--mysql-test/t/rpl_rbr_to_sbr.test47
-rw-r--r--mysql-test/t/rpl_read_only-slave.opt1
-rw-r--r--mysql-test/t/rpl_redirect.test47
-rw-r--r--mysql-test/t/rpl_relayrotate-slave.opt3
-rw-r--r--mysql-test/t/rpl_relayrotate.test10
-rw-r--r--mysql-test/t/rpl_relayspace.test34
-rw-r--r--mysql-test/t/rpl_replicate_do.test92
-rw-r--r--mysql-test/t/rpl_rotate_logs.test164
-rw-r--r--mysql-test/t/rpl_row_001.test7
-rw-r--r--mysql-test/t/rpl_row_UUID.test7
-rw-r--r--mysql-test/t/rpl_row_basic_11bugs-master.opt2
-rw-r--r--mysql-test/t/rpl_row_basic_11bugs-slave.opt1
-rw-r--r--mysql-test/t/rpl_row_basic_11bugs.test186
-rw-r--r--mysql-test/t/rpl_row_basic_2myisam.test3
-rw-r--r--mysql-test/t/rpl_row_basic_3innodb.test6
-rw-r--r--mysql-test/t/rpl_row_basic_7ndb.test5
-rw-r--r--mysql-test/t/rpl_row_blob_innodb.test12
-rw-r--r--mysql-test/t/rpl_row_blob_myisam.test11
-rw-r--r--mysql-test/t/rpl_row_charset.test7
-rw-r--r--mysql-test/t/rpl_row_create_table-slave.opt1
-rw-r--r--mysql-test/t/rpl_row_create_table.test236
-rw-r--r--mysql-test/t/rpl_row_flsh_tbls.test17
-rw-r--r--mysql-test/t/rpl_row_func003-slave.opt1
-rw-r--r--mysql-test/t/rpl_row_func003.test11
-rw-r--r--mysql-test/t/rpl_row_inexist_tbl.test35
-rw-r--r--mysql-test/t/rpl_row_log.test16
-rw-r--r--mysql-test/t/rpl_row_log_innodb.test13
-rw-r--r--mysql-test/t/rpl_row_mysqlbinlog.test321
-rw-r--r--mysql-test/t/rpl_row_sp003-master.opt1
-rw-r--r--mysql-test/t/rpl_row_sp003-slave.opt1
-rw-r--r--mysql-test/t/rpl_row_sp003.test11
-rw-r--r--mysql-test/t/rpl_row_sp006_InnoDB.test11
-rw-r--r--mysql-test/t/rpl_row_until.test87
-rw-r--r--mysql-test/t/rpl_server_id1.test26
-rw-r--r--mysql-test/t/rpl_server_id2.test26
-rw-r--r--mysql-test/t/rpl_session_var.test42
-rw-r--r--mysql-test/t/rpl_sf.test68
-rw-r--r--mysql-test/t/rpl_skip_error-slave.opt1
-rw-r--r--mysql-test/t/rpl_skip_error.test29
-rw-r--r--mysql-test/t/rpl_slave_status.test58
-rw-r--r--mysql-test/t/rpl_sp.test585
-rw-r--r--mysql-test/t/rpl_ssl.test69
-rw-r--r--mysql-test/t/rpl_ssl1.test97
-rw-r--r--mysql-test/t/rpl_stm_000001-slave.opt1
-rw-r--r--mysql-test/t/rpl_stm_log.test8
-rw-r--r--mysql-test/t/rpl_stm_until.test88
-rw-r--r--mysql-test/t/rpl_timezone.test142
-rw-r--r--mysql-test/t/rpl_truncate_7ndb.test71
-rw-r--r--mysql-test/t/rpl_user_variables.test354
-rw-r--r--mysql-test/t/rpl_view.test155
-rw-r--r--mysql-test/t/select.test124
-rw-r--r--mysql-test/t/show_check-master.opt2
-rw-r--r--mysql-test/t/show_check.test527
-rw-r--r--mysql-test/t/sp-code.test77
-rw-r--r--mysql-test/t/sp-destruct.test16
-rw-r--r--mysql-test/t/sp-dynamic.test12
-rw-r--r--mysql-test/t/sp-error.test33
-rw-r--r--mysql-test/t/sp-prelocking.test85
-rw-r--r--mysql-test/t/sp-vars.test80
-rw-r--r--mysql-test/t/sp.test429
-rw-r--r--mysql-test/t/sp_notembedded.test65
-rw-r--r--mysql-test/t/sp_trans.test3
-rw-r--r--mysql-test/t/sp_trans_log.test2
-rw-r--r--mysql-test/t/sql_mode.test13
-rw-r--r--mysql-test/t/ssl-big.test56
-rw-r--r--mysql-test/t/ssl_8k_key.test6
-rw-r--r--mysql-test/t/status.test65
-rw-r--r--mysql-test/t/strict.test4
-rw-r--r--mysql-test/t/subselect.test119
-rw-r--r--mysql-test/t/subselect3.test47
-rw-r--r--mysql-test/t/subselect_notembedded.test7
-rw-r--r--mysql-test/t/symlink.test39
-rw-r--r--mysql-test/t/system_mysql_db_fix50117-master.opt1
-rw-r--r--mysql-test/t/system_mysql_db_fix50117.test104
-rw-r--r--mysql-test/t/temp_table.test2
-rw-r--r--mysql-test/t/trigger-trans.test82
-rw-r--r--mysql-test/t/trigger.test518
-rw-r--r--mysql-test/t/type_binary.test2
-rw-r--r--mysql-test/t/type_bit.test65
-rw-r--r--mysql-test/t/type_bit_innodb.test2
-rw-r--r--mysql-test/t/type_blob.test4
-rw-r--r--mysql-test/t/type_date.test9
-rw-r--r--mysql-test/t/type_datetime.test78
-rw-r--r--mysql-test/t/type_decimal.test14
-rw-r--r--mysql-test/t/type_enum.test66
-rw-r--r--mysql-test/t/type_float.test20
-rw-r--r--mysql-test/t/type_newdecimal.test65
-rw-r--r--mysql-test/t/type_time.test37
-rw-r--r--mysql-test/t/type_varchar.test2
-rw-r--r--mysql-test/t/udf-master.opt1
-rw-r--r--mysql-test/t/udf.test60
-rw-r--r--mysql-test/t/user_var-binlog.test2
-rw-r--r--mysql-test/t/user_var.test15
-rw-r--r--mysql-test/t/varbinary.test19
-rw-r--r--mysql-test/t/variables.test28
-rw-r--r--mysql-test/t/view.test204
-rw-r--r--mysql-test/t/warnings-master.opt2
-rw-r--r--mysql-test/t/warnings_engine_disabled-master.opt2
-rw-r--r--mysql-test/t/windows_shm-master.opt1
-rw-r--r--mysql-test/t/windows_shm.test9
-rw-r--r--mysql-test/t/xml.test89
-rw-r--r--mysql-test/valgrind.supp17
-rwxr-xr-x[-rw-r--r--]mysys/CMakeLists.txt24
-rw-r--r--mysys/array.c118
-rw-r--r--mysys/charset-def.c6
-rw-r--r--mysys/charset.c131
-rw-r--r--mysys/checksum.c9
-rw-r--r--mysys/default.c23
-rw-r--r--mysys/default_modify.c13
-rw-r--r--mysys/hash.c122
-rw-r--r--mysys/list.c6
-rw-r--r--mysys/md5.c2
-rw-r--r--mysys/mf_cache.c2
-rw-r--r--mysys/mf_dirname.c28
-rw-r--r--mysys/mf_fn_ext.c11
-rw-r--r--mysys/mf_format.c36
-rw-r--r--mysys/mf_getdate.c4
-rw-r--r--mysys/mf_iocache.c253
-rw-r--r--mysys/mf_iocache2.c157
-rw-r--r--mysys/mf_keycache.c2648
-rw-r--r--mysys/mf_keycaches.c44
-rw-r--r--mysys/mf_loadpath.c4
-rw-r--r--mysys/mf_pack.c186
-rw-r--r--mysys/mf_path.c14
-rw-r--r--mysys/mf_radix.c4
-rw-r--r--mysys/mf_same.c5
-rw-r--r--mysys/mf_sort.c8
-rw-r--r--mysys/mf_soundex.c4
-rw-r--r--mysys/mf_strip.c12
-rw-r--r--mysys/mf_tempdir.c2
-rw-r--r--mysys/mf_tempfile.c14
-rw-r--r--mysys/mf_unixpath.c2
-rw-r--r--mysys/mf_wfile.c14
-rw-r--r--mysys/mulalloc.c6
-rw-r--r--mysys/my_alloc.c62
-rw-r--r--mysys/my_append.c15
-rw-r--r--mysys/my_chsize.c8
-rw-r--r--mysys/my_compress.c169
-rw-r--r--mysys/my_conio.c24
-rw-r--r--mysys/my_copy.c6
-rw-r--r--mysys/my_create.c6
-rw-r--r--mysys/my_div.c2
-rw-r--r--mysys/my_error.c6
-rw-r--r--mysys/my_fopen.c5
-rw-r--r--mysys/my_fstream.c92
-rw-r--r--mysys/my_gethwaddr.c5
-rw-r--r--mysys/my_getopt.c156
-rw-r--r--mysys/my_getsystime.c200
-rw-r--r--mysys/my_getwd.c38
-rw-r--r--mysys/my_init.c78
-rw-r--r--mysys/my_largepage.c26
-rw-r--r--mysys/my_lib.c22
-rw-r--r--mysys/my_lockmem.c18
-rw-r--r--mysys/my_malloc.c38
-rw-r--r--mysys/my_memmem.c3
-rw-r--r--mysys/my_once.c26
-rw-r--r--mysys/my_open.c9
-rw-r--r--mysys/my_pread.c154
-rw-r--r--mysys/my_quick.c18
-rw-r--r--mysys/my_read.c25
-rw-r--r--mysys/my_realloc.c10
-rw-r--r--mysys/my_seek.c18
-rw-r--r--mysys/my_static.c17
-rw-r--r--mysys/my_static.h4
-rw-r--r--mysys/my_symlink2.c2
-rw-r--r--mysys/my_thr_init.c29
-rw-r--r--mysys/my_vle.c20
-rw-r--r--mysys/my_wincond.c2
-rw-r--r--mysys/my_windac.c8
-rw-r--r--mysys/my_write.c26
-rw-r--r--mysys/mysys_priv.h2
-rw-r--r--mysys/ptr_cmp.c26
-rw-r--r--mysys/queues.c36
-rw-r--r--mysys/safemalloc.c90
-rw-r--r--mysys/string.c40
-rw-r--r--mysys/test_charset.c2
-rw-r--r--mysys/testhash.c6
-rw-r--r--mysys/thr_alarm.c73
-rw-r--r--mysys/thr_lock.c44
-rw-r--r--mysys/thr_mutex.c17
-rw-r--r--mysys/tree.c8
-rw-r--r--mysys/trie.c8
-rw-r--r--mysys/typelib.c62
-rwxr-xr-xnetware/BUILD/compile-netware-END11
-rw-r--r--netware/Makefile.am15
-rw-r--r--netware/isamchk.def12
-rw-r--r--netware/isamlog.def11
-rw-r--r--netware/pack_isam.def13
-rw-r--r--plugin/Makefile.am1
-rw-r--r--plugin/daemon_example/Makefile.am3
-rw-r--r--plugin/daemon_example/daemon_example.cc6
-rw-r--r--plugin/fulltext/Makefile.am3
-rw-r--r--plugin/fulltext/plugin_example.c39
-rw-r--r--pstack/Makefile.am13
-rwxr-xr-x[-rw-r--r--]regex/CMakeLists.txt7
-rw-r--r--regex/regcomp.c4
-rw-r--r--regex/reginit.c2
-rwxr-xr-xscripts/CMakeLists.txt2
-rw-r--r--scripts/Makefile.am6
-rw-r--r--scripts/make_binary_distribution.sh538
-rwxr-xr-xscripts/make_win_bin_dist167
-rw-r--r--scripts/mysql_config.sh2
-rw-r--r--scripts/mysql_install_db.sh395
-rw-r--r--scripts/mysql_setpermission.sh22
-rw-r--r--scripts/mysql_system_tables.sql27
-rw-r--r--scripts/mysql_system_tables_data.sql2
-rw-r--r--scripts/mysql_system_tables_fix.sql48
-rw-r--r--scripts/mysqld_safe.sh356
-rw-r--r--scripts/mysqlhotcopy.sh32
-rwxr-xr-x[-rw-r--r--]server-tools/instance-manager/CMakeLists.txt4
-rw-r--r--server-tools/instance-manager/angel.cc3
-rw-r--r--server-tools/instance-manager/buffer.cc10
-rw-r--r--server-tools/instance-manager/buffer.h8
-rw-r--r--server-tools/instance-manager/commands.cc37
-rw-r--r--server-tools/instance-manager/guardian.cc31
-rw-r--r--server-tools/instance-manager/instance.cc44
-rw-r--r--server-tools/instance-manager/instance.h2
-rw-r--r--server-tools/instance-manager/instance_map.cc28
-rw-r--r--server-tools/instance-manager/instance_options.cc19
-rw-r--r--server-tools/instance-manager/listener.cc1
-rw-r--r--server-tools/instance-manager/listener.h2
-rw-r--r--server-tools/instance-manager/mysql_connection.cc23
-rw-r--r--server-tools/instance-manager/options.cc74
-rw-r--r--server-tools/instance-manager/parse.cc10
-rw-r--r--server-tools/instance-manager/parse.h10
-rw-r--r--server-tools/instance-manager/parse_output.cc401
-rw-r--r--server-tools/instance-manager/parse_output.h16
-rw-r--r--server-tools/instance-manager/portability.h5
-rw-r--r--server-tools/instance-manager/protocol.cc28
-rw-r--r--server-tools/instance-manager/protocol.h7
-rw-r--r--server-tools/instance-manager/thread_registry.cc15
-rw-r--r--server-tools/instance-manager/user_map.cc16
-rw-r--r--sql-common/client.c79
-rw-r--r--sql-common/my_time.c11
-rw-r--r--sql-common/my_user.c6
-rw-r--r--sql-common/pack.c12
-rwxr-xr-x[-rw-r--r--]sql/CMakeLists.txt106
-rw-r--r--sql/Makefile.am45
-rw-r--r--sql/derror.cc57
-rw-r--r--sql/discover.cc18
-rw-r--r--sql/event_data_objects.cc427
-rw-r--r--sql/event_data_objects.h30
-rw-r--r--sql/event_db_repository.cc121
-rw-r--r--sql/event_db_repository.h18
-rw-r--r--sql/event_queue.cc40
-rw-r--r--sql/event_queue.h18
-rw-r--r--sql/event_scheduler.cc23
-rw-r--r--sql/event_scheduler.h21
-rw-r--r--sql/events.cc55
-rw-r--r--sql/events.h16
-rw-r--r--sql/field.cc1425
-rw-r--r--sql/field.h594
-rw-r--r--sql/field_conv.cc84
-rw-r--r--sql/filesort.cc150
-rw-r--r--sql/gen_lex_hash.cc4
-rw-r--r--sql/gstream.h2
-rw-r--r--sql/ha_ndbcluster.cc764
-rw-r--r--sql/ha_ndbcluster.h89
-rw-r--r--sql/ha_ndbcluster_binlog.cc224
-rw-r--r--sql/ha_ndbcluster_binlog.h10
-rw-r--r--sql/ha_ndbcluster_cond.cc16
-rw-r--r--sql/ha_ndbcluster_cond.h22
-rw-r--r--sql/ha_partition.cc391
-rw-r--r--sql/ha_partition.h85
-rw-r--r--sql/handler.cc432
-rw-r--r--sql/handler.h399
-rw-r--r--sql/hash_filo.h8
-rw-r--r--sql/hostname.cc10
-rw-r--r--sql/init.cc13
-rw-r--r--sql/item.cc259
-rw-r--r--sql/item.h263
-rw-r--r--sql/item_cmpfunc.cc479
-rw-r--r--sql/item_cmpfunc.h190
-rw-r--r--sql/item_create.cc805
-rw-r--r--sql/item_create.h14
-rw-r--r--sql/item_func.cc378
-rw-r--r--sql/item_func.h88
-rw-r--r--sql/item_row.cc4
-rw-r--r--sql/item_row.h4
-rw-r--r--sql/item_strfunc.cc34
-rw-r--r--sql/item_strfunc.h41
-rw-r--r--sql/item_subselect.cc114
-rw-r--r--sql/item_subselect.h2
-rw-r--r--sql/item_sum.cc120
-rw-r--r--sql/item_sum.h31
-rw-r--r--sql/item_timefunc.cc147
-rw-r--r--sql/item_timefunc.h49
-rw-r--r--sql/item_xmlfunc.cc121
-rw-r--r--sql/item_xmlfunc.h1
-rw-r--r--sql/key.cc36
-rw-r--r--sql/lock.cc328
-rw-r--r--sql/log.cc1141
-rw-r--r--sql/log.h112
-rw-r--r--sql/log_event.cc1826
-rw-r--r--sql/log_event.h344
-rw-r--r--sql/log_event_old.cc1152
-rw-r--r--sql/log_event_old.h142
-rw-r--r--sql/mf_iocache.cc6
-rw-r--r--sql/my_decimal.cc15
-rw-r--r--sql/my_decimal.h23
-rw-r--r--sql/mysql_priv.h449
-rw-r--r--sql/mysqld.cc1505
-rw-r--r--sql/net_serv.cc165
-rw-r--r--sql/opt_range.cc365
-rw-r--r--sql/opt_range.h44
-rw-r--r--sql/opt_sum.cc112
-rw-r--r--sql/parse_file.cc69
-rw-r--r--sql/parse_file.h10
-rw-r--r--sql/partition_element.h4
-rw-r--r--sql/partition_info.cc81
-rw-r--r--sql/partition_info.h33
-rw-r--r--sql/protocol.cc114
-rw-r--r--sql/protocol.h26
-rw-r--r--sql/records.cc10
-rw-r--r--sql/repl_failsafe.cc22
-rw-r--r--sql/repl_failsafe.h4
-rw-r--r--sql/rpl_filter.cc28
-rw-r--r--sql/rpl_filter.h2
-rw-r--r--sql/rpl_injector.h2
-rw-r--r--sql/rpl_mi.cc19
-rw-r--r--sql/rpl_mi.h21
-rw-r--r--sql/rpl_record.cc182
-rw-r--r--sql/rpl_record.h18
-rw-r--r--sql/rpl_record_old.cc37
-rw-r--r--sql/rpl_record_old.h12
-rw-r--r--sql/rpl_reporting.cc48
-rw-r--r--sql/rpl_reporting.h85
-rw-r--r--sql/rpl_rli.cc86
-rw-r--r--sql/rpl_rli.h41
-rw-r--r--sql/rpl_tblmap.cc6
-rw-r--r--sql/rpl_tblmap.h2
-rw-r--r--sql/rpl_utility.cc176
-rw-r--r--sql/rpl_utility.h193
-rw-r--r--sql/set_var.cc1700
-rw-r--r--sql/set_var.h521
-rw-r--r--sql/share/charsets/ascii.xml8
-rw-r--r--sql/share/errmsg.txt118
-rw-r--r--sql/slave.cc782
-rw-r--r--sql/slave.h96
-rw-r--r--sql/sp.cc836
-rw-r--r--sql/sp.h43
-rw-r--r--sql/sp_cache.cc21
-rw-r--r--sql/sp_head.cc677
-rw-r--r--sql/sp_head.h127
-rw-r--r--sql/sp_pcontext.cc22
-rw-r--r--sql/sp_pcontext.h10
-rw-r--r--sql/sp_rcontext.cc20
-rw-r--r--sql/sp_rcontext.h6
-rw-r--r--sql/spatial.cc23
-rw-r--r--sql/sql_acl.cc339
-rw-r--r--sql/sql_analyse.cc6
-rw-r--r--sql/sql_analyse.h6
-rw-r--r--sql/sql_array.h2
-rw-r--r--sql/sql_base.cc1032
-rw-r--r--sql/sql_binlog.cc12
-rw-r--r--sql/sql_cache.cc1145
-rw-r--r--sql/sql_cache.h116
-rw-r--r--sql/sql_class.cc651
-rw-r--r--sql/sql_class.h529
-rw-r--r--sql/sql_client.cc7
-rw-r--r--sql/sql_connect.cc51
-rw-r--r--sql/sql_db.cc310
-rw-r--r--sql/sql_delete.cc98
-rw-r--r--sql/sql_error.cc5
-rw-r--r--sql/sql_handler.cc158
-rw-r--r--sql/sql_help.cc16
-rw-r--r--sql/sql_insert.cc1103
-rw-r--r--sql/sql_lex.cc1254
-rw-r--r--sql/sql_lex.h657
-rw-r--r--sql/sql_list.cc34
-rw-r--r--sql/sql_list.h89
-rw-r--r--sql/sql_load.cc67
-rw-r--r--sql/sql_manager.cc2
-rw-r--r--sql/sql_map.cc12
-rw-r--r--sql/sql_map.h12
-rw-r--r--sql/sql_olap.cc4
-rw-r--r--sql/sql_parse.cc1016
-rw-r--r--sql/sql_partition.cc246
-rw-r--r--sql/sql_partition.h15
-rw-r--r--sql/sql_plugin.cc2515
-rw-r--r--sql/sql_plugin.h72
-rw-r--r--sql/sql_prepare.cc245
-rw-r--r--sql/sql_rename.cc53
-rw-r--r--sql/sql_repl.cc193
-rw-r--r--sql/sql_repl.h11
-rw-r--r--sql/sql_select.cc1073
-rw-r--r--sql/sql_select.h75
-rw-r--r--sql/sql_servers.cc55
-rw-r--r--sql/sql_show.cc3310
-rw-r--r--sql/sql_show.h5
-rw-r--r--sql/sql_sort.h9
-rw-r--r--sql/sql_string.cc20
-rw-r--r--sql/sql_table.cc2555
-rw-r--r--sql/sql_tablespace.cc10
-rw-r--r--sql/sql_test.cc8
-rw-r--r--sql/sql_trigger.cc848
-rw-r--r--sql/sql_trigger.h52
-rw-r--r--sql/sql_udf.cc75
-rw-r--r--sql/sql_udf.h1
-rw-r--r--sql/sql_union.cc73
-rw-r--r--sql/sql_update.cc427
-rw-r--r--sql/sql_view.cc293
-rw-r--r--sql/sql_yacc.yy14051
-rw-r--r--sql/stacktrace.c23
-rw-r--r--sql/stacktrace.h2
-rw-r--r--sql/strfunc.cc6
-rw-r--r--sql/structs.h24
-rw-r--r--sql/table.cc706
-rw-r--r--sql/table.h357
-rw-r--r--sql/thr_malloc.cc31
-rw-r--r--sql/time.cc2
-rw-r--r--sql/tzfile.h16
-rw-r--r--sql/tztime.cc90
-rw-r--r--sql/tztime.h1
-rw-r--r--sql/udf_example.c38
-rw-r--r--sql/udf_example.def2
-rw-r--r--sql/uniques.cc32
-rw-r--r--sql/unireg.cc123
-rw-r--r--sql/unireg.h39
-rw-r--r--storage/archive/CMakeLists.txt8
-rw-r--r--storage/archive/archive_reader.c16
-rw-r--r--storage/archive/azio.c45
-rw-r--r--storage/archive/azlib.h2
-rw-r--r--storage/archive/ha_archive.cc176
-rw-r--r--storage/archive/ha_archive.h38
-rw-r--r--storage/blackhole/CMakeLists.txt7
-rw-r--r--storage/blackhole/ha_blackhole.cc150
-rw-r--r--storage/blackhole/ha_blackhole.h42
-rw-r--r--storage/csv/CMakeLists.txt7
-rw-r--r--storage/csv/ha_tina.cc231
-rw-r--r--storage/csv/ha_tina.h34
-rw-r--r--storage/csv/transparent_file.cc46
-rw-r--r--storage/csv/transparent_file.h4
-rw-r--r--storage/example/CMakeLists.txt7
-rw-r--r--storage/example/ha_example.cc52
-rw-r--r--storage/example/ha_example.h31
-rw-r--r--storage/example/plug.in2
-rw-r--r--storage/federated/CMakeLists.txt7
-rw-r--r--storage/federated/ha_federated.cc874
-rw-r--r--storage/federated/ha_federated.h49
-rwxr-xr-x[-rw-r--r--]storage/heap/CMakeLists.txt7
-rw-r--r--storage/heap/_check.c4
-rw-r--r--storage/heap/_rectest.c2
-rw-r--r--storage/heap/ha_heap.cc123
-rw-r--r--storage/heap/ha_heap.h45
-rw-r--r--storage/heap/heapdef.h54
-rw-r--r--storage/heap/hp_block.c23
-rw-r--r--storage/heap/hp_clear.c4
-rw-r--r--storage/heap/hp_close.c5
-rw-r--r--storage/heap/hp_create.c73
-rw-r--r--storage/heap/hp_delete.c10
-rw-r--r--storage/heap/hp_hash.c73
-rw-r--r--storage/heap/hp_info.c2
-rw-r--r--storage/heap/hp_open.c85
-rw-r--r--storage/heap/hp_rfirst.c6
-rw-r--r--storage/heap/hp_rkey.c8
-rw-r--r--storage/heap/hp_rlast.c6
-rw-r--r--storage/heap/hp_rnext.c6
-rw-r--r--storage/heap/hp_rprev.c6
-rw-r--r--storage/heap/hp_rrnd.c4
-rw-r--r--storage/heap/hp_rsame.c2
-rw-r--r--storage/heap/hp_scan.c2
-rw-r--r--storage/heap/hp_test1.c24
-rw-r--r--storage/heap/hp_test2.c79
-rw-r--r--storage/heap/hp_update.c4
-rw-r--r--storage/heap/hp_write.c32
-rwxr-xr-x[-rw-r--r--]storage/innobase/CMakeLists.txt13
-rw-r--r--storage/innobase/Makefile.am227
-rw-r--r--storage/innobase/btr/Makefile.am25
-rw-r--r--storage/innobase/btr/btr0btr.c7
-rw-r--r--storage/innobase/buf/Makefile.am25
-rw-r--r--storage/innobase/buf/buf0buf.c12
-rw-r--r--storage/innobase/buf/buf0lru.c13
-rw-r--r--storage/innobase/data/Makefile.am25
-rw-r--r--storage/innobase/data/data0data.c2
-rw-r--r--storage/innobase/data/data0type.c3
-rw-r--r--storage/innobase/dict/Makefile.am26
-rw-r--r--storage/innobase/dict/dict0boot.c65
-rw-r--r--storage/innobase/dict/dict0crea.c5
-rw-r--r--storage/innobase/dict/dict0dict.c182
-rw-r--r--storage/innobase/dict/dict0load.c9
-rw-r--r--storage/innobase/dict/dict0mem.c80
-rw-r--r--storage/innobase/dyn/Makefile.am25
-rw-r--r--storage/innobase/eval/Makefile.am25
-rw-r--r--storage/innobase/fil/Makefile.am25
-rw-r--r--storage/innobase/fsp/Makefile.am26
-rw-r--r--storage/innobase/fsp/fsp0fsp.c16
-rw-r--r--storage/innobase/fut/Makefile.am25
-rw-r--r--storage/innobase/ha/Makefile.am25
-rw-r--r--storage/innobase/handler/Makefile.am28
-rw-r--r--storage/innobase/handler/ha_innodb.cc2049
-rw-r--r--storage/innobase/handler/ha_innodb.h134
-rw-r--r--storage/innobase/ibuf/Makefile.am25
-rw-r--r--storage/innobase/ibuf/ibuf0ibuf.c106
-rw-r--r--storage/innobase/include/Makefile.i10
-rw-r--r--storage/innobase/include/buf0buf.ic2
-rw-r--r--storage/innobase/include/db0err.h5
-rw-r--r--storage/innobase/include/dict0dict.h61
-rw-r--r--storage/innobase/include/dict0dict.ic24
-rw-r--r--storage/innobase/include/dict0mem.h39
-rw-r--r--storage/innobase/include/fsp0fsp.h2
-rw-r--r--storage/innobase/include/ha_prototypes.h29
-rw-r--r--storage/innobase/include/lock0iter.h52
-rw-r--r--storage/innobase/include/lock0lock.h14
-rw-r--r--storage/innobase/include/lock0priv.h101
-rw-r--r--storage/innobase/include/lock0priv.ic32
-rw-r--r--storage/innobase/include/mem0mem.ic18
-rw-r--r--storage/innobase/include/os0file.h3
-rw-r--r--storage/innobase/include/page0page.h9
-rw-r--r--storage/innobase/include/rem0rec.ic6
-rw-r--r--storage/innobase/include/row0mysql.h1
-rw-r--r--storage/innobase/include/row0sel.h10
-rw-r--r--storage/innobase/include/sync0rw.ic2
-rw-r--r--storage/innobase/include/trx0trx.h64
-rw-r--r--storage/innobase/include/trx0undo.h13
-rw-r--r--storage/innobase/include/univ.i16
-rw-r--r--storage/innobase/include/ut0mem.h2
-rw-r--r--storage/innobase/include/ut0ut.h5
-rw-r--r--storage/innobase/lock/Makefile.am25
-rw-r--r--storage/innobase/lock/lock0iter.c90
-rw-r--r--storage/innobase/lock/lock0lock.c88
-rw-r--r--storage/innobase/log/Makefile.am25
-rw-r--r--storage/innobase/log/log0log.c34
-rw-r--r--storage/innobase/log/log0recv.c246
-rw-r--r--storage/innobase/mach/Makefile.am25
-rw-r--r--storage/innobase/mem/Makefile.am27
-rw-r--r--storage/innobase/mem/mem0mem.c1
-rw-r--r--storage/innobase/mem/mem0pool.c6
-rw-r--r--storage/innobase/mtr/Makefile.am25
-rw-r--r--storage/innobase/mtr/mtr0log.c28
-rw-r--r--storage/innobase/os/Makefile.am25
-rw-r--r--storage/innobase/os/os0file.c19
-rw-r--r--storage/innobase/page/Makefile.am25
-rw-r--r--storage/innobase/page/page0page.c12
-rw-r--r--storage/innobase/pars/Makefile.am27
-rw-r--r--storage/innobase/pars/pars0pars.c3
-rw-r--r--storage/innobase/plug.in37
-rw-r--r--storage/innobase/que/Makefile.am25
-rw-r--r--storage/innobase/read/Makefile.am25
-rw-r--r--storage/innobase/rem/Makefile.am25
-rw-r--r--storage/innobase/rem/rem0rec.c46
-rw-r--r--storage/innobase/row/Makefile.am26
-rw-r--r--storage/innobase/row/row0ins.c46
-rw-r--r--storage/innobase/row/row0mysql.c7
-rw-r--r--storage/innobase/row/row0row.c23
-rw-r--r--storage/innobase/row/row0sel.c172
-rw-r--r--storage/innobase/srv/Makefile.am25
-rw-r--r--storage/innobase/srv/srv0srv.c54
-rw-r--r--storage/innobase/srv/srv0start.c6
-rw-r--r--storage/innobase/sync/Makefile.am25
-rw-r--r--storage/innobase/sync/sync0arr.c4
-rw-r--r--storage/innobase/sync/sync0rw.c18
-rw-r--r--storage/innobase/sync/sync0sync.c1
-rw-r--r--storage/innobase/thr/Makefile.am25
-rw-r--r--storage/innobase/trx/Makefile.am26
-rw-r--r--storage/innobase/trx/trx0rec.c19
-rw-r--r--storage/innobase/trx/trx0sys.c13
-rw-r--r--storage/innobase/trx/trx0trx.c92
-rw-r--r--storage/innobase/trx/trx0undo.c101
-rw-r--r--storage/innobase/usr/Makefile.am25
-rw-r--r--storage/innobase/ut/Makefile.am25
-rw-r--r--storage/innobase/ut/ut0mem.c2
-rw-r--r--storage/innobase/ut/ut0ut.c1
-rwxr-xr-x[-rw-r--r--]storage/myisam/CMakeLists.txt37
-rw-r--r--storage/myisam/ft_boolean_search.c145
-rw-r--r--storage/myisam/ft_nlq_search.c22
-rw-r--r--storage/myisam/ft_parser.c70
-rw-r--r--storage/myisam/ft_static.c4
-rw-r--r--storage/myisam/ft_stopwords.c6
-rw-r--r--storage/myisam/ft_update.c28
-rw-r--r--storage/myisam/ftdefs.h32
-rw-r--r--storage/myisam/fulltext.h6
-rw-r--r--storage/myisam/ha_myisam.cc252
-rw-r--r--storage/myisam/ha_myisam.h51
-rw-r--r--storage/myisam/mi_cache.c6
-rw-r--r--storage/myisam/mi_check.c174
-rw-r--r--storage/myisam/mi_checksum.c8
-rw-r--r--storage/myisam/mi_close.c10
-rw-r--r--storage/myisam/mi_create.c8
-rw-r--r--storage/myisam/mi_delete.c76
-rw-r--r--storage/myisam/mi_delete_all.c2
-rw-r--r--storage/myisam/mi_dynrec.c185
-rw-r--r--storage/myisam/mi_extra.c20
-rw-r--r--storage/myisam/mi_key.c73
-rw-r--r--storage/myisam/mi_keycache.c3
-rw-r--r--storage/myisam/mi_locking.c6
-rw-r--r--storage/myisam/mi_log.c21
-rw-r--r--storage/myisam/mi_open.c77
-rw-r--r--storage/myisam/mi_packrec.c105
-rw-r--r--storage/myisam/mi_page.c12
-rw-r--r--storage/myisam/mi_preload.c19
-rw-r--r--storage/myisam/mi_range.c4
-rw-r--r--storage/myisam/mi_rfirst.c2
-rw-r--r--storage/myisam/mi_rkey.c84
-rw-r--r--storage/myisam/mi_rlast.c2
-rw-r--r--storage/myisam/mi_rnext.c2
-rw-r--r--storage/myisam/mi_rnext_same.c2
-rw-r--r--storage/myisam/mi_rprev.c2
-rw-r--r--storage/myisam/mi_rrnd.c2
-rw-r--r--storage/myisam/mi_rsame.c2
-rw-r--r--storage/myisam/mi_rsamepos.c2
-rw-r--r--storage/myisam/mi_scan.c2
-rw-r--r--storage/myisam/mi_search.c26
-rw-r--r--storage/myisam/mi_static.c2
-rw-r--r--storage/myisam/mi_statrec.c48
-rw-r--r--storage/myisam/mi_test1.c116
-rw-r--r--storage/myisam/mi_test2.c67
-rw-r--r--storage/myisam/mi_test3.c20
-rw-r--r--storage/myisam/mi_unique.c16
-rw-r--r--storage/myisam/mi_update.c10
-rw-r--r--storage/myisam/mi_write.c64
-rw-r--r--storage/myisam/myisam_ftdump.c2
-rw-r--r--storage/myisam/myisamchk.c96
-rw-r--r--storage/myisam/myisamdef.h135
-rw-r--r--storage/myisam/myisamlog.c63
-rw-r--r--storage/myisam/myisampack.c124
-rw-r--r--storage/myisam/rt_index.c32
-rw-r--r--storage/myisam/rt_split.c4
-rw-r--r--storage/myisam/rt_test.c34
-rw-r--r--storage/myisam/sort.c96
-rw-r--r--storage/myisam/sp_defs.h2
-rw-r--r--storage/myisam/sp_key.c77
-rw-r--r--storage/myisam/sp_test.c36
-rwxr-xr-x[-rw-r--r--]storage/myisammrg/CMakeLists.txt7
-rw-r--r--storage/myisammrg/ha_myisammrg.cc121
-rw-r--r--storage/myisammrg/ha_myisammrg.h35
-rw-r--r--storage/myisammrg/myrg_close.c2
-rw-r--r--storage/myisammrg/myrg_create.c4
-rw-r--r--storage/myisammrg/myrg_def.h7
-rw-r--r--storage/myisammrg/myrg_delete.c2
-rw-r--r--storage/myisammrg/myrg_locking.c8
-rw-r--r--storage/myisammrg/myrg_open.c25
-rw-r--r--storage/myisammrg/myrg_queue.c4
-rw-r--r--storage/myisammrg/myrg_rfirst.c4
-rw-r--r--storage/myisammrg/myrg_rkey.c10
-rw-r--r--storage/myisammrg/myrg_rlast.c4
-rw-r--r--storage/myisammrg/myrg_rnext.c4
-rw-r--r--storage/myisammrg/myrg_rnext_same.c4
-rw-r--r--storage/myisammrg/myrg_rprev.c4
-rw-r--r--storage/myisammrg/myrg_rrnd.c12
-rw-r--r--storage/myisammrg/myrg_rsame.c2
-rw-r--r--storage/myisammrg/myrg_update.c2
-rw-r--r--storage/myisammrg/myrg_write.c2
-rw-r--r--storage/ndb/MAINTAINERS163
-rw-r--r--storage/ndb/config/common.mk.am2
-rw-r--r--storage/ndb/include/Makefile.am1
-rw-r--r--storage/ndb/include/debugger/EventLogger.hpp2
-rw-r--r--storage/ndb/include/kernel/signaldata/FsOpenReq.hpp2
-rw-r--r--storage/ndb/include/mgmapi/mgmapi.h102
-rw-r--r--storage/ndb/include/mgmapi/mgmapi_config_parameters.h7
-rw-r--r--storage/ndb/include/mgmapi/mgmapi_error.h121
-rw-r--r--storage/ndb/include/mgmapi/ndbd_exit_codes.h3
-rw-r--r--storage/ndb/include/ndb_global.h.in2
-rw-r--r--storage/ndb/include/ndb_version.h.in57
-rw-r--r--storage/ndb/include/ndbapi/Ndb.hpp46
-rw-r--r--storage/ndb/include/ndbapi/NdbOperation.hpp7
-rw-r--r--storage/ndb/include/ndbapi/NdbRecAttr.hpp28
-rw-r--r--storage/ndb/include/portlib/NdbThread.h2
-rw-r--r--storage/ndb/include/portlib/NdbTick.h4
-rw-r--r--storage/ndb/include/util/ndb_opts.h22
-rw-r--r--storage/ndb/include/util/version.h23
-rw-r--r--storage/ndb/ndbapi-examples/mgmapi_logevent/Makefile6
-rw-r--r--storage/ndb/ndbapi-examples/mgmapi_logevent/main.cpp (renamed from storage/ndb/ndbapi-examples/mgmapi_logevent/mgmapi_logevent.cpp)0
-rw-r--r--storage/ndb/ndbapi-examples/mgmapi_logevent2/Makefile6
-rw-r--r--storage/ndb/ndbapi-examples/mgmapi_logevent2/main.cpp (renamed from storage/ndb/ndbapi-examples/mgmapi_logevent2/mgmapi_logevent2.cpp)0
-rw-r--r--storage/ndb/ndbapi-examples/ndbapi_async1/ndbapi_async1.cpp2
-rw-r--r--storage/ndb/ndbapi-examples/ndbapi_simple/ndbapi_simple.cpp12
-rw-r--r--storage/ndb/ndbapi-examples/ndbapi_simple_dual/Makefile6
-rw-r--r--storage/ndb/ndbapi-examples/ndbapi_simple_dual/main.cpp (renamed from storage/ndb/ndbapi-examples/ndbapi_simple_dual/ndbapi_simple_dual.cpp)0
-rw-r--r--storage/ndb/ndbapi-examples/ndbapi_simple_index/Makefile6
-rw-r--r--storage/ndb/ndbapi-examples/ndbapi_simple_index/main.cpp (renamed from storage/ndb/ndbapi-examples/ndbapi_simple_index/ndbapi_simple_index.cpp)0
-rw-r--r--storage/ndb/src/common/debugger/signaldata/SignalNames.cpp8
-rw-r--r--storage/ndb/src/common/portlib/NdbTick.c4
-rw-r--r--storage/ndb/src/common/transporter/Packer.cpp5
-rw-r--r--storage/ndb/src/common/transporter/SCI_Transporter.cpp216
-rw-r--r--storage/ndb/src/common/transporter/SCI_Transporter.hpp18
-rw-r--r--storage/ndb/src/common/transporter/TCP_Transporter.hpp4
-rw-r--r--storage/ndb/src/common/transporter/TransporterRegistry.cpp51
-rw-r--r--storage/ndb/src/common/util/version.c23
-rw-r--r--storage/ndb/src/cw/cpcd/main.cpp12
-rw-r--r--storage/ndb/src/kernel/blocks/ERROR_codes.txt20
-rw-r--r--storage/ndb/src/kernel/blocks/backup/Backup.cpp86
-rw-r--r--storage/ndb/src/kernel/blocks/backup/Backup.hpp3
-rw-r--r--storage/ndb/src/kernel/blocks/backup/BackupFormat.hpp10
-rw-r--r--storage/ndb/src/kernel/blocks/backup/BackupInit.cpp7
-rw-r--r--storage/ndb/src/kernel/blocks/backup/FsBuffer.hpp24
-rw-r--r--storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp17
-rw-r--r--storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp5
-rw-r--r--storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp925
-rw-r--r--storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp9
-rw-r--r--storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp2
-rw-r--r--storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp2
-rw-r--r--storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp217
-rw-r--r--storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp28
-rw-r--r--storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp21
-rw-r--r--storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp721
-rw-r--r--storage/ndb/src/kernel/blocks/dblqh/Makefile.am2
-rw-r--r--storage/ndb/src/kernel/blocks/dblqh/redoLogReader/reader.cpp (renamed from storage/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp)0
-rw-r--r--storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp10
-rw-r--r--storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp164
-rw-r--r--storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp15
-rw-r--r--storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp3
-rw-r--r--storage/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp47
-rw-r--r--storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp21
-rw-r--r--storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp17
-rw-r--r--storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp22
-rw-r--r--storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp87
-rw-r--r--storage/ndb/src/kernel/blocks/dbtup/DbtupPagMan.cpp61
-rw-r--r--storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp5
-rw-r--r--storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp66
-rw-r--r--storage/ndb/src/kernel/blocks/diskpage.cpp2
-rw-r--r--storage/ndb/src/kernel/blocks/lgman.cpp37
-rw-r--r--storage/ndb/src/kernel/blocks/lgman.hpp3
-rw-r--r--storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp45
-rw-r--r--storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp160
-rw-r--r--storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp6
-rw-r--r--storage/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp2
-rw-r--r--storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp2
-rw-r--r--storage/ndb/src/kernel/blocks/pgman.cpp133
-rw-r--r--storage/ndb/src/kernel/blocks/pgman.hpp6
-rw-r--r--storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp4
-rw-r--r--storage/ndb/src/kernel/blocks/restore.cpp5
-rw-r--r--storage/ndb/src/kernel/blocks/tsman.cpp6
-rw-r--r--storage/ndb/src/kernel/error/ndbd_exit_codes.c2
-rw-r--r--storage/ndb/src/kernel/vm/Configuration.cpp28
-rw-r--r--storage/ndb/src/kernel/vm/Configuration.hpp1
-rw-r--r--storage/ndb/src/kernel/vm/DynArr256.cpp101
-rw-r--r--storage/ndb/src/kernel/vm/DynArr256.hpp12
-rw-r--r--storage/ndb/src/kernel/vm/RWPool.cpp2
-rw-r--r--storage/ndb/src/kernel/vm/SimulatedBlock.cpp48
-rw-r--r--storage/ndb/src/kernel/vm/SimulatedBlock.hpp10
-rw-r--r--storage/ndb/src/kernel/vm/WatchDog.cpp152
-rw-r--r--storage/ndb/src/mgmapi/mgmapi.cpp4
-rw-r--r--storage/ndb/src/mgmclient/CommandInterpreter.cpp249
-rw-r--r--storage/ndb/src/mgmclient/Makefile.am4
-rw-r--r--storage/ndb/src/mgmclient/main.cpp31
-rw-r--r--storage/ndb/src/mgmsrv/ConfigInfo.cpp87
-rw-r--r--storage/ndb/src/mgmsrv/InitConfigFileParser.cpp43
-rw-r--r--storage/ndb/src/mgmsrv/Makefile.am2
-rw-r--r--storage/ndb/src/mgmsrv/MgmtSrvr.cpp86
-rw-r--r--storage/ndb/src/mgmsrv/MgmtSrvr.hpp39
-rw-r--r--storage/ndb/src/mgmsrv/Services.cpp2
-rw-r--r--storage/ndb/src/mgmsrv/main.cpp14
-rw-r--r--storage/ndb/src/mgmsrv/ndb_mgmd_error.h33
-rw-r--r--storage/ndb/src/ndbapi/ClusterMgr.cpp8
-rw-r--r--storage/ndb/src/ndbapi/ClusterMgr.hpp2
-rw-r--r--storage/ndb/src/ndbapi/Ndb.cpp274
-rw-r--r--storage/ndb/src/ndbapi/NdbBlob.cpp17
-rw-r--r--storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp2
-rw-r--r--storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp2
-rw-r--r--storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp3
-rw-r--r--storage/ndb/src/ndbapi/NdbOperation.cpp8
-rw-r--r--storage/ndb/src/ndbapi/NdbOperationDefine.cpp1
-rw-r--r--storage/ndb/src/ndbapi/NdbOperationInt.cpp2
-rw-r--r--storage/ndb/src/ndbapi/NdbRecAttr.cpp6
-rw-r--r--storage/ndb/src/ndbapi/NdbScanOperation.cpp4
-rw-r--r--storage/ndb/src/ndbapi/NdbTransaction.cpp38
-rw-r--r--storage/ndb/src/ndbapi/ndb_internal.hpp26
-rw-r--r--storage/ndb/src/ndbapi/ndberror.c36
-rw-r--r--storage/ndb/test/include/HugoTransactions.hpp16
-rw-r--r--storage/ndb/test/include/NDBT_Thread.hpp226
-rw-r--r--storage/ndb/test/ndbapi/benchronja.cpp19
-rw-r--r--storage/ndb/test/ndbapi/flexAsynch.cpp19
-rw-r--r--storage/ndb/test/ndbapi/flexHammer.cpp15
-rw-r--r--storage/ndb/test/ndbapi/flexScan.cpp11
-rw-r--r--storage/ndb/test/ndbapi/flexTT.cpp19
-rw-r--r--storage/ndb/test/ndbapi/flexTimedAsynch.cpp23
-rw-r--r--storage/ndb/test/ndbapi/initronja.cpp9
-rw-r--r--storage/ndb/test/ndbapi/testBasic.cpp125
-rw-r--r--storage/ndb/test/ndbapi/testDict.cpp157
-rw-r--r--storage/ndb/test/ndbapi/testIndex.cpp118
-rw-r--r--storage/ndb/test/ndbapi/testIndexStat.cpp30
-rw-r--r--storage/ndb/test/ndbapi/testMgm.cpp75
-rw-r--r--storage/ndb/test/ndbapi/testNdbApi.cpp34
-rw-r--r--storage/ndb/test/ndbapi/testNodeRestart.cpp145
-rw-r--r--storage/ndb/test/ndbapi/testOperations.cpp5
-rw-r--r--storage/ndb/test/ndbapi/testScanFilter.cpp12
-rw-r--r--storage/ndb/test/ndbapi/testSystemRestart.cpp95
-rw-r--r--storage/ndb/test/ndbapi/test_event_merge.cpp34
-rw-r--r--storage/ndb/test/odbc/SQL99_test/SQL99_test.cpp13
-rw-r--r--storage/ndb/test/run-test/Makefile.am4
-rw-r--r--storage/ndb/test/run-test/autotest-boot.sh35
-rw-r--r--storage/ndb/test/run-test/autotest-run.sh6
-rw-r--r--storage/ndb/test/run-test/conf-dl145a.cnf3
-rw-r--r--storage/ndb/test/run-test/conf-test.cnf26
-rw-r--r--storage/ndb/test/run-test/daily-basic-tests.txt39
-rw-r--r--storage/ndb/test/run-test/main.cpp36
-rw-r--r--storage/ndb/test/run-test/upgrade-boot.sh218
-rw-r--r--storage/ndb/test/src/HugoTransactions.cpp78
-rw-r--r--storage/ndb/test/src/Makefile.am2
-rw-r--r--storage/ndb/test/src/NDBT_Test.cpp20
-rw-r--r--storage/ndb/test/src/NDBT_Thread.cpp283
-rw-r--r--storage/ndb/test/tools/hugoFill.cpp4
-rw-r--r--storage/ndb/test/tools/hugoPkDelete.cpp94
-rw-r--r--storage/ndb/test/tools/hugoPkRead.cpp89
-rw-r--r--storage/ndb/test/tools/hugoPkUpdate.cpp98
-rw-r--r--storage/ndb/tools/delete_all.cpp8
-rw-r--r--storage/ndb/tools/desc.cpp8
-rw-r--r--storage/ndb/tools/drop_index.cpp2
-rw-r--r--storage/ndb/tools/drop_tab.cpp2
-rw-r--r--storage/ndb/tools/listTables.cpp12
-rw-r--r--storage/ndb/tools/ndb_config.cpp22
-rw-r--r--storage/ndb/tools/ndb_error_reporter4
-rw-r--r--storage/ndb/tools/ndb_size.pl165
-rw-r--r--storage/ndb/tools/restore/Restore.cpp59
-rw-r--r--storage/ndb/tools/restore/consumer_restore.cpp49
-rw-r--r--storage/ndb/tools/restore/consumer_restore.hpp2
-rw-r--r--storage/ndb/tools/restore/restore_main.cpp75
-rw-r--r--storage/ndb/tools/select_all.cpp26
-rw-r--r--storage/ndb/tools/select_count.cpp6
-rw-r--r--storage/ndb/tools/waiter.cpp8
-rwxr-xr-x[-rw-r--r--]strings/CMakeLists.txt9
-rw-r--r--strings/bchange.c6
-rw-r--r--strings/bcmp.c6
-rw-r--r--strings/bmove512.c2
-rw-r--r--strings/bmove_upp.c3
-rw-r--r--strings/conf_to_src.c33
-rw-r--r--strings/ctype-big5.c59
-rw-r--r--strings/ctype-bin.c199
-rw-r--r--strings/ctype-cp932.c65
-rw-r--r--strings/ctype-czech.c36
-rw-r--r--strings/ctype-euc_kr.c13
-rw-r--r--strings/ctype-eucjpms.c27
-rw-r--r--strings/ctype-extra.c29
-rw-r--r--strings/ctype-gb2312.c10
-rw-r--r--strings/ctype-gbk.c51
-rw-r--r--strings/ctype-latin1.c38
-rw-r--r--strings/ctype-mb.c170
-rw-r--r--strings/ctype-simple.c212
-rw-r--r--strings/ctype-sjis.c57
-rw-r--r--strings/ctype-tis620.c42
-rw-r--r--strings/ctype-uca.c108
-rw-r--r--strings/ctype-ucs2.c219
-rw-r--r--strings/ctype-ujis.c46
-rw-r--r--strings/ctype-utf8.c106
-rw-r--r--strings/ctype-win1250ch.c34
-rw-r--r--strings/ctype.c105
-rw-r--r--strings/decimal.c25
-rw-r--r--strings/do_ctype.c16
-rw-r--r--strings/my_strtoll10.c2
-rw-r--r--strings/my_vsnprintf.c26
-rw-r--r--strings/r_strinstr.c12
-rw-r--r--strings/str_test.c6
-rw-r--r--strings/strappend.c2
-rw-r--r--strings/strcont.c4
-rw-r--r--strings/strfill.c2
-rw-r--r--strings/strinstr.c10
-rw-r--r--strings/strlen.c8
-rw-r--r--strings/strmake.c2
-rw-r--r--strings/strnlen.c4
-rw-r--r--strings/strnmov.c2
-rw-r--r--strings/strto.c2
-rw-r--r--strings/strtod.c67
-rw-r--r--strings/strxnmov.c2
-rw-r--r--strings/xml.c55
-rw-r--r--support-files/Makefile.am10
-rw-r--r--support-files/compiler_warnings.supp9
-rw-r--r--support-files/mysql.server.sh2
-rwxr-xr-x[-rw-r--r--]tests/CMakeLists.txt11
-rw-r--r--tests/Makefile.am5
-rw-r--r--tests/bug25714.c72
-rw-r--r--tests/mysql_client_test.c457
-rw-r--r--tests/thread_test.c28
-rw-r--r--unittest/Makefile.am3
-rw-r--r--unittest/examples/Makefile.am2
-rw-r--r--unittest/mysys/Makefile.am2
-rw-r--r--unittest/mysys/base64-t.c2
-rw-r--r--unittest/mysys/bitmap-t.c9
-rw-r--r--unittest/mysys/my_atomic-t.c3
-rw-r--r--unittest/mytap/Makefile.am3
-rw-r--r--unittest/mytap/t/Makefile.am2
-rwxr-xr-x[-rw-r--r--]vio/CMakeLists.txt8
-rw-r--r--vio/test-ssl.c26
-rw-r--r--vio/test-sslclient.c6
-rw-r--r--vio/test-sslserver.c8
-rw-r--r--vio/vio.c4
-rw-r--r--vio/vio_priv.h5
-rw-r--r--vio/viosocket.c139
-rw-r--r--vio/viossl.c178
-rw-r--r--vio/viosslfactories.c2
-rw-r--r--vio/viotest-ssl.c26
-rw-r--r--win/Makefile.am2
-rw-r--r--win/README25
-rw-r--r--win/build-nmake-x64.bat21
-rw-r--r--win/build-nmake.bat21
-rw-r--r--win/configure.js2
-rwxr-xr-xwin/create_manifest.js19
-rwxr-xr-xwin/mysql_manifest.cmake9
-rwxr-xr-x[-rw-r--r--]zlib/CMakeLists.txt15
2826 files changed, 218405 insertions, 125157 deletions
diff --git a/.bzrignore b/.bzrignore
index 70d966f9ccc..e1ad5a89015 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -5,6 +5,7 @@
*.bb
*.bbg
*.bin
+*.cdf
*.core
*.d
*.da
@@ -38,7 +39,9 @@
*/.libs/*
*/.pure
*/debug/*
+*/minsizerel/*
*/release/*
+*/relwithdebinfo/*
*~
.*.swp
./CMakeCache.txt
@@ -473,6 +476,9 @@ contrib/*.vcproj
core
core.*
core.2430
+cscope.in.out
+cscope.out
+cscope.po.out
db-*.*.*
dbug/*.ds?
dbug/*.vcproj
@@ -489,6 +495,8 @@ dbug/main.r
dbug/output*.r
dbug/user.ps
dbug/user.t
+debian/control
+debian/defs.mk
depcomp
emacs.h
examples/*.ds?
@@ -580,6 +588,7 @@ heap/hp_test2
help
help.c
help.h
+include/abi_check
include/check_abi
include/link_sources
include/my_config.h
@@ -1017,6 +1026,7 @@ libmysqld/.deps/unireg.Po
libmysqld/backup_dir
libmysqld/client.c
libmysqld/client_settings.h
+libmysqld/cmake_dummy.c
libmysqld/convert.cc
libmysqld/derror.cc
libmysqld/discover.cc
@@ -1071,6 +1081,7 @@ libmysqld/ha_myisam.cc
libmysqld/ha_myisammrg.cc
libmysqld/ha_ndbcluster.cc
libmysqld/ha_ndbcluster_binlog.cc
+libmysqld/ha_ndbcluster_cond.cc
libmysqld/ha_partition.cc
libmysqld/ha_tina.cc
libmysqld/handler.cc
@@ -1091,6 +1102,7 @@ libmysqld/item_sum.cc
libmysqld/item_timefunc.cc
libmysqld/item_uniq.cc
libmysqld/key.cc
+libmysqld/lex_hash.h
libmysqld/lib_sql.cpp
libmysqld/libmysql.c
libmysqld/link_sources
@@ -1099,6 +1111,8 @@ libmysqld/log.cc
libmysqld/log_event.cc
libmysqld/log_event_old.cc
libmysqld/md5.c
+libmysqld/message.h
+libmysqld/message.rc
libmysqld/mf_iocache.cc
libmysqld/mini_client.cc
libmysqld/my_decimal.cc
@@ -1274,7 +1288,6 @@ mysql-test/r/*.err
mysql-test/r/*.log
mysql-test/r/*.out
mysql-test/r/*.reject
-mysql-test/r/*.warnings
mysql-test/r/alter_table.err
mysql-test/r/archive.err
mysql-test/r/backup.log
@@ -2875,6 +2888,7 @@ support-files/mysql-3.23.29-gamma.spec
support-files/mysql-log-rotate
support-files/mysql.server
support-files/mysql.spec
+support-files/mysqld_multi.server
support-files/ndb-config-2-node.ini
tags
test/ndbapi/bank/bankCreator
@@ -2940,6 +2954,7 @@ tests/.deps/thread_test.Po
tests/.libs -prune
tests/.libs/lt-mysql_client_test
tests/.libs/mysql_client_test
+tests/bug25714
tests/client_test
tests/connect_test
tests/mysql_client_test
diff --git a/BUILD/Makefile.am b/BUILD/Makefile.am
index 46814a077de..82e31c4a47b 100644
--- a/BUILD/Makefile.am
+++ b/BUILD/Makefile.am
@@ -28,6 +28,7 @@ EXTRA_DIST = FINISH.sh \
compile-alpha-debug \
compile-amd64-debug-max \
compile-amd64-max \
+ compile-amd64-max-sci \
compile-darwin-mwcc \
compile-dist \
compile-hpux11-parisc2-aCC \
@@ -52,6 +53,7 @@ EXTRA_DIST = FINISH.sh \
compile-pentium-valgrind-max \
compile-pentium64-debug \
compile-pentium64-debug-max \
+ compile-pentium64-max-sci \
compile-pentium64-valgrind-max \
compile-ppc \
compile-ppc-debug \
diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh
index 6b3708f475f..e940f7a3371 100755
--- a/BUILD/SETUP.sh
+++ b/BUILD/SETUP.sh
@@ -105,7 +105,7 @@ if [ "x$warning_mode" != "xpedantic" ]; then
# Added unless --with-debug=full
debug_extra_cflags="-O1 -Wuninitialized"
else
- warnings="-W -Wall -ansi -pedantic -Wno-long-long -D_POSIX_SOURCE"
+ warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -D_POSIX_SOURCE"
c_warnings="$warnings"
cxx_warnings="$warnings -std=c++98"
# NOTE: warning mode should not influence optimize/debug mode.
@@ -207,3 +207,28 @@ then
echo "$CC" | grep "ccache" > /dev/null || CC="ccache $CC"
echo "$CXX" | grep "ccache" > /dev/null || CXX="ccache $CXX"
fi
+
+# gcov
+
+# The -fprofile-arcs and -ftest-coverage options cause GCC to instrument the
+# code with profiling information used by gcov.
+# The -DDISABLE_TAO_ASM is needed to avoid build failures in Yassl.
+# The -DHAVE_gcov enables code to write out coverage info even when crashing.
+
+gcov_compile_flags="-fprofile-arcs -ftest-coverage"
+gcov_compile_flags="$gcov_compile_flags -DDISABLE_TAO_ASM"
+gcov_compile_flags="$gcov_compile_flags -DMYSQL_SERVER_SUFFIX=-gcov -DHAVE_gcov"
+
+# GCC4 needs -fprofile-arcs -ftest-coverage on the linker command line (as well
+# as on the compiler command line), and this requires setting LDFLAGS for BDB.
+
+gcov_link_flags="-fprofile-arcs -ftest-coverage"
+
+gcov_configs="--disable-shared"
+
+# gprof
+
+gprof_compile_flags="-O2 -pg -g"
+
+gprof_link_flags="--disable-shared $static_link"
+
diff --git a/BUILD/check-cpu b/BUILD/check-cpu
index 2852aa98ef3..0720a53c54d 100755
--- a/BUILD/check-cpu
+++ b/BUILD/check-cpu
@@ -105,6 +105,12 @@ check_cpu () {
*Athlon*64*)
cpu_arg="athlon64";
;;
+ *Turion*)
+ cpu_arg="athlon64";
+ ;;
+ *Opteron*)
+ cpu_arg="athlon64";
+ ;;
*Athlon*)
cpu_arg="athlon";
;;
diff --git a/BUILD/compile-amd64-gcov b/BUILD/compile-amd64-gcov
new file mode 100755
index 00000000000..239a4aed0fb
--- /dev/null
+++ b/BUILD/compile-amd64-gcov
@@ -0,0 +1,17 @@
+#! /bin/sh
+
+path=`dirname $0`
+. "$path/SETUP.sh"
+
+# Need to disable ccache, or we loose the gcov-needed compiler output files.
+CCACHE_DISABLE=1
+export CCACHE_DISABLE
+
+export LDFLAGS="$gcov_link_flags"
+
+extra_flags="$amd64_cflags $debug_cflags $max_cflags $gcov_compile_flags"
+c_warnings="$c_warnings $debug_extra_warnings"
+cxx_warnings="$cxx_warnings $debug_extra_warnings"
+extra_configs="$amd64_configs $debug_configs $gcov_configs $max_configs"
+
+. "$path/FINISH.sh"
diff --git a/BUILD/compile-amd64-gprof b/BUILD/compile-amd64-gprof
new file mode 100755
index 00000000000..6cfb8a4302c
--- /dev/null
+++ b/BUILD/compile-amd64-gprof
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+path=`dirname $0`
+. "$path/SETUP.sh"
+
+extra_flags="$amd64_cflags $gprof_compile_flags"
+extra_configs="$amd64_configs $debug_configs $gprof_link_flags"
+
+. "$path/FINISH.sh"
diff --git a/BUILD/compile-amd64-max-sci b/BUILD/compile-amd64-max-sci
new file mode 100644
index 00000000000..4afa9004742
--- /dev/null
+++ b/BUILD/compile-amd64-max-sci
@@ -0,0 +1,8 @@
+#! /bin/sh
+
+path=`dirname $0`
+. "$path/SETUP.sh"
+extra_flags="$amd64_cflags $fast_cflags -g"
+extra_configs="$amd64_configs $max_configs --with-ndb-sci=/opt/DIS"
+
+. "$path/FINISH.sh"
diff --git a/BUILD/compile-dist b/BUILD/compile-dist
index 0ecb386bf71..2da2259a3f7 100755
--- a/BUILD/compile-dist
+++ b/BUILD/compile-dist
@@ -45,16 +45,5 @@ fi
# Make sure to enable all features that affect "make dist"
./configure \
- --with-embedded-server \
- --with-archive-storage-engine \
- --with-blackhole-storage-engine \
- --with-csv-storage-engine \
- --with-example-storage-engine \
- --with-federated-storage-engine \
- --with-innodb \
- --with-ssl \
- --enable-thread-safe-client \
- --with-extra-charsets=complex \
- --with-ndbcluster \
- --with-zlib-dir=bundled
+ --with-ndbcluster
make
diff --git a/BUILD/compile-pentium-gcov b/BUILD/compile-pentium-gcov
index 5ee3c071f61..42666b2632c 100755
--- a/BUILD/compile-pentium-gcov
+++ b/BUILD/compile-pentium-gcov
@@ -20,17 +20,11 @@ export CCACHE_GCOV_VERSION_ENABLED
path=`dirname $0`
. "$path/SETUP.sh"
-# GCC4 needs -fprofile-arcs -ftest-coverage on the linker command line (as well
-# as on the compiler command line), and this requires setting LDFLAGS for BDB.
-export LDFLAGS="-fprofile-arcs -ftest-coverage"
+export LDFLAGS="$gcov_link_flags"
-# The -fprofile-arcs and -ftest-coverage options cause GCC to instrument the
-# code with profiling information used by gcov.
-# the -DDISABLE_TAO_ASM is needed to avoid build failures in Yassl.
-extra_flags="$pentium_cflags -fprofile-arcs -ftest-coverage -DDISABLE_TAO_ASM -DHAVE_MUTEX_THREAD_ONLY $debug_extra_flags $debug_cflags $max_cflags -DMYSQL_SERVER_SUFFIX=-gcov"
-extra_configs="$pentium_configs $debug_configs --disable-shared $static_link"
-extra_configs="$extra_configs $max_configs"
+extra_flags="$pentium_cflags $debug_cflags $max_cflags $gcov_compile_flags"
c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings"
+extra_configs="$pentium_configs $debug_configs $gcov_configs $max_configs"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium-gprof b/BUILD/compile-pentium-gprof
index aa74de0b1b2..4aebc1d2e02 100755
--- a/BUILD/compile-pentium-gprof
+++ b/BUILD/compile-pentium-gprof
@@ -3,7 +3,7 @@
path=`dirname $0`
. "$path/SETUP.sh"
-extra_flags="$pentium_cflags -O2 -pg -g"
-extra_configs="$pentium_configs $debug_configs --disable-shared $static_link"
+extra_flags="$pentium_cflags $gprof_compile_flags"
+extra_configs="$pentium_configs $debug_configs $gprof_link_flags"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium64-gcov b/BUILD/compile-pentium64-gcov
new file mode 100755
index 00000000000..5a99b7f8796
--- /dev/null
+++ b/BUILD/compile-pentium64-gcov
@@ -0,0 +1,17 @@
+#! /bin/sh
+
+path=`dirname $0`
+. "$path/SETUP.sh"
+
+# Need to disable ccache, or we loose the gcov-needed compiler output files.
+CCACHE_DISABLE=1
+export CCACHE_DISABLE
+
+export LDFLAGS="$gcov_link_flags"
+
+extra_flags="$pentium64_cflags $debug_cflags $max_cflags $gcov_compile_flags"
+c_warnings="$c_warnings $debug_extra_warnings"
+cxx_warnings="$cxx_warnings $debug_extra_warnings"
+extra_configs="$pentium64_configs $debug_configs $gcov_configs $max_configs"
+
+. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium64-gprof b/BUILD/compile-pentium64-gprof
new file mode 100755
index 00000000000..f64dee6d196
--- /dev/null
+++ b/BUILD/compile-pentium64-gprof
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+path=`dirname $0`
+. "$path/SETUP.sh"
+
+extra_flags="$pentium64_cflags $gprof_compile_flags"
+extra_configs="$pentium64_configs $debug_configs $gprof_link_flags"
+
+. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium64-max-sci b/BUILD/compile-pentium64-max-sci
new file mode 100644
index 00000000000..9ebb1988475
--- /dev/null
+++ b/BUILD/compile-pentium64-max-sci
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+path=`dirname $0`
+. "$path/SETUP.sh"
+
+extra_flags="$pentium64_cflags $fast_cflags -g"
+extra_configs="$pentium_configs $max_configs --with-ndb-sci=/opt/DIS"
+
+. "$path/FINISH.sh"
diff --git a/BUILD/compile-solaris-sparc-debug b/BUILD/compile-solaris-sparc-debug
index 58fcecf5a71..43cabd644fa 100755
--- a/BUILD/compile-solaris-sparc-debug
+++ b/BUILD/compile-solaris-sparc-debug
@@ -6,6 +6,6 @@ make -k clean || true
path=`dirname $0`
. "$path/autorun.sh"
-CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa" CXX=gcc CXXFLAGS="-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa -g" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-debug
+CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -O3 -fno-omit-frame-pointer" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-debug
make -j 4
diff --git a/BUILD/compile-solaris-sparc-forte b/BUILD/compile-solaris-sparc-forte
index 2a8b7dbae48..b9fffcb7fdd 100755
--- a/BUILD/compile-solaris-sparc-forte
+++ b/BUILD/compile-solaris-sparc-forte
@@ -3,7 +3,13 @@
# Assume Forte is installed in /opt/SUNWSpro and ld is installed in
# /usr/ccs/bin
-PATH=/opt/SUNWspro/bin/:/usr/ccs/bin:$PATH
+PATH=/opt/SUNWspro/bin:/usr/ccs/bin:/usr/sfw/bin:/opt/csw/bin:$PATH
+
+prefix="/usr/local/mysql"
+if test -n "$MYSQL_BUILD_PREFIX"
+then
+ prefix="$MYSQL_BUILD_PREFIX"
+fi
make -k maintainer-clean || true
/bin/rm -f */.deps/*.P config.cache
@@ -12,9 +18,9 @@ path=`dirname $0`
. "$path/autorun.sh"
# For "optimal" code for this computer add -fast to EXTRA
-# To compile 64 bit, add -xarch=v9 to EXTRA_64_BIT
+# To compile 32/64 bit, uncomment/comment EXTRA_64_BIT
-EXTRA_64_BIT="-xarch=v9" # Remove comment to get 64 bit binaries
+EXTRA_64_BIT="-m64"
EXTRA="-fast" # Remove comment to target current machine
#
@@ -22,10 +28,9 @@ EXTRA="-fast" # Remove comment to target current machine
#
STD="-mt -D_FORTEC_ $EXTRA $EXTRA_64_BIT"
-ASFLAGS="$EXTRA_64_BIT" \
CC=cc-5.0 CFLAGS="-Xa -xstrconst $STD" \
CXX=CC CXXFLAGS="-noex $STD" \
-./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client
+./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --prefix=$PREFIX
make -j 4
if [ $? = 0 ]
diff --git a/BitKeeper/triggers/post-commit b/BitKeeper/triggers/post-commit
index b4dcb311dde..8376b9e0631 100755
--- a/BitKeeper/triggers/post-commit
+++ b/BitKeeper/triggers/post-commit
@@ -33,6 +33,13 @@ then
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`
#
@@ -48,44 +55,35 @@ WL=`bk -R prs -r+ -h -d':C:' ChangeSet | \
s/.*\(WL#[0-9][0-9]*\)/ \1/p'`
if [ "$BUG" = "" ]
then
- TO=dev-public@mysql.com
+# TO=dev-public@mysql.com
BS=""
BH=""
else
- TO=dev-bugs@mysql.com
+# TO=dev-bugs@mysql.com
BS=" BUG#$BUG"
# need newline here
BH="X-Bug: $BUG
"
fi
+
#++
-# dev-public@ / dev-bugs@
+# commits@ or dev-private@ mail
#--
- echo "Commit successful, notifying developers at $TO"
- (
- cat <<EOF
-List-ID: <bk.mysql-$VERSION>
-From: $FROM
-To: $TO
-Subject: bk commit - $VERSION tree ($CHANGESET)${BS}${WL}
-X-CSetKey: <$CSETKEY>
-$BH
-EOF
- bk changes -v -r+
- bk rset -r+ -ah | bk gnupatch -h -dup -T
- ) > $BKROOT/BitKeeper/tmp/dev_public.txt
-$SENDMAIL -t < $BKROOT/BitKeeper/tmp/dev_public.txt
+LIST="commits"
+TO="commits@lists.mysql.com"
+if [ -f .tree-is-private ]
+then
+ LIST="dev-private"
+ TO="dev-private@mysql.com"
+fi
-#++
-# commits@ mail
-#--
- echo "Notifying commits list at $COMMITS"
+ echo "Notifying $LIST list at $TO"
(
cat <<EOF
List-ID: <bk.mysql-$VERSION>
From: $FROM
-To: $COMMITS
+To: $TO
Subject: bk commit into $VERSION tree ($CHANGESET)$BS
X-CSetKey: <$CSETKEY>
$BH
@@ -98,7 +96,7 @@ see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
EOF
bk changes -v -r+
- bk cset -r+ -d
+ 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
@@ -120,7 +118,7 @@ Subject: bk commit - $VERSION tree (Manual) ($CHANGESET)$BS
EOF
bk changes -v -r+
- bk cset -r+ -d
+ bk rset -r+ -ah | bk gnupatch -h -dup -T
) > $BKROOT/BitKeeper/tmp/docs.txt
$SENDMAIL -t < $BKROOT/BitKeeper/tmp/docs.txt
fi
diff --git a/BitKeeper/triggers/pre-commit b/BitKeeper/triggers/pre-commit
index 524321e8b80..f4664ccf1fe 100755
--- a/BitKeeper/triggers/pre-commit
+++ b/BitKeeper/triggers/pre-commit
@@ -20,4 +20,3 @@ then
echo "Set REAL_EMAIL and retry."
exit 1
fi
-
diff --git a/BitKeeper/triggers/pre-outgoing.crash-protect.pl b/BitKeeper/triggers/pre-outgoing.crash-protect.pl
index 80567012c0f..b83e356e3f8 100755
--- a/BitKeeper/triggers/pre-outgoing.crash-protect.pl
+++ b/BitKeeper/triggers/pre-outgoing.crash-protect.pl
@@ -47,6 +47,7 @@ my @bad_csets=
'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.
diff --git a/BitKeeper/triggers/pre-resolve.crash-protect.pl b/BitKeeper/triggers/pre-resolve.crash-protect.pl
index 80567012c0f..b83e356e3f8 100755
--- a/BitKeeper/triggers/pre-resolve.crash-protect.pl
+++ b/BitKeeper/triggers/pre-resolve.crash-protect.pl
@@ -47,6 +47,7 @@ my @bad_csets=
'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.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 02755c5d138..b702810f2c3 100644..100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,44 +24,53 @@ SET(WITH_CSV_STORAGE_ENGINE TRUE)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/mysql_version.h.in
${CMAKE_SOURCE_DIR}/include/mysql_version.h @ONLY)
+# Set standard options
+ADD_DEFINITIONS(-DHAVE_YASSL)
+
+# Set debug options
+SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DFORCE_INIT_OF_VARS")
+
+# Note that some engines are always compiled in, MyISAM, MyISAMMRG and HEAP,
+# these three plugin defintions are dummys for symmetry
+
SET(WITH_HEAP_STORAGE_ENGINE TRUE)
-ADD_DEFINITIONS(-D WITH_HEAP_STORAGE_ENGINE)
+ADD_DEFINITIONS(-DWITH_HEAP_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_heap_plugin")
SET(WITH_MYISAM_STORAGE_ENGINE TRUE)
-ADD_DEFINITIONS(-D WITH_MYISAM_STORAGE_ENGINE)
+ADD_DEFINITIONS(-DWITH_MYISAM_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_myisam_plugin")
SET(WITH_MYISAMMRG_STORAGE_ENGINE TRUE)
-ADD_DEFINITIONS(-D WITH_MYISAMMRG_STORAGE_ENGINE)
+ADD_DEFINITIONS(-DWITH_MYISAMMRG_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_myisammrg_plugin")
IF(WITH_ARCHIVE_STORAGE_ENGINE)
- ADD_DEFINITIONS(-D WITH_ARCHIVE_STORAGE_ENGINE)
+ ADD_DEFINITIONS(-DWITH_ARCHIVE_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_archive_plugin")
ENDIF(WITH_ARCHIVE_STORAGE_ENGINE)
IF(WITH_BLACKHOLE_STORAGE_ENGINE)
- ADD_DEFINITIONS(-D WITH_BLACKHOLE_STORAGE_ENGINE)
+ ADD_DEFINITIONS(-DWITH_BLACKHOLE_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_blackhole_plugin")
ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE)
IF(WITH_CSV_STORAGE_ENGINE)
- ADD_DEFINITIONS(-D WITH_CSV_STORAGE_ENGINE)
+ ADD_DEFINITIONS(-DWITH_CSV_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_csv_plugin")
ENDIF(WITH_CSV_STORAGE_ENGINE)
IF(WITH_EXAMPLE_STORAGE_ENGINE)
- ADD_DEFINITIONS(-D WITH_EXAMPLE_STORAGE_ENGINE)
+ ADD_DEFINITIONS(-DWITH_EXAMPLE_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_example_plugin")
ENDIF(WITH_EXAMPLE_STORAGE_ENGINE)
IF(WITH_INNOBASE_STORAGE_ENGINE)
- ADD_DEFINITIONS(-D WITH_INNOBASE_STORAGE_ENGINE)
+ ADD_DEFINITIONS(-DWITH_INNOBASE_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_innobase_plugin")
ENDIF(WITH_INNOBASE_STORAGE_ENGINE)
IF(WITH_PARTITION_STORAGE_ENGINE)
- ADD_DEFINITIONS(-D WITH_PARTITION_STORAGE_ENGINE)
+ ADD_DEFINITIONS(-DWITH_PARTITION_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_partition_plugin")
ENDIF(WITH_PARTITION_STORAGE_ENGINE)
IF(WITH_FEDERATED_STORAGE_ENGINE)
- ADD_DEFINITIONS(-D WITH_FEDERATED_STORAGE_ENGINE)
+ ADD_DEFINITIONS(-DWITH_FEDERATED_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_federated_plugin")
ENDIF(WITH_FEDERATED_STORAGE_ENGINE)
@@ -81,86 +90,118 @@ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/support-files/my-small.cnf.sh
${CMAKE_SOURCE_DIR}/support-files/my-small.ini @ONLY)
IF(__NT__)
- ADD_DEFINITIONS(-D __NT__)
+ ADD_DEFINITIONS(-D__NT__)
ENDIF(__NT__)
IF(CYBOZU)
- ADD_DEFINITIONS(-D CYBOZU)
+ ADD_DEFINITIONS(-DCYBOZU)
ENDIF(CYBOZU)
# in some places we use DBUG_OFF
-SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -D DBUG_OFF")
-SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -D DBUG_OFF")
+SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DDBUG_OFF")
+SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DDBUG_OFF")
+SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DDBUG_OFF")
+SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DDBUG_OFF")
IF(CMAKE_GENERATOR MATCHES "Visual Studio 8")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4996")
+ SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /wd4996")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /wd4996")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /wd4996")
+ SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /wd4996")
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8")
IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR
CMAKE_GENERATOR MATCHES "Visual Studio 8")
- # replace /MDd with /MTd
- STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG_INIT
- ${CMAKE_CXX_FLAGS_DEBUG_INIT})
- STRING(REPLACE "/MDd" "/MTd" CMAKE_C_FLAGS_DEBUG_INIT
- ${CMAKE_C_FLAGS_DEBUG_INIT})
- STRING(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE
- ${CMAKE_C_FLAGS_RELEASE})
- STRING(REPLACE "/MDd" "/MTd" CMAKE_C_FLAGS_DEBUG
- ${CMAKE_C_FLAGS_DEBUG})
- STRING(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE
- ${CMAKE_CXX_FLAGS_RELEASE})
- STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG
- ${CMAKE_CXX_FLAGS_DEBUG})
-
- STRING(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELWITHDEBINFO
- ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
- STRING(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELWITHDEBINFO
- ${CMAKE_C_FLAGS_RELWITHDEBINFO})
-
- # generate .map files
- SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MAP /MAPINFO:EXPORTS")
-
- # remove support for Exception handling
- STRING(REPLACE "/GX" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
- STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
- STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS_INIT
- ${CMAKE_CXX_FLAGS_INIT})
- STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS_DEBUG_INIT
- ${CMAKE_CXX_FLAGS_DEBUG_INIT})
+
+ # replace /MDd with /MTd
+ STRING(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
+ STRING(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO})
+ STRING(REPLACE "/MDd" "/MTd" CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
+ STRING(REPLACE "/MDd" "/MTd" CMAKE_C_FLAGS_DEBUG_INIT ${CMAKE_C_FLAGS_DEBUG_INIT})
+
+ STRING(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
+ STRING(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
+ STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
+ STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG_INIT ${CMAKE_CXX_FLAGS_DEBUG_INIT})
+
+ # generate map files, set stack size (see bug#20815)
+ SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MAP /MAPINFO:EXPORTS")
+ SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:1048576")
+
+ # remove support for Exception handling
+ STRING(REPLACE "/GX" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+ STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+ STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS_INIT ${CMAKE_CXX_FLAGS_INIT})
+ STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS_DEBUG_INIT ${CMAKE_CXX_FLAGS_DEBUG_INIT})
+
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR
CMAKE_GENERATOR MATCHES "Visual Studio 8")
-ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D _CRT_SECURE_NO_DEPRECATE")
+IF(WIN32)
+ ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE")
+ENDIF(WIN32)
IF(EMBED_MANIFESTS)
- # Search for the Manifest tool. CMake will first search it's defaults
- # (CMAKE_FRAMEWORK_PATH, CMAKE_APPBUNDLE_PATH, CMAKE_PROGRAM_PATH and
- # the system PATH) followed by the listed paths which are the current
- # possible defaults and should be updated when necessary. The custom
- # manifests are designed to be compatible with all mt versions.
+ # Search for the tools (mt, makecat, signtool) necessary for embedding
+ # manifests and signing executables with the MySQL AB authenticode cert.
+ #
+ # CMake will first search it's defaults (CMAKE_FRAMEWORK_PATH,
+ # CMAKE_APPBUNDLE_PATH, CMAKE_PROGRAM_PATH and the system PATH) followed
+ # by the listed paths which are the current possible defaults and should be
+ # updated when necessary.
+ #
+ # The custom manifests are designed to be compatible with all mt versions.
+ # The MySQL AB Authenticode certificate is available only internally.
+ # Others should store a single signing certificate in a local cryptographic
+ # service provider and alter the signtool command as necessary.
FIND_PROGRAM(HAVE_MANIFEST_TOOL NAMES mt
PATHS
"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/VC/bin"
"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/Common7/Tools/Bin"
"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/SDK/v2.0/Bin")
+ FIND_PROGRAM(HAVE_CATALOG_TOOL NAMES makecat
+ PATHS
+ "$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/Common7/Tools/Bin")
+ FIND_PROGRAM(HAVE_SIGN_TOOL NAMES signtool
+ PATHS
+ "$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/Common7/Tools/Bin"
+ "$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/SDK/v2.0/Bin")
+
IF(HAVE_MANIFEST_TOOL)
- MESSAGE(STATUS "Found Mainfest Tool. Embedding custom manifests.")
+ MESSAGE(STATUS "Found Mainfest Tool.")
ELSE(HAVE_MANIFEST_TOOL)
MESSAGE(FATAL_ERROR "Manifest tool, mt.exe, can't be found.")
ENDIF(HAVE_MANIFEST_TOOL)
+ IF(HAVE_CATALOG_TOOL)
+ MESSAGE(STATUS "Found Catalog Tool.")
+ ELSE(HAVE_CATALOG_TOOL)
+ MESSAGE(FATAL_ERROR "Catalog tool, makecat.exe, can't be found.")
+ ENDIF(HAVE_CATALOG_TOOL)
+ IF(HAVE_SIGN_TOOL)
+ MESSAGE(STATUS "Found Sign Tool. Embedding custom manifests and signing executables.")
+ ELSE(HAVE_SIGN_TOOL)
+ MESSAGE(FATAL_ERROR "Sign tool, signtool.exe, can't be found.")
+ ENDIF(HAVE_SIGN_TOOL)
+
# Disable automatic manifest generation.
STRING(REPLACE "/MANIFEST" "/MANIFEST:NO" CMAKE_EXE_LINKER_FLAGS
${CMAKE_EXE_LINKER_FLAGS})
+ # Explicitly disable it since it is the default for newer versions of VS
+ STRING(REGEX MATCH "MANIFEST:NO" tmp_manifest ${CMAKE_EXE_LINKER_FLAGS})
+ IF(NOT tmp_manifest)
+ SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
+ ENDIF(NOT tmp_manifest)
# Set the processor architecture.
IF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64")
- SET(PROCESSOR_ARCH "X64")
+ SET(PROCESSOR_ARCH "amd64")
ELSE(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64")
SET(PROCESSOR_ARCH "X86")
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64")
ENDIF(EMBED_MANIFESTS)
+# FIXME "debug" only needed if build type is "Debug", but
+# CMAKE_BUILD_TYPE is not set during configure time.
ADD_SUBDIRECTORY(vio)
ADD_SUBDIRECTORY(dbug)
ADD_SUBDIRECTORY(strings)
@@ -197,7 +238,7 @@ ADD_SUBDIRECTORY(sql)
ADD_SUBDIRECTORY(server-tools/instance-manager)
ADD_SUBDIRECTORY(libmysql)
ADD_SUBDIRECTORY(tests)
-
-# disable libmysqld until it's fixed, so we can use Cmake 2.2 and 2.4
-#ADD_SUBDIRECTORY(libmysqld)
-#ADD_SUBDIRECTORY(libmysqld/examples)
+IF(WITH_EMBEDDED_SERVER)
+ ADD_SUBDIRECTORY(libmysqld)
+ ADD_SUBDIRECTORY(libmysqld/examples)
+ENDIF(WITH_EMBEDDED_SERVER)
diff --git a/Makefile.am b/Makefile.am
index cbca477fbf7..f29764e4143 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -20,16 +20,25 @@ AUTOMAKE_OPTIONS = foreign
# These are built from source in the Docs directory
EXTRA_DIST = INSTALL-SOURCE INSTALL-WIN-SOURCE \
README COPYING EXCEPTIONS-CLIENT CMakeLists.txt
+
SUBDIRS = . include @docs_dirs@ @zlib_dir@ \
@readline_topdir@ sql-common scripts \
- @thread_dirs@ pstack \
+ @pstack_dir@ \
@sql_union_dirs@ unittest storage plugin \
@sql_server@ @man_dirs@ tests \
netware @libmysqld_dirs@ \
mysql-test support-files sql-bench @tools_dirs@ \
win
-DIST_SUBDIRS = $(SUBDIRS) BUILD debian
+DIST_SUBDIRS = . include Docs zlib \
+ cmd-line-utils sql-common scripts \
+ pstack \
+ strings mysys dbug extra regex libmysql libmysql_r client unittest storage plugin \
+ vio sql man tests \
+ netware libmysqld \
+ mysql-test support-files sql-bench server-tools \
+ win \
+ BUILD debian
DISTCLEANFILES = ac_available_languages_fragment
@@ -44,7 +53,6 @@ bin-dist: all
# Create initial database files for Windows installations.
dist-hook:
rm -rf `find $(distdir) -type d -name SCCS -print`
- rm -f `find $(distdir) -type l -print`
mkdir -p $(distdir)/win
scripts/mysql_install_db --no-defaults --windows \
--basedir=$(top_builddir) \
@@ -58,7 +66,8 @@ tags:
test test-force test-full test-force-full test-force-mem \
test-pl test-force-pl test-full-pl test-force-full-pl test-force-pl-mem \
test-unit test-ps test-nr test-pr test-ns test-binlog-statement \
- test-ext-funcs test-ext-rpl test-ext-partitions test-ext \
+ test-ext-funcs test-ext-rpl test-ext-partitions test-ext-jp \
+ test-ext-stress test-ext \
test-fast test-fast-cursor test-fast-view test-fast-prepare \
test-full-qa
@@ -123,10 +132,33 @@ test-bt:
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --comment=NDB --force --timer \
--with-ndbcluster-only
+ -if [ -e bin/mysqltest_embedded -o -e libmysqld/examples/mysqltest_embedded ] ; then \
+ cd mysql-test ; MTR_BUILD_THREAD=auto \
+ @PERL@ ./mysql-test-run.pl --comment=embedded --force --timer \
+ --embedded-server --skip-rpl --skip-ndbcluster ; \
+ fi
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --force --comment=funcs1_ps --ps-protocol --suite=funcs_1
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --force --comment=funcs2 --suite=funcs_2
+ -cd mysql-test ; MTR_BUILD_THREAD=auto \
+ @PERL@ ./mysql-test-run.pl --force --comment=rpl --suite=rpl
+ -cd mysql-test ; MTR_BUILD_THREAD=auto \
+ @PERL@ ./mysql-test-run.pl --force --comment=partitions --suite=parts
+ -if [ -d mysql-test/suite/nist ] ; then \
+ cd mysql-test ; MTR_BUILD_THREAD=auto \
+ @PERL@ ./mysql-test-run.pl --comment=NIST+normal --force --suite=nist ; \
+ fi
+ -if [ -d mysql-test/suite/nist ] ; then \
+ cd mysql-test ; MTR_BUILD_THREAD=auto \
+ @PERL@ ./mysql-test-run.pl --comment=NIST+ps --force --suite=nist --ps-protocol ; \
+ fi
+ -cd mysql-test ; MTR_BUILD_THREAD=auto \
+ @PERL@ ./mysql-test-run.pl --force --comment=stress --suite=stress
+
+# Re-enable the "jp" suite when bug#28563 is fixed
+# -cd mysql-test ; MTR_BUILD_THREAD=auto \
+# @PERL@ ./mysql-test-run.pl --force --comment=jp --suite=jp
test-bt-debug:
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@@ -151,18 +183,23 @@ test-ext-rpl:
test-ext-partitions:
cd mysql-test ; \
- @PERL@ ./mysql-test-run.pl --force --suite=partitions
+ @PERL@ ./mysql-test-run.pl --force --suite=parts
test-ext-jp:
cd mysql-test ; \
@PERL@ ./mysql-test-run.pl --force --suite=jp
-test-ext: test-ext-funcs test-ext-rpl test-ext-partitions test-ext-jp
+test-ext-stress:
+ cd mysql-test ; \
+ @PERL@ ./mysql-test-run.pl --force --big-test --suite=stress
+
+test-ext: test-ext-funcs test-ext-rpl test-ext-partitions test-ext-jp test-ext-stress
test-fast:
cd mysql-test ; \
@PERL@ ./mysql-test-run.pl $(subset) --force --skip-ndb --skip-innodb --skip-im --skip-rpl ; \
- @PERL@ ./mysql-test-run.pl $(subset) --force --suite=funcs_1 --do-test=myisam
+ @PERL@ ./mysql-test-run.pl $(subset) --force --suite=funcs_1 --do-test=myisam ; \
+ @PERL@ ./mysql-test-run.pl $(subset) --force --suite=stress --do-test=ddl_myisam
test-fast-view:
$(MAKE) subset=--view-protocol test-fast
diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt
index 8ec8b0111b0..2ef55c23c90 100644..100755
--- a/client/CMakeLists.txt
+++ b/client/CMakeLists.txt
@@ -14,91 +14,58 @@
# 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 beond 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")
-# The old Windows build method used renamed (.cc -> .cpp) source files, fails
-# in #include in mysqlbinlog.cc. So disable that using the USING_CMAKE define.
-ADD_DEFINITIONS(-DUSING_CMAKE)
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
- ${CMAKE_SOURCE_DIR}/zlib
- ${CMAKE_SOURCE_DIR}/extra/yassl/include
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
+ ${CMAKE_SOURCE_DIR}/zlib
+ ${CMAKE_SOURCE_DIR}/extra/yassl/include
${CMAKE_SOURCE_DIR}/libmysql
${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/strings)
-ADD_LIBRARY(mysqlclient ../mysys/array.c ../strings/bchange.c ../strings/bmove.c
- ../strings/bmove_upp.c ../mysys/charset-def.c ../mysys/charset.c
- ../sql-common/client.c ../strings/ctype-big5.c ../strings/ctype-bin.c
- ../strings/ctype-cp932.c ../strings/ctype-czech.c ../strings/ctype-euc_kr.c
- ../strings/ctype-eucjpms.c ../strings/ctype-extra.c ../strings/ctype-gb2312.c
- ../strings/ctype-gbk.c ../strings/ctype-latin1.c ../strings/ctype-mb.c
- ../strings/ctype-simple.c ../strings/ctype-sjis.c ../strings/ctype-tis620.c
- ../strings/ctype-uca.c ../strings/ctype-ucs2.c ../strings/ctype-ujis.c
- ../strings/ctype-utf8.c ../strings/ctype-win1250ch.c ../strings/ctype.c
- ../mysys/default.c ../libmysql/errmsg.c ../mysys/errors.c
- ../libmysql/get_password.c ../strings/int2str.c ../strings/is_prefix.c
- ../libmysql/libmysql.c ../mysys/list.c ../strings/llstr.c
- ../strings/longlong2str.c ../libmysql/manager.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
- ../mysys/mf_wcomp.c ../mysys/mulalloc.c ../mysys/my_access.c ../mysys/my_alloc.c
- ../mysys/my_chsize.c ../mysys/my_compress.c ../mysys/my_create.c
- ../mysys/my_delete.c ../mysys/my_div.c ../mysys/my_error.c ../mysys/my_file.c
- ../mysys/my_fopen.c ../mysys/my_fstream.c ../mysys/my_gethostbyname.c
- ../mysys/my_getopt.c ../mysys/my_getwd.c ../mysys/my_init.c ../mysys/my_lib.c
- ../mysys/my_malloc.c ../mysys/my_messnc.c ../mysys/my_net.c ../mysys/my_once.c
- ../mysys/my_open.c ../mysys/my_pread.c ../mysys/my_pthread.c ../mysys/my_read.c
- ../mysys/my_realloc.c ../mysys/my_rename.c ../mysys/my_seek.c
- ../mysys/my_static.c ../strings/my_strtoll10.c ../mysys/my_symlink.c
- ../mysys/my_symlink2.c ../mysys/my_thr_init.c ../sql-common/my_time.c
- ../strings/my_vsnprintf.c ../mysys/my_wincond.c ../mysys/my_winthread.c
- ../mysys/my_write.c ../sql/net_serv.cc ../sql-common/pack.c ../sql/password.c
- ../mysys/safemalloc.c ../mysys/sha1.c ../strings/str2int.c
- ../strings/str_alloc.c ../strings/strcend.c ../strings/strcont.c ../strings/strend.c
- ../strings/strfill.c ../mysys/string.c ../strings/strinstr.c ../strings/strmake.c
- ../strings/strmov.c ../strings/strnlen.c ../strings/strnmov.c ../strings/strtod.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)
-
-ADD_DEPENDENCIES(mysqlclient GenError)
-ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc sql_string.cc)
-LINK_DIRECTORIES(${MYSQL_BINARY_DIR}/mysys ${MYSQL_BINARY_DIR}/zlib)
-TARGET_LINK_LIBRARIES(mysql mysqlclient mysys yassl taocrypt zlib dbug wsock32)
-
-ADD_EXECUTABLE(mysqltest mysqltest.c)
-TARGET_LINK_LIBRARIES(mysqltest mysqlclient mysys yassl taocrypt zlib dbug regex wsock32)
+ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc sql_string.cc ../mysys/my_conio.c)
+TARGET_LINK_LIBRARIES(mysql mysqlclient_notls wsock32)
+
+ADD_EXECUTABLE(mysqltest mysqltest.c ../mysys/my_getsystime.c ../mysys/my_copy.c)
+TARGET_LINK_LIBRARIES(mysqltest mysqlclient_notls regex wsock32)
ADD_EXECUTABLE(mysqlcheck mysqlcheck.c)
-TARGET_LINK_LIBRARIES(mysqlcheck mysqlclient dbug yassl taocrypt zlib wsock32)
+TARGET_LINK_LIBRARIES(mysqlcheck mysqlclient_notls wsock32)
-ADD_EXECUTABLE(mysqldump mysqldump.c ../sql-common/my_user.c)
-TARGET_LINK_LIBRARIES(mysqldump mysqlclient mysys dbug yassl taocrypt zlib wsock32)
+ADD_EXECUTABLE(mysqldump mysqldump.c ../sql-common/my_user.c ../mysys/mf_getdate.c)
+TARGET_LINK_LIBRARIES(mysqldump mysqlclient_notls wsock32)
ADD_EXECUTABLE(mysqlimport mysqlimport.c)
-TARGET_LINK_LIBRARIES(mysqlimport mysqlclient mysys dbug yassl taocrypt zlib wsock32)
+TARGET_LINK_LIBRARIES(mysqlimport mysqlclient_notls wsock32)
ADD_EXECUTABLE(mysql_upgrade mysql_upgrade.c ../mysys/my_getpagesize.c)
-TARGET_LINK_LIBRARIES(mysql_upgrade mysqlclient dbug yassl taocrypt zlib wsock32)
+TARGET_LINK_LIBRARIES(mysql_upgrade mysqlclient_notls wsock32)
ADD_DEPENDENCIES(mysql_upgrade GenFixPrivs)
ADD_EXECUTABLE(mysqlshow mysqlshow.c)
-TARGET_LINK_LIBRARIES(mysqlshow mysqlclient mysys dbug yassl taocrypt zlib wsock32)
+TARGET_LINK_LIBRARIES(mysqlshow mysqlclient_notls wsock32)
-ADD_EXECUTABLE(mysqlbinlog mysqlbinlog.cc ../mysys/mf_tempdir.c ../mysys/my_new.cc
- ../mysys/my_bit.c ../mysys/my_bitmap.c ../mysys/my_vle.c
- ../mysys/base64.c)
-TARGET_LINK_LIBRARIES(mysqlbinlog mysqlclient dbug yassl taocrypt zlib wsock32)
+ADD_EXECUTABLE(mysqlbinlog mysqlbinlog.cc
+ ../mysys/mf_tempdir.c
+ ../mysys/my_new.cc
+ ../mysys/my_bit.c
+ ../mysys/my_bitmap.c
+ ../mysys/my_vle.c
+ ../mysys/base64.c)
+TARGET_LINK_LIBRARIES(mysqlbinlog mysqlclient_notls wsock32)
ADD_EXECUTABLE(mysqladmin mysqladmin.cc)
-TARGET_LINK_LIBRARIES(mysqladmin mysqlclient mysys dbug yassl taocrypt zlib wsock32)
+TARGET_LINK_LIBRARIES(mysqladmin mysqlclient_notls wsock32)
ADD_EXECUTABLE(mysqlslap mysqlslap.c)
SET_SOURCE_FILES_PROPERTIES(mysqlslap.c PROPERTIES COMPILE_FLAGS "-DTHREADS")
-TARGET_LINK_LIBRARIES(mysqlslap mysqlclient mysys yassl taocrypt zlib wsock32 dbug)
+TARGET_LINK_LIBRARIES(mysqlslap mysqlclient mysys zlib wsock32 dbug)
ADD_EXECUTABLE(echo echo.c)
@@ -114,3 +81,4 @@ IF(EMBED_MANIFESTS)
MYSQL_EMBED_MANIFEST("mysqladmin" "asInvoker")
MYSQL_EMBED_MANIFEST("echo" "asInvoker")
ENDIF(EMBED_MANIFESTS)
+
diff --git a/client/client_priv.h b/client/client_priv.h
index 25241cc8c59..a2f61b9e9ca 100644
--- a/client/client_priv.h
+++ b/client/client_priv.h
@@ -48,7 +48,7 @@ enum options_client
OPT_PROMPT, OPT_IGN_LINES,OPT_TRANSACTION,OPT_MYSQL_PROTOCOL,
OPT_SHARED_MEMORY_BASE_NAME, OPT_FRM, OPT_SKIP_OPTIMIZATION,
OPT_COMPATIBLE, OPT_RECONNECT, OPT_DELIMITER, OPT_SECURE_AUTH,
- OPT_OPEN_FILES_LIMIT, OPT_SET_CHARSET, OPT_CREATE_OPTIONS,
+ OPT_OPEN_FILES_LIMIT, OPT_SET_CHARSET, OPT_CREATE_OPTIONS, OPT_SERVER_ARG,
OPT_START_POSITION, OPT_STOP_POSITION, OPT_START_DATETIME, OPT_STOP_DATETIME,
OPT_SIGINT_IGNORE, OPT_HEXBLOB, OPT_ORDER_BY_PRIMARY, OPT_COUNT,
#ifdef HAVE_NDBCLUSTER_DB
@@ -73,8 +73,12 @@ enum options_client
OPT_SLAP_AUTO_GENERATE_UNIQUE_QUERY_NUM,
OPT_SLAP_PRE_QUERY,
OPT_SLAP_POST_QUERY,
+ OPT_SLAP_PRE_SYSTEM,
+ OPT_SLAP_POST_SYSTEM,
+ OPT_SLAP_COMMIT,
+ OPT_SLAP_DETACH,
OPT_MYSQL_REPLACE_INTO, OPT_BASE64_OUTPUT, OPT_SERVER_ID,
OPT_FIX_TABLE_NAMES, OPT_FIX_DB_NAMES, OPT_SSL_VERIFY_SERVER_CERT,
- OPT_DEBUG_INFO, OPT_COLUMN_TYPES, OPT_ERROR_LOG_FILE, OPT_WRITE_BINLOG,
- OPT_MAX_CLIENT_OPTION
+ OPT_DEBUG_INFO, OPT_DEBUG_CHECK, OPT_COLUMN_TYPES, OPT_ERROR_LOG_FILE,
+ OPT_WRITE_BINLOG, OPT_MAX_CLIENT_OPTION
};
diff --git a/client/completion_hash.cc b/client/completion_hash.cc
index 4c777f8a704..cd0ea17dfaf 100644
--- a/client/completion_hash.cc
+++ b/client/completion_hash.cc
@@ -213,7 +213,7 @@ void completion_hash_clean(HashTable *ht)
void completion_hash_free(HashTable *ht)
{
completion_hash_clean(ht);
- my_free((gptr) ht->arBuckets,MYF(0));
+ my_free(ht->arBuckets, MYF(0));
}
diff --git a/client/my_readline.h b/client/my_readline.h
index 47be7fa9294..3ebe24b75b8 100644
--- a/client/my_readline.h
+++ b/client/my_readline.h
@@ -28,6 +28,6 @@ typedef struct st_line_buffer
} LINE_BUFFER;
extern LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file);
-extern LINE_BUFFER *batch_readline_command(LINE_BUFFER *buffer, my_string str);
+extern LINE_BUFFER *batch_readline_command(LINE_BUFFER *buffer, char * str);
extern char *batch_readline(LINE_BUFFER *buffer);
extern void batch_readline_end(LINE_BUFFER *buffer);
diff --git a/client/mysql.cc b/client/mysql.cc
index 49d5ae4f449..794f252853a 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -43,7 +43,7 @@
#include <locale.h>
#endif
-const char *VER= "14.13";
+const char *VER= "14.14";
/* Don't try to make a nice table if the data is too big */
#define MAX_COLUMN_LENGTH 1024
@@ -51,7 +51,10 @@ const char *VER= "14.13";
/* Buffer to hold 'version' and 'version_comment' */
#define MAX_SERVER_VERSION_LENGTH 128
-gptr sql_alloc(unsigned size); // Don't use mysqld alloc for these
+/* Array of options to pass to libemysqld */
+#define MAX_SERVER_ARGS 64
+
+void* sql_alloc(unsigned size); // Don't use mysqld alloc for these
void sql_element_free(void *ptr);
#include "sql_string.h"
@@ -129,7 +132,7 @@ enum enum_info_type { INFO_INFO,INFO_ERROR,INFO_RESULT};
typedef enum enum_info_type INFO_TYPE;
static MYSQL mysql; /* The connection */
-static my_bool info_flag=0,ignore_errors=0,wait_flag=0,quick=0,
+static my_bool ignore_errors=0,wait_flag=0,quick=0,
connected=0,opt_raw_data=0,unbuffered=0,output_tables=0,
opt_rehash=1,skip_updates=0,safe_updates=0,one_database=0,
opt_compress=0, using_opt_local_infile=0,
@@ -139,10 +142,12 @@ static my_bool info_flag=0,ignore_errors=0,wait_flag=0,quick=0,
default_charset_used= 0, opt_secure_auth= 0,
default_pager_set= 0, opt_sigint_ignore= 0,
show_warnings= 0, executing_query= 0, interrupted_query= 0;
+static my_bool debug_info_flag, debug_check_flag;
static my_bool column_types_flag;
static ulong opt_max_allowed_packet, opt_net_buffer_length;
static uint verbose=0,opt_silent=0,opt_mysql_port=0, opt_local_infile=0;
-static my_string opt_mysql_unix_port=0;
+static uint my_end_arg;
+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,
@@ -191,6 +196,8 @@ void tee_putc(int c, FILE *file);
static void tee_print_sized_data(const char *, unsigned int, unsigned int, bool);
/* The names of functions that actually do the manipulation. */
static int get_options(int argc,char **argv);
+extern "C" my_bool get_one_option(int optid, const struct my_option *opt,
+ char *argument);
static int com_quit(String *str,char*),
com_go(String *str,char*), com_ego(String *str,char*),
com_print(String *str,char*),
@@ -302,7 +309,10 @@ static COMMANDS commands[] = {
};
static const char *load_default_groups[]= { "mysql","client",0 };
-static const char *server_default_groups[]=
+
+static int embedded_server_arg_count= 0;
+static char *embedded_server_args[MAX_SERVER_ARGS];
+static const char *embedded_server_groups[]=
{ "server", "embedded", "mysql_SERVER", 0 };
#ifdef HAVE_READLINE
@@ -341,21 +351,12 @@ static ulong start_timer(void);
static void end_timer(ulong start_time,char *buff);
static void mysql_end_timer(ulong start_time,char *buff);
static void nice_time(double sec,char *buff,bool part_second);
-static sig_handler mysql_end(int sig);
-static sig_handler handle_sigint(int sig);
+extern "C" sig_handler mysql_end(int sig);
+extern "C" sig_handler handle_sigint(int sig);
int main(int argc,char *argv[])
{
char buff[80];
- char *defaults, *extra_defaults, *group_suffix;
- char *emb_argv[4];
- int emb_argc;
-
- /* Get --defaults-xxx args for mysql_server_init() */
- emb_argc= get_defaults_options(argc, argv, &defaults, &extra_defaults,
- &group_suffix)+1;
- memcpy((char*) emb_argv, (char*) argv, emb_argc * sizeof(*argv));
- emb_argv[emb_argc]= 0;
MY_INIT(argv[0]);
DBUG_ENTER("main");
@@ -416,7 +417,8 @@ int main(int argc,char *argv[])
my_end(0);
exit(1);
}
- if (mysql_server_init(emb_argc, emb_argv, (char**) server_default_groups))
+ if (mysql_server_init(embedded_server_arg_count, embedded_server_args,
+ (char**) embedded_server_groups))
{
free_defaults(defaults_argv);
my_end(0);
@@ -539,9 +541,11 @@ sig_handler mysql_end(int sig)
my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR));
#endif
my_free(current_prompt,MYF(MY_ALLOW_ZERO_PTR));
+ while (embedded_server_arg_count > 1)
+ my_free(embedded_server_args[--embedded_server_arg_count],MYF(0));
mysql_server_end();
free_defaults(defaults_argv);
- my_end(info_flag ? MY_CHECK_ERROR : 0);
+ my_end(my_end_arg);
exit(status.exit_status);
}
@@ -587,7 +591,7 @@ static struct my_option my_long_options[] =
#endif
{"auto-rehash", OPT_AUTO_REHASH,
"Enable automatic rehashing. One doesn't need to use 'rehash' to get table and field completion, but startup and reconnecting may take a longer time. Disable with --disable-auto-rehash.",
- (gptr*) &opt_rehash, (gptr*) &opt_rehash, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
+ (uchar**) &opt_rehash, (uchar**) &opt_rehash, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
0, 0},
{"no-auto-rehash", 'A',
"No automatic rehashing. One has to use 'rehash' to get table and field completion. This gives a quicker start of mysql and disables rehashing on reconnect. WARNING: options deprecated; use --disable-auto-rehash instead.",
@@ -595,42 +599,45 @@ static struct my_option my_long_options[] =
{"batch", 'B',
"Don't use history file. Disable interactive behavior. (Enables --silent)", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
- "Directory where character sets are.", (gptr*) &charsets_dir,
- (gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Directory where character sets are.", (uchar**) &charsets_dir,
+ (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"column-type-info", OPT_COLUMN_TYPES, "Display column type information.",
- (gptr*) &column_types_flag, (gptr*) &column_types_flag,
+ (uchar**) &column_types_flag, (uchar**) &column_types_flag,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"compress", 'C', "Use compression in server/client protocol.",
- (gptr*) &opt_compress, (gptr*) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+ (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
#ifdef DBUG_OFF
{"debug", '#', "This is a non-debug version. Catch this and exit",
0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
#else
- {"debug", '#', "Output debug log", (gptr*) &default_dbug_option,
- (gptr*) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug", '#', "Output debug log", (uchar**) &default_dbug_option,
+ (uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"debug-info", 'T', "Print some debug info at exit.", (gptr*) &info_flag,
- (gptr*) &info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"database", 'D', "Database to use.", (gptr*) &current_db,
- (gptr*) &current_db, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .",
+ (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+ GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug-info", 'T', "Print some debug info at exit.", (uchar**) &debug_info_flag,
+ (uchar**) &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"database", 'D', "Database to use.", (uchar**) &current_db,
+ (uchar**) &current_db, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"default-character-set", OPT_DEFAULT_CHARSET,
- "Set the default character set.", (gptr*) &default_charset,
- (gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"delimiter", OPT_DELIMITER, "Delimiter to be used.", (gptr*) &delimiter_str,
- (gptr*) &delimiter_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Set the default character set.", (uchar**) &default_charset,
+ (uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"delimiter", OPT_DELIMITER, "Delimiter to be used.", (uchar**) &delimiter_str,
+ (uchar**) &delimiter_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"execute", 'e', "Execute command and quit. (Disables --force and history file)", 0,
0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"vertical", 'E', "Print the output of a query (rows) vertically.",
- (gptr*) &vertical, (gptr*) &vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
+ (uchar**) &vertical, (uchar**) &vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0},
{"force", 'f', "Continue even if we get an sql error.",
- (gptr*) &ignore_errors, (gptr*) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
+ (uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0},
{"named-commands", 'G',
"Enable named commands. Named commands mean this program's internal commands; see mysql> help . When enabled, the named commands can be used from any line of the query, otherwise only from the first line, before an enter. Disable with --disable-named-commands. This option is disabled by default.",
- (gptr*) &named_cmds, (gptr*) &named_cmds, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+ (uchar**) &named_cmds, (uchar**) &named_cmds, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"no-named-commands", 'g',
"Named commands are disabled. Use \\* form only, or use named commands only in the beginning of a line ending with a semicolon (;) Since version 10.9 the client now starts with this option ENABLED by default! Disable with '-G'. Long format commands still work from the first line. WARNING: option deprecated; use --disable-named-commands instead.",
@@ -638,25 +645,25 @@ static struct my_option my_long_options[] =
{"ignore-spaces", 'i', "Ignore space after function names.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"local-infile", OPT_LOCAL_INFILE, "Enable/disable LOAD DATA LOCAL INFILE.",
- (gptr*) &opt_local_infile,
- (gptr*) &opt_local_infile, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
- {"no-beep", 'b', "Turn off beep on error.", (gptr*) &opt_nobeep,
- (gptr*) &opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"host", 'h', "Connect to host.", (gptr*) &current_host,
- (gptr*) &current_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"html", 'H', "Produce HTML output.", (gptr*) &opt_html, (gptr*) &opt_html,
+ (uchar**) &opt_local_infile,
+ (uchar**) &opt_local_infile, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
+ {"no-beep", 'b', "Turn off beep on error.", (uchar**) &opt_nobeep,
+ (uchar**) &opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"host", 'h', "Connect to host.", (uchar**) &current_host,
+ (uchar**) &current_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"html", 'H', "Produce HTML output.", (uchar**) &opt_html, (uchar**) &opt_html,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"xml", 'X', "Produce XML output", (gptr*) &opt_xml, (gptr*) &opt_xml, 0,
+ {"xml", 'X', "Produce XML output", (uchar**) &opt_xml, (uchar**) &opt_xml, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"line-numbers", OPT_LINE_NUMBERS, "Write line numbers for errors.",
- (gptr*) &line_numbers, (gptr*) &line_numbers, 0, GET_BOOL,
+ (uchar**) &line_numbers, (uchar**) &line_numbers, 0, GET_BOOL,
NO_ARG, 1, 0, 0, 0, 0, 0},
{"skip-line-numbers", 'L', "Don't write line number for errors. WARNING: -L is deprecated, use long version of this option instead.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
- {"unbuffered", 'n', "Flush buffer after each query.", (gptr*) &unbuffered,
- (gptr*) &unbuffered, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"unbuffered", 'n', "Flush buffer after each query.", (uchar**) &unbuffered,
+ (uchar**) &unbuffered, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"column-names", OPT_COLUMN_NAMES, "Write column names in results.",
- (gptr*) &column_names, (gptr*) &column_names, 0, GET_BOOL,
+ (uchar**) &column_names, (uchar**) &column_names, 0, GET_BOOL,
NO_ARG, 1, 0, 0, 0, 0, 0},
{"skip-column-names", 'N',
"Don't write column names in results. WARNING: -N is deprecated, use long version of this options instead.",
@@ -665,7 +672,7 @@ static struct my_option my_long_options[] =
"Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"sigint-ignore", OPT_SIGINT_IGNORE, "Ignore SIGINT (CTRL-C)",
- (gptr*) &opt_sigint_ignore, (gptr*) &opt_sigint_ignore, 0, GET_BOOL,
+ (uchar**) &opt_sigint_ignore, (uchar**) &opt_sigint_ignore, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"one-database", 'o',
"Only update the default database. This is useful for skipping updates to other database in the update log.",
@@ -685,49 +692,49 @@ static struct my_option my_long_options[] =
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port,
- (gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
+ {"port", 'P', "Port number to use for connection.", (uchar**) &opt_mysql_port,
+ (uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
0},
{"prompt", OPT_PROMPT, "Set the mysql prompt to this value.",
- (gptr*) &current_prompt, (gptr*) &current_prompt, 0, GET_STR_ALLOC,
+ (uchar**) &current_prompt, (uchar**) &current_prompt, 0, GET_STR_ALLOC,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"quick", 'q',
"Don't cache result, print it row by row. This may slow down the server if the output is suspended. Doesn't use history file.",
- (gptr*) &quick, (gptr*) &quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ (uchar**) &quick, (uchar**) &quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"raw", 'r', "Write fields without conversion. Used with --batch.",
- (gptr*) &opt_raw_data, (gptr*) &opt_raw_data, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+ (uchar**) &opt_raw_data, (uchar**) &opt_raw_data, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"reconnect", OPT_RECONNECT, "Reconnect if the connection is lost. Disable with --disable-reconnect. This option is enabled by default.",
- (gptr*) &opt_reconnect, (gptr*) &opt_reconnect, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+ (uchar**) &opt_reconnect, (uchar**) &opt_reconnect, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"silent", 's', "Be more silent. Print results with a tab as separator, each row on new line.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0,
0, 0},
#ifdef HAVE_SMEM
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
- "Base name of shared memory.", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
+ "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"socket", 'S', "Socket file to use for connection.",
- (gptr*) &opt_mysql_unix_port, (gptr*) &opt_mysql_unix_port, 0, GET_STR_ALLOC,
+ (uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR_ALLOC,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#include "sslopt-longopts.h"
- {"table", 't', "Output in table format.", (gptr*) &output_tables,
- (gptr*) &output_tables, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"table", 't', "Output in table format.", (uchar**) &output_tables,
+ (uchar**) &output_tables, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"tee", OPT_TEE,
"Append everything into outfile. See interactive help (\\h) also. Does not work in batch mode. Disable with --disable-tee. This option is disabled by default.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"no-tee", OPT_NOTEE, "Disable outfile. See interactive help (\\h) also. WARNING: option deprecated; use --disable-tee instead", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#ifndef DONT_ALLOW_USER_CHANGE
- {"user", 'u', "User for login if not current user.", (gptr*) &current_user,
- (gptr*) &current_user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"user", 'u', "User for login if not current user.", (uchar**) &current_user,
+ (uchar**) &current_user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"safe-updates", 'U', "Only allow UPDATE and DELETE that uses keys.",
- (gptr*) &safe_updates, (gptr*) &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0,
+ (uchar**) &safe_updates, (uchar**) &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0},
{"i-am-a-dummy", 'U', "Synonym for option --safe-updates, -U.",
- (gptr*) &safe_updates, (gptr*) &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0,
+ (uchar**) &safe_updates, (uchar**) &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0},
{"verbose", 'v', "Write more. (-v -v -v gives the table output format).", 0,
0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -737,32 +744,34 @@ static struct my_option my_long_options[] =
NO_ARG, 0, 0, 0, 0, 0, 0},
{"connect_timeout", OPT_CONNECT_TIMEOUT,
"Number of seconds before connection timeout.",
- (gptr*) &opt_connect_timeout,
- (gptr*) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 3600*12, 0,
- 0, 1},
+ (uchar**) &opt_connect_timeout,
+ (uchar**) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 3600*12, 0,
+ 0, 0},
{"max_allowed_packet", OPT_MAX_ALLOWED_PACKET,
"Max packet length to send to, or receive from server",
- (gptr*) &opt_max_allowed_packet, (gptr*) &opt_max_allowed_packet, 0, GET_ULONG,
+ (uchar**) &opt_max_allowed_packet, (uchar**) &opt_max_allowed_packet, 0, GET_ULONG,
REQUIRED_ARG, 16 *1024L*1024L, 4096, (longlong) 2*1024L*1024L*1024L,
MALLOC_OVERHEAD, 1024, 0},
{"net_buffer_length", OPT_NET_BUFFER_LENGTH,
"Buffer for TCP/IP and socket communication",
- (gptr*) &opt_net_buffer_length, (gptr*) &opt_net_buffer_length, 0, GET_ULONG,
+ (uchar**) &opt_net_buffer_length, (uchar**) &opt_net_buffer_length, 0, GET_ULONG,
REQUIRED_ARG, 16384, 1024, 512*1024*1024L, MALLOC_OVERHEAD, 1024, 0},
{"select_limit", OPT_SELECT_LIMIT,
"Automatic limit for SELECT when using --safe-updates",
- (gptr*) &select_limit,
- (gptr*) &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L, 1, ~0L, 0, 1, 0},
+ (uchar**) &select_limit,
+ (uchar**) &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L, 1, ~0L, 0, 1, 0},
{"max_join_size", OPT_MAX_JOIN_SIZE,
"Automatic limit for rows in a join when using --safe-updates",
- (gptr*) &max_join_size,
- (gptr*) &max_join_size, 0, GET_ULONG, REQUIRED_ARG, 1000000L, 1, ~0L, 0, 1,
+ (uchar**) &max_join_size,
+ (uchar**) &max_join_size, 0, GET_ULONG, REQUIRED_ARG, 1000000L, 1, ~0L, 0, 1,
0},
{"secure-auth", OPT_SECURE_AUTH, "Refuse client connecting to server if it"
- " uses old (pre-4.1.1) protocol", (gptr*) &opt_secure_auth,
- (gptr*) &opt_secure_auth, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ " uses old (pre-4.1.1) protocol", (uchar**) &opt_secure_auth,
+ (uchar**) &opt_secure_auth, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"server-arg", OPT_SERVER_ARG, "Send embedded server this as a parameter.",
+ 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"show-warnings", OPT_SHOW_WARNINGS, "Show warnings after every statement.",
- (gptr*) &show_warnings, (gptr*) &show_warnings, 0, GET_BOOL, NO_ARG,
+ (uchar**) &show_warnings, (uchar**) &show_warnings, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -807,7 +816,7 @@ and you are welcome to modify and redistribute it under the GPL license\n");
}
-static my_bool
+my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument)
{
@@ -888,7 +897,29 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
opt->name);
break;
- break;
+ case OPT_SERVER_ARG:
+#ifdef EMBEDDED_LIBRARY
+ /*
+ When the embedded server is being tested, the client needs to be
+ able to pass command-line arguments to the embedded server so it can
+ locate the language files and data directory.
+ */
+ if (!embedded_server_arg_count)
+ {
+ embedded_server_arg_count= 1;
+ embedded_server_args[0]= (char*) "";
+ }
+ if (embedded_server_arg_count == MAX_SERVER_ARGS-1 ||
+ !(embedded_server_args[embedded_server_arg_count++]=
+ my_strdup(argument, MYF(MY_FAE))))
+ {
+ put_info("Can't use server argument", INFO_ERROR);
+ return 0;
+ }
+#else /*EMBEDDED_LIBRARY */
+ printf("WARNING: --server-arg option not supported in this configuration.\n");
+#endif
+ break;
case 'A':
opt_rehash= 0;
break;
@@ -927,7 +958,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
case '#':
DBUG_PUSH(argument ? argument : default_dbug_option);
- info_flag= 1;
+ debug_info_flag= 1;
break;
case 's':
if (argument == disabled_my_option)
@@ -1021,6 +1052,10 @@ static int get_options(int argc, char **argv)
}
if (tty_password)
opt_password= get_tty_password(NullS);
+ if (debug_info_flag)
+ my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO;
+ if (debug_check_flag)
+ my_end_arg= MY_CHECK_ERROR;
return(0);
}
@@ -1079,7 +1114,7 @@ static int read_and_execute(bool interactive)
tmpbuf.alloc(65535);
tmpbuf.length(0);
buffer.length(0);
- unsigned long clen;
+ size_t clen;
do
{
line= my_cgets((char*)tmpbuf.ptr(), tmpbuf.alloced_length()-1, &clen);
@@ -1089,7 +1124,12 @@ static int read_and_execute(bool interactive)
something else is still in console input buffer
*/
} while (tmpbuf.alloced_length() <= clen);
- line= buffer.c_ptr();
+ /*
+ An empty line is returned from my_cgets when there's error reading :
+ Ctrl-c for example
+ */
+ if (line)
+ line= buffer.c_ptr();
#endif /* __NETWARE__ */
#else
if (opt_outfile)
@@ -1223,6 +1263,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
char buff[80], *pos, *out;
COMMANDS *com;
bool need_space= 0;
+ bool ss_comment= 0;
DBUG_ENTER("add_line");
if (!line[0] && buffer.is_empty())
@@ -1271,22 +1312,36 @@ static bool add_line(String &buffer,char *line,char *in_string,
}
if ((com=find_command(NullS,(char) inchar)))
{
- const String tmp(line,(uint) (out-line), charset_info);
- buffer.append(tmp);
- if ((*com->func)(&buffer,pos-1) > 0)
- DBUG_RETURN(1); // Quit
- if (com->takes_params)
- {
- for (pos++ ;
- *pos && (*pos != *delimiter ||
- !is_prefix(pos + 1, delimiter + 1)) ; pos++)
- ; // Remove parameters
- if (!*pos)
- pos--;
- else
- pos+= delimiter_length - 1; // Point at last delim char
- }
- out=line;
+ const String tmp(line,(uint) (out-line), charset_info);
+ buffer.append(tmp);
+ if ((*com->func)(&buffer,pos-1) > 0)
+ DBUG_RETURN(1); // Quit
+ if (com->takes_params)
+ {
+ if (ss_comment)
+ {
+ /*
+ If a client-side macro appears inside a server-side comment,
+ discard all characters in the comment after the macro (that is,
+ until the end of the comment rather than the next delimiter)
+ */
+ for (pos++; *pos && (*pos != '*' || *(pos + 1) != '/'); pos++)
+ ;
+ pos--;
+ }
+ else
+ {
+ for (pos++ ;
+ *pos && (*pos != *delimiter ||
+ !is_prefix(pos + 1, delimiter + 1)) ; pos++)
+ ; // Remove parameters
+ if (!*pos)
+ pos--;
+ else
+ pos+= delimiter_length - 1; // Point at last delim char
+ }
+ }
+ out=line;
}
else
{
@@ -1346,7 +1401,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
out=line;
}
}
- else if (*ml_comment && inchar == '*' && *(pos + 1) == '/')
+ else if (*ml_comment && !ss_comment && inchar == '*' && *(pos + 1) == '/')
{
pos++;
*ml_comment= 0;
@@ -1354,6 +1409,11 @@ static bool add_line(String &buffer,char *line,char *in_string,
}
else
{ // Add found char to buffer
+ if (!*in_string && inchar == '/' && *(pos + 1) == '*' &&
+ *(pos + 2) == '!')
+ ss_comment= 1;
+ else if (!*in_string && ss_comment && inchar == '*' && *(pos + 1) == '/')
+ ss_comment= 0;
if (inchar == *in_string)
*in_string= 0;
else if (!*ml_comment && !*in_string &&
@@ -1389,7 +1449,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
#ifdef HAVE_READLINE
static char *new_command_generator(const char *text, int);
-static char **new_mysql_completion (const char *text, int start, int end);
+extern "C" char **new_mysql_completion (const char *text, int start, int end);
/*
Tell the GNU Readline library how to complete. We want to try to complete
@@ -1398,9 +1458,9 @@ static char **new_mysql_completion (const char *text, int start, int end);
*/
#if defined(USE_NEW_READLINE_INTERFACE) || defined(USE_LIBEDIT_INTERFACE)
-char *no_completion(const char*,int)
+extern "C" char *no_completion(const char*,int)
#else
-char *no_completion()
+extern "C" char *no_completion()
#endif
{
return 0; /* No filename completion */
@@ -1502,9 +1562,9 @@ static void initialize_readline (char *name)
array of matches, or NULL if there aren't any.
*/
-static char **new_mysql_completion (const char *text,
- int start __attribute__((unused)),
- int end __attribute__((unused)))
+char **new_mysql_completion (const char *text,
+ int start __attribute__((unused)),
+ int end __attribute__((unused)))
{
if (!status.batch && !quick)
#if defined(USE_NEW_READLINE_INTERFACE)
@@ -2443,7 +2503,7 @@ print_table_data(MYSQL_RES *result)
(void) tee_fputs("\n", PAGER);
}
tee_puts((char*) separator.ptr(), PAGER);
- my_afree((gptr) num_flag);
+ my_afree((uchar*) num_flag);
}
@@ -2842,10 +2902,10 @@ com_edit(String *buffer,char *line __attribute__((unused)))
MYF(MY_WME))) < 0)
goto err;
if (buffer->is_empty() && !old_buffer.is_empty())
- (void) my_write(fd,(byte*) old_buffer.ptr(),old_buffer.length(),
+ (void) my_write(fd,(uchar*) old_buffer.ptr(),old_buffer.length(),
MYF(MY_WME));
else
- (void) my_write(fd,(byte*) buffer->ptr(),buffer->length(),MYF(MY_WME));
+ (void) my_write(fd,(uchar*) buffer->ptr(),buffer->length(),MYF(MY_WME));
(void) my_close(fd,MYF(0));
if (!(editor = (char *)getenv("EDITOR")) &&
@@ -3283,7 +3343,7 @@ sql_real_connect(char *host,char *database,char *user,char *password,
}
connected=1;
#ifndef EMBEDDED_LIBRARY
- mysql.reconnect=info_flag ? 1 : 0; // We want to know if this happens
+ mysql.reconnect= debug_info_flag; // We want to know if this happens
#else
mysql.reconnect= 1;
#endif
@@ -3893,13 +3953,13 @@ static int com_prompt(String *buffer, char *line)
#ifndef EMBEDDED_LIBRARY
/* Keep sql_string library happy */
-gptr sql_alloc(unsigned int Size)
+void *sql_alloc(size_t Size)
{
return my_malloc(Size,MYF(MY_WME));
}
void sql_element_free(void *ptr)
{
- my_free((gptr) ptr,MYF(0));
+ my_free(ptr,MYF(0));
}
#endif /* EMBEDDED_LIBRARY */
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index 64de3d19882..334269720b4 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -17,6 +17,8 @@
#include <sslopt-vars.h>
#include "../scripts/mysql_fix_privilege_tables_sql.c"
+#define VER "1.1"
+
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
@@ -32,7 +34,8 @@
static char mysql_path[FN_REFLEN];
static char mysqlcheck_path[FN_REFLEN];
-static my_bool opt_force, opt_verbose;
+static my_bool opt_force, opt_verbose, debug_info_flag, debug_check_flag;
+static uint my_end_arg= 0;
static char *opt_user= (char*)"root";
static DYNAMIC_STRING ds_args;
@@ -56,6 +59,11 @@ static struct my_option my_long_options[]=
NO_ARG, 0, 0, 0, 0, 0, 0},
{"basedir", 'b', "Not used by mysql_upgrade. Only for backward compatibilty",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"character-sets-dir", OPT_CHARSETS_DIR,
+ "Directory where character sets are.", 0,
+ 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"compress", OPT_COMPRESS, "Use compression in server/client protocol.",
+ (uchar**)&not_used, (uchar**)&not_used, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"datadir", 'd',
"Not used by mysql_upgrade. Only for backward compatibilty",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -63,26 +71,26 @@ static struct my_option my_long_options[]=
{"debug", '#', "This is a non-debug version. Catch this and exit",
0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
#else
- {"debug", '#', "Output debug log", (gptr *) & default_dbug_option,
- (gptr *) & default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug", '#', "Output debug log", (uchar* *) & default_dbug_option,
+ (uchar* *) & default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
+ {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .",
+ (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+ GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug-info", 'T', "Print some debug info at exit.", (uchar**) &debug_info_flag,
+ (uchar**) &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"default-character-set", OPT_DEFAULT_CHARSET,
"Set the default character set.", 0,
0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"character-sets-dir", OPT_CHARSETS_DIR,
- "Directory where character sets are.", 0,
- 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"compress", OPT_COMPRESS, "Use compression in server/client protocol.",
- (gptr*)&not_used, (gptr*)&not_used, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"force", 'f', "Force execution of mysqlcheck even if mysql_upgrade "
"has already been executed for the current version of MySQL.",
- (gptr*)&opt_force, (gptr*)&opt_force, 0,
+ (uchar**)&opt_force, (uchar**)&opt_force, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"host",'h', "Connect to host.", 0,
0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"password", 'p',
"Password to use when connecting to server. If password is not given"
- " it's solicited on the tty.", (gptr*) &opt_password,(gptr*) &opt_password,
+ " it's solicited on the tty.", (uchar**) &opt_password,(uchar**) &opt_password,
0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#ifdef __WIN__
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0,
@@ -100,11 +108,11 @@ static struct my_option my_long_options[]=
#endif
{"socket", 'S', "Socket file to use for connection.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"user", 'u', "User for login if not current user.", (gptr*) &opt_user,
- (gptr*) &opt_user, 0, GET_STR, REQUIRED_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},
#include <sslopt-longopts.h>
{"verbose", 'v', "Display more output about the process",
- (gptr*) &opt_verbose, (gptr*) &opt_verbose, 0,
+ (uchar**) &opt_verbose, (uchar**) &opt_verbose, 0,
GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -138,7 +146,7 @@ static void die(const char *fmt, ...)
va_end(args);
free_used_memory();
- my_end(MY_CHECK_ERROR);
+ my_end(my_end_arg);
exit(1);
}
@@ -200,8 +208,9 @@ get_one_option(int optid, const struct my_option *opt,
switch (optid) {
case '?':
- printf("MySQL utility for upgrading database to MySQL version %s\n",
- MYSQL_SERVER_VERSION);
+ printf("%s Ver %s Distrib %s, for %s (%s)\n",
+ my_progname, VER, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
+ puts("MySQL utility for upgrading databases to new MySQL versions\n");
my_print_help(my_long_options);
exit(0);
break;
@@ -209,6 +218,7 @@ get_one_option(int optid, const struct my_option *opt,
case '#':
DBUG_PUSH(argument ? argument : default_dbug_option);
add_option= FALSE;
+ debug_check_flag= 1;
break;
case 'p':
@@ -342,16 +352,11 @@ static my_bool get_full_path_to_executable(char* path)
/*
Look for the tool in the same directory as mysql_upgrade.
-
- When running in a not yet installed build the the program
- will exist but it need to be invoked via it's libtool wrapper.
- Check if the found tool can executed and if not look in the
- directory one step higher up where the libtool wrapper normally
- is found
*/
static void find_tool(char *tool_path, const char *tool_name)
{
+ size_t path_len;
char path[FN_REFLEN];
DYNAMIC_STRING ds_tmp;
DBUG_ENTER("find_tool");
@@ -385,37 +390,52 @@ static void find_tool(char *tool_path, const char *tool_name)
path[0]= 0;
}
}
- do
+
+ DBUG_PRINT("info", ("path: '%s'", path));
+
+ /* Chop off binary name (i.e mysql-upgrade) from path */
+ dirname_part(path, path, &path_len);
+
+ /*
+ When running in a not yet installed build and using libtool,
+ the program(mysql_upgrade) will be in .libs/ and executed
+ through a libtool wrapper in order to use the dynamic libraries
+ from this build. The same must be done for the tools(mysql and
+ mysqlcheck). Thus if path ends in .libs/, step up one directory
+ and execute the tools from there
+ */
+ path[max(path_len-1, 0)]= 0; /* Chop off last / */
+ if (strncmp(path + dirname_length(path), ".libs", 5) == 0)
{
- DBUG_PRINT("enter", ("path: %s", path));
+ DBUG_PRINT("info", ("Chopping off .libs from '%s'", path));
+
+ /* Chop off .libs */
+ dirname_part(path, path, &path_len);
+ }
- /* Chop off last char(since it might be a /) */
- path[max((strlen(path)-1), 0)]= 0;
- /* Chop off last dir part */
- dirname_part(path, path);
+ DBUG_PRINT("info", ("path: '%s'", path));
- /* Format name of the tool to search for */
- fn_format(tool_path, tool_name,
- path, "", MYF(MY_REPLACE_DIR));
+ /* Format name of the tool to search for */
+ fn_format(tool_path, tool_name,
+ path, "", MYF(MY_REPLACE_DIR));
- verbose("Looking for '%s' in: %s", tool_name, tool_path);
+ verbose("Looking for '%s' in: %s", tool_name, tool_path);
- /* Make sure the tool exists */
- if (my_access(tool_path, F_OK) != 0)
- die("Can't find '%s'", tool_path);
+ /* Make sure the tool exists */
+ if (my_access(tool_path, F_OK) != 0)
+ die("Can't find '%s'", tool_path);
- /*
- Make sure it can be executed, otherwise try again
- in higher level directory
- */
- }
- while(run_tool(tool_path,
- &ds_tmp, /* Get output from command, discard*/
- "--help",
- "2>&1",
- IF_WIN("> NUL", "> /dev/null"),
- NULL));
+ /*
+ Make sure it can be executed
+ */
+ if (run_tool(tool_path,
+ &ds_tmp, /* Get output from command, discard*/
+ "--help",
+ "2>&1",
+ IF_WIN("> NUL", "> /dev/null"),
+ NULL))
+ die("Can't execute '%s'", tool_path);
dynstr_free(&ds_tmp);
@@ -440,12 +460,13 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res,
MYF(MY_WME))) < 0)
die("Failed to create temporary file for defaults");
- if (my_write(fd, query, strlen(query),
+ if (my_write(fd, (uchar*) query, strlen(query),
MYF(MY_FNABP | MY_WME)))
die("Failed to write to '%s'", query_file_path);
ret= run_tool(mysql_path,
ds_res,
+ "--no-defaults",
ds_args.str,
"--database=mysql",
"--batch", /* Turns off pager etc. */
@@ -457,6 +478,7 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res,
NULL);
my_close(fd, MYF(0));
+ my_delete(query_file_path, MYF(0));
DBUG_RETURN(ret);
}
@@ -607,6 +629,7 @@ static int run_mysqlcheck_upgrade(void)
verbose("Running 'mysqlcheck'...");
return run_tool(mysqlcheck_path,
NULL, /* Send output from mysqlcheck directly to screen */
+ "--no-defaults",
ds_args.str,
"--check-upgrade",
"--all-databases",
@@ -731,6 +754,10 @@ int main(int argc, char **argv)
if (handle_options(&argc, &argv, my_long_options, get_one_option))
die(NULL);
+ if (debug_info_flag)
+ my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO;
+ if (debug_check_flag)
+ my_end_arg= MY_CHECK_ERROR;
if (tty_password)
{
@@ -779,7 +806,7 @@ int main(int argc, char **argv)
create_mysql_upgrade_info_file();
free_used_memory();
- my_end(MY_CHECK_ERROR);
+ my_end(my_end_arg);
exit(0);
}
diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc
index 03b37f2ba3a..91fb7386916 100644
--- a/client/mysqladmin.cc
+++ b/client/mysqladmin.cc
@@ -40,11 +40,12 @@ ulonglong last_values[MAX_MYSQL_VAR];
static int interval=0;
static my_bool option_force=0,interrupted=0,new_line=0,
opt_compress=0, opt_relative=0, opt_verbose=0, opt_vertical=0,
- tty_password= 0, info_flag= 0, opt_nobeep;
-static uint tcp_port = 0, option_wait = 0, option_silent=0, nr_iterations,
- opt_count_iterations= 0;
+ tty_password= 0, opt_nobeep;
+static my_bool debug_info_flag= 0, debug_check_flag= 0;
+static uint tcp_port = 0, option_wait = 0, option_silent=0, nr_iterations;
+static uint opt_count_iterations= 0, my_end_arg;
static ulong opt_connect_timeout, opt_shutdown_timeout;
-static my_string unix_port=0;
+static char * unix_port=0;
#ifdef LATER_HAVE_NDBCLUSTER_DB
static my_bool opt_ndbcluster=0;
static char *opt_ndb_connectstring=0;
@@ -70,10 +71,12 @@ static uint ex_var_count, max_var_length, max_val_length;
static void print_version(void);
static void usage(void);
+extern "C" my_bool get_one_option(int optid, const struct my_option *opt,
+ char *argument);
static my_bool sql_connect(MYSQL *mysql, uint wait);
static int execute_commands(MYSQL *mysql,int argc, char **argv);
static int drop_db(MYSQL *mysql,const char *db);
-static sig_handler endprog(int signal_number);
+extern "C" sig_handler endprog(int signal_number);
static void nice_time(ulong sec,char *buff);
static void print_header(MYSQL_RES *result);
static void print_top(MYSQL_RES *result);
@@ -132,31 +135,37 @@ static struct my_option my_long_options[] =
#endif
{"count", 'c',
"Number of iterations to make. This works with -i (--sleep) only.",
- (gptr*) &nr_iterations, (gptr*) &nr_iterations, 0, GET_UINT,
+ (uchar**) &nr_iterations, (uchar**) &nr_iterations, 0, GET_UINT,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+#ifndef DBUG_OFF
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
- {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", (gptr*) &info_flag,
- (gptr*) &info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+#endif
+ {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .",
+ (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+ GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
+ (uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
+ 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"force", 'f',
"Don't ask for confirmation on drop database; with multiple commands, continue even if an error occurs.",
- (gptr*) &option_force, (gptr*) &option_force, 0, GET_BOOL, NO_ARG, 0, 0,
+ (uchar**) &option_force, (uchar**) &option_force, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0},
{"compress", 'C', "Use compression in server/client protocol.",
- (gptr*) &opt_compress, (gptr*) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+ (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
- "Directory where character sets are.", (gptr*) &charsets_dir,
- (gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Directory where character sets are.", (uchar**) &charsets_dir,
+ (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"default-character-set", OPT_DEFAULT_CHARSET,
- "Set the default character set.", (gptr*) &default_charset,
- (gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Set the default character set.", (uchar**) &default_charset,
+ (uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
- {"host", 'h', "Connect to host.", (gptr*) &host, (gptr*) &host, 0, GET_STR,
+ {"host", 'h', "Connect to host.", (uchar**) &host, (uchar**) &host, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"no-beep", 'b', "Turn off beep on error.", (gptr*) &opt_nobeep,
- (gptr*) &opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"no-beep", 'b', "Turn off beep on error.", (uchar**) &opt_nobeep,
+ (uchar**) &opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"password", 'p',
"Password to use when connecting to server. If password is not given it's asked from the tty.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
@@ -164,58 +173,58 @@ static struct my_option my_long_options[] =
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"port", 'P', "Port number to use for connection.", (gptr*) &tcp_port,
- (gptr*) &tcp_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"port", 'P', "Port number to use for connection.", (uchar**) &tcp_port,
+ (uchar**) &tcp_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"relative", 'r',
"Show difference between current and previous values when used with -i. Currently works only with extended-status.",
- (gptr*) &opt_relative, (gptr*) &opt_relative, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+ (uchar**) &opt_relative, (uchar**) &opt_relative, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"set-variable", 'O',
"Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
- "Base name of shared memory.", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
+ "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"silent", 's', "Silently exit if one can't connect to server.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"socket", 'S', "Socket file to use for connection.",
- (gptr*) &unix_port, (gptr*) &unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
+ (uchar**) &unix_port, (uchar**) &unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
0, 0, 0},
{"sleep", 'i', "Execute commands again and again with a sleep between.",
- (gptr*) &interval, (gptr*) &interval, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0,
+ (uchar**) &interval, (uchar**) &interval, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0,
0, 0},
#include <sslopt-longopts.h>
#ifndef DONT_ALLOW_USER_CHANGE
- {"user", 'u', "User for login if not current user.", (gptr*) &user,
- (gptr*) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"user", 'u', "User for login if not current user.", (uchar**) &user,
+ (uchar**) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"verbose", 'v', "Write more information.", (gptr*) &opt_verbose,
- (gptr*) &opt_verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"verbose", 'v', "Write more information.", (uchar**) &opt_verbose,
+ (uchar**) &opt_verbose, 0, GET_BOOL, NO_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},
{"vertical", 'E',
"Print output vertically. Is similar to --relative, but prints output vertically.",
- (gptr*) &opt_vertical, (gptr*) &opt_vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+ (uchar**) &opt_vertical, (uchar**) &opt_vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"wait", 'w', "Wait and retry if connection is down.", 0, 0, 0, GET_UINT,
OPT_ARG, 0, 0, 0, 0, 0, 0},
- {"connect_timeout", OPT_CONNECT_TIMEOUT, "", (gptr*) &opt_connect_timeout,
- (gptr*) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 3600*12, 0,
+ {"connect_timeout", OPT_CONNECT_TIMEOUT, "", (uchar**) &opt_connect_timeout,
+ (uchar**) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 3600*12, 0,
3600*12, 0, 1, 0},
- {"shutdown_timeout", OPT_SHUTDOWN_TIMEOUT, "", (gptr*) &opt_shutdown_timeout,
- (gptr*) &opt_shutdown_timeout, 0, GET_ULONG, REQUIRED_ARG,
+ {"shutdown_timeout", OPT_SHUTDOWN_TIMEOUT, "", (uchar**) &opt_shutdown_timeout,
+ (uchar**) &opt_shutdown_timeout, 0, GET_ULONG, REQUIRED_ARG,
SHUTDOWN_DEF_TIMEOUT, 0, 3600*12, 0, 1, 0},
#ifdef LATER_HAVE_NDBCLUSTER_DB
{"ndbcluster", OPT_NDBCLUSTER, ""
- "", (gptr*) &opt_ndbcluster,
- (gptr*) &opt_ndbcluster, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ "", (uchar**) &opt_ndbcluster,
+ (uchar**) &opt_ndbcluster, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"ndb-connectstring", OPT_NDB_CONNECTSTRING, ""
- "", (gptr*) &opt_ndb_connectstring,
- (gptr*) &opt_ndb_connectstring, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "", (uchar**) &opt_ndb_connectstring,
+ (uchar**) &opt_ndb_connectstring, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -223,7 +232,7 @@ static struct my_option my_long_options[] =
static const char *load_default_groups[]= { "mysqladmin","client",0 };
-static my_bool
+my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument)
{
@@ -315,6 +324,10 @@ int main(int argc,char *argv[])
free_defaults(save_argv);
exit(ho_error);
}
+ if (debug_info_flag)
+ my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO;
+ if (debug_check_flag)
+ my_end_arg= MY_CHECK_ERROR;
if (argc == 0)
{
@@ -413,13 +426,13 @@ int main(int argc,char *argv[])
my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR));
#endif
free_defaults(save_argv);
- my_end(info_flag ? MY_CHECK_ERROR : 0);
+ my_end(my_end_arg);
exit(error ? 1 : 0);
return 0;
}
-static sig_handler endprog(int signal_number __attribute__((unused)))
+sig_handler endprog(int signal_number __attribute__((unused)))
{
interrupted=1;
}
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 033c55707fc..12d1da39974 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -65,11 +65,13 @@ static bool one_database=0, to_last_remote_log= 0, disable_log_bin= 0;
static bool opt_hexdump= 0;
static bool opt_base64_output= 0;
static const char* database= 0;
-static my_bool force_opt= 0, short_form= 0, remote_opt= 0, info_flag;
+static my_bool force_opt= 0, short_form= 0, remote_opt= 0;
+static my_bool debug_info_flag, debug_check_flag;
static my_bool force_if_open_opt= 1;
static ulonglong offset = 0;
static const char* host = 0;
static int port= 0;
+static uint my_end_arg;
static const char* sock= 0;
static const char* user = 0;
static char* pass = 0;
@@ -296,7 +298,7 @@ File Load_log_processor::prepare_new_file_for_old_format(Load_log_event *le,
int Load_log_processor::load_old_format_file(NET* net, const char*server_fname,
uint server_fname_len, File file)
{
- char buf[FN_REFLEN+1];
+ uchar buf[FN_REFLEN+1];
buf[0] = 0;
memcpy(buf + 1, server_fname, server_fname_len + 1);
if (my_net_write(net, buf, server_fname_len +2) || net_flush(net))
@@ -310,7 +312,7 @@ int Load_log_processor::load_old_format_file(NET* net, const char*server_fname,
ulong packet_len = my_net_read(net);
if (packet_len == 0)
{
- if (my_net_write(net, "", 0) || net_flush(net))
+ if (my_net_write(net, (uchar*) "", 0) || net_flush(net))
{
sql_print_error("Failed sending the ack packet");
return -1;
@@ -334,7 +336,7 @@ int Load_log_processor::load_old_format_file(NET* net, const char*server_fname,
sql_print_error("Illegal length of packet read from net");
return -1;
}
- if (my_write(file, (byte*) net->read_pos,
+ if (my_write(file, (uchar*) net->read_pos,
(uint) packet_len, MYF(MY_WME|MY_NABP)))
return -1;
}
@@ -379,7 +381,7 @@ int Load_log_processor::process_first_event(const char *bname, uint blen,
File_name_record rec;
DBUG_ENTER("Load_log_processor::process_first_event");
- if (!(fname= my_malloc(full_len,MYF(MY_WME))))
+ if (!(fname= (char*) my_malloc(full_len,MYF(MY_WME))))
DBUG_RETURN(-1);
memcpy(fname, target_dir_name, target_dir_name_len);
@@ -398,7 +400,7 @@ int Load_log_processor::process_first_event(const char *bname, uint blen,
rec.fname= fname;
rec.event= ce;
- if (set_dynamic(&file_names, (gptr)&rec, file_id))
+ if (set_dynamic(&file_names, (uchar*)&rec, file_id))
{
sql_print_error("Could not construct local filename %s%s",
target_dir_name, bname);
@@ -408,7 +410,7 @@ int Load_log_processor::process_first_event(const char *bname, uint blen,
if (ce)
ce->set_fname_outside_temp_buf(fname, strlen(fname));
- if (my_write(file, (byte*)block, block_len, MYF(MY_WME|MY_NABP)))
+ if (my_write(file, (uchar*)block, block_len, MYF(MY_WME|MY_NABP)))
error= -1;
if (my_close(file, MYF(MY_WME)))
error= -1;
@@ -447,7 +449,7 @@ int Load_log_processor::process(Append_block_log_event *ae)
if (((file= my_open(fname,
O_APPEND|O_BINARY|O_WRONLY,MYF(MY_WME))) < 0))
DBUG_RETURN(-1);
- if (my_write(file,(byte*)ae->block,ae->block_len,MYF(MY_WME|MY_NABP)))
+ if (my_write(file,(uchar*)ae->block,ae->block_len,MYF(MY_WME|MY_NABP)))
error= -1;
if (my_close(file,MYF(MY_WME)))
error= -1;
@@ -635,6 +637,7 @@ Create_file event for file_id: %u\n",exv->file_id);
print_event_info->common_header_len=
glob_description_event->common_header_len;
ev->print(result_file, print_event_info);
+ ev->temp_buf= 0; // as the event ref is zeroed
/*
We don't want this event to be deleted now, so let's hide it (I
(Guilhem) should later see if this triggers a non-serious Valgrind
@@ -682,8 +685,16 @@ Begin_load_query event for file_id: %u\n", exlq->file_id);
end:
rec_count++;
+ /*
+ Destroy the log_event object. If reading from a remote host,
+ set the temp_buf to NULL so that memory isn't freed twice.
+ */
if (ev)
+ {
+ if (remote_opt)
+ ev->temp_buf= 0;
delete ev;
+ }
DBUG_RETURN(0);
}
@@ -700,7 +711,7 @@ static struct my_option my_long_options[] =
"Print all binlog entries using base64 encoding. "
"This is for debugging only. Logs produced using this option "
"should not be applied on production systems.",
- (gptr*) &opt_base64_output, (gptr*) &opt_base64_output, 0, GET_BOOL,
+ (uchar**) &opt_base64_output, (uchar**) &opt_base64_output, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
/*
mysqlbinlog needs charsets knowledge, to be able to convert a charset
@@ -709,47 +720,51 @@ static struct my_option my_long_options[] =
SET @`a`:=_cp850 0x4DFC6C6C6572 COLLATE `cp850_general_ci`;
*/
{"character-sets-dir", OPT_CHARSETS_DIR,
- "Directory where character sets are.", (gptr*) &charsets_dir,
- (gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Directory where character sets are.", (uchar**) &charsets_dir,
+ (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"database", 'd', "List entries for just this database (local log only).",
- (gptr*) &database, (gptr*) &database, 0, GET_STR_ALLOC, REQUIRED_ARG,
+ (uchar**) &database, (uchar**) &database, 0, GET_STR_ALLOC, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
#ifndef DBUG_OFF
- {"debug", '#', "Output debug log.", (gptr*) &default_dbug_option,
- (gptr*) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug", '#', "Output debug log.", (uchar**) &default_dbug_option,
+ (uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", (gptr*) &info_flag,
- (gptr*) &info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .",
+ (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+ GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
+ (uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
+ 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"disable-log-bin", 'D', "Disable binary log. This is useful, if you "
"enabled --to-last-log and are sending the output to the same MySQL server. "
"This way you could avoid an endless loop. You would also like to use it "
"when restoring after a crash to avoid duplication of the statements you "
"already have. NOTE: you will need a SUPER privilege to use this option.",
- (gptr*) &disable_log_bin, (gptr*) &disable_log_bin, 0, GET_BOOL,
+ (uchar**) &disable_log_bin, (uchar**) &disable_log_bin, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"force-if-open", 'F', "Force if binlog was not closed properly.",
- (gptr*) &force_if_open_opt, (gptr*) &force_if_open_opt, 0, GET_BOOL, NO_ARG,
+ (uchar**) &force_if_open_opt, (uchar**) &force_if_open_opt, 0, GET_BOOL, NO_ARG,
1, 0, 0, 0, 0, 0},
{"force-read", 'f', "Force reading unknown binlog events.",
- (gptr*) &force_opt, (gptr*) &force_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+ (uchar**) &force_opt, (uchar**) &force_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"hexdump", 'H', "Augment output with hexadecimal and ASCII event dump.",
- (gptr*) &opt_hexdump, (gptr*) &opt_hexdump, 0, GET_BOOL, NO_ARG,
+ (uchar**) &opt_hexdump, (uchar**) &opt_hexdump, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
- {"host", 'h', "Get the binlog from server.", (gptr*) &host, (gptr*) &host,
+ {"host", 'h', "Get the binlog from server.", (uchar**) &host, (uchar**) &host,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"local-load", 'l', "Prepare local temporary files for LOAD DATA INFILE in the specified directory.",
- (gptr*) &dirname_for_local_load, (gptr*) &dirname_for_local_load, 0,
+ (uchar**) &dirname_for_local_load, (uchar**) &dirname_for_local_load, 0,
GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"offset", 'o', "Skip the first N entries.", (gptr*) &offset, (gptr*) &offset,
+ {"offset", 'o', "Skip the first N entries.", (uchar**) &offset, (uchar**) &offset,
0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"password", 'p', "Password to connect to remote server.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Use port to connect to the remote server.",
- (gptr*) &port, (gptr*) &port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0,
+ (uchar**) &port, (uchar**) &port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0,
0, 0, 0},
{"position", 'j', "Deprecated. Use --start-position instead.",
- (gptr*) &start_position, (gptr*) &start_position, 0, GET_ULL,
+ (uchar**) &start_position, (uchar**) &start_position, 0, GET_ULL,
REQUIRED_ARG, BIN_LOG_HEADER_SIZE, BIN_LOG_HEADER_SIZE,
/* COM_BINLOG_DUMP accepts only 4 bytes for the position */
(ulonglong)(~(uint32)0), 0, 0, 0},
@@ -757,22 +772,22 @@ static struct my_option my_long_options[] =
"The protocol of connection (tcp,socket,pipe,memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"read-from-remote-server", 'R', "Read binary logs from a MySQL server",
- (gptr*) &remote_opt, (gptr*) &remote_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+ (uchar**) &remote_opt, (uchar**) &remote_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"result-file", 'r', "Direct output to a given file.", 0, 0, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"server-id", OPT_SERVER_ID,
"Extract only binlog entries created by the server having the given id.",
- (gptr*) &server_id, (gptr*) &server_id, 0, GET_ULONG,
+ (uchar**) &server_id, (uchar**) &server_id, 0, GET_ULONG,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"set-charset", OPT_SET_CHARSET,
- "Add 'SET NAMES character_set' to the output.", (gptr*) &charset,
- (gptr*) &charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Add 'SET NAMES character_set' to the output.", (uchar**) &charset,
+ (uchar**) &charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"short-form", 's', "Just show the queries, no extra info.",
- (gptr*) &short_form, (gptr*) &short_form, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+ (uchar**) &short_form, (uchar**) &short_form, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"socket", 'S', "Socket file to use for connection.",
- (gptr*) &sock, (gptr*) &sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
+ (uchar**) &sock, (uchar**) &sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
0, 0},
{"start-datetime", OPT_START_DATETIME,
"Start reading the binlog at first event having a datetime equal or "
@@ -780,12 +795,12 @@ static struct my_option my_long_options[] =
"in the local time zone, in any format accepted by the MySQL server "
"for DATETIME and TIMESTAMP types, for example: 2004-12-25 11:25:56 "
"(you should probably use quotes for your shell to set it properly).",
- (gptr*) &start_datetime_str, (gptr*) &start_datetime_str,
+ (uchar**) &start_datetime_str, (uchar**) &start_datetime_str,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"start-position", OPT_START_POSITION,
"Start reading the binlog at position N. Applies to the first binlog "
"passed on the command line.",
- (gptr*) &start_position, (gptr*) &start_position, 0, GET_ULL,
+ (uchar**) &start_position, (uchar**) &start_position, 0, GET_ULL,
REQUIRED_ARG, BIN_LOG_HEADER_SIZE, BIN_LOG_HEADER_SIZE,
/* COM_BINLOG_DUMP accepts only 4 bytes for the position */
(ulonglong)(~(uint32)0), 0, 0, 0},
@@ -795,28 +810,28 @@ static struct my_option my_long_options[] =
"in the local time zone, in any format accepted by the MySQL server "
"for DATETIME and TIMESTAMP types, for example: 2004-12-25 11:25:56 "
"(you should probably use quotes for your shell to set it properly).",
- (gptr*) &stop_datetime_str, (gptr*) &stop_datetime_str,
+ (uchar**) &stop_datetime_str, (uchar**) &stop_datetime_str,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"stop-position", OPT_STOP_POSITION,
"Stop reading the binlog at position N. Applies to the last binlog "
"passed on the command line.",
- (gptr*) &stop_position, (gptr*) &stop_position, 0, GET_ULL,
+ (uchar**) &stop_position, (uchar**) &stop_position, 0, GET_ULL,
REQUIRED_ARG, (ulonglong)(~(my_off_t)0), BIN_LOG_HEADER_SIZE,
(ulonglong)(~(my_off_t)0), 0, 0, 0},
{"to-last-log", 't', "Requires -R. Will not stop at the end of the \
requested binlog but rather continue printing until the end of the last \
binlog of the MySQL server. If you send the output to the same MySQL server, \
that may lead to an endless loop.",
- (gptr*) &to_last_remote_log, (gptr*) &to_last_remote_log, 0, GET_BOOL,
+ (uchar**) &to_last_remote_log, (uchar**) &to_last_remote_log, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"user", 'u', "Connect to the remote server as username.",
- (gptr*) &user, (gptr*) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0,
+ (uchar**) &user, (uchar**) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0,
0, 0},
{"version", 'V', "Print version and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
0, 0, 0, 0, 0},
{"open_files_limit", OPT_OPEN_FILES_LIMIT,
"Used to reserve file descriptors for usage by this program",
- (gptr*) &open_files_limit, (gptr*) &open_files_limit, 0, GET_ULONG,
+ (uchar**) &open_files_limit, (uchar**) &open_files_limit, 0, GET_ULONG,
REQUIRED_ARG, MY_NFILE, 8, OS_FILE_LIMIT, 0, 1, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -851,7 +866,7 @@ static void die(const char* fmt, ...)
va_end(args);
cleanup();
/* We cannot free DBUG, it is used in global destructors after exit(). */
- my_end((info_flag ? MY_CHECK_ERROR : 0) | MY_DONT_FREE_DBUG);
+ my_end(my_end_arg | MY_DONT_FREE_DBUG);
exit(1);
}
@@ -859,7 +874,7 @@ static void die(const char* fmt, ...)
static void print_version()
{
- printf("%s Ver 3.2 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE);
+ printf("%s Ver 3.3 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE);
NETWARE_SET_SCREEN_MODE(1);
}
@@ -975,7 +990,10 @@ static int parse_args(int *argc, char*** argv)
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)
+ my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO;
+ if (debug_check_flag)
+ my_end_arg= MY_CHECK_ERROR;
return 0;
}
@@ -1012,14 +1030,14 @@ static int dump_log_entries(const char* logname)
like CREATE PROCEDURE safely
*/
fprintf(result_file, "DELIMITER /*!*/;\n");
- strcpy(print_event_info.delimiter, "/*!*/;");
+ strmov(print_event_info.delimiter, "/*!*/;");
rc= (remote_opt ? dump_remote_log_entries(&print_event_info, logname) :
dump_local_log_entries(&print_event_info, logname));
/* Set delimiter back to semicolon */
fprintf(result_file, "DELIMITER ;\n");
- strcpy(print_event_info.delimiter, ";");
+ strmov(print_event_info.delimiter, ";");
return rc;
}
@@ -1069,6 +1087,7 @@ static int check_master_version(MYSQL *mysql_arg,
break;
case '4':
*description_event= new Format_description_log_event(3);
+ break;
case '5':
/*
The server is soon going to send us its Format_description log
@@ -1094,7 +1113,7 @@ static int dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info,
const char* logname)
{
- char buf[128];
+ uchar buf[128];
ulong len;
uint logname_len;
NET* net;
@@ -1130,7 +1149,7 @@ could be out of memory");
int4store(buf, (uint32)start_position);
int2store(buf + BIN_LOG_HEADER_SIZE, binlog_flags);
- size_s tlen = strlen(logname);
+ size_t tlen = strlen(logname);
if (tlen > UINT_MAX)
{
fprintf(stderr,"Log name too long\n");
@@ -1172,6 +1191,12 @@ could be out of memory");
error= 1;
goto err;
}
+ /*
+ If reading from a remote host, ensure the temp_buf for the
+ Log_event class is pointing to the incoming stream.
+ */
+ if (remote_opt)
+ ev->register_temp_buf((char*) net->read_pos + 1);
Log_event_type type= ev->get_type_code();
if (glob_description_event->binlog_version >= 3 ||
@@ -1278,17 +1303,23 @@ err:
static void check_header(IO_CACHE* file,
Format_description_log_event **description_event)
{
- byte header[BIN_LOG_HEADER_SIZE];
- byte buf[PROBE_HEADER_LEN];
+ uchar header[BIN_LOG_HEADER_SIZE];
+ uchar buf[PROBE_HEADER_LEN];
my_off_t tmp_pos, pos;
*description_event= new Format_description_log_event(3);
pos= my_b_tell(file);
my_b_seek(file, (my_off_t)0);
if (my_b_read(file, header, sizeof(header)))
+ {
+ delete *description_event;
die("Failed reading header; Probably an empty file");
+ }
if (memcmp(header, BINLOG_MAGIC, sizeof(header)))
+ {
+ delete *description_event;
die("File is not a binary log file");
+ }
/*
Imagine we are running with --start-position=1000. We still need
@@ -1309,9 +1340,12 @@ static void check_header(IO_CACHE* file,
if (my_b_read(file, buf, sizeof(buf)))
{
if (file->error)
+ {
+ delete *description_event;
die("\
Could not read entry at offset %lu : Error in log format or read error",
tmp_pos);
+ }
/*
Otherwise this is just EOF : this log currently contains 0-2
events. Maybe it's going to be filled in the next
@@ -1347,13 +1381,19 @@ Could not read entry at offset %lu : Error in log format or read error",
break;
else if (buf[4] == FORMAT_DESCRIPTION_EVENT) /* This is 5.0 */
{
+ Format_description_log_event *new_description_event;
my_b_seek(file, tmp_pos); /* seek back to event's start */
- if (!(*description_event= (Format_description_log_event*)
+ if (!(new_description_event= (Format_description_log_event*)
Log_event::read_log_event(file, *description_event)))
/* EOF can't be hit here normally, so it's a real error */
+ {
+ delete *description_event;
die("Could not read a Format_description_log_event event \
at offset %lu ; this could be a log format error or read error",
tmp_pos);
+ }
+ delete *description_event;
+ *description_event= new_description_event;
DBUG_PRINT("info",("Setting description_event"));
}
else if (buf[4] == ROTATE_EVENT)
@@ -1362,8 +1402,11 @@ at offset %lu ; this could be a log format error or read error",
my_b_seek(file, tmp_pos); /* seek back to event's start */
if (!(ev= Log_event::read_log_event(file, *description_event)))
/* EOF can't be hit here normally, so it's a real error */
+ {
+ delete *description_event;
die("Could not read a Rotate_log_event event at offset %lu ;"
" this could be a log format error or read error", tmp_pos);
+ }
delete ev;
}
else
@@ -1379,7 +1422,7 @@ static int dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
{
File fd = -1;
IO_CACHE cache,*file= &cache;
- byte tmp_buff[BIN_LOG_HEADER_SIZE];
+ uchar tmp_buff[BIN_LOG_HEADER_SIZE];
int error= 0;
if (logname && logname[0] != '-')
@@ -1418,7 +1461,7 @@ static int dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
if (start_position)
{
/* skip 'start_position' characters from stdin */
- byte buff[IO_SIZE];
+ uchar buff[IO_SIZE];
my_off_t length,tmp;
for (length= start_position_mot ; length > 0 ; length-=tmp)
{
@@ -1433,7 +1476,10 @@ static int dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
}
if (!glob_description_event || !glob_description_event->is_valid())
+ {
+ delete glob_description_event;
die("Invalid Format_description log event; could be out of memory");
+ }
if (!start_position && my_b_read(file, tmp_buff, BIN_LOG_HEADER_SIZE))
{
@@ -1582,7 +1628,7 @@ int main(int argc, char** argv)
my_free_open_file_info();
load_processor.destroy();
/* We cannot free DBUG, it is used in global destructors after exit(). */
- my_end((info_flag ? MY_CHECK_ERROR : 0) | MY_DONT_FREE_DBUG);
+ my_end(my_end_arg | MY_DONT_FREE_DBUG);
if (file_not_closed_error)
{
@@ -1602,17 +1648,9 @@ int main(int argc, char** argv)
the server
*/
-#if defined(__WIN__) && !defined(USING_CMAKE)
-#include "my_decimal.h"
-#include "decimal.c"
-#include "my_decimal.cpp"
-#include "log_event.cpp"
-#include "log_event_old.cpp"
-#else
#include "my_decimal.h"
#include "decimal.c"
#include "my_decimal.cc"
#include "log_event.cc"
#include "log_event_old.cc"
-#endif
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index 28b3103c53e..c3883efce97 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -15,7 +15,7 @@
/* By Jani Tolonen, 2001-04-20, MySQL Development Team */
-#define CHECK_VERSION "2.4.5"
+#define CHECK_VERSION "2.5.0"
#include "client_priv.h"
#include <m_ctype.h>
@@ -33,11 +33,12 @@ static my_bool opt_alldbs = 0, opt_check_only_changed = 0, opt_extended = 0,
opt_compress = 0, opt_databases = 0, opt_fast = 0,
opt_medium_check = 0, opt_quick = 0, opt_all_in_1 = 0,
opt_silent = 0, opt_auto_repair = 0, ignore_errors = 0,
- tty_password= 0, opt_frm= 0, info_flag= 0,
+ tty_password= 0, opt_frm= 0, debug_info_flag= 0, debug_check_flag= 0,
opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0,
opt_write_binlog= 1;
static uint verbose = 0, opt_mysql_port=0;
-static my_string opt_mysql_unix_port = 0;
+static int my_end_arg;
+static char * opt_mysql_unix_port = 0;
static char *opt_password = 0, *current_user = 0,
*default_charset = (char *)MYSQL_DEFAULT_CHARSET_NAME,
*current_host = 0;
@@ -55,13 +56,13 @@ static struct my_option my_long_options[] =
{
{"all-databases", 'A',
"Check all the databases. This will be same as --databases with all databases selected.",
- (gptr*) &opt_alldbs, (gptr*) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+ (uchar**) &opt_alldbs, (uchar**) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"analyze", 'a', "Analyze given tables.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
0, 0, 0, 0},
{"all-in-1", '1',
"Instead of issuing one query for each table, use one query per database, naming all tables in the database in a comma-separated list.",
- (gptr*) &opt_all_in_1, (gptr*) &opt_all_in_1, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+ (uchar**) &opt_all_in_1, (uchar**) &opt_all_in_1, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
#ifdef __NETWARE__
{"autoclose", OPT_AUTO_CLOSE, "Auto close the screen on exit for Netware.",
@@ -69,11 +70,11 @@ static struct my_option my_long_options[] =
#endif
{"auto-repair", OPT_AUTO_REPAIR,
"If a checked table is corrupted, automatically fix it. Repairing will be done after all tables have been checked, if corrupted ones were found.",
- (gptr*) &opt_auto_repair, (gptr*) &opt_auto_repair, 0, GET_BOOL, NO_ARG, 0,
+ (uchar**) &opt_auto_repair, (uchar**) &opt_auto_repair, 0, GET_BOOL, NO_ARG, 0,
0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
- "Directory where character sets are.", (gptr*) &charsets_dir,
- (gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Directory where character sets are.", (uchar**) &charsets_dir,
+ (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"check", 'c', "Check table for errors.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
0, 0, 0, 0},
{"check-only-changed", 'C',
@@ -83,11 +84,11 @@ static struct my_option my_long_options[] =
"Check tables for version-dependent changes. May be used with --auto-repair to correct tables requiring version-dependent updates.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"compress", OPT_COMPRESS, "Use compression in server/client protocol.",
- (gptr*) &opt_compress, (gptr*) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+ (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"databases", 'B',
"To check several databases. Note the difference in usage; In this case no tables are given. All name arguments are regarded as databasenames.",
- (gptr*) &opt_databases, (gptr*) &opt_databases, 0, GET_BOOL, NO_ARG,
+ (uchar**) &opt_databases, (uchar**) &opt_databases, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
#ifdef DBUG_OFF
{"debug", '#', "This is a non-debug version. Catch this and exit.",
@@ -96,37 +97,41 @@ static struct my_option my_long_options[] =
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", (gptr*) &info_flag,
- (gptr*) &info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .",
+ (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+ GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
+ (uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
+ 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"default-character-set", OPT_DEFAULT_CHARSET,
- "Set the default character set.", (gptr*) &default_charset,
- (gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Set the default character set.", (uchar**) &default_charset,
+ (uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"fast",'F', "Check only tables that haven't been closed properly.",
- (gptr*) &opt_fast, (gptr*) &opt_fast, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
+ (uchar**) &opt_fast, (uchar**) &opt_fast, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0},
{"fix-db-names", OPT_FIX_DB_NAMES, "Fix database names.",
- (gptr*) &opt_fix_db_names, (gptr*) &opt_fix_db_names,
+ (uchar**) &opt_fix_db_names, (uchar**) &opt_fix_db_names,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"fix-table-names", OPT_FIX_TABLE_NAMES, "Fix table names.",
- (gptr*) &opt_fix_table_names, (gptr*) &opt_fix_table_names,
+ (uchar**) &opt_fix_table_names, (uchar**) &opt_fix_table_names,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"force", 'f', "Continue even if we get an sql-error.",
- (gptr*) &ignore_errors, (gptr*) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
+ (uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0},
{"extended", 'e',
"If you are using this option with CHECK TABLE, it will ensure that the table is 100 percent consistent, but will take a long time. If you are using this option with REPAIR TABLE, it will force using old slow repair with keycache method, instead of much faster repair by sorting.",
- (gptr*) &opt_extended, (gptr*) &opt_extended, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+ (uchar**) &opt_extended, (uchar**) &opt_extended, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
- {"host",'h', "Connect to host.", (gptr*) &current_host,
- (gptr*) &current_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"host",'h', "Connect to host.", (uchar**) &current_host,
+ (uchar**) &current_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"medium-check", 'm',
"Faster than extended-check, but only finds 99.99 percent of all errors. Should be good enough for most cases.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"write-binlog", OPT_WRITE_BINLOG,
"Log ANALYZE, OPTIMIZE and REPAIR TABLE commands. Enabled by default; use --skip-write-binlog when commands should not be sent to replication slaves.",
- (gptr*) &opt_write_binlog, (gptr*) &opt_write_binlog, 0, GET_BOOL, NO_ARG,
+ (uchar**) &opt_write_binlog, (uchar**) &opt_write_binlog, 0, GET_BOOL, NO_ARG,
1, 0, 0, 0, 0, 0},
{"optimize", 'o', "Optimize table.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0,
0, 0},
@@ -137,38 +142,38 @@ static struct my_option my_long_options[] =
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port,
- (gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
+ {"port", 'P', "Port number to use for connection.", (uchar**) &opt_mysql_port,
+ (uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
0},
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"quick", 'q',
"If you are using this option with CHECK TABLE, it prevents the check from scanning the rows to check for wrong links. This is the fastest check. If you are using this option with REPAIR TABLE, it will try to repair only the index tree. This is the fastest repair method for a table.",
- (gptr*) &opt_quick, (gptr*) &opt_quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
+ (uchar**) &opt_quick, (uchar**) &opt_quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0},
{"repair", 'r',
"Can fix almost anything except unique keys that aren't unique.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
- "Base name of shared memory.", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
+ "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"silent", 's', "Print only error messages.", (gptr*) &opt_silent,
- (gptr*) &opt_silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"silent", 's', "Print only error messages.", (uchar**) &opt_silent,
+ (uchar**) &opt_silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"socket", 'S', "Socket file to use for connection.",
- (gptr*) &opt_mysql_unix_port, (gptr*) &opt_mysql_unix_port, 0, GET_STR,
+ (uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#include <sslopt-longopts.h>
{"tables", OPT_TABLES, "Overrides option --databases (-B).", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"use-frm", OPT_FRM,
"When used with REPAIR, get table structure from .frm file, so the table can be repaired even if .MYI header is corrupted.",
- (gptr*) &opt_frm, (gptr*) &opt_frm, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
+ (uchar**) &opt_frm, (uchar**) &opt_frm, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0},
#ifndef DONT_ALLOW_USER_CHANGE
- {"user", 'u', "User for login if not current user.", (gptr*) &current_user,
- (gptr*) &current_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"user", 'u', "User for login if not current user.", (uchar**) &current_user,
+ (uchar**) &current_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"verbose", 'v', "Print info about the various stages.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -305,6 +310,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
case '#':
DBUG_PUSH(argument ? argument : "d:t:o");
+ debug_check_flag= 1;
break;
#include <sslopt-case.h>
case OPT_TABLES:
@@ -375,6 +381,10 @@ static int get_options(int *argc, char ***argv)
}
if (tty_password)
opt_password = get_tty_password(NullS);
+ if (debug_info_flag)
+ my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO;
+ if (debug_check_flag)
+ my_end_arg= MY_CHECK_ERROR;
return(0);
} /* get_options */
@@ -670,7 +680,7 @@ static void print_result()
*/
if (found_error && opt_auto_repair && what_to_do != DO_REPAIR &&
strcmp(row[3],"OK"))
- insert_dynamic(&tables4repair, prev);
+ insert_dynamic(&tables4repair, (uchar*) prev);
found_error=0;
if (opt_silent)
continue;
@@ -690,7 +700,7 @@ static void print_result()
}
/* add the last table to be repaired to the list */
if (found_error && opt_auto_repair && what_to_do != DO_REPAIR)
- insert_dynamic(&tables4repair, prev);
+ insert_dynamic(&tables4repair, (uchar*) prev);
mysql_free_result(res);
}
@@ -765,7 +775,7 @@ int main(int argc, char **argv)
*/
if (get_options(&argc, &argv))
{
- my_end(info_flag ? MY_CHECK_ERROR : 0);
+ my_end(my_end_arg);
exit(EX_USAGE);
}
if (dbConnect(current_host, current_user, opt_password))
@@ -807,6 +817,6 @@ int main(int argc, char **argv)
#ifdef HAVE_SMEM
my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR));
#endif
- my_end(info_flag ? MY_CHECK_ERROR : 0);
+ my_end(my_end_arg);
return(first_error!=0);
} /* main */
diff --git a/client/mysqldump.c b/client/mysqldump.c
index afefa467cce..582e9e3b3b9 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -36,7 +36,7 @@
** 10 Jun 2003: SET NAMES and --no-set-names by Alexander Barkov
*/
-#define DUMP_VERSION "10.12"
+#define DUMP_VERSION "10.13"
#include <my_global.h>
#include <my_sys.h>
@@ -100,9 +100,9 @@ static my_bool verbose= 0, opt_no_create_info= 0, opt_no_data= 0,
opt_dump_triggers= 0, opt_routines=0, opt_tz_utc=1,
opt_events= 0,
opt_alltspcs=0, opt_notspcs= 0;
+static my_bool insert_pat_inited= 0, debug_info_flag= 0, debug_check_flag= 0;
static ulong opt_max_allowed_packet, opt_net_buffer_length;
static MYSQL mysql_connection,*mysql=0;
-static my_bool insert_pat_inited= 0, info_flag;
static DYNAMIC_STRING insert_pat;
static char *opt_password=0,*current_user=0,
*current_host=0,*path=0,*fields_terminated=0,
@@ -116,8 +116,9 @@ static char compatible_mode_normal_str[255];
static ulong opt_compatible_mode= 0;
#define MYSQL_OPT_MASTER_DATA_EFFECTIVE_SQL 1
#define MYSQL_OPT_MASTER_DATA_COMMENTED_SQL 2
-static uint opt_mysql_port= 0, opt_master_data;
-static my_string opt_mysql_unix_port=0;
+static uint opt_mysql_port= 0, opt_master_data;
+static uint my_end_arg;
+static char * opt_mysql_unix_port=0;
static int first_error=0;
static DYNAMIC_STRING extended_row;
#include <sslopt-vars.h>
@@ -177,106 +178,110 @@ HASH ignore_table;
static struct my_option my_long_options[] =
{
{"all", 'a', "Deprecated. Use --create-options instead.",
- (gptr*) &create_options, (gptr*) &create_options, 0, GET_BOOL, NO_ARG, 1,
+ (uchar**) &create_options, (uchar**) &create_options, 0, GET_BOOL, NO_ARG, 1,
0, 0, 0, 0, 0},
{"all-databases", 'A',
"Dump all the databases. This will be same as --databases with all databases selected.",
- (gptr*) &opt_alldbs, (gptr*) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+ (uchar**) &opt_alldbs, (uchar**) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"all-tablespaces", 'Y',
"Dump all the tablespaces.",
- (gptr*) &opt_alltspcs, (gptr*) &opt_alltspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+ (uchar**) &opt_alltspcs, (uchar**) &opt_alltspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"no-tablespaces", 'y',
"Do not dump any tablespace information.",
- (gptr*) &opt_notspcs, (gptr*) &opt_notspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+ (uchar**) &opt_notspcs, (uchar**) &opt_notspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"add-drop-database", OPT_DROP_DATABASE, "Add a 'DROP DATABASE' before each create.",
- (gptr*) &opt_drop_database, (gptr*) &opt_drop_database, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
+ (uchar**) &opt_drop_database, (uchar**) &opt_drop_database, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0},
{"add-drop-table", OPT_DROP, "Add a 'drop table' before each create.",
- (gptr*) &opt_drop, (gptr*) &opt_drop, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0,
+ (uchar**) &opt_drop, (uchar**) &opt_drop, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0,
0},
{"add-locks", OPT_LOCKS, "Add locks around insert statements.",
- (gptr*) &opt_lock, (gptr*) &opt_lock, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0,
+ (uchar**) &opt_lock, (uchar**) &opt_lock, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0,
0},
{"allow-keywords", OPT_KEYWORDS,
- "Allow creation of column names that are keywords.", (gptr*) &opt_keywords,
- (gptr*) &opt_keywords, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ "Allow creation of column names that are keywords.", (uchar**) &opt_keywords,
+ (uchar**) &opt_keywords, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef __NETWARE__
{"autoclose", OPT_AUTO_CLOSE, "Auto close the screen on exit for Netware.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"character-sets-dir", OPT_CHARSETS_DIR,
- "Directory where character sets are.", (gptr*) &charsets_dir,
- (gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Directory where character sets are.", (uchar**) &charsets_dir,
+ (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"comments", 'i', "Write additional information.",
- (gptr*) &opt_comments, (gptr*) &opt_comments, 0, GET_BOOL, NO_ARG,
+ (uchar**) &opt_comments, (uchar**) &opt_comments, 0, GET_BOOL, NO_ARG,
1, 0, 0, 0, 0, 0},
{"compatible", OPT_COMPATIBLE,
"Change the dump to be compatible with a given mode. By default tables are dumped in a format optimized for MySQL. Legal modes are: ansi, mysql323, mysql40, postgresql, oracle, mssql, db2, maxdb, no_key_options, no_table_options, no_field_options. One can use several modes separated by commas. Note: Requires MySQL server version 4.1.0 or higher. This option is ignored with earlier server versions.",
- (gptr*) &opt_compatible_mode_str, (gptr*) &opt_compatible_mode_str, 0,
+ (uchar**) &opt_compatible_mode_str, (uchar**) &opt_compatible_mode_str, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"compact", OPT_COMPACT,
"Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs. Enables options --skip-add-drop-table --no-set-names --skip-disable-keys --skip-add-locks",
- (gptr*) &opt_compact, (gptr*) &opt_compact, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+ (uchar**) &opt_compact, (uchar**) &opt_compact, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"complete-insert", 'c', "Use complete insert statements.",
- (gptr*) &opt_complete_insert, (gptr*) &opt_complete_insert, 0, GET_BOOL,
+ (uchar**) &opt_complete_insert, (uchar**) &opt_complete_insert, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"compress", 'C', "Use compression in server/client protocol.",
- (gptr*) &opt_compress, (gptr*) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+ (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"create-options", OPT_CREATE_OPTIONS,
"Include all MySQL specific create options.",
- (gptr*) &create_options, (gptr*) &create_options, 0, GET_BOOL, NO_ARG, 1,
+ (uchar**) &create_options, (uchar**) &create_options, 0, GET_BOOL, NO_ARG, 1,
0, 0, 0, 0, 0},
{"databases", 'B',
"To dump several databases. Note the difference in usage; In this case no tables are given. All name arguments are regarded as databasenames. 'USE db_name;' will be included in the output.",
- (gptr*) &opt_databases, (gptr*) &opt_databases, 0, GET_BOOL, NO_ARG, 0, 0,
+ (uchar**) &opt_databases, (uchar**) &opt_databases, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0},
#ifdef DBUG_OFF
{"debug", '#', "This is a non-debug version. Catch this and exit",
0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
#else
- {"debug", '#', "Output debug log", (gptr*) &default_dbug_option,
- (gptr*) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug", '#', "Output debug log", (uchar**) &default_dbug_option,
+ (uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", (gptr*) &info_flag,
- (gptr*) &info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .",
+ (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+ GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
+ (uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
+ 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"default-character-set", OPT_DEFAULT_CHARSET,
- "Set the default character set.", (gptr*) &default_charset,
- (gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Set the default character set.", (uchar**) &default_charset,
+ (uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"delayed-insert", OPT_DELAYED, "Insert rows with INSERT DELAYED; ",
- (gptr*) &opt_delayed, (gptr*) &opt_delayed, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+ (uchar**) &opt_delayed, (uchar**) &opt_delayed, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"delete-master-logs", OPT_DELETE_MASTER_LOGS,
"Delete logs on master after backup. This automatically enables --master-data.",
- (gptr*) &opt_delete_master_logs, (gptr*) &opt_delete_master_logs, 0,
+ (uchar**) &opt_delete_master_logs, (uchar**) &opt_delete_master_logs, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"disable-keys", 'K',
- "'/*!40000 ALTER TABLE tb_name DISABLE KEYS */; and '/*!40000 ALTER TABLE tb_name ENABLE KEYS */; will be put in the output.", (gptr*) &opt_disable_keys,
- (gptr*) &opt_disable_keys, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+ "'/*!40000 ALTER TABLE tb_name DISABLE KEYS */; and '/*!40000 ALTER TABLE tb_name ENABLE KEYS */; will be put in the output.", (uchar**) &opt_disable_keys,
+ (uchar**) &opt_disable_keys, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"events", 'E', "Dump events.",
- (gptr*) &opt_events, (gptr*) &opt_events, 0, GET_BOOL,
+ (uchar**) &opt_events, (uchar**) &opt_events, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"extended-insert", 'e',
"Allows utilization of the new, much faster INSERT syntax.",
- (gptr*) &extended_insert, (gptr*) &extended_insert, 0, GET_BOOL, NO_ARG,
+ (uchar**) &extended_insert, (uchar**) &extended_insert, 0, GET_BOOL, NO_ARG,
1, 0, 0, 0, 0, 0},
{"fields-terminated-by", OPT_FTB,
- "Fields in the textfile are terminated by ...", (gptr*) &fields_terminated,
- (gptr*) &fields_terminated, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Fields in the textfile are terminated by ...", (uchar**) &fields_terminated,
+ (uchar**) &fields_terminated, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"fields-enclosed-by", OPT_ENC,
- "Fields in the importfile are enclosed by ...", (gptr*) &enclosed,
- (gptr*) &enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0},
+ "Fields in the importfile are enclosed by ...", (uchar**) &enclosed,
+ (uchar**) &enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0},
{"fields-optionally-enclosed-by", OPT_O_ENC,
- "Fields in the i.file are opt. enclosed by ...", (gptr*) &opt_enclosed,
- (gptr*) &opt_enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0},
+ "Fields in the i.file are opt. enclosed by ...", (uchar**) &opt_enclosed,
+ (uchar**) &opt_enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0},
{"fields-escaped-by", OPT_ESC, "Fields in the i.file are escaped by ...",
- (gptr*) &escaped, (gptr*) &escaped, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ (uchar**) &escaped, (uchar**) &escaped, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"first-slave", 'x', "Deprecated, renamed to --lock-all-tables.",
- (gptr*) &opt_lock_all_tables, (gptr*) &opt_lock_all_tables, 0, GET_BOOL, NO_ARG,
+ (uchar**) &opt_lock_all_tables, (uchar**) &opt_lock_all_tables, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
{"flush-logs", 'F', "Flush logs file in server before starting dump. "
"Note that if you dump many databases at once (using the option "
@@ -287,44 +292,44 @@ static struct my_option my_long_options[] =
"to the moment all tables are locked. So if you want your dump and "
"the log flush to happen at the same exact moment you should use "
"--lock-all-tables or --master-data with --flush-logs",
- (gptr*) &flush_logs, (gptr*) &flush_logs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+ (uchar**) &flush_logs, (uchar**) &flush_logs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"flush-privileges", OPT_ESC, "Emit a FLUSH PRIVILEGES statement "
"after dumping the mysql database. This option should be used any "
"time the dump contains the mysql database and any other database "
"that depends on the data in the mysql database for proper restore. ",
- (gptr*) &flush_privileges, (gptr*) &flush_privileges, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+ (uchar**) &flush_privileges, (uchar**) &flush_privileges, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"force", 'f', "Continue even if we get an sql-error.",
- (gptr*) &ignore_errors, (gptr*) &ignore_errors, 0, GET_BOOL, NO_ARG,
+ (uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
{"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"hex-blob", OPT_HEXBLOB, "Dump binary strings (BINARY, "
"VARBINARY, BLOB) in hexadecimal format.",
- (gptr*) &opt_hex_blob, (gptr*) &opt_hex_blob, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"host", 'h', "Connect to host.", (gptr*) &current_host,
- (gptr*) &current_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ (uchar**) &opt_hex_blob, (uchar**) &opt_hex_blob, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"host", 'h', "Connect to host.", (uchar**) &current_host,
+ (uchar**) &current_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"ignore-table", OPT_IGNORE_TABLE,
"Do not dump the specified table. To specify more than one table to ignore, "
"use the directive multiple times, once for each table. Each table must "
"be specified with both database and table names, e.g. --ignore-table=database.table",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"insert-ignore", OPT_INSERT_IGNORE, "Insert rows with INSERT IGNORE.",
- (gptr*) &opt_ignore, (gptr*) &opt_ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+ (uchar**) &opt_ignore, (uchar**) &opt_ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"lines-terminated-by", OPT_LTB, "Lines in the i.file are terminated by ...",
- (gptr*) &lines_terminated, (gptr*) &lines_terminated, 0, GET_STR,
+ (uchar**) &lines_terminated, (uchar**) &lines_terminated, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"lock-all-tables", 'x', "Locks all tables across all databases. This "
"is achieved by taking a global read lock for the duration of the whole "
"dump. Automatically turns --single-transaction and --lock-tables off.",
- (gptr*) &opt_lock_all_tables, (gptr*) &opt_lock_all_tables, 0, GET_BOOL, NO_ARG,
+ (uchar**) &opt_lock_all_tables, (uchar**) &opt_lock_all_tables, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
- {"lock-tables", 'l', "Lock all tables for read.", (gptr*) &lock_tables,
- (gptr*) &lock_tables, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+ {"lock-tables", 'l', "Lock all tables for read.", (uchar**) &lock_tables,
+ (uchar**) &lock_tables, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"log-error", OPT_ERROR_LOG_FILE, "Append warnings and errors to given file.",
- (gptr*) &log_error_file, (gptr*) &log_error_file, 0, GET_STR,
+ (uchar**) &log_error_file, (uchar**) &log_error_file, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"master-data", OPT_MASTER_DATA,
"This causes the binary log position and filename to be appended to the "
@@ -336,29 +341,29 @@ static struct my_option my_long_options[] =
"- don't forget to read about --single-transaction below). In all cases "
"any action on logs will happen at the exact moment of the dump."
"Option automatically turns --lock-tables off.",
- (gptr*) &opt_master_data, (gptr*) &opt_master_data, 0,
+ (uchar**) &opt_master_data, (uchar**) &opt_master_data, 0,
GET_UINT, OPT_ARG, 0, 0, MYSQL_OPT_MASTER_DATA_COMMENTED_SQL, 0, 0, 0},
{"max_allowed_packet", OPT_MAX_ALLOWED_PACKET, "",
- (gptr*) &opt_max_allowed_packet, (gptr*) &opt_max_allowed_packet, 0,
+ (uchar**) &opt_max_allowed_packet, (uchar**) &opt_max_allowed_packet, 0,
GET_ULONG, REQUIRED_ARG, 24*1024*1024, 4096,
(longlong) 2L*1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0},
{"net_buffer_length", OPT_NET_BUFFER_LENGTH, "",
- (gptr*) &opt_net_buffer_length, (gptr*) &opt_net_buffer_length, 0,
+ (uchar**) &opt_net_buffer_length, (uchar**) &opt_net_buffer_length, 0,
GET_ULONG, REQUIRED_ARG, 1024*1024L-1025, 4096, 16*1024L*1024L,
MALLOC_OVERHEAD-1024, 1024, 0},
{"no-autocommit", OPT_AUTOCOMMIT,
"Wrap tables with autocommit/commit statements.",
- (gptr*) &opt_autocommit, (gptr*) &opt_autocommit, 0, GET_BOOL, NO_ARG,
+ (uchar**) &opt_autocommit, (uchar**) &opt_autocommit, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
{"no-create-db", 'n',
"'CREATE DATABASE /*!32312 IF NOT EXISTS*/ db_name;' will not be put in the output. The above line will be added otherwise, if --databases or --all-databases option was given.}.",
- (gptr*) &opt_create_db, (gptr*) &opt_create_db, 0, GET_BOOL, NO_ARG, 0, 0,
+ (uchar**) &opt_create_db, (uchar**) &opt_create_db, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0},
{"no-create-info", 't', "Don't write table creation info.",
- (gptr*) &opt_no_create_info, (gptr*) &opt_no_create_info, 0, GET_BOOL,
+ (uchar**) &opt_no_create_info, (uchar**) &opt_no_create_info, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
- {"no-data", 'd', "No row information.", (gptr*) &opt_no_data,
- (gptr*) &opt_no_data, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"no-data", 'd', "No row information.", (uchar**) &opt_no_data,
+ (uchar**) &opt_no_data, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"no-set-names", 'N',
"Deprecated. Use --skip-set-charset instead.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -367,7 +372,7 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"order-by-primary", OPT_ORDER_BY_PRIMARY,
"Sorts each table's rows by primary key, or first unique key, if such a key exists. Useful when dumping a MyISAM table to be loaded into an InnoDB table, but will make the dump itself take considerably longer.",
- (gptr*) &opt_order_by_primary, (gptr*) &opt_order_by_primary, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ (uchar**) &opt_order_by_primary, (uchar**) &opt_order_by_primary, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"password", 'p',
"Password to use when connecting to server. If password is not given it's solicited on the tty.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
@@ -375,35 +380,35 @@ static struct my_option my_long_options[] =
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port,
- (gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
+ {"port", 'P', "Port number to use for connection.", (uchar**) &opt_mysql_port,
+ (uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
0},
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"quick", 'q', "Don't buffer query, dump directly to stdout.",
- (gptr*) &quick, (gptr*) &quick, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+ (uchar**) &quick, (uchar**) &quick, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"quote-names",'Q', "Quote table and column names with backticks (`).",
- (gptr*) &opt_quoted, (gptr*) &opt_quoted, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
+ (uchar**) &opt_quoted, (uchar**) &opt_quoted, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
0, 0},
{"replace", OPT_MYSQL_REPLACE_INTO, "Use REPLACE INTO instead of INSERT INTO.",
- (gptr*) &opt_replace_into, (gptr*) &opt_replace_into, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+ (uchar**) &opt_replace_into, (uchar**) &opt_replace_into, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"result-file", 'r',
"Direct output to a given file. This option should be used in MSDOS, because it prevents new line '\\n' from being converted to '\\r\\n' (carriage return + line feed).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"routines", 'R', "Dump stored routines (functions and procedures).",
- (gptr*) &opt_routines, (gptr*) &opt_routines, 0, GET_BOOL,
+ (uchar**) &opt_routines, (uchar**) &opt_routines, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"set-charset", OPT_SET_CHARSET,
"Add 'SET NAMES default_character_set' to the output. Enabled by default; suppress with --skip-set-charset.",
- (gptr*) &opt_set_charset, (gptr*) &opt_set_charset, 0, GET_BOOL, NO_ARG, 1,
+ (uchar**) &opt_set_charset, (uchar**) &opt_set_charset, 0, GET_BOOL, NO_ARG, 1,
0, 0, 0, 0, 0},
{"set-variable", 'O',
"Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
- "Base name of shared memory.", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
+ "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
/*
@@ -417,37 +422,37 @@ static struct my_option my_long_options[] =
"support multiversioning (currently only InnoDB does); the dump is NOT "
"guaranteed to be consistent for other storage engines. Option "
"automatically turns off --lock-tables.",
- (gptr*) &opt_single_transaction, (gptr*) &opt_single_transaction, 0,
+ (uchar**) &opt_single_transaction, (uchar**) &opt_single_transaction, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"skip-opt", OPT_SKIP_OPTIMIZATION,
"Disable --opt. Disables --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"socket", 'S', "Socket file to use for connection.",
- (gptr*) &opt_mysql_unix_port, (gptr*) &opt_mysql_unix_port, 0, GET_STR,
+ (uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#include <sslopt-longopts.h>
{"tab",'T',
"Creates tab separated textfile for each table to given path. (creates .sql and .txt files). NOTE: This only works if mysqldump is run on the same machine as the mysqld daemon.",
- (gptr*) &path, (gptr*) &path, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ (uchar**) &path, (uchar**) &path, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"tables", OPT_TABLES, "Overrides option --databases (-B).",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"triggers", OPT_TRIGGERS, "Dump triggers for each dumped table",
- (gptr*) &opt_dump_triggers, (gptr*) &opt_dump_triggers, 0, GET_BOOL,
+ (uchar**) &opt_dump_triggers, (uchar**) &opt_dump_triggers, 0, GET_BOOL,
NO_ARG, 1, 0, 0, 0, 0, 0},
{"tz-utc", OPT_TZ_UTC,
"SET TIME_ZONE='+00:00' at top of dump to allow dumping of TIMESTAMP data when a server has data in different time zones or data is being moved between servers with different time zones.",
- (gptr*) &opt_tz_utc, (gptr*) &opt_tz_utc, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+ (uchar**) &opt_tz_utc, (uchar**) &opt_tz_utc, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
#ifndef DONT_ALLOW_USER_CHANGE
{"user", 'u', "User for login if not current user.",
- (gptr*) &current_user, (gptr*) &current_user, 0, GET_STR, REQUIRED_ARG,
+ (uchar**) &current_user, (uchar**) &current_user, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
#endif
{"verbose", 'v', "Print info about the various stages.",
- (gptr*) &verbose, (gptr*) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ (uchar**) &verbose, (uchar**) &verbose, 0, GET_BOOL, NO_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},
{"where", 'w', "Dump only selected records; QUOTES mandatory!",
- (gptr*) &where, (gptr*) &where, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ (uchar**) &where, (uchar**) &where, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"xml", 'X', "Dump a database as well formed XML.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
@@ -655,18 +660,18 @@ static void write_footer(FILE *sql_file)
}
} /* write_footer */
-static void free_table_ent(char *key)
+static void free_table_ent(char *key)
{
- my_free((gptr) key, MYF(0));
+ my_free(key, MYF(0));
}
-byte* get_table_key(const char *entry, uint *length,
- my_bool not_used __attribute__((unused)))
+uchar* get_table_key(const char *entry, size_t *length,
+ my_bool not_used __attribute__((unused)))
{
*length= strlen(entry);
- return (byte*) entry;
+ return (uchar*) entry;
}
@@ -709,10 +714,22 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
case 'T':
opt_disable_keys=0;
+
+ if (strlen(argument) >= FN_REFLEN)
+ {
+ /*
+ This check is made because the some the file functions below
+ have FN_REFLEN sized stack allocated buffers and will cause
+ a crash even if the input destination buffer is large enough
+ to hold the output.
+ */
+ die(EX_USAGE, "Input filename too long: %s", argument);
+ }
+
break;
case '#':
DBUG_PUSH(argument ? argument : default_dbug_option);
- info_flag= 1;
+ debug_check_flag= 1;
break;
#include <sslopt-case.h>
case 'V': print_version(); exit(0);
@@ -753,7 +770,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
fprintf(stderr, "Illegal use of option --ignore-table=<database>.<table>\n");
exit(1);
}
- if (my_hash_insert(&ignore_table, (byte*)my_strdup(argument, MYF(0))))
+ if (my_hash_insert(&ignore_table, (uchar*)my_strdup(argument, MYF(0))))
exit(EX_EOM);
break;
}
@@ -832,13 +849,13 @@ static int get_options(int *argc, char ***argv)
return(EX_EOM);
/* Don't copy internal log tables */
if (my_hash_insert(&ignore_table,
- (byte*) my_strdup("mysql.apply_status", MYF(MY_WME))) ||
+ (uchar*) my_strdup("mysql.apply_status", MYF(MY_WME))) ||
my_hash_insert(&ignore_table,
- (byte*) my_strdup("mysql.schema", MYF(MY_WME))) ||
+ (uchar*) my_strdup("mysql.schema", MYF(MY_WME))) ||
my_hash_insert(&ignore_table,
- (byte*) my_strdup("mysql.general_log", MYF(MY_WME))) ||
+ (uchar*) my_strdup("mysql.general_log", MYF(MY_WME))) ||
my_hash_insert(&ignore_table,
- (byte*) my_strdup("mysql.slow_log", MYF(MY_WME))))
+ (uchar*) my_strdup("mysql.slow_log", MYF(MY_WME))))
return(EX_EOM);
if ((ho_error= handle_options(argc, argv, my_long_options, get_one_option)))
@@ -846,6 +863,10 @@ static int get_options(int *argc, char ***argv)
*mysql_params->p_max_allowed_packet= opt_max_allowed_packet;
*mysql_params->p_net_buffer_length= opt_net_buffer_length;
+ if (debug_info_flag)
+ my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO;
+ if (debug_check_flag)
+ my_end_arg= MY_CHECK_ERROR;
if (opt_delayed)
opt_lock=0; /* Can't have lock with delayed */
@@ -1002,6 +1023,338 @@ static int mysql_query_with_error_report(MYSQL *mysql_con, MYSQL_RES **res,
return 0;
}
+
+static int fetch_db_collation(const char *db_name,
+ char *db_cl_name,
+ int db_cl_size)
+{
+ bool err_status= FALSE;
+ char query[QUERY_LENGTH];
+ MYSQL_RES *db_cl_res;
+ MYSQL_ROW db_cl_row;
+
+ my_snprintf(query, sizeof (query), "use %s", db_name);
+
+ if (mysql_query_with_error_report(mysql, NULL, query))
+ return 1;
+
+ if (mysql_query_with_error_report(mysql, &db_cl_res,
+ "select @@collation_database"))
+ return 1;
+
+ do
+ {
+ if (mysql_num_rows(db_cl_res) != 1)
+ {
+ err_status= TRUE;
+ break;
+ }
+
+ if (!(db_cl_row= mysql_fetch_row(db_cl_res)))
+ {
+ err_status= TRUE;
+ break;
+ }
+
+ strncpy(db_cl_name, db_cl_row[0], db_cl_size);
+ db_cl_name[db_cl_size - 1]= 0; /* just in case. */
+
+ } while (FALSE);
+
+ mysql_free_result(db_cl_res);
+
+ return err_status ? 1 : 0;
+}
+
+
+static char *my_case_str(const char *str,
+ uint str_len,
+ const char *token,
+ uint token_len)
+{
+ my_match_t match;
+
+ uint status= my_charset_latin1.coll->instr(&my_charset_latin1,
+ str, str_len,
+ token, token_len,
+ &match, 1);
+
+ return status ? (char *) str + match.end : NULL;
+}
+
+
+static int switch_db_collation(FILE *sql_file,
+ const char *db_name,
+ const char *delimiter,
+ const char *current_db_cl_name,
+ const char *required_db_cl_name,
+ int *db_cl_altered)
+{
+ if (strcmp(current_db_cl_name, required_db_cl_name) != 0)
+ {
+ CHARSET_INFO *db_cl= get_charset_by_name(required_db_cl_name, MYF(0));
+
+ if (!db_cl)
+ return 1;
+
+ fprintf(sql_file,
+ "ALTER DATABASE %s CHARACTER SET %s COLLATE %s %s\n",
+ (const char *) db_name,
+ (const char *) db_cl->csname,
+ (const char *) db_cl->name,
+ (const char *) delimiter);
+
+ *db_cl_altered= 1;
+
+ return 0;
+ }
+
+ *db_cl_altered= 0;
+
+ return 0;
+}
+
+
+static int restore_db_collation(FILE *sql_file,
+ const char *db_name,
+ const char *delimiter,
+ const char *db_cl_name)
+{
+ CHARSET_INFO *db_cl= get_charset_by_name(db_cl_name, MYF(0));
+
+ if (!db_cl)
+ return 1;
+
+ fprintf(sql_file,
+ "ALTER DATABASE %s CHARACTER SET %s COLLATE %s %s\n",
+ (const char *) db_name,
+ (const char *) db_cl->csname,
+ (const char *) db_cl->name,
+ (const char *) delimiter);
+
+ return 0;
+}
+
+
+static void switch_cs_variables(FILE *sql_file,
+ const char *delimiter,
+ const char *character_set_client,
+ const char *character_set_results,
+ const char *collation_connection)
+{
+ fprintf(sql_file,
+ "/*!50003 SET @saved_cs_client = @@character_set_client */ %s\n"
+ "/*!50003 SET @saved_cs_results = @@character_set_results */ %s\n"
+ "/*!50003 SET @saved_col_connection = @@collation_connection */ %s\n"
+ "/*!50003 SET character_set_client = %s */ %s\n"
+ "/*!50003 SET character_set_results = %s */ %s\n"
+ "/*!50003 SET collation_connection = %s */ %s\n",
+ (const char *) delimiter,
+ (const char *) delimiter,
+ (const char *) delimiter,
+
+ (const char *) character_set_client,
+ (const char *) delimiter,
+
+ (const char *) character_set_results,
+ (const char *) delimiter,
+
+ (const char *) collation_connection,
+ (const char *) delimiter);
+}
+
+
+static void restore_cs_variables(FILE *sql_file,
+ const char *delimiter)
+{
+ fprintf(sql_file,
+ "/*!50003 SET character_set_client = @saved_cs_client */ %s\n"
+ "/*!50003 SET character_set_results = @saved_cs_results */ %s\n"
+ "/*!50003 SET collation_connection = @saved_col_connection */ %s\n",
+ (const char *) delimiter,
+ (const char *) delimiter,
+ (const char *) delimiter);
+}
+
+
+static void switch_sql_mode(FILE *sql_file,
+ const char *delimiter,
+ const char *sql_mode)
+{
+ fprintf(sql_file,
+ "/*!50003 SET @saved_sql_mode = @@sql_mode */ %s\n"
+ "/*!50003 SET sql_mode = '%s' */ %s\n",
+ (const char *) delimiter,
+
+ (const char *) sql_mode,
+ (const char *) delimiter);
+}
+
+
+static void restore_sql_mode(FILE *sql_file,
+ const char *delimiter)
+{
+ fprintf(sql_file,
+ "/*!50003 SET sql_mode = @saved_sql_mode */ %s\n",
+ (const char *) delimiter);
+}
+
+
+static void switch_time_zone(FILE *sql_file,
+ const char *delimiter,
+ const char *time_zone)
+{
+ fprintf(sql_file,
+ "/*!50003 SET @saved_time_zone = @@time_zone */ %s\n"
+ "/*!50003 SET time_zone = '%s' */ %s\n",
+ (const char *) delimiter,
+
+ (const char *) time_zone,
+ (const char *) delimiter);
+}
+
+
+static void restore_time_zone(FILE *sql_file,
+ const char *delimiter)
+{
+ fprintf(sql_file,
+ "/*!50003 SET time_zone = @saved_time_zone */ %s\n",
+ (const char *) delimiter);
+}
+
+
+static int switch_character_set_results(MYSQL *mysql, const char *cs_name)
+{
+ char query_buffer[QUERY_LENGTH];
+ size_t query_length;
+
+ query_length= my_snprintf(query_buffer,
+ sizeof (query_buffer),
+ "SET SESSION character_set_results = '%s'",
+ (const char *) cs_name);
+
+ return mysql_real_query(mysql, query_buffer, query_length);
+}
+
+/**
+ Rewrite CREATE TRIGGER 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:
+ 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.
+
+ @return pointer to the new allocated query string.
+*/
+
+static char *cover_definer_clause_in_sp(const char *def_str,
+ uint def_str_length)
+{
+ char *query_str= NULL;
+ char *definer_begin= my_case_str(def_str, def_str_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(" PROCEDURE"));
+
+ if (!definer_end)
+ {
+ definer_end= my_case_str(definer_begin, strlen(definer_begin),
+ C_STRING_WITH_LEN(" FUNCTION"));
+ }
+
+ 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(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);
+ }
+
+ return query_str;
+}
+
/*
Open a new .sql file to dump the table or view into
@@ -1037,7 +1390,7 @@ static void free_resources()
dynstr_free(&insert_pat);
if (defaults_argv)
free_defaults(defaults_argv);
- my_end(info_flag ? MY_CHECK_ERROR : 0);
+ my_end(my_end_arg);
}
@@ -1470,10 +1823,14 @@ static uint dump_events_for_db(char *db)
char query_buff[QUERY_LENGTH];
char db_name_buff[NAME_LEN*2+3], name_buff[NAME_LEN*2+3];
char *event_name;
- char delimiter[QUERY_LENGTH], *delimit_test;
+ char delimiter[QUERY_LENGTH];
FILE *sql_file= md_result_file;
MYSQL_RES *event_res, *event_list_res;
MYSQL_ROW row, event_list_row;
+
+ char db_cl_name[MY_CS_NAME_SIZE];
+ int db_cl_altered= FALSE;
+
DBUG_ENTER("dump_events_for_db");
DBUG_PRINT("enter", ("db: '%s'", db));
@@ -1498,6 +1855,14 @@ static uint dump_events_for_db(char *db)
{
fprintf(sql_file, "/*!50106 SET @save_time_zone= @@TIME_ZONE */ ;\n");
+ /* Get database collation. */
+
+ if (fetch_db_collation(db_name_buff, db_cl_name, sizeof (db_cl_name)))
+ DBUG_RETURN(1);
+
+ if (switch_character_set_results(mysql, "binary"))
+ DBUG_RETURN(1);
+
while ((event_list_row= mysql_fetch_row(event_list_res)) != NULL)
{
event_name= quote_name(event_list_row[1], name_buff, 0);
@@ -1520,17 +1885,69 @@ static uint dump_events_for_db(char *db)
fprintf(sql_file, "/*!50106 DROP EVENT IF EXISTS %s */%s\n",
event_name, delimiter);
- delimit_test= create_delimiter(row[3], delimiter, sizeof(delimiter));
- if (delimit_test == NULL) {
- fprintf(stderr, "%s: Warning: Can't dump event '%s'\n",
- event_name, my_progname);
+ if (create_delimiter(row[3], delimiter, sizeof(delimiter)) == NULL)
+ {
+ fprintf(stderr, "%s: Warning: Can't create delimiter for event '%s'\n",
+ event_name, my_progname);
DBUG_RETURN(1);
}
fprintf(sql_file, "DELIMITER %s\n", delimiter);
- fprintf(sql_file, "/*!50106 SET TIME_ZONE= '%s' */ %s\n",
- row[2], delimiter);
- fprintf(sql_file, "/*!50106 %s */ %s\n", row[3], delimiter);
+
+ if (mysql_num_fields(event_res) >= 7)
+ {
+ if (switch_db_collation(sql_file, db_name_buff, delimiter,
+ db_cl_name, row[6], &db_cl_altered))
+ {
+ DBUG_RETURN(1);
+ }
+
+ switch_cs_variables(sql_file, delimiter,
+ row[4], /* character_set_client */
+ 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.
+
+ 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");
+ }
+
+ switch_sql_mode(sql_file, delimiter, row[1]);
+
+ switch_time_zone(sql_file, delimiter, row[2]);
+
+ fprintf(sql_file,
+ "/*!50106 %s */ %s\n",
+ (const char *) row[3],
+ (const char *) delimiter);
+
+ restore_time_zone(sql_file, delimiter);
+ restore_sql_mode(sql_file, delimiter);
+
+ if (mysql_num_fields(event_res) >= 7)
+ {
+ restore_cs_variables(sql_file, delimiter);
+
+ if (db_cl_altered)
+ {
+ if (restore_db_collation(sql_file, db_name_buff, delimiter,
+ db_cl_name))
+ DBUG_RETURN(1);
+ }
+ }
}
} /* end of event printing */
mysql_free_result(event_res);
@@ -1538,6 +1955,9 @@ static uint dump_events_for_db(char *db)
} /* end of list of events */
fprintf(sql_file, "DELIMITER ;\n");
fprintf(sql_file, "/*!50106 SET TIME_ZONE= @save_time_zone */ ;\n");
+
+ if (switch_character_set_results(mysql, default_charset))
+ DBUG_RETURN(1);
}
mysql_free_result(event_list_res);
@@ -1592,6 +2012,10 @@ static uint dump_routines_for_db(char *db)
FILE *sql_file= md_result_file;
MYSQL_RES *routine_res, *routine_list_res;
MYSQL_ROW row, routine_list_row;
+
+ char db_cl_name[MY_CS_NAME_SIZE];
+ int db_cl_altered= FALSE;
+
DBUG_ENTER("dump_routines_for_db");
DBUG_PRINT("enter", ("db: '%s'", db));
@@ -1608,7 +2032,13 @@ static uint dump_routines_for_db(char *db)
if (lock_tables)
mysql_query(mysql, "LOCK TABLES mysql.proc READ");
- fprintf(sql_file, "DELIMITER ;;\n");
+ /* Get database collation. */
+
+ if (fetch_db_collation(db_name_buff, db_cl_name, sizeof (db_cl_name)))
+ DBUG_RETURN(1);
+
+ if (switch_character_set_results(mysql, "binary"))
+ DBUG_RETURN(1);
/* 0, retrieve and dump functions, 1, procedures */
for (i= 0; i <= 1; i++)
@@ -1651,63 +2081,67 @@ static uint dump_routines_for_db(char *db)
}
else if (strlen(row[2]))
{
- char *query_str= NULL;
- char *definer_begin;
-
+ char *query_str;
if (opt_drop)
- fprintf(sql_file, "/*!50003 DROP %s IF EXISTS %s */;;\n",
+ fprintf(sql_file, "/*!50003 DROP %s IF EXISTS %s */;\n",
routine_type[i], routine_name);
- /*
- Cover DEFINER-clause in version-specific comments.
+ query_str= cover_definer_clause_in_sp(row[2], strlen(row[2]));
- TODO: this is definitely a BAD IDEA to parse SHOW CREATE output.
- We should user INFORMATION_SCHEMA instead. The only problem is
- that now INFORMATION_SCHEMA does not provide information about
- routine parameters.
- */
-
- definer_begin= strstr(row[2], " DEFINER");
+ if (mysql_num_fields(routine_res) >= 6)
+ {
+ if (switch_db_collation(sql_file, db_name_buff, ";",
+ db_cl_name, row[5], &db_cl_altered))
+ {
+ DBUG_RETURN(1);
+ }
- if (definer_begin)
+ switch_cs_variables(sql_file, ";",
+ row[3], /* character_set_client */
+ row[3], /* character_set_results */
+ row[4]); /* collation_connection */
+ }
+ else
{
- char *definer_end= strstr(definer_begin, " PROCEDURE");
+ /*
+ 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 stored
+ procedure/function properly.
+ */
+
+ fprintf(sql_file,
+ "--\n"
+ "-- WARNING: old server version. "
+ "The following dump may be incomplete.\n"
+ "--\n");
+ }
- if (!definer_end)
- definer_end= strstr(definer_begin, " FUNCTION");
- if (definer_end)
- {
- char *query_str_tail;
+ switch_sql_mode(sql_file, ";", row[1]);
- /*
- Allocate memory for new query string: original string
- from SHOW statement and version-specific comments.
- */
- query_str= alloc_query_str(strlen(row[2]) + 23);
-
- query_str_tail= strnmov(query_str, row[2],
- definer_begin - row[2]);
- 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);
+ fprintf(sql_file,
+ "DELIMITER ;;\n"
+ "/*!50003 %s */;;\n"
+ "DELIMITER ;\n",
+ (const char *) (query_str != NULL ? query_str : row[2]));
+
+ restore_sql_mode(sql_file, ";");
+
+ if (mysql_num_fields(routine_res) >= 6)
+ {
+ restore_cs_variables(sql_file, ";");
+
+ if (db_cl_altered)
+ {
+ if (restore_db_collation(sql_file, db_name_buff, ";", db_cl_name))
+ DBUG_RETURN(1);
}
}
- /*
- we need to change sql_mode only for the CREATE
- PROCEDURE/FUNCTION otherwise we may need to re-quote routine_name
- */
- fprintf(sql_file, "/*!50003 SET SESSION SQL_MODE=\"%s\"*/;;\n",
- row[1] /* sql_mode */);
- fprintf(sql_file, "/*!50003 %s */;;\n",
- (query_str != NULL ? query_str : row[2]));
- fprintf(sql_file,
- "/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/"
- ";;\n");
-
my_free(query_str, MYF(MY_ALLOW_ZERO_PTR));
}
} /* end of routine printing */
@@ -1717,8 +2151,9 @@ static uint dump_routines_for_db(char *db)
}
mysql_free_result(routine_list_res);
} /* end of for i (0 .. 1) */
- /* set the delimiter back to ';' */
- fprintf(sql_file, "DELIMITER ;\n");
+
+ if (switch_character_set_results(mysql, default_charset))
+ DBUG_RETURN(1);
if (lock_tables)
VOID(mysql_query_with_error_report(mysql, 0, "UNLOCK TABLES"));
@@ -1753,7 +2188,6 @@ static uint get_table_structure(char *table, char *db, char *table_type,
int len;
MYSQL_RES *result;
MYSQL_ROW row;
-
DBUG_ENTER("get_table_structure");
DBUG_PRINT("enter", ("db: %s table: %s", db, table));
@@ -1808,7 +2242,10 @@ static uint get_table_structure(char *table, char *db, char *table_type,
MYSQL_FIELD *field;
my_snprintf(buff, sizeof(buff), "show create table %s", result_table);
- if (mysql_query_with_error_report(mysql, 0, buff))
+
+ if (switch_character_set_results(mysql, "binary") ||
+ mysql_query_with_error_report(mysql, &result, buff) ||
+ switch_character_set_results(mysql, default_charset))
DBUG_RETURN(0);
if (path)
@@ -1839,7 +2276,6 @@ static uint get_table_structure(char *table, char *db, char *table_type,
check_io(sql_file);
}
- result= mysql_store_result(mysql);
field= mysql_fetch_field_direct(result, 0);
if (strcmp(field->name, "View") == 0)
{
@@ -1866,7 +2302,9 @@ static uint get_table_structure(char *table, char *db, char *table_type,
*/
my_snprintf(query_buff, sizeof(query_buff),
"SHOW FIELDS FROM %s", result_table);
- if (mysql_query_with_error_report(mysql, 0, query_buff))
+ if (switch_character_set_results(mysql, "binary") ||
+ mysql_query_with_error_report(mysql, &result, query_buff) ||
+ switch_character_set_results(mysql, default_charset))
{
/*
View references invalid or privileged table/col/fun (err 1356),
@@ -1884,43 +2322,50 @@ static uint get_table_structure(char *table, char *db, char *table_type,
else
my_free(scv_buff, MYF(MY_ALLOW_ZERO_PTR));
- if ((result= mysql_store_result(mysql)))
+ if (mysql_num_rows(result))
{
- if (mysql_num_rows(result))
+ if (opt_drop)
{
- if (opt_drop)
- {
/*
- We have already dropped any table of the same name
- above, so here we just drop the view.
- */
+ We have already dropped any table of the same name above, so
+ here we just drop the view.
+ */
- fprintf(sql_file, "/*!50001 DROP VIEW IF EXISTS %s*/;\n",
- opt_quoted_table);
- check_io(sql_file);
- }
+ fprintf(sql_file, "/*!50001 DROP VIEW IF EXISTS %s*/;\n",
+ opt_quoted_table);
+ check_io(sql_file);
+ }
- fprintf(sql_file, "/*!50001 CREATE TABLE %s (\n", result_table);
- /*
- Get first row, following loop will prepend comma - keeps
- from having to know if the row being printed is last to
- determine if there should be a _trailing_ comma.
- */
- row= mysql_fetch_row(result);
+ fprintf(sql_file,
+ "SET @saved_cs_client = @@character_set_client;\n"
+ "SET character_set_client = utf8;\n"
+ "/*!50001 CREATE TABLE %s (\n",
+ result_table);
- fprintf(sql_file, " %s %s", quote_name(row[0], name_buff, 0),
- row[1]);
+ /*
+ Get first row, following loop will prepend comma - keeps from
+ having to know if the row being printed is last to determine if
+ there should be a _trailing_ comma.
+ */
- while((row= mysql_fetch_row(result)))
- {
- /* col name, col type */
- fprintf(sql_file, ",\n %s %s",
- quote_name(row[0], name_buff, 0), row[1]);
- }
- fprintf(sql_file, "\n) */;\n");
- check_io(sql_file);
+ row= mysql_fetch_row(result);
+
+ fprintf(sql_file, " %s %s", quote_name(row[0], name_buff, 0),
+ row[1]);
+
+ while((row= mysql_fetch_row(result)))
+ {
+ /* col name, col type */
+ fprintf(sql_file, ",\n %s %s",
+ quote_name(row[0], name_buff, 0), row[1]);
}
+ fprintf(sql_file,
+ "\n) */;\n"
+ "SET character_set_client = @saved_cs_client;\n");
+
+ check_io(sql_file);
}
+
mysql_free_result(result);
if (path)
@@ -1931,7 +2376,14 @@ static uint get_table_structure(char *table, char *db, char *table_type,
}
row= mysql_fetch_row(result);
- fprintf(sql_file, "%s;\n", row[1]);
+
+ fprintf(sql_file,
+ "SET @saved_cs_client = @@character_set_client;\n"
+ "SET character_set_client = utf8;\n"
+ "%s;\n"
+ "SET character_set_client = @saved_cs_client;\n",
+ row[1]);
+
check_io(sql_file);
mysql_free_result(result);
}
@@ -2155,6 +2607,7 @@ static uint get_table_structure(char *table, char *db, char *table_type,
fprintf(sql_file, " (%s)",row[7]); /* Sub key */
check_io(sql_file);
}
+ mysql_free_result(result);
if (!opt_xml)
{
if (keynr)
@@ -2225,98 +2678,219 @@ continue_xml:
DBUG_RETURN((uint) num_fields);
} /* get_table_structure */
+static void dump_trigger_old(MYSQL_RES *show_triggers_rs,
+ MYSQL_ROW *show_trigger_row,
+ const char *table_name)
+{
+ FILE *sql_file= md_result_file;
-/*
+ char quoted_table_name_buf[NAME_LEN * 2 + 3];
+ char *quoted_table_name= quote_name(table_name, quoted_table_name_buf, 1);
+
+ char name_buff[NAME_LEN * 4 + 3];
+
+ DBUG_ENTER("dump_trigger_old");
+
+ fprintf(sql_file,
+ "--\n"
+ "-- WARNING: old server version. "
+ "The following dump may be incomplete.\n"
+ "--\n");
+
+ if (opt_compact)
+ fprintf(sql_file, "/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;\n");
+
+ fprintf(sql_file,
+ "DELIMITER ;;\n"
+ "/*!50003 SET SESSION SQL_MODE=\"%s\" */;;\n"
+ "/*!50003 CREATE */ ",
+ (*show_trigger_row)[6]);
+
+ if (mysql_num_fields(show_triggers_rs) > 7)
+ {
+ /*
+ mysqldump can be run against the server, that does not support
+ definer in triggers (there is no DEFINER column in SHOW TRIGGERS
+ output). So, we should check if we have this column before
+ accessing it.
+ */
+
+ size_t user_name_len;
+ char user_name_str[USERNAME_LENGTH + 1];
+ char quoted_user_name_str[USERNAME_LENGTH * 2 + 3];
+ size_t host_name_len;
+ char host_name_str[HOSTNAME_LENGTH + 1];
+ char quoted_host_name_str[HOSTNAME_LENGTH * 2 + 3];
+
+ parse_user((*show_trigger_row)[7],
+ strlen((*show_trigger_row)[7]),
+ user_name_str, &user_name_len,
+ host_name_str, &host_name_len);
+
+ fprintf(sql_file,
+ "/*!50017 DEFINER=%s@%s */ ",
+ quote_name(user_name_str, quoted_user_name_str, FALSE),
+ quote_name(host_name_str, quoted_host_name_str, FALSE));
+ }
+
+ fprintf(sql_file,
+ "/*!50003 TRIGGER %s %s %s ON %s FOR EACH ROW%s%s */;;\n"
+ "DELIMITER ;\n",
+ quote_name((*show_trigger_row)[0], name_buff, 0), /* Trigger */
+ (*show_trigger_row)[4], /* Timing */
+ (*show_trigger_row)[1], /* Event */
+ quoted_table_name,
+ (strchr(" \t\n\r", *((*show_trigger_row)[3]))) ? "" : " ",
+ (*show_trigger_row)[3] /* Statement */);
+
+ if (opt_compact)
+ fprintf(sql_file, "/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */;\n");
+
+ DBUG_VOID_RETURN;
+}
+
+static int dump_trigger(MYSQL_RES *show_create_trigger_rs,
+ const char *db_name,
+ const char *db_cl_name)
+{
+ FILE *sql_file= md_result_file;
+ MYSQL_ROW row;
+ int db_cl_altered= FALSE;
+
+ DBUG_ENTER("dump_trigger");
+
+ while ((row= mysql_fetch_row(show_create_trigger_rs)))
+ {
+ char *query_str= cover_definer_clause_in_trigger(row[2], strlen(row[2]));
+
+
+ if (switch_db_collation(sql_file, db_name, ";",
+ db_cl_name, row[5], &db_cl_altered))
+ DBUG_RETURN(TRUE);
+
+ switch_cs_variables(sql_file, ";",
+ row[3], /* character_set_client */
+ row[3], /* character_set_results */
+ row[4]); /* collation_connection */
+
+ switch_sql_mode(sql_file, ";", row[1]);
+
+ fprintf(sql_file,
+ "DELIMITER ;;\n"
+ "/*!50003 %s */;;\n"
+ "DELIMITER ;\n",
+ (const char *) (query_str != NULL ? query_str : row[2]));
+
+ restore_sql_mode(sql_file, ";");
+ restore_cs_variables(sql_file, ";");
+
+ if (db_cl_altered)
+ {
+ if (restore_db_collation(sql_file, db_name, ";", db_cl_name))
+ DBUG_RETURN(TRUE);
+ }
+
+ my_free(query_str, MYF(MY_ALLOW_ZERO_PTR));
+ }
- dump_triggers_for_table
+ DBUG_RETURN(FALSE);
+}
+
+/**
+ Dump the triggers for a given table.
- Dumps the triggers given a table/db name. This should be called after
- the tables have been dumped in case a trigger depends on the existence
- of a table
+ This should be called after the tables have been dumped in case a trigger
+ depends on the existence of a table.
+ @param[in] table_name
+ @param[in] db_name
+
+ @return Error status.
+ @retval TRUE error has occurred.
+ @retval FALSE operation succeed.
*/
-static void dump_triggers_for_table(char *table,
- char *db __attribute__((unused)))
+static int dump_triggers_for_table(char *table_name, char *db_name)
{
- char *result_table;
- char name_buff[NAME_LEN*4+3], table_buff[NAME_LEN*2+3];
+ char name_buff[NAME_LEN*4+3];
char query_buff[QUERY_LENGTH];
- uint old_opt_compatible_mode=opt_compatible_mode;
- FILE *sql_file= md_result_file;
- MYSQL_RES *result;
+ uint old_opt_compatible_mode= opt_compatible_mode;
+ MYSQL_RES *show_triggers_rs;
MYSQL_ROW row;
+
+ char db_cl_name[MY_CS_NAME_SIZE];
+
DBUG_ENTER("dump_triggers_for_table");
- DBUG_PRINT("enter", ("db: %s, table: %s", db, table));
+ DBUG_PRINT("enter", ("db: %s, table_name: %s", db_name, table_name));
/* Do not use ANSI_QUOTES on triggers in dump */
opt_compatible_mode&= ~MASK_ANSI_QUOTES;
- result_table= quote_name(table, table_buff, 1);
+
+ /* Get database collation. */
+
+ if (switch_character_set_results(mysql, "binary"))
+ DBUG_RETURN(TRUE);
+
+ if (fetch_db_collation(db_name, db_cl_name, sizeof (db_cl_name)))
+ DBUG_RETURN(TRUE);
+
+ /* Get list of triggers. */
my_snprintf(query_buff, sizeof(query_buff),
"SHOW TRIGGERS LIKE %s",
- quote_for_like(table, name_buff));
+ quote_for_like(table_name, name_buff));
- if (mysql_query_with_error_report(mysql, &result, query_buff))
- {
- if (path)
- my_fclose(sql_file, MYF(MY_WME));
- DBUG_VOID_RETURN;
- }
- if (mysql_num_rows(result))
- fprintf(sql_file, "\n/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;\n\
-DELIMITER ;;\n");
- while ((row= mysql_fetch_row(result)))
+ if (mysql_query_with_error_report(mysql, &show_triggers_rs, query_buff))
+ DBUG_RETURN(TRUE);
+
+ /* Dump triggers. */
+
+ while ((row= mysql_fetch_row(show_triggers_rs)))
{
- fprintf(sql_file,
- "/*!50003 SET SESSION SQL_MODE=\"%s\" */;;\n"
- "/*!50003 CREATE */ ",
- row[6] /* sql_mode */);
- if (mysql_num_fields(result) > 7)
+ my_snprintf(query_buff, sizeof (query_buff),
+ "SHOW CREATE TRIGGER %s",
+ quote_name(row[0], name_buff, TRUE));
+
+ if (mysql_query(mysql, query_buff))
{
/*
- mysqldump can be run against the server, that does not support definer
- in triggers (there is no DEFINER column in SHOW TRIGGERS output). So,
- we should check if we have this column before accessing it.
+ mysqldump is being run against old server, that does not support
+ SHOW CREATE TRIGGER statement. We should use SHOW TRIGGERS output.
+
+ NOTE: the dump may be incorrect, as old SHOW TRIGGERS does not
+ provide all the necessary information to restore trigger properly.
*/
- uint user_name_len;
- char user_name_str[USERNAME_LENGTH + 1];
- char quoted_user_name_str[USERNAME_LENGTH * 2 + 3];
- uint host_name_len;
- char host_name_str[HOSTNAME_LENGTH + 1];
- char quoted_host_name_str[HOSTNAME_LENGTH * 2 + 3];
+ dump_trigger_old(show_triggers_rs, &row, table_name);
+ }
+ else
+ {
+ MYSQL_RES *show_create_trigger_rs= mysql_store_result(mysql);
- parse_user(row[7], strlen(row[7]), user_name_str, &user_name_len,
- host_name_str, &host_name_len);
+ if (!show_create_trigger_rs ||
+ dump_trigger(show_create_trigger_rs, db_name, db_cl_name))
+ {
+ DBUG_RETURN(TRUE);
+ }
- fprintf(sql_file,
- "/*!50017 DEFINER=%s@%s */ ",
- quote_name(user_name_str, quoted_user_name_str, FALSE),
- quote_name(host_name_str, quoted_host_name_str, FALSE));
+ mysql_free_result(show_create_trigger_rs);
}
- fprintf(sql_file,
- "/*!50003 TRIGGER %s %s %s ON %s FOR EACH ROW%s%s */;;\n\n",
- quote_name(row[0], name_buff, 0), /* Trigger */
- row[4], /* Timing */
- row[1], /* Event */
- result_table,
- (strchr(" \t\n\r", *(row[3]))) ? "" : " ",
- row[3] /* Statement */);
}
- if (mysql_num_rows(result))
- fprintf(sql_file,
- "DELIMITER ;\n"
- "/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */;\n");
- mysql_free_result(result);
+
+ mysql_free_result(show_triggers_rs);
+
+ if (switch_character_set_results(mysql, default_charset))
+ DBUG_RETURN(TRUE);
+
/*
make sure to set back opt_compatible mode to
original value
*/
opt_compatible_mode=old_opt_compatible_mode;
- DBUG_VOID_RETURN;
+
+ DBUG_RETURN(FALSE);
}
static void add_load_option(DYNAMIC_STRING *str, const char *option,
@@ -2433,7 +3007,7 @@ static void dump_table(char *table, char *db)
/*
The "table" could be a view. If so, we don't do anything here.
*/
- if (strcmp (table_type, "VIEW") == 0)
+ if (strcmp(table_type, "VIEW") == 0)
DBUG_VOID_RETURN;
/* Check --no-data flag */
@@ -2465,6 +3039,18 @@ static void dump_table(char *table, char *db)
DBUG_VOID_RETURN;
}
+ /*
+ Check --skip-events flag: it is not enough to skip creation of events
+ discarding SHOW CREATE EVENT statements generation. The myslq.event
+ table data should be skipped too.
+ */
+ if (!opt_events && !my_strcasecmp(&my_charset_latin1, db, "mysql") &&
+ !my_strcasecmp(&my_charset_latin1, table, "event"))
+ {
+ verbose_msg("-- Skipping data table mysql.event, --skip-events was used\n");
+ DBUG_VOID_RETURN;
+ }
+
result_table= quote_name(table,table_buff, 1);
opt_quoted_table= quote_name(table, table_buff2, 0);
@@ -2476,17 +3062,6 @@ static void dump_table(char *table, char *db)
{
char filename[FN_REFLEN], tmp_path[FN_REFLEN];
- if (strlen(path) >= FN_REFLEN)
- {
- /*
- This check is made because the some the file functions below
- have FN_REFLEN sized stack allocated buffers and will cause
- a crash even if the input destination buffer is large enough
- to hold the output.
- */
- die(EX_USAGE, "Input filename or options too long: %s", path);
- }
-
/*
Convert the path to native os format
and resolve to the full filepath.
@@ -2534,6 +3109,7 @@ static void dump_table(char *table, char *db)
if (mysql_real_query(mysql, query_string.str, query_string.length))
{
DB_error(mysql, "when executing 'SELECT INTO OUTFILE'");
+ dynstr_free(&query_string);
DBUG_VOID_RETURN;
}
}
@@ -2687,15 +3263,18 @@ static void dump_table(char *table, char *db)
plus 2 bytes for '0x' prefix.
- In non-HEX mode we need up to 2 bytes per character,
plus 2 bytes for leading and trailing '\'' characters.
+ Also we need to reserve 1 byte for terminating '\0'.
*/
- dynstr_realloc_checked(&extended_row,length * 2+2);
+ dynstr_realloc_checked(&extended_row,length * 2 + 2 + 1);
if (opt_hex_blob && is_blob)
{
dynstr_append_checked(&extended_row, "0x");
extended_row.length+= mysql_hex_string(extended_row.str +
extended_row.length,
row[i], length);
- extended_row.str[extended_row.length]= '\0';
+ DBUG_ASSERT(extended_row.length+1 <= extended_row.max_length);
+ /* mysql_hex_string() already terminated string by '\0' */
+ DBUG_ASSERT(extended_row.str[extended_row.length] == '\0');
}
else
{
@@ -2885,8 +3464,8 @@ static void dump_table(char *table, char *db)
check_io(md_result_file);
}
mysql_free_result(res);
- dynstr_free(&query_string);
}
+ dynstr_free(&query_string);
DBUG_VOID_RETURN;
err:
@@ -3007,6 +3586,7 @@ static int dump_tablespaces(char* ts_where)
char extra_format[]= "UNDO_BUFFER_SIZE=";
char *ubs;
char *endsemi;
+ DBUG_ENTER("dump_tablespaces");
init_dynamic_string_checked(&sqlbuf,
"SELECT LOGFILE_GROUP_NAME,"
@@ -3038,6 +3618,7 @@ static int dump_tablespaces(char* ts_where)
if (mysql_query(mysql, sqlbuf.str) ||
!(tableres = mysql_store_result(mysql)))
{
+ dynstr_free(&sqlbuf);
if (mysql_errno(mysql) == ER_BAD_TABLE_ERROR ||
mysql_errno(mysql) == ER_BAD_DB_ERROR ||
mysql_errno(mysql) == ER_UNKNOWN_TABLE)
@@ -3046,12 +3627,12 @@ static int dump_tablespaces(char* ts_where)
"\n--\n-- Not dumping tablespaces as no INFORMATION_SCHEMA.FILES"
" table on this server\n--\n");
check_io(md_result_file);
- return 0;
+ DBUG_RETURN(0);
}
- my_printf_error(0, "Error: Couldn't dump tablespaces %s",
+ my_printf_error(0, "Error: '%s' when trying to dump tablespaces",
MYF(0), mysql_error(mysql));
- return 1;
+ DBUG_RETURN(1);
}
buf[0]= 0;
@@ -3103,6 +3684,7 @@ static int dump_tablespaces(char* ts_where)
}
}
dynstr_free(&sqlbuf);
+ mysql_free_result(tableres);
init_dynamic_string_checked(&sqlbuf,
"SELECT DISTINCT TABLESPACE_NAME,"
" FILE_NAME,"
@@ -3120,7 +3702,10 @@ static int dump_tablespaces(char* ts_where)
dynstr_append_checked(&sqlbuf, " ORDER BY TABLESPACE_NAME, LOGFILE_GROUP_NAME");
if (mysql_query_with_error_report(mysql, &tableres, sqlbuf.str))
- return 1;
+ {
+ dynstr_free(&sqlbuf);
+ DBUG_RETURN(1);
+ }
buf[0]= 0;
while ((row= mysql_fetch_row(tableres)))
@@ -3166,8 +3751,9 @@ static int dump_tablespaces(char* ts_where)
}
}
+ mysql_free_result(tableres);
dynstr_free(&sqlbuf);
- return 0;
+ DBUG_RETURN(0);
}
static int dump_all_databases()
@@ -3254,8 +3840,11 @@ RETURN VALUES
0 Success.
1 Failure.
*/
+
int init_dumping_tables(char *qdatabase)
{
+ DBUG_ENTER("init_dumping_tables");
+
if (!opt_create_db)
{
char qbuf[256];
@@ -3271,7 +3860,7 @@ int init_dumping_tables(char *qdatabase)
/* Old server version, dump generic CREATE DATABASE */
if (opt_drop_database)
fprintf(md_result_file,
- "\n/*!40000 DROP DATABASE IF EXISTS %s;*/\n",
+ "\n/*!40000 DROP DATABASE IF EXISTS %s*/;\n",
qdatabase);
fprintf(md_result_file,
"\nCREATE DATABASE /*!32312 IF NOT EXISTS*/ %s;\n",
@@ -3288,10 +3877,10 @@ int init_dumping_tables(char *qdatabase)
{
fprintf(md_result_file,"\n%s;\n",row[1]);
}
+ mysql_free_result(dbinfo);
}
}
-
- return 0;
+ DBUG_RETURN(0);
} /* init_dumping_tables */
@@ -3336,9 +3925,9 @@ static int init_dumping(char *database, int init_func(char*))
/* Return 1 if we should copy the table */
-my_bool include_table(byte* hash_key, uint len)
+my_bool include_table(const uchar *hash_key, size_t len)
{
- return !hash_search(&ignore_table, (byte*) hash_key, len);
+ return !hash_search(&ignore_table, hash_key, len);
}
@@ -3363,11 +3952,12 @@ static int dump_all_tables_in_db(char *database)
{
DYNAMIC_STRING query;
init_dynamic_string_checked(&query, "LOCK TABLES ", 256, 1024);
- for (numrows= 0 ; (table= getTableName(1)) ; numrows++)
+ for (numrows= 0 ; (table= getTableName(1)) ; )
{
char *end= strmov(afterdot, table);
- if (include_table(hash_key,end - hash_key))
+ if (include_table((uchar*) hash_key,end - hash_key))
{
+ numrows++;
dynstr_append_checked(&query, quote_name(table, table_buff, 1));
dynstr_append_checked(&query, " READ /*!32311 LOCAL */,");
}
@@ -3386,14 +3976,21 @@ static int dump_all_tables_in_db(char *database)
while ((table= getTableName(0)))
{
char *end= strmov(afterdot, table);
- if (include_table(hash_key, end - hash_key))
+ if (include_table((uchar*) hash_key, end - hash_key))
{
dump_table(table,database);
my_free(order_by, MYF(MY_ALLOW_ZERO_PTR));
order_by= 0;
if (opt_dump_triggers && ! opt_xml &&
mysql_get_server_version(mysql) >= 50009)
- dump_triggers_for_table(table, database);
+ {
+ if (dump_triggers_for_table(table, database))
+ {
+ if (path)
+ my_fclose(md_result_file, MYF(MY_WME));
+ maybe_exit(EX_MYSQLERR);
+ }
+ }
}
}
if (opt_events && !opt_xml &&
@@ -3441,6 +4038,11 @@ static my_bool dump_all_views_in_db(char *database)
char *table;
uint numrows;
char table_buff[NAME_LEN*2+3];
+ char hash_key[2*NAME_LEN+2]; /* "db.tablename" */
+ char *afterdot;
+
+ afterdot= strmov(hash_key, database);
+ *afterdot++= '.';
if (init_dumping(database, init_dumping_views))
return 1;
@@ -3450,10 +4052,15 @@ static my_bool dump_all_views_in_db(char *database)
{
DYNAMIC_STRING query;
init_dynamic_string_checked(&query, "LOCK TABLES ", 256, 1024);
- for (numrows= 0 ; (table= getTableName(1)); numrows++)
+ for (numrows= 0 ; (table= getTableName(1)); )
{
- dynstr_append_checked(&query, quote_name(table, table_buff, 1));
- dynstr_append_checked(&query, " READ /*!32311 LOCAL */,");
+ char *end= strmov(afterdot, table);
+ if (include_table((uchar*) hash_key,end - hash_key))
+ {
+ numrows++;
+ dynstr_append_checked(&query, quote_name(table, table_buff, 1));
+ dynstr_append_checked(&query, " READ /*!32311 LOCAL */,");
+ }
}
if (numrows && mysql_real_query(mysql, query.str, query.length-1))
DB_error(mysql, "when using LOCK TABLES");
@@ -3467,7 +4074,11 @@ static my_bool dump_all_views_in_db(char *database)
/* We shall continue here, if --force was given */
}
while ((table= getTableName(0)))
- get_view_structure(table, database);
+ {
+ char *end= strmov(afterdot, table);
+ if (include_table((uchar*) hash_key, end - hash_key))
+ get_view_structure(table, database);
+ }
if (opt_xml)
{
fputs("</database>\n", md_result_file);
@@ -3559,8 +4170,13 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
}
else
{
- maybe_die(EX_ILLEGAL_TABLE, "Couldn't find table: \"%s\"", *table_names);
- /* We shall countinue here, if --force was given */
+ if (!ignore_errors)
+ {
+ dynstr_free(&lock_tables_query);
+ free_root(&root, MYF(0));
+ }
+ maybe_die(EX_ILLEGAL_TABLE, "Couldn't find table: \"%s\"", *table_names);
+ /* We shall countinue here, if --force was given */
}
}
end= pos;
@@ -3569,14 +4185,25 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
{
if (mysql_real_query(mysql, lock_tables_query.str,
lock_tables_query.length-1))
+ {
+ if (!ignore_errors)
+ {
+ dynstr_free(&lock_tables_query);
+ free_root(&root, MYF(0));
+ }
DB_error(mysql, "when doing LOCK TABLES");
/* We shall countinue here, if --force was given */
+ }
}
dynstr_free(&lock_tables_query);
if (flush_logs)
{
if (mysql_refresh(mysql, REFRESH_LOG))
+ {
+ if (!ignore_errors)
+ free_root(&root, MYF(0));
DB_error(mysql, "when doing refresh");
+ }
/* We shall countinue here, if --force was given */
}
if (opt_xml)
@@ -3589,7 +4216,14 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
dump_table(*pos, db);
if (opt_dump_triggers &&
mysql_get_server_version(mysql) >= 50009)
- dump_triggers_for_table(*pos, db);
+ {
+ if (dump_triggers_for_table(*pos, db))
+ {
+ if (path)
+ my_fclose(md_result_file, MYF(MY_WME));
+ maybe_exit(EX_MYSQLERR);
+ }
+ }
}
/* Dump each selected view */
@@ -3686,10 +4320,41 @@ static int do_unlock_tables(MYSQL *mysql_con)
return mysql_query_with_error_report(mysql_con, 0, "UNLOCK TABLES");
}
+static int get_bin_log_name(MYSQL *mysql_con,
+ char* buff_log_name, uint buff_len)
+{
+ MYSQL_RES *res;
+ MYSQL_ROW row;
+
+ if (mysql_query(mysql_con, "SHOW MASTER STATUS") ||
+ !(res= mysql_store_result(mysql)))
+ return 1;
+
+ if (!(row= mysql_fetch_row(res)))
+ {
+ mysql_free_result(res);
+ return 1;
+ }
+ /*
+ Only one row is returned, and the first column is the name of the
+ active log.
+ */
+ strmake(buff_log_name, row[0], buff_len - 1);
+
+ mysql_free_result(res);
+ return 0;
+}
-static int do_reset_master(MYSQL *mysql_con)
+static int purge_bin_logs_to(MYSQL *mysql_con, char* log_name)
{
- return mysql_query_with_error_report(mysql_con, 0, "RESET MASTER");
+ DYNAMIC_STRING str;
+ int err;
+ init_dynamic_string_checked(&str, "PURGE BINARY LOGS TO '", 1024, 1024);
+ dynstr_append_checked(&str, log_name);
+ dynstr_append_checked(&str, "'");
+ err = mysql_query_with_error_report(mysql_con, 0, str.str);
+ dynstr_free(&str);
+ return err;
}
@@ -3861,7 +4526,8 @@ char check_if_ignore_table(const char *table_name, char *table_type)
If these two types, we do want to skip dumping the table
*/
if (!opt_no_data &&
- (!strcmp(table_type,"MRG_MyISAM") || !strcmp(table_type,"MRG_ISAM")))
+ (!my_strcasecmp(&my_charset_latin1, table_type, "MRG_MyISAM") ||
+ !strcmp(table_type,"MRG_ISAM")))
result= IGNORE_DATA;
}
mysql_free_result(res);
@@ -4029,14 +4695,22 @@ static my_bool get_view_structure(char *table, char* db)
result_table= quote_name(table, table_buff, 1);
opt_quoted_table= quote_name(table, table_buff2, 0);
+ if (switch_character_set_results(mysql, "binary"))
+ DBUG_RETURN(1);
+
my_snprintf(query, sizeof(query), "SHOW CREATE TABLE %s", result_table);
+
if (mysql_query_with_error_report(mysql, &table_res, query))
+ {
+ switch_character_set_results(mysql, default_charset);
DBUG_RETURN(0);
+ }
/* Check if this is a view */
field= mysql_fetch_field_direct(table_res, 0);
if (strcmp(field->name, "View") != 0)
{
+ switch_character_set_results(mysql, default_charset);
verbose_msg("-- It's base table, skipped\n");
DBUG_RETURN(0);
}
@@ -4056,10 +4730,9 @@ static my_bool get_view_structure(char *table, char* db)
result_table);
check_io(sql_file);
}
+ fprintf(sql_file, "/*!50001 DROP TABLE %s*/;\n", opt_quoted_table);
if (opt_drop)
{
- fprintf(sql_file, "/*!50001 DROP TABLE IF EXISTS %s*/;\n",
- opt_quoted_table);
fprintf(sql_file, "/*!50001 DROP VIEW IF EXISTS %s*/;\n",
opt_quoted_table);
check_io(sql_file);
@@ -4067,9 +4740,11 @@ static my_bool get_view_structure(char *table, char* db)
my_snprintf(query, sizeof(query),
- "SELECT CHECK_OPTION, DEFINER, SECURITY_TYPE " \
- "FROM information_schema.views " \
+ "SELECT CHECK_OPTION, DEFINER, SECURITY_TYPE, "
+ " CHARACTER_SET_CLIENT, COLLATION_CONNECTION "
+ "FROM information_schema.views "
"WHERE table_name=\"%s\" AND table_schema=\"%s\"", table, db);
+
if (mysql_query(mysql, query))
{
/*
@@ -4099,6 +4774,9 @@ static my_bool get_view_structure(char *table, char* db)
if (!(table_res= mysql_store_result(mysql)) ||
!(row= mysql_fetch_row(table_res)))
{
+ if (table_res)
+ mysql_free_result(table_res);
+ dynstr_free(&ds_view);
DB_error(mysql, "when trying to save the result of SHOW CREATE TABLE in ds_view.");
DBUG_RETURN(1);
}
@@ -4126,10 +4804,10 @@ static my_bool get_view_structure(char *table, char* db)
Surround it with !50013 comments
*/
{
- uint user_name_len;
+ size_t user_name_len;
char user_name_str[USERNAME_LENGTH + 1];
char quoted_user_name_str[USERNAME_LENGTH * 2 + 3];
- uint host_name_len;
+ size_t host_name_len;
char host_name_str[HOSTNAME_LENGTH + 1];
char quoted_host_name_str[HOSTNAME_LENGTH * 2 + 3];
@@ -4155,12 +4833,31 @@ static my_bool get_view_structure(char *table, char* db)
}
/* Dump view structure to file */
- fprintf(sql_file, "/*!50001 %s */;\n", ds_view.str);
+
+ fprintf(sql_file,
+ "/*!50001 SET @saved_cs_client = @@character_set_client */;\n"
+ "/*!50001 SET @saved_cs_results = @@character_set_results */;\n"
+ "/*!50001 SET @saved_col_connection = @@collation_connection */;\n"
+ "/*!50001 SET character_set_client = %s */;\n"
+ "/*!50001 SET character_set_results = %s */;\n"
+ "/*!50001 SET collation_connection = %s */;\n"
+ "/*!50001 %s */;\n"
+ "/*!50001 SET character_set_client = @saved_cs_client */;\n"
+ "/*!50001 SET character_set_results = @saved_cs_results */;\n"
+ "/*!50001 SET collation_connection = @saved_col_connection */;\n",
+ (const char *) row[3],
+ (const char *) row[3],
+ (const char *) row[4],
+ (const char *) ds_view.str);
+
check_io(sql_file);
mysql_free_result(table_res);
dynstr_free(&ds_view);
}
+ if (switch_character_set_results(mysql, default_charset))
+ DBUG_RETURN(1);
+
/* If a separate .sql file was opened, close it now */
if (sql_file != md_result_file)
{
@@ -4213,6 +4910,7 @@ static void dynstr_realloc_checked(DYNAMIC_STRING *str, ulong additional_size)
int main(int argc, char **argv)
{
+ char bin_log_name[FN_REFLEN];
int exit_code;
MY_INIT("mysqldump");
@@ -4249,8 +4947,13 @@ int main(int argc, char **argv)
goto err;
if (opt_single_transaction && start_transaction(mysql))
goto err;
- if (opt_delete_master_logs && do_reset_master(mysql))
- goto err;
+ if (opt_delete_master_logs)
+ {
+ if (mysql_refresh(mysql, REFRESH_LOG) ||
+ get_bin_log_name(mysql, bin_log_name, sizeof(bin_log_name)))
+ goto err;
+ flush_logs= 0;
+ }
if (opt_lock_all_tables || opt_master_data)
{
if (flush_logs && mysql_refresh(mysql, REFRESH_LOG))
@@ -4285,6 +4988,18 @@ int main(int argc, char **argv)
dump_tablespaces_for_databases(argv);
dump_databases(argv);
}
+
+ /* ensure dumped data flushed */
+ if (md_result_file && fflush(md_result_file))
+ {
+ if (!first_error)
+ first_error= EX_MYSQLERR;
+ goto err;
+ }
+ /* everything successful, purge the old logs files */
+ if (opt_delete_master_logs && purge_bin_logs_to(mysql, bin_log_name))
+ goto err;
+
#ifdef HAVE_SMEM
my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR));
#endif
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index c037da9c0b9..afd9454d6be 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -24,7 +24,7 @@
** * *
** *************************
*/
-#define IMPORT_VERSION "3.6"
+#define IMPORT_VERSION "3.7"
#include "client_priv.h"
#include "mysql_version.h"
@@ -49,15 +49,15 @@ static char *add_load_option(char *ptr,const char *object,
static my_bool verbose=0,lock_tables=0,ignore_errors=0,opt_delete=0,
replace=0,silent=0,ignore=0,opt_compress=0,
opt_low_priority= 0, tty_password= 0;
-static my_bool info_flag= 0;
-static uint opt_use_threads=0, opt_local_file=0;
+static my_bool debug_info_flag= 0, debug_check_flag= 0;
+static uint opt_use_threads=0, opt_local_file=0, my_end_arg= 0;
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;
static uint opt_mysql_port= 0, opt_protocol= 0;
-static my_string opt_mysql_unix_port=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>
@@ -73,59 +73,63 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"character-sets-dir", OPT_CHARSETS_DIR,
- "Directory where character sets are.", (gptr*) &charsets_dir,
- (gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Directory where character sets are.", (uchar**) &charsets_dir,
+ (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"default-character-set", OPT_DEFAULT_CHARSET,
- "Set the default character set.", (gptr*) &default_charset,
- (gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Set the default character set.", (uchar**) &default_charset,
+ (uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"columns", 'c',
"Use only these columns to import the data to. Give the column names in a comma separated list. This is same as giving columns to LOAD DATA INFILE.",
- (gptr*) &opt_columns, (gptr*) &opt_columns, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
+ (uchar**) &opt_columns, (uchar**) &opt_columns, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
0, 0, 0},
{"compress", 'C', "Use compression in server/client protocol.",
- (gptr*) &opt_compress, (gptr*) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+ (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"debug",'#', "Output debug log. Often this is 'd:t:o,filename'.", 0, 0, 0,
GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
- {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", (gptr*) &info_flag,
- (gptr*) &info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"delete", 'd', "First delete all rows from table.", (gptr*) &opt_delete,
- (gptr*) &opt_delete, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .",
+ (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+ GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
+ (uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
+ 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"delete", 'd', "First delete all rows from table.", (uchar**) &opt_delete,
+ (uchar**) &opt_delete, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"fields-terminated-by", OPT_FTB,
- "Fields in the textfile are terminated by ...", (gptr*) &fields_terminated,
- (gptr*) &fields_terminated, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Fields in the textfile are terminated by ...", (uchar**) &fields_terminated,
+ (uchar**) &fields_terminated, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"fields-enclosed-by", OPT_ENC,
- "Fields in the importfile are enclosed by ...", (gptr*) &enclosed,
- (gptr*) &enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Fields in the importfile are enclosed by ...", (uchar**) &enclosed,
+ (uchar**) &enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"fields-optionally-enclosed-by", OPT_O_ENC,
- "Fields in the i.file are opt. enclosed by ...", (gptr*) &opt_enclosed,
- (gptr*) &opt_enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Fields in the i.file are opt. enclosed by ...", (uchar**) &opt_enclosed,
+ (uchar**) &opt_enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"fields-escaped-by", OPT_ESC, "Fields in the i.file are escaped by ...",
- (gptr*) &escaped, (gptr*) &escaped, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
+ (uchar**) &escaped, (uchar**) &escaped, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
0, 0},
{"force", 'f', "Continue even if we get an sql-error.",
- (gptr*) &ignore_errors, (gptr*) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
+ (uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0},
{"help", '?', "Displays this help and exits.", 0, 0, 0, GET_NO_ARG, NO_ARG,
0, 0, 0, 0, 0, 0},
- {"host", 'h', "Connect to host.", (gptr*) &current_host,
- (gptr*) &current_host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"host", 'h', "Connect to host.", (uchar**) &current_host,
+ (uchar**) &current_host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"ignore", 'i', "If duplicate unique key was found, keep old row.",
- (gptr*) &ignore, (gptr*) &ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ (uchar**) &ignore, (uchar**) &ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"ignore-lines", OPT_IGN_LINES, "Ignore first n lines of data infile.",
- (gptr*) &opt_ignore_lines, (gptr*) &opt_ignore_lines, 0, GET_LL,
+ (uchar**) &opt_ignore_lines, (uchar**) &opt_ignore_lines, 0, GET_LL,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"lines-terminated-by", OPT_LTB, "Lines in the i.file are terminated by ...",
- (gptr*) &lines_terminated, (gptr*) &lines_terminated, 0, GET_STR,
+ (uchar**) &lines_terminated, (uchar**) &lines_terminated, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"local", 'L', "Read all files through the client.", (gptr*) &opt_local_file,
- (gptr*) &opt_local_file, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"local", 'L', "Read all files through the client.", (uchar**) &opt_local_file,
+ (uchar**) &opt_local_file, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"lock-tables", 'l', "Lock all tables for write (this disables threads).",
- (gptr*) &lock_tables, (gptr*) &lock_tables, 0, GET_BOOL, NO_ARG,
+ (uchar**) &lock_tables, (uchar**) &lock_tables, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
{"low-priority", OPT_LOW_PRIORITY,
- "Use LOW_PRIORITY when updating the table.", (gptr*) &opt_low_priority,
- (gptr*) &opt_low_priority, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ "Use LOW_PRIORITY when updating the table.", (uchar**) &opt_low_priority,
+ (uchar**) &opt_low_priority, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"password", 'p',
"Password to use when connecting to server. If password is not given it's asked from the tty.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
@@ -133,35 +137,35 @@ static struct my_option my_long_options[] =
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port,
- (gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
+ {"port", 'P', "Port number to use for connection.", (uchar**) &opt_mysql_port,
+ (uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
0},
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"replace", 'r', "If duplicate unique key was found, replace old row.",
- (gptr*) &replace, (gptr*) &replace, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ (uchar**) &replace, (uchar**) &replace, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
- "Base name of shared memory.", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
+ "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"silent", 's', "Be more silent.", (gptr*) &silent, (gptr*) &silent, 0,
+ {"silent", 's', "Be more silent.", (uchar**) &silent, (uchar**) &silent, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"socket", 'S', "Socket file to use for connection.",
- (gptr*) &opt_mysql_unix_port, (gptr*) &opt_mysql_unix_port, 0, GET_STR,
+ (uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#include <sslopt-longopts.h>
{"use-threads", OPT_USE_THREADS,
"Load files in parallel. The argument is the number "
"of threads to use for loading data.",
- (gptr*) &opt_use_threads, (gptr*) &opt_use_threads, 0,
+ (uchar**) &opt_use_threads, (uchar**) &opt_use_threads, 0,
GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifndef DONT_ALLOW_USER_CHANGE
- {"user", 'u', "User for login if not current user.", (gptr*) &current_user,
- (gptr*) &current_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"user", 'u', "User for login if not current user.", (uchar**) &current_user,
+ (uchar**) &current_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"verbose", 'v', "Print info about the various stages.", (gptr*) &verbose,
- (gptr*) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"verbose", 'v', "Print info about the various stages.", (uchar**) &verbose,
+ (uchar**) &verbose, 0, GET_BOOL, NO_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},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
@@ -236,6 +240,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
case '#':
DBUG_PUSH(argument ? argument : "d:t:o");
+ debug_check_flag= 1;
break;
#include <sslopt-case.h>
case 'V': print_version(); exit(0);
@@ -254,6 +259,10 @@ static int get_options(int *argc, char ***argv)
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
exit(ho_error);
+ if (debug_info_flag)
+ my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO;
+ if (debug_check_flag)
+ my_end_arg= MY_CHECK_ERROR;
if (enclosed && opt_enclosed)
{
@@ -659,6 +668,6 @@ int main(int argc, char **argv)
my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR));
#endif
free_defaults(argv_to_free);
- my_end(info_flag ? MY_CHECK_ERROR : 0);
+ my_end(my_end_arg);
return(exitcode);
}
diff --git a/client/mysqlshow.c b/client/mysqlshow.c
index 0c6a6229964..a7f6cadf450 100644
--- a/client/mysqlshow.c
+++ b/client/mysqlshow.c
@@ -15,7 +15,7 @@
/* Show databases, tables or columns */
-#define SHOW_VERSION "9.6"
+#define SHOW_VERSION "9.10"
#include "client_priv.h"
#include <my_sys.h>
@@ -26,9 +26,11 @@
#include <stdarg.h>
#include <sslopt-vars.h>
-static my_string host=0,opt_password=0,user=0;
+static char * host=0, *opt_password=0, *user=0;
static my_bool opt_show_keys= 0, opt_compress= 0, opt_count=0, opt_status= 0;
-static my_bool tty_password= 0, opt_table_type= 0, info_flag= 0;
+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;
@@ -52,7 +54,7 @@ static void print_res_top(MYSQL_RES *result);
static void print_res_row(MYSQL_RES *result,MYSQL_ROW cur);
static const char *load_default_groups[]= { "mysqlshow","client",0 };
-static my_string opt_mysql_unix_port=0;
+static char * opt_mysql_unix_port=0;
int main(int argc, char **argv)
{
@@ -120,7 +122,8 @@ int main(int argc, char **argv)
mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset);
if (!(mysql_real_connect(&mysql,host,user,opt_password,
- (first_argument_uses_wildcards) ? "" : argv[0],opt_mysql_port,opt_mysql_unix_port,
+ (first_argument_uses_wildcards) ? "" :
+ argv[0],opt_mysql_port,opt_mysql_unix_port,
0)))
{
fprintf(stderr,"%s: %s\n",my_progname,mysql_error(&mysql));
@@ -149,7 +152,7 @@ int main(int argc, char **argv)
#ifdef HAVE_SMEM
my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR));
#endif
- my_end(info_flag ? MY_CHECK_ERROR : 0);
+ my_end(my_end_arg);
exit(error ? 1 : 0);
return 0; /* No compiler warnings */
}
@@ -161,36 +164,40 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"character-sets-dir", 'c', "Directory where character sets are.",
- (gptr*) &charsets_dir, (gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0,
+ (uchar**) &charsets_dir, (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0,
0, 0, 0, 0, 0},
{"default-character-set", OPT_DEFAULT_CHARSET,
- "Set the default character set.", (gptr*) &default_charset,
- (gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Set the default character set.", (uchar**) &default_charset,
+ (uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"count", OPT_COUNT,
"Show number of rows per table (may be slow for not MyISAM tables)",
- (gptr*) &opt_count, (gptr*) &opt_count, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+ (uchar**) &opt_count, (uchar**) &opt_count, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"compress", 'C', "Use compression in server/client protocol.",
- (gptr*) &opt_compress, (gptr*) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+ (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
- {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", (gptr*) &info_flag,
- (gptr*) &info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .",
+ (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+ GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
+ (uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
+ 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG,
0, 0, 0, 0, 0, 0},
- {"host", 'h', "Connect to host.", (gptr*) &host, (gptr*) &host, 0, GET_STR,
+ {"host", 'h', "Connect to host.", (uchar**) &host, (uchar**) &host, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"status", 'i', "Shows a lot of extra information about each table.",
- (gptr*) &opt_status, (gptr*) &opt_status, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+ (uchar**) &opt_status, (uchar**) &opt_status, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
- {"keys", 'k', "Show keys for table.", (gptr*) &opt_show_keys,
- (gptr*) &opt_show_keys, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"keys", 'k', "Show keys for table.", (uchar**) &opt_show_keys,
+ (uchar**) &opt_show_keys, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"password", 'p',
"Password to use when connecting to server. If password is not given it's asked from the tty.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
- {"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port,
- (gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
+ {"port", 'P', "Port number to use for connection.", (uchar**) &opt_mysql_port,
+ (uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
0},
#ifdef __WIN__
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
@@ -200,19 +207,19 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
- "Base name of shared memory.", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
+ "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"show-table-type", 't', "Show table type column.",
- (gptr*) &opt_table_type, (gptr*) &opt_table_type, 0, GET_BOOL,
+ (uchar**) &opt_table_type, (uchar**) &opt_table_type, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"socket", 'S', "Socket file to use for connection.",
- (gptr*) &opt_mysql_unix_port, (gptr*) &opt_mysql_unix_port, 0, GET_STR,
+ (uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#include <sslopt-longopts.h>
#ifndef DONT_ALLOW_USER_CHANGE
- {"user", 'u', "User for login if not current user.", (gptr*) &user,
- (gptr*) &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"user", 'u', "User for login if not current user.", (uchar**) &user,
+ (uchar**) &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"verbose", 'v',
"More verbose output; You can use this multiple times to get even more verbose output.",
@@ -292,6 +299,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
case '#':
DBUG_PUSH(argument ? argument : "d:t:o");
+ debug_check_flag= 1;
break;
#include <sslopt-case.h>
case 'V':
@@ -325,6 +333,10 @@ get_options(int *argc,char ***argv)
*/
opt_verbose= 2;
}
+ if (debug_info_flag)
+ my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO;
+ if (debug_check_flag)
+ my_end_arg= MY_CHECK_ERROR;
return;
}
@@ -733,7 +745,7 @@ print_header(const char *header,uint head_length,...)
for (i=0 ; i < length+2 ; i++)
putchar('-');
putchar('+');
- if (!(field=va_arg(args,my_string)))
+ if (!(field=va_arg(args,char *)))
break;
length=va_arg(args,uint);
}
@@ -757,7 +769,7 @@ print_header(const char *header,uint head_length,...)
for (i=0 ; i < length ; i++)
putchar(' ');
putchar('|');
- if (!(field=va_arg(args,my_string)))
+ if (!(field=va_arg(args,char *)))
break;
length=va_arg(args,uint);
}
@@ -772,7 +784,7 @@ print_header(const char *header,uint head_length,...)
for (i=0 ; i < length+2 ; i++)
putchar('-');
putchar('+');
- if (!(field=va_arg(args,my_string)))
+ if (!(field=va_arg(args,char *)))
break;
length=va_arg(args,uint);
}
@@ -798,7 +810,7 @@ print_row(const char *header,uint head_length,...)
field_length=(uint) strlen(field);
for (i=field_length ; i <= length ; i++)
putchar(' ');
- if (!(field=va_arg(args,my_string)))
+ if (!(field=va_arg(args,char *)))
break;
length=va_arg(args,uint);
}
diff --git a/client/mysqlslap.c b/client/mysqlslap.c
index 0335922881a..02a0cbd04c5 100644
--- a/client/mysqlslap.c
+++ b/client/mysqlslap.c
@@ -35,7 +35,8 @@
Supply your own create and query SQL statements, with 50 clients
querying (200 selects for each):
- mysqlslap --create="CREATE TABLE A (a int);INSERT INTO A (23)" \
+ mysqlslap --delimiter=";" \
+ --create="CREATE TABLE A (a int);INSERT INTO A VALUES (23)" \
--query="SELECT * FROM A" --concurrency=50 --iterations=200
Let the program build the query SQL statement with a table of two int
@@ -68,7 +69,7 @@ TODO:
*/
-#define SHOW_VERSION "0.9"
+#define SLAP_VERSION "1.0"
#define HUGE_STRING_LENGTH 8196
#define RAND_STRING_SIZE 126
@@ -80,6 +81,7 @@ TODO:
#define UPDATE_TYPE_REQUIRES_PREFIX 3
#define CREATE_TABLE_TYPE 4
#define SELECT_TYPE_REQUIRES_PREFIX 5
+#define DELETE_TYPE_REQUIRES_PREFIX 6
#include "client_priv.h"
#include <mysqld_error.h>
@@ -121,16 +123,16 @@ static char *host= NULL, *opt_password= NULL, *user= NULL,
*user_supplied_pre_statements= NULL,
*user_supplied_post_statements= NULL,
*default_engine= NULL,
+ *pre_system= NULL,
+ *post_system= NULL,
*opt_mysql_unix_port= NULL;
const char *delimiter= "\n";
const char *create_schema_string= "mysqlslap";
-static my_bool opt_preserve;
-
+static my_bool opt_preserve= 0, debug_info_flag= 0, debug_check_flag= 0;
static my_bool opt_only_print= FALSE;
-
static my_bool opt_compress= FALSE, tty_password= FALSE,
opt_silent= FALSE,
auto_generate_sql_autoincrement= FALSE,
@@ -141,15 +143,18 @@ const char *auto_generate_sql_type= "mixed";
static unsigned long connect_flags= CLIENT_MULTI_RESULTS;
static int verbose, delimiter_length;
+static uint commit_rate;
+static uint detach_rate;
const char *num_int_cols_opt;
const char *num_char_cols_opt;
+
/* Yes, we do set defaults here */
static unsigned int num_int_cols= 1;
static unsigned int num_char_cols= 1;
static unsigned int num_int_cols_index= 0;
static unsigned int num_char_cols_index= 0;
-
static unsigned int iterations;
+static uint my_end_arg= 0;
static char *default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME;
static ulonglong actual_queries= 0;
static ulonglong auto_actual_queries;
@@ -253,6 +258,8 @@ void statement_cleanup(statement *stmt);
void option_cleanup(option_string *stmt);
void concurrency_loop(MYSQL *mysql, uint current, option_string *eptr);
static int run_statements(MYSQL *mysql, statement *stmt);
+int slap_connect(MYSQL *mysql);
+static int run_query(MYSQL *mysql, const char *query, int len);
static const char ALPHANUMERICS[]=
"0123456789ABCDEFGHIJKLMNOPQRSTWXYZabcdefghijklmnopqrstuvwxyz";
@@ -387,9 +394,9 @@ int main(int argc, char **argv)
/* now free all the strings we created */
if (opt_password)
- my_free((gptr)opt_password, MYF(0));
+ my_free(opt_password, MYF(0));
- my_free((gptr)concurrency, MYF(0));
+ my_free(concurrency, MYF(0));
statement_cleanup(create_statements);
statement_cleanup(query_statements);
@@ -399,10 +406,10 @@ int main(int argc, char **argv)
#ifdef HAVE_SMEM
if (shared_memory_base_name)
- my_free((gptr)shared_memory_base_name, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(shared_memory_base_name, MYF(MY_ALLOW_ZERO_PTR));
#endif
free_defaults(defaults_argv);
- my_end(0);
+ my_end(my_end_arg);
return 0;
}
@@ -450,6 +457,16 @@ void concurrency_loop(MYSQL *mysql, uint current, option_string *eptr)
if (auto_generate_sql_autoincrement || auto_generate_sql_guid_primary)
generate_primary_key_list(mysql, eptr);
+ if (commit_rate)
+ run_query(mysql, "SET AUTOCOMMIT=0", strlen("SET AUTOCOMMIT=0"));
+
+ if (pre_system)
+ system(pre_system);
+
+ /*
+ Pre statements are always run after all other logic so they can
+ correct/adjust any item that they want.
+ */
if (pre_statements)
run_statements(mysql, pre_statements);
@@ -458,6 +475,9 @@ void concurrency_loop(MYSQL *mysql, uint current, option_string *eptr)
if (post_statements)
run_statements(mysql, post_statements);
+ if (post_system)
+ system(post_system);
+
/* We are finished with this run */
if (auto_generate_sql_autoincrement || auto_generate_sql_guid_primary)
drop_primary_key_list();
@@ -473,7 +493,7 @@ void concurrency_loop(MYSQL *mysql, uint current, option_string *eptr)
if (opt_csv_str)
print_conclusions_csv(&conclusion);
- my_free((gptr)head_sptr, MYF(0));
+ my_free(head_sptr, MYF(0));
}
@@ -484,94 +504,105 @@ static struct my_option my_long_options[] =
0, 0, 0, 0, 0, 0},
{"auto-generate-sql", 'a',
"Generate SQL where not supplied by file or command line.",
- (gptr*) &auto_generate_sql, (gptr*) &auto_generate_sql,
+ (uchar**) &auto_generate_sql, (uchar**) &auto_generate_sql,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"auto-generate-sql-add-autoincrement", OPT_SLAP_AUTO_GENERATE_ADD_AUTO,
"Add autoincrement to auto-generated tables.",
- (gptr*) &auto_generate_sql_autoincrement,
- (gptr*) &auto_generate_sql_autoincrement,
+ (uchar**) &auto_generate_sql_autoincrement,
+ (uchar**) &auto_generate_sql_autoincrement,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"auto-generate-sql-execute-number", OPT_SLAP_AUTO_GENERATE_EXECUTE_QUERIES,
"Set this number to generate a set number of queries to run.\n",
- (gptr*) &auto_actual_queries, (gptr*) &auto_actual_queries,
+ (uchar**) &auto_actual_queries, (uchar**) &auto_actual_queries,
0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"auto-generate-sql-guid-primary", OPT_SLAP_AUTO_GENERATE_GUID_PRIMARY,
"Add GUID based primary keys to auto-generated tables.",
- (gptr*) &auto_generate_sql_guid_primary,
- (gptr*) &auto_generate_sql_guid_primary,
+ (uchar**) &auto_generate_sql_guid_primary,
+ (uchar**) &auto_generate_sql_guid_primary,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"auto-generate-sql-load-type", OPT_SLAP_AUTO_GENERATE_SQL_LOAD_TYPE,
"Load types are mixed, update, write, key, or read. Default is mixed\n",
- (gptr*) &auto_generate_sql_type, (gptr*) &auto_generate_sql_type,
+ (uchar**) &auto_generate_sql_type, (uchar**) &auto_generate_sql_type,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"auto-generate-sql-secondary-indexes",
OPT_SLAP_AUTO_GENERATE_SECONDARY_INDEXES,
"Number of secondary indexes to add auto-generated tables.",
- (gptr*) &auto_generate_sql_secondary_indexes,
- (gptr*) &auto_generate_sql_secondary_indexes, 0,
+ (uchar**) &auto_generate_sql_secondary_indexes,
+ (uchar**) &auto_generate_sql_secondary_indexes, 0,
GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"auto-generate-sql-unique-query-number",
OPT_SLAP_AUTO_GENERATE_UNIQUE_QUERY_NUM,
"Number of unique queries auto tests",
- (gptr*) &auto_generate_sql_unique_query_number,
- (gptr*) &auto_generate_sql_unique_query_number,
+ (uchar**) &auto_generate_sql_unique_query_number,
+ (uchar**) &auto_generate_sql_unique_query_number,
0, GET_ULL, REQUIRED_ARG, 10, 0, 0, 0, 0, 0},
{"auto-generate-sql-unique-write-number",
OPT_SLAP_AUTO_GENERATE_UNIQUE_WRITE_NUM,
"Number of unique queries for auto-generate-sql-write-number",
- (gptr*) &auto_generate_sql_unique_write_number,
- (gptr*) &auto_generate_sql_unique_write_number,
+ (uchar**) &auto_generate_sql_unique_write_number,
+ (uchar**) &auto_generate_sql_unique_write_number,
0, GET_ULL, REQUIRED_ARG, 10, 0, 0, 0, 0, 0},
{"auto-generate-sql-write-number", OPT_SLAP_AUTO_GENERATE_WRITE_NUM,
"Number of rows to insert to used in read and write loads (default is 100).\n",
- (gptr*) &auto_generate_sql_number, (gptr*) &auto_generate_sql_number,
+ (uchar**) &auto_generate_sql_number, (uchar**) &auto_generate_sql_number,
0, GET_ULL, REQUIRED_ARG, 100, 0, 0, 0, 0, 0},
+ {"commit", OPT_SLAP_COMMIT, "Commit records after X number of statements.",
+ (uchar**) &commit_rate, (uchar**) &commit_rate, 0, GET_UINT, REQUIRED_ARG,
+ 0, 0, 0, 0, 0, 0},
{"compress", 'C', "Use compression in server/client protocol.",
- (gptr*) &opt_compress, (gptr*) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+ (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"concurrency", 'c', "Number of clients to simulate for query to run.",
- (gptr*) &concurrency_str, (gptr*) &concurrency_str, 0, GET_STR,
+ (uchar**) &concurrency_str, (uchar**) &concurrency_str, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"create", OPT_SLAP_CREATE_STRING, "File or string to use create tables.",
- (gptr*) &create_string, (gptr*) &create_string, 0, GET_STR, REQUIRED_ARG,
+ (uchar**) &create_string, (uchar**) &create_string, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"create-schema", OPT_CREATE_SLAP_SCHEMA, "Schema to run tests in.",
- (gptr*) &create_schema_string, (gptr*) &create_schema_string, 0, GET_STR,
+ (uchar**) &create_schema_string, (uchar**) &create_schema_string, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"csv", OPT_SLAP_CSV,
"Generate CSV output to named file or to stdout if no file is named.",
- (gptr*) &opt_csv_str, (gptr*) &opt_csv_str, 0, GET_STR,
+ (uchar**) &opt_csv_str, (uchar**) &opt_csv_str, 0, GET_STR,
OPT_ARG, 0, 0, 0, 0, 0, 0},
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
- (gptr*) &default_dbug_option, (gptr*) &default_dbug_option, 0, GET_STR,
+ (uchar**) &default_dbug_option, (uchar**) &default_dbug_option, 0, GET_STR,
OPT_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .",
+ (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+ GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug-info", 'T', "Print some debug info at exit.", (uchar**) &debug_info_flag,
+ (uchar**) &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"delimiter", 'F',
"Delimiter to use in SQL statements supplied in file or command line.",
- (gptr*) &delimiter, (gptr*) &delimiter, 0, GET_STR, REQUIRED_ARG,
+ (uchar**) &delimiter, (uchar**) &delimiter, 0, GET_STR, REQUIRED_ARG,
+ 0, 0, 0, 0, 0, 0},
+ {"detach", OPT_SLAP_DETACH, "Detach connections after X number of requests.",
+ (uchar**) &detach_rate, (uchar**) &detach_rate, 0, GET_UINT, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"engine", 'e', "Storage engine to use for creating the table.",
- (gptr*) &default_engine, (gptr*) &default_engine, 0,
+ (uchar**) &default_engine, (uchar**) &default_engine, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"host", 'h', "Connect to host.", (gptr*) &host, (gptr*) &host, 0, GET_STR,
+ {"host", 'h', "Connect to host.", (uchar**) &host, (uchar**) &host, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"iterations", 'i', "Number of times too run the tests.", (gptr*) &iterations,
- (gptr*) &iterations, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0},
+ {"iterations", 'i', "Number of times to run the tests.", (uchar**) &iterations,
+ (uchar**) &iterations, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0},
{"number-char-cols", 'x',
"Number of VARCHAR columns to create table with if specifying --auto-generate-sql ",
- (gptr*) &num_char_cols_opt, (gptr*) &num_char_cols_opt, 0, GET_STR, REQUIRED_ARG,
+ (uchar**) &num_char_cols_opt, (uchar**) &num_char_cols_opt, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"number-int-cols", 'y',
"Number of INT columns to create table with if specifying --auto-generate-sql.",
- (gptr*) &num_int_cols_opt, (gptr*) &num_int_cols_opt, 0, GET_STR, REQUIRED_ARG,
+ (uchar**) &num_int_cols_opt, (uchar**) &num_int_cols_opt, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"number-of-queries", OPT_MYSQL_NUMBER_OF_QUERY,
"Limit each client to this number of queries (this is not exact).",
- (gptr*) &num_of_query, (gptr*) &num_of_query, 0,
+ (uchar**) &num_of_query, (uchar**) &num_of_query, 0,
GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"only-print", OPT_MYSQL_ONLY_PRINT,
"This causes mysqlslap to not connect to the databases, but instead print "
"out what it would have done instead.",
- (gptr*) &opt_only_print, (gptr*) &opt_only_print, 0, GET_BOOL, NO_ARG,
+ (uchar**) &opt_only_print, (uchar**) &opt_only_print, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
{"password", 'p',
"Password to use when connecting to server. If password is not given it's "
@@ -580,50 +611,60 @@ static struct my_option my_long_options[] =
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port,
- (gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0,
+ {"port", 'P', "Port number to use for connection.", (uchar**) &opt_mysql_port,
+ (uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0,
0},
{"post-query", OPT_SLAP_POST_QUERY,
"Query to run or file containing query to run after executing.",
- (gptr*) &user_supplied_post_statements,
- (gptr*) &user_supplied_post_statements,
+ (uchar**) &user_supplied_post_statements,
+ (uchar**) &user_supplied_post_statements,
+ 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"post-system", OPT_SLAP_POST_SYSTEM,
+ "System() string to run after the load has completed.",
+ (uchar**) &post_system,
+ (uchar**) &post_system,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"pre-query", OPT_SLAP_PRE_QUERY,
"Query to run or file containing query to run before executing.",
- (gptr*) &user_supplied_pre_statements,
- (gptr*) &user_supplied_pre_statements,
+ (uchar**) &user_supplied_pre_statements,
+ (uchar**) &user_supplied_pre_statements,
+ 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"pre-system", OPT_SLAP_PRE_SYSTEM,
+ "System() string to before load has completed.",
+ (uchar**) &pre_system,
+ (uchar**) &pre_system,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"preserve-schema", OPT_MYSQL_PRESERVE_SCHEMA,
"Preserve the schema from the mysqlslap run, this happens unless "
"--auto-generate-sql or --create are used.",
- (gptr*) &opt_preserve, (gptr*) &opt_preserve, 0, GET_BOOL,
+ (uchar**) &opt_preserve, (uchar**) &opt_preserve, 0, GET_BOOL,
NO_ARG, TRUE, 0, 0, 0, 0, 0},
{"protocol", OPT_MYSQL_PROTOCOL,
"The protocol of connection (tcp,socket,pipe,memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"query", 'q', "Query to run or file containing query to run.",
- (gptr*) &user_supplied_query, (gptr*) &user_supplied_query,
+ (uchar**) &user_supplied_query, (uchar**) &user_supplied_query,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
- "Base name of shared memory.", (gptr*) &shared_memory_base_name,
- (gptr*) &shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG,
+ "Base name of shared memory.", (uchar**) &shared_memory_base_name,
+ (uchar**) &shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
#endif
{"silent", 's', "Run program in silent mode - no output.",
- (gptr*) &opt_silent, (gptr*) &opt_silent, 0, GET_BOOL, NO_ARG,
+ (uchar**) &opt_silent, (uchar**) &opt_silent, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
{"socket", 'S', "Socket file to use for connection.",
- (gptr*) &opt_mysql_unix_port, (gptr*) &opt_mysql_unix_port, 0, GET_STR,
+ (uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#include <sslopt-longopts.h>
#ifndef DONT_ALLOW_USER_CHANGE
- {"user", 'u', "User for login if not current user.", (gptr*) &user,
- (gptr*) &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"user", 'u', "User for login if not current user.", (uchar**) &user,
+ (uchar**) &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"verbose", 'v',
"More verbose output; You can use this multiple times to get even more "
- "verbose output.", (gptr*) &verbose, (gptr*) &verbose, 0,
+ "verbose output.", (uchar**) &verbose, (uchar**) &verbose, 0,
GET_NO_ARG, NO_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},
@@ -635,7 +676,7 @@ static struct my_option my_long_options[] =
static void print_version(void)
{
- printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,SHOW_VERSION,
+ printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname, SLAP_VERSION,
MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
}
@@ -673,7 +714,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
if (argument)
{
char *start= argument;
- my_free((gptr)opt_password, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(opt_password, MYF(MY_ALLOW_ZERO_PTR));
opt_password= my_strdup(argument,MYF(MY_FAE));
while (*argument) *argument++= 'x'; /* Destroy argument */
if (*start)
@@ -694,6 +735,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
case '#':
DBUG_PUSH(argument ? argument : default_dbug_option);
+ debug_check_flag= 1;
break;
#include <sslopt-case.h>
case 'V':
@@ -1089,6 +1131,10 @@ get_options(int *argc,char ***argv)
DBUG_ENTER("get_options");
if ((ho_error= handle_options(argc, argv, my_long_options, get_one_option)))
exit(ho_error);
+ if (debug_info_flag)
+ my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO;
+ if (debug_check_flag)
+ my_end_arg= MY_CHECK_ERROR;
if (!user)
user= (char *)"root";
@@ -1308,11 +1354,11 @@ get_options(int *argc,char ***argv)
}
tmp_string= (char *)my_malloc(sbuf.st_size + 1,
MYF(MY_ZEROFILL|MY_FAE|MY_WME));
- my_read(data_file, tmp_string, sbuf.st_size, MYF(0));
+ my_read(data_file, (uchar*) tmp_string, sbuf.st_size, MYF(0));
tmp_string[sbuf.st_size]= '\0';
my_close(data_file,MYF(0));
parse_delimiter(tmp_string, &create_statements, delimiter[0]);
- my_free((gptr)tmp_string, MYF(0));
+ my_free(tmp_string, MYF(0));
}
else if (create_string)
{
@@ -1335,13 +1381,13 @@ get_options(int *argc,char ***argv)
}
tmp_string= (char *)my_malloc(sbuf.st_size + 1,
MYF(MY_ZEROFILL|MY_FAE|MY_WME));
- my_read(data_file, tmp_string, sbuf.st_size, MYF(0));
+ my_read(data_file, (uchar*) tmp_string, sbuf.st_size, MYF(0));
tmp_string[sbuf.st_size]= '\0';
my_close(data_file,MYF(0));
if (user_supplied_query)
actual_queries= parse_delimiter(tmp_string, &query_statements,
delimiter[0]);
- my_free((gptr)tmp_string, MYF(0));
+ my_free(tmp_string, MYF(0));
}
else if (user_supplied_query)
{
@@ -1366,18 +1412,19 @@ get_options(int *argc,char ***argv)
}
tmp_string= (char *)my_malloc(sbuf.st_size + 1,
MYF(MY_ZEROFILL|MY_FAE|MY_WME));
- my_read(data_file, tmp_string, sbuf.st_size, MYF(0));
+ my_read(data_file, (uchar*) tmp_string, sbuf.st_size, MYF(0));
tmp_string[sbuf.st_size]= '\0';
my_close(data_file,MYF(0));
if (user_supplied_pre_statements)
- actual_queries= parse_delimiter(tmp_string, &pre_statements,
- delimiter[0]);
- my_free((gptr)tmp_string, MYF(0));
+ (void)parse_delimiter(tmp_string, &pre_statements,
+ delimiter[0]);
+ my_free(tmp_string, MYF(0));
}
else if (user_supplied_pre_statements)
{
- actual_queries= parse_delimiter(user_supplied_pre_statements, &pre_statements,
- delimiter[0]);
+ (void)parse_delimiter(user_supplied_pre_statements,
+ &pre_statements,
+ delimiter[0]);
}
if (user_supplied_post_statements && my_stat(user_supplied_post_statements, &sbuf, MYF(0)))
@@ -1396,18 +1443,18 @@ get_options(int *argc,char ***argv)
}
tmp_string= (char *)my_malloc(sbuf.st_size + 1,
MYF(MY_ZEROFILL|MY_FAE|MY_WME));
- my_read(data_file, tmp_string, sbuf.st_size, MYF(0));
+ my_read(data_file, (uchar*) tmp_string, sbuf.st_size, MYF(0));
tmp_string[sbuf.st_size]= '\0';
my_close(data_file,MYF(0));
if (user_supplied_post_statements)
- parse_delimiter(tmp_string, &post_statements,
- delimiter[0]);
- my_free((gptr)tmp_string, MYF(0));
+ (void)parse_delimiter(tmp_string, &post_statements,
+ delimiter[0]);
+ my_free(tmp_string, MYF(0));
}
else if (user_supplied_post_statements)
{
- parse_delimiter(user_supplied_post_statements, &post_statements,
- delimiter[0]);
+ (void)parse_delimiter(user_supplied_post_statements, &post_statements,
+ delimiter[0]);
}
if (verbose >= 2)
@@ -1499,9 +1546,9 @@ drop_primary_key_list(void)
if (primary_keys_number_of)
{
for (counter= 0; counter < primary_keys_number_of; counter++)
- my_free((gptr)primary_keys[counter], MYF(0));
+ my_free(primary_keys[counter], MYF(0));
- my_free((gptr)primary_keys, MYF(0));
+ my_free(primary_keys, MYF(0));
}
return 0;
@@ -1626,6 +1673,7 @@ static int
run_statements(MYSQL *mysql, statement *stmt)
{
statement *ptr;
+ MYSQL_RES *result;
DBUG_ENTER("run_statements");
for (ptr= stmt; ptr && ptr->length; ptr= ptr->next)
@@ -1636,6 +1684,11 @@ run_statements(MYSQL *mysql, statement *stmt)
my_progname, (uint)ptr->length, ptr->string, mysql_error(mysql));
exit(1);
}
+ if (mysql_field_count(mysql))
+ {
+ result= mysql_store_result(mysql);
+ mysql_free_result(result);
+ }
}
DBUG_RETURN(0);
@@ -1713,6 +1766,7 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)
pthread_handler_t run_task(void *p)
{
ulonglong counter= 0, queries;
+ ulonglong trans_counter;
MYSQL *mysql;
MYSQL_RES *result;
MYSQL_ROW row;
@@ -1747,38 +1801,35 @@ pthread_handler_t run_task(void *p)
if (!opt_only_print)
{
- /* Connect to server */
- static ulong connection_retry_sleep= 100000; /* Microseconds */
- int i, connect_error= 1;
- for (i= 0; i < 10; i++)
- {
- if (mysql_real_connect(mysql, host, user, opt_password,
- create_schema_string,
- opt_mysql_port,
- opt_mysql_unix_port,
- connect_flags))
- {
- /* Connect suceeded */
- connect_error= 0;
- break;
- }
- my_sleep(connection_retry_sleep);
- }
- if (connect_error)
- {
- fprintf(stderr,"%s: Error when connecting to server: %d %s\n",
- my_progname, mysql_errno(mysql), mysql_error(mysql));
+ if (slap_connect(mysql))
goto end;
- }
}
+
DBUG_PRINT("info", ("connected."));
if (verbose >= 3)
printf("connected!\n");
queries= 0;
limit_not_met:
- for (ptr= con->stmt; ptr && ptr->length; ptr= ptr->next)
+ for (ptr= con->stmt, trans_counter= 0;
+ ptr && ptr->length;
+ ptr= ptr->next, trans_counter++)
{
+ if (!opt_only_print && detach_rate && !(trans_counter % detach_rate))
+ {
+ mysql_close(mysql);
+
+ if (!(mysql= mysql_init(NULL)))
+ {
+ fprintf(stderr,"%s: mysql_init() failed ERROR : %s\n",
+ my_progname, mysql_error(mysql));
+ exit(0);
+ }
+
+ if (slap_connect(mysql))
+ goto end;
+ }
+
/*
We have to execute differently based on query type. This should become a function.
*/
@@ -1835,6 +1886,9 @@ limit_not_met:
}
queries++;
+ if (commit_rate && commit_rate <= trans_counter)
+ run_query(mysql, "COMMIT", strlen("COMMIT"));
+
if (con->limit && queries == con->limit)
goto end;
}
@@ -1843,6 +1897,8 @@ limit_not_met:
goto limit_not_met;
end:
+ if (commit_rate)
+ run_query(mysql, "COMMIT", strlen("COMMIT"));
if (!opt_only_print)
mysql_close(mysql);
@@ -1959,7 +2015,6 @@ parse_delimiter(const char *script, statement **stmt, char delm)
ptr+= retstr - ptr + 1;
if (isspace(*ptr))
ptr++;
- count++;
}
if (ptr != script+length)
@@ -2033,7 +2088,7 @@ print_conclusions_csv(conclusions *con)
con->users, /* Children used */
con->avg_rows /* Queries run */
);
- my_write(csv_file, buffer, (uint)strlen(buffer), MYF(0));
+ my_write(csv_file, (uchar*) buffer, (uint)strlen(buffer), MYF(0));
}
void
@@ -2080,10 +2135,10 @@ option_cleanup(option_string *stmt)
{
nptr= ptr->next;
if (ptr->string)
- my_free((gptr)ptr->string, MYF(0));
+ my_free(ptr->string, MYF(0));
if (ptr->option)
- my_free((gptr)ptr->option, MYF(0));
- my_free((gptr)(byte *)ptr, MYF(0));
+ my_free(ptr->option, MYF(0));
+ my_free(ptr, MYF(0));
}
}
@@ -2098,7 +2153,38 @@ statement_cleanup(statement *stmt)
{
nptr= ptr->next;
if (ptr->string)
- my_free((gptr)ptr->string, MYF(0));
- my_free((gptr)(byte *)ptr, MYF(0));
+ my_free(ptr->string, MYF(0));
+ my_free(ptr, MYF(0));
}
}
+
+
+int
+slap_connect(MYSQL *mysql)
+{
+ /* Connect to server */
+ static ulong connection_retry_sleep= 100000; /* Microseconds */
+ int x, connect_error= 1;
+ for (x= 0; x < 10; x++)
+ {
+ if (mysql_real_connect(mysql, host, user, opt_password,
+ create_schema_string,
+ opt_mysql_port,
+ opt_mysql_unix_port,
+ connect_flags))
+ {
+ /* Connect suceeded */
+ connect_error= 0;
+ break;
+ }
+ my_sleep(connection_retry_sleep);
+ }
+ if (connect_error)
+ {
+ fprintf(stderr,"%s: Error when connecting to server: %d %s\n",
+ my_progname, mysql_errno(mysql), mysql_error(mysql));
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 8dc70249f60..979c8de3656 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -31,7 +31,7 @@
Holyfoot
*/
-#define MTEST_VERSION "3.2"
+#define MTEST_VERSION "3.3"
#include "client_priv.h"
#include <mysql_version.h>
@@ -60,16 +60,10 @@
#define QUERY_SEND_FLAG 1
#define QUERY_REAP_FLAG 2
- enum {
- RESULT_OK= 0,
- RESULT_CONTENT_MISMATCH= 1,
- RESULT_LENGTH_MISMATCH= 2
- };
-
enum {
OPT_SKIP_SAFEMALLOC=OPT_MAX_CLIENT_OPTION,
OPT_PS_PROTOCOL, OPT_SP_PROTOCOL, OPT_CURSOR_PROTOCOL, OPT_VIEW_PROTOCOL,
- OPT_MAX_CONNECT_RETRIES, OPT_MARK_PROGRESS, OPT_LOG_DIR
+ OPT_MAX_CONNECT_RETRIES, OPT_MARK_PROGRESS, OPT_LOG_DIR, OPT_TAIL_LINES
};
static int record= 0, opt_sleep= -1;
@@ -80,6 +74,7 @@ const char *opt_include= 0, *opt_charsets_dir;
static int opt_port= 0;
static int opt_max_connect_retries;
static my_bool opt_compress= 0, silent= 0, verbose= 0;
+static my_bool debug_info_flag= 0, debug_check_flag= 0;
static my_bool tty_password= 0;
static my_bool opt_mark_progress= 0;
static my_bool ps_protocol= 0, ps_protocol_enabled= 0;
@@ -100,6 +95,10 @@ static const char *load_default_groups[]= { "mysqltest", "client", 0 };
static char line_buffer[MAX_DELIMITER_LENGTH], *line_buffer_pos= line_buffer;
static uint start_lineno= 0; /* Start line of current command */
+static uint my_end_arg= 0;
+
+/* Number of lines of the result to include in failure report */
+static uint opt_tail_lines= 0;
static char delimiter[MAX_DELIMITER_LENGTH]= ";";
static uint delimiter_length= 1;
@@ -222,7 +221,7 @@ struct st_connection
#endif /*EMBEDDED_LIBRARY*/
};
struct st_connection connections[128];
-struct st_connection* cur_con, *next_con, *connections_end;
+struct st_connection* cur_con= NULL, *next_con, *connections_end;
/*
List of commands in mysqltest
@@ -255,7 +254,7 @@ enum enum_commands {
Q_EXEC, Q_DELIMITER,
Q_DISABLE_ABORT_ON_ERROR, Q_ENABLE_ABORT_ON_ERROR,
Q_DISPLAY_VERTICAL_RESULTS, Q_DISPLAY_HORIZONTAL_RESULTS,
- Q_QUERY_VERTICAL, Q_QUERY_HORIZONTAL, Q_QUERY_SORTED,
+ Q_QUERY_VERTICAL, Q_QUERY_HORIZONTAL, Q_SORTED_RESULT,
Q_START_TIMER, Q_END_TIMER,
Q_CHARACTER_SET, Q_DISABLE_PS_PROTOCOL, Q_ENABLE_PS_PROTOCOL,
Q_DISABLE_RECONNECT, Q_ENABLE_RECONNECT,
@@ -264,6 +263,7 @@ enum enum_commands {
Q_REPLACE_REGEX, Q_REMOVE_FILE, Q_FILE_EXIST,
Q_WRITE_FILE, Q_COPY_FILE, Q_PERL, Q_DIE, Q_EXIT, Q_SKIP,
Q_CHMOD_FILE, Q_APPEND_FILE, Q_CAT_FILE, Q_DIFF_FILES,
+ Q_SEND_QUIT,
Q_UNKNOWN, /* Unknown command. */
Q_COMMENT, /* Comments, ignored. */
@@ -325,7 +325,7 @@ const char *command_names[]=
"horizontal_results",
"query_vertical",
"query_horizontal",
- "query_sorted",
+ "sorted_result",
"start_timer",
"end_timer",
"character_set",
@@ -351,6 +351,7 @@ const char *command_names[]=
"append_file",
"cat_file",
"diff_files",
+ "send_quit",
0
};
@@ -437,7 +438,6 @@ void free_tmp_sh_file();
void free_win_path_patterns();
#endif
-static int eval_result = 0;
/* For replace_column */
static char *replace_column[MAX_COLUMNS];
@@ -480,12 +480,16 @@ void handle_error(struct st_command*,
void handle_no_error(struct st_command*);
#ifdef EMBEDDED_LIBRARY
+
+/* attributes of the query thread */
+pthread_attr_t cn_thd_attrib;
+
/*
- send_one_query executes query in separate thread what is
+ send_one_query executes query in separate thread, which is
necessary in embedded library to run 'send' in proper way.
This implementation doesn't handle errors returned
by mysql_send_query. It's technically possible, though
- i don't see where it is needed.
+ I don't see where it is needed.
*/
pthread_handler_t send_one_query(void *arg)
{
@@ -518,7 +522,7 @@ static int do_send_query(struct st_connection *cn, const char *q, int q_len,
cn->cur_query= q;
cn->cur_query_len= q_len;
cn->query_done= 0;
- if (pthread_create(&tid, NULL, send_one_query, (void*)cn))
+ if (pthread_create(&tid, &cn_thd_attrib, send_one_query, (void*)cn))
die("Cannot start new thread for query");
return 0;
@@ -586,6 +590,142 @@ void do_eval(DYNAMIC_STRING *query_eval, const char *query,
}
+/*
+ Run query and dump the result to stdout in vertical format
+
+ NOTE! This function should be safe to call when an error
+ has occured and thus any further errors will be ignored(although logged)
+
+ SYNOPSIS
+ show_query
+ mysql - connection to use
+ query - query to run
+
+*/
+
+static void show_query(MYSQL* mysql, const char* query)
+{
+ MYSQL_RES* res;
+ DBUG_ENTER("show_query");
+
+ if (!mysql)
+ DBUG_VOID_RETURN;
+
+ if (mysql_query(mysql, query))
+ {
+ log_msg("Error running query '%s': %d %s",
+ query, mysql_errno(mysql), mysql_error(mysql));
+ DBUG_VOID_RETURN;
+ }
+
+ if ((res= mysql_store_result(mysql)) == NULL)
+ {
+ /* No result set returned */
+ DBUG_VOID_RETURN;
+ }
+
+ {
+ MYSQL_ROW row;
+ unsigned int i;
+ unsigned int row_num= 0;
+ unsigned int num_fields= mysql_num_fields(res);
+ MYSQL_FIELD *fields= mysql_fetch_fields(res);
+
+ fprintf(stderr, "=== %s ===\n", query);
+ while ((row= mysql_fetch_row(res)))
+ {
+ unsigned long *lengths= mysql_fetch_lengths(res);
+ row_num++;
+
+ fprintf(stderr, "---- %d. ----\n", row_num);
+ for(i= 0; i < num_fields; i++)
+ {
+ fprintf(stderr, "%s\t%.*s\n",
+ fields[i].name,
+ (int)lengths[i], row[i] ? row[i] : "NULL");
+ }
+ }
+ for (i= 0; i < strlen(query)+8; i++)
+ fprintf(stderr, "=");
+ fprintf(stderr, "\n\n");
+ }
+ mysql_free_result(res);
+
+ DBUG_VOID_RETURN;
+}
+
+
+/*
+ Show any warnings just before the error. Since the last error
+ is added to the warning stack, only print @@warning_count-1 warnings.
+
+ NOTE! This function should be safe to call when an error
+ has occured and this any further errors will be ignored(although logged)
+
+ SYNOPSIS
+ show_warnings_before_error
+ mysql - connection to use
+
+*/
+
+static void show_warnings_before_error(MYSQL* mysql)
+{
+ MYSQL_RES* res;
+ const char* query= "SHOW WARNINGS";
+ DBUG_ENTER("show_warnings_before_error");
+
+ if (!mysql)
+ DBUG_VOID_RETURN;
+
+ if (mysql_query(mysql, query))
+ {
+ log_msg("Error running query '%s': %d %s",
+ query, mysql_errno(mysql), mysql_error(mysql));
+ DBUG_VOID_RETURN;
+ }
+
+ if ((res= mysql_store_result(mysql)) == NULL)
+ {
+ /* No result set returned */
+ DBUG_VOID_RETURN;
+ }
+
+ if (mysql_num_rows(res) <= 1)
+ {
+ /* Don't display the last row, it's "last error" */
+ }
+ else
+ {
+ MYSQL_ROW row;
+ unsigned int row_num= 0;
+ unsigned int num_fields= mysql_num_fields(res);
+
+ fprintf(stderr, "\nWarnings from just before the error:\n");
+ while ((row= mysql_fetch_row(res)))
+ {
+ unsigned int i;
+ unsigned long *lengths= mysql_fetch_lengths(res);
+
+ if (++row_num >= mysql_num_rows(res))
+ {
+ /* Don't display the last row, it's "last error" */
+ break;
+ }
+
+ for(i= 0; i < num_fields; i++)
+ {
+ fprintf(stderr, "%.*s ", (int)lengths[i],
+ row[i] ? row[i] : "NULL");
+ }
+ fprintf(stderr, "\n");
+ }
+ }
+ mysql_free_result(res);
+
+ DBUG_VOID_RETURN;
+}
+
+
enum arg_type
{
ARG_STRING,
@@ -664,6 +804,15 @@ void check_command_args(struct st_command *command,
command->first_word_len, command->query);
}
+ /* Check for too many arguments passed */
+ ptr= command->last_argument;
+ while(ptr <= command->end)
+ {
+ if (*ptr && *ptr != ' ')
+ die("Extra argument '%s' passed to '%.*s'",
+ ptr, command->first_word_len, command->query);
+ ptr++;
+ }
DBUG_VOID_RETURN;
}
@@ -747,7 +896,7 @@ void close_files()
DBUG_PRINT("info", ("closing file: %s", cur_file->file_name));
my_fclose(cur_file->file, MYF(0));
}
- my_free((gptr)cur_file->file_name, MYF(MY_ALLOW_ZERO_PTR));
+ my_free((uchar*) cur_file->file_name, MYF(MY_ALLOW_ZERO_PTR));
cur_file->file_name= 0;
}
DBUG_VOID_RETURN;
@@ -766,8 +915,8 @@ void free_used_memory()
for (i= 0 ; i < q_lines.elements ; i++)
{
struct st_command **q= dynamic_element(&q_lines, i, struct st_command**);
- my_free((gptr) (*q)->query_buf,MYF(MY_ALLOW_ZERO_PTR));
- my_free((gptr) (*q),MYF(0));
+ my_free((*q)->query_buf,MYF(MY_ALLOW_ZERO_PTR));
+ my_free((*q),MYF(0));
}
for (i= 0; i < 10; i++)
{
@@ -801,12 +950,10 @@ void free_used_memory()
static void cleanup_and_exit(int exit_code)
{
free_used_memory();
- my_end(MY_CHECK_ERROR);
+ my_end(my_end_arg);
- if (!silent)
- {
- switch (exit_code)
- {
+ if (!silent) {
+ switch (exit_code) {
case 1:
printf("not ok\n");
break;
@@ -859,6 +1006,24 @@ void die(const char *fmt, ...)
fprintf(stderr, "\n");
fflush(stderr);
+ /* Show results from queries just before failure */
+ if (ds_res.length && opt_tail_lines)
+ {
+ int tail_lines= opt_tail_lines;
+ char* show_from= ds_res.str + ds_res.length - 1;
+ while(show_from > ds_res.str && tail_lines > 0 )
+ {
+ show_from--;
+ if (*show_from == '\n')
+ tail_lines--;
+ }
+ fprintf(stderr, "\nThe result from queries just before the failure was:\n");
+ if (show_from > ds_res.str)
+ fprintf(stderr, "< snip >");
+ fprintf(stderr, "%s", show_from);
+ fflush(stderr);
+ }
+
/* Dump the result that has been accumulated so far to .log file */
if (result_file_name && ds_res.length)
dump_result_to_log_file(ds_res.str, ds_res.length);
@@ -867,6 +1032,13 @@ void die(const char *fmt, ...)
if (result_file_name && ds_warning_messages.length)
dump_warning_messages();
+ /*
+ Help debugging by displaying any warnings that might have
+ been produced prior to the error
+ */
+ if (cur_con)
+ show_warnings_before_error(&cur_con->mysql);
+
cleanup_and_exit(1);
}
@@ -970,11 +1142,10 @@ void warning_msg(const char *fmt, ...)
void log_msg(const char *fmt, ...)
{
va_list args;
- char buff[512];
+ char buff[1024];
size_t len;
DBUG_ENTER("log_msg");
- memset(buff, 0, sizeof(buff));
va_start(args, fmt);
len= my_vsnprintf(buff, sizeof(buff)-1, fmt, args);
va_end(args);
@@ -987,77 +1158,372 @@ void log_msg(const char *fmt, ...)
/*
- Compare content of the string ds to content of file fname
+ Read a file and append it to ds
+
+ SYNOPSIS
+ cat_file
+ ds - pointer to dynamic string where to add the files content
+ filename - name of the file to read
+
*/
-int dyn_string_cmp(DYNAMIC_STRING* ds, const char *fname)
+void cat_file(DYNAMIC_STRING* ds, const char* filename)
{
- MY_STAT stat_info;
- char *tmp, *res_ptr;
- char eval_file[FN_REFLEN];
- int res;
- uint res_len;
int fd;
- DYNAMIC_STRING res_ds;
- DBUG_ENTER("dyn_string_cmp");
+ uint len;
+ char buff[512];
- if (!test_if_hard_path(fname))
+ if ((fd= my_open(filename, O_RDONLY, MYF(0))) < 0)
+ die("Failed to open file '%s'", filename);
+ while((len= my_read(fd, (uchar*)&buff,
+ sizeof(buff), MYF(0))) > 0)
{
- strxmov(eval_file, opt_basedir, fname, NullS);
- fn_format(eval_file, eval_file, "", "", MY_UNPACK_FILENAME);
+ char *p= buff, *start= buff;
+ while (p < buff+len)
+ {
+ /* Convert cr/lf to lf */
+ if (*p == '\r' && *(p+1) && *(p+1)== '\n')
+ {
+ /* Add fake newline instead of cr and output the line */
+ *p= '\n';
+ p++; /* Step past the "fake" newline */
+ dynstr_append_mem(ds, start, p-start);
+ p++; /* Step past the "fake" newline */
+ start= p;
+ }
+ else
+ p++;
+ }
+ /* Output any chars that migh be left */
+ dynstr_append_mem(ds, start, p-start);
}
- else
- fn_format(eval_file, fname, "", "", MY_UNPACK_FILENAME);
+ my_close(fd, MYF(0));
+}
- if (!my_stat(eval_file, &stat_info, MYF(MY_WME)))
- die(NullS);
- if (!eval_result && (uint) stat_info.st_size != ds->length)
+
+/*
+ Run the specified command with popen
+
+ SYNOPSIS
+ run_command
+ cmd - command to execute(should be properly quoted
+ ds_res- pointer to dynamic string where to store the result
+
+*/
+
+static int run_command(char* cmd,
+ DYNAMIC_STRING *ds_res)
+{
+ char buf[512]= {0};
+ FILE *res_file;
+ int error;
+
+ if (!(res_file= popen(cmd, "r")))
+ die("popen(\"%s\", \"r\") failed", cmd);
+
+ while (fgets(buf, sizeof(buf), res_file))
{
- DBUG_PRINT("info",("Size differs: result size: %u file size: %lu",
- ds->length, (ulong) stat_info.st_size));
- DBUG_PRINT("info",("result: '%s'", ds->str));
- DBUG_RETURN(RESULT_LENGTH_MISMATCH);
+ DBUG_PRINT("info", ("buf: %s", buf));
+ if(ds_res)
+ {
+ /* Save the output of this command in the supplied string */
+ dynstr_append(ds_res, buf);
+ }
+ else
+ {
+ /* Print it directly on screen */
+ fprintf(stdout, "%s", buf);
+ }
}
- if (!(tmp = (char*) my_malloc(stat_info.st_size + 1, MYF(MY_WME))))
+
+ error= pclose(res_file);
+ return WEXITSTATUS(error);
+}
+
+
+/*
+ Run the specified tool with variable number of arguments
+
+ SYNOPSIS
+ run_tool
+ tool_path - the name of the tool to run
+ ds_res - pointer to dynamic string where to store the result
+ ... - variable number of arguments that will be properly
+ quoted and appended after the tool's name
+
+*/
+
+static int run_tool(const char *tool_path, DYNAMIC_STRING *ds_res, ...)
+{
+ int ret;
+ const char* arg;
+ va_list args;
+ DYNAMIC_STRING ds_cmdline;
+
+ DBUG_ENTER("run_tool");
+ DBUG_PRINT("enter", ("tool_path: %s", tool_path));
+
+ if (init_dynamic_string(&ds_cmdline, IF_WIN("\"", ""), FN_REFLEN, FN_REFLEN))
+ die("Out of memory");
+
+ dynstr_append_os_quoted(&ds_cmdline, tool_path, NullS);
+ dynstr_append(&ds_cmdline, " ");
+
+ va_start(args, ds_res);
+
+ while ((arg= va_arg(args, char *)))
+ {
+ /* Options should be os quoted */
+ if (strncmp(arg, "--", 2) == 0)
+ dynstr_append_os_quoted(&ds_cmdline, arg, NullS);
+ else
+ dynstr_append(&ds_cmdline, arg);
+ dynstr_append(&ds_cmdline, " ");
+ }
+
+ va_end(args);
+
+#ifdef __WIN__
+ dynstr_append(&ds_cmdline, "\"");
+#endif
+
+ DBUG_PRINT("info", ("Running: %s", ds_cmdline.str));
+ ret= run_command(ds_cmdline.str, ds_res);
+ DBUG_PRINT("exit", ("ret: %d", ret));
+ dynstr_free(&ds_cmdline);
+ DBUG_RETURN(ret);
+}
+
+
+/*
+ Show the diff of two files using the systems builtin diff
+ command. If no such diff command exist, just dump the content
+ of the two files and inform about how to get "diff"
+
+ SYNOPSIS
+ show_diff
+ ds - pointer to dynamic string where to add the diff(may be NULL)
+ filename1 - name of first file
+ filename2 - name of second file
+
+*/
+
+void show_diff(DYNAMIC_STRING* ds,
+ const char* filename1, const char* filename2)
+{
+
+ DYNAMIC_STRING ds_tmp;
+
+ if (init_dynamic_string(&ds_tmp, "", 256, 256))
die("Out of memory");
- if ((fd = my_open(eval_file, O_RDONLY, MYF(MY_WME))) < 0)
- die("Failed to open file %s", eval_file);
- if (my_read(fd, (byte*)tmp, stat_info.st_size, MYF(MY_WME|MY_NABP)))
- die("Failed to read from file %s, errno: %d", eval_file, errno);
- tmp[stat_info.st_size] = 0;
- init_dynamic_string(&res_ds, "", stat_info.st_size+256, 256);
- if (eval_result)
- {
- do_eval(&res_ds, tmp, tmp + stat_info.st_size, FALSE);
- res_ptr= res_ds.str;
- res_len= res_ds.length;
- if (res_len != ds->length)
+ /* First try with unified diff */
+ if (run_tool("diff",
+ &ds_tmp, /* Get output from diff in ds_tmp */
+ "-u",
+ filename1,
+ filename2,
+ "2>&1",
+ NULL) > 1) /* Most "diff" tools return >1 if error */
+ {
+ dynstr_set(&ds_tmp, "");
+
+ /* Fallback to context diff with "diff -c" */
+ if (run_tool("diff",
+ &ds_tmp, /* Get output from diff in ds_tmp */
+ "-c",
+ filename1,
+ filename2,
+ "2>&1",
+ NULL) > 1) /* Most "diff" tools return >1 if error */
{
- res= RESULT_LENGTH_MISMATCH;
- goto err;
+ /*
+ Fallback to dump both files to result file and inform
+ about installing "diff"
+ */
+ dynstr_set(&ds_tmp, "");
+
+ dynstr_append(&ds_tmp,
+"\n"
+"The two files differ but it was not possible to execute 'diff' in\n"
+"order to show only the difference, tried both 'diff -u' or 'diff -c'.\n"
+"Instead the whole content of the two files was shown for you to diff manually. ;)\n\n"
+"To get a better report you should install 'diff' on your system, which you\n"
+"for example can get from http://www.gnu.org/software/diffutils/diffutils.html\n"
+#ifdef __WIN__
+"or http://gnuwin32.sourceforge.net/packages/diffutils.htm\n"
+#endif
+"\n");
+
+ dynstr_append(&ds_tmp, " --- ");
+ dynstr_append(&ds_tmp, filename1);
+ dynstr_append(&ds_tmp, " >>>\n");
+ cat_file(&ds_tmp, filename1);
+ dynstr_append(&ds_tmp, "<<<\n --- ");
+ dynstr_append(&ds_tmp, filename1);
+ dynstr_append(&ds_tmp, " >>>\n");
+ cat_file(&ds_tmp, filename2);
+ dynstr_append(&ds_tmp, "<<<<\n");
}
}
+
+ if (ds)
+ {
+ /* Add the diff to output */
+ dynstr_append_mem(ds, ds_tmp.str, ds_tmp.length);
+ }
else
{
- res_ptr = tmp;
- res_len = stat_info.st_size;
+ /* Print diff directly to stdout */
+ fprintf(stderr, "%s\n", ds_tmp.str);
}
+
+ dynstr_free(&ds_tmp);
- res= (memcmp(res_ptr, ds->str, res_len)) ?
- RESULT_CONTENT_MISMATCH : RESULT_OK;
+}
-err:
- if (res && eval_result)
- str_to_file(fn_format(eval_file, fname, "", ".eval",
- MY_REPLACE_EXT),
- res_ptr, res_len);
- dynstr_free(&res_ds);
- my_free((gptr) tmp, MYF(0));
- my_close(fd, MYF(MY_WME));
+enum compare_files_result_enum {
+ RESULT_OK= 0,
+ RESULT_CONTENT_MISMATCH= 1,
+ RESULT_LENGTH_MISMATCH= 2
+};
+
+/*
+ Compare two files, given a fd to the first file and
+ name of the second file
- DBUG_RETURN(res);
+ SYNOPSIS
+ compare_files2
+ fd - Open file descriptor of the first file
+ filename2 - Name of second file
+
+ RETURN VALUES
+ According to the values in "compare_files_result_enum"
+
+*/
+
+int compare_files2(File fd, const char* filename2)
+{
+ int error= RESULT_OK;
+ File fd2;
+ uint len, len2;
+ char buff[512], buff2[512];
+
+ if ((fd2= my_open(filename2, O_RDONLY, MYF(0))) < 0)
+ {
+ my_close(fd, MYF(0));
+ die("Failed to open second file: '%s'", filename2);
+ }
+ while((len= my_read(fd, (uchar*)&buff,
+ sizeof(buff), MYF(0))) > 0)
+ {
+ if ((len2= my_read(fd2, (uchar*)&buff2,
+ sizeof(buff2), MYF(0))) < len)
+ {
+ /* File 2 was smaller */
+ error= RESULT_LENGTH_MISMATCH;
+ break;
+ }
+ if (len2 > len)
+ {
+ /* File 1 was smaller */
+ error= RESULT_LENGTH_MISMATCH;
+ break;
+ }
+ if ((memcmp(buff, buff2, len)))
+ {
+ /* Content of this part differed */
+ error= RESULT_CONTENT_MISMATCH;
+ break;
+ }
+ }
+ if (!error && my_read(fd2, (uchar*)&buff2,
+ sizeof(buff2), MYF(0)) > 0)
+ {
+ /* File 1 was smaller */
+ error= RESULT_LENGTH_MISMATCH;
+ }
+
+ my_close(fd2, MYF(0));
+
+ return error;
+}
+
+
+/*
+ Compare two files, given their filenames
+
+ SYNOPSIS
+ compare_files
+ filename1 - Name of first file
+ filename2 - Name of second file
+
+ RETURN VALUES
+ See 'compare_files2'
+
+*/
+
+int compare_files(const char* filename1, const char* filename2)
+{
+ File fd;
+ int error;
+
+ if ((fd= my_open(filename1, O_RDONLY, MYF(0))) < 0)
+ die("Failed to open first file: '%s'", filename1);
+
+ error= compare_files2(fd, filename2);
+
+ my_close(fd, MYF(0));
+
+ return error;
+}
+
+
+/*
+ Compare content of the string in ds to content of file fname
+
+ SYNOPSIS
+ dyn_string_cmp
+ ds - Dynamic string containing the string o be compared
+ fname - Name of file to compare with
+
+ RETURN VALUES
+ See 'compare_files2'
+*/
+
+int dyn_string_cmp(DYNAMIC_STRING* ds, const char *fname)
+{
+ int error;
+ File fd;
+ char temp_file_path[FN_REFLEN];
+
+ DBUG_ENTER("dyn_string_cmp");
+ DBUG_PRINT("enter", ("fname: %s", fname));
+
+ if ((fd= create_temp_file(temp_file_path, NULL,
+ "tmp", O_CREAT | O_SHARE | O_RDWR,
+ MYF(MY_WME))) < 0)
+ die("Failed to create temporary file for ds");
+
+ /* Write ds to temporary file and set file pos to beginning*/
+ if (my_write(fd, ds->str, ds->length,
+ MYF(MY_FNABP | MY_WME)) ||
+ my_seek(fd, 0, SEEK_SET, MYF(0)) == MY_FILEPOS_ERROR)
+ {
+ my_close(fd, MYF(0));
+ /* Remove the temporary file */
+ my_delete(temp_file_path, MYF(0));
+ die("Failed to write file '%s'", temp_file_path);
+ }
+
+ error= compare_files2(fd, fname);
+
+ my_close(fd, MYF(0));
+ /* Remove the temporary file */
+ my_delete(temp_file_path, MYF(0));
+
+ DBUG_RETURN(error);
}
@@ -1075,21 +1541,39 @@ err:
void check_result(DYNAMIC_STRING* ds)
{
+ const char* mess= "Result content mismatch\n";
+
DBUG_ENTER("check_result");
DBUG_ASSERT(result_file_name);
+ DBUG_PRINT("enter", ("result_file_name: %s", result_file_name));
- switch (dyn_string_cmp(ds, result_file_name))
- {
+ if (access(result_file_name, F_OK) != 0)
+ die("The specified result file does not exist: '%s'", result_file_name);
+
+ switch (dyn_string_cmp(ds, result_file_name)) {
case RESULT_OK:
break; /* ok */
case RESULT_LENGTH_MISMATCH:
- dump_result_to_reject_file(ds->str, ds->length);
- die("Result length mismatch");
- break;
+ mess= "Result length mismatch\n";
+ /* Fallthrough */
case RESULT_CONTENT_MISMATCH:
- dump_result_to_reject_file(ds->str, ds->length);
- die("Result content mismatch");
+ {
+ /*
+ Result mismatched, dump results to .reject file
+ and then show the diff
+ */
+ char reject_file[FN_REFLEN];
+ str_to_file(fn_format(reject_file, result_file_name, opt_logdir, ".reject",
+ *opt_logdir ? MY_REPLACE_DIR | MY_REPLACE_EXT :
+ MY_REPLACE_EXT),
+ ds->str, ds->length);
+
+ dynstr_set(ds, NULL); /* Don't create a .log file */
+
+ show_diff(NULL, result_file_name, reject_file);
+ die(mess);
break;
+ }
default: /* impossible */
die("Unknown error code from dyn_string_cmp()");
}
@@ -1104,7 +1588,7 @@ void check_result(DYNAMIC_STRING* ds)
indicating that test is not supported
SYNOPSIS
- check_result
+ check_require
ds - content to be checked
fname - name of file to check against
@@ -1127,13 +1611,57 @@ void check_require(DYNAMIC_STRING* ds, const char *fname)
}
-static byte *get_var_key(const byte* var, uint* len,
- my_bool __attribute__((unused)) t)
+/*
+ Remove surrounding chars from string
+
+ Return 1 if first character is found but not last
+*/
+static int strip_surrounding(char* str, char c1, char c2)
+{
+ char* ptr= str;
+
+ /* Check if the first non space character is c1 */
+ while(*ptr && my_isspace(charset_info, *ptr))
+ ptr++;
+ if (*ptr == c1)
+ {
+ /* Replace it with a space */
+ *ptr= ' ';
+
+ /* Last non space charecter should be c2 */
+ ptr= strend(str)-1;
+ while(*ptr && my_isspace(charset_info, *ptr))
+ ptr--;
+ if (*ptr == c2)
+ {
+ /* Replace it with \0 */
+ *ptr= 0;
+ }
+ else
+ {
+ /* Mismatch detected */
+ return 1;
+ }
+ }
+ return 0;
+}
+
+
+static void strip_parentheses(struct st_command *command)
+{
+ if (strip_surrounding(command->first_argument, '(', ')'))
+ die("%.*s - argument list started with '%c' must be ended with '%c'",
+ command->first_word_len, command->query, '(', ')');
+}
+
+
+static uchar *get_var_key(const uchar* var, size_t *len,
+ my_bool __attribute__((unused)) t)
{
register char* key;
key = ((VAR*)var)->name;
*len = ((VAR*)var)->name_len;
- return (byte*)key;
+ return (uchar*)key;
}
@@ -1177,7 +1705,7 @@ void var_free(void *v)
{
my_free(((VAR*) v)->str_val, MYF(MY_WME));
if (((VAR*)v)->alloced)
- my_free((char*) v, MYF(MY_WME));
+ my_free(v, MYF(MY_WME));
}
@@ -1189,7 +1717,7 @@ VAR* var_from_env(const char *name, const char *def_val)
tmp = def_val;
v = var_init(0, name, strlen(name), tmp, strlen(tmp));
- my_hash_insert(&var_hash, (byte*)v);
+ my_hash_insert(&var_hash, (uchar*)v);
return v;
}
@@ -1222,7 +1750,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, save_var_name, length)))
+ if (!(v = (VAR*) hash_search(&var_hash, (const uchar*) save_var_name,
+ length)))
{
char buff[MAX_VAR_NAME_LENGTH+1];
strmake(buff, save_var_name, length);
@@ -1253,10 +1782,10 @@ err:
VAR *var_obtain(const char *name, int len)
{
VAR* v;
- if ((v = (VAR*)hash_search(&var_hash, name, len)))
+ if ((v = (VAR*)hash_search(&var_hash, (const uchar *) name, len)))
return v;
v = var_init(0, name, len, "", 0);
- my_hash_insert(&var_hash, (byte*)v);
+ my_hash_insert(&var_hash, (uchar*)v);
return v;
}
@@ -1308,7 +1837,7 @@ void var_set(const char *var_name, const char *var_name_end,
if (!(v->env_s= my_strdup(buf, MYF(MY_WME))))
die("Out of memory");
putenv(v->env_s);
- my_free((gptr)old_env_s, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(old_env_s, MYF(MY_ALLOW_ZERO_PTR));
}
DBUG_VOID_RETURN;
}
@@ -1382,48 +1911,29 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
init_dynamic_string(&ds_query, 0, (end - query) + 32, 256);
do_eval(&ds_query, query, end, FALSE);
- if (mysql_real_query(mysql, ds_query.str, ds_query.length) ||
- !(res = mysql_store_result(mysql)))
- {
+ if (mysql_real_query(mysql, ds_query.str, ds_query.length))
die("Error running query '%s': %d %s", ds_query.str,
mysql_errno(mysql), mysql_error(mysql));
- }
+ if (!(res= mysql_store_result(mysql)))
+ die("Query '%s' didn't return a result set", ds_query.str);
dynstr_free(&ds_query);
- if ((row = mysql_fetch_row(res)) && row[0])
+ if ((row= mysql_fetch_row(res)) && row[0])
{
/*
- Concatenate all row results with tab in between to allow us to work
- with results from many columns (for example from SHOW VARIABLES)
+ Concatenate all fields in the first row with tab in between
+ and assign that string to the $variable
*/
DYNAMIC_STRING result;
uint i;
ulong *lengths;
-#ifdef NOT_YET
- MYSQL_FIELD *fields= mysql_fetch_fields(res);
-#endif
- init_dynamic_string(&result, "", 2048, 2048);
+ init_dynamic_string(&result, "", 512, 512);
lengths= mysql_fetch_lengths(res);
- for (i=0; i < mysql_num_fields(res); i++)
+ for (i= 0; i < mysql_num_fields(res); i++)
{
- if (row[0])
+ if (row[i])
{
-#ifdef NOT_YET
- /* Add to <var_name>_<col_name> */
- uint j;
- char var_col_name[MAX_VAR_NAME_LENGTH];
- uint length= snprintf(var_col_name, MAX_VAR_NAME_LENGTH,
- "$%s_%s", var->name, fields[i].name);
- /* Convert characters not allowed in variable names to '_' */
- for (j= 1; j < length; j++)
- {
- if (!my_isvar(charset_info,var_col_name[j]))
- var_col_name[j]= '_';
- }
- var_set(var_col_name, var_col_name + length,
- row[i], row[i] + lengths[i]);
-#endif
/* Add column to tab separated string */
dynstr_append_mem(&result, row[i], lengths[i]);
}
@@ -1441,6 +1951,130 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
}
+/*
+ Set variable from the result of a field in a query
+
+ This function is useful when checking for a certain value
+ in the output from a query that can't be restricted to only
+ return some values. A very good example of that is most SHOW
+ commands.
+
+ SYNOPSIS
+ var_set_query_get_value()
+
+ DESCRIPTION
+ let $variable= query_get_value(<query to run>,<column name>,<row no>);
+
+ <query to run> - The query that should be sent to the server
+ <column name> - Name of the column that holds the field be compared
+ against the expected value
+ <row no> - Number of the row that holds the field to be
+ compared against the expected value
+
+*/
+
+void var_set_query_get_value(struct st_command *command, VAR *var)
+{
+ long row_no;
+ int col_no= -1;
+ MYSQL_RES* res;
+ MYSQL* mysql= &cur_con->mysql;
+
+ static DYNAMIC_STRING ds_query;
+ static DYNAMIC_STRING ds_col;
+ static DYNAMIC_STRING ds_row;
+ const struct command_arg query_get_value_args[] = {
+ "query", ARG_STRING, TRUE, &ds_query, "Query to run",
+ "column name", ARG_STRING, TRUE, &ds_col, "Name of column",
+ "row number", ARG_STRING, TRUE, &ds_row, "Number for row",
+ };
+
+ DBUG_ENTER("var_set_query_get_value");
+ LINT_INIT(res);
+
+ strip_parentheses(command);
+ DBUG_PRINT("info", ("query: %s", command->query));
+ check_command_args(command, command->first_argument, query_get_value_args,
+ sizeof(query_get_value_args)/sizeof(struct command_arg),
+ ',');
+
+ DBUG_PRINT("info", ("query: %s", ds_query.str));
+ DBUG_PRINT("info", ("col: %s", ds_col.str));
+
+ /* Convert row number to int */
+ if (!str2int(ds_row.str, 10, (long) 0, (long) INT_MAX, &row_no))
+ die("Invalid row number: '%s'", ds_row.str);
+ DBUG_PRINT("info", ("row: %s, row_no: %ld", ds_row.str, row_no));
+ dynstr_free(&ds_row);
+
+ /* Remove any surrounding "'s from the query - if there is any */
+ if (strip_surrounding(ds_query.str, '"', '"'))
+ die("Mismatched \"'s around query '%s'", ds_query.str);
+
+ /* Run the query */
+ if (mysql_real_query(mysql, ds_query.str, ds_query.length))
+ die("Error running query '%s': %d %s", ds_query.str,
+ mysql_errno(mysql), mysql_error(mysql));
+ if (!(res= mysql_store_result(mysql)))
+ die("Query '%s' didn't return a result set", ds_query.str);
+
+ {
+ /* Find column number from the given column name */
+ uint i;
+ uint num_fields= mysql_num_fields(res);
+ MYSQL_FIELD *fields= mysql_fetch_fields(res);
+
+ for (i= 0; i < num_fields; i++)
+ {
+ if (strcmp(fields[i].name, ds_col.str) == 0 &&
+ strlen(fields[i].name) == ds_col.length)
+ {
+ col_no= i;
+ break;
+ }
+ }
+ if (col_no == -1)
+ {
+ mysql_free_result(res);
+ die("Could not find column '%s' in the result of '%s'",
+ ds_col.str, ds_query.str);
+ }
+ DBUG_PRINT("info", ("Found column %d with name '%s'",
+ i, fields[i].name));
+ }
+ dynstr_free(&ds_col);
+
+ {
+ /* Get the value */
+ MYSQL_ROW row;
+ long rows= 0;
+ const char* value= "No such row";
+
+ while ((row= mysql_fetch_row(res)))
+ {
+ if (++rows == row_no)
+ {
+
+ DBUG_PRINT("info", ("At row %ld, column %d is '%s'",
+ row_no, col_no, row[col_no]));
+ /* Found the row to get */
+ if (row[col_no])
+ value= row[col_no];
+ else
+ value= "NULL";
+
+ break;
+ }
+ }
+ eval_expr(var, value, 0);
+ }
+ dynstr_free(&ds_query);
+ mysql_free_result(res);
+
+ DBUG_VOID_RETURN;
+}
+
+
void var_copy(VAR *dest, VAR *src)
{
dest->int_val= src->int_val;
@@ -1464,26 +2098,47 @@ void var_copy(VAR *dest, VAR *src)
void eval_expr(VAR *v, const char *p, const char **p_end)
{
- static int MIN_VAR_ALLOC= 32; /* MASV why 32? */
- VAR *vp;
+
+ DBUG_ENTER("eval_expr");
+ DBUG_PRINT("enter", ("p: '%s'", p));
+
if (*p == '$')
{
+ VAR *vp;
if ((vp= var_get(p, p_end, 0, 0)))
- {
var_copy(v, vp);
- return;
- }
+ DBUG_VOID_RETURN;
}
- else if (*p == '`')
+
+ if (*p == '`')
{
var_query_set(v, p, p_end);
+ DBUG_VOID_RETURN;
}
- else
+
+ {
+ /* Check if this is a "let $var= query_get_value()" */
+ const char* get_value_str= "query_get_value";
+ const size_t len= strlen(get_value_str);
+ if (strncmp(p, get_value_str, len)==0)
+ {
+ struct st_command command;
+ memset(&command, 0, sizeof(command));
+ command.query= (char*)p;
+ command.first_word_len= len;
+ command.first_argument= command.query + len;
+ command.end= (char*)*p_end;
+ var_set_query_get_value(&command, v);
+ DBUG_VOID_RETURN;
+ }
+ }
+
{
int new_val_len = (p_end && *p_end) ?
(int) (*p_end - p) : (int) strlen(p);
if (new_val_len + 1 >= v->alloced_len)
{
+ static int MIN_VAR_ALLOC= 32;
v->alloced_len = (new_val_len < MIN_VAR_ALLOC - 1) ?
MIN_VAR_ALLOC : new_val_len + 1;
if (!(v->str_val =
@@ -1496,9 +2151,10 @@ void eval_expr(VAR *v, const char *p, const char **p_end)
memcpy(v->str_val, p, new_val_len);
v->str_val[new_val_len] = 0;
v->int_val=atoi(p);
+ DBUG_PRINT("info", ("atoi on '%s', returns: %d", p, v->int_val));
v->int_dirty=0;
}
- return;
+ DBUG_VOID_RETURN;
}
@@ -1520,7 +2176,7 @@ int open_file(const char *name)
if (!(cur_file->file = my_fopen(buff, O_RDONLY | FILE_BINARY, MYF(0))))
{
cur_file--;
- die("Could not open file %s", buff);
+ die("Could not open file '%s'", buff);
}
cur_file->file_name= my_strdup(buff, MYF(MY_FAE));
cur_file->lineno=1;
@@ -1546,7 +2202,7 @@ void do_source(struct st_command *command)
{
static DYNAMIC_STRING ds_filename;
const struct command_arg source_args[] = {
- "filename", ARG_STRING, TRUE, &ds_filename, "File to source"
+ { "filename", ARG_STRING, TRUE, &ds_filename, "File to source" }
};
DBUG_ENTER("do_source");
@@ -1613,9 +2269,10 @@ FILE* my_popen(DYNAMIC_STRING *ds_cmd, const char *mode)
static void init_builtin_echo(void)
{
#ifdef __WIN__
+ size_t echo_length;
/* Look for "echo.exe" in same dir as mysqltest was started from */
- dirname_part(builtin_echo, my_progname);
+ dirname_part(builtin_echo, my_progname, &echo_length);
fn_format(builtin_echo, ".\\echo.exe",
builtin_echo, "", MYF(MY_REPLACE_DIR));
@@ -1732,7 +2389,10 @@ void do_exec(struct st_command *command)
command->first_argument, ds_cmd.str));
if (!(res_file= my_popen(&ds_cmd, "r")) && command->abort_on_error)
+ {
+ dynstr_free(&ds_cmd);
die("popen(\"%s\", \"r\") failed", command->first_argument);
+ }
while (fgets(buf, sizeof(buf), res_file))
{
@@ -1754,8 +2414,9 @@ void do_exec(struct st_command *command)
if (command->abort_on_error)
{
- log_msg("exec of '%s failed, error: %d, status: %d, errno: %d",
+ log_msg("exec of '%s' failed, error: %d, status: %d, errno: %d",
ds_cmd.str, error, status, errno);
+ dynstr_free(&ds_cmd);
die("command \"%s\" failed", command->first_argument);
}
@@ -1774,8 +2435,11 @@ void do_exec(struct st_command *command)
}
}
if (!ok)
+ {
+ dynstr_free(&ds_cmd);
die("command \"%s\" failed with wrong error: %d",
command->first_argument, status);
+ }
}
else if (command->expected_errors.err[0].type == ERR_ERRNO &&
command->expected_errors.err[0].code.errnum != 0)
@@ -1783,6 +2447,7 @@ void do_exec(struct st_command *command)
/* Error code we wanted was != 0, i.e. not an expected success */
log_msg("exec of '%s failed, error: %d, errno: %d",
ds_cmd.str, error, errno);
+ dynstr_free(&ds_cmd);
die("command \"%s\" succeeded - should have failed with errno %d...",
command->first_argument, command->expected_errors.err[0].code.errnum);
}
@@ -1932,7 +2597,7 @@ void do_remove_file(struct st_command *command)
int error;
static DYNAMIC_STRING ds_filename;
const struct command_arg rm_args[] = {
- "filename", ARG_STRING, TRUE, &ds_filename, "File to delete"
+ { "filename", ARG_STRING, TRUE, &ds_filename, "File to delete" }
};
DBUG_ENTER("do_remove_file");
@@ -1966,8 +2631,8 @@ void do_copy_file(struct st_command *command)
static DYNAMIC_STRING ds_from_file;
static DYNAMIC_STRING ds_to_file;
const struct command_arg copy_file_args[] = {
- "from_file", ARG_STRING, TRUE, &ds_from_file, "Filename to copy from",
- "to_file", ARG_STRING, TRUE, &ds_to_file, "Filename to copy to"
+ { "from_file", ARG_STRING, TRUE, &ds_from_file, "Filename to copy from" },
+ { "to_file", ARG_STRING, TRUE, &ds_to_file, "Filename to copy to" }
};
DBUG_ENTER("do_copy_file");
@@ -1992,8 +2657,8 @@ void do_copy_file(struct st_command *command)
command command handle
DESCRIPTION
- chmod <octal> <file>
- Change file permission of <file>
+ chmod_file <octal> <file_name>
+ Change file permission of <file_name>
*/
@@ -2003,8 +2668,8 @@ void do_chmod_file(struct st_command *command)
static DYNAMIC_STRING ds_mode;
static DYNAMIC_STRING ds_file;
const struct command_arg chmod_file_args[] = {
- "mode", ARG_STRING, TRUE, &ds_mode, "Mode of file",
- "file", ARG_STRING, TRUE, &ds_file, "Filename of file to modify"
+ { "mode", ARG_STRING, TRUE, &ds_mode, "Mode of file(octal) ex. 0660"},
+ { "filename", ARG_STRING, TRUE, &ds_file, "Filename of file to modify" }
};
DBUG_ENTER("do_chmod_file");
@@ -2041,7 +2706,7 @@ void do_file_exist(struct st_command *command)
int error;
static DYNAMIC_STRING ds_filename;
const struct command_arg file_exist_args[] = {
- "filename", ARG_STRING, TRUE, &ds_filename, "File to check if it exist"
+ { "filename", ARG_STRING, TRUE, &ds_filename, "File to check if it exist" }
};
DBUG_ENTER("do_file_exist");
@@ -2087,8 +2752,8 @@ void read_until_delimiter(DYNAMIC_STRING *ds,
{
char c;
DBUG_ENTER("read_until_delimiter");
- DBUG_PRINT("enter", ("delimiter: %s, length: %d",
- ds_delimiter->str, ds_delimiter->length));
+ DBUG_PRINT("enter", ("delimiter: %s, length: %u",
+ ds_delimiter->str, (uint) ds_delimiter->length));
if (ds_delimiter->length > MAX_DELIMITER_LENGTH)
die("Max delimiter length(%d) exceeded", MAX_DELIMITER_LENGTH);
@@ -2099,8 +2764,22 @@ void read_until_delimiter(DYNAMIC_STRING *ds,
c= my_getc(cur_file->file);
if (c == '\n')
+ {
cur_file->lineno++;
+ /* Skip newline from the same line as the command */
+ if (start_lineno == (cur_file->lineno - 1))
+ continue;
+ }
+ else if (start_lineno == cur_file->lineno)
+ {
+ /*
+ No characters except \n are allowed on
+ the same line as the command
+ */
+ die("Trailing characters found after command");
+ }
+
if (feof(cur_file->file))
die("End of file encountered before '%s' delimiter was found",
ds_delimiter->str);
@@ -2123,8 +2802,8 @@ void do_write_file_command(struct st_command *command, my_bool append)
static DYNAMIC_STRING ds_filename;
static DYNAMIC_STRING ds_delimiter;
const struct command_arg write_file_args[] = {
- "filename", ARG_STRING, TRUE, &ds_filename, "File to write to",
- "delimiter", ARG_STRING, FALSE, &ds_delimiter, "Delimiter to read until"
+ { "filename", ARG_STRING, TRUE, &ds_filename, "File to write to" },
+ { "delimiter", ARG_STRING, FALSE, &ds_delimiter, "Delimiter to read until" }
};
DBUG_ENTER("do_write_file");
@@ -2138,6 +2817,12 @@ void do_write_file_command(struct st_command *command, my_bool append)
if (ds_delimiter.length == 0)
dynstr_set(&ds_delimiter, "EOF");
+ if (!append && access(ds_filename.str, F_OK) == 0)
+ {
+ /* The file should not be overwritten */
+ die("File already exist: '%s'", ds_filename.str);
+ }
+
init_dynamic_string(&ds_content, "", 1024, 1024);
read_until_delimiter(&ds_content, &ds_delimiter);
DBUG_PRINT("info", ("Writing to file: %s", ds_filename.str));
@@ -2170,7 +2855,7 @@ void do_write_file_command(struct st_command *command, my_bool append)
Write everything between the "write_file" command and 'delimiter'
to "file_name"
- NOTE! Overwrites existing file
+ NOTE! Will fail if <file_name> exists
Default <delimiter> is EOF
@@ -2227,12 +2912,9 @@ void do_append_file(struct st_command *command)
void do_cat_file(struct st_command *command)
{
- int fd;
- uint len;
- char buff[512];
static DYNAMIC_STRING ds_filename;
const struct command_arg cat_file_args[] = {
- "filename", ARG_STRING, TRUE, &ds_filename, "File to read from"
+ { "filename", ARG_STRING, TRUE, &ds_filename, "File to read from" }
};
DBUG_ENTER("do_cat_file");
@@ -2244,37 +2926,13 @@ void do_cat_file(struct st_command *command)
DBUG_PRINT("info", ("Reading from, file: %s", ds_filename.str));
- if ((fd= my_open(ds_filename.str, O_RDONLY, MYF(0))) < 0)
- die("Failed to open file %s", ds_filename.str);
- while((len= my_read(fd, (byte*)&buff,
- sizeof(buff), MYF(0))) > 0)
- {
- char *p= buff, *start= buff;
- while (p < buff+len)
- {
- /* Convert cr/lf to lf */
- if (*p == '\r' && *(p+1) && *(p+1)== '\n')
- {
- /* Add fake newline instead of cr and output the line */
- *p= '\n';
- p++; /* Step past the "fake" newline */
- dynstr_append_mem(&ds_res, start, p-start);
- p++; /* Step past the "fake" newline */
- start= p;
- }
- else
- p++;
- }
- /* Output any chars that migh be left */
- dynstr_append_mem(&ds_res, start, p-start);
- }
- my_close(fd, MYF(0));
+ cat_file(&ds_res, ds_filename.str);
+
dynstr_free(&ds_filename);
DBUG_VOID_RETURN;
}
-
/*
SYNOPSIS
do_diff_files
@@ -2290,14 +2948,11 @@ void do_cat_file(struct st_command *command)
void do_diff_files(struct st_command *command)
{
int error= 0;
- int fd, fd2;
- uint len, len2;
- char buff[512], buff2[512];
static DYNAMIC_STRING ds_filename;
static DYNAMIC_STRING ds_filename2;
const struct command_arg diff_file_args[] = {
- "file1", ARG_STRING, TRUE, &ds_filename, "First file to diff",
- "file2", ARG_STRING, TRUE, &ds_filename2, "Second file to diff"
+ { "file1", ARG_STRING, TRUE, &ds_filename, "First file to diff" },
+ { "file2", ARG_STRING, TRUE, &ds_filename2, "Second file to diff" }
};
DBUG_ENTER("do_diff_files");
@@ -2307,45 +2962,72 @@ void do_diff_files(struct st_command *command)
sizeof(diff_file_args)/sizeof(struct command_arg),
' ');
- if ((fd= my_open(ds_filename.str, O_RDONLY, MYF(0))) < 0)
- die("Failed to open first file %s", ds_filename.str);
- if ((fd2= my_open(ds_filename2.str, O_RDONLY, MYF(0))) < 0)
+ if ((error= compare_files(ds_filename.str, ds_filename2.str)))
{
- my_close(fd, MYF(0));
- die("Failed to open second file %s", ds_filename2.str);
+ /* Compare of the two files failed, append them to output
+ so the failure can be analyzed
+ */
+ show_diff(&ds_res, ds_filename.str, ds_filename2.str);
}
- while((len= my_read(fd, (byte*)&buff,
- sizeof(buff), MYF(0))) > 0)
+
+ dynstr_free(&ds_filename);
+ dynstr_free(&ds_filename2);
+ handle_command_error(command, error);
+ DBUG_VOID_RETURN;
+}
+
+
+struct st_connection * find_connection_by_name(const char *name)
+{
+ struct st_connection *con;
+ for (con= connections; con < next_con; con++)
{
- if ((len2= my_read(fd2, (byte*)&buff2,
- sizeof(buff2), MYF(0))) != len)
- {
- /* File 2 was smaller */
- error= 1;
- break;
- }
- if ((memcmp(buff, buff2, len)))
+ if (!strcmp(con->name, name))
{
- /* Content of this part differed */
- error= 1;
- break;
+ return con;
}
}
- if (my_read(fd2, (byte*)&buff2,
- sizeof(buff2), MYF(0)) > 0)
- {
- /* File 1 was smaller */
- error= 1;
- }
+ return 0; /* Connection not found */
+}
+
+
+/*
+ SYNOPSIS
+ do_send_quit
+ command called command
+
+ DESCRIPTION
+ Sends a simple quit command to the server for the named connection.
+
+*/
+
+void do_send_quit(struct st_command *command)
+{
+ char *p= command->first_argument, *name;
+ struct st_connection *con;
+
+ DBUG_ENTER("do_send_quit");
+ DBUG_PRINT("enter",("name: '%s'",p));
+
+ if (!*p)
+ die("Missing connection name in send_quit");
+ name= p;
+ while (*p && !my_isspace(charset_info,*p))
+ p++;
+
+ if (*p)
+ *p++= 0;
+ command->last_argument= p;
+
+ if (!(con= find_connection_by_name(name)))
+ die("connection '%s' not found in connection pool", name);
+
+ simple_command(&con->mysql,COM_QUIT,0,0,1);
- my_close(fd, MYF(0));
- my_close(fd2, MYF(0));
- dynstr_free(&ds_filename);
- dynstr_free(&ds_filename2);
- handle_command_error(command, error);
DBUG_VOID_RETURN;
}
+
/*
SYNOPSIS
do_perl
@@ -2368,12 +3050,14 @@ void do_diff_files(struct st_command *command)
void do_perl(struct st_command *command)
{
int error;
- char buf[FN_REFLEN];
+ File fd;
FILE *res_file;
+ char buf[FN_REFLEN];
+ char temp_file_path[FN_REFLEN];
static DYNAMIC_STRING ds_script;
static DYNAMIC_STRING ds_delimiter;
const struct command_arg perl_args[] = {
- "delimiter", ARG_STRING, FALSE, &ds_delimiter, "Delimiter to read until"
+ { "delimiter", ARG_STRING, FALSE, &ds_delimiter, "Delimiter to read until" }
};
DBUG_ENTER("do_perl");
@@ -2392,14 +3076,17 @@ void do_perl(struct st_command *command)
DBUG_PRINT("info", ("Executing perl: %s", ds_script.str));
- /* Format a name for a tmp .pl file that is unique for this process */
- my_snprintf(buf, sizeof(buf), "%s/tmp/tmp_%d.pl",
- getenv("MYSQLTEST_VARDIR"), getpid());
- str_to_file(buf, ds_script.str, ds_script.length);
+ /* Create temporary file name */
+ if ((fd= create_temp_file(temp_file_path, getenv("MYSQLTEST_VARDIR"),
+ "tmp", O_CREAT | O_SHARE | O_RDWR,
+ MYF(MY_WME))) < 0)
+ die("Failed to create temporary file for perl command");
+ my_close(fd, MYF(0));
+
+ str_to_file(temp_file_path, ds_script.str, ds_script.length);
- /* Format the perl <filename> command */
- my_snprintf(buf, sizeof(buf), "perl %s/tmp/tmp_%d.pl",
- getenv("MYSQLTEST_VARDIR"), getpid());
+ /* Format the "perl <filename>" command */
+ my_snprintf(buf, sizeof(buf), "perl %s", temp_file_path);
if (!(res_file= popen(buf, "r")) && command->abort_on_error)
die("popen(\"%s\", \"r\") failed", buf);
@@ -2417,6 +3104,10 @@ void do_perl(struct st_command *command)
}
}
error= pclose(res_file);
+
+ /* Remove the temporary file */
+ my_delete(temp_file_path, MYF(0));
+
handle_command_error(command, WEXITSTATUS(error));
dynstr_free(&ds_script);
dynstr_free(&ds_delimiter);
@@ -2531,7 +3222,11 @@ wait_for_position:
*/
mysql_free_result(res);
if (tries++ == 30)
+ {
+ show_query(mysql, "SHOW MASTER STATUS");
+ show_query(mysql, "SHOW SLAVE STATUS");
die("could not sync with master ('%s' returned NULL)", query_buf);
+ }
sleep(1); /* So at most we will wait 30 seconds and make 31 tries */
goto wait_for_position;
}
@@ -3170,20 +3865,6 @@ void set_reconnect(MYSQL* mysql, int val)
}
-struct st_connection * find_connection_by_name(const char *name)
-{
- struct st_connection *con;
- for (con= connections; con < next_con; con++)
- {
- if (!strcmp(con->name, name))
- {
- return con;
- }
- }
- return 0; /* Connection not found */
-}
-
-
int select_connection_name(const char *name)
{
DBUG_ENTER("select_connection_name");
@@ -3231,45 +3912,40 @@ void do_close_connection(struct st_command *command)
*p++= 0;
command->last_argument= p;
- /* Loop through connection pool for connection to close */
- for (con= connections; con < next_con; con++)
+ if (!(con= find_connection_by_name(name)))
+ die("connection '%s' not found in connection pool", name);
+
+ DBUG_PRINT("info", ("Closing connection %s", con->name));
+#ifndef EMBEDDED_LIBRARY
+ if (command->type == Q_DIRTY_CLOSE)
{
- DBUG_PRINT("info", ("con->name: %s", con->name));
- if (!strcmp(con->name, name))
+ if (con->mysql.net.vio)
{
- DBUG_PRINT("info", ("Closing connection %s", con->name));
-#ifndef EMBEDDED_LIBRARY
- if (command->type == Q_DIRTY_CLOSE)
- {
- if (con->mysql.net.vio)
- {
- vio_delete(con->mysql.net.vio);
- con->mysql.net.vio = 0;
- }
- }
+ vio_delete(con->mysql.net.vio);
+ con->mysql.net.vio = 0;
+ }
+ }
#endif
- if (next_con->stmt)
- mysql_stmt_close(next_con->stmt);
- next_con->stmt= 0;
+ if (con->stmt)
+ mysql_stmt_close(con->stmt);
+ con->stmt= 0;
- mysql_close(&con->mysql);
- if (con->util_mysql)
- mysql_close(con->util_mysql);
- con->util_mysql= 0;
- my_free(con->name, MYF(0));
+ mysql_close(&con->mysql);
- /*
- When the connection is closed set name to "closed_connection"
- to make it possible to reuse the connection name.
- The connection slot will not be reused
- */
- if (!(con->name = my_strdup("closed_connection", MYF(MY_WME))))
- die("Out of memory");
+ if (con->util_mysql)
+ mysql_close(con->util_mysql);
+ con->util_mysql= 0;
- DBUG_VOID_RETURN;
- }
- }
- die("connection '%s' not found in connection pool", name);
+ my_free(con->name, MYF(0));
+
+ /*
+ When the connection is closed set name to "-closed_connection-"
+ to make it possible to reuse the connection name.
+ */
+ if (!(con->name = my_strdup("-closed_connection-", MYF(MY_WME))))
+ die("Out of memory");
+
+ DBUG_VOID_RETURN;
}
@@ -3441,7 +4117,7 @@ void do_connect(struct st_command *command)
int con_port= opt_port;
char *con_options;
bool con_ssl= 0, con_compress= 0;
- char *ptr;
+ struct st_connection* con_slot;
static DYNAMIC_STRING ds_connection_name;
static DYNAMIC_STRING ds_host;
@@ -3452,37 +4128,20 @@ void do_connect(struct st_command *command)
static DYNAMIC_STRING ds_sock;
static DYNAMIC_STRING ds_options;
const struct command_arg connect_args[] = {
- "connection name", ARG_STRING, TRUE, &ds_connection_name,
- "Name of the connection",
- "host", ARG_STRING, TRUE, &ds_host, "Host to connect to",
- "user", ARG_STRING, FALSE, &ds_user, "User to connect as",
- "passsword", ARG_STRING, FALSE, &ds_password,
- "Password used when connecting",
- "database", ARG_STRING, FALSE, &ds_database,
- "Dtabase to select after connect",
- "port", ARG_STRING, FALSE, &ds_port, "Port to connect to",
- "socket", ARG_STRING, FALSE, &ds_sock, "Socket to connect with",
- "options", ARG_STRING, FALSE, &ds_options,
- "Options to use while connecting"
+ { "connection name", ARG_STRING, TRUE, &ds_connection_name, "Name of the connection" },
+ { "host", ARG_STRING, TRUE, &ds_host, "Host to connect to" },
+ { "user", ARG_STRING, FALSE, &ds_user, "User to connect as" },
+ { "passsword", ARG_STRING, FALSE, &ds_password, "Password used when connecting" },
+ { "database", ARG_STRING, FALSE, &ds_database, "Database to select after connect" },
+ { "port", ARG_STRING, FALSE, &ds_port, "Port to connect to" },
+ { "socket", ARG_STRING, FALSE, &ds_sock, "Socket to connect with" },
+ { "options", ARG_STRING, FALSE, &ds_options, "Options to use while connecting" }
};
DBUG_ENTER("do_connect");
DBUG_PRINT("enter",("connect: %s", command->first_argument));
- /* Remove parenteses around connect arguments */
- if ((ptr= strstr(command->first_argument, "(")))
- {
- /* Replace it with a space */
- *ptr= ' ';
- if ((ptr= strstr(command->first_argument, ")")))
- {
- /* Replace it with \0 */
- *ptr= 0;
- }
- else
- die("connect - argument list started with '(' must be ended with ')'");
- }
-
+ strip_parentheses(command);
check_command_args(command, command->first_argument, connect_args,
sizeof(connect_args)/sizeof(struct command_arg),
',');
@@ -3540,33 +4199,38 @@ void do_connect(struct st_command *command)
con_options= end;
}
- if (next_con == connections_end)
- die("Connection limit exhausted, you can have max %d connections",
- (int) (sizeof(connections)/sizeof(struct st_connection)));
-
if (find_connection_by_name(ds_connection_name.str))
die("Connection %s already exists", ds_connection_name.str);
+
+ if (next_con != connections_end)
+ con_slot= next_con;
+ else
+ {
+ if (!(con_slot= find_connection_by_name("-closed_connection-")))
+ die("Connection limit exhausted, you can have max %d connections",
+ (int) (sizeof(connections)/sizeof(struct st_connection)));
+ }
- if (!mysql_init(&next_con->mysql))
+ if (!mysql_init(&con_slot->mysql))
die("Failed on mysql_init()");
if (opt_compress || con_compress)
- mysql_options(&next_con->mysql, MYSQL_OPT_COMPRESS, NullS);
- mysql_options(&next_con->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
- mysql_options(&next_con->mysql, MYSQL_SET_CHARSET_NAME,
+ mysql_options(&con_slot->mysql, MYSQL_OPT_COMPRESS, NullS);
+ mysql_options(&con_slot->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
+ mysql_options(&con_slot->mysql, MYSQL_SET_CHARSET_NAME,
charset_info->csname);
if (opt_charsets_dir)
- mysql_options(&cur_con->mysql, MYSQL_SET_CHARSET_DIR,
+ mysql_options(&con_slot->mysql, MYSQL_SET_CHARSET_DIR,
opt_charsets_dir);
#ifdef HAVE_OPENSSL
if (opt_use_ssl || con_ssl)
{
- mysql_ssl_set(&next_con->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
+ mysql_ssl_set(&con_slot->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
#if MYSQL_VERSION_ID >= 50000
/* Turn on ssl_verify_server_cert only if host is "localhost" */
opt_ssl_verify_server_cert= !strcmp(ds_host.str, "localhost");
- mysql_options(&next_con->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
+ mysql_options(&con_slot->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
&opt_ssl_verify_server_cert);
#endif
}
@@ -3580,16 +4244,19 @@ void do_connect(struct st_command *command)
if (ds_database.length && !strcmp(ds_database.str,"*NO-ONE*"))
dynstr_set(&ds_database, "");
- if (connect_n_handle_errors(command, &next_con->mysql,
+ if (connect_n_handle_errors(command, &con_slot->mysql,
ds_host.str,ds_user.str,
ds_password.str, ds_database.str,
con_port, ds_sock.str))
{
DBUG_PRINT("info", ("Inserting connection %s in connection pool",
ds_connection_name.str));
- if (!(next_con->name= my_strdup(ds_connection_name.str, MYF(MY_WME))))
+ if (!(con_slot->name= my_strdup(ds_connection_name.str, MYF(MY_WME))))
die("Out of memory");
- cur_con= next_con++;
+ cur_con= con_slot;
+
+ if (con_slot == next_con)
+ next_con++; /* if we used the next_con slot, advance the pointer */
}
dynstr_free(&ds_connection_name);
@@ -3823,7 +4490,7 @@ int read_line(char *buf, int size)
my_fclose(cur_file->file, MYF(0));
cur_file->file= 0;
}
- my_free((gptr)cur_file->file_name, MYF(MY_ALLOW_ZERO_PTR));
+ my_free((uchar*) cur_file->file_name, MYF(MY_ALLOW_ZERO_PTR));
cur_file->file_name= 0;
if (cur_file == file_stack)
{
@@ -4165,7 +4832,7 @@ void check_eol_junk(const char *eol)
terminated by new line '\n' regardless how many "delimiter" it contain.
*/
-#define MAX_QUERY (256*1024) /* 256K -- a test in sp-big is >128K */
+#define MAX_QUERY (256*1024*2) /* 256K -- a test in sp-big is >128K */
static char read_command_buf[MAX_QUERY];
int read_command(struct st_command** command_ptr)
@@ -4176,20 +4843,16 @@ int read_command(struct st_command** command_ptr)
if (parser.current_line < parser.read_lines)
{
- get_dynamic(&q_lines, (gptr) command_ptr, parser.current_line) ;
+ get_dynamic(&q_lines, (uchar*) command_ptr, parser.current_line) ;
DBUG_RETURN(0);
}
if (!(*command_ptr= command=
- (struct st_command*) my_malloc(sizeof(*command), MYF(MY_WME))) ||
- insert_dynamic(&q_lines, (gptr) &command))
+ (struct st_command*) my_malloc(sizeof(*command),
+ MYF(MY_WME|MY_ZEROFILL))) ||
+ insert_dynamic(&q_lines, (uchar*) &command))
die(NullS);
-
- command->require_file[0]= 0;
- command->first_word_len= 0;
- command->query_len= 0;
-
command->type= Q_UNKNOWN;
- command->query_buf= command->query= 0;
+
read_command_buf[0]= 0;
if (read_line(read_command_buf, sizeof(read_command_buf)))
{
@@ -4217,9 +4880,13 @@ int read_command(struct st_command** command_ptr)
if (!(command->query_buf= command->query= my_strdup(p, MYF(MY_WME))))
die("Out of memory");
- /* Calculate first word and first argument */
- for (p= command->query; *p && !my_isspace(charset_info, *p) ; p++) ;
+ /* Calculate first word length(the command), terminated by space or ( */
+ p= command->query;
+ while (*p && !my_isspace(charset_info, *p) && *p != '(')
+ p++;
command->first_word_len= (uint) (p - command->query);
+ DBUG_PRINT("info", ("first_word: %.*s",
+ command->first_word_len, command->query));
/* Skip spaces between command and first argument */
while (*p && my_isspace(charset_info, *p))
@@ -4237,18 +4904,18 @@ 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},
- {"basedir", 'b', "Basedir for tests.", (gptr*) &opt_basedir,
- (gptr*) &opt_basedir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"basedir", 'b', "Basedir for tests.", (uchar**) &opt_basedir,
+ (uchar**) &opt_basedir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
- "Directory where character sets are.", (gptr*) &opt_charsets_dir,
- (gptr*) &opt_charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Directory where character sets are.", (uchar**) &opt_charsets_dir,
+ (uchar**) &opt_charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"compress", 'C', "Use the compressed server/client protocol.",
- (gptr*) &opt_compress, (gptr*) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+ (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"cursor-protocol", OPT_CURSOR_PROTOCOL, "Use cursors for prepared statements.",
- (gptr*) &cursor_protocol, (gptr*) &cursor_protocol, 0,
+ (uchar**) &cursor_protocol, (uchar**) &cursor_protocol, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"database", 'D', "Database to use.", (gptr*) &opt_db, (gptr*) &opt_db, 0,
+ {"database", 'D', "Database to use.", (uchar**) &opt_db, (uchar**) &opt_db, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef DBUG_OFF
{"debug", '#', "This is a non-debug version. Catch this and exit",
@@ -4257,52 +4924,62 @@ static struct my_option my_long_options[] =
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"host", 'h', "Connect to host.", (gptr*) &opt_host, (gptr*) &opt_host, 0,
+ {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .",
+ (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+ GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
+ (uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
+ 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"host", 'h', "Connect to host.", (uchar**) &opt_host, (uchar**) &opt_host, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"include", 'i', "Include SQL before each test case.", (gptr*) &opt_include,
- (gptr*) &opt_include, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"logdir", OPT_LOG_DIR, "Directory for log files", (gptr*) &opt_logdir,
- (gptr*) &opt_logdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"include", 'i', "Include SQL before each test case.", (uchar**) &opt_include,
+ (uchar**) &opt_include, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"logdir", OPT_LOG_DIR, "Directory for log files", (uchar**) &opt_logdir,
+ (uchar**) &opt_logdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"mark-progress", OPT_MARK_PROGRESS,
"Write linenumber and elapsed time to <testname>.progress ",
- (gptr*) &opt_mark_progress, (gptr*) &opt_mark_progress, 0,
+ (uchar**) &opt_mark_progress, (uchar**) &opt_mark_progress, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"max-connect-retries", OPT_MAX_CONNECT_RETRIES,
"Max number of connection attempts when connecting to server",
- (gptr*) &opt_max_connect_retries, (gptr*) &opt_max_connect_retries, 0,
+ (uchar**) &opt_max_connect_retries, (uchar**) &opt_max_connect_retries, 0,
GET_INT, REQUIRED_ARG, 500, 1, 10000, 0, 0, 0},
{"password", 'p', "Password to use when connecting to server.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
- {"port", 'P', "Port number to use for connection.", (gptr*) &opt_port,
- (gptr*) &opt_port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"port", 'P', "Port number to use for connection.", (uchar**) &opt_port,
+ (uchar**) &opt_port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"ps-protocol", OPT_PS_PROTOCOL, "Use prepared statements protocol for communication",
- (gptr*) &ps_protocol, (gptr*) &ps_protocol, 0,
+ (uchar**) &ps_protocol, (uchar**) &ps_protocol, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"quiet", 's', "Suppress all normal output.", (gptr*) &silent,
- (gptr*) &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"quiet", 's', "Suppress all normal output.", (uchar**) &silent,
+ (uchar**) &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"record", 'r', "Record output of test_file into result file.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"result-file", 'R', "Read/Store result from/in this file.",
- (gptr*) &result_file_name, (gptr*) &result_file_name, 0,
+ (uchar**) &result_file_name, (uchar**) &result_file_name, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"server-arg", 'A', "Send option value to embedded server as a parameter.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"server-file", 'F', "Read embedded server arguments from file.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"silent", 's', "Suppress all normal output. Synonym for --quiet.",
- (gptr*) &silent, (gptr*) &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ (uchar**) &silent, (uchar**) &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"skip-safemalloc", OPT_SKIP_SAFEMALLOC,
"Don't use the memory allocation checking.", 0, 0, 0, GET_NO_ARG, NO_ARG,
0, 0, 0, 0, 0, 0},
{"sleep", 'T', "Sleep always this many seconds on sleep commands.",
- (gptr*) &opt_sleep, (gptr*) &opt_sleep, 0, GET_INT, REQUIRED_ARG, -1, 0, 0,
+ (uchar**) &opt_sleep, (uchar**) &opt_sleep, 0, GET_INT, REQUIRED_ARG, -1, 0, 0,
0, 0, 0},
{"socket", 'S', "Socket file to use for connection.",
- (gptr*) &unix_sock, (gptr*) &unix_sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
+ (uchar**) &unix_sock, (uchar**) &unix_sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
0, 0, 0},
{"sp-protocol", OPT_SP_PROTOCOL, "Use stored procedures for select",
- (gptr*) &sp_protocol, (gptr*) &sp_protocol, 0,
+ (uchar**) &sp_protocol, (uchar**) &sp_protocol, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"tail-lines", OPT_TAIL_LINES,
+ "Number of lines of the resul to include in a failure report",
+ (uchar**) &opt_tail_lines, (uchar**) &opt_tail_lines, 0,
+ GET_INT, REQUIRED_ARG, 0, 0, 10000, 0, 0, 0},
#include "sslopt-longopts.h"
{"test-file", 'x', "Read test from/in this file (default stdin).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -4310,14 +4987,14 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"tmpdir", 't', "Temporary directory where sockets are put.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"user", 'u', "User for login.", (gptr*) &opt_user, (gptr*) &opt_user, 0,
+ {"user", 'u', "User for login.", (uchar**) &opt_user, (uchar**) &opt_user, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"verbose", 'v', "Write more.", (gptr*) &verbose, (gptr*) &verbose, 0,
+ {"verbose", 'v', "Write more.", (uchar**) &verbose, (uchar**) &verbose, 0,
GET_BOOL, NO_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},
{"view-protocol", OPT_VIEW_PROTOCOL, "Use views for select",
- (gptr*) &view_protocol, (gptr*) &view_protocol, 0,
+ (uchar**) &view_protocol, (uchar**) &view_protocol, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -4369,7 +5046,7 @@ void read_embedded_server_arguments(const char *name)
embedded_server_args[0]= (char*) ""; /* Progname */
}
if (!(file=my_fopen(buff, O_RDONLY | FILE_BINARY, MYF(MY_WME))))
- die("Failed to open file %s", buff);
+ die("Failed to open file '%s'", buff);
while (embedded_server_arg_count < MAX_EMBEDDED_SERVER_ARGS &&
(str=fgets(argument,sizeof(argument), file)))
@@ -4400,6 +5077,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case '#':
#ifndef DBUG_OFF
DBUG_PUSH(argument ? argument : "d:t:S:i:O,/tmp/mysqltest.trace");
+ debug_check_flag= 1;
#endif
break;
case 'r':
@@ -4499,6 +5177,10 @@ int parse_args(int argc, char **argv)
opt_db= *argv;
if (tty_password)
opt_pass= get_tty_password(NullS); /* purify tested */
+ if (debug_info_flag)
+ my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO;
+ if (debug_check_flag)
+ my_end_arg= MY_CHECK_ERROR;
return 0;
}
@@ -4533,7 +5215,7 @@ void str_to_file2(const char *fname, char *str, int size, my_bool append)
die("Could not open %s: errno = %d", buff, errno);
if (append && my_seek(fd, 0, SEEK_END, MYF(0)) == MY_FILEPOS_ERROR)
die("Could not find end of file %s: errno = %d", buff, errno);
- if (my_write(fd, (byte*)str, size, MYF(MY_WME|MY_FNABP)))
+ if (my_write(fd, (uchar*)str, size, MYF(MY_WME|MY_FNABP)))
die("write failed");
my_close(fd, MYF(0));
}
@@ -4554,14 +5236,6 @@ void str_to_file(const char *fname, char *str, int size)
}
-void dump_result_to_reject_file(char *buf, int size)
-{
- char reject_file[FN_REFLEN];
- str_to_file(fn_format(reject_file, result_file_name, "", ".reject",
- MY_REPLACE_EXT),
- buf, size);
-}
-
void dump_result_to_log_file(char *buf, int size)
{
char log_file[FN_REFLEN];
@@ -4569,6 +5243,8 @@ void dump_result_to_log_file(char *buf, int size)
*opt_logdir ? MY_REPLACE_DIR | MY_REPLACE_EXT :
MY_REPLACE_EXT),
buf, size);
+ fprintf(stderr, "\nMore results from queries before failure can be found in %s\n",
+ log_file);
}
void dump_progress(void)
@@ -4650,7 +5326,7 @@ void init_win_path_patterns()
continue;
}
- if (insert_dynamic(&patterns, (gptr) &p))
+ if (insert_dynamic(&patterns, (uchar*) &p))
die(NullS);
DBUG_PRINT("info", ("p: %s", p));
@@ -4670,7 +5346,7 @@ void free_win_path_patterns()
for (i=0 ; i < patterns.elements ; i++)
{
const char** pattern= dynamic_element(&patterns, i, const char**);
- my_free((gptr) *pattern, MYF(0));
+ my_free((char*) *pattern, MYF(0));
}
delete_dynamic(&patterns);
}
@@ -4852,12 +5528,12 @@ void append_stmt_result(DYNAMIC_STRING *ds, MYSQL_STMT *stmt,
for (i= 0; i < num_fields; i++)
{
/* Free data for output */
- my_free((gptr)my_bind[i].buffer, MYF(MY_WME | MY_FAE));
+ my_free(my_bind[i].buffer, MYF(MY_WME | MY_FAE));
}
/* Free array with bind structs, lengths and NULL flags */
- my_free((gptr)my_bind , MYF(MY_WME | MY_FAE));
- my_free((gptr)length , MYF(MY_WME | MY_FAE));
- my_free((gptr)is_null , MYF(MY_WME | MY_FAE));
+ my_free(my_bind , MYF(MY_WME | MY_FAE));
+ my_free(length , MYF(MY_WME | MY_FAE));
+ my_free(is_null , MYF(MY_WME | MY_FAE));
}
@@ -5152,11 +5828,8 @@ end:
ds - dynamic string which is used for output buffer
NOTE
- If there is an unexpected error this function will abort mysqltest
- immediately.
-
- RETURN VALUE
- error - function will not return
+ If there is an unexpected error this function will abort mysqltest
+ immediately.
*/
void handle_error(struct st_command *command,
@@ -5553,7 +6226,7 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
init_dynamic_string(&ds_warnings, NULL, 0, 256);
- /* Scan for warning before sendign to server */
+ /* Scan for warning before sending to server */
scan_command_for_warnings(command);
/*
@@ -5985,7 +6658,12 @@ int main(int argc, char **argv)
connections_end= connections +
(sizeof(connections)/sizeof(struct st_connection)) - 1;
next_con= connections + 1;
- cur_con= connections;
+
+#ifdef EMBEDDED_LIBRARY
+ /* set appropriate stack for the 'query' threads */
+ (void) pthread_attr_init(&cn_thd_attrib);
+ pthread_attr_setstacksize(&cn_thd_attrib, DEFAULT_THREAD_STACK);
+#endif /*EMBEDDED_LIBRARY*/
/* Init file stack */
memset(file_stack, 0, sizeof(file_stack));
@@ -6028,6 +6706,11 @@ int main(int argc, char **argv)
init_dynamic_string(&ds_warning_messages, "", 0, 2048);
parse_args(argc, argv);
+ var_set_int("$PS_PROTOCOL", ps_protocol);
+ var_set_int("$SP_PROTOCOL", sp_protocol);
+ var_set_int("$VIEW_PROTOCOL", view_protocol);
+ var_set_int("$CURSOR_PROTOCOL", cursor_protocol);
+
DBUG_PRINT("info",("result_file: '%s'",
result_file_name ? result_file_name : ""));
if (mysql_server_init(embedded_server_arg_count,
@@ -6050,6 +6733,7 @@ int main(int argc, char **argv)
if (cursor_protocol_enabled)
ps_protocol_enabled= 1;
+ cur_con= connections;
if (!( mysql_init(&cur_con->mysql)))
die("Failed in mysql_init()");
if (opt_compress)
@@ -6151,6 +6835,7 @@ int main(int argc, char **argv)
case Q_WRITE_FILE: do_write_file(command); break;
case Q_APPEND_FILE: do_append_file(command); break;
case Q_DIFF_FILES: do_diff_files(command); break;
+ case Q_SEND_QUIT: do_send_quit(command); break;
case Q_CAT_FILE: do_cat_file(command); break;
case Q_COPY_FILE: do_copy_file(command); break;
case Q_CHMOD_FILE: do_chmod_file(command); break;
@@ -6164,13 +6849,19 @@ int main(int argc, char **argv)
case Q_DISPLAY_HORIZONTAL_RESULTS:
display_result_vertically= FALSE;
break;
+ case Q_SORTED_RESULT:
+ /*
+ Turn on sorting of result set, will be reset after next
+ command
+ */
+ display_result_sorted= TRUE;
+ break;
case Q_LET: do_let(command); break;
case Q_EVAL_RESULT:
- eval_result = 1; break;
+ die("'eval_result' command is deprecated");
case Q_EVAL:
case Q_QUERY_VERTICAL:
case Q_QUERY_HORIZONTAL:
- case Q_QUERY_SORTED:
if (command->query == command->query_buf)
{
/* Skip the first part of command, i.e query_xxx */
@@ -6182,7 +6873,6 @@ int main(int argc, char **argv)
case Q_REAP:
{
my_bool old_display_result_vertically= display_result_vertically;
- my_bool old_display_result_sorted= display_result_sorted;
/* Default is full query, both reap and send */
int flags= QUERY_REAP_FLAG | QUERY_SEND_FLAG;
@@ -6199,7 +6889,6 @@ int main(int argc, char **argv)
/* Check for special property for this query */
display_result_vertically|= (command->type == Q_QUERY_VERTICAL);
- display_result_sorted= (command->type == Q_QUERY_SORTED);
if (save_file[0])
{
@@ -6212,7 +6901,6 @@ int main(int argc, char **argv)
/* Restore settings */
display_result_vertically= old_display_result_vertically;
- display_result_sorted= old_display_result_sorted;
break;
}
@@ -6373,6 +7061,9 @@ int main(int argc, char **argv)
the replace structures should be cleared
*/
free_all_replace();
+
+ /* Also reset "sorted_result" */
+ display_result_sorted= FALSE;
}
last_command_executed= command_executed;
@@ -6554,15 +7245,15 @@ void free_replace_column()
typedef struct st_pointer_array { /* when using array-strings */
TYPELIB typelib; /* Pointer to strings */
- byte *str; /* Strings is here */
+ uchar *str; /* Strings is here */
int7 *flag; /* Flag about each var. */
uint array_allocs,max_count,length,max_length;
} POINTER_ARRAY;
struct st_replace;
-struct st_replace *init_replace(my_string *from, my_string *to, uint count,
- my_string word_end_chars);
-int insert_pointer_name(reg1 POINTER_ARRAY *pa,my_string name);
+struct st_replace *init_replace(char * *from, char * *to, uint count,
+ char * word_end_chars);
+int insert_pointer_name(reg1 POINTER_ARRAY *pa,char * name);
void replace_strings_append(struct st_replace *rep, DYNAMIC_STRING* ds,
const char *from, int len);
void free_pointer_array(POINTER_ARRAY *pa);
@@ -6626,7 +7317,7 @@ void free_replace()
DBUG_ENTER("free_replace");
if (glob_replace)
{
- my_free((char*) glob_replace,MYF(0));
+ my_free(glob_replace,MYF(0));
glob_replace=0;
}
DBUG_VOID_RETURN;
@@ -6837,7 +7528,7 @@ struct st_replace_regex* init_replace_regex(char* expr)
reg.icase= 1;
/* done parsing the statement, now place it in regex_arr */
- if (insert_dynamic(&res->regex_arr,(gptr) &reg))
+ if (insert_dynamic(&res->regex_arr,(uchar*) &reg))
die("Out of memory");
}
res->odd_buf_len= res->even_buf_len= 8192;
@@ -6848,7 +7539,7 @@ struct st_replace_regex* init_replace_regex(char* expr)
return res;
err:
- my_free((gptr)res,0);
+ my_free(res,0);
die("Error parsing replace_regex \"%s\"", expr);
return 0;
}
@@ -6889,7 +7580,7 @@ int multi_reg_replace(struct st_replace_regex* r,char* val)
struct st_regex re;
char* save_out_buf= out_buf;
- get_dynamic(&r->regex_arr,(gptr)&re,i);
+ get_dynamic(&r->regex_arr,(uchar*)&re,i);
if (!reg_replace(&out_buf, buf_len_p, re.pattern, re.replace,
in_buf, re.icase))
@@ -6942,7 +7633,7 @@ void free_replace_regex()
delete_dynamic(&glob_replace_regex->regex_arr);
my_free(glob_replace_regex->even_buf,MYF(MY_ALLOW_ZERO_PTR));
my_free(glob_replace_regex->odd_buf,MYF(MY_ALLOW_ZERO_PTR));
- my_free((char*) glob_replace_regex,MYF(0));
+ my_free(glob_replace_regex,MYF(0));
glob_replace_regex=0;
}
}
@@ -7137,7 +7828,7 @@ int reg_replace(char** buf_p, int* buf_len_p, char *pattern,
str_p= str_end;
}
}
- my_free((gptr)subs, MYF(0));
+ my_free(subs, MYF(0));
my_regfree(&r);
*res_p= 0;
*buf_p= buf;
@@ -7197,13 +7888,13 @@ int get_next_bit(REP_SET *set,uint lastpos);
int find_set(REP_SETS *sets,REP_SET *find);
int find_found(FOUND_SET *found_set,uint table_offset,
int found_offset);
-uint start_at_word(my_string pos);
-uint end_of_word(my_string pos);
+uint start_at_word(char * pos);
+uint end_of_word(char * pos);
static uint found_sets=0;
-uint replace_len(my_string str)
+uint replace_len(char * str)
{
uint len=0;
while (*str)
@@ -7218,8 +7909,8 @@ uint replace_len(my_string str)
/* Init a replace structure for further calls */
-REPLACE *init_replace(my_string *from, my_string *to,uint count,
- my_string word_end_chars)
+REPLACE *init_replace(char * *from, char * *to,uint count,
+ char * word_end_chars)
{
static const int SPACE_CHAR= 256;
static const int START_OF_LINE= 257;
@@ -7228,7 +7919,7 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count,
uint i,j,states,set_nr,len,result_len,max_length,found_end,bits_set,bit_nr;
int used_sets,chr,default_state;
char used_chars[LAST_CHAR_CODE],is_word_end[256];
- my_string pos,to_pos,*to_array;
+ char * pos, *to_pos, **to_array;
REP_SETS sets;
REP_SET *set,*start_states,*word_states,*new_set;
FOLLOWS *follow,*follow_ptr;
@@ -7273,7 +7964,7 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count,
if (!(follow=(FOLLOWS*) my_malloc((states+2)*sizeof(FOLLOWS),MYF(MY_WME))))
{
free_sets(&sets);
- my_free((gptr) found_set,MYF(0));
+ my_free(found_set,MYF(0));
DBUG_RETURN(0);
}
@@ -7464,12 +8155,12 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count,
if ((replace=(REPLACE*) my_malloc(sizeof(REPLACE)*(sets.count)+
sizeof(REPLACE_STRING)*(found_sets+1)+
- sizeof(my_string)*count+result_len,
+ sizeof(char *)*count+result_len,
MYF(MY_WME | MY_ZEROFILL))))
{
rep_str=(REPLACE_STRING*) (replace+sets.count);
- to_array=(my_string*) (rep_str+found_sets+1);
- to_pos=(my_string) (to_array+count);
+ to_array= (char **) (rep_str+found_sets+1);
+ to_pos=(char *) (to_array+count);
for (i=0 ; i < count ; i++)
{
to_array[i]=to_pos;
@@ -7480,7 +8171,8 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count,
for (i=1 ; i <= found_sets ; i++)
{
pos=from[found_set[i-1].table_offset];
- rep_str[i].found= !bcmp(pos,"\\^",3) ? 2 : 1;
+ rep_str[i].found= !bcmp((const uchar*) pos,
+ (const uchar*) "\\^", 3) ? 2 : 1;
rep_str[i].replace_string=to_array[found_set[i-1].table_offset];
rep_str[i].to_offset=found_set[i-1].found_offset-start_at_word(pos);
rep_str[i].from_offset=found_set[i-1].found_offset-replace_len(pos)+
@@ -7495,9 +8187,9 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count,
replace[i].next[j]=(REPLACE*) (rep_str+(-sets.set[i].next[j]-1));
}
}
- my_free((gptr) follow,MYF(0));
+ my_free(follow,MYF(0));
free_sets(&sets);
- my_free((gptr) found_set,MYF(0));
+ my_free(found_set,MYF(0));
DBUG_PRINT("exit",("Replace table has %d states",sets.count));
DBUG_RETURN(replace);
}
@@ -7513,7 +8205,7 @@ int init_sets(REP_SETS *sets,uint states)
if (!(sets->bit_buffer=(uint*) my_malloc(sizeof(uint)*sets->size_of_bits*
SET_MALLOC_HUNC,MYF(MY_WME))))
{
- my_free((gptr) sets->set,MYF(0));
+ my_free(sets->set,MYF(0));
return 1;
}
return 0;
@@ -7545,13 +8237,13 @@ REP_SET *make_new_set(REP_SETS *sets)
return set;
}
count=sets->count+sets->invisible+SET_MALLOC_HUNC;
- if (!(set=(REP_SET*) my_realloc((gptr) sets->set_buffer,
+ if (!(set=(REP_SET*) my_realloc((uchar*) sets->set_buffer,
sizeof(REP_SET)*count,
MYF(MY_WME))))
return 0;
sets->set_buffer=set;
sets->set=set+sets->invisible;
- if (!(bit_buffer=(uint*) my_realloc((gptr) sets->bit_buffer,
+ if (!(bit_buffer=(uint*) my_realloc((uchar*) sets->bit_buffer,
(sizeof(uint)*sets->size_of_bits)*count,
MYF(MY_WME))))
return 0;
@@ -7574,8 +8266,8 @@ void free_last_set(REP_SETS *sets)
void free_sets(REP_SETS *sets)
{
- my_free((gptr)sets->set_buffer,MYF(0));
- my_free((gptr)sets->bit_buffer,MYF(0));
+ my_free(sets->set_buffer,MYF(0));
+ my_free(sets->bit_buffer,MYF(0));
return;
}
@@ -7602,13 +8294,13 @@ void or_bits(REP_SET *to,REP_SET *from)
void copy_bits(REP_SET *to,REP_SET *from)
{
- memcpy((byte*) to->bits,(byte*) from->bits,
+ memcpy((uchar*) to->bits,(uchar*) from->bits,
(size_t) (sizeof(uint) * to->size_of_bits));
}
int cmp_bits(REP_SET *set1,REP_SET *set2)
{
- return bcmp((byte*) set1->bits,(byte*) set2->bits,
+ return bcmp((uchar*) set1->bits,(uchar*) set2->bits,
sizeof(uint) * set1->size_of_bits);
}
@@ -7676,17 +8368,19 @@ int find_found(FOUND_SET *found_set,uint table_offset, int found_offset)
/* Return 1 if regexp starts with \b or ends with \b*/
-uint start_at_word(my_string pos)
+uint start_at_word(char * pos)
{
- return (((!bcmp(pos,"\\b",2) && pos[2]) || !bcmp(pos,"\\^",2)) ? 1 : 0);
+ return (((!bcmp((const uchar*) pos, (const uchar*) "\\b",2) && pos[2]) ||
+ !bcmp((const uchar*) pos, (const uchar*) "\\^", 2)) ? 1 : 0);
}
-uint end_of_word(my_string pos)
+uint end_of_word(char * pos)
{
- my_string end=strend(pos);
- return ((end > pos+2 && !bcmp(end-2,"\\b",2)) ||
- (end >= pos+2 && !bcmp(end-2,"\\$",2))) ?
- 1 : 0;
+ char * end=strend(pos);
+ return ((end > pos+2 && !bcmp((const uchar*) end-2,
+ (const uchar*) "\\b", 2)) ||
+ (end >= pos+2 && !bcmp((const uchar*) end-2,
+ (const uchar*) "\\$",2))) ? 1 : 0;
}
/****************************************************************************
@@ -7696,10 +8390,10 @@ uint end_of_word(my_string pos)
#define PC_MALLOC 256 /* Bytes for pointers */
#define PS_MALLOC 512 /* Bytes for data */
-int insert_pointer_name(reg1 POINTER_ARRAY *pa,my_string name)
+int insert_pointer_name(reg1 POINTER_ARRAY *pa,char * name)
{
uint i,length,old_count;
- byte *new_pos;
+ uchar *new_pos;
const char **new_array;
DBUG_ENTER("insert_pointer_name");
@@ -7707,16 +8401,16 @@ int insert_pointer_name(reg1 POINTER_ARRAY *pa,my_string name)
{
if (!(pa->typelib.type_names=(const char **)
my_malloc(((PC_MALLOC-MALLOC_OVERHEAD)/
- (sizeof(my_string)+sizeof(*pa->flag))*
- (sizeof(my_string)+sizeof(*pa->flag))),MYF(MY_WME))))
+ (sizeof(char *)+sizeof(*pa->flag))*
+ (sizeof(char *)+sizeof(*pa->flag))),MYF(MY_WME))))
DBUG_RETURN(-1);
- if (!(pa->str= (byte*) my_malloc((uint) (PS_MALLOC-MALLOC_OVERHEAD),
+ if (!(pa->str= (uchar*) my_malloc((uint) (PS_MALLOC-MALLOC_OVERHEAD),
MYF(MY_WME))))
{
- my_free((gptr) pa->typelib.type_names,MYF(0));
+ my_free((char*) pa->typelib.type_names,MYF(0));
DBUG_RETURN (-1);
}
- pa->max_count=(PC_MALLOC-MALLOC_OVERHEAD)/(sizeof(byte*)+
+ pa->max_count=(PC_MALLOC-MALLOC_OVERHEAD)/(sizeof(uchar*)+
sizeof(*pa->flag));
pa->flag= (int7*) (pa->typelib.type_names+pa->max_count);
pa->length=0;
@@ -7726,7 +8420,7 @@ int insert_pointer_name(reg1 POINTER_ARRAY *pa,my_string name)
length=(uint) strlen(name)+1;
if (pa->length+length >= pa->max_length)
{
- if (!(new_pos= (byte*) my_realloc((gptr) pa->str,
+ if (!(new_pos= (uchar*) my_realloc((uchar*) pa->str,
(uint) (pa->max_length+PS_MALLOC),
MYF(MY_WME))))
DBUG_RETURN(1);
@@ -7745,23 +8439,23 @@ int insert_pointer_name(reg1 POINTER_ARRAY *pa,my_string name)
int len;
pa->array_allocs++;
len=(PC_MALLOC*pa->array_allocs - MALLOC_OVERHEAD);
- if (!(new_array=(const char **) my_realloc((gptr) pa->typelib.type_names,
+ if (!(new_array=(const char **) my_realloc((uchar*) pa->typelib.type_names,
(uint) len/
- (sizeof(byte*)+sizeof(*pa->flag))*
- (sizeof(byte*)+sizeof(*pa->flag)),
+ (sizeof(uchar*)+sizeof(*pa->flag))*
+ (sizeof(uchar*)+sizeof(*pa->flag)),
MYF(MY_WME))))
DBUG_RETURN(1);
pa->typelib.type_names=new_array;
old_count=pa->max_count;
- pa->max_count=len/(sizeof(byte*) + sizeof(*pa->flag));
+ pa->max_count=len/(sizeof(uchar*) + sizeof(*pa->flag));
pa->flag= (int7*) (pa->typelib.type_names+pa->max_count);
- memcpy((byte*) pa->flag,(my_string) (pa->typelib.type_names+old_count),
+ memcpy((uchar*) pa->flag,(char *) (pa->typelib.type_names+old_count),
old_count*sizeof(*pa->flag));
}
pa->flag[pa->typelib.count]=0; /* Reset flag */
- pa->typelib.type_names[pa->typelib.count++]= pa->str+pa->length;
+ pa->typelib.type_names[pa->typelib.count++]= (char*) pa->str+pa->length;
pa->typelib.type_names[pa->typelib.count]= NullS; /* Put end-mark */
- VOID(strmov(pa->str+pa->length,name));
+ VOID(strmov((char*) pa->str+pa->length,name));
pa->length+=length;
DBUG_RETURN(0);
} /* insert_pointer_name */
@@ -7774,9 +8468,9 @@ void free_pointer_array(POINTER_ARRAY *pa)
if (pa->typelib.count)
{
pa->typelib.count=0;
- my_free((gptr) pa->typelib.type_names,MYF(0));
+ my_free((char*) pa->typelib.type_names,MYF(0));
pa->typelib.type_names=0;
- my_free((gptr) pa->str,MYF(0));
+ my_free(pa->str,MYF(0));
}
} /* free_pointer_array */
@@ -7873,7 +8567,7 @@ void dynstr_append_sorted(DYNAMIC_STRING* ds, DYNAMIC_STRING *ds_input)
*line_end= 0;
/* Insert pointer to the line in array */
- if (insert_dynamic(&lines, (gptr) &start))
+ if (insert_dynamic(&lines, (uchar*) &start))
die("Out of memory inserting lines to sort");
start= line_end+1;
diff --git a/client/readline.cc b/client/readline.cc
index ad42ed2ee10..7afdbc9531e 100644
--- a/client/readline.cc
+++ b/client/readline.cc
@@ -22,8 +22,8 @@
static bool init_line_buffer(LINE_BUFFER *buffer,File file,ulong size,
ulong max_size);
-static bool init_line_buffer_from_string(LINE_BUFFER *buffer,my_string str);
-static uint fill_buffer(LINE_BUFFER *buffer);
+static bool init_line_buffer_from_string(LINE_BUFFER *buffer,char * str);
+static size_t fill_buffer(LINE_BUFFER *buffer);
static char *intern_read_line(LINE_BUFFER *buffer,ulong *out_length);
@@ -35,7 +35,7 @@ LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file)
return 0;
if (init_line_buffer(line_buff,fileno(file),IO_SIZE,max_size))
{
- my_free((char*) line_buff,MYF(0));
+ my_free(line_buff,MYF(0));
return 0;
}
return line_buff;
@@ -62,13 +62,13 @@ void batch_readline_end(LINE_BUFFER *line_buff)
{
if (line_buff)
{
- my_free((gptr) line_buff->buffer,MYF(MY_ALLOW_ZERO_PTR));
- my_free((char*) line_buff,MYF(0));
+ my_free(line_buff->buffer,MYF(MY_ALLOW_ZERO_PTR));
+ my_free(line_buff,MYF(0));
}
}
-LINE_BUFFER *batch_readline_command(LINE_BUFFER *line_buff, my_string str)
+LINE_BUFFER *batch_readline_command(LINE_BUFFER *line_buff, char * str)
{
if (!line_buff)
if (!(line_buff=(LINE_BUFFER*)
@@ -76,7 +76,7 @@ LINE_BUFFER *batch_readline_command(LINE_BUFFER *line_buff, my_string str)
return 0;
if (init_line_buffer_from_string(line_buff,str))
{
- my_free((char*) line_buff,MYF(0));
+ my_free(line_buff,MYF(0));
return 0;
}
return line_buff;
@@ -106,13 +106,13 @@ init_line_buffer(LINE_BUFFER *buffer,File file,ulong size,ulong max_buffer)
several times. the resulting buffer will contain a
concatenation of all strings separated by spaces
*/
-static bool init_line_buffer_from_string(LINE_BUFFER *buffer,my_string str)
+static bool init_line_buffer_from_string(LINE_BUFFER *buffer,char * str)
{
uint old_length=(uint)(buffer->end - buffer->buffer);
uint length= (uint) strlen(str);
if (!(buffer->buffer= buffer->start_of_line= buffer->end_of_line=
- (char*)my_realloc(buffer->buffer, old_length+length+2,
- MYF(MY_FAE|MY_ALLOW_ZERO_PTR))))
+ (char*) my_realloc((uchar*) buffer->buffer, old_length+length+2,
+ MYF(MY_FAE|MY_ALLOW_ZERO_PTR))))
return 1;
buffer->end= buffer->buffer + old_length;
if (old_length)
@@ -133,9 +133,9 @@ static bool init_line_buffer_from_string(LINE_BUFFER *buffer,my_string str)
bytes read from disk.
*/
-static uint fill_buffer(LINE_BUFFER *buffer)
+static size_t fill_buffer(LINE_BUFFER *buffer)
{
- uint read_count;
+ size_t read_count;
uint bufbytes= (uint) (buffer->end - buffer->start_of_line);
if (buffer->eof)
@@ -166,11 +166,11 @@ static uint fill_buffer(LINE_BUFFER *buffer)
}
/* Read in new stuff. */
- if ((read_count= my_read(buffer->file, (byte*) buffer->end, read_count,
+ if ((read_count= my_read(buffer->file, (uchar*) buffer->end, read_count,
MYF(MY_WME))) == MY_FILE_ERROR)
- return read_count;
+ return (size_t) -1;
- DBUG_PRINT("fill_buff", ("Got %d bytes", read_count));
+ DBUG_PRINT("fill_buff", ("Got %lu bytes", (ulong) read_count));
/* Kludge to pretend every nonempty file ends with a newline. */
if (!read_count && bufbytes && buffer->end[-1] != '\n')
@@ -189,7 +189,7 @@ static uint fill_buffer(LINE_BUFFER *buffer)
char *intern_read_line(LINE_BUFFER *buffer,ulong *out_length)
{
char *pos;
- uint length;
+ size_t length;
DBUG_ENTER("intern_read_line");
buffer->start_of_line=buffer->end_of_line;
@@ -202,7 +202,7 @@ char *intern_read_line(LINE_BUFFER *buffer,ulong *out_length)
{
if ((uint) (pos - buffer->start_of_line) < buffer->max_size)
{
- if (!(length=fill_buffer(buffer)) || length == (uint) -1)
+ if (!(length=fill_buffer(buffer)) || length == (size_t) -1)
DBUG_RETURN(0);
continue;
}
diff --git a/client/sql_string.cc b/client/sql_string.cc
index 9d887ff031c..c41463999aa 100644
--- a/client/sql_string.cc
+++ b/client/sql_string.cc
@@ -32,7 +32,7 @@
required by the string function
*/
-extern gptr sql_alloc(unsigned size);
+extern void sql_alloc(size_t size);
extern void sql_element_free(void *ptr);
#include "sql_string.h"
@@ -506,7 +506,7 @@ bool String::append(FILE* file, uint32 arg_length, myf my_flags)
{
if (realloc(str_length+arg_length))
return TRUE;
- if (my_fread(file, (byte*) Ptr + str_length, arg_length, my_flags))
+ if (my_fread(file, (uchar*) Ptr + str_length, arg_length, my_flags))
{
shrink(str_length);
return TRUE;
@@ -520,7 +520,7 @@ bool String::append(IO_CACHE* file, uint32 arg_length)
{
if (realloc(str_length+arg_length))
return TRUE;
- if (my_b_read(file, (byte*) Ptr + str_length, arg_length))
+ if (my_b_read(file, (uchar*) Ptr + str_length, arg_length))
{
shrink(str_length);
return TRUE;
@@ -645,7 +645,7 @@ bool String::replace(uint32 offset,uint32 arg_length,
{
if (realloc(str_length+(uint32) diff))
return TRUE;
- bmove_upp(Ptr+str_length+diff,Ptr+str_length,
+ bmove_upp((uchar*) Ptr+str_length+diff, (uchar*) Ptr+str_length,
str_length-offset-arg_length);
}
if (to_length)
@@ -805,10 +805,8 @@ copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
const uchar *from_end= (const uchar*) from+from_length;
char *to_start= to;
uchar *to_end= (uchar*) to+to_length;
- int (*mb_wc)(struct charset_info_st *, my_wc_t *, const uchar *,
- const uchar *) = from_cs->cset->mb_wc;
- int (*wc_mb)(struct charset_info_st *, my_wc_t, uchar *s, uchar *e)=
- to_cs->cset->wc_mb;
+ my_charset_conv_mb_wc mb_wc= from_cs->cset->mb_wc;
+ my_charset_conv_wc_mb wc_mb= to_cs->cset->wc_mb;
uint error_count= 0;
while (1)
diff --git a/cmd-line-utils/libedit/Makefile.am b/cmd-line-utils/libedit/Makefile.am
index ae6755f1c5c..b87f11a8de2 100644
--- a/cmd-line-utils/libedit/Makefile.am
+++ b/cmd-line-utils/libedit/Makefile.am
@@ -5,8 +5,8 @@
ASRC = $(srcdir)/vi.c $(srcdir)/emacs.c $(srcdir)/common.c
AHDR = vi.h emacs.h common.h
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
- -I$(srcdir)/../.. -I..
+# Make sure to include stuff from this directory first, to get right "config.h"
+INCLUDES = -I. -I$(top_builddir)/include -I$(top_srcdir)/include
noinst_LIBRARIES = libedit.a
@@ -21,9 +21,9 @@ EXTRA_libedit_a_SOURCES = np/unvis.c np/strlcpy.c np/vis.c np/strlcat.c \
libedit_a_LIBADD = @LIBEDIT_LOBJECTS@
libedit_a_DEPENDENCIES = @LIBEDIT_LOBJECTS@
-pkginclude_HEADERS = readline/readline.h
-
-noinst_HEADERS = chared.h el.h el_term.h histedit.h key.h parse.h refresh.h sig.h \
+noinst_HEADERS = readline/readline.h \
+\
+ chared.h el.h el_term.h histedit.h key.h parse.h refresh.h sig.h \
sys.h tokenizer.h config.h hist.h map.h prompt.h read.h \
search.h tty.h libedit_term.h vis.h
diff --git a/cmd-line-utils/libedit/el_term.h b/cmd-line-utils/libedit/el_term.h
index 9e5588ee96f..00ca48e38e2 100644
--- a/cmd-line-utils/libedit/el_term.h
+++ b/cmd-line-utils/libedit/el_term.h
@@ -90,6 +90,16 @@ extern char* tgoto(const char*, int, int);
extern char* tgetstr(char*, char**);
#endif
+
+#if !HAVE_DECL_TGOTO
+/*
+ 'tgoto' is not declared in the system header files, this causes
+ problems on 64-bit systems. The function returns a 64 bit pointer
+ but caller see it as "int" and it's thus truncated to 32-bit
+*/
+extern char* tgoto(const char*, int, int);
+#endif
+
protected void term_move_to_line(EditLine *, int);
protected void term_move_to_char(EditLine *, int);
protected void term_clear_EOL(EditLine *, int);
diff --git a/cmd-line-utils/readline/Makefile.am b/cmd-line-utils/readline/Makefile.am
index f5e41b7e2e9..5fcbcde0516 100644
--- a/cmd-line-utils/readline/Makefile.am
+++ b/cmd-line-utils/readline/Makefile.am
@@ -20,11 +20,11 @@ libreadline_a_SOURCES = readline.c funmap.c keymaps.c \
shell.c tilde.c misc.c text.c mbutil.c \
compat.c savestring.c
-pkginclude_HEADERS = readline.h chardefs.h keymaps.h \
+noinst_HEADERS = readline.h chardefs.h keymaps.h \
history.h tilde.h rlmbutil.h rltypedefs.h rlprivate.h \
- rlshell.h xmalloc.h
-
-noinst_HEADERS = config_readline.h rldefs.h histlib.h rlwinsize.h \
+ rlshell.h xmalloc.h \
+\
+ config_readline.h rldefs.h histlib.h rlwinsize.h \
posixstat.h posixdir.h posixjmp.h \
tilde.h rlconf.h rltty.h ansi_stdlib.h \
tcap.h rlstdc.h
diff --git a/cmd-line-utils/readline/rltty.c b/cmd-line-utils/readline/rltty.c
index ffbae1e08af..869538af9ab 100644
--- a/cmd-line-utils/readline/rltty.c
+++ b/cmd-line-utils/readline/rltty.c
@@ -139,8 +139,7 @@ static int ksrflow;
/* Dummy call to force a backgrounded readline to stop before it tries
to get the tty settings. */
static void
-set_winsize (tty)
- int tty;
+set_winsize (int tty __attribute__((unused)))
{
#if defined (TIOCGWINSZ)
struct winsize w;
diff --git a/config/ac-macros/compiler_flag.m4 b/config/ac-macros/compiler_flag.m4
index 88097c7a62e..ce2ce6cbdfa 100644
--- a/config/ac-macros/compiler_flag.m4
+++ b/config/ac-macros/compiler_flag.m4
@@ -7,7 +7,7 @@ AC_DEFUN([AC_SYS_COMPILER_FLAG],
AC_CACHE_VAL(mysql_cv_option_$2,
[
CFLAGS="[$]OLD_CFLAGS $1"
- AC_TRY_RUN([int main(){exit(0);}],mysql_cv_option_$2=yes,mysql_cv_option_$2=no,mysql_cv_option_$2=no)
+ AC_TRY_LINK([int main(){exit(0);}],mysql_cv_option_$2=yes,mysql_cv_option_$2=no,mysql_cv_option_$2=no)
])
CFLAGS="[$]OLD_CFLAGS"
diff --git a/config/ac-macros/ha_ndbcluster.m4 b/config/ac-macros/ha_ndbcluster.m4
index 2a54638b3ae..60ca92abc10 100644
--- a/config/ac-macros/ha_ndbcluster.m4
+++ b/config/ac-macros/ha_ndbcluster.m4
@@ -43,7 +43,7 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [
if test -f "$mysql_sci_dir/lib/libsisci.a" -a \
-f "$mysql_sci_dir/include/sisci_api.h"; then
NDB_SCI_INCLUDES="-I$mysql_sci_dir/include"
- NDB_SCI_LIBS="-L$mysql_sci_dir/lib -lsisci"
+ NDB_SCI_LIBS="$mysql_sci_dir/lib/libsisci.a"
AC_MSG_RESULT([-- including sci transporter])
AC_DEFINE([NDB_SCI_TRANSPORTER], [1],
[Including Ndb Cluster DB sci transporter])
@@ -197,7 +197,6 @@ AC_DEFUN([MYSQL_SETUP_NDBCLUSTER], [
MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --with-ndbcluster"
- CXXFLAGS="$CXXFLAGS \$(NDB_CXXFLAGS)"
if test "$have_ndb_debug" = "default"
then
have_ndb_debug=$with_debug
@@ -278,6 +277,13 @@ AC_DEFUN([MYSQL_SETUP_NDBCLUSTER], [
ndb_bin_am_ldflags=""
fi
+ # building dynamic breaks on AIX. (If you want to try it and get unresolved
+ # __vec__delete2 and some such, try linking against libhC.)
+ case "$host_os" in
+ aix3.* | aix4.0.* | aix4.1.*) ;;
+ *) ndb_bin_am_ldflags="-static";;
+ esac
+
# libndbclient versioning when linked with GNU ld.
if $LD --version 2>/dev/null|grep -q GNU; then
NDB_LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_builddir)/storage/ndb/src/libndb.ver"
diff --git a/config/ac-macros/large_file.m4 b/config/ac-macros/large_file.m4
index 00c2fdf614e..2639cec5fb7 100644
--- a/config/ac-macros/large_file.m4
+++ b/config/ac-macros/large_file.m4
@@ -127,14 +127,9 @@ AC_DEFUN([MYSQL_SYS_LARGEFILE],
hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
ac_cv_sys_largefile_source=1 ;;
esac])
- AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES,
- ac_cv_sys_large_files,
- [Large files support on AIX-style hosts.],
- [case "$host_os" in
- # AIX 4.2 and later
- aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*)
- ac_cv_sys_large_files=1 ;;
- esac])
+
+ # AIX 4.2 and later -- do nothing, include standards.h instead.
+ # this goes for both GNU and IBM C and C++ compilers.
fi
])
diff --git a/config/ac-macros/misc.m4 b/config/ac-macros/misc.m4
index 6e9dfe8231c..975e48d0487 100644
--- a/config/ac-macros/misc.m4
+++ b/config/ac-macros/misc.m4
@@ -469,7 +469,7 @@ AC_DEFUN([MYSQL_STACK_DIRECTION],
{
exit (find_stack_direction() < 0);
}], ac_cv_c_stack_direction=1, ac_cv_c_stack_direction=-1,
- ac_cv_c_stack_direction=0)])
+ ac_cv_c_stack_direction=)])
AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
])dnl
@@ -479,7 +479,7 @@ AC_MSG_CHECKING(if conversion of longlong to float works)
AC_CACHE_VAL(ac_cv_conv_longlong_to_float,
[AC_TRY_RUN([#include <stdio.h>
typedef long long longlong;
-main()
+int main()
{
longlong ll=1;
float f;
@@ -487,8 +487,10 @@ main()
f = (float) ll;
fprintf(file,"%g\n",f);
fclose(file);
- exit (0);
-}], ac_cv_conv_longlong_to_float=`cat conftestval`, ac_cv_conv_longlong_to_float=0, ifelse([$2], , , ac_cv_conv_longlong_to_float=$2))])dnl
+ return (0);
+}], ac_cv_conv_longlong_to_float=`cat conftestval`,
+ ac_cv_conv_longlong_to_float=0,
+ ac_cv_conv_longlong_to_float="yes")])dnl # Cross compiling, assume can convert
if test "$ac_cv_conv_longlong_to_float" = "1" -o "$ac_cv_conv_longlong_to_float" = "yes"
then
ac_cv_conv_longlong_to_float=yes
@@ -636,7 +638,6 @@ AC_SUBST(CXX_VERSION)
])
AC_DEFUN([MYSQL_PROG_AR], [
-AC_REQUIRE([MYSQL_CHECK_CXX_VERSION])
case $CXX_VERSION in
MIPSpro*)
AR=$CXX
@@ -647,11 +648,8 @@ case $CXX_VERSION in
ARFLAGS="-xar -o"
;;
*)
- if test -z "$AR"
- then
- AC_CHECK_PROG([AR], [ar], [ar])
- fi
- if test -z "$AR"
+ AC_CHECK_PROG([AR], [ar], [ar])
+ if test -z "$AR" || test "$AR" = "false"
then
AC_MSG_ERROR([You need ar to build the library])
fi
diff --git a/config/ac-macros/ssl.m4 b/config/ac-macros/ssl.m4
index 4ee58318a62..729115ffe88 100644
--- a/config/ac-macros/ssl.m4
+++ b/config/ac-macros/ssl.m4
@@ -15,14 +15,6 @@ dnl Add defines so yassl is built and linked with
dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_USE_BUNDLED_YASSL], [
- AC_CONFIG_FILES(extra/yassl/Makefile dnl
- extra/yassl/taocrypt/Makefile dnl
- extra/yassl/taocrypt/benchmark/Makefile dnl
- extra/yassl/taocrypt/src/Makefile dnl
- extra/yassl/taocrypt/test/Makefile dnl
- extra/yassl/src/Makefile dnl
- extra/yassl/testsuite/Makefile)
-
with_bundled_yassl="yes"
yassl_dir="yassl"
@@ -104,7 +96,7 @@ AC_DEFUN([MYSQL_FIND_OPENSSL], [
# compiler warnings when using gcc 3.x
if test "$openssl_include" != "/usr/include"
then
- openssl_includes="-I$ssl_include"
+ openssl_includes="-I$openssl_include"
fi
#
@@ -167,6 +159,15 @@ dnl macro bails out with error.
dnl
dnl ------------------------------------------------------------------------
AC_DEFUN([MYSQL_CHECK_SSL], [
+
+ AC_CONFIG_FILES(extra/yassl/Makefile dnl
+ extra/yassl/taocrypt/Makefile dnl
+ extra/yassl/taocrypt/benchmark/Makefile dnl
+ extra/yassl/taocrypt/src/Makefile dnl
+ extra/yassl/taocrypt/test/Makefile dnl
+ extra/yassl/src/Makefile dnl
+ extra/yassl/testsuite/Makefile)
+
AC_MSG_CHECKING(for SSL)
AC_ARG_WITH([ssl],
[ --with-ssl[=DIR] Include SSL support],
diff --git a/config/ac-macros/zlib.m4 b/config/ac-macros/zlib.m4
index 5586b1ba816..f62bb056249 100644
--- a/config/ac-macros/zlib.m4
+++ b/config/ac-macros/zlib.m4
@@ -64,6 +64,9 @@ dnl installation dir ($pkglibdir), so ZLIB_DEPS is set to point to
dnl $pkglibdir.
AC_DEFUN([MYSQL_CHECK_ZLIB_WITH_COMPRESS], [
+
+AC_CONFIG_FILES(zlib/Makefile)
+
AC_MSG_CHECKING([for zlib compression library])
case $SYSTEM_TYPE in
*netware* | *modesto*)
@@ -124,10 +127,6 @@ case $SYSTEM_TYPE in
fi
;;
esac
-if test -n "$zlib_dir"
-then
- AC_CONFIG_FILES(zlib/Makefile)
-fi
])
dnl ------------------------------------------------------------------------
diff --git a/configure.in b/configure.in
index d293e70bb3b..b6c0a21b1eb 100644
--- a/configure.in
+++ b/configure.in
@@ -10,14 +10,14 @@ AC_CANONICAL_SYSTEM
#
# When changing major version number please also check switch statement
# in mysqlbinlog::check_master_version().
-AM_INIT_AUTOMAKE(mysql, 5.1.18-beta)
-AM_CONFIG_HEADER(config.h)
+AM_INIT_AUTOMAKE(mysql, 5.1.23-beta)
+AM_CONFIG_HEADER([include/config.h:config.h.in])
is_this_community_tree=no
PROTOCOL_VERSION=10
DOT_FRM_VERSION=6
# See the libtool docs for information on how to do shared lib versions.
-SHARED_LIB_MAJOR_VERSION=15
+SHARED_LIB_MAJOR_VERSION=16
SHARED_LIB_VERSION=$SHARED_LIB_MAJOR_VERSION:0:0
NDB_SHARED_LIB_MAJOR_VERSION=3
NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0
@@ -72,14 +72,22 @@ AC_SUBST(AVAILABLE_LANGUAGES)
# Canonicalize the configuration name.
-SYSTEM_TYPE="$host_vendor-$host_os"
-MACHINE_TYPE="$host_cpu"
+
+# Check whether --with-system-type or --without-system-type was given.
+AC_ARG_WITH(system-type,
+ [ --with-system-type Set the system type, like "sun-solaris10"],
+ [SYSTEM_TYPE="$withval"],
+ [SYSTEM_TYPE="$host_vendor-$host_os"])
+AC_ARG_WITH(machine-type,
+ [ --with-machine-type Set the machine type, like "powerpc"],
+ [MACHINE_TYPE="$withval"],
+ [MACHINE_TYPE="$host_cpu"])
AC_SUBST(SYSTEM_TYPE)
AC_DEFINE_UNQUOTED([SYSTEM_TYPE], ["$SYSTEM_TYPE"],
- [Name of system, eg solaris])
+ [Name of system, eg sun-solaris])
AC_SUBST(MACHINE_TYPE)
AC_DEFINE_UNQUOTED([MACHINE_TYPE], ["$MACHINE_TYPE"],
- [Machine type name, eg sun10])
+ [Machine type name, eg sparc])
# Detect intel x86 like processor
BASE_MACHINE_TYPE=$MACHINE_TYPE
@@ -231,14 +239,8 @@ AC_CHECK_PROGS(YACC, ['bison -y -p MYSQL'])
AC_CHECK_PROG(PDFMANUAL, pdftex, manual.pdf)
AC_CHECK_PROG(DVIS, tex, manual.dvi)
-AC_MSG_CHECKING("return type of sprintf")
-
#check the return type of sprintf
-case $SYSTEM_TYPE in
- *netware*)
- AC_DEFINE(SPRINTF_RETURNS_INT, [1]) AC_MSG_RESULT("int")
- ;;
- *)
+AC_MSG_CHECKING("return type of sprintf")
AC_TRY_RUN([
int main()
{
@@ -264,10 +266,12 @@ AC_TRY_RUN([
[AC_DEFINE(SPRINTF_RETURNS_PTR, [1], [Broken sprintf])
AC_MSG_RESULT("ptr")],
[AC_DEFINE(SPRINTF_RETURNS_GARBAGE, [1], [Broken sprintf])
- AC_MSG_RESULT("garbage")])
- ])
- ;;
-esac
+ AC_MSG_RESULT("garbage")]
+ )],
+ # Cross compile, assume POSIX
+ [AC_DEFINE(SPRINTF_RETURNS_INT, [1], [POSIX sprintf])
+ AC_MSG_RESULT("int (we assume)")]
+)
AC_PATH_PROG(uname_prog, uname, no)
@@ -777,7 +781,8 @@ AC_CHECK_HEADERS(fcntl.h float.h floatingpoint.h ieeefp.h limits.h \
sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \
unistd.h utime.h sys/utime.h termio.h termios.h sched.h crypt.h alloca.h \
sys/ioctl.h malloc.h sys/malloc.h sys/ipc.h sys/shm.h linux/config.h \
- sys/resource.h sys/param.h port.h)
+ sys/prctl.h \
+ sys/resource.h sys/param.h port.h ieeefp.h)
AC_CHECK_HEADERS([xfs/xfs.h])
@@ -791,6 +796,7 @@ AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
AC_CHECK_LIB(nsl_r, gethostbyname_r, [],
AC_CHECK_LIB(nsl, gethostbyname_r))
AC_CHECK_FUNC(gethostbyname_r)
+AC_CHECK_LIB(mtmalloc, malloc)
AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
AC_CHECK_FUNC(yp_get_default_domain, ,
@@ -872,7 +878,7 @@ if test "$TARGET_LINUX" = "true"; then
[ USE_PSTACK=$withval ],
[ USE_PSTACK=no ])
pstack_libs=
- pstack_dirs=
+ pstack_dir=
if test "$USE_PSTACK" = yes -a "$TARGET_LINUX" = "true" -a "$BASE_MACHINE_TYPE" = "i386"
then
have_libiberty= have_libbfd=
@@ -885,11 +891,11 @@ dnl I have no idea if this is a good test - can not find docs for libiberty
if test x"$have_libiberty" = xyes -a x"$have_libbfd" = xyes
then
- pstack_dirs='$(top_srcdir)'/pstack
+ pstack_dir="pstack"
pstack_libs="../pstack/libpstack.a -lbfd -liberty"
# We must link staticly when using pstack
with_mysqld_ldflags="-all-static"
- AC_SUBST([pstack_dirs])
+ AC_SUBST([pstack_dir])
AC_SUBST([pstack_libs])
AC_DEFINE([USE_PSTACK], [1], [the pstack backtrace library])
dnl This check isn't needed, but might be nice to give some feedback....
@@ -903,7 +909,6 @@ dnl have_libiberty_h=no)
USE_PSTACK="no"
fi
fi
-AM_CONDITIONAL(COMPILE_PSTACK, test "$USE_PSTACK" = "yes")
AC_MSG_CHECKING([if we should use pstack])
AC_MSG_RESULT([$USE_PSTACK])
@@ -1703,6 +1708,12 @@ AC_ARG_WITH(client-ldflags,
[CLIENT_EXTRA_LDFLAGS=])
AC_SUBST(CLIENT_EXTRA_LDFLAGS)
+AC_ARG_WITH(mysqld-libs,
+ [ --with-mysqld-libs Extra libraries to link with for mysqld],
+ [MYSQLD_EXTRA_LIBS=$withval],
+ [MYSQLD_EXTRA_LIBS=])
+AC_SUBST(MYSQLD_EXTRA_LIBS)
+
AC_ARG_WITH(lib-ccflags,
[ --with-lib-ccflags Extra CC options for libraries],
[LIB_EXTRA_CCFLAGS=$withval],
@@ -1903,6 +1914,19 @@ else
fi
AC_SUBST(TERMCAP_LIB)
+# Check if the termcap function 'tgoto' is already declared in
+# system header files or if it need to be declared locally
+AC_CHECK_DECLS(tgoto,,,[
+#ifdef HAVE_CURSES_H
+# include <curses.h>
+#elif HAVE_NCURSES_H
+# include <ncurses.h>
+#endif
+#ifdef HAVE_TERM_H
+# include <term.h>
+#endif
+])
+
LIBEDIT_LOBJECTS=""
AC_CHECK_FUNC(strunvis, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS unvis.o"])
AC_CHECK_FUNC(strvis, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS vis.o"])
@@ -1937,8 +1961,9 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bsearch bzero \
chsize cuserid fchmod fcntl \
fconvert fdatasync finite fpresetsticky fpsetmask fsync ftruncate \
getcwd gethostbyaddr_r gethostbyname_r getpass getpassphrase getpwnam \
- getpwuid getrlimit getrusage getwd gmtime_r index initgroups isnan \
- localtime_r locking longjmp lrand48 madvise mallinfo memcpy memmove \
+ getpwuid getrlimit getrusage getwd index initgroups isnan \
+ localtime_r gethrtime gmtime_r \
+ locking longjmp lrand48 madvise mallinfo memcpy memmove \
mkstemp mlockall perror poll pread pthread_attr_create mmap mmap64 getpagesize \
pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
@@ -1965,12 +1990,20 @@ case "$target" in
;;
esac
-# isinf() could be a function or a macro (HPUX)
-AC_MSG_CHECKING(for isinf with <math.h>)
+# Check that isinf() is available in math.h and can be used in both C and C++
+# code
+AC_MSG_CHECKING(for isinf in <math.h>)
AC_TRY_LINK([#include <math.h>], [float f = 0.0; int r = isinf(f); return r],
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_ISINF, [1], [isinf() macro or function]),
- AC_MSG_RESULT(no))
+ AC_MSG_RESULT(yes)
+ AC_MSG_CHECKING(whether isinf() can be used in C++ code)
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_LINK([#include <math.h>], [float f = 0.0; int r = isinf(f); return r],
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_ISINF, [1], [isinf() macro or function]),
+ AC_MSG_RESULT(no))
+ AC_LANG_RESTORE,
+ AC_MSG_RESULT(no))
CFLAGS="$ORG_CFLAGS"
@@ -2311,8 +2344,7 @@ AC_ARG_WITH([mysqlmanager],
if test "$with_mysqlmanager" = "yes" -o \
'(' "$with_mysqlmanager:$with_server" = ":yes" -a \
-d "$srcdir/server-tools" ')' ; then
- tools_dirs="$tools_dirs server-tools"
- AC_CONFIG_FILES(server-tools/Makefile server-tools/instance-manager/Makefile)
+ tools_dirs="server-tools"
fi
AC_SUBST(tools_dirs)
@@ -2324,7 +2356,6 @@ if test "$with_embedded_server" = "yes"
then
libmysqld_dirs=libmysqld
- AC_CONFIG_FILES(libmysqld/Makefile libmysqld/examples/Makefile)
# We can't build embedded library without building the server, because
# we depend on libmysys, libmystrings, libmyisam, etc.
with_server=yes
@@ -2409,70 +2440,58 @@ then
# For NetWare, do not need readline
echo "Skipping readline"
else
-
-if [test "$with_libedit" = "yes"] || [test "$with_libedit" = "undefined"] && [test "$with_readline" = "undefined"]
-then
- readline_topdir="cmd-line-utils"
- readline_basedir="libedit"
- readline_dir="$readline_topdir/$readline_basedir"
- readline_link="\$(top_builddir)/cmd-line-utils/libedit/libedit.a"
- readline_h_ln_cmd="\$(LN) -s \$(top_srcdir)/cmd-line-utils/libedit/readline readline"
- compile_libedit=yes
- AC_DEFINE_UNQUOTED(HAVE_HIST_ENTRY, 1)
- AC_DEFINE_UNQUOTED(USE_LIBEDIT_INTERFACE, 1)
-elif test "$with_readline" = "yes"
-then
- readline_topdir="cmd-line-utils"
- readline_basedir="readline"
- readline_dir="$readline_topdir/$readline_basedir"
- readline_link="\$(top_builddir)/cmd-line-utils/readline/libreadline.a"
- readline_h_ln_cmd="\$(LN) -s \$(top_srcdir)/cmd-line-utils/readline readline"
- compile_readline=yes
- want_to_use_readline="yes"
- AC_DEFINE_UNQUOTED(USE_NEW_READLINE_INTERFACE, 1)
-else
- # Use system readline library
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- MYSQL_CHECK_LIBEDIT_INTERFACE
- MYSQL_CHECK_NEW_RL_INTERFACE
- MYSQL_CHECK_READLINE_DECLARES_HIST_ENTRY
- AC_LANG_RESTORE
- if [test "$mysql_cv_new_rl_interface" = "yes"] && [test -d "./cmd-line-utils/readline"]
+ if [test "$with_libedit" = "yes"] || [test "$with_libedit" = "undefined"] && [test "$with_readline" = "undefined"]
then
- # Use the new readline interface, but only if the package includes a bundled libreadline
- # this way we avoid linking commercial source with GPL readline
- readline_link="-lreadline"
- want_to_use_readline="yes"
- elif [test "$mysql_cv_libedit_interface" = "yes"]
+ readline_topdir="cmd-line-utils"
+ readline_basedir="libedit"
+ readline_dir="$readline_topdir/$readline_basedir"
+ readline_link="\$(top_builddir)/cmd-line-utils/libedit/libedit.a"
+ readline_h_ln_cmd="\$(LN) -s \$(top_srcdir)/cmd-line-utils/libedit/readline readline"
+ compile_libedit=yes
+ AC_DEFINE_UNQUOTED(HAVE_HIST_ENTRY, 1)
+ AC_DEFINE_UNQUOTED(USE_LIBEDIT_INTERFACE, 1)
+ elif test "$with_readline" = "yes"
then
- # Use libedit
- readline_link="-ledit"
+ readline_topdir="cmd-line-utils"
+ readline_basedir="readline"
+ readline_dir="$readline_topdir/$readline_basedir"
+ readline_link="\$(top_builddir)/cmd-line-utils/readline/libreadline.a"
+ readline_h_ln_cmd="\$(LN) -s \$(top_srcdir)/cmd-line-utils/readline readline"
+ compile_readline=yes
+ want_to_use_readline="yes"
+ AC_DEFINE_UNQUOTED(USE_NEW_READLINE_INTERFACE, 1)
else
- AC_MSG_ERROR([Could not find system readline or libedit libraries
- Use --with-readline or --with-libedit to use the bundled
- versions of libedit or readline])
+ # Use system readline library
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ MYSQL_CHECK_LIBEDIT_INTERFACE
+ MYSQL_CHECK_NEW_RL_INTERFACE
+ MYSQL_CHECK_READLINE_DECLARES_HIST_ENTRY
+ AC_LANG_RESTORE
+ if [test "$mysql_cv_new_rl_interface" = "yes"] && [test -d "$srcdir/cmd-line-utils/readline"]
+ then
+ # Use the new readline interface, but only if the package includes a bundled libreadline
+ # this way we avoid linking commercial source with GPL readline
+ readline_link="-lreadline"
+ want_to_use_readline="yes"
+ elif [test "$mysql_cv_libedit_interface" = "yes"]
+ then
+ # Use libedit
+ readline_link="-ledit"
+ else
+ AC_MSG_ERROR([Could not find system readline or libedit libraries
+ Use --with-readline or --with-libedit to use the bundled
+ versions of libedit or readline])
+ fi
fi
-fi
-
-# if there is no readline, but we want to build with readline, we fail
-if [test "$want_to_use_readline" = "yes"] && [test ! -d "./cmd-line-utils/readline"]
-then
- AC_MSG_ERROR([This commercially licensed MySQL source package can't
- be built with libreadline. Please use --with-libedit to use
- the bundled version of libedit instead.])
-fi
-#
-# if either readline or libedit is enabled - generate Makefile's for both
-# (to make sure both are included in 'make dist')
-#
-if test -n "$readline_basedir"
-then
- AC_CONFIG_FILES(cmd-line-utils/Makefile dnl
- cmd-line-utils/libedit/Makefile dnl
- cmd-line-utils/readline/Makefile)
-fi
+ # if there is no readline, but we want to build with readline, we fail
+ if [test "$want_to_use_readline" = "yes"] && [test ! -d "./cmd-line-utils/readline"]
+ then
+ AC_MSG_ERROR([This commercially licensed MySQL source package can't
+ be built with libreadline. Please use --with-libedit to use
+ the bundled version of libedit instead.])
+ fi
fi
AC_SUBST(readline_dir)
@@ -2541,7 +2560,6 @@ AC_SUBST(man8_files)
sql_server_dirs=
sql_server=
server_scripts=
-thread_dirs=
dnl This probably should be cleaned up more - for now the threaded
dnl client is just using plain-old libs.
@@ -2552,7 +2570,6 @@ AM_CONDITIONAL(THREAD_SAFE_CLIENT, test "$THREAD_SAFE_CLIENT" != "no")
if test "$THREAD_SAFE_CLIENT" != "no"
then
sql_client_dirs="$sql_client_dirs libmysql_r"
- AC_CONFIG_FILES(libmysql_r/Makefile)
AC_DEFINE([THREAD_SAFE_CLIENT], [1], [Should the client be thread safe])
fi
sql_client_dirs="$sql_client_dirs client"
@@ -2584,7 +2601,7 @@ then
server_scripts="mysqld_safe mysql_install_db"
sql_server_dirs="strings mysys dbug extra regex"
- sql_server="$sql_server vio sql"
+ sql_server="vio sql"
fi
# IMPORTANT - do not modify LIBS past this line - this hack is the only way
@@ -2596,7 +2613,6 @@ LIBS="$LIBS $STATIC_NSS_FLAGS"
AC_SUBST(sql_server_dirs)
AC_SUBST(sql_server)
-AC_SUBST(thread_dirs)
AC_SUBST(server_scripts)
AC_SUBST(mysql_plugin_dirs)
@@ -2623,20 +2639,38 @@ AC_SUBST(CC)
AC_SUBST(GXX)
# Set configuration options for make_binary_distribution
+case $SYSTEM_TYPE in
+ *netware*)
+ MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --no-strip"
+ ;;
+ *)
+ : # no change for other platforms yet
+ ;;
+esac
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
# Output results
+if test -d "$srcdir/pstack" ; then
+ AC_CONFIG_FILES(pstack/Makefile pstack/aout/Makefile)
+fi
+if test -d "$srcdir/cmd-line-utils/readline" ; then
+ AC_CONFIG_FILES(cmd-line-utils/readline/Makefile)
+fi
+
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
unittest/Makefile unittest/mytap/Makefile unittest/mytap/t/Makefile dnl
unittest/mysys/Makefile unittest/examples/Makefile dnl
strings/Makefile regex/Makefile storage/Makefile dnl
man/Makefile BUILD/Makefile vio/Makefile dnl
- libmysql/Makefile client/Makefile dnl
- pstack/Makefile pstack/aout/Makefile sql/Makefile sql/share/Makefile dnl
+ libmysql/Makefile libmysql_r/Makefile client/Makefile dnl
+ sql/Makefile sql/share/Makefile dnl
sql/sql_builtin.cc sql-common/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
+ server-tools/Makefile server-tools/instance-manager/Makefile dnl
+ cmd-line-utils/Makefile cmd-line-utils/libedit/Makefile dnl
+ libmysqld/Makefile libmysqld/examples/Makefile dnl
mysql-test/Makefile dnl
debian/Makefile debian/defs.mk debian/control dnl
mysql-test/ndb/Makefile netware/Makefile sql-bench/Makefile dnl
diff --git a/dbug/CMakeLists.txt b/dbug/CMakeLists.txt
index 375fd19fb40..8b27f79dcf4 100644..100755
--- a/dbug/CMakeLists.txt
+++ b/dbug/CMakeLists.txt
@@ -13,8 +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
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -D__WIN32__")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/dbug)
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
-ADD_LIBRARY(dbug dbug.c factorial.c sanity.c)
+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/dbug.c b/dbug/dbug.c
index e482fd95073..9d638c299d3 100644
--- a/dbug/dbug.c
+++ b/dbug/dbug.c
@@ -264,7 +264,7 @@ static BOOLEAN DoTrace(CODE_STATE *cs);
/* Test to see if file is writable */
#if !(!defined(HAVE_ACCESS) || defined(MSDOS))
-static BOOLEAN Writable(char *pathname);
+static BOOLEAN Writable(const char *pathname);
/* Change file owner and group */
static void ChangeOwner(CODE_STATE *cs, char *pathname);
/* Allocate memory for runtime support */
@@ -343,12 +343,12 @@ static CODE_STATE *code_state(void)
if (!(cs=(CODE_STATE *) tmp->dbug))
{
cs=(CODE_STATE*) DbugMalloc(sizeof(*cs));
- bzero((char*) cs,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=(gptr) cs;
+ tmp->dbug= (void*) cs;
}
}
return cs;
@@ -715,7 +715,7 @@ void _db_push_(const char *control)
void _db_set_init_(const char *control)
{
CODE_STATE tmp_cs;
- bzero((char*) &tmp_cs, sizeof(tmp_cs));
+ bzero((uchar*) &tmp_cs, sizeof(tmp_cs));
tmp_cs.stack= &init_settings;
_db_set_(&tmp_cs, control);
}
@@ -830,7 +830,7 @@ void _db_pop_()
} \
} while (0)
-int _db_explain_ (CODE_STATE *cs, char *buf, int len)
+int _db_explain_ (CODE_STATE *cs, char *buf, size_t len)
{
char *start=buf, *end=buf+len-4;
@@ -887,10 +887,10 @@ overflow:
* see _db_explain_
*/
-int _db_explain_init_(char *buf, int len)
+int _db_explain_init_(char *buf, size_t len)
{
CODE_STATE cs;
- bzero((char*) &cs,sizeof(cs));
+ bzero((uchar*) &cs,sizeof(cs));
cs.stack=&init_settings;
return _db_explain_(&cs, buf, len);
}
@@ -1083,7 +1083,7 @@ void _db_pargs_(uint _line_, const char *keyword)
CODE_STATE *cs=0;
get_code_state_or_return;
cs->u_line= _line_;
- cs->u_keyword= (char*) keyword;
+ cs->u_keyword= keyword;
}
@@ -1160,7 +1160,8 @@ void _db_doprnt_(const char *format,...)
* Is used to examine corrputed memory or arrays.
*/
-void _db_dump_(uint _line_, const char *keyword, const char *memory, uint length)
+void _db_dump_(uint _line_, const char *keyword,
+ const unsigned char *memory, size_t length)
{
int pos;
char dbuff[90];
@@ -1168,7 +1169,7 @@ void _db_dump_(uint _line_, const char *keyword, const char *memory, uint length
CODE_STATE *cs=0;
get_code_state_or_return;
- if (_db_keyword_(cs, (char*) keyword))
+ if (_db_keyword_(cs, keyword))
{
if (!cs->locked)
pthread_mutex_lock(&THR_LOCK_dbug);
@@ -1182,8 +1183,8 @@ void _db_dump_(uint _line_, const char *keyword, const char *memory, uint length
{
fprintf(cs->stack->out_file, "%s: ", cs->func);
}
- sprintf(dbuff,"%s: Memory: 0x%lx Bytes: (%d)\n",
- keyword,(ulong) memory, length);
+ sprintf(dbuff,"%s: Memory: 0x%lx Bytes: (%ld)\n",
+ keyword, (ulong) memory, (long) length);
(void) fputs(dbuff,cs->stack->out_file);
pos=0;
@@ -1292,7 +1293,7 @@ static struct link *ListDel(struct link *head,
{
struct link *delme=*cur;
*cur=(*cur)->next_link;
- free((char*)delme);
+ free((void*) delme);
}
} while (*cur && *(cur=&((*cur)->next_link)));
}
@@ -1448,10 +1449,11 @@ static void FreeState(CODE_STATE *cs, struct settings *state, int free_state)
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)
DBUGCloseFile(cs, state->prof_file);
if (free_state)
- free((char *) state);
+ free((void*) state);
}
@@ -1696,7 +1698,7 @@ static void FreeList(struct link *linkp)
{
old= linkp;
linkp= linkp->next_link;
- free((char *) old);
+ free((void*) old);
}
}
@@ -1815,7 +1817,7 @@ static void DBUGOpenFile(CODE_STATE *cs,
}
else
{
- if (!Writable((char*)name))
+ if (!Writable(name))
{
(void) fprintf(stderr, ERR_OPEN, cs->process, name);
perror("");
@@ -1881,7 +1883,6 @@ static FILE *OpenProfile(CODE_STATE *cs, const char *name)
{
(void) fprintf(cs->stack->out_file, ERR_OPEN, cs->process, name);
perror("");
- dbug_flush(0);
(void) Delay(cs->stack->delay);
}
else
@@ -1891,7 +1892,6 @@ static FILE *OpenProfile(CODE_STATE *cs, const char *name)
{
(void) fprintf(cs->stack->out_file, ERR_OPEN, cs->process, name);
perror("");
- dbug_flush(0);
}
else
{
@@ -1930,7 +1930,7 @@ static void DBUGCloseFile(CODE_STATE *cs, FILE *fp)
pthread_mutex_lock(&THR_LOCK_dbug);
(void) fprintf(cs->stack->out_file, ERR_CLOSE, cs->process);
perror("");
- dbug_flush(0);
+ dbug_flush(cs);
}
}
@@ -1988,7 +1988,7 @@ static char *DbugMalloc(size_t size)
{
register char *new_malloc;
- if (!(new_malloc= (char*) malloc((size_t) size)))
+ if (!(new_malloc= (char*) malloc(size)))
DbugExit("out of memory");
return new_malloc;
}
@@ -2062,7 +2062,7 @@ static const char *BaseName(const char *pathname)
#ifndef Writable
-static BOOLEAN Writable(char *pathname)
+static BOOLEAN Writable(const char *pathname)
{
REGISTER BOOLEAN granted;
REGISTER char *lastslash;
diff --git a/extra/CMakeLists.txt b/extra/CMakeLists.txt
index 1722c9da5f2..42561a97888 100644..100755
--- a/extra/CMakeLists.txt
+++ b/extra/CMakeLists.txt
@@ -20,7 +20,7 @@ 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 dbug mysys strings zlib wsock32)
+TARGET_LINK_LIBRARIES(comp_err debug dbug mysys strings zlib wsock32)
GET_TARGET_PROPERTY(COMP_ERR_EXE comp_err LOCATION)
@@ -39,13 +39,13 @@ ADD_CUSTOM_TARGET(GenError
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 dbug taocrypt wsock32)
+TARGET_LINK_LIBRARIES(my_print_defaults strings mysys debug dbug taocrypt wsock32)
ADD_EXECUTABLE(perror perror.c)
-TARGET_LINK_LIBRARIES(perror strings mysys dbug wsock32)
+TARGET_LINK_LIBRARIES(perror strings mysys debug dbug wsock32)
ADD_EXECUTABLE(replace replace.c)
-TARGET_LINK_LIBRARIES(replace strings mysys dbug wsock32)
+TARGET_LINK_LIBRARIES(replace strings mysys debug dbug wsock32)
IF(EMBED_MANIFESTS)
MYSQL_EMBED_MANIFEST("myTest" "asInvoker")
diff --git a/extra/Makefile.am b/extra/Makefile.am
index b2d504cfb62..bc7289c7f7d 100644
--- a/extra/Makefile.am
+++ b/extra/Makefile.am
@@ -24,6 +24,7 @@ BUILT_SOURCES= $(top_builddir)/include/mysqld_error.h \
pkginclude_HEADERS= $(BUILT_SOURCES)
DISTCLEANFILES = $(BUILT_SOURCES)
SUBDIRS = @yassl_dir@
+DIST_SUBDIRS = yassl
# This will build mysqld_error.h, mysqld_ername.h and sql_state.h
# NOTE Built files should depend on their sources to avoid
diff --git a/extra/comp_err.c b/extra/comp_err.c
index 3f7664405ad..3e540d8f481 100644
--- a/extra/comp_err.c
+++ b/extra/comp_err.c
@@ -99,31 +99,31 @@ static struct my_option my_long_options[]=
{"debug", '#', "This is a non-debug version. Catch this and exit",
0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
#else
- {"debug", '#', "Output debug log", (gptr *) & default_dbug_option,
- (gptr *) & default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug", '#', "Output debug log", (uchar**) & default_dbug_option,
+ (uchar**) & default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"debug-info", 'T', "Print some debug info at exit.", (gptr *) & info_flag,
- (gptr *) & info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug-info", 'T', "Print some debug info at exit.", (uchar**) & info_flag,
+ (uchar**) & info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"help", '?', "Displays this help and exits.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Prints version", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
- {"charset", 'C', "Charset dir", (gptr *) & charsets_dir,
- (gptr *) & charsets_dir,
+ {"charset", 'C', "Charset dir", (uchar**) & charsets_dir,
+ (uchar**) & charsets_dir,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"in_file", 'F', "Input file", (gptr *) & TXTFILE, (gptr *) & TXTFILE,
+ {"in_file", 'F', "Input file", (uchar**) & TXTFILE, (uchar**) & TXTFILE,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"out_dir", 'D', "Output base directory", (gptr *) & DATADIRECTORY,
- (gptr *) & DATADIRECTORY,
+ {"out_dir", 'D', "Output base directory", (uchar**) & DATADIRECTORY,
+ (uchar**) & DATADIRECTORY,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"out_file", 'O', "Output filename (errmsg.sys)", (gptr *) & OUTFILE,
- (gptr *) & OUTFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"header_file", 'H', "mysqld_error.h file ", (gptr *) & HEADERFILE,
- (gptr *) & HEADERFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"name_file", 'N', "mysqld_ername.h file ", (gptr *) & NAMEFILE,
- (gptr *) & NAMEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"state_file", 'S', "sql_state.h file", (gptr *) & STATEFILE,
- (gptr *) & STATEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"out_file", 'O', "Output filename (errmsg.sys)", (uchar**) & OUTFILE,
+ (uchar**) & OUTFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"header_file", 'H', "mysqld_error.h file ", (uchar**) & HEADERFILE,
+ (uchar**) & HEADERFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"name_file", 'N', "mysqld_ername.h file ", (uchar**) & NAMEFILE,
+ (uchar**) & NAMEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"state_file", 'S', "sql_state.h file", (uchar**) & STATEFILE,
+ (uchar**) & STATEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -241,7 +241,7 @@ static int create_header_files(struct errors *error_head)
/* generating sql_state.h file */
if (tmp_error->sql_code1[0] || tmp_error->sql_code2[0])
fprintf(sql_statef,
- "%-40s,\"%s\", \"%s\",\n", tmp_error->er_name,
+ "{ %-40s,\"%s\", \"%s\" },\n", tmp_error->er_name,
tmp_error->sql_code1, tmp_error->sql_code2);
/*generating er_name file */
fprintf(er_namef, "{ \"%s\", %d },\n", tmp_error->er_name,
@@ -329,21 +329,21 @@ static int create_sys_files(struct languages *lang_head,
/* continue with header of the errmsg.sys file */
length= ftell(to) - HEADER_LENGTH - row_count * 2;
- bzero((gptr) head, HEADER_LENGTH);
- bmove((byte *) head, (byte *) file_head, 4);
+ bzero((uchar*) head, HEADER_LENGTH);
+ bmove((uchar *) head, (uchar *) file_head, 4);
head[4]= 1;
int2store(head + 6, length);
int2store(head + 8, row_count);
head[30]= csnum;
my_fseek(to, 0l, MY_SEEK_SET, MYF(0));
- if (my_fwrite(to, (byte*) head, HEADER_LENGTH, MYF(MY_WME | MY_FNABP)))
+ if (my_fwrite(to, (uchar*) head, HEADER_LENGTH, MYF(MY_WME | MY_FNABP)))
goto err;
for (i= 0; i < row_count; i++)
{
int2store(head, file_pos[i]);
- if (my_fwrite(to, (byte*) head, 2, MYF(MY_WME | MY_FNABP)))
+ if (my_fwrite(to, (uchar*) head, 2, MYF(MY_WME | MY_FNABP)))
goto err;
}
my_fclose(to, MYF(0));
@@ -362,7 +362,7 @@ static void clean_up(struct languages *lang_head, struct errors *error_head)
struct errors *tmp_error, *next_error;
uint count, i;
- my_free((gptr) default_language, MYF(0));
+ my_free((uchar*) default_language, MYF(0));
for (tmp_lang= lang_head; tmp_lang; tmp_lang= next_language)
{
@@ -370,7 +370,7 @@ static void clean_up(struct languages *lang_head, struct errors *error_head)
my_free(tmp_lang->lang_short_name, MYF(0));
my_free(tmp_lang->lang_long_name, MYF(0));
my_free(tmp_lang->charset, MYF(0));
- my_free((gptr) tmp_lang, MYF(0));
+ my_free((uchar*) tmp_lang, MYF(0));
}
for (tmp_error= error_head; tmp_error; tmp_error= next_error)
@@ -381,17 +381,17 @@ static void clean_up(struct languages *lang_head, struct errors *error_head)
{
struct message *tmp;
tmp= dynamic_element(&tmp_error->msg, i, struct message*);
- my_free((gptr) tmp->lang_short_name, MYF(0));
- my_free((gptr) tmp->text, MYF(0));
+ my_free((uchar*) tmp->lang_short_name, MYF(0));
+ my_free((uchar*) tmp->text, MYF(0));
}
delete_dynamic(&tmp_error->msg);
if (tmp_error->sql_code1[0])
- my_free((gptr) tmp_error->sql_code1, MYF(0));
+ my_free((uchar*) tmp_error->sql_code1, MYF(0));
if (tmp_error->sql_code2[0])
- my_free((gptr) tmp_error->sql_code2, MYF(0));
- my_free((gptr) tmp_error->er_name, MYF(0));
- my_free((gptr) tmp_error, MYF(0));
+ my_free((uchar*) tmp_error->sql_code2, MYF(0));
+ my_free((uchar*) tmp_error->er_name, MYF(0));
+ my_free((uchar*) tmp_error, MYF(0));
}
}
@@ -471,7 +471,7 @@ static int parse_input_file(const char *file_name, struct errors **top_error,
current_error->er_name, current_message.lang_short_name);
DBUG_RETURN(0);
}
- if (insert_dynamic(&current_error->msg, (byte *) & current_message))
+ if (insert_dynamic(&current_error->msg, (uchar *) & current_message))
DBUG_RETURN(0);
continue;
}
@@ -534,7 +534,7 @@ static uint parse_error_offset(char *str)
end= 0;
ioffset= (uint) my_strtoll10(soffset, &end, &error);
- my_free((gptr) soffset, MYF(0));
+ my_free((uchar*) soffset, MYF(0));
DBUG_RETURN(ioffset);
}
diff --git a/extra/innochecksum.c b/extra/innochecksum.c
index 33f925a4cad..524637a1729 100644
--- a/extra/innochecksum.c
+++ b/extra/innochecksum.c
@@ -51,10 +51,10 @@
/* another argument to specify page ranges... seek to right spot and go from there */
typedef unsigned long int ulint;
-typedef unsigned char byte;
+typedef unsigned char uchar;
/* innodb function in name; modified slightly to not have the ASM version (lots of #ifs that didn't apply) */
-ulint mach_read_from_4(byte *b)
+ulint mach_read_from_4(uchar *b)
{
return( ((ulint)(b[0]) << 24)
+ ((ulint)(b[1]) << 16)
@@ -78,7 +78,7 @@ ulint
ut_fold_binary(
/*===========*/
/* out: folded value */
- byte* str, /* in: string of bytes */
+ uchar* str, /* in: string of bytes */
ulint len) /* in: length */
{
ulint i;
@@ -98,7 +98,7 @@ ulint
buf_calc_page_new_checksum(
/*=======================*/
/* out: checksum */
- byte* page) /* in: buffer page */
+ uchar* page) /* in: buffer page */
{
ulint checksum;
@@ -123,7 +123,7 @@ ulint
buf_calc_page_old_checksum(
/*=======================*/
/* out: checksum */
- byte* page) /* in: buffer page */
+ uchar* page) /* in: buffer page */
{
ulint checksum;
@@ -138,7 +138,7 @@ buf_calc_page_old_checksum(
int main(int argc, char **argv)
{
FILE *f; /* our input file */
- byte *p; /* storage of pages read */
+ uchar *p; /* storage of pages read */
int bytes; /* bytes read count */
ulint ct; /* current page number (0 based) */
int now; /* current time */
@@ -256,7 +256,7 @@ int main(int argc, char **argv)
}
/* allocate buffer for reading (so we don't realloc every time) */
- p= (byte *)malloc(UNIV_PAGE_SIZE);
+ p= (uchar *)malloc(UNIV_PAGE_SIZE);
/* main checksumming loop */
ct= start_page;
diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c
index f5f7e68c9e6..06f7e51c380 100644
--- a/extra/my_print_defaults.c
+++ b/extra/my_print_defaults.c
@@ -47,30 +47,30 @@ static struct my_option my_long_options[] =
added if the file has no extension)
*/
{"config-file", 'c', "Deprecated, please use --defaults-file instead. Name of config file to read; if no extension is given, default extension (e.g., .ini or .cnf) will be added",
- (gptr*) &config_file, (gptr*) &config_file, 0, GET_STR, REQUIRED_ARG,
+ (uchar**) &config_file, (uchar**) &config_file, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
#ifdef DBUG_OFF
{"debug", '#', "This is a non-debug version. Catch this and exit",
0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
#else
- {"debug", '#', "Output debug log", (gptr*) &default_dbug_option,
- (gptr*) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug", '#', "Output debug log", (uchar**) &default_dbug_option,
+ (uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"defaults-file", 'c', "Like --config-file, except: if first option, then read this file only, do not read global or per-user config files; should be the first option",
- (gptr*) &config_file, (gptr*) &config_file, 0, GET_STR, REQUIRED_ARG,
+ (uchar**) &config_file, (uchar**) &config_file, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"defaults-extra-file", 'e',
"Read this file after the global config file and before the config file in the users home directory; should be the first option",
- (gptr*) &my_defaults_extra_file, (gptr*) &my_defaults_extra_file, 0,
+ (uchar**) &my_defaults_extra_file, (uchar**) &my_defaults_extra_file, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"defaults-group-suffix", 'g',
"In addition to the given groups, read also groups with this suffix",
- (gptr*) &my_defaults_group_suffix, (gptr*) &my_defaults_group_suffix,
+ (uchar**) &my_defaults_group_suffix, (uchar**) &my_defaults_group_suffix,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"extra-file", 'e',
"Deprecated. Synonym for --defaults-extra-file.",
- (gptr*) &my_defaults_extra_file,
- (gptr*) &my_defaults_extra_file, 0, GET_STR,
+ (uchar**) &my_defaults_extra_file,
+ (uchar**) &my_defaults_extra_file, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"no-defaults", 'n', "Return an empty string (useful for scripts).",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
diff --git a/extra/mysql_waitpid.c b/extra/mysql_waitpid.c
index a166e6b15af..42465998862 100644
--- a/extra/mysql_waitpid.c
+++ b/extra/mysql_waitpid.c
@@ -38,7 +38,7 @@ static struct my_option my_long_options[] =
0, 0, 0, 0, 0},
{"verbose", 'v',
"Be more verbose. Give a warning, if kill can't handle signal 0.",
- (gptr*) &verbose, (gptr*) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ (uchar**) &verbose, (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Print version information and exit.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
diff --git a/extra/perror.c b/extra/perror.c
index c49869be681..fba7b69bfe4 100644
--- a/extra/perror.c
+++ b/extra/perror.c
@@ -25,6 +25,7 @@
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
#include "../storage/ndb/src/ndbapi/ndberror.c"
#include "../storage/ndb/src/kernel/error/ndbd_exit_codes.c"
+#include "../storage/ndb/include/mgmapi/mgmapi_error.h"
#endif
static my_bool verbose, print_all_codes;
@@ -32,6 +33,20 @@ static my_bool verbose, print_all_codes;
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
static my_bool ndb_code;
static char ndb_string[1024];
+int mgmapi_error_string(int err_no, char *str, int size)
+{
+ int i;
+ for (i= 0; i < ndb_mgm_noOfErrorMsgs; i++)
+ {
+ if ((int)ndb_mgm_error_msgs[i].code == err_no)
+ {
+ my_snprintf(str, size-1, "%s", ndb_mgm_error_msgs[i].msg);
+ str[size-1]= '\0';
+ return 0;
+ }
+ }
+ return -1;
+}
#endif
static struct my_option my_long_options[] =
@@ -41,18 +56,18 @@ static struct my_option my_long_options[] =
{"info", 'I', "Synonym for --help.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
- {"ndb", 257, "Ndbcluster storage engine specific error codes.", (gptr*) &ndb_code,
- (gptr*) &ndb_code, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"ndb", 257, "Ndbcluster storage engine specific error codes.", (uchar**) &ndb_code,
+ (uchar**) &ndb_code, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
#ifdef HAVE_SYS_ERRLIST
{"all", 'a', "Print all the error messages and the number.",
- (gptr*) &print_all_codes, (gptr*) &print_all_codes, 0, GET_BOOL, NO_ARG,
+ (uchar**) &print_all_codes, (uchar**) &print_all_codes, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
#endif
{"silent", 's', "Only print the error message.", 0, 0, 0, GET_NO_ARG, NO_ARG,
0, 0, 0, 0, 0, 0},
- {"verbose", 'v', "Print error code and message (default).", (gptr*) &verbose,
- (gptr*) &verbose, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+ {"verbose", 'v', "Print error code and message (default).", (uchar**) &verbose,
+ (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"version", 'V', "Displays version information and exits.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
@@ -238,8 +253,9 @@ int main(int argc,char *argv[])
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
if (ndb_code)
{
- if ((ndb_error_string(code, ndb_string, sizeof(ndb_string)) < 0) &&
- (ndbd_exit_string(code, ndb_string, sizeof(ndb_string)) < 0))
+ if ((ndb_error_string(code, ndb_string, sizeof(ndb_string)) < 0) &&
+ (ndbd_exit_string(code, ndb_string, sizeof(ndb_string)) < 0) &&
+ (mgmapi_error_string(code, ndb_string, sizeof(ndb_string)) < 0))
{
msg= 0;
}
diff --git a/extra/replace.c b/extra/replace.c
index de0a4b05764..9d1d8335014 100644
--- a/extra/replace.c
+++ b/extra/replace.c
@@ -51,7 +51,7 @@
typedef struct st_pointer_array { /* when using array-strings */
TYPELIB typelib; /* Pointer to strings */
- byte *str; /* Strings is here */
+ uchar *str; /* Strings is here */
int7 *flag; /* Flag about each var. */
uint array_allocs,max_count,length,max_length;
} POINTER_ARRAY;
@@ -83,14 +83,14 @@ static int static_get_options(int *argc,char * * *argv);
static int get_replace_strings(int *argc,char * * *argv,
POINTER_ARRAY *from_array,
POINTER_ARRAY *to_array);
-static int insert_pointer_name(POINTER_ARRAY *pa, my_string name);
+static int insert_pointer_name(POINTER_ARRAY *pa, char * name);
static void free_pointer_array(POINTER_ARRAY *pa);
static int convert_pipe(REPLACE *,FILE *,FILE *);
-static int convert_file(REPLACE *, my_string);
-static REPLACE *init_replace(my_string *from, my_string *to,uint count,
- my_string word_end_chars);
-static uint replace_strings(REPLACE *rep, my_string *start,uint *max_length,
- my_string from);
+static int convert_file(REPLACE *, char *);
+static REPLACE *init_replace(char * *from, char * *to,uint count,
+ char * word_end_chars);
+static uint replace_strings(REPLACE *rep, char * *start,uint *max_length,
+ char * from);
static int initialize_buffer(void);
static void reset_buffer(void);
static void free_buffer(void);
@@ -245,10 +245,10 @@ POINTER_ARRAY *from_array,*to_array;
return 0;
}
-static int insert_pointer_name(reg1 POINTER_ARRAY *pa,my_string name)
+static int insert_pointer_name(reg1 POINTER_ARRAY *pa,char * name)
{
uint i,length,old_count;
- byte *new_pos;
+ uchar *new_pos;
const char **new_array;
DBUG_ENTER("insert_pointer_name");
@@ -256,16 +256,16 @@ static int insert_pointer_name(reg1 POINTER_ARRAY *pa,my_string name)
{
if (!(pa->typelib.type_names=(const char **)
my_malloc(((PC_MALLOC-MALLOC_OVERHEAD)/
- (sizeof(my_string)+sizeof(*pa->flag))*
- (sizeof(my_string)+sizeof(*pa->flag))),MYF(MY_WME))))
+ (sizeof(char *)+sizeof(*pa->flag))*
+ (sizeof(char *)+sizeof(*pa->flag))),MYF(MY_WME))))
DBUG_RETURN(-1);
- if (!(pa->str= (byte*) my_malloc((uint) (PS_MALLOC-MALLOC_OVERHEAD),
+ if (!(pa->str= (uchar*) my_malloc((uint) (PS_MALLOC-MALLOC_OVERHEAD),
MYF(MY_WME))))
{
- my_free((gptr) pa->typelib.type_names,MYF(0));
+ my_free((uchar*) pa->typelib.type_names,MYF(0));
DBUG_RETURN (-1);
}
- pa->max_count=(PC_MALLOC-MALLOC_OVERHEAD)/(sizeof(byte*)+
+ pa->max_count=(PC_MALLOC-MALLOC_OVERHEAD)/(sizeof(uchar*)+
sizeof(*pa->flag));
pa->flag= (int7*) (pa->typelib.type_names+pa->max_count);
pa->length=0;
@@ -277,7 +277,7 @@ static int insert_pointer_name(reg1 POINTER_ARRAY *pa,my_string name)
{
pa->max_length=(pa->length+length+MALLOC_OVERHEAD+PS_MALLOC-1)/PS_MALLOC;
pa->max_length=pa->max_length*PS_MALLOC-MALLOC_OVERHEAD;
- if (!(new_pos= (byte*) my_realloc((gptr) pa->str,
+ if (!(new_pos= (uchar*) my_realloc((uchar*) pa->str,
(uint) pa->max_length,
MYF(MY_WME))))
DBUG_RETURN(1);
@@ -295,23 +295,23 @@ static int insert_pointer_name(reg1 POINTER_ARRAY *pa,my_string name)
int len;
pa->array_allocs++;
len=(PC_MALLOC*pa->array_allocs - MALLOC_OVERHEAD);
- if (!(new_array=(const char **) my_realloc((gptr) pa->typelib.type_names,
+ if (!(new_array=(const char **) my_realloc((uchar*) pa->typelib.type_names,
(uint) len/
- (sizeof(byte*)+sizeof(*pa->flag))*
- (sizeof(byte*)+sizeof(*pa->flag)),
+ (sizeof(uchar*)+sizeof(*pa->flag))*
+ (sizeof(uchar*)+sizeof(*pa->flag)),
MYF(MY_WME))))
DBUG_RETURN(1);
pa->typelib.type_names=new_array;
old_count=pa->max_count;
- pa->max_count=len/(sizeof(byte*) + sizeof(*pa->flag));
+ pa->max_count=len/(sizeof(uchar*) + sizeof(*pa->flag));
pa->flag= (int7*) (pa->typelib.type_names+pa->max_count);
- memcpy((byte*) pa->flag,(my_string) (pa->typelib.type_names+old_count),
+ memcpy((uchar*) pa->flag,(char *) (pa->typelib.type_names+old_count),
old_count*sizeof(*pa->flag));
}
pa->flag[pa->typelib.count]=0; /* Reset flag */
- pa->typelib.type_names[pa->typelib.count++]= pa->str+pa->length;
+ pa->typelib.type_names[pa->typelib.count++]= (char*) (pa->str+pa->length);
pa->typelib.type_names[pa->typelib.count]= NullS; /* Put end-mark */
- VOID(strmov(pa->str+pa->length,name));
+ VOID(strmov((char*) pa->str + pa->length, name));
pa->length+=length;
DBUG_RETURN(0);
} /* insert_pointer_name */
@@ -324,9 +324,9 @@ static void free_pointer_array(reg1 POINTER_ARRAY *pa)
if (pa->typelib.count)
{
pa->typelib.count=0;
- my_free((gptr) pa->typelib.type_names,MYF(0));
+ my_free((uchar*) pa->typelib.type_names,MYF(0));
pa->typelib.type_names=0;
- my_free((gptr) pa->str,MYF(0));
+ my_free((uchar*) pa->str,MYF(0));
}
return;
} /* free_pointer_array */
@@ -380,23 +380,23 @@ static int get_next_bit(REP_SET *set,uint lastpos);
static short find_set(REP_SETS *sets,REP_SET *find);
static short find_found(FOUND_SET *found_set,uint table_offset,
int found_offset);
-static uint start_at_word(my_string pos);
-static uint end_of_word(my_string pos);
-static uint replace_len(my_string pos);
+static uint start_at_word(char * pos);
+static uint end_of_word(char * pos);
+static uint replace_len(char * pos);
static uint found_sets=0;
/* Init a replace structure for further calls */
-static REPLACE *init_replace(my_string *from, my_string *to,uint count,
- my_string word_end_chars)
+static REPLACE *init_replace(char * *from, char * *to,uint count,
+ char * word_end_chars)
{
uint i,j,states,set_nr,len,result_len,max_length,found_end,bits_set,bit_nr;
int used_sets,chr;
short default_state;
char used_chars[LAST_CHAR_CODE],is_word_end[256];
- my_string pos,to_pos,*to_array;
+ char * pos, *to_pos, **to_array;
REP_SETS sets;
REP_SET *set,*start_states,*word_states,*new_set;
FOLLOWS *follow,*follow_ptr;
@@ -441,7 +441,7 @@ static REPLACE *init_replace(my_string *from, my_string *to,uint count,
if (!(follow=(FOLLOWS*) my_malloc((states+2)*sizeof(FOLLOWS),MYF(MY_WME))))
{
free_sets(&sets);
- my_free((gptr) found_set,MYF(0));
+ my_free((uchar*) found_set,MYF(0));
DBUG_RETURN(0);
}
@@ -632,12 +632,12 @@ static REPLACE *init_replace(my_string *from, my_string *to,uint count,
if ((replace=(REPLACE*) my_malloc(sizeof(REPLACE)*(sets.count)+
sizeof(REPLACE_STRING)*(found_sets+1)+
- sizeof(my_string)*count+result_len,
+ sizeof(char *)*count+result_len,
MYF(MY_WME | MY_ZEROFILL))))
{
rep_str=(REPLACE_STRING*) (replace+sets.count);
- to_array=(my_string*) (rep_str+found_sets+1);
- to_pos=(my_string) (to_array+count);
+ to_array=(char **) (rep_str+found_sets+1);
+ to_pos=(char *) (to_array+count);
for (i=0 ; i < count ; i++)
{
to_array[i]=to_pos;
@@ -663,9 +663,9 @@ static REPLACE *init_replace(my_string *from, my_string *to,uint count,
replace[i].next[j]=(REPLACE*) (rep_str+(-sets.set[i].next[j]-1));
}
}
- my_free((gptr) follow,MYF(0));
+ my_free((uchar*) follow,MYF(0));
free_sets(&sets);
- my_free((gptr) found_set,MYF(0));
+ my_free((uchar*) found_set,MYF(0));
DBUG_PRINT("exit",("Replace table has %d states",sets.count));
DBUG_RETURN(replace);
}
@@ -681,7 +681,7 @@ static int init_sets(REP_SETS *sets,uint states)
if (!(sets->bit_buffer=(uint*) my_malloc(sizeof(uint)*sets->size_of_bits*
SET_MALLOC_HUNC,MYF(MY_WME))))
{
- my_free((gptr) sets->set,MYF(0));
+ my_free((uchar*) sets->set,MYF(0));
return 1;
}
return 0;
@@ -713,13 +713,13 @@ static REP_SET *make_new_set(REP_SETS *sets)
return set;
}
count=sets->count+sets->invisible+SET_MALLOC_HUNC;
- if (!(set=(REP_SET*) my_realloc((gptr) sets->set_buffer,
+ if (!(set=(REP_SET*) my_realloc((uchar*) sets->set_buffer,
sizeof(REP_SET)*count,
MYF(MY_WME))))
return 0;
sets->set_buffer=set;
sets->set=set+sets->invisible;
- if (!(bit_buffer=(uint*) my_realloc((gptr) sets->bit_buffer,
+ if (!(bit_buffer=(uint*) my_realloc((uchar*) sets->bit_buffer,
(sizeof(uint)*sets->size_of_bits)*count,
MYF(MY_WME))))
return 0;
@@ -742,8 +742,8 @@ static void free_last_set(REP_SETS *sets)
static void free_sets(REP_SETS *sets)
{
- my_free((gptr)sets->set_buffer,MYF(0));
- my_free((gptr)sets->bit_buffer,MYF(0));
+ my_free((uchar*)sets->set_buffer,MYF(0));
+ my_free((uchar*)sets->bit_buffer,MYF(0));
return;
}
@@ -770,13 +770,13 @@ static void or_bits(REP_SET *to,REP_SET *from)
static void copy_bits(REP_SET *to,REP_SET *from)
{
- memcpy((byte*) to->bits,(byte*) from->bits,
+ memcpy((uchar*) to->bits,(uchar*) from->bits,
(size_t) (sizeof(uint) * to->size_of_bits));
}
static int cmp_bits(REP_SET *set1,REP_SET *set2)
{
- return bcmp((byte*) set1->bits,(byte*) set2->bits,
+ return bcmp((uchar*) set1->bits,(uchar*) set2->bits,
sizeof(uint) * set1->size_of_bits);
}
@@ -847,21 +847,21 @@ static short find_found(FOUND_SET *found_set,uint table_offset,
/* Return 1 if regexp starts with \b or ends with \b*/
-static uint start_at_word(my_string pos)
+static uint start_at_word(char * pos)
{
return (((!bcmp(pos,"\\b",2) && pos[2]) || !bcmp(pos,"\\^",2)) ? 1 : 0);
}
-static uint end_of_word(my_string pos)
+static uint end_of_word(char * pos)
{
- my_string end=strend(pos);
+ char * end=strend(pos);
return ((end > pos+2 && !bcmp(end-2,"\\b",2)) ||
(end >= pos+2 && !bcmp(end-2,"\\$",2))) ?
1 : 0;
}
-static uint replace_len(my_string str)
+static uint replace_len(char * str)
{
uint len=0;
while (*str)
@@ -877,12 +877,12 @@ static uint replace_len(my_string str)
/* The actual loop */
-static uint replace_strings(REPLACE *rep, my_string *start,uint *max_length,
- my_string from)
+static uint replace_strings(REPLACE *rep, char **start, uint *max_length,
+ char *from)
{
reg1 REPLACE *rep_pos;
reg2 REPLACE_STRING *rep_str;
- my_string to,end,pos,new;
+ char *to, *end, *pos, *new;
end=(to= *start) + *max_length-1;
rep_pos=rep+1;
@@ -903,7 +903,7 @@ static uint replace_strings(REPLACE *rep, my_string *start,uint *max_length,
}
if (!(rep_str = ((REPLACE_STRING*) rep_pos))->replace_string)
return (uint) (to - *start)-1;
- updated=1; /* Some my_string is replaced */
+ updated=1; /* Some char * is replaced */
to-=rep_str->to_offset;
for (pos=rep_str->replace_string; *pos ; pos++)
{
@@ -988,7 +988,8 @@ int n;
return 0;
/* Read in new stuff. */
- if ((i=(int) my_read(fd, buffer + bufbytes, (uint) bufread,MYF(MY_WME))) < 0)
+ if ((i=(int) my_read(fd, (uchar*) buffer + bufbytes,
+ (size_t) bufread, MYF(MY_WME))) < 0)
return -1;
/* Kludge to pretend every nonempty file ends with a newline. */
@@ -1039,7 +1040,7 @@ FILE *in,*out;
return 1;
if (!my_eof)
out_buff[length++]=save_char; /* Don't write added newline */
- if (my_fwrite(out,out_buff,length,MYF(MY_WME | MY_NABP)))
+ if (my_fwrite(out, (uchar*) out_buff, length, MYF(MY_WME | MY_NABP)))
DBUG_RETURN(1);
}
}
@@ -1047,7 +1048,7 @@ FILE *in,*out;
}
-static int convert_file(REPLACE *rep, my_string name)
+static int convert_file(REPLACE *rep, char * name)
{
int error;
FILE *in,*out;
@@ -1056,6 +1057,7 @@ static int convert_file(REPLACE *rep, my_string name)
char link_name[FN_REFLEN];
#endif
File temp_file;
+ size_t dir_buff_length;
DBUG_ENTER("convert_file");
/* check if name is a symlink */
@@ -1065,7 +1067,7 @@ static int convert_file(REPLACE *rep, my_string name)
#endif
if (!(in= my_fopen(org_name,O_RDONLY,MYF(MY_WME))))
DBUG_RETURN(1);
- dirname_part(dir_buff,org_name);
+ dirname_part(dir_buff, org_name, &dir_buff_length);
if ((temp_file= create_temp_file(tempname, dir_buff, "PR", O_WRONLY,
MYF(MY_WME))) < 0)
{
diff --git a/extra/resolve_stack_dump.c b/extra/resolve_stack_dump.c
index 04ab8a30f0d..5606c17ecf3 100644
--- a/extra/resolve_stack_dump.c
+++ b/extra/resolve_stack_dump.c
@@ -53,10 +53,10 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_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},
- {"symbols-file", 's', "Use specified symbols file.", (gptr*) &sym_fname,
- (gptr*) &sym_fname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"symbols-file", 's', "Use specified symbols file.", (uchar**) &sym_fname,
+ (uchar**) &sym_fname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"numeric-dump-file", 'n', "Read the dump from specified file.",
- (gptr*) &dump_fname, (gptr*) &dump_fname, 0, GET_STR, REQUIRED_ARG,
+ (uchar**) &dump_fname, (uchar**) &dump_fname, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -235,7 +235,7 @@ static void init_sym_table()
SYM_ENTRY se;
if (init_sym_entry(&se, buf))
continue;
- if (insert_dynamic(&sym_table, (gptr)&se))
+ if (insert_dynamic(&sym_table, (uchar*)&se))
die("insert_dynamic() failed - looks like we are out of memory");
}
@@ -255,7 +255,7 @@ static void verify_sort()
for (i = 0; i < sym_table.elements; i++)
{
SYM_ENTRY se;
- get_dynamic(&sym_table, (gptr)&se, i);
+ get_dynamic(&sym_table, (uchar*)&se, i);
if (se.addr < last)
die("sym table does not appear to be sorted, did you forget \
--numeric-sort arg to nm? trouble addr = %p, last = %p", se.addr, last);
@@ -267,16 +267,16 @@ static void verify_sort()
static SYM_ENTRY* resolve_addr(uchar* addr, SYM_ENTRY* se)
{
uint i;
- get_dynamic(&sym_table, (gptr)se, 0);
+ get_dynamic(&sym_table, (uchar*)se, 0);
if (addr < se->addr)
return 0;
for (i = 1; i < sym_table.elements; i++)
{
- get_dynamic(&sym_table, (gptr)se, i);
+ get_dynamic(&sym_table, (uchar*)se, i);
if (addr < se->addr)
{
- get_dynamic(&sym_table, (gptr)se, i - 1);
+ get_dynamic(&sym_table, (uchar*)se, i - 1);
return se;
}
}
diff --git a/extra/resolveip.c b/extra/resolveip.c
index 5bbecab5e6b..b61c0871aaf 100644
--- a/extra/resolveip.c
+++ b/extra/resolveip.c
@@ -43,7 +43,7 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"info", 'I', "Synonym for --help.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"silent", 's', "Be more silent.", (gptr*) &silent, (gptr*) &silent,
+ {"silent", 's', "Be more silent.", (uchar**) &silent, (uchar**) &silent,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Displays version information and exits.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -83,7 +83,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
return 0;
}
-/*static my_string load_default_groups[]= { "resolveip","client",0 }; */
+/*static char * load_default_groups[]= { "resolveip","client",0 }; */
static int get_options(int *argc,char ***argv)
{
diff --git a/extra/yassl/CMakeLists.txt b/extra/yassl/CMakeLists.txt
index 5cc97f22a36..26e682cbb0c 100644..100755
--- a/extra/yassl/CMakeLists.txt
+++ b/extra/yassl/CMakeLists.txt
@@ -13,9 +13,15 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-ADD_DEFINITIONS("-DWIN32 -D_LIB -DYASSL_PREFIX")
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/extra/yassl/include
+ ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/include
+ ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL)
-INCLUDE_DIRECTORIES(include taocrypt/include taocrypt/mySTL)
-ADD_LIBRARY(yassl src/buffer.cpp src/cert_wrapper.cpp src/crypto_wrapper.cpp src/handshake.cpp src/lock.cpp
+ADD_DEFINITIONS("-D_LIB -DYASSL_PREFIX")
+
+SET(YASSL_SOURCES src/buffer.cpp src/cert_wrapper.cpp src/crypto_wrapper.cpp src/handshake.cpp src/lock.cpp
src/log.cpp src/socket_wrapper.cpp src/ssl.cpp src/timer.cpp src/yassl_error.cpp
src/yassl_imp.cpp src/yassl_int.cpp)
+IF(NOT SOURCE_SUBLIBS)
+ ADD_LIBRARY(yassl ${YASSL_SOURCES})
+ENDIF(NOT SOURCE_SUBLIBS)
diff --git a/extra/yassl/include/openssl/crypto.h b/extra/yassl/include/openssl/crypto.h
index 288990e1318..f53e5231027 100644
--- a/extra/yassl/include/openssl/crypto.h
+++ b/extra/yassl/include/openssl/crypto.h
@@ -9,6 +9,7 @@
const char* SSLeay_version(int type);
+#define SSLEAY_NUMBER_DEFINED
#define SSLEAY_VERSION 0x0900L
#define SSLEAY_VERSION_NUMBER SSLEAY_VERSION
diff --git a/extra/yassl/include/openssl/des_old.h b/extra/yassl/include/openssl/des_old.h
new file mode 100644
index 00000000000..40e8fbc02af
--- /dev/null
+++ b/extra/yassl/include/openssl/des_old.h
@@ -0,0 +1 @@
+/* des_old.h for openvn */
diff --git a/extra/yassl/include/openssl/evp.h b/extra/yassl/include/openssl/evp.h
new file mode 100644
index 00000000000..1d66b08df46
--- /dev/null
+++ b/extra/yassl/include/openssl/evp.h
@@ -0,0 +1,10 @@
+/* evp.h for openSSL */
+
+#ifndef SSLEAY_NUMBER_DEFINED
+#define SSLEAY_NUMBER_DEFINED
+
+/* for OpenVPN */
+#define SSLEAY_VERSION_NUMBER 0x0090700f
+
+
+#endif /* SSLEAY_NUMBER_DEFINED */
diff --git a/extra/yassl/include/openssl/hmac.h b/extra/yassl/include/openssl/hmac.h
new file mode 100644
index 00000000000..a2eae4c08c1
--- /dev/null
+++ b/extra/yassl/include/openssl/hmac.h
@@ -0,0 +1 @@
+/* hmac.h for openvpn */
diff --git a/extra/yassl/include/openssl/objects.h b/extra/yassl/include/openssl/objects.h
new file mode 100644
index 00000000000..99f2326e51b
--- /dev/null
+++ b/extra/yassl/include/openssl/objects.h
@@ -0,0 +1 @@
+/* objects.h for openvpn */
diff --git a/extra/yassl/include/openssl/prefix_ssl.h b/extra/yassl/include/openssl/prefix_ssl.h
index dc6e3ef81f0..3a3a8c26c9c 100644
--- a/extra/yassl/include/openssl/prefix_ssl.h
+++ b/extra/yassl/include/openssl/prefix_ssl.h
@@ -30,6 +30,7 @@
#define SSL_CTX_new yaSSL_CTX_new
#define SSL_new yaSSL_new
#define SSL_set_fd yaSSL_set_fd
+#define SSL_get_fd yaSSL_get_fd
#define SSL_connect yaSSL_connect
#define SSL_write yaSSL_write
#define SSL_read yaSSL_read
@@ -91,6 +92,8 @@
#define SSL_set_rfd yaSSL_set_rfd
#define SSL_set_wfd yaSSL_set_wfd
#define SSL_set_shutdown yaSSL_set_shutdown
+#define SSL_set_quiet_shutdown yaSSL_set_quiet_shutdown
+#define SSL_get_quiet_shutdown yaSSL_get_quiet_shutdown
#define SSL_want_read yaSSL_want_read
#define SSL_want_write yaSSL_want_write
#define SSL_pending yaSSL_pending
diff --git a/extra/yassl/include/openssl/sha.h b/extra/yassl/include/openssl/sha.h
new file mode 100644
index 00000000000..bb487c05c2e
--- /dev/null
+++ b/extra/yassl/include/openssl/sha.h
@@ -0,0 +1 @@
+/* sha.h for openvpn */
diff --git a/extra/yassl/include/openssl/ssl.h b/extra/yassl/include/openssl/ssl.h
index 7dd33e3fcad..c0b87f804ad 100644
--- a/extra/yassl/include/openssl/ssl.h
+++ b/extra/yassl/include/openssl/ssl.h
@@ -34,7 +34,7 @@
#include "rsa.h"
-#define YASSL_VERSION "1.6.5"
+#define YASSL_VERSION "1.7.2"
#if defined(__cplusplus)
@@ -201,6 +201,7 @@ typedef int YASSL_SOCKET_T;
SSL_CTX* SSL_CTX_new(SSL_METHOD*);
SSL* SSL_new(SSL_CTX*);
int SSL_set_fd (SSL*, YASSL_SOCKET_T);
+YASSL_SOCKET_T SSL_get_fd(const SSL*);
int SSL_connect(SSL*);
int SSL_write(SSL*, const void*, int);
int SSL_read(SSL*, void*, int);
@@ -277,6 +278,8 @@ int SSL_session_reused(SSL*);
int SSL_set_rfd(SSL*, int);
int SSL_set_wfd(SSL*, int);
void SSL_set_shutdown(SSL*, int);
+void SSL_set_quiet_shutdown(SSL *ssl,int mode);
+int SSL_get_quiet_shutdown(SSL *ssl);
int SSL_want_read(SSL*);
int SSL_want_write(SSL*);
diff --git a/extra/yassl/include/yassl_int.hpp b/extra/yassl/include/yassl_int.hpp
index 94cb85c3300..b207f0bffbd 100644
--- a/extra/yassl/include/yassl_int.hpp
+++ b/extra/yassl/include/yassl_int.hpp
@@ -584,6 +584,7 @@ class SSL {
Socket socket_; // socket wrapper
Buffers buffers_; // buffered handshakes and data
Log log_; // logger
+ bool quietShutdown_;
// optimization variables
bool has_data_; // buffered data ready?
@@ -610,6 +611,7 @@ public:
Buffers& useBuffers();
bool HasData() const;
+ bool GetQuietShutdown() const;
// sets
void set_pending(Cipher suite);
@@ -621,6 +623,7 @@ public:
void SetError(YasslError);
int SetCompression();
void UnSetCompression();
+ void SetQuietShutdown(bool mode);
// helpers
bool isTLS() const;
diff --git a/extra/yassl/src/handshake.cpp b/extra/yassl/src/handshake.cpp
index 0cd0dfe9c7c..1d5a95820bb 100644
--- a/extra/yassl/src/handshake.cpp
+++ b/extra/yassl/src/handshake.cpp
@@ -719,6 +719,10 @@ int DoProcessReply(SSL& ssl)
// add new data
uint read = ssl.useSocket().receive(buffer.get_buffer() + buffSz, ready);
+ if (read == static_cast<uint>(-1)) {
+ ssl.SetError(receive_error);
+ return 0;
+ }
buffer.add_size(read);
uint offset = 0;
const MessageFactory& mf = ssl.getFactory().getMessage();
diff --git a/extra/yassl/src/socket_wrapper.cpp b/extra/yassl/src/socket_wrapper.cpp
index d53a109d70e..eee5d47377f 100644
--- a/extra/yassl/src/socket_wrapper.cpp
+++ b/extra/yassl/src/socket_wrapper.cpp
@@ -114,8 +114,6 @@ uint Socket::send(const byte* buf, unsigned int sz, int flags) const
const byte* pos = buf;
const byte* end = pos + sz;
- assert(socket_ != INVALID_SOCKET);
-
while (pos != end) {
int sent = ::send(socket_, reinterpret_cast<const char *>(pos),
static_cast<int>(end - pos), flags);
@@ -132,7 +130,6 @@ uint Socket::send(const byte* buf, unsigned int sz, int flags) const
uint Socket::receive(byte* buf, unsigned int sz, int flags)
{
- assert(socket_ != INVALID_SOCKET);
wouldBlock_ = false;
int recvd = ::recv(socket_, reinterpret_cast<char *>(buf), sz, flags);
@@ -163,7 +160,6 @@ bool Socket::wait()
void Socket::shutDown(int how)
{
- assert(socket_ != INVALID_SOCKET);
shutdown(socket_, how);
}
diff --git a/extra/yassl/src/ssl.cpp b/extra/yassl/src/ssl.cpp
index 86dfa1c6ebd..f09a43be56e 100644
--- a/extra/yassl/src/ssl.cpp
+++ b/extra/yassl/src/ssl.cpp
@@ -239,6 +239,12 @@ int SSL_set_fd(SSL* ssl, YASSL_SOCKET_T fd)
}
+YASSL_SOCKET_T SSL_get_fd(const SSL* ssl)
+{
+ return ssl->getSocket().get_fd();
+}
+
+
int SSL_connect(SSL* ssl)
{
if (ssl->GetError() == YasslError(SSL_ERROR_WANT_READ))
@@ -411,8 +417,10 @@ int SSL_clear(SSL* ssl)
int SSL_shutdown(SSL* ssl)
{
- Alert alert(warning, close_notify);
- sendAlert(*ssl, alert);
+ if (!ssl->GetQuietShutdown()) {
+ Alert alert(warning, close_notify);
+ sendAlert(*ssl, alert);
+ }
ssl->useLog().ShowTCP(ssl->getSocket().get_fd(), true);
GetErrors().Remove();
@@ -421,6 +429,18 @@ int SSL_shutdown(SSL* ssl)
}
+void SSL_set_quiet_shutdown(SSL *ssl,int mode)
+{
+ ssl->SetQuietShutdown(mode != 0);
+}
+
+
+int SSL_get_quiet_shutdown(SSL *ssl)
+{
+ return ssl->GetQuietShutdown();
+}
+
+
/* on by default but allow user to turn off */
long SSL_CTX_set_session_cache_mode(SSL_CTX* ctx, long mode)
{
diff --git a/extra/yassl/src/yassl_int.cpp b/extra/yassl/src/yassl_int.cpp
index ae16abf9e49..0b6cb89e77e 100644
--- a/extra/yassl/src/yassl_int.cpp
+++ b/extra/yassl/src/yassl_int.cpp
@@ -291,7 +291,7 @@ const ClientKeyFactory& sslFactory::getClientKey() const
SSL::SSL(SSL_CTX* ctx)
: secure_(ctx->getMethod()->getVersion(), crypto_.use_random(),
ctx->getMethod()->getSide(), ctx->GetCiphers(), ctx,
- ctx->GetDH_Parms().set_), has_data_(false)
+ ctx->GetDH_Parms().set_), quietShutdown_(false), has_data_(false)
{
if (int err = crypto_.get_random().GetError()) {
SetError(YasslError(err));
@@ -774,6 +774,13 @@ void SSL::SetError(YasslError ye)
}
+// set the quiet shutdown mode (close_nofiy not sent or received on shutdown)
+void SSL::SetQuietShutdown(bool mode)
+{
+ quietShutdown_ = mode;
+}
+
+
Buffers& SSL::useBuffers()
{
return buffers_;
@@ -1330,6 +1337,12 @@ YasslError SSL::GetError() const
}
+bool SSL::GetQuietShutdown() const
+{
+ return quietShutdown_;
+}
+
+
bool SSL::GetMultiProtocol() const
{
return secure_.GetContext()->getMethod()->multipleProtocol();
diff --git a/extra/yassl/taocrypt/CMakeLists.txt b/extra/yassl/taocrypt/CMakeLists.txt
index baa8f97dff6..e91fa021de5 100644..100755
--- a/extra/yassl/taocrypt/CMakeLists.txt
+++ b/extra/yassl/taocrypt/CMakeLists.txt
@@ -13,9 +13,10 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-INCLUDE_DIRECTORIES(mySTL include)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL
+ ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/include)
-ADD_LIBRARY(taocrypt src/aes.cpp src/aestables.cpp src/algebra.cpp src/arc4.cpp src/asn.cpp src/coding.cpp
+SET(TAOCRYPT_SOURCES src/aes.cpp src/aestables.cpp src/algebra.cpp src/arc4.cpp src/asn.cpp src/coding.cpp
src/des.cpp src/dh.cpp src/dsa.cpp src/file.cpp src/hash.cpp src/integer.cpp src/md2.cpp
src/md4.cpp src/md5.cpp src/misc.cpp src/random.cpp src/ripemd.cpp src/rsa.cpp src/sha.cpp
include/aes.hpp include/algebra.hpp include/arc4.hpp include/asn.hpp include/block.hpp
@@ -23,3 +24,6 @@ ADD_LIBRARY(taocrypt src/aes.cpp src/aestables.cpp src/algebra.cpp src/arc4.cpp
include/error.hpp include/file.hpp include/hash.hpp include/hmac.hpp include/integer.hpp
include/md2.hpp include/md5.hpp include/misc.hpp include/modarith.hpp include/modes.hpp
include/random.hpp include/ripemd.hpp include/rsa.hpp include/sha.hpp)
+IF(NOT SOURCE_SUBLIBS)
+ ADD_LIBRARY(taocrypt ${TAOCRYPT_SOURCES})
+ENDIF(NOT SOURCE_SUBLIBS)
diff --git a/extra/yassl/taocrypt/src/coding.cpp b/extra/yassl/taocrypt/src/coding.cpp
index 68055b3aff4..7a9d50aaac9 100644
--- a/extra/yassl/taocrypt/src/coding.cpp
+++ b/extra/yassl/taocrypt/src/coding.cpp
@@ -107,11 +107,12 @@ void HexDecoder::Decode()
// sanity checks
assert( b < sizeof(hexDecode)/sizeof(hexDecode[0]) );
assert( b2 < sizeof(hexDecode)/sizeof(hexDecode[0]) );
- assert( b != bad && b2 != bad );
b = hexDecode[b];
b2 = hexDecode[b2];
+ assert( b != bad && b2 != bad );
+
decoded_[i++] = (b << 4) | b2;
bytes -= 2;
}
diff --git a/extra/yassl/taocrypt/src/crypto.cpp b/extra/yassl/taocrypt/src/crypto.cpp
index 82d3b853084..90d406bf0c2 100644
--- a/extra/yassl/taocrypt/src/crypto.cpp
+++ b/extra/yassl/taocrypt/src/crypto.cpp
@@ -26,6 +26,11 @@ extern "C" {
// locking handled internally by library
char CRYPTO_lock() { return 0;}
char CRYPTO_add_lock() { return 0;}
+
+
+ // for openvpn, test are the signatures they use
+ char EVP_CIPHER_CTX_init() { return 0; }
+ char CRYPTO_mem_ctrl() { return 0; }
} // extern "C"
diff --git a/include/Makefile.am b/include/Makefile.am
index b803f614a93..8335da36e93 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -15,25 +15,24 @@
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA
-# FIXME 'abi_check' should be in BUILT_SOURCES, disabled for now
BUILT_SOURCES = $(HEADERS_GEN) link_sources
HEADERS_GEN = mysql_version.h my_config.h
HEADERS_ABI = mysql.h mysql_com.h mysql_time.h \
- my_list.h my_alloc.h typelib.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_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 \
sslopt-vars.h sslopt-case.h sql_common.h keycache.h \
- m_ctype.h mysql/plugin.h my_attribute.h $(HEADERS_GEN)
+ m_ctype.h my_attribute.h $(HEADERS_GEN)
noinst_HEADERS = config-win.h config-netware.h \
heap.h my_bitmap.h my_uctype.h \
myisam.h myisampack.h myisammrg.h ft_global.h\
mysys_err.h my_base.h help_start.h help_end.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 md5.h base64.h \
+ thr_lock.h t_ctype.h violite.h my_md5.h base64.h \
mysql_version.h.in my_handler.h my_time.h \
my_vle.h my_user.h my_atomic.h atomic/nolock.h \
atomic/rwlock.h atomic/x86-gcc.h atomic/x86-msvc.h \
@@ -53,8 +52,11 @@ link_sources:
@yassl_h_ln_cmd@
echo timestamp > link_sources
-my_config.h: ../config.h
- $(CP) ../config.h my_config.h
+# We want both "my_config.h" and "config.h" that are identical, as
+# MySQL sources assumes the name "my_config.h", and 3rd party sources
+# assumes the name "config.h".
+my_config.h: config.h
+ $(CP) config.h my_config.h
# These files should not be included in distributions since they are
# generated by configure from the .h.in files
@@ -69,9 +71,8 @@ dist-hook:
abi_check: $(HEADERS_ABI) mysql_version.h mysql_h.ic
@set -ex; \
if [ @ICHECK@ != no ] ; then \
- @ICHECK@ --canonify --skip-from-re /usr/ -o $@.ic mysql.h; \
- @ICHECK@ --compare mysql_h.ic $@.ic; \
- $(RM) -f $@.ic; \
+ @ICHECK@ --canonify --skip-from-re /usr/ -o $@ $(HEADERS_ABI); \
+ @ICHECK@ --compare mysql_h.ic $@; \
fi; \
touch abi_check;
diff --git a/include/config-netware.h b/include/config-netware.h
index f287699249b..e6bddee034e 100644
--- a/include/config-netware.h
+++ b/include/config-netware.h
@@ -112,7 +112,7 @@ extern "C" {
/* signal by closing the sockets */
#define SIGNAL_WITH_VIO_CLOSE 1
-/* On NetWare, stack grows towards lower address*/
+/* On NetWare, stack grows towards lower address */
#define STACK_DIRECTION -1
/* On NetWare, we need to set stack size for threads, otherwise default 16K is used */
diff --git a/include/config-win.h b/include/config-win.h
index 6f0339707e6..9b48f8de3cd 100644
--- a/include/config-win.h
+++ b/include/config-win.h
@@ -15,6 +15,8 @@
/* Defines for Win32 to make it compatible for MySQL */
+#define BIG_TABLES
+
#ifdef __WIN2000__
/* We have to do this define before including windows.h to get the AWE API
functions */
@@ -313,10 +315,10 @@ inline double ulonglong2double(ulonglong value)
#define doublestore(T,V) do { *((long *) T) = *((long*) &V); \
*(((long *) T)+1) = *(((long*) &V)+1); } while(0)
#define float4get(V,M) { *((long *) &(V)) = *((long*) (M)); }
-#define floatstore(T,V) memcpy((byte*)(T), (byte*)(&V), sizeof(float))
-#define floatget(V,M) memcpy((byte*)(&V), (byte*)(M), sizeof(float))
+#define floatstore(T,V) memcpy((uchar*)(T), (uchar*)(&V), sizeof(float))
+#define floatget(V,M) memcpy((uchar*)(&V), (uchar*)(M), sizeof(float))
#define float8get(V,M) doubleget((V),(M))
-#define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float))
+#define float4store(V,M) memcpy((uchar*) V,(uchar*) (&M),sizeof(float))
#define float8store(V,M) doublestore((V),(M))
#endif /* _WIN64 */
@@ -353,7 +355,10 @@ inline double ulonglong2double(ulonglong value)
#define SPRINTF_RETURNS_INT
#define HAVE_SETFILEPOINTER
#define HAVE_VIO_READ_BUFF
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+/* strnlen() appeared in Studio 2005 */
#define HAVE_STRNLEN
+#endif
#define HAVE_WINSOCK2
#define strcasecmp stricmp
@@ -414,16 +419,7 @@ inline double ulonglong2double(ulonglong value)
#ifdef __NT__ /* This should also work on Win98 but .. */
#define thread_safe_add(V,C,L) InterlockedExchangeAdd((long*) &(V),(C))
#define thread_safe_sub(V,C,L) InterlockedExchangeAdd((long*) &(V),-(long) (C))
-#define statistic_add(V,C,L) thread_safe_add((V),(C),(L))
-#else
-#define thread_safe_add(V,C,L) \
- pthread_mutex_lock((L)); (V)+=(C); pthread_mutex_unlock((L));
-#define thread_safe_sub(V,C,L) \
- pthread_mutex_lock((L)); (V)-=(C); pthread_mutex_unlock((L));
-#define statistic_add(V,C,L) (V)+=(C)
#endif
-#define statistic_increment(V,L) thread_safe_increment((V),(L))
-#define statistic_decrement(V,L) thread_safe_decrement((V),(L))
#define shared_memory_buffer_length 16000
#define default_shared_memory_base_name "MYSQL"
diff --git a/include/decimal.h b/include/decimal.h
index c5385b58658..530ed9e1757 100644
--- a/include/decimal.h
+++ b/include/decimal.h
@@ -39,8 +39,8 @@ int longlong2decimal(longlong from, decimal_t *to);
int decimal2double(decimal_t *from, double *to);
int double2decimal(double from, decimal_t *to);
int decimal_actual_fraction(decimal_t *from);
-int decimal2bin(decimal_t *from, char *to, int precision, int scale);
-int bin2decimal(char *from, decimal_t *to, int precision, int scale);
+int decimal2bin(decimal_t *from, uchar *to, int precision, int scale);
+int bin2decimal(const uchar *from, decimal_t *to, int precision, int scale);
int decimal_size(int precision, int scale);
int decimal_bin_size(int precision, int scale);
diff --git a/include/ft_global.h b/include/ft_global.h
index 6c3457541a5..752371d6bc6 100644
--- a/include/ft_global.h
+++ b/include/ft_global.h
@@ -32,7 +32,7 @@ typedef struct st_ft_info FT_INFO;
struct _ft_vft
{
int (*read_next)(FT_INFO *, char *);
- float (*find_relevance)(FT_INFO *, byte *, uint);
+ float (*find_relevance)(FT_INFO *, uchar *, uint);
void (*close_search)(FT_INFO *);
float (*get_relevance)(FT_INFO *);
void (*reinit_search)(FT_INFO *);
@@ -62,8 +62,8 @@ void ft_free_stopwords(void);
#define FT_SORTED 2
#define FT_EXPAND 4 /* query expansion */
-FT_INFO *ft_init_search(uint,void *, uint, byte *, uint,CHARSET_INFO *, byte *);
-my_bool ft_boolean_check_syntax_string(const byte *);
+FT_INFO *ft_init_search(uint,void *, uint, uchar *, uint,CHARSET_INFO *, uchar *);
+my_bool ft_boolean_check_syntax_string(const uchar *);
#ifdef __cplusplus
}
diff --git a/include/hash.h b/include/hash.h
index 97e947d7c6a..d924e62a0ec 100644
--- a/include/hash.h
+++ b/include/hash.h
@@ -27,12 +27,16 @@ extern "C" {
*/
#define HASH_OVERHEAD (sizeof(char*)*2)
-typedef byte *(*hash_get_key)(const byte *,uint*,my_bool);
+/* flags for hash_init */
+#define HASH_UNIQUE 1 /* hash_insert fails on duplicate key */
+
+typedef uchar *(*hash_get_key)(const uchar *,size_t*,my_bool);
typedef void (*hash_free_key)(void *);
typedef struct st_hash {
- uint key_offset,key_length; /* Length of key if const length */
- uint records, blength;
+ size_t key_offset,key_length; /* Length of key if const length */
+ size_t blength;
+ ulong records;
uint flags;
DYNAMIC_ARRAY array; /* Place for hash_keys */
hash_get_key get_key;
@@ -45,21 +49,21 @@ typedef uint HASH_SEARCH_STATE;
#define hash_init(A,B,C,D,E,F,G,H) _hash_init(A,B,C,D,E,F,G, H CALLER_INFO)
my_bool _hash_init(HASH *hash, CHARSET_INFO *charset,
- uint default_array_elements, uint key_offset,
- uint key_length, hash_get_key get_key,
+ ulong default_array_elements, size_t key_offset,
+ size_t key_length, hash_get_key get_key,
void (*free_element)(void*), uint flags CALLER_INFO_PROTO);
void hash_free(HASH *tree);
void my_hash_reset(HASH *hash);
-byte *hash_element(HASH *hash,uint idx);
-gptr hash_search(const HASH *info, const byte *key, uint length);
-gptr hash_first(const HASH *info, const byte *key, uint length,
+uchar *hash_element(HASH *hash,ulong idx);
+uchar *hash_search(const HASH *info, const uchar *key, size_t length);
+uchar *hash_first(const HASH *info, const uchar *key, size_t length,
HASH_SEARCH_STATE *state);
-gptr hash_next(const HASH *info, const byte *key, uint length,
- HASH_SEARCH_STATE *state);
-my_bool my_hash_insert(HASH *info,const byte *data);
-my_bool hash_delete(HASH *hash,byte *record);
-my_bool hash_update(HASH *hash,byte *record,byte *old_key,uint old_key_length);
-void hash_replace(HASH *hash, HASH_SEARCH_STATE *state, byte *new_row);
+uchar *hash_next(const HASH *info, const uchar *key, size_t length,
+ HASH_SEARCH_STATE *state);
+my_bool my_hash_insert(HASH *info,const uchar *data);
+my_bool hash_delete(HASH *hash,uchar *record);
+my_bool hash_update(HASH *hash,uchar *record,uchar *old_key,size_t old_key_length);
+void hash_replace(HASH *hash, HASH_SEARCH_STATE *state, uchar *new_row);
my_bool hash_check(HASH *hash); /* Only in debug library */
#define hash_clear(H) bzero((char*) (H),sizeof(*(H)))
diff --git a/include/heap.h b/include/heap.h
index 6cacb7fc529..4a1c7d419ed 100644
--- a/include/heap.h
+++ b/include/heap.h
@@ -57,7 +57,7 @@ typedef struct st_heapinfo /* Struct from heap_info */
typedef struct st_heap_ptrs
{
- byte *blocks[HP_PTRS_IN_NOD]; /* pointers to HP_PTRS or records */
+ uchar *blocks[HP_PTRS_IN_NOD]; /* pointers to HP_PTRS or records */
} HP_PTRS;
struct st_level_info
@@ -70,7 +70,7 @@ struct st_level_info
of last_blocks array. For level 0 - 1, for level 1 - HP_PTRS_IN_NOD, for
level 2 - HP_PTRS_IN_NOD^2 and so forth.
*/
- uint records_under_level;
+ ulong records_under_level;
/*
Ptr to last allocated HP_PTRS (or records buffer for level 0) on this
@@ -123,10 +123,10 @@ typedef struct st_hp_keydef /* Key definition with open */
ha_rows hash_buckets;
TREE rb_tree;
int (*write_key)(struct st_heap_info *info, struct st_hp_keydef *keyinfo,
- const byte *record, byte *recpos);
+ const uchar *record, uchar *recpos);
int (*delete_key)(struct st_heap_info *info, struct st_hp_keydef *keyinfo,
- const byte *record, byte *recpos, int flag);
- uint (*get_key_length)(struct st_hp_keydef *keydef, const byte *key);
+ const uchar *record, uchar *recpos, int flag);
+ uint (*get_key_length)(struct st_hp_keydef *keydef, const uchar *key);
} HP_KEYDEF;
typedef struct st_heap_share
@@ -144,8 +144,8 @@ typedef struct st_heap_share
uint keys,max_key_length;
uint currently_disabled_keys; /* saved value from "keys" when disabled */
uint open_count;
- byte *del_link; /* Link to next block with del. rec */
- my_string name; /* Name of "memory-file" */
+ uchar *del_link; /* Link to next block with del. rec */
+ char * name; /* Name of "memory-file" */
#ifdef THREAD
THR_LOCK lock;
pthread_mutex_t intern_lock; /* Locking for use with _locking */
@@ -162,14 +162,14 @@ struct st_hp_hash_info;
typedef struct st_heap_info
{
HP_SHARE *s;
- byte *current_ptr;
+ uchar *current_ptr;
struct st_hp_hash_info *current_hash_ptr;
ulong current_record,next_block;
int lastinx,errkey;
int mode; /* Mode of file (READONLY..) */
uint opt_flag,update;
- byte *lastkey; /* Last used key with rkey */
- byte *recbuf; /* Record buffer for rb-tree keys */
+ uchar *lastkey; /* Last used key with rkey */
+ uchar *recbuf; /* Record buffer for rb-tree keys */
enum ha_rkey_function last_find_flag;
TREE_ELEMENT *parents[MAX_TREE_HEIGHT+1];
TREE_ELEMENT **last_pos;
@@ -189,54 +189,57 @@ typedef struct st_heap_create_info
ulonglong max_table_size;
ulonglong auto_increment;
my_bool with_auto_increment;
+ my_bool internal_table;
} HP_CREATE_INFO;
/* Prototypes for heap-functions */
extern HP_INFO *heap_open(const char *name, int mode);
+extern HP_INFO *heap_open_from_share(HP_SHARE *share, int mode);
+extern HP_INFO *heap_open_from_share_and_register(HP_SHARE *share, int mode);
extern int heap_close(HP_INFO *info);
-extern int heap_write(HP_INFO *info,const byte *buff);
-extern int heap_update(HP_INFO *info,const byte *old,const byte *newdata);
-extern int heap_rrnd(HP_INFO *info,byte *buf,byte *pos);
+extern int heap_write(HP_INFO *info,const uchar *buff);
+extern int heap_update(HP_INFO *info,const uchar *old,const uchar *newdata);
+extern int heap_rrnd(HP_INFO *info,uchar *buf,uchar *pos);
extern int heap_scan_init(HP_INFO *info);
-extern int heap_scan(register HP_INFO *info, byte *record);
-extern int heap_delete(HP_INFO *info,const byte *buff);
+extern int heap_scan(register HP_INFO *info, uchar *record);
+extern int heap_delete(HP_INFO *info,const uchar *buff);
extern int heap_info(HP_INFO *info,HEAPINFO *x,int flag);
extern int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
uint reclength, ulong max_records, ulong min_records,
- HP_CREATE_INFO *create_info);
+ HP_CREATE_INFO *create_info, HP_SHARE **share);
extern int heap_delete_table(const char *name);
extern void heap_drop_table(HP_INFO *info);
extern int heap_extra(HP_INFO *info,enum ha_extra_function function);
extern int heap_reset(HP_INFO *info);
extern int heap_rename(const char *old_name,const char *new_name);
extern int heap_panic(enum ha_panic_function flag);
-extern int heap_rsame(HP_INFO *info,byte *record,int inx);
-extern int heap_rnext(HP_INFO *info,byte *record);
-extern int heap_rprev(HP_INFO *info,byte *record);
-extern int heap_rfirst(HP_INFO *info,byte *record,int inx);
-extern int heap_rlast(HP_INFO *info,byte *record,int inx);
+extern int heap_rsame(HP_INFO *info,uchar *record,int inx);
+extern int heap_rnext(HP_INFO *info,uchar *record);
+extern int heap_rprev(HP_INFO *info,uchar *record);
+extern int heap_rfirst(HP_INFO *info,uchar *record,int inx);
+extern int heap_rlast(HP_INFO *info,uchar *record,int inx);
extern void heap_clear(HP_INFO *info);
extern void heap_clear_keys(HP_INFO *info);
extern int heap_disable_indexes(HP_INFO *info);
extern int heap_enable_indexes(HP_INFO *info);
extern int heap_indexes_are_disabled(HP_INFO *info);
-extern void heap_update_auto_increment(HP_INFO *info, const byte *record);
+extern void heap_update_auto_increment(HP_INFO *info, const uchar *record);
ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, key_range *min_key,
key_range *max_key);
int hp_panic(enum ha_panic_function flag);
-int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key,
+int heap_rkey(HP_INFO *info, uchar *record, int inx, const uchar *key,
key_part_map keypart_map, enum ha_rkey_function find_flag);
-extern gptr heap_find(HP_INFO *info,int inx,const byte *key);
+extern uchar * heap_find(HP_INFO *info,int inx,const uchar *key);
extern int heap_check_heap(HP_INFO *info, my_bool print_status);
-extern byte *heap_position(HP_INFO *info);
+extern uchar *heap_position(HP_INFO *info);
/* The following is for programs that uses the old HEAP interface where
- pointer to rows where a long instead of a (byte*).
+ pointer to rows where a long instead of a (uchar*).
*/
#if defined(WANT_OLD_HEAP_VERSION) || defined(OLD_HEAP_VERSION)
-extern int heap_rrnd_old(HP_INFO *info,byte *buf,ulong pos);
+extern int heap_rrnd_old(HP_INFO *info,uchar *buf,ulong pos);
extern ulong heap_position_old(HP_INFO *info);
#endif
#ifdef OLD_HEAP_VERSION
@@ -244,7 +247,7 @@ typedef ulong HEAP_PTR;
#define heap_position(A) heap_position_old(A)
#define heap_rrnd(A,B,C) heap_rrnd_old(A,B,C)
#else
-typedef byte *HEAP_PTR;
+typedef uchar *HEAP_PTR;
#endif
#ifdef __cplusplus
diff --git a/include/keycache.h b/include/keycache.h
index dc763b8cc08..a6005bae878 100644
--- a/include/keycache.h
+++ b/include/keycache.h
@@ -44,10 +44,10 @@ typedef struct st_keycache_wqueue
typedef struct st_key_cache
{
my_bool key_cache_inited;
+ my_bool in_resize; /* true during resize operation */
my_bool resize_in_flush; /* true during flush of resize operation */
my_bool can_be_used; /* usage of cache for read/write is allowed */
- uint key_cache_shift;
- ulong key_cache_mem_size; /* specified size of the cache memory */
+ size_t key_cache_mem_size; /* specified size of the cache memory */
uint key_cache_block_size; /* size of the page buffer of a cache block */
ulong min_warm_blocks; /* min number of warm blocks; */
ulong age_threshold; /* age threshold for hot blocks */
@@ -65,13 +65,18 @@ typedef struct st_key_cache
HASH_LINK **hash_root; /* arr. of entries into hash table buckets */
HASH_LINK *hash_link_root; /* memory for hash table links */
HASH_LINK *free_hash_list; /* list of free hash links */
- BLOCK_LINK *free_block_list; /* list of free blocks */
+ BLOCK_LINK *free_block_list; /* list of free blocks */
BLOCK_LINK *block_root; /* memory for block links */
- byte HUGE_PTR *block_mem; /* memory for block buffers */
+ uchar HUGE_PTR *block_mem; /* memory for block buffers */
BLOCK_LINK *used_last; /* ptr to the last block of the LRU chain */
BLOCK_LINK *used_ins; /* ptr to the insertion block in LRU chain */
pthread_mutex_t cache_lock; /* to lock access to the cache structure */
KEYCACHE_WQUEUE resize_queue; /* threads waiting during resize operation */
+ /*
+ Waiting for a zero resize count. Using a queue for symmetry though
+ only one thread can wait here.
+ */
+ KEYCACHE_WQUEUE waiting_for_resize_cnt;
KEYCACHE_WQUEUE waiting_for_hash_link; /* waiting for a free hash link */
KEYCACHE_WQUEUE waiting_for_block; /* requests waiting for a free block */
BLOCK_LINK *changed_blocks[CHANGED_BLOCKS_HASH]; /* hash for dirty file bl.*/
@@ -102,23 +107,23 @@ typedef struct st_key_cache
extern KEY_CACHE dflt_key_cache_var, *dflt_key_cache;
extern int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
- ulong use_mem, uint division_limit,
+ size_t use_mem, uint division_limit,
uint age_threshold);
extern int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
- ulong use_mem, uint division_limit,
+ size_t use_mem, uint division_limit,
uint age_threshold);
extern void change_key_cache_param(KEY_CACHE *keycache, uint division_limit,
uint age_threshold);
-extern byte *key_cache_read(KEY_CACHE *keycache,
+extern uchar *key_cache_read(KEY_CACHE *keycache,
File file, my_off_t filepos, int level,
- byte *buff, uint length,
+ uchar *buff, uint length,
uint block_length,int return_buffer);
extern int key_cache_insert(KEY_CACHE *keycache,
File file, my_off_t filepos, int level,
- byte *buff, uint length);
+ uchar *buff, uint length);
extern int key_cache_write(KEY_CACHE *keycache,
File file, my_off_t filepos, int level,
- byte *buff, uint length,
+ uchar *buff, uint length,
uint block_length,int force_write);
extern int flush_key_blocks(KEY_CACHE *keycache,
int file, enum flush_type type);
@@ -127,8 +132,8 @@ extern void end_key_cache(KEY_CACHE *keycache, my_bool cleanup);
/* Functions to handle multiple key caches */
extern my_bool multi_keycache_init(void);
extern void multi_keycache_free(void);
-extern KEY_CACHE *multi_key_cache_search(byte *key, uint length);
-extern my_bool multi_key_cache_set(const byte *key, uint length,
+extern KEY_CACHE *multi_key_cache_search(uchar *key, uint length);
+extern my_bool multi_key_cache_set(const uchar *key, uint length,
KEY_CACHE *key_cache);
extern void multi_key_cache_change(KEY_CACHE *old_data,
KEY_CACHE *new_data);
diff --git a/include/m_ctype.h b/include/m_ctype.h
index f2b49c63fe3..9025507ce15 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -51,8 +51,8 @@ extern MY_UNICASE_INFO *my_unicase_turkish[256];
typedef struct uni_ctype_st
{
- unsigned char pctype;
- unsigned char *ctype;
+ uchar pctype;
+ uchar *ctype;
} MY_UNI_CTYPE;
extern MY_UNI_CTYPE my_uni_ctype[256];
@@ -84,10 +84,16 @@ extern MY_UNI_CTYPE my_uni_ctype[256];
#define MY_CS_UNICODE 128 /* is a charset is full unicode */
#define MY_CS_READY 256 /* if a charset is initialized */
#define MY_CS_AVAILABLE 512 /* If either compiled-in or loaded*/
-#define MY_CS_CSSORT 1024 /* if case sensitive sort order */
+#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_CHARSET_UNDEFINED 0
+/* Character repertoire flags */
+#define MY_REPERTOIRE_ASCII 1 /* Pure ASCII U+0000..U+007F */
+#define MY_REPERTOIRE_EXTENDED 2 /* Extended characters: U+0080..U+FFFF */
+#define MY_REPERTOIRE_UNICODE30 3 /* ASCII | EXTENDED: U+0000..U+FFFF */
+
typedef struct my_uni_idx_st
{
@@ -125,22 +131,22 @@ struct charset_info_st;
/* See strings/CHARSET_INFO.txt for information about this structure */
typedef struct my_collation_handler_st
{
- my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint));
+ my_bool (*init)(struct charset_info_st *, void *(*alloc)(size_t));
/* Collation routines */
int (*strnncoll)(struct charset_info_st *,
- const uchar *, uint, const uchar *, uint, my_bool);
+ const uchar *, size_t, const uchar *, size_t, my_bool);
int (*strnncollsp)(struct charset_info_st *,
- const uchar *, uint, const uchar *, uint,
+ const uchar *, size_t, const uchar *, size_t,
my_bool diff_if_only_endspace_difference);
- int (*strnxfrm)(struct charset_info_st *,
- uchar *, uint, const uchar *, uint);
- uint (*strnxfrmlen)(struct charset_info_st *, uint);
+ size_t (*strnxfrm)(struct charset_info_st *,
+ uchar *, size_t, const uchar *, size_t);
+ size_t (*strnxfrmlen)(struct charset_info_st *, size_t);
my_bool (*like_range)(struct charset_info_st *,
- const char *s, uint s_length,
+ const char *s, size_t s_length,
pchar w_prefix, pchar w_one, pchar w_many,
- uint res_length,
+ size_t res_length,
char *min_str, char *max_str,
- uint *min_len, uint *max_len);
+ size_t *min_len, size_t *max_len);
int (*wildcmp)(struct charset_info_st *,
const char *str,const char *str_end,
const char *wildstr,const char *wildend,
@@ -149,14 +155,14 @@ typedef struct my_collation_handler_st
int (*strcasecmp)(struct charset_info_st *, const char *, const char *);
uint (*instr)(struct charset_info_st *,
- const char *b, uint b_length,
- const char *s, uint s_length,
+ const char *b, size_t b_length,
+ const char *s, size_t s_length,
my_match_t *match, uint nmatch);
/* Hash calculation */
- void (*hash_sort)(struct charset_info_st *cs, const uchar *key, uint len,
+ void (*hash_sort)(struct charset_info_st *cs, const uchar *key, size_t len,
ulong *nr1, ulong *nr2);
- my_bool (*propagate)(struct charset_info_st *cs, const uchar *str, uint len);
+ my_bool (*propagate)(struct charset_info_st *cs, const uchar *str, size_t len);
} MY_COLLATION_HANDLER;
extern MY_COLLATION_HANDLER my_collation_mb_bin_handler;
@@ -164,68 +170,76 @@ extern MY_COLLATION_HANDLER my_collation_8bit_bin_handler;
extern MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler;
extern MY_COLLATION_HANDLER my_collation_ucs2_uca_handler;
+/* Some typedef to make it easy for C++ to make function pointers */
+typedef int (*my_charset_conv_mb_wc)(struct charset_info_st *, my_wc_t *,
+ const uchar *, const uchar *);
+typedef int (*my_charset_conv_wc_mb)(struct charset_info_st *, my_wc_t,
+ uchar *, uchar *);
+typedef size_t (*my_charset_conv_case)(struct charset_info_st *,
+ char *, size_t, char *, size_t);
+
/* See strings/CHARSET_INFO.txt about information on this structure */
typedef struct my_charset_handler_st
{
- my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint));
+ my_bool (*init)(struct charset_info_st *, void *(*alloc)(size_t));
/* Multibyte routines */
- int (*ismbchar)(struct charset_info_st *, const char *, const char *);
- int (*mbcharlen)(struct charset_info_st *, uint);
- uint (*numchars)(struct charset_info_st *, const char *b, const char *e);
- uint (*charpos)(struct charset_info_st *, const char *b, const char *e, uint pos);
- uint (*well_formed_len)(struct charset_info_st *,
+ uint (*ismbchar)(struct charset_info_st *, const char *, const char *);
+ uint (*mbcharlen)(struct charset_info_st *, uint c);
+ size_t (*numchars)(struct charset_info_st *, const char *b, const char *e);
+ size_t (*charpos)(struct charset_info_st *, const char *b, const char *e,
+ size_t pos);
+ size_t (*well_formed_len)(struct charset_info_st *,
const char *b,const char *e,
- uint nchars, int *error);
- uint (*lengthsp)(struct charset_info_st *, const char *ptr, uint length);
- uint (*numcells)(struct charset_info_st *, const char *b, const char *e);
+ size_t nchars, int *error);
+ size_t (*lengthsp)(struct charset_info_st *, const char *ptr, size_t length);
+ size_t (*numcells)(struct charset_info_st *, const char *b, const char *e);
/* Unicode conversion */
- int (*mb_wc)(struct charset_info_st *cs,my_wc_t *wc,
- const unsigned char *s,const unsigned char *e);
- int (*wc_mb)(struct charset_info_st *cs,my_wc_t wc,
- unsigned char *s,unsigned char *e);
-
+ my_charset_conv_mb_wc mb_wc;
+ my_charset_conv_wc_mb wc_mb;
+
/* CTYPE scanner */
int (*ctype)(struct charset_info_st *cs, int *ctype,
- const unsigned char *s, const unsigned char *e);
+ const uchar *s, const uchar *e);
/* Functions for case and sort conversion */
- uint (*caseup_str)(struct charset_info_st *, char *);
- uint (*casedn_str)(struct charset_info_st *, char *);
- uint (*caseup)(struct charset_info_st *, char *src, uint srclen,
- char *dst, uint dstlen);
- uint (*casedn)(struct charset_info_st *, char *src, uint srclen,
- char *dst, uint dstlen);
-
+ size_t (*caseup_str)(struct charset_info_st *, char *);
+ size_t (*casedn_str)(struct charset_info_st *, char *);
+
+ my_charset_conv_case caseup;
+ my_charset_conv_case casedn;
+
/* Charset dependant snprintf() */
- int (*snprintf)(struct charset_info_st *, char *to, uint n, const char *fmt,
- ...) ATTRIBUTE_FORMAT_FPTR(printf, 4, 5);
- int (*long10_to_str)(struct charset_info_st *, char *to, uint n, int radix,
- long int val);
- int (*longlong10_to_str)(struct charset_info_st *, char *to, uint n,
- int radix, longlong val);
+ size_t (*snprintf)(struct charset_info_st *, char *to, size_t n,
+ const char *fmt,
+ ...) ATTRIBUTE_FORMAT_FPTR(printf, 4, 5);
+ size_t (*long10_to_str)(struct charset_info_st *, char *to, size_t n,
+ int radix, long int val);
+ size_t (*longlong10_to_str)(struct charset_info_st *, char *to, size_t n,
+ int radix, longlong val);
- void (*fill)(struct charset_info_st *, char *to, uint len, int fill);
+ void (*fill)(struct charset_info_st *, char *to, size_t len, int fill);
/* String-to-number conversion routines */
- long (*strntol)(struct charset_info_st *, const char *s, uint l,
+ long (*strntol)(struct charset_info_st *, const char *s, size_t l,
int base, char **e, int *err);
- ulong (*strntoul)(struct charset_info_st *, const char *s, uint l,
+ ulong (*strntoul)(struct charset_info_st *, const char *s, size_t l,
int base, char **e, int *err);
- longlong (*strntoll)(struct charset_info_st *, const char *s, uint l,
+ longlong (*strntoll)(struct charset_info_st *, const char *s, size_t l,
int base, char **e, int *err);
- ulonglong (*strntoull)(struct charset_info_st *, const char *s, uint l,
+ ulonglong (*strntoull)(struct charset_info_st *, const char *s, size_t l,
int base, char **e, int *err);
- double (*strntod)(struct charset_info_st *, char *s, uint l, char **e,
+ double (*strntod)(struct charset_info_st *, char *s, size_t l, char **e,
int *err);
longlong (*strtoll10)(struct charset_info_st *cs,
const char *nptr, char **endptr, int *error);
ulonglong (*strntoull10rnd)(struct charset_info_st *cs,
- const char *str, uint length, int unsigned_fl,
+ const char *str, size_t length,
+ int unsigned_fl,
char **endptr, int *error);
- ulong (*scan)(struct charset_info_st *, const char *b, const char *e,
- int sq);
+ size_t (*scan)(struct charset_info_st *, const char *b, const char *e,
+ int sq);
} MY_CHARSET_HANDLER;
extern MY_CHARSET_HANDLER my_charset_8bit_handler;
@@ -293,44 +307,45 @@ extern CHARSET_INFO my_charset_tis620_thai_ci;
extern CHARSET_INFO my_charset_tis620_bin;
extern CHARSET_INFO my_charset_ucs2_general_ci;
extern CHARSET_INFO my_charset_ucs2_bin;
-extern CHARSET_INFO my_charset_ucs2_general_uca;
+extern CHARSET_INFO my_charset_ucs2_unicode_ci;
extern CHARSET_INFO my_charset_ujis_japanese_ci;
extern CHARSET_INFO my_charset_ujis_bin;
extern CHARSET_INFO my_charset_utf8_general_ci;
+extern CHARSET_INFO my_charset_utf8_unicode_ci;
extern CHARSET_INFO my_charset_utf8_bin;
extern CHARSET_INFO my_charset_cp1250_czech_ci;
extern CHARSET_INFO my_charset_filename;
/* declarations for simple charsets */
-extern int my_strnxfrm_simple(CHARSET_INFO *, uchar *, uint, const uchar *,
- uint);
-uint my_strnxfrmlen_simple(CHARSET_INFO *, uint);
-extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, uint,
- const uchar *, uint, my_bool);
-
-extern int my_strnncollsp_simple(CHARSET_INFO *, const uchar *, uint,
- const uchar *, uint,
+extern size_t my_strnxfrm_simple(CHARSET_INFO *, uchar *, size_t,
+ const uchar *, size_t);
+size_t my_strnxfrmlen_simple(CHARSET_INFO *, size_t);
+extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, size_t,
+ const uchar *, size_t, my_bool);
+
+extern int my_strnncollsp_simple(CHARSET_INFO *, const uchar *, size_t,
+ const uchar *, size_t,
my_bool diff_if_only_endspace_difference);
extern void my_hash_sort_simple(CHARSET_INFO *cs,
- const uchar *key, uint len,
+ const uchar *key, size_t len,
ulong *nr1, ulong *nr2);
-extern uint my_lengthsp_8bit(CHARSET_INFO *cs, const char *ptr, uint length);
+extern size_t my_lengthsp_8bit(CHARSET_INFO *cs, const char *ptr, size_t length);
extern uint my_instr_simple(struct charset_info_st *,
- const char *b, uint b_length,
- const char *s, uint s_length,
+ const char *b, size_t b_length,
+ const char *s, size_t s_length,
my_match_t *match, uint nmatch);
/* Functions for 8bit */
-extern uint my_caseup_str_8bit(CHARSET_INFO *, char *);
-extern uint my_casedn_str_8bit(CHARSET_INFO *, char *);
-extern uint my_caseup_8bit(CHARSET_INFO *, char *src, uint srclen,
- char *dst, uint dstlen);
-extern uint my_casedn_8bit(CHARSET_INFO *, char *src, uint srclen,
- char *dst, uint dstlen);
+extern size_t my_caseup_str_8bit(CHARSET_INFO *, char *);
+extern size_t my_casedn_str_8bit(CHARSET_INFO *, char *);
+extern size_t my_caseup_8bit(CHARSET_INFO *, char *src, size_t srclen,
+ char *dst, size_t dstlen);
+extern size_t my_casedn_8bit(CHARSET_INFO *, char *src, size_t srclen,
+ char *dst, size_t dstlen);
extern int my_strcasecmp_8bit(CHARSET_INFO * cs, const char *, const char *);
@@ -340,26 +355,26 @@ int my_wc_mb_8bit(CHARSET_INFO *cs,my_wc_t wc, uchar *s, uchar *e);
int my_mb_ctype_8bit(CHARSET_INFO *,int *, const uchar *,const uchar *);
int my_mb_ctype_mb(CHARSET_INFO *,int *, const uchar *,const uchar *);
-ulong my_scan_8bit(CHARSET_INFO *cs, const char *b, const char *e, int sq);
+size_t my_scan_8bit(CHARSET_INFO *cs, const char *b, const char *e, int sq);
-int my_snprintf_8bit(struct charset_info_st *, char *to, uint n,
- const char *fmt, ...)
+size_t my_snprintf_8bit(struct charset_info_st *, char *to, size_t n,
+ const char *fmt, ...)
ATTRIBUTE_FORMAT(printf, 4, 5);
-long my_strntol_8bit(CHARSET_INFO *, const char *s, uint l, int base,
- char **e, int *err);
-ulong my_strntoul_8bit(CHARSET_INFO *, const char *s, uint l, int base,
+long my_strntol_8bit(CHARSET_INFO *, const char *s, size_t l, int base,
+ char **e, int *err);
+ulong my_strntoul_8bit(CHARSET_INFO *, const char *s, size_t l, int base,
char **e, int *err);
-longlong my_strntoll_8bit(CHARSET_INFO *, const char *s, uint l, int base,
+longlong my_strntoll_8bit(CHARSET_INFO *, const char *s, size_t l, int base,
char **e, int *err);
-ulonglong my_strntoull_8bit(CHARSET_INFO *, const char *s, uint l, int base,
+ulonglong my_strntoull_8bit(CHARSET_INFO *, const char *s, size_t l, int base,
char **e, int *err);
-double my_strntod_8bit(CHARSET_INFO *, char *s, uint l,char **e,
+double my_strntod_8bit(CHARSET_INFO *, char *s, size_t l,char **e,
int *err);
-int my_long10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix,
- long int val);
-int my_longlong10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix,
- longlong val);
+size_t my_long10_to_str_8bit(CHARSET_INFO *, char *to, size_t l, int radix,
+ long int val);
+size_t my_longlong10_to_str_8bit(CHARSET_INFO *, char *to, size_t l, int radix,
+ longlong val);
longlong my_strtoll10_8bit(CHARSET_INFO *cs,
const char *nptr, char **endptr, int *error);
@@ -367,34 +382,34 @@ longlong my_strtoll10_ucs2(CHARSET_INFO *cs,
const char *nptr, char **endptr, int *error);
ulonglong my_strntoull10rnd_8bit(CHARSET_INFO *cs,
- const char *str, uint length, int unsigned_fl,
- char **endptr, int *error);
+ const char *str, size_t length, int
+ unsigned_fl, char **endptr, int *error);
ulonglong my_strntoull10rnd_ucs2(CHARSET_INFO *cs,
- const char *str, uint length, int unsigned_fl,
- char **endptr, int *error);
+ const char *str, size_t length,
+ int unsigned_fl, char **endptr, int *error);
-void my_fill_8bit(CHARSET_INFO *cs, char* to, uint l, int fill);
+void my_fill_8bit(CHARSET_INFO *cs, char* to, size_t l, int fill);
my_bool my_like_range_simple(CHARSET_INFO *cs,
- const char *ptr, uint ptr_length,
+ const char *ptr, size_t ptr_length,
pbool escape, pbool w_one, pbool w_many,
- uint res_length,
+ size_t res_length,
char *min_str, char *max_str,
- uint *min_length, uint *max_length);
+ size_t *min_length, size_t *max_length);
my_bool my_like_range_mb(CHARSET_INFO *cs,
- const char *ptr, uint ptr_length,
+ const char *ptr, size_t ptr_length,
pbool escape, pbool w_one, pbool w_many,
- uint res_length,
+ size_t res_length,
char *min_str, char *max_str,
- uint *min_length, uint *max_length);
+ size_t *min_length, size_t *max_length);
my_bool my_like_range_ucs2(CHARSET_INFO *cs,
- const char *ptr, uint ptr_length,
+ const char *ptr, size_t ptr_length,
pbool escape, pbool w_one, pbool w_many,
- uint res_length,
+ size_t res_length,
char *min_str, char *max_str,
- uint *min_length, uint *max_length);
+ size_t *min_length, size_t *max_length);
int my_wildcmp_8bit(CHARSET_INFO *,
@@ -407,35 +422,35 @@ int my_wildcmp_bin(CHARSET_INFO *,
const char *wildstr,const char *wildend,
int escape, int w_one, int w_many);
-uint my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e);
-uint my_numcells_8bit(CHARSET_INFO *, const char *b, const char *e);
-uint my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos);
-uint my_well_formed_len_8bit(CHARSET_INFO *, const char *b, const char *e,
- uint pos, int *error);
-int my_mbcharlen_8bit(CHARSET_INFO *, uint c);
+size_t my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e);
+size_t my_numcells_8bit(CHARSET_INFO *, const char *b, const char *e);
+size_t my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, size_t pos);
+size_t my_well_formed_len_8bit(CHARSET_INFO *, const char *b, const char *e,
+ size_t pos, int *error);
+uint my_mbcharlen_8bit(CHARSET_INFO *, uint c);
/* Functions for multibyte charsets */
-extern uint my_caseup_str_mb(CHARSET_INFO *, char *);
-extern uint my_casedn_str_mb(CHARSET_INFO *, char *);
-extern uint my_caseup_mb(CHARSET_INFO *, char *src, uint srclen,
- char *dst, uint dstlen);
-extern uint my_casedn_mb(CHARSET_INFO *, char *src, uint srclen,
- char *dst, uint dstlen);
+extern size_t my_caseup_str_mb(CHARSET_INFO *, char *);
+extern size_t my_casedn_str_mb(CHARSET_INFO *, char *);
+extern size_t my_caseup_mb(CHARSET_INFO *, char *src, size_t srclen,
+ char *dst, size_t dstlen);
+extern size_t my_casedn_mb(CHARSET_INFO *, char *src, size_t srclen,
+ char *dst, size_t dstlen);
extern int my_strcasecmp_mb(CHARSET_INFO * cs,const char *, const char *);
int my_wildcmp_mb(CHARSET_INFO *,
const char *str,const char *str_end,
const char *wildstr,const char *wildend,
int escape, int w_one, int w_many);
-uint my_numchars_mb(CHARSET_INFO *, const char *b, const char *e);
-uint my_numcells_mb(CHARSET_INFO *, const char *b, const char *e);
-uint my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
-uint my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e,
- uint pos, int *error);
+size_t my_numchars_mb(CHARSET_INFO *, const char *b, const char *e);
+size_t my_numcells_mb(CHARSET_INFO *, const char *b, const char *e);
+size_t my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, size_t pos);
+size_t my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e,
+ size_t pos, int *error);
uint my_instr_mb(struct charset_info_st *,
- const char *b, uint b_length,
- const char *s, uint s_length,
+ const char *b, size_t b_length,
+ const char *s, size_t s_length,
my_match_t *match, uint nmatch);
int my_wildcmp_unicode(CHARSET_INFO *cs,
@@ -444,13 +459,18 @@ int my_wildcmp_unicode(CHARSET_INFO *cs,
int escape, int w_one, int w_many,
MY_UNICASE_INFO **weights);
-extern my_bool my_parse_charset_xml(const char *bug, uint len,
+extern my_bool my_parse_charset_xml(const char *bug, size_t len,
int (*add)(CHARSET_INFO *cs));
extern char *my_strchr(CHARSET_INFO *cs, const char *str, const char *end,
pchar c);
-my_bool my_propagate_simple(CHARSET_INFO *cs, const uchar *str, uint len);
-my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, uint len);
+my_bool my_propagate_simple(CHARSET_INFO *cs, const uchar *str, size_t len);
+my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, size_t len);
+
+
+uint my_string_repertoire(CHARSET_INFO *cs, const char *str, ulong len);
+my_bool my_charset_is_ascii_based(CHARSET_INFO *cs);
+my_bool my_charset_is_8bit_pure_ascii(CHARSET_INFO *cs);
#define _MY_U 01 /* Upper case */
diff --git a/include/m_string.h b/include/m_string.h
index 4f098c3206d..00fb4cb0656 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -92,6 +92,9 @@ extern char *stpcpy(char *, const char *); /* For AIX with gcc 2.95.3 */
extern char NEAR _dig_vec_upper[];
extern char NEAR _dig_vec_lower[];
+/* Defined in strtod.c */
+extern const double log_10[309];
+
#ifdef BAD_STRING_COMPILER
#define strmov(A,B) (memccpy(A,B,0,INT_MAX)-1)
#else
@@ -112,59 +115,59 @@ extern char NEAR _dig_vec_lower[];
/* Prototypes for string functions */
#if !defined(bfill) && !defined(HAVE_BFILL)
-extern void bfill(gptr dst,uint len,pchar fill);
+extern void bfill(uchar *dst,size_t len,pchar fill);
#endif
#if !defined(bzero) && !defined(HAVE_BZERO)
-extern void bzero(gptr dst,uint len);
+extern void bzero(uchar * dst,size_t len);
#endif
#if !defined(bcmp) && !defined(HAVE_BCMP)
-extern int bcmp(const char *s1,const char *s2,uint len);
+extern size_t bcmp(const uchar *s1,const uchar *s2,size_t len);
#endif
#ifdef HAVE_purify
-extern int my_bcmp(const char *s1,const char *s2,uint len);
+extern size_t my_bcmp(const uchar *s1,const uchar *s2,size_t len);
#undef bcmp
#define bcmp(A,B,C) my_bcmp((A),(B),(C))
#endif
#ifndef bmove512
-extern void bmove512(gptr dst,const gptr src,uint len);
+extern void bmove512(uchar *dst,const uchar *src,size_t len);
#endif
#if !defined(HAVE_BMOVE) && !defined(bmove)
-extern void bmove(char *dst, const char *src,uint len);
+extern void bmove(uuchar *dst, const uchar *src,size_t len);
#endif
-extern void bmove_upp(char *dst,const char *src,uint len);
-extern void bchange(char *dst,uint old_len,const char *src,
- uint new_len,uint tot_len);
-extern void strappend(char *s,uint len,pchar fill);
+extern void bmove_upp(uchar *dst,const uchar *src,size_t len);
+extern void bchange(uchar *dst,size_t old_len,const uchar *src,
+ size_t new_len,size_t tot_len);
+extern void strappend(char *s,size_t len,pchar fill);
extern char *strend(const char *s);
extern char *strcend(const char *, pchar);
extern char *strfield(char *src,int fields,int chars,int blanks,
int tabch);
-extern char *strfill(my_string s,uint len,pchar fill);
-extern uint strinstr(const char *str,const char *search);
-extern uint r_strinstr(reg1 my_string str,int from, reg4 my_string search);
+extern char *strfill(char * s,size_t len,pchar fill);
+extern size_t strinstr(const char *str,const char *search);
+extern size_t r_strinstr(const char *str, size_t from, const char *search);
extern char *strkey(char *dst,char *head,char *tail,char *flags);
-extern char *strmake(char *dst,const char *src,uint length);
+extern char *strmake(char *dst,const char *src,size_t length);
#ifndef strmake_overlapp
-extern char *strmake_overlapp(char *dst,const char *src, uint length);
+extern char *strmake_overlapp(char *dst,const char *src, size_t length);
#endif
#ifndef strmov
extern char *strmov(char *dst,const char *src);
#endif
-extern char *strnmov(char *dst,const char *src,uint n);
+extern char *strnmov(char *dst,const char *src,size_t n);
extern char *strsuff(const char *src,const char *suffix);
extern char *strcont(const char *src,const char *set);
extern char *strxcat _VARARGS((char *dst,const char *src, ...));
extern char *strxmov _VARARGS((char *dst,const char *src, ...));
extern char *strxcpy _VARARGS((char *dst,const char *src, ...));
-extern char *strxncat _VARARGS((char *dst,uint len, const char *src, ...));
-extern char *strxnmov _VARARGS((char *dst,uint len, const char *src, ...));
-extern char *strxncpy _VARARGS((char *dst,uint len, const char *src, ...));
+extern char *strxncat _VARARGS((char *dst,size_t len, const char *src, ...));
+extern char *strxnmov _VARARGS((char *dst,size_t len, const char *src, ...));
+extern char *strxncpy _VARARGS((char *dst,size_t len, const char *src, ...));
/* Prototypes of normal stringfunctions (with may ours) */
@@ -179,7 +182,7 @@ extern size_t strlen(const char *);
#endif
#endif
#ifndef HAVE_STRNLEN
-extern uint strnlen(const char *s, uint n);
+extern size_t strnlen(const char *s, size_t n);
#endif
#if !defined(__cplusplus)
@@ -232,9 +235,9 @@ extern ulonglong strtoull(const char *str, char **ptr, int base);
/* my_vsnprintf.c */
-extern int my_vsnprintf( char *str, size_t n,
- const char *format, va_list ap );
-extern int my_snprintf(char *to, size_t n, const char *fmt, ...)
+extern size_t my_vsnprintf(char *str, size_t n,
+ const char *format, va_list ap);
+extern size_t my_snprintf(char *to, size_t n, const char *fmt, ...)
ATTRIBUTE_FORMAT(printf, 3, 4);
#if defined(__cplusplus)
@@ -243,19 +246,20 @@ extern int my_snprintf(char *to, size_t n, const char *fmt, ...)
/*
LEX_STRING -- a pair of a C-string and its length.
-
- NOTE: this exactly form of declaration is required for some C-compilers
- (for one, Sun C 5.7 2005/01/07). Unfortunatelt with such declaration
- LEX_STRING can not be forward declared.
*/
-typedef struct
+#ifndef _my_plugin_h
+/* This definition must match the one given in mysql/plugin.h */
+struct st_mysql_lex_string
{
char *str;
- uint length;
-} LEX_STRING;
+ size_t length;
+};
+#endif
+typedef struct st_mysql_lex_string LEX_STRING;
-#define STRING_WITH_LEN(X) (X), ((uint) (sizeof(X) - 1))
-#define C_STRING_WITH_LEN(X) ((char *) (X)), ((uint) (sizeof(X) - 1))
+#define STRING_WITH_LEN(X) (X), ((size_t) (sizeof(X) - 1))
+#define USTRING_WITH_LEN(X) ((uchar*) X), ((size_t) (sizeof(X) - 1))
+#define C_STRING_WITH_LEN(X) ((char *) (X)), ((size_t) (sizeof(X) - 1))
#endif
diff --git a/include/my_alloc.h b/include/my_alloc.h
index 657394a363b..93b7438a1df 100644
--- a/include/my_alloc.h
+++ b/include/my_alloc.h
@@ -37,8 +37,8 @@ typedef struct st_mem_root
USED_MEM *used; /* blocks almost without free memory */
USED_MEM *pre_alloc; /* preallocated block */
/* if block have less memory it will be put in 'used' list */
- unsigned int min_malloc;
- unsigned int block_size; /* initial block size */
+ size_t min_malloc;
+ size_t block_size; /* initial block size */
unsigned int block_num; /* allocated blocks counter */
/*
first free block in queue test counter (if it exceed
diff --git a/include/my_base.h b/include/my_base.h
index 37110810558..339554979a8 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -48,6 +48,8 @@
#define HA_OPEN_FOR_REPAIR 32 /* open even if crashed */
#define HA_OPEN_FROM_SQL_LAYER 64
#define HA_OPEN_MMAP 128 /* open memory mapped */
+/* Internal temp table, used for temporary results */
+#define HA_OPEN_INTERNAL_TABLE 256
/* The following is parameter to ha_rkey() how to use key */
@@ -180,7 +182,12 @@ enum ha_extra_function {
These flags are reset by the handler::extra(HA_EXTRA_RESET) call.
*/
HA_EXTRA_DELETE_CANNOT_BATCH,
- HA_EXTRA_UPDATE_CANNOT_BATCH
+ HA_EXTRA_UPDATE_CANNOT_BATCH,
+ /*
+ Inform handler that an "INSERT...ON DUPLICATE KEY UPDATE" will be
+ executed. This condition is unset by HA_EXTRA_NO_IGNORE_DUP_KEY.
+ */
+ HA_EXTRA_INSERT_WITH_UPDATE
};
/* The following is parameter to ha_panic() */
@@ -294,6 +301,7 @@ enum ha_base_keytype {
#define HA_PACK_RECORD 2 /* Request packed record format */
#define HA_CREATE_TMP_TABLE 4
#define HA_CREATE_CHECKSUM 8
+#define HA_CREATE_KEEP_FILES 16 /* don't overwrite .MYD and MYI */
#define HA_CREATE_DELAY_KEY_WRITE 64
#define HA_CREATE_RELIES_ON_SQL_LAYER 128
@@ -396,7 +404,12 @@ enum ha_base_keytype {
#define HA_ERR_AUTOINC_READ_FAILED 166 /* Failed to get next autoinc value */
#define HA_ERR_AUTOINC_ERANGE 167 /* Failed to set row autoinc value */
#define HA_ERR_GENERIC 168 /* Generic error */
-#define HA_ERR_LAST 168 /*Copy last error nr.*/
+#define HA_ERR_RECORD_IS_THE_SAME 169 /* row not actually updated :
+ new values same as the old values */
+
+#define HA_ERR_LOGGING_IMPOSSIBLE 170 /* It is not possible to log this
+ statement */
+#define HA_ERR_LAST 170 /*Copy last error nr.*/
/* Add error numbers before HA_ERR_LAST and change it accordingly. */
#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)
@@ -478,7 +491,7 @@ enum data_file_type {
typedef struct st_key_range
{
- const byte *key;
+ const uchar *key;
uint length;
key_part_map keypart_map;
enum ha_rkey_function flag;
diff --git a/include/my_bitmap.h b/include/my_bitmap.h
index 488c41ffb22..ab69b2d671d 100644
--- a/include/my_bitmap.h
+++ b/include/my_bitmap.h
@@ -41,6 +41,7 @@ typedef struct st_bitmap
#ifdef __cplusplus
extern "C" {
#endif
+extern void create_last_word_mask(MY_BITMAP *map);
extern my_bool bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits,
my_bool thread_safe);
extern my_bool bitmap_is_clear_all(const MY_BITMAP *map);
@@ -103,6 +104,17 @@ extern void bitmap_lock_invert(MY_BITMAP *map);
&= ~ (1 << ((BIT) & 7)))
#define _bitmap_is_set(MAP, BIT) (uint) (((uchar*)(MAP)->bitmap)[(BIT) / 8] \
& (1 << ((BIT) & 7)))
+/*
+ WARNING!
+
+ The below symbols are inline functions in DEBUG builds and macros in
+ non-DEBUG builds. The latter evaluate their 'bit' argument twice.
+
+ NEVER use an increment/decrement operator with the 'bit' argument.
+ It would work with DEBUG builds, but fails later in production builds!
+
+ FORBIDDEN: bitmap_set_bit($my_bitmap, (field++)->field_index);
+*/
#ifndef DBUG_OFF
static inline void
bitmap_set_bit(MY_BITMAP *map,uint bit)
diff --git a/include/my_dbug.h b/include/my_dbug.h
index 0541cf00c29..514cd17099b 100644
--- a/include/my_dbug.h
+++ b/include/my_dbug.h
@@ -23,8 +23,8 @@ extern "C" {
struct _db_code_state_;
extern int _db_keyword_(struct _db_code_state_ *cs, const char *keyword);
extern int _db_strict_keyword_(const char *keyword);
-extern int _db_explain_(struct _db_code_state_ *cs, char *buf, int len);
-extern int _db_explain_init_(char *buf, int len);
+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 void _db_process_(const char *name);
@@ -40,8 +40,8 @@ extern void _db_return_(uint _line_,const char **_sfunc_,const char **_sfile_,
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,const char *memory,
- uint length);
+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);
diff --git a/include/my_getopt.h b/include/my_getopt.h
index dcd6ad9d79b..c74f3ed672e 100644
--- a/include/my_getopt.h
+++ b/include/my_getopt.h
@@ -29,20 +29,25 @@ C_MODE_START
#define GET_STR 9
#define GET_STR_ALLOC 10
#define GET_DISABLED 11
+#define GET_ENUM 12
+#define GET_SET 13
+#define GET_DOUBLE 14
#define GET_ASK_ADDR 128
#define GET_TYPE_MASK 127
enum get_opt_arg_type { NO_ARG, OPT_ARG, REQUIRED_ARG };
+struct st_typelib;
+
struct my_option
{
const char *name; /* Name of the option */
int id; /* unique id or short option */
const char *comment; /* option comment, for autom. --help */
- gptr *value; /* The variable value */
- gptr *u_max_value; /* The user def. max variable value */
- const char **str_values; /* Pointer to possible values */
+ uchar **value; /* The variable value */
+ uchar **u_max_value; /* The user def. max variable value */
+ struct st_typelib *typelib; /* Pointer to possible values */
ulong var_type;
enum get_opt_arg_type arg_type;
longlong def_value; /* Default value */
@@ -50,7 +55,7 @@ struct my_option
longlong max_value; /* Max allowed value */
longlong sub_size; /* Subtract this from given value */
long block_size; /* Value should be a mult. of this */
- int app_type; /* To be used by an application */
+ void *app_type; /* To be used by an application */
};
typedef my_bool (* my_get_one_option) (int, const struct my_option *, char * );
@@ -58,13 +63,14 @@ typedef void (* my_error_reporter) (enum loglevel level, const char *format, ...
extern char *disabled_my_option;
extern my_bool my_getopt_print_errors;
+extern my_bool my_getopt_skip_unknown;
extern my_error_reporter my_getopt_error_reporter;
extern int handle_options (int *argc, char ***argv,
const struct my_option *longopts, my_get_one_option);
extern void my_print_help(const struct my_option *options);
extern void my_print_variables(const struct my_option *options);
-extern void my_getopt_register_get_addr(gptr* (*func_addr)(const char *, uint,
+extern void my_getopt_register_get_addr(uchar ** (*func_addr)(const char *, uint,
const struct my_option *));
ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp);
diff --git a/include/my_global.h b/include/my_global.h
index 71a2d087a43..12129523939 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -23,6 +23,17 @@
#define HAVE_EXTERNAL_CLIENT
#endif
+/*
+ InnoDB depends on some MySQL internals which other plugins should not
+ need. This is because of InnoDB's foreign key support, "safe" binlog
+ truncation, and other similar legacy features.
+
+ We define accessors for these internals unconditionally, but do not
+ expose them in mysql/plugin.h. They are declared in ha_innodb.h for
+ InnoDB's use.
+*/
+#define INNODB_COMPATIBILITY_HOOKS
+
#ifdef __CYGWIN__
/* We use a Unix API, so pretend it's not Windows */
#undef WIN
@@ -441,17 +452,7 @@ C_MODE_END
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#endif
-#ifdef HAVE_ATOMIC_ADD
-#define new my_arg_new
-#define need_to_restore_new 1
-C_MODE_START
-#include <asm/atomic.h>
-C_MODE_END
-#ifdef need_to_restore_new /* probably safer than #ifdef new */
-#undef new
-#undef need_to_restore_new
-#endif
-#endif
+
#include <errno.h> /* Recommended by debian */
/* We need the following to go around a problem with openssl on solaris */
#if defined(HAVE_CRYPT_H)
@@ -465,6 +466,18 @@ C_MODE_END
*/
#include <assert.h>
+/* an assert that works at compile-time. only for constant expression */
+#ifndef __GNUC__
+#define compile_time_assert(X) do { } while(0)
+#else
+#define compile_time_assert(X) \
+ do \
+ { \
+ char compile_time_assert[(X) ? 1 : -1] \
+ __attribute__ ((unused)); \
+ } while(0)
+#endif
+
/* Go around some bugs in different OS and compilers */
#if defined (HPUX11) && defined(_LARGEFILE_SOURCE)
#define _LARGEFILE64_SOURCE
@@ -549,12 +562,6 @@ int __void__;
#define PURIFY_OR_LINT_INIT(var)
#endif
-/* Define some useful general macros */
-#if !defined(max)
-#define max(a, b) ((a) > (b) ? (a) : (b))
-#define min(a, b) ((a) < (b) ? (a) : (b))
-#endif
-
#if !defined(HAVE_UINT)
#undef HAVE_UINT
#define HAVE_UINT
@@ -791,6 +798,10 @@ typedef SOCKET_SIZE_TYPE size_socket;
#define ulong_to_double(X) ((double) (ulong) (X))
#define SET_STACK_SIZE(X) /* Not needed on real machines */
+#ifndef STACK_DIRECTION
+#error "please add -DSTACK_DIRECTION=1 or -1 to your CPPFLAGS"
+#endif
+
#if !defined(HAVE_STRTOK_R)
#define strtok_r(A,B,C) strtok((A),(B))
#endif
@@ -855,12 +866,11 @@ typedef SOCKET_SIZE_TYPE size_socket;
#define isnan(x) ((x) != (x))
#endif
-#if !defined(HAVE_ISINF)
-/* The configure check for "isinf with math.h" has failed */
-#ifdef isinf
-#undef isinf
-#endif
-#define isinf(X) (!finite(X) && !isnan(X))
+#ifdef HAVE_ISINF
+/* isinf() can be used in both C and C++ code */
+#define my_isinf(X) isinf(X)
+#else
+#define my_isinf(X) (!finite(X) && !isnan(X))
#endif
/* Define missing math constants. */
@@ -884,21 +894,17 @@ typedef long my_ptrdiff_t;
typedef long long my_ptrdiff_t;
#endif
-/* We can't set my_size_t to size_t as we want my_size_t to be unsigned */
-#if SIZEOF_CHARP <= SIZEOF_LONG
-typedef unsigned long my_size_t;
-#else
-typedef unsigned long long my_size_t;
-#endif
-
#define MY_ALIGN(A,L) (((A) + (L) - 1) & ~((L) - 1))
#define ALIGN_SIZE(A) MY_ALIGN((A),sizeof(double))
/* Size to make adressable obj. */
#define ALIGN_PTR(A, t) ((t*) MY_ALIGN((A),sizeof(t)))
/* Offset of field f in structure t */
#define OFFSET(t, f) ((size_t)(char *)&((t *)0)->f)
-#define ADD_TO_PTR(ptr,size,type) (type) ((byte*) (ptr)+size)
-#define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((byte*) (A) - (byte*) (B))
+#define ADD_TO_PTR(ptr,size,type) (type) ((uchar*) (ptr)+size)
+#define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((uchar*) (A) - (uchar*) (B))
+
+#define MY_DIV_UP(A, B) (((A) + (B) - 1) / (B))
+#define MY_ALIGNED_BYTE_ARRAY(N, S, T) T N[MY_DIV_UP(S, sizeof(T))]
/*
Custom version of standard offsetof() macro which can be used to get
@@ -933,11 +939,6 @@ typedef unsigned long long my_size_t;
/* Typdefs for easyier portability */
-#if defined(VOIDTYPE)
-typedef void *gptr; /* Generic pointer */
-#else
-typedef char *gptr; /* Generic pointer */
-#endif
#ifndef HAVE_UCHAR
typedef unsigned char uchar; /* Short for unsigned char */
#endif
@@ -976,7 +977,12 @@ typedef unsigned long uint32;
typedef unsigned long ulong; /* Short for unsigned long */
#endif
#ifndef longlong_defined
-#if defined(HAVE_LONG_LONG) && SIZEOF_LONG != 8
+/*
+ Using [unsigned] long long is preferable as [u]longlong because we use
+ [unsigned] long long unconditionally in many places,
+ for example in constants with [U]LL suffix.
+*/
+#if defined(HAVE_LONG_LONG) && SIZEOF_LONG_LONG == 8
typedef unsigned long long int ulonglong; /* ulong or unsigned long long */
typedef long long int longlong;
#else
@@ -1058,12 +1064,7 @@ typedef off_t os_off_t;
typedef uint8 int7; /* Most effective integer 0 <= x <= 127 */
typedef short int15; /* Most effective integer 0 <= x <= 32767 */
-typedef char *my_string; /* String of characters */
-typedef unsigned long size_s; /* Size of strings (In string-funcs) */
typedef int myf; /* Type of MyFlags in my_funcs */
-#ifndef byte_defined
-typedef char byte; /* Smallest addressable unit */
-#endif
typedef char my_bool; /* Small bool */
#if !defined(bool) && !defined(bool_defined) && (!defined(HAVE_BOOL) || !defined(__cplusplus))
typedef char bool; /* Ordinary boolean values 0 1 */
@@ -1209,9 +1210,9 @@ do { doubleget_union _tmp; \
} while (0)
#define float4get(V,M) do { *((float *) &(V)) = *((float*) (M)); } while(0)
#define float8get(V,M) doubleget((V),(M))
-#define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float))
-#define floatstore(T,V) memcpy((byte*)(T), (byte*)(&V),sizeof(float))
-#define floatget(V,M) memcpy((byte*) &V,(byte*) (M),sizeof(float))
+#define float4store(V,M) memcpy((uchar*) V,(uchar*) (&M),sizeof(float))
+#define floatstore(T,V) memcpy((uchar*)(T), (uchar*)(&V),sizeof(float))
+#define floatget(V,M) memcpy((uchar*) &V,(uchar*) (M),sizeof(float))
#define float8store(V,M) doublestore((V),(M))
#endif /* __i386__ */
@@ -1294,59 +1295,59 @@ do { doubleget_union _tmp; \
int4store((T),def_temp); \
int4store((T+4),def_temp2); } while(0)
#ifdef WORDS_BIGENDIAN
-#define float4store(T,A) do { *(T)= ((byte *) &A)[3];\
- *((T)+1)=(char) ((byte *) &A)[2];\
- *((T)+2)=(char) ((byte *) &A)[1];\
- *((T)+3)=(char) ((byte *) &A)[0]; } while(0)
+#define float4store(T,A) do { *(T)= ((uchar *) &A)[3];\
+ *((T)+1)=(char) ((uchar *) &A)[2];\
+ *((T)+2)=(char) ((uchar *) &A)[1];\
+ *((T)+3)=(char) ((uchar *) &A)[0]; } while(0)
#define float4get(V,M) do { float def_temp;\
- ((byte*) &def_temp)[0]=(M)[3];\
- ((byte*) &def_temp)[1]=(M)[2];\
- ((byte*) &def_temp)[2]=(M)[1];\
- ((byte*) &def_temp)[3]=(M)[0];\
+ ((uchar*) &def_temp)[0]=(M)[3];\
+ ((uchar*) &def_temp)[1]=(M)[2];\
+ ((uchar*) &def_temp)[2]=(M)[1];\
+ ((uchar*) &def_temp)[3]=(M)[0];\
(V)=def_temp; } while(0)
-#define float8store(T,V) do { *(T)= ((byte *) &V)[7];\
- *((T)+1)=(char) ((byte *) &V)[6];\
- *((T)+2)=(char) ((byte *) &V)[5];\
- *((T)+3)=(char) ((byte *) &V)[4];\
- *((T)+4)=(char) ((byte *) &V)[3];\
- *((T)+5)=(char) ((byte *) &V)[2];\
- *((T)+6)=(char) ((byte *) &V)[1];\
- *((T)+7)=(char) ((byte *) &V)[0]; } while(0)
+#define float8store(T,V) do { *(T)= ((uchar *) &V)[7];\
+ *((T)+1)=(char) ((uchar *) &V)[6];\
+ *((T)+2)=(char) ((uchar *) &V)[5];\
+ *((T)+3)=(char) ((uchar *) &V)[4];\
+ *((T)+4)=(char) ((uchar *) &V)[3];\
+ *((T)+5)=(char) ((uchar *) &V)[2];\
+ *((T)+6)=(char) ((uchar *) &V)[1];\
+ *((T)+7)=(char) ((uchar *) &V)[0]; } while(0)
#define float8get(V,M) do { double def_temp;\
- ((byte*) &def_temp)[0]=(M)[7];\
- ((byte*) &def_temp)[1]=(M)[6];\
- ((byte*) &def_temp)[2]=(M)[5];\
- ((byte*) &def_temp)[3]=(M)[4];\
- ((byte*) &def_temp)[4]=(M)[3];\
- ((byte*) &def_temp)[5]=(M)[2];\
- ((byte*) &def_temp)[6]=(M)[1];\
- ((byte*) &def_temp)[7]=(M)[0];\
+ ((uchar*) &def_temp)[0]=(M)[7];\
+ ((uchar*) &def_temp)[1]=(M)[6];\
+ ((uchar*) &def_temp)[2]=(M)[5];\
+ ((uchar*) &def_temp)[3]=(M)[4];\
+ ((uchar*) &def_temp)[4]=(M)[3];\
+ ((uchar*) &def_temp)[5]=(M)[2];\
+ ((uchar*) &def_temp)[6]=(M)[1];\
+ ((uchar*) &def_temp)[7]=(M)[0];\
(V) = def_temp; } while(0)
#else
-#define float4get(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(float))
-#define float4store(V,M) memcpy_fixed((byte*) V,(byte*) (&M),sizeof(float))
+#define float4get(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(float))
+#define float4store(V,M) memcpy_fixed((uchar*) V,(uchar*) (&M),sizeof(float))
#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
-#define doublestore(T,V) do { *(((char*)T)+0)=(char) ((byte *) &V)[4];\
- *(((char*)T)+1)=(char) ((byte *) &V)[5];\
- *(((char*)T)+2)=(char) ((byte *) &V)[6];\
- *(((char*)T)+3)=(char) ((byte *) &V)[7];\
- *(((char*)T)+4)=(char) ((byte *) &V)[0];\
- *(((char*)T)+5)=(char) ((byte *) &V)[1];\
- *(((char*)T)+6)=(char) ((byte *) &V)[2];\
- *(((char*)T)+7)=(char) ((byte *) &V)[3]; }\
+#define doublestore(T,V) do { *(((char*)T)+0)=(char) ((uchar *) &V)[4];\
+ *(((char*)T)+1)=(char) ((uchar *) &V)[5];\
+ *(((char*)T)+2)=(char) ((uchar *) &V)[6];\
+ *(((char*)T)+3)=(char) ((uchar *) &V)[7];\
+ *(((char*)T)+4)=(char) ((uchar *) &V)[0];\
+ *(((char*)T)+5)=(char) ((uchar *) &V)[1];\
+ *(((char*)T)+6)=(char) ((uchar *) &V)[2];\
+ *(((char*)T)+7)=(char) ((uchar *) &V)[3]; }\
while(0)
#define doubleget(V,M) do { double def_temp;\
- ((byte*) &def_temp)[0]=(M)[4];\
- ((byte*) &def_temp)[1]=(M)[5];\
- ((byte*) &def_temp)[2]=(M)[6];\
- ((byte*) &def_temp)[3]=(M)[7];\
- ((byte*) &def_temp)[4]=(M)[0];\
- ((byte*) &def_temp)[5]=(M)[1];\
- ((byte*) &def_temp)[6]=(M)[2];\
- ((byte*) &def_temp)[7]=(M)[3];\
+ ((uchar*) &def_temp)[0]=(M)[4];\
+ ((uchar*) &def_temp)[1]=(M)[5];\
+ ((uchar*) &def_temp)[2]=(M)[6];\
+ ((uchar*) &def_temp)[3]=(M)[7];\
+ ((uchar*) &def_temp)[4]=(M)[0];\
+ ((uchar*) &def_temp)[5]=(M)[1];\
+ ((uchar*) &def_temp)[6]=(M)[2];\
+ ((uchar*) &def_temp)[7]=(M)[3];\
(V) = def_temp; } while(0)
#endif /* __FLOAT_WORD_ORDER */
@@ -1377,16 +1378,16 @@ do { doubleget_union _tmp; \
#define shortget(V,M) do { V = (short) (((short) ((uchar) (M)[1]))+\
((short) ((short) (M)[0]) << 8)); } while(0)
#define longget(V,M) do { int32 def_temp;\
- ((byte*) &def_temp)[0]=(M)[0];\
- ((byte*) &def_temp)[1]=(M)[1];\
- ((byte*) &def_temp)[2]=(M)[2];\
- ((byte*) &def_temp)[3]=(M)[3];\
+ ((uchar*) &def_temp)[0]=(M)[0];\
+ ((uchar*) &def_temp)[1]=(M)[1];\
+ ((uchar*) &def_temp)[2]=(M)[2];\
+ ((uchar*) &def_temp)[3]=(M)[3];\
(V)=def_temp; } while(0)
#define ulongget(V,M) do { uint32 def_temp;\
- ((byte*) &def_temp)[0]=(M)[0];\
- ((byte*) &def_temp)[1]=(M)[1];\
- ((byte*) &def_temp)[2]=(M)[2];\
- ((byte*) &def_temp)[3]=(M)[3];\
+ ((uchar*) &def_temp)[0]=(M)[0];\
+ ((uchar*) &def_temp)[1]=(M)[1];\
+ ((uchar*) &def_temp)[2]=(M)[2];\
+ ((uchar*) &def_temp)[3]=(M)[3];\
(V)=def_temp; } while(0)
#define shortstore(T,A) do { uint def_temp=(uint) (A) ;\
*(((char*)T)+1)=(char)(def_temp); \
@@ -1396,12 +1397,12 @@ do { doubleget_union _tmp; \
*(((char*)T)+1)=(((A) >> 16));\
*(((char*)T)+0)=(((A) >> 24)); } while(0)
-#define floatget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(float))
-#define floatstore(T,V) memcpy_fixed((byte*) (T),(byte*)(&V),sizeof(float))
-#define doubleget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(double))
-#define doublestore(T,V) memcpy_fixed((byte*) (T),(byte*) &V,sizeof(double))
-#define longlongget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(ulonglong))
-#define longlongstore(T,V) memcpy_fixed((byte*) (T),(byte*) &V,sizeof(ulonglong))
+#define floatget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(float))
+#define floatstore(T,V) memcpy_fixed((uchar*) (T),(uchar*)(&V),sizeof(float))
+#define doubleget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(double))
+#define doublestore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(double))
+#define longlongget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(ulonglong))
+#define longlongstore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(ulonglong))
#else
@@ -1412,15 +1413,15 @@ do { doubleget_union _tmp; \
#define shortstore(T,V) int2store(T,V)
#define longstore(T,V) int4store(T,V)
#ifndef floatstore
-#define floatstore(T,V) memcpy_fixed((byte*) (T),(byte*) (&V),sizeof(float))
-#define floatget(V,M) memcpy_fixed((byte*) &V, (byte*) (M), sizeof(float))
+#define floatstore(T,V) memcpy_fixed((uchar*) (T),(uchar*) (&V),sizeof(float))
+#define floatget(V,M) memcpy_fixed((uchar*) &V, (uchar*) (M), sizeof(float))
#endif
#ifndef doubleget
-#define doubleget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(double))
-#define doublestore(T,V) memcpy_fixed((byte*) (T),(byte*) &V,sizeof(double))
+#define doubleget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(double))
+#define doublestore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(double))
#endif /* doubleget */
-#define longlongget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(ulonglong))
-#define longlongstore(T,V) memcpy_fixed((byte*) (T),(byte*) &V,sizeof(ulonglong))
+#define longlongget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(ulonglong))
+#define longlongstore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(ulonglong))
#endif /* WORDS_BIGENDIAN */
@@ -1437,10 +1438,13 @@ do { doubleget_union _tmp; \
#ifndef THREAD
#define thread_safe_increment(V,L) (V)++
+#define thread_safe_decrement(V,L) (V)--
#define thread_safe_add(V,C,L) (V)+=(C)
#define thread_safe_sub(V,C,L) (V)-=(C)
#define statistic_increment(V,L) (V)++
+#define statistic_decrement(V,L) (V)--
#define statistic_add(V,C,L) (V)+=(C)
+#define statistic_sub(V,C,L) (V)-=(C)
#endif
#ifdef HAVE_CHARSET_utf8
@@ -1498,4 +1502,10 @@ inline void operator delete[](void*, void*) { /* Do nothing */ }
/* Length of decimal number represented by INT64. */
#define MY_INT64_NUM_DECIMAL_DIGITS 21
+/* Define some useful general macros (should be done after all headers). */
+#if !defined(max)
+#define max(a, b) ((a) > (b) ? (a) : (b))
+#define min(a, b) ((a) < (b) ? (a) : (b))
+#endif
+
#endif /* my_global_h */
diff --git a/include/my_list.h b/include/my_list.h
index 4a1737d4c53..775b56587b8 100644
--- a/include/my_list.h
+++ b/include/my_list.h
@@ -33,11 +33,11 @@ extern LIST *list_cons(void *data,LIST *root);
extern LIST *list_reverse(LIST *root);
extern void list_free(LIST *root,unsigned int free_data);
extern unsigned int list_length(LIST *);
-extern int list_walk(LIST *,list_walk_action action,gptr argument);
+extern int list_walk(LIST *,list_walk_action action,unsigned char * argument);
#define list_rest(a) ((a)->next)
#define list_push(a,b) (a)=list_cons((b),(a))
-#define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old) ; my_free((gptr) old,MYF(MY_FAE)); }
+#define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old) ; my_free((unsigned char *) old,MYF(MY_FAE)); }
#ifdef __cplusplus
}
diff --git a/include/md5.h b/include/my_md5.h
index f92976b3beb..f92976b3beb 100644
--- a/include/md5.h
+++ b/include/my_md5.h
diff --git a/include/my_nosys.h b/include/my_nosys.h
index f8422699041..df5639b81e2 100644
--- a/include/my_nosys.h
+++ b/include/my_nosys.h
@@ -35,8 +35,9 @@ extern "C" {
#undef my_seek
#define my_read(a,b,c,d) my_quick_read(a,b,c,d)
#define my_write(a,b,c,d) my_quick_write(a,b,c)
-extern uint my_quick_read(File Filedes,byte *Buffer,uint Count,myf myFlags);
-extern uint my_quick_write(File Filedes,const byte *Buffer,uint Count);
+extern size_t my_quick_read(File Filedes,uchar *Buffer,size_t Count,
+ myf myFlags);
+extern size_t my_quick_write(File Filedes,const uchar *Buffer,size_t Count);
#if !defined(SAFEMALLOC) && defined(USE_HALLOC)
#define my_malloc(a,b) halloc(a,1)
diff --git a/include/my_pthread.h b/include/my_pthread.h
index 340dc32981a..eb390c2acc4 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -29,25 +29,6 @@ extern "C" {
#define EXTERNC
#endif /* __cplusplus */
-/*
- BUG#24507: Race conditions inside current NPTL pthread_exit() implementation.
-
- If macro NPTL_PTHREAD_EXIT_HACK is defined then a hack described in the bug
- report will be implemented inside my_thread_global_init() in my_thr_init.c.
-
- This amounts to spawning a dummy thread which does nothing but executes
- pthread_exit(0).
-
- This bug is fixed in version 2.5 of glibc library.
-
- TODO: Remove this code when fixed versions of glibc6 are in common use.
- */
-
-#if defined(TARGET_OS_LINUX) && defined(HAVE_NPTL) && \
- defined(__GLIBC__) && ( __GLIBC__ < 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ < 5 )
-#define NPTL_PTHREAD_EXIT_BUG 1
-#endif
-
#if defined(__WIN__)
typedef CRITICAL_SECTION pthread_mutex_t;
typedef HANDLE pthread_t;
@@ -179,10 +160,9 @@ void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/
#define pthread_mutex_unlock(A) LeaveCriticalSection(A)
#define pthread_mutex_destroy(A) DeleteCriticalSection(A)
#define my_pthread_setprio(A,B) SetThreadPriority(GetCurrentThread(), (B))
-#define pthread_kill(A,B) pthread_dummy(0)
+#define pthread_kill(A,B) pthread_dummy(ESRCH)
-#define pthread_join(A,B) \
- ((WaitForSingleObject((A), INFINITE) != WAIT_OBJECT_0) || !CloseHandle(A))
+#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)
@@ -362,14 +342,14 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res);
#define pthread_attr_setdetachstate(A,B) pthread_dummy(0)
#define pthread_create(A,B,C,D) pthread_create((A),*(B),(C),(D))
#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
-#define pthread_kill(A,B) pthread_dummy(0)
+#define pthread_kill(A,B) pthread_dummy(ESRCH)
#undef pthread_detach_this_thread
#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); }
#endif
#ifdef HAVE_DARWIN5_THREADS
#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
-#define pthread_kill(A,B) pthread_dummy(0)
+#define pthread_kill(A,B) pthread_dummy(ESRCH)
#define pthread_condattr_init(A) pthread_dummy(0)
#define pthread_condattr_destroy(A) pthread_dummy(0)
#undef pthread_detach_this_thread
@@ -389,7 +369,7 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res);
#ifndef pthread_sigmask
#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
#endif
-#define pthread_kill(A,B) pthread_dummy(0)
+#define pthread_kill(A,B) pthread_dummy(ESRCH)
#undef pthread_detach_this_thread
#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); }
#elif !defined(__NETWARE__) /* HAVE_PTHREAD_ATTR_CREATE && !HAVE_SIGWAIT */
@@ -539,6 +519,7 @@ typedef struct st_my_pthread_fastmutex_t
pthread_mutex_t mutex;
uint spins;
} my_pthread_fastmutex_t;
+void fastmutex_global_init(void);
int my_pthread_fastmutex_init(my_pthread_fastmutex_t *mp,
const pthread_mutexattr_t *attr);
@@ -647,6 +628,11 @@ extern pthread_mutexattr_t my_errorcheck_mutexattr;
#define MY_MUTEX_INIT_ERRCHK NULL
#endif
+#ifndef ESRCH
+/* Define it to something */
+#define ESRCH 1
+#endif
+
typedef ulong my_thread_id;
extern my_bool my_thread_global_init(void);
@@ -688,7 +674,7 @@ struct st_my_thread_var
struct st_my_thread_var *next,**prev;
void *opt_info;
#ifndef DBUG_OFF
- gptr dbug;
+ void *dbug;
char name[THREAD_NAME_SIZE+1];
#endif
};
@@ -710,33 +696,68 @@ extern uint my_thread_end_wait_time;
extern uint thd_lib_detected;
- /* statistics_xxx functions are for not essential statistic */
+/*
+ thread_safe_xxx functions are for critical statistic or counters.
+ The implementation is guaranteed to be thread safe, on all platforms.
+ Note that the calling code should *not* assume the counter is protected
+ by the mutex given, as the implementation of these helpers may change
+ to use my_atomic operations instead.
+*/
+/*
+ Warning:
+ When compiling without threads, this file is not included.
+ See the *other* declarations of thread_safe_xxx in include/my_global.h
+
+ Second warning:
+ See include/config-win.h, for yet another implementation.
+*/
+#ifdef THREAD
#ifndef thread_safe_increment
-#ifdef HAVE_ATOMIC_ADD
-#define thread_safe_increment(V,L) atomic_inc((atomic_t*) &V)
-#define thread_safe_decrement(V,L) atomic_dec((atomic_t*) &V)
-#define thread_safe_add(V,C,L) atomic_add((C),(atomic_t*) &V)
-#define thread_safe_sub(V,C,L) atomic_sub((C),(atomic_t*) &V)
-#else
#define thread_safe_increment(V,L) \
(pthread_mutex_lock((L)), (V)++, pthread_mutex_unlock((L)))
#define thread_safe_decrement(V,L) \
(pthread_mutex_lock((L)), (V)--, pthread_mutex_unlock((L)))
-#define thread_safe_add(V,C,L) (pthread_mutex_lock((L)), (V)+=(C), pthread_mutex_unlock((L)))
+#endif
+
+#ifndef thread_safe_add
+#define thread_safe_add(V,C,L) \
+ (pthread_mutex_lock((L)), (V)+=(C), pthread_mutex_unlock((L)))
#define thread_safe_sub(V,C,L) \
(pthread_mutex_lock((L)), (V)-=(C), pthread_mutex_unlock((L)))
-#endif /* HAVE_ATOMIC_ADD */
+#endif
+#endif
+
+/*
+ statistics_xxx functions are for non critical statistic,
+ maintained in global variables.
+ When compiling with SAFE_STATISTICS:
+ - race conditions can not occur.
+ - some locking occurs, which may cause performance degradation.
+
+ When compiling without SAFE_STATISTICS:
+ - race conditions can occur, making the result slightly inaccurate.
+ - the lock given is not honored.
+*/
#ifdef SAFE_STATISTICS
-#define statistic_increment(V,L) thread_safe_increment((V),(L))
-#define statistic_decrement(V,L) thread_safe_decrement((V),(L))
-#define statistic_add(V,C,L) thread_safe_add((V),(C),(L))
+#define statistic_increment(V,L) thread_safe_increment((V),(L))
+#define statistic_decrement(V,L) thread_safe_decrement((V),(L))
+#define statistic_add(V,C,L) thread_safe_add((V),(C),(L))
+#define statistic_sub(V,C,L) thread_safe_sub((V),(C),(L))
#else
#define statistic_decrement(V,L) (V)--
#define statistic_increment(V,L) (V)++
#define statistic_add(V,C,L) (V)+=(C)
+#define statistic_sub(V,C,L) (V)-=(C)
#endif /* SAFE_STATISTICS */
-#endif /* thread_safe_increment */
+
+/*
+ No locking needed, the counter is owned by the thread
+*/
+#define status_var_increment(V) (V)++
+#define status_var_decrement(V) (V)--
+#define status_var_add(V,C) (V)+=(C)
+#define status_var_sub(V,C) (V)-=(C)
#ifdef __cplusplus
}
diff --git a/include/my_sys.h b/include/my_sys.h
index 15de73d65a0..2ce36760032 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -41,7 +41,7 @@ extern int NEAR my_errno; /* Last error in mysys */
#define ERRMSGSIZE (SC_MAXWIDTH) /* Max length of a error message */
#define NRERRBUFFS (2) /* Buffers for parameters */
-#define MY_FILE_ERROR ((uint) ~0)
+#define MY_FILE_ERROR ((size_t) -1)
/* General bitmaps for my_func's */
#define MY_FFNF 1 /* Fatal if file not found */
@@ -66,8 +66,8 @@ extern int NEAR my_errno; /* Last error in mysys */
#define MY_ALLOW_ZERO_PTR 64 /* my_realloc() ; zero ptr -> malloc */
#define MY_FREE_ON_ERROR 128 /* my_realloc() ; Free old ptr on error */
#define MY_HOLD_ON_ERROR 256 /* my_realloc() ; Return old ptr on error */
-#define MY_THREADSAFE 128 /* pread/pwrite: Don't allow interrupts */
#define MY_DONT_OVERWRITE_FILE 1024 /* my_copy: Don't overwrite file */
+#define MY_THREADSAFE 2048 /* my_seek(): lock fd mutex */
#define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */
#define MY_GIVE_INFO 2 /* Give time info about process*/
@@ -150,16 +150,16 @@ extern ulonglong sf_malloc_mem_limit;
#else
#define my_checkmalloc()
#undef TERMINATE
-#define TERMINATE(A) {}
+#define TERMINATE(A,B) {}
#define QUICK_SAFEMALLOC
#define NORMAL_SAFEMALLOC
-extern gptr my_malloc(uint Size,myf MyFlags);
+extern void *my_malloc(size_t Size,myf MyFlags);
#define my_malloc_ci(SZ,FLAG) my_malloc( SZ, FLAG )
-extern gptr my_realloc(gptr oldpoint,uint Size,myf MyFlags);
-extern void my_no_flags_free(gptr ptr);
-extern gptr my_memdup(const byte *from,uint length,myf MyFlags);
+extern void *my_realloc(void *oldpoint, size_t Size, myf MyFlags);
+extern void my_no_flags_free(void *ptr);
+extern void *my_memdup(const void *from,size_t length,myf MyFlags);
extern char *my_strdup(const char *from,myf MyFlags);
-extern char *my_strndup(const char *from, uint length,
+extern char *my_strndup(const char *from, size_t length,
myf MyFlags);
/* we do use FG (as a no-op) in below so that a typo on FG is caught */
#define my_free(PTR,FG) ((void)FG,my_no_flags_free(PTR))
@@ -171,8 +171,8 @@ extern char *my_strndup(const char *from, uint length,
#ifdef HAVE_LARGE_PAGES
extern uint my_get_large_page_size(void);
-extern gptr my_large_malloc(uint size, myf my_flags);
-extern void my_large_free(gptr ptr, myf my_flags);
+extern uchar * my_large_malloc(size_t size, myf my_flags);
+extern void my_large_free(uchar * ptr, myf my_flags);
#else
#define my_get_large_page_size() (0)
#define my_large_malloc(A,B) my_malloc_lock((A),(B))
@@ -225,6 +225,7 @@ extern CHARSET_INFO compiled_charsets[];
/* statistics */
extern ulong my_file_opened,my_stream_opened, my_tmp_file_created;
+extern ulong my_file_total_opened;
extern uint mysys_usage_id;
extern my_bool my_init_done;
@@ -258,7 +259,7 @@ typedef struct wild_file_pack /* Struct to hold info when selecting files */
{
uint wilds; /* How many wildcards */
uint not_pos; /* Start of not-theese-files */
- my_string *wild; /* Pointer to wildcards */
+ char * *wild; /* Pointer to wildcards */
} WF_PACK;
enum loglevel {
@@ -284,7 +285,7 @@ typedef struct st_record_cache /* Used when cacheing records */
int rc_seek,error,inited;
uint rc_length,read_length,reclength;
my_off_t rc_record_pos,end_of_file;
- byte *rc_buff,*rc_buff2,*rc_pos,*rc_end,*rc_request_pos;
+ uchar *rc_buff,*rc_buff2,*rc_pos,*rc_end,*rc_request_pos;
#ifdef HAVE_AIOWAIT
int use_async_io;
my_aio_result aio_result;
@@ -300,7 +301,7 @@ enum file_type
struct st_my_file_info
{
- my_string name;
+ char * name;
enum file_type type;
#if defined(THREAD) && !defined(HAVE_PREAD)
pthread_mutex_t mutex;
@@ -311,7 +312,7 @@ extern struct st_my_file_info *my_file_info;
typedef struct st_dynamic_array
{
- char *buffer;
+ uchar *buffer;
uint elements,max_element;
uint alloc_increment;
uint size_of_element;
@@ -330,7 +331,7 @@ typedef struct st_my_tmpdir
typedef struct st_dynamic_string
{
char *str;
- uint length,max_length,alloc_increment;
+ size_t length,max_length,alloc_increment;
} DYNAMIC_STRING;
struct st_io_cache;
@@ -346,8 +347,8 @@ typedef struct st_io_cache_share
my_off_t pos_in_file;
/* If a synchronized write cache is the source of the data. */
struct st_io_cache *source_cache;
- byte *buffer; /* The read buffer. */
- byte *read_end; /* Behind last valid byte of buffer. */
+ uchar *buffer; /* The read buffer. */
+ uchar *read_end; /* Behind last valid byte of buffer. */
int running_threads; /* threads not in lock. */
int total_threads; /* threads sharing the cache. */
int error; /* Last error. */
@@ -360,7 +361,7 @@ typedef struct st_io_cache_share
typedef struct st_io_cache /* Used when cacheing files */
{
- /* Offset in file corresponding to the first byte of byte* buffer. */
+ /* Offset in file corresponding to the first byte of uchar* buffer. */
my_off_t pos_in_file;
/*
The offset of end of file for READ_CACHE and WRITE_CACHE.
@@ -369,26 +370,26 @@ typedef struct st_io_cache /* Used when cacheing files */
*/
my_off_t end_of_file;
/* Points to current read position in the buffer */
- byte *read_pos;
+ uchar *read_pos;
/* the non-inclusive boundary in the buffer for the currently valid read */
- byte *read_end;
- byte *buffer; /* The read buffer */
+ uchar *read_end;
+ uchar *buffer; /* The read buffer */
/* Used in ASYNC_IO */
- byte *request_pos;
+ uchar *request_pos;
/* Only used in WRITE caches and in SEQ_READ_APPEND to buffer writes */
- byte *write_buffer;
+ uchar *write_buffer;
/*
Only used in SEQ_READ_APPEND, and points to the current read position
in the write buffer. Note that reads in SEQ_READ_APPEND caches can
- happen from both read buffer (byte* buffer) and write buffer
- (byte* write_buffer).
+ happen from both read buffer (uchar* buffer) and write buffer
+ (uchar* write_buffer).
*/
- byte *append_read_pos;
+ uchar *append_read_pos;
/* Points to current write position in the write buffer */
- byte *write_pos;
+ uchar *write_pos;
/* The non-inclusive boundary of the valid write area */
- byte *write_end;
+ uchar *write_end;
/*
Current_pos and current_end are convenience variables used by
@@ -396,7 +397,7 @@ typedef struct st_io_cache /* Used when cacheing files */
current_pos points to &write_pos, and current_end to &write_end in a
WRITE_CACHE, and &read_pos and &read_end respectively otherwise
*/
- byte **current_pos, **current_end;
+ uchar **current_pos, **current_end;
#ifdef THREAD
/*
The lock is for append buffer used in SEQ_READ_APPEND cache
@@ -420,12 +421,12 @@ typedef struct st_io_cache /* Used when cacheing files */
my_b_read() will call read_function to fetch the data. read_function
must never be invoked directly.
*/
- int (*read_function)(struct st_io_cache *,byte *,uint);
+ int (*read_function)(struct st_io_cache *,uchar *,size_t);
/*
Same idea as in the case of read_function, except my_b_write() needs to
be replaced with my_b_append() for a SEQ_READ_APPEND cache
*/
- int (*write_function)(struct st_io_cache *,const byte *,uint);
+ int (*write_function)(struct st_io_cache *,const uchar *,size_t);
/*
Specifies the type of the cache. Depending on the type of the cache
certain operations might not be available and yield unpredicatable
@@ -460,9 +461,9 @@ typedef struct st_io_cache /* Used when cacheing files */
*/
int seek_not_done,error;
/* buffer_length is memory size allocated for buffer or write_buffer */
- uint buffer_length;
+ size_t buffer_length;
/* read_length is the same as buffer_length except when we use async io */
- uint read_length;
+ size_t read_length;
myf myflags; /* Flags used to my_read/my_write */
/*
alloced_buffer is 1 if the buffer was allocated by init_io_cache() and
@@ -518,14 +519,14 @@ typedef int (*qsort2_cmp)(const void *, const void *, const void *);
(((info)->read_end=(info)->read_pos),(*(info)->read_function)(info,0,0))
#define my_b_tell(info) ((info)->pos_in_file + \
- (uint) (*(info)->current_pos - (info)->request_pos))
+ (size_t) (*(info)->current_pos - (info)->request_pos))
/* tell write offset in the SEQ_APPEND cache */
int my_b_copy_to_file(IO_CACHE *cache, FILE *file);
my_off_t my_b_append_tell(IO_CACHE* info);
my_off_t my_b_safe_tell(IO_CACHE* info); /* picks the correct tell() */
-#define my_b_bytes_in_cache(info) (uint) (*(info)->current_end - \
+#define my_b_bytes_in_cache(info) (size_t) (*(info)->current_end - \
*(info)->current_pos)
typedef uint32 ha_checksum;
@@ -542,13 +543,13 @@ typedef int (*Process_option_func)(void *ctx, const char *group_name,
extern int my_copy(const char *from,const char *to,myf MyFlags);
extern int my_append(const char *from,const char *to,myf MyFlags);
extern int my_delete(const char *name,myf MyFlags);
-extern int my_getwd(my_string buf,uint size,myf MyFlags);
+extern int my_getwd(char * buf,size_t size,myf MyFlags);
extern int my_setwd(const char *dir,myf MyFlags);
extern int my_lock(File fd,int op,my_off_t start, my_off_t length,myf MyFlags);
-extern gptr my_once_alloc(uint Size,myf MyFlags);
+extern void *my_once_alloc(size_t Size,myf MyFlags);
extern void my_once_free(void);
extern char *my_once_strdup(const char *src,myf myflags);
-extern char *my_once_memdup(const char *src, uint len, myf myflags);
+extern void *my_once_memdup(const void *src, size_t len, myf myflags);
extern File my_open(const char *FileName,int Flags,myf MyFlags);
extern File my_register_filename(File fd, const char *FileName,
enum file_type type_of_file,
@@ -566,39 +567,39 @@ extern File my_create_with_symlink(const char *linkname, const char *filename,
extern int my_delete_with_symlink(const char *name, myf MyFlags);
extern int my_rename_with_symlink(const char *from,const char *to,myf MyFlags);
extern int my_symlink(const char *content, const char *linkname, myf MyFlags);
-extern uint my_read(File Filedes,byte *Buffer,uint Count,myf MyFlags);
-extern uint my_pread(File Filedes,byte *Buffer,uint Count,my_off_t offset,
+extern size_t my_read(File Filedes,uchar *Buffer,size_t Count,myf MyFlags);
+extern size_t my_pread(File Filedes,uchar *Buffer,size_t Count,my_off_t offset,
myf MyFlags);
extern int my_rename(const char *from,const char *to,myf MyFlags);
extern my_off_t my_seek(File fd,my_off_t pos,int whence,myf MyFlags);
extern my_off_t my_tell(File fd,myf MyFlags);
-extern uint my_write(File Filedes,const byte *Buffer,uint Count,
+extern size_t my_write(File Filedes,const uchar *Buffer,size_t Count,
myf MyFlags);
-extern uint my_pwrite(File Filedes,const byte *Buffer,uint Count,
+extern size_t my_pwrite(File Filedes,const uchar *Buffer,size_t Count,
my_off_t offset,myf MyFlags);
-extern uint my_fread(FILE *stream,byte *Buffer,uint Count,myf MyFlags);
-extern uint my_fwrite(FILE *stream,const byte *Buffer,uint Count,
+extern size_t my_fread(FILE *stream,uchar *Buffer,size_t Count,myf MyFlags);
+extern size_t my_fwrite(FILE *stream,const uchar *Buffer,size_t Count,
myf MyFlags);
extern my_off_t my_fseek(FILE *stream,my_off_t pos,int whence,myf MyFlags);
extern my_off_t my_ftell(FILE *stream,myf MyFlags);
-extern gptr _mymalloc(uint uSize,const char *sFile,
- uint uLine, myf MyFlag);
-extern gptr _myrealloc(gptr pPtr,uint uSize,const char *sFile,
+extern void *_mymalloc(size_t uSize,const char *sFile,
+ uint uLine, myf MyFlag);
+extern void *_myrealloc(void *pPtr,size_t uSize,const char *sFile,
uint uLine, myf MyFlag);
-extern gptr my_multi_malloc _VARARGS((myf MyFlags, ...));
-extern void _myfree(gptr pPtr,const char *sFile,uint uLine, myf MyFlag);
-extern int _sanity(const char *sFile,unsigned int uLine);
-extern gptr _my_memdup(const byte *from,uint length,
- const char *sFile, uint uLine,myf MyFlag);
-extern my_string _my_strdup(const char *from, const char *sFile, uint uLine,
- myf MyFlag);
-extern char *_my_strndup(const char *from, uint length,
- const char *sFile, uint uLine,
- myf MyFlag);
+extern void * my_multi_malloc _VARARGS((myf MyFlags, ...));
+extern void _myfree(void *pPtr,const char *sFile,uint uLine, myf MyFlag);
+extern int _sanity(const char *sFile, uint uLine);
+extern void *_my_memdup(const void *from, size_t length,
+ const char *sFile, uint uLine,myf MyFlag);
+extern char * _my_strdup(const char *from, const char *sFile, uint uLine,
+ myf MyFlag);
+extern char *_my_strndup(const char *from, size_t length,
+ const char *sFile, uint uLine,
+ myf MyFlag);
/* implemented in my_memmem.c */
extern void *my_memmem(const void *haystack, size_t haystacklen,
- const void *needle, size_t needlelen);
+ const void *needle, size_t needlelen);
#ifdef __WIN__
@@ -618,7 +619,7 @@ extern int nt_share_delete(const char *name,myf MyFlags);
#endif
#ifndef TERMINATE
-extern void TERMINATE(FILE *file);
+extern void TERMINATE(FILE *file, uint flag);
#endif
extern void init_glob_errs(void);
extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags);
@@ -639,7 +640,7 @@ extern my_bool my_init(void);
extern void my_end(int infoflag);
extern int my_redel(const char *from, const char *to, int MyFlags);
extern int my_copystat(const char *from, const char *to, int MyFlags);
-extern my_string my_filename(File fd);
+extern char * my_filename(File fd);
#ifndef THREAD
extern void dont_break(void);
@@ -660,116 +661,123 @@ extern char *my_tmpdir(MY_TMPDIR *tmpdir);
extern void free_tmpdir(MY_TMPDIR *tmpdir);
extern void my_remember_signal(int signal_number,sig_handler (*func)(int));
-extern uint dirname_part(my_string to,const char *name);
-extern uint dirname_length(const char *name);
+extern size_t dirname_part(char * to, const char *name, size_t *to_res_length);
+extern size_t dirname_length(const char *name);
#define base_name(A) (A+dirname_length(A))
extern int test_if_hard_path(const char *dir_name);
extern my_bool has_path(const char *name);
extern char *convert_dirname(char *to, const char *from, const char *from_end);
-extern void to_unix_path(my_string name);
-extern my_string fn_ext(const char *name);
-extern my_string fn_same(my_string toname,const char *name,int flag);
-extern my_string fn_format(my_string to,const char *name,const char *dir,
+extern void to_unix_path(char * name);
+extern char * fn_ext(const char *name);
+extern char * fn_same(char * toname,const char *name,int flag);
+extern char * fn_format(char * to,const char *name,const char *dir,
const char *form, uint flag);
-extern size_s strlength(const char *str);
-extern void pack_dirname(my_string to,const char *from);
-extern uint unpack_dirname(my_string to,const char *from);
-extern uint cleanup_dirname(my_string to,const char *from);
-extern uint system_filename(my_string to,const char *from);
-extern uint unpack_filename(my_string to,const char *from);
-extern my_string intern_filename(my_string to,const char *from);
-extern my_string directory_file_name(my_string dst, const char *src);
-extern int pack_filename(my_string to, const char *name, size_s max_length);
-extern my_string my_path(my_string to,const char *progname,
+extern size_t strlength(const char *str);
+extern void pack_dirname(char * to,const char *from);
+extern size_t unpack_dirname(char * to,const char *from);
+extern size_t cleanup_dirname(char * to,const char *from);
+extern size_t system_filename(char * to,const char *from);
+extern size_t unpack_filename(char * to,const char *from);
+extern char * intern_filename(char * to,const char *from);
+extern char * directory_file_name(char * dst, const char *src);
+extern int pack_filename(char * to, const char *name, size_t max_length);
+extern char * my_path(char * to,const char *progname,
const char *own_pathname_part);
-extern my_string my_load_path(my_string to, const char *path,
+extern char * my_load_path(char * to, const char *path,
const char *own_path_prefix);
extern int wild_compare(const char *str,const char *wildstr,
pbool str_is_pattern);
-extern WF_PACK *wf_comp(my_string str);
+extern WF_PACK *wf_comp(char * str);
extern int wf_test(struct wild_file_pack *wf_pack,const char *name);
extern void wf_end(struct wild_file_pack *buffer);
-extern size_s strip_sp(my_string str);
-extern void get_date(my_string to,int timeflag,time_t use_time);
-extern void soundex(CHARSET_INFO *, my_string out_pntr, my_string in_pntr,
+extern size_t strip_sp(char * str);
+extern void get_date(char * to,int timeflag,time_t use_time);
+extern void soundex(CHARSET_INFO *, char * out_pntr, char * in_pntr,
pbool remove_garbage);
-extern int init_record_cache(RECORD_CACHE *info,uint cachesize,File file,
- uint reclength,enum cache_type type,
+extern int init_record_cache(RECORD_CACHE *info,size_t cachesize,File file,
+ size_t reclength,enum cache_type type,
pbool use_async_io);
-extern int read_cache_record(RECORD_CACHE *info,byte *to);
+extern int read_cache_record(RECORD_CACHE *info,uchar *to);
extern int end_record_cache(RECORD_CACHE *info);
extern int write_cache_record(RECORD_CACHE *info,my_off_t filepos,
- const byte *record,uint length);
+ const uchar *record,size_t length);
extern int flush_write_cache(RECORD_CACHE *info);
extern long my_clock(void);
extern sig_handler sigtstp_handler(int signal_number);
extern void handle_recived_signals(void);
extern sig_handler my_set_alarm_variable(int signo);
-extern void my_string_ptr_sort(void *base,uint items,size_s size);
+extern void my_string_ptr_sort(uchar *base, uint items, size_t size);
extern void radixsort_for_str_ptr(uchar* base[], uint number_of_elements,
- size_s size_of_element,uchar *buffer[]);
+ size_t size_of_element,uchar *buffer[]);
extern qsort_t qsort2(void *base_ptr, size_t total_elems, size_t size,
qsort2_cmp cmp, void *cmp_argument);
-extern qsort2_cmp get_ptr_compare(uint);
-void my_store_ptr(byte *buff, uint pack_length, my_off_t pos);
-my_off_t my_get_ptr(byte *ptr, uint pack_length);
-extern int init_io_cache(IO_CACHE *info,File file,uint cachesize,
+extern qsort2_cmp get_ptr_compare(size_t);
+void my_store_ptr(uchar *buff, size_t pack_length, my_off_t pos);
+my_off_t my_get_ptr(uchar *ptr, size_t pack_length);
+extern int init_io_cache(IO_CACHE *info,File file,size_t cachesize,
enum cache_type type,my_off_t seek_offset,
pbool use_async_io, myf cache_myflags);
extern my_bool reinit_io_cache(IO_CACHE *info,enum cache_type type,
my_off_t seek_offset,pbool use_async_io,
pbool clear_cache);
extern void setup_io_cache(IO_CACHE* info);
-extern int _my_b_read(IO_CACHE *info,byte *Buffer,uint Count);
+extern int _my_b_read(IO_CACHE *info,uchar *Buffer,size_t Count);
#ifdef THREAD
-extern int _my_b_read_r(IO_CACHE *info,byte *Buffer,uint Count);
+extern int _my_b_read_r(IO_CACHE *info,uchar *Buffer,size_t Count);
extern void init_io_cache_share(IO_CACHE *read_cache, IO_CACHE_SHARE *cshare,
IO_CACHE *write_cache, uint num_threads);
extern void remove_io_thread(IO_CACHE *info);
#endif
-extern int _my_b_seq_read(IO_CACHE *info,byte *Buffer,uint Count);
-extern int _my_b_net_read(IO_CACHE *info,byte *Buffer,uint Count);
+extern int _my_b_seq_read(IO_CACHE *info,uchar *Buffer,size_t Count);
+extern int _my_b_net_read(IO_CACHE *info,uchar *Buffer,size_t Count);
extern int _my_b_get(IO_CACHE *info);
-extern int _my_b_async_read(IO_CACHE *info,byte *Buffer,uint Count);
-extern int _my_b_write(IO_CACHE *info,const byte *Buffer,uint Count);
-extern int my_b_append(IO_CACHE *info,const byte *Buffer,uint Count);
-extern int my_b_safe_write(IO_CACHE *info,const byte *Buffer,uint Count);
+extern int _my_b_async_read(IO_CACHE *info,uchar *Buffer,size_t Count);
+extern int _my_b_write(IO_CACHE *info,const uchar *Buffer,size_t Count);
+extern int my_b_append(IO_CACHE *info,const uchar *Buffer,size_t Count);
+extern int my_b_safe_write(IO_CACHE *info,const uchar *Buffer,size_t Count);
-extern int my_block_write(IO_CACHE *info, const byte *Buffer,
- uint Count, my_off_t pos);
+extern int my_block_write(IO_CACHE *info, const uchar *Buffer,
+ size_t Count, my_off_t pos);
extern int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock);
#define flush_io_cache(info) my_b_flush_io_cache((info),1)
extern int end_io_cache(IO_CACHE *info);
-extern uint my_b_fill(IO_CACHE *info);
+extern size_t my_b_fill(IO_CACHE *info);
extern void my_b_seek(IO_CACHE *info,my_off_t pos);
-extern uint my_b_gets(IO_CACHE *info, char *to, uint max_length);
+extern size_t my_b_gets(IO_CACHE *info, char *to, size_t max_length);
extern my_off_t my_b_filelength(IO_CACHE *info);
-extern uint my_b_printf(IO_CACHE *info, const char* fmt, ...);
-extern uint my_b_vprintf(IO_CACHE *info, const char* fmt, va_list ap);
+extern size_t my_b_printf(IO_CACHE *info, const char* fmt, ...);
+extern size_t my_b_vprintf(IO_CACHE *info, const char* fmt, va_list ap);
extern my_bool open_cached_file(IO_CACHE *cache,const char *dir,
- const char *prefix, uint cache_size,
+ const char *prefix, size_t cache_size,
myf cache_myflags);
extern my_bool real_open_cached_file(IO_CACHE *cache);
extern void close_cached_file(IO_CACHE *cache);
File create_temp_file(char *to, const char *dir, const char *pfx,
int mode, myf MyFlags);
-#define my_init_dynamic_array(A,B,C,D) init_dynamic_array(A,B,C,D CALLER_INFO)
-#define my_init_dynamic_array_ci(A,B,C,D) init_dynamic_array(A,B,C,D ORIG_CALLER_INFO)
+#define my_init_dynamic_array(A,B,C,D) init_dynamic_array2(A,B,NULL,C,D CALLER_INFO)
+#define my_init_dynamic_array_ci(A,B,C,D) init_dynamic_array2(A,B,NULL,C,D ORIG_CALLER_INFO)
+#define my_init_dynamic_array2(A,B,C,D,E) init_dynamic_array2(A,B,C,D,E CALLER_INFO)
+#define my_init_dynamic_array2_ci(A,B,C,D,E) init_dynamic_array2(A,B,C,D,E ORIG_CALLER_INFO)
+extern my_bool init_dynamic_array2(DYNAMIC_ARRAY *array,uint element_size,
+ void *init_buffer, uint init_alloc,
+ uint alloc_increment
+ CALLER_INFO_PROTO);
+/* init_dynamic_array() function is deprecated */
extern my_bool init_dynamic_array(DYNAMIC_ARRAY *array,uint element_size,
uint init_alloc,uint alloc_increment
CALLER_INFO_PROTO);
-extern my_bool insert_dynamic(DYNAMIC_ARRAY *array,gptr element);
-extern byte *alloc_dynamic(DYNAMIC_ARRAY *array);
-extern byte *pop_dynamic(DYNAMIC_ARRAY*);
-extern my_bool set_dynamic(DYNAMIC_ARRAY *array,gptr element,uint array_index);
-extern void get_dynamic(DYNAMIC_ARRAY *array,gptr element,uint array_index);
+extern my_bool insert_dynamic(DYNAMIC_ARRAY *array,uchar * element);
+extern uchar *alloc_dynamic(DYNAMIC_ARRAY *array);
+extern uchar *pop_dynamic(DYNAMIC_ARRAY*);
+extern my_bool set_dynamic(DYNAMIC_ARRAY *array,uchar * element,uint array_index);
+extern void get_dynamic(DYNAMIC_ARRAY *array,uchar * element,uint array_index);
extern void delete_dynamic(DYNAMIC_ARRAY *array);
extern void delete_dynamic_element(DYNAMIC_ARRAY *array, uint array_index);
extern void freeze_size(DYNAMIC_ARRAY *array);
-extern int get_index_dynamic(DYNAMIC_ARRAY *array, gptr element);
+extern int get_index_dynamic(DYNAMIC_ARRAY *array, uchar * element);
#define dynamic_array_ptr(array,array_index) ((array)->buffer+(array_index)*(array)->size_of_element)
#define dynamic_element(array,array_index,type) ((type)((array)->buffer) +(array_index))
#define push_dynamic(A,B) insert_dynamic((A),(B))
@@ -777,19 +785,19 @@ extern int get_index_dynamic(DYNAMIC_ARRAY *array, gptr element);
#define sort_dynamic(A,cmp) qsort((A)->buffer, (A)->elements, (A)->size_of_element, (cmp))
extern my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str,
- uint init_alloc,uint alloc_increment);
+ size_t init_alloc,size_t alloc_increment);
extern my_bool dynstr_append(DYNAMIC_STRING *str, const char *append);
my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append,
- uint length);
+ size_t length);
extern my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append,
...);
extern my_bool dynstr_set(DYNAMIC_STRING *str, const char *init_str);
-extern my_bool dynstr_realloc(DYNAMIC_STRING *str, ulong additional_size);
-extern my_bool dynstr_trunc(DYNAMIC_STRING *str, int n);
+extern my_bool dynstr_realloc(DYNAMIC_STRING *str, size_t additional_size);
+extern my_bool dynstr_trunc(DYNAMIC_STRING *str, size_t n);
extern void dynstr_free(DYNAMIC_STRING *str);
#ifdef HAVE_MLOCK
-extern byte *my_malloc_lock(uint length,myf flags);
-extern void my_free_lock(byte *ptr,myf flags);
+extern void *my_malloc_lock(size_t length,myf flags);
+extern void my_free_lock(void *ptr,myf flags);
#else
#define my_malloc_lock(A,B) my_malloc((A),(B))
#define my_free_lock(A,B) my_free((A),(B))
@@ -797,17 +805,17 @@ extern void my_free_lock(byte *ptr,myf flags);
#define alloc_root_inited(A) ((A)->min_malloc != 0)
#define ALLOC_ROOT_MIN_BLOCK_SIZE (MALLOC_OVERHEAD + sizeof(USED_MEM) + 8)
#define clear_alloc_root(A) do { (A)->free= (A)->used= (A)->pre_alloc= 0; (A)->min_malloc=0;} while(0)
-extern void init_alloc_root(MEM_ROOT *mem_root, uint block_size,
- uint pre_alloc_size);
-extern gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size);
-extern gptr multi_alloc_root(MEM_ROOT *mem_root, ...);
+extern void init_alloc_root(MEM_ROOT *mem_root, size_t block_size,
+ size_t pre_alloc_size);
+extern void *alloc_root(MEM_ROOT *mem_root, size_t Size);
+extern void *multi_alloc_root(MEM_ROOT *mem_root, ...);
extern void free_root(MEM_ROOT *root, myf MyFLAGS);
extern void set_prealloc_root(MEM_ROOT *root, char *ptr);
-extern void reset_root_defaults(MEM_ROOT *mem_root, uint block_size,
- uint prealloc_size);
+extern void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size,
+ size_t prealloc_size);
extern char *strdup_root(MEM_ROOT *root,const char *str);
-extern char *strmake_root(MEM_ROOT *root,const char *str,uint len);
-extern char *memdup_root(MEM_ROOT *root,const char *str,uint len);
+extern char *strmake_root(MEM_ROOT *root,const char *str,size_t len);
+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);
@@ -822,23 +830,28 @@ extern int my_search_option_files(const char *conf_file, int *argc,
extern void free_defaults(char **argv);
extern void my_print_default_files(const char *conf_file);
extern void print_defaults(const char *conf_file, const char **groups);
-extern my_bool my_compress(byte *, ulong *, ulong *);
-extern my_bool my_uncompress(byte *, ulong *, ulong *);
-extern byte *my_compress_alloc(const byte *packet, ulong *len, ulong *complen);
-extern int packfrm(const void *, uint, const void **, uint *);
-extern int unpackfrm(const void **, uint *, const void *);
-
-extern ha_checksum my_checksum(ha_checksum crc, const byte *mem, uint count);
+extern my_bool my_compress(uchar *, size_t *, size_t *);
+extern my_bool my_uncompress(uchar *, size_t , size_t *);
+extern uchar *my_compress_alloc(const uchar *packet, size_t *len,
+ size_t *complen);
+extern int packfrm(uchar *, size_t, uchar **, size_t *);
+extern int unpackfrm(uchar **, size_t *, const uchar *);
+
+extern ha_checksum my_checksum(ha_checksum crc, const uchar *mem,
+ size_t count);
extern uint my_bit_log2(ulong value);
extern uint32 my_round_up_to_next_power(uint32 v);
extern uint my_count_bits(ulonglong v);
extern uint my_count_bits_ushort(ushort v);
extern void my_sleep(ulong m_seconds);
-extern ulong crc32(ulong crc, const uchar *buf, uint len);
extern uint my_set_max_open_files(uint files);
void my_free_open_file_info(void);
+extern time_t my_time(myf flags);
extern ulonglong my_getsystime(void);
+extern ulonglong my_micro_time();
+extern ulonglong my_micro_time_and_time(time_t *time_arg);
+time_t my_time_possible_from_micro(ulonglong microtime);
extern my_bool my_gethwaddr(uchar *to);
extern int my_getncpus();
@@ -896,22 +909,30 @@ extern CHARSET_INFO *get_charset(uint cs_number, myf flags);
extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags);
extern CHARSET_INFO *get_charset_by_csname(const char *cs_name,
uint cs_flags, myf my_flags);
+
+extern bool resolve_charset(const char *cs_name,
+ CHARSET_INFO *default_cs,
+ CHARSET_INFO **cs);
+extern bool resolve_collation(const char *cl_name,
+ CHARSET_INFO *default_cl,
+ CHARSET_INFO **cl);
+
extern void free_charsets(void);
extern char *get_charsets_dir(char *buf);
extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2);
extern my_bool init_compiled_charsets(myf flags);
extern void add_compiled_collation(CHARSET_INFO *cs);
-extern ulong escape_string_for_mysql(CHARSET_INFO *charset_info,
- char *to, ulong to_length,
- const char *from, ulong length);
+extern size_t escape_string_for_mysql(CHARSET_INFO *charset_info,
+ char *to, size_t to_length,
+ const char *from, size_t length);
#ifdef __WIN__
#define BACKSLASH_MBTAIL
/* File system character set */
extern CHARSET_INFO *fs_character_set(void);
#endif
-extern ulong escape_quotes_for_mysql(CHARSET_INFO *charset_info,
- char *to, ulong to_length,
- const char *from, ulong length);
+extern size_t escape_quotes_for_mysql(CHARSET_INFO *charset_info,
+ char *to, size_t to_length,
+ const char *from, size_t length);
extern void thd_increment_bytes_sent(ulong length);
extern void thd_increment_bytes_received(ulong length);
@@ -928,7 +949,7 @@ int my_security_attr_create(SECURITY_ATTRIBUTES **psa, const char **perror,
void my_security_attr_free(SECURITY_ATTRIBUTES *sa);
/* implemented in my_conio.c */
-char* my_cgets(char *string, unsigned long clen, unsigned long* plen);
+char* my_cgets(char *string, size_t clen, size_t* plen);
#endif
#ifdef __NETWARE__
diff --git a/include/my_tree.h b/include/my_tree.h
index 380fc1c9b26..24bbdd54019 100644
--- a/include/my_tree.h
+++ b/include/my_tree.h
@@ -25,10 +25,10 @@ extern "C" {
#define MAX_TREE_HEIGHT 64
#define ELEMENT_KEY(tree,element)\
-(tree->offset_to_key ? (void*)((byte*) element+tree->offset_to_key) :\
+(tree->offset_to_key ? (void*)((uchar*) element+tree->offset_to_key) :\
*((void**) (element+1)))
-#define tree_set_pointer(element,ptr) *((byte **) (element+1))=((byte*) (ptr))
+#define tree_set_pointer(element,ptr) *((uchar **) (element+1))=((uchar*) (ptr))
#define TREE_NO_DUPS 1
diff --git a/include/my_trie.h b/include/my_trie.h
index 264a2595c52..72dd485af04 100644
--- a/include/my_trie.h
+++ b/include/my_trie.h
@@ -22,7 +22,7 @@ extern "C" {
typedef struct st_trie_node
{
uint16 leaf; /* Depth from root node if match, 0 else */
- byte c; /* Label on this edge */
+ uchar c; /* Label on this edge */
struct st_trie_node *next; /* Next label */
struct st_trie_node *links; /* Array of edges leaving this node */
struct st_trie_node *fail; /* AC failure function */
@@ -45,14 +45,14 @@ typedef struct st_ac_trie_state
extern TRIE *trie_init (TRIE *trie, CHARSET_INFO *charset);
extern void trie_free (TRIE *trie);
-extern my_bool trie_insert (TRIE *trie, const byte *key, uint keylen);
+extern my_bool trie_insert (TRIE *trie, const uchar *key, uint keylen);
extern my_bool ac_trie_prepare (TRIE *trie);
extern void ac_trie_init (TRIE *trie, AC_TRIE_STATE *state);
/* `trie_goto' is internal function and shouldn't be used. */
-static inline TRIE_NODE *trie_goto (TRIE_NODE *root, TRIE_NODE *node, byte c)
+static inline TRIE_NODE *trie_goto (TRIE_NODE *root, TRIE_NODE *node, uchar c)
{
TRIE_NODE *next;
DBUG_ENTER("trie_goto");
@@ -67,7 +67,7 @@ static inline TRIE_NODE *trie_goto (TRIE_NODE *root, TRIE_NODE *node, byte c)
/*
SYNOPSIS
- int ac_trie_next (AC_TRIE_STATE *state, byte *c);
+ int ac_trie_next (AC_TRIE_STATE *state, uchar *c);
state - valid pointer to `AC_TRIE_STATE'
c - character to lookup
@@ -79,7 +79,7 @@ static inline TRIE_NODE *trie_goto (TRIE_NODE *root, TRIE_NODE *node, byte c)
`ac_trie_next' returns length of matched word or 0.
*/
-static inline int ac_trie_next (AC_TRIE_STATE *state, byte *c)
+static inline int ac_trie_next (AC_TRIE_STATE *state, uchar *c)
{
TRIE_NODE *root, *node;
DBUG_ENTER("ac_trie_next");
@@ -94,7 +94,7 @@ static inline int ac_trie_next (AC_TRIE_STATE *state, byte *c)
/*
SYNOPSIS
- my_bool trie_search (TRIE *trie, const byte *key, uint keylen);
+ my_bool trie_search (TRIE *trie, const uchar *key, uint keylen);
trie - valid pointer to `TRIE'
key - valid pointer to key to insert
keylen - non-0 key length
@@ -113,7 +113,7 @@ static inline int ac_trie_next (AC_TRIE_STATE *state, byte *c)
consecutive loop better (tested)
*/
-static inline my_bool trie_search (TRIE *trie, const byte *key, uint keylen)
+static inline my_bool trie_search (TRIE *trie, const uchar *key, uint keylen)
{
TRIE_NODE *node;
uint k;
@@ -123,7 +123,7 @@ static inline my_bool trie_search (TRIE *trie, const byte *key, uint keylen)
for (k= 0; k < keylen; k++)
{
- byte p;
+ uchar p;
if (! (node= node->links))
DBUG_RETURN(FALSE);
p= key[k];
diff --git a/include/my_user.h b/include/my_user.h
index 0c86d0f90f6..44eebf1551d 100644
--- a/include/my_user.h
+++ b/include/my_user.h
@@ -25,9 +25,9 @@
C_MODE_START
-void parse_user(const char *user_id_str, uint user_id_len,
- char *user_name_str, uint *user_name_len,
- char *host_name_str, uint *host_name_len);
+void parse_user(const char *user_id_str, size_t user_id_len,
+ char *user_name_str, size_t *user_name_len,
+ char *host_name_str, size_t *host_name_len);
C_MODE_END
diff --git a/include/my_vle.h b/include/my_vle.h
index 21db8eeb6e1..c09f82229c4 100644
--- a/include/my_vle.h
+++ b/include/my_vle.h
@@ -28,8 +28,8 @@ extern "C" {
*/
#define my_vle_sizeof(ITEM) (((sizeof(ITEM) * CHAR_BIT) + 6) / 7)
-byte *my_vle_encode(byte *vle, my_size_t max, ulong value);
-byte const *my_vle_decode(ulong *value_ptr, byte const *vle);
+uchar *my_vle_encode(uchar *vle, size_t max, ulong value);
+uchar const *my_vle_decode(ulong *value_ptr, uchar const *vle);
#ifdef __cplusplus
}
diff --git a/include/my_xml.h b/include/my_xml.h
index 114805c7cc0..6a453ee90be 100644
--- a/include/my_xml.h
+++ b/include/my_xml.h
@@ -57,27 +57,27 @@ typedef struct xml_stack_st
const char *cur;
const char *end;
void *user_data;
- int (*enter)(struct xml_stack_st *st,const char *val, uint len);
- int (*value)(struct xml_stack_st *st,const char *val, uint len);
- int (*leave_xml)(struct xml_stack_st *st,const char *val, uint len);
+ int (*enter)(struct xml_stack_st *st,const char *val, size_t len);
+ int (*value)(struct xml_stack_st *st,const char *val, size_t len);
+ int (*leave_xml)(struct xml_stack_st *st,const char *val, size_t len);
} MY_XML_PARSER;
void my_xml_parser_create(MY_XML_PARSER *st);
void my_xml_parser_free(MY_XML_PARSER *st);
-int my_xml_parse(MY_XML_PARSER *st,const char *str, uint len);
+int my_xml_parse(MY_XML_PARSER *st,const char *str, size_t len);
void my_xml_set_value_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *,
const char *,
- uint len));
+ size_t len));
void my_xml_set_enter_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *,
const char *,
- uint len));
+ size_t len));
void my_xml_set_leave_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *,
const char *,
- uint len));
+ size_t len));
void my_xml_set_user_data(MY_XML_PARSER *st, void *);
-uint my_xml_error_pos(MY_XML_PARSER *st);
+size_t my_xml_error_pos(MY_XML_PARSER *st);
uint my_xml_error_lineno(MY_XML_PARSER *st);
const char *my_xml_error_string(MY_XML_PARSER *st);
diff --git a/include/myisam.h b/include/myisam.h
index b05440e5ae4..6a76a298dee 100644
--- a/include/myisam.h
+++ b/include/myisam.h
@@ -227,7 +227,7 @@ typedef struct st_mi_decode_tree /* Decode huff-table */
{
uint16 *table;
uint quick_table_bits;
- byte *intervalls;
+ uchar *intervalls;
} MI_DECODE_TREE;
@@ -259,7 +259,7 @@ typedef struct st_columndef /* column information */
/* invalidator function reference for Query Cache */
typedef void (* invalidator_by_filename)(const char * filename);
-extern my_string myisam_log_filename; /* Name of logfile */
+extern char * myisam_log_filename; /* Name of logfile */
extern ulong myisam_block_size;
extern ulong myisam_concurrent_insert;
extern my_bool myisam_flush,myisam_delay_key_write,myisam_single_user;
@@ -269,26 +269,26 @@ extern ulong myisam_bulk_insert_tree_size, myisam_data_pointer_size;
/* Prototypes for myisam-functions */
extern int mi_close(struct st_myisam_info *file);
-extern int mi_delete(struct st_myisam_info *file,const byte *buff);
+extern int mi_delete(struct st_myisam_info *file,const uchar *buff);
extern struct st_myisam_info *mi_open(const char *name,int mode,
uint wait_if_locked);
extern int mi_panic(enum ha_panic_function function);
-extern int mi_rfirst(struct st_myisam_info *file,byte *buf,int inx);
-extern int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key,
+extern int mi_rfirst(struct st_myisam_info *file,uchar *buf,int inx);
+extern int mi_rkey(MI_INFO *info, uchar *buf, int inx, const uchar *key,
key_part_map keypart_map, enum ha_rkey_function search_flag);
-extern int mi_rlast(struct st_myisam_info *file,byte *buf,int inx);
-extern int mi_rnext(struct st_myisam_info *file,byte *buf,int inx);
-extern int mi_rnext_same(struct st_myisam_info *info, byte *buf);
-extern int mi_rprev(struct st_myisam_info *file,byte *buf,int inx);
-extern int mi_rrnd(struct st_myisam_info *file,byte *buf, my_off_t pos);
+extern int mi_rlast(struct st_myisam_info *file,uchar *buf,int inx);
+extern int mi_rnext(struct st_myisam_info *file,uchar *buf,int inx);
+extern int mi_rnext_same(struct st_myisam_info *info, uchar *buf);
+extern int mi_rprev(struct st_myisam_info *file,uchar *buf,int inx);
+extern int mi_rrnd(struct st_myisam_info *file,uchar *buf, my_off_t pos);
extern int mi_scan_init(struct st_myisam_info *file);
-extern int mi_scan(struct st_myisam_info *file,byte *buf);
-extern int mi_rsame(struct st_myisam_info *file,byte *record,int inx);
-extern int mi_rsame_with_pos(struct st_myisam_info *file,byte *record,
+extern int mi_scan(struct st_myisam_info *file,uchar *buf);
+extern int mi_rsame(struct st_myisam_info *file,uchar *record,int inx);
+extern int mi_rsame_with_pos(struct st_myisam_info *file,uchar *record,
int inx, my_off_t pos);
-extern int mi_update(struct st_myisam_info *file,const byte *old,
- byte *new_record);
-extern int mi_write(struct st_myisam_info *file,byte *buff);
+extern int mi_update(struct st_myisam_info *file,const uchar *old,
+ uchar *new_record);
+extern int mi_write(struct st_myisam_info *file,uchar *buff);
extern my_off_t mi_position(struct st_myisam_info *file);
extern int mi_status(struct st_myisam_info *info, MI_ISAMINFO *x, uint flag);
extern int mi_lock_database(struct st_myisam_info *file,int lock_type);
@@ -307,7 +307,7 @@ extern ha_rows mi_records_in_range(MI_INFO *info, int inx,
extern int mi_log(int activate_log);
extern int mi_is_changed(struct st_myisam_info *info);
extern int mi_delete_all_rows(struct st_myisam_info *info);
-extern ulong _mi_calc_blob_length(uint length , const byte *pos);
+extern ulong _mi_calc_blob_length(uint length , const uchar *pos);
extern uint mi_get_pointer_length(ulonglong file_length, uint def);
/* this is used to pass to mysql_myisamchk_table -- by Sasha Pachev */
@@ -455,7 +455,7 @@ typedef struct st_sort_info
enum data_file_type new_data_file_type;
MI_INFO *info;
MI_CHECK *param;
- char *buff;
+ uchar *buff;
SORT_KEY_BLOCKS *key_block,*key_block_end;
SORT_FT_BUF *ft_buf;
/* sync things */
@@ -474,8 +474,8 @@ int chk_size(MI_CHECK *param, MI_INFO *info);
int chk_key(MI_CHECK *param, MI_INFO *info);
int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend);
int mi_repair(MI_CHECK *param, register MI_INFO *info,
- my_string name, int rep_quick);
-int mi_sort_index(MI_CHECK *param, register MI_INFO *info, my_string name);
+ char * name, int rep_quick);
+int mi_sort_index(MI_CHECK *param, register MI_INFO *info, char * name);
int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
const char * name, int rep_quick);
int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
@@ -494,7 +494,7 @@ void update_key_parts(MI_KEYDEF *keyinfo, ulong *rec_per_key_part,
ulonglong records);
int filecopy(MI_CHECK *param, File to,File from,my_off_t start,
my_off_t length, const char *type);
-int movepoint(MI_INFO *info,byte *record,my_off_t oldpos,
+int movepoint(MI_INFO *info,uchar *record,my_off_t oldpos,
my_off_t newpos, uint prot_key);
int write_data_suffix(SORT_INFO *sort_info, my_bool fix_datafile);
int test_if_almost_full(MI_INFO *info);
diff --git a/include/myisammrg.h b/include/myisammrg.h
index 02e81cf806d..eed50bebaee 100644
--- a/include/myisammrg.h
+++ b/include/myisammrg.h
@@ -78,20 +78,20 @@ typedef struct st_myrg_info
/* Prototypes for merge-functions */
extern int myrg_close(MYRG_INFO *file);
-extern int myrg_delete(MYRG_INFO *file,const byte *buff);
+extern int myrg_delete(MYRG_INFO *file,const uchar *buff);
extern MYRG_INFO *myrg_open(const char *name,int mode,int wait_if_locked);
extern int myrg_panic(enum ha_panic_function function);
-extern int myrg_rfirst(MYRG_INFO *file,byte *buf,int inx);
-extern int myrg_rlast(MYRG_INFO *file,byte *buf,int inx);
-extern int myrg_rnext(MYRG_INFO *file,byte *buf,int inx);
-extern int myrg_rprev(MYRG_INFO *file,byte *buf,int inx);
-extern int myrg_rnext_same(MYRG_INFO *file,byte *buf);
-extern int myrg_rkey(MYRG_INFO *info,byte *buf,int inx, const byte *key,
+extern int myrg_rfirst(MYRG_INFO *file,uchar *buf,int inx);
+extern int myrg_rlast(MYRG_INFO *file,uchar *buf,int inx);
+extern int myrg_rnext(MYRG_INFO *file,uchar *buf,int inx);
+extern int myrg_rprev(MYRG_INFO *file,uchar *buf,int inx);
+extern int myrg_rnext_same(MYRG_INFO *file,uchar *buf);
+extern int myrg_rkey(MYRG_INFO *info,uchar *buf,int inx, const uchar *key,
key_part_map keypart_map, enum ha_rkey_function search_flag);
-extern int myrg_rrnd(MYRG_INFO *file,byte *buf,ulonglong pos);
-extern int myrg_rsame(MYRG_INFO *file,byte *record,int inx);
-extern int myrg_update(MYRG_INFO *file,const byte *old,byte *new_rec);
-extern int myrg_write(MYRG_INFO *info,byte *rec);
+extern int myrg_rrnd(MYRG_INFO *file,uchar *buf,ulonglong pos);
+extern int myrg_rsame(MYRG_INFO *file,uchar *record,int inx);
+extern int myrg_update(MYRG_INFO *file,const uchar *old,uchar *new_rec);
+extern int myrg_write(MYRG_INFO *info,uchar *rec);
extern int myrg_status(MYRG_INFO *file,MYMERGE_INFO *x,int flag);
extern int myrg_lock_database(MYRG_INFO *file,int lock_type);
extern int myrg_create(const char *name, const char **table_names,
diff --git a/include/mysql.h b/include/mysql.h
index 33bdf80ef73..68cce3196a0 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -27,6 +27,10 @@
#ifndef _mysql_h
#define _mysql_h
+#ifdef _AIX /* large-file support will break without this */
+#include <standards.h>
+#endif
+
#ifdef __CYGWIN__ /* CYGWIN implements a UNIX API */
#undef WIN
#undef _WIN
@@ -53,7 +57,6 @@ typedef char my_bool;
#else
#define STDCALL __stdcall
#endif
-typedef char * gptr;
#ifndef my_socket_defined
#ifdef __WIN__
@@ -67,7 +70,6 @@ typedef int my_socket;
#include "mysql_version.h"
#include "mysql_com.h"
#include "mysql_time.h"
-#include "typelib.h"
#include "my_list.h" /* for LISTs used in 'MYSQL' and 'MYSQL_STMT' */
@@ -111,6 +113,7 @@ typedef struct st_mysql_field {
unsigned int decimals; /* Number of decimals in field */
unsigned int charsetnr; /* Character set */
enum enum_field_types type; /* Type of field. See mysql_com.h for types */
+ void *extension;
} MYSQL_FIELD;
typedef char **MYSQL_ROW; /* return data as array of strings */
@@ -126,6 +129,8 @@ typedef unsigned long long my_ulonglong;
#endif
#endif
+#include "typelib.h"
+
#define MYSQL_COUNT_ERROR (~(my_ulonglong) 0)
/* backward compatibility define - to be removed eventually */
@@ -143,12 +148,13 @@ typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; /* offset to current row */
typedef struct embedded_query_result EMBEDDED_QUERY_RESULT;
typedef struct st_mysql_data {
- my_ulonglong rows;
- unsigned int fields;
MYSQL_ROWS *data;
+ struct embedded_query_result *embedded_info;
MEM_ROOT alloc;
+ my_ulonglong rows;
+ unsigned int fields;
/* extra info for embedded library */
- struct embedded_query_result *embedded_info;
+ void *extension;
} MYSQL_DATA;
enum mysql_option
@@ -211,6 +217,7 @@ struct st_mysql_options {
void (*local_infile_end)(void *);
int (*local_infile_error)(void *, char *, unsigned int);
void *local_infile_userdata;
+ void *extension;
};
enum mysql_status
@@ -251,9 +258,9 @@ struct st_mysql_stmt;
typedef struct st_mysql
{
NET net; /* Communication parameters */
- gptr connector_fd; /* ConnectorFd for SSL */
- char *host,*user,*passwd,*unix_socket,*server_version,*host_info,*info;
- char *db;
+ unsigned char *connector_fd; /* ConnectorFd for SSL */
+ char *host,*user,*passwd,*unix_socket,*server_version,*host_info;
+ char *info, *db;
struct charset_info_st *charset;
MYSQL_FIELD *fields;
MEM_ROOT field_alloc;
@@ -300,27 +307,28 @@ typedef struct st_mysql
from mysql_stmt_close if close had to cancel result set of this object.
*/
my_bool *unbuffered_fetch_owner;
-#if defined(EMBEDDED_LIBRARY) || defined(EMBEDDED_LIBRARY_COMPATIBLE) || MYSQL_VERSION_ID >= 50100
/* needed for embedded server - no net buffer to store the 'info' */
char *info_buffer;
-#endif
+ void *extension;
} MYSQL;
+
typedef struct st_mysql_res {
- my_ulonglong row_count;
+ my_ulonglong row_count;
MYSQL_FIELD *fields;
MYSQL_DATA *data;
MYSQL_ROWS *data_cursor;
unsigned long *lengths; /* column lengths of current row */
MYSQL *handle; /* for unbuffered reads */
- MEM_ROOT field_alloc;
- unsigned int field_count, current_field;
+ const struct st_mysql_methods *methods;
MYSQL_ROW row; /* If unbuffered read */
MYSQL_ROW current_row; /* buffer to current row */
+ MEM_ROOT field_alloc;
+ unsigned int field_count, current_field;
my_bool eof; /* Used by mysql_fetch_row */
/* mysql_stmt_close() had to cancel this result */
my_bool unbuffered_fetch_cancelled;
- const struct st_mysql_methods *methods;
+ void *extension;
} MYSQL_RES;
#define MAX_MYSQL_MANAGER_ERR 256
@@ -340,21 +348,23 @@ typedef struct st_mysql_res {
typedef struct st_mysql_manager
{
NET net;
- char *host,*user,*passwd;
+ char *host, *user, *passwd;
+ char *net_buf, *net_buf_pos, *net_data_end;
unsigned int port;
- my_bool free_me;
- my_bool eof;
int cmd_status;
int last_errno;
- char* net_buf,*net_buf_pos,*net_data_end;
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;
unsigned long *p_net_buffer_length;
+ void *extension;
} MYSQL_PARAMETERS;
#if !defined(MYSQL_SERVER) && !defined(EMBEDDED_LIBRARY)
@@ -369,6 +379,7 @@ typedef struct st_mysql_parameters
*/
int STDCALL mysql_server_init(int argc, char **argv, char **groups);
void STDCALL mysql_server_end(void);
+
/*
mysql_server_init/end need to be called when using libmysqld or
libmysqlclient (exactly, mysql_server_init() is called by mysql_init() so
@@ -657,23 +668,24 @@ typedef struct st_mysql_bind
void *buffer; /* buffer to get/put data */
/* set this if you want to track data truncations happened during fetch */
my_bool *error;
- enum enum_field_types buffer_type; /* buffer type */
+ unsigned char *row_ptr; /* for the current data position */
+ void (*store_param_func)(NET *net, struct st_mysql_bind *param);
+ void (*fetch_result)(struct st_mysql_bind *, MYSQL_FIELD *,
+ unsigned char **row);
+ void (*skip_result)(struct st_mysql_bind *, MYSQL_FIELD *,
+ unsigned char **row);
/* output buffer length, must be set when fetching str/binary */
unsigned long buffer_length;
- unsigned char *row_ptr; /* for the current data position */
unsigned long offset; /* offset position for char/binary fetch */
unsigned long length_value; /* Used if length is 0 */
unsigned int param_number; /* For null count and error messages */
unsigned int pack_length; /* Internal length for packed data */
+ enum enum_field_types buffer_type; /* buffer type */
my_bool error_value; /* used if error is 0 */
my_bool is_unsigned; /* set if integer type is unsigned */
my_bool long_data_used; /* If used with mysql_send_long_data */
my_bool is_null_value; /* Used if is_null is 0 */
- void (*store_param_func)(NET *net, struct st_mysql_bind *param);
- void (*fetch_result)(struct st_mysql_bind *, MYSQL_FIELD *,
- unsigned char **row);
- void (*skip_result)(struct st_mysql_bind *, MYSQL_FIELD *,
- unsigned char **row);
+ void *extension;
} MYSQL_BIND;
@@ -688,15 +700,15 @@ typedef struct st_mysql_stmt
MYSQL_FIELD *fields; /* result set metadata */
MYSQL_DATA result; /* cached result set */
MYSQL_ROWS *data_cursor; /* current row in cached result */
- /* copy of mysql->affected_rows after statement execution */
- my_ulonglong affected_rows;
- my_ulonglong insert_id; /* copy of mysql->insert_id */
/*
mysql_stmt_fetch() calls this function to fetch one row (it's different
for buffered, unbuffered and cursor fetch).
*/
int (*read_row_func)(struct st_mysql_stmt *stmt,
unsigned char **row);
+ /* copy of mysql->affected_rows after statement execution */
+ my_ulonglong affected_rows;
+ my_ulonglong insert_id; /* copy of mysql->insert_id */
unsigned long stmt_id; /* Id for prepared statement */
unsigned long flags; /* i.e. type of cursor to open */
unsigned long prefetch_rows; /* number of rows per one COM_FETCH */
@@ -722,6 +734,7 @@ typedef struct st_mysql_stmt
metadata fields when doing mysql_stmt_store_result.
*/
my_bool update_max_length;
+ void *extension;
} MYSQL_STMT;
enum enum_stmt_attr_type
@@ -752,9 +765,9 @@ typedef struct st_mysql_methods
my_bool (*read_query_result)(MYSQL *mysql);
my_bool (*advanced_command)(MYSQL *mysql,
enum enum_server_command command,
- const char *header,
+ const unsigned char *header,
unsigned long header_length,
- const char *arg,
+ const unsigned char *arg,
unsigned long arg_length,
my_bool skip_check,
MYSQL_STMT *stmt);
@@ -847,10 +860,10 @@ int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB);
*/
#define simple_command(mysql, command, arg, length, skip_check) \
- (*(mysql)->methods->advanced_command)(mysql, command, NullS, \
+ (*(mysql)->methods->advanced_command)(mysql, command, 0, \
0, arg, length, skip_check, NULL)
#define stmt_command(mysql, command, arg, length, stmt) \
- (*(mysql)->methods->advanced_command)(mysql, command, NullS, \
+ (*(mysql)->methods->advanced_command)(mysql, command, 0, \
0, arg, length, 1, stmt)
#ifdef __NETWARE__
diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h
index 660ce49d7ee..50ec051d111 100644
--- a/include/mysql/plugin.h
+++ b/include/mysql/plugin.h
@@ -16,6 +16,41 @@
#ifndef _my_plugin_h
#define _my_plugin_h
+#ifdef __cplusplus
+class THD;
+class Item;
+#define MYSQL_THD THD*
+#else
+#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;
+
+#define MYSQL_XIDDATASIZE 128
+/**
+ struct st_mysql_xid is binary compatible with the XID structure as
+ in the X/Open CAE Specification, Distributed Transaction Processing:
+ The XA Specification, X/Open Company Ltd., 1991.
+ http://www.opengroup.org/bookstore/catalog/c193.htm
+
+ @see XID in sql/handler.h
+*/
+struct st_mysql_xid {
+ long formatID;
+ long gtrid_length;
+ long bqual_length;
+ char data[MYSQL_XIDDATASIZE]; /* Not \0-terminated */
+};
+typedef struct st_mysql_xid MYSQL_XID;
+
/*************************************************************************
Plugin API. Common for all plugin types.
*/
@@ -75,7 +110,7 @@ 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_ARRAY, SHOW_FUNC, SHOW_DOUBLE
};
struct st_mysql_show_var {
@@ -85,7 +120,262 @@ struct st_mysql_show_var {
};
#define SHOW_VAR_FUNC_BUFF_SIZE 1024
-typedef int (*mysql_show_var_func)(void *, struct st_mysql_show_var*, char *);
+typedef int (*mysql_show_var_func)(MYSQL_THD, struct st_mysql_show_var*, char *);
+
+
+/*
+ declarations for server variables and command line options
+*/
+
+
+#define PLUGIN_VAR_BOOL 0x0001
+#define PLUGIN_VAR_INT 0x0002
+#define PLUGIN_VAR_LONG 0x0003
+#define PLUGIN_VAR_LONGLONG 0x0004
+#define PLUGIN_VAR_STR 0x0005
+#define PLUGIN_VAR_ENUM 0x0006
+#define PLUGIN_VAR_SET 0x0007
+#define PLUGIN_VAR_UNSIGNED 0x0080
+#define PLUGIN_VAR_THDLOCAL 0x0100 /* Variable is per-connection */
+#define PLUGIN_VAR_READONLY 0x0200 /* Server variable is read only */
+#define PLUGIN_VAR_NOSYSVAR 0x0400 /* Not a server variable */
+#define PLUGIN_VAR_NOCMDOPT 0x0800 /* Not a command line option */
+#define PLUGIN_VAR_NOCMDARG 0x1000 /* No argument for cmd line */
+#define PLUGIN_VAR_RQCMDARG 0x0000 /* Argument required for cmd line */
+#define PLUGIN_VAR_OPCMDARG 0x2000 /* Argument optional for cmd line */
+#define PLUGIN_VAR_MEMALLOC 0x8000 /* String needs memory allocated */
+
+struct st_mysql_sys_var;
+struct st_mysql_value;
+
+/*
+ SYNOPSIS
+ (*mysql_var_check_func)()
+ thd thread handle
+ var dynamic variable being altered
+ save pointer to temporary storage
+ value user provided value
+ RETURN
+ 0 user provided value is OK and the update func may be called.
+ any other value indicates error.
+
+ This function should parse the user provided value and store in the
+ provided temporary storage any data as required by the update func.
+ There is sufficient space in the temporary storage to store a double.
+ Note that the update func may not be called if any other error occurs
+ so any memory allocated should be thread-local so that it may be freed
+ automatically at the end of the statement.
+*/
+
+typedef int (*mysql_var_check_func)(MYSQL_THD thd,
+ struct st_mysql_sys_var *var,
+ void *save, struct st_mysql_value *value);
+
+/*
+ SYNOPSIS
+ (*mysql_var_update_func)()
+ thd thread handle
+ var dynamic variable being altered
+ var_ptr pointer to dynamic variable
+ save pointer to temporary storage
+ RETURN
+ NONE
+
+ This function should use the validated value stored in the temporary store
+ and persist it in the provided pointer to the dynamic variable.
+ For example, strings may require memory to be allocated.
+*/
+typedef void (*mysql_var_update_func)(MYSQL_THD thd,
+ struct st_mysql_sys_var *var,
+ void *var_ptr, void *save);
+
+
+/* the following declarations are for internal use only */
+
+
+#define PLUGIN_VAR_MASK \
+ (PLUGIN_VAR_READONLY | PLUGIN_VAR_NOSYSVAR | \
+ PLUGIN_VAR_NOCMDOPT | PLUGIN_VAR_NOCMDARG | \
+ PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC)
+
+#define MYSQL_PLUGIN_VAR_HEADER \
+ int flags; \
+ const char *name; \
+ const char *comment; \
+ mysql_var_check_func check; \
+ mysql_var_update_func update
+
+#define MYSQL_SYSVAR_NAME(name) mysql_sysvar_ ## name
+#define MYSQL_SYSVAR(name) \
+ ((struct st_mysql_sys_var *)&(MYSQL_SYSVAR_NAME(name)))
+
+/*
+ for global variables, the value pointer is the first
+ element after the header, the default value is the second.
+ for thread variables, the value offset is the first
+ element after the header, the default value is the second.
+*/
+
+
+#define DECLARE_MYSQL_SYSVAR_BASIC(name, type) struct { \
+ MYSQL_PLUGIN_VAR_HEADER; \
+ type *value; \
+ const type def_val; \
+} MYSQL_SYSVAR_NAME(name)
+
+#define DECLARE_MYSQL_SYSVAR_SIMPLE(name, type) struct { \
+ MYSQL_PLUGIN_VAR_HEADER; \
+ type *value; type def_val; \
+ type min_val; type max_val; \
+ type blk_sz; \
+} MYSQL_SYSVAR_NAME(name)
+
+#define DECLARE_MYSQL_SYSVAR_TYPELIB(name, type) struct { \
+ MYSQL_PLUGIN_VAR_HEADER; \
+ type *value; type def_val; \
+ TYPELIB *typelib; \
+} MYSQL_SYSVAR_NAME(name)
+
+#define DECLARE_THDVAR_FUNC(type) \
+ type *(*resolve)(MYSQL_THD thd, int offset)
+
+#define DECLARE_MYSQL_THDVAR_BASIC(name, type) struct { \
+ MYSQL_PLUGIN_VAR_HEADER; \
+ int offset; \
+ const type def_val; \
+ DECLARE_THDVAR_FUNC(type); \
+} MYSQL_SYSVAR_NAME(name)
+
+#define DECLARE_MYSQL_THDVAR_SIMPLE(name, type) struct { \
+ MYSQL_PLUGIN_VAR_HEADER; \
+ int offset; \
+ type def_val; type min_val; \
+ type max_val; type blk_sz; \
+ DECLARE_THDVAR_FUNC(type); \
+} MYSQL_SYSVAR_NAME(name)
+
+#define DECLARE_MYSQL_THDVAR_TYPELIB(name, type) struct { \
+ MYSQL_PLUGIN_VAR_HEADER; \
+ int offset; \
+ type def_val; \
+ DECLARE_THDVAR_FUNC(type); \
+ TYPELIB *typelib; \
+} MYSQL_SYSVAR_NAME(name)
+
+
+/*
+ the following declarations are for use by plugin implementors
+*/
+
+#define MYSQL_SYSVAR_BOOL(name, varname, opt, comment, check, update, def) \
+DECLARE_MYSQL_SYSVAR_BASIC(name, char) = { \
+ PLUGIN_VAR_BOOL | ((opt) & PLUGIN_VAR_MASK), \
+ #name, comment, check, update, &varname, def}
+
+#define MYSQL_SYSVAR_STR(name, varname, opt, comment, check, update, def) \
+DECLARE_MYSQL_SYSVAR_BASIC(name, char *) = { \
+ PLUGIN_VAR_STR | ((opt) & PLUGIN_VAR_MASK), \
+ #name, comment, check, update, &varname, def}
+
+#define MYSQL_SYSVAR_INT(name, varname, opt, comment, check, update, def, min, max, blk) \
+DECLARE_MYSQL_SYSVAR_SIMPLE(name, int) = { \
+ PLUGIN_VAR_INT | ((opt) & PLUGIN_VAR_MASK), \
+ #name, comment, check, update, &varname, def, min, max, blk }
+
+#define MYSQL_SYSVAR_UINT(name, varname, opt, comment, check, update, def, min, max, blk) \
+DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned int) = { \
+ PLUGIN_VAR_INT | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
+ #name, comment, check, update, &varname, def, min, max, blk }
+
+#define MYSQL_SYSVAR_LONG(name, varname, opt, comment, check, update, def, min, max, blk) \
+DECLARE_MYSQL_SYSVAR_SIMPLE(name, long) = { \
+ PLUGIN_VAR_LONG | ((opt) & PLUGIN_VAR_MASK), \
+ #name, comment, check, update, &varname, def, min, max, blk }
+
+#define MYSQL_SYSVAR_ULONG(name, varname, opt, comment, check, update, def, min, max, blk) \
+DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned long) = { \
+ PLUGIN_VAR_LONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
+ #name, comment, check, update, &varname, def, min, max, blk }
+
+#define MYSQL_SYSVAR_LONGLONG(name, varname, opt, comment, check, update, def, min, max, blk) \
+DECLARE_MYSQL_SYSVAR_SIMPLE(name, long long) = { \
+ PLUGIN_VAR_LONGLONG | ((opt) & PLUGIN_VAR_MASK), \
+ #name, comment, check, update, &varname, def, min, max, blk }
+
+#define MYSQL_SYSVAR_ULONGLONG(name, varname, opt, comment, check, update, def, min, max, blk) \
+DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned long long) = { \
+ PLUGIN_VAR_LONGLONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
+ #name, comment, check, update, &varname, def, min, max, blk }
+
+#define MYSQL_SYSVAR_ENUM(name, varname, opt, comment, check, update, def, typelib) \
+DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long) = { \
+ PLUGIN_VAR_ENUM | ((opt) & PLUGIN_VAR_MASK), \
+ #name, comment, check, update, &varname, def, typelib }
+
+#define MYSQL_SYSVAR_SET(name, varname, opt, comment, check, update, def, typelib) \
+DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long long) = { \
+ PLUGIN_VAR_SET | ((opt) & PLUGIN_VAR_MASK), \
+ #name, comment, check, update, &varname, def, typelib }
+
+#define MYSQL_THDVAR_BOOL(name, opt, comment, check, update, def) \
+DECLARE_MYSQL_THDVAR_BASIC(name, char) = { \
+ PLUGIN_VAR_BOOL | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
+ #name, comment, check, update, -1, def, NULL}
+
+#define MYSQL_THDVAR_STR(name, opt, comment, check, update, def) \
+DECLARE_MYSQL_THDVAR_BASIC(name, char *) = { \
+ PLUGIN_VAR_STR | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
+ #name, comment, check, update, -1, def, NULL}
+
+#define MYSQL_THDVAR_INT(name, opt, comment, check, update, def, min, max, blk) \
+DECLARE_MYSQL_THDVAR_SIMPLE(name, int) = { \
+ PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
+ #name, comment, check, update, -1, def, min, max, blk, NULL }
+
+#define MYSQL_THDVAR_UINT(name, opt, comment, check, update, def, min, max, blk) \
+DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned int) = { \
+ PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
+ #name, comment, check, update, -1, def, min, max, blk, NULL }
+
+#define MYSQL_THDVAR_LONG(name, opt, comment, check, update, def, min, max, blk) \
+DECLARE_MYSQL_THDVAR_SIMPLE(name, long) = { \
+ PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
+ #name, comment, check, update, -1, def, min, max, blk, NULL }
+
+#define MYSQL_THDVAR_ULONG(name, opt, comment, check, update, def, min, max, blk) \
+DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned long) = { \
+ PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
+ #name, comment, check, update, -1, def, min, max, blk, NULL }
+
+#define MYSQL_THDVAR_LONGLONG(name, opt, comment, check, update, def, min, max, blk) \
+DECLARE_MYSQL_THDVAR_SIMPLE(name, long long) = { \
+ PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
+ #name, comment, check, update, -1, def, min, max, blk, NULL }
+
+#define MYSQL_THDVAR_ULONGLONG(name, opt, comment, check, update, def, min, max, blk) \
+DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned long long) = { \
+ PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
+ #name, comment, check, update, -1, def, min, max, blk, NULL }
+
+#define MYSQL_THDVAR_ENUM(name, opt, comment, check, update, def, typelib) \
+DECLARE_MYSQL_THDVAR_TYPELIB(name, unsigned long) = { \
+ PLUGIN_VAR_ENUM | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
+ #name, comment, check, update, -1, def, NULL, typelib }
+
+#define MYSQL_THDVAR_SET(name, opt, comment, check, update, def, typelib) \
+DECLARE_MYSQL_THDVAR_TYPELIB(name, unsigned long long) = { \
+ PLUGIN_VAR_SET | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
+ #name, comment, check, update, -1, def, NULL, typelib }
+
+/* accessor macros */
+
+#define SYSVAR(name) \
+ (*(MYSQL_SYSVAR_NAME(name).value))
+
+/* when thd == null, result points to global value */
+#define THDVAR(thd, name) \
+ (*(MYSQL_SYSVAR_NAME(name).resolve(thd, MYSQL_SYSVAR_NAME(name).offset)))
+
/*
Plugin description structure.
@@ -103,8 +393,8 @@ struct st_mysql_plugin
int (*deinit)(void *);/* the function to invoke when plugin is unloaded */
unsigned int version; /* plugin version (for SHOW PLUGINS) */
struct st_mysql_show_var *status_vars;
- void * __reserved1; /* placeholder for system variables */
- void * __reserved2; /* placeholder for config options */
+ struct st_mysql_sys_var **system_vars;
+ void * __reserved1; /* reserved for dependency checking */
};
/*************************************************************************
@@ -328,6 +618,8 @@ struct st_mysql_storage_engine
int interface_version;
};
+struct handlerton;
+
/*
Here we define only the descriptor structure, that is referred from
st_mysql_plugin.
@@ -348,5 +640,173 @@ struct st_mysql_information_schema
int interface_version;
};
+
+/*
+ st_mysql_value struct for reading values from mysqld.
+ Used by server variables framework to parse user-provided values.
+ Will be used for arguments when implementing UDFs.
+
+ Note that val_str() returns a string in temporary memory
+ that will be freed at the end of statement. Copy the string
+ if you need it to persist.
+*/
+
+#define MYSQL_VALUE_TYPE_STRING 0
+#define MYSQL_VALUE_TYPE_REAL 1
+#define MYSQL_VALUE_TYPE_INT 2
+
+struct st_mysql_value
+{
+ int (*value_type)(struct st_mysql_value *);
+ const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length);
+ int (*val_real)(struct st_mysql_value *, double *realbuf);
+ int (*val_int)(struct st_mysql_value *, long long *intbuf);
+};
+
+
+/*************************************************************************
+ Miscellaneous functions for plugin implementors
+*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int thd_in_lock_tables(const MYSQL_THD thd);
+int thd_tablespace_op(const MYSQL_THD thd);
+long long thd_test_options(const MYSQL_THD thd, long long test_options);
+int thd_sql_command(const MYSQL_THD thd);
+const char *thd_proc_info(MYSQL_THD thd, const char *info);
+void **thd_ha_data(const MYSQL_THD thd, const struct handlerton *hton);
+int thd_tx_isolation(const MYSQL_THD thd);
+char *thd_security_context(MYSQL_THD thd, char *buffer, unsigned int length,
+ unsigned int max_query_len);
+/* Increments the row counter, see THD::row_count */
+void thd_inc_row_count(MYSQL_THD thd);
+
+/**
+ Create a temporary file.
+
+ @details
+ The temporary file is created in a location specified by the mysql
+ server configuration (--tmpdir option). The caller does not need to
+ delete the file, it will be deleted automatically.
+
+ @param prefix prefix for temporary file name
+ @retval -1 error
+ @retval >= 0 a file handle that can be passed to dup or my_close
+*/
+int mysql_tmpfile(const char *prefix);
+
+/**
+ Check the killed state of a connection
+
+ @details
+ In MySQL support for the KILL statement is cooperative. The KILL
+ statement only sets a "killed" flag. This function returns the value
+ of that flag. A thread should check it often, especially inside
+ time-consuming loops, and gracefully abort the operation if it is
+ non-zero.
+
+ @param thd user thread connection handle
+ @retval 0 the connection is active
+ @retval 1 the connection has been killed
+*/
+int thd_killed(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
+
+ @param thd user thread connection handle
+ @param xid location where identifier is stored
+*/
+void thd_get_xid(const MYSQL_THD thd, MYSQL_XID *xid);
+
+/**
+ Invalidate the query cache for a given table.
+
+ @param thd user thread connection handle
+ @param key databasename\\0tablename\\0
+ @param key_length length of key in bytes, including the NUL bytes
+ @param using_trx flag: TRUE if using transactions, FALSE otherwise
+*/
+void mysql_query_cache_invalidate4(MYSQL_THD thd,
+ const char *key, unsigned int key_length,
+ int using_trx);
+
+#ifdef __cplusplus
+}
+#endif
+
+#ifdef __cplusplus
+/**
+ Provide a handler data getter to simplify coding
+*/
+inline
+void *
+thd_get_ha_data(const MYSQL_THD thd, const struct handlerton *hton)
+{
+ return *thd_ha_data(thd, hton);
+}
+
+/**
+ Provide a handler data setter to simplify coding
+*/
+inline
+void
+thd_set_ha_data(const MYSQL_THD thd, const struct handlerton *hton,
+ const void *ha_data)
+{
+ *thd_ha_data(thd, hton)= (void*) ha_data;
+}
+#endif
+
#endif
diff --git a/include/mysql_com.h b/include/mysql_com.h
index 2223dbad6ab..5850d48fbf5 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -186,25 +186,25 @@ typedef struct st_vio Vio;
typedef struct st_net {
#if !defined(CHECK_EMBEDDED_DIFFERENCES) || !defined(EMBEDDED_LIBRARY)
- Vio* vio;
+ Vio *vio;
unsigned char *buff,*buff_end,*write_pos,*read_pos;
my_socket fd; /* For Perl DBI/dbd */
- unsigned long max_packet,max_packet_size;
- unsigned int pkt_nr,compress_pkt_nr;
- unsigned int write_timeout, read_timeout, retry_count;
- int fcntl;
- my_bool compress;
/*
The following variable is set if we are doing several queries in one
command ( as in LOAD TABLE ... FROM MASTER ),
and do not want to confuse the client with OK at the wrong time
*/
unsigned long remain_in_buf,length, buf_length, where_b;
+ unsigned long max_packet,max_packet_size;
+ unsigned int pkt_nr,compress_pkt_nr;
+ unsigned int write_timeout, read_timeout, retry_count;
+ int fcntl;
unsigned int *return_status;
unsigned char reading_or_writing;
char save_char;
my_bool no_send_ok; /* For SPs and other things that do multiple stmts */
my_bool no_send_eof; /* For SPs' first version read-only cursors */
+ my_bool compress;
/*
Set if OK packet is already sent, and we do not need to send error
messages
@@ -215,20 +215,20 @@ typedef struct st_net {
queries in cache that have not stored its results yet
*/
#endif
- char last_error[MYSQL_ERRMSG_SIZE], sqlstate[SQLSTATE_LENGTH+1];
- unsigned int last_errno;
- unsigned char error;
-
/*
'query_cache_query' should be accessed only via query cache
functions and methods to maintain proper locking.
*/
- gptr query_cache_query;
-
+ unsigned char *query_cache_query;
+ unsigned int last_errno;
+ unsigned char error;
my_bool report_error; /* We should report error (we have unreported error) */
my_bool return_errno;
+ char last_error[MYSQL_ERRMSG_SIZE], sqlstate[SQLSTATE_LENGTH+1];
+ void *extension;
} NET;
+
#define packet_error (~(unsigned long) 0)
enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY,
@@ -344,15 +344,20 @@ my_bool my_net_init(NET *net, Vio* vio);
void my_net_local_init(NET *net);
void net_end(NET *net);
void net_clear(NET *net, my_bool clear_buffer);
-my_bool net_realloc(NET *net, unsigned long length);
+my_bool net_realloc(NET *net, size_t length);
my_bool net_flush(NET *net);
-my_bool my_net_write(NET *net,const char *packet,unsigned long len);
+my_bool my_net_write(NET *net,const unsigned char *packet, size_t len);
my_bool net_write_command(NET *net,unsigned char command,
- const char *header, unsigned long head_len,
- const char *packet, unsigned long len);
-int net_real_write(NET *net,const char *packet,unsigned long len);
+ const unsigned char *header, size_t head_len,
+ const unsigned char *packet, size_t len);
+int net_real_write(NET *net,const unsigned char *packet, size_t len);
unsigned long my_net_read(NET *net);
+#ifdef _global_h
+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
@@ -384,6 +389,7 @@ typedef struct st_udf_args
char *maybe_null; /* Set to 1 for all maybe_null args */
char **attributes; /* Pointer to attribute name */
unsigned long *attribute_lengths; /* Length of attribute arguments */
+ void *extension;
} UDF_ARGS;
/* This holds information about the result */
@@ -394,7 +400,9 @@ typedef struct st_udf_init
unsigned int decimals; /* for real functions */
unsigned long max_length; /* For string functions */
char *ptr; /* free pointer for function data */
- my_bool const_item; /* 0 if result is independent of arguments */
+ /* 0 if result is independent of arguments */
+ my_bool const_item;
+ void *extension;
} UDF_INIT;
/* Constants when using compression */
@@ -446,7 +454,7 @@ void my_thread_end(void);
#ifdef _global_h
ulong STDCALL net_field_length(uchar **packet);
my_ulonglong net_field_length_ll(uchar **packet);
-char *net_store_length(char *pkg, ulonglong length);
+uchar *net_store_length(uchar *pkg, ulonglong length);
#endif
#ifdef __cplusplus
diff --git a/include/mysql_h.ic b/include/mysql_h.ic
index 7d16a886fd8..8b1c36fdaab 100644
--- a/include/mysql_h.ic
+++ b/include/mysql_h.ic
@@ -4,16 +4,27 @@ struct st_list;
struct st_mem_root;
struct st_mysql;
struct st_mysql_bind;
+struct st_mysql_daemon;
struct st_mysql_data;
struct st_mysql_field;
+struct st_mysql_ftparser;
+struct st_mysql_ftparser_boolean_info;
+struct st_mysql_ftparser_param;
+struct st_mysql_information_schema;
+struct st_mysql_lex_string;
struct st_mysql_manager;
struct st_mysql_methods;
struct st_mysql_options;
struct st_mysql_parameters;
+struct st_mysql_plugin;
struct st_mysql_res;
struct st_mysql_rows;
+struct st_mysql_show_var;
struct st_mysql_stmt;
+struct st_mysql_storage_engine;
struct st_mysql_time;
+struct st_mysql_value;
+struct st_mysql_xid;
struct st_net;
struct st_typelib;
struct st_udf_args;
@@ -22,7 +33,10 @@ struct st_used_mem;
enum Item_result;
enum enum_cursor_type;
enum enum_field_types;
+enum enum_ft_token_type;
+enum enum_ftparser_mode;
enum enum_mysql_set_option;
+enum enum_mysql_show_type;
enum enum_mysql_stmt_state;
enum enum_mysql_timestamp_type;
enum enum_server_command;
@@ -32,65 +46,79 @@ enum mysql_option;
enum mysql_protocol_type;
enum mysql_rpl_type;
enum mysql_status;
-# 134 "mysql.h"
+# 139 "mysql.h"
typedef struct st_mysql_rows MYSQL_ROWS;
-# 24 "my_list.h"
+# 23 "my_list.h"
typedef struct st_list LIST;
-# 35 "my_alloc.h"
+# 34 "my_alloc.h"
typedef struct st_mem_root MEM_ROOT;
-# 251 "mysql.h"
+# 258 "mysql.h"
typedef struct st_mysql MYSQL;
-# 653 "mysql.h"
+# 664 "mysql.h"
typedef struct st_mysql_bind MYSQL_BIND;
-# 93 "mysql.h"
+# 95 "mysql.h"
typedef struct st_mysql_field MYSQL_FIELD;
-# 117 "mysql.h"
+# 120 "mysql.h"
typedef unsigned int MYSQL_FIELD_OFFSET;
-# 340 "mysql.h"
+# 35 "mysql/plugin.h"
+typedef struct st_mysql_lex_string MYSQL_LEX_STRING;
+# 348 "mysql.h"
typedef struct st_mysql_manager MYSQL_MANAGER;
-# 354 "mysql.h"
+# 363 "mysql.h"
typedef struct st_mysql_parameters MYSQL_PARAMETERS;
-# 309 "mysql.h"
+# 316 "mysql.h"
typedef struct st_mysql_res MYSQL_RES;
-# 116 "mysql.h"
+# 119 "mysql.h"
typedef char * * MYSQL_ROW;
-# 140 "mysql.h"
+# 145 "mysql.h"
typedef MYSQL_ROWS * MYSQL_ROW_OFFSET;
-# 681 "mysql.h"
+# 693 "mysql.h"
typedef struct st_mysql_stmt MYSQL_STMT;
-# 236 "mysql.h"
+# 52 "mysql/plugin.h"
+typedef struct st_mysql_xid MYSQL_XID;
+# 243 "mysql.h"
typedef struct character_set MY_CHARSET_INFO;
-# 184 "mysql_com.h"
+# 187 "mysql_com.h"
typedef struct st_net NET;
-# 23 "typelib.h"
+# 22 "typelib.h"
typedef struct st_typelib TYPELIB;
-# 174 "mysql_com.h"
+# 177 "mysql_com.h"
typedef struct st_vio Vio;
-# 57 "mysql.h"
-typedef char * gptr;
-# 29 "my_list.h"
+# 28 "my_list.h"
typedef int (* list_walk_action)(void *, void *);
-# 48 "mysql.h"
+# 51 "mysql.h"
typedef char my_bool;
-# 63 "mysql.h"
+# 65 "mysql.h"
typedef int my_socket;
-# 125 "mysql.h"
+# 128 "mysql.h"
typedef unsigned long long int my_ulonglong;
-# 144 "mysql.h"
+# 214 "/usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h"
+typedef unsigned int size_t;
+# 149 "mysql.h"
typedef struct embedded_query_result EMBEDDED_QUERY_RESULT;
-# 145 "mysql.h"
+# 150 "mysql.h"
typedef struct st_mysql_data MYSQL_DATA;
-# 750 "mysql.h"
+# 495 "mysql/plugin.h"
+typedef struct st_mysql_ftparser_boolean_info MYSQL_FTPARSER_BOOLEAN_INFO;
+# 557 "mysql/plugin.h"
+typedef struct st_mysql_ftparser_param MYSQL_FTPARSER_PARAM;
+# 763 "mysql.h"
typedef struct st_mysql_methods MYSQL_METHODS;
-# 48 "mysql_time.h"
+# 47 "mysql_time.h"
typedef struct st_mysql_time MYSQL_TIME;
-# 375 "mysql_com.h"
+# 383 "mysql_com.h"
typedef struct st_udf_args UDF_ARGS;
-# 388 "mysql_com.h"
+# 397 "mysql_com.h"
typedef struct st_udf_init UDF_INIT;
-# 27 "my_alloc.h"
+# 26 "my_alloc.h"
typedef struct st_used_mem USED_MEM;
-# 236 "mysql.h"
+# 123 "mysql/plugin.h"
+typedef int (* mysql_show_var_func)(void *, struct st_mysql_show_var *, char *);
+# 170 "mysql/plugin.h"
+typedef int (* mysql_var_check_func)(void * thd, struct st_mysql_sys_var * var, void * save, struct st_mysql_value * value);
+# 188 "mysql/plugin.h"
+typedef void (* mysql_var_update_func)(void * thd, struct st_mysql_sys_var * var, void * var_ptr, void * save);
+# 243 "mysql.h"
struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(void *)))) character_set
{
unsigned int number;
@@ -102,7 +130,7 @@ struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(vo
unsigned int mbminlen;
unsigned int mbmaxlen;
};
-# 361 "mysql_com.h"
+# 369 "mysql_com.h"
struct __attribute__((aligned(__alignof__(unsigned long int)), aligned(__alignof__(double)))) rand_struct
{
unsigned long int seed1;
@@ -110,30 +138,30 @@ struct __attribute__((aligned(__alignof__(unsigned long int)), aligned(__alignof
unsigned long int max_value;
double max_value_dbl;
};
-# 24 "my_list.h"
+# 23 "my_list.h"
struct __attribute__((aligned(__alignof__(void *)))) st_list
{
struct st_list * prev;
struct st_list * next;
void * data;
};
-# 35 "my_alloc.h"
+# 34 "my_alloc.h"
struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned int)))) st_mem_root
{
USED_MEM * free;
USED_MEM * used;
USED_MEM * pre_alloc;
- unsigned int min_malloc;
- unsigned int block_size;
+ size_t min_malloc;
+ size_t block_size;
unsigned int block_num;
unsigned int first_block_usage;
void (* error_handler)(void);
};
-# 251 "mysql.h"
+# 258 "mysql.h"
struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long long int)))) st_mysql
{
NET net;
- gptr connector_fd;
+ unsigned char * connector_fd;
char * host;
char * user;
char * passwd;
@@ -173,39 +201,47 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned
void * thd;
my_bool * unbuffered_fetch_owner;
char * info_buffer;
+ void * extension;
};
-# 653 "mysql.h"
+# 664 "mysql.h"
struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long int)))) st_mysql_bind
{
unsigned long int * length;
my_bool * is_null;
void * buffer;
my_bool * error;
- enum enum_field_types buffer_type;
- unsigned long int buffer_length;
unsigned char * row_ptr;
+ void (* store_param_func)(NET * net, struct st_mysql_bind * param);
+ void (* fetch_result)(struct st_mysql_bind *, MYSQL_FIELD *, unsigned char * * row);
+ void (* skip_result)(struct st_mysql_bind *, MYSQL_FIELD *, unsigned char * * row);
+ unsigned long int buffer_length;
unsigned long int offset;
unsigned long int length_value;
unsigned int param_number;
unsigned int pack_length;
+ enum enum_field_types buffer_type;
my_bool error_value;
my_bool is_unsigned;
my_bool long_data_used;
my_bool is_null_value;
- void (* store_param_func)(NET * net, struct st_mysql_bind * param);
- void (* fetch_result)(struct st_mysql_bind *, MYSQL_FIELD *, unsigned char * * row);
- void (* skip_result)(struct st_mysql_bind *, MYSQL_FIELD *, unsigned char * * row);
+ void * extension;
};
-# 145 "mysql.h"
-struct __attribute__((aligned(__alignof__(unsigned long long int)), aligned(__alignof__(void *)))) st_mysql_data
+# 628 "mysql/plugin.h"
+struct __attribute__((aligned(__alignof__(int)))) st_mysql_daemon
+ {
+ int interface_version;
+ };
+# 150 "mysql.h"
+struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long long int)))) st_mysql_data
{
- my_ulonglong rows;
- unsigned int fields;
MYSQL_ROWS * data;
- MEM_ROOT alloc;
struct embedded_query_result * embedded_info;
+ MEM_ROOT alloc;
+ my_ulonglong rows;
+ unsigned int fields;
+ void * extension;
};
-# 93 "mysql.h"
+# 95 "mysql.h"
struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long int)))) st_mysql_field
{
char * name;
@@ -228,30 +264,75 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned
unsigned int decimals;
unsigned int charsetnr;
enum enum_field_types type;
+ void * extension;
+ };
+# 581 "mysql/plugin.h"
+struct __attribute__((aligned(__alignof__(int)), aligned(__alignof__(void *)))) st_mysql_ftparser
+ {
+ int interface_version;
+ int (* parse)(MYSQL_FTPARSER_PARAM * param);
+ int (* init)(MYSQL_FTPARSER_PARAM * param);
+ int (* deinit)(MYSQL_FTPARSER_PARAM * param);
+ };
+# 495 "mysql/plugin.h"
+struct __attribute__((aligned(__alignof__(int)), aligned(__alignof__(void *)))) st_mysql_ftparser_boolean_info
+ {
+ enum enum_ft_token_type type;
+ int yesno;
+ int weight_adjust;
+ char wasign;
+ char trunc;
+ char prev;
+ char * quot;
+ };
+# 557 "mysql/plugin.h"
+struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(int)))) st_mysql_ftparser_param
+ {
+ int (* mysql_parse)(struct st_mysql_ftparser_param *, char * doc, int);
+ int (* mysql_add_word)(struct st_mysql_ftparser_param *, char * word, int, MYSQL_FTPARSER_BOOLEAN_INFO * boolean_info);
+ void * ftparser_state;
+ void * mysql_ftparam;
+ struct charset_info_st * cs;
+ char * doc;
+ int length;
+ int flags;
+ enum enum_ftparser_mode mode;
+ };
+# 638 "mysql/plugin.h"
+struct __attribute__((aligned(__alignof__(int)))) st_mysql_information_schema
+ {
+ int interface_version;
+ };
+# 29 "mysql/plugin.h"
+struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned int)))) st_mysql_lex_string
+ {
+ char * str;
+ unsigned int length;
};
-# 340 "mysql.h"
+# 348 "mysql.h"
struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long int)))) st_mysql_manager
{
NET net;
char * host;
char * user;
char * passwd;
- unsigned int port;
- my_bool free_me;
- my_bool eof;
- int cmd_status;
- int last_errno;
char * net_buf;
char * net_buf_pos;
char * 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;
};
-# 750 "mysql.h"
+# 763 "mysql.h"
struct __attribute__((aligned(__alignof__(void *)))) st_mysql_methods
{
my_bool (* read_query_result)(MYSQL * mysql);
- my_bool (* advanced_command)(MYSQL * mysql, enum enum_server_command, char const * header, unsigned long int, char const * arg, unsigned long int, my_bool, MYSQL_STMT * stmt);
+ my_bool (* advanced_command)(MYSQL * mysql, enum enum_server_command, unsigned char const * header, unsigned long int, unsigned char const * arg, unsigned long int, my_bool, MYSQL_STMT * stmt);
MYSQL_DATA * (* read_rows)(MYSQL * mysql, MYSQL_FIELD * mysql_fields, unsigned int);
MYSQL_RES * (* use_result)(MYSQL * mysql);
void (* fetch_lengths)(unsigned long int * to, MYSQL_ROW, unsigned int);
@@ -267,7 +348,7 @@ struct __attribute__((aligned(__alignof__(void *)))) st_mysql_methods
int (* read_change_user_result)(MYSQL * mysql, char * buff, char const * passwd);
int (* read_rows_from_cursor)(MYSQL_STMT * stmt);
};
-# 167 "mysql.h"
+# 173 "mysql.h"
struct __attribute__((aligned(__alignof__(unsigned long int)), aligned(__alignof__(void *)))) st_mysql_options
{
unsigned int connect_timeout;
@@ -309,14 +390,32 @@ struct __attribute__((aligned(__alignof__(unsigned long int)), aligned(__alignof
void (* local_infile_end)(void);
int (* local_infile_error)(void *, char *, unsigned int);
void * local_infile_userdata;
+ void * extension;
};
-# 354 "mysql.h"
+# 363 "mysql.h"
struct __attribute__((aligned(__alignof__(void *)))) st_mysql_parameters
{
unsigned long int * p_max_allowed_packet;
unsigned long int * p_net_buffer_length;
+ void * extension;
+ };
+# 384 "mysql/plugin.h"
+struct __attribute__((aligned(__alignof__(int)), aligned(__alignof__(void *)))) st_mysql_plugin
+ {
+ int type;
+ void * info;
+ char const * name;
+ char const * author;
+ char const * descr;
+ int license;
+ int (* init)(void);
+ int (* deinit)(void);
+ unsigned int version;
+ struct st_mysql_show_var * status_vars;
+ struct st_mysql_sys_var * * system_vars;
+ void * __reserved1;
};
-# 309 "mysql.h"
+# 316 "mysql.h"
struct __attribute__((aligned(__alignof__(unsigned long long int)), aligned(__alignof__(void *)))) st_mysql_res
{
my_ulonglong row_count;
@@ -325,23 +424,31 @@ struct __attribute__((aligned(__alignof__(unsigned long long int)), aligned(__al
MYSQL_ROWS * data_cursor;
unsigned long int * lengths;
MYSQL * handle;
+ struct st_mysql_methods const * methods;
+ MYSQL_ROW row;
+ MYSQL_ROW current_row;
MEM_ROOT field_alloc;
unsigned int field_count;
unsigned int current_field;
- MYSQL_ROW row;
- MYSQL_ROW current_row;
my_bool eof;
my_bool unbuffered_fetch_cancelled;
- struct st_mysql_methods const * methods;
+ void * extension;
};
-# 134 "mysql.h"
+# 139 "mysql.h"
struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long int)))) st_mysql_rows
{
struct st_mysql_rows * next;
MYSQL_ROW data;
unsigned long int length;
};
-# 681 "mysql.h"
+# 116 "mysql/plugin.h"
+struct __attribute__((aligned(__alignof__(void *)))) st_mysql_show_var
+ {
+ char const * name;
+ char * value;
+ enum enum_mysql_show_type type;
+ };
+# 693 "mysql.h"
struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long long int)))) st_mysql_stmt
{
MEM_ROOT mem_root;
@@ -352,9 +459,9 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned
MYSQL_FIELD * fields;
MYSQL_DATA result;
MYSQL_ROWS * data_cursor;
+ int (* read_row_func)(struct st_mysql_stmt * stmt, unsigned char * * row);
my_ulonglong affected_rows;
my_ulonglong insert_id;
- int (* read_row_func)(struct st_mysql_stmt * stmt, unsigned char * * row);
unsigned long int stmt_id;
unsigned long int flags;
unsigned long int prefetch_rows;
@@ -370,8 +477,14 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned
unsigned char bind_result_done;
my_bool unbuffered_fetch_cancelled;
my_bool update_max_length;
+ void * extension;
+ };
+# 616 "mysql/plugin.h"
+struct __attribute__((aligned(__alignof__(int)))) st_mysql_storage_engine
+ {
+ int interface_version;
};
-# 48 "mysql_time.h"
+# 47 "mysql_time.h"
struct __attribute__((aligned(__alignof__(unsigned long int)))) st_mysql_time
{
unsigned int year;
@@ -384,7 +497,23 @@ struct __attribute__((aligned(__alignof__(unsigned long int)))) st_mysql_time
my_bool neg;
enum enum_mysql_timestamp_type time_type;
};
-# 184 "mysql_com.h"
+# 658 "mysql/plugin.h"
+struct __attribute__((aligned(__alignof__(void *)))) st_mysql_value
+ {
+ int (* value_type)(struct st_mysql_value *);
+ char const * (* val_str)(struct st_mysql_value *, char * buffer, int * length);
+ int (* val_real)(struct st_mysql_value *, double * realbuf);
+ int (* val_int)(struct st_mysql_value *, long long int * intbuf);
+ };
+# 46 "mysql/plugin.h"
+struct __attribute__((aligned(__alignof__(long int)))) st_mysql_xid
+ {
+ long int formatID;
+ long int gtrid_length;
+ long int bqual_length;
+ char data[128];
+ };
+# 187 "mysql_com.h"
struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long int)))) st_net
{
Vio * vio;
@@ -393,6 +522,10 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned
unsigned char * write_pos;
unsigned char * read_pos;
my_socket fd;
+ unsigned long int remain_in_buf;
+ unsigned long int length;
+ unsigned long int buf_length;
+ unsigned long int where_b;
unsigned long int max_packet;
unsigned long int max_packet_size;
unsigned int pkt_nr;
@@ -401,26 +534,23 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned
unsigned int read_timeout;
unsigned int retry_count;
int fcntl;
- my_bool compress;
- unsigned long int remain_in_buf;
- unsigned long int length;
- unsigned long int buf_length;
- unsigned long int where_b;
unsigned int * return_status;
unsigned char reading_or_writing;
char save_char;
my_bool no_send_ok;
my_bool no_send_eof;
+ my_bool compress;
my_bool no_send_error;
- char last_error[512];
- char sqlstate[(5 + 1)];
+ unsigned char * query_cache_query;
unsigned int last_errno;
unsigned char error;
- gptr query_cache_query;
my_bool report_error;
my_bool return_errno;
+ char last_error[512];
+ char sqlstate[(5 + 1)];
+ void * extension;
};
-# 23 "typelib.h"
+# 22 "typelib.h"
struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(void *)))) st_typelib
{
unsigned int count;
@@ -428,7 +558,7 @@ struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(vo
char const * * type_names;
unsigned int * type_lengths;
};
-# 375 "mysql_com.h"
+# 383 "mysql_com.h"
struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(void *)))) st_udf_args
{
unsigned int arg_count;
@@ -438,8 +568,9 @@ struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(vo
char * maybe_null;
char * * attributes;
unsigned long int * attribute_lengths;
+ void * extension;
};
-# 388 "mysql_com.h"
+# 397 "mysql_com.h"
struct __attribute__((aligned(__alignof__(unsigned long int)), aligned(__alignof__(void *)))) st_udf_init
{
my_bool maybe_null;
@@ -447,15 +578,16 @@ struct __attribute__((aligned(__alignof__(unsigned long int)), aligned(__alignof
unsigned long int max_length;
char * ptr;
my_bool const_item;
+ void * extension;
};
-# 27 "my_alloc.h"
+# 26 "my_alloc.h"
struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned int)))) st_used_mem
{
struct st_used_mem * next;
unsigned int left;
unsigned int size;
};
-# 372 "mysql_com.h"
+# 380 "mysql_com.h"
enum Item_result
{
STRING_RESULT = 0,
@@ -464,7 +596,7 @@ enum Item_result
ROW_RESULT = 3,
DECIMAL_RESULT = 4,
};
-# 318 "mysql_com.h"
+# 321 "mysql_com.h"
enum enum_cursor_type
{
CURSOR_TYPE_NO_CURSOR = 0,
@@ -472,7 +604,7 @@ enum enum_cursor_type
CURSOR_TYPE_FOR_UPDATE = 2,
CURSOR_TYPE_SCROLLABLE = 4,
};
-# 231 "mysql_com.h"
+# 234 "mysql_com.h"
enum enum_field_types
{
MYSQL_TYPE_DECIMAL = 0,
@@ -503,13 +635,43 @@ enum enum_field_types
MYSQL_TYPE_STRING = 254,
MYSQL_TYPE_GEOMETRY = 255,
};
-# 328 "mysql_com.h"
+# 455 "mysql/plugin.h"
+enum enum_ft_token_type
+ {
+ FT_TOKEN_EOF = 0,
+ FT_TOKEN_WORD = 1,
+ FT_TOKEN_LEFT_PAREN = 2,
+ FT_TOKEN_RIGHT_PAREN = 3,
+ FT_TOKEN_STOPWORD = 4,
+ };
+# 407 "mysql/plugin.h"
+enum enum_ftparser_mode
+ {
+ MYSQL_FTPARSER_SIMPLE_MODE = 0,
+ MYSQL_FTPARSER_WITH_STOPWORDS = 1,
+ MYSQL_FTPARSER_FULL_BOOLEAN_INFO = 2,
+ };
+# 331 "mysql_com.h"
enum enum_mysql_set_option
{
MYSQL_OPTION_MULTI_STATEMENTS_ON = 0,
MYSQL_OPTION_MULTI_STATEMENTS_OFF = 1,
};
-# 583 "mysql.h"
+# 109 "mysql/plugin.h"
+enum enum_mysql_show_type
+ {
+ SHOW_UNDEF = 0,
+ SHOW_BOOL = 1,
+ SHOW_INT = 2,
+ SHOW_LONG = 3,
+ SHOW_LONGLONG = 4,
+ SHOW_CHAR = 5,
+ SHOW_CHAR_PTR = 6,
+ SHOW_ARRAY = 7,
+ SHOW_FUNC = 8,
+ SHOW_DOUBLE = 9,
+ };
+# 594 "mysql.h"
enum enum_mysql_stmt_state
{
MYSQL_STMT_INIT_DONE = 1,
@@ -517,7 +679,7 @@ enum enum_mysql_stmt_state
MYSQL_STMT_EXECUTE_DONE = 3,
MYSQL_STMT_FETCH_DONE = 4,
};
-# 29 "mysql_time.h"
+# 28 "mysql_time.h"
enum enum_mysql_timestamp_type
{
MYSQL_TIMESTAMP_NONE = -(2),
@@ -526,7 +688,7 @@ enum enum_mysql_timestamp_type
MYSQL_TIMESTAMP_DATETIME = 1,
MYSQL_TIMESTAMP_TIME = 2,
};
-# 52 "mysql_com.h"
+# 55 "mysql_com.h"
enum enum_server_command
{
COM_SLEEP = 0,
@@ -561,14 +723,14 @@ enum enum_server_command
COM_DAEMON = 29,
COM_END = 30,
};
-# 727 "mysql.h"
+# 740 "mysql.h"
enum enum_stmt_attr_type
{
STMT_ATTR_UPDATE_MAX_LENGTH = 0,
STMT_ATTR_CURSOR_TYPE = 1,
STMT_ATTR_PREFETCH_ROWS = 2,
};
-# 293 "mysql_com.h"
+# 296 "mysql_com.h"
enum mysql_enum_shutdown_level
{
SHUTDOWN_DEFAULT = 0,
@@ -577,10 +739,9 @@ enum mysql_enum_shutdown_level
SHUTDOWN_WAIT_UPDATES = (unsigned char)((1 << 3)),
SHUTDOWN_WAIT_ALL_BUFFERS = ((unsigned char)((1 << 3)) << 1),
SHUTDOWN_WAIT_CRITICAL_BUFFERS = (((unsigned char)((1 << 3)) << 1) + 1),
- KILL_QUERY = 254,
KILL_CONNECTION = 255,
};
-# 154 "mysql.h"
+# 160 "mysql.h"
enum mysql_option
{
MYSQL_OPT_CONNECT_TIMEOUT = 0,
@@ -606,7 +767,7 @@ enum mysql_option
MYSQL_OPT_RECONNECT = 20,
MYSQL_OPT_SSL_VERIFY_SERVER_CERT = 21,
};
-# 221 "mysql.h"
+# 228 "mysql.h"
enum mysql_protocol_type
{
MYSQL_PROTOCOL_DEFAULT = 0,
@@ -615,351 +776,393 @@ enum mysql_protocol_type
MYSQL_PROTOCOL_PIPE = 3,
MYSQL_PROTOCOL_MEMORY = 4,
};
-# 231 "mysql.h"
+# 238 "mysql.h"
enum mysql_rpl_type
{
MYSQL_RPL_MASTER = 0,
MYSQL_RPL_SLAVE = 1,
MYSQL_RPL_ADMIN = 2,
};
-# 216 "mysql.h"
+# 223 "mysql.h"
enum mysql_status
{
MYSQL_STATUS_READY = 0,
MYSQL_STATUS_GET_RESULT = 1,
MYSQL_STATUS_USE_RESULT = 2,
};
-# 427 "mysql_com.h"
+# 438 "mysql_com.h"
extern my_bool check_scramble(char const * reply, char const * message, unsigned char const * hash_stage2);
-# 420 "mysql_com.h"
+# 431 "mysql_com.h"
extern my_bool check_scramble_323(char const *, char const * message, unsigned long int * salt);
-# 33 "typelib.h"
+# 35 "typelib.h"
extern TYPELIB * copy_typelib(MEM_ROOT * root, TYPELIB * from);
-# 415 "mysql_com.h"
+# 426 "mysql_com.h"
extern void create_random_string(char * to, unsigned int, struct rand_struct * rand_st);
+# 32 "typelib.h"
+extern int find_type(char * x, TYPELIB const * typelib, unsigned int);
# 30 "typelib.h"
-extern int find_type(char * x, const TYPELIB * typelib, unsigned int);
-# 429 "mysql_com.h"
+extern int find_type_or_exit(char const * x, TYPELIB * typelib, char const * option);
+# 29 "typelib.h"
+extern my_ulonglong find_typeset(char * x, TYPELIB * typelib, int * error_position);
+# 440 "mysql_com.h"
extern void get_salt_from_password(unsigned char * res, char const * password);
-# 422 "mysql_com.h"
+# 433 "mysql_com.h"
extern void get_salt_from_password_323(unsigned long int * res, char const * password);
-# 435 "mysql_com.h"
+# 446 "mysql_com.h"
extern char * get_tty_password(char const * opt_message);
-# 32 "typelib.h"
+# 34 "typelib.h"
extern char const * get_type(TYPELIB * typelib, unsigned int);
-# 417 "mysql_com.h"
+# 428 "mysql_com.h"
extern void hash_password(unsigned long int * to, char const * password, unsigned int);
-# 31 "my_list.h"
+# 30 "my_list.h"
extern LIST * list_add(LIST * root, LIST * element);
-# 33 "my_list.h"
-extern LIST * list_cons(void * data, LIST * root);
# 32 "my_list.h"
+extern LIST * list_cons(void * data, LIST * root);
+# 31 "my_list.h"
extern LIST * list_delete(LIST * root, LIST * element);
-# 35 "my_list.h"
+# 34 "my_list.h"
extern void list_free(LIST * root, unsigned int);
-# 36 "my_list.h"
+# 35 "my_list.h"
extern unsigned int list_length(LIST *);
-# 34 "my_list.h"
+# 33 "my_list.h"
extern LIST * list_reverse(LIST * root);
-# 37 "my_list.h"
-extern int list_walk(LIST *, list_walk_action, gptr);
-# 430 "mysql_com.h"
+# 36 "my_list.h"
+extern int list_walk(LIST *, list_walk_action, unsigned char * argument);
+# 441 "mysql_com.h"
extern void make_password_from_salt(char * to, unsigned char const * hash_stage2);
-# 423 "mysql_com.h"
+# 434 "mysql_com.h"
extern void make_password_from_salt_323(char * to, unsigned long int const * salt);
-# 425 "mysql_com.h"
+# 436 "mysql_com.h"
extern void make_scrambled_password(char * to, char const * password);
-# 418 "mysql_com.h"
+# 429 "mysql_com.h"
extern void make_scrambled_password_323(char * to, char const * password);
-# 31 "typelib.h"
+# 33 "typelib.h"
extern void make_type(char * to, unsigned int, TYPELIB * typelib);
-# 358 "mysql_com.h"
+# 366 "mysql_com.h"
extern int my_connect(my_socket, struct sockaddr const * name, unsigned int, unsigned int);
-# 340 "mysql_com.h"
+# 343 "mysql_com.h"
extern my_bool my_net_init(NET * net, Vio * vio);
-# 341 "mysql_com.h"
+# 344 "mysql_com.h"
extern void my_net_local_init(NET * net);
-# 351 "mysql_com.h"
+# 354 "mysql_com.h"
extern unsigned long int my_net_read(NET * net);
-# 346 "mysql_com.h"
-extern my_bool my_net_write(NET * net, char const * packet, unsigned long int);
-# 414 "mysql_com.h"
+# 349 "mysql_com.h"
+extern my_bool my_net_write(NET * net, unsigned char const * packet, size_t);
+# 425 "mysql_com.h"
extern double my_rnd(struct rand_struct *);
-# 441 "mysql_com.h"
+# 452 "mysql_com.h"
extern void my_thread_end(void);
-# 440 "mysql_com.h"
+# 451 "mysql_com.h"
extern my_bool my_thread_init(void);
-# 559 "mysql.h"
+# 570 "mysql.h"
extern void myodbc_remove_escape(MYSQL * mysql, char * name);
-# 501 "mysql.h"
+# 512 "mysql.h"
extern int mysql_add_slave(MYSQL * mysql, char const * host, unsigned int, char const * user, char const * passwd);
-# 410 "mysql.h"
+# 421 "mysql.h"
extern my_ulonglong mysql_affected_rows(MYSQL * mysql);
-# 823 "mysql.h"
+# 836 "mysql.h"
extern my_bool mysql_autocommit(MYSQL * mysql, my_bool);
-# 426 "mysql.h"
+# 437 "mysql.h"
extern my_bool mysql_change_user(MYSQL * mysql, char const * user, char const * passwd, char const * db);
-# 418 "mysql.h"
+# 429 "mysql.h"
extern char const * mysql_character_set_name(MYSQL * mysql);
-# 826 "mysql.h"
+# 839 "mysql.h"
extern void mysql_close(MYSQL * sock);
-# 821 "mysql.h"
+# 834 "mysql.h"
extern my_bool mysql_commit(MYSQL * mysql);
-# 530 "mysql.h"
+# 541 "mysql.h"
extern void mysql_data_seek(MYSQL_RES * result, my_ulonglong);
-# 548 "mysql.h"
+# 559 "mysql.h"
extern void mysql_debug(char const * debug);
-# 487 "mysql.h"
+# 498 "mysql.h"
extern void mysql_disable_reads_from_master(MYSQL * mysql);
-# 481 "mysql.h"
+# 492 "mysql.h"
extern void mysql_disable_rpl_parse(MYSQL * mysql);
-# 509 "mysql.h"
+# 520 "mysql.h"
extern int mysql_dump_debug_info(MYSQL * mysql);
-# 561 "mysql.h"
+# 572 "mysql.h"
extern my_bool mysql_embedded(void);
-# 486 "mysql.h"
+# 497 "mysql.h"
extern void mysql_enable_reads_from_master(MYSQL * mysql);
-# 480 "mysql.h"
+# 491 "mysql.h"
extern void mysql_enable_rpl_parse(MYSQL * mysql);
-# 402 "mysql.h"
+# 413 "mysql.h"
extern my_bool mysql_eof(MYSQL_RES * res);
-# 412 "mysql.h"
+# 423 "mysql.h"
extern unsigned int mysql_errno(MYSQL * mysql);
-# 436 "mysql_com.h"
+# 447 "mysql_com.h"
extern char const * mysql_errno_to_sqlstate(unsigned int);
-# 413 "mysql.h"
+# 424 "mysql.h"
extern char const * mysql_error(MYSQL * mysql);
-# 541 "mysql.h"
+# 552 "mysql.h"
extern unsigned long int mysql_escape_string(char * to, char const * from, unsigned long int);
-# 538 "mysql.h"
+# 549 "mysql.h"
extern MYSQL_FIELD * mysql_fetch_field(MYSQL_RES * result);
-# 403 "mysql.h"
+# 414 "mysql.h"
extern MYSQL_FIELD * mysql_fetch_field_direct(MYSQL_RES * res, unsigned int);
-# 405 "mysql.h"
+# 416 "mysql.h"
extern MYSQL_FIELD * mysql_fetch_fields(MYSQL_RES * res);
-# 537 "mysql.h"
+# 548 "mysql.h"
extern unsigned long int * mysql_fetch_lengths(MYSQL_RES * result);
-# 536 "mysql.h"
+# 547 "mysql.h"
extern MYSQL_ROW mysql_fetch_row(MYSQL_RES * result);
-# 409 "mysql.h"
+# 420 "mysql.h"
extern unsigned int mysql_field_count(MYSQL * mysql);
-# 534 "mysql.h"
+# 545 "mysql.h"
extern MYSQL_FIELD_OFFSET mysql_field_seek(MYSQL_RES * result, MYSQL_FIELD_OFFSET);
-# 407 "mysql.h"
+# 418 "mysql.h"
extern MYSQL_FIELD_OFFSET mysql_field_tell(MYSQL_RES * res);
-# 529 "mysql.h"
+# 540 "mysql.h"
extern void mysql_free_result(MYSQL_RES * result);
-# 454 "mysql.h"
+# 465 "mysql.h"
extern void mysql_get_character_set_info(MYSQL * mysql, MY_CHARSET_INFO * charset);
-# 519 "mysql.h"
+# 530 "mysql.h"
extern char const * mysql_get_client_info(void);
-# 520 "mysql.h"
+# 531 "mysql.h"
extern unsigned long int mysql_get_client_version(void);
-# 521 "mysql.h"
+# 532 "mysql.h"
extern char const * mysql_get_host_info(MYSQL * mysql);
-# 384 "mysql.h"
+# 395 "mysql.h"
extern MYSQL_PARAMETERS * mysql_get_parameters(void);
-# 523 "mysql.h"
+# 534 "mysql.h"
extern unsigned int mysql_get_proto_info(MYSQL * mysql);
-# 518 "mysql.h"
+# 529 "mysql.h"
extern char const * mysql_get_server_info(MYSQL * mysql);
-# 522 "mysql.h"
+# 533 "mysql.h"
extern unsigned long int mysql_get_server_version(MYSQL * mysql);
-# 425 "mysql.h"
+# 436 "mysql.h"
extern char const * mysql_get_ssl_cipher(MYSQL * mysql);
-# 543 "mysql.h"
+# 554 "mysql.h"
extern unsigned long int mysql_hex_string(char * to, char const * from, unsigned long int);
-# 416 "mysql.h"
+# 427 "mysql.h"
extern char const * mysql_info(MYSQL * mysql);
-# 421 "mysql.h"
+# 432 "mysql.h"
extern MYSQL * mysql_init(MYSQL * mysql);
-# 411 "mysql.h"
+# 422 "mysql.h"
extern my_ulonglong mysql_insert_id(MYSQL * mysql);
-# 512 "mysql.h"
+# 523 "mysql.h"
extern int mysql_kill(MYSQL * mysql, unsigned long int);
-# 524 "mysql.h"
+# 535 "mysql.h"
extern MYSQL_RES * mysql_list_dbs(MYSQL * mysql, char const * wild);
-# 539 "mysql.h"
+# 550 "mysql.h"
extern MYSQL_RES * mysql_list_fields(MYSQL * mysql, char const * table, char const * wild);
-# 526 "mysql.h"
+# 537 "mysql.h"
extern MYSQL_RES * mysql_list_processes(MYSQL * mysql);
-# 525 "mysql.h"
+# 536 "mysql.h"
extern MYSQL_RES * mysql_list_tables(MYSQL * mysql, char const * wild);
-# 568 "mysql.h"
+# 579 "mysql.h"
extern void mysql_manager_close(MYSQL_MANAGER * con);
-# 569 "mysql.h"
+# 580 "mysql.h"
extern int mysql_manager_command(MYSQL_MANAGER * con, char const * cmd, int);
-# 563 "mysql.h"
+# 574 "mysql.h"
extern MYSQL_MANAGER * mysql_manager_connect(MYSQL_MANAGER * con, char const * host, char const * user, char const * passwd, unsigned int);
-# 571 "mysql.h"
+# 582 "mysql.h"
extern int mysql_manager_fetch_line(MYSQL_MANAGER * con, char * res_buf, int);
-# 562 "mysql.h"
+# 573 "mysql.h"
extern MYSQL_MANAGER * mysql_manager_init(MYSQL_MANAGER * con);
-# 445 "mysql.h"
+# 456 "mysql.h"
extern my_bool mysql_master_query(MYSQL * mysql, char const * q, unsigned long int);
-# 447 "mysql.h"
+# 458 "mysql.h"
extern my_bool mysql_master_send_query(MYSQL * mysql, char const * q, unsigned long int);
-# 824 "mysql.h"
+# 837 "mysql.h"
extern my_bool mysql_more_results(MYSQL * mysql);
-# 825 "mysql.h"
+# 838 "mysql.h"
extern int mysql_next_result(MYSQL * mysql);
-# 401 "mysql.h"
+# 412 "mysql.h"
extern unsigned int mysql_num_fields(MYSQL_RES * res);
-# 400 "mysql.h"
+# 411 "mysql.h"
extern my_ulonglong mysql_num_rows(MYSQL_RES * res);
-# 549 "mysql.h"
+# 560 "mysql.h"
extern char * mysql_odbc_escape_string(MYSQL * mysql, char * to, unsigned long int, char const * from, unsigned long int, void * param, char * (* extend_buffer)(void *, char * to, unsigned long int * length));
+# 538 "mysql.h"
+extern int mysql_options(MYSQL * mysql, enum mysql_option, void const * arg);
# 527 "mysql.h"
-extern int mysql_options(MYSQL * mysql, enum mysql_option, char const * arg);
-# 516 "mysql.h"
extern int mysql_ping(MYSQL * mysql);
-# 75 "mysql.h"
+# 76 "mysql.h"
extern unsigned int mysql_port;
-# 436 "mysql.h"
+# 447 "mysql.h"
extern int mysql_query(MYSQL * mysql, char const * q);
-# 574 "mysql.h"
+# 780 "mysql/plugin.h"
+extern void mysql_query_cache_invalidate4(void * thd, char const * key, unsigned int, int);
+# 585 "mysql.h"
extern my_bool mysql_read_query_result(MYSQL * mysql);
-# 489 "mysql.h"
+# 500 "mysql.h"
extern my_bool mysql_reads_from_master_enabled(MYSQL * mysql);
-# 428 "mysql.h"
+# 439 "mysql.h"
extern MYSQL * mysql_real_connect(MYSQL * mysql, char const * host, char const * user, char const * passwd, char const * db, unsigned int, char const * unix_socket, unsigned long int);
-# 545 "mysql.h"
+# 556 "mysql.h"
extern unsigned long int mysql_real_escape_string(MYSQL * mysql, char * to, char const * from, unsigned long int);
-# 439 "mysql.h"
+# 450 "mysql.h"
extern int mysql_real_query(MYSQL * mysql, char const * q, unsigned long int);
-# 510 "mysql.h"
+# 521 "mysql.h"
extern int mysql_refresh(MYSQL * mysql, unsigned int);
-# 822 "mysql.h"
+# 835 "mysql.h"
extern my_bool mysql_rollback(MYSQL * mysql);
-# 532 "mysql.h"
+# 543 "mysql.h"
extern MYSQL_ROW_OFFSET mysql_row_seek(MYSQL_RES * result, MYSQL_ROW_OFFSET);
-# 406 "mysql.h"
+# 417 "mysql.h"
extern MYSQL_ROW_OFFSET mysql_row_tell(MYSQL_RES * res);
-# 483 "mysql.h"
-extern int mysql_rpl_parse_enabled(MYSQL * mysql);
# 494 "mysql.h"
+extern int mysql_rpl_parse_enabled(MYSQL * mysql);
+# 505 "mysql.h"
extern my_bool mysql_rpl_probe(MYSQL * mysql);
-# 491 "mysql.h"
+# 502 "mysql.h"
extern enum mysql_rpl_type mysql_rpl_query_type(char const * q, int);
-# 435 "mysql.h"
+# 446 "mysql.h"
extern int mysql_select_db(MYSQL * mysql, char const * db);
-# 437 "mysql.h"
+# 448 "mysql.h"
extern int mysql_send_query(MYSQL * mysql, char const * q, unsigned long int);
-# 371 "mysql.h"
+# 381 "mysql.h"
extern void mysql_server_end(void);
-# 370 "mysql.h"
+# 380 "mysql.h"
extern int mysql_server_init(int, char * * argv, char * * groups);
-# 419 "mysql.h"
+# 430 "mysql.h"
extern int mysql_set_character_set(MYSQL * mysql, char const * csname);
-# 472 "mysql.h"
+# 483 "mysql.h"
extern void mysql_set_local_infile_default(MYSQL * mysql);
-# 461 "mysql.h"
+# 472 "mysql.h"
extern void mysql_set_local_infile_handler(MYSQL * mysql, int (* local_infile_init)(void * *, char const *, void *), int (* local_infile_read)(void *, char *, unsigned int), void (* local_infile_end)(void), int (* local_infile_error)(void *, char *, unsigned int), void *);
-# 497 "mysql.h"
+# 508 "mysql.h"
extern int mysql_set_master(MYSQL * mysql, char const * host, unsigned int, char const * user, char const * passwd);
-# 513 "mysql.h"
+# 524 "mysql.h"
extern int mysql_set_server_option(MYSQL * mysql, enum enum_mysql_set_option);
-# 506 "mysql.h"
+# 517 "mysql.h"
extern int mysql_shutdown(MYSQL * mysql, enum mysql_enum_shutdown_level);
-# 450 "mysql.h"
+# 461 "mysql.h"
extern my_bool mysql_slave_query(MYSQL * mysql, char const * q, unsigned long int);
-# 452 "mysql.h"
+# 463 "mysql.h"
extern my_bool mysql_slave_send_query(MYSQL * mysql, char const * q, unsigned long int);
-# 414 "mysql.h"
+# 425 "mysql.h"
extern char const * mysql_sqlstate(MYSQL * mysql);
-# 422 "mysql.h"
+# 433 "mysql.h"
extern my_bool mysql_ssl_set(MYSQL * mysql, char const * key, char const * cert, char const * ca, char const * capath, char const * cipher);
-# 517 "mysql.h"
+# 528 "mysql.h"
extern char const * mysql_stat(MYSQL * mysql);
-# 817 "mysql.h"
+# 830 "mysql.h"
extern my_ulonglong mysql_stmt_affected_rows(MYSQL_STMT * stmt);
-# 795 "mysql.h"
+# 808 "mysql.h"
extern my_bool mysql_stmt_attr_get(MYSQL_STMT * stmt, enum enum_stmt_attr_type, void * attr);
-# 792 "mysql.h"
+# 805 "mysql.h"
extern my_bool mysql_stmt_attr_set(MYSQL_STMT * stmt, enum enum_stmt_attr_type, void const * attr);
-# 798 "mysql.h"
+# 811 "mysql.h"
extern my_bool mysql_stmt_bind_param(MYSQL_STMT * stmt, MYSQL_BIND * bnd);
-# 799 "mysql.h"
+# 812 "mysql.h"
extern my_bool mysql_stmt_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bnd);
-# 800 "mysql.h"
+# 813 "mysql.h"
extern my_bool mysql_stmt_close(MYSQL_STMT * stmt);
-# 815 "mysql.h"
+# 828 "mysql.h"
extern void mysql_stmt_data_seek(MYSQL_STMT * stmt, my_ulonglong);
-# 809 "mysql.h"
+# 822 "mysql.h"
extern unsigned int mysql_stmt_errno(MYSQL_STMT * stmt);
-# 810 "mysql.h"
+# 823 "mysql.h"
extern char const * mysql_stmt_error(MYSQL_STMT * stmt);
-# 785 "mysql.h"
+# 798 "mysql.h"
extern int mysql_stmt_execute(MYSQL_STMT * stmt);
-# 786 "mysql.h"
+# 799 "mysql.h"
extern int mysql_stmt_fetch(MYSQL_STMT * stmt);
-# 787 "mysql.h"
-extern int mysql_stmt_fetch_column(MYSQL_STMT * stmt, MYSQL_BIND * bind, unsigned int, unsigned long int);
-# 819 "mysql.h"
+# 800 "mysql.h"
+extern int mysql_stmt_fetch_column(MYSQL_STMT * stmt, MYSQL_BIND * bind_arg, unsigned int, unsigned long int);
+# 832 "mysql.h"
extern unsigned int mysql_stmt_field_count(MYSQL_STMT * stmt);
-# 802 "mysql.h"
+# 815 "mysql.h"
extern my_bool mysql_stmt_free_result(MYSQL_STMT * stmt);
-# 782 "mysql.h"
+# 795 "mysql.h"
extern MYSQL_STMT * mysql_stmt_init(MYSQL * mysql);
-# 818 "mysql.h"
+# 831 "mysql.h"
extern my_ulonglong mysql_stmt_insert_id(MYSQL_STMT * stmt);
-# 816 "mysql.h"
+# 829 "mysql.h"
extern my_ulonglong mysql_stmt_num_rows(MYSQL_STMT * stmt);
-# 791 "mysql.h"
+# 804 "mysql.h"
extern unsigned long int mysql_stmt_param_count(MYSQL_STMT * stmt);
-# 808 "mysql.h"
+# 821 "mysql.h"
extern MYSQL_RES * mysql_stmt_param_metadata(MYSQL_STMT * stmt);
-# 783 "mysql.h"
+# 796 "mysql.h"
extern int mysql_stmt_prepare(MYSQL_STMT * stmt, char const * query, unsigned long int);
-# 801 "mysql.h"
+# 814 "mysql.h"
extern my_bool mysql_stmt_reset(MYSQL_STMT * stmt);
-# 807 "mysql.h"
+# 820 "mysql.h"
extern MYSQL_RES * mysql_stmt_result_metadata(MYSQL_STMT * stmt);
-# 812 "mysql.h"
+# 825 "mysql.h"
extern MYSQL_ROW_OFFSET mysql_stmt_row_seek(MYSQL_STMT * stmt, MYSQL_ROW_OFFSET);
-# 814 "mysql.h"
+# 827 "mysql.h"
extern MYSQL_ROW_OFFSET mysql_stmt_row_tell(MYSQL_STMT * stmt);
-# 803 "mysql.h"
+# 816 "mysql.h"
extern my_bool mysql_stmt_send_long_data(MYSQL_STMT * stmt, unsigned int, char const * data, unsigned long int);
-# 811 "mysql.h"
+# 824 "mysql.h"
extern char const * mysql_stmt_sqlstate(MYSQL_STMT * stmt);
-# 790 "mysql.h"
+# 803 "mysql.h"
extern int mysql_stmt_store_result(MYSQL_STMT * stmt);
-# 441 "mysql.h"
+# 452 "mysql.h"
extern MYSQL_RES * mysql_store_result(MYSQL * mysql);
-# 393 "mysql.h"
+# 404 "mysql.h"
extern void mysql_thread_end(void);
-# 417 "mysql.h"
+# 428 "mysql.h"
extern unsigned long int mysql_thread_id(MYSQL * mysql);
-# 392 "mysql.h"
+# 403 "mysql.h"
extern my_bool mysql_thread_init(void);
-# 560 "mysql.h"
+# 571 "mysql.h"
extern unsigned int mysql_thread_safe(void);
-# 76 "mysql.h"
+# 699 "mysql/plugin.h"
+extern int mysql_tmpfile(char const * prefix);
+# 77 "mysql.h"
extern char * mysql_unix_port;
-# 442 "mysql.h"
+# 453 "mysql.h"
extern MYSQL_RES * mysql_use_result(MYSQL * mysql);
-# 415 "mysql.h"
+# 426 "mysql.h"
extern unsigned int mysql_warning_count(MYSQL * mysql);
-# 343 "mysql_com.h"
-extern void net_clear(NET * net);
-# 342 "mysql_com.h"
-extern void net_end(NET * net);
+# 346 "mysql_com.h"
+extern void net_clear(NET * net, my_bool);
# 345 "mysql_com.h"
+extern void net_end(NET * net);
+# 348 "mysql_com.h"
extern my_bool net_flush(NET * net);
-# 350 "mysql_com.h"
-extern int net_real_write(NET * net, char const * packet, unsigned long int);
-# 344 "mysql_com.h"
-extern my_bool net_realloc(NET * net, unsigned long int);
+# 353 "mysql_com.h"
+extern int net_real_write(NET * net, unsigned char const * packet, size_t);
# 347 "mysql_com.h"
-extern my_bool net_write_command(NET * net, unsigned char, char const * header, unsigned long int, char const * packet, unsigned long int);
-# 431 "mysql_com.h"
+extern my_bool net_realloc(NET * net, size_t);
+# 350 "mysql_com.h"
+extern my_bool net_write_command(NET * net, unsigned char, unsigned char const * header, size_t, unsigned char const * packet, size_t);
+# 442 "mysql_com.h"
extern char * octet2hex(char * to, char const * str, unsigned int);
-# 412 "mysql_com.h"
+# 423 "mysql_com.h"
extern void randominit(struct rand_struct *, unsigned long int, unsigned long int);
-# 426 "mysql_com.h"
+# 437 "mysql_com.h"
extern void scramble(char * to, char const * message, char const * password);
-# 419 "mysql_com.h"
+# 430 "mysql_com.h"
extern void scramble_323(char * to, char const * message, char const * password);
-# 35 "typelib.h"
+# 37 "typelib.h"
extern TYPELIB sql_protocol_typelib;
+# 729 "mysql/plugin.h"
+extern void * thd_alloc(void * thd, unsigned int);
+# 733 "mysql/plugin.h"
+extern void * thd_calloc(void * thd, unsigned int);
+# 770 "mysql/plugin.h"
+extern void thd_get_xid(void const * thd, MYSQL_XID * xid);
+# 680 "mysql/plugin.h"
+extern void * * thd_ha_data(void const * thd, struct handlerton const * hton);
+# 675 "mysql/plugin.h"
+extern int thd_in_lock_tables(void const * thd);
+# 685 "mysql/plugin.h"
+extern void thd_inc_row_count(void);
+# 715 "mysql/plugin.h"
+extern int thd_killed(void const * thd);
+# 760 "mysql/plugin.h"
+extern MYSQL_LEX_STRING * thd_make_lex_string(void * thd, MYSQL_LEX_STRING * lex_str, char const * str, unsigned int, int);
+# 745 "mysql/plugin.h"
+extern void * thd_memdup(void * thd, void const * str, unsigned int);
+# 679 "mysql/plugin.h"
+extern char const * thd_proc_info(void * thd, char const * info);
+# 682 "mysql/plugin.h"
+extern char * thd_security_context(void * thd, char * buffer, unsigned int, unsigned int);
+# 678 "mysql/plugin.h"
+extern int thd_sql_command(void const * thd);
+# 737 "mysql/plugin.h"
+extern char * thd_strdup(void * thd, char const * str);
+# 741 "mysql/plugin.h"
+extern char * thd_strmake(void * thd, char const * str, unsigned int);
+# 676 "mysql/plugin.h"
+extern int thd_tablespace_op(void const * thd);
+# 677 "mysql/plugin.h"
+extern long long int thd_test_options(void const * thd, long long int);
+# 681 "mysql/plugin.h"
+extern int thd_tx_isolation(void const * thd);
diff --git a/include/mysys_err.h b/include/mysys_err.h
index b92027a4e3c..09e77248c17 100644
--- a/include/mysys_err.h
+++ b/include/mysys_err.h
@@ -79,6 +79,7 @@ extern const char * NEAR globerrs[]; /* my_error_messages is here */
#define EXIT_NO_PTR_TO_VARIABLE 10
#define EXIT_CANNOT_CONNECT_TO_SERVICE 11
#define EXIT_OPTION_DISABLED 12
+#define EXIT_ARGUMENT_INVALID 13
#ifdef __cplusplus
diff --git a/include/queues.h b/include/queues.h
index d46f867f3bf..4fd0f72484e 100644
--- a/include/queues.h
+++ b/include/queues.h
@@ -27,13 +27,13 @@ extern "C" {
#endif
typedef struct st_queue {
- byte **root;
+ uchar **root;
void *first_cmp_arg;
uint elements;
uint max_elements;
uint offset_to_key; /* compare is done on element+offset */
int max_at_top; /* Set if queue_top gives max */
- int (*compare)(void *, byte *,byte *);
+ int (*compare)(void *, uchar *,uchar *);
uint auto_extent;
} QUEUE;
@@ -44,7 +44,7 @@ typedef struct st_queue {
#define queue_set_cmp_arg(queue, set_arg) (queue)->first_cmp_arg= set_arg
#define queue_set_max_at_top(queue, set_arg) \
(queue)->max_at_top= set_arg ? (-1 ^ 1) : 0
-typedef int (*queue_compare)(void *,byte *, byte *);
+typedef int (*queue_compare)(void *,uchar *, uchar *);
int init_queue(QUEUE *queue,uint max_elements,uint offset_to_key,
pbool max_at_top, queue_compare compare,
@@ -57,9 +57,9 @@ int reinit_queue(QUEUE *queue,uint max_elements,uint offset_to_key,
void *first_cmp_arg);
int resize_queue(QUEUE *queue, uint max_elements);
void delete_queue(QUEUE *queue);
-void queue_insert(QUEUE *queue,byte *element);
-int queue_insert_safe(QUEUE *queue, byte *element);
-byte *queue_remove(QUEUE *queue,uint idx);
+void queue_insert(QUEUE *queue,uchar *element);
+int queue_insert_safe(QUEUE *queue, uchar *element);
+uchar *queue_remove(QUEUE *queue,uint idx);
#define queue_remove_all(queue) { (queue)->elements= 0; }
#define queue_is_full(queue) (queue->elements == queue->max_elements)
void _downheap(QUEUE *queue,uint idx);
diff --git a/include/sql_common.h b/include/sql_common.h
index a549fe6aeb5..80504140fae 100644
--- a/include/sql_common.h
+++ b/include/sql_common.h
@@ -32,9 +32,9 @@ void mysql_read_default_options(struct st_mysql_options *options,
const char *filename,const char *group);
my_bool
cli_advanced_command(MYSQL *mysql, enum enum_server_command command,
- const char *header, ulong header_length,
- const char *arg, ulong arg_length, my_bool skip_check,
- MYSQL_STMT *stmt);
+ const unsigned char *header, ulong header_length,
+ const unsigned char *arg, ulong arg_length,
+ my_bool skip_check, MYSQL_STMT *stmt);
unsigned long cli_safe_read(MYSQL *mysql);
void set_stmt_errmsg(MYSQL_STMT * stmt, const char *err, int errcode,
const char *sqlstate);
diff --git a/include/sslopt-longopts.h b/include/sslopt-longopts.h
index d4aaf50992d..c76b5dcd252 100644
--- a/include/sslopt-longopts.h
+++ b/include/sslopt-longopts.h
@@ -17,29 +17,29 @@
{"ssl", OPT_SSL_SSL,
"Enable SSL for connection (automatically enabled with other flags). Disable with --skip-ssl.",
- (gptr*) &opt_use_ssl, (gptr*) &opt_use_ssl, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+ (uchar **) &opt_use_ssl, (uchar **) &opt_use_ssl, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"ssl-ca", OPT_SSL_CA,
"CA file in PEM format (check OpenSSL docs, implies --ssl).",
- (gptr*) &opt_ssl_ca, (gptr*) &opt_ssl_ca, 0, GET_STR, REQUIRED_ARG,
+ (uchar **) &opt_ssl_ca, (uchar **) &opt_ssl_ca, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-capath", OPT_SSL_CAPATH,
"CA directory (check OpenSSL docs, implies --ssl).",
- (gptr*) &opt_ssl_capath, (gptr*) &opt_ssl_capath, 0, GET_STR, REQUIRED_ARG,
+ (uchar **) &opt_ssl_capath, (uchar **) &opt_ssl_capath, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-cert", OPT_SSL_CERT, "X509 cert in PEM format (implies --ssl).",
- (gptr*) &opt_ssl_cert, (gptr*) &opt_ssl_cert, 0, GET_STR, REQUIRED_ARG,
+ (uchar **) &opt_ssl_cert, (uchar **) &opt_ssl_cert, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-cipher", OPT_SSL_CIPHER, "SSL cipher to use (implies --ssl).",
- (gptr*) &opt_ssl_cipher, (gptr*) &opt_ssl_cipher, 0, GET_STR, REQUIRED_ARG,
+ (uchar **) &opt_ssl_cipher, (uchar **) &opt_ssl_cipher, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-key", OPT_SSL_KEY, "X509 key in PEM format (implies --ssl).",
- (gptr*) &opt_ssl_key, (gptr*) &opt_ssl_key, 0, GET_STR, REQUIRED_ARG,
+ (uchar **) &opt_ssl_key, (uchar **) &opt_ssl_key, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
#ifdef MYSQL_CLIENT
{"ssl-verify-server-cert", OPT_SSL_VERIFY_SERVER_CERT,
"Verify server's \"Common Name\" in its cert against hostname used when connecting. This option is disabled by default.",
- (gptr*) &opt_ssl_verify_server_cert, (gptr*) &opt_ssl_verify_server_cert,
+ (uchar **) &opt_ssl_verify_server_cert, (uchar **) &opt_ssl_verify_server_cert,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
#endif /* HAVE_OPENSSL */
diff --git a/include/thr_lock.h b/include/thr_lock.h
index 9bd7c22aa92..74d65c2fa7a 100644
--- a/include/thr_lock.h
+++ b/include/thr_lock.h
@@ -54,6 +54,11 @@ enum thr_lock_type { TL_IGNORE=-1,
TL_WRITE_CONCURRENT_INSERT,
/* Write used by INSERT DELAYED. Allows READ locks */
TL_WRITE_DELAYED,
+ /*
+ parser only! Late bound low_priority flag.
+ At open_tables() becomes thd->update_lock_default.
+ */
+ TL_WRITE_DEFAULT,
/* WRITE lock that has lower priority than TL_READ */
TL_WRITE_LOW_PRIORITY,
/* Normal WRITE lock */
diff --git a/include/typelib.h b/include/typelib.h
index aa51864749f..46106d1bdab 100644
--- a/include/typelib.h
+++ b/include/typelib.h
@@ -26,6 +26,7 @@ typedef struct st_typelib { /* Different types saved here */
unsigned int *type_lengths;
} TYPELIB;
+extern my_ulonglong find_typeset(char *x, TYPELIB *typelib,int *error_position);
extern int find_type_or_exit(const char *x, TYPELIB *typelib,
const char *option);
extern int find_type(char *x, const TYPELIB *typelib, unsigned int full_name);
diff --git a/include/violite.h b/include/violite.h
index 04365213ec0..d49d0302b5e 100644
--- a/include/violite.h
+++ b/include/violite.h
@@ -51,8 +51,8 @@ Vio* vio_new_win32shared_memory(NET *net,HANDLE handle_file_map,
HANDLE event_client_wrote,
HANDLE event_client_read,
HANDLE event_conn_closed);
-int vio_read_pipe(Vio *vio, gptr buf, int size);
-int vio_write_pipe(Vio *vio, const gptr buf, int size);
+size_t vio_read_pipe(Vio *vio, uchar * buf, size_t size);
+size_t vio_write_pipe(Vio *vio, const uchar * buf, size_t size);
int vio_close_pipe(Vio * vio);
#else
#define HANDLE void *
@@ -62,9 +62,9 @@ void vio_delete(Vio* vio);
int vio_close(Vio* vio);
void vio_reset(Vio* vio, enum enum_vio_type type,
my_socket sd, HANDLE hPipe, uint flags);
-int vio_read(Vio *vio, gptr buf, int size);
-int vio_read_buff(Vio *vio, gptr buf, int size);
-int vio_write(Vio *vio, const gptr buf, int size);
+size_t vio_read(Vio *vio, uchar * buf, size_t size);
+size_t vio_read_buff(Vio *vio, uchar * buf, size_t size);
+size_t vio_write(Vio *vio, const uchar * buf, size_t size);
int vio_blocking(Vio *vio, my_bool onoff, my_bool *old_mode);
my_bool vio_is_blocking(Vio *vio);
/* setsockopt TCP_NODELAY at IPPROTO_TCP level, when possible */
@@ -88,7 +88,6 @@ my_bool vio_peer_addr(Vio* vio, char *buf, uint16 *port);
/* Remotes in_addr */
void vio_in_addr(Vio *vio, struct in_addr *in);
my_bool vio_poll_read(Vio *vio,uint timeout);
-void vio_timeout(Vio *vio,uint which, uint timeout);
#ifdef HAVE_OPENSSL
#include <openssl/opensslv.h>
@@ -101,7 +100,9 @@ void vio_timeout(Vio *vio,uint which, uint timeout);
#define HEADER_DES_LOCL_H dummy_something
#define YASSL_MYSQL_COMPATIBLE
+#ifndef YASSL_PREFIX
#define YASSL_PREFIX
+#endif
/* Set yaSSL to use same type as MySQL do for socket handles */
typedef my_socket YASSL_SOCKET_T;
#define YASSL_SOCKET_T_DEFINED
@@ -128,8 +129,8 @@ void free_vio_ssl_acceptor_fd(struct st_VioSSLFd *fd);
#endif /* HAVE_OPENSSL */
#ifdef HAVE_SMEM
-int vio_read_shared_memory(Vio *vio, gptr buf, int size);
-int vio_write_shared_memory(Vio *vio, const gptr buf, int size);
+size_t vio_read_shared_memory(Vio *vio, uchar * buf, size_t size);
+size_t vio_write_shared_memory(Vio *vio, const uchar * buf, size_t size);
int vio_close_shared_memory(Vio * vio);
#endif
@@ -187,8 +188,8 @@ struct st_vio
/* function pointers. They are similar for socket/SSL/whatever */
void (*viodelete)(Vio*);
int (*vioerrno)(Vio*);
- int (*read)(Vio*, gptr, int);
- int (*write)(Vio*, const gptr, int);
+ size_t (*read)(Vio*, uchar *, size_t);
+ size_t (*write)(Vio*, const uchar *, size_t);
int (*vioblocking)(Vio*, my_bool, my_bool *);
my_bool (*is_blocking)(Vio*);
int (*viokeepalive)(Vio*, my_bool);
@@ -210,7 +211,7 @@ struct st_vio
HANDLE event_client_wrote;
HANDLE event_client_read;
HANDLE event_conn_closed;
- long shared_memory_remain;
+ size_t shared_memory_remain;
char *shared_memory_pos;
NET *net;
#endif /* HAVE_SMEM */
diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt
index 7d4dcc1e919..8471bbbd76c 100644..100755
--- a/libmysql/CMakeLists.txt
+++ b/libmysql/CMakeLists.txt
@@ -12,24 +12,57 @@
# 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
-
-# Need to set USE_TLS, since __declspec(thread) approach to thread local
-# storage does not work properly in DLLs.
INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_TLS")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_TLS")
+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
+# directly. This means we don't have to worry here about if these
+# libraries are compiled defining USE_TLS or not. Not that it *should*
+# have been a problem anyway, they don't use thread local storage.
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
- ${CMAKE_SOURCE_DIR}/zlib
- ${CMAKE_SOURCE_DIR}/extra/yassl/include
${CMAKE_SOURCE_DIR}/libmysql
${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/strings)
-ADD_LIBRARY(libmysql SHARED dll.c libmysql.def
- ../mysys/array.c ../strings/bchange.c ../strings/bmove.c
+# We include the source file listing instead of referencing the
+# libraries. At least with CMake 2.4 and Visual Studio 2005 a static
+# library created from other static libraries would not be complete,
+# i.e. the libraries listed in TARGET_LINK_LIBRARIES() were just
+# ignored.
+
+
+# Include and add the directory path
+SET(SOURCE_SUBLIBS TRUE)
+SET(LIB_SOURCES "")
+
+INCLUDE(${CMAKE_SOURCE_DIR}/zlib/CMakeLists.txt)
+FOREACH(rpath ${ZLIB_SOURCES})
+ SET(LIB_SOURCES ${LIB_SOURCES} ../zlib/${rpath})
+ENDFOREACH(rpath)
+
+# FIXME only needed if build type is "Debug", but CMAKE_BUILD_TYPE is
+# not set during configure time.
+INCLUDE(${CMAKE_SOURCE_DIR}/dbug/CMakeLists.txt)
+FOREACH(rpath ${DBUG_SOURCES})
+ SET(LIB_SOURCES ${LIB_SOURCES} ../dbug/${rpath})
+ENDFOREACH(rpath)
+
+INCLUDE(${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/CMakeLists.txt)
+FOREACH(rpath ${TAOCRYPT_SOURCES})
+ SET(LIB_SOURCES ${LIB_SOURCES} ../extra/yassl/taocrypt/${rpath})
+ENDFOREACH(rpath)
+
+INCLUDE(${CMAKE_SOURCE_DIR}/extra/yassl/CMakeLists.txt)
+FOREACH(rpath ${YASSL_SOURCES})
+ SET(LIB_SOURCES ${LIB_SOURCES} ../extra/yassl/${rpath})
+ENDFOREACH(rpath)
+
+SET(CLIENT_SOURCES ../mysys/array.c ../strings/bchange.c ../strings/bmove.c
../strings/bmove_upp.c ../mysys/charset-def.c ../mysys/charset.c
../sql-common/client.c ../strings/ctype-big5.c ../strings/ctype-bin.c
../strings/ctype-cp932.c ../strings/ctype-czech.c ../strings/ctype-euc_kr.c
@@ -38,10 +71,11 @@ ADD_LIBRARY(libmysql SHARED dll.c libmysql.def
../strings/ctype-simple.c ../strings/ctype-sjis.c ../strings/ctype-tis620.c
../strings/ctype-uca.c ../strings/ctype-ucs2.c ../strings/ctype-ujis.c
../strings/ctype-utf8.c ../strings/ctype-win1250ch.c ../strings/ctype.c
- ../mysys/default.c ../libmysql/errmsg.c ../mysys/errors.c
- ../libmysql/get_password.c ../strings/int2str.c ../strings/is_prefix.c
- ../libmysql/libmysql.c ../mysys/list.c ../strings/llstr.c
- ../strings/longlong2str.c ../libmysql/manager.c ../mysys/mf_cache.c
+ ../mysys/default.c errmsg.c ../mysys/errors.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_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
@@ -63,9 +97,34 @@ ADD_LIBRARY(libmysql SHARED dll.c libmysql.def
../strings/strmov.c ../strings/strnlen.c ../strings/strnmov.c ../strings/strtod.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)
-ADD_DEPENDENCIES(libmysql dbug vio mysys strings GenError zlib yassl taocrypt)
-TARGET_LINK_LIBRARIES(libmysql mysys strings wsock32)
+ ../vio/viossl.c ../vio/viosslfactories.c ../strings/xml.c
+ ../mysys/my_getsystime.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.
+
+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)
ADD_EXECUTABLE(myTest mytest.c)
TARGET_LINK_LIBRARIES(myTest libmysql)
diff --git a/libmysql/Makefile.am b/libmysql/Makefile.am
index ebfe15774ff..e5005553467 100644
--- a/libmysql/Makefile.am
+++ b/libmysql/Makefile.am
@@ -34,7 +34,6 @@ libmysqlclient_la_LDFLAGS = $(target_ldflags)
EXTRA_DIST = Makefile.shared libmysql.def dll.c mytest.c CMakeLists.txt
noinst_HEADERS = client_settings.h
-# This is called from the toplevel makefile
link_sources:
set -x; \
ss=`echo $(mystringsobjects) | sed "s;\.lo;.c;g"`; \
diff --git a/libmysql/Makefile.shared b/libmysql/Makefile.shared
index c24c6ab52db..3a2559921f9 100644
--- a/libmysql/Makefile.shared
+++ b/libmysql/Makefile.shared
@@ -68,7 +68,7 @@ mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \
mf_iocache2.lo my_seek.lo my_sleep.lo \
my_pread.lo mf_cache.lo md5.lo sha1.lo \
my_getopt.lo my_gethostbyname.lo my_port.lo \
- my_rename.lo my_chsize.lo
+ my_rename.lo my_chsize.lo my_getsystime.lo
sqlobjects = net.lo
sql_cmn_objects = pack.lo client.lo my_time.lo
diff --git a/libmysql/client_settings.h b/libmysql/client_settings.h
index 4bc4bda5b63..a803ff8372f 100644
--- a/libmysql/client_settings.h
+++ b/libmysql/client_settings.h
@@ -14,7 +14,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
extern uint mysql_port;
-extern my_string mysql_unix_port;
+extern char * mysql_unix_port;
#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | \
CLIENT_TRANSACTIONS | \
@@ -42,7 +42,7 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename);
void mysql_read_default_options(struct st_mysql_options *options,
const char *filename,const char *group);
void mysql_detach_stmt_list(LIST **stmt_list, const char *func_name);
-MYSQL *
+MYSQL * STDCALL
cli_mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
const char *passwd, const char *db,
uint port, const char *unix_socket,ulong client_flag);
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 374676ebe32..74435a1eb57 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -67,8 +67,6 @@
ulong net_buffer_length=8192;
ulong max_allowed_packet= 1024L*1024L*1024L;
-ulong net_read_timeout= CLIENT_NET_READ_TIMEOUT;
-ulong net_write_timeout= CLIENT_NET_WRITE_TIMEOUT;
#ifdef EMBEDDED_LIBRARY
@@ -170,8 +168,23 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)),
}
+/*
+ Free all memory and resources used by the client library
+
+ NOTES
+ When calling this there should not be any other threads using
+ the library.
+
+ To make things simpler when used with windows dll's (which calls this
+ function automaticly), it's safe to call this function multiple times.
+*/
+
+
void STDCALL mysql_server_end()
{
+ if (!mysql_client_init)
+ return;
+
#ifdef EMBEDDED_LIBRARY
end_embedded_server();
#endif
@@ -202,7 +215,7 @@ void STDCALL mysql_server_end()
}
static MYSQL_PARAMETERS mysql_internal_parameters=
-{&max_allowed_packet, &net_buffer_length};
+{&max_allowed_packet, &net_buffer_length, 0};
MYSQL_PARAMETERS *STDCALL mysql_get_parameters(void)
{
@@ -328,7 +341,7 @@ my_bool STDCALL mysql_master_send_query(MYSQL *mysql, const char *q,
DBUG_RETURN(1);
master->reconnect= 1;
mysql->last_used_con = master;
- DBUG_RETURN(simple_command(master, COM_QUERY, q, length, 1));
+ DBUG_RETURN(simple_command(master, COM_QUERY, (const uchar*) q, length, 1));
}
@@ -362,7 +375,8 @@ my_bool STDCALL mysql_slave_send_query(MYSQL *mysql, const char *q,
0,0,0,0))
DBUG_RETURN(1);
slave_to_use->reconnect= 1;
- DBUG_RETURN(simple_command(slave_to_use, COM_QUERY, q, length, 1));
+ DBUG_RETURN(simple_command(slave_to_use, COM_QUERY, (const uchar*) q,
+ length, 1));
}
@@ -625,7 +639,7 @@ mysql_connect(MYSQL *mysql,const char *host,
if (!(res=mysql_real_connect(mysql,host,user,passwd,NullS,0,NullS,0)))
{
if (mysql->free_me)
- my_free((gptr) mysql,MYF(0));
+ my_free((uchar*) mysql,MYF(0));
}
mysql->reconnect= 1;
DBUG_RETURN(res);
@@ -656,7 +670,8 @@ int cli_read_change_user_result(MYSQL *mysql, char *buff, const char *passwd)
password in old format. The reply contains scramble_323.
*/
scramble_323(buff, mysql->scramble, passwd);
- if (my_net_write(net, buff, SCRAMBLE_LENGTH_323 + 1) || net_flush(net))
+ if (my_net_write(net, (uchar*) buff, SCRAMBLE_LENGTH_323 + 1) ||
+ net_flush(net))
{
net->last_errno= CR_SERVER_LOST;
strmov(net->sqlstate, unknown_sqlstate);
@@ -707,7 +722,7 @@ my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user,
end= strmov(end, db ? db : "") + 1;
/* Write authentication package */
- simple_command(mysql,COM_CHANGE_USER, buff,(ulong) (end-buff),1);
+ simple_command(mysql,COM_CHANGE_USER, (uchar*) buff, (ulong) (end-buff), 1);
rc= (*mysql->methods->read_change_user_result)(mysql, buff, passwd);
@@ -817,7 +832,7 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename)
if ((*options->local_infile_init)(&li_ptr, net_filename,
options->local_infile_userdata))
{
- VOID(my_net_write(net,"",0)); /* Server needs one packet */
+ VOID(my_net_write(net,(const uchar*) "",0)); /* Server needs one packet */
net_flush(net);
strmov(net->sqlstate, unknown_sqlstate);
net->last_errno= (*options->local_infile_error)(li_ptr,
@@ -831,7 +846,7 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename)
(*options->local_infile_read)(li_ptr, buf,
packet_length)) > 0)
{
- if (my_net_write(net,buf,readcount))
+ if (my_net_write(net, (uchar*) buf, readcount))
{
DBUG_PRINT("error",
("Lost connection to MySQL server during LOAD DATA of local file"));
@@ -843,7 +858,7 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename)
}
/* Send empty packet to mark end of file */
- if (my_net_write(net,"",0) || net_flush(net))
+ if (my_net_write(net, (const uchar*) "", 0) || net_flush(net))
{
strmov(net->sqlstate, unknown_sqlstate);
net->last_errno=CR_SERVER_LOST;
@@ -946,7 +961,7 @@ static int default_local_infile_read(void *ptr, char *buf, uint buf_len)
int count;
default_local_infile_data*data = (default_local_infile_data *) ptr;
- if ((count= (int) my_read(data->fd, (byte *) buf, buf_len, MYF(0))) < 0)
+ if ((count= (int) my_read(data->fd, (uchar *) buf, buf_len, MYF(0))) < 0)
{
data->error_num= EE_READ; /* the errmsg for not entire file read */
my_snprintf(data->error_msg, sizeof(data->error_msg)-1,
@@ -1229,7 +1244,8 @@ mysql_list_fields(MYSQL *mysql, const char *table, const char *wild)
end=strmake(strmake(buff, table,128)+1,wild ? wild : "",128);
free_old_query(mysql);
- if (simple_command(mysql,COM_FIELD_LIST,buff,(ulong) (end-buff),1) ||
+ if (simple_command(mysql, COM_FIELD_LIST, (uchar*) buff,
+ (ulong) (end-buff), 1) ||
!(fields= (*mysql->methods->list_fields)(mysql)))
DBUG_RETURN(NULL);
@@ -1300,7 +1316,7 @@ mysql_shutdown(MYSQL *mysql, enum mysql_enum_shutdown_level shutdown_level)
uchar level[1];
DBUG_ENTER("mysql_shutdown");
level[0]= (uchar) shutdown_level;
- DBUG_RETURN(simple_command(mysql, COM_SHUTDOWN, (char *)level, 1, 0));
+ DBUG_RETURN(simple_command(mysql, COM_SHUTDOWN, level, 1, 0));
}
@@ -1310,14 +1326,14 @@ mysql_refresh(MYSQL *mysql,uint options)
uchar bits[1];
DBUG_ENTER("mysql_refresh");
bits[0]= (uchar) options;
- DBUG_RETURN(simple_command(mysql,COM_REFRESH,(char*) bits,1,0));
+ DBUG_RETURN(simple_command(mysql, COM_REFRESH, bits, 1, 0));
}
int STDCALL
mysql_kill(MYSQL *mysql,ulong pid)
{
- char buff[4];
+ uchar buff[4];
DBUG_ENTER("mysql_kill");
int4store(buff,pid);
DBUG_RETURN(simple_command(mysql,COM_PROCESS_KILL,buff,sizeof(buff),0));
@@ -1327,7 +1343,7 @@ mysql_kill(MYSQL *mysql,ulong pid)
int STDCALL
mysql_set_server_option(MYSQL *mysql, enum enum_mysql_set_option option)
{
- char buff[2];
+ uchar buff[2];
DBUG_ENTER("mysql_set_server_option");
int2store(buff, (uint) option);
DBUG_RETURN(simple_command(mysql, COM_SET_OPTION, buff, sizeof(buff), 0));
@@ -1522,8 +1538,8 @@ my_bool STDCALL mysql_embedded(void)
void my_net_local_init(NET *net)
{
net->max_packet= (uint) net_buffer_length;
- net->read_timeout= (uint) net_read_timeout;
- net->write_timeout=(uint) net_write_timeout;
+ my_net_set_read_timeout(net, CLIENT_NET_READ_TIMEOUT);
+ my_net_set_write_timeout(net, CLIENT_NET_WRITE_TIMEOUT);
net->retry_count= 1;
net->max_packet_size= max(net_buffer_length, max_allowed_packet);
}
@@ -2046,7 +2062,7 @@ mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length)
if ((int) stmt->state > (int) MYSQL_STMT_INIT_DONE)
{
/* This is second prepare with another statement */
- char buff[MYSQL_STMT_HEADER]; /* 4 bytes - stmt id */
+ uchar buff[MYSQL_STMT_HEADER]; /* 4 bytes - stmt id */
if (reset_stmt_handle(stmt, RESET_LONG_DATA | RESET_STORE_RESULT))
DBUG_RETURN(1);
@@ -2076,7 +2092,7 @@ mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length)
}
}
- if (stmt_command(mysql, COM_STMT_PREPARE, query, length, stmt))
+ if (stmt_command(mysql, COM_STMT_PREPARE, (const uchar*) query, length, stmt))
{
set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno,
mysql->net.sqlstate);
@@ -2412,9 +2428,9 @@ static void store_param_str(NET *net, MYSQL_BIND *param)
{
/* param->length is always set in mysql_stmt_bind_param */
ulong length= *param->length;
- char *to= (char *) net_store_length((char *) net->write_pos, length);
+ uchar *to= net_store_length(net->write_pos, length);
memcpy(to, param->buffer, length);
- net->write_pos= (uchar*) to+length;
+ net->write_pos= to+length;
}
@@ -2482,10 +2498,9 @@ static my_bool execute(MYSQL_STMT *stmt, char *packet, ulong length)
{
MYSQL *mysql= stmt->mysql;
NET *net= &mysql->net;
- char buff[4 /* size of stmt id */ +
- 5 /* execution flags */];
+ uchar buff[4 /* size of stmt id */ +
+ 5 /* execution flags */];
my_bool res;
-
DBUG_ENTER("execute");
DBUG_DUMP("packet", packet, length);
@@ -2495,7 +2510,7 @@ static my_bool execute(MYSQL_STMT *stmt, char *packet, ulong length)
int4store(buff+5, 1); /* iteration count */
res= test(cli_advanced_command(mysql, COM_STMT_EXECUTE, buff, sizeof(buff),
- packet, length, 1, NULL) ||
+ (uchar*) packet, length, 1, NULL) ||
(*mysql->methods->read_query_result)(mysql));
stmt->affected_rows= mysql->affected_rows;
stmt->server_status= mysql->server_status;
@@ -2574,7 +2589,7 @@ int cli_stmt_execute(MYSQL_STMT *stmt)
}
length= (ulong) (net->write_pos - net->buff);
/* TODO: Look into avoding the following memdup */
- if (!(param_data= my_memdup((const char*) net->buff, length, MYF(0))))
+ if (!(param_data= my_memdup(net->buff, length, MYF(0))))
{
set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate);
DBUG_RETURN(1);
@@ -2701,8 +2716,8 @@ stmt_read_row_from_cursor(MYSQL_STMT *stmt, unsigned char **row)
MYSQL *mysql= stmt->mysql;
NET *net= &mysql->net;
MYSQL_DATA *result= &stmt->result;
- char buff[4 /* statement id */ +
- 4 /* number of rows to fetch */];
+ uchar buff[4 /* statement id */ +
+ 4 /* number of rows to fetch */];
free_root(&result->alloc, MYF(MY_KEEP_PREALLOC));
result->data= NULL;
@@ -2711,7 +2726,7 @@ stmt_read_row_from_cursor(MYSQL_STMT *stmt, unsigned char **row)
int4store(buff, stmt->stmt_id);
int4store(buff + 4, stmt->prefetch_rows); /* number of rows to fetch */
if ((*mysql->methods->advanced_command)(mysql, COM_STMT_FETCH,
- buff, sizeof(buff), NullS, 0,
+ buff, sizeof(buff), (uchar*) 0, 0,
1, NULL))
{
set_stmt_errmsg(stmt, net->last_error, net->last_errno, net->sqlstate);
@@ -3367,7 +3382,7 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number,
{
MYSQL *mysql= stmt->mysql;
/* Packet header: stmt id (4 bytes), param no (2 bytes) */
- char buff[MYSQL_LONG_DATA_HEADER];
+ uchar buff[MYSQL_LONG_DATA_HEADER];
int4store(buff, stmt->stmt_id);
int2store(buff + 4, param_number);
@@ -3378,7 +3393,7 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number,
This is intentional to save bandwidth.
*/
if ((*mysql->methods->advanced_command)(mysql, COM_STMT_SEND_LONG_DATA,
- buff, sizeof(buff), data,
+ buff, sizeof(buff), (uchar*) data,
length, 1, NULL))
{
set_stmt_errmsg(stmt, mysql->net.last_error,
@@ -3659,33 +3674,38 @@ static void fetch_long_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
case MYSQL_TYPE_FLOAT:
{
/*
- We need to store data in the buffer before the truncation check to
+ We need to mark the local variable volatile to
workaround Intel FPU executive precision feature.
(See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=323 for details)
- AFAIU it does not guarantee to work.
*/
- float data;
+ volatile float data;
if (is_unsigned)
+ {
data= (float) ulonglong2double(value);
+ *param->error= ((ulonglong) value) != ((ulonglong) data);
+ }
else
- data= (float) value;
+ {
+ data= (float)value;
+ *param->error= value != ((longlong) data);
+ }
floatstore(buffer, data);
- *param->error= is_unsigned ?
- ((ulonglong) value) != ((ulonglong) (*(float*) buffer)) :
- ((longlong) value) != ((longlong) (*(float*) buffer));
break;
}
case MYSQL_TYPE_DOUBLE:
{
- double data;
+ volatile double data;
if (is_unsigned)
+ {
data= ulonglong2double(value);
+ *param->error= ((ulonglong) value) != ((ulonglong) data);
+ }
else
+ {
data= (double)value;
+ *param->error= value != ((longlong) data);
+ }
doublestore(buffer, data);
- *param->error= is_unsigned ?
- ((ulonglong) value) != ((ulonglong) (*(double*) buffer)) :
- ((longlong) value) != ((longlong) (*(double*) buffer));
break;
}
case MYSQL_TYPE_TIME:
@@ -3701,19 +3721,20 @@ static void fetch_long_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
}
default:
{
- char buff[22]; /* Enough for longlong */
- char *end= longlong10_to_str(value, buff, is_unsigned ? 10: -10);
+ uchar buff[22]; /* Enough for longlong */
+ uchar *end= (uchar*) longlong10_to_str(value, (char*) buff,
+ is_unsigned ? 10: -10);
/* Resort to string conversion which supports all typecodes */
uint length= (uint) (end-buff);
if (field->flags & ZEROFILL_FLAG && length < field->length &&
field->length < 21)
{
- bmove_upp((char*) buff+field->length,buff+length, length);
- bfill((char*) buff, field->length - length,'0');
+ bmove_upp(buff+field->length,buff+length, length);
+ bfill(buff, field->length - length,'0');
length= field->length;
}
- fetch_string_with_conversion(param, buff, length);
+ fetch_string_with_conversion(param, (char*) buff, length);
break;
}
}
@@ -4539,7 +4560,7 @@ static int stmt_fetch_row(MYSQL_STMT *stmt, uchar *row)
}
if (!((bit<<=1) & 255))
{
- bit= 1; /* To next byte */
+ bit= 1; /* To next uchar */
null_ptr++;
}
}
@@ -4655,9 +4676,17 @@ int cli_read_binary_rows(MYSQL_STMT *stmt)
MYSQL *mysql= stmt->mysql;
MYSQL_DATA *result= &stmt->result;
MYSQL_ROWS *cur, **prev_ptr= &result->data;
- NET *net = &mysql->net;
+ NET *net;
+
DBUG_ENTER("cli_read_binary_rows");
+
+ if (!mysql)
+ {
+ set_stmt_error(stmt, CR_SERVER_LOST, unknown_sqlstate);
+ DBUG_RETURN(1);
+ }
+ net = &mysql->net;
mysql= mysql->last_used_con;
while ((pkt_len= cli_safe_read(mysql)) != packet_error)
@@ -4732,7 +4761,7 @@ static void stmt_update_metadata(MYSQL_STMT *stmt, MYSQL_ROWS *data)
DBUG_ASSERT(row <= row_end);
if (!((bit<<=1) & 255))
{
- bit= 1; /* To next byte */
+ bit= 1; /* To next uchar */
null_ptr++;
}
}
@@ -4767,14 +4796,14 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt)
Server side cursor exist, tell server to start sending the rows
*/
NET *net= &mysql->net;
- char buff[4 /* statement id */ +
- 4 /* number of rows to fetch */];
+ uchar buff[4 /* statement id */ +
+ 4 /* number of rows to fetch */];
/* Send row request to the server */
int4store(buff, stmt->stmt_id);
int4store(buff + 4, (int)~0); /* number of rows to fetch */
if (cli_advanced_command(mysql, COM_STMT_FETCH, buff, sizeof(buff),
- NullS, 0, 1, NULL))
+ (uchar*) 0, 0, 1, NULL))
{
set_stmt_errmsg(stmt, net->last_error, net->last_errno, net->sqlstate);
DBUG_RETURN(1);
@@ -4921,7 +4950,7 @@ static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags)
Reset stored result set if so was requested or it's a part
of cursor fetch.
*/
- if (result->data && (flags & RESET_STORE_RESULT))
+ if (flags & RESET_STORE_RESULT)
{
/* Result buffered */
free_root(&result->alloc, MYF(MY_KEEP_PREALLOC));
@@ -4958,7 +4987,7 @@ static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags)
Reset the server side statement and close the server side
cursor if it exists.
*/
- char buff[MYSQL_STMT_HEADER]; /* packet header: 4 bytes for stmt id */
+ uchar buff[MYSQL_STMT_HEADER]; /* packet header: 4 bytes for stmt id */
int4store(buff, stmt->stmt_id);
if ((*mysql->methods->advanced_command)(mysql, COM_STMT_RESET, buff,
sizeof(buff), 0, 0, 0, NULL))
@@ -5019,7 +5048,7 @@ my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt)
net_clear_error(&mysql->net);
if ((int) stmt->state > (int) MYSQL_STMT_INIT_DONE)
{
- char buff[MYSQL_STMT_HEADER]; /* 4 bytes - stmt id */
+ uchar buff[MYSQL_STMT_HEADER]; /* 4 bytes - stmt id */
if (mysql->unbuffered_fetch_owner == &stmt->unbuffered_fetch_cancelled)
mysql->unbuffered_fetch_owner= 0;
@@ -5043,7 +5072,7 @@ my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt)
}
}
- my_free((gptr) stmt, MYF(MY_WME));
+ my_free((uchar*) stmt, MYF(MY_WME));
DBUG_RETURN(test(rc));
}
diff --git a/libmysql/manager.c b/libmysql/manager.c
index a88c63123b0..53ffffa55c0 100644
--- a/libmysql/manager.c
+++ b/libmysql/manager.c
@@ -158,7 +158,7 @@ MYSQL_MANAGER* STDCALL mysql_manager_connect(MYSQL_MANAGER* con,
}
sprintf(msg_buf,"%-.16s %-.16s\n",user,passwd);
msg_len=strlen(msg_buf);
- if (my_net_write(&con->net,msg_buf,msg_len) || net_flush(&con->net))
+ 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");
@@ -206,10 +206,10 @@ void STDCALL mysql_manager_close(MYSQL_MANAGER* con)
allocated in my_multimalloc() along with con->host, freeing
con->hosts frees the whole block
*/
- my_free((gptr)con->host,MYF(MY_ALLOW_ZERO_PTR));
+ my_free((uchar*)con->host,MYF(MY_ALLOW_ZERO_PTR));
net_end(&con->net);
if (con->free_me)
- my_free((gptr)con,MYF(0));
+ my_free((uchar*)con,MYF(0));
}
@@ -218,7 +218,7 @@ int STDCALL mysql_manager_command(MYSQL_MANAGER* con,const char* cmd,
{
if (!cmd_len)
cmd_len=strlen(cmd);
- if (my_net_write(&con->net,(char*)cmd,cmd_len) || net_flush(&con->net))
+ 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");
diff --git a/libmysql_r/Makefile.am b/libmysql_r/Makefile.am
index a8014b37bed..2ff4082b014 100644
--- a/libmysql_r/Makefile.am
+++ b/libmysql_r/Makefile.am
@@ -29,11 +29,10 @@ INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
## automake barfs if you don't use $(srcdir) or $(top_srcdir) in include
include $(top_srcdir)/libmysql/Makefile.shared
-libmysqlclient_r_la_SOURCES = $(target_sources)
+nodist_libmysqlclient_r_la_SOURCES = $(target_sources)
libmysqlclient_r_la_LIBADD = $(target_libadd) $(yassl_las)
libmysqlclient_r_la_LDFLAGS = $(target_ldflags)
-# This is called from the toplevel makefile
link_sources:
set -x; \
for d in $(top_srcdir)/libmysql $(top_builddir)/libmysql; do \
diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt
index 8a855ebdbf5..fb3316c303c 100644
--- a/libmysqld/CMakeLists.txt
+++ b/libmysqld/CMakeLists.txt
@@ -18,89 +18,191 @@ 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.
-ADD_DEFINITIONS(-DUSE_TLS -DMYSQL_SERVER -DEMBEDDED_LIBRARY)
+IF(WIN32)
+ ADD_DEFINITIONS(-DUSE_TLS)
+ENDIF(WIN32)
-# The old Windows build method used renamed (.cc -> .cpp) source files, fails
-# in #include in lib_sql.cc. So disable that using the USING_CMAKE define.
-ADD_DEFINITIONS(-DUSING_CMAKE)
+ADD_DEFINITIONS(-DMYSQL_SERVER -DEMBEDDED_LIBRARY)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
- ${CMAKE_SOURCE_DIR}/libmysqld
- ${CMAKE_SOURCE_DIR}/libmysql
+ ${CMAKE_SOURCE_DIR}/libmysqld
+ ${CMAKE_SOURCE_DIR}/libmysql
${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/extra/yassl/include
- ${CMAKE_SOURCE_DIR}/zlib
-)
+ ${CMAKE_SOURCE_DIR}/zlib)
-SET_SOURCE_FILES_PROPERTIES(${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
- ${PROJECT_SOURCE_DIR}/sql/sql_yacc.h
- PROPERTIES GENERATED 1)
-
-ADD_LIBRARY(mysqldemb emb_qcache.cc libmysqld.c lib_sql.cc
- ../client/get_password.c ../libmysql/errmsg.c
- ../libmysql/libmysql.c ../sql/password.c ../sql-common/client.c
- ../sql-common/my_time.c ../sql-common/my_user.c
- ../sql-common/pack.c ../sql/derror.cc ../sql/event_scheduler.cc
- ../sql/event_timed.cc ../sql/events.cc ../sql/discover.cc
- ../sql/field_conv.cc ../sql/field.cc ../sql/filesort.cc
- ../sql/gstream.cc ${mysql_se_ha_src}
- ../sql/handler.cc ../sql/hash_filo.cc
- ../sql/hostname.cc ../sql/init.cc ../sql/item_buff.cc
- ../sql/item_cmpfunc.cc ../sql/item.cc ../sql/item_create.cc
- ../sql/item_func.cc ../sql/item_geofunc.cc ../sql/item_row.cc
- ../sql/item_strfunc.cc ../sql/item_subselect.cc ../sql/item_sum.cc
- ../sql/item_timefunc.cc ../sql/item_uniq.cc ../sql/item_xmlfunc.cc
- ../sql/key.cc ../sql/lock.cc ../sql/log.cc ../sql/log_event.cc
- ../sql/mf_iocache.cc ../sql/my_decimal.cc ../sql/net_serv.cc
- ../sql/opt_range.cc ../sql/opt_sum.cc ../sql/parse_file.cc
- ../sql/procedure.cc ../sql/protocol.cc ../sql/records.cc
- ../sql/repl_failsafe.cc ../sql/rpl_filter.cc ../sql/set_var.cc
- ../sql/spatial.cc ../sql/sp_cache.cc ../sql/sp.cc
- ../sql/sp_head.cc ../sql/sp_pcontext.cc ../sql/sp_rcontext.cc
- ../sql/sql_acl.cc ../sql/sql_analyse.cc ../sql/sql_base.cc
- ../sql/sql_cache.cc ../sql/sql_class.cc ../sql/sql_crypt.cc
- ../sql/sql_cursor.cc ../sql/sql_db.cc ../sql/sql_delete.cc
- ../sql/sql_derived.cc ../sql/sql_do.cc ../sql/sql_error.cc
- ../sql/sql_handler.cc ../sql/sql_help.cc ../sql/sql_insert.cc
- ../sql/sql_lex.cc ../sql/sql_list.cc ../sql/sql_load.cc
- ../sql/sql_manager.cc ../sql/sql_map.cc ../sql/sql_parse.cc
- ../sql/sql_partition.cc ../sql/sql_plugin.cc ../sql/sql_prepare.cc
- ../sql/sql_rename.cc ../sql/sql_repl.cc ../sql/sql_select.cc
- ../sql/sql_show.cc ../sql/sql_state.c ../sql/sql_string.cc
- ../sql/sql_tablespace.cc ../sql/sql_table.cc ../sql/sql_test.cc
- ../sql/sql_trigger.cc ../sql/sql_udf.cc ../sql/sql_union.cc
- ../sql/sql_update.cc ../sql/sql_view.cc
- ../sql/strfunc.cc ../sql/table.cc ../sql/thr_malloc.cc
- ../sql/time.cc ../sql/tztime.cc ../sql/uniques.cc ../sql/unireg.cc
- ../sql/partition_info.cc ../sql/sql_locale.cc
- ../sql/sql_connect.cc ../sql/scheduler.cc
- ../vio/vio.c ../vio/viosocket.c ../vio/viossl.c
- ../vio/viosslfactories.c
- ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
- ${PROJECT_SOURCE_DIR}/sql/sql_yacc.h)
+SET(GEN_SOURCES ${CMAKE_SOURCE_DIR}/sql/sql_yacc.cc
+ ${CMAKE_SOURCE_DIR}/sql/sql_yacc.h
+ ${CMAKE_SOURCE_DIR}/sql/message.h
+ ${CMAKE_SOURCE_DIR}/sql/message.rc
+ ${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc
+ ${CMAKE_SOURCE_DIR}/sql/lex_hash.h)
-# Seems we cannot make a library without at least one source file. So use a
-# dummy empty file
-FILE(WRITE cmake_dummy.c " ")
+SET_SOURCE_FILES_PROPERTIES(${GEN_SOURCES} PROPERTIES GENERATED 1)
+
+# Include and add the directory path
+SET(SOURCE_SUBLIBS TRUE)
+SET(LIB_SOURCES "")
+
+INCLUDE(${CMAKE_SOURCE_DIR}/zlib/CMakeLists.txt)
+FOREACH(rpath ${ZLIB_SOURCES})
+ SET(LIB_SOURCES ${LIB_SOURCES} ../zlib/${rpath})
+ENDFOREACH(rpath)
+
+# FIXME only needed if build type is "Debug", but CMAKE_BUILD_TYPE is
+# not set during configure time.
+INCLUDE(${CMAKE_SOURCE_DIR}/dbug/CMakeLists.txt)
+FOREACH(rpath ${DBUG_SOURCES})
+ SET(LIB_SOURCES ${LIB_SOURCES} ../dbug/${rpath})
+ENDFOREACH(rpath)
+
+INCLUDE(${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/CMakeLists.txt)
+FOREACH(rpath ${TAOCRYPT_SOURCES})
+ SET(LIB_SOURCES ${LIB_SOURCES} ../extra/yassl/taocrypt/${rpath})
+ENDFOREACH(rpath)
+
+INCLUDE(${CMAKE_SOURCE_DIR}/extra/yassl/CMakeLists.txt)
+FOREACH(rpath ${YASSL_SOURCES})
+ SET(LIB_SOURCES ${LIB_SOURCES} ../extra/yassl/${rpath})
+ENDFOREACH(rpath)
+
+INCLUDE(${CMAKE_SOURCE_DIR}/strings/CMakeLists.txt)
+FOREACH(rpath ${STRINGS_SOURCES})
+ SET(LIB_SOURCES ${LIB_SOURCES} ../strings/${rpath})
+ENDFOREACH(rpath)
+
+INCLUDE(${CMAKE_SOURCE_DIR}/regex/CMakeLists.txt)
+FOREACH(rpath ${REGEX_SOURCES})
+ SET(LIB_SOURCES ${LIB_SOURCES} ../regex/${rpath})
+ENDFOREACH(rpath)
+
+INCLUDE(${CMAKE_SOURCE_DIR}/mysys/CMakeLists.txt)
+FOREACH(rpath ${MYSYS_SOURCES})
+ SET(LIB_SOURCES ${LIB_SOURCES} ../mysys/${rpath})
+ENDFOREACH(rpath)
+
+INCLUDE(${CMAKE_SOURCE_DIR}/vio/CMakeLists.txt)
+FOREACH(rpath ${VIO_SOURCES})
+ SET(LIB_SOURCES ${LIB_SOURCES} ../vio/${rpath})
+ENDFOREACH(rpath)
+
+# Engines
+INCLUDE(${CMAKE_SOURCE_DIR}/storage/heap/CMakeLists.txt)
+FOREACH(rpath ${HEAP_SOURCES})
+ SET(LIB_SOURCES ${LIB_SOURCES} ../storage/heap/${rpath})
+ENDFOREACH(rpath)
+
+INCLUDE(${CMAKE_SOURCE_DIR}/storage/myisam/CMakeLists.txt)
+FOREACH(rpath ${MYISAM_SOURCES})
+ SET(LIB_SOURCES ${LIB_SOURCES} ../storage/myisam/${rpath})
+ENDFOREACH(rpath)
+
+INCLUDE(${CMAKE_SOURCE_DIR}/storage/myisammrg/CMakeLists.txt)
+FOREACH(rpath ${MYISAMMRG_SOURCES})
+ SET(LIB_SOURCES ${LIB_SOURCES} ../storage/myisammrg/${rpath})
+ENDFOREACH(rpath)
-ADD_LIBRARY(mysqlserver cmake_dummy.c)
-TARGET_LINK_LIBRARIES(mysqlserver wsock32)
-ADD_DEPENDENCIES(mysqlserver dbug mysys strings zlib mysqldemb regex myisam myisammrg
- heap yassl taocrypt)
IF(WITH_ARCHIVE_STORAGE_ENGINE)
- ADD_DEPENDENCIES(mysqlserver archive)
+ INCLUDE(${CMAKE_SOURCE_DIR}/storage/archive/CMakeLists.txt)
+ FOREACH(rpath ${ARCHIVE_SOURCES})
+ SET(LIB_SOURCES ${LIB_SOURCES} ../storage/archive/${rpath})
+ ENDFOREACH(rpath)
ENDIF(WITH_ARCHIVE_STORAGE_ENGINE)
+
+IF(WITH_BLACKHOLE_STORAGE_ENGINE)
+ INCLUDE(${CMAKE_SOURCE_DIR}/storage/blackhole/CMakeLists.txt)
+ FOREACH(rpath ${BLACKHOLE_SOURCES})
+ SET(LIB_SOURCES ${LIB_SOURCES} ../storage/blackhole/${rpath})
+ ENDFOREACH(rpath)
+ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE)
+
IF(WITH_EXAMPLE_STORAGE_ENGINE)
- ADD_DEPENDENCIES(mysqlserver example)
+ INCLUDE(${CMAKE_SOURCE_DIR}/storage/example/CMakeLists.txt)
+ FOREACH(rpath ${EXAMPLE_SOURCES})
+ SET(LIB_SOURCES ${LIB_SOURCES} ../storage/example/${rpath})
+ ENDFOREACH(rpath)
ENDIF(WITH_EXAMPLE_STORAGE_ENGINE)
+
IF(WITH_FEDERATED_STORAGE_ENGINE)
- ADD_DEPENDENCIES(mysqlserver federated)
+ INCLUDE(${CMAKE_SOURCE_DIR}/storage/federated/CMakeLists.txt)
+ FOREACH(rpath ${FEDERATED_SOURCES})
+ SET(LIB_SOURCES ${LIB_SOURCES} ../storage/federated/${rpath})
+ ENDFOREACH(rpath)
ENDIF(WITH_FEDERATED_STORAGE_ENGINE)
+
IF(WITH_INNOBASE_STORAGE_ENGINE)
- ADD_DEPENDENCIES(mysqlserver innobase)
+ INCLUDE(${CMAKE_SOURCE_DIR}/storage/innobase/CMakeLists.txt)
+ FOREACH(rpath ${INNOBASE_SOURCES})
+ SET(LIB_SOURCES ${LIB_SOURCES} ../storage/innobase/${rpath})
+ ENDFOREACH(rpath)
ENDIF(WITH_INNOBASE_STORAGE_ENGINE)
+IF(WITH_CSV_STORAGE_ENGINE)
+ INCLUDE(${CMAKE_SOURCE_DIR}/storage/csv/CMakeLists.txt)
+ FOREACH(rpath ${CSV_SOURCES})
+ SET(LIB_SOURCES ${LIB_SOURCES} ../storage/csv/${rpath})
+ ENDFOREACH(rpath)
+ENDIF(WITH_CSV_STORAGE_ENGINE)
+
+SET(SOURCE_SUBLIBS FALSE)
+
+SET(LIBMYSQLD_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
+ ../libmysql/libmysql.c ../libmysql/errmsg.c ../client/get_password.c
+ ../sql-common/client.c ../sql-common/my_time.c
+ ../sql-common/my_user.c ../sql-common/pack.c
+ ../sql/password.c ../sql/discover.cc ../sql/derror.cc
+ ../sql/event_scheduler.cc ../sql/events.cc
+ ../sql/event_data_objects.cc ../sql/event_queue.cc
+ ../sql/event_db_repository.cc ../sql/field.cc ../sql/field_conv.cc
+ ../sql/filesort.cc ../sql/gstream.cc ../sql/ha_partition.cc
+ ../sql/handler.cc ../sql/hash_filo.cc ../sql/hostname.cc
+ ../sql/init.cc ../sql/item_buff.cc ../sql/item_cmpfunc.cc
+ ../sql/item.cc ../sql/item_create.cc ../sql/item_func.cc
+ ../sql/item_geofunc.cc ../sql/item_row.cc ../sql/item_strfunc.cc
+ ../sql/item_subselect.cc ../sql/item_sum.cc ../sql/item_timefunc.cc
+ ../sql/item_xmlfunc.cc ../sql/key.cc ../sql/lock.cc ../sql/log.cc
+ ../sql/log_event.cc ../sql/mf_iocache.cc ../sql/my_decimal.cc
+ ../sql/net_serv.cc ../sql/opt_range.cc ../sql/opt_sum.cc
+ ../sql/parse_file.cc ../sql/procedure.cc ../sql/protocol.cc
+ ../sql/records.cc ../sql/repl_failsafe.cc ../sql/rpl_filter.cc
+ ../sql/rpl_record.cc
+ ../sql/rpl_injector.cc ../sql/set_var.cc ../sql/spatial.cc
+ ../sql/sp_cache.cc ../sql/sp.cc ../sql/sp_head.cc
+ ../sql/sp_pcontext.cc ../sql/sp_rcontext.cc ../sql/sql_acl.cc
+ ../sql/sql_analyse.cc ../sql/sql_base.cc ../sql/sql_cache.cc
+ ../sql/sql_class.cc ../sql/sql_crypt.cc ../sql/sql_cursor.cc
+ ../sql/sql_db.cc ../sql/sql_delete.cc ../sql/sql_derived.cc
+ ../sql/sql_do.cc ../sql/sql_error.cc ../sql/sql_handler.cc
+ ../sql/sql_help.cc ../sql/sql_insert.cc ../sql/sql_lex.cc
+ ../sql/sql_list.cc ../sql/sql_load.cc ../sql/sql_locale.cc
+ ../sql/sql_binlog.cc ../sql/sql_manager.cc ../sql/sql_map.cc
+ ../sql/sql_parse.cc ../sql/sql_partition.cc ../sql/sql_plugin.cc
+ ../sql/sql_prepare.cc ../sql/sql_rename.cc ../sql/sql_repl.cc
+ ../sql/sql_select.cc ../sql/sql_servers.cc
+ ../sql/sql_show.cc ../sql/sql_state.c ../sql/sql_string.cc
+ ../sql/sql_tablespace.cc ../sql/sql_table.cc ../sql/sql_test.cc
+ ../sql/sql_trigger.cc ../sql/sql_udf.cc ../sql/sql_union.cc
+ ../sql/sql_update.cc ../sql/sql_view.cc
+ ../sql/strfunc.cc ../sql/table.cc ../sql/thr_malloc.cc
+ ../sql/time.cc ../sql/tztime.cc ../sql/uniques.cc ../sql/unireg.cc
+ ../sql/partition_info.cc ../sql/sql_connect.cc
+ ../sql/scheduler.cc
+ ${GEN_SOURCES}
+ ${LIB_SOURCES})
+
+# Seems we cannot make a library without at least one source file. So use a
+# dummy empty file
+FILE(WRITE cmake_dummy.c " ")
+
+# Tried use the correct ${GEN_SOURCES} as dependency, worked on Unix
+# but not on Windows and Visual Studio generators. Likely because they
+# are no real targets from the Visual Studio project files view. Added
+# custom targets to "sql/CMakeLists.txt" and reference them here.
+ADD_LIBRARY(mysqlserver STATIC ${LIBMYSQLD_SOURCES})
+ADD_DEPENDENCIES(mysqlserver GenServerSource GenError)
+TARGET_LINK_LIBRARIES(mysqlserver)
+
ADD_LIBRARY(libmysqld MODULE cmake_dummy.c libmysqld.def)
-TARGET_LINK_LIBRARIES(libmysqld wsock32)
ADD_DEPENDENCIES(libmysqld mysqlserver)
+TARGET_LINK_LIBRARIES(libmysqld mysqlserver wsock32)
diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am
index 1b3207bac17..5d673bb340e 100644
--- a/libmysqld/Makefile.am
+++ b/libmysqld/Makefile.am
@@ -22,7 +22,7 @@ MYSQLSHAREdir = $(pkgdatadir)
MYSQLBASEdir= $(prefix)
MYSQLLIBdir= $(libdir)
-EXTRA_DIST = libmysqld.def
+EXTRA_DIST = libmysqld.def CMakeLists.txt
DEFS = -DEMBEDDED_LIBRARY -DMYSQL_SERVER \
-DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
-DDATADIR="\"$(MYSQLDATAdir)\"" \
@@ -79,7 +79,8 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
rpl_injector.cc my_user.c partition_info.cc \
sql_servers.cc
-libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources)
+libmysqld_int_a_SOURCES= $(libmysqld_sources)
+nodist_libmysqld_int_a_SOURCES= $(libmysqlsources) $(sqlsources)
libmysqld_a_SOURCES=
sqlstoragesources = $(EXTRA_libmysqld_a_SOURCES)
@@ -96,6 +97,7 @@ INC_LIB= $(top_builddir)/regex/libregex.a \
$(top_builddir)/strings/libmystrings.a \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/vio/libvio.a \
+ @NDB_SCI_LIBS@ \
@mysql_plugin_libs@ \
$(yassl_inc_libs)
diff --git a/libmysqld/emb_qcache.cc b/libmysqld/emb_qcache.cc
index e6f35aa33a0..17549bfa96b 100644
--- a/libmysqld/emb_qcache.cc
+++ b/libmysqld/emb_qcache.cc
@@ -47,9 +47,9 @@ void Querycache_stream::store_short(ushort s)
cur_data+= 2;
return;
}
- *cur_data= ((byte *)(&s))[0];
+ *cur_data= ((uchar *)(&s))[0];
use_next_block(TRUE);
- *(cur_data++)= ((byte *)(&s))[1];
+ *(cur_data++)= ((uchar *)(&s))[1];
}
void Querycache_stream::store_int(uint i)
@@ -100,7 +100,7 @@ void Querycache_stream::store_ll(ulonglong ll)
}
memcpy(cur_data, &ll, rest_len);
use_next_block(TRUE);
- memcpy(cur_data, ((byte*)&ll)+rest_len, 8-rest_len);
+ memcpy(cur_data, ((uchar*)&ll)+rest_len, 8-rest_len);
cur_data+= 8-rest_len;
}
@@ -165,9 +165,9 @@ ushort Querycache_stream::load_short()
cur_data+= 2;
return result;
}
- ((byte*)&result)[0]= *cur_data;
+ ((uchar*)&result)[0]= *cur_data;
use_next_block(FALSE);
- ((byte*)&result)[1]= *(cur_data++);
+ ((uchar*)&result)[1]= *(cur_data++);
return result;
}
@@ -216,7 +216,7 @@ ulonglong Querycache_stream::load_ll()
}
memcpy(&result, cur_data, rest_len);
use_next_block(FALSE);
- memcpy(((byte*)&result)+rest_len, cur_data, 8-rest_len);
+ memcpy(((uchar*)&result)+rest_len, cur_data, 8-rest_len);
cur_data+= 8-rest_len;
return result;
}
@@ -245,7 +245,7 @@ char *Querycache_stream::load_str(MEM_ROOT *alloc, uint *str_len)
{
char *result;
*str_len= load_int();
- if (!(result= alloc_root(alloc, *str_len + 1)))
+ if (!(result= (char*) alloc_root(alloc, *str_len + 1)))
return 0;
load_str_only(result, *str_len);
return result;
@@ -259,7 +259,7 @@ int Querycache_stream::load_safe_str(MEM_ROOT *alloc, char **str, uint *str_len)
return 0;
}
(*str_len)--;
- if (!(*str= alloc_root(alloc, *str_len + 1)))
+ if (!(*str= (char*) alloc_root(alloc, *str_len + 1)))
return 1;
load_str_only(*str, *str_len);
return 0;
diff --git a/libmysqld/emb_qcache.h b/libmysqld/emb_qcache.h
index 5c5209902a1..6e320fbd967 100644
--- a/libmysqld/emb_qcache.h
+++ b/libmysqld/emb_qcache.h
@@ -15,8 +15,8 @@
class Querycache_stream
{
- byte *cur_data;
- byte *data_end;
+ uchar *cur_data;
+ uchar *data_end;
Query_cache_block *block;
uint headers_len;
public:
@@ -27,7 +27,7 @@ public:
Querycache_stream(Query_cache_block *ini_block, uint ini_headers_len) :
block(ini_block), headers_len(ini_headers_len)
{
- cur_data= ((byte*)block)+headers_len;
+ cur_data= ((uchar*)block)+headers_len;
data_end= cur_data + (block->used-headers_len);
#ifndef DBUG_OFF
first_block= ini_block;
@@ -54,7 +54,7 @@ public:
else
DBUG_ASSERT(block->type == Query_cache_block::RES_CONT);
- cur_data= ((byte*)block)+headers_len;
+ cur_data= ((uchar*)block)+headers_len;
data_end= cur_data + (block->used-headers_len);
}
diff --git a/libmysqld/examples/CMakeLists.txt b/libmysqld/examples/CMakeLists.txt
index b33b4740c93..ee129ff2df0 100644
--- a/libmysqld/examples/CMakeLists.txt
+++ b/libmysqld/examples/CMakeLists.txt
@@ -15,12 +15,24 @@
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/libmysqld/include
+ ${CMAKE_SOURCE_DIR}/regex
+ ${CMAKE_SOURCE_DIR}/zlib
${CMAKE_SOURCE_DIR}/extra/yassl/include)
# Currently does not work with DBUG, there are missing symbols reported.
-ADD_DEFINITIONS(-DDBUG_OFF)
-ADD_EXECUTABLE(test_libmysqld ../../client/completion_hash.cc
+IF(WIN32)
+ ADD_DEFINITIONS(-DUSE_TLS)
+ENDIF(WIN32)
+ADD_EXECUTABLE(mysql_embedded ../../client/completion_hash.cc
../../client/mysql.cc ../../client/readline.cc
../../client/sql_string.cc)
-TARGET_LINK_LIBRARIES(test_libmysqld yassl taocrypt zlib wsock32)
-ADD_DEPENDENCIES(test_libmysqld libmysqld)
+TARGET_LINK_LIBRARIES(mysql_embedded mysys yassl taocrypt zlib debug dbug regex strings wsock32)
+ADD_DEPENDENCIES(mysql_embedded libmysqld)
+
+ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.c)
+TARGET_LINK_LIBRARIES(mysqltest_embedded mysys yassl taocrypt zlib debug dbug regex strings wsock32)
+ADD_DEPENDENCIES(mysqltest_embedded libmysqld)
+
+ADD_EXECUTABLE(mysql_client_test_embedded ../../tests/mysql_client_test.c)
+TARGET_LINK_LIBRARIES(mysql_client_test_embedded debug dbug mysys yassl taocrypt zlib strings wsock32)
+ADD_DEPENDENCIES(mysql_client_test_embedded libmysqld)
diff --git a/libmysqld/examples/Makefile.am b/libmysqld/examples/Makefile.am
index 3e4769c564d..3425b48645f 100644
--- a/libmysqld/examples/Makefile.am
+++ b/libmysqld/examples/Makefile.am
@@ -15,10 +15,11 @@
noinst_PROGRAMS = mysql
bin_PROGRAMS = mysqltest_embedded mysql_client_test_embedded
-client_sources = $(mysqltest_embedded_SOURCES) $(mysql_SOURCES)
-tests_sources = $(mysql_client_test_embedded_SOURCES)
+client_sources = $(nodist_mysqltest_embedded_SOURCES) $(nodist_mysql_SOURCES)
+tests_sources = $(nodist_mysql_client_test_embedded_SOURCES)
BUILT_SOURCES = link_sources
CLEANFILES = $(client_sources) $(tests_sources) $(BUILT_SOURCES)
+EXTRA_DIST = CMakeLists.txt
link_sources:
for f in $(client_sources); do \
@@ -36,18 +37,19 @@ INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir) \
-I$(top_srcdir) -I$(top_srcdir)/client -I$(top_srcdir)/regex \
$(openssl_includes)
LIBS = @LIBS@ @WRAPLIBS@ @CLIENT_LIBS@ $(yassl_libs)
-LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysqld.a @LIBDL@ $(CXXLDFLAGS)
+LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysqld.a @LIBDL@ $(CXXLDFLAGS) \
+ @NDB_SCI_LIBS@
mysqltest_embedded_LINK = $(CXXLINK)
-mysqltest_embedded_SOURCES = mysqltest.c
+nodist_mysqltest_embedded_SOURCES = mysqltest.c
mysqltest_embedded_LDADD = $(LDADD) $(top_builddir)/regex/libregex.a
-mysql_SOURCES = mysql.cc readline.cc completion_hash.cc \
+nodist_mysql_SOURCES = mysql.cc readline.cc completion_hash.cc \
my_readline.h sql_string.h completion_hash.h
mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD)
mysql_client_test_embedded_LINK = $(CXXLINK)
-mysql_client_test_embedded_SOURCES = mysql_client_test.c
+nodist_mysql_client_test_embedded_SOURCES = mysql_client_test.c
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index dbec5bf6bbf..9c26febe627 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -28,11 +28,7 @@ extern "C"
extern unsigned long max_allowed_packet, net_buffer_length;
}
-#if defined(__WIN__) && !defined(USING_CMAKE)
-#include "../sql/mysqld.cpp"
-#else
#include "../sql/mysqld.cc"
-#endif
C_MODE_START
@@ -68,13 +64,13 @@ void embedded_get_error(MYSQL *mysql, MYSQL_DATA *data)
net->last_errno= ei->last_errno;
strmake(net->last_error, ei->info, sizeof(net->last_error));
memcpy(net->sqlstate, ei->sqlstate, sizeof(net->sqlstate));
- my_free((gptr) data, MYF(0));
+ my_free(data, MYF(0));
}
static my_bool
emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
- const char *header, ulong header_length,
- const char *arg, ulong arg_length, my_bool skip_check,
+ const uchar *header, ulong header_length,
+ const uchar *arg, ulong arg_length, my_bool skip_check,
MYSQL_STMT *stmt)
{
my_bool result= 1;
@@ -180,7 +176,7 @@ static MYSQL_FIELD *emb_list_fields(MYSQL *mysql)
res= ((THD*) mysql->thd)->cur_data;
((THD*) mysql->thd)->cur_data= 0;
mysql->field_alloc= res->alloc;
- my_free((gptr) res,MYF(0));
+ my_free(res,MYF(0));
mysql->status= MYSQL_STATUS_READY;
return mysql->fields;
}
@@ -209,7 +205,7 @@ static my_bool emb_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt)
stmt->fields= mysql->fields;
stmt->mem_root= res->alloc;
mysql->fields= NULL;
- my_free((gptr) res,MYF(0));
+ my_free(res,MYF(0));
}
return 0;
@@ -265,7 +261,7 @@ static my_bool emb_read_query_result(MYSQL *mysql)
thd->cur_data= res;
}
else
- my_free((gptr) res, MYF(0));
+ my_free(res, MYF(0));
return 0;
}
@@ -273,7 +269,7 @@ static my_bool emb_read_query_result(MYSQL *mysql)
static int emb_stmt_execute(MYSQL_STMT *stmt)
{
DBUG_ENTER("emb_stmt_execute");
- char header[5];
+ uchar header[5];
THD *thd;
my_bool res;
@@ -568,10 +564,21 @@ void init_embedded_mysql(MYSQL *mysql, int client_flag)
init_alloc_root(&mysql->field_alloc, 8192, 0);
}
+/**
+ @brief Initialize a new THD for a connection in the embedded server
+
+ @param client_flag Client capabilities which this thread supports
+ @return pointer to the created THD object
+
+ @todo
+ This function copies code from several places in the server, including
+ create_new_thread(), and prepare_new_connection_state(). This should
+ be refactored to avoid code duplication.
+*/
void *create_embedded_thd(int client_flag)
{
THD * thd= new THD;
- thd->thread_id= thread_id++;
+ thd->thread_id= thd->variables.pseudo_thread_id= thread_id++;
thd->thread_stack= (char*) &thd;
if (thd->store_globals())
@@ -1063,22 +1070,22 @@ bool Protocol_text::store_null()
return false;
}
-bool Protocol::net_store_data(const char *from, uint length)
+bool Protocol::net_store_data(const uchar *from, size_t length)
{
char *field_buf;
if (!thd->mysql) // bootstrap file handling
- return false;
+ return FALSE;
- if (!(field_buf=alloc_root(alloc, length + sizeof(uint) + 1)))
- return true;
+ if (!(field_buf= (char*) alloc_root(alloc, length + sizeof(uint) + 1)))
+ return TRUE;
*(uint *)field_buf= length;
*next_field= field_buf + sizeof(uint);
- memcpy(*next_field, from, length);
+ memcpy((uchar*) *next_field, from, 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;
+ return FALSE;
}
diff --git a/libmysqld/libmysqld.def b/libmysqld/libmysqld.def
index 6f7800ee207..78ff08e510a 100644
--- a/libmysqld/libmysqld.def
+++ b/libmysqld/libmysqld.def
@@ -1,6 +1,6 @@
LIBRARY LIBMYSQLD
-DESCRIPTION 'MySQL 5.0 Embedded Server Library'
-VERSION 5.0
+DESCRIPTION 'MySQL 5.1 Embedded Server Library'
+VERSION 5.1
EXPORTS
_dig_vec_upper
_dig_vec_lower
@@ -30,8 +30,8 @@ EXPORTS
my_print_variables
my_realloc
my_strdup
- my_thread_end
- my_thread_init
+ mysql_thread_end
+ mysql_thread_init
myodbc_remove_escape
mysql_affected_rows
mysql_autocommit
@@ -41,11 +41,14 @@ 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
mysql_escape_string
+ mysql_hex_string
mysql_fetch_field
mysql_fetch_field_direct
mysql_fetch_fields
@@ -55,15 +58,18 @@ EXPORTS
mysql_field_seek
mysql_field_tell
mysql_free_result
+ mysql_get_character_set_info
mysql_get_client_info
mysql_get_host_info
mysql_get_proto_info
mysql_get_server_info
+ mysql_get_client_version
mysql_get_ssl_cipher
mysql_info
mysql_init
mysql_insert_id
mysql_kill
+ mysql_set_server_option
mysql_list_dbs
mysql_list_fields
mysql_list_processes
@@ -84,6 +90,8 @@ EXPORTS
mysql_rollback
mysql_row_seek
mysql_row_tell
+ mysql_rpl_parse_enabled
+ mysql_rpl_probe
mysql_select_db
mysql_send_query
mysql_shutdown
@@ -109,6 +117,7 @@ EXPORTS
get_tty_password
sql_protocol_typelib
mysql_get_server_version
+ mysql_set_character_set
mysql_sqlstate
charsets_dir
disabled_my_option
@@ -133,6 +142,8 @@ EXPORTS
my_read
llstr
mysql_get_parameters
+ mysql_thread_init
+ mysql_thread_end
mysql_stmt_bind_param
mysql_stmt_bind_result
mysql_stmt_execute
@@ -164,4 +175,3 @@ EXPORTS
my_charset_bin
my_charset_same
modify_defaults_file
- mysql_set_server_option
diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am
index 1e9371e5bf2..eb31e9057cc 100644
--- a/mysql-test/Makefile.am
+++ b/mysql-test/Makefile.am
@@ -18,7 +18,6 @@
## Process this file with automake to create Makefile.in
SUBDIRS = ndb
-DIST_SUBDIRS=ndb
benchdir_root= $(prefix)
testdir = $(benchdir_root)/mysql-test
@@ -26,11 +25,8 @@ EXTRA_SCRIPTS = mysql-test-run-shell.sh install_test_db.sh \
valgrind.supp $(PRESCRIPTS)
EXTRA_DIST = $(EXTRA_SCRIPTS) suite
GENSCRIPTS = mysql-test-run-shell install_test_db mtr mysql-test-run
-PRESCRIPTS = mysql-test-run.pl
+PRESCRIPTS = mysql-test-run.pl mysql-stress-test.pl
test_SCRIPTS = $(GENSCRIPTS) $(PRESCRIPTS)
-test_DATA = std_data/client-key.pem std_data/client-cert.pem \
- std_data/cacert.pem std_data/server-cert.pem \
- std_data/server-key.pem
CLEANFILES = $(GENSCRIPTS)
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I..
@@ -46,14 +42,16 @@ dist-hook:
$(distdir)/std_data \
$(distdir)/std_data/ndb_backup50 \
$(distdir)/std_data/ndb_backup51 \
+ $(distdir)/std_data/ndb_backup51_data_be \
+ $(distdir)/std_data/ndb_backup51_data_le \
$(distdir)/lib
-$(INSTALL_DATA) $(srcdir)/t/*.def $(distdir)/t
$(INSTALL_DATA) $(srcdir)/t/*.test $(distdir)/t
-$(INSTALL_DATA) $(srcdir)/t/*.imtest $(distdir)/t
$(INSTALL_DATA) $(srcdir)/t/*.sql $(distdir)/t
-$(INSTALL_DATA) $(srcdir)/t/*.disabled $(distdir)/t
- $(INSTALL_DATA) $(srcdir)/t/*.opt $(srcdir)/t/*.slave-mi $(distdir)/t
- $(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(distdir)/t
+ -$(INSTALL_DATA) $(srcdir)/t/*.opt $(srcdir)/t/*.slave-mi $(distdir)/t
+ -$(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(distdir)/t
$(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.test $(distdir)/extra/binlog_tests
$(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.test $(distdir)/extra/rpl_tests
-$(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.opt $(distdir)/extra/binlog_tests
@@ -62,6 +60,7 @@ dist-hook:
$(INSTALL_DATA) $(srcdir)/include/*.test $(distdir)/include
$(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.require $(distdir)/r
$(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(distdir)/std_data
+ $(INSTALL_DATA) $(srcdir)/std_data/Index.xml $(distdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/*.dat $(srcdir)/std_data/*.000001 $(distdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(distdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/*.pem $(distdir)/std_data
@@ -70,8 +69,10 @@ dist-hook:
$(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(distdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50/BACKUP* $(distdir)/std_data/ndb_backup50
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51/BACKUP* $(distdir)/std_data/ndb_backup51
+ $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_be/BACKUP* $(distdir)/std_data/ndb_backup51_data_be
+ $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_le/BACKUP* $(distdir)/std_data/ndb_backup51_data_le
$(INSTALL_DATA) $(srcdir)/lib/*.pl $(distdir)/lib
- -rm -rf `find $(distdir)/suite -type d -name SCCS`
+ -rm -rf `find $(distdir)/suite -type d -name SCCS` $(distdir)/suite/row_lock
install-data-local:
$(mkinstalldirs) \
@@ -83,6 +84,8 @@ install-data-local:
$(DESTDIR)$(testdir)/std_data \
$(DESTDIR)$(testdir)/std_data/ndb_backup50 \
$(DESTDIR)$(testdir)/std_data/ndb_backup51 \
+ $(DESTDIR)$(testdir)/std_data/ndb_backup51_data_be \
+ $(DESTDIR)$(testdir)/std_data/ndb_backup51_data_le \
$(DESTDIR)$(testdir)/lib
$(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(testdir)
-$(INSTALL_DATA) $(srcdir)/t/*.def $(DESTDIR)$(testdir)/t
@@ -90,9 +93,9 @@ install-data-local:
-$(INSTALL_DATA) $(srcdir)/t/*.imtest $(DESTDIR)$(testdir)/t
$(INSTALL_DATA) $(srcdir)/t/*.sql $(DESTDIR)$(testdir)/t
-$(INSTALL_DATA) $(srcdir)/t/*.disabled $(DESTDIR)$(testdir)/t
- $(INSTALL_DATA) $(srcdir)/t/*.opt $(DESTDIR)$(testdir)/t
- $(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(DESTDIR)$(testdir)/t
- $(INSTALL_DATA) $(srcdir)/t/*.slave-mi $(DESTDIR)$(testdir)/t
+ -$(INSTALL_DATA) $(srcdir)/t/*.opt $(DESTDIR)$(testdir)/t
+ -$(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(DESTDIR)$(testdir)/t
+ -$(INSTALL_DATA) $(srcdir)/t/*.slave-mi $(DESTDIR)$(testdir)/t
$(INSTALL_DATA) $(srcdir)/r/*.result $(DESTDIR)$(testdir)/r
$(INSTALL_DATA) $(srcdir)/r/*.require $(DESTDIR)$(testdir)/r
$(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.test $(DESTDIR)$(testdir)/extra/binlog_tests
@@ -106,14 +109,17 @@ install-data-local:
$(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(DESTDIR)$(testdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(DESTDIR)$(testdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(DESTDIR)$(testdir)/std_data
+ $(INSTALL_DATA) $(srcdir)/std_data/Index.xml $(DESTDIR)$(testdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/*.pem $(DESTDIR)$(testdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/*.frm $(DESTDIR)$(testdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/*.MY* $(DESTDIR)$(testdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(DESTDIR)$(testdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup50
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup51
+ $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_be/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup51_data_be
+ $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_le/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup51_data_le
$(INSTALL_DATA) $(srcdir)/lib/*.pl $(DESTDIR)$(testdir)/lib
- for f in `(cd $(srcdir); find suite -type f | grep -v SCCS)`; \
+ for f in `(cd $(srcdir); find suite -type f | egrep -v 'SCCS|row_lock')`; \
do \
d=$(DESTDIR)$(testdir)/`dirname $$f`; \
mkdir -p $$d ; \
diff --git a/mysql-test/extra/binlog_tests/binlog.test b/mysql-test/extra/binlog_tests/binlog.test
index c59685a0e65..0d2ed7ad509 100644
--- a/mysql-test/extra/binlog_tests/binlog.test
+++ b/mysql-test/extra/binlog_tests/binlog.test
@@ -2,6 +2,7 @@
# misc binlogging tests that do not require a slave running
#
+-- source include/have_log_bin.inc
-- source include/not_embedded.inc
-- source include/have_innodb.inc
-- source include/have_debug.inc
@@ -47,6 +48,68 @@ show binlog events in 'master-bin.000001' from 106;
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
show binlog events in 'master-bin.000002' from 106;
+
+#
+# Bug#22540 - Incorrect value in column End_log_pos of
+# SHOW BINLOG EVENTS using InnoDB
+#
+
+# the following tests will show that certain queries now return
+# absolute offsets (from binlog start, rather than relative to
+# the beginning of the current transaction). under what
+# conditions it should be allowed / is sensible to put the
+# slider into the middle of a transaction is not our concern
+# here; we just guarantee that if and when it's done, the
+# user has valid offsets to use. if the setter function still
+# wants to throw a "positioning into middle of transaction"
+# warning, that's its prerogative and handled elsewhere.
+
+set @ac = @@autocommit;
+
+# first show this to work for SHOW BINLOG EVENTS
+
+set autocommit= 0;
+reset master;
+create table t1(n int) engine=innodb;
+begin;
+insert into t1 values (1);
+insert into t1 values (2);
+insert into t1 values (3);
+commit;
+drop table t1;
+--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
+show binlog events from 0;
+
+# now show that nothing breaks if we need to read from the cache more
+# than once, resulting in split event-headers
+
+set @bcs = @@binlog_cache_size;
+set global binlog_cache_size=4096;
+reset master;
+
+create table t1 (a int) engine=innodb;
+
+let $1=400;
+disable_query_log;
+begin;
+while ($1)
+{
+ eval insert into t1 values( $1 );
+ dec $1;
+}
+commit;
+enable_query_log;
+
+--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
+show binlog events from 0;
+
+drop table t1;
+
+set global binlog_cache_size=@bcs;
+set session autocommit = @ac;
+
+--echo End of 5.0 tests
+
# Test of a too big SET INSERT_ID: see if the truncated value goes
# into binlog (right), or the too big value (wrong); we look at the
# binlog further down with SHOW BINLOG EVENTS.
diff --git a/mysql-test/extra/binlog_tests/blackhole.test b/mysql-test/extra/binlog_tests/blackhole.test
index 80f998359ba..1ca59955d76 100644
--- a/mysql-test/extra/binlog_tests/blackhole.test
+++ b/mysql-test/extra/binlog_tests/blackhole.test
@@ -4,6 +4,11 @@
#
-- source include/not_embedded.inc
-- source include/have_blackhole.inc
+-- source include/have_log_bin.inc
+
+# The server need to be started in $MYSQLTEST_VARDIR since it
+# uses ../std_data_ln/
+-- source include/uses_vardir.inc
--disable_warnings
drop table if exists t1,t2;
@@ -109,7 +114,7 @@ insert into t1 values(1);
insert ignore into t1 values(1);
replace into t1 values(100);
create table t2 (a varchar(200)) engine=blackhole;
-load data infile '../std_data_ln/words.dat' into table t2;
+eval load data infile '../std_data_ln/words.dat' into table t2;
alter table t1 add b int;
alter table t1 drop b;
create table t3 like t1;
@@ -125,6 +130,16 @@ source include/show_binlog_events.inc;
drop table t1,t2,t3;
#
+# BUG#27998 - mysqld crashed when executing INSERT DELAYED on a BLACKHOLE
+# table
+#
+CREATE TABLE t1(a INT) ENGINE=BLACKHOLE;
+INSERT DELAYED INTO t1 VALUES(1);
+DROP TABLE t1;
+
+# End of 4.1 tests
+
+#
#Bug#19717: DELETE Query Error on BLACKHOLE when using WHERE on column with UNIQUE INDEX
#
CREATE TABLE t1(a INT, b INT) ENGINE=BLACKHOLE;
@@ -139,7 +154,8 @@ ALTER TABLE t1 ADD PRIMARY KEY(a);
DELETE FROM t1 WHERE a=10;
DROP TABLE t1;
-# End of 4.1 tests
+# End of 5.0 tests
+
# Test that a transaction which is rolled back does not go into binlog
# and that a transaction which is committed does
@@ -156,4 +172,4 @@ set autocommit=1;
source include/show_binlog_events.inc;
drop table if exists t1;
-# End of 5.0 tests
+# End of 5.1 tests
diff --git a/mysql-test/extra/binlog_tests/ctype_cp932.test b/mysql-test/extra/binlog_tests/ctype_cp932.test
index fc2fa934641..0839f5d43aa 100644
--- a/mysql-test/extra/binlog_tests/ctype_cp932.test
+++ b/mysql-test/extra/binlog_tests/ctype_cp932.test
@@ -404,6 +404,28 @@ SET collation_connection='cp932_bin';
-- source include/ctype_filesort.inc
#
+# Bug#29333 myisam corruption with
+# character set cp932 collate cp932_japanese_ci
+#
+create table t2 (a char(1));
+insert into t2 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7');
+insert into t2 values ('8'),('9'),('A'),('B'),('C'),('D'),('E'),('F');
+create table t1 (
+ a varchar(2) character set cp932
+) engine=myisam;
+--disable_warnings
+insert into t1
+select unhex(concat(t24.a, t23.a, t22.a, t21.a))
+from t2 t21, t2 t22, t2 t23, t2 t24;
+--enable_warnings
+delete from t1 where a='';
+alter table t1 add key(a);
+check table t1;
+drop table t1;
+drop table t2;
+
+
+#
# Bug#12547: Inserting long string into varchar causes table crash in cp932
#
create table t1 (col1 varchar(1)) character set cp932;
diff --git a/mysql-test/extra/binlog_tests/ctype_cp932_binlog.test b/mysql-test/extra/binlog_tests/ctype_cp932_binlog.test
index 30585ece71c..5c172afd122 100644
--- a/mysql-test/extra/binlog_tests/ctype_cp932_binlog.test
+++ b/mysql-test/extra/binlog_tests/ctype_cp932_binlog.test
@@ -1,5 +1,6 @@
-- source include/not_embedded.inc
-- source include/have_cp932.inc
+-- source include/have_log_bin.inc
--character_set cp932
--disable_warnings
diff --git a/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test b/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test
index e1a9dba7775..fa374502997 100644
--- a/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test
+++ b/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test
@@ -1,5 +1,6 @@
--source include/not_embedded.inc
--source include/have_ucs2.inc
+--source include/have_log_bin.inc
#
# Check correct binlogging of UCS2 user variables (BUG#3875)
diff --git a/mysql-test/extra/binlog_tests/drop_temp_table.test b/mysql-test/extra/binlog_tests/drop_temp_table.test
index 87f94eff987..7d37fca2bef 100644
--- a/mysql-test/extra/binlog_tests/drop_temp_table.test
+++ b/mysql-test/extra/binlog_tests/drop_temp_table.test
@@ -1,5 +1,3 @@
-# Embedded server doesn't support binlog
--- source include/not_embedded.inc
--disable_warnings
drop database if exists `drop-temp+table-test`;
diff --git a/mysql-test/extra/binlog_tests/insert_select-binlog.test b/mysql-test/extra/binlog_tests/insert_select-binlog.test
index b09eebcb996..ef22373a628 100644
--- a/mysql-test/extra/binlog_tests/insert_select-binlog.test
+++ b/mysql-test/extra/binlog_tests/insert_select-binlog.test
@@ -1,5 +1,6 @@
# Embedded server doesn't support binlog
-- source include/not_embedded.inc
+-- source include/have_log_bin.inc
--disable_warnings
drop table if exists t1,t2;
@@ -13,7 +14,7 @@ insert into t1 values(2);
create table t2(a int);
insert into t2 values(1),(2);
reset master;
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 select * from t2;
# The above should produce an error, but still be in the binlog;
# verify the binlog :
@@ -27,7 +28,7 @@ drop table t1, t2;
create table t1(a int);
insert into t1 values(1),(1);
reset master;
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
create table t2(unique(a)) select a from t1;
# The above should produce an error, *and* not appear in the binlog
let $VERSION=`select version()`;
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 d6ccc403ce9..7141bd1abb9 100644
--- a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test
+++ b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test
@@ -5,9 +5,7 @@
# did some tests manually on a slave; tables are replicated fine and
# Exec_Master_Log_Pos advances as expected.
-# Embedded server doesn't support binlogging
--- source include/not_embedded.inc
-
+-- source include/have_log_bin.inc
-- source include/have_innodb.inc
-- source include/have_debug.inc
@@ -246,12 +244,12 @@ set autocommit=0;
CREATE TABLE t1 (a int, b int) engine=myisam;
reset master;
INSERT INTO t1 values (1,1),(1,2);
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
CREATE TABLE t2 (primary key (a)) engine=innodb select * from t1;
# This should give warning
DROP TABLE if exists t2;
INSERT INTO t1 values (3,3);
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
CREATE TEMPORARY TABLE t2 (primary key (a)) engine=innodb select * from t1;
ROLLBACK;
# This should give warning
@@ -259,12 +257,12 @@ DROP TABLE IF EXISTS t2;
CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb;
INSERT INTO t1 VALUES (4,4);
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
CREATE TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
SELECT * from t2;
TRUNCATE table t2;
INSERT INTO t1 VALUES (5,5);
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
INSERT INTO t2 select * from t1;
SELECT * FROM t2;
DROP TABLE t2;
@@ -274,25 +272,25 @@ CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a)) engine=innodb ;
INSERT INTO t1 values (7,7);
ROLLBACK;
INSERT INTO t1 values (8,8);
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
COMMIT;
INSERT INTO t1 values (9,9);
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
ROLLBACK;
SELECT * from t2;
TRUNCATE table t2;
INSERT INTO t1 values (10,10);
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
INSERT INTO t2 select * from t1;
SELECT * from t1;
INSERT INTO t2 values (100,100);
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
COMMIT;
INSERT INTO t2 values (101,101);
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
ROLLBACK;
SELECT * from t2;
diff --git a/mysql-test/extra/rpl_tests/rpl_auto_increment.test b/mysql-test/extra/rpl_tests/rpl_auto_increment.test
index 410aeecb7ee..1fa3cf034f6 100644
--- a/mysql-test/extra/rpl_tests/rpl_auto_increment.test
+++ b/mysql-test/extra/rpl_tests/rpl_auto_increment.test
@@ -76,7 +76,7 @@ insert into t1 values (NULL),(5),(NULL),(NULL);
insert into t1 values (500),(NULL),(502),(NULL),(NULL);
select * from t1;
set @@insert_id=600;
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values(600),(NULL),(NULL);
set @@insert_id=600;
insert ignore into t1 values(600),(NULL),(NULL),(610),(NULL);
@@ -119,7 +119,7 @@ set auto_increment_increment=11;
set auto_increment_offset=4;
insert into t1 values(null);
insert into t1 values(null);
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values(null);
select a, mod(a-@@auto_increment_offset,@@auto_increment_increment) from t1 order by a;
diff --git a/mysql-test/extra/rpl_tests/rpl_commit_after_flush.test b/mysql-test/extra/rpl_tests/rpl_commit_after_flush.test
index d63d7e4b07d..98638b0b1f6 100644
--- a/mysql-test/extra/rpl_tests/rpl_commit_after_flush.test
+++ b/mysql-test/extra/rpl_tests/rpl_commit_after_flush.test
@@ -2,8 +2,6 @@
# Test updated to use a wrapper #
#################################
--- source include/master-slave.inc
-
eval CREATE TABLE t1 (a INT) ENGINE=$engine_type;
begin;
diff --git a/mysql-test/extra/rpl_tests/rpl_deadlock.test b/mysql-test/extra/rpl_tests/rpl_deadlock.test
index f6e02546a0b..62fe9b2223a 100644
--- a/mysql-test/extra/rpl_tests/rpl_deadlock.test
+++ b/mysql-test/extra/rpl_tests/rpl_deadlock.test
@@ -72,7 +72,7 @@ sync_with_master;
select * from t1; # check that repl-ed succeeded finally
select * from t2 /* must be 1 */;
# check that no error is reported
---replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 #
+--replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--replace_result $MASTER_MYPORT MASTER_MYPORT
--vertical_results
show slave status;
@@ -117,7 +117,7 @@ commit;
sync_with_master;
select * from t1;
select * from t2;
---replace_column 1 # 7 # 8 # 9 # 11 # 16 # 22 # 23 # 33 #
+--replace_column 1 # 7 # 8 # 9 # 11 # 16 # 22 # 23 # 33 # 35 # 36 #
--replace_result $MASTER_MYPORT MASTER_MYPORT
--vertical_results
show slave status;
diff --git a/mysql-test/extra/rpl_tests/rpl_delete_no_where.test b/mysql-test/extra/rpl_tests/rpl_delete_no_where.test
index 4db9e0fb63f..914bedc6b67 100644
--- a/mysql-test/extra/rpl_tests/rpl_delete_no_where.test
+++ b/mysql-test/extra/rpl_tests/rpl_delete_no_where.test
@@ -2,8 +2,6 @@
# (not internally row-per-row but more like a TRUNCATE, MyISAM
# supports that), is replicated (BUG#13576).
--- source include/master-slave.inc
-
eval create table t1 (a int, b int) engine=$engine_type;
insert into t1 values(1,1);
sync_slave_with_master;
diff --git a/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test b/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test
new file mode 100644
index 00000000000..26b1e6d5ba0
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test
@@ -0,0 +1,506 @@
+#############################################################
+# Purpose: To test having extra columns on the master WL#3915
+# engine inspecific sourced part
+#############################################################
+
+# TODO: partition specific
+# -- source include/have_partition.inc
+
+########### Clean up ################
+--disable_warnings
+--disable_query_log
+DROP TABLE IF EXISTS t1,t2,t3,t4,t31;
+
+--enable_query_log
+--enable_warnings
+
+#
+# Setup differently defined tables on master and slave
+#
+
+# Def on master: t (f_1 type_m_1,... f_s type_m_s, f_s1, f_m)
+# Def on slave: t (f_1 type_s_1,... f_s type_s_s)
+# where type_mi,type_si (0 < i-1 <s1) pairs are compatible types (WL#3228)
+# Arbitrary paramaters of the test are:
+# 1. the tables type
+# 2. the types of the extra master's column f_s1,..., f_m
+# 3. the numbers of common columns `s'
+# 4. and extra columns `m' are par
+#
+# optionally
+#
+# 5. vary the common columns type within compatible ranges.
+
+#
+# constant size column type:
+
+#BIGINT
+#BLOB
+#DATE
+#DATETIME
+#FLOAT
+#INT, INTEGER
+#LONGBLOB
+#LONGTEXT
+#MEDIUMBLOB
+#MEDIUMINT
+#MEDIUMTEXT
+#REAL
+#SMALLINT
+#TEXT
+#TIME
+#TIMESTAMP
+#TINYBLOB
+#TINYINT
+#TINYTEXT
+#YEAR
+
+# variable size column types:
+
+#BINARY(M)
+#BIT(M)
+#CHAR(M)
+#DECIMAL(M,D)
+#DOUBLE[P]
+#ENUM
+#FLOAT(p)
+#NUMERIC(M,D)
+#SET
+#VARBINARY(M)
+#VARCHAR(M)
+#
+
+
+connection master;
+eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
+ f5 FLOAT DEFAULT '2.00')
+ ENGINE=$engine_type;
+
+sync_slave_with_master;
+alter table t1 drop f5;
+
+connection master;
+INSERT into t1 values (1, 1, 1, 'first', 1.0);
+
+ sync_slave_with_master;
+--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
+--query_vertical show slave status;
+ select * from t1 order by f3;
+
+connection master;
+DROP TABLE t1;
+eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
+ f5 FLOAT DEFAULT '2.00',
+ f6 CHAR(4) DEFAULT 'TEST')
+ ENGINE=$engine_type;
+
+sync_slave_with_master;
+alter table t1 drop f5, drop f6;
+
+connection master;
+INSERT into t1 values (1, 1, 1, 'first', 1.0, 'yksi');
+
+ sync_slave_with_master;
+--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
+--query_vertical show slave status;
+ select * from t1 order by f3;
+
+connection master;
+DROP TABLE t1;
+eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
+ f5 FLOAT DEFAULT '2.00',
+ f6 CHAR(4) DEFAULT 'TEST',
+ f7 INT DEFAULT '0')
+ ENGINE=$engine_type;
+
+sync_slave_with_master;
+alter table t1 drop f5, drop f6, drop f7;
+
+connection master;
+INSERT into t1 values (1, 1, 1, 'first', 1.0, 'yksi', 1);
+ sync_slave_with_master;
+--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
+--query_vertical show slave status;
+ select * from t1 order by f3;
+
+connection master;
+DROP TABLE t1;
+eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
+ f5 FLOAT DEFAULT '2.00',
+ f6 CHAR(4) DEFAULT 'TEST',
+ f7 INT DEFAULT '0',
+ f8 TEXT)
+ ENGINE=$engine_type;
+
+sync_slave_with_master;
+alter table t1 drop f5, drop f6, drop f7, drop f8;
+
+connection master;
+INSERT into t1 values (1, 1, 1, 'first', 1.0, 'yksi', 1, 'lounge of happiness');
+ sync_slave_with_master;
+--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
+--query_vertical show slave status;
+ select * from t1 order by f3;
+
+connection master;
+DROP TABLE t1;
+eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
+ f5 FLOAT DEFAULT '2.00',
+ f6 CHAR(4) DEFAULT 'TEST',
+ f7 INT DEFAULT '0',
+ f8 TEXT,
+ f9 LONGBLOB)
+ ENGINE=$engine_type;
+
+sync_slave_with_master;
+alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9;
+
+connection master;
+INSERT into t1 values (1, 1, 1, 'first', 1.0, 'yksi', 1, 'lounge of happiness', 'very fat blob');
+ sync_slave_with_master;
+--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
+--query_vertical show slave status;
+ select * from t1 order by f3;
+
+connection master;
+DROP TABLE t1;
+eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
+ f5 FLOAT DEFAULT '2.00',
+ f6 CHAR(4) DEFAULT 'TEST',
+ f7 INT DEFAULT '0',
+ f8 TEXT,
+ f9 LONGBLOB,
+ f10 BIT(63))
+ ENGINE=$engine_type;
+
+sync_slave_with_master;
+alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10;
+
+connection master;
+INSERT into t1 values (1, 1, 1, 'first', 1.0, 'yksi', 1, 'lounge of happiness', 'very fat blob', b'01010101010101');
+ sync_slave_with_master;
+--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
+--query_vertical show slave status;
+ select * from t1 order by f3;
+
+connection master;
+DROP TABLE t1;
+ eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
+ /* extra */
+ f5 FLOAT DEFAULT '2.00',
+ f6 CHAR(4) DEFAULT 'TEST',
+ f7 INT DEFAULT '0',
+ f8 TEXT,
+ f9 LONGBLOB,
+ f10 BIT(63),
+ f11 VARBINARY(64))
+ ENGINE=$engine_type;
+
+#connection slave;
+ sync_slave_with_master;
+ alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
+
+connection master;
+
+ INSERT into t1 values (1, 1, 1, 'first', 1.0, 'yksi', 1, 'lounge of happiness', 'very fat blob', b'01010101010101', 0x123456);
+ INSERT into t1 values (2, 2, 2, 'second', 2.0, 'kaks', 2, 'got stolen from the paradise', 'very fat blob', b'01010101010101', 0x123456), (3, 3, 3, 'third', 3.0, 'kolm', 3, 'got stolen from the paradise', 'very fat blob', b'01010101010101', 0x123456);
+ update t1 set f4= 'next' where f1=1;
+ delete from t1 where f1=1;
+
+ select * from t1 order by f3;
+
+
+#connection slave;
+ sync_slave_with_master;
+--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
+--query_vertical show slave status;
+ select * from t1 order by f3;
+
+
+### Altering table def scenario
+
+connection master;
+
+ eval CREATE TABLE t2 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
+ /* extra */
+ f5 DOUBLE DEFAULT '2.00',
+ f6 ENUM('a', 'b', 'c') default 'a',
+ f7 DECIMAL(17,9) default '1000.00',
+ f8 MEDIUMBLOB,
+ f9 NUMERIC(6,4) default '2000.00',
+ f10 VARCHAR(1024),
+ f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
+ f12 SET('a', 'b', 'c') default 'b')
+ ENGINE=$engine_type;
+
+ eval CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
+ /* extra */
+ f5 DOUBLE DEFAULT '2.00',
+ f6 ENUM('a', 'b', 'c') default 'a',
+ f8 MEDIUMBLOB,
+ f10 VARCHAR(1024),
+ f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
+ f12 SET('a', 'b', 'c') default 'b')
+ ENGINE=$engine_type;
+
+
+# no ENUM and SET
+ eval CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
+ /* extra */
+ f5 DOUBLE DEFAULT '2.00',
+ f6 DECIMAL(17,9) default '1000.00',
+ f7 MEDIUMBLOB,
+ f8 NUMERIC(6,4) default '2000.00',
+ f9 VARCHAR(1024),
+ f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
+ f11 CHAR(255))
+ ENGINE=$engine_type;
+
+
+ eval CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
+
+ /* extra */
+
+ f5 BIGINT,
+ f6 BLOB,
+ f7 DATE,
+ f8 DATETIME,
+ f9 FLOAT,
+ f10 INT,
+ f11 LONGBLOB,
+ f12 LONGTEXT,
+ f13 MEDIUMBLOB,
+ f14 MEDIUMINT,
+ f15 MEDIUMTEXT,
+ f16 REAL,
+ f17 SMALLINT,
+ f18 TEXT,
+ f19 TIME,
+ f20 TIMESTAMP,
+ f21 TINYBLOB,
+ f22 TINYINT,
+ f23 TINYTEXT,
+ f24 YEAR,
+ f25 BINARY(255),
+ f26 BIT(64),
+ f27 CHAR(255),
+ f28 DECIMAL(30,7),
+ f29 DOUBLE,
+ f30 ENUM ('a','b', 'c') default 'a',
+ f31 FLOAT,
+ f32 NUMERIC(17,9),
+ f33 SET ('a', 'b', 'c') default 'b',
+ f34 VARBINARY(1025),
+ f35 VARCHAR(257)
+ ) ENGINE=$engine_type;
+
+#connection slave;
+ sync_slave_with_master;
+ alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop
+f12;
+ alter table t3 drop f5, drop f6, drop f8, drop f10, drop f11, drop f12;
+ alter table t4 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
+
+ alter table t31
+ drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11,
+ drop f12, drop f13, drop f14, drop f15, drop f16, drop f17, drop f18,
+ drop f19, drop f20, drop f21, drop f22, drop f23, drop f24, drop f25,
+ drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32,
+ drop f33, drop f34, drop f35;
+
+
+
+connection master;
+ INSERT into t2 set f1=1, f2=1, f3=1, f4='first', f8='f8: medium size blob', f10='f10:
+some var char';
+ INSERT into t2 values (2, 2, 2, 'second',
+ 2.0, 'b', 2000.0002, 'f8: medium size blob', 2000, 'f10: some var char',
+'01234567', 'c'),
+ (3, 3, 3, 'third',
+ 3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char',
+'01234567', 'c');
+ INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char';
+ INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10:
+binary data';
+ INSERT into t31 set f1=1, f2=1, f3=1, f4='first';
+ INSERT into t31 set f1=1, f2=1, f3=2, f4='second',
+ f9=2.2, f10='seven samurai', f28=222.222, f35='222';
+ INSERT into t31 values (1, 1, 3, 'third',
+ /* f5 BIGINT, */ 333333333333333333333333,
+ /* f6 BLOB, */ '3333333333333333333333',
+ /* f7 DATE, */ '2007-07-18',
+ /* f8 DATETIME, */ "2007-07-18",
+ /* f9 FLOAT, */ 3.33333333,
+ /* f10 INT, */ 333333333,
+ /* f11 LONGBLOB, */ '3333333333333333333',
+ /* f12 LONGTEXT, */ '3333333333333333333',
+ /* f13 MEDIUMBLOB, */ '3333333333333333333',
+ /* f14 MEDIUMINT, */ 33,
+ /* f15 MEDIUMTEXT, */ 3.3,
+ /* f16 REAL, */ 3.3,
+ /* f17 SMALLINT, */ 3,
+ /* f18 TEXT, */ '33',
+ /* f19 TIME, */ '2:59:58.999',
+ /* f20 TIMESTAMP, */ 20000303000000,
+ /* f21 TINYBLOB, */ '3333',
+ /* f22 TINYINT, */ 3,
+ /* f23 TINYTEXT, */ '3',
+ /* f24 YEAR, */ 3000,
+ /* f25 BINARY(255), */ 'three_33333',
+ /* f26 BIT(64), */ b'011',
+ /* f27 CHAR(255), */ 'three',
+ /* f28 DECIMAL(30,7), */ 3.333,
+ /* f29 DOUBLE, */ 3.333333333333333333333333333,
+ /* f30 ENUM ('a','b','c')*/ 'c',
+ /* f31 FLOAT, */ 3.0,
+ /* f32 NUMERIC(17,9), */ 3.3333,
+ /* f33 SET ('a','b','c'),*/ 'c',
+ /*f34 VARBINARY(1025),*/ '3333 minus 3',
+ /*f35 VARCHAR(257),*/ 'three times three'
+ );
+
+ INSERT into t31 values (1, 1, 4, 'fourth',
+ /* f5 BIGINT, */ 333333333333333333333333,
+ /* f6 BLOB, */ '3333333333333333333333',
+ /* f7 DATE, */ '2007-07-18',
+ /* f8 DATETIME, */ "2007-07-18",
+ /* f9 FLOAT, */ 3.33333333,
+ /* f10 INT, */ 333333333,
+ /* f11 LONGBLOB, */ '3333333333333333333',
+ /* f12 LONGTEXT, */ '3333333333333333333',
+ /* f13 MEDIUMBLOB, */ '3333333333333333333',
+ /* f14 MEDIUMINT, */ 33,
+ /* f15 MEDIUMTEXT, */ 3.3,
+ /* f16 REAL, */ 3.3,
+ /* f17 SMALLINT, */ 3,
+ /* f18 TEXT, */ '33',
+ /* f19 TIME, */ '2:59:58.999',
+ /* f20 TIMESTAMP, */ 20000303000000,
+ /* f21 TINYBLOB, */ '3333',
+ /* f22 TINYINT, */ 3,
+ /* f23 TINYTEXT, */ '3',
+ /* f24 YEAR, */ 3000,
+ /* f25 BINARY(255), */ 'three_33333',
+ /* f26 BIT(64), */ b'011',
+ /* f27 CHAR(255), */ 'three',
+ /* f28 DECIMAL(30,7), */ 3.333,
+ /* f29 DOUBLE, */ 3.333333333333333333333333333,
+ /* f30 ENUM ('a','b','c')*/ 'c',
+ /* f31 FLOAT, */ 3.0,
+ /* f32 NUMERIC(17,9), */ 3.3333,
+ /* f33 SET ('a','b','c'),*/ 'c',
+ /*f34 VARBINARY(1025),*/ '3333 minus 3',
+ /*f35 VARCHAR(257),*/ 'three times three'
+ ),
+ (1, 1, 5, 'fifth',
+ /* f5 BIGINT, */ 333333333333333333333333,
+ /* f6 BLOB, */ '3333333333333333333333',
+ /* f7 DATE, */ '2007-07-18',
+ /* f8 DATETIME, */ "2007-07-18",
+ /* f9 FLOAT, */ 3.33333333,
+ /* f10 INT, */ 333333333,
+ /* f11 LONGBLOB, */ '3333333333333333333',
+ /* f12 LONGTEXT, */ '3333333333333333333',
+ /* f13 MEDIUMBLOB, */ '3333333333333333333',
+ /* f14 MEDIUMINT, */ 33,
+ /* f15 MEDIUMTEXT, */ 3.3,
+ /* f16 REAL, */ 3.3,
+ /* f17 SMALLINT, */ 3,
+ /* f18 TEXT, */ '33',
+ /* f19 TIME, */ '2:59:58.999',
+ /* f20 TIMESTAMP, */ 20000303000000,
+ /* f21 TINYBLOB, */ '3333',
+ /* f22 TINYINT, */ 3,
+ /* f23 TINYTEXT, */ '3',
+ /* f24 YEAR, */ 3000,
+ /* f25 BINARY(255), */ 'three_33333',
+ /* f26 BIT(64), */ b'011',
+ /* f27 CHAR(255), */ 'three',
+ /* f28 DECIMAL(30,7), */ 3.333,
+ /* f29 DOUBLE, */ 3.333333333333333333333333333,
+ /* f30 ENUM ('a','b','c')*/ 'c',
+ /* f31 FLOAT, */ 3.0,
+ /* f32 NUMERIC(17,9), */ 3.3333,
+ /* f33 SET ('a','b','c'),*/ 'c',
+ /*f34 VARBINARY(1025),*/ '3333 minus 3',
+ /*f35 VARCHAR(257),*/ 'three times three'
+ ),
+ (1, 1, 6, 'sixth',
+ /* f5 BIGINT, */ NULL,
+ /* f6 BLOB, */ '3333333333333333333333',
+ /* f7 DATE, */ '2007-07-18',
+ /* f8 DATETIME, */ "2007-07-18",
+ /* f9 FLOAT, */ 3.33333333,
+ /* f10 INT, */ 333333333,
+ /* f11 LONGBLOB, */ '3333333333333333333',
+ /* f12 LONGTEXT, */ '3333333333333333333',
+ /* f13 MEDIUMBLOB, */ '3333333333333333333',
+ /* f14 MEDIUMINT, */ 33,
+ /* f15 MEDIUMTEXT, */ 3.3,
+ /* f16 REAL, */ 3.3,
+ /* f17 SMALLINT, */ 3,
+ /* f18 TEXT, */ '33',
+ /* f19 TIME, */ '2:59:58.999',
+ /* f20 TIMESTAMP, */ 20000303000000,
+ /* f21 TINYBLOB, */ '3333',
+ /* f22 TINYINT, */ 3,
+ /* f23 TINYTEXT, */ '3',
+ /* f24 YEAR, */ 3000,
+ /* f25 BINARY(255), */ 'three_33333',
+ /* f26 BIT(64), */ b'011',
+ /* f27 CHAR(255), */ 'three',
+ /* f28 DECIMAL(30,7), */ 3.333,
+ /* f29 DOUBLE, */ 3.333333333333333333333333333,
+ /* f30 ENUM ('a','b','c')*/ 'c',
+ /* f31 FLOAT, */ 3.0,
+ /* f32 NUMERIC(17,9), */ 3.3333,
+ /* f33 SET ('a','b','c'),*/ 'c',
+ /*f34 VARBINARY(1025),*/ '3333 minus 3',
+ /*f35 VARCHAR(257),*/ NULL
+ );
+
+#connection slave;
+ sync_slave_with_master;
+
+ select * from t1 order by f3;
+ select * from t2 order by f1;
+ select * from t3 order by f1;
+ select * from t4 order by f1;
+ select * from t31 order by f1;
+
+connection master;
+
+ update t31 set f5=555555555555555 where f3=6;
+ update t31 set f2=2 where f3=2;
+ update t31 set f1=NULL where f3=1;
+ update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;
+
+ delete from t1;
+ delete from t2;
+ delete from t3;
+ delete from t4;
+ delete from t31;
+
+#connection slave;
+ sync_slave_with_master;
+ select * from t31;
+
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
+--query_vertical show slave status;
+
+#### Clean Up ####
+
+connection master;
+--disable_warnings
+--disable_query_log
+ DROP TABLE t1,t2,t3,t4,t31;
+
+#connection slave;
+ sync_slave_with_master;
+--enable_query_log
+--enable_warnings
+
+# END of the tests
+
+
diff --git a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
index a8a3e33b8cd..a4ac55cc2e8 100644
--- a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
+++ b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
@@ -71,38 +71,47 @@ sync_slave_with_master;
############################################
## BUG22086
-#--echo *** Create t2 on slave ***
-#STOP SLAVE;
-#RESET SLAVE;
-#eval CREATE TABLE t2 (a INT, b INT PRIMARY KEY, c CHAR(5),
-# d FLOAT DEFAULT '2.00',
-# e CHAR(5) DEFAULT 'TEST2')
-# ENGINE=$engine_type;
-#
-#--echo *** Create t2 on Master ***
-#connection master;
-#eval CREATE TABLE t2 (a INT PRIMARY KEY, b INT, c CHAR(10)
-# ) ENGINE=$engine_type;
-#RESET MASTER;
-#
-#--echo *** Start Slave ***
-#connection slave;
-#START SLAVE;
-#
-#--echo *** Master Data Insert ***
-#connection master;
-#
-#INSERT INTO t2 () VALUES(1,2,'Kyle, TEX'),(2,1,'JOE AUSTIN'),(3,4,'QA TESTING');
-#SELECT * FROM t2 ORDER BY a;
+--echo *** Create t2 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t2 (a INT, b INT PRIMARY KEY, c CHAR(5),
+ d FLOAT DEFAULT '2.00',
+ e CHAR(5) DEFAULT 'TEST2')
+ ENGINE=$engine_type;
-#--echo *** Select from slave ***
-#sync_slave_with_master;
-#SELECT * FROM t2 ORDER BY a;
+--echo *** Create t2 on Master ***
+connection master;
+eval CREATE TABLE t2 (a INT PRIMARY KEY, b INT, c CHAR(10)
+ ) ENGINE=$engine_type;
+RESET MASTER;
-#--echo *** Drop t2 ***
-#connection master;
-#DROP TABLE t2;
-#sync_slave_with_master;
+--echo *** Master Data Insert ***
+connection master;
+
+INSERT INTO t2 () VALUES(1,2,'Kyle, TEX'),(2,1,'JOE AUSTIN'),(3,4,'QA TESTING');
+SELECT * FROM t2 ORDER BY a;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+wait_for_slave_to_stop;
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
+--query_vertical SHOW SLAVE STATUS
+STOP SLAVE;
+RESET SLAVE;
+SELECT * FROM t2 ORDER BY a;
+
+connection master;
+RESET MASTER;
+
+connection slave;
+START SLAVE;
+
+--echo *** Drop t2 ***
+connection master;
+DROP TABLE t2;
+sync_slave_with_master;
####################################
### Try to replicate BLOB to INT ###
@@ -138,9 +147,9 @@ INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TEST
--echo *** Expect slave to fail with Error 1522 ***
--echo ********************************************
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -183,9 +192,9 @@ INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'),
--echo *** Expect slave to fail with Error 1522 ***
--echo ********************************************
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -228,9 +237,9 @@ INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
--echo *** Expect slave to fail with Error 1522 ***
--echo ********************************************
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -274,9 +283,9 @@ INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
--echo *** Expect slave to fail with Error 1522 ***
--echo ********************************************
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
#START SLAVE;
@@ -378,7 +387,7 @@ INSERT INTO t8 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
#connection slave;
#wait_for_slave_to_stop;
#--replace_result $MASTER_MYPORT MASTER_PORT
-#--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+#--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
#--query_vertical SHOW SLAVE STATUS
#SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
#START SLAVE;
@@ -427,9 +436,9 @@ sync_slave_with_master;
#connection slave;
#--echo *** Select from T9 ***
-#wait_for_slave_to_stop;
+#--source include/wait_for_slave_sql_to_stop.inc
#--replace_result $MASTER_MYPORT MASTER_PORT
-#--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+#--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
#--query_vertical SHOW SLAVE STATUS
#SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
#START SLAVE;
@@ -469,9 +478,9 @@ INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
--echo *** Expect slave to fail with Error 1522 ***
--echo ********************************************
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -513,9 +522,9 @@ INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
--echo *** Expect slave to fail with Error 1522 ***
--echo ********************************************
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -723,9 +732,9 @@ ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
--echo *** Expect slave to fail with Error 1060 ***
--echo ********************************************
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -832,9 +841,9 @@ INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
--echo *** Expect slave to fail with Error 1522 ***
--echo ********************************************
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
diff --git a/mysql-test/extra/rpl_tests/rpl_foreign_key.test b/mysql-test/extra/rpl_tests/rpl_foreign_key.test
index 8558650fd04..583f2d85554 100644
--- a/mysql-test/extra/rpl_tests/rpl_foreign_key.test
+++ b/mysql-test/extra/rpl_tests/rpl_foreign_key.test
@@ -22,8 +22,8 @@ SET TIMESTAMP=1000000000;
CREATE TABLE t3 ( a INT UNIQUE );
SET FOREIGN_KEY_CHECKS=0;
# Had to add 1022 for run with ndb as ndb uses different
-# error and error code for error ER_DUP_ENTRY_WITH_KEY_NAME. Bug 16677
---error 1022, ER_DUP_ENTRY_WITH_KEY_NAME
+# error and error code for error ER_DUP_ENTRY. Bug 16677
+--error 1022, ER_DUP_ENTRY
INSERT INTO t3 VALUES (1),(1);
sync_slave_with_master;
diff --git a/mysql-test/extra/rpl_tests/rpl_insert_delayed.test b/mysql-test/extra/rpl_tests/rpl_insert_delayed.test
index 2cba7ab64c8..e492903afad 100644
--- a/mysql-test/extra/rpl_tests/rpl_insert_delayed.test
+++ b/mysql-test/extra/rpl_tests/rpl_insert_delayed.test
@@ -42,7 +42,7 @@ if ($binlog_format_statement)
{
# statement below will be converted to non-delayed INSERT and so
# will stop at first error, guaranteeing replication.
- --error ER_DUP_ENTRY_WITH_KEY_NAME
+ --error ER_DUP_ENTRY
insert delayed into t1 values(10, "is Bond"), (20, "James Bond");
}
if (!$binlog_format_statement)
@@ -64,7 +64,7 @@ if ($binlog_format_statement)
# statement below will be converted to non-delayed INSERT and so
# will be binlogged with its ER_DUP_ENTRY error code, guaranteeing
# replication (slave will hit the same error code and so be fine).
- --error ER_DUP_ENTRY_WITH_KEY_NAME
+ --error ER_DUP_ENTRY
insert delayed into t1 values(20, "is Bond"), (10, "James Bond");
}
if (!$binlog_format_statement)
@@ -83,4 +83,58 @@ connection master;
USE test;
DROP SCHEMA mysqlslap;
sync_slave_with_master;
+use test;
connection master;
+
+#
+# Bug #29571: INSERT DELAYED IGNORE written to binary log on the master but
+# on the slave
+#
+if (`SELECT @@global.binlog_format != 'ROW'`)
+{
+ #flush the logs before the test
+ connection slave;
+ FLUSH LOGS;
+ connection master;
+ FLUSH LOGS;
+}
+
+CREATE TABLE t1(a int, UNIQUE(a));
+INSERT DELAYED IGNORE INTO t1 VALUES(1);
+INSERT DELAYED IGNORE INTO t1 VALUES(1);
+flush table t1; # to wait for INSERT DELAYED to be done
+
+if (`SELECT @@global.binlog_format != 'ROW'`)
+{
+ #must show two INSERT DELAYED
+ --replace_column 1 x 2 x 3 x 4 x 5 x
+ show binlog events in 'master-bin.000002' LIMIT 2,2;
+}
+select * from t1;
+
+sync_slave_with_master;
+echo On slave;
+if (`SELECT @@global.binlog_format != 'ROW'`)
+{
+ #must show two INSERT DELAYED
+ --replace_column 1 x 2 x 3 x 4 x 5 x
+ show binlog events in 'slave-bin.000002' LIMIT 2,2;
+}
+select * from t1;
+
+
+# clean up
+connection master;
+drop table t1;
+sync_slave_with_master;
+if (`SELECT @@global.binlog_format != 'ROW'`)
+{
+ #flush the logs after the test
+ FLUSH LOGS;
+ connection master;
+ FLUSH LOGS;
+}
+connection master;
+
+
+--echo End of 5.0 tests
diff --git a/mysql-test/extra/rpl_tests/rpl_insert_id.test b/mysql-test/extra/rpl_tests/rpl_insert_id.test
index bd2abbac6de..8ee98e0bc76 100644
--- a/mysql-test/extra/rpl_tests/rpl_insert_id.test
+++ b/mysql-test/extra/rpl_tests/rpl_insert_id.test
@@ -97,7 +97,7 @@ SET TIMESTAMP=1000000000;
CREATE TABLE t1 ( a INT UNIQUE );
SET FOREIGN_KEY_CHECKS=0;
# Duplicate Key Errors
---error 1022, ER_DUP_ENTRY_WITH_KEY_NAME
+--error 1022, ER_DUP_ENTRY
INSERT INTO t1 VALUES (1),(1);
sync_slave_with_master;
connection master;
diff --git a/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test b/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test
index 5a646bd49e3..844f93d0906 100644
--- a/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test
+++ b/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test
@@ -80,7 +80,7 @@ SET TIMESTAMP=1000000000;
CREATE TABLE t1 ( a INT UNIQUE );
SET FOREIGN_KEY_CHECKS=0;
# Duplicate Key Errors codes
---error 1022, ER_DUP_ENTRY_WITH_KEY_NAME
+--error 1022, ER_DUP_ENTRY
INSERT INTO t1 VALUES (1),(1);
sync_slave_with_master;
connection master;
diff --git a/mysql-test/extra/rpl_tests/rpl_insert_ignore.test b/mysql-test/extra/rpl_tests/rpl_insert_ignore.test
index 207b53b6fb4..43d45ef6c60 100644
--- a/mysql-test/extra/rpl_tests/rpl_insert_ignore.test
+++ b/mysql-test/extra/rpl_tests/rpl_insert_ignore.test
@@ -5,8 +5,6 @@
# Slave needs to be started with --innodb to store table in InnoDB.
# Same test for MyISAM (which had no bug).
--- source include/master-slave.inc
-
eval CREATE TABLE t1 (
a int unsigned not null auto_increment primary key,
b int unsigned,
diff --git a/mysql-test/extra/rpl_tests/rpl_loaddata.test b/mysql-test/extra/rpl_tests/rpl_loaddata.test
index 111b66ff7fe..bb6afd73034 100644
--- a/mysql-test/extra/rpl_tests/rpl_loaddata.test
+++ b/mysql-test/extra/rpl_tests/rpl_loaddata.test
@@ -15,6 +15,7 @@
# Last_slave_errno in SHOW SLAVE STATUS (1st and 3rd commands did not: bug 986)
-- source include/master-slave.inc
+source include/have_innodb.inc;
connection slave;
reset master;
@@ -67,7 +68,7 @@ load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
save_master_pos;
connection slave;
# The SQL slave thread should be stopped now.
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
# Skip the bad event and see if error is cleared in SHOW SLAVE STATUS by START
# SLAVE, even though we are not executing any event (as sql_slave_skip_counter
@@ -92,7 +93,7 @@ connection slave;
# The SQL slave thread should be stopped now.
# Exec_Master_Log_Pos should point to the start of Execute event
# for last load data.
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
# CHANGE MASTER and see if error is cleared in SHOW SLAVE STATUS.
stop slave;
@@ -115,7 +116,7 @@ load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
save_master_pos;
connection slave;
# The SQL slave thread should be stopped now.
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
# RESET SLAVE and see if error is cleared in SHOW SLAVE STATUS.
stop slave;
@@ -130,7 +131,7 @@ connection master;
reset master;
eval create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
unique(day)) engine=$engine_type; # no transactions
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
'\n##\n' starting by '>' ignore 1 lines;
@@ -146,14 +147,25 @@ select * from t2;
alter table t2 drop key day;
connection master;
delete from t2;
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
'\n##\n' starting by '>' ignore 1 lines;
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
drop table t2;
connection master;
drop table t2;
drop table t1;
+
+# BUG#17233 LOAD DATA INFILE: failure causes mysqld dbug_assert, binlog not flushed
+CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
+
+--error ER_DUP_ENTRY
+LOAD DATA INFILE "../std_data_ln/words.dat" INTO TABLE t1;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
# End of 4.1 tests
diff --git a/mysql-test/extra/rpl_tests/rpl_log.test b/mysql-test/extra/rpl_tests/rpl_log.test
index 932fcdf670b..a5db4dfab4d 100644
--- a/mysql-test/extra/rpl_tests/rpl_log.test
+++ b/mysql-test/extra/rpl_tests/rpl_log.test
@@ -1,5 +1,4 @@
# Requires statement logging
--- source include/master-slave.inc
# Clean up old slave's binlogs.
# The slave is started with --log-slave-updates
@@ -71,6 +70,10 @@ eval create table t3 (a int)ENGINE=$engine_type;
# Sync slave and force it to start on another binary log
+#show rows of t1 on master
+connection master;
+select * from t1 order by 1 asc;
+
save_master_pos;
connection slave;
# Note that the above 'slave start' will cause a 3rd rotate event (a fake one)
@@ -80,6 +83,8 @@ start slave;
let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%';
--source include/wait_slave_status.inc
sync_with_master;
+#check t1 on slave to ensure whether it's identical with on master
+select * from t1 order by 1 asc;
flush logs;
stop slave;
connection master;
@@ -107,9 +112,7 @@ show binlog events in 'slave-bin.000001' from 4;
--replace_column 2 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
show binlog events in 'slave-bin.000002' from 4;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 16 # 23 # 33 #
-show slave status;
+source include/show_slave_status.inc;
# Need to recode the following
diff --git a/mysql-test/extra/rpl_tests/rpl_max_relay_size.test b/mysql-test/extra/rpl_tests/rpl_max_relay_size.test
index d05fefe916b..6b84cf67d58 100644
--- a/mysql-test/extra/rpl_tests/rpl_max_relay_size.test
+++ b/mysql-test/extra/rpl_tests/rpl_max_relay_size.test
@@ -43,10 +43,7 @@ set global max_relay_log_size=8192-1; # mapped to 4096
select @@global.max_relay_log_size;
start slave;
sync_with_master;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 16 # 23 # 33 #
---vertical_results
-show slave status;
+source include/show_slave_status.inc;
--echo #
--echo # Test 2
@@ -55,13 +52,10 @@ show slave status;
stop slave;
reset slave;
set global max_relay_log_size=(5*4096);
-select @@global.max_relay_log_size;
+query_vertical select @@global.max_relay_log_size;
start slave;
sync_with_master;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 16 # 23 # 33 #
---vertical_results
-show slave status;
+source include/show_slave_status.inc;
--echo #
--echo # Test 3: max_relay_log_size = 0
@@ -70,13 +64,10 @@ show slave status;
stop slave;
reset slave;
set global max_relay_log_size=0;
-select @@global.max_relay_log_size;
+query_vertical select @@global.max_relay_log_size;
start slave;
sync_with_master;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 16 # 23 # 33 #
---vertical_results
-show slave status;
+source include/show_slave_status.inc;
--echo #
--echo # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
@@ -87,10 +78,7 @@ reset slave;
# test of relay log rotation when the slave is stopped
# (to make sure it does not crash).
flush logs;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 16 # 23 # 33 #
---vertical_results
-show slave status;
+source include/show_slave_status.inc;
--echo #
--echo # Test 5
@@ -108,10 +96,7 @@ create table t1 (a int);
save_master_pos;
connection slave;
sync_with_master;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 16 # 23 # 33 #
---vertical_results
-show slave status;
+source include/show_slave_status.inc;
--echo #
--echo # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
@@ -123,16 +108,13 @@ drop table t1;
save_master_pos;
connection slave;
sync_with_master;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 16 # 23 # 33 #
---vertical_results
-show slave status;
+source include/show_slave_status.inc;
connection master;
# test that the absence of relay logs does not make a master crash
flush logs;
-- replace_column 3 <Binlog_Ignore_DB>
-show master status;
+query_vertical show master status;
# Restore max_binlog_size
connection slave;
diff --git a/mysql-test/extra/rpl_tests/rpl_multi_update2.test b/mysql-test/extra/rpl_tests/rpl_multi_update2.test
index 0adf0053425..ae4261c0516 100644
--- a/mysql-test/extra/rpl_tests/rpl_multi_update2.test
+++ b/mysql-test/extra/rpl_tests/rpl_multi_update2.test
@@ -2,8 +2,6 @@
# some replicate-* rules exist.
# (BUG#7011)
-source include/master-slave.inc;
-
--disable_warnings
drop table if exists t1,t2;
--enable_warnings
diff --git a/mysql-test/extra/rpl_tests/rpl_multi_update3.test b/mysql-test/extra/rpl_tests/rpl_multi_update3.test
index 797e385e509..6c7a980aecb 100644
--- a/mysql-test/extra/rpl_tests/rpl_multi_update3.test
+++ b/mysql-test/extra/rpl_tests/rpl_multi_update3.test
@@ -1,5 +1,3 @@
--- source include/master-slave.inc
-
##############################################################################
#
# Let's verify that multi-update with a subselect does not cause the slave to crash
diff --git a/mysql-test/extra/rpl_tests/rpl_ndb_2multi_basic.test b/mysql-test/extra/rpl_tests/rpl_ndb_2multi_basic.test
new file mode 100644
index 00000000000..16f8116d92e
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_ndb_2multi_basic.test
@@ -0,0 +1,119 @@
+#######################################
+# Author: Rafal Somla #
+# Date: 2006-08-20 #
+# Purpose: Test replication of basic #
+# table operations in various setups #
+# #
+# Based on rpl_ndb_2multi_eng.test by #
+# JBM #
+#######################################
+
+--echo --- Doing pre test cleanup ---
+
+connection master;
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_query_log
+
+#################################################
+--echo --- Create Table Section ---
+
+CREATE TABLE t1 (id MEDIUMINT NOT NULL,
+ b1 INT,
+ vc VARCHAR(255),
+ bc CHAR(255),
+ d DECIMAL(10,4) DEFAULT 0,
+ f FLOAT DEFAULT 0,
+ total BIGINT UNSIGNED,
+ y YEAR,
+ t DATE,
+ PRIMARY KEY(id));
+
+--echo --- Show table on master ---
+
+SHOW CREATE TABLE t1;
+
+--echo --- Show table on slave ---
+
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+--source include/rpl_multi_engine2.inc
+
+#################################################
+# Okay lets see how it holds up to table changes
+--echo --- Check that simple Alter statements are replicated correctly --
+
+ALTER TABLE t1 DROP PRIMARY KEY;
+# note: table with no PK can't contain blobs if it is to be replicated.
+ALTER TABLE t1 MODIFY vc char(32);
+
+--echo --- Show the new improved table on the master ---
+
+SHOW CREATE TABLE t1;
+
+--echo --- Make sure that our tables on slave are still same engine ---
+--echo --- and that the alter statements replicated correctly ---
+
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+--source include/rpl_multi_engine2.inc
+
+#################################################
+--echo --- Check that replication works when slave has more columns than master
+connection master;
+ALTER TABLE t1 ADD PRIMARY KEY(id,total);
+ALTER TABLE t1 MODIFY vc TEXT;
+
+INSERT INTO t1 VALUES(3,1,'Testing MySQL databases is a cool ',
+ 'Must make it bug free for the customer',
+ 654321.4321,15.21,0,1965,"1905-11-14");
+INSERT INTO t1 VALUES(20,1,'Testing MySQL databases is a cool ',
+ 'Must make it bug free for the customer',
+ 654321.4321,15.21,0,1965,"1965-11-14");
+INSERT INTO t1 VALUES(50,1,'Testing MySQL databases is a cool ',
+ 'Must make it bug free for the customer',
+ 654321.4321,15.21,0,1965,"1985-11-14");
+
+--echo --- Add columns on slave ---
+--sync_slave_with_master
+ALTER TABLE t1 ADD (u int, v char(16) default 'default');
+UPDATE t1 SET u=7 WHERE id < 50;
+UPDATE t1 SET v='explicit' WHERE id >10;
+
+--echo --- Show changed table on slave ---
+
+SHOW CREATE TABLE t1;
+SELECT *
+FROM t1
+ORDER BY id;
+
+--source include/rpl_multi_engine2.inc
+TRUNCATE TABLE t1;
+
+#################################################
+--echo --- Check that replication works when master has more columns than slave
+connection master;
+
+--echo --- Remove columns on slave ---
+--sync_slave_with_master
+ALTER TABLE t1 DROP COLUMN v;
+ALTER TABLE t1 DROP COLUMN u;
+ALTER TABLE t1 DROP COLUMN t;
+ALTER TABLE t1 DROP COLUMN y;
+
+--echo --- Show changed table on slave ---
+
+SHOW CREATE TABLE t1;
+
+--source include/rpl_multi_engine2.inc
+TRUNCATE TABLE t1;
+
+#################################################
+--echo --- Do Cleanup --
+connection master;
+DROP TABLE IF EXISTS t1;
+
+sync_slave_with_master;
+connection master;
diff --git a/mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test b/mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test
new file mode 100644
index 00000000000..926c4106d6d
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test
@@ -0,0 +1,290 @@
+#############################################
+#Authors: TU and Jeb
+#Date: 2007/04
+#Purpose: Generic replication to cluster
+# and ensuring that the ndb_apply_status
+# table is updated.
+#############################################
+# Notes:
+# include/select_ndb_apply_status.inc
+# Selects out the log name, start & end pos
+# from the ndb_apply_status table
+#
+# include/show_binlog_using_logname.inc
+# To select out 1 row from offset 1
+# from the start position in the binlog whose
+# name is = log_name
+#
+# include/tpcb.inc
+# Creates DATABASE tpcb, the tables and
+# stored procedures for loading the DB
+# and for running transactions against DB.
+##############################################
+
+
+--echo
+--echo *** Test 1 ***
+--echo
+
+connection master;
+create table t1 (a int key, b int) engine innodb;
+create table t2 (a int key, b int) engine innodb;
+
+--echo
+
+--sync_slave_with_master
+alter table t1 engine ndb;
+alter table t2 engine ndb;
+
+--echo
+
+# check binlog position without begin
+connection master;
+insert into t1 values (1,2);
+
+--echo
+
+--sync_slave_with_master
+--source include/select_ndb_apply_status.inc
+
+--echo
+
+connection master;
+# here is actually a bug, since there is no begin statement, the
+# query is autocommitted, and end_pos shows end of the insert and not
+# end of the commit
+--replace_result $start_pos <start_pos>
+--replace_column 5 #
+--eval show binlog events from $start_pos limit 1
+--echo
+--replace_result $start_pos <start_pos> $end_pos <end_pos>
+--replace_column 2 #
+--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
+--eval show binlog events from $start_pos limit 1,1
+
+--echo
+
+# check binlog position with begin
+begin;
+insert into t1 values (2,3);
+insert into t2 values (3,4);
+commit;
+
+--echo
+
+--sync_slave_with_master
+--source include/select_ndb_apply_status.inc
+
+connection master;
+--replace_result $start_pos <start_pos>
+--replace_column 5 #
+--eval show binlog events from $start_pos limit 1
+--echo
+--replace_result $start_pos <start_pos>
+--replace_column 2 # 4 # 5 #
+--eval show binlog events from $start_pos limit 1,2
+--echo
+--replace_result $start_pos <start_pos> $end_pos <end_pos>
+--replace_column 2 #
+--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
+--eval show binlog events from $start_pos limit 3,1
+
+--echo
+
+connection master;
+DROP TABLE test.t1, test.t2;
+--sync_slave_with_master
+SHOW TABLES;
+
+# Run in some transactions using stored procedures
+# and ensure that the ndb_apply_status table is
+# updated to show the transactions
+
+
+--echo
+--echo *** Test 2 ***
+--echo
+
+# Create database/tables and stored procdures
+connection master;
+--source include/tpcb.inc
+
+# Switch tables on slave to use NDB
+--sync_slave_with_master
+USE tpcb;
+ALTER TABLE account ENGINE NDB;
+ALTER TABLE branch ENGINE NDB;
+ALTER TABLE teller ENGINE NDB;
+ALTER TABLE history ENGINE NDB;
+
+--echo
+
+# Load DB tpcb and run some transactions
+connection master;
+--disable_query_log
+CALL tpcb.load();
+SET AUTOCOMMIT=0;
+let $run= 5;
+while ($run)
+{
+ START TRANSACTION;
+ --eval CALL tpcb.trans($rpl_format);
+ eval SET @my_errno= $mysql_errno;
+ let $run_good= `SELECT @my_errno = 0`;
+ let $run_bad= `SELECT @my_errno <> 0`;
+ if ($run_good)
+ {
+ COMMIT;
+ }
+ if ($run_bad)
+ {
+ ROLLBACK;
+ }
+ dec $run;
+}
+
+SET AUTOCOMMIT=1;
+--enable_query_log
+
+--sync_slave_with_master
+--source include/select_ndb_apply_status.inc
+
+--echo
+
+connection master;
+--source include/show_binlog_using_logname.inc
+
+# Flush the logs on the master moving all
+# Transaction to a new binlog and ensure
+# that the ndb_apply_status table is updated
+# to show the use of the new binlog.
+
+--echo
+--echo ** Test 3 **
+--echo
+
+# Flush logs on master which should force it
+# to switch to binlog #2
+
+FLUSH LOGS;
+
+# Run in some transaction to increase end pos in
+# binlog
+
+--disable_query_log
+SET AUTOCOMMIT=0;
+let $run= 5;
+while ($run)
+{
+ START TRANSACTION;
+ --eval CALL tpcb.trans($rpl_format);
+ eval SET @my_errno= $mysql_errno;
+ let $run_good= `SELECT @my_errno = 0`;
+ let $run_bad= `SELECT @my_errno <> 0`;
+ if ($run_good)
+ {
+ COMMIT;
+ }
+ if ($run_bad)
+ {
+ ROLLBACK;
+ }
+ dec $run;
+}
+SET AUTOCOMMIT=1;
+--enable_query_log
+
+--echo
+
+--sync_slave_with_master
+--source include/select_ndb_apply_status.inc
+
+--echo
+
+connection master;
+--source include/show_binlog_using_logname.inc
+
+# Now we reset both the master and the slave
+# Run some more transaction and ensure
+# that the ndb_apply_status is updated
+# correctly
+
+--echo
+--echo ** Test 4 **
+--echo
+
+# Reset both slave and master
+# This should reset binlog to #1
+--source include/master-slave-reset.inc
+
+--echo
+
+# Run in some transactions and check
+connection master;
+--disable_query_log
+SET AUTOCOMMIT=0;
+let $run= 5;
+while ($run)
+{
+ START TRANSACTION;
+ --eval CALL tpcb.trans($rpl_format);
+ eval SET @my_errno= $mysql_errno;
+ let $run_good= `SELECT @my_errno = 0`;
+ let $run_bad= `SELECT @my_errno <> 0`;
+ if ($run_good)
+ {
+ COMMIT;
+ }
+ if ($run_bad)
+ {
+ ROLLBACK;
+ }
+ dec $run;
+}
+SET AUTOCOMMIT=1;
+--enable_query_log
+
+--sync_slave_with_master
+--source include/select_ndb_apply_status.inc
+
+--echo
+
+connection master;
+--source include/show_binlog_using_logname.inc
+
+# Since we are doing replication, it is a good
+# idea to check to make sure all data was
+# Replicated correctly
+
+--echo
+--echo *** DUMP MASTER & SLAVE FOR COMPARE ********
+
+--exec $MYSQL_DUMP -n -t --compact --order-by-primary --skip-extended-insert tpcb account teller branch history > $MYSQLTEST_VARDIR/tmp/master_apply_status.sql
+
+--exec $MYSQL_DUMP_SLAVE -n -t --compact --order-by-primary --skip-extended-insert tpcb account teller branch history > $MYSQLTEST_VARDIR/tmp/slave_apply_status.sql
+
+connection master;
+DROP DATABASE tpcb;
+
+--sync_slave_with_master
+
+####### Commenting out until decision on Bug#27960 ###########
+
+#--source include/select_ndb_apply_status.inc
+
+#connection master;
+#--eval SHOW BINLOG EVENTS in '$log_name' from $start_pos
+#--source include/show_binlog_using_logname.inc
+
+--echo ****** Do dumps compare ************
+
+
+diff_files $MYSQLTEST_VARDIR/tmp/master_apply_status.sql $MYSQLTEST_VARDIR/tmp/slave_apply_status.sql;
+
+## Note: Ths files should only get removed, if the above diff succeeds.
+
+--exec rm $MYSQLTEST_VARDIR/tmp/master_apply_status.sql
+--exec rm $MYSQLTEST_VARDIR/tmp/slave_apply_status.sql
+
+
+# End of 5.1 Test
diff --git a/mysql-test/extra/rpl_tests/rpl_relayrotate.test b/mysql-test/extra/rpl_tests/rpl_relayrotate.test
index 0d2f25e2b4a..28670fe0985 100644
--- a/mysql-test/extra/rpl_tests/rpl_relayrotate.test
+++ b/mysql-test/extra/rpl_tests/rpl_relayrotate.test
@@ -8,8 +8,6 @@
# The slave is started with max_binlog_size=16384 bytes,
# to force many rotations (approximately 30 rotations)
--- source include/master-slave.inc
-
# We have to sync with master, to ensure slave had time to start properly
# before we stop it. If not, we get errors about UNIX_TIMESTAMP() in the log.
connection master;
diff --git a/mysql-test/extra/rpl_tests/rpl_reset_slave.test b/mysql-test/extra/rpl_tests/rpl_reset_slave.test
index 374b2620a34..83b39d3299a 100644
--- a/mysql-test/extra/rpl_tests/rpl_reset_slave.test
+++ b/mysql-test/extra/rpl_tests/rpl_reset_slave.test
@@ -13,26 +13,18 @@ connection master;
save_master_pos;
connection slave;
sync_with_master;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 16 # 23 # 33 #
-show slave status;
+source include/show_slave_status.inc;
stop slave;
change master to master_user='test';
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 16 # 23 # 33 #
-show slave status;
+source include/show_slave_status.inc;
reset slave;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 16 # 23 # 33 #
-show slave status;
+source include/show_slave_status.inc;
start slave;
sync_with_master;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 16 # 23 # 33 #
-show slave status;
+source include/show_slave_status.inc;
# test of crash with temp tables & RESET SLAVE
# (test to see if RESET SLAVE clears temp tables in memory and disk)
diff --git a/mysql-test/extra/rpl_tests/rpl_row_001.test b/mysql-test/extra/rpl_tests/rpl_row_001.test
index 9bdfae81093..6261659c4ce 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_001.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_001.test
@@ -1,6 +1,3 @@
--- source include/master-slave.inc
--- source include/have_binlog_format_row.inc
-
CREATE TABLE t1 (word CHAR(20) NOT NULL);
LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
diff --git a/mysql-test/extra/rpl_tests/rpl_row_UUID.test b/mysql-test/extra/rpl_tests/rpl_row_UUID.test
index b3fa2fabe2c..9f2dbb4ce4b 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_UUID.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_UUID.test
@@ -5,10 +5,6 @@
# TEST: To test the UUID() in rbr #
#############################################################################
-# Includes
--- source include/have_binlog_format_row.inc
--- source include/master-slave.inc
-
# Begin clean up test section
connection master;
@@ -45,7 +41,7 @@ end|
delimiter ;|
# test both in SELECT and in INSERT
select fn1(0);
-create table t2 (a int);
+eval create table t2 (a int) engine=$engine_type;
insert into t2 values(fn1(2));
sync_slave_with_master;
diff --git a/mysql-test/extra/rpl_tests/rpl_row_basic.test b/mysql-test/extra/rpl_tests/rpl_row_basic.test
index 9ba06096faf..6de254d9931 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_basic.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test
@@ -1,6 +1,3 @@
---source include/have_binlog_format_row.inc
---source include/master-slave.inc
-
#
# Basic tests of row-level logging
#
@@ -195,11 +192,11 @@ eval CREATE TABLE t8 (a INT PRIMARY KEY, b INT UNIQUE, c INT UNIQUE) ENGINE = $t
# First we make sure that the constraints are correctly set.
INSERT INTO t8 VALUES (99,99,99);
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
INSERT INTO t8 VALUES (99,22,33);
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
INSERT INTO t8 VALUES (11,99,33);
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
INSERT INTO t8 VALUES (11,22,99);
SELECT * FROM t8 ORDER BY a;
diff --git a/mysql-test/extra/rpl_tests/rpl_row_blob.test b/mysql-test/extra/rpl_tests/rpl_row_blob.test
index 2dc6867df32..080df7d75dd 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_blob.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_blob.test
@@ -5,10 +5,6 @@
# correctly.
################################################
-# Includes
--- source include/have_binlog_format_row.inc
--- source include/master-slave.inc
-
# Pre test clean up section
connection master;
--disable_warnings
diff --git a/mysql-test/extra/rpl_tests/rpl_row_charset.test b/mysql-test/extra/rpl_tests/rpl_row_charset.test
index 4ce5245a79a..a21ed5bb841 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_charset.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_charset.test
@@ -1,10 +1,6 @@
# Replication of character sets.
# This test will fail if the server/client does not support enough charsets.
-# Requires statement logging
--- source include/have_binlog_format_row.inc
-
--- source include/master-slave.inc
--disable_warnings
set timestamp=1000000000;
drop database if exists mysqltest2;
diff --git a/mysql-test/extra/rpl_tests/rpl_row_func003.test b/mysql-test/extra/rpl_tests/rpl_row_func003.test
index 662f1454096..8ee2d863527 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_func003.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_func003.test
@@ -18,11 +18,6 @@
# Vs slave. #
#############################################################################
-# Includes
--- source include/have_binlog_format_row.inc
--- source include/master-slave.inc
-
-
# Begin clean up test section
connection master;
--disable_warnings
diff --git a/mysql-test/extra/rpl_tests/rpl_row_sp003.test b/mysql-test/extra/rpl_tests/rpl_row_sp003.test
index df318ee0c0b..7cf3d0fa19c 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_sp003.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_sp003.test
@@ -3,11 +3,6 @@
# Original Date: Aug/13/2005 Created from Bug 12335 #
#############################################################################
-# Includes
--- source include/have_binlog_format_row.inc
--- source include/master-slave.inc
-
-
# Begin clean up test section
connection master;
--disable_warnings
diff --git a/mysql-test/extra/rpl_tests/rpl_row_sp006.test b/mysql-test/extra/rpl_tests/rpl_row_sp006.test
index da9206d7d3f..897d7e492bf 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_sp006.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_sp006.test
@@ -8,10 +8,6 @@
# to populate a table with data from the first table. #
#############################################################################
-# Includes
--- source include/have_binlog_format_row.inc
--- source include/master-slave.inc
-
# Begin clean up test section
connection master;
--disable_warnings
diff --git a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
index 0cf43d45348..23ac16d24ae 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
@@ -113,26 +113,30 @@ sync_slave_with_master;
connection master;
INSERT INTO t1_nodef VALUES (1,2);
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
+#
+# Replicating to tables with fewer columns at the end works as of WL#3228
+#
connection master;
INSERT INTO t9 VALUES (2);
sync_slave_with_master;
# Now slave is guaranteed to be running
connection master;
+--echo **** On Master ****
INSERT INTO t2 VALUES (2,4);
-connection slave;
-wait_for_slave_to_stop;
+SELECT * FROM t2;
+sync_slave_with_master;
+--echo **** On Slave ****
+SELECT * FROM t2;
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
connection master;
INSERT INTO t9 VALUES (4);
@@ -141,9 +145,9 @@ sync_slave_with_master;
connection master;
INSERT INTO t4 VALUES (4);
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -155,9 +159,9 @@ sync_slave_with_master;
connection master;
INSERT INTO t5 VALUES (5,10,25);
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -169,9 +173,9 @@ sync_slave_with_master;
connection master;
INSERT INTO t6 VALUES (6,12,36);
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -179,8 +183,8 @@ START SLAVE;
connection master;
INSERT INTO t9 VALUES (6);
sync_slave_with_master;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS
# Testing some tables extra field that can be null and cannot be null
diff --git a/mysql-test/extra/rpl_tests/rpl_stm_000001.test b/mysql-test/extra/rpl_tests/rpl_stm_000001.test
index 8673ae31305..d007e433ab6 100644
--- a/mysql-test/extra/rpl_tests/rpl_stm_000001.test
+++ b/mysql-test/extra/rpl_tests/rpl_stm_000001.test
@@ -98,7 +98,7 @@ reap;
connection slave;
# The SQL slave thread should now have stopped because the query was killed on
# the master (so it has a non-zero error code in the binlog).
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
# The following test can't be done because the result of Pos will differ
# on different computers
diff --git a/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test b/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test
index 654cb523f74..3304a0ff46d 100644
--- a/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test
+++ b/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test
@@ -19,12 +19,12 @@ set sql_log_bin=0;
insert into t1 values(2);
set sql_log_bin=1;
save_master_pos;
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values(1),(2);
drop table t1;
save_master_pos;
connection slave;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
# End of 4.1 tests
diff --git a/mysql-test/extra/rpl_tests/rpl_trig004.test b/mysql-test/extra/rpl_tests/rpl_trig004.test
index 5144943bc64..45cb11f2787 100644
--- a/mysql-test/extra/rpl_tests/rpl_trig004.test
+++ b/mysql-test/extra/rpl_tests/rpl_trig004.test
@@ -29,7 +29,7 @@ delimiter ;//
INSERT INTO test.t2 VALUES (1, 0.0);
# Expect duplicate error 1022 == ndb
---error 1022, ER_DUP_ENTRY_WITH_KEY_NAME
+--error 1022, ER_DUP_ENTRY
INSERT INTO test.t2 VALUES (1, 0.0);
#show binlog events;
diff --git a/mysql-test/include/ddl_i18n.check_events.inc b/mysql-test/include/ddl_i18n.check_events.inc
new file mode 100644
index 00000000000..8b0d70e3c0e
--- /dev/null
+++ b/mysql-test/include/ddl_i18n.check_events.inc
@@ -0,0 +1,48 @@
+# - Check SHOW CREATE statement;
+
+--echo
+--echo
+
+SHOW CREATE EVENT ev1|
+--echo
+SHOW CREATE EVENT ev2|
+--echo
+SHOW CREATE EVENT mysqltest2.ev3|
+--echo
+SHOW CREATE EVENT mysqltest2.ev3|
+
+# - Check SHOW statement;
+
+--echo
+--echo
+
+SHOW EVENTS LIKE 'ev1'|
+
+--echo
+SHOW EVENTS LIKE 'ev2'|
+
+--echo
+SHOW EVENTS LIKE 'ev3'|
+
+--echo
+SHOW EVENTS LIKE 'ev4'|
+
+# - Check INFORMATION_SCHEMA;
+
+--echo
+--echo
+
+--replace_column 17 CREATED 18 LAST_ALTERED
+SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev1'|
+
+--echo
+--replace_column 17 CREATED 18 LAST_ALTERED
+SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'|
+
+--echo
+--replace_column 17 CREATED 18 LAST_ALTERED
+SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'|
+
+--echo
+--replace_column 17 CREATED 18 LAST_ALTERED
+SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'|
diff --git a/mysql-test/include/ddl_i18n.check_sp.inc b/mysql-test/include/ddl_i18n.check_sp.inc
new file mode 100644
index 00000000000..bb1657d7072
--- /dev/null
+++ b/mysql-test/include/ddl_i18n.check_sp.inc
@@ -0,0 +1,83 @@
+# - Check SHOW CREATE statement;
+
+--echo
+--echo
+
+SHOW CREATE PROCEDURE p1|
+--echo
+SHOW CREATE PROCEDURE p2|
+--echo
+SHOW CREATE PROCEDURE mysqltest2.p3|
+--echo
+SHOW CREATE PROCEDURE mysqltest2.p4|
+
+# - Check SHOW statement;
+
+--echo
+--echo
+
+--replace_column 5 MODIFIED 6 CREATED
+SHOW PROCEDURE STATUS LIKE 'p1'|
+
+--echo
+--replace_column 5 MODIFIED 6 CREATED
+SHOW PROCEDURE STATUS LIKE 'p2'|
+
+--echo
+--replace_column 5 MODIFIED 6 CREATED
+SHOW PROCEDURE STATUS LIKE 'p3'|
+
+--echo
+--replace_column 5 MODIFIED 6 CREATED
+SHOW PROCEDURE STATUS LIKE 'p4'|
+
+# - Check INFORMATION_SCHEMA;
+
+--echo
+--echo
+
+--replace_column 16 CREATED 17 ALTERED
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p1'|
+
+--echo
+--replace_column 16 CREATED 17 ALTERED
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'|
+
+--echo
+--replace_column 16 CREATED 17 ALTERED
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'|
+
+--echo
+--replace_column 16 CREATED 17 ALTERED
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'|
+
+# - Initialize the used variables (actual values don't matter);
+
+--echo
+--echo
+
+SET @a = '1'|
+SET @b = '2'|
+
+# - Execute the routines;
+
+--echo
+--echo
+
+CALL p1(@a, @b)|
+SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
+
+--echo
+
+CALL p2(@a, @b)|
+SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
+
+--echo
+
+CALL mysqltest2.p3(@a, @b)|
+SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
+
+--echo
+
+CALL mysqltest2.p4(@a, @b)|
+SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
diff --git a/mysql-test/include/ddl_i18n.check_triggers.inc b/mysql-test/include/ddl_i18n.check_triggers.inc
new file mode 100644
index 00000000000..dbfbc3cda5e
--- /dev/null
+++ b/mysql-test/include/ddl_i18n.check_triggers.inc
@@ -0,0 +1,106 @@
+# - Check SHOW CREATE statement;
+
+--echo
+--echo
+
+SHOW CREATE TRIGGER trg1|
+--echo
+SHOW CREATE TRIGGER trg2|
+--echo
+SHOW CREATE TRIGGER mysqltest2.trg3|
+--echo
+SHOW CREATE TRIGGER mysqltest2.trg4|
+
+# - Check SHOW statement;
+
+--echo
+--echo
+
+SHOW TRIGGERS|
+
+--echo
+
+use mysqltest2|
+
+--echo
+
+SHOW TRIGGERS|
+
+use mysqltest1|
+
+# - Check INFORMATION_SCHEMA;
+
+--echo
+--echo
+
+--replace_column 17 CREATED
+SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg1'|
+
+--echo
+--replace_column 17 CREATED
+SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'|
+
+--echo
+--replace_column 17 CREATED
+SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'|
+
+--echo
+--replace_column 17 CREATED
+SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'|
+
+# - Initialize the used variables (actual values don't matter);
+
+--echo
+--echo
+
+SET @a1 = '1'|
+SET @a2 = '1'|
+SET @a3 = '1'|
+
+SET @b1 = '2'|
+SET @b2 = '2'|
+SET @b3 = '2'|
+
+# - Execute the triggers;
+
+--echo
+--echo
+
+INSERT INTO t1 VALUES(1)|
+
+--echo
+--echo ---> Log:
+SELECT msg FROM log|
+
+--echo
+SELECT
+ COLLATION(@a1) AS ca1,
+ COLLATION(@a2) AS ca2,
+ COLLATION(@a3) AS ca3,
+ COLLATION(@b1) AS cb1,
+ COLLATION(@b2) AS cb2,
+ COLLATION(@b3) AS cb3|
+
+--echo
+DELETE FROM log|
+
+--echo
+--echo
+
+INSERT INTO mysqltest2.t1 VALUES(1)|
+
+--echo
+--echo ---> Log:
+SELECT msg FROM mysqltest2.log|
+
+--echo
+SELECT
+ COLLATION(@a1) AS ca1,
+ COLLATION(@a2) AS ca2,
+ COLLATION(@a3) AS ca3,
+ COLLATION(@b1) AS cb1,
+ COLLATION(@b2) AS cb2,
+ COLLATION(@b3) AS cb3|
+
+--echo
+DELETE FROM mysqltest2.log|
diff --git a/mysql-test/include/ddl_i18n.check_views.inc b/mysql-test/include/ddl_i18n.check_views.inc
new file mode 100644
index 00000000000..727f3506e4a
--- /dev/null
+++ b/mysql-test/include/ddl_i18n.check_views.inc
@@ -0,0 +1,32 @@
+# - Check SHOW CREATE statement;
+
+--echo
+--echo
+
+SHOW CREATE VIEW v1|
+
+--echo
+
+SHOW CREATE VIEW v2|
+
+# - Check INFORMATION_SCHEMA;
+
+--echo
+--echo
+
+SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'|
+
+--echo
+
+SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v2'|
+
+# - Execute the views;
+
+--echo
+--echo
+
+SELECT COLLATION(c1), COLLATION(c2) FROM v1|
+
+--echo
+
+SELECT COLLATION(c1) FROM v2|
diff --git a/mysql-test/include/deadlock.inc b/mysql-test/include/deadlock.inc
index 41c68f39320..89c34abc871 100644
--- a/mysql-test/include/deadlock.inc
+++ b/mysql-test/include/deadlock.inc
@@ -144,4 +144,29 @@ disconnect con1;
disconnect con2;
drop table t1, t2;
-# End of 4.1 tests
+--echo End of 4.1 tests
+
+#
+# Bug#25164 create table `a` as select * from `A` hangs
+#
+
+set storage_engine=innodb;
+
+--disable_warnings
+drop table if exists a;
+drop table if exists A;
+--enable_warnings
+
+create table A (c int);
+insert into A (c) values (0);
+--error 0,ER_LOCK_DEADLOCK,ER_UPDATE_TABLE_USED
+create table a as select * from A;
+drop table A;
+
+--disable_warnings
+drop table if exists a;
+--enable_warnings
+
+set storage_engine=default;
+
+--echo End of 5.0 tests.
diff --git a/mysql-test/include/federated.inc b/mysql-test/include/federated.inc
index dde24cd8198..925ecdd9682 100644
--- a/mysql-test/include/federated.inc
+++ b/mysql-test/include/federated.inc
@@ -1,3 +1,4 @@
+--source include/have_log_bin.inc
--source include/not_embedded.inc
--source ./include/have_federated_db.inc
diff --git a/mysql-test/include/grant_cache.inc b/mysql-test/include/grant_cache.inc
new file mode 100644
index 00000000000..dd65d1ed726
--- /dev/null
+++ b/mysql-test/include/grant_cache.inc
@@ -0,0 +1,203 @@
+################### include/grant_cache.inc ####################
+#
+# Test grants with query cache
+#
+# Last update:
+# 2007-05-03 ML - Move t/grant_cache.test to include/grant_cache.inc
+# - Remove the disabling of the ps-protocol
+# - minor improvements like error names instead of numbers
+# - Create two toplevel tests sourcing this routine
+#
+# Running this test with and without "--ps-protocol" produces different
+# Qcache_not_cached results because of the following reason:
+# In normal protocol, a SELECT failing due to insufficient privileges
+# increments Qcache_not_cached, while in ps-protocol, no.
+# In detail:
+# - In normal protocol,
+# the "access denied" errors on SELECT are issued at (stack trace):
+# mysql_parse/mysql_execute_command/execute_sqlcom_select/handle_select/
+# mysql_select/JOIN::prepare/setup_wild/insert_fields/
+# check_grant_all_columns/my_error/my_message_sql, which then calls
+# push_warning/query_cache_abort: at this moment,
+# query_cache_store_query() has been called, so query exists in cache,
+# so thd->net.query_cache_query!=NULL, so query_cache_abort() removes
+# the query from cache, which causes a query_cache.refused++ (thus,
+# a Qcache_not_cached++).
+# - In ps-protocol,
+# the error is issued at prepare time;
+# for this mysql_test_select() is called, not execute_sqlcom_select()
+# (and that also leads to JOIN::prepare/etc). Thus, as
+# query_cache_store_query() has not been called,
+# thd->net.query_cache_query==NULL, so query_cache_abort() does nothing:
+# Qcache_not_cached is not incremented.
+#
+# A run of this tests with sp/cursor/view protocol does not make sense
+# because these protocols serve totally different purposes than this test.
+#
+
+--source include/add_anonymous_users.inc
+
+#
+--disable_warnings
+drop table if exists test.t1,mysqltest.t1,mysqltest.t2;
+drop database if exists mysqltest;
+--enable_warnings
+
+set GLOBAL query_cache_size=1355776;
+
+reset query cache;
+flush status;
+--echo ----- establish connection root -----
+connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
+connection root;
+show grants for current_user;
+show grants;
+--disable_warnings
+create database if not exists mysqltest;
+--enable_warnings
+
+create table mysqltest.t1 (a int,b int,c int);
+create table mysqltest.t2 (a int,b int,c int);
+insert into mysqltest.t1 values (1,1,1),(2,2,2);
+insert into mysqltest.t2 values (3,3,3);
+create table test.t1 (a char (10));
+insert into test.t1 values ("test.t1");
+select * from t1;
+--echo ----- establish connection root2 -----
+connect (root2,localhost,root,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
+connection root2;
+# put queries in cache
+select * from t1;
+select a from t1;
+select c from t1;
+select * from t2;
+select * from mysqltest.t1,test.t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits%";
+
+# Create the test users
+grant SELECT on mysqltest.* to mysqltest_1@localhost;
+grant SELECT on mysqltest.t1 to mysqltest_2@localhost;
+grant SELECT on test.t1 to mysqltest_2@localhost;
+grant SELECT(a) on mysqltest.t1 to mysqltest_3@localhost;
+
+# The following queries should be fetched from cache
+--echo ----- establish connection user1 (user=mysqltest_1) -----
+connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
+connection user1;
+show grants for current_user();
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+show status like "Qcache_not_cached";
+select "user1";
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+show status like "Qcache_not_cached";
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+show status like "Qcache_not_cached";
+# The pre and end space are intentional
+ select a from t1 ;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+show status like "Qcache_not_cached";
+select c from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+show status like "Qcache_not_cached";
+
+
+--echo ----- establish connection unkuser (user=unkuser) -----
+# Don't use '' as user because it will pick Unix login
+connect (unkuser,localhost,unkuser,,,$MASTER_MYPORT,$MASTER_MYSOCK);
+connection unkuser;
+show grants for current_user();
+
+# The following queries should be fetched from cache
+--echo ----- establish connection user2 (user=mysqltest_2) -----
+connect (user2,localhost,mysqltest_2,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
+connection user2;
+select "user2";
+select * from t1;
+select a from t1;
+select c from t1;
+select * from mysqltest.t1,test.t1;
+--replace_result 127.0.0.1 localhost
+--error ER_TABLEACCESS_DENIED_ERROR
+select * from t2;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+show status like "Qcache_not_cached";
+
+# The following queries should not be fetched from cache
+--echo ----- establish connection user3 (user=mysqltest_3) -----
+connect (user3,localhost,mysqltest_3,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
+connection user3;
+select "user3";
+--replace_result 127.0.0.1 localhost
+--error ER_COLUMNACCESS_DENIED_ERROR
+select * from t1;
+select a from t1;
+--replace_result 127.0.0.1 localhost
+--error ER_COLUMNACCESS_DENIED_ERROR
+select c from t1;
+--replace_result 127.0.0.1 localhost
+--error ER_TABLEACCESS_DENIED_ERROR
+select * from t2;
+--replace_result 127.0.0.1 localhost
+--error ER_COLUMNACCESS_DENIED_ERROR
+select mysqltest.t1.c from test.t1,mysqltest.t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+show status like "Qcache_not_cached";
+
+# Connect without a database
+--echo ----- establish connection user4 (user=mysqltest_1) -----
+connect (user4,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,$MASTER_MYSOCK);
+connection user4;
+select "user4";
+show grants;
+--error ER_NO_DB_ERROR
+select a from t1;
+# The following query is not cached before (different database)
+select * from mysqltest.t1,test.t1;
+# Cache a query with 'no database'
+select a from mysqltest.t1;
+select a from mysqltest.t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+show status like "Qcache_not_cached";
+
+# Cleanup
+
+--echo ----- switch to connection default and close connections -----
+connection default;
+disconnect root;
+disconnect root2;
+disconnect user1;
+disconnect user2;
+disconnect user3;
+disconnect user4;
+disconnect unkuser;
+
+#
+# A temporary 4.1 workaround to make this test pass if
+# mysql was compiled with other than latin1 --with-charset=XXX.
+# Without "set names binary" the below queries fail with
+# "Illegal mix of collations" error.
+# In 5.0 we will change grant tables to use NCHAR(N) instead
+# of "CHAR(N) BINARY", and use cast-to-nchar: N'mysqltest_1'.
+#
+set names binary;
+delete from mysql.user where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
+delete from mysql.db where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
+delete from mysql.tables_priv where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
+delete from mysql.columns_priv where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
+flush privileges;
+drop table test.t1,mysqltest.t1,mysqltest.t2;
+drop database mysqltest;
+
+set GLOBAL query_cache_size=default;
+
+--source include/delete_anonymous_users.inc
diff --git a/mysql-test/include/handler.inc b/mysql-test/include/handler.inc
index 67fff16c577..437dd6ced4d 100644
--- a/mysql-test/include/handler.inc
+++ b/mysql-test/include/handler.inc
@@ -465,3 +465,36 @@ select * from t1;
# Just to be sure and not confuse the next test case writer.
drop table if exists t1;
+#
+# Bug#25856 - HANDLER table OPEN in one connection lock DROP TABLE in another one
+#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+eval create table t1 (a int) ENGINE=$other_engine_type;
+--echo --> client 2
+connection con2;
+--error 1031
+handler t1 open;
+--echo --> client 1
+connection default;
+drop table t1;
+
+#
+# Bug#30632 HANDLER read failure causes hang
+#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int);
+handler t1 open as t1_alias;
+--error 1176
+handler t1_alias read a next;
+--error 1054
+handler t1_alias READ a next where inexistent > 0;
+--error 1176
+handler t1_alias read a next;
+--error 1054
+handler t1_alias READ a next where inexistent > 0;
+handler t1_alias close;
+drop table t1;
diff --git a/mysql-test/include/have_archive.inc b/mysql-test/include/have_archive.inc
index 9f0038db97a..82399ca4c6c 100644
--- a/mysql-test/include/have_archive.inc
+++ b/mysql-test/include/have_archive.inc
@@ -1,4 +1,4 @@
--disable_query_log
--require r/true.require
-select support = 'Enabled' as `TRUE` from information_schema.engines where engine = 'archive';
+select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'archive';
--enable_query_log
diff --git a/mysql-test/include/have_binlog_format_mixed.inc b/mysql-test/include/have_binlog_format_mixed.inc
index fc5ca61c5a0..fc1dc8324c6 100644
--- a/mysql-test/include/have_binlog_format_mixed.inc
+++ b/mysql-test/include/have_binlog_format_mixed.inc
@@ -1,3 +1,5 @@
+--source include/have_log_bin.inc
+
-- require r/have_binlog_format_mixed.require
disable_query_log;
show variables like "binlog_format";
diff --git a/mysql-test/include/have_binlog_format_mixed_or_row.inc b/mysql-test/include/have_binlog_format_mixed_or_row.inc
index c38b8f3d601..fcba9eef883 100644
--- a/mysql-test/include/have_binlog_format_mixed_or_row.inc
+++ b/mysql-test/include/have_binlog_format_mixed_or_row.inc
@@ -1,3 +1,5 @@
+--source include/have_log_bin.inc
+
--require r/have_binlog_format_row.require
--disable_query_log
--replace_result MIXED ROW
diff --git a/mysql-test/include/have_binlog_format_mixed_or_statement.inc b/mysql-test/include/have_binlog_format_mixed_or_statement.inc
index 8ee6f2cc030..700b58a77fb 100644
--- a/mysql-test/include/have_binlog_format_mixed_or_statement.inc
+++ b/mysql-test/include/have_binlog_format_mixed_or_statement.inc
@@ -1,3 +1,6 @@
+source include/have_log_bin.inc;
+
+
--require r/have_binlog_format_statement.require
--disable_query_log
--replace_result MIXED STATEMENT
diff --git a/mysql-test/include/have_binlog_format_row.inc b/mysql-test/include/have_binlog_format_row.inc
index 2992b8e0f32..f24bca52b5a 100644
--- a/mysql-test/include/have_binlog_format_row.inc
+++ b/mysql-test/include/have_binlog_format_row.inc
@@ -1,3 +1,5 @@
+--source include/have_log_bin.inc
+
-- require r/have_binlog_format_row.require
disable_query_log;
show variables like "binlog_format";
diff --git a/mysql-test/include/have_binlog_format_statement.inc b/mysql-test/include/have_binlog_format_statement.inc
index c99297c10e5..ca863293d1d 100644
--- a/mysql-test/include/have_binlog_format_statement.inc
+++ b/mysql-test/include/have_binlog_format_statement.inc
@@ -1,3 +1,5 @@
+--source include/have_log_bin.inc
+
-- require r/have_binlog_format_statement.require
disable_query_log;
show variables like "binlog_format";
diff --git a/mysql-test/include/have_blackhole.inc b/mysql-test/include/have_blackhole.inc
index e13cff52094..6c4da01d61d 100644
--- a/mysql-test/include/have_blackhole.inc
+++ b/mysql-test/include/have_blackhole.inc
@@ -1,4 +1,4 @@
disable_query_log;
--require r/true.require
-select support = 'Enabled' as `TRUE` from information_schema.engines where engine = 'blackhole';
+select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'blackhole';
enable_query_log;
diff --git a/mysql-test/include/have_bug25714.inc b/mysql-test/include/have_bug25714.inc
new file mode 100644
index 00000000000..0c09ae1a035
--- /dev/null
+++ b/mysql-test/include/have_bug25714.inc
@@ -0,0 +1,7 @@
+#
+# Check if the variable MYSQL_BUG25714 is set
+#
+--require r/have_bug25714.require
+disable_query_log;
+eval select LENGTH("$MYSQL_BUG25714") > 0 as "have_bug25714_exe";
+enable_query_log;
diff --git a/mysql-test/include/have_cp1251.inc b/mysql-test/include/have_cp1251.inc
new file mode 100644
index 00000000000..2d5f1b3b529
--- /dev/null
+++ b/mysql-test/include/have_cp1251.inc
@@ -0,0 +1,7 @@
+--require r/have_cp1251.require
+
+--disable_query_log
+
+SHOW COLLATION LIKE 'cp1251_general_ci';
+
+--enable_query_log
diff --git a/mysql-test/include/have_cp866.inc b/mysql-test/include/have_cp866.inc
new file mode 100644
index 00000000000..27390d87d51
--- /dev/null
+++ b/mysql-test/include/have_cp866.inc
@@ -0,0 +1,7 @@
+--require r/have_cp866.require
+
+--disable_query_log
+
+SHOW COLLATION LIKE 'cp866_general_ci';
+
+--enable_query_log
diff --git a/mysql-test/include/have_csv.inc b/mysql-test/include/have_csv.inc
index 3175fc16fe7..410caa95285 100644
--- a/mysql-test/include/have_csv.inc
+++ b/mysql-test/include/have_csv.inc
@@ -1,4 +1,4 @@
disable_query_log;
--require r/true.require
-select support = 'Enabled' as `TRUE` from information_schema.engines where engine = 'csv';
+select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'csv';
enable_query_log;
diff --git a/mysql-test/include/have_exampledb.inc b/mysql-test/include/have_exampledb.inc
index e3fd068b485..db3985e3c7c 100644
--- a/mysql-test/include/have_exampledb.inc
+++ b/mysql-test/include/have_exampledb.inc
@@ -1,4 +1,4 @@
disable_query_log;
--require r/true.require
-select support = 'Enabled' as `TRUE` from information_schema.engines where engine = 'example';
+select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'example';
enable_query_log;
diff --git a/mysql-test/include/have_federated_db.inc b/mysql-test/include/have_federated_db.inc
index abef5a64d30..041a29f460b 100644
--- a/mysql-test/include/have_federated_db.inc
+++ b/mysql-test/include/have_federated_db.inc
@@ -1,4 +1,4 @@
disable_query_log;
--require r/true.require
-select support = 'Enabled' as `TRUE` from information_schema.engines where engine = 'federated';
+select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'federated';
enable_query_log;
diff --git a/mysql-test/include/have_innodb.inc b/mysql-test/include/have_innodb.inc
index be8850725e5..cbffe6a2574 100644
--- a/mysql-test/include/have_innodb.inc
+++ b/mysql-test/include/have_innodb.inc
@@ -1,4 +1,4 @@
disable_query_log;
--require r/true.require
-select support = 'Enabled' as `TRUE` from information_schema.engines where engine = 'innodb';
+select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'innodb';
enable_query_log;
diff --git a/mysql-test/include/have_koi8r.inc b/mysql-test/include/have_koi8r.inc
new file mode 100644
index 00000000000..1fe163565ba
--- /dev/null
+++ b/mysql-test/include/have_koi8r.inc
@@ -0,0 +1,7 @@
+--require r/have_koi8r.require
+
+--disable_query_log
+
+SHOW COLLATION LIKE 'koi8r_general_ci';
+
+--enable_query_log
diff --git a/mysql-test/include/have_log_bin.inc b/mysql-test/include/have_log_bin.inc
new file mode 100644
index 00000000000..11530dc953e
--- /dev/null
+++ b/mysql-test/include/have_log_bin.inc
@@ -0,0 +1,4 @@
+-- require r/have_log_bin.require
+disable_query_log;
+show variables like "log_bin";
+enable_query_log;
diff --git a/mysql-test/include/have_multi_ndb.inc b/mysql-test/include/have_multi_ndb.inc
index 819518b2674..deda22b64c0 100644
--- a/mysql-test/include/have_multi_ndb.inc
+++ b/mysql-test/include/have_multi_ndb.inc
@@ -10,7 +10,8 @@ drop table if exists t1, t2;
--enable_warnings
flush tables;
--require r/true.require
-select support = 'Enabled' as `TRUE` from information_schema.engines where engine = 'ndbcluster';
+select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'ndbcluster';
+--source include/ndb_not_readonly.inc
enable_query_log;
# Check that server2 has NDB support
@@ -21,12 +22,9 @@ drop table if exists t1, t2;
--enable_warnings
flush tables;
--require r/true.require
-select support = 'Enabled' as `TRUE` from information_schema.engines where engine = 'ndbcluster';
+select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'ndbcluster';
+--source include/ndb_not_readonly.inc
enable_query_log;
-# Check should be here as well...
-# # Check that second master mysqld has come out of redonly mode
-# --source include/ndb_not_readonly.inc
-
# Set the default connection to 'server1'
connection server1;
diff --git a/mysql-test/include/have_ndb.inc b/mysql-test/include/have_ndb.inc
index c9603634508..cfc5b5d0ff8 100644
--- a/mysql-test/include/have_ndb.inc
+++ b/mysql-test/include/have_ndb.inc
@@ -1,9 +1,10 @@
# Check that server is compiled and started with support for NDB
-disable_query_log;
---require r/true.require
-select support = 'Enabled' as `TRUE` from information_schema.engines where engine = 'ndbcluster';
-enable_query_log;
-
-
-
-
+#disable_query_log;
+#--require r/true.require
+#select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'ndbcluster';
+#--source include/ndb_not_readonly.inc
+#enable_query_log;
+# always make sure we have both mysql servers started ok before test starts
+# there are some initial startup bugs that are avoided by doing this, avoiding sporadic
+# failures in mysql-test-run
+--source include/have_multi_ndb.inc
diff --git a/mysql-test/include/have_outfile.inc b/mysql-test/include/have_outfile.inc
index 10f093ec3ef..ae4a2723840 100644
--- a/mysql-test/include/have_outfile.inc
+++ b/mysql-test/include/have_outfile.inc
@@ -1,5 +1,5 @@
-- require r/have_outfile.require
disable_query_log;
select load_file(concat(@tmpdir,"/outfile.test"));
---exec rm $MYSQLTEST_VARDIR/tmp/outfile.test
+--remove_file $MYSQLTEST_VARDIR/tmp/outfile.test
enable_query_log;
diff --git a/mysql-test/include/have_utf8.inc b/mysql-test/include/have_utf8.inc
new file mode 100644
index 00000000000..58b74f4072f
--- /dev/null
+++ b/mysql-test/include/have_utf8.inc
@@ -0,0 +1,7 @@
+--require r/have_utf8.require
+
+--disable_query_log
+
+SHOW COLLATION LIKE 'utf8_general_ci';
+
+--enable_query_log
diff --git a/mysql-test/include/index_merge1.inc b/mysql-test/include/index_merge1.inc
index a3a874a8ed2..2ecdbe583c2 100644
--- a/mysql-test/include/index_merge1.inc
+++ b/mysql-test/include/index_merge1.inc
@@ -439,3 +439,51 @@ INSERT INTO t2(a,b) VALUES(1,2);
SELECT t2.a FROM t1,t2 WHERE t2.b=2 AND t2.a=1;
UNLOCK TABLES;
DROP TABLE t1, t2;
+
+#
+# BUG#29740: HA_KEY_SCAN_NOT_ROR wasn't set for HEAP engine
+#
+CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `filler` char(200) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ KEY `a` (`a`),
+ KEY `b` (`b`)
+) ENGINE=MEMORY DEFAULT CHARSET=latin1;
+
+insert into t1 values
+(0, 'filler', 0), (1, 'filler', 1), (2, 'filler', 2), (3, 'filler', 3),
+(4, 'filler', 4), (5, 'filler', 5), (6, 'filler', 6), (7, 'filler', 7),
+(8, 'filler', 8), (9, 'filler', 9), (0, 'filler', 0), (1, 'filler', 1),
+(2, 'filler', 2), (3, 'filler', 3), (4, 'filler', 4), (5, 'filler', 5),
+(6, 'filler', 6), (7, 'filler', 7), (8, 'filler', 8), (9, 'filler', 9),
+(10, 'filler', 10), (11, 'filler', 11), (12, 'filler', 12), (13, 'filler', 13),
+(14, 'filler', 14), (15, 'filler', 15), (16, 'filler', 16), (17, 'filler', 17),
+(18, 'filler', 18), (19, 'filler', 19), (4, '5 ', 0), (5, '4 ', 0),
+(4, '4 ', 0), (4, 'qq ', 5), (5, 'qq ', 4), (4, 'zz ', 4);
+
+create table t2(
+ `a` int(11) DEFAULT NULL,
+ `filler` char(200) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ KEY USING BTREE (`a`),
+ KEY USING BTREE (`b`)
+) ENGINE=MEMORY DEFAULT CHARSET=latin1;
+insert into t2 select * from t1;
+
+--echo must use sort-union rather than union:
+--replace_column 9 #
+explain select * from t1 where a=4 or b=4;
+--sorted_result
+select * from t1 where a=4 or b=4;
+--sorted_result
+select * from t1 ignore index(a,b) where a=4 or b=4;
+
+--echo must use union, not sort-union:
+--replace_column 9 #
+explain select * from t2 where a=4 or b=4;
+--sorted_result
+select * from t2 where a=4 or b=4;
+
+drop table t1, t2;
+
diff --git a/mysql-test/include/innodb_trx_weight.inc b/mysql-test/include/innodb_trx_weight.inc
new file mode 100644
index 00000000000..56d3d47da36
--- /dev/null
+++ b/mysql-test/include/innodb_trx_weight.inc
@@ -0,0 +1,51 @@
+-- connect (con1,localhost,root,,)
+-- connect (con2,localhost,root,,)
+
+-- connection con1
+SET autocommit=0;
+SELECT * FROM t1 FOR UPDATE;
+-- if ($con1_extra_sql_present) {
+ -- eval $con1_extra_sql
+-- }
+
+-- connection con2
+SET autocommit=0;
+SELECT * FROM t2 FOR UPDATE;
+-- if ($con2_extra_sql_present) {
+ -- eval $con2_extra_sql
+-- }
+
+-- if ($con1_should_be_rolledback) {
+ -- connection con1
+ -- send
+ INSERT INTO t2 VALUES (0);
+
+ -- connection con2
+ INSERT INTO t1 VALUES (0);
+ ROLLBACK;
+
+ -- connection con1
+ -- error ER_LOCK_DEADLOCK
+ -- reap
+-- }
+# else
+-- if (!$con1_should_be_rolledback) {
+ -- connection con2
+ -- send
+ INSERT INTO t1 VALUES (0);
+
+ -- connection con1
+ INSERT INTO t2 VALUES (0);
+ ROLLBACK;
+
+ -- connection con2
+ -- error ER_LOCK_DEADLOCK
+ -- reap
+-- }
+
+-- connection default
+
+DELETE FROM t5_nontrans;
+
+-- disconnect con1
+-- disconnect con2
diff --git a/mysql-test/include/is_debug_build.inc b/mysql-test/include/is_debug_build.inc
deleted file mode 100644
index 23a2814e2bb..00000000000
--- a/mysql-test/include/is_debug_build.inc
+++ /dev/null
@@ -1,4 +0,0 @@
--- require r/is_debug_build.require
---disable_query_log
-select instr(version(), "debug") > 0;
---enable_query_log
diff --git a/mysql-test/include/master-slave.inc b/mysql-test/include/master-slave.inc
index fe1dacb433e..e0eb87f02f7 100644
--- a/mysql-test/include/master-slave.inc
+++ b/mysql-test/include/master-slave.inc
@@ -1,3 +1,6 @@
+# Replication tests need binlog
+source include/have_log_bin.inc;
+
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
connect (master1,127.0.0.1,root,,test,$MASTER_MYPORT,);
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
diff --git a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc
index 352d5a987a2..e2a22303d9d 100644
--- a/mysql-test/include/mix1.inc
+++ b/mysql-test/include/mix1.inc
@@ -28,7 +28,7 @@
eval SET SESSION STORAGE_ENGINE = $engine_type;
--disable_warnings
-drop table if exists t1,t2,t1m,t1i,t2m,t2i,t4;
+drop table if exists t1,t2,t3,t1m,t1i,t2m,t2i,t4;
--enable_warnings
@@ -197,8 +197,30 @@ INSERT INTO t1 (c1) VALUES ('1b') ON DUPLICATE KEY UPDATE cnt=cnt+1;
SELECT * FROM t1;
DROP TABLE t1;
---echo End of 4.1 tests
+#
+# Bug #28272: EXPLAIN for SELECT from an empty InnoDB table
+#
+
+CREATE TABLE t1 (
+ a1 decimal(10,0) DEFAULT NULL,
+ a2 blob,
+ a3 time DEFAULT NULL,
+ a4 blob,
+ a5 char(175) DEFAULT NULL,
+ a6 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+ a7 tinyblob,
+ INDEX idx (a6,a7(239),a5)
+) ENGINE=InnoDB;
+
+EXPLAIN SELECT a4 FROM t1 WHERE
+a6=NULL AND
+a4='UNcT5pIde4I6c2SheTo4gt92OV1jgJCVkXmzyf325R1DwLURkbYHwhydANIZMbKTgdcR5xS';
+EXPLAIN SELECT t1.a4 FROM t1, t1 t WHERE
+t.a6=t.a6 AND t1.a6=NULL AND
+t1.a4='UNcT5pIde4I6c2SheTo4gt92OV1jgJCVkXmzyf325R1DwLURkbYHwhydANIZMbKTgdcR5xS';
+
+DROP TABLE t1;
#
# Bug #12882 min/max inconsistent on empty table
@@ -399,24 +421,6 @@ SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
DROP TABLE t1,t2;
#
-# Bug#22781: SQL_BIG_RESULT fails to influence sort plan
-#
-CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c FLOAT, KEY b(b)) ENGINE = INNODB;
-
-INSERT INTO t1 VALUES ( 1 , 1 , 1);
-INSERT INTO t1 SELECT a + 1 , MOD(a + 1 , 20), 1 FROM t1;
-INSERT INTO t1 SELECT a + 2 , MOD(a + 2 , 20), 1 FROM t1;
-INSERT INTO t1 SELECT a + 4 , MOD(a + 4 , 20), 1 FROM t1;
-INSERT INTO t1 SELECT a + 8 , MOD(a + 8 , 20), 1 FROM t1;
-INSERT INTO t1 SELECT a + 16, MOD(a + 16, 20), 1 FROM t1;
-INSERT INTO t1 SELECT a + 32, MOD(a + 32, 20), 1 FROM t1;
-INSERT INTO t1 SELECT a + 64, MOD(a + 64, 20), 1 FROM t1;
-
-EXPLAIN SELECT b, SUM(c) FROM t1 GROUP BY b;
-EXPLAIN SELECT SQL_BIG_RESULT b, SUM(c) FROM t1 GROUP BY b;
-DROP TABLE t1;
-
-#
# Bug#26159: crash for a loose scan of a table that has been emptied
#
@@ -477,40 +481,6 @@ set global query_cache_size=@save_qcache_size;
--source include/innodb_rollback_on_timeout.inc
#
-# Bug #27210: INNODB ON DUPLICATE KEY UPDATE
-#
-
-set @save_qcache_size=@@global.query_cache_size;
-set @save_qcache_type=@@global.query_cache_type;
-set global query_cache_size=10*1024*1024;
-set global query_cache_type=1;
-connect (con1,localhost,root,,);
-connection con1;
-drop table if exists `test`;
-CREATE TABLE `test` (`test1` varchar(3) NOT NULL,
- `test2` varchar(4) NOT NULL,PRIMARY KEY (`test1`))
- ENGINE=InnoDB DEFAULT CHARSET=latin1;
-INSERT INTO `test` (`test1`, `test2`) VALUES ('tes', '5678');
-disconnect con1;
-connect (con2,localhost,root,,);
-connection con2;
-select * from test;
-INSERT INTO `test` (`test1`, `test2`) VALUES ('tes', '1234')
- ON DUPLICATE KEY UPDATE `test2` = '1234';
-select * from test;
-flush tables;
-select * from test;
-disconnect con2;
-connection default;
-drop table test;
-set global query_cache_type=@save_qcache_type;
-set global query_cache_size=@save_qcache_size;
-
---echo End of 5.0 tests
-
--- source include/have_innodb.inc
-
-#
# Bug #27650: INSERT fails after multi-row INSERT of the form:
# INSERT INTO t (id...) VALUES (NULL...) ON DUPLICATE KEY UPDATE id=VALUES(id)
#
@@ -554,7 +524,203 @@ select * from t1;
drop table t1;
---echo End of 5.0 tests
+#
+# Bug #28189: optimizer erroniously prefers ref access to range access
+# for an InnoDB table
+#
+
+CREATE TABLE t1(
+ id int AUTO_INCREMENT PRIMARY KEY,
+ stat_id int NOT NULL,
+ acct_id int DEFAULT NULL,
+ INDEX idx1 (stat_id, acct_id),
+ INDEX idx2 (acct_id)
+) ENGINE=MyISAM;
+
+CREATE TABLE t2(
+ id int AUTO_INCREMENT PRIMARY KEY,
+ stat_id int NOT NULL,
+ acct_id int DEFAULT NULL,
+ INDEX idx1 (stat_id, acct_id),
+ INDEX idx2 (acct_id)
+) ENGINE=InnoDB;
+
+INSERT INTO t1(stat_id,acct_id) VALUES
+ (1,759), (2,831), (3,785), (4,854), (1,921),
+ (1,553), (2,589), (3,743), (2,827), (2,545),
+ (4,779), (4,783), (1,597), (1,785), (4,832),
+ (1,741), (1,833), (3,788), (2,973), (1,907);
+
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+UPDATE t1 SET acct_id=785
+ WHERE MOD(stat_id,2)=0 AND MOD(id,stat_id)=MOD(acct_id,stat_id);
+OPTIMIZE TABLE t1;
+
+SELECT COUNT(*) FROM t1;
+SELECT COUNT(*) FROM t1 WHERE acct_id=785;
+
+EXPLAIN SELECT COUNT(*) FROM t1 WHERE stat_id IN (1,3) AND acct_id=785;
+
+INSERT INTO t2 SELECT * FROM t1;
+OPTIMIZE TABLE t2;
+
+EXPLAIN SELECT COUNT(*) FROM t2 WHERE stat_id IN (1,3) AND acct_id=785;
+
+DROP TABLE t1,t2;
+
+#
+# Bug #28652: assert when alter innodb table operation
+#
+create table t1(a int) engine=innodb;
+alter table t1 comment '123';
+show create table t1;
+drop table t1;
+
+#
+# Bug #25866: Getting "#HY000 Can't find record in..." on and INSERT
+#
+CREATE TABLE t1 (a CHAR(2), KEY (a)) ENGINE = InnoDB DEFAULT CHARSET=UTF8;
+INSERT INTO t1 VALUES ('uk'),('bg');
+SELECT * FROM t1 WHERE a = 'uk';
+DELETE FROM t1 WHERE a = 'uk';
+SELECT * FROM t1 WHERE a = 'uk';
+UPDATE t1 SET a = 'us' WHERE a = 'uk';
+SELECT * FROM t1 WHERE a = 'uk';
+
+CREATE TABLE t2 (a CHAR(2), KEY (a)) ENGINE = InnoDB;
+INSERT INTO t2 VALUES ('uk'),('bg');
+SELECT * FROM t2 WHERE a = 'uk';
+DELETE FROM t2 WHERE a = 'uk';
+SELECT * FROM t2 WHERE a = 'uk';
+INSERT INTO t2 VALUES ('uk');
+UPDATE t2 SET a = 'us' WHERE a = 'uk';
+SELECT * FROM t2 WHERE a = 'uk';
+
+CREATE TABLE t3 (a CHAR(2), KEY (a)) ENGINE = MyISAM;
+INSERT INTO t3 VALUES ('uk'),('bg');
+SELECT * FROM t3 WHERE a = 'uk';
+DELETE FROM t3 WHERE a = 'uk';
+SELECT * FROM t3 WHERE a = 'uk';
+INSERT INTO t3 VALUES ('uk');
+UPDATE t3 SET a = 'us' WHERE a = 'uk';
+SELECT * FROM t3 WHERE a = 'uk';
+
+DROP TABLE t1,t2,t3;
+
+#
+# Test bug when trying to drop data file which no InnoDB directory entry
+#
+
+create table t1 (a int) engine=innodb;
+copy_file $MYSQLTEST_VARDIR/master-data/test/t1.frm $MYSQLTEST_VARDIR/master-data/test/bug29807.frm;
+--error 1146
+select * from bug29807;
+drop table t1;
+--error 1051
+drop table bug29807;
+create table bug29807 (a int);
+drop table bug29807;
+
+
+#
+# Bug #29154: LOCK TABLES is not atomic when >1 InnoDB tables are locked
+#
+
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+CREATE TABLE t2 (a INT) ENGINE=InnoDB;
+
+CONNECT (c1,localhost,root,,);
+CONNECT (c2,localhost,root,,);
+
+--echo switch to connection c1
+CONNECTION c1;
+SET AUTOCOMMIT=0;
+INSERT INTO t2 VALUES (1);
+
+--echo switch to connection c2
+CONNECTION c2;
+SET AUTOCOMMIT=0;
+--error ER_LOCK_WAIT_TIMEOUT
+LOCK TABLES t1 READ, t2 READ;
+
+--echo switch to connection c1
+CONNECTION c1;
+COMMIT;
+INSERT INTO t1 VALUES (1);
+
+--echo switch to connection default
+CONNECTION default;
+SET AUTOCOMMIT=default;
+DISCONNECT c1;
+DISCONNECT c2;
+DROP TABLE t1,t2;
+
+#
+# Bug #25798: a query with forced index merge returns wrong result
+#
+
+CREATE TABLE t1 (
+ id int NOT NULL auto_increment PRIMARY KEY,
+ b int NOT NULL,
+ c datetime NOT NULL,
+ INDEX idx_b(b),
+ INDEX idx_c(c)
+) ENGINE=InnoDB;
+
+CREATE TABLE t2 (
+ b int NOT NULL auto_increment PRIMARY KEY,
+ c datetime NOT NULL
+) ENGINE= MyISAM;
+
+INSERT INTO t2(c) VALUES ('2007-01-01');
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+
+INSERT INTO t1(b,c) SELECT b,c FROM t2;
+UPDATE t2 SET c='2007-01-02';
+INSERT INTO t1(b,c) SELECT b,c FROM t2;
+UPDATE t2 SET c='2007-01-03';
+INSERT INTO t1(b,c) SELECT b,c FROM t2;
+
+set @@sort_buffer_size=8192;
+
+SELECT COUNT(*) FROM t1;
+
+--replace_column 9 #
+EXPLAIN
+SELECT COUNT(*) FROM t1
+ WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1;
+SELECT COUNT(*) FROM t1
+ WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1;
+
+--replace_column 9 #
+EXPLAIN
+SELECT COUNT(*) FROM t1 FORCE INDEX(idx_b, idx_c)
+ WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1;
+SELECT COUNT(*) FROM t1 FORCE INDEX(idx_b, idx_c)
+ WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1;
+
+set @@sort_buffer_size=default;
+
+DROP TABLE t1,t2;
#
# Test of behaviour with CREATE ... SELECT
@@ -562,24 +728,24 @@ drop table t1;
CREATE TABLE t1 (a int, b int);
insert into t1 values (1,1),(1,2);
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
CREATE TABLE t2 (primary key (a)) select * from t1;
# This should give warning
drop table if exists t2;
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
CREATE TEMPORARY TABLE t2 (primary key (a)) select * from t1;
# This should give warning
drop table if exists t2;
CREATE TABLE t2 (a int, b int, primary key (a));
BEGIN;
INSERT INTO t2 values(100,100);
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
CREATE TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
SELECT * from t2;
ROLLBACK;
SELECT * from t2;
TRUNCATE table t2;
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
INSERT INTO t2 select * from t1;
SELECT * from t2;
drop table t2;
@@ -587,19 +753,19 @@ drop table t2;
CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a));
BEGIN;
INSERT INTO t2 values(100,100);
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
SELECT * from t2;
COMMIT;
BEGIN;
INSERT INTO t2 values(101,101);
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
SELECT * from t2;
ROLLBACK;
SELECT * from t2;
TRUNCATE table t2;
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
INSERT INTO t2 select * from t1;
SELECT * from t2;
drop table t1,t2;
@@ -633,8 +799,227 @@ DROP TABLE t1;
--source include/innodb_rollback_on_timeout.inc
---echo End of 5.0 tests
+#
+# Bug#27296 Assertion in ALTER TABLE SET DEFAULT in Linux Debug build
+# (possible deadlock).
+#
+# The bug is applicable only to a transactoinal table.
+# Cover with tests behavior that no longer causes an
+# assertion.
+#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int) engine=innodb;
+alter table t1 alter a set default 1;
+drop table t1;
+--echo
+--echo Bug#24918 drop table and lock / inconsistent between
+--echo perm and temp tables
+--echo
+--echo Check transactional tables under LOCK TABLES
+--echo
+--disable_warnings
+drop table if exists t24918, t24918_tmp, t24918_trans, t24918_trans_tmp,
+t24918_access;
+--enable_warnings
+create table t24918_access (id int);
+create table t24918 (id int) engine=myisam;
+create temporary table t24918_tmp (id int) engine=myisam;
+create table t24918_trans (id int) engine=innodb;
+create temporary table t24918_trans_tmp (id int) engine=innodb;
+
+lock table t24918 write, t24918_tmp write, t24918_trans write, t24918_trans_tmp write;
+drop table t24918;
+--error ER_TABLE_NOT_LOCKED
+select * from t24918_access;
+drop table t24918_trans;
+--error ER_TABLE_NOT_LOCKED
+select * from t24918_access;
+drop table t24918_trans_tmp;
+--error ER_TABLE_NOT_LOCKED
+select * from t24918_access;
+drop table t24918_tmp;
+--error ER_TABLE_NOT_LOCKED
+select * from t24918_access;
+unlock tables;
+
+drop table t24918_access;
+#
+# Bug #28591: MySQL need not sort the records in case of ORDER BY
+# primary_key on InnoDB table
+#
+
+CREATE TABLE t1 (a int, b int, PRIMARY KEY (a), KEY bkey (b)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,2),(3,2),(2,2),(4,2),(5,2),(6,2),(7,2),(8,2);
+INSERT INTO t1 SELECT a + 8, 2 FROM t1;
+INSERT INTO t1 SELECT a + 16, 1 FROM t1;
+query_vertical EXPLAIN SELECT * FROM t1 WHERE b=2 ORDER BY a;
+SELECT * FROM t1 WHERE b=2 ORDER BY a;
+query_vertical EXPLAIN SELECT * FROM t1 WHERE b BETWEEN 1 AND 2 ORDER BY a;
+SELECT * FROM t1 WHERE b BETWEEN 1 AND 2 ORDER BY a;
+query_vertical EXPLAIN SELECT * FROM t1 WHERE b BETWEEN 1 AND 2 ORDER BY b,a;
+SELECT * FROM t1 WHERE b BETWEEN 1 AND 2 ORDER BY b,a;
+
+CREATE TABLE t2 (a int, b int, c int, PRIMARY KEY (a), KEY bkey (b,c))
+ ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1,1,1),(3,1,1),(2,1,1),(4,1,1);
+INSERT INTO t2 SELECT a + 4, 1, 1 FROM t2;
+INSERT INTO t2 SELECT a + 8, 1, 1 FROM t2;
+
+query_vertical EXPLAIN SELECT * FROM t2 WHERE b=1 ORDER BY a;
+SELECT * FROM t2 WHERE b=1 ORDER BY a;
+query_vertical EXPLAIN SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY a;
+SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY a;
+query_vertical EXPLAIN SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY b,c,a;
+SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY b,c,a;
+query_vertical EXPLAIN SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY c,a;
+SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY c,a;
+
+DROP TABLE t1,t2;
+
+
+#
+# Bug #29644: alter table hangs if records locked in share mode by long
+# running transaction
+#
+
+CREATE TABLE t1 (a INT, PRIMARY KEY (a)) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8);
+INSERT INTO t1 SELECT a + 8 FROM t1;
+INSERT INTO t1 SELECT a + 16 FROM t1;
+
+DELIMITER |;
+CREATE PROCEDURE p1 ()
+BEGIN
+ DECLARE i INT DEFAULT 50;
+ DECLARE cnt INT;
+ START TRANSACTION;
+ ALTER TABLE t1 ENGINE=InnoDB;
+ COMMIT;
+ START TRANSACTION;
+ WHILE (i > 0) DO
+ SET i = i - 1;
+ SELECT COUNT(*) INTO cnt FROM t1 LOCK IN SHARE MODE;
+ END WHILE;
+ COMMIT;
+END;|
+
+DELIMITER ;|
+
+CONNECT (con1,localhost,root,,);
+CONNECT (con2,localhost,root,,);
+
+CONNECTION con1;
+SEND CALL p1();
+CONNECTION con2;
+SEND CALL p1();
+CONNECTION default;
+CALL p1();
+
+CONNECTION con1;
+REAP;
+CONNECTION con2;
+REAP;
+CONNECTION default;
+DISCONNECT con1;
+DISCONNECT con2;
+
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+#
+# Bug #28125: ERROR 2013 when adding index.
+#
+create table t1(a text) engine=innodb default charset=utf8;
+insert into t1 values('aaa');
+alter table t1 add index(a(1024));
+show create table t1;
+drop table t1;
+
+#
+# Bug #28570: handler::index_read() is called with different find_flag when
+# ORDER BY is used
+#
+
+CREATE TABLE t1 (
+ a INT,
+ b INT,
+ KEY (b)
+) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES (1,10), (2,10), (2,20), (3,30);
+
+START TRANSACTION;
+SELECT * FROM t1 WHERE b=20 FOR UPDATE;
+
+--connect (conn2, localhost, root,,test)
+
+# This statement gives a "failed: 1205: Lock wait timeout exceeded; try
+# restarting transaction" message when the bug is present.
+START TRANSACTION;
+SELECT * FROM t1 WHERE b=10 ORDER BY A FOR UPDATE;
+ROLLBACK;
+
+--disconnect conn2
+--connection default
+
+ROLLBACK;
+DROP TABLE t1;
+
+#
+# Bug#30596: GROUP BY optimization gives wrong result order
+#
+CREATE TABLE t1(
+ a INT,
+ b INT NOT NULL,
+ c INT NOT NULL,
+ d INT,
+ UNIQUE KEY (c,b)
+) engine=innodb;
+
+INSERT INTO t1 VALUES (1,1,1,50), (1,2,3,40), (2,1,3,4);
+
+EXPLAIN SELECT c,b,d FROM t1 GROUP BY c,b,d;
+SELECT c,b,d FROM t1 GROUP BY c,b,d;
+EXPLAIN SELECT c,b,d FROM t1 GROUP BY c,b,d ORDER BY NULL;
+SELECT c,b,d FROM t1 GROUP BY c,b,d ORDER BY NULL;
+EXPLAIN SELECT c,b,d FROM t1 ORDER BY c,b,d;
+SELECT c,b,d FROM t1 ORDER BY c,b,d;
+
+EXPLAIN SELECT c,b,d FROM t1 GROUP BY c,b;
+SELECT c,b,d FROM t1 GROUP BY c,b;
+EXPLAIN SELECT c,b FROM t1 GROUP BY c,b;
+SELECT c,b FROM t1 GROUP BY c,b;
+
+DROP TABLE t1;
+
+#
+# Bug #31001: ORDER BY DESC in InnoDB not working
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a), INDEX b (b)) ENGINE=InnoDB;
+INSERT INTO t1(a,b) VALUES (1,1), (2,2), (3,2);
+
+#The two queries below should produce different results, but they don't.
+query_vertical EXPLAIN SELECT * FROM t1 WHERE b=2 ORDER BY a ASC;
+SELECT * FROM t1 WHERE b=2 ORDER BY a ASC;
+query_vertical EXPLAIN SELECT * FROM t1 WHERE b=2 ORDER BY a DESC;
+SELECT * FROM t1 WHERE b=2 ORDER BY a DESC;
+
+query_vertical EXPLAIN SELECT * FROM t1 ORDER BY b ASC, a ASC;
+SELECT * FROM t1 ORDER BY b ASC, a ASC;
+query_vertical EXPLAIN SELECT * FROM t1 ORDER BY b DESC, a DESC;
+SELECT * FROM t1 ORDER BY b DESC, a DESC;
+query_vertical EXPLAIN SELECT * FROM t1 ORDER BY b ASC, a DESC;
+SELECT * FROM t1 ORDER BY b ASC, a DESC;
+query_vertical EXPLAIN SELECT * FROM t1 ORDER BY b DESC, a ASC;
+SELECT * FROM t1 ORDER BY b DESC, a ASC;
+
+DROP TABLE t1;
+
+--echo End of 5.0 tests
# Fix for BUG#19243 "wrong LAST_INSERT_ID() after ON DUPLICATE KEY
# UPDATE": if the row is updated, it's like a regular UPDATE:
@@ -688,4 +1073,77 @@ select * from t2;
drop table t2;
+
+#
+# Tests for bug #28415 "Some ALTER TABLE statements no longer work
+# under LOCK TABLES" and some aspects of fast ALTER TABLE behaviour
+# for transactional tables.
+#
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+create table t1 (i int);
+alter table t1 modify i int default 1;
+alter table t1 modify i int default 2, rename t2;
+lock table t2 write;
+alter table t2 modify i int default 3;
+unlock tables;
+lock table t2 write;
+alter table t2 modify i int default 4, rename t1;
+unlock tables;
+drop table t1;
+
+
+#
+# Some more tests for ALTER TABLE and LOCK TABLES for transactional tables.
+#
+# Table which is altered under LOCK TABLES should stay in list of locked
+# tables and be available after alter takes place unless ALTER contains
+# RENAME clause. We should see the new definition of table, of course.
+# Before 5.1 this behavior was inconsistent across the platforms and
+# different engines. See also tests in alter_table.test
+#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (i int);
+insert into t1 values ();
+lock table t1 write;
+# Example of so-called 'fast' ALTER TABLE
+alter table t1 modify i int default 1;
+insert into t1 values ();
+select * from t1;
+# And now full-blown ALTER TABLE
+alter table t1 change i c char(10) default "Two";
+insert into t1 values ();
+select * from t1;
+unlock tables;
+select * from t1;
+drop tables t1;
+
+#
+# Bug#29310: An InnoDB table was updated when the data wasn't actually changed.
+#
+create table t1(f1 varchar(5) unique, f2 timestamp NOT NULL DEFAULT
+ CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
+insert into t1(f1) values(1);
+--replace_column 1 #
+select @a:=f2 from t1;
+--sleep 5
+update t1 set f1=1;
+--replace_column 1 #
+select @b:=f2 from t1;
+select if(@a=@b,"ok","wrong");
+--sleep 5
+insert into t1(f1) values (1) on duplicate key update f1="1";
+--replace_column 1 #
+select @b:=f2 from t1;
+select if(@a=@b,"ok","wrong");
+--sleep 5
+insert into t1(f1) select f1 from t1 on duplicate key update f1="1";
+--replace_column 1 #
+select @b:=f2 from t1;
+select if(@a=@b,"ok","wrong");
+drop table t1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/include/mix2.inc b/mysql-test/include/mix2.inc
index 76666cb7bc0..b4c4a9b8836 100644
--- a/mysql-test/include/mix2.inc
+++ b/mysql-test/include/mix2.inc
@@ -96,7 +96,7 @@ INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2),
update t1 set parent_id=parent_id+100;
select * from t1 where parent_id=102;
update t1 set id=id+1000;
--- error ER_DUP_ENTRY_WITH_KEY_NAME,1022
+-- error ER_DUP_ENTRY,1022
update t1 set id=1024 where id=1009;
select * from t1;
update ignore t1 set id=id+1; # This will change all rows
@@ -179,13 +179,13 @@ commit;
select n, "after commit" from t1;
commit;
insert into t1 values (5);
--- error ER_DUP_ENTRY_WITH_KEY_NAME
+-- error ER_DUP_ENTRY
insert into t1 values (4);
commit;
select n, "after commit" from t1;
set autocommit=1;
insert into t1 values (6);
--- error ER_DUP_ENTRY_WITH_KEY_NAME
+-- error ER_DUP_ENTRY
insert into t1 values (4);
select n from t1;
set autocommit=0;
@@ -259,7 +259,7 @@ drop table t1;
eval CREATE TABLE t1 (id char(8) not null primary key, val int not null) engine=$engine_type;
insert into t1 values ('pippo', 12);
--- error ER_DUP_ENTRY_WITH_KEY_NAME
+-- error ER_DUP_ENTRY
insert into t1 values ('pippo', 12); # Gives error
delete from t1;
delete from t1 where id = 'pippo';
@@ -390,9 +390,9 @@ eval CREATE TABLE t1 (
insert into t1 (ggid,passwd) values ('test1','xxx');
insert into t1 (ggid,passwd) values ('test2','yyy');
--- error ER_DUP_ENTRY_WITH_KEY_NAME
+-- error ER_DUP_ENTRY
insert into t1 (ggid,passwd) values ('test2','this will fail');
--- error ER_DUP_ENTRY_WITH_KEY_NAME
+-- error ER_DUP_ENTRY
insert into t1 (ggid,id) values ('this will fail',1);
select * from t1 where ggid='test1';
@@ -401,7 +401,7 @@ select * from t1 where id=2;
replace into t1 (ggid,id) values ('this will work',1);
replace into t1 (ggid,passwd) values ('test2','this will work');
--- error ER_DUP_ENTRY_WITH_KEY_NAME
+-- error ER_DUP_ENTRY
update t1 set id=100,ggid='test2' where id=1;
select * from t1;
select * from t1 where id=1;
@@ -572,7 +572,7 @@ drop table t1;
eval create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=$engine_type;
insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL');
LOCK TABLES t1 WRITE;
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values (99,1,2,'D'),(1,1,2,'D');
select id from t1;
select id from t1;
@@ -583,7 +583,7 @@ eval create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 c
insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL');
LOCK TABLES t1 WRITE;
begin;
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values (99,1,2,'D'),(1,1,2,'D');
select id from t1;
insert ignore into t1 values (100,1,2,'D'),(1,1,99,'D');
@@ -1513,7 +1513,7 @@ eval create table t1 (rowid int not null auto_increment, val int not null,primar
key (rowid), unique(val)) engine=$engine_type;
replace into t1 (val) values ('1'),('2');
replace into t1 (val) values ('1'),('2');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 (val) values ('1'),('2');
select * from t1;
drop table t1;
@@ -1528,7 +1528,7 @@ eval create table t1 (a int not null auto_increment primary key, val int) engine
insert into t1 (val) values (1);
update t1 set a=2 where a=1;
# We should get the following error because InnoDB does not update the counter
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 (val) values (1);
select * from t1;
drop table t1;
@@ -1894,13 +1894,13 @@ eval create table t3 (s1 varchar(2) binary,primary key (s1)) engine=$engine_type
eval create table t4 (s1 char(2) binary,primary key (s1)) engine=$engine_type;
insert into t1 values (0x41),(0x4120),(0x4100);
--- error ER_DUP_ENTRY_WITH_KEY_NAME
+-- error ER_DUP_ENTRY
insert into t2 values (0x41),(0x4120),(0x4100);
insert into t2 values (0x41),(0x4120);
--- error ER_DUP_ENTRY_WITH_KEY_NAME
+-- error ER_DUP_ENTRY
insert into t3 values (0x41),(0x4120),(0x4100);
insert into t3 values (0x41),(0x4100);
--- error ER_DUP_ENTRY_WITH_KEY_NAME
+-- error ER_DUP_ENTRY
insert into t4 values (0x41),(0x4120),(0x4100);
insert into t4 values (0x41),(0x4100);
select hex(s1) from t1;
diff --git a/mysql-test/include/ndb_master-slave.inc b/mysql-test/include/ndb_master-slave.inc
new file mode 100644
index 00000000000..0bf4b701f0c
--- /dev/null
+++ b/mysql-test/include/ndb_master-slave.inc
@@ -0,0 +1,20 @@
+# Replication tests need binlog
+source include/have_log_bin.inc;
+
+connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
+connect (master1,127.0.0.1,root,,test,$MASTER_MYPORT,);
+connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
+connect (slave1,127.0.0.1,root,,test,$SLAVE_MYPORT,);
+
+connection slave;
+# Check that server is compiled and started with support for NDB
+disable_query_log;
+--require r/true.require
+select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'ndbcluster';
+--source include/ndb_not_readonly.inc
+enable_query_log;
+
+-- source include/master-slave-reset.inc
+
+# Set the default connection to 'master'
+connection master;
diff --git a/mysql-test/include/ndb_not_readonly.inc b/mysql-test/include/ndb_not_readonly.inc
index df67dced8ab..a87ba66f1ef 100644
--- a/mysql-test/include/ndb_not_readonly.inc
+++ b/mysql-test/include/ndb_not_readonly.inc
@@ -1,31 +1,30 @@
# Check that server has come out ot readonly mode
---disable_query_log
-let $counter= 100;
+#
+# wait for server to connect properly to cluster
+#
+set @saved_log = @@sql_log_bin;
+set sql_log_bin = 0;
+--error 0,ER_NO_SUCH_TABLE,ER_OPEN_AS_READONLY,ER_GET_ERRMSG,ER_KEY_NOT_FOUND
+delete from mysql.ndb_apply_status where server_id=0;
let $mysql_errno= 1;
+let $counter= 600;
while ($mysql_errno)
{
- --error 0, 1005
- create table check_read_only(a int) engine=NDB;
- sleep 0.1;
- if (!$counter)
+ # Table is readonly until the mysqld has connected properly
+ --error 0,ER_NO_SUCH_TABLE,ER_OPEN_AS_READONLY,ER_GET_ERRMSG
+ replace into mysql.ndb_apply_status values(0,0,"",0,0);
+ if ($mysql_errno)
{
- die("Failed while waiting for mysqld to come out of readonly mode");
+ if (!$counter)
+ {
+ die("Failed while waiting for mysqld to come out of readonly mode");
+ }
+ dec $counter;
+ --sleep 0.1
}
- dec $counter;
}
-
-let $counter= 100;
-let $mysql_errno= 1;
-while ($mysql_errno)
-{
- --error 0, 1036
- insert into check_read_only values(1);
- sleep 0.1;
- if (!$counter)
- {
- die("Failed while waiting for mysqld to come out of readonly mode");
- }
- dec $counter;
-}
-drop table check_read_only;
---enable_query_log
+delete from mysql.ndb_apply_status where server_id=0;
+set sql_log_bin = @saved_log;
+#
+# connected
+#
diff --git a/mysql-test/include/partition_layout.inc b/mysql-test/include/partition_layout.inc
index 95f6cac37d7..e8d2b0f9123 100644
--- a/mysql-test/include/partition_layout.inc
+++ b/mysql-test/include/partition_layout.inc
@@ -9,5 +9,6 @@ eval SHOW CREATE TABLE t1;
# listing of files belonging to the table t1
if ($ls)
{
+ --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec ls $MYSQLTEST_VARDIR/master-data/test/t1*
}
diff --git a/mysql-test/include/ps_modify.inc b/mysql-test/include/ps_modify.inc
index 9e38671263f..f66f888261d 100644
--- a/mysql-test/include/ps_modify.inc
+++ b/mysql-test/include/ps_modify.inc
@@ -193,7 +193,7 @@ prepare stmt1 from 'insert into t1 values(6, ? )';
execute stmt1 using @arg00;
select a,b from t1 where b = @arg00;
# the second insert fails, because the first column is primary key
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
execute stmt1 using @arg00;
set @arg00=NULL ;
prepare stmt1 from 'insert into t1 values(0, ? )';
@@ -272,7 +272,7 @@ execute stmt1 using @arg00, @arg01;
select * from t1 order by a;
set @arg00=81 ;
set @arg01=1 ;
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
execute stmt1 using @arg00, @arg01;
## insert, autoincrement column and ' SELECT LAST_INSERT_ID() '
diff --git a/mysql-test/include/query_cache.inc b/mysql-test/include/query_cache.inc
index b54976886bd..fdd6bc50eae 100644
--- a/mysql-test/include/query_cache.inc
+++ b/mysql-test/include/query_cache.inc
@@ -90,7 +90,7 @@ delete from t3 where t1_id = 1 and t2_id = 1;
select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t2_id = t2.id and t1.id = 1 order by t1.a asc;
begin;
insert into t3 VALUES ( NULL, 1, 1, 2 );
--- error ER_DUP_ENTRY_WITH_KEY_NAME
+-- error ER_DUP_ENTRY
insert into t3 VALUES ( NULL, 1, 1, 2 );
commit;
select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t2_id = t2.id and t1.id = 1 order by t1.a asc;
diff --git a/mysql-test/include/query_cache_sql_prepare.inc b/mysql-test/include/query_cache_sql_prepare.inc
new file mode 100644
index 00000000000..1842d5412bb
--- /dev/null
+++ b/mysql-test/include/query_cache_sql_prepare.inc
@@ -0,0 +1,497 @@
+############### 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.
+# Query cache is abbreviated as "QC"
+#
+# Last update:
+# 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
+# - Add tests checking that
+# - another connection gets the same amount of QC hits
+# - statements running via ps-protocol do not hit QC results
+# of preceding sql EXECUTEs
+#
+
+--source include/have_query_cache.inc
+# embedded can't make more than one connection, which this test needs
+-- source include/not_embedded.inc
+
+--echo ---- establish connection con1 (root) ----
+connect (con1,localhost,root,,test,$MASTER_MYPORT,);
+--echo ---- switch to connection default ----
+connection default;
+
+set @initial_query_cache_size = @@global.query_cache_size;
+set @@global.query_cache_size=100000;
+flush status;
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1(c1 int);
+insert into t1 values(1),(10),(100);
+
+# First, prepared statements with no parameters
+prepare stmt1 from "select * from t1 where c1=10";
+show status like 'Qcache_hits';
+execute stmt1;
+show status like 'Qcache_hits';
+execute stmt1;
+show status like 'Qcache_hits';
+execute stmt1;
+show status like 'Qcache_hits';
+# Another prepared statement (same text, same connection), should hit the QC
+prepare stmt2 from "select * from t1 where c1=10";
+execute stmt2;
+show status like 'Qcache_hits';
+execute stmt2;
+show status like 'Qcache_hits';
+execute stmt2;
+show status like 'Qcache_hits';
+# Another prepared statement (same text, other connection), should hit the QC
+--echo ---- switch to connection con1 ----
+connection con1;
+prepare stmt3 from "select * from t1 where c1=10";
+execute stmt3;
+show status like 'Qcache_hits';
+execute stmt3;
+show status like 'Qcache_hits';
+execute stmt3;
+show status like 'Qcache_hits';
+--echo ---- switch to connection default ----
+connection default;
+
+# Mixup tests, where statements without PREPARE.../EXECUTE.... meet statements
+# with PREPARE.../EXECUTE.... (text protocol). Both statements have the
+# same text. QC hits occur only when both statements use the same protocol.
+# The outcome of the test depends on the mysqltest startup options
+# - with "--ps-protocol"
+# Statements without PREPARE.../EXECUTE.... run as prepared statements
+# with binary protocol. Expect to get no QC hits.
+# - without any "--<whatever>-protocol"
+# Statements without PREPARE.../EXECUTE run as non prepared statements
+# with text protocol. Expect to get QC hits.
+############################################################################
+#
+# Statement with PREPARE.../EXECUTE.... first
+let $my_stmt= SELECT * FROM t1 WHERE c1 = 100;
+eval prepare stmt10 from "$my_stmt";
+show status like 'Qcache_hits';
+execute stmt10;
+show status like 'Qcache_hits';
+execute stmt10;
+show status like 'Qcache_hits';
+eval $my_stmt;
+show status like 'Qcache_hits';
+--echo ---- switch to connection con1 ----
+connection con1;
+eval $my_stmt;
+show status like 'Qcache_hits';
+--echo ---- switch to connection default ----
+connection default;
+#
+# Statement without PREPARE.../EXECUTE.... first
+let $my_stmt= SELECT * FROM t1 WHERE c1 = 1;
+eval prepare stmt11 from "$my_stmt";
+--echo ---- switch to connection con1 ----
+connection con1;
+eval prepare stmt12 from "$my_stmt";
+--echo ---- switch to connection default ----
+connection default;
+eval $my_stmt;
+show status like 'Qcache_hits';
+eval $my_stmt;
+show status like 'Qcache_hits';
+execute stmt11;
+show status like 'Qcache_hits';
+--echo ---- switch to connection con1 ----
+connection con1;
+execute stmt12;
+show status like 'Qcache_hits';
+--echo ---- switch to connection default ----
+connection default;
+
+# Query caching also works when statement has parameters
+# (BUG#29318 Statements prepared with PREPARE and with one parameter don't use
+# query cache)
+prepare stmt1 from "select * from t1 where c1=?";
+show status like 'Qcache_hits';
+set @a=1;
+execute stmt1 using @a;
+show status like 'Qcache_hits';
+execute stmt1 using @a;
+show status like 'Qcache_hits';
+--echo ---- switch to connection con1 ----
+connection con1;
+set @a=1;
+prepare stmt4 from "select * from t1 where c1=?";
+execute stmt4 using @a;
+show status like 'Qcache_hits';
+# verify that presence of user variables forbids caching
+prepare stmt4 from "select @a from t1 where c1=?";
+execute stmt4 using @a;
+show status like 'Qcache_hits';
+execute stmt4 using @a;
+show status like 'Qcache_hits';
+--echo ---- switch to connection default ----
+connection default;
+
+# See if enabling/disabling the query cache between PREPARE and
+# EXECUTE is an issue; the expected result is that the query cache
+# will not be used.
+# Indeed, decision to read/write the query cache is taken at PREPARE
+# time, so if the query cache was disabled at PREPARE time then no
+# execution of the statement will read/write the query cache.
+# If the query cache was enabled at PREPARE time, but disabled at
+# EXECUTE time, at EXECUTE time the query cache internal functions do
+# nothing so again the query cache is not read/written. But if the
+# query cache is re-enabled before another execution then that
+# execution will read/write the query cache.
+
+# QC is enabled at PREPARE
+prepare stmt1 from "select * from t1 where c1=10";
+# then QC is disabled at EXECUTE
+# Expect to see no additional Qcache_hits.
+set global query_cache_size=0;
+show status like 'Qcache_hits';
+execute stmt1;
+show status like 'Qcache_hits';
+execute stmt1;
+show status like 'Qcache_hits';
+execute stmt1;
+show status like 'Qcache_hits';
+# The QC is global = affects also other connections.
+# Expect to see no additional Qcache_hits.
+--echo ---- switch to connection con1 ----
+connection con1;
+execute stmt3;
+show status like 'Qcache_hits';
+execute stmt3;
+show status like 'Qcache_hits';
+execute stmt3;
+show status like 'Qcache_hits';
+#
+# then QC is re-enabled for more EXECUTE.
+--echo ---- switch to connection default ----
+connection default;
+set global query_cache_size=100000;
+# Expect to see additional Qcache_hits.
+# The fact that the QC was temporary disabled should have no affect
+# except that the first execute will not hit results from the
+# beginning of the test (because QC has been emptied meanwhile by
+# setting its size to 0).
+execute stmt1;
+show status like 'Qcache_hits';
+execute stmt1;
+show status like 'Qcache_hits';
+execute stmt1;
+show status like 'Qcache_hits';
+# The QC is global = affects also other connections.
+--echo ---- switch to connection con1 ----
+connection con1;
+execute stmt3;
+show status like 'Qcache_hits';
+execute stmt3;
+show status like 'Qcache_hits';
+execute stmt3;
+show status like 'Qcache_hits';
+--echo ---- switch to connection default ----
+connection default;
+#
+# then QC is re-disabled for more EXECUTE.
+# Expect to see no additional Qcache_hits.
+# The fact that the QC was temporary enabled should have no affect.
+set global query_cache_size=0;
+show status like 'Qcache_hits';
+execute stmt1;
+show status like 'Qcache_hits';
+execute stmt1;
+show status like 'Qcache_hits';
+execute stmt1;
+show status like 'Qcache_hits';
+# The QC is global = affects also other connections.
+--echo ---- switch to connection con1 ----
+connection con1;
+execute stmt3;
+show status like 'Qcache_hits';
+execute stmt3;
+show status like 'Qcache_hits';
+execute stmt3;
+show status like 'Qcache_hits';
+#
+
+--echo ---- switch to connection default ----
+connection default;
+# QC is disabled at PREPARE
+set global query_cache_size=0;
+prepare stmt1 from "select * from t1 where c1=10";
+--echo ---- switch to connection con1 ----
+connection con1;
+prepare stmt3 from "select * from t1 where c1=10";
+--echo ---- switch to connection default ----
+connection default;
+# then QC is enabled at EXECUTE
+set global query_cache_size=100000;
+show status like 'Qcache_hits';
+execute stmt1;
+show status like 'Qcache_hits';
+execute stmt1;
+show status like 'Qcache_hits';
+execute stmt1;
+show status like 'Qcache_hits';
+# The QC is global = affects also other connections.
+--echo ---- switch to connection con1 ----
+connection con1;
+show status like 'Qcache_hits';
+execute stmt3;
+show status like 'Qcache_hits';
+execute stmt3;
+show status like 'Qcache_hits';
+execute stmt3;
+show status like 'Qcache_hits';
+--echo ---- switch to connection default ----
+connection default;
+#
+# QC is disabled at PREPARE
+set global query_cache_size=0;
+prepare stmt1 from "select * from t1 where c1=?";
+# then QC is enabled at EXECUTE
+set global query_cache_size=100000;
+show status like 'Qcache_hits';
+set @a=1;
+execute stmt1 using @a;
+show status like 'Qcache_hits';
+set @a=100;
+execute stmt1 using @a;
+show status like 'Qcache_hits';
+set @a=10;
+execute stmt1 using @a;
+show status like 'Qcache_hits';
+
+
+drop table t1;
+--echo ---- disconnect connection con1 ----
+disconnect con1;
+
+#
+# Bug #25843 Changing default database between PREPARE and EXECUTE of statement
+# breaks binlog.
+#
+# There were actually two problems discovered by this bug:
+#
+# 1. Default (current) database is not fixed at the creation time.
+# That leads to wrong output of DATABASE() function.
+#
+# 2. Database attributes (@@collation_database) are not fixed at the creation
+# time. That leads to wrong resultset.
+#
+# Binlog breakage and Query Cache wrong output happened because of the first
+# problem.
+#
+
+--echo ########################################################################
+--echo #
+--echo # BUG#25843: Changing default database between PREPARE and EXECUTE of
+--echo # statement breaks binlog.
+--echo #
+--echo ########################################################################
+
+###############################################################################
+
+--echo
+--echo #
+--echo # Check that default database and its attributes are fixed at the
+--echo # creation time.
+--echo #
+
+# Prepare data structures.
+
+--echo
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest1;
+DROP DATABASE IF EXISTS mysqltest2;
+--enable_warnings
+
+--echo
+CREATE DATABASE mysqltest1 COLLATE utf8_unicode_ci;
+CREATE DATABASE mysqltest2 COLLATE utf8_general_ci;
+
+--echo
+CREATE TABLE mysqltest1.t1(msg VARCHAR(255));
+CREATE TABLE mysqltest2.t1(msg VARCHAR(255));
+
+# - Create a prepared statement with mysqltest1 as default database;
+
+--echo
+
+use mysqltest1;
+
+PREPARE stmt_a_1 FROM 'INSERT INTO t1 VALUES(DATABASE())';
+PREPARE stmt_a_2 FROM 'INSERT INTO t1 VALUES(@@collation_database)';
+
+# - Execute on mysqltest1.
+
+--echo
+
+EXECUTE stmt_a_1;
+EXECUTE stmt_a_2;
+
+# - Execute on mysqltest2.
+
+--echo
+
+use mysqltest2;
+
+EXECUTE stmt_a_1;
+EXECUTE stmt_a_2;
+
+# - Check the results;
+
+--echo
+SELECT * FROM mysqltest1.t1;
+
+--echo
+SELECT * FROM mysqltest2.t1;
+
+# - Drop prepared statements.
+
+--echo
+DROP PREPARE stmt_a_1;
+DROP PREPARE stmt_a_2;
+
+###############################################################################
+
+--echo
+--echo #
+--echo # The Query Cache test case.
+--echo #
+
+--echo
+DELETE FROM mysqltest1.t1;
+DELETE FROM mysqltest2.t1;
+
+--echo
+INSERT INTO mysqltest1.t1 VALUES('mysqltest1.t1');
+INSERT INTO mysqltest2.t1 VALUES('mysqltest2.t1');
+
+--echo
+use mysqltest1;
+PREPARE stmt_b_1 FROM 'SELECT * FROM t1';
+
+--echo
+use mysqltest2;
+PREPARE stmt_b_2 FROM 'SELECT * FROM t1';
+
+--echo
+EXECUTE stmt_b_1;
+
+--echo
+EXECUTE stmt_b_2;
+
+--echo
+use mysqltest1;
+
+--echo
+EXECUTE stmt_b_1;
+
+--echo
+EXECUTE stmt_b_2;
+
+--echo
+DROP PREPARE stmt_b_1;
+DROP PREPARE stmt_b_2;
+
+# Cleanup.
+
+--echo
+use test;
+
+--echo
+DROP DATABASE mysqltest1;
+DROP DATABASE mysqltest2;
+
+###############################################################################
+
+--echo
+--echo #
+--echo # Check that prepared statements work properly when there is no current
+--echo # database.
+--echo #
+
+--echo
+CREATE DATABASE mysqltest1 COLLATE utf8_unicode_ci;
+CREATE DATABASE mysqltest2 COLLATE utf8_general_ci;
+
+--echo
+use mysqltest1;
+
+--echo
+PREPARE stmt_c_1 FROM 'SELECT DATABASE(), @@collation_database';
+
+--echo
+use mysqltest2;
+
+--echo
+PREPARE stmt_c_2 FROM 'SELECT DATABASE(), @@collation_database';
+
+--echo
+DROP DATABASE mysqltest2;
+
+--echo
+SELECT DATABASE(), @@collation_database;
+
+# -- Here we have: current db: NULL; stmt db: mysqltest1;
+--echo
+EXECUTE stmt_c_1;
+
+--echo
+SELECT DATABASE(), @@collation_database;
+
+# -- Here we have: current db: NULL; stmt db: mysqltest2 (non-existent);
+--echo
+EXECUTE stmt_c_2;
+
+--echo
+SELECT DATABASE(), @@collation_database;
+
+# -- Create prepared statement, which has no current database.
+
+--echo
+PREPARE stmt_c_3 FROM 'SELECT DATABASE(), @@collation_database';
+
+# -- Here we have: current db: NULL; stmt db: NULL;
+--echo
+EXECUTE stmt_c_3;
+
+--echo
+use mysqltest1;
+
+# -- Here we have: current db: mysqltest1; stmt db: mysqltest2 (non-existent);
+--echo
+EXECUTE stmt_c_2;
+
+--echo
+SELECT DATABASE(), @@collation_database;
+
+# -- Here we have: current db: mysqltest1; stmt db: NULL;
+--echo
+EXECUTE stmt_c_3;
+
+--echo
+SELECT DATABASE(), @@collation_database;
+
+--echo
+DROP DATABASE mysqltest1;
+
+--echo
+use test;
+
+--echo
+--echo ########################################################################
+
+###############################################################################
+
+set @@global.query_cache_size=@initial_query_cache_size;
+flush status; # reset Qcache status variables for next tests
diff --git a/mysql-test/include/read_many_rows.inc b/mysql-test/include/read_many_rows.inc
index e69f5a05cd6..ff57c0ca13d 100644
--- a/mysql-test/include/read_many_rows.inc
+++ b/mysql-test/include/read_many_rows.inc
@@ -59,3 +59,109 @@ INSERT INTO t4 SELECT * FROM t3 ORDER BY CONCAT(a);
SELECT SUM(id) FROM t3;
DROP TABLE t1,t2,t3,t4;
+
+#
+# Bug#24989: The DEADLOCK error is improperly handled by InnoDB.
+#
+CREATE TABLE t1 (f1 int NOT NULL) ENGINE=InnoDB;
+CREATE TABLE t2 (f2 int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+DELIMITER |;
+CREATE TRIGGER t1_bi before INSERT
+ ON t1 FOR EACH ROW
+BEGIN
+ DECLARE CONTINUE HANDLER FOR SQLSTATE '40001' SET @a:= 'deadlock';
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET @a:= 'exception';
+ INSERT INTO t2 (f2) VALUES (1);
+ DELETE FROM t2 WHERE f2 = 1;
+END;|
+
+CREATE PROCEDURE proc24989()
+BEGIN
+ DECLARE CONTINUE HANDLER FOR SQLSTATE '40001' SET @b:= 'deadlock';
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET @a:= 'exception';
+ INSERT INTO t2 (f2) VALUES (1);
+ DELETE FROM t2 WHERE f2 = 1;
+END;|
+
+create procedure proc24989_2()
+ deterministic
+begin
+ declare continue handler for sqlexception
+ select 'Outer handler' as 'exception';
+
+ insert into t1 values(1);
+ select "continued";
+end|
+
+DELIMITER ;|
+
+connect (con1,localhost,root,,);
+connect (con2,localhost,root,,);
+
+connection con1;
+start transaction;
+insert into t1 values(1);
+
+connection con2;
+start transaction;
+insert into t2 values(123);
+send insert into t1 values(1);
+
+connection con1;
+--sleep 1
+insert into t1 values(1);
+
+connection con2;
+--error 1213
+reap;
+select @a;
+# check that the whole transaction was rolled back
+select * from t2;
+
+connection con1;
+commit;
+start transaction;
+insert into t1 values(1);
+
+connection con2;
+start transaction;
+insert into t2 values(123);
+send call proc24989();
+
+connection con1;
+--sleep 1
+insert into t1 values(1);
+
+connection con2;
+reap;
+select @a,@b;
+# check that the whole transaction was rolled back
+select * from t2;
+
+connection con1;
+commit;
+start transaction;
+insert into t1 values(1);
+
+connection con2;
+start transaction;
+insert into t2 values(123);
+send call proc24989_2();
+
+connection con1;
+--sleep 1
+insert into t1 values(1);
+commit;
+
+connection con2;
+reap;
+# check that the whole transaction was rolled back
+select * from t2;
+
+disconnect con1;
+disconnect con2;
+connection default;
+drop procedure proc24989;
+drop procedure proc24989_2;
+drop table t1,t2;
+
diff --git a/mysql-test/include/rpl_events.inc b/mysql-test/include/rpl_events.inc
index 04885f31997..e1bf5500923 100644
--- a/mysql-test/include/rpl_events.inc
+++ b/mysql-test/include/rpl_events.inc
@@ -13,49 +13,63 @@ drop table if exists t1,t2;
# first, we need a table to record something from an event
eval CREATE TABLE `t1` (
- `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+ `id` INT(10) UNSIGNED NOT NULL,
`c` VARCHAR(50) NOT NULL,
`ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=$engine_type DEFAULT CHARSET=utf8;
-INSERT INTO t1 (c) VALUES ('manually');
+INSERT INTO t1 (id, c) VALUES (1, 'manually');
-# then, we create the event
-CREATE EVENT test.justonce ON SCHEDULE AT NOW() + INTERVAL 2 SECOND DO INSERT INTO t1
-(c) VALUES ('from justonce');
+# We create the event so that it inserts exactly 1 row in the table
+# A recuring event is used so that we can be sure the event will
+# fire regardless of timing delays on the server. Otherwise, it is
+# possible for the event to timeout before it has inserted a row.
+--echo "Creating event test.justonce on the master"
+CREATE EVENT test.justonce ON SCHEDULE EVERY 2 SECOND DO
+ INSERT IGNORE INTO t1 (id, c) VALUES (2, 'from justonce');
+# Show the event is alive and present on master
+--echo "Checking event is active on master"
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce';
-# wait 3 seconds, so the event can trigger
---real_sleep 3
+# Wait until event has fired. We know this because t1 will contain
+# the row from the event.
+let $wait_condition=
+ SELECT COUNT(*) = 1 FROM t1 WHERE c = 'from justonce';
+--source include/wait_condition.inc
# check that table t1 contains something
---echo "in the master"
+--echo "Checking event data on the master"
--enable_info
--replace_column 3 TIMESTAMP
-SELECT * FROM t1 WHERE c = 'from justonce' OR c = 'manually' ORDER BY id;
+SELECT * FROM t1 ORDER BY id;
--disable_info
sync_slave_with_master;
---echo "in the slave"
+--echo "Checking event data on the slave"
--enable_info
--replace_column 3 TIMESTAMP
-SELECT * FROM t1 WHERE c = 'from justonce' OR c = 'manually' ORDER BY id;
+SELECT * FROM t1 ORDER BY id;
--disable_info
+--echo "Checking event is inactive on slave"
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce';
# Create an event on the slave and check to see what the originator is.
+--echo "Dropping event test.slave_once on the slave"
--disable_warnings
DROP EVENT IF EXISTS test.slave_once;
--enable_warnings
CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE DO
-INSERT INTO t1(c) VALUES ('from slave_once');
+ INSERT IGNORE INTO t1(id, c) VALUES (3, 'from slave_once');
+
+--echo "Checking event status on the slave for originator value = slave's server_id"
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_once';
+--echo "Dropping event test.slave_once on the slave"
--disable_warnings
DROP EVENT IF EXISTS test.slave_once;
--enable_warnings
@@ -63,57 +77,76 @@ DROP EVENT IF EXISTS test.slave_once;
connection master;
# BUG#20384 - disable events on slave
+--echo "Dropping event test.justonce on the master"
--disable_warnings
DROP EVENT IF EXISTS test.justonce;
--enable_warnings
+--echo "Creating event test.er on the master"
CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND DO
-INSERT INTO t1(c) VALUES ('from er');
+ INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er');
+
+--echo "Checking event status on the master"
SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
sync_slave_with_master;
---echo "in the slave"
+--echo "Checking event status on the slave"
SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
connection master;
---echo "in the master"
-ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND DO INSERT into t1(c) VALUES ('from alter er');
+--echo "Altering event test.er on the master"
+ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND DO
+ INSERT IGNORE INTO t1(id, c) VALUES (5, 'from alter er');
+
+--echo "Checking event status on the master"
SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
sync_slave_with_master;
---echo "in the slave"
+--echo "Checking event status on the slave"
SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
connection master;
---echo "in the master"
+--echo "Dropping event test.er on the master"
DROP EVENT test.er;
+
+--echo "Checking event status on the master"
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
--disable_info
sync_slave_with_master;
---echo "in the slave"
+--echo "Checking event status on the slave"
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
# test the DISABLE ON SLAVE for setting event SLAVESIDE_DISABLED as status
# on CREATE EVENT
-CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND
-DO INSERT INTO t1(c) VALUES ('from slave_terminate');
+--echo "Creating event test.slave_terminate on the slave"
+CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND DO
+ INSERT IGNORE INTO t1(id, c) VALUES (6, 'from slave_terminate');
+
+--echo "Checking event status on the slave"
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate';
+--echo "Dropping event test.slave_terminate on the slave"
DROP EVENT test.slave_terminate;
-CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND
-DISABLE ON SLAVE DO INSERT INTO t1(c) VALUES ('from slave_terminate');
+--echo "Creating event test.slave_terminate with DISABLE ON SLAVE on the slave"
+CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND DISABLE ON SLAVE DO
+ INSERT IGNORE INTO t1(c) VALUES (7, 'from slave_terminate');
+
+--echo "Checking event status on the slave"
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate';
+--echo "Dropping event test.slave_terminate on the slave"
DROP EVENT test.slave_terminate;
---echo "in the master"
+--echo "Cleanup"
connection master;
DROP TABLE t1;
+sync_slave_with_master;
+connection master;
diff --git a/mysql-test/include/rpl_multi_engine2.inc b/mysql-test/include/rpl_multi_engine2.inc
new file mode 100644
index 00000000000..e683a1d5838
--- /dev/null
+++ b/mysql-test/include/rpl_multi_engine2.inc
@@ -0,0 +1,91 @@
+#############################################################
+# Author: Rafal
+# Date: 2007-08-20
+# based on rpl_multi_engine3.inc
+#############################################################
+
+connection slave;
+STOP SLAVE;
+RESET SLAVE;
+
+connection master;
+RESET MASTER;
+
+connection slave;
+START SLAVE;
+
+--echo --- Populate t1 with data ---
+connection master;
+--disable_query_log
+INSERT INTO t1 VALUES(42,1,'Testing MySQL databases is a cool ',
+ 'Must make it bug free for the customer',
+ 654321.4321,15.21,0,1965,"1905-11-14");
+INSERT INTO t1 VALUES(2,1,'Testing MySQL databases is a cool ',
+ 'Must make it bug free for the customer',
+ 654321.4321,15.21,0,1965,"1965-11-14");
+INSERT INTO t1 VALUES(4,1,'Testing MySQL databases is a cool ',
+ 'Must make it bug free for the customer',
+ 654321.4321,15.21,0,1965,"1985-11-14");
+INSERT INTO t1 VALUES(142,1,'Testing MySQL databases is a cool ',
+ 'Must make it bug free for the customer',
+ 654321.4321,15.21,0,1965,"1995-11-14");
+INSERT INTO t1 VALUES(412,1,'Testing MySQL databases is a cool ',
+ 'Must make it bug free for the customer',
+ 654321.4321,15.21,0,1965,"2005-11-14");
+--enable_query_log
+
+--echo --- Select from t1 on master ---
+select *
+from t1
+order by id;
+
+sync_slave_with_master;
+--echo --- Select from t1 on slave ---
+select *
+from t1
+order by id;
+
+--echo --- Perform basic operation on master ---
+--echo --- and ensure replicated correctly ---
+connection master;
+
+--echo --- Update t1 on master --
+UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22"
+WHERE id < 100
+ORDER BY id;
+
+--echo --- Check the update on master ---
+SELECT *
+FROM t1
+WHERE id < 100
+ORDER BY id;
+
+# Must give injector thread a little time to get update
+# into the binlog other wise we will miss the update.
+
+sync_slave_with_master;
+--echo --- Check Update on slave ---
+SELECT *
+FROM t1
+WHERE id < 100
+ORDER BY id;
+
+connection master;
+--echo --- Remove a record from t1 on master ---
+# Note: there is an error in replication of Delete_row
+# from NDB to MyISAM (BUG#28538). However, if there is
+# only one row in Delete_row event then it works fine,
+# as this test demonstrates.
+DELETE FROM t1 WHERE id = 412;
+
+--echo --- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+
+sync_slave_with_master;
+--echo --- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+
+connection master;
+TRUNCATE TABLE t1;
+sync_slave_with_master;
+connection master;
diff --git a/mysql-test/include/rpl_udf.inc b/mysql-test/include/rpl_udf.inc
index d9e19cda484..30f39d79d49 100644
--- a/mysql-test/include/rpl_udf.inc
+++ b/mysql-test/include/rpl_udf.inc
@@ -35,7 +35,7 @@ eval CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB";
--error ER_CANT_FIND_DL_ENTRY
eval CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB";
--replace_column 3 UDF_LIB
-SELECT * FROM mysql.func;
+SELECT * FROM mysql.func ORDER BY name;
--disable_info
save_master_pos;
@@ -46,7 +46,7 @@ sync_with_master;
--echo "Running on the slave"
--enable_info
--replace_column 3 UDF_LIB
-SELECT * FROM mysql.func;
+SELECT * FROM mysql.func ORDER BY name;
--disable_info
connection master;
@@ -81,7 +81,7 @@ connection master;
--enable_info
DROP FUNCTION myfunc_double;
DROP FUNCTION myfunc_int;
-SELECT * FROM mysql.func;
+SELECT * FROM mysql.func ORDER BY name;
--disable_info
sync_slave_with_master;
@@ -89,7 +89,7 @@ sync_slave_with_master;
# Check to see if the UDFs were dropped on the slave
--echo "Running on the slave"
--enable_info
-SELECT * FROM mysql.func;
+SELECT * FROM mysql.func ORDER BY name;
--disable_info
connection master;
@@ -108,7 +108,7 @@ DROP TABLE t1;
--enable_info
CREATE FUNCTION myfuncsql_int(i INT) RETURNS INTEGER DETERMINISTIC RETURN i;
CREATE FUNCTION myfuncsql_double(d DOUBLE) RETURNS INTEGER DETERMINISTIC RETURN d * 2.00;
-SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
+SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
--disable_info
sync_slave_with_master;
@@ -116,7 +116,7 @@ sync_slave_with_master;
# Check to see that UDF CREATE statements were replicated
--echo "Running on the slave"
--enable_info
-SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
+SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
--disable_info
connection master;
@@ -147,7 +147,7 @@ connection master;
--enable_info
ALTER FUNCTION myfuncsql_int COMMENT "This was altered.";
ALTER FUNCTION myfuncsql_double COMMENT "This was altered.";
-SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
+SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
--disable_info
sync_slave_with_master;
@@ -155,7 +155,7 @@ sync_slave_with_master;
# Check to see if data was replicated
--echo "Running on the slave"
--enable_info
-SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
+SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
# Check to see that the functions are available for execution on the slave
SELECT myfuncsql_int(25);
@@ -169,7 +169,7 @@ connection master;
--enable_info
DROP FUNCTION myfuncsql_double;
DROP FUNCTION myfuncsql_int;
-SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
+SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
--disable_info
sync_slave_with_master;
@@ -177,7 +177,7 @@ sync_slave_with_master;
# Check to see if the UDFs were dropped on the slave
--echo "Running on the slave"
--enable_info
-SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
+SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
--disable_info
connection master;
diff --git a/mysql-test/include/select_ndb_apply_status.inc b/mysql-test/include/select_ndb_apply_status.inc
new file mode 100644
index 00000000000..a676b7cfb06
--- /dev/null
+++ b/mysql-test/include/select_ndb_apply_status.inc
@@ -0,0 +1,13 @@
+##################################################
+# Author: Jeb
+# Date: 2007/04
+# Purpose: To select out log name, start and end
+# positions from ndb_apply_status table
+##################################################
+--replace_column 1 <log_name> 2 <start_pos> 3 <end_pos>
+select @log_name:=log_name, @start_pos:=start_pos, @end_pos:=end_pos
+ from mysql.ndb_apply_status;
+--let $start_pos = `select @start_pos`
+--let $end_pos = `select @end_pos`
+--let $log_name = `select @log_name`
+
diff --git a/mysql-test/include/show_binlog_using_logname.inc b/mysql-test/include/show_binlog_using_logname.inc
new file mode 100644
index 00000000000..d78c28e5916
--- /dev/null
+++ b/mysql-test/include/show_binlog_using_logname.inc
@@ -0,0 +1,13 @@
+########################################################
+# Author: Jeb
+# Date: 2007/04
+# Purpose: To select out 1 row from offset 1
+# from the start position in the binlog whose
+# name is = log_name
+########################################################
+
+--replace_result $start_pos <start_pos> $end_pos <end_pos>
+--replace_column 2 #
+--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
+--eval show binlog events in '$log_name' from $start_pos limit $off_set,1
+
diff --git a/mysql-test/include/show_slave_status.inc b/mysql-test/include/show_slave_status.inc
new file mode 100644
index 00000000000..b315b9e45ca
--- /dev/null
+++ b/mysql-test/include/show_slave_status.inc
@@ -0,0 +1,6 @@
+# Include file to show the slave status, masking out some information
+# that varies depending on where the test is executed.
+
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 # 35 # 36 #
+query_vertical SHOW SLAVE STATUS;
diff --git a/mysql-test/include/test_fieldsize.inc b/mysql-test/include/test_fieldsize.inc
new file mode 100644
index 00000000000..cbe63e26318
--- /dev/null
+++ b/mysql-test/include/test_fieldsize.inc
@@ -0,0 +1,40 @@
+#
+# include/test_fieldsize.inc
+#
+# This include file is designed to create a table with one column
+# whose size on the master is greater than that on the slave. The
+# test should fail with an error on the slave.
+#
+
+connection master;
+DROP TABLE IF EXISTS t1;
+
+sync_slave_with_master;
+STOP SLAVE;
+RESET SLAVE;
+eval $test_table_slave;
+
+connection master;
+eval $test_table_master;
+RESET MASTER;
+
+eval $test_insert;
+
+connection slave;
+START SLAVE;
+wait_for_slave_to_stop;
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
+--query_vertical SHOW SLAVE STATUS
+
+# The following should be 0
+SELECT COUNT(*) FROM t1;
+STOP SLAVE;
+RESET SLAVE;
+
+connection master;
+RESET MASTER;
+
+connection slave;
+START SLAVE;
+
diff --git a/mysql-test/include/tpcb.inc b/mysql-test/include/tpcb.inc
new file mode 100644
index 00000000000..84a5c98f9c2
--- /dev/null
+++ b/mysql-test/include/tpcb.inc
@@ -0,0 +1,155 @@
+##################################################
+# Author: Jeb
+# Date: 2007/04
+# Purpose: To create a tpcb database, tables and
+# stored procedures to load the database
+# and run transactions against the DB
+##################################################
+--disable_warnings
+DROP DATABASE IF EXISTS tpcb;
+--enable_warnings
+CREATE DATABASE tpcb;
+
+--echo
+CREATE TABLE tpcb.account (id INT, bid INT, balance DECIMAL(10,2),
+ filler CHAR(255), PRIMARY KEY(id));
+--echo
+CREATE TABLE tpcb.branch (bid INT, balance DECIMAL(10,2), filler VARCHAR(255),
+ PRIMARY KEY(bid));
+--echo
+CREATE TABLE tpcb.teller (tid INT, balance DECIMAL(10,2), filler VARCHAR(255),
+ PRIMARY KEY(tid));
+--echo
+CREATE TABLE tpcb.history (id MEDIUMINT NOT NULL AUTO_INCREMENT,aid INT,
+ tid INT, bid INT, amount DECIMAL(10,2),
+ tdate DATETIME, teller CHAR(20), uuidf LONGBLOB,
+ filler CHAR(80),PRIMARY KEY (id));
+
+--echo
+--echo --- Create stored procedures & functions ---
+--echo
+
+--disable_query_log
+delimiter |;
+CREATE PROCEDURE tpcb.load()
+BEGIN
+ DECLARE acct INT DEFAULT 100;
+ DECLARE brch INT DEFAULT 10;
+ DECLARE tell INT DEFAULT 100;
+ DECLARE tmp INT DEFAULT 10;
+ WHILE brch > 0 DO
+ SET tmp = 100;
+ WHILE tmp > 0 DO
+ INSERT INTO tpcb.account VALUES (acct, brch, 0.0, "FRESH ACCOUNT");
+ SET acct = acct - 1;
+ SET tmp = tmp -1;
+ END WHILE;
+ INSERT INTO tpcb.branch VALUES (brch, 0.0, "FRESH BRANCH");
+ SET brch = brch - 1;
+ END WHILE;
+ WHILE tell > 0 DO
+ INSERT INTO tpcb.teller VALUES (tell, 0.0, "FRESH TELLER");
+ SET tell = tell - 1;
+ END WHILE;
+END|
+
+CREATE FUNCTION tpcb.account_id () RETURNS INT
+BEGIN
+ DECLARE num INT;
+ DECLARE ran INT;
+ SELECT RAND() * 10 INTO ran;
+ IF (ran < 5)
+ THEN
+ SELECT RAND() * 10 INTO num;
+ ELSE
+ SELECT RAND() * 100 INTO num;
+ END IF;
+ IF (num < 1)
+ THEN
+ RETURN 1;
+ END IF;
+ RETURN num;
+END|
+
+CREATE FUNCTION tpcb.teller_id () RETURNS INT
+BEGIN
+ DECLARE num INT;
+ DECLARE ran INT;
+ SELECT RAND() * 10 INTO ran;
+ IF (ran < 5)
+ THEN
+ SELECT RAND() * 10 INTO num;
+ ELSE
+ SELECT RAND() * 100 INTO num;
+ END IF;
+ IF (num < 1)
+ THEN
+ RETURN 1;
+ END IF;
+ RETURN num;
+END|
+
+CREATE PROCEDURE tpcb.trans(in format varchar(3))
+BEGIN
+ DECLARE acct INT DEFAULT 0;
+ DECLARE brch INT DEFAULT 0;
+ DECLARE tell INT DEFAULT 0;
+ DECLARE bal DECIMAL(10,2) DEFAULT 0.0;
+ DECLARE amount DECIMAL(10,2) DEFAULT 1.00;
+ DECLARE test INT DEFAULT 0;
+ DECLARE bbal DECIMAL(10,2) DEFAULT 0.0;
+ DECLARE tbal DECIMAL(10,2) DEFAULT 0.0;
+ DECLARE local_uuid VARCHAR(255);
+ DECLARE local_user VARCHAR(255);
+ DECLARE local_time TIMESTAMP;
+
+ SELECT RAND() * 10 INTO test;
+ SELECT tpcb.account_id() INTO acct;
+ SELECT tpcb.teller_id() INTO tell;
+
+ SELECT account.balance INTO bal FROM tpcb.account WHERE id = acct;
+ SELECT account.bid INTO brch FROM tpcb.account WHERE id = acct;
+ SELECT teller.balance INTO tbal FROM tpcb.teller WHERE tid = tell;
+ SELECT branch.balance INTO bbal FROM tpcb.branch WHERE bid = brch;
+
+ IF (test < 5)
+ THEN
+ SET bal = bal + amount;
+ SET bbal = bbal + amount;
+ SET tbal = tbal + amount;
+ UPDATE tpcb.account SET balance = bal, filler = 'account updated'
+ WHERE id = acct;
+ UPDATE tpcb.branch SET balance = bbal, filler = 'branch updated'
+ WHERE bid = brch;
+ UPDATE tpcb.teller SET balance = tbal, filler = 'teller updated'
+ WHERE tid = tell;
+ ELSE
+ SET bal = bal - amount;
+ SET bbal = bbal - amount;
+ SET tbal = tbal - amount;
+ UPDATE tpcb.account SET balance = bal, filler = 'account updated'
+ WHERE id = acct;
+ UPDATE tpcb.branch SET balance = bbal, filler = 'branch updated'
+ WHERE bid = brch;
+ UPDATE tpcb.teller SET balance = tbal, filler = 'teller updated'
+ WHERE tid = tell;
+ END IF;
+
+ IF (format = 'SBR')
+ THEN
+ SET local_uuid=UUID();
+ SET local_user=USER();
+ SET local_time= NOW();
+ INSERT INTO tpcb.history VALUES(NULL,acct,tell,brch,amount, local_time,local_user,
+ local_uuid,'completed trans');
+ ELSE
+ INSERT INTO tpcb.history VALUES(NULL,acct,tell,brch,amount, NOW(), USER(),
+ UUID(),'completed trans');
+ END IF;
+END|
+delimiter ;|
+--enable_query_log
+--echo
+--echo *** Stored Procedures Created ***
+--echo
+
diff --git a/mysql-test/include/tpcb_disk_data.inc b/mysql-test/include/tpcb_disk_data.inc
new file mode 100644
index 00000000000..dbdf3766bbc
--- /dev/null
+++ b/mysql-test/include/tpcb_disk_data.inc
@@ -0,0 +1,166 @@
+##################################################
+# Author: Jeb
+# Date: 2007/05
+# Purpose: To create a tpcb database using Disk Data,
+# tables and stored procedures to load the database
+# and run transactions against the DB
+##################################################
+--disable_warnings
+DROP DATABASE IF EXISTS tpcb;
+--enable_warnings
+CREATE DATABASE tpcb;
+
+--echo
+eval CREATE TABLE tpcb.account
+ (id INT, bid INT, balance DECIMAL(10,2),
+ filler CHAR(255), PRIMARY KEY(id))
+ TABLESPACE $table_space STORAGE DISK
+ ENGINE=$engine_type;
+--echo
+eval CREATE TABLE tpcb.branch
+ (bid INT, balance DECIMAL(10,2), filler VARCHAR(255),
+ PRIMARY KEY(bid))TABLESPACE $table_space STORAGE DISK
+ ENGINE=$engine_type;
+--echo
+eval CREATE TABLE tpcb.teller
+ (tid INT, balance DECIMAL(10,2), filler VARCHAR(255),
+ PRIMARY KEY(tid)) TABLESPACE $table_space STORAGE DISK
+ ENGINE=$engine_type;
+
+--echo
+eval CREATE TABLE tpcb.history
+ (id MEDIUMINT NOT NULL AUTO_INCREMENT,aid INT,
+ tid INT, bid INT, amount DECIMAL(10,2),
+ tdate DATETIME, teller CHAR(20), uuidf LONGBLOB,
+ filler CHAR(80),PRIMARY KEY (id))
+ TABLESPACE $table_space STORAGE DISK
+ ENGINE=$engine_type;
+
+--echo
+--echo --- Create stored procedures & functions ---
+--echo
+
+--disable_query_log
+delimiter |;
+CREATE PROCEDURE tpcb.load()
+BEGIN
+ DECLARE acct INT DEFAULT 100;
+ DECLARE brch INT DEFAULT 10;
+ DECLARE tell INT DEFAULT 100;
+ DECLARE tmp INT DEFAULT 10;
+ WHILE brch > 0 DO
+ SET tmp = 100;
+ WHILE tmp > 0 DO
+ INSERT INTO tpcb.account VALUES (acct, brch, 0.0, "FRESH ACCOUNT");
+ SET acct = acct - 1;
+ SET tmp = tmp -1;
+ END WHILE;
+ INSERT INTO tpcb.branch VALUES (brch, 0.0, "FRESH BRANCH");
+ SET brch = brch - 1;
+ END WHILE;
+ WHILE tell > 0 DO
+ INSERT INTO tpcb.teller VALUES (tell, 0.0, "FRESH TELLER");
+ SET tell = tell - 1;
+ END WHILE;
+END|
+
+CREATE FUNCTION tpcb.account_id () RETURNS INT
+BEGIN
+ DECLARE num INT;
+ DECLARE ran INT;
+ SELECT RAND() * 10 INTO ran;
+ IF (ran < 5)
+ THEN
+ SELECT RAND() * 10 INTO num;
+ ELSE
+ SELECT RAND() * 100 INTO num;
+ END IF;
+ IF (num < 1)
+ THEN
+ RETURN 1;
+ END IF;
+ RETURN num;
+END|
+
+CREATE FUNCTION tpcb.teller_id () RETURNS INT
+BEGIN
+ DECLARE num INT;
+ DECLARE ran INT;
+ SELECT RAND() * 10 INTO ran;
+ IF (ran < 5)
+ THEN
+ SELECT RAND() * 10 INTO num;
+ ELSE
+ SELECT RAND() * 100 INTO num;
+ END IF;
+ IF (num < 1)
+ THEN
+ RETURN 1;
+ END IF;
+ RETURN num;
+END|
+
+CREATE PROCEDURE tpcb.trans(in format varchar(3))
+BEGIN
+ DECLARE acct INT DEFAULT 0;
+ DECLARE brch INT DEFAULT 0;
+ DECLARE tell INT DEFAULT 0;
+ DECLARE bal DECIMAL(10,2) DEFAULT 0.0;
+ DECLARE amount DECIMAL(10,2) DEFAULT 1.00;
+ DECLARE test INT DEFAULT 0;
+ DECLARE bbal DECIMAL(10,2) DEFAULT 0.0;
+ DECLARE tbal DECIMAL(10,2) DEFAULT 0.0;
+ DECLARE local_uuid VARCHAR(255);
+ DECLARE local_user VARCHAR(255);
+ DECLARE local_time TIMESTAMP;
+
+ SELECT RAND() * 10 INTO test;
+ SELECT tpcb.account_id() INTO acct;
+ SELECT tpcb.teller_id() INTO tell;
+
+ SELECT account.balance INTO bal FROM tpcb.account WHERE id = acct;
+ SELECT account.bid INTO brch FROM tpcb.account WHERE id = acct;
+ SELECT teller.balance INTO tbal FROM tpcb.teller WHERE tid = tell;
+ SELECT branch.balance INTO bbal FROM tpcb.branch WHERE bid = brch;
+
+ IF (test < 5)
+ THEN
+ SET bal = bal + amount;
+ SET bbal = bbal + amount;
+ SET tbal = tbal + amount;
+ UPDATE tpcb.account SET balance = bal, filler = 'account updated'
+ WHERE id = acct;
+ UPDATE tpcb.branch SET balance = bbal, filler = 'branch updated'
+ WHERE bid = brch;
+ UPDATE tpcb.teller SET balance = tbal, filler = 'teller updated'
+ WHERE tid = tell;
+ ELSE
+ SET bal = bal - amount;
+ SET bbal = bbal - amount;
+ SET tbal = tbal - amount;
+ UPDATE tpcb.account SET balance = bal, filler = 'account updated'
+ WHERE id = acct;
+ UPDATE tpcb.branch SET balance = bbal, filler = 'branch updated'
+ WHERE bid = brch;
+ UPDATE tpcb.teller SET balance = tbal, filler = 'teller updated'
+ WHERE tid = tell;
+ END IF;
+
+ IF (format = 'SBR')
+ THEN
+ SET local_uuid=UUID();
+ SET local_user=USER();
+ SET local_time= NOW();
+ INSERT INTO tpcb.history VALUES(NULL,acct,tell,brch,amount, local_time,local_user,
+ local_uuid,'completed trans');
+ ELSE
+ INSERT INTO tpcb.history VALUES(NULL,acct,tell,brch,amount, NOW(), USER(),
+ UUID(),'completed trans');
+ END IF;
+END|
+delimiter ;|
+--enable_query_log
+--echo
+--echo *** Stored Procedures Created ***
+--echo
+
diff --git a/mysql-test/include/unsafe_binlog.inc b/mysql-test/include/unsafe_binlog.inc
index 6fbbdcb6d6c..2fc2ad77bc9 100644
--- a/mysql-test/include/unsafe_binlog.inc
+++ b/mysql-test/include/unsafe_binlog.inc
@@ -23,7 +23,7 @@
#
--disable_warnings
-drop table if exists t1,t2;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
--enable_warnings
eval create table t1 (id int not null, f_id int not null, f int not null,
primary key(f_id, id)) engine = $engine_type;
@@ -59,7 +59,7 @@ set autocommit = 0;
#
# S-lock to records (2,2),(4,2), and (6,2) should not be released in a update
#
---error 1205
+--error ER_LOCK_WAIT_TIMEOUT
select * from t1 where a = 2 and b = 2 for update;
connection a;
commit;
@@ -213,39 +213,39 @@ set autocommit = 0;
create table t10(a int not null, b int, primary key(a)) select * from t2 for update;
connection b;
---error 1205
+--error ER_LOCK_WAIT_TIMEOUT
reap;
connection c;
---error 1205
+--error ER_LOCK_WAIT_TIMEOUT
reap;
connection d;
---error 1205
+--error ER_LOCK_WAIT_TIMEOUT
reap;
connection e;
---error 1205
+--error ER_LOCK_WAIT_TIMEOUT
reap;
connection f;
---error 1205
+--error ER_LOCK_WAIT_TIMEOUT
reap;
connection g;
---error 1205
+--error ER_LOCK_WAIT_TIMEOUT
reap;
connection h;
---error 1205
+--error ER_LOCK_WAIT_TIMEOUT
reap;
connection i;
---error 1205
+--error ER_LOCK_WAIT_TIMEOUT
reap;
connection j;
---error 1205
+--error ER_LOCK_WAIT_TIMEOUT
reap;
connection a;
diff --git a/mysql-test/include/uses_vardir.inc b/mysql-test/include/uses_vardir.inc
new file mode 100644
index 00000000000..950de698a43
--- /dev/null
+++ b/mysql-test/include/uses_vardir.inc
@@ -0,0 +1,14 @@
+#
+# Some tests uses LOAD DATA with a relative path
+# and need to see for example ../std_data
+#
+# Also if an absolute path was used, the server might be started
+# with --secure-file-priv and wouldn't be allowed to LOAD a file
+# outside of it's vardir anyway
+#
+
+
+if (`select LOCATE('$MYSQLTEST_VARDIR', REPLACE(@@datadir, '\\\\', '/')) != 1`)
+{
+ skip Need mysqld in MYSQLTEST_VARDIR;
+}
diff --git a/mysql-test/include/varchar.inc b/mysql-test/include/varchar.inc
index 2d683a15030..15306ed8385 100644
--- a/mysql-test/include/varchar.inc
+++ b/mysql-test/include/varchar.inc
@@ -81,7 +81,7 @@ explain select count(*) from t1 where v between 'a' and 'a ';
--replace_column 9 #
explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
alter table t1 add unique(v);
alter table t1 add key(v);
select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a';
@@ -179,17 +179,17 @@ drop table t1;
create table t1 (a char(10), unique (a));
insert into t1 values ('a ');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('a ');
alter table t1 modify a varchar(10);
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('a '),('a '),('a '),('a ');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('a ');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('a ');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('a ');
update t1 set a='a ' where a like 'a%';
select concat(a,'.') from t1;
diff --git a/mysql-test/include/wait_condition.inc b/mysql-test/include/wait_condition.inc
index 2e6bd276aac..a41d8080c9b 100644
--- a/mysql-test/include/wait_condition.inc
+++ b/mysql-test/include/wait_condition.inc
@@ -17,6 +17,7 @@
# let $wait_condition=
# SELECT c = 3 FROM t;
# --source include/wait_condition.inc
+# --echo Executed the test condition $wait_condition_reps times
#
# EXAMPLE
# events_bugs.test, events_time_zone.test
@@ -33,9 +34,13 @@ if ($wait_timeout)
# calls, and default will be used instead.
let $wait_timeout= 0;
+# Keep track of how many times the wait condition is tested
+# This is used by some tests (e.g., main.status)
+let $wait_condition_reps= 0;
while ($wait_counter)
{
let $success= `$wait_condition`;
+ inc $wait_condition_reps;
if ($success)
{
let $wait_counter= 0;
diff --git a/mysql-test/include/wait_for_slave_io_to_stop.inc b/mysql-test/include/wait_for_slave_io_to_stop.inc
new file mode 100644
index 00000000000..6e66d4e7521
--- /dev/null
+++ b/mysql-test/include/wait_for_slave_io_to_stop.inc
@@ -0,0 +1,33 @@
+###################################################
+#Author: Jeb
+#Date: 2007-06-11
+#Purpose: used for io errors on the slave. If Slave gets an io
+# error, the io trhead should stop
+#Details:
+# 1) Fill in and setup variables
+# 2) loop through looking for
+# sql threads to stop
+# 3) If loops too long die.
+####################################################
+connection slave;
+let $my_show= SHOW SLAVE STATUS;
+let $sql_running= Slave_IO_Running;
+let $row_number= 1;
+let $run= 1;
+let $counter= 300;
+
+while ($run)
+{
+ let $io_result= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, $row_number);
+ if (`SELECT '$io_result' = 'No'`){
+ let $run= 0;
+ }
+ sleep 0.1;
+ if (!$counter){
+ --echo "Failed while waiting for slave IO thread to stop"
+ query_vertical SHOW SLAVE STATUS;
+ exit;
+ }
+ dec $counter;
+}
+
diff --git a/mysql-test/include/wait_for_slave_param.inc b/mysql-test/include/wait_for_slave_param.inc
new file mode 100644
index 00000000000..fed97195aba
--- /dev/null
+++ b/mysql-test/include/wait_for_slave_param.inc
@@ -0,0 +1,26 @@
+# include/wait_for_slave_param.inc
+#
+# SUMMARY
+#
+# Waits until SHOW SLAVE STATUS has returned a spicified value.
+#
+# USAGE
+#
+# let $slave_param= Slave_SQL_Running;
+# let $slave_param_value= No;
+# --source include/slave_wait_param.inc
+
+let $slave_wait_param_counter= 300;
+let $slave_value= query_get_value("SHOW SLAVE STATUS", $slave_param, 1);
+while (`select "$slave_value" != "$slave_param_value"`)
+{
+ 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;
+ exit;
+ }
+ sleep 0.1;
+ let $slave_value= query_get_value("SHOW SLAVE STATUS", $slave_param, 1);
+}
diff --git a/mysql-test/include/wait_for_slave_sql_to_stop.inc b/mysql-test/include/wait_for_slave_sql_to_stop.inc
new file mode 100644
index 00000000000..7f435142901
--- /dev/null
+++ b/mysql-test/include/wait_for_slave_sql_to_stop.inc
@@ -0,0 +1,30 @@
+###################################################
+#Author: Jeb
+#Date: 2007-06-11
+#Purpose: used for SQL errors on the slave. If Slave gets a sql
+# error, the SQL trhead should stop
+#Details:
+# 1) Fill in and setup variables
+# 2) loop through looking for
+# sql threads to stop
+# 3) If loops too long die.
+####################################################
+connection slave;
+let $row_number= 1;
+let $run= 1;
+let $counter= 300;
+
+while ($run)
+{
+ let $sql_result= query_get_value("SHOW SLAVE STATUS", Slave_SQL_Running, $row_number);
+ if (`SELECT '$sql_result' = 'No'`){
+ let $run= 0;
+ }
+ sleep 0.1;
+ if (!$counter){
+ --echo "Failed while waiting for slave SQL thread to stop"
+ query_vertical SHOW SLAVE STATUS;
+ exit;
+ }
+ dec $counter;
+}
diff --git a/mysql-test/include/wait_for_slave_to_start.inc b/mysql-test/include/wait_for_slave_to_start.inc
new file mode 100644
index 00000000000..29d87b58a3c
--- /dev/null
+++ b/mysql-test/include/wait_for_slave_to_start.inc
@@ -0,0 +1,35 @@
+###################################################
+#Author: Jeb
+#Date: 2007-06-11
+#Purpose: To wait a brief time for slave to start
+#Details:
+# 1) Fill in and setup variables
+# 2) loop through looking for both
+# io and sql threads to start
+# 3) If loops too long die.
+####################################################
+connection slave;
+let $row_number= 1;
+let $run= 1;
+let $counter= 300;
+
+while ($run)
+{
+ let $io_result= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, $row_number);
+ if (`SELECT '$io_result' = 'Yes'`){
+
+ let $sql_result= query_get_value("SHOW SLAVE STATUS", Slave_SQL_Running, $row_number);
+ if (`SELECT '$sql_result' = 'Yes'`){
+ let $run= 0;
+ }
+ }
+ sleep 0.1;
+ if (!$counter){
+ --echo "Failed while waiting for slave to start"
+ query_vertical SHOW SLAVE STATUS;
+ exit;
+ }
+ dec $counter;
+}
+
+
diff --git a/mysql-test/include/wait_for_slave_to_stop.inc b/mysql-test/include/wait_for_slave_to_stop.inc
new file mode 100644
index 00000000000..5bd2d0338f8
--- /dev/null
+++ b/mysql-test/include/wait_for_slave_to_stop.inc
@@ -0,0 +1,39 @@
+###################################################
+#Author: Jeb
+#Date: 2007-06-11
+#Purpose: To replace the mysqltest.c executable
+# wait_for_slave_to_stop function and
+# return this to the test language.
+#Details:
+# 1) Fill in and setup variables
+# 2) loop through looking for both
+# io and sql threads to stop
+# 3) If loops too long die.
+####################################################
+connection slave;
+let $row_number= 1;
+let $run= 1;
+let $counter= 300;
+
+while ($run)
+{
+ let $io_result= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, $row_number);
+ if (`SELECT '$io_result' = 'No'`){
+
+ let $sql_result= query_get_value("SHOW SLAVE STATUS", Slave_SQL_Running, $row_number);
+ if (`SELECT '$sql_result' = 'No'`){
+ let $run= 0;
+ }
+ }
+ sleep 0.1;
+ if (!$counter){
+ --echo "Failed while waiting for slave to stop"
+ --replace_result $MASTER_MYPORT MASTER_PORT
+ --replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+ query_vertical SHOW SLAVE STATUS;
+ exit;
+ }
+ dec $counter;
+}
+
+
diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl
index cdbd29148f9..ba7fcb8ce10 100644
--- a/mysql-test/lib/mtr_cases.pl
+++ b/mysql-test/lib/mtr_cases.pl
@@ -23,7 +23,8 @@ use IO::File();
use strict;
sub collect_test_cases ($);
-sub collect_one_test_case ($$$$$$$);
+sub collect_one_suite ($$);
+sub collect_one_test_case ($$$$$$$$$);
sub mtr_options_from_test_file($$);
@@ -34,7 +35,121 @@ sub mtr_options_from_test_file($$);
##############################################################################
sub collect_test_cases ($) {
- my $suite= shift; # Test suite name
+ my $suites= shift; # Semicolon separated list of test suites
+ my $cases = []; # Array of hash
+
+ foreach my $suite (split(",", $suites))
+ {
+ collect_one_suite($suite, $cases);
+ }
+
+
+ if ( @::opt_cases )
+ {
+ # Check that the tests specified was found
+ # in at least one suite
+ foreach my $tname ( @::opt_cases )
+ {
+ my $found= 0;
+ foreach my $test ( @$cases )
+ {
+ if ( $test->{'name'} eq $tname ||
+ mtr_match_extension($test->{'name'}, $tname) )
+ {
+ $found= 1;
+ }
+ }
+ if ( not $found )
+ {
+ mtr_error("Could not find $tname in any suite");
+ }
+ }
+ }
+
+ if ( $::opt_reorder )
+ {
+ # Reorder the test cases in an order that will make them faster to run
+ my %sort_criteria;
+
+ # Make a mapping of test name to a string that represents how that test
+ # should be sorted among the other tests. Put the most important criterion
+ # first, then a sub-criterion, then sub-sub-criterion, et c.
+ foreach my $tinfo (@$cases)
+ {
+ my @criteria = ();
+
+ # Look for tests that muct be in run in a defined order
+ # that is defined by test having the same name except for
+ # the ending digit
+
+ # Put variables into hash
+ my $test_name= $tinfo->{'name'};
+ my $depend_on_test_name;
+ if ( $test_name =~ /^([\D]+)([0-9]{1})$/ )
+ {
+ my $base_name= $1;
+ my $idx= $2;
+ mtr_verbose("$test_name => $base_name idx=$idx");
+ if ( $idx > 1 )
+ {
+ $idx-= 1;
+ $base_name= "$base_name$idx";
+ mtr_verbose("New basename $base_name");
+ }
+
+ foreach my $tinfo2 (@$cases)
+ {
+ if ( $tinfo2->{'name'} eq $base_name )
+ {
+ mtr_verbose("found dependent test $tinfo2->{'name'}");
+ $depend_on_test_name=$base_name;
+ }
+ }
+ }
+
+ if ( defined $depend_on_test_name )
+ {
+ mtr_verbose("Giving $test_name same critera as $depend_on_test_name");
+ $sort_criteria{$test_name} = $sort_criteria{$depend_on_test_name};
+ }
+ else
+ {
+ #
+ # Append the criteria for sorting, in order of importance.
+ #
+ push(@criteria, "ndb=" . ($tinfo->{'ndb_test'} ? "1" : "0"));
+ # Group test with equal options together.
+ # Ending with "~" makes empty sort later than filled
+ push(@criteria, join("!", sort @{$tinfo->{'master_opt'}}) . "~");
+
+ $sort_criteria{$test_name} = join(" ", @criteria);
+ }
+ }
+
+ @$cases = sort {
+ $sort_criteria{$a->{'name'}} . $a->{'name'} cmp
+ $sort_criteria{$b->{'name'}} . $b->{'name'}; } @$cases;
+
+ if ( $::opt_script_debug )
+ {
+ # For debugging the sort-order
+ foreach my $tinfo (@$cases)
+ {
+ print("$sort_criteria{$tinfo->{'name'}} -> \t$tinfo->{'name'}\n");
+ }
+ }
+ }
+
+ return $cases;
+
+}
+
+sub collect_one_suite($$)
+{
+ my $suite= shift; # Test suite name
+ my $cases= shift; # List of test cases
+
+ mtr_verbose("Collecting: $suite");
my $testdir;
my $resdir;
@@ -50,12 +165,8 @@ sub collect_test_cases ($) {
$resdir= "$::glob_mysql_test_dir/suite/$suite/r";
}
- my $cases = []; # Array of hash, will be array of C struct
-
- opendir(TESTDIR, $testdir) or mtr_error("Can't open dir \"$testdir\": $!");
-
# ----------------------------------------------------------------------
- # Disable some tests listed in disabled.def
+ # Build a hash of disabled testcases for this suite
# ----------------------------------------------------------------------
my %disabled;
if ( open(DISABLED, "$testdir/disabled.def" ) )
@@ -71,11 +182,20 @@ sub collect_test_cases ($) {
close DISABLED;
}
+ # Read suite.opt file
+ my $suite_opt_file= "$testdir/suite.opt";
+ my $suite_opts= [];
+ if ( -f $suite_opt_file )
+ {
+ $suite_opts= mtr_get_opts_from_file($suite_opt_file);
+ }
+
if ( @::opt_cases )
{
- foreach my $tname ( @::opt_cases )
+ # Collect in specified order, no sort
+ foreach my $tname2 ( @::opt_cases )
{
- # Run in specified order, no sort
+ my $tname= $tname2; # Don't modify @::opt_cases !
my $elem= undef;
my $component_id= undef;
@@ -84,6 +204,9 @@ sub collect_test_cases ($) {
$tname = basename($tname);
+ # Get rid of suite part
+ $tname =~ s/^$suite\.//;
+
# Check if the extenstion has been specified.
if ( mtr_match_extension($tname, "test") )
@@ -122,7 +245,8 @@ sub collect_test_cases ($) {
}
elsif ( ! $mysqld_test_exists and ! $im_test_exists )
{
- mtr_error("Test case $tname is not found");
+ # Silently skip, could exist in another suite
+ next;
}
elsif ( $mysqld_test_exists )
{
@@ -136,13 +260,15 @@ sub collect_test_cases ($) {
}
}
- collect_one_test_case($testdir,$resdir,$tname,$elem,$cases,\%disabled,
- $component_id);
+ collect_one_test_case($testdir,$resdir,$suite,$tname,
+ $elem,$cases,\%disabled,$component_id,
+ $suite_opts);
}
- closedir TESTDIR;
}
else
{
+ opendir(TESTDIR, $testdir) or mtr_error("Can't open dir \"$testdir\": $!");
+
foreach my $elem ( sort readdir(TESTDIR) )
{
my $component_id= undef;
@@ -165,87 +291,13 @@ sub collect_test_cases ($) {
next if $::opt_do_test and
! defined mtr_match_prefix($elem,$::opt_do_test);
- collect_one_test_case($testdir,$resdir,$tname,$elem,$cases,\%disabled,
- $component_id);
+ collect_one_test_case($testdir,$resdir,$suite,$tname,
+ $elem,$cases,\%disabled,$component_id,
+ $suite_opts);
}
closedir TESTDIR;
}
- # Reorder the test cases in an order that will make them faster to run
- if ( $::opt_reorder )
- {
-
- my %sort_criteria;
-
- # Make a mapping of test name to a string that represents how that test
- # should be sorted among the other tests. Put the most important criterion
- # first, then a sub-criterion, then sub-sub-criterion, et c.
- foreach my $tinfo (@$cases)
- {
- my @criteria = ();
-
- # Look for tests that muct be in run in a defined order
- # that is defined by test having the same name except for
- # the ending digit
-
- # Put variables into hash
- my $test_name= $tinfo->{'name'};
- my $depend_on_test_name;
- if ( $test_name =~ /^([\D]+)([0-9]{1})$/ )
- {
- my $base_name= $1;
- my $idx= $2;
- mtr_verbose("$test_name => $base_name idx=$idx");
- if ( $idx > 1 )
- {
- $idx-= 1;
- $base_name= "$base_name$idx";
- mtr_verbose("New basename $base_name");
- }
-
- foreach my $tinfo2 (@$cases)
- {
- if ( $tinfo2->{'name'} eq $base_name )
- {
- mtr_verbose("found dependent test $tinfo2->{'name'}");
- $depend_on_test_name=$base_name;
- }
- }
- }
-
- if ( defined $depend_on_test_name )
- {
- mtr_verbose("Giving $test_name same critera as $depend_on_test_name");
- $sort_criteria{$test_name} = $sort_criteria{$depend_on_test_name};
- }
- else
- {
- #
- # Append the criteria for sorting, in order of importance.
- #
- push(@criteria, "ndb=" . ($tinfo->{'ndb_test'} ? "1" : "0"));
- # Group test with equal options together.
- # Ending with "~" makes empty sort later than filled
- push(@criteria, join("!", sort @{$tinfo->{'master_opt'}}) . "~");
-
- $sort_criteria{$test_name} = join(" ", @criteria);
- }
- }
-
- @$cases = sort {
- $sort_criteria{$a->{'name'}} . $a->{'name'} cmp
- $sort_criteria{$b->{'name'}} . $b->{'name'}; } @$cases;
-
- if ( $::opt_script_debug )
- {
- # For debugging the sort-order
- foreach my $tinfo (@$cases)
- {
- print("$sort_criteria{$tinfo->{'name'}} -> \t$tinfo->{'name'}\n");
- }
- }
- }
-
return $cases;
}
@@ -257,14 +309,16 @@ sub collect_test_cases ($) {
##############################################################################
-sub collect_one_test_case($$$$$$$) {
+sub collect_one_test_case($$$$$$$$$) {
my $testdir= shift;
my $resdir= shift;
+ my $suite= shift;
my $tname= shift;
my $elem= shift;
my $cases= shift;
my $disabled=shift;
my $component_id= shift;
+ my $suite_opts= shift;
my $path= "$testdir/$elem";
@@ -279,7 +333,7 @@ sub collect_one_test_case($$$$$$$) {
my $tinfo= {};
- $tinfo->{'name'}= $tname;
+ $tinfo->{'name'}= "$suite.$tname";
$tinfo->{'result_file'}= "$resdir/$tname.result";
$tinfo->{'component_id'} = $component_id;
push(@$cases, $tinfo);
@@ -334,6 +388,15 @@ sub collect_one_test_case($$$$$$$) {
$tinfo->{'slave_opt'}= [];
$tinfo->{'slave_mi'}= [];
+ # Add suite opts
+ foreach my $opt ( @$suite_opts )
+ {
+ mtr_verbose($opt);
+ push(@{$tinfo->{'master_opt'}}, $opt);
+ push(@{$tinfo->{'slave_opt'}}, $opt);
+ }
+
+ # Add master opts
if ( -f $master_opt_file )
{
@@ -394,6 +457,7 @@ sub collect_one_test_case($$$$$$$) {
}
}
+ # Add slave opts
if ( -f $slave_opt_file )
{
my $slave_opt= mtr_get_opts_from_file($slave_opt_file);
@@ -587,7 +651,7 @@ sub collect_one_test_case($$$$$$$) {
if ( $tinfo->{'innodb_test'} )
{
# This is a test that need innodb
- if ( $::mysqld_variables{'innodb'} eq "FALSE" )
+ if ( $::mysqld_variables{'innodb'} ne "TRUE" )
{
# innodb is not supported, skip it
$tinfo->{'skip'}= 1;
@@ -596,6 +660,25 @@ sub collect_one_test_case($$$$$$$) {
}
}
+ if ( $tinfo->{'need_binlog'} )
+ {
+ if (grep(/^--skip-log-bin/, @::opt_extra_mysqld_opt) )
+ {
+ $tinfo->{'skip'}= 1;
+ $tinfo->{'comment'}= "Test need binlog";
+ return;
+ }
+ }
+ else
+ {
+ if ( $::mysql_version_id >= 50100 )
+ {
+ # Test does not need binlog, add --skip-binlog to
+ # the options used when starting it
+ push(@{$tinfo->{'master_opt'}}, "--skip-log-bin");
+ }
+ }
+
}
}
@@ -606,11 +689,13 @@ our @tags=
(
["include/have_innodb.inc", "innodb_test", 1],
["include/have_binlog_format_row.inc", "binlog_format", "row"],
+ ["include/have_log_bin.inc", "need_binlog", 1],
["include/have_binlog_format_statement.inc", "binlog_format", "statement"],
["include/have_binlog_format_mixed.inc", "binlog_format", "mixed"],
["include/big_test.inc", "big_test", 1],
["include/have_debug.inc", "need_debug", 1],
["include/have_ndb.inc", "ndb_test", 1],
+ ["include/have_multi_ndb.inc", "ndb_test", 1],
["include/have_ndb_extra.inc", "ndb_extra", 1],
["require_manager", "require_manager", 1],
);
diff --git a/mysql-test/lib/mtr_io.pl b/mysql-test/lib/mtr_io.pl
index 570a58875c2..aa671c0f4f7 100644
--- a/mysql-test/lib/mtr_io.pl
+++ b/mysql-test/lib/mtr_io.pl
@@ -120,7 +120,11 @@ sub mtr_get_opts_from_file ($) {
$arg =~ s/\$(\w+)/envsubst($1)/ge;
# print STDERR "ARG: $arg\n";
- push(@args, $arg);
+ # Do not pass empty string since my_getopt is not capable to handle it.
+ if (length($arg))
+ {
+ push(@args, $arg)
+ }
}
}
close FILE;
diff --git a/mysql-test/lib/mtr_misc.pl b/mysql-test/lib/mtr_misc.pl
index dc22f88bd7f..226f73a21de 100644
--- a/mysql-test/lib/mtr_misc.pl
+++ b/mysql-test/lib/mtr_misc.pl
@@ -19,9 +19,8 @@
# same name.
use strict;
+use File::Find;
-sub mtr_full_hostname ();
-sub mtr_short_hostname ();
sub mtr_native_path($);
sub mtr_init_args ($);
sub mtr_add_arg ($$@);
@@ -31,6 +30,7 @@ sub mtr_file_exists(@);
sub mtr_exe_exists(@);
sub mtr_exe_maybe_exists(@);
sub mtr_copy_dir($$);
+sub mtr_rmtree($);
sub mtr_same_opts($$);
sub mtr_cmp_opts($$);
@@ -40,30 +40,6 @@ sub mtr_cmp_opts($$);
#
##############################################################################
-# We want the fully qualified host name and hostname() may have returned
-# only the short name. So we use the resolver to find out.
-# Note that this might fail on some platforms
-
-sub mtr_full_hostname () {
-
- my $hostname= hostname();
- if ( $hostname !~ /\./ )
- {
- my $address= gethostbyname($hostname)
- or mtr_error("Couldn't resolve $hostname : $!");
- my $fullname= gethostbyaddr($address, AF_INET);
- $hostname= $fullname if $fullname;
- }
- return $hostname;
-}
-
-sub mtr_short_hostname () {
-
- my $hostname= hostname();
- $hostname =~ s/\..+$//;
- return $hostname;
-}
-
# Convert path to OS native format
sub mtr_native_path($)
{
@@ -226,6 +202,57 @@ sub mtr_copy_dir($$) {
}
+sub mtr_rmtree($) {
+ my ($dir)= @_;
+ mtr_verbose("mtr_rmtree: $dir");
+
+ # Try to use File::Path::rmtree. Recent versions
+ # handles removal of directories and files that don't
+ # have full permissions, while older versions
+ # may have a problem with that and we use our own version
+
+ eval { rmtree($dir); };
+ if ( $@ ) {
+ mtr_warning("rmtree($dir) failed, trying with File::Find...");
+
+ my $errors= 0;
+
+ # chmod
+ find( {
+ no_chdir => 1,
+ wanted => sub {
+ chmod(0777, $_)
+ or mtr_warning("couldn't chmod(0777, $_): $!") and $errors++;
+ }
+ },
+ $dir
+ );
+
+ # rm
+ finddepth( {
+ no_chdir => 1,
+ wanted => sub {
+ my $file= $_;
+ # Use special underscore (_) filehandle, caches stat info
+ if (!-l $file and -d _ ) {
+ rmdir($file) or
+ mtr_warning("couldn't rmdir($file): $!") and $errors++;
+ } else {
+ unlink($file)
+ or mtr_warning("couldn't unlink($file): $!") and $errors++;
+ }
+ }
+ },
+ $dir
+ );
+
+ mtr_error("Failed to remove '$dir'") if $errors;
+
+ mtr_report("OK, that worked!");
+ }
+}
+
+
sub mtr_same_opts ($$) {
my $l1= shift;
my $l2= shift;
diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl
index ac2e049a67c..8fd900330da 100644
--- a/mysql-test/lib/mtr_process.pl
+++ b/mysql-test/lib/mtr_process.pl
@@ -99,25 +99,26 @@ sub spawn_impl ($$$$$$$) {
if ( $::opt_script_debug )
{
- print STDERR "\n";
- print STDERR "#### ", "-" x 78, "\n";
- print STDERR "#### ", "STDIN $input\n" if $input;
- print STDERR "#### ", "STDOUT $output\n" if $output;
- print STDERR "#### ", "STDERR $error\n" if $error;
- print STDERR "#### ", "$mode : $path ", join(" ",@$arg_list_t), "\n";
- print STDERR "#### ", "spawn options:\n";
+ mtr_report("");
+ mtr_debug("-" x 73);
+ mtr_debug("STDIN $input") if $input;
+ mtr_debug("STDOUT $output") if $output;
+ mtr_debug("STDERR $error") if $error;
+ mtr_debug("$mode: $path ", join(" ",@$arg_list_t));
+ mtr_debug("spawn options:");
if ($spawn_opts)
{
foreach my $key (sort keys %{$spawn_opts})
{
- print STDERR "#### ", " - $key: $spawn_opts->{$key}\n";
+ mtr_debug(" - $key: $spawn_opts->{$key}");
}
}
else
{
- print STDERR "#### ", " none\n";
+ mtr_debug(" none");
}
- print STDERR "#### ", "-" x 78, "\n";
+ mtr_debug("-" x 73);
+ mtr_report("");
}
mtr_error("Can't spawn with empty \"path\"") unless defined $path;
@@ -142,6 +143,7 @@ sub spawn_impl ($$$$$$$) {
if ( $pid )
{
+ select(STDOUT) if $::glob_win32_perl;
return spawn_parent_impl($pid,$mode,$path);
}
else
@@ -163,9 +165,6 @@ sub spawn_impl ($$$$$$$) {
{
# Don't redirect stdout on ActiveState perl since this is
# just another thread in the same process.
- # Should be fixed so that the thread that is created with fork
- # executes the exe in another process and wait's for it to return.
- # In the meanwhile, we get all the output from mysqld's to screen
}
elsif ( ! open(STDOUT,$log_file_open_mode,$output) )
{
@@ -175,7 +174,7 @@ sub spawn_impl ($$$$$$$) {
if ( $error )
{
- if ( $output eq $error )
+ if ( !$::glob_win32_perl and $output eq $error )
{
if ( ! open(STDERR,">&STDOUT") )
{
@@ -184,15 +183,7 @@ sub spawn_impl ($$$$$$$) {
}
else
{
- if ( $::glob_win32_perl )
- {
- # Don't redirect stdout on ActiveState perl since this is
- # just another thread in the same process.
- # Should be fixed so that the thread that is created with fork
- # executes the exe in another process and wait's for it to return.
- # In the meanwhile, we get all the output from mysqld's to screen
- }
- elsif ( ! open(STDERR,$log_file_open_mode,$error) )
+ if ( ! open(STDERR,$log_file_open_mode,$error) )
{
mtr_child_error("can't redirect STDERR to \"$error\": $!");
}
@@ -369,7 +360,7 @@ sub mtr_kill_leftovers () {
"socket: '$srv->{path_sock}'; ".
"port: $srv->{port})");
- my $pid= mtr_mysqladmin_start($srv, "shutdown", 70);
+ my $pid= mtr_mysqladmin_start($srv, "shutdown", 20);
# Save the pid of the mysqladmin process
$admin_pids{$pid}= 1;
@@ -385,11 +376,13 @@ sub mtr_kill_leftovers () {
if ( ! $::opt_skip_ndbcluster )
{
- # Start shutdown of clusters.
- mtr_debug("Shutting down cluster...");
foreach my $cluster (@{$::clusters})
{
+
+ # Don't shut down a "running" cluster
+ next if $cluster->{'use_running'};
+
mtr_debug(" - cluster " .
"(pid: $cluster->{pid}; " .
"pid file: '$cluster->{path_pid})");
@@ -547,72 +540,92 @@ sub mtr_kill_leftovers () {
}
-# Check that all processes in list are killed
-# The argument is a list of 'ports', 'pids', 'pidfiles' and 'socketfiles'
-# for which shutdown has been started. Make sure they all get killed
-# in one way or the other.
#
-# FIXME On Cygwin, and maybe some other platforms, $srv->{'pid'} and
-# the pid in $srv->{'pidfile'} will not be the same PID. We need to try to kill
-# both I think.
-
+# Check that all processes in "spec" are shutdown gracefully
+# else kill them off hard
+#
sub mtr_check_stop_servers ($) {
my $spec= shift;
# Return if no processes are defined
return if ! @$spec;
- #mtr_report("mtr_check_stop_servers");
+ mtr_verbose("mtr_check_stop_servers");
+ # ----------------------------------------------------------------------
+ # Wait until servers in "spec" has stopped listening
+ # to their ports or timeout occurs
+ # ----------------------------------------------------------------------
mtr_ping_with_timeout(\@$spec);
# ----------------------------------------------------------------------
- # We loop with waitpid() nonblocking to see how many of the ones we
- # are to kill, actually got killed by mysqladmin or ndb_mgm
- #
- # Note that we don't rely on this, the mysqld server might have stopped
- # listening to the port, but still be alive. But it is a start.
+ # Use waitpid() nonblocking for a little while, to see how
+ # many process's will exit sucessfully.
+ # This is the normal case.
# ----------------------------------------------------------------------
-
+ my $wait_counter= 50; # Max number of times to redo the loop
foreach my $srv ( @$spec )
{
+ my $pid= $srv->{'pid'};
my $ret_pid;
- if ( $srv->{'pid'} )
+ if ( $pid )
{
- $ret_pid= waitpid($srv->{'pid'},&WNOHANG);
- if ($ret_pid == $srv->{'pid'})
+ $ret_pid= waitpid($pid,&WNOHANG);
+ if ($ret_pid == $pid)
{
mtr_verbose("Caught exit of process $ret_pid");
$srv->{'pid'}= 0;
}
+ elsif ($ret_pid == 0)
+ {
+ mtr_verbose("Process $pid is still alive");
+ if ($wait_counter-- > 0)
+ {
+ # Give the processes more time to exit
+ select(undef, undef, undef, (0.1));
+ redo;
+ }
+ }
else
{
- # mtr_warning("caught exit of unknown child $ret_pid");
+ mtr_warning("caught exit of unknown child $ret_pid");
}
}
}
# ----------------------------------------------------------------------
- # We know the process was started from this file, so there is a PID
- # saved, or else we have nothing to do.
- # Might be that is is recorded to be missing, but we failed to
- # take away the PID file earlier, then we do it now.
+ # The processes that haven't yet exited need to
+ # be killed hard, put them in "kill_pids" hash
# ----------------------------------------------------------------------
-
- my %mysqld_pids;
-
+ my %kill_pids;
foreach my $srv ( @$spec )
{
- if ( $srv->{'pid'} )
+ my $pid= $srv->{'pid'};
+ if ( $pid )
{
- $mysqld_pids{$srv->{'pid'}}= 1;
+ # Server is still alive, put it in list to be hard killed
+ if ($::glob_win32_perl)
+ {
+ # Kill the real process if it's known
+ $pid= $srv->{'real_pid'} if ($srv->{'real_pid'});
+ }
+ $kill_pids{$pid}= 1;
+
+ # Write a message to the process's error log (if it has one)
+ # that it's being killed hard.
+ if ( defined $srv->{'errfile'} )
+ {
+ mtr_tofile($srv->{'errfile'}, "Note: Forcing kill of process $pid\n");
+ }
+ mtr_warning("Forcing kill of process $pid");
+
}
else
{
- # Server is dead, we remove the pidfile if any
- # Race, could have been removed between I tested with -f
- # and the unlink() below, so I better check again with -f
-
+ # Server is dead, remove the pidfile if it exists
+ #
+ # Race, could have been removed between test with -f
+ # and the unlink() below, so better check again with -f
if ( -f $srv->{'pidfile'} and ! unlink($srv->{'pidfile'}) and
-f $srv->{'pidfile'} )
{
@@ -621,69 +634,45 @@ sub mtr_check_stop_servers ($) {
}
}
- # ----------------------------------------------------------------------
- # If all the processes in list already have been killed,
- # then we don't have to do anything.
- # ----------------------------------------------------------------------
-
- if ( ! keys %mysqld_pids )
+ if ( ! keys %kill_pids )
{
+ # All processes has exited gracefully
return;
}
- # ----------------------------------------------------------------------
- # In mtr_mysqladmin_shutdown() we only waited for the mysqld servers
- # not to listen to the port. But we are not sure we got them all
- # killed. If we suspect it lives, try nice kill with SIG_TERM. Note
- # that for true Win32 processes, kill(0,$pid) will not return 1.
- # ----------------------------------------------------------------------
-
- start_reap_all(); # Avoid zombies
-
- my @mysqld_pids= keys %mysqld_pids;
- mtr_kill_processes(\@mysqld_pids);
-
- stop_reap_all(); # Get into control again
+ mtr_kill_processes(\%kill_pids);
# ----------------------------------------------------------------------
- # Now, we check if all we can find using kill(0,$pid) are dead,
- # and just assume the rest are. We cleanup socket and PID files.
+ # All processes are killed, cleanup leftover files
# ----------------------------------------------------------------------
-
{
my $errors= 0;
foreach my $srv ( @$spec )
{
if ( $srv->{'pid'} )
{
- if ( kill(0,$srv->{'pid'}) )
+ # Server has been hard killed, clean it's resources
+ foreach my $file ($srv->{'pidfile'}, $srv->{'sockfile'})
{
- # FIXME In Cygwin there seem to be some fast reuse
- # of PIDs, so dying may not be the right thing to do.
- $errors++;
- mtr_warning("can't kill process $srv->{'pid'}");
- }
- else
- {
- # We managed to kill it at last
- # FIXME In Cygwin, we will get here even if the process lives.
+ # Know it is dead so should be no race, careful anyway
+ if ( defined $file and -f $file and ! unlink($file) and -f $file )
+ {
+ $errors++;
+ mtr_warning("couldn't delete $file");
+ }
+ }
- # Not needed as we know the process is dead, but to be safe
- # we unlink and check success in two steps. We first unlink
- # without checking the error code, and then check if the
- # file still exists.
+ if ($::glob_win32_perl and $srv->{'real_pid'})
+ {
+ # Wait for the pseudo pid - if the real_pid was known
+ # the pseudo pid has not been waited for yet, wai blocking
+ # since it's "such a simple program"
+ mtr_verbose("Wait for pseudo process $srv->{'pid'}");
+ my $ret_pid= waitpid($srv->{'pid'}, 0);
+ mtr_verbose("Pseudo process $ret_pid died");
+ }
- foreach my $file ($srv->{'pidfile'}, $srv->{'sockfile'})
- {
- # Know it is dead so should be no race, careful anyway
- if ( defined $file and -f $file and ! unlink($file) and -f $file )
- {
- $errors++;
- mtr_warning("couldn't delete $file");
- }
- }
- $srv->{'pid'}= 0;
- }
+ $srv->{'pid'}= 0;
}
}
if ( $errors )
@@ -701,12 +690,9 @@ sub mtr_check_stop_servers ($) {
}
}
}
-
- # FIXME We just assume they are all dead, for Cygwin we are not
- # really sure
-
}
+
# Wait for all the process in the list to terminate
sub mtr_wait_blocking($) {
my $admin_pids= shift;
@@ -1063,7 +1049,7 @@ sub sleep_until_file_created ($$$) {
{
if ( -r $pidfile )
{
- return $pid;
+ return 1;
}
# Check if it died after the fork() was successful
@@ -1095,9 +1081,9 @@ sub sleep_until_file_created ($$$) {
sub mtr_kill_processes ($) {
my $pids = shift;
- mtr_verbose("mtr_kill_processes " . join(" ", @$pids));
+ mtr_verbose("mtr_kill_processes (" . join(" ", keys %{$pids}) . ")");
- foreach my $pid (@$pids)
+ foreach my $pid (keys %{$pids})
{
if ($pid <= 0)
@@ -1106,11 +1092,26 @@ sub mtr_kill_processes ($) {
next;
}
- foreach my $sig (15, 9)
+ my $signaled_procs= kill(9, $pid);
+ if ($signaled_procs == 0)
+ {
+ # No such process existed, assume it's killed
+ mtr_verbose("killed $pid(no such process)");
+ }
+ else
{
- last if mtr_im_kill_process([ $pid ], $sig, 10, 1);
+ my $ret_pid= waitpid($pid,0);
+ if ($ret_pid == $pid)
+ {
+ mtr_verbose("killed $pid(got the pid)");
+ }
+ elsif ($ret_pid == -1)
+ {
+ mtr_verbose("killed $pid(got -1)");
+ }
}
}
+ mtr_verbose("done killing processes");
}
diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl
index ce206a35727..dcd7d1ec842 100644
--- a/mysql-test/lib/mtr_report.pl
+++ b/mysql-test/lib/mtr_report.pl
@@ -19,6 +19,7 @@
# same name.
use strict;
+use warnings;
sub mtr_report_test_name($);
sub mtr_report_test_passed($);
@@ -26,7 +27,6 @@ sub mtr_report_test_failed($);
sub mtr_report_test_skipped($);
sub mtr_report_test_not_skipped_though_disabled($);
-sub mtr_show_failed_diff ($);
sub mtr_report_stats ($);
sub mtr_print_line ();
sub mtr_print_thick_line ();
@@ -38,6 +38,9 @@ sub mtr_child_error (@);
sub mtr_debug (@);
sub mtr_verbose (@);
+my $tot_real_time= 0;
+
+
##############################################################################
#
@@ -45,58 +48,10 @@ sub mtr_verbose (@);
#
##############################################################################
-# We can't use diff -u or diff -a as these are not portable
-
-sub mtr_show_failed_diff ($) {
- my $result_file_name= shift;
-
- # The reject and log files have been dumped to
- # to filenames based on the result_file's name
- my $tname= basename($result_file_name);
- $tname=~ s/\..*$//;
-
- my $reject_file= "r/$tname.reject";
- my $result_file= "r/$tname.result";
- my $log_file= "$::opt_vardir/log/$tname.log";
- my $eval_file= "r/$tname.eval";
-
- if ( $::opt_suite ne "main" )
- {
- $reject_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$reject_file";
- $result_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$result_file";
- $eval_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$eval_file";
- $log_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$log_file";
- }
-
- if ( -f $eval_file )
- {
- $result_file= $eval_file;
- }
-
- my $diffopts= $::opt_udiff ? "-u" : "-c";
-
- if ( -f $reject_file )
- {
- print "Below are the diffs between actual and expected results:\n";
- print "-------------------------------------------------------\n";
- # FIXME check result code?!
- mtr_run("diff",[$diffopts,$result_file,$reject_file], "", "", "", "");
- print "-------------------------------------------------------\n";
- print "Please follow the instructions outlined at\n";
- print "http://www.mysql.com/doc/en/Reporting_mysqltest_bugs.html\n";
- print "to find the reason to this problem and how to report this.\n\n";
- }
-
- if ( -f $log_file )
- {
- print "Result from queries before failure can be found in $log_file\n";
- # FIXME Maybe a tail -f -n 10 $log_file here
- }
-}
-
sub mtr_report_test_name ($) {
my $tinfo= shift;
+ _mtr_log("$tinfo->{name}");
printf "%-30s ", $tinfo->{'name'};
}
@@ -106,15 +61,15 @@ sub mtr_report_test_skipped ($) {
$tinfo->{'result'}= 'MTR_RES_SKIPPED';
if ( $tinfo->{'disable'} )
{
- print "[ disabled ] $tinfo->{'comment'}\n";
+ mtr_report("[ disabled ] $tinfo->{'comment'}");
}
elsif ( $tinfo->{'comment'} )
{
- print "[ skipped ] $tinfo->{'comment'}\n";
+ mtr_report("[ skipped ] $tinfo->{'comment'}");
}
else
{
- print "[ skipped ]\n";
+ mtr_report("[ skipped ]");
}
}
@@ -142,11 +97,11 @@ sub mtr_report_test_passed ($) {
if ( $::opt_timer and -f "$::opt_vardir/log/timer" )
{
$timer= mtr_fromfile("$::opt_vardir/log/timer");
- $::glob_tot_real_time += ($timer/1000);
+ $tot_real_time += ($timer/1000);
$timer= sprintf "%12s", $timer;
}
$tinfo->{'result'}= 'MTR_RES_PASSED';
- print "[ pass ] $timer\n";
+ mtr_report("[ pass ] $timer");
}
sub mtr_report_test_failed ($) {
@@ -155,27 +110,34 @@ sub mtr_report_test_failed ($) {
$tinfo->{'result'}= 'MTR_RES_FAILED';
if ( defined $tinfo->{'timeout'} )
{
- print "[ fail ] timeout\n";
+ mtr_report("[ fail ] timeout");
return;
}
else
{
- print "[ fail ]\n";
+ mtr_report("[ fail ]");
}
if ( $tinfo->{'comment'} )
{
- print "\nERROR: $tinfo->{'comment'}\n";
+ # The test failure has been detected by mysql-test-run.pl
+ # when starting the servers or due to other error, the reason for
+ # failing the test is saved in "comment"
+ mtr_report("\nERROR: $tinfo->{'comment'}");
}
elsif ( -f $::path_timefile )
{
- print "\nErrors are (from $::path_timefile) :\n";
+ # Test failure was detected by test tool and it's report
+ # about what failed has been saved to file. Display the report.
+ print "\n";
print mtr_fromfile($::path_timefile); # FIXME print_file() instead
- print "\n(the last lines may be the most important ones)\n";
+ print "\n";
}
else
{
- print "\nUnexpected termination, probably when starting mysqld\n";
+ # Neither this script or the test tool has recorded info
+ # about why the test has failed. Should be debugged.
+ mtr_report("\nUnexpected termination, probably when starting mysqld");;
}
}
@@ -243,8 +205,10 @@ sub mtr_report_stats ($) {
if ( $::opt_timer )
{
- print
- "Spent $::glob_tot_real_time seconds actually executing testcases\n"
+ use English;
+
+ mtr_report("Spent", sprintf("%.3f", $tot_real_time),"of",
+ time - $BASETIME, "seconds executing testcases");
}
# ----------------------------------------------------------------------
@@ -265,33 +229,139 @@ sub mtr_report_stats ($) {
else
{
# We report different types of problems in order
- foreach my $pattern ( "^Warning:", "^Error:", "^==.* at 0x",
- "InnoDB: Warning", "missing DBUG_RETURN",
+ foreach my $pattern ( "^Warning:",
+ "\\[Warning\\]",
+ "\\[ERROR\\]",
+ "^Error:", "^==.* at 0x",
+ "InnoDB: Warning",
+ "^safe_mutex:",
+ "missing DBUG_RETURN",
"mysqld: Warning",
"allocated at line",
"Attempting backtrace", "Assertion .* failed" )
{
foreach my $errlog ( sort glob("$::opt_vardir/log/*.err") )
{
+ my $testname= "";
unless ( open(ERR, $errlog) )
{
mtr_warning("can't read $errlog");
next;
}
+ my $leak_reports_expected= undef;
while ( <ERR> )
{
+ # There is a test case that purposely provokes a
+ # SAFEMALLOC leak report, even though there is no actual
+ # leak. We need to detect this, and ignore the warning in
+ # that case.
+ if (/Begin safemalloc memory dump:/) {
+ $leak_reports_expected= 1;
+ } elsif (/End safemalloc memory dump./) {
+ $leak_reports_expected= undef;
+ }
+
# Skip some non fatal warnings from the log files
- if ( /Warning:\s+Table:.* on (delete|rename)/ or
- /Warning:\s+Setting lower_case_table_names=2/ or
- /Warning:\s+One can only use the --user.*root/ or
- /InnoDB: Warning: we did not need to do crash recovery/)
+ if (
+ /\"SELECT UNIX_TIMESTAMP\(\)\" failed on master/ or
+ /Aborted connection/ or
+ /Client requested master to start replication from impossible position/ or
+ /Could not find first log file name in binary log/ or
+ /Enabling keys got errno/ or
+ /Error reading master configuration/ or
+ /Error reading packet/ or
+ /Event Scheduler/ or
+ /Failed to open log/ or
+ /Failed to open the existing master info file/ or
+ /Forcing shutdown of [0-9]* plugins/ or
+ /Got error [0-9]* when reading table/ or
+ /Incorrect definition of table/ or
+ /Incorrect information in file/ or
+ /InnoDB: Warning: we did not need to do crash recovery/ or
+ /Invalid \(old\?\) table or database name/ or
+ /Lock wait timeout exceeded/ or
+ /Log entry on master is longer than max_allowed_packet/ or
+ /unknown option '--loose-/ or
+ /unknown variable 'loose-/ or
+ /You have forced lower_case_table_names to 0 through a command-line option/ or
+ /Setting lower_case_table_names=2/ or
+ /NDB Binlog:/ or
+ /NDB: failed to setup table/ or
+ /NDB: only row based binary logging/ or
+ /Neither --relay-log nor --relay-log-index were used/ or
+ /Query partially completed/ or
+ /Slave I.O thread aborted while waiting for relay log/ or
+ /Slave SQL thread is stopped because UNTIL condition/ or
+ /Slave SQL thread retried transaction/ or
+ /Slave \(additional info\)/ or
+ /Slave: .*Duplicate column name/ or
+ /Slave: .*master may suffer from/ or
+ /Slave: According to the master's version/ or
+ /Slave: Column [0-9]* type mismatch/ or
+ /Slave: Error .* doesn't exist/ or
+ /Slave: Error .*Deadlock found/ or
+ /Slave: Error .*Unknown table/ or
+ /Slave: Error in Write_rows event: / or
+ /Slave: Field .* of table .* has no default value/ or
+ /Slave: Query caused different errors on master and slave/ or
+ /Slave: Table .* doesn't exist/ or
+ /Slave: Table width mismatch/ or
+ /Slave: The incident LOST_EVENTS occured on the master/ or
+ /Slave: Unknown error.* 1105/ or
+ /Slave: Can't drop database.* database doesn't exist/ or
+ /Slave SQL:.*(?:Error_code: \d+|Query:.*)/ or
+ /Sort aborted/ or
+ /Time-out in NDB/ or
+ /Warning:\s+One can only use the --user.*root/ or
+ /Warning:\s+Setting lower_case_table_names=2/ or
+ /Warning:\s+Table:.* on (delete|rename)/ or
+ /You have an error in your SQL syntax/ or
+ /deprecated/ or
+ /description of time zone/ or
+ /equal MySQL server ids/ or
+ /error .*connecting to master/ or
+ /error reading log entry/ or
+ /lower_case_table_names is set/ or
+ /skip-name-resolve mode/ or
+ /slave SQL thread aborted/ or
+ /Slave: .*Duplicate entry/ or
+ # Special case for Bug #26402 in show_check.test
+ # Question marks are not valid file name parts
+ # on Windows platforms. Ignore this error message.
+ /\QCan't find file: '.\test\????????.frm'\E/ or
+ # Special case, made as specific as possible, for:
+ # Bug #28436: Incorrect position in SHOW BINLOG EVENTS causes
+ # server coredump
+ /\QError in Log_event::read_log_event(): 'Sanity check failed', data_len: 258, event_type: 49\E/ or
+ /Statement is not safe to log in statement format/ or
+
+ # Test case for Bug#14233 produces the following warnings:
+ /Stored routine 'test'.'bug14233_1': invalid value in column mysql.proc/ or
+ /Stored routine 'test'.'bug14233_2': invalid value in column mysql.proc/ or
+ /Stored routine 'test'.'bug14233_3': invalid value in column mysql.proc/ or
+
+ # BUG#29807 - innodb_mysql.test: Cannot find table test/t2
+ # from the internal data dictionary
+ /Cannot find table test\/bug29807 from the internal data dictionary/ or
+
+ # BUG#29839 - lowercase_table3.test: Cannot find table test/T1
+ # from the internal data dictiona
+ /Cannot find table test\/BUG29839 from the internal data dictionary/
+ )
{
next; # Skip these lines
}
+ if ( /CURRENT_TEST: (.*)/ )
+ {
+ $testname= $1;
+ }
if ( /$pattern/ )
{
+ if ($leak_reports_expected) {
+ next;
+ }
$found_problems= 1;
- print WARN $_;
+ print WARN basename($errlog) . ": $testname: $_";
}
}
}
@@ -393,35 +463,66 @@ sub mtr_print_header () {
##############################################################################
#
-# Misc
+# Log and reporting functions
#
##############################################################################
+use IO::File;
+
+my $log_file_ref= undef;
+
+sub mtr_log_init ($) {
+ my ($filename)= @_;
+
+ mtr_error("Log is already open") if defined $log_file_ref;
+
+ $log_file_ref= IO::File->new($filename, "a") or
+ mtr_warning("Could not create logfile $filename: $!");
+}
+
+sub _mtr_log (@) {
+ print $log_file_ref join(" ", @_),"\n"
+ if defined $log_file_ref;
+}
+
sub mtr_report (@) {
+ # Print message to screen and log
+ _mtr_log(@_);
print join(" ", @_),"\n";
}
sub mtr_warning (@) {
+ # Print message to screen and log
+ _mtr_log("WARNING: ", @_);
print STDERR "mysql-test-run: WARNING: ",join(" ", @_),"\n";
}
sub mtr_error (@) {
+ # Print message to screen and log
+ _mtr_log("ERROR: ", @_);
print STDERR "mysql-test-run: *** ERROR: ",join(" ", @_),"\n";
mtr_exit(1);
}
sub mtr_child_error (@) {
+ # Print message to screen and log
+ _mtr_log("ERROR(child): ", @_);
print STDERR "mysql-test-run: *** ERROR(child): ",join(" ", @_),"\n";
exit(1);
}
sub mtr_debug (@) {
+ # Only print if --script-debug is used
if ( $::opt_script_debug )
{
+ _mtr_log("###: ", @_);
print STDERR "####: ",join(" ", @_),"\n";
}
}
+
sub mtr_verbose (@) {
+ # Always print to log, print to screen only when --verbose is used
+ _mtr_log("> ",@_);
if ( $::opt_verbose )
{
print STDERR "> ",join(" ", @_),"\n";
diff --git a/mysql-test/lib/mtr_timer.pl b/mysql-test/lib/mtr_timer.pl
index 523799f7cf5..326fbea74ec 100644
--- a/mysql-test/lib/mtr_timer.pl
+++ b/mysql-test/lib/mtr_timer.pl
@@ -18,7 +18,6 @@
# and is part of the translation of the Bourne shell script with the
# same name.
-use Socket;
use Errno;
use strict;
@@ -52,12 +51,10 @@ sub mtr_init_timers () {
sub mtr_timer_start($$$) {
my ($timers,$name,$duration)= @_;
- mtr_verbose("mtr_timer_start: $name, $duration");
-
if ( exists $timers->{'timers'}->{$name} )
{
# We have an old running timer, kill it
- mtr_verbose("There is an old timer running");
+ mtr_warning("There is an old timer running");
mtr_timer_stop($timers,$name);
}
@@ -75,31 +72,36 @@ sub mtr_timer_start($$$) {
}
else
{
- mtr_error("can't fork");
+ mtr_error("can't fork timer, error: $!");
}
}
if ( $tpid )
{
# Parent, record the information
- mtr_verbose("timer parent, record info($name, $tpid, $duration)");
+ mtr_verbose("Starting timer for '$name',",
+ "duration: $duration, pid: $tpid");
$timers->{'timers'}->{$name}->{'pid'}= $tpid;
$timers->{'timers'}->{$name}->{'duration'}= $duration;
$timers->{'pids'}->{$tpid}= $name;
}
else
{
- # Child, redirect output and exec
- # FIXME do we need to redirect streams?
+ # Child, install signal handlers and sleep for "duration"
# Don't do the ^C cleanup in the timeout child processes!
# There is actually a race here, if we get ^C after fork(), but before
# clearing the signal handler.
$SIG{INT}= 'DEFAULT';
+ $SIG{TERM}= sub {
+ mtr_verbose("timer $$ woke up, exiting!");
+ exit(0);
+ };
+
$0= "mtr_timer(timers,$name,$duration)";
- mtr_verbose("timer child $name, sleep $duration");
sleep($duration);
+ mtr_verbose("timer $$ expired after $duration seconds");
exit(0);
}
}
@@ -109,16 +111,14 @@ sub mtr_timer_start($$$) {
sub mtr_timer_stop ($$) {
my ($timers,$name)= @_;
- mtr_verbose("mtr_timer_stop: $name");
-
if ( exists $timers->{'timers'}->{$name} )
{
my $tpid= $timers->{'timers'}->{$name}->{'pid'};
- mtr_verbose("Stopping timer with pid $tpid");
+ mtr_verbose("Stopping timer for '$name' with pid $tpid");
# FIXME as Cygwin reuses pids fast, maybe check that is
# the expected process somehow?!
- kill(9, $tpid);
+ kill(15, $tpid);
# As the timers are so simple programs, we trust them to terminate,
# and use blocking wait for it. We wait just to avoid a zombie.
@@ -129,11 +129,8 @@ sub mtr_timer_stop ($$) {
return 1;
}
- else
- {
- mtr_error("Asked to stop timer \"$name\" not started");
- return 0;
- }
+
+ mtr_error("Asked to stop timer '$name' not started");
}
@@ -153,7 +150,8 @@ sub mtr_timer_timeout ($$) {
return "" unless exists $timers->{'pids'}->{$pid};
- # We got a timeout, return the name ot the timer
+ # Got a timeout(the process with $pid is recorded as being a timer)
+ # return the name of the timer
return $timers->{'pids'}->{$pid};
}
diff --git a/mysql-test/mysql-test-run-shell.sh b/mysql-test/mysql-test-run-shell.sh
index 953478fa9f4..54323c878a9 100644
--- a/mysql-test/mysql-test-run-shell.sh
+++ b/mysql-test/mysql-test-run-shell.sh
@@ -629,6 +629,11 @@ else
TEST_MODE=`echo $TEST_MODE | sed 's/^ *//'`
fi
+#
+# Skip tests that doesn't work with shell version
+#
+SKIP_TEST="$SKIP_TEST bootstrap"
+
#++
# mysqld Environment Parameters
#--
@@ -900,8 +905,8 @@ MYSQL_DUMP="$MYSQL_DUMP --no-defaults --debug-info -uroot --socket=$MASTER_MYSOC
MYSQL_SLAP="$MYSQL_SLAP -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLSLAP_OPT"
MYSQL_DUMP_SLAVE="$MYSQL_DUMP_DIR --no-defaults -uroot --socket=$SLAVE_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
MYSQL_SHOW="$MYSQL_SHOW --no-defaults --debug-info -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLSHOW_OPT"
-MYSQL_BINLOG="$MYSQL_BINLOG --debug-info --no-defaults --local-load=$MYSQL_TMP_DIR --character-sets-dir=$CHARSETSDIR $EXTRA_MYSQLBINLOG_OPT"
-MYSQL_IMPORT="$MYSQL_IMPORT --debug-info -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
+MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --debug-info --local-load=$MYSQL_TMP_DIR --character-sets-dir=$CHARSETSDIR $EXTRA_MYSQLBINLOG_OPT"
+MYSQL_IMPORT="$MYSQL_IMPORT --no-defaults --debug-info -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD --basedir=$BASEDIR --bindir=$CLIENT_BINDIR --verbose"
MYSQL="$MYSQL --no-defaults --debug-info --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD"
export MYSQL MYSQL_CHECK MYSQL_DUMP MYSQL_DUMP_SLAVE MYSQL_SHOW MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES MYSQL_IMPORT
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 5d9e42fa7d7..7b6ddf70d53 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -58,10 +58,9 @@ $Devel::Trace::TRACE= 0; # Don't trace boring init stuff
use File::Path;
use File::Basename;
use File::Copy;
-use File::Temp qw / tempdir /;
+use File::Temp qw /tempdir/;
use Cwd;
use Getopt::Long;
-use Sys::Hostname;
use IO::Socket;
use IO::Socket::INET;
use strict;
@@ -83,7 +82,6 @@ require "lib/mtr_io.pl";
require "lib/mtr_gcov.pl";
require "lib/mtr_gprof.pl";
require "lib/mtr_report.pl";
-require "lib/mtr_diff.pl";
require "lib/mtr_match.pl";
require "lib/mtr_misc.pl";
require "lib/mtr_stress.pl";
@@ -101,11 +99,8 @@ $Devel::Trace::TRACE= 1;
our $mysql_version_id;
our $glob_mysql_test_dir= undef;
our $glob_mysql_bench_dir= undef;
-our $glob_hostname= undef;
our $glob_scriptname= undef;
our $glob_timers= undef;
-our $glob_use_running_ndbcluster= 0;
-our $glob_use_running_ndbcluster_slave= 0;
our $glob_use_embedded_server= 0;
our @glob_test_mode;
@@ -113,6 +108,7 @@ our $glob_basedir;
our $path_charsetsdir;
our $path_client_bindir;
+our $path_share;
our $path_language;
our $path_timefile;
our $path_snapshot;
@@ -133,7 +129,7 @@ our $opt_vs_config = $ENV{'MTR_VS_CONFIG'};
our $default_vardir;
our $opt_usage;
-our $opt_suite;
+our $opt_suites= "main,binlog,rpl,rpl_ndb,ndb"; # Default suites to run
our $opt_script_debug= 0; # Script debugging, enable with --script-debug
our $opt_verbose= 0; # Verbose output, enable with --verbose
@@ -144,6 +140,7 @@ our $exe_mysqladmin;
our $exe_mysql_upgrade;
our $exe_mysqlbinlog;
our $exe_mysql_client_test;
+our $exe_bug25714;
our $exe_mysqld;
our $exe_mysqlcheck;
our $exe_mysqldump;
@@ -234,7 +231,6 @@ my $opt_report_features;
our $opt_check_testcases;
our $opt_mark_progress;
-our $opt_skip;
our $opt_skip_rpl;
our $max_slave_num= 0;
our $max_master_num= 1;
@@ -277,13 +273,8 @@ our $opt_stress_test_duration= 0;
our $opt_stress_init_file= "";
our $opt_stress_test_file= "";
-our $opt_wait_for_master;
-our $opt_wait_for_slave;
-
our $opt_warnings;
-our $opt_udiff;
-
our $opt_skip_ndbcluster= 0;
our $opt_skip_ndbcluster_slave= 0;
our $opt_with_ndbcluster= 0;
@@ -307,7 +298,6 @@ our @data_dir_lst;
our $used_binlog_format;
our $used_default_engine;
our $debug_compiled_binaries;
-our $glob_tot_real_time= 0;
our %mysqld_variables;
@@ -405,7 +395,7 @@ sub main () {
else
{
# Figure out which tests we are going to run
- my $tests= collect_test_cases($opt_suite);
+ my $tests= collect_test_cases($opt_suites);
# Turn off NDB and other similar options if no tests use it
my ($need_ndbcluster,$need_im);
@@ -459,7 +449,7 @@ sub main () {
run_report_features();
}
- run_suite($opt_suite, $tests);
+ run_tests($tests);
}
mtr_exit(0);
@@ -475,7 +465,6 @@ sub command_line_setup () {
# These are defaults for things that are set on the command line
- $opt_suite= "main"; # Special default suite
my $opt_comment;
$opt_master_myport= 9306;
@@ -535,7 +524,7 @@ sub command_line_setup () {
'skip-slave-binlog' => \$opt_skip_slave_binlog,
'do-test=s' => \$opt_do_test,
'start-from=s' => \$opt_start_from,
- 'suite=s' => \$opt_suite,
+ 'suite|suites=s' => \$opt_suites,
'skip-rpl' => \$opt_skip_rpl,
'skip-im' => \$opt_skip_im,
'skip-test=s' => \$opt_skip_test,
@@ -620,7 +609,6 @@ sub command_line_setup () {
'start-dirty' => \$opt_start_dirty,
'start-and-exit' => \$opt_start_and_exit,
'timer!' => \$opt_timer,
- 'unified-diff|udiff' => \$opt_udiff,
'user=s' => \$opt_user,
'testcase-timeout=i' => \$opt_testcase_timeout,
'suite-timeout=i' => \$opt_suite_timeout,
@@ -656,8 +644,6 @@ sub command_line_setup () {
$source_dist= 1;
}
- $glob_hostname= mtr_short_hostname();
-
# Find the absolute path to the test directory
$glob_mysql_test_dir= cwd();
if ( $glob_cygwin_perl )
@@ -666,6 +652,7 @@ sub command_line_setup () {
$glob_mysql_test_dir= `cygpath -m "$glob_mysql_test_dir"`;
chomp($glob_mysql_test_dir);
}
+ $default_vardir= "$glob_mysql_test_dir/var";
# In most cases, the base directory we find everything relative to,
# is the parent directory of the "mysql-test" directory. For source
@@ -693,6 +680,37 @@ sub command_line_setup () {
$glob_timers= mtr_init_timers();
+ # --------------------------------------------------------------------------
+ # Embedded server flag
+ # --------------------------------------------------------------------------
+ if ( $opt_embedded_server )
+ {
+ $glob_use_embedded_server= 1;
+ # Add the location for libmysqld.dll to the path.
+ if ( $glob_win32 )
+ {
+ my $lib_mysqld=
+ mtr_path_exists(vs_config_dirs('libmysqld',''));
+ $lib_mysqld= $glob_cygwin_perl ? ":".`cygpath "$lib_mysqld"`
+ : ";".$lib_mysqld;
+ chomp($lib_mysqld);
+ $ENV{'PATH'}="$ENV{'PATH'}".$lib_mysqld;
+ }
+
+ push(@glob_test_mode, "embedded");
+ $opt_skip_rpl= 1; # We never run replication with embedded
+ $opt_skip_ndbcluster= 1; # Turn off use of NDB cluster
+ $opt_skip_ssl= 1; # Turn off use of SSL
+
+ # Turn off use of bin log
+ push(@opt_extra_mysqld_opt, "--skip-log-bin");
+
+ if ( $opt_extern )
+ {
+ mtr_error("Can't use --extern with --embedded-server");
+ }
+ }
+
#
# Find the mysqld executable to be able to find the mysqld version
# number as early as possible
@@ -705,9 +723,19 @@ sub command_line_setup () {
"$glob_basedir/client",
"$glob_basedir/bin");
+ # Look for language files and charsetsdir, use same share
+ $path_share= mtr_path_exists("$glob_basedir/share/mysql",
+ "$glob_basedir/sql/share",
+ "$glob_basedir/share");
+
+ $path_language= mtr_path_exists("$path_share/english");
+ $path_charsetsdir= mtr_path_exists("$path_share/charsets");
+
+
if (!$opt_extern)
{
$exe_mysqld= mtr_exe_exists (vs_config_dirs('sql', 'mysqld'),
+ vs_config_dirs('sql', 'mysqld-debug'),
"$glob_basedir/sql/mysqld",
"$path_client_bindir/mysqld-max-nt",
"$path_client_bindir/mysqld-max",
@@ -762,7 +790,7 @@ sub command_line_setup () {
# Find out type of logging that are being used
# --------------------------------------------------------------------------
# NOTE if the default binlog format is changed, this has to be changed
- $used_binlog_format= "stmt";
+ $used_binlog_format= "statement";
if (!$opt_extern && $mysql_version_id >= 50100 )
{
$used_binlog_format= "mixed"; # Default value for binlog format
@@ -827,7 +855,6 @@ sub command_line_setup () {
# --------------------------------------------------------------------------
# Set the "var/" directory, as it is the base for everything else
# --------------------------------------------------------------------------
- $default_vardir= "$glob_mysql_test_dir/var";
if ( ! $opt_vardir )
{
$opt_vardir= $default_vardir;
@@ -893,23 +920,6 @@ sub command_line_setup () {
mtr_error("Will not run in record mode without a specific test case");
}
- # --------------------------------------------------------------------------
- # Embedded server flag
- # --------------------------------------------------------------------------
- if ( $opt_embedded_server )
- {
- $glob_use_embedded_server= 1;
- push(@glob_test_mode, "embedded");
- $opt_skip_rpl= 1; # We never run replication with embedded
- $opt_skip_ndbcluster= 1; # Turn off use of NDB cluster
- $opt_skip_ssl= 1; # Turn off use of SSL
-
- if ( $opt_extern )
- {
- mtr_error("Can't use --extern with --embedded-server");
- }
- }
-
# --------------------------------------------------------------------------
# ps protcol flag
@@ -920,40 +930,6 @@ sub command_line_setup () {
}
# --------------------------------------------------------------------------
- # Ndb cluster flags
- # --------------------------------------------------------------------------
-
- if ( $opt_ndbconnectstring )
- {
- $glob_use_running_ndbcluster= 1;
- mtr_error("Can't specify --ndb-connectstring and --skip-ndbcluster")
- if $opt_skip_ndbcluster;
- mtr_error("Can't specify --ndb-connectstring and --ndbcluster-port")
- if $opt_ndbcluster_port;
- }
- else
- {
- # Set default connect string
- $opt_ndbconnectstring= "host=localhost:$opt_ndbcluster_port";
- }
-
- if ( $opt_ndbconnectstring_slave )
- {
- $glob_use_running_ndbcluster_slave= 1;
- mtr_error("Can't specify ndb-connectstring_slave and " .
- "--skip-ndbcluster-slave")
- if $opt_skip_ndbcluster;
- mtr_error("Can't specify --ndb-connectstring-slave and " .
- "--ndbcluster-port-slave")
- if $opt_ndbcluster_port_slave;
- }
- else
- {
- # Set default connect string
- $opt_ndbconnectstring_slave= "host=localhost:$opt_ndbcluster_port_slave";
- }
-
- # --------------------------------------------------------------------------
# Bench flags
# --------------------------------------------------------------------------
if ( $opt_small_bench )
@@ -1072,7 +1048,7 @@ sub command_line_setup () {
# On some operating systems, there is a limit to the length of a
# UNIX domain socket's path far below PATH_MAX, so try to avoid long
# socket path names.
- $sockdir = tempdir(CLEANUP => 0) if ( length($sockdir) >= 80 );
+ $sockdir = tempdir(CLEANUP => 0) if ( length($sockdir) >= 70 );
$master->[0]=
{
@@ -1196,7 +1172,7 @@ sub command_line_setup () {
nodes => 2,
port => "$opt_ndbcluster_port",
data_dir => "$data_dir",
- connect_string => "$opt_ndbconnectstring",
+ connect_string => "host=localhost:$opt_ndbcluster_port",
path_pid => "$data_dir/ndb_3.pid", # Nodes + 1
pid => 0, # pid of ndb_mgmd
installed_ok => 0,
@@ -1209,7 +1185,7 @@ sub command_line_setup () {
nodes => 1,
port => "$opt_ndbcluster_port_slave",
data_dir => "$data_dir",
- connect_string => "$opt_ndbconnectstring_slave",
+ connect_string => "host=localhost:$opt_ndbcluster_port_slave",
path_pid => "$data_dir/ndb_2.pid", # Nodes + 1
pid => 0, # pid of ndb_mgmd
installed_ok => 0,
@@ -1231,6 +1207,9 @@ sub command_line_setup () {
}
}
+ # --------------------------------------------------------------------------
+ # extern
+ # --------------------------------------------------------------------------
if ( $opt_extern )
{
# Turn off features not supported when running with extern server
@@ -1247,6 +1226,38 @@ sub command_line_setup () {
if $opt_socket;
}
+
+ # --------------------------------------------------------------------------
+ # ndbconnectstring and ndbconnectstring_slave
+ # --------------------------------------------------------------------------
+ if ( $opt_ndbconnectstring )
+ {
+ # ndbconnectstring was supplied by user, the tests shoudl be run
+ # against an already started cluster, change settings
+ my $cluster= $clusters->[0]; # Master cluster
+ $cluster->{'connect_string'}= $opt_ndbconnectstring;
+ $cluster->{'use_running'}= 1;
+
+ mtr_error("Can't specify --ndb-connectstring and --skip-ndbcluster")
+ if $opt_skip_ndbcluster;
+ }
+ $ENV{'NDB_CONNECTSTRING'}= $clusters->[0]->{'connect_string'};
+
+
+ if ( $opt_ndbconnectstring_slave )
+ {
+ # ndbconnectstring-slave was supplied by user, the tests should be run
+ # agains an already started slave cluster, change settings
+ my $cluster= $clusters->[1]; # Slave cluster
+ $cluster->{'connect_string'}= $opt_ndbconnectstring_slave;
+ $cluster->{'use_running'}= 1;
+
+ mtr_error("Can't specify ndb-connectstring_slave and " .
+ "--skip-ndbcluster-slave")
+ if $opt_skip_ndbcluster_slave;
+ }
+
+
$path_timefile= "$opt_vardir/log/mysqltest-time";
$path_mysqltest_log= "$opt_vardir/log/mysqltest.log";
$path_current_test_log= "$opt_vardir/log/current_test";
@@ -1345,10 +1356,15 @@ sub collect_mysqld_features () {
my $found_variable_list_start= 0;
#
- # Execute "mysqld --no-defaults --help --verbose" to get a
+ # Execute "mysqld --help --verbose" to get a list
# list of all features and settings
#
- my $list= `$exe_mysqld --no-defaults --verbose --help`;
+ # --no-defaults and --skip-grant-tables are to avoid loading
+ # system-wide configs and plugins
+ #
+ # --datadir must exist, mysqld will chdir into it
+ #
+ my $list= `$exe_mysqld --no-defaults --datadir=$path_language --language=$path_language --skip-grant-tables --verbose --help`;
foreach my $line (split('\n', $list))
{
@@ -1511,14 +1527,6 @@ sub executable_setup () {
}
}
- # Look for language files and charsetsdir, use same share
- my $path_share= mtr_path_exists("$glob_basedir/share/mysql",
- "$glob_basedir/sql/share",
- "$glob_basedir/share");
-
- $path_language= mtr_path_exists("$path_share/english");
- $path_charsetsdir= mtr_path_exists("$path_share/charsets");
-
# Look for my_print_defaults
$exe_my_print_defaults=
mtr_exe_exists(vs_config_dirs('extra', 'my_print_defaults'),
@@ -1640,6 +1648,12 @@ sub executable_setup () {
"$glob_basedir/tests/mysql_client_test",
"$glob_basedir/bin/mysql_client_test");
}
+
+ # Look for bug25714 executable which may _not_ exist in
+ # some versions, test using it should be skipped
+ $exe_bug25714=
+ mtr_exe_maybe_exists(vs_config_dirs('tests', 'bug25714'),
+ "$glob_basedir/tests/bug25714");
}
@@ -1647,7 +1661,7 @@ sub generate_cmdline_mysqldump ($) {
my($mysqld) = @_;
return
mtr_native_path($exe_mysqldump) .
- " --no-defaults -uroot --debug-info " .
+ " --no-defaults -uroot --debug-check " .
"--port=$mysqld->{'port'} " .
"--socket=$mysqld->{'path_sock'} --password=";
}
@@ -1760,22 +1774,6 @@ sub environment_setup () {
}
# --------------------------------------------------------------------------
- # Add the path where mysqld will find udf_example.so
- # --------------------------------------------------------------------------
- if ( $lib_udf_example )
- {
- push(@ld_library_paths, dirname($lib_udf_example));
- }
-
- # --------------------------------------------------------------------------
- # Add the path where mysqld will find ha_example.so
- # --------------------------------------------------------------------------
- if ( $lib_example_plugin )
- {
- push(@ld_library_paths, dirname($lib_example_plugin));
- }
-
- # --------------------------------------------------------------------------
# Valgrind need to be run with debug libraries otherwise it's almost
# impossible to add correct supressions, that means if "/usr/lib/debug"
# is available, it should be added to
@@ -1805,6 +1803,17 @@ sub environment_setup () {
split(':', $ENV{'DYLD_LIBRARY_PATH'}) : ());
mtr_debug("DYLD_LIBRARY_PATH: $ENV{'DYLD_LIBRARY_PATH'}");
+ # The environment variable used for shared libs on AIX
+ $ENV{'SHLIB_PATH'}= join(":", @ld_library_paths,
+ $ENV{'SHLIB_PATH'} ?
+ split(':', $ENV{'SHLIB_PATH'}) : ());
+ mtr_debug("SHLIB_PATH: $ENV{'SHLIB_PATH'}");
+
+ # The environment variable used for shared libs on hp-ux
+ $ENV{'LIBPATH'}= join(":", @ld_library_paths,
+ $ENV{'LIBPATH'} ?
+ split(':', $ENV{'LIBPATH'}) : ());
+ mtr_debug("LIBPATH: $ENV{'LIBPATH'}");
# --------------------------------------------------------------------------
# Also command lines in .opt files may contain env vars
@@ -1813,6 +1822,18 @@ sub environment_setup () {
$ENV{'CHARSETSDIR'}= $path_charsetsdir;
$ENV{'UMASK'}= "0660"; # The octal *string*
$ENV{'UMASK_DIR'}= "0770"; # The octal *string*
+
+ #
+ # MySQL tests can produce output in various character sets
+ # (especially, ctype_xxx.test). To avoid confusing Perl
+ # with output which is incompatible with the current locale
+ # settings, we reset the current values of LC_ALL and LC_CTYPE to "C".
+ # For details, please see
+ # Bug#27636 tests fails if LC_* variables set to *_*.UTF-8
+ #
+ $ENV{'LC_ALL'}= "C";
+ $ENV{'LC_CTYPE'}= "C";
+
$ENV{'LC_COLLATE'}= "C";
$ENV{'USE_RUNNING_SERVER'}= $opt_extern;
$ENV{'MYSQL_TEST_DIR'}= $glob_mysql_test_dir;
@@ -1853,7 +1874,6 @@ sub environment_setup () {
$ENV{'NDB_DATA_DIR'}= $clusters->[0]->{'data_dir'};
$ENV{'NDB_TOOLS_DIR'}= $path_ndb_tools_dir;
$ENV{'NDB_TOOLS_OUTPUT'}= $path_ndb_testrun_log;
- $ENV{'NDB_CONNECTSTRING'}= $opt_ndbconnectstring;
if ( $mysql_version_id >= 50000 )
{
@@ -1894,7 +1914,7 @@ sub environment_setup () {
# ----------------------------------------------------
my $cmdline_mysqlcheck=
mtr_native_path($exe_mysqlcheck) .
- " --no-defaults --debug-info -uroot " .
+ " --no-defaults --debug-check -uroot " .
"--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'} --password=";
@@ -1946,7 +1966,7 @@ sub environment_setup () {
# ----------------------------------------------------
my $cmdline_mysqlimport=
mtr_native_path($exe_mysqlimport) .
- " -uroot --debug-info " .
+ " -uroot --debug-check " .
"--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'} --password=";
@@ -1963,7 +1983,7 @@ sub environment_setup () {
# ----------------------------------------------------
my $cmdline_mysqlshow=
mtr_native_path($exe_mysqlshow) .
- " -uroot --debug-info " .
+ " -uroot --debug-check " .
"--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'} --password=";
@@ -1979,7 +1999,7 @@ sub environment_setup () {
# ----------------------------------------------------
my $cmdline_mysqlbinlog=
mtr_native_path($exe_mysqlbinlog) .
- " --no-defaults --disable-force-if-open --debug-info";
+ " --no-defaults --disable-force-if-open --debug-check";
if ( !$opt_extern && $mysql_version_id >= 50000 )
{
$cmdline_mysqlbinlog .=" --character-sets-dir=$path_charsetsdir";
@@ -1997,7 +2017,7 @@ sub environment_setup () {
# ----------------------------------------------------
my $cmdline_mysql=
mtr_native_path($exe_mysql) .
- " --no-defaults --debug-info --host=localhost --user=root --password= " .
+ " --no-defaults --debug-check --host=localhost --user=root --password= " .
"--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'} ".
"--character-sets-dir=$path_charsetsdir";
@@ -2005,6 +2025,11 @@ sub environment_setup () {
$ENV{'MYSQL'}= $cmdline_mysql;
# ----------------------------------------------------
+ # Setup env so childs can execute bug25714
+ # ----------------------------------------------------
+ $ENV{'MYSQL_BUG25714'}= $exe_bug25714;
+
+ # ----------------------------------------------------
# Setup env so childs can execute mysql_client_test
# ----------------------------------------------------
$ENV{'MYSQL_CLIENT_TEST'}= mysql_client_test_arguments();
@@ -2053,12 +2078,16 @@ sub environment_setup () {
# ----------------------------------------------------
$ENV{'UDF_EXAMPLE_LIB'}=
($lib_udf_example ? basename($lib_udf_example) : "");
+ $ENV{'UDF_EXAMPLE_LIB_OPT'}=
+ ($lib_udf_example ? "--plugin_dir=" . dirname($lib_udf_example) : "");
# ----------------------------------------------------
# Add the path where mysqld will find ha_example.so
# ----------------------------------------------------
$ENV{'EXAMPLE_PLUGIN'}=
($lib_example_plugin ? basename($lib_example_plugin) : "");
+ $ENV{'EXAMPLE_PLUGIN_OPT'}=
+ ($lib_example_plugin ? "--plugin_dir=" . dirname($lib_example_plugin) : "");
# ----------------------------------------------------
# We are nice and report a bit about our settings
@@ -2167,7 +2196,7 @@ sub remove_stale_vardir () {
{
# Remove the directory which the link points at
mtr_verbose("Removing " . readlink($opt_vardir));
- rmtree(readlink($opt_vardir));
+ mtr_rmtree(readlink($opt_vardir));
# Remove the "var" symlink
mtr_verbose("unlink($opt_vardir)");
@@ -2195,7 +2224,7 @@ sub remove_stale_vardir () {
foreach my $bin ( glob("$opt_vardir/*") )
{
mtr_verbose("Removing bin $bin");
- rmtree($bin);
+ mtr_rmtree($bin);
}
}
}
@@ -2203,7 +2232,7 @@ sub remove_stale_vardir () {
{
# Remove the entire "var" dir
mtr_verbose("Removing $opt_vardir/");
- rmtree("$opt_vardir/");
+ mtr_rmtree("$opt_vardir/");
}
if ( $opt_mem )
@@ -2212,7 +2241,7 @@ sub remove_stale_vardir () {
# remove the $opt_mem dir to assure the symlink
# won't point at an old directory
mtr_verbose("Removing $opt_mem");
- rmtree($opt_mem);
+ mtr_rmtree($opt_mem);
}
}
@@ -2225,11 +2254,11 @@ sub remove_stale_vardir () {
# Remove the var/ dir in mysql-test dir if any
# this could be an old symlink that shouldn't be there
mtr_verbose("Removing $default_vardir");
- rmtree($default_vardir);
+ mtr_rmtree($default_vardir);
# Remove the "var" dir
mtr_verbose("Removing $opt_vardir/");
- rmtree("$opt_vardir/");
+ mtr_rmtree("$opt_vardir/");
}
}
@@ -2328,16 +2357,23 @@ sub check_running_as_root () {
close FILE;
}
- chmod(oct("0755"), $test_file);
- unlink($test_file);
+ # Some filesystems( for example CIFS) allows reading a file
+ # although mode was set to 0000, but in that case a stat on
+ # the file will not return 0000
+ my $file_mode= (stat($test_file))[2] & 07777;
$ENV{'MYSQL_TEST_ROOT'}= "NO";
- if ($result eq "MySQL")
+ mtr_verbose("result: $result, file_mode: $file_mode");
+ if ($result eq "MySQL" && $file_mode == 0)
{
mtr_warning("running this script as _root_ will cause some " .
"tests to be skipped");
$ENV{'MYSQL_TEST_ROOT'}= "YES";
}
+
+ chmod(oct("0755"), $test_file);
+ unlink($test_file);
+
}
@@ -2412,6 +2448,7 @@ sub vs_config_dirs ($$) {
}
return ("$glob_basedir/$path_part/release/$exe",
+ "$glob_basedir/$path_part/relwithdebinfo/$exe",
"$glob_basedir/$path_part/debug/$exe");
}
@@ -2567,10 +2604,19 @@ sub ndbcluster_wait_started($$){
sub mysqld_wait_started($){
my $mysqld= shift;
- my $res= sleep_until_file_created($mysqld->{'path_pid'},
- $mysqld->{'start_timeout'},
- $mysqld->{'pid'});
- return $res == 0;
+ if (sleep_until_file_created($mysqld->{'path_pid'},
+ $mysqld->{'start_timeout'},
+ $mysqld->{'pid'}) == 0)
+ {
+ # Failed to wait for pid file
+ return 1;
+ }
+
+ # Get the "real pid" of the process, it will be used for killing
+ # the process in ActiveState's perl on windows
+ $mysqld->{'real_pid'}= mtr_get_pid_from_file($mysqld->{'path_pid'});
+
+ return 0;
}
@@ -2674,7 +2720,7 @@ sub ndbcluster_start ($$) {
mtr_verbose("ndbcluster_start '$cluster->{'name'}'");
- if ( $glob_use_running_ndbcluster )
+ if ( $cluster->{'use_running'} )
{
return 0;
}
@@ -2771,19 +2817,17 @@ sub run_benchmarks ($) {
##############################################################################
#
-# Run the test suite
+# Run the tests
#
##############################################################################
-sub run_suite () {
- my ($suite, $tests)= @_;
+sub run_tests () {
+ my ($tests)= @_;
mtr_print_thick_line();
mtr_timer_start($glob_timers,"suite", 60 * $opt_suite_timeout);
- mtr_report("Starting Tests in the '$suite' suite");
-
mtr_report_tests_not_skipped_though_disabled($tests);
mtr_print_header();
@@ -2867,13 +2911,16 @@ sub initialize_servers () {
}
}
check_running_as_root();
+
+ mtr_log_init("$opt_vardir/log/mysql-test-run.log");
+
}
sub mysql_install_db () {
install_db('master', $master->[0]->{'path_myddir'});
- if ($max_master_num)
+ if ($max_master_num > 1)
{
copy_install_db('master', $master->[1]->{'path_myddir'});
}
@@ -2891,30 +2938,34 @@ sub mysql_install_db () {
my $cluster_started_ok= 1; # Assume it can be started
- if ($opt_skip_ndbcluster || $glob_use_running_ndbcluster ||
- $clusters->[0]->{executable_setup_failed})
+ my $cluster= $clusters->[0]; # Master cluster
+ if ($opt_skip_ndbcluster ||
+ $cluster->{'use_running'} ||
+ $cluster->{executable_setup_failed})
{
# Don't install master cluster
}
- elsif (ndbcluster_start_install($clusters->[0]))
+ elsif (ndbcluster_start_install($cluster))
{
- mtr_warning("Failed to start install of $clusters->[0]->{name}");
+ mtr_warning("Failed to start install of $cluster->{name}");
$cluster_started_ok= 0;
}
+ $cluster= $clusters->[1]; # Slave cluster
if ($max_slave_num == 0 ||
- $opt_skip_ndbcluster_slave || $glob_use_running_ndbcluster_slave ||
- $clusters->[1]->{executable_setup_failed})
+ $opt_skip_ndbcluster_slave ||
+ $cluster->{'use_running'} ||
+ $cluster->{executable_setup_failed})
{
# Don't install slave cluster
}
- elsif (ndbcluster_start_install($clusters->[1]))
+ elsif (ndbcluster_start_install($cluster))
{
- mtr_warning("Failed to start install of $clusters->[1]->{name}");
+ mtr_warning("Failed to start install of $cluster->{name}");
$cluster_started_ok= 0;
}
- foreach my $cluster (@{$clusters})
+ foreach $cluster (@{$clusters})
{
next if !$cluster->{'pid'};
@@ -2972,8 +3023,8 @@ sub install_db ($$) {
mtr_add_arg($args, "--bootstrap");
mtr_add_arg($args, "--basedir=%s", $path_my_basedir);
mtr_add_arg($args, "--datadir=%s", $data_dir);
- mtr_add_arg($args, "--skip-innodb");
- mtr_add_arg($args, "--skip-ndbcluster");
+ mtr_add_arg($args, "--loose-skip-innodb");
+ mtr_add_arg($args, "--loose-skip-ndbcluster");
mtr_add_arg($args, "--tmpdir=.");
mtr_add_arg($args, "--core-file");
@@ -3031,11 +3082,16 @@ sub install_db ($$) {
mtr_appendfile_to_file("$path_sql_dir/fill_help_tables.sql",
$bootstrap_sql_file);
+ # Remove anonymous users
+ mtr_tofile($bootstrap_sql_file,
+ "DELETE FROM mysql.user where user= '';");
+
# Log bootstrap command
my $path_bootstrap_log= "$opt_vardir/log/bootstrap.log";
mtr_tofile($path_bootstrap_log,
"$exe_mysqld_bootstrap " . join(" ", @$args) . "\n");
+
if ( mtr_run($exe_mysqld_bootstrap, $args, $bootstrap_sql_file,
$path_bootstrap_log, $path_bootstrap_log,
"", { append_log_file => 1 }) != 0 )
@@ -3114,8 +3170,8 @@ basedir = $path_my_basedir
server_id = $server_id
shutdown-delay = 10
skip-stack-trace
-skip-innodb
-skip-ndbcluster
+loose-skip-innodb
+loose-skip-ndbcluster
EOF
;
if ( $mysql_version_id < 50100 )
@@ -3160,7 +3216,7 @@ sub restore_slave_databases ($) {
{
my $data_dir= $slave->[$idx]->{'path_myddir'};
my $name= basename($data_dir);
- rmtree($data_dir);
+ mtr_rmtree($data_dir);
mtr_copy_dir("$path_snapshot/$name", $data_dir);
}
}
@@ -3189,9 +3245,16 @@ sub run_testcase_check_skip_test($)
{
foreach my $cluster (@{$clusters})
{
+ # Slave cluster is skipped and thus not
+ # installed, no need to perform checks
last if ($opt_skip_ndbcluster_slave and
$cluster->{'name'} eq 'Slave');
+ # Using running cluster - no need
+ # to check if test should be skipped
+ # will be done by test itself
+ last if ($cluster->{'use_running'});
+
# If test needs this cluster, check binaries was found ok
if ( $cluster->{'executable_setup_failed'} )
{
@@ -3235,18 +3298,14 @@ sub run_testcase_check_skip_test($)
sub do_before_run_mysqltest($)
{
my $tinfo= shift;
- my $tname= $tinfo->{'name'};
# Remove old files produced by mysqltest
- my $result_dir= "r";
- if ( $opt_suite ne "main" )
- {
- $result_dir= "suite/$opt_suite/r";
- }
- unlink("$result_dir/$tname.reject");
- unlink("$result_dir/$tname.progress");
- unlink("$result_dir/$tname.log");
- unlink("$result_dir/$tname.warnings");
+ my $base_file= mtr_match_extension($tinfo->{'result_file'},
+ "result"); # Trim extension
+ unlink("$base_file.reject");
+ unlink("$base_file.progress");
+ unlink("$base_file.log");
+ unlink("$base_file.warnings");
if (!$opt_extern)
{
@@ -3265,7 +3324,6 @@ sub do_before_run_mysqltest($)
sub do_after_run_mysqltest($)
{
my $tinfo= shift;
- my $tname= $tinfo->{'name'};
# Save info from this testcase run to mysqltest.log
mtr_appendfile_to_file($path_current_test_log, $path_mysqltest_log)
@@ -3305,9 +3363,12 @@ sub find_testcase_skipped_reason($)
{
my ($tinfo)= @_;
- # Open mysqltest-time
- my $F= IO::File->new($path_timefile) or
- mtr_error("can't open file \"$path_timefile\": $!");
+ # Set default message
+ $tinfo->{'comment'}= "Detected by testcase(no log file)";
+
+ # Open mysqltest-time(the mysqltest log file)
+ my $F= IO::File->new($path_timefile)
+ or return;
my $reason;
while ( my $line= <$F> )
@@ -3328,56 +3389,6 @@ sub find_testcase_skipped_reason($)
}
-sub analyze_testcase_failure_sync_with_master($)
-{
- my ($tinfo)= @_;
-
- my $args;
- mtr_init_args(\$args);
-
- mtr_add_arg($args, "--no-defaults");
- mtr_add_arg($args, "--silent");
- mtr_add_arg($args, "--skip-safemalloc");
- mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir);
- mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir);
-
- mtr_add_arg($args, "--socket=%s", $master->[0]->{'path_sock'});
- mtr_add_arg($args, "--port=%d", $master->[0]->{'port'});
- mtr_add_arg($args, "--database=test");
- mtr_add_arg($args, "--user=%s", $opt_user);
- mtr_add_arg($args, "--password=");
-
- # Run the test file and append output to log file
- mtr_run_test($exe_mysqltest,$args,
- "include/analyze_failure_sync_with_master.test",
- "$path_timefile", "$path_timefile","",
- { append_log_file => 1 });
-
-}
-
-sub analyze_testcase_failure($)
-{
- my ($tinfo)= @_;
-
- # Open mysqltest.log
- my $F= IO::File->new($path_timefile) or
- mtr_error("can't open file \"$path_timefile\": $!");
-
- while ( my $line= <$F> )
- {
- # Look for "mysqltest: At line nnn: <error>
- if ( $line =~ /mysqltest: At line [0-9]*: (.*)/ )
- {
- my $error= $1;
- # Look for "could not sync with master"
- if ( $error =~ /could not sync with master/ )
- {
- analyze_testcase_failure_sync_with_master($tinfo);
- }
- }
- }
-}
-
##############################################################################
#
# Run a single test case
@@ -3477,10 +3488,6 @@ sub run_testcase ($) {
}
elsif ( $res == 1 )
{
- if ( $opt_force )
- {
- analyze_testcase_failure($tinfo);
- }
# Test case failure reported by mysqltest
report_failure_and_restart($tinfo);
}
@@ -3514,7 +3521,7 @@ sub run_testcase ($) {
sub save_installed_db () {
mtr_report("Saving snapshot of installed databases");
- rmtree($path_snapshot);
+ mtr_rmtree($path_snapshot);
foreach my $data_dir (@data_dir_lst)
{
@@ -3561,7 +3568,7 @@ sub restore_installed_db ($) {
{
my $name= basename($data_dir);
save_files_before_restore($test_name, $data_dir);
- rmtree("$data_dir");
+ mtr_rmtree("$data_dir");
mtr_copy_dir("$path_snapshot/$name", "$data_dir");
}
@@ -3571,7 +3578,7 @@ sub restore_installed_db ($) {
{
foreach my $ndbd (@{$cluster->{'ndbds'}})
{
- rmtree("$ndbd->{'path_fs'}" );
+ mtr_rmtree("$ndbd->{'path_fs'}" );
}
}
}
@@ -3586,7 +3593,6 @@ sub report_failure_and_restart ($) {
my $tinfo= shift;
mtr_report_test_failed($tinfo);
- mtr_show_failed_diff($tinfo->{'result_file'});
print "\n";
if ( $opt_force )
{
@@ -3595,13 +3601,13 @@ sub report_failure_and_restart ($) {
# Restore the snapshot of the installed test db
restore_installed_db($tinfo->{'name'});
- print "Resuming Tests\n\n";
+ mtr_report("Resuming Tests\n");
return;
}
my $test_mode= join(" ", @::glob_test_mode) || "default";
- print "Aborting: $tinfo->{'name'} failed in $test_mode mode. ";
- print "To continue, re-run with '--force'.\n";
+ mtr_report("Aborting: $tinfo->{'name'} failed in $test_mode mode. ");
+ mtr_report("To continue, re-run with '--force'.");
if ( ! $glob_debugger and
! $opt_extern and
! $glob_use_embedded_server )
@@ -3644,6 +3650,9 @@ sub do_before_start_master ($) {
# FIXME what about second master.....
+ # Don't delete anything if starting dirty
+ return if ($opt_start_dirty);
+
foreach my $bin ( glob("$opt_vardir/log/master*-bin*") )
{
unlink($bin);
@@ -3666,6 +3675,9 @@ sub do_before_start_slave ($) {
my $tname= $tinfo->{'name'};
my $init_script= $tinfo->{'master_sh'};
+ # Don't delete anything if starting dirty
+ return if ($opt_start_dirty);
+
foreach my $bin ( glob("$opt_vardir/log/slave*-bin*") )
{
unlink($bin);
@@ -3713,22 +3725,13 @@ sub mysqld_arguments ($$$$) {
mtr_add_arg($args, "%s--no-defaults", $prefix);
- mtr_add_arg($args, "%s--console", $prefix);
mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir);
mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir);
if ( $mysql_version_id >= 50036)
{
# By default, prevent the started mysqld to access files outside of vardir
- my $secure_file_dir= $opt_vardir;
- if ( $opt_suite ne "main" )
- {
- # When running a suite other than default allow the mysqld
- # access to subdirs of mysql-test/ in order to make it possible
- # to "load data" from the suites data/ directory.
- $secure_file_dir= $glob_mysql_test_dir;
- }
- mtr_add_arg($args, "%s--secure-file-priv=%s", $prefix, $secure_file_dir);
+ mtr_add_arg($args, "%s--secure-file-priv=%s", $prefix, $opt_vardir);
}
if ( $mysql_version_id >= 50000 )
@@ -3775,8 +3778,7 @@ sub mysqld_arguments ($$$$) {
"%s--log-slow-queries=%s-slow.log", $prefix, $log_base_path);
# Check if "extra_opt" contains --skip-log-bin
- my $skip_binlog= grep(/^--skip-log-bin/, @$extra_opt);
-
+ my $skip_binlog= grep(/^--skip-log-bin/, @$extra_opt, @opt_extra_mysqld_opt);
if ( $mysqld->{'type'} eq 'master' )
{
if (! ($opt_skip_master_binlog || $skip_binlog) )
@@ -3788,23 +3790,19 @@ sub mysqld_arguments ($$$$) {
mtr_add_arg($args, "%s--server-id=%d", $prefix,
$idx > 0 ? $idx + 101 : 1);
- mtr_add_arg($args, "%s--innodb_data_file_path=ibdata1:10M:autoextend",
+ mtr_add_arg($args, "%s--loose-innodb_data_file_path=ibdata1:10M:autoextend",
$prefix);
mtr_add_arg($args, "%s--local-infile", $prefix);
if ( $idx > 0 or !$use_innodb)
{
- mtr_add_arg($args, "%s--skip-innodb", $prefix);
+ mtr_add_arg($args, "%s--loose-skip-innodb", $prefix);
}
my $cluster= $clusters->[$mysqld->{'cluster'}];
- if ( $opt_skip_ndbcluster ||
- !$cluster->{'pid'})
- {
- mtr_add_arg($args, "%s--skip-ndbcluster", $prefix);
- }
- else
+ if ( $cluster->{'pid'} || # Cluster is started
+ $cluster->{'use_running'} ) # Using running cluster
{
mtr_add_arg($args, "%s--ndbcluster", $prefix);
mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix,
@@ -3814,9 +3812,10 @@ sub mysqld_arguments ($$$$) {
mtr_add_arg($args, "%s--ndb-extra-logging", $prefix);
}
}
-
- mtr_add_arg($args, "%s--plugin_dir=%s", $prefix,
- dirname($lib_example_plugin));
+ else
+ {
+ mtr_add_arg($args, "%s--loose-skip-ndbcluster", $prefix);
+ }
}
else
{
@@ -3839,7 +3838,7 @@ sub mysqld_arguments ($$$$) {
mtr_add_arg($args, "%s--report-port=%d", $prefix,
$mysqld->{'port'});
mtr_add_arg($args, "%s--report-user=root", $prefix);
- mtr_add_arg($args, "%s--skip-innodb", $prefix);
+ mtr_add_arg($args, "%s--loose-skip-innodb", $prefix);
mtr_add_arg($args, "%s--skip-slave-start", $prefix);
# Directory where slaves find the dumps generated by "load data"
@@ -3859,36 +3858,39 @@ sub mysqld_arguments ($$$$) {
}
else
{
- mtr_add_arg($args, "%s--master-user=root", $prefix);
- mtr_add_arg($args, "%s--master-connect-retry=1", $prefix);
- mtr_add_arg($args, "%s--master-host=127.0.0.1", $prefix);
- mtr_add_arg($args, "%s--master-password=", $prefix);
- mtr_add_arg($args, "%s--master-port=%d", $prefix,
- $master->[0]->{'port'}); # First master
-
+ if ($mysql_version_id < 50200)
+ {
+ mtr_add_arg($args, "%s--master-user=root", $prefix);
+ mtr_add_arg($args, "%s--master-connect-retry=1", $prefix);
+ mtr_add_arg($args, "%s--master-host=127.0.0.1", $prefix);
+ mtr_add_arg($args, "%s--master-password=", $prefix);
+ mtr_add_arg($args, "%s--master-port=%d", $prefix,
+ $master->[0]->{'port'}); # First master
+ }
my $slave_server_id= 2 + $idx;
my $slave_rpl_rank= $slave_server_id;
mtr_add_arg($args, "%s--server-id=%d", $prefix, $slave_server_id);
mtr_add_arg($args, "%s--rpl-recovery-rank=%d", $prefix, $slave_rpl_rank);
}
- if ( $opt_skip_ndbcluster_slave ||
- $mysqld->{'cluster'} == -1 ||
- !$clusters->[$mysqld->{'cluster'}]->{'pid'} )
- {
- mtr_add_arg($args, "%s--skip-ndbcluster", $prefix);
- }
- else
+ my $cluster= $clusters->[$mysqld->{'cluster'}];
+ if ( $cluster->{'pid'} || # Slave cluster is started
+ $cluster->{'use_running'} ) # Using running slave cluster
{
mtr_add_arg($args, "%s--ndbcluster", $prefix);
mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix,
- $clusters->[$mysqld->{'cluster'}]->{'connect_string'});
+ $cluster->{'connect_string'});
if ( $mysql_version_id >= 50100 )
{
mtr_add_arg($args, "%s--ndb-extra-logging", $prefix);
}
}
+ else
+ {
+ mtr_add_arg($args, "%s--loose-skip-ndbcluster", $prefix);
+ }
+
} # end slave
if ( $opt_debug )
@@ -4031,6 +4033,9 @@ sub mysqld_start ($$$) {
$wait_for_pid_file= 0;
}
+ # Remove the pidfile
+ unlink($mysqld->{'path_pid'});
+
if ( defined $exe )
{
$pid= mtr_spawn($exe, $args, "",
@@ -4064,11 +4069,11 @@ sub mysqld_start ($$$) {
sub stop_all_servers () {
- print "Stopping All Servers\n";
+ mtr_report("Stopping All Servers");
if ( ! $opt_skip_im )
{
- print "Shutting-down Instance Manager\n";
+ mtr_report("Shutting-down Instance Manager");
unless (mtr_im_stop($instance_manager, "stop_all_servers"))
{
mtr_error("Failed to stop Instance Manager.")
@@ -4080,7 +4085,7 @@ sub stop_all_servers () {
my $pid;
# Start shutdown of all started masters
- foreach my $mysqld (@{$master}, @{$slave})
+ foreach my $mysqld (@{$slave}, @{$master})
{
if ( $mysqld->{'pid'} )
{
@@ -4089,9 +4094,11 @@ sub stop_all_servers () {
push(@kill_pids,{
pid => $mysqld->{'pid'},
+ real_pid => $mysqld->{'real_pid'},
pidfile => $mysqld->{'path_pid'},
sockfile => $mysqld->{'path_sock'},
port => $mysqld->{'port'},
+ errfile => $mysqld->{'path_myerr'},
});
$mysqld->{'pid'}= 0; # Assume we are done with it
@@ -4289,15 +4296,17 @@ sub run_testcase_stop_servers($$$) {
{
if ( $mysqld->{'pid'} )
{
- $pid= mtr_mysqladmin_start($mysqld, "shutdown", 70);
+ $pid= mtr_mysqladmin_start($mysqld, "shutdown", 20);
$admin_pids{$pid}= 1;
push(@kill_pids,{
pid => $mysqld->{'pid'},
+ real_pid => $mysqld->{'real_pid'},
pidfile => $mysqld->{'path_pid'},
sockfile => $mysqld->{'path_sock'},
port => $mysqld->{'port'},
+ errfile => $mysqld->{'path_myerr'},
});
$mysqld->{'pid'}= 0; # Assume we are done with it
@@ -4339,15 +4348,17 @@ sub run_testcase_stop_servers($$$) {
{
if ( $mysqld->{'pid'} )
{
- $pid= mtr_mysqladmin_start($mysqld, "shutdown", 70);
+ $pid= mtr_mysqladmin_start($mysqld, "shutdown", 20);
$admin_pids{$pid}= 1;
push(@kill_pids,{
pid => $mysqld->{'pid'},
+ real_pid => $mysqld->{'real_pid'},
pidfile => $mysqld->{'path_pid'},
sockfile => $mysqld->{'path_sock'},
port => $mysqld->{'port'},
+ errfile => $mysqld->{'path_myerr'},
});
@@ -4437,7 +4448,8 @@ sub run_testcase_start_servers($) {
}
- if ( $clusters->[0]->{'pid'} and ! $master->[1]->{'pid'} and
+ if ( $clusters->[0]->{'pid'} || $clusters->[0]->{'use_running'}
+ and ! $master->[1]->{'pid'} and
$tinfo->{'master_num'} > 1 )
{
# Test needs cluster, start an extra mysqld connected to cluster
@@ -4769,12 +4781,13 @@ sub run_mysqltest ($) {
mtr_add_arg($args, "%s", $_) for @args_saved;
}
- mtr_add_arg($args, "--test-file");
- mtr_add_arg($args, $tinfo->{'path'});
+ mtr_add_arg($args, "--test-file=%s", $tinfo->{'path'});
+
+ # Number of lines of resut to include in failure report
+ mtr_add_arg($args, "--tail-lines=20");
if ( defined $tinfo->{'result_file'} ) {
- mtr_add_arg($args, "--result-file");
- mtr_add_arg($args, $tinfo->{'result_file'});
+ mtr_add_arg($args, "--result-file=%s", $tinfo->{'result_file'});
}
if ( $opt_record )
@@ -5101,7 +5114,9 @@ Options to control what test suites or cases to run
ndb-extra Run extra tests from ndb directory
do-test=PREFIX Run test cases which name are prefixed with PREFIX
start-from=PREFIX Run test cases starting from test prefixed with PREFIX
- suite=NAME Run the test suite named NAME. The default is "main"
+ suite[s]=NAME1,..,NAMEN Collect tests in suites from the comma separated
+ list of suite names.
+ The default is: "$opt_suites"
skip-rpl Skip the replication test cases.
skip-im Don't start IM, and skip the IM test cases
skip-test=PREFIX Skip test cases which name are prefixed with PREFIX
@@ -5184,7 +5199,6 @@ Misc options
fast Don't try to clean up from earlier runs
reorder Reorder tests to get fewer server restarts
help Get this help text
- unified-diff | udiff When presenting differences, use unified diff
testcase-timeout=MINUTES Max test case run time (default $default_testcase_timeout)
suite-timeout=MINUTES Max test suite run time (default $default_suite_timeout)
diff --git a/mysql-test/ndb/ndb_config_1_node.ini b/mysql-test/ndb/ndb_config_1_node.ini
index 39e758493c8..4e0be7796dc 100644
--- a/mysql-test/ndb/ndb_config_1_node.ini
+++ b/mysql-test/ndb/ndb_config_1_node.ini
@@ -10,13 +10,16 @@ DataDir= CHOOSE_FILESYSTEM
MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes
MaxNoOfAttributes= CHOOSE_MaxNoOfAttributes
TimeBetweenGlobalCheckpoints= 500
-NoOfFragmentLogFiles= 3
-DiskPageBufferMemory= CHOOSE_DiskPageBufferMemory
+NoOfFragmentLogFiles= 8
+FragmentLogFileSize= 6M
+DiskPageBufferMemory= CHOOSE_DiskPageBufferMemory
#
-# Increase deadlock-timeout to cater for slow test-machines
+# Increase timeouts to cater for slow test-machines
# (possibly running several tests in parallell)
#
+HeartbeatIntervalDbDb= 30000
+HeartbeatIntervalDbApi= 30000
#TransactionDeadlockDetectionTimeout= 7500
[ndbd]
diff --git a/mysql-test/ndb/ndb_config_2_node.ini b/mysql-test/ndb/ndb_config_2_node.ini
index 99f31150d8c..57e4d049ad6 100644
--- a/mysql-test/ndb/ndb_config_2_node.ini
+++ b/mysql-test/ndb/ndb_config_2_node.ini
@@ -10,16 +10,21 @@ DataDir= CHOOSE_FILESYSTEM
MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes
MaxNoOfAttributes= CHOOSE_MaxNoOfAttributes
TimeBetweenGlobalCheckpoints= 500
-NoOfFragmentLogFiles= 3
+NoOfFragmentLogFiles= 4
+FragmentLogFileSize=12M
DiskPageBufferMemory= CHOOSE_DiskPageBufferMemory
+# O_DIRECT has issues on 2.4 whach have not been handled, Bug #29612
+#ODirect= 1
# the following parametes just function as a small regression
# test that the parameter exists
InitialNoOfOpenFiles= 27
#
-# Increase deadlock-timeout to cater for slow test-machines
+# Increase timeouts to cater for slow test-machines
# (possibly running several tests in parallell)
#
+HeartbeatIntervalDbDb= 30000
+HeartbeatIntervalDbApi= 30000
#TransactionDeadlockDetectionTimeout= 7500
[ndbd]
diff --git a/mysql-test/ndb/ndb_config_4_node.ini b/mysql-test/ndb/ndb_config_4_node.ini
index 94d58bd8efc..d7c66cf177a 100644
--- a/mysql-test/ndb/ndb_config_4_node.ini
+++ b/mysql-test/ndb/ndb_config_4_node.ini
@@ -11,12 +11,14 @@ MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes
MaxNoOfAttributes= CHOOSE_MaxNoOfAttributes
TimeBetweenGlobalCheckpoints= 500
NoOfFragmentLogFiles= 3
-DiskPageBufferMemory= CHOOSE_DiskPageBufferMemory
+DiskPageBufferMemory= CHOOSE_DiskPageBufferMemory
#
-# Increase deadlock-timeout to cater for slow test-machines
+# Increase timeouts to cater for slow test-machines
# (possibly running several tests in parallell)
#
+HeartbeatIntervalDbDb= 30000
+HeartbeatIntervalDbApi= 30000
#TransactionDeadlockDetectionTimeout= 7500
[ndbd]
diff --git a/mysql-test/r/alter_table-big.result b/mysql-test/r/alter_table-big.result
index a9d0515d6bb..9761754a02f 100644
--- a/mysql-test/r/alter_table-big.result
+++ b/mysql-test/r/alter_table-big.result
@@ -5,14 +5,53 @@ key (n2, n3, n1),
key (n3, n1, n2));
create table t2 (i int);
alter table t1 disable keys;
+insert into t1 values (RAND()*1000, RAND()*1000, RAND()*1000);
reset master;
+set session debug="+d,sleep_alter_enable_indexes";
alter table t1 enable keys;;
insert into t2 values (1);
insert into t1 values (1, 1, 1);
-show binlog events in 'master-bin.000001' from 102;
+set session debug="-d,sleep_alter_enable_indexes";
+show binlog events in 'master-bin.000001' from 106;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; insert into t2 values (1)
master-bin.000001 # Query 1 # use `test`; alter table t1 enable keys
master-bin.000001 # Query 1 # use `test`; insert into t1 values (1, 1, 1)
drop tables t1, t2;
End of 5.0 tests
+drop table if exists t1, t2, t3;
+create table t1 (i int);
+reset master;
+set session debug="+d,sleep_alter_before_main_binlog";
+alter table t1 change i c char(10) default 'Test1';;
+insert into t1 values ();
+select * from t1;
+c
+Test1
+alter table t1 change c vc varchar(100) default 'Test2';;
+rename table t1 to t2;
+drop table t2;
+create table t1 (i int);
+alter table t1 change i c char(10) default 'Test3', rename to t2;;
+insert into t2 values ();
+select * from t2;
+c
+Test3
+alter table t2 change c vc varchar(100) default 'Test2', rename to t1;;
+rename table t1 to t3;
+drop table t3;
+set session debug="-d,sleep_alter_before_main_binlog";
+show binlog events in 'master-bin.000001' from 106;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # use `test`; alter table t1 change i c char(10) default 'Test1'
+master-bin.000001 # Query 1 # use `test`; insert into t1 values ()
+master-bin.000001 # Query 1 # use `test`; alter table t1 change c vc varchar(100) default 'Test2'
+master-bin.000001 # Query 1 # use `test`; rename table t1 to t2
+master-bin.000001 # Query 1 # use `test`; drop table t2
+master-bin.000001 # Query 1 # use `test`; create table t1 (i int)
+master-bin.000001 # Query 1 # use `test`; alter table t1 change i c char(10) default 'Test3', rename to t2
+master-bin.000001 # Query 1 # use `test`; insert into t2 values ()
+master-bin.000001 # Query 1 # use `test`; alter table t2 change c vc varchar(100) default 'Test2', rename to t1
+master-bin.000001 # Query 1 # use `test`; rename table t1 to t3
+master-bin.000001 # Query 1 # use `test`; drop table t3
+End of 5.1 tests
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index 4481b56791f..68b636829fc 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -54,7 +54,7 @@ SHOW FULL COLUMNS FROM t1;
Field Type Collation Null Key Default Extra Privileges Comment
GROUP_ID int(10) unsigned NULL NO PRI 0 #
LANG_ID smallint(5) unsigned NULL NO PRI 0 #
-NAME char(80) latin1_swedish_ci NO MUL #
+NAME char(80) latin1_swedish_ci NO MUL NULL #
DROP TABLE t1;
create table t1 (n int);
insert into t1 values(9),(3),(12),(10);
@@ -846,6 +846,25 @@ id
50
51
drop table t1;
+set @orig_sql_mode = @@sql_mode;
+set sql_mode="no_zero_date";
+create table t1(f1 int);
+alter table t1 add column f2 datetime not null, add column f21 date not null;
+insert into t1 values(1,'2000-01-01','2000-01-01');
+alter table t1 add column f3 datetime not null;
+ERROR 22007: Incorrect datetime value: '0000-00-00 00:00:00' for column 'f3' at row 1
+alter table t1 add column f3 date not null;
+ERROR 22007: Incorrect date value: '0000-00-00' for column 'f3' at row 1
+alter table t1 add column f4 datetime not null default '2002-02-02',
+add column f41 date not null;
+ERROR 22007: Incorrect date value: '0000-00-00' for column 'f41' at row 1
+alter table t1 add column f4 datetime not null default '2002-02-02',
+add column f41 date not null default '2002-02-02';
+select * from t1;
+f1 f2 f21 f4 f41
+1 2000-01-01 00:00:00 2000-01-01 2002-02-02 00:00:00 2002-02-02
+drop table t1;
+set sql_mode= @orig_sql_mode;
create table t1 (v varchar(32));
insert into t1 values ('def'),('abc'),('hij'),('3r4f');
select * from t1;
@@ -977,6 +996,61 @@ SELECT * FROM t1;
v b
abc 5
DROP TABLE t1;
+End of 5.0 tests
+drop table if exists t1, t2, t3;
+create table t1 (i int);
+create table t3 (j int);
+insert into t1 values ();
+insert into t3 values ();
+lock table t1 write, t3 read;
+alter table t1 modify i int default 1;
+insert into t1 values ();
+select * from t1;
+i
+NULL
+1
+alter table t1 change i c char(10) default "Two";
+insert into t1 values ();
+select * from t1;
+c
+NULL
+1
+Two
+alter table t1 modify c char(10) default "Three", rename to t2;
+select * from t1;
+ERROR HY000: Table 't1' was not locked with LOCK TABLES
+select * from t2;
+ERROR HY000: Table 't2' was not locked with LOCK TABLES
+select * from t3;
+j
+NULL
+unlock tables;
+insert into t2 values ();
+select * from t2;
+c
+NULL
+1
+Two
+Three
+lock table t2 write, t3 read;
+alter table t2 change c vc varchar(100) default "Four", rename to t1;
+select * from t1;
+ERROR HY000: Table 't1' was not locked with LOCK TABLES
+select * from t2;
+ERROR HY000: Table 't2' was not locked with LOCK TABLES
+select * from t3;
+j
+NULL
+unlock tables;
+insert into t1 values ();
+select * from t1;
+vc
+NULL
+1
+Two
+Three
+Four
+drop tables t1, t3;
DROP TABLE IF EXISTS `t+1`, `t+2`;
CREATE TABLE `t+1` (c1 INT);
ALTER TABLE `t+1` RENAME `t+2`;
@@ -1051,7 +1125,7 @@ INDEX(`int_field`)
);
DESCRIBE t1;
Field Type Null Key Default Extra
-int_field int(10) unsigned NO MUL
+int_field int(10) unsigned NO MUL NULL
char_field char(10) YES NULL
SHOW INDEXES FROM t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
@@ -1072,15 +1146,41 @@ unsigned_int_field char_field
5 pet
DESCRIBE t2;
Field Type Null Key Default Extra
-unsigned_int_field int(10) unsigned NO MUL
+unsigned_int_field int(10) unsigned NO MUL NULL
char_field char(10) YES NULL
DESCRIBE t2;
Field Type Null Key Default Extra
-unsigned_int_field int(10) unsigned NO MUL
+unsigned_int_field int(10) unsigned NO MUL NULL
char_field char(10) YES NULL
ALTER TABLE t2 MODIFY unsigned_int_field BIGINT UNSIGNED NOT NULL;
DESCRIBE t2;
Field Type Null Key Default Extra
-unsigned_int_field bigint(20) unsigned NO MUL
+unsigned_int_field bigint(20) unsigned NO MUL NULL
char_field char(10) YES NULL
DROP TABLE t2;
+CREATE TABLE t1 (f1 INT, f2 INT, f3 INT);
+INSERT INTO t1 VALUES (1, 2, NULL);
+SELECT * FROM t1;
+f1 f2 f3
+1 2 NULL
+ALTER TABLE t1 MODIFY COLUMN f3 INT AFTER f1;
+SELECT * FROM t1;
+f1 f3 f2
+1 NULL 2
+ALTER TABLE t1 MODIFY COLUMN f3 INT AFTER f2;
+SELECT * FROM t1;
+f1 f2 f3
+1 2 NULL
+DROP TABLE t1;
+create table t1 (c char(10) default "Two");
+lock table t1 write;
+insert into t1 values ();
+alter table t1 modify c char(10) default "Three";
+unlock tables;
+select * from t1;
+c
+Two
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+drop table t1;
diff --git a/mysql-test/r/analyse.result b/mysql-test/r/analyse.result
index b1ed1ea2bed..c0b16778f9c 100644
--- a/mysql-test/r/analyse.result
+++ b/mysql-test/r/analyse.result
@@ -39,10 +39,10 @@ t2 CREATE TABLE `t2` (
`Field_name` varbinary(255) NOT NULL DEFAULT '',
`Min_value` varbinary(255) DEFAULT NULL,
`Max_value` varbinary(255) DEFAULT NULL,
- `Min_length` int(11) NOT NULL DEFAULT '0',
- `Max_length` int(11) NOT NULL DEFAULT '0',
- `Empties_or_zeros` int(11) NOT NULL DEFAULT '0',
- `Nulls` int(11) NOT NULL DEFAULT '0',
+ `Min_length` bigint(11) NOT NULL DEFAULT '0',
+ `Max_length` bigint(11) NOT NULL DEFAULT '0',
+ `Empties_or_zeros` bigint(11) NOT NULL DEFAULT '0',
+ `Nulls` bigint(11) NOT NULL DEFAULT '0',
`Avg_value_or_avg_length` varbinary(255) NOT NULL DEFAULT '',
`Std` varbinary(255) DEFAULT NULL,
`Optimal_fieldtype` varbinary(64) NOT NULL DEFAULT ''
@@ -58,10 +58,10 @@ t2 CREATE TABLE `t2` (
`Field_name` varbinary(255) NOT NULL DEFAULT '',
`Min_value` varbinary(255) DEFAULT NULL,
`Max_value` varbinary(255) DEFAULT NULL,
- `Min_length` int(11) NOT NULL DEFAULT '0',
- `Max_length` int(11) NOT NULL DEFAULT '0',
- `Empties_or_zeros` int(11) NOT NULL DEFAULT '0',
- `Nulls` int(11) NOT NULL DEFAULT '0',
+ `Min_length` bigint(11) NOT NULL DEFAULT '0',
+ `Max_length` bigint(11) NOT NULL DEFAULT '0',
+ `Empties_or_zeros` bigint(11) NOT NULL DEFAULT '0',
+ `Nulls` bigint(11) NOT NULL DEFAULT '0',
`Avg_value_or_avg_length` varbinary(255) NOT NULL DEFAULT '',
`Std` varbinary(255) DEFAULT NULL,
`Optimal_fieldtype` varbinary(64) NOT NULL DEFAULT ''
@@ -81,10 +81,10 @@ t2 CREATE TABLE `t2` (
`Field_name` varbinary(255) NOT NULL DEFAULT '',
`Min_value` varbinary(255) DEFAULT NULL,
`Max_value` varbinary(255) DEFAULT NULL,
- `Min_length` int(11) NOT NULL DEFAULT '0',
- `Max_length` int(11) NOT NULL DEFAULT '0',
- `Empties_or_zeros` int(11) NOT NULL DEFAULT '0',
- `Nulls` int(11) NOT NULL DEFAULT '0',
+ `Min_length` bigint(11) NOT NULL DEFAULT '0',
+ `Max_length` bigint(11) NOT NULL DEFAULT '0',
+ `Empties_or_zeros` bigint(11) NOT NULL DEFAULT '0',
+ `Nulls` bigint(11) NOT NULL DEFAULT '0',
`Avg_value_or_avg_length` varbinary(255) NOT NULL DEFAULT '',
`Std` varbinary(255) DEFAULT NULL,
`Optimal_fieldtype` varbinary(64) NOT NULL DEFAULT ''
diff --git a/mysql-test/r/archive-big.result b/mysql-test/r/archive-big.result
new file mode 100644
index 00000000000..7dbdb490017
--- /dev/null
+++ b/mysql-test/r/archive-big.result
@@ -0,0 +1,19 @@
+CREATE TABLE t1(a BLOB) ENGINE=ARCHIVE;
+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;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result
index 59462e848d2..36b013703d8 100644
--- a/mysql-test/r/archive.result
+++ b/mysql-test/r/archive.result
@@ -12675,3 +12675,10 @@ select * from t1;
i
1
drop table t1;
+create table t1(a longblob) engine=archive;
+insert into t1 set a='';
+insert into t1 set a='a';
+check table t1 extended;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+drop table t1;
diff --git a/mysql-test/r/archive_gis.result b/mysql-test/r/archive_gis.result
index 71eeb063d59..901f8a9acc2 100644
--- a/mysql-test/r/archive_gis.result
+++ b/mysql-test/r/archive_gis.result
@@ -402,8 +402,8 @@ Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE g1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort; Using join cache
-1 SIMPLE g2 ALL NULL NULL NULL NULL 2 100.00
+1 SIMPLE g1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort
+1 SIMPLE g2 ALL NULL NULL NULL NULL 2 100.00 Using join buffer
Warnings:
Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,overlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,equals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,disjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,intersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid`
DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
diff --git a/mysql-test/r/backup.result b/mysql-test/r/backup.result
index be1a3efc5c6..4de599f3af7 100644
--- a/mysql-test/r/backup.result
+++ b/mysql-test/r/backup.result
@@ -4,28 +4,24 @@ create table t4(n int);
backup table t4 to '../bogus';
Table Op Msg_type Msg_text
test.t4 backup error Failed copying .frm file (errno: X)
+test.t4 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
+test.t4 backup Error Can't create/write to file 'MYSQLTEST_VARDIR/bogus/t4.frm' (Errcode: X)
test.t4 backup status Operation failed
-Warnings:
-Warning 1543 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
-Error 1 Can't create/write to file 'MYSQLTEST_VARDIR/bogus/t4.frm' (Errcode: X)
backup table t4 to '../tmp';
Table Op Msg_type Msg_text
+test.t4 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
test.t4 backup status OK
-Warnings:
-Warning 1543 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
backup table t4 to '../tmp';
Table Op Msg_type Msg_text
test.t4 backup error Failed copying .frm file (errno: X)
+test.t4 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
+test.t4 backup Error Can't create/write to file 'MYSQLTEST_VARDIR/tmp/t4.frm' (Errcode: X)
test.t4 backup status Operation failed
-Warnings:
-Warning 1543 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
-Error 1 Can't create/write to file 'MYSQLTEST_VARDIR/tmp/t4.frm' (Errcode: X)
drop table t4;
restore table t4 from '../tmp';
Table Op Msg_type Msg_text
+test.t4 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
test.t4 restore status OK
-Warnings:
-Warning 1543 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
select count(*) from t4;
count(*)
0
@@ -33,21 +29,19 @@ create table t1(n int);
insert into t1 values (23),(45),(67);
backup table t1 to '../tmp';
Table Op Msg_type Msg_text
+test.t1 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
test.t1 backup status OK
-Warnings:
-Warning 1543 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
drop table t1;
restore table t1 from '../bogus';
Table Op Msg_type Msg_text
t1 restore error Failed copying .frm file
Warnings:
-Warning 1543 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
+Warning 1287 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
Error 29 File 'MYSQLTEST_VARDIR/bogus/t1.frm' not found (Errcode: X)
restore table t1 from '../tmp';
Table Op Msg_type Msg_text
+test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
test.t1 restore status OK
-Warnings:
-Warning 1543 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
select n from t1;
n
23
@@ -59,18 +53,16 @@ insert into t2 values (123),(145),(167);
insert into t3 values (223),(245),(267);
backup table t2,t3 to '../tmp';
Table Op Msg_type Msg_text
+test.t2 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
test.t2 backup status OK
test.t3 backup status OK
-Warnings:
-Warning 1543 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
drop table t1,t2,t3;
restore table t1,t2,t3 from '../tmp';
Table Op Msg_type Msg_text
+test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
test.t1 restore status OK
test.t2 restore status OK
test.t3 restore status OK
-Warnings:
-Warning 1543 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
select n from t1;
n
23
@@ -89,32 +81,28 @@ k
drop table t1,t2,t3,t4;
restore table t1 from '../tmp';
Table Op Msg_type Msg_text
+test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
test.t1 restore status OK
-Warnings:
-Warning 1543 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
rename table t1 to t5;
lock tables t5 write;
backup table t5 to '../tmp';
unlock tables;
Table Op Msg_type Msg_text
+test.t5 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
test.t5 backup status OK
-Warnings:
-Warning 1543 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
drop table t5;
DROP TABLE IF EXISTS `t+1`;
CREATE TABLE `t+1` (c1 INT);
INSERT INTO `t+1` VALUES (1), (2), (3);
BACKUP TABLE `t+1` TO '../tmp';
Table Op Msg_type Msg_text
+test.t+1 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
test.t+1 backup status OK
-Warnings:
-Warning 1543 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
DROP TABLE `t+1`;
RESTORE TABLE `t+1` FROM '../tmp';
Table Op Msg_type Msg_text
+test.t+1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
test.t+1 restore status OK
-Warnings:
-Warning 1543 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
SELECT * FROM `t+1`;
c1
1
diff --git a/mysql-test/r/bigint.result b/mysql-test/r/bigint.result
index d8f78cd5103..0d6cf8e7d30 100644
--- a/mysql-test/r/bigint.result
+++ b/mysql-test/r/bigint.result
@@ -352,3 +352,49 @@ select c1 mod 50 as result from t1;
result
6
drop table t1;
+select cast(19999999999999999999 as signed);
+cast(19999999999999999999 as signed)
+9223372036854775807
+Warnings:
+Error 1292 Truncated incorrect DECIMAL value: ''
+select cast(-19999999999999999999 as signed);
+cast(-19999999999999999999 as signed)
+-9223372036854775808
+Warnings:
+Error 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
+-9223372036854775808
+-9223372036854775808
+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
+-(9223372036854775808)
+-9223372036854775808
+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
+-((9223372036854775808))
+-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
+-(-(9223372036854775808))
+9223372036854775808
+select --9223372036854775808, ---9223372036854775808, ----9223372036854775808;
+--9223372036854775808 ---9223372036854775808 ----9223372036854775808
+9223372036854775808 -9223372036854775808 9223372036854775808
+select -(-9223372036854775808), -(-(-9223372036854775808));
+-(-9223372036854775808) -(-(-9223372036854775808))
+9223372036854775808 -9223372036854775808
+create table t1 select -9223372036854775808 bi;
+describe t1;
+Field Type Null Key Default Extra
+bi bigint(20) NO 0
+drop table t1;
+create table t1 select -9223372036854775809 bi;
+describe t1;
+Field Type Null Key Default Extra
+bi decimal(19,0) NO 0
+drop table t1;
diff --git a/mysql-test/r/binary.result b/mysql-test/r/binary.result
index ccafa43c7ab..be87c25e932 100644
--- a/mysql-test/r/binary.result
+++ b/mysql-test/r/binary.result
@@ -160,3 +160,41 @@ hex(col1)
62000000000000000000
62200000000000000000
drop table t1;
+CREATE TABLE t1 (
+a binary(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
+index idx(a)
+);
+INSERT INTO t1 SET a=unhex('1F9480179366F2BF567E1C4B964C1EF029087575');
+INSERT INTO t1 SET a=unhex('1F9480179366F2BF567E1C4B964C1EF029082020');
+INSERT INTO t1 SET a=unhex('1F9480179366F2BF567E1C4B964C1EF029080707');
+SELECT hex(a) FROM t1 order by a;
+hex(a)
+1F9480179366F2BF567E1C4B964C1EF029080707
+1F9480179366F2BF567E1C4B964C1EF029082020
+1F9480179366F2BF567E1C4B964C1EF029087575
+EXPLAIN SELECT hex(a) FROM t1 order by a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL idx 20 NULL 3 Using index
+SELECT hex(a) from t1 WHERE a=unhex('1F9480179366F2BF567E1C4B964C1EF029082020');
+hex(a)
+1F9480179366F2BF567E1C4B964C1EF029082020
+EXPLAIN
+SELECT hex(a) from t1 WHERE a=unhex('1F9480179366F2BF567E1C4B964C1EF029082020');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref idx idx 20 const 1 Using where; Using index
+SELECT hex(a) from t1 WHERE a=unhex('1F9480179366F2BF567E1C4B964C1EF02908');
+hex(a)
+DROP TABLE t1;
+CREATE TABLE t1 (
+id numeric(20) NOT NULL,
+lang varchar(8) NOT NULL,
+msg varchar(32) NOT NULL,
+PRIMARY KEY (id,lang)
+);
+INSERT INTO t1 VALUES (33, 'en', 'zzzzzzz');
+INSERT INTO t1 VALUES (31, 'en', 'xxxxxxx');
+INSERT INTO t1 VALUES (32, 'en', 'yyyyyyy');
+SELECT * FROM t1 WHERE id=32;
+id lang msg
+32 en yyyyyyy
+DROP TABLE t1;
diff --git a/mysql-test/r/binlog_row_binlog.result b/mysql-test/r/binlog_row_binlog.result
deleted file mode 100644
index 6fcaad010d2..00000000000
--- a/mysql-test/r/binlog_row_binlog.result
+++ /dev/null
@@ -1,339 +0,0 @@
-drop table if exists t1, t2;
-reset master;
-create table t1 (a int) engine=innodb;
-create table t2 (a int) engine=innodb;
-begin;
-insert t1 values (5);
-commit;
-begin;
-insert t2 values (5);
-commit;
-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) engine=innodb
-master-bin.000001 # Query # # use `test`; create table t2 (a int) engine=innodb
-master-bin.000001 # Query # # use `test`; 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 # # use `test`; BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Xid # # COMMIT /* XID */
-drop table t1,t2;
-reset master;
-create table t1 (n int) engine=innodb;
-begin;
-commit;
-drop table t1;
-show binlog events in 'master-bin.000001' from 106;
-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 # use `test`; 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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-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 # 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;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000002 # Query 1 # use `test`; drop table t1
-reset master;
-create table t1 (id tinyint auto_increment primary key);
-set insert_id=128;
-insert into t1 values(null);
-Warnings:
-Warning 1264 Out of range value for column 'id' at row 1
-select * from t1;
-id
-127
-drop table t1;
-create table t1 (a int);
-create table if not exists t2 select * from t1;
-create temporary table tt1 (a int);
-create table if not exists t3 like tt1;
-USE mysql;
-INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test');
-UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@';
-DELETE FROM user WHERE host='localhost' AND user='@#@';
-use test;
-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 (id tinyint auto_increment primary key)
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `test`; drop table t1
-master-bin.000001 # Query # # use `test`; create table t1 (a int)
-master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t2` (
- `a` int(11) DEFAULT NULL
-)
-master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t3` (
- `a` int(11) DEFAULT NULL
-)
-master-bin.000001 # Table_map # # table_id: # (mysql.user)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysql.user)
-master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysql.user)
-master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
-drop table t1,t2,t3,tt1;
-create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
-set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
-insert delayed into t1 values (207);
-insert delayed into t1 values (null);
-insert delayed into t1 values (300);
-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 (id tinyint auto_increment primary key)
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `test`; drop table t1
-master-bin.000001 # Query # # use `test`; create table t1 (a int)
-master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t2` (
- `a` int(11) DEFAULT NULL
-)
-master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t3` (
- `a` int(11) DEFAULT NULL
-)
-master-bin.000001 # Table_map # # table_id: # (mysql.user)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysql.user)
-master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysql.user)
-master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2`,`t3` /* generated by server */
-master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam
-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 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-insert delayed into t1 values (null),(null),(null),(null);
-insert delayed into t1 values (null),(null),(400),(null);
-11 == 11
-select * from t1;
-a
-207
-208
-300
-301
-302
-303
-304
-305
-306
-400
-401
-drop table t1;
-reset master;
-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
-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
-drop table t3;
diff --git a/mysql-test/r/binlog_row_blackhole.result b/mysql-test/r/binlog_row_blackhole.result
deleted file mode 100644
index 8e90ac4f30b..00000000000
--- a/mysql-test/r/binlog_row_blackhole.result
+++ /dev/null
@@ -1,152 +0,0 @@
-drop table if exists t1,t2;
-CREATE TABLE t1 (
-Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
-Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
-) ENGINE=blackhole;
-INSERT INTO t1 VALUES (9410,9412);
-select period from t1;
-period
-select * from t1;
-Period Varor_period
-select t1.* from t1;
-Period Varor_period
-CREATE TABLE t2 (
-auto int NOT NULL auto_increment,
-fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL,
-companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL,
-fld3 char(30) DEFAULT '' NOT NULL,
-fld4 char(35) DEFAULT '' NOT NULL,
-fld5 char(35) DEFAULT '' NOT NULL,
-fld6 char(4) DEFAULT '' NOT NULL,
-primary key (auto)
-) ENGINE=blackhole;
-INSERT INTO t2 VALUES (1192,068305,00,'Colombo','hardware','colicky','');
-INSERT INTO t2 VALUES (1193,000000,00,'nondecreasing','implant','thrillingly','');
-select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%";
-fld3
-select fld3 from t2 where fld3 like "%cultivation" ;
-fld3
-select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3;
-fld3 companynr
-select fld3,companynr from t2 where companynr = 58 order by fld3;
-fld3 companynr
-select fld3 from t2 order by fld3 desc limit 10;
-fld3
-select fld3 from t2 order by fld3 desc limit 5;
-fld3
-select fld3 from t2 order by fld3 desc limit 5,5;
-fld3
-select t2.fld3 from t2 where fld3 = 'honeysuckle';
-fld3
-select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_';
-fld3
-select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_';
-fld3
-select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%';
-fld3
-select t2.fld3 from t2 where fld3 LIKE 'h%le';
-fld3
-select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_';
-fld3
-select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%';
-fld3
-select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
-fld3
-select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3;
-fld1 fld3
-DROP TABLE t1;
-CREATE TABLE t1 (a VARCHAR(200), b TEXT, FULLTEXT (a,b));
-INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'),
-('Full-text indexes', 'are called collections'),
-('Only MyISAM tables','support collections'),
-('Function MATCH ... AGAINST()','is used to do a search'),
-('Full-text search in MySQL', 'implements vector space model');
-SHOW INDEX FROM t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 1 a 1 a NULL NULL NULL NULL YES FULLTEXT
-t1 1 a 2 b NULL NULL NULL NULL YES FULLTEXT
-select * from t1 where MATCH(a,b) AGAINST ("collections");
-a b
-Only MyISAM tables support collections
-Full-text indexes are called collections
-explain extended select * from t1 where MATCH(a,b) AGAINST ("collections");
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 fulltext a a 0 1 100.00 Using where
-Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (match `test`.`t1`.`a`,`test`.`t1`.`b` against (_latin1'collections'))
-select * from t1 where MATCH(a,b) AGAINST ("indexes");
-a b
-Full-text indexes are called collections
-select * from t1 where MATCH(a,b) AGAINST ("indexes collections");
-a b
-Full-text indexes are called collections
-Only MyISAM tables support collections
-select * from t1 where MATCH(a,b) AGAINST ("only");
-a b
-reset master;
-drop table t1,t2;
-create table t1 (a int) engine=blackhole;
-delete from t1 where a=10;
-update t1 set a=11 where a=15;
-insert into t1 values(1);
-insert ignore into t1 values(1);
-replace into t1 values(100);
-create table t2 (a varchar(200)) engine=blackhole;
-load data infile '../std_data_ln/words.dat' into table t2;
-alter table t1 add b int;
-alter table t1 drop b;
-create table t3 like t1;
-insert into t1 select * from t3;
-replace into t1 select * from t3;
-select * from t1;
-a
-select * from t2;
-a
-select * from t3;
-a
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; drop table t1,t2
-master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=blackhole
-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 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `test`; create table t2 (a varchar(200)) engine=blackhole
-master-bin.000001 # Table_map # # table_id: # (test.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `test`; alter table t1 add b int
-master-bin.000001 # Query # # use `test`; alter table t1 drop b
-master-bin.000001 # Query # # use `test`; create table t3 like t1
-drop table t1,t2,t3;
-CREATE TABLE t1(a INT, b INT) ENGINE=BLACKHOLE;
-DELETE FROM t1 WHERE a=10;
-ALTER TABLE t1 ADD INDEX(a);
-DELETE FROM t1 WHERE a=10;
-ALTER TABLE t1 DROP INDEX a;
-ALTER TABLE t1 ADD UNIQUE INDEX(a);
-DELETE FROM t1 WHERE a=10;
-ALTER TABLE t1 DROP INDEX a;
-ALTER TABLE t1 ADD PRIMARY KEY(a);
-DELETE FROM t1 WHERE a=10;
-DROP TABLE t1;
-reset master;
-create table t1 (a int) engine=blackhole;
-set autocommit=0;
-start transaction;
-insert into t1 values(1);
-commit;
-start transaction;
-insert into t1 values(2);
-rollback;
-set autocommit=1;
-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) engine=blackhole
-master-bin.000001 # Query # # use `test`; 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 # # use `test`; COMMIT
-drop table if exists t1;
diff --git a/mysql-test/r/binlog_row_ctype_cp932.result b/mysql-test/r/binlog_row_ctype_cp932.result
deleted file mode 100644
index ca70f98c0e6..00000000000
--- a/mysql-test/r/binlog_row_ctype_cp932.result
+++ /dev/null
@@ -1,11377 +0,0 @@
-drop table if exists t1;
-drop table if exists t2;
-drop table if exists t3;
-drop table if exists t4;
-set names cp932;
-set character_set_database = cp932;
-CREATE TABLE t1(c1 CHAR(1)) DEFAULT CHARACTER SET = cp932;
-INSERT INTO t1 VALUES
-(0x05),(0x7E),(0x815C),(0x815F),(0x8160),(0x8161),(0x817C),(0x8191),(0x8192),(0x81CA);
-INSERT INTO t1 VALUES
-(0x8740),(0x8741),(0x8742),(0x8743),(0x8744),(0x8745),(0x8746),(0x8747),
-(0x8748),(0x8749),(0x874A),(0x874B),(0x874C),(0x874D),(0x874E),(0x874F),
-(0x8750),(0x8751),(0x8752),(0x8753),(0x8754),(0x8755),(0x8756),(0x8757),
-(0x8758),(0x8759),(0x875A),(0x875B),(0x875C),(0x875D),(0x875F),
-(0x8760),(0x8761),(0x8762),(0x8763),(0x8764),(0x8765),(0x8766),(0x8767),
-(0x8768),(0x8769),(0x876A),(0x876B),(0x876C),(0x876D),(0x876E),(0x876F),
-(0x8770),(0x8771),(0x8772),(0x8773),(0x8774),(0x8775),(0x877E),
-(0x8780),(0x8781),(0x8782),(0x8783),(0x8784),(0x8785),(0x8786),(0x8787),
-(0x8788),(0x8789),(0x878A),(0x878B),(0x878C),(0x878D),(0x878E),(0x878F),
-(0x8790),(0x8791),(0x8792),(0x8793),(0x8794),(0x8795),(0x8796),(0x8797),
-(0x8798),(0x8799),(0x879A),(0x879B),(0x879C);
-INSERT INTO t1 VALUES
-(0xED40),(0xED41),(0xED42),(0xED43),(0xED44),(0xED45),(0xED46),(0xED47),
-(0xED48),(0xED49),(0xED4A),(0xED4B),(0xED4C),(0xED4D),(0xED4E),(0xED4F),
-(0xED50),(0xED51),(0xED52),(0xED53),(0xED54),(0xED55),(0xED56),(0xED57),
-(0xED58),(0xED59),(0xED5A),(0xED5B),(0xED5C),(0xED5D),(0xED5E),(0xED5F),
-(0xED60),(0xED61),(0xED62),(0xED63),(0xED64),(0xED65),(0xED66),(0xED67),
-(0xED68),(0xED69),(0xED6A),(0xED6B),(0xED6C),(0xED6D),(0xED6E),(0xED6F),
-(0xED70),(0xED71),(0xED72),(0xED73),(0xED74),(0xED75),(0xED76),(0xED77),
-(0xED78),(0xED79),(0xED7A),(0xED7B),(0xED7C),(0xED7D),(0xED7E),
-(0xED80),(0xED81),(0xED82),(0xED83),(0xED84),(0xED85),(0xED86),(0xED87),
-(0xED88),(0xED89),(0xED8A),(0xED8B),(0xED8C),(0xED8D),(0xED8E),(0xED8F),
-(0xED90),(0xED91),(0xED92),(0xED93),(0xED94),(0xED95),(0xED96),(0xED97),
-(0xED98),(0xED99),(0xED9A),(0xED9B),(0xED9C),(0xED9D),(0xED9E),(0xED9F),
-(0xEDA0),(0xEDA1),(0xEDA2),(0xEDA3),(0xEDA4),(0xEDA5),(0xEDA6),(0xEDA7),
-(0xEDA8),(0xEDA9),(0xEDAA),(0xEDAB),(0xEDAC),(0xEDAD),(0xEDAE),(0xEDAF),
-(0xEDB0),(0xEDB1),(0xEDB2),(0xEDB3),(0xEDB4),(0xEDB5),(0xEDB6),(0xEDB7),
-(0xEDB8),(0xEDB9),(0xEDBA),(0xEDBB),(0xEDBC),(0xEDBD),(0xEDBE),(0xEDBF),
-(0xEDC0),(0xEDC1),(0xEDC2),(0xEDC3),(0xEDC4),(0xEDC5),(0xEDC6),(0xEDC7),
-(0xEDC8),(0xEDC9),(0xEDCA),(0xEDCB),(0xEDCC),(0xEDCD),(0xEDCE),(0xEDCF),
-(0xEDD0),(0xEDD1),(0xEDD2),(0xEDD3),(0xEDD4),(0xEDD5),(0xEDD6),(0xEDD7),
-(0xEDD8),(0xEDD9),(0xEDDA),(0xEDDB),(0xEDDC),(0xEDDD),(0xEDDE),(0xEDDF),
-(0xEDE0),(0xEDE1),(0xEDE2),(0xEDE3),(0xEDE4),(0xEDE5),(0xEDE6),(0xEDE7),
-(0xEDE8),(0xEDE9),(0xEDEA),(0xEDEB),(0xEDEC),(0xEDED),(0xEDEE),(0xEDEF),
-(0xEDF0),(0xEDF1),(0xEDF2),(0xEDF3),(0xEDF4),(0xEDF5),(0xEDF6),(0xEDF7),
-(0xEDF8),(0xEDF9),(0xEDFA),(0xEDFB),(0xEDFC),
-(0xEE40),(0xEE41),(0xEE42),(0xEE43),(0xEE44),(0xEE45),(0xEE46),(0xEE47),
-(0xEE48),(0xEE49),(0xEE4A),(0xEE4B),(0xEE4C),(0xEE4D),(0xEE4E),(0xEE4F),
-(0xEE50),(0xEE51),(0xEE52),(0xEE53),(0xEE54),(0xEE55),(0xEE56),(0xEE57),
-(0xEE58),(0xEE59),(0xEE5A),(0xEE5B),(0xEE5C),(0xEE5D),(0xEE5E),(0xEE5F),
-(0xEE60),(0xEE61),(0xEE62),(0xEE63),(0xEE64),(0xEE65),(0xEE66),(0xEE67),
-(0xEE68),(0xEE69),(0xEE6A),(0xEE6B),(0xEE6C),(0xEE6D),(0xEE6E),(0xEE6F),
-(0xEE70),(0xEE71),(0xEE72),(0xEE73),(0xEE74),(0xEE75),(0xEE76),(0xEE77),
-(0xEE78),(0xEE79),(0xEE7A),(0xEE7B),(0xEE7C),(0xEE7D),(0xEE7E),
-(0xEE80),(0xEE81),(0xEE82),(0xEE83),(0xEE84),(0xEE85),(0xEE86),(0xEE87),
-(0xEE88),(0xEE89),(0xEE8A),(0xEE8B),(0xEE8C),(0xEE8D),(0xEE8E),(0xEE8F),
-(0xEE90),(0xEE91),(0xEE92),(0xEE93),(0xEE94),(0xEE95),(0xEE96),(0xEE97),
-(0xEE98),(0xEE99),(0xEE9A),(0xEE9B),(0xEE9C),(0xEE9D),(0xEE9E),(0xEE9F),
-(0xEEA0),(0xEEA1),(0xEEA2),(0xEEA3),(0xEEA4),(0xEEA5),(0xEEA6),(0xEEA7),
-(0xEEA8),(0xEEA9),(0xEEAA),(0xEEAB),(0xEEAC),(0xEEAD),(0xEEAE),(0xEEAF),
-(0xEEB0),(0xEEB1),(0xEEB2),(0xEEB3),(0xEEB4),(0xEEB5),(0xEEB6),(0xEEB7),
-(0xEEB8),(0xEEB9),(0xEEBA),(0xEEBB),(0xEEBC),(0xEEBD),(0xEEBE),(0xEEBF),
-(0xEEC0),(0xEEC1),(0xEEC2),(0xEEC3),(0xEEC4),(0xEEC5),(0xEEC6),(0xEEC7),
-(0xEEC8),(0xEEC9),(0xEECA),(0xEECB),(0xEECC),(0xEECD),(0xEECE),(0xEECF),
-(0xEED0),(0xEED1),(0xEED2),(0xEED3),(0xEED4),(0xEED5),(0xEED6),(0xEED7),
-(0xEED8),(0xEED9),(0xEEDA),(0xEEDB),(0xEEDC),(0xEEDD),(0xEEDE),(0xEEDF),
-(0xEEE0),(0xEEE1),(0xEEE2),(0xEEE3),(0xEEE4),(0xEEE5),(0xEEE6),(0xEEE7),
-(0xEEE8),(0xEEE9),(0xEEEA),(0xEEEB),(0xEEEC),(0xEEEF),
-(0xEEF0),(0xEEF1),(0xEEF2),(0xEEF3),(0xEEF4),(0xEEF5),(0xEEF6),(0xEEF7),
-(0xEEF8),(0xEEF9),(0xEEFA),(0xEEFB),(0xEEFC);
-INSERT INTO t1 VALUES
-(0xFA40),(0xFA41),(0xFA42),(0xFA43),(0xFA44),(0xFA45),(0xFA46),(0xFA47),
-(0xFA48),(0xFA49),(0xFA4A),(0xFA4B),(0xFA4C),(0xFA4D),(0xFA4E),(0xFA4F),
-(0xFA50),(0xFA51),(0xFA52),(0xFA53),(0xFA54),(0xFA55),(0xFA56),(0xFA57),
-(0xFA58),(0xFA59),(0xFA5A),(0xFA5B),(0xFA5C),(0xFA5D),(0xFA5E),(0xFA5F),
-(0xFA60),(0xFA61),(0xFA62),(0xFA63),(0xFA64),(0xFA65),(0xFA66),(0xFA67),
-(0xFA68),(0xFA69),(0xFA6A),(0xFA6B),(0xFA6C),(0xFA6D),(0xFA6E),(0xFA6F),
-(0xFA70),(0xFA71),(0xFA72),(0xFA73),(0xFA74),(0xFA75),(0xFA76),(0xFA77),
-(0xFA78),(0xFA79),(0xFA7A),(0xFA7B),(0xFA7C),(0xFA7D),(0xFA7E),
-(0xFA80),(0xFA81),(0xFA82),(0xFA83),(0xFA84),(0xFA85),(0xFA86),(0xFA87),
-(0xFA88),(0xFA89),(0xFA8A),(0xFA8B),(0xFA8C),(0xFA8D),(0xFA8E),(0xFA8F),
-(0xFA90),(0xFA91),(0xFA92),(0xFA93),(0xFA94),(0xFA95),(0xFA96),(0xFA97),
-(0xFA98),(0xFA99),(0xFA9A),(0xFA9B),(0xFA9C),(0xFA9D),(0xFA9E),(0xFA9F),
-(0xFAA0),(0xFAA1),(0xFAA2),(0xFAA3),(0xFAA4),(0xFAA5),(0xFAA6),(0xFAA7),
-(0xFAA8),(0xFAA9),(0xFAAA),(0xFAAB),(0xFAAC),(0xFAAD),(0xFAAE),(0xFAAF),
-(0xFAB0),(0xFAB1),(0xFAB2),(0xFAB3),(0xFAB4),(0xFAB5),(0xFAB6),(0xFAB7),
-(0xFAB8),(0xFAB9),(0xFABA),(0xFABB),(0xFABC),(0xFABD),(0xFABE),(0xFABF),
-(0xFAC0),(0xFAC1),(0xFAC2),(0xFAC3),(0xFAC4),(0xFAC5),(0xFAC6),(0xFAC7),
-(0xFAC8),(0xFAC9),(0xFACA),(0xFACB),(0xFACC),(0xFACD),(0xFACE),(0xFACF),
-(0xFAD0),(0xFAD1),(0xFAD2),(0xFAD3),(0xFAD4),(0xFAD5),(0xFAD6),(0xFAD7),
-(0xFAD8),(0xFAD9),(0xFADA),(0xFADB),(0xFADC),(0xFADD),(0xFADE),(0xFADF),
-(0xFAE0),(0xFAE1),(0xFAE2),(0xFAE3),(0xFAE4),(0xFAE5),(0xFAE6),(0xFAE7),
-(0xFAE8),(0xFAE9),(0xFAEA),(0xFAEB),(0xFAEC),(0xFAED),(0xFAEE),(0xFAEF),
-(0xFAF0),(0xFAF1),(0xFAF2),(0xFAF3),(0xFAF4),(0xFAF5),(0xFAF6),(0xFAF7),
-(0xFAF8),(0xFAF9),(0xFAFA),(0xFAFB),(0xFAFC),
-(0xFB40),(0xFB41),(0xFB42),(0xFB43),(0xFB44),(0xFB45),(0xFB46),(0xFB47),
-(0xFB48),(0xFB49),(0xFB4A),(0xFB4B),(0xFB4C),(0xFB4D),(0xFB4E),(0xFB4F),
-(0xFB50),(0xFB51),(0xFB52),(0xFB53),(0xFB54),(0xFB55),(0xFB56),(0xFB57),
-(0xFB58),(0xFB59),(0xFB5A),(0xFB5B),(0xFB5C),(0xFB5D),(0xFB5E),(0xFB5F),
-(0xFB60),(0xFB61),(0xFB62),(0xFB63),(0xFB64),(0xFB65),(0xFB66),(0xFB67),
-(0xFB68),(0xFB69),(0xFB6A),(0xFB6B),(0xFB6C),(0xFB6D),(0xFB6E),(0xFB6F),
-(0xFB70),(0xFB71),(0xFB72),(0xFB73),(0xFB74),(0xFB75),(0xFB76),(0xFB77),
-(0xFB78),(0xFB79),(0xFB7A),(0xFB7B),(0xFB7C),(0xFB7D),(0xFB7E),
-(0xFB80),(0xFB81),(0xFB82),(0xFB83),(0xFB84),(0xFB85),(0xFB86),(0xFB87),
-(0xFB88),(0xFB89),(0xFB8A),(0xFB8B),(0xFB8C),(0xFB8D),(0xFB8E),(0xFB8F),
-(0xFB90),(0xFB91),(0xFB92),(0xFB93),(0xFB94),(0xFB95),(0xFB96),(0xFB97),
-(0xFB98),(0xFB99),(0xFB9A),(0xFB9B),(0xFB9C),(0xFB9D),(0xFB9E),(0xFB9F),
-(0xFBA0),(0xFBA1),(0xFBA2),(0xFBA3),(0xFBA4),(0xFBA5),(0xFBA6),(0xFBA7),
-(0xFBA8),(0xFBA9),(0xFBAA),(0xFBAB),(0xFBAC),(0xFBAD),(0xFBAE),(0xFBAF),
-(0xFBB0),(0xFBB1),(0xFBB2),(0xFBB3),(0xFBB4),(0xFBB5),(0xFBB6),(0xFBB7),
-(0xFBB8),(0xFBB9),(0xFBBA),(0xFBBB),(0xFBBC),(0xFBBD),(0xFBBE),(0xFBBF),
-(0xFBC0),(0xFBC1),(0xFBC2),(0xFBC3),(0xFBC4),(0xFBC5),(0xFBC6),(0xFBC7),
-(0xFBC8),(0xFBC9),(0xFBCA),(0xFBCB),(0xFBCC),(0xFBCD),(0xFBCE),(0xFBCF),
-(0xFBD0),(0xFBD1),(0xFBD2),(0xFBD3),(0xFBD4),(0xFBD5),(0xFBD6),(0xFBD7),
-(0xFBD8),(0xFBD9),(0xFBDA),(0xFBDB),(0xFBDC),(0xFBDD),(0xFBDE),(0xFBDF),
-(0xFBE0),(0xFBE1),(0xFBE2),(0xFBE3),(0xFBE4),(0xFBE5),(0xFBE6),(0xFBE7),
-(0xFBE8),(0xFBE9),(0xFBEA),(0xFBEB),(0xFBEC),(0xFBED),(0xFBEE),(0xFBEF),
-(0xFBF0),(0xFBF1),(0xFBF2),(0xFBF3),(0xFBF4),(0xFBF5),(0xFBF6),(0xFBF7),
-(0xFBF8),(0xFBF9),(0xFBFA),(0xFBFB),(0xFBFC),
-(0xFC40),(0xFC41),(0xFC42),(0xFC43),(0xFC44),(0xFC45),(0xFC46),(0xFC47),
-(0xFC48),(0xFC49),(0xFC4A),(0xFC4B);
-INSERT INTO t1 VALUES
-(0xF040),(0xF041),(0xF042),(0xF043),(0xF044),(0xF045),(0xF046),(0xF047),
-(0xF048),(0xF049),(0xF04A),(0xF04B),(0xF04C),(0xF04D),(0xF04E),(0xF04F),
-(0xF050),(0xF051),(0xF052),(0xF053),(0xF054),(0xF055),(0xF056),(0xF057),
-(0xF058),(0xF059),(0xF05A),(0xF05B),(0xF05C),(0xF05D),(0xF05E),(0xF05F),
-(0xF060),(0xF061),(0xF062),(0xF063),(0xF064),(0xF065),(0xF066),(0xF067),
-(0xF068),(0xF069),(0xF06A),(0xF06B),(0xF06C),(0xF06D),(0xF06E),(0xF06F),
-(0xF070),(0xF071),(0xF072),(0xF073),(0xF074),(0xF075),(0xF076),(0xF077),
-(0xF078),(0xF079),(0xF07A),(0xF07B),(0xF07C),(0xF07D),(0xF07E),
-(0xF080),(0xF081),(0xF082),(0xF083),(0xF084),(0xF085),(0xF086),(0xF087),
-(0xF088),(0xF089),(0xF08A),(0xF08B),(0xF08C),(0xF08D),(0xF08E),(0xF08F),
-(0xF090),(0xF091),(0xF092),(0xF093),(0xF094),(0xF095),(0xF096),(0xF097),
-(0xF098),(0xF099),(0xF09A),(0xF09B),(0xF09C),(0xF09D),(0xF09E),(0xF09F),
-(0xF0A0),(0xF0A1),(0xF0A2),(0xF0A3),(0xF0A4),(0xF0A5),(0xF0A6),(0xF0A7),
-(0xF0A8),(0xF0A9),(0xF0AA),(0xF0AB),(0xF0AC),(0xF0AD),(0xF0AE),(0xF0AF),
-(0xF0B0),(0xF0B1),(0xF0B2),(0xF0B3),(0xF0B4),(0xF0B5),(0xF0B6),(0xF0B7),
-(0xF0B8),(0xF0B9),(0xF0BA),(0xF0BB),(0xF0BC),(0xF0BD),(0xF0BE),(0xF0BF),
-(0xF0C0),(0xF0C1),(0xF0C2),(0xF0C3),(0xF0C4),(0xF0C5),(0xF0C6),(0xF0C7),
-(0xF0C8),(0xF0C9),(0xF0CA),(0xF0CB),(0xF0CC),(0xF0CD),(0xF0CE),(0xF0CF),
-(0xF0D0),(0xF0D1),(0xF0D2),(0xF0D3),(0xF0D4),(0xF0D5),(0xF0D6),(0xF0D7),
-(0xF0D8),(0xF0D9),(0xF0DA),(0xF0DB),(0xF0DC),(0xF0DD),(0xF0DE),(0xF0DF),
-(0xF0E0),(0xF0E1),(0xF0E2),(0xF0E3),(0xF0E4),(0xF0E5),(0xF0E6),(0xF0E7),
-(0xF0E8),(0xF0E9),(0xF0EA),(0xF0EB),(0xF0EC),(0xF0ED),(0xF0EE),(0xF0EF),
-(0xF0F0),(0xF0F1),(0xF0F2),(0xF0F3),(0xF0F4),(0xF0F5),(0xF0F6),(0xF0F7),
-(0xF0F8),(0xF0F9),(0xF0FA),(0xF0FB),(0xF0FC),
-(0xF140),(0xF141),(0xF142),(0xF143),(0xF144),(0xF145),(0xF146),(0xF147),
-(0xF148),(0xF149),(0xF14A),(0xF14B),(0xF14C),(0xF14D),(0xF14E),(0xF14F),
-(0xF150),(0xF151),(0xF152),(0xF153),(0xF154),(0xF155),(0xF156),(0xF157),
-(0xF158),(0xF159),(0xF15A),(0xF15B),(0xF15C),(0xF15D),(0xF15E),(0xF15F),
-(0xF160),(0xF161),(0xF162),(0xF163),(0xF164),(0xF165),(0xF166),(0xF167),
-(0xF168),(0xF169),(0xF16A),(0xF16B),(0xF16C),(0xF16D),(0xF16E),(0xF16F),
-(0xF170),(0xF171),(0xF172),(0xF173),(0xF174),(0xF175),(0xF176),(0xF177),
-(0xF178),(0xF179),(0xF17A),(0xF17B),(0xF17C),(0xF17D),(0xF17E),
-(0xF180),(0xF181),(0xF182),(0xF183),(0xF184),(0xF185),(0xF186),(0xF187),
-(0xF188),(0xF189),(0xF18A),(0xF18B),(0xF18C),(0xF18D),(0xF18E),(0xF18F),
-(0xF190),(0xF191),(0xF192),(0xF193),(0xF194),(0xF195),(0xF196),(0xF197),
-(0xF198),(0xF199),(0xF19A),(0xF19B),(0xF19C),(0xF19D),(0xF19E),(0xF19F),
-(0xF1A0),(0xF1A1),(0xF1A2),(0xF1A3),(0xF1A4),(0xF1A5),(0xF1A6),(0xF1A7),
-(0xF1A8),(0xF1A9),(0xF1AA),(0xF1AB),(0xF1AC),(0xF1AD),(0xF1AE),(0xF1AF),
-(0xF1B0),(0xF1B1),(0xF1B2),(0xF1B3),(0xF1B4),(0xF1B5),(0xF1B6),(0xF1B7),
-(0xF1B8),(0xF1B9),(0xF1BA),(0xF1BB),(0xF1BC),(0xF1BD),(0xF1BE),(0xF1BF),
-(0xF1C0),(0xF1C1),(0xF1C2),(0xF1C3),(0xF1C4),(0xF1C5),(0xF1C6),(0xF1C7),
-(0xF1C8),(0xF1C9),(0xF1CA),(0xF1CB),(0xF1CC),(0xF1CD),(0xF1CE),(0xF1CF),
-(0xF1D0),(0xF1D1),(0xF1D2),(0xF1D3),(0xF1D4),(0xF1D5),(0xF1D6),(0xF1D7),
-(0xF1D8),(0xF1D9),(0xF1DA),(0xF1DB),(0xF1DC),(0xF1DD),(0xF1DE),(0xF1DF),
-(0xF1E0),(0xF1E1),(0xF1E2),(0xF1E3),(0xF1E4),(0xF1E5),(0xF1E6),(0xF1E7),
-(0xF1E8),(0xF1E9),(0xF1EA),(0xF1EB),(0xF1EC),(0xF1ED),(0xF1EE),(0xF1EF),
-(0xF1F0),(0xF1F1),(0xF1F2),(0xF1F3),(0xF1F4),(0xF1F5),(0xF1F6),(0xF1F7),
-(0xF1F8),(0xF1F9),(0xF1FA),(0xF1FB),(0xF1FC),
-(0xF240),(0xF241),(0xF242),(0xF243),(0xF244),(0xF245),(0xF246),(0xF247),
-(0xF248),(0xF249),(0xF24A),(0xF24B),(0xF24C),(0xF24D),(0xF24E),(0xF24F),
-(0xF250),(0xF251),(0xF252),(0xF253),(0xF254),(0xF255),(0xF256),(0xF257),
-(0xF258),(0xF259),(0xF25A),(0xF25B),(0xF25C),(0xF25D),(0xF25E),(0xF25F),
-(0xF260),(0xF261),(0xF262),(0xF263),(0xF264),(0xF265),(0xF266),(0xF267),
-(0xF268),(0xF269),(0xF26A),(0xF26B),(0xF26C),(0xF26D),(0xF26E),(0xF26F),
-(0xF270),(0xF271),(0xF272),(0xF273),(0xF274),(0xF275),(0xF276),(0xF277),
-(0xF278),(0xF279),(0xF27A),(0xF27B),(0xF27C),(0xF27D),(0xF27E),
-(0xF280),(0xF281),(0xF282),(0xF283),(0xF284),(0xF285),(0xF286),(0xF287),
-(0xF288),(0xF289),(0xF28A),(0xF28B),(0xF28C),(0xF28D),(0xF28E),(0xF28F),
-(0xF290),(0xF291),(0xF292),(0xF293),(0xF294),(0xF295),(0xF296),(0xF297),
-(0xF298),(0xF299),(0xF29A),(0xF29B),(0xF29C),(0xF29D),(0xF29E),(0xF29F),
-(0xF2A0),(0xF2A1),(0xF2A2),(0xF2A3),(0xF2A4),(0xF2A5),(0xF2A6),(0xF2A7),
-(0xF2A8),(0xF2A9),(0xF2AA),(0xF2AB),(0xF2AC),(0xF2AD),(0xF2AE),(0xF2AF),
-(0xF2B0),(0xF2B1),(0xF2B2),(0xF2B3),(0xF2B4),(0xF2B5),(0xF2B6),(0xF2B7),
-(0xF2B8),(0xF2B9),(0xF2BA),(0xF2BB),(0xF2BC),(0xF2BD),(0xF2BE),(0xF2BF),
-(0xF2C0),(0xF2C1),(0xF2C2),(0xF2C3),(0xF2C4),(0xF2C5),(0xF2C6),(0xF2C7),
-(0xF2C8),(0xF2C9),(0xF2CA),(0xF2CB),(0xF2CC),(0xF2CD),(0xF2CE),(0xF2CF),
-(0xF2D0),(0xF2D1),(0xF2D2),(0xF2D3),(0xF2D4),(0xF2D5),(0xF2D6),(0xF2D7),
-(0xF2D8),(0xF2D9),(0xF2DA),(0xF2DB),(0xF2DC),(0xF2DD),(0xF2DE),(0xF2DF),
-(0xF2E0),(0xF2E1),(0xF2E2),(0xF2E3),(0xF2E4),(0xF2E5),(0xF2E6),(0xF2E7),
-(0xF2E8),(0xF2E9),(0xF2EA),(0xF2EB),(0xF2EC),(0xF2ED),(0xF2EE),(0xF2EF),
-(0xF2F0),(0xF2F1),(0xF2F2),(0xF2F3),(0xF2F4),(0xF2F5),(0xF2F6),(0xF2F7),
-(0xF2F8),(0xF2F9),(0xF2FA),(0xF2FB),(0xF2FC),
-(0xF340),(0xF341),(0xF342),(0xF343),(0xF344),(0xF345),(0xF346),(0xF347),
-(0xF348),(0xF349),(0xF34A),(0xF34B),(0xF34C),(0xF34D),(0xF34E),(0xF34F),
-(0xF350),(0xF351),(0xF352),(0xF353),(0xF354),(0xF355),(0xF356),(0xF357),
-(0xF358),(0xF359),(0xF35A),(0xF35B),(0xF35C),(0xF35D),(0xF35E),(0xF35F),
-(0xF360),(0xF361),(0xF362),(0xF363),(0xF364),(0xF365),(0xF366),(0xF367),
-(0xF368),(0xF369),(0xF36A),(0xF36B),(0xF36C),(0xF36D),(0xF36E),(0xF36F),
-(0xF370),(0xF371),(0xF372),(0xF373),(0xF374),(0xF375),(0xF376),(0xF377),
-(0xF378),(0xF379),(0xF37A),(0xF37B),(0xF37C),(0xF37D),(0xF37E),
-(0xF380),(0xF381),(0xF382),(0xF383),(0xF384),(0xF385),(0xF386),(0xF387),
-(0xF388),(0xF389),(0xF38A),(0xF38B),(0xF38C),(0xF38D),(0xF38E),(0xF38F),
-(0xF390),(0xF391),(0xF392),(0xF393),(0xF394),(0xF395),(0xF396),(0xF397),
-(0xF398),(0xF399),(0xF39A),(0xF39B),(0xF39C),(0xF39D),(0xF39E),(0xF39F),
-(0xF3A0),(0xF3A1),(0xF3A2),(0xF3A3),(0xF3A4),(0xF3A5),(0xF3A6),(0xF3A7),
-(0xF3A8),(0xF3A9),(0xF3AA),(0xF3AB),(0xF3AC),(0xF3AD),(0xF3AE),(0xF3AF),
-(0xF3B0),(0xF3B1),(0xF3B2),(0xF3B3),(0xF3B4),(0xF3B5),(0xF3B6),(0xF3B7),
-(0xF3B8),(0xF3B9),(0xF3BA),(0xF3BB),(0xF3BC),(0xF3BD),(0xF3BE),(0xF3BF),
-(0xF3C0),(0xF3C1),(0xF3C2),(0xF3C3),(0xF3C4),(0xF3C5),(0xF3C6),(0xF3C7),
-(0xF3C8),(0xF3C9),(0xF3CA),(0xF3CB),(0xF3CC),(0xF3CD),(0xF3CE),(0xF3CF),
-(0xF3D0),(0xF3D1),(0xF3D2),(0xF3D3),(0xF3D4),(0xF3D5),(0xF3D6),(0xF3D7),
-(0xF3D8),(0xF3D9),(0xF3DA),(0xF3DB),(0xF3DC),(0xF3DD),(0xF3DE),(0xF3DF),
-(0xF3E0),(0xF3E1),(0xF3E2),(0xF3E3),(0xF3E4),(0xF3E5),(0xF3E6),(0xF3E7),
-(0xF3E8),(0xF3E9),(0xF3EA),(0xF3EB),(0xF3EC),(0xF3ED),(0xF3EE),(0xF3EF),
-(0xF3F0),(0xF3F1),(0xF3F2),(0xF3F3),(0xF3F4),(0xF3F5),(0xF3F6),(0xF3F7),
-(0xF3F8),(0xF3F9),(0xF3FA),(0xF3FB),(0xF3FC),
-(0xF440),(0xF441),(0xF442),(0xF443),(0xF444),(0xF445),(0xF446),(0xF447),
-(0xF448),(0xF449),(0xF44A),(0xF44B),(0xF44C),(0xF44D),(0xF44E),(0xF44F),
-(0xF450),(0xF451),(0xF452),(0xF453),(0xF454),(0xF455),(0xF456),(0xF457),
-(0xF458),(0xF459),(0xF45A),(0xF45B),(0xF45C),(0xF45D),(0xF45E),(0xF45F),
-(0xF460),(0xF461),(0xF462),(0xF463),(0xF464),(0xF465),(0xF466),(0xF467),
-(0xF468),(0xF469),(0xF46A),(0xF46B),(0xF46C),(0xF46D),(0xF46E),(0xF46F),
-(0xF470),(0xF471),(0xF472),(0xF473),(0xF474),(0xF475),(0xF476),(0xF477),
-(0xF478),(0xF479),(0xF47A),(0xF47B),(0xF47C),(0xF47D),(0xF47E),
-(0xF480),(0xF481),(0xF482),(0xF483),(0xF484),(0xF485),(0xF486),(0xF487),
-(0xF488),(0xF489),(0xF48A),(0xF48B),(0xF48C),(0xF48D),(0xF48E),(0xF48F),
-(0xF490),(0xF491),(0xF492),(0xF493),(0xF494),(0xF495),(0xF496),(0xF497),
-(0xF498),(0xF499),(0xF49A),(0xF49B),(0xF49C),(0xF49D),(0xF49E),(0xF49F),
-(0xF4A0),(0xF4A1),(0xF4A2),(0xF4A3),(0xF4A4),(0xF4A5),(0xF4A6),(0xF4A7),
-(0xF4A8),(0xF4A9),(0xF4AA),(0xF4AB),(0xF4AC),(0xF4AD),(0xF4AE),(0xF4AF),
-(0xF4B0),(0xF4B1),(0xF4B2),(0xF4B3),(0xF4B4),(0xF4B5),(0xF4B6),(0xF4B7),
-(0xF4B8),(0xF4B9),(0xF4BA),(0xF4BB),(0xF4BC),(0xF4BD),(0xF4BE),(0xF4BF),
-(0xF4C0),(0xF4C1),(0xF4C2),(0xF4C3),(0xF4C4),(0xF4C5),(0xF4C6),(0xF4C7),
-(0xF4C8),(0xF4C9),(0xF4CA),(0xF4CB),(0xF4CC),(0xF4CD),(0xF4CE),(0xF4CF),
-(0xF4D0),(0xF4D1),(0xF4D2),(0xF4D3),(0xF4D4),(0xF4D5),(0xF4D6),(0xF4D7),
-(0xF4D8),(0xF4D9),(0xF4DA),(0xF4DB),(0xF4DC),(0xF4DD),(0xF4DE),(0xF4DF),
-(0xF4E0),(0xF4E1),(0xF4E2),(0xF4E3),(0xF4E4),(0xF4E5),(0xF4E6),(0xF4E7),
-(0xF4E8),(0xF4E9),(0xF4EA),(0xF4EB),(0xF4EC),(0xF4ED),(0xF4EE),(0xF4EF),
-(0xF4F0),(0xF4F1),(0xF4F2),(0xF4F3),(0xF4F4),(0xF4F5),(0xF4F6),(0xF4F7),
-(0xF4F8),(0xF4F9),(0xF4FA),(0xF4FB),(0xF4FC),
-(0xF540),(0xF541),(0xF542),(0xF543),(0xF544),(0xF545),(0xF546),(0xF547),
-(0xF548),(0xF549),(0xF54A),(0xF54B),(0xF54C),(0xF54D),(0xF54E),(0xF54F),
-(0xF550),(0xF551),(0xF552),(0xF553),(0xF554),(0xF555),(0xF556),(0xF557),
-(0xF558),(0xF559),(0xF55A),(0xF55B),(0xF55C),(0xF55D),(0xF55E),(0xF55F),
-(0xF560),(0xF561),(0xF562),(0xF563),(0xF564),(0xF565),(0xF566),(0xF567),
-(0xF568),(0xF569),(0xF56A),(0xF56B),(0xF56C),(0xF56D),(0xF56E),(0xF56F),
-(0xF570),(0xF571),(0xF572),(0xF573),(0xF574),(0xF575),(0xF576),(0xF577),
-(0xF578),(0xF579),(0xF57A),(0xF57B),(0xF57C),(0xF57D),(0xF57E),
-(0xF580),(0xF581),(0xF582),(0xF583),(0xF584),(0xF585),(0xF586),(0xF587),
-(0xF588),(0xF589),(0xF58A),(0xF58B),(0xF58C),(0xF58D),(0xF58E),(0xF58F),
-(0xF590),(0xF591),(0xF592),(0xF593),(0xF594),(0xF595),(0xF596),(0xF597),
-(0xF598),(0xF599),(0xF59A),(0xF59B),(0xF59C),(0xF59D),(0xF59E),(0xF59F),
-(0xF5A0),(0xF5A1),(0xF5A2),(0xF5A3),(0xF5A4),(0xF5A5),(0xF5A6),(0xF5A7),
-(0xF5A8),(0xF5A9),(0xF5AA),(0xF5AB),(0xF5AC),(0xF5AD),(0xF5AE),(0xF5AF),
-(0xF5B0),(0xF5B1),(0xF5B2),(0xF5B3),(0xF5B4),(0xF5B5),(0xF5B6),(0xF5B7),
-(0xF5B8),(0xF5B9),(0xF5BA),(0xF5BB),(0xF5BC),(0xF5BD),(0xF5BE),(0xF5BF),
-(0xF5C0),(0xF5C1),(0xF5C2),(0xF5C3),(0xF5C4),(0xF5C5),(0xF5C6),(0xF5C7),
-(0xF5C8),(0xF5C9),(0xF5CA),(0xF5CB),(0xF5CC),(0xF5CD),(0xF5CE),(0xF5CF),
-(0xF5D0),(0xF5D1),(0xF5D2),(0xF5D3),(0xF5D4),(0xF5D5),(0xF5D6),(0xF5D7),
-(0xF5D8),(0xF5D9),(0xF5DA),(0xF5DB),(0xF5DC),(0xF5DD),(0xF5DE),(0xF5DF),
-(0xF5E0),(0xF5E1),(0xF5E2),(0xF5E3),(0xF5E4),(0xF5E5),(0xF5E6),(0xF5E7),
-(0xF5E8),(0xF5E9),(0xF5EA),(0xF5EB),(0xF5EC),(0xF5ED),(0xF5EE),(0xF5EF),
-(0xF5F0),(0xF5F1),(0xF5F2),(0xF5F3),(0xF5F4),(0xF5F5),(0xF5F6),(0xF5F7),
-(0xF5F8),(0xF5F9),(0xF5FA),(0xF5FB),(0xF5FC),
-(0xF640),(0xF641),(0xF642),(0xF643),(0xF644),(0xF645),(0xF646),(0xF647),
-(0xF648),(0xF649),(0xF64A),(0xF64B),(0xF64C),(0xF64D),(0xF64E),(0xF64F),
-(0xF650),(0xF651),(0xF652),(0xF653),(0xF654),(0xF655),(0xF656),(0xF657),
-(0xF658),(0xF659),(0xF65A),(0xF65B),(0xF65C),(0xF65D),(0xF65E),(0xF65F),
-(0xF660),(0xF661),(0xF662),(0xF663),(0xF664),(0xF665),(0xF666),(0xF667),
-(0xF668),(0xF669),(0xF66A),(0xF66B),(0xF66C),(0xF66D),(0xF66E),(0xF66F),
-(0xF670),(0xF671),(0xF672),(0xF673),(0xF674),(0xF675),(0xF676),(0xF677),
-(0xF678),(0xF679),(0xF67A),(0xF67B),(0xF67C),(0xF67D),(0xF67E),
-(0xF680),(0xF681),(0xF682),(0xF683),(0xF684),(0xF685),(0xF686),(0xF687),
-(0xF688),(0xF689),(0xF68A),(0xF68B),(0xF68C),(0xF68D),(0xF68E),(0xF68F),
-(0xF690),(0xF691),(0xF692),(0xF693),(0xF694),(0xF695),(0xF696),(0xF697),
-(0xF698),(0xF699),(0xF69A),(0xF69B),(0xF69C),(0xF69D),(0xF69E),(0xF69F),
-(0xF6A0),(0xF6A1),(0xF6A2),(0xF6A3),(0xF6A4),(0xF6A5),(0xF6A6),(0xF6A7),
-(0xF6A8),(0xF6A9),(0xF6AA),(0xF6AB),(0xF6AC),(0xF6AD),(0xF6AE),(0xF6AF),
-(0xF6B0),(0xF6B1),(0xF6B2),(0xF6B3),(0xF6B4),(0xF6B5),(0xF6B6),(0xF6B7),
-(0xF6B8),(0xF6B9),(0xF6BA),(0xF6BB),(0xF6BC),(0xF6BD),(0xF6BE),(0xF6BF),
-(0xF6C0),(0xF6C1),(0xF6C2),(0xF6C3),(0xF6C4),(0xF6C5),(0xF6C6),(0xF6C7),
-(0xF6C8),(0xF6C9),(0xF6CA),(0xF6CB),(0xF6CC),(0xF6CD),(0xF6CE),(0xF6CF),
-(0xF6D0),(0xF6D1),(0xF6D2),(0xF6D3),(0xF6D4),(0xF6D5),(0xF6D6),(0xF6D7),
-(0xF6D8),(0xF6D9),(0xF6DA),(0xF6DB),(0xF6DC),(0xF6DD),(0xF6DE),(0xF6DF),
-(0xF6E0),(0xF6E1),(0xF6E2),(0xF6E3),(0xF6E4),(0xF6E5),(0xF6E6),(0xF6E7),
-(0xF6E8),(0xF6E9),(0xF6EA),(0xF6EB),(0xF6EC),(0xF6ED),(0xF6EE),(0xF6EF),
-(0xF6F0),(0xF6F1),(0xF6F2),(0xF6F3),(0xF6F4),(0xF6F5),(0xF6F6),(0xF6F7),
-(0xF6F8),(0xF6F9),(0xF6FA),(0xF6FB),(0xF6FC),
-(0xF740),(0xF741),(0xF742),(0xF743),(0xF744),(0xF745),(0xF746),(0xF747),
-(0xF748),(0xF749),(0xF74A),(0xF74B),(0xF74C),(0xF74D),(0xF74E),(0xF74F),
-(0xF750),(0xF751),(0xF752),(0xF753),(0xF754),(0xF755),(0xF756),(0xF757),
-(0xF758),(0xF759),(0xF75A),(0xF75B),(0xF75C),(0xF75D),(0xF75E),(0xF75F),
-(0xF760),(0xF761),(0xF762),(0xF763),(0xF764),(0xF765),(0xF766),(0xF767),
-(0xF768),(0xF769),(0xF76A),(0xF76B),(0xF76C),(0xF76D),(0xF76E),(0xF76F),
-(0xF770),(0xF771),(0xF772),(0xF773),(0xF774),(0xF775),(0xF776),(0xF777),
-(0xF778),(0xF779),(0xF77A),(0xF77B),(0xF77C),(0xF77D),(0xF77E),
-(0xF780),(0xF781),(0xF782),(0xF783),(0xF784),(0xF785),(0xF786),(0xF787),
-(0xF788),(0xF789),(0xF78A),(0xF78B),(0xF78C),(0xF78D),(0xF78E),(0xF78F),
-(0xF790),(0xF791),(0xF792),(0xF793),(0xF794),(0xF795),(0xF796),(0xF797),
-(0xF798),(0xF799),(0xF79A),(0xF79B),(0xF79C),(0xF79D),(0xF79E),(0xF79F),
-(0xF7A0),(0xF7A1),(0xF7A2),(0xF7A3),(0xF7A4),(0xF7A5),(0xF7A6),(0xF7A7),
-(0xF7A8),(0xF7A9),(0xF7AA),(0xF7AB),(0xF7AC),(0xF7AD),(0xF7AE),(0xF7AF),
-(0xF7B0),(0xF7B1),(0xF7B2),(0xF7B3),(0xF7B4),(0xF7B5),(0xF7B6),(0xF7B7),
-(0xF7B8),(0xF7B9),(0xF7BA),(0xF7BB),(0xF7BC),(0xF7BD),(0xF7BE),(0xF7BF),
-(0xF7C0),(0xF7C1),(0xF7C2),(0xF7C3),(0xF7C4),(0xF7C5),(0xF7C6),(0xF7C7),
-(0xF7C8),(0xF7C9),(0xF7CA),(0xF7CB),(0xF7CC),(0xF7CD),(0xF7CE),(0xF7CF),
-(0xF7D0),(0xF7D1),(0xF7D2),(0xF7D3),(0xF7D4),(0xF7D5),(0xF7D6),(0xF7D7),
-(0xF7D8),(0xF7D9),(0xF7DA),(0xF7DB),(0xF7DC),(0xF7DD),(0xF7DE),(0xF7DF),
-(0xF7E0),(0xF7E1),(0xF7E2),(0xF7E3),(0xF7E4),(0xF7E5),(0xF7E6),(0xF7E7),
-(0xF7E8),(0xF7E9),(0xF7EA),(0xF7EB),(0xF7EC),(0xF7ED),(0xF7EE),(0xF7EF),
-(0xF7F0),(0xF7F1),(0xF7F2),(0xF7F3),(0xF7F4),(0xF7F5),(0xF7F6),(0xF7F7),
-(0xF7F8),(0xF7F9),(0xF7FA),(0xF7FB),(0xF7FC),
-(0xF840),(0xF841),(0xF842),(0xF843),(0xF844),(0xF845),(0xF846),(0xF847),
-(0xF848),(0xF849),(0xF84A),(0xF84B),(0xF84C),(0xF84D),(0xF84E),(0xF84F),
-(0xF850),(0xF851),(0xF852),(0xF853),(0xF854),(0xF855),(0xF856),(0xF857),
-(0xF858),(0xF859),(0xF85A),(0xF85B),(0xF85C),(0xF85D),(0xF85E),(0xF85F),
-(0xF860),(0xF861),(0xF862),(0xF863),(0xF864),(0xF865),(0xF866),(0xF867),
-(0xF868),(0xF869),(0xF86A),(0xF86B),(0xF86C),(0xF86D),(0xF86E),(0xF86F),
-(0xF870),(0xF871),(0xF872),(0xF873),(0xF874),(0xF875),(0xF876),(0xF877),
-(0xF878),(0xF879),(0xF87A),(0xF87B),(0xF87C),(0xF87D),(0xF87E),
-(0xF880),(0xF881),(0xF882),(0xF883),(0xF884),(0xF885),(0xF886),(0xF887),
-(0xF888),(0xF889),(0xF88A),(0xF88B),(0xF88C),(0xF88D),(0xF88E),(0xF88F),
-(0xF890),(0xF891),(0xF892),(0xF893),(0xF894),(0xF895),(0xF896),(0xF897),
-(0xF898),(0xF899),(0xF89A),(0xF89B),(0xF89C),(0xF89D),(0xF89E),(0xF89F),
-(0xF8A0),(0xF8A1),(0xF8A2),(0xF8A3),(0xF8A4),(0xF8A5),(0xF8A6),(0xF8A7),
-(0xF8A8),(0xF8A9),(0xF8AA),(0xF8AB),(0xF8AC),(0xF8AD),(0xF8AE),(0xF8AF),
-(0xF8B0),(0xF8B1),(0xF8B2),(0xF8B3),(0xF8B4),(0xF8B5),(0xF8B6),(0xF8B7),
-(0xF8B8),(0xF8B9),(0xF8BA),(0xF8BB),(0xF8BC),(0xF8BD),(0xF8BE),(0xF8BF),
-(0xF8C0),(0xF8C1),(0xF8C2),(0xF8C3),(0xF8C4),(0xF8C5),(0xF8C6),(0xF8C7),
-(0xF8C8),(0xF8C9),(0xF8CA),(0xF8CB),(0xF8CC),(0xF8CD),(0xF8CE),(0xF8CF),
-(0xF8D0),(0xF8D1),(0xF8D2),(0xF8D3),(0xF8D4),(0xF8D5),(0xF8D6),(0xF8D7),
-(0xF8D8),(0xF8D9),(0xF8DA),(0xF8DB),(0xF8DC),(0xF8DD),(0xF8DE),(0xF8DF),
-(0xF8E0),(0xF8E1),(0xF8E2),(0xF8E3),(0xF8E4),(0xF8E5),(0xF8E6),(0xF8E7),
-(0xF8E8),(0xF8E9),(0xF8EA),(0xF8EB),(0xF8EC),(0xF8ED),(0xF8EE),(0xF8EF),
-(0xF8F0),(0xF8F1),(0xF8F2),(0xF8F3),(0xF8F4),(0xF8F5),(0xF8F6),(0xF8F7),
-(0xF8F8),(0xF8F9),(0xF8FA),(0xF8FB),(0xF8FC),
-(0xF940),(0xF941),(0xF942),(0xF943),(0xF944),(0xF945),(0xF946),(0xF947),
-(0xF948),(0xF949),(0xF94A),(0xF94B),(0xF94C),(0xF94D),(0xF94E),(0xF94F),
-(0xF950),(0xF951),(0xF952),(0xF953),(0xF954),(0xF955),(0xF956),(0xF957),
-(0xF958),(0xF959),(0xF95A),(0xF95B),(0xF95C),(0xF95D),(0xF95E),(0xF95F),
-(0xF960),(0xF961),(0xF962),(0xF963),(0xF964),(0xF965),(0xF966),(0xF967),
-(0xF968),(0xF969),(0xF96A),(0xF96B),(0xF96C),(0xF96D),(0xF96E),(0xF96F),
-(0xF970),(0xF971),(0xF972),(0xF973),(0xF974),(0xF975),(0xF976),(0xF977),
-(0xF978),(0xF979),(0xF97A),(0xF97B),(0xF97C),(0xF97D),(0xF97E),
-(0xF980),(0xF981),(0xF982),(0xF983),(0xF984),(0xF985),(0xF986),(0xF987),
-(0xF988),(0xF989),(0xF98A),(0xF98B),(0xF98C),(0xF98D),(0xF98E),(0xF98F),
-(0xF990),(0xF991),(0xF992),(0xF993),(0xF994),(0xF995),(0xF996),(0xF997),
-(0xF998),(0xF999),(0xF99A),(0xF99B),(0xF99C),(0xF99D),(0xF99E),(0xF99F),
-(0xF9A0),(0xF9A1),(0xF9A2),(0xF9A3),(0xF9A4),(0xF9A5),(0xF9A6),(0xF9A7),
-(0xF9A8),(0xF9A9),(0xF9AA),(0xF9AB),(0xF9AC),(0xF9AD),(0xF9AE),(0xF9AF),
-(0xF9B0),(0xF9B1),(0xF9B2),(0xF9B3),(0xF9B4),(0xF9B5),(0xF9B6),(0xF9B7),
-(0xF9B8),(0xF9B9),(0xF9BA),(0xF9BB),(0xF9BC),(0xF9BD),(0xF9BE),(0xF9BF),
-(0xF9C0),(0xF9C1),(0xF9C2),(0xF9C3),(0xF9C4),(0xF9C5),(0xF9C6),(0xF9C7),
-(0xF9C8),(0xF9C9),(0xF9CA),(0xF9CB),(0xF9CC),(0xF9CD),(0xF9CE),(0xF9CF),
-(0xF9D0),(0xF9D1),(0xF9D2),(0xF9D3),(0xF9D4),(0xF9D5),(0xF9D6),(0xF9D7),
-(0xF9D8),(0xF9D9),(0xF9DA),(0xF9DB),(0xF9DC),(0xF9DD),(0xF9DE),(0xF9DF),
-(0xF9E0),(0xF9E1),(0xF9E2),(0xF9E3),(0xF9E4),(0xF9E5),(0xF9E6),(0xF9E7),
-(0xF9E8),(0xF9E9),(0xF9EA),(0xF9EB),(0xF9EC),(0xF9ED),(0xF9EE),(0xF9EF),
-(0xF9F0),(0xF9F1),(0xF9F2),(0xF9F3),(0xF9F4),(0xF9F5),(0xF9F6),(0xF9F7),
-(0xF9F8),(0xF9F9),(0xF9FA),(0xF9FB),(0xF9FC);
-SELECT HEX(c1) FROM t1;
-HEX(c1)
-05
-7E
-815C
-815F
-8160
-8161
-817C
-8191
-8192
-81CA
-8740
-8741
-8742
-8743
-8744
-8745
-8746
-8747
-8748
-8749
-874A
-874B
-874C
-874D
-874E
-874F
-8750
-8751
-8752
-8753
-8754
-8755
-8756
-8757
-8758
-8759
-875A
-875B
-875C
-875D
-875F
-8760
-8761
-8762
-8763
-8764
-8765
-8766
-8767
-8768
-8769
-876A
-876B
-876C
-876D
-876E
-876F
-8770
-8771
-8772
-8773
-8774
-8775
-877E
-8780
-8781
-8782
-8783
-8784
-8785
-8786
-8787
-8788
-8789
-878A
-878B
-878C
-878D
-878E
-878F
-8790
-8791
-8792
-8793
-8794
-8795
-8796
-8797
-8798
-8799
-879A
-879B
-879C
-ED40
-ED41
-ED42
-ED43
-ED44
-ED45
-ED46
-ED47
-ED48
-ED49
-ED4A
-ED4B
-ED4C
-ED4D
-ED4E
-ED4F
-ED50
-ED51
-ED52
-ED53
-ED54
-ED55
-ED56
-ED57
-ED58
-ED59
-ED5A
-ED5B
-ED5C
-ED5D
-ED5E
-ED5F
-ED60
-ED61
-ED62
-ED63
-ED64
-ED65
-ED66
-ED67
-ED68
-ED69
-ED6A
-ED6B
-ED6C
-ED6D
-ED6E
-ED6F
-ED70
-ED71
-ED72
-ED73
-ED74
-ED75
-ED76
-ED77
-ED78
-ED79
-ED7A
-ED7B
-ED7C
-ED7D
-ED7E
-ED80
-ED81
-ED82
-ED83
-ED84
-ED85
-ED86
-ED87
-ED88
-ED89
-ED8A
-ED8B
-ED8C
-ED8D
-ED8E
-ED8F
-ED90
-ED91
-ED92
-ED93
-ED94
-ED95
-ED96
-ED97
-ED98
-ED99
-ED9A
-ED9B
-ED9C
-ED9D
-ED9E
-ED9F
-EDA0
-EDA1
-EDA2
-EDA3
-EDA4
-EDA5
-EDA6
-EDA7
-EDA8
-EDA9
-EDAA
-EDAB
-EDAC
-EDAD
-EDAE
-EDAF
-EDB0
-EDB1
-EDB2
-EDB3
-EDB4
-EDB5
-EDB6
-EDB7
-EDB8
-EDB9
-EDBA
-EDBB
-EDBC
-EDBD
-EDBE
-EDBF
-EDC0
-EDC1
-EDC2
-EDC3
-EDC4
-EDC5
-EDC6
-EDC7
-EDC8
-EDC9
-EDCA
-EDCB
-EDCC
-EDCD
-EDCE
-EDCF
-EDD0
-EDD1
-EDD2
-EDD3
-EDD4
-EDD5
-EDD6
-EDD7
-EDD8
-EDD9
-EDDA
-EDDB
-EDDC
-EDDD
-EDDE
-EDDF
-EDE0
-EDE1
-EDE2
-EDE3
-EDE4
-EDE5
-EDE6
-EDE7
-EDE8
-EDE9
-EDEA
-EDEB
-EDEC
-EDED
-EDEE
-EDEF
-EDF0
-EDF1
-EDF2
-EDF3
-EDF4
-EDF5
-EDF6
-EDF7
-EDF8
-EDF9
-EDFA
-EDFB
-EDFC
-EE40
-EE41
-EE42
-EE43
-EE44
-EE45
-EE46
-EE47
-EE48
-EE49
-EE4A
-EE4B
-EE4C
-EE4D
-EE4E
-EE4F
-EE50
-EE51
-EE52
-EE53
-EE54
-EE55
-EE56
-EE57
-EE58
-EE59
-EE5A
-EE5B
-EE5C
-EE5D
-EE5E
-EE5F
-EE60
-EE61
-EE62
-EE63
-EE64
-EE65
-EE66
-EE67
-EE68
-EE69
-EE6A
-EE6B
-EE6C
-EE6D
-EE6E
-EE6F
-EE70
-EE71
-EE72
-EE73
-EE74
-EE75
-EE76
-EE77
-EE78
-EE79
-EE7A
-EE7B
-EE7C
-EE7D
-EE7E
-EE80
-EE81
-EE82
-EE83
-EE84
-EE85
-EE86
-EE87
-EE88
-EE89
-EE8A
-EE8B
-EE8C
-EE8D
-EE8E
-EE8F
-EE90
-EE91
-EE92
-EE93
-EE94
-EE95
-EE96
-EE97
-EE98
-EE99
-EE9A
-EE9B
-EE9C
-EE9D
-EE9E
-EE9F
-EEA0
-EEA1
-EEA2
-EEA3
-EEA4
-EEA5
-EEA6
-EEA7
-EEA8
-EEA9
-EEAA
-EEAB
-EEAC
-EEAD
-EEAE
-EEAF
-EEB0
-EEB1
-EEB2
-EEB3
-EEB4
-EEB5
-EEB6
-EEB7
-EEB8
-EEB9
-EEBA
-EEBB
-EEBC
-EEBD
-EEBE
-EEBF
-EEC0
-EEC1
-EEC2
-EEC3
-EEC4
-EEC5
-EEC6
-EEC7
-EEC8
-EEC9
-EECA
-EECB
-EECC
-EECD
-EECE
-EECF
-EED0
-EED1
-EED2
-EED3
-EED4
-EED5
-EED6
-EED7
-EED8
-EED9
-EEDA
-EEDB
-EEDC
-EEDD
-EEDE
-EEDF
-EEE0
-EEE1
-EEE2
-EEE3
-EEE4
-EEE5
-EEE6
-EEE7
-EEE8
-EEE9
-EEEA
-EEEB
-EEEC
-EEEF
-EEF0
-EEF1
-EEF2
-EEF3
-EEF4
-EEF5
-EEF6
-EEF7
-EEF8
-EEF9
-EEFA
-EEFB
-EEFC
-FA40
-FA41
-FA42
-FA43
-FA44
-FA45
-FA46
-FA47
-FA48
-FA49
-FA4A
-FA4B
-FA4C
-FA4D
-FA4E
-FA4F
-FA50
-FA51
-FA52
-FA53
-FA54
-FA55
-FA56
-FA57
-FA58
-FA59
-FA5A
-FA5B
-FA5C
-FA5D
-FA5E
-FA5F
-FA60
-FA61
-FA62
-FA63
-FA64
-FA65
-FA66
-FA67
-FA68
-FA69
-FA6A
-FA6B
-FA6C
-FA6D
-FA6E
-FA6F
-FA70
-FA71
-FA72
-FA73
-FA74
-FA75
-FA76
-FA77
-FA78
-FA79
-FA7A
-FA7B
-FA7C
-FA7D
-FA7E
-FA80
-FA81
-FA82
-FA83
-FA84
-FA85
-FA86
-FA87
-FA88
-FA89
-FA8A
-FA8B
-FA8C
-FA8D
-FA8E
-FA8F
-FA90
-FA91
-FA92
-FA93
-FA94
-FA95
-FA96
-FA97
-FA98
-FA99
-FA9A
-FA9B
-FA9C
-FA9D
-FA9E
-FA9F
-FAA0
-FAA1
-FAA2
-FAA3
-FAA4
-FAA5
-FAA6
-FAA7
-FAA8
-FAA9
-FAAA
-FAAB
-FAAC
-FAAD
-FAAE
-FAAF
-FAB0
-FAB1
-FAB2
-FAB3
-FAB4
-FAB5
-FAB6
-FAB7
-FAB8
-FAB9
-FABA
-FABB
-FABC
-FABD
-FABE
-FABF
-FAC0
-FAC1
-FAC2
-FAC3
-FAC4
-FAC5
-FAC6
-FAC7
-FAC8
-FAC9
-FACA
-FACB
-FACC
-FACD
-FACE
-FACF
-FAD0
-FAD1
-FAD2
-FAD3
-FAD4
-FAD5
-FAD6
-FAD7
-FAD8
-FAD9
-FADA
-FADB
-FADC
-FADD
-FADE
-FADF
-FAE0
-FAE1
-FAE2
-FAE3
-FAE4
-FAE5
-FAE6
-FAE7
-FAE8
-FAE9
-FAEA
-FAEB
-FAEC
-FAED
-FAEE
-FAEF
-FAF0
-FAF1
-FAF2
-FAF3
-FAF4
-FAF5
-FAF6
-FAF7
-FAF8
-FAF9
-FAFA
-FAFB
-FAFC
-FB40
-FB41
-FB42
-FB43
-FB44
-FB45
-FB46
-FB47
-FB48
-FB49
-FB4A
-FB4B
-FB4C
-FB4D
-FB4E
-FB4F
-FB50
-FB51
-FB52
-FB53
-FB54
-FB55
-FB56
-FB57
-FB58
-FB59
-FB5A
-FB5B
-FB5C
-FB5D
-FB5E
-FB5F
-FB60
-FB61
-FB62
-FB63
-FB64
-FB65
-FB66
-FB67
-FB68
-FB69
-FB6A
-FB6B
-FB6C
-FB6D
-FB6E
-FB6F
-FB70
-FB71
-FB72
-FB73
-FB74
-FB75
-FB76
-FB77
-FB78
-FB79
-FB7A
-FB7B
-FB7C
-FB7D
-FB7E
-FB80
-FB81
-FB82
-FB83
-FB84
-FB85
-FB86
-FB87
-FB88
-FB89
-FB8A
-FB8B
-FB8C
-FB8D
-FB8E
-FB8F
-FB90
-FB91
-FB92
-FB93
-FB94
-FB95
-FB96
-FB97
-FB98
-FB99
-FB9A
-FB9B
-FB9C
-FB9D
-FB9E
-FB9F
-FBA0
-FBA1
-FBA2
-FBA3
-FBA4
-FBA5
-FBA6
-FBA7
-FBA8
-FBA9
-FBAA
-FBAB
-FBAC
-FBAD
-FBAE
-FBAF
-FBB0
-FBB1
-FBB2
-FBB3
-FBB4
-FBB5
-FBB6
-FBB7
-FBB8
-FBB9
-FBBA
-FBBB
-FBBC
-FBBD
-FBBE
-FBBF
-FBC0
-FBC1
-FBC2
-FBC3
-FBC4
-FBC5
-FBC6
-FBC7
-FBC8
-FBC9
-FBCA
-FBCB
-FBCC
-FBCD
-FBCE
-FBCF
-FBD0
-FBD1
-FBD2
-FBD3
-FBD4
-FBD5
-FBD6
-FBD7
-FBD8
-FBD9
-FBDA
-FBDB
-FBDC
-FBDD
-FBDE
-FBDF
-FBE0
-FBE1
-FBE2
-FBE3
-FBE4
-FBE5
-FBE6
-FBE7
-FBE8
-FBE9
-FBEA
-FBEB
-FBEC
-FBED
-FBEE
-FBEF
-FBF0
-FBF1
-FBF2
-FBF3
-FBF4
-FBF5
-FBF6
-FBF7
-FBF8
-FBF9
-FBFA
-FBFB
-FBFC
-FC40
-FC41
-FC42
-FC43
-FC44
-FC45
-FC46
-FC47
-FC48
-FC49
-FC4A
-FC4B
-F040
-F041
-F042
-F043
-F044
-F045
-F046
-F047
-F048
-F049
-F04A
-F04B
-F04C
-F04D
-F04E
-F04F
-F050
-F051
-F052
-F053
-F054
-F055
-F056
-F057
-F058
-F059
-F05A
-F05B
-F05C
-F05D
-F05E
-F05F
-F060
-F061
-F062
-F063
-F064
-F065
-F066
-F067
-F068
-F069
-F06A
-F06B
-F06C
-F06D
-F06E
-F06F
-F070
-F071
-F072
-F073
-F074
-F075
-F076
-F077
-F078
-F079
-F07A
-F07B
-F07C
-F07D
-F07E
-F080
-F081
-F082
-F083
-F084
-F085
-F086
-F087
-F088
-F089
-F08A
-F08B
-F08C
-F08D
-F08E
-F08F
-F090
-F091
-F092
-F093
-F094
-F095
-F096
-F097
-F098
-F099
-F09A
-F09B
-F09C
-F09D
-F09E
-F09F
-F0A0
-F0A1
-F0A2
-F0A3
-F0A4
-F0A5
-F0A6
-F0A7
-F0A8
-F0A9
-F0AA
-F0AB
-F0AC
-F0AD
-F0AE
-F0AF
-F0B0
-F0B1
-F0B2
-F0B3
-F0B4
-F0B5
-F0B6
-F0B7
-F0B8
-F0B9
-F0BA
-F0BB
-F0BC
-F0BD
-F0BE
-F0BF
-F0C0
-F0C1
-F0C2
-F0C3
-F0C4
-F0C5
-F0C6
-F0C7
-F0C8
-F0C9
-F0CA
-F0CB
-F0CC
-F0CD
-F0CE
-F0CF
-F0D0
-F0D1
-F0D2
-F0D3
-F0D4
-F0D5
-F0D6
-F0D7
-F0D8
-F0D9
-F0DA
-F0DB
-F0DC
-F0DD
-F0DE
-F0DF
-F0E0
-F0E1
-F0E2
-F0E3
-F0E4
-F0E5
-F0E6
-F0E7
-F0E8
-F0E9
-F0EA
-F0EB
-F0EC
-F0ED
-F0EE
-F0EF
-F0F0
-F0F1
-F0F2
-F0F3
-F0F4
-F0F5
-F0F6
-F0F7
-F0F8
-F0F9
-F0FA
-F0FB
-F0FC
-F140
-F141
-F142
-F143
-F144
-F145
-F146
-F147
-F148
-F149
-F14A
-F14B
-F14C
-F14D
-F14E
-F14F
-F150
-F151
-F152
-F153
-F154
-F155
-F156
-F157
-F158
-F159
-F15A
-F15B
-F15C
-F15D
-F15E
-F15F
-F160
-F161
-F162
-F163
-F164
-F165
-F166
-F167
-F168
-F169
-F16A
-F16B
-F16C
-F16D
-F16E
-F16F
-F170
-F171
-F172
-F173
-F174
-F175
-F176
-F177
-F178
-F179
-F17A
-F17B
-F17C
-F17D
-F17E
-F180
-F181
-F182
-F183
-F184
-F185
-F186
-F187
-F188
-F189
-F18A
-F18B
-F18C
-F18D
-F18E
-F18F
-F190
-F191
-F192
-F193
-F194
-F195
-F196
-F197
-F198
-F199
-F19A
-F19B
-F19C
-F19D
-F19E
-F19F
-F1A0
-F1A1
-F1A2
-F1A3
-F1A4
-F1A5
-F1A6
-F1A7
-F1A8
-F1A9
-F1AA
-F1AB
-F1AC
-F1AD
-F1AE
-F1AF
-F1B0
-F1B1
-F1B2
-F1B3
-F1B4
-F1B5
-F1B6
-F1B7
-F1B8
-F1B9
-F1BA
-F1BB
-F1BC
-F1BD
-F1BE
-F1BF
-F1C0
-F1C1
-F1C2
-F1C3
-F1C4
-F1C5
-F1C6
-F1C7
-F1C8
-F1C9
-F1CA
-F1CB
-F1CC
-F1CD
-F1CE
-F1CF
-F1D0
-F1D1
-F1D2
-F1D3
-F1D4
-F1D5
-F1D6
-F1D7
-F1D8
-F1D9
-F1DA
-F1DB
-F1DC
-F1DD
-F1DE
-F1DF
-F1E0
-F1E1
-F1E2
-F1E3
-F1E4
-F1E5
-F1E6
-F1E7
-F1E8
-F1E9
-F1EA
-F1EB
-F1EC
-F1ED
-F1EE
-F1EF
-F1F0
-F1F1
-F1F2
-F1F3
-F1F4
-F1F5
-F1F6
-F1F7
-F1F8
-F1F9
-F1FA
-F1FB
-F1FC
-F240
-F241
-F242
-F243
-F244
-F245
-F246
-F247
-F248
-F249
-F24A
-F24B
-F24C
-F24D
-F24E
-F24F
-F250
-F251
-F252
-F253
-F254
-F255
-F256
-F257
-F258
-F259
-F25A
-F25B
-F25C
-F25D
-F25E
-F25F
-F260
-F261
-F262
-F263
-F264
-F265
-F266
-F267
-F268
-F269
-F26A
-F26B
-F26C
-F26D
-F26E
-F26F
-F270
-F271
-F272
-F273
-F274
-F275
-F276
-F277
-F278
-F279
-F27A
-F27B
-F27C
-F27D
-F27E
-F280
-F281
-F282
-F283
-F284
-F285
-F286
-F287
-F288
-F289
-F28A
-F28B
-F28C
-F28D
-F28E
-F28F
-F290
-F291
-F292
-F293
-F294
-F295
-F296
-F297
-F298
-F299
-F29A
-F29B
-F29C
-F29D
-F29E
-F29F
-F2A0
-F2A1
-F2A2
-F2A3
-F2A4
-F2A5
-F2A6
-F2A7
-F2A8
-F2A9
-F2AA
-F2AB
-F2AC
-F2AD
-F2AE
-F2AF
-F2B0
-F2B1
-F2B2
-F2B3
-F2B4
-F2B5
-F2B6
-F2B7
-F2B8
-F2B9
-F2BA
-F2BB
-F2BC
-F2BD
-F2BE
-F2BF
-F2C0
-F2C1
-F2C2
-F2C3
-F2C4
-F2C5
-F2C6
-F2C7
-F2C8
-F2C9
-F2CA
-F2CB
-F2CC
-F2CD
-F2CE
-F2CF
-F2D0
-F2D1
-F2D2
-F2D3
-F2D4
-F2D5
-F2D6
-F2D7
-F2D8
-F2D9
-F2DA
-F2DB
-F2DC
-F2DD
-F2DE
-F2DF
-F2E0
-F2E1
-F2E2
-F2E3
-F2E4
-F2E5
-F2E6
-F2E7
-F2E8
-F2E9
-F2EA
-F2EB
-F2EC
-F2ED
-F2EE
-F2EF
-F2F0
-F2F1
-F2F2
-F2F3
-F2F4
-F2F5
-F2F6
-F2F7
-F2F8
-F2F9
-F2FA
-F2FB
-F2FC
-F340
-F341
-F342
-F343
-F344
-F345
-F346
-F347
-F348
-F349
-F34A
-F34B
-F34C
-F34D
-F34E
-F34F
-F350
-F351
-F352
-F353
-F354
-F355
-F356
-F357
-F358
-F359
-F35A
-F35B
-F35C
-F35D
-F35E
-F35F
-F360
-F361
-F362
-F363
-F364
-F365
-F366
-F367
-F368
-F369
-F36A
-F36B
-F36C
-F36D
-F36E
-F36F
-F370
-F371
-F372
-F373
-F374
-F375
-F376
-F377
-F378
-F379
-F37A
-F37B
-F37C
-F37D
-F37E
-F380
-F381
-F382
-F383
-F384
-F385
-F386
-F387
-F388
-F389
-F38A
-F38B
-F38C
-F38D
-F38E
-F38F
-F390
-F391
-F392
-F393
-F394
-F395
-F396
-F397
-F398
-F399
-F39A
-F39B
-F39C
-F39D
-F39E
-F39F
-F3A0
-F3A1
-F3A2
-F3A3
-F3A4
-F3A5
-F3A6
-F3A7
-F3A8
-F3A9
-F3AA
-F3AB
-F3AC
-F3AD
-F3AE
-F3AF
-F3B0
-F3B1
-F3B2
-F3B3
-F3B4
-F3B5
-F3B6
-F3B7
-F3B8
-F3B9
-F3BA
-F3BB
-F3BC
-F3BD
-F3BE
-F3BF
-F3C0
-F3C1
-F3C2
-F3C3
-F3C4
-F3C5
-F3C6
-F3C7
-F3C8
-F3C9
-F3CA
-F3CB
-F3CC
-F3CD
-F3CE
-F3CF
-F3D0
-F3D1
-F3D2
-F3D3
-F3D4
-F3D5
-F3D6
-F3D7
-F3D8
-F3D9
-F3DA
-F3DB
-F3DC
-F3DD
-F3DE
-F3DF
-F3E0
-F3E1
-F3E2
-F3E3
-F3E4
-F3E5
-F3E6
-F3E7
-F3E8
-F3E9
-F3EA
-F3EB
-F3EC
-F3ED
-F3EE
-F3EF
-F3F0
-F3F1
-F3F2
-F3F3
-F3F4
-F3F5
-F3F6
-F3F7
-F3F8
-F3F9
-F3FA
-F3FB
-F3FC
-F440
-F441
-F442
-F443
-F444
-F445
-F446
-F447
-F448
-F449
-F44A
-F44B
-F44C
-F44D
-F44E
-F44F
-F450
-F451
-F452
-F453
-F454
-F455
-F456
-F457
-F458
-F459
-F45A
-F45B
-F45C
-F45D
-F45E
-F45F
-F460
-F461
-F462
-F463
-F464
-F465
-F466
-F467
-F468
-F469
-F46A
-F46B
-F46C
-F46D
-F46E
-F46F
-F470
-F471
-F472
-F473
-F474
-F475
-F476
-F477
-F478
-F479
-F47A
-F47B
-F47C
-F47D
-F47E
-F480
-F481
-F482
-F483
-F484
-F485
-F486
-F487
-F488
-F489
-F48A
-F48B
-F48C
-F48D
-F48E
-F48F
-F490
-F491
-F492
-F493
-F494
-F495
-F496
-F497
-F498
-F499
-F49A
-F49B
-F49C
-F49D
-F49E
-F49F
-F4A0
-F4A1
-F4A2
-F4A3
-F4A4
-F4A5
-F4A6
-F4A7
-F4A8
-F4A9
-F4AA
-F4AB
-F4AC
-F4AD
-F4AE
-F4AF
-F4B0
-F4B1
-F4B2
-F4B3
-F4B4
-F4B5
-F4B6
-F4B7
-F4B8
-F4B9
-F4BA
-F4BB
-F4BC
-F4BD
-F4BE
-F4BF
-F4C0
-F4C1
-F4C2
-F4C3
-F4C4
-F4C5
-F4C6
-F4C7
-F4C8
-F4C9
-F4CA
-F4CB
-F4CC
-F4CD
-F4CE
-F4CF
-F4D0
-F4D1
-F4D2
-F4D3
-F4D4
-F4D5
-F4D6
-F4D7
-F4D8
-F4D9
-F4DA
-F4DB
-F4DC
-F4DD
-F4DE
-F4DF
-F4E0
-F4E1
-F4E2
-F4E3
-F4E4
-F4E5
-F4E6
-F4E7
-F4E8
-F4E9
-F4EA
-F4EB
-F4EC
-F4ED
-F4EE
-F4EF
-F4F0
-F4F1
-F4F2
-F4F3
-F4F4
-F4F5
-F4F6
-F4F7
-F4F8
-F4F9
-F4FA
-F4FB
-F4FC
-F540
-F541
-F542
-F543
-F544
-F545
-F546
-F547
-F548
-F549
-F54A
-F54B
-F54C
-F54D
-F54E
-F54F
-F550
-F551
-F552
-F553
-F554
-F555
-F556
-F557
-F558
-F559
-F55A
-F55B
-F55C
-F55D
-F55E
-F55F
-F560
-F561
-F562
-F563
-F564
-F565
-F566
-F567
-F568
-F569
-F56A
-F56B
-F56C
-F56D
-F56E
-F56F
-F570
-F571
-F572
-F573
-F574
-F575
-F576
-F577
-F578
-F579
-F57A
-F57B
-F57C
-F57D
-F57E
-F580
-F581
-F582
-F583
-F584
-F585
-F586
-F587
-F588
-F589
-F58A
-F58B
-F58C
-F58D
-F58E
-F58F
-F590
-F591
-F592
-F593
-F594
-F595
-F596
-F597
-F598
-F599
-F59A
-F59B
-F59C
-F59D
-F59E
-F59F
-F5A0
-F5A1
-F5A2
-F5A3
-F5A4
-F5A5
-F5A6
-F5A7
-F5A8
-F5A9
-F5AA
-F5AB
-F5AC
-F5AD
-F5AE
-F5AF
-F5B0
-F5B1
-F5B2
-F5B3
-F5B4
-F5B5
-F5B6
-F5B7
-F5B8
-F5B9
-F5BA
-F5BB
-F5BC
-F5BD
-F5BE
-F5BF
-F5C0
-F5C1
-F5C2
-F5C3
-F5C4
-F5C5
-F5C6
-F5C7
-F5C8
-F5C9
-F5CA
-F5CB
-F5CC
-F5CD
-F5CE
-F5CF
-F5D0
-F5D1
-F5D2
-F5D3
-F5D4
-F5D5
-F5D6
-F5D7
-F5D8
-F5D9
-F5DA
-F5DB
-F5DC
-F5DD
-F5DE
-F5DF
-F5E0
-F5E1
-F5E2
-F5E3
-F5E4
-F5E5
-F5E6
-F5E7
-F5E8
-F5E9
-F5EA
-F5EB
-F5EC
-F5ED
-F5EE
-F5EF
-F5F0
-F5F1
-F5F2
-F5F3
-F5F4
-F5F5
-F5F6
-F5F7
-F5F8
-F5F9
-F5FA
-F5FB
-F5FC
-F640
-F641
-F642
-F643
-F644
-F645
-F646
-F647
-F648
-F649
-F64A
-F64B
-F64C
-F64D
-F64E
-F64F
-F650
-F651
-F652
-F653
-F654
-F655
-F656
-F657
-F658
-F659
-F65A
-F65B
-F65C
-F65D
-F65E
-F65F
-F660
-F661
-F662
-F663
-F664
-F665
-F666
-F667
-F668
-F669
-F66A
-F66B
-F66C
-F66D
-F66E
-F66F
-F670
-F671
-F672
-F673
-F674
-F675
-F676
-F677
-F678
-F679
-F67A
-F67B
-F67C
-F67D
-F67E
-F680
-F681
-F682
-F683
-F684
-F685
-F686
-F687
-F688
-F689
-F68A
-F68B
-F68C
-F68D
-F68E
-F68F
-F690
-F691
-F692
-F693
-F694
-F695
-F696
-F697
-F698
-F699
-F69A
-F69B
-F69C
-F69D
-F69E
-F69F
-F6A0
-F6A1
-F6A2
-F6A3
-F6A4
-F6A5
-F6A6
-F6A7
-F6A8
-F6A9
-F6AA
-F6AB
-F6AC
-F6AD
-F6AE
-F6AF
-F6B0
-F6B1
-F6B2
-F6B3
-F6B4
-F6B5
-F6B6
-F6B7
-F6B8
-F6B9
-F6BA
-F6BB
-F6BC
-F6BD
-F6BE
-F6BF
-F6C0
-F6C1
-F6C2
-F6C3
-F6C4
-F6C5
-F6C6
-F6C7
-F6C8
-F6C9
-F6CA
-F6CB
-F6CC
-F6CD
-F6CE
-F6CF
-F6D0
-F6D1
-F6D2
-F6D3
-F6D4
-F6D5
-F6D6
-F6D7
-F6D8
-F6D9
-F6DA
-F6DB
-F6DC
-F6DD
-F6DE
-F6DF
-F6E0
-F6E1
-F6E2
-F6E3
-F6E4
-F6E5
-F6E6
-F6E7
-F6E8
-F6E9
-F6EA
-F6EB
-F6EC
-F6ED
-F6EE
-F6EF
-F6F0
-F6F1
-F6F2
-F6F3
-F6F4
-F6F5
-F6F6
-F6F7
-F6F8
-F6F9
-F6FA
-F6FB
-F6FC
-F740
-F741
-F742
-F743
-F744
-F745
-F746
-F747
-F748
-F749
-F74A
-F74B
-F74C
-F74D
-F74E
-F74F
-F750
-F751
-F752
-F753
-F754
-F755
-F756
-F757
-F758
-F759
-F75A
-F75B
-F75C
-F75D
-F75E
-F75F
-F760
-F761
-F762
-F763
-F764
-F765
-F766
-F767
-F768
-F769
-F76A
-F76B
-F76C
-F76D
-F76E
-F76F
-F770
-F771
-F772
-F773
-F774
-F775
-F776
-F777
-F778
-F779
-F77A
-F77B
-F77C
-F77D
-F77E
-F780
-F781
-F782
-F783
-F784
-F785
-F786
-F787
-F788
-F789
-F78A
-F78B
-F78C
-F78D
-F78E
-F78F
-F790
-F791
-F792
-F793
-F794
-F795
-F796
-F797
-F798
-F799
-F79A
-F79B
-F79C
-F79D
-F79E
-F79F
-F7A0
-F7A1
-F7A2
-F7A3
-F7A4
-F7A5
-F7A6
-F7A7
-F7A8
-F7A9
-F7AA
-F7AB
-F7AC
-F7AD
-F7AE
-F7AF
-F7B0
-F7B1
-F7B2
-F7B3
-F7B4
-F7B5
-F7B6
-F7B7
-F7B8
-F7B9
-F7BA
-F7BB
-F7BC
-F7BD
-F7BE
-F7BF
-F7C0
-F7C1
-F7C2
-F7C3
-F7C4
-F7C5
-F7C6
-F7C7
-F7C8
-F7C9
-F7CA
-F7CB
-F7CC
-F7CD
-F7CE
-F7CF
-F7D0
-F7D1
-F7D2
-F7D3
-F7D4
-F7D5
-F7D6
-F7D7
-F7D8
-F7D9
-F7DA
-F7DB
-F7DC
-F7DD
-F7DE
-F7DF
-F7E0
-F7E1
-F7E2
-F7E3
-F7E4
-F7E5
-F7E6
-F7E7
-F7E8
-F7E9
-F7EA
-F7EB
-F7EC
-F7ED
-F7EE
-F7EF
-F7F0
-F7F1
-F7F2
-F7F3
-F7F4
-F7F5
-F7F6
-F7F7
-F7F8
-F7F9
-F7FA
-F7FB
-F7FC
-F840
-F841
-F842
-F843
-F844
-F845
-F846
-F847
-F848
-F849
-F84A
-F84B
-F84C
-F84D
-F84E
-F84F
-F850
-F851
-F852
-F853
-F854
-F855
-F856
-F857
-F858
-F859
-F85A
-F85B
-F85C
-F85D
-F85E
-F85F
-F860
-F861
-F862
-F863
-F864
-F865
-F866
-F867
-F868
-F869
-F86A
-F86B
-F86C
-F86D
-F86E
-F86F
-F870
-F871
-F872
-F873
-F874
-F875
-F876
-F877
-F878
-F879
-F87A
-F87B
-F87C
-F87D
-F87E
-F880
-F881
-F882
-F883
-F884
-F885
-F886
-F887
-F888
-F889
-F88A
-F88B
-F88C
-F88D
-F88E
-F88F
-F890
-F891
-F892
-F893
-F894
-F895
-F896
-F897
-F898
-F899
-F89A
-F89B
-F89C
-F89D
-F89E
-F89F
-F8A0
-F8A1
-F8A2
-F8A3
-F8A4
-F8A5
-F8A6
-F8A7
-F8A8
-F8A9
-F8AA
-F8AB
-F8AC
-F8AD
-F8AE
-F8AF
-F8B0
-F8B1
-F8B2
-F8B3
-F8B4
-F8B5
-F8B6
-F8B7
-F8B8
-F8B9
-F8BA
-F8BB
-F8BC
-F8BD
-F8BE
-F8BF
-F8C0
-F8C1
-F8C2
-F8C3
-F8C4
-F8C5
-F8C6
-F8C7
-F8C8
-F8C9
-F8CA
-F8CB
-F8CC
-F8CD
-F8CE
-F8CF
-F8D0
-F8D1
-F8D2
-F8D3
-F8D4
-F8D5
-F8D6
-F8D7
-F8D8
-F8D9
-F8DA
-F8DB
-F8DC
-F8DD
-F8DE
-F8DF
-F8E0
-F8E1
-F8E2
-F8E3
-F8E4
-F8E5
-F8E6
-F8E7
-F8E8
-F8E9
-F8EA
-F8EB
-F8EC
-F8ED
-F8EE
-F8EF
-F8F0
-F8F1
-F8F2
-F8F3
-F8F4
-F8F5
-F8F6
-F8F7
-F8F8
-F8F9
-F8FA
-F8FB
-F8FC
-F940
-F941
-F942
-F943
-F944
-F945
-F946
-F947
-F948
-F949
-F94A
-F94B
-F94C
-F94D
-F94E
-F94F
-F950
-F951
-F952
-F953
-F954
-F955
-F956
-F957
-F958
-F959
-F95A
-F95B
-F95C
-F95D
-F95E
-F95F
-F960
-F961
-F962
-F963
-F964
-F965
-F966
-F967
-F968
-F969
-F96A
-F96B
-F96C
-F96D
-F96E
-F96F
-F970
-F971
-F972
-F973
-F974
-F975
-F976
-F977
-F978
-F979
-F97A
-F97B
-F97C
-F97D
-F97E
-F980
-F981
-F982
-F983
-F984
-F985
-F986
-F987
-F988
-F989
-F98A
-F98B
-F98C
-F98D
-F98E
-F98F
-F990
-F991
-F992
-F993
-F994
-F995
-F996
-F997
-F998
-F999
-F99A
-F99B
-F99C
-F99D
-F99E
-F99F
-F9A0
-F9A1
-F9A2
-F9A3
-F9A4
-F9A5
-F9A6
-F9A7
-F9A8
-F9A9
-F9AA
-F9AB
-F9AC
-F9AD
-F9AE
-F9AF
-F9B0
-F9B1
-F9B2
-F9B3
-F9B4
-F9B5
-F9B6
-F9B7
-F9B8
-F9B9
-F9BA
-F9BB
-F9BC
-F9BD
-F9BE
-F9BF
-F9C0
-F9C1
-F9C2
-F9C3
-F9C4
-F9C5
-F9C6
-F9C7
-F9C8
-F9C9
-F9CA
-F9CB
-F9CC
-F9CD
-F9CE
-F9CF
-F9D0
-F9D1
-F9D2
-F9D3
-F9D4
-F9D5
-F9D6
-F9D7
-F9D8
-F9D9
-F9DA
-F9DB
-F9DC
-F9DD
-F9DE
-F9DF
-F9E0
-F9E1
-F9E2
-F9E3
-F9E4
-F9E5
-F9E6
-F9E7
-F9E8
-F9E9
-F9EA
-F9EB
-F9EC
-F9ED
-F9EE
-F9EF
-F9F0
-F9F1
-F9F2
-F9F3
-F9F4
-F9F5
-F9F6
-F9F7
-F9F8
-F9F9
-F9FA
-F9FB
-F9FC
-CREATE TABLE t2 SELECT CONVERT(c1 USING ucs2) AS c1 FROM t1;
-SELECT HEX(c1) FROM t2;
-HEX(c1)
-0005
-007E
-2015
-FF3C
-FF5E
-2225
-FF0D
-FFE0
-FFE1
-FFE2
-2460
-2461
-2462
-2463
-2464
-2465
-2466
-2467
-2468
-2469
-246A
-246B
-246C
-246D
-246E
-246F
-2470
-2471
-2472
-2473
-2160
-2161
-2162
-2163
-2164
-2165
-2166
-2167
-2168
-2169
-3349
-3314
-3322
-334D
-3318
-3327
-3303
-3336
-3351
-3357
-330D
-3326
-3323
-332B
-334A
-333B
-339C
-339D
-339E
-338E
-338F
-33C4
-33A1
-337B
-301D
-301F
-2116
-33CD
-2121
-32A4
-32A5
-32A6
-32A7
-32A8
-3231
-3232
-3239
-337E
-337D
-337C
-2252
-2261
-222B
-222E
-2211
-221A
-22A5
-2220
-221F
-22BF
-2235
-2229
-222A
-7E8A
-891C
-9348
-9288
-84DC
-4FC9
-70BB
-6631
-68C8
-92F9
-66FB
-5F45
-4E28
-4EE1
-4EFC
-4F00
-4F03
-4F39
-4F56
-4F92
-4F8A
-4F9A
-4F94
-4FCD
-5040
-5022
-4FFF
-501E
-5046
-5070
-5042
-5094
-50F4
-50D8
-514A
-5164
-519D
-51BE
-51EC
-5215
-529C
-52A6
-52C0
-52DB
-5300
-5307
-5324
-5372
-5393
-53B2
-53DD
-FA0E
-549C
-548A
-54A9
-54FF
-5586
-5759
-5765
-57AC
-57C8
-57C7
-FA0F
-FA10
-589E
-58B2
-590B
-5953
-595B
-595D
-5963
-59A4
-59BA
-5B56
-5BC0
-752F
-5BD8
-5BEC
-5C1E
-5CA6
-5CBA
-5CF5
-5D27
-5D53
-FA11
-5D42
-5D6D
-5DB8
-5DB9
-5DD0
-5F21
-5F34
-5F67
-5FB7
-5FDE
-605D
-6085
-608A
-60DE
-60D5
-6120
-60F2
-6111
-6137
-6130
-6198
-6213
-62A6
-63F5
-6460
-649D
-64CE
-654E
-6600
-6615
-663B
-6609
-662E
-661E
-6624
-6665
-6657
-6659
-FA12
-6673
-6699
-66A0
-66B2
-66BF
-66FA
-670E
-F929
-6766
-67BB
-6852
-67C0
-6801
-6844
-68CF
-FA13
-6968
-FA14
-6998
-69E2
-6A30
-6A6B
-6A46
-6A73
-6A7E
-6AE2
-6AE4
-6BD6
-6C3F
-6C5C
-6C86
-6C6F
-6CDA
-6D04
-6D87
-6D6F
-6D96
-6DAC
-6DCF
-6DF8
-6DF2
-6DFC
-6E39
-6E5C
-6E27
-6E3C
-6EBF
-6F88
-6FB5
-6FF5
-7005
-7007
-7028
-7085
-70AB
-710F
-7104
-715C
-7146
-7147
-FA15
-71C1
-71FE
-72B1
-72BE
-7324
-FA16
-7377
-73BD
-73C9
-73D6
-73E3
-73D2
-7407
-73F5
-7426
-742A
-7429
-742E
-7462
-7489
-749F
-7501
-756F
-7682
-769C
-769E
-769B
-76A6
-FA17
-7746
-52AF
-7821
-784E
-7864
-787A
-7930
-FA18
-FA19
-FA1A
-7994
-FA1B
-799B
-7AD1
-7AE7
-FA1C
-7AEB
-7B9E
-FA1D
-7D48
-7D5C
-7DB7
-7DA0
-7DD6
-7E52
-7F47
-7FA1
-FA1E
-8301
-8362
-837F
-83C7
-83F6
-8448
-84B4
-8553
-8559
-856B
-FA1F
-85B0
-FA20
-FA21
-8807
-88F5
-8A12
-8A37
-8A79
-8AA7
-8ABE
-8ADF
-FA22
-8AF6
-8B53
-8B7F
-8CF0
-8CF4
-8D12
-8D76
-FA23
-8ECF
-FA24
-FA25
-9067
-90DE
-FA26
-9115
-9127
-91DA
-91D7
-91DE
-91ED
-91EE
-91E4
-91E5
-9206
-9210
-920A
-923A
-9240
-923C
-924E
-9259
-9251
-9239
-9267
-92A7
-9277
-9278
-92E7
-92D7
-92D9
-92D0
-FA27
-92D5
-92E0
-92D3
-9325
-9321
-92FB
-FA28
-931E
-92FF
-931D
-9302
-9370
-9357
-93A4
-93C6
-93DE
-93F8
-9431
-9445
-9448
-9592
-F9DC
-FA29
-969D
-96AF
-9733
-973B
-9743
-974D
-974F
-9751
-9755
-9857
-9865
-FA2A
-FA2B
-9927
-FA2C
-999E
-9A4E
-9AD9
-9ADC
-9B75
-9B72
-9B8F
-9BB1
-9BBB
-9C00
-9D70
-9D6B
-FA2D
-9E19
-9ED1
-2170
-2171
-2172
-2173
-2174
-2175
-2176
-2177
-2178
-2179
-FFE2
-FFE4
-FF07
-FF02
-2170
-2171
-2172
-2173
-2174
-2175
-2176
-2177
-2178
-2179
-2160
-2161
-2162
-2163
-2164
-2165
-2166
-2167
-2168
-2169
-FFE2
-FFE4
-FF07
-FF02
-3231
-2116
-2121
-2235
-7E8A
-891C
-9348
-9288
-84DC
-4FC9
-70BB
-6631
-68C8
-92F9
-66FB
-5F45
-4E28
-4EE1
-4EFC
-4F00
-4F03
-4F39
-4F56
-4F92
-4F8A
-4F9A
-4F94
-4FCD
-5040
-5022
-4FFF
-501E
-5046
-5070
-5042
-5094
-50F4
-50D8
-514A
-5164
-519D
-51BE
-51EC
-5215
-529C
-52A6
-52C0
-52DB
-5300
-5307
-5324
-5372
-5393
-53B2
-53DD
-FA0E
-549C
-548A
-54A9
-54FF
-5586
-5759
-5765
-57AC
-57C8
-57C7
-FA0F
-FA10
-589E
-58B2
-590B
-5953
-595B
-595D
-5963
-59A4
-59BA
-5B56
-5BC0
-752F
-5BD8
-5BEC
-5C1E
-5CA6
-5CBA
-5CF5
-5D27
-5D53
-FA11
-5D42
-5D6D
-5DB8
-5DB9
-5DD0
-5F21
-5F34
-5F67
-5FB7
-5FDE
-605D
-6085
-608A
-60DE
-60D5
-6120
-60F2
-6111
-6137
-6130
-6198
-6213
-62A6
-63F5
-6460
-649D
-64CE
-654E
-6600
-6615
-663B
-6609
-662E
-661E
-6624
-6665
-6657
-6659
-FA12
-6673
-6699
-66A0
-66B2
-66BF
-66FA
-670E
-F929
-6766
-67BB
-6852
-67C0
-6801
-6844
-68CF
-FA13
-6968
-FA14
-6998
-69E2
-6A30
-6A6B
-6A46
-6A73
-6A7E
-6AE2
-6AE4
-6BD6
-6C3F
-6C5C
-6C86
-6C6F
-6CDA
-6D04
-6D87
-6D6F
-6D96
-6DAC
-6DCF
-6DF8
-6DF2
-6DFC
-6E39
-6E5C
-6E27
-6E3C
-6EBF
-6F88
-6FB5
-6FF5
-7005
-7007
-7028
-7085
-70AB
-710F
-7104
-715C
-7146
-7147
-FA15
-71C1
-71FE
-72B1
-72BE
-7324
-FA16
-7377
-73BD
-73C9
-73D6
-73E3
-73D2
-7407
-73F5
-7426
-742A
-7429
-742E
-7462
-7489
-749F
-7501
-756F
-7682
-769C
-769E
-769B
-76A6
-FA17
-7746
-52AF
-7821
-784E
-7864
-787A
-7930
-FA18
-FA19
-FA1A
-7994
-FA1B
-799B
-7AD1
-7AE7
-FA1C
-7AEB
-7B9E
-FA1D
-7D48
-7D5C
-7DB7
-7DA0
-7DD6
-7E52
-7F47
-7FA1
-FA1E
-8301
-8362
-837F
-83C7
-83F6
-8448
-84B4
-8553
-8559
-856B
-FA1F
-85B0
-FA20
-FA21
-8807
-88F5
-8A12
-8A37
-8A79
-8AA7
-8ABE
-8ADF
-FA22
-8AF6
-8B53
-8B7F
-8CF0
-8CF4
-8D12
-8D76
-FA23
-8ECF
-FA24
-FA25
-9067
-90DE
-FA26
-9115
-9127
-91DA
-91D7
-91DE
-91ED
-91EE
-91E4
-91E5
-9206
-9210
-920A
-923A
-9240
-923C
-924E
-9259
-9251
-9239
-9267
-92A7
-9277
-9278
-92E7
-92D7
-92D9
-92D0
-FA27
-92D5
-92E0
-92D3
-9325
-9321
-92FB
-FA28
-931E
-92FF
-931D
-9302
-9370
-9357
-93A4
-93C6
-93DE
-93F8
-9431
-9445
-9448
-9592
-F9DC
-FA29
-969D
-96AF
-9733
-973B
-9743
-974D
-974F
-9751
-9755
-9857
-9865
-FA2A
-FA2B
-9927
-FA2C
-999E
-9A4E
-9AD9
-9ADC
-9B75
-9B72
-9B8F
-9BB1
-9BBB
-9C00
-9D70
-9D6B
-FA2D
-9E19
-9ED1
-E000
-E001
-E002
-E003
-E004
-E005
-E006
-E007
-E008
-E009
-E00A
-E00B
-E00C
-E00D
-E00E
-E00F
-E010
-E011
-E012
-E013
-E014
-E015
-E016
-E017
-E018
-E019
-E01A
-E01B
-E01C
-E01D
-E01E
-E01F
-E020
-E021
-E022
-E023
-E024
-E025
-E026
-E027
-E028
-E029
-E02A
-E02B
-E02C
-E02D
-E02E
-E02F
-E030
-E031
-E032
-E033
-E034
-E035
-E036
-E037
-E038
-E039
-E03A
-E03B
-E03C
-E03D
-E03E
-E03F
-E040
-E041
-E042
-E043
-E044
-E045
-E046
-E047
-E048
-E049
-E04A
-E04B
-E04C
-E04D
-E04E
-E04F
-E050
-E051
-E052
-E053
-E054
-E055
-E056
-E057
-E058
-E059
-E05A
-E05B
-E05C
-E05D
-E05E
-E05F
-E060
-E061
-E062
-E063
-E064
-E065
-E066
-E067
-E068
-E069
-E06A
-E06B
-E06C
-E06D
-E06E
-E06F
-E070
-E071
-E072
-E073
-E074
-E075
-E076
-E077
-E078
-E079
-E07A
-E07B
-E07C
-E07D
-E07E
-E07F
-E080
-E081
-E082
-E083
-E084
-E085
-E086
-E087
-E088
-E089
-E08A
-E08B
-E08C
-E08D
-E08E
-E08F
-E090
-E091
-E092
-E093
-E094
-E095
-E096
-E097
-E098
-E099
-E09A
-E09B
-E09C
-E09D
-E09E
-E09F
-E0A0
-E0A1
-E0A2
-E0A3
-E0A4
-E0A5
-E0A6
-E0A7
-E0A8
-E0A9
-E0AA
-E0AB
-E0AC
-E0AD
-E0AE
-E0AF
-E0B0
-E0B1
-E0B2
-E0B3
-E0B4
-E0B5
-E0B6
-E0B7
-E0B8
-E0B9
-E0BA
-E0BB
-E0BC
-E0BD
-E0BE
-E0BF
-E0C0
-E0C1
-E0C2
-E0C3
-E0C4
-E0C5
-E0C6
-E0C7
-E0C8
-E0C9
-E0CA
-E0CB
-E0CC
-E0CD
-E0CE
-E0CF
-E0D0
-E0D1
-E0D2
-E0D3
-E0D4
-E0D5
-E0D6
-E0D7
-E0D8
-E0D9
-E0DA
-E0DB
-E0DC
-E0DD
-E0DE
-E0DF
-E0E0
-E0E1
-E0E2
-E0E3
-E0E4
-E0E5
-E0E6
-E0E7
-E0E8
-E0E9
-E0EA
-E0EB
-E0EC
-E0ED
-E0EE
-E0EF
-E0F0
-E0F1
-E0F2
-E0F3
-E0F4
-E0F5
-E0F6
-E0F7
-E0F8
-E0F9
-E0FA
-E0FB
-E0FC
-E0FD
-E0FE
-E0FF
-E100
-E101
-E102
-E103
-E104
-E105
-E106
-E107
-E108
-E109
-E10A
-E10B
-E10C
-E10D
-E10E
-E10F
-E110
-E111
-E112
-E113
-E114
-E115
-E116
-E117
-E118
-E119
-E11A
-E11B
-E11C
-E11D
-E11E
-E11F
-E120
-E121
-E122
-E123
-E124
-E125
-E126
-E127
-E128
-E129
-E12A
-E12B
-E12C
-E12D
-E12E
-E12F
-E130
-E131
-E132
-E133
-E134
-E135
-E136
-E137
-E138
-E139
-E13A
-E13B
-E13C
-E13D
-E13E
-E13F
-E140
-E141
-E142
-E143
-E144
-E145
-E146
-E147
-E148
-E149
-E14A
-E14B
-E14C
-E14D
-E14E
-E14F
-E150
-E151
-E152
-E153
-E154
-E155
-E156
-E157
-E158
-E159
-E15A
-E15B
-E15C
-E15D
-E15E
-E15F
-E160
-E161
-E162
-E163
-E164
-E165
-E166
-E167
-E168
-E169
-E16A
-E16B
-E16C
-E16D
-E16E
-E16F
-E170
-E171
-E172
-E173
-E174
-E175
-E176
-E177
-E178
-E179
-E17A
-E17B
-E17C
-E17D
-E17E
-E17F
-E180
-E181
-E182
-E183
-E184
-E185
-E186
-E187
-E188
-E189
-E18A
-E18B
-E18C
-E18D
-E18E
-E18F
-E190
-E191
-E192
-E193
-E194
-E195
-E196
-E197
-E198
-E199
-E19A
-E19B
-E19C
-E19D
-E19E
-E19F
-E1A0
-E1A1
-E1A2
-E1A3
-E1A4
-E1A5
-E1A6
-E1A7
-E1A8
-E1A9
-E1AA
-E1AB
-E1AC
-E1AD
-E1AE
-E1AF
-E1B0
-E1B1
-E1B2
-E1B3
-E1B4
-E1B5
-E1B6
-E1B7
-E1B8
-E1B9
-E1BA
-E1BB
-E1BC
-E1BD
-E1BE
-E1BF
-E1C0
-E1C1
-E1C2
-E1C3
-E1C4
-E1C5
-E1C6
-E1C7
-E1C8
-E1C9
-E1CA
-E1CB
-E1CC
-E1CD
-E1CE
-E1CF
-E1D0
-E1D1
-E1D2
-E1D3
-E1D4
-E1D5
-E1D6
-E1D7
-E1D8
-E1D9
-E1DA
-E1DB
-E1DC
-E1DD
-E1DE
-E1DF
-E1E0
-E1E1
-E1E2
-E1E3
-E1E4
-E1E5
-E1E6
-E1E7
-E1E8
-E1E9
-E1EA
-E1EB
-E1EC
-E1ED
-E1EE
-E1EF
-E1F0
-E1F1
-E1F2
-E1F3
-E1F4
-E1F5
-E1F6
-E1F7
-E1F8
-E1F9
-E1FA
-E1FB
-E1FC
-E1FD
-E1FE
-E1FF
-E200
-E201
-E202
-E203
-E204
-E205
-E206
-E207
-E208
-E209
-E20A
-E20B
-E20C
-E20D
-E20E
-E20F
-E210
-E211
-E212
-E213
-E214
-E215
-E216
-E217
-E218
-E219
-E21A
-E21B
-E21C
-E21D
-E21E
-E21F
-E220
-E221
-E222
-E223
-E224
-E225
-E226
-E227
-E228
-E229
-E22A
-E22B
-E22C
-E22D
-E22E
-E22F
-E230
-E231
-E232
-E233
-E234
-E235
-E236
-E237
-E238
-E239
-E23A
-E23B
-E23C
-E23D
-E23E
-E23F
-E240
-E241
-E242
-E243
-E244
-E245
-E246
-E247
-E248
-E249
-E24A
-E24B
-E24C
-E24D
-E24E
-E24F
-E250
-E251
-E252
-E253
-E254
-E255
-E256
-E257
-E258
-E259
-E25A
-E25B
-E25C
-E25D
-E25E
-E25F
-E260
-E261
-E262
-E263
-E264
-E265
-E266
-E267
-E268
-E269
-E26A
-E26B
-E26C
-E26D
-E26E
-E26F
-E270
-E271
-E272
-E273
-E274
-E275
-E276
-E277
-E278
-E279
-E27A
-E27B
-E27C
-E27D
-E27E
-E27F
-E280
-E281
-E282
-E283
-E284
-E285
-E286
-E287
-E288
-E289
-E28A
-E28B
-E28C
-E28D
-E28E
-E28F
-E290
-E291
-E292
-E293
-E294
-E295
-E296
-E297
-E298
-E299
-E29A
-E29B
-E29C
-E29D
-E29E
-E29F
-E2A0
-E2A1
-E2A2
-E2A3
-E2A4
-E2A5
-E2A6
-E2A7
-E2A8
-E2A9
-E2AA
-E2AB
-E2AC
-E2AD
-E2AE
-E2AF
-E2B0
-E2B1
-E2B2
-E2B3
-E2B4
-E2B5
-E2B6
-E2B7
-E2B8
-E2B9
-E2BA
-E2BB
-E2BC
-E2BD
-E2BE
-E2BF
-E2C0
-E2C1
-E2C2
-E2C3
-E2C4
-E2C5
-E2C6
-E2C7
-E2C8
-E2C9
-E2CA
-E2CB
-E2CC
-E2CD
-E2CE
-E2CF
-E2D0
-E2D1
-E2D2
-E2D3
-E2D4
-E2D5
-E2D6
-E2D7
-E2D8
-E2D9
-E2DA
-E2DB
-E2DC
-E2DD
-E2DE
-E2DF
-E2E0
-E2E1
-E2E2
-E2E3
-E2E4
-E2E5
-E2E6
-E2E7
-E2E8
-E2E9
-E2EA
-E2EB
-E2EC
-E2ED
-E2EE
-E2EF
-E2F0
-E2F1
-E2F2
-E2F3
-E2F4
-E2F5
-E2F6
-E2F7
-E2F8
-E2F9
-E2FA
-E2FB
-E2FC
-E2FD
-E2FE
-E2FF
-E300
-E301
-E302
-E303
-E304
-E305
-E306
-E307
-E308
-E309
-E30A
-E30B
-E30C
-E30D
-E30E
-E30F
-E310
-E311
-E312
-E313
-E314
-E315
-E316
-E317
-E318
-E319
-E31A
-E31B
-E31C
-E31D
-E31E
-E31F
-E320
-E321
-E322
-E323
-E324
-E325
-E326
-E327
-E328
-E329
-E32A
-E32B
-E32C
-E32D
-E32E
-E32F
-E330
-E331
-E332
-E333
-E334
-E335
-E336
-E337
-E338
-E339
-E33A
-E33B
-E33C
-E33D
-E33E
-E33F
-E340
-E341
-E342
-E343
-E344
-E345
-E346
-E347
-E348
-E349
-E34A
-E34B
-E34C
-E34D
-E34E
-E34F
-E350
-E351
-E352
-E353
-E354
-E355
-E356
-E357
-E358
-E359
-E35A
-E35B
-E35C
-E35D
-E35E
-E35F
-E360
-E361
-E362
-E363
-E364
-E365
-E366
-E367
-E368
-E369
-E36A
-E36B
-E36C
-E36D
-E36E
-E36F
-E370
-E371
-E372
-E373
-E374
-E375
-E376
-E377
-E378
-E379
-E37A
-E37B
-E37C
-E37D
-E37E
-E37F
-E380
-E381
-E382
-E383
-E384
-E385
-E386
-E387
-E388
-E389
-E38A
-E38B
-E38C
-E38D
-E38E
-E38F
-E390
-E391
-E392
-E393
-E394
-E395
-E396
-E397
-E398
-E399
-E39A
-E39B
-E39C
-E39D
-E39E
-E39F
-E3A0
-E3A1
-E3A2
-E3A3
-E3A4
-E3A5
-E3A6
-E3A7
-E3A8
-E3A9
-E3AA
-E3AB
-E3AC
-E3AD
-E3AE
-E3AF
-E3B0
-E3B1
-E3B2
-E3B3
-E3B4
-E3B5
-E3B6
-E3B7
-E3B8
-E3B9
-E3BA
-E3BB
-E3BC
-E3BD
-E3BE
-E3BF
-E3C0
-E3C1
-E3C2
-E3C3
-E3C4
-E3C5
-E3C6
-E3C7
-E3C8
-E3C9
-E3CA
-E3CB
-E3CC
-E3CD
-E3CE
-E3CF
-E3D0
-E3D1
-E3D2
-E3D3
-E3D4
-E3D5
-E3D6
-E3D7
-E3D8
-E3D9
-E3DA
-E3DB
-E3DC
-E3DD
-E3DE
-E3DF
-E3E0
-E3E1
-E3E2
-E3E3
-E3E4
-E3E5
-E3E6
-E3E7
-E3E8
-E3E9
-E3EA
-E3EB
-E3EC
-E3ED
-E3EE
-E3EF
-E3F0
-E3F1
-E3F2
-E3F3
-E3F4
-E3F5
-E3F6
-E3F7
-E3F8
-E3F9
-E3FA
-E3FB
-E3FC
-E3FD
-E3FE
-E3FF
-E400
-E401
-E402
-E403
-E404
-E405
-E406
-E407
-E408
-E409
-E40A
-E40B
-E40C
-E40D
-E40E
-E40F
-E410
-E411
-E412
-E413
-E414
-E415
-E416
-E417
-E418
-E419
-E41A
-E41B
-E41C
-E41D
-E41E
-E41F
-E420
-E421
-E422
-E423
-E424
-E425
-E426
-E427
-E428
-E429
-E42A
-E42B
-E42C
-E42D
-E42E
-E42F
-E430
-E431
-E432
-E433
-E434
-E435
-E436
-E437
-E438
-E439
-E43A
-E43B
-E43C
-E43D
-E43E
-E43F
-E440
-E441
-E442
-E443
-E444
-E445
-E446
-E447
-E448
-E449
-E44A
-E44B
-E44C
-E44D
-E44E
-E44F
-E450
-E451
-E452
-E453
-E454
-E455
-E456
-E457
-E458
-E459
-E45A
-E45B
-E45C
-E45D
-E45E
-E45F
-E460
-E461
-E462
-E463
-E464
-E465
-E466
-E467
-E468
-E469
-E46A
-E46B
-E46C
-E46D
-E46E
-E46F
-E470
-E471
-E472
-E473
-E474
-E475
-E476
-E477
-E478
-E479
-E47A
-E47B
-E47C
-E47D
-E47E
-E47F
-E480
-E481
-E482
-E483
-E484
-E485
-E486
-E487
-E488
-E489
-E48A
-E48B
-E48C
-E48D
-E48E
-E48F
-E490
-E491
-E492
-E493
-E494
-E495
-E496
-E497
-E498
-E499
-E49A
-E49B
-E49C
-E49D
-E49E
-E49F
-E4A0
-E4A1
-E4A2
-E4A3
-E4A4
-E4A5
-E4A6
-E4A7
-E4A8
-E4A9
-E4AA
-E4AB
-E4AC
-E4AD
-E4AE
-E4AF
-E4B0
-E4B1
-E4B2
-E4B3
-E4B4
-E4B5
-E4B6
-E4B7
-E4B8
-E4B9
-E4BA
-E4BB
-E4BC
-E4BD
-E4BE
-E4BF
-E4C0
-E4C1
-E4C2
-E4C3
-E4C4
-E4C5
-E4C6
-E4C7
-E4C8
-E4C9
-E4CA
-E4CB
-E4CC
-E4CD
-E4CE
-E4CF
-E4D0
-E4D1
-E4D2
-E4D3
-E4D4
-E4D5
-E4D6
-E4D7
-E4D8
-E4D9
-E4DA
-E4DB
-E4DC
-E4DD
-E4DE
-E4DF
-E4E0
-E4E1
-E4E2
-E4E3
-E4E4
-E4E5
-E4E6
-E4E7
-E4E8
-E4E9
-E4EA
-E4EB
-E4EC
-E4ED
-E4EE
-E4EF
-E4F0
-E4F1
-E4F2
-E4F3
-E4F4
-E4F5
-E4F6
-E4F7
-E4F8
-E4F9
-E4FA
-E4FB
-E4FC
-E4FD
-E4FE
-E4FF
-E500
-E501
-E502
-E503
-E504
-E505
-E506
-E507
-E508
-E509
-E50A
-E50B
-E50C
-E50D
-E50E
-E50F
-E510
-E511
-E512
-E513
-E514
-E515
-E516
-E517
-E518
-E519
-E51A
-E51B
-E51C
-E51D
-E51E
-E51F
-E520
-E521
-E522
-E523
-E524
-E525
-E526
-E527
-E528
-E529
-E52A
-E52B
-E52C
-E52D
-E52E
-E52F
-E530
-E531
-E532
-E533
-E534
-E535
-E536
-E537
-E538
-E539
-E53A
-E53B
-E53C
-E53D
-E53E
-E53F
-E540
-E541
-E542
-E543
-E544
-E545
-E546
-E547
-E548
-E549
-E54A
-E54B
-E54C
-E54D
-E54E
-E54F
-E550
-E551
-E552
-E553
-E554
-E555
-E556
-E557
-E558
-E559
-E55A
-E55B
-E55C
-E55D
-E55E
-E55F
-E560
-E561
-E562
-E563
-E564
-E565
-E566
-E567
-E568
-E569
-E56A
-E56B
-E56C
-E56D
-E56E
-E56F
-E570
-E571
-E572
-E573
-E574
-E575
-E576
-E577
-E578
-E579
-E57A
-E57B
-E57C
-E57D
-E57E
-E57F
-E580
-E581
-E582
-E583
-E584
-E585
-E586
-E587
-E588
-E589
-E58A
-E58B
-E58C
-E58D
-E58E
-E58F
-E590
-E591
-E592
-E593
-E594
-E595
-E596
-E597
-E598
-E599
-E59A
-E59B
-E59C
-E59D
-E59E
-E59F
-E5A0
-E5A1
-E5A2
-E5A3
-E5A4
-E5A5
-E5A6
-E5A7
-E5A8
-E5A9
-E5AA
-E5AB
-E5AC
-E5AD
-E5AE
-E5AF
-E5B0
-E5B1
-E5B2
-E5B3
-E5B4
-E5B5
-E5B6
-E5B7
-E5B8
-E5B9
-E5BA
-E5BB
-E5BC
-E5BD
-E5BE
-E5BF
-E5C0
-E5C1
-E5C2
-E5C3
-E5C4
-E5C5
-E5C6
-E5C7
-E5C8
-E5C9
-E5CA
-E5CB
-E5CC
-E5CD
-E5CE
-E5CF
-E5D0
-E5D1
-E5D2
-E5D3
-E5D4
-E5D5
-E5D6
-E5D7
-E5D8
-E5D9
-E5DA
-E5DB
-E5DC
-E5DD
-E5DE
-E5DF
-E5E0
-E5E1
-E5E2
-E5E3
-E5E4
-E5E5
-E5E6
-E5E7
-E5E8
-E5E9
-E5EA
-E5EB
-E5EC
-E5ED
-E5EE
-E5EF
-E5F0
-E5F1
-E5F2
-E5F3
-E5F4
-E5F5
-E5F6
-E5F7
-E5F8
-E5F9
-E5FA
-E5FB
-E5FC
-E5FD
-E5FE
-E5FF
-E600
-E601
-E602
-E603
-E604
-E605
-E606
-E607
-E608
-E609
-E60A
-E60B
-E60C
-E60D
-E60E
-E60F
-E610
-E611
-E612
-E613
-E614
-E615
-E616
-E617
-E618
-E619
-E61A
-E61B
-E61C
-E61D
-E61E
-E61F
-E620
-E621
-E622
-E623
-E624
-E625
-E626
-E627
-E628
-E629
-E62A
-E62B
-E62C
-E62D
-E62E
-E62F
-E630
-E631
-E632
-E633
-E634
-E635
-E636
-E637
-E638
-E639
-E63A
-E63B
-E63C
-E63D
-E63E
-E63F
-E640
-E641
-E642
-E643
-E644
-E645
-E646
-E647
-E648
-E649
-E64A
-E64B
-E64C
-E64D
-E64E
-E64F
-E650
-E651
-E652
-E653
-E654
-E655
-E656
-E657
-E658
-E659
-E65A
-E65B
-E65C
-E65D
-E65E
-E65F
-E660
-E661
-E662
-E663
-E664
-E665
-E666
-E667
-E668
-E669
-E66A
-E66B
-E66C
-E66D
-E66E
-E66F
-E670
-E671
-E672
-E673
-E674
-E675
-E676
-E677
-E678
-E679
-E67A
-E67B
-E67C
-E67D
-E67E
-E67F
-E680
-E681
-E682
-E683
-E684
-E685
-E686
-E687
-E688
-E689
-E68A
-E68B
-E68C
-E68D
-E68E
-E68F
-E690
-E691
-E692
-E693
-E694
-E695
-E696
-E697
-E698
-E699
-E69A
-E69B
-E69C
-E69D
-E69E
-E69F
-E6A0
-E6A1
-E6A2
-E6A3
-E6A4
-E6A5
-E6A6
-E6A7
-E6A8
-E6A9
-E6AA
-E6AB
-E6AC
-E6AD
-E6AE
-E6AF
-E6B0
-E6B1
-E6B2
-E6B3
-E6B4
-E6B5
-E6B6
-E6B7
-E6B8
-E6B9
-E6BA
-E6BB
-E6BC
-E6BD
-E6BE
-E6BF
-E6C0
-E6C1
-E6C2
-E6C3
-E6C4
-E6C5
-E6C6
-E6C7
-E6C8
-E6C9
-E6CA
-E6CB
-E6CC
-E6CD
-E6CE
-E6CF
-E6D0
-E6D1
-E6D2
-E6D3
-E6D4
-E6D5
-E6D6
-E6D7
-E6D8
-E6D9
-E6DA
-E6DB
-E6DC
-E6DD
-E6DE
-E6DF
-E6E0
-E6E1
-E6E2
-E6E3
-E6E4
-E6E5
-E6E6
-E6E7
-E6E8
-E6E9
-E6EA
-E6EB
-E6EC
-E6ED
-E6EE
-E6EF
-E6F0
-E6F1
-E6F2
-E6F3
-E6F4
-E6F5
-E6F6
-E6F7
-E6F8
-E6F9
-E6FA
-E6FB
-E6FC
-E6FD
-E6FE
-E6FF
-E700
-E701
-E702
-E703
-E704
-E705
-E706
-E707
-E708
-E709
-E70A
-E70B
-E70C
-E70D
-E70E
-E70F
-E710
-E711
-E712
-E713
-E714
-E715
-E716
-E717
-E718
-E719
-E71A
-E71B
-E71C
-E71D
-E71E
-E71F
-E720
-E721
-E722
-E723
-E724
-E725
-E726
-E727
-E728
-E729
-E72A
-E72B
-E72C
-E72D
-E72E
-E72F
-E730
-E731
-E732
-E733
-E734
-E735
-E736
-E737
-E738
-E739
-E73A
-E73B
-E73C
-E73D
-E73E
-E73F
-E740
-E741
-E742
-E743
-E744
-E745
-E746
-E747
-E748
-E749
-E74A
-E74B
-E74C
-E74D
-E74E
-E74F
-E750
-E751
-E752
-E753
-E754
-E755
-E756
-E757
-CREATE TABLE t3 SELECT CONVERT(c1 USING cp932) AS c1 FROM t2;
-SELECT HEX(c1) FROM t3;
-HEX(c1)
-05
-7E
-815C
-815F
-8160
-8161
-817C
-8191
-8192
-81CA
-8740
-8741
-8742
-8743
-8744
-8745
-8746
-8747
-8748
-8749
-874A
-874B
-874C
-874D
-874E
-874F
-8750
-8751
-8752
-8753
-8754
-8755
-8756
-8757
-8758
-8759
-875A
-875B
-875C
-875D
-875F
-8760
-8761
-8762
-8763
-8764
-8765
-8766
-8767
-8768
-8769
-876A
-876B
-876C
-876D
-876E
-876F
-8770
-8771
-8772
-8773
-8774
-8775
-877E
-8780
-8781
-8782
-8783
-8784
-8785
-8786
-8787
-8788
-8789
-878A
-878B
-878C
-878D
-878E
-878F
-81E0
-81DF
-81E7
-8793
-8794
-81E3
-81DB
-81DA
-8798
-8799
-81E6
-81BF
-81BE
-FA5C
-FA5D
-FA5E
-FA5F
-FA60
-FA61
-FA62
-FA63
-FA64
-FA65
-FA66
-FA67
-FA68
-FA69
-FA6A
-FA6B
-FA6C
-FA6D
-FA6E
-FA6F
-FA70
-FA71
-FA72
-FA73
-FA74
-FA75
-FA76
-FA77
-FA78
-FA79
-FA7A
-FA7B
-FA7C
-FA7D
-FA7E
-FA80
-FA81
-FA82
-FA83
-FA84
-FA85
-FA86
-FA87
-FA88
-FA89
-FA8A
-FA8B
-FA8C
-FA8D
-FA8E
-FA8F
-FA90
-FA91
-FA92
-FA93
-FA94
-FA95
-FA96
-FA97
-FA98
-FA99
-FA9A
-FA9B
-FA9C
-FA9D
-FA9E
-FA9F
-FAA0
-FAA1
-FAA2
-FAA3
-FAA4
-FAA5
-FAA6
-FAA7
-FAA8
-FAA9
-FAAA
-FAAB
-FAAC
-FAAD
-FAAE
-FAAF
-FAB0
-FAB1
-FAB2
-FAB3
-FAB4
-FAB5
-FAB6
-FAB7
-FAB8
-FAB9
-FABA
-FABB
-FABC
-FABD
-FABE
-FABF
-FAC0
-FAC1
-FAC2
-FAC3
-FAC4
-FAC5
-FAC6
-FAC7
-FAC8
-FAC9
-FACA
-FACB
-FACC
-FACD
-FACE
-FACF
-FAD0
-FAD1
-FAD2
-FAD3
-FAD4
-FAD5
-FAD6
-FAD7
-FAD8
-FAD9
-FADA
-FADB
-FADC
-FADD
-FADE
-FADF
-FAE0
-FAE1
-FAE2
-FAE3
-FAE4
-FAE5
-FAE6
-FAE7
-FAE8
-FAE9
-FAEA
-FAEB
-FAEC
-FAED
-FAEE
-FAEF
-FAF0
-FAF1
-FAF2
-FAF3
-FAF4
-FAF5
-FAF6
-FAF7
-FAF8
-FAF9
-FAFA
-FAFB
-FAFC
-FB40
-FB41
-FB42
-FB43
-FB44
-FB45
-FB46
-FB47
-FB48
-FB49
-FB4A
-FB4B
-FB4C
-FB4D
-FB4E
-FB4F
-FB50
-FB51
-FB52
-FB53
-FB54
-FB55
-FB56
-FB57
-FB58
-FB59
-FB5A
-FB5B
-FB5C
-FB5D
-FB5E
-FB5F
-FB60
-FB61
-FB62
-FB63
-FB64
-FB65
-FB66
-FB67
-FB68
-FB69
-FB6A
-FB6B
-FB6C
-FB6D
-FB6E
-FB6F
-FB70
-FB71
-FB72
-FB73
-FB74
-FB75
-FB76
-FB77
-FB78
-FB79
-FB7A
-FB7B
-FB7C
-FB7D
-FB7E
-FB80
-FB81
-FB82
-FB83
-FB84
-FB85
-FB86
-FB87
-FB88
-FB89
-FB8A
-FB8B
-FB8C
-FB8D
-FB8E
-FB8F
-FB90
-FB91
-FB92
-FB93
-FB94
-FB95
-FB96
-FB97
-FB98
-FB99
-FB9A
-FB9B
-FB9C
-FB9D
-FB9E
-FB9F
-FBA0
-FBA1
-FBA2
-FBA3
-FBA4
-FBA5
-FBA6
-FBA7
-FBA8
-FBA9
-FBAA
-FBAB
-FBAC
-FBAD
-FBAE
-FBAF
-FBB0
-FBB1
-FBB2
-FBB3
-FBB4
-FBB5
-FBB6
-FBB7
-FBB8
-FBB9
-FBBA
-FBBB
-FBBC
-FBBD
-FBBE
-FBBF
-FBC0
-FBC1
-FBC2
-FBC3
-FBC4
-FBC5
-FBC6
-FBC7
-FBC8
-FBC9
-FBCA
-FBCB
-FBCC
-FBCD
-FBCE
-FBCF
-FBD0
-FBD1
-FBD2
-FBD3
-FBD4
-FBD5
-FBD6
-FBD7
-FBD8
-FBD9
-FBDA
-FBDB
-FBDC
-FBDD
-FBDE
-FBDF
-FBE0
-FBE1
-FBE2
-FBE3
-FBE4
-FBE5
-FBE6
-FBE7
-FBE8
-FBE9
-FBEA
-FBEB
-FBEC
-FBED
-FBEE
-FBEF
-FBF0
-FBF1
-FBF2
-FBF3
-FBF4
-FBF5
-FBF6
-FBF7
-FBF8
-FBF9
-FBFA
-FBFB
-FBFC
-FC40
-FC41
-FC42
-FC43
-FC44
-FC45
-FC46
-FC47
-FC48
-FC49
-FC4A
-FC4B
-FA40
-FA41
-FA42
-FA43
-FA44
-FA45
-FA46
-FA47
-FA48
-FA49
-81CA
-FA55
-FA56
-FA57
-FA40
-FA41
-FA42
-FA43
-FA44
-FA45
-FA46
-FA47
-FA48
-FA49
-8754
-8755
-8756
-8757
-8758
-8759
-875A
-875B
-875C
-875D
-81CA
-FA55
-FA56
-FA57
-878A
-8782
-8784
-81E6
-FA5C
-FA5D
-FA5E
-FA5F
-FA60
-FA61
-FA62
-FA63
-FA64
-FA65
-FA66
-FA67
-FA68
-FA69
-FA6A
-FA6B
-FA6C
-FA6D
-FA6E
-FA6F
-FA70
-FA71
-FA72
-FA73
-FA74
-FA75
-FA76
-FA77
-FA78
-FA79
-FA7A
-FA7B
-FA7C
-FA7D
-FA7E
-FA80
-FA81
-FA82
-FA83
-FA84
-FA85
-FA86
-FA87
-FA88
-FA89
-FA8A
-FA8B
-FA8C
-FA8D
-FA8E
-FA8F
-FA90
-FA91
-FA92
-FA93
-FA94
-FA95
-FA96
-FA97
-FA98
-FA99
-FA9A
-FA9B
-FA9C
-FA9D
-FA9E
-FA9F
-FAA0
-FAA1
-FAA2
-FAA3
-FAA4
-FAA5
-FAA6
-FAA7
-FAA8
-FAA9
-FAAA
-FAAB
-FAAC
-FAAD
-FAAE
-FAAF
-FAB0
-FAB1
-FAB2
-FAB3
-FAB4
-FAB5
-FAB6
-FAB7
-FAB8
-FAB9
-FABA
-FABB
-FABC
-FABD
-FABE
-FABF
-FAC0
-FAC1
-FAC2
-FAC3
-FAC4
-FAC5
-FAC6
-FAC7
-FAC8
-FAC9
-FACA
-FACB
-FACC
-FACD
-FACE
-FACF
-FAD0
-FAD1
-FAD2
-FAD3
-FAD4
-FAD5
-FAD6
-FAD7
-FAD8
-FAD9
-FADA
-FADB
-FADC
-FADD
-FADE
-FADF
-FAE0
-FAE1
-FAE2
-FAE3
-FAE4
-FAE5
-FAE6
-FAE7
-FAE8
-FAE9
-FAEA
-FAEB
-FAEC
-FAED
-FAEE
-FAEF
-FAF0
-FAF1
-FAF2
-FAF3
-FAF4
-FAF5
-FAF6
-FAF7
-FAF8
-FAF9
-FAFA
-FAFB
-FAFC
-FB40
-FB41
-FB42
-FB43
-FB44
-FB45
-FB46
-FB47
-FB48
-FB49
-FB4A
-FB4B
-FB4C
-FB4D
-FB4E
-FB4F
-FB50
-FB51
-FB52
-FB53
-FB54
-FB55
-FB56
-FB57
-FB58
-FB59
-FB5A
-FB5B
-FB5C
-FB5D
-FB5E
-FB5F
-FB60
-FB61
-FB62
-FB63
-FB64
-FB65
-FB66
-FB67
-FB68
-FB69
-FB6A
-FB6B
-FB6C
-FB6D
-FB6E
-FB6F
-FB70
-FB71
-FB72
-FB73
-FB74
-FB75
-FB76
-FB77
-FB78
-FB79
-FB7A
-FB7B
-FB7C
-FB7D
-FB7E
-FB80
-FB81
-FB82
-FB83
-FB84
-FB85
-FB86
-FB87
-FB88
-FB89
-FB8A
-FB8B
-FB8C
-FB8D
-FB8E
-FB8F
-FB90
-FB91
-FB92
-FB93
-FB94
-FB95
-FB96
-FB97
-FB98
-FB99
-FB9A
-FB9B
-FB9C
-FB9D
-FB9E
-FB9F
-FBA0
-FBA1
-FBA2
-FBA3
-FBA4
-FBA5
-FBA6
-FBA7
-FBA8
-FBA9
-FBAA
-FBAB
-FBAC
-FBAD
-FBAE
-FBAF
-FBB0
-FBB1
-FBB2
-FBB3
-FBB4
-FBB5
-FBB6
-FBB7
-FBB8
-FBB9
-FBBA
-FBBB
-FBBC
-FBBD
-FBBE
-FBBF
-FBC0
-FBC1
-FBC2
-FBC3
-FBC4
-FBC5
-FBC6
-FBC7
-FBC8
-FBC9
-FBCA
-FBCB
-FBCC
-FBCD
-FBCE
-FBCF
-FBD0
-FBD1
-FBD2
-FBD3
-FBD4
-FBD5
-FBD6
-FBD7
-FBD8
-FBD9
-FBDA
-FBDB
-FBDC
-FBDD
-FBDE
-FBDF
-FBE0
-FBE1
-FBE2
-FBE3
-FBE4
-FBE5
-FBE6
-FBE7
-FBE8
-FBE9
-FBEA
-FBEB
-FBEC
-FBED
-FBEE
-FBEF
-FBF0
-FBF1
-FBF2
-FBF3
-FBF4
-FBF5
-FBF6
-FBF7
-FBF8
-FBF9
-FBFA
-FBFB
-FBFC
-FC40
-FC41
-FC42
-FC43
-FC44
-FC45
-FC46
-FC47
-FC48
-FC49
-FC4A
-FC4B
-F040
-F041
-F042
-F043
-F044
-F045
-F046
-F047
-F048
-F049
-F04A
-F04B
-F04C
-F04D
-F04E
-F04F
-F050
-F051
-F052
-F053
-F054
-F055
-F056
-F057
-F058
-F059
-F05A
-F05B
-F05C
-F05D
-F05E
-F05F
-F060
-F061
-F062
-F063
-F064
-F065
-F066
-F067
-F068
-F069
-F06A
-F06B
-F06C
-F06D
-F06E
-F06F
-F070
-F071
-F072
-F073
-F074
-F075
-F076
-F077
-F078
-F079
-F07A
-F07B
-F07C
-F07D
-F07E
-F080
-F081
-F082
-F083
-F084
-F085
-F086
-F087
-F088
-F089
-F08A
-F08B
-F08C
-F08D
-F08E
-F08F
-F090
-F091
-F092
-F093
-F094
-F095
-F096
-F097
-F098
-F099
-F09A
-F09B
-F09C
-F09D
-F09E
-F09F
-F0A0
-F0A1
-F0A2
-F0A3
-F0A4
-F0A5
-F0A6
-F0A7
-F0A8
-F0A9
-F0AA
-F0AB
-F0AC
-F0AD
-F0AE
-F0AF
-F0B0
-F0B1
-F0B2
-F0B3
-F0B4
-F0B5
-F0B6
-F0B7
-F0B8
-F0B9
-F0BA
-F0BB
-F0BC
-F0BD
-F0BE
-F0BF
-F0C0
-F0C1
-F0C2
-F0C3
-F0C4
-F0C5
-F0C6
-F0C7
-F0C8
-F0C9
-F0CA
-F0CB
-F0CC
-F0CD
-F0CE
-F0CF
-F0D0
-F0D1
-F0D2
-F0D3
-F0D4
-F0D5
-F0D6
-F0D7
-F0D8
-F0D9
-F0DA
-F0DB
-F0DC
-F0DD
-F0DE
-F0DF
-F0E0
-F0E1
-F0E2
-F0E3
-F0E4
-F0E5
-F0E6
-F0E7
-F0E8
-F0E9
-F0EA
-F0EB
-F0EC
-F0ED
-F0EE
-F0EF
-F0F0
-F0F1
-F0F2
-F0F3
-F0F4
-F0F5
-F0F6
-F0F7
-F0F8
-F0F9
-F0FA
-F0FB
-F0FC
-F140
-F141
-F142
-F143
-F144
-F145
-F146
-F147
-F148
-F149
-F14A
-F14B
-F14C
-F14D
-F14E
-F14F
-F150
-F151
-F152
-F153
-F154
-F155
-F156
-F157
-F158
-F159
-F15A
-F15B
-F15C
-F15D
-F15E
-F15F
-F160
-F161
-F162
-F163
-F164
-F165
-F166
-F167
-F168
-F169
-F16A
-F16B
-F16C
-F16D
-F16E
-F16F
-F170
-F171
-F172
-F173
-F174
-F175
-F176
-F177
-F178
-F179
-F17A
-F17B
-F17C
-F17D
-F17E
-F180
-F181
-F182
-F183
-F184
-F185
-F186
-F187
-F188
-F189
-F18A
-F18B
-F18C
-F18D
-F18E
-F18F
-F190
-F191
-F192
-F193
-F194
-F195
-F196
-F197
-F198
-F199
-F19A
-F19B
-F19C
-F19D
-F19E
-F19F
-F1A0
-F1A1
-F1A2
-F1A3
-F1A4
-F1A5
-F1A6
-F1A7
-F1A8
-F1A9
-F1AA
-F1AB
-F1AC
-F1AD
-F1AE
-F1AF
-F1B0
-F1B1
-F1B2
-F1B3
-F1B4
-F1B5
-F1B6
-F1B7
-F1B8
-F1B9
-F1BA
-F1BB
-F1BC
-F1BD
-F1BE
-F1BF
-F1C0
-F1C1
-F1C2
-F1C3
-F1C4
-F1C5
-F1C6
-F1C7
-F1C8
-F1C9
-F1CA
-F1CB
-F1CC
-F1CD
-F1CE
-F1CF
-F1D0
-F1D1
-F1D2
-F1D3
-F1D4
-F1D5
-F1D6
-F1D7
-F1D8
-F1D9
-F1DA
-F1DB
-F1DC
-F1DD
-F1DE
-F1DF
-F1E0
-F1E1
-F1E2
-F1E3
-F1E4
-F1E5
-F1E6
-F1E7
-F1E8
-F1E9
-F1EA
-F1EB
-F1EC
-F1ED
-F1EE
-F1EF
-F1F0
-F1F1
-F1F2
-F1F3
-F1F4
-F1F5
-F1F6
-F1F7
-F1F8
-F1F9
-F1FA
-F1FB
-F1FC
-F240
-F241
-F242
-F243
-F244
-F245
-F246
-F247
-F248
-F249
-F24A
-F24B
-F24C
-F24D
-F24E
-F24F
-F250
-F251
-F252
-F253
-F254
-F255
-F256
-F257
-F258
-F259
-F25A
-F25B
-F25C
-F25D
-F25E
-F25F
-F260
-F261
-F262
-F263
-F264
-F265
-F266
-F267
-F268
-F269
-F26A
-F26B
-F26C
-F26D
-F26E
-F26F
-F270
-F271
-F272
-F273
-F274
-F275
-F276
-F277
-F278
-F279
-F27A
-F27B
-F27C
-F27D
-F27E
-F280
-F281
-F282
-F283
-F284
-F285
-F286
-F287
-F288
-F289
-F28A
-F28B
-F28C
-F28D
-F28E
-F28F
-F290
-F291
-F292
-F293
-F294
-F295
-F296
-F297
-F298
-F299
-F29A
-F29B
-F29C
-F29D
-F29E
-F29F
-F2A0
-F2A1
-F2A2
-F2A3
-F2A4
-F2A5
-F2A6
-F2A7
-F2A8
-F2A9
-F2AA
-F2AB
-F2AC
-F2AD
-F2AE
-F2AF
-F2B0
-F2B1
-F2B2
-F2B3
-F2B4
-F2B5
-F2B6
-F2B7
-F2B8
-F2B9
-F2BA
-F2BB
-F2BC
-F2BD
-F2BE
-F2BF
-F2C0
-F2C1
-F2C2
-F2C3
-F2C4
-F2C5
-F2C6
-F2C7
-F2C8
-F2C9
-F2CA
-F2CB
-F2CC
-F2CD
-F2CE
-F2CF
-F2D0
-F2D1
-F2D2
-F2D3
-F2D4
-F2D5
-F2D6
-F2D7
-F2D8
-F2D9
-F2DA
-F2DB
-F2DC
-F2DD
-F2DE
-F2DF
-F2E0
-F2E1
-F2E2
-F2E3
-F2E4
-F2E5
-F2E6
-F2E7
-F2E8
-F2E9
-F2EA
-F2EB
-F2EC
-F2ED
-F2EE
-F2EF
-F2F0
-F2F1
-F2F2
-F2F3
-F2F4
-F2F5
-F2F6
-F2F7
-F2F8
-F2F9
-F2FA
-F2FB
-F2FC
-F340
-F341
-F342
-F343
-F344
-F345
-F346
-F347
-F348
-F349
-F34A
-F34B
-F34C
-F34D
-F34E
-F34F
-F350
-F351
-F352
-F353
-F354
-F355
-F356
-F357
-F358
-F359
-F35A
-F35B
-F35C
-F35D
-F35E
-F35F
-F360
-F361
-F362
-F363
-F364
-F365
-F366
-F367
-F368
-F369
-F36A
-F36B
-F36C
-F36D
-F36E
-F36F
-F370
-F371
-F372
-F373
-F374
-F375
-F376
-F377
-F378
-F379
-F37A
-F37B
-F37C
-F37D
-F37E
-F380
-F381
-F382
-F383
-F384
-F385
-F386
-F387
-F388
-F389
-F38A
-F38B
-F38C
-F38D
-F38E
-F38F
-F390
-F391
-F392
-F393
-F394
-F395
-F396
-F397
-F398
-F399
-F39A
-F39B
-F39C
-F39D
-F39E
-F39F
-F3A0
-F3A1
-F3A2
-F3A3
-F3A4
-F3A5
-F3A6
-F3A7
-F3A8
-F3A9
-F3AA
-F3AB
-F3AC
-F3AD
-F3AE
-F3AF
-F3B0
-F3B1
-F3B2
-F3B3
-F3B4
-F3B5
-F3B6
-F3B7
-F3B8
-F3B9
-F3BA
-F3BB
-F3BC
-F3BD
-F3BE
-F3BF
-F3C0
-F3C1
-F3C2
-F3C3
-F3C4
-F3C5
-F3C6
-F3C7
-F3C8
-F3C9
-F3CA
-F3CB
-F3CC
-F3CD
-F3CE
-F3CF
-F3D0
-F3D1
-F3D2
-F3D3
-F3D4
-F3D5
-F3D6
-F3D7
-F3D8
-F3D9
-F3DA
-F3DB
-F3DC
-F3DD
-F3DE
-F3DF
-F3E0
-F3E1
-F3E2
-F3E3
-F3E4
-F3E5
-F3E6
-F3E7
-F3E8
-F3E9
-F3EA
-F3EB
-F3EC
-F3ED
-F3EE
-F3EF
-F3F0
-F3F1
-F3F2
-F3F3
-F3F4
-F3F5
-F3F6
-F3F7
-F3F8
-F3F9
-F3FA
-F3FB
-F3FC
-F440
-F441
-F442
-F443
-F444
-F445
-F446
-F447
-F448
-F449
-F44A
-F44B
-F44C
-F44D
-F44E
-F44F
-F450
-F451
-F452
-F453
-F454
-F455
-F456
-F457
-F458
-F459
-F45A
-F45B
-F45C
-F45D
-F45E
-F45F
-F460
-F461
-F462
-F463
-F464
-F465
-F466
-F467
-F468
-F469
-F46A
-F46B
-F46C
-F46D
-F46E
-F46F
-F470
-F471
-F472
-F473
-F474
-F475
-F476
-F477
-F478
-F479
-F47A
-F47B
-F47C
-F47D
-F47E
-F480
-F481
-F482
-F483
-F484
-F485
-F486
-F487
-F488
-F489
-F48A
-F48B
-F48C
-F48D
-F48E
-F48F
-F490
-F491
-F492
-F493
-F494
-F495
-F496
-F497
-F498
-F499
-F49A
-F49B
-F49C
-F49D
-F49E
-F49F
-F4A0
-F4A1
-F4A2
-F4A3
-F4A4
-F4A5
-F4A6
-F4A7
-F4A8
-F4A9
-F4AA
-F4AB
-F4AC
-F4AD
-F4AE
-F4AF
-F4B0
-F4B1
-F4B2
-F4B3
-F4B4
-F4B5
-F4B6
-F4B7
-F4B8
-F4B9
-F4BA
-F4BB
-F4BC
-F4BD
-F4BE
-F4BF
-F4C0
-F4C1
-F4C2
-F4C3
-F4C4
-F4C5
-F4C6
-F4C7
-F4C8
-F4C9
-F4CA
-F4CB
-F4CC
-F4CD
-F4CE
-F4CF
-F4D0
-F4D1
-F4D2
-F4D3
-F4D4
-F4D5
-F4D6
-F4D7
-F4D8
-F4D9
-F4DA
-F4DB
-F4DC
-F4DD
-F4DE
-F4DF
-F4E0
-F4E1
-F4E2
-F4E3
-F4E4
-F4E5
-F4E6
-F4E7
-F4E8
-F4E9
-F4EA
-F4EB
-F4EC
-F4ED
-F4EE
-F4EF
-F4F0
-F4F1
-F4F2
-F4F3
-F4F4
-F4F5
-F4F6
-F4F7
-F4F8
-F4F9
-F4FA
-F4FB
-F4FC
-F540
-F541
-F542
-F543
-F544
-F545
-F546
-F547
-F548
-F549
-F54A
-F54B
-F54C
-F54D
-F54E
-F54F
-F550
-F551
-F552
-F553
-F554
-F555
-F556
-F557
-F558
-F559
-F55A
-F55B
-F55C
-F55D
-F55E
-F55F
-F560
-F561
-F562
-F563
-F564
-F565
-F566
-F567
-F568
-F569
-F56A
-F56B
-F56C
-F56D
-F56E
-F56F
-F570
-F571
-F572
-F573
-F574
-F575
-F576
-F577
-F578
-F579
-F57A
-F57B
-F57C
-F57D
-F57E
-F580
-F581
-F582
-F583
-F584
-F585
-F586
-F587
-F588
-F589
-F58A
-F58B
-F58C
-F58D
-F58E
-F58F
-F590
-F591
-F592
-F593
-F594
-F595
-F596
-F597
-F598
-F599
-F59A
-F59B
-F59C
-F59D
-F59E
-F59F
-F5A0
-F5A1
-F5A2
-F5A3
-F5A4
-F5A5
-F5A6
-F5A7
-F5A8
-F5A9
-F5AA
-F5AB
-F5AC
-F5AD
-F5AE
-F5AF
-F5B0
-F5B1
-F5B2
-F5B3
-F5B4
-F5B5
-F5B6
-F5B7
-F5B8
-F5B9
-F5BA
-F5BB
-F5BC
-F5BD
-F5BE
-F5BF
-F5C0
-F5C1
-F5C2
-F5C3
-F5C4
-F5C5
-F5C6
-F5C7
-F5C8
-F5C9
-F5CA
-F5CB
-F5CC
-F5CD
-F5CE
-F5CF
-F5D0
-F5D1
-F5D2
-F5D3
-F5D4
-F5D5
-F5D6
-F5D7
-F5D8
-F5D9
-F5DA
-F5DB
-F5DC
-F5DD
-F5DE
-F5DF
-F5E0
-F5E1
-F5E2
-F5E3
-F5E4
-F5E5
-F5E6
-F5E7
-F5E8
-F5E9
-F5EA
-F5EB
-F5EC
-F5ED
-F5EE
-F5EF
-F5F0
-F5F1
-F5F2
-F5F3
-F5F4
-F5F5
-F5F6
-F5F7
-F5F8
-F5F9
-F5FA
-F5FB
-F5FC
-F640
-F641
-F642
-F643
-F644
-F645
-F646
-F647
-F648
-F649
-F64A
-F64B
-F64C
-F64D
-F64E
-F64F
-F650
-F651
-F652
-F653
-F654
-F655
-F656
-F657
-F658
-F659
-F65A
-F65B
-F65C
-F65D
-F65E
-F65F
-F660
-F661
-F662
-F663
-F664
-F665
-F666
-F667
-F668
-F669
-F66A
-F66B
-F66C
-F66D
-F66E
-F66F
-F670
-F671
-F672
-F673
-F674
-F675
-F676
-F677
-F678
-F679
-F67A
-F67B
-F67C
-F67D
-F67E
-F680
-F681
-F682
-F683
-F684
-F685
-F686
-F687
-F688
-F689
-F68A
-F68B
-F68C
-F68D
-F68E
-F68F
-F690
-F691
-F692
-F693
-F694
-F695
-F696
-F697
-F698
-F699
-F69A
-F69B
-F69C
-F69D
-F69E
-F69F
-F6A0
-F6A1
-F6A2
-F6A3
-F6A4
-F6A5
-F6A6
-F6A7
-F6A8
-F6A9
-F6AA
-F6AB
-F6AC
-F6AD
-F6AE
-F6AF
-F6B0
-F6B1
-F6B2
-F6B3
-F6B4
-F6B5
-F6B6
-F6B7
-F6B8
-F6B9
-F6BA
-F6BB
-F6BC
-F6BD
-F6BE
-F6BF
-F6C0
-F6C1
-F6C2
-F6C3
-F6C4
-F6C5
-F6C6
-F6C7
-F6C8
-F6C9
-F6CA
-F6CB
-F6CC
-F6CD
-F6CE
-F6CF
-F6D0
-F6D1
-F6D2
-F6D3
-F6D4
-F6D5
-F6D6
-F6D7
-F6D8
-F6D9
-F6DA
-F6DB
-F6DC
-F6DD
-F6DE
-F6DF
-F6E0
-F6E1
-F6E2
-F6E3
-F6E4
-F6E5
-F6E6
-F6E7
-F6E8
-F6E9
-F6EA
-F6EB
-F6EC
-F6ED
-F6EE
-F6EF
-F6F0
-F6F1
-F6F2
-F6F3
-F6F4
-F6F5
-F6F6
-F6F7
-F6F8
-F6F9
-F6FA
-F6FB
-F6FC
-F740
-F741
-F742
-F743
-F744
-F745
-F746
-F747
-F748
-F749
-F74A
-F74B
-F74C
-F74D
-F74E
-F74F
-F750
-F751
-F752
-F753
-F754
-F755
-F756
-F757
-F758
-F759
-F75A
-F75B
-F75C
-F75D
-F75E
-F75F
-F760
-F761
-F762
-F763
-F764
-F765
-F766
-F767
-F768
-F769
-F76A
-F76B
-F76C
-F76D
-F76E
-F76F
-F770
-F771
-F772
-F773
-F774
-F775
-F776
-F777
-F778
-F779
-F77A
-F77B
-F77C
-F77D
-F77E
-F780
-F781
-F782
-F783
-F784
-F785
-F786
-F787
-F788
-F789
-F78A
-F78B
-F78C
-F78D
-F78E
-F78F
-F790
-F791
-F792
-F793
-F794
-F795
-F796
-F797
-F798
-F799
-F79A
-F79B
-F79C
-F79D
-F79E
-F79F
-F7A0
-F7A1
-F7A2
-F7A3
-F7A4
-F7A5
-F7A6
-F7A7
-F7A8
-F7A9
-F7AA
-F7AB
-F7AC
-F7AD
-F7AE
-F7AF
-F7B0
-F7B1
-F7B2
-F7B3
-F7B4
-F7B5
-F7B6
-F7B7
-F7B8
-F7B9
-F7BA
-F7BB
-F7BC
-F7BD
-F7BE
-F7BF
-F7C0
-F7C1
-F7C2
-F7C3
-F7C4
-F7C5
-F7C6
-F7C7
-F7C8
-F7C9
-F7CA
-F7CB
-F7CC
-F7CD
-F7CE
-F7CF
-F7D0
-F7D1
-F7D2
-F7D3
-F7D4
-F7D5
-F7D6
-F7D7
-F7D8
-F7D9
-F7DA
-F7DB
-F7DC
-F7DD
-F7DE
-F7DF
-F7E0
-F7E1
-F7E2
-F7E3
-F7E4
-F7E5
-F7E6
-F7E7
-F7E8
-F7E9
-F7EA
-F7EB
-F7EC
-F7ED
-F7EE
-F7EF
-F7F0
-F7F1
-F7F2
-F7F3
-F7F4
-F7F5
-F7F6
-F7F7
-F7F8
-F7F9
-F7FA
-F7FB
-F7FC
-F840
-F841
-F842
-F843
-F844
-F845
-F846
-F847
-F848
-F849
-F84A
-F84B
-F84C
-F84D
-F84E
-F84F
-F850
-F851
-F852
-F853
-F854
-F855
-F856
-F857
-F858
-F859
-F85A
-F85B
-F85C
-F85D
-F85E
-F85F
-F860
-F861
-F862
-F863
-F864
-F865
-F866
-F867
-F868
-F869
-F86A
-F86B
-F86C
-F86D
-F86E
-F86F
-F870
-F871
-F872
-F873
-F874
-F875
-F876
-F877
-F878
-F879
-F87A
-F87B
-F87C
-F87D
-F87E
-F880
-F881
-F882
-F883
-F884
-F885
-F886
-F887
-F888
-F889
-F88A
-F88B
-F88C
-F88D
-F88E
-F88F
-F890
-F891
-F892
-F893
-F894
-F895
-F896
-F897
-F898
-F899
-F89A
-F89B
-F89C
-F89D
-F89E
-F89F
-F8A0
-F8A1
-F8A2
-F8A3
-F8A4
-F8A5
-F8A6
-F8A7
-F8A8
-F8A9
-F8AA
-F8AB
-F8AC
-F8AD
-F8AE
-F8AF
-F8B0
-F8B1
-F8B2
-F8B3
-F8B4
-F8B5
-F8B6
-F8B7
-F8B8
-F8B9
-F8BA
-F8BB
-F8BC
-F8BD
-F8BE
-F8BF
-F8C0
-F8C1
-F8C2
-F8C3
-F8C4
-F8C5
-F8C6
-F8C7
-F8C8
-F8C9
-F8CA
-F8CB
-F8CC
-F8CD
-F8CE
-F8CF
-F8D0
-F8D1
-F8D2
-F8D3
-F8D4
-F8D5
-F8D6
-F8D7
-F8D8
-F8D9
-F8DA
-F8DB
-F8DC
-F8DD
-F8DE
-F8DF
-F8E0
-F8E1
-F8E2
-F8E3
-F8E4
-F8E5
-F8E6
-F8E7
-F8E8
-F8E9
-F8EA
-F8EB
-F8EC
-F8ED
-F8EE
-F8EF
-F8F0
-F8F1
-F8F2
-F8F3
-F8F4
-F8F5
-F8F6
-F8F7
-F8F8
-F8F9
-F8FA
-F8FB
-F8FC
-F940
-F941
-F942
-F943
-F944
-F945
-F946
-F947
-F948
-F949
-F94A
-F94B
-F94C
-F94D
-F94E
-F94F
-F950
-F951
-F952
-F953
-F954
-F955
-F956
-F957
-F958
-F959
-F95A
-F95B
-F95C
-F95D
-F95E
-F95F
-F960
-F961
-F962
-F963
-F964
-F965
-F966
-F967
-F968
-F969
-F96A
-F96B
-F96C
-F96D
-F96E
-F96F
-F970
-F971
-F972
-F973
-F974
-F975
-F976
-F977
-F978
-F979
-F97A
-F97B
-F97C
-F97D
-F97E
-F980
-F981
-F982
-F983
-F984
-F985
-F986
-F987
-F988
-F989
-F98A
-F98B
-F98C
-F98D
-F98E
-F98F
-F990
-F991
-F992
-F993
-F994
-F995
-F996
-F997
-F998
-F999
-F99A
-F99B
-F99C
-F99D
-F99E
-F99F
-F9A0
-F9A1
-F9A2
-F9A3
-F9A4
-F9A5
-F9A6
-F9A7
-F9A8
-F9A9
-F9AA
-F9AB
-F9AC
-F9AD
-F9AE
-F9AF
-F9B0
-F9B1
-F9B2
-F9B3
-F9B4
-F9B5
-F9B6
-F9B7
-F9B8
-F9B9
-F9BA
-F9BB
-F9BC
-F9BD
-F9BE
-F9BF
-F9C0
-F9C1
-F9C2
-F9C3
-F9C4
-F9C5
-F9C6
-F9C7
-F9C8
-F9C9
-F9CA
-F9CB
-F9CC
-F9CD
-F9CE
-F9CF
-F9D0
-F9D1
-F9D2
-F9D3
-F9D4
-F9D5
-F9D6
-F9D7
-F9D8
-F9D9
-F9DA
-F9DB
-F9DC
-F9DD
-F9DE
-F9DF
-F9E0
-F9E1
-F9E2
-F9E3
-F9E4
-F9E5
-F9E6
-F9E7
-F9E8
-F9E9
-F9EA
-F9EB
-F9EC
-F9ED
-F9EE
-F9EF
-F9F0
-F9F1
-F9F2
-F9F3
-F9F4
-F9F5
-F9F6
-F9F7
-F9F8
-F9F9
-F9FA
-F9FB
-F9FC
-CREATE TABLE t4 SELECT CONVERT(c1 USING eucjpms) AS c1 FROM t1;
-SELECT HEX(c1) FROM t4;
-HEX(c1)
-05
-7E
-A1BD
-A1C0
-A1C1
-A1C2
-A1DD
-A1F1
-A1F2
-A2CC
-ADA1
-ADA2
-ADA3
-ADA4
-ADA5
-ADA6
-ADA7
-ADA8
-ADA9
-ADAA
-ADAB
-ADAC
-ADAD
-ADAE
-ADAF
-ADB0
-ADB1
-ADB2
-ADB3
-ADB4
-ADB5
-ADB6
-ADB7
-ADB8
-ADB9
-ADBA
-ADBB
-ADBC
-ADBD
-ADBE
-ADC0
-ADC1
-ADC2
-ADC3
-ADC4
-ADC5
-ADC6
-ADC7
-ADC8
-ADC9
-ADCA
-ADCB
-ADCC
-ADCD
-ADCE
-ADCF
-ADD0
-ADD1
-ADD2
-ADD3
-ADD4
-ADD5
-ADD6
-ADDF
-ADE0
-ADE1
-ADE2
-ADE3
-ADE4
-ADE5
-ADE6
-ADE7
-ADE8
-ADE9
-ADEA
-ADEB
-ADEC
-ADED
-ADEE
-ADEF
-A2E2
-A2E1
-A2E9
-ADF3
-ADF4
-A2E5
-A2DD
-A2DC
-ADF8
-ADF9
-A2E8
-A2C1
-A2C0
-8FD4E3
-8FDCDF
-8FE4E9
-8FE3F8
-8FD9A1
-8FB1BB
-8FF4AE
-8FC2AD
-8FC3FC
-8FE4D0
-8FC2BF
-8FBCF4
-8FB0A9
-8FB0C8
-8FF4AF
-8FB0D2
-8FB0D4
-8FB0E3
-8FB0EE
-8FB1A7
-8FB1A3
-8FB1AC
-8FB1A9
-8FB1BE
-8FB1DF
-8FB1D8
-8FB1C8
-8FB1D7
-8FB1E3
-8FB1F4
-8FB1E1
-8FB2A3
-8FF4B0
-8FB2BB
-8FB2E6
-8FB2ED
-8FB2F5
-8FB2FC
-8FF4B1
-8FB3B5
-8FB3D8
-8FB3DB
-8FB3E5
-8FB3EE
-8FB3FB
-8FF4B2
-8FF4B3
-8FB4C0
-8FB4C7
-8FB4D0
-8FB4DE
-8FF4B4
-8FB5AA
-8FF4B5
-8FB5AF
-8FB5C4
-8FB5E8
-8FF4B6
-8FB7C2
-8FB7E4
-8FB7E8
-8FB7E7
-8FF4B7
-8FF4B8
-8FF4B9
-8FB8CE
-8FB8E1
-8FB8F5
-8FB8F7
-8FB8F8
-8FB8FC
-8FB9AF
-8FB9B7
-8FBABE
-8FBADB
-8FCDAA
-8FBAE1
-8FF4BA
-8FBAEB
-8FBBB3
-8FBBB8
-8FF4BB
-8FBBCA
-8FF4BC
-8FF4BD
-8FBBD0
-8FBBDE
-8FBBF4
-8FBBF5
-8FBBF9
-8FBCE4
-8FBCED
-8FBCFE
-8FF4BE
-8FBDC2
-8FBDE7
-8FF4BF
-8FBDF0
-8FBEB0
-8FBEAC
-8FF4C0
-8FBEB3
-8FBEBD
-8FBECD
-8FBEC9
-8FBEE4
-8FBFA8
-8FBFC9
-8FC0C4
-8FC0E4
-8FC0F4
-8FC1A6
-8FF4C1
-8FC1F5
-8FC1FC
-8FF4C2
-8FC1F8
-8FC2AB
-8FC2A1
-8FC2A5
-8FF4C3
-8FC2B8
-8FC2BA
-8FF4C4
-8FC2C4
-8FC2D2
-8FC2D7
-8FC2DB
-8FC2DE
-8FC2ED
-8FC2F0
-8FF4C5
-8FC3A1
-8FC3B5
-8FC3C9
-8FC3B9
-8FF4C6
-8FC3D8
-8FC3FE
-8FF4C7
-8FC4CC
-8FF4C8
-8FC4D9
-8FC4EA
-8FC4FD
-8FF4C9
-8FC5A7
-8FC5B5
-8FC5B6
-8FF4CA
-8FC5D5
-8FC6B8
-8FC6D7
-8FC6E0
-8FC6EA
-8FC6E3
-8FC7A1
-8FC7AB
-8FC7C7
-8FC7C3
-8FC7CB
-8FC7CF
-8FC7D9
-8FF4CB
-8FF4CC
-8FC7E6
-8FC7EE
-8FC7FC
-8FC7EB
-8FC7F0
-8FC8B1
-8FC8E5
-8FC8F8
-8FC9A6
-8FC9AB
-8FC9AD
-8FF4CD
-8FC9CA
-8FC9D3
-8FC9E9
-8FC9E3
-8FC9FC
-8FC9F4
-8FC9F5
-8FF4CE
-8FCAB3
-8FCABD
-8FCAEF
-8FCAF1
-8FCBAE
-8FF4CF
-8FCBCA
-8FCBE6
-8FCBEA
-8FCBF0
-8FCBF4
-8FCBEE
-8FCCA5
-8FCBF9
-8FCCAB
-8FCCAE
-8FCCAD
-8FCCB2
-8FCCC2
-8FCCD0
-8FCCD9
-8FF4D0
-8FCDBB
-8FF4D1
-8FCEBB
-8FF4D2
-8FCEBA
-8FCEC3
-8FF4D3
-8FCEF2
-8FB3DD
-8FCFD5
-8FCFE2
-8FCFE9
-8FCFED
-8FF4D4
-8FF4D5
-8FF4D6
-8FF4D7
-8FD0E5
-8FF4D8
-8FD0E9
-8FD1E8
-8FF4D9
-8FF4DA
-8FD1EC
-8FD2BB
-8FF4DB
-8FD3E1
-8FD3E8
-8FD4A7
-8FF4DC
-8FF4DD
-8FD4D4
-8FD4F2
-8FD5AE
-8FF4DE
-8FD7DE
-8FF4DF
-8FD8A2
-8FD8B7
-8FD8C1
-8FD8D1
-8FD8F4
-8FD9C6
-8FD9C8
-8FD9D1
-8FF4E0
-8FF4E1
-8FF4E2
-8FF4E3
-8FF4E4
-8FDCD3
-8FDDC8
-8FDDD4
-8FDDEA
-8FDDFA
-8FDEA4
-8FDEB0
-8FF4E5
-8FDEB5
-8FDECB
-8FF4E6
-8FDFB9
-8FF4E7
-8FDFC3
-8FF4E8
-8FF4E9
-8FE0D9
-8FF4EA
-8FF4EB
-8FE1E2
-8FF4EC
-8FF4ED
-8FF4EE
-8FE2C7
-8FE3A8
-8FE3A6
-8FE3A9
-8FE3AF
-8FE3B0
-8FE3AA
-8FE3AB
-8FE3BC
-8FE3C1
-8FE3BF
-8FE3D5
-8FE3D8
-8FE3D6
-8FE3DF
-8FE3E3
-8FE3E1
-8FE3D4
-8FE3E9
-8FE4A6
-8FE3F1
-8FE3F2
-8FE4CB
-8FE4C1
-8FE4C3
-8FE4BE
-8FF4EF
-8FE4C0
-8FE4C7
-8FE4BF
-8FE4E0
-8FE4DE
-8FE4D1
-8FF4F0
-8FE4DC
-8FE4D2
-8FE4DB
-8FE4D4
-8FE4FA
-8FE4EF
-8FE5B3
-8FE5BF
-8FE5C9
-8FE5D0
-8FE5E2
-8FE5EA
-8FE5EB
-8FF4F1
-8FF4F2
-8FF4F3
-8FE6E8
-8FE6EF
-8FE7AC
-8FF4F4
-8FE7AE
-8FF4F5
-8FE7B1
-8FF4F6
-8FE7B2
-8FE8B1
-8FE8B6
-8FF4F7
-8FF4F8
-8FE8DD
-8FF4F9
-8FF4FA
-8FE9D1
-8FF4FB
-8FE9ED
-8FEACD
-8FF4FC
-8FEADB
-8FEAE6
-8FEAEA
-8FEBA5
-8FEBFB
-8FEBFA
-8FF4FD
-8FECD6
-8FF4FE
-8FF3F3
-8FF3F4
-8FF3F5
-8FF3F6
-8FF3F7
-8FF3F8
-8FF3F9
-8FF3FA
-8FF3FB
-8FF3FC
-A2CC
-8FA2C3
-8FF4A9
-8FF4AA
-8FF3F3
-8FF3F4
-8FF3F5
-8FF3F6
-8FF3F7
-8FF3F8
-8FF3F9
-8FF3FA
-8FF3FB
-8FF3FC
-ADB5
-ADB6
-ADB7
-ADB8
-ADB9
-ADBA
-ADBB
-ADBC
-ADBD
-ADBE
-A2CC
-8FA2C3
-8FF4A9
-8FF4AA
-ADEA
-ADE2
-ADE4
-A2E8
-8FD4E3
-8FDCDF
-8FE4E9
-8FE3F8
-8FD9A1
-8FB1BB
-8FF4AE
-8FC2AD
-8FC3FC
-8FE4D0
-8FC2BF
-8FBCF4
-8FB0A9
-8FB0C8
-8FF4AF
-8FB0D2
-8FB0D4
-8FB0E3
-8FB0EE
-8FB1A7
-8FB1A3
-8FB1AC
-8FB1A9
-8FB1BE
-8FB1DF
-8FB1D8
-8FB1C8
-8FB1D7
-8FB1E3
-8FB1F4
-8FB1E1
-8FB2A3
-8FF4B0
-8FB2BB
-8FB2E6
-8FB2ED
-8FB2F5
-8FB2FC
-8FF4B1
-8FB3B5
-8FB3D8
-8FB3DB
-8FB3E5
-8FB3EE
-8FB3FB
-8FF4B2
-8FF4B3
-8FB4C0
-8FB4C7
-8FB4D0
-8FB4DE
-8FF4B4
-8FB5AA
-8FF4B5
-8FB5AF
-8FB5C4
-8FB5E8
-8FF4B6
-8FB7C2
-8FB7E4
-8FB7E8
-8FB7E7
-8FF4B7
-8FF4B8
-8FF4B9
-8FB8CE
-8FB8E1
-8FB8F5
-8FB8F7
-8FB8F8
-8FB8FC
-8FB9AF
-8FB9B7
-8FBABE
-8FBADB
-8FCDAA
-8FBAE1
-8FF4BA
-8FBAEB
-8FBBB3
-8FBBB8
-8FF4BB
-8FBBCA
-8FF4BC
-8FF4BD
-8FBBD0
-8FBBDE
-8FBBF4
-8FBBF5
-8FBBF9
-8FBCE4
-8FBCED
-8FBCFE
-8FF4BE
-8FBDC2
-8FBDE7
-8FF4BF
-8FBDF0
-8FBEB0
-8FBEAC
-8FF4C0
-8FBEB3
-8FBEBD
-8FBECD
-8FBEC9
-8FBEE4
-8FBFA8
-8FBFC9
-8FC0C4
-8FC0E4
-8FC0F4
-8FC1A6
-8FF4C1
-8FC1F5
-8FC1FC
-8FF4C2
-8FC1F8
-8FC2AB
-8FC2A1
-8FC2A5
-8FF4C3
-8FC2B8
-8FC2BA
-8FF4C4
-8FC2C4
-8FC2D2
-8FC2D7
-8FC2DB
-8FC2DE
-8FC2ED
-8FC2F0
-8FF4C5
-8FC3A1
-8FC3B5
-8FC3C9
-8FC3B9
-8FF4C6
-8FC3D8
-8FC3FE
-8FF4C7
-8FC4CC
-8FF4C8
-8FC4D9
-8FC4EA
-8FC4FD
-8FF4C9
-8FC5A7
-8FC5B5
-8FC5B6
-8FF4CA
-8FC5D5
-8FC6B8
-8FC6D7
-8FC6E0
-8FC6EA
-8FC6E3
-8FC7A1
-8FC7AB
-8FC7C7
-8FC7C3
-8FC7CB
-8FC7CF
-8FC7D9
-8FF4CB
-8FF4CC
-8FC7E6
-8FC7EE
-8FC7FC
-8FC7EB
-8FC7F0
-8FC8B1
-8FC8E5
-8FC8F8
-8FC9A6
-8FC9AB
-8FC9AD
-8FF4CD
-8FC9CA
-8FC9D3
-8FC9E9
-8FC9E3
-8FC9FC
-8FC9F4
-8FC9F5
-8FF4CE
-8FCAB3
-8FCABD
-8FCAEF
-8FCAF1
-8FCBAE
-8FF4CF
-8FCBCA
-8FCBE6
-8FCBEA
-8FCBF0
-8FCBF4
-8FCBEE
-8FCCA5
-8FCBF9
-8FCCAB
-8FCCAE
-8FCCAD
-8FCCB2
-8FCCC2
-8FCCD0
-8FCCD9
-8FF4D0
-8FCDBB
-8FF4D1
-8FCEBB
-8FF4D2
-8FCEBA
-8FCEC3
-8FF4D3
-8FCEF2
-8FB3DD
-8FCFD5
-8FCFE2
-8FCFE9
-8FCFED
-8FF4D4
-8FF4D5
-8FF4D6
-8FF4D7
-8FD0E5
-8FF4D8
-8FD0E9
-8FD1E8
-8FF4D9
-8FF4DA
-8FD1EC
-8FD2BB
-8FF4DB
-8FD3E1
-8FD3E8
-8FD4A7
-8FF4DC
-8FF4DD
-8FD4D4
-8FD4F2
-8FD5AE
-8FF4DE
-8FD7DE
-8FF4DF
-8FD8A2
-8FD8B7
-8FD8C1
-8FD8D1
-8FD8F4
-8FD9C6
-8FD9C8
-8FD9D1
-8FF4E0
-8FF4E1
-8FF4E2
-8FF4E3
-8FF4E4
-8FDCD3
-8FDDC8
-8FDDD4
-8FDDEA
-8FDDFA
-8FDEA4
-8FDEB0
-8FF4E5
-8FDEB5
-8FDECB
-8FF4E6
-8FDFB9
-8FF4E7
-8FDFC3
-8FF4E8
-8FF4E9
-8FE0D9
-8FF4EA
-8FF4EB
-8FE1E2
-8FF4EC
-8FF4ED
-8FF4EE
-8FE2C7
-8FE3A8
-8FE3A6
-8FE3A9
-8FE3AF
-8FE3B0
-8FE3AA
-8FE3AB
-8FE3BC
-8FE3C1
-8FE3BF
-8FE3D5
-8FE3D8
-8FE3D6
-8FE3DF
-8FE3E3
-8FE3E1
-8FE3D4
-8FE3E9
-8FE4A6
-8FE3F1
-8FE3F2
-8FE4CB
-8FE4C1
-8FE4C3
-8FE4BE
-8FF4EF
-8FE4C0
-8FE4C7
-8FE4BF
-8FE4E0
-8FE4DE
-8FE4D1
-8FF4F0
-8FE4DC
-8FE4D2
-8FE4DB
-8FE4D4
-8FE4FA
-8FE4EF
-8FE5B3
-8FE5BF
-8FE5C9
-8FE5D0
-8FE5E2
-8FE5EA
-8FE5EB
-8FF4F1
-8FF4F2
-8FF4F3
-8FE6E8
-8FE6EF
-8FE7AC
-8FF4F4
-8FE7AE
-8FF4F5
-8FE7B1
-8FF4F6
-8FE7B2
-8FE8B1
-8FE8B6
-8FF4F7
-8FF4F8
-8FE8DD
-8FF4F9
-8FF4FA
-8FE9D1
-8FF4FB
-8FE9ED
-8FEACD
-8FF4FC
-8FEADB
-8FEAE6
-8FEAEA
-8FEBA5
-8FEBFB
-8FEBFA
-8FF4FD
-8FECD6
-8FF4FE
-F5A1
-F5A2
-F5A3
-F5A4
-F5A5
-F5A6
-F5A7
-F5A8
-F5A9
-F5AA
-F5AB
-F5AC
-F5AD
-F5AE
-F5AF
-F5B0
-F5B1
-F5B2
-F5B3
-F5B4
-F5B5
-F5B6
-F5B7
-F5B8
-F5B9
-F5BA
-F5BB
-F5BC
-F5BD
-F5BE
-F5BF
-F5C0
-F5C1
-F5C2
-F5C3
-F5C4
-F5C5
-F5C6
-F5C7
-F5C8
-F5C9
-F5CA
-F5CB
-F5CC
-F5CD
-F5CE
-F5CF
-F5D0
-F5D1
-F5D2
-F5D3
-F5D4
-F5D5
-F5D6
-F5D7
-F5D8
-F5D9
-F5DA
-F5DB
-F5DC
-F5DD
-F5DE
-F5DF
-F5E0
-F5E1
-F5E2
-F5E3
-F5E4
-F5E5
-F5E6
-F5E7
-F5E8
-F5E9
-F5EA
-F5EB
-F5EC
-F5ED
-F5EE
-F5EF
-F5F0
-F5F1
-F5F2
-F5F3
-F5F4
-F5F5
-F5F6
-F5F7
-F5F8
-F5F9
-F5FA
-F5FB
-F5FC
-F5FD
-F5FE
-F6A1
-F6A2
-F6A3
-F6A4
-F6A5
-F6A6
-F6A7
-F6A8
-F6A9
-F6AA
-F6AB
-F6AC
-F6AD
-F6AE
-F6AF
-F6B0
-F6B1
-F6B2
-F6B3
-F6B4
-F6B5
-F6B6
-F6B7
-F6B8
-F6B9
-F6BA
-F6BB
-F6BC
-F6BD
-F6BE
-F6BF
-F6C0
-F6C1
-F6C2
-F6C3
-F6C4
-F6C5
-F6C6
-F6C7
-F6C8
-F6C9
-F6CA
-F6CB
-F6CC
-F6CD
-F6CE
-F6CF
-F6D0
-F6D1
-F6D2
-F6D3
-F6D4
-F6D5
-F6D6
-F6D7
-F6D8
-F6D9
-F6DA
-F6DB
-F6DC
-F6DD
-F6DE
-F6DF
-F6E0
-F6E1
-F6E2
-F6E3
-F6E4
-F6E5
-F6E6
-F6E7
-F6E8
-F6E9
-F6EA
-F6EB
-F6EC
-F6ED
-F6EE
-F6EF
-F6F0
-F6F1
-F6F2
-F6F3
-F6F4
-F6F5
-F6F6
-F6F7
-F6F8
-F6F9
-F6FA
-F6FB
-F6FC
-F6FD
-F6FE
-F7A1
-F7A2
-F7A3
-F7A4
-F7A5
-F7A6
-F7A7
-F7A8
-F7A9
-F7AA
-F7AB
-F7AC
-F7AD
-F7AE
-F7AF
-F7B0
-F7B1
-F7B2
-F7B3
-F7B4
-F7B5
-F7B6
-F7B7
-F7B8
-F7B9
-F7BA
-F7BB
-F7BC
-F7BD
-F7BE
-F7BF
-F7C0
-F7C1
-F7C2
-F7C3
-F7C4
-F7C5
-F7C6
-F7C7
-F7C8
-F7C9
-F7CA
-F7CB
-F7CC
-F7CD
-F7CE
-F7CF
-F7D0
-F7D1
-F7D2
-F7D3
-F7D4
-F7D5
-F7D6
-F7D7
-F7D8
-F7D9
-F7DA
-F7DB
-F7DC
-F7DD
-F7DE
-F7DF
-F7E0
-F7E1
-F7E2
-F7E3
-F7E4
-F7E5
-F7E6
-F7E7
-F7E8
-F7E9
-F7EA
-F7EB
-F7EC
-F7ED
-F7EE
-F7EF
-F7F0
-F7F1
-F7F2
-F7F3
-F7F4
-F7F5
-F7F6
-F7F7
-F7F8
-F7F9
-F7FA
-F7FB
-F7FC
-F7FD
-F7FE
-F8A1
-F8A2
-F8A3
-F8A4
-F8A5
-F8A6
-F8A7
-F8A8
-F8A9
-F8AA
-F8AB
-F8AC
-F8AD
-F8AE
-F8AF
-F8B0
-F8B1
-F8B2
-F8B3
-F8B4
-F8B5
-F8B6
-F8B7
-F8B8
-F8B9
-F8BA
-F8BB
-F8BC
-F8BD
-F8BE
-F8BF
-F8C0
-F8C1
-F8C2
-F8C3
-F8C4
-F8C5
-F8C6
-F8C7
-F8C8
-F8C9
-F8CA
-F8CB
-F8CC
-F8CD
-F8CE
-F8CF
-F8D0
-F8D1
-F8D2
-F8D3
-F8D4
-F8D5
-F8D6
-F8D7
-F8D8
-F8D9
-F8DA
-F8DB
-F8DC
-F8DD
-F8DE
-F8DF
-F8E0
-F8E1
-F8E2
-F8E3
-F8E4
-F8E5
-F8E6
-F8E7
-F8E8
-F8E9
-F8EA
-F8EB
-F8EC
-F8ED
-F8EE
-F8EF
-F8F0
-F8F1
-F8F2
-F8F3
-F8F4
-F8F5
-F8F6
-F8F7
-F8F8
-F8F9
-F8FA
-F8FB
-F8FC
-F8FD
-F8FE
-F9A1
-F9A2
-F9A3
-F9A4
-F9A5
-F9A6
-F9A7
-F9A8
-F9A9
-F9AA
-F9AB
-F9AC
-F9AD
-F9AE
-F9AF
-F9B0
-F9B1
-F9B2
-F9B3
-F9B4
-F9B5
-F9B6
-F9B7
-F9B8
-F9B9
-F9BA
-F9BB
-F9BC
-F9BD
-F9BE
-F9BF
-F9C0
-F9C1
-F9C2
-F9C3
-F9C4
-F9C5
-F9C6
-F9C7
-F9C8
-F9C9
-F9CA
-F9CB
-F9CC
-F9CD
-F9CE
-F9CF
-F9D0
-F9D1
-F9D2
-F9D3
-F9D4
-F9D5
-F9D6
-F9D7
-F9D8
-F9D9
-F9DA
-F9DB
-F9DC
-F9DD
-F9DE
-F9DF
-F9E0
-F9E1
-F9E2
-F9E3
-F9E4
-F9E5
-F9E6
-F9E7
-F9E8
-F9E9
-F9EA
-F9EB
-F9EC
-F9ED
-F9EE
-F9EF
-F9F0
-F9F1
-F9F2
-F9F3
-F9F4
-F9F5
-F9F6
-F9F7
-F9F8
-F9F9
-F9FA
-F9FB
-F9FC
-F9FD
-F9FE
-FAA1
-FAA2
-FAA3
-FAA4
-FAA5
-FAA6
-FAA7
-FAA8
-FAA9
-FAAA
-FAAB
-FAAC
-FAAD
-FAAE
-FAAF
-FAB0
-FAB1
-FAB2
-FAB3
-FAB4
-FAB5
-FAB6
-FAB7
-FAB8
-FAB9
-FABA
-FABB
-FABC
-FABD
-FABE
-FABF
-FAC0
-FAC1
-FAC2
-FAC3
-FAC4
-FAC5
-FAC6
-FAC7
-FAC8
-FAC9
-FACA
-FACB
-FACC
-FACD
-FACE
-FACF
-FAD0
-FAD1
-FAD2
-FAD3
-FAD4
-FAD5
-FAD6
-FAD7
-FAD8
-FAD9
-FADA
-FADB
-FADC
-FADD
-FADE
-FADF
-FAE0
-FAE1
-FAE2
-FAE3
-FAE4
-FAE5
-FAE6
-FAE7
-FAE8
-FAE9
-FAEA
-FAEB
-FAEC
-FAED
-FAEE
-FAEF
-FAF0
-FAF1
-FAF2
-FAF3
-FAF4
-FAF5
-FAF6
-FAF7
-FAF8
-FAF9
-FAFA
-FAFB
-FAFC
-FAFD
-FAFE
-FBA1
-FBA2
-FBA3
-FBA4
-FBA5
-FBA6
-FBA7
-FBA8
-FBA9
-FBAA
-FBAB
-FBAC
-FBAD
-FBAE
-FBAF
-FBB0
-FBB1
-FBB2
-FBB3
-FBB4
-FBB5
-FBB6
-FBB7
-FBB8
-FBB9
-FBBA
-FBBB
-FBBC
-FBBD
-FBBE
-FBBF
-FBC0
-FBC1
-FBC2
-FBC3
-FBC4
-FBC5
-FBC6
-FBC7
-FBC8
-FBC9
-FBCA
-FBCB
-FBCC
-FBCD
-FBCE
-FBCF
-FBD0
-FBD1
-FBD2
-FBD3
-FBD4
-FBD5
-FBD6
-FBD7
-FBD8
-FBD9
-FBDA
-FBDB
-FBDC
-FBDD
-FBDE
-FBDF
-FBE0
-FBE1
-FBE2
-FBE3
-FBE4
-FBE5
-FBE6
-FBE7
-FBE8
-FBE9
-FBEA
-FBEB
-FBEC
-FBED
-FBEE
-FBEF
-FBF0
-FBF1
-FBF2
-FBF3
-FBF4
-FBF5
-FBF6
-FBF7
-FBF8
-FBF9
-FBFA
-FBFB
-FBFC
-FBFD
-FBFE
-FCA1
-FCA2
-FCA3
-FCA4
-FCA5
-FCA6
-FCA7
-FCA8
-FCA9
-FCAA
-FCAB
-FCAC
-FCAD
-FCAE
-FCAF
-FCB0
-FCB1
-FCB2
-FCB3
-FCB4
-FCB5
-FCB6
-FCB7
-FCB8
-FCB9
-FCBA
-FCBB
-FCBC
-FCBD
-FCBE
-FCBF
-FCC0
-FCC1
-FCC2
-FCC3
-FCC4
-FCC5
-FCC6
-FCC7
-FCC8
-FCC9
-FCCA
-FCCB
-FCCC
-FCCD
-FCCE
-FCCF
-FCD0
-FCD1
-FCD2
-FCD3
-FCD4
-FCD5
-FCD6
-FCD7
-FCD8
-FCD9
-FCDA
-FCDB
-FCDC
-FCDD
-FCDE
-FCDF
-FCE0
-FCE1
-FCE2
-FCE3
-FCE4
-FCE5
-FCE6
-FCE7
-FCE8
-FCE9
-FCEA
-FCEB
-FCEC
-FCED
-FCEE
-FCEF
-FCF0
-FCF1
-FCF2
-FCF3
-FCF4
-FCF5
-FCF6
-FCF7
-FCF8
-FCF9
-FCFA
-FCFB
-FCFC
-FCFD
-FCFE
-FDA1
-FDA2
-FDA3
-FDA4
-FDA5
-FDA6
-FDA7
-FDA8
-FDA9
-FDAA
-FDAB
-FDAC
-FDAD
-FDAE
-FDAF
-FDB0
-FDB1
-FDB2
-FDB3
-FDB4
-FDB5
-FDB6
-FDB7
-FDB8
-FDB9
-FDBA
-FDBB
-FDBC
-FDBD
-FDBE
-FDBF
-FDC0
-FDC1
-FDC2
-FDC3
-FDC4
-FDC5
-FDC6
-FDC7
-FDC8
-FDC9
-FDCA
-FDCB
-FDCC
-FDCD
-FDCE
-FDCF
-FDD0
-FDD1
-FDD2
-FDD3
-FDD4
-FDD5
-FDD6
-FDD7
-FDD8
-FDD9
-FDDA
-FDDB
-FDDC
-FDDD
-FDDE
-FDDF
-FDE0
-FDE1
-FDE2
-FDE3
-FDE4
-FDE5
-FDE6
-FDE7
-FDE8
-FDE9
-FDEA
-FDEB
-FDEC
-FDED
-FDEE
-FDEF
-FDF0
-FDF1
-FDF2
-FDF3
-FDF4
-FDF5
-FDF6
-FDF7
-FDF8
-FDF9
-FDFA
-FDFB
-FDFC
-FDFD
-FDFE
-FEA1
-FEA2
-FEA3
-FEA4
-FEA5
-FEA6
-FEA7
-FEA8
-FEA9
-FEAA
-FEAB
-FEAC
-FEAD
-FEAE
-FEAF
-FEB0
-FEB1
-FEB2
-FEB3
-FEB4
-FEB5
-FEB6
-FEB7
-FEB8
-FEB9
-FEBA
-FEBB
-FEBC
-FEBD
-FEBE
-FEBF
-FEC0
-FEC1
-FEC2
-FEC3
-FEC4
-FEC5
-FEC6
-FEC7
-FEC8
-FEC9
-FECA
-FECB
-FECC
-FECD
-FECE
-FECF
-FED0
-FED1
-FED2
-FED3
-FED4
-FED5
-FED6
-FED7
-FED8
-FED9
-FEDA
-FEDB
-FEDC
-FEDD
-FEDE
-FEDF
-FEE0
-FEE1
-FEE2
-FEE3
-FEE4
-FEE5
-FEE6
-FEE7
-FEE8
-FEE9
-FEEA
-FEEB
-FEEC
-FEED
-FEEE
-FEEF
-FEF0
-FEF1
-FEF2
-FEF3
-FEF4
-FEF5
-FEF6
-FEF7
-FEF8
-FEF9
-FEFA
-FEFB
-FEFC
-FEFD
-FEFE
-8FF5A1
-8FF5A2
-8FF5A3
-8FF5A4
-8FF5A5
-8FF5A6
-8FF5A7
-8FF5A8
-8FF5A9
-8FF5AA
-8FF5AB
-8FF5AC
-8FF5AD
-8FF5AE
-8FF5AF
-8FF5B0
-8FF5B1
-8FF5B2
-8FF5B3
-8FF5B4
-8FF5B5
-8FF5B6
-8FF5B7
-8FF5B8
-8FF5B9
-8FF5BA
-8FF5BB
-8FF5BC
-8FF5BD
-8FF5BE
-8FF5BF
-8FF5C0
-8FF5C1
-8FF5C2
-8FF5C3
-8FF5C4
-8FF5C5
-8FF5C6
-8FF5C7
-8FF5C8
-8FF5C9
-8FF5CA
-8FF5CB
-8FF5CC
-8FF5CD
-8FF5CE
-8FF5CF
-8FF5D0
-8FF5D1
-8FF5D2
-8FF5D3
-8FF5D4
-8FF5D5
-8FF5D6
-8FF5D7
-8FF5D8
-8FF5D9
-8FF5DA
-8FF5DB
-8FF5DC
-8FF5DD
-8FF5DE
-8FF5DF
-8FF5E0
-8FF5E1
-8FF5E2
-8FF5E3
-8FF5E4
-8FF5E5
-8FF5E6
-8FF5E7
-8FF5E8
-8FF5E9
-8FF5EA
-8FF5EB
-8FF5EC
-8FF5ED
-8FF5EE
-8FF5EF
-8FF5F0
-8FF5F1
-8FF5F2
-8FF5F3
-8FF5F4
-8FF5F5
-8FF5F6
-8FF5F7
-8FF5F8
-8FF5F9
-8FF5FA
-8FF5FB
-8FF5FC
-8FF5FD
-8FF5FE
-8FF6A1
-8FF6A2
-8FF6A3
-8FF6A4
-8FF6A5
-8FF6A6
-8FF6A7
-8FF6A8
-8FF6A9
-8FF6AA
-8FF6AB
-8FF6AC
-8FF6AD
-8FF6AE
-8FF6AF
-8FF6B0
-8FF6B1
-8FF6B2
-8FF6B3
-8FF6B4
-8FF6B5
-8FF6B6
-8FF6B7
-8FF6B8
-8FF6B9
-8FF6BA
-8FF6BB
-8FF6BC
-8FF6BD
-8FF6BE
-8FF6BF
-8FF6C0
-8FF6C1
-8FF6C2
-8FF6C3
-8FF6C4
-8FF6C5
-8FF6C6
-8FF6C7
-8FF6C8
-8FF6C9
-8FF6CA
-8FF6CB
-8FF6CC
-8FF6CD
-8FF6CE
-8FF6CF
-8FF6D0
-8FF6D1
-8FF6D2
-8FF6D3
-8FF6D4
-8FF6D5
-8FF6D6
-8FF6D7
-8FF6D8
-8FF6D9
-8FF6DA
-8FF6DB
-8FF6DC
-8FF6DD
-8FF6DE
-8FF6DF
-8FF6E0
-8FF6E1
-8FF6E2
-8FF6E3
-8FF6E4
-8FF6E5
-8FF6E6
-8FF6E7
-8FF6E8
-8FF6E9
-8FF6EA
-8FF6EB
-8FF6EC
-8FF6ED
-8FF6EE
-8FF6EF
-8FF6F0
-8FF6F1
-8FF6F2
-8FF6F3
-8FF6F4
-8FF6F5
-8FF6F6
-8FF6F7
-8FF6F8
-8FF6F9
-8FF6FA
-8FF6FB
-8FF6FC
-8FF6FD
-8FF6FE
-8FF7A1
-8FF7A2
-8FF7A3
-8FF7A4
-8FF7A5
-8FF7A6
-8FF7A7
-8FF7A8
-8FF7A9
-8FF7AA
-8FF7AB
-8FF7AC
-8FF7AD
-8FF7AE
-8FF7AF
-8FF7B0
-8FF7B1
-8FF7B2
-8FF7B3
-8FF7B4
-8FF7B5
-8FF7B6
-8FF7B7
-8FF7B8
-8FF7B9
-8FF7BA
-8FF7BB
-8FF7BC
-8FF7BD
-8FF7BE
-8FF7BF
-8FF7C0
-8FF7C1
-8FF7C2
-8FF7C3
-8FF7C4
-8FF7C5
-8FF7C6
-8FF7C7
-8FF7C8
-8FF7C9
-8FF7CA
-8FF7CB
-8FF7CC
-8FF7CD
-8FF7CE
-8FF7CF
-8FF7D0
-8FF7D1
-8FF7D2
-8FF7D3
-8FF7D4
-8FF7D5
-8FF7D6
-8FF7D7
-8FF7D8
-8FF7D9
-8FF7DA
-8FF7DB
-8FF7DC
-8FF7DD
-8FF7DE
-8FF7DF
-8FF7E0
-8FF7E1
-8FF7E2
-8FF7E3
-8FF7E4
-8FF7E5
-8FF7E6
-8FF7E7
-8FF7E8
-8FF7E9
-8FF7EA
-8FF7EB
-8FF7EC
-8FF7ED
-8FF7EE
-8FF7EF
-8FF7F0
-8FF7F1
-8FF7F2
-8FF7F3
-8FF7F4
-8FF7F5
-8FF7F6
-8FF7F7
-8FF7F8
-8FF7F9
-8FF7FA
-8FF7FB
-8FF7FC
-8FF7FD
-8FF7FE
-8FF8A1
-8FF8A2
-8FF8A3
-8FF8A4
-8FF8A5
-8FF8A6
-8FF8A7
-8FF8A8
-8FF8A9
-8FF8AA
-8FF8AB
-8FF8AC
-8FF8AD
-8FF8AE
-8FF8AF
-8FF8B0
-8FF8B1
-8FF8B2
-8FF8B3
-8FF8B4
-8FF8B5
-8FF8B6
-8FF8B7
-8FF8B8
-8FF8B9
-8FF8BA
-8FF8BB
-8FF8BC
-8FF8BD
-8FF8BE
-8FF8BF
-8FF8C0
-8FF8C1
-8FF8C2
-8FF8C3
-8FF8C4
-8FF8C5
-8FF8C6
-8FF8C7
-8FF8C8
-8FF8C9
-8FF8CA
-8FF8CB
-8FF8CC
-8FF8CD
-8FF8CE
-8FF8CF
-8FF8D0
-8FF8D1
-8FF8D2
-8FF8D3
-8FF8D4
-8FF8D5
-8FF8D6
-8FF8D7
-8FF8D8
-8FF8D9
-8FF8DA
-8FF8DB
-8FF8DC
-8FF8DD
-8FF8DE
-8FF8DF
-8FF8E0
-8FF8E1
-8FF8E2
-8FF8E3
-8FF8E4
-8FF8E5
-8FF8E6
-8FF8E7
-8FF8E8
-8FF8E9
-8FF8EA
-8FF8EB
-8FF8EC
-8FF8ED
-8FF8EE
-8FF8EF
-8FF8F0
-8FF8F1
-8FF8F2
-8FF8F3
-8FF8F4
-8FF8F5
-8FF8F6
-8FF8F7
-8FF8F8
-8FF8F9
-8FF8FA
-8FF8FB
-8FF8FC
-8FF8FD
-8FF8FE
-8FF9A1
-8FF9A2
-8FF9A3
-8FF9A4
-8FF9A5
-8FF9A6
-8FF9A7
-8FF9A8
-8FF9A9
-8FF9AA
-8FF9AB
-8FF9AC
-8FF9AD
-8FF9AE
-8FF9AF
-8FF9B0
-8FF9B1
-8FF9B2
-8FF9B3
-8FF9B4
-8FF9B5
-8FF9B6
-8FF9B7
-8FF9B8
-8FF9B9
-8FF9BA
-8FF9BB
-8FF9BC
-8FF9BD
-8FF9BE
-8FF9BF
-8FF9C0
-8FF9C1
-8FF9C2
-8FF9C3
-8FF9C4
-8FF9C5
-8FF9C6
-8FF9C7
-8FF9C8
-8FF9C9
-8FF9CA
-8FF9CB
-8FF9CC
-8FF9CD
-8FF9CE
-8FF9CF
-8FF9D0
-8FF9D1
-8FF9D2
-8FF9D3
-8FF9D4
-8FF9D5
-8FF9D6
-8FF9D7
-8FF9D8
-8FF9D9
-8FF9DA
-8FF9DB
-8FF9DC
-8FF9DD
-8FF9DE
-8FF9DF
-8FF9E0
-8FF9E1
-8FF9E2
-8FF9E3
-8FF9E4
-8FF9E5
-8FF9E6
-8FF9E7
-8FF9E8
-8FF9E9
-8FF9EA
-8FF9EB
-8FF9EC
-8FF9ED
-8FF9EE
-8FF9EF
-8FF9F0
-8FF9F1
-8FF9F2
-8FF9F3
-8FF9F4
-8FF9F5
-8FF9F6
-8FF9F7
-8FF9F8
-8FF9F9
-8FF9FA
-8FF9FB
-8FF9FC
-8FF9FD
-8FF9FE
-8FFAA1
-8FFAA2
-8FFAA3
-8FFAA4
-8FFAA5
-8FFAA6
-8FFAA7
-8FFAA8
-8FFAA9
-8FFAAA
-8FFAAB
-8FFAAC
-8FFAAD
-8FFAAE
-8FFAAF
-8FFAB0
-8FFAB1
-8FFAB2
-8FFAB3
-8FFAB4
-8FFAB5
-8FFAB6
-8FFAB7
-8FFAB8
-8FFAB9
-8FFABA
-8FFABB
-8FFABC
-8FFABD
-8FFABE
-8FFABF
-8FFAC0
-8FFAC1
-8FFAC2
-8FFAC3
-8FFAC4
-8FFAC5
-8FFAC6
-8FFAC7
-8FFAC8
-8FFAC9
-8FFACA
-8FFACB
-8FFACC
-8FFACD
-8FFACE
-8FFACF
-8FFAD0
-8FFAD1
-8FFAD2
-8FFAD3
-8FFAD4
-8FFAD5
-8FFAD6
-8FFAD7
-8FFAD8
-8FFAD9
-8FFADA
-8FFADB
-8FFADC
-8FFADD
-8FFADE
-8FFADF
-8FFAE0
-8FFAE1
-8FFAE2
-8FFAE3
-8FFAE4
-8FFAE5
-8FFAE6
-8FFAE7
-8FFAE8
-8FFAE9
-8FFAEA
-8FFAEB
-8FFAEC
-8FFAED
-8FFAEE
-8FFAEF
-8FFAF0
-8FFAF1
-8FFAF2
-8FFAF3
-8FFAF4
-8FFAF5
-8FFAF6
-8FFAF7
-8FFAF8
-8FFAF9
-8FFAFA
-8FFAFB
-8FFAFC
-8FFAFD
-8FFAFE
-8FFBA1
-8FFBA2
-8FFBA3
-8FFBA4
-8FFBA5
-8FFBA6
-8FFBA7
-8FFBA8
-8FFBA9
-8FFBAA
-8FFBAB
-8FFBAC
-8FFBAD
-8FFBAE
-8FFBAF
-8FFBB0
-8FFBB1
-8FFBB2
-8FFBB3
-8FFBB4
-8FFBB5
-8FFBB6
-8FFBB7
-8FFBB8
-8FFBB9
-8FFBBA
-8FFBBB
-8FFBBC
-8FFBBD
-8FFBBE
-8FFBBF
-8FFBC0
-8FFBC1
-8FFBC2
-8FFBC3
-8FFBC4
-8FFBC5
-8FFBC6
-8FFBC7
-8FFBC8
-8FFBC9
-8FFBCA
-8FFBCB
-8FFBCC
-8FFBCD
-8FFBCE
-8FFBCF
-8FFBD0
-8FFBD1
-8FFBD2
-8FFBD3
-8FFBD4
-8FFBD5
-8FFBD6
-8FFBD7
-8FFBD8
-8FFBD9
-8FFBDA
-8FFBDB
-8FFBDC
-8FFBDD
-8FFBDE
-8FFBDF
-8FFBE0
-8FFBE1
-8FFBE2
-8FFBE3
-8FFBE4
-8FFBE5
-8FFBE6
-8FFBE7
-8FFBE8
-8FFBE9
-8FFBEA
-8FFBEB
-8FFBEC
-8FFBED
-8FFBEE
-8FFBEF
-8FFBF0
-8FFBF1
-8FFBF2
-8FFBF3
-8FFBF4
-8FFBF5
-8FFBF6
-8FFBF7
-8FFBF8
-8FFBF9
-8FFBFA
-8FFBFB
-8FFBFC
-8FFBFD
-8FFBFE
-8FFCA1
-8FFCA2
-8FFCA3
-8FFCA4
-8FFCA5
-8FFCA6
-8FFCA7
-8FFCA8
-8FFCA9
-8FFCAA
-8FFCAB
-8FFCAC
-8FFCAD
-8FFCAE
-8FFCAF
-8FFCB0
-8FFCB1
-8FFCB2
-8FFCB3
-8FFCB4
-8FFCB5
-8FFCB6
-8FFCB7
-8FFCB8
-8FFCB9
-8FFCBA
-8FFCBB
-8FFCBC
-8FFCBD
-8FFCBE
-8FFCBF
-8FFCC0
-8FFCC1
-8FFCC2
-8FFCC3
-8FFCC4
-8FFCC5
-8FFCC6
-8FFCC7
-8FFCC8
-8FFCC9
-8FFCCA
-8FFCCB
-8FFCCC
-8FFCCD
-8FFCCE
-8FFCCF
-8FFCD0
-8FFCD1
-8FFCD2
-8FFCD3
-8FFCD4
-8FFCD5
-8FFCD6
-8FFCD7
-8FFCD8
-8FFCD9
-8FFCDA
-8FFCDB
-8FFCDC
-8FFCDD
-8FFCDE
-8FFCDF
-8FFCE0
-8FFCE1
-8FFCE2
-8FFCE3
-8FFCE4
-8FFCE5
-8FFCE6
-8FFCE7
-8FFCE8
-8FFCE9
-8FFCEA
-8FFCEB
-8FFCEC
-8FFCED
-8FFCEE
-8FFCEF
-8FFCF0
-8FFCF1
-8FFCF2
-8FFCF3
-8FFCF4
-8FFCF5
-8FFCF6
-8FFCF7
-8FFCF8
-8FFCF9
-8FFCFA
-8FFCFB
-8FFCFC
-8FFCFD
-8FFCFE
-8FFDA1
-8FFDA2
-8FFDA3
-8FFDA4
-8FFDA5
-8FFDA6
-8FFDA7
-8FFDA8
-8FFDA9
-8FFDAA
-8FFDAB
-8FFDAC
-8FFDAD
-8FFDAE
-8FFDAF
-8FFDB0
-8FFDB1
-8FFDB2
-8FFDB3
-8FFDB4
-8FFDB5
-8FFDB6
-8FFDB7
-8FFDB8
-8FFDB9
-8FFDBA
-8FFDBB
-8FFDBC
-8FFDBD
-8FFDBE
-8FFDBF
-8FFDC0
-8FFDC1
-8FFDC2
-8FFDC3
-8FFDC4
-8FFDC5
-8FFDC6
-8FFDC7
-8FFDC8
-8FFDC9
-8FFDCA
-8FFDCB
-8FFDCC
-8FFDCD
-8FFDCE
-8FFDCF
-8FFDD0
-8FFDD1
-8FFDD2
-8FFDD3
-8FFDD4
-8FFDD5
-8FFDD6
-8FFDD7
-8FFDD8
-8FFDD9
-8FFDDA
-8FFDDB
-8FFDDC
-8FFDDD
-8FFDDE
-8FFDDF
-8FFDE0
-8FFDE1
-8FFDE2
-8FFDE3
-8FFDE4
-8FFDE5
-8FFDE6
-8FFDE7
-8FFDE8
-8FFDE9
-8FFDEA
-8FFDEB
-8FFDEC
-8FFDED
-8FFDEE
-8FFDEF
-8FFDF0
-8FFDF1
-8FFDF2
-8FFDF3
-8FFDF4
-8FFDF5
-8FFDF6
-8FFDF7
-8FFDF8
-8FFDF9
-8FFDFA
-8FFDFB
-8FFDFC
-8FFDFD
-8FFDFE
-8FFEA1
-8FFEA2
-8FFEA3
-8FFEA4
-8FFEA5
-8FFEA6
-8FFEA7
-8FFEA8
-8FFEA9
-8FFEAA
-8FFEAB
-8FFEAC
-8FFEAD
-8FFEAE
-8FFEAF
-8FFEB0
-8FFEB1
-8FFEB2
-8FFEB3
-8FFEB4
-8FFEB5
-8FFEB6
-8FFEB7
-8FFEB8
-8FFEB9
-8FFEBA
-8FFEBB
-8FFEBC
-8FFEBD
-8FFEBE
-8FFEBF
-8FFEC0
-8FFEC1
-8FFEC2
-8FFEC3
-8FFEC4
-8FFEC5
-8FFEC6
-8FFEC7
-8FFEC8
-8FFEC9
-8FFECA
-8FFECB
-8FFECC
-8FFECD
-8FFECE
-8FFECF
-8FFED0
-8FFED1
-8FFED2
-8FFED3
-8FFED4
-8FFED5
-8FFED6
-8FFED7
-8FFED8
-8FFED9
-8FFEDA
-8FFEDB
-8FFEDC
-8FFEDD
-8FFEDE
-8FFEDF
-8FFEE0
-8FFEE1
-8FFEE2
-8FFEE3
-8FFEE4
-8FFEE5
-8FFEE6
-8FFEE7
-8FFEE8
-8FFEE9
-8FFEEA
-8FFEEB
-8FFEEC
-8FFEED
-8FFEEE
-8FFEEF
-8FFEF0
-8FFEF1
-8FFEF2
-8FFEF3
-8FFEF4
-8FFEF5
-8FFEF6
-8FFEF7
-8FFEF8
-8FFEF9
-8FFEFA
-8FFEFB
-8FFEFC
-8FFEFD
-8FFEFE
-DROP TABLE t1;
-DROP TABLE t2;
-DROP TABLE t3;
-DROP TABLE t4;
-SET collation_connection='cp932_japanese_ci';
-create table t1 select repeat('a',4000) a;
-delete from t1;
-insert into t1 values ('a'), ('a '), ('a\t');
-select collation(a),hex(a) from t1 order by a;
-collation(a) hex(a)
-cp932_japanese_ci 6109
-cp932_japanese_ci 61
-cp932_japanese_ci 6120
-drop table t1;
-SET collation_connection='cp932_bin';
-create table t1 select repeat('a',4000) a;
-delete from t1;
-insert into t1 values ('a'), ('a '), ('a\t');
-select collation(a),hex(a) from t1 order by a;
-collation(a) hex(a)
-cp932_bin 6109
-cp932_bin 61
-cp932_bin 6120
-drop table t1;
-create table t1 (col1 varchar(1)) character set cp932;
-insert into t1 values ('a');
-insert into t1 values ('ab');
-Warnings:
-Warning 1265 Data truncated for column 'col1' at row 1
-select * from t1;
-col1
-a
-a
-insert into t1 values ('abc');
-Warnings:
-Warning 1265 Data truncated for column 'col1' at row 1
-select * from t1;
-col1
-a
-a
-a
-drop table t1;
-set names utf8;
-create table t1 (a text) default character set cp932;
-insert into t1 values (_utf8 0xE38182);
-show warnings;
-Level Code Message
-select * from t1;
-a
-ã‚
-select hex(a) from t1;
-hex(a)
-82A0
-drop table t1;
-ƒ\
-ƒ\
-c_cp932
-ƒ\
-ƒ\
-ƒ\
-ソ
-ソ
-ƒ\
-ƒ\
diff --git a/mysql-test/r/binlog_stm_binlog.result b/mysql-test/r/binlog_stm_binlog.result
deleted file mode 100644
index 66fe3e40270..00000000000
--- a/mysql-test/r/binlog_stm_binlog.result
+++ /dev/null
@@ -1,237 +0,0 @@
-create table t1 (a int, b int) engine=innodb;
-begin;
-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 use `test`; BEGIN
-master-bin.000001 281 Query 1 90 use `test`; insert into t1 values (1,2)
-master-bin.000001 371 Xid 1 398 COMMIT /* XID */
-drop table t1;
-drop table if exists t1, t2;
-reset master;
-create table t1 (a int) engine=innodb;
-create table t2 (a int) engine=innodb;
-begin;
-insert t1 values (5);
-commit;
-begin;
-insert t2 values (5);
-commit;
-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) engine=innodb
-master-bin.000001 # Query # # use `test`; create table t2 (a int) engine=innodb
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; insert t1 values (5)
-master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; insert t2 values (5)
-master-bin.000001 # Xid # # COMMIT /* XID */
-drop table t1,t2;
-reset master;
-create table t1 (n int) engine=innodb;
-begin;
-commit;
-drop table t1;
-show binlog events in 'master-bin.000001' from 106;
-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 # use `test`; BEGIN
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(100 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(99 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(98 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(97 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(96 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(95 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(94 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(93 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(92 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(91 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(90 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(89 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(88 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(87 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(86 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(85 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(84 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(83 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(82 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(81 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(80 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(79 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(78 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(77 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(76 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(75 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(74 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(73 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(72 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(71 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(70 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(69 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(68 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(67 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(66 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(65 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(64 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(63 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(62 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(61 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(60 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(59 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(58 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(57 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(56 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(55 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(54 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(53 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(52 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(51 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(50 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(49 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(48 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(47 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(46 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(45 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(44 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(43 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(42 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(41 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(40 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(39 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(38 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(37 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(36 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(35 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(34 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(33 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(32 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(31 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(30 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(29 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(28 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(27 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(26 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(25 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(24 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(23 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(22 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(21 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(20 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(19 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(18 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(17 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(16 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(15 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(14 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(13 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(12 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(11 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(10 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(9 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(8 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(7 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(6 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(5 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(4 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(3 + 4)
-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;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000002 # Query 1 # use `test`; drop table t1
-reset master;
-create table t1 (id tinyint auto_increment primary key);
-set insert_id=128;
-insert into t1 values(null);
-Warnings:
-Warning 1264 Out of range value for column 'id' at row 1
-select * from t1;
-id
-127
-drop table t1;
-create table t1 (a int);
-create table if not exists t2 select * from t1;
-create temporary table tt1 (a int);
-create table if not exists t3 like tt1;
-USE mysql;
-INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test');
-UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@';
-DELETE FROM user WHERE host='localhost' AND user='@#@';
-use test;
-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 (id tinyint auto_increment primary key)
-master-bin.000001 # Intvar # # INSERT_ID=127
-master-bin.000001 # Query # # use `test`; insert into t1 values(null)
-master-bin.000001 # Query # # use `test`; drop table t1
-master-bin.000001 # Query # # use `test`; create table t1 (a int)
-master-bin.000001 # Query # # use `test`; create table if not exists t2 select * from t1
-master-bin.000001 # Query # # use `test`; create temporary table tt1 (a int)
-master-bin.000001 # Query # # use `test`; create table if not exists t3 like tt1
-master-bin.000001 # Query # # use `mysql`; INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test')
-master-bin.000001 # Query # # use `mysql`; UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@'
-master-bin.000001 # Query # # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@'
-drop table t1,t2,t3,tt1;
-create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
-set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
-insert delayed into t1 values (207);
-insert delayed into t1 values (null);
-insert delayed into t1 values (300);
-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 (id tinyint auto_increment primary key)
-master-bin.000001 # Intvar # # INSERT_ID=127
-master-bin.000001 # Query # # use `test`; insert into t1 values(null)
-master-bin.000001 # Query # # use `test`; drop table t1
-master-bin.000001 # Query # # use `test`; create table t1 (a int)
-master-bin.000001 # Query # # use `test`; create table if not exists t2 select * from t1
-master-bin.000001 # Query # # use `test`; create temporary table tt1 (a int)
-master-bin.000001 # Query # # use `test`; create table if not exists t3 like tt1
-master-bin.000001 # Query # # use `mysql`; INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test')
-master-bin.000001 # Query # # use `mysql`; UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@'
-master-bin.000001 # Query # # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@'
-master-bin.000001 # Query # # use `test`; drop table t1,t2,t3,tt1
-master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam
-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 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-insert delayed into t1 values (null),(null),(null),(null);
-insert delayed into t1 values (null),(null),(400),(null);
-11 == 11
-select * from t1;
-a
-207
-208
-300
-301
-302
-303
-304
-305
-306
-400
-401
-drop table t1;
-reset master;
-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
-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
-drop table t3;
diff --git a/mysql-test/r/binlog_stm_blackhole.result b/mysql-test/r/binlog_stm_blackhole.result
deleted file mode 100644
index bf2fdfa616b..00000000000
--- a/mysql-test/r/binlog_stm_blackhole.result
+++ /dev/null
@@ -1,152 +0,0 @@
-drop table if exists t1,t2;
-CREATE TABLE t1 (
-Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
-Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
-) ENGINE=blackhole;
-INSERT INTO t1 VALUES (9410,9412);
-select period from t1;
-period
-select * from t1;
-Period Varor_period
-select t1.* from t1;
-Period Varor_period
-CREATE TABLE t2 (
-auto int NOT NULL auto_increment,
-fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL,
-companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL,
-fld3 char(30) DEFAULT '' NOT NULL,
-fld4 char(35) DEFAULT '' NOT NULL,
-fld5 char(35) DEFAULT '' NOT NULL,
-fld6 char(4) DEFAULT '' NOT NULL,
-primary key (auto)
-) ENGINE=blackhole;
-INSERT INTO t2 VALUES (1192,068305,00,'Colombo','hardware','colicky','');
-INSERT INTO t2 VALUES (1193,000000,00,'nondecreasing','implant','thrillingly','');
-select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%";
-fld3
-select fld3 from t2 where fld3 like "%cultivation" ;
-fld3
-select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3;
-fld3 companynr
-select fld3,companynr from t2 where companynr = 58 order by fld3;
-fld3 companynr
-select fld3 from t2 order by fld3 desc limit 10;
-fld3
-select fld3 from t2 order by fld3 desc limit 5;
-fld3
-select fld3 from t2 order by fld3 desc limit 5,5;
-fld3
-select t2.fld3 from t2 where fld3 = 'honeysuckle';
-fld3
-select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_';
-fld3
-select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_';
-fld3
-select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%';
-fld3
-select t2.fld3 from t2 where fld3 LIKE 'h%le';
-fld3
-select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_';
-fld3
-select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%';
-fld3
-select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
-fld3
-select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3;
-fld1 fld3
-DROP TABLE t1;
-CREATE TABLE t1 (a VARCHAR(200), b TEXT, FULLTEXT (a,b));
-INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'),
-('Full-text indexes', 'are called collections'),
-('Only MyISAM tables','support collections'),
-('Function MATCH ... AGAINST()','is used to do a search'),
-('Full-text search in MySQL', 'implements vector space model');
-SHOW INDEX FROM t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 1 a 1 a NULL NULL NULL NULL YES FULLTEXT
-t1 1 a 2 b NULL NULL NULL NULL YES FULLTEXT
-select * from t1 where MATCH(a,b) AGAINST ("collections");
-a b
-Only MyISAM tables support collections
-Full-text indexes are called collections
-explain extended select * from t1 where MATCH(a,b) AGAINST ("collections");
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 fulltext a a 0 1 100.00 Using where
-Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (match `test`.`t1`.`a`,`test`.`t1`.`b` against (_latin1'collections'))
-select * from t1 where MATCH(a,b) AGAINST ("indexes");
-a b
-Full-text indexes are called collections
-select * from t1 where MATCH(a,b) AGAINST ("indexes collections");
-a b
-Full-text indexes are called collections
-Only MyISAM tables support collections
-select * from t1 where MATCH(a,b) AGAINST ("only");
-a b
-reset master;
-drop table t1,t2;
-create table t1 (a int) engine=blackhole;
-delete from t1 where a=10;
-update t1 set a=11 where a=15;
-insert into t1 values(1);
-insert ignore into t1 values(1);
-replace into t1 values(100);
-create table t2 (a varchar(200)) engine=blackhole;
-load data infile '../std_data_ln/words.dat' into table t2;
-alter table t1 add b int;
-alter table t1 drop b;
-create table t3 like t1;
-insert into t1 select * from t3;
-replace into t1 select * from t3;
-select * from t1;
-a
-select * from t2;
-a
-select * from t3;
-a
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; drop table t1,t2
-master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=blackhole
-master-bin.000001 # Query # # use `test`; delete from t1 where a=10
-master-bin.000001 # Query # # use `test`; update t1 set a=11 where a=15
-master-bin.000001 # Query # # use `test`; insert into t1 values(1)
-master-bin.000001 # Query # # use `test`; insert ignore into t1 values(1)
-master-bin.000001 # Query # # use `test`; replace into t1 values(100)
-master-bin.000001 # Query # # use `test`; create table t2 (a varchar(200)) engine=blackhole
-master-bin.000001 # Begin_load_query # # ;file_id=1;block_len=581
-master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/words.dat' into table t2 ;file_id=1
-master-bin.000001 # Query # # use `test`; alter table t1 add b int
-master-bin.000001 # Query # # use `test`; alter table t1 drop b
-master-bin.000001 # Query # # use `test`; create table t3 like t1
-master-bin.000001 # Query # # use `test`; insert into t1 select * from t3
-master-bin.000001 # Query # # use `test`; replace into t1 select * from t3
-drop table t1,t2,t3;
-CREATE TABLE t1(a INT, b INT) ENGINE=BLACKHOLE;
-DELETE FROM t1 WHERE a=10;
-ALTER TABLE t1 ADD INDEX(a);
-DELETE FROM t1 WHERE a=10;
-ALTER TABLE t1 DROP INDEX a;
-ALTER TABLE t1 ADD UNIQUE INDEX(a);
-DELETE FROM t1 WHERE a=10;
-ALTER TABLE t1 DROP INDEX a;
-ALTER TABLE t1 ADD PRIMARY KEY(a);
-DELETE FROM t1 WHERE a=10;
-DROP TABLE t1;
-reset master;
-create table t1 (a int) engine=blackhole;
-set autocommit=0;
-start transaction;
-insert into t1 values(1);
-commit;
-start transaction;
-insert into t1 values(2);
-rollback;
-set autocommit=1;
-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) engine=blackhole
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; insert into t1 values(1)
-master-bin.000001 # Query # # use `test`; COMMIT
-drop table if exists t1;
diff --git a/mysql-test/r/binlog_stm_ctype_cp932.result b/mysql-test/r/binlog_stm_ctype_cp932.result
deleted file mode 100755
index ca70f98c0e6..00000000000
--- a/mysql-test/r/binlog_stm_ctype_cp932.result
+++ /dev/null
@@ -1,11377 +0,0 @@
-drop table if exists t1;
-drop table if exists t2;
-drop table if exists t3;
-drop table if exists t4;
-set names cp932;
-set character_set_database = cp932;
-CREATE TABLE t1(c1 CHAR(1)) DEFAULT CHARACTER SET = cp932;
-INSERT INTO t1 VALUES
-(0x05),(0x7E),(0x815C),(0x815F),(0x8160),(0x8161),(0x817C),(0x8191),(0x8192),(0x81CA);
-INSERT INTO t1 VALUES
-(0x8740),(0x8741),(0x8742),(0x8743),(0x8744),(0x8745),(0x8746),(0x8747),
-(0x8748),(0x8749),(0x874A),(0x874B),(0x874C),(0x874D),(0x874E),(0x874F),
-(0x8750),(0x8751),(0x8752),(0x8753),(0x8754),(0x8755),(0x8756),(0x8757),
-(0x8758),(0x8759),(0x875A),(0x875B),(0x875C),(0x875D),(0x875F),
-(0x8760),(0x8761),(0x8762),(0x8763),(0x8764),(0x8765),(0x8766),(0x8767),
-(0x8768),(0x8769),(0x876A),(0x876B),(0x876C),(0x876D),(0x876E),(0x876F),
-(0x8770),(0x8771),(0x8772),(0x8773),(0x8774),(0x8775),(0x877E),
-(0x8780),(0x8781),(0x8782),(0x8783),(0x8784),(0x8785),(0x8786),(0x8787),
-(0x8788),(0x8789),(0x878A),(0x878B),(0x878C),(0x878D),(0x878E),(0x878F),
-(0x8790),(0x8791),(0x8792),(0x8793),(0x8794),(0x8795),(0x8796),(0x8797),
-(0x8798),(0x8799),(0x879A),(0x879B),(0x879C);
-INSERT INTO t1 VALUES
-(0xED40),(0xED41),(0xED42),(0xED43),(0xED44),(0xED45),(0xED46),(0xED47),
-(0xED48),(0xED49),(0xED4A),(0xED4B),(0xED4C),(0xED4D),(0xED4E),(0xED4F),
-(0xED50),(0xED51),(0xED52),(0xED53),(0xED54),(0xED55),(0xED56),(0xED57),
-(0xED58),(0xED59),(0xED5A),(0xED5B),(0xED5C),(0xED5D),(0xED5E),(0xED5F),
-(0xED60),(0xED61),(0xED62),(0xED63),(0xED64),(0xED65),(0xED66),(0xED67),
-(0xED68),(0xED69),(0xED6A),(0xED6B),(0xED6C),(0xED6D),(0xED6E),(0xED6F),
-(0xED70),(0xED71),(0xED72),(0xED73),(0xED74),(0xED75),(0xED76),(0xED77),
-(0xED78),(0xED79),(0xED7A),(0xED7B),(0xED7C),(0xED7D),(0xED7E),
-(0xED80),(0xED81),(0xED82),(0xED83),(0xED84),(0xED85),(0xED86),(0xED87),
-(0xED88),(0xED89),(0xED8A),(0xED8B),(0xED8C),(0xED8D),(0xED8E),(0xED8F),
-(0xED90),(0xED91),(0xED92),(0xED93),(0xED94),(0xED95),(0xED96),(0xED97),
-(0xED98),(0xED99),(0xED9A),(0xED9B),(0xED9C),(0xED9D),(0xED9E),(0xED9F),
-(0xEDA0),(0xEDA1),(0xEDA2),(0xEDA3),(0xEDA4),(0xEDA5),(0xEDA6),(0xEDA7),
-(0xEDA8),(0xEDA9),(0xEDAA),(0xEDAB),(0xEDAC),(0xEDAD),(0xEDAE),(0xEDAF),
-(0xEDB0),(0xEDB1),(0xEDB2),(0xEDB3),(0xEDB4),(0xEDB5),(0xEDB6),(0xEDB7),
-(0xEDB8),(0xEDB9),(0xEDBA),(0xEDBB),(0xEDBC),(0xEDBD),(0xEDBE),(0xEDBF),
-(0xEDC0),(0xEDC1),(0xEDC2),(0xEDC3),(0xEDC4),(0xEDC5),(0xEDC6),(0xEDC7),
-(0xEDC8),(0xEDC9),(0xEDCA),(0xEDCB),(0xEDCC),(0xEDCD),(0xEDCE),(0xEDCF),
-(0xEDD0),(0xEDD1),(0xEDD2),(0xEDD3),(0xEDD4),(0xEDD5),(0xEDD6),(0xEDD7),
-(0xEDD8),(0xEDD9),(0xEDDA),(0xEDDB),(0xEDDC),(0xEDDD),(0xEDDE),(0xEDDF),
-(0xEDE0),(0xEDE1),(0xEDE2),(0xEDE3),(0xEDE4),(0xEDE5),(0xEDE6),(0xEDE7),
-(0xEDE8),(0xEDE9),(0xEDEA),(0xEDEB),(0xEDEC),(0xEDED),(0xEDEE),(0xEDEF),
-(0xEDF0),(0xEDF1),(0xEDF2),(0xEDF3),(0xEDF4),(0xEDF5),(0xEDF6),(0xEDF7),
-(0xEDF8),(0xEDF9),(0xEDFA),(0xEDFB),(0xEDFC),
-(0xEE40),(0xEE41),(0xEE42),(0xEE43),(0xEE44),(0xEE45),(0xEE46),(0xEE47),
-(0xEE48),(0xEE49),(0xEE4A),(0xEE4B),(0xEE4C),(0xEE4D),(0xEE4E),(0xEE4F),
-(0xEE50),(0xEE51),(0xEE52),(0xEE53),(0xEE54),(0xEE55),(0xEE56),(0xEE57),
-(0xEE58),(0xEE59),(0xEE5A),(0xEE5B),(0xEE5C),(0xEE5D),(0xEE5E),(0xEE5F),
-(0xEE60),(0xEE61),(0xEE62),(0xEE63),(0xEE64),(0xEE65),(0xEE66),(0xEE67),
-(0xEE68),(0xEE69),(0xEE6A),(0xEE6B),(0xEE6C),(0xEE6D),(0xEE6E),(0xEE6F),
-(0xEE70),(0xEE71),(0xEE72),(0xEE73),(0xEE74),(0xEE75),(0xEE76),(0xEE77),
-(0xEE78),(0xEE79),(0xEE7A),(0xEE7B),(0xEE7C),(0xEE7D),(0xEE7E),
-(0xEE80),(0xEE81),(0xEE82),(0xEE83),(0xEE84),(0xEE85),(0xEE86),(0xEE87),
-(0xEE88),(0xEE89),(0xEE8A),(0xEE8B),(0xEE8C),(0xEE8D),(0xEE8E),(0xEE8F),
-(0xEE90),(0xEE91),(0xEE92),(0xEE93),(0xEE94),(0xEE95),(0xEE96),(0xEE97),
-(0xEE98),(0xEE99),(0xEE9A),(0xEE9B),(0xEE9C),(0xEE9D),(0xEE9E),(0xEE9F),
-(0xEEA0),(0xEEA1),(0xEEA2),(0xEEA3),(0xEEA4),(0xEEA5),(0xEEA6),(0xEEA7),
-(0xEEA8),(0xEEA9),(0xEEAA),(0xEEAB),(0xEEAC),(0xEEAD),(0xEEAE),(0xEEAF),
-(0xEEB0),(0xEEB1),(0xEEB2),(0xEEB3),(0xEEB4),(0xEEB5),(0xEEB6),(0xEEB7),
-(0xEEB8),(0xEEB9),(0xEEBA),(0xEEBB),(0xEEBC),(0xEEBD),(0xEEBE),(0xEEBF),
-(0xEEC0),(0xEEC1),(0xEEC2),(0xEEC3),(0xEEC4),(0xEEC5),(0xEEC6),(0xEEC7),
-(0xEEC8),(0xEEC9),(0xEECA),(0xEECB),(0xEECC),(0xEECD),(0xEECE),(0xEECF),
-(0xEED0),(0xEED1),(0xEED2),(0xEED3),(0xEED4),(0xEED5),(0xEED6),(0xEED7),
-(0xEED8),(0xEED9),(0xEEDA),(0xEEDB),(0xEEDC),(0xEEDD),(0xEEDE),(0xEEDF),
-(0xEEE0),(0xEEE1),(0xEEE2),(0xEEE3),(0xEEE4),(0xEEE5),(0xEEE6),(0xEEE7),
-(0xEEE8),(0xEEE9),(0xEEEA),(0xEEEB),(0xEEEC),(0xEEEF),
-(0xEEF0),(0xEEF1),(0xEEF2),(0xEEF3),(0xEEF4),(0xEEF5),(0xEEF6),(0xEEF7),
-(0xEEF8),(0xEEF9),(0xEEFA),(0xEEFB),(0xEEFC);
-INSERT INTO t1 VALUES
-(0xFA40),(0xFA41),(0xFA42),(0xFA43),(0xFA44),(0xFA45),(0xFA46),(0xFA47),
-(0xFA48),(0xFA49),(0xFA4A),(0xFA4B),(0xFA4C),(0xFA4D),(0xFA4E),(0xFA4F),
-(0xFA50),(0xFA51),(0xFA52),(0xFA53),(0xFA54),(0xFA55),(0xFA56),(0xFA57),
-(0xFA58),(0xFA59),(0xFA5A),(0xFA5B),(0xFA5C),(0xFA5D),(0xFA5E),(0xFA5F),
-(0xFA60),(0xFA61),(0xFA62),(0xFA63),(0xFA64),(0xFA65),(0xFA66),(0xFA67),
-(0xFA68),(0xFA69),(0xFA6A),(0xFA6B),(0xFA6C),(0xFA6D),(0xFA6E),(0xFA6F),
-(0xFA70),(0xFA71),(0xFA72),(0xFA73),(0xFA74),(0xFA75),(0xFA76),(0xFA77),
-(0xFA78),(0xFA79),(0xFA7A),(0xFA7B),(0xFA7C),(0xFA7D),(0xFA7E),
-(0xFA80),(0xFA81),(0xFA82),(0xFA83),(0xFA84),(0xFA85),(0xFA86),(0xFA87),
-(0xFA88),(0xFA89),(0xFA8A),(0xFA8B),(0xFA8C),(0xFA8D),(0xFA8E),(0xFA8F),
-(0xFA90),(0xFA91),(0xFA92),(0xFA93),(0xFA94),(0xFA95),(0xFA96),(0xFA97),
-(0xFA98),(0xFA99),(0xFA9A),(0xFA9B),(0xFA9C),(0xFA9D),(0xFA9E),(0xFA9F),
-(0xFAA0),(0xFAA1),(0xFAA2),(0xFAA3),(0xFAA4),(0xFAA5),(0xFAA6),(0xFAA7),
-(0xFAA8),(0xFAA9),(0xFAAA),(0xFAAB),(0xFAAC),(0xFAAD),(0xFAAE),(0xFAAF),
-(0xFAB0),(0xFAB1),(0xFAB2),(0xFAB3),(0xFAB4),(0xFAB5),(0xFAB6),(0xFAB7),
-(0xFAB8),(0xFAB9),(0xFABA),(0xFABB),(0xFABC),(0xFABD),(0xFABE),(0xFABF),
-(0xFAC0),(0xFAC1),(0xFAC2),(0xFAC3),(0xFAC4),(0xFAC5),(0xFAC6),(0xFAC7),
-(0xFAC8),(0xFAC9),(0xFACA),(0xFACB),(0xFACC),(0xFACD),(0xFACE),(0xFACF),
-(0xFAD0),(0xFAD1),(0xFAD2),(0xFAD3),(0xFAD4),(0xFAD5),(0xFAD6),(0xFAD7),
-(0xFAD8),(0xFAD9),(0xFADA),(0xFADB),(0xFADC),(0xFADD),(0xFADE),(0xFADF),
-(0xFAE0),(0xFAE1),(0xFAE2),(0xFAE3),(0xFAE4),(0xFAE5),(0xFAE6),(0xFAE7),
-(0xFAE8),(0xFAE9),(0xFAEA),(0xFAEB),(0xFAEC),(0xFAED),(0xFAEE),(0xFAEF),
-(0xFAF0),(0xFAF1),(0xFAF2),(0xFAF3),(0xFAF4),(0xFAF5),(0xFAF6),(0xFAF7),
-(0xFAF8),(0xFAF9),(0xFAFA),(0xFAFB),(0xFAFC),
-(0xFB40),(0xFB41),(0xFB42),(0xFB43),(0xFB44),(0xFB45),(0xFB46),(0xFB47),
-(0xFB48),(0xFB49),(0xFB4A),(0xFB4B),(0xFB4C),(0xFB4D),(0xFB4E),(0xFB4F),
-(0xFB50),(0xFB51),(0xFB52),(0xFB53),(0xFB54),(0xFB55),(0xFB56),(0xFB57),
-(0xFB58),(0xFB59),(0xFB5A),(0xFB5B),(0xFB5C),(0xFB5D),(0xFB5E),(0xFB5F),
-(0xFB60),(0xFB61),(0xFB62),(0xFB63),(0xFB64),(0xFB65),(0xFB66),(0xFB67),
-(0xFB68),(0xFB69),(0xFB6A),(0xFB6B),(0xFB6C),(0xFB6D),(0xFB6E),(0xFB6F),
-(0xFB70),(0xFB71),(0xFB72),(0xFB73),(0xFB74),(0xFB75),(0xFB76),(0xFB77),
-(0xFB78),(0xFB79),(0xFB7A),(0xFB7B),(0xFB7C),(0xFB7D),(0xFB7E),
-(0xFB80),(0xFB81),(0xFB82),(0xFB83),(0xFB84),(0xFB85),(0xFB86),(0xFB87),
-(0xFB88),(0xFB89),(0xFB8A),(0xFB8B),(0xFB8C),(0xFB8D),(0xFB8E),(0xFB8F),
-(0xFB90),(0xFB91),(0xFB92),(0xFB93),(0xFB94),(0xFB95),(0xFB96),(0xFB97),
-(0xFB98),(0xFB99),(0xFB9A),(0xFB9B),(0xFB9C),(0xFB9D),(0xFB9E),(0xFB9F),
-(0xFBA0),(0xFBA1),(0xFBA2),(0xFBA3),(0xFBA4),(0xFBA5),(0xFBA6),(0xFBA7),
-(0xFBA8),(0xFBA9),(0xFBAA),(0xFBAB),(0xFBAC),(0xFBAD),(0xFBAE),(0xFBAF),
-(0xFBB0),(0xFBB1),(0xFBB2),(0xFBB3),(0xFBB4),(0xFBB5),(0xFBB6),(0xFBB7),
-(0xFBB8),(0xFBB9),(0xFBBA),(0xFBBB),(0xFBBC),(0xFBBD),(0xFBBE),(0xFBBF),
-(0xFBC0),(0xFBC1),(0xFBC2),(0xFBC3),(0xFBC4),(0xFBC5),(0xFBC6),(0xFBC7),
-(0xFBC8),(0xFBC9),(0xFBCA),(0xFBCB),(0xFBCC),(0xFBCD),(0xFBCE),(0xFBCF),
-(0xFBD0),(0xFBD1),(0xFBD2),(0xFBD3),(0xFBD4),(0xFBD5),(0xFBD6),(0xFBD7),
-(0xFBD8),(0xFBD9),(0xFBDA),(0xFBDB),(0xFBDC),(0xFBDD),(0xFBDE),(0xFBDF),
-(0xFBE0),(0xFBE1),(0xFBE2),(0xFBE3),(0xFBE4),(0xFBE5),(0xFBE6),(0xFBE7),
-(0xFBE8),(0xFBE9),(0xFBEA),(0xFBEB),(0xFBEC),(0xFBED),(0xFBEE),(0xFBEF),
-(0xFBF0),(0xFBF1),(0xFBF2),(0xFBF3),(0xFBF4),(0xFBF5),(0xFBF6),(0xFBF7),
-(0xFBF8),(0xFBF9),(0xFBFA),(0xFBFB),(0xFBFC),
-(0xFC40),(0xFC41),(0xFC42),(0xFC43),(0xFC44),(0xFC45),(0xFC46),(0xFC47),
-(0xFC48),(0xFC49),(0xFC4A),(0xFC4B);
-INSERT INTO t1 VALUES
-(0xF040),(0xF041),(0xF042),(0xF043),(0xF044),(0xF045),(0xF046),(0xF047),
-(0xF048),(0xF049),(0xF04A),(0xF04B),(0xF04C),(0xF04D),(0xF04E),(0xF04F),
-(0xF050),(0xF051),(0xF052),(0xF053),(0xF054),(0xF055),(0xF056),(0xF057),
-(0xF058),(0xF059),(0xF05A),(0xF05B),(0xF05C),(0xF05D),(0xF05E),(0xF05F),
-(0xF060),(0xF061),(0xF062),(0xF063),(0xF064),(0xF065),(0xF066),(0xF067),
-(0xF068),(0xF069),(0xF06A),(0xF06B),(0xF06C),(0xF06D),(0xF06E),(0xF06F),
-(0xF070),(0xF071),(0xF072),(0xF073),(0xF074),(0xF075),(0xF076),(0xF077),
-(0xF078),(0xF079),(0xF07A),(0xF07B),(0xF07C),(0xF07D),(0xF07E),
-(0xF080),(0xF081),(0xF082),(0xF083),(0xF084),(0xF085),(0xF086),(0xF087),
-(0xF088),(0xF089),(0xF08A),(0xF08B),(0xF08C),(0xF08D),(0xF08E),(0xF08F),
-(0xF090),(0xF091),(0xF092),(0xF093),(0xF094),(0xF095),(0xF096),(0xF097),
-(0xF098),(0xF099),(0xF09A),(0xF09B),(0xF09C),(0xF09D),(0xF09E),(0xF09F),
-(0xF0A0),(0xF0A1),(0xF0A2),(0xF0A3),(0xF0A4),(0xF0A5),(0xF0A6),(0xF0A7),
-(0xF0A8),(0xF0A9),(0xF0AA),(0xF0AB),(0xF0AC),(0xF0AD),(0xF0AE),(0xF0AF),
-(0xF0B0),(0xF0B1),(0xF0B2),(0xF0B3),(0xF0B4),(0xF0B5),(0xF0B6),(0xF0B7),
-(0xF0B8),(0xF0B9),(0xF0BA),(0xF0BB),(0xF0BC),(0xF0BD),(0xF0BE),(0xF0BF),
-(0xF0C0),(0xF0C1),(0xF0C2),(0xF0C3),(0xF0C4),(0xF0C5),(0xF0C6),(0xF0C7),
-(0xF0C8),(0xF0C9),(0xF0CA),(0xF0CB),(0xF0CC),(0xF0CD),(0xF0CE),(0xF0CF),
-(0xF0D0),(0xF0D1),(0xF0D2),(0xF0D3),(0xF0D4),(0xF0D5),(0xF0D6),(0xF0D7),
-(0xF0D8),(0xF0D9),(0xF0DA),(0xF0DB),(0xF0DC),(0xF0DD),(0xF0DE),(0xF0DF),
-(0xF0E0),(0xF0E1),(0xF0E2),(0xF0E3),(0xF0E4),(0xF0E5),(0xF0E6),(0xF0E7),
-(0xF0E8),(0xF0E9),(0xF0EA),(0xF0EB),(0xF0EC),(0xF0ED),(0xF0EE),(0xF0EF),
-(0xF0F0),(0xF0F1),(0xF0F2),(0xF0F3),(0xF0F4),(0xF0F5),(0xF0F6),(0xF0F7),
-(0xF0F8),(0xF0F9),(0xF0FA),(0xF0FB),(0xF0FC),
-(0xF140),(0xF141),(0xF142),(0xF143),(0xF144),(0xF145),(0xF146),(0xF147),
-(0xF148),(0xF149),(0xF14A),(0xF14B),(0xF14C),(0xF14D),(0xF14E),(0xF14F),
-(0xF150),(0xF151),(0xF152),(0xF153),(0xF154),(0xF155),(0xF156),(0xF157),
-(0xF158),(0xF159),(0xF15A),(0xF15B),(0xF15C),(0xF15D),(0xF15E),(0xF15F),
-(0xF160),(0xF161),(0xF162),(0xF163),(0xF164),(0xF165),(0xF166),(0xF167),
-(0xF168),(0xF169),(0xF16A),(0xF16B),(0xF16C),(0xF16D),(0xF16E),(0xF16F),
-(0xF170),(0xF171),(0xF172),(0xF173),(0xF174),(0xF175),(0xF176),(0xF177),
-(0xF178),(0xF179),(0xF17A),(0xF17B),(0xF17C),(0xF17D),(0xF17E),
-(0xF180),(0xF181),(0xF182),(0xF183),(0xF184),(0xF185),(0xF186),(0xF187),
-(0xF188),(0xF189),(0xF18A),(0xF18B),(0xF18C),(0xF18D),(0xF18E),(0xF18F),
-(0xF190),(0xF191),(0xF192),(0xF193),(0xF194),(0xF195),(0xF196),(0xF197),
-(0xF198),(0xF199),(0xF19A),(0xF19B),(0xF19C),(0xF19D),(0xF19E),(0xF19F),
-(0xF1A0),(0xF1A1),(0xF1A2),(0xF1A3),(0xF1A4),(0xF1A5),(0xF1A6),(0xF1A7),
-(0xF1A8),(0xF1A9),(0xF1AA),(0xF1AB),(0xF1AC),(0xF1AD),(0xF1AE),(0xF1AF),
-(0xF1B0),(0xF1B1),(0xF1B2),(0xF1B3),(0xF1B4),(0xF1B5),(0xF1B6),(0xF1B7),
-(0xF1B8),(0xF1B9),(0xF1BA),(0xF1BB),(0xF1BC),(0xF1BD),(0xF1BE),(0xF1BF),
-(0xF1C0),(0xF1C1),(0xF1C2),(0xF1C3),(0xF1C4),(0xF1C5),(0xF1C6),(0xF1C7),
-(0xF1C8),(0xF1C9),(0xF1CA),(0xF1CB),(0xF1CC),(0xF1CD),(0xF1CE),(0xF1CF),
-(0xF1D0),(0xF1D1),(0xF1D2),(0xF1D3),(0xF1D4),(0xF1D5),(0xF1D6),(0xF1D7),
-(0xF1D8),(0xF1D9),(0xF1DA),(0xF1DB),(0xF1DC),(0xF1DD),(0xF1DE),(0xF1DF),
-(0xF1E0),(0xF1E1),(0xF1E2),(0xF1E3),(0xF1E4),(0xF1E5),(0xF1E6),(0xF1E7),
-(0xF1E8),(0xF1E9),(0xF1EA),(0xF1EB),(0xF1EC),(0xF1ED),(0xF1EE),(0xF1EF),
-(0xF1F0),(0xF1F1),(0xF1F2),(0xF1F3),(0xF1F4),(0xF1F5),(0xF1F6),(0xF1F7),
-(0xF1F8),(0xF1F9),(0xF1FA),(0xF1FB),(0xF1FC),
-(0xF240),(0xF241),(0xF242),(0xF243),(0xF244),(0xF245),(0xF246),(0xF247),
-(0xF248),(0xF249),(0xF24A),(0xF24B),(0xF24C),(0xF24D),(0xF24E),(0xF24F),
-(0xF250),(0xF251),(0xF252),(0xF253),(0xF254),(0xF255),(0xF256),(0xF257),
-(0xF258),(0xF259),(0xF25A),(0xF25B),(0xF25C),(0xF25D),(0xF25E),(0xF25F),
-(0xF260),(0xF261),(0xF262),(0xF263),(0xF264),(0xF265),(0xF266),(0xF267),
-(0xF268),(0xF269),(0xF26A),(0xF26B),(0xF26C),(0xF26D),(0xF26E),(0xF26F),
-(0xF270),(0xF271),(0xF272),(0xF273),(0xF274),(0xF275),(0xF276),(0xF277),
-(0xF278),(0xF279),(0xF27A),(0xF27B),(0xF27C),(0xF27D),(0xF27E),
-(0xF280),(0xF281),(0xF282),(0xF283),(0xF284),(0xF285),(0xF286),(0xF287),
-(0xF288),(0xF289),(0xF28A),(0xF28B),(0xF28C),(0xF28D),(0xF28E),(0xF28F),
-(0xF290),(0xF291),(0xF292),(0xF293),(0xF294),(0xF295),(0xF296),(0xF297),
-(0xF298),(0xF299),(0xF29A),(0xF29B),(0xF29C),(0xF29D),(0xF29E),(0xF29F),
-(0xF2A0),(0xF2A1),(0xF2A2),(0xF2A3),(0xF2A4),(0xF2A5),(0xF2A6),(0xF2A7),
-(0xF2A8),(0xF2A9),(0xF2AA),(0xF2AB),(0xF2AC),(0xF2AD),(0xF2AE),(0xF2AF),
-(0xF2B0),(0xF2B1),(0xF2B2),(0xF2B3),(0xF2B4),(0xF2B5),(0xF2B6),(0xF2B7),
-(0xF2B8),(0xF2B9),(0xF2BA),(0xF2BB),(0xF2BC),(0xF2BD),(0xF2BE),(0xF2BF),
-(0xF2C0),(0xF2C1),(0xF2C2),(0xF2C3),(0xF2C4),(0xF2C5),(0xF2C6),(0xF2C7),
-(0xF2C8),(0xF2C9),(0xF2CA),(0xF2CB),(0xF2CC),(0xF2CD),(0xF2CE),(0xF2CF),
-(0xF2D0),(0xF2D1),(0xF2D2),(0xF2D3),(0xF2D4),(0xF2D5),(0xF2D6),(0xF2D7),
-(0xF2D8),(0xF2D9),(0xF2DA),(0xF2DB),(0xF2DC),(0xF2DD),(0xF2DE),(0xF2DF),
-(0xF2E0),(0xF2E1),(0xF2E2),(0xF2E3),(0xF2E4),(0xF2E5),(0xF2E6),(0xF2E7),
-(0xF2E8),(0xF2E9),(0xF2EA),(0xF2EB),(0xF2EC),(0xF2ED),(0xF2EE),(0xF2EF),
-(0xF2F0),(0xF2F1),(0xF2F2),(0xF2F3),(0xF2F4),(0xF2F5),(0xF2F6),(0xF2F7),
-(0xF2F8),(0xF2F9),(0xF2FA),(0xF2FB),(0xF2FC),
-(0xF340),(0xF341),(0xF342),(0xF343),(0xF344),(0xF345),(0xF346),(0xF347),
-(0xF348),(0xF349),(0xF34A),(0xF34B),(0xF34C),(0xF34D),(0xF34E),(0xF34F),
-(0xF350),(0xF351),(0xF352),(0xF353),(0xF354),(0xF355),(0xF356),(0xF357),
-(0xF358),(0xF359),(0xF35A),(0xF35B),(0xF35C),(0xF35D),(0xF35E),(0xF35F),
-(0xF360),(0xF361),(0xF362),(0xF363),(0xF364),(0xF365),(0xF366),(0xF367),
-(0xF368),(0xF369),(0xF36A),(0xF36B),(0xF36C),(0xF36D),(0xF36E),(0xF36F),
-(0xF370),(0xF371),(0xF372),(0xF373),(0xF374),(0xF375),(0xF376),(0xF377),
-(0xF378),(0xF379),(0xF37A),(0xF37B),(0xF37C),(0xF37D),(0xF37E),
-(0xF380),(0xF381),(0xF382),(0xF383),(0xF384),(0xF385),(0xF386),(0xF387),
-(0xF388),(0xF389),(0xF38A),(0xF38B),(0xF38C),(0xF38D),(0xF38E),(0xF38F),
-(0xF390),(0xF391),(0xF392),(0xF393),(0xF394),(0xF395),(0xF396),(0xF397),
-(0xF398),(0xF399),(0xF39A),(0xF39B),(0xF39C),(0xF39D),(0xF39E),(0xF39F),
-(0xF3A0),(0xF3A1),(0xF3A2),(0xF3A3),(0xF3A4),(0xF3A5),(0xF3A6),(0xF3A7),
-(0xF3A8),(0xF3A9),(0xF3AA),(0xF3AB),(0xF3AC),(0xF3AD),(0xF3AE),(0xF3AF),
-(0xF3B0),(0xF3B1),(0xF3B2),(0xF3B3),(0xF3B4),(0xF3B5),(0xF3B6),(0xF3B7),
-(0xF3B8),(0xF3B9),(0xF3BA),(0xF3BB),(0xF3BC),(0xF3BD),(0xF3BE),(0xF3BF),
-(0xF3C0),(0xF3C1),(0xF3C2),(0xF3C3),(0xF3C4),(0xF3C5),(0xF3C6),(0xF3C7),
-(0xF3C8),(0xF3C9),(0xF3CA),(0xF3CB),(0xF3CC),(0xF3CD),(0xF3CE),(0xF3CF),
-(0xF3D0),(0xF3D1),(0xF3D2),(0xF3D3),(0xF3D4),(0xF3D5),(0xF3D6),(0xF3D7),
-(0xF3D8),(0xF3D9),(0xF3DA),(0xF3DB),(0xF3DC),(0xF3DD),(0xF3DE),(0xF3DF),
-(0xF3E0),(0xF3E1),(0xF3E2),(0xF3E3),(0xF3E4),(0xF3E5),(0xF3E6),(0xF3E7),
-(0xF3E8),(0xF3E9),(0xF3EA),(0xF3EB),(0xF3EC),(0xF3ED),(0xF3EE),(0xF3EF),
-(0xF3F0),(0xF3F1),(0xF3F2),(0xF3F3),(0xF3F4),(0xF3F5),(0xF3F6),(0xF3F7),
-(0xF3F8),(0xF3F9),(0xF3FA),(0xF3FB),(0xF3FC),
-(0xF440),(0xF441),(0xF442),(0xF443),(0xF444),(0xF445),(0xF446),(0xF447),
-(0xF448),(0xF449),(0xF44A),(0xF44B),(0xF44C),(0xF44D),(0xF44E),(0xF44F),
-(0xF450),(0xF451),(0xF452),(0xF453),(0xF454),(0xF455),(0xF456),(0xF457),
-(0xF458),(0xF459),(0xF45A),(0xF45B),(0xF45C),(0xF45D),(0xF45E),(0xF45F),
-(0xF460),(0xF461),(0xF462),(0xF463),(0xF464),(0xF465),(0xF466),(0xF467),
-(0xF468),(0xF469),(0xF46A),(0xF46B),(0xF46C),(0xF46D),(0xF46E),(0xF46F),
-(0xF470),(0xF471),(0xF472),(0xF473),(0xF474),(0xF475),(0xF476),(0xF477),
-(0xF478),(0xF479),(0xF47A),(0xF47B),(0xF47C),(0xF47D),(0xF47E),
-(0xF480),(0xF481),(0xF482),(0xF483),(0xF484),(0xF485),(0xF486),(0xF487),
-(0xF488),(0xF489),(0xF48A),(0xF48B),(0xF48C),(0xF48D),(0xF48E),(0xF48F),
-(0xF490),(0xF491),(0xF492),(0xF493),(0xF494),(0xF495),(0xF496),(0xF497),
-(0xF498),(0xF499),(0xF49A),(0xF49B),(0xF49C),(0xF49D),(0xF49E),(0xF49F),
-(0xF4A0),(0xF4A1),(0xF4A2),(0xF4A3),(0xF4A4),(0xF4A5),(0xF4A6),(0xF4A7),
-(0xF4A8),(0xF4A9),(0xF4AA),(0xF4AB),(0xF4AC),(0xF4AD),(0xF4AE),(0xF4AF),
-(0xF4B0),(0xF4B1),(0xF4B2),(0xF4B3),(0xF4B4),(0xF4B5),(0xF4B6),(0xF4B7),
-(0xF4B8),(0xF4B9),(0xF4BA),(0xF4BB),(0xF4BC),(0xF4BD),(0xF4BE),(0xF4BF),
-(0xF4C0),(0xF4C1),(0xF4C2),(0xF4C3),(0xF4C4),(0xF4C5),(0xF4C6),(0xF4C7),
-(0xF4C8),(0xF4C9),(0xF4CA),(0xF4CB),(0xF4CC),(0xF4CD),(0xF4CE),(0xF4CF),
-(0xF4D0),(0xF4D1),(0xF4D2),(0xF4D3),(0xF4D4),(0xF4D5),(0xF4D6),(0xF4D7),
-(0xF4D8),(0xF4D9),(0xF4DA),(0xF4DB),(0xF4DC),(0xF4DD),(0xF4DE),(0xF4DF),
-(0xF4E0),(0xF4E1),(0xF4E2),(0xF4E3),(0xF4E4),(0xF4E5),(0xF4E6),(0xF4E7),
-(0xF4E8),(0xF4E9),(0xF4EA),(0xF4EB),(0xF4EC),(0xF4ED),(0xF4EE),(0xF4EF),
-(0xF4F0),(0xF4F1),(0xF4F2),(0xF4F3),(0xF4F4),(0xF4F5),(0xF4F6),(0xF4F7),
-(0xF4F8),(0xF4F9),(0xF4FA),(0xF4FB),(0xF4FC),
-(0xF540),(0xF541),(0xF542),(0xF543),(0xF544),(0xF545),(0xF546),(0xF547),
-(0xF548),(0xF549),(0xF54A),(0xF54B),(0xF54C),(0xF54D),(0xF54E),(0xF54F),
-(0xF550),(0xF551),(0xF552),(0xF553),(0xF554),(0xF555),(0xF556),(0xF557),
-(0xF558),(0xF559),(0xF55A),(0xF55B),(0xF55C),(0xF55D),(0xF55E),(0xF55F),
-(0xF560),(0xF561),(0xF562),(0xF563),(0xF564),(0xF565),(0xF566),(0xF567),
-(0xF568),(0xF569),(0xF56A),(0xF56B),(0xF56C),(0xF56D),(0xF56E),(0xF56F),
-(0xF570),(0xF571),(0xF572),(0xF573),(0xF574),(0xF575),(0xF576),(0xF577),
-(0xF578),(0xF579),(0xF57A),(0xF57B),(0xF57C),(0xF57D),(0xF57E),
-(0xF580),(0xF581),(0xF582),(0xF583),(0xF584),(0xF585),(0xF586),(0xF587),
-(0xF588),(0xF589),(0xF58A),(0xF58B),(0xF58C),(0xF58D),(0xF58E),(0xF58F),
-(0xF590),(0xF591),(0xF592),(0xF593),(0xF594),(0xF595),(0xF596),(0xF597),
-(0xF598),(0xF599),(0xF59A),(0xF59B),(0xF59C),(0xF59D),(0xF59E),(0xF59F),
-(0xF5A0),(0xF5A1),(0xF5A2),(0xF5A3),(0xF5A4),(0xF5A5),(0xF5A6),(0xF5A7),
-(0xF5A8),(0xF5A9),(0xF5AA),(0xF5AB),(0xF5AC),(0xF5AD),(0xF5AE),(0xF5AF),
-(0xF5B0),(0xF5B1),(0xF5B2),(0xF5B3),(0xF5B4),(0xF5B5),(0xF5B6),(0xF5B7),
-(0xF5B8),(0xF5B9),(0xF5BA),(0xF5BB),(0xF5BC),(0xF5BD),(0xF5BE),(0xF5BF),
-(0xF5C0),(0xF5C1),(0xF5C2),(0xF5C3),(0xF5C4),(0xF5C5),(0xF5C6),(0xF5C7),
-(0xF5C8),(0xF5C9),(0xF5CA),(0xF5CB),(0xF5CC),(0xF5CD),(0xF5CE),(0xF5CF),
-(0xF5D0),(0xF5D1),(0xF5D2),(0xF5D3),(0xF5D4),(0xF5D5),(0xF5D6),(0xF5D7),
-(0xF5D8),(0xF5D9),(0xF5DA),(0xF5DB),(0xF5DC),(0xF5DD),(0xF5DE),(0xF5DF),
-(0xF5E0),(0xF5E1),(0xF5E2),(0xF5E3),(0xF5E4),(0xF5E5),(0xF5E6),(0xF5E7),
-(0xF5E8),(0xF5E9),(0xF5EA),(0xF5EB),(0xF5EC),(0xF5ED),(0xF5EE),(0xF5EF),
-(0xF5F0),(0xF5F1),(0xF5F2),(0xF5F3),(0xF5F4),(0xF5F5),(0xF5F6),(0xF5F7),
-(0xF5F8),(0xF5F9),(0xF5FA),(0xF5FB),(0xF5FC),
-(0xF640),(0xF641),(0xF642),(0xF643),(0xF644),(0xF645),(0xF646),(0xF647),
-(0xF648),(0xF649),(0xF64A),(0xF64B),(0xF64C),(0xF64D),(0xF64E),(0xF64F),
-(0xF650),(0xF651),(0xF652),(0xF653),(0xF654),(0xF655),(0xF656),(0xF657),
-(0xF658),(0xF659),(0xF65A),(0xF65B),(0xF65C),(0xF65D),(0xF65E),(0xF65F),
-(0xF660),(0xF661),(0xF662),(0xF663),(0xF664),(0xF665),(0xF666),(0xF667),
-(0xF668),(0xF669),(0xF66A),(0xF66B),(0xF66C),(0xF66D),(0xF66E),(0xF66F),
-(0xF670),(0xF671),(0xF672),(0xF673),(0xF674),(0xF675),(0xF676),(0xF677),
-(0xF678),(0xF679),(0xF67A),(0xF67B),(0xF67C),(0xF67D),(0xF67E),
-(0xF680),(0xF681),(0xF682),(0xF683),(0xF684),(0xF685),(0xF686),(0xF687),
-(0xF688),(0xF689),(0xF68A),(0xF68B),(0xF68C),(0xF68D),(0xF68E),(0xF68F),
-(0xF690),(0xF691),(0xF692),(0xF693),(0xF694),(0xF695),(0xF696),(0xF697),
-(0xF698),(0xF699),(0xF69A),(0xF69B),(0xF69C),(0xF69D),(0xF69E),(0xF69F),
-(0xF6A0),(0xF6A1),(0xF6A2),(0xF6A3),(0xF6A4),(0xF6A5),(0xF6A6),(0xF6A7),
-(0xF6A8),(0xF6A9),(0xF6AA),(0xF6AB),(0xF6AC),(0xF6AD),(0xF6AE),(0xF6AF),
-(0xF6B0),(0xF6B1),(0xF6B2),(0xF6B3),(0xF6B4),(0xF6B5),(0xF6B6),(0xF6B7),
-(0xF6B8),(0xF6B9),(0xF6BA),(0xF6BB),(0xF6BC),(0xF6BD),(0xF6BE),(0xF6BF),
-(0xF6C0),(0xF6C1),(0xF6C2),(0xF6C3),(0xF6C4),(0xF6C5),(0xF6C6),(0xF6C7),
-(0xF6C8),(0xF6C9),(0xF6CA),(0xF6CB),(0xF6CC),(0xF6CD),(0xF6CE),(0xF6CF),
-(0xF6D0),(0xF6D1),(0xF6D2),(0xF6D3),(0xF6D4),(0xF6D5),(0xF6D6),(0xF6D7),
-(0xF6D8),(0xF6D9),(0xF6DA),(0xF6DB),(0xF6DC),(0xF6DD),(0xF6DE),(0xF6DF),
-(0xF6E0),(0xF6E1),(0xF6E2),(0xF6E3),(0xF6E4),(0xF6E5),(0xF6E6),(0xF6E7),
-(0xF6E8),(0xF6E9),(0xF6EA),(0xF6EB),(0xF6EC),(0xF6ED),(0xF6EE),(0xF6EF),
-(0xF6F0),(0xF6F1),(0xF6F2),(0xF6F3),(0xF6F4),(0xF6F5),(0xF6F6),(0xF6F7),
-(0xF6F8),(0xF6F9),(0xF6FA),(0xF6FB),(0xF6FC),
-(0xF740),(0xF741),(0xF742),(0xF743),(0xF744),(0xF745),(0xF746),(0xF747),
-(0xF748),(0xF749),(0xF74A),(0xF74B),(0xF74C),(0xF74D),(0xF74E),(0xF74F),
-(0xF750),(0xF751),(0xF752),(0xF753),(0xF754),(0xF755),(0xF756),(0xF757),
-(0xF758),(0xF759),(0xF75A),(0xF75B),(0xF75C),(0xF75D),(0xF75E),(0xF75F),
-(0xF760),(0xF761),(0xF762),(0xF763),(0xF764),(0xF765),(0xF766),(0xF767),
-(0xF768),(0xF769),(0xF76A),(0xF76B),(0xF76C),(0xF76D),(0xF76E),(0xF76F),
-(0xF770),(0xF771),(0xF772),(0xF773),(0xF774),(0xF775),(0xF776),(0xF777),
-(0xF778),(0xF779),(0xF77A),(0xF77B),(0xF77C),(0xF77D),(0xF77E),
-(0xF780),(0xF781),(0xF782),(0xF783),(0xF784),(0xF785),(0xF786),(0xF787),
-(0xF788),(0xF789),(0xF78A),(0xF78B),(0xF78C),(0xF78D),(0xF78E),(0xF78F),
-(0xF790),(0xF791),(0xF792),(0xF793),(0xF794),(0xF795),(0xF796),(0xF797),
-(0xF798),(0xF799),(0xF79A),(0xF79B),(0xF79C),(0xF79D),(0xF79E),(0xF79F),
-(0xF7A0),(0xF7A1),(0xF7A2),(0xF7A3),(0xF7A4),(0xF7A5),(0xF7A6),(0xF7A7),
-(0xF7A8),(0xF7A9),(0xF7AA),(0xF7AB),(0xF7AC),(0xF7AD),(0xF7AE),(0xF7AF),
-(0xF7B0),(0xF7B1),(0xF7B2),(0xF7B3),(0xF7B4),(0xF7B5),(0xF7B6),(0xF7B7),
-(0xF7B8),(0xF7B9),(0xF7BA),(0xF7BB),(0xF7BC),(0xF7BD),(0xF7BE),(0xF7BF),
-(0xF7C0),(0xF7C1),(0xF7C2),(0xF7C3),(0xF7C4),(0xF7C5),(0xF7C6),(0xF7C7),
-(0xF7C8),(0xF7C9),(0xF7CA),(0xF7CB),(0xF7CC),(0xF7CD),(0xF7CE),(0xF7CF),
-(0xF7D0),(0xF7D1),(0xF7D2),(0xF7D3),(0xF7D4),(0xF7D5),(0xF7D6),(0xF7D7),
-(0xF7D8),(0xF7D9),(0xF7DA),(0xF7DB),(0xF7DC),(0xF7DD),(0xF7DE),(0xF7DF),
-(0xF7E0),(0xF7E1),(0xF7E2),(0xF7E3),(0xF7E4),(0xF7E5),(0xF7E6),(0xF7E7),
-(0xF7E8),(0xF7E9),(0xF7EA),(0xF7EB),(0xF7EC),(0xF7ED),(0xF7EE),(0xF7EF),
-(0xF7F0),(0xF7F1),(0xF7F2),(0xF7F3),(0xF7F4),(0xF7F5),(0xF7F6),(0xF7F7),
-(0xF7F8),(0xF7F9),(0xF7FA),(0xF7FB),(0xF7FC),
-(0xF840),(0xF841),(0xF842),(0xF843),(0xF844),(0xF845),(0xF846),(0xF847),
-(0xF848),(0xF849),(0xF84A),(0xF84B),(0xF84C),(0xF84D),(0xF84E),(0xF84F),
-(0xF850),(0xF851),(0xF852),(0xF853),(0xF854),(0xF855),(0xF856),(0xF857),
-(0xF858),(0xF859),(0xF85A),(0xF85B),(0xF85C),(0xF85D),(0xF85E),(0xF85F),
-(0xF860),(0xF861),(0xF862),(0xF863),(0xF864),(0xF865),(0xF866),(0xF867),
-(0xF868),(0xF869),(0xF86A),(0xF86B),(0xF86C),(0xF86D),(0xF86E),(0xF86F),
-(0xF870),(0xF871),(0xF872),(0xF873),(0xF874),(0xF875),(0xF876),(0xF877),
-(0xF878),(0xF879),(0xF87A),(0xF87B),(0xF87C),(0xF87D),(0xF87E),
-(0xF880),(0xF881),(0xF882),(0xF883),(0xF884),(0xF885),(0xF886),(0xF887),
-(0xF888),(0xF889),(0xF88A),(0xF88B),(0xF88C),(0xF88D),(0xF88E),(0xF88F),
-(0xF890),(0xF891),(0xF892),(0xF893),(0xF894),(0xF895),(0xF896),(0xF897),
-(0xF898),(0xF899),(0xF89A),(0xF89B),(0xF89C),(0xF89D),(0xF89E),(0xF89F),
-(0xF8A0),(0xF8A1),(0xF8A2),(0xF8A3),(0xF8A4),(0xF8A5),(0xF8A6),(0xF8A7),
-(0xF8A8),(0xF8A9),(0xF8AA),(0xF8AB),(0xF8AC),(0xF8AD),(0xF8AE),(0xF8AF),
-(0xF8B0),(0xF8B1),(0xF8B2),(0xF8B3),(0xF8B4),(0xF8B5),(0xF8B6),(0xF8B7),
-(0xF8B8),(0xF8B9),(0xF8BA),(0xF8BB),(0xF8BC),(0xF8BD),(0xF8BE),(0xF8BF),
-(0xF8C0),(0xF8C1),(0xF8C2),(0xF8C3),(0xF8C4),(0xF8C5),(0xF8C6),(0xF8C7),
-(0xF8C8),(0xF8C9),(0xF8CA),(0xF8CB),(0xF8CC),(0xF8CD),(0xF8CE),(0xF8CF),
-(0xF8D0),(0xF8D1),(0xF8D2),(0xF8D3),(0xF8D4),(0xF8D5),(0xF8D6),(0xF8D7),
-(0xF8D8),(0xF8D9),(0xF8DA),(0xF8DB),(0xF8DC),(0xF8DD),(0xF8DE),(0xF8DF),
-(0xF8E0),(0xF8E1),(0xF8E2),(0xF8E3),(0xF8E4),(0xF8E5),(0xF8E6),(0xF8E7),
-(0xF8E8),(0xF8E9),(0xF8EA),(0xF8EB),(0xF8EC),(0xF8ED),(0xF8EE),(0xF8EF),
-(0xF8F0),(0xF8F1),(0xF8F2),(0xF8F3),(0xF8F4),(0xF8F5),(0xF8F6),(0xF8F7),
-(0xF8F8),(0xF8F9),(0xF8FA),(0xF8FB),(0xF8FC),
-(0xF940),(0xF941),(0xF942),(0xF943),(0xF944),(0xF945),(0xF946),(0xF947),
-(0xF948),(0xF949),(0xF94A),(0xF94B),(0xF94C),(0xF94D),(0xF94E),(0xF94F),
-(0xF950),(0xF951),(0xF952),(0xF953),(0xF954),(0xF955),(0xF956),(0xF957),
-(0xF958),(0xF959),(0xF95A),(0xF95B),(0xF95C),(0xF95D),(0xF95E),(0xF95F),
-(0xF960),(0xF961),(0xF962),(0xF963),(0xF964),(0xF965),(0xF966),(0xF967),
-(0xF968),(0xF969),(0xF96A),(0xF96B),(0xF96C),(0xF96D),(0xF96E),(0xF96F),
-(0xF970),(0xF971),(0xF972),(0xF973),(0xF974),(0xF975),(0xF976),(0xF977),
-(0xF978),(0xF979),(0xF97A),(0xF97B),(0xF97C),(0xF97D),(0xF97E),
-(0xF980),(0xF981),(0xF982),(0xF983),(0xF984),(0xF985),(0xF986),(0xF987),
-(0xF988),(0xF989),(0xF98A),(0xF98B),(0xF98C),(0xF98D),(0xF98E),(0xF98F),
-(0xF990),(0xF991),(0xF992),(0xF993),(0xF994),(0xF995),(0xF996),(0xF997),
-(0xF998),(0xF999),(0xF99A),(0xF99B),(0xF99C),(0xF99D),(0xF99E),(0xF99F),
-(0xF9A0),(0xF9A1),(0xF9A2),(0xF9A3),(0xF9A4),(0xF9A5),(0xF9A6),(0xF9A7),
-(0xF9A8),(0xF9A9),(0xF9AA),(0xF9AB),(0xF9AC),(0xF9AD),(0xF9AE),(0xF9AF),
-(0xF9B0),(0xF9B1),(0xF9B2),(0xF9B3),(0xF9B4),(0xF9B5),(0xF9B6),(0xF9B7),
-(0xF9B8),(0xF9B9),(0xF9BA),(0xF9BB),(0xF9BC),(0xF9BD),(0xF9BE),(0xF9BF),
-(0xF9C0),(0xF9C1),(0xF9C2),(0xF9C3),(0xF9C4),(0xF9C5),(0xF9C6),(0xF9C7),
-(0xF9C8),(0xF9C9),(0xF9CA),(0xF9CB),(0xF9CC),(0xF9CD),(0xF9CE),(0xF9CF),
-(0xF9D0),(0xF9D1),(0xF9D2),(0xF9D3),(0xF9D4),(0xF9D5),(0xF9D6),(0xF9D7),
-(0xF9D8),(0xF9D9),(0xF9DA),(0xF9DB),(0xF9DC),(0xF9DD),(0xF9DE),(0xF9DF),
-(0xF9E0),(0xF9E1),(0xF9E2),(0xF9E3),(0xF9E4),(0xF9E5),(0xF9E6),(0xF9E7),
-(0xF9E8),(0xF9E9),(0xF9EA),(0xF9EB),(0xF9EC),(0xF9ED),(0xF9EE),(0xF9EF),
-(0xF9F0),(0xF9F1),(0xF9F2),(0xF9F3),(0xF9F4),(0xF9F5),(0xF9F6),(0xF9F7),
-(0xF9F8),(0xF9F9),(0xF9FA),(0xF9FB),(0xF9FC);
-SELECT HEX(c1) FROM t1;
-HEX(c1)
-05
-7E
-815C
-815F
-8160
-8161
-817C
-8191
-8192
-81CA
-8740
-8741
-8742
-8743
-8744
-8745
-8746
-8747
-8748
-8749
-874A
-874B
-874C
-874D
-874E
-874F
-8750
-8751
-8752
-8753
-8754
-8755
-8756
-8757
-8758
-8759
-875A
-875B
-875C
-875D
-875F
-8760
-8761
-8762
-8763
-8764
-8765
-8766
-8767
-8768
-8769
-876A
-876B
-876C
-876D
-876E
-876F
-8770
-8771
-8772
-8773
-8774
-8775
-877E
-8780
-8781
-8782
-8783
-8784
-8785
-8786
-8787
-8788
-8789
-878A
-878B
-878C
-878D
-878E
-878F
-8790
-8791
-8792
-8793
-8794
-8795
-8796
-8797
-8798
-8799
-879A
-879B
-879C
-ED40
-ED41
-ED42
-ED43
-ED44
-ED45
-ED46
-ED47
-ED48
-ED49
-ED4A
-ED4B
-ED4C
-ED4D
-ED4E
-ED4F
-ED50
-ED51
-ED52
-ED53
-ED54
-ED55
-ED56
-ED57
-ED58
-ED59
-ED5A
-ED5B
-ED5C
-ED5D
-ED5E
-ED5F
-ED60
-ED61
-ED62
-ED63
-ED64
-ED65
-ED66
-ED67
-ED68
-ED69
-ED6A
-ED6B
-ED6C
-ED6D
-ED6E
-ED6F
-ED70
-ED71
-ED72
-ED73
-ED74
-ED75
-ED76
-ED77
-ED78
-ED79
-ED7A
-ED7B
-ED7C
-ED7D
-ED7E
-ED80
-ED81
-ED82
-ED83
-ED84
-ED85
-ED86
-ED87
-ED88
-ED89
-ED8A
-ED8B
-ED8C
-ED8D
-ED8E
-ED8F
-ED90
-ED91
-ED92
-ED93
-ED94
-ED95
-ED96
-ED97
-ED98
-ED99
-ED9A
-ED9B
-ED9C
-ED9D
-ED9E
-ED9F
-EDA0
-EDA1
-EDA2
-EDA3
-EDA4
-EDA5
-EDA6
-EDA7
-EDA8
-EDA9
-EDAA
-EDAB
-EDAC
-EDAD
-EDAE
-EDAF
-EDB0
-EDB1
-EDB2
-EDB3
-EDB4
-EDB5
-EDB6
-EDB7
-EDB8
-EDB9
-EDBA
-EDBB
-EDBC
-EDBD
-EDBE
-EDBF
-EDC0
-EDC1
-EDC2
-EDC3
-EDC4
-EDC5
-EDC6
-EDC7
-EDC8
-EDC9
-EDCA
-EDCB
-EDCC
-EDCD
-EDCE
-EDCF
-EDD0
-EDD1
-EDD2
-EDD3
-EDD4
-EDD5
-EDD6
-EDD7
-EDD8
-EDD9
-EDDA
-EDDB
-EDDC
-EDDD
-EDDE
-EDDF
-EDE0
-EDE1
-EDE2
-EDE3
-EDE4
-EDE5
-EDE6
-EDE7
-EDE8
-EDE9
-EDEA
-EDEB
-EDEC
-EDED
-EDEE
-EDEF
-EDF0
-EDF1
-EDF2
-EDF3
-EDF4
-EDF5
-EDF6
-EDF7
-EDF8
-EDF9
-EDFA
-EDFB
-EDFC
-EE40
-EE41
-EE42
-EE43
-EE44
-EE45
-EE46
-EE47
-EE48
-EE49
-EE4A
-EE4B
-EE4C
-EE4D
-EE4E
-EE4F
-EE50
-EE51
-EE52
-EE53
-EE54
-EE55
-EE56
-EE57
-EE58
-EE59
-EE5A
-EE5B
-EE5C
-EE5D
-EE5E
-EE5F
-EE60
-EE61
-EE62
-EE63
-EE64
-EE65
-EE66
-EE67
-EE68
-EE69
-EE6A
-EE6B
-EE6C
-EE6D
-EE6E
-EE6F
-EE70
-EE71
-EE72
-EE73
-EE74
-EE75
-EE76
-EE77
-EE78
-EE79
-EE7A
-EE7B
-EE7C
-EE7D
-EE7E
-EE80
-EE81
-EE82
-EE83
-EE84
-EE85
-EE86
-EE87
-EE88
-EE89
-EE8A
-EE8B
-EE8C
-EE8D
-EE8E
-EE8F
-EE90
-EE91
-EE92
-EE93
-EE94
-EE95
-EE96
-EE97
-EE98
-EE99
-EE9A
-EE9B
-EE9C
-EE9D
-EE9E
-EE9F
-EEA0
-EEA1
-EEA2
-EEA3
-EEA4
-EEA5
-EEA6
-EEA7
-EEA8
-EEA9
-EEAA
-EEAB
-EEAC
-EEAD
-EEAE
-EEAF
-EEB0
-EEB1
-EEB2
-EEB3
-EEB4
-EEB5
-EEB6
-EEB7
-EEB8
-EEB9
-EEBA
-EEBB
-EEBC
-EEBD
-EEBE
-EEBF
-EEC0
-EEC1
-EEC2
-EEC3
-EEC4
-EEC5
-EEC6
-EEC7
-EEC8
-EEC9
-EECA
-EECB
-EECC
-EECD
-EECE
-EECF
-EED0
-EED1
-EED2
-EED3
-EED4
-EED5
-EED6
-EED7
-EED8
-EED9
-EEDA
-EEDB
-EEDC
-EEDD
-EEDE
-EEDF
-EEE0
-EEE1
-EEE2
-EEE3
-EEE4
-EEE5
-EEE6
-EEE7
-EEE8
-EEE9
-EEEA
-EEEB
-EEEC
-EEEF
-EEF0
-EEF1
-EEF2
-EEF3
-EEF4
-EEF5
-EEF6
-EEF7
-EEF8
-EEF9
-EEFA
-EEFB
-EEFC
-FA40
-FA41
-FA42
-FA43
-FA44
-FA45
-FA46
-FA47
-FA48
-FA49
-FA4A
-FA4B
-FA4C
-FA4D
-FA4E
-FA4F
-FA50
-FA51
-FA52
-FA53
-FA54
-FA55
-FA56
-FA57
-FA58
-FA59
-FA5A
-FA5B
-FA5C
-FA5D
-FA5E
-FA5F
-FA60
-FA61
-FA62
-FA63
-FA64
-FA65
-FA66
-FA67
-FA68
-FA69
-FA6A
-FA6B
-FA6C
-FA6D
-FA6E
-FA6F
-FA70
-FA71
-FA72
-FA73
-FA74
-FA75
-FA76
-FA77
-FA78
-FA79
-FA7A
-FA7B
-FA7C
-FA7D
-FA7E
-FA80
-FA81
-FA82
-FA83
-FA84
-FA85
-FA86
-FA87
-FA88
-FA89
-FA8A
-FA8B
-FA8C
-FA8D
-FA8E
-FA8F
-FA90
-FA91
-FA92
-FA93
-FA94
-FA95
-FA96
-FA97
-FA98
-FA99
-FA9A
-FA9B
-FA9C
-FA9D
-FA9E
-FA9F
-FAA0
-FAA1
-FAA2
-FAA3
-FAA4
-FAA5
-FAA6
-FAA7
-FAA8
-FAA9
-FAAA
-FAAB
-FAAC
-FAAD
-FAAE
-FAAF
-FAB0
-FAB1
-FAB2
-FAB3
-FAB4
-FAB5
-FAB6
-FAB7
-FAB8
-FAB9
-FABA
-FABB
-FABC
-FABD
-FABE
-FABF
-FAC0
-FAC1
-FAC2
-FAC3
-FAC4
-FAC5
-FAC6
-FAC7
-FAC8
-FAC9
-FACA
-FACB
-FACC
-FACD
-FACE
-FACF
-FAD0
-FAD1
-FAD2
-FAD3
-FAD4
-FAD5
-FAD6
-FAD7
-FAD8
-FAD9
-FADA
-FADB
-FADC
-FADD
-FADE
-FADF
-FAE0
-FAE1
-FAE2
-FAE3
-FAE4
-FAE5
-FAE6
-FAE7
-FAE8
-FAE9
-FAEA
-FAEB
-FAEC
-FAED
-FAEE
-FAEF
-FAF0
-FAF1
-FAF2
-FAF3
-FAF4
-FAF5
-FAF6
-FAF7
-FAF8
-FAF9
-FAFA
-FAFB
-FAFC
-FB40
-FB41
-FB42
-FB43
-FB44
-FB45
-FB46
-FB47
-FB48
-FB49
-FB4A
-FB4B
-FB4C
-FB4D
-FB4E
-FB4F
-FB50
-FB51
-FB52
-FB53
-FB54
-FB55
-FB56
-FB57
-FB58
-FB59
-FB5A
-FB5B
-FB5C
-FB5D
-FB5E
-FB5F
-FB60
-FB61
-FB62
-FB63
-FB64
-FB65
-FB66
-FB67
-FB68
-FB69
-FB6A
-FB6B
-FB6C
-FB6D
-FB6E
-FB6F
-FB70
-FB71
-FB72
-FB73
-FB74
-FB75
-FB76
-FB77
-FB78
-FB79
-FB7A
-FB7B
-FB7C
-FB7D
-FB7E
-FB80
-FB81
-FB82
-FB83
-FB84
-FB85
-FB86
-FB87
-FB88
-FB89
-FB8A
-FB8B
-FB8C
-FB8D
-FB8E
-FB8F
-FB90
-FB91
-FB92
-FB93
-FB94
-FB95
-FB96
-FB97
-FB98
-FB99
-FB9A
-FB9B
-FB9C
-FB9D
-FB9E
-FB9F
-FBA0
-FBA1
-FBA2
-FBA3
-FBA4
-FBA5
-FBA6
-FBA7
-FBA8
-FBA9
-FBAA
-FBAB
-FBAC
-FBAD
-FBAE
-FBAF
-FBB0
-FBB1
-FBB2
-FBB3
-FBB4
-FBB5
-FBB6
-FBB7
-FBB8
-FBB9
-FBBA
-FBBB
-FBBC
-FBBD
-FBBE
-FBBF
-FBC0
-FBC1
-FBC2
-FBC3
-FBC4
-FBC5
-FBC6
-FBC7
-FBC8
-FBC9
-FBCA
-FBCB
-FBCC
-FBCD
-FBCE
-FBCF
-FBD0
-FBD1
-FBD2
-FBD3
-FBD4
-FBD5
-FBD6
-FBD7
-FBD8
-FBD9
-FBDA
-FBDB
-FBDC
-FBDD
-FBDE
-FBDF
-FBE0
-FBE1
-FBE2
-FBE3
-FBE4
-FBE5
-FBE6
-FBE7
-FBE8
-FBE9
-FBEA
-FBEB
-FBEC
-FBED
-FBEE
-FBEF
-FBF0
-FBF1
-FBF2
-FBF3
-FBF4
-FBF5
-FBF6
-FBF7
-FBF8
-FBF9
-FBFA
-FBFB
-FBFC
-FC40
-FC41
-FC42
-FC43
-FC44
-FC45
-FC46
-FC47
-FC48
-FC49
-FC4A
-FC4B
-F040
-F041
-F042
-F043
-F044
-F045
-F046
-F047
-F048
-F049
-F04A
-F04B
-F04C
-F04D
-F04E
-F04F
-F050
-F051
-F052
-F053
-F054
-F055
-F056
-F057
-F058
-F059
-F05A
-F05B
-F05C
-F05D
-F05E
-F05F
-F060
-F061
-F062
-F063
-F064
-F065
-F066
-F067
-F068
-F069
-F06A
-F06B
-F06C
-F06D
-F06E
-F06F
-F070
-F071
-F072
-F073
-F074
-F075
-F076
-F077
-F078
-F079
-F07A
-F07B
-F07C
-F07D
-F07E
-F080
-F081
-F082
-F083
-F084
-F085
-F086
-F087
-F088
-F089
-F08A
-F08B
-F08C
-F08D
-F08E
-F08F
-F090
-F091
-F092
-F093
-F094
-F095
-F096
-F097
-F098
-F099
-F09A
-F09B
-F09C
-F09D
-F09E
-F09F
-F0A0
-F0A1
-F0A2
-F0A3
-F0A4
-F0A5
-F0A6
-F0A7
-F0A8
-F0A9
-F0AA
-F0AB
-F0AC
-F0AD
-F0AE
-F0AF
-F0B0
-F0B1
-F0B2
-F0B3
-F0B4
-F0B5
-F0B6
-F0B7
-F0B8
-F0B9
-F0BA
-F0BB
-F0BC
-F0BD
-F0BE
-F0BF
-F0C0
-F0C1
-F0C2
-F0C3
-F0C4
-F0C5
-F0C6
-F0C7
-F0C8
-F0C9
-F0CA
-F0CB
-F0CC
-F0CD
-F0CE
-F0CF
-F0D0
-F0D1
-F0D2
-F0D3
-F0D4
-F0D5
-F0D6
-F0D7
-F0D8
-F0D9
-F0DA
-F0DB
-F0DC
-F0DD
-F0DE
-F0DF
-F0E0
-F0E1
-F0E2
-F0E3
-F0E4
-F0E5
-F0E6
-F0E7
-F0E8
-F0E9
-F0EA
-F0EB
-F0EC
-F0ED
-F0EE
-F0EF
-F0F0
-F0F1
-F0F2
-F0F3
-F0F4
-F0F5
-F0F6
-F0F7
-F0F8
-F0F9
-F0FA
-F0FB
-F0FC
-F140
-F141
-F142
-F143
-F144
-F145
-F146
-F147
-F148
-F149
-F14A
-F14B
-F14C
-F14D
-F14E
-F14F
-F150
-F151
-F152
-F153
-F154
-F155
-F156
-F157
-F158
-F159
-F15A
-F15B
-F15C
-F15D
-F15E
-F15F
-F160
-F161
-F162
-F163
-F164
-F165
-F166
-F167
-F168
-F169
-F16A
-F16B
-F16C
-F16D
-F16E
-F16F
-F170
-F171
-F172
-F173
-F174
-F175
-F176
-F177
-F178
-F179
-F17A
-F17B
-F17C
-F17D
-F17E
-F180
-F181
-F182
-F183
-F184
-F185
-F186
-F187
-F188
-F189
-F18A
-F18B
-F18C
-F18D
-F18E
-F18F
-F190
-F191
-F192
-F193
-F194
-F195
-F196
-F197
-F198
-F199
-F19A
-F19B
-F19C
-F19D
-F19E
-F19F
-F1A0
-F1A1
-F1A2
-F1A3
-F1A4
-F1A5
-F1A6
-F1A7
-F1A8
-F1A9
-F1AA
-F1AB
-F1AC
-F1AD
-F1AE
-F1AF
-F1B0
-F1B1
-F1B2
-F1B3
-F1B4
-F1B5
-F1B6
-F1B7
-F1B8
-F1B9
-F1BA
-F1BB
-F1BC
-F1BD
-F1BE
-F1BF
-F1C0
-F1C1
-F1C2
-F1C3
-F1C4
-F1C5
-F1C6
-F1C7
-F1C8
-F1C9
-F1CA
-F1CB
-F1CC
-F1CD
-F1CE
-F1CF
-F1D0
-F1D1
-F1D2
-F1D3
-F1D4
-F1D5
-F1D6
-F1D7
-F1D8
-F1D9
-F1DA
-F1DB
-F1DC
-F1DD
-F1DE
-F1DF
-F1E0
-F1E1
-F1E2
-F1E3
-F1E4
-F1E5
-F1E6
-F1E7
-F1E8
-F1E9
-F1EA
-F1EB
-F1EC
-F1ED
-F1EE
-F1EF
-F1F0
-F1F1
-F1F2
-F1F3
-F1F4
-F1F5
-F1F6
-F1F7
-F1F8
-F1F9
-F1FA
-F1FB
-F1FC
-F240
-F241
-F242
-F243
-F244
-F245
-F246
-F247
-F248
-F249
-F24A
-F24B
-F24C
-F24D
-F24E
-F24F
-F250
-F251
-F252
-F253
-F254
-F255
-F256
-F257
-F258
-F259
-F25A
-F25B
-F25C
-F25D
-F25E
-F25F
-F260
-F261
-F262
-F263
-F264
-F265
-F266
-F267
-F268
-F269
-F26A
-F26B
-F26C
-F26D
-F26E
-F26F
-F270
-F271
-F272
-F273
-F274
-F275
-F276
-F277
-F278
-F279
-F27A
-F27B
-F27C
-F27D
-F27E
-F280
-F281
-F282
-F283
-F284
-F285
-F286
-F287
-F288
-F289
-F28A
-F28B
-F28C
-F28D
-F28E
-F28F
-F290
-F291
-F292
-F293
-F294
-F295
-F296
-F297
-F298
-F299
-F29A
-F29B
-F29C
-F29D
-F29E
-F29F
-F2A0
-F2A1
-F2A2
-F2A3
-F2A4
-F2A5
-F2A6
-F2A7
-F2A8
-F2A9
-F2AA
-F2AB
-F2AC
-F2AD
-F2AE
-F2AF
-F2B0
-F2B1
-F2B2
-F2B3
-F2B4
-F2B5
-F2B6
-F2B7
-F2B8
-F2B9
-F2BA
-F2BB
-F2BC
-F2BD
-F2BE
-F2BF
-F2C0
-F2C1
-F2C2
-F2C3
-F2C4
-F2C5
-F2C6
-F2C7
-F2C8
-F2C9
-F2CA
-F2CB
-F2CC
-F2CD
-F2CE
-F2CF
-F2D0
-F2D1
-F2D2
-F2D3
-F2D4
-F2D5
-F2D6
-F2D7
-F2D8
-F2D9
-F2DA
-F2DB
-F2DC
-F2DD
-F2DE
-F2DF
-F2E0
-F2E1
-F2E2
-F2E3
-F2E4
-F2E5
-F2E6
-F2E7
-F2E8
-F2E9
-F2EA
-F2EB
-F2EC
-F2ED
-F2EE
-F2EF
-F2F0
-F2F1
-F2F2
-F2F3
-F2F4
-F2F5
-F2F6
-F2F7
-F2F8
-F2F9
-F2FA
-F2FB
-F2FC
-F340
-F341
-F342
-F343
-F344
-F345
-F346
-F347
-F348
-F349
-F34A
-F34B
-F34C
-F34D
-F34E
-F34F
-F350
-F351
-F352
-F353
-F354
-F355
-F356
-F357
-F358
-F359
-F35A
-F35B
-F35C
-F35D
-F35E
-F35F
-F360
-F361
-F362
-F363
-F364
-F365
-F366
-F367
-F368
-F369
-F36A
-F36B
-F36C
-F36D
-F36E
-F36F
-F370
-F371
-F372
-F373
-F374
-F375
-F376
-F377
-F378
-F379
-F37A
-F37B
-F37C
-F37D
-F37E
-F380
-F381
-F382
-F383
-F384
-F385
-F386
-F387
-F388
-F389
-F38A
-F38B
-F38C
-F38D
-F38E
-F38F
-F390
-F391
-F392
-F393
-F394
-F395
-F396
-F397
-F398
-F399
-F39A
-F39B
-F39C
-F39D
-F39E
-F39F
-F3A0
-F3A1
-F3A2
-F3A3
-F3A4
-F3A5
-F3A6
-F3A7
-F3A8
-F3A9
-F3AA
-F3AB
-F3AC
-F3AD
-F3AE
-F3AF
-F3B0
-F3B1
-F3B2
-F3B3
-F3B4
-F3B5
-F3B6
-F3B7
-F3B8
-F3B9
-F3BA
-F3BB
-F3BC
-F3BD
-F3BE
-F3BF
-F3C0
-F3C1
-F3C2
-F3C3
-F3C4
-F3C5
-F3C6
-F3C7
-F3C8
-F3C9
-F3CA
-F3CB
-F3CC
-F3CD
-F3CE
-F3CF
-F3D0
-F3D1
-F3D2
-F3D3
-F3D4
-F3D5
-F3D6
-F3D7
-F3D8
-F3D9
-F3DA
-F3DB
-F3DC
-F3DD
-F3DE
-F3DF
-F3E0
-F3E1
-F3E2
-F3E3
-F3E4
-F3E5
-F3E6
-F3E7
-F3E8
-F3E9
-F3EA
-F3EB
-F3EC
-F3ED
-F3EE
-F3EF
-F3F0
-F3F1
-F3F2
-F3F3
-F3F4
-F3F5
-F3F6
-F3F7
-F3F8
-F3F9
-F3FA
-F3FB
-F3FC
-F440
-F441
-F442
-F443
-F444
-F445
-F446
-F447
-F448
-F449
-F44A
-F44B
-F44C
-F44D
-F44E
-F44F
-F450
-F451
-F452
-F453
-F454
-F455
-F456
-F457
-F458
-F459
-F45A
-F45B
-F45C
-F45D
-F45E
-F45F
-F460
-F461
-F462
-F463
-F464
-F465
-F466
-F467
-F468
-F469
-F46A
-F46B
-F46C
-F46D
-F46E
-F46F
-F470
-F471
-F472
-F473
-F474
-F475
-F476
-F477
-F478
-F479
-F47A
-F47B
-F47C
-F47D
-F47E
-F480
-F481
-F482
-F483
-F484
-F485
-F486
-F487
-F488
-F489
-F48A
-F48B
-F48C
-F48D
-F48E
-F48F
-F490
-F491
-F492
-F493
-F494
-F495
-F496
-F497
-F498
-F499
-F49A
-F49B
-F49C
-F49D
-F49E
-F49F
-F4A0
-F4A1
-F4A2
-F4A3
-F4A4
-F4A5
-F4A6
-F4A7
-F4A8
-F4A9
-F4AA
-F4AB
-F4AC
-F4AD
-F4AE
-F4AF
-F4B0
-F4B1
-F4B2
-F4B3
-F4B4
-F4B5
-F4B6
-F4B7
-F4B8
-F4B9
-F4BA
-F4BB
-F4BC
-F4BD
-F4BE
-F4BF
-F4C0
-F4C1
-F4C2
-F4C3
-F4C4
-F4C5
-F4C6
-F4C7
-F4C8
-F4C9
-F4CA
-F4CB
-F4CC
-F4CD
-F4CE
-F4CF
-F4D0
-F4D1
-F4D2
-F4D3
-F4D4
-F4D5
-F4D6
-F4D7
-F4D8
-F4D9
-F4DA
-F4DB
-F4DC
-F4DD
-F4DE
-F4DF
-F4E0
-F4E1
-F4E2
-F4E3
-F4E4
-F4E5
-F4E6
-F4E7
-F4E8
-F4E9
-F4EA
-F4EB
-F4EC
-F4ED
-F4EE
-F4EF
-F4F0
-F4F1
-F4F2
-F4F3
-F4F4
-F4F5
-F4F6
-F4F7
-F4F8
-F4F9
-F4FA
-F4FB
-F4FC
-F540
-F541
-F542
-F543
-F544
-F545
-F546
-F547
-F548
-F549
-F54A
-F54B
-F54C
-F54D
-F54E
-F54F
-F550
-F551
-F552
-F553
-F554
-F555
-F556
-F557
-F558
-F559
-F55A
-F55B
-F55C
-F55D
-F55E
-F55F
-F560
-F561
-F562
-F563
-F564
-F565
-F566
-F567
-F568
-F569
-F56A
-F56B
-F56C
-F56D
-F56E
-F56F
-F570
-F571
-F572
-F573
-F574
-F575
-F576
-F577
-F578
-F579
-F57A
-F57B
-F57C
-F57D
-F57E
-F580
-F581
-F582
-F583
-F584
-F585
-F586
-F587
-F588
-F589
-F58A
-F58B
-F58C
-F58D
-F58E
-F58F
-F590
-F591
-F592
-F593
-F594
-F595
-F596
-F597
-F598
-F599
-F59A
-F59B
-F59C
-F59D
-F59E
-F59F
-F5A0
-F5A1
-F5A2
-F5A3
-F5A4
-F5A5
-F5A6
-F5A7
-F5A8
-F5A9
-F5AA
-F5AB
-F5AC
-F5AD
-F5AE
-F5AF
-F5B0
-F5B1
-F5B2
-F5B3
-F5B4
-F5B5
-F5B6
-F5B7
-F5B8
-F5B9
-F5BA
-F5BB
-F5BC
-F5BD
-F5BE
-F5BF
-F5C0
-F5C1
-F5C2
-F5C3
-F5C4
-F5C5
-F5C6
-F5C7
-F5C8
-F5C9
-F5CA
-F5CB
-F5CC
-F5CD
-F5CE
-F5CF
-F5D0
-F5D1
-F5D2
-F5D3
-F5D4
-F5D5
-F5D6
-F5D7
-F5D8
-F5D9
-F5DA
-F5DB
-F5DC
-F5DD
-F5DE
-F5DF
-F5E0
-F5E1
-F5E2
-F5E3
-F5E4
-F5E5
-F5E6
-F5E7
-F5E8
-F5E9
-F5EA
-F5EB
-F5EC
-F5ED
-F5EE
-F5EF
-F5F0
-F5F1
-F5F2
-F5F3
-F5F4
-F5F5
-F5F6
-F5F7
-F5F8
-F5F9
-F5FA
-F5FB
-F5FC
-F640
-F641
-F642
-F643
-F644
-F645
-F646
-F647
-F648
-F649
-F64A
-F64B
-F64C
-F64D
-F64E
-F64F
-F650
-F651
-F652
-F653
-F654
-F655
-F656
-F657
-F658
-F659
-F65A
-F65B
-F65C
-F65D
-F65E
-F65F
-F660
-F661
-F662
-F663
-F664
-F665
-F666
-F667
-F668
-F669
-F66A
-F66B
-F66C
-F66D
-F66E
-F66F
-F670
-F671
-F672
-F673
-F674
-F675
-F676
-F677
-F678
-F679
-F67A
-F67B
-F67C
-F67D
-F67E
-F680
-F681
-F682
-F683
-F684
-F685
-F686
-F687
-F688
-F689
-F68A
-F68B
-F68C
-F68D
-F68E
-F68F
-F690
-F691
-F692
-F693
-F694
-F695
-F696
-F697
-F698
-F699
-F69A
-F69B
-F69C
-F69D
-F69E
-F69F
-F6A0
-F6A1
-F6A2
-F6A3
-F6A4
-F6A5
-F6A6
-F6A7
-F6A8
-F6A9
-F6AA
-F6AB
-F6AC
-F6AD
-F6AE
-F6AF
-F6B0
-F6B1
-F6B2
-F6B3
-F6B4
-F6B5
-F6B6
-F6B7
-F6B8
-F6B9
-F6BA
-F6BB
-F6BC
-F6BD
-F6BE
-F6BF
-F6C0
-F6C1
-F6C2
-F6C3
-F6C4
-F6C5
-F6C6
-F6C7
-F6C8
-F6C9
-F6CA
-F6CB
-F6CC
-F6CD
-F6CE
-F6CF
-F6D0
-F6D1
-F6D2
-F6D3
-F6D4
-F6D5
-F6D6
-F6D7
-F6D8
-F6D9
-F6DA
-F6DB
-F6DC
-F6DD
-F6DE
-F6DF
-F6E0
-F6E1
-F6E2
-F6E3
-F6E4
-F6E5
-F6E6
-F6E7
-F6E8
-F6E9
-F6EA
-F6EB
-F6EC
-F6ED
-F6EE
-F6EF
-F6F0
-F6F1
-F6F2
-F6F3
-F6F4
-F6F5
-F6F6
-F6F7
-F6F8
-F6F9
-F6FA
-F6FB
-F6FC
-F740
-F741
-F742
-F743
-F744
-F745
-F746
-F747
-F748
-F749
-F74A
-F74B
-F74C
-F74D
-F74E
-F74F
-F750
-F751
-F752
-F753
-F754
-F755
-F756
-F757
-F758
-F759
-F75A
-F75B
-F75C
-F75D
-F75E
-F75F
-F760
-F761
-F762
-F763
-F764
-F765
-F766
-F767
-F768
-F769
-F76A
-F76B
-F76C
-F76D
-F76E
-F76F
-F770
-F771
-F772
-F773
-F774
-F775
-F776
-F777
-F778
-F779
-F77A
-F77B
-F77C
-F77D
-F77E
-F780
-F781
-F782
-F783
-F784
-F785
-F786
-F787
-F788
-F789
-F78A
-F78B
-F78C
-F78D
-F78E
-F78F
-F790
-F791
-F792
-F793
-F794
-F795
-F796
-F797
-F798
-F799
-F79A
-F79B
-F79C
-F79D
-F79E
-F79F
-F7A0
-F7A1
-F7A2
-F7A3
-F7A4
-F7A5
-F7A6
-F7A7
-F7A8
-F7A9
-F7AA
-F7AB
-F7AC
-F7AD
-F7AE
-F7AF
-F7B0
-F7B1
-F7B2
-F7B3
-F7B4
-F7B5
-F7B6
-F7B7
-F7B8
-F7B9
-F7BA
-F7BB
-F7BC
-F7BD
-F7BE
-F7BF
-F7C0
-F7C1
-F7C2
-F7C3
-F7C4
-F7C5
-F7C6
-F7C7
-F7C8
-F7C9
-F7CA
-F7CB
-F7CC
-F7CD
-F7CE
-F7CF
-F7D0
-F7D1
-F7D2
-F7D3
-F7D4
-F7D5
-F7D6
-F7D7
-F7D8
-F7D9
-F7DA
-F7DB
-F7DC
-F7DD
-F7DE
-F7DF
-F7E0
-F7E1
-F7E2
-F7E3
-F7E4
-F7E5
-F7E6
-F7E7
-F7E8
-F7E9
-F7EA
-F7EB
-F7EC
-F7ED
-F7EE
-F7EF
-F7F0
-F7F1
-F7F2
-F7F3
-F7F4
-F7F5
-F7F6
-F7F7
-F7F8
-F7F9
-F7FA
-F7FB
-F7FC
-F840
-F841
-F842
-F843
-F844
-F845
-F846
-F847
-F848
-F849
-F84A
-F84B
-F84C
-F84D
-F84E
-F84F
-F850
-F851
-F852
-F853
-F854
-F855
-F856
-F857
-F858
-F859
-F85A
-F85B
-F85C
-F85D
-F85E
-F85F
-F860
-F861
-F862
-F863
-F864
-F865
-F866
-F867
-F868
-F869
-F86A
-F86B
-F86C
-F86D
-F86E
-F86F
-F870
-F871
-F872
-F873
-F874
-F875
-F876
-F877
-F878
-F879
-F87A
-F87B
-F87C
-F87D
-F87E
-F880
-F881
-F882
-F883
-F884
-F885
-F886
-F887
-F888
-F889
-F88A
-F88B
-F88C
-F88D
-F88E
-F88F
-F890
-F891
-F892
-F893
-F894
-F895
-F896
-F897
-F898
-F899
-F89A
-F89B
-F89C
-F89D
-F89E
-F89F
-F8A0
-F8A1
-F8A2
-F8A3
-F8A4
-F8A5
-F8A6
-F8A7
-F8A8
-F8A9
-F8AA
-F8AB
-F8AC
-F8AD
-F8AE
-F8AF
-F8B0
-F8B1
-F8B2
-F8B3
-F8B4
-F8B5
-F8B6
-F8B7
-F8B8
-F8B9
-F8BA
-F8BB
-F8BC
-F8BD
-F8BE
-F8BF
-F8C0
-F8C1
-F8C2
-F8C3
-F8C4
-F8C5
-F8C6
-F8C7
-F8C8
-F8C9
-F8CA
-F8CB
-F8CC
-F8CD
-F8CE
-F8CF
-F8D0
-F8D1
-F8D2
-F8D3
-F8D4
-F8D5
-F8D6
-F8D7
-F8D8
-F8D9
-F8DA
-F8DB
-F8DC
-F8DD
-F8DE
-F8DF
-F8E0
-F8E1
-F8E2
-F8E3
-F8E4
-F8E5
-F8E6
-F8E7
-F8E8
-F8E9
-F8EA
-F8EB
-F8EC
-F8ED
-F8EE
-F8EF
-F8F0
-F8F1
-F8F2
-F8F3
-F8F4
-F8F5
-F8F6
-F8F7
-F8F8
-F8F9
-F8FA
-F8FB
-F8FC
-F940
-F941
-F942
-F943
-F944
-F945
-F946
-F947
-F948
-F949
-F94A
-F94B
-F94C
-F94D
-F94E
-F94F
-F950
-F951
-F952
-F953
-F954
-F955
-F956
-F957
-F958
-F959
-F95A
-F95B
-F95C
-F95D
-F95E
-F95F
-F960
-F961
-F962
-F963
-F964
-F965
-F966
-F967
-F968
-F969
-F96A
-F96B
-F96C
-F96D
-F96E
-F96F
-F970
-F971
-F972
-F973
-F974
-F975
-F976
-F977
-F978
-F979
-F97A
-F97B
-F97C
-F97D
-F97E
-F980
-F981
-F982
-F983
-F984
-F985
-F986
-F987
-F988
-F989
-F98A
-F98B
-F98C
-F98D
-F98E
-F98F
-F990
-F991
-F992
-F993
-F994
-F995
-F996
-F997
-F998
-F999
-F99A
-F99B
-F99C
-F99D
-F99E
-F99F
-F9A0
-F9A1
-F9A2
-F9A3
-F9A4
-F9A5
-F9A6
-F9A7
-F9A8
-F9A9
-F9AA
-F9AB
-F9AC
-F9AD
-F9AE
-F9AF
-F9B0
-F9B1
-F9B2
-F9B3
-F9B4
-F9B5
-F9B6
-F9B7
-F9B8
-F9B9
-F9BA
-F9BB
-F9BC
-F9BD
-F9BE
-F9BF
-F9C0
-F9C1
-F9C2
-F9C3
-F9C4
-F9C5
-F9C6
-F9C7
-F9C8
-F9C9
-F9CA
-F9CB
-F9CC
-F9CD
-F9CE
-F9CF
-F9D0
-F9D1
-F9D2
-F9D3
-F9D4
-F9D5
-F9D6
-F9D7
-F9D8
-F9D9
-F9DA
-F9DB
-F9DC
-F9DD
-F9DE
-F9DF
-F9E0
-F9E1
-F9E2
-F9E3
-F9E4
-F9E5
-F9E6
-F9E7
-F9E8
-F9E9
-F9EA
-F9EB
-F9EC
-F9ED
-F9EE
-F9EF
-F9F0
-F9F1
-F9F2
-F9F3
-F9F4
-F9F5
-F9F6
-F9F7
-F9F8
-F9F9
-F9FA
-F9FB
-F9FC
-CREATE TABLE t2 SELECT CONVERT(c1 USING ucs2) AS c1 FROM t1;
-SELECT HEX(c1) FROM t2;
-HEX(c1)
-0005
-007E
-2015
-FF3C
-FF5E
-2225
-FF0D
-FFE0
-FFE1
-FFE2
-2460
-2461
-2462
-2463
-2464
-2465
-2466
-2467
-2468
-2469
-246A
-246B
-246C
-246D
-246E
-246F
-2470
-2471
-2472
-2473
-2160
-2161
-2162
-2163
-2164
-2165
-2166
-2167
-2168
-2169
-3349
-3314
-3322
-334D
-3318
-3327
-3303
-3336
-3351
-3357
-330D
-3326
-3323
-332B
-334A
-333B
-339C
-339D
-339E
-338E
-338F
-33C4
-33A1
-337B
-301D
-301F
-2116
-33CD
-2121
-32A4
-32A5
-32A6
-32A7
-32A8
-3231
-3232
-3239
-337E
-337D
-337C
-2252
-2261
-222B
-222E
-2211
-221A
-22A5
-2220
-221F
-22BF
-2235
-2229
-222A
-7E8A
-891C
-9348
-9288
-84DC
-4FC9
-70BB
-6631
-68C8
-92F9
-66FB
-5F45
-4E28
-4EE1
-4EFC
-4F00
-4F03
-4F39
-4F56
-4F92
-4F8A
-4F9A
-4F94
-4FCD
-5040
-5022
-4FFF
-501E
-5046
-5070
-5042
-5094
-50F4
-50D8
-514A
-5164
-519D
-51BE
-51EC
-5215
-529C
-52A6
-52C0
-52DB
-5300
-5307
-5324
-5372
-5393
-53B2
-53DD
-FA0E
-549C
-548A
-54A9
-54FF
-5586
-5759
-5765
-57AC
-57C8
-57C7
-FA0F
-FA10
-589E
-58B2
-590B
-5953
-595B
-595D
-5963
-59A4
-59BA
-5B56
-5BC0
-752F
-5BD8
-5BEC
-5C1E
-5CA6
-5CBA
-5CF5
-5D27
-5D53
-FA11
-5D42
-5D6D
-5DB8
-5DB9
-5DD0
-5F21
-5F34
-5F67
-5FB7
-5FDE
-605D
-6085
-608A
-60DE
-60D5
-6120
-60F2
-6111
-6137
-6130
-6198
-6213
-62A6
-63F5
-6460
-649D
-64CE
-654E
-6600
-6615
-663B
-6609
-662E
-661E
-6624
-6665
-6657
-6659
-FA12
-6673
-6699
-66A0
-66B2
-66BF
-66FA
-670E
-F929
-6766
-67BB
-6852
-67C0
-6801
-6844
-68CF
-FA13
-6968
-FA14
-6998
-69E2
-6A30
-6A6B
-6A46
-6A73
-6A7E
-6AE2
-6AE4
-6BD6
-6C3F
-6C5C
-6C86
-6C6F
-6CDA
-6D04
-6D87
-6D6F
-6D96
-6DAC
-6DCF
-6DF8
-6DF2
-6DFC
-6E39
-6E5C
-6E27
-6E3C
-6EBF
-6F88
-6FB5
-6FF5
-7005
-7007
-7028
-7085
-70AB
-710F
-7104
-715C
-7146
-7147
-FA15
-71C1
-71FE
-72B1
-72BE
-7324
-FA16
-7377
-73BD
-73C9
-73D6
-73E3
-73D2
-7407
-73F5
-7426
-742A
-7429
-742E
-7462
-7489
-749F
-7501
-756F
-7682
-769C
-769E
-769B
-76A6
-FA17
-7746
-52AF
-7821
-784E
-7864
-787A
-7930
-FA18
-FA19
-FA1A
-7994
-FA1B
-799B
-7AD1
-7AE7
-FA1C
-7AEB
-7B9E
-FA1D
-7D48
-7D5C
-7DB7
-7DA0
-7DD6
-7E52
-7F47
-7FA1
-FA1E
-8301
-8362
-837F
-83C7
-83F6
-8448
-84B4
-8553
-8559
-856B
-FA1F
-85B0
-FA20
-FA21
-8807
-88F5
-8A12
-8A37
-8A79
-8AA7
-8ABE
-8ADF
-FA22
-8AF6
-8B53
-8B7F
-8CF0
-8CF4
-8D12
-8D76
-FA23
-8ECF
-FA24
-FA25
-9067
-90DE
-FA26
-9115
-9127
-91DA
-91D7
-91DE
-91ED
-91EE
-91E4
-91E5
-9206
-9210
-920A
-923A
-9240
-923C
-924E
-9259
-9251
-9239
-9267
-92A7
-9277
-9278
-92E7
-92D7
-92D9
-92D0
-FA27
-92D5
-92E0
-92D3
-9325
-9321
-92FB
-FA28
-931E
-92FF
-931D
-9302
-9370
-9357
-93A4
-93C6
-93DE
-93F8
-9431
-9445
-9448
-9592
-F9DC
-FA29
-969D
-96AF
-9733
-973B
-9743
-974D
-974F
-9751
-9755
-9857
-9865
-FA2A
-FA2B
-9927
-FA2C
-999E
-9A4E
-9AD9
-9ADC
-9B75
-9B72
-9B8F
-9BB1
-9BBB
-9C00
-9D70
-9D6B
-FA2D
-9E19
-9ED1
-2170
-2171
-2172
-2173
-2174
-2175
-2176
-2177
-2178
-2179
-FFE2
-FFE4
-FF07
-FF02
-2170
-2171
-2172
-2173
-2174
-2175
-2176
-2177
-2178
-2179
-2160
-2161
-2162
-2163
-2164
-2165
-2166
-2167
-2168
-2169
-FFE2
-FFE4
-FF07
-FF02
-3231
-2116
-2121
-2235
-7E8A
-891C
-9348
-9288
-84DC
-4FC9
-70BB
-6631
-68C8
-92F9
-66FB
-5F45
-4E28
-4EE1
-4EFC
-4F00
-4F03
-4F39
-4F56
-4F92
-4F8A
-4F9A
-4F94
-4FCD
-5040
-5022
-4FFF
-501E
-5046
-5070
-5042
-5094
-50F4
-50D8
-514A
-5164
-519D
-51BE
-51EC
-5215
-529C
-52A6
-52C0
-52DB
-5300
-5307
-5324
-5372
-5393
-53B2
-53DD
-FA0E
-549C
-548A
-54A9
-54FF
-5586
-5759
-5765
-57AC
-57C8
-57C7
-FA0F
-FA10
-589E
-58B2
-590B
-5953
-595B
-595D
-5963
-59A4
-59BA
-5B56
-5BC0
-752F
-5BD8
-5BEC
-5C1E
-5CA6
-5CBA
-5CF5
-5D27
-5D53
-FA11
-5D42
-5D6D
-5DB8
-5DB9
-5DD0
-5F21
-5F34
-5F67
-5FB7
-5FDE
-605D
-6085
-608A
-60DE
-60D5
-6120
-60F2
-6111
-6137
-6130
-6198
-6213
-62A6
-63F5
-6460
-649D
-64CE
-654E
-6600
-6615
-663B
-6609
-662E
-661E
-6624
-6665
-6657
-6659
-FA12
-6673
-6699
-66A0
-66B2
-66BF
-66FA
-670E
-F929
-6766
-67BB
-6852
-67C0
-6801
-6844
-68CF
-FA13
-6968
-FA14
-6998
-69E2
-6A30
-6A6B
-6A46
-6A73
-6A7E
-6AE2
-6AE4
-6BD6
-6C3F
-6C5C
-6C86
-6C6F
-6CDA
-6D04
-6D87
-6D6F
-6D96
-6DAC
-6DCF
-6DF8
-6DF2
-6DFC
-6E39
-6E5C
-6E27
-6E3C
-6EBF
-6F88
-6FB5
-6FF5
-7005
-7007
-7028
-7085
-70AB
-710F
-7104
-715C
-7146
-7147
-FA15
-71C1
-71FE
-72B1
-72BE
-7324
-FA16
-7377
-73BD
-73C9
-73D6
-73E3
-73D2
-7407
-73F5
-7426
-742A
-7429
-742E
-7462
-7489
-749F
-7501
-756F
-7682
-769C
-769E
-769B
-76A6
-FA17
-7746
-52AF
-7821
-784E
-7864
-787A
-7930
-FA18
-FA19
-FA1A
-7994
-FA1B
-799B
-7AD1
-7AE7
-FA1C
-7AEB
-7B9E
-FA1D
-7D48
-7D5C
-7DB7
-7DA0
-7DD6
-7E52
-7F47
-7FA1
-FA1E
-8301
-8362
-837F
-83C7
-83F6
-8448
-84B4
-8553
-8559
-856B
-FA1F
-85B0
-FA20
-FA21
-8807
-88F5
-8A12
-8A37
-8A79
-8AA7
-8ABE
-8ADF
-FA22
-8AF6
-8B53
-8B7F
-8CF0
-8CF4
-8D12
-8D76
-FA23
-8ECF
-FA24
-FA25
-9067
-90DE
-FA26
-9115
-9127
-91DA
-91D7
-91DE
-91ED
-91EE
-91E4
-91E5
-9206
-9210
-920A
-923A
-9240
-923C
-924E
-9259
-9251
-9239
-9267
-92A7
-9277
-9278
-92E7
-92D7
-92D9
-92D0
-FA27
-92D5
-92E0
-92D3
-9325
-9321
-92FB
-FA28
-931E
-92FF
-931D
-9302
-9370
-9357
-93A4
-93C6
-93DE
-93F8
-9431
-9445
-9448
-9592
-F9DC
-FA29
-969D
-96AF
-9733
-973B
-9743
-974D
-974F
-9751
-9755
-9857
-9865
-FA2A
-FA2B
-9927
-FA2C
-999E
-9A4E
-9AD9
-9ADC
-9B75
-9B72
-9B8F
-9BB1
-9BBB
-9C00
-9D70
-9D6B
-FA2D
-9E19
-9ED1
-E000
-E001
-E002
-E003
-E004
-E005
-E006
-E007
-E008
-E009
-E00A
-E00B
-E00C
-E00D
-E00E
-E00F
-E010
-E011
-E012
-E013
-E014
-E015
-E016
-E017
-E018
-E019
-E01A
-E01B
-E01C
-E01D
-E01E
-E01F
-E020
-E021
-E022
-E023
-E024
-E025
-E026
-E027
-E028
-E029
-E02A
-E02B
-E02C
-E02D
-E02E
-E02F
-E030
-E031
-E032
-E033
-E034
-E035
-E036
-E037
-E038
-E039
-E03A
-E03B
-E03C
-E03D
-E03E
-E03F
-E040
-E041
-E042
-E043
-E044
-E045
-E046
-E047
-E048
-E049
-E04A
-E04B
-E04C
-E04D
-E04E
-E04F
-E050
-E051
-E052
-E053
-E054
-E055
-E056
-E057
-E058
-E059
-E05A
-E05B
-E05C
-E05D
-E05E
-E05F
-E060
-E061
-E062
-E063
-E064
-E065
-E066
-E067
-E068
-E069
-E06A
-E06B
-E06C
-E06D
-E06E
-E06F
-E070
-E071
-E072
-E073
-E074
-E075
-E076
-E077
-E078
-E079
-E07A
-E07B
-E07C
-E07D
-E07E
-E07F
-E080
-E081
-E082
-E083
-E084
-E085
-E086
-E087
-E088
-E089
-E08A
-E08B
-E08C
-E08D
-E08E
-E08F
-E090
-E091
-E092
-E093
-E094
-E095
-E096
-E097
-E098
-E099
-E09A
-E09B
-E09C
-E09D
-E09E
-E09F
-E0A0
-E0A1
-E0A2
-E0A3
-E0A4
-E0A5
-E0A6
-E0A7
-E0A8
-E0A9
-E0AA
-E0AB
-E0AC
-E0AD
-E0AE
-E0AF
-E0B0
-E0B1
-E0B2
-E0B3
-E0B4
-E0B5
-E0B6
-E0B7
-E0B8
-E0B9
-E0BA
-E0BB
-E0BC
-E0BD
-E0BE
-E0BF
-E0C0
-E0C1
-E0C2
-E0C3
-E0C4
-E0C5
-E0C6
-E0C7
-E0C8
-E0C9
-E0CA
-E0CB
-E0CC
-E0CD
-E0CE
-E0CF
-E0D0
-E0D1
-E0D2
-E0D3
-E0D4
-E0D5
-E0D6
-E0D7
-E0D8
-E0D9
-E0DA
-E0DB
-E0DC
-E0DD
-E0DE
-E0DF
-E0E0
-E0E1
-E0E2
-E0E3
-E0E4
-E0E5
-E0E6
-E0E7
-E0E8
-E0E9
-E0EA
-E0EB
-E0EC
-E0ED
-E0EE
-E0EF
-E0F0
-E0F1
-E0F2
-E0F3
-E0F4
-E0F5
-E0F6
-E0F7
-E0F8
-E0F9
-E0FA
-E0FB
-E0FC
-E0FD
-E0FE
-E0FF
-E100
-E101
-E102
-E103
-E104
-E105
-E106
-E107
-E108
-E109
-E10A
-E10B
-E10C
-E10D
-E10E
-E10F
-E110
-E111
-E112
-E113
-E114
-E115
-E116
-E117
-E118
-E119
-E11A
-E11B
-E11C
-E11D
-E11E
-E11F
-E120
-E121
-E122
-E123
-E124
-E125
-E126
-E127
-E128
-E129
-E12A
-E12B
-E12C
-E12D
-E12E
-E12F
-E130
-E131
-E132
-E133
-E134
-E135
-E136
-E137
-E138
-E139
-E13A
-E13B
-E13C
-E13D
-E13E
-E13F
-E140
-E141
-E142
-E143
-E144
-E145
-E146
-E147
-E148
-E149
-E14A
-E14B
-E14C
-E14D
-E14E
-E14F
-E150
-E151
-E152
-E153
-E154
-E155
-E156
-E157
-E158
-E159
-E15A
-E15B
-E15C
-E15D
-E15E
-E15F
-E160
-E161
-E162
-E163
-E164
-E165
-E166
-E167
-E168
-E169
-E16A
-E16B
-E16C
-E16D
-E16E
-E16F
-E170
-E171
-E172
-E173
-E174
-E175
-E176
-E177
-E178
-E179
-E17A
-E17B
-E17C
-E17D
-E17E
-E17F
-E180
-E181
-E182
-E183
-E184
-E185
-E186
-E187
-E188
-E189
-E18A
-E18B
-E18C
-E18D
-E18E
-E18F
-E190
-E191
-E192
-E193
-E194
-E195
-E196
-E197
-E198
-E199
-E19A
-E19B
-E19C
-E19D
-E19E
-E19F
-E1A0
-E1A1
-E1A2
-E1A3
-E1A4
-E1A5
-E1A6
-E1A7
-E1A8
-E1A9
-E1AA
-E1AB
-E1AC
-E1AD
-E1AE
-E1AF
-E1B0
-E1B1
-E1B2
-E1B3
-E1B4
-E1B5
-E1B6
-E1B7
-E1B8
-E1B9
-E1BA
-E1BB
-E1BC
-E1BD
-E1BE
-E1BF
-E1C0
-E1C1
-E1C2
-E1C3
-E1C4
-E1C5
-E1C6
-E1C7
-E1C8
-E1C9
-E1CA
-E1CB
-E1CC
-E1CD
-E1CE
-E1CF
-E1D0
-E1D1
-E1D2
-E1D3
-E1D4
-E1D5
-E1D6
-E1D7
-E1D8
-E1D9
-E1DA
-E1DB
-E1DC
-E1DD
-E1DE
-E1DF
-E1E0
-E1E1
-E1E2
-E1E3
-E1E4
-E1E5
-E1E6
-E1E7
-E1E8
-E1E9
-E1EA
-E1EB
-E1EC
-E1ED
-E1EE
-E1EF
-E1F0
-E1F1
-E1F2
-E1F3
-E1F4
-E1F5
-E1F6
-E1F7
-E1F8
-E1F9
-E1FA
-E1FB
-E1FC
-E1FD
-E1FE
-E1FF
-E200
-E201
-E202
-E203
-E204
-E205
-E206
-E207
-E208
-E209
-E20A
-E20B
-E20C
-E20D
-E20E
-E20F
-E210
-E211
-E212
-E213
-E214
-E215
-E216
-E217
-E218
-E219
-E21A
-E21B
-E21C
-E21D
-E21E
-E21F
-E220
-E221
-E222
-E223
-E224
-E225
-E226
-E227
-E228
-E229
-E22A
-E22B
-E22C
-E22D
-E22E
-E22F
-E230
-E231
-E232
-E233
-E234
-E235
-E236
-E237
-E238
-E239
-E23A
-E23B
-E23C
-E23D
-E23E
-E23F
-E240
-E241
-E242
-E243
-E244
-E245
-E246
-E247
-E248
-E249
-E24A
-E24B
-E24C
-E24D
-E24E
-E24F
-E250
-E251
-E252
-E253
-E254
-E255
-E256
-E257
-E258
-E259
-E25A
-E25B
-E25C
-E25D
-E25E
-E25F
-E260
-E261
-E262
-E263
-E264
-E265
-E266
-E267
-E268
-E269
-E26A
-E26B
-E26C
-E26D
-E26E
-E26F
-E270
-E271
-E272
-E273
-E274
-E275
-E276
-E277
-E278
-E279
-E27A
-E27B
-E27C
-E27D
-E27E
-E27F
-E280
-E281
-E282
-E283
-E284
-E285
-E286
-E287
-E288
-E289
-E28A
-E28B
-E28C
-E28D
-E28E
-E28F
-E290
-E291
-E292
-E293
-E294
-E295
-E296
-E297
-E298
-E299
-E29A
-E29B
-E29C
-E29D
-E29E
-E29F
-E2A0
-E2A1
-E2A2
-E2A3
-E2A4
-E2A5
-E2A6
-E2A7
-E2A8
-E2A9
-E2AA
-E2AB
-E2AC
-E2AD
-E2AE
-E2AF
-E2B0
-E2B1
-E2B2
-E2B3
-E2B4
-E2B5
-E2B6
-E2B7
-E2B8
-E2B9
-E2BA
-E2BB
-E2BC
-E2BD
-E2BE
-E2BF
-E2C0
-E2C1
-E2C2
-E2C3
-E2C4
-E2C5
-E2C6
-E2C7
-E2C8
-E2C9
-E2CA
-E2CB
-E2CC
-E2CD
-E2CE
-E2CF
-E2D0
-E2D1
-E2D2
-E2D3
-E2D4
-E2D5
-E2D6
-E2D7
-E2D8
-E2D9
-E2DA
-E2DB
-E2DC
-E2DD
-E2DE
-E2DF
-E2E0
-E2E1
-E2E2
-E2E3
-E2E4
-E2E5
-E2E6
-E2E7
-E2E8
-E2E9
-E2EA
-E2EB
-E2EC
-E2ED
-E2EE
-E2EF
-E2F0
-E2F1
-E2F2
-E2F3
-E2F4
-E2F5
-E2F6
-E2F7
-E2F8
-E2F9
-E2FA
-E2FB
-E2FC
-E2FD
-E2FE
-E2FF
-E300
-E301
-E302
-E303
-E304
-E305
-E306
-E307
-E308
-E309
-E30A
-E30B
-E30C
-E30D
-E30E
-E30F
-E310
-E311
-E312
-E313
-E314
-E315
-E316
-E317
-E318
-E319
-E31A
-E31B
-E31C
-E31D
-E31E
-E31F
-E320
-E321
-E322
-E323
-E324
-E325
-E326
-E327
-E328
-E329
-E32A
-E32B
-E32C
-E32D
-E32E
-E32F
-E330
-E331
-E332
-E333
-E334
-E335
-E336
-E337
-E338
-E339
-E33A
-E33B
-E33C
-E33D
-E33E
-E33F
-E340
-E341
-E342
-E343
-E344
-E345
-E346
-E347
-E348
-E349
-E34A
-E34B
-E34C
-E34D
-E34E
-E34F
-E350
-E351
-E352
-E353
-E354
-E355
-E356
-E357
-E358
-E359
-E35A
-E35B
-E35C
-E35D
-E35E
-E35F
-E360
-E361
-E362
-E363
-E364
-E365
-E366
-E367
-E368
-E369
-E36A
-E36B
-E36C
-E36D
-E36E
-E36F
-E370
-E371
-E372
-E373
-E374
-E375
-E376
-E377
-E378
-E379
-E37A
-E37B
-E37C
-E37D
-E37E
-E37F
-E380
-E381
-E382
-E383
-E384
-E385
-E386
-E387
-E388
-E389
-E38A
-E38B
-E38C
-E38D
-E38E
-E38F
-E390
-E391
-E392
-E393
-E394
-E395
-E396
-E397
-E398
-E399
-E39A
-E39B
-E39C
-E39D
-E39E
-E39F
-E3A0
-E3A1
-E3A2
-E3A3
-E3A4
-E3A5
-E3A6
-E3A7
-E3A8
-E3A9
-E3AA
-E3AB
-E3AC
-E3AD
-E3AE
-E3AF
-E3B0
-E3B1
-E3B2
-E3B3
-E3B4
-E3B5
-E3B6
-E3B7
-E3B8
-E3B9
-E3BA
-E3BB
-E3BC
-E3BD
-E3BE
-E3BF
-E3C0
-E3C1
-E3C2
-E3C3
-E3C4
-E3C5
-E3C6
-E3C7
-E3C8
-E3C9
-E3CA
-E3CB
-E3CC
-E3CD
-E3CE
-E3CF
-E3D0
-E3D1
-E3D2
-E3D3
-E3D4
-E3D5
-E3D6
-E3D7
-E3D8
-E3D9
-E3DA
-E3DB
-E3DC
-E3DD
-E3DE
-E3DF
-E3E0
-E3E1
-E3E2
-E3E3
-E3E4
-E3E5
-E3E6
-E3E7
-E3E8
-E3E9
-E3EA
-E3EB
-E3EC
-E3ED
-E3EE
-E3EF
-E3F0
-E3F1
-E3F2
-E3F3
-E3F4
-E3F5
-E3F6
-E3F7
-E3F8
-E3F9
-E3FA
-E3FB
-E3FC
-E3FD
-E3FE
-E3FF
-E400
-E401
-E402
-E403
-E404
-E405
-E406
-E407
-E408
-E409
-E40A
-E40B
-E40C
-E40D
-E40E
-E40F
-E410
-E411
-E412
-E413
-E414
-E415
-E416
-E417
-E418
-E419
-E41A
-E41B
-E41C
-E41D
-E41E
-E41F
-E420
-E421
-E422
-E423
-E424
-E425
-E426
-E427
-E428
-E429
-E42A
-E42B
-E42C
-E42D
-E42E
-E42F
-E430
-E431
-E432
-E433
-E434
-E435
-E436
-E437
-E438
-E439
-E43A
-E43B
-E43C
-E43D
-E43E
-E43F
-E440
-E441
-E442
-E443
-E444
-E445
-E446
-E447
-E448
-E449
-E44A
-E44B
-E44C
-E44D
-E44E
-E44F
-E450
-E451
-E452
-E453
-E454
-E455
-E456
-E457
-E458
-E459
-E45A
-E45B
-E45C
-E45D
-E45E
-E45F
-E460
-E461
-E462
-E463
-E464
-E465
-E466
-E467
-E468
-E469
-E46A
-E46B
-E46C
-E46D
-E46E
-E46F
-E470
-E471
-E472
-E473
-E474
-E475
-E476
-E477
-E478
-E479
-E47A
-E47B
-E47C
-E47D
-E47E
-E47F
-E480
-E481
-E482
-E483
-E484
-E485
-E486
-E487
-E488
-E489
-E48A
-E48B
-E48C
-E48D
-E48E
-E48F
-E490
-E491
-E492
-E493
-E494
-E495
-E496
-E497
-E498
-E499
-E49A
-E49B
-E49C
-E49D
-E49E
-E49F
-E4A0
-E4A1
-E4A2
-E4A3
-E4A4
-E4A5
-E4A6
-E4A7
-E4A8
-E4A9
-E4AA
-E4AB
-E4AC
-E4AD
-E4AE
-E4AF
-E4B0
-E4B1
-E4B2
-E4B3
-E4B4
-E4B5
-E4B6
-E4B7
-E4B8
-E4B9
-E4BA
-E4BB
-E4BC
-E4BD
-E4BE
-E4BF
-E4C0
-E4C1
-E4C2
-E4C3
-E4C4
-E4C5
-E4C6
-E4C7
-E4C8
-E4C9
-E4CA
-E4CB
-E4CC
-E4CD
-E4CE
-E4CF
-E4D0
-E4D1
-E4D2
-E4D3
-E4D4
-E4D5
-E4D6
-E4D7
-E4D8
-E4D9
-E4DA
-E4DB
-E4DC
-E4DD
-E4DE
-E4DF
-E4E0
-E4E1
-E4E2
-E4E3
-E4E4
-E4E5
-E4E6
-E4E7
-E4E8
-E4E9
-E4EA
-E4EB
-E4EC
-E4ED
-E4EE
-E4EF
-E4F0
-E4F1
-E4F2
-E4F3
-E4F4
-E4F5
-E4F6
-E4F7
-E4F8
-E4F9
-E4FA
-E4FB
-E4FC
-E4FD
-E4FE
-E4FF
-E500
-E501
-E502
-E503
-E504
-E505
-E506
-E507
-E508
-E509
-E50A
-E50B
-E50C
-E50D
-E50E
-E50F
-E510
-E511
-E512
-E513
-E514
-E515
-E516
-E517
-E518
-E519
-E51A
-E51B
-E51C
-E51D
-E51E
-E51F
-E520
-E521
-E522
-E523
-E524
-E525
-E526
-E527
-E528
-E529
-E52A
-E52B
-E52C
-E52D
-E52E
-E52F
-E530
-E531
-E532
-E533
-E534
-E535
-E536
-E537
-E538
-E539
-E53A
-E53B
-E53C
-E53D
-E53E
-E53F
-E540
-E541
-E542
-E543
-E544
-E545
-E546
-E547
-E548
-E549
-E54A
-E54B
-E54C
-E54D
-E54E
-E54F
-E550
-E551
-E552
-E553
-E554
-E555
-E556
-E557
-E558
-E559
-E55A
-E55B
-E55C
-E55D
-E55E
-E55F
-E560
-E561
-E562
-E563
-E564
-E565
-E566
-E567
-E568
-E569
-E56A
-E56B
-E56C
-E56D
-E56E
-E56F
-E570
-E571
-E572
-E573
-E574
-E575
-E576
-E577
-E578
-E579
-E57A
-E57B
-E57C
-E57D
-E57E
-E57F
-E580
-E581
-E582
-E583
-E584
-E585
-E586
-E587
-E588
-E589
-E58A
-E58B
-E58C
-E58D
-E58E
-E58F
-E590
-E591
-E592
-E593
-E594
-E595
-E596
-E597
-E598
-E599
-E59A
-E59B
-E59C
-E59D
-E59E
-E59F
-E5A0
-E5A1
-E5A2
-E5A3
-E5A4
-E5A5
-E5A6
-E5A7
-E5A8
-E5A9
-E5AA
-E5AB
-E5AC
-E5AD
-E5AE
-E5AF
-E5B0
-E5B1
-E5B2
-E5B3
-E5B4
-E5B5
-E5B6
-E5B7
-E5B8
-E5B9
-E5BA
-E5BB
-E5BC
-E5BD
-E5BE
-E5BF
-E5C0
-E5C1
-E5C2
-E5C3
-E5C4
-E5C5
-E5C6
-E5C7
-E5C8
-E5C9
-E5CA
-E5CB
-E5CC
-E5CD
-E5CE
-E5CF
-E5D0
-E5D1
-E5D2
-E5D3
-E5D4
-E5D5
-E5D6
-E5D7
-E5D8
-E5D9
-E5DA
-E5DB
-E5DC
-E5DD
-E5DE
-E5DF
-E5E0
-E5E1
-E5E2
-E5E3
-E5E4
-E5E5
-E5E6
-E5E7
-E5E8
-E5E9
-E5EA
-E5EB
-E5EC
-E5ED
-E5EE
-E5EF
-E5F0
-E5F1
-E5F2
-E5F3
-E5F4
-E5F5
-E5F6
-E5F7
-E5F8
-E5F9
-E5FA
-E5FB
-E5FC
-E5FD
-E5FE
-E5FF
-E600
-E601
-E602
-E603
-E604
-E605
-E606
-E607
-E608
-E609
-E60A
-E60B
-E60C
-E60D
-E60E
-E60F
-E610
-E611
-E612
-E613
-E614
-E615
-E616
-E617
-E618
-E619
-E61A
-E61B
-E61C
-E61D
-E61E
-E61F
-E620
-E621
-E622
-E623
-E624
-E625
-E626
-E627
-E628
-E629
-E62A
-E62B
-E62C
-E62D
-E62E
-E62F
-E630
-E631
-E632
-E633
-E634
-E635
-E636
-E637
-E638
-E639
-E63A
-E63B
-E63C
-E63D
-E63E
-E63F
-E640
-E641
-E642
-E643
-E644
-E645
-E646
-E647
-E648
-E649
-E64A
-E64B
-E64C
-E64D
-E64E
-E64F
-E650
-E651
-E652
-E653
-E654
-E655
-E656
-E657
-E658
-E659
-E65A
-E65B
-E65C
-E65D
-E65E
-E65F
-E660
-E661
-E662
-E663
-E664
-E665
-E666
-E667
-E668
-E669
-E66A
-E66B
-E66C
-E66D
-E66E
-E66F
-E670
-E671
-E672
-E673
-E674
-E675
-E676
-E677
-E678
-E679
-E67A
-E67B
-E67C
-E67D
-E67E
-E67F
-E680
-E681
-E682
-E683
-E684
-E685
-E686
-E687
-E688
-E689
-E68A
-E68B
-E68C
-E68D
-E68E
-E68F
-E690
-E691
-E692
-E693
-E694
-E695
-E696
-E697
-E698
-E699
-E69A
-E69B
-E69C
-E69D
-E69E
-E69F
-E6A0
-E6A1
-E6A2
-E6A3
-E6A4
-E6A5
-E6A6
-E6A7
-E6A8
-E6A9
-E6AA
-E6AB
-E6AC
-E6AD
-E6AE
-E6AF
-E6B0
-E6B1
-E6B2
-E6B3
-E6B4
-E6B5
-E6B6
-E6B7
-E6B8
-E6B9
-E6BA
-E6BB
-E6BC
-E6BD
-E6BE
-E6BF
-E6C0
-E6C1
-E6C2
-E6C3
-E6C4
-E6C5
-E6C6
-E6C7
-E6C8
-E6C9
-E6CA
-E6CB
-E6CC
-E6CD
-E6CE
-E6CF
-E6D0
-E6D1
-E6D2
-E6D3
-E6D4
-E6D5
-E6D6
-E6D7
-E6D8
-E6D9
-E6DA
-E6DB
-E6DC
-E6DD
-E6DE
-E6DF
-E6E0
-E6E1
-E6E2
-E6E3
-E6E4
-E6E5
-E6E6
-E6E7
-E6E8
-E6E9
-E6EA
-E6EB
-E6EC
-E6ED
-E6EE
-E6EF
-E6F0
-E6F1
-E6F2
-E6F3
-E6F4
-E6F5
-E6F6
-E6F7
-E6F8
-E6F9
-E6FA
-E6FB
-E6FC
-E6FD
-E6FE
-E6FF
-E700
-E701
-E702
-E703
-E704
-E705
-E706
-E707
-E708
-E709
-E70A
-E70B
-E70C
-E70D
-E70E
-E70F
-E710
-E711
-E712
-E713
-E714
-E715
-E716
-E717
-E718
-E719
-E71A
-E71B
-E71C
-E71D
-E71E
-E71F
-E720
-E721
-E722
-E723
-E724
-E725
-E726
-E727
-E728
-E729
-E72A
-E72B
-E72C
-E72D
-E72E
-E72F
-E730
-E731
-E732
-E733
-E734
-E735
-E736
-E737
-E738
-E739
-E73A
-E73B
-E73C
-E73D
-E73E
-E73F
-E740
-E741
-E742
-E743
-E744
-E745
-E746
-E747
-E748
-E749
-E74A
-E74B
-E74C
-E74D
-E74E
-E74F
-E750
-E751
-E752
-E753
-E754
-E755
-E756
-E757
-CREATE TABLE t3 SELECT CONVERT(c1 USING cp932) AS c1 FROM t2;
-SELECT HEX(c1) FROM t3;
-HEX(c1)
-05
-7E
-815C
-815F
-8160
-8161
-817C
-8191
-8192
-81CA
-8740
-8741
-8742
-8743
-8744
-8745
-8746
-8747
-8748
-8749
-874A
-874B
-874C
-874D
-874E
-874F
-8750
-8751
-8752
-8753
-8754
-8755
-8756
-8757
-8758
-8759
-875A
-875B
-875C
-875D
-875F
-8760
-8761
-8762
-8763
-8764
-8765
-8766
-8767
-8768
-8769
-876A
-876B
-876C
-876D
-876E
-876F
-8770
-8771
-8772
-8773
-8774
-8775
-877E
-8780
-8781
-8782
-8783
-8784
-8785
-8786
-8787
-8788
-8789
-878A
-878B
-878C
-878D
-878E
-878F
-81E0
-81DF
-81E7
-8793
-8794
-81E3
-81DB
-81DA
-8798
-8799
-81E6
-81BF
-81BE
-FA5C
-FA5D
-FA5E
-FA5F
-FA60
-FA61
-FA62
-FA63
-FA64
-FA65
-FA66
-FA67
-FA68
-FA69
-FA6A
-FA6B
-FA6C
-FA6D
-FA6E
-FA6F
-FA70
-FA71
-FA72
-FA73
-FA74
-FA75
-FA76
-FA77
-FA78
-FA79
-FA7A
-FA7B
-FA7C
-FA7D
-FA7E
-FA80
-FA81
-FA82
-FA83
-FA84
-FA85
-FA86
-FA87
-FA88
-FA89
-FA8A
-FA8B
-FA8C
-FA8D
-FA8E
-FA8F
-FA90
-FA91
-FA92
-FA93
-FA94
-FA95
-FA96
-FA97
-FA98
-FA99
-FA9A
-FA9B
-FA9C
-FA9D
-FA9E
-FA9F
-FAA0
-FAA1
-FAA2
-FAA3
-FAA4
-FAA5
-FAA6
-FAA7
-FAA8
-FAA9
-FAAA
-FAAB
-FAAC
-FAAD
-FAAE
-FAAF
-FAB0
-FAB1
-FAB2
-FAB3
-FAB4
-FAB5
-FAB6
-FAB7
-FAB8
-FAB9
-FABA
-FABB
-FABC
-FABD
-FABE
-FABF
-FAC0
-FAC1
-FAC2
-FAC3
-FAC4
-FAC5
-FAC6
-FAC7
-FAC8
-FAC9
-FACA
-FACB
-FACC
-FACD
-FACE
-FACF
-FAD0
-FAD1
-FAD2
-FAD3
-FAD4
-FAD5
-FAD6
-FAD7
-FAD8
-FAD9
-FADA
-FADB
-FADC
-FADD
-FADE
-FADF
-FAE0
-FAE1
-FAE2
-FAE3
-FAE4
-FAE5
-FAE6
-FAE7
-FAE8
-FAE9
-FAEA
-FAEB
-FAEC
-FAED
-FAEE
-FAEF
-FAF0
-FAF1
-FAF2
-FAF3
-FAF4
-FAF5
-FAF6
-FAF7
-FAF8
-FAF9
-FAFA
-FAFB
-FAFC
-FB40
-FB41
-FB42
-FB43
-FB44
-FB45
-FB46
-FB47
-FB48
-FB49
-FB4A
-FB4B
-FB4C
-FB4D
-FB4E
-FB4F
-FB50
-FB51
-FB52
-FB53
-FB54
-FB55
-FB56
-FB57
-FB58
-FB59
-FB5A
-FB5B
-FB5C
-FB5D
-FB5E
-FB5F
-FB60
-FB61
-FB62
-FB63
-FB64
-FB65
-FB66
-FB67
-FB68
-FB69
-FB6A
-FB6B
-FB6C
-FB6D
-FB6E
-FB6F
-FB70
-FB71
-FB72
-FB73
-FB74
-FB75
-FB76
-FB77
-FB78
-FB79
-FB7A
-FB7B
-FB7C
-FB7D
-FB7E
-FB80
-FB81
-FB82
-FB83
-FB84
-FB85
-FB86
-FB87
-FB88
-FB89
-FB8A
-FB8B
-FB8C
-FB8D
-FB8E
-FB8F
-FB90
-FB91
-FB92
-FB93
-FB94
-FB95
-FB96
-FB97
-FB98
-FB99
-FB9A
-FB9B
-FB9C
-FB9D
-FB9E
-FB9F
-FBA0
-FBA1
-FBA2
-FBA3
-FBA4
-FBA5
-FBA6
-FBA7
-FBA8
-FBA9
-FBAA
-FBAB
-FBAC
-FBAD
-FBAE
-FBAF
-FBB0
-FBB1
-FBB2
-FBB3
-FBB4
-FBB5
-FBB6
-FBB7
-FBB8
-FBB9
-FBBA
-FBBB
-FBBC
-FBBD
-FBBE
-FBBF
-FBC0
-FBC1
-FBC2
-FBC3
-FBC4
-FBC5
-FBC6
-FBC7
-FBC8
-FBC9
-FBCA
-FBCB
-FBCC
-FBCD
-FBCE
-FBCF
-FBD0
-FBD1
-FBD2
-FBD3
-FBD4
-FBD5
-FBD6
-FBD7
-FBD8
-FBD9
-FBDA
-FBDB
-FBDC
-FBDD
-FBDE
-FBDF
-FBE0
-FBE1
-FBE2
-FBE3
-FBE4
-FBE5
-FBE6
-FBE7
-FBE8
-FBE9
-FBEA
-FBEB
-FBEC
-FBED
-FBEE
-FBEF
-FBF0
-FBF1
-FBF2
-FBF3
-FBF4
-FBF5
-FBF6
-FBF7
-FBF8
-FBF9
-FBFA
-FBFB
-FBFC
-FC40
-FC41
-FC42
-FC43
-FC44
-FC45
-FC46
-FC47
-FC48
-FC49
-FC4A
-FC4B
-FA40
-FA41
-FA42
-FA43
-FA44
-FA45
-FA46
-FA47
-FA48
-FA49
-81CA
-FA55
-FA56
-FA57
-FA40
-FA41
-FA42
-FA43
-FA44
-FA45
-FA46
-FA47
-FA48
-FA49
-8754
-8755
-8756
-8757
-8758
-8759
-875A
-875B
-875C
-875D
-81CA
-FA55
-FA56
-FA57
-878A
-8782
-8784
-81E6
-FA5C
-FA5D
-FA5E
-FA5F
-FA60
-FA61
-FA62
-FA63
-FA64
-FA65
-FA66
-FA67
-FA68
-FA69
-FA6A
-FA6B
-FA6C
-FA6D
-FA6E
-FA6F
-FA70
-FA71
-FA72
-FA73
-FA74
-FA75
-FA76
-FA77
-FA78
-FA79
-FA7A
-FA7B
-FA7C
-FA7D
-FA7E
-FA80
-FA81
-FA82
-FA83
-FA84
-FA85
-FA86
-FA87
-FA88
-FA89
-FA8A
-FA8B
-FA8C
-FA8D
-FA8E
-FA8F
-FA90
-FA91
-FA92
-FA93
-FA94
-FA95
-FA96
-FA97
-FA98
-FA99
-FA9A
-FA9B
-FA9C
-FA9D
-FA9E
-FA9F
-FAA0
-FAA1
-FAA2
-FAA3
-FAA4
-FAA5
-FAA6
-FAA7
-FAA8
-FAA9
-FAAA
-FAAB
-FAAC
-FAAD
-FAAE
-FAAF
-FAB0
-FAB1
-FAB2
-FAB3
-FAB4
-FAB5
-FAB6
-FAB7
-FAB8
-FAB9
-FABA
-FABB
-FABC
-FABD
-FABE
-FABF
-FAC0
-FAC1
-FAC2
-FAC3
-FAC4
-FAC5
-FAC6
-FAC7
-FAC8
-FAC9
-FACA
-FACB
-FACC
-FACD
-FACE
-FACF
-FAD0
-FAD1
-FAD2
-FAD3
-FAD4
-FAD5
-FAD6
-FAD7
-FAD8
-FAD9
-FADA
-FADB
-FADC
-FADD
-FADE
-FADF
-FAE0
-FAE1
-FAE2
-FAE3
-FAE4
-FAE5
-FAE6
-FAE7
-FAE8
-FAE9
-FAEA
-FAEB
-FAEC
-FAED
-FAEE
-FAEF
-FAF0
-FAF1
-FAF2
-FAF3
-FAF4
-FAF5
-FAF6
-FAF7
-FAF8
-FAF9
-FAFA
-FAFB
-FAFC
-FB40
-FB41
-FB42
-FB43
-FB44
-FB45
-FB46
-FB47
-FB48
-FB49
-FB4A
-FB4B
-FB4C
-FB4D
-FB4E
-FB4F
-FB50
-FB51
-FB52
-FB53
-FB54
-FB55
-FB56
-FB57
-FB58
-FB59
-FB5A
-FB5B
-FB5C
-FB5D
-FB5E
-FB5F
-FB60
-FB61
-FB62
-FB63
-FB64
-FB65
-FB66
-FB67
-FB68
-FB69
-FB6A
-FB6B
-FB6C
-FB6D
-FB6E
-FB6F
-FB70
-FB71
-FB72
-FB73
-FB74
-FB75
-FB76
-FB77
-FB78
-FB79
-FB7A
-FB7B
-FB7C
-FB7D
-FB7E
-FB80
-FB81
-FB82
-FB83
-FB84
-FB85
-FB86
-FB87
-FB88
-FB89
-FB8A
-FB8B
-FB8C
-FB8D
-FB8E
-FB8F
-FB90
-FB91
-FB92
-FB93
-FB94
-FB95
-FB96
-FB97
-FB98
-FB99
-FB9A
-FB9B
-FB9C
-FB9D
-FB9E
-FB9F
-FBA0
-FBA1
-FBA2
-FBA3
-FBA4
-FBA5
-FBA6
-FBA7
-FBA8
-FBA9
-FBAA
-FBAB
-FBAC
-FBAD
-FBAE
-FBAF
-FBB0
-FBB1
-FBB2
-FBB3
-FBB4
-FBB5
-FBB6
-FBB7
-FBB8
-FBB9
-FBBA
-FBBB
-FBBC
-FBBD
-FBBE
-FBBF
-FBC0
-FBC1
-FBC2
-FBC3
-FBC4
-FBC5
-FBC6
-FBC7
-FBC8
-FBC9
-FBCA
-FBCB
-FBCC
-FBCD
-FBCE
-FBCF
-FBD0
-FBD1
-FBD2
-FBD3
-FBD4
-FBD5
-FBD6
-FBD7
-FBD8
-FBD9
-FBDA
-FBDB
-FBDC
-FBDD
-FBDE
-FBDF
-FBE0
-FBE1
-FBE2
-FBE3
-FBE4
-FBE5
-FBE6
-FBE7
-FBE8
-FBE9
-FBEA
-FBEB
-FBEC
-FBED
-FBEE
-FBEF
-FBF0
-FBF1
-FBF2
-FBF3
-FBF4
-FBF5
-FBF6
-FBF7
-FBF8
-FBF9
-FBFA
-FBFB
-FBFC
-FC40
-FC41
-FC42
-FC43
-FC44
-FC45
-FC46
-FC47
-FC48
-FC49
-FC4A
-FC4B
-F040
-F041
-F042
-F043
-F044
-F045
-F046
-F047
-F048
-F049
-F04A
-F04B
-F04C
-F04D
-F04E
-F04F
-F050
-F051
-F052
-F053
-F054
-F055
-F056
-F057
-F058
-F059
-F05A
-F05B
-F05C
-F05D
-F05E
-F05F
-F060
-F061
-F062
-F063
-F064
-F065
-F066
-F067
-F068
-F069
-F06A
-F06B
-F06C
-F06D
-F06E
-F06F
-F070
-F071
-F072
-F073
-F074
-F075
-F076
-F077
-F078
-F079
-F07A
-F07B
-F07C
-F07D
-F07E
-F080
-F081
-F082
-F083
-F084
-F085
-F086
-F087
-F088
-F089
-F08A
-F08B
-F08C
-F08D
-F08E
-F08F
-F090
-F091
-F092
-F093
-F094
-F095
-F096
-F097
-F098
-F099
-F09A
-F09B
-F09C
-F09D
-F09E
-F09F
-F0A0
-F0A1
-F0A2
-F0A3
-F0A4
-F0A5
-F0A6
-F0A7
-F0A8
-F0A9
-F0AA
-F0AB
-F0AC
-F0AD
-F0AE
-F0AF
-F0B0
-F0B1
-F0B2
-F0B3
-F0B4
-F0B5
-F0B6
-F0B7
-F0B8
-F0B9
-F0BA
-F0BB
-F0BC
-F0BD
-F0BE
-F0BF
-F0C0
-F0C1
-F0C2
-F0C3
-F0C4
-F0C5
-F0C6
-F0C7
-F0C8
-F0C9
-F0CA
-F0CB
-F0CC
-F0CD
-F0CE
-F0CF
-F0D0
-F0D1
-F0D2
-F0D3
-F0D4
-F0D5
-F0D6
-F0D7
-F0D8
-F0D9
-F0DA
-F0DB
-F0DC
-F0DD
-F0DE
-F0DF
-F0E0
-F0E1
-F0E2
-F0E3
-F0E4
-F0E5
-F0E6
-F0E7
-F0E8
-F0E9
-F0EA
-F0EB
-F0EC
-F0ED
-F0EE
-F0EF
-F0F0
-F0F1
-F0F2
-F0F3
-F0F4
-F0F5
-F0F6
-F0F7
-F0F8
-F0F9
-F0FA
-F0FB
-F0FC
-F140
-F141
-F142
-F143
-F144
-F145
-F146
-F147
-F148
-F149
-F14A
-F14B
-F14C
-F14D
-F14E
-F14F
-F150
-F151
-F152
-F153
-F154
-F155
-F156
-F157
-F158
-F159
-F15A
-F15B
-F15C
-F15D
-F15E
-F15F
-F160
-F161
-F162
-F163
-F164
-F165
-F166
-F167
-F168
-F169
-F16A
-F16B
-F16C
-F16D
-F16E
-F16F
-F170
-F171
-F172
-F173
-F174
-F175
-F176
-F177
-F178
-F179
-F17A
-F17B
-F17C
-F17D
-F17E
-F180
-F181
-F182
-F183
-F184
-F185
-F186
-F187
-F188
-F189
-F18A
-F18B
-F18C
-F18D
-F18E
-F18F
-F190
-F191
-F192
-F193
-F194
-F195
-F196
-F197
-F198
-F199
-F19A
-F19B
-F19C
-F19D
-F19E
-F19F
-F1A0
-F1A1
-F1A2
-F1A3
-F1A4
-F1A5
-F1A6
-F1A7
-F1A8
-F1A9
-F1AA
-F1AB
-F1AC
-F1AD
-F1AE
-F1AF
-F1B0
-F1B1
-F1B2
-F1B3
-F1B4
-F1B5
-F1B6
-F1B7
-F1B8
-F1B9
-F1BA
-F1BB
-F1BC
-F1BD
-F1BE
-F1BF
-F1C0
-F1C1
-F1C2
-F1C3
-F1C4
-F1C5
-F1C6
-F1C7
-F1C8
-F1C9
-F1CA
-F1CB
-F1CC
-F1CD
-F1CE
-F1CF
-F1D0
-F1D1
-F1D2
-F1D3
-F1D4
-F1D5
-F1D6
-F1D7
-F1D8
-F1D9
-F1DA
-F1DB
-F1DC
-F1DD
-F1DE
-F1DF
-F1E0
-F1E1
-F1E2
-F1E3
-F1E4
-F1E5
-F1E6
-F1E7
-F1E8
-F1E9
-F1EA
-F1EB
-F1EC
-F1ED
-F1EE
-F1EF
-F1F0
-F1F1
-F1F2
-F1F3
-F1F4
-F1F5
-F1F6
-F1F7
-F1F8
-F1F9
-F1FA
-F1FB
-F1FC
-F240
-F241
-F242
-F243
-F244
-F245
-F246
-F247
-F248
-F249
-F24A
-F24B
-F24C
-F24D
-F24E
-F24F
-F250
-F251
-F252
-F253
-F254
-F255
-F256
-F257
-F258
-F259
-F25A
-F25B
-F25C
-F25D
-F25E
-F25F
-F260
-F261
-F262
-F263
-F264
-F265
-F266
-F267
-F268
-F269
-F26A
-F26B
-F26C
-F26D
-F26E
-F26F
-F270
-F271
-F272
-F273
-F274
-F275
-F276
-F277
-F278
-F279
-F27A
-F27B
-F27C
-F27D
-F27E
-F280
-F281
-F282
-F283
-F284
-F285
-F286
-F287
-F288
-F289
-F28A
-F28B
-F28C
-F28D
-F28E
-F28F
-F290
-F291
-F292
-F293
-F294
-F295
-F296
-F297
-F298
-F299
-F29A
-F29B
-F29C
-F29D
-F29E
-F29F
-F2A0
-F2A1
-F2A2
-F2A3
-F2A4
-F2A5
-F2A6
-F2A7
-F2A8
-F2A9
-F2AA
-F2AB
-F2AC
-F2AD
-F2AE
-F2AF
-F2B0
-F2B1
-F2B2
-F2B3
-F2B4
-F2B5
-F2B6
-F2B7
-F2B8
-F2B9
-F2BA
-F2BB
-F2BC
-F2BD
-F2BE
-F2BF
-F2C0
-F2C1
-F2C2
-F2C3
-F2C4
-F2C5
-F2C6
-F2C7
-F2C8
-F2C9
-F2CA
-F2CB
-F2CC
-F2CD
-F2CE
-F2CF
-F2D0
-F2D1
-F2D2
-F2D3
-F2D4
-F2D5
-F2D6
-F2D7
-F2D8
-F2D9
-F2DA
-F2DB
-F2DC
-F2DD
-F2DE
-F2DF
-F2E0
-F2E1
-F2E2
-F2E3
-F2E4
-F2E5
-F2E6
-F2E7
-F2E8
-F2E9
-F2EA
-F2EB
-F2EC
-F2ED
-F2EE
-F2EF
-F2F0
-F2F1
-F2F2
-F2F3
-F2F4
-F2F5
-F2F6
-F2F7
-F2F8
-F2F9
-F2FA
-F2FB
-F2FC
-F340
-F341
-F342
-F343
-F344
-F345
-F346
-F347
-F348
-F349
-F34A
-F34B
-F34C
-F34D
-F34E
-F34F
-F350
-F351
-F352
-F353
-F354
-F355
-F356
-F357
-F358
-F359
-F35A
-F35B
-F35C
-F35D
-F35E
-F35F
-F360
-F361
-F362
-F363
-F364
-F365
-F366
-F367
-F368
-F369
-F36A
-F36B
-F36C
-F36D
-F36E
-F36F
-F370
-F371
-F372
-F373
-F374
-F375
-F376
-F377
-F378
-F379
-F37A
-F37B
-F37C
-F37D
-F37E
-F380
-F381
-F382
-F383
-F384
-F385
-F386
-F387
-F388
-F389
-F38A
-F38B
-F38C
-F38D
-F38E
-F38F
-F390
-F391
-F392
-F393
-F394
-F395
-F396
-F397
-F398
-F399
-F39A
-F39B
-F39C
-F39D
-F39E
-F39F
-F3A0
-F3A1
-F3A2
-F3A3
-F3A4
-F3A5
-F3A6
-F3A7
-F3A8
-F3A9
-F3AA
-F3AB
-F3AC
-F3AD
-F3AE
-F3AF
-F3B0
-F3B1
-F3B2
-F3B3
-F3B4
-F3B5
-F3B6
-F3B7
-F3B8
-F3B9
-F3BA
-F3BB
-F3BC
-F3BD
-F3BE
-F3BF
-F3C0
-F3C1
-F3C2
-F3C3
-F3C4
-F3C5
-F3C6
-F3C7
-F3C8
-F3C9
-F3CA
-F3CB
-F3CC
-F3CD
-F3CE
-F3CF
-F3D0
-F3D1
-F3D2
-F3D3
-F3D4
-F3D5
-F3D6
-F3D7
-F3D8
-F3D9
-F3DA
-F3DB
-F3DC
-F3DD
-F3DE
-F3DF
-F3E0
-F3E1
-F3E2
-F3E3
-F3E4
-F3E5
-F3E6
-F3E7
-F3E8
-F3E9
-F3EA
-F3EB
-F3EC
-F3ED
-F3EE
-F3EF
-F3F0
-F3F1
-F3F2
-F3F3
-F3F4
-F3F5
-F3F6
-F3F7
-F3F8
-F3F9
-F3FA
-F3FB
-F3FC
-F440
-F441
-F442
-F443
-F444
-F445
-F446
-F447
-F448
-F449
-F44A
-F44B
-F44C
-F44D
-F44E
-F44F
-F450
-F451
-F452
-F453
-F454
-F455
-F456
-F457
-F458
-F459
-F45A
-F45B
-F45C
-F45D
-F45E
-F45F
-F460
-F461
-F462
-F463
-F464
-F465
-F466
-F467
-F468
-F469
-F46A
-F46B
-F46C
-F46D
-F46E
-F46F
-F470
-F471
-F472
-F473
-F474
-F475
-F476
-F477
-F478
-F479
-F47A
-F47B
-F47C
-F47D
-F47E
-F480
-F481
-F482
-F483
-F484
-F485
-F486
-F487
-F488
-F489
-F48A
-F48B
-F48C
-F48D
-F48E
-F48F
-F490
-F491
-F492
-F493
-F494
-F495
-F496
-F497
-F498
-F499
-F49A
-F49B
-F49C
-F49D
-F49E
-F49F
-F4A0
-F4A1
-F4A2
-F4A3
-F4A4
-F4A5
-F4A6
-F4A7
-F4A8
-F4A9
-F4AA
-F4AB
-F4AC
-F4AD
-F4AE
-F4AF
-F4B0
-F4B1
-F4B2
-F4B3
-F4B4
-F4B5
-F4B6
-F4B7
-F4B8
-F4B9
-F4BA
-F4BB
-F4BC
-F4BD
-F4BE
-F4BF
-F4C0
-F4C1
-F4C2
-F4C3
-F4C4
-F4C5
-F4C6
-F4C7
-F4C8
-F4C9
-F4CA
-F4CB
-F4CC
-F4CD
-F4CE
-F4CF
-F4D0
-F4D1
-F4D2
-F4D3
-F4D4
-F4D5
-F4D6
-F4D7
-F4D8
-F4D9
-F4DA
-F4DB
-F4DC
-F4DD
-F4DE
-F4DF
-F4E0
-F4E1
-F4E2
-F4E3
-F4E4
-F4E5
-F4E6
-F4E7
-F4E8
-F4E9
-F4EA
-F4EB
-F4EC
-F4ED
-F4EE
-F4EF
-F4F0
-F4F1
-F4F2
-F4F3
-F4F4
-F4F5
-F4F6
-F4F7
-F4F8
-F4F9
-F4FA
-F4FB
-F4FC
-F540
-F541
-F542
-F543
-F544
-F545
-F546
-F547
-F548
-F549
-F54A
-F54B
-F54C
-F54D
-F54E
-F54F
-F550
-F551
-F552
-F553
-F554
-F555
-F556
-F557
-F558
-F559
-F55A
-F55B
-F55C
-F55D
-F55E
-F55F
-F560
-F561
-F562
-F563
-F564
-F565
-F566
-F567
-F568
-F569
-F56A
-F56B
-F56C
-F56D
-F56E
-F56F
-F570
-F571
-F572
-F573
-F574
-F575
-F576
-F577
-F578
-F579
-F57A
-F57B
-F57C
-F57D
-F57E
-F580
-F581
-F582
-F583
-F584
-F585
-F586
-F587
-F588
-F589
-F58A
-F58B
-F58C
-F58D
-F58E
-F58F
-F590
-F591
-F592
-F593
-F594
-F595
-F596
-F597
-F598
-F599
-F59A
-F59B
-F59C
-F59D
-F59E
-F59F
-F5A0
-F5A1
-F5A2
-F5A3
-F5A4
-F5A5
-F5A6
-F5A7
-F5A8
-F5A9
-F5AA
-F5AB
-F5AC
-F5AD
-F5AE
-F5AF
-F5B0
-F5B1
-F5B2
-F5B3
-F5B4
-F5B5
-F5B6
-F5B7
-F5B8
-F5B9
-F5BA
-F5BB
-F5BC
-F5BD
-F5BE
-F5BF
-F5C0
-F5C1
-F5C2
-F5C3
-F5C4
-F5C5
-F5C6
-F5C7
-F5C8
-F5C9
-F5CA
-F5CB
-F5CC
-F5CD
-F5CE
-F5CF
-F5D0
-F5D1
-F5D2
-F5D3
-F5D4
-F5D5
-F5D6
-F5D7
-F5D8
-F5D9
-F5DA
-F5DB
-F5DC
-F5DD
-F5DE
-F5DF
-F5E0
-F5E1
-F5E2
-F5E3
-F5E4
-F5E5
-F5E6
-F5E7
-F5E8
-F5E9
-F5EA
-F5EB
-F5EC
-F5ED
-F5EE
-F5EF
-F5F0
-F5F1
-F5F2
-F5F3
-F5F4
-F5F5
-F5F6
-F5F7
-F5F8
-F5F9
-F5FA
-F5FB
-F5FC
-F640
-F641
-F642
-F643
-F644
-F645
-F646
-F647
-F648
-F649
-F64A
-F64B
-F64C
-F64D
-F64E
-F64F
-F650
-F651
-F652
-F653
-F654
-F655
-F656
-F657
-F658
-F659
-F65A
-F65B
-F65C
-F65D
-F65E
-F65F
-F660
-F661
-F662
-F663
-F664
-F665
-F666
-F667
-F668
-F669
-F66A
-F66B
-F66C
-F66D
-F66E
-F66F
-F670
-F671
-F672
-F673
-F674
-F675
-F676
-F677
-F678
-F679
-F67A
-F67B
-F67C
-F67D
-F67E
-F680
-F681
-F682
-F683
-F684
-F685
-F686
-F687
-F688
-F689
-F68A
-F68B
-F68C
-F68D
-F68E
-F68F
-F690
-F691
-F692
-F693
-F694
-F695
-F696
-F697
-F698
-F699
-F69A
-F69B
-F69C
-F69D
-F69E
-F69F
-F6A0
-F6A1
-F6A2
-F6A3
-F6A4
-F6A5
-F6A6
-F6A7
-F6A8
-F6A9
-F6AA
-F6AB
-F6AC
-F6AD
-F6AE
-F6AF
-F6B0
-F6B1
-F6B2
-F6B3
-F6B4
-F6B5
-F6B6
-F6B7
-F6B8
-F6B9
-F6BA
-F6BB
-F6BC
-F6BD
-F6BE
-F6BF
-F6C0
-F6C1
-F6C2
-F6C3
-F6C4
-F6C5
-F6C6
-F6C7
-F6C8
-F6C9
-F6CA
-F6CB
-F6CC
-F6CD
-F6CE
-F6CF
-F6D0
-F6D1
-F6D2
-F6D3
-F6D4
-F6D5
-F6D6
-F6D7
-F6D8
-F6D9
-F6DA
-F6DB
-F6DC
-F6DD
-F6DE
-F6DF
-F6E0
-F6E1
-F6E2
-F6E3
-F6E4
-F6E5
-F6E6
-F6E7
-F6E8
-F6E9
-F6EA
-F6EB
-F6EC
-F6ED
-F6EE
-F6EF
-F6F0
-F6F1
-F6F2
-F6F3
-F6F4
-F6F5
-F6F6
-F6F7
-F6F8
-F6F9
-F6FA
-F6FB
-F6FC
-F740
-F741
-F742
-F743
-F744
-F745
-F746
-F747
-F748
-F749
-F74A
-F74B
-F74C
-F74D
-F74E
-F74F
-F750
-F751
-F752
-F753
-F754
-F755
-F756
-F757
-F758
-F759
-F75A
-F75B
-F75C
-F75D
-F75E
-F75F
-F760
-F761
-F762
-F763
-F764
-F765
-F766
-F767
-F768
-F769
-F76A
-F76B
-F76C
-F76D
-F76E
-F76F
-F770
-F771
-F772
-F773
-F774
-F775
-F776
-F777
-F778
-F779
-F77A
-F77B
-F77C
-F77D
-F77E
-F780
-F781
-F782
-F783
-F784
-F785
-F786
-F787
-F788
-F789
-F78A
-F78B
-F78C
-F78D
-F78E
-F78F
-F790
-F791
-F792
-F793
-F794
-F795
-F796
-F797
-F798
-F799
-F79A
-F79B
-F79C
-F79D
-F79E
-F79F
-F7A0
-F7A1
-F7A2
-F7A3
-F7A4
-F7A5
-F7A6
-F7A7
-F7A8
-F7A9
-F7AA
-F7AB
-F7AC
-F7AD
-F7AE
-F7AF
-F7B0
-F7B1
-F7B2
-F7B3
-F7B4
-F7B5
-F7B6
-F7B7
-F7B8
-F7B9
-F7BA
-F7BB
-F7BC
-F7BD
-F7BE
-F7BF
-F7C0
-F7C1
-F7C2
-F7C3
-F7C4
-F7C5
-F7C6
-F7C7
-F7C8
-F7C9
-F7CA
-F7CB
-F7CC
-F7CD
-F7CE
-F7CF
-F7D0
-F7D1
-F7D2
-F7D3
-F7D4
-F7D5
-F7D6
-F7D7
-F7D8
-F7D9
-F7DA
-F7DB
-F7DC
-F7DD
-F7DE
-F7DF
-F7E0
-F7E1
-F7E2
-F7E3
-F7E4
-F7E5
-F7E6
-F7E7
-F7E8
-F7E9
-F7EA
-F7EB
-F7EC
-F7ED
-F7EE
-F7EF
-F7F0
-F7F1
-F7F2
-F7F3
-F7F4
-F7F5
-F7F6
-F7F7
-F7F8
-F7F9
-F7FA
-F7FB
-F7FC
-F840
-F841
-F842
-F843
-F844
-F845
-F846
-F847
-F848
-F849
-F84A
-F84B
-F84C
-F84D
-F84E
-F84F
-F850
-F851
-F852
-F853
-F854
-F855
-F856
-F857
-F858
-F859
-F85A
-F85B
-F85C
-F85D
-F85E
-F85F
-F860
-F861
-F862
-F863
-F864
-F865
-F866
-F867
-F868
-F869
-F86A
-F86B
-F86C
-F86D
-F86E
-F86F
-F870
-F871
-F872
-F873
-F874
-F875
-F876
-F877
-F878
-F879
-F87A
-F87B
-F87C
-F87D
-F87E
-F880
-F881
-F882
-F883
-F884
-F885
-F886
-F887
-F888
-F889
-F88A
-F88B
-F88C
-F88D
-F88E
-F88F
-F890
-F891
-F892
-F893
-F894
-F895
-F896
-F897
-F898
-F899
-F89A
-F89B
-F89C
-F89D
-F89E
-F89F
-F8A0
-F8A1
-F8A2
-F8A3
-F8A4
-F8A5
-F8A6
-F8A7
-F8A8
-F8A9
-F8AA
-F8AB
-F8AC
-F8AD
-F8AE
-F8AF
-F8B0
-F8B1
-F8B2
-F8B3
-F8B4
-F8B5
-F8B6
-F8B7
-F8B8
-F8B9
-F8BA
-F8BB
-F8BC
-F8BD
-F8BE
-F8BF
-F8C0
-F8C1
-F8C2
-F8C3
-F8C4
-F8C5
-F8C6
-F8C7
-F8C8
-F8C9
-F8CA
-F8CB
-F8CC
-F8CD
-F8CE
-F8CF
-F8D0
-F8D1
-F8D2
-F8D3
-F8D4
-F8D5
-F8D6
-F8D7
-F8D8
-F8D9
-F8DA
-F8DB
-F8DC
-F8DD
-F8DE
-F8DF
-F8E0
-F8E1
-F8E2
-F8E3
-F8E4
-F8E5
-F8E6
-F8E7
-F8E8
-F8E9
-F8EA
-F8EB
-F8EC
-F8ED
-F8EE
-F8EF
-F8F0
-F8F1
-F8F2
-F8F3
-F8F4
-F8F5
-F8F6
-F8F7
-F8F8
-F8F9
-F8FA
-F8FB
-F8FC
-F940
-F941
-F942
-F943
-F944
-F945
-F946
-F947
-F948
-F949
-F94A
-F94B
-F94C
-F94D
-F94E
-F94F
-F950
-F951
-F952
-F953
-F954
-F955
-F956
-F957
-F958
-F959
-F95A
-F95B
-F95C
-F95D
-F95E
-F95F
-F960
-F961
-F962
-F963
-F964
-F965
-F966
-F967
-F968
-F969
-F96A
-F96B
-F96C
-F96D
-F96E
-F96F
-F970
-F971
-F972
-F973
-F974
-F975
-F976
-F977
-F978
-F979
-F97A
-F97B
-F97C
-F97D
-F97E
-F980
-F981
-F982
-F983
-F984
-F985
-F986
-F987
-F988
-F989
-F98A
-F98B
-F98C
-F98D
-F98E
-F98F
-F990
-F991
-F992
-F993
-F994
-F995
-F996
-F997
-F998
-F999
-F99A
-F99B
-F99C
-F99D
-F99E
-F99F
-F9A0
-F9A1
-F9A2
-F9A3
-F9A4
-F9A5
-F9A6
-F9A7
-F9A8
-F9A9
-F9AA
-F9AB
-F9AC
-F9AD
-F9AE
-F9AF
-F9B0
-F9B1
-F9B2
-F9B3
-F9B4
-F9B5
-F9B6
-F9B7
-F9B8
-F9B9
-F9BA
-F9BB
-F9BC
-F9BD
-F9BE
-F9BF
-F9C0
-F9C1
-F9C2
-F9C3
-F9C4
-F9C5
-F9C6
-F9C7
-F9C8
-F9C9
-F9CA
-F9CB
-F9CC
-F9CD
-F9CE
-F9CF
-F9D0
-F9D1
-F9D2
-F9D3
-F9D4
-F9D5
-F9D6
-F9D7
-F9D8
-F9D9
-F9DA
-F9DB
-F9DC
-F9DD
-F9DE
-F9DF
-F9E0
-F9E1
-F9E2
-F9E3
-F9E4
-F9E5
-F9E6
-F9E7
-F9E8
-F9E9
-F9EA
-F9EB
-F9EC
-F9ED
-F9EE
-F9EF
-F9F0
-F9F1
-F9F2
-F9F3
-F9F4
-F9F5
-F9F6
-F9F7
-F9F8
-F9F9
-F9FA
-F9FB
-F9FC
-CREATE TABLE t4 SELECT CONVERT(c1 USING eucjpms) AS c1 FROM t1;
-SELECT HEX(c1) FROM t4;
-HEX(c1)
-05
-7E
-A1BD
-A1C0
-A1C1
-A1C2
-A1DD
-A1F1
-A1F2
-A2CC
-ADA1
-ADA2
-ADA3
-ADA4
-ADA5
-ADA6
-ADA7
-ADA8
-ADA9
-ADAA
-ADAB
-ADAC
-ADAD
-ADAE
-ADAF
-ADB0
-ADB1
-ADB2
-ADB3
-ADB4
-ADB5
-ADB6
-ADB7
-ADB8
-ADB9
-ADBA
-ADBB
-ADBC
-ADBD
-ADBE
-ADC0
-ADC1
-ADC2
-ADC3
-ADC4
-ADC5
-ADC6
-ADC7
-ADC8
-ADC9
-ADCA
-ADCB
-ADCC
-ADCD
-ADCE
-ADCF
-ADD0
-ADD1
-ADD2
-ADD3
-ADD4
-ADD5
-ADD6
-ADDF
-ADE0
-ADE1
-ADE2
-ADE3
-ADE4
-ADE5
-ADE6
-ADE7
-ADE8
-ADE9
-ADEA
-ADEB
-ADEC
-ADED
-ADEE
-ADEF
-A2E2
-A2E1
-A2E9
-ADF3
-ADF4
-A2E5
-A2DD
-A2DC
-ADF8
-ADF9
-A2E8
-A2C1
-A2C0
-8FD4E3
-8FDCDF
-8FE4E9
-8FE3F8
-8FD9A1
-8FB1BB
-8FF4AE
-8FC2AD
-8FC3FC
-8FE4D0
-8FC2BF
-8FBCF4
-8FB0A9
-8FB0C8
-8FF4AF
-8FB0D2
-8FB0D4
-8FB0E3
-8FB0EE
-8FB1A7
-8FB1A3
-8FB1AC
-8FB1A9
-8FB1BE
-8FB1DF
-8FB1D8
-8FB1C8
-8FB1D7
-8FB1E3
-8FB1F4
-8FB1E1
-8FB2A3
-8FF4B0
-8FB2BB
-8FB2E6
-8FB2ED
-8FB2F5
-8FB2FC
-8FF4B1
-8FB3B5
-8FB3D8
-8FB3DB
-8FB3E5
-8FB3EE
-8FB3FB
-8FF4B2
-8FF4B3
-8FB4C0
-8FB4C7
-8FB4D0
-8FB4DE
-8FF4B4
-8FB5AA
-8FF4B5
-8FB5AF
-8FB5C4
-8FB5E8
-8FF4B6
-8FB7C2
-8FB7E4
-8FB7E8
-8FB7E7
-8FF4B7
-8FF4B8
-8FF4B9
-8FB8CE
-8FB8E1
-8FB8F5
-8FB8F7
-8FB8F8
-8FB8FC
-8FB9AF
-8FB9B7
-8FBABE
-8FBADB
-8FCDAA
-8FBAE1
-8FF4BA
-8FBAEB
-8FBBB3
-8FBBB8
-8FF4BB
-8FBBCA
-8FF4BC
-8FF4BD
-8FBBD0
-8FBBDE
-8FBBF4
-8FBBF5
-8FBBF9
-8FBCE4
-8FBCED
-8FBCFE
-8FF4BE
-8FBDC2
-8FBDE7
-8FF4BF
-8FBDF0
-8FBEB0
-8FBEAC
-8FF4C0
-8FBEB3
-8FBEBD
-8FBECD
-8FBEC9
-8FBEE4
-8FBFA8
-8FBFC9
-8FC0C4
-8FC0E4
-8FC0F4
-8FC1A6
-8FF4C1
-8FC1F5
-8FC1FC
-8FF4C2
-8FC1F8
-8FC2AB
-8FC2A1
-8FC2A5
-8FF4C3
-8FC2B8
-8FC2BA
-8FF4C4
-8FC2C4
-8FC2D2
-8FC2D7
-8FC2DB
-8FC2DE
-8FC2ED
-8FC2F0
-8FF4C5
-8FC3A1
-8FC3B5
-8FC3C9
-8FC3B9
-8FF4C6
-8FC3D8
-8FC3FE
-8FF4C7
-8FC4CC
-8FF4C8
-8FC4D9
-8FC4EA
-8FC4FD
-8FF4C9
-8FC5A7
-8FC5B5
-8FC5B6
-8FF4CA
-8FC5D5
-8FC6B8
-8FC6D7
-8FC6E0
-8FC6EA
-8FC6E3
-8FC7A1
-8FC7AB
-8FC7C7
-8FC7C3
-8FC7CB
-8FC7CF
-8FC7D9
-8FF4CB
-8FF4CC
-8FC7E6
-8FC7EE
-8FC7FC
-8FC7EB
-8FC7F0
-8FC8B1
-8FC8E5
-8FC8F8
-8FC9A6
-8FC9AB
-8FC9AD
-8FF4CD
-8FC9CA
-8FC9D3
-8FC9E9
-8FC9E3
-8FC9FC
-8FC9F4
-8FC9F5
-8FF4CE
-8FCAB3
-8FCABD
-8FCAEF
-8FCAF1
-8FCBAE
-8FF4CF
-8FCBCA
-8FCBE6
-8FCBEA
-8FCBF0
-8FCBF4
-8FCBEE
-8FCCA5
-8FCBF9
-8FCCAB
-8FCCAE
-8FCCAD
-8FCCB2
-8FCCC2
-8FCCD0
-8FCCD9
-8FF4D0
-8FCDBB
-8FF4D1
-8FCEBB
-8FF4D2
-8FCEBA
-8FCEC3
-8FF4D3
-8FCEF2
-8FB3DD
-8FCFD5
-8FCFE2
-8FCFE9
-8FCFED
-8FF4D4
-8FF4D5
-8FF4D6
-8FF4D7
-8FD0E5
-8FF4D8
-8FD0E9
-8FD1E8
-8FF4D9
-8FF4DA
-8FD1EC
-8FD2BB
-8FF4DB
-8FD3E1
-8FD3E8
-8FD4A7
-8FF4DC
-8FF4DD
-8FD4D4
-8FD4F2
-8FD5AE
-8FF4DE
-8FD7DE
-8FF4DF
-8FD8A2
-8FD8B7
-8FD8C1
-8FD8D1
-8FD8F4
-8FD9C6
-8FD9C8
-8FD9D1
-8FF4E0
-8FF4E1
-8FF4E2
-8FF4E3
-8FF4E4
-8FDCD3
-8FDDC8
-8FDDD4
-8FDDEA
-8FDDFA
-8FDEA4
-8FDEB0
-8FF4E5
-8FDEB5
-8FDECB
-8FF4E6
-8FDFB9
-8FF4E7
-8FDFC3
-8FF4E8
-8FF4E9
-8FE0D9
-8FF4EA
-8FF4EB
-8FE1E2
-8FF4EC
-8FF4ED
-8FF4EE
-8FE2C7
-8FE3A8
-8FE3A6
-8FE3A9
-8FE3AF
-8FE3B0
-8FE3AA
-8FE3AB
-8FE3BC
-8FE3C1
-8FE3BF
-8FE3D5
-8FE3D8
-8FE3D6
-8FE3DF
-8FE3E3
-8FE3E1
-8FE3D4
-8FE3E9
-8FE4A6
-8FE3F1
-8FE3F2
-8FE4CB
-8FE4C1
-8FE4C3
-8FE4BE
-8FF4EF
-8FE4C0
-8FE4C7
-8FE4BF
-8FE4E0
-8FE4DE
-8FE4D1
-8FF4F0
-8FE4DC
-8FE4D2
-8FE4DB
-8FE4D4
-8FE4FA
-8FE4EF
-8FE5B3
-8FE5BF
-8FE5C9
-8FE5D0
-8FE5E2
-8FE5EA
-8FE5EB
-8FF4F1
-8FF4F2
-8FF4F3
-8FE6E8
-8FE6EF
-8FE7AC
-8FF4F4
-8FE7AE
-8FF4F5
-8FE7B1
-8FF4F6
-8FE7B2
-8FE8B1
-8FE8B6
-8FF4F7
-8FF4F8
-8FE8DD
-8FF4F9
-8FF4FA
-8FE9D1
-8FF4FB
-8FE9ED
-8FEACD
-8FF4FC
-8FEADB
-8FEAE6
-8FEAEA
-8FEBA5
-8FEBFB
-8FEBFA
-8FF4FD
-8FECD6
-8FF4FE
-8FF3F3
-8FF3F4
-8FF3F5
-8FF3F6
-8FF3F7
-8FF3F8
-8FF3F9
-8FF3FA
-8FF3FB
-8FF3FC
-A2CC
-8FA2C3
-8FF4A9
-8FF4AA
-8FF3F3
-8FF3F4
-8FF3F5
-8FF3F6
-8FF3F7
-8FF3F8
-8FF3F9
-8FF3FA
-8FF3FB
-8FF3FC
-ADB5
-ADB6
-ADB7
-ADB8
-ADB9
-ADBA
-ADBB
-ADBC
-ADBD
-ADBE
-A2CC
-8FA2C3
-8FF4A9
-8FF4AA
-ADEA
-ADE2
-ADE4
-A2E8
-8FD4E3
-8FDCDF
-8FE4E9
-8FE3F8
-8FD9A1
-8FB1BB
-8FF4AE
-8FC2AD
-8FC3FC
-8FE4D0
-8FC2BF
-8FBCF4
-8FB0A9
-8FB0C8
-8FF4AF
-8FB0D2
-8FB0D4
-8FB0E3
-8FB0EE
-8FB1A7
-8FB1A3
-8FB1AC
-8FB1A9
-8FB1BE
-8FB1DF
-8FB1D8
-8FB1C8
-8FB1D7
-8FB1E3
-8FB1F4
-8FB1E1
-8FB2A3
-8FF4B0
-8FB2BB
-8FB2E6
-8FB2ED
-8FB2F5
-8FB2FC
-8FF4B1
-8FB3B5
-8FB3D8
-8FB3DB
-8FB3E5
-8FB3EE
-8FB3FB
-8FF4B2
-8FF4B3
-8FB4C0
-8FB4C7
-8FB4D0
-8FB4DE
-8FF4B4
-8FB5AA
-8FF4B5
-8FB5AF
-8FB5C4
-8FB5E8
-8FF4B6
-8FB7C2
-8FB7E4
-8FB7E8
-8FB7E7
-8FF4B7
-8FF4B8
-8FF4B9
-8FB8CE
-8FB8E1
-8FB8F5
-8FB8F7
-8FB8F8
-8FB8FC
-8FB9AF
-8FB9B7
-8FBABE
-8FBADB
-8FCDAA
-8FBAE1
-8FF4BA
-8FBAEB
-8FBBB3
-8FBBB8
-8FF4BB
-8FBBCA
-8FF4BC
-8FF4BD
-8FBBD0
-8FBBDE
-8FBBF4
-8FBBF5
-8FBBF9
-8FBCE4
-8FBCED
-8FBCFE
-8FF4BE
-8FBDC2
-8FBDE7
-8FF4BF
-8FBDF0
-8FBEB0
-8FBEAC
-8FF4C0
-8FBEB3
-8FBEBD
-8FBECD
-8FBEC9
-8FBEE4
-8FBFA8
-8FBFC9
-8FC0C4
-8FC0E4
-8FC0F4
-8FC1A6
-8FF4C1
-8FC1F5
-8FC1FC
-8FF4C2
-8FC1F8
-8FC2AB
-8FC2A1
-8FC2A5
-8FF4C3
-8FC2B8
-8FC2BA
-8FF4C4
-8FC2C4
-8FC2D2
-8FC2D7
-8FC2DB
-8FC2DE
-8FC2ED
-8FC2F0
-8FF4C5
-8FC3A1
-8FC3B5
-8FC3C9
-8FC3B9
-8FF4C6
-8FC3D8
-8FC3FE
-8FF4C7
-8FC4CC
-8FF4C8
-8FC4D9
-8FC4EA
-8FC4FD
-8FF4C9
-8FC5A7
-8FC5B5
-8FC5B6
-8FF4CA
-8FC5D5
-8FC6B8
-8FC6D7
-8FC6E0
-8FC6EA
-8FC6E3
-8FC7A1
-8FC7AB
-8FC7C7
-8FC7C3
-8FC7CB
-8FC7CF
-8FC7D9
-8FF4CB
-8FF4CC
-8FC7E6
-8FC7EE
-8FC7FC
-8FC7EB
-8FC7F0
-8FC8B1
-8FC8E5
-8FC8F8
-8FC9A6
-8FC9AB
-8FC9AD
-8FF4CD
-8FC9CA
-8FC9D3
-8FC9E9
-8FC9E3
-8FC9FC
-8FC9F4
-8FC9F5
-8FF4CE
-8FCAB3
-8FCABD
-8FCAEF
-8FCAF1
-8FCBAE
-8FF4CF
-8FCBCA
-8FCBE6
-8FCBEA
-8FCBF0
-8FCBF4
-8FCBEE
-8FCCA5
-8FCBF9
-8FCCAB
-8FCCAE
-8FCCAD
-8FCCB2
-8FCCC2
-8FCCD0
-8FCCD9
-8FF4D0
-8FCDBB
-8FF4D1
-8FCEBB
-8FF4D2
-8FCEBA
-8FCEC3
-8FF4D3
-8FCEF2
-8FB3DD
-8FCFD5
-8FCFE2
-8FCFE9
-8FCFED
-8FF4D4
-8FF4D5
-8FF4D6
-8FF4D7
-8FD0E5
-8FF4D8
-8FD0E9
-8FD1E8
-8FF4D9
-8FF4DA
-8FD1EC
-8FD2BB
-8FF4DB
-8FD3E1
-8FD3E8
-8FD4A7
-8FF4DC
-8FF4DD
-8FD4D4
-8FD4F2
-8FD5AE
-8FF4DE
-8FD7DE
-8FF4DF
-8FD8A2
-8FD8B7
-8FD8C1
-8FD8D1
-8FD8F4
-8FD9C6
-8FD9C8
-8FD9D1
-8FF4E0
-8FF4E1
-8FF4E2
-8FF4E3
-8FF4E4
-8FDCD3
-8FDDC8
-8FDDD4
-8FDDEA
-8FDDFA
-8FDEA4
-8FDEB0
-8FF4E5
-8FDEB5
-8FDECB
-8FF4E6
-8FDFB9
-8FF4E7
-8FDFC3
-8FF4E8
-8FF4E9
-8FE0D9
-8FF4EA
-8FF4EB
-8FE1E2
-8FF4EC
-8FF4ED
-8FF4EE
-8FE2C7
-8FE3A8
-8FE3A6
-8FE3A9
-8FE3AF
-8FE3B0
-8FE3AA
-8FE3AB
-8FE3BC
-8FE3C1
-8FE3BF
-8FE3D5
-8FE3D8
-8FE3D6
-8FE3DF
-8FE3E3
-8FE3E1
-8FE3D4
-8FE3E9
-8FE4A6
-8FE3F1
-8FE3F2
-8FE4CB
-8FE4C1
-8FE4C3
-8FE4BE
-8FF4EF
-8FE4C0
-8FE4C7
-8FE4BF
-8FE4E0
-8FE4DE
-8FE4D1
-8FF4F0
-8FE4DC
-8FE4D2
-8FE4DB
-8FE4D4
-8FE4FA
-8FE4EF
-8FE5B3
-8FE5BF
-8FE5C9
-8FE5D0
-8FE5E2
-8FE5EA
-8FE5EB
-8FF4F1
-8FF4F2
-8FF4F3
-8FE6E8
-8FE6EF
-8FE7AC
-8FF4F4
-8FE7AE
-8FF4F5
-8FE7B1
-8FF4F6
-8FE7B2
-8FE8B1
-8FE8B6
-8FF4F7
-8FF4F8
-8FE8DD
-8FF4F9
-8FF4FA
-8FE9D1
-8FF4FB
-8FE9ED
-8FEACD
-8FF4FC
-8FEADB
-8FEAE6
-8FEAEA
-8FEBA5
-8FEBFB
-8FEBFA
-8FF4FD
-8FECD6
-8FF4FE
-F5A1
-F5A2
-F5A3
-F5A4
-F5A5
-F5A6
-F5A7
-F5A8
-F5A9
-F5AA
-F5AB
-F5AC
-F5AD
-F5AE
-F5AF
-F5B0
-F5B1
-F5B2
-F5B3
-F5B4
-F5B5
-F5B6
-F5B7
-F5B8
-F5B9
-F5BA
-F5BB
-F5BC
-F5BD
-F5BE
-F5BF
-F5C0
-F5C1
-F5C2
-F5C3
-F5C4
-F5C5
-F5C6
-F5C7
-F5C8
-F5C9
-F5CA
-F5CB
-F5CC
-F5CD
-F5CE
-F5CF
-F5D0
-F5D1
-F5D2
-F5D3
-F5D4
-F5D5
-F5D6
-F5D7
-F5D8
-F5D9
-F5DA
-F5DB
-F5DC
-F5DD
-F5DE
-F5DF
-F5E0
-F5E1
-F5E2
-F5E3
-F5E4
-F5E5
-F5E6
-F5E7
-F5E8
-F5E9
-F5EA
-F5EB
-F5EC
-F5ED
-F5EE
-F5EF
-F5F0
-F5F1
-F5F2
-F5F3
-F5F4
-F5F5
-F5F6
-F5F7
-F5F8
-F5F9
-F5FA
-F5FB
-F5FC
-F5FD
-F5FE
-F6A1
-F6A2
-F6A3
-F6A4
-F6A5
-F6A6
-F6A7
-F6A8
-F6A9
-F6AA
-F6AB
-F6AC
-F6AD
-F6AE
-F6AF
-F6B0
-F6B1
-F6B2
-F6B3
-F6B4
-F6B5
-F6B6
-F6B7
-F6B8
-F6B9
-F6BA
-F6BB
-F6BC
-F6BD
-F6BE
-F6BF
-F6C0
-F6C1
-F6C2
-F6C3
-F6C4
-F6C5
-F6C6
-F6C7
-F6C8
-F6C9
-F6CA
-F6CB
-F6CC
-F6CD
-F6CE
-F6CF
-F6D0
-F6D1
-F6D2
-F6D3
-F6D4
-F6D5
-F6D6
-F6D7
-F6D8
-F6D9
-F6DA
-F6DB
-F6DC
-F6DD
-F6DE
-F6DF
-F6E0
-F6E1
-F6E2
-F6E3
-F6E4
-F6E5
-F6E6
-F6E7
-F6E8
-F6E9
-F6EA
-F6EB
-F6EC
-F6ED
-F6EE
-F6EF
-F6F0
-F6F1
-F6F2
-F6F3
-F6F4
-F6F5
-F6F6
-F6F7
-F6F8
-F6F9
-F6FA
-F6FB
-F6FC
-F6FD
-F6FE
-F7A1
-F7A2
-F7A3
-F7A4
-F7A5
-F7A6
-F7A7
-F7A8
-F7A9
-F7AA
-F7AB
-F7AC
-F7AD
-F7AE
-F7AF
-F7B0
-F7B1
-F7B2
-F7B3
-F7B4
-F7B5
-F7B6
-F7B7
-F7B8
-F7B9
-F7BA
-F7BB
-F7BC
-F7BD
-F7BE
-F7BF
-F7C0
-F7C1
-F7C2
-F7C3
-F7C4
-F7C5
-F7C6
-F7C7
-F7C8
-F7C9
-F7CA
-F7CB
-F7CC
-F7CD
-F7CE
-F7CF
-F7D0
-F7D1
-F7D2
-F7D3
-F7D4
-F7D5
-F7D6
-F7D7
-F7D8
-F7D9
-F7DA
-F7DB
-F7DC
-F7DD
-F7DE
-F7DF
-F7E0
-F7E1
-F7E2
-F7E3
-F7E4
-F7E5
-F7E6
-F7E7
-F7E8
-F7E9
-F7EA
-F7EB
-F7EC
-F7ED
-F7EE
-F7EF
-F7F0
-F7F1
-F7F2
-F7F3
-F7F4
-F7F5
-F7F6
-F7F7
-F7F8
-F7F9
-F7FA
-F7FB
-F7FC
-F7FD
-F7FE
-F8A1
-F8A2
-F8A3
-F8A4
-F8A5
-F8A6
-F8A7
-F8A8
-F8A9
-F8AA
-F8AB
-F8AC
-F8AD
-F8AE
-F8AF
-F8B0
-F8B1
-F8B2
-F8B3
-F8B4
-F8B5
-F8B6
-F8B7
-F8B8
-F8B9
-F8BA
-F8BB
-F8BC
-F8BD
-F8BE
-F8BF
-F8C0
-F8C1
-F8C2
-F8C3
-F8C4
-F8C5
-F8C6
-F8C7
-F8C8
-F8C9
-F8CA
-F8CB
-F8CC
-F8CD
-F8CE
-F8CF
-F8D0
-F8D1
-F8D2
-F8D3
-F8D4
-F8D5
-F8D6
-F8D7
-F8D8
-F8D9
-F8DA
-F8DB
-F8DC
-F8DD
-F8DE
-F8DF
-F8E0
-F8E1
-F8E2
-F8E3
-F8E4
-F8E5
-F8E6
-F8E7
-F8E8
-F8E9
-F8EA
-F8EB
-F8EC
-F8ED
-F8EE
-F8EF
-F8F0
-F8F1
-F8F2
-F8F3
-F8F4
-F8F5
-F8F6
-F8F7
-F8F8
-F8F9
-F8FA
-F8FB
-F8FC
-F8FD
-F8FE
-F9A1
-F9A2
-F9A3
-F9A4
-F9A5
-F9A6
-F9A7
-F9A8
-F9A9
-F9AA
-F9AB
-F9AC
-F9AD
-F9AE
-F9AF
-F9B0
-F9B1
-F9B2
-F9B3
-F9B4
-F9B5
-F9B6
-F9B7
-F9B8
-F9B9
-F9BA
-F9BB
-F9BC
-F9BD
-F9BE
-F9BF
-F9C0
-F9C1
-F9C2
-F9C3
-F9C4
-F9C5
-F9C6
-F9C7
-F9C8
-F9C9
-F9CA
-F9CB
-F9CC
-F9CD
-F9CE
-F9CF
-F9D0
-F9D1
-F9D2
-F9D3
-F9D4
-F9D5
-F9D6
-F9D7
-F9D8
-F9D9
-F9DA
-F9DB
-F9DC
-F9DD
-F9DE
-F9DF
-F9E0
-F9E1
-F9E2
-F9E3
-F9E4
-F9E5
-F9E6
-F9E7
-F9E8
-F9E9
-F9EA
-F9EB
-F9EC
-F9ED
-F9EE
-F9EF
-F9F0
-F9F1
-F9F2
-F9F3
-F9F4
-F9F5
-F9F6
-F9F7
-F9F8
-F9F9
-F9FA
-F9FB
-F9FC
-F9FD
-F9FE
-FAA1
-FAA2
-FAA3
-FAA4
-FAA5
-FAA6
-FAA7
-FAA8
-FAA9
-FAAA
-FAAB
-FAAC
-FAAD
-FAAE
-FAAF
-FAB0
-FAB1
-FAB2
-FAB3
-FAB4
-FAB5
-FAB6
-FAB7
-FAB8
-FAB9
-FABA
-FABB
-FABC
-FABD
-FABE
-FABF
-FAC0
-FAC1
-FAC2
-FAC3
-FAC4
-FAC5
-FAC6
-FAC7
-FAC8
-FAC9
-FACA
-FACB
-FACC
-FACD
-FACE
-FACF
-FAD0
-FAD1
-FAD2
-FAD3
-FAD4
-FAD5
-FAD6
-FAD7
-FAD8
-FAD9
-FADA
-FADB
-FADC
-FADD
-FADE
-FADF
-FAE0
-FAE1
-FAE2
-FAE3
-FAE4
-FAE5
-FAE6
-FAE7
-FAE8
-FAE9
-FAEA
-FAEB
-FAEC
-FAED
-FAEE
-FAEF
-FAF0
-FAF1
-FAF2
-FAF3
-FAF4
-FAF5
-FAF6
-FAF7
-FAF8
-FAF9
-FAFA
-FAFB
-FAFC
-FAFD
-FAFE
-FBA1
-FBA2
-FBA3
-FBA4
-FBA5
-FBA6
-FBA7
-FBA8
-FBA9
-FBAA
-FBAB
-FBAC
-FBAD
-FBAE
-FBAF
-FBB0
-FBB1
-FBB2
-FBB3
-FBB4
-FBB5
-FBB6
-FBB7
-FBB8
-FBB9
-FBBA
-FBBB
-FBBC
-FBBD
-FBBE
-FBBF
-FBC0
-FBC1
-FBC2
-FBC3
-FBC4
-FBC5
-FBC6
-FBC7
-FBC8
-FBC9
-FBCA
-FBCB
-FBCC
-FBCD
-FBCE
-FBCF
-FBD0
-FBD1
-FBD2
-FBD3
-FBD4
-FBD5
-FBD6
-FBD7
-FBD8
-FBD9
-FBDA
-FBDB
-FBDC
-FBDD
-FBDE
-FBDF
-FBE0
-FBE1
-FBE2
-FBE3
-FBE4
-FBE5
-FBE6
-FBE7
-FBE8
-FBE9
-FBEA
-FBEB
-FBEC
-FBED
-FBEE
-FBEF
-FBF0
-FBF1
-FBF2
-FBF3
-FBF4
-FBF5
-FBF6
-FBF7
-FBF8
-FBF9
-FBFA
-FBFB
-FBFC
-FBFD
-FBFE
-FCA1
-FCA2
-FCA3
-FCA4
-FCA5
-FCA6
-FCA7
-FCA8
-FCA9
-FCAA
-FCAB
-FCAC
-FCAD
-FCAE
-FCAF
-FCB0
-FCB1
-FCB2
-FCB3
-FCB4
-FCB5
-FCB6
-FCB7
-FCB8
-FCB9
-FCBA
-FCBB
-FCBC
-FCBD
-FCBE
-FCBF
-FCC0
-FCC1
-FCC2
-FCC3
-FCC4
-FCC5
-FCC6
-FCC7
-FCC8
-FCC9
-FCCA
-FCCB
-FCCC
-FCCD
-FCCE
-FCCF
-FCD0
-FCD1
-FCD2
-FCD3
-FCD4
-FCD5
-FCD6
-FCD7
-FCD8
-FCD9
-FCDA
-FCDB
-FCDC
-FCDD
-FCDE
-FCDF
-FCE0
-FCE1
-FCE2
-FCE3
-FCE4
-FCE5
-FCE6
-FCE7
-FCE8
-FCE9
-FCEA
-FCEB
-FCEC
-FCED
-FCEE
-FCEF
-FCF0
-FCF1
-FCF2
-FCF3
-FCF4
-FCF5
-FCF6
-FCF7
-FCF8
-FCF9
-FCFA
-FCFB
-FCFC
-FCFD
-FCFE
-FDA1
-FDA2
-FDA3
-FDA4
-FDA5
-FDA6
-FDA7
-FDA8
-FDA9
-FDAA
-FDAB
-FDAC
-FDAD
-FDAE
-FDAF
-FDB0
-FDB1
-FDB2
-FDB3
-FDB4
-FDB5
-FDB6
-FDB7
-FDB8
-FDB9
-FDBA
-FDBB
-FDBC
-FDBD
-FDBE
-FDBF
-FDC0
-FDC1
-FDC2
-FDC3
-FDC4
-FDC5
-FDC6
-FDC7
-FDC8
-FDC9
-FDCA
-FDCB
-FDCC
-FDCD
-FDCE
-FDCF
-FDD0
-FDD1
-FDD2
-FDD3
-FDD4
-FDD5
-FDD6
-FDD7
-FDD8
-FDD9
-FDDA
-FDDB
-FDDC
-FDDD
-FDDE
-FDDF
-FDE0
-FDE1
-FDE2
-FDE3
-FDE4
-FDE5
-FDE6
-FDE7
-FDE8
-FDE9
-FDEA
-FDEB
-FDEC
-FDED
-FDEE
-FDEF
-FDF0
-FDF1
-FDF2
-FDF3
-FDF4
-FDF5
-FDF6
-FDF7
-FDF8
-FDF9
-FDFA
-FDFB
-FDFC
-FDFD
-FDFE
-FEA1
-FEA2
-FEA3
-FEA4
-FEA5
-FEA6
-FEA7
-FEA8
-FEA9
-FEAA
-FEAB
-FEAC
-FEAD
-FEAE
-FEAF
-FEB0
-FEB1
-FEB2
-FEB3
-FEB4
-FEB5
-FEB6
-FEB7
-FEB8
-FEB9
-FEBA
-FEBB
-FEBC
-FEBD
-FEBE
-FEBF
-FEC0
-FEC1
-FEC2
-FEC3
-FEC4
-FEC5
-FEC6
-FEC7
-FEC8
-FEC9
-FECA
-FECB
-FECC
-FECD
-FECE
-FECF
-FED0
-FED1
-FED2
-FED3
-FED4
-FED5
-FED6
-FED7
-FED8
-FED9
-FEDA
-FEDB
-FEDC
-FEDD
-FEDE
-FEDF
-FEE0
-FEE1
-FEE2
-FEE3
-FEE4
-FEE5
-FEE6
-FEE7
-FEE8
-FEE9
-FEEA
-FEEB
-FEEC
-FEED
-FEEE
-FEEF
-FEF0
-FEF1
-FEF2
-FEF3
-FEF4
-FEF5
-FEF6
-FEF7
-FEF8
-FEF9
-FEFA
-FEFB
-FEFC
-FEFD
-FEFE
-8FF5A1
-8FF5A2
-8FF5A3
-8FF5A4
-8FF5A5
-8FF5A6
-8FF5A7
-8FF5A8
-8FF5A9
-8FF5AA
-8FF5AB
-8FF5AC
-8FF5AD
-8FF5AE
-8FF5AF
-8FF5B0
-8FF5B1
-8FF5B2
-8FF5B3
-8FF5B4
-8FF5B5
-8FF5B6
-8FF5B7
-8FF5B8
-8FF5B9
-8FF5BA
-8FF5BB
-8FF5BC
-8FF5BD
-8FF5BE
-8FF5BF
-8FF5C0
-8FF5C1
-8FF5C2
-8FF5C3
-8FF5C4
-8FF5C5
-8FF5C6
-8FF5C7
-8FF5C8
-8FF5C9
-8FF5CA
-8FF5CB
-8FF5CC
-8FF5CD
-8FF5CE
-8FF5CF
-8FF5D0
-8FF5D1
-8FF5D2
-8FF5D3
-8FF5D4
-8FF5D5
-8FF5D6
-8FF5D7
-8FF5D8
-8FF5D9
-8FF5DA
-8FF5DB
-8FF5DC
-8FF5DD
-8FF5DE
-8FF5DF
-8FF5E0
-8FF5E1
-8FF5E2
-8FF5E3
-8FF5E4
-8FF5E5
-8FF5E6
-8FF5E7
-8FF5E8
-8FF5E9
-8FF5EA
-8FF5EB
-8FF5EC
-8FF5ED
-8FF5EE
-8FF5EF
-8FF5F0
-8FF5F1
-8FF5F2
-8FF5F3
-8FF5F4
-8FF5F5
-8FF5F6
-8FF5F7
-8FF5F8
-8FF5F9
-8FF5FA
-8FF5FB
-8FF5FC
-8FF5FD
-8FF5FE
-8FF6A1
-8FF6A2
-8FF6A3
-8FF6A4
-8FF6A5
-8FF6A6
-8FF6A7
-8FF6A8
-8FF6A9
-8FF6AA
-8FF6AB
-8FF6AC
-8FF6AD
-8FF6AE
-8FF6AF
-8FF6B0
-8FF6B1
-8FF6B2
-8FF6B3
-8FF6B4
-8FF6B5
-8FF6B6
-8FF6B7
-8FF6B8
-8FF6B9
-8FF6BA
-8FF6BB
-8FF6BC
-8FF6BD
-8FF6BE
-8FF6BF
-8FF6C0
-8FF6C1
-8FF6C2
-8FF6C3
-8FF6C4
-8FF6C5
-8FF6C6
-8FF6C7
-8FF6C8
-8FF6C9
-8FF6CA
-8FF6CB
-8FF6CC
-8FF6CD
-8FF6CE
-8FF6CF
-8FF6D0
-8FF6D1
-8FF6D2
-8FF6D3
-8FF6D4
-8FF6D5
-8FF6D6
-8FF6D7
-8FF6D8
-8FF6D9
-8FF6DA
-8FF6DB
-8FF6DC
-8FF6DD
-8FF6DE
-8FF6DF
-8FF6E0
-8FF6E1
-8FF6E2
-8FF6E3
-8FF6E4
-8FF6E5
-8FF6E6
-8FF6E7
-8FF6E8
-8FF6E9
-8FF6EA
-8FF6EB
-8FF6EC
-8FF6ED
-8FF6EE
-8FF6EF
-8FF6F0
-8FF6F1
-8FF6F2
-8FF6F3
-8FF6F4
-8FF6F5
-8FF6F6
-8FF6F7
-8FF6F8
-8FF6F9
-8FF6FA
-8FF6FB
-8FF6FC
-8FF6FD
-8FF6FE
-8FF7A1
-8FF7A2
-8FF7A3
-8FF7A4
-8FF7A5
-8FF7A6
-8FF7A7
-8FF7A8
-8FF7A9
-8FF7AA
-8FF7AB
-8FF7AC
-8FF7AD
-8FF7AE
-8FF7AF
-8FF7B0
-8FF7B1
-8FF7B2
-8FF7B3
-8FF7B4
-8FF7B5
-8FF7B6
-8FF7B7
-8FF7B8
-8FF7B9
-8FF7BA
-8FF7BB
-8FF7BC
-8FF7BD
-8FF7BE
-8FF7BF
-8FF7C0
-8FF7C1
-8FF7C2
-8FF7C3
-8FF7C4
-8FF7C5
-8FF7C6
-8FF7C7
-8FF7C8
-8FF7C9
-8FF7CA
-8FF7CB
-8FF7CC
-8FF7CD
-8FF7CE
-8FF7CF
-8FF7D0
-8FF7D1
-8FF7D2
-8FF7D3
-8FF7D4
-8FF7D5
-8FF7D6
-8FF7D7
-8FF7D8
-8FF7D9
-8FF7DA
-8FF7DB
-8FF7DC
-8FF7DD
-8FF7DE
-8FF7DF
-8FF7E0
-8FF7E1
-8FF7E2
-8FF7E3
-8FF7E4
-8FF7E5
-8FF7E6
-8FF7E7
-8FF7E8
-8FF7E9
-8FF7EA
-8FF7EB
-8FF7EC
-8FF7ED
-8FF7EE
-8FF7EF
-8FF7F0
-8FF7F1
-8FF7F2
-8FF7F3
-8FF7F4
-8FF7F5
-8FF7F6
-8FF7F7
-8FF7F8
-8FF7F9
-8FF7FA
-8FF7FB
-8FF7FC
-8FF7FD
-8FF7FE
-8FF8A1
-8FF8A2
-8FF8A3
-8FF8A4
-8FF8A5
-8FF8A6
-8FF8A7
-8FF8A8
-8FF8A9
-8FF8AA
-8FF8AB
-8FF8AC
-8FF8AD
-8FF8AE
-8FF8AF
-8FF8B0
-8FF8B1
-8FF8B2
-8FF8B3
-8FF8B4
-8FF8B5
-8FF8B6
-8FF8B7
-8FF8B8
-8FF8B9
-8FF8BA
-8FF8BB
-8FF8BC
-8FF8BD
-8FF8BE
-8FF8BF
-8FF8C0
-8FF8C1
-8FF8C2
-8FF8C3
-8FF8C4
-8FF8C5
-8FF8C6
-8FF8C7
-8FF8C8
-8FF8C9
-8FF8CA
-8FF8CB
-8FF8CC
-8FF8CD
-8FF8CE
-8FF8CF
-8FF8D0
-8FF8D1
-8FF8D2
-8FF8D3
-8FF8D4
-8FF8D5
-8FF8D6
-8FF8D7
-8FF8D8
-8FF8D9
-8FF8DA
-8FF8DB
-8FF8DC
-8FF8DD
-8FF8DE
-8FF8DF
-8FF8E0
-8FF8E1
-8FF8E2
-8FF8E3
-8FF8E4
-8FF8E5
-8FF8E6
-8FF8E7
-8FF8E8
-8FF8E9
-8FF8EA
-8FF8EB
-8FF8EC
-8FF8ED
-8FF8EE
-8FF8EF
-8FF8F0
-8FF8F1
-8FF8F2
-8FF8F3
-8FF8F4
-8FF8F5
-8FF8F6
-8FF8F7
-8FF8F8
-8FF8F9
-8FF8FA
-8FF8FB
-8FF8FC
-8FF8FD
-8FF8FE
-8FF9A1
-8FF9A2
-8FF9A3
-8FF9A4
-8FF9A5
-8FF9A6
-8FF9A7
-8FF9A8
-8FF9A9
-8FF9AA
-8FF9AB
-8FF9AC
-8FF9AD
-8FF9AE
-8FF9AF
-8FF9B0
-8FF9B1
-8FF9B2
-8FF9B3
-8FF9B4
-8FF9B5
-8FF9B6
-8FF9B7
-8FF9B8
-8FF9B9
-8FF9BA
-8FF9BB
-8FF9BC
-8FF9BD
-8FF9BE
-8FF9BF
-8FF9C0
-8FF9C1
-8FF9C2
-8FF9C3
-8FF9C4
-8FF9C5
-8FF9C6
-8FF9C7
-8FF9C8
-8FF9C9
-8FF9CA
-8FF9CB
-8FF9CC
-8FF9CD
-8FF9CE
-8FF9CF
-8FF9D0
-8FF9D1
-8FF9D2
-8FF9D3
-8FF9D4
-8FF9D5
-8FF9D6
-8FF9D7
-8FF9D8
-8FF9D9
-8FF9DA
-8FF9DB
-8FF9DC
-8FF9DD
-8FF9DE
-8FF9DF
-8FF9E0
-8FF9E1
-8FF9E2
-8FF9E3
-8FF9E4
-8FF9E5
-8FF9E6
-8FF9E7
-8FF9E8
-8FF9E9
-8FF9EA
-8FF9EB
-8FF9EC
-8FF9ED
-8FF9EE
-8FF9EF
-8FF9F0
-8FF9F1
-8FF9F2
-8FF9F3
-8FF9F4
-8FF9F5
-8FF9F6
-8FF9F7
-8FF9F8
-8FF9F9
-8FF9FA
-8FF9FB
-8FF9FC
-8FF9FD
-8FF9FE
-8FFAA1
-8FFAA2
-8FFAA3
-8FFAA4
-8FFAA5
-8FFAA6
-8FFAA7
-8FFAA8
-8FFAA9
-8FFAAA
-8FFAAB
-8FFAAC
-8FFAAD
-8FFAAE
-8FFAAF
-8FFAB0
-8FFAB1
-8FFAB2
-8FFAB3
-8FFAB4
-8FFAB5
-8FFAB6
-8FFAB7
-8FFAB8
-8FFAB9
-8FFABA
-8FFABB
-8FFABC
-8FFABD
-8FFABE
-8FFABF
-8FFAC0
-8FFAC1
-8FFAC2
-8FFAC3
-8FFAC4
-8FFAC5
-8FFAC6
-8FFAC7
-8FFAC8
-8FFAC9
-8FFACA
-8FFACB
-8FFACC
-8FFACD
-8FFACE
-8FFACF
-8FFAD0
-8FFAD1
-8FFAD2
-8FFAD3
-8FFAD4
-8FFAD5
-8FFAD6
-8FFAD7
-8FFAD8
-8FFAD9
-8FFADA
-8FFADB
-8FFADC
-8FFADD
-8FFADE
-8FFADF
-8FFAE0
-8FFAE1
-8FFAE2
-8FFAE3
-8FFAE4
-8FFAE5
-8FFAE6
-8FFAE7
-8FFAE8
-8FFAE9
-8FFAEA
-8FFAEB
-8FFAEC
-8FFAED
-8FFAEE
-8FFAEF
-8FFAF0
-8FFAF1
-8FFAF2
-8FFAF3
-8FFAF4
-8FFAF5
-8FFAF6
-8FFAF7
-8FFAF8
-8FFAF9
-8FFAFA
-8FFAFB
-8FFAFC
-8FFAFD
-8FFAFE
-8FFBA1
-8FFBA2
-8FFBA3
-8FFBA4
-8FFBA5
-8FFBA6
-8FFBA7
-8FFBA8
-8FFBA9
-8FFBAA
-8FFBAB
-8FFBAC
-8FFBAD
-8FFBAE
-8FFBAF
-8FFBB0
-8FFBB1
-8FFBB2
-8FFBB3
-8FFBB4
-8FFBB5
-8FFBB6
-8FFBB7
-8FFBB8
-8FFBB9
-8FFBBA
-8FFBBB
-8FFBBC
-8FFBBD
-8FFBBE
-8FFBBF
-8FFBC0
-8FFBC1
-8FFBC2
-8FFBC3
-8FFBC4
-8FFBC5
-8FFBC6
-8FFBC7
-8FFBC8
-8FFBC9
-8FFBCA
-8FFBCB
-8FFBCC
-8FFBCD
-8FFBCE
-8FFBCF
-8FFBD0
-8FFBD1
-8FFBD2
-8FFBD3
-8FFBD4
-8FFBD5
-8FFBD6
-8FFBD7
-8FFBD8
-8FFBD9
-8FFBDA
-8FFBDB
-8FFBDC
-8FFBDD
-8FFBDE
-8FFBDF
-8FFBE0
-8FFBE1
-8FFBE2
-8FFBE3
-8FFBE4
-8FFBE5
-8FFBE6
-8FFBE7
-8FFBE8
-8FFBE9
-8FFBEA
-8FFBEB
-8FFBEC
-8FFBED
-8FFBEE
-8FFBEF
-8FFBF0
-8FFBF1
-8FFBF2
-8FFBF3
-8FFBF4
-8FFBF5
-8FFBF6
-8FFBF7
-8FFBF8
-8FFBF9
-8FFBFA
-8FFBFB
-8FFBFC
-8FFBFD
-8FFBFE
-8FFCA1
-8FFCA2
-8FFCA3
-8FFCA4
-8FFCA5
-8FFCA6
-8FFCA7
-8FFCA8
-8FFCA9
-8FFCAA
-8FFCAB
-8FFCAC
-8FFCAD
-8FFCAE
-8FFCAF
-8FFCB0
-8FFCB1
-8FFCB2
-8FFCB3
-8FFCB4
-8FFCB5
-8FFCB6
-8FFCB7
-8FFCB8
-8FFCB9
-8FFCBA
-8FFCBB
-8FFCBC
-8FFCBD
-8FFCBE
-8FFCBF
-8FFCC0
-8FFCC1
-8FFCC2
-8FFCC3
-8FFCC4
-8FFCC5
-8FFCC6
-8FFCC7
-8FFCC8
-8FFCC9
-8FFCCA
-8FFCCB
-8FFCCC
-8FFCCD
-8FFCCE
-8FFCCF
-8FFCD0
-8FFCD1
-8FFCD2
-8FFCD3
-8FFCD4
-8FFCD5
-8FFCD6
-8FFCD7
-8FFCD8
-8FFCD9
-8FFCDA
-8FFCDB
-8FFCDC
-8FFCDD
-8FFCDE
-8FFCDF
-8FFCE0
-8FFCE1
-8FFCE2
-8FFCE3
-8FFCE4
-8FFCE5
-8FFCE6
-8FFCE7
-8FFCE8
-8FFCE9
-8FFCEA
-8FFCEB
-8FFCEC
-8FFCED
-8FFCEE
-8FFCEF
-8FFCF0
-8FFCF1
-8FFCF2
-8FFCF3
-8FFCF4
-8FFCF5
-8FFCF6
-8FFCF7
-8FFCF8
-8FFCF9
-8FFCFA
-8FFCFB
-8FFCFC
-8FFCFD
-8FFCFE
-8FFDA1
-8FFDA2
-8FFDA3
-8FFDA4
-8FFDA5
-8FFDA6
-8FFDA7
-8FFDA8
-8FFDA9
-8FFDAA
-8FFDAB
-8FFDAC
-8FFDAD
-8FFDAE
-8FFDAF
-8FFDB0
-8FFDB1
-8FFDB2
-8FFDB3
-8FFDB4
-8FFDB5
-8FFDB6
-8FFDB7
-8FFDB8
-8FFDB9
-8FFDBA
-8FFDBB
-8FFDBC
-8FFDBD
-8FFDBE
-8FFDBF
-8FFDC0
-8FFDC1
-8FFDC2
-8FFDC3
-8FFDC4
-8FFDC5
-8FFDC6
-8FFDC7
-8FFDC8
-8FFDC9
-8FFDCA
-8FFDCB
-8FFDCC
-8FFDCD
-8FFDCE
-8FFDCF
-8FFDD0
-8FFDD1
-8FFDD2
-8FFDD3
-8FFDD4
-8FFDD5
-8FFDD6
-8FFDD7
-8FFDD8
-8FFDD9
-8FFDDA
-8FFDDB
-8FFDDC
-8FFDDD
-8FFDDE
-8FFDDF
-8FFDE0
-8FFDE1
-8FFDE2
-8FFDE3
-8FFDE4
-8FFDE5
-8FFDE6
-8FFDE7
-8FFDE8
-8FFDE9
-8FFDEA
-8FFDEB
-8FFDEC
-8FFDED
-8FFDEE
-8FFDEF
-8FFDF0
-8FFDF1
-8FFDF2
-8FFDF3
-8FFDF4
-8FFDF5
-8FFDF6
-8FFDF7
-8FFDF8
-8FFDF9
-8FFDFA
-8FFDFB
-8FFDFC
-8FFDFD
-8FFDFE
-8FFEA1
-8FFEA2
-8FFEA3
-8FFEA4
-8FFEA5
-8FFEA6
-8FFEA7
-8FFEA8
-8FFEA9
-8FFEAA
-8FFEAB
-8FFEAC
-8FFEAD
-8FFEAE
-8FFEAF
-8FFEB0
-8FFEB1
-8FFEB2
-8FFEB3
-8FFEB4
-8FFEB5
-8FFEB6
-8FFEB7
-8FFEB8
-8FFEB9
-8FFEBA
-8FFEBB
-8FFEBC
-8FFEBD
-8FFEBE
-8FFEBF
-8FFEC0
-8FFEC1
-8FFEC2
-8FFEC3
-8FFEC4
-8FFEC5
-8FFEC6
-8FFEC7
-8FFEC8
-8FFEC9
-8FFECA
-8FFECB
-8FFECC
-8FFECD
-8FFECE
-8FFECF
-8FFED0
-8FFED1
-8FFED2
-8FFED3
-8FFED4
-8FFED5
-8FFED6
-8FFED7
-8FFED8
-8FFED9
-8FFEDA
-8FFEDB
-8FFEDC
-8FFEDD
-8FFEDE
-8FFEDF
-8FFEE0
-8FFEE1
-8FFEE2
-8FFEE3
-8FFEE4
-8FFEE5
-8FFEE6
-8FFEE7
-8FFEE8
-8FFEE9
-8FFEEA
-8FFEEB
-8FFEEC
-8FFEED
-8FFEEE
-8FFEEF
-8FFEF0
-8FFEF1
-8FFEF2
-8FFEF3
-8FFEF4
-8FFEF5
-8FFEF6
-8FFEF7
-8FFEF8
-8FFEF9
-8FFEFA
-8FFEFB
-8FFEFC
-8FFEFD
-8FFEFE
-DROP TABLE t1;
-DROP TABLE t2;
-DROP TABLE t3;
-DROP TABLE t4;
-SET collation_connection='cp932_japanese_ci';
-create table t1 select repeat('a',4000) a;
-delete from t1;
-insert into t1 values ('a'), ('a '), ('a\t');
-select collation(a),hex(a) from t1 order by a;
-collation(a) hex(a)
-cp932_japanese_ci 6109
-cp932_japanese_ci 61
-cp932_japanese_ci 6120
-drop table t1;
-SET collation_connection='cp932_bin';
-create table t1 select repeat('a',4000) a;
-delete from t1;
-insert into t1 values ('a'), ('a '), ('a\t');
-select collation(a),hex(a) from t1 order by a;
-collation(a) hex(a)
-cp932_bin 6109
-cp932_bin 61
-cp932_bin 6120
-drop table t1;
-create table t1 (col1 varchar(1)) character set cp932;
-insert into t1 values ('a');
-insert into t1 values ('ab');
-Warnings:
-Warning 1265 Data truncated for column 'col1' at row 1
-select * from t1;
-col1
-a
-a
-insert into t1 values ('abc');
-Warnings:
-Warning 1265 Data truncated for column 'col1' at row 1
-select * from t1;
-col1
-a
-a
-a
-drop table t1;
-set names utf8;
-create table t1 (a text) default character set cp932;
-insert into t1 values (_utf8 0xE38182);
-show warnings;
-Level Code Message
-select * from t1;
-a
-ã‚
-select hex(a) from t1;
-hex(a)
-82A0
-drop table t1;
-ƒ\
-ƒ\
-c_cp932
-ƒ\
-ƒ\
-ƒ\
-ソ
-ソ
-ƒ\
-ƒ\
diff --git a/mysql-test/r/binlog_stm_mix_innodb_myisam.result b/mysql-test/r/binlog_stm_mix_innodb_myisam.result
deleted file mode 100644
index c74fb17d600..00000000000
--- a/mysql-test/r/binlog_stm_mix_innodb_myisam.result
+++ /dev/null
@@ -1,382 +0,0 @@
-drop table if exists t1, t2;
-create table t1 (a int) engine=innodb;
-create table t2 (a int) engine=myisam;
-reset master;
-begin;
-insert into t1 values(1);
-insert into t2 select * from t1;
-commit;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; insert into t1 values(1)
-master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
-master-bin.000001 # Xid # # COMMIT /* XID */
-delete from t1;
-delete from t2;
-reset master;
-begin;
-insert into t1 values(2);
-insert into t2 select * from t1;
-rollback;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; insert into t1 values(2)
-master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
-master-bin.000001 # Query # # use `test`; ROLLBACK
-delete from t1;
-delete from t2;
-reset master;
-begin;
-insert into t1 values(3);
-savepoint my_savepoint;
-insert into t1 values(4);
-insert into t2 select * from t1;
-rollback to savepoint my_savepoint;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-commit;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; insert into t1 values(3)
-master-bin.000001 # Query # # use `test`; savepoint my_savepoint
-master-bin.000001 # Query # # use `test`; insert into t1 values(4)
-master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
-master-bin.000001 # Query # # use `test`; rollback to savepoint my_savepoint
-master-bin.000001 # Xid # # COMMIT /* XID */
-delete from t1;
-delete from t2;
-reset master;
-begin;
-insert into t1 values(5);
-savepoint my_savepoint;
-insert into t1 values(6);
-insert into t2 select * from t1;
-rollback to savepoint my_savepoint;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-insert into t1 values(7);
-commit;
-select a from t1 order by a;
-a
-5
-7
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; insert into t1 values(5)
-master-bin.000001 # Query # # use `test`; savepoint my_savepoint
-master-bin.000001 # Query # # use `test`; insert into t1 values(6)
-master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
-master-bin.000001 # Query # # use `test`; rollback to savepoint my_savepoint
-master-bin.000001 # Query # # use `test`; insert into t1 values(7)
-master-bin.000001 # Xid # # COMMIT /* XID */
-delete from t1;
-delete from t2;
-reset master;
-select get_lock("a",10);
-get_lock("a",10)
-1
-begin;
-insert into t1 values(8);
-insert into t2 select * from t1;
-select get_lock("a",10);
-get_lock("a",10)
-1
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; insert into t1 values(8)
-master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
-master-bin.000001 # Query # # use `test`; ROLLBACK
-delete from t1;
-delete from t2;
-reset master;
-insert into t1 values(9);
-insert into t2 select * from t1;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; insert into t1 values(9)
-master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
-delete from t1;
-delete from t2;
-reset master;
-insert into t1 values(10);
-begin;
-insert into t2 select * from t1;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; insert into t1 values(10)
-master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
-insert into t1 values(11);
-commit;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; insert into t1 values(10)
-master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; insert into t1 values(11)
-master-bin.000001 # Xid # # COMMIT /* XID */
-alter table t2 engine=INNODB;
-delete from t1;
-delete from t2;
-reset master;
-begin;
-insert into t1 values(12);
-insert into t2 select * from t1;
-commit;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; insert into t1 values(12)
-master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
-master-bin.000001 # Xid # # COMMIT /* XID */
-delete from t1;
-delete from t2;
-reset master;
-begin;
-insert into t1 values(13);
-insert into t2 select * from t1;
-rollback;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-delete from t1;
-delete from t2;
-reset master;
-begin;
-insert into t1 values(14);
-savepoint my_savepoint;
-insert into t1 values(15);
-insert into t2 select * from t1;
-rollback to savepoint my_savepoint;
-commit;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; insert into t1 values(14)
-master-bin.000001 # Xid # # COMMIT /* XID */
-delete from t1;
-delete from t2;
-reset master;
-begin;
-insert into t1 values(16);
-savepoint my_savepoint;
-insert into t1 values(17);
-insert into t2 select * from t1;
-rollback to savepoint my_savepoint;
-insert into t1 values(18);
-commit;
-select a from t1 order by a;
-a
-16
-18
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; insert into t1 values(16)
-master-bin.000001 # Query # # use `test`; insert into t1 values(18)
-master-bin.000001 # Xid # # COMMIT /* XID */
-delete from t1;
-delete from t2;
-alter table t2 engine=MyISAM;
-insert into t1 values (1);
-begin;
-select * from t1 for update;
-a
-1
-select (@before:=unix_timestamp())*0;
-(@before:=unix_timestamp())*0
-0
-begin;
-select * from t1 for update;
-insert into t2 values (20);
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-select (@after:=unix_timestamp())*0;
-(@after:=unix_timestamp())*0
-0
-select (@after-@before) >= 2;
-(@after-@before) >= 2
-1
-drop table t1,t2;
-commit;
-begin;
-create temporary table ti (a int) engine=innodb;
-rollback;
-insert into ti values(1);
-set autocommit=0;
-create temporary table t1 (a int) engine=myisam;
-commit;
-insert t1 values (1);
-rollback;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-create table t0 (n int);
-insert t0 select * from t1;
-set autocommit=1;
-insert into t0 select GET_LOCK("lock1",null);
-set autocommit=0;
-create table t2 (n int) engine=innodb;
-insert into t2 values (3);
-select get_lock("lock1",60);
-get_lock("lock1",60)
-1
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; insert into t1 values(16)
-master-bin.000001 # Query # # use `test`; insert into t1 values(18)
-master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; delete from t1
-master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; delete from t2
-master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; alter table t2 engine=MyISAM
-master-bin.000001 # Query # # use `test`; insert into t1 values (1)
-master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; insert into t2 values (20)
-master-bin.000001 # Query # # use `test`; drop table t1,t2
-master-bin.000001 # Query # # use `test`; create temporary table ti (a int) engine=innodb
-master-bin.000001 # Query # # use `test`; insert into ti values(1)
-master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; create temporary table t1 (a int) engine=myisam
-master-bin.000001 # Query # # use `test`; insert t1 values (1)
-master-bin.000001 # Query # # use `test`; create table t0 (n int)
-master-bin.000001 # Query # # use `test`; insert t0 select * from t1
-master-bin.000001 # Query # # use `test`; insert into t0 select GET_LOCK("lock1",null)
-master-bin.000001 # Query # # use `test`; create table t2 (n int) engine=innodb
-master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `test`.`t1`,`test`.`ti`
-do release_lock("lock1");
-drop table t0,t2;
-set autocommit=0;
-CREATE TABLE t1 (a int, b int) engine=myisam;
-reset master;
-INSERT INTO t1 values (1,1),(1,2);
-CREATE TABLE t2 (primary key (a)) engine=innodb select * from t1;
-ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
-DROP TABLE if exists t2;
-Warnings:
-Note 1051 Unknown table 't2'
-INSERT INTO t1 values (3,3);
-CREATE TEMPORARY TABLE t2 (primary key (a)) engine=innodb select * from t1;
-ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
-ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-DROP TABLE IF EXISTS t2;
-Warnings:
-Note 1051 Unknown table 't2'
-CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb;
-INSERT INTO t1 VALUES (4,4);
-CREATE TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
-ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
-SELECT * from t2;
-a b
-TRUNCATE table t2;
-INSERT INTO t1 VALUES (5,5);
-INSERT INTO t2 select * from t1;
-ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
-SELECT * FROM t2;
-a b
-DROP TABLE t2;
-INSERT INTO t1 values (6,6);
-CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a)) engine=innodb ;
-INSERT INTO t1 values (7,7);
-ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-INSERT INTO t1 values (8,8);
-CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
-ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
-COMMIT;
-INSERT INTO t1 values (9,9);
-CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
-ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
-ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-SELECT * from t2;
-a b
-TRUNCATE table t2;
-INSERT INTO t1 values (10,10);
-INSERT INTO t2 select * from t1;
-ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
-SELECT * from t1;
-a b
-1 1
-1 2
-3 3
-4 4
-5 5
-6 6
-7 7
-8 8
-9 9
-10 10
-INSERT INTO t2 values (100,100);
-CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
-ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
-COMMIT;
-INSERT INTO t2 values (101,101);
-CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
-ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
-ROLLBACK;
-SELECT * from t2;
-a b
-100 100
-DROP TABLE t1,t2;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (1,1),(1,2)
-master-bin.000001 # Query # # use `test`; DROP TABLE if exists t2
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (3,3)
-master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t2
-master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4,4)
-master-bin.000001 # Query # # use `test`; TRUNCATE table t2
-master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5,5)
-master-bin.000001 # Query # # use `test`; DROP TABLE t2
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (6,6)
-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a)) engine=innodb
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (7,7)
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (8,8)
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (9,9)
-master-bin.000001 # Query # # use `test`; TRUNCATE table t2
-master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (10,10)
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t2 values (100,100)
-master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; DROP TABLE t1,t2
-reset master;
-create table t1 (a int) engine=innodb;
-create table t2 (a int) engine=myisam;
-select get_lock("a",10);
-get_lock("a",10)
-1
-begin;
-insert into t1 values(8);
-insert into t2 select * from t1;
-select get_lock("a",10);
-get_lock("a",10)
-1
-flush logs;
-select
-(@a:=load_file("MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output"))
-is not null;
-(@a:=load_file("MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output"))
-is not null
-1
-select
-@a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%",
-@a not like "%#%error_code=%error_code=%";
-@a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" @a not like "%#%error_code=%error_code=%"
-1 1
-drop table t1, t2;
diff --git a/mysql-test/r/binlog_tx_isolation.result b/mysql-test/r/binlog_tx_isolation.result
new file mode 100644
index 00000000000..39aba22758d
--- /dev/null
+++ b/mysql-test/r/binlog_tx_isolation.result
@@ -0,0 +1,48 @@
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=INNODB;
+INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6);
+SET BINLOG_FORMAT=STATEMENT;
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+ERROR HY000: Transaction isolation level 'READ-COMMITTED' is not safe for 'STATEMENT' binlog mode
+UPDATE t1 SET b = a*a WHERE a > 1;
+COMMIT;
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+UPDATE t1 SET b = a*a WHERE a > 1;
+COMMIT;
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+UPDATE t1 SET b = a*a WHERE a > 1;
+COMMIT;
+SET BINLOG_FORMAT=MIXED;
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+ERROR HY000: Transaction isolation level 'READ-COMMITTED' is not safe for 'MIXED' binlog mode
+UPDATE t1 SET b = a*a*a WHERE a > 2;
+COMMIT;
+SET BINLOG_FORMAT=ROW;
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+UPDATE t1 SET b = a*a*a*a WHERE a > 3;
+COMMIT;
+SELECT @@session.tx_isolation, @@session.binlog_format;
+@@session.tx_isolation READ-COMMITTED
+@@session.binlog_format ROW
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+SET BINLOG_FORMAT=MIXED;
+ERROR HY000: Transaction isolation level 'READ-COMMITTED' prevents leaving 'ROW' binlog mode
+UPDATE t1 SET b = a*a*a*a WHERE a > 3;
+COMMIT;
+SELECT @@session.tx_isolation, @@session.binlog_format;
+@@session.tx_isolation READ-COMMITTED
+@@session.binlog_format ROW
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+SET BINLOG_FORMAT=STATEMENT;
+ERROR HY000: Transaction isolation level 'READ-COMMITTED' prevents leaving 'ROW' binlog mode
+UPDATE t1 SET b = a*a*a*a WHERE a > 3;
+COMMIT;
+SELECT @@session.tx_isolation, @@session.binlog_format;
+@@session.tx_isolation READ-COMMITTED
+@@session.binlog_format ROW
diff --git a/mysql-test/r/binlog_unsafe.result b/mysql-test/r/binlog_unsafe.result
new file mode 100644
index 00000000000..281bb475944
--- /dev/null
+++ b/mysql-test/r/binlog_unsafe.result
@@ -0,0 +1,13 @@
+SET BINLOG_FORMAT=STATEMENT;
+CREATE TABLE t1 (a CHAR(40));
+CREATE TABLE t2 (a INT AUTO_INCREMENT PRIMARY KEY);
+CREATE TABLE t3 (b INT AUTO_INCREMENT PRIMARY KEY);
+CREATE VIEW v1(a,b) AS SELECT a,b FROM t2,t3;
+INSERT INTO t1 SELECT UUID();
+Warnings:
+Warning 1591 Statement is not safe to log in statement format.
+SHOW WARNINGS;
+Level Warning
+Code 1591
+Message Statement is not safe to log in statement format.
+DROP TABLE t1,t2,t3;
diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result
index c538d8d55e1..afd0a5a990e 100644
--- a/mysql-test/r/cast.result
+++ b/mysql-test/r/cast.result
@@ -403,4 +403,15 @@ hex(cast('a' as binary(2)))
select hex(cast('a' as char(2) binary));
hex(cast('a' as char(2) binary))
61
+CREATE TABLE t1 (d1 datetime);
+INSERT INTO t1(d1) VALUES ('2007-07-19 08:30:00'), (NULL),
+('2007-07-19 08:34:00'), (NULL), ('2007-07-19 08:36:00');
+SELECT cast(date(d1) as signed) FROM t1;
+cast(date(d1) as signed)
+20070719
+NULL
+20070719
+NULL
+20070719
+drop table t1;
End of 5.0 tests
diff --git a/mysql-test/r/check.result b/mysql-test/r/check.result
index 60806e7393e..0bff34dba20 100644
--- a/mysql-test/r/check.result
+++ b/mysql-test/r/check.result
@@ -1,4 +1,5 @@
-drop table if exists t1;
+drop table if exists t1,t2;
+drop view if exists v1;
create table t1(n int not null, key(n), key(n), key(n), key(n));
check table t1 extended;
insert into t1 values (200000);
@@ -14,3 +15,11 @@ test.v1 check status OK
test.t2 check status OK
drop view v1;
drop table t1, t2;
+CREATE TEMPORARY TABLE t1(a INT);
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+REPAIR TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+DROP TABLE t1;
diff --git a/mysql-test/r/comments.result b/mysql-test/r/comments.result
index a9106ce0538..d8ac68e2468 100644
--- a/mysql-test/r/comments.result
+++ b/mysql-test/r/comments.result
@@ -8,7 +8,7 @@ multi line comment */;
;
ERROR 42000: Query was empty
select 1 /*!32301 +1 */;
-1 /*!32301 +1
+1 +1
2
select 1 /*!52301 +1 */;
1
@@ -26,3 +26,28 @@ select 1 # The rest of the row will be ignored
1
1
/* line with only comment */;
+select 1/*!2*/;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '2*/' at line 1
+select 1/*!000002*/;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '2*/' at line 1
+select 1/*!999992*/;
+1
+1
+select 1 + /*!00000 2 */ + 3 /*!99999 noise*/ + 4;
+1 + 2 + 3 + 4
+10
+drop table if exists table_28779;
+create table table_28779 (a int);
+prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*' AND b = 'bar';";
+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 '/*' AND b = 'bar'' at line 1
+prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*' AND b = 'bar';*";
+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 '/*' AND b = 'bar';*' at line 1
+prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*! AND 2=2;";
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
+prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*! AND 2=2;*";
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';*' at line 1
+prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*!98765' AND b = 'bar';";
+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 '/*!98765' AND b = 'bar'' at line 1
+prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*!98765' AND b = 'bar';*";
+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 '/*!98765' AND b = 'bar';*' at line 1
+drop table table_28779;
diff --git a/mysql-test/r/compress.result b/mysql-test/r/compress.result
index 2eced78b07a..68206c0dc0e 100644
--- a/mysql-test/r/compress.result
+++ b/mysql-test/r/compress.result
@@ -3,7 +3,7 @@ Variable_name Value
Compression ON
select * from information_schema.session_status where variable_name= 'COMPRESSION';
VARIABLE_NAME VARIABLE_VALUE
-COMPRESSION 1.0000000
+COMPRESSION ON
drop table if exists t1,t2,t3,t4;
CREATE TABLE t1 (
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
@@ -1434,8 +1434,8 @@ companynr companynr
41 40
explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary; Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where; Using join buffer
select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008;
fld1 companynr fld3 period
038008 37 reporters 1008
diff --git a/mysql-test/r/create-big.result b/mysql-test/r/create-big.result
new file mode 100644
index 00000000000..eb57bf59084
--- /dev/null
+++ b/mysql-test/r/create-big.result
@@ -0,0 +1,247 @@
+drop table if exists t1,t2,t3,t4,t5;
+set session debug="+d,sleep_create_select_before_create";
+create table t1 select 1 as i;;
+create table t1 (j char(5));
+ERROR 42S01: Table 't1' already exists
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `i` int(1) NOT NULL DEFAULT '0'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 select 1 as i;;
+create table t1 select "Test" as j;
+ERROR 42S01: Table 't1' already exists
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `i` int(1) NOT NULL DEFAULT '0'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t3 (j char(5));
+create table t1 select 1 as i;;
+create table t1 like t3;
+ERROR 42S01: Table 't1' already exists
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `i` int(1) NOT NULL DEFAULT '0'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 select 1 as i;;
+rename table t3 to t1;
+ERROR 42S01: Table 't1' already exists
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `i` int(1) NOT NULL DEFAULT '0'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 select 1 as i;;
+alter table t3 rename to t1;
+ERROR 42S01: Table 't1' already exists
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `i` int(1) NOT NULL DEFAULT '0'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 select 1 as i;;
+alter table t3 rename to t1, add k int;
+ERROR 42S01: Table 't1' already exists
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `i` int(1) NOT NULL DEFAULT '0'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t3;
+set session debug="-d,sleep_create_select_before_create:+d,sleep_create_select_before_open";
+create table t1 select 1 as i;;
+drop table t1;
+create table t1 select 1 as i;;
+rename table t1 to t2;
+drop table t2;
+create table t1 select 1 as i;;
+select * from t1;
+i
+1
+drop table t1;
+create table t1 select 1 as i;;
+insert into t1 values (2);
+select * from t1;
+i
+1
+2
+drop table t1;
+set @a:=0;
+create table t1 select 1 as i;;
+create trigger t1_bi before insert on t1 for each row set @a:=1;
+select @a;
+@a
+0
+drop table t1;
+set session debug="-d,sleep_create_select_before_open:+d,sleep_create_select_before_lock";
+create table t1 select 1 as i;;
+drop table t1;
+create table t1 select 1 as i;;
+rename table t1 to t2;
+drop table t2;
+create table t1 select 1 as i;;
+select * from t1;
+i
+1
+drop table t1;
+create table t1 select 1 as i;;
+insert into t1 values (2);
+select * from t1;
+i
+1
+2
+drop table t1;
+set @a:=0;
+create table t1 select 1 as i;;
+create trigger t1_bi before insert on t1 for each row set @a:=1;
+select @a;
+@a
+0
+drop table t1;
+set session debug="-d,sleep_create_select_before_lock:+d,sleep_create_select_before_check_if_exists";
+create table t1 (i int);
+create table if not exists t1 select 1 as i;;
+drop table t1;
+Warnings:
+Note 1050 Table 't1' already exists
+create table t1 (i int);
+set @a:=0;
+create table if not exists t1 select 1 as i;;
+create trigger t1_bi before insert on t1 for each row set @a:=1;
+Warnings:
+Note 1050 Table 't1' already exists
+select @a;
+@a
+0
+select * from t1;
+i
+1
+drop table t1;
+set session debug="-d,sleep_create_select_before_check_if_exists";
+create table t2 (a int);
+create table t4 (b int);
+lock table t4 write;
+select 1;
+1
+1
+create table t3 as select * from t4;;
+create table t1 select * from t2, t3;;
+unlock tables;
+select * from t1;
+a b
+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
+drop table t1, t3;
+lock table t4 read;
+select 1;
+1
+1
+rename table t4 to t3;;
+create table if not exists t1 select 1 as i from t2, t3;;
+create table t5 (j int);
+rename table t5 to t1;
+unlock tables;
+Warnings:
+Note 1050 Table 't1' already exists
+select * from t1;
+j
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `j` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2, t3;
+drop table if exists t1,t2;
+create table t1 (i int);
+set session debug="+d,sleep_create_like_before_check_if_exists";
+reset master;
+create table t2 like t1;;
+insert into t1 values (1);
+drop table t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t2;
+show binlog events in 'master-bin.000001' from 106;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # use `test`; insert into t1 values (1)
+master-bin.000001 # Query 1 # use `test`; create table t2 like t1
+master-bin.000001 # Query 1 # use `test`; drop table t1
+master-bin.000001 # Query 1 # use `test`; drop table t2
+create table t1 (i int);
+set session debug="-d,sleep_create_like_before_check_if_exists:+d,sleep_create_like_before_copy";
+create table t2 like t1;;
+create table if not exists t2 (j int);
+Warnings:
+Note 1050 Table 't2' already exists
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t2;
+reset master;
+create table t2 like t1;;
+drop table t1;
+drop table t2;
+show binlog events in 'master-bin.000001' from 106;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # use `test`; create table t2 like t1
+master-bin.000001 # Query 1 # use `test`; drop table t1
+master-bin.000001 # Query 1 # use `test`; drop table t2
+create table t1 (i int);
+set session debug="-d,sleep_create_like_before_copy:+d,sleep_create_like_before_ha_create";
+reset master;
+create table t2 like t1;;
+insert into t2 values (1);
+drop table t2;
+create table t2 like t1;;
+drop table t2;
+create table t2 like t1;;
+drop table t1;
+drop table t2;
+show binlog events in 'master-bin.000001' from 106;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # use `test`; create table t2 like t1
+master-bin.000001 # Query 1 # use `test`; insert into t2 values (1)
+master-bin.000001 # Query 1 # use `test`; drop table t2
+master-bin.000001 # Query 1 # use `test`; create table t2 like t1
+master-bin.000001 # Query 1 # use `test`; drop table t2
+master-bin.000001 # Query 1 # use `test`; create table t2 like t1
+master-bin.000001 # Query 1 # use `test`; drop table t1
+master-bin.000001 # Query 1 # use `test`; drop table t2
+create table t1 (i int);
+set session debug="-d,sleep_create_like_before_ha_create:+d,sleep_create_like_before_binlogging";
+reset master;
+create table t2 like t1;;
+insert into t2 values (1);
+drop table t2;
+create table t2 like t1;;
+drop table t2;
+create table t2 like t1;;
+drop table t1;
+drop table t2;
+show binlog events in 'master-bin.000001' from 106;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # use `test`; create table t2 like t1
+master-bin.000001 # Query 1 # use `test`; insert into t2 values (1)
+master-bin.000001 # Query 1 # use `test`; drop table t2
+master-bin.000001 # Query 1 # use `test`; create table t2 like t1
+master-bin.000001 # Query 1 # use `test`; drop table t2
+master-bin.000001 # Query 1 # use `test`; create table t2 like t1
+master-bin.000001 # Query 1 # use `test`; drop table t1
+master-bin.000001 # Query 1 # use `test`; drop table t2
+set session debug="-d,sleep_create_like_before_binlogging";
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index c7f8ba17930..b370fbf6fbe 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -285,7 +285,7 @@ ERROR 23000: Duplicate entry '3' for key 'PRIMARY'
show warnings;
Level Code Message
Note 1050 Table 't1' already exists
-Error 1582 Duplicate entry '3' for key 'PRIMARY'
+Error 1062 Duplicate entry '3' for key 'PRIMARY'
show status like "Opened_tables";
Variable_name Value
Opened_tables 2
@@ -371,7 +371,7 @@ ERROR 42S01: Table 't3' already exists
create table non_existing_database.t1 like t1;
ERROR 42000: Unknown database 'non_existing_database'
create table t3 like non_existing_table;
-ERROR 42S02: Unknown table 'non_existing_table'
+ERROR 42S02: Table 'test.non_existing_table' doesn't exist
create temporary table t3 like t1;
ERROR 42S01: Table 't3' already exists
drop table t1, t2, t3;
@@ -443,7 +443,7 @@ d date YES NULL
e varchar(1) NO
f datetime YES NULL
g time YES NULL
-h longblob NO
+h longblob NO NULL
dd time YES NULL
select * from t2;
a b c d e f g h dd
@@ -782,8 +782,769 @@ t1 CREATE TABLE `t1` (
`i` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 MAX_ROWS=4294967295
drop table t1;
+create table t1 select * from t2;
+ERROR 42S02: Table 'test.t2' doesn't exist
+create table t1 select * from t1;
+ERROR HY000: You can't specify target table 't1' for update in FROM clause
+create table t1 select coalesce('a' collate latin1_swedish_ci,'b' collate latin1_bin);
+ERROR HY000: Illegal mix of collations (latin1_swedish_ci,EXPLICIT) and (latin1_bin,EXPLICIT) for operation 'coalesce'
+create table t1 (primary key(a)) select "b" as b;
+ERROR 42000: Key column 'a' doesn't exist in table
+create table t1 (a int);
+create table if not exists t1 select 1 as a, 2 as b;
+ERROR 21S01: Column count doesn't match value count at row 1
+drop table t1;
+create table t1 (primary key (a)) (select 1 as a) union all (select 1 as a);
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+create table t1 (i int);
+create table t1 select 1 as i;
+ERROR 42S01: Table 't1' already exists
+create table if not exists t1 select 1 as i;
+Warnings:
+Note 1050 Table 't1' already exists
+select * from t1;
+i
+1
+create table t1 select coalesce('a' collate latin1_swedish_ci,'b' collate latin1_bin);
+ERROR HY000: Illegal mix of collations (latin1_swedish_ci,EXPLICIT) and (latin1_bin,EXPLICIT) for operation 'coalesce'
+select * from t1;
+i
+1
+alter table t1 add primary key (i);
+create table if not exists t1 (select 2 as i) union all (select 2 as i);
+ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
+select * from t1;
+i
+1
+2
+drop table t1;
+create temporary table t1 (j int);
+create table if not exists t1 select 1;
+Warnings:
+Note 1050 Table 't1' already exists
+select * from t1;
+j
+1
+drop temporary table t1;
+select * from t1;
+ERROR 42S02: Table 'test.t1' doesn't exist
+drop table t1;
+ERROR 42S02: Unknown table 't1'
+create table t1 (i int);
+insert into t1 values (1), (2);
+lock tables t1 read;
+create table t2 select * from t1;
+ERROR HY000: Table 't2' was not locked with LOCK TABLES
+create table if not exists t2 select * from t1;
+ERROR HY000: Table 't2' was not locked with LOCK TABLES
+unlock tables;
+create table t2 (j int);
+lock tables t1 read;
+create table t2 select * from t1;
+ERROR HY000: Table 't2' was not locked with LOCK TABLES
+create table if not exists t2 select * from t1;
+ERROR HY000: Table 't2' was not locked with LOCK TABLES
+unlock tables;
+lock table t1 read, t2 read;
+create table t2 select * from t1;
+ERROR HY000: Table 't2' was locked with a READ lock and can't be updated
+create table if not exists t2 select * from t1;
+ERROR HY000: Table 't2' was locked with a READ lock and can't be updated
+unlock tables;
+lock table t1 read, t2 write;
+create table t2 select * from t1;
+ERROR 42S01: Table 't2' already exists
+create table if not exists t2 select * from t1;
+Warnings:
+Note 1050 Table 't2' already exists
+select * from t1;
+i
+1
+2
+unlock tables;
+drop table t2;
+lock tables t1 read;
+create temporary table t2 select * from t1;
+create temporary table if not exists t2 select * from t1;
+Warnings:
+Note 1050 Table 't2' already exists
+select * from t2;
+i
+1
+2
+1
+2
+unlock tables;
+drop table t1, t2;
create table t1 (upgrade int);
drop table t1;
+create table t1 (
+c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int, c8 int,
+c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int, c16 int,
+key a001_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a002_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a003_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a004_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a005_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a006_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a007_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a008_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a009_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a010_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a011_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a012_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a013_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a014_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a015_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a016_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a017_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a018_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a019_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a020_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a021_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a022_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a023_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a024_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a025_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a026_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a027_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a028_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a029_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a030_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a031_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a032_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a033_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a034_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a035_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a036_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a037_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a038_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a039_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a040_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a041_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a042_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a043_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a044_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a045_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a046_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a047_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a048_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a049_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a050_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a051_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a052_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a053_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a054_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a055_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a056_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a057_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a058_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a059_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a060_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a061_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a062_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a063_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16)
+);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) DEFAULT NULL,
+ `c2` int(11) DEFAULT NULL,
+ `c3` int(11) DEFAULT NULL,
+ `c4` int(11) DEFAULT NULL,
+ `c5` int(11) DEFAULT NULL,
+ `c6` int(11) DEFAULT NULL,
+ `c7` int(11) DEFAULT NULL,
+ `c8` int(11) DEFAULT NULL,
+ `c9` int(11) DEFAULT NULL,
+ `c10` int(11) DEFAULT NULL,
+ `c11` int(11) DEFAULT NULL,
+ `c12` int(11) DEFAULT NULL,
+ `c13` int(11) DEFAULT NULL,
+ `c14` int(11) DEFAULT NULL,
+ `c15` int(11) DEFAULT NULL,
+ `c16` int(11) DEFAULT NULL,
+ KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a004_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a005_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a006_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a007_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a008_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a009_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a010_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a011_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a012_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a013_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a014_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a015_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a016_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a017_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a018_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a019_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a020_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a021_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a022_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a023_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a024_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a025_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a026_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a027_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a028_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a029_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a030_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a031_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a032_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a033_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a034_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a035_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a036_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a037_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a038_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a039_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a040_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a041_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a042_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a043_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a044_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a045_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a046_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a047_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a048_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a049_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a050_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a051_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a052_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a053_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a054_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a055_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a056_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a057_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a058_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a059_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a060_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a061_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+flush tables;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) DEFAULT NULL,
+ `c2` int(11) DEFAULT NULL,
+ `c3` int(11) DEFAULT NULL,
+ `c4` int(11) DEFAULT NULL,
+ `c5` int(11) DEFAULT NULL,
+ `c6` int(11) DEFAULT NULL,
+ `c7` int(11) DEFAULT NULL,
+ `c8` int(11) DEFAULT NULL,
+ `c9` int(11) DEFAULT NULL,
+ `c10` int(11) DEFAULT NULL,
+ `c11` int(11) DEFAULT NULL,
+ `c12` int(11) DEFAULT NULL,
+ `c13` int(11) DEFAULT NULL,
+ `c14` int(11) DEFAULT NULL,
+ `c15` int(11) DEFAULT NULL,
+ `c16` int(11) DEFAULT NULL,
+ KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a004_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a005_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a006_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a007_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a008_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a009_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a010_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a011_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a012_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a013_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a014_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a015_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a016_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a017_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a018_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a019_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a020_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a021_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a022_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a023_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a024_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a025_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a026_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a027_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a028_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a029_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a030_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a031_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a032_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a033_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a034_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a035_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a036_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a037_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a038_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a039_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a040_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a041_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a042_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a043_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a044_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a045_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a046_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a047_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a048_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a049_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a050_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a051_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a052_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a053_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a054_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a055_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a056_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a057_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a058_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a059_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a060_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a061_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 (c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int,
+c8 int, c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int, c16 int);
+alter table t1
+add key a001_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a002_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a003_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a004_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a005_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a006_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a007_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a008_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a009_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a010_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a011_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a012_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a013_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a014_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a015_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a016_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a017_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a018_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a019_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a020_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a021_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a022_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a023_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a024_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a025_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a026_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a027_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a028_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a029_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a030_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a031_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a032_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a033_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a034_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a035_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a036_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a037_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a038_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a039_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a040_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a041_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a042_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a043_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a044_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a045_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a046_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a047_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a048_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a049_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a050_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a051_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a052_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a053_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a054_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a055_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a056_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a057_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a058_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a059_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a060_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a061_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a062_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a063_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+add key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) DEFAULT NULL,
+ `c2` int(11) DEFAULT NULL,
+ `c3` int(11) DEFAULT NULL,
+ `c4` int(11) DEFAULT NULL,
+ `c5` int(11) DEFAULT NULL,
+ `c6` int(11) DEFAULT NULL,
+ `c7` int(11) DEFAULT NULL,
+ `c8` int(11) DEFAULT NULL,
+ `c9` int(11) DEFAULT NULL,
+ `c10` int(11) DEFAULT NULL,
+ `c11` int(11) DEFAULT NULL,
+ `c12` int(11) DEFAULT NULL,
+ `c13` int(11) DEFAULT NULL,
+ `c14` int(11) DEFAULT NULL,
+ `c15` int(11) DEFAULT NULL,
+ `c16` int(11) DEFAULT NULL,
+ KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a004_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a005_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a006_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a007_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a008_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a009_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a010_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a011_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a012_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a013_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a014_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a015_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a016_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a017_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a018_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a019_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a020_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a021_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a022_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a023_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a024_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a025_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a026_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a027_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a028_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a029_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a030_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a031_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a032_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a033_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a034_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a035_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a036_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a037_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a038_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a039_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a040_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a041_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a042_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a043_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a044_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a045_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a046_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a047_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a048_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a049_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a050_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a051_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a052_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a053_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a054_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a055_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a056_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a057_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a058_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a059_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a060_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a061_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+flush tables;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) DEFAULT NULL,
+ `c2` int(11) DEFAULT NULL,
+ `c3` int(11) DEFAULT NULL,
+ `c4` int(11) DEFAULT NULL,
+ `c5` int(11) DEFAULT NULL,
+ `c6` int(11) DEFAULT NULL,
+ `c7` int(11) DEFAULT NULL,
+ `c8` int(11) DEFAULT NULL,
+ `c9` int(11) DEFAULT NULL,
+ `c10` int(11) DEFAULT NULL,
+ `c11` int(11) DEFAULT NULL,
+ `c12` int(11) DEFAULT NULL,
+ `c13` int(11) DEFAULT NULL,
+ `c14` int(11) DEFAULT NULL,
+ `c15` int(11) DEFAULT NULL,
+ `c16` int(11) DEFAULT NULL,
+ KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a004_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a005_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a006_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a007_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a008_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a009_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a010_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a011_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a012_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a013_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a014_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a015_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a016_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a017_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a018_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a019_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a020_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a021_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a022_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a023_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a024_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a025_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a026_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a027_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a028_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a029_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a030_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a031_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a032_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a033_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a034_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a035_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a036_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a037_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a038_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a039_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a040_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a041_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a042_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a043_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a044_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a045_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a046_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a047_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a048_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a049_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a050_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a051_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a052_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a053_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a054_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a055_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a056_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a057_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a058_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a059_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a060_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a061_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
+ KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+alter table t1 add key
+a065_long_123456789_123456789_123456789_123456789_123456789_1234 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
+ERROR 42000: Too many keys specified; max 64 keys allowed
+drop table t1;
+create table t1 (c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int,
+c8 int, c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int,
+c16 int, c17 int);
+alter table t1 add key i1 (
+c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16, c17);
+ERROR 42000: Too many key parts specified; max 16 parts allowed
+alter table t1 add key
+a001_long_123456789_123456789_123456789_123456789_123456789_12345 (c1);
+ERROR 42000: Identifier name 'a001_long_123456789_123456789_123456789_123456789_123456789_12345' is too long
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) DEFAULT NULL,
+ `c2` int(11) DEFAULT NULL,
+ `c3` int(11) DEFAULT NULL,
+ `c4` int(11) DEFAULT NULL,
+ `c5` int(11) DEFAULT NULL,
+ `c6` int(11) DEFAULT NULL,
+ `c7` int(11) DEFAULT NULL,
+ `c8` int(11) DEFAULT NULL,
+ `c9` int(11) DEFAULT NULL,
+ `c10` int(11) DEFAULT NULL,
+ `c11` int(11) DEFAULT NULL,
+ `c12` int(11) DEFAULT NULL,
+ `c13` int(11) DEFAULT NULL,
+ `c14` int(11) DEFAULT NULL,
+ `c15` int(11) DEFAULT NULL,
+ `c16` int(11) DEFAULT NULL,
+ `c17` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+
+Bug #26104 Bug on foreign key class constructor
+
+Check that ref_columns is initalized correctly in the constructor
+and semantic checks in mysql_prepare_table work.
+
+We do not need a storage engine that supports foreign keys
+for this test, as the checks are purely syntax-based, and the
+syntax is supported for all engines.
+
+drop table if exists t1,t2;
+create table t1(a int not null, b int not null, primary key (a, b));
+create table t2(a int not null, b int not null, c int not null, primary key (a),
+foreign key fk_bug26104 (b,c) references t1(a));
+ERROR 42000: Incorrect foreign key definition for 'fk_bug26104': Key reference and table reference don't match
+drop table t1;
+create table t1(f1 int,f2 int);
+insert into t1 value(1,1),(1,2),(1,3),(2,1),(2,2),(2,3);
+flush status;
+create table t2 select sql_big_result f1,count(f2) from t1 group by f1;
+show status like 'handler_read%';
+Variable_name Value
+Handler_read_first 0
+Handler_read_key 0
+Handler_read_next 0
+Handler_read_prev 0
+Handler_read_rnd 0
+Handler_read_rnd_next 7
+drop table t1,t2;
End of 5.0 tests
CREATE TABLE t1 (a int, b int);
insert into t1 values (1,1),(1,2);
@@ -886,8 +1647,8 @@ Table Create Table
KEY `имÑ_индекÑа_в_кодировке_утф8_длиной_больше_чем_48` (`имÑ_полÑ_в_кодировке_утф8_длиной_больше_чем_45`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show create view имÑ_вью_кодировке_утф8_длиной_больше_чем_42;
-View Create View
-имÑ_вью_кодировке_утф8_длиной_больше_чем_42 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `имÑ_вью_кодировке_утф8_длиной_больше_чем_42` AS select `имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48`.`имÑ_полÑ_в_кодировке_утф8_длиной_больше_чем_45` AS `имÑ_полÑ_в_кодировке_утф8_длиной_больше_чем_45` from `имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48`
+View Create View character_set_client collation_connection
+имÑ_вью_кодировке_утф8_длиной_больше_чем_42 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `имÑ_вью_кодировке_утф8_длиной_больше_чем_42` AS select `имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48`.`имÑ_полÑ_в_кодировке_утф8_длиной_больше_чем_45` AS `имÑ_полÑ_в_кодировке_утф8_длиной_больше_чем_45` from `имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48` utf8 utf8_general_ci
create event имÑ_ÑобытиÑ_в_кодировке_утф8_длиной_больше_чем_48 on schedule every 2 year do select 1;
select EVENT_NAME from information_schema.events
where event_schema='test';
diff --git a/mysql-test/r/csv.result b/mysql-test/r/csv.result
index ede5d9a32fd..86ba5002af8 100644
--- a/mysql-test/r/csv.result
+++ b/mysql-test/r/csv.result
@@ -5203,6 +5203,27 @@ select * from bug15205;
val
drop table bug15205;
drop table bug15205_2;
+set names latin1;
+create table t1 (
+c varchar(1),
+name varchar(64)
+) character set latin1 engine=csv;
+insert into t1 values (0xC0,'LATIN CAPITAL LETTER A WITH GRAVE');
+insert into t1 values (0xE0,'LATIN SMALL LETTER A WITH GRAVE');
+insert into t1 values (0xEE,'LATIN SMALL LETTER I WITH CIRCUMFLEX');
+insert into t1 values (0xFE,'LATIN SMALL LETTER THORN');
+insert into t1 values (0xF7,'DIVISION SIGN');
+insert into t1 values (0xFF,'LATIN SMALL LETTER Y WITH DIAERESIS');
+select hex(c), c, name from t1 order by 1;
+hex(c) c name
+C0 À LATIN CAPITAL LETTER A WITH GRAVE
+E0 à LATIN SMALL LETTER A WITH GRAVE
+EE î LATIN SMALL LETTER I WITH CIRCUMFLEX
+F7 ÷ DIVISION SIGN
+FE þ LATIN SMALL LETTER THORN
+FF ÿ LATIN SMALL LETTER Y WITH DIAERESIS
+drop table t1;
+End of 5.0 tests
create table bug22080_1 (id int,string varchar(64)) Engine=CSV;
create table bug22080_2 (id int,string varchar(64)) Engine=CSV;
create table bug22080_3 (id int,string varchar(64)) Engine=CSV;
@@ -5240,3 +5261,58 @@ CREATE TABLE `bug21328` (
insert into bug21328 values (1,NULL,NULL);
alter table bug21328 engine=myisam;
drop table bug21328;
+create table t1(a blob, b int) engine=csv;
+insert into t1 values('a', 1);
+flush tables;
+update t1 set b=2;
+select * from t1;
+a b
+a 2
+drop table t1;
+create table t1(a int) engine=csv;
+insert into t1 values(-1), (-123.34), (2), (-23);
+select * from t1;
+a
+-1
+-123
+2
+-23
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+drop table t1;
+create table t1(a int, b int) engine=csv;
+repair table t1;
+Table Op Msg_type Msg_text
+test.t1 repair Warning Data truncated for column 'a' at row 5
+test.t1 repair status OK
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+select * from t1;
+a b
+1 0
+-200 1
+-1 -1
+-1 -100
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+drop table t1;
+create table t1(a int) engine=csv;
+insert into t1 values (0), (1), (2);
+delete from t1 limit 2;
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+select * from t1;
+a
+2
+delete from t1;
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+select * from t1;
+a
+drop table t1;
+End of 5.1 tests
diff --git a/mysql-test/r/ctype_ascii.result b/mysql-test/r/ctype_ascii.result
new file mode 100644
index 00000000000..06362486073
--- /dev/null
+++ b/mysql-test/r/ctype_ascii.result
@@ -0,0 +1,177 @@
+set names ascii;
+select 'e'='`';
+'e'='`'
+0
+select 'y'='~';
+'y'='~'
+0
+create table t1 (a char(1) character set ascii);
+insert into t1 (a) values (' '), ('a'), ('b'), ('c'), ('d'), ('e'), ('f'), ('g'), ('h'), ('i'), ('j'), ('k'), ('l'), ('m'), ('n'), ('o'), ('p'), ('q'), ('r'), ('s'), ('t'), ('u'), ('v'), ('w'), ('x'), ('y'), ('z'), ('A'), ('B'), ('C'), ('D'), ('E'), ('F'), ('G'), ('H'), ('I'), ('J'), ('K'), ('L'), ('M'), ('N'), ('O'), ('P'), ('Q'), ('R'), ('S'), ('T'), ('U'), ('V'), ('W'), ('X'), ('Y'), ('Z'), ('!'), ('@'), ('#'), ('$'), ('%'), ('^'), ('&'), ('*'), ('('), (')'), ('_'), ('+'), ('`'), ('~'), ('1'), ('2'), ('3'), ('4'), ('5'), ('6'), ('7'), ('8'), ('9'), ('0'), ('['), (']'), ('\\'), ('|'), ('}'), ('{'), ('"'), (':'), (''''), (';'), ('/'), ('.'), (','), ('?'), ('>'), ('<'), ('\n'), ('\t'), ('\a'), ('\f'), ('\v');
+select t1a.a, t1b.a from t1 as t1a, t1 as t1b where t1a.a=t1b.a order by binary t1a.a, binary t1b.a;
+a a
+
+
+
+
+
+! !
+" "
+# #
+$ $
+% %
+& &
+' '
+( (
+) )
+* *
++ +
+, ,
+. .
+/ /
+0 0
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+7 7
+8 8
+9 9
+: :
+; ;
+< <
+> >
+? ?
+@ @
+A A
+A a
+A a
+B B
+B b
+C C
+C c
+D D
+D d
+E E
+E e
+F F
+F f
+F f
+G G
+G g
+H H
+H h
+I I
+I i
+J J
+J j
+K K
+K k
+L L
+L l
+M M
+M m
+N N
+N n
+O O
+O o
+P P
+P p
+Q Q
+Q q
+R R
+R r
+S S
+S s
+T T
+T t
+U U
+U u
+V V
+V v
+V v
+W W
+W w
+X X
+X x
+Y Y
+Y y
+Z Z
+Z z
+[ [
+\ \
+] ]
+^ ^
+_ _
+` `
+a A
+a A
+a a
+a a
+a a
+a a
+b B
+b b
+c C
+c c
+d D
+d d
+e E
+e e
+f F
+f F
+f f
+f f
+f f
+f f
+g G
+g g
+h H
+h h
+i I
+i i
+j J
+j j
+k K
+k k
+l L
+l l
+m M
+m m
+n N
+n n
+o O
+o o
+p P
+p p
+q Q
+q q
+r R
+r r
+s S
+s s
+t T
+t t
+u U
+u u
+v V
+v V
+v v
+v v
+v v
+v v
+w W
+w w
+x X
+x x
+y Y
+y y
+z Z
+z z
+{ {
+| |
+} }
+~ ~
+drop table t1;
+End of 5.0 tests.
diff --git a/mysql-test/r/ctype_big5.result b/mysql-test/r/ctype_big5.result
index 6574908101c..6d318a445f5 100644
--- a/mysql-test/r/ctype_big5.result
+++ b/mysql-test/r/ctype_big5.result
@@ -192,3 +192,18 @@ drop table t1;
select hex(convert(_big5 0xC84041 using ucs2));
hex(convert(_big5 0xC84041 using ucs2))
003F0041
+End of 4.1 tests
+set names big5;
+create table t1 (a blob);
+insert into t1 values (0xEE00);
+select * into outfile 'test/t1.txt' from t1;
+delete from t1;
+select hex(load_file('MYSQLTEST_VARDIR/master-data/test/t1.txt'));;
+hex(load_file('MYSQLTEST_VARDIR/master-data/test/t1.txt'))
+5CEE5C300A
+load data infile 't1.txt' into table t1;
+select hex(a) from t1;
+hex(a)
+EE00
+drop table t1;
+End of 5.0 tests
diff --git a/mysql-test/r/ctype_collate.result b/mysql-test/r/ctype_collate.result
index c5d433cd080..026c0ebdcf2 100644
--- a/mysql-test/r/ctype_collate.result
+++ b/mysql-test/r/ctype_collate.result
@@ -488,7 +488,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SHOW FIELDS FROM t1;
Field Type Null Key Default Extra
-latin1_f char(32) NO
+latin1_f char(32) NO NULL
ALTER TABLE t1 CHANGE latin1_f
latin1_f CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin;
SHOW CREATE TABLE t1;
@@ -595,3 +595,19 @@ EXPLAIN SELECT * FROM t1 WHERE s2 LIKE 'a' COLLATE latin1_german1_ci;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL s2 NULL NULL NULL 10 Using where
DROP TABLE t1;
+create table t1(f1 varchar(10) character set latin2 collate latin2_hungarian_ci, key(f1));
+insert into t1 set f1=0x3F3F9DC73F;
+insert into t1 set f1=0x3F3F1E563F;
+insert into t1 set f1=0x3F3F;
+check table t1 extended;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+drop table t1;
+create table t1 (a varchar(2) character set latin7 collate latin7_general_ci,key(a));
+insert into t1 set a=0x4c20;
+insert into t1 set a=0x6c;
+insert into t1 set a=0x4c98;
+check table t1 extended;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+drop table t1;
diff --git a/mysql-test/r/ctype_cp932_binlog_stm.result b/mysql-test/r/ctype_cp932_binlog_stm.result
index b486d2faaa9..cbdafc95b2a 100644
--- a/mysql-test/r/ctype_cp932_binlog_stm.result
+++ b/mysql-test/r/ctype_cp932_binlog_stm.result
@@ -9,8 +9,7 @@ EXECUTE stmt1 USING @var1;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; CREATE TABLE t1(f1 blob)
-master-bin.000001 # User var # # @`var1`=_binary 0x8300 COLLATE binary
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(@'var1')
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES('ƒ\0')
SELECT HEX(f1) FROM t1;
HEX(f1)
8300
@@ -30,17 +29,21 @@ HEX(s1) HEX(s2) d
466F6F2773206120426172 ED40ED41ED42 47.93
DROP PROCEDURE bug18293|
DROP TABLE t4|
-SHOW BINLOG EVENTS FROM 410|
+SHOW BINLOG EVENTS FROM 369|
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 410 Query 1 576 use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1,
+master-bin.000001 369 Query 1 535 use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1,
s2 CHAR(50) CHARACTER SET cp932,
d DECIMAL(10,2))
-master-bin.000001 576 Query 1 824 use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE bug18293 (IN ins1 CHAR(50),
+master-bin.000001 535 Query 1 783 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 824 Query 1 1043 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93))
-master-bin.000001 1043 Query 1 1132 use `test`; DROP PROCEDURE bug18293
-master-bin.000001 1132 Query 1 1211 use `test`; DROP TABLE t4
+master-bin.000001 783 Query 1 999 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93))
+master-bin.000001 999 Query 1 1088 use `test`; DROP PROCEDURE bug18293
+master-bin.000001 1088 Query 1 1167 use `test`; DROP TABLE t4
+End of 5.0 tests
+SHOW BINLOG EVENTS FROM 364;
+ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error
+End of 5.1 tests
diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result
index 32871563b64..763acd0fea0 100644
--- a/mysql-test/r/ctype_latin1.result
+++ b/mysql-test/r/ctype_latin1.result
@@ -405,3 +405,7 @@ i
1
2
DROP TABLE `abcÿdef`;
+select hex(cast(_ascii 0x7f as char(1) character set latin1));
+hex(cast(_ascii 0x7f as char(1) character set latin1))
+7F
+End of 5.0 tests
diff --git a/mysql-test/r/ctype_ldml.result b/mysql-test/r/ctype_ldml.result
new file mode 100644
index 00000000000..f3d3ff700f0
--- /dev/null
+++ b/mysql-test/r/ctype_ldml.result
@@ -0,0 +1,296 @@
+drop table if exists t1;
+set names utf8;
+show variables like 'character_sets_dir%';
+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
+create table t1 (c1 char(1) character set utf8 collate utf8_test_ci);
+insert into t1 values ('a');
+select * from t1 where c1='b';
+c1
+a
+drop table t1;
+show collation like 'ucs2_test_ci';
+Collation Charset Id Default Compiled Sortlen
+ucs2_test_ci ucs2 241 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';
+c1
+a
+drop table t1;
+show collation like 'ucs2_vn_ci';
+Collation Charset Id Default Compiled Sortlen
+ucs2_vn_ci ucs2 242 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);
+insert into t1 values (0x0103),(0x0102),(0x1EB1),(0x1EB0),(0x1EB3),(0x1EB2),
+(0x1EB5),(0x1EB4),(0x1EAF),(0x1EAE),(0x1EB7),(0x1EB6);
+insert into t1 values (0x00E2),(0x00C2),(0x1EA7),(0x1EA6),(0x1EA9),(0x1EA8),
+(0x1EAB),(0x1EAA),(0x1EA5),(0x1EA4),(0x1EAD),(0x1EAC);
+insert into t1 values ('b'),('B'),('c'),('C');
+insert into t1 values ('d'),('D'),(0x0111),(0x0110);
+insert into t1 values (0x0065),(0x0045),(0x00E8),(0x00C8),(0x1EBB),(0x1EBA),
+(0x1EBD),(0x1EBC),(0x00E9),(0x00C9),(0x1EB9),(0x1EB8);
+insert into t1 values (0x00EA),(0x00CA),(0x1EC1),(0x1EC0),(0x1EC3),(0x1EC2),
+(0x1EC5),(0x1EC4),(0x1EBF),(0x1EBE),(0x1EC7),(0x1EC6);
+insert into t1 values ('g'),('G'),('h'),('H');
+insert into t1 values (0x0069),(0x0049),(0x00EC),(0x00CC),(0x1EC9),(0x1EC8),
+(0x0129),(0x0128),(0x00ED),(0x00CD),(0x1ECB),(0x1ECA);
+insert into t1 values ('k'),('K'),('l'),('L'),('m'),('M');
+insert into t1 values (0x006F),(0x004F),(0x00F2),(0x00D2),(0x1ECF),(0x1ECE),
+(0x00F5),(0x00D5),(0x00F3),(0x00D3),(0x1ECD),(0x1ECC);
+insert into t1 values (0x00F4),(0x00D4),(0x1ED3),(0x1ED2),(0x1ED5),(0x1ED4),
+(0x1ED7),(0x1ED6),(0x1ED1),(0x1ED0),(0x1ED9),(0x1ED8);
+insert into t1 values (0x01A1),(0x01A0),(0x1EDD),(0x1EDC),(0x1EDF),(0x1EDE),
+(0x1EE1),(0x1EE0),(0x1EDB),(0x1EDA),(0x1EE3),(0x1EE2);
+insert into t1 values ('p'),('P'),('q'),('Q'),('r'),('R'),('s'),('S'),('t'),('T');
+insert into t1 values (0x0075),(0x0055),(0x00F9),(0x00D9),(0x1EE7),(0x1EE6),
+(0x0169),(0x0168),(0x00FA),(0x00DA),(0x1EE5),(0x1EE4);
+insert into t1 values (0x01B0),(0x01AF),(0x1EEB),(0x1EEA),(0x1EED),(0x1EEC),
+(0x1EEF),(0x1EEE),(0x1EE9),(0x1EE8),(0x1EF1),(0x1EF0);
+insert into t1 values ('v'),('V'),('x'),('X');
+insert into t1 values (0x0079),(0x0059),(0x1EF3),(0x1EF2),(0x1EF7),(0x1EF6),
+(0x1EF9),(0x1EF8),(0x00FD),(0x00DD),(0x1EF5),(0x1EF4);
+select hex(c1) as h, c1 from t1 order by c1, h;
+h c1
+0041 A
+0061 a
+00C0 À
+00C1 Ã
+00C3 Ã
+00E0 à
+00E1 á
+00E3 ã
+1EA0 Ạ
+1EA1 ạ
+1EA2 Ả
+1EA3 ả
+0102 Ä‚
+0103 ă
+1EAE Ắ
+1EAF ắ
+1EB0 Ằ
+1EB1 ằ
+1EB2 Ẳ
+1EB3 ẳ
+1EB4 Ẵ
+1EB5 ẵ
+1EB6 Ặ
+1EB7 ặ
+00C2 Â
+00E2 â
+1EA4 Ấ
+1EA5 ấ
+1EA6 Ầ
+1EA7 ầ
+1EA8 Ẩ
+1EA9 ẩ
+1EAA Ẫ
+1EAB ẫ
+1EAC Ậ
+1EAD ậ
+0042 B
+0062 b
+0043 C
+0063 c
+0044 D
+0064 d
+0110 Ä
+0111 Ä‘
+0045 E
+0065 e
+00C8 È
+00C9 É
+00E8 è
+00E9 é
+1EB8 Ẹ
+1EB9 ẹ
+1EBA Ẻ
+1EBB ẻ
+1EBC Ẽ
+1EBD ẽ
+00CA Ê
+00EA ê
+1EBE Ế
+1EBF ế
+1EC0 Ề
+1EC1 á»
+1EC2 Ể
+1EC3 ể
+1EC4 Ễ
+1EC5 á»…
+1EC6 Ệ
+1EC7 ệ
+0047 G
+0067 g
+0048 H
+0068 h
+0049 I
+0069 i
+00CC Ì
+00CD Ã
+00EC ì
+00ED í
+0128 Ĩ
+0129 Ä©
+1EC8 Ỉ
+1EC9 ỉ
+1ECA Ị
+1ECB ị
+004B K
+006B k
+004C L
+006C l
+004D M
+006D m
+004F O
+006F o
+00D2 Ã’
+00D3 Ó
+00D5 Õ
+00F2 ò
+00F3 ó
+00F5 õ
+1ECC Ọ
+1ECD á»
+1ECE Ỏ
+1ECF á»
+00D4 Ô
+00F4 ô
+1ED0 á»
+1ED1 ố
+1ED2 á»’
+1ED3 ồ
+1ED4 á»”
+1ED5 ổ
+1ED6 á»–
+1ED7 á»—
+1ED8 Ộ
+1ED9 á»™
+01A0 Æ 
+01A1 Æ¡
+1EDA Ớ
+1EDB á»›
+1EDC Ờ
+1EDD á»
+1EDE Ở
+1EDF ở
+1EE0 á» 
+1EE1 ỡ
+1EE2 Ợ
+1EE3 ợ
+0050 P
+0070 p
+0051 Q
+0071 q
+0052 R
+0072 r
+0053 S
+0073 s
+0054 T
+0074 t
+0055 U
+0075 u
+00D9 Ù
+00DA Ú
+00F9 ù
+00FA ú
+0168 Ũ
+0169 Å©
+1EE4 Ụ
+1EE5 ụ
+1EE6 Ủ
+1EE7 á»§
+01AF Ư
+01B0 ư
+1EE8 Ứ
+1EE9 ứ
+1EEA Ừ
+1EEB ừ
+1EEC Ử
+1EED á»­
+1EEE á»®
+1EEF ữ
+1EF0 á»°
+1EF1 á»±
+0056 V
+0076 v
+0058 X
+0078 x
+0059 Y
+0079 y
+00DD Ã
+00FD ý
+1EF2 Ỳ
+1EF3 ỳ
+1EF4 á»´
+1EF5 ỵ
+1EF6 á»¶
+1EF7 á»·
+1EF8 Ỹ
+1EF9 ỹ
+select group_concat(hex(c1) order by hex(c1)) from t1 group by c1;
+group_concat(hex(c1) order by hex(c1))
+0041,0061,00C0,00C1,00C3,00E0,00E1,00E3,1EA0,1EA1,1EA2,1EA3
+0102,0103,1EAE,1EAF,1EB0,1EB1,1EB2,1EB3,1EB4,1EB5,1EB6,1EB7
+00C2,00E2,1EA4,1EA5,1EA6,1EA7,1EA8,1EA9,1EAA,1EAB,1EAC,1EAD
+0042,0062
+0043,0063
+0044,0064
+0110,0111
+0045,0065,00C8,00C9,00E8,00E9,1EB8,1EB9,1EBA,1EBB,1EBC,1EBD
+00CA,00EA,1EBE,1EBF,1EC0,1EC1,1EC2,1EC3,1EC4,1EC5,1EC6,1EC7
+0047,0067
+0048,0068
+0049,0069,00CC,00CD,00EC,00ED,0128,0129,1EC8,1EC9,1ECA,1ECB
+004B,006B
+004C,006C
+004D,006D
+004F,006F,00D2,00D3,00D5,00F2,00F3,00F5,1ECC,1ECD,1ECE,1ECF
+00D4,00F4,1ED0,1ED1,1ED2,1ED3,1ED4,1ED5,1ED6,1ED7,1ED8,1ED9
+01A0,01A1,1EDA,1EDB,1EDC,1EDD,1EDE,1EDF,1EE0,1EE1,1EE2,1EE3
+0050,0070
+0051,0071
+0052,0072
+0053,0073
+0054,0074
+0055,0075,00D9,00DA,00F9,00FA,0168,0169,1EE4,1EE5,1EE6,1EE7
+01AF,01B0,1EE8,1EE9,1EEA,1EEB,1EEC,1EED,1EEE,1EEF,1EF0,1EF1
+0056,0076
+0058,0078
+0059,0079,00DD,00FD,1EF2,1EF3,1EF4,1EF5,1EF6,1EF7,1EF8,1EF9
+select group_concat(c1 order by hex(c1) SEPARATOR '') from t1 group by c1;
+group_concat(c1 order by hex(c1) SEPARATOR '')
+AaÀÃÃàáãẠạẢả
+ĂăẮắẰằẲẳẴẵẶặ
+ÂâẤấẦầẨẩẪẫẬậ
+Bb
+Cc
+Dd
+ÄÄ‘
+EeÈÉèéẸẹẺẻẼẽ
+ÊêẾếỀá»á»‚ểỄễỆệ
+Gg
+Hh
+IiÃŒÃìíĨĩỈỉỊị
+Kk
+Ll
+Mm
+OoÒÓÕòóõỌá»á»Žá»
+Ôôá»á»‘ỒồỔổỖỗỘộ
+ƠơỚớỜá»á»žá»Ÿá» á»¡á»¢á»£
+Pp
+Qq
+Rr
+Ss
+Tt
+UuÙÚùúŨũỤụỦủ
+ƯưỨứỪừỬửỮữỰự
+Vv
+Xx
+YyÃýỲỳỴỵỶỷỸỹ
+drop table t1;
diff --git a/mysql-test/r/ctype_recoding.result b/mysql-test/r/ctype_recoding.result
index e85d379c932..304e37facb1 100644
--- a/mysql-test/r/ctype_recoding.result
+++ b/mysql-test/r/ctype_recoding.result
@@ -54,7 +54,7 @@ Table Create Table
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='ËÏÍÍÅÎÔÁÒÉÊ ÔÁÂÌÉÃÙ'
SHOW FIELDS FROM ÔÁÂÌÉÃÁ;
Field Type Null Key Default Extra
-ÐÏÌÅ char(32) NO
+ÐÏÌÅ char(32) NO NULL
SET CHARACTER SET cp1251;
SHOW TABLES;
Tables_in_test
@@ -66,7 +66,7 @@ Table Create Table
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='êîììåíòàðèé òàáëèöû'
SHOW FIELDS FROM òàáëèöà;
Field Type Null Key Default Extra
-ïîëå char(32) NO
+ïîëå char(32) NO NULL
SET CHARACTER SET utf8;
SHOW TABLES;
Tables_in_test
@@ -78,7 +78,7 @@ Table Create Table
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='комментарий таблицы'
SHOW FIELDS FROM таблица;
Field Type Null Key Default Extra
-поле char(32) NO
+поле char(32) NO NULL
SET CHARACTER SET koi8r;
DROP TABLE ÔÁÂÌÉÃÁ;
SET CHARACTER SET default;
@@ -187,6 +187,14 @@ select * from t1 where a=_latin1'×ÁÓÑ';
ERROR HY000: Illegal mix of collations (cp1251_general_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation '='
drop table t1;
set names latin1;
+set names ascii;
+create table t1 (a char(1) character set latin1);
+insert into t1 values ('a');
+select * from t1 where a='a';
+a
+a
+drop table t1;
+set names latin1;
create table t1 (a char(10) character set utf8 collate utf8_bin);
insert into t1 values (' xxx');
select * from t1 where a=lpad('xxx',10,' ');
diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result
index 1fd1493bf1e..889702e380c 100644
--- a/mysql-test/r/ctype_uca.result
+++ b/mysql-test/r/ctype_uca.result
@@ -2663,3 +2663,95 @@ COUNT(*) c1
1
1 a
DROP TABLE IF EXISTS t1;
+set names utf8;
+create table t1 (
+a varchar(255),
+key a(a)
+) character set utf8 collate utf8_danish_ci;
+insert into t1 values ('åaaaa'),('ååaaa'),('aaaaa');
+select a as like_a from t1 where a like 'a%';
+like_a
+aaaaa
+select a as like_aa from t1 where a like 'aa%';
+like_aa
+aaaaa
+select a as like_aaa from t1 where a like 'aaa%';
+like_aaa
+aaaaa
+select a as like_aaaa from t1 where a like 'aaaa%';
+like_aaaa
+aaaaa
+select a as like_aaaaa from t1 where a like 'aaaaa%';
+like_aaaaa
+aaaaa
+alter table t1 convert to character set ucs2 collate ucs2_danish_ci;
+select a as like_a from t1 where a like 'a%';
+like_a
+aaaaa
+select a as like_aa from t1 where a like 'aa%';
+like_aa
+aaaaa
+select a as like_aaa from t1 where a like 'aaa%';
+like_aaa
+aaaaa
+select a as like_aaaa from t1 where a like 'aaaa%';
+like_aaaa
+aaaaa
+select a as like_aaaaa from t1 where a like 'aaaaa%';
+like_aaaaa
+aaaaa
+drop table t1;
+create table t1 (
+a varchar(255),
+key(a)
+) character set utf8 collate utf8_spanish2_ci;
+insert into t1 values ('aaaaa'),('lllll'),('zzzzz');
+select a as like_l from t1 where a like 'l%';
+like_l
+lllll
+select a as like_ll from t1 where a like 'll%';
+like_ll
+lllll
+select a as like_lll from t1 where a like 'lll%';
+like_lll
+lllll
+select a as like_llll from t1 where a like 'llll%';
+like_llll
+lllll
+select a as like_lllll from t1 where a like 'lllll%';
+like_lllll
+lllll
+alter table t1 convert to character set ucs2 collate ucs2_spanish2_ci;
+select a as like_l from t1 where a like 'l%';
+like_l
+lllll
+select a as like_ll from t1 where a like 'll%';
+like_ll
+lllll
+select a as like_lll from t1 where a like 'lll%';
+like_lll
+lllll
+select a as like_llll from t1 where a like 'llll%';
+like_llll
+lllll
+select a as like_lllll from t1 where a like 'lllll%';
+like_lllll
+lllll
+drop table t1;
+create table t1 (
+a varchar(255),
+key a(a)
+) character set utf8 collate utf8_czech_ci;
+insert into t1 values
+('b'),('c'),('d'),('e'),('f'),('g'),('h'),('ch'),('i'),('j');
+select * from t1 where a like 'c%';
+a
+c
+ch
+alter table t1 convert to character set ucs2 collate ucs2_czech_ci;
+select * from t1 where a like 'c%';
+a
+c
+ch
+drop table t1;
+End for 5.0 tests
diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result
index fcfe5d6345b..1097486f185 100644
--- a/mysql-test/r/ctype_ucs.result
+++ b/mysql-test/r/ctype_ucs.result
@@ -865,4 +865,61 @@ blob 65535 65535
text 65535 65535
text 65535 32767
drop table t1;
+create table t1 (a char(1) character set ucs2);
+insert into t1 values ('a'),('b'),('c');
+select hex(group_concat(a)) from t1;
+hex(group_concat(a))
+0061002C0062002C0063
+select collation(group_concat(a)) from t1;
+collation(group_concat(a))
+ucs2_general_ci
+drop table t1;
+set names latin1;
+create table t1 (a char(1) character set latin1);
+insert into t1 values ('a'),('b'),('c');
+set character_set_connection=ucs2;
+select hex(group_concat(a separator ',')) from t1;
+hex(group_concat(a separator ','))
+612C622C63
+select collation(group_concat(a separator ',')) from t1;
+collation(group_concat(a separator ','))
+latin1_swedish_ci
+drop table t1;
+set names latin1;
+create table t1 (s1 char(1) character set ascii, s2 char(1) character set ucs2);
+insert into t1 (s1) values (0x7f);
+update t1 set s2 = s1;
+select hex(s2) from t1;
+hex(s2)
+007F
+select hex(convert(s1 using latin1)) from t1;
+hex(convert(s1 using latin1))
+7F
+drop table t1;
+create table t1 (a varchar(15) character set ascii not null, b int);
+insert into t1 values ('a',1);
+select concat(a,if(b<10,_ucs2 0x0061,_ucs2 0x0062)) from t1;
+concat(a,if(b<10,_ucs2 0x0061,_ucs2 0x0062))
+aa
+select concat(a,if(b>10,_ucs2 0x0061,_ucs2 0x0062)) from t1;
+concat(a,if(b>10,_ucs2 0x0061,_ucs2 0x0062))
+ab
+select * from t1 where a=if(b<10,_ucs2 0x0061,_ucs2 0x0062);
+a b
+a 1
+select * from t1 where a=if(b>10,_ucs2 0x0061,_ucs2 0x0062);
+a b
+select concat(a,if(b<10,_ucs2 0x00C0,_ucs2 0x0062)) from t1;
+ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (ucs2_general_ci,COERCIBLE) for operation 'concat'
+select concat(a,if(b>10,_ucs2 0x00C0,_ucs2 0x0062)) from t1;
+ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (ucs2_general_ci,COERCIBLE) for operation 'concat'
+select concat(a,if(b<10,_ucs2 0x0062,_ucs2 0x00C0)) from t1;
+ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (ucs2_general_ci,COERCIBLE) for operation 'concat'
+select concat(a,if(b>10,_ucs2 0x0062,_ucs2 0x00C0)) from t1;
+ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (ucs2_general_ci,COERCIBLE) for operation 'concat'
+select * from t1 where a=if(b<10,_ucs2 0x00C0,_ucs2 0x0062);
+ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (ucs2_general_ci,COERCIBLE) for operation '='
+select * from t1 where a=if(b<10,_ucs2 0x0062,_ucs2 0x00C0);
+ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (ucs2_general_ci,COERCIBLE) for operation '='
+drop table t1;
End of 5.0 tests
diff --git a/mysql-test/r/ctype_ucs2_def.result b/mysql-test/r/ctype_ucs2_def.result
index 2f9dc4ae616..6fd45428368 100644
--- a/mysql-test/r/ctype_ucs2_def.result
+++ b/mysql-test/r/ctype_ucs2_def.result
@@ -7,3 +7,18 @@ character_set_server ucs2
DROP TABLE IF EXISTS t1;
create table t1 (a int);
drop table t1;
+End of 4.1 tests
+create table t1 (a char(1) character set latin1);
+insert into t1 values ('a'),('b'),('c');
+select hex(group_concat(a)) from t1;
+hex(group_concat(a))
+612C622C63
+drop table t1;
+CREATE TABLE t1(col1 VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL,
+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'
+DROP TABLE t1;
+End of 5.0 tests
diff --git a/mysql-test/r/ctype_ujis_ucs2.result b/mysql-test/r/ctype_ujis_ucs2.result
new file mode 100644
index 00000000000..3c63e7c0441
--- /dev/null
+++ b/mysql-test/r/ctype_ujis_ucs2.result
@@ -0,0 +1,19159 @@
+drop table if exists t1, t2;
+create table t2 (code binary(1));
+insert into t2 values (0xA1),(0xA2),(0xA3),(0xA4),(0xA5),(0xA6),(0xA7);
+insert into t2 values (0xA8),(0xA9),(0xAA),(0xAB),(0xAC),(0xAD),(0xAE),(0xAF);
+insert into t2 values (0xB0),(0xB1),(0xB2),(0xB3),(0xB4),(0xB5),(0xB6),(0xB7);
+insert into t2 values (0xB8),(0xB9),(0xBA),(0xBB),(0xBC),(0xBD),(0xBE),(0xBF);
+insert into t2 values (0xC0),(0xC1),(0xC2),(0xC3),(0xC4),(0xC5),(0xC6),(0xC7);
+insert into t2 values (0xC8),(0xC9),(0xCA),(0xCB),(0xCC),(0xCD),(0xCE),(0xCF);
+insert into t2 values (0xD0),(0xD1),(0xD2),(0xD3),(0xD4),(0xD5),(0xD6),(0xD7);
+insert into t2 values (0xD8),(0xD9),(0xDA),(0xDB),(0xDC),(0xDD),(0xDE),(0xDF);
+insert into t2 values (0xE0),(0xE1),(0xE2),(0xE3),(0xE4),(0xE5),(0xE6),(0xE7);
+insert into t2 values (0xE8),(0xE9),(0xEA),(0xEB),(0xEC),(0xED),(0xEE),(0xEF);
+insert into t2 values (0xF0),(0xF1),(0xF2),(0xF3),(0xF4),(0xF5),(0xF6),(0xF7);
+insert into t2 values (0xF8),(0xF9),(0xFA),(0xFB),(0xFC),(0xFD),(0xFE);
+create table t1
+(
+ujis varchar(1) character set ujis collate ujis_bin primary key,
+ucs2 varchar(1) character set ucs2 not null default '',
+ujis2 varchar(1) character set ujis not null default '',
+name varchar(64) character set ujis not null default ''
+);
+insert into t1 set ujis=0x00, name='U+0000 NULL';
+insert into t1 set ujis=0x01, name='U+0001 START OF HEADING';
+insert into t1 set ujis=0x02, name='U+0002 START OF TEXT';
+insert into t1 set ujis=0x03, name='U+0003 END OF TEXT';
+insert into t1 set ujis=0x04, name='U+0004 END OF TRANSMISSION';
+insert into t1 set ujis=0x05, name='U+0005 ENQUIRY';
+insert into t1 set ujis=0x06, name='U+0006 ACKNOWLEDGE';
+insert into t1 set ujis=0x07, name='U+0007 BELL';
+insert into t1 set ujis=0x08, name='U+0008 BACKSPACE';
+insert into t1 set ujis=0x09, name='U+0009 HORIZONTAL TABULATION';
+insert into t1 set ujis=0x0A, name='U+000A LINE FEED';
+insert into t1 set ujis=0x0B, name='U+000B VERTICAL TABULATION';
+insert into t1 set ujis=0x0C, name='U+000C FORM FEED';
+insert into t1 set ujis=0x0D, name='U+000D CARRIAGE RETURN';
+insert into t1 set ujis=0x0E, name='U+000E SHIFT OUT';
+insert into t1 set ujis=0x0F, name='U+000F SHIFT IN';
+insert into t1 set ujis=0x10, name='U+0010 DATA LINK ESCAPE';
+insert into t1 set ujis=0x11, name='U+0011 DEVICE CONTROL ONE';
+insert into t1 set ujis=0x12, name='U+0012 DEVICE CONTROL TWO';
+insert into t1 set ujis=0x13, name='U+0013 DEVICE CONTROL THREE';
+insert into t1 set ujis=0x14, name='U+0014 DEVICE CONTROL FOUR';
+insert into t1 set ujis=0x15, name='U+0015 NEGATIVE ACKNOWLEDGE';
+insert into t1 set ujis=0x16, name='U+0016 SYNCHRONOUS IDLE';
+insert into t1 set ujis=0x17, name='U+0017 END OF TRANSMISSION BLOCK';
+insert into t1 set ujis=0x18, name='U+0018 CANCEL';
+insert into t1 set ujis=0x19, name='U+0019 END OF MEDIUM';
+insert into t1 set ujis=0x1A, name='U+001A SUBSTITUTE';
+insert into t1 set ujis=0x1B, name='U+001B ESCAPE';
+insert into t1 set ujis=0x1C, name='U+001C FILE SEPARATOR';
+insert into t1 set ujis=0x1D, name='U+001D GROUP SEPARATOR';
+insert into t1 set ujis=0x1E, name='U+001E RECORD SEPARATOR';
+insert into t1 set ujis=0x1F, name='U+001F UNIT SEPARATOR';
+insert into t1 set ujis=0x20, name='U+0020 SPACE';
+insert into t1 set ujis=0x21, name='U+0021 EXCLAMATION MARK';
+insert into t1 set ujis=0x22, name='U+0022 QUOTATION MARK';
+insert into t1 set ujis=0x23, name='U+0023 NUMBER SIGN';
+insert into t1 set ujis=0x24, name='U+0024 DOLLAR SIGN';
+insert into t1 set ujis=0x25, name='U+0025 PERCENT SIGN';
+insert into t1 set ujis=0x26, name='U+0026 AMPERSAND';
+insert into t1 set ujis=0x27, name='U+0027 APOSTROPHE';
+insert into t1 set ujis=0x28, name='U+0028 LEFT PARENTHESIS';
+insert into t1 set ujis=0x29, name='U+0029 RIGHT PARENTHESIS';
+insert into t1 set ujis=0x2A, name='U+002A ASTERISK';
+insert into t1 set ujis=0x2B, name='U+002B PLUS SIGN';
+insert into t1 set ujis=0x2C, name='U+002C COMMA';
+insert into t1 set ujis=0x2D, name='U+002D HYPHEN-MINUS';
+insert into t1 set ujis=0x2E, name='U+002E FULL STOP';
+insert into t1 set ujis=0x2F, name='U+002F SOLIDUS';
+insert into t1 set ujis=0x30, name='U+0030 DIGIT ZERO';
+insert into t1 set ujis=0x31, name='U+0031 DIGIT ONE';
+insert into t1 set ujis=0x32, name='U+0032 DIGIT TWO';
+insert into t1 set ujis=0x33, name='U+0033 DIGIT THREE';
+insert into t1 set ujis=0x34, name='U+0034 DIGIT FOUR';
+insert into t1 set ujis=0x35, name='U+0035 DIGIT FIVE';
+insert into t1 set ujis=0x36, name='U+0036 DIGIT SIX';
+insert into t1 set ujis=0x37, name='U+0037 DIGIT SEVEN';
+insert into t1 set ujis=0x38, name='U+0038 DIGIT EIGHT';
+insert into t1 set ujis=0x39, name='U+0039 DIGIT NINE';
+insert into t1 set ujis=0x3A, name='U+003A COLON';
+insert into t1 set ujis=0x3B, name='U+003B SEMICOLON';
+insert into t1 set ujis=0x3C, name='U+003C LESS-THAN SIGN';
+insert into t1 set ujis=0x3D, name='U+003D EQUALS SIGN';
+insert into t1 set ujis=0x3E, name='U+003E GREATER-THAN SIGN';
+insert into t1 set ujis=0x3F, name='U+003F QUESTION MARK';
+insert into t1 set ujis=0x40, name='U+0040 COMMERCIAL AT';
+insert into t1 set ujis=0x41, name='U+0041 LATIN CAPITAL LETTER A';
+insert into t1 set ujis=0x42, name='U+0042 LATIN CAPITAL LETTER B';
+insert into t1 set ujis=0x43, name='U+0043 LATIN CAPITAL LETTER C';
+insert into t1 set ujis=0x44, name='U+0044 LATIN CAPITAL LETTER D';
+insert into t1 set ujis=0x45, name='U+0045 LATIN CAPITAL LETTER E';
+insert into t1 set ujis=0x46, name='U+0046 LATIN CAPITAL LETTER F';
+insert into t1 set ujis=0x47, name='U+0047 LATIN CAPITAL LETTER G';
+insert into t1 set ujis=0x48, name='U+0048 LATIN CAPITAL LETTER H';
+insert into t1 set ujis=0x49, name='U+0049 LATIN CAPITAL LETTER I';
+insert into t1 set ujis=0x4A, name='U+004A LATIN CAPITAL LETTER J';
+insert into t1 set ujis=0x4B, name='U+004B LATIN CAPITAL LETTER K';
+insert into t1 set ujis=0x4C, name='U+004C LATIN CAPITAL LETTER L';
+insert into t1 set ujis=0x4D, name='U+004D LATIN CAPITAL LETTER M';
+insert into t1 set ujis=0x4E, name='U+004E LATIN CAPITAL LETTER N';
+insert into t1 set ujis=0x4F, name='U+004F LATIN CAPITAL LETTER O';
+insert into t1 set ujis=0x50, name='U+0050 LATIN CAPITAL LETTER P';
+insert into t1 set ujis=0x51, name='U+0051 LATIN CAPITAL LETTER Q';
+insert into t1 set ujis=0x52, name='U+0052 LATIN CAPITAL LETTER R';
+insert into t1 set ujis=0x53, name='U+0053 LATIN CAPITAL LETTER S';
+insert into t1 set ujis=0x54, name='U+0054 LATIN CAPITAL LETTER T';
+insert into t1 set ujis=0x55, name='U+0055 LATIN CAPITAL LETTER U';
+insert into t1 set ujis=0x56, name='U+0056 LATIN CAPITAL LETTER V';
+insert into t1 set ujis=0x57, name='U+0057 LATIN CAPITAL LETTER W';
+insert into t1 set ujis=0x58, name='U+0058 LATIN CAPITAL LETTER X';
+insert into t1 set ujis=0x59, name='U+0059 LATIN CAPITAL LETTER Y';
+insert into t1 set ujis=0x5A, name='U+005A LATIN CAPITAL LETTER Z';
+insert into t1 set ujis=0x5B, name='U+005B LEFT SQUARE BRACKET';
+insert into t1 set ujis=0x5C, name='U+005C REVERSE SOLIDUS';
+insert into t1 set ujis=0x5D, name='U+005D RIGHT SQUARE BRACKET';
+insert into t1 set ujis=0x5E, name='U+005E CIRCUMFLEX ACCENT';
+insert into t1 set ujis=0x5F, name='U+005F LOW LINE';
+insert into t1 set ujis=0x60, name='U+0060 GRAVE ACCENT';
+insert into t1 set ujis=0x61, name='U+0061 LATIN SMALL LETTER A';
+insert into t1 set ujis=0x62, name='U+0062 LATIN SMALL LETTER B';
+insert into t1 set ujis=0x63, name='U+0063 LATIN SMALL LETTER C';
+insert into t1 set ujis=0x64, name='U+0064 LATIN SMALL LETTER D';
+insert into t1 set ujis=0x65, name='U+0065 LATIN SMALL LETTER E';
+insert into t1 set ujis=0x66, name='U+0066 LATIN SMALL LETTER F';
+insert into t1 set ujis=0x67, name='U+0067 LATIN SMALL LETTER G';
+insert into t1 set ujis=0x68, name='U+0068 LATIN SMALL LETTER H';
+insert into t1 set ujis=0x69, name='U+0069 LATIN SMALL LETTER I';
+insert into t1 set ujis=0x6A, name='U+006A LATIN SMALL LETTER J';
+insert into t1 set ujis=0x6B, name='U+006B LATIN SMALL LETTER K';
+insert into t1 set ujis=0x6C, name='U+006C LATIN SMALL LETTER L';
+insert into t1 set ujis=0x6D, name='U+006D LATIN SMALL LETTER M';
+insert into t1 set ujis=0x6E, name='U+006E LATIN SMALL LETTER N';
+insert into t1 set ujis=0x6F, name='U+006F LATIN SMALL LETTER O';
+insert into t1 set ujis=0x70, name='U+0070 LATIN SMALL LETTER P';
+insert into t1 set ujis=0x71, name='U+0071 LATIN SMALL LETTER Q';
+insert into t1 set ujis=0x72, name='U+0072 LATIN SMALL LETTER R';
+insert into t1 set ujis=0x73, name='U+0073 LATIN SMALL LETTER S';
+insert into t1 set ujis=0x74, name='U+0074 LATIN SMALL LETTER T';
+insert into t1 set ujis=0x75, name='U+0075 LATIN SMALL LETTER U';
+insert into t1 set ujis=0x76, name='U+0076 LATIN SMALL LETTER V';
+insert into t1 set ujis=0x77, name='U+0077 LATIN SMALL LETTER W';
+insert into t1 set ujis=0x78, name='U+0078 LATIN SMALL LETTER X';
+insert into t1 set ujis=0x79, name='U+0079 LATIN SMALL LETTER Y';
+insert into t1 set ujis=0x7A, name='U+007A LATIN SMALL LETTER Z';
+insert into t1 set ujis=0x7B, name='U+007B LEFT CURLY BRACKET';
+insert into t1 set ujis=0x7C, name='U+007C VERTICAL LINE';
+insert into t1 set ujis=0x7D, name='U+007D RIGHT CURLY BRACKET';
+insert into t1 set ujis=0x7E, name='U+007E TILDE';
+insert into t1 set ujis=0x7F, name='U+007F DELETE';
+insert into t1 (ujis) select concat(t21.code,t22.code) from t2 t21, t2 t22 order by 1;
+update t1 set name='U+3000 IDEOGRAPHIC SPACE' where ujis=0xA1A1;
+update t1 set name='U+3001 IDEOGRAPHIC COMMA' where ujis=0xA1A2;
+update t1 set name='U+3002 IDEOGRAPHIC FULL STOP' where ujis=0xA1A3;
+update t1 set name='U+FF0C FULLWIDTH COMMA' where ujis=0xA1A4;
+update t1 set name='U+FF0E FULLWIDTH FULL STOP' where ujis=0xA1A5;
+update t1 set name='U+30FB KATAKANA MIDDLE DOT' where ujis=0xA1A6;
+update t1 set name='U+FF1A FULLWIDTH COLON' where ujis=0xA1A7;
+update t1 set name='U+FF1B FULLWIDTH SEMICOLON' where ujis=0xA1A8;
+update t1 set name='U+FF1F FULLWIDTH QUESTION MARK' where ujis=0xA1A9;
+update t1 set name='U+FF01 FULLWIDTH EXCLAMATION MARK' where ujis=0xA1AA;
+update t1 set name='U+309B KATAKANA-HIRAGANA VOICED SOUND MARK' where ujis=0xA1AB;
+update t1 set name='U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK' where ujis=0xA1AC;
+update t1 set name='U+00B4 ACUTE ACCENT' where ujis=0xA1AD;
+update t1 set name='U+FF40 FULLWIDTH GRAVE ACCENT' where ujis=0xA1AE;
+update t1 set name='U+00A8 DIAERESIS' where ujis=0xA1AF;
+update t1 set name='U+FF3E FULLWIDTH CIRCUMFLEX ACCENT' where ujis=0xA1B0;
+update t1 set name='U+FFE3 FULLWIDTH MACRON' where ujis=0xA1B1;
+update t1 set name='U+FF3F FULLWIDTH LOW LINE' where ujis=0xA1B2;
+update t1 set name='U+30FD KATAKANA ITERATION MARK' where ujis=0xA1B3;
+update t1 set name='U+30FE KATAKANA VOICED ITERATION MARK' where ujis=0xA1B4;
+update t1 set name='U+309D HIRAGANA ITERATION MARK' where ujis=0xA1B5;
+update t1 set name='U+309E HIRAGANA VOICED ITERATION MARK' where ujis=0xA1B6;
+update t1 set name='U+3003 DITTO MARK' where ujis=0xA1B7;
+update t1 set name='U+4EDD <CJK>' where ujis=0xA1B8;
+update t1 set name='U+3005 IDEOGRAPHIC ITERATION MARK' where ujis=0xA1B9;
+update t1 set name='U+3006 IDEOGRAPHIC CLOSING MARK' where ujis=0xA1BA;
+update t1 set name='U+3007 IDEOGRAPHIC NUMBER ZERO' where ujis=0xA1BB;
+update t1 set name='U+30FC KATAKANA-HIRAGANA PROLONGED SOUND MARK' where ujis=0xA1BC;
+update t1 set name='U+2015 HORIZONTAL BAR' where ujis=0xA1BD;
+update t1 set name='U+2010 HYPHEN' where ujis=0xA1BE;
+update t1 set name='U+FF0F FULLWIDTH SOLIDUS' where ujis=0xA1BF;
+update t1 set name='U+005C REVERSE SOLIDUS' where ujis=0xA1C0;
+update t1 set name='U+301C WAVE DASH' where ujis=0xA1C1;
+update t1 set name='U+2016 DOUBLE VERTICAL LINE' where ujis=0xA1C2;
+update t1 set name='U+FF5C FULLWIDTH VERTICAL LINE' where ujis=0xA1C3;
+update t1 set name='U+2026 HORIZONTAL ELLIPSIS' where ujis=0xA1C4;
+update t1 set name='U+2025 TWO DOT LEADER' where ujis=0xA1C5;
+update t1 set name='U+2018 LEFT SINGLE QUOTATION MARK' where ujis=0xA1C6;
+update t1 set name='U+2019 RIGHT SINGLE QUOTATION MARK' where ujis=0xA1C7;
+update t1 set name='U+201C LEFT DOUBLE QUOTATION MARK' where ujis=0xA1C8;
+update t1 set name='U+201D RIGHT DOUBLE QUOTATION MARK' where ujis=0xA1C9;
+update t1 set name='U+FF08 FULLWIDTH LEFT PARENTHESIS' where ujis=0xA1CA;
+update t1 set name='U+FF09 FULLWIDTH RIGHT PARENTHESIS' where ujis=0xA1CB;
+update t1 set name='U+3014 LEFT TORTOISE SHELL BRACKET' where ujis=0xA1CC;
+update t1 set name='U+3015 RIGHT TORTOISE SHELL BRACKET' where ujis=0xA1CD;
+update t1 set name='U+FF3B FULLWIDTH LEFT SQUARE BRACKET' where ujis=0xA1CE;
+update t1 set name='U+FF3D FULLWIDTH RIGHT SQUARE BRACKET' where ujis=0xA1CF;
+update t1 set name='U+FF5B FULLWIDTH LEFT CURLY BRACKET' where ujis=0xA1D0;
+update t1 set name='U+FF5D FULLWIDTH RIGHT CURLY BRACKET' where ujis=0xA1D1;
+update t1 set name='U+3008 LEFT ANGLE BRACKET' where ujis=0xA1D2;
+update t1 set name='U+3009 RIGHT ANGLE BRACKET' where ujis=0xA1D3;
+update t1 set name='U+300A LEFT DOUBLE ANGLE BRACKET' where ujis=0xA1D4;
+update t1 set name='U+300B RIGHT DOUBLE ANGLE BRACKET' where ujis=0xA1D5;
+update t1 set name='U+300C LEFT CORNER BRACKET' where ujis=0xA1D6;
+update t1 set name='U+300D RIGHT CORNER BRACKET' where ujis=0xA1D7;
+update t1 set name='U+300E LEFT WHITE CORNER BRACKET' where ujis=0xA1D8;
+update t1 set name='U+300F RIGHT WHITE CORNER BRACKET' where ujis=0xA1D9;
+update t1 set name='U+3010 LEFT BLACK LENTICULAR BRACKET' where ujis=0xA1DA;
+update t1 set name='U+3011 RIGHT BLACK LENTICULAR BRACKET' where ujis=0xA1DB;
+update t1 set name='U+FF0B FULLWIDTH PLUS SIGN' where ujis=0xA1DC;
+update t1 set name='U+2212 MINUS SIGN' where ujis=0xA1DD;
+update t1 set name='U+00B1 PLUS-MINUS SIGN' where ujis=0xA1DE;
+update t1 set name='U+00D7 MULTIPLICATION SIGN' where ujis=0xA1DF;
+update t1 set name='U+00F7 DIVISION SIGN' where ujis=0xA1E0;
+update t1 set name='U+FF1D FULLWIDTH EQUALS SIGN' where ujis=0xA1E1;
+update t1 set name='U+2260 NOT EQUAL TO' where ujis=0xA1E2;
+update t1 set name='U+FF1C FULLWIDTH LESS-THAN SIGN' where ujis=0xA1E3;
+update t1 set name='U+FF1E FULLWIDTH GREATER-THAN SIGN' where ujis=0xA1E4;
+update t1 set name='U+2266 LESS-THAN OVER EQUAL TO' where ujis=0xA1E5;
+update t1 set name='U+2267 GREATER-THAN OVER EQUAL TO' where ujis=0xA1E6;
+update t1 set name='U+221E INFINITY' where ujis=0xA1E7;
+update t1 set name='U+2234 THEREFORE' where ujis=0xA1E8;
+update t1 set name='U+2642 MALE SIGN' where ujis=0xA1E9;
+update t1 set name='U+2640 FEMALE SIGN' where ujis=0xA1EA;
+update t1 set name='U+00B0 DEGREE SIGN' where ujis=0xA1EB;
+update t1 set name='U+2032 PRIME' where ujis=0xA1EC;
+update t1 set name='U+2033 DOUBLE PRIME' where ujis=0xA1ED;
+update t1 set name='U+2103 DEGREE CELSIUS' where ujis=0xA1EE;
+update t1 set name='U+FFE5 FULLWIDTH YEN SIGN' where ujis=0xA1EF;
+update t1 set name='U+FF04 FULLWIDTH DOLLAR SIGN' where ujis=0xA1F0;
+update t1 set name='U+00A2 CENT SIGN' where ujis=0xA1F1;
+update t1 set name='U+00A3 POUND SIGN' where ujis=0xA1F2;
+update t1 set name='U+FF05 FULLWIDTH PERCENT SIGN' where ujis=0xA1F3;
+update t1 set name='U+FF03 FULLWIDTH NUMBER SIGN' where ujis=0xA1F4;
+update t1 set name='U+FF06 FULLWIDTH AMPERSAND' where ujis=0xA1F5;
+update t1 set name='U+FF0A FULLWIDTH ASTERISK' where ujis=0xA1F6;
+update t1 set name='U+FF20 FULLWIDTH COMMERCIAL AT' where ujis=0xA1F7;
+update t1 set name='U+00A7 SECTION SIGN' where ujis=0xA1F8;
+update t1 set name='U+2606 WHITE STAR' where ujis=0xA1F9;
+update t1 set name='U+2605 BLACK STAR' where ujis=0xA1FA;
+update t1 set name='U+25CB WHITE CIRCLE' where ujis=0xA1FB;
+update t1 set name='U+25CF BLACK CIRCLE' where ujis=0xA1FC;
+update t1 set name='U+25CE BULLSEYE' where ujis=0xA1FD;
+update t1 set name='U+25C7 WHITE DIAMOND' where ujis=0xA1FE;
+update t1 set name='U+25C6 BLACK DIAMOND' where ujis=0xA2A1;
+update t1 set name='U+25A1 WHITE SQUARE' where ujis=0xA2A2;
+update t1 set name='U+25A0 BLACK SQUARE' where ujis=0xA2A3;
+update t1 set name='U+25B3 WHITE UP-POINTING TRIANGLE' where ujis=0xA2A4;
+update t1 set name='U+25B2 BLACK UP-POINTING TRIANGLE' where ujis=0xA2A5;
+update t1 set name='U+25BD WHITE DOWN-POINTING TRIANGLE' where ujis=0xA2A6;
+update t1 set name='U+25BC BLACK DOWN-POINTING TRIANGLE' where ujis=0xA2A7;
+update t1 set name='U+203B REFERENCE MARK' where ujis=0xA2A8;
+update t1 set name='U+3012 POSTAL MARK' where ujis=0xA2A9;
+update t1 set name='U+2192 RIGHTWARDS ARROW' where ujis=0xA2AA;
+update t1 set name='U+2190 LEFTWARDS ARROW' where ujis=0xA2AB;
+update t1 set name='U+2191 UPWARDS ARROW' where ujis=0xA2AC;
+update t1 set name='U+2193 DOWNWARDS ARROW' where ujis=0xA2AD;
+update t1 set name='U+3013 GETA MARK' where ujis=0xA2AE;
+update t1 set name='U+2208 ELEMENT OF' where ujis=0xA2BA;
+update t1 set name='U+220B CONTAINS AS MEMBER' where ujis=0xA2BB;
+update t1 set name='U+2286 SUBset OF OR EQUAL TO' where ujis=0xA2BC;
+update t1 set name='U+2287 SUPERset OF OR EQUAL TO' where ujis=0xA2BD;
+update t1 set name='U+2282 SUBset OF' where ujis=0xA2BE;
+update t1 set name='U+2283 SUPERset OF' where ujis=0xA2BF;
+update t1 set name='U+222A UNION' where ujis=0xA2C0;
+update t1 set name='U+2229 INTERSECTION' where ujis=0xA2C1;
+update t1 set name='U+2227 LOGICAL AND' where ujis=0xA2CA;
+update t1 set name='U+2228 LOGICAL OR' where ujis=0xA2CB;
+update t1 set name='U+00AC NOT SIGN' where ujis=0xA2CC;
+update t1 set name='U+21D2 RIGHTWARDS DOUBLE ARROW' where ujis=0xA2CD;
+update t1 set name='U+21D4 LEFT RIGHT DOUBLE ARROW' where ujis=0xA2CE;
+update t1 set name='U+2200 FOR ALL' where ujis=0xA2CF;
+update t1 set name='U+2203 THERE EXISTS' where ujis=0xA2D0;
+update t1 set name='U+2220 ANGLE' where ujis=0xA2DC;
+update t1 set name='U+22A5 UP TACK' where ujis=0xA2DD;
+update t1 set name='U+2312 ARC' where ujis=0xA2DE;
+update t1 set name='U+2202 PARTIAL DIFFERENTIAL' where ujis=0xA2DF;
+update t1 set name='U+2207 NABLA' where ujis=0xA2E0;
+update t1 set name='U+2261 IDENTICAL TO' where ujis=0xA2E1;
+update t1 set name='U+2252 APPROXIMATELY EQUAL TO OR THE IMAGE OF' where ujis=0xA2E2;
+update t1 set name='U+226A MUCH LESS-THAN' where ujis=0xA2E3;
+update t1 set name='U+226B MUCH GREATER-THAN' where ujis=0xA2E4;
+update t1 set name='U+221A SQUARE ROOT' where ujis=0xA2E5;
+update t1 set name='U+223D REVERSED TILDE' where ujis=0xA2E6;
+update t1 set name='U+221D PROPORTIONAL TO' where ujis=0xA2E7;
+update t1 set name='U+2235 BECAUSE' where ujis=0xA2E8;
+update t1 set name='U+222B INTEGRAL' where ujis=0xA2E9;
+update t1 set name='U+222C DOUBLE INTEGRAL' where ujis=0xA2EA;
+update t1 set name='U+212B ANGSTROM SIGN' where ujis=0xA2F2;
+update t1 set name='U+2030 PER MILLE SIGN' where ujis=0xA2F3;
+update t1 set name='U+266F MUSIC SHARP SIGN' where ujis=0xA2F4;
+update t1 set name='U+266D MUSIC FLAT SIGN' where ujis=0xA2F5;
+update t1 set name='U+266A EIGHTH NOTE' where ujis=0xA2F6;
+update t1 set name='U+2020 DAGGER' where ujis=0xA2F7;
+update t1 set name='U+2021 DOUBLE DAGGER' where ujis=0xA2F8;
+update t1 set name='U+00B6 PILCROW SIGN' where ujis=0xA2F9;
+update t1 set name='U+25EF LARGE CIRCLE' where ujis=0xA2FE;
+update t1 set name='U+FF10 FULLWIDTH DIGIT ZERO' where ujis=0xA3B0;
+update t1 set name='U+FF11 FULLWIDTH DIGIT ONE' where ujis=0xA3B1;
+update t1 set name='U+FF12 FULLWIDTH DIGIT TWO' where ujis=0xA3B2;
+update t1 set name='U+FF13 FULLWIDTH DIGIT THREE' where ujis=0xA3B3;
+update t1 set name='U+FF14 FULLWIDTH DIGIT FOUR' where ujis=0xA3B4;
+update t1 set name='U+FF15 FULLWIDTH DIGIT FIVE' where ujis=0xA3B5;
+update t1 set name='U+FF16 FULLWIDTH DIGIT SIX' where ujis=0xA3B6;
+update t1 set name='U+FF17 FULLWIDTH DIGIT SEVEN' where ujis=0xA3B7;
+update t1 set name='U+FF18 FULLWIDTH DIGIT EIGHT' where ujis=0xA3B8;
+update t1 set name='U+FF19 FULLWIDTH DIGIT NINE' where ujis=0xA3B9;
+update t1 set name='U+FF21 FULLWIDTH LATIN CAPITAL LETTER A' where ujis=0xA3C1;
+update t1 set name='U+FF22 FULLWIDTH LATIN CAPITAL LETTER B' where ujis=0xA3C2;
+update t1 set name='U+FF23 FULLWIDTH LATIN CAPITAL LETTER C' where ujis=0xA3C3;
+update t1 set name='U+FF24 FULLWIDTH LATIN CAPITAL LETTER D' where ujis=0xA3C4;
+update t1 set name='U+FF25 FULLWIDTH LATIN CAPITAL LETTER E' where ujis=0xA3C5;
+update t1 set name='U+FF26 FULLWIDTH LATIN CAPITAL LETTER F' where ujis=0xA3C6;
+update t1 set name='U+FF27 FULLWIDTH LATIN CAPITAL LETTER G' where ujis=0xA3C7;
+update t1 set name='U+FF28 FULLWIDTH LATIN CAPITAL LETTER H' where ujis=0xA3C8;
+update t1 set name='U+FF29 FULLWIDTH LATIN CAPITAL LETTER I' where ujis=0xA3C9;
+update t1 set name='U+FF2A FULLWIDTH LATIN CAPITAL LETTER J' where ujis=0xA3CA;
+update t1 set name='U+FF2B FULLWIDTH LATIN CAPITAL LETTER K' where ujis=0xA3CB;
+update t1 set name='U+FF2C FULLWIDTH LATIN CAPITAL LETTER L' where ujis=0xA3CC;
+update t1 set name='U+FF2D FULLWIDTH LATIN CAPITAL LETTER M' where ujis=0xA3CD;
+update t1 set name='U+FF2E FULLWIDTH LATIN CAPITAL LETTER N' where ujis=0xA3CE;
+update t1 set name='U+FF2F FULLWIDTH LATIN CAPITAL LETTER O' where ujis=0xA3CF;
+update t1 set name='U+FF30 FULLWIDTH LATIN CAPITAL LETTER P' where ujis=0xA3D0;
+update t1 set name='U+FF31 FULLWIDTH LATIN CAPITAL LETTER Q' where ujis=0xA3D1;
+update t1 set name='U+FF32 FULLWIDTH LATIN CAPITAL LETTER R' where ujis=0xA3D2;
+update t1 set name='U+FF33 FULLWIDTH LATIN CAPITAL LETTER S' where ujis=0xA3D3;
+update t1 set name='U+FF34 FULLWIDTH LATIN CAPITAL LETTER T' where ujis=0xA3D4;
+update t1 set name='U+FF35 FULLWIDTH LATIN CAPITAL LETTER U' where ujis=0xA3D5;
+update t1 set name='U+FF36 FULLWIDTH LATIN CAPITAL LETTER V' where ujis=0xA3D6;
+update t1 set name='U+FF37 FULLWIDTH LATIN CAPITAL LETTER W' where ujis=0xA3D7;
+update t1 set name='U+FF38 FULLWIDTH LATIN CAPITAL LETTER X' where ujis=0xA3D8;
+update t1 set name='U+FF39 FULLWIDTH LATIN CAPITAL LETTER Y' where ujis=0xA3D9;
+update t1 set name='U+FF3A FULLWIDTH LATIN CAPITAL LETTER Z' where ujis=0xA3DA;
+update t1 set name='U+FF41 FULLWIDTH LATIN SMALL LETTER A' where ujis=0xA3E1;
+update t1 set name='U+FF42 FULLWIDTH LATIN SMALL LETTER B' where ujis=0xA3E2;
+update t1 set name='U+FF43 FULLWIDTH LATIN SMALL LETTER C' where ujis=0xA3E3;
+update t1 set name='U+FF44 FULLWIDTH LATIN SMALL LETTER D' where ujis=0xA3E4;
+update t1 set name='U+FF45 FULLWIDTH LATIN SMALL LETTER E' where ujis=0xA3E5;
+update t1 set name='U+FF46 FULLWIDTH LATIN SMALL LETTER F' where ujis=0xA3E6;
+update t1 set name='U+FF47 FULLWIDTH LATIN SMALL LETTER G' where ujis=0xA3E7;
+update t1 set name='U+FF48 FULLWIDTH LATIN SMALL LETTER H' where ujis=0xA3E8;
+update t1 set name='U+FF49 FULLWIDTH LATIN SMALL LETTER I' where ujis=0xA3E9;
+update t1 set name='U+FF4A FULLWIDTH LATIN SMALL LETTER J' where ujis=0xA3EA;
+update t1 set name='U+FF4B FULLWIDTH LATIN SMALL LETTER K' where ujis=0xA3EB;
+update t1 set name='U+FF4C FULLWIDTH LATIN SMALL LETTER L' where ujis=0xA3EC;
+update t1 set name='U+FF4D FULLWIDTH LATIN SMALL LETTER M' where ujis=0xA3ED;
+update t1 set name='U+FF4E FULLWIDTH LATIN SMALL LETTER N' where ujis=0xA3EE;
+update t1 set name='U+FF4F FULLWIDTH LATIN SMALL LETTER O' where ujis=0xA3EF;
+update t1 set name='U+FF50 FULLWIDTH LATIN SMALL LETTER P' where ujis=0xA3F0;
+update t1 set name='U+FF51 FULLWIDTH LATIN SMALL LETTER Q' where ujis=0xA3F1;
+update t1 set name='U+FF52 FULLWIDTH LATIN SMALL LETTER R' where ujis=0xA3F2;
+update t1 set name='U+FF53 FULLWIDTH LATIN SMALL LETTER S' where ujis=0xA3F3;
+update t1 set name='U+FF54 FULLWIDTH LATIN SMALL LETTER T' where ujis=0xA3F4;
+update t1 set name='U+FF55 FULLWIDTH LATIN SMALL LETTER U' where ujis=0xA3F5;
+update t1 set name='U+FF56 FULLWIDTH LATIN SMALL LETTER V' where ujis=0xA3F6;
+update t1 set name='U+FF57 FULLWIDTH LATIN SMALL LETTER W' where ujis=0xA3F7;
+update t1 set name='U+FF58 FULLWIDTH LATIN SMALL LETTER X' where ujis=0xA3F8;
+update t1 set name='U+FF59 FULLWIDTH LATIN SMALL LETTER Y' where ujis=0xA3F9;
+update t1 set name='U+FF5A FULLWIDTH LATIN SMALL LETTER Z' where ujis=0xA3FA;
+update t1 set name='U+3041 HIRAGANA LETTER SMALL A' where ujis=0xA4A1;
+update t1 set name='U+3042 HIRAGANA LETTER A' where ujis=0xA4A2;
+update t1 set name='U+3043 HIRAGANA LETTER SMALL I' where ujis=0xA4A3;
+update t1 set name='U+3044 HIRAGANA LETTER I' where ujis=0xA4A4;
+update t1 set name='U+3045 HIRAGANA LETTER SMALL U' where ujis=0xA4A5;
+update t1 set name='U+3046 HIRAGANA LETTER U' where ujis=0xA4A6;
+update t1 set name='U+3047 HIRAGANA LETTER SMALL E' where ujis=0xA4A7;
+update t1 set name='U+3048 HIRAGANA LETTER E' where ujis=0xA4A8;
+update t1 set name='U+3049 HIRAGANA LETTER SMALL O' where ujis=0xA4A9;
+update t1 set name='U+304A HIRAGANA LETTER O' where ujis=0xA4AA;
+update t1 set name='U+304B HIRAGANA LETTER KA' where ujis=0xA4AB;
+update t1 set name='U+304C HIRAGANA LETTER GA' where ujis=0xA4AC;
+update t1 set name='U+304D HIRAGANA LETTER KI' where ujis=0xA4AD;
+update t1 set name='U+304E HIRAGANA LETTER GI' where ujis=0xA4AE;
+update t1 set name='U+304F HIRAGANA LETTER KU' where ujis=0xA4AF;
+update t1 set name='U+3050 HIRAGANA LETTER GU' where ujis=0xA4B0;
+update t1 set name='U+3051 HIRAGANA LETTER KE' where ujis=0xA4B1;
+update t1 set name='U+3052 HIRAGANA LETTER GE' where ujis=0xA4B2;
+update t1 set name='U+3053 HIRAGANA LETTER KO' where ujis=0xA4B3;
+update t1 set name='U+3054 HIRAGANA LETTER GO' where ujis=0xA4B4;
+update t1 set name='U+3055 HIRAGANA LETTER SA' where ujis=0xA4B5;
+update t1 set name='U+3056 HIRAGANA LETTER ZA' where ujis=0xA4B6;
+update t1 set name='U+3057 HIRAGANA LETTER SI' where ujis=0xA4B7;
+update t1 set name='U+3058 HIRAGANA LETTER ZI' where ujis=0xA4B8;
+update t1 set name='U+3059 HIRAGANA LETTER SU' where ujis=0xA4B9;
+update t1 set name='U+305A HIRAGANA LETTER ZU' where ujis=0xA4BA;
+update t1 set name='U+305B HIRAGANA LETTER SE' where ujis=0xA4BB;
+update t1 set name='U+305C HIRAGANA LETTER ZE' where ujis=0xA4BC;
+update t1 set name='U+305D HIRAGANA LETTER SO' where ujis=0xA4BD;
+update t1 set name='U+305E HIRAGANA LETTER ZO' where ujis=0xA4BE;
+update t1 set name='U+305F HIRAGANA LETTER TA' where ujis=0xA4BF;
+update t1 set name='U+3060 HIRAGANA LETTER DA' where ujis=0xA4C0;
+update t1 set name='U+3061 HIRAGANA LETTER TI' where ujis=0xA4C1;
+update t1 set name='U+3062 HIRAGANA LETTER DI' where ujis=0xA4C2;
+update t1 set name='U+3063 HIRAGANA LETTER SMALL TU' where ujis=0xA4C3;
+update t1 set name='U+3064 HIRAGANA LETTER TU' where ujis=0xA4C4;
+update t1 set name='U+3065 HIRAGANA LETTER DU' where ujis=0xA4C5;
+update t1 set name='U+3066 HIRAGANA LETTER TE' where ujis=0xA4C6;
+update t1 set name='U+3067 HIRAGANA LETTER DE' where ujis=0xA4C7;
+update t1 set name='U+3068 HIRAGANA LETTER TO' where ujis=0xA4C8;
+update t1 set name='U+3069 HIRAGANA LETTER DO' where ujis=0xA4C9;
+update t1 set name='U+306A HIRAGANA LETTER NA' where ujis=0xA4CA;
+update t1 set name='U+306B HIRAGANA LETTER NI' where ujis=0xA4CB;
+update t1 set name='U+306C HIRAGANA LETTER NU' where ujis=0xA4CC;
+update t1 set name='U+306D HIRAGANA LETTER NE' where ujis=0xA4CD;
+update t1 set name='U+306E HIRAGANA LETTER NO' where ujis=0xA4CE;
+update t1 set name='U+306F HIRAGANA LETTER HA' where ujis=0xA4CF;
+update t1 set name='U+3070 HIRAGANA LETTER BA' where ujis=0xA4D0;
+update t1 set name='U+3071 HIRAGANA LETTER PA' where ujis=0xA4D1;
+update t1 set name='U+3072 HIRAGANA LETTER HI' where ujis=0xA4D2;
+update t1 set name='U+3073 HIRAGANA LETTER BI' where ujis=0xA4D3;
+update t1 set name='U+3074 HIRAGANA LETTER PI' where ujis=0xA4D4;
+update t1 set name='U+3075 HIRAGANA LETTER HU' where ujis=0xA4D5;
+update t1 set name='U+3076 HIRAGANA LETTER BU' where ujis=0xA4D6;
+update t1 set name='U+3077 HIRAGANA LETTER PU' where ujis=0xA4D7;
+update t1 set name='U+3078 HIRAGANA LETTER HE' where ujis=0xA4D8;
+update t1 set name='U+3079 HIRAGANA LETTER BE' where ujis=0xA4D9;
+update t1 set name='U+307A HIRAGANA LETTER PE' where ujis=0xA4DA;
+update t1 set name='U+307B HIRAGANA LETTER HO' where ujis=0xA4DB;
+update t1 set name='U+307C HIRAGANA LETTER BO' where ujis=0xA4DC;
+update t1 set name='U+307D HIRAGANA LETTER PO' where ujis=0xA4DD;
+update t1 set name='U+307E HIRAGANA LETTER MA' where ujis=0xA4DE;
+update t1 set name='U+307F HIRAGANA LETTER MI' where ujis=0xA4DF;
+update t1 set name='U+3080 HIRAGANA LETTER MU' where ujis=0xA4E0;
+update t1 set name='U+3081 HIRAGANA LETTER ME' where ujis=0xA4E1;
+update t1 set name='U+3082 HIRAGANA LETTER MO' where ujis=0xA4E2;
+update t1 set name='U+3083 HIRAGANA LETTER SMALL YA' where ujis=0xA4E3;
+update t1 set name='U+3084 HIRAGANA LETTER YA' where ujis=0xA4E4;
+update t1 set name='U+3085 HIRAGANA LETTER SMALL YU' where ujis=0xA4E5;
+update t1 set name='U+3086 HIRAGANA LETTER YU' where ujis=0xA4E6;
+update t1 set name='U+3087 HIRAGANA LETTER SMALL YO' where ujis=0xA4E7;
+update t1 set name='U+3088 HIRAGANA LETTER YO' where ujis=0xA4E8;
+update t1 set name='U+3089 HIRAGANA LETTER RA' where ujis=0xA4E9;
+update t1 set name='U+308A HIRAGANA LETTER RI' where ujis=0xA4EA;
+update t1 set name='U+308B HIRAGANA LETTER RU' where ujis=0xA4EB;
+update t1 set name='U+308C HIRAGANA LETTER RE' where ujis=0xA4EC;
+update t1 set name='U+308D HIRAGANA LETTER RO' where ujis=0xA4ED;
+update t1 set name='U+308E HIRAGANA LETTER SMALL WA' where ujis=0xA4EE;
+update t1 set name='U+308F HIRAGANA LETTER WA' where ujis=0xA4EF;
+update t1 set name='U+3090 HIRAGANA LETTER WI' where ujis=0xA4F0;
+update t1 set name='U+3091 HIRAGANA LETTER WE' where ujis=0xA4F1;
+update t1 set name='U+3092 HIRAGANA LETTER WO' where ujis=0xA4F2;
+update t1 set name='U+3093 HIRAGANA LETTER N' where ujis=0xA4F3;
+update t1 set name='U+30A1 KATAKANA LETTER SMALL A' where ujis=0xA5A1;
+update t1 set name='U+30A2 KATAKANA LETTER A' where ujis=0xA5A2;
+update t1 set name='U+30A3 KATAKANA LETTER SMALL I' where ujis=0xA5A3;
+update t1 set name='U+30A4 KATAKANA LETTER I' where ujis=0xA5A4;
+update t1 set name='U+30A5 KATAKANA LETTER SMALL U' where ujis=0xA5A5;
+update t1 set name='U+30A6 KATAKANA LETTER U' where ujis=0xA5A6;
+update t1 set name='U+30A7 KATAKANA LETTER SMALL E' where ujis=0xA5A7;
+update t1 set name='U+30A8 KATAKANA LETTER E' where ujis=0xA5A8;
+update t1 set name='U+30A9 KATAKANA LETTER SMALL O' where ujis=0xA5A9;
+update t1 set name='U+30AA KATAKANA LETTER O' where ujis=0xA5AA;
+update t1 set name='U+30AB KATAKANA LETTER KA' where ujis=0xA5AB;
+update t1 set name='U+30AC KATAKANA LETTER GA' where ujis=0xA5AC;
+update t1 set name='U+30AD KATAKANA LETTER KI' where ujis=0xA5AD;
+update t1 set name='U+30AE KATAKANA LETTER GI' where ujis=0xA5AE;
+update t1 set name='U+30AF KATAKANA LETTER KU' where ujis=0xA5AF;
+update t1 set name='U+30B0 KATAKANA LETTER GU' where ujis=0xA5B0;
+update t1 set name='U+30B1 KATAKANA LETTER KE' where ujis=0xA5B1;
+update t1 set name='U+30B2 KATAKANA LETTER GE' where ujis=0xA5B2;
+update t1 set name='U+30B3 KATAKANA LETTER KO' where ujis=0xA5B3;
+update t1 set name='U+30B4 KATAKANA LETTER GO' where ujis=0xA5B4;
+update t1 set name='U+30B5 KATAKANA LETTER SA' where ujis=0xA5B5;
+update t1 set name='U+30B6 KATAKANA LETTER ZA' where ujis=0xA5B6;
+update t1 set name='U+30B7 KATAKANA LETTER SI' where ujis=0xA5B7;
+update t1 set name='U+30B8 KATAKANA LETTER ZI' where ujis=0xA5B8;
+update t1 set name='U+30B9 KATAKANA LETTER SU' where ujis=0xA5B9;
+update t1 set name='U+30BA KATAKANA LETTER ZU' where ujis=0xA5BA;
+update t1 set name='U+30BB KATAKANA LETTER SE' where ujis=0xA5BB;
+update t1 set name='U+30BC KATAKANA LETTER ZE' where ujis=0xA5BC;
+update t1 set name='U+30BD KATAKANA LETTER SO' where ujis=0xA5BD;
+update t1 set name='U+30BE KATAKANA LETTER ZO' where ujis=0xA5BE;
+update t1 set name='U+30BF KATAKANA LETTER TA' where ujis=0xA5BF;
+update t1 set name='U+30C0 KATAKANA LETTER DA' where ujis=0xA5C0;
+update t1 set name='U+30C1 KATAKANA LETTER TI' where ujis=0xA5C1;
+update t1 set name='U+30C2 KATAKANA LETTER DI' where ujis=0xA5C2;
+update t1 set name='U+30C3 KATAKANA LETTER SMALL TU' where ujis=0xA5C3;
+update t1 set name='U+30C4 KATAKANA LETTER TU' where ujis=0xA5C4;
+update t1 set name='U+30C5 KATAKANA LETTER DU' where ujis=0xA5C5;
+update t1 set name='U+30C6 KATAKANA LETTER TE' where ujis=0xA5C6;
+update t1 set name='U+30C7 KATAKANA LETTER DE' where ujis=0xA5C7;
+update t1 set name='U+30C8 KATAKANA LETTER TO' where ujis=0xA5C8;
+update t1 set name='U+30C9 KATAKANA LETTER DO' where ujis=0xA5C9;
+update t1 set name='U+30CA KATAKANA LETTER NA' where ujis=0xA5CA;
+update t1 set name='U+30CB KATAKANA LETTER NI' where ujis=0xA5CB;
+update t1 set name='U+30CC KATAKANA LETTER NU' where ujis=0xA5CC;
+update t1 set name='U+30CD KATAKANA LETTER NE' where ujis=0xA5CD;
+update t1 set name='U+30CE KATAKANA LETTER NO' where ujis=0xA5CE;
+update t1 set name='U+30CF KATAKANA LETTER HA' where ujis=0xA5CF;
+update t1 set name='U+30D0 KATAKANA LETTER BA' where ujis=0xA5D0;
+update t1 set name='U+30D1 KATAKANA LETTER PA' where ujis=0xA5D1;
+update t1 set name='U+30D2 KATAKANA LETTER HI' where ujis=0xA5D2;
+update t1 set name='U+30D3 KATAKANA LETTER BI' where ujis=0xA5D3;
+update t1 set name='U+30D4 KATAKANA LETTER PI' where ujis=0xA5D4;
+update t1 set name='U+30D5 KATAKANA LETTER HU' where ujis=0xA5D5;
+update t1 set name='U+30D6 KATAKANA LETTER BU' where ujis=0xA5D6;
+update t1 set name='U+30D7 KATAKANA LETTER PU' where ujis=0xA5D7;
+update t1 set name='U+30D8 KATAKANA LETTER HE' where ujis=0xA5D8;
+update t1 set name='U+30D9 KATAKANA LETTER BE' where ujis=0xA5D9;
+update t1 set name='U+30DA KATAKANA LETTER PE' where ujis=0xA5DA;
+update t1 set name='U+30DB KATAKANA LETTER HO' where ujis=0xA5DB;
+update t1 set name='U+30DC KATAKANA LETTER BO' where ujis=0xA5DC;
+update t1 set name='U+30DD KATAKANA LETTER PO' where ujis=0xA5DD;
+update t1 set name='U+30DE KATAKANA LETTER MA' where ujis=0xA5DE;
+update t1 set name='U+30DF KATAKANA LETTER MI' where ujis=0xA5DF;
+update t1 set name='U+30E0 KATAKANA LETTER MU' where ujis=0xA5E0;
+update t1 set name='U+30E1 KATAKANA LETTER ME' where ujis=0xA5E1;
+update t1 set name='U+30E2 KATAKANA LETTER MO' where ujis=0xA5E2;
+update t1 set name='U+30E3 KATAKANA LETTER SMALL YA' where ujis=0xA5E3;
+update t1 set name='U+30E4 KATAKANA LETTER YA' where ujis=0xA5E4;
+update t1 set name='U+30E5 KATAKANA LETTER SMALL YU' where ujis=0xA5E5;
+update t1 set name='U+30E6 KATAKANA LETTER YU' where ujis=0xA5E6;
+update t1 set name='U+30E7 KATAKANA LETTER SMALL YO' where ujis=0xA5E7;
+update t1 set name='U+30E8 KATAKANA LETTER YO' where ujis=0xA5E8;
+update t1 set name='U+30E9 KATAKANA LETTER RA' where ujis=0xA5E9;
+update t1 set name='U+30EA KATAKANA LETTER RI' where ujis=0xA5EA;
+update t1 set name='U+30EB KATAKANA LETTER RU' where ujis=0xA5EB;
+update t1 set name='U+30EC KATAKANA LETTER RE' where ujis=0xA5EC;
+update t1 set name='U+30ED KATAKANA LETTER RO' where ujis=0xA5ED;
+update t1 set name='U+30EE KATAKANA LETTER SMALL WA' where ujis=0xA5EE;
+update t1 set name='U+30EF KATAKANA LETTER WA' where ujis=0xA5EF;
+update t1 set name='U+30F0 KATAKANA LETTER WI' where ujis=0xA5F0;
+update t1 set name='U+30F1 KATAKANA LETTER WE' where ujis=0xA5F1;
+update t1 set name='U+30F2 KATAKANA LETTER WO' where ujis=0xA5F2;
+update t1 set name='U+30F3 KATAKANA LETTER N' where ujis=0xA5F3;
+update t1 set name='U+30F4 KATAKANA LETTER VU' where ujis=0xA5F4;
+update t1 set name='U+30F5 KATAKANA LETTER SMALL KA' where ujis=0xA5F5;
+update t1 set name='U+30F6 KATAKANA LETTER SMALL KE' where ujis=0xA5F6;
+update t1 set name='U+0391 GREEK CAPITAL LETTER ALPHA' where ujis=0xA6A1;
+update t1 set name='U+0392 GREEK CAPITAL LETTER BETA' where ujis=0xA6A2;
+update t1 set name='U+0393 GREEK CAPITAL LETTER GAMMA' where ujis=0xA6A3;
+update t1 set name='U+0394 GREEK CAPITAL LETTER DELTA' where ujis=0xA6A4;
+update t1 set name='U+0395 GREEK CAPITAL LETTER EPSILON' where ujis=0xA6A5;
+update t1 set name='U+0396 GREEK CAPITAL LETTER ZETA' where ujis=0xA6A6;
+update t1 set name='U+0397 GREEK CAPITAL LETTER ETA' where ujis=0xA6A7;
+update t1 set name='U+0398 GREEK CAPITAL LETTER THETA' where ujis=0xA6A8;
+update t1 set name='U+0399 GREEK CAPITAL LETTER IOTA' where ujis=0xA6A9;
+update t1 set name='U+039A GREEK CAPITAL LETTER KAPPA' where ujis=0xA6AA;
+update t1 set name='U+039B GREEK CAPITAL LETTER LAMDA' where ujis=0xA6AB;
+update t1 set name='U+039C GREEK CAPITAL LETTER MU' where ujis=0xA6AC;
+update t1 set name='U+039D GREEK CAPITAL LETTER NU' where ujis=0xA6AD;
+update t1 set name='U+039E GREEK CAPITAL LETTER XI' where ujis=0xA6AE;
+update t1 set name='U+039F GREEK CAPITAL LETTER OMICRON' where ujis=0xA6AF;
+update t1 set name='U+03A0 GREEK CAPITAL LETTER PI' where ujis=0xA6B0;
+update t1 set name='U+03A1 GREEK CAPITAL LETTER RHO' where ujis=0xA6B1;
+update t1 set name='U+03A3 GREEK CAPITAL LETTER SIGMA' where ujis=0xA6B2;
+update t1 set name='U+03A4 GREEK CAPITAL LETTER TAU' where ujis=0xA6B3;
+update t1 set name='U+03A5 GREEK CAPITAL LETTER UPSILON' where ujis=0xA6B4;
+update t1 set name='U+03A6 GREEK CAPITAL LETTER PHI' where ujis=0xA6B5;
+update t1 set name='U+03A7 GREEK CAPITAL LETTER CHI' where ujis=0xA6B6;
+update t1 set name='U+03A8 GREEK CAPITAL LETTER PSI' where ujis=0xA6B7;
+update t1 set name='U+03A9 GREEK CAPITAL LETTER OMEGA' where ujis=0xA6B8;
+update t1 set name='U+03B1 GREEK SMALL LETTER ALPHA' where ujis=0xA6C1;
+update t1 set name='U+03B2 GREEK SMALL LETTER BETA' where ujis=0xA6C2;
+update t1 set name='U+03B3 GREEK SMALL LETTER GAMMA' where ujis=0xA6C3;
+update t1 set name='U+03B4 GREEK SMALL LETTER DELTA' where ujis=0xA6C4;
+update t1 set name='U+03B5 GREEK SMALL LETTER EPSILON' where ujis=0xA6C5;
+update t1 set name='U+03B6 GREEK SMALL LETTER ZETA' where ujis=0xA6C6;
+update t1 set name='U+03B7 GREEK SMALL LETTER ETA' where ujis=0xA6C7;
+update t1 set name='U+03B8 GREEK SMALL LETTER THETA' where ujis=0xA6C8;
+update t1 set name='U+03B9 GREEK SMALL LETTER IOTA' where ujis=0xA6C9;
+update t1 set name='U+03BA GREEK SMALL LETTER KAPPA' where ujis=0xA6CA;
+update t1 set name='U+03BB GREEK SMALL LETTER LAMDA' where ujis=0xA6CB;
+update t1 set name='U+03BC GREEK SMALL LETTER MU' where ujis=0xA6CC;
+update t1 set name='U+03BD GREEK SMALL LETTER NU' where ujis=0xA6CD;
+update t1 set name='U+03BE GREEK SMALL LETTER XI' where ujis=0xA6CE;
+update t1 set name='U+03BF GREEK SMALL LETTER OMICRON' where ujis=0xA6CF;
+update t1 set name='U+03C0 GREEK SMALL LETTER PI' where ujis=0xA6D0;
+update t1 set name='U+03C1 GREEK SMALL LETTER RHO' where ujis=0xA6D1;
+update t1 set name='U+03C3 GREEK SMALL LETTER SIGMA' where ujis=0xA6D2;
+update t1 set name='U+03C4 GREEK SMALL LETTER TAU' where ujis=0xA6D3;
+update t1 set name='U+03C5 GREEK SMALL LETTER UPSILON' where ujis=0xA6D4;
+update t1 set name='U+03C6 GREEK SMALL LETTER PHI' where ujis=0xA6D5;
+update t1 set name='U+03C7 GREEK SMALL LETTER CHI' where ujis=0xA6D6;
+update t1 set name='U+03C8 GREEK SMALL LETTER PSI' where ujis=0xA6D7;
+update t1 set name='U+03C9 GREEK SMALL LETTER OMEGA' where ujis=0xA6D8;
+update t1 set name='U+0410 CYRILLIC CAPITAL LETTER A' where ujis=0xA7A1;
+update t1 set name='U+0411 CYRILLIC CAPITAL LETTER BE' where ujis=0xA7A2;
+update t1 set name='U+0412 CYRILLIC CAPITAL LETTER VE' where ujis=0xA7A3;
+update t1 set name='U+0413 CYRILLIC CAPITAL LETTER GHE' where ujis=0xA7A4;
+update t1 set name='U+0414 CYRILLIC CAPITAL LETTER DE' where ujis=0xA7A5;
+update t1 set name='U+0415 CYRILLIC CAPITAL LETTER IE' where ujis=0xA7A6;
+update t1 set name='U+0401 CYRILLIC CAPITAL LETTER IO' where ujis=0xA7A7;
+update t1 set name='U+0416 CYRILLIC CAPITAL LETTER ZHE' where ujis=0xA7A8;
+update t1 set name='U+0417 CYRILLIC CAPITAL LETTER ZE' where ujis=0xA7A9;
+update t1 set name='U+0418 CYRILLIC CAPITAL LETTER I' where ujis=0xA7AA;
+update t1 set name='U+0419 CYRILLIC CAPITAL LETTER SHORT I' where ujis=0xA7AB;
+update t1 set name='U+041A CYRILLIC CAPITAL LETTER KA' where ujis=0xA7AC;
+update t1 set name='U+041B CYRILLIC CAPITAL LETTER EL' where ujis=0xA7AD;
+update t1 set name='U+041C CYRILLIC CAPITAL LETTER EM' where ujis=0xA7AE;
+update t1 set name='U+041D CYRILLIC CAPITAL LETTER EN' where ujis=0xA7AF;
+update t1 set name='U+041E CYRILLIC CAPITAL LETTER O' where ujis=0xA7B0;
+update t1 set name='U+041F CYRILLIC CAPITAL LETTER PE' where ujis=0xA7B1;
+update t1 set name='U+0420 CYRILLIC CAPITAL LETTER ER' where ujis=0xA7B2;
+update t1 set name='U+0421 CYRILLIC CAPITAL LETTER ES' where ujis=0xA7B3;
+update t1 set name='U+0422 CYRILLIC CAPITAL LETTER TE' where ujis=0xA7B4;
+update t1 set name='U+0423 CYRILLIC CAPITAL LETTER U' where ujis=0xA7B5;
+update t1 set name='U+0424 CYRILLIC CAPITAL LETTER EF' where ujis=0xA7B6;
+update t1 set name='U+0425 CYRILLIC CAPITAL LETTER HA' where ujis=0xA7B7;
+update t1 set name='U+0426 CYRILLIC CAPITAL LETTER TSE' where ujis=0xA7B8;
+update t1 set name='U+0427 CYRILLIC CAPITAL LETTER CHE' where ujis=0xA7B9;
+update t1 set name='U+0428 CYRILLIC CAPITAL LETTER SHA' where ujis=0xA7BA;
+update t1 set name='U+0429 CYRILLIC CAPITAL LETTER SHCHA' where ujis=0xA7BB;
+update t1 set name='U+042A CYRILLIC CAPITAL LETTER HARD SIGN' where ujis=0xA7BC;
+update t1 set name='U+042B CYRILLIC CAPITAL LETTER YERU' where ujis=0xA7BD;
+update t1 set name='U+042C CYRILLIC CAPITAL LETTER SOFT SIGN' where ujis=0xA7BE;
+update t1 set name='U+042D CYRILLIC CAPITAL LETTER E' where ujis=0xA7BF;
+update t1 set name='U+042E CYRILLIC CAPITAL LETTER YU' where ujis=0xA7C0;
+update t1 set name='U+042F CYRILLIC CAPITAL LETTER YA' where ujis=0xA7C1;
+update t1 set name='U+0430 CYRILLIC SMALL LETTER A' where ujis=0xA7D1;
+update t1 set name='U+0431 CYRILLIC SMALL LETTER BE' where ujis=0xA7D2;
+update t1 set name='U+0432 CYRILLIC SMALL LETTER VE' where ujis=0xA7D3;
+update t1 set name='U+0433 CYRILLIC SMALL LETTER GHE' where ujis=0xA7D4;
+update t1 set name='U+0434 CYRILLIC SMALL LETTER DE' where ujis=0xA7D5;
+update t1 set name='U+0435 CYRILLIC SMALL LETTER IE' where ujis=0xA7D6;
+update t1 set name='U+0451 CYRILLIC SMALL LETTER IO' where ujis=0xA7D7;
+update t1 set name='U+0436 CYRILLIC SMALL LETTER ZHE' where ujis=0xA7D8;
+update t1 set name='U+0437 CYRILLIC SMALL LETTER ZE' where ujis=0xA7D9;
+update t1 set name='U+0438 CYRILLIC SMALL LETTER I' where ujis=0xA7DA;
+update t1 set name='U+0439 CYRILLIC SMALL LETTER SHORT I' where ujis=0xA7DB;
+update t1 set name='U+043A CYRILLIC SMALL LETTER KA' where ujis=0xA7DC;
+update t1 set name='U+043B CYRILLIC SMALL LETTER EL' where ujis=0xA7DD;
+update t1 set name='U+043C CYRILLIC SMALL LETTER EM' where ujis=0xA7DE;
+update t1 set name='U+043D CYRILLIC SMALL LETTER EN' where ujis=0xA7DF;
+update t1 set name='U+043E CYRILLIC SMALL LETTER O' where ujis=0xA7E0;
+update t1 set name='U+043F CYRILLIC SMALL LETTER PE' where ujis=0xA7E1;
+update t1 set name='U+0440 CYRILLIC SMALL LETTER ER' where ujis=0xA7E2;
+update t1 set name='U+0441 CYRILLIC SMALL LETTER ES' where ujis=0xA7E3;
+update t1 set name='U+0442 CYRILLIC SMALL LETTER TE' where ujis=0xA7E4;
+update t1 set name='U+0443 CYRILLIC SMALL LETTER U' where ujis=0xA7E5;
+update t1 set name='U+0444 CYRILLIC SMALL LETTER EF' where ujis=0xA7E6;
+update t1 set name='U+0445 CYRILLIC SMALL LETTER HA' where ujis=0xA7E7;
+update t1 set name='U+0446 CYRILLIC SMALL LETTER TSE' where ujis=0xA7E8;
+update t1 set name='U+0447 CYRILLIC SMALL LETTER CHE' where ujis=0xA7E9;
+update t1 set name='U+0448 CYRILLIC SMALL LETTER SHA' where ujis=0xA7EA;
+update t1 set name='U+0449 CYRILLIC SMALL LETTER SHCHA' where ujis=0xA7EB;
+update t1 set name='U+044A CYRILLIC SMALL LETTER HARD SIGN' where ujis=0xA7EC;
+update t1 set name='U+044B CYRILLIC SMALL LETTER YERU' where ujis=0xA7ED;
+update t1 set name='U+044C CYRILLIC SMALL LETTER SOFT SIGN' where ujis=0xA7EE;
+update t1 set name='U+044D CYRILLIC SMALL LETTER E' where ujis=0xA7EF;
+update t1 set name='U+044E CYRILLIC SMALL LETTER YU' where ujis=0xA7F0;
+update t1 set name='U+044F CYRILLIC SMALL LETTER YA' where ujis=0xA7F1;
+update t1 set name='U+2500 BOX DRAWINGS LIGHT HORIZONTAL' where ujis=0xA8A1;
+update t1 set name='U+2502 BOX DRAWINGS LIGHT VERTICAL' where ujis=0xA8A2;
+update t1 set name='U+250C BOX DRAWINGS LIGHT DOWN AND RIGHT' where ujis=0xA8A3;
+update t1 set name='U+2510 BOX DRAWINGS LIGHT DOWN AND LEFT' where ujis=0xA8A4;
+update t1 set name='U+2518 BOX DRAWINGS LIGHT UP AND LEFT' where ujis=0xA8A5;
+update t1 set name='U+2514 BOX DRAWINGS LIGHT UP AND RIGHT' where ujis=0xA8A6;
+update t1 set name='U+251C BOX DRAWINGS LIGHT VERTICAL AND RIGHT' where ujis=0xA8A7;
+update t1 set name='U+252C BOX DRAWINGS LIGHT DOWN AND HORIZONTAL' where ujis=0xA8A8;
+update t1 set name='U+2524 BOX DRAWINGS LIGHT VERTICAL AND LEFT' where ujis=0xA8A9;
+update t1 set name='U+2534 BOX DRAWINGS LIGHT UP AND HORIZONTAL' where ujis=0xA8AA;
+update t1 set name='U+253C BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL' where ujis=0xA8AB;
+update t1 set name='U+2501 BOX DRAWINGS HEAVY HORIZONTAL' where ujis=0xA8AC;
+update t1 set name='U+2503 BOX DRAWINGS HEAVY VERTICAL' where ujis=0xA8AD;
+update t1 set name='U+250F BOX DRAWINGS HEAVY DOWN AND RIGHT' where ujis=0xA8AE;
+update t1 set name='U+2513 BOX DRAWINGS HEAVY DOWN AND LEFT' where ujis=0xA8AF;
+update t1 set name='U+251B BOX DRAWINGS HEAVY UP AND LEFT' where ujis=0xA8B0;
+update t1 set name='U+2517 BOX DRAWINGS HEAVY UP AND RIGHT' where ujis=0xA8B1;
+update t1 set name='U+2523 BOX DRAWINGS HEAVY VERTICAL AND RIGHT' where ujis=0xA8B2;
+update t1 set name='U+2533 BOX DRAWINGS HEAVY DOWN AND HORIZONTAL' where ujis=0xA8B3;
+update t1 set name='U+252B BOX DRAWINGS HEAVY VERTICAL AND LEFT' where ujis=0xA8B4;
+update t1 set name='U+253B BOX DRAWINGS HEAVY UP AND HORIZONTAL' where ujis=0xA8B5;
+update t1 set name='U+254B BOX DRAWINGS HEAVY VERTICAL AND HORIZONTAL' where ujis=0xA8B6;
+update t1 set name='U+2520 BOX DRAWINGS VERTICAL HEAVY AND RIGHT LIGHT' where ujis=0xA8B7;
+update t1 set name='U+252F BOX DRAWINGS DOWN LIGHT AND HORIZONTAL HEAVY' where ujis=0xA8B8;
+update t1 set name='U+2528 BOX DRAWINGS VERTICAL HEAVY AND LEFT LIGHT' where ujis=0xA8B9;
+update t1 set name='U+2537 BOX DRAWINGS UP LIGHT AND HORIZONTAL HEAVY' where ujis=0xA8BA;
+update t1 set name='U+253F BOX DRAWINGS VERTICAL LIGHT AND HORIZONTAL HEAVY' where ujis=0xA8BB;
+update t1 set name='U+251D BOX DRAWINGS VERTICAL LIGHT AND RIGHT HEAVY' where ujis=0xA8BC;
+update t1 set name='U+2530 BOX DRAWINGS DOWN HEAVY AND HORIZONTAL LIGHT' where ujis=0xA8BD;
+update t1 set name='U+2525 BOX DRAWINGS VERTICAL LIGHT AND LEFT HEAVY' where ujis=0xA8BE;
+update t1 set name='U+2538 BOX DRAWINGS UP HEAVY AND HORIZONTAL LIGHT' where ujis=0xA8BF;
+update t1 set name='U+2542 BOX DRAWINGS VERTICAL HEAVY AND HORIZONTAL LIGHT' where ujis=0xA8C0;
+update t1 set name='<CJK>' where ujis >= 0xB0A1 AND ujis <= 0xBFFE;
+update t1 set name='<CJK>' where ujis >= 0xC0A1 AND ujis <= 0xCEFE;
+update t1 set name='U+84EE <CJK>' where ujis=0xCFA1;
+update t1 set name='U+9023 <CJK>' where ujis=0xCFA2;
+update t1 set name='U+932C <CJK>' where ujis=0xCFA3;
+update t1 set name='U+5442 <CJK>' where ujis=0xCFA4;
+update t1 set name='U+9B6F <CJK>' where ujis=0xCFA5;
+update t1 set name='U+6AD3 <CJK>' where ujis=0xCFA6;
+update t1 set name='U+7089 <CJK>' where ujis=0xCFA7;
+update t1 set name='U+8CC2 <CJK>' where ujis=0xCFA8;
+update t1 set name='U+8DEF <CJK>' where ujis=0xCFA9;
+update t1 set name='U+9732 <CJK>' where ujis=0xCFAA;
+update t1 set name='U+52B4 <CJK>' where ujis=0xCFAB;
+update t1 set name='U+5A41 <CJK>' where ujis=0xCFAC;
+update t1 set name='U+5ECA <CJK>' where ujis=0xCFAD;
+update t1 set name='U+5F04 <CJK>' where ujis=0xCFAE;
+update t1 set name='U+6717 <CJK>' where ujis=0xCFAF;
+update t1 set name='U+697C <CJK>' where ujis=0xCFB0;
+update t1 set name='U+6994 <CJK>' where ujis=0xCFB1;
+update t1 set name='U+6D6A <CJK>' where ujis=0xCFB2;
+update t1 set name='U+6F0F <CJK>' where ujis=0xCFB3;
+update t1 set name='U+7262 <CJK>' where ujis=0xCFB4;
+update t1 set name='U+72FC <CJK>' where ujis=0xCFB5;
+update t1 set name='U+7BED <CJK>' where ujis=0xCFB6;
+update t1 set name='U+8001 <CJK>' where ujis=0xCFB7;
+update t1 set name='U+807E <CJK>' where ujis=0xCFB8;
+update t1 set name='U+874B <CJK>' where ujis=0xCFB9;
+update t1 set name='U+90CE <CJK>' where ujis=0xCFBA;
+update t1 set name='U+516D <CJK>' where ujis=0xCFBB;
+update t1 set name='U+9E93 <CJK>' where ujis=0xCFBC;
+update t1 set name='U+7984 <CJK>' where ujis=0xCFBD;
+update t1 set name='U+808B <CJK>' where ujis=0xCFBE;
+update t1 set name='U+9332 <CJK>' where ujis=0xCFBF;
+update t1 set name='U+8AD6 <CJK>' where ujis=0xCFC0;
+update t1 set name='U+502D <CJK>' where ujis=0xCFC1;
+update t1 set name='U+548C <CJK>' where ujis=0xCFC2;
+update t1 set name='U+8A71 <CJK>' where ujis=0xCFC3;
+update t1 set name='U+6B6A <CJK>' where ujis=0xCFC4;
+update t1 set name='U+8CC4 <CJK>' where ujis=0xCFC5;
+update t1 set name='U+8107 <CJK>' where ujis=0xCFC6;
+update t1 set name='U+60D1 <CJK>' where ujis=0xCFC7;
+update t1 set name='U+67A0 <CJK>' where ujis=0xCFC8;
+update t1 set name='U+9DF2 <CJK>' where ujis=0xCFC9;
+update t1 set name='U+4E99 <CJK>' where ujis=0xCFCA;
+update t1 set name='U+4E98 <CJK>' where ujis=0xCFCB;
+update t1 set name='U+9C10 <CJK>' where ujis=0xCFCC;
+update t1 set name='U+8A6B <CJK>' where ujis=0xCFCD;
+update t1 set name='U+85C1 <CJK>' where ujis=0xCFCE;
+update t1 set name='U+8568 <CJK>' where ujis=0xCFCF;
+update t1 set name='U+6900 <CJK>' where ujis=0xCFD0;
+update t1 set name='U+6E7E <CJK>' where ujis=0xCFD1;
+update t1 set name='U+7897 <CJK>' where ujis=0xCFD2;
+update t1 set name='U+8155 <CJK>' where ujis=0xCFD3;
+update t1 set name='<CJK>' where ujis >= 0xD0A1 AND ujis <= 0xDFFE;
+update t1 set name='<CJK>' where ujis >= 0xE0A1 AND ujis <= 0xEFFE;
+update t1 set name='<CJK>' where ujis >= 0xF0A1 AND ujis <= 0xF3FE;
+update t1 set name='U+582F <CJK>' where ujis=0xF4A1;
+update t1 set name='U+69C7 <CJK>' where ujis=0xF4A2;
+update t1 set name='U+9059 <CJK>' where ujis=0xF4A3;
+update t1 set name='U+7464 <CJK>' where ujis=0xF4A4;
+update t1 set name='U+51DC <CJK>' where ujis=0xF4A5;
+update t1 set name='U+7199 <CJK>' where ujis=0xF4A6;
+update t1 set name='User defined range #1' where ujis >= 0xF5A1 AND ujis <= 0xFEFE;
+insert into t1 (ujis,name) values (0x8EA1,'U+FF61 HALFWIDTH IDEOGRAPHIC FULL STOP');
+insert into t1 (ujis,name) values (0x8EA2,'U+FF62 HALFWIDTH LEFT CORNER BRACKET');
+insert into t1 (ujis,name) values (0x8EA3,'U+FF63 HALFWIDTH RIGHT CORNER BRACKET');
+insert into t1 (ujis,name) values (0x8EA4,'U+FF64 HALFWIDTH IDEOGRAPHIC COMMA');
+insert into t1 (ujis,name) values (0x8EA5,'U+FF65 HALFWIDTH KATAKANA MIDDLE DOT');
+insert into t1 (ujis,name) values (0x8EA6,'U+FF66 HALFWIDTH KATAKANA LETTER WO');
+insert into t1 (ujis,name) values (0x8EA7,'U+FF67 HALFWIDTH KATAKANA LETTER SMALL A');
+insert into t1 (ujis,name) values (0x8EA8,'U+FF68 HALFWIDTH KATAKANA LETTER SMALL I');
+insert into t1 (ujis,name) values (0x8EA9,'U+FF69 HALFWIDTH KATAKANA LETTER SMALL U');
+insert into t1 (ujis,name) values (0x8EAA,'U+FF6A HALFWIDTH KATAKANA LETTER SMALL E');
+insert into t1 (ujis,name) values (0x8EAB,'U+FF6B HALFWIDTH KATAKANA LETTER SMALL O');
+insert into t1 (ujis,name) values (0x8EAC,'U+FF6C HALFWIDTH KATAKANA LETTER SMALL YA');
+insert into t1 (ujis,name) values (0x8EAD,'U+FF6D HALFWIDTH KATAKANA LETTER SMALL YU');
+insert into t1 (ujis,name) values (0x8EAE,'U+FF6E HALFWIDTH KATAKANA LETTER SMALL YO');
+insert into t1 (ujis,name) values (0x8EAF,'U+FF6F HALFWIDTH KATAKANA LETTER SMALL TU');
+insert into t1 (ujis,name) values (0x8EB0,'U+FF70 HALFWIDTH KATAKANA-HIRAGANA PROLONGED SOUND MARK');
+insert into t1 (ujis,name) values (0x8EB1,'U+FF71 HALFWIDTH KATAKANA LETTER A');
+insert into t1 (ujis,name) values (0x8EB2,'U+FF72 HALFWIDTH KATAKANA LETTER I');
+insert into t1 (ujis,name) values (0x8EB3,'U+FF73 HALFWIDTH KATAKANA LETTER U');
+insert into t1 (ujis,name) values (0x8EB4,'U+FF74 HALFWIDTH KATAKANA LETTER E');
+insert into t1 (ujis,name) values (0x8EB5,'U+FF75 HALFWIDTH KATAKANA LETTER O');
+insert into t1 (ujis,name) values (0x8EB6,'U+FF76 HALFWIDTH KATAKANA LETTER KA');
+insert into t1 (ujis,name) values (0x8EB7,'U+FF77 HALFWIDTH KATAKANA LETTER KI');
+insert into t1 (ujis,name) values (0x8EB8,'U+FF78 HALFWIDTH KATAKANA LETTER KU');
+insert into t1 (ujis,name) values (0x8EB9,'U+FF79 HALFWIDTH KATAKANA LETTER KE');
+insert into t1 (ujis,name) values (0x8EBA,'U+FF7A HALFWIDTH KATAKANA LETTER KO');
+insert into t1 (ujis,name) values (0x8EBB,'U+FF7B HALFWIDTH KATAKANA LETTER SA');
+insert into t1 (ujis,name) values (0x8EBC,'U+FF7C HALFWIDTH KATAKANA LETTER SI');
+insert into t1 (ujis,name) values (0x8EBD,'U+FF7D HALFWIDTH KATAKANA LETTER SU');
+insert into t1 (ujis,name) values (0x8EBE,'U+FF7E HALFWIDTH KATAKANA LETTER SE');
+insert into t1 (ujis,name) values (0x8EBF,'U+FF7F HALFWIDTH KATAKANA LETTER SO');
+insert into t1 (ujis,name) values (0x8EC0,'U+FF80 HALFWIDTH KATAKANA LETTER TA');
+insert into t1 (ujis,name) values (0x8EC1,'U+FF81 HALFWIDTH KATAKANA LETTER TI');
+insert into t1 (ujis,name) values (0x8EC2,'U+FF82 HALFWIDTH KATAKANA LETTER TU');
+insert into t1 (ujis,name) values (0x8EC3,'U+FF83 HALFWIDTH KATAKANA LETTER TE');
+insert into t1 (ujis,name) values (0x8EC4,'U+FF84 HALFWIDTH KATAKANA LETTER TO');
+insert into t1 (ujis,name) values (0x8EC5,'U+FF85 HALFWIDTH KATAKANA LETTER NA');
+insert into t1 (ujis,name) values (0x8EC6,'U+FF86 HALFWIDTH KATAKANA LETTER NI');
+insert into t1 (ujis,name) values (0x8EC7,'U+FF87 HALFWIDTH KATAKANA LETTER NU');
+insert into t1 (ujis,name) values (0x8EC8,'U+FF88 HALFWIDTH KATAKANA LETTER NE');
+insert into t1 (ujis,name) values (0x8EC9,'U+FF89 HALFWIDTH KATAKANA LETTER NO');
+insert into t1 (ujis,name) values (0x8ECA,'U+FF8A HALFWIDTH KATAKANA LETTER HA');
+insert into t1 (ujis,name) values (0x8ECB,'U+FF8B HALFWIDTH KATAKANA LETTER HI');
+insert into t1 (ujis,name) values (0x8ECC,'U+FF8C HALFWIDTH KATAKANA LETTER HU');
+insert into t1 (ujis,name) values (0x8ECD,'U+FF8D HALFWIDTH KATAKANA LETTER HE');
+insert into t1 (ujis,name) values (0x8ECE,'U+FF8E HALFWIDTH KATAKANA LETTER HO');
+insert into t1 (ujis,name) values (0x8ECF,'U+FF8F HALFWIDTH KATAKANA LETTER MA');
+insert into t1 (ujis,name) values (0x8ED0,'U+FF90 HALFWIDTH KATAKANA LETTER MI');
+insert into t1 (ujis,name) values (0x8ED1,'U+FF91 HALFWIDTH KATAKANA LETTER MU');
+insert into t1 (ujis,name) values (0x8ED2,'U+FF92 HALFWIDTH KATAKANA LETTER ME');
+insert into t1 (ujis,name) values (0x8ED3,'U+FF93 HALFWIDTH KATAKANA LETTER MO');
+insert into t1 (ujis,name) values (0x8ED4,'U+FF94 HALFWIDTH KATAKANA LETTER YA');
+insert into t1 (ujis,name) values (0x8ED5,'U+FF95 HALFWIDTH KATAKANA LETTER YU');
+insert into t1 (ujis,name) values (0x8ED6,'U+FF96 HALFWIDTH KATAKANA LETTER YO');
+insert into t1 (ujis,name) values (0x8ED7,'U+FF97 HALFWIDTH KATAKANA LETTER RA');
+insert into t1 (ujis,name) values (0x8ED8,'U+FF98 HALFWIDTH KATAKANA LETTER RI');
+insert into t1 (ujis,name) values (0x8ED9,'U+FF99 HALFWIDTH KATAKANA LETTER RU');
+insert into t1 (ujis,name) values (0x8EDA,'U+FF9A HALFWIDTH KATAKANA LETTER RE');
+insert into t1 (ujis,name) values (0x8EDB,'U+FF9B HALFWIDTH KATAKANA LETTER RO');
+insert into t1 (ujis,name) values (0x8EDC,'U+FF9C HALFWIDTH KATAKANA LETTER WA');
+insert into t1 (ujis,name) values (0x8EDD,'U+FF9D HALFWIDTH KATAKANA LETTER N');
+insert into t1 (ujis,name) values (0x8EDE,'U+FF9E HALFWIDTH KATAKANA VOICED SOUND MARK');
+insert into t1 (ujis,name) values (0x8EDF,'U+FF9F HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK');
+insert into t1 (ujis) select concat(0x8F,t21.code,t22.code) from t2 t21, t2 t22 order by 1;
+update t1 set name='U+02D8 BREVE' where ujis=0x8FA2AF;
+update t1 set name='U+02C7 CARON (Mandarin Chinese third tone)' where ujis=0x8FA2B0;
+update t1 set name='U+00B8 CEDILLA' where ujis=0x8FA2B1;
+update t1 set name='U+02D9 DOT ABOVE (Mandarin Chinese light tone)' where ujis=0x8FA2B2;
+update t1 set name='U+02DD DOUBLE ACUTE ACCENT' where ujis=0x8FA2B3;
+update t1 set name='U+00AF MACRON' where ujis=0x8FA2B4;
+update t1 set name='U+02DB OGONEK' where ujis=0x8FA2B5;
+update t1 set name='U+02DA RING ABOVE' where ujis=0x8FA2B6;
+update t1 set name='U+007E TILDE' where ujis=0x8FA2B7;
+update t1 set name='U+0384 GREEK TONOS' where ujis=0x8FA2B8;
+update t1 set name='U+0385 GREEK DIALYTIKA TONOS' where ujis=0x8FA2B9;
+update t1 set name='U+00A1 INVERTED EXCLAMATION MARK' where ujis=0x8FA2C2;
+update t1 set name='U+00A6 BROKEN BAR' where ujis=0x8FA2C3;
+update t1 set name='U+00BF INVERTED QUESTION MARK' where ujis=0x8FA2C4;
+update t1 set name='U+00BA MASCULINE ORDINAL INDICATOR' where ujis=0x8FA2EB;
+update t1 set name='U+00AA FEMININE ORDINAL INDICATOR' where ujis=0x8FA2EC;
+update t1 set name='U+00A9 COPYRIGHT SIGN' where ujis=0x8FA2ED;
+update t1 set name='U+00AE REGISTERED SIGN' where ujis=0x8FA2EE;
+update t1 set name='U+2122 TRADE MARK SIGN' where ujis=0x8FA2EF;
+update t1 set name='U+00A4 CURRENCY SIGN' where ujis=0x8FA2F0;
+update t1 set name='U+2116 NUMERO SIGN' where ujis=0x8FA2F1;
+update t1 set name='U+0386 GREEK CAPITAL LETTER ALPHA WITH TONOS' where ujis=0x8FA6E1;
+update t1 set name='U+0388 GREEK CAPITAL LETTER EPSILON WITH TONOS' where ujis=0x8FA6E2;
+update t1 set name='U+0389 GREEK CAPITAL LETTER ETA WITH TONOS' where ujis=0x8FA6E3;
+update t1 set name='U+038A GREEK CAPITAL LETTER IOTA WITH TONOS' where ujis=0x8FA6E4;
+update t1 set name='U+03AA GREEK CAPITAL LETTER IOTA WITH DIALYTIKA' where ujis=0x8FA6E5;
+update t1 set name='U+038C GREEK CAPITAL LETTER OMICRON WITH TONOS' where ujis=0x8FA6E7;
+update t1 set name='U+038E GREEK CAPITAL LETTER UPSILON WITH TONOS' where ujis=0x8FA6E9;
+update t1 set name='U+03AB GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA' where ujis=0x8FA6EA;
+update t1 set name='U+038F GREEK CAPITAL LETTER OMEGA WITH TONOS' where ujis=0x8FA6EC;
+update t1 set name='U+03AC GREEK SMALL LETTER ALPHA WITH TONOS' where ujis=0x8FA6F1;
+update t1 set name='U+03AD GREEK SMALL LETTER EPSILON WITH TONOS' where ujis=0x8FA6F2;
+update t1 set name='U+03AE GREEK SMALL LETTER ETA WITH TONOS' where ujis=0x8FA6F3;
+update t1 set name='U+03AF GREEK SMALL LETTER IOTA WITH TONOS' where ujis=0x8FA6F4;
+update t1 set name='U+03CA GREEK SMALL LETTER IOTA WITH DIALYTIKA' where ujis=0x8FA6F5;
+update t1 set name='U+0390 GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS' where ujis=0x8FA6F6;
+update t1 set name='U+03CC GREEK SMALL LETTER OMICRON WITH TONOS' where ujis=0x8FA6F7;
+update t1 set name='U+03C2 GREEK SMALL LETTER FINAL SIGMA' where ujis=0x8FA6F8;
+update t1 set name='U+03CD GREEK SMALL LETTER UPSILON WITH TONOS' where ujis=0x8FA6F9;
+update t1 set name='U+03CB GREEK SMALL LETTER UPSILON WITH DIALYTIKA' where ujis=0x8FA6FA;
+update t1 set name='U+03B0 GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS' where ujis=0x8FA6FB;
+update t1 set name='U+03CE GREEK SMALL LETTER OMEGA WITH TONOS' where ujis=0x8FA6FC;
+update t1 set name='U+0402 CYRILLIC CAPITAL LETTER DJE' where ujis=0x8FA7C2;
+update t1 set name='U+0403 CYRILLIC CAPITAL LETTER GJE' where ujis=0x8FA7C3;
+update t1 set name='U+0404 CYRILLIC CAPITAL LETTER UKRAINIAN IE' where ujis=0x8FA7C4;
+update t1 set name='U+0405 CYRILLIC CAPITAL LETTER DZE' where ujis=0x8FA7C5;
+update t1 set name='U+0406 CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I' where ujis=0x8FA7C6;
+update t1 set name='U+0407 CYRILLIC CAPITAL LETTER YI' where ujis=0x8FA7C7;
+update t1 set name='U+0408 CYRILLIC CAPITAL LETTER JE' where ujis=0x8FA7C8;
+update t1 set name='U+0409 CYRILLIC CAPITAL LETTER LJE' where ujis=0x8FA7C9;
+update t1 set name='U+040A CYRILLIC CAPITAL LETTER NJE' where ujis=0x8FA7CA;
+update t1 set name='U+040B CYRILLIC CAPITAL LETTER TSHE' where ujis=0x8FA7CB;
+update t1 set name='U+040C CYRILLIC CAPITAL LETTER KJE' where ujis=0x8FA7CC;
+update t1 set name='U+040E CYRILLIC CAPITAL LETTER SHORT U' where ujis=0x8FA7CD;
+update t1 set name='U+040F CYRILLIC CAPITAL LETTER DZHE' where ujis=0x8FA7CE;
+update t1 set name='U+0452 CYRILLIC SMALL LETTER DJE' where ujis=0x8FA7F2;
+update t1 set name='U+0453 CYRILLIC SMALL LETTER GJE' where ujis=0x8FA7F3;
+update t1 set name='U+0454 CYRILLIC SMALL LETTER UKRAINIAN IE' where ujis=0x8FA7F4;
+update t1 set name='U+0455 CYRILLIC SMALL LETTER DZE' where ujis=0x8FA7F5;
+update t1 set name='U+0456 CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I' where ujis=0x8FA7F6;
+update t1 set name='U+0457 CYRILLIC SMALL LETTER YI' where ujis=0x8FA7F7;
+update t1 set name='U+0458 CYRILLIC SMALL LETTER JE' where ujis=0x8FA7F8;
+update t1 set name='U+0459 CYRILLIC SMALL LETTER LJE' where ujis=0x8FA7F9;
+update t1 set name='U+045A CYRILLIC SMALL LETTER NJE' where ujis=0x8FA7FA;
+update t1 set name='U+045B CYRILLIC SMALL LETTER TSHE' where ujis=0x8FA7FB;
+update t1 set name='U+045C CYRILLIC SMALL LETTER KJE' where ujis=0x8FA7FC;
+update t1 set name='U+045E CYRILLIC SMALL LETTER SHORT U' where ujis=0x8FA7FD;
+update t1 set name='U+045F CYRILLIC SMALL LETTER DZHE' where ujis=0x8FA7FE;
+update t1 set name='U+00C6 LATIN CAPITAL LIGATURE AE' where ujis=0x8FA9A1;
+update t1 set name='U+0110 LATIN CAPITAL LETTER D WITH STROKE' where ujis=0x8FA9A2;
+update t1 set name='U+0126 LATIN CAPITAL LETTER H WITH STROKE' where ujis=0x8FA9A4;
+update t1 set name='U+0132 LATIN CAPITAL LIGATURE IJ' where ujis=0x8FA9A6;
+update t1 set name='U+0141 LATIN CAPITAL LETTER L WITH STROKE' where ujis=0x8FA9A8;
+update t1 set name='U+013F LATIN CAPITAL LETTER L WITH MIDDLE DOT' where ujis=0x8FA9A9;
+update t1 set name='U+014A LATIN CAPITAL LETTER ENG' where ujis=0x8FA9AB;
+update t1 set name='U+00D8 LATIN CAPITAL LETTER O WITH STROKE' where ujis=0x8FA9AC;
+update t1 set name='U+0152 LATIN CAPITAL LIGATURE OE' where ujis=0x8FA9AD;
+update t1 set name='U+0166 LATIN CAPITAL LETTER T WITH STROKE' where ujis=0x8FA9AF;
+update t1 set name='U+00DE LATIN CAPITAL LETTER THORN' where ujis=0x8FA9B0;
+update t1 set name='U+00E6 LATIN SMALL LIGATURE AE' where ujis=0x8FA9C1;
+update t1 set name='U+0111 LATIN SMALL LETTER D WITH STROKE' where ujis=0x8FA9C2;
+update t1 set name='U+00F0 LATIN SMALL LETTER ETH' where ujis=0x8FA9C3;
+update t1 set name='U+0127 LATIN SMALL LETTER H WITH STROKE' where ujis=0x8FA9C4;
+update t1 set name='U+0131 LATIN SMALL LETTER DOTLESS I' where ujis=0x8FA9C5;
+update t1 set name='U+0133 LATIN SMALL LIGATURE IJ' where ujis=0x8FA9C6;
+update t1 set name='U+0138 LATIN SMALL LETTER KRA' where ujis=0x8FA9C7;
+update t1 set name='U+0142 LATIN SMALL LETTER L WITH STROKE' where ujis=0x8FA9C8;
+update t1 set name='U+0140 LATIN SMALL LETTER L WITH MIDDLE DOT' where ujis=0x8FA9C9;
+update t1 set name='U+0149 LATIN SMALL LETTER N PRECEDED BY APOSTROPHE' where ujis=0x8FA9CA;
+update t1 set name='U+014B LATIN SMALL LETTER ENG' where ujis=0x8FA9CB;
+update t1 set name='U+00F8 LATIN SMALL LETTER O WITH STROKE' where ujis=0x8FA9CC;
+update t1 set name='U+0153 LATIN SMALL LIGATURE OE' where ujis=0x8FA9CD;
+update t1 set name='U+00DF LATIN SMALL LETTER SHARP S' where ujis=0x8FA9CE;
+update t1 set name='U+0167 LATIN SMALL LETTER T WITH STROKE' where ujis=0x8FA9CF;
+update t1 set name='U+00FE LATIN SMALL LETTER THORN' where ujis=0x8FA9D0;
+update t1 set name='U+00C1 LATIN CAPITAL LETTER A WITH ACUTE' where ujis=0x8FAAA1;
+update t1 set name='U+00C0 LATIN CAPITAL LETTER A WITH GRAVE' where ujis=0x8FAAA2;
+update t1 set name='U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS' where ujis=0x8FAAA3;
+update t1 set name='U+00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX' where ujis=0x8FAAA4;
+update t1 set name='U+0102 LATIN CAPITAL LETTER A WITH BREVE' where ujis=0x8FAAA5;
+update t1 set name='U+01CD LATIN CAPITAL LETTER A WITH CARON' where ujis=0x8FAAA6;
+update t1 set name='U+0100 LATIN CAPITAL LETTER A WITH MACRON' where ujis=0x8FAAA7;
+update t1 set name='U+0104 LATIN CAPITAL LETTER A WITH OGONEK' where ujis=0x8FAAA8;
+update t1 set name='U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE' where ujis=0x8FAAA9;
+update t1 set name='U+00C3 LATIN CAPITAL LETTER A WITH TILDE' where ujis=0x8FAAAA;
+update t1 set name='U+0106 LATIN CAPITAL LETTER C WITH ACUTE' where ujis=0x8FAAAB;
+update t1 set name='U+0108 LATIN CAPITAL LETTER C WITH CIRCUMFLEX' where ujis=0x8FAAAC;
+update t1 set name='U+010C LATIN CAPITAL LETTER C WITH CARON' where ujis=0x8FAAAD;
+update t1 set name='U+00C7 LATIN CAPITAL LETTER C WITH CEDILLA' where ujis=0x8FAAAE;
+update t1 set name='U+010A LATIN CAPITAL LETTER C WITH DOT ABOVE' where ujis=0x8FAAAF;
+update t1 set name='U+010E LATIN CAPITAL LETTER D WITH CARON' where ujis=0x8FAAB0;
+update t1 set name='U+00C9 LATIN CAPITAL LETTER E WITH ACUTE' where ujis=0x8FAAB1;
+update t1 set name='U+00C8 LATIN CAPITAL LETTER E WITH GRAVE' where ujis=0x8FAAB2;
+update t1 set name='U+00CB LATIN CAPITAL LETTER E WITH DIAERESIS' where ujis=0x8FAAB3;
+update t1 set name='U+00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX' where ujis=0x8FAAB4;
+update t1 set name='U+011A LATIN CAPITAL LETTER E WITH CARON' where ujis=0x8FAAB5;
+update t1 set name='U+0116 LATIN CAPITAL LETTER E WITH DOT ABOVE' where ujis=0x8FAAB6;
+update t1 set name='U+0112 LATIN CAPITAL LETTER E WITH MACRON' where ujis=0x8FAAB7;
+update t1 set name='U+0118 LATIN CAPITAL LETTER E WITH OGONEK' where ujis=0x8FAAB8;
+update t1 set name='U+011C LATIN CAPITAL LETTER G WITH CIRCUMFLEX' where ujis=0x8FAABA;
+update t1 set name='U+011E LATIN CAPITAL LETTER G WITH BREVE' where ujis=0x8FAABB;
+update t1 set name='U+0122 LATIN CAPITAL LETTER G WITH CEDILLA' where ujis=0x8FAABC;
+update t1 set name='U+0120 LATIN CAPITAL LETTER G WITH DOT ABOVE' where ujis=0x8FAABD;
+update t1 set name='U+0124 LATIN CAPITAL LETTER H WITH CIRCUMFLEX' where ujis=0x8FAABE;
+update t1 set name='U+00CD LATIN CAPITAL LETTER I WITH ACUTE' where ujis=0x8FAABF;
+update t1 set name='U+00CC LATIN CAPITAL LETTER I WITH GRAVE' where ujis=0x8FAAC0;
+update t1 set name='U+00CF LATIN CAPITAL LETTER I WITH DIAERESIS' where ujis=0x8FAAC1;
+update t1 set name='U+00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX' where ujis=0x8FAAC2;
+update t1 set name='U+01CF LATIN CAPITAL LETTER I WITH CARON' where ujis=0x8FAAC3;
+update t1 set name='U+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE' where ujis=0x8FAAC4;
+update t1 set name='U+012A LATIN CAPITAL LETTER I WITH MACRON' where ujis=0x8FAAC5;
+update t1 set name='U+012E LATIN CAPITAL LETTER I WITH OGONEK' where ujis=0x8FAAC6;
+update t1 set name='U+0128 LATIN CAPITAL LETTER I WITH TILDE' where ujis=0x8FAAC7;
+update t1 set name='U+0134 LATIN CAPITAL LETTER J WITH CIRCUMFLEX' where ujis=0x8FAAC8;
+update t1 set name='U+0136 LATIN CAPITAL LETTER K WITH CEDILLA' where ujis=0x8FAAC9;
+update t1 set name='U+0139 LATIN CAPITAL LETTER L WITH ACUTE' where ujis=0x8FAACA;
+update t1 set name='U+013D LATIN CAPITAL LETTER L WITH CARON' where ujis=0x8FAACB;
+update t1 set name='U+013B LATIN CAPITAL LETTER L WITH CEDILLA' where ujis=0x8FAACC;
+update t1 set name='U+0143 LATIN CAPITAL LETTER N WITH ACUTE' where ujis=0x8FAACD;
+update t1 set name='U+0147 LATIN CAPITAL LETTER N WITH CARON' where ujis=0x8FAACE;
+update t1 set name='U+0145 LATIN CAPITAL LETTER N WITH CEDILLA' where ujis=0x8FAACF;
+update t1 set name='U+00D1 LATIN CAPITAL LETTER N WITH TILDE' where ujis=0x8FAAD0;
+update t1 set name='U+00D3 LATIN CAPITAL LETTER O WITH ACUTE' where ujis=0x8FAAD1;
+update t1 set name='U+00D2 LATIN CAPITAL LETTER O WITH GRAVE' where ujis=0x8FAAD2;
+update t1 set name='U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS' where ujis=0x8FAAD3;
+update t1 set name='U+00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX' where ujis=0x8FAAD4;
+update t1 set name='U+01D1 LATIN CAPITAL LETTER O WITH CARON' where ujis=0x8FAAD5;
+update t1 set name='U+0150 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE' where ujis=0x8FAAD6;
+update t1 set name='U+014C LATIN CAPITAL LETTER O WITH MACRON' where ujis=0x8FAAD7;
+update t1 set name='U+00D5 LATIN CAPITAL LETTER O WITH TILDE' where ujis=0x8FAAD8;
+update t1 set name='U+0154 LATIN CAPITAL LETTER R WITH ACUTE' where ujis=0x8FAAD9;
+update t1 set name='U+0158 LATIN CAPITAL LETTER R WITH CARON' where ujis=0x8FAADA;
+update t1 set name='U+0156 LATIN CAPITAL LETTER R WITH CEDILLA' where ujis=0x8FAADB;
+update t1 set name='U+015A LATIN CAPITAL LETTER S WITH ACUTE' where ujis=0x8FAADC;
+update t1 set name='U+015C LATIN CAPITAL LETTER S WITH CIRCUMFLEX' where ujis=0x8FAADD;
+update t1 set name='U+0160 LATIN CAPITAL LETTER S WITH CARON' where ujis=0x8FAADE;
+update t1 set name='U+015E LATIN CAPITAL LETTER S WITH CEDILLA' where ujis=0x8FAADF;
+update t1 set name='U+0164 LATIN CAPITAL LETTER T WITH CARON' where ujis=0x8FAAE0;
+update t1 set name='U+0162 LATIN CAPITAL LETTER T WITH CEDILLA' where ujis=0x8FAAE1;
+update t1 set name='U+00DA LATIN CAPITAL LETTER U WITH ACUTE' where ujis=0x8FAAE2;
+update t1 set name='U+00D9 LATIN CAPITAL LETTER U WITH GRAVE' where ujis=0x8FAAE3;
+update t1 set name='U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS' where ujis=0x8FAAE4;
+update t1 set name='U+00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX' where ujis=0x8FAAE5;
+update t1 set name='U+016C LATIN CAPITAL LETTER U WITH BREVE' where ujis=0x8FAAE6;
+update t1 set name='U+01D3 LATIN CAPITAL LETTER U WITH CARON' where ujis=0x8FAAE7;
+update t1 set name='U+0170 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE' where ujis=0x8FAAE8;
+update t1 set name='U+016A LATIN CAPITAL LETTER U WITH MACRON' where ujis=0x8FAAE9;
+update t1 set name='U+0172 LATIN CAPITAL LETTER U WITH OGONEK' where ujis=0x8FAAEA;
+update t1 set name='U+016E LATIN CAPITAL LETTER U WITH RING ABOVE' where ujis=0x8FAAEB;
+update t1 set name='U+0168 LATIN CAPITAL LETTER U WITH TILDE' where ujis=0x8FAAEC;
+update t1 set name='U+01D7 LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE' where ujis=0x8FAAED;
+update t1 set name='U+01DB LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE' where ujis=0x8FAAEE;
+update t1 set name='U+01D9 LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON' where ujis=0x8FAAEF;
+update t1 set name='U+01D5 LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON' where ujis=0x8FAAF0;
+update t1 set name='U+0174 LATIN CAPITAL LETTER W WITH CIRCUMFLEX' where ujis=0x8FAAF1;
+update t1 set name='U+00DD LATIN CAPITAL LETTER Y WITH ACUTE' where ujis=0x8FAAF2;
+update t1 set name='U+0178 LATIN CAPITAL LETTER Y WITH DIAERESIS' where ujis=0x8FAAF3;
+update t1 set name='U+0176 LATIN CAPITAL LETTER Y WITH CIRCUMFLEX' where ujis=0x8FAAF4;
+update t1 set name='U+0179 LATIN CAPITAL LETTER Z WITH ACUTE' where ujis=0x8FAAF5;
+update t1 set name='U+017D LATIN CAPITAL LETTER Z WITH CARON' where ujis=0x8FAAF6;
+update t1 set name='U+017B LATIN CAPITAL LETTER Z WITH DOT ABOVE' where ujis=0x8FAAF7;
+update t1 set name='U+00E1 LATIN SMALL LETTER A WITH ACUTE' where ujis=0x8FABA1;
+update t1 set name='U+00E0 LATIN SMALL LETTER A WITH GRAVE' where ujis=0x8FABA2;
+update t1 set name='U+00E4 LATIN SMALL LETTER A WITH DIAERESIS' where ujis=0x8FABA3;
+update t1 set name='U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX' where ujis=0x8FABA4;
+update t1 set name='U+0103 LATIN SMALL LETTER A WITH BREVE' where ujis=0x8FABA5;
+update t1 set name='U+01CE LATIN SMALL LETTER A WITH CARON' where ujis=0x8FABA6;
+update t1 set name='U+0101 LATIN SMALL LETTER A WITH MACRON' where ujis=0x8FABA7;
+update t1 set name='U+0105 LATIN SMALL LETTER A WITH OGONEK' where ujis=0x8FABA8;
+update t1 set name='U+00E5 LATIN SMALL LETTER A WITH RING ABOVE' where ujis=0x8FABA9;
+update t1 set name='U+00E3 LATIN SMALL LETTER A WITH TILDE' where ujis=0x8FABAA;
+update t1 set name='U+0107 LATIN SMALL LETTER C WITH ACUTE' where ujis=0x8FABAB;
+update t1 set name='U+0109 LATIN SMALL LETTER C WITH CIRCUMFLEX' where ujis=0x8FABAC;
+update t1 set name='U+010D LATIN SMALL LETTER C WITH CARON' where ujis=0x8FABAD;
+update t1 set name='U+00E7 LATIN SMALL LETTER C WITH CEDILLA' where ujis=0x8FABAE;
+update t1 set name='U+010B LATIN SMALL LETTER C WITH DOT ABOVE' where ujis=0x8FABAF;
+update t1 set name='U+010F LATIN SMALL LETTER D WITH CARON' where ujis=0x8FABB0;
+update t1 set name='U+00E9 LATIN SMALL LETTER E WITH ACUTE' where ujis=0x8FABB1;
+update t1 set name='U+00E8 LATIN SMALL LETTER E WITH GRAVE' where ujis=0x8FABB2;
+update t1 set name='U+00EB LATIN SMALL LETTER E WITH DIAERESIS' where ujis=0x8FABB3;
+update t1 set name='U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX' where ujis=0x8FABB4;
+update t1 set name='U+011B LATIN SMALL LETTER E WITH CARON' where ujis=0x8FABB5;
+update t1 set name='U+0117 LATIN SMALL LETTER E WITH DOT ABOVE' where ujis=0x8FABB6;
+update t1 set name='U+0113 LATIN SMALL LETTER E WITH MACRON' where ujis=0x8FABB7;
+update t1 set name='U+0119 LATIN SMALL LETTER E WITH OGONEK' where ujis=0x8FABB8;
+update t1 set name='U+01F5 LATIN SMALL LETTER G WITH ACUTE' where ujis=0x8FABB9;
+update t1 set name='U+011D LATIN SMALL LETTER G WITH CIRCUMFLEX' where ujis=0x8FABBA;
+update t1 set name='U+011F LATIN SMALL LETTER G WITH BREVE' where ujis=0x8FABBB;
+update t1 set name='U+0121 LATIN SMALL LETTER G WITH DOT ABOVE' where ujis=0x8FABBD;
+update t1 set name='U+0125 LATIN SMALL LETTER H WITH CIRCUMFLEX' where ujis=0x8FABBE;
+update t1 set name='U+00ED LATIN SMALL LETTER I WITH ACUTE' where ujis=0x8FABBF;
+update t1 set name='U+00EC LATIN SMALL LETTER I WITH GRAVE' where ujis=0x8FABC0;
+update t1 set name='U+00EF LATIN SMALL LETTER I WITH DIAERESIS' where ujis=0x8FABC1;
+update t1 set name='U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX' where ujis=0x8FABC2;
+update t1 set name='U+01D0 LATIN SMALL LETTER I WITH CARON' where ujis=0x8FABC3;
+update t1 set name='U+012B LATIN SMALL LETTER I WITH MACRON' where ujis=0x8FABC5;
+update t1 set name='U+012F LATIN SMALL LETTER I WITH OGONEK' where ujis=0x8FABC6;
+update t1 set name='U+0129 LATIN SMALL LETTER I WITH TILDE' where ujis=0x8FABC7;
+update t1 set name='U+0135 LATIN SMALL LETTER J WITH CIRCUMFLEX' where ujis=0x8FABC8;
+update t1 set name='U+0137 LATIN SMALL LETTER K WITH CEDILLA' where ujis=0x8FABC9;
+update t1 set name='U+013A LATIN SMALL LETTER L WITH ACUTE' where ujis=0x8FABCA;
+update t1 set name='U+013E LATIN SMALL LETTER L WITH CARON' where ujis=0x8FABCB;
+update t1 set name='U+013C LATIN SMALL LETTER L WITH CEDILLA' where ujis=0x8FABCC;
+update t1 set name='U+0144 LATIN SMALL LETTER N WITH ACUTE' where ujis=0x8FABCD;
+update t1 set name='U+0148 LATIN SMALL LETTER N WITH CARON' where ujis=0x8FABCE;
+update t1 set name='U+0146 LATIN SMALL LETTER N WITH CEDILLA' where ujis=0x8FABCF;
+update t1 set name='U+00F1 LATIN SMALL LETTER N WITH TILDE' where ujis=0x8FABD0;
+update t1 set name='U+00F3 LATIN SMALL LETTER O WITH ACUTE' where ujis=0x8FABD1;
+update t1 set name='U+00F2 LATIN SMALL LETTER O WITH GRAVE' where ujis=0x8FABD2;
+update t1 set name='U+00F6 LATIN SMALL LETTER O WITH DIAERESIS' where ujis=0x8FABD3;
+update t1 set name='U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX' where ujis=0x8FABD4;
+update t1 set name='U+01D2 LATIN SMALL LETTER O WITH CARON' where ujis=0x8FABD5;
+update t1 set name='U+0151 LATIN SMALL LETTER O WITH DOUBLE ACUTE' where ujis=0x8FABD6;
+update t1 set name='U+014D LATIN SMALL LETTER O WITH MACRON' where ujis=0x8FABD7;
+update t1 set name='U+00F5 LATIN SMALL LETTER O WITH TILDE' where ujis=0x8FABD8;
+update t1 set name='U+0155 LATIN SMALL LETTER R WITH ACUTE' where ujis=0x8FABD9;
+update t1 set name='U+0159 LATIN SMALL LETTER R WITH CARON' where ujis=0x8FABDA;
+update t1 set name='U+0157 LATIN SMALL LETTER R WITH CEDILLA' where ujis=0x8FABDB;
+update t1 set name='U+015B LATIN SMALL LETTER S WITH ACUTE' where ujis=0x8FABDC;
+update t1 set name='U+015D LATIN SMALL LETTER S WITH CIRCUMFLEX' where ujis=0x8FABDD;
+update t1 set name='U+0161 LATIN SMALL LETTER S WITH CARON' where ujis=0x8FABDE;
+update t1 set name='U+015F LATIN SMALL LETTER S WITH CEDILLA' where ujis=0x8FABDF;
+update t1 set name='U+0165 LATIN SMALL LETTER T WITH CARON' where ujis=0x8FABE0;
+update t1 set name='U+0163 LATIN SMALL LETTER T WITH CEDILLA' where ujis=0x8FABE1;
+update t1 set name='U+00FA LATIN SMALL LETTER U WITH ACUTE' where ujis=0x8FABE2;
+update t1 set name='U+00F9 LATIN SMALL LETTER U WITH GRAVE' where ujis=0x8FABE3;
+update t1 set name='U+00FC LATIN SMALL LETTER U WITH DIAERESIS' where ujis=0x8FABE4;
+update t1 set name='U+00FB LATIN SMALL LETTER U WITH CIRCUMFLEX' where ujis=0x8FABE5;
+update t1 set name='U+016D LATIN SMALL LETTER U WITH BREVE' where ujis=0x8FABE6;
+update t1 set name='U+01D4 LATIN SMALL LETTER U WITH CARON' where ujis=0x8FABE7;
+update t1 set name='U+0171 LATIN SMALL LETTER U WITH DOUBLE ACUTE' where ujis=0x8FABE8;
+update t1 set name='U+016B LATIN SMALL LETTER U WITH MACRON' where ujis=0x8FABE9;
+update t1 set name='U+0173 LATIN SMALL LETTER U WITH OGONEK' where ujis=0x8FABEA;
+update t1 set name='U+016F LATIN SMALL LETTER U WITH RING ABOVE' where ujis=0x8FABEB;
+update t1 set name='U+0169 LATIN SMALL LETTER U WITH TILDE' where ujis=0x8FABEC;
+update t1 set name='U+01D8 LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE' where ujis=0x8FABED;
+update t1 set name='U+01DC LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE' where ujis=0x8FABEE;
+update t1 set name='U+01DA LATIN SMALL LETTER U WITH DIAERESIS AND CARON' where ujis=0x8FABEF;
+update t1 set name='U+01D6 LATIN SMALL LETTER U WITH DIAERESIS AND MACRON' where ujis=0x8FABF0;
+update t1 set name='U+0175 LATIN SMALL LETTER W WITH CIRCUMFLEX' where ujis=0x8FABF1;
+update t1 set name='U+00FD LATIN SMALL LETTER Y WITH ACUTE' where ujis=0x8FABF2;
+update t1 set name='U+00FF LATIN SMALL LETTER Y WITH DIAERESIS' where ujis=0x8FABF3;
+update t1 set name='U+0177 LATIN SMALL LETTER Y WITH CIRCUMFLEX' where ujis=0x8FABF4;
+update t1 set name='U+017A LATIN SMALL LETTER Z WITH ACUTE' where ujis=0x8FABF5;
+update t1 set name='U+017E LATIN SMALL LETTER Z WITH CARON' where ujis=0x8FABF6;
+update t1 set name='U+017C LATIN SMALL LETTER Z WITH DOT ABOVE' where ujis=0x8FABF7;
+update t1 set name='<CJK>' where ujis >= 0x8FB0A1 AND ujis <= 0x8FBFFE;
+update t1 set name='<CJK>' where ujis >= 0x8FC0A1 AND ujis <= 0x8FCFFE;
+update t1 set name='<CJK>' where ujis >= 0x8FD0A1 AND ujis <= 0x8FDFFE;
+update t1 set name='<CJK>' where ujis >= 0x8FE0A1 AND ujis <= 0x8FECFE;
+update t1 set name='U+9EF8 <CJK>' where ujis=0x8FEDA1;
+update t1 set name='U+9EFF <CJK>' where ujis=0x8FEDA2;
+update t1 set name='U+9F02 <CJK>' where ujis=0x8FEDA3;
+update t1 set name='U+9F03 <CJK>' where ujis=0x8FEDA4;
+update t1 set name='U+9F09 <CJK>' where ujis=0x8FEDA5;
+update t1 set name='U+9F0F <CJK>' where ujis=0x8FEDA6;
+update t1 set name='U+9F10 <CJK>' where ujis=0x8FEDA7;
+update t1 set name='U+9F11 <CJK>' where ujis=0x8FEDA8;
+update t1 set name='U+9F12 <CJK>' where ujis=0x8FEDA9;
+update t1 set name='U+9F14 <CJK>' where ujis=0x8FEDAA;
+update t1 set name='U+9F16 <CJK>' where ujis=0x8FEDAB;
+update t1 set name='U+9F17 <CJK>' where ujis=0x8FEDAC;
+update t1 set name='U+9F19 <CJK>' where ujis=0x8FEDAD;
+update t1 set name='U+9F1A <CJK>' where ujis=0x8FEDAE;
+update t1 set name='U+9F1B <CJK>' where ujis=0x8FEDAF;
+update t1 set name='U+9F1F <CJK>' where ujis=0x8FEDB0;
+update t1 set name='U+9F22 <CJK>' where ujis=0x8FEDB1;
+update t1 set name='U+9F26 <CJK>' where ujis=0x8FEDB2;
+update t1 set name='U+9F2A <CJK>' where ujis=0x8FEDB3;
+update t1 set name='U+9F2B <CJK>' where ujis=0x8FEDB4;
+update t1 set name='U+9F2F <CJK>' where ujis=0x8FEDB5;
+update t1 set name='U+9F31 <CJK>' where ujis=0x8FEDB6;
+update t1 set name='U+9F32 <CJK>' where ujis=0x8FEDB7;
+update t1 set name='U+9F34 <CJK>' where ujis=0x8FEDB8;
+update t1 set name='U+9F37 <CJK>' where ujis=0x8FEDB9;
+update t1 set name='U+9F39 <CJK>' where ujis=0x8FEDBA;
+update t1 set name='U+9F3A <CJK>' where ujis=0x8FEDBB;
+update t1 set name='U+9F3C <CJK>' where ujis=0x8FEDBC;
+update t1 set name='U+9F3D <CJK>' where ujis=0x8FEDBD;
+update t1 set name='U+9F3F <CJK>' where ujis=0x8FEDBE;
+update t1 set name='U+9F41 <CJK>' where ujis=0x8FEDBF;
+update t1 set name='U+9F43 <CJK>' where ujis=0x8FEDC0;
+update t1 set name='U+9F44 <CJK>' where ujis=0x8FEDC1;
+update t1 set name='U+9F45 <CJK>' where ujis=0x8FEDC2;
+update t1 set name='U+9F46 <CJK>' where ujis=0x8FEDC3;
+update t1 set name='U+9F47 <CJK>' where ujis=0x8FEDC4;
+update t1 set name='U+9F53 <CJK>' where ujis=0x8FEDC5;
+update t1 set name='U+9F55 <CJK>' where ujis=0x8FEDC6;
+update t1 set name='U+9F56 <CJK>' where ujis=0x8FEDC7;
+update t1 set name='U+9F57 <CJK>' where ujis=0x8FEDC8;
+update t1 set name='U+9F58 <CJK>' where ujis=0x8FEDC9;
+update t1 set name='U+9F5A <CJK>' where ujis=0x8FEDCA;
+update t1 set name='U+9F5D <CJK>' where ujis=0x8FEDCB;
+update t1 set name='U+9F5E <CJK>' where ujis=0x8FEDCC;
+update t1 set name='U+9F68 <CJK>' where ujis=0x8FEDCD;
+update t1 set name='U+9F69 <CJK>' where ujis=0x8FEDCE;
+update t1 set name='U+9F6D <CJK>' where ujis=0x8FEDCF;
+update t1 set name='U+9F6E <CJK>' where ujis=0x8FEDD0;
+update t1 set name='U+9F6F <CJK>' where ujis=0x8FEDD1;
+update t1 set name='U+9F70 <CJK>' where ujis=0x8FEDD2;
+update t1 set name='U+9F71 <CJK>' where ujis=0x8FEDD3;
+update t1 set name='U+9F73 <CJK>' where ujis=0x8FEDD4;
+update t1 set name='U+9F75 <CJK>' where ujis=0x8FEDD5;
+update t1 set name='U+9F7A <CJK>' where ujis=0x8FEDD6;
+update t1 set name='U+9F7D <CJK>' where ujis=0x8FEDD7;
+update t1 set name='U+9F8F <CJK>' where ujis=0x8FEDD8;
+update t1 set name='U+9F90 <CJK>' where ujis=0x8FEDD9;
+update t1 set name='U+9F91 <CJK>' where ujis=0x8FEDDA;
+update t1 set name='U+9F92 <CJK>' where ujis=0x8FEDDB;
+update t1 set name='U+9F94 <CJK>' where ujis=0x8FEDDC;
+update t1 set name='U+9F96 <CJK>' where ujis=0x8FEDDD;
+update t1 set name='U+9F97 <CJK>' where ujis=0x8FEDDE;
+update t1 set name='U+9F9E <CJK>' where ujis=0x8FEDDF;
+update t1 set name='U+9FA1 <CJK>' where ujis=0x8FEDE0;
+update t1 set name='U+9FA2 <CJK>' where ujis=0x8FEDE1;
+update t1 set name='U+9FA3 <CJK>' where ujis=0x8FEDE2;
+update t1 set name='U+9FA5 <CJK>' where ujis=0x8FEDE3;
+update t1 set name='User defined range #2' where ujis >= 0x8FF5A1 and ujis <= 0x8FFEFE;
+update t1 set name='UNASSIGNED' where name='';
+update t1 set ucs2=ujis, ujis2=ucs2;
+Warnings:
+Warning 1366 Incorrect string value: '\xA2\xAF' for column 'ucs2' at row 237
+Warning 1366 Incorrect string value: '\xA2\xB0' for column 'ucs2' at row 238
+Warning 1366 Incorrect string value: '\xA2\xB1' for column 'ucs2' at row 239
+Warning 1366 Incorrect string value: '\xA2\xB2' for column 'ucs2' at row 240
+Warning 1366 Incorrect string value: '\xA2\xB3' for column 'ucs2' at row 241
+Warning 1366 Incorrect string value: '\xA2\xB4' for column 'ucs2' at row 242
+Warning 1366 Incorrect string value: '\xA2\xB5' for column 'ucs2' at row 243
+Warning 1366 Incorrect string value: '\xA2\xB6' for column 'ucs2' at row 244
+Warning 1366 Incorrect string value: '\xA2\xB7' for column 'ucs2' at row 245
+Warning 1366 Incorrect string value: '\xA2\xB8' for column 'ucs2' at row 246
+Warning 1366 Incorrect string value: '\xA2\xB9' for column 'ucs2' at row 247
+Warning 1366 Incorrect string value: '\xA2\xC2' for column 'ucs2' at row 256
+Warning 1366 Incorrect string value: '\xA2\xC3' for column 'ucs2' at row 257
+Warning 1366 Incorrect string value: '\xA2\xC4' for column 'ucs2' at row 258
+Warning 1366 Incorrect string value: '\xA2\xC5' for column 'ucs2' at row 259
+Warning 1366 Incorrect string value: '\xA2\xC6' for column 'ucs2' at row 260
+Warning 1366 Incorrect string value: '\xA2\xC7' for column 'ucs2' at row 261
+Warning 1366 Incorrect string value: '\xA2\xC8' for column 'ucs2' at row 262
+Warning 1366 Incorrect string value: '\xA2\xC9' for column 'ucs2' at row 263
+Warning 1366 Incorrect string value: '\xA2\xD1' for column 'ucs2' at row 271
+Warning 1366 Incorrect string value: '\xA2\xD2' for column 'ucs2' at row 272
+Warning 1366 Incorrect string value: '\xA2\xD3' for column 'ucs2' at row 273
+Warning 1366 Incorrect string value: '\xA2\xD4' for column 'ucs2' at row 274
+Warning 1366 Incorrect string value: '\xA2\xD5' for column 'ucs2' at row 275
+Warning 1366 Incorrect string value: '\xA2\xD6' for column 'ucs2' at row 276
+Warning 1366 Incorrect string value: '\xA2\xD7' for column 'ucs2' at row 277
+Warning 1366 Incorrect string value: '\xA2\xD8' for column 'ucs2' at row 278
+Warning 1366 Incorrect string value: '\xA2\xD9' for column 'ucs2' at row 279
+Warning 1366 Incorrect string value: '\xA2\xDA' for column 'ucs2' at row 280
+Warning 1366 Incorrect string value: '\xA2\xDB' for column 'ucs2' at row 281
+Warning 1366 Incorrect string value: '\xA2\xEB' for column 'ucs2' at row 297
+Warning 1366 Incorrect string value: '\xA2\xEC' for column 'ucs2' at row 298
+Warning 1366 Incorrect string value: '\xA2\xED' for column 'ucs2' at row 299
+Warning 1366 Incorrect string value: '\xA2\xEE' for column 'ucs2' at row 300
+Warning 1366 Incorrect string value: '\xA2\xEF' for column 'ucs2' at row 301
+Warning 1366 Incorrect string value: '\xA2\xF0' for column 'ucs2' at row 302
+Warning 1366 Incorrect string value: '\xA2\xF1' for column 'ucs2' at row 303
+Warning 1366 Incorrect string value: '\xA2\xFA' for column 'ucs2' at row 312
+Warning 1366 Incorrect string value: '\xA2\xFB' for column 'ucs2' at row 313
+Warning 1366 Incorrect string value: '\xA2\xFC' for column 'ucs2' at row 314
+Warning 1366 Incorrect string value: '\xA2\xFD' for column 'ucs2' at row 315
+Warning 1366 Incorrect string value: '\xA3\xA1' for column 'ucs2' at row 317
+Warning 1366 Incorrect string value: '\xA3\xA2' for column 'ucs2' at row 318
+Warning 1366 Incorrect string value: '\xA3\xA3' for column 'ucs2' at row 319
+Warning 1366 Incorrect string value: '\xA3\xA4' for column 'ucs2' at row 320
+Warning 1366 Incorrect string value: '\xA3\xA5' for column 'ucs2' at row 321
+Warning 1366 Incorrect string value: '\xA3\xA6' for column 'ucs2' at row 322
+Warning 1366 Incorrect string value: '\xA3\xA7' for column 'ucs2' at row 323
+Warning 1366 Incorrect string value: '\xA3\xA8' for column 'ucs2' at row 324
+Warning 1366 Incorrect string value: '\xA3\xA9' for column 'ucs2' at row 325
+Warning 1366 Incorrect string value: '\xA3\xAA' for column 'ucs2' at row 326
+Warning 1366 Incorrect string value: '\xA3\xAB' for column 'ucs2' at row 327
+Warning 1366 Incorrect string value: '\xA3\xAC' for column 'ucs2' at row 328
+Warning 1366 Incorrect string value: '\xA3\xAD' for column 'ucs2' at row 329
+Warning 1366 Incorrect string value: '\xA3\xAE' for column 'ucs2' at row 330
+Warning 1366 Incorrect string value: '\xA3\xAF' for column 'ucs2' at row 331
+Warning 1366 Incorrect string value: '\xA3\xBA' for column 'ucs2' at row 342
+Warning 1366 Incorrect string value: '\xA3\xBB' for column 'ucs2' at row 343
+Warning 1366 Incorrect string value: '\xA3\xBC' for column 'ucs2' at row 344
+Warning 1366 Incorrect string value: '\xA3\xBD' for column 'ucs2' at row 345
+Warning 1366 Incorrect string value: '\xA3\xBE' for column 'ucs2' at row 346
+Warning 1366 Incorrect string value: '\xA3\xBF' for column 'ucs2' at row 347
+Warning 1366 Incorrect string value: '\xA3\xC0' for column 'ucs2' at row 348
+Warning 1366 Incorrect string value: '\xA3\xDB' for column 'ucs2' at row 375
+Characters with safe Unicode round trip
+select hex(ujis), hex(ucs2), hex(ujis2), name from t1 where ujis=ujis2 order by ujis;
+hex(ujis) hex(ucs2) hex(ujis2) name
+00 0000 00 U+0000 NULL
+01 0001 01 U+0001 START OF HEADING
+02 0002 02 U+0002 START OF TEXT
+03 0003 03 U+0003 END OF TEXT
+04 0004 04 U+0004 END OF TRANSMISSION
+05 0005 05 U+0005 ENQUIRY
+06 0006 06 U+0006 ACKNOWLEDGE
+07 0007 07 U+0007 BELL
+08 0008 08 U+0008 BACKSPACE
+09 0009 09 U+0009 HORIZONTAL TABULATION
+0A 000A 0A U+000A LINE FEED
+0B 000B 0B U+000B VERTICAL TABULATION
+0C 000C 0C U+000C FORM FEED
+0D 000D 0D U+000D CARRIAGE RETURN
+0E 000E 0E U+000E SHIFT OUT
+0F 000F 0F U+000F SHIFT IN
+10 0010 10 U+0010 DATA LINK ESCAPE
+11 0011 11 U+0011 DEVICE CONTROL ONE
+12 0012 12 U+0012 DEVICE CONTROL TWO
+13 0013 13 U+0013 DEVICE CONTROL THREE
+14 0014 14 U+0014 DEVICE CONTROL FOUR
+15 0015 15 U+0015 NEGATIVE ACKNOWLEDGE
+16 0016 16 U+0016 SYNCHRONOUS IDLE
+17 0017 17 U+0017 END OF TRANSMISSION BLOCK
+18 0018 18 U+0018 CANCEL
+19 0019 19 U+0019 END OF MEDIUM
+1A 001A 1A U+001A SUBSTITUTE
+1B 001B 1B U+001B ESCAPE
+1C 001C 1C U+001C FILE SEPARATOR
+1D 001D 1D U+001D GROUP SEPARATOR
+1E 001E 1E U+001E RECORD SEPARATOR
+1F 001F 1F U+001F UNIT SEPARATOR
+20 0020 20 U+0020 SPACE
+21 0021 21 U+0021 EXCLAMATION MARK
+22 0022 22 U+0022 QUOTATION MARK
+23 0023 23 U+0023 NUMBER SIGN
+24 0024 24 U+0024 DOLLAR SIGN
+25 0025 25 U+0025 PERCENT SIGN
+26 0026 26 U+0026 AMPERSAND
+27 0027 27 U+0027 APOSTROPHE
+28 0028 28 U+0028 LEFT PARENTHESIS
+29 0029 29 U+0029 RIGHT PARENTHESIS
+2A 002A 2A U+002A ASTERISK
+2B 002B 2B U+002B PLUS SIGN
+2C 002C 2C U+002C COMMA
+2D 002D 2D U+002D HYPHEN-MINUS
+2E 002E 2E U+002E FULL STOP
+2F 002F 2F U+002F SOLIDUS
+30 0030 30 U+0030 DIGIT ZERO
+31 0031 31 U+0031 DIGIT ONE
+32 0032 32 U+0032 DIGIT TWO
+33 0033 33 U+0033 DIGIT THREE
+34 0034 34 U+0034 DIGIT FOUR
+35 0035 35 U+0035 DIGIT FIVE
+36 0036 36 U+0036 DIGIT SIX
+37 0037 37 U+0037 DIGIT SEVEN
+38 0038 38 U+0038 DIGIT EIGHT
+39 0039 39 U+0039 DIGIT NINE
+3A 003A 3A U+003A COLON
+3B 003B 3B U+003B SEMICOLON
+3C 003C 3C U+003C LESS-THAN SIGN
+3D 003D 3D U+003D EQUALS SIGN
+3E 003E 3E U+003E GREATER-THAN SIGN
+3F 003F 3F U+003F QUESTION MARK
+40 0040 40 U+0040 COMMERCIAL AT
+41 0041 41 U+0041 LATIN CAPITAL LETTER A
+42 0042 42 U+0042 LATIN CAPITAL LETTER B
+43 0043 43 U+0043 LATIN CAPITAL LETTER C
+44 0044 44 U+0044 LATIN CAPITAL LETTER D
+45 0045 45 U+0045 LATIN CAPITAL LETTER E
+46 0046 46 U+0046 LATIN CAPITAL LETTER F
+47 0047 47 U+0047 LATIN CAPITAL LETTER G
+48 0048 48 U+0048 LATIN CAPITAL LETTER H
+49 0049 49 U+0049 LATIN CAPITAL LETTER I
+4A 004A 4A U+004A LATIN CAPITAL LETTER J
+4B 004B 4B U+004B LATIN CAPITAL LETTER K
+4C 004C 4C U+004C LATIN CAPITAL LETTER L
+4D 004D 4D U+004D LATIN CAPITAL LETTER M
+4E 004E 4E U+004E LATIN CAPITAL LETTER N
+4F 004F 4F U+004F LATIN CAPITAL LETTER O
+50 0050 50 U+0050 LATIN CAPITAL LETTER P
+51 0051 51 U+0051 LATIN CAPITAL LETTER Q
+52 0052 52 U+0052 LATIN CAPITAL LETTER R
+53 0053 53 U+0053 LATIN CAPITAL LETTER S
+54 0054 54 U+0054 LATIN CAPITAL LETTER T
+55 0055 55 U+0055 LATIN CAPITAL LETTER U
+56 0056 56 U+0056 LATIN CAPITAL LETTER V
+57 0057 57 U+0057 LATIN CAPITAL LETTER W
+58 0058 58 U+0058 LATIN CAPITAL LETTER X
+59 0059 59 U+0059 LATIN CAPITAL LETTER Y
+5A 005A 5A U+005A LATIN CAPITAL LETTER Z
+5B 005B 5B U+005B LEFT SQUARE BRACKET
+5C 005C 5C U+005C REVERSE SOLIDUS
+5D 005D 5D U+005D RIGHT SQUARE BRACKET
+5E 005E 5E U+005E CIRCUMFLEX ACCENT
+5F 005F 5F U+005F LOW LINE
+60 0060 60 U+0060 GRAVE ACCENT
+61 0061 61 U+0061 LATIN SMALL LETTER A
+62 0062 62 U+0062 LATIN SMALL LETTER B
+63 0063 63 U+0063 LATIN SMALL LETTER C
+64 0064 64 U+0064 LATIN SMALL LETTER D
+65 0065 65 U+0065 LATIN SMALL LETTER E
+66 0066 66 U+0066 LATIN SMALL LETTER F
+67 0067 67 U+0067 LATIN SMALL LETTER G
+68 0068 68 U+0068 LATIN SMALL LETTER H
+69 0069 69 U+0069 LATIN SMALL LETTER I
+6A 006A 6A U+006A LATIN SMALL LETTER J
+6B 006B 6B U+006B LATIN SMALL LETTER K
+6C 006C 6C U+006C LATIN SMALL LETTER L
+6D 006D 6D U+006D LATIN SMALL LETTER M
+6E 006E 6E U+006E LATIN SMALL LETTER N
+6F 006F 6F U+006F LATIN SMALL LETTER O
+70 0070 70 U+0070 LATIN SMALL LETTER P
+71 0071 71 U+0071 LATIN SMALL LETTER Q
+72 0072 72 U+0072 LATIN SMALL LETTER R
+73 0073 73 U+0073 LATIN SMALL LETTER S
+74 0074 74 U+0074 LATIN SMALL LETTER T
+75 0075 75 U+0075 LATIN SMALL LETTER U
+76 0076 76 U+0076 LATIN SMALL LETTER V
+77 0077 77 U+0077 LATIN SMALL LETTER W
+78 0078 78 U+0078 LATIN SMALL LETTER X
+79 0079 79 U+0079 LATIN SMALL LETTER Y
+7A 007A 7A U+007A LATIN SMALL LETTER Z
+7B 007B 7B U+007B LEFT CURLY BRACKET
+7C 007C 7C U+007C VERTICAL LINE
+7D 007D 7D U+007D RIGHT CURLY BRACKET
+7E 007E 7E U+007E TILDE
+7F 007F 7F U+007F DELETE
+8EA1 FF61 8EA1 U+FF61 HALFWIDTH IDEOGRAPHIC FULL STOP
+8EA2 FF62 8EA2 U+FF62 HALFWIDTH LEFT CORNER BRACKET
+8EA3 FF63 8EA3 U+FF63 HALFWIDTH RIGHT CORNER BRACKET
+8EA4 FF64 8EA4 U+FF64 HALFWIDTH IDEOGRAPHIC COMMA
+8EA5 FF65 8EA5 U+FF65 HALFWIDTH KATAKANA MIDDLE DOT
+8EA6 FF66 8EA6 U+FF66 HALFWIDTH KATAKANA LETTER WO
+8EA7 FF67 8EA7 U+FF67 HALFWIDTH KATAKANA LETTER SMALL A
+8EA8 FF68 8EA8 U+FF68 HALFWIDTH KATAKANA LETTER SMALL I
+8EA9 FF69 8EA9 U+FF69 HALFWIDTH KATAKANA LETTER SMALL U
+8EAA FF6A 8EAA U+FF6A HALFWIDTH KATAKANA LETTER SMALL E
+8EAB FF6B 8EAB U+FF6B HALFWIDTH KATAKANA LETTER SMALL O
+8EAC FF6C 8EAC U+FF6C HALFWIDTH KATAKANA LETTER SMALL YA
+8EAD FF6D 8EAD U+FF6D HALFWIDTH KATAKANA LETTER SMALL YU
+8EAE FF6E 8EAE U+FF6E HALFWIDTH KATAKANA LETTER SMALL YO
+8EAF FF6F 8EAF U+FF6F HALFWIDTH KATAKANA LETTER SMALL TU
+8EB0 FF70 8EB0 U+FF70 HALFWIDTH KATAKANA-HIRAGANA PROLONGED SOUND MARK
+8EB1 FF71 8EB1 U+FF71 HALFWIDTH KATAKANA LETTER A
+8EB2 FF72 8EB2 U+FF72 HALFWIDTH KATAKANA LETTER I
+8EB3 FF73 8EB3 U+FF73 HALFWIDTH KATAKANA LETTER U
+8EB4 FF74 8EB4 U+FF74 HALFWIDTH KATAKANA LETTER E
+8EB5 FF75 8EB5 U+FF75 HALFWIDTH KATAKANA LETTER O
+8EB6 FF76 8EB6 U+FF76 HALFWIDTH KATAKANA LETTER KA
+8EB7 FF77 8EB7 U+FF77 HALFWIDTH KATAKANA LETTER KI
+8EB8 FF78 8EB8 U+FF78 HALFWIDTH KATAKANA LETTER KU
+8EB9 FF79 8EB9 U+FF79 HALFWIDTH KATAKANA LETTER KE
+8EBA FF7A 8EBA U+FF7A HALFWIDTH KATAKANA LETTER KO
+8EBB FF7B 8EBB U+FF7B HALFWIDTH KATAKANA LETTER SA
+8EBC FF7C 8EBC U+FF7C HALFWIDTH KATAKANA LETTER SI
+8EBD FF7D 8EBD U+FF7D HALFWIDTH KATAKANA LETTER SU
+8EBE FF7E 8EBE U+FF7E HALFWIDTH KATAKANA LETTER SE
+8EBF FF7F 8EBF U+FF7F HALFWIDTH KATAKANA LETTER SO
+8EC0 FF80 8EC0 U+FF80 HALFWIDTH KATAKANA LETTER TA
+8EC1 FF81 8EC1 U+FF81 HALFWIDTH KATAKANA LETTER TI
+8EC2 FF82 8EC2 U+FF82 HALFWIDTH KATAKANA LETTER TU
+8EC3 FF83 8EC3 U+FF83 HALFWIDTH KATAKANA LETTER TE
+8EC4 FF84 8EC4 U+FF84 HALFWIDTH KATAKANA LETTER TO
+8EC5 FF85 8EC5 U+FF85 HALFWIDTH KATAKANA LETTER NA
+8EC6 FF86 8EC6 U+FF86 HALFWIDTH KATAKANA LETTER NI
+8EC7 FF87 8EC7 U+FF87 HALFWIDTH KATAKANA LETTER NU
+8EC8 FF88 8EC8 U+FF88 HALFWIDTH KATAKANA LETTER NE
+8EC9 FF89 8EC9 U+FF89 HALFWIDTH KATAKANA LETTER NO
+8ECA FF8A 8ECA U+FF8A HALFWIDTH KATAKANA LETTER HA
+8ECB FF8B 8ECB U+FF8B HALFWIDTH KATAKANA LETTER HI
+8ECC FF8C 8ECC U+FF8C HALFWIDTH KATAKANA LETTER HU
+8ECD FF8D 8ECD U+FF8D HALFWIDTH KATAKANA LETTER HE
+8ECE FF8E 8ECE U+FF8E HALFWIDTH KATAKANA LETTER HO
+8ECF FF8F 8ECF U+FF8F HALFWIDTH KATAKANA LETTER MA
+8ED0 FF90 8ED0 U+FF90 HALFWIDTH KATAKANA LETTER MI
+8ED1 FF91 8ED1 U+FF91 HALFWIDTH KATAKANA LETTER MU
+8ED2 FF92 8ED2 U+FF92 HALFWIDTH KATAKANA LETTER ME
+8ED3 FF93 8ED3 U+FF93 HALFWIDTH KATAKANA LETTER MO
+8ED4 FF94 8ED4 U+FF94 HALFWIDTH KATAKANA LETTER YA
+8ED5 FF95 8ED5 U+FF95 HALFWIDTH KATAKANA LETTER YU
+8ED6 FF96 8ED6 U+FF96 HALFWIDTH KATAKANA LETTER YO
+8ED7 FF97 8ED7 U+FF97 HALFWIDTH KATAKANA LETTER RA
+8ED8 FF98 8ED8 U+FF98 HALFWIDTH KATAKANA LETTER RI
+8ED9 FF99 8ED9 U+FF99 HALFWIDTH KATAKANA LETTER RU
+8EDA FF9A 8EDA U+FF9A HALFWIDTH KATAKANA LETTER RE
+8EDB FF9B 8EDB U+FF9B HALFWIDTH KATAKANA LETTER RO
+8EDC FF9C 8EDC U+FF9C HALFWIDTH KATAKANA LETTER WA
+8EDD FF9D 8EDD U+FF9D HALFWIDTH KATAKANA LETTER N
+8EDE FF9E 8EDE U+FF9E HALFWIDTH KATAKANA VOICED SOUND MARK
+8EDF FF9F 8EDF U+FF9F HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK
+8FA2AF 02D8 8FA2AF U+02D8 BREVE
+8FA2B0 02C7 8FA2B0 U+02C7 CARON (Mandarin Chinese third tone)
+8FA2B1 00B8 8FA2B1 U+00B8 CEDILLA
+8FA2B2 02D9 8FA2B2 U+02D9 DOT ABOVE (Mandarin Chinese light tone)
+8FA2B3 02DD 8FA2B3 U+02DD DOUBLE ACUTE ACCENT
+8FA2B4 00AF 8FA2B4 U+00AF MACRON
+8FA2B5 02DB 8FA2B5 U+02DB OGONEK
+8FA2B6 02DA 8FA2B6 U+02DA RING ABOVE
+8FA2B8 0384 8FA2B8 U+0384 GREEK TONOS
+8FA2B9 0385 8FA2B9 U+0385 GREEK DIALYTIKA TONOS
+8FA2C2 00A1 8FA2C2 U+00A1 INVERTED EXCLAMATION MARK
+8FA2C3 00A6 8FA2C3 U+00A6 BROKEN BAR
+8FA2C4 00BF 8FA2C4 U+00BF INVERTED QUESTION MARK
+8FA2EB 00BA 8FA2EB U+00BA MASCULINE ORDINAL INDICATOR
+8FA2EC 00AA 8FA2EC U+00AA FEMININE ORDINAL INDICATOR
+8FA2ED 00A9 8FA2ED U+00A9 COPYRIGHT SIGN
+8FA2EE 00AE 8FA2EE U+00AE REGISTERED SIGN
+8FA2EF 2122 8FA2EF U+2122 TRADE MARK SIGN
+8FA2F0 00A4 8FA2F0 U+00A4 CURRENCY SIGN
+8FA2F1 2116 8FA2F1 U+2116 NUMERO SIGN
+8FA6E1 0386 8FA6E1 U+0386 GREEK CAPITAL LETTER ALPHA WITH TONOS
+8FA6E2 0388 8FA6E2 U+0388 GREEK CAPITAL LETTER EPSILON WITH TONOS
+8FA6E3 0389 8FA6E3 U+0389 GREEK CAPITAL LETTER ETA WITH TONOS
+8FA6E4 038A 8FA6E4 U+038A GREEK CAPITAL LETTER IOTA WITH TONOS
+8FA6E5 03AA 8FA6E5 U+03AA GREEK CAPITAL LETTER IOTA WITH DIALYTIKA
+8FA6E7 038C 8FA6E7 U+038C GREEK CAPITAL LETTER OMICRON WITH TONOS
+8FA6E9 038E 8FA6E9 U+038E GREEK CAPITAL LETTER UPSILON WITH TONOS
+8FA6EA 03AB 8FA6EA U+03AB GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA
+8FA6EC 038F 8FA6EC U+038F GREEK CAPITAL LETTER OMEGA WITH TONOS
+8FA6F1 03AC 8FA6F1 U+03AC GREEK SMALL LETTER ALPHA WITH TONOS
+8FA6F2 03AD 8FA6F2 U+03AD GREEK SMALL LETTER EPSILON WITH TONOS
+8FA6F3 03AE 8FA6F3 U+03AE GREEK SMALL LETTER ETA WITH TONOS
+8FA6F4 03AF 8FA6F4 U+03AF GREEK SMALL LETTER IOTA WITH TONOS
+8FA6F5 03CA 8FA6F5 U+03CA GREEK SMALL LETTER IOTA WITH DIALYTIKA
+8FA6F6 0390 8FA6F6 U+0390 GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
+8FA6F7 03CC 8FA6F7 U+03CC GREEK SMALL LETTER OMICRON WITH TONOS
+8FA6F8 03C2 8FA6F8 U+03C2 GREEK SMALL LETTER FINAL SIGMA
+8FA6F9 03CD 8FA6F9 U+03CD GREEK SMALL LETTER UPSILON WITH TONOS
+8FA6FA 03CB 8FA6FA U+03CB GREEK SMALL LETTER UPSILON WITH DIALYTIKA
+8FA6FB 03B0 8FA6FB U+03B0 GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
+8FA6FC 03CE 8FA6FC U+03CE GREEK SMALL LETTER OMEGA WITH TONOS
+8FA7C2 0402 8FA7C2 U+0402 CYRILLIC CAPITAL LETTER DJE
+8FA7C3 0403 8FA7C3 U+0403 CYRILLIC CAPITAL LETTER GJE
+8FA7C4 0404 8FA7C4 U+0404 CYRILLIC CAPITAL LETTER UKRAINIAN IE
+8FA7C5 0405 8FA7C5 U+0405 CYRILLIC CAPITAL LETTER DZE
+8FA7C6 0406 8FA7C6 U+0406 CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
+8FA7C7 0407 8FA7C7 U+0407 CYRILLIC CAPITAL LETTER YI
+8FA7C8 0408 8FA7C8 U+0408 CYRILLIC CAPITAL LETTER JE
+8FA7C9 0409 8FA7C9 U+0409 CYRILLIC CAPITAL LETTER LJE
+8FA7CA 040A 8FA7CA U+040A CYRILLIC CAPITAL LETTER NJE
+8FA7CB 040B 8FA7CB U+040B CYRILLIC CAPITAL LETTER TSHE
+8FA7CC 040C 8FA7CC U+040C CYRILLIC CAPITAL LETTER KJE
+8FA7CD 040E 8FA7CD U+040E CYRILLIC CAPITAL LETTER SHORT U
+8FA7CE 040F 8FA7CE U+040F CYRILLIC CAPITAL LETTER DZHE
+8FA7F2 0452 8FA7F2 U+0452 CYRILLIC SMALL LETTER DJE
+8FA7F3 0453 8FA7F3 U+0453 CYRILLIC SMALL LETTER GJE
+8FA7F4 0454 8FA7F4 U+0454 CYRILLIC SMALL LETTER UKRAINIAN IE
+8FA7F5 0455 8FA7F5 U+0455 CYRILLIC SMALL LETTER DZE
+8FA7F6 0456 8FA7F6 U+0456 CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
+8FA7F7 0457 8FA7F7 U+0457 CYRILLIC SMALL LETTER YI
+8FA7F8 0458 8FA7F8 U+0458 CYRILLIC SMALL LETTER JE
+8FA7F9 0459 8FA7F9 U+0459 CYRILLIC SMALL LETTER LJE
+8FA7FA 045A 8FA7FA U+045A CYRILLIC SMALL LETTER NJE
+8FA7FB 045B 8FA7FB U+045B CYRILLIC SMALL LETTER TSHE
+8FA7FC 045C 8FA7FC U+045C CYRILLIC SMALL LETTER KJE
+8FA7FD 045E 8FA7FD U+045E CYRILLIC SMALL LETTER SHORT U
+8FA7FE 045F 8FA7FE U+045F CYRILLIC SMALL LETTER DZHE
+8FA9A1 00C6 8FA9A1 U+00C6 LATIN CAPITAL LIGATURE AE
+8FA9A2 0110 8FA9A2 U+0110 LATIN CAPITAL LETTER D WITH STROKE
+8FA9A4 0126 8FA9A4 U+0126 LATIN CAPITAL LETTER H WITH STROKE
+8FA9A6 0132 8FA9A6 U+0132 LATIN CAPITAL LIGATURE IJ
+8FA9A8 0141 8FA9A8 U+0141 LATIN CAPITAL LETTER L WITH STROKE
+8FA9A9 013F 8FA9A9 U+013F LATIN CAPITAL LETTER L WITH MIDDLE DOT
+8FA9AB 014A 8FA9AB U+014A LATIN CAPITAL LETTER ENG
+8FA9AC 00D8 8FA9AC U+00D8 LATIN CAPITAL LETTER O WITH STROKE
+8FA9AD 0152 8FA9AD U+0152 LATIN CAPITAL LIGATURE OE
+8FA9AF 0166 8FA9AF U+0166 LATIN CAPITAL LETTER T WITH STROKE
+8FA9B0 00DE 8FA9B0 U+00DE LATIN CAPITAL LETTER THORN
+8FA9C1 00E6 8FA9C1 U+00E6 LATIN SMALL LIGATURE AE
+8FA9C2 0111 8FA9C2 U+0111 LATIN SMALL LETTER D WITH STROKE
+8FA9C3 00F0 8FA9C3 U+00F0 LATIN SMALL LETTER ETH
+8FA9C4 0127 8FA9C4 U+0127 LATIN SMALL LETTER H WITH STROKE
+8FA9C5 0131 8FA9C5 U+0131 LATIN SMALL LETTER DOTLESS I
+8FA9C6 0133 8FA9C6 U+0133 LATIN SMALL LIGATURE IJ
+8FA9C7 0138 8FA9C7 U+0138 LATIN SMALL LETTER KRA
+8FA9C8 0142 8FA9C8 U+0142 LATIN SMALL LETTER L WITH STROKE
+8FA9C9 0140 8FA9C9 U+0140 LATIN SMALL LETTER L WITH MIDDLE DOT
+8FA9CA 0149 8FA9CA U+0149 LATIN SMALL LETTER N PRECEDED BY APOSTROPHE
+8FA9CB 014B 8FA9CB U+014B LATIN SMALL LETTER ENG
+8FA9CC 00F8 8FA9CC U+00F8 LATIN SMALL LETTER O WITH STROKE
+8FA9CD 0153 8FA9CD U+0153 LATIN SMALL LIGATURE OE
+8FA9CE 00DF 8FA9CE U+00DF LATIN SMALL LETTER SHARP S
+8FA9CF 0167 8FA9CF U+0167 LATIN SMALL LETTER T WITH STROKE
+8FA9D0 00FE 8FA9D0 U+00FE LATIN SMALL LETTER THORN
+8FAAA1 00C1 8FAAA1 U+00C1 LATIN CAPITAL LETTER A WITH ACUTE
+8FAAA2 00C0 8FAAA2 U+00C0 LATIN CAPITAL LETTER A WITH GRAVE
+8FAAA3 00C4 8FAAA3 U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS
+8FAAA4 00C2 8FAAA4 U+00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+8FAAA5 0102 8FAAA5 U+0102 LATIN CAPITAL LETTER A WITH BREVE
+8FAAA6 01CD 8FAAA6 U+01CD LATIN CAPITAL LETTER A WITH CARON
+8FAAA7 0100 8FAAA7 U+0100 LATIN CAPITAL LETTER A WITH MACRON
+8FAAA8 0104 8FAAA8 U+0104 LATIN CAPITAL LETTER A WITH OGONEK
+8FAAA9 00C5 8FAAA9 U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE
+8FAAAA 00C3 8FAAAA U+00C3 LATIN CAPITAL LETTER A WITH TILDE
+8FAAAB 0106 8FAAAB U+0106 LATIN CAPITAL LETTER C WITH ACUTE
+8FAAAC 0108 8FAAAC U+0108 LATIN CAPITAL LETTER C WITH CIRCUMFLEX
+8FAAAD 010C 8FAAAD U+010C LATIN CAPITAL LETTER C WITH CARON
+8FAAAE 00C7 8FAAAE U+00C7 LATIN CAPITAL LETTER C WITH CEDILLA
+8FAAAF 010A 8FAAAF U+010A LATIN CAPITAL LETTER C WITH DOT ABOVE
+8FAAB0 010E 8FAAB0 U+010E LATIN CAPITAL LETTER D WITH CARON
+8FAAB1 00C9 8FAAB1 U+00C9 LATIN CAPITAL LETTER E WITH ACUTE
+8FAAB2 00C8 8FAAB2 U+00C8 LATIN CAPITAL LETTER E WITH GRAVE
+8FAAB3 00CB 8FAAB3 U+00CB LATIN CAPITAL LETTER E WITH DIAERESIS
+8FAAB4 00CA 8FAAB4 U+00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+8FAAB5 011A 8FAAB5 U+011A LATIN CAPITAL LETTER E WITH CARON
+8FAAB6 0116 8FAAB6 U+0116 LATIN CAPITAL LETTER E WITH DOT ABOVE
+8FAAB7 0112 8FAAB7 U+0112 LATIN CAPITAL LETTER E WITH MACRON
+8FAAB8 0118 8FAAB8 U+0118 LATIN CAPITAL LETTER E WITH OGONEK
+8FAABA 011C 8FAABA U+011C LATIN CAPITAL LETTER G WITH CIRCUMFLEX
+8FAABB 011E 8FAABB U+011E LATIN CAPITAL LETTER G WITH BREVE
+8FAABC 0122 8FAABC U+0122 LATIN CAPITAL LETTER G WITH CEDILLA
+8FAABD 0120 8FAABD U+0120 LATIN CAPITAL LETTER G WITH DOT ABOVE
+8FAABE 0124 8FAABE U+0124 LATIN CAPITAL LETTER H WITH CIRCUMFLEX
+8FAABF 00CD 8FAABF U+00CD LATIN CAPITAL LETTER I WITH ACUTE
+8FAAC0 00CC 8FAAC0 U+00CC LATIN CAPITAL LETTER I WITH GRAVE
+8FAAC1 00CF 8FAAC1 U+00CF LATIN CAPITAL LETTER I WITH DIAERESIS
+8FAAC2 00CE 8FAAC2 U+00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+8FAAC3 01CF 8FAAC3 U+01CF LATIN CAPITAL LETTER I WITH CARON
+8FAAC4 0130 8FAAC4 U+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE
+8FAAC5 012A 8FAAC5 U+012A LATIN CAPITAL LETTER I WITH MACRON
+8FAAC6 012E 8FAAC6 U+012E LATIN CAPITAL LETTER I WITH OGONEK
+8FAAC7 0128 8FAAC7 U+0128 LATIN CAPITAL LETTER I WITH TILDE
+8FAAC8 0134 8FAAC8 U+0134 LATIN CAPITAL LETTER J WITH CIRCUMFLEX
+8FAAC9 0136 8FAAC9 U+0136 LATIN CAPITAL LETTER K WITH CEDILLA
+8FAACA 0139 8FAACA U+0139 LATIN CAPITAL LETTER L WITH ACUTE
+8FAACB 013D 8FAACB U+013D LATIN CAPITAL LETTER L WITH CARON
+8FAACC 013B 8FAACC U+013B LATIN CAPITAL LETTER L WITH CEDILLA
+8FAACD 0143 8FAACD U+0143 LATIN CAPITAL LETTER N WITH ACUTE
+8FAACE 0147 8FAACE U+0147 LATIN CAPITAL LETTER N WITH CARON
+8FAACF 0145 8FAACF U+0145 LATIN CAPITAL LETTER N WITH CEDILLA
+8FAAD0 00D1 8FAAD0 U+00D1 LATIN CAPITAL LETTER N WITH TILDE
+8FAAD1 00D3 8FAAD1 U+00D3 LATIN CAPITAL LETTER O WITH ACUTE
+8FAAD2 00D2 8FAAD2 U+00D2 LATIN CAPITAL LETTER O WITH GRAVE
+8FAAD3 00D6 8FAAD3 U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS
+8FAAD4 00D4 8FAAD4 U+00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+8FAAD5 01D1 8FAAD5 U+01D1 LATIN CAPITAL LETTER O WITH CARON
+8FAAD6 0150 8FAAD6 U+0150 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
+8FAAD7 014C 8FAAD7 U+014C LATIN CAPITAL LETTER O WITH MACRON
+8FAAD8 00D5 8FAAD8 U+00D5 LATIN CAPITAL LETTER O WITH TILDE
+8FAAD9 0154 8FAAD9 U+0154 LATIN CAPITAL LETTER R WITH ACUTE
+8FAADA 0158 8FAADA U+0158 LATIN CAPITAL LETTER R WITH CARON
+8FAADB 0156 8FAADB U+0156 LATIN CAPITAL LETTER R WITH CEDILLA
+8FAADC 015A 8FAADC U+015A LATIN CAPITAL LETTER S WITH ACUTE
+8FAADD 015C 8FAADD U+015C LATIN CAPITAL LETTER S WITH CIRCUMFLEX
+8FAADE 0160 8FAADE U+0160 LATIN CAPITAL LETTER S WITH CARON
+8FAADF 015E 8FAADF U+015E LATIN CAPITAL LETTER S WITH CEDILLA
+8FAAE0 0164 8FAAE0 U+0164 LATIN CAPITAL LETTER T WITH CARON
+8FAAE1 0162 8FAAE1 U+0162 LATIN CAPITAL LETTER T WITH CEDILLA
+8FAAE2 00DA 8FAAE2 U+00DA LATIN CAPITAL LETTER U WITH ACUTE
+8FAAE3 00D9 8FAAE3 U+00D9 LATIN CAPITAL LETTER U WITH GRAVE
+8FAAE4 00DC 8FAAE4 U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS
+8FAAE5 00DB 8FAAE5 U+00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+8FAAE6 016C 8FAAE6 U+016C LATIN CAPITAL LETTER U WITH BREVE
+8FAAE7 01D3 8FAAE7 U+01D3 LATIN CAPITAL LETTER U WITH CARON
+8FAAE8 0170 8FAAE8 U+0170 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
+8FAAE9 016A 8FAAE9 U+016A LATIN CAPITAL LETTER U WITH MACRON
+8FAAEA 0172 8FAAEA U+0172 LATIN CAPITAL LETTER U WITH OGONEK
+8FAAEB 016E 8FAAEB U+016E LATIN CAPITAL LETTER U WITH RING ABOVE
+8FAAEC 0168 8FAAEC U+0168 LATIN CAPITAL LETTER U WITH TILDE
+8FAAED 01D7 8FAAED U+01D7 LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
+8FAAEE 01DB 8FAAEE U+01DB LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE
+8FAAEF 01D9 8FAAEF U+01D9 LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON
+8FAAF0 01D5 8FAAF0 U+01D5 LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON
+8FAAF1 0174 8FAAF1 U+0174 LATIN CAPITAL LETTER W WITH CIRCUMFLEX
+8FAAF2 00DD 8FAAF2 U+00DD LATIN CAPITAL LETTER Y WITH ACUTE
+8FAAF3 0178 8FAAF3 U+0178 LATIN CAPITAL LETTER Y WITH DIAERESIS
+8FAAF4 0176 8FAAF4 U+0176 LATIN CAPITAL LETTER Y WITH CIRCUMFLEX
+8FAAF5 0179 8FAAF5 U+0179 LATIN CAPITAL LETTER Z WITH ACUTE
+8FAAF6 017D 8FAAF6 U+017D LATIN CAPITAL LETTER Z WITH CARON
+8FAAF7 017B 8FAAF7 U+017B LATIN CAPITAL LETTER Z WITH DOT ABOVE
+8FABA1 00E1 8FABA1 U+00E1 LATIN SMALL LETTER A WITH ACUTE
+8FABA2 00E0 8FABA2 U+00E0 LATIN SMALL LETTER A WITH GRAVE
+8FABA3 00E4 8FABA3 U+00E4 LATIN SMALL LETTER A WITH DIAERESIS
+8FABA4 00E2 8FABA4 U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX
+8FABA5 0103 8FABA5 U+0103 LATIN SMALL LETTER A WITH BREVE
+8FABA6 01CE 8FABA6 U+01CE LATIN SMALL LETTER A WITH CARON
+8FABA7 0101 8FABA7 U+0101 LATIN SMALL LETTER A WITH MACRON
+8FABA8 0105 8FABA8 U+0105 LATIN SMALL LETTER A WITH OGONEK
+8FABA9 00E5 8FABA9 U+00E5 LATIN SMALL LETTER A WITH RING ABOVE
+8FABAA 00E3 8FABAA U+00E3 LATIN SMALL LETTER A WITH TILDE
+8FABAB 0107 8FABAB U+0107 LATIN SMALL LETTER C WITH ACUTE
+8FABAC 0109 8FABAC U+0109 LATIN SMALL LETTER C WITH CIRCUMFLEX
+8FABAD 010D 8FABAD U+010D LATIN SMALL LETTER C WITH CARON
+8FABAE 00E7 8FABAE U+00E7 LATIN SMALL LETTER C WITH CEDILLA
+8FABAF 010B 8FABAF U+010B LATIN SMALL LETTER C WITH DOT ABOVE
+8FABB0 010F 8FABB0 U+010F LATIN SMALL LETTER D WITH CARON
+8FABB1 00E9 8FABB1 U+00E9 LATIN SMALL LETTER E WITH ACUTE
+8FABB2 00E8 8FABB2 U+00E8 LATIN SMALL LETTER E WITH GRAVE
+8FABB3 00EB 8FABB3 U+00EB LATIN SMALL LETTER E WITH DIAERESIS
+8FABB4 00EA 8FABB4 U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX
+8FABB5 011B 8FABB5 U+011B LATIN SMALL LETTER E WITH CARON
+8FABB6 0117 8FABB6 U+0117 LATIN SMALL LETTER E WITH DOT ABOVE
+8FABB7 0113 8FABB7 U+0113 LATIN SMALL LETTER E WITH MACRON
+8FABB8 0119 8FABB8 U+0119 LATIN SMALL LETTER E WITH OGONEK
+8FABB9 01F5 8FABB9 U+01F5 LATIN SMALL LETTER G WITH ACUTE
+8FABBA 011D 8FABBA U+011D LATIN SMALL LETTER G WITH CIRCUMFLEX
+8FABBB 011F 8FABBB U+011F LATIN SMALL LETTER G WITH BREVE
+8FABBD 0121 8FABBD U+0121 LATIN SMALL LETTER G WITH DOT ABOVE
+8FABBE 0125 8FABBE U+0125 LATIN SMALL LETTER H WITH CIRCUMFLEX
+8FABBF 00ED 8FABBF U+00ED LATIN SMALL LETTER I WITH ACUTE
+8FABC0 00EC 8FABC0 U+00EC LATIN SMALL LETTER I WITH GRAVE
+8FABC1 00EF 8FABC1 U+00EF LATIN SMALL LETTER I WITH DIAERESIS
+8FABC2 00EE 8FABC2 U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX
+8FABC3 01D0 8FABC3 U+01D0 LATIN SMALL LETTER I WITH CARON
+8FABC5 012B 8FABC5 U+012B LATIN SMALL LETTER I WITH MACRON
+8FABC6 012F 8FABC6 U+012F LATIN SMALL LETTER I WITH OGONEK
+8FABC7 0129 8FABC7 U+0129 LATIN SMALL LETTER I WITH TILDE
+8FABC8 0135 8FABC8 U+0135 LATIN SMALL LETTER J WITH CIRCUMFLEX
+8FABC9 0137 8FABC9 U+0137 LATIN SMALL LETTER K WITH CEDILLA
+8FABCA 013A 8FABCA U+013A LATIN SMALL LETTER L WITH ACUTE
+8FABCB 013E 8FABCB U+013E LATIN SMALL LETTER L WITH CARON
+8FABCC 013C 8FABCC U+013C LATIN SMALL LETTER L WITH CEDILLA
+8FABCD 0144 8FABCD U+0144 LATIN SMALL LETTER N WITH ACUTE
+8FABCE 0148 8FABCE U+0148 LATIN SMALL LETTER N WITH CARON
+8FABCF 0146 8FABCF U+0146 LATIN SMALL LETTER N WITH CEDILLA
+8FABD0 00F1 8FABD0 U+00F1 LATIN SMALL LETTER N WITH TILDE
+8FABD1 00F3 8FABD1 U+00F3 LATIN SMALL LETTER O WITH ACUTE
+8FABD2 00F2 8FABD2 U+00F2 LATIN SMALL LETTER O WITH GRAVE
+8FABD3 00F6 8FABD3 U+00F6 LATIN SMALL LETTER O WITH DIAERESIS
+8FABD4 00F4 8FABD4 U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX
+8FABD5 01D2 8FABD5 U+01D2 LATIN SMALL LETTER O WITH CARON
+8FABD6 0151 8FABD6 U+0151 LATIN SMALL LETTER O WITH DOUBLE ACUTE
+8FABD7 014D 8FABD7 U+014D LATIN SMALL LETTER O WITH MACRON
+8FABD8 00F5 8FABD8 U+00F5 LATIN SMALL LETTER O WITH TILDE
+8FABD9 0155 8FABD9 U+0155 LATIN SMALL LETTER R WITH ACUTE
+8FABDA 0159 8FABDA U+0159 LATIN SMALL LETTER R WITH CARON
+8FABDB 0157 8FABDB U+0157 LATIN SMALL LETTER R WITH CEDILLA
+8FABDC 015B 8FABDC U+015B LATIN SMALL LETTER S WITH ACUTE
+8FABDD 015D 8FABDD U+015D LATIN SMALL LETTER S WITH CIRCUMFLEX
+8FABDE 0161 8FABDE U+0161 LATIN SMALL LETTER S WITH CARON
+8FABDF 015F 8FABDF U+015F LATIN SMALL LETTER S WITH CEDILLA
+8FABE0 0165 8FABE0 U+0165 LATIN SMALL LETTER T WITH CARON
+8FABE1 0163 8FABE1 U+0163 LATIN SMALL LETTER T WITH CEDILLA
+8FABE2 00FA 8FABE2 U+00FA LATIN SMALL LETTER U WITH ACUTE
+8FABE3 00F9 8FABE3 U+00F9 LATIN SMALL LETTER U WITH GRAVE
+8FABE4 00FC 8FABE4 U+00FC LATIN SMALL LETTER U WITH DIAERESIS
+8FABE5 00FB 8FABE5 U+00FB LATIN SMALL LETTER U WITH CIRCUMFLEX
+8FABE6 016D 8FABE6 U+016D LATIN SMALL LETTER U WITH BREVE
+8FABE7 01D4 8FABE7 U+01D4 LATIN SMALL LETTER U WITH CARON
+8FABE8 0171 8FABE8 U+0171 LATIN SMALL LETTER U WITH DOUBLE ACUTE
+8FABE9 016B 8FABE9 U+016B LATIN SMALL LETTER U WITH MACRON
+8FABEA 0173 8FABEA U+0173 LATIN SMALL LETTER U WITH OGONEK
+8FABEB 016F 8FABEB U+016F LATIN SMALL LETTER U WITH RING ABOVE
+8FABEC 0169 8FABEC U+0169 LATIN SMALL LETTER U WITH TILDE
+8FABED 01D8 8FABED U+01D8 LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
+8FABEE 01DC 8FABEE U+01DC LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE
+8FABEF 01DA 8FABEF U+01DA LATIN SMALL LETTER U WITH DIAERESIS AND CARON
+8FABF0 01D6 8FABF0 U+01D6 LATIN SMALL LETTER U WITH DIAERESIS AND MACRON
+8FABF1 0175 8FABF1 U+0175 LATIN SMALL LETTER W WITH CIRCUMFLEX
+8FABF2 00FD 8FABF2 U+00FD LATIN SMALL LETTER Y WITH ACUTE
+8FABF3 00FF 8FABF3 U+00FF LATIN SMALL LETTER Y WITH DIAERESIS
+8FABF4 0177 8FABF4 U+0177 LATIN SMALL LETTER Y WITH CIRCUMFLEX
+8FABF5 017A 8FABF5 U+017A LATIN SMALL LETTER Z WITH ACUTE
+8FABF6 017E 8FABF6 U+017E LATIN SMALL LETTER Z WITH CARON
+8FABF7 017C 8FABF7 U+017C LATIN SMALL LETTER Z WITH DOT ABOVE
+8FB0A1 4E02 8FB0A1 <CJK>
+8FB0A2 4E04 8FB0A2 <CJK>
+8FB0A3 4E05 8FB0A3 <CJK>
+8FB0A4 4E0C 8FB0A4 <CJK>
+8FB0A5 4E12 8FB0A5 <CJK>
+8FB0A6 4E1F 8FB0A6 <CJK>
+8FB0A7 4E23 8FB0A7 <CJK>
+8FB0A8 4E24 8FB0A8 <CJK>
+8FB0A9 4E28 8FB0A9 <CJK>
+8FB0AA 4E2B 8FB0AA <CJK>
+8FB0AB 4E2E 8FB0AB <CJK>
+8FB0AC 4E2F 8FB0AC <CJK>
+8FB0AD 4E30 8FB0AD <CJK>
+8FB0AE 4E35 8FB0AE <CJK>
+8FB0AF 4E40 8FB0AF <CJK>
+8FB0B0 4E41 8FB0B0 <CJK>
+8FB0B1 4E44 8FB0B1 <CJK>
+8FB0B2 4E47 8FB0B2 <CJK>
+8FB0B3 4E51 8FB0B3 <CJK>
+8FB0B4 4E5A 8FB0B4 <CJK>
+8FB0B5 4E5C 8FB0B5 <CJK>
+8FB0B6 4E63 8FB0B6 <CJK>
+8FB0B7 4E68 8FB0B7 <CJK>
+8FB0B8 4E69 8FB0B8 <CJK>
+8FB0B9 4E74 8FB0B9 <CJK>
+8FB0BA 4E75 8FB0BA <CJK>
+8FB0BB 4E79 8FB0BB <CJK>
+8FB0BC 4E7F 8FB0BC <CJK>
+8FB0BD 4E8D 8FB0BD <CJK>
+8FB0BE 4E96 8FB0BE <CJK>
+8FB0BF 4E97 8FB0BF <CJK>
+8FB0C0 4E9D 8FB0C0 <CJK>
+8FB0C1 4EAF 8FB0C1 <CJK>
+8FB0C2 4EB9 8FB0C2 <CJK>
+8FB0C3 4EC3 8FB0C3 <CJK>
+8FB0C4 4ED0 8FB0C4 <CJK>
+8FB0C5 4EDA 8FB0C5 <CJK>
+8FB0C6 4EDB 8FB0C6 <CJK>
+8FB0C7 4EE0 8FB0C7 <CJK>
+8FB0C8 4EE1 8FB0C8 <CJK>
+8FB0C9 4EE2 8FB0C9 <CJK>
+8FB0CA 4EE8 8FB0CA <CJK>
+8FB0CB 4EEF 8FB0CB <CJK>
+8FB0CC 4EF1 8FB0CC <CJK>
+8FB0CD 4EF3 8FB0CD <CJK>
+8FB0CE 4EF5 8FB0CE <CJK>
+8FB0CF 4EFD 8FB0CF <CJK>
+8FB0D0 4EFE 8FB0D0 <CJK>
+8FB0D1 4EFF 8FB0D1 <CJK>
+8FB0D2 4F00 8FB0D2 <CJK>
+8FB0D3 4F02 8FB0D3 <CJK>
+8FB0D4 4F03 8FB0D4 <CJK>
+8FB0D5 4F08 8FB0D5 <CJK>
+8FB0D6 4F0B 8FB0D6 <CJK>
+8FB0D7 4F0C 8FB0D7 <CJK>
+8FB0D8 4F12 8FB0D8 <CJK>
+8FB0D9 4F15 8FB0D9 <CJK>
+8FB0DA 4F16 8FB0DA <CJK>
+8FB0DB 4F17 8FB0DB <CJK>
+8FB0DC 4F19 8FB0DC <CJK>
+8FB0DD 4F2E 8FB0DD <CJK>
+8FB0DE 4F31 8FB0DE <CJK>
+8FB0DF 4F60 8FB0DF <CJK>
+8FB0E0 4F33 8FB0E0 <CJK>
+8FB0E1 4F35 8FB0E1 <CJK>
+8FB0E2 4F37 8FB0E2 <CJK>
+8FB0E3 4F39 8FB0E3 <CJK>
+8FB0E4 4F3B 8FB0E4 <CJK>
+8FB0E5 4F3E 8FB0E5 <CJK>
+8FB0E6 4F40 8FB0E6 <CJK>
+8FB0E7 4F42 8FB0E7 <CJK>
+8FB0E8 4F48 8FB0E8 <CJK>
+8FB0E9 4F49 8FB0E9 <CJK>
+8FB0EA 4F4B 8FB0EA <CJK>
+8FB0EB 4F4C 8FB0EB <CJK>
+8FB0EC 4F52 8FB0EC <CJK>
+8FB0ED 4F54 8FB0ED <CJK>
+8FB0EE 4F56 8FB0EE <CJK>
+8FB0EF 4F58 8FB0EF <CJK>
+8FB0F0 4F5F 8FB0F0 <CJK>
+8FB0F1 4F63 8FB0F1 <CJK>
+8FB0F2 4F6A 8FB0F2 <CJK>
+8FB0F3 4F6C 8FB0F3 <CJK>
+8FB0F4 4F6E 8FB0F4 <CJK>
+8FB0F5 4F71 8FB0F5 <CJK>
+8FB0F6 4F77 8FB0F6 <CJK>
+8FB0F7 4F78 8FB0F7 <CJK>
+8FB0F8 4F79 8FB0F8 <CJK>
+8FB0F9 4F7A 8FB0F9 <CJK>
+8FB0FA 4F7D 8FB0FA <CJK>
+8FB0FB 4F7E 8FB0FB <CJK>
+8FB0FC 4F81 8FB0FC <CJK>
+8FB0FD 4F82 8FB0FD <CJK>
+8FB0FE 4F84 8FB0FE <CJK>
+8FB1A1 4F85 8FB1A1 <CJK>
+8FB1A2 4F89 8FB1A2 <CJK>
+8FB1A3 4F8A 8FB1A3 <CJK>
+8FB1A4 4F8C 8FB1A4 <CJK>
+8FB1A5 4F8E 8FB1A5 <CJK>
+8FB1A6 4F90 8FB1A6 <CJK>
+8FB1A7 4F92 8FB1A7 <CJK>
+8FB1A8 4F93 8FB1A8 <CJK>
+8FB1A9 4F94 8FB1A9 <CJK>
+8FB1AA 4F97 8FB1AA <CJK>
+8FB1AB 4F99 8FB1AB <CJK>
+8FB1AC 4F9A 8FB1AC <CJK>
+8FB1AD 4F9E 8FB1AD <CJK>
+8FB1AE 4F9F 8FB1AE <CJK>
+8FB1AF 4FB2 8FB1AF <CJK>
+8FB1B0 4FB7 8FB1B0 <CJK>
+8FB1B1 4FB9 8FB1B1 <CJK>
+8FB1B2 4FBB 8FB1B2 <CJK>
+8FB1B3 4FBC 8FB1B3 <CJK>
+8FB1B4 4FBD 8FB1B4 <CJK>
+8FB1B5 4FBE 8FB1B5 <CJK>
+8FB1B6 4FC0 8FB1B6 <CJK>
+8FB1B7 4FC1 8FB1B7 <CJK>
+8FB1B8 4FC5 8FB1B8 <CJK>
+8FB1B9 4FC6 8FB1B9 <CJK>
+8FB1BA 4FC8 8FB1BA <CJK>
+8FB1BB 4FC9 8FB1BB <CJK>
+8FB1BC 4FCB 8FB1BC <CJK>
+8FB1BD 4FCC 8FB1BD <CJK>
+8FB1BE 4FCD 8FB1BE <CJK>
+8FB1BF 4FCF 8FB1BF <CJK>
+8FB1C0 4FD2 8FB1C0 <CJK>
+8FB1C1 4FDC 8FB1C1 <CJK>
+8FB1C2 4FE0 8FB1C2 <CJK>
+8FB1C3 4FE2 8FB1C3 <CJK>
+8FB1C4 4FF0 8FB1C4 <CJK>
+8FB1C5 4FF2 8FB1C5 <CJK>
+8FB1C6 4FFC 8FB1C6 <CJK>
+8FB1C7 4FFD 8FB1C7 <CJK>
+8FB1C8 4FFF 8FB1C8 <CJK>
+8FB1C9 5000 8FB1C9 <CJK>
+8FB1CA 5001 8FB1CA <CJK>
+8FB1CB 5004 8FB1CB <CJK>
+8FB1CC 5007 8FB1CC <CJK>
+8FB1CD 500A 8FB1CD <CJK>
+8FB1CE 500C 8FB1CE <CJK>
+8FB1CF 500E 8FB1CF <CJK>
+8FB1D0 5010 8FB1D0 <CJK>
+8FB1D1 5013 8FB1D1 <CJK>
+8FB1D2 5017 8FB1D2 <CJK>
+8FB1D3 5018 8FB1D3 <CJK>
+8FB1D4 501B 8FB1D4 <CJK>
+8FB1D5 501C 8FB1D5 <CJK>
+8FB1D6 501D 8FB1D6 <CJK>
+8FB1D7 501E 8FB1D7 <CJK>
+8FB1D8 5022 8FB1D8 <CJK>
+8FB1D9 5027 8FB1D9 <CJK>
+8FB1DA 502E 8FB1DA <CJK>
+8FB1DB 5030 8FB1DB <CJK>
+8FB1DC 5032 8FB1DC <CJK>
+8FB1DD 5033 8FB1DD <CJK>
+8FB1DE 5035 8FB1DE <CJK>
+8FB1DF 5040 8FB1DF <CJK>
+8FB1E0 5041 8FB1E0 <CJK>
+8FB1E1 5042 8FB1E1 <CJK>
+8FB1E2 5045 8FB1E2 <CJK>
+8FB1E3 5046 8FB1E3 <CJK>
+8FB1E4 504A 8FB1E4 <CJK>
+8FB1E5 504C 8FB1E5 <CJK>
+8FB1E6 504E 8FB1E6 <CJK>
+8FB1E7 5051 8FB1E7 <CJK>
+8FB1E8 5052 8FB1E8 <CJK>
+8FB1E9 5053 8FB1E9 <CJK>
+8FB1EA 5057 8FB1EA <CJK>
+8FB1EB 5059 8FB1EB <CJK>
+8FB1EC 505F 8FB1EC <CJK>
+8FB1ED 5060 8FB1ED <CJK>
+8FB1EE 5062 8FB1EE <CJK>
+8FB1EF 5063 8FB1EF <CJK>
+8FB1F0 5066 8FB1F0 <CJK>
+8FB1F1 5067 8FB1F1 <CJK>
+8FB1F2 506A 8FB1F2 <CJK>
+8FB1F3 506D 8FB1F3 <CJK>
+8FB1F4 5070 8FB1F4 <CJK>
+8FB1F5 5071 8FB1F5 <CJK>
+8FB1F6 503B 8FB1F6 <CJK>
+8FB1F7 5081 8FB1F7 <CJK>
+8FB1F8 5083 8FB1F8 <CJK>
+8FB1F9 5084 8FB1F9 <CJK>
+8FB1FA 5086 8FB1FA <CJK>
+8FB1FB 508A 8FB1FB <CJK>
+8FB1FC 508E 8FB1FC <CJK>
+8FB1FD 508F 8FB1FD <CJK>
+8FB1FE 5090 8FB1FE <CJK>
+8FB2A1 5092 8FB2A1 <CJK>
+8FB2A2 5093 8FB2A2 <CJK>
+8FB2A3 5094 8FB2A3 <CJK>
+8FB2A4 5096 8FB2A4 <CJK>
+8FB2A5 509B 8FB2A5 <CJK>
+8FB2A6 509C 8FB2A6 <CJK>
+8FB2A7 509E 8FB2A7 <CJK>
+8FB2A8 509F 8FB2A8 <CJK>
+8FB2A9 50A0 8FB2A9 <CJK>
+8FB2AA 50A1 8FB2AA <CJK>
+8FB2AB 50A2 8FB2AB <CJK>
+8FB2AC 50AA 8FB2AC <CJK>
+8FB2AD 50AF 8FB2AD <CJK>
+8FB2AE 50B0 8FB2AE <CJK>
+8FB2AF 50B9 8FB2AF <CJK>
+8FB2B0 50BA 8FB2B0 <CJK>
+8FB2B1 50BD 8FB2B1 <CJK>
+8FB2B2 50C0 8FB2B2 <CJK>
+8FB2B3 50C3 8FB2B3 <CJK>
+8FB2B4 50C4 8FB2B4 <CJK>
+8FB2B5 50C7 8FB2B5 <CJK>
+8FB2B6 50CC 8FB2B6 <CJK>
+8FB2B7 50CE 8FB2B7 <CJK>
+8FB2B8 50D0 8FB2B8 <CJK>
+8FB2B9 50D3 8FB2B9 <CJK>
+8FB2BA 50D4 8FB2BA <CJK>
+8FB2BB 50D8 8FB2BB <CJK>
+8FB2BC 50DC 8FB2BC <CJK>
+8FB2BD 50DD 8FB2BD <CJK>
+8FB2BE 50DF 8FB2BE <CJK>
+8FB2BF 50E2 8FB2BF <CJK>
+8FB2C0 50E4 8FB2C0 <CJK>
+8FB2C1 50E6 8FB2C1 <CJK>
+8FB2C2 50E8 8FB2C2 <CJK>
+8FB2C3 50E9 8FB2C3 <CJK>
+8FB2C4 50EF 8FB2C4 <CJK>
+8FB2C5 50F1 8FB2C5 <CJK>
+8FB2C6 50F6 8FB2C6 <CJK>
+8FB2C7 50FA 8FB2C7 <CJK>
+8FB2C8 50FE 8FB2C8 <CJK>
+8FB2C9 5103 8FB2C9 <CJK>
+8FB2CA 5106 8FB2CA <CJK>
+8FB2CB 5107 8FB2CB <CJK>
+8FB2CC 5108 8FB2CC <CJK>
+8FB2CD 510B 8FB2CD <CJK>
+8FB2CE 510C 8FB2CE <CJK>
+8FB2CF 510D 8FB2CF <CJK>
+8FB2D0 510E 8FB2D0 <CJK>
+8FB2D1 50F2 8FB2D1 <CJK>
+8FB2D2 5110 8FB2D2 <CJK>
+8FB2D3 5117 8FB2D3 <CJK>
+8FB2D4 5119 8FB2D4 <CJK>
+8FB2D5 511B 8FB2D5 <CJK>
+8FB2D6 511C 8FB2D6 <CJK>
+8FB2D7 511D 8FB2D7 <CJK>
+8FB2D8 511E 8FB2D8 <CJK>
+8FB2D9 5123 8FB2D9 <CJK>
+8FB2DA 5127 8FB2DA <CJK>
+8FB2DB 5128 8FB2DB <CJK>
+8FB2DC 512C 8FB2DC <CJK>
+8FB2DD 512D 8FB2DD <CJK>
+8FB2DE 512F 8FB2DE <CJK>
+8FB2DF 5131 8FB2DF <CJK>
+8FB2E0 5133 8FB2E0 <CJK>
+8FB2E1 5134 8FB2E1 <CJK>
+8FB2E2 5135 8FB2E2 <CJK>
+8FB2E3 5138 8FB2E3 <CJK>
+8FB2E4 5139 8FB2E4 <CJK>
+8FB2E5 5142 8FB2E5 <CJK>
+8FB2E6 514A 8FB2E6 <CJK>
+8FB2E7 514F 8FB2E7 <CJK>
+8FB2E8 5153 8FB2E8 <CJK>
+8FB2E9 5155 8FB2E9 <CJK>
+8FB2EA 5157 8FB2EA <CJK>
+8FB2EB 5158 8FB2EB <CJK>
+8FB2EC 515F 8FB2EC <CJK>
+8FB2ED 5164 8FB2ED <CJK>
+8FB2EE 5166 8FB2EE <CJK>
+8FB2EF 517E 8FB2EF <CJK>
+8FB2F0 5183 8FB2F0 <CJK>
+8FB2F1 5184 8FB2F1 <CJK>
+8FB2F2 518B 8FB2F2 <CJK>
+8FB2F3 518E 8FB2F3 <CJK>
+8FB2F4 5198 8FB2F4 <CJK>
+8FB2F5 519D 8FB2F5 <CJK>
+8FB2F6 51A1 8FB2F6 <CJK>
+8FB2F7 51A3 8FB2F7 <CJK>
+8FB2F8 51AD 8FB2F8 <CJK>
+8FB2F9 51B8 8FB2F9 <CJK>
+8FB2FA 51BA 8FB2FA <CJK>
+8FB2FB 51BC 8FB2FB <CJK>
+8FB2FC 51BE 8FB2FC <CJK>
+8FB2FD 51BF 8FB2FD <CJK>
+8FB2FE 51C2 8FB2FE <CJK>
+8FB3A1 51C8 8FB3A1 <CJK>
+8FB3A2 51CF 8FB3A2 <CJK>
+8FB3A3 51D1 8FB3A3 <CJK>
+8FB3A4 51D2 8FB3A4 <CJK>
+8FB3A5 51D3 8FB3A5 <CJK>
+8FB3A6 51D5 8FB3A6 <CJK>
+8FB3A7 51D8 8FB3A7 <CJK>
+8FB3A8 51DE 8FB3A8 <CJK>
+8FB3A9 51E2 8FB3A9 <CJK>
+8FB3AA 51E5 8FB3AA <CJK>
+8FB3AB 51EE 8FB3AB <CJK>
+8FB3AC 51F2 8FB3AC <CJK>
+8FB3AD 51F3 8FB3AD <CJK>
+8FB3AE 51F4 8FB3AE <CJK>
+8FB3AF 51F7 8FB3AF <CJK>
+8FB3B0 5201 8FB3B0 <CJK>
+8FB3B1 5202 8FB3B1 <CJK>
+8FB3B2 5205 8FB3B2 <CJK>
+8FB3B3 5212 8FB3B3 <CJK>
+8FB3B4 5213 8FB3B4 <CJK>
+8FB3B5 5215 8FB3B5 <CJK>
+8FB3B6 5216 8FB3B6 <CJK>
+8FB3B7 5218 8FB3B7 <CJK>
+8FB3B8 5222 8FB3B8 <CJK>
+8FB3B9 5228 8FB3B9 <CJK>
+8FB3BA 5231 8FB3BA <CJK>
+8FB3BB 5232 8FB3BB <CJK>
+8FB3BC 5235 8FB3BC <CJK>
+8FB3BD 523C 8FB3BD <CJK>
+8FB3BE 5245 8FB3BE <CJK>
+8FB3BF 5249 8FB3BF <CJK>
+8FB3C0 5255 8FB3C0 <CJK>
+8FB3C1 5257 8FB3C1 <CJK>
+8FB3C2 5258 8FB3C2 <CJK>
+8FB3C3 525A 8FB3C3 <CJK>
+8FB3C4 525C 8FB3C4 <CJK>
+8FB3C5 525F 8FB3C5 <CJK>
+8FB3C6 5260 8FB3C6 <CJK>
+8FB3C7 5261 8FB3C7 <CJK>
+8FB3C8 5266 8FB3C8 <CJK>
+8FB3C9 526E 8FB3C9 <CJK>
+8FB3CA 5277 8FB3CA <CJK>
+8FB3CB 5278 8FB3CB <CJK>
+8FB3CC 5279 8FB3CC <CJK>
+8FB3CD 5280 8FB3CD <CJK>
+8FB3CE 5282 8FB3CE <CJK>
+8FB3CF 5285 8FB3CF <CJK>
+8FB3D0 528A 8FB3D0 <CJK>
+8FB3D1 528C 8FB3D1 <CJK>
+8FB3D2 5293 8FB3D2 <CJK>
+8FB3D3 5295 8FB3D3 <CJK>
+8FB3D4 5296 8FB3D4 <CJK>
+8FB3D5 5297 8FB3D5 <CJK>
+8FB3D6 5298 8FB3D6 <CJK>
+8FB3D7 529A 8FB3D7 <CJK>
+8FB3D8 529C 8FB3D8 <CJK>
+8FB3D9 52A4 8FB3D9 <CJK>
+8FB3DA 52A5 8FB3DA <CJK>
+8FB3DB 52A6 8FB3DB <CJK>
+8FB3DC 52A7 8FB3DC <CJK>
+8FB3DD 52AF 8FB3DD <CJK>
+8FB3DE 52B0 8FB3DE <CJK>
+8FB3DF 52B6 8FB3DF <CJK>
+8FB3E0 52B7 8FB3E0 <CJK>
+8FB3E1 52B8 8FB3E1 <CJK>
+8FB3E2 52BA 8FB3E2 <CJK>
+8FB3E3 52BB 8FB3E3 <CJK>
+8FB3E4 52BD 8FB3E4 <CJK>
+8FB3E5 52C0 8FB3E5 <CJK>
+8FB3E6 52C4 8FB3E6 <CJK>
+8FB3E7 52C6 8FB3E7 <CJK>
+8FB3E8 52C8 8FB3E8 <CJK>
+8FB3E9 52CC 8FB3E9 <CJK>
+8FB3EA 52CF 8FB3EA <CJK>
+8FB3EB 52D1 8FB3EB <CJK>
+8FB3EC 52D4 8FB3EC <CJK>
+8FB3ED 52D6 8FB3ED <CJK>
+8FB3EE 52DB 8FB3EE <CJK>
+8FB3EF 52DC 8FB3EF <CJK>
+8FB3F0 52E1 8FB3F0 <CJK>
+8FB3F1 52E5 8FB3F1 <CJK>
+8FB3F2 52E8 8FB3F2 <CJK>
+8FB3F3 52E9 8FB3F3 <CJK>
+8FB3F4 52EA 8FB3F4 <CJK>
+8FB3F5 52EC 8FB3F5 <CJK>
+8FB3F6 52F0 8FB3F6 <CJK>
+8FB3F7 52F1 8FB3F7 <CJK>
+8FB3F8 52F4 8FB3F8 <CJK>
+8FB3F9 52F6 8FB3F9 <CJK>
+8FB3FA 52F7 8FB3FA <CJK>
+8FB3FB 5300 8FB3FB <CJK>
+8FB3FC 5303 8FB3FC <CJK>
+8FB3FD 530A 8FB3FD <CJK>
+8FB3FE 530B 8FB3FE <CJK>
+8FB4A1 530C 8FB4A1 <CJK>
+8FB4A2 5311 8FB4A2 <CJK>
+8FB4A3 5313 8FB4A3 <CJK>
+8FB4A4 5318 8FB4A4 <CJK>
+8FB4A5 531B 8FB4A5 <CJK>
+8FB4A6 531C 8FB4A6 <CJK>
+8FB4A7 531E 8FB4A7 <CJK>
+8FB4A8 531F 8FB4A8 <CJK>
+8FB4A9 5325 8FB4A9 <CJK>
+8FB4AA 5327 8FB4AA <CJK>
+8FB4AB 5328 8FB4AB <CJK>
+8FB4AC 5329 8FB4AC <CJK>
+8FB4AD 532B 8FB4AD <CJK>
+8FB4AE 532C 8FB4AE <CJK>
+8FB4AF 532D 8FB4AF <CJK>
+8FB4B0 5330 8FB4B0 <CJK>
+8FB4B1 5332 8FB4B1 <CJK>
+8FB4B2 5335 8FB4B2 <CJK>
+8FB4B3 533C 8FB4B3 <CJK>
+8FB4B4 533D 8FB4B4 <CJK>
+8FB4B5 533E 8FB4B5 <CJK>
+8FB4B6 5342 8FB4B6 <CJK>
+8FB4B7 534C 8FB4B7 <CJK>
+8FB4B8 534B 8FB4B8 <CJK>
+8FB4B9 5359 8FB4B9 <CJK>
+8FB4BA 535B 8FB4BA <CJK>
+8FB4BB 5361 8FB4BB <CJK>
+8FB4BC 5363 8FB4BC <CJK>
+8FB4BD 5365 8FB4BD <CJK>
+8FB4BE 536C 8FB4BE <CJK>
+8FB4BF 536D 8FB4BF <CJK>
+8FB4C0 5372 8FB4C0 <CJK>
+8FB4C1 5379 8FB4C1 <CJK>
+8FB4C2 537E 8FB4C2 <CJK>
+8FB4C3 5383 8FB4C3 <CJK>
+8FB4C4 5387 8FB4C4 <CJK>
+8FB4C5 5388 8FB4C5 <CJK>
+8FB4C6 538E 8FB4C6 <CJK>
+8FB4C7 5393 8FB4C7 <CJK>
+8FB4C8 5394 8FB4C8 <CJK>
+8FB4C9 5399 8FB4C9 <CJK>
+8FB4CA 539D 8FB4CA <CJK>
+8FB4CB 53A1 8FB4CB <CJK>
+8FB4CC 53A4 8FB4CC <CJK>
+8FB4CD 53AA 8FB4CD <CJK>
+8FB4CE 53AB 8FB4CE <CJK>
+8FB4CF 53AF 8FB4CF <CJK>
+8FB4D0 53B2 8FB4D0 <CJK>
+8FB4D1 53B4 8FB4D1 <CJK>
+8FB4D2 53B5 8FB4D2 <CJK>
+8FB4D3 53B7 8FB4D3 <CJK>
+8FB4D4 53B8 8FB4D4 <CJK>
+8FB4D5 53BA 8FB4D5 <CJK>
+8FB4D6 53BD 8FB4D6 <CJK>
+8FB4D7 53C0 8FB4D7 <CJK>
+8FB4D8 53C5 8FB4D8 <CJK>
+8FB4D9 53CF 8FB4D9 <CJK>
+8FB4DA 53D2 8FB4DA <CJK>
+8FB4DB 53D3 8FB4DB <CJK>
+8FB4DC 53D5 8FB4DC <CJK>
+8FB4DD 53DA 8FB4DD <CJK>
+8FB4DE 53DD 8FB4DE <CJK>
+8FB4DF 53DE 8FB4DF <CJK>
+8FB4E0 53E0 8FB4E0 <CJK>
+8FB4E1 53E6 8FB4E1 <CJK>
+8FB4E2 53E7 8FB4E2 <CJK>
+8FB4E3 53F5 8FB4E3 <CJK>
+8FB4E4 5402 8FB4E4 <CJK>
+8FB4E5 5413 8FB4E5 <CJK>
+8FB4E6 541A 8FB4E6 <CJK>
+8FB4E7 5421 8FB4E7 <CJK>
+8FB4E8 5427 8FB4E8 <CJK>
+8FB4E9 5428 8FB4E9 <CJK>
+8FB4EA 542A 8FB4EA <CJK>
+8FB4EB 542F 8FB4EB <CJK>
+8FB4EC 5431 8FB4EC <CJK>
+8FB4ED 5434 8FB4ED <CJK>
+8FB4EE 5435 8FB4EE <CJK>
+8FB4EF 5443 8FB4EF <CJK>
+8FB4F0 5444 8FB4F0 <CJK>
+8FB4F1 5447 8FB4F1 <CJK>
+8FB4F2 544D 8FB4F2 <CJK>
+8FB4F3 544F 8FB4F3 <CJK>
+8FB4F4 545E 8FB4F4 <CJK>
+8FB4F5 5462 8FB4F5 <CJK>
+8FB4F6 5464 8FB4F6 <CJK>
+8FB4F7 5466 8FB4F7 <CJK>
+8FB4F8 5467 8FB4F8 <CJK>
+8FB4F9 5469 8FB4F9 <CJK>
+8FB4FA 546B 8FB4FA <CJK>
+8FB4FB 546D 8FB4FB <CJK>
+8FB4FC 546E 8FB4FC <CJK>
+8FB4FD 5474 8FB4FD <CJK>
+8FB4FE 547F 8FB4FE <CJK>
+8FB5A1 5481 8FB5A1 <CJK>
+8FB5A2 5483 8FB5A2 <CJK>
+8FB5A3 5485 8FB5A3 <CJK>
+8FB5A4 5488 8FB5A4 <CJK>
+8FB5A5 5489 8FB5A5 <CJK>
+8FB5A6 548D 8FB5A6 <CJK>
+8FB5A7 5491 8FB5A7 <CJK>
+8FB5A8 5495 8FB5A8 <CJK>
+8FB5A9 5496 8FB5A9 <CJK>
+8FB5AA 549C 8FB5AA <CJK>
+8FB5AB 549F 8FB5AB <CJK>
+8FB5AC 54A1 8FB5AC <CJK>
+8FB5AD 54A6 8FB5AD <CJK>
+8FB5AE 54A7 8FB5AE <CJK>
+8FB5AF 54A9 8FB5AF <CJK>
+8FB5B0 54AA 8FB5B0 <CJK>
+8FB5B1 54AD 8FB5B1 <CJK>
+8FB5B2 54AE 8FB5B2 <CJK>
+8FB5B3 54B1 8FB5B3 <CJK>
+8FB5B4 54B7 8FB5B4 <CJK>
+8FB5B5 54B9 8FB5B5 <CJK>
+8FB5B6 54BA 8FB5B6 <CJK>
+8FB5B7 54BB 8FB5B7 <CJK>
+8FB5B8 54BF 8FB5B8 <CJK>
+8FB5B9 54C6 8FB5B9 <CJK>
+8FB5BA 54CA 8FB5BA <CJK>
+8FB5BB 54CD 8FB5BB <CJK>
+8FB5BC 54CE 8FB5BC <CJK>
+8FB5BD 54E0 8FB5BD <CJK>
+8FB5BE 54EA 8FB5BE <CJK>
+8FB5BF 54EC 8FB5BF <CJK>
+8FB5C0 54EF 8FB5C0 <CJK>
+8FB5C1 54F6 8FB5C1 <CJK>
+8FB5C2 54FC 8FB5C2 <CJK>
+8FB5C3 54FE 8FB5C3 <CJK>
+8FB5C4 54FF 8FB5C4 <CJK>
+8FB5C5 5500 8FB5C5 <CJK>
+8FB5C6 5501 8FB5C6 <CJK>
+8FB5C7 5505 8FB5C7 <CJK>
+8FB5C8 5508 8FB5C8 <CJK>
+8FB5C9 5509 8FB5C9 <CJK>
+8FB5CA 550C 8FB5CA <CJK>
+8FB5CB 550D 8FB5CB <CJK>
+8FB5CC 550E 8FB5CC <CJK>
+8FB5CD 5515 8FB5CD <CJK>
+8FB5CE 552A 8FB5CE <CJK>
+8FB5CF 552B 8FB5CF <CJK>
+8FB5D0 5532 8FB5D0 <CJK>
+8FB5D1 5535 8FB5D1 <CJK>
+8FB5D2 5536 8FB5D2 <CJK>
+8FB5D3 553B 8FB5D3 <CJK>
+8FB5D4 553C 8FB5D4 <CJK>
+8FB5D5 553D 8FB5D5 <CJK>
+8FB5D6 5541 8FB5D6 <CJK>
+8FB5D7 5547 8FB5D7 <CJK>
+8FB5D8 5549 8FB5D8 <CJK>
+8FB5D9 554A 8FB5D9 <CJK>
+8FB5DA 554D 8FB5DA <CJK>
+8FB5DB 5550 8FB5DB <CJK>
+8FB5DC 5551 8FB5DC <CJK>
+8FB5DD 5558 8FB5DD <CJK>
+8FB5DE 555A 8FB5DE <CJK>
+8FB5DF 555B 8FB5DF <CJK>
+8FB5E0 555E 8FB5E0 <CJK>
+8FB5E1 5560 8FB5E1 <CJK>
+8FB5E2 5561 8FB5E2 <CJK>
+8FB5E3 5564 8FB5E3 <CJK>
+8FB5E4 5566 8FB5E4 <CJK>
+8FB5E5 557F 8FB5E5 <CJK>
+8FB5E6 5581 8FB5E6 <CJK>
+8FB5E7 5582 8FB5E7 <CJK>
+8FB5E8 5586 8FB5E8 <CJK>
+8FB5E9 5588 8FB5E9 <CJK>
+8FB5EA 558E 8FB5EA <CJK>
+8FB5EB 558F 8FB5EB <CJK>
+8FB5EC 5591 8FB5EC <CJK>
+8FB5ED 5592 8FB5ED <CJK>
+8FB5EE 5593 8FB5EE <CJK>
+8FB5EF 5594 8FB5EF <CJK>
+8FB5F0 5597 8FB5F0 <CJK>
+8FB5F1 55A3 8FB5F1 <CJK>
+8FB5F2 55A4 8FB5F2 <CJK>
+8FB5F3 55AD 8FB5F3 <CJK>
+8FB5F4 55B2 8FB5F4 <CJK>
+8FB5F5 55BF 8FB5F5 <CJK>
+8FB5F6 55C1 8FB5F6 <CJK>
+8FB5F7 55C3 8FB5F7 <CJK>
+8FB5F8 55C6 8FB5F8 <CJK>
+8FB5F9 55C9 8FB5F9 <CJK>
+8FB5FA 55CB 8FB5FA <CJK>
+8FB5FB 55CC 8FB5FB <CJK>
+8FB5FC 55CE 8FB5FC <CJK>
+8FB5FD 55D1 8FB5FD <CJK>
+8FB5FE 55D2 8FB5FE <CJK>
+8FB6A1 55D3 8FB6A1 <CJK>
+8FB6A2 55D7 8FB6A2 <CJK>
+8FB6A3 55D8 8FB6A3 <CJK>
+8FB6A4 55DB 8FB6A4 <CJK>
+8FB6A5 55DE 8FB6A5 <CJK>
+8FB6A6 55E2 8FB6A6 <CJK>
+8FB6A7 55E9 8FB6A7 <CJK>
+8FB6A8 55F6 8FB6A8 <CJK>
+8FB6A9 55FF 8FB6A9 <CJK>
+8FB6AA 5605 8FB6AA <CJK>
+8FB6AB 5608 8FB6AB <CJK>
+8FB6AC 560A 8FB6AC <CJK>
+8FB6AD 560D 8FB6AD <CJK>
+8FB6AE 560E 8FB6AE <CJK>
+8FB6AF 560F 8FB6AF <CJK>
+8FB6B0 5610 8FB6B0 <CJK>
+8FB6B1 5611 8FB6B1 <CJK>
+8FB6B2 5612 8FB6B2 <CJK>
+8FB6B3 5619 8FB6B3 <CJK>
+8FB6B4 562C 8FB6B4 <CJK>
+8FB6B5 5630 8FB6B5 <CJK>
+8FB6B6 5633 8FB6B6 <CJK>
+8FB6B7 5635 8FB6B7 <CJK>
+8FB6B8 5637 8FB6B8 <CJK>
+8FB6B9 5639 8FB6B9 <CJK>
+8FB6BA 563B 8FB6BA <CJK>
+8FB6BB 563C 8FB6BB <CJK>
+8FB6BC 563D 8FB6BC <CJK>
+8FB6BD 563F 8FB6BD <CJK>
+8FB6BE 5640 8FB6BE <CJK>
+8FB6BF 5641 8FB6BF <CJK>
+8FB6C0 5643 8FB6C0 <CJK>
+8FB6C1 5644 8FB6C1 <CJK>
+8FB6C2 5646 8FB6C2 <CJK>
+8FB6C3 5649 8FB6C3 <CJK>
+8FB6C4 564B 8FB6C4 <CJK>
+8FB6C5 564D 8FB6C5 <CJK>
+8FB6C6 564F 8FB6C6 <CJK>
+8FB6C7 5654 8FB6C7 <CJK>
+8FB6C8 565E 8FB6C8 <CJK>
+8FB6C9 5660 8FB6C9 <CJK>
+8FB6CA 5661 8FB6CA <CJK>
+8FB6CB 5662 8FB6CB <CJK>
+8FB6CC 5663 8FB6CC <CJK>
+8FB6CD 5666 8FB6CD <CJK>
+8FB6CE 5669 8FB6CE <CJK>
+8FB6CF 566D 8FB6CF <CJK>
+8FB6D0 566F 8FB6D0 <CJK>
+8FB6D1 5671 8FB6D1 <CJK>
+8FB6D2 5672 8FB6D2 <CJK>
+8FB6D3 5675 8FB6D3 <CJK>
+8FB6D4 5684 8FB6D4 <CJK>
+8FB6D5 5685 8FB6D5 <CJK>
+8FB6D6 5688 8FB6D6 <CJK>
+8FB6D7 568B 8FB6D7 <CJK>
+8FB6D8 568C 8FB6D8 <CJK>
+8FB6D9 5695 8FB6D9 <CJK>
+8FB6DA 5699 8FB6DA <CJK>
+8FB6DB 569A 8FB6DB <CJK>
+8FB6DC 569D 8FB6DC <CJK>
+8FB6DD 569E 8FB6DD <CJK>
+8FB6DE 569F 8FB6DE <CJK>
+8FB6DF 56A6 8FB6DF <CJK>
+8FB6E0 56A7 8FB6E0 <CJK>
+8FB6E1 56A8 8FB6E1 <CJK>
+8FB6E2 56A9 8FB6E2 <CJK>
+8FB6E3 56AB 8FB6E3 <CJK>
+8FB6E4 56AC 8FB6E4 <CJK>
+8FB6E5 56AD 8FB6E5 <CJK>
+8FB6E6 56B1 8FB6E6 <CJK>
+8FB6E7 56B3 8FB6E7 <CJK>
+8FB6E8 56B7 8FB6E8 <CJK>
+8FB6E9 56BE 8FB6E9 <CJK>
+8FB6EA 56C5 8FB6EA <CJK>
+8FB6EB 56C9 8FB6EB <CJK>
+8FB6EC 56CA 8FB6EC <CJK>
+8FB6ED 56CB 8FB6ED <CJK>
+8FB6EE 56CF 8FB6EE <CJK>
+8FB6EF 56D0 8FB6EF <CJK>
+8FB6F0 56CC 8FB6F0 <CJK>
+8FB6F1 56CD 8FB6F1 <CJK>
+8FB6F2 56D9 8FB6F2 <CJK>
+8FB6F3 56DC 8FB6F3 <CJK>
+8FB6F4 56DD 8FB6F4 <CJK>
+8FB6F5 56DF 8FB6F5 <CJK>
+8FB6F6 56E1 8FB6F6 <CJK>
+8FB6F7 56E4 8FB6F7 <CJK>
+8FB6F8 56E5 8FB6F8 <CJK>
+8FB6F9 56E6 8FB6F9 <CJK>
+8FB6FA 56E7 8FB6FA <CJK>
+8FB6FB 56E8 8FB6FB <CJK>
+8FB6FC 56F1 8FB6FC <CJK>
+8FB6FD 56EB 8FB6FD <CJK>
+8FB6FE 56ED 8FB6FE <CJK>
+8FB7A1 56F6 8FB7A1 <CJK>
+8FB7A2 56F7 8FB7A2 <CJK>
+8FB7A3 5701 8FB7A3 <CJK>
+8FB7A4 5702 8FB7A4 <CJK>
+8FB7A5 5707 8FB7A5 <CJK>
+8FB7A6 570A 8FB7A6 <CJK>
+8FB7A7 570C 8FB7A7 <CJK>
+8FB7A8 5711 8FB7A8 <CJK>
+8FB7A9 5715 8FB7A9 <CJK>
+8FB7AA 571A 8FB7AA <CJK>
+8FB7AB 571B 8FB7AB <CJK>
+8FB7AC 571D 8FB7AC <CJK>
+8FB7AD 5720 8FB7AD <CJK>
+8FB7AE 5722 8FB7AE <CJK>
+8FB7AF 5723 8FB7AF <CJK>
+8FB7B0 5724 8FB7B0 <CJK>
+8FB7B1 5725 8FB7B1 <CJK>
+8FB7B2 5729 8FB7B2 <CJK>
+8FB7B3 572A 8FB7B3 <CJK>
+8FB7B4 572C 8FB7B4 <CJK>
+8FB7B5 572E 8FB7B5 <CJK>
+8FB7B6 572F 8FB7B6 <CJK>
+8FB7B7 5733 8FB7B7 <CJK>
+8FB7B8 5734 8FB7B8 <CJK>
+8FB7B9 573D 8FB7B9 <CJK>
+8FB7BA 573E 8FB7BA <CJK>
+8FB7BB 573F 8FB7BB <CJK>
+8FB7BC 5745 8FB7BC <CJK>
+8FB7BD 5746 8FB7BD <CJK>
+8FB7BE 574C 8FB7BE <CJK>
+8FB7BF 574D 8FB7BF <CJK>
+8FB7C0 5752 8FB7C0 <CJK>
+8FB7C1 5762 8FB7C1 <CJK>
+8FB7C2 5765 8FB7C2 <CJK>
+8FB7C3 5767 8FB7C3 <CJK>
+8FB7C4 5768 8FB7C4 <CJK>
+8FB7C5 576B 8FB7C5 <CJK>
+8FB7C6 576D 8FB7C6 <CJK>
+8FB7C7 576E 8FB7C7 <CJK>
+8FB7C8 576F 8FB7C8 <CJK>
+8FB7C9 5770 8FB7C9 <CJK>
+8FB7CA 5771 8FB7CA <CJK>
+8FB7CB 5773 8FB7CB <CJK>
+8FB7CC 5774 8FB7CC <CJK>
+8FB7CD 5775 8FB7CD <CJK>
+8FB7CE 5777 8FB7CE <CJK>
+8FB7CF 5779 8FB7CF <CJK>
+8FB7D0 577A 8FB7D0 <CJK>
+8FB7D1 577B 8FB7D1 <CJK>
+8FB7D2 577C 8FB7D2 <CJK>
+8FB7D3 577E 8FB7D3 <CJK>
+8FB7D4 5781 8FB7D4 <CJK>
+8FB7D5 5783 8FB7D5 <CJK>
+8FB7D6 578C 8FB7D6 <CJK>
+8FB7D7 5794 8FB7D7 <CJK>
+8FB7D8 5797 8FB7D8 <CJK>
+8FB7D9 5799 8FB7D9 <CJK>
+8FB7DA 579A 8FB7DA <CJK>
+8FB7DB 579C 8FB7DB <CJK>
+8FB7DC 579D 8FB7DC <CJK>
+8FB7DD 579E 8FB7DD <CJK>
+8FB7DE 579F 8FB7DE <CJK>
+8FB7DF 57A1 8FB7DF <CJK>
+8FB7E0 5795 8FB7E0 <CJK>
+8FB7E1 57A7 8FB7E1 <CJK>
+8FB7E2 57A8 8FB7E2 <CJK>
+8FB7E3 57A9 8FB7E3 <CJK>
+8FB7E4 57AC 8FB7E4 <CJK>
+8FB7E5 57B8 8FB7E5 <CJK>
+8FB7E6 57BD 8FB7E6 <CJK>
+8FB7E7 57C7 8FB7E7 <CJK>
+8FB7E8 57C8 8FB7E8 <CJK>
+8FB7E9 57CC 8FB7E9 <CJK>
+8FB7EA 57CF 8FB7EA <CJK>
+8FB7EB 57D5 8FB7EB <CJK>
+8FB7EC 57DD 8FB7EC <CJK>
+8FB7ED 57DE 8FB7ED <CJK>
+8FB7EE 57E4 8FB7EE <CJK>
+8FB7EF 57E6 8FB7EF <CJK>
+8FB7F0 57E7 8FB7F0 <CJK>
+8FB7F1 57E9 8FB7F1 <CJK>
+8FB7F2 57ED 8FB7F2 <CJK>
+8FB7F3 57F0 8FB7F3 <CJK>
+8FB7F4 57F5 8FB7F4 <CJK>
+8FB7F5 57F6 8FB7F5 <CJK>
+8FB7F6 57F8 8FB7F6 <CJK>
+8FB7F7 57FD 8FB7F7 <CJK>
+8FB7F8 57FE 8FB7F8 <CJK>
+8FB7F9 57FF 8FB7F9 <CJK>
+8FB7FA 5803 8FB7FA <CJK>
+8FB7FB 5804 8FB7FB <CJK>
+8FB7FC 5808 8FB7FC <CJK>
+8FB7FD 5809 8FB7FD <CJK>
+8FB7FE 57E1 8FB7FE <CJK>
+8FB8A1 580C 8FB8A1 <CJK>
+8FB8A2 580D 8FB8A2 <CJK>
+8FB8A3 581B 8FB8A3 <CJK>
+8FB8A4 581E 8FB8A4 <CJK>
+8FB8A5 581F 8FB8A5 <CJK>
+8FB8A6 5820 8FB8A6 <CJK>
+8FB8A7 5826 8FB8A7 <CJK>
+8FB8A8 5827 8FB8A8 <CJK>
+8FB8A9 582D 8FB8A9 <CJK>
+8FB8AA 5832 8FB8AA <CJK>
+8FB8AB 5839 8FB8AB <CJK>
+8FB8AC 583F 8FB8AC <CJK>
+8FB8AD 5849 8FB8AD <CJK>
+8FB8AE 584C 8FB8AE <CJK>
+8FB8AF 584D 8FB8AF <CJK>
+8FB8B0 584F 8FB8B0 <CJK>
+8FB8B1 5850 8FB8B1 <CJK>
+8FB8B2 5855 8FB8B2 <CJK>
+8FB8B3 585F 8FB8B3 <CJK>
+8FB8B4 5861 8FB8B4 <CJK>
+8FB8B5 5864 8FB8B5 <CJK>
+8FB8B6 5867 8FB8B6 <CJK>
+8FB8B7 5868 8FB8B7 <CJK>
+8FB8B8 5878 8FB8B8 <CJK>
+8FB8B9 587C 8FB8B9 <CJK>
+8FB8BA 587F 8FB8BA <CJK>
+8FB8BB 5880 8FB8BB <CJK>
+8FB8BC 5881 8FB8BC <CJK>
+8FB8BD 5887 8FB8BD <CJK>
+8FB8BE 5888 8FB8BE <CJK>
+8FB8BF 5889 8FB8BF <CJK>
+8FB8C0 588A 8FB8C0 <CJK>
+8FB8C1 588C 8FB8C1 <CJK>
+8FB8C2 588D 8FB8C2 <CJK>
+8FB8C3 588F 8FB8C3 <CJK>
+8FB8C4 5890 8FB8C4 <CJK>
+8FB8C5 5894 8FB8C5 <CJK>
+8FB8C6 5896 8FB8C6 <CJK>
+8FB8C7 589D 8FB8C7 <CJK>
+8FB8C8 58A0 8FB8C8 <CJK>
+8FB8C9 58A1 8FB8C9 <CJK>
+8FB8CA 58A2 8FB8CA <CJK>
+8FB8CB 58A6 8FB8CB <CJK>
+8FB8CC 58A9 8FB8CC <CJK>
+8FB8CD 58B1 8FB8CD <CJK>
+8FB8CE 58B2 8FB8CE <CJK>
+8FB8CF 58C4 8FB8CF <CJK>
+8FB8D0 58BC 8FB8D0 <CJK>
+8FB8D1 58C2 8FB8D1 <CJK>
+8FB8D2 58C8 8FB8D2 <CJK>
+8FB8D3 58CD 8FB8D3 <CJK>
+8FB8D4 58CE 8FB8D4 <CJK>
+8FB8D5 58D0 8FB8D5 <CJK>
+8FB8D6 58D2 8FB8D6 <CJK>
+8FB8D7 58D4 8FB8D7 <CJK>
+8FB8D8 58D6 8FB8D8 <CJK>
+8FB8D9 58DA 8FB8D9 <CJK>
+8FB8DA 58DD 8FB8DA <CJK>
+8FB8DB 58E1 8FB8DB <CJK>
+8FB8DC 58E2 8FB8DC <CJK>
+8FB8DD 58E9 8FB8DD <CJK>
+8FB8DE 58F3 8FB8DE <CJK>
+8FB8DF 5905 8FB8DF <CJK>
+8FB8E0 5906 8FB8E0 <CJK>
+8FB8E1 590B 8FB8E1 <CJK>
+8FB8E2 590C 8FB8E2 <CJK>
+8FB8E3 5912 8FB8E3 <CJK>
+8FB8E4 5913 8FB8E4 <CJK>
+8FB8E5 5914 8FB8E5 <CJK>
+8FB8E6 8641 8FB8E6 <CJK>
+8FB8E7 591D 8FB8E7 <CJK>
+8FB8E8 5921 8FB8E8 <CJK>
+8FB8E9 5923 8FB8E9 <CJK>
+8FB8EA 5924 8FB8EA <CJK>
+8FB8EB 5928 8FB8EB <CJK>
+8FB8EC 592F 8FB8EC <CJK>
+8FB8ED 5930 8FB8ED <CJK>
+8FB8EE 5933 8FB8EE <CJK>
+8FB8EF 5935 8FB8EF <CJK>
+8FB8F0 5936 8FB8F0 <CJK>
+8FB8F1 593F 8FB8F1 <CJK>
+8FB8F2 5943 8FB8F2 <CJK>
+8FB8F3 5946 8FB8F3 <CJK>
+8FB8F4 5952 8FB8F4 <CJK>
+8FB8F5 5953 8FB8F5 <CJK>
+8FB8F6 5959 8FB8F6 <CJK>
+8FB8F7 595B 8FB8F7 <CJK>
+8FB8F8 595D 8FB8F8 <CJK>
+8FB8F9 595E 8FB8F9 <CJK>
+8FB8FA 595F 8FB8FA <CJK>
+8FB8FB 5961 8FB8FB <CJK>
+8FB8FC 5963 8FB8FC <CJK>
+8FB8FD 596B 8FB8FD <CJK>
+8FB8FE 596D 8FB8FE <CJK>
+8FB9A1 596F 8FB9A1 <CJK>
+8FB9A2 5972 8FB9A2 <CJK>
+8FB9A3 5975 8FB9A3 <CJK>
+8FB9A4 5976 8FB9A4 <CJK>
+8FB9A5 5979 8FB9A5 <CJK>
+8FB9A6 597B 8FB9A6 <CJK>
+8FB9A7 597C 8FB9A7 <CJK>
+8FB9A8 598B 8FB9A8 <CJK>
+8FB9A9 598C 8FB9A9 <CJK>
+8FB9AA 598E 8FB9AA <CJK>
+8FB9AB 5992 8FB9AB <CJK>
+8FB9AC 5995 8FB9AC <CJK>
+8FB9AD 5997 8FB9AD <CJK>
+8FB9AE 599F 8FB9AE <CJK>
+8FB9AF 59A4 8FB9AF <CJK>
+8FB9B0 59A7 8FB9B0 <CJK>
+8FB9B1 59AD 8FB9B1 <CJK>
+8FB9B2 59AE 8FB9B2 <CJK>
+8FB9B3 59AF 8FB9B3 <CJK>
+8FB9B4 59B0 8FB9B4 <CJK>
+8FB9B5 59B3 8FB9B5 <CJK>
+8FB9B6 59B7 8FB9B6 <CJK>
+8FB9B7 59BA 8FB9B7 <CJK>
+8FB9B8 59BC 8FB9B8 <CJK>
+8FB9B9 59C1 8FB9B9 <CJK>
+8FB9BA 59C3 8FB9BA <CJK>
+8FB9BB 59C4 8FB9BB <CJK>
+8FB9BC 59C8 8FB9BC <CJK>
+8FB9BD 59CA 8FB9BD <CJK>
+8FB9BE 59CD 8FB9BE <CJK>
+8FB9BF 59D2 8FB9BF <CJK>
+8FB9C0 59DD 8FB9C0 <CJK>
+8FB9C1 59DE 8FB9C1 <CJK>
+8FB9C2 59DF 8FB9C2 <CJK>
+8FB9C3 59E3 8FB9C3 <CJK>
+8FB9C4 59E4 8FB9C4 <CJK>
+8FB9C5 59E7 8FB9C5 <CJK>
+8FB9C6 59EE 8FB9C6 <CJK>
+8FB9C7 59EF 8FB9C7 <CJK>
+8FB9C8 59F1 8FB9C8 <CJK>
+8FB9C9 59F2 8FB9C9 <CJK>
+8FB9CA 59F4 8FB9CA <CJK>
+8FB9CB 59F7 8FB9CB <CJK>
+8FB9CC 5A00 8FB9CC <CJK>
+8FB9CD 5A04 8FB9CD <CJK>
+8FB9CE 5A0C 8FB9CE <CJK>
+8FB9CF 5A0D 8FB9CF <CJK>
+8FB9D0 5A0E 8FB9D0 <CJK>
+8FB9D1 5A12 8FB9D1 <CJK>
+8FB9D2 5A13 8FB9D2 <CJK>
+8FB9D3 5A1E 8FB9D3 <CJK>
+8FB9D4 5A23 8FB9D4 <CJK>
+8FB9D5 5A24 8FB9D5 <CJK>
+8FB9D6 5A27 8FB9D6 <CJK>
+8FB9D7 5A28 8FB9D7 <CJK>
+8FB9D8 5A2A 8FB9D8 <CJK>
+8FB9D9 5A2D 8FB9D9 <CJK>
+8FB9DA 5A30 8FB9DA <CJK>
+8FB9DB 5A44 8FB9DB <CJK>
+8FB9DC 5A45 8FB9DC <CJK>
+8FB9DD 5A47 8FB9DD <CJK>
+8FB9DE 5A48 8FB9DE <CJK>
+8FB9DF 5A4C 8FB9DF <CJK>
+8FB9E0 5A50 8FB9E0 <CJK>
+8FB9E1 5A55 8FB9E1 <CJK>
+8FB9E2 5A5E 8FB9E2 <CJK>
+8FB9E3 5A63 8FB9E3 <CJK>
+8FB9E4 5A65 8FB9E4 <CJK>
+8FB9E5 5A67 8FB9E5 <CJK>
+8FB9E6 5A6D 8FB9E6 <CJK>
+8FB9E7 5A77 8FB9E7 <CJK>
+8FB9E8 5A7A 8FB9E8 <CJK>
+8FB9E9 5A7B 8FB9E9 <CJK>
+8FB9EA 5A7E 8FB9EA <CJK>
+8FB9EB 5A8B 8FB9EB <CJK>
+8FB9EC 5A90 8FB9EC <CJK>
+8FB9ED 5A93 8FB9ED <CJK>
+8FB9EE 5A96 8FB9EE <CJK>
+8FB9EF 5A99 8FB9EF <CJK>
+8FB9F0 5A9C 8FB9F0 <CJK>
+8FB9F1 5A9E 8FB9F1 <CJK>
+8FB9F2 5A9F 8FB9F2 <CJK>
+8FB9F3 5AA0 8FB9F3 <CJK>
+8FB9F4 5AA2 8FB9F4 <CJK>
+8FB9F5 5AA7 8FB9F5 <CJK>
+8FB9F6 5AAC 8FB9F6 <CJK>
+8FB9F7 5AB1 8FB9F7 <CJK>
+8FB9F8 5AB2 8FB9F8 <CJK>
+8FB9F9 5AB3 8FB9F9 <CJK>
+8FB9FA 5AB5 8FB9FA <CJK>
+8FB9FB 5AB8 8FB9FB <CJK>
+8FB9FC 5ABA 8FB9FC <CJK>
+8FB9FD 5ABB 8FB9FD <CJK>
+8FB9FE 5ABF 8FB9FE <CJK>
+8FBAA1 5AC4 8FBAA1 <CJK>
+8FBAA2 5AC6 8FBAA2 <CJK>
+8FBAA3 5AC8 8FBAA3 <CJK>
+8FBAA4 5ACF 8FBAA4 <CJK>
+8FBAA5 5ADA 8FBAA5 <CJK>
+8FBAA6 5ADC 8FBAA6 <CJK>
+8FBAA7 5AE0 8FBAA7 <CJK>
+8FBAA8 5AE5 8FBAA8 <CJK>
+8FBAA9 5AEA 8FBAA9 <CJK>
+8FBAAA 5AEE 8FBAAA <CJK>
+8FBAAB 5AF5 8FBAAB <CJK>
+8FBAAC 5AF6 8FBAAC <CJK>
+8FBAAD 5AFD 8FBAAD <CJK>
+8FBAAE 5B00 8FBAAE <CJK>
+8FBAAF 5B01 8FBAAF <CJK>
+8FBAB0 5B08 8FBAB0 <CJK>
+8FBAB1 5B17 8FBAB1 <CJK>
+8FBAB2 5B34 8FBAB2 <CJK>
+8FBAB3 5B19 8FBAB3 <CJK>
+8FBAB4 5B1B 8FBAB4 <CJK>
+8FBAB5 5B1D 8FBAB5 <CJK>
+8FBAB6 5B21 8FBAB6 <CJK>
+8FBAB7 5B25 8FBAB7 <CJK>
+8FBAB8 5B2D 8FBAB8 <CJK>
+8FBAB9 5B38 8FBAB9 <CJK>
+8FBABA 5B41 8FBABA <CJK>
+8FBABB 5B4B 8FBABB <CJK>
+8FBABC 5B4C 8FBABC <CJK>
+8FBABD 5B52 8FBABD <CJK>
+8FBABE 5B56 8FBABE <CJK>
+8FBABF 5B5E 8FBABF <CJK>
+8FBAC0 5B68 8FBAC0 <CJK>
+8FBAC1 5B6E 8FBAC1 <CJK>
+8FBAC2 5B6F 8FBAC2 <CJK>
+8FBAC3 5B7C 8FBAC3 <CJK>
+8FBAC4 5B7D 8FBAC4 <CJK>
+8FBAC5 5B7E 8FBAC5 <CJK>
+8FBAC6 5B7F 8FBAC6 <CJK>
+8FBAC7 5B81 8FBAC7 <CJK>
+8FBAC8 5B84 8FBAC8 <CJK>
+8FBAC9 5B86 8FBAC9 <CJK>
+8FBACA 5B8A 8FBACA <CJK>
+8FBACB 5B8E 8FBACB <CJK>
+8FBACC 5B90 8FBACC <CJK>
+8FBACD 5B91 8FBACD <CJK>
+8FBACE 5B93 8FBACE <CJK>
+8FBACF 5B94 8FBACF <CJK>
+8FBAD0 5B96 8FBAD0 <CJK>
+8FBAD1 5BA8 8FBAD1 <CJK>
+8FBAD2 5BA9 8FBAD2 <CJK>
+8FBAD3 5BAC 8FBAD3 <CJK>
+8FBAD4 5BAD 8FBAD4 <CJK>
+8FBAD5 5BAF 8FBAD5 <CJK>
+8FBAD6 5BB1 8FBAD6 <CJK>
+8FBAD7 5BB2 8FBAD7 <CJK>
+8FBAD8 5BB7 8FBAD8 <CJK>
+8FBAD9 5BBA 8FBAD9 <CJK>
+8FBADA 5BBC 8FBADA <CJK>
+8FBADB 5BC0 8FBADB <CJK>
+8FBADC 5BC1 8FBADC <CJK>
+8FBADD 5BCD 8FBADD <CJK>
+8FBADE 5BCF 8FBADE <CJK>
+8FBADF 5BD6 8FBADF <CJK>
+8FBAE0 5BD7 8FBAE0 <CJK>
+8FBAE1 5BD8 8FBAE1 <CJK>
+8FBAE2 5BD9 8FBAE2 <CJK>
+8FBAE3 5BDA 8FBAE3 <CJK>
+8FBAE4 5BE0 8FBAE4 <CJK>
+8FBAE5 5BEF 8FBAE5 <CJK>
+8FBAE6 5BF1 8FBAE6 <CJK>
+8FBAE7 5BF4 8FBAE7 <CJK>
+8FBAE8 5BFD 8FBAE8 <CJK>
+8FBAE9 5C0C 8FBAE9 <CJK>
+8FBAEA 5C17 8FBAEA <CJK>
+8FBAEB 5C1E 8FBAEB <CJK>
+8FBAEC 5C1F 8FBAEC <CJK>
+8FBAED 5C23 8FBAED <CJK>
+8FBAEE 5C26 8FBAEE <CJK>
+8FBAEF 5C29 8FBAEF <CJK>
+8FBAF0 5C2B 8FBAF0 <CJK>
+8FBAF1 5C2C 8FBAF1 <CJK>
+8FBAF2 5C2E 8FBAF2 <CJK>
+8FBAF3 5C30 8FBAF3 <CJK>
+8FBAF4 5C32 8FBAF4 <CJK>
+8FBAF5 5C35 8FBAF5 <CJK>
+8FBAF6 5C36 8FBAF6 <CJK>
+8FBAF7 5C59 8FBAF7 <CJK>
+8FBAF8 5C5A 8FBAF8 <CJK>
+8FBAF9 5C5C 8FBAF9 <CJK>
+8FBAFA 5C62 8FBAFA <CJK>
+8FBAFB 5C63 8FBAFB <CJK>
+8FBAFC 5C67 8FBAFC <CJK>
+8FBAFD 5C68 8FBAFD <CJK>
+8FBAFE 5C69 8FBAFE <CJK>
+8FBBA1 5C6D 8FBBA1 <CJK>
+8FBBA2 5C70 8FBBA2 <CJK>
+8FBBA3 5C74 8FBBA3 <CJK>
+8FBBA4 5C75 8FBBA4 <CJK>
+8FBBA5 5C7A 8FBBA5 <CJK>
+8FBBA6 5C7B 8FBBA6 <CJK>
+8FBBA7 5C7C 8FBBA7 <CJK>
+8FBBA8 5C7D 8FBBA8 <CJK>
+8FBBA9 5C87 8FBBA9 <CJK>
+8FBBAA 5C88 8FBBAA <CJK>
+8FBBAB 5C8A 8FBBAB <CJK>
+8FBBAC 5C8F 8FBBAC <CJK>
+8FBBAD 5C92 8FBBAD <CJK>
+8FBBAE 5C9D 8FBBAE <CJK>
+8FBBAF 5C9F 8FBBAF <CJK>
+8FBBB0 5CA0 8FBBB0 <CJK>
+8FBBB1 5CA2 8FBBB1 <CJK>
+8FBBB2 5CA3 8FBBB2 <CJK>
+8FBBB3 5CA6 8FBBB3 <CJK>
+8FBBB4 5CAA 8FBBB4 <CJK>
+8FBBB5 5CB2 8FBBB5 <CJK>
+8FBBB6 5CB4 8FBBB6 <CJK>
+8FBBB7 5CB5 8FBBB7 <CJK>
+8FBBB8 5CBA 8FBBB8 <CJK>
+8FBBB9 5CC9 8FBBB9 <CJK>
+8FBBBA 5CCB 8FBBBA <CJK>
+8FBBBB 5CD2 8FBBBB <CJK>
+8FBBBC 5CDD 8FBBBC <CJK>
+8FBBBD 5CD7 8FBBBD <CJK>
+8FBBBE 5CEE 8FBBBE <CJK>
+8FBBBF 5CF1 8FBBBF <CJK>
+8FBBC0 5CF2 8FBBC0 <CJK>
+8FBBC1 5CF4 8FBBC1 <CJK>
+8FBBC2 5D01 8FBBC2 <CJK>
+8FBBC3 5D06 8FBBC3 <CJK>
+8FBBC4 5D0D 8FBBC4 <CJK>
+8FBBC5 5D12 8FBBC5 <CJK>
+8FBBC6 5D2B 8FBBC6 <CJK>
+8FBBC7 5D23 8FBBC7 <CJK>
+8FBBC8 5D24 8FBBC8 <CJK>
+8FBBC9 5D26 8FBBC9 <CJK>
+8FBBCA 5D27 8FBBCA <CJK>
+8FBBCB 5D31 8FBBCB <CJK>
+8FBBCC 5D34 8FBBCC <CJK>
+8FBBCD 5D39 8FBBCD <CJK>
+8FBBCE 5D3D 8FBBCE <CJK>
+8FBBCF 5D3F 8FBBCF <CJK>
+8FBBD0 5D42 8FBBD0 <CJK>
+8FBBD1 5D43 8FBBD1 <CJK>
+8FBBD2 5D46 8FBBD2 <CJK>
+8FBBD3 5D48 8FBBD3 <CJK>
+8FBBD4 5D55 8FBBD4 <CJK>
+8FBBD5 5D51 8FBBD5 <CJK>
+8FBBD6 5D59 8FBBD6 <CJK>
+8FBBD7 5D4A 8FBBD7 <CJK>
+8FBBD8 5D5F 8FBBD8 <CJK>
+8FBBD9 5D60 8FBBD9 <CJK>
+8FBBDA 5D61 8FBBDA <CJK>
+8FBBDB 5D62 8FBBDB <CJK>
+8FBBDC 5D64 8FBBDC <CJK>
+8FBBDD 5D6A 8FBBDD <CJK>
+8FBBDE 5D6D 8FBBDE <CJK>
+8FBBDF 5D70 8FBBDF <CJK>
+8FBBE0 5D79 8FBBE0 <CJK>
+8FBBE1 5D7A 8FBBE1 <CJK>
+8FBBE2 5D7E 8FBBE2 <CJK>
+8FBBE3 5D7F 8FBBE3 <CJK>
+8FBBE4 5D81 8FBBE4 <CJK>
+8FBBE5 5D83 8FBBE5 <CJK>
+8FBBE6 5D88 8FBBE6 <CJK>
+8FBBE7 5D8A 8FBBE7 <CJK>
+8FBBE8 5D92 8FBBE8 <CJK>
+8FBBE9 5D93 8FBBE9 <CJK>
+8FBBEA 5D94 8FBBEA <CJK>
+8FBBEB 5D95 8FBBEB <CJK>
+8FBBEC 5D99 8FBBEC <CJK>
+8FBBED 5D9B 8FBBED <CJK>
+8FBBEE 5D9F 8FBBEE <CJK>
+8FBBEF 5DA0 8FBBEF <CJK>
+8FBBF0 5DA7 8FBBF0 <CJK>
+8FBBF1 5DAB 8FBBF1 <CJK>
+8FBBF2 5DB0 8FBBF2 <CJK>
+8FBBF3 5DB4 8FBBF3 <CJK>
+8FBBF4 5DB8 8FBBF4 <CJK>
+8FBBF5 5DB9 8FBBF5 <CJK>
+8FBBF6 5DC3 8FBBF6 <CJK>
+8FBBF7 5DC7 8FBBF7 <CJK>
+8FBBF8 5DCB 8FBBF8 <CJK>
+8FBBF9 5DD0 8FBBF9 <CJK>
+8FBBFA 5DCE 8FBBFA <CJK>
+8FBBFB 5DD8 8FBBFB <CJK>
+8FBBFC 5DD9 8FBBFC <CJK>
+8FBBFD 5DE0 8FBBFD <CJK>
+8FBBFE 5DE4 8FBBFE <CJK>
+8FBCA1 5DE9 8FBCA1 <CJK>
+8FBCA2 5DF8 8FBCA2 <CJK>
+8FBCA3 5DF9 8FBCA3 <CJK>
+8FBCA4 5E00 8FBCA4 <CJK>
+8FBCA5 5E07 8FBCA5 <CJK>
+8FBCA6 5E0D 8FBCA6 <CJK>
+8FBCA7 5E12 8FBCA7 <CJK>
+8FBCA8 5E14 8FBCA8 <CJK>
+8FBCA9 5E15 8FBCA9 <CJK>
+8FBCAA 5E18 8FBCAA <CJK>
+8FBCAB 5E1F 8FBCAB <CJK>
+8FBCAC 5E20 8FBCAC <CJK>
+8FBCAD 5E2E 8FBCAD <CJK>
+8FBCAE 5E28 8FBCAE <CJK>
+8FBCAF 5E32 8FBCAF <CJK>
+8FBCB0 5E35 8FBCB0 <CJK>
+8FBCB1 5E3E 8FBCB1 <CJK>
+8FBCB2 5E4B 8FBCB2 <CJK>
+8FBCB3 5E50 8FBCB3 <CJK>
+8FBCB4 5E49 8FBCB4 <CJK>
+8FBCB5 5E51 8FBCB5 <CJK>
+8FBCB6 5E56 8FBCB6 <CJK>
+8FBCB7 5E58 8FBCB7 <CJK>
+8FBCB8 5E5B 8FBCB8 <CJK>
+8FBCB9 5E5C 8FBCB9 <CJK>
+8FBCBA 5E5E 8FBCBA <CJK>
+8FBCBB 5E68 8FBCBB <CJK>
+8FBCBC 5E6A 8FBCBC <CJK>
+8FBCBD 5E6B 8FBCBD <CJK>
+8FBCBE 5E6C 8FBCBE <CJK>
+8FBCBF 5E6D 8FBCBF <CJK>
+8FBCC0 5E6E 8FBCC0 <CJK>
+8FBCC1 5E70 8FBCC1 <CJK>
+8FBCC2 5E80 8FBCC2 <CJK>
+8FBCC3 5E8B 8FBCC3 <CJK>
+8FBCC4 5E8E 8FBCC4 <CJK>
+8FBCC5 5EA2 8FBCC5 <CJK>
+8FBCC6 5EA4 8FBCC6 <CJK>
+8FBCC7 5EA5 8FBCC7 <CJK>
+8FBCC8 5EA8 8FBCC8 <CJK>
+8FBCC9 5EAA 8FBCC9 <CJK>
+8FBCCA 5EAC 8FBCCA <CJK>
+8FBCCB 5EB1 8FBCCB <CJK>
+8FBCCC 5EB3 8FBCCC <CJK>
+8FBCCD 5EBD 8FBCCD <CJK>
+8FBCCE 5EBE 8FBCCE <CJK>
+8FBCCF 5EBF 8FBCCF <CJK>
+8FBCD0 5EC6 8FBCD0 <CJK>
+8FBCD1 5ECC 8FBCD1 <CJK>
+8FBCD2 5ECB 8FBCD2 <CJK>
+8FBCD3 5ECE 8FBCD3 <CJK>
+8FBCD4 5ED1 8FBCD4 <CJK>
+8FBCD5 5ED2 8FBCD5 <CJK>
+8FBCD6 5ED4 8FBCD6 <CJK>
+8FBCD7 5ED5 8FBCD7 <CJK>
+8FBCD8 5EDC 8FBCD8 <CJK>
+8FBCD9 5EDE 8FBCD9 <CJK>
+8FBCDA 5EE5 8FBCDA <CJK>
+8FBCDB 5EEB 8FBCDB <CJK>
+8FBCDC 5F02 8FBCDC <CJK>
+8FBCDD 5F06 8FBCDD <CJK>
+8FBCDE 5F07 8FBCDE <CJK>
+8FBCDF 5F08 8FBCDF <CJK>
+8FBCE0 5F0E 8FBCE0 <CJK>
+8FBCE1 5F19 8FBCE1 <CJK>
+8FBCE2 5F1C 8FBCE2 <CJK>
+8FBCE3 5F1D 8FBCE3 <CJK>
+8FBCE4 5F21 8FBCE4 <CJK>
+8FBCE5 5F22 8FBCE5 <CJK>
+8FBCE6 5F23 8FBCE6 <CJK>
+8FBCE7 5F24 8FBCE7 <CJK>
+8FBCE8 5F28 8FBCE8 <CJK>
+8FBCE9 5F2B 8FBCE9 <CJK>
+8FBCEA 5F2C 8FBCEA <CJK>
+8FBCEB 5F2E 8FBCEB <CJK>
+8FBCEC 5F30 8FBCEC <CJK>
+8FBCED 5F34 8FBCED <CJK>
+8FBCEE 5F36 8FBCEE <CJK>
+8FBCEF 5F3B 8FBCEF <CJK>
+8FBCF0 5F3D 8FBCF0 <CJK>
+8FBCF1 5F3F 8FBCF1 <CJK>
+8FBCF2 5F40 8FBCF2 <CJK>
+8FBCF3 5F44 8FBCF3 <CJK>
+8FBCF4 5F45 8FBCF4 <CJK>
+8FBCF5 5F47 8FBCF5 <CJK>
+8FBCF6 5F4D 8FBCF6 <CJK>
+8FBCF7 5F50 8FBCF7 <CJK>
+8FBCF8 5F54 8FBCF8 <CJK>
+8FBCF9 5F58 8FBCF9 <CJK>
+8FBCFA 5F5B 8FBCFA <CJK>
+8FBCFB 5F60 8FBCFB <CJK>
+8FBCFC 5F63 8FBCFC <CJK>
+8FBCFD 5F64 8FBCFD <CJK>
+8FBCFE 5F67 8FBCFE <CJK>
+8FBDA1 5F6F 8FBDA1 <CJK>
+8FBDA2 5F72 8FBDA2 <CJK>
+8FBDA3 5F74 8FBDA3 <CJK>
+8FBDA4 5F75 8FBDA4 <CJK>
+8FBDA5 5F78 8FBDA5 <CJK>
+8FBDA6 5F7A 8FBDA6 <CJK>
+8FBDA7 5F7D 8FBDA7 <CJK>
+8FBDA8 5F7E 8FBDA8 <CJK>
+8FBDA9 5F89 8FBDA9 <CJK>
+8FBDAA 5F8D 8FBDAA <CJK>
+8FBDAB 5F8F 8FBDAB <CJK>
+8FBDAC 5F96 8FBDAC <CJK>
+8FBDAD 5F9C 8FBDAD <CJK>
+8FBDAE 5F9D 8FBDAE <CJK>
+8FBDAF 5FA2 8FBDAF <CJK>
+8FBDB0 5FA7 8FBDB0 <CJK>
+8FBDB1 5FAB 8FBDB1 <CJK>
+8FBDB2 5FA4 8FBDB2 <CJK>
+8FBDB3 5FAC 8FBDB3 <CJK>
+8FBDB4 5FAF 8FBDB4 <CJK>
+8FBDB5 5FB0 8FBDB5 <CJK>
+8FBDB6 5FB1 8FBDB6 <CJK>
+8FBDB7 5FB8 8FBDB7 <CJK>
+8FBDB8 5FC4 8FBDB8 <CJK>
+8FBDB9 5FC7 8FBDB9 <CJK>
+8FBDBA 5FC8 8FBDBA <CJK>
+8FBDBB 5FC9 8FBDBB <CJK>
+8FBDBC 5FCB 8FBDBC <CJK>
+8FBDBD 5FD0 8FBDBD <CJK>
+8FBDBE 5FD1 8FBDBE <CJK>
+8FBDBF 5FD2 8FBDBF <CJK>
+8FBDC0 5FD3 8FBDC0 <CJK>
+8FBDC1 5FD4 8FBDC1 <CJK>
+8FBDC2 5FDE 8FBDC2 <CJK>
+8FBDC3 5FE1 8FBDC3 <CJK>
+8FBDC4 5FE2 8FBDC4 <CJK>
+8FBDC5 5FE8 8FBDC5 <CJK>
+8FBDC6 5FE9 8FBDC6 <CJK>
+8FBDC7 5FEA 8FBDC7 <CJK>
+8FBDC8 5FEC 8FBDC8 <CJK>
+8FBDC9 5FED 8FBDC9 <CJK>
+8FBDCA 5FEE 8FBDCA <CJK>
+8FBDCB 5FEF 8FBDCB <CJK>
+8FBDCC 5FF2 8FBDCC <CJK>
+8FBDCD 5FF3 8FBDCD <CJK>
+8FBDCE 5FF6 8FBDCE <CJK>
+8FBDCF 5FFA 8FBDCF <CJK>
+8FBDD0 5FFC 8FBDD0 <CJK>
+8FBDD1 6007 8FBDD1 <CJK>
+8FBDD2 600A 8FBDD2 <CJK>
+8FBDD3 600D 8FBDD3 <CJK>
+8FBDD4 6013 8FBDD4 <CJK>
+8FBDD5 6014 8FBDD5 <CJK>
+8FBDD6 6017 8FBDD6 <CJK>
+8FBDD7 6018 8FBDD7 <CJK>
+8FBDD8 601A 8FBDD8 <CJK>
+8FBDD9 601F 8FBDD9 <CJK>
+8FBDDA 6024 8FBDDA <CJK>
+8FBDDB 602D 8FBDDB <CJK>
+8FBDDC 6033 8FBDDC <CJK>
+8FBDDD 6035 8FBDDD <CJK>
+8FBDDE 6040 8FBDDE <CJK>
+8FBDDF 6047 8FBDDF <CJK>
+8FBDE0 6048 8FBDE0 <CJK>
+8FBDE1 6049 8FBDE1 <CJK>
+8FBDE2 604C 8FBDE2 <CJK>
+8FBDE3 6051 8FBDE3 <CJK>
+8FBDE4 6054 8FBDE4 <CJK>
+8FBDE5 6056 8FBDE5 <CJK>
+8FBDE6 6057 8FBDE6 <CJK>
+8FBDE7 605D 8FBDE7 <CJK>
+8FBDE8 6061 8FBDE8 <CJK>
+8FBDE9 6067 8FBDE9 <CJK>
+8FBDEA 6071 8FBDEA <CJK>
+8FBDEB 607E 8FBDEB <CJK>
+8FBDEC 607F 8FBDEC <CJK>
+8FBDED 6082 8FBDED <CJK>
+8FBDEE 6086 8FBDEE <CJK>
+8FBDEF 6088 8FBDEF <CJK>
+8FBDF0 608A 8FBDF0 <CJK>
+8FBDF1 608E 8FBDF1 <CJK>
+8FBDF2 6091 8FBDF2 <CJK>
+8FBDF3 6093 8FBDF3 <CJK>
+8FBDF4 6095 8FBDF4 <CJK>
+8FBDF5 6098 8FBDF5 <CJK>
+8FBDF6 609D 8FBDF6 <CJK>
+8FBDF7 609E 8FBDF7 <CJK>
+8FBDF8 60A2 8FBDF8 <CJK>
+8FBDF9 60A4 8FBDF9 <CJK>
+8FBDFA 60A5 8FBDFA <CJK>
+8FBDFB 60A8 8FBDFB <CJK>
+8FBDFC 60B0 8FBDFC <CJK>
+8FBDFD 60B1 8FBDFD <CJK>
+8FBDFE 60B7 8FBDFE <CJK>
+8FBEA1 60BB 8FBEA1 <CJK>
+8FBEA2 60BE 8FBEA2 <CJK>
+8FBEA3 60C2 8FBEA3 <CJK>
+8FBEA4 60C4 8FBEA4 <CJK>
+8FBEA5 60C8 8FBEA5 <CJK>
+8FBEA6 60C9 8FBEA6 <CJK>
+8FBEA7 60CA 8FBEA7 <CJK>
+8FBEA8 60CB 8FBEA8 <CJK>
+8FBEA9 60CE 8FBEA9 <CJK>
+8FBEAA 60CF 8FBEAA <CJK>
+8FBEAB 60D4 8FBEAB <CJK>
+8FBEAC 60D5 8FBEAC <CJK>
+8FBEAD 60D9 8FBEAD <CJK>
+8FBEAE 60DB 8FBEAE <CJK>
+8FBEAF 60DD 8FBEAF <CJK>
+8FBEB0 60DE 8FBEB0 <CJK>
+8FBEB1 60E2 8FBEB1 <CJK>
+8FBEB2 60E5 8FBEB2 <CJK>
+8FBEB3 60F2 8FBEB3 <CJK>
+8FBEB4 60F5 8FBEB4 <CJK>
+8FBEB5 60F8 8FBEB5 <CJK>
+8FBEB6 60FC 8FBEB6 <CJK>
+8FBEB7 60FD 8FBEB7 <CJK>
+8FBEB8 6102 8FBEB8 <CJK>
+8FBEB9 6107 8FBEB9 <CJK>
+8FBEBA 610A 8FBEBA <CJK>
+8FBEBB 610C 8FBEBB <CJK>
+8FBEBC 6110 8FBEBC <CJK>
+8FBEBD 6111 8FBEBD <CJK>
+8FBEBE 6112 8FBEBE <CJK>
+8FBEBF 6113 8FBEBF <CJK>
+8FBEC0 6114 8FBEC0 <CJK>
+8FBEC1 6116 8FBEC1 <CJK>
+8FBEC2 6117 8FBEC2 <CJK>
+8FBEC3 6119 8FBEC3 <CJK>
+8FBEC4 611C 8FBEC4 <CJK>
+8FBEC5 611E 8FBEC5 <CJK>
+8FBEC6 6122 8FBEC6 <CJK>
+8FBEC7 612A 8FBEC7 <CJK>
+8FBEC8 612B 8FBEC8 <CJK>
+8FBEC9 6130 8FBEC9 <CJK>
+8FBECA 6131 8FBECA <CJK>
+8FBECB 6135 8FBECB <CJK>
+8FBECC 6136 8FBECC <CJK>
+8FBECD 6137 8FBECD <CJK>
+8FBECE 6139 8FBECE <CJK>
+8FBECF 6141 8FBECF <CJK>
+8FBED0 6145 8FBED0 <CJK>
+8FBED1 6146 8FBED1 <CJK>
+8FBED2 6149 8FBED2 <CJK>
+8FBED3 615E 8FBED3 <CJK>
+8FBED4 6160 8FBED4 <CJK>
+8FBED5 616C 8FBED5 <CJK>
+8FBED6 6172 8FBED6 <CJK>
+8FBED7 6178 8FBED7 <CJK>
+8FBED8 617B 8FBED8 <CJK>
+8FBED9 617C 8FBED9 <CJK>
+8FBEDA 617F 8FBEDA <CJK>
+8FBEDB 6180 8FBEDB <CJK>
+8FBEDC 6181 8FBEDC <CJK>
+8FBEDD 6183 8FBEDD <CJK>
+8FBEDE 6184 8FBEDE <CJK>
+8FBEDF 618B 8FBEDF <CJK>
+8FBEE0 618D 8FBEE0 <CJK>
+8FBEE1 6192 8FBEE1 <CJK>
+8FBEE2 6193 8FBEE2 <CJK>
+8FBEE3 6197 8FBEE3 <CJK>
+8FBEE4 6198 8FBEE4 <CJK>
+8FBEE5 619C 8FBEE5 <CJK>
+8FBEE6 619D 8FBEE6 <CJK>
+8FBEE7 619F 8FBEE7 <CJK>
+8FBEE8 61A0 8FBEE8 <CJK>
+8FBEE9 61A5 8FBEE9 <CJK>
+8FBEEA 61A8 8FBEEA <CJK>
+8FBEEB 61AA 8FBEEB <CJK>
+8FBEEC 61AD 8FBEEC <CJK>
+8FBEED 61B8 8FBEED <CJK>
+8FBEEE 61B9 8FBEEE <CJK>
+8FBEEF 61BC 8FBEEF <CJK>
+8FBEF0 61C0 8FBEF0 <CJK>
+8FBEF1 61C1 8FBEF1 <CJK>
+8FBEF2 61C2 8FBEF2 <CJK>
+8FBEF3 61CE 8FBEF3 <CJK>
+8FBEF4 61CF 8FBEF4 <CJK>
+8FBEF5 61D5 8FBEF5 <CJK>
+8FBEF6 61DC 8FBEF6 <CJK>
+8FBEF7 61DD 8FBEF7 <CJK>
+8FBEF8 61DE 8FBEF8 <CJK>
+8FBEF9 61DF 8FBEF9 <CJK>
+8FBEFA 61E1 8FBEFA <CJK>
+8FBEFB 61E2 8FBEFB <CJK>
+8FBEFC 61E7 8FBEFC <CJK>
+8FBEFD 61E9 8FBEFD <CJK>
+8FBEFE 61E5 8FBEFE <CJK>
+8FBFA1 61EC 8FBFA1 <CJK>
+8FBFA2 61ED 8FBFA2 <CJK>
+8FBFA3 61EF 8FBFA3 <CJK>
+8FBFA4 6201 8FBFA4 <CJK>
+8FBFA5 6203 8FBFA5 <CJK>
+8FBFA6 6204 8FBFA6 <CJK>
+8FBFA7 6207 8FBFA7 <CJK>
+8FBFA8 6213 8FBFA8 <CJK>
+8FBFA9 6215 8FBFA9 <CJK>
+8FBFAA 621C 8FBFAA <CJK>
+8FBFAB 6220 8FBFAB <CJK>
+8FBFAC 6222 8FBFAC <CJK>
+8FBFAD 6223 8FBFAD <CJK>
+8FBFAE 6227 8FBFAE <CJK>
+8FBFAF 6229 8FBFAF <CJK>
+8FBFB0 622B 8FBFB0 <CJK>
+8FBFB1 6239 8FBFB1 <CJK>
+8FBFB2 623D 8FBFB2 <CJK>
+8FBFB3 6242 8FBFB3 <CJK>
+8FBFB4 6243 8FBFB4 <CJK>
+8FBFB5 6244 8FBFB5 <CJK>
+8FBFB6 6246 8FBFB6 <CJK>
+8FBFB7 624C 8FBFB7 <CJK>
+8FBFB8 6250 8FBFB8 <CJK>
+8FBFB9 6251 8FBFB9 <CJK>
+8FBFBA 6252 8FBFBA <CJK>
+8FBFBB 6254 8FBFBB <CJK>
+8FBFBC 6256 8FBFBC <CJK>
+8FBFBD 625A 8FBFBD <CJK>
+8FBFBE 625C 8FBFBE <CJK>
+8FBFBF 6264 8FBFBF <CJK>
+8FBFC0 626D 8FBFC0 <CJK>
+8FBFC1 626F 8FBFC1 <CJK>
+8FBFC2 6273 8FBFC2 <CJK>
+8FBFC3 627A 8FBFC3 <CJK>
+8FBFC4 627D 8FBFC4 <CJK>
+8FBFC5 628D 8FBFC5 <CJK>
+8FBFC6 628E 8FBFC6 <CJK>
+8FBFC7 628F 8FBFC7 <CJK>
+8FBFC8 6290 8FBFC8 <CJK>
+8FBFC9 62A6 8FBFC9 <CJK>
+8FBFCA 62A8 8FBFCA <CJK>
+8FBFCB 62B3 8FBFCB <CJK>
+8FBFCC 62B6 8FBFCC <CJK>
+8FBFCD 62B7 8FBFCD <CJK>
+8FBFCE 62BA 8FBFCE <CJK>
+8FBFCF 62BE 8FBFCF <CJK>
+8FBFD0 62BF 8FBFD0 <CJK>
+8FBFD1 62C4 8FBFD1 <CJK>
+8FBFD2 62CE 8FBFD2 <CJK>
+8FBFD3 62D5 8FBFD3 <CJK>
+8FBFD4 62D6 8FBFD4 <CJK>
+8FBFD5 62DA 8FBFD5 <CJK>
+8FBFD6 62EA 8FBFD6 <CJK>
+8FBFD7 62F2 8FBFD7 <CJK>
+8FBFD8 62F4 8FBFD8 <CJK>
+8FBFD9 62FC 8FBFD9 <CJK>
+8FBFDA 62FD 8FBFDA <CJK>
+8FBFDB 6303 8FBFDB <CJK>
+8FBFDC 6304 8FBFDC <CJK>
+8FBFDD 630A 8FBFDD <CJK>
+8FBFDE 630B 8FBFDE <CJK>
+8FBFDF 630D 8FBFDF <CJK>
+8FBFE0 6310 8FBFE0 <CJK>
+8FBFE1 6313 8FBFE1 <CJK>
+8FBFE2 6316 8FBFE2 <CJK>
+8FBFE3 6318 8FBFE3 <CJK>
+8FBFE4 6329 8FBFE4 <CJK>
+8FBFE5 632A 8FBFE5 <CJK>
+8FBFE6 632D 8FBFE6 <CJK>
+8FBFE7 6335 8FBFE7 <CJK>
+8FBFE8 6336 8FBFE8 <CJK>
+8FBFE9 6339 8FBFE9 <CJK>
+8FBFEA 633C 8FBFEA <CJK>
+8FBFEB 6341 8FBFEB <CJK>
+8FBFEC 6342 8FBFEC <CJK>
+8FBFED 6343 8FBFED <CJK>
+8FBFEE 6344 8FBFEE <CJK>
+8FBFEF 6346 8FBFEF <CJK>
+8FBFF0 634A 8FBFF0 <CJK>
+8FBFF1 634B 8FBFF1 <CJK>
+8FBFF2 634E 8FBFF2 <CJK>
+8FBFF3 6352 8FBFF3 <CJK>
+8FBFF4 6353 8FBFF4 <CJK>
+8FBFF5 6354 8FBFF5 <CJK>
+8FBFF6 6358 8FBFF6 <CJK>
+8FBFF7 635B 8FBFF7 <CJK>
+8FBFF8 6365 8FBFF8 <CJK>
+8FBFF9 6366 8FBFF9 <CJK>
+8FBFFA 636C 8FBFFA <CJK>
+8FBFFB 636D 8FBFFB <CJK>
+8FBFFC 6371 8FBFFC <CJK>
+8FBFFD 6374 8FBFFD <CJK>
+8FBFFE 6375 8FBFFE <CJK>
+8FC0A1 6378 8FC0A1 <CJK>
+8FC0A2 637C 8FC0A2 <CJK>
+8FC0A3 637D 8FC0A3 <CJK>
+8FC0A4 637F 8FC0A4 <CJK>
+8FC0A5 6382 8FC0A5 <CJK>
+8FC0A6 6384 8FC0A6 <CJK>
+8FC0A7 6387 8FC0A7 <CJK>
+8FC0A8 638A 8FC0A8 <CJK>
+8FC0A9 6390 8FC0A9 <CJK>
+8FC0AA 6394 8FC0AA <CJK>
+8FC0AB 6395 8FC0AB <CJK>
+8FC0AC 6399 8FC0AC <CJK>
+8FC0AD 639A 8FC0AD <CJK>
+8FC0AE 639E 8FC0AE <CJK>
+8FC0AF 63A4 8FC0AF <CJK>
+8FC0B0 63A6 8FC0B0 <CJK>
+8FC0B1 63AD 8FC0B1 <CJK>
+8FC0B2 63AE 8FC0B2 <CJK>
+8FC0B3 63AF 8FC0B3 <CJK>
+8FC0B4 63BD 8FC0B4 <CJK>
+8FC0B5 63C1 8FC0B5 <CJK>
+8FC0B6 63C5 8FC0B6 <CJK>
+8FC0B7 63C8 8FC0B7 <CJK>
+8FC0B8 63CE 8FC0B8 <CJK>
+8FC0B9 63D1 8FC0B9 <CJK>
+8FC0BA 63D3 8FC0BA <CJK>
+8FC0BB 63D4 8FC0BB <CJK>
+8FC0BC 63D5 8FC0BC <CJK>
+8FC0BD 63DC 8FC0BD <CJK>
+8FC0BE 63E0 8FC0BE <CJK>
+8FC0BF 63E5 8FC0BF <CJK>
+8FC0C0 63EA 8FC0C0 <CJK>
+8FC0C1 63EC 8FC0C1 <CJK>
+8FC0C2 63F2 8FC0C2 <CJK>
+8FC0C3 63F3 8FC0C3 <CJK>
+8FC0C4 63F5 8FC0C4 <CJK>
+8FC0C5 63F8 8FC0C5 <CJK>
+8FC0C6 63F9 8FC0C6 <CJK>
+8FC0C7 6409 8FC0C7 <CJK>
+8FC0C8 640A 8FC0C8 <CJK>
+8FC0C9 6410 8FC0C9 <CJK>
+8FC0CA 6412 8FC0CA <CJK>
+8FC0CB 6414 8FC0CB <CJK>
+8FC0CC 6418 8FC0CC <CJK>
+8FC0CD 641E 8FC0CD <CJK>
+8FC0CE 6420 8FC0CE <CJK>
+8FC0CF 6422 8FC0CF <CJK>
+8FC0D0 6424 8FC0D0 <CJK>
+8FC0D1 6425 8FC0D1 <CJK>
+8FC0D2 6429 8FC0D2 <CJK>
+8FC0D3 642A 8FC0D3 <CJK>
+8FC0D4 642F 8FC0D4 <CJK>
+8FC0D5 6430 8FC0D5 <CJK>
+8FC0D6 6435 8FC0D6 <CJK>
+8FC0D7 643D 8FC0D7 <CJK>
+8FC0D8 643F 8FC0D8 <CJK>
+8FC0D9 644B 8FC0D9 <CJK>
+8FC0DA 644F 8FC0DA <CJK>
+8FC0DB 6451 8FC0DB <CJK>
+8FC0DC 6452 8FC0DC <CJK>
+8FC0DD 6453 8FC0DD <CJK>
+8FC0DE 6454 8FC0DE <CJK>
+8FC0DF 645A 8FC0DF <CJK>
+8FC0E0 645B 8FC0E0 <CJK>
+8FC0E1 645C 8FC0E1 <CJK>
+8FC0E2 645D 8FC0E2 <CJK>
+8FC0E3 645F 8FC0E3 <CJK>
+8FC0E4 6460 8FC0E4 <CJK>
+8FC0E5 6461 8FC0E5 <CJK>
+8FC0E6 6463 8FC0E6 <CJK>
+8FC0E7 646D 8FC0E7 <CJK>
+8FC0E8 6473 8FC0E8 <CJK>
+8FC0E9 6474 8FC0E9 <CJK>
+8FC0EA 647B 8FC0EA <CJK>
+8FC0EB 647D 8FC0EB <CJK>
+8FC0EC 6485 8FC0EC <CJK>
+8FC0ED 6487 8FC0ED <CJK>
+8FC0EE 648F 8FC0EE <CJK>
+8FC0EF 6490 8FC0EF <CJK>
+8FC0F0 6491 8FC0F0 <CJK>
+8FC0F1 6498 8FC0F1 <CJK>
+8FC0F2 6499 8FC0F2 <CJK>
+8FC0F3 649B 8FC0F3 <CJK>
+8FC0F4 649D 8FC0F4 <CJK>
+8FC0F5 649F 8FC0F5 <CJK>
+8FC0F6 64A1 8FC0F6 <CJK>
+8FC0F7 64A3 8FC0F7 <CJK>
+8FC0F8 64A6 8FC0F8 <CJK>
+8FC0F9 64A8 8FC0F9 <CJK>
+8FC0FA 64AC 8FC0FA <CJK>
+8FC0FB 64B3 8FC0FB <CJK>
+8FC0FC 64BD 8FC0FC <CJK>
+8FC0FD 64BE 8FC0FD <CJK>
+8FC0FE 64BF 8FC0FE <CJK>
+8FC1A1 64C4 8FC1A1 <CJK>
+8FC1A2 64C9 8FC1A2 <CJK>
+8FC1A3 64CA 8FC1A3 <CJK>
+8FC1A4 64CB 8FC1A4 <CJK>
+8FC1A5 64CC 8FC1A5 <CJK>
+8FC1A6 64CE 8FC1A6 <CJK>
+8FC1A7 64D0 8FC1A7 <CJK>
+8FC1A8 64D1 8FC1A8 <CJK>
+8FC1A9 64D5 8FC1A9 <CJK>
+8FC1AA 64D7 8FC1AA <CJK>
+8FC1AB 64E4 8FC1AB <CJK>
+8FC1AC 64E5 8FC1AC <CJK>
+8FC1AD 64E9 8FC1AD <CJK>
+8FC1AE 64EA 8FC1AE <CJK>
+8FC1AF 64ED 8FC1AF <CJK>
+8FC1B0 64F0 8FC1B0 <CJK>
+8FC1B1 64F5 8FC1B1 <CJK>
+8FC1B2 64F7 8FC1B2 <CJK>
+8FC1B3 64FB 8FC1B3 <CJK>
+8FC1B4 64FF 8FC1B4 <CJK>
+8FC1B5 6501 8FC1B5 <CJK>
+8FC1B6 6504 8FC1B6 <CJK>
+8FC1B7 6508 8FC1B7 <CJK>
+8FC1B8 6509 8FC1B8 <CJK>
+8FC1B9 650A 8FC1B9 <CJK>
+8FC1BA 650F 8FC1BA <CJK>
+8FC1BB 6513 8FC1BB <CJK>
+8FC1BC 6514 8FC1BC <CJK>
+8FC1BD 6516 8FC1BD <CJK>
+8FC1BE 6519 8FC1BE <CJK>
+8FC1BF 651B 8FC1BF <CJK>
+8FC1C0 651E 8FC1C0 <CJK>
+8FC1C1 651F 8FC1C1 <CJK>
+8FC1C2 6522 8FC1C2 <CJK>
+8FC1C3 6526 8FC1C3 <CJK>
+8FC1C4 6529 8FC1C4 <CJK>
+8FC1C5 652E 8FC1C5 <CJK>
+8FC1C6 6531 8FC1C6 <CJK>
+8FC1C7 653A 8FC1C7 <CJK>
+8FC1C8 653C 8FC1C8 <CJK>
+8FC1C9 653D 8FC1C9 <CJK>
+8FC1CA 6543 8FC1CA <CJK>
+8FC1CB 6547 8FC1CB <CJK>
+8FC1CC 6549 8FC1CC <CJK>
+8FC1CD 6550 8FC1CD <CJK>
+8FC1CE 6552 8FC1CE <CJK>
+8FC1CF 6554 8FC1CF <CJK>
+8FC1D0 655F 8FC1D0 <CJK>
+8FC1D1 6560 8FC1D1 <CJK>
+8FC1D2 6567 8FC1D2 <CJK>
+8FC1D3 656B 8FC1D3 <CJK>
+8FC1D4 657A 8FC1D4 <CJK>
+8FC1D5 657D 8FC1D5 <CJK>
+8FC1D6 6581 8FC1D6 <CJK>
+8FC1D7 6585 8FC1D7 <CJK>
+8FC1D8 658A 8FC1D8 <CJK>
+8FC1D9 6592 8FC1D9 <CJK>
+8FC1DA 6595 8FC1DA <CJK>
+8FC1DB 6598 8FC1DB <CJK>
+8FC1DC 659D 8FC1DC <CJK>
+8FC1DD 65A0 8FC1DD <CJK>
+8FC1DE 65A3 8FC1DE <CJK>
+8FC1DF 65A6 8FC1DF <CJK>
+8FC1E0 65AE 8FC1E0 <CJK>
+8FC1E1 65B2 8FC1E1 <CJK>
+8FC1E2 65B3 8FC1E2 <CJK>
+8FC1E3 65B4 8FC1E3 <CJK>
+8FC1E4 65BF 8FC1E4 <CJK>
+8FC1E5 65C2 8FC1E5 <CJK>
+8FC1E6 65C8 8FC1E6 <CJK>
+8FC1E7 65C9 8FC1E7 <CJK>
+8FC1E8 65CE 8FC1E8 <CJK>
+8FC1E9 65D0 8FC1E9 <CJK>
+8FC1EA 65D4 8FC1EA <CJK>
+8FC1EB 65D6 8FC1EB <CJK>
+8FC1EC 65D8 8FC1EC <CJK>
+8FC1ED 65DF 8FC1ED <CJK>
+8FC1EE 65F0 8FC1EE <CJK>
+8FC1EF 65F2 8FC1EF <CJK>
+8FC1F0 65F4 8FC1F0 <CJK>
+8FC1F1 65F5 8FC1F1 <CJK>
+8FC1F2 65F9 8FC1F2 <CJK>
+8FC1F3 65FE 8FC1F3 <CJK>
+8FC1F4 65FF 8FC1F4 <CJK>
+8FC1F5 6600 8FC1F5 <CJK>
+8FC1F6 6604 8FC1F6 <CJK>
+8FC1F7 6608 8FC1F7 <CJK>
+8FC1F8 6609 8FC1F8 <CJK>
+8FC1F9 660D 8FC1F9 <CJK>
+8FC1FA 6611 8FC1FA <CJK>
+8FC1FB 6612 8FC1FB <CJK>
+8FC1FC 6615 8FC1FC <CJK>
+8FC1FD 6616 8FC1FD <CJK>
+8FC1FE 661D 8FC1FE <CJK>
+8FC2A1 661E 8FC2A1 <CJK>
+8FC2A2 6621 8FC2A2 <CJK>
+8FC2A3 6622 8FC2A3 <CJK>
+8FC2A4 6623 8FC2A4 <CJK>
+8FC2A5 6624 8FC2A5 <CJK>
+8FC2A6 6626 8FC2A6 <CJK>
+8FC2A7 6629 8FC2A7 <CJK>
+8FC2A8 662A 8FC2A8 <CJK>
+8FC2A9 662B 8FC2A9 <CJK>
+8FC2AA 662C 8FC2AA <CJK>
+8FC2AB 662E 8FC2AB <CJK>
+8FC2AC 6630 8FC2AC <CJK>
+8FC2AD 6631 8FC2AD <CJK>
+8FC2AE 6633 8FC2AE <CJK>
+8FC2AF 6639 8FC2AF <CJK>
+8FC2B0 6637 8FC2B0 <CJK>
+8FC2B1 6640 8FC2B1 <CJK>
+8FC2B2 6645 8FC2B2 <CJK>
+8FC2B3 6646 8FC2B3 <CJK>
+8FC2B4 664A 8FC2B4 <CJK>
+8FC2B5 664C 8FC2B5 <CJK>
+8FC2B6 6651 8FC2B6 <CJK>
+8FC2B7 664E 8FC2B7 <CJK>
+8FC2B8 6657 8FC2B8 <CJK>
+8FC2B9 6658 8FC2B9 <CJK>
+8FC2BA 6659 8FC2BA <CJK>
+8FC2BB 665B 8FC2BB <CJK>
+8FC2BC 665C 8FC2BC <CJK>
+8FC2BD 6660 8FC2BD <CJK>
+8FC2BE 6661 8FC2BE <CJK>
+8FC2BF 66FB 8FC2BF <CJK>
+8FC2C0 666A 8FC2C0 <CJK>
+8FC2C1 666B 8FC2C1 <CJK>
+8FC2C2 666C 8FC2C2 <CJK>
+8FC2C3 667E 8FC2C3 <CJK>
+8FC2C4 6673 8FC2C4 <CJK>
+8FC2C5 6675 8FC2C5 <CJK>
+8FC2C6 667F 8FC2C6 <CJK>
+8FC2C7 6677 8FC2C7 <CJK>
+8FC2C8 6678 8FC2C8 <CJK>
+8FC2C9 6679 8FC2C9 <CJK>
+8FC2CA 667B 8FC2CA <CJK>
+8FC2CB 6680 8FC2CB <CJK>
+8FC2CC 667C 8FC2CC <CJK>
+8FC2CD 668B 8FC2CD <CJK>
+8FC2CE 668C 8FC2CE <CJK>
+8FC2CF 668D 8FC2CF <CJK>
+8FC2D0 6690 8FC2D0 <CJK>
+8FC2D1 6692 8FC2D1 <CJK>
+8FC2D2 6699 8FC2D2 <CJK>
+8FC2D3 669A 8FC2D3 <CJK>
+8FC2D4 669B 8FC2D4 <CJK>
+8FC2D5 669C 8FC2D5 <CJK>
+8FC2D6 669F 8FC2D6 <CJK>
+8FC2D7 66A0 8FC2D7 <CJK>
+8FC2D8 66A4 8FC2D8 <CJK>
+8FC2D9 66AD 8FC2D9 <CJK>
+8FC2DA 66B1 8FC2DA <CJK>
+8FC2DB 66B2 8FC2DB <CJK>
+8FC2DC 66B5 8FC2DC <CJK>
+8FC2DD 66BB 8FC2DD <CJK>
+8FC2DE 66BF 8FC2DE <CJK>
+8FC2DF 66C0 8FC2DF <CJK>
+8FC2E0 66C2 8FC2E0 <CJK>
+8FC2E1 66C3 8FC2E1 <CJK>
+8FC2E2 66C8 8FC2E2 <CJK>
+8FC2E3 66CC 8FC2E3 <CJK>
+8FC2E4 66CE 8FC2E4 <CJK>
+8FC2E5 66CF 8FC2E5 <CJK>
+8FC2E6 66D4 8FC2E6 <CJK>
+8FC2E7 66DB 8FC2E7 <CJK>
+8FC2E8 66DF 8FC2E8 <CJK>
+8FC2E9 66E8 8FC2E9 <CJK>
+8FC2EA 66EB 8FC2EA <CJK>
+8FC2EB 66EC 8FC2EB <CJK>
+8FC2EC 66EE 8FC2EC <CJK>
+8FC2ED 66FA 8FC2ED <CJK>
+8FC2EE 6705 8FC2EE <CJK>
+8FC2EF 6707 8FC2EF <CJK>
+8FC2F0 670E 8FC2F0 <CJK>
+8FC2F1 6713 8FC2F1 <CJK>
+8FC2F2 6719 8FC2F2 <CJK>
+8FC2F3 671C 8FC2F3 <CJK>
+8FC2F4 6720 8FC2F4 <CJK>
+8FC2F5 6722 8FC2F5 <CJK>
+8FC2F6 6733 8FC2F6 <CJK>
+8FC2F7 673E 8FC2F7 <CJK>
+8FC2F8 6745 8FC2F8 <CJK>
+8FC2F9 6747 8FC2F9 <CJK>
+8FC2FA 6748 8FC2FA <CJK>
+8FC2FB 674C 8FC2FB <CJK>
+8FC2FC 6754 8FC2FC <CJK>
+8FC2FD 6755 8FC2FD <CJK>
+8FC2FE 675D 8FC2FE <CJK>
+8FC3A1 6766 8FC3A1 <CJK>
+8FC3A2 676C 8FC3A2 <CJK>
+8FC3A3 676E 8FC3A3 <CJK>
+8FC3A4 6774 8FC3A4 <CJK>
+8FC3A5 6776 8FC3A5 <CJK>
+8FC3A6 677B 8FC3A6 <CJK>
+8FC3A7 6781 8FC3A7 <CJK>
+8FC3A8 6784 8FC3A8 <CJK>
+8FC3A9 678E 8FC3A9 <CJK>
+8FC3AA 678F 8FC3AA <CJK>
+8FC3AB 6791 8FC3AB <CJK>
+8FC3AC 6793 8FC3AC <CJK>
+8FC3AD 6796 8FC3AD <CJK>
+8FC3AE 6798 8FC3AE <CJK>
+8FC3AF 6799 8FC3AF <CJK>
+8FC3B0 679B 8FC3B0 <CJK>
+8FC3B1 67B0 8FC3B1 <CJK>
+8FC3B2 67B1 8FC3B2 <CJK>
+8FC3B3 67B2 8FC3B3 <CJK>
+8FC3B4 67B5 8FC3B4 <CJK>
+8FC3B5 67BB 8FC3B5 <CJK>
+8FC3B6 67BC 8FC3B6 <CJK>
+8FC3B7 67BD 8FC3B7 <CJK>
+8FC3B8 67F9 8FC3B8 <CJK>
+8FC3B9 67C0 8FC3B9 <CJK>
+8FC3BA 67C2 8FC3BA <CJK>
+8FC3BB 67C3 8FC3BB <CJK>
+8FC3BC 67C5 8FC3BC <CJK>
+8FC3BD 67C8 8FC3BD <CJK>
+8FC3BE 67C9 8FC3BE <CJK>
+8FC3BF 67D2 8FC3BF <CJK>
+8FC3C0 67D7 8FC3C0 <CJK>
+8FC3C1 67D9 8FC3C1 <CJK>
+8FC3C2 67DC 8FC3C2 <CJK>
+8FC3C3 67E1 8FC3C3 <CJK>
+8FC3C4 67E6 8FC3C4 <CJK>
+8FC3C5 67F0 8FC3C5 <CJK>
+8FC3C6 67F2 8FC3C6 <CJK>
+8FC3C7 67F6 8FC3C7 <CJK>
+8FC3C8 67F7 8FC3C8 <CJK>
+8FC3C9 6852 8FC3C9 <CJK>
+8FC3CA 6814 8FC3CA <CJK>
+8FC3CB 6819 8FC3CB <CJK>
+8FC3CC 681D 8FC3CC <CJK>
+8FC3CD 681F 8FC3CD <CJK>
+8FC3CE 6828 8FC3CE <CJK>
+8FC3CF 6827 8FC3CF <CJK>
+8FC3D0 682C 8FC3D0 <CJK>
+8FC3D1 682D 8FC3D1 <CJK>
+8FC3D2 682F 8FC3D2 <CJK>
+8FC3D3 6830 8FC3D3 <CJK>
+8FC3D4 6831 8FC3D4 <CJK>
+8FC3D5 6833 8FC3D5 <CJK>
+8FC3D6 683B 8FC3D6 <CJK>
+8FC3D7 683F 8FC3D7 <CJK>
+8FC3D8 6844 8FC3D8 <CJK>
+8FC3D9 6845 8FC3D9 <CJK>
+8FC3DA 684A 8FC3DA <CJK>
+8FC3DB 684C 8FC3DB <CJK>
+8FC3DC 6855 8FC3DC <CJK>
+8FC3DD 6857 8FC3DD <CJK>
+8FC3DE 6858 8FC3DE <CJK>
+8FC3DF 685B 8FC3DF <CJK>
+8FC3E0 686B 8FC3E0 <CJK>
+8FC3E1 686E 8FC3E1 <CJK>
+8FC3E2 686F 8FC3E2 <CJK>
+8FC3E3 6870 8FC3E3 <CJK>
+8FC3E4 6871 8FC3E4 <CJK>
+8FC3E5 6872 8FC3E5 <CJK>
+8FC3E6 6875 8FC3E6 <CJK>
+8FC3E7 6879 8FC3E7 <CJK>
+8FC3E8 687A 8FC3E8 <CJK>
+8FC3E9 687B 8FC3E9 <CJK>
+8FC3EA 687C 8FC3EA <CJK>
+8FC3EB 6882 8FC3EB <CJK>
+8FC3EC 6884 8FC3EC <CJK>
+8FC3ED 6886 8FC3ED <CJK>
+8FC3EE 6888 8FC3EE <CJK>
+8FC3EF 6896 8FC3EF <CJK>
+8FC3F0 6898 8FC3F0 <CJK>
+8FC3F1 689A 8FC3F1 <CJK>
+8FC3F2 689C 8FC3F2 <CJK>
+8FC3F3 68A1 8FC3F3 <CJK>
+8FC3F4 68A3 8FC3F4 <CJK>
+8FC3F5 68A5 8FC3F5 <CJK>
+8FC3F6 68A9 8FC3F6 <CJK>
+8FC3F7 68AA 8FC3F7 <CJK>
+8FC3F8 68AE 8FC3F8 <CJK>
+8FC3F9 68B2 8FC3F9 <CJK>
+8FC3FA 68BB 8FC3FA <CJK>
+8FC3FB 68C5 8FC3FB <CJK>
+8FC3FC 68C8 8FC3FC <CJK>
+8FC3FD 68CC 8FC3FD <CJK>
+8FC3FE 68CF 8FC3FE <CJK>
+8FC4A1 68D0 8FC4A1 <CJK>
+8FC4A2 68D1 8FC4A2 <CJK>
+8FC4A3 68D3 8FC4A3 <CJK>
+8FC4A4 68D6 8FC4A4 <CJK>
+8FC4A5 68D9 8FC4A5 <CJK>
+8FC4A6 68DC 8FC4A6 <CJK>
+8FC4A7 68DD 8FC4A7 <CJK>
+8FC4A8 68E5 8FC4A8 <CJK>
+8FC4A9 68E8 8FC4A9 <CJK>
+8FC4AA 68EA 8FC4AA <CJK>
+8FC4AB 68EB 8FC4AB <CJK>
+8FC4AC 68EC 8FC4AC <CJK>
+8FC4AD 68ED 8FC4AD <CJK>
+8FC4AE 68F0 8FC4AE <CJK>
+8FC4AF 68F1 8FC4AF <CJK>
+8FC4B0 68F5 8FC4B0 <CJK>
+8FC4B1 68F6 8FC4B1 <CJK>
+8FC4B2 68FB 8FC4B2 <CJK>
+8FC4B3 68FC 8FC4B3 <CJK>
+8FC4B4 68FD 8FC4B4 <CJK>
+8FC4B5 6906 8FC4B5 <CJK>
+8FC4B6 6909 8FC4B6 <CJK>
+8FC4B7 690A 8FC4B7 <CJK>
+8FC4B8 6910 8FC4B8 <CJK>
+8FC4B9 6911 8FC4B9 <CJK>
+8FC4BA 6913 8FC4BA <CJK>
+8FC4BB 6916 8FC4BB <CJK>
+8FC4BC 6917 8FC4BC <CJK>
+8FC4BD 6931 8FC4BD <CJK>
+8FC4BE 6933 8FC4BE <CJK>
+8FC4BF 6935 8FC4BF <CJK>
+8FC4C0 6938 8FC4C0 <CJK>
+8FC4C1 693B 8FC4C1 <CJK>
+8FC4C2 6942 8FC4C2 <CJK>
+8FC4C3 6945 8FC4C3 <CJK>
+8FC4C4 6949 8FC4C4 <CJK>
+8FC4C5 694E 8FC4C5 <CJK>
+8FC4C6 6957 8FC4C6 <CJK>
+8FC4C7 695B 8FC4C7 <CJK>
+8FC4C8 6963 8FC4C8 <CJK>
+8FC4C9 6964 8FC4C9 <CJK>
+8FC4CA 6965 8FC4CA <CJK>
+8FC4CB 6966 8FC4CB <CJK>
+8FC4CC 6968 8FC4CC <CJK>
+8FC4CD 6969 8FC4CD <CJK>
+8FC4CE 696C 8FC4CE <CJK>
+8FC4CF 6970 8FC4CF <CJK>
+8FC4D0 6971 8FC4D0 <CJK>
+8FC4D1 6972 8FC4D1 <CJK>
+8FC4D2 697A 8FC4D2 <CJK>
+8FC4D3 697B 8FC4D3 <CJK>
+8FC4D4 697F 8FC4D4 <CJK>
+8FC4D5 6980 8FC4D5 <CJK>
+8FC4D6 698D 8FC4D6 <CJK>
+8FC4D7 6992 8FC4D7 <CJK>
+8FC4D8 6996 8FC4D8 <CJK>
+8FC4D9 6998 8FC4D9 <CJK>
+8FC4DA 69A1 8FC4DA <CJK>
+8FC4DB 69A5 8FC4DB <CJK>
+8FC4DC 69A6 8FC4DC <CJK>
+8FC4DD 69A8 8FC4DD <CJK>
+8FC4DE 69AB 8FC4DE <CJK>
+8FC4DF 69AD 8FC4DF <CJK>
+8FC4E0 69AF 8FC4E0 <CJK>
+8FC4E1 69B7 8FC4E1 <CJK>
+8FC4E2 69B8 8FC4E2 <CJK>
+8FC4E3 69BA 8FC4E3 <CJK>
+8FC4E4 69BC 8FC4E4 <CJK>
+8FC4E5 69C5 8FC4E5 <CJK>
+8FC4E6 69C8 8FC4E6 <CJK>
+8FC4E7 69D1 8FC4E7 <CJK>
+8FC4E8 69D6 8FC4E8 <CJK>
+8FC4E9 69D7 8FC4E9 <CJK>
+8FC4EA 69E2 8FC4EA <CJK>
+8FC4EB 69E5 8FC4EB <CJK>
+8FC4EC 69EE 8FC4EC <CJK>
+8FC4ED 69EF 8FC4ED <CJK>
+8FC4EE 69F1 8FC4EE <CJK>
+8FC4EF 69F3 8FC4EF <CJK>
+8FC4F0 69F5 8FC4F0 <CJK>
+8FC4F1 69FE 8FC4F1 <CJK>
+8FC4F2 6A00 8FC4F2 <CJK>
+8FC4F3 6A01 8FC4F3 <CJK>
+8FC4F4 6A03 8FC4F4 <CJK>
+8FC4F5 6A0F 8FC4F5 <CJK>
+8FC4F6 6A11 8FC4F6 <CJK>
+8FC4F7 6A15 8FC4F7 <CJK>
+8FC4F8 6A1A 8FC4F8 <CJK>
+8FC4F9 6A1D 8FC4F9 <CJK>
+8FC4FA 6A20 8FC4FA <CJK>
+8FC4FB 6A24 8FC4FB <CJK>
+8FC4FC 6A28 8FC4FC <CJK>
+8FC4FD 6A30 8FC4FD <CJK>
+8FC4FE 6A32 8FC4FE <CJK>
+8FC5A1 6A34 8FC5A1 <CJK>
+8FC5A2 6A37 8FC5A2 <CJK>
+8FC5A3 6A3B 8FC5A3 <CJK>
+8FC5A4 6A3E 8FC5A4 <CJK>
+8FC5A5 6A3F 8FC5A5 <CJK>
+8FC5A6 6A45 8FC5A6 <CJK>
+8FC5A7 6A46 8FC5A7 <CJK>
+8FC5A8 6A49 8FC5A8 <CJK>
+8FC5A9 6A4A 8FC5A9 <CJK>
+8FC5AA 6A4E 8FC5AA <CJK>
+8FC5AB 6A50 8FC5AB <CJK>
+8FC5AC 6A51 8FC5AC <CJK>
+8FC5AD 6A52 8FC5AD <CJK>
+8FC5AE 6A55 8FC5AE <CJK>
+8FC5AF 6A56 8FC5AF <CJK>
+8FC5B0 6A5B 8FC5B0 <CJK>
+8FC5B1 6A64 8FC5B1 <CJK>
+8FC5B2 6A67 8FC5B2 <CJK>
+8FC5B3 6A6A 8FC5B3 <CJK>
+8FC5B4 6A71 8FC5B4 <CJK>
+8FC5B5 6A73 8FC5B5 <CJK>
+8FC5B6 6A7E 8FC5B6 <CJK>
+8FC5B7 6A81 8FC5B7 <CJK>
+8FC5B8 6A83 8FC5B8 <CJK>
+8FC5B9 6A86 8FC5B9 <CJK>
+8FC5BA 6A87 8FC5BA <CJK>
+8FC5BB 6A89 8FC5BB <CJK>
+8FC5BC 6A8B 8FC5BC <CJK>
+8FC5BD 6A91 8FC5BD <CJK>
+8FC5BE 6A9B 8FC5BE <CJK>
+8FC5BF 6A9D 8FC5BF <CJK>
+8FC5C0 6A9E 8FC5C0 <CJK>
+8FC5C1 6A9F 8FC5C1 <CJK>
+8FC5C2 6AA5 8FC5C2 <CJK>
+8FC5C3 6AAB 8FC5C3 <CJK>
+8FC5C4 6AAF 8FC5C4 <CJK>
+8FC5C5 6AB0 8FC5C5 <CJK>
+8FC5C6 6AB1 8FC5C6 <CJK>
+8FC5C7 6AB4 8FC5C7 <CJK>
+8FC5C8 6ABD 8FC5C8 <CJK>
+8FC5C9 6ABE 8FC5C9 <CJK>
+8FC5CA 6ABF 8FC5CA <CJK>
+8FC5CB 6AC6 8FC5CB <CJK>
+8FC5CC 6AC9 8FC5CC <CJK>
+8FC5CD 6AC8 8FC5CD <CJK>
+8FC5CE 6ACC 8FC5CE <CJK>
+8FC5CF 6AD0 8FC5CF <CJK>
+8FC5D0 6AD4 8FC5D0 <CJK>
+8FC5D1 6AD5 8FC5D1 <CJK>
+8FC5D2 6AD6 8FC5D2 <CJK>
+8FC5D3 6ADC 8FC5D3 <CJK>
+8FC5D4 6ADD 8FC5D4 <CJK>
+8FC5D5 6AE4 8FC5D5 <CJK>
+8FC5D6 6AE7 8FC5D6 <CJK>
+8FC5D7 6AEC 8FC5D7 <CJK>
+8FC5D8 6AF0 8FC5D8 <CJK>
+8FC5D9 6AF1 8FC5D9 <CJK>
+8FC5DA 6AF2 8FC5DA <CJK>
+8FC5DB 6AFC 8FC5DB <CJK>
+8FC5DC 6AFD 8FC5DC <CJK>
+8FC5DD 6B02 8FC5DD <CJK>
+8FC5DE 6B03 8FC5DE <CJK>
+8FC5DF 6B06 8FC5DF <CJK>
+8FC5E0 6B07 8FC5E0 <CJK>
+8FC5E1 6B09 8FC5E1 <CJK>
+8FC5E2 6B0F 8FC5E2 <CJK>
+8FC5E3 6B10 8FC5E3 <CJK>
+8FC5E4 6B11 8FC5E4 <CJK>
+8FC5E5 6B17 8FC5E5 <CJK>
+8FC5E6 6B1B 8FC5E6 <CJK>
+8FC5E7 6B1E 8FC5E7 <CJK>
+8FC5E8 6B24 8FC5E8 <CJK>
+8FC5E9 6B28 8FC5E9 <CJK>
+8FC5EA 6B2B 8FC5EA <CJK>
+8FC5EB 6B2C 8FC5EB <CJK>
+8FC5EC 6B2F 8FC5EC <CJK>
+8FC5ED 6B35 8FC5ED <CJK>
+8FC5EE 6B36 8FC5EE <CJK>
+8FC5EF 6B3B 8FC5EF <CJK>
+8FC5F0 6B3F 8FC5F0 <CJK>
+8FC5F1 6B46 8FC5F1 <CJK>
+8FC5F2 6B4A 8FC5F2 <CJK>
+8FC5F3 6B4D 8FC5F3 <CJK>
+8FC5F4 6B52 8FC5F4 <CJK>
+8FC5F5 6B56 8FC5F5 <CJK>
+8FC5F6 6B58 8FC5F6 <CJK>
+8FC5F7 6B5D 8FC5F7 <CJK>
+8FC5F8 6B60 8FC5F8 <CJK>
+8FC5F9 6B67 8FC5F9 <CJK>
+8FC5FA 6B6B 8FC5FA <CJK>
+8FC5FB 6B6E 8FC5FB <CJK>
+8FC5FC 6B70 8FC5FC <CJK>
+8FC5FD 6B75 8FC5FD <CJK>
+8FC5FE 6B7D 8FC5FE <CJK>
+8FC6A1 6B7E 8FC6A1 <CJK>
+8FC6A2 6B82 8FC6A2 <CJK>
+8FC6A3 6B85 8FC6A3 <CJK>
+8FC6A4 6B97 8FC6A4 <CJK>
+8FC6A5 6B9B 8FC6A5 <CJK>
+8FC6A6 6B9F 8FC6A6 <CJK>
+8FC6A7 6BA0 8FC6A7 <CJK>
+8FC6A8 6BA2 8FC6A8 <CJK>
+8FC6A9 6BA3 8FC6A9 <CJK>
+8FC6AA 6BA8 8FC6AA <CJK>
+8FC6AB 6BA9 8FC6AB <CJK>
+8FC6AC 6BAC 8FC6AC <CJK>
+8FC6AD 6BAD 8FC6AD <CJK>
+8FC6AE 6BAE 8FC6AE <CJK>
+8FC6AF 6BB0 8FC6AF <CJK>
+8FC6B0 6BB8 8FC6B0 <CJK>
+8FC6B1 6BB9 8FC6B1 <CJK>
+8FC6B2 6BBD 8FC6B2 <CJK>
+8FC6B3 6BBE 8FC6B3 <CJK>
+8FC6B4 6BC3 8FC6B4 <CJK>
+8FC6B5 6BC4 8FC6B5 <CJK>
+8FC6B6 6BC9 8FC6B6 <CJK>
+8FC6B7 6BCC 8FC6B7 <CJK>
+8FC6B8 6BD6 8FC6B8 <CJK>
+8FC6B9 6BDA 8FC6B9 <CJK>
+8FC6BA 6BE1 8FC6BA <CJK>
+8FC6BB 6BE3 8FC6BB <CJK>
+8FC6BC 6BE6 8FC6BC <CJK>
+8FC6BD 6BE7 8FC6BD <CJK>
+8FC6BE 6BEE 8FC6BE <CJK>
+8FC6BF 6BF1 8FC6BF <CJK>
+8FC6C0 6BF7 8FC6C0 <CJK>
+8FC6C1 6BF9 8FC6C1 <CJK>
+8FC6C2 6BFF 8FC6C2 <CJK>
+8FC6C3 6C02 8FC6C3 <CJK>
+8FC6C4 6C04 8FC6C4 <CJK>
+8FC6C5 6C05 8FC6C5 <CJK>
+8FC6C6 6C09 8FC6C6 <CJK>
+8FC6C7 6C0D 8FC6C7 <CJK>
+8FC6C8 6C0E 8FC6C8 <CJK>
+8FC6C9 6C10 8FC6C9 <CJK>
+8FC6CA 6C12 8FC6CA <CJK>
+8FC6CB 6C19 8FC6CB <CJK>
+8FC6CC 6C1F 8FC6CC <CJK>
+8FC6CD 6C26 8FC6CD <CJK>
+8FC6CE 6C27 8FC6CE <CJK>
+8FC6CF 6C28 8FC6CF <CJK>
+8FC6D0 6C2C 8FC6D0 <CJK>
+8FC6D1 6C2E 8FC6D1 <CJK>
+8FC6D2 6C33 8FC6D2 <CJK>
+8FC6D3 6C35 8FC6D3 <CJK>
+8FC6D4 6C36 8FC6D4 <CJK>
+8FC6D5 6C3A 8FC6D5 <CJK>
+8FC6D6 6C3B 8FC6D6 <CJK>
+8FC6D7 6C3F 8FC6D7 <CJK>
+8FC6D8 6C4A 8FC6D8 <CJK>
+8FC6D9 6C4B 8FC6D9 <CJK>
+8FC6DA 6C4D 8FC6DA <CJK>
+8FC6DB 6C4F 8FC6DB <CJK>
+8FC6DC 6C52 8FC6DC <CJK>
+8FC6DD 6C54 8FC6DD <CJK>
+8FC6DE 6C59 8FC6DE <CJK>
+8FC6DF 6C5B 8FC6DF <CJK>
+8FC6E0 6C5C 8FC6E0 <CJK>
+8FC6E1 6C6B 8FC6E1 <CJK>
+8FC6E2 6C6D 8FC6E2 <CJK>
+8FC6E3 6C6F 8FC6E3 <CJK>
+8FC6E4 6C74 8FC6E4 <CJK>
+8FC6E5 6C76 8FC6E5 <CJK>
+8FC6E6 6C78 8FC6E6 <CJK>
+8FC6E7 6C79 8FC6E7 <CJK>
+8FC6E8 6C7B 8FC6E8 <CJK>
+8FC6E9 6C85 8FC6E9 <CJK>
+8FC6EA 6C86 8FC6EA <CJK>
+8FC6EB 6C87 8FC6EB <CJK>
+8FC6EC 6C89 8FC6EC <CJK>
+8FC6ED 6C94 8FC6ED <CJK>
+8FC6EE 6C95 8FC6EE <CJK>
+8FC6EF 6C97 8FC6EF <CJK>
+8FC6F0 6C98 8FC6F0 <CJK>
+8FC6F1 6C9C 8FC6F1 <CJK>
+8FC6F2 6C9F 8FC6F2 <CJK>
+8FC6F3 6CB0 8FC6F3 <CJK>
+8FC6F4 6CB2 8FC6F4 <CJK>
+8FC6F5 6CB4 8FC6F5 <CJK>
+8FC6F6 6CC2 8FC6F6 <CJK>
+8FC6F7 6CC6 8FC6F7 <CJK>
+8FC6F8 6CCD 8FC6F8 <CJK>
+8FC6F9 6CCF 8FC6F9 <CJK>
+8FC6FA 6CD0 8FC6FA <CJK>
+8FC6FB 6CD1 8FC6FB <CJK>
+8FC6FC 6CD2 8FC6FC <CJK>
+8FC6FD 6CD4 8FC6FD <CJK>
+8FC6FE 6CD6 8FC6FE <CJK>
+8FC7A1 6CDA 8FC7A1 <CJK>
+8FC7A2 6CDC 8FC7A2 <CJK>
+8FC7A3 6CE0 8FC7A3 <CJK>
+8FC7A4 6CE7 8FC7A4 <CJK>
+8FC7A5 6CE9 8FC7A5 <CJK>
+8FC7A6 6CEB 8FC7A6 <CJK>
+8FC7A7 6CEC 8FC7A7 <CJK>
+8FC7A8 6CEE 8FC7A8 <CJK>
+8FC7A9 6CF2 8FC7A9 <CJK>
+8FC7AA 6CF4 8FC7AA <CJK>
+8FC7AB 6D04 8FC7AB <CJK>
+8FC7AC 6D07 8FC7AC <CJK>
+8FC7AD 6D0A 8FC7AD <CJK>
+8FC7AE 6D0E 8FC7AE <CJK>
+8FC7AF 6D0F 8FC7AF <CJK>
+8FC7B0 6D11 8FC7B0 <CJK>
+8FC7B1 6D13 8FC7B1 <CJK>
+8FC7B2 6D1A 8FC7B2 <CJK>
+8FC7B3 6D26 8FC7B3 <CJK>
+8FC7B4 6D27 8FC7B4 <CJK>
+8FC7B5 6D28 8FC7B5 <CJK>
+8FC7B6 6C67 8FC7B6 <CJK>
+8FC7B7 6D2E 8FC7B7 <CJK>
+8FC7B8 6D2F 8FC7B8 <CJK>
+8FC7B9 6D31 8FC7B9 <CJK>
+8FC7BA 6D39 8FC7BA <CJK>
+8FC7BB 6D3C 8FC7BB <CJK>
+8FC7BC 6D3F 8FC7BC <CJK>
+8FC7BD 6D57 8FC7BD <CJK>
+8FC7BE 6D5E 8FC7BE <CJK>
+8FC7BF 6D5F 8FC7BF <CJK>
+8FC7C0 6D61 8FC7C0 <CJK>
+8FC7C1 6D65 8FC7C1 <CJK>
+8FC7C2 6D67 8FC7C2 <CJK>
+8FC7C3 6D6F 8FC7C3 <CJK>
+8FC7C4 6D70 8FC7C4 <CJK>
+8FC7C5 6D7C 8FC7C5 <CJK>
+8FC7C6 6D82 8FC7C6 <CJK>
+8FC7C7 6D87 8FC7C7 <CJK>
+8FC7C8 6D91 8FC7C8 <CJK>
+8FC7C9 6D92 8FC7C9 <CJK>
+8FC7CA 6D94 8FC7CA <CJK>
+8FC7CB 6D96 8FC7CB <CJK>
+8FC7CC 6D97 8FC7CC <CJK>
+8FC7CD 6D98 8FC7CD <CJK>
+8FC7CE 6DAA 8FC7CE <CJK>
+8FC7CF 6DAC 8FC7CF <CJK>
+8FC7D0 6DB4 8FC7D0 <CJK>
+8FC7D1 6DB7 8FC7D1 <CJK>
+8FC7D2 6DB9 8FC7D2 <CJK>
+8FC7D3 6DBD 8FC7D3 <CJK>
+8FC7D4 6DBF 8FC7D4 <CJK>
+8FC7D5 6DC4 8FC7D5 <CJK>
+8FC7D6 6DC8 8FC7D6 <CJK>
+8FC7D7 6DCA 8FC7D7 <CJK>
+8FC7D8 6DCE 8FC7D8 <CJK>
+8FC7D9 6DCF 8FC7D9 <CJK>
+8FC7DA 6DD6 8FC7DA <CJK>
+8FC7DB 6DDB 8FC7DB <CJK>
+8FC7DC 6DDD 8FC7DC <CJK>
+8FC7DD 6DDF 8FC7DD <CJK>
+8FC7DE 6DE0 8FC7DE <CJK>
+8FC7DF 6DE2 8FC7DF <CJK>
+8FC7E0 6DE5 8FC7E0 <CJK>
+8FC7E1 6DE9 8FC7E1 <CJK>
+8FC7E2 6DEF 8FC7E2 <CJK>
+8FC7E3 6DF0 8FC7E3 <CJK>
+8FC7E4 6DF4 8FC7E4 <CJK>
+8FC7E5 6DF6 8FC7E5 <CJK>
+8FC7E6 6DFC 8FC7E6 <CJK>
+8FC7E7 6E00 8FC7E7 <CJK>
+8FC7E8 6E04 8FC7E8 <CJK>
+8FC7E9 6E1E 8FC7E9 <CJK>
+8FC7EA 6E22 8FC7EA <CJK>
+8FC7EB 6E27 8FC7EB <CJK>
+8FC7EC 6E32 8FC7EC <CJK>
+8FC7ED 6E36 8FC7ED <CJK>
+8FC7EE 6E39 8FC7EE <CJK>
+8FC7EF 6E3B 8FC7EF <CJK>
+8FC7F0 6E3C 8FC7F0 <CJK>
+8FC7F1 6E44 8FC7F1 <CJK>
+8FC7F2 6E45 8FC7F2 <CJK>
+8FC7F3 6E48 8FC7F3 <CJK>
+8FC7F4 6E49 8FC7F4 <CJK>
+8FC7F5 6E4B 8FC7F5 <CJK>
+8FC7F6 6E4F 8FC7F6 <CJK>
+8FC7F7 6E51 8FC7F7 <CJK>
+8FC7F8 6E52 8FC7F8 <CJK>
+8FC7F9 6E53 8FC7F9 <CJK>
+8FC7FA 6E54 8FC7FA <CJK>
+8FC7FB 6E57 8FC7FB <CJK>
+8FC7FC 6E5C 8FC7FC <CJK>
+8FC7FD 6E5D 8FC7FD <CJK>
+8FC7FE 6E5E 8FC7FE <CJK>
+8FC8A1 6E62 8FC8A1 <CJK>
+8FC8A2 6E63 8FC8A2 <CJK>
+8FC8A3 6E68 8FC8A3 <CJK>
+8FC8A4 6E73 8FC8A4 <CJK>
+8FC8A5 6E7B 8FC8A5 <CJK>
+8FC8A6 6E7D 8FC8A6 <CJK>
+8FC8A7 6E8D 8FC8A7 <CJK>
+8FC8A8 6E93 8FC8A8 <CJK>
+8FC8A9 6E99 8FC8A9 <CJK>
+8FC8AA 6EA0 8FC8AA <CJK>
+8FC8AB 6EA7 8FC8AB <CJK>
+8FC8AC 6EAD 8FC8AC <CJK>
+8FC8AD 6EAE 8FC8AD <CJK>
+8FC8AE 6EB1 8FC8AE <CJK>
+8FC8AF 6EB3 8FC8AF <CJK>
+8FC8B0 6EBB 8FC8B0 <CJK>
+8FC8B1 6EBF 8FC8B1 <CJK>
+8FC8B2 6EC0 8FC8B2 <CJK>
+8FC8B3 6EC1 8FC8B3 <CJK>
+8FC8B4 6EC3 8FC8B4 <CJK>
+8FC8B5 6EC7 8FC8B5 <CJK>
+8FC8B6 6EC8 8FC8B6 <CJK>
+8FC8B7 6ECA 8FC8B7 <CJK>
+8FC8B8 6ECD 8FC8B8 <CJK>
+8FC8B9 6ECE 8FC8B9 <CJK>
+8FC8BA 6ECF 8FC8BA <CJK>
+8FC8BB 6EEB 8FC8BB <CJK>
+8FC8BC 6EED 8FC8BC <CJK>
+8FC8BD 6EEE 8FC8BD <CJK>
+8FC8BE 6EF9 8FC8BE <CJK>
+8FC8BF 6EFB 8FC8BF <CJK>
+8FC8C0 6EFD 8FC8C0 <CJK>
+8FC8C1 6F04 8FC8C1 <CJK>
+8FC8C2 6F08 8FC8C2 <CJK>
+8FC8C3 6F0A 8FC8C3 <CJK>
+8FC8C4 6F0C 8FC8C4 <CJK>
+8FC8C5 6F0D 8FC8C5 <CJK>
+8FC8C6 6F16 8FC8C6 <CJK>
+8FC8C7 6F18 8FC8C7 <CJK>
+8FC8C8 6F1A 8FC8C8 <CJK>
+8FC8C9 6F1B 8FC8C9 <CJK>
+8FC8CA 6F26 8FC8CA <CJK>
+8FC8CB 6F29 8FC8CB <CJK>
+8FC8CC 6F2A 8FC8CC <CJK>
+8FC8CD 6F2F 8FC8CD <CJK>
+8FC8CE 6F30 8FC8CE <CJK>
+8FC8CF 6F33 8FC8CF <CJK>
+8FC8D0 6F36 8FC8D0 <CJK>
+8FC8D1 6F3B 8FC8D1 <CJK>
+8FC8D2 6F3C 8FC8D2 <CJK>
+8FC8D3 6F2D 8FC8D3 <CJK>
+8FC8D4 6F4F 8FC8D4 <CJK>
+8FC8D5 6F51 8FC8D5 <CJK>
+8FC8D6 6F52 8FC8D6 <CJK>
+8FC8D7 6F53 8FC8D7 <CJK>
+8FC8D8 6F57 8FC8D8 <CJK>
+8FC8D9 6F59 8FC8D9 <CJK>
+8FC8DA 6F5A 8FC8DA <CJK>
+8FC8DB 6F5D 8FC8DB <CJK>
+8FC8DC 6F5E 8FC8DC <CJK>
+8FC8DD 6F61 8FC8DD <CJK>
+8FC8DE 6F62 8FC8DE <CJK>
+8FC8DF 6F68 8FC8DF <CJK>
+8FC8E0 6F6C 8FC8E0 <CJK>
+8FC8E1 6F7D 8FC8E1 <CJK>
+8FC8E2 6F7E 8FC8E2 <CJK>
+8FC8E3 6F83 8FC8E3 <CJK>
+8FC8E4 6F87 8FC8E4 <CJK>
+8FC8E5 6F88 8FC8E5 <CJK>
+8FC8E6 6F8B 8FC8E6 <CJK>
+8FC8E7 6F8C 8FC8E7 <CJK>
+8FC8E8 6F8D 8FC8E8 <CJK>
+8FC8E9 6F90 8FC8E9 <CJK>
+8FC8EA 6F92 8FC8EA <CJK>
+8FC8EB 6F93 8FC8EB <CJK>
+8FC8EC 6F94 8FC8EC <CJK>
+8FC8ED 6F96 8FC8ED <CJK>
+8FC8EE 6F9A 8FC8EE <CJK>
+8FC8EF 6F9F 8FC8EF <CJK>
+8FC8F0 6FA0 8FC8F0 <CJK>
+8FC8F1 6FA5 8FC8F1 <CJK>
+8FC8F2 6FA6 8FC8F2 <CJK>
+8FC8F3 6FA7 8FC8F3 <CJK>
+8FC8F4 6FA8 8FC8F4 <CJK>
+8FC8F5 6FAE 8FC8F5 <CJK>
+8FC8F6 6FAF 8FC8F6 <CJK>
+8FC8F7 6FB0 8FC8F7 <CJK>
+8FC8F8 6FB5 8FC8F8 <CJK>
+8FC8F9 6FB6 8FC8F9 <CJK>
+8FC8FA 6FBC 8FC8FA <CJK>
+8FC8FB 6FC5 8FC8FB <CJK>
+8FC8FC 6FC7 8FC8FC <CJK>
+8FC8FD 6FC8 8FC8FD <CJK>
+8FC8FE 6FCA 8FC8FE <CJK>
+8FC9A1 6FDA 8FC9A1 <CJK>
+8FC9A2 6FDE 8FC9A2 <CJK>
+8FC9A3 6FE8 8FC9A3 <CJK>
+8FC9A4 6FE9 8FC9A4 <CJK>
+8FC9A5 6FF0 8FC9A5 <CJK>
+8FC9A6 6FF5 8FC9A6 <CJK>
+8FC9A7 6FF9 8FC9A7 <CJK>
+8FC9A8 6FFC 8FC9A8 <CJK>
+8FC9A9 6FFD 8FC9A9 <CJK>
+8FC9AA 7000 8FC9AA <CJK>
+8FC9AB 7005 8FC9AB <CJK>
+8FC9AC 7006 8FC9AC <CJK>
+8FC9AD 7007 8FC9AD <CJK>
+8FC9AE 700D 8FC9AE <CJK>
+8FC9AF 7017 8FC9AF <CJK>
+8FC9B0 7020 8FC9B0 <CJK>
+8FC9B1 7023 8FC9B1 <CJK>
+8FC9B2 702F 8FC9B2 <CJK>
+8FC9B3 7034 8FC9B3 <CJK>
+8FC9B4 7037 8FC9B4 <CJK>
+8FC9B5 7039 8FC9B5 <CJK>
+8FC9B6 703C 8FC9B6 <CJK>
+8FC9B7 7043 8FC9B7 <CJK>
+8FC9B8 7044 8FC9B8 <CJK>
+8FC9B9 7048 8FC9B9 <CJK>
+8FC9BA 7049 8FC9BA <CJK>
+8FC9BB 704A 8FC9BB <CJK>
+8FC9BC 704B 8FC9BC <CJK>
+8FC9BD 7054 8FC9BD <CJK>
+8FC9BE 7055 8FC9BE <CJK>
+8FC9BF 705D 8FC9BF <CJK>
+8FC9C0 705E 8FC9C0 <CJK>
+8FC9C1 704E 8FC9C1 <CJK>
+8FC9C2 7064 8FC9C2 <CJK>
+8FC9C3 7065 8FC9C3 <CJK>
+8FC9C4 706C 8FC9C4 <CJK>
+8FC9C5 706E 8FC9C5 <CJK>
+8FC9C6 7075 8FC9C6 <CJK>
+8FC9C7 7076 8FC9C7 <CJK>
+8FC9C8 707E 8FC9C8 <CJK>
+8FC9C9 7081 8FC9C9 <CJK>
+8FC9CA 7085 8FC9CA <CJK>
+8FC9CB 7086 8FC9CB <CJK>
+8FC9CC 7094 8FC9CC <CJK>
+8FC9CD 7095 8FC9CD <CJK>
+8FC9CE 7096 8FC9CE <CJK>
+8FC9CF 7097 8FC9CF <CJK>
+8FC9D0 7098 8FC9D0 <CJK>
+8FC9D1 709B 8FC9D1 <CJK>
+8FC9D2 70A4 8FC9D2 <CJK>
+8FC9D3 70AB 8FC9D3 <CJK>
+8FC9D4 70B0 8FC9D4 <CJK>
+8FC9D5 70B1 8FC9D5 <CJK>
+8FC9D6 70B4 8FC9D6 <CJK>
+8FC9D7 70B7 8FC9D7 <CJK>
+8FC9D8 70CA 8FC9D8 <CJK>
+8FC9D9 70D1 8FC9D9 <CJK>
+8FC9DA 70D3 8FC9DA <CJK>
+8FC9DB 70D4 8FC9DB <CJK>
+8FC9DC 70D5 8FC9DC <CJK>
+8FC9DD 70D6 8FC9DD <CJK>
+8FC9DE 70D8 8FC9DE <CJK>
+8FC9DF 70DC 8FC9DF <CJK>
+8FC9E0 70E4 8FC9E0 <CJK>
+8FC9E1 70FA 8FC9E1 <CJK>
+8FC9E2 7103 8FC9E2 <CJK>
+8FC9E3 7104 8FC9E3 <CJK>
+8FC9E4 7105 8FC9E4 <CJK>
+8FC9E5 7106 8FC9E5 <CJK>
+8FC9E6 7107 8FC9E6 <CJK>
+8FC9E7 710B 8FC9E7 <CJK>
+8FC9E8 710C 8FC9E8 <CJK>
+8FC9E9 710F 8FC9E9 <CJK>
+8FC9EA 711E 8FC9EA <CJK>
+8FC9EB 7120 8FC9EB <CJK>
+8FC9EC 712B 8FC9EC <CJK>
+8FC9ED 712D 8FC9ED <CJK>
+8FC9EE 712F 8FC9EE <CJK>
+8FC9EF 7130 8FC9EF <CJK>
+8FC9F0 7131 8FC9F0 <CJK>
+8FC9F1 7138 8FC9F1 <CJK>
+8FC9F2 7141 8FC9F2 <CJK>
+8FC9F3 7145 8FC9F3 <CJK>
+8FC9F4 7146 8FC9F4 <CJK>
+8FC9F5 7147 8FC9F5 <CJK>
+8FC9F6 714A 8FC9F6 <CJK>
+8FC9F7 714B 8FC9F7 <CJK>
+8FC9F8 7150 8FC9F8 <CJK>
+8FC9F9 7152 8FC9F9 <CJK>
+8FC9FA 7157 8FC9FA <CJK>
+8FC9FB 715A 8FC9FB <CJK>
+8FC9FC 715C 8FC9FC <CJK>
+8FC9FD 715E 8FC9FD <CJK>
+8FC9FE 7160 8FC9FE <CJK>
+8FCAA1 7168 8FCAA1 <CJK>
+8FCAA2 7179 8FCAA2 <CJK>
+8FCAA3 7180 8FCAA3 <CJK>
+8FCAA4 7185 8FCAA4 <CJK>
+8FCAA5 7187 8FCAA5 <CJK>
+8FCAA6 718C 8FCAA6 <CJK>
+8FCAA7 7192 8FCAA7 <CJK>
+8FCAA8 719A 8FCAA8 <CJK>
+8FCAA9 719B 8FCAA9 <CJK>
+8FCAAA 71A0 8FCAAA <CJK>
+8FCAAB 71A2 8FCAAB <CJK>
+8FCAAC 71AF 8FCAAC <CJK>
+8FCAAD 71B0 8FCAAD <CJK>
+8FCAAE 71B2 8FCAAE <CJK>
+8FCAAF 71B3 8FCAAF <CJK>
+8FCAB0 71BA 8FCAB0 <CJK>
+8FCAB1 71BF 8FCAB1 <CJK>
+8FCAB2 71C0 8FCAB2 <CJK>
+8FCAB3 71C1 8FCAB3 <CJK>
+8FCAB4 71C4 8FCAB4 <CJK>
+8FCAB5 71CB 8FCAB5 <CJK>
+8FCAB6 71CC 8FCAB6 <CJK>
+8FCAB7 71D3 8FCAB7 <CJK>
+8FCAB8 71D6 8FCAB8 <CJK>
+8FCAB9 71D9 8FCAB9 <CJK>
+8FCABA 71DA 8FCABA <CJK>
+8FCABB 71DC 8FCABB <CJK>
+8FCABC 71F8 8FCABC <CJK>
+8FCABD 71FE 8FCABD <CJK>
+8FCABE 7200 8FCABE <CJK>
+8FCABF 7207 8FCABF <CJK>
+8FCAC0 7208 8FCAC0 <CJK>
+8FCAC1 7209 8FCAC1 <CJK>
+8FCAC2 7213 8FCAC2 <CJK>
+8FCAC3 7217 8FCAC3 <CJK>
+8FCAC4 721A 8FCAC4 <CJK>
+8FCAC5 721D 8FCAC5 <CJK>
+8FCAC6 721F 8FCAC6 <CJK>
+8FCAC7 7224 8FCAC7 <CJK>
+8FCAC8 722B 8FCAC8 <CJK>
+8FCAC9 722F 8FCAC9 <CJK>
+8FCACA 7234 8FCACA <CJK>
+8FCACB 7238 8FCACB <CJK>
+8FCACC 7239 8FCACC <CJK>
+8FCACD 7241 8FCACD <CJK>
+8FCACE 7242 8FCACE <CJK>
+8FCACF 7243 8FCACF <CJK>
+8FCAD0 7245 8FCAD0 <CJK>
+8FCAD1 724E 8FCAD1 <CJK>
+8FCAD2 724F 8FCAD2 <CJK>
+8FCAD3 7250 8FCAD3 <CJK>
+8FCAD4 7253 8FCAD4 <CJK>
+8FCAD5 7255 8FCAD5 <CJK>
+8FCAD6 7256 8FCAD6 <CJK>
+8FCAD7 725A 8FCAD7 <CJK>
+8FCAD8 725C 8FCAD8 <CJK>
+8FCAD9 725E 8FCAD9 <CJK>
+8FCADA 7260 8FCADA <CJK>
+8FCADB 7263 8FCADB <CJK>
+8FCADC 7268 8FCADC <CJK>
+8FCADD 726B 8FCADD <CJK>
+8FCADE 726E 8FCADE <CJK>
+8FCADF 726F 8FCADF <CJK>
+8FCAE0 7271 8FCAE0 <CJK>
+8FCAE1 7277 8FCAE1 <CJK>
+8FCAE2 7278 8FCAE2 <CJK>
+8FCAE3 727B 8FCAE3 <CJK>
+8FCAE4 727C 8FCAE4 <CJK>
+8FCAE5 727F 8FCAE5 <CJK>
+8FCAE6 7284 8FCAE6 <CJK>
+8FCAE7 7289 8FCAE7 <CJK>
+8FCAE8 728D 8FCAE8 <CJK>
+8FCAE9 728E 8FCAE9 <CJK>
+8FCAEA 7293 8FCAEA <CJK>
+8FCAEB 729B 8FCAEB <CJK>
+8FCAEC 72A8 8FCAEC <CJK>
+8FCAED 72AD 8FCAED <CJK>
+8FCAEE 72AE 8FCAEE <CJK>
+8FCAEF 72B1 8FCAEF <CJK>
+8FCAF0 72B4 8FCAF0 <CJK>
+8FCAF1 72BE 8FCAF1 <CJK>
+8FCAF2 72C1 8FCAF2 <CJK>
+8FCAF3 72C7 8FCAF3 <CJK>
+8FCAF4 72C9 8FCAF4 <CJK>
+8FCAF5 72CC 8FCAF5 <CJK>
+8FCAF6 72D5 8FCAF6 <CJK>
+8FCAF7 72D6 8FCAF7 <CJK>
+8FCAF8 72D8 8FCAF8 <CJK>
+8FCAF9 72DF 8FCAF9 <CJK>
+8FCAFA 72E5 8FCAFA <CJK>
+8FCAFB 72F3 8FCAFB <CJK>
+8FCAFC 72F4 8FCAFC <CJK>
+8FCAFD 72FA 8FCAFD <CJK>
+8FCAFE 72FB 8FCAFE <CJK>
+8FCBA1 72FE 8FCBA1 <CJK>
+8FCBA2 7302 8FCBA2 <CJK>
+8FCBA3 7304 8FCBA3 <CJK>
+8FCBA4 7305 8FCBA4 <CJK>
+8FCBA5 7307 8FCBA5 <CJK>
+8FCBA6 730B 8FCBA6 <CJK>
+8FCBA7 730D 8FCBA7 <CJK>
+8FCBA8 7312 8FCBA8 <CJK>
+8FCBA9 7313 8FCBA9 <CJK>
+8FCBAA 7318 8FCBAA <CJK>
+8FCBAB 7319 8FCBAB <CJK>
+8FCBAC 731E 8FCBAC <CJK>
+8FCBAD 7322 8FCBAD <CJK>
+8FCBAE 7324 8FCBAE <CJK>
+8FCBAF 7327 8FCBAF <CJK>
+8FCBB0 7328 8FCBB0 <CJK>
+8FCBB1 732C 8FCBB1 <CJK>
+8FCBB2 7331 8FCBB2 <CJK>
+8FCBB3 7332 8FCBB3 <CJK>
+8FCBB4 7335 8FCBB4 <CJK>
+8FCBB5 733A 8FCBB5 <CJK>
+8FCBB6 733B 8FCBB6 <CJK>
+8FCBB7 733D 8FCBB7 <CJK>
+8FCBB8 7343 8FCBB8 <CJK>
+8FCBB9 734D 8FCBB9 <CJK>
+8FCBBA 7350 8FCBBA <CJK>
+8FCBBB 7352 8FCBBB <CJK>
+8FCBBC 7356 8FCBBC <CJK>
+8FCBBD 7358 8FCBBD <CJK>
+8FCBBE 735D 8FCBBE <CJK>
+8FCBBF 735E 8FCBBF <CJK>
+8FCBC0 735F 8FCBC0 <CJK>
+8FCBC1 7360 8FCBC1 <CJK>
+8FCBC2 7366 8FCBC2 <CJK>
+8FCBC3 7367 8FCBC3 <CJK>
+8FCBC4 7369 8FCBC4 <CJK>
+8FCBC5 736B 8FCBC5 <CJK>
+8FCBC6 736C 8FCBC6 <CJK>
+8FCBC7 736E 8FCBC7 <CJK>
+8FCBC8 736F 8FCBC8 <CJK>
+8FCBC9 7371 8FCBC9 <CJK>
+8FCBCA 7377 8FCBCA <CJK>
+8FCBCB 7379 8FCBCB <CJK>
+8FCBCC 737C 8FCBCC <CJK>
+8FCBCD 7380 8FCBCD <CJK>
+8FCBCE 7381 8FCBCE <CJK>
+8FCBCF 7383 8FCBCF <CJK>
+8FCBD0 7385 8FCBD0 <CJK>
+8FCBD1 7386 8FCBD1 <CJK>
+8FCBD2 738E 8FCBD2 <CJK>
+8FCBD3 7390 8FCBD3 <CJK>
+8FCBD4 7393 8FCBD4 <CJK>
+8FCBD5 7395 8FCBD5 <CJK>
+8FCBD6 7397 8FCBD6 <CJK>
+8FCBD7 7398 8FCBD7 <CJK>
+8FCBD8 739C 8FCBD8 <CJK>
+8FCBD9 739E 8FCBD9 <CJK>
+8FCBDA 739F 8FCBDA <CJK>
+8FCBDB 73A0 8FCBDB <CJK>
+8FCBDC 73A2 8FCBDC <CJK>
+8FCBDD 73A5 8FCBDD <CJK>
+8FCBDE 73A6 8FCBDE <CJK>
+8FCBDF 73AA 8FCBDF <CJK>
+8FCBE0 73AB 8FCBE0 <CJK>
+8FCBE1 73AD 8FCBE1 <CJK>
+8FCBE2 73B5 8FCBE2 <CJK>
+8FCBE3 73B7 8FCBE3 <CJK>
+8FCBE4 73B9 8FCBE4 <CJK>
+8FCBE5 73BC 8FCBE5 <CJK>
+8FCBE6 73BD 8FCBE6 <CJK>
+8FCBE7 73BF 8FCBE7 <CJK>
+8FCBE8 73C5 8FCBE8 <CJK>
+8FCBE9 73C6 8FCBE9 <CJK>
+8FCBEA 73C9 8FCBEA <CJK>
+8FCBEB 73CB 8FCBEB <CJK>
+8FCBEC 73CC 8FCBEC <CJK>
+8FCBED 73CF 8FCBED <CJK>
+8FCBEE 73D2 8FCBEE <CJK>
+8FCBEF 73D3 8FCBEF <CJK>
+8FCBF0 73D6 8FCBF0 <CJK>
+8FCBF1 73D9 8FCBF1 <CJK>
+8FCBF2 73DD 8FCBF2 <CJK>
+8FCBF3 73E1 8FCBF3 <CJK>
+8FCBF4 73E3 8FCBF4 <CJK>
+8FCBF5 73E6 8FCBF5 <CJK>
+8FCBF6 73E7 8FCBF6 <CJK>
+8FCBF7 73E9 8FCBF7 <CJK>
+8FCBF8 73F4 8FCBF8 <CJK>
+8FCBF9 73F5 8FCBF9 <CJK>
+8FCBFA 73F7 8FCBFA <CJK>
+8FCBFB 73F9 8FCBFB <CJK>
+8FCBFC 73FA 8FCBFC <CJK>
+8FCBFD 73FB 8FCBFD <CJK>
+8FCBFE 73FD 8FCBFE <CJK>
+8FCCA1 73FF 8FCCA1 <CJK>
+8FCCA2 7400 8FCCA2 <CJK>
+8FCCA3 7401 8FCCA3 <CJK>
+8FCCA4 7404 8FCCA4 <CJK>
+8FCCA5 7407 8FCCA5 <CJK>
+8FCCA6 740A 8FCCA6 <CJK>
+8FCCA7 7411 8FCCA7 <CJK>
+8FCCA8 741A 8FCCA8 <CJK>
+8FCCA9 741B 8FCCA9 <CJK>
+8FCCAA 7424 8FCCAA <CJK>
+8FCCAB 7426 8FCCAB <CJK>
+8FCCAC 7428 8FCCAC <CJK>
+8FCCAD 7429 8FCCAD <CJK>
+8FCCAE 742A 8FCCAE <CJK>
+8FCCAF 742B 8FCCAF <CJK>
+8FCCB0 742C 8FCCB0 <CJK>
+8FCCB1 742D 8FCCB1 <CJK>
+8FCCB2 742E 8FCCB2 <CJK>
+8FCCB3 742F 8FCCB3 <CJK>
+8FCCB4 7430 8FCCB4 <CJK>
+8FCCB5 7431 8FCCB5 <CJK>
+8FCCB6 7439 8FCCB6 <CJK>
+8FCCB7 7440 8FCCB7 <CJK>
+8FCCB8 7443 8FCCB8 <CJK>
+8FCCB9 7444 8FCCB9 <CJK>
+8FCCBA 7446 8FCCBA <CJK>
+8FCCBB 7447 8FCCBB <CJK>
+8FCCBC 744B 8FCCBC <CJK>
+8FCCBD 744D 8FCCBD <CJK>
+8FCCBE 7451 8FCCBE <CJK>
+8FCCBF 7452 8FCCBF <CJK>
+8FCCC0 7457 8FCCC0 <CJK>
+8FCCC1 745D 8FCCC1 <CJK>
+8FCCC2 7462 8FCCC2 <CJK>
+8FCCC3 7466 8FCCC3 <CJK>
+8FCCC4 7467 8FCCC4 <CJK>
+8FCCC5 7468 8FCCC5 <CJK>
+8FCCC6 746B 8FCCC6 <CJK>
+8FCCC7 746D 8FCCC7 <CJK>
+8FCCC8 746E 8FCCC8 <CJK>
+8FCCC9 7471 8FCCC9 <CJK>
+8FCCCA 7472 8FCCCA <CJK>
+8FCCCB 7480 8FCCCB <CJK>
+8FCCCC 7481 8FCCCC <CJK>
+8FCCCD 7485 8FCCCD <CJK>
+8FCCCE 7486 8FCCCE <CJK>
+8FCCCF 7487 8FCCCF <CJK>
+8FCCD0 7489 8FCCD0 <CJK>
+8FCCD1 748F 8FCCD1 <CJK>
+8FCCD2 7490 8FCCD2 <CJK>
+8FCCD3 7491 8FCCD3 <CJK>
+8FCCD4 7492 8FCCD4 <CJK>
+8FCCD5 7498 8FCCD5 <CJK>
+8FCCD6 7499 8FCCD6 <CJK>
+8FCCD7 749A 8FCCD7 <CJK>
+8FCCD8 749C 8FCCD8 <CJK>
+8FCCD9 749F 8FCCD9 <CJK>
+8FCCDA 74A0 8FCCDA <CJK>
+8FCCDB 74A1 8FCCDB <CJK>
+8FCCDC 74A3 8FCCDC <CJK>
+8FCCDD 74A6 8FCCDD <CJK>
+8FCCDE 74A8 8FCCDE <CJK>
+8FCCDF 74A9 8FCCDF <CJK>
+8FCCE0 74AA 8FCCE0 <CJK>
+8FCCE1 74AB 8FCCE1 <CJK>
+8FCCE2 74AE 8FCCE2 <CJK>
+8FCCE3 74AF 8FCCE3 <CJK>
+8FCCE4 74B1 8FCCE4 <CJK>
+8FCCE5 74B2 8FCCE5 <CJK>
+8FCCE6 74B5 8FCCE6 <CJK>
+8FCCE7 74B9 8FCCE7 <CJK>
+8FCCE8 74BB 8FCCE8 <CJK>
+8FCCE9 74BF 8FCCE9 <CJK>
+8FCCEA 74C8 8FCCEA <CJK>
+8FCCEB 74C9 8FCCEB <CJK>
+8FCCEC 74CC 8FCCEC <CJK>
+8FCCED 74D0 8FCCED <CJK>
+8FCCEE 74D3 8FCCEE <CJK>
+8FCCEF 74D8 8FCCEF <CJK>
+8FCCF0 74DA 8FCCF0 <CJK>
+8FCCF1 74DB 8FCCF1 <CJK>
+8FCCF2 74DE 8FCCF2 <CJK>
+8FCCF3 74DF 8FCCF3 <CJK>
+8FCCF4 74E4 8FCCF4 <CJK>
+8FCCF5 74E8 8FCCF5 <CJK>
+8FCCF6 74EA 8FCCF6 <CJK>
+8FCCF7 74EB 8FCCF7 <CJK>
+8FCCF8 74EF 8FCCF8 <CJK>
+8FCCF9 74F4 8FCCF9 <CJK>
+8FCCFA 74FA 8FCCFA <CJK>
+8FCCFB 74FB 8FCCFB <CJK>
+8FCCFC 74FC 8FCCFC <CJK>
+8FCCFD 74FF 8FCCFD <CJK>
+8FCCFE 7506 8FCCFE <CJK>
+8FCDA1 7512 8FCDA1 <CJK>
+8FCDA2 7516 8FCDA2 <CJK>
+8FCDA3 7517 8FCDA3 <CJK>
+8FCDA4 7520 8FCDA4 <CJK>
+8FCDA5 7521 8FCDA5 <CJK>
+8FCDA6 7524 8FCDA6 <CJK>
+8FCDA7 7527 8FCDA7 <CJK>
+8FCDA8 7529 8FCDA8 <CJK>
+8FCDA9 752A 8FCDA9 <CJK>
+8FCDAA 752F 8FCDAA <CJK>
+8FCDAB 7536 8FCDAB <CJK>
+8FCDAC 7539 8FCDAC <CJK>
+8FCDAD 753D 8FCDAD <CJK>
+8FCDAE 753E 8FCDAE <CJK>
+8FCDAF 753F 8FCDAF <CJK>
+8FCDB0 7540 8FCDB0 <CJK>
+8FCDB1 7543 8FCDB1 <CJK>
+8FCDB2 7547 8FCDB2 <CJK>
+8FCDB3 7548 8FCDB3 <CJK>
+8FCDB4 754E 8FCDB4 <CJK>
+8FCDB5 7550 8FCDB5 <CJK>
+8FCDB6 7552 8FCDB6 <CJK>
+8FCDB7 7557 8FCDB7 <CJK>
+8FCDB8 755E 8FCDB8 <CJK>
+8FCDB9 755F 8FCDB9 <CJK>
+8FCDBA 7561 8FCDBA <CJK>
+8FCDBB 756F 8FCDBB <CJK>
+8FCDBC 7571 8FCDBC <CJK>
+8FCDBD 7579 8FCDBD <CJK>
+8FCDBE 757A 8FCDBE <CJK>
+8FCDBF 757B 8FCDBF <CJK>
+8FCDC0 757C 8FCDC0 <CJK>
+8FCDC1 757D 8FCDC1 <CJK>
+8FCDC2 757E 8FCDC2 <CJK>
+8FCDC3 7581 8FCDC3 <CJK>
+8FCDC4 7585 8FCDC4 <CJK>
+8FCDC5 7590 8FCDC5 <CJK>
+8FCDC6 7592 8FCDC6 <CJK>
+8FCDC7 7593 8FCDC7 <CJK>
+8FCDC8 7595 8FCDC8 <CJK>
+8FCDC9 7599 8FCDC9 <CJK>
+8FCDCA 759C 8FCDCA <CJK>
+8FCDCB 75A2 8FCDCB <CJK>
+8FCDCC 75A4 8FCDCC <CJK>
+8FCDCD 75B4 8FCDCD <CJK>
+8FCDCE 75BA 8FCDCE <CJK>
+8FCDCF 75BF 8FCDCF <CJK>
+8FCDD0 75C0 8FCDD0 <CJK>
+8FCDD1 75C1 8FCDD1 <CJK>
+8FCDD2 75C4 8FCDD2 <CJK>
+8FCDD3 75C6 8FCDD3 <CJK>
+8FCDD4 75CC 8FCDD4 <CJK>
+8FCDD5 75CE 8FCDD5 <CJK>
+8FCDD6 75CF 8FCDD6 <CJK>
+8FCDD7 75D7 8FCDD7 <CJK>
+8FCDD8 75DC 8FCDD8 <CJK>
+8FCDD9 75DF 8FCDD9 <CJK>
+8FCDDA 75E0 8FCDDA <CJK>
+8FCDDB 75E1 8FCDDB <CJK>
+8FCDDC 75E4 8FCDDC <CJK>
+8FCDDD 75E7 8FCDDD <CJK>
+8FCDDE 75EC 8FCDDE <CJK>
+8FCDDF 75EE 8FCDDF <CJK>
+8FCDE0 75EF 8FCDE0 <CJK>
+8FCDE1 75F1 8FCDE1 <CJK>
+8FCDE2 75F9 8FCDE2 <CJK>
+8FCDE3 7600 8FCDE3 <CJK>
+8FCDE4 7602 8FCDE4 <CJK>
+8FCDE5 7603 8FCDE5 <CJK>
+8FCDE6 7604 8FCDE6 <CJK>
+8FCDE7 7607 8FCDE7 <CJK>
+8FCDE8 7608 8FCDE8 <CJK>
+8FCDE9 760A 8FCDE9 <CJK>
+8FCDEA 760C 8FCDEA <CJK>
+8FCDEB 760F 8FCDEB <CJK>
+8FCDEC 7612 8FCDEC <CJK>
+8FCDED 7613 8FCDED <CJK>
+8FCDEE 7615 8FCDEE <CJK>
+8FCDEF 7616 8FCDEF <CJK>
+8FCDF0 7619 8FCDF0 <CJK>
+8FCDF1 761B 8FCDF1 <CJK>
+8FCDF2 761C 8FCDF2 <CJK>
+8FCDF3 761D 8FCDF3 <CJK>
+8FCDF4 761E 8FCDF4 <CJK>
+8FCDF5 7623 8FCDF5 <CJK>
+8FCDF6 7625 8FCDF6 <CJK>
+8FCDF7 7626 8FCDF7 <CJK>
+8FCDF8 7629 8FCDF8 <CJK>
+8FCDF9 762D 8FCDF9 <CJK>
+8FCDFA 7632 8FCDFA <CJK>
+8FCDFB 7633 8FCDFB <CJK>
+8FCDFC 7635 8FCDFC <CJK>
+8FCDFD 7638 8FCDFD <CJK>
+8FCDFE 7639 8FCDFE <CJK>
+8FCEA1 763A 8FCEA1 <CJK>
+8FCEA2 763C 8FCEA2 <CJK>
+8FCEA3 764A 8FCEA3 <CJK>
+8FCEA4 7640 8FCEA4 <CJK>
+8FCEA5 7641 8FCEA5 <CJK>
+8FCEA6 7643 8FCEA6 <CJK>
+8FCEA7 7644 8FCEA7 <CJK>
+8FCEA8 7645 8FCEA8 <CJK>
+8FCEA9 7649 8FCEA9 <CJK>
+8FCEAA 764B 8FCEAA <CJK>
+8FCEAB 7655 8FCEAB <CJK>
+8FCEAC 7659 8FCEAC <CJK>
+8FCEAD 765F 8FCEAD <CJK>
+8FCEAE 7664 8FCEAE <CJK>
+8FCEAF 7665 8FCEAF <CJK>
+8FCEB0 766D 8FCEB0 <CJK>
+8FCEB1 766E 8FCEB1 <CJK>
+8FCEB2 766F 8FCEB2 <CJK>
+8FCEB3 7671 8FCEB3 <CJK>
+8FCEB4 7674 8FCEB4 <CJK>
+8FCEB5 7681 8FCEB5 <CJK>
+8FCEB6 7685 8FCEB6 <CJK>
+8FCEB7 768C 8FCEB7 <CJK>
+8FCEB8 768D 8FCEB8 <CJK>
+8FCEB9 7695 8FCEB9 <CJK>
+8FCEBA 769B 8FCEBA <CJK>
+8FCEBB 769C 8FCEBB <CJK>
+8FCEBC 769D 8FCEBC <CJK>
+8FCEBD 769F 8FCEBD <CJK>
+8FCEBE 76A0 8FCEBE <CJK>
+8FCEBF 76A2 8FCEBF <CJK>
+8FCEC0 76A3 8FCEC0 <CJK>
+8FCEC1 76A4 8FCEC1 <CJK>
+8FCEC2 76A5 8FCEC2 <CJK>
+8FCEC3 76A6 8FCEC3 <CJK>
+8FCEC4 76A7 8FCEC4 <CJK>
+8FCEC5 76A8 8FCEC5 <CJK>
+8FCEC6 76AA 8FCEC6 <CJK>
+8FCEC7 76AD 8FCEC7 <CJK>
+8FCEC8 76BD 8FCEC8 <CJK>
+8FCEC9 76C1 8FCEC9 <CJK>
+8FCECA 76C5 8FCECA <CJK>
+8FCECB 76C9 8FCECB <CJK>
+8FCECC 76CB 8FCECC <CJK>
+8FCECD 76CC 8FCECD <CJK>
+8FCECE 76CE 8FCECE <CJK>
+8FCECF 76D4 8FCECF <CJK>
+8FCED0 76D9 8FCED0 <CJK>
+8FCED1 76E0 8FCED1 <CJK>
+8FCED2 76E6 8FCED2 <CJK>
+8FCED3 76E8 8FCED3 <CJK>
+8FCED4 76EC 8FCED4 <CJK>
+8FCED5 76F0 8FCED5 <CJK>
+8FCED6 76F1 8FCED6 <CJK>
+8FCED7 76F6 8FCED7 <CJK>
+8FCED8 76F9 8FCED8 <CJK>
+8FCED9 76FC 8FCED9 <CJK>
+8FCEDA 7700 8FCEDA <CJK>
+8FCEDB 7706 8FCEDB <CJK>
+8FCEDC 770A 8FCEDC <CJK>
+8FCEDD 770E 8FCEDD <CJK>
+8FCEDE 7712 8FCEDE <CJK>
+8FCEDF 7714 8FCEDF <CJK>
+8FCEE0 7715 8FCEE0 <CJK>
+8FCEE1 7717 8FCEE1 <CJK>
+8FCEE2 7719 8FCEE2 <CJK>
+8FCEE3 771A 8FCEE3 <CJK>
+8FCEE4 771C 8FCEE4 <CJK>
+8FCEE5 7722 8FCEE5 <CJK>
+8FCEE6 7728 8FCEE6 <CJK>
+8FCEE7 772D 8FCEE7 <CJK>
+8FCEE8 772E 8FCEE8 <CJK>
+8FCEE9 772F 8FCEE9 <CJK>
+8FCEEA 7734 8FCEEA <CJK>
+8FCEEB 7735 8FCEEB <CJK>
+8FCEEC 7736 8FCEEC <CJK>
+8FCEED 7739 8FCEED <CJK>
+8FCEEE 773D 8FCEEE <CJK>
+8FCEEF 773E 8FCEEF <CJK>
+8FCEF0 7742 8FCEF0 <CJK>
+8FCEF1 7745 8FCEF1 <CJK>
+8FCEF2 7746 8FCEF2 <CJK>
+8FCEF3 774A 8FCEF3 <CJK>
+8FCEF4 774D 8FCEF4 <CJK>
+8FCEF5 774E 8FCEF5 <CJK>
+8FCEF6 774F 8FCEF6 <CJK>
+8FCEF7 7752 8FCEF7 <CJK>
+8FCEF8 7756 8FCEF8 <CJK>
+8FCEF9 7757 8FCEF9 <CJK>
+8FCEFA 775C 8FCEFA <CJK>
+8FCEFB 775E 8FCEFB <CJK>
+8FCEFC 775F 8FCEFC <CJK>
+8FCEFD 7760 8FCEFD <CJK>
+8FCEFE 7762 8FCEFE <CJK>
+8FCFA1 7764 8FCFA1 <CJK>
+8FCFA2 7767 8FCFA2 <CJK>
+8FCFA3 776A 8FCFA3 <CJK>
+8FCFA4 776C 8FCFA4 <CJK>
+8FCFA5 7770 8FCFA5 <CJK>
+8FCFA6 7772 8FCFA6 <CJK>
+8FCFA7 7773 8FCFA7 <CJK>
+8FCFA8 7774 8FCFA8 <CJK>
+8FCFA9 777A 8FCFA9 <CJK>
+8FCFAA 777D 8FCFAA <CJK>
+8FCFAB 7780 8FCFAB <CJK>
+8FCFAC 7784 8FCFAC <CJK>
+8FCFAD 778C 8FCFAD <CJK>
+8FCFAE 778D 8FCFAE <CJK>
+8FCFAF 7794 8FCFAF <CJK>
+8FCFB0 7795 8FCFB0 <CJK>
+8FCFB1 7796 8FCFB1 <CJK>
+8FCFB2 779A 8FCFB2 <CJK>
+8FCFB3 779F 8FCFB3 <CJK>
+8FCFB4 77A2 8FCFB4 <CJK>
+8FCFB5 77A7 8FCFB5 <CJK>
+8FCFB6 77AA 8FCFB6 <CJK>
+8FCFB7 77AE 8FCFB7 <CJK>
+8FCFB8 77AF 8FCFB8 <CJK>
+8FCFB9 77B1 8FCFB9 <CJK>
+8FCFBA 77B5 8FCFBA <CJK>
+8FCFBB 77BE 8FCFBB <CJK>
+8FCFBC 77C3 8FCFBC <CJK>
+8FCFBD 77C9 8FCFBD <CJK>
+8FCFBE 77D1 8FCFBE <CJK>
+8FCFBF 77D2 8FCFBF <CJK>
+8FCFC0 77D5 8FCFC0 <CJK>
+8FCFC1 77D9 8FCFC1 <CJK>
+8FCFC2 77DE 8FCFC2 <CJK>
+8FCFC3 77DF 8FCFC3 <CJK>
+8FCFC4 77E0 8FCFC4 <CJK>
+8FCFC5 77E4 8FCFC5 <CJK>
+8FCFC6 77E6 8FCFC6 <CJK>
+8FCFC7 77EA 8FCFC7 <CJK>
+8FCFC8 77EC 8FCFC8 <CJK>
+8FCFC9 77F0 8FCFC9 <CJK>
+8FCFCA 77F1 8FCFCA <CJK>
+8FCFCB 77F4 8FCFCB <CJK>
+8FCFCC 77F8 8FCFCC <CJK>
+8FCFCD 77FB 8FCFCD <CJK>
+8FCFCE 7805 8FCFCE <CJK>
+8FCFCF 7806 8FCFCF <CJK>
+8FCFD0 7809 8FCFD0 <CJK>
+8FCFD1 780D 8FCFD1 <CJK>
+8FCFD2 780E 8FCFD2 <CJK>
+8FCFD3 7811 8FCFD3 <CJK>
+8FCFD4 781D 8FCFD4 <CJK>
+8FCFD5 7821 8FCFD5 <CJK>
+8FCFD6 7822 8FCFD6 <CJK>
+8FCFD7 7823 8FCFD7 <CJK>
+8FCFD8 782D 8FCFD8 <CJK>
+8FCFD9 782E 8FCFD9 <CJK>
+8FCFDA 7830 8FCFDA <CJK>
+8FCFDB 7835 8FCFDB <CJK>
+8FCFDC 7837 8FCFDC <CJK>
+8FCFDD 7843 8FCFDD <CJK>
+8FCFDE 7844 8FCFDE <CJK>
+8FCFDF 7847 8FCFDF <CJK>
+8FCFE0 7848 8FCFE0 <CJK>
+8FCFE1 784C 8FCFE1 <CJK>
+8FCFE2 784E 8FCFE2 <CJK>
+8FCFE3 7852 8FCFE3 <CJK>
+8FCFE4 785C 8FCFE4 <CJK>
+8FCFE5 785E 8FCFE5 <CJK>
+8FCFE6 7860 8FCFE6 <CJK>
+8FCFE7 7861 8FCFE7 <CJK>
+8FCFE8 7863 8FCFE8 <CJK>
+8FCFE9 7864 8FCFE9 <CJK>
+8FCFEA 7868 8FCFEA <CJK>
+8FCFEB 786A 8FCFEB <CJK>
+8FCFEC 786E 8FCFEC <CJK>
+8FCFED 787A 8FCFED <CJK>
+8FCFEE 787E 8FCFEE <CJK>
+8FCFEF 788A 8FCFEF <CJK>
+8FCFF0 788F 8FCFF0 <CJK>
+8FCFF1 7894 8FCFF1 <CJK>
+8FCFF2 7898 8FCFF2 <CJK>
+8FCFF3 78A1 8FCFF3 <CJK>
+8FCFF4 789D 8FCFF4 <CJK>
+8FCFF5 789E 8FCFF5 <CJK>
+8FCFF6 789F 8FCFF6 <CJK>
+8FCFF7 78A4 8FCFF7 <CJK>
+8FCFF8 78A8 8FCFF8 <CJK>
+8FCFF9 78AC 8FCFF9 <CJK>
+8FCFFA 78AD 8FCFFA <CJK>
+8FCFFB 78B0 8FCFFB <CJK>
+8FCFFC 78B1 8FCFFC <CJK>
+8FCFFD 78B2 8FCFFD <CJK>
+8FCFFE 78B3 8FCFFE <CJK>
+8FD0A1 78BB 8FD0A1 <CJK>
+8FD0A2 78BD 8FD0A2 <CJK>
+8FD0A3 78BF 8FD0A3 <CJK>
+8FD0A4 78C7 8FD0A4 <CJK>
+8FD0A5 78C8 8FD0A5 <CJK>
+8FD0A6 78C9 8FD0A6 <CJK>
+8FD0A7 78CC 8FD0A7 <CJK>
+8FD0A8 78CE 8FD0A8 <CJK>
+8FD0A9 78D2 8FD0A9 <CJK>
+8FD0AA 78D3 8FD0AA <CJK>
+8FD0AB 78D5 8FD0AB <CJK>
+8FD0AC 78D6 8FD0AC <CJK>
+8FD0AD 78E4 8FD0AD <CJK>
+8FD0AE 78DB 8FD0AE <CJK>
+8FD0AF 78DF 8FD0AF <CJK>
+8FD0B0 78E0 8FD0B0 <CJK>
+8FD0B1 78E1 8FD0B1 <CJK>
+8FD0B2 78E6 8FD0B2 <CJK>
+8FD0B3 78EA 8FD0B3 <CJK>
+8FD0B4 78F2 8FD0B4 <CJK>
+8FD0B5 78F3 8FD0B5 <CJK>
+8FD0B6 7900 8FD0B6 <CJK>
+8FD0B7 78F6 8FD0B7 <CJK>
+8FD0B8 78F7 8FD0B8 <CJK>
+8FD0B9 78FA 8FD0B9 <CJK>
+8FD0BA 78FB 8FD0BA <CJK>
+8FD0BB 78FF 8FD0BB <CJK>
+8FD0BC 7906 8FD0BC <CJK>
+8FD0BD 790C 8FD0BD <CJK>
+8FD0BE 7910 8FD0BE <CJK>
+8FD0BF 791A 8FD0BF <CJK>
+8FD0C0 791C 8FD0C0 <CJK>
+8FD0C1 791E 8FD0C1 <CJK>
+8FD0C2 791F 8FD0C2 <CJK>
+8FD0C3 7920 8FD0C3 <CJK>
+8FD0C4 7925 8FD0C4 <CJK>
+8FD0C5 7927 8FD0C5 <CJK>
+8FD0C6 7929 8FD0C6 <CJK>
+8FD0C7 792D 8FD0C7 <CJK>
+8FD0C8 7931 8FD0C8 <CJK>
+8FD0C9 7934 8FD0C9 <CJK>
+8FD0CA 7935 8FD0CA <CJK>
+8FD0CB 793B 8FD0CB <CJK>
+8FD0CC 793D 8FD0CC <CJK>
+8FD0CD 793F 8FD0CD <CJK>
+8FD0CE 7944 8FD0CE <CJK>
+8FD0CF 7945 8FD0CF <CJK>
+8FD0D0 7946 8FD0D0 <CJK>
+8FD0D1 794A 8FD0D1 <CJK>
+8FD0D2 794B 8FD0D2 <CJK>
+8FD0D3 794F 8FD0D3 <CJK>
+8FD0D4 7951 8FD0D4 <CJK>
+8FD0D5 7954 8FD0D5 <CJK>
+8FD0D6 7958 8FD0D6 <CJK>
+8FD0D7 795B 8FD0D7 <CJK>
+8FD0D8 795C 8FD0D8 <CJK>
+8FD0D9 7967 8FD0D9 <CJK>
+8FD0DA 7969 8FD0DA <CJK>
+8FD0DB 796B 8FD0DB <CJK>
+8FD0DC 7972 8FD0DC <CJK>
+8FD0DD 7979 8FD0DD <CJK>
+8FD0DE 797B 8FD0DE <CJK>
+8FD0DF 797C 8FD0DF <CJK>
+8FD0E0 797E 8FD0E0 <CJK>
+8FD0E1 798B 8FD0E1 <CJK>
+8FD0E2 798C 8FD0E2 <CJK>
+8FD0E3 7991 8FD0E3 <CJK>
+8FD0E4 7993 8FD0E4 <CJK>
+8FD0E5 7994 8FD0E5 <CJK>
+8FD0E6 7995 8FD0E6 <CJK>
+8FD0E7 7996 8FD0E7 <CJK>
+8FD0E8 7998 8FD0E8 <CJK>
+8FD0E9 799B 8FD0E9 <CJK>
+8FD0EA 799C 8FD0EA <CJK>
+8FD0EB 79A1 8FD0EB <CJK>
+8FD0EC 79A8 8FD0EC <CJK>
+8FD0ED 79A9 8FD0ED <CJK>
+8FD0EE 79AB 8FD0EE <CJK>
+8FD0EF 79AF 8FD0EF <CJK>
+8FD0F0 79B1 8FD0F0 <CJK>
+8FD0F1 79B4 8FD0F1 <CJK>
+8FD0F2 79B8 8FD0F2 <CJK>
+8FD0F3 79BB 8FD0F3 <CJK>
+8FD0F4 79C2 8FD0F4 <CJK>
+8FD0F5 79C4 8FD0F5 <CJK>
+8FD0F6 79C7 8FD0F6 <CJK>
+8FD0F7 79C8 8FD0F7 <CJK>
+8FD0F8 79CA 8FD0F8 <CJK>
+8FD0F9 79CF 8FD0F9 <CJK>
+8FD0FA 79D4 8FD0FA <CJK>
+8FD0FB 79D6 8FD0FB <CJK>
+8FD0FC 79DA 8FD0FC <CJK>
+8FD0FD 79DD 8FD0FD <CJK>
+8FD0FE 79DE 8FD0FE <CJK>
+8FD1A1 79E0 8FD1A1 <CJK>
+8FD1A2 79E2 8FD1A2 <CJK>
+8FD1A3 79E5 8FD1A3 <CJK>
+8FD1A4 79EA 8FD1A4 <CJK>
+8FD1A5 79EB 8FD1A5 <CJK>
+8FD1A6 79ED 8FD1A6 <CJK>
+8FD1A7 79F1 8FD1A7 <CJK>
+8FD1A8 79F8 8FD1A8 <CJK>
+8FD1A9 79FC 8FD1A9 <CJK>
+8FD1AA 7A02 8FD1AA <CJK>
+8FD1AB 7A03 8FD1AB <CJK>
+8FD1AC 7A07 8FD1AC <CJK>
+8FD1AD 7A09 8FD1AD <CJK>
+8FD1AE 7A0A 8FD1AE <CJK>
+8FD1AF 7A0C 8FD1AF <CJK>
+8FD1B0 7A11 8FD1B0 <CJK>
+8FD1B1 7A15 8FD1B1 <CJK>
+8FD1B2 7A1B 8FD1B2 <CJK>
+8FD1B3 7A1E 8FD1B3 <CJK>
+8FD1B4 7A21 8FD1B4 <CJK>
+8FD1B5 7A27 8FD1B5 <CJK>
+8FD1B6 7A2B 8FD1B6 <CJK>
+8FD1B7 7A2D 8FD1B7 <CJK>
+8FD1B8 7A2F 8FD1B8 <CJK>
+8FD1B9 7A30 8FD1B9 <CJK>
+8FD1BA 7A34 8FD1BA <CJK>
+8FD1BB 7A35 8FD1BB <CJK>
+8FD1BC 7A38 8FD1BC <CJK>
+8FD1BD 7A39 8FD1BD <CJK>
+8FD1BE 7A3A 8FD1BE <CJK>
+8FD1BF 7A44 8FD1BF <CJK>
+8FD1C0 7A45 8FD1C0 <CJK>
+8FD1C1 7A47 8FD1C1 <CJK>
+8FD1C2 7A48 8FD1C2 <CJK>
+8FD1C3 7A4C 8FD1C3 <CJK>
+8FD1C4 7A55 8FD1C4 <CJK>
+8FD1C5 7A56 8FD1C5 <CJK>
+8FD1C6 7A59 8FD1C6 <CJK>
+8FD1C7 7A5C 8FD1C7 <CJK>
+8FD1C8 7A5D 8FD1C8 <CJK>
+8FD1C9 7A5F 8FD1C9 <CJK>
+8FD1CA 7A60 8FD1CA <CJK>
+8FD1CB 7A65 8FD1CB <CJK>
+8FD1CC 7A67 8FD1CC <CJK>
+8FD1CD 7A6A 8FD1CD <CJK>
+8FD1CE 7A6D 8FD1CE <CJK>
+8FD1CF 7A75 8FD1CF <CJK>
+8FD1D0 7A78 8FD1D0 <CJK>
+8FD1D1 7A7E 8FD1D1 <CJK>
+8FD1D2 7A80 8FD1D2 <CJK>
+8FD1D3 7A82 8FD1D3 <CJK>
+8FD1D4 7A85 8FD1D4 <CJK>
+8FD1D5 7A86 8FD1D5 <CJK>
+8FD1D6 7A8A 8FD1D6 <CJK>
+8FD1D7 7A8B 8FD1D7 <CJK>
+8FD1D8 7A90 8FD1D8 <CJK>
+8FD1D9 7A91 8FD1D9 <CJK>
+8FD1DA 7A94 8FD1DA <CJK>
+8FD1DB 7A9E 8FD1DB <CJK>
+8FD1DC 7AA0 8FD1DC <CJK>
+8FD1DD 7AA3 8FD1DD <CJK>
+8FD1DE 7AAC 8FD1DE <CJK>
+8FD1DF 7AB3 8FD1DF <CJK>
+8FD1E0 7AB5 8FD1E0 <CJK>
+8FD1E1 7AB9 8FD1E1 <CJK>
+8FD1E2 7ABB 8FD1E2 <CJK>
+8FD1E3 7ABC 8FD1E3 <CJK>
+8FD1E4 7AC6 8FD1E4 <CJK>
+8FD1E5 7AC9 8FD1E5 <CJK>
+8FD1E6 7ACC 8FD1E6 <CJK>
+8FD1E7 7ACE 8FD1E7 <CJK>
+8FD1E8 7AD1 8FD1E8 <CJK>
+8FD1E9 7ADB 8FD1E9 <CJK>
+8FD1EA 7AE8 8FD1EA <CJK>
+8FD1EB 7AE9 8FD1EB <CJK>
+8FD1EC 7AEB 8FD1EC <CJK>
+8FD1ED 7AEC 8FD1ED <CJK>
+8FD1EE 7AF1 8FD1EE <CJK>
+8FD1EF 7AF4 8FD1EF <CJK>
+8FD1F0 7AFB 8FD1F0 <CJK>
+8FD1F1 7AFD 8FD1F1 <CJK>
+8FD1F2 7AFE 8FD1F2 <CJK>
+8FD1F3 7B07 8FD1F3 <CJK>
+8FD1F4 7B14 8FD1F4 <CJK>
+8FD1F5 7B1F 8FD1F5 <CJK>
+8FD1F6 7B23 8FD1F6 <CJK>
+8FD1F7 7B27 8FD1F7 <CJK>
+8FD1F8 7B29 8FD1F8 <CJK>
+8FD1F9 7B2A 8FD1F9 <CJK>
+8FD1FA 7B2B 8FD1FA <CJK>
+8FD1FB 7B2D 8FD1FB <CJK>
+8FD1FC 7B2E 8FD1FC <CJK>
+8FD1FD 7B2F 8FD1FD <CJK>
+8FD1FE 7B30 8FD1FE <CJK>
+8FD2A1 7B31 8FD2A1 <CJK>
+8FD2A2 7B34 8FD2A2 <CJK>
+8FD2A3 7B3D 8FD2A3 <CJK>
+8FD2A4 7B3F 8FD2A4 <CJK>
+8FD2A5 7B40 8FD2A5 <CJK>
+8FD2A6 7B41 8FD2A6 <CJK>
+8FD2A7 7B47 8FD2A7 <CJK>
+8FD2A8 7B4E 8FD2A8 <CJK>
+8FD2A9 7B55 8FD2A9 <CJK>
+8FD2AA 7B60 8FD2AA <CJK>
+8FD2AB 7B64 8FD2AB <CJK>
+8FD2AC 7B66 8FD2AC <CJK>
+8FD2AD 7B69 8FD2AD <CJK>
+8FD2AE 7B6A 8FD2AE <CJK>
+8FD2AF 7B6D 8FD2AF <CJK>
+8FD2B0 7B6F 8FD2B0 <CJK>
+8FD2B1 7B72 8FD2B1 <CJK>
+8FD2B2 7B73 8FD2B2 <CJK>
+8FD2B3 7B77 8FD2B3 <CJK>
+8FD2B4 7B84 8FD2B4 <CJK>
+8FD2B5 7B89 8FD2B5 <CJK>
+8FD2B6 7B8E 8FD2B6 <CJK>
+8FD2B7 7B90 8FD2B7 <CJK>
+8FD2B8 7B91 8FD2B8 <CJK>
+8FD2B9 7B96 8FD2B9 <CJK>
+8FD2BA 7B9B 8FD2BA <CJK>
+8FD2BB 7B9E 8FD2BB <CJK>
+8FD2BC 7BA0 8FD2BC <CJK>
+8FD2BD 7BA5 8FD2BD <CJK>
+8FD2BE 7BAC 8FD2BE <CJK>
+8FD2BF 7BAF 8FD2BF <CJK>
+8FD2C0 7BB0 8FD2C0 <CJK>
+8FD2C1 7BB2 8FD2C1 <CJK>
+8FD2C2 7BB5 8FD2C2 <CJK>
+8FD2C3 7BB6 8FD2C3 <CJK>
+8FD2C4 7BBA 8FD2C4 <CJK>
+8FD2C5 7BBB 8FD2C5 <CJK>
+8FD2C6 7BBC 8FD2C6 <CJK>
+8FD2C7 7BBD 8FD2C7 <CJK>
+8FD2C8 7BC2 8FD2C8 <CJK>
+8FD2C9 7BC5 8FD2C9 <CJK>
+8FD2CA 7BC8 8FD2CA <CJK>
+8FD2CB 7BCA 8FD2CB <CJK>
+8FD2CC 7BD4 8FD2CC <CJK>
+8FD2CD 7BD6 8FD2CD <CJK>
+8FD2CE 7BD7 8FD2CE <CJK>
+8FD2CF 7BD9 8FD2CF <CJK>
+8FD2D0 7BDA 8FD2D0 <CJK>
+8FD2D1 7BDB 8FD2D1 <CJK>
+8FD2D2 7BE8 8FD2D2 <CJK>
+8FD2D3 7BEA 8FD2D3 <CJK>
+8FD2D4 7BF2 8FD2D4 <CJK>
+8FD2D5 7BF4 8FD2D5 <CJK>
+8FD2D6 7BF5 8FD2D6 <CJK>
+8FD2D7 7BF8 8FD2D7 <CJK>
+8FD2D8 7BF9 8FD2D8 <CJK>
+8FD2D9 7BFA 8FD2D9 <CJK>
+8FD2DA 7BFC 8FD2DA <CJK>
+8FD2DB 7BFE 8FD2DB <CJK>
+8FD2DC 7C01 8FD2DC <CJK>
+8FD2DD 7C02 8FD2DD <CJK>
+8FD2DE 7C03 8FD2DE <CJK>
+8FD2DF 7C04 8FD2DF <CJK>
+8FD2E0 7C06 8FD2E0 <CJK>
+8FD2E1 7C09 8FD2E1 <CJK>
+8FD2E2 7C0B 8FD2E2 <CJK>
+8FD2E3 7C0C 8FD2E3 <CJK>
+8FD2E4 7C0E 8FD2E4 <CJK>
+8FD2E5 7C0F 8FD2E5 <CJK>
+8FD2E6 7C19 8FD2E6 <CJK>
+8FD2E7 7C1B 8FD2E7 <CJK>
+8FD2E8 7C20 8FD2E8 <CJK>
+8FD2E9 7C25 8FD2E9 <CJK>
+8FD2EA 7C26 8FD2EA <CJK>
+8FD2EB 7C28 8FD2EB <CJK>
+8FD2EC 7C2C 8FD2EC <CJK>
+8FD2ED 7C31 8FD2ED <CJK>
+8FD2EE 7C33 8FD2EE <CJK>
+8FD2EF 7C34 8FD2EF <CJK>
+8FD2F0 7C36 8FD2F0 <CJK>
+8FD2F1 7C39 8FD2F1 <CJK>
+8FD2F2 7C3A 8FD2F2 <CJK>
+8FD2F3 7C46 8FD2F3 <CJK>
+8FD2F4 7C4A 8FD2F4 <CJK>
+8FD2F5 7C55 8FD2F5 <CJK>
+8FD2F6 7C51 8FD2F6 <CJK>
+8FD2F7 7C52 8FD2F7 <CJK>
+8FD2F8 7C53 8FD2F8 <CJK>
+8FD2F9 7C59 8FD2F9 <CJK>
+8FD2FA 7C5A 8FD2FA <CJK>
+8FD2FB 7C5B 8FD2FB <CJK>
+8FD2FC 7C5C 8FD2FC <CJK>
+8FD2FD 7C5D 8FD2FD <CJK>
+8FD2FE 7C5E 8FD2FE <CJK>
+8FD3A1 7C61 8FD3A1 <CJK>
+8FD3A2 7C63 8FD3A2 <CJK>
+8FD3A3 7C67 8FD3A3 <CJK>
+8FD3A4 7C69 8FD3A4 <CJK>
+8FD3A5 7C6D 8FD3A5 <CJK>
+8FD3A6 7C6E 8FD3A6 <CJK>
+8FD3A7 7C70 8FD3A7 <CJK>
+8FD3A8 7C72 8FD3A8 <CJK>
+8FD3A9 7C79 8FD3A9 <CJK>
+8FD3AA 7C7C 8FD3AA <CJK>
+8FD3AB 7C7D 8FD3AB <CJK>
+8FD3AC 7C86 8FD3AC <CJK>
+8FD3AD 7C87 8FD3AD <CJK>
+8FD3AE 7C8F 8FD3AE <CJK>
+8FD3AF 7C94 8FD3AF <CJK>
+8FD3B0 7C9E 8FD3B0 <CJK>
+8FD3B1 7CA0 8FD3B1 <CJK>
+8FD3B2 7CA6 8FD3B2 <CJK>
+8FD3B3 7CB0 8FD3B3 <CJK>
+8FD3B4 7CB6 8FD3B4 <CJK>
+8FD3B5 7CB7 8FD3B5 <CJK>
+8FD3B6 7CBA 8FD3B6 <CJK>
+8FD3B7 7CBB 8FD3B7 <CJK>
+8FD3B8 7CBC 8FD3B8 <CJK>
+8FD3B9 7CBF 8FD3B9 <CJK>
+8FD3BA 7CC4 8FD3BA <CJK>
+8FD3BB 7CC7 8FD3BB <CJK>
+8FD3BC 7CC8 8FD3BC <CJK>
+8FD3BD 7CC9 8FD3BD <CJK>
+8FD3BE 7CCD 8FD3BE <CJK>
+8FD3BF 7CCF 8FD3BF <CJK>
+8FD3C0 7CD3 8FD3C0 <CJK>
+8FD3C1 7CD4 8FD3C1 <CJK>
+8FD3C2 7CD5 8FD3C2 <CJK>
+8FD3C3 7CD7 8FD3C3 <CJK>
+8FD3C4 7CD9 8FD3C4 <CJK>
+8FD3C5 7CDA 8FD3C5 <CJK>
+8FD3C6 7CDD 8FD3C6 <CJK>
+8FD3C7 7CE6 8FD3C7 <CJK>
+8FD3C8 7CE9 8FD3C8 <CJK>
+8FD3C9 7CEB 8FD3C9 <CJK>
+8FD3CA 7CF5 8FD3CA <CJK>
+8FD3CB 7D03 8FD3CB <CJK>
+8FD3CC 7D07 8FD3CC <CJK>
+8FD3CD 7D08 8FD3CD <CJK>
+8FD3CE 7D09 8FD3CE <CJK>
+8FD3CF 7D0F 8FD3CF <CJK>
+8FD3D0 7D11 8FD3D0 <CJK>
+8FD3D1 7D12 8FD3D1 <CJK>
+8FD3D2 7D13 8FD3D2 <CJK>
+8FD3D3 7D16 8FD3D3 <CJK>
+8FD3D4 7D1D 8FD3D4 <CJK>
+8FD3D5 7D1E 8FD3D5 <CJK>
+8FD3D6 7D23 8FD3D6 <CJK>
+8FD3D7 7D26 8FD3D7 <CJK>
+8FD3D8 7D2A 8FD3D8 <CJK>
+8FD3D9 7D2D 8FD3D9 <CJK>
+8FD3DA 7D31 8FD3DA <CJK>
+8FD3DB 7D3C 8FD3DB <CJK>
+8FD3DC 7D3D 8FD3DC <CJK>
+8FD3DD 7D3E 8FD3DD <CJK>
+8FD3DE 7D40 8FD3DE <CJK>
+8FD3DF 7D41 8FD3DF <CJK>
+8FD3E0 7D47 8FD3E0 <CJK>
+8FD3E1 7D48 8FD3E1 <CJK>
+8FD3E2 7D4D 8FD3E2 <CJK>
+8FD3E3 7D51 8FD3E3 <CJK>
+8FD3E4 7D53 8FD3E4 <CJK>
+8FD3E5 7D57 8FD3E5 <CJK>
+8FD3E6 7D59 8FD3E6 <CJK>
+8FD3E7 7D5A 8FD3E7 <CJK>
+8FD3E8 7D5C 8FD3E8 <CJK>
+8FD3E9 7D5D 8FD3E9 <CJK>
+8FD3EA 7D65 8FD3EA <CJK>
+8FD3EB 7D67 8FD3EB <CJK>
+8FD3EC 7D6A 8FD3EC <CJK>
+8FD3ED 7D70 8FD3ED <CJK>
+8FD3EE 7D78 8FD3EE <CJK>
+8FD3EF 7D7A 8FD3EF <CJK>
+8FD3F0 7D7B 8FD3F0 <CJK>
+8FD3F1 7D7F 8FD3F1 <CJK>
+8FD3F2 7D81 8FD3F2 <CJK>
+8FD3F3 7D82 8FD3F3 <CJK>
+8FD3F4 7D83 8FD3F4 <CJK>
+8FD3F5 7D85 8FD3F5 <CJK>
+8FD3F6 7D86 8FD3F6 <CJK>
+8FD3F7 7D88 8FD3F7 <CJK>
+8FD3F8 7D8B 8FD3F8 <CJK>
+8FD3F9 7D8C 8FD3F9 <CJK>
+8FD3FA 7D8D 8FD3FA <CJK>
+8FD3FB 7D91 8FD3FB <CJK>
+8FD3FC 7D96 8FD3FC <CJK>
+8FD3FD 7D97 8FD3FD <CJK>
+8FD3FE 7D9D 8FD3FE <CJK>
+8FD4A1 7D9E 8FD4A1 <CJK>
+8FD4A2 7DA6 8FD4A2 <CJK>
+8FD4A3 7DA7 8FD4A3 <CJK>
+8FD4A4 7DAA 8FD4A4 <CJK>
+8FD4A5 7DB3 8FD4A5 <CJK>
+8FD4A6 7DB6 8FD4A6 <CJK>
+8FD4A7 7DB7 8FD4A7 <CJK>
+8FD4A8 7DB9 8FD4A8 <CJK>
+8FD4A9 7DC2 8FD4A9 <CJK>
+8FD4AA 7DC3 8FD4AA <CJK>
+8FD4AB 7DC4 8FD4AB <CJK>
+8FD4AC 7DC5 8FD4AC <CJK>
+8FD4AD 7DC6 8FD4AD <CJK>
+8FD4AE 7DCC 8FD4AE <CJK>
+8FD4AF 7DCD 8FD4AF <CJK>
+8FD4B0 7DCE 8FD4B0 <CJK>
+8FD4B1 7DD7 8FD4B1 <CJK>
+8FD4B2 7DD9 8FD4B2 <CJK>
+8FD4B3 7E00 8FD4B3 <CJK>
+8FD4B4 7DE2 8FD4B4 <CJK>
+8FD4B5 7DE5 8FD4B5 <CJK>
+8FD4B6 7DE6 8FD4B6 <CJK>
+8FD4B7 7DEA 8FD4B7 <CJK>
+8FD4B8 7DEB 8FD4B8 <CJK>
+8FD4B9 7DED 8FD4B9 <CJK>
+8FD4BA 7DF1 8FD4BA <CJK>
+8FD4BB 7DF5 8FD4BB <CJK>
+8FD4BC 7DF6 8FD4BC <CJK>
+8FD4BD 7DF9 8FD4BD <CJK>
+8FD4BE 7DFA 8FD4BE <CJK>
+8FD4BF 7E08 8FD4BF <CJK>
+8FD4C0 7E10 8FD4C0 <CJK>
+8FD4C1 7E11 8FD4C1 <CJK>
+8FD4C2 7E15 8FD4C2 <CJK>
+8FD4C3 7E17 8FD4C3 <CJK>
+8FD4C4 7E1C 8FD4C4 <CJK>
+8FD4C5 7E1D 8FD4C5 <CJK>
+8FD4C6 7E20 8FD4C6 <CJK>
+8FD4C7 7E27 8FD4C7 <CJK>
+8FD4C8 7E28 8FD4C8 <CJK>
+8FD4C9 7E2C 8FD4C9 <CJK>
+8FD4CA 7E2D 8FD4CA <CJK>
+8FD4CB 7E2F 8FD4CB <CJK>
+8FD4CC 7E33 8FD4CC <CJK>
+8FD4CD 7E36 8FD4CD <CJK>
+8FD4CE 7E3F 8FD4CE <CJK>
+8FD4CF 7E44 8FD4CF <CJK>
+8FD4D0 7E45 8FD4D0 <CJK>
+8FD4D1 7E47 8FD4D1 <CJK>
+8FD4D2 7E4E 8FD4D2 <CJK>
+8FD4D3 7E50 8FD4D3 <CJK>
+8FD4D4 7E52 8FD4D4 <CJK>
+8FD4D5 7E58 8FD4D5 <CJK>
+8FD4D6 7E5F 8FD4D6 <CJK>
+8FD4D7 7E61 8FD4D7 <CJK>
+8FD4D8 7E62 8FD4D8 <CJK>
+8FD4D9 7E65 8FD4D9 <CJK>
+8FD4DA 7E6B 8FD4DA <CJK>
+8FD4DB 7E6E 8FD4DB <CJK>
+8FD4DC 7E6F 8FD4DC <CJK>
+8FD4DD 7E73 8FD4DD <CJK>
+8FD4DE 7E78 8FD4DE <CJK>
+8FD4DF 7E7E 8FD4DF <CJK>
+8FD4E0 7E81 8FD4E0 <CJK>
+8FD4E1 7E86 8FD4E1 <CJK>
+8FD4E2 7E87 8FD4E2 <CJK>
+8FD4E3 7E8A 8FD4E3 <CJK>
+8FD4E4 7E8D 8FD4E4 <CJK>
+8FD4E5 7E91 8FD4E5 <CJK>
+8FD4E6 7E95 8FD4E6 <CJK>
+8FD4E7 7E98 8FD4E7 <CJK>
+8FD4E8 7E9A 8FD4E8 <CJK>
+8FD4E9 7E9D 8FD4E9 <CJK>
+8FD4EA 7E9E 8FD4EA <CJK>
+8FD4EB 7F3C 8FD4EB <CJK>
+8FD4EC 7F3B 8FD4EC <CJK>
+8FD4ED 7F3D 8FD4ED <CJK>
+8FD4EE 7F3E 8FD4EE <CJK>
+8FD4EF 7F3F 8FD4EF <CJK>
+8FD4F0 7F43 8FD4F0 <CJK>
+8FD4F1 7F44 8FD4F1 <CJK>
+8FD4F2 7F47 8FD4F2 <CJK>
+8FD4F3 7F4F 8FD4F3 <CJK>
+8FD4F4 7F52 8FD4F4 <CJK>
+8FD4F5 7F53 8FD4F5 <CJK>
+8FD4F6 7F5B 8FD4F6 <CJK>
+8FD4F7 7F5C 8FD4F7 <CJK>
+8FD4F8 7F5D 8FD4F8 <CJK>
+8FD4F9 7F61 8FD4F9 <CJK>
+8FD4FA 7F63 8FD4FA <CJK>
+8FD4FB 7F64 8FD4FB <CJK>
+8FD4FC 7F65 8FD4FC <CJK>
+8FD4FD 7F66 8FD4FD <CJK>
+8FD4FE 7F6D 8FD4FE <CJK>
+8FD5A1 7F71 8FD5A1 <CJK>
+8FD5A2 7F7D 8FD5A2 <CJK>
+8FD5A3 7F7E 8FD5A3 <CJK>
+8FD5A4 7F7F 8FD5A4 <CJK>
+8FD5A5 7F80 8FD5A5 <CJK>
+8FD5A6 7F8B 8FD5A6 <CJK>
+8FD5A7 7F8D 8FD5A7 <CJK>
+8FD5A8 7F8F 8FD5A8 <CJK>
+8FD5A9 7F90 8FD5A9 <CJK>
+8FD5AA 7F91 8FD5AA <CJK>
+8FD5AB 7F96 8FD5AB <CJK>
+8FD5AC 7F97 8FD5AC <CJK>
+8FD5AD 7F9C 8FD5AD <CJK>
+8FD5AE 7FA1 8FD5AE <CJK>
+8FD5AF 7FA2 8FD5AF <CJK>
+8FD5B0 7FA6 8FD5B0 <CJK>
+8FD5B1 7FAA 8FD5B1 <CJK>
+8FD5B2 7FAD 8FD5B2 <CJK>
+8FD5B3 7FB4 8FD5B3 <CJK>
+8FD5B4 7FBC 8FD5B4 <CJK>
+8FD5B5 7FBF 8FD5B5 <CJK>
+8FD5B6 7FC0 8FD5B6 <CJK>
+8FD5B7 7FC3 8FD5B7 <CJK>
+8FD5B8 7FC8 8FD5B8 <CJK>
+8FD5B9 7FCE 8FD5B9 <CJK>
+8FD5BA 7FCF 8FD5BA <CJK>
+8FD5BB 7FDB 8FD5BB <CJK>
+8FD5BC 7FDF 8FD5BC <CJK>
+8FD5BD 7FE3 8FD5BD <CJK>
+8FD5BE 7FE5 8FD5BE <CJK>
+8FD5BF 7FE8 8FD5BF <CJK>
+8FD5C0 7FEC 8FD5C0 <CJK>
+8FD5C1 7FEE 8FD5C1 <CJK>
+8FD5C2 7FEF 8FD5C2 <CJK>
+8FD5C3 7FF2 8FD5C3 <CJK>
+8FD5C4 7FFA 8FD5C4 <CJK>
+8FD5C5 7FFD 8FD5C5 <CJK>
+8FD5C6 7FFE 8FD5C6 <CJK>
+8FD5C7 7FFF 8FD5C7 <CJK>
+8FD5C8 8007 8FD5C8 <CJK>
+8FD5C9 8008 8FD5C9 <CJK>
+8FD5CA 800A 8FD5CA <CJK>
+8FD5CB 800D 8FD5CB <CJK>
+8FD5CC 800E 8FD5CC <CJK>
+8FD5CD 800F 8FD5CD <CJK>
+8FD5CE 8011 8FD5CE <CJK>
+8FD5CF 8013 8FD5CF <CJK>
+8FD5D0 8014 8FD5D0 <CJK>
+8FD5D1 8016 8FD5D1 <CJK>
+8FD5D2 801D 8FD5D2 <CJK>
+8FD5D3 801E 8FD5D3 <CJK>
+8FD5D4 801F 8FD5D4 <CJK>
+8FD5D5 8020 8FD5D5 <CJK>
+8FD5D6 8024 8FD5D6 <CJK>
+8FD5D7 8026 8FD5D7 <CJK>
+8FD5D8 802C 8FD5D8 <CJK>
+8FD5D9 802E 8FD5D9 <CJK>
+8FD5DA 8030 8FD5DA <CJK>
+8FD5DB 8034 8FD5DB <CJK>
+8FD5DC 8035 8FD5DC <CJK>
+8FD5DD 8037 8FD5DD <CJK>
+8FD5DE 8039 8FD5DE <CJK>
+8FD5DF 803A 8FD5DF <CJK>
+8FD5E0 803C 8FD5E0 <CJK>
+8FD5E1 803E 8FD5E1 <CJK>
+8FD5E2 8040 8FD5E2 <CJK>
+8FD5E3 8044 8FD5E3 <CJK>
+8FD5E4 8060 8FD5E4 <CJK>
+8FD5E5 8064 8FD5E5 <CJK>
+8FD5E6 8066 8FD5E6 <CJK>
+8FD5E7 806D 8FD5E7 <CJK>
+8FD5E8 8071 8FD5E8 <CJK>
+8FD5E9 8075 8FD5E9 <CJK>
+8FD5EA 8081 8FD5EA <CJK>
+8FD5EB 8088 8FD5EB <CJK>
+8FD5EC 808E 8FD5EC <CJK>
+8FD5ED 809C 8FD5ED <CJK>
+8FD5EE 809E 8FD5EE <CJK>
+8FD5EF 80A6 8FD5EF <CJK>
+8FD5F0 80A7 8FD5F0 <CJK>
+8FD5F1 80AB 8FD5F1 <CJK>
+8FD5F2 80B8 8FD5F2 <CJK>
+8FD5F3 80B9 8FD5F3 <CJK>
+8FD5F4 80C8 8FD5F4 <CJK>
+8FD5F5 80CD 8FD5F5 <CJK>
+8FD5F6 80CF 8FD5F6 <CJK>
+8FD5F7 80D2 8FD5F7 <CJK>
+8FD5F8 80D4 8FD5F8 <CJK>
+8FD5F9 80D5 8FD5F9 <CJK>
+8FD5FA 80D7 8FD5FA <CJK>
+8FD5FB 80D8 8FD5FB <CJK>
+8FD5FC 80E0 8FD5FC <CJK>
+8FD5FD 80ED 8FD5FD <CJK>
+8FD5FE 80EE 8FD5FE <CJK>
+8FD6A1 80F0 8FD6A1 <CJK>
+8FD6A2 80F2 8FD6A2 <CJK>
+8FD6A3 80F3 8FD6A3 <CJK>
+8FD6A4 80F6 8FD6A4 <CJK>
+8FD6A5 80F9 8FD6A5 <CJK>
+8FD6A6 80FA 8FD6A6 <CJK>
+8FD6A7 80FE 8FD6A7 <CJK>
+8FD6A8 8103 8FD6A8 <CJK>
+8FD6A9 810B 8FD6A9 <CJK>
+8FD6AA 8116 8FD6AA <CJK>
+8FD6AB 8117 8FD6AB <CJK>
+8FD6AC 8118 8FD6AC <CJK>
+8FD6AD 811C 8FD6AD <CJK>
+8FD6AE 811E 8FD6AE <CJK>
+8FD6AF 8120 8FD6AF <CJK>
+8FD6B0 8124 8FD6B0 <CJK>
+8FD6B1 8127 8FD6B1 <CJK>
+8FD6B2 812C 8FD6B2 <CJK>
+8FD6B3 8130 8FD6B3 <CJK>
+8FD6B4 8135 8FD6B4 <CJK>
+8FD6B5 813A 8FD6B5 <CJK>
+8FD6B6 813C 8FD6B6 <CJK>
+8FD6B7 8145 8FD6B7 <CJK>
+8FD6B8 8147 8FD6B8 <CJK>
+8FD6B9 814A 8FD6B9 <CJK>
+8FD6BA 814C 8FD6BA <CJK>
+8FD6BB 8152 8FD6BB <CJK>
+8FD6BC 8157 8FD6BC <CJK>
+8FD6BD 8160 8FD6BD <CJK>
+8FD6BE 8161 8FD6BE <CJK>
+8FD6BF 8167 8FD6BF <CJK>
+8FD6C0 8168 8FD6C0 <CJK>
+8FD6C1 8169 8FD6C1 <CJK>
+8FD6C2 816D 8FD6C2 <CJK>
+8FD6C3 816F 8FD6C3 <CJK>
+8FD6C4 8177 8FD6C4 <CJK>
+8FD6C5 8181 8FD6C5 <CJK>
+8FD6C6 8190 8FD6C6 <CJK>
+8FD6C7 8184 8FD6C7 <CJK>
+8FD6C8 8185 8FD6C8 <CJK>
+8FD6C9 8186 8FD6C9 <CJK>
+8FD6CA 818B 8FD6CA <CJK>
+8FD6CB 818E 8FD6CB <CJK>
+8FD6CC 8196 8FD6CC <CJK>
+8FD6CD 8198 8FD6CD <CJK>
+8FD6CE 819B 8FD6CE <CJK>
+8FD6CF 819E 8FD6CF <CJK>
+8FD6D0 81A2 8FD6D0 <CJK>
+8FD6D1 81AE 8FD6D1 <CJK>
+8FD6D2 81B2 8FD6D2 <CJK>
+8FD6D3 81B4 8FD6D3 <CJK>
+8FD6D4 81BB 8FD6D4 <CJK>
+8FD6D5 81CB 8FD6D5 <CJK>
+8FD6D6 81C3 8FD6D6 <CJK>
+8FD6D7 81C5 8FD6D7 <CJK>
+8FD6D8 81CA 8FD6D8 <CJK>
+8FD6D9 81CE 8FD6D9 <CJK>
+8FD6DA 81CF 8FD6DA <CJK>
+8FD6DB 81D5 8FD6DB <CJK>
+8FD6DC 81D7 8FD6DC <CJK>
+8FD6DD 81DB 8FD6DD <CJK>
+8FD6DE 81DD 8FD6DE <CJK>
+8FD6DF 81DE 8FD6DF <CJK>
+8FD6E0 81E1 8FD6E0 <CJK>
+8FD6E1 81E4 8FD6E1 <CJK>
+8FD6E2 81EB 8FD6E2 <CJK>
+8FD6E3 81EC 8FD6E3 <CJK>
+8FD6E4 81F0 8FD6E4 <CJK>
+8FD6E5 81F1 8FD6E5 <CJK>
+8FD6E6 81F2 8FD6E6 <CJK>
+8FD6E7 81F5 8FD6E7 <CJK>
+8FD6E8 81F6 8FD6E8 <CJK>
+8FD6E9 81F8 8FD6E9 <CJK>
+8FD6EA 81F9 8FD6EA <CJK>
+8FD6EB 81FD 8FD6EB <CJK>
+8FD6EC 81FF 8FD6EC <CJK>
+8FD6ED 8200 8FD6ED <CJK>
+8FD6EE 8203 8FD6EE <CJK>
+8FD6EF 820F 8FD6EF <CJK>
+8FD6F0 8213 8FD6F0 <CJK>
+8FD6F1 8214 8FD6F1 <CJK>
+8FD6F2 8219 8FD6F2 <CJK>
+8FD6F3 821A 8FD6F3 <CJK>
+8FD6F4 821D 8FD6F4 <CJK>
+8FD6F5 8221 8FD6F5 <CJK>
+8FD6F6 8222 8FD6F6 <CJK>
+8FD6F7 8228 8FD6F7 <CJK>
+8FD6F8 8232 8FD6F8 <CJK>
+8FD6F9 8234 8FD6F9 <CJK>
+8FD6FA 823A 8FD6FA <CJK>
+8FD6FB 8243 8FD6FB <CJK>
+8FD6FC 8244 8FD6FC <CJK>
+8FD6FD 8245 8FD6FD <CJK>
+8FD6FE 8246 8FD6FE <CJK>
+8FD7A1 824B 8FD7A1 <CJK>
+8FD7A2 824E 8FD7A2 <CJK>
+8FD7A3 824F 8FD7A3 <CJK>
+8FD7A4 8251 8FD7A4 <CJK>
+8FD7A5 8256 8FD7A5 <CJK>
+8FD7A6 825C 8FD7A6 <CJK>
+8FD7A7 8260 8FD7A7 <CJK>
+8FD7A8 8263 8FD7A8 <CJK>
+8FD7A9 8267 8FD7A9 <CJK>
+8FD7AA 826D 8FD7AA <CJK>
+8FD7AB 8274 8FD7AB <CJK>
+8FD7AC 827B 8FD7AC <CJK>
+8FD7AD 827D 8FD7AD <CJK>
+8FD7AE 827F 8FD7AE <CJK>
+8FD7AF 8280 8FD7AF <CJK>
+8FD7B0 8281 8FD7B0 <CJK>
+8FD7B1 8283 8FD7B1 <CJK>
+8FD7B2 8284 8FD7B2 <CJK>
+8FD7B3 8287 8FD7B3 <CJK>
+8FD7B4 8289 8FD7B4 <CJK>
+8FD7B5 828A 8FD7B5 <CJK>
+8FD7B6 828E 8FD7B6 <CJK>
+8FD7B7 8291 8FD7B7 <CJK>
+8FD7B8 8294 8FD7B8 <CJK>
+8FD7B9 8296 8FD7B9 <CJK>
+8FD7BA 8298 8FD7BA <CJK>
+8FD7BB 829A 8FD7BB <CJK>
+8FD7BC 829B 8FD7BC <CJK>
+8FD7BD 82A0 8FD7BD <CJK>
+8FD7BE 82A1 8FD7BE <CJK>
+8FD7BF 82A3 8FD7BF <CJK>
+8FD7C0 82A4 8FD7C0 <CJK>
+8FD7C1 82A7 8FD7C1 <CJK>
+8FD7C2 82A8 8FD7C2 <CJK>
+8FD7C3 82A9 8FD7C3 <CJK>
+8FD7C4 82AA 8FD7C4 <CJK>
+8FD7C5 82AE 8FD7C5 <CJK>
+8FD7C6 82B0 8FD7C6 <CJK>
+8FD7C7 82B2 8FD7C7 <CJK>
+8FD7C8 82B4 8FD7C8 <CJK>
+8FD7C9 82B7 8FD7C9 <CJK>
+8FD7CA 82BA 8FD7CA <CJK>
+8FD7CB 82BC 8FD7CB <CJK>
+8FD7CC 82BE 8FD7CC <CJK>
+8FD7CD 82BF 8FD7CD <CJK>
+8FD7CE 82C6 8FD7CE <CJK>
+8FD7CF 82D0 8FD7CF <CJK>
+8FD7D0 82D5 8FD7D0 <CJK>
+8FD7D1 82DA 8FD7D1 <CJK>
+8FD7D2 82E0 8FD7D2 <CJK>
+8FD7D3 82E2 8FD7D3 <CJK>
+8FD7D4 82E4 8FD7D4 <CJK>
+8FD7D5 82E8 8FD7D5 <CJK>
+8FD7D6 82EA 8FD7D6 <CJK>
+8FD7D7 82ED 8FD7D7 <CJK>
+8FD7D8 82EF 8FD7D8 <CJK>
+8FD7D9 82F6 8FD7D9 <CJK>
+8FD7DA 82F7 8FD7DA <CJK>
+8FD7DB 82FD 8FD7DB <CJK>
+8FD7DC 82FE 8FD7DC <CJK>
+8FD7DD 8300 8FD7DD <CJK>
+8FD7DE 8301 8FD7DE <CJK>
+8FD7DF 8307 8FD7DF <CJK>
+8FD7E0 8308 8FD7E0 <CJK>
+8FD7E1 830A 8FD7E1 <CJK>
+8FD7E2 830B 8FD7E2 <CJK>
+8FD7E3 8354 8FD7E3 <CJK>
+8FD7E4 831B 8FD7E4 <CJK>
+8FD7E5 831D 8FD7E5 <CJK>
+8FD7E6 831E 8FD7E6 <CJK>
+8FD7E7 831F 8FD7E7 <CJK>
+8FD7E8 8321 8FD7E8 <CJK>
+8FD7E9 8322 8FD7E9 <CJK>
+8FD7EA 832C 8FD7EA <CJK>
+8FD7EB 832D 8FD7EB <CJK>
+8FD7EC 832E 8FD7EC <CJK>
+8FD7ED 8330 8FD7ED <CJK>
+8FD7EE 8333 8FD7EE <CJK>
+8FD7EF 8337 8FD7EF <CJK>
+8FD7F0 833A 8FD7F0 <CJK>
+8FD7F1 833C 8FD7F1 <CJK>
+8FD7F2 833D 8FD7F2 <CJK>
+8FD7F3 8342 8FD7F3 <CJK>
+8FD7F4 8343 8FD7F4 <CJK>
+8FD7F5 8344 8FD7F5 <CJK>
+8FD7F6 8347 8FD7F6 <CJK>
+8FD7F7 834D 8FD7F7 <CJK>
+8FD7F8 834E 8FD7F8 <CJK>
+8FD7F9 8351 8FD7F9 <CJK>
+8FD7FA 8355 8FD7FA <CJK>
+8FD7FB 8356 8FD7FB <CJK>
+8FD7FC 8357 8FD7FC <CJK>
+8FD7FD 8370 8FD7FD <CJK>
+8FD7FE 8378 8FD7FE <CJK>
+8FD8A1 837D 8FD8A1 <CJK>
+8FD8A2 837F 8FD8A2 <CJK>
+8FD8A3 8380 8FD8A3 <CJK>
+8FD8A4 8382 8FD8A4 <CJK>
+8FD8A5 8384 8FD8A5 <CJK>
+8FD8A6 8386 8FD8A6 <CJK>
+8FD8A7 838D 8FD8A7 <CJK>
+8FD8A8 8392 8FD8A8 <CJK>
+8FD8A9 8394 8FD8A9 <CJK>
+8FD8AA 8395 8FD8AA <CJK>
+8FD8AB 8398 8FD8AB <CJK>
+8FD8AC 8399 8FD8AC <CJK>
+8FD8AD 839B 8FD8AD <CJK>
+8FD8AE 839C 8FD8AE <CJK>
+8FD8AF 839D 8FD8AF <CJK>
+8FD8B0 83A6 8FD8B0 <CJK>
+8FD8B1 83A7 8FD8B1 <CJK>
+8FD8B2 83A9 8FD8B2 <CJK>
+8FD8B3 83AC 8FD8B3 <CJK>
+8FD8B4 83BE 8FD8B4 <CJK>
+8FD8B5 83BF 8FD8B5 <CJK>
+8FD8B6 83C0 8FD8B6 <CJK>
+8FD8B7 83C7 8FD8B7 <CJK>
+8FD8B8 83C9 8FD8B8 <CJK>
+8FD8B9 83CF 8FD8B9 <CJK>
+8FD8BA 83D0 8FD8BA <CJK>
+8FD8BB 83D1 8FD8BB <CJK>
+8FD8BC 83D4 8FD8BC <CJK>
+8FD8BD 83DD 8FD8BD <CJK>
+8FD8BE 8353 8FD8BE <CJK>
+8FD8BF 83E8 8FD8BF <CJK>
+8FD8C0 83EA 8FD8C0 <CJK>
+8FD8C1 83F6 8FD8C1 <CJK>
+8FD8C2 83F8 8FD8C2 <CJK>
+8FD8C3 83F9 8FD8C3 <CJK>
+8FD8C4 83FC 8FD8C4 <CJK>
+8FD8C5 8401 8FD8C5 <CJK>
+8FD8C6 8406 8FD8C6 <CJK>
+8FD8C7 840A 8FD8C7 <CJK>
+8FD8C8 840F 8FD8C8 <CJK>
+8FD8C9 8411 8FD8C9 <CJK>
+8FD8CA 8415 8FD8CA <CJK>
+8FD8CB 8419 8FD8CB <CJK>
+8FD8CC 83AD 8FD8CC <CJK>
+8FD8CD 842F 8FD8CD <CJK>
+8FD8CE 8439 8FD8CE <CJK>
+8FD8CF 8445 8FD8CF <CJK>
+8FD8D0 8447 8FD8D0 <CJK>
+8FD8D1 8448 8FD8D1 <CJK>
+8FD8D2 844A 8FD8D2 <CJK>
+8FD8D3 844D 8FD8D3 <CJK>
+8FD8D4 844F 8FD8D4 <CJK>
+8FD8D5 8451 8FD8D5 <CJK>
+8FD8D6 8452 8FD8D6 <CJK>
+8FD8D7 8456 8FD8D7 <CJK>
+8FD8D8 8458 8FD8D8 <CJK>
+8FD8D9 8459 8FD8D9 <CJK>
+8FD8DA 845A 8FD8DA <CJK>
+8FD8DB 845C 8FD8DB <CJK>
+8FD8DC 8460 8FD8DC <CJK>
+8FD8DD 8464 8FD8DD <CJK>
+8FD8DE 8465 8FD8DE <CJK>
+8FD8DF 8467 8FD8DF <CJK>
+8FD8E0 846A 8FD8E0 <CJK>
+8FD8E1 8470 8FD8E1 <CJK>
+8FD8E2 8473 8FD8E2 <CJK>
+8FD8E3 8474 8FD8E3 <CJK>
+8FD8E4 8476 8FD8E4 <CJK>
+8FD8E5 8478 8FD8E5 <CJK>
+8FD8E6 847C 8FD8E6 <CJK>
+8FD8E7 847D 8FD8E7 <CJK>
+8FD8E8 8481 8FD8E8 <CJK>
+8FD8E9 8485 8FD8E9 <CJK>
+8FD8EA 8492 8FD8EA <CJK>
+8FD8EB 8493 8FD8EB <CJK>
+8FD8EC 8495 8FD8EC <CJK>
+8FD8ED 849E 8FD8ED <CJK>
+8FD8EE 84A6 8FD8EE <CJK>
+8FD8EF 84A8 8FD8EF <CJK>
+8FD8F0 84A9 8FD8F0 <CJK>
+8FD8F1 84AA 8FD8F1 <CJK>
+8FD8F2 84AF 8FD8F2 <CJK>
+8FD8F3 84B1 8FD8F3 <CJK>
+8FD8F4 84B4 8FD8F4 <CJK>
+8FD8F5 84BA 8FD8F5 <CJK>
+8FD8F6 84BD 8FD8F6 <CJK>
+8FD8F7 84BE 8FD8F7 <CJK>
+8FD8F8 84C0 8FD8F8 <CJK>
+8FD8F9 84C2 8FD8F9 <CJK>
+8FD8FA 84C7 8FD8FA <CJK>
+8FD8FB 84C8 8FD8FB <CJK>
+8FD8FC 84CC 8FD8FC <CJK>
+8FD8FD 84CF 8FD8FD <CJK>
+8FD8FE 84D3 8FD8FE <CJK>
+8FD9A1 84DC 8FD9A1 <CJK>
+8FD9A2 84E7 8FD9A2 <CJK>
+8FD9A3 84EA 8FD9A3 <CJK>
+8FD9A4 84EF 8FD9A4 <CJK>
+8FD9A5 84F0 8FD9A5 <CJK>
+8FD9A6 84F1 8FD9A6 <CJK>
+8FD9A7 84F2 8FD9A7 <CJK>
+8FD9A8 84F7 8FD9A8 <CJK>
+8FD9A9 8532 8FD9A9 <CJK>
+8FD9AA 84FA 8FD9AA <CJK>
+8FD9AB 84FB 8FD9AB <CJK>
+8FD9AC 84FD 8FD9AC <CJK>
+8FD9AD 8502 8FD9AD <CJK>
+8FD9AE 8503 8FD9AE <CJK>
+8FD9AF 8507 8FD9AF <CJK>
+8FD9B0 850C 8FD9B0 <CJK>
+8FD9B1 850E 8FD9B1 <CJK>
+8FD9B2 8510 8FD9B2 <CJK>
+8FD9B3 851C 8FD9B3 <CJK>
+8FD9B4 851E 8FD9B4 <CJK>
+8FD9B5 8522 8FD9B5 <CJK>
+8FD9B6 8523 8FD9B6 <CJK>
+8FD9B7 8524 8FD9B7 <CJK>
+8FD9B8 8525 8FD9B8 <CJK>
+8FD9B9 8527 8FD9B9 <CJK>
+8FD9BA 852A 8FD9BA <CJK>
+8FD9BB 852B 8FD9BB <CJK>
+8FD9BC 852F 8FD9BC <CJK>
+8FD9BD 8533 8FD9BD <CJK>
+8FD9BE 8534 8FD9BE <CJK>
+8FD9BF 8536 8FD9BF <CJK>
+8FD9C0 853F 8FD9C0 <CJK>
+8FD9C1 8546 8FD9C1 <CJK>
+8FD9C2 854F 8FD9C2 <CJK>
+8FD9C3 8550 8FD9C3 <CJK>
+8FD9C4 8551 8FD9C4 <CJK>
+8FD9C5 8552 8FD9C5 <CJK>
+8FD9C6 8553 8FD9C6 <CJK>
+8FD9C7 8556 8FD9C7 <CJK>
+8FD9C8 8559 8FD9C8 <CJK>
+8FD9C9 855C 8FD9C9 <CJK>
+8FD9CA 855D 8FD9CA <CJK>
+8FD9CB 855E 8FD9CB <CJK>
+8FD9CC 855F 8FD9CC <CJK>
+8FD9CD 8560 8FD9CD <CJK>
+8FD9CE 8561 8FD9CE <CJK>
+8FD9CF 8562 8FD9CF <CJK>
+8FD9D0 8564 8FD9D0 <CJK>
+8FD9D1 856B 8FD9D1 <CJK>
+8FD9D2 856F 8FD9D2 <CJK>
+8FD9D3 8579 8FD9D3 <CJK>
+8FD9D4 857A 8FD9D4 <CJK>
+8FD9D5 857B 8FD9D5 <CJK>
+8FD9D6 857D 8FD9D6 <CJK>
+8FD9D7 857F 8FD9D7 <CJK>
+8FD9D8 8581 8FD9D8 <CJK>
+8FD9D9 8585 8FD9D9 <CJK>
+8FD9DA 8586 8FD9DA <CJK>
+8FD9DB 8589 8FD9DB <CJK>
+8FD9DC 858B 8FD9DC <CJK>
+8FD9DD 858C 8FD9DD <CJK>
+8FD9DE 858F 8FD9DE <CJK>
+8FD9DF 8593 8FD9DF <CJK>
+8FD9E0 8598 8FD9E0 <CJK>
+8FD9E1 859D 8FD9E1 <CJK>
+8FD9E2 859F 8FD9E2 <CJK>
+8FD9E3 85A0 8FD9E3 <CJK>
+8FD9E4 85A2 8FD9E4 <CJK>
+8FD9E5 85A5 8FD9E5 <CJK>
+8FD9E6 85A7 8FD9E6 <CJK>
+8FD9E7 85B4 8FD9E7 <CJK>
+8FD9E8 85B6 8FD9E8 <CJK>
+8FD9E9 85B7 8FD9E9 <CJK>
+8FD9EA 85B8 8FD9EA <CJK>
+8FD9EB 85BC 8FD9EB <CJK>
+8FD9EC 85BD 8FD9EC <CJK>
+8FD9ED 85BE 8FD9ED <CJK>
+8FD9EE 85BF 8FD9EE <CJK>
+8FD9EF 85C2 8FD9EF <CJK>
+8FD9F0 85C7 8FD9F0 <CJK>
+8FD9F1 85CA 8FD9F1 <CJK>
+8FD9F2 85CB 8FD9F2 <CJK>
+8FD9F3 85CE 8FD9F3 <CJK>
+8FD9F4 85AD 8FD9F4 <CJK>
+8FD9F5 85D8 8FD9F5 <CJK>
+8FD9F6 85DA 8FD9F6 <CJK>
+8FD9F7 85DF 8FD9F7 <CJK>
+8FD9F8 85E0 8FD9F8 <CJK>
+8FD9F9 85E6 8FD9F9 <CJK>
+8FD9FA 85E8 8FD9FA <CJK>
+8FD9FB 85ED 8FD9FB <CJK>
+8FD9FC 85F3 8FD9FC <CJK>
+8FD9FD 85F6 8FD9FD <CJK>
+8FD9FE 85FC 8FD9FE <CJK>
+8FDAA1 85FF 8FDAA1 <CJK>
+8FDAA2 8600 8FDAA2 <CJK>
+8FDAA3 8604 8FDAA3 <CJK>
+8FDAA4 8605 8FDAA4 <CJK>
+8FDAA5 860D 8FDAA5 <CJK>
+8FDAA6 860E 8FDAA6 <CJK>
+8FDAA7 8610 8FDAA7 <CJK>
+8FDAA8 8611 8FDAA8 <CJK>
+8FDAA9 8612 8FDAA9 <CJK>
+8FDAAA 8618 8FDAAA <CJK>
+8FDAAB 8619 8FDAAB <CJK>
+8FDAAC 861B 8FDAAC <CJK>
+8FDAAD 861E 8FDAAD <CJK>
+8FDAAE 8621 8FDAAE <CJK>
+8FDAAF 8627 8FDAAF <CJK>
+8FDAB0 8629 8FDAB0 <CJK>
+8FDAB1 8636 8FDAB1 <CJK>
+8FDAB2 8638 8FDAB2 <CJK>
+8FDAB3 863A 8FDAB3 <CJK>
+8FDAB4 863C 8FDAB4 <CJK>
+8FDAB5 863D 8FDAB5 <CJK>
+8FDAB6 8640 8FDAB6 <CJK>
+8FDAB7 8642 8FDAB7 <CJK>
+8FDAB8 8646 8FDAB8 <CJK>
+8FDAB9 8652 8FDAB9 <CJK>
+8FDABA 8653 8FDABA <CJK>
+8FDABB 8656 8FDABB <CJK>
+8FDABC 8657 8FDABC <CJK>
+8FDABD 8658 8FDABD <CJK>
+8FDABE 8659 8FDABE <CJK>
+8FDABF 865D 8FDABF <CJK>
+8FDAC0 8660 8FDAC0 <CJK>
+8FDAC1 8661 8FDAC1 <CJK>
+8FDAC2 8662 8FDAC2 <CJK>
+8FDAC3 8663 8FDAC3 <CJK>
+8FDAC4 8664 8FDAC4 <CJK>
+8FDAC5 8669 8FDAC5 <CJK>
+8FDAC6 866C 8FDAC6 <CJK>
+8FDAC7 866F 8FDAC7 <CJK>
+8FDAC8 8675 8FDAC8 <CJK>
+8FDAC9 8676 8FDAC9 <CJK>
+8FDACA 8677 8FDACA <CJK>
+8FDACB 867A 8FDACB <CJK>
+8FDACC 868D 8FDACC <CJK>
+8FDACD 8691 8FDACD <CJK>
+8FDACE 8696 8FDACE <CJK>
+8FDACF 8698 8FDACF <CJK>
+8FDAD0 869A 8FDAD0 <CJK>
+8FDAD1 869C 8FDAD1 <CJK>
+8FDAD2 86A1 8FDAD2 <CJK>
+8FDAD3 86A6 8FDAD3 <CJK>
+8FDAD4 86A7 8FDAD4 <CJK>
+8FDAD5 86A8 8FDAD5 <CJK>
+8FDAD6 86AD 8FDAD6 <CJK>
+8FDAD7 86B1 8FDAD7 <CJK>
+8FDAD8 86B3 8FDAD8 <CJK>
+8FDAD9 86B4 8FDAD9 <CJK>
+8FDADA 86B5 8FDADA <CJK>
+8FDADB 86B7 8FDADB <CJK>
+8FDADC 86B8 8FDADC <CJK>
+8FDADD 86B9 8FDADD <CJK>
+8FDADE 86BF 8FDADE <CJK>
+8FDADF 86C0 8FDADF <CJK>
+8FDAE0 86C1 8FDAE0 <CJK>
+8FDAE1 86C3 8FDAE1 <CJK>
+8FDAE2 86C5 8FDAE2 <CJK>
+8FDAE3 86D1 8FDAE3 <CJK>
+8FDAE4 86D2 8FDAE4 <CJK>
+8FDAE5 86D5 8FDAE5 <CJK>
+8FDAE6 86D7 8FDAE6 <CJK>
+8FDAE7 86DA 8FDAE7 <CJK>
+8FDAE8 86DC 8FDAE8 <CJK>
+8FDAE9 86E0 8FDAE9 <CJK>
+8FDAEA 86E3 8FDAEA <CJK>
+8FDAEB 86E5 8FDAEB <CJK>
+8FDAEC 86E7 8FDAEC <CJK>
+8FDAED 8688 8FDAED <CJK>
+8FDAEE 86FA 8FDAEE <CJK>
+8FDAEF 86FC 8FDAEF <CJK>
+8FDAF0 86FD 8FDAF0 <CJK>
+8FDAF1 8704 8FDAF1 <CJK>
+8FDAF2 8705 8FDAF2 <CJK>
+8FDAF3 8707 8FDAF3 <CJK>
+8FDAF4 870B 8FDAF4 <CJK>
+8FDAF5 870E 8FDAF5 <CJK>
+8FDAF6 870F 8FDAF6 <CJK>
+8FDAF7 8710 8FDAF7 <CJK>
+8FDAF8 8713 8FDAF8 <CJK>
+8FDAF9 8714 8FDAF9 <CJK>
+8FDAFA 8719 8FDAFA <CJK>
+8FDAFB 871E 8FDAFB <CJK>
+8FDAFC 871F 8FDAFC <CJK>
+8FDAFD 8721 8FDAFD <CJK>
+8FDAFE 8723 8FDAFE <CJK>
+8FDBA1 8728 8FDBA1 <CJK>
+8FDBA2 872E 8FDBA2 <CJK>
+8FDBA3 872F 8FDBA3 <CJK>
+8FDBA4 8731 8FDBA4 <CJK>
+8FDBA5 8732 8FDBA5 <CJK>
+8FDBA6 8739 8FDBA6 <CJK>
+8FDBA7 873A 8FDBA7 <CJK>
+8FDBA8 873C 8FDBA8 <CJK>
+8FDBA9 873D 8FDBA9 <CJK>
+8FDBAA 873E 8FDBAA <CJK>
+8FDBAB 8740 8FDBAB <CJK>
+8FDBAC 8743 8FDBAC <CJK>
+8FDBAD 8745 8FDBAD <CJK>
+8FDBAE 874D 8FDBAE <CJK>
+8FDBAF 8758 8FDBAF <CJK>
+8FDBB0 875D 8FDBB0 <CJK>
+8FDBB1 8761 8FDBB1 <CJK>
+8FDBB2 8764 8FDBB2 <CJK>
+8FDBB3 8765 8FDBB3 <CJK>
+8FDBB4 876F 8FDBB4 <CJK>
+8FDBB5 8771 8FDBB5 <CJK>
+8FDBB6 8772 8FDBB6 <CJK>
+8FDBB7 877B 8FDBB7 <CJK>
+8FDBB8 8783 8FDBB8 <CJK>
+8FDBB9 8784 8FDBB9 <CJK>
+8FDBBA 8785 8FDBBA <CJK>
+8FDBBB 8786 8FDBBB <CJK>
+8FDBBC 8787 8FDBBC <CJK>
+8FDBBD 8788 8FDBBD <CJK>
+8FDBBE 8789 8FDBBE <CJK>
+8FDBBF 878B 8FDBBF <CJK>
+8FDBC0 878C 8FDBC0 <CJK>
+8FDBC1 8790 8FDBC1 <CJK>
+8FDBC2 8793 8FDBC2 <CJK>
+8FDBC3 8795 8FDBC3 <CJK>
+8FDBC4 8797 8FDBC4 <CJK>
+8FDBC5 8798 8FDBC5 <CJK>
+8FDBC6 8799 8FDBC6 <CJK>
+8FDBC7 879E 8FDBC7 <CJK>
+8FDBC8 87A0 8FDBC8 <CJK>
+8FDBC9 87A3 8FDBC9 <CJK>
+8FDBCA 87A7 8FDBCA <CJK>
+8FDBCB 87AC 8FDBCB <CJK>
+8FDBCC 87AD 8FDBCC <CJK>
+8FDBCD 87AE 8FDBCD <CJK>
+8FDBCE 87B1 8FDBCE <CJK>
+8FDBCF 87B5 8FDBCF <CJK>
+8FDBD0 87BE 8FDBD0 <CJK>
+8FDBD1 87BF 8FDBD1 <CJK>
+8FDBD2 87C1 8FDBD2 <CJK>
+8FDBD3 87C8 8FDBD3 <CJK>
+8FDBD4 87C9 8FDBD4 <CJK>
+8FDBD5 87CA 8FDBD5 <CJK>
+8FDBD6 87CE 8FDBD6 <CJK>
+8FDBD7 87D5 8FDBD7 <CJK>
+8FDBD8 87D6 8FDBD8 <CJK>
+8FDBD9 87D9 8FDBD9 <CJK>
+8FDBDA 87DA 8FDBDA <CJK>
+8FDBDB 87DC 8FDBDB <CJK>
+8FDBDC 87DF 8FDBDC <CJK>
+8FDBDD 87E2 8FDBDD <CJK>
+8FDBDE 87E3 8FDBDE <CJK>
+8FDBDF 87E4 8FDBDF <CJK>
+8FDBE0 87EA 8FDBE0 <CJK>
+8FDBE1 87EB 8FDBE1 <CJK>
+8FDBE2 87ED 8FDBE2 <CJK>
+8FDBE3 87F1 8FDBE3 <CJK>
+8FDBE4 87F3 8FDBE4 <CJK>
+8FDBE5 87F8 8FDBE5 <CJK>
+8FDBE6 87FA 8FDBE6 <CJK>
+8FDBE7 87FF 8FDBE7 <CJK>
+8FDBE8 8801 8FDBE8 <CJK>
+8FDBE9 8803 8FDBE9 <CJK>
+8FDBEA 8806 8FDBEA <CJK>
+8FDBEB 8809 8FDBEB <CJK>
+8FDBEC 880A 8FDBEC <CJK>
+8FDBED 880B 8FDBED <CJK>
+8FDBEE 8810 8FDBEE <CJK>
+8FDBEF 8819 8FDBEF <CJK>
+8FDBF0 8812 8FDBF0 <CJK>
+8FDBF1 8813 8FDBF1 <CJK>
+8FDBF2 8814 8FDBF2 <CJK>
+8FDBF3 8818 8FDBF3 <CJK>
+8FDBF4 881A 8FDBF4 <CJK>
+8FDBF5 881B 8FDBF5 <CJK>
+8FDBF6 881C 8FDBF6 <CJK>
+8FDBF7 881E 8FDBF7 <CJK>
+8FDBF8 881F 8FDBF8 <CJK>
+8FDBF9 8828 8FDBF9 <CJK>
+8FDBFA 882D 8FDBFA <CJK>
+8FDBFB 882E 8FDBFB <CJK>
+8FDBFC 8830 8FDBFC <CJK>
+8FDBFD 8832 8FDBFD <CJK>
+8FDBFE 8835 8FDBFE <CJK>
+8FDCA1 883A 8FDCA1 <CJK>
+8FDCA2 883C 8FDCA2 <CJK>
+8FDCA3 8841 8FDCA3 <CJK>
+8FDCA4 8843 8FDCA4 <CJK>
+8FDCA5 8845 8FDCA5 <CJK>
+8FDCA6 8848 8FDCA6 <CJK>
+8FDCA7 8849 8FDCA7 <CJK>
+8FDCA8 884A 8FDCA8 <CJK>
+8FDCA9 884B 8FDCA9 <CJK>
+8FDCAA 884E 8FDCAA <CJK>
+8FDCAB 8851 8FDCAB <CJK>
+8FDCAC 8855 8FDCAC <CJK>
+8FDCAD 8856 8FDCAD <CJK>
+8FDCAE 8858 8FDCAE <CJK>
+8FDCAF 885A 8FDCAF <CJK>
+8FDCB0 885C 8FDCB0 <CJK>
+8FDCB1 885F 8FDCB1 <CJK>
+8FDCB2 8860 8FDCB2 <CJK>
+8FDCB3 8864 8FDCB3 <CJK>
+8FDCB4 8869 8FDCB4 <CJK>
+8FDCB5 8871 8FDCB5 <CJK>
+8FDCB6 8879 8FDCB6 <CJK>
+8FDCB7 887B 8FDCB7 <CJK>
+8FDCB8 8880 8FDCB8 <CJK>
+8FDCB9 8898 8FDCB9 <CJK>
+8FDCBA 889A 8FDCBA <CJK>
+8FDCBB 889B 8FDCBB <CJK>
+8FDCBC 889C 8FDCBC <CJK>
+8FDCBD 889F 8FDCBD <CJK>
+8FDCBE 88A0 8FDCBE <CJK>
+8FDCBF 88A8 8FDCBF <CJK>
+8FDCC0 88AA 8FDCC0 <CJK>
+8FDCC1 88BA 8FDCC1 <CJK>
+8FDCC2 88BD 8FDCC2 <CJK>
+8FDCC3 88BE 8FDCC3 <CJK>
+8FDCC4 88C0 8FDCC4 <CJK>
+8FDCC5 88CA 8FDCC5 <CJK>
+8FDCC6 88CB 8FDCC6 <CJK>
+8FDCC7 88CC 8FDCC7 <CJK>
+8FDCC8 88CD 8FDCC8 <CJK>
+8FDCC9 88CE 8FDCC9 <CJK>
+8FDCCA 88D1 8FDCCA <CJK>
+8FDCCB 88D2 8FDCCB <CJK>
+8FDCCC 88D3 8FDCCC <CJK>
+8FDCCD 88DB 8FDCCD <CJK>
+8FDCCE 88DE 8FDCCE <CJK>
+8FDCCF 88E7 8FDCCF <CJK>
+8FDCD0 88EF 8FDCD0 <CJK>
+8FDCD1 88F0 8FDCD1 <CJK>
+8FDCD2 88F1 8FDCD2 <CJK>
+8FDCD3 88F5 8FDCD3 <CJK>
+8FDCD4 88F7 8FDCD4 <CJK>
+8FDCD5 8901 8FDCD5 <CJK>
+8FDCD6 8906 8FDCD6 <CJK>
+8FDCD7 890D 8FDCD7 <CJK>
+8FDCD8 890E 8FDCD8 <CJK>
+8FDCD9 890F 8FDCD9 <CJK>
+8FDCDA 8915 8FDCDA <CJK>
+8FDCDB 8916 8FDCDB <CJK>
+8FDCDC 8918 8FDCDC <CJK>
+8FDCDD 8919 8FDCDD <CJK>
+8FDCDE 891A 8FDCDE <CJK>
+8FDCDF 891C 8FDCDF <CJK>
+8FDCE0 8920 8FDCE0 <CJK>
+8FDCE1 8926 8FDCE1 <CJK>
+8FDCE2 8927 8FDCE2 <CJK>
+8FDCE3 8928 8FDCE3 <CJK>
+8FDCE4 8930 8FDCE4 <CJK>
+8FDCE5 8931 8FDCE5 <CJK>
+8FDCE6 8932 8FDCE6 <CJK>
+8FDCE7 8935 8FDCE7 <CJK>
+8FDCE8 8939 8FDCE8 <CJK>
+8FDCE9 893A 8FDCE9 <CJK>
+8FDCEA 893E 8FDCEA <CJK>
+8FDCEB 8940 8FDCEB <CJK>
+8FDCEC 8942 8FDCEC <CJK>
+8FDCED 8945 8FDCED <CJK>
+8FDCEE 8946 8FDCEE <CJK>
+8FDCEF 8949 8FDCEF <CJK>
+8FDCF0 894F 8FDCF0 <CJK>
+8FDCF1 8952 8FDCF1 <CJK>
+8FDCF2 8957 8FDCF2 <CJK>
+8FDCF3 895A 8FDCF3 <CJK>
+8FDCF4 895B 8FDCF4 <CJK>
+8FDCF5 895C 8FDCF5 <CJK>
+8FDCF6 8961 8FDCF6 <CJK>
+8FDCF7 8962 8FDCF7 <CJK>
+8FDCF8 8963 8FDCF8 <CJK>
+8FDCF9 896B 8FDCF9 <CJK>
+8FDCFA 896E 8FDCFA <CJK>
+8FDCFB 8970 8FDCFB <CJK>
+8FDCFC 8973 8FDCFC <CJK>
+8FDCFD 8975 8FDCFD <CJK>
+8FDCFE 897A 8FDCFE <CJK>
+8FDDA1 897B 8FDDA1 <CJK>
+8FDDA2 897C 8FDDA2 <CJK>
+8FDDA3 897D 8FDDA3 <CJK>
+8FDDA4 8989 8FDDA4 <CJK>
+8FDDA5 898D 8FDDA5 <CJK>
+8FDDA6 8990 8FDDA6 <CJK>
+8FDDA7 8994 8FDDA7 <CJK>
+8FDDA8 8995 8FDDA8 <CJK>
+8FDDA9 899B 8FDDA9 <CJK>
+8FDDAA 899C 8FDDAA <CJK>
+8FDDAB 899F 8FDDAB <CJK>
+8FDDAC 89A0 8FDDAC <CJK>
+8FDDAD 89A5 8FDDAD <CJK>
+8FDDAE 89B0 8FDDAE <CJK>
+8FDDAF 89B4 8FDDAF <CJK>
+8FDDB0 89B5 8FDDB0 <CJK>
+8FDDB1 89B6 8FDDB1 <CJK>
+8FDDB2 89B7 8FDDB2 <CJK>
+8FDDB3 89BC 8FDDB3 <CJK>
+8FDDB4 89D4 8FDDB4 <CJK>
+8FDDB5 89D5 8FDDB5 <CJK>
+8FDDB6 89D6 8FDDB6 <CJK>
+8FDDB7 89D7 8FDDB7 <CJK>
+8FDDB8 89D8 8FDDB8 <CJK>
+8FDDB9 89E5 8FDDB9 <CJK>
+8FDDBA 89E9 8FDDBA <CJK>
+8FDDBB 89EB 8FDDBB <CJK>
+8FDDBC 89ED 8FDDBC <CJK>
+8FDDBD 89F1 8FDDBD <CJK>
+8FDDBE 89F3 8FDDBE <CJK>
+8FDDBF 89F6 8FDDBF <CJK>
+8FDDC0 89F9 8FDDC0 <CJK>
+8FDDC1 89FD 8FDDC1 <CJK>
+8FDDC2 89FF 8FDDC2 <CJK>
+8FDDC3 8A04 8FDDC3 <CJK>
+8FDDC4 8A05 8FDDC4 <CJK>
+8FDDC5 8A07 8FDDC5 <CJK>
+8FDDC6 8A0F 8FDDC6 <CJK>
+8FDDC7 8A11 8FDDC7 <CJK>
+8FDDC8 8A12 8FDDC8 <CJK>
+8FDDC9 8A14 8FDDC9 <CJK>
+8FDDCA 8A15 8FDDCA <CJK>
+8FDDCB 8A1E 8FDDCB <CJK>
+8FDDCC 8A20 8FDDCC <CJK>
+8FDDCD 8A22 8FDDCD <CJK>
+8FDDCE 8A24 8FDDCE <CJK>
+8FDDCF 8A26 8FDDCF <CJK>
+8FDDD0 8A2B 8FDDD0 <CJK>
+8FDDD1 8A2C 8FDDD1 <CJK>
+8FDDD2 8A2F 8FDDD2 <CJK>
+8FDDD3 8A35 8FDDD3 <CJK>
+8FDDD4 8A37 8FDDD4 <CJK>
+8FDDD5 8A3D 8FDDD5 <CJK>
+8FDDD6 8A3E 8FDDD6 <CJK>
+8FDDD7 8A40 8FDDD7 <CJK>
+8FDDD8 8A43 8FDDD8 <CJK>
+8FDDD9 8A45 8FDDD9 <CJK>
+8FDDDA 8A47 8FDDDA <CJK>
+8FDDDB 8A49 8FDDDB <CJK>
+8FDDDC 8A4D 8FDDDC <CJK>
+8FDDDD 8A4E 8FDDDD <CJK>
+8FDDDE 8A53 8FDDDE <CJK>
+8FDDDF 8A56 8FDDDF <CJK>
+8FDDE0 8A57 8FDDE0 <CJK>
+8FDDE1 8A58 8FDDE1 <CJK>
+8FDDE2 8A5C 8FDDE2 <CJK>
+8FDDE3 8A5D 8FDDE3 <CJK>
+8FDDE4 8A61 8FDDE4 <CJK>
+8FDDE5 8A65 8FDDE5 <CJK>
+8FDDE6 8A67 8FDDE6 <CJK>
+8FDDE7 8A75 8FDDE7 <CJK>
+8FDDE8 8A76 8FDDE8 <CJK>
+8FDDE9 8A77 8FDDE9 <CJK>
+8FDDEA 8A79 8FDDEA <CJK>
+8FDDEB 8A7A 8FDDEB <CJK>
+8FDDEC 8A7B 8FDDEC <CJK>
+8FDDED 8A7E 8FDDED <CJK>
+8FDDEE 8A7F 8FDDEE <CJK>
+8FDDEF 8A80 8FDDEF <CJK>
+8FDDF0 8A83 8FDDF0 <CJK>
+8FDDF1 8A86 8FDDF1 <CJK>
+8FDDF2 8A8B 8FDDF2 <CJK>
+8FDDF3 8A8F 8FDDF3 <CJK>
+8FDDF4 8A90 8FDDF4 <CJK>
+8FDDF5 8A92 8FDDF5 <CJK>
+8FDDF6 8A96 8FDDF6 <CJK>
+8FDDF7 8A97 8FDDF7 <CJK>
+8FDDF8 8A99 8FDDF8 <CJK>
+8FDDF9 8A9F 8FDDF9 <CJK>
+8FDDFA 8AA7 8FDDFA <CJK>
+8FDDFB 8AA9 8FDDFB <CJK>
+8FDDFC 8AAE 8FDDFC <CJK>
+8FDDFD 8AAF 8FDDFD <CJK>
+8FDDFE 8AB3 8FDDFE <CJK>
+8FDEA1 8AB6 8FDEA1 <CJK>
+8FDEA2 8AB7 8FDEA2 <CJK>
+8FDEA3 8ABB 8FDEA3 <CJK>
+8FDEA4 8ABE 8FDEA4 <CJK>
+8FDEA5 8AC3 8FDEA5 <CJK>
+8FDEA6 8AC6 8FDEA6 <CJK>
+8FDEA7 8AC8 8FDEA7 <CJK>
+8FDEA8 8AC9 8FDEA8 <CJK>
+8FDEA9 8ACA 8FDEA9 <CJK>
+8FDEAA 8AD1 8FDEAA <CJK>
+8FDEAB 8AD3 8FDEAB <CJK>
+8FDEAC 8AD4 8FDEAC <CJK>
+8FDEAD 8AD5 8FDEAD <CJK>
+8FDEAE 8AD7 8FDEAE <CJK>
+8FDEAF 8ADD 8FDEAF <CJK>
+8FDEB0 8ADF 8FDEB0 <CJK>
+8FDEB1 8AEC 8FDEB1 <CJK>
+8FDEB2 8AF0 8FDEB2 <CJK>
+8FDEB3 8AF4 8FDEB3 <CJK>
+8FDEB4 8AF5 8FDEB4 <CJK>
+8FDEB5 8AF6 8FDEB5 <CJK>
+8FDEB6 8AFC 8FDEB6 <CJK>
+8FDEB7 8AFF 8FDEB7 <CJK>
+8FDEB8 8B05 8FDEB8 <CJK>
+8FDEB9 8B06 8FDEB9 <CJK>
+8FDEBA 8B0B 8FDEBA <CJK>
+8FDEBB 8B11 8FDEBB <CJK>
+8FDEBC 8B1C 8FDEBC <CJK>
+8FDEBD 8B1E 8FDEBD <CJK>
+8FDEBE 8B1F 8FDEBE <CJK>
+8FDEBF 8B0A 8FDEBF <CJK>
+8FDEC0 8B2D 8FDEC0 <CJK>
+8FDEC1 8B30 8FDEC1 <CJK>
+8FDEC2 8B37 8FDEC2 <CJK>
+8FDEC3 8B3C 8FDEC3 <CJK>
+8FDEC4 8B42 8FDEC4 <CJK>
+8FDEC5 8B43 8FDEC5 <CJK>
+8FDEC6 8B44 8FDEC6 <CJK>
+8FDEC7 8B45 8FDEC7 <CJK>
+8FDEC8 8B46 8FDEC8 <CJK>
+8FDEC9 8B48 8FDEC9 <CJK>
+8FDECA 8B52 8FDECA <CJK>
+8FDECB 8B53 8FDECB <CJK>
+8FDECC 8B54 8FDECC <CJK>
+8FDECD 8B59 8FDECD <CJK>
+8FDECE 8B4D 8FDECE <CJK>
+8FDECF 8B5E 8FDECF <CJK>
+8FDED0 8B63 8FDED0 <CJK>
+8FDED1 8B6D 8FDED1 <CJK>
+8FDED2 8B76 8FDED2 <CJK>
+8FDED3 8B78 8FDED3 <CJK>
+8FDED4 8B79 8FDED4 <CJK>
+8FDED5 8B7C 8FDED5 <CJK>
+8FDED6 8B7E 8FDED6 <CJK>
+8FDED7 8B81 8FDED7 <CJK>
+8FDED8 8B84 8FDED8 <CJK>
+8FDED9 8B85 8FDED9 <CJK>
+8FDEDA 8B8B 8FDEDA <CJK>
+8FDEDB 8B8D 8FDEDB <CJK>
+8FDEDC 8B8F 8FDEDC <CJK>
+8FDEDD 8B94 8FDEDD <CJK>
+8FDEDE 8B95 8FDEDE <CJK>
+8FDEDF 8B9C 8FDEDF <CJK>
+8FDEE0 8B9E 8FDEE0 <CJK>
+8FDEE1 8B9F 8FDEE1 <CJK>
+8FDEE2 8C38 8FDEE2 <CJK>
+8FDEE3 8C39 8FDEE3 <CJK>
+8FDEE4 8C3D 8FDEE4 <CJK>
+8FDEE5 8C3E 8FDEE5 <CJK>
+8FDEE6 8C45 8FDEE6 <CJK>
+8FDEE7 8C47 8FDEE7 <CJK>
+8FDEE8 8C49 8FDEE8 <CJK>
+8FDEE9 8C4B 8FDEE9 <CJK>
+8FDEEA 8C4F 8FDEEA <CJK>
+8FDEEB 8C51 8FDEEB <CJK>
+8FDEEC 8C53 8FDEEC <CJK>
+8FDEED 8C54 8FDEED <CJK>
+8FDEEE 8C57 8FDEEE <CJK>
+8FDEEF 8C58 8FDEEF <CJK>
+8FDEF0 8C5B 8FDEF0 <CJK>
+8FDEF1 8C5D 8FDEF1 <CJK>
+8FDEF2 8C59 8FDEF2 <CJK>
+8FDEF3 8C63 8FDEF3 <CJK>
+8FDEF4 8C64 8FDEF4 <CJK>
+8FDEF5 8C66 8FDEF5 <CJK>
+8FDEF6 8C68 8FDEF6 <CJK>
+8FDEF7 8C69 8FDEF7 <CJK>
+8FDEF8 8C6D 8FDEF8 <CJK>
+8FDEF9 8C73 8FDEF9 <CJK>
+8FDEFA 8C75 8FDEFA <CJK>
+8FDEFB 8C76 8FDEFB <CJK>
+8FDEFC 8C7B 8FDEFC <CJK>
+8FDEFD 8C7E 8FDEFD <CJK>
+8FDEFE 8C86 8FDEFE <CJK>
+8FDFA1 8C87 8FDFA1 <CJK>
+8FDFA2 8C8B 8FDFA2 <CJK>
+8FDFA3 8C90 8FDFA3 <CJK>
+8FDFA4 8C92 8FDFA4 <CJK>
+8FDFA5 8C93 8FDFA5 <CJK>
+8FDFA6 8C99 8FDFA6 <CJK>
+8FDFA7 8C9B 8FDFA7 <CJK>
+8FDFA8 8C9C 8FDFA8 <CJK>
+8FDFA9 8CA4 8FDFA9 <CJK>
+8FDFAA 8CB9 8FDFAA <CJK>
+8FDFAB 8CBA 8FDFAB <CJK>
+8FDFAC 8CC5 8FDFAC <CJK>
+8FDFAD 8CC6 8FDFAD <CJK>
+8FDFAE 8CC9 8FDFAE <CJK>
+8FDFAF 8CCB 8FDFAF <CJK>
+8FDFB0 8CCF 8FDFB0 <CJK>
+8FDFB1 8CD6 8FDFB1 <CJK>
+8FDFB2 8CD5 8FDFB2 <CJK>
+8FDFB3 8CD9 8FDFB3 <CJK>
+8FDFB4 8CDD 8FDFB4 <CJK>
+8FDFB5 8CE1 8FDFB5 <CJK>
+8FDFB6 8CE8 8FDFB6 <CJK>
+8FDFB7 8CEC 8FDFB7 <CJK>
+8FDFB8 8CEF 8FDFB8 <CJK>
+8FDFB9 8CF0 8FDFB9 <CJK>
+8FDFBA 8CF2 8FDFBA <CJK>
+8FDFBB 8CF5 8FDFBB <CJK>
+8FDFBC 8CF7 8FDFBC <CJK>
+8FDFBD 8CF8 8FDFBD <CJK>
+8FDFBE 8CFE 8FDFBE <CJK>
+8FDFBF 8CFF 8FDFBF <CJK>
+8FDFC0 8D01 8FDFC0 <CJK>
+8FDFC1 8D03 8FDFC1 <CJK>
+8FDFC2 8D09 8FDFC2 <CJK>
+8FDFC3 8D12 8FDFC3 <CJK>
+8FDFC4 8D17 8FDFC4 <CJK>
+8FDFC5 8D1B 8FDFC5 <CJK>
+8FDFC6 8D65 8FDFC6 <CJK>
+8FDFC7 8D69 8FDFC7 <CJK>
+8FDFC8 8D6C 8FDFC8 <CJK>
+8FDFC9 8D6E 8FDFC9 <CJK>
+8FDFCA 8D7F 8FDFCA <CJK>
+8FDFCB 8D82 8FDFCB <CJK>
+8FDFCC 8D84 8FDFCC <CJK>
+8FDFCD 8D88 8FDFCD <CJK>
+8FDFCE 8D8D 8FDFCE <CJK>
+8FDFCF 8D90 8FDFCF <CJK>
+8FDFD0 8D91 8FDFD0 <CJK>
+8FDFD1 8D95 8FDFD1 <CJK>
+8FDFD2 8D9E 8FDFD2 <CJK>
+8FDFD3 8D9F 8FDFD3 <CJK>
+8FDFD4 8DA0 8FDFD4 <CJK>
+8FDFD5 8DA6 8FDFD5 <CJK>
+8FDFD6 8DAB 8FDFD6 <CJK>
+8FDFD7 8DAC 8FDFD7 <CJK>
+8FDFD8 8DAF 8FDFD8 <CJK>
+8FDFD9 8DB2 8FDFD9 <CJK>
+8FDFDA 8DB5 8FDFDA <CJK>
+8FDFDB 8DB7 8FDFDB <CJK>
+8FDFDC 8DB9 8FDFDC <CJK>
+8FDFDD 8DBB 8FDFDD <CJK>
+8FDFDE 8DC0 8FDFDE <CJK>
+8FDFDF 8DC5 8FDFDF <CJK>
+8FDFE0 8DC6 8FDFE0 <CJK>
+8FDFE1 8DC7 8FDFE1 <CJK>
+8FDFE2 8DC8 8FDFE2 <CJK>
+8FDFE3 8DCA 8FDFE3 <CJK>
+8FDFE4 8DCE 8FDFE4 <CJK>
+8FDFE5 8DD1 8FDFE5 <CJK>
+8FDFE6 8DD4 8FDFE6 <CJK>
+8FDFE7 8DD5 8FDFE7 <CJK>
+8FDFE8 8DD7 8FDFE8 <CJK>
+8FDFE9 8DD9 8FDFE9 <CJK>
+8FDFEA 8DE4 8FDFEA <CJK>
+8FDFEB 8DE5 8FDFEB <CJK>
+8FDFEC 8DE7 8FDFEC <CJK>
+8FDFED 8DEC 8FDFED <CJK>
+8FDFEE 8DF0 8FDFEE <CJK>
+8FDFEF 8DBC 8FDFEF <CJK>
+8FDFF0 8DF1 8FDFF0 <CJK>
+8FDFF1 8DF2 8FDFF1 <CJK>
+8FDFF2 8DF4 8FDFF2 <CJK>
+8FDFF3 8DFD 8FDFF3 <CJK>
+8FDFF4 8E01 8FDFF4 <CJK>
+8FDFF5 8E04 8FDFF5 <CJK>
+8FDFF6 8E05 8FDFF6 <CJK>
+8FDFF7 8E06 8FDFF7 <CJK>
+8FDFF8 8E0B 8FDFF8 <CJK>
+8FDFF9 8E11 8FDFF9 <CJK>
+8FDFFA 8E14 8FDFFA <CJK>
+8FDFFB 8E16 8FDFFB <CJK>
+8FDFFC 8E20 8FDFFC <CJK>
+8FDFFD 8E21 8FDFFD <CJK>
+8FDFFE 8E22 8FDFFE <CJK>
+8FE0A1 8E23 8FE0A1 <CJK>
+8FE0A2 8E26 8FE0A2 <CJK>
+8FE0A3 8E27 8FE0A3 <CJK>
+8FE0A4 8E31 8FE0A4 <CJK>
+8FE0A5 8E33 8FE0A5 <CJK>
+8FE0A6 8E36 8FE0A6 <CJK>
+8FE0A7 8E37 8FE0A7 <CJK>
+8FE0A8 8E38 8FE0A8 <CJK>
+8FE0A9 8E39 8FE0A9 <CJK>
+8FE0AA 8E3D 8FE0AA <CJK>
+8FE0AB 8E40 8FE0AB <CJK>
+8FE0AC 8E41 8FE0AC <CJK>
+8FE0AD 8E4B 8FE0AD <CJK>
+8FE0AE 8E4D 8FE0AE <CJK>
+8FE0AF 8E4E 8FE0AF <CJK>
+8FE0B0 8E4F 8FE0B0 <CJK>
+8FE0B1 8E54 8FE0B1 <CJK>
+8FE0B2 8E5B 8FE0B2 <CJK>
+8FE0B3 8E5C 8FE0B3 <CJK>
+8FE0B4 8E5D 8FE0B4 <CJK>
+8FE0B5 8E5E 8FE0B5 <CJK>
+8FE0B6 8E61 8FE0B6 <CJK>
+8FE0B7 8E62 8FE0B7 <CJK>
+8FE0B8 8E69 8FE0B8 <CJK>
+8FE0B9 8E6C 8FE0B9 <CJK>
+8FE0BA 8E6D 8FE0BA <CJK>
+8FE0BB 8E6F 8FE0BB <CJK>
+8FE0BC 8E70 8FE0BC <CJK>
+8FE0BD 8E71 8FE0BD <CJK>
+8FE0BE 8E79 8FE0BE <CJK>
+8FE0BF 8E7A 8FE0BF <CJK>
+8FE0C0 8E7B 8FE0C0 <CJK>
+8FE0C1 8E82 8FE0C1 <CJK>
+8FE0C2 8E83 8FE0C2 <CJK>
+8FE0C3 8E89 8FE0C3 <CJK>
+8FE0C4 8E90 8FE0C4 <CJK>
+8FE0C5 8E92 8FE0C5 <CJK>
+8FE0C6 8E95 8FE0C6 <CJK>
+8FE0C7 8E9A 8FE0C7 <CJK>
+8FE0C8 8E9B 8FE0C8 <CJK>
+8FE0C9 8E9D 8FE0C9 <CJK>
+8FE0CA 8E9E 8FE0CA <CJK>
+8FE0CB 8EA2 8FE0CB <CJK>
+8FE0CC 8EA7 8FE0CC <CJK>
+8FE0CD 8EA9 8FE0CD <CJK>
+8FE0CE 8EAD 8FE0CE <CJK>
+8FE0CF 8EAE 8FE0CF <CJK>
+8FE0D0 8EB3 8FE0D0 <CJK>
+8FE0D1 8EB5 8FE0D1 <CJK>
+8FE0D2 8EBA 8FE0D2 <CJK>
+8FE0D3 8EBB 8FE0D3 <CJK>
+8FE0D4 8EC0 8FE0D4 <CJK>
+8FE0D5 8EC1 8FE0D5 <CJK>
+8FE0D6 8EC3 8FE0D6 <CJK>
+8FE0D7 8EC4 8FE0D7 <CJK>
+8FE0D8 8EC7 8FE0D8 <CJK>
+8FE0D9 8ECF 8FE0D9 <CJK>
+8FE0DA 8ED1 8FE0DA <CJK>
+8FE0DB 8ED4 8FE0DB <CJK>
+8FE0DC 8EDC 8FE0DC <CJK>
+8FE0DD 8EE8 8FE0DD <CJK>
+8FE0DE 8EEE 8FE0DE <CJK>
+8FE0DF 8EF0 8FE0DF <CJK>
+8FE0E0 8EF1 8FE0E0 <CJK>
+8FE0E1 8EF7 8FE0E1 <CJK>
+8FE0E2 8EF9 8FE0E2 <CJK>
+8FE0E3 8EFA 8FE0E3 <CJK>
+8FE0E4 8EED 8FE0E4 <CJK>
+8FE0E5 8F00 8FE0E5 <CJK>
+8FE0E6 8F02 8FE0E6 <CJK>
+8FE0E7 8F07 8FE0E7 <CJK>
+8FE0E8 8F08 8FE0E8 <CJK>
+8FE0E9 8F0F 8FE0E9 <CJK>
+8FE0EA 8F10 8FE0EA <CJK>
+8FE0EB 8F16 8FE0EB <CJK>
+8FE0EC 8F17 8FE0EC <CJK>
+8FE0ED 8F18 8FE0ED <CJK>
+8FE0EE 8F1E 8FE0EE <CJK>
+8FE0EF 8F20 8FE0EF <CJK>
+8FE0F0 8F21 8FE0F0 <CJK>
+8FE0F1 8F23 8FE0F1 <CJK>
+8FE0F2 8F25 8FE0F2 <CJK>
+8FE0F3 8F27 8FE0F3 <CJK>
+8FE0F4 8F28 8FE0F4 <CJK>
+8FE0F5 8F2C 8FE0F5 <CJK>
+8FE0F6 8F2D 8FE0F6 <CJK>
+8FE0F7 8F2E 8FE0F7 <CJK>
+8FE0F8 8F34 8FE0F8 <CJK>
+8FE0F9 8F35 8FE0F9 <CJK>
+8FE0FA 8F36 8FE0FA <CJK>
+8FE0FB 8F37 8FE0FB <CJK>
+8FE0FC 8F3A 8FE0FC <CJK>
+8FE0FD 8F40 8FE0FD <CJK>
+8FE0FE 8F41 8FE0FE <CJK>
+8FE1A1 8F43 8FE1A1 <CJK>
+8FE1A2 8F47 8FE1A2 <CJK>
+8FE1A3 8F4F 8FE1A3 <CJK>
+8FE1A4 8F51 8FE1A4 <CJK>
+8FE1A5 8F52 8FE1A5 <CJK>
+8FE1A6 8F53 8FE1A6 <CJK>
+8FE1A7 8F54 8FE1A7 <CJK>
+8FE1A8 8F55 8FE1A8 <CJK>
+8FE1A9 8F58 8FE1A9 <CJK>
+8FE1AA 8F5D 8FE1AA <CJK>
+8FE1AB 8F5E 8FE1AB <CJK>
+8FE1AC 8F65 8FE1AC <CJK>
+8FE1AD 8F9D 8FE1AD <CJK>
+8FE1AE 8FA0 8FE1AE <CJK>
+8FE1AF 8FA1 8FE1AF <CJK>
+8FE1B0 8FA4 8FE1B0 <CJK>
+8FE1B1 8FA5 8FE1B1 <CJK>
+8FE1B2 8FA6 8FE1B2 <CJK>
+8FE1B3 8FB5 8FE1B3 <CJK>
+8FE1B4 8FB6 8FE1B4 <CJK>
+8FE1B5 8FB8 8FE1B5 <CJK>
+8FE1B6 8FBE 8FE1B6 <CJK>
+8FE1B7 8FC0 8FE1B7 <CJK>
+8FE1B8 8FC1 8FE1B8 <CJK>
+8FE1B9 8FC6 8FE1B9 <CJK>
+8FE1BA 8FCA 8FE1BA <CJK>
+8FE1BB 8FCB 8FE1BB <CJK>
+8FE1BC 8FCD 8FE1BC <CJK>
+8FE1BD 8FD0 8FE1BD <CJK>
+8FE1BE 8FD2 8FE1BE <CJK>
+8FE1BF 8FD3 8FE1BF <CJK>
+8FE1C0 8FD5 8FE1C0 <CJK>
+8FE1C1 8FE0 8FE1C1 <CJK>
+8FE1C2 8FE3 8FE1C2 <CJK>
+8FE1C3 8FE4 8FE1C3 <CJK>
+8FE1C4 8FE8 8FE1C4 <CJK>
+8FE1C5 8FEE 8FE1C5 <CJK>
+8FE1C6 8FF1 8FE1C6 <CJK>
+8FE1C7 8FF5 8FE1C7 <CJK>
+8FE1C8 8FF6 8FE1C8 <CJK>
+8FE1C9 8FFB 8FE1C9 <CJK>
+8FE1CA 8FFE 8FE1CA <CJK>
+8FE1CB 9002 8FE1CB <CJK>
+8FE1CC 9004 8FE1CC <CJK>
+8FE1CD 9008 8FE1CD <CJK>
+8FE1CE 900C 8FE1CE <CJK>
+8FE1CF 9018 8FE1CF <CJK>
+8FE1D0 901B 8FE1D0 <CJK>
+8FE1D1 9028 8FE1D1 <CJK>
+8FE1D2 9029 8FE1D2 <CJK>
+8FE1D3 902F 8FE1D3 <CJK>
+8FE1D4 902A 8FE1D4 <CJK>
+8FE1D5 902C 8FE1D5 <CJK>
+8FE1D6 902D 8FE1D6 <CJK>
+8FE1D7 9033 8FE1D7 <CJK>
+8FE1D8 9034 8FE1D8 <CJK>
+8FE1D9 9037 8FE1D9 <CJK>
+8FE1DA 903F 8FE1DA <CJK>
+8FE1DB 9043 8FE1DB <CJK>
+8FE1DC 9044 8FE1DC <CJK>
+8FE1DD 904C 8FE1DD <CJK>
+8FE1DE 905B 8FE1DE <CJK>
+8FE1DF 905D 8FE1DF <CJK>
+8FE1E0 9062 8FE1E0 <CJK>
+8FE1E1 9066 8FE1E1 <CJK>
+8FE1E2 9067 8FE1E2 <CJK>
+8FE1E3 906C 8FE1E3 <CJK>
+8FE1E4 9070 8FE1E4 <CJK>
+8FE1E5 9074 8FE1E5 <CJK>
+8FE1E6 9079 8FE1E6 <CJK>
+8FE1E7 9085 8FE1E7 <CJK>
+8FE1E8 9088 8FE1E8 <CJK>
+8FE1E9 908B 8FE1E9 <CJK>
+8FE1EA 908C 8FE1EA <CJK>
+8FE1EB 908E 8FE1EB <CJK>
+8FE1EC 9090 8FE1EC <CJK>
+8FE1ED 9095 8FE1ED <CJK>
+8FE1EE 9097 8FE1EE <CJK>
+8FE1EF 9098 8FE1EF <CJK>
+8FE1F0 9099 8FE1F0 <CJK>
+8FE1F1 909B 8FE1F1 <CJK>
+8FE1F2 90A0 8FE1F2 <CJK>
+8FE1F3 90A1 8FE1F3 <CJK>
+8FE1F4 90A2 8FE1F4 <CJK>
+8FE1F5 90A5 8FE1F5 <CJK>
+8FE1F6 90B0 8FE1F6 <CJK>
+8FE1F7 90B2 8FE1F7 <CJK>
+8FE1F8 90B3 8FE1F8 <CJK>
+8FE1F9 90B4 8FE1F9 <CJK>
+8FE1FA 90B6 8FE1FA <CJK>
+8FE1FB 90BD 8FE1FB <CJK>
+8FE1FC 90CC 8FE1FC <CJK>
+8FE1FD 90BE 8FE1FD <CJK>
+8FE1FE 90C3 8FE1FE <CJK>
+8FE2A1 90C4 8FE2A1 <CJK>
+8FE2A2 90C5 8FE2A2 <CJK>
+8FE2A3 90C7 8FE2A3 <CJK>
+8FE2A4 90C8 8FE2A4 <CJK>
+8FE2A5 90D5 8FE2A5 <CJK>
+8FE2A6 90D7 8FE2A6 <CJK>
+8FE2A7 90D8 8FE2A7 <CJK>
+8FE2A8 90D9 8FE2A8 <CJK>
+8FE2A9 90DC 8FE2A9 <CJK>
+8FE2AA 90DD 8FE2AA <CJK>
+8FE2AB 90DF 8FE2AB <CJK>
+8FE2AC 90E5 8FE2AC <CJK>
+8FE2AD 90D2 8FE2AD <CJK>
+8FE2AE 90F6 8FE2AE <CJK>
+8FE2AF 90EB 8FE2AF <CJK>
+8FE2B0 90EF 8FE2B0 <CJK>
+8FE2B1 90F0 8FE2B1 <CJK>
+8FE2B2 90F4 8FE2B2 <CJK>
+8FE2B3 90FE 8FE2B3 <CJK>
+8FE2B4 90FF 8FE2B4 <CJK>
+8FE2B5 9100 8FE2B5 <CJK>
+8FE2B6 9104 8FE2B6 <CJK>
+8FE2B7 9105 8FE2B7 <CJK>
+8FE2B8 9106 8FE2B8 <CJK>
+8FE2B9 9108 8FE2B9 <CJK>
+8FE2BA 910D 8FE2BA <CJK>
+8FE2BB 9110 8FE2BB <CJK>
+8FE2BC 9114 8FE2BC <CJK>
+8FE2BD 9116 8FE2BD <CJK>
+8FE2BE 9117 8FE2BE <CJK>
+8FE2BF 9118 8FE2BF <CJK>
+8FE2C0 911A 8FE2C0 <CJK>
+8FE2C1 911C 8FE2C1 <CJK>
+8FE2C2 911E 8FE2C2 <CJK>
+8FE2C3 9120 8FE2C3 <CJK>
+8FE2C4 9125 8FE2C4 <CJK>
+8FE2C5 9122 8FE2C5 <CJK>
+8FE2C6 9123 8FE2C6 <CJK>
+8FE2C7 9127 8FE2C7 <CJK>
+8FE2C8 9129 8FE2C8 <CJK>
+8FE2C9 912E 8FE2C9 <CJK>
+8FE2CA 912F 8FE2CA <CJK>
+8FE2CB 9131 8FE2CB <CJK>
+8FE2CC 9134 8FE2CC <CJK>
+8FE2CD 9136 8FE2CD <CJK>
+8FE2CE 9137 8FE2CE <CJK>
+8FE2CF 9139 8FE2CF <CJK>
+8FE2D0 913A 8FE2D0 <CJK>
+8FE2D1 913C 8FE2D1 <CJK>
+8FE2D2 913D 8FE2D2 <CJK>
+8FE2D3 9143 8FE2D3 <CJK>
+8FE2D4 9147 8FE2D4 <CJK>
+8FE2D5 9148 8FE2D5 <CJK>
+8FE2D6 914F 8FE2D6 <CJK>
+8FE2D7 9153 8FE2D7 <CJK>
+8FE2D8 9157 8FE2D8 <CJK>
+8FE2D9 9159 8FE2D9 <CJK>
+8FE2DA 915A 8FE2DA <CJK>
+8FE2DB 915B 8FE2DB <CJK>
+8FE2DC 9161 8FE2DC <CJK>
+8FE2DD 9164 8FE2DD <CJK>
+8FE2DE 9167 8FE2DE <CJK>
+8FE2DF 916D 8FE2DF <CJK>
+8FE2E0 9174 8FE2E0 <CJK>
+8FE2E1 9179 8FE2E1 <CJK>
+8FE2E2 917A 8FE2E2 <CJK>
+8FE2E3 917B 8FE2E3 <CJK>
+8FE2E4 9181 8FE2E4 <CJK>
+8FE2E5 9183 8FE2E5 <CJK>
+8FE2E6 9185 8FE2E6 <CJK>
+8FE2E7 9186 8FE2E7 <CJK>
+8FE2E8 918A 8FE2E8 <CJK>
+8FE2E9 918E 8FE2E9 <CJK>
+8FE2EA 9191 8FE2EA <CJK>
+8FE2EB 9193 8FE2EB <CJK>
+8FE2EC 9194 8FE2EC <CJK>
+8FE2ED 9195 8FE2ED <CJK>
+8FE2EE 9198 8FE2EE <CJK>
+8FE2EF 919E 8FE2EF <CJK>
+8FE2F0 91A1 8FE2F0 <CJK>
+8FE2F1 91A6 8FE2F1 <CJK>
+8FE2F2 91A8 8FE2F2 <CJK>
+8FE2F3 91AC 8FE2F3 <CJK>
+8FE2F4 91AD 8FE2F4 <CJK>
+8FE2F5 91AE 8FE2F5 <CJK>
+8FE2F6 91B0 8FE2F6 <CJK>
+8FE2F7 91B1 8FE2F7 <CJK>
+8FE2F8 91B2 8FE2F8 <CJK>
+8FE2F9 91B3 8FE2F9 <CJK>
+8FE2FA 91B6 8FE2FA <CJK>
+8FE2FB 91BB 8FE2FB <CJK>
+8FE2FC 91BC 8FE2FC <CJK>
+8FE2FD 91BD 8FE2FD <CJK>
+8FE2FE 91BF 8FE2FE <CJK>
+8FE3A1 91C2 8FE3A1 <CJK>
+8FE3A2 91C3 8FE3A2 <CJK>
+8FE3A3 91C5 8FE3A3 <CJK>
+8FE3A4 91D3 8FE3A4 <CJK>
+8FE3A5 91D4 8FE3A5 <CJK>
+8FE3A6 91D7 8FE3A6 <CJK>
+8FE3A7 91D9 8FE3A7 <CJK>
+8FE3A8 91DA 8FE3A8 <CJK>
+8FE3A9 91DE 8FE3A9 <CJK>
+8FE3AA 91E4 8FE3AA <CJK>
+8FE3AB 91E5 8FE3AB <CJK>
+8FE3AC 91E9 8FE3AC <CJK>
+8FE3AD 91EA 8FE3AD <CJK>
+8FE3AE 91EC 8FE3AE <CJK>
+8FE3AF 91ED 8FE3AF <CJK>
+8FE3B0 91EE 8FE3B0 <CJK>
+8FE3B1 91EF 8FE3B1 <CJK>
+8FE3B2 91F0 8FE3B2 <CJK>
+8FE3B3 91F1 8FE3B3 <CJK>
+8FE3B4 91F7 8FE3B4 <CJK>
+8FE3B5 91F9 8FE3B5 <CJK>
+8FE3B6 91FB 8FE3B6 <CJK>
+8FE3B7 91FD 8FE3B7 <CJK>
+8FE3B8 9200 8FE3B8 <CJK>
+8FE3B9 9201 8FE3B9 <CJK>
+8FE3BA 9204 8FE3BA <CJK>
+8FE3BB 9205 8FE3BB <CJK>
+8FE3BC 9206 8FE3BC <CJK>
+8FE3BD 9207 8FE3BD <CJK>
+8FE3BE 9209 8FE3BE <CJK>
+8FE3BF 920A 8FE3BF <CJK>
+8FE3C0 920C 8FE3C0 <CJK>
+8FE3C1 9210 8FE3C1 <CJK>
+8FE3C2 9212 8FE3C2 <CJK>
+8FE3C3 9213 8FE3C3 <CJK>
+8FE3C4 9216 8FE3C4 <CJK>
+8FE3C5 9218 8FE3C5 <CJK>
+8FE3C6 921C 8FE3C6 <CJK>
+8FE3C7 921D 8FE3C7 <CJK>
+8FE3C8 9223 8FE3C8 <CJK>
+8FE3C9 9224 8FE3C9 <CJK>
+8FE3CA 9225 8FE3CA <CJK>
+8FE3CB 9226 8FE3CB <CJK>
+8FE3CC 9228 8FE3CC <CJK>
+8FE3CD 922E 8FE3CD <CJK>
+8FE3CE 922F 8FE3CE <CJK>
+8FE3CF 9230 8FE3CF <CJK>
+8FE3D0 9233 8FE3D0 <CJK>
+8FE3D1 9235 8FE3D1 <CJK>
+8FE3D2 9236 8FE3D2 <CJK>
+8FE3D3 9238 8FE3D3 <CJK>
+8FE3D4 9239 8FE3D4 <CJK>
+8FE3D5 923A 8FE3D5 <CJK>
+8FE3D6 923C 8FE3D6 <CJK>
+8FE3D7 923E 8FE3D7 <CJK>
+8FE3D8 9240 8FE3D8 <CJK>
+8FE3D9 9242 8FE3D9 <CJK>
+8FE3DA 9243 8FE3DA <CJK>
+8FE3DB 9246 8FE3DB <CJK>
+8FE3DC 9247 8FE3DC <CJK>
+8FE3DD 924A 8FE3DD <CJK>
+8FE3DE 924D 8FE3DE <CJK>
+8FE3DF 924E 8FE3DF <CJK>
+8FE3E0 924F 8FE3E0 <CJK>
+8FE3E1 9251 8FE3E1 <CJK>
+8FE3E2 9258 8FE3E2 <CJK>
+8FE3E3 9259 8FE3E3 <CJK>
+8FE3E4 925C 8FE3E4 <CJK>
+8FE3E5 925D 8FE3E5 <CJK>
+8FE3E6 9260 8FE3E6 <CJK>
+8FE3E7 9261 8FE3E7 <CJK>
+8FE3E8 9265 8FE3E8 <CJK>
+8FE3E9 9267 8FE3E9 <CJK>
+8FE3EA 9268 8FE3EA <CJK>
+8FE3EB 9269 8FE3EB <CJK>
+8FE3EC 926E 8FE3EC <CJK>
+8FE3ED 926F 8FE3ED <CJK>
+8FE3EE 9270 8FE3EE <CJK>
+8FE3EF 9275 8FE3EF <CJK>
+8FE3F0 9276 8FE3F0 <CJK>
+8FE3F1 9277 8FE3F1 <CJK>
+8FE3F2 9278 8FE3F2 <CJK>
+8FE3F3 9279 8FE3F3 <CJK>
+8FE3F4 927B 8FE3F4 <CJK>
+8FE3F5 927C 8FE3F5 <CJK>
+8FE3F6 927D 8FE3F6 <CJK>
+8FE3F7 927F 8FE3F7 <CJK>
+8FE3F8 9288 8FE3F8 <CJK>
+8FE3F9 9289 8FE3F9 <CJK>
+8FE3FA 928A 8FE3FA <CJK>
+8FE3FB 928D 8FE3FB <CJK>
+8FE3FC 928E 8FE3FC <CJK>
+8FE3FD 9292 8FE3FD <CJK>
+8FE3FE 9297 8FE3FE <CJK>
+8FE4A1 9299 8FE4A1 <CJK>
+8FE4A2 929F 8FE4A2 <CJK>
+8FE4A3 92A0 8FE4A3 <CJK>
+8FE4A4 92A4 8FE4A4 <CJK>
+8FE4A5 92A5 8FE4A5 <CJK>
+8FE4A6 92A7 8FE4A6 <CJK>
+8FE4A7 92A8 8FE4A7 <CJK>
+8FE4A8 92AB 8FE4A8 <CJK>
+8FE4A9 92AF 8FE4A9 <CJK>
+8FE4AA 92B2 8FE4AA <CJK>
+8FE4AB 92B6 8FE4AB <CJK>
+8FE4AC 92B8 8FE4AC <CJK>
+8FE4AD 92BA 8FE4AD <CJK>
+8FE4AE 92BB 8FE4AE <CJK>
+8FE4AF 92BC 8FE4AF <CJK>
+8FE4B0 92BD 8FE4B0 <CJK>
+8FE4B1 92BF 8FE4B1 <CJK>
+8FE4B2 92C0 8FE4B2 <CJK>
+8FE4B3 92C1 8FE4B3 <CJK>
+8FE4B4 92C2 8FE4B4 <CJK>
+8FE4B5 92C3 8FE4B5 <CJK>
+8FE4B6 92C5 8FE4B6 <CJK>
+8FE4B7 92C6 8FE4B7 <CJK>
+8FE4B8 92C7 8FE4B8 <CJK>
+8FE4B9 92C8 8FE4B9 <CJK>
+8FE4BA 92CB 8FE4BA <CJK>
+8FE4BB 92CC 8FE4BB <CJK>
+8FE4BC 92CD 8FE4BC <CJK>
+8FE4BD 92CE 8FE4BD <CJK>
+8FE4BE 92D0 8FE4BE <CJK>
+8FE4BF 92D3 8FE4BF <CJK>
+8FE4C0 92D5 8FE4C0 <CJK>
+8FE4C1 92D7 8FE4C1 <CJK>
+8FE4C2 92D8 8FE4C2 <CJK>
+8FE4C3 92D9 8FE4C3 <CJK>
+8FE4C4 92DC 8FE4C4 <CJK>
+8FE4C5 92DD 8FE4C5 <CJK>
+8FE4C6 92DF 8FE4C6 <CJK>
+8FE4C7 92E0 8FE4C7 <CJK>
+8FE4C8 92E1 8FE4C8 <CJK>
+8FE4C9 92E3 8FE4C9 <CJK>
+8FE4CA 92E5 8FE4CA <CJK>
+8FE4CB 92E7 8FE4CB <CJK>
+8FE4CC 92E8 8FE4CC <CJK>
+8FE4CD 92EC 8FE4CD <CJK>
+8FE4CE 92EE 8FE4CE <CJK>
+8FE4CF 92F0 8FE4CF <CJK>
+8FE4D0 92F9 8FE4D0 <CJK>
+8FE4D1 92FB 8FE4D1 <CJK>
+8FE4D2 92FF 8FE4D2 <CJK>
+8FE4D3 9300 8FE4D3 <CJK>
+8FE4D4 9302 8FE4D4 <CJK>
+8FE4D5 9308 8FE4D5 <CJK>
+8FE4D6 930D 8FE4D6 <CJK>
+8FE4D7 9311 8FE4D7 <CJK>
+8FE4D8 9314 8FE4D8 <CJK>
+8FE4D9 9315 8FE4D9 <CJK>
+8FE4DA 931C 8FE4DA <CJK>
+8FE4DB 931D 8FE4DB <CJK>
+8FE4DC 931E 8FE4DC <CJK>
+8FE4DD 931F 8FE4DD <CJK>
+8FE4DE 9321 8FE4DE <CJK>
+8FE4DF 9324 8FE4DF <CJK>
+8FE4E0 9325 8FE4E0 <CJK>
+8FE4E1 9327 8FE4E1 <CJK>
+8FE4E2 9329 8FE4E2 <CJK>
+8FE4E3 932A 8FE4E3 <CJK>
+8FE4E4 9333 8FE4E4 <CJK>
+8FE4E5 9334 8FE4E5 <CJK>
+8FE4E6 9336 8FE4E6 <CJK>
+8FE4E7 9337 8FE4E7 <CJK>
+8FE4E8 9347 8FE4E8 <CJK>
+8FE4E9 9348 8FE4E9 <CJK>
+8FE4EA 9349 8FE4EA <CJK>
+8FE4EB 9350 8FE4EB <CJK>
+8FE4EC 9351 8FE4EC <CJK>
+8FE4ED 9352 8FE4ED <CJK>
+8FE4EE 9355 8FE4EE <CJK>
+8FE4EF 9357 8FE4EF <CJK>
+8FE4F0 9358 8FE4F0 <CJK>
+8FE4F1 935A 8FE4F1 <CJK>
+8FE4F2 935E 8FE4F2 <CJK>
+8FE4F3 9364 8FE4F3 <CJK>
+8FE4F4 9365 8FE4F4 <CJK>
+8FE4F5 9367 8FE4F5 <CJK>
+8FE4F6 9369 8FE4F6 <CJK>
+8FE4F7 936A 8FE4F7 <CJK>
+8FE4F8 936D 8FE4F8 <CJK>
+8FE4F9 936F 8FE4F9 <CJK>
+8FE4FA 9370 8FE4FA <CJK>
+8FE4FB 9371 8FE4FB <CJK>
+8FE4FC 9373 8FE4FC <CJK>
+8FE4FD 9374 8FE4FD <CJK>
+8FE4FE 9376 8FE4FE <CJK>
+8FE5A1 937A 8FE5A1 <CJK>
+8FE5A2 937D 8FE5A2 <CJK>
+8FE5A3 937F 8FE5A3 <CJK>
+8FE5A4 9380 8FE5A4 <CJK>
+8FE5A5 9381 8FE5A5 <CJK>
+8FE5A6 9382 8FE5A6 <CJK>
+8FE5A7 9388 8FE5A7 <CJK>
+8FE5A8 938A 8FE5A8 <CJK>
+8FE5A9 938B 8FE5A9 <CJK>
+8FE5AA 938D 8FE5AA <CJK>
+8FE5AB 938F 8FE5AB <CJK>
+8FE5AC 9392 8FE5AC <CJK>
+8FE5AD 9395 8FE5AD <CJK>
+8FE5AE 9398 8FE5AE <CJK>
+8FE5AF 939B 8FE5AF <CJK>
+8FE5B0 939E 8FE5B0 <CJK>
+8FE5B1 93A1 8FE5B1 <CJK>
+8FE5B2 93A3 8FE5B2 <CJK>
+8FE5B3 93A4 8FE5B3 <CJK>
+8FE5B4 93A6 8FE5B4 <CJK>
+8FE5B5 93A8 8FE5B5 <CJK>
+8FE5B6 93AB 8FE5B6 <CJK>
+8FE5B7 93B4 8FE5B7 <CJK>
+8FE5B8 93B5 8FE5B8 <CJK>
+8FE5B9 93B6 8FE5B9 <CJK>
+8FE5BA 93BA 8FE5BA <CJK>
+8FE5BB 93A9 8FE5BB <CJK>
+8FE5BC 93C1 8FE5BC <CJK>
+8FE5BD 93C4 8FE5BD <CJK>
+8FE5BE 93C5 8FE5BE <CJK>
+8FE5BF 93C6 8FE5BF <CJK>
+8FE5C0 93C7 8FE5C0 <CJK>
+8FE5C1 93C9 8FE5C1 <CJK>
+8FE5C2 93CA 8FE5C2 <CJK>
+8FE5C3 93CB 8FE5C3 <CJK>
+8FE5C4 93CC 8FE5C4 <CJK>
+8FE5C5 93CD 8FE5C5 <CJK>
+8FE5C6 93D3 8FE5C6 <CJK>
+8FE5C7 93D9 8FE5C7 <CJK>
+8FE5C8 93DC 8FE5C8 <CJK>
+8FE5C9 93DE 8FE5C9 <CJK>
+8FE5CA 93DF 8FE5CA <CJK>
+8FE5CB 93E2 8FE5CB <CJK>
+8FE5CC 93E6 8FE5CC <CJK>
+8FE5CD 93E7 8FE5CD <CJK>
+8FE5CE 93F9 8FE5CE <CJK>
+8FE5CF 93F7 8FE5CF <CJK>
+8FE5D0 93F8 8FE5D0 <CJK>
+8FE5D1 93FA 8FE5D1 <CJK>
+8FE5D2 93FB 8FE5D2 <CJK>
+8FE5D3 93FD 8FE5D3 <CJK>
+8FE5D4 9401 8FE5D4 <CJK>
+8FE5D5 9402 8FE5D5 <CJK>
+8FE5D6 9404 8FE5D6 <CJK>
+8FE5D7 9408 8FE5D7 <CJK>
+8FE5D8 9409 8FE5D8 <CJK>
+8FE5D9 940D 8FE5D9 <CJK>
+8FE5DA 940E 8FE5DA <CJK>
+8FE5DB 940F 8FE5DB <CJK>
+8FE5DC 9415 8FE5DC <CJK>
+8FE5DD 9416 8FE5DD <CJK>
+8FE5DE 9417 8FE5DE <CJK>
+8FE5DF 941F 8FE5DF <CJK>
+8FE5E0 942E 8FE5E0 <CJK>
+8FE5E1 942F 8FE5E1 <CJK>
+8FE5E2 9431 8FE5E2 <CJK>
+8FE5E3 9432 8FE5E3 <CJK>
+8FE5E4 9433 8FE5E4 <CJK>
+8FE5E5 9434 8FE5E5 <CJK>
+8FE5E6 943B 8FE5E6 <CJK>
+8FE5E7 943F 8FE5E7 <CJK>
+8FE5E8 943D 8FE5E8 <CJK>
+8FE5E9 9443 8FE5E9 <CJK>
+8FE5EA 9445 8FE5EA <CJK>
+8FE5EB 9448 8FE5EB <CJK>
+8FE5EC 944A 8FE5EC <CJK>
+8FE5ED 944C 8FE5ED <CJK>
+8FE5EE 9455 8FE5EE <CJK>
+8FE5EF 9459 8FE5EF <CJK>
+8FE5F0 945C 8FE5F0 <CJK>
+8FE5F1 945F 8FE5F1 <CJK>
+8FE5F2 9461 8FE5F2 <CJK>
+8FE5F3 9463 8FE5F3 <CJK>
+8FE5F4 9468 8FE5F4 <CJK>
+8FE5F5 946B 8FE5F5 <CJK>
+8FE5F6 946D 8FE5F6 <CJK>
+8FE5F7 946E 8FE5F7 <CJK>
+8FE5F8 946F 8FE5F8 <CJK>
+8FE5F9 9471 8FE5F9 <CJK>
+8FE5FA 9472 8FE5FA <CJK>
+8FE5FB 9484 8FE5FB <CJK>
+8FE5FC 9483 8FE5FC <CJK>
+8FE5FD 9578 8FE5FD <CJK>
+8FE5FE 9579 8FE5FE <CJK>
+8FE6A1 957E 8FE6A1 <CJK>
+8FE6A2 9584 8FE6A2 <CJK>
+8FE6A3 9588 8FE6A3 <CJK>
+8FE6A4 958C 8FE6A4 <CJK>
+8FE6A5 958D 8FE6A5 <CJK>
+8FE6A6 958E 8FE6A6 <CJK>
+8FE6A7 959D 8FE6A7 <CJK>
+8FE6A8 959E 8FE6A8 <CJK>
+8FE6A9 959F 8FE6A9 <CJK>
+8FE6AA 95A1 8FE6AA <CJK>
+8FE6AB 95A6 8FE6AB <CJK>
+8FE6AC 95A9 8FE6AC <CJK>
+8FE6AD 95AB 8FE6AD <CJK>
+8FE6AE 95AC 8FE6AE <CJK>
+8FE6AF 95B4 8FE6AF <CJK>
+8FE6B0 95B6 8FE6B0 <CJK>
+8FE6B1 95BA 8FE6B1 <CJK>
+8FE6B2 95BD 8FE6B2 <CJK>
+8FE6B3 95BF 8FE6B3 <CJK>
+8FE6B4 95C6 8FE6B4 <CJK>
+8FE6B5 95C8 8FE6B5 <CJK>
+8FE6B6 95C9 8FE6B6 <CJK>
+8FE6B7 95CB 8FE6B7 <CJK>
+8FE6B8 95D0 8FE6B8 <CJK>
+8FE6B9 95D1 8FE6B9 <CJK>
+8FE6BA 95D2 8FE6BA <CJK>
+8FE6BB 95D3 8FE6BB <CJK>
+8FE6BC 95D9 8FE6BC <CJK>
+8FE6BD 95DA 8FE6BD <CJK>
+8FE6BE 95DD 8FE6BE <CJK>
+8FE6BF 95DE 8FE6BF <CJK>
+8FE6C0 95DF 8FE6C0 <CJK>
+8FE6C1 95E0 8FE6C1 <CJK>
+8FE6C2 95E4 8FE6C2 <CJK>
+8FE6C3 95E6 8FE6C3 <CJK>
+8FE6C4 961D 8FE6C4 <CJK>
+8FE6C5 961E 8FE6C5 <CJK>
+8FE6C6 9622 8FE6C6 <CJK>
+8FE6C7 9624 8FE6C7 <CJK>
+8FE6C8 9625 8FE6C8 <CJK>
+8FE6C9 9626 8FE6C9 <CJK>
+8FE6CA 962C 8FE6CA <CJK>
+8FE6CB 9631 8FE6CB <CJK>
+8FE6CC 9633 8FE6CC <CJK>
+8FE6CD 9637 8FE6CD <CJK>
+8FE6CE 9638 8FE6CE <CJK>
+8FE6CF 9639 8FE6CF <CJK>
+8FE6D0 963A 8FE6D0 <CJK>
+8FE6D1 963C 8FE6D1 <CJK>
+8FE6D2 963D 8FE6D2 <CJK>
+8FE6D3 9641 8FE6D3 <CJK>
+8FE6D4 9652 8FE6D4 <CJK>
+8FE6D5 9654 8FE6D5 <CJK>
+8FE6D6 9656 8FE6D6 <CJK>
+8FE6D7 9657 8FE6D7 <CJK>
+8FE6D8 9658 8FE6D8 <CJK>
+8FE6D9 9661 8FE6D9 <CJK>
+8FE6DA 966E 8FE6DA <CJK>
+8FE6DB 9674 8FE6DB <CJK>
+8FE6DC 967B 8FE6DC <CJK>
+8FE6DD 967C 8FE6DD <CJK>
+8FE6DE 967E 8FE6DE <CJK>
+8FE6DF 967F 8FE6DF <CJK>
+8FE6E0 9681 8FE6E0 <CJK>
+8FE6E1 9682 8FE6E1 <CJK>
+8FE6E2 9683 8FE6E2 <CJK>
+8FE6E3 9684 8FE6E3 <CJK>
+8FE6E4 9689 8FE6E4 <CJK>
+8FE6E5 9691 8FE6E5 <CJK>
+8FE6E6 9696 8FE6E6 <CJK>
+8FE6E7 969A 8FE6E7 <CJK>
+8FE6E8 969D 8FE6E8 <CJK>
+8FE6E9 969F 8FE6E9 <CJK>
+8FE6EA 96A4 8FE6EA <CJK>
+8FE6EB 96A5 8FE6EB <CJK>
+8FE6EC 96A6 8FE6EC <CJK>
+8FE6ED 96A9 8FE6ED <CJK>
+8FE6EE 96AE 8FE6EE <CJK>
+8FE6EF 96AF 8FE6EF <CJK>
+8FE6F0 96B3 8FE6F0 <CJK>
+8FE6F1 96BA 8FE6F1 <CJK>
+8FE6F2 96CA 8FE6F2 <CJK>
+8FE6F3 96D2 8FE6F3 <CJK>
+8FE6F4 5DB2 8FE6F4 <CJK>
+8FE6F5 96D8 8FE6F5 <CJK>
+8FE6F6 96DA 8FE6F6 <CJK>
+8FE6F7 96DD 8FE6F7 <CJK>
+8FE6F8 96DE 8FE6F8 <CJK>
+8FE6F9 96DF 8FE6F9 <CJK>
+8FE6FA 96E9 8FE6FA <CJK>
+8FE6FB 96EF 8FE6FB <CJK>
+8FE6FC 96F1 8FE6FC <CJK>
+8FE6FD 96FA 8FE6FD <CJK>
+8FE6FE 9702 8FE6FE <CJK>
+8FE7A1 9703 8FE7A1 <CJK>
+8FE7A2 9705 8FE7A2 <CJK>
+8FE7A3 9709 8FE7A3 <CJK>
+8FE7A4 971A 8FE7A4 <CJK>
+8FE7A5 971B 8FE7A5 <CJK>
+8FE7A6 971D 8FE7A6 <CJK>
+8FE7A7 9721 8FE7A7 <CJK>
+8FE7A8 9722 8FE7A8 <CJK>
+8FE7A9 9723 8FE7A9 <CJK>
+8FE7AA 9728 8FE7AA <CJK>
+8FE7AB 9731 8FE7AB <CJK>
+8FE7AC 9733 8FE7AC <CJK>
+8FE7AD 9741 8FE7AD <CJK>
+8FE7AE 9743 8FE7AE <CJK>
+8FE7AF 974A 8FE7AF <CJK>
+8FE7B0 974E 8FE7B0 <CJK>
+8FE7B1 974F 8FE7B1 <CJK>
+8FE7B2 9755 8FE7B2 <CJK>
+8FE7B3 9757 8FE7B3 <CJK>
+8FE7B4 9758 8FE7B4 <CJK>
+8FE7B5 975A 8FE7B5 <CJK>
+8FE7B6 975B 8FE7B6 <CJK>
+8FE7B7 9763 8FE7B7 <CJK>
+8FE7B8 9767 8FE7B8 <CJK>
+8FE7B9 976A 8FE7B9 <CJK>
+8FE7BA 976E 8FE7BA <CJK>
+8FE7BB 9773 8FE7BB <CJK>
+8FE7BC 9776 8FE7BC <CJK>
+8FE7BD 9777 8FE7BD <CJK>
+8FE7BE 9778 8FE7BE <CJK>
+8FE7BF 977B 8FE7BF <CJK>
+8FE7C0 977D 8FE7C0 <CJK>
+8FE7C1 977F 8FE7C1 <CJK>
+8FE7C2 9780 8FE7C2 <CJK>
+8FE7C3 9789 8FE7C3 <CJK>
+8FE7C4 9795 8FE7C4 <CJK>
+8FE7C5 9796 8FE7C5 <CJK>
+8FE7C6 9797 8FE7C6 <CJK>
+8FE7C7 9799 8FE7C7 <CJK>
+8FE7C8 979A 8FE7C8 <CJK>
+8FE7C9 979E 8FE7C9 <CJK>
+8FE7CA 979F 8FE7CA <CJK>
+8FE7CB 97A2 8FE7CB <CJK>
+8FE7CC 97AC 8FE7CC <CJK>
+8FE7CD 97AE 8FE7CD <CJK>
+8FE7CE 97B1 8FE7CE <CJK>
+8FE7CF 97B2 8FE7CF <CJK>
+8FE7D0 97B5 8FE7D0 <CJK>
+8FE7D1 97B6 8FE7D1 <CJK>
+8FE7D2 97B8 8FE7D2 <CJK>
+8FE7D3 97B9 8FE7D3 <CJK>
+8FE7D4 97BA 8FE7D4 <CJK>
+8FE7D5 97BC 8FE7D5 <CJK>
+8FE7D6 97BE 8FE7D6 <CJK>
+8FE7D7 97BF 8FE7D7 <CJK>
+8FE7D8 97C1 8FE7D8 <CJK>
+8FE7D9 97C4 8FE7D9 <CJK>
+8FE7DA 97C5 8FE7DA <CJK>
+8FE7DB 97C7 8FE7DB <CJK>
+8FE7DC 97C9 8FE7DC <CJK>
+8FE7DD 97CA 8FE7DD <CJK>
+8FE7DE 97CC 8FE7DE <CJK>
+8FE7DF 97CD 8FE7DF <CJK>
+8FE7E0 97CE 8FE7E0 <CJK>
+8FE7E1 97D0 8FE7E1 <CJK>
+8FE7E2 97D1 8FE7E2 <CJK>
+8FE7E3 97D4 8FE7E3 <CJK>
+8FE7E4 97D7 8FE7E4 <CJK>
+8FE7E5 97D8 8FE7E5 <CJK>
+8FE7E6 97D9 8FE7E6 <CJK>
+8FE7E7 97DD 8FE7E7 <CJK>
+8FE7E8 97DE 8FE7E8 <CJK>
+8FE7E9 97E0 8FE7E9 <CJK>
+8FE7EA 97DB 8FE7EA <CJK>
+8FE7EB 97E1 8FE7EB <CJK>
+8FE7EC 97E4 8FE7EC <CJK>
+8FE7ED 97EF 8FE7ED <CJK>
+8FE7EE 97F1 8FE7EE <CJK>
+8FE7EF 97F4 8FE7EF <CJK>
+8FE7F0 97F7 8FE7F0 <CJK>
+8FE7F1 97F8 8FE7F1 <CJK>
+8FE7F2 97FA 8FE7F2 <CJK>
+8FE7F3 9807 8FE7F3 <CJK>
+8FE7F4 980A 8FE7F4 <CJK>
+8FE7F5 9819 8FE7F5 <CJK>
+8FE7F6 980D 8FE7F6 <CJK>
+8FE7F7 980E 8FE7F7 <CJK>
+8FE7F8 9814 8FE7F8 <CJK>
+8FE7F9 9816 8FE7F9 <CJK>
+8FE7FA 981C 8FE7FA <CJK>
+8FE7FB 981E 8FE7FB <CJK>
+8FE7FC 9820 8FE7FC <CJK>
+8FE7FD 9823 8FE7FD <CJK>
+8FE7FE 9826 8FE7FE <CJK>
+8FE8A1 982B 8FE8A1 <CJK>
+8FE8A2 982E 8FE8A2 <CJK>
+8FE8A3 982F 8FE8A3 <CJK>
+8FE8A4 9830 8FE8A4 <CJK>
+8FE8A5 9832 8FE8A5 <CJK>
+8FE8A6 9833 8FE8A6 <CJK>
+8FE8A7 9835 8FE8A7 <CJK>
+8FE8A8 9825 8FE8A8 <CJK>
+8FE8A9 983E 8FE8A9 <CJK>
+8FE8AA 9844 8FE8AA <CJK>
+8FE8AB 9847 8FE8AB <CJK>
+8FE8AC 984A 8FE8AC <CJK>
+8FE8AD 9851 8FE8AD <CJK>
+8FE8AE 9852 8FE8AE <CJK>
+8FE8AF 9853 8FE8AF <CJK>
+8FE8B0 9856 8FE8B0 <CJK>
+8FE8B1 9857 8FE8B1 <CJK>
+8FE8B2 9859 8FE8B2 <CJK>
+8FE8B3 985A 8FE8B3 <CJK>
+8FE8B4 9862 8FE8B4 <CJK>
+8FE8B5 9863 8FE8B5 <CJK>
+8FE8B6 9865 8FE8B6 <CJK>
+8FE8B7 9866 8FE8B7 <CJK>
+8FE8B8 986A 8FE8B8 <CJK>
+8FE8B9 986C 8FE8B9 <CJK>
+8FE8BA 98AB 8FE8BA <CJK>
+8FE8BB 98AD 8FE8BB <CJK>
+8FE8BC 98AE 8FE8BC <CJK>
+8FE8BD 98B0 8FE8BD <CJK>
+8FE8BE 98B4 8FE8BE <CJK>
+8FE8BF 98B7 8FE8BF <CJK>
+8FE8C0 98B8 8FE8C0 <CJK>
+8FE8C1 98BA 8FE8C1 <CJK>
+8FE8C2 98BB 8FE8C2 <CJK>
+8FE8C3 98BF 8FE8C3 <CJK>
+8FE8C4 98C2 8FE8C4 <CJK>
+8FE8C5 98C5 8FE8C5 <CJK>
+8FE8C6 98C8 8FE8C6 <CJK>
+8FE8C7 98CC 8FE8C7 <CJK>
+8FE8C8 98E1 8FE8C8 <CJK>
+8FE8C9 98E3 8FE8C9 <CJK>
+8FE8CA 98E5 8FE8CA <CJK>
+8FE8CB 98E6 8FE8CB <CJK>
+8FE8CC 98E7 8FE8CC <CJK>
+8FE8CD 98EA 8FE8CD <CJK>
+8FE8CE 98F3 8FE8CE <CJK>
+8FE8CF 98F6 8FE8CF <CJK>
+8FE8D0 9902 8FE8D0 <CJK>
+8FE8D1 9907 8FE8D1 <CJK>
+8FE8D2 9908 8FE8D2 <CJK>
+8FE8D3 9911 8FE8D3 <CJK>
+8FE8D4 9915 8FE8D4 <CJK>
+8FE8D5 9916 8FE8D5 <CJK>
+8FE8D6 9917 8FE8D6 <CJK>
+8FE8D7 991A 8FE8D7 <CJK>
+8FE8D8 991B 8FE8D8 <CJK>
+8FE8D9 991C 8FE8D9 <CJK>
+8FE8DA 991F 8FE8DA <CJK>
+8FE8DB 9922 8FE8DB <CJK>
+8FE8DC 9926 8FE8DC <CJK>
+8FE8DD 9927 8FE8DD <CJK>
+8FE8DE 992B 8FE8DE <CJK>
+8FE8DF 9931 8FE8DF <CJK>
+8FE8E0 9932 8FE8E0 <CJK>
+8FE8E1 9933 8FE8E1 <CJK>
+8FE8E2 9934 8FE8E2 <CJK>
+8FE8E3 9935 8FE8E3 <CJK>
+8FE8E4 9939 8FE8E4 <CJK>
+8FE8E5 993A 8FE8E5 <CJK>
+8FE8E6 993B 8FE8E6 <CJK>
+8FE8E7 993C 8FE8E7 <CJK>
+8FE8E8 9940 8FE8E8 <CJK>
+8FE8E9 9941 8FE8E9 <CJK>
+8FE8EA 9946 8FE8EA <CJK>
+8FE8EB 9947 8FE8EB <CJK>
+8FE8EC 9948 8FE8EC <CJK>
+8FE8ED 994D 8FE8ED <CJK>
+8FE8EE 994E 8FE8EE <CJK>
+8FE8EF 9954 8FE8EF <CJK>
+8FE8F0 9958 8FE8F0 <CJK>
+8FE8F1 9959 8FE8F1 <CJK>
+8FE8F2 995B 8FE8F2 <CJK>
+8FE8F3 995C 8FE8F3 <CJK>
+8FE8F4 995E 8FE8F4 <CJK>
+8FE8F5 995F 8FE8F5 <CJK>
+8FE8F6 9960 8FE8F6 <CJK>
+8FE8F7 999B 8FE8F7 <CJK>
+8FE8F8 999D 8FE8F8 <CJK>
+8FE8F9 999F 8FE8F9 <CJK>
+8FE8FA 99A6 8FE8FA <CJK>
+8FE8FB 99B0 8FE8FB <CJK>
+8FE8FC 99B1 8FE8FC <CJK>
+8FE8FD 99B2 8FE8FD <CJK>
+8FE8FE 99B5 8FE8FE <CJK>
+8FE9A1 99B9 8FE9A1 <CJK>
+8FE9A2 99BA 8FE9A2 <CJK>
+8FE9A3 99BD 8FE9A3 <CJK>
+8FE9A4 99BF 8FE9A4 <CJK>
+8FE9A5 99C3 8FE9A5 <CJK>
+8FE9A6 99C9 8FE9A6 <CJK>
+8FE9A7 99D3 8FE9A7 <CJK>
+8FE9A8 99D4 8FE9A8 <CJK>
+8FE9A9 99D9 8FE9A9 <CJK>
+8FE9AA 99DA 8FE9AA <CJK>
+8FE9AB 99DC 8FE9AB <CJK>
+8FE9AC 99DE 8FE9AC <CJK>
+8FE9AD 99E7 8FE9AD <CJK>
+8FE9AE 99EA 8FE9AE <CJK>
+8FE9AF 99EB 8FE9AF <CJK>
+8FE9B0 99EC 8FE9B0 <CJK>
+8FE9B1 99F0 8FE9B1 <CJK>
+8FE9B2 99F4 8FE9B2 <CJK>
+8FE9B3 99F5 8FE9B3 <CJK>
+8FE9B4 99F9 8FE9B4 <CJK>
+8FE9B5 99FD 8FE9B5 <CJK>
+8FE9B6 99FE 8FE9B6 <CJK>
+8FE9B7 9A02 8FE9B7 <CJK>
+8FE9B8 9A03 8FE9B8 <CJK>
+8FE9B9 9A04 8FE9B9 <CJK>
+8FE9BA 9A0B 8FE9BA <CJK>
+8FE9BB 9A0C 8FE9BB <CJK>
+8FE9BC 9A10 8FE9BC <CJK>
+8FE9BD 9A11 8FE9BD <CJK>
+8FE9BE 9A16 8FE9BE <CJK>
+8FE9BF 9A1E 8FE9BF <CJK>
+8FE9C0 9A20 8FE9C0 <CJK>
+8FE9C1 9A22 8FE9C1 <CJK>
+8FE9C2 9A23 8FE9C2 <CJK>
+8FE9C3 9A24 8FE9C3 <CJK>
+8FE9C4 9A27 8FE9C4 <CJK>
+8FE9C5 9A2D 8FE9C5 <CJK>
+8FE9C6 9A2E 8FE9C6 <CJK>
+8FE9C7 9A33 8FE9C7 <CJK>
+8FE9C8 9A35 8FE9C8 <CJK>
+8FE9C9 9A36 8FE9C9 <CJK>
+8FE9CA 9A38 8FE9CA <CJK>
+8FE9CB 9A47 8FE9CB <CJK>
+8FE9CC 9A41 8FE9CC <CJK>
+8FE9CD 9A44 8FE9CD <CJK>
+8FE9CE 9A4A 8FE9CE <CJK>
+8FE9CF 9A4B 8FE9CF <CJK>
+8FE9D0 9A4C 8FE9D0 <CJK>
+8FE9D1 9A4E 8FE9D1 <CJK>
+8FE9D2 9A51 8FE9D2 <CJK>
+8FE9D3 9A54 8FE9D3 <CJK>
+8FE9D4 9A56 8FE9D4 <CJK>
+8FE9D5 9A5D 8FE9D5 <CJK>
+8FE9D6 9AAA 8FE9D6 <CJK>
+8FE9D7 9AAC 8FE9D7 <CJK>
+8FE9D8 9AAE 8FE9D8 <CJK>
+8FE9D9 9AAF 8FE9D9 <CJK>
+8FE9DA 9AB2 8FE9DA <CJK>
+8FE9DB 9AB4 8FE9DB <CJK>
+8FE9DC 9AB5 8FE9DC <CJK>
+8FE9DD 9AB6 8FE9DD <CJK>
+8FE9DE 9AB9 8FE9DE <CJK>
+8FE9DF 9ABB 8FE9DF <CJK>
+8FE9E0 9ABE 8FE9E0 <CJK>
+8FE9E1 9ABF 8FE9E1 <CJK>
+8FE9E2 9AC1 8FE9E2 <CJK>
+8FE9E3 9AC3 8FE9E3 <CJK>
+8FE9E4 9AC6 8FE9E4 <CJK>
+8FE9E5 9AC8 8FE9E5 <CJK>
+8FE9E6 9ACE 8FE9E6 <CJK>
+8FE9E7 9AD0 8FE9E7 <CJK>
+8FE9E8 9AD2 8FE9E8 <CJK>
+8FE9E9 9AD5 8FE9E9 <CJK>
+8FE9EA 9AD6 8FE9EA <CJK>
+8FE9EB 9AD7 8FE9EB <CJK>
+8FE9EC 9ADB 8FE9EC <CJK>
+8FE9ED 9ADC 8FE9ED <CJK>
+8FE9EE 9AE0 8FE9EE <CJK>
+8FE9EF 9AE4 8FE9EF <CJK>
+8FE9F0 9AE5 8FE9F0 <CJK>
+8FE9F1 9AE7 8FE9F1 <CJK>
+8FE9F2 9AE9 8FE9F2 <CJK>
+8FE9F3 9AEC 8FE9F3 <CJK>
+8FE9F4 9AF2 8FE9F4 <CJK>
+8FE9F5 9AF3 8FE9F5 <CJK>
+8FE9F6 9AF5 8FE9F6 <CJK>
+8FE9F7 9AF9 8FE9F7 <CJK>
+8FE9F8 9AFA 8FE9F8 <CJK>
+8FE9F9 9AFD 8FE9F9 <CJK>
+8FE9FA 9AFF 8FE9FA <CJK>
+8FE9FB 9B00 8FE9FB <CJK>
+8FE9FC 9B01 8FE9FC <CJK>
+8FE9FD 9B02 8FE9FD <CJK>
+8FE9FE 9B03 8FE9FE <CJK>
+8FEAA1 9B04 8FEAA1 <CJK>
+8FEAA2 9B05 8FEAA2 <CJK>
+8FEAA3 9B08 8FEAA3 <CJK>
+8FEAA4 9B09 8FEAA4 <CJK>
+8FEAA5 9B0B 8FEAA5 <CJK>
+8FEAA6 9B0C 8FEAA6 <CJK>
+8FEAA7 9B0D 8FEAA7 <CJK>
+8FEAA8 9B0E 8FEAA8 <CJK>
+8FEAA9 9B10 8FEAA9 <CJK>
+8FEAAA 9B12 8FEAAA <CJK>
+8FEAAB 9B16 8FEAAB <CJK>
+8FEAAC 9B19 8FEAAC <CJK>
+8FEAAD 9B1B 8FEAAD <CJK>
+8FEAAE 9B1C 8FEAAE <CJK>
+8FEAAF 9B20 8FEAAF <CJK>
+8FEAB0 9B26 8FEAB0 <CJK>
+8FEAB1 9B2B 8FEAB1 <CJK>
+8FEAB2 9B2D 8FEAB2 <CJK>
+8FEAB3 9B33 8FEAB3 <CJK>
+8FEAB4 9B34 8FEAB4 <CJK>
+8FEAB5 9B35 8FEAB5 <CJK>
+8FEAB6 9B37 8FEAB6 <CJK>
+8FEAB7 9B39 8FEAB7 <CJK>
+8FEAB8 9B3A 8FEAB8 <CJK>
+8FEAB9 9B3D 8FEAB9 <CJK>
+8FEABA 9B48 8FEABA <CJK>
+8FEABB 9B4B 8FEABB <CJK>
+8FEABC 9B4C 8FEABC <CJK>
+8FEABD 9B55 8FEABD <CJK>
+8FEABE 9B56 8FEABE <CJK>
+8FEABF 9B57 8FEABF <CJK>
+8FEAC0 9B5B 8FEAC0 <CJK>
+8FEAC1 9B5E 8FEAC1 <CJK>
+8FEAC2 9B61 8FEAC2 <CJK>
+8FEAC3 9B63 8FEAC3 <CJK>
+8FEAC4 9B65 8FEAC4 <CJK>
+8FEAC5 9B66 8FEAC5 <CJK>
+8FEAC6 9B68 8FEAC6 <CJK>
+8FEAC7 9B6A 8FEAC7 <CJK>
+8FEAC8 9B6B 8FEAC8 <CJK>
+8FEAC9 9B6C 8FEAC9 <CJK>
+8FEACA 9B6D 8FEACA <CJK>
+8FEACB 9B6E 8FEACB <CJK>
+8FEACC 9B73 8FEACC <CJK>
+8FEACD 9B75 8FEACD <CJK>
+8FEACE 9B77 8FEACE <CJK>
+8FEACF 9B78 8FEACF <CJK>
+8FEAD0 9B79 8FEAD0 <CJK>
+8FEAD1 9B7F 8FEAD1 <CJK>
+8FEAD2 9B80 8FEAD2 <CJK>
+8FEAD3 9B84 8FEAD3 <CJK>
+8FEAD4 9B85 8FEAD4 <CJK>
+8FEAD5 9B86 8FEAD5 <CJK>
+8FEAD6 9B87 8FEAD6 <CJK>
+8FEAD7 9B89 8FEAD7 <CJK>
+8FEAD8 9B8A 8FEAD8 <CJK>
+8FEAD9 9B8B 8FEAD9 <CJK>
+8FEADA 9B8D 8FEADA <CJK>
+8FEADB 9B8F 8FEADB <CJK>
+8FEADC 9B90 8FEADC <CJK>
+8FEADD 9B94 8FEADD <CJK>
+8FEADE 9B9A 8FEADE <CJK>
+8FEADF 9B9D 8FEADF <CJK>
+8FEAE0 9B9E 8FEAE0 <CJK>
+8FEAE1 9BA6 8FEAE1 <CJK>
+8FEAE2 9BA7 8FEAE2 <CJK>
+8FEAE3 9BA9 8FEAE3 <CJK>
+8FEAE4 9BAC 8FEAE4 <CJK>
+8FEAE5 9BB0 8FEAE5 <CJK>
+8FEAE6 9BB1 8FEAE6 <CJK>
+8FEAE7 9BB2 8FEAE7 <CJK>
+8FEAE8 9BB7 8FEAE8 <CJK>
+8FEAE9 9BB8 8FEAE9 <CJK>
+8FEAEA 9BBB 8FEAEA <CJK>
+8FEAEB 9BBC 8FEAEB <CJK>
+8FEAEC 9BBE 8FEAEC <CJK>
+8FEAED 9BBF 8FEAED <CJK>
+8FEAEE 9BC1 8FEAEE <CJK>
+8FEAEF 9BC7 8FEAEF <CJK>
+8FEAF0 9BC8 8FEAF0 <CJK>
+8FEAF1 9BCE 8FEAF1 <CJK>
+8FEAF2 9BD0 8FEAF2 <CJK>
+8FEAF3 9BD7 8FEAF3 <CJK>
+8FEAF4 9BD8 8FEAF4 <CJK>
+8FEAF5 9BDD 8FEAF5 <CJK>
+8FEAF6 9BDF 8FEAF6 <CJK>
+8FEAF7 9BE5 8FEAF7 <CJK>
+8FEAF8 9BE7 8FEAF8 <CJK>
+8FEAF9 9BEA 8FEAF9 <CJK>
+8FEAFA 9BEB 8FEAFA <CJK>
+8FEAFB 9BEF 8FEAFB <CJK>
+8FEAFC 9BF3 8FEAFC <CJK>
+8FEAFD 9BF7 8FEAFD <CJK>
+8FEAFE 9BF8 8FEAFE <CJK>
+8FEBA1 9BF9 8FEBA1 <CJK>
+8FEBA2 9BFA 8FEBA2 <CJK>
+8FEBA3 9BFD 8FEBA3 <CJK>
+8FEBA4 9BFF 8FEBA4 <CJK>
+8FEBA5 9C00 8FEBA5 <CJK>
+8FEBA6 9C02 8FEBA6 <CJK>
+8FEBA7 9C0B 8FEBA7 <CJK>
+8FEBA8 9C0F 8FEBA8 <CJK>
+8FEBA9 9C11 8FEBA9 <CJK>
+8FEBAA 9C16 8FEBAA <CJK>
+8FEBAB 9C18 8FEBAB <CJK>
+8FEBAC 9C19 8FEBAC <CJK>
+8FEBAD 9C1A 8FEBAD <CJK>
+8FEBAE 9C1C 8FEBAE <CJK>
+8FEBAF 9C1E 8FEBAF <CJK>
+8FEBB0 9C22 8FEBB0 <CJK>
+8FEBB1 9C23 8FEBB1 <CJK>
+8FEBB2 9C26 8FEBB2 <CJK>
+8FEBB3 9C27 8FEBB3 <CJK>
+8FEBB4 9C28 8FEBB4 <CJK>
+8FEBB5 9C29 8FEBB5 <CJK>
+8FEBB6 9C2A 8FEBB6 <CJK>
+8FEBB7 9C31 8FEBB7 <CJK>
+8FEBB8 9C35 8FEBB8 <CJK>
+8FEBB9 9C36 8FEBB9 <CJK>
+8FEBBA 9C37 8FEBBA <CJK>
+8FEBBB 9C3D 8FEBBB <CJK>
+8FEBBC 9C41 8FEBBC <CJK>
+8FEBBD 9C43 8FEBBD <CJK>
+8FEBBE 9C44 8FEBBE <CJK>
+8FEBBF 9C45 8FEBBF <CJK>
+8FEBC0 9C49 8FEBC0 <CJK>
+8FEBC1 9C4A 8FEBC1 <CJK>
+8FEBC2 9C4E 8FEBC2 <CJK>
+8FEBC3 9C4F 8FEBC3 <CJK>
+8FEBC4 9C50 8FEBC4 <CJK>
+8FEBC5 9C53 8FEBC5 <CJK>
+8FEBC6 9C54 8FEBC6 <CJK>
+8FEBC7 9C56 8FEBC7 <CJK>
+8FEBC8 9C58 8FEBC8 <CJK>
+8FEBC9 9C5B 8FEBC9 <CJK>
+8FEBCA 9C5D 8FEBCA <CJK>
+8FEBCB 9C5E 8FEBCB <CJK>
+8FEBCC 9C5F 8FEBCC <CJK>
+8FEBCD 9C63 8FEBCD <CJK>
+8FEBCE 9C69 8FEBCE <CJK>
+8FEBCF 9C6A 8FEBCF <CJK>
+8FEBD0 9C5C 8FEBD0 <CJK>
+8FEBD1 9C6B 8FEBD1 <CJK>
+8FEBD2 9C68 8FEBD2 <CJK>
+8FEBD3 9C6E 8FEBD3 <CJK>
+8FEBD4 9C70 8FEBD4 <CJK>
+8FEBD5 9C72 8FEBD5 <CJK>
+8FEBD6 9C75 8FEBD6 <CJK>
+8FEBD7 9C77 8FEBD7 <CJK>
+8FEBD8 9C7B 8FEBD8 <CJK>
+8FEBD9 9CE6 8FEBD9 <CJK>
+8FEBDA 9CF2 8FEBDA <CJK>
+8FEBDB 9CF7 8FEBDB <CJK>
+8FEBDC 9CF9 8FEBDC <CJK>
+8FEBDD 9D0B 8FEBDD <CJK>
+8FEBDE 9D02 8FEBDE <CJK>
+8FEBDF 9D11 8FEBDF <CJK>
+8FEBE0 9D17 8FEBE0 <CJK>
+8FEBE1 9D18 8FEBE1 <CJK>
+8FEBE2 9D1C 8FEBE2 <CJK>
+8FEBE3 9D1D 8FEBE3 <CJK>
+8FEBE4 9D1E 8FEBE4 <CJK>
+8FEBE5 9D2F 8FEBE5 <CJK>
+8FEBE6 9D30 8FEBE6 <CJK>
+8FEBE7 9D32 8FEBE7 <CJK>
+8FEBE8 9D33 8FEBE8 <CJK>
+8FEBE9 9D34 8FEBE9 <CJK>
+8FEBEA 9D3A 8FEBEA <CJK>
+8FEBEB 9D3C 8FEBEB <CJK>
+8FEBEC 9D45 8FEBEC <CJK>
+8FEBED 9D3D 8FEBED <CJK>
+8FEBEE 9D42 8FEBEE <CJK>
+8FEBEF 9D43 8FEBEF <CJK>
+8FEBF0 9D47 8FEBF0 <CJK>
+8FEBF1 9D4A 8FEBF1 <CJK>
+8FEBF2 9D53 8FEBF2 <CJK>
+8FEBF3 9D54 8FEBF3 <CJK>
+8FEBF4 9D5F 8FEBF4 <CJK>
+8FEBF5 9D63 8FEBF5 <CJK>
+8FEBF6 9D62 8FEBF6 <CJK>
+8FEBF7 9D65 8FEBF7 <CJK>
+8FEBF8 9D69 8FEBF8 <CJK>
+8FEBF9 9D6A 8FEBF9 <CJK>
+8FEBFA 9D6B 8FEBFA <CJK>
+8FEBFB 9D70 8FEBFB <CJK>
+8FEBFC 9D76 8FEBFC <CJK>
+8FEBFD 9D77 8FEBFD <CJK>
+8FEBFE 9D7B 8FEBFE <CJK>
+8FECA1 9D7C 8FECA1 <CJK>
+8FECA2 9D7E 8FECA2 <CJK>
+8FECA3 9D83 8FECA3 <CJK>
+8FECA4 9D84 8FECA4 <CJK>
+8FECA5 9D86 8FECA5 <CJK>
+8FECA6 9D8A 8FECA6 <CJK>
+8FECA7 9D8D 8FECA7 <CJK>
+8FECA8 9D8E 8FECA8 <CJK>
+8FECA9 9D92 8FECA9 <CJK>
+8FECAA 9D93 8FECAA <CJK>
+8FECAB 9D95 8FECAB <CJK>
+8FECAC 9D96 8FECAC <CJK>
+8FECAD 9D97 8FECAD <CJK>
+8FECAE 9D98 8FECAE <CJK>
+8FECAF 9DA1 8FECAF <CJK>
+8FECB0 9DAA 8FECB0 <CJK>
+8FECB1 9DAC 8FECB1 <CJK>
+8FECB2 9DAE 8FECB2 <CJK>
+8FECB3 9DB1 8FECB3 <CJK>
+8FECB4 9DB5 8FECB4 <CJK>
+8FECB5 9DB9 8FECB5 <CJK>
+8FECB6 9DBC 8FECB6 <CJK>
+8FECB7 9DBF 8FECB7 <CJK>
+8FECB8 9DC3 8FECB8 <CJK>
+8FECB9 9DC7 8FECB9 <CJK>
+8FECBA 9DC9 8FECBA <CJK>
+8FECBB 9DCA 8FECBB <CJK>
+8FECBC 9DD4 8FECBC <CJK>
+8FECBD 9DD5 8FECBD <CJK>
+8FECBE 9DD6 8FECBE <CJK>
+8FECBF 9DD7 8FECBF <CJK>
+8FECC0 9DDA 8FECC0 <CJK>
+8FECC1 9DDE 8FECC1 <CJK>
+8FECC2 9DDF 8FECC2 <CJK>
+8FECC3 9DE0 8FECC3 <CJK>
+8FECC4 9DE5 8FECC4 <CJK>
+8FECC5 9DE7 8FECC5 <CJK>
+8FECC6 9DE9 8FECC6 <CJK>
+8FECC7 9DEB 8FECC7 <CJK>
+8FECC8 9DEE 8FECC8 <CJK>
+8FECC9 9DF0 8FECC9 <CJK>
+8FECCA 9DF3 8FECCA <CJK>
+8FECCB 9DF4 8FECCB <CJK>
+8FECCC 9DFE 8FECCC <CJK>
+8FECCD 9E0A 8FECCD <CJK>
+8FECCE 9E02 8FECCE <CJK>
+8FECCF 9E07 8FECCF <CJK>
+8FECD0 9E0E 8FECD0 <CJK>
+8FECD1 9E10 8FECD1 <CJK>
+8FECD2 9E11 8FECD2 <CJK>
+8FECD3 9E12 8FECD3 <CJK>
+8FECD4 9E15 8FECD4 <CJK>
+8FECD5 9E16 8FECD5 <CJK>
+8FECD6 9E19 8FECD6 <CJK>
+8FECD7 9E1C 8FECD7 <CJK>
+8FECD8 9E1D 8FECD8 <CJK>
+8FECD9 9E7A 8FECD9 <CJK>
+8FECDA 9E7B 8FECDA <CJK>
+8FECDB 9E7C 8FECDB <CJK>
+8FECDC 9E80 8FECDC <CJK>
+8FECDD 9E82 8FECDD <CJK>
+8FECDE 9E83 8FECDE <CJK>
+8FECDF 9E84 8FECDF <CJK>
+8FECE0 9E85 8FECE0 <CJK>
+8FECE1 9E87 8FECE1 <CJK>
+8FECE2 9E8E 8FECE2 <CJK>
+8FECE3 9E8F 8FECE3 <CJK>
+8FECE4 9E96 8FECE4 <CJK>
+8FECE5 9E98 8FECE5 <CJK>
+8FECE6 9E9B 8FECE6 <CJK>
+8FECE7 9E9E 8FECE7 <CJK>
+8FECE8 9EA4 8FECE8 <CJK>
+8FECE9 9EA8 8FECE9 <CJK>
+8FECEA 9EAC 8FECEA <CJK>
+8FECEB 9EAE 8FECEB <CJK>
+8FECEC 9EAF 8FECEC <CJK>
+8FECED 9EB0 8FECED <CJK>
+8FECEE 9EB3 8FECEE <CJK>
+8FECEF 9EB4 8FECEF <CJK>
+8FECF0 9EB5 8FECF0 <CJK>
+8FECF1 9EC6 8FECF1 <CJK>
+8FECF2 9EC8 8FECF2 <CJK>
+8FECF3 9ECB 8FECF3 <CJK>
+8FECF4 9ED5 8FECF4 <CJK>
+8FECF5 9EDF 8FECF5 <CJK>
+8FECF6 9EE4 8FECF6 <CJK>
+8FECF7 9EE7 8FECF7 <CJK>
+8FECF8 9EEC 8FECF8 <CJK>
+8FECF9 9EED 8FECF9 <CJK>
+8FECFA 9EEE 8FECFA <CJK>
+8FECFB 9EF0 8FECFB <CJK>
+8FECFC 9EF1 8FECFC <CJK>
+8FECFD 9EF2 8FECFD <CJK>
+8FECFE 9EF5 8FECFE <CJK>
+8FEDA1 9EF8 8FEDA1 U+9EF8 <CJK>
+8FEDA2 9EFF 8FEDA2 U+9EFF <CJK>
+8FEDA3 9F02 8FEDA3 U+9F02 <CJK>
+8FEDA4 9F03 8FEDA4 U+9F03 <CJK>
+8FEDA5 9F09 8FEDA5 U+9F09 <CJK>
+8FEDA6 9F0F 8FEDA6 U+9F0F <CJK>
+8FEDA7 9F10 8FEDA7 U+9F10 <CJK>
+8FEDA8 9F11 8FEDA8 U+9F11 <CJK>
+8FEDA9 9F12 8FEDA9 U+9F12 <CJK>
+8FEDAA 9F14 8FEDAA U+9F14 <CJK>
+8FEDAB 9F16 8FEDAB U+9F16 <CJK>
+8FEDAC 9F17 8FEDAC U+9F17 <CJK>
+8FEDAD 9F19 8FEDAD U+9F19 <CJK>
+8FEDAE 9F1A 8FEDAE U+9F1A <CJK>
+8FEDAF 9F1B 8FEDAF U+9F1B <CJK>
+8FEDB0 9F1F 8FEDB0 U+9F1F <CJK>
+8FEDB1 9F22 8FEDB1 U+9F22 <CJK>
+8FEDB2 9F26 8FEDB2 U+9F26 <CJK>
+8FEDB3 9F2A 8FEDB3 U+9F2A <CJK>
+8FEDB4 9F2B 8FEDB4 U+9F2B <CJK>
+8FEDB5 9F2F 8FEDB5 U+9F2F <CJK>
+8FEDB6 9F31 8FEDB6 U+9F31 <CJK>
+8FEDB7 9F32 8FEDB7 U+9F32 <CJK>
+8FEDB8 9F34 8FEDB8 U+9F34 <CJK>
+8FEDB9 9F37 8FEDB9 U+9F37 <CJK>
+8FEDBA 9F39 8FEDBA U+9F39 <CJK>
+8FEDBB 9F3A 8FEDBB U+9F3A <CJK>
+8FEDBC 9F3C 8FEDBC U+9F3C <CJK>
+8FEDBD 9F3D 8FEDBD U+9F3D <CJK>
+8FEDBE 9F3F 8FEDBE U+9F3F <CJK>
+8FEDBF 9F41 8FEDBF U+9F41 <CJK>
+8FEDC0 9F43 8FEDC0 U+9F43 <CJK>
+8FEDC1 9F44 8FEDC1 U+9F44 <CJK>
+8FEDC2 9F45 8FEDC2 U+9F45 <CJK>
+8FEDC3 9F46 8FEDC3 U+9F46 <CJK>
+8FEDC4 9F47 8FEDC4 U+9F47 <CJK>
+8FEDC5 9F53 8FEDC5 U+9F53 <CJK>
+8FEDC6 9F55 8FEDC6 U+9F55 <CJK>
+8FEDC7 9F56 8FEDC7 U+9F56 <CJK>
+8FEDC8 9F57 8FEDC8 U+9F57 <CJK>
+8FEDC9 9F58 8FEDC9 U+9F58 <CJK>
+8FEDCA 9F5A 8FEDCA U+9F5A <CJK>
+8FEDCB 9F5D 8FEDCB U+9F5D <CJK>
+8FEDCC 9F5E 8FEDCC U+9F5E <CJK>
+8FEDCD 9F68 8FEDCD U+9F68 <CJK>
+8FEDCE 9F69 8FEDCE U+9F69 <CJK>
+8FEDCF 9F6D 8FEDCF U+9F6D <CJK>
+8FEDD0 9F6E 8FEDD0 U+9F6E <CJK>
+8FEDD1 9F6F 8FEDD1 U+9F6F <CJK>
+8FEDD2 9F70 8FEDD2 U+9F70 <CJK>
+8FEDD3 9F71 8FEDD3 U+9F71 <CJK>
+8FEDD4 9F73 8FEDD4 U+9F73 <CJK>
+8FEDD5 9F75 8FEDD5 U+9F75 <CJK>
+8FEDD6 9F7A 8FEDD6 U+9F7A <CJK>
+8FEDD7 9F7D 8FEDD7 U+9F7D <CJK>
+8FEDD8 9F8F 8FEDD8 U+9F8F <CJK>
+8FEDD9 9F90 8FEDD9 U+9F90 <CJK>
+8FEDDA 9F91 8FEDDA U+9F91 <CJK>
+8FEDDB 9F92 8FEDDB U+9F92 <CJK>
+8FEDDC 9F94 8FEDDC U+9F94 <CJK>
+8FEDDD 9F96 8FEDDD U+9F96 <CJK>
+8FEDDE 9F97 8FEDDE U+9F97 <CJK>
+8FEDDF 9F9E 8FEDDF U+9F9E <CJK>
+8FEDE0 9FA1 8FEDE0 U+9FA1 <CJK>
+8FEDE1 9FA2 8FEDE1 U+9FA2 <CJK>
+8FEDE2 9FA3 8FEDE2 U+9FA3 <CJK>
+8FEDE3 9FA5 8FEDE3 U+9FA5 <CJK>
+8FF5A1 E3AC 8FF5A1 User defined range #2
+8FF5A2 E3AD 8FF5A2 User defined range #2
+8FF5A3 E3AE 8FF5A3 User defined range #2
+8FF5A4 E3AF 8FF5A4 User defined range #2
+8FF5A5 E3B0 8FF5A5 User defined range #2
+8FF5A6 E3B1 8FF5A6 User defined range #2
+8FF5A7 E3B2 8FF5A7 User defined range #2
+8FF5A8 E3B3 8FF5A8 User defined range #2
+8FF5A9 E3B4 8FF5A9 User defined range #2
+8FF5AA E3B5 8FF5AA User defined range #2
+8FF5AB E3B6 8FF5AB User defined range #2
+8FF5AC E3B7 8FF5AC User defined range #2
+8FF5AD E3B8 8FF5AD User defined range #2
+8FF5AE E3B9 8FF5AE User defined range #2
+8FF5AF E3BA 8FF5AF User defined range #2
+8FF5B0 E3BB 8FF5B0 User defined range #2
+8FF5B1 E3BC 8FF5B1 User defined range #2
+8FF5B2 E3BD 8FF5B2 User defined range #2
+8FF5B3 E3BE 8FF5B3 User defined range #2
+8FF5B4 E3BF 8FF5B4 User defined range #2
+8FF5B5 E3C0 8FF5B5 User defined range #2
+8FF5B6 E3C1 8FF5B6 User defined range #2
+8FF5B7 E3C2 8FF5B7 User defined range #2
+8FF5B8 E3C3 8FF5B8 User defined range #2
+8FF5B9 E3C4 8FF5B9 User defined range #2
+8FF5BA E3C5 8FF5BA User defined range #2
+8FF5BB E3C6 8FF5BB User defined range #2
+8FF5BC E3C7 8FF5BC User defined range #2
+8FF5BD E3C8 8FF5BD User defined range #2
+8FF5BE E3C9 8FF5BE User defined range #2
+8FF5BF E3CA 8FF5BF User defined range #2
+8FF5C0 E3CB 8FF5C0 User defined range #2
+8FF5C1 E3CC 8FF5C1 User defined range #2
+8FF5C2 E3CD 8FF5C2 User defined range #2
+8FF5C3 E3CE 8FF5C3 User defined range #2
+8FF5C4 E3CF 8FF5C4 User defined range #2
+8FF5C5 E3D0 8FF5C5 User defined range #2
+8FF5C6 E3D1 8FF5C6 User defined range #2
+8FF5C7 E3D2 8FF5C7 User defined range #2
+8FF5C8 E3D3 8FF5C8 User defined range #2
+8FF5C9 E3D4 8FF5C9 User defined range #2
+8FF5CA E3D5 8FF5CA User defined range #2
+8FF5CB E3D6 8FF5CB User defined range #2
+8FF5CC E3D7 8FF5CC User defined range #2
+8FF5CD E3D8 8FF5CD User defined range #2
+8FF5CE E3D9 8FF5CE User defined range #2
+8FF5CF E3DA 8FF5CF User defined range #2
+8FF5D0 E3DB 8FF5D0 User defined range #2
+8FF5D1 E3DC 8FF5D1 User defined range #2
+8FF5D2 E3DD 8FF5D2 User defined range #2
+8FF5D3 E3DE 8FF5D3 User defined range #2
+8FF5D4 E3DF 8FF5D4 User defined range #2
+8FF5D5 E3E0 8FF5D5 User defined range #2
+8FF5D6 E3E1 8FF5D6 User defined range #2
+8FF5D7 E3E2 8FF5D7 User defined range #2
+8FF5D8 E3E3 8FF5D8 User defined range #2
+8FF5D9 E3E4 8FF5D9 User defined range #2
+8FF5DA E3E5 8FF5DA User defined range #2
+8FF5DB E3E6 8FF5DB User defined range #2
+8FF5DC E3E7 8FF5DC User defined range #2
+8FF5DD E3E8 8FF5DD User defined range #2
+8FF5DE E3E9 8FF5DE User defined range #2
+8FF5DF E3EA 8FF5DF User defined range #2
+8FF5E0 E3EB 8FF5E0 User defined range #2
+8FF5E1 E3EC 8FF5E1 User defined range #2
+8FF5E2 E3ED 8FF5E2 User defined range #2
+8FF5E3 E3EE 8FF5E3 User defined range #2
+8FF5E4 E3EF 8FF5E4 User defined range #2
+8FF5E5 E3F0 8FF5E5 User defined range #2
+8FF5E6 E3F1 8FF5E6 User defined range #2
+8FF5E7 E3F2 8FF5E7 User defined range #2
+8FF5E8 E3F3 8FF5E8 User defined range #2
+8FF5E9 E3F4 8FF5E9 User defined range #2
+8FF5EA E3F5 8FF5EA User defined range #2
+8FF5EB E3F6 8FF5EB User defined range #2
+8FF5EC E3F7 8FF5EC User defined range #2
+8FF5ED E3F8 8FF5ED User defined range #2
+8FF5EE E3F9 8FF5EE User defined range #2
+8FF5EF E3FA 8FF5EF User defined range #2
+8FF5F0 E3FB 8FF5F0 User defined range #2
+8FF5F1 E3FC 8FF5F1 User defined range #2
+8FF5F2 E3FD 8FF5F2 User defined range #2
+8FF5F3 E3FE 8FF5F3 User defined range #2
+8FF5F4 E3FF 8FF5F4 User defined range #2
+8FF5F5 E400 8FF5F5 User defined range #2
+8FF5F6 E401 8FF5F6 User defined range #2
+8FF5F7 E402 8FF5F7 User defined range #2
+8FF5F8 E403 8FF5F8 User defined range #2
+8FF5F9 E404 8FF5F9 User defined range #2
+8FF5FA E405 8FF5FA User defined range #2
+8FF5FB E406 8FF5FB User defined range #2
+8FF5FC E407 8FF5FC User defined range #2
+8FF5FD E408 8FF5FD User defined range #2
+8FF5FE E409 8FF5FE User defined range #2
+8FF6A1 E40A 8FF6A1 User defined range #2
+8FF6A2 E40B 8FF6A2 User defined range #2
+8FF6A3 E40C 8FF6A3 User defined range #2
+8FF6A4 E40D 8FF6A4 User defined range #2
+8FF6A5 E40E 8FF6A5 User defined range #2
+8FF6A6 E40F 8FF6A6 User defined range #2
+8FF6A7 E410 8FF6A7 User defined range #2
+8FF6A8 E411 8FF6A8 User defined range #2
+8FF6A9 E412 8FF6A9 User defined range #2
+8FF6AA E413 8FF6AA User defined range #2
+8FF6AB E414 8FF6AB User defined range #2
+8FF6AC E415 8FF6AC User defined range #2
+8FF6AD E416 8FF6AD User defined range #2
+8FF6AE E417 8FF6AE User defined range #2
+8FF6AF E418 8FF6AF User defined range #2
+8FF6B0 E419 8FF6B0 User defined range #2
+8FF6B1 E41A 8FF6B1 User defined range #2
+8FF6B2 E41B 8FF6B2 User defined range #2
+8FF6B3 E41C 8FF6B3 User defined range #2
+8FF6B4 E41D 8FF6B4 User defined range #2
+8FF6B5 E41E 8FF6B5 User defined range #2
+8FF6B6 E41F 8FF6B6 User defined range #2
+8FF6B7 E420 8FF6B7 User defined range #2
+8FF6B8 E421 8FF6B8 User defined range #2
+8FF6B9 E422 8FF6B9 User defined range #2
+8FF6BA E423 8FF6BA User defined range #2
+8FF6BB E424 8FF6BB User defined range #2
+8FF6BC E425 8FF6BC User defined range #2
+8FF6BD E426 8FF6BD User defined range #2
+8FF6BE E427 8FF6BE User defined range #2
+8FF6BF E428 8FF6BF User defined range #2
+8FF6C0 E429 8FF6C0 User defined range #2
+8FF6C1 E42A 8FF6C1 User defined range #2
+8FF6C2 E42B 8FF6C2 User defined range #2
+8FF6C3 E42C 8FF6C3 User defined range #2
+8FF6C4 E42D 8FF6C4 User defined range #2
+8FF6C5 E42E 8FF6C5 User defined range #2
+8FF6C6 E42F 8FF6C6 User defined range #2
+8FF6C7 E430 8FF6C7 User defined range #2
+8FF6C8 E431 8FF6C8 User defined range #2
+8FF6C9 E432 8FF6C9 User defined range #2
+8FF6CA E433 8FF6CA User defined range #2
+8FF6CB E434 8FF6CB User defined range #2
+8FF6CC E435 8FF6CC User defined range #2
+8FF6CD E436 8FF6CD User defined range #2
+8FF6CE E437 8FF6CE User defined range #2
+8FF6CF E438 8FF6CF User defined range #2
+8FF6D0 E439 8FF6D0 User defined range #2
+8FF6D1 E43A 8FF6D1 User defined range #2
+8FF6D2 E43B 8FF6D2 User defined range #2
+8FF6D3 E43C 8FF6D3 User defined range #2
+8FF6D4 E43D 8FF6D4 User defined range #2
+8FF6D5 E43E 8FF6D5 User defined range #2
+8FF6D6 E43F 8FF6D6 User defined range #2
+8FF6D7 E440 8FF6D7 User defined range #2
+8FF6D8 E441 8FF6D8 User defined range #2
+8FF6D9 E442 8FF6D9 User defined range #2
+8FF6DA E443 8FF6DA User defined range #2
+8FF6DB E444 8FF6DB User defined range #2
+8FF6DC E445 8FF6DC User defined range #2
+8FF6DD E446 8FF6DD User defined range #2
+8FF6DE E447 8FF6DE User defined range #2
+8FF6DF E448 8FF6DF User defined range #2
+8FF6E0 E449 8FF6E0 User defined range #2
+8FF6E1 E44A 8FF6E1 User defined range #2
+8FF6E2 E44B 8FF6E2 User defined range #2
+8FF6E3 E44C 8FF6E3 User defined range #2
+8FF6E4 E44D 8FF6E4 User defined range #2
+8FF6E5 E44E 8FF6E5 User defined range #2
+8FF6E6 E44F 8FF6E6 User defined range #2
+8FF6E7 E450 8FF6E7 User defined range #2
+8FF6E8 E451 8FF6E8 User defined range #2
+8FF6E9 E452 8FF6E9 User defined range #2
+8FF6EA E453 8FF6EA User defined range #2
+8FF6EB E454 8FF6EB User defined range #2
+8FF6EC E455 8FF6EC User defined range #2
+8FF6ED E456 8FF6ED User defined range #2
+8FF6EE E457 8FF6EE User defined range #2
+8FF6EF E458 8FF6EF User defined range #2
+8FF6F0 E459 8FF6F0 User defined range #2
+8FF6F1 E45A 8FF6F1 User defined range #2
+8FF6F2 E45B 8FF6F2 User defined range #2
+8FF6F3 E45C 8FF6F3 User defined range #2
+8FF6F4 E45D 8FF6F4 User defined range #2
+8FF6F5 E45E 8FF6F5 User defined range #2
+8FF6F6 E45F 8FF6F6 User defined range #2
+8FF6F7 E460 8FF6F7 User defined range #2
+8FF6F8 E461 8FF6F8 User defined range #2
+8FF6F9 E462 8FF6F9 User defined range #2
+8FF6FA E463 8FF6FA User defined range #2
+8FF6FB E464 8FF6FB User defined range #2
+8FF6FC E465 8FF6FC User defined range #2
+8FF6FD E466 8FF6FD User defined range #2
+8FF6FE E467 8FF6FE User defined range #2
+8FF7A1 E468 8FF7A1 User defined range #2
+8FF7A2 E469 8FF7A2 User defined range #2
+8FF7A3 E46A 8FF7A3 User defined range #2
+8FF7A4 E46B 8FF7A4 User defined range #2
+8FF7A5 E46C 8FF7A5 User defined range #2
+8FF7A6 E46D 8FF7A6 User defined range #2
+8FF7A7 E46E 8FF7A7 User defined range #2
+8FF7A8 E46F 8FF7A8 User defined range #2
+8FF7A9 E470 8FF7A9 User defined range #2
+8FF7AA E471 8FF7AA User defined range #2
+8FF7AB E472 8FF7AB User defined range #2
+8FF7AC E473 8FF7AC User defined range #2
+8FF7AD E474 8FF7AD User defined range #2
+8FF7AE E475 8FF7AE User defined range #2
+8FF7AF E476 8FF7AF User defined range #2
+8FF7B0 E477 8FF7B0 User defined range #2
+8FF7B1 E478 8FF7B1 User defined range #2
+8FF7B2 E479 8FF7B2 User defined range #2
+8FF7B3 E47A 8FF7B3 User defined range #2
+8FF7B4 E47B 8FF7B4 User defined range #2
+8FF7B5 E47C 8FF7B5 User defined range #2
+8FF7B6 E47D 8FF7B6 User defined range #2
+8FF7B7 E47E 8FF7B7 User defined range #2
+8FF7B8 E47F 8FF7B8 User defined range #2
+8FF7B9 E480 8FF7B9 User defined range #2
+8FF7BA E481 8FF7BA User defined range #2
+8FF7BB E482 8FF7BB User defined range #2
+8FF7BC E483 8FF7BC User defined range #2
+8FF7BD E484 8FF7BD User defined range #2
+8FF7BE E485 8FF7BE User defined range #2
+8FF7BF E486 8FF7BF User defined range #2
+8FF7C0 E487 8FF7C0 User defined range #2
+8FF7C1 E488 8FF7C1 User defined range #2
+8FF7C2 E489 8FF7C2 User defined range #2
+8FF7C3 E48A 8FF7C3 User defined range #2
+8FF7C4 E48B 8FF7C4 User defined range #2
+8FF7C5 E48C 8FF7C5 User defined range #2
+8FF7C6 E48D 8FF7C6 User defined range #2
+8FF7C7 E48E 8FF7C7 User defined range #2
+8FF7C8 E48F 8FF7C8 User defined range #2
+8FF7C9 E490 8FF7C9 User defined range #2
+8FF7CA E491 8FF7CA User defined range #2
+8FF7CB E492 8FF7CB User defined range #2
+8FF7CC E493 8FF7CC User defined range #2
+8FF7CD E494 8FF7CD User defined range #2
+8FF7CE E495 8FF7CE User defined range #2
+8FF7CF E496 8FF7CF User defined range #2
+8FF7D0 E497 8FF7D0 User defined range #2
+8FF7D1 E498 8FF7D1 User defined range #2
+8FF7D2 E499 8FF7D2 User defined range #2
+8FF7D3 E49A 8FF7D3 User defined range #2
+8FF7D4 E49B 8FF7D4 User defined range #2
+8FF7D5 E49C 8FF7D5 User defined range #2
+8FF7D6 E49D 8FF7D6 User defined range #2
+8FF7D7 E49E 8FF7D7 User defined range #2
+8FF7D8 E49F 8FF7D8 User defined range #2
+8FF7D9 E4A0 8FF7D9 User defined range #2
+8FF7DA E4A1 8FF7DA User defined range #2
+8FF7DB E4A2 8FF7DB User defined range #2
+8FF7DC E4A3 8FF7DC User defined range #2
+8FF7DD E4A4 8FF7DD User defined range #2
+8FF7DE E4A5 8FF7DE User defined range #2
+8FF7DF E4A6 8FF7DF User defined range #2
+8FF7E0 E4A7 8FF7E0 User defined range #2
+8FF7E1 E4A8 8FF7E1 User defined range #2
+8FF7E2 E4A9 8FF7E2 User defined range #2
+8FF7E3 E4AA 8FF7E3 User defined range #2
+8FF7E4 E4AB 8FF7E4 User defined range #2
+8FF7E5 E4AC 8FF7E5 User defined range #2
+8FF7E6 E4AD 8FF7E6 User defined range #2
+8FF7E7 E4AE 8FF7E7 User defined range #2
+8FF7E8 E4AF 8FF7E8 User defined range #2
+8FF7E9 E4B0 8FF7E9 User defined range #2
+8FF7EA E4B1 8FF7EA User defined range #2
+8FF7EB E4B2 8FF7EB User defined range #2
+8FF7EC E4B3 8FF7EC User defined range #2
+8FF7ED E4B4 8FF7ED User defined range #2
+8FF7EE E4B5 8FF7EE User defined range #2
+8FF7EF E4B6 8FF7EF User defined range #2
+8FF7F0 E4B7 8FF7F0 User defined range #2
+8FF7F1 E4B8 8FF7F1 User defined range #2
+8FF7F2 E4B9 8FF7F2 User defined range #2
+8FF7F3 E4BA 8FF7F3 User defined range #2
+8FF7F4 E4BB 8FF7F4 User defined range #2
+8FF7F5 E4BC 8FF7F5 User defined range #2
+8FF7F6 E4BD 8FF7F6 User defined range #2
+8FF7F7 E4BE 8FF7F7 User defined range #2
+8FF7F8 E4BF 8FF7F8 User defined range #2
+8FF7F9 E4C0 8FF7F9 User defined range #2
+8FF7FA E4C1 8FF7FA User defined range #2
+8FF7FB E4C2 8FF7FB User defined range #2
+8FF7FC E4C3 8FF7FC User defined range #2
+8FF7FD E4C4 8FF7FD User defined range #2
+8FF7FE E4C5 8FF7FE User defined range #2
+8FF8A1 E4C6 8FF8A1 User defined range #2
+8FF8A2 E4C7 8FF8A2 User defined range #2
+8FF8A3 E4C8 8FF8A3 User defined range #2
+8FF8A4 E4C9 8FF8A4 User defined range #2
+8FF8A5 E4CA 8FF8A5 User defined range #2
+8FF8A6 E4CB 8FF8A6 User defined range #2
+8FF8A7 E4CC 8FF8A7 User defined range #2
+8FF8A8 E4CD 8FF8A8 User defined range #2
+8FF8A9 E4CE 8FF8A9 User defined range #2
+8FF8AA E4CF 8FF8AA User defined range #2
+8FF8AB E4D0 8FF8AB User defined range #2
+8FF8AC E4D1 8FF8AC User defined range #2
+8FF8AD E4D2 8FF8AD User defined range #2
+8FF8AE E4D3 8FF8AE User defined range #2
+8FF8AF E4D4 8FF8AF User defined range #2
+8FF8B0 E4D5 8FF8B0 User defined range #2
+8FF8B1 E4D6 8FF8B1 User defined range #2
+8FF8B2 E4D7 8FF8B2 User defined range #2
+8FF8B3 E4D8 8FF8B3 User defined range #2
+8FF8B4 E4D9 8FF8B4 User defined range #2
+8FF8B5 E4DA 8FF8B5 User defined range #2
+8FF8B6 E4DB 8FF8B6 User defined range #2
+8FF8B7 E4DC 8FF8B7 User defined range #2
+8FF8B8 E4DD 8FF8B8 User defined range #2
+8FF8B9 E4DE 8FF8B9 User defined range #2
+8FF8BA E4DF 8FF8BA User defined range #2
+8FF8BB E4E0 8FF8BB User defined range #2
+8FF8BC E4E1 8FF8BC User defined range #2
+8FF8BD E4E2 8FF8BD User defined range #2
+8FF8BE E4E3 8FF8BE User defined range #2
+8FF8BF E4E4 8FF8BF User defined range #2
+8FF8C0 E4E5 8FF8C0 User defined range #2
+8FF8C1 E4E6 8FF8C1 User defined range #2
+8FF8C2 E4E7 8FF8C2 User defined range #2
+8FF8C3 E4E8 8FF8C3 User defined range #2
+8FF8C4 E4E9 8FF8C4 User defined range #2
+8FF8C5 E4EA 8FF8C5 User defined range #2
+8FF8C6 E4EB 8FF8C6 User defined range #2
+8FF8C7 E4EC 8FF8C7 User defined range #2
+8FF8C8 E4ED 8FF8C8 User defined range #2
+8FF8C9 E4EE 8FF8C9 User defined range #2
+8FF8CA E4EF 8FF8CA User defined range #2
+8FF8CB E4F0 8FF8CB User defined range #2
+8FF8CC E4F1 8FF8CC User defined range #2
+8FF8CD E4F2 8FF8CD User defined range #2
+8FF8CE E4F3 8FF8CE User defined range #2
+8FF8CF E4F4 8FF8CF User defined range #2
+8FF8D0 E4F5 8FF8D0 User defined range #2
+8FF8D1 E4F6 8FF8D1 User defined range #2
+8FF8D2 E4F7 8FF8D2 User defined range #2
+8FF8D3 E4F8 8FF8D3 User defined range #2
+8FF8D4 E4F9 8FF8D4 User defined range #2
+8FF8D5 E4FA 8FF8D5 User defined range #2
+8FF8D6 E4FB 8FF8D6 User defined range #2
+8FF8D7 E4FC 8FF8D7 User defined range #2
+8FF8D8 E4FD 8FF8D8 User defined range #2
+8FF8D9 E4FE 8FF8D9 User defined range #2
+8FF8DA E4FF 8FF8DA User defined range #2
+8FF8DB E500 8FF8DB User defined range #2
+8FF8DC E501 8FF8DC User defined range #2
+8FF8DD E502 8FF8DD User defined range #2
+8FF8DE E503 8FF8DE User defined range #2
+8FF8DF E504 8FF8DF User defined range #2
+8FF8E0 E505 8FF8E0 User defined range #2
+8FF8E1 E506 8FF8E1 User defined range #2
+8FF8E2 E507 8FF8E2 User defined range #2
+8FF8E3 E508 8FF8E3 User defined range #2
+8FF8E4 E509 8FF8E4 User defined range #2
+8FF8E5 E50A 8FF8E5 User defined range #2
+8FF8E6 E50B 8FF8E6 User defined range #2
+8FF8E7 E50C 8FF8E7 User defined range #2
+8FF8E8 E50D 8FF8E8 User defined range #2
+8FF8E9 E50E 8FF8E9 User defined range #2
+8FF8EA E50F 8FF8EA User defined range #2
+8FF8EB E510 8FF8EB User defined range #2
+8FF8EC E511 8FF8EC User defined range #2
+8FF8ED E512 8FF8ED User defined range #2
+8FF8EE E513 8FF8EE User defined range #2
+8FF8EF E514 8FF8EF User defined range #2
+8FF8F0 E515 8FF8F0 User defined range #2
+8FF8F1 E516 8FF8F1 User defined range #2
+8FF8F2 E517 8FF8F2 User defined range #2
+8FF8F3 E518 8FF8F3 User defined range #2
+8FF8F4 E519 8FF8F4 User defined range #2
+8FF8F5 E51A 8FF8F5 User defined range #2
+8FF8F6 E51B 8FF8F6 User defined range #2
+8FF8F7 E51C 8FF8F7 User defined range #2
+8FF8F8 E51D 8FF8F8 User defined range #2
+8FF8F9 E51E 8FF8F9 User defined range #2
+8FF8FA E51F 8FF8FA User defined range #2
+8FF8FB E520 8FF8FB User defined range #2
+8FF8FC E521 8FF8FC User defined range #2
+8FF8FD E522 8FF8FD User defined range #2
+8FF8FE E523 8FF8FE User defined range #2
+8FF9A1 E524 8FF9A1 User defined range #2
+8FF9A2 E525 8FF9A2 User defined range #2
+8FF9A3 E526 8FF9A3 User defined range #2
+8FF9A4 E527 8FF9A4 User defined range #2
+8FF9A5 E528 8FF9A5 User defined range #2
+8FF9A6 E529 8FF9A6 User defined range #2
+8FF9A7 E52A 8FF9A7 User defined range #2
+8FF9A8 E52B 8FF9A8 User defined range #2
+8FF9A9 E52C 8FF9A9 User defined range #2
+8FF9AA E52D 8FF9AA User defined range #2
+8FF9AB E52E 8FF9AB User defined range #2
+8FF9AC E52F 8FF9AC User defined range #2
+8FF9AD E530 8FF9AD User defined range #2
+8FF9AE E531 8FF9AE User defined range #2
+8FF9AF E532 8FF9AF User defined range #2
+8FF9B0 E533 8FF9B0 User defined range #2
+8FF9B1 E534 8FF9B1 User defined range #2
+8FF9B2 E535 8FF9B2 User defined range #2
+8FF9B3 E536 8FF9B3 User defined range #2
+8FF9B4 E537 8FF9B4 User defined range #2
+8FF9B5 E538 8FF9B5 User defined range #2
+8FF9B6 E539 8FF9B6 User defined range #2
+8FF9B7 E53A 8FF9B7 User defined range #2
+8FF9B8 E53B 8FF9B8 User defined range #2
+8FF9B9 E53C 8FF9B9 User defined range #2
+8FF9BA E53D 8FF9BA User defined range #2
+8FF9BB E53E 8FF9BB User defined range #2
+8FF9BC E53F 8FF9BC User defined range #2
+8FF9BD E540 8FF9BD User defined range #2
+8FF9BE E541 8FF9BE User defined range #2
+8FF9BF E542 8FF9BF User defined range #2
+8FF9C0 E543 8FF9C0 User defined range #2
+8FF9C1 E544 8FF9C1 User defined range #2
+8FF9C2 E545 8FF9C2 User defined range #2
+8FF9C3 E546 8FF9C3 User defined range #2
+8FF9C4 E547 8FF9C4 User defined range #2
+8FF9C5 E548 8FF9C5 User defined range #2
+8FF9C6 E549 8FF9C6 User defined range #2
+8FF9C7 E54A 8FF9C7 User defined range #2
+8FF9C8 E54B 8FF9C8 User defined range #2
+8FF9C9 E54C 8FF9C9 User defined range #2
+8FF9CA E54D 8FF9CA User defined range #2
+8FF9CB E54E 8FF9CB User defined range #2
+8FF9CC E54F 8FF9CC User defined range #2
+8FF9CD E550 8FF9CD User defined range #2
+8FF9CE E551 8FF9CE User defined range #2
+8FF9CF E552 8FF9CF User defined range #2
+8FF9D0 E553 8FF9D0 User defined range #2
+8FF9D1 E554 8FF9D1 User defined range #2
+8FF9D2 E555 8FF9D2 User defined range #2
+8FF9D3 E556 8FF9D3 User defined range #2
+8FF9D4 E557 8FF9D4 User defined range #2
+8FF9D5 E558 8FF9D5 User defined range #2
+8FF9D6 E559 8FF9D6 User defined range #2
+8FF9D7 E55A 8FF9D7 User defined range #2
+8FF9D8 E55B 8FF9D8 User defined range #2
+8FF9D9 E55C 8FF9D9 User defined range #2
+8FF9DA E55D 8FF9DA User defined range #2
+8FF9DB E55E 8FF9DB User defined range #2
+8FF9DC E55F 8FF9DC User defined range #2
+8FF9DD E560 8FF9DD User defined range #2
+8FF9DE E561 8FF9DE User defined range #2
+8FF9DF E562 8FF9DF User defined range #2
+8FF9E0 E563 8FF9E0 User defined range #2
+8FF9E1 E564 8FF9E1 User defined range #2
+8FF9E2 E565 8FF9E2 User defined range #2
+8FF9E3 E566 8FF9E3 User defined range #2
+8FF9E4 E567 8FF9E4 User defined range #2
+8FF9E5 E568 8FF9E5 User defined range #2
+8FF9E6 E569 8FF9E6 User defined range #2
+8FF9E7 E56A 8FF9E7 User defined range #2
+8FF9E8 E56B 8FF9E8 User defined range #2
+8FF9E9 E56C 8FF9E9 User defined range #2
+8FF9EA E56D 8FF9EA User defined range #2
+8FF9EB E56E 8FF9EB User defined range #2
+8FF9EC E56F 8FF9EC User defined range #2
+8FF9ED E570 8FF9ED User defined range #2
+8FF9EE E571 8FF9EE User defined range #2
+8FF9EF E572 8FF9EF User defined range #2
+8FF9F0 E573 8FF9F0 User defined range #2
+8FF9F1 E574 8FF9F1 User defined range #2
+8FF9F2 E575 8FF9F2 User defined range #2
+8FF9F3 E576 8FF9F3 User defined range #2
+8FF9F4 E577 8FF9F4 User defined range #2
+8FF9F5 E578 8FF9F5 User defined range #2
+8FF9F6 E579 8FF9F6 User defined range #2
+8FF9F7 E57A 8FF9F7 User defined range #2
+8FF9F8 E57B 8FF9F8 User defined range #2
+8FF9F9 E57C 8FF9F9 User defined range #2
+8FF9FA E57D 8FF9FA User defined range #2
+8FF9FB E57E 8FF9FB User defined range #2
+8FF9FC E57F 8FF9FC User defined range #2
+8FF9FD E580 8FF9FD User defined range #2
+8FF9FE E581 8FF9FE User defined range #2
+8FFAA1 E582 8FFAA1 User defined range #2
+8FFAA2 E583 8FFAA2 User defined range #2
+8FFAA3 E584 8FFAA3 User defined range #2
+8FFAA4 E585 8FFAA4 User defined range #2
+8FFAA5 E586 8FFAA5 User defined range #2
+8FFAA6 E587 8FFAA6 User defined range #2
+8FFAA7 E588 8FFAA7 User defined range #2
+8FFAA8 E589 8FFAA8 User defined range #2
+8FFAA9 E58A 8FFAA9 User defined range #2
+8FFAAA E58B 8FFAAA User defined range #2
+8FFAAB E58C 8FFAAB User defined range #2
+8FFAAC E58D 8FFAAC User defined range #2
+8FFAAD E58E 8FFAAD User defined range #2
+8FFAAE E58F 8FFAAE User defined range #2
+8FFAAF E590 8FFAAF User defined range #2
+8FFAB0 E591 8FFAB0 User defined range #2
+8FFAB1 E592 8FFAB1 User defined range #2
+8FFAB2 E593 8FFAB2 User defined range #2
+8FFAB3 E594 8FFAB3 User defined range #2
+8FFAB4 E595 8FFAB4 User defined range #2
+8FFAB5 E596 8FFAB5 User defined range #2
+8FFAB6 E597 8FFAB6 User defined range #2
+8FFAB7 E598 8FFAB7 User defined range #2
+8FFAB8 E599 8FFAB8 User defined range #2
+8FFAB9 E59A 8FFAB9 User defined range #2
+8FFABA E59B 8FFABA User defined range #2
+8FFABB E59C 8FFABB User defined range #2
+8FFABC E59D 8FFABC User defined range #2
+8FFABD E59E 8FFABD User defined range #2
+8FFABE E59F 8FFABE User defined range #2
+8FFABF E5A0 8FFABF User defined range #2
+8FFAC0 E5A1 8FFAC0 User defined range #2
+8FFAC1 E5A2 8FFAC1 User defined range #2
+8FFAC2 E5A3 8FFAC2 User defined range #2
+8FFAC3 E5A4 8FFAC3 User defined range #2
+8FFAC4 E5A5 8FFAC4 User defined range #2
+8FFAC5 E5A6 8FFAC5 User defined range #2
+8FFAC6 E5A7 8FFAC6 User defined range #2
+8FFAC7 E5A8 8FFAC7 User defined range #2
+8FFAC8 E5A9 8FFAC8 User defined range #2
+8FFAC9 E5AA 8FFAC9 User defined range #2
+8FFACA E5AB 8FFACA User defined range #2
+8FFACB E5AC 8FFACB User defined range #2
+8FFACC E5AD 8FFACC User defined range #2
+8FFACD E5AE 8FFACD User defined range #2
+8FFACE E5AF 8FFACE User defined range #2
+8FFACF E5B0 8FFACF User defined range #2
+8FFAD0 E5B1 8FFAD0 User defined range #2
+8FFAD1 E5B2 8FFAD1 User defined range #2
+8FFAD2 E5B3 8FFAD2 User defined range #2
+8FFAD3 E5B4 8FFAD3 User defined range #2
+8FFAD4 E5B5 8FFAD4 User defined range #2
+8FFAD5 E5B6 8FFAD5 User defined range #2
+8FFAD6 E5B7 8FFAD6 User defined range #2
+8FFAD7 E5B8 8FFAD7 User defined range #2
+8FFAD8 E5B9 8FFAD8 User defined range #2
+8FFAD9 E5BA 8FFAD9 User defined range #2
+8FFADA E5BB 8FFADA User defined range #2
+8FFADB E5BC 8FFADB User defined range #2
+8FFADC E5BD 8FFADC User defined range #2
+8FFADD E5BE 8FFADD User defined range #2
+8FFADE E5BF 8FFADE User defined range #2
+8FFADF E5C0 8FFADF User defined range #2
+8FFAE0 E5C1 8FFAE0 User defined range #2
+8FFAE1 E5C2 8FFAE1 User defined range #2
+8FFAE2 E5C3 8FFAE2 User defined range #2
+8FFAE3 E5C4 8FFAE3 User defined range #2
+8FFAE4 E5C5 8FFAE4 User defined range #2
+8FFAE5 E5C6 8FFAE5 User defined range #2
+8FFAE6 E5C7 8FFAE6 User defined range #2
+8FFAE7 E5C8 8FFAE7 User defined range #2
+8FFAE8 E5C9 8FFAE8 User defined range #2
+8FFAE9 E5CA 8FFAE9 User defined range #2
+8FFAEA E5CB 8FFAEA User defined range #2
+8FFAEB E5CC 8FFAEB User defined range #2
+8FFAEC E5CD 8FFAEC User defined range #2
+8FFAED E5CE 8FFAED User defined range #2
+8FFAEE E5CF 8FFAEE User defined range #2
+8FFAEF E5D0 8FFAEF User defined range #2
+8FFAF0 E5D1 8FFAF0 User defined range #2
+8FFAF1 E5D2 8FFAF1 User defined range #2
+8FFAF2 E5D3 8FFAF2 User defined range #2
+8FFAF3 E5D4 8FFAF3 User defined range #2
+8FFAF4 E5D5 8FFAF4 User defined range #2
+8FFAF5 E5D6 8FFAF5 User defined range #2
+8FFAF6 E5D7 8FFAF6 User defined range #2
+8FFAF7 E5D8 8FFAF7 User defined range #2
+8FFAF8 E5D9 8FFAF8 User defined range #2
+8FFAF9 E5DA 8FFAF9 User defined range #2
+8FFAFA E5DB 8FFAFA User defined range #2
+8FFAFB E5DC 8FFAFB User defined range #2
+8FFAFC E5DD 8FFAFC User defined range #2
+8FFAFD E5DE 8FFAFD User defined range #2
+8FFAFE E5DF 8FFAFE User defined range #2
+8FFBA1 E5E0 8FFBA1 User defined range #2
+8FFBA2 E5E1 8FFBA2 User defined range #2
+8FFBA3 E5E2 8FFBA3 User defined range #2
+8FFBA4 E5E3 8FFBA4 User defined range #2
+8FFBA5 E5E4 8FFBA5 User defined range #2
+8FFBA6 E5E5 8FFBA6 User defined range #2
+8FFBA7 E5E6 8FFBA7 User defined range #2
+8FFBA8 E5E7 8FFBA8 User defined range #2
+8FFBA9 E5E8 8FFBA9 User defined range #2
+8FFBAA E5E9 8FFBAA User defined range #2
+8FFBAB E5EA 8FFBAB User defined range #2
+8FFBAC E5EB 8FFBAC User defined range #2
+8FFBAD E5EC 8FFBAD User defined range #2
+8FFBAE E5ED 8FFBAE User defined range #2
+8FFBAF E5EE 8FFBAF User defined range #2
+8FFBB0 E5EF 8FFBB0 User defined range #2
+8FFBB1 E5F0 8FFBB1 User defined range #2
+8FFBB2 E5F1 8FFBB2 User defined range #2
+8FFBB3 E5F2 8FFBB3 User defined range #2
+8FFBB4 E5F3 8FFBB4 User defined range #2
+8FFBB5 E5F4 8FFBB5 User defined range #2
+8FFBB6 E5F5 8FFBB6 User defined range #2
+8FFBB7 E5F6 8FFBB7 User defined range #2
+8FFBB8 E5F7 8FFBB8 User defined range #2
+8FFBB9 E5F8 8FFBB9 User defined range #2
+8FFBBA E5F9 8FFBBA User defined range #2
+8FFBBB E5FA 8FFBBB User defined range #2
+8FFBBC E5FB 8FFBBC User defined range #2
+8FFBBD E5FC 8FFBBD User defined range #2
+8FFBBE E5FD 8FFBBE User defined range #2
+8FFBBF E5FE 8FFBBF User defined range #2
+8FFBC0 E5FF 8FFBC0 User defined range #2
+8FFBC1 E600 8FFBC1 User defined range #2
+8FFBC2 E601 8FFBC2 User defined range #2
+8FFBC3 E602 8FFBC3 User defined range #2
+8FFBC4 E603 8FFBC4 User defined range #2
+8FFBC5 E604 8FFBC5 User defined range #2
+8FFBC6 E605 8FFBC6 User defined range #2
+8FFBC7 E606 8FFBC7 User defined range #2
+8FFBC8 E607 8FFBC8 User defined range #2
+8FFBC9 E608 8FFBC9 User defined range #2
+8FFBCA E609 8FFBCA User defined range #2
+8FFBCB E60A 8FFBCB User defined range #2
+8FFBCC E60B 8FFBCC User defined range #2
+8FFBCD E60C 8FFBCD User defined range #2
+8FFBCE E60D 8FFBCE User defined range #2
+8FFBCF E60E 8FFBCF User defined range #2
+8FFBD0 E60F 8FFBD0 User defined range #2
+8FFBD1 E610 8FFBD1 User defined range #2
+8FFBD2 E611 8FFBD2 User defined range #2
+8FFBD3 E612 8FFBD3 User defined range #2
+8FFBD4 E613 8FFBD4 User defined range #2
+8FFBD5 E614 8FFBD5 User defined range #2
+8FFBD6 E615 8FFBD6 User defined range #2
+8FFBD7 E616 8FFBD7 User defined range #2
+8FFBD8 E617 8FFBD8 User defined range #2
+8FFBD9 E618 8FFBD9 User defined range #2
+8FFBDA E619 8FFBDA User defined range #2
+8FFBDB E61A 8FFBDB User defined range #2
+8FFBDC E61B 8FFBDC User defined range #2
+8FFBDD E61C 8FFBDD User defined range #2
+8FFBDE E61D 8FFBDE User defined range #2
+8FFBDF E61E 8FFBDF User defined range #2
+8FFBE0 E61F 8FFBE0 User defined range #2
+8FFBE1 E620 8FFBE1 User defined range #2
+8FFBE2 E621 8FFBE2 User defined range #2
+8FFBE3 E622 8FFBE3 User defined range #2
+8FFBE4 E623 8FFBE4 User defined range #2
+8FFBE5 E624 8FFBE5 User defined range #2
+8FFBE6 E625 8FFBE6 User defined range #2
+8FFBE7 E626 8FFBE7 User defined range #2
+8FFBE8 E627 8FFBE8 User defined range #2
+8FFBE9 E628 8FFBE9 User defined range #2
+8FFBEA E629 8FFBEA User defined range #2
+8FFBEB E62A 8FFBEB User defined range #2
+8FFBEC E62B 8FFBEC User defined range #2
+8FFBED E62C 8FFBED User defined range #2
+8FFBEE E62D 8FFBEE User defined range #2
+8FFBEF E62E 8FFBEF User defined range #2
+8FFBF0 E62F 8FFBF0 User defined range #2
+8FFBF1 E630 8FFBF1 User defined range #2
+8FFBF2 E631 8FFBF2 User defined range #2
+8FFBF3 E632 8FFBF3 User defined range #2
+8FFBF4 E633 8FFBF4 User defined range #2
+8FFBF5 E634 8FFBF5 User defined range #2
+8FFBF6 E635 8FFBF6 User defined range #2
+8FFBF7 E636 8FFBF7 User defined range #2
+8FFBF8 E637 8FFBF8 User defined range #2
+8FFBF9 E638 8FFBF9 User defined range #2
+8FFBFA E639 8FFBFA User defined range #2
+8FFBFB E63A 8FFBFB User defined range #2
+8FFBFC E63B 8FFBFC User defined range #2
+8FFBFD E63C 8FFBFD User defined range #2
+8FFBFE E63D 8FFBFE User defined range #2
+8FFCA1 E63E 8FFCA1 User defined range #2
+8FFCA2 E63F 8FFCA2 User defined range #2
+8FFCA3 E640 8FFCA3 User defined range #2
+8FFCA4 E641 8FFCA4 User defined range #2
+8FFCA5 E642 8FFCA5 User defined range #2
+8FFCA6 E643 8FFCA6 User defined range #2
+8FFCA7 E644 8FFCA7 User defined range #2
+8FFCA8 E645 8FFCA8 User defined range #2
+8FFCA9 E646 8FFCA9 User defined range #2
+8FFCAA E647 8FFCAA User defined range #2
+8FFCAB E648 8FFCAB User defined range #2
+8FFCAC E649 8FFCAC User defined range #2
+8FFCAD E64A 8FFCAD User defined range #2
+8FFCAE E64B 8FFCAE User defined range #2
+8FFCAF E64C 8FFCAF User defined range #2
+8FFCB0 E64D 8FFCB0 User defined range #2
+8FFCB1 E64E 8FFCB1 User defined range #2
+8FFCB2 E64F 8FFCB2 User defined range #2
+8FFCB3 E650 8FFCB3 User defined range #2
+8FFCB4 E651 8FFCB4 User defined range #2
+8FFCB5 E652 8FFCB5 User defined range #2
+8FFCB6 E653 8FFCB6 User defined range #2
+8FFCB7 E654 8FFCB7 User defined range #2
+8FFCB8 E655 8FFCB8 User defined range #2
+8FFCB9 E656 8FFCB9 User defined range #2
+8FFCBA E657 8FFCBA User defined range #2
+8FFCBB E658 8FFCBB User defined range #2
+8FFCBC E659 8FFCBC User defined range #2
+8FFCBD E65A 8FFCBD User defined range #2
+8FFCBE E65B 8FFCBE User defined range #2
+8FFCBF E65C 8FFCBF User defined range #2
+8FFCC0 E65D 8FFCC0 User defined range #2
+8FFCC1 E65E 8FFCC1 User defined range #2
+8FFCC2 E65F 8FFCC2 User defined range #2
+8FFCC3 E660 8FFCC3 User defined range #2
+8FFCC4 E661 8FFCC4 User defined range #2
+8FFCC5 E662 8FFCC5 User defined range #2
+8FFCC6 E663 8FFCC6 User defined range #2
+8FFCC7 E664 8FFCC7 User defined range #2
+8FFCC8 E665 8FFCC8 User defined range #2
+8FFCC9 E666 8FFCC9 User defined range #2
+8FFCCA E667 8FFCCA User defined range #2
+8FFCCB E668 8FFCCB User defined range #2
+8FFCCC E669 8FFCCC User defined range #2
+8FFCCD E66A 8FFCCD User defined range #2
+8FFCCE E66B 8FFCCE User defined range #2
+8FFCCF E66C 8FFCCF User defined range #2
+8FFCD0 E66D 8FFCD0 User defined range #2
+8FFCD1 E66E 8FFCD1 User defined range #2
+8FFCD2 E66F 8FFCD2 User defined range #2
+8FFCD3 E670 8FFCD3 User defined range #2
+8FFCD4 E671 8FFCD4 User defined range #2
+8FFCD5 E672 8FFCD5 User defined range #2
+8FFCD6 E673 8FFCD6 User defined range #2
+8FFCD7 E674 8FFCD7 User defined range #2
+8FFCD8 E675 8FFCD8 User defined range #2
+8FFCD9 E676 8FFCD9 User defined range #2
+8FFCDA E677 8FFCDA User defined range #2
+8FFCDB E678 8FFCDB User defined range #2
+8FFCDC E679 8FFCDC User defined range #2
+8FFCDD E67A 8FFCDD User defined range #2
+8FFCDE E67B 8FFCDE User defined range #2
+8FFCDF E67C 8FFCDF User defined range #2
+8FFCE0 E67D 8FFCE0 User defined range #2
+8FFCE1 E67E 8FFCE1 User defined range #2
+8FFCE2 E67F 8FFCE2 User defined range #2
+8FFCE3 E680 8FFCE3 User defined range #2
+8FFCE4 E681 8FFCE4 User defined range #2
+8FFCE5 E682 8FFCE5 User defined range #2
+8FFCE6 E683 8FFCE6 User defined range #2
+8FFCE7 E684 8FFCE7 User defined range #2
+8FFCE8 E685 8FFCE8 User defined range #2
+8FFCE9 E686 8FFCE9 User defined range #2
+8FFCEA E687 8FFCEA User defined range #2
+8FFCEB E688 8FFCEB User defined range #2
+8FFCEC E689 8FFCEC User defined range #2
+8FFCED E68A 8FFCED User defined range #2
+8FFCEE E68B 8FFCEE User defined range #2
+8FFCEF E68C 8FFCEF User defined range #2
+8FFCF0 E68D 8FFCF0 User defined range #2
+8FFCF1 E68E 8FFCF1 User defined range #2
+8FFCF2 E68F 8FFCF2 User defined range #2
+8FFCF3 E690 8FFCF3 User defined range #2
+8FFCF4 E691 8FFCF4 User defined range #2
+8FFCF5 E692 8FFCF5 User defined range #2
+8FFCF6 E693 8FFCF6 User defined range #2
+8FFCF7 E694 8FFCF7 User defined range #2
+8FFCF8 E695 8FFCF8 User defined range #2
+8FFCF9 E696 8FFCF9 User defined range #2
+8FFCFA E697 8FFCFA User defined range #2
+8FFCFB E698 8FFCFB User defined range #2
+8FFCFC E699 8FFCFC User defined range #2
+8FFCFD E69A 8FFCFD User defined range #2
+8FFCFE E69B 8FFCFE User defined range #2
+8FFDA1 E69C 8FFDA1 User defined range #2
+8FFDA2 E69D 8FFDA2 User defined range #2
+8FFDA3 E69E 8FFDA3 User defined range #2
+8FFDA4 E69F 8FFDA4 User defined range #2
+8FFDA5 E6A0 8FFDA5 User defined range #2
+8FFDA6 E6A1 8FFDA6 User defined range #2
+8FFDA7 E6A2 8FFDA7 User defined range #2
+8FFDA8 E6A3 8FFDA8 User defined range #2
+8FFDA9 E6A4 8FFDA9 User defined range #2
+8FFDAA E6A5 8FFDAA User defined range #2
+8FFDAB E6A6 8FFDAB User defined range #2
+8FFDAC E6A7 8FFDAC User defined range #2
+8FFDAD E6A8 8FFDAD User defined range #2
+8FFDAE E6A9 8FFDAE User defined range #2
+8FFDAF E6AA 8FFDAF User defined range #2
+8FFDB0 E6AB 8FFDB0 User defined range #2
+8FFDB1 E6AC 8FFDB1 User defined range #2
+8FFDB2 E6AD 8FFDB2 User defined range #2
+8FFDB3 E6AE 8FFDB3 User defined range #2
+8FFDB4 E6AF 8FFDB4 User defined range #2
+8FFDB5 E6B0 8FFDB5 User defined range #2
+8FFDB6 E6B1 8FFDB6 User defined range #2
+8FFDB7 E6B2 8FFDB7 User defined range #2
+8FFDB8 E6B3 8FFDB8 User defined range #2
+8FFDB9 E6B4 8FFDB9 User defined range #2
+8FFDBA E6B5 8FFDBA User defined range #2
+8FFDBB E6B6 8FFDBB User defined range #2
+8FFDBC E6B7 8FFDBC User defined range #2
+8FFDBD E6B8 8FFDBD User defined range #2
+8FFDBE E6B9 8FFDBE User defined range #2
+8FFDBF E6BA 8FFDBF User defined range #2
+8FFDC0 E6BB 8FFDC0 User defined range #2
+8FFDC1 E6BC 8FFDC1 User defined range #2
+8FFDC2 E6BD 8FFDC2 User defined range #2
+8FFDC3 E6BE 8FFDC3 User defined range #2
+8FFDC4 E6BF 8FFDC4 User defined range #2
+8FFDC5 E6C0 8FFDC5 User defined range #2
+8FFDC6 E6C1 8FFDC6 User defined range #2
+8FFDC7 E6C2 8FFDC7 User defined range #2
+8FFDC8 E6C3 8FFDC8 User defined range #2
+8FFDC9 E6C4 8FFDC9 User defined range #2
+8FFDCA E6C5 8FFDCA User defined range #2
+8FFDCB E6C6 8FFDCB User defined range #2
+8FFDCC E6C7 8FFDCC User defined range #2
+8FFDCD E6C8 8FFDCD User defined range #2
+8FFDCE E6C9 8FFDCE User defined range #2
+8FFDCF E6CA 8FFDCF User defined range #2
+8FFDD0 E6CB 8FFDD0 User defined range #2
+8FFDD1 E6CC 8FFDD1 User defined range #2
+8FFDD2 E6CD 8FFDD2 User defined range #2
+8FFDD3 E6CE 8FFDD3 User defined range #2
+8FFDD4 E6CF 8FFDD4 User defined range #2
+8FFDD5 E6D0 8FFDD5 User defined range #2
+8FFDD6 E6D1 8FFDD6 User defined range #2
+8FFDD7 E6D2 8FFDD7 User defined range #2
+8FFDD8 E6D3 8FFDD8 User defined range #2
+8FFDD9 E6D4 8FFDD9 User defined range #2
+8FFDDA E6D5 8FFDDA User defined range #2
+8FFDDB E6D6 8FFDDB User defined range #2
+8FFDDC E6D7 8FFDDC User defined range #2
+8FFDDD E6D8 8FFDDD User defined range #2
+8FFDDE E6D9 8FFDDE User defined range #2
+8FFDDF E6DA 8FFDDF User defined range #2
+8FFDE0 E6DB 8FFDE0 User defined range #2
+8FFDE1 E6DC 8FFDE1 User defined range #2
+8FFDE2 E6DD 8FFDE2 User defined range #2
+8FFDE3 E6DE 8FFDE3 User defined range #2
+8FFDE4 E6DF 8FFDE4 User defined range #2
+8FFDE5 E6E0 8FFDE5 User defined range #2
+8FFDE6 E6E1 8FFDE6 User defined range #2
+8FFDE7 E6E2 8FFDE7 User defined range #2
+8FFDE8 E6E3 8FFDE8 User defined range #2
+8FFDE9 E6E4 8FFDE9 User defined range #2
+8FFDEA E6E5 8FFDEA User defined range #2
+8FFDEB E6E6 8FFDEB User defined range #2
+8FFDEC E6E7 8FFDEC User defined range #2
+8FFDED E6E8 8FFDED User defined range #2
+8FFDEE E6E9 8FFDEE User defined range #2
+8FFDEF E6EA 8FFDEF User defined range #2
+8FFDF0 E6EB 8FFDF0 User defined range #2
+8FFDF1 E6EC 8FFDF1 User defined range #2
+8FFDF2 E6ED 8FFDF2 User defined range #2
+8FFDF3 E6EE 8FFDF3 User defined range #2
+8FFDF4 E6EF 8FFDF4 User defined range #2
+8FFDF5 E6F0 8FFDF5 User defined range #2
+8FFDF6 E6F1 8FFDF6 User defined range #2
+8FFDF7 E6F2 8FFDF7 User defined range #2
+8FFDF8 E6F3 8FFDF8 User defined range #2
+8FFDF9 E6F4 8FFDF9 User defined range #2
+8FFDFA E6F5 8FFDFA User defined range #2
+8FFDFB E6F6 8FFDFB User defined range #2
+8FFDFC E6F7 8FFDFC User defined range #2
+8FFDFD E6F8 8FFDFD User defined range #2
+8FFDFE E6F9 8FFDFE User defined range #2
+8FFEA1 E6FA 8FFEA1 User defined range #2
+8FFEA2 E6FB 8FFEA2 User defined range #2
+8FFEA3 E6FC 8FFEA3 User defined range #2
+8FFEA4 E6FD 8FFEA4 User defined range #2
+8FFEA5 E6FE 8FFEA5 User defined range #2
+8FFEA6 E6FF 8FFEA6 User defined range #2
+8FFEA7 E700 8FFEA7 User defined range #2
+8FFEA8 E701 8FFEA8 User defined range #2
+8FFEA9 E702 8FFEA9 User defined range #2
+8FFEAA E703 8FFEAA User defined range #2
+8FFEAB E704 8FFEAB User defined range #2
+8FFEAC E705 8FFEAC User defined range #2
+8FFEAD E706 8FFEAD User defined range #2
+8FFEAE E707 8FFEAE User defined range #2
+8FFEAF E708 8FFEAF User defined range #2
+8FFEB0 E709 8FFEB0 User defined range #2
+8FFEB1 E70A 8FFEB1 User defined range #2
+8FFEB2 E70B 8FFEB2 User defined range #2
+8FFEB3 E70C 8FFEB3 User defined range #2
+8FFEB4 E70D 8FFEB4 User defined range #2
+8FFEB5 E70E 8FFEB5 User defined range #2
+8FFEB6 E70F 8FFEB6 User defined range #2
+8FFEB7 E710 8FFEB7 User defined range #2
+8FFEB8 E711 8FFEB8 User defined range #2
+8FFEB9 E712 8FFEB9 User defined range #2
+8FFEBA E713 8FFEBA User defined range #2
+8FFEBB E714 8FFEBB User defined range #2
+8FFEBC E715 8FFEBC User defined range #2
+8FFEBD E716 8FFEBD User defined range #2
+8FFEBE E717 8FFEBE User defined range #2
+8FFEBF E718 8FFEBF User defined range #2
+8FFEC0 E719 8FFEC0 User defined range #2
+8FFEC1 E71A 8FFEC1 User defined range #2
+8FFEC2 E71B 8FFEC2 User defined range #2
+8FFEC3 E71C 8FFEC3 User defined range #2
+8FFEC4 E71D 8FFEC4 User defined range #2
+8FFEC5 E71E 8FFEC5 User defined range #2
+8FFEC6 E71F 8FFEC6 User defined range #2
+8FFEC7 E720 8FFEC7 User defined range #2
+8FFEC8 E721 8FFEC8 User defined range #2
+8FFEC9 E722 8FFEC9 User defined range #2
+8FFECA E723 8FFECA User defined range #2
+8FFECB E724 8FFECB User defined range #2
+8FFECC E725 8FFECC User defined range #2
+8FFECD E726 8FFECD User defined range #2
+8FFECE E727 8FFECE User defined range #2
+8FFECF E728 8FFECF User defined range #2
+8FFED0 E729 8FFED0 User defined range #2
+8FFED1 E72A 8FFED1 User defined range #2
+8FFED2 E72B 8FFED2 User defined range #2
+8FFED3 E72C 8FFED3 User defined range #2
+8FFED4 E72D 8FFED4 User defined range #2
+8FFED5 E72E 8FFED5 User defined range #2
+8FFED6 E72F 8FFED6 User defined range #2
+8FFED7 E730 8FFED7 User defined range #2
+8FFED8 E731 8FFED8 User defined range #2
+8FFED9 E732 8FFED9 User defined range #2
+8FFEDA E733 8FFEDA User defined range #2
+8FFEDB E734 8FFEDB User defined range #2
+8FFEDC E735 8FFEDC User defined range #2
+8FFEDD E736 8FFEDD User defined range #2
+8FFEDE E737 8FFEDE User defined range #2
+8FFEDF E738 8FFEDF User defined range #2
+8FFEE0 E739 8FFEE0 User defined range #2
+8FFEE1 E73A 8FFEE1 User defined range #2
+8FFEE2 E73B 8FFEE2 User defined range #2
+8FFEE3 E73C 8FFEE3 User defined range #2
+8FFEE4 E73D 8FFEE4 User defined range #2
+8FFEE5 E73E 8FFEE5 User defined range #2
+8FFEE6 E73F 8FFEE6 User defined range #2
+8FFEE7 E740 8FFEE7 User defined range #2
+8FFEE8 E741 8FFEE8 User defined range #2
+8FFEE9 E742 8FFEE9 User defined range #2
+8FFEEA E743 8FFEEA User defined range #2
+8FFEEB E744 8FFEEB User defined range #2
+8FFEEC E745 8FFEEC User defined range #2
+8FFEED E746 8FFEED User defined range #2
+8FFEEE E747 8FFEEE User defined range #2
+8FFEEF E748 8FFEEF User defined range #2
+8FFEF0 E749 8FFEF0 User defined range #2
+8FFEF1 E74A 8FFEF1 User defined range #2
+8FFEF2 E74B 8FFEF2 User defined range #2
+8FFEF3 E74C 8FFEF3 User defined range #2
+8FFEF4 E74D 8FFEF4 User defined range #2
+8FFEF5 E74E 8FFEF5 User defined range #2
+8FFEF6 E74F 8FFEF6 User defined range #2
+8FFEF7 E750 8FFEF7 User defined range #2
+8FFEF8 E751 8FFEF8 User defined range #2
+8FFEF9 E752 8FFEF9 User defined range #2
+8FFEFA E753 8FFEFA User defined range #2
+8FFEFB E754 8FFEFB User defined range #2
+8FFEFC E755 8FFEFC User defined range #2
+8FFEFD E756 8FFEFD User defined range #2
+8FFEFE E757 8FFEFE User defined range #2
+A1A1 3000 A1A1 U+3000 IDEOGRAPHIC SPACE
+A1A2 3001 A1A2 U+3001 IDEOGRAPHIC COMMA
+A1A3 3002 A1A3 U+3002 IDEOGRAPHIC FULL STOP
+A1A4 FF0C A1A4 U+FF0C FULLWIDTH COMMA
+A1A5 FF0E A1A5 U+FF0E FULLWIDTH FULL STOP
+A1A6 30FB A1A6 U+30FB KATAKANA MIDDLE DOT
+A1A7 FF1A A1A7 U+FF1A FULLWIDTH COLON
+A1A8 FF1B A1A8 U+FF1B FULLWIDTH SEMICOLON
+A1A9 FF1F A1A9 U+FF1F FULLWIDTH QUESTION MARK
+A1AA FF01 A1AA U+FF01 FULLWIDTH EXCLAMATION MARK
+A1AB 309B A1AB U+309B KATAKANA-HIRAGANA VOICED SOUND MARK
+A1AC 309C A1AC U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
+A1AD 00B4 A1AD U+00B4 ACUTE ACCENT
+A1AE FF40 A1AE U+FF40 FULLWIDTH GRAVE ACCENT
+A1AF 00A8 A1AF U+00A8 DIAERESIS
+A1B0 FF3E A1B0 U+FF3E FULLWIDTH CIRCUMFLEX ACCENT
+A1B1 FFE3 A1B1 U+FFE3 FULLWIDTH MACRON
+A1B2 FF3F A1B2 U+FF3F FULLWIDTH LOW LINE
+A1B3 30FD A1B3 U+30FD KATAKANA ITERATION MARK
+A1B4 30FE A1B4 U+30FE KATAKANA VOICED ITERATION MARK
+A1B5 309D A1B5 U+309D HIRAGANA ITERATION MARK
+A1B6 309E A1B6 U+309E HIRAGANA VOICED ITERATION MARK
+A1B7 3003 A1B7 U+3003 DITTO MARK
+A1B8 4EDD A1B8 U+4EDD <CJK>
+A1B9 3005 A1B9 U+3005 IDEOGRAPHIC ITERATION MARK
+A1BA 3006 A1BA U+3006 IDEOGRAPHIC CLOSING MARK
+A1BB 3007 A1BB U+3007 IDEOGRAPHIC NUMBER ZERO
+A1BC 30FC A1BC U+30FC KATAKANA-HIRAGANA PROLONGED SOUND MARK
+A1BD 2015 A1BD U+2015 HORIZONTAL BAR
+A1BE 2010 A1BE U+2010 HYPHEN
+A1BF FF0F A1BF U+FF0F FULLWIDTH SOLIDUS
+A1C1 301C A1C1 U+301C WAVE DASH
+A1C2 2016 A1C2 U+2016 DOUBLE VERTICAL LINE
+A1C3 FF5C A1C3 U+FF5C FULLWIDTH VERTICAL LINE
+A1C4 2026 A1C4 U+2026 HORIZONTAL ELLIPSIS
+A1C5 2025 A1C5 U+2025 TWO DOT LEADER
+A1C6 2018 A1C6 U+2018 LEFT SINGLE QUOTATION MARK
+A1C7 2019 A1C7 U+2019 RIGHT SINGLE QUOTATION MARK
+A1C8 201C A1C8 U+201C LEFT DOUBLE QUOTATION MARK
+A1C9 201D A1C9 U+201D RIGHT DOUBLE QUOTATION MARK
+A1CA FF08 A1CA U+FF08 FULLWIDTH LEFT PARENTHESIS
+A1CB FF09 A1CB U+FF09 FULLWIDTH RIGHT PARENTHESIS
+A1CC 3014 A1CC U+3014 LEFT TORTOISE SHELL BRACKET
+A1CD 3015 A1CD U+3015 RIGHT TORTOISE SHELL BRACKET
+A1CE FF3B A1CE U+FF3B FULLWIDTH LEFT SQUARE BRACKET
+A1CF FF3D A1CF U+FF3D FULLWIDTH RIGHT SQUARE BRACKET
+A1D0 FF5B A1D0 U+FF5B FULLWIDTH LEFT CURLY BRACKET
+A1D1 FF5D A1D1 U+FF5D FULLWIDTH RIGHT CURLY BRACKET
+A1D2 3008 A1D2 U+3008 LEFT ANGLE BRACKET
+A1D3 3009 A1D3 U+3009 RIGHT ANGLE BRACKET
+A1D4 300A A1D4 U+300A LEFT DOUBLE ANGLE BRACKET
+A1D5 300B A1D5 U+300B RIGHT DOUBLE ANGLE BRACKET
+A1D6 300C A1D6 U+300C LEFT CORNER BRACKET
+A1D7 300D A1D7 U+300D RIGHT CORNER BRACKET
+A1D8 300E A1D8 U+300E LEFT WHITE CORNER BRACKET
+A1D9 300F A1D9 U+300F RIGHT WHITE CORNER BRACKET
+A1DA 3010 A1DA U+3010 LEFT BLACK LENTICULAR BRACKET
+A1DB 3011 A1DB U+3011 RIGHT BLACK LENTICULAR BRACKET
+A1DC FF0B A1DC U+FF0B FULLWIDTH PLUS SIGN
+A1DD 2212 A1DD U+2212 MINUS SIGN
+A1DE 00B1 A1DE U+00B1 PLUS-MINUS SIGN
+A1DF 00D7 A1DF U+00D7 MULTIPLICATION SIGN
+A1E0 00F7 A1E0 U+00F7 DIVISION SIGN
+A1E1 FF1D A1E1 U+FF1D FULLWIDTH EQUALS SIGN
+A1E2 2260 A1E2 U+2260 NOT EQUAL TO
+A1E3 FF1C A1E3 U+FF1C FULLWIDTH LESS-THAN SIGN
+A1E4 FF1E A1E4 U+FF1E FULLWIDTH GREATER-THAN SIGN
+A1E5 2266 A1E5 U+2266 LESS-THAN OVER EQUAL TO
+A1E6 2267 A1E6 U+2267 GREATER-THAN OVER EQUAL TO
+A1E7 221E A1E7 U+221E INFINITY
+A1E8 2234 A1E8 U+2234 THEREFORE
+A1E9 2642 A1E9 U+2642 MALE SIGN
+A1EA 2640 A1EA U+2640 FEMALE SIGN
+A1EB 00B0 A1EB U+00B0 DEGREE SIGN
+A1EC 2032 A1EC U+2032 PRIME
+A1ED 2033 A1ED U+2033 DOUBLE PRIME
+A1EE 2103 A1EE U+2103 DEGREE CELSIUS
+A1EF FFE5 A1EF U+FFE5 FULLWIDTH YEN SIGN
+A1F0 FF04 A1F0 U+FF04 FULLWIDTH DOLLAR SIGN
+A1F1 00A2 A1F1 U+00A2 CENT SIGN
+A1F2 00A3 A1F2 U+00A3 POUND SIGN
+A1F3 FF05 A1F3 U+FF05 FULLWIDTH PERCENT SIGN
+A1F4 FF03 A1F4 U+FF03 FULLWIDTH NUMBER SIGN
+A1F5 FF06 A1F5 U+FF06 FULLWIDTH AMPERSAND
+A1F6 FF0A A1F6 U+FF0A FULLWIDTH ASTERISK
+A1F7 FF20 A1F7 U+FF20 FULLWIDTH COMMERCIAL AT
+A1F8 00A7 A1F8 U+00A7 SECTION SIGN
+A1F9 2606 A1F9 U+2606 WHITE STAR
+A1FA 2605 A1FA U+2605 BLACK STAR
+A1FB 25CB A1FB U+25CB WHITE CIRCLE
+A1FC 25CF A1FC U+25CF BLACK CIRCLE
+A1FD 25CE A1FD U+25CE BULLSEYE
+A1FE 25C7 A1FE U+25C7 WHITE DIAMOND
+A2A1 25C6 A2A1 U+25C6 BLACK DIAMOND
+A2A2 25A1 A2A2 U+25A1 WHITE SQUARE
+A2A3 25A0 A2A3 U+25A0 BLACK SQUARE
+A2A4 25B3 A2A4 U+25B3 WHITE UP-POINTING TRIANGLE
+A2A5 25B2 A2A5 U+25B2 BLACK UP-POINTING TRIANGLE
+A2A6 25BD A2A6 U+25BD WHITE DOWN-POINTING TRIANGLE
+A2A7 25BC A2A7 U+25BC BLACK DOWN-POINTING TRIANGLE
+A2A8 203B A2A8 U+203B REFERENCE MARK
+A2A9 3012 A2A9 U+3012 POSTAL MARK
+A2AA 2192 A2AA U+2192 RIGHTWARDS ARROW
+A2AB 2190 A2AB U+2190 LEFTWARDS ARROW
+A2AC 2191 A2AC U+2191 UPWARDS ARROW
+A2AD 2193 A2AD U+2193 DOWNWARDS ARROW
+A2AE 3013 A2AE U+3013 GETA MARK
+A2BA 2208 A2BA U+2208 ELEMENT OF
+A2BB 220B A2BB U+220B CONTAINS AS MEMBER
+A2BC 2286 A2BC U+2286 SUBset OF OR EQUAL TO
+A2BD 2287 A2BD U+2287 SUPERset OF OR EQUAL TO
+A2BE 2282 A2BE U+2282 SUBset OF
+A2BF 2283 A2BF U+2283 SUPERset OF
+A2C0 222A A2C0 U+222A UNION
+A2C1 2229 A2C1 U+2229 INTERSECTION
+A2CA 2227 A2CA U+2227 LOGICAL AND
+A2CB 2228 A2CB U+2228 LOGICAL OR
+A2CC 00AC A2CC U+00AC NOT SIGN
+A2CD 21D2 A2CD U+21D2 RIGHTWARDS DOUBLE ARROW
+A2CE 21D4 A2CE U+21D4 LEFT RIGHT DOUBLE ARROW
+A2CF 2200 A2CF U+2200 FOR ALL
+A2D0 2203 A2D0 U+2203 THERE EXISTS
+A2DC 2220 A2DC U+2220 ANGLE
+A2DD 22A5 A2DD U+22A5 UP TACK
+A2DE 2312 A2DE U+2312 ARC
+A2DF 2202 A2DF U+2202 PARTIAL DIFFERENTIAL
+A2E0 2207 A2E0 U+2207 NABLA
+A2E1 2261 A2E1 U+2261 IDENTICAL TO
+A2E2 2252 A2E2 U+2252 APPROXIMATELY EQUAL TO OR THE IMAGE OF
+A2E3 226A A2E3 U+226A MUCH LESS-THAN
+A2E4 226B A2E4 U+226B MUCH GREATER-THAN
+A2E5 221A A2E5 U+221A SQUARE ROOT
+A2E6 223D A2E6 U+223D REVERSED TILDE
+A2E7 221D A2E7 U+221D PROPORTIONAL TO
+A2E8 2235 A2E8 U+2235 BECAUSE
+A2E9 222B A2E9 U+222B INTEGRAL
+A2EA 222C A2EA U+222C DOUBLE INTEGRAL
+A2F2 212B A2F2 U+212B ANGSTROM SIGN
+A2F3 2030 A2F3 U+2030 PER MILLE SIGN
+A2F4 266F A2F4 U+266F MUSIC SHARP SIGN
+A2F5 266D A2F5 U+266D MUSIC FLAT SIGN
+A2F6 266A A2F6 U+266A EIGHTH NOTE
+A2F7 2020 A2F7 U+2020 DAGGER
+A2F8 2021 A2F8 U+2021 DOUBLE DAGGER
+A2F9 00B6 A2F9 U+00B6 PILCROW SIGN
+A2FE 25EF A2FE U+25EF LARGE CIRCLE
+A3B0 FF10 A3B0 U+FF10 FULLWIDTH DIGIT ZERO
+A3B1 FF11 A3B1 U+FF11 FULLWIDTH DIGIT ONE
+A3B2 FF12 A3B2 U+FF12 FULLWIDTH DIGIT TWO
+A3B3 FF13 A3B3 U+FF13 FULLWIDTH DIGIT THREE
+A3B4 FF14 A3B4 U+FF14 FULLWIDTH DIGIT FOUR
+A3B5 FF15 A3B5 U+FF15 FULLWIDTH DIGIT FIVE
+A3B6 FF16 A3B6 U+FF16 FULLWIDTH DIGIT SIX
+A3B7 FF17 A3B7 U+FF17 FULLWIDTH DIGIT SEVEN
+A3B8 FF18 A3B8 U+FF18 FULLWIDTH DIGIT EIGHT
+A3B9 FF19 A3B9 U+FF19 FULLWIDTH DIGIT NINE
+A3C1 FF21 A3C1 U+FF21 FULLWIDTH LATIN CAPITAL LETTER A
+A3C2 FF22 A3C2 U+FF22 FULLWIDTH LATIN CAPITAL LETTER B
+A3C3 FF23 A3C3 U+FF23 FULLWIDTH LATIN CAPITAL LETTER C
+A3C4 FF24 A3C4 U+FF24 FULLWIDTH LATIN CAPITAL LETTER D
+A3C5 FF25 A3C5 U+FF25 FULLWIDTH LATIN CAPITAL LETTER E
+A3C6 FF26 A3C6 U+FF26 FULLWIDTH LATIN CAPITAL LETTER F
+A3C7 FF27 A3C7 U+FF27 FULLWIDTH LATIN CAPITAL LETTER G
+A3C8 FF28 A3C8 U+FF28 FULLWIDTH LATIN CAPITAL LETTER H
+A3C9 FF29 A3C9 U+FF29 FULLWIDTH LATIN CAPITAL LETTER I
+A3CA FF2A A3CA U+FF2A FULLWIDTH LATIN CAPITAL LETTER J
+A3CB FF2B A3CB U+FF2B FULLWIDTH LATIN CAPITAL LETTER K
+A3CC FF2C A3CC U+FF2C FULLWIDTH LATIN CAPITAL LETTER L
+A3CD FF2D A3CD U+FF2D FULLWIDTH LATIN CAPITAL LETTER M
+A3CE FF2E A3CE U+FF2E FULLWIDTH LATIN CAPITAL LETTER N
+A3CF FF2F A3CF U+FF2F FULLWIDTH LATIN CAPITAL LETTER O
+A3D0 FF30 A3D0 U+FF30 FULLWIDTH LATIN CAPITAL LETTER P
+A3D1 FF31 A3D1 U+FF31 FULLWIDTH LATIN CAPITAL LETTER Q
+A3D2 FF32 A3D2 U+FF32 FULLWIDTH LATIN CAPITAL LETTER R
+A3D3 FF33 A3D3 U+FF33 FULLWIDTH LATIN CAPITAL LETTER S
+A3D4 FF34 A3D4 U+FF34 FULLWIDTH LATIN CAPITAL LETTER T
+A3D5 FF35 A3D5 U+FF35 FULLWIDTH LATIN CAPITAL LETTER U
+A3D6 FF36 A3D6 U+FF36 FULLWIDTH LATIN CAPITAL LETTER V
+A3D7 FF37 A3D7 U+FF37 FULLWIDTH LATIN CAPITAL LETTER W
+A3D8 FF38 A3D8 U+FF38 FULLWIDTH LATIN CAPITAL LETTER X
+A3D9 FF39 A3D9 U+FF39 FULLWIDTH LATIN CAPITAL LETTER Y
+A3DA FF3A A3DA U+FF3A FULLWIDTH LATIN CAPITAL LETTER Z
+A3E1 FF41 A3E1 U+FF41 FULLWIDTH LATIN SMALL LETTER A
+A3E2 FF42 A3E2 U+FF42 FULLWIDTH LATIN SMALL LETTER B
+A3E3 FF43 A3E3 U+FF43 FULLWIDTH LATIN SMALL LETTER C
+A3E4 FF44 A3E4 U+FF44 FULLWIDTH LATIN SMALL LETTER D
+A3E5 FF45 A3E5 U+FF45 FULLWIDTH LATIN SMALL LETTER E
+A3E6 FF46 A3E6 U+FF46 FULLWIDTH LATIN SMALL LETTER F
+A3E7 FF47 A3E7 U+FF47 FULLWIDTH LATIN SMALL LETTER G
+A3E8 FF48 A3E8 U+FF48 FULLWIDTH LATIN SMALL LETTER H
+A3E9 FF49 A3E9 U+FF49 FULLWIDTH LATIN SMALL LETTER I
+A3EA FF4A A3EA U+FF4A FULLWIDTH LATIN SMALL LETTER J
+A3EB FF4B A3EB U+FF4B FULLWIDTH LATIN SMALL LETTER K
+A3EC FF4C A3EC U+FF4C FULLWIDTH LATIN SMALL LETTER L
+A3ED FF4D A3ED U+FF4D FULLWIDTH LATIN SMALL LETTER M
+A3EE FF4E A3EE U+FF4E FULLWIDTH LATIN SMALL LETTER N
+A3EF FF4F A3EF U+FF4F FULLWIDTH LATIN SMALL LETTER O
+A3F0 FF50 A3F0 U+FF50 FULLWIDTH LATIN SMALL LETTER P
+A3F1 FF51 A3F1 U+FF51 FULLWIDTH LATIN SMALL LETTER Q
+A3F2 FF52 A3F2 U+FF52 FULLWIDTH LATIN SMALL LETTER R
+A3F3 FF53 A3F3 U+FF53 FULLWIDTH LATIN SMALL LETTER S
+A3F4 FF54 A3F4 U+FF54 FULLWIDTH LATIN SMALL LETTER T
+A3F5 FF55 A3F5 U+FF55 FULLWIDTH LATIN SMALL LETTER U
+A3F6 FF56 A3F6 U+FF56 FULLWIDTH LATIN SMALL LETTER V
+A3F7 FF57 A3F7 U+FF57 FULLWIDTH LATIN SMALL LETTER W
+A3F8 FF58 A3F8 U+FF58 FULLWIDTH LATIN SMALL LETTER X
+A3F9 FF59 A3F9 U+FF59 FULLWIDTH LATIN SMALL LETTER Y
+A3FA FF5A A3FA U+FF5A FULLWIDTH LATIN SMALL LETTER Z
+A4A1 3041 A4A1 U+3041 HIRAGANA LETTER SMALL A
+A4A2 3042 A4A2 U+3042 HIRAGANA LETTER A
+A4A3 3043 A4A3 U+3043 HIRAGANA LETTER SMALL I
+A4A4 3044 A4A4 U+3044 HIRAGANA LETTER I
+A4A5 3045 A4A5 U+3045 HIRAGANA LETTER SMALL U
+A4A6 3046 A4A6 U+3046 HIRAGANA LETTER U
+A4A7 3047 A4A7 U+3047 HIRAGANA LETTER SMALL E
+A4A8 3048 A4A8 U+3048 HIRAGANA LETTER E
+A4A9 3049 A4A9 U+3049 HIRAGANA LETTER SMALL O
+A4AA 304A A4AA U+304A HIRAGANA LETTER O
+A4AB 304B A4AB U+304B HIRAGANA LETTER KA
+A4AC 304C A4AC U+304C HIRAGANA LETTER GA
+A4AD 304D A4AD U+304D HIRAGANA LETTER KI
+A4AE 304E A4AE U+304E HIRAGANA LETTER GI
+A4AF 304F A4AF U+304F HIRAGANA LETTER KU
+A4B0 3050 A4B0 U+3050 HIRAGANA LETTER GU
+A4B1 3051 A4B1 U+3051 HIRAGANA LETTER KE
+A4B2 3052 A4B2 U+3052 HIRAGANA LETTER GE
+A4B3 3053 A4B3 U+3053 HIRAGANA LETTER KO
+A4B4 3054 A4B4 U+3054 HIRAGANA LETTER GO
+A4B5 3055 A4B5 U+3055 HIRAGANA LETTER SA
+A4B6 3056 A4B6 U+3056 HIRAGANA LETTER ZA
+A4B7 3057 A4B7 U+3057 HIRAGANA LETTER SI
+A4B8 3058 A4B8 U+3058 HIRAGANA LETTER ZI
+A4B9 3059 A4B9 U+3059 HIRAGANA LETTER SU
+A4BA 305A A4BA U+305A HIRAGANA LETTER ZU
+A4BB 305B A4BB U+305B HIRAGANA LETTER SE
+A4BC 305C A4BC U+305C HIRAGANA LETTER ZE
+A4BD 305D A4BD U+305D HIRAGANA LETTER SO
+A4BE 305E A4BE U+305E HIRAGANA LETTER ZO
+A4BF 305F A4BF U+305F HIRAGANA LETTER TA
+A4C0 3060 A4C0 U+3060 HIRAGANA LETTER DA
+A4C1 3061 A4C1 U+3061 HIRAGANA LETTER TI
+A4C2 3062 A4C2 U+3062 HIRAGANA LETTER DI
+A4C3 3063 A4C3 U+3063 HIRAGANA LETTER SMALL TU
+A4C4 3064 A4C4 U+3064 HIRAGANA LETTER TU
+A4C5 3065 A4C5 U+3065 HIRAGANA LETTER DU
+A4C6 3066 A4C6 U+3066 HIRAGANA LETTER TE
+A4C7 3067 A4C7 U+3067 HIRAGANA LETTER DE
+A4C8 3068 A4C8 U+3068 HIRAGANA LETTER TO
+A4C9 3069 A4C9 U+3069 HIRAGANA LETTER DO
+A4CA 306A A4CA U+306A HIRAGANA LETTER NA
+A4CB 306B A4CB U+306B HIRAGANA LETTER NI
+A4CC 306C A4CC U+306C HIRAGANA LETTER NU
+A4CD 306D A4CD U+306D HIRAGANA LETTER NE
+A4CE 306E A4CE U+306E HIRAGANA LETTER NO
+A4CF 306F A4CF U+306F HIRAGANA LETTER HA
+A4D0 3070 A4D0 U+3070 HIRAGANA LETTER BA
+A4D1 3071 A4D1 U+3071 HIRAGANA LETTER PA
+A4D2 3072 A4D2 U+3072 HIRAGANA LETTER HI
+A4D3 3073 A4D3 U+3073 HIRAGANA LETTER BI
+A4D4 3074 A4D4 U+3074 HIRAGANA LETTER PI
+A4D5 3075 A4D5 U+3075 HIRAGANA LETTER HU
+A4D6 3076 A4D6 U+3076 HIRAGANA LETTER BU
+A4D7 3077 A4D7 U+3077 HIRAGANA LETTER PU
+A4D8 3078 A4D8 U+3078 HIRAGANA LETTER HE
+A4D9 3079 A4D9 U+3079 HIRAGANA LETTER BE
+A4DA 307A A4DA U+307A HIRAGANA LETTER PE
+A4DB 307B A4DB U+307B HIRAGANA LETTER HO
+A4DC 307C A4DC U+307C HIRAGANA LETTER BO
+A4DD 307D A4DD U+307D HIRAGANA LETTER PO
+A4DE 307E A4DE U+307E HIRAGANA LETTER MA
+A4DF 307F A4DF U+307F HIRAGANA LETTER MI
+A4E0 3080 A4E0 U+3080 HIRAGANA LETTER MU
+A4E1 3081 A4E1 U+3081 HIRAGANA LETTER ME
+A4E2 3082 A4E2 U+3082 HIRAGANA LETTER MO
+A4E3 3083 A4E3 U+3083 HIRAGANA LETTER SMALL YA
+A4E4 3084 A4E4 U+3084 HIRAGANA LETTER YA
+A4E5 3085 A4E5 U+3085 HIRAGANA LETTER SMALL YU
+A4E6 3086 A4E6 U+3086 HIRAGANA LETTER YU
+A4E7 3087 A4E7 U+3087 HIRAGANA LETTER SMALL YO
+A4E8 3088 A4E8 U+3088 HIRAGANA LETTER YO
+A4E9 3089 A4E9 U+3089 HIRAGANA LETTER RA
+A4EA 308A A4EA U+308A HIRAGANA LETTER RI
+A4EB 308B A4EB U+308B HIRAGANA LETTER RU
+A4EC 308C A4EC U+308C HIRAGANA LETTER RE
+A4ED 308D A4ED U+308D HIRAGANA LETTER RO
+A4EE 308E A4EE U+308E HIRAGANA LETTER SMALL WA
+A4EF 308F A4EF U+308F HIRAGANA LETTER WA
+A4F0 3090 A4F0 U+3090 HIRAGANA LETTER WI
+A4F1 3091 A4F1 U+3091 HIRAGANA LETTER WE
+A4F2 3092 A4F2 U+3092 HIRAGANA LETTER WO
+A4F3 3093 A4F3 U+3093 HIRAGANA LETTER N
+A5A1 30A1 A5A1 U+30A1 KATAKANA LETTER SMALL A
+A5A2 30A2 A5A2 U+30A2 KATAKANA LETTER A
+A5A3 30A3 A5A3 U+30A3 KATAKANA LETTER SMALL I
+A5A4 30A4 A5A4 U+30A4 KATAKANA LETTER I
+A5A5 30A5 A5A5 U+30A5 KATAKANA LETTER SMALL U
+A5A6 30A6 A5A6 U+30A6 KATAKANA LETTER U
+A5A7 30A7 A5A7 U+30A7 KATAKANA LETTER SMALL E
+A5A8 30A8 A5A8 U+30A8 KATAKANA LETTER E
+A5A9 30A9 A5A9 U+30A9 KATAKANA LETTER SMALL O
+A5AA 30AA A5AA U+30AA KATAKANA LETTER O
+A5AB 30AB A5AB U+30AB KATAKANA LETTER KA
+A5AC 30AC A5AC U+30AC KATAKANA LETTER GA
+A5AD 30AD A5AD U+30AD KATAKANA LETTER KI
+A5AE 30AE A5AE U+30AE KATAKANA LETTER GI
+A5AF 30AF A5AF U+30AF KATAKANA LETTER KU
+A5B0 30B0 A5B0 U+30B0 KATAKANA LETTER GU
+A5B1 30B1 A5B1 U+30B1 KATAKANA LETTER KE
+A5B2 30B2 A5B2 U+30B2 KATAKANA LETTER GE
+A5B3 30B3 A5B3 U+30B3 KATAKANA LETTER KO
+A5B4 30B4 A5B4 U+30B4 KATAKANA LETTER GO
+A5B5 30B5 A5B5 U+30B5 KATAKANA LETTER SA
+A5B6 30B6 A5B6 U+30B6 KATAKANA LETTER ZA
+A5B7 30B7 A5B7 U+30B7 KATAKANA LETTER SI
+A5B8 30B8 A5B8 U+30B8 KATAKANA LETTER ZI
+A5B9 30B9 A5B9 U+30B9 KATAKANA LETTER SU
+A5BA 30BA A5BA U+30BA KATAKANA LETTER ZU
+A5BB 30BB A5BB U+30BB KATAKANA LETTER SE
+A5BC 30BC A5BC U+30BC KATAKANA LETTER ZE
+A5BD 30BD A5BD U+30BD KATAKANA LETTER SO
+A5BE 30BE A5BE U+30BE KATAKANA LETTER ZO
+A5BF 30BF A5BF U+30BF KATAKANA LETTER TA
+A5C0 30C0 A5C0 U+30C0 KATAKANA LETTER DA
+A5C1 30C1 A5C1 U+30C1 KATAKANA LETTER TI
+A5C2 30C2 A5C2 U+30C2 KATAKANA LETTER DI
+A5C3 30C3 A5C3 U+30C3 KATAKANA LETTER SMALL TU
+A5C4 30C4 A5C4 U+30C4 KATAKANA LETTER TU
+A5C5 30C5 A5C5 U+30C5 KATAKANA LETTER DU
+A5C6 30C6 A5C6 U+30C6 KATAKANA LETTER TE
+A5C7 30C7 A5C7 U+30C7 KATAKANA LETTER DE
+A5C8 30C8 A5C8 U+30C8 KATAKANA LETTER TO
+A5C9 30C9 A5C9 U+30C9 KATAKANA LETTER DO
+A5CA 30CA A5CA U+30CA KATAKANA LETTER NA
+A5CB 30CB A5CB U+30CB KATAKANA LETTER NI
+A5CC 30CC A5CC U+30CC KATAKANA LETTER NU
+A5CD 30CD A5CD U+30CD KATAKANA LETTER NE
+A5CE 30CE A5CE U+30CE KATAKANA LETTER NO
+A5CF 30CF A5CF U+30CF KATAKANA LETTER HA
+A5D0 30D0 A5D0 U+30D0 KATAKANA LETTER BA
+A5D1 30D1 A5D1 U+30D1 KATAKANA LETTER PA
+A5D2 30D2 A5D2 U+30D2 KATAKANA LETTER HI
+A5D3 30D3 A5D3 U+30D3 KATAKANA LETTER BI
+A5D4 30D4 A5D4 U+30D4 KATAKANA LETTER PI
+A5D5 30D5 A5D5 U+30D5 KATAKANA LETTER HU
+A5D6 30D6 A5D6 U+30D6 KATAKANA LETTER BU
+A5D7 30D7 A5D7 U+30D7 KATAKANA LETTER PU
+A5D8 30D8 A5D8 U+30D8 KATAKANA LETTER HE
+A5D9 30D9 A5D9 U+30D9 KATAKANA LETTER BE
+A5DA 30DA A5DA U+30DA KATAKANA LETTER PE
+A5DB 30DB A5DB U+30DB KATAKANA LETTER HO
+A5DC 30DC A5DC U+30DC KATAKANA LETTER BO
+A5DD 30DD A5DD U+30DD KATAKANA LETTER PO
+A5DE 30DE A5DE U+30DE KATAKANA LETTER MA
+A5DF 30DF A5DF U+30DF KATAKANA LETTER MI
+A5E0 30E0 A5E0 U+30E0 KATAKANA LETTER MU
+A5E1 30E1 A5E1 U+30E1 KATAKANA LETTER ME
+A5E2 30E2 A5E2 U+30E2 KATAKANA LETTER MO
+A5E3 30E3 A5E3 U+30E3 KATAKANA LETTER SMALL YA
+A5E4 30E4 A5E4 U+30E4 KATAKANA LETTER YA
+A5E5 30E5 A5E5 U+30E5 KATAKANA LETTER SMALL YU
+A5E6 30E6 A5E6 U+30E6 KATAKANA LETTER YU
+A5E7 30E7 A5E7 U+30E7 KATAKANA LETTER SMALL YO
+A5E8 30E8 A5E8 U+30E8 KATAKANA LETTER YO
+A5E9 30E9 A5E9 U+30E9 KATAKANA LETTER RA
+A5EA 30EA A5EA U+30EA KATAKANA LETTER RI
+A5EB 30EB A5EB U+30EB KATAKANA LETTER RU
+A5EC 30EC A5EC U+30EC KATAKANA LETTER RE
+A5ED 30ED A5ED U+30ED KATAKANA LETTER RO
+A5EE 30EE A5EE U+30EE KATAKANA LETTER SMALL WA
+A5EF 30EF A5EF U+30EF KATAKANA LETTER WA
+A5F0 30F0 A5F0 U+30F0 KATAKANA LETTER WI
+A5F1 30F1 A5F1 U+30F1 KATAKANA LETTER WE
+A5F2 30F2 A5F2 U+30F2 KATAKANA LETTER WO
+A5F3 30F3 A5F3 U+30F3 KATAKANA LETTER N
+A5F4 30F4 A5F4 U+30F4 KATAKANA LETTER VU
+A5F5 30F5 A5F5 U+30F5 KATAKANA LETTER SMALL KA
+A5F6 30F6 A5F6 U+30F6 KATAKANA LETTER SMALL KE
+A6A1 0391 A6A1 U+0391 GREEK CAPITAL LETTER ALPHA
+A6A2 0392 A6A2 U+0392 GREEK CAPITAL LETTER BETA
+A6A3 0393 A6A3 U+0393 GREEK CAPITAL LETTER GAMMA
+A6A4 0394 A6A4 U+0394 GREEK CAPITAL LETTER DELTA
+A6A5 0395 A6A5 U+0395 GREEK CAPITAL LETTER EPSILON
+A6A6 0396 A6A6 U+0396 GREEK CAPITAL LETTER ZETA
+A6A7 0397 A6A7 U+0397 GREEK CAPITAL LETTER ETA
+A6A8 0398 A6A8 U+0398 GREEK CAPITAL LETTER THETA
+A6A9 0399 A6A9 U+0399 GREEK CAPITAL LETTER IOTA
+A6AA 039A A6AA U+039A GREEK CAPITAL LETTER KAPPA
+A6AB 039B A6AB U+039B GREEK CAPITAL LETTER LAMDA
+A6AC 039C A6AC U+039C GREEK CAPITAL LETTER MU
+A6AD 039D A6AD U+039D GREEK CAPITAL LETTER NU
+A6AE 039E A6AE U+039E GREEK CAPITAL LETTER XI
+A6AF 039F A6AF U+039F GREEK CAPITAL LETTER OMICRON
+A6B0 03A0 A6B0 U+03A0 GREEK CAPITAL LETTER PI
+A6B1 03A1 A6B1 U+03A1 GREEK CAPITAL LETTER RHO
+A6B2 03A3 A6B2 U+03A3 GREEK CAPITAL LETTER SIGMA
+A6B3 03A4 A6B3 U+03A4 GREEK CAPITAL LETTER TAU
+A6B4 03A5 A6B4 U+03A5 GREEK CAPITAL LETTER UPSILON
+A6B5 03A6 A6B5 U+03A6 GREEK CAPITAL LETTER PHI
+A6B6 03A7 A6B6 U+03A7 GREEK CAPITAL LETTER CHI
+A6B7 03A8 A6B7 U+03A8 GREEK CAPITAL LETTER PSI
+A6B8 03A9 A6B8 U+03A9 GREEK CAPITAL LETTER OMEGA
+A6C1 03B1 A6C1 U+03B1 GREEK SMALL LETTER ALPHA
+A6C2 03B2 A6C2 U+03B2 GREEK SMALL LETTER BETA
+A6C3 03B3 A6C3 U+03B3 GREEK SMALL LETTER GAMMA
+A6C4 03B4 A6C4 U+03B4 GREEK SMALL LETTER DELTA
+A6C5 03B5 A6C5 U+03B5 GREEK SMALL LETTER EPSILON
+A6C6 03B6 A6C6 U+03B6 GREEK SMALL LETTER ZETA
+A6C7 03B7 A6C7 U+03B7 GREEK SMALL LETTER ETA
+A6C8 03B8 A6C8 U+03B8 GREEK SMALL LETTER THETA
+A6C9 03B9 A6C9 U+03B9 GREEK SMALL LETTER IOTA
+A6CA 03BA A6CA U+03BA GREEK SMALL LETTER KAPPA
+A6CB 03BB A6CB U+03BB GREEK SMALL LETTER LAMDA
+A6CC 03BC A6CC U+03BC GREEK SMALL LETTER MU
+A6CD 03BD A6CD U+03BD GREEK SMALL LETTER NU
+A6CE 03BE A6CE U+03BE GREEK SMALL LETTER XI
+A6CF 03BF A6CF U+03BF GREEK SMALL LETTER OMICRON
+A6D0 03C0 A6D0 U+03C0 GREEK SMALL LETTER PI
+A6D1 03C1 A6D1 U+03C1 GREEK SMALL LETTER RHO
+A6D2 03C3 A6D2 U+03C3 GREEK SMALL LETTER SIGMA
+A6D3 03C4 A6D3 U+03C4 GREEK SMALL LETTER TAU
+A6D4 03C5 A6D4 U+03C5 GREEK SMALL LETTER UPSILON
+A6D5 03C6 A6D5 U+03C6 GREEK SMALL LETTER PHI
+A6D6 03C7 A6D6 U+03C7 GREEK SMALL LETTER CHI
+A6D7 03C8 A6D7 U+03C8 GREEK SMALL LETTER PSI
+A6D8 03C9 A6D8 U+03C9 GREEK SMALL LETTER OMEGA
+A7A1 0410 A7A1 U+0410 CYRILLIC CAPITAL LETTER A
+A7A2 0411 A7A2 U+0411 CYRILLIC CAPITAL LETTER BE
+A7A3 0412 A7A3 U+0412 CYRILLIC CAPITAL LETTER VE
+A7A4 0413 A7A4 U+0413 CYRILLIC CAPITAL LETTER GHE
+A7A5 0414 A7A5 U+0414 CYRILLIC CAPITAL LETTER DE
+A7A6 0415 A7A6 U+0415 CYRILLIC CAPITAL LETTER IE
+A7A7 0401 A7A7 U+0401 CYRILLIC CAPITAL LETTER IO
+A7A8 0416 A7A8 U+0416 CYRILLIC CAPITAL LETTER ZHE
+A7A9 0417 A7A9 U+0417 CYRILLIC CAPITAL LETTER ZE
+A7AA 0418 A7AA U+0418 CYRILLIC CAPITAL LETTER I
+A7AB 0419 A7AB U+0419 CYRILLIC CAPITAL LETTER SHORT I
+A7AC 041A A7AC U+041A CYRILLIC CAPITAL LETTER KA
+A7AD 041B A7AD U+041B CYRILLIC CAPITAL LETTER EL
+A7AE 041C A7AE U+041C CYRILLIC CAPITAL LETTER EM
+A7AF 041D A7AF U+041D CYRILLIC CAPITAL LETTER EN
+A7B0 041E A7B0 U+041E CYRILLIC CAPITAL LETTER O
+A7B1 041F A7B1 U+041F CYRILLIC CAPITAL LETTER PE
+A7B2 0420 A7B2 U+0420 CYRILLIC CAPITAL LETTER ER
+A7B3 0421 A7B3 U+0421 CYRILLIC CAPITAL LETTER ES
+A7B4 0422 A7B4 U+0422 CYRILLIC CAPITAL LETTER TE
+A7B5 0423 A7B5 U+0423 CYRILLIC CAPITAL LETTER U
+A7B6 0424 A7B6 U+0424 CYRILLIC CAPITAL LETTER EF
+A7B7 0425 A7B7 U+0425 CYRILLIC CAPITAL LETTER HA
+A7B8 0426 A7B8 U+0426 CYRILLIC CAPITAL LETTER TSE
+A7B9 0427 A7B9 U+0427 CYRILLIC CAPITAL LETTER CHE
+A7BA 0428 A7BA U+0428 CYRILLIC CAPITAL LETTER SHA
+A7BB 0429 A7BB U+0429 CYRILLIC CAPITAL LETTER SHCHA
+A7BC 042A A7BC U+042A CYRILLIC CAPITAL LETTER HARD SIGN
+A7BD 042B A7BD U+042B CYRILLIC CAPITAL LETTER YERU
+A7BE 042C A7BE U+042C CYRILLIC CAPITAL LETTER SOFT SIGN
+A7BF 042D A7BF U+042D CYRILLIC CAPITAL LETTER E
+A7C0 042E A7C0 U+042E CYRILLIC CAPITAL LETTER YU
+A7C1 042F A7C1 U+042F CYRILLIC CAPITAL LETTER YA
+A7D1 0430 A7D1 U+0430 CYRILLIC SMALL LETTER A
+A7D2 0431 A7D2 U+0431 CYRILLIC SMALL LETTER BE
+A7D3 0432 A7D3 U+0432 CYRILLIC SMALL LETTER VE
+A7D4 0433 A7D4 U+0433 CYRILLIC SMALL LETTER GHE
+A7D5 0434 A7D5 U+0434 CYRILLIC SMALL LETTER DE
+A7D6 0435 A7D6 U+0435 CYRILLIC SMALL LETTER IE
+A7D7 0451 A7D7 U+0451 CYRILLIC SMALL LETTER IO
+A7D8 0436 A7D8 U+0436 CYRILLIC SMALL LETTER ZHE
+A7D9 0437 A7D9 U+0437 CYRILLIC SMALL LETTER ZE
+A7DA 0438 A7DA U+0438 CYRILLIC SMALL LETTER I
+A7DB 0439 A7DB U+0439 CYRILLIC SMALL LETTER SHORT I
+A7DC 043A A7DC U+043A CYRILLIC SMALL LETTER KA
+A7DD 043B A7DD U+043B CYRILLIC SMALL LETTER EL
+A7DE 043C A7DE U+043C CYRILLIC SMALL LETTER EM
+A7DF 043D A7DF U+043D CYRILLIC SMALL LETTER EN
+A7E0 043E A7E0 U+043E CYRILLIC SMALL LETTER O
+A7E1 043F A7E1 U+043F CYRILLIC SMALL LETTER PE
+A7E2 0440 A7E2 U+0440 CYRILLIC SMALL LETTER ER
+A7E3 0441 A7E3 U+0441 CYRILLIC SMALL LETTER ES
+A7E4 0442 A7E4 U+0442 CYRILLIC SMALL LETTER TE
+A7E5 0443 A7E5 U+0443 CYRILLIC SMALL LETTER U
+A7E6 0444 A7E6 U+0444 CYRILLIC SMALL LETTER EF
+A7E7 0445 A7E7 U+0445 CYRILLIC SMALL LETTER HA
+A7E8 0446 A7E8 U+0446 CYRILLIC SMALL LETTER TSE
+A7E9 0447 A7E9 U+0447 CYRILLIC SMALL LETTER CHE
+A7EA 0448 A7EA U+0448 CYRILLIC SMALL LETTER SHA
+A7EB 0449 A7EB U+0449 CYRILLIC SMALL LETTER SHCHA
+A7EC 044A A7EC U+044A CYRILLIC SMALL LETTER HARD SIGN
+A7ED 044B A7ED U+044B CYRILLIC SMALL LETTER YERU
+A7EE 044C A7EE U+044C CYRILLIC SMALL LETTER SOFT SIGN
+A7EF 044D A7EF U+044D CYRILLIC SMALL LETTER E
+A7F0 044E A7F0 U+044E CYRILLIC SMALL LETTER YU
+A7F1 044F A7F1 U+044F CYRILLIC SMALL LETTER YA
+A8A1 2500 A8A1 U+2500 BOX DRAWINGS LIGHT HORIZONTAL
+A8A2 2502 A8A2 U+2502 BOX DRAWINGS LIGHT VERTICAL
+A8A3 250C A8A3 U+250C BOX DRAWINGS LIGHT DOWN AND RIGHT
+A8A4 2510 A8A4 U+2510 BOX DRAWINGS LIGHT DOWN AND LEFT
+A8A5 2518 A8A5 U+2518 BOX DRAWINGS LIGHT UP AND LEFT
+A8A6 2514 A8A6 U+2514 BOX DRAWINGS LIGHT UP AND RIGHT
+A8A7 251C A8A7 U+251C BOX DRAWINGS LIGHT VERTICAL AND RIGHT
+A8A8 252C A8A8 U+252C BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
+A8A9 2524 A8A9 U+2524 BOX DRAWINGS LIGHT VERTICAL AND LEFT
+A8AA 2534 A8AA U+2534 BOX DRAWINGS LIGHT UP AND HORIZONTAL
+A8AB 253C A8AB U+253C BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
+A8AC 2501 A8AC U+2501 BOX DRAWINGS HEAVY HORIZONTAL
+A8AD 2503 A8AD U+2503 BOX DRAWINGS HEAVY VERTICAL
+A8AE 250F A8AE U+250F BOX DRAWINGS HEAVY DOWN AND RIGHT
+A8AF 2513 A8AF U+2513 BOX DRAWINGS HEAVY DOWN AND LEFT
+A8B0 251B A8B0 U+251B BOX DRAWINGS HEAVY UP AND LEFT
+A8B1 2517 A8B1 U+2517 BOX DRAWINGS HEAVY UP AND RIGHT
+A8B2 2523 A8B2 U+2523 BOX DRAWINGS HEAVY VERTICAL AND RIGHT
+A8B3 2533 A8B3 U+2533 BOX DRAWINGS HEAVY DOWN AND HORIZONTAL
+A8B4 252B A8B4 U+252B BOX DRAWINGS HEAVY VERTICAL AND LEFT
+A8B5 253B A8B5 U+253B BOX DRAWINGS HEAVY UP AND HORIZONTAL
+A8B6 254B A8B6 U+254B BOX DRAWINGS HEAVY VERTICAL AND HORIZONTAL
+A8B7 2520 A8B7 U+2520 BOX DRAWINGS VERTICAL HEAVY AND RIGHT LIGHT
+A8B8 252F A8B8 U+252F BOX DRAWINGS DOWN LIGHT AND HORIZONTAL HEAVY
+A8B9 2528 A8B9 U+2528 BOX DRAWINGS VERTICAL HEAVY AND LEFT LIGHT
+A8BA 2537 A8BA U+2537 BOX DRAWINGS UP LIGHT AND HORIZONTAL HEAVY
+A8BB 253F A8BB U+253F BOX DRAWINGS VERTICAL LIGHT AND HORIZONTAL HEAVY
+A8BC 251D A8BC U+251D BOX DRAWINGS VERTICAL LIGHT AND RIGHT HEAVY
+A8BD 2530 A8BD U+2530 BOX DRAWINGS DOWN HEAVY AND HORIZONTAL LIGHT
+A8BE 2525 A8BE U+2525 BOX DRAWINGS VERTICAL LIGHT AND LEFT HEAVY
+A8BF 2538 A8BF U+2538 BOX DRAWINGS UP HEAVY AND HORIZONTAL LIGHT
+A8C0 2542 A8C0 U+2542 BOX DRAWINGS VERTICAL HEAVY AND HORIZONTAL LIGHT
+B0A1 4E9C B0A1 <CJK>
+B0A2 5516 B0A2 <CJK>
+B0A3 5A03 B0A3 <CJK>
+B0A4 963F B0A4 <CJK>
+B0A5 54C0 B0A5 <CJK>
+B0A6 611B B0A6 <CJK>
+B0A7 6328 B0A7 <CJK>
+B0A8 59F6 B0A8 <CJK>
+B0A9 9022 B0A9 <CJK>
+B0AA 8475 B0AA <CJK>
+B0AB 831C B0AB <CJK>
+B0AC 7A50 B0AC <CJK>
+B0AD 60AA B0AD <CJK>
+B0AE 63E1 B0AE <CJK>
+B0AF 6E25 B0AF <CJK>
+B0B0 65ED B0B0 <CJK>
+B0B1 8466 B0B1 <CJK>
+B0B2 82A6 B0B2 <CJK>
+B0B3 9BF5 B0B3 <CJK>
+B0B4 6893 B0B4 <CJK>
+B0B5 5727 B0B5 <CJK>
+B0B6 65A1 B0B6 <CJK>
+B0B7 6271 B0B7 <CJK>
+B0B8 5B9B B0B8 <CJK>
+B0B9 59D0 B0B9 <CJK>
+B0BA 867B B0BA <CJK>
+B0BB 98F4 B0BB <CJK>
+B0BC 7D62 B0BC <CJK>
+B0BD 7DBE B0BD <CJK>
+B0BE 9B8E B0BE <CJK>
+B0BF 6216 B0BF <CJK>
+B0C0 7C9F B0C0 <CJK>
+B0C1 88B7 B0C1 <CJK>
+B0C2 5B89 B0C2 <CJK>
+B0C3 5EB5 B0C3 <CJK>
+B0C4 6309 B0C4 <CJK>
+B0C5 6697 B0C5 <CJK>
+B0C6 6848 B0C6 <CJK>
+B0C7 95C7 B0C7 <CJK>
+B0C8 978D B0C8 <CJK>
+B0C9 674F B0C9 <CJK>
+B0CA 4EE5 B0CA <CJK>
+B0CB 4F0A B0CB <CJK>
+B0CC 4F4D B0CC <CJK>
+B0CD 4F9D B0CD <CJK>
+B0CE 5049 B0CE <CJK>
+B0CF 56F2 B0CF <CJK>
+B0D0 5937 B0D0 <CJK>
+B0D1 59D4 B0D1 <CJK>
+B0D2 5A01 B0D2 <CJK>
+B0D3 5C09 B0D3 <CJK>
+B0D4 60DF B0D4 <CJK>
+B0D5 610F B0D5 <CJK>
+B0D6 6170 B0D6 <CJK>
+B0D7 6613 B0D7 <CJK>
+B0D8 6905 B0D8 <CJK>
+B0D9 70BA B0D9 <CJK>
+B0DA 754F B0DA <CJK>
+B0DB 7570 B0DB <CJK>
+B0DC 79FB B0DC <CJK>
+B0DD 7DAD B0DD <CJK>
+B0DE 7DEF B0DE <CJK>
+B0DF 80C3 B0DF <CJK>
+B0E0 840E B0E0 <CJK>
+B0E1 8863 B0E1 <CJK>
+B0E2 8B02 B0E2 <CJK>
+B0E3 9055 B0E3 <CJK>
+B0E4 907A B0E4 <CJK>
+B0E5 533B B0E5 <CJK>
+B0E6 4E95 B0E6 <CJK>
+B0E7 4EA5 B0E7 <CJK>
+B0E8 57DF B0E8 <CJK>
+B0E9 80B2 B0E9 <CJK>
+B0EA 90C1 B0EA <CJK>
+B0EB 78EF B0EB <CJK>
+B0EC 4E00 B0EC <CJK>
+B0ED 58F1 B0ED <CJK>
+B0EE 6EA2 B0EE <CJK>
+B0EF 9038 B0EF <CJK>
+B0F0 7A32 B0F0 <CJK>
+B0F1 8328 B0F1 <CJK>
+B0F2 828B B0F2 <CJK>
+B0F3 9C2F B0F3 <CJK>
+B0F4 5141 B0F4 <CJK>
+B0F5 5370 B0F5 <CJK>
+B0F6 54BD B0F6 <CJK>
+B0F7 54E1 B0F7 <CJK>
+B0F8 56E0 B0F8 <CJK>
+B0F9 59FB B0F9 <CJK>
+B0FA 5F15 B0FA <CJK>
+B0FB 98F2 B0FB <CJK>
+B0FC 6DEB B0FC <CJK>
+B0FD 80E4 B0FD <CJK>
+B0FE 852D B0FE <CJK>
+B1A1 9662 B1A1 <CJK>
+B1A2 9670 B1A2 <CJK>
+B1A3 96A0 B1A3 <CJK>
+B1A4 97FB B1A4 <CJK>
+B1A5 540B B1A5 <CJK>
+B1A6 53F3 B1A6 <CJK>
+B1A7 5B87 B1A7 <CJK>
+B1A8 70CF B1A8 <CJK>
+B1A9 7FBD B1A9 <CJK>
+B1AA 8FC2 B1AA <CJK>
+B1AB 96E8 B1AB <CJK>
+B1AC 536F B1AC <CJK>
+B1AD 9D5C B1AD <CJK>
+B1AE 7ABA B1AE <CJK>
+B1AF 4E11 B1AF <CJK>
+B1B0 7893 B1B0 <CJK>
+B1B1 81FC B1B1 <CJK>
+B1B2 6E26 B1B2 <CJK>
+B1B3 5618 B1B3 <CJK>
+B1B4 5504 B1B4 <CJK>
+B1B5 6B1D B1B5 <CJK>
+B1B6 851A B1B6 <CJK>
+B1B7 9C3B B1B7 <CJK>
+B1B8 59E5 B1B8 <CJK>
+B1B9 53A9 B1B9 <CJK>
+B1BA 6D66 B1BA <CJK>
+B1BB 74DC B1BB <CJK>
+B1BC 958F B1BC <CJK>
+B1BD 5642 B1BD <CJK>
+B1BE 4E91 B1BE <CJK>
+B1BF 904B B1BF <CJK>
+B1C0 96F2 B1C0 <CJK>
+B1C1 834F B1C1 <CJK>
+B1C2 990C B1C2 <CJK>
+B1C3 53E1 B1C3 <CJK>
+B1C4 55B6 B1C4 <CJK>
+B1C5 5B30 B1C5 <CJK>
+B1C6 5F71 B1C6 <CJK>
+B1C7 6620 B1C7 <CJK>
+B1C8 66F3 B1C8 <CJK>
+B1C9 6804 B1C9 <CJK>
+B1CA 6C38 B1CA <CJK>
+B1CB 6CF3 B1CB <CJK>
+B1CC 6D29 B1CC <CJK>
+B1CD 745B B1CD <CJK>
+B1CE 76C8 B1CE <CJK>
+B1CF 7A4E B1CF <CJK>
+B1D0 9834 B1D0 <CJK>
+B1D1 82F1 B1D1 <CJK>
+B1D2 885B B1D2 <CJK>
+B1D3 8A60 B1D3 <CJK>
+B1D4 92ED B1D4 <CJK>
+B1D5 6DB2 B1D5 <CJK>
+B1D6 75AB B1D6 <CJK>
+B1D7 76CA B1D7 <CJK>
+B1D8 99C5 B1D8 <CJK>
+B1D9 60A6 B1D9 <CJK>
+B1DA 8B01 B1DA <CJK>
+B1DB 8D8A B1DB <CJK>
+B1DC 95B2 B1DC <CJK>
+B1DD 698E B1DD <CJK>
+B1DE 53AD B1DE <CJK>
+B1DF 5186 B1DF <CJK>
+B1E0 5712 B1E0 <CJK>
+B1E1 5830 B1E1 <CJK>
+B1E2 5944 B1E2 <CJK>
+B1E3 5BB4 B1E3 <CJK>
+B1E4 5EF6 B1E4 <CJK>
+B1E5 6028 B1E5 <CJK>
+B1E6 63A9 B1E6 <CJK>
+B1E7 63F4 B1E7 <CJK>
+B1E8 6CBF B1E8 <CJK>
+B1E9 6F14 B1E9 <CJK>
+B1EA 708E B1EA <CJK>
+B1EB 7114 B1EB <CJK>
+B1EC 7159 B1EC <CJK>
+B1ED 71D5 B1ED <CJK>
+B1EE 733F B1EE <CJK>
+B1EF 7E01 B1EF <CJK>
+B1F0 8276 B1F0 <CJK>
+B1F1 82D1 B1F1 <CJK>
+B1F2 8597 B1F2 <CJK>
+B1F3 9060 B1F3 <CJK>
+B1F4 925B B1F4 <CJK>
+B1F5 9D1B B1F5 <CJK>
+B1F6 5869 B1F6 <CJK>
+B1F7 65BC B1F7 <CJK>
+B1F8 6C5A B1F8 <CJK>
+B1F9 7525 B1F9 <CJK>
+B1FA 51F9 B1FA <CJK>
+B1FB 592E B1FB <CJK>
+B1FC 5965 B1FC <CJK>
+B1FD 5F80 B1FD <CJK>
+B1FE 5FDC B1FE <CJK>
+B2A1 62BC B2A1 <CJK>
+B2A2 65FA B2A2 <CJK>
+B2A3 6A2A B2A3 <CJK>
+B2A4 6B27 B2A4 <CJK>
+B2A5 6BB4 B2A5 <CJK>
+B2A6 738B B2A6 <CJK>
+B2A7 7FC1 B2A7 <CJK>
+B2A8 8956 B2A8 <CJK>
+B2A9 9D2C B2A9 <CJK>
+B2AA 9D0E B2AA <CJK>
+B2AB 9EC4 B2AB <CJK>
+B2AC 5CA1 B2AC <CJK>
+B2AD 6C96 B2AD <CJK>
+B2AE 837B B2AE <CJK>
+B2AF 5104 B2AF <CJK>
+B2B0 5C4B B2B0 <CJK>
+B2B1 61B6 B2B1 <CJK>
+B2B2 81C6 B2B2 <CJK>
+B2B3 6876 B2B3 <CJK>
+B2B4 7261 B2B4 <CJK>
+B2B5 4E59 B2B5 <CJK>
+B2B6 4FFA B2B6 <CJK>
+B2B7 5378 B2B7 <CJK>
+B2B8 6069 B2B8 <CJK>
+B2B9 6E29 B2B9 <CJK>
+B2BA 7A4F B2BA <CJK>
+B2BB 97F3 B2BB <CJK>
+B2BC 4E0B B2BC <CJK>
+B2BD 5316 B2BD <CJK>
+B2BE 4EEE B2BE <CJK>
+B2BF 4F55 B2BF <CJK>
+B2C0 4F3D B2C0 <CJK>
+B2C1 4FA1 B2C1 <CJK>
+B2C2 4F73 B2C2 <CJK>
+B2C3 52A0 B2C3 <CJK>
+B2C4 53EF B2C4 <CJK>
+B2C5 5609 B2C5 <CJK>
+B2C6 590F B2C6 <CJK>
+B2C7 5AC1 B2C7 <CJK>
+B2C8 5BB6 B2C8 <CJK>
+B2C9 5BE1 B2C9 <CJK>
+B2CA 79D1 B2CA <CJK>
+B2CB 6687 B2CB <CJK>
+B2CC 679C B2CC <CJK>
+B2CD 67B6 B2CD <CJK>
+B2CE 6B4C B2CE <CJK>
+B2CF 6CB3 B2CF <CJK>
+B2D0 706B B2D0 <CJK>
+B2D1 73C2 B2D1 <CJK>
+B2D2 798D B2D2 <CJK>
+B2D3 79BE B2D3 <CJK>
+B2D4 7A3C B2D4 <CJK>
+B2D5 7B87 B2D5 <CJK>
+B2D6 82B1 B2D6 <CJK>
+B2D7 82DB B2D7 <CJK>
+B2D8 8304 B2D8 <CJK>
+B2D9 8377 B2D9 <CJK>
+B2DA 83EF B2DA <CJK>
+B2DB 83D3 B2DB <CJK>
+B2DC 8766 B2DC <CJK>
+B2DD 8AB2 B2DD <CJK>
+B2DE 5629 B2DE <CJK>
+B2DF 8CA8 B2DF <CJK>
+B2E0 8FE6 B2E0 <CJK>
+B2E1 904E B2E1 <CJK>
+B2E2 971E B2E2 <CJK>
+B2E3 868A B2E3 <CJK>
+B2E4 4FC4 B2E4 <CJK>
+B2E5 5CE8 B2E5 <CJK>
+B2E6 6211 B2E6 <CJK>
+B2E7 7259 B2E7 <CJK>
+B2E8 753B B2E8 <CJK>
+B2E9 81E5 B2E9 <CJK>
+B2EA 82BD B2EA <CJK>
+B2EB 86FE B2EB <CJK>
+B2EC 8CC0 B2EC <CJK>
+B2ED 96C5 B2ED <CJK>
+B2EE 9913 B2EE <CJK>
+B2EF 99D5 B2EF <CJK>
+B2F0 4ECB B2F0 <CJK>
+B2F1 4F1A B2F1 <CJK>
+B2F2 89E3 B2F2 <CJK>
+B2F3 56DE B2F3 <CJK>
+B2F4 584A B2F4 <CJK>
+B2F5 58CA B2F5 <CJK>
+B2F6 5EFB B2F6 <CJK>
+B2F7 5FEB B2F7 <CJK>
+B2F8 602A B2F8 <CJK>
+B2F9 6094 B2F9 <CJK>
+B2FA 6062 B2FA <CJK>
+B2FB 61D0 B2FB <CJK>
+B2FC 6212 B2FC <CJK>
+B2FD 62D0 B2FD <CJK>
+B2FE 6539 B2FE <CJK>
+B3A1 9B41 B3A1 <CJK>
+B3A2 6666 B3A2 <CJK>
+B3A3 68B0 B3A3 <CJK>
+B3A4 6D77 B3A4 <CJK>
+B3A5 7070 B3A5 <CJK>
+B3A6 754C B3A6 <CJK>
+B3A7 7686 B3A7 <CJK>
+B3A8 7D75 B3A8 <CJK>
+B3A9 82A5 B3A9 <CJK>
+B3AA 87F9 B3AA <CJK>
+B3AB 958B B3AB <CJK>
+B3AC 968E B3AC <CJK>
+B3AD 8C9D B3AD <CJK>
+B3AE 51F1 B3AE <CJK>
+B3AF 52BE B3AF <CJK>
+B3B0 5916 B3B0 <CJK>
+B3B1 54B3 B3B1 <CJK>
+B3B2 5BB3 B3B2 <CJK>
+B3B3 5D16 B3B3 <CJK>
+B3B4 6168 B3B4 <CJK>
+B3B5 6982 B3B5 <CJK>
+B3B6 6DAF B3B6 <CJK>
+B3B7 788D B3B7 <CJK>
+B3B8 84CB B3B8 <CJK>
+B3B9 8857 B3B9 <CJK>
+B3BA 8A72 B3BA <CJK>
+B3BB 93A7 B3BB <CJK>
+B3BC 9AB8 B3BC <CJK>
+B3BD 6D6C B3BD <CJK>
+B3BE 99A8 B3BE <CJK>
+B3BF 86D9 B3BF <CJK>
+B3C0 57A3 B3C0 <CJK>
+B3C1 67FF B3C1 <CJK>
+B3C2 86CE B3C2 <CJK>
+B3C3 920E B3C3 <CJK>
+B3C4 5283 B3C4 <CJK>
+B3C5 5687 B3C5 <CJK>
+B3C6 5404 B3C6 <CJK>
+B3C7 5ED3 B3C7 <CJK>
+B3C8 62E1 B3C8 <CJK>
+B3C9 64B9 B3C9 <CJK>
+B3CA 683C B3CA <CJK>
+B3CB 6838 B3CB <CJK>
+B3CC 6BBB B3CC <CJK>
+B3CD 7372 B3CD <CJK>
+B3CE 78BA B3CE <CJK>
+B3CF 7A6B B3CF <CJK>
+B3D0 899A B3D0 <CJK>
+B3D1 89D2 B3D1 <CJK>
+B3D2 8D6B B3D2 <CJK>
+B3D3 8F03 B3D3 <CJK>
+B3D4 90ED B3D4 <CJK>
+B3D5 95A3 B3D5 <CJK>
+B3D6 9694 B3D6 <CJK>
+B3D7 9769 B3D7 <CJK>
+B3D8 5B66 B3D8 <CJK>
+B3D9 5CB3 B3D9 <CJK>
+B3DA 697D B3DA <CJK>
+B3DB 984D B3DB <CJK>
+B3DC 984E B3DC <CJK>
+B3DD 639B B3DD <CJK>
+B3DE 7B20 B3DE <CJK>
+B3DF 6A2B B3DF <CJK>
+B3E0 6A7F B3E0 <CJK>
+B3E1 68B6 B3E1 <CJK>
+B3E2 9C0D B3E2 <CJK>
+B3E3 6F5F B3E3 <CJK>
+B3E4 5272 B3E4 <CJK>
+B3E5 559D B3E5 <CJK>
+B3E6 6070 B3E6 <CJK>
+B3E7 62EC B3E7 <CJK>
+B3E8 6D3B B3E8 <CJK>
+B3E9 6E07 B3E9 <CJK>
+B3EA 6ED1 B3EA <CJK>
+B3EB 845B B3EB <CJK>
+B3EC 8910 B3EC <CJK>
+B3ED 8F44 B3ED <CJK>
+B3EE 4E14 B3EE <CJK>
+B3EF 9C39 B3EF <CJK>
+B3F0 53F6 B3F0 <CJK>
+B3F1 691B B3F1 <CJK>
+B3F2 6A3A B3F2 <CJK>
+B3F3 9784 B3F3 <CJK>
+B3F4 682A B3F4 <CJK>
+B3F5 515C B3F5 <CJK>
+B3F6 7AC3 B3F6 <CJK>
+B3F7 84B2 B3F7 <CJK>
+B3F8 91DC B3F8 <CJK>
+B3F9 938C B3F9 <CJK>
+B3FA 565B B3FA <CJK>
+B3FB 9D28 B3FB <CJK>
+B3FC 6822 B3FC <CJK>
+B3FD 8305 B3FD <CJK>
+B3FE 8431 B3FE <CJK>
+B4A1 7CA5 B4A1 <CJK>
+B4A2 5208 B4A2 <CJK>
+B4A3 82C5 B4A3 <CJK>
+B4A4 74E6 B4A4 <CJK>
+B4A5 4E7E B4A5 <CJK>
+B4A6 4F83 B4A6 <CJK>
+B4A7 51A0 B4A7 <CJK>
+B4A8 5BD2 B4A8 <CJK>
+B4A9 520A B4A9 <CJK>
+B4AA 52D8 B4AA <CJK>
+B4AB 52E7 B4AB <CJK>
+B4AC 5DFB B4AC <CJK>
+B4AD 559A B4AD <CJK>
+B4AE 582A B4AE <CJK>
+B4AF 59E6 B4AF <CJK>
+B4B0 5B8C B4B0 <CJK>
+B4B1 5B98 B4B1 <CJK>
+B4B2 5BDB B4B2 <CJK>
+B4B3 5E72 B4B3 <CJK>
+B4B4 5E79 B4B4 <CJK>
+B4B5 60A3 B4B5 <CJK>
+B4B6 611F B4B6 <CJK>
+B4B7 6163 B4B7 <CJK>
+B4B8 61BE B4B8 <CJK>
+B4B9 63DB B4B9 <CJK>
+B4BA 6562 B4BA <CJK>
+B4BB 67D1 B4BB <CJK>
+B4BC 6853 B4BC <CJK>
+B4BD 68FA B4BD <CJK>
+B4BE 6B3E B4BE <CJK>
+B4BF 6B53 B4BF <CJK>
+B4C0 6C57 B4C0 <CJK>
+B4C1 6F22 B4C1 <CJK>
+B4C2 6F97 B4C2 <CJK>
+B4C3 6F45 B4C3 <CJK>
+B4C4 74B0 B4C4 <CJK>
+B4C5 7518 B4C5 <CJK>
+B4C6 76E3 B4C6 <CJK>
+B4C7 770B B4C7 <CJK>
+B4C8 7AFF B4C8 <CJK>
+B4C9 7BA1 B4C9 <CJK>
+B4CA 7C21 B4CA <CJK>
+B4CB 7DE9 B4CB <CJK>
+B4CC 7F36 B4CC <CJK>
+B4CD 7FF0 B4CD <CJK>
+B4CE 809D B4CE <CJK>
+B4CF 8266 B4CF <CJK>
+B4D0 839E B4D0 <CJK>
+B4D1 89B3 B4D1 <CJK>
+B4D2 8ACC B4D2 <CJK>
+B4D3 8CAB B4D3 <CJK>
+B4D4 9084 B4D4 <CJK>
+B4D5 9451 B4D5 <CJK>
+B4D6 9593 B4D6 <CJK>
+B4D7 9591 B4D7 <CJK>
+B4D8 95A2 B4D8 <CJK>
+B4D9 9665 B4D9 <CJK>
+B4DA 97D3 B4DA <CJK>
+B4DB 9928 B4DB <CJK>
+B4DC 8218 B4DC <CJK>
+B4DD 4E38 B4DD <CJK>
+B4DE 542B B4DE <CJK>
+B4DF 5CB8 B4DF <CJK>
+B4E0 5DCC B4E0 <CJK>
+B4E1 73A9 B4E1 <CJK>
+B4E2 764C B4E2 <CJK>
+B4E3 773C B4E3 <CJK>
+B4E4 5CA9 B4E4 <CJK>
+B4E5 7FEB B4E5 <CJK>
+B4E6 8D0B B4E6 <CJK>
+B4E7 96C1 B4E7 <CJK>
+B4E8 9811 B4E8 <CJK>
+B4E9 9854 B4E9 <CJK>
+B4EA 9858 B4EA <CJK>
+B4EB 4F01 B4EB <CJK>
+B4EC 4F0E B4EC <CJK>
+B4ED 5371 B4ED <CJK>
+B4EE 559C B4EE <CJK>
+B4EF 5668 B4EF <CJK>
+B4F0 57FA B4F0 <CJK>
+B4F1 5947 B4F1 <CJK>
+B4F2 5B09 B4F2 <CJK>
+B4F3 5BC4 B4F3 <CJK>
+B4F4 5C90 B4F4 <CJK>
+B4F5 5E0C B4F5 <CJK>
+B4F6 5E7E B4F6 <CJK>
+B4F7 5FCC B4F7 <CJK>
+B4F8 63EE B4F8 <CJK>
+B4F9 673A B4F9 <CJK>
+B4FA 65D7 B4FA <CJK>
+B4FB 65E2 B4FB <CJK>
+B4FC 671F B4FC <CJK>
+B4FD 68CB B4FD <CJK>
+B4FE 68C4 B4FE <CJK>
+B5A1 6A5F B5A1 <CJK>
+B5A2 5E30 B5A2 <CJK>
+B5A3 6BC5 B5A3 <CJK>
+B5A4 6C17 B5A4 <CJK>
+B5A5 6C7D B5A5 <CJK>
+B5A6 757F B5A6 <CJK>
+B5A7 7948 B5A7 <CJK>
+B5A8 5B63 B5A8 <CJK>
+B5A9 7A00 B5A9 <CJK>
+B5AA 7D00 B5AA <CJK>
+B5AB 5FBD B5AB <CJK>
+B5AC 898F B5AC <CJK>
+B5AD 8A18 B5AD <CJK>
+B5AE 8CB4 B5AE <CJK>
+B5AF 8D77 B5AF <CJK>
+B5B0 8ECC B5B0 <CJK>
+B5B1 8F1D B5B1 <CJK>
+B5B2 98E2 B5B2 <CJK>
+B5B3 9A0E B5B3 <CJK>
+B5B4 9B3C B5B4 <CJK>
+B5B5 4E80 B5B5 <CJK>
+B5B6 507D B5B6 <CJK>
+B5B7 5100 B5B7 <CJK>
+B5B8 5993 B5B8 <CJK>
+B5B9 5B9C B5B9 <CJK>
+B5BA 622F B5BA <CJK>
+B5BB 6280 B5BB <CJK>
+B5BC 64EC B5BC <CJK>
+B5BD 6B3A B5BD <CJK>
+B5BE 72A0 B5BE <CJK>
+B5BF 7591 B5BF <CJK>
+B5C0 7947 B5C0 <CJK>
+B5C1 7FA9 B5C1 <CJK>
+B5C2 87FB B5C2 <CJK>
+B5C3 8ABC B5C3 <CJK>
+B5C4 8B70 B5C4 <CJK>
+B5C5 63AC B5C5 <CJK>
+B5C6 83CA B5C6 <CJK>
+B5C7 97A0 B5C7 <CJK>
+B5C8 5409 B5C8 <CJK>
+B5C9 5403 B5C9 <CJK>
+B5CA 55AB B5CA <CJK>
+B5CB 6854 B5CB <CJK>
+B5CC 6A58 B5CC <CJK>
+B5CD 8A70 B5CD <CJK>
+B5CE 7827 B5CE <CJK>
+B5CF 6775 B5CF <CJK>
+B5D0 9ECD B5D0 <CJK>
+B5D1 5374 B5D1 <CJK>
+B5D2 5BA2 B5D2 <CJK>
+B5D3 811A B5D3 <CJK>
+B5D4 8650 B5D4 <CJK>
+B5D5 9006 B5D5 <CJK>
+B5D6 4E18 B5D6 <CJK>
+B5D7 4E45 B5D7 <CJK>
+B5D8 4EC7 B5D8 <CJK>
+B5D9 4F11 B5D9 <CJK>
+B5DA 53CA B5DA <CJK>
+B5DB 5438 B5DB <CJK>
+B5DC 5BAE B5DC <CJK>
+B5DD 5F13 B5DD <CJK>
+B5DE 6025 B5DE <CJK>
+B5DF 6551 B5DF <CJK>
+B5E0 673D B5E0 <CJK>
+B5E1 6C42 B5E1 <CJK>
+B5E2 6C72 B5E2 <CJK>
+B5E3 6CE3 B5E3 <CJK>
+B5E4 7078 B5E4 <CJK>
+B5E5 7403 B5E5 <CJK>
+B5E6 7A76 B5E6 <CJK>
+B5E7 7AAE B5E7 <CJK>
+B5E8 7B08 B5E8 <CJK>
+B5E9 7D1A B5E9 <CJK>
+B5EA 7CFE B5EA <CJK>
+B5EB 7D66 B5EB <CJK>
+B5EC 65E7 B5EC <CJK>
+B5ED 725B B5ED <CJK>
+B5EE 53BB B5EE <CJK>
+B5EF 5C45 B5EF <CJK>
+B5F0 5DE8 B5F0 <CJK>
+B5F1 62D2 B5F1 <CJK>
+B5F2 62E0 B5F2 <CJK>
+B5F3 6319 B5F3 <CJK>
+B5F4 6E20 B5F4 <CJK>
+B5F5 865A B5F5 <CJK>
+B5F6 8A31 B5F6 <CJK>
+B5F7 8DDD B5F7 <CJK>
+B5F8 92F8 B5F8 <CJK>
+B5F9 6F01 B5F9 <CJK>
+B5FA 79A6 B5FA <CJK>
+B5FB 9B5A B5FB <CJK>
+B5FC 4EA8 B5FC <CJK>
+B5FD 4EAB B5FD <CJK>
+B5FE 4EAC B5FE <CJK>
+B6A1 4F9B B6A1 <CJK>
+B6A2 4FA0 B6A2 <CJK>
+B6A3 50D1 B6A3 <CJK>
+B6A4 5147 B6A4 <CJK>
+B6A5 7AF6 B6A5 <CJK>
+B6A6 5171 B6A6 <CJK>
+B6A7 51F6 B6A7 <CJK>
+B6A8 5354 B6A8 <CJK>
+B6A9 5321 B6A9 <CJK>
+B6AA 537F B6AA <CJK>
+B6AB 53EB B6AB <CJK>
+B6AC 55AC B6AC <CJK>
+B6AD 5883 B6AD <CJK>
+B6AE 5CE1 B6AE <CJK>
+B6AF 5F37 B6AF <CJK>
+B6B0 5F4A B6B0 <CJK>
+B6B1 602F B6B1 <CJK>
+B6B2 6050 B6B2 <CJK>
+B6B3 606D B6B3 <CJK>
+B6B4 631F B6B4 <CJK>
+B6B5 6559 B6B5 <CJK>
+B6B6 6A4B B6B6 <CJK>
+B6B7 6CC1 B6B7 <CJK>
+B6B8 72C2 B6B8 <CJK>
+B6B9 72ED B6B9 <CJK>
+B6BA 77EF B6BA <CJK>
+B6BB 80F8 B6BB <CJK>
+B6BC 8105 B6BC <CJK>
+B6BD 8208 B6BD <CJK>
+B6BE 854E B6BE <CJK>
+B6BF 90F7 B6BF <CJK>
+B6C0 93E1 B6C0 <CJK>
+B6C1 97FF B6C1 <CJK>
+B6C2 9957 B6C2 <CJK>
+B6C3 9A5A B6C3 <CJK>
+B6C4 4EF0 B6C4 <CJK>
+B6C5 51DD B6C5 <CJK>
+B6C6 5C2D B6C6 <CJK>
+B6C7 6681 B6C7 <CJK>
+B6C8 696D B6C8 <CJK>
+B6C9 5C40 B6C9 <CJK>
+B6CA 66F2 B6CA <CJK>
+B6CB 6975 B6CB <CJK>
+B6CC 7389 B6CC <CJK>
+B6CD 6850 B6CD <CJK>
+B6CE 7C81 B6CE <CJK>
+B6CF 50C5 B6CF <CJK>
+B6D0 52E4 B6D0 <CJK>
+B6D1 5747 B6D1 <CJK>
+B6D2 5DFE B6D2 <CJK>
+B6D3 9326 B6D3 <CJK>
+B6D4 65A4 B6D4 <CJK>
+B6D5 6B23 B6D5 <CJK>
+B6D6 6B3D B6D6 <CJK>
+B6D7 7434 B6D7 <CJK>
+B6D8 7981 B6D8 <CJK>
+B6D9 79BD B6D9 <CJK>
+B6DA 7B4B B6DA <CJK>
+B6DB 7DCA B6DB <CJK>
+B6DC 82B9 B6DC <CJK>
+B6DD 83CC B6DD <CJK>
+B6DE 887F B6DE <CJK>
+B6DF 895F B6DF <CJK>
+B6E0 8B39 B6E0 <CJK>
+B6E1 8FD1 B6E1 <CJK>
+B6E2 91D1 B6E2 <CJK>
+B6E3 541F B6E3 <CJK>
+B6E4 9280 B6E4 <CJK>
+B6E5 4E5D B6E5 <CJK>
+B6E6 5036 B6E6 <CJK>
+B6E7 53E5 B6E7 <CJK>
+B6E8 533A B6E8 <CJK>
+B6E9 72D7 B6E9 <CJK>
+B6EA 7396 B6EA <CJK>
+B6EB 77E9 B6EB <CJK>
+B6EC 82E6 B6EC <CJK>
+B6ED 8EAF B6ED <CJK>
+B6EE 99C6 B6EE <CJK>
+B6EF 99C8 B6EF <CJK>
+B6F0 99D2 B6F0 <CJK>
+B6F1 5177 B6F1 <CJK>
+B6F2 611A B6F2 <CJK>
+B6F3 865E B6F3 <CJK>
+B6F4 55B0 B6F4 <CJK>
+B6F5 7A7A B6F5 <CJK>
+B6F6 5076 B6F6 <CJK>
+B6F7 5BD3 B6F7 <CJK>
+B6F8 9047 B6F8 <CJK>
+B6F9 9685 B6F9 <CJK>
+B6FA 4E32 B6FA <CJK>
+B6FB 6ADB B6FB <CJK>
+B6FC 91E7 B6FC <CJK>
+B6FD 5C51 B6FD <CJK>
+B6FE 5C48 B6FE <CJK>
+B7A1 6398 B7A1 <CJK>
+B7A2 7A9F B7A2 <CJK>
+B7A3 6C93 B7A3 <CJK>
+B7A4 9774 B7A4 <CJK>
+B7A5 8F61 B7A5 <CJK>
+B7A6 7AAA B7A6 <CJK>
+B7A7 718A B7A7 <CJK>
+B7A8 9688 B7A8 <CJK>
+B7A9 7C82 B7A9 <CJK>
+B7AA 6817 B7AA <CJK>
+B7AB 7E70 B7AB <CJK>
+B7AC 6851 B7AC <CJK>
+B7AD 936C B7AD <CJK>
+B7AE 52F2 B7AE <CJK>
+B7AF 541B B7AF <CJK>
+B7B0 85AB B7B0 <CJK>
+B7B1 8A13 B7B1 <CJK>
+B7B2 7FA4 B7B2 <CJK>
+B7B3 8ECD B7B3 <CJK>
+B7B4 90E1 B7B4 <CJK>
+B7B5 5366 B7B5 <CJK>
+B7B6 8888 B7B6 <CJK>
+B7B7 7941 B7B7 <CJK>
+B7B8 4FC2 B7B8 <CJK>
+B7B9 50BE B7B9 <CJK>
+B7BA 5211 B7BA <CJK>
+B7BB 5144 B7BB <CJK>
+B7BC 5553 B7BC <CJK>
+B7BD 572D B7BD <CJK>
+B7BE 73EA B7BE <CJK>
+B7BF 578B B7BF <CJK>
+B7C0 5951 B7C0 <CJK>
+B7C1 5F62 B7C1 <CJK>
+B7C2 5F84 B7C2 <CJK>
+B7C3 6075 B7C3 <CJK>
+B7C4 6176 B7C4 <CJK>
+B7C5 6167 B7C5 <CJK>
+B7C6 61A9 B7C6 <CJK>
+B7C7 63B2 B7C7 <CJK>
+B7C8 643A B7C8 <CJK>
+B7C9 656C B7C9 <CJK>
+B7CA 666F B7CA <CJK>
+B7CB 6842 B7CB <CJK>
+B7CC 6E13 B7CC <CJK>
+B7CD 7566 B7CD <CJK>
+B7CE 7A3D B7CE <CJK>
+B7CF 7CFB B7CF <CJK>
+B7D0 7D4C B7D0 <CJK>
+B7D1 7D99 B7D1 <CJK>
+B7D2 7E4B B7D2 <CJK>
+B7D3 7F6B B7D3 <CJK>
+B7D4 830E B7D4 <CJK>
+B7D5 834A B7D5 <CJK>
+B7D6 86CD B7D6 <CJK>
+B7D7 8A08 B7D7 <CJK>
+B7D8 8A63 B7D8 <CJK>
+B7D9 8B66 B7D9 <CJK>
+B7DA 8EFD B7DA <CJK>
+B7DB 981A B7DB <CJK>
+B7DC 9D8F B7DC <CJK>
+B7DD 82B8 B7DD <CJK>
+B7DE 8FCE B7DE <CJK>
+B7DF 9BE8 B7DF <CJK>
+B7E0 5287 B7E0 <CJK>
+B7E1 621F B7E1 <CJK>
+B7E2 6483 B7E2 <CJK>
+B7E3 6FC0 B7E3 <CJK>
+B7E4 9699 B7E4 <CJK>
+B7E5 6841 B7E5 <CJK>
+B7E6 5091 B7E6 <CJK>
+B7E7 6B20 B7E7 <CJK>
+B7E8 6C7A B7E8 <CJK>
+B7E9 6F54 B7E9 <CJK>
+B7EA 7A74 B7EA <CJK>
+B7EB 7D50 B7EB <CJK>
+B7EC 8840 B7EC <CJK>
+B7ED 8A23 B7ED <CJK>
+B7EE 6708 B7EE <CJK>
+B7EF 4EF6 B7EF <CJK>
+B7F0 5039 B7F0 <CJK>
+B7F1 5026 B7F1 <CJK>
+B7F2 5065 B7F2 <CJK>
+B7F3 517C B7F3 <CJK>
+B7F4 5238 B7F4 <CJK>
+B7F5 5263 B7F5 <CJK>
+B7F6 55A7 B7F6 <CJK>
+B7F7 570F B7F7 <CJK>
+B7F8 5805 B7F8 <CJK>
+B7F9 5ACC B7F9 <CJK>
+B7FA 5EFA B7FA <CJK>
+B7FB 61B2 B7FB <CJK>
+B7FC 61F8 B7FC <CJK>
+B7FD 62F3 B7FD <CJK>
+B7FE 6372 B7FE <CJK>
+B8A1 691C B8A1 <CJK>
+B8A2 6A29 B8A2 <CJK>
+B8A3 727D B8A3 <CJK>
+B8A4 72AC B8A4 <CJK>
+B8A5 732E B8A5 <CJK>
+B8A6 7814 B8A6 <CJK>
+B8A7 786F B8A7 <CJK>
+B8A8 7D79 B8A8 <CJK>
+B8A9 770C B8A9 <CJK>
+B8AA 80A9 B8AA <CJK>
+B8AB 898B B8AB <CJK>
+B8AC 8B19 B8AC <CJK>
+B8AD 8CE2 B8AD <CJK>
+B8AE 8ED2 B8AE <CJK>
+B8AF 9063 B8AF <CJK>
+B8B0 9375 B8B0 <CJK>
+B8B1 967A B8B1 <CJK>
+B8B2 9855 B8B2 <CJK>
+B8B3 9A13 B8B3 <CJK>
+B8B4 9E78 B8B4 <CJK>
+B8B5 5143 B8B5 <CJK>
+B8B6 539F B8B6 <CJK>
+B8B7 53B3 B8B7 <CJK>
+B8B8 5E7B B8B8 <CJK>
+B8B9 5F26 B8B9 <CJK>
+B8BA 6E1B B8BA <CJK>
+B8BB 6E90 B8BB <CJK>
+B8BC 7384 B8BC <CJK>
+B8BD 73FE B8BD <CJK>
+B8BE 7D43 B8BE <CJK>
+B8BF 8237 B8BF <CJK>
+B8C0 8A00 B8C0 <CJK>
+B8C1 8AFA B8C1 <CJK>
+B8C2 9650 B8C2 <CJK>
+B8C3 4E4E B8C3 <CJK>
+B8C4 500B B8C4 <CJK>
+B8C5 53E4 B8C5 <CJK>
+B8C6 547C B8C6 <CJK>
+B8C7 56FA B8C7 <CJK>
+B8C8 59D1 B8C8 <CJK>
+B8C9 5B64 B8C9 <CJK>
+B8CA 5DF1 B8CA <CJK>
+B8CB 5EAB B8CB <CJK>
+B8CC 5F27 B8CC <CJK>
+B8CD 6238 B8CD <CJK>
+B8CE 6545 B8CE <CJK>
+B8CF 67AF B8CF <CJK>
+B8D0 6E56 B8D0 <CJK>
+B8D1 72D0 B8D1 <CJK>
+B8D2 7CCA B8D2 <CJK>
+B8D3 88B4 B8D3 <CJK>
+B8D4 80A1 B8D4 <CJK>
+B8D5 80E1 B8D5 <CJK>
+B8D6 83F0 B8D6 <CJK>
+B8D7 864E B8D7 <CJK>
+B8D8 8A87 B8D8 <CJK>
+B8D9 8DE8 B8D9 <CJK>
+B8DA 9237 B8DA <CJK>
+B8DB 96C7 B8DB <CJK>
+B8DC 9867 B8DC <CJK>
+B8DD 9F13 B8DD <CJK>
+B8DE 4E94 B8DE <CJK>
+B8DF 4E92 B8DF <CJK>
+B8E0 4F0D B8E0 <CJK>
+B8E1 5348 B8E1 <CJK>
+B8E2 5449 B8E2 <CJK>
+B8E3 543E B8E3 <CJK>
+B8E4 5A2F B8E4 <CJK>
+B8E5 5F8C B8E5 <CJK>
+B8E6 5FA1 B8E6 <CJK>
+B8E7 609F B8E7 <CJK>
+B8E8 68A7 B8E8 <CJK>
+B8E9 6A8E B8E9 <CJK>
+B8EA 745A B8EA <CJK>
+B8EB 7881 B8EB <CJK>
+B8EC 8A9E B8EC <CJK>
+B8ED 8AA4 B8ED <CJK>
+B8EE 8B77 B8EE <CJK>
+B8EF 9190 B8EF <CJK>
+B8F0 4E5E B8F0 <CJK>
+B8F1 9BC9 B8F1 <CJK>
+B8F2 4EA4 B8F2 <CJK>
+B8F3 4F7C B8F3 <CJK>
+B8F4 4FAF B8F4 <CJK>
+B8F5 5019 B8F5 <CJK>
+B8F6 5016 B8F6 <CJK>
+B8F7 5149 B8F7 <CJK>
+B8F8 516C B8F8 <CJK>
+B8F9 529F B8F9 <CJK>
+B8FA 52B9 B8FA <CJK>
+B8FB 52FE B8FB <CJK>
+B8FC 539A B8FC <CJK>
+B8FD 53E3 B8FD <CJK>
+B8FE 5411 B8FE <CJK>
+B9A1 540E B9A1 <CJK>
+B9A2 5589 B9A2 <CJK>
+B9A3 5751 B9A3 <CJK>
+B9A4 57A2 B9A4 <CJK>
+B9A5 597D B9A5 <CJK>
+B9A6 5B54 B9A6 <CJK>
+B9A7 5B5D B9A7 <CJK>
+B9A8 5B8F B9A8 <CJK>
+B9A9 5DE5 B9A9 <CJK>
+B9AA 5DE7 B9AA <CJK>
+B9AB 5DF7 B9AB <CJK>
+B9AC 5E78 B9AC <CJK>
+B9AD 5E83 B9AD <CJK>
+B9AE 5E9A B9AE <CJK>
+B9AF 5EB7 B9AF <CJK>
+B9B0 5F18 B9B0 <CJK>
+B9B1 6052 B9B1 <CJK>
+B9B2 614C B9B2 <CJK>
+B9B3 6297 B9B3 <CJK>
+B9B4 62D8 B9B4 <CJK>
+B9B5 63A7 B9B5 <CJK>
+B9B6 653B B9B6 <CJK>
+B9B7 6602 B9B7 <CJK>
+B9B8 6643 B9B8 <CJK>
+B9B9 66F4 B9B9 <CJK>
+B9BA 676D B9BA <CJK>
+B9BB 6821 B9BB <CJK>
+B9BC 6897 B9BC <CJK>
+B9BD 69CB B9BD <CJK>
+B9BE 6C5F B9BE <CJK>
+B9BF 6D2A B9BF <CJK>
+B9C0 6D69 B9C0 <CJK>
+B9C1 6E2F B9C1 <CJK>
+B9C2 6E9D B9C2 <CJK>
+B9C3 7532 B9C3 <CJK>
+B9C4 7687 B9C4 <CJK>
+B9C5 786C B9C5 <CJK>
+B9C6 7A3F B9C6 <CJK>
+B9C7 7CE0 B9C7 <CJK>
+B9C8 7D05 B9C8 <CJK>
+B9C9 7D18 B9C9 <CJK>
+B9CA 7D5E B9CA <CJK>
+B9CB 7DB1 B9CB <CJK>
+B9CC 8015 B9CC <CJK>
+B9CD 8003 B9CD <CJK>
+B9CE 80AF B9CE <CJK>
+B9CF 80B1 B9CF <CJK>
+B9D0 8154 B9D0 <CJK>
+B9D1 818F B9D1 <CJK>
+B9D2 822A B9D2 <CJK>
+B9D3 8352 B9D3 <CJK>
+B9D4 884C B9D4 <CJK>
+B9D5 8861 B9D5 <CJK>
+B9D6 8B1B B9D6 <CJK>
+B9D7 8CA2 B9D7 <CJK>
+B9D8 8CFC B9D8 <CJK>
+B9D9 90CA B9D9 <CJK>
+B9DA 9175 B9DA <CJK>
+B9DB 9271 B9DB <CJK>
+B9DC 783F B9DC <CJK>
+B9DD 92FC B9DD <CJK>
+B9DE 95A4 B9DE <CJK>
+B9DF 964D B9DF <CJK>
+B9E0 9805 B9E0 <CJK>
+B9E1 9999 B9E1 <CJK>
+B9E2 9AD8 B9E2 <CJK>
+B9E3 9D3B B9E3 <CJK>
+B9E4 525B B9E4 <CJK>
+B9E5 52AB B9E5 <CJK>
+B9E6 53F7 B9E6 <CJK>
+B9E7 5408 B9E7 <CJK>
+B9E8 58D5 B9E8 <CJK>
+B9E9 62F7 B9E9 <CJK>
+B9EA 6FE0 B9EA <CJK>
+B9EB 8C6A B9EB <CJK>
+B9EC 8F5F B9EC <CJK>
+B9ED 9EB9 B9ED <CJK>
+B9EE 514B B9EE <CJK>
+B9EF 523B B9EF <CJK>
+B9F0 544A B9F0 <CJK>
+B9F1 56FD B9F1 <CJK>
+B9F2 7A40 B9F2 <CJK>
+B9F3 9177 B9F3 <CJK>
+B9F4 9D60 B9F4 <CJK>
+B9F5 9ED2 B9F5 <CJK>
+B9F6 7344 B9F6 <CJK>
+B9F7 6F09 B9F7 <CJK>
+B9F8 8170 B9F8 <CJK>
+B9F9 7511 B9F9 <CJK>
+B9FA 5FFD B9FA <CJK>
+B9FB 60DA B9FB <CJK>
+B9FC 9AA8 B9FC <CJK>
+B9FD 72DB B9FD <CJK>
+B9FE 8FBC B9FE <CJK>
+BAA1 6B64 BAA1 <CJK>
+BAA2 9803 BAA2 <CJK>
+BAA3 4ECA BAA3 <CJK>
+BAA4 56F0 BAA4 <CJK>
+BAA5 5764 BAA5 <CJK>
+BAA6 58BE BAA6 <CJK>
+BAA7 5A5A BAA7 <CJK>
+BAA8 6068 BAA8 <CJK>
+BAA9 61C7 BAA9 <CJK>
+BAAA 660F BAAA <CJK>
+BAAB 6606 BAAB <CJK>
+BAAC 6839 BAAC <CJK>
+BAAD 68B1 BAAD <CJK>
+BAAE 6DF7 BAAE <CJK>
+BAAF 75D5 BAAF <CJK>
+BAB0 7D3A BAB0 <CJK>
+BAB1 826E BAB1 <CJK>
+BAB2 9B42 BAB2 <CJK>
+BAB3 4E9B BAB3 <CJK>
+BAB4 4F50 BAB4 <CJK>
+BAB5 53C9 BAB5 <CJK>
+BAB6 5506 BAB6 <CJK>
+BAB7 5D6F BAB7 <CJK>
+BAB8 5DE6 BAB8 <CJK>
+BAB9 5DEE BAB9 <CJK>
+BABA 67FB BABA <CJK>
+BABB 6C99 BABB <CJK>
+BABC 7473 BABC <CJK>
+BABD 7802 BABD <CJK>
+BABE 8A50 BABE <CJK>
+BABF 9396 BABF <CJK>
+BAC0 88DF BAC0 <CJK>
+BAC1 5750 BAC1 <CJK>
+BAC2 5EA7 BAC2 <CJK>
+BAC3 632B BAC3 <CJK>
+BAC4 50B5 BAC4 <CJK>
+BAC5 50AC BAC5 <CJK>
+BAC6 518D BAC6 <CJK>
+BAC7 6700 BAC7 <CJK>
+BAC8 54C9 BAC8 <CJK>
+BAC9 585E BAC9 <CJK>
+BACA 59BB BACA <CJK>
+BACB 5BB0 BACB <CJK>
+BACC 5F69 BACC <CJK>
+BACD 624D BACD <CJK>
+BACE 63A1 BACE <CJK>
+BACF 683D BACF <CJK>
+BAD0 6B73 BAD0 <CJK>
+BAD1 6E08 BAD1 <CJK>
+BAD2 707D BAD2 <CJK>
+BAD3 91C7 BAD3 <CJK>
+BAD4 7280 BAD4 <CJK>
+BAD5 7815 BAD5 <CJK>
+BAD6 7826 BAD6 <CJK>
+BAD7 796D BAD7 <CJK>
+BAD8 658E BAD8 <CJK>
+BAD9 7D30 BAD9 <CJK>
+BADA 83DC BADA <CJK>
+BADB 88C1 BADB <CJK>
+BADC 8F09 BADC <CJK>
+BADD 969B BADD <CJK>
+BADE 5264 BADE <CJK>
+BADF 5728 BADF <CJK>
+BAE0 6750 BAE0 <CJK>
+BAE1 7F6A BAE1 <CJK>
+BAE2 8CA1 BAE2 <CJK>
+BAE3 51B4 BAE3 <CJK>
+BAE4 5742 BAE4 <CJK>
+BAE5 962A BAE5 <CJK>
+BAE6 583A BAE6 <CJK>
+BAE7 698A BAE7 <CJK>
+BAE8 80B4 BAE8 <CJK>
+BAE9 54B2 BAE9 <CJK>
+BAEA 5D0E BAEA <CJK>
+BAEB 57FC BAEB <CJK>
+BAEC 7895 BAEC <CJK>
+BAED 9DFA BAED <CJK>
+BAEE 4F5C BAEE <CJK>
+BAEF 524A BAEF <CJK>
+BAF0 548B BAF0 <CJK>
+BAF1 643E BAF1 <CJK>
+BAF2 6628 BAF2 <CJK>
+BAF3 6714 BAF3 <CJK>
+BAF4 67F5 BAF4 <CJK>
+BAF5 7A84 BAF5 <CJK>
+BAF6 7B56 BAF6 <CJK>
+BAF7 7D22 BAF7 <CJK>
+BAF8 932F BAF8 <CJK>
+BAF9 685C BAF9 <CJK>
+BAFA 9BAD BAFA <CJK>
+BAFB 7B39 BAFB <CJK>
+BAFC 5319 BAFC <CJK>
+BAFD 518A BAFD <CJK>
+BAFE 5237 BAFE <CJK>
+BBA1 5BDF BBA1 <CJK>
+BBA2 62F6 BBA2 <CJK>
+BBA3 64AE BBA3 <CJK>
+BBA4 64E6 BBA4 <CJK>
+BBA5 672D BBA5 <CJK>
+BBA6 6BBA BBA6 <CJK>
+BBA7 85A9 BBA7 <CJK>
+BBA8 96D1 BBA8 <CJK>
+BBA9 7690 BBA9 <CJK>
+BBAA 9BD6 BBAA <CJK>
+BBAB 634C BBAB <CJK>
+BBAC 9306 BBAC <CJK>
+BBAD 9BAB BBAD <CJK>
+BBAE 76BF BBAE <CJK>
+BBAF 6652 BBAF <CJK>
+BBB0 4E09 BBB0 <CJK>
+BBB1 5098 BBB1 <CJK>
+BBB2 53C2 BBB2 <CJK>
+BBB3 5C71 BBB3 <CJK>
+BBB4 60E8 BBB4 <CJK>
+BBB5 6492 BBB5 <CJK>
+BBB6 6563 BBB6 <CJK>
+BBB7 685F BBB7 <CJK>
+BBB8 71E6 BBB8 <CJK>
+BBB9 73CA BBB9 <CJK>
+BBBA 7523 BBBA <CJK>
+BBBB 7B97 BBBB <CJK>
+BBBC 7E82 BBBC <CJK>
+BBBD 8695 BBBD <CJK>
+BBBE 8B83 BBBE <CJK>
+BBBF 8CDB BBBF <CJK>
+BBC0 9178 BBC0 <CJK>
+BBC1 9910 BBC1 <CJK>
+BBC2 65AC BBC2 <CJK>
+BBC3 66AB BBC3 <CJK>
+BBC4 6B8B BBC4 <CJK>
+BBC5 4ED5 BBC5 <CJK>
+BBC6 4ED4 BBC6 <CJK>
+BBC7 4F3A BBC7 <CJK>
+BBC8 4F7F BBC8 <CJK>
+BBC9 523A BBC9 <CJK>
+BBCA 53F8 BBCA <CJK>
+BBCB 53F2 BBCB <CJK>
+BBCC 55E3 BBCC <CJK>
+BBCD 56DB BBCD <CJK>
+BBCE 58EB BBCE <CJK>
+BBCF 59CB BBCF <CJK>
+BBD0 59C9 BBD0 <CJK>
+BBD1 59FF BBD1 <CJK>
+BBD2 5B50 BBD2 <CJK>
+BBD3 5C4D BBD3 <CJK>
+BBD4 5E02 BBD4 <CJK>
+BBD5 5E2B BBD5 <CJK>
+BBD6 5FD7 BBD6 <CJK>
+BBD7 601D BBD7 <CJK>
+BBD8 6307 BBD8 <CJK>
+BBD9 652F BBD9 <CJK>
+BBDA 5B5C BBDA <CJK>
+BBDB 65AF BBDB <CJK>
+BBDC 65BD BBDC <CJK>
+BBDD 65E8 BBDD <CJK>
+BBDE 679D BBDE <CJK>
+BBDF 6B62 BBDF <CJK>
+BBE0 6B7B BBE0 <CJK>
+BBE1 6C0F BBE1 <CJK>
+BBE2 7345 BBE2 <CJK>
+BBE3 7949 BBE3 <CJK>
+BBE4 79C1 BBE4 <CJK>
+BBE5 7CF8 BBE5 <CJK>
+BBE6 7D19 BBE6 <CJK>
+BBE7 7D2B BBE7 <CJK>
+BBE8 80A2 BBE8 <CJK>
+BBE9 8102 BBE9 <CJK>
+BBEA 81F3 BBEA <CJK>
+BBEB 8996 BBEB <CJK>
+BBEC 8A5E BBEC <CJK>
+BBED 8A69 BBED <CJK>
+BBEE 8A66 BBEE <CJK>
+BBEF 8A8C BBEF <CJK>
+BBF0 8AEE BBF0 <CJK>
+BBF1 8CC7 BBF1 <CJK>
+BBF2 8CDC BBF2 <CJK>
+BBF3 96CC BBF3 <CJK>
+BBF4 98FC BBF4 <CJK>
+BBF5 6B6F BBF5 <CJK>
+BBF6 4E8B BBF6 <CJK>
+BBF7 4F3C BBF7 <CJK>
+BBF8 4F8D BBF8 <CJK>
+BBF9 5150 BBF9 <CJK>
+BBFA 5B57 BBFA <CJK>
+BBFB 5BFA BBFB <CJK>
+BBFC 6148 BBFC <CJK>
+BBFD 6301 BBFD <CJK>
+BBFE 6642 BBFE <CJK>
+BCA1 6B21 BCA1 <CJK>
+BCA2 6ECB BCA2 <CJK>
+BCA3 6CBB BCA3 <CJK>
+BCA4 723E BCA4 <CJK>
+BCA5 74BD BCA5 <CJK>
+BCA6 75D4 BCA6 <CJK>
+BCA7 78C1 BCA7 <CJK>
+BCA8 793A BCA8 <CJK>
+BCA9 800C BCA9 <CJK>
+BCAA 8033 BCAA <CJK>
+BCAB 81EA BCAB <CJK>
+BCAC 8494 BCAC <CJK>
+BCAD 8F9E BCAD <CJK>
+BCAE 6C50 BCAE <CJK>
+BCAF 9E7F BCAF <CJK>
+BCB0 5F0F BCB0 <CJK>
+BCB1 8B58 BCB1 <CJK>
+BCB2 9D2B BCB2 <CJK>
+BCB3 7AFA BCB3 <CJK>
+BCB4 8EF8 BCB4 <CJK>
+BCB5 5B8D BCB5 <CJK>
+BCB6 96EB BCB6 <CJK>
+BCB7 4E03 BCB7 <CJK>
+BCB8 53F1 BCB8 <CJK>
+BCB9 57F7 BCB9 <CJK>
+BCBA 5931 BCBA <CJK>
+BCBB 5AC9 BCBB <CJK>
+BCBC 5BA4 BCBC <CJK>
+BCBD 6089 BCBD <CJK>
+BCBE 6E7F BCBE <CJK>
+BCBF 6F06 BCBF <CJK>
+BCC0 75BE BCC0 <CJK>
+BCC1 8CEA BCC1 <CJK>
+BCC2 5B9F BCC2 <CJK>
+BCC3 8500 BCC3 <CJK>
+BCC4 7BE0 BCC4 <CJK>
+BCC5 5072 BCC5 <CJK>
+BCC6 67F4 BCC6 <CJK>
+BCC7 829D BCC7 <CJK>
+BCC8 5C61 BCC8 <CJK>
+BCC9 854A BCC9 <CJK>
+BCCA 7E1E BCCA <CJK>
+BCCB 820E BCCB <CJK>
+BCCC 5199 BCCC <CJK>
+BCCD 5C04 BCCD <CJK>
+BCCE 6368 BCCE <CJK>
+BCCF 8D66 BCCF <CJK>
+BCD0 659C BCD0 <CJK>
+BCD1 716E BCD1 <CJK>
+BCD2 793E BCD2 <CJK>
+BCD3 7D17 BCD3 <CJK>
+BCD4 8005 BCD4 <CJK>
+BCD5 8B1D BCD5 <CJK>
+BCD6 8ECA BCD6 <CJK>
+BCD7 906E BCD7 <CJK>
+BCD8 86C7 BCD8 <CJK>
+BCD9 90AA BCD9 <CJK>
+BCDA 501F BCDA <CJK>
+BCDB 52FA BCDB <CJK>
+BCDC 5C3A BCDC <CJK>
+BCDD 6753 BCDD <CJK>
+BCDE 707C BCDE <CJK>
+BCDF 7235 BCDF <CJK>
+BCE0 914C BCE0 <CJK>
+BCE1 91C8 BCE1 <CJK>
+BCE2 932B BCE2 <CJK>
+BCE3 82E5 BCE3 <CJK>
+BCE4 5BC2 BCE4 <CJK>
+BCE5 5F31 BCE5 <CJK>
+BCE6 60F9 BCE6 <CJK>
+BCE7 4E3B BCE7 <CJK>
+BCE8 53D6 BCE8 <CJK>
+BCE9 5B88 BCE9 <CJK>
+BCEA 624B BCEA <CJK>
+BCEB 6731 BCEB <CJK>
+BCEC 6B8A BCEC <CJK>
+BCED 72E9 BCED <CJK>
+BCEE 73E0 BCEE <CJK>
+BCEF 7A2E BCEF <CJK>
+BCF0 816B BCF0 <CJK>
+BCF1 8DA3 BCF1 <CJK>
+BCF2 9152 BCF2 <CJK>
+BCF3 9996 BCF3 <CJK>
+BCF4 5112 BCF4 <CJK>
+BCF5 53D7 BCF5 <CJK>
+BCF6 546A BCF6 <CJK>
+BCF7 5BFF BCF7 <CJK>
+BCF8 6388 BCF8 <CJK>
+BCF9 6A39 BCF9 <CJK>
+BCFA 7DAC BCFA <CJK>
+BCFB 9700 BCFB <CJK>
+BCFC 56DA BCFC <CJK>
+BCFD 53CE BCFD <CJK>
+BCFE 5468 BCFE <CJK>
+BDA1 5B97 BDA1 <CJK>
+BDA2 5C31 BDA2 <CJK>
+BDA3 5DDE BDA3 <CJK>
+BDA4 4FEE BDA4 <CJK>
+BDA5 6101 BDA5 <CJK>
+BDA6 62FE BDA6 <CJK>
+BDA7 6D32 BDA7 <CJK>
+BDA8 79C0 BDA8 <CJK>
+BDA9 79CB BDA9 <CJK>
+BDAA 7D42 BDAA <CJK>
+BDAB 7E4D BDAB <CJK>
+BDAC 7FD2 BDAC <CJK>
+BDAD 81ED BDAD <CJK>
+BDAE 821F BDAE <CJK>
+BDAF 8490 BDAF <CJK>
+BDB0 8846 BDB0 <CJK>
+BDB1 8972 BDB1 <CJK>
+BDB2 8B90 BDB2 <CJK>
+BDB3 8E74 BDB3 <CJK>
+BDB4 8F2F BDB4 <CJK>
+BDB5 9031 BDB5 <CJK>
+BDB6 914B BDB6 <CJK>
+BDB7 916C BDB7 <CJK>
+BDB8 96C6 BDB8 <CJK>
+BDB9 919C BDB9 <CJK>
+BDBA 4EC0 BDBA <CJK>
+BDBB 4F4F BDBB <CJK>
+BDBC 5145 BDBC <CJK>
+BDBD 5341 BDBD <CJK>
+BDBE 5F93 BDBE <CJK>
+BDBF 620E BDBF <CJK>
+BDC0 67D4 BDC0 <CJK>
+BDC1 6C41 BDC1 <CJK>
+BDC2 6E0B BDC2 <CJK>
+BDC3 7363 BDC3 <CJK>
+BDC4 7E26 BDC4 <CJK>
+BDC5 91CD BDC5 <CJK>
+BDC6 9283 BDC6 <CJK>
+BDC7 53D4 BDC7 <CJK>
+BDC8 5919 BDC8 <CJK>
+BDC9 5BBF BDC9 <CJK>
+BDCA 6DD1 BDCA <CJK>
+BDCB 795D BDCB <CJK>
+BDCC 7E2E BDCC <CJK>
+BDCD 7C9B BDCD <CJK>
+BDCE 587E BDCE <CJK>
+BDCF 719F BDCF <CJK>
+BDD0 51FA BDD0 <CJK>
+BDD1 8853 BDD1 <CJK>
+BDD2 8FF0 BDD2 <CJK>
+BDD3 4FCA BDD3 <CJK>
+BDD4 5CFB BDD4 <CJK>
+BDD5 6625 BDD5 <CJK>
+BDD6 77AC BDD6 <CJK>
+BDD7 7AE3 BDD7 <CJK>
+BDD8 821C BDD8 <CJK>
+BDD9 99FF BDD9 <CJK>
+BDDA 51C6 BDDA <CJK>
+BDDB 5FAA BDDB <CJK>
+BDDC 65EC BDDC <CJK>
+BDDD 696F BDDD <CJK>
+BDDE 6B89 BDDE <CJK>
+BDDF 6DF3 BDDF <CJK>
+BDE0 6E96 BDE0 <CJK>
+BDE1 6F64 BDE1 <CJK>
+BDE2 76FE BDE2 <CJK>
+BDE3 7D14 BDE3 <CJK>
+BDE4 5DE1 BDE4 <CJK>
+BDE5 9075 BDE5 <CJK>
+BDE6 9187 BDE6 <CJK>
+BDE7 9806 BDE7 <CJK>
+BDE8 51E6 BDE8 <CJK>
+BDE9 521D BDE9 <CJK>
+BDEA 6240 BDEA <CJK>
+BDEB 6691 BDEB <CJK>
+BDEC 66D9 BDEC <CJK>
+BDED 6E1A BDED <CJK>
+BDEE 5EB6 BDEE <CJK>
+BDEF 7DD2 BDEF <CJK>
+BDF0 7F72 BDF0 <CJK>
+BDF1 66F8 BDF1 <CJK>
+BDF2 85AF BDF2 <CJK>
+BDF3 85F7 BDF3 <CJK>
+BDF4 8AF8 BDF4 <CJK>
+BDF5 52A9 BDF5 <CJK>
+BDF6 53D9 BDF6 <CJK>
+BDF7 5973 BDF7 <CJK>
+BDF8 5E8F BDF8 <CJK>
+BDF9 5F90 BDF9 <CJK>
+BDFA 6055 BDFA <CJK>
+BDFB 92E4 BDFB <CJK>
+BDFC 9664 BDFC <CJK>
+BDFD 50B7 BDFD <CJK>
+BDFE 511F BDFE <CJK>
+BEA1 52DD BEA1 <CJK>
+BEA2 5320 BEA2 <CJK>
+BEA3 5347 BEA3 <CJK>
+BEA4 53EC BEA4 <CJK>
+BEA5 54E8 BEA5 <CJK>
+BEA6 5546 BEA6 <CJK>
+BEA7 5531 BEA7 <CJK>
+BEA8 5617 BEA8 <CJK>
+BEA9 5968 BEA9 <CJK>
+BEAA 59BE BEAA <CJK>
+BEAB 5A3C BEAB <CJK>
+BEAC 5BB5 BEAC <CJK>
+BEAD 5C06 BEAD <CJK>
+BEAE 5C0F BEAE <CJK>
+BEAF 5C11 BEAF <CJK>
+BEB0 5C1A BEB0 <CJK>
+BEB1 5E84 BEB1 <CJK>
+BEB2 5E8A BEB2 <CJK>
+BEB3 5EE0 BEB3 <CJK>
+BEB4 5F70 BEB4 <CJK>
+BEB5 627F BEB5 <CJK>
+BEB6 6284 BEB6 <CJK>
+BEB7 62DB BEB7 <CJK>
+BEB8 638C BEB8 <CJK>
+BEB9 6377 BEB9 <CJK>
+BEBA 6607 BEBA <CJK>
+BEBB 660C BEBB <CJK>
+BEBC 662D BEBC <CJK>
+BEBD 6676 BEBD <CJK>
+BEBE 677E BEBE <CJK>
+BEBF 68A2 BEBF <CJK>
+BEC0 6A1F BEC0 <CJK>
+BEC1 6A35 BEC1 <CJK>
+BEC2 6CBC BEC2 <CJK>
+BEC3 6D88 BEC3 <CJK>
+BEC4 6E09 BEC4 <CJK>
+BEC5 6E58 BEC5 <CJK>
+BEC6 713C BEC6 <CJK>
+BEC7 7126 BEC7 <CJK>
+BEC8 7167 BEC8 <CJK>
+BEC9 75C7 BEC9 <CJK>
+BECA 7701 BECA <CJK>
+BECB 785D BECB <CJK>
+BECC 7901 BECC <CJK>
+BECD 7965 BECD <CJK>
+BECE 79F0 BECE <CJK>
+BECF 7AE0 BECF <CJK>
+BED0 7B11 BED0 <CJK>
+BED1 7CA7 BED1 <CJK>
+BED2 7D39 BED2 <CJK>
+BED3 8096 BED3 <CJK>
+BED4 83D6 BED4 <CJK>
+BED5 848B BED5 <CJK>
+BED6 8549 BED6 <CJK>
+BED7 885D BED7 <CJK>
+BED8 88F3 BED8 <CJK>
+BED9 8A1F BED9 <CJK>
+BEDA 8A3C BEDA <CJK>
+BEDB 8A54 BEDB <CJK>
+BEDC 8A73 BEDC <CJK>
+BEDD 8C61 BEDD <CJK>
+BEDE 8CDE BEDE <CJK>
+BEDF 91A4 BEDF <CJK>
+BEE0 9266 BEE0 <CJK>
+BEE1 937E BEE1 <CJK>
+BEE2 9418 BEE2 <CJK>
+BEE3 969C BEE3 <CJK>
+BEE4 9798 BEE4 <CJK>
+BEE5 4E0A BEE5 <CJK>
+BEE6 4E08 BEE6 <CJK>
+BEE7 4E1E BEE7 <CJK>
+BEE8 4E57 BEE8 <CJK>
+BEE9 5197 BEE9 <CJK>
+BEEA 5270 BEEA <CJK>
+BEEB 57CE BEEB <CJK>
+BEEC 5834 BEEC <CJK>
+BEED 58CC BEED <CJK>
+BEEE 5B22 BEEE <CJK>
+BEEF 5E38 BEEF <CJK>
+BEF0 60C5 BEF0 <CJK>
+BEF1 64FE BEF1 <CJK>
+BEF2 6761 BEF2 <CJK>
+BEF3 6756 BEF3 <CJK>
+BEF4 6D44 BEF4 <CJK>
+BEF5 72B6 BEF5 <CJK>
+BEF6 7573 BEF6 <CJK>
+BEF7 7A63 BEF7 <CJK>
+BEF8 84B8 BEF8 <CJK>
+BEF9 8B72 BEF9 <CJK>
+BEFA 91B8 BEFA <CJK>
+BEFB 9320 BEFB <CJK>
+BEFC 5631 BEFC <CJK>
+BEFD 57F4 BEFD <CJK>
+BEFE 98FE BEFE <CJK>
+BFA1 62ED BFA1 <CJK>
+BFA2 690D BFA2 <CJK>
+BFA3 6B96 BFA3 <CJK>
+BFA4 71ED BFA4 <CJK>
+BFA5 7E54 BFA5 <CJK>
+BFA6 8077 BFA6 <CJK>
+BFA7 8272 BFA7 <CJK>
+BFA8 89E6 BFA8 <CJK>
+BFA9 98DF BFA9 <CJK>
+BFAA 8755 BFAA <CJK>
+BFAB 8FB1 BFAB <CJK>
+BFAC 5C3B BFAC <CJK>
+BFAD 4F38 BFAD <CJK>
+BFAE 4FE1 BFAE <CJK>
+BFAF 4FB5 BFAF <CJK>
+BFB0 5507 BFB0 <CJK>
+BFB1 5A20 BFB1 <CJK>
+BFB2 5BDD BFB2 <CJK>
+BFB3 5BE9 BFB3 <CJK>
+BFB4 5FC3 BFB4 <CJK>
+BFB5 614E BFB5 <CJK>
+BFB6 632F BFB6 <CJK>
+BFB7 65B0 BFB7 <CJK>
+BFB8 664B BFB8 <CJK>
+BFB9 68EE BFB9 <CJK>
+BFBA 699B BFBA <CJK>
+BFBB 6D78 BFBB <CJK>
+BFBC 6DF1 BFBC <CJK>
+BFBD 7533 BFBD <CJK>
+BFBE 75B9 BFBE <CJK>
+BFBF 771F BFBF <CJK>
+BFC0 795E BFC0 <CJK>
+BFC1 79E6 BFC1 <CJK>
+BFC2 7D33 BFC2 <CJK>
+BFC3 81E3 BFC3 <CJK>
+BFC4 82AF BFC4 <CJK>
+BFC5 85AA BFC5 <CJK>
+BFC6 89AA BFC6 <CJK>
+BFC7 8A3A BFC7 <CJK>
+BFC8 8EAB BFC8 <CJK>
+BFC9 8F9B BFC9 <CJK>
+BFCA 9032 BFCA <CJK>
+BFCB 91DD BFCB <CJK>
+BFCC 9707 BFCC <CJK>
+BFCD 4EBA BFCD <CJK>
+BFCE 4EC1 BFCE <CJK>
+BFCF 5203 BFCF <CJK>
+BFD0 5875 BFD0 <CJK>
+BFD1 58EC BFD1 <CJK>
+BFD2 5C0B BFD2 <CJK>
+BFD3 751A BFD3 <CJK>
+BFD4 5C3D BFD4 <CJK>
+BFD5 814E BFD5 <CJK>
+BFD6 8A0A BFD6 <CJK>
+BFD7 8FC5 BFD7 <CJK>
+BFD8 9663 BFD8 <CJK>
+BFD9 976D BFD9 <CJK>
+BFDA 7B25 BFDA <CJK>
+BFDB 8ACF BFDB <CJK>
+BFDC 9808 BFDC <CJK>
+BFDD 9162 BFDD <CJK>
+BFDE 56F3 BFDE <CJK>
+BFDF 53A8 BFDF <CJK>
+BFE0 9017 BFE0 <CJK>
+BFE1 5439 BFE1 <CJK>
+BFE2 5782 BFE2 <CJK>
+BFE3 5E25 BFE3 <CJK>
+BFE4 63A8 BFE4 <CJK>
+BFE5 6C34 BFE5 <CJK>
+BFE6 708A BFE6 <CJK>
+BFE7 7761 BFE7 <CJK>
+BFE8 7C8B BFE8 <CJK>
+BFE9 7FE0 BFE9 <CJK>
+BFEA 8870 BFEA <CJK>
+BFEB 9042 BFEB <CJK>
+BFEC 9154 BFEC <CJK>
+BFED 9310 BFED <CJK>
+BFEE 9318 BFEE <CJK>
+BFEF 968F BFEF <CJK>
+BFF0 745E BFF0 <CJK>
+BFF1 9AC4 BFF1 <CJK>
+BFF2 5D07 BFF2 <CJK>
+BFF3 5D69 BFF3 <CJK>
+BFF4 6570 BFF4 <CJK>
+BFF5 67A2 BFF5 <CJK>
+BFF6 8DA8 BFF6 <CJK>
+BFF7 96DB BFF7 <CJK>
+BFF8 636E BFF8 <CJK>
+BFF9 6749 BFF9 <CJK>
+BFFA 6919 BFFA <CJK>
+BFFB 83C5 BFFB <CJK>
+BFFC 9817 BFFC <CJK>
+BFFD 96C0 BFFD <CJK>
+BFFE 88FE BFFE <CJK>
+C0A1 6F84 C0A1 <CJK>
+C0A2 647A C0A2 <CJK>
+C0A3 5BF8 C0A3 <CJK>
+C0A4 4E16 C0A4 <CJK>
+C0A5 702C C0A5 <CJK>
+C0A6 755D C0A6 <CJK>
+C0A7 662F C0A7 <CJK>
+C0A8 51C4 C0A8 <CJK>
+C0A9 5236 C0A9 <CJK>
+C0AA 52E2 C0AA <CJK>
+C0AB 59D3 C0AB <CJK>
+C0AC 5F81 C0AC <CJK>
+C0AD 6027 C0AD <CJK>
+C0AE 6210 C0AE <CJK>
+C0AF 653F C0AF <CJK>
+C0B0 6574 C0B0 <CJK>
+C0B1 661F C0B1 <CJK>
+C0B2 6674 C0B2 <CJK>
+C0B3 68F2 C0B3 <CJK>
+C0B4 6816 C0B4 <CJK>
+C0B5 6B63 C0B5 <CJK>
+C0B6 6E05 C0B6 <CJK>
+C0B7 7272 C0B7 <CJK>
+C0B8 751F C0B8 <CJK>
+C0B9 76DB C0B9 <CJK>
+C0BA 7CBE C0BA <CJK>
+C0BB 8056 C0BB <CJK>
+C0BC 58F0 C0BC <CJK>
+C0BD 88FD C0BD <CJK>
+C0BE 897F C0BE <CJK>
+C0BF 8AA0 C0BF <CJK>
+C0C0 8A93 C0C0 <CJK>
+C0C1 8ACB C0C1 <CJK>
+C0C2 901D C0C2 <CJK>
+C0C3 9192 C0C3 <CJK>
+C0C4 9752 C0C4 <CJK>
+C0C5 9759 C0C5 <CJK>
+C0C6 6589 C0C6 <CJK>
+C0C7 7A0E C0C7 <CJK>
+C0C8 8106 C0C8 <CJK>
+C0C9 96BB C0C9 <CJK>
+C0CA 5E2D C0CA <CJK>
+C0CB 60DC C0CB <CJK>
+C0CC 621A C0CC <CJK>
+C0CD 65A5 C0CD <CJK>
+C0CE 6614 C0CE <CJK>
+C0CF 6790 C0CF <CJK>
+C0D0 77F3 C0D0 <CJK>
+C0D1 7A4D C0D1 <CJK>
+C0D2 7C4D C0D2 <CJK>
+C0D3 7E3E C0D3 <CJK>
+C0D4 810A C0D4 <CJK>
+C0D5 8CAC C0D5 <CJK>
+C0D6 8D64 C0D6 <CJK>
+C0D7 8DE1 C0D7 <CJK>
+C0D8 8E5F C0D8 <CJK>
+C0D9 78A9 C0D9 <CJK>
+C0DA 5207 C0DA <CJK>
+C0DB 62D9 C0DB <CJK>
+C0DC 63A5 C0DC <CJK>
+C0DD 6442 C0DD <CJK>
+C0DE 6298 C0DE <CJK>
+C0DF 8A2D C0DF <CJK>
+C0E0 7A83 C0E0 <CJK>
+C0E1 7BC0 C0E1 <CJK>
+C0E2 8AAC C0E2 <CJK>
+C0E3 96EA C0E3 <CJK>
+C0E4 7D76 C0E4 <CJK>
+C0E5 820C C0E5 <CJK>
+C0E6 8749 C0E6 <CJK>
+C0E7 4ED9 C0E7 <CJK>
+C0E8 5148 C0E8 <CJK>
+C0E9 5343 C0E9 <CJK>
+C0EA 5360 C0EA <CJK>
+C0EB 5BA3 C0EB <CJK>
+C0EC 5C02 C0EC <CJK>
+C0ED 5C16 C0ED <CJK>
+C0EE 5DDD C0EE <CJK>
+C0EF 6226 C0EF <CJK>
+C0F0 6247 C0F0 <CJK>
+C0F1 64B0 C0F1 <CJK>
+C0F2 6813 C0F2 <CJK>
+C0F3 6834 C0F3 <CJK>
+C0F4 6CC9 C0F4 <CJK>
+C0F5 6D45 C0F5 <CJK>
+C0F6 6D17 C0F6 <CJK>
+C0F7 67D3 C0F7 <CJK>
+C0F8 6F5C C0F8 <CJK>
+C0F9 714E C0F9 <CJK>
+C0FA 717D C0FA <CJK>
+C0FB 65CB C0FB <CJK>
+C0FC 7A7F C0FC <CJK>
+C0FD 7BAD C0FD <CJK>
+C0FE 7DDA C0FE <CJK>
+C1A1 7E4A C1A1 <CJK>
+C1A2 7FA8 C1A2 <CJK>
+C1A3 817A C1A3 <CJK>
+C1A4 821B C1A4 <CJK>
+C1A5 8239 C1A5 <CJK>
+C1A6 85A6 C1A6 <CJK>
+C1A7 8A6E C1A7 <CJK>
+C1A8 8CCE C1A8 <CJK>
+C1A9 8DF5 C1A9 <CJK>
+C1AA 9078 C1AA <CJK>
+C1AB 9077 C1AB <CJK>
+C1AC 92AD C1AC <CJK>
+C1AD 9291 C1AD <CJK>
+C1AE 9583 C1AE <CJK>
+C1AF 9BAE C1AF <CJK>
+C1B0 524D C1B0 <CJK>
+C1B1 5584 C1B1 <CJK>
+C1B2 6F38 C1B2 <CJK>
+C1B3 7136 C1B3 <CJK>
+C1B4 5168 C1B4 <CJK>
+C1B5 7985 C1B5 <CJK>
+C1B6 7E55 C1B6 <CJK>
+C1B7 81B3 C1B7 <CJK>
+C1B8 7CCE C1B8 <CJK>
+C1B9 564C C1B9 <CJK>
+C1BA 5851 C1BA <CJK>
+C1BB 5CA8 C1BB <CJK>
+C1BC 63AA C1BC <CJK>
+C1BD 66FE C1BD <CJK>
+C1BE 66FD C1BE <CJK>
+C1BF 695A C1BF <CJK>
+C1C0 72D9 C1C0 <CJK>
+C1C1 758F C1C1 <CJK>
+C1C2 758E C1C2 <CJK>
+C1C3 790E C1C3 <CJK>
+C1C4 7956 C1C4 <CJK>
+C1C5 79DF C1C5 <CJK>
+C1C6 7C97 C1C6 <CJK>
+C1C7 7D20 C1C7 <CJK>
+C1C8 7D44 C1C8 <CJK>
+C1C9 8607 C1C9 <CJK>
+C1CA 8A34 C1CA <CJK>
+C1CB 963B C1CB <CJK>
+C1CC 9061 C1CC <CJK>
+C1CD 9F20 C1CD <CJK>
+C1CE 50E7 C1CE <CJK>
+C1CF 5275 C1CF <CJK>
+C1D0 53CC C1D0 <CJK>
+C1D1 53E2 C1D1 <CJK>
+C1D2 5009 C1D2 <CJK>
+C1D3 55AA C1D3 <CJK>
+C1D4 58EE C1D4 <CJK>
+C1D5 594F C1D5 <CJK>
+C1D6 723D C1D6 <CJK>
+C1D7 5B8B C1D7 <CJK>
+C1D8 5C64 C1D8 <CJK>
+C1D9 531D C1D9 <CJK>
+C1DA 60E3 C1DA <CJK>
+C1DB 60F3 C1DB <CJK>
+C1DC 635C C1DC <CJK>
+C1DD 6383 C1DD <CJK>
+C1DE 633F C1DE <CJK>
+C1DF 63BB C1DF <CJK>
+C1E0 64CD C1E0 <CJK>
+C1E1 65E9 C1E1 <CJK>
+C1E2 66F9 C1E2 <CJK>
+C1E3 5DE3 C1E3 <CJK>
+C1E4 69CD C1E4 <CJK>
+C1E5 69FD C1E5 <CJK>
+C1E6 6F15 C1E6 <CJK>
+C1E7 71E5 C1E7 <CJK>
+C1E8 4E89 C1E8 <CJK>
+C1E9 75E9 C1E9 <CJK>
+C1EA 76F8 C1EA <CJK>
+C1EB 7A93 C1EB <CJK>
+C1EC 7CDF C1EC <CJK>
+C1ED 7DCF C1ED <CJK>
+C1EE 7D9C C1EE <CJK>
+C1EF 8061 C1EF <CJK>
+C1F0 8349 C1F0 <CJK>
+C1F1 8358 C1F1 <CJK>
+C1F2 846C C1F2 <CJK>
+C1F3 84BC C1F3 <CJK>
+C1F4 85FB C1F4 <CJK>
+C1F5 88C5 C1F5 <CJK>
+C1F6 8D70 C1F6 <CJK>
+C1F7 9001 C1F7 <CJK>
+C1F8 906D C1F8 <CJK>
+C1F9 9397 C1F9 <CJK>
+C1FA 971C C1FA <CJK>
+C1FB 9A12 C1FB <CJK>
+C1FC 50CF C1FC <CJK>
+C1FD 5897 C1FD <CJK>
+C1FE 618E C1FE <CJK>
+C2A1 81D3 C2A1 <CJK>
+C2A2 8535 C2A2 <CJK>
+C2A3 8D08 C2A3 <CJK>
+C2A4 9020 C2A4 <CJK>
+C2A5 4FC3 C2A5 <CJK>
+C2A6 5074 C2A6 <CJK>
+C2A7 5247 C2A7 <CJK>
+C2A8 5373 C2A8 <CJK>
+C2A9 606F C2A9 <CJK>
+C2AA 6349 C2AA <CJK>
+C2AB 675F C2AB <CJK>
+C2AC 6E2C C2AC <CJK>
+C2AD 8DB3 C2AD <CJK>
+C2AE 901F C2AE <CJK>
+C2AF 4FD7 C2AF <CJK>
+C2B0 5C5E C2B0 <CJK>
+C2B1 8CCA C2B1 <CJK>
+C2B2 65CF C2B2 <CJK>
+C2B3 7D9A C2B3 <CJK>
+C2B4 5352 C2B4 <CJK>
+C2B5 8896 C2B5 <CJK>
+C2B6 5176 C2B6 <CJK>
+C2B7 63C3 C2B7 <CJK>
+C2B8 5B58 C2B8 <CJK>
+C2B9 5B6B C2B9 <CJK>
+C2BA 5C0A C2BA <CJK>
+C2BB 640D C2BB <CJK>
+C2BC 6751 C2BC <CJK>
+C2BD 905C C2BD <CJK>
+C2BE 4ED6 C2BE <CJK>
+C2BF 591A C2BF <CJK>
+C2C0 592A C2C0 <CJK>
+C2C1 6C70 C2C1 <CJK>
+C2C2 8A51 C2C2 <CJK>
+C2C3 553E C2C3 <CJK>
+C2C4 5815 C2C4 <CJK>
+C2C5 59A5 C2C5 <CJK>
+C2C6 60F0 C2C6 <CJK>
+C2C7 6253 C2C7 <CJK>
+C2C8 67C1 C2C8 <CJK>
+C2C9 8235 C2C9 <CJK>
+C2CA 6955 C2CA <CJK>
+C2CB 9640 C2CB <CJK>
+C2CC 99C4 C2CC <CJK>
+C2CD 9A28 C2CD <CJK>
+C2CE 4F53 C2CE <CJK>
+C2CF 5806 C2CF <CJK>
+C2D0 5BFE C2D0 <CJK>
+C2D1 8010 C2D1 <CJK>
+C2D2 5CB1 C2D2 <CJK>
+C2D3 5E2F C2D3 <CJK>
+C2D4 5F85 C2D4 <CJK>
+C2D5 6020 C2D5 <CJK>
+C2D6 614B C2D6 <CJK>
+C2D7 6234 C2D7 <CJK>
+C2D8 66FF C2D8 <CJK>
+C2D9 6CF0 C2D9 <CJK>
+C2DA 6EDE C2DA <CJK>
+C2DB 80CE C2DB <CJK>
+C2DC 817F C2DC <CJK>
+C2DD 82D4 C2DD <CJK>
+C2DE 888B C2DE <CJK>
+C2DF 8CB8 C2DF <CJK>
+C2E0 9000 C2E0 <CJK>
+C2E1 902E C2E1 <CJK>
+C2E2 968A C2E2 <CJK>
+C2E3 9EDB C2E3 <CJK>
+C2E4 9BDB C2E4 <CJK>
+C2E5 4EE3 C2E5 <CJK>
+C2E6 53F0 C2E6 <CJK>
+C2E7 5927 C2E7 <CJK>
+C2E8 7B2C C2E8 <CJK>
+C2E9 918D C2E9 <CJK>
+C2EA 984C C2EA <CJK>
+C2EB 9DF9 C2EB <CJK>
+C2EC 6EDD C2EC <CJK>
+C2ED 7027 C2ED <CJK>
+C2EE 5353 C2EE <CJK>
+C2EF 5544 C2EF <CJK>
+C2F0 5B85 C2F0 <CJK>
+C2F1 6258 C2F1 <CJK>
+C2F2 629E C2F2 <CJK>
+C2F3 62D3 C2F3 <CJK>
+C2F4 6CA2 C2F4 <CJK>
+C2F5 6FEF C2F5 <CJK>
+C2F6 7422 C2F6 <CJK>
+C2F7 8A17 C2F7 <CJK>
+C2F8 9438 C2F8 <CJK>
+C2F9 6FC1 C2F9 <CJK>
+C2FA 8AFE C2FA <CJK>
+C2FB 8338 C2FB <CJK>
+C2FC 51E7 C2FC <CJK>
+C2FD 86F8 C2FD <CJK>
+C2FE 53EA C2FE <CJK>
+C3A1 53E9 C3A1 <CJK>
+C3A2 4F46 C3A2 <CJK>
+C3A3 9054 C3A3 <CJK>
+C3A4 8FB0 C3A4 <CJK>
+C3A5 596A C3A5 <CJK>
+C3A6 8131 C3A6 <CJK>
+C3A7 5DFD C3A7 <CJK>
+C3A8 7AEA C3A8 <CJK>
+C3A9 8FBF C3A9 <CJK>
+C3AA 68DA C3AA <CJK>
+C3AB 8C37 C3AB <CJK>
+C3AC 72F8 C3AC <CJK>
+C3AD 9C48 C3AD <CJK>
+C3AE 6A3D C3AE <CJK>
+C3AF 8AB0 C3AF <CJK>
+C3B0 4E39 C3B0 <CJK>
+C3B1 5358 C3B1 <CJK>
+C3B2 5606 C3B2 <CJK>
+C3B3 5766 C3B3 <CJK>
+C3B4 62C5 C3B4 <CJK>
+C3B5 63A2 C3B5 <CJK>
+C3B6 65E6 C3B6 <CJK>
+C3B7 6B4E C3B7 <CJK>
+C3B8 6DE1 C3B8 <CJK>
+C3B9 6E5B C3B9 <CJK>
+C3BA 70AD C3BA <CJK>
+C3BB 77ED C3BB <CJK>
+C3BC 7AEF C3BC <CJK>
+C3BD 7BAA C3BD <CJK>
+C3BE 7DBB C3BE <CJK>
+C3BF 803D C3BF <CJK>
+C3C0 80C6 C3C0 <CJK>
+C3C1 86CB C3C1 <CJK>
+C3C2 8A95 C3C2 <CJK>
+C3C3 935B C3C3 <CJK>
+C3C4 56E3 C3C4 <CJK>
+C3C5 58C7 C3C5 <CJK>
+C3C6 5F3E C3C6 <CJK>
+C3C7 65AD C3C7 <CJK>
+C3C8 6696 C3C8 <CJK>
+C3C9 6A80 C3C9 <CJK>
+C3CA 6BB5 C3CA <CJK>
+C3CB 7537 C3CB <CJK>
+C3CC 8AC7 C3CC <CJK>
+C3CD 5024 C3CD <CJK>
+C3CE 77E5 C3CE <CJK>
+C3CF 5730 C3CF <CJK>
+C3D0 5F1B C3D0 <CJK>
+C3D1 6065 C3D1 <CJK>
+C3D2 667A C3D2 <CJK>
+C3D3 6C60 C3D3 <CJK>
+C3D4 75F4 C3D4 <CJK>
+C3D5 7A1A C3D5 <CJK>
+C3D6 7F6E C3D6 <CJK>
+C3D7 81F4 C3D7 <CJK>
+C3D8 8718 C3D8 <CJK>
+C3D9 9045 C3D9 <CJK>
+C3DA 99B3 C3DA <CJK>
+C3DB 7BC9 C3DB <CJK>
+C3DC 755C C3DC <CJK>
+C3DD 7AF9 C3DD <CJK>
+C3DE 7B51 C3DE <CJK>
+C3DF 84C4 C3DF <CJK>
+C3E0 9010 C3E0 <CJK>
+C3E1 79E9 C3E1 <CJK>
+C3E2 7A92 C3E2 <CJK>
+C3E3 8336 C3E3 <CJK>
+C3E4 5AE1 C3E4 <CJK>
+C3E5 7740 C3E5 <CJK>
+C3E6 4E2D C3E6 <CJK>
+C3E7 4EF2 C3E7 <CJK>
+C3E8 5B99 C3E8 <CJK>
+C3E9 5FE0 C3E9 <CJK>
+C3EA 62BD C3EA <CJK>
+C3EB 663C C3EB <CJK>
+C3EC 67F1 C3EC <CJK>
+C3ED 6CE8 C3ED <CJK>
+C3EE 866B C3EE <CJK>
+C3EF 8877 C3EF <CJK>
+C3F0 8A3B C3F0 <CJK>
+C3F1 914E C3F1 <CJK>
+C3F2 92F3 C3F2 <CJK>
+C3F3 99D0 C3F3 <CJK>
+C3F4 6A17 C3F4 <CJK>
+C3F5 7026 C3F5 <CJK>
+C3F6 732A C3F6 <CJK>
+C3F7 82E7 C3F7 <CJK>
+C3F8 8457 C3F8 <CJK>
+C3F9 8CAF C3F9 <CJK>
+C3FA 4E01 C3FA <CJK>
+C3FB 5146 C3FB <CJK>
+C3FC 51CB C3FC <CJK>
+C3FD 558B C3FD <CJK>
+C3FE 5BF5 C3FE <CJK>
+C4A1 5E16 C4A1 <CJK>
+C4A2 5E33 C4A2 <CJK>
+C4A3 5E81 C4A3 <CJK>
+C4A4 5F14 C4A4 <CJK>
+C4A5 5F35 C4A5 <CJK>
+C4A6 5F6B C4A6 <CJK>
+C4A7 5FB4 C4A7 <CJK>
+C4A8 61F2 C4A8 <CJK>
+C4A9 6311 C4A9 <CJK>
+C4AA 66A2 C4AA <CJK>
+C4AB 671D C4AB <CJK>
+C4AC 6F6E C4AC <CJK>
+C4AD 7252 C4AD <CJK>
+C4AE 753A C4AE <CJK>
+C4AF 773A C4AF <CJK>
+C4B0 8074 C4B0 <CJK>
+C4B1 8139 C4B1 <CJK>
+C4B2 8178 C4B2 <CJK>
+C4B3 8776 C4B3 <CJK>
+C4B4 8ABF C4B4 <CJK>
+C4B5 8ADC C4B5 <CJK>
+C4B6 8D85 C4B6 <CJK>
+C4B7 8DF3 C4B7 <CJK>
+C4B8 929A C4B8 <CJK>
+C4B9 9577 C4B9 <CJK>
+C4BA 9802 C4BA <CJK>
+C4BB 9CE5 C4BB <CJK>
+C4BC 52C5 C4BC <CJK>
+C4BD 6357 C4BD <CJK>
+C4BE 76F4 C4BE <CJK>
+C4BF 6715 C4BF <CJK>
+C4C0 6C88 C4C0 <CJK>
+C4C1 73CD C4C1 <CJK>
+C4C2 8CC3 C4C2 <CJK>
+C4C3 93AE C4C3 <CJK>
+C4C4 9673 C4C4 <CJK>
+C4C5 6D25 C4C5 <CJK>
+C4C6 589C C4C6 <CJK>
+C4C7 690E C4C7 <CJK>
+C4C8 69CC C4C8 <CJK>
+C4C9 8FFD C4C9 <CJK>
+C4CA 939A C4CA <CJK>
+C4CB 75DB C4CB <CJK>
+C4CC 901A C4CC <CJK>
+C4CD 585A C4CD <CJK>
+C4CE 6802 C4CE <CJK>
+C4CF 63B4 C4CF <CJK>
+C4D0 69FB C4D0 <CJK>
+C4D1 4F43 C4D1 <CJK>
+C4D2 6F2C C4D2 <CJK>
+C4D3 67D8 C4D3 <CJK>
+C4D4 8FBB C4D4 <CJK>
+C4D5 8526 C4D5 <CJK>
+C4D6 7DB4 C4D6 <CJK>
+C4D7 9354 C4D7 <CJK>
+C4D8 693F C4D8 <CJK>
+C4D9 6F70 C4D9 <CJK>
+C4DA 576A C4DA <CJK>
+C4DB 58F7 C4DB <CJK>
+C4DC 5B2C C4DC <CJK>
+C4DD 7D2C C4DD <CJK>
+C4DE 722A C4DE <CJK>
+C4DF 540A C4DF <CJK>
+C4E0 91E3 C4E0 <CJK>
+C4E1 9DB4 C4E1 <CJK>
+C4E2 4EAD C4E2 <CJK>
+C4E3 4F4E C4E3 <CJK>
+C4E4 505C C4E4 <CJK>
+C4E5 5075 C4E5 <CJK>
+C4E6 5243 C4E6 <CJK>
+C4E7 8C9E C4E7 <CJK>
+C4E8 5448 C4E8 <CJK>
+C4E9 5824 C4E9 <CJK>
+C4EA 5B9A C4EA <CJK>
+C4EB 5E1D C4EB <CJK>
+C4EC 5E95 C4EC <CJK>
+C4ED 5EAD C4ED <CJK>
+C4EE 5EF7 C4EE <CJK>
+C4EF 5F1F C4EF <CJK>
+C4F0 608C C4F0 <CJK>
+C4F1 62B5 C4F1 <CJK>
+C4F2 633A C4F2 <CJK>
+C4F3 63D0 C4F3 <CJK>
+C4F4 68AF C4F4 <CJK>
+C4F5 6C40 C4F5 <CJK>
+C4F6 7887 C4F6 <CJK>
+C4F7 798E C4F7 <CJK>
+C4F8 7A0B C4F8 <CJK>
+C4F9 7DE0 C4F9 <CJK>
+C4FA 8247 C4FA <CJK>
+C4FB 8A02 C4FB <CJK>
+C4FC 8AE6 C4FC <CJK>
+C4FD 8E44 C4FD <CJK>
+C4FE 9013 C4FE <CJK>
+C5A1 90B8 C5A1 <CJK>
+C5A2 912D C5A2 <CJK>
+C5A3 91D8 C5A3 <CJK>
+C5A4 9F0E C5A4 <CJK>
+C5A5 6CE5 C5A5 <CJK>
+C5A6 6458 C5A6 <CJK>
+C5A7 64E2 C5A7 <CJK>
+C5A8 6575 C5A8 <CJK>
+C5A9 6EF4 C5A9 <CJK>
+C5AA 7684 C5AA <CJK>
+C5AB 7B1B C5AB <CJK>
+C5AC 9069 C5AC <CJK>
+C5AD 93D1 C5AD <CJK>
+C5AE 6EBA C5AE <CJK>
+C5AF 54F2 C5AF <CJK>
+C5B0 5FB9 C5B0 <CJK>
+C5B1 64A4 C5B1 <CJK>
+C5B2 8F4D C5B2 <CJK>
+C5B3 8FED C5B3 <CJK>
+C5B4 9244 C5B4 <CJK>
+C5B5 5178 C5B5 <CJK>
+C5B6 586B C5B6 <CJK>
+C5B7 5929 C5B7 <CJK>
+C5B8 5C55 C5B8 <CJK>
+C5B9 5E97 C5B9 <CJK>
+C5BA 6DFB C5BA <CJK>
+C5BB 7E8F C5BB <CJK>
+C5BC 751C C5BC <CJK>
+C5BD 8CBC C5BD <CJK>
+C5BE 8EE2 C5BE <CJK>
+C5BF 985B C5BF <CJK>
+C5C0 70B9 C5C0 <CJK>
+C5C1 4F1D C5C1 <CJK>
+C5C2 6BBF C5C2 <CJK>
+C5C3 6FB1 C5C3 <CJK>
+C5C4 7530 C5C4 <CJK>
+C5C5 96FB C5C5 <CJK>
+C5C6 514E C5C6 <CJK>
+C5C7 5410 C5C7 <CJK>
+C5C8 5835 C5C8 <CJK>
+C5C9 5857 C5C9 <CJK>
+C5CA 59AC C5CA <CJK>
+C5CB 5C60 C5CB <CJK>
+C5CC 5F92 C5CC <CJK>
+C5CD 6597 C5CD <CJK>
+C5CE 675C C5CE <CJK>
+C5CF 6E21 C5CF <CJK>
+C5D0 767B C5D0 <CJK>
+C5D1 83DF C5D1 <CJK>
+C5D2 8CED C5D2 <CJK>
+C5D3 9014 C5D3 <CJK>
+C5D4 90FD C5D4 <CJK>
+C5D5 934D C5D5 <CJK>
+C5D6 7825 C5D6 <CJK>
+C5D7 783A C5D7 <CJK>
+C5D8 52AA C5D8 <CJK>
+C5D9 5EA6 C5D9 <CJK>
+C5DA 571F C5DA <CJK>
+C5DB 5974 C5DB <CJK>
+C5DC 6012 C5DC <CJK>
+C5DD 5012 C5DD <CJK>
+C5DE 515A C5DE <CJK>
+C5DF 51AC C5DF <CJK>
+C5E0 51CD C5E0 <CJK>
+C5E1 5200 C5E1 <CJK>
+C5E2 5510 C5E2 <CJK>
+C5E3 5854 C5E3 <CJK>
+C5E4 5858 C5E4 <CJK>
+C5E5 5957 C5E5 <CJK>
+C5E6 5B95 C5E6 <CJK>
+C5E7 5CF6 C5E7 <CJK>
+C5E8 5D8B C5E8 <CJK>
+C5E9 60BC C5E9 <CJK>
+C5EA 6295 C5EA <CJK>
+C5EB 642D C5EB <CJK>
+C5EC 6771 C5EC <CJK>
+C5ED 6843 C5ED <CJK>
+C5EE 68BC C5EE <CJK>
+C5EF 68DF C5EF <CJK>
+C5F0 76D7 C5F0 <CJK>
+C5F1 6DD8 C5F1 <CJK>
+C5F2 6E6F C5F2 <CJK>
+C5F3 6D9B C5F3 <CJK>
+C5F4 706F C5F4 <CJK>
+C5F5 71C8 C5F5 <CJK>
+C5F6 5F53 C5F6 <CJK>
+C5F7 75D8 C5F7 <CJK>
+C5F8 7977 C5F8 <CJK>
+C5F9 7B49 C5F9 <CJK>
+C5FA 7B54 C5FA <CJK>
+C5FB 7B52 C5FB <CJK>
+C5FC 7CD6 C5FC <CJK>
+C5FD 7D71 C5FD <CJK>
+C5FE 5230 C5FE <CJK>
+C6A1 8463 C6A1 <CJK>
+C6A2 8569 C6A2 <CJK>
+C6A3 85E4 C6A3 <CJK>
+C6A4 8A0E C6A4 <CJK>
+C6A5 8B04 C6A5 <CJK>
+C6A6 8C46 C6A6 <CJK>
+C6A7 8E0F C6A7 <CJK>
+C6A8 9003 C6A8 <CJK>
+C6A9 900F C6A9 <CJK>
+C6AA 9419 C6AA <CJK>
+C6AB 9676 C6AB <CJK>
+C6AC 982D C6AC <CJK>
+C6AD 9A30 C6AD <CJK>
+C6AE 95D8 C6AE <CJK>
+C6AF 50CD C6AF <CJK>
+C6B0 52D5 C6B0 <CJK>
+C6B1 540C C6B1 <CJK>
+C6B2 5802 C6B2 <CJK>
+C6B3 5C0E C6B3 <CJK>
+C6B4 61A7 C6B4 <CJK>
+C6B5 649E C6B5 <CJK>
+C6B6 6D1E C6B6 <CJK>
+C6B7 77B3 C6B7 <CJK>
+C6B8 7AE5 C6B8 <CJK>
+C6B9 80F4 C6B9 <CJK>
+C6BA 8404 C6BA <CJK>
+C6BB 9053 C6BB <CJK>
+C6BC 9285 C6BC <CJK>
+C6BD 5CE0 C6BD <CJK>
+C6BE 9D07 C6BE <CJK>
+C6BF 533F C6BF <CJK>
+C6C0 5F97 C6C0 <CJK>
+C6C1 5FB3 C6C1 <CJK>
+C6C2 6D9C C6C2 <CJK>
+C6C3 7279 C6C3 <CJK>
+C6C4 7763 C6C4 <CJK>
+C6C5 79BF C6C5 <CJK>
+C6C6 7BE4 C6C6 <CJK>
+C6C7 6BD2 C6C7 <CJK>
+C6C8 72EC C6C8 <CJK>
+C6C9 8AAD C6C9 <CJK>
+C6CA 6803 C6CA <CJK>
+C6CB 6A61 C6CB <CJK>
+C6CC 51F8 C6CC <CJK>
+C6CD 7A81 C6CD <CJK>
+C6CE 6934 C6CE <CJK>
+C6CF 5C4A C6CF <CJK>
+C6D0 9CF6 C6D0 <CJK>
+C6D1 82EB C6D1 <CJK>
+C6D2 5BC5 C6D2 <CJK>
+C6D3 9149 C6D3 <CJK>
+C6D4 701E C6D4 <CJK>
+C6D5 5678 C6D5 <CJK>
+C6D6 5C6F C6D6 <CJK>
+C6D7 60C7 C6D7 <CJK>
+C6D8 6566 C6D8 <CJK>
+C6D9 6C8C C6D9 <CJK>
+C6DA 8C5A C6DA <CJK>
+C6DB 9041 C6DB <CJK>
+C6DC 9813 C6DC <CJK>
+C6DD 5451 C6DD <CJK>
+C6DE 66C7 C6DE <CJK>
+C6DF 920D C6DF <CJK>
+C6E0 5948 C6E0 <CJK>
+C6E1 90A3 C6E1 <CJK>
+C6E2 5185 C6E2 <CJK>
+C6E3 4E4D C6E3 <CJK>
+C6E4 51EA C6E4 <CJK>
+C6E5 8599 C6E5 <CJK>
+C6E6 8B0E C6E6 <CJK>
+C6E7 7058 C6E7 <CJK>
+C6E8 637A C6E8 <CJK>
+C6E9 934B C6E9 <CJK>
+C6EA 6962 C6EA <CJK>
+C6EB 99B4 C6EB <CJK>
+C6EC 7E04 C6EC <CJK>
+C6ED 7577 C6ED <CJK>
+C6EE 5357 C6EE <CJK>
+C6EF 6960 C6EF <CJK>
+C6F0 8EDF C6F0 <CJK>
+C6F1 96E3 C6F1 <CJK>
+C6F2 6C5D C6F2 <CJK>
+C6F3 4E8C C6F3 <CJK>
+C6F4 5C3C C6F4 <CJK>
+C6F5 5F10 C6F5 <CJK>
+C6F6 8FE9 C6F6 <CJK>
+C6F7 5302 C6F7 <CJK>
+C6F8 8CD1 C6F8 <CJK>
+C6F9 8089 C6F9 <CJK>
+C6FA 8679 C6FA <CJK>
+C6FB 5EFF C6FB <CJK>
+C6FC 65E5 C6FC <CJK>
+C6FD 4E73 C6FD <CJK>
+C6FE 5165 C6FE <CJK>
+C7A1 5982 C7A1 <CJK>
+C7A2 5C3F C7A2 <CJK>
+C7A3 97EE C7A3 <CJK>
+C7A4 4EFB C7A4 <CJK>
+C7A5 598A C7A5 <CJK>
+C7A6 5FCD C7A6 <CJK>
+C7A7 8A8D C7A7 <CJK>
+C7A8 6FE1 C7A8 <CJK>
+C7A9 79B0 C7A9 <CJK>
+C7AA 7962 C7AA <CJK>
+C7AB 5BE7 C7AB <CJK>
+C7AC 8471 C7AC <CJK>
+C7AD 732B C7AD <CJK>
+C7AE 71B1 C7AE <CJK>
+C7AF 5E74 C7AF <CJK>
+C7B0 5FF5 C7B0 <CJK>
+C7B1 637B C7B1 <CJK>
+C7B2 649A C7B2 <CJK>
+C7B3 71C3 C7B3 <CJK>
+C7B4 7C98 C7B4 <CJK>
+C7B5 4E43 C7B5 <CJK>
+C7B6 5EFC C7B6 <CJK>
+C7B7 4E4B C7B7 <CJK>
+C7B8 57DC C7B8 <CJK>
+C7B9 56A2 C7B9 <CJK>
+C7BA 60A9 C7BA <CJK>
+C7BB 6FC3 C7BB <CJK>
+C7BC 7D0D C7BC <CJK>
+C7BD 80FD C7BD <CJK>
+C7BE 8133 C7BE <CJK>
+C7BF 81BF C7BF <CJK>
+C7C0 8FB2 C7C0 <CJK>
+C7C1 8997 C7C1 <CJK>
+C7C2 86A4 C7C2 <CJK>
+C7C3 5DF4 C7C3 <CJK>
+C7C4 628A C7C4 <CJK>
+C7C5 64AD C7C5 <CJK>
+C7C6 8987 C7C6 <CJK>
+C7C7 6777 C7C7 <CJK>
+C7C8 6CE2 C7C8 <CJK>
+C7C9 6D3E C7C9 <CJK>
+C7CA 7436 C7CA <CJK>
+C7CB 7834 C7CB <CJK>
+C7CC 5A46 C7CC <CJK>
+C7CD 7F75 C7CD <CJK>
+C7CE 82AD C7CE <CJK>
+C7CF 99AC C7CF <CJK>
+C7D0 4FF3 C7D0 <CJK>
+C7D1 5EC3 C7D1 <CJK>
+C7D2 62DD C7D2 <CJK>
+C7D3 6392 C7D3 <CJK>
+C7D4 6557 C7D4 <CJK>
+C7D5 676F C7D5 <CJK>
+C7D6 76C3 C7D6 <CJK>
+C7D7 724C C7D7 <CJK>
+C7D8 80CC C7D8 <CJK>
+C7D9 80BA C7D9 <CJK>
+C7DA 8F29 C7DA <CJK>
+C7DB 914D C7DB <CJK>
+C7DC 500D C7DC <CJK>
+C7DD 57F9 C7DD <CJK>
+C7DE 5A92 C7DE <CJK>
+C7DF 6885 C7DF <CJK>
+C7E0 6973 C7E0 <CJK>
+C7E1 7164 C7E1 <CJK>
+C7E2 72FD C7E2 <CJK>
+C7E3 8CB7 C7E3 <CJK>
+C7E4 58F2 C7E4 <CJK>
+C7E5 8CE0 C7E5 <CJK>
+C7E6 966A C7E6 <CJK>
+C7E7 9019 C7E7 <CJK>
+C7E8 877F C7E8 <CJK>
+C7E9 79E4 C7E9 <CJK>
+C7EA 77E7 C7EA <CJK>
+C7EB 8429 C7EB <CJK>
+C7EC 4F2F C7EC <CJK>
+C7ED 5265 C7ED <CJK>
+C7EE 535A C7EE <CJK>
+C7EF 62CD C7EF <CJK>
+C7F0 67CF C7F0 <CJK>
+C7F1 6CCA C7F1 <CJK>
+C7F2 767D C7F2 <CJK>
+C7F3 7B94 C7F3 <CJK>
+C7F4 7C95 C7F4 <CJK>
+C7F5 8236 C7F5 <CJK>
+C7F6 8584 C7F6 <CJK>
+C7F7 8FEB C7F7 <CJK>
+C7F8 66DD C7F8 <CJK>
+C7F9 6F20 C7F9 <CJK>
+C7FA 7206 C7FA <CJK>
+C7FB 7E1B C7FB <CJK>
+C7FC 83AB C7FC <CJK>
+C7FD 99C1 C7FD <CJK>
+C7FE 9EA6 C7FE <CJK>
+C8A1 51FD C8A1 <CJK>
+C8A2 7BB1 C8A2 <CJK>
+C8A3 7872 C8A3 <CJK>
+C8A4 7BB8 C8A4 <CJK>
+C8A5 8087 C8A5 <CJK>
+C8A6 7B48 C8A6 <CJK>
+C8A7 6AE8 C8A7 <CJK>
+C8A8 5E61 C8A8 <CJK>
+C8A9 808C C8A9 <CJK>
+C8AA 7551 C8AA <CJK>
+C8AB 7560 C8AB <CJK>
+C8AC 516B C8AC <CJK>
+C8AD 9262 C8AD <CJK>
+C8AE 6E8C C8AE <CJK>
+C8AF 767A C8AF <CJK>
+C8B0 9197 C8B0 <CJK>
+C8B1 9AEA C8B1 <CJK>
+C8B2 4F10 C8B2 <CJK>
+C8B3 7F70 C8B3 <CJK>
+C8B4 629C C8B4 <CJK>
+C8B5 7B4F C8B5 <CJK>
+C8B6 95A5 C8B6 <CJK>
+C8B7 9CE9 C8B7 <CJK>
+C8B8 567A C8B8 <CJK>
+C8B9 5859 C8B9 <CJK>
+C8BA 86E4 C8BA <CJK>
+C8BB 96BC C8BB <CJK>
+C8BC 4F34 C8BC <CJK>
+C8BD 5224 C8BD <CJK>
+C8BE 534A C8BE <CJK>
+C8BF 53CD C8BF <CJK>
+C8C0 53DB C8C0 <CJK>
+C8C1 5E06 C8C1 <CJK>
+C8C2 642C C8C2 <CJK>
+C8C3 6591 C8C3 <CJK>
+C8C4 677F C8C4 <CJK>
+C8C5 6C3E C8C5 <CJK>
+C8C6 6C4E C8C6 <CJK>
+C8C7 7248 C8C7 <CJK>
+C8C8 72AF C8C8 <CJK>
+C8C9 73ED C8C9 <CJK>
+C8CA 7554 C8CA <CJK>
+C8CB 7E41 C8CB <CJK>
+C8CC 822C C8CC <CJK>
+C8CD 85E9 C8CD <CJK>
+C8CE 8CA9 C8CE <CJK>
+C8CF 7BC4 C8CF <CJK>
+C8D0 91C6 C8D0 <CJK>
+C8D1 7169 C8D1 <CJK>
+C8D2 9812 C8D2 <CJK>
+C8D3 98EF C8D3 <CJK>
+C8D4 633D C8D4 <CJK>
+C8D5 6669 C8D5 <CJK>
+C8D6 756A C8D6 <CJK>
+C8D7 76E4 C8D7 <CJK>
+C8D8 78D0 C8D8 <CJK>
+C8D9 8543 C8D9 <CJK>
+C8DA 86EE C8DA <CJK>
+C8DB 532A C8DB <CJK>
+C8DC 5351 C8DC <CJK>
+C8DD 5426 C8DD <CJK>
+C8DE 5983 C8DE <CJK>
+C8DF 5E87 C8DF <CJK>
+C8E0 5F7C C8E0 <CJK>
+C8E1 60B2 C8E1 <CJK>
+C8E2 6249 C8E2 <CJK>
+C8E3 6279 C8E3 <CJK>
+C8E4 62AB C8E4 <CJK>
+C8E5 6590 C8E5 <CJK>
+C8E6 6BD4 C8E6 <CJK>
+C8E7 6CCC C8E7 <CJK>
+C8E8 75B2 C8E8 <CJK>
+C8E9 76AE C8E9 <CJK>
+C8EA 7891 C8EA <CJK>
+C8EB 79D8 C8EB <CJK>
+C8EC 7DCB C8EC <CJK>
+C8ED 7F77 C8ED <CJK>
+C8EE 80A5 C8EE <CJK>
+C8EF 88AB C8EF <CJK>
+C8F0 8AB9 C8F0 <CJK>
+C8F1 8CBB C8F1 <CJK>
+C8F2 907F C8F2 <CJK>
+C8F3 975E C8F3 <CJK>
+C8F4 98DB C8F4 <CJK>
+C8F5 6A0B C8F5 <CJK>
+C8F6 7C38 C8F6 <CJK>
+C8F7 5099 C8F7 <CJK>
+C8F8 5C3E C8F8 <CJK>
+C8F9 5FAE C8F9 <CJK>
+C8FA 6787 C8FA <CJK>
+C8FB 6BD8 C8FB <CJK>
+C8FC 7435 C8FC <CJK>
+C8FD 7709 C8FD <CJK>
+C8FE 7F8E C8FE <CJK>
+C9A1 9F3B C9A1 <CJK>
+C9A2 67CA C9A2 <CJK>
+C9A3 7A17 C9A3 <CJK>
+C9A4 5339 C9A4 <CJK>
+C9A5 758B C9A5 <CJK>
+C9A6 9AED C9A6 <CJK>
+C9A7 5F66 C9A7 <CJK>
+C9A8 819D C9A8 <CJK>
+C9A9 83F1 C9A9 <CJK>
+C9AA 8098 C9AA <CJK>
+C9AB 5F3C C9AB <CJK>
+C9AC 5FC5 C9AC <CJK>
+C9AD 7562 C9AD <CJK>
+C9AE 7B46 C9AE <CJK>
+C9AF 903C C9AF <CJK>
+C9B0 6867 C9B0 <CJK>
+C9B1 59EB C9B1 <CJK>
+C9B2 5A9B C9B2 <CJK>
+C9B3 7D10 C9B3 <CJK>
+C9B4 767E C9B4 <CJK>
+C9B5 8B2C C9B5 <CJK>
+C9B6 4FF5 C9B6 <CJK>
+C9B7 5F6A C9B7 <CJK>
+C9B8 6A19 C9B8 <CJK>
+C9B9 6C37 C9B9 <CJK>
+C9BA 6F02 C9BA <CJK>
+C9BB 74E2 C9BB <CJK>
+C9BC 7968 C9BC <CJK>
+C9BD 8868 C9BD <CJK>
+C9BE 8A55 C9BE <CJK>
+C9BF 8C79 C9BF <CJK>
+C9C0 5EDF C9C0 <CJK>
+C9C1 63CF C9C1 <CJK>
+C9C2 75C5 C9C2 <CJK>
+C9C3 79D2 C9C3 <CJK>
+C9C4 82D7 C9C4 <CJK>
+C9C5 9328 C9C5 <CJK>
+C9C6 92F2 C9C6 <CJK>
+C9C7 849C C9C7 <CJK>
+C9C8 86ED C9C8 <CJK>
+C9C9 9C2D C9C9 <CJK>
+C9CA 54C1 C9CA <CJK>
+C9CB 5F6C C9CB <CJK>
+C9CC 658C C9CC <CJK>
+C9CD 6D5C C9CD <CJK>
+C9CE 7015 C9CE <CJK>
+C9CF 8CA7 C9CF <CJK>
+C9D0 8CD3 C9D0 <CJK>
+C9D1 983B C9D1 <CJK>
+C9D2 654F C9D2 <CJK>
+C9D3 74F6 C9D3 <CJK>
+C9D4 4E0D C9D4 <CJK>
+C9D5 4ED8 C9D5 <CJK>
+C9D6 57E0 C9D6 <CJK>
+C9D7 592B C9D7 <CJK>
+C9D8 5A66 C9D8 <CJK>
+C9D9 5BCC C9D9 <CJK>
+C9DA 51A8 C9DA <CJK>
+C9DB 5E03 C9DB <CJK>
+C9DC 5E9C C9DC <CJK>
+C9DD 6016 C9DD <CJK>
+C9DE 6276 C9DE <CJK>
+C9DF 6577 C9DF <CJK>
+C9E0 65A7 C9E0 <CJK>
+C9E1 666E C9E1 <CJK>
+C9E2 6D6E C9E2 <CJK>
+C9E3 7236 C9E3 <CJK>
+C9E4 7B26 C9E4 <CJK>
+C9E5 8150 C9E5 <CJK>
+C9E6 819A C9E6 <CJK>
+C9E7 8299 C9E7 <CJK>
+C9E8 8B5C C9E8 <CJK>
+C9E9 8CA0 C9E9 <CJK>
+C9EA 8CE6 C9EA <CJK>
+C9EB 8D74 C9EB <CJK>
+C9EC 961C C9EC <CJK>
+C9ED 9644 C9ED <CJK>
+C9EE 4FAE C9EE <CJK>
+C9EF 64AB C9EF <CJK>
+C9F0 6B66 C9F0 <CJK>
+C9F1 821E C9F1 <CJK>
+C9F2 8461 C9F2 <CJK>
+C9F3 856A C9F3 <CJK>
+C9F4 90E8 C9F4 <CJK>
+C9F5 5C01 C9F5 <CJK>
+C9F6 6953 C9F6 <CJK>
+C9F7 98A8 C9F7 <CJK>
+C9F8 847A C9F8 <CJK>
+C9F9 8557 C9F9 <CJK>
+C9FA 4F0F C9FA <CJK>
+C9FB 526F C9FB <CJK>
+C9FC 5FA9 C9FC <CJK>
+C9FD 5E45 C9FD <CJK>
+C9FE 670D C9FE <CJK>
+CAA1 798F CAA1 <CJK>
+CAA2 8179 CAA2 <CJK>
+CAA3 8907 CAA3 <CJK>
+CAA4 8986 CAA4 <CJK>
+CAA5 6DF5 CAA5 <CJK>
+CAA6 5F17 CAA6 <CJK>
+CAA7 6255 CAA7 <CJK>
+CAA8 6CB8 CAA8 <CJK>
+CAA9 4ECF CAA9 <CJK>
+CAAA 7269 CAAA <CJK>
+CAAB 9B92 CAAB <CJK>
+CAAC 5206 CAAC <CJK>
+CAAD 543B CAAD <CJK>
+CAAE 5674 CAAE <CJK>
+CAAF 58B3 CAAF <CJK>
+CAB0 61A4 CAB0 <CJK>
+CAB1 626E CAB1 <CJK>
+CAB2 711A CAB2 <CJK>
+CAB3 596E CAB3 <CJK>
+CAB4 7C89 CAB4 <CJK>
+CAB5 7CDE CAB5 <CJK>
+CAB6 7D1B CAB6 <CJK>
+CAB7 96F0 CAB7 <CJK>
+CAB8 6587 CAB8 <CJK>
+CAB9 805E CAB9 <CJK>
+CABA 4E19 CABA <CJK>
+CABB 4F75 CABB <CJK>
+CABC 5175 CABC <CJK>
+CABD 5840 CABD <CJK>
+CABE 5E63 CABE <CJK>
+CABF 5E73 CABF <CJK>
+CAC0 5F0A CAC0 <CJK>
+CAC1 67C4 CAC1 <CJK>
+CAC2 4E26 CAC2 <CJK>
+CAC3 853D CAC3 <CJK>
+CAC4 9589 CAC4 <CJK>
+CAC5 965B CAC5 <CJK>
+CAC6 7C73 CAC6 <CJK>
+CAC7 9801 CAC7 <CJK>
+CAC8 50FB CAC8 <CJK>
+CAC9 58C1 CAC9 <CJK>
+CACA 7656 CACA <CJK>
+CACB 78A7 CACB <CJK>
+CACC 5225 CACC <CJK>
+CACD 77A5 CACD <CJK>
+CACE 8511 CACE <CJK>
+CACF 7B86 CACF <CJK>
+CAD0 504F CAD0 <CJK>
+CAD1 5909 CAD1 <CJK>
+CAD2 7247 CAD2 <CJK>
+CAD3 7BC7 CAD3 <CJK>
+CAD4 7DE8 CAD4 <CJK>
+CAD5 8FBA CAD5 <CJK>
+CAD6 8FD4 CAD6 <CJK>
+CAD7 904D CAD7 <CJK>
+CAD8 4FBF CAD8 <CJK>
+CAD9 52C9 CAD9 <CJK>
+CADA 5A29 CADA <CJK>
+CADB 5F01 CADB <CJK>
+CADC 97AD CADC <CJK>
+CADD 4FDD CADD <CJK>
+CADE 8217 CADE <CJK>
+CADF 92EA CADF <CJK>
+CAE0 5703 CAE0 <CJK>
+CAE1 6355 CAE1 <CJK>
+CAE2 6B69 CAE2 <CJK>
+CAE3 752B CAE3 <CJK>
+CAE4 88DC CAE4 <CJK>
+CAE5 8F14 CAE5 <CJK>
+CAE6 7A42 CAE6 <CJK>
+CAE7 52DF CAE7 <CJK>
+CAE8 5893 CAE8 <CJK>
+CAE9 6155 CAE9 <CJK>
+CAEA 620A CAEA <CJK>
+CAEB 66AE CAEB <CJK>
+CAEC 6BCD CAEC <CJK>
+CAED 7C3F CAED <CJK>
+CAEE 83E9 CAEE <CJK>
+CAEF 5023 CAEF <CJK>
+CAF0 4FF8 CAF0 <CJK>
+CAF1 5305 CAF1 <CJK>
+CAF2 5446 CAF2 <CJK>
+CAF3 5831 CAF3 <CJK>
+CAF4 5949 CAF4 <CJK>
+CAF5 5B9D CAF5 <CJK>
+CAF6 5CF0 CAF6 <CJK>
+CAF7 5CEF CAF7 <CJK>
+CAF8 5D29 CAF8 <CJK>
+CAF9 5E96 CAF9 <CJK>
+CAFA 62B1 CAFA <CJK>
+CAFB 6367 CAFB <CJK>
+CAFC 653E CAFC <CJK>
+CAFD 65B9 CAFD <CJK>
+CAFE 670B CAFE <CJK>
+CBA1 6CD5 CBA1 <CJK>
+CBA2 6CE1 CBA2 <CJK>
+CBA3 70F9 CBA3 <CJK>
+CBA4 7832 CBA4 <CJK>
+CBA5 7E2B CBA5 <CJK>
+CBA6 80DE CBA6 <CJK>
+CBA7 82B3 CBA7 <CJK>
+CBA8 840C CBA8 <CJK>
+CBA9 84EC CBA9 <CJK>
+CBAA 8702 CBAA <CJK>
+CBAB 8912 CBAB <CJK>
+CBAC 8A2A CBAC <CJK>
+CBAD 8C4A CBAD <CJK>
+CBAE 90A6 CBAE <CJK>
+CBAF 92D2 CBAF <CJK>
+CBB0 98FD CBB0 <CJK>
+CBB1 9CF3 CBB1 <CJK>
+CBB2 9D6C CBB2 <CJK>
+CBB3 4E4F CBB3 <CJK>
+CBB4 4EA1 CBB4 <CJK>
+CBB5 508D CBB5 <CJK>
+CBB6 5256 CBB6 <CJK>
+CBB7 574A CBB7 <CJK>
+CBB8 59A8 CBB8 <CJK>
+CBB9 5E3D CBB9 <CJK>
+CBBA 5FD8 CBBA <CJK>
+CBBB 5FD9 CBBB <CJK>
+CBBC 623F CBBC <CJK>
+CBBD 66B4 CBBD <CJK>
+CBBE 671B CBBE <CJK>
+CBBF 67D0 CBBF <CJK>
+CBC0 68D2 CBC0 <CJK>
+CBC1 5192 CBC1 <CJK>
+CBC2 7D21 CBC2 <CJK>
+CBC3 80AA CBC3 <CJK>
+CBC4 81A8 CBC4 <CJK>
+CBC5 8B00 CBC5 <CJK>
+CBC6 8C8C CBC6 <CJK>
+CBC7 8CBF CBC7 <CJK>
+CBC8 927E CBC8 <CJK>
+CBC9 9632 CBC9 <CJK>
+CBCA 5420 CBCA <CJK>
+CBCB 982C CBCB <CJK>
+CBCC 5317 CBCC <CJK>
+CBCD 50D5 CBCD <CJK>
+CBCE 535C CBCE <CJK>
+CBCF 58A8 CBCF <CJK>
+CBD0 64B2 CBD0 <CJK>
+CBD1 6734 CBD1 <CJK>
+CBD2 7267 CBD2 <CJK>
+CBD3 7766 CBD3 <CJK>
+CBD4 7A46 CBD4 <CJK>
+CBD5 91E6 CBD5 <CJK>
+CBD6 52C3 CBD6 <CJK>
+CBD7 6CA1 CBD7 <CJK>
+CBD8 6B86 CBD8 <CJK>
+CBD9 5800 CBD9 <CJK>
+CBDA 5E4C CBDA <CJK>
+CBDB 5954 CBDB <CJK>
+CBDC 672C CBDC <CJK>
+CBDD 7FFB CBDD <CJK>
+CBDE 51E1 CBDE <CJK>
+CBDF 76C6 CBDF <CJK>
+CBE0 6469 CBE0 <CJK>
+CBE1 78E8 CBE1 <CJK>
+CBE2 9B54 CBE2 <CJK>
+CBE3 9EBB CBE3 <CJK>
+CBE4 57CB CBE4 <CJK>
+CBE5 59B9 CBE5 <CJK>
+CBE6 6627 CBE6 <CJK>
+CBE7 679A CBE7 <CJK>
+CBE8 6BCE CBE8 <CJK>
+CBE9 54E9 CBE9 <CJK>
+CBEA 69D9 CBEA <CJK>
+CBEB 5E55 CBEB <CJK>
+CBEC 819C CBEC <CJK>
+CBED 6795 CBED <CJK>
+CBEE 9BAA CBEE <CJK>
+CBEF 67FE CBEF <CJK>
+CBF0 9C52 CBF0 <CJK>
+CBF1 685D CBF1 <CJK>
+CBF2 4EA6 CBF2 <CJK>
+CBF3 4FE3 CBF3 <CJK>
+CBF4 53C8 CBF4 <CJK>
+CBF5 62B9 CBF5 <CJK>
+CBF6 672B CBF6 <CJK>
+CBF7 6CAB CBF7 <CJK>
+CBF8 8FC4 CBF8 <CJK>
+CBF9 4FAD CBF9 <CJK>
+CBFA 7E6D CBFA <CJK>
+CBFB 9EBF CBFB <CJK>
+CBFC 4E07 CBFC <CJK>
+CBFD 6162 CBFD <CJK>
+CBFE 6E80 CBFE <CJK>
+CCA1 6F2B CCA1 <CJK>
+CCA2 8513 CCA2 <CJK>
+CCA3 5473 CCA3 <CJK>
+CCA4 672A CCA4 <CJK>
+CCA5 9B45 CCA5 <CJK>
+CCA6 5DF3 CCA6 <CJK>
+CCA7 7B95 CCA7 <CJK>
+CCA8 5CAC CCA8 <CJK>
+CCA9 5BC6 CCA9 <CJK>
+CCAA 871C CCAA <CJK>
+CCAB 6E4A CCAB <CJK>
+CCAC 84D1 CCAC <CJK>
+CCAD 7A14 CCAD <CJK>
+CCAE 8108 CCAE <CJK>
+CCAF 5999 CCAF <CJK>
+CCB0 7C8D CCB0 <CJK>
+CCB1 6C11 CCB1 <CJK>
+CCB2 7720 CCB2 <CJK>
+CCB3 52D9 CCB3 <CJK>
+CCB4 5922 CCB4 <CJK>
+CCB5 7121 CCB5 <CJK>
+CCB6 725F CCB6 <CJK>
+CCB7 77DB CCB7 <CJK>
+CCB8 9727 CCB8 <CJK>
+CCB9 9D61 CCB9 <CJK>
+CCBA 690B CCBA <CJK>
+CCBB 5A7F CCBB <CJK>
+CCBC 5A18 CCBC <CJK>
+CCBD 51A5 CCBD <CJK>
+CCBE 540D CCBE <CJK>
+CCBF 547D CCBF <CJK>
+CCC0 660E CCC0 <CJK>
+CCC1 76DF CCC1 <CJK>
+CCC2 8FF7 CCC2 <CJK>
+CCC3 9298 CCC3 <CJK>
+CCC4 9CF4 CCC4 <CJK>
+CCC5 59EA CCC5 <CJK>
+CCC6 725D CCC6 <CJK>
+CCC7 6EC5 CCC7 <CJK>
+CCC8 514D CCC8 <CJK>
+CCC9 68C9 CCC9 <CJK>
+CCCA 7DBF CCCA <CJK>
+CCCB 7DEC CCCB <CJK>
+CCCC 9762 CCCC <CJK>
+CCCD 9EBA CCCD <CJK>
+CCCE 6478 CCCE <CJK>
+CCCF 6A21 CCCF <CJK>
+CCD0 8302 CCD0 <CJK>
+CCD1 5984 CCD1 <CJK>
+CCD2 5B5F CCD2 <CJK>
+CCD3 6BDB CCD3 <CJK>
+CCD4 731B CCD4 <CJK>
+CCD5 76F2 CCD5 <CJK>
+CCD6 7DB2 CCD6 <CJK>
+CCD7 8017 CCD7 <CJK>
+CCD8 8499 CCD8 <CJK>
+CCD9 5132 CCD9 <CJK>
+CCDA 6728 CCDA <CJK>
+CCDB 9ED9 CCDB <CJK>
+CCDC 76EE CCDC <CJK>
+CCDD 6762 CCDD <CJK>
+CCDE 52FF CCDE <CJK>
+CCDF 9905 CCDF <CJK>
+CCE0 5C24 CCE0 <CJK>
+CCE1 623B CCE1 <CJK>
+CCE2 7C7E CCE2 <CJK>
+CCE3 8CB0 CCE3 <CJK>
+CCE4 554F CCE4 <CJK>
+CCE5 60B6 CCE5 <CJK>
+CCE6 7D0B CCE6 <CJK>
+CCE7 9580 CCE7 <CJK>
+CCE8 5301 CCE8 <CJK>
+CCE9 4E5F CCE9 <CJK>
+CCEA 51B6 CCEA <CJK>
+CCEB 591C CCEB <CJK>
+CCEC 723A CCEC <CJK>
+CCED 8036 CCED <CJK>
+CCEE 91CE CCEE <CJK>
+CCEF 5F25 CCEF <CJK>
+CCF0 77E2 CCF0 <CJK>
+CCF1 5384 CCF1 <CJK>
+CCF2 5F79 CCF2 <CJK>
+CCF3 7D04 CCF3 <CJK>
+CCF4 85AC CCF4 <CJK>
+CCF5 8A33 CCF5 <CJK>
+CCF6 8E8D CCF6 <CJK>
+CCF7 9756 CCF7 <CJK>
+CCF8 67F3 CCF8 <CJK>
+CCF9 85AE CCF9 <CJK>
+CCFA 9453 CCFA <CJK>
+CCFB 6109 CCFB <CJK>
+CCFC 6108 CCFC <CJK>
+CCFD 6CB9 CCFD <CJK>
+CCFE 7652 CCFE <CJK>
+CDA1 8AED CDA1 <CJK>
+CDA2 8F38 CDA2 <CJK>
+CDA3 552F CDA3 <CJK>
+CDA4 4F51 CDA4 <CJK>
+CDA5 512A CDA5 <CJK>
+CDA6 52C7 CDA6 <CJK>
+CDA7 53CB CDA7 <CJK>
+CDA8 5BA5 CDA8 <CJK>
+CDA9 5E7D CDA9 <CJK>
+CDAA 60A0 CDAA <CJK>
+CDAB 6182 CDAB <CJK>
+CDAC 63D6 CDAC <CJK>
+CDAD 6709 CDAD <CJK>
+CDAE 67DA CDAE <CJK>
+CDAF 6E67 CDAF <CJK>
+CDB0 6D8C CDB0 <CJK>
+CDB1 7336 CDB1 <CJK>
+CDB2 7337 CDB2 <CJK>
+CDB3 7531 CDB3 <CJK>
+CDB4 7950 CDB4 <CJK>
+CDB5 88D5 CDB5 <CJK>
+CDB6 8A98 CDB6 <CJK>
+CDB7 904A CDB7 <CJK>
+CDB8 9091 CDB8 <CJK>
+CDB9 90F5 CDB9 <CJK>
+CDBA 96C4 CDBA <CJK>
+CDBB 878D CDBB <CJK>
+CDBC 5915 CDBC <CJK>
+CDBD 4E88 CDBD <CJK>
+CDBE 4F59 CDBE <CJK>
+CDBF 4E0E CDBF <CJK>
+CDC0 8A89 CDC0 <CJK>
+CDC1 8F3F CDC1 <CJK>
+CDC2 9810 CDC2 <CJK>
+CDC3 50AD CDC3 <CJK>
+CDC4 5E7C CDC4 <CJK>
+CDC5 5996 CDC5 <CJK>
+CDC6 5BB9 CDC6 <CJK>
+CDC7 5EB8 CDC7 <CJK>
+CDC8 63DA CDC8 <CJK>
+CDC9 63FA CDC9 <CJK>
+CDCA 64C1 CDCA <CJK>
+CDCB 66DC CDCB <CJK>
+CDCC 694A CDCC <CJK>
+CDCD 69D8 CDCD <CJK>
+CDCE 6D0B CDCE <CJK>
+CDCF 6EB6 CDCF <CJK>
+CDD0 7194 CDD0 <CJK>
+CDD1 7528 CDD1 <CJK>
+CDD2 7AAF CDD2 <CJK>
+CDD3 7F8A CDD3 <CJK>
+CDD4 8000 CDD4 <CJK>
+CDD5 8449 CDD5 <CJK>
+CDD6 84C9 CDD6 <CJK>
+CDD7 8981 CDD7 <CJK>
+CDD8 8B21 CDD8 <CJK>
+CDD9 8E0A CDD9 <CJK>
+CDDA 9065 CDDA <CJK>
+CDDB 967D CDDB <CJK>
+CDDC 990A CDDC <CJK>
+CDDD 617E CDDD <CJK>
+CDDE 6291 CDDE <CJK>
+CDDF 6B32 CDDF <CJK>
+CDE0 6C83 CDE0 <CJK>
+CDE1 6D74 CDE1 <CJK>
+CDE2 7FCC CDE2 <CJK>
+CDE3 7FFC CDE3 <CJK>
+CDE4 6DC0 CDE4 <CJK>
+CDE5 7F85 CDE5 <CJK>
+CDE6 87BA CDE6 <CJK>
+CDE7 88F8 CDE7 <CJK>
+CDE8 6765 CDE8 <CJK>
+CDE9 83B1 CDE9 <CJK>
+CDEA 983C CDEA <CJK>
+CDEB 96F7 CDEB <CJK>
+CDEC 6D1B CDEC <CJK>
+CDED 7D61 CDED <CJK>
+CDEE 843D CDEE <CJK>
+CDEF 916A CDEF <CJK>
+CDF0 4E71 CDF0 <CJK>
+CDF1 5375 CDF1 <CJK>
+CDF2 5D50 CDF2 <CJK>
+CDF3 6B04 CDF3 <CJK>
+CDF4 6FEB CDF4 <CJK>
+CDF5 85CD CDF5 <CJK>
+CDF6 862D CDF6 <CJK>
+CDF7 89A7 CDF7 <CJK>
+CDF8 5229 CDF8 <CJK>
+CDF9 540F CDF9 <CJK>
+CDFA 5C65 CDFA <CJK>
+CDFB 674E CDFB <CJK>
+CDFC 68A8 CDFC <CJK>
+CDFD 7406 CDFD <CJK>
+CDFE 7483 CDFE <CJK>
+CEA1 75E2 CEA1 <CJK>
+CEA2 88CF CEA2 <CJK>
+CEA3 88E1 CEA3 <CJK>
+CEA4 91CC CEA4 <CJK>
+CEA5 96E2 CEA5 <CJK>
+CEA6 9678 CEA6 <CJK>
+CEA7 5F8B CEA7 <CJK>
+CEA8 7387 CEA8 <CJK>
+CEA9 7ACB CEA9 <CJK>
+CEAA 844E CEAA <CJK>
+CEAB 63A0 CEAB <CJK>
+CEAC 7565 CEAC <CJK>
+CEAD 5289 CEAD <CJK>
+CEAE 6D41 CEAE <CJK>
+CEAF 6E9C CEAF <CJK>
+CEB0 7409 CEB0 <CJK>
+CEB1 7559 CEB1 <CJK>
+CEB2 786B CEB2 <CJK>
+CEB3 7C92 CEB3 <CJK>
+CEB4 9686 CEB4 <CJK>
+CEB5 7ADC CEB5 <CJK>
+CEB6 9F8D CEB6 <CJK>
+CEB7 4FB6 CEB7 <CJK>
+CEB8 616E CEB8 <CJK>
+CEB9 65C5 CEB9 <CJK>
+CEBA 865C CEBA <CJK>
+CEBB 4E86 CEBB <CJK>
+CEBC 4EAE CEBC <CJK>
+CEBD 50DA CEBD <CJK>
+CEBE 4E21 CEBE <CJK>
+CEBF 51CC CEBF <CJK>
+CEC0 5BEE CEC0 <CJK>
+CEC1 6599 CEC1 <CJK>
+CEC2 6881 CEC2 <CJK>
+CEC3 6DBC CEC3 <CJK>
+CEC4 731F CEC4 <CJK>
+CEC5 7642 CEC5 <CJK>
+CEC6 77AD CEC6 <CJK>
+CEC7 7A1C CEC7 <CJK>
+CEC8 7CE7 CEC8 <CJK>
+CEC9 826F CEC9 <CJK>
+CECA 8AD2 CECA <CJK>
+CECB 907C CECB <CJK>
+CECC 91CF CECC <CJK>
+CECD 9675 CECD <CJK>
+CECE 9818 CECE <CJK>
+CECF 529B CECF <CJK>
+CED0 7DD1 CED0 <CJK>
+CED1 502B CED1 <CJK>
+CED2 5398 CED2 <CJK>
+CED3 6797 CED3 <CJK>
+CED4 6DCB CED4 <CJK>
+CED5 71D0 CED5 <CJK>
+CED6 7433 CED6 <CJK>
+CED7 81E8 CED7 <CJK>
+CED8 8F2A CED8 <CJK>
+CED9 96A3 CED9 <CJK>
+CEDA 9C57 CEDA <CJK>
+CEDB 9E9F CEDB <CJK>
+CEDC 7460 CEDC <CJK>
+CEDD 5841 CEDD <CJK>
+CEDE 6D99 CEDE <CJK>
+CEDF 7D2F CEDF <CJK>
+CEE0 985E CEE0 <CJK>
+CEE1 4EE4 CEE1 <CJK>
+CEE2 4F36 CEE2 <CJK>
+CEE3 4F8B CEE3 <CJK>
+CEE4 51B7 CEE4 <CJK>
+CEE5 52B1 CEE5 <CJK>
+CEE6 5DBA CEE6 <CJK>
+CEE7 601C CEE7 <CJK>
+CEE8 73B2 CEE8 <CJK>
+CEE9 793C CEE9 <CJK>
+CEEA 82D3 CEEA <CJK>
+CEEB 9234 CEEB <CJK>
+CEEC 96B7 CEEC <CJK>
+CEED 96F6 CEED <CJK>
+CEEE 970A CEEE <CJK>
+CEEF 9E97 CEEF <CJK>
+CEF0 9F62 CEF0 <CJK>
+CEF1 66A6 CEF1 <CJK>
+CEF2 6B74 CEF2 <CJK>
+CEF3 5217 CEF3 <CJK>
+CEF4 52A3 CEF4 <CJK>
+CEF5 70C8 CEF5 <CJK>
+CEF6 88C2 CEF6 <CJK>
+CEF7 5EC9 CEF7 <CJK>
+CEF8 604B CEF8 <CJK>
+CEF9 6190 CEF9 <CJK>
+CEFA 6F23 CEFA <CJK>
+CEFB 7149 CEFB <CJK>
+CEFC 7C3E CEFC <CJK>
+CEFD 7DF4 CEFD <CJK>
+CEFE 806F CEFE <CJK>
+CFA1 84EE CFA1 U+84EE <CJK>
+CFA2 9023 CFA2 U+9023 <CJK>
+CFA3 932C CFA3 U+932C <CJK>
+CFA4 5442 CFA4 U+5442 <CJK>
+CFA5 9B6F CFA5 U+9B6F <CJK>
+CFA6 6AD3 CFA6 U+6AD3 <CJK>
+CFA7 7089 CFA7 U+7089 <CJK>
+CFA8 8CC2 CFA8 U+8CC2 <CJK>
+CFA9 8DEF CFA9 U+8DEF <CJK>
+CFAA 9732 CFAA U+9732 <CJK>
+CFAB 52B4 CFAB U+52B4 <CJK>
+CFAC 5A41 CFAC U+5A41 <CJK>
+CFAD 5ECA CFAD U+5ECA <CJK>
+CFAE 5F04 CFAE U+5F04 <CJK>
+CFAF 6717 CFAF U+6717 <CJK>
+CFB0 697C CFB0 U+697C <CJK>
+CFB1 6994 CFB1 U+6994 <CJK>
+CFB2 6D6A CFB2 U+6D6A <CJK>
+CFB3 6F0F CFB3 U+6F0F <CJK>
+CFB4 7262 CFB4 U+7262 <CJK>
+CFB5 72FC CFB5 U+72FC <CJK>
+CFB6 7BED CFB6 U+7BED <CJK>
+CFB7 8001 CFB7 U+8001 <CJK>
+CFB8 807E CFB8 U+807E <CJK>
+CFB9 874B CFB9 U+874B <CJK>
+CFBA 90CE CFBA U+90CE <CJK>
+CFBB 516D CFBB U+516D <CJK>
+CFBC 9E93 CFBC U+9E93 <CJK>
+CFBD 7984 CFBD U+7984 <CJK>
+CFBE 808B CFBE U+808B <CJK>
+CFBF 9332 CFBF U+9332 <CJK>
+CFC0 8AD6 CFC0 U+8AD6 <CJK>
+CFC1 502D CFC1 U+502D <CJK>
+CFC2 548C CFC2 U+548C <CJK>
+CFC3 8A71 CFC3 U+8A71 <CJK>
+CFC4 6B6A CFC4 U+6B6A <CJK>
+CFC5 8CC4 CFC5 U+8CC4 <CJK>
+CFC6 8107 CFC6 U+8107 <CJK>
+CFC7 60D1 CFC7 U+60D1 <CJK>
+CFC8 67A0 CFC8 U+67A0 <CJK>
+CFC9 9DF2 CFC9 U+9DF2 <CJK>
+CFCA 4E99 CFCA U+4E99 <CJK>
+CFCB 4E98 CFCB U+4E98 <CJK>
+CFCC 9C10 CFCC U+9C10 <CJK>
+CFCD 8A6B CFCD U+8A6B <CJK>
+CFCE 85C1 CFCE U+85C1 <CJK>
+CFCF 8568 CFCF U+8568 <CJK>
+CFD0 6900 CFD0 U+6900 <CJK>
+CFD1 6E7E CFD1 U+6E7E <CJK>
+CFD2 7897 CFD2 U+7897 <CJK>
+CFD3 8155 CFD3 U+8155 <CJK>
+D0A1 5F0C D0A1 <CJK>
+D0A2 4E10 D0A2 <CJK>
+D0A3 4E15 D0A3 <CJK>
+D0A4 4E2A D0A4 <CJK>
+D0A5 4E31 D0A5 <CJK>
+D0A6 4E36 D0A6 <CJK>
+D0A7 4E3C D0A7 <CJK>
+D0A8 4E3F D0A8 <CJK>
+D0A9 4E42 D0A9 <CJK>
+D0AA 4E56 D0AA <CJK>
+D0AB 4E58 D0AB <CJK>
+D0AC 4E82 D0AC <CJK>
+D0AD 4E85 D0AD <CJK>
+D0AE 8C6B D0AE <CJK>
+D0AF 4E8A D0AF <CJK>
+D0B0 8212 D0B0 <CJK>
+D0B1 5F0D D0B1 <CJK>
+D0B2 4E8E D0B2 <CJK>
+D0B3 4E9E D0B3 <CJK>
+D0B4 4E9F D0B4 <CJK>
+D0B5 4EA0 D0B5 <CJK>
+D0B6 4EA2 D0B6 <CJK>
+D0B7 4EB0 D0B7 <CJK>
+D0B8 4EB3 D0B8 <CJK>
+D0B9 4EB6 D0B9 <CJK>
+D0BA 4ECE D0BA <CJK>
+D0BB 4ECD D0BB <CJK>
+D0BC 4EC4 D0BC <CJK>
+D0BD 4EC6 D0BD <CJK>
+D0BE 4EC2 D0BE <CJK>
+D0BF 4ED7 D0BF <CJK>
+D0C0 4EDE D0C0 <CJK>
+D0C1 4EED D0C1 <CJK>
+D0C2 4EDF D0C2 <CJK>
+D0C3 4EF7 D0C3 <CJK>
+D0C4 4F09 D0C4 <CJK>
+D0C5 4F5A D0C5 <CJK>
+D0C6 4F30 D0C6 <CJK>
+D0C7 4F5B D0C7 <CJK>
+D0C8 4F5D D0C8 <CJK>
+D0C9 4F57 D0C9 <CJK>
+D0CA 4F47 D0CA <CJK>
+D0CB 4F76 D0CB <CJK>
+D0CC 4F88 D0CC <CJK>
+D0CD 4F8F D0CD <CJK>
+D0CE 4F98 D0CE <CJK>
+D0CF 4F7B D0CF <CJK>
+D0D0 4F69 D0D0 <CJK>
+D0D1 4F70 D0D1 <CJK>
+D0D2 4F91 D0D2 <CJK>
+D0D3 4F6F D0D3 <CJK>
+D0D4 4F86 D0D4 <CJK>
+D0D5 4F96 D0D5 <CJK>
+D0D6 5118 D0D6 <CJK>
+D0D7 4FD4 D0D7 <CJK>
+D0D8 4FDF D0D8 <CJK>
+D0D9 4FCE D0D9 <CJK>
+D0DA 4FD8 D0DA <CJK>
+D0DB 4FDB D0DB <CJK>
+D0DC 4FD1 D0DC <CJK>
+D0DD 4FDA D0DD <CJK>
+D0DE 4FD0 D0DE <CJK>
+D0DF 4FE4 D0DF <CJK>
+D0E0 4FE5 D0E0 <CJK>
+D0E1 501A D0E1 <CJK>
+D0E2 5028 D0E2 <CJK>
+D0E3 5014 D0E3 <CJK>
+D0E4 502A D0E4 <CJK>
+D0E5 5025 D0E5 <CJK>
+D0E6 5005 D0E6 <CJK>
+D0E7 4F1C D0E7 <CJK>
+D0E8 4FF6 D0E8 <CJK>
+D0E9 5021 D0E9 <CJK>
+D0EA 5029 D0EA <CJK>
+D0EB 502C D0EB <CJK>
+D0EC 4FFE D0EC <CJK>
+D0ED 4FEF D0ED <CJK>
+D0EE 5011 D0EE <CJK>
+D0EF 5006 D0EF <CJK>
+D0F0 5043 D0F0 <CJK>
+D0F1 5047 D0F1 <CJK>
+D0F2 6703 D0F2 <CJK>
+D0F3 5055 D0F3 <CJK>
+D0F4 5050 D0F4 <CJK>
+D0F5 5048 D0F5 <CJK>
+D0F6 505A D0F6 <CJK>
+D0F7 5056 D0F7 <CJK>
+D0F8 506C D0F8 <CJK>
+D0F9 5078 D0F9 <CJK>
+D0FA 5080 D0FA <CJK>
+D0FB 509A D0FB <CJK>
+D0FC 5085 D0FC <CJK>
+D0FD 50B4 D0FD <CJK>
+D0FE 50B2 D0FE <CJK>
+D1A1 50C9 D1A1 <CJK>
+D1A2 50CA D1A2 <CJK>
+D1A3 50B3 D1A3 <CJK>
+D1A4 50C2 D1A4 <CJK>
+D1A5 50D6 D1A5 <CJK>
+D1A6 50DE D1A6 <CJK>
+D1A7 50E5 D1A7 <CJK>
+D1A8 50ED D1A8 <CJK>
+D1A9 50E3 D1A9 <CJK>
+D1AA 50EE D1AA <CJK>
+D1AB 50F9 D1AB <CJK>
+D1AC 50F5 D1AC <CJK>
+D1AD 5109 D1AD <CJK>
+D1AE 5101 D1AE <CJK>
+D1AF 5102 D1AF <CJK>
+D1B0 5116 D1B0 <CJK>
+D1B1 5115 D1B1 <CJK>
+D1B2 5114 D1B2 <CJK>
+D1B3 511A D1B3 <CJK>
+D1B4 5121 D1B4 <CJK>
+D1B5 513A D1B5 <CJK>
+D1B6 5137 D1B6 <CJK>
+D1B7 513C D1B7 <CJK>
+D1B8 513B D1B8 <CJK>
+D1B9 513F D1B9 <CJK>
+D1BA 5140 D1BA <CJK>
+D1BB 5152 D1BB <CJK>
+D1BC 514C D1BC <CJK>
+D1BD 5154 D1BD <CJK>
+D1BE 5162 D1BE <CJK>
+D1BF 7AF8 D1BF <CJK>
+D1C0 5169 D1C0 <CJK>
+D1C1 516A D1C1 <CJK>
+D1C2 516E D1C2 <CJK>
+D1C3 5180 D1C3 <CJK>
+D1C4 5182 D1C4 <CJK>
+D1C5 56D8 D1C5 <CJK>
+D1C6 518C D1C6 <CJK>
+D1C7 5189 D1C7 <CJK>
+D1C8 518F D1C8 <CJK>
+D1C9 5191 D1C9 <CJK>
+D1CA 5193 D1CA <CJK>
+D1CB 5195 D1CB <CJK>
+D1CC 5196 D1CC <CJK>
+D1CD 51A4 D1CD <CJK>
+D1CE 51A6 D1CE <CJK>
+D1CF 51A2 D1CF <CJK>
+D1D0 51A9 D1D0 <CJK>
+D1D1 51AA D1D1 <CJK>
+D1D2 51AB D1D2 <CJK>
+D1D3 51B3 D1D3 <CJK>
+D1D4 51B1 D1D4 <CJK>
+D1D5 51B2 D1D5 <CJK>
+D1D6 51B0 D1D6 <CJK>
+D1D7 51B5 D1D7 <CJK>
+D1D8 51BD D1D8 <CJK>
+D1D9 51C5 D1D9 <CJK>
+D1DA 51C9 D1DA <CJK>
+D1DB 51DB D1DB <CJK>
+D1DC 51E0 D1DC <CJK>
+D1DD 8655 D1DD <CJK>
+D1DE 51E9 D1DE <CJK>
+D1DF 51ED D1DF <CJK>
+D1E0 51F0 D1E0 <CJK>
+D1E1 51F5 D1E1 <CJK>
+D1E2 51FE D1E2 <CJK>
+D1E3 5204 D1E3 <CJK>
+D1E4 520B D1E4 <CJK>
+D1E5 5214 D1E5 <CJK>
+D1E6 520E D1E6 <CJK>
+D1E7 5227 D1E7 <CJK>
+D1E8 522A D1E8 <CJK>
+D1E9 522E D1E9 <CJK>
+D1EA 5233 D1EA <CJK>
+D1EB 5239 D1EB <CJK>
+D1EC 524F D1EC <CJK>
+D1ED 5244 D1ED <CJK>
+D1EE 524B D1EE <CJK>
+D1EF 524C D1EF <CJK>
+D1F0 525E D1F0 <CJK>
+D1F1 5254 D1F1 <CJK>
+D1F2 526A D1F2 <CJK>
+D1F3 5274 D1F3 <CJK>
+D1F4 5269 D1F4 <CJK>
+D1F5 5273 D1F5 <CJK>
+D1F6 527F D1F6 <CJK>
+D1F7 527D D1F7 <CJK>
+D1F8 528D D1F8 <CJK>
+D1F9 5294 D1F9 <CJK>
+D1FA 5292 D1FA <CJK>
+D1FB 5271 D1FB <CJK>
+D1FC 5288 D1FC <CJK>
+D1FD 5291 D1FD <CJK>
+D1FE 8FA8 D1FE <CJK>
+D2A1 8FA7 D2A1 <CJK>
+D2A2 52AC D2A2 <CJK>
+D2A3 52AD D2A3 <CJK>
+D2A4 52BC D2A4 <CJK>
+D2A5 52B5 D2A5 <CJK>
+D2A6 52C1 D2A6 <CJK>
+D2A7 52CD D2A7 <CJK>
+D2A8 52D7 D2A8 <CJK>
+D2A9 52DE D2A9 <CJK>
+D2AA 52E3 D2AA <CJK>
+D2AB 52E6 D2AB <CJK>
+D2AC 98ED D2AC <CJK>
+D2AD 52E0 D2AD <CJK>
+D2AE 52F3 D2AE <CJK>
+D2AF 52F5 D2AF <CJK>
+D2B0 52F8 D2B0 <CJK>
+D2B1 52F9 D2B1 <CJK>
+D2B2 5306 D2B2 <CJK>
+D2B3 5308 D2B3 <CJK>
+D2B4 7538 D2B4 <CJK>
+D2B5 530D D2B5 <CJK>
+D2B6 5310 D2B6 <CJK>
+D2B7 530F D2B7 <CJK>
+D2B8 5315 D2B8 <CJK>
+D2B9 531A D2B9 <CJK>
+D2BA 5323 D2BA <CJK>
+D2BB 532F D2BB <CJK>
+D2BC 5331 D2BC <CJK>
+D2BD 5333 D2BD <CJK>
+D2BE 5338 D2BE <CJK>
+D2BF 5340 D2BF <CJK>
+D2C0 5346 D2C0 <CJK>
+D2C1 5345 D2C1 <CJK>
+D2C2 4E17 D2C2 <CJK>
+D2C3 5349 D2C3 <CJK>
+D2C4 534D D2C4 <CJK>
+D2C5 51D6 D2C5 <CJK>
+D2C6 535E D2C6 <CJK>
+D2C7 5369 D2C7 <CJK>
+D2C8 536E D2C8 <CJK>
+D2C9 5918 D2C9 <CJK>
+D2CA 537B D2CA <CJK>
+D2CB 5377 D2CB <CJK>
+D2CC 5382 D2CC <CJK>
+D2CD 5396 D2CD <CJK>
+D2CE 53A0 D2CE <CJK>
+D2CF 53A6 D2CF <CJK>
+D2D0 53A5 D2D0 <CJK>
+D2D1 53AE D2D1 <CJK>
+D2D2 53B0 D2D2 <CJK>
+D2D3 53B6 D2D3 <CJK>
+D2D4 53C3 D2D4 <CJK>
+D2D5 7C12 D2D5 <CJK>
+D2D6 96D9 D2D6 <CJK>
+D2D7 53DF D2D7 <CJK>
+D2D8 66FC D2D8 <CJK>
+D2D9 71EE D2D9 <CJK>
+D2DA 53EE D2DA <CJK>
+D2DB 53E8 D2DB <CJK>
+D2DC 53ED D2DC <CJK>
+D2DD 53FA D2DD <CJK>
+D2DE 5401 D2DE <CJK>
+D2DF 543D D2DF <CJK>
+D2E0 5440 D2E0 <CJK>
+D2E1 542C D2E1 <CJK>
+D2E2 542D D2E2 <CJK>
+D2E3 543C D2E3 <CJK>
+D2E4 542E D2E4 <CJK>
+D2E5 5436 D2E5 <CJK>
+D2E6 5429 D2E6 <CJK>
+D2E7 541D D2E7 <CJK>
+D2E8 544E D2E8 <CJK>
+D2E9 548F D2E9 <CJK>
+D2EA 5475 D2EA <CJK>
+D2EB 548E D2EB <CJK>
+D2EC 545F D2EC <CJK>
+D2ED 5471 D2ED <CJK>
+D2EE 5477 D2EE <CJK>
+D2EF 5470 D2EF <CJK>
+D2F0 5492 D2F0 <CJK>
+D2F1 547B D2F1 <CJK>
+D2F2 5480 D2F2 <CJK>
+D2F3 5476 D2F3 <CJK>
+D2F4 5484 D2F4 <CJK>
+D2F5 5490 D2F5 <CJK>
+D2F6 5486 D2F6 <CJK>
+D2F7 54C7 D2F7 <CJK>
+D2F8 54A2 D2F8 <CJK>
+D2F9 54B8 D2F9 <CJK>
+D2FA 54A5 D2FA <CJK>
+D2FB 54AC D2FB <CJK>
+D2FC 54C4 D2FC <CJK>
+D2FD 54C8 D2FD <CJK>
+D2FE 54A8 D2FE <CJK>
+D3A1 54AB D3A1 <CJK>
+D3A2 54C2 D3A2 <CJK>
+D3A3 54A4 D3A3 <CJK>
+D3A4 54BE D3A4 <CJK>
+D3A5 54BC D3A5 <CJK>
+D3A6 54D8 D3A6 <CJK>
+D3A7 54E5 D3A7 <CJK>
+D3A8 54E6 D3A8 <CJK>
+D3A9 550F D3A9 <CJK>
+D3AA 5514 D3AA <CJK>
+D3AB 54FD D3AB <CJK>
+D3AC 54EE D3AC <CJK>
+D3AD 54ED D3AD <CJK>
+D3AE 54FA D3AE <CJK>
+D3AF 54E2 D3AF <CJK>
+D3B0 5539 D3B0 <CJK>
+D3B1 5540 D3B1 <CJK>
+D3B2 5563 D3B2 <CJK>
+D3B3 554C D3B3 <CJK>
+D3B4 552E D3B4 <CJK>
+D3B5 555C D3B5 <CJK>
+D3B6 5545 D3B6 <CJK>
+D3B7 5556 D3B7 <CJK>
+D3B8 5557 D3B8 <CJK>
+D3B9 5538 D3B9 <CJK>
+D3BA 5533 D3BA <CJK>
+D3BB 555D D3BB <CJK>
+D3BC 5599 D3BC <CJK>
+D3BD 5580 D3BD <CJK>
+D3BE 54AF D3BE <CJK>
+D3BF 558A D3BF <CJK>
+D3C0 559F D3C0 <CJK>
+D3C1 557B D3C1 <CJK>
+D3C2 557E D3C2 <CJK>
+D3C3 5598 D3C3 <CJK>
+D3C4 559E D3C4 <CJK>
+D3C5 55AE D3C5 <CJK>
+D3C6 557C D3C6 <CJK>
+D3C7 5583 D3C7 <CJK>
+D3C8 55A9 D3C8 <CJK>
+D3C9 5587 D3C9 <CJK>
+D3CA 55A8 D3CA <CJK>
+D3CB 55DA D3CB <CJK>
+D3CC 55C5 D3CC <CJK>
+D3CD 55DF D3CD <CJK>
+D3CE 55C4 D3CE <CJK>
+D3CF 55DC D3CF <CJK>
+D3D0 55E4 D3D0 <CJK>
+D3D1 55D4 D3D1 <CJK>
+D3D2 5614 D3D2 <CJK>
+D3D3 55F7 D3D3 <CJK>
+D3D4 5616 D3D4 <CJK>
+D3D5 55FE D3D5 <CJK>
+D3D6 55FD D3D6 <CJK>
+D3D7 561B D3D7 <CJK>
+D3D8 55F9 D3D8 <CJK>
+D3D9 564E D3D9 <CJK>
+D3DA 5650 D3DA <CJK>
+D3DB 71DF D3DB <CJK>
+D3DC 5634 D3DC <CJK>
+D3DD 5636 D3DD <CJK>
+D3DE 5632 D3DE <CJK>
+D3DF 5638 D3DF <CJK>
+D3E0 566B D3E0 <CJK>
+D3E1 5664 D3E1 <CJK>
+D3E2 562F D3E2 <CJK>
+D3E3 566C D3E3 <CJK>
+D3E4 566A D3E4 <CJK>
+D3E5 5686 D3E5 <CJK>
+D3E6 5680 D3E6 <CJK>
+D3E7 568A D3E7 <CJK>
+D3E8 56A0 D3E8 <CJK>
+D3E9 5694 D3E9 <CJK>
+D3EA 568F D3EA <CJK>
+D3EB 56A5 D3EB <CJK>
+D3EC 56AE D3EC <CJK>
+D3ED 56B6 D3ED <CJK>
+D3EE 56B4 D3EE <CJK>
+D3EF 56C2 D3EF <CJK>
+D3F0 56BC D3F0 <CJK>
+D3F1 56C1 D3F1 <CJK>
+D3F2 56C3 D3F2 <CJK>
+D3F3 56C0 D3F3 <CJK>
+D3F4 56C8 D3F4 <CJK>
+D3F5 56CE D3F5 <CJK>
+D3F6 56D1 D3F6 <CJK>
+D3F7 56D3 D3F7 <CJK>
+D3F8 56D7 D3F8 <CJK>
+D3F9 56EE D3F9 <CJK>
+D3FA 56F9 D3FA <CJK>
+D3FB 5700 D3FB <CJK>
+D3FC 56FF D3FC <CJK>
+D3FD 5704 D3FD <CJK>
+D3FE 5709 D3FE <CJK>
+D4A1 5708 D4A1 <CJK>
+D4A2 570B D4A2 <CJK>
+D4A3 570D D4A3 <CJK>
+D4A4 5713 D4A4 <CJK>
+D4A5 5718 D4A5 <CJK>
+D4A6 5716 D4A6 <CJK>
+D4A7 55C7 D4A7 <CJK>
+D4A8 571C D4A8 <CJK>
+D4A9 5726 D4A9 <CJK>
+D4AA 5737 D4AA <CJK>
+D4AB 5738 D4AB <CJK>
+D4AC 574E D4AC <CJK>
+D4AD 573B D4AD <CJK>
+D4AE 5740 D4AE <CJK>
+D4AF 574F D4AF <CJK>
+D4B0 5769 D4B0 <CJK>
+D4B1 57C0 D4B1 <CJK>
+D4B2 5788 D4B2 <CJK>
+D4B3 5761 D4B3 <CJK>
+D4B4 577F D4B4 <CJK>
+D4B5 5789 D4B5 <CJK>
+D4B6 5793 D4B6 <CJK>
+D4B7 57A0 D4B7 <CJK>
+D4B8 57B3 D4B8 <CJK>
+D4B9 57A4 D4B9 <CJK>
+D4BA 57AA D4BA <CJK>
+D4BB 57B0 D4BB <CJK>
+D4BC 57C3 D4BC <CJK>
+D4BD 57C6 D4BD <CJK>
+D4BE 57D4 D4BE <CJK>
+D4BF 57D2 D4BF <CJK>
+D4C0 57D3 D4C0 <CJK>
+D4C1 580A D4C1 <CJK>
+D4C2 57D6 D4C2 <CJK>
+D4C3 57E3 D4C3 <CJK>
+D4C4 580B D4C4 <CJK>
+D4C5 5819 D4C5 <CJK>
+D4C6 581D D4C6 <CJK>
+D4C7 5872 D4C7 <CJK>
+D4C8 5821 D4C8 <CJK>
+D4C9 5862 D4C9 <CJK>
+D4CA 584B D4CA <CJK>
+D4CB 5870 D4CB <CJK>
+D4CC 6BC0 D4CC <CJK>
+D4CD 5852 D4CD <CJK>
+D4CE 583D D4CE <CJK>
+D4CF 5879 D4CF <CJK>
+D4D0 5885 D4D0 <CJK>
+D4D1 58B9 D4D1 <CJK>
+D4D2 589F D4D2 <CJK>
+D4D3 58AB D4D3 <CJK>
+D4D4 58BA D4D4 <CJK>
+D4D5 58DE D4D5 <CJK>
+D4D6 58BB D4D6 <CJK>
+D4D7 58B8 D4D7 <CJK>
+D4D8 58AE D4D8 <CJK>
+D4D9 58C5 D4D9 <CJK>
+D4DA 58D3 D4DA <CJK>
+D4DB 58D1 D4DB <CJK>
+D4DC 58D7 D4DC <CJK>
+D4DD 58D9 D4DD <CJK>
+D4DE 58D8 D4DE <CJK>
+D4DF 58E5 D4DF <CJK>
+D4E0 58DC D4E0 <CJK>
+D4E1 58E4 D4E1 <CJK>
+D4E2 58DF D4E2 <CJK>
+D4E3 58EF D4E3 <CJK>
+D4E4 58FA D4E4 <CJK>
+D4E5 58F9 D4E5 <CJK>
+D4E6 58FB D4E6 <CJK>
+D4E7 58FC D4E7 <CJK>
+D4E8 58FD D4E8 <CJK>
+D4E9 5902 D4E9 <CJK>
+D4EA 590A D4EA <CJK>
+D4EB 5910 D4EB <CJK>
+D4EC 591B D4EC <CJK>
+D4ED 68A6 D4ED <CJK>
+D4EE 5925 D4EE <CJK>
+D4EF 592C D4EF <CJK>
+D4F0 592D D4F0 <CJK>
+D4F1 5932 D4F1 <CJK>
+D4F2 5938 D4F2 <CJK>
+D4F3 593E D4F3 <CJK>
+D4F4 7AD2 D4F4 <CJK>
+D4F5 5955 D4F5 <CJK>
+D4F6 5950 D4F6 <CJK>
+D4F7 594E D4F7 <CJK>
+D4F8 595A D4F8 <CJK>
+D4F9 5958 D4F9 <CJK>
+D4FA 5962 D4FA <CJK>
+D4FB 5960 D4FB <CJK>
+D4FC 5967 D4FC <CJK>
+D4FD 596C D4FD <CJK>
+D4FE 5969 D4FE <CJK>
+D5A1 5978 D5A1 <CJK>
+D5A2 5981 D5A2 <CJK>
+D5A3 599D D5A3 <CJK>
+D5A4 4F5E D5A4 <CJK>
+D5A5 4FAB D5A5 <CJK>
+D5A6 59A3 D5A6 <CJK>
+D5A7 59B2 D5A7 <CJK>
+D5A8 59C6 D5A8 <CJK>
+D5A9 59E8 D5A9 <CJK>
+D5AA 59DC D5AA <CJK>
+D5AB 598D D5AB <CJK>
+D5AC 59D9 D5AC <CJK>
+D5AD 59DA D5AD <CJK>
+D5AE 5A25 D5AE <CJK>
+D5AF 5A1F D5AF <CJK>
+D5B0 5A11 D5B0 <CJK>
+D5B1 5A1C D5B1 <CJK>
+D5B2 5A09 D5B2 <CJK>
+D5B3 5A1A D5B3 <CJK>
+D5B4 5A40 D5B4 <CJK>
+D5B5 5A6C D5B5 <CJK>
+D5B6 5A49 D5B6 <CJK>
+D5B7 5A35 D5B7 <CJK>
+D5B8 5A36 D5B8 <CJK>
+D5B9 5A62 D5B9 <CJK>
+D5BA 5A6A D5BA <CJK>
+D5BB 5A9A D5BB <CJK>
+D5BC 5ABC D5BC <CJK>
+D5BD 5ABE D5BD <CJK>
+D5BE 5ACB D5BE <CJK>
+D5BF 5AC2 D5BF <CJK>
+D5C0 5ABD D5C0 <CJK>
+D5C1 5AE3 D5C1 <CJK>
+D5C2 5AD7 D5C2 <CJK>
+D5C3 5AE6 D5C3 <CJK>
+D5C4 5AE9 D5C4 <CJK>
+D5C5 5AD6 D5C5 <CJK>
+D5C6 5AFA D5C6 <CJK>
+D5C7 5AFB D5C7 <CJK>
+D5C8 5B0C D5C8 <CJK>
+D5C9 5B0B D5C9 <CJK>
+D5CA 5B16 D5CA <CJK>
+D5CB 5B32 D5CB <CJK>
+D5CC 5AD0 D5CC <CJK>
+D5CD 5B2A D5CD <CJK>
+D5CE 5B36 D5CE <CJK>
+D5CF 5B3E D5CF <CJK>
+D5D0 5B43 D5D0 <CJK>
+D5D1 5B45 D5D1 <CJK>
+D5D2 5B40 D5D2 <CJK>
+D5D3 5B51 D5D3 <CJK>
+D5D4 5B55 D5D4 <CJK>
+D5D5 5B5A D5D5 <CJK>
+D5D6 5B5B D5D6 <CJK>
+D5D7 5B65 D5D7 <CJK>
+D5D8 5B69 D5D8 <CJK>
+D5D9 5B70 D5D9 <CJK>
+D5DA 5B73 D5DA <CJK>
+D5DB 5B75 D5DB <CJK>
+D5DC 5B78 D5DC <CJK>
+D5DD 6588 D5DD <CJK>
+D5DE 5B7A D5DE <CJK>
+D5DF 5B80 D5DF <CJK>
+D5E0 5B83 D5E0 <CJK>
+D5E1 5BA6 D5E1 <CJK>
+D5E2 5BB8 D5E2 <CJK>
+D5E3 5BC3 D5E3 <CJK>
+D5E4 5BC7 D5E4 <CJK>
+D5E5 5BC9 D5E5 <CJK>
+D5E6 5BD4 D5E6 <CJK>
+D5E7 5BD0 D5E7 <CJK>
+D5E8 5BE4 D5E8 <CJK>
+D5E9 5BE6 D5E9 <CJK>
+D5EA 5BE2 D5EA <CJK>
+D5EB 5BDE D5EB <CJK>
+D5EC 5BE5 D5EC <CJK>
+D5ED 5BEB D5ED <CJK>
+D5EE 5BF0 D5EE <CJK>
+D5EF 5BF6 D5EF <CJK>
+D5F0 5BF3 D5F0 <CJK>
+D5F1 5C05 D5F1 <CJK>
+D5F2 5C07 D5F2 <CJK>
+D5F3 5C08 D5F3 <CJK>
+D5F4 5C0D D5F4 <CJK>
+D5F5 5C13 D5F5 <CJK>
+D5F6 5C20 D5F6 <CJK>
+D5F7 5C22 D5F7 <CJK>
+D5F8 5C28 D5F8 <CJK>
+D5F9 5C38 D5F9 <CJK>
+D5FA 5C39 D5FA <CJK>
+D5FB 5C41 D5FB <CJK>
+D5FC 5C46 D5FC <CJK>
+D5FD 5C4E D5FD <CJK>
+D5FE 5C53 D5FE <CJK>
+D6A1 5C50 D6A1 <CJK>
+D6A2 5C4F D6A2 <CJK>
+D6A3 5B71 D6A3 <CJK>
+D6A4 5C6C D6A4 <CJK>
+D6A5 5C6E D6A5 <CJK>
+D6A6 4E62 D6A6 <CJK>
+D6A7 5C76 D6A7 <CJK>
+D6A8 5C79 D6A8 <CJK>
+D6A9 5C8C D6A9 <CJK>
+D6AA 5C91 D6AA <CJK>
+D6AB 5C94 D6AB <CJK>
+D6AC 599B D6AC <CJK>
+D6AD 5CAB D6AD <CJK>
+D6AE 5CBB D6AE <CJK>
+D6AF 5CB6 D6AF <CJK>
+D6B0 5CBC D6B0 <CJK>
+D6B1 5CB7 D6B1 <CJK>
+D6B2 5CC5 D6B2 <CJK>
+D6B3 5CBE D6B3 <CJK>
+D6B4 5CC7 D6B4 <CJK>
+D6B5 5CD9 D6B5 <CJK>
+D6B6 5CE9 D6B6 <CJK>
+D6B7 5CFD D6B7 <CJK>
+D6B8 5CFA D6B8 <CJK>
+D6B9 5CED D6B9 <CJK>
+D6BA 5D8C D6BA <CJK>
+D6BB 5CEA D6BB <CJK>
+D6BC 5D0B D6BC <CJK>
+D6BD 5D15 D6BD <CJK>
+D6BE 5D17 D6BE <CJK>
+D6BF 5D5C D6BF <CJK>
+D6C0 5D1F D6C0 <CJK>
+D6C1 5D1B D6C1 <CJK>
+D6C2 5D11 D6C2 <CJK>
+D6C3 5D14 D6C3 <CJK>
+D6C4 5D22 D6C4 <CJK>
+D6C5 5D1A D6C5 <CJK>
+D6C6 5D19 D6C6 <CJK>
+D6C7 5D18 D6C7 <CJK>
+D6C8 5D4C D6C8 <CJK>
+D6C9 5D52 D6C9 <CJK>
+D6CA 5D4E D6CA <CJK>
+D6CB 5D4B D6CB <CJK>
+D6CC 5D6C D6CC <CJK>
+D6CD 5D73 D6CD <CJK>
+D6CE 5D76 D6CE <CJK>
+D6CF 5D87 D6CF <CJK>
+D6D0 5D84 D6D0 <CJK>
+D6D1 5D82 D6D1 <CJK>
+D6D2 5DA2 D6D2 <CJK>
+D6D3 5D9D D6D3 <CJK>
+D6D4 5DAC D6D4 <CJK>
+D6D5 5DAE D6D5 <CJK>
+D6D6 5DBD D6D6 <CJK>
+D6D7 5D90 D6D7 <CJK>
+D6D8 5DB7 D6D8 <CJK>
+D6D9 5DBC D6D9 <CJK>
+D6DA 5DC9 D6DA <CJK>
+D6DB 5DCD D6DB <CJK>
+D6DC 5DD3 D6DC <CJK>
+D6DD 5DD2 D6DD <CJK>
+D6DE 5DD6 D6DE <CJK>
+D6DF 5DDB D6DF <CJK>
+D6E0 5DEB D6E0 <CJK>
+D6E1 5DF2 D6E1 <CJK>
+D6E2 5DF5 D6E2 <CJK>
+D6E3 5E0B D6E3 <CJK>
+D6E4 5E1A D6E4 <CJK>
+D6E5 5E19 D6E5 <CJK>
+D6E6 5E11 D6E6 <CJK>
+D6E7 5E1B D6E7 <CJK>
+D6E8 5E36 D6E8 <CJK>
+D6E9 5E37 D6E9 <CJK>
+D6EA 5E44 D6EA <CJK>
+D6EB 5E43 D6EB <CJK>
+D6EC 5E40 D6EC <CJK>
+D6ED 5E4E D6ED <CJK>
+D6EE 5E57 D6EE <CJK>
+D6EF 5E54 D6EF <CJK>
+D6F0 5E5F D6F0 <CJK>
+D6F1 5E62 D6F1 <CJK>
+D6F2 5E64 D6F2 <CJK>
+D6F3 5E47 D6F3 <CJK>
+D6F4 5E75 D6F4 <CJK>
+D6F5 5E76 D6F5 <CJK>
+D6F6 5E7A D6F6 <CJK>
+D6F7 9EBC D6F7 <CJK>
+D6F8 5E7F D6F8 <CJK>
+D6F9 5EA0 D6F9 <CJK>
+D6FA 5EC1 D6FA <CJK>
+D6FB 5EC2 D6FB <CJK>
+D6FC 5EC8 D6FC <CJK>
+D6FD 5ED0 D6FD <CJK>
+D6FE 5ECF D6FE <CJK>
+D7A1 5ED6 D7A1 <CJK>
+D7A2 5EE3 D7A2 <CJK>
+D7A3 5EDD D7A3 <CJK>
+D7A4 5EDA D7A4 <CJK>
+D7A5 5EDB D7A5 <CJK>
+D7A6 5EE2 D7A6 <CJK>
+D7A7 5EE1 D7A7 <CJK>
+D7A8 5EE8 D7A8 <CJK>
+D7A9 5EE9 D7A9 <CJK>
+D7AA 5EEC D7AA <CJK>
+D7AB 5EF1 D7AB <CJK>
+D7AC 5EF3 D7AC <CJK>
+D7AD 5EF0 D7AD <CJK>
+D7AE 5EF4 D7AE <CJK>
+D7AF 5EF8 D7AF <CJK>
+D7B0 5EFE D7B0 <CJK>
+D7B1 5F03 D7B1 <CJK>
+D7B2 5F09 D7B2 <CJK>
+D7B3 5F5D D7B3 <CJK>
+D7B4 5F5C D7B4 <CJK>
+D7B5 5F0B D7B5 <CJK>
+D7B6 5F11 D7B6 <CJK>
+D7B7 5F16 D7B7 <CJK>
+D7B8 5F29 D7B8 <CJK>
+D7B9 5F2D D7B9 <CJK>
+D7BA 5F38 D7BA <CJK>
+D7BB 5F41 D7BB <CJK>
+D7BC 5F48 D7BC <CJK>
+D7BD 5F4C D7BD <CJK>
+D7BE 5F4E D7BE <CJK>
+D7BF 5F2F D7BF <CJK>
+D7C0 5F51 D7C0 <CJK>
+D7C1 5F56 D7C1 <CJK>
+D7C2 5F57 D7C2 <CJK>
+D7C3 5F59 D7C3 <CJK>
+D7C4 5F61 D7C4 <CJK>
+D7C5 5F6D D7C5 <CJK>
+D7C6 5F73 D7C6 <CJK>
+D7C7 5F77 D7C7 <CJK>
+D7C8 5F83 D7C8 <CJK>
+D7C9 5F82 D7C9 <CJK>
+D7CA 5F7F D7CA <CJK>
+D7CB 5F8A D7CB <CJK>
+D7CC 5F88 D7CC <CJK>
+D7CD 5F91 D7CD <CJK>
+D7CE 5F87 D7CE <CJK>
+D7CF 5F9E D7CF <CJK>
+D7D0 5F99 D7D0 <CJK>
+D7D1 5F98 D7D1 <CJK>
+D7D2 5FA0 D7D2 <CJK>
+D7D3 5FA8 D7D3 <CJK>
+D7D4 5FAD D7D4 <CJK>
+D7D5 5FBC D7D5 <CJK>
+D7D6 5FD6 D7D6 <CJK>
+D7D7 5FFB D7D7 <CJK>
+D7D8 5FE4 D7D8 <CJK>
+D7D9 5FF8 D7D9 <CJK>
+D7DA 5FF1 D7DA <CJK>
+D7DB 5FDD D7DB <CJK>
+D7DC 60B3 D7DC <CJK>
+D7DD 5FFF D7DD <CJK>
+D7DE 6021 D7DE <CJK>
+D7DF 6060 D7DF <CJK>
+D7E0 6019 D7E0 <CJK>
+D7E1 6010 D7E1 <CJK>
+D7E2 6029 D7E2 <CJK>
+D7E3 600E D7E3 <CJK>
+D7E4 6031 D7E4 <CJK>
+D7E5 601B D7E5 <CJK>
+D7E6 6015 D7E6 <CJK>
+D7E7 602B D7E7 <CJK>
+D7E8 6026 D7E8 <CJK>
+D7E9 600F D7E9 <CJK>
+D7EA 603A D7EA <CJK>
+D7EB 605A D7EB <CJK>
+D7EC 6041 D7EC <CJK>
+D7ED 606A D7ED <CJK>
+D7EE 6077 D7EE <CJK>
+D7EF 605F D7EF <CJK>
+D7F0 604A D7F0 <CJK>
+D7F1 6046 D7F1 <CJK>
+D7F2 604D D7F2 <CJK>
+D7F3 6063 D7F3 <CJK>
+D7F4 6043 D7F4 <CJK>
+D7F5 6064 D7F5 <CJK>
+D7F6 6042 D7F6 <CJK>
+D7F7 606C D7F7 <CJK>
+D7F8 606B D7F8 <CJK>
+D7F9 6059 D7F9 <CJK>
+D7FA 6081 D7FA <CJK>
+D7FB 608D D7FB <CJK>
+D7FC 60E7 D7FC <CJK>
+D7FD 6083 D7FD <CJK>
+D7FE 609A D7FE <CJK>
+D8A1 6084 D8A1 <CJK>
+D8A2 609B D8A2 <CJK>
+D8A3 6096 D8A3 <CJK>
+D8A4 6097 D8A4 <CJK>
+D8A5 6092 D8A5 <CJK>
+D8A6 60A7 D8A6 <CJK>
+D8A7 608B D8A7 <CJK>
+D8A8 60E1 D8A8 <CJK>
+D8A9 60B8 D8A9 <CJK>
+D8AA 60E0 D8AA <CJK>
+D8AB 60D3 D8AB <CJK>
+D8AC 60B4 D8AC <CJK>
+D8AD 5FF0 D8AD <CJK>
+D8AE 60BD D8AE <CJK>
+D8AF 60C6 D8AF <CJK>
+D8B0 60B5 D8B0 <CJK>
+D8B1 60D8 D8B1 <CJK>
+D8B2 614D D8B2 <CJK>
+D8B3 6115 D8B3 <CJK>
+D8B4 6106 D8B4 <CJK>
+D8B5 60F6 D8B5 <CJK>
+D8B6 60F7 D8B6 <CJK>
+D8B7 6100 D8B7 <CJK>
+D8B8 60F4 D8B8 <CJK>
+D8B9 60FA D8B9 <CJK>
+D8BA 6103 D8BA <CJK>
+D8BB 6121 D8BB <CJK>
+D8BC 60FB D8BC <CJK>
+D8BD 60F1 D8BD <CJK>
+D8BE 610D D8BE <CJK>
+D8BF 610E D8BF <CJK>
+D8C0 6147 D8C0 <CJK>
+D8C1 613E D8C1 <CJK>
+D8C2 6128 D8C2 <CJK>
+D8C3 6127 D8C3 <CJK>
+D8C4 614A D8C4 <CJK>
+D8C5 613F D8C5 <CJK>
+D8C6 613C D8C6 <CJK>
+D8C7 612C D8C7 <CJK>
+D8C8 6134 D8C8 <CJK>
+D8C9 613D D8C9 <CJK>
+D8CA 6142 D8CA <CJK>
+D8CB 6144 D8CB <CJK>
+D8CC 6173 D8CC <CJK>
+D8CD 6177 D8CD <CJK>
+D8CE 6158 D8CE <CJK>
+D8CF 6159 D8CF <CJK>
+D8D0 615A D8D0 <CJK>
+D8D1 616B D8D1 <CJK>
+D8D2 6174 D8D2 <CJK>
+D8D3 616F D8D3 <CJK>
+D8D4 6165 D8D4 <CJK>
+D8D5 6171 D8D5 <CJK>
+D8D6 615F D8D6 <CJK>
+D8D7 615D D8D7 <CJK>
+D8D8 6153 D8D8 <CJK>
+D8D9 6175 D8D9 <CJK>
+D8DA 6199 D8DA <CJK>
+D8DB 6196 D8DB <CJK>
+D8DC 6187 D8DC <CJK>
+D8DD 61AC D8DD <CJK>
+D8DE 6194 D8DE <CJK>
+D8DF 619A D8DF <CJK>
+D8E0 618A D8E0 <CJK>
+D8E1 6191 D8E1 <CJK>
+D8E2 61AB D8E2 <CJK>
+D8E3 61AE D8E3 <CJK>
+D8E4 61CC D8E4 <CJK>
+D8E5 61CA D8E5 <CJK>
+D8E6 61C9 D8E6 <CJK>
+D8E7 61F7 D8E7 <CJK>
+D8E8 61C8 D8E8 <CJK>
+D8E9 61C3 D8E9 <CJK>
+D8EA 61C6 D8EA <CJK>
+D8EB 61BA D8EB <CJK>
+D8EC 61CB D8EC <CJK>
+D8ED 7F79 D8ED <CJK>
+D8EE 61CD D8EE <CJK>
+D8EF 61E6 D8EF <CJK>
+D8F0 61E3 D8F0 <CJK>
+D8F1 61F6 D8F1 <CJK>
+D8F2 61FA D8F2 <CJK>
+D8F3 61F4 D8F3 <CJK>
+D8F4 61FF D8F4 <CJK>
+D8F5 61FD D8F5 <CJK>
+D8F6 61FC D8F6 <CJK>
+D8F7 61FE D8F7 <CJK>
+D8F8 6200 D8F8 <CJK>
+D8F9 6208 D8F9 <CJK>
+D8FA 6209 D8FA <CJK>
+D8FB 620D D8FB <CJK>
+D8FC 620C D8FC <CJK>
+D8FD 6214 D8FD <CJK>
+D8FE 621B D8FE <CJK>
+D9A1 621E D9A1 <CJK>
+D9A2 6221 D9A2 <CJK>
+D9A3 622A D9A3 <CJK>
+D9A4 622E D9A4 <CJK>
+D9A5 6230 D9A5 <CJK>
+D9A6 6232 D9A6 <CJK>
+D9A7 6233 D9A7 <CJK>
+D9A8 6241 D9A8 <CJK>
+D9A9 624E D9A9 <CJK>
+D9AA 625E D9AA <CJK>
+D9AB 6263 D9AB <CJK>
+D9AC 625B D9AC <CJK>
+D9AD 6260 D9AD <CJK>
+D9AE 6268 D9AE <CJK>
+D9AF 627C D9AF <CJK>
+D9B0 6282 D9B0 <CJK>
+D9B1 6289 D9B1 <CJK>
+D9B2 627E D9B2 <CJK>
+D9B3 6292 D9B3 <CJK>
+D9B4 6293 D9B4 <CJK>
+D9B5 6296 D9B5 <CJK>
+D9B6 62D4 D9B6 <CJK>
+D9B7 6283 D9B7 <CJK>
+D9B8 6294 D9B8 <CJK>
+D9B9 62D7 D9B9 <CJK>
+D9BA 62D1 D9BA <CJK>
+D9BB 62BB D9BB <CJK>
+D9BC 62CF D9BC <CJK>
+D9BD 62FF D9BD <CJK>
+D9BE 62C6 D9BE <CJK>
+D9BF 64D4 D9BF <CJK>
+D9C0 62C8 D9C0 <CJK>
+D9C1 62DC D9C1 <CJK>
+D9C2 62CC D9C2 <CJK>
+D9C3 62CA D9C3 <CJK>
+D9C4 62C2 D9C4 <CJK>
+D9C5 62C7 D9C5 <CJK>
+D9C6 629B D9C6 <CJK>
+D9C7 62C9 D9C7 <CJK>
+D9C8 630C D9C8 <CJK>
+D9C9 62EE D9C9 <CJK>
+D9CA 62F1 D9CA <CJK>
+D9CB 6327 D9CB <CJK>
+D9CC 6302 D9CC <CJK>
+D9CD 6308 D9CD <CJK>
+D9CE 62EF D9CE <CJK>
+D9CF 62F5 D9CF <CJK>
+D9D0 6350 D9D0 <CJK>
+D9D1 633E D9D1 <CJK>
+D9D2 634D D9D2 <CJK>
+D9D3 641C D9D3 <CJK>
+D9D4 634F D9D4 <CJK>
+D9D5 6396 D9D5 <CJK>
+D9D6 638E D9D6 <CJK>
+D9D7 6380 D9D7 <CJK>
+D9D8 63AB D9D8 <CJK>
+D9D9 6376 D9D9 <CJK>
+D9DA 63A3 D9DA <CJK>
+D9DB 638F D9DB <CJK>
+D9DC 6389 D9DC <CJK>
+D9DD 639F D9DD <CJK>
+D9DE 63B5 D9DE <CJK>
+D9DF 636B D9DF <CJK>
+D9E0 6369 D9E0 <CJK>
+D9E1 63BE D9E1 <CJK>
+D9E2 63E9 D9E2 <CJK>
+D9E3 63C0 D9E3 <CJK>
+D9E4 63C6 D9E4 <CJK>
+D9E5 63E3 D9E5 <CJK>
+D9E6 63C9 D9E6 <CJK>
+D9E7 63D2 D9E7 <CJK>
+D9E8 63F6 D9E8 <CJK>
+D9E9 63C4 D9E9 <CJK>
+D9EA 6416 D9EA <CJK>
+D9EB 6434 D9EB <CJK>
+D9EC 6406 D9EC <CJK>
+D9ED 6413 D9ED <CJK>
+D9EE 6426 D9EE <CJK>
+D9EF 6436 D9EF <CJK>
+D9F0 651D D9F0 <CJK>
+D9F1 6417 D9F1 <CJK>
+D9F2 6428 D9F2 <CJK>
+D9F3 640F D9F3 <CJK>
+D9F4 6467 D9F4 <CJK>
+D9F5 646F D9F5 <CJK>
+D9F6 6476 D9F6 <CJK>
+D9F7 644E D9F7 <CJK>
+D9F8 652A D9F8 <CJK>
+D9F9 6495 D9F9 <CJK>
+D9FA 6493 D9FA <CJK>
+D9FB 64A5 D9FB <CJK>
+D9FC 64A9 D9FC <CJK>
+D9FD 6488 D9FD <CJK>
+D9FE 64BC D9FE <CJK>
+DAA1 64DA DAA1 <CJK>
+DAA2 64D2 DAA2 <CJK>
+DAA3 64C5 DAA3 <CJK>
+DAA4 64C7 DAA4 <CJK>
+DAA5 64BB DAA5 <CJK>
+DAA6 64D8 DAA6 <CJK>
+DAA7 64C2 DAA7 <CJK>
+DAA8 64F1 DAA8 <CJK>
+DAA9 64E7 DAA9 <CJK>
+DAAA 8209 DAAA <CJK>
+DAAB 64E0 DAAB <CJK>
+DAAC 64E1 DAAC <CJK>
+DAAD 62AC DAAD <CJK>
+DAAE 64E3 DAAE <CJK>
+DAAF 64EF DAAF <CJK>
+DAB0 652C DAB0 <CJK>
+DAB1 64F6 DAB1 <CJK>
+DAB2 64F4 DAB2 <CJK>
+DAB3 64F2 DAB3 <CJK>
+DAB4 64FA DAB4 <CJK>
+DAB5 6500 DAB5 <CJK>
+DAB6 64FD DAB6 <CJK>
+DAB7 6518 DAB7 <CJK>
+DAB8 651C DAB8 <CJK>
+DAB9 6505 DAB9 <CJK>
+DABA 6524 DABA <CJK>
+DABB 6523 DABB <CJK>
+DABC 652B DABC <CJK>
+DABD 6534 DABD <CJK>
+DABE 6535 DABE <CJK>
+DABF 6537 DABF <CJK>
+DAC0 6536 DAC0 <CJK>
+DAC1 6538 DAC1 <CJK>
+DAC2 754B DAC2 <CJK>
+DAC3 6548 DAC3 <CJK>
+DAC4 6556 DAC4 <CJK>
+DAC5 6555 DAC5 <CJK>
+DAC6 654D DAC6 <CJK>
+DAC7 6558 DAC7 <CJK>
+DAC8 655E DAC8 <CJK>
+DAC9 655D DAC9 <CJK>
+DACA 6572 DACA <CJK>
+DACB 6578 DACB <CJK>
+DACC 6582 DACC <CJK>
+DACD 6583 DACD <CJK>
+DACE 8B8A DACE <CJK>
+DACF 659B DACF <CJK>
+DAD0 659F DAD0 <CJK>
+DAD1 65AB DAD1 <CJK>
+DAD2 65B7 DAD2 <CJK>
+DAD3 65C3 DAD3 <CJK>
+DAD4 65C6 DAD4 <CJK>
+DAD5 65C1 DAD5 <CJK>
+DAD6 65C4 DAD6 <CJK>
+DAD7 65CC DAD7 <CJK>
+DAD8 65D2 DAD8 <CJK>
+DAD9 65DB DAD9 <CJK>
+DADA 65D9 DADA <CJK>
+DADB 65E0 DADB <CJK>
+DADC 65E1 DADC <CJK>
+DADD 65F1 DADD <CJK>
+DADE 6772 DADE <CJK>
+DADF 660A DADF <CJK>
+DAE0 6603 DAE0 <CJK>
+DAE1 65FB DAE1 <CJK>
+DAE2 6773 DAE2 <CJK>
+DAE3 6635 DAE3 <CJK>
+DAE4 6636 DAE4 <CJK>
+DAE5 6634 DAE5 <CJK>
+DAE6 661C DAE6 <CJK>
+DAE7 664F DAE7 <CJK>
+DAE8 6644 DAE8 <CJK>
+DAE9 6649 DAE9 <CJK>
+DAEA 6641 DAEA <CJK>
+DAEB 665E DAEB <CJK>
+DAEC 665D DAEC <CJK>
+DAED 6664 DAED <CJK>
+DAEE 6667 DAEE <CJK>
+DAEF 6668 DAEF <CJK>
+DAF0 665F DAF0 <CJK>
+DAF1 6662 DAF1 <CJK>
+DAF2 6670 DAF2 <CJK>
+DAF3 6683 DAF3 <CJK>
+DAF4 6688 DAF4 <CJK>
+DAF5 668E DAF5 <CJK>
+DAF6 6689 DAF6 <CJK>
+DAF7 6684 DAF7 <CJK>
+DAF8 6698 DAF8 <CJK>
+DAF9 669D DAF9 <CJK>
+DAFA 66C1 DAFA <CJK>
+DAFB 66B9 DAFB <CJK>
+DAFC 66C9 DAFC <CJK>
+DAFD 66BE DAFD <CJK>
+DAFE 66BC DAFE <CJK>
+DBA1 66C4 DBA1 <CJK>
+DBA2 66B8 DBA2 <CJK>
+DBA3 66D6 DBA3 <CJK>
+DBA4 66DA DBA4 <CJK>
+DBA5 66E0 DBA5 <CJK>
+DBA6 663F DBA6 <CJK>
+DBA7 66E6 DBA7 <CJK>
+DBA8 66E9 DBA8 <CJK>
+DBA9 66F0 DBA9 <CJK>
+DBAA 66F5 DBAA <CJK>
+DBAB 66F7 DBAB <CJK>
+DBAC 670F DBAC <CJK>
+DBAD 6716 DBAD <CJK>
+DBAE 671E DBAE <CJK>
+DBAF 6726 DBAF <CJK>
+DBB0 6727 DBB0 <CJK>
+DBB1 9738 DBB1 <CJK>
+DBB2 672E DBB2 <CJK>
+DBB3 673F DBB3 <CJK>
+DBB4 6736 DBB4 <CJK>
+DBB5 6741 DBB5 <CJK>
+DBB6 6738 DBB6 <CJK>
+DBB7 6737 DBB7 <CJK>
+DBB8 6746 DBB8 <CJK>
+DBB9 675E DBB9 <CJK>
+DBBA 6760 DBBA <CJK>
+DBBB 6759 DBBB <CJK>
+DBBC 6763 DBBC <CJK>
+DBBD 6764 DBBD <CJK>
+DBBE 6789 DBBE <CJK>
+DBBF 6770 DBBF <CJK>
+DBC0 67A9 DBC0 <CJK>
+DBC1 677C DBC1 <CJK>
+DBC2 676A DBC2 <CJK>
+DBC3 678C DBC3 <CJK>
+DBC4 678B DBC4 <CJK>
+DBC5 67A6 DBC5 <CJK>
+DBC6 67A1 DBC6 <CJK>
+DBC7 6785 DBC7 <CJK>
+DBC8 67B7 DBC8 <CJK>
+DBC9 67EF DBC9 <CJK>
+DBCA 67B4 DBCA <CJK>
+DBCB 67EC DBCB <CJK>
+DBCC 67B3 DBCC <CJK>
+DBCD 67E9 DBCD <CJK>
+DBCE 67B8 DBCE <CJK>
+DBCF 67E4 DBCF <CJK>
+DBD0 67DE DBD0 <CJK>
+DBD1 67DD DBD1 <CJK>
+DBD2 67E2 DBD2 <CJK>
+DBD3 67EE DBD3 <CJK>
+DBD4 67B9 DBD4 <CJK>
+DBD5 67CE DBD5 <CJK>
+DBD6 67C6 DBD6 <CJK>
+DBD7 67E7 DBD7 <CJK>
+DBD8 6A9C DBD8 <CJK>
+DBD9 681E DBD9 <CJK>
+DBDA 6846 DBDA <CJK>
+DBDB 6829 DBDB <CJK>
+DBDC 6840 DBDC <CJK>
+DBDD 684D DBDD <CJK>
+DBDE 6832 DBDE <CJK>
+DBDF 684E DBDF <CJK>
+DBE0 68B3 DBE0 <CJK>
+DBE1 682B DBE1 <CJK>
+DBE2 6859 DBE2 <CJK>
+DBE3 6863 DBE3 <CJK>
+DBE4 6877 DBE4 <CJK>
+DBE5 687F DBE5 <CJK>
+DBE6 689F DBE6 <CJK>
+DBE7 688F DBE7 <CJK>
+DBE8 68AD DBE8 <CJK>
+DBE9 6894 DBE9 <CJK>
+DBEA 689D DBEA <CJK>
+DBEB 689B DBEB <CJK>
+DBEC 6883 DBEC <CJK>
+DBED 6AAE DBED <CJK>
+DBEE 68B9 DBEE <CJK>
+DBEF 6874 DBEF <CJK>
+DBF0 68B5 DBF0 <CJK>
+DBF1 68A0 DBF1 <CJK>
+DBF2 68BA DBF2 <CJK>
+DBF3 690F DBF3 <CJK>
+DBF4 688D DBF4 <CJK>
+DBF5 687E DBF5 <CJK>
+DBF6 6901 DBF6 <CJK>
+DBF7 68CA DBF7 <CJK>
+DBF8 6908 DBF8 <CJK>
+DBF9 68D8 DBF9 <CJK>
+DBFA 6922 DBFA <CJK>
+DBFB 6926 DBFB <CJK>
+DBFC 68E1 DBFC <CJK>
+DBFD 690C DBFD <CJK>
+DBFE 68CD DBFE <CJK>
+DCA1 68D4 DCA1 <CJK>
+DCA2 68E7 DCA2 <CJK>
+DCA3 68D5 DCA3 <CJK>
+DCA4 6936 DCA4 <CJK>
+DCA5 6912 DCA5 <CJK>
+DCA6 6904 DCA6 <CJK>
+DCA7 68D7 DCA7 <CJK>
+DCA8 68E3 DCA8 <CJK>
+DCA9 6925 DCA9 <CJK>
+DCAA 68F9 DCAA <CJK>
+DCAB 68E0 DCAB <CJK>
+DCAC 68EF DCAC <CJK>
+DCAD 6928 DCAD <CJK>
+DCAE 692A DCAE <CJK>
+DCAF 691A DCAF <CJK>
+DCB0 6923 DCB0 <CJK>
+DCB1 6921 DCB1 <CJK>
+DCB2 68C6 DCB2 <CJK>
+DCB3 6979 DCB3 <CJK>
+DCB4 6977 DCB4 <CJK>
+DCB5 695C DCB5 <CJK>
+DCB6 6978 DCB6 <CJK>
+DCB7 696B DCB7 <CJK>
+DCB8 6954 DCB8 <CJK>
+DCB9 697E DCB9 <CJK>
+DCBA 696E DCBA <CJK>
+DCBB 6939 DCBB <CJK>
+DCBC 6974 DCBC <CJK>
+DCBD 693D DCBD <CJK>
+DCBE 6959 DCBE <CJK>
+DCBF 6930 DCBF <CJK>
+DCC0 6961 DCC0 <CJK>
+DCC1 695E DCC1 <CJK>
+DCC2 695D DCC2 <CJK>
+DCC3 6981 DCC3 <CJK>
+DCC4 696A DCC4 <CJK>
+DCC5 69B2 DCC5 <CJK>
+DCC6 69AE DCC6 <CJK>
+DCC7 69D0 DCC7 <CJK>
+DCC8 69BF DCC8 <CJK>
+DCC9 69C1 DCC9 <CJK>
+DCCA 69D3 DCCA <CJK>
+DCCB 69BE DCCB <CJK>
+DCCC 69CE DCCC <CJK>
+DCCD 5BE8 DCCD <CJK>
+DCCE 69CA DCCE <CJK>
+DCCF 69DD DCCF <CJK>
+DCD0 69BB DCD0 <CJK>
+DCD1 69C3 DCD1 <CJK>
+DCD2 69A7 DCD2 <CJK>
+DCD3 6A2E DCD3 <CJK>
+DCD4 6991 DCD4 <CJK>
+DCD5 69A0 DCD5 <CJK>
+DCD6 699C DCD6 <CJK>
+DCD7 6995 DCD7 <CJK>
+DCD8 69B4 DCD8 <CJK>
+DCD9 69DE DCD9 <CJK>
+DCDA 69E8 DCDA <CJK>
+DCDB 6A02 DCDB <CJK>
+DCDC 6A1B DCDC <CJK>
+DCDD 69FF DCDD <CJK>
+DCDE 6B0A DCDE <CJK>
+DCDF 69F9 DCDF <CJK>
+DCE0 69F2 DCE0 <CJK>
+DCE1 69E7 DCE1 <CJK>
+DCE2 6A05 DCE2 <CJK>
+DCE3 69B1 DCE3 <CJK>
+DCE4 6A1E DCE4 <CJK>
+DCE5 69ED DCE5 <CJK>
+DCE6 6A14 DCE6 <CJK>
+DCE7 69EB DCE7 <CJK>
+DCE8 6A0A DCE8 <CJK>
+DCE9 6A12 DCE9 <CJK>
+DCEA 6AC1 DCEA <CJK>
+DCEB 6A23 DCEB <CJK>
+DCEC 6A13 DCEC <CJK>
+DCED 6A44 DCED <CJK>
+DCEE 6A0C DCEE <CJK>
+DCEF 6A72 DCEF <CJK>
+DCF0 6A36 DCF0 <CJK>
+DCF1 6A78 DCF1 <CJK>
+DCF2 6A47 DCF2 <CJK>
+DCF3 6A62 DCF3 <CJK>
+DCF4 6A59 DCF4 <CJK>
+DCF5 6A66 DCF5 <CJK>
+DCF6 6A48 DCF6 <CJK>
+DCF7 6A38 DCF7 <CJK>
+DCF8 6A22 DCF8 <CJK>
+DCF9 6A90 DCF9 <CJK>
+DCFA 6A8D DCFA <CJK>
+DCFB 6AA0 DCFB <CJK>
+DCFC 6A84 DCFC <CJK>
+DCFD 6AA2 DCFD <CJK>
+DCFE 6AA3 DCFE <CJK>
+DDA1 6A97 DDA1 <CJK>
+DDA2 8617 DDA2 <CJK>
+DDA3 6ABB DDA3 <CJK>
+DDA4 6AC3 DDA4 <CJK>
+DDA5 6AC2 DDA5 <CJK>
+DDA6 6AB8 DDA6 <CJK>
+DDA7 6AB3 DDA7 <CJK>
+DDA8 6AAC DDA8 <CJK>
+DDA9 6ADE DDA9 <CJK>
+DDAA 6AD1 DDAA <CJK>
+DDAB 6ADF DDAB <CJK>
+DDAC 6AAA DDAC <CJK>
+DDAD 6ADA DDAD <CJK>
+DDAE 6AEA DDAE <CJK>
+DDAF 6AFB DDAF <CJK>
+DDB0 6B05 DDB0 <CJK>
+DDB1 8616 DDB1 <CJK>
+DDB2 6AFA DDB2 <CJK>
+DDB3 6B12 DDB3 <CJK>
+DDB4 6B16 DDB4 <CJK>
+DDB5 9B31 DDB5 <CJK>
+DDB6 6B1F DDB6 <CJK>
+DDB7 6B38 DDB7 <CJK>
+DDB8 6B37 DDB8 <CJK>
+DDB9 76DC DDB9 <CJK>
+DDBA 6B39 DDBA <CJK>
+DDBB 98EE DDBB <CJK>
+DDBC 6B47 DDBC <CJK>
+DDBD 6B43 DDBD <CJK>
+DDBE 6B49 DDBE <CJK>
+DDBF 6B50 DDBF <CJK>
+DDC0 6B59 DDC0 <CJK>
+DDC1 6B54 DDC1 <CJK>
+DDC2 6B5B DDC2 <CJK>
+DDC3 6B5F DDC3 <CJK>
+DDC4 6B61 DDC4 <CJK>
+DDC5 6B78 DDC5 <CJK>
+DDC6 6B79 DDC6 <CJK>
+DDC7 6B7F DDC7 <CJK>
+DDC8 6B80 DDC8 <CJK>
+DDC9 6B84 DDC9 <CJK>
+DDCA 6B83 DDCA <CJK>
+DDCB 6B8D DDCB <CJK>
+DDCC 6B98 DDCC <CJK>
+DDCD 6B95 DDCD <CJK>
+DDCE 6B9E DDCE <CJK>
+DDCF 6BA4 DDCF <CJK>
+DDD0 6BAA DDD0 <CJK>
+DDD1 6BAB DDD1 <CJK>
+DDD2 6BAF DDD2 <CJK>
+DDD3 6BB2 DDD3 <CJK>
+DDD4 6BB1 DDD4 <CJK>
+DDD5 6BB3 DDD5 <CJK>
+DDD6 6BB7 DDD6 <CJK>
+DDD7 6BBC DDD7 <CJK>
+DDD8 6BC6 DDD8 <CJK>
+DDD9 6BCB DDD9 <CJK>
+DDDA 6BD3 DDDA <CJK>
+DDDB 6BDF DDDB <CJK>
+DDDC 6BEC DDDC <CJK>
+DDDD 6BEB DDDD <CJK>
+DDDE 6BF3 DDDE <CJK>
+DDDF 6BEF DDDF <CJK>
+DDE0 9EBE DDE0 <CJK>
+DDE1 6C08 DDE1 <CJK>
+DDE2 6C13 DDE2 <CJK>
+DDE3 6C14 DDE3 <CJK>
+DDE4 6C1B DDE4 <CJK>
+DDE5 6C24 DDE5 <CJK>
+DDE6 6C23 DDE6 <CJK>
+DDE7 6C5E DDE7 <CJK>
+DDE8 6C55 DDE8 <CJK>
+DDE9 6C62 DDE9 <CJK>
+DDEA 6C6A DDEA <CJK>
+DDEB 6C82 DDEB <CJK>
+DDEC 6C8D DDEC <CJK>
+DDED 6C9A DDED <CJK>
+DDEE 6C81 DDEE <CJK>
+DDEF 6C9B DDEF <CJK>
+DDF0 6C7E DDF0 <CJK>
+DDF1 6C68 DDF1 <CJK>
+DDF2 6C73 DDF2 <CJK>
+DDF3 6C92 DDF3 <CJK>
+DDF4 6C90 DDF4 <CJK>
+DDF5 6CC4 DDF5 <CJK>
+DDF6 6CF1 DDF6 <CJK>
+DDF7 6CD3 DDF7 <CJK>
+DDF8 6CBD DDF8 <CJK>
+DDF9 6CD7 DDF9 <CJK>
+DDFA 6CC5 DDFA <CJK>
+DDFB 6CDD DDFB <CJK>
+DDFC 6CAE DDFC <CJK>
+DDFD 6CB1 DDFD <CJK>
+DDFE 6CBE DDFE <CJK>
+DEA1 6CBA DEA1 <CJK>
+DEA2 6CDB DEA2 <CJK>
+DEA3 6CEF DEA3 <CJK>
+DEA4 6CD9 DEA4 <CJK>
+DEA5 6CEA DEA5 <CJK>
+DEA6 6D1F DEA6 <CJK>
+DEA7 884D DEA7 <CJK>
+DEA8 6D36 DEA8 <CJK>
+DEA9 6D2B DEA9 <CJK>
+DEAA 6D3D DEAA <CJK>
+DEAB 6D38 DEAB <CJK>
+DEAC 6D19 DEAC <CJK>
+DEAD 6D35 DEAD <CJK>
+DEAE 6D33 DEAE <CJK>
+DEAF 6D12 DEAF <CJK>
+DEB0 6D0C DEB0 <CJK>
+DEB1 6D63 DEB1 <CJK>
+DEB2 6D93 DEB2 <CJK>
+DEB3 6D64 DEB3 <CJK>
+DEB4 6D5A DEB4 <CJK>
+DEB5 6D79 DEB5 <CJK>
+DEB6 6D59 DEB6 <CJK>
+DEB7 6D8E DEB7 <CJK>
+DEB8 6D95 DEB8 <CJK>
+DEB9 6FE4 DEB9 <CJK>
+DEBA 6D85 DEBA <CJK>
+DEBB 6DF9 DEBB <CJK>
+DEBC 6E15 DEBC <CJK>
+DEBD 6E0A DEBD <CJK>
+DEBE 6DB5 DEBE <CJK>
+DEBF 6DC7 DEBF <CJK>
+DEC0 6DE6 DEC0 <CJK>
+DEC1 6DB8 DEC1 <CJK>
+DEC2 6DC6 DEC2 <CJK>
+DEC3 6DEC DEC3 <CJK>
+DEC4 6DDE DEC4 <CJK>
+DEC5 6DCC DEC5 <CJK>
+DEC6 6DE8 DEC6 <CJK>
+DEC7 6DD2 DEC7 <CJK>
+DEC8 6DC5 DEC8 <CJK>
+DEC9 6DFA DEC9 <CJK>
+DECA 6DD9 DECA <CJK>
+DECB 6DE4 DECB <CJK>
+DECC 6DD5 DECC <CJK>
+DECD 6DEA DECD <CJK>
+DECE 6DEE DECE <CJK>
+DECF 6E2D DECF <CJK>
+DED0 6E6E DED0 <CJK>
+DED1 6E2E DED1 <CJK>
+DED2 6E19 DED2 <CJK>
+DED3 6E72 DED3 <CJK>
+DED4 6E5F DED4 <CJK>
+DED5 6E3E DED5 <CJK>
+DED6 6E23 DED6 <CJK>
+DED7 6E6B DED7 <CJK>
+DED8 6E2B DED8 <CJK>
+DED9 6E76 DED9 <CJK>
+DEDA 6E4D DEDA <CJK>
+DEDB 6E1F DEDB <CJK>
+DEDC 6E43 DEDC <CJK>
+DEDD 6E3A DEDD <CJK>
+DEDE 6E4E DEDE <CJK>
+DEDF 6E24 DEDF <CJK>
+DEE0 6EFF DEE0 <CJK>
+DEE1 6E1D DEE1 <CJK>
+DEE2 6E38 DEE2 <CJK>
+DEE3 6E82 DEE3 <CJK>
+DEE4 6EAA DEE4 <CJK>
+DEE5 6E98 DEE5 <CJK>
+DEE6 6EC9 DEE6 <CJK>
+DEE7 6EB7 DEE7 <CJK>
+DEE8 6ED3 DEE8 <CJK>
+DEE9 6EBD DEE9 <CJK>
+DEEA 6EAF DEEA <CJK>
+DEEB 6EC4 DEEB <CJK>
+DEEC 6EB2 DEEC <CJK>
+DEED 6ED4 DEED <CJK>
+DEEE 6ED5 DEEE <CJK>
+DEEF 6E8F DEEF <CJK>
+DEF0 6EA5 DEF0 <CJK>
+DEF1 6EC2 DEF1 <CJK>
+DEF2 6E9F DEF2 <CJK>
+DEF3 6F41 DEF3 <CJK>
+DEF4 6F11 DEF4 <CJK>
+DEF5 704C DEF5 <CJK>
+DEF6 6EEC DEF6 <CJK>
+DEF7 6EF8 DEF7 <CJK>
+DEF8 6EFE DEF8 <CJK>
+DEF9 6F3F DEF9 <CJK>
+DEFA 6EF2 DEFA <CJK>
+DEFB 6F31 DEFB <CJK>
+DEFC 6EEF DEFC <CJK>
+DEFD 6F32 DEFD <CJK>
+DEFE 6ECC DEFE <CJK>
+DFA1 6F3E DFA1 <CJK>
+DFA2 6F13 DFA2 <CJK>
+DFA3 6EF7 DFA3 <CJK>
+DFA4 6F86 DFA4 <CJK>
+DFA5 6F7A DFA5 <CJK>
+DFA6 6F78 DFA6 <CJK>
+DFA7 6F81 DFA7 <CJK>
+DFA8 6F80 DFA8 <CJK>
+DFA9 6F6F DFA9 <CJK>
+DFAA 6F5B DFAA <CJK>
+DFAB 6FF3 DFAB <CJK>
+DFAC 6F6D DFAC <CJK>
+DFAD 6F82 DFAD <CJK>
+DFAE 6F7C DFAE <CJK>
+DFAF 6F58 DFAF <CJK>
+DFB0 6F8E DFB0 <CJK>
+DFB1 6F91 DFB1 <CJK>
+DFB2 6FC2 DFB2 <CJK>
+DFB3 6F66 DFB3 <CJK>
+DFB4 6FB3 DFB4 <CJK>
+DFB5 6FA3 DFB5 <CJK>
+DFB6 6FA1 DFB6 <CJK>
+DFB7 6FA4 DFB7 <CJK>
+DFB8 6FB9 DFB8 <CJK>
+DFB9 6FC6 DFB9 <CJK>
+DFBA 6FAA DFBA <CJK>
+DFBB 6FDF DFBB <CJK>
+DFBC 6FD5 DFBC <CJK>
+DFBD 6FEC DFBD <CJK>
+DFBE 6FD4 DFBE <CJK>
+DFBF 6FD8 DFBF <CJK>
+DFC0 6FF1 DFC0 <CJK>
+DFC1 6FEE DFC1 <CJK>
+DFC2 6FDB DFC2 <CJK>
+DFC3 7009 DFC3 <CJK>
+DFC4 700B DFC4 <CJK>
+DFC5 6FFA DFC5 <CJK>
+DFC6 7011 DFC6 <CJK>
+DFC7 7001 DFC7 <CJK>
+DFC8 700F DFC8 <CJK>
+DFC9 6FFE DFC9 <CJK>
+DFCA 701B DFCA <CJK>
+DFCB 701A DFCB <CJK>
+DFCC 6F74 DFCC <CJK>
+DFCD 701D DFCD <CJK>
+DFCE 7018 DFCE <CJK>
+DFCF 701F DFCF <CJK>
+DFD0 7030 DFD0 <CJK>
+DFD1 703E DFD1 <CJK>
+DFD2 7032 DFD2 <CJK>
+DFD3 7051 DFD3 <CJK>
+DFD4 7063 DFD4 <CJK>
+DFD5 7099 DFD5 <CJK>
+DFD6 7092 DFD6 <CJK>
+DFD7 70AF DFD7 <CJK>
+DFD8 70F1 DFD8 <CJK>
+DFD9 70AC DFD9 <CJK>
+DFDA 70B8 DFDA <CJK>
+DFDB 70B3 DFDB <CJK>
+DFDC 70AE DFDC <CJK>
+DFDD 70DF DFDD <CJK>
+DFDE 70CB DFDE <CJK>
+DFDF 70DD DFDF <CJK>
+DFE0 70D9 DFE0 <CJK>
+DFE1 7109 DFE1 <CJK>
+DFE2 70FD DFE2 <CJK>
+DFE3 711C DFE3 <CJK>
+DFE4 7119 DFE4 <CJK>
+DFE5 7165 DFE5 <CJK>
+DFE6 7155 DFE6 <CJK>
+DFE7 7188 DFE7 <CJK>
+DFE8 7166 DFE8 <CJK>
+DFE9 7162 DFE9 <CJK>
+DFEA 714C DFEA <CJK>
+DFEB 7156 DFEB <CJK>
+DFEC 716C DFEC <CJK>
+DFED 718F DFED <CJK>
+DFEE 71FB DFEE <CJK>
+DFEF 7184 DFEF <CJK>
+DFF0 7195 DFF0 <CJK>
+DFF1 71A8 DFF1 <CJK>
+DFF2 71AC DFF2 <CJK>
+DFF3 71D7 DFF3 <CJK>
+DFF4 71B9 DFF4 <CJK>
+DFF5 71BE DFF5 <CJK>
+DFF6 71D2 DFF6 <CJK>
+DFF7 71C9 DFF7 <CJK>
+DFF8 71D4 DFF8 <CJK>
+DFF9 71CE DFF9 <CJK>
+DFFA 71E0 DFFA <CJK>
+DFFB 71EC DFFB <CJK>
+DFFC 71E7 DFFC <CJK>
+DFFD 71F5 DFFD <CJK>
+DFFE 71FC DFFE <CJK>
+E0A1 71F9 E0A1 <CJK>
+E0A2 71FF E0A2 <CJK>
+E0A3 720D E0A3 <CJK>
+E0A4 7210 E0A4 <CJK>
+E0A5 721B E0A5 <CJK>
+E0A6 7228 E0A6 <CJK>
+E0A7 722D E0A7 <CJK>
+E0A8 722C E0A8 <CJK>
+E0A9 7230 E0A9 <CJK>
+E0AA 7232 E0AA <CJK>
+E0AB 723B E0AB <CJK>
+E0AC 723C E0AC <CJK>
+E0AD 723F E0AD <CJK>
+E0AE 7240 E0AE <CJK>
+E0AF 7246 E0AF <CJK>
+E0B0 724B E0B0 <CJK>
+E0B1 7258 E0B1 <CJK>
+E0B2 7274 E0B2 <CJK>
+E0B3 727E E0B3 <CJK>
+E0B4 7282 E0B4 <CJK>
+E0B5 7281 E0B5 <CJK>
+E0B6 7287 E0B6 <CJK>
+E0B7 7292 E0B7 <CJK>
+E0B8 7296 E0B8 <CJK>
+E0B9 72A2 E0B9 <CJK>
+E0BA 72A7 E0BA <CJK>
+E0BB 72B9 E0BB <CJK>
+E0BC 72B2 E0BC <CJK>
+E0BD 72C3 E0BD <CJK>
+E0BE 72C6 E0BE <CJK>
+E0BF 72C4 E0BF <CJK>
+E0C0 72CE E0C0 <CJK>
+E0C1 72D2 E0C1 <CJK>
+E0C2 72E2 E0C2 <CJK>
+E0C3 72E0 E0C3 <CJK>
+E0C4 72E1 E0C4 <CJK>
+E0C5 72F9 E0C5 <CJK>
+E0C6 72F7 E0C6 <CJK>
+E0C7 500F E0C7 <CJK>
+E0C8 7317 E0C8 <CJK>
+E0C9 730A E0C9 <CJK>
+E0CA 731C E0CA <CJK>
+E0CB 7316 E0CB <CJK>
+E0CC 731D E0CC <CJK>
+E0CD 7334 E0CD <CJK>
+E0CE 732F E0CE <CJK>
+E0CF 7329 E0CF <CJK>
+E0D0 7325 E0D0 <CJK>
+E0D1 733E E0D1 <CJK>
+E0D2 734E E0D2 <CJK>
+E0D3 734F E0D3 <CJK>
+E0D4 9ED8 E0D4 <CJK>
+E0D5 7357 E0D5 <CJK>
+E0D6 736A E0D6 <CJK>
+E0D7 7368 E0D7 <CJK>
+E0D8 7370 E0D8 <CJK>
+E0D9 7378 E0D9 <CJK>
+E0DA 7375 E0DA <CJK>
+E0DB 737B E0DB <CJK>
+E0DC 737A E0DC <CJK>
+E0DD 73C8 E0DD <CJK>
+E0DE 73B3 E0DE <CJK>
+E0DF 73CE E0DF <CJK>
+E0E0 73BB E0E0 <CJK>
+E0E1 73C0 E0E1 <CJK>
+E0E2 73E5 E0E2 <CJK>
+E0E3 73EE E0E3 <CJK>
+E0E4 73DE E0E4 <CJK>
+E0E5 74A2 E0E5 <CJK>
+E0E6 7405 E0E6 <CJK>
+E0E7 746F E0E7 <CJK>
+E0E8 7425 E0E8 <CJK>
+E0E9 73F8 E0E9 <CJK>
+E0EA 7432 E0EA <CJK>
+E0EB 743A E0EB <CJK>
+E0EC 7455 E0EC <CJK>
+E0ED 743F E0ED <CJK>
+E0EE 745F E0EE <CJK>
+E0EF 7459 E0EF <CJK>
+E0F0 7441 E0F0 <CJK>
+E0F1 745C E0F1 <CJK>
+E0F2 7469 E0F2 <CJK>
+E0F3 7470 E0F3 <CJK>
+E0F4 7463 E0F4 <CJK>
+E0F5 746A E0F5 <CJK>
+E0F6 7476 E0F6 <CJK>
+E0F7 747E E0F7 <CJK>
+E0F8 748B E0F8 <CJK>
+E0F9 749E E0F9 <CJK>
+E0FA 74A7 E0FA <CJK>
+E0FB 74CA E0FB <CJK>
+E0FC 74CF E0FC <CJK>
+E0FD 74D4 E0FD <CJK>
+E0FE 73F1 E0FE <CJK>
+E1A1 74E0 E1A1 <CJK>
+E1A2 74E3 E1A2 <CJK>
+E1A3 74E7 E1A3 <CJK>
+E1A4 74E9 E1A4 <CJK>
+E1A5 74EE E1A5 <CJK>
+E1A6 74F2 E1A6 <CJK>
+E1A7 74F0 E1A7 <CJK>
+E1A8 74F1 E1A8 <CJK>
+E1A9 74F8 E1A9 <CJK>
+E1AA 74F7 E1AA <CJK>
+E1AB 7504 E1AB <CJK>
+E1AC 7503 E1AC <CJK>
+E1AD 7505 E1AD <CJK>
+E1AE 750C E1AE <CJK>
+E1AF 750E E1AF <CJK>
+E1B0 750D E1B0 <CJK>
+E1B1 7515 E1B1 <CJK>
+E1B2 7513 E1B2 <CJK>
+E1B3 751E E1B3 <CJK>
+E1B4 7526 E1B4 <CJK>
+E1B5 752C E1B5 <CJK>
+E1B6 753C E1B6 <CJK>
+E1B7 7544 E1B7 <CJK>
+E1B8 754D E1B8 <CJK>
+E1B9 754A E1B9 <CJK>
+E1BA 7549 E1BA <CJK>
+E1BB 755B E1BB <CJK>
+E1BC 7546 E1BC <CJK>
+E1BD 755A E1BD <CJK>
+E1BE 7569 E1BE <CJK>
+E1BF 7564 E1BF <CJK>
+E1C0 7567 E1C0 <CJK>
+E1C1 756B E1C1 <CJK>
+E1C2 756D E1C2 <CJK>
+E1C3 7578 E1C3 <CJK>
+E1C4 7576 E1C4 <CJK>
+E1C5 7586 E1C5 <CJK>
+E1C6 7587 E1C6 <CJK>
+E1C7 7574 E1C7 <CJK>
+E1C8 758A E1C8 <CJK>
+E1C9 7589 E1C9 <CJK>
+E1CA 7582 E1CA <CJK>
+E1CB 7594 E1CB <CJK>
+E1CC 759A E1CC <CJK>
+E1CD 759D E1CD <CJK>
+E1CE 75A5 E1CE <CJK>
+E1CF 75A3 E1CF <CJK>
+E1D0 75C2 E1D0 <CJK>
+E1D1 75B3 E1D1 <CJK>
+E1D2 75C3 E1D2 <CJK>
+E1D3 75B5 E1D3 <CJK>
+E1D4 75BD E1D4 <CJK>
+E1D5 75B8 E1D5 <CJK>
+E1D6 75BC E1D6 <CJK>
+E1D7 75B1 E1D7 <CJK>
+E1D8 75CD E1D8 <CJK>
+E1D9 75CA E1D9 <CJK>
+E1DA 75D2 E1DA <CJK>
+E1DB 75D9 E1DB <CJK>
+E1DC 75E3 E1DC <CJK>
+E1DD 75DE E1DD <CJK>
+E1DE 75FE E1DE <CJK>
+E1DF 75FF E1DF <CJK>
+E1E0 75FC E1E0 <CJK>
+E1E1 7601 E1E1 <CJK>
+E1E2 75F0 E1E2 <CJK>
+E1E3 75FA E1E3 <CJK>
+E1E4 75F2 E1E4 <CJK>
+E1E5 75F3 E1E5 <CJK>
+E1E6 760B E1E6 <CJK>
+E1E7 760D E1E7 <CJK>
+E1E8 7609 E1E8 <CJK>
+E1E9 761F E1E9 <CJK>
+E1EA 7627 E1EA <CJK>
+E1EB 7620 E1EB <CJK>
+E1EC 7621 E1EC <CJK>
+E1ED 7622 E1ED <CJK>
+E1EE 7624 E1EE <CJK>
+E1EF 7634 E1EF <CJK>
+E1F0 7630 E1F0 <CJK>
+E1F1 763B E1F1 <CJK>
+E1F2 7647 E1F2 <CJK>
+E1F3 7648 E1F3 <CJK>
+E1F4 7646 E1F4 <CJK>
+E1F5 765C E1F5 <CJK>
+E1F6 7658 E1F6 <CJK>
+E1F7 7661 E1F7 <CJK>
+E1F8 7662 E1F8 <CJK>
+E1F9 7668 E1F9 <CJK>
+E1FA 7669 E1FA <CJK>
+E1FB 766A E1FB <CJK>
+E1FC 7667 E1FC <CJK>
+E1FD 766C E1FD <CJK>
+E1FE 7670 E1FE <CJK>
+E2A1 7672 E2A1 <CJK>
+E2A2 7676 E2A2 <CJK>
+E2A3 7678 E2A3 <CJK>
+E2A4 767C E2A4 <CJK>
+E2A5 7680 E2A5 <CJK>
+E2A6 7683 E2A6 <CJK>
+E2A7 7688 E2A7 <CJK>
+E2A8 768B E2A8 <CJK>
+E2A9 768E E2A9 <CJK>
+E2AA 7696 E2AA <CJK>
+E2AB 7693 E2AB <CJK>
+E2AC 7699 E2AC <CJK>
+E2AD 769A E2AD <CJK>
+E2AE 76B0 E2AE <CJK>
+E2AF 76B4 E2AF <CJK>
+E2B0 76B8 E2B0 <CJK>
+E2B1 76B9 E2B1 <CJK>
+E2B2 76BA E2B2 <CJK>
+E2B3 76C2 E2B3 <CJK>
+E2B4 76CD E2B4 <CJK>
+E2B5 76D6 E2B5 <CJK>
+E2B6 76D2 E2B6 <CJK>
+E2B7 76DE E2B7 <CJK>
+E2B8 76E1 E2B8 <CJK>
+E2B9 76E5 E2B9 <CJK>
+E2BA 76E7 E2BA <CJK>
+E2BB 76EA E2BB <CJK>
+E2BC 862F E2BC <CJK>
+E2BD 76FB E2BD <CJK>
+E2BE 7708 E2BE <CJK>
+E2BF 7707 E2BF <CJK>
+E2C0 7704 E2C0 <CJK>
+E2C1 7729 E2C1 <CJK>
+E2C2 7724 E2C2 <CJK>
+E2C3 771E E2C3 <CJK>
+E2C4 7725 E2C4 <CJK>
+E2C5 7726 E2C5 <CJK>
+E2C6 771B E2C6 <CJK>
+E2C7 7737 E2C7 <CJK>
+E2C8 7738 E2C8 <CJK>
+E2C9 7747 E2C9 <CJK>
+E2CA 775A E2CA <CJK>
+E2CB 7768 E2CB <CJK>
+E2CC 776B E2CC <CJK>
+E2CD 775B E2CD <CJK>
+E2CE 7765 E2CE <CJK>
+E2CF 777F E2CF <CJK>
+E2D0 777E E2D0 <CJK>
+E2D1 7779 E2D1 <CJK>
+E2D2 778E E2D2 <CJK>
+E2D3 778B E2D3 <CJK>
+E2D4 7791 E2D4 <CJK>
+E2D5 77A0 E2D5 <CJK>
+E2D6 779E E2D6 <CJK>
+E2D7 77B0 E2D7 <CJK>
+E2D8 77B6 E2D8 <CJK>
+E2D9 77B9 E2D9 <CJK>
+E2DA 77BF E2DA <CJK>
+E2DB 77BC E2DB <CJK>
+E2DC 77BD E2DC <CJK>
+E2DD 77BB E2DD <CJK>
+E2DE 77C7 E2DE <CJK>
+E2DF 77CD E2DF <CJK>
+E2E0 77D7 E2E0 <CJK>
+E2E1 77DA E2E1 <CJK>
+E2E2 77DC E2E2 <CJK>
+E2E3 77E3 E2E3 <CJK>
+E2E4 77EE E2E4 <CJK>
+E2E5 77FC E2E5 <CJK>
+E2E6 780C E2E6 <CJK>
+E2E7 7812 E2E7 <CJK>
+E2E8 7926 E2E8 <CJK>
+E2E9 7820 E2E9 <CJK>
+E2EA 792A E2EA <CJK>
+E2EB 7845 E2EB <CJK>
+E2EC 788E E2EC <CJK>
+E2ED 7874 E2ED <CJK>
+E2EE 7886 E2EE <CJK>
+E2EF 787C E2EF <CJK>
+E2F0 789A E2F0 <CJK>
+E2F1 788C E2F1 <CJK>
+E2F2 78A3 E2F2 <CJK>
+E2F3 78B5 E2F3 <CJK>
+E2F4 78AA E2F4 <CJK>
+E2F5 78AF E2F5 <CJK>
+E2F6 78D1 E2F6 <CJK>
+E2F7 78C6 E2F7 <CJK>
+E2F8 78CB E2F8 <CJK>
+E2F9 78D4 E2F9 <CJK>
+E2FA 78BE E2FA <CJK>
+E2FB 78BC E2FB <CJK>
+E2FC 78C5 E2FC <CJK>
+E2FD 78CA E2FD <CJK>
+E2FE 78EC E2FE <CJK>
+E3A1 78E7 E3A1 <CJK>
+E3A2 78DA E3A2 <CJK>
+E3A3 78FD E3A3 <CJK>
+E3A4 78F4 E3A4 <CJK>
+E3A5 7907 E3A5 <CJK>
+E3A6 7912 E3A6 <CJK>
+E3A7 7911 E3A7 <CJK>
+E3A8 7919 E3A8 <CJK>
+E3A9 792C E3A9 <CJK>
+E3AA 792B E3AA <CJK>
+E3AB 7940 E3AB <CJK>
+E3AC 7960 E3AC <CJK>
+E3AD 7957 E3AD <CJK>
+E3AE 795F E3AE <CJK>
+E3AF 795A E3AF <CJK>
+E3B0 7955 E3B0 <CJK>
+E3B1 7953 E3B1 <CJK>
+E3B2 797A E3B2 <CJK>
+E3B3 797F E3B3 <CJK>
+E3B4 798A E3B4 <CJK>
+E3B5 799D E3B5 <CJK>
+E3B6 79A7 E3B6 <CJK>
+E3B7 9F4B E3B7 <CJK>
+E3B8 79AA E3B8 <CJK>
+E3B9 79AE E3B9 <CJK>
+E3BA 79B3 E3BA <CJK>
+E3BB 79B9 E3BB <CJK>
+E3BC 79BA E3BC <CJK>
+E3BD 79C9 E3BD <CJK>
+E3BE 79D5 E3BE <CJK>
+E3BF 79E7 E3BF <CJK>
+E3C0 79EC E3C0 <CJK>
+E3C1 79E1 E3C1 <CJK>
+E3C2 79E3 E3C2 <CJK>
+E3C3 7A08 E3C3 <CJK>
+E3C4 7A0D E3C4 <CJK>
+E3C5 7A18 E3C5 <CJK>
+E3C6 7A19 E3C6 <CJK>
+E3C7 7A20 E3C7 <CJK>
+E3C8 7A1F E3C8 <CJK>
+E3C9 7980 E3C9 <CJK>
+E3CA 7A31 E3CA <CJK>
+E3CB 7A3B E3CB <CJK>
+E3CC 7A3E E3CC <CJK>
+E3CD 7A37 E3CD <CJK>
+E3CE 7A43 E3CE <CJK>
+E3CF 7A57 E3CF <CJK>
+E3D0 7A49 E3D0 <CJK>
+E3D1 7A61 E3D1 <CJK>
+E3D2 7A62 E3D2 <CJK>
+E3D3 7A69 E3D3 <CJK>
+E3D4 9F9D E3D4 <CJK>
+E3D5 7A70 E3D5 <CJK>
+E3D6 7A79 E3D6 <CJK>
+E3D7 7A7D E3D7 <CJK>
+E3D8 7A88 E3D8 <CJK>
+E3D9 7A97 E3D9 <CJK>
+E3DA 7A95 E3DA <CJK>
+E3DB 7A98 E3DB <CJK>
+E3DC 7A96 E3DC <CJK>
+E3DD 7AA9 E3DD <CJK>
+E3DE 7AC8 E3DE <CJK>
+E3DF 7AB0 E3DF <CJK>
+E3E0 7AB6 E3E0 <CJK>
+E3E1 7AC5 E3E1 <CJK>
+E3E2 7AC4 E3E2 <CJK>
+E3E3 7ABF E3E3 <CJK>
+E3E4 9083 E3E4 <CJK>
+E3E5 7AC7 E3E5 <CJK>
+E3E6 7ACA E3E6 <CJK>
+E3E7 7ACD E3E7 <CJK>
+E3E8 7ACF E3E8 <CJK>
+E3E9 7AD5 E3E9 <CJK>
+E3EA 7AD3 E3EA <CJK>
+E3EB 7AD9 E3EB <CJK>
+E3EC 7ADA E3EC <CJK>
+E3ED 7ADD E3ED <CJK>
+E3EE 7AE1 E3EE <CJK>
+E3EF 7AE2 E3EF <CJK>
+E3F0 7AE6 E3F0 <CJK>
+E3F1 7AED E3F1 <CJK>
+E3F2 7AF0 E3F2 <CJK>
+E3F3 7B02 E3F3 <CJK>
+E3F4 7B0F E3F4 <CJK>
+E3F5 7B0A E3F5 <CJK>
+E3F6 7B06 E3F6 <CJK>
+E3F7 7B33 E3F7 <CJK>
+E3F8 7B18 E3F8 <CJK>
+E3F9 7B19 E3F9 <CJK>
+E3FA 7B1E E3FA <CJK>
+E3FB 7B35 E3FB <CJK>
+E3FC 7B28 E3FC <CJK>
+E3FD 7B36 E3FD <CJK>
+E3FE 7B50 E3FE <CJK>
+E4A1 7B7A E4A1 <CJK>
+E4A2 7B04 E4A2 <CJK>
+E4A3 7B4D E4A3 <CJK>
+E4A4 7B0B E4A4 <CJK>
+E4A5 7B4C E4A5 <CJK>
+E4A6 7B45 E4A6 <CJK>
+E4A7 7B75 E4A7 <CJK>
+E4A8 7B65 E4A8 <CJK>
+E4A9 7B74 E4A9 <CJK>
+E4AA 7B67 E4AA <CJK>
+E4AB 7B70 E4AB <CJK>
+E4AC 7B71 E4AC <CJK>
+E4AD 7B6C E4AD <CJK>
+E4AE 7B6E E4AE <CJK>
+E4AF 7B9D E4AF <CJK>
+E4B0 7B98 E4B0 <CJK>
+E4B1 7B9F E4B1 <CJK>
+E4B2 7B8D E4B2 <CJK>
+E4B3 7B9C E4B3 <CJK>
+E4B4 7B9A E4B4 <CJK>
+E4B5 7B8B E4B5 <CJK>
+E4B6 7B92 E4B6 <CJK>
+E4B7 7B8F E4B7 <CJK>
+E4B8 7B5D E4B8 <CJK>
+E4B9 7B99 E4B9 <CJK>
+E4BA 7BCB E4BA <CJK>
+E4BB 7BC1 E4BB <CJK>
+E4BC 7BCC E4BC <CJK>
+E4BD 7BCF E4BD <CJK>
+E4BE 7BB4 E4BE <CJK>
+E4BF 7BC6 E4BF <CJK>
+E4C0 7BDD E4C0 <CJK>
+E4C1 7BE9 E4C1 <CJK>
+E4C2 7C11 E4C2 <CJK>
+E4C3 7C14 E4C3 <CJK>
+E4C4 7BE6 E4C4 <CJK>
+E4C5 7BE5 E4C5 <CJK>
+E4C6 7C60 E4C6 <CJK>
+E4C7 7C00 E4C7 <CJK>
+E4C8 7C07 E4C8 <CJK>
+E4C9 7C13 E4C9 <CJK>
+E4CA 7BF3 E4CA <CJK>
+E4CB 7BF7 E4CB <CJK>
+E4CC 7C17 E4CC <CJK>
+E4CD 7C0D E4CD <CJK>
+E4CE 7BF6 E4CE <CJK>
+E4CF 7C23 E4CF <CJK>
+E4D0 7C27 E4D0 <CJK>
+E4D1 7C2A E4D1 <CJK>
+E4D2 7C1F E4D2 <CJK>
+E4D3 7C37 E4D3 <CJK>
+E4D4 7C2B E4D4 <CJK>
+E4D5 7C3D E4D5 <CJK>
+E4D6 7C4C E4D6 <CJK>
+E4D7 7C43 E4D7 <CJK>
+E4D8 7C54 E4D8 <CJK>
+E4D9 7C4F E4D9 <CJK>
+E4DA 7C40 E4DA <CJK>
+E4DB 7C50 E4DB <CJK>
+E4DC 7C58 E4DC <CJK>
+E4DD 7C5F E4DD <CJK>
+E4DE 7C64 E4DE <CJK>
+E4DF 7C56 E4DF <CJK>
+E4E0 7C65 E4E0 <CJK>
+E4E1 7C6C E4E1 <CJK>
+E4E2 7C75 E4E2 <CJK>
+E4E3 7C83 E4E3 <CJK>
+E4E4 7C90 E4E4 <CJK>
+E4E5 7CA4 E4E5 <CJK>
+E4E6 7CAD E4E6 <CJK>
+E4E7 7CA2 E4E7 <CJK>
+E4E8 7CAB E4E8 <CJK>
+E4E9 7CA1 E4E9 <CJK>
+E4EA 7CA8 E4EA <CJK>
+E4EB 7CB3 E4EB <CJK>
+E4EC 7CB2 E4EC <CJK>
+E4ED 7CB1 E4ED <CJK>
+E4EE 7CAE E4EE <CJK>
+E4EF 7CB9 E4EF <CJK>
+E4F0 7CBD E4F0 <CJK>
+E4F1 7CC0 E4F1 <CJK>
+E4F2 7CC5 E4F2 <CJK>
+E4F3 7CC2 E4F3 <CJK>
+E4F4 7CD8 E4F4 <CJK>
+E4F5 7CD2 E4F5 <CJK>
+E4F6 7CDC E4F6 <CJK>
+E4F7 7CE2 E4F7 <CJK>
+E4F8 9B3B E4F8 <CJK>
+E4F9 7CEF E4F9 <CJK>
+E4FA 7CF2 E4FA <CJK>
+E4FB 7CF4 E4FB <CJK>
+E4FC 7CF6 E4FC <CJK>
+E4FD 7CFA E4FD <CJK>
+E4FE 7D06 E4FE <CJK>
+E5A1 7D02 E5A1 <CJK>
+E5A2 7D1C E5A2 <CJK>
+E5A3 7D15 E5A3 <CJK>
+E5A4 7D0A E5A4 <CJK>
+E5A5 7D45 E5A5 <CJK>
+E5A6 7D4B E5A6 <CJK>
+E5A7 7D2E E5A7 <CJK>
+E5A8 7D32 E5A8 <CJK>
+E5A9 7D3F E5A9 <CJK>
+E5AA 7D35 E5AA <CJK>
+E5AB 7D46 E5AB <CJK>
+E5AC 7D73 E5AC <CJK>
+E5AD 7D56 E5AD <CJK>
+E5AE 7D4E E5AE <CJK>
+E5AF 7D72 E5AF <CJK>
+E5B0 7D68 E5B0 <CJK>
+E5B1 7D6E E5B1 <CJK>
+E5B2 7D4F E5B2 <CJK>
+E5B3 7D63 E5B3 <CJK>
+E5B4 7D93 E5B4 <CJK>
+E5B5 7D89 E5B5 <CJK>
+E5B6 7D5B E5B6 <CJK>
+E5B7 7D8F E5B7 <CJK>
+E5B8 7D7D E5B8 <CJK>
+E5B9 7D9B E5B9 <CJK>
+E5BA 7DBA E5BA <CJK>
+E5BB 7DAE E5BB <CJK>
+E5BC 7DA3 E5BC <CJK>
+E5BD 7DB5 E5BD <CJK>
+E5BE 7DC7 E5BE <CJK>
+E5BF 7DBD E5BF <CJK>
+E5C0 7DAB E5C0 <CJK>
+E5C1 7E3D E5C1 <CJK>
+E5C2 7DA2 E5C2 <CJK>
+E5C3 7DAF E5C3 <CJK>
+E5C4 7DDC E5C4 <CJK>
+E5C5 7DB8 E5C5 <CJK>
+E5C6 7D9F E5C6 <CJK>
+E5C7 7DB0 E5C7 <CJK>
+E5C8 7DD8 E5C8 <CJK>
+E5C9 7DDD E5C9 <CJK>
+E5CA 7DE4 E5CA <CJK>
+E5CB 7DDE E5CB <CJK>
+E5CC 7DFB E5CC <CJK>
+E5CD 7DF2 E5CD <CJK>
+E5CE 7DE1 E5CE <CJK>
+E5CF 7E05 E5CF <CJK>
+E5D0 7E0A E5D0 <CJK>
+E5D1 7E23 E5D1 <CJK>
+E5D2 7E21 E5D2 <CJK>
+E5D3 7E12 E5D3 <CJK>
+E5D4 7E31 E5D4 <CJK>
+E5D5 7E1F E5D5 <CJK>
+E5D6 7E09 E5D6 <CJK>
+E5D7 7E0B E5D7 <CJK>
+E5D8 7E22 E5D8 <CJK>
+E5D9 7E46 E5D9 <CJK>
+E5DA 7E66 E5DA <CJK>
+E5DB 7E3B E5DB <CJK>
+E5DC 7E35 E5DC <CJK>
+E5DD 7E39 E5DD <CJK>
+E5DE 7E43 E5DE <CJK>
+E5DF 7E37 E5DF <CJK>
+E5E0 7E32 E5E0 <CJK>
+E5E1 7E3A E5E1 <CJK>
+E5E2 7E67 E5E2 <CJK>
+E5E3 7E5D E5E3 <CJK>
+E5E4 7E56 E5E4 <CJK>
+E5E5 7E5E E5E5 <CJK>
+E5E6 7E59 E5E6 <CJK>
+E5E7 7E5A E5E7 <CJK>
+E5E8 7E79 E5E8 <CJK>
+E5E9 7E6A E5E9 <CJK>
+E5EA 7E69 E5EA <CJK>
+E5EB 7E7C E5EB <CJK>
+E5EC 7E7B E5EC <CJK>
+E5ED 7E83 E5ED <CJK>
+E5EE 7DD5 E5EE <CJK>
+E5EF 7E7D E5EF <CJK>
+E5F0 8FAE E5F0 <CJK>
+E5F1 7E7F E5F1 <CJK>
+E5F2 7E88 E5F2 <CJK>
+E5F3 7E89 E5F3 <CJK>
+E5F4 7E8C E5F4 <CJK>
+E5F5 7E92 E5F5 <CJK>
+E5F6 7E90 E5F6 <CJK>
+E5F7 7E93 E5F7 <CJK>
+E5F8 7E94 E5F8 <CJK>
+E5F9 7E96 E5F9 <CJK>
+E5FA 7E8E E5FA <CJK>
+E5FB 7E9B E5FB <CJK>
+E5FC 7E9C E5FC <CJK>
+E5FD 7F38 E5FD <CJK>
+E5FE 7F3A E5FE <CJK>
+E6A1 7F45 E6A1 <CJK>
+E6A2 7F4C E6A2 <CJK>
+E6A3 7F4D E6A3 <CJK>
+E6A4 7F4E E6A4 <CJK>
+E6A5 7F50 E6A5 <CJK>
+E6A6 7F51 E6A6 <CJK>
+E6A7 7F55 E6A7 <CJK>
+E6A8 7F54 E6A8 <CJK>
+E6A9 7F58 E6A9 <CJK>
+E6AA 7F5F E6AA <CJK>
+E6AB 7F60 E6AB <CJK>
+E6AC 7F68 E6AC <CJK>
+E6AD 7F69 E6AD <CJK>
+E6AE 7F67 E6AE <CJK>
+E6AF 7F78 E6AF <CJK>
+E6B0 7F82 E6B0 <CJK>
+E6B1 7F86 E6B1 <CJK>
+E6B2 7F83 E6B2 <CJK>
+E6B3 7F88 E6B3 <CJK>
+E6B4 7F87 E6B4 <CJK>
+E6B5 7F8C E6B5 <CJK>
+E6B6 7F94 E6B6 <CJK>
+E6B7 7F9E E6B7 <CJK>
+E6B8 7F9D E6B8 <CJK>
+E6B9 7F9A E6B9 <CJK>
+E6BA 7FA3 E6BA <CJK>
+E6BB 7FAF E6BB <CJK>
+E6BC 7FB2 E6BC <CJK>
+E6BD 7FB9 E6BD <CJK>
+E6BE 7FAE E6BE <CJK>
+E6BF 7FB6 E6BF <CJK>
+E6C0 7FB8 E6C0 <CJK>
+E6C1 8B71 E6C1 <CJK>
+E6C2 7FC5 E6C2 <CJK>
+E6C3 7FC6 E6C3 <CJK>
+E6C4 7FCA E6C4 <CJK>
+E6C5 7FD5 E6C5 <CJK>
+E6C6 7FD4 E6C6 <CJK>
+E6C7 7FE1 E6C7 <CJK>
+E6C8 7FE6 E6C8 <CJK>
+E6C9 7FE9 E6C9 <CJK>
+E6CA 7FF3 E6CA <CJK>
+E6CB 7FF9 E6CB <CJK>
+E6CC 98DC E6CC <CJK>
+E6CD 8006 E6CD <CJK>
+E6CE 8004 E6CE <CJK>
+E6CF 800B E6CF <CJK>
+E6D0 8012 E6D0 <CJK>
+E6D1 8018 E6D1 <CJK>
+E6D2 8019 E6D2 <CJK>
+E6D3 801C E6D3 <CJK>
+E6D4 8021 E6D4 <CJK>
+E6D5 8028 E6D5 <CJK>
+E6D6 803F E6D6 <CJK>
+E6D7 803B E6D7 <CJK>
+E6D8 804A E6D8 <CJK>
+E6D9 8046 E6D9 <CJK>
+E6DA 8052 E6DA <CJK>
+E6DB 8058 E6DB <CJK>
+E6DC 805A E6DC <CJK>
+E6DD 805F E6DD <CJK>
+E6DE 8062 E6DE <CJK>
+E6DF 8068 E6DF <CJK>
+E6E0 8073 E6E0 <CJK>
+E6E1 8072 E6E1 <CJK>
+E6E2 8070 E6E2 <CJK>
+E6E3 8076 E6E3 <CJK>
+E6E4 8079 E6E4 <CJK>
+E6E5 807D E6E5 <CJK>
+E6E6 807F E6E6 <CJK>
+E6E7 8084 E6E7 <CJK>
+E6E8 8086 E6E8 <CJK>
+E6E9 8085 E6E9 <CJK>
+E6EA 809B E6EA <CJK>
+E6EB 8093 E6EB <CJK>
+E6EC 809A E6EC <CJK>
+E6ED 80AD E6ED <CJK>
+E6EE 5190 E6EE <CJK>
+E6EF 80AC E6EF <CJK>
+E6F0 80DB E6F0 <CJK>
+E6F1 80E5 E6F1 <CJK>
+E6F2 80D9 E6F2 <CJK>
+E6F3 80DD E6F3 <CJK>
+E6F4 80C4 E6F4 <CJK>
+E6F5 80DA E6F5 <CJK>
+E6F6 80D6 E6F6 <CJK>
+E6F7 8109 E6F7 <CJK>
+E6F8 80EF E6F8 <CJK>
+E6F9 80F1 E6F9 <CJK>
+E6FA 811B E6FA <CJK>
+E6FB 8129 E6FB <CJK>
+E6FC 8123 E6FC <CJK>
+E6FD 812F E6FD <CJK>
+E6FE 814B E6FE <CJK>
+E7A1 968B E7A1 <CJK>
+E7A2 8146 E7A2 <CJK>
+E7A3 813E E7A3 <CJK>
+E7A4 8153 E7A4 <CJK>
+E7A5 8151 E7A5 <CJK>
+E7A6 80FC E7A6 <CJK>
+E7A7 8171 E7A7 <CJK>
+E7A8 816E E7A8 <CJK>
+E7A9 8165 E7A9 <CJK>
+E7AA 8166 E7AA <CJK>
+E7AB 8174 E7AB <CJK>
+E7AC 8183 E7AC <CJK>
+E7AD 8188 E7AD <CJK>
+E7AE 818A E7AE <CJK>
+E7AF 8180 E7AF <CJK>
+E7B0 8182 E7B0 <CJK>
+E7B1 81A0 E7B1 <CJK>
+E7B2 8195 E7B2 <CJK>
+E7B3 81A4 E7B3 <CJK>
+E7B4 81A3 E7B4 <CJK>
+E7B5 815F E7B5 <CJK>
+E7B6 8193 E7B6 <CJK>
+E7B7 81A9 E7B7 <CJK>
+E7B8 81B0 E7B8 <CJK>
+E7B9 81B5 E7B9 <CJK>
+E7BA 81BE E7BA <CJK>
+E7BB 81B8 E7BB <CJK>
+E7BC 81BD E7BC <CJK>
+E7BD 81C0 E7BD <CJK>
+E7BE 81C2 E7BE <CJK>
+E7BF 81BA E7BF <CJK>
+E7C0 81C9 E7C0 <CJK>
+E7C1 81CD E7C1 <CJK>
+E7C2 81D1 E7C2 <CJK>
+E7C3 81D9 E7C3 <CJK>
+E7C4 81D8 E7C4 <CJK>
+E7C5 81C8 E7C5 <CJK>
+E7C6 81DA E7C6 <CJK>
+E7C7 81DF E7C7 <CJK>
+E7C8 81E0 E7C8 <CJK>
+E7C9 81E7 E7C9 <CJK>
+E7CA 81FA E7CA <CJK>
+E7CB 81FB E7CB <CJK>
+E7CC 81FE E7CC <CJK>
+E7CD 8201 E7CD <CJK>
+E7CE 8202 E7CE <CJK>
+E7CF 8205 E7CF <CJK>
+E7D0 8207 E7D0 <CJK>
+E7D1 820A E7D1 <CJK>
+E7D2 820D E7D2 <CJK>
+E7D3 8210 E7D3 <CJK>
+E7D4 8216 E7D4 <CJK>
+E7D5 8229 E7D5 <CJK>
+E7D6 822B E7D6 <CJK>
+E7D7 8238 E7D7 <CJK>
+E7D8 8233 E7D8 <CJK>
+E7D9 8240 E7D9 <CJK>
+E7DA 8259 E7DA <CJK>
+E7DB 8258 E7DB <CJK>
+E7DC 825D E7DC <CJK>
+E7DD 825A E7DD <CJK>
+E7DE 825F E7DE <CJK>
+E7DF 8264 E7DF <CJK>
+E7E0 8262 E7E0 <CJK>
+E7E1 8268 E7E1 <CJK>
+E7E2 826A E7E2 <CJK>
+E7E3 826B E7E3 <CJK>
+E7E4 822E E7E4 <CJK>
+E7E5 8271 E7E5 <CJK>
+E7E6 8277 E7E6 <CJK>
+E7E7 8278 E7E7 <CJK>
+E7E8 827E E7E8 <CJK>
+E7E9 828D E7E9 <CJK>
+E7EA 8292 E7EA <CJK>
+E7EB 82AB E7EB <CJK>
+E7EC 829F E7EC <CJK>
+E7ED 82BB E7ED <CJK>
+E7EE 82AC E7EE <CJK>
+E7EF 82E1 E7EF <CJK>
+E7F0 82E3 E7F0 <CJK>
+E7F1 82DF E7F1 <CJK>
+E7F2 82D2 E7F2 <CJK>
+E7F3 82F4 E7F3 <CJK>
+E7F4 82F3 E7F4 <CJK>
+E7F5 82FA E7F5 <CJK>
+E7F6 8393 E7F6 <CJK>
+E7F7 8303 E7F7 <CJK>
+E7F8 82FB E7F8 <CJK>
+E7F9 82F9 E7F9 <CJK>
+E7FA 82DE E7FA <CJK>
+E7FB 8306 E7FB <CJK>
+E7FC 82DC E7FC <CJK>
+E7FD 8309 E7FD <CJK>
+E7FE 82D9 E7FE <CJK>
+E8A1 8335 E8A1 <CJK>
+E8A2 8334 E8A2 <CJK>
+E8A3 8316 E8A3 <CJK>
+E8A4 8332 E8A4 <CJK>
+E8A5 8331 E8A5 <CJK>
+E8A6 8340 E8A6 <CJK>
+E8A7 8339 E8A7 <CJK>
+E8A8 8350 E8A8 <CJK>
+E8A9 8345 E8A9 <CJK>
+E8AA 832F E8AA <CJK>
+E8AB 832B E8AB <CJK>
+E8AC 8317 E8AC <CJK>
+E8AD 8318 E8AD <CJK>
+E8AE 8385 E8AE <CJK>
+E8AF 839A E8AF <CJK>
+E8B0 83AA E8B0 <CJK>
+E8B1 839F E8B1 <CJK>
+E8B2 83A2 E8B2 <CJK>
+E8B3 8396 E8B3 <CJK>
+E8B4 8323 E8B4 <CJK>
+E8B5 838E E8B5 <CJK>
+E8B6 8387 E8B6 <CJK>
+E8B7 838A E8B7 <CJK>
+E8B8 837C E8B8 <CJK>
+E8B9 83B5 E8B9 <CJK>
+E8BA 8373 E8BA <CJK>
+E8BB 8375 E8BB <CJK>
+E8BC 83A0 E8BC <CJK>
+E8BD 8389 E8BD <CJK>
+E8BE 83A8 E8BE <CJK>
+E8BF 83F4 E8BF <CJK>
+E8C0 8413 E8C0 <CJK>
+E8C1 83EB E8C1 <CJK>
+E8C2 83CE E8C2 <CJK>
+E8C3 83FD E8C3 <CJK>
+E8C4 8403 E8C4 <CJK>
+E8C5 83D8 E8C5 <CJK>
+E8C6 840B E8C6 <CJK>
+E8C7 83C1 E8C7 <CJK>
+E8C8 83F7 E8C8 <CJK>
+E8C9 8407 E8C9 <CJK>
+E8CA 83E0 E8CA <CJK>
+E8CB 83F2 E8CB <CJK>
+E8CC 840D E8CC <CJK>
+E8CD 8422 E8CD <CJK>
+E8CE 8420 E8CE <CJK>
+E8CF 83BD E8CF <CJK>
+E8D0 8438 E8D0 <CJK>
+E8D1 8506 E8D1 <CJK>
+E8D2 83FB E8D2 <CJK>
+E8D3 846D E8D3 <CJK>
+E8D4 842A E8D4 <CJK>
+E8D5 843C E8D5 <CJK>
+E8D6 855A E8D6 <CJK>
+E8D7 8484 E8D7 <CJK>
+E8D8 8477 E8D8 <CJK>
+E8D9 846B E8D9 <CJK>
+E8DA 84AD E8DA <CJK>
+E8DB 846E E8DB <CJK>
+E8DC 8482 E8DC <CJK>
+E8DD 8469 E8DD <CJK>
+E8DE 8446 E8DE <CJK>
+E8DF 842C E8DF <CJK>
+E8E0 846F E8E0 <CJK>
+E8E1 8479 E8E1 <CJK>
+E8E2 8435 E8E2 <CJK>
+E8E3 84CA E8E3 <CJK>
+E8E4 8462 E8E4 <CJK>
+E8E5 84B9 E8E5 <CJK>
+E8E6 84BF E8E6 <CJK>
+E8E7 849F E8E7 <CJK>
+E8E8 84D9 E8E8 <CJK>
+E8E9 84CD E8E9 <CJK>
+E8EA 84BB E8EA <CJK>
+E8EB 84DA E8EB <CJK>
+E8EC 84D0 E8EC <CJK>
+E8ED 84C1 E8ED <CJK>
+E8EE 84C6 E8EE <CJK>
+E8EF 84D6 E8EF <CJK>
+E8F0 84A1 E8F0 <CJK>
+E8F1 8521 E8F1 <CJK>
+E8F2 84FF E8F2 <CJK>
+E8F3 84F4 E8F3 <CJK>
+E8F4 8517 E8F4 <CJK>
+E8F5 8518 E8F5 <CJK>
+E8F6 852C E8F6 <CJK>
+E8F7 851F E8F7 <CJK>
+E8F8 8515 E8F8 <CJK>
+E8F9 8514 E8F9 <CJK>
+E8FA 84FC E8FA <CJK>
+E8FB 8540 E8FB <CJK>
+E8FC 8563 E8FC <CJK>
+E8FD 8558 E8FD <CJK>
+E8FE 8548 E8FE <CJK>
+E9A1 8541 E9A1 <CJK>
+E9A2 8602 E9A2 <CJK>
+E9A3 854B E9A3 <CJK>
+E9A4 8555 E9A4 <CJK>
+E9A5 8580 E9A5 <CJK>
+E9A6 85A4 E9A6 <CJK>
+E9A7 8588 E9A7 <CJK>
+E9A8 8591 E9A8 <CJK>
+E9A9 858A E9A9 <CJK>
+E9AA 85A8 E9AA <CJK>
+E9AB 856D E9AB <CJK>
+E9AC 8594 E9AC <CJK>
+E9AD 859B E9AD <CJK>
+E9AE 85EA E9AE <CJK>
+E9AF 8587 E9AF <CJK>
+E9B0 859C E9B0 <CJK>
+E9B1 8577 E9B1 <CJK>
+E9B2 857E E9B2 <CJK>
+E9B3 8590 E9B3 <CJK>
+E9B4 85C9 E9B4 <CJK>
+E9B5 85BA E9B5 <CJK>
+E9B6 85CF E9B6 <CJK>
+E9B7 85B9 E9B7 <CJK>
+E9B8 85D0 E9B8 <CJK>
+E9B9 85D5 E9B9 <CJK>
+E9BA 85DD E9BA <CJK>
+E9BB 85E5 E9BB <CJK>
+E9BC 85DC E9BC <CJK>
+E9BD 85F9 E9BD <CJK>
+E9BE 860A E9BE <CJK>
+E9BF 8613 E9BF <CJK>
+E9C0 860B E9C0 <CJK>
+E9C1 85FE E9C1 <CJK>
+E9C2 85FA E9C2 <CJK>
+E9C3 8606 E9C3 <CJK>
+E9C4 8622 E9C4 <CJK>
+E9C5 861A E9C5 <CJK>
+E9C6 8630 E9C6 <CJK>
+E9C7 863F E9C7 <CJK>
+E9C8 864D E9C8 <CJK>
+E9C9 4E55 E9C9 <CJK>
+E9CA 8654 E9CA <CJK>
+E9CB 865F E9CB <CJK>
+E9CC 8667 E9CC <CJK>
+E9CD 8671 E9CD <CJK>
+E9CE 8693 E9CE <CJK>
+E9CF 86A3 E9CF <CJK>
+E9D0 86A9 E9D0 <CJK>
+E9D1 86AA E9D1 <CJK>
+E9D2 868B E9D2 <CJK>
+E9D3 868C E9D3 <CJK>
+E9D4 86B6 E9D4 <CJK>
+E9D5 86AF E9D5 <CJK>
+E9D6 86C4 E9D6 <CJK>
+E9D7 86C6 E9D7 <CJK>
+E9D8 86B0 E9D8 <CJK>
+E9D9 86C9 E9D9 <CJK>
+E9DA 8823 E9DA <CJK>
+E9DB 86AB E9DB <CJK>
+E9DC 86D4 E9DC <CJK>
+E9DD 86DE E9DD <CJK>
+E9DE 86E9 E9DE <CJK>
+E9DF 86EC E9DF <CJK>
+E9E0 86DF E9E0 <CJK>
+E9E1 86DB E9E1 <CJK>
+E9E2 86EF E9E2 <CJK>
+E9E3 8712 E9E3 <CJK>
+E9E4 8706 E9E4 <CJK>
+E9E5 8708 E9E5 <CJK>
+E9E6 8700 E9E6 <CJK>
+E9E7 8703 E9E7 <CJK>
+E9E8 86FB E9E8 <CJK>
+E9E9 8711 E9E9 <CJK>
+E9EA 8709 E9EA <CJK>
+E9EB 870D E9EB <CJK>
+E9EC 86F9 E9EC <CJK>
+E9ED 870A E9ED <CJK>
+E9EE 8734 E9EE <CJK>
+E9EF 873F E9EF <CJK>
+E9F0 8737 E9F0 <CJK>
+E9F1 873B E9F1 <CJK>
+E9F2 8725 E9F2 <CJK>
+E9F3 8729 E9F3 <CJK>
+E9F4 871A E9F4 <CJK>
+E9F5 8760 E9F5 <CJK>
+E9F6 875F E9F6 <CJK>
+E9F7 8778 E9F7 <CJK>
+E9F8 874C E9F8 <CJK>
+E9F9 874E E9F9 <CJK>
+E9FA 8774 E9FA <CJK>
+E9FB 8757 E9FB <CJK>
+E9FC 8768 E9FC <CJK>
+E9FD 876E E9FD <CJK>
+E9FE 8759 E9FE <CJK>
+EAA1 8753 EAA1 <CJK>
+EAA2 8763 EAA2 <CJK>
+EAA3 876A EAA3 <CJK>
+EAA4 8805 EAA4 <CJK>
+EAA5 87A2 EAA5 <CJK>
+EAA6 879F EAA6 <CJK>
+EAA7 8782 EAA7 <CJK>
+EAA8 87AF EAA8 <CJK>
+EAA9 87CB EAA9 <CJK>
+EAAA 87BD EAAA <CJK>
+EAAB 87C0 EAAB <CJK>
+EAAC 87D0 EAAC <CJK>
+EAAD 96D6 EAAD <CJK>
+EAAE 87AB EAAE <CJK>
+EAAF 87C4 EAAF <CJK>
+EAB0 87B3 EAB0 <CJK>
+EAB1 87C7 EAB1 <CJK>
+EAB2 87C6 EAB2 <CJK>
+EAB3 87BB EAB3 <CJK>
+EAB4 87EF EAB4 <CJK>
+EAB5 87F2 EAB5 <CJK>
+EAB6 87E0 EAB6 <CJK>
+EAB7 880F EAB7 <CJK>
+EAB8 880D EAB8 <CJK>
+EAB9 87FE EAB9 <CJK>
+EABA 87F6 EABA <CJK>
+EABB 87F7 EABB <CJK>
+EABC 880E EABC <CJK>
+EABD 87D2 EABD <CJK>
+EABE 8811 EABE <CJK>
+EABF 8816 EABF <CJK>
+EAC0 8815 EAC0 <CJK>
+EAC1 8822 EAC1 <CJK>
+EAC2 8821 EAC2 <CJK>
+EAC3 8831 EAC3 <CJK>
+EAC4 8836 EAC4 <CJK>
+EAC5 8839 EAC5 <CJK>
+EAC6 8827 EAC6 <CJK>
+EAC7 883B EAC7 <CJK>
+EAC8 8844 EAC8 <CJK>
+EAC9 8842 EAC9 <CJK>
+EACA 8852 EACA <CJK>
+EACB 8859 EACB <CJK>
+EACC 885E EACC <CJK>
+EACD 8862 EACD <CJK>
+EACE 886B EACE <CJK>
+EACF 8881 EACF <CJK>
+EAD0 887E EAD0 <CJK>
+EAD1 889E EAD1 <CJK>
+EAD2 8875 EAD2 <CJK>
+EAD3 887D EAD3 <CJK>
+EAD4 88B5 EAD4 <CJK>
+EAD5 8872 EAD5 <CJK>
+EAD6 8882 EAD6 <CJK>
+EAD7 8897 EAD7 <CJK>
+EAD8 8892 EAD8 <CJK>
+EAD9 88AE EAD9 <CJK>
+EADA 8899 EADA <CJK>
+EADB 88A2 EADB <CJK>
+EADC 888D EADC <CJK>
+EADD 88A4 EADD <CJK>
+EADE 88B0 EADE <CJK>
+EADF 88BF EADF <CJK>
+EAE0 88B1 EAE0 <CJK>
+EAE1 88C3 EAE1 <CJK>
+EAE2 88C4 EAE2 <CJK>
+EAE3 88D4 EAE3 <CJK>
+EAE4 88D8 EAE4 <CJK>
+EAE5 88D9 EAE5 <CJK>
+EAE6 88DD EAE6 <CJK>
+EAE7 88F9 EAE7 <CJK>
+EAE8 8902 EAE8 <CJK>
+EAE9 88FC EAE9 <CJK>
+EAEA 88F4 EAEA <CJK>
+EAEB 88E8 EAEB <CJK>
+EAEC 88F2 EAEC <CJK>
+EAED 8904 EAED <CJK>
+EAEE 890C EAEE <CJK>
+EAEF 890A EAEF <CJK>
+EAF0 8913 EAF0 <CJK>
+EAF1 8943 EAF1 <CJK>
+EAF2 891E EAF2 <CJK>
+EAF3 8925 EAF3 <CJK>
+EAF4 892A EAF4 <CJK>
+EAF5 892B EAF5 <CJK>
+EAF6 8941 EAF6 <CJK>
+EAF7 8944 EAF7 <CJK>
+EAF8 893B EAF8 <CJK>
+EAF9 8936 EAF9 <CJK>
+EAFA 8938 EAFA <CJK>
+EAFB 894C EAFB <CJK>
+EAFC 891D EAFC <CJK>
+EAFD 8960 EAFD <CJK>
+EAFE 895E EAFE <CJK>
+EBA1 8966 EBA1 <CJK>
+EBA2 8964 EBA2 <CJK>
+EBA3 896D EBA3 <CJK>
+EBA4 896A EBA4 <CJK>
+EBA5 896F EBA5 <CJK>
+EBA6 8974 EBA6 <CJK>
+EBA7 8977 EBA7 <CJK>
+EBA8 897E EBA8 <CJK>
+EBA9 8983 EBA9 <CJK>
+EBAA 8988 EBAA <CJK>
+EBAB 898A EBAB <CJK>
+EBAC 8993 EBAC <CJK>
+EBAD 8998 EBAD <CJK>
+EBAE 89A1 EBAE <CJK>
+EBAF 89A9 EBAF <CJK>
+EBB0 89A6 EBB0 <CJK>
+EBB1 89AC EBB1 <CJK>
+EBB2 89AF EBB2 <CJK>
+EBB3 89B2 EBB3 <CJK>
+EBB4 89BA EBB4 <CJK>
+EBB5 89BD EBB5 <CJK>
+EBB6 89BF EBB6 <CJK>
+EBB7 89C0 EBB7 <CJK>
+EBB8 89DA EBB8 <CJK>
+EBB9 89DC EBB9 <CJK>
+EBBA 89DD EBBA <CJK>
+EBBB 89E7 EBBB <CJK>
+EBBC 89F4 EBBC <CJK>
+EBBD 89F8 EBBD <CJK>
+EBBE 8A03 EBBE <CJK>
+EBBF 8A16 EBBF <CJK>
+EBC0 8A10 EBC0 <CJK>
+EBC1 8A0C EBC1 <CJK>
+EBC2 8A1B EBC2 <CJK>
+EBC3 8A1D EBC3 <CJK>
+EBC4 8A25 EBC4 <CJK>
+EBC5 8A36 EBC5 <CJK>
+EBC6 8A41 EBC6 <CJK>
+EBC7 8A5B EBC7 <CJK>
+EBC8 8A52 EBC8 <CJK>
+EBC9 8A46 EBC9 <CJK>
+EBCA 8A48 EBCA <CJK>
+EBCB 8A7C EBCB <CJK>
+EBCC 8A6D EBCC <CJK>
+EBCD 8A6C EBCD <CJK>
+EBCE 8A62 EBCE <CJK>
+EBCF 8A85 EBCF <CJK>
+EBD0 8A82 EBD0 <CJK>
+EBD1 8A84 EBD1 <CJK>
+EBD2 8AA8 EBD2 <CJK>
+EBD3 8AA1 EBD3 <CJK>
+EBD4 8A91 EBD4 <CJK>
+EBD5 8AA5 EBD5 <CJK>
+EBD6 8AA6 EBD6 <CJK>
+EBD7 8A9A EBD7 <CJK>
+EBD8 8AA3 EBD8 <CJK>
+EBD9 8AC4 EBD9 <CJK>
+EBDA 8ACD EBDA <CJK>
+EBDB 8AC2 EBDB <CJK>
+EBDC 8ADA EBDC <CJK>
+EBDD 8AEB EBDD <CJK>
+EBDE 8AF3 EBDE <CJK>
+EBDF 8AE7 EBDF <CJK>
+EBE0 8AE4 EBE0 <CJK>
+EBE1 8AF1 EBE1 <CJK>
+EBE2 8B14 EBE2 <CJK>
+EBE3 8AE0 EBE3 <CJK>
+EBE4 8AE2 EBE4 <CJK>
+EBE5 8AF7 EBE5 <CJK>
+EBE6 8ADE EBE6 <CJK>
+EBE7 8ADB EBE7 <CJK>
+EBE8 8B0C EBE8 <CJK>
+EBE9 8B07 EBE9 <CJK>
+EBEA 8B1A EBEA <CJK>
+EBEB 8AE1 EBEB <CJK>
+EBEC 8B16 EBEC <CJK>
+EBED 8B10 EBED <CJK>
+EBEE 8B17 EBEE <CJK>
+EBEF 8B20 EBEF <CJK>
+EBF0 8B33 EBF0 <CJK>
+EBF1 97AB EBF1 <CJK>
+EBF2 8B26 EBF2 <CJK>
+EBF3 8B2B EBF3 <CJK>
+EBF4 8B3E EBF4 <CJK>
+EBF5 8B28 EBF5 <CJK>
+EBF6 8B41 EBF6 <CJK>
+EBF7 8B4C EBF7 <CJK>
+EBF8 8B4F EBF8 <CJK>
+EBF9 8B4E EBF9 <CJK>
+EBFA 8B49 EBFA <CJK>
+EBFB 8B56 EBFB <CJK>
+EBFC 8B5B EBFC <CJK>
+EBFD 8B5A EBFD <CJK>
+EBFE 8B6B EBFE <CJK>
+ECA1 8B5F ECA1 <CJK>
+ECA2 8B6C ECA2 <CJK>
+ECA3 8B6F ECA3 <CJK>
+ECA4 8B74 ECA4 <CJK>
+ECA5 8B7D ECA5 <CJK>
+ECA6 8B80 ECA6 <CJK>
+ECA7 8B8C ECA7 <CJK>
+ECA8 8B8E ECA8 <CJK>
+ECA9 8B92 ECA9 <CJK>
+ECAA 8B93 ECAA <CJK>
+ECAB 8B96 ECAB <CJK>
+ECAC 8B99 ECAC <CJK>
+ECAD 8B9A ECAD <CJK>
+ECAE 8C3A ECAE <CJK>
+ECAF 8C41 ECAF <CJK>
+ECB0 8C3F ECB0 <CJK>
+ECB1 8C48 ECB1 <CJK>
+ECB2 8C4C ECB2 <CJK>
+ECB3 8C4E ECB3 <CJK>
+ECB4 8C50 ECB4 <CJK>
+ECB5 8C55 ECB5 <CJK>
+ECB6 8C62 ECB6 <CJK>
+ECB7 8C6C ECB7 <CJK>
+ECB8 8C78 ECB8 <CJK>
+ECB9 8C7A ECB9 <CJK>
+ECBA 8C82 ECBA <CJK>
+ECBB 8C89 ECBB <CJK>
+ECBC 8C85 ECBC <CJK>
+ECBD 8C8A ECBD <CJK>
+ECBE 8C8D ECBE <CJK>
+ECBF 8C8E ECBF <CJK>
+ECC0 8C94 ECC0 <CJK>
+ECC1 8C7C ECC1 <CJK>
+ECC2 8C98 ECC2 <CJK>
+ECC3 621D ECC3 <CJK>
+ECC4 8CAD ECC4 <CJK>
+ECC5 8CAA ECC5 <CJK>
+ECC6 8CBD ECC6 <CJK>
+ECC7 8CB2 ECC7 <CJK>
+ECC8 8CB3 ECC8 <CJK>
+ECC9 8CAE ECC9 <CJK>
+ECCA 8CB6 ECCA <CJK>
+ECCB 8CC8 ECCB <CJK>
+ECCC 8CC1 ECCC <CJK>
+ECCD 8CE4 ECCD <CJK>
+ECCE 8CE3 ECCE <CJK>
+ECCF 8CDA ECCF <CJK>
+ECD0 8CFD ECD0 <CJK>
+ECD1 8CFA ECD1 <CJK>
+ECD2 8CFB ECD2 <CJK>
+ECD3 8D04 ECD3 <CJK>
+ECD4 8D05 ECD4 <CJK>
+ECD5 8D0A ECD5 <CJK>
+ECD6 8D07 ECD6 <CJK>
+ECD7 8D0F ECD7 <CJK>
+ECD8 8D0D ECD8 <CJK>
+ECD9 8D10 ECD9 <CJK>
+ECDA 9F4E ECDA <CJK>
+ECDB 8D13 ECDB <CJK>
+ECDC 8CCD ECDC <CJK>
+ECDD 8D14 ECDD <CJK>
+ECDE 8D16 ECDE <CJK>
+ECDF 8D67 ECDF <CJK>
+ECE0 8D6D ECE0 <CJK>
+ECE1 8D71 ECE1 <CJK>
+ECE2 8D73 ECE2 <CJK>
+ECE3 8D81 ECE3 <CJK>
+ECE4 8D99 ECE4 <CJK>
+ECE5 8DC2 ECE5 <CJK>
+ECE6 8DBE ECE6 <CJK>
+ECE7 8DBA ECE7 <CJK>
+ECE8 8DCF ECE8 <CJK>
+ECE9 8DDA ECE9 <CJK>
+ECEA 8DD6 ECEA <CJK>
+ECEB 8DCC ECEB <CJK>
+ECEC 8DDB ECEC <CJK>
+ECED 8DCB ECED <CJK>
+ECEE 8DEA ECEE <CJK>
+ECEF 8DEB ECEF <CJK>
+ECF0 8DDF ECF0 <CJK>
+ECF1 8DE3 ECF1 <CJK>
+ECF2 8DFC ECF2 <CJK>
+ECF3 8E08 ECF3 <CJK>
+ECF4 8E09 ECF4 <CJK>
+ECF5 8DFF ECF5 <CJK>
+ECF6 8E1D ECF6 <CJK>
+ECF7 8E1E ECF7 <CJK>
+ECF8 8E10 ECF8 <CJK>
+ECF9 8E1F ECF9 <CJK>
+ECFA 8E42 ECFA <CJK>
+ECFB 8E35 ECFB <CJK>
+ECFC 8E30 ECFC <CJK>
+ECFD 8E34 ECFD <CJK>
+ECFE 8E4A ECFE <CJK>
+EDA1 8E47 EDA1 <CJK>
+EDA2 8E49 EDA2 <CJK>
+EDA3 8E4C EDA3 <CJK>
+EDA4 8E50 EDA4 <CJK>
+EDA5 8E48 EDA5 <CJK>
+EDA6 8E59 EDA6 <CJK>
+EDA7 8E64 EDA7 <CJK>
+EDA8 8E60 EDA8 <CJK>
+EDA9 8E2A EDA9 <CJK>
+EDAA 8E63 EDAA <CJK>
+EDAB 8E55 EDAB <CJK>
+EDAC 8E76 EDAC <CJK>
+EDAD 8E72 EDAD <CJK>
+EDAE 8E7C EDAE <CJK>
+EDAF 8E81 EDAF <CJK>
+EDB0 8E87 EDB0 <CJK>
+EDB1 8E85 EDB1 <CJK>
+EDB2 8E84 EDB2 <CJK>
+EDB3 8E8B EDB3 <CJK>
+EDB4 8E8A EDB4 <CJK>
+EDB5 8E93 EDB5 <CJK>
+EDB6 8E91 EDB6 <CJK>
+EDB7 8E94 EDB7 <CJK>
+EDB8 8E99 EDB8 <CJK>
+EDB9 8EAA EDB9 <CJK>
+EDBA 8EA1 EDBA <CJK>
+EDBB 8EAC EDBB <CJK>
+EDBC 8EB0 EDBC <CJK>
+EDBD 8EC6 EDBD <CJK>
+EDBE 8EB1 EDBE <CJK>
+EDBF 8EBE EDBF <CJK>
+EDC0 8EC5 EDC0 <CJK>
+EDC1 8EC8 EDC1 <CJK>
+EDC2 8ECB EDC2 <CJK>
+EDC3 8EDB EDC3 <CJK>
+EDC4 8EE3 EDC4 <CJK>
+EDC5 8EFC EDC5 <CJK>
+EDC6 8EFB EDC6 <CJK>
+EDC7 8EEB EDC7 <CJK>
+EDC8 8EFE EDC8 <CJK>
+EDC9 8F0A EDC9 <CJK>
+EDCA 8F05 EDCA <CJK>
+EDCB 8F15 EDCB <CJK>
+EDCC 8F12 EDCC <CJK>
+EDCD 8F19 EDCD <CJK>
+EDCE 8F13 EDCE <CJK>
+EDCF 8F1C EDCF <CJK>
+EDD0 8F1F EDD0 <CJK>
+EDD1 8F1B EDD1 <CJK>
+EDD2 8F0C EDD2 <CJK>
+EDD3 8F26 EDD3 <CJK>
+EDD4 8F33 EDD4 <CJK>
+EDD5 8F3B EDD5 <CJK>
+EDD6 8F39 EDD6 <CJK>
+EDD7 8F45 EDD7 <CJK>
+EDD8 8F42 EDD8 <CJK>
+EDD9 8F3E EDD9 <CJK>
+EDDA 8F4C EDDA <CJK>
+EDDB 8F49 EDDB <CJK>
+EDDC 8F46 EDDC <CJK>
+EDDD 8F4E EDDD <CJK>
+EDDE 8F57 EDDE <CJK>
+EDDF 8F5C EDDF <CJK>
+EDE0 8F62 EDE0 <CJK>
+EDE1 8F63 EDE1 <CJK>
+EDE2 8F64 EDE2 <CJK>
+EDE3 8F9C EDE3 <CJK>
+EDE4 8F9F EDE4 <CJK>
+EDE5 8FA3 EDE5 <CJK>
+EDE6 8FAD EDE6 <CJK>
+EDE7 8FAF EDE7 <CJK>
+EDE8 8FB7 EDE8 <CJK>
+EDE9 8FDA EDE9 <CJK>
+EDEA 8FE5 EDEA <CJK>
+EDEB 8FE2 EDEB <CJK>
+EDEC 8FEA EDEC <CJK>
+EDED 8FEF EDED <CJK>
+EDEE 9087 EDEE <CJK>
+EDEF 8FF4 EDEF <CJK>
+EDF0 9005 EDF0 <CJK>
+EDF1 8FF9 EDF1 <CJK>
+EDF2 8FFA EDF2 <CJK>
+EDF3 9011 EDF3 <CJK>
+EDF4 9015 EDF4 <CJK>
+EDF5 9021 EDF5 <CJK>
+EDF6 900D EDF6 <CJK>
+EDF7 901E EDF7 <CJK>
+EDF8 9016 EDF8 <CJK>
+EDF9 900B EDF9 <CJK>
+EDFA 9027 EDFA <CJK>
+EDFB 9036 EDFB <CJK>
+EDFC 9035 EDFC <CJK>
+EDFD 9039 EDFD <CJK>
+EDFE 8FF8 EDFE <CJK>
+EEA1 904F EEA1 <CJK>
+EEA2 9050 EEA2 <CJK>
+EEA3 9051 EEA3 <CJK>
+EEA4 9052 EEA4 <CJK>
+EEA5 900E EEA5 <CJK>
+EEA6 9049 EEA6 <CJK>
+EEA7 903E EEA7 <CJK>
+EEA8 9056 EEA8 <CJK>
+EEA9 9058 EEA9 <CJK>
+EEAA 905E EEAA <CJK>
+EEAB 9068 EEAB <CJK>
+EEAC 906F EEAC <CJK>
+EEAD 9076 EEAD <CJK>
+EEAE 96A8 EEAE <CJK>
+EEAF 9072 EEAF <CJK>
+EEB0 9082 EEB0 <CJK>
+EEB1 907D EEB1 <CJK>
+EEB2 9081 EEB2 <CJK>
+EEB3 9080 EEB3 <CJK>
+EEB4 908A EEB4 <CJK>
+EEB5 9089 EEB5 <CJK>
+EEB6 908F EEB6 <CJK>
+EEB7 90A8 EEB7 <CJK>
+EEB8 90AF EEB8 <CJK>
+EEB9 90B1 EEB9 <CJK>
+EEBA 90B5 EEBA <CJK>
+EEBB 90E2 EEBB <CJK>
+EEBC 90E4 EEBC <CJK>
+EEBD 6248 EEBD <CJK>
+EEBE 90DB EEBE <CJK>
+EEBF 9102 EEBF <CJK>
+EEC0 9112 EEC0 <CJK>
+EEC1 9119 EEC1 <CJK>
+EEC2 9132 EEC2 <CJK>
+EEC3 9130 EEC3 <CJK>
+EEC4 914A EEC4 <CJK>
+EEC5 9156 EEC5 <CJK>
+EEC6 9158 EEC6 <CJK>
+EEC7 9163 EEC7 <CJK>
+EEC8 9165 EEC8 <CJK>
+EEC9 9169 EEC9 <CJK>
+EECA 9173 EECA <CJK>
+EECB 9172 EECB <CJK>
+EECC 918B EECC <CJK>
+EECD 9189 EECD <CJK>
+EECE 9182 EECE <CJK>
+EECF 91A2 EECF <CJK>
+EED0 91AB EED0 <CJK>
+EED1 91AF EED1 <CJK>
+EED2 91AA EED2 <CJK>
+EED3 91B5 EED3 <CJK>
+EED4 91B4 EED4 <CJK>
+EED5 91BA EED5 <CJK>
+EED6 91C0 EED6 <CJK>
+EED7 91C1 EED7 <CJK>
+EED8 91C9 EED8 <CJK>
+EED9 91CB EED9 <CJK>
+EEDA 91D0 EEDA <CJK>
+EEDB 91D6 EEDB <CJK>
+EEDC 91DF EEDC <CJK>
+EEDD 91E1 EEDD <CJK>
+EEDE 91DB EEDE <CJK>
+EEDF 91FC EEDF <CJK>
+EEE0 91F5 EEE0 <CJK>
+EEE1 91F6 EEE1 <CJK>
+EEE2 921E EEE2 <CJK>
+EEE3 91FF EEE3 <CJK>
+EEE4 9214 EEE4 <CJK>
+EEE5 922C EEE5 <CJK>
+EEE6 9215 EEE6 <CJK>
+EEE7 9211 EEE7 <CJK>
+EEE8 925E EEE8 <CJK>
+EEE9 9257 EEE9 <CJK>
+EEEA 9245 EEEA <CJK>
+EEEB 9249 EEEB <CJK>
+EEEC 9264 EEEC <CJK>
+EEED 9248 EEED <CJK>
+EEEE 9295 EEEE <CJK>
+EEEF 923F EEEF <CJK>
+EEF0 924B EEF0 <CJK>
+EEF1 9250 EEF1 <CJK>
+EEF2 929C EEF2 <CJK>
+EEF3 9296 EEF3 <CJK>
+EEF4 9293 EEF4 <CJK>
+EEF5 929B EEF5 <CJK>
+EEF6 925A EEF6 <CJK>
+EEF7 92CF EEF7 <CJK>
+EEF8 92B9 EEF8 <CJK>
+EEF9 92B7 EEF9 <CJK>
+EEFA 92E9 EEFA <CJK>
+EEFB 930F EEFB <CJK>
+EEFC 92FA EEFC <CJK>
+EEFD 9344 EEFD <CJK>
+EEFE 932E EEFE <CJK>
+EFA1 9319 EFA1 <CJK>
+EFA2 9322 EFA2 <CJK>
+EFA3 931A EFA3 <CJK>
+EFA4 9323 EFA4 <CJK>
+EFA5 933A EFA5 <CJK>
+EFA6 9335 EFA6 <CJK>
+EFA7 933B EFA7 <CJK>
+EFA8 935C EFA8 <CJK>
+EFA9 9360 EFA9 <CJK>
+EFAA 937C EFAA <CJK>
+EFAB 936E EFAB <CJK>
+EFAC 9356 EFAC <CJK>
+EFAD 93B0 EFAD <CJK>
+EFAE 93AC EFAE <CJK>
+EFAF 93AD EFAF <CJK>
+EFB0 9394 EFB0 <CJK>
+EFB1 93B9 EFB1 <CJK>
+EFB2 93D6 EFB2 <CJK>
+EFB3 93D7 EFB3 <CJK>
+EFB4 93E8 EFB4 <CJK>
+EFB5 93E5 EFB5 <CJK>
+EFB6 93D8 EFB6 <CJK>
+EFB7 93C3 EFB7 <CJK>
+EFB8 93DD EFB8 <CJK>
+EFB9 93D0 EFB9 <CJK>
+EFBA 93C8 EFBA <CJK>
+EFBB 93E4 EFBB <CJK>
+EFBC 941A EFBC <CJK>
+EFBD 9414 EFBD <CJK>
+EFBE 9413 EFBE <CJK>
+EFBF 9403 EFBF <CJK>
+EFC0 9407 EFC0 <CJK>
+EFC1 9410 EFC1 <CJK>
+EFC2 9436 EFC2 <CJK>
+EFC3 942B EFC3 <CJK>
+EFC4 9435 EFC4 <CJK>
+EFC5 9421 EFC5 <CJK>
+EFC6 943A EFC6 <CJK>
+EFC7 9441 EFC7 <CJK>
+EFC8 9452 EFC8 <CJK>
+EFC9 9444 EFC9 <CJK>
+EFCA 945B EFCA <CJK>
+EFCB 9460 EFCB <CJK>
+EFCC 9462 EFCC <CJK>
+EFCD 945E EFCD <CJK>
+EFCE 946A EFCE <CJK>
+EFCF 9229 EFCF <CJK>
+EFD0 9470 EFD0 <CJK>
+EFD1 9475 EFD1 <CJK>
+EFD2 9477 EFD2 <CJK>
+EFD3 947D EFD3 <CJK>
+EFD4 945A EFD4 <CJK>
+EFD5 947C EFD5 <CJK>
+EFD6 947E EFD6 <CJK>
+EFD7 9481 EFD7 <CJK>
+EFD8 947F EFD8 <CJK>
+EFD9 9582 EFD9 <CJK>
+EFDA 9587 EFDA <CJK>
+EFDB 958A EFDB <CJK>
+EFDC 9594 EFDC <CJK>
+EFDD 9596 EFDD <CJK>
+EFDE 9598 EFDE <CJK>
+EFDF 9599 EFDF <CJK>
+EFE0 95A0 EFE0 <CJK>
+EFE1 95A8 EFE1 <CJK>
+EFE2 95A7 EFE2 <CJK>
+EFE3 95AD EFE3 <CJK>
+EFE4 95BC EFE4 <CJK>
+EFE5 95BB EFE5 <CJK>
+EFE6 95B9 EFE6 <CJK>
+EFE7 95BE EFE7 <CJK>
+EFE8 95CA EFE8 <CJK>
+EFE9 6FF6 EFE9 <CJK>
+EFEA 95C3 EFEA <CJK>
+EFEB 95CD EFEB <CJK>
+EFEC 95CC EFEC <CJK>
+EFED 95D5 EFED <CJK>
+EFEE 95D4 EFEE <CJK>
+EFEF 95D6 EFEF <CJK>
+EFF0 95DC EFF0 <CJK>
+EFF1 95E1 EFF1 <CJK>
+EFF2 95E5 EFF2 <CJK>
+EFF3 95E2 EFF3 <CJK>
+EFF4 9621 EFF4 <CJK>
+EFF5 9628 EFF5 <CJK>
+EFF6 962E EFF6 <CJK>
+EFF7 962F EFF7 <CJK>
+EFF8 9642 EFF8 <CJK>
+EFF9 964C EFF9 <CJK>
+EFFA 964F EFFA <CJK>
+EFFB 964B EFFB <CJK>
+EFFC 9677 EFFC <CJK>
+EFFD 965C EFFD <CJK>
+EFFE 965E EFFE <CJK>
+F0A1 965D F0A1 <CJK>
+F0A2 965F F0A2 <CJK>
+F0A3 9666 F0A3 <CJK>
+F0A4 9672 F0A4 <CJK>
+F0A5 966C F0A5 <CJK>
+F0A6 968D F0A6 <CJK>
+F0A7 9698 F0A7 <CJK>
+F0A8 9695 F0A8 <CJK>
+F0A9 9697 F0A9 <CJK>
+F0AA 96AA F0AA <CJK>
+F0AB 96A7 F0AB <CJK>
+F0AC 96B1 F0AC <CJK>
+F0AD 96B2 F0AD <CJK>
+F0AE 96B0 F0AE <CJK>
+F0AF 96B4 F0AF <CJK>
+F0B0 96B6 F0B0 <CJK>
+F0B1 96B8 F0B1 <CJK>
+F0B2 96B9 F0B2 <CJK>
+F0B3 96CE F0B3 <CJK>
+F0B4 96CB F0B4 <CJK>
+F0B5 96C9 F0B5 <CJK>
+F0B6 96CD F0B6 <CJK>
+F0B7 894D F0B7 <CJK>
+F0B8 96DC F0B8 <CJK>
+F0B9 970D F0B9 <CJK>
+F0BA 96D5 F0BA <CJK>
+F0BB 96F9 F0BB <CJK>
+F0BC 9704 F0BC <CJK>
+F0BD 9706 F0BD <CJK>
+F0BE 9708 F0BE <CJK>
+F0BF 9713 F0BF <CJK>
+F0C0 970E F0C0 <CJK>
+F0C1 9711 F0C1 <CJK>
+F0C2 970F F0C2 <CJK>
+F0C3 9716 F0C3 <CJK>
+F0C4 9719 F0C4 <CJK>
+F0C5 9724 F0C5 <CJK>
+F0C6 972A F0C6 <CJK>
+F0C7 9730 F0C7 <CJK>
+F0C8 9739 F0C8 <CJK>
+F0C9 973D F0C9 <CJK>
+F0CA 973E F0CA <CJK>
+F0CB 9744 F0CB <CJK>
+F0CC 9746 F0CC <CJK>
+F0CD 9748 F0CD <CJK>
+F0CE 9742 F0CE <CJK>
+F0CF 9749 F0CF <CJK>
+F0D0 975C F0D0 <CJK>
+F0D1 9760 F0D1 <CJK>
+F0D2 9764 F0D2 <CJK>
+F0D3 9766 F0D3 <CJK>
+F0D4 9768 F0D4 <CJK>
+F0D5 52D2 F0D5 <CJK>
+F0D6 976B F0D6 <CJK>
+F0D7 9771 F0D7 <CJK>
+F0D8 9779 F0D8 <CJK>
+F0D9 9785 F0D9 <CJK>
+F0DA 977C F0DA <CJK>
+F0DB 9781 F0DB <CJK>
+F0DC 977A F0DC <CJK>
+F0DD 9786 F0DD <CJK>
+F0DE 978B F0DE <CJK>
+F0DF 978F F0DF <CJK>
+F0E0 9790 F0E0 <CJK>
+F0E1 979C F0E1 <CJK>
+F0E2 97A8 F0E2 <CJK>
+F0E3 97A6 F0E3 <CJK>
+F0E4 97A3 F0E4 <CJK>
+F0E5 97B3 F0E5 <CJK>
+F0E6 97B4 F0E6 <CJK>
+F0E7 97C3 F0E7 <CJK>
+F0E8 97C6 F0E8 <CJK>
+F0E9 97C8 F0E9 <CJK>
+F0EA 97CB F0EA <CJK>
+F0EB 97DC F0EB <CJK>
+F0EC 97ED F0EC <CJK>
+F0ED 9F4F F0ED <CJK>
+F0EE 97F2 F0EE <CJK>
+F0EF 7ADF F0EF <CJK>
+F0F0 97F6 F0F0 <CJK>
+F0F1 97F5 F0F1 <CJK>
+F0F2 980F F0F2 <CJK>
+F0F3 980C F0F3 <CJK>
+F0F4 9838 F0F4 <CJK>
+F0F5 9824 F0F5 <CJK>
+F0F6 9821 F0F6 <CJK>
+F0F7 9837 F0F7 <CJK>
+F0F8 983D F0F8 <CJK>
+F0F9 9846 F0F9 <CJK>
+F0FA 984F F0FA <CJK>
+F0FB 984B F0FB <CJK>
+F0FC 986B F0FC <CJK>
+F0FD 986F F0FD <CJK>
+F0FE 9870 F0FE <CJK>
+F1A1 9871 F1A1 <CJK>
+F1A2 9874 F1A2 <CJK>
+F1A3 9873 F1A3 <CJK>
+F1A4 98AA F1A4 <CJK>
+F1A5 98AF F1A5 <CJK>
+F1A6 98B1 F1A6 <CJK>
+F1A7 98B6 F1A7 <CJK>
+F1A8 98C4 F1A8 <CJK>
+F1A9 98C3 F1A9 <CJK>
+F1AA 98C6 F1AA <CJK>
+F1AB 98E9 F1AB <CJK>
+F1AC 98EB F1AC <CJK>
+F1AD 9903 F1AD <CJK>
+F1AE 9909 F1AE <CJK>
+F1AF 9912 F1AF <CJK>
+F1B0 9914 F1B0 <CJK>
+F1B1 9918 F1B1 <CJK>
+F1B2 9921 F1B2 <CJK>
+F1B3 991D F1B3 <CJK>
+F1B4 991E F1B4 <CJK>
+F1B5 9924 F1B5 <CJK>
+F1B6 9920 F1B6 <CJK>
+F1B7 992C F1B7 <CJK>
+F1B8 992E F1B8 <CJK>
+F1B9 993D F1B9 <CJK>
+F1BA 993E F1BA <CJK>
+F1BB 9942 F1BB <CJK>
+F1BC 9949 F1BC <CJK>
+F1BD 9945 F1BD <CJK>
+F1BE 9950 F1BE <CJK>
+F1BF 994B F1BF <CJK>
+F1C0 9951 F1C0 <CJK>
+F1C1 9952 F1C1 <CJK>
+F1C2 994C F1C2 <CJK>
+F1C3 9955 F1C3 <CJK>
+F1C4 9997 F1C4 <CJK>
+F1C5 9998 F1C5 <CJK>
+F1C6 99A5 F1C6 <CJK>
+F1C7 99AD F1C7 <CJK>
+F1C8 99AE F1C8 <CJK>
+F1C9 99BC F1C9 <CJK>
+F1CA 99DF F1CA <CJK>
+F1CB 99DB F1CB <CJK>
+F1CC 99DD F1CC <CJK>
+F1CD 99D8 F1CD <CJK>
+F1CE 99D1 F1CE <CJK>
+F1CF 99ED F1CF <CJK>
+F1D0 99EE F1D0 <CJK>
+F1D1 99F1 F1D1 <CJK>
+F1D2 99F2 F1D2 <CJK>
+F1D3 99FB F1D3 <CJK>
+F1D4 99F8 F1D4 <CJK>
+F1D5 9A01 F1D5 <CJK>
+F1D6 9A0F F1D6 <CJK>
+F1D7 9A05 F1D7 <CJK>
+F1D8 99E2 F1D8 <CJK>
+F1D9 9A19 F1D9 <CJK>
+F1DA 9A2B F1DA <CJK>
+F1DB 9A37 F1DB <CJK>
+F1DC 9A45 F1DC <CJK>
+F1DD 9A42 F1DD <CJK>
+F1DE 9A40 F1DE <CJK>
+F1DF 9A43 F1DF <CJK>
+F1E0 9A3E F1E0 <CJK>
+F1E1 9A55 F1E1 <CJK>
+F1E2 9A4D F1E2 <CJK>
+F1E3 9A5B F1E3 <CJK>
+F1E4 9A57 F1E4 <CJK>
+F1E5 9A5F F1E5 <CJK>
+F1E6 9A62 F1E6 <CJK>
+F1E7 9A65 F1E7 <CJK>
+F1E8 9A64 F1E8 <CJK>
+F1E9 9A69 F1E9 <CJK>
+F1EA 9A6B F1EA <CJK>
+F1EB 9A6A F1EB <CJK>
+F1EC 9AAD F1EC <CJK>
+F1ED 9AB0 F1ED <CJK>
+F1EE 9ABC F1EE <CJK>
+F1EF 9AC0 F1EF <CJK>
+F1F0 9ACF F1F0 <CJK>
+F1F1 9AD1 F1F1 <CJK>
+F1F2 9AD3 F1F2 <CJK>
+F1F3 9AD4 F1F3 <CJK>
+F1F4 9ADE F1F4 <CJK>
+F1F5 9ADF F1F5 <CJK>
+F1F6 9AE2 F1F6 <CJK>
+F1F7 9AE3 F1F7 <CJK>
+F1F8 9AE6 F1F8 <CJK>
+F1F9 9AEF F1F9 <CJK>
+F1FA 9AEB F1FA <CJK>
+F1FB 9AEE F1FB <CJK>
+F1FC 9AF4 F1FC <CJK>
+F1FD 9AF1 F1FD <CJK>
+F1FE 9AF7 F1FE <CJK>
+F2A1 9AFB F2A1 <CJK>
+F2A2 9B06 F2A2 <CJK>
+F2A3 9B18 F2A3 <CJK>
+F2A4 9B1A F2A4 <CJK>
+F2A5 9B1F F2A5 <CJK>
+F2A6 9B22 F2A6 <CJK>
+F2A7 9B23 F2A7 <CJK>
+F2A8 9B25 F2A8 <CJK>
+F2A9 9B27 F2A9 <CJK>
+F2AA 9B28 F2AA <CJK>
+F2AB 9B29 F2AB <CJK>
+F2AC 9B2A F2AC <CJK>
+F2AD 9B2E F2AD <CJK>
+F2AE 9B2F F2AE <CJK>
+F2AF 9B32 F2AF <CJK>
+F2B0 9B44 F2B0 <CJK>
+F2B1 9B43 F2B1 <CJK>
+F2B2 9B4F F2B2 <CJK>
+F2B3 9B4D F2B3 <CJK>
+F2B4 9B4E F2B4 <CJK>
+F2B5 9B51 F2B5 <CJK>
+F2B6 9B58 F2B6 <CJK>
+F2B7 9B74 F2B7 <CJK>
+F2B8 9B93 F2B8 <CJK>
+F2B9 9B83 F2B9 <CJK>
+F2BA 9B91 F2BA <CJK>
+F2BB 9B96 F2BB <CJK>
+F2BC 9B97 F2BC <CJK>
+F2BD 9B9F F2BD <CJK>
+F2BE 9BA0 F2BE <CJK>
+F2BF 9BA8 F2BF <CJK>
+F2C0 9BB4 F2C0 <CJK>
+F2C1 9BC0 F2C1 <CJK>
+F2C2 9BCA F2C2 <CJK>
+F2C3 9BB9 F2C3 <CJK>
+F2C4 9BC6 F2C4 <CJK>
+F2C5 9BCF F2C5 <CJK>
+F2C6 9BD1 F2C6 <CJK>
+F2C7 9BD2 F2C7 <CJK>
+F2C8 9BE3 F2C8 <CJK>
+F2C9 9BE2 F2C9 <CJK>
+F2CA 9BE4 F2CA <CJK>
+F2CB 9BD4 F2CB <CJK>
+F2CC 9BE1 F2CC <CJK>
+F2CD 9C3A F2CD <CJK>
+F2CE 9BF2 F2CE <CJK>
+F2CF 9BF1 F2CF <CJK>
+F2D0 9BF0 F2D0 <CJK>
+F2D1 9C15 F2D1 <CJK>
+F2D2 9C14 F2D2 <CJK>
+F2D3 9C09 F2D3 <CJK>
+F2D4 9C13 F2D4 <CJK>
+F2D5 9C0C F2D5 <CJK>
+F2D6 9C06 F2D6 <CJK>
+F2D7 9C08 F2D7 <CJK>
+F2D8 9C12 F2D8 <CJK>
+F2D9 9C0A F2D9 <CJK>
+F2DA 9C04 F2DA <CJK>
+F2DB 9C2E F2DB <CJK>
+F2DC 9C1B F2DC <CJK>
+F2DD 9C25 F2DD <CJK>
+F2DE 9C24 F2DE <CJK>
+F2DF 9C21 F2DF <CJK>
+F2E0 9C30 F2E0 <CJK>
+F2E1 9C47 F2E1 <CJK>
+F2E2 9C32 F2E2 <CJK>
+F2E3 9C46 F2E3 <CJK>
+F2E4 9C3E F2E4 <CJK>
+F2E5 9C5A F2E5 <CJK>
+F2E6 9C60 F2E6 <CJK>
+F2E7 9C67 F2E7 <CJK>
+F2E8 9C76 F2E8 <CJK>
+F2E9 9C78 F2E9 <CJK>
+F2EA 9CE7 F2EA <CJK>
+F2EB 9CEC F2EB <CJK>
+F2EC 9CF0 F2EC <CJK>
+F2ED 9D09 F2ED <CJK>
+F2EE 9D08 F2EE <CJK>
+F2EF 9CEB F2EF <CJK>
+F2F0 9D03 F2F0 <CJK>
+F2F1 9D06 F2F1 <CJK>
+F2F2 9D2A F2F2 <CJK>
+F2F3 9D26 F2F3 <CJK>
+F2F4 9DAF F2F4 <CJK>
+F2F5 9D23 F2F5 <CJK>
+F2F6 9D1F F2F6 <CJK>
+F2F7 9D44 F2F7 <CJK>
+F2F8 9D15 F2F8 <CJK>
+F2F9 9D12 F2F9 <CJK>
+F2FA 9D41 F2FA <CJK>
+F2FB 9D3F F2FB <CJK>
+F2FC 9D3E F2FC <CJK>
+F2FD 9D46 F2FD <CJK>
+F2FE 9D48 F2FE <CJK>
+F3A1 9D5D F3A1 <CJK>
+F3A2 9D5E F3A2 <CJK>
+F3A3 9D64 F3A3 <CJK>
+F3A4 9D51 F3A4 <CJK>
+F3A5 9D50 F3A5 <CJK>
+F3A6 9D59 F3A6 <CJK>
+F3A7 9D72 F3A7 <CJK>
+F3A8 9D89 F3A8 <CJK>
+F3A9 9D87 F3A9 <CJK>
+F3AA 9DAB F3AA <CJK>
+F3AB 9D6F F3AB <CJK>
+F3AC 9D7A F3AC <CJK>
+F3AD 9D9A F3AD <CJK>
+F3AE 9DA4 F3AE <CJK>
+F3AF 9DA9 F3AF <CJK>
+F3B0 9DB2 F3B0 <CJK>
+F3B1 9DC4 F3B1 <CJK>
+F3B2 9DC1 F3B2 <CJK>
+F3B3 9DBB F3B3 <CJK>
+F3B4 9DB8 F3B4 <CJK>
+F3B5 9DBA F3B5 <CJK>
+F3B6 9DC6 F3B6 <CJK>
+F3B7 9DCF F3B7 <CJK>
+F3B8 9DC2 F3B8 <CJK>
+F3B9 9DD9 F3B9 <CJK>
+F3BA 9DD3 F3BA <CJK>
+F3BB 9DF8 F3BB <CJK>
+F3BC 9DE6 F3BC <CJK>
+F3BD 9DED F3BD <CJK>
+F3BE 9DEF F3BE <CJK>
+F3BF 9DFD F3BF <CJK>
+F3C0 9E1A F3C0 <CJK>
+F3C1 9E1B F3C1 <CJK>
+F3C2 9E1E F3C2 <CJK>
+F3C3 9E75 F3C3 <CJK>
+F3C4 9E79 F3C4 <CJK>
+F3C5 9E7D F3C5 <CJK>
+F3C6 9E81 F3C6 <CJK>
+F3C7 9E88 F3C7 <CJK>
+F3C8 9E8B F3C8 <CJK>
+F3C9 9E8C F3C9 <CJK>
+F3CA 9E92 F3CA <CJK>
+F3CB 9E95 F3CB <CJK>
+F3CC 9E91 F3CC <CJK>
+F3CD 9E9D F3CD <CJK>
+F3CE 9EA5 F3CE <CJK>
+F3CF 9EA9 F3CF <CJK>
+F3D0 9EB8 F3D0 <CJK>
+F3D1 9EAA F3D1 <CJK>
+F3D2 9EAD F3D2 <CJK>
+F3D3 9761 F3D3 <CJK>
+F3D4 9ECC F3D4 <CJK>
+F3D5 9ECE F3D5 <CJK>
+F3D6 9ECF F3D6 <CJK>
+F3D7 9ED0 F3D7 <CJK>
+F3D8 9ED4 F3D8 <CJK>
+F3D9 9EDC F3D9 <CJK>
+F3DA 9EDE F3DA <CJK>
+F3DB 9EDD F3DB <CJK>
+F3DC 9EE0 F3DC <CJK>
+F3DD 9EE5 F3DD <CJK>
+F3DE 9EE8 F3DE <CJK>
+F3DF 9EEF F3DF <CJK>
+F3E0 9EF4 F3E0 <CJK>
+F3E1 9EF6 F3E1 <CJK>
+F3E2 9EF7 F3E2 <CJK>
+F3E3 9EF9 F3E3 <CJK>
+F3E4 9EFB F3E4 <CJK>
+F3E5 9EFC F3E5 <CJK>
+F3E6 9EFD F3E6 <CJK>
+F3E7 9F07 F3E7 <CJK>
+F3E8 9F08 F3E8 <CJK>
+F3E9 76B7 F3E9 <CJK>
+F3EA 9F15 F3EA <CJK>
+F3EB 9F21 F3EB <CJK>
+F3EC 9F2C F3EC <CJK>
+F3ED 9F3E F3ED <CJK>
+F3EE 9F4A F3EE <CJK>
+F3EF 9F52 F3EF <CJK>
+F3F0 9F54 F3F0 <CJK>
+F3F1 9F63 F3F1 <CJK>
+F3F2 9F5F F3F2 <CJK>
+F3F3 9F60 F3F3 <CJK>
+F3F4 9F61 F3F4 <CJK>
+F3F5 9F66 F3F5 <CJK>
+F3F6 9F67 F3F6 <CJK>
+F3F7 9F6C F3F7 <CJK>
+F3F8 9F6A F3F8 <CJK>
+F3F9 9F77 F3F9 <CJK>
+F3FA 9F72 F3FA <CJK>
+F3FB 9F76 F3FB <CJK>
+F3FC 9F95 F3FC <CJK>
+F3FD 9F9C F3FD <CJK>
+F3FE 9FA0 F3FE <CJK>
+F4A1 582F F4A1 U+582F <CJK>
+F4A2 69C7 F4A2 U+69C7 <CJK>
+F4A3 9059 F4A3 U+9059 <CJK>
+F4A4 7464 F4A4 U+7464 <CJK>
+F4A5 51DC F4A5 U+51DC <CJK>
+F4A6 7199 F4A6 U+7199 <CJK>
+F5A1 E000 F5A1 User defined range #1
+F5A2 E001 F5A2 User defined range #1
+F5A3 E002 F5A3 User defined range #1
+F5A4 E003 F5A4 User defined range #1
+F5A5 E004 F5A5 User defined range #1
+F5A6 E005 F5A6 User defined range #1
+F5A7 E006 F5A7 User defined range #1
+F5A8 E007 F5A8 User defined range #1
+F5A9 E008 F5A9 User defined range #1
+F5AA E009 F5AA User defined range #1
+F5AB E00A F5AB User defined range #1
+F5AC E00B F5AC User defined range #1
+F5AD E00C F5AD User defined range #1
+F5AE E00D F5AE User defined range #1
+F5AF E00E F5AF User defined range #1
+F5B0 E00F F5B0 User defined range #1
+F5B1 E010 F5B1 User defined range #1
+F5B2 E011 F5B2 User defined range #1
+F5B3 E012 F5B3 User defined range #1
+F5B4 E013 F5B4 User defined range #1
+F5B5 E014 F5B5 User defined range #1
+F5B6 E015 F5B6 User defined range #1
+F5B7 E016 F5B7 User defined range #1
+F5B8 E017 F5B8 User defined range #1
+F5B9 E018 F5B9 User defined range #1
+F5BA E019 F5BA User defined range #1
+F5BB E01A F5BB User defined range #1
+F5BC E01B F5BC User defined range #1
+F5BD E01C F5BD User defined range #1
+F5BE E01D F5BE User defined range #1
+F5BF E01E F5BF User defined range #1
+F5C0 E01F F5C0 User defined range #1
+F5C1 E020 F5C1 User defined range #1
+F5C2 E021 F5C2 User defined range #1
+F5C3 E022 F5C3 User defined range #1
+F5C4 E023 F5C4 User defined range #1
+F5C5 E024 F5C5 User defined range #1
+F5C6 E025 F5C6 User defined range #1
+F5C7 E026 F5C7 User defined range #1
+F5C8 E027 F5C8 User defined range #1
+F5C9 E028 F5C9 User defined range #1
+F5CA E029 F5CA User defined range #1
+F5CB E02A F5CB User defined range #1
+F5CC E02B F5CC User defined range #1
+F5CD E02C F5CD User defined range #1
+F5CE E02D F5CE User defined range #1
+F5CF E02E F5CF User defined range #1
+F5D0 E02F F5D0 User defined range #1
+F5D1 E030 F5D1 User defined range #1
+F5D2 E031 F5D2 User defined range #1
+F5D3 E032 F5D3 User defined range #1
+F5D4 E033 F5D4 User defined range #1
+F5D5 E034 F5D5 User defined range #1
+F5D6 E035 F5D6 User defined range #1
+F5D7 E036 F5D7 User defined range #1
+F5D8 E037 F5D8 User defined range #1
+F5D9 E038 F5D9 User defined range #1
+F5DA E039 F5DA User defined range #1
+F5DB E03A F5DB User defined range #1
+F5DC E03B F5DC User defined range #1
+F5DD E03C F5DD User defined range #1
+F5DE E03D F5DE User defined range #1
+F5DF E03E F5DF User defined range #1
+F5E0 E03F F5E0 User defined range #1
+F5E1 E040 F5E1 User defined range #1
+F5E2 E041 F5E2 User defined range #1
+F5E3 E042 F5E3 User defined range #1
+F5E4 E043 F5E4 User defined range #1
+F5E5 E044 F5E5 User defined range #1
+F5E6 E045 F5E6 User defined range #1
+F5E7 E046 F5E7 User defined range #1
+F5E8 E047 F5E8 User defined range #1
+F5E9 E048 F5E9 User defined range #1
+F5EA E049 F5EA User defined range #1
+F5EB E04A F5EB User defined range #1
+F5EC E04B F5EC User defined range #1
+F5ED E04C F5ED User defined range #1
+F5EE E04D F5EE User defined range #1
+F5EF E04E F5EF User defined range #1
+F5F0 E04F F5F0 User defined range #1
+F5F1 E050 F5F1 User defined range #1
+F5F2 E051 F5F2 User defined range #1
+F5F3 E052 F5F3 User defined range #1
+F5F4 E053 F5F4 User defined range #1
+F5F5 E054 F5F5 User defined range #1
+F5F6 E055 F5F6 User defined range #1
+F5F7 E056 F5F7 User defined range #1
+F5F8 E057 F5F8 User defined range #1
+F5F9 E058 F5F9 User defined range #1
+F5FA E059 F5FA User defined range #1
+F5FB E05A F5FB User defined range #1
+F5FC E05B F5FC User defined range #1
+F5FD E05C F5FD User defined range #1
+F5FE E05D F5FE User defined range #1
+F6A1 E05E F6A1 User defined range #1
+F6A2 E05F F6A2 User defined range #1
+F6A3 E060 F6A3 User defined range #1
+F6A4 E061 F6A4 User defined range #1
+F6A5 E062 F6A5 User defined range #1
+F6A6 E063 F6A6 User defined range #1
+F6A7 E064 F6A7 User defined range #1
+F6A8 E065 F6A8 User defined range #1
+F6A9 E066 F6A9 User defined range #1
+F6AA E067 F6AA User defined range #1
+F6AB E068 F6AB User defined range #1
+F6AC E069 F6AC User defined range #1
+F6AD E06A F6AD User defined range #1
+F6AE E06B F6AE User defined range #1
+F6AF E06C F6AF User defined range #1
+F6B0 E06D F6B0 User defined range #1
+F6B1 E06E F6B1 User defined range #1
+F6B2 E06F F6B2 User defined range #1
+F6B3 E070 F6B3 User defined range #1
+F6B4 E071 F6B4 User defined range #1
+F6B5 E072 F6B5 User defined range #1
+F6B6 E073 F6B6 User defined range #1
+F6B7 E074 F6B7 User defined range #1
+F6B8 E075 F6B8 User defined range #1
+F6B9 E076 F6B9 User defined range #1
+F6BA E077 F6BA User defined range #1
+F6BB E078 F6BB User defined range #1
+F6BC E079 F6BC User defined range #1
+F6BD E07A F6BD User defined range #1
+F6BE E07B F6BE User defined range #1
+F6BF E07C F6BF User defined range #1
+F6C0 E07D F6C0 User defined range #1
+F6C1 E07E F6C1 User defined range #1
+F6C2 E07F F6C2 User defined range #1
+F6C3 E080 F6C3 User defined range #1
+F6C4 E081 F6C4 User defined range #1
+F6C5 E082 F6C5 User defined range #1
+F6C6 E083 F6C6 User defined range #1
+F6C7 E084 F6C7 User defined range #1
+F6C8 E085 F6C8 User defined range #1
+F6C9 E086 F6C9 User defined range #1
+F6CA E087 F6CA User defined range #1
+F6CB E088 F6CB User defined range #1
+F6CC E089 F6CC User defined range #1
+F6CD E08A F6CD User defined range #1
+F6CE E08B F6CE User defined range #1
+F6CF E08C F6CF User defined range #1
+F6D0 E08D F6D0 User defined range #1
+F6D1 E08E F6D1 User defined range #1
+F6D2 E08F F6D2 User defined range #1
+F6D3 E090 F6D3 User defined range #1
+F6D4 E091 F6D4 User defined range #1
+F6D5 E092 F6D5 User defined range #1
+F6D6 E093 F6D6 User defined range #1
+F6D7 E094 F6D7 User defined range #1
+F6D8 E095 F6D8 User defined range #1
+F6D9 E096 F6D9 User defined range #1
+F6DA E097 F6DA User defined range #1
+F6DB E098 F6DB User defined range #1
+F6DC E099 F6DC User defined range #1
+F6DD E09A F6DD User defined range #1
+F6DE E09B F6DE User defined range #1
+F6DF E09C F6DF User defined range #1
+F6E0 E09D F6E0 User defined range #1
+F6E1 E09E F6E1 User defined range #1
+F6E2 E09F F6E2 User defined range #1
+F6E3 E0A0 F6E3 User defined range #1
+F6E4 E0A1 F6E4 User defined range #1
+F6E5 E0A2 F6E5 User defined range #1
+F6E6 E0A3 F6E6 User defined range #1
+F6E7 E0A4 F6E7 User defined range #1
+F6E8 E0A5 F6E8 User defined range #1
+F6E9 E0A6 F6E9 User defined range #1
+F6EA E0A7 F6EA User defined range #1
+F6EB E0A8 F6EB User defined range #1
+F6EC E0A9 F6EC User defined range #1
+F6ED E0AA F6ED User defined range #1
+F6EE E0AB F6EE User defined range #1
+F6EF E0AC F6EF User defined range #1
+F6F0 E0AD F6F0 User defined range #1
+F6F1 E0AE F6F1 User defined range #1
+F6F2 E0AF F6F2 User defined range #1
+F6F3 E0B0 F6F3 User defined range #1
+F6F4 E0B1 F6F4 User defined range #1
+F6F5 E0B2 F6F5 User defined range #1
+F6F6 E0B3 F6F6 User defined range #1
+F6F7 E0B4 F6F7 User defined range #1
+F6F8 E0B5 F6F8 User defined range #1
+F6F9 E0B6 F6F9 User defined range #1
+F6FA E0B7 F6FA User defined range #1
+F6FB E0B8 F6FB User defined range #1
+F6FC E0B9 F6FC User defined range #1
+F6FD E0BA F6FD User defined range #1
+F6FE E0BB F6FE User defined range #1
+F7A1 E0BC F7A1 User defined range #1
+F7A2 E0BD F7A2 User defined range #1
+F7A3 E0BE F7A3 User defined range #1
+F7A4 E0BF F7A4 User defined range #1
+F7A5 E0C0 F7A5 User defined range #1
+F7A6 E0C1 F7A6 User defined range #1
+F7A7 E0C2 F7A7 User defined range #1
+F7A8 E0C3 F7A8 User defined range #1
+F7A9 E0C4 F7A9 User defined range #1
+F7AA E0C5 F7AA User defined range #1
+F7AB E0C6 F7AB User defined range #1
+F7AC E0C7 F7AC User defined range #1
+F7AD E0C8 F7AD User defined range #1
+F7AE E0C9 F7AE User defined range #1
+F7AF E0CA F7AF User defined range #1
+F7B0 E0CB F7B0 User defined range #1
+F7B1 E0CC F7B1 User defined range #1
+F7B2 E0CD F7B2 User defined range #1
+F7B3 E0CE F7B3 User defined range #1
+F7B4 E0CF F7B4 User defined range #1
+F7B5 E0D0 F7B5 User defined range #1
+F7B6 E0D1 F7B6 User defined range #1
+F7B7 E0D2 F7B7 User defined range #1
+F7B8 E0D3 F7B8 User defined range #1
+F7B9 E0D4 F7B9 User defined range #1
+F7BA E0D5 F7BA User defined range #1
+F7BB E0D6 F7BB User defined range #1
+F7BC E0D7 F7BC User defined range #1
+F7BD E0D8 F7BD User defined range #1
+F7BE E0D9 F7BE User defined range #1
+F7BF E0DA F7BF User defined range #1
+F7C0 E0DB F7C0 User defined range #1
+F7C1 E0DC F7C1 User defined range #1
+F7C2 E0DD F7C2 User defined range #1
+F7C3 E0DE F7C3 User defined range #1
+F7C4 E0DF F7C4 User defined range #1
+F7C5 E0E0 F7C5 User defined range #1
+F7C6 E0E1 F7C6 User defined range #1
+F7C7 E0E2 F7C7 User defined range #1
+F7C8 E0E3 F7C8 User defined range #1
+F7C9 E0E4 F7C9 User defined range #1
+F7CA E0E5 F7CA User defined range #1
+F7CB E0E6 F7CB User defined range #1
+F7CC E0E7 F7CC User defined range #1
+F7CD E0E8 F7CD User defined range #1
+F7CE E0E9 F7CE User defined range #1
+F7CF E0EA F7CF User defined range #1
+F7D0 E0EB F7D0 User defined range #1
+F7D1 E0EC F7D1 User defined range #1
+F7D2 E0ED F7D2 User defined range #1
+F7D3 E0EE F7D3 User defined range #1
+F7D4 E0EF F7D4 User defined range #1
+F7D5 E0F0 F7D5 User defined range #1
+F7D6 E0F1 F7D6 User defined range #1
+F7D7 E0F2 F7D7 User defined range #1
+F7D8 E0F3 F7D8 User defined range #1
+F7D9 E0F4 F7D9 User defined range #1
+F7DA E0F5 F7DA User defined range #1
+F7DB E0F6 F7DB User defined range #1
+F7DC E0F7 F7DC User defined range #1
+F7DD E0F8 F7DD User defined range #1
+F7DE E0F9 F7DE User defined range #1
+F7DF E0FA F7DF User defined range #1
+F7E0 E0FB F7E0 User defined range #1
+F7E1 E0FC F7E1 User defined range #1
+F7E2 E0FD F7E2 User defined range #1
+F7E3 E0FE F7E3 User defined range #1
+F7E4 E0FF F7E4 User defined range #1
+F7E5 E100 F7E5 User defined range #1
+F7E6 E101 F7E6 User defined range #1
+F7E7 E102 F7E7 User defined range #1
+F7E8 E103 F7E8 User defined range #1
+F7E9 E104 F7E9 User defined range #1
+F7EA E105 F7EA User defined range #1
+F7EB E106 F7EB User defined range #1
+F7EC E107 F7EC User defined range #1
+F7ED E108 F7ED User defined range #1
+F7EE E109 F7EE User defined range #1
+F7EF E10A F7EF User defined range #1
+F7F0 E10B F7F0 User defined range #1
+F7F1 E10C F7F1 User defined range #1
+F7F2 E10D F7F2 User defined range #1
+F7F3 E10E F7F3 User defined range #1
+F7F4 E10F F7F4 User defined range #1
+F7F5 E110 F7F5 User defined range #1
+F7F6 E111 F7F6 User defined range #1
+F7F7 E112 F7F7 User defined range #1
+F7F8 E113 F7F8 User defined range #1
+F7F9 E114 F7F9 User defined range #1
+F7FA E115 F7FA User defined range #1
+F7FB E116 F7FB User defined range #1
+F7FC E117 F7FC User defined range #1
+F7FD E118 F7FD User defined range #1
+F7FE E119 F7FE User defined range #1
+F8A1 E11A F8A1 User defined range #1
+F8A2 E11B F8A2 User defined range #1
+F8A3 E11C F8A3 User defined range #1
+F8A4 E11D F8A4 User defined range #1
+F8A5 E11E F8A5 User defined range #1
+F8A6 E11F F8A6 User defined range #1
+F8A7 E120 F8A7 User defined range #1
+F8A8 E121 F8A8 User defined range #1
+F8A9 E122 F8A9 User defined range #1
+F8AA E123 F8AA User defined range #1
+F8AB E124 F8AB User defined range #1
+F8AC E125 F8AC User defined range #1
+F8AD E126 F8AD User defined range #1
+F8AE E127 F8AE User defined range #1
+F8AF E128 F8AF User defined range #1
+F8B0 E129 F8B0 User defined range #1
+F8B1 E12A F8B1 User defined range #1
+F8B2 E12B F8B2 User defined range #1
+F8B3 E12C F8B3 User defined range #1
+F8B4 E12D F8B4 User defined range #1
+F8B5 E12E F8B5 User defined range #1
+F8B6 E12F F8B6 User defined range #1
+F8B7 E130 F8B7 User defined range #1
+F8B8 E131 F8B8 User defined range #1
+F8B9 E132 F8B9 User defined range #1
+F8BA E133 F8BA User defined range #1
+F8BB E134 F8BB User defined range #1
+F8BC E135 F8BC User defined range #1
+F8BD E136 F8BD User defined range #1
+F8BE E137 F8BE User defined range #1
+F8BF E138 F8BF User defined range #1
+F8C0 E139 F8C0 User defined range #1
+F8C1 E13A F8C1 User defined range #1
+F8C2 E13B F8C2 User defined range #1
+F8C3 E13C F8C3 User defined range #1
+F8C4 E13D F8C4 User defined range #1
+F8C5 E13E F8C5 User defined range #1
+F8C6 E13F F8C6 User defined range #1
+F8C7 E140 F8C7 User defined range #1
+F8C8 E141 F8C8 User defined range #1
+F8C9 E142 F8C9 User defined range #1
+F8CA E143 F8CA User defined range #1
+F8CB E144 F8CB User defined range #1
+F8CC E145 F8CC User defined range #1
+F8CD E146 F8CD User defined range #1
+F8CE E147 F8CE User defined range #1
+F8CF E148 F8CF User defined range #1
+F8D0 E149 F8D0 User defined range #1
+F8D1 E14A F8D1 User defined range #1
+F8D2 E14B F8D2 User defined range #1
+F8D3 E14C F8D3 User defined range #1
+F8D4 E14D F8D4 User defined range #1
+F8D5 E14E F8D5 User defined range #1
+F8D6 E14F F8D6 User defined range #1
+F8D7 E150 F8D7 User defined range #1
+F8D8 E151 F8D8 User defined range #1
+F8D9 E152 F8D9 User defined range #1
+F8DA E153 F8DA User defined range #1
+F8DB E154 F8DB User defined range #1
+F8DC E155 F8DC User defined range #1
+F8DD E156 F8DD User defined range #1
+F8DE E157 F8DE User defined range #1
+F8DF E158 F8DF User defined range #1
+F8E0 E159 F8E0 User defined range #1
+F8E1 E15A F8E1 User defined range #1
+F8E2 E15B F8E2 User defined range #1
+F8E3 E15C F8E3 User defined range #1
+F8E4 E15D F8E4 User defined range #1
+F8E5 E15E F8E5 User defined range #1
+F8E6 E15F F8E6 User defined range #1
+F8E7 E160 F8E7 User defined range #1
+F8E8 E161 F8E8 User defined range #1
+F8E9 E162 F8E9 User defined range #1
+F8EA E163 F8EA User defined range #1
+F8EB E164 F8EB User defined range #1
+F8EC E165 F8EC User defined range #1
+F8ED E166 F8ED User defined range #1
+F8EE E167 F8EE User defined range #1
+F8EF E168 F8EF User defined range #1
+F8F0 E169 F8F0 User defined range #1
+F8F1 E16A F8F1 User defined range #1
+F8F2 E16B F8F2 User defined range #1
+F8F3 E16C F8F3 User defined range #1
+F8F4 E16D F8F4 User defined range #1
+F8F5 E16E F8F5 User defined range #1
+F8F6 E16F F8F6 User defined range #1
+F8F7 E170 F8F7 User defined range #1
+F8F8 E171 F8F8 User defined range #1
+F8F9 E172 F8F9 User defined range #1
+F8FA E173 F8FA User defined range #1
+F8FB E174 F8FB User defined range #1
+F8FC E175 F8FC User defined range #1
+F8FD E176 F8FD User defined range #1
+F8FE E177 F8FE User defined range #1
+F9A1 E178 F9A1 User defined range #1
+F9A2 E179 F9A2 User defined range #1
+F9A3 E17A F9A3 User defined range #1
+F9A4 E17B F9A4 User defined range #1
+F9A5 E17C F9A5 User defined range #1
+F9A6 E17D F9A6 User defined range #1
+F9A7 E17E F9A7 User defined range #1
+F9A8 E17F F9A8 User defined range #1
+F9A9 E180 F9A9 User defined range #1
+F9AA E181 F9AA User defined range #1
+F9AB E182 F9AB User defined range #1
+F9AC E183 F9AC User defined range #1
+F9AD E184 F9AD User defined range #1
+F9AE E185 F9AE User defined range #1
+F9AF E186 F9AF User defined range #1
+F9B0 E187 F9B0 User defined range #1
+F9B1 E188 F9B1 User defined range #1
+F9B2 E189 F9B2 User defined range #1
+F9B3 E18A F9B3 User defined range #1
+F9B4 E18B F9B4 User defined range #1
+F9B5 E18C F9B5 User defined range #1
+F9B6 E18D F9B6 User defined range #1
+F9B7 E18E F9B7 User defined range #1
+F9B8 E18F F9B8 User defined range #1
+F9B9 E190 F9B9 User defined range #1
+F9BA E191 F9BA User defined range #1
+F9BB E192 F9BB User defined range #1
+F9BC E193 F9BC User defined range #1
+F9BD E194 F9BD User defined range #1
+F9BE E195 F9BE User defined range #1
+F9BF E196 F9BF User defined range #1
+F9C0 E197 F9C0 User defined range #1
+F9C1 E198 F9C1 User defined range #1
+F9C2 E199 F9C2 User defined range #1
+F9C3 E19A F9C3 User defined range #1
+F9C4 E19B F9C4 User defined range #1
+F9C5 E19C F9C5 User defined range #1
+F9C6 E19D F9C6 User defined range #1
+F9C7 E19E F9C7 User defined range #1
+F9C8 E19F F9C8 User defined range #1
+F9C9 E1A0 F9C9 User defined range #1
+F9CA E1A1 F9CA User defined range #1
+F9CB E1A2 F9CB User defined range #1
+F9CC E1A3 F9CC User defined range #1
+F9CD E1A4 F9CD User defined range #1
+F9CE E1A5 F9CE User defined range #1
+F9CF E1A6 F9CF User defined range #1
+F9D0 E1A7 F9D0 User defined range #1
+F9D1 E1A8 F9D1 User defined range #1
+F9D2 E1A9 F9D2 User defined range #1
+F9D3 E1AA F9D3 User defined range #1
+F9D4 E1AB F9D4 User defined range #1
+F9D5 E1AC F9D5 User defined range #1
+F9D6 E1AD F9D6 User defined range #1
+F9D7 E1AE F9D7 User defined range #1
+F9D8 E1AF F9D8 User defined range #1
+F9D9 E1B0 F9D9 User defined range #1
+F9DA E1B1 F9DA User defined range #1
+F9DB E1B2 F9DB User defined range #1
+F9DC E1B3 F9DC User defined range #1
+F9DD E1B4 F9DD User defined range #1
+F9DE E1B5 F9DE User defined range #1
+F9DF E1B6 F9DF User defined range #1
+F9E0 E1B7 F9E0 User defined range #1
+F9E1 E1B8 F9E1 User defined range #1
+F9E2 E1B9 F9E2 User defined range #1
+F9E3 E1BA F9E3 User defined range #1
+F9E4 E1BB F9E4 User defined range #1
+F9E5 E1BC F9E5 User defined range #1
+F9E6 E1BD F9E6 User defined range #1
+F9E7 E1BE F9E7 User defined range #1
+F9E8 E1BF F9E8 User defined range #1
+F9E9 E1C0 F9E9 User defined range #1
+F9EA E1C1 F9EA User defined range #1
+F9EB E1C2 F9EB User defined range #1
+F9EC E1C3 F9EC User defined range #1
+F9ED E1C4 F9ED User defined range #1
+F9EE E1C5 F9EE User defined range #1
+F9EF E1C6 F9EF User defined range #1
+F9F0 E1C7 F9F0 User defined range #1
+F9F1 E1C8 F9F1 User defined range #1
+F9F2 E1C9 F9F2 User defined range #1
+F9F3 E1CA F9F3 User defined range #1
+F9F4 E1CB F9F4 User defined range #1
+F9F5 E1CC F9F5 User defined range #1
+F9F6 E1CD F9F6 User defined range #1
+F9F7 E1CE F9F7 User defined range #1
+F9F8 E1CF F9F8 User defined range #1
+F9F9 E1D0 F9F9 User defined range #1
+F9FA E1D1 F9FA User defined range #1
+F9FB E1D2 F9FB User defined range #1
+F9FC E1D3 F9FC User defined range #1
+F9FD E1D4 F9FD User defined range #1
+F9FE E1D5 F9FE User defined range #1
+FAA1 E1D6 FAA1 User defined range #1
+FAA2 E1D7 FAA2 User defined range #1
+FAA3 E1D8 FAA3 User defined range #1
+FAA4 E1D9 FAA4 User defined range #1
+FAA5 E1DA FAA5 User defined range #1
+FAA6 E1DB FAA6 User defined range #1
+FAA7 E1DC FAA7 User defined range #1
+FAA8 E1DD FAA8 User defined range #1
+FAA9 E1DE FAA9 User defined range #1
+FAAA E1DF FAAA User defined range #1
+FAAB E1E0 FAAB User defined range #1
+FAAC E1E1 FAAC User defined range #1
+FAAD E1E2 FAAD User defined range #1
+FAAE E1E3 FAAE User defined range #1
+FAAF E1E4 FAAF User defined range #1
+FAB0 E1E5 FAB0 User defined range #1
+FAB1 E1E6 FAB1 User defined range #1
+FAB2 E1E7 FAB2 User defined range #1
+FAB3 E1E8 FAB3 User defined range #1
+FAB4 E1E9 FAB4 User defined range #1
+FAB5 E1EA FAB5 User defined range #1
+FAB6 E1EB FAB6 User defined range #1
+FAB7 E1EC FAB7 User defined range #1
+FAB8 E1ED FAB8 User defined range #1
+FAB9 E1EE FAB9 User defined range #1
+FABA E1EF FABA User defined range #1
+FABB E1F0 FABB User defined range #1
+FABC E1F1 FABC User defined range #1
+FABD E1F2 FABD User defined range #1
+FABE E1F3 FABE User defined range #1
+FABF E1F4 FABF User defined range #1
+FAC0 E1F5 FAC0 User defined range #1
+FAC1 E1F6 FAC1 User defined range #1
+FAC2 E1F7 FAC2 User defined range #1
+FAC3 E1F8 FAC3 User defined range #1
+FAC4 E1F9 FAC4 User defined range #1
+FAC5 E1FA FAC5 User defined range #1
+FAC6 E1FB FAC6 User defined range #1
+FAC7 E1FC FAC7 User defined range #1
+FAC8 E1FD FAC8 User defined range #1
+FAC9 E1FE FAC9 User defined range #1
+FACA E1FF FACA User defined range #1
+FACB E200 FACB User defined range #1
+FACC E201 FACC User defined range #1
+FACD E202 FACD User defined range #1
+FACE E203 FACE User defined range #1
+FACF E204 FACF User defined range #1
+FAD0 E205 FAD0 User defined range #1
+FAD1 E206 FAD1 User defined range #1
+FAD2 E207 FAD2 User defined range #1
+FAD3 E208 FAD3 User defined range #1
+FAD4 E209 FAD4 User defined range #1
+FAD5 E20A FAD5 User defined range #1
+FAD6 E20B FAD6 User defined range #1
+FAD7 E20C FAD7 User defined range #1
+FAD8 E20D FAD8 User defined range #1
+FAD9 E20E FAD9 User defined range #1
+FADA E20F FADA User defined range #1
+FADB E210 FADB User defined range #1
+FADC E211 FADC User defined range #1
+FADD E212 FADD User defined range #1
+FADE E213 FADE User defined range #1
+FADF E214 FADF User defined range #1
+FAE0 E215 FAE0 User defined range #1
+FAE1 E216 FAE1 User defined range #1
+FAE2 E217 FAE2 User defined range #1
+FAE3 E218 FAE3 User defined range #1
+FAE4 E219 FAE4 User defined range #1
+FAE5 E21A FAE5 User defined range #1
+FAE6 E21B FAE6 User defined range #1
+FAE7 E21C FAE7 User defined range #1
+FAE8 E21D FAE8 User defined range #1
+FAE9 E21E FAE9 User defined range #1
+FAEA E21F FAEA User defined range #1
+FAEB E220 FAEB User defined range #1
+FAEC E221 FAEC User defined range #1
+FAED E222 FAED User defined range #1
+FAEE E223 FAEE User defined range #1
+FAEF E224 FAEF User defined range #1
+FAF0 E225 FAF0 User defined range #1
+FAF1 E226 FAF1 User defined range #1
+FAF2 E227 FAF2 User defined range #1
+FAF3 E228 FAF3 User defined range #1
+FAF4 E229 FAF4 User defined range #1
+FAF5 E22A FAF5 User defined range #1
+FAF6 E22B FAF6 User defined range #1
+FAF7 E22C FAF7 User defined range #1
+FAF8 E22D FAF8 User defined range #1
+FAF9 E22E FAF9 User defined range #1
+FAFA E22F FAFA User defined range #1
+FAFB E230 FAFB User defined range #1
+FAFC E231 FAFC User defined range #1
+FAFD E232 FAFD User defined range #1
+FAFE E233 FAFE User defined range #1
+FBA1 E234 FBA1 User defined range #1
+FBA2 E235 FBA2 User defined range #1
+FBA3 E236 FBA3 User defined range #1
+FBA4 E237 FBA4 User defined range #1
+FBA5 E238 FBA5 User defined range #1
+FBA6 E239 FBA6 User defined range #1
+FBA7 E23A FBA7 User defined range #1
+FBA8 E23B FBA8 User defined range #1
+FBA9 E23C FBA9 User defined range #1
+FBAA E23D FBAA User defined range #1
+FBAB E23E FBAB User defined range #1
+FBAC E23F FBAC User defined range #1
+FBAD E240 FBAD User defined range #1
+FBAE E241 FBAE User defined range #1
+FBAF E242 FBAF User defined range #1
+FBB0 E243 FBB0 User defined range #1
+FBB1 E244 FBB1 User defined range #1
+FBB2 E245 FBB2 User defined range #1
+FBB3 E246 FBB3 User defined range #1
+FBB4 E247 FBB4 User defined range #1
+FBB5 E248 FBB5 User defined range #1
+FBB6 E249 FBB6 User defined range #1
+FBB7 E24A FBB7 User defined range #1
+FBB8 E24B FBB8 User defined range #1
+FBB9 E24C FBB9 User defined range #1
+FBBA E24D FBBA User defined range #1
+FBBB E24E FBBB User defined range #1
+FBBC E24F FBBC User defined range #1
+FBBD E250 FBBD User defined range #1
+FBBE E251 FBBE User defined range #1
+FBBF E252 FBBF User defined range #1
+FBC0 E253 FBC0 User defined range #1
+FBC1 E254 FBC1 User defined range #1
+FBC2 E255 FBC2 User defined range #1
+FBC3 E256 FBC3 User defined range #1
+FBC4 E257 FBC4 User defined range #1
+FBC5 E258 FBC5 User defined range #1
+FBC6 E259 FBC6 User defined range #1
+FBC7 E25A FBC7 User defined range #1
+FBC8 E25B FBC8 User defined range #1
+FBC9 E25C FBC9 User defined range #1
+FBCA E25D FBCA User defined range #1
+FBCB E25E FBCB User defined range #1
+FBCC E25F FBCC User defined range #1
+FBCD E260 FBCD User defined range #1
+FBCE E261 FBCE User defined range #1
+FBCF E262 FBCF User defined range #1
+FBD0 E263 FBD0 User defined range #1
+FBD1 E264 FBD1 User defined range #1
+FBD2 E265 FBD2 User defined range #1
+FBD3 E266 FBD3 User defined range #1
+FBD4 E267 FBD4 User defined range #1
+FBD5 E268 FBD5 User defined range #1
+FBD6 E269 FBD6 User defined range #1
+FBD7 E26A FBD7 User defined range #1
+FBD8 E26B FBD8 User defined range #1
+FBD9 E26C FBD9 User defined range #1
+FBDA E26D FBDA User defined range #1
+FBDB E26E FBDB User defined range #1
+FBDC E26F FBDC User defined range #1
+FBDD E270 FBDD User defined range #1
+FBDE E271 FBDE User defined range #1
+FBDF E272 FBDF User defined range #1
+FBE0 E273 FBE0 User defined range #1
+FBE1 E274 FBE1 User defined range #1
+FBE2 E275 FBE2 User defined range #1
+FBE3 E276 FBE3 User defined range #1
+FBE4 E277 FBE4 User defined range #1
+FBE5 E278 FBE5 User defined range #1
+FBE6 E279 FBE6 User defined range #1
+FBE7 E27A FBE7 User defined range #1
+FBE8 E27B FBE8 User defined range #1
+FBE9 E27C FBE9 User defined range #1
+FBEA E27D FBEA User defined range #1
+FBEB E27E FBEB User defined range #1
+FBEC E27F FBEC User defined range #1
+FBED E280 FBED User defined range #1
+FBEE E281 FBEE User defined range #1
+FBEF E282 FBEF User defined range #1
+FBF0 E283 FBF0 User defined range #1
+FBF1 E284 FBF1 User defined range #1
+FBF2 E285 FBF2 User defined range #1
+FBF3 E286 FBF3 User defined range #1
+FBF4 E287 FBF4 User defined range #1
+FBF5 E288 FBF5 User defined range #1
+FBF6 E289 FBF6 User defined range #1
+FBF7 E28A FBF7 User defined range #1
+FBF8 E28B FBF8 User defined range #1
+FBF9 E28C FBF9 User defined range #1
+FBFA E28D FBFA User defined range #1
+FBFB E28E FBFB User defined range #1
+FBFC E28F FBFC User defined range #1
+FBFD E290 FBFD User defined range #1
+FBFE E291 FBFE User defined range #1
+FCA1 E292 FCA1 User defined range #1
+FCA2 E293 FCA2 User defined range #1
+FCA3 E294 FCA3 User defined range #1
+FCA4 E295 FCA4 User defined range #1
+FCA5 E296 FCA5 User defined range #1
+FCA6 E297 FCA6 User defined range #1
+FCA7 E298 FCA7 User defined range #1
+FCA8 E299 FCA8 User defined range #1
+FCA9 E29A FCA9 User defined range #1
+FCAA E29B FCAA User defined range #1
+FCAB E29C FCAB User defined range #1
+FCAC E29D FCAC User defined range #1
+FCAD E29E FCAD User defined range #1
+FCAE E29F FCAE User defined range #1
+FCAF E2A0 FCAF User defined range #1
+FCB0 E2A1 FCB0 User defined range #1
+FCB1 E2A2 FCB1 User defined range #1
+FCB2 E2A3 FCB2 User defined range #1
+FCB3 E2A4 FCB3 User defined range #1
+FCB4 E2A5 FCB4 User defined range #1
+FCB5 E2A6 FCB5 User defined range #1
+FCB6 E2A7 FCB6 User defined range #1
+FCB7 E2A8 FCB7 User defined range #1
+FCB8 E2A9 FCB8 User defined range #1
+FCB9 E2AA FCB9 User defined range #1
+FCBA E2AB FCBA User defined range #1
+FCBB E2AC FCBB User defined range #1
+FCBC E2AD FCBC User defined range #1
+FCBD E2AE FCBD User defined range #1
+FCBE E2AF FCBE User defined range #1
+FCBF E2B0 FCBF User defined range #1
+FCC0 E2B1 FCC0 User defined range #1
+FCC1 E2B2 FCC1 User defined range #1
+FCC2 E2B3 FCC2 User defined range #1
+FCC3 E2B4 FCC3 User defined range #1
+FCC4 E2B5 FCC4 User defined range #1
+FCC5 E2B6 FCC5 User defined range #1
+FCC6 E2B7 FCC6 User defined range #1
+FCC7 E2B8 FCC7 User defined range #1
+FCC8 E2B9 FCC8 User defined range #1
+FCC9 E2BA FCC9 User defined range #1
+FCCA E2BB FCCA User defined range #1
+FCCB E2BC FCCB User defined range #1
+FCCC E2BD FCCC User defined range #1
+FCCD E2BE FCCD User defined range #1
+FCCE E2BF FCCE User defined range #1
+FCCF E2C0 FCCF User defined range #1
+FCD0 E2C1 FCD0 User defined range #1
+FCD1 E2C2 FCD1 User defined range #1
+FCD2 E2C3 FCD2 User defined range #1
+FCD3 E2C4 FCD3 User defined range #1
+FCD4 E2C5 FCD4 User defined range #1
+FCD5 E2C6 FCD5 User defined range #1
+FCD6 E2C7 FCD6 User defined range #1
+FCD7 E2C8 FCD7 User defined range #1
+FCD8 E2C9 FCD8 User defined range #1
+FCD9 E2CA FCD9 User defined range #1
+FCDA E2CB FCDA User defined range #1
+FCDB E2CC FCDB User defined range #1
+FCDC E2CD FCDC User defined range #1
+FCDD E2CE FCDD User defined range #1
+FCDE E2CF FCDE User defined range #1
+FCDF E2D0 FCDF User defined range #1
+FCE0 E2D1 FCE0 User defined range #1
+FCE1 E2D2 FCE1 User defined range #1
+FCE2 E2D3 FCE2 User defined range #1
+FCE3 E2D4 FCE3 User defined range #1
+FCE4 E2D5 FCE4 User defined range #1
+FCE5 E2D6 FCE5 User defined range #1
+FCE6 E2D7 FCE6 User defined range #1
+FCE7 E2D8 FCE7 User defined range #1
+FCE8 E2D9 FCE8 User defined range #1
+FCE9 E2DA FCE9 User defined range #1
+FCEA E2DB FCEA User defined range #1
+FCEB E2DC FCEB User defined range #1
+FCEC E2DD FCEC User defined range #1
+FCED E2DE FCED User defined range #1
+FCEE E2DF FCEE User defined range #1
+FCEF E2E0 FCEF User defined range #1
+FCF0 E2E1 FCF0 User defined range #1
+FCF1 E2E2 FCF1 User defined range #1
+FCF2 E2E3 FCF2 User defined range #1
+FCF3 E2E4 FCF3 User defined range #1
+FCF4 E2E5 FCF4 User defined range #1
+FCF5 E2E6 FCF5 User defined range #1
+FCF6 E2E7 FCF6 User defined range #1
+FCF7 E2E8 FCF7 User defined range #1
+FCF8 E2E9 FCF8 User defined range #1
+FCF9 E2EA FCF9 User defined range #1
+FCFA E2EB FCFA User defined range #1
+FCFB E2EC FCFB User defined range #1
+FCFC E2ED FCFC User defined range #1
+FCFD E2EE FCFD User defined range #1
+FCFE E2EF FCFE User defined range #1
+FDA1 E2F0 FDA1 User defined range #1
+FDA2 E2F1 FDA2 User defined range #1
+FDA3 E2F2 FDA3 User defined range #1
+FDA4 E2F3 FDA4 User defined range #1
+FDA5 E2F4 FDA5 User defined range #1
+FDA6 E2F5 FDA6 User defined range #1
+FDA7 E2F6 FDA7 User defined range #1
+FDA8 E2F7 FDA8 User defined range #1
+FDA9 E2F8 FDA9 User defined range #1
+FDAA E2F9 FDAA User defined range #1
+FDAB E2FA FDAB User defined range #1
+FDAC E2FB FDAC User defined range #1
+FDAD E2FC FDAD User defined range #1
+FDAE E2FD FDAE User defined range #1
+FDAF E2FE FDAF User defined range #1
+FDB0 E2FF FDB0 User defined range #1
+FDB1 E300 FDB1 User defined range #1
+FDB2 E301 FDB2 User defined range #1
+FDB3 E302 FDB3 User defined range #1
+FDB4 E303 FDB4 User defined range #1
+FDB5 E304 FDB5 User defined range #1
+FDB6 E305 FDB6 User defined range #1
+FDB7 E306 FDB7 User defined range #1
+FDB8 E307 FDB8 User defined range #1
+FDB9 E308 FDB9 User defined range #1
+FDBA E309 FDBA User defined range #1
+FDBB E30A FDBB User defined range #1
+FDBC E30B FDBC User defined range #1
+FDBD E30C FDBD User defined range #1
+FDBE E30D FDBE User defined range #1
+FDBF E30E FDBF User defined range #1
+FDC0 E30F FDC0 User defined range #1
+FDC1 E310 FDC1 User defined range #1
+FDC2 E311 FDC2 User defined range #1
+FDC3 E312 FDC3 User defined range #1
+FDC4 E313 FDC4 User defined range #1
+FDC5 E314 FDC5 User defined range #1
+FDC6 E315 FDC6 User defined range #1
+FDC7 E316 FDC7 User defined range #1
+FDC8 E317 FDC8 User defined range #1
+FDC9 E318 FDC9 User defined range #1
+FDCA E319 FDCA User defined range #1
+FDCB E31A FDCB User defined range #1
+FDCC E31B FDCC User defined range #1
+FDCD E31C FDCD User defined range #1
+FDCE E31D FDCE User defined range #1
+FDCF E31E FDCF User defined range #1
+FDD0 E31F FDD0 User defined range #1
+FDD1 E320 FDD1 User defined range #1
+FDD2 E321 FDD2 User defined range #1
+FDD3 E322 FDD3 User defined range #1
+FDD4 E323 FDD4 User defined range #1
+FDD5 E324 FDD5 User defined range #1
+FDD6 E325 FDD6 User defined range #1
+FDD7 E326 FDD7 User defined range #1
+FDD8 E327 FDD8 User defined range #1
+FDD9 E328 FDD9 User defined range #1
+FDDA E329 FDDA User defined range #1
+FDDB E32A FDDB User defined range #1
+FDDC E32B FDDC User defined range #1
+FDDD E32C FDDD User defined range #1
+FDDE E32D FDDE User defined range #1
+FDDF E32E FDDF User defined range #1
+FDE0 E32F FDE0 User defined range #1
+FDE1 E330 FDE1 User defined range #1
+FDE2 E331 FDE2 User defined range #1
+FDE3 E332 FDE3 User defined range #1
+FDE4 E333 FDE4 User defined range #1
+FDE5 E334 FDE5 User defined range #1
+FDE6 E335 FDE6 User defined range #1
+FDE7 E336 FDE7 User defined range #1
+FDE8 E337 FDE8 User defined range #1
+FDE9 E338 FDE9 User defined range #1
+FDEA E339 FDEA User defined range #1
+FDEB E33A FDEB User defined range #1
+FDEC E33B FDEC User defined range #1
+FDED E33C FDED User defined range #1
+FDEE E33D FDEE User defined range #1
+FDEF E33E FDEF User defined range #1
+FDF0 E33F FDF0 User defined range #1
+FDF1 E340 FDF1 User defined range #1
+FDF2 E341 FDF2 User defined range #1
+FDF3 E342 FDF3 User defined range #1
+FDF4 E343 FDF4 User defined range #1
+FDF5 E344 FDF5 User defined range #1
+FDF6 E345 FDF6 User defined range #1
+FDF7 E346 FDF7 User defined range #1
+FDF8 E347 FDF8 User defined range #1
+FDF9 E348 FDF9 User defined range #1
+FDFA E349 FDFA User defined range #1
+FDFB E34A FDFB User defined range #1
+FDFC E34B FDFC User defined range #1
+FDFD E34C FDFD User defined range #1
+FDFE E34D FDFE User defined range #1
+FEA1 E34E FEA1 User defined range #1
+FEA2 E34F FEA2 User defined range #1
+FEA3 E350 FEA3 User defined range #1
+FEA4 E351 FEA4 User defined range #1
+FEA5 E352 FEA5 User defined range #1
+FEA6 E353 FEA6 User defined range #1
+FEA7 E354 FEA7 User defined range #1
+FEA8 E355 FEA8 User defined range #1
+FEA9 E356 FEA9 User defined range #1
+FEAA E357 FEAA User defined range #1
+FEAB E358 FEAB User defined range #1
+FEAC E359 FEAC User defined range #1
+FEAD E35A FEAD User defined range #1
+FEAE E35B FEAE User defined range #1
+FEAF E35C FEAF User defined range #1
+FEB0 E35D FEB0 User defined range #1
+FEB1 E35E FEB1 User defined range #1
+FEB2 E35F FEB2 User defined range #1
+FEB3 E360 FEB3 User defined range #1
+FEB4 E361 FEB4 User defined range #1
+FEB5 E362 FEB5 User defined range #1
+FEB6 E363 FEB6 User defined range #1
+FEB7 E364 FEB7 User defined range #1
+FEB8 E365 FEB8 User defined range #1
+FEB9 E366 FEB9 User defined range #1
+FEBA E367 FEBA User defined range #1
+FEBB E368 FEBB User defined range #1
+FEBC E369 FEBC User defined range #1
+FEBD E36A FEBD User defined range #1
+FEBE E36B FEBE User defined range #1
+FEBF E36C FEBF User defined range #1
+FEC0 E36D FEC0 User defined range #1
+FEC1 E36E FEC1 User defined range #1
+FEC2 E36F FEC2 User defined range #1
+FEC3 E370 FEC3 User defined range #1
+FEC4 E371 FEC4 User defined range #1
+FEC5 E372 FEC5 User defined range #1
+FEC6 E373 FEC6 User defined range #1
+FEC7 E374 FEC7 User defined range #1
+FEC8 E375 FEC8 User defined range #1
+FEC9 E376 FEC9 User defined range #1
+FECA E377 FECA User defined range #1
+FECB E378 FECB User defined range #1
+FECC E379 FECC User defined range #1
+FECD E37A FECD User defined range #1
+FECE E37B FECE User defined range #1
+FECF E37C FECF User defined range #1
+FED0 E37D FED0 User defined range #1
+FED1 E37E FED1 User defined range #1
+FED2 E37F FED2 User defined range #1
+FED3 E380 FED3 User defined range #1
+FED4 E381 FED4 User defined range #1
+FED5 E382 FED5 User defined range #1
+FED6 E383 FED6 User defined range #1
+FED7 E384 FED7 User defined range #1
+FED8 E385 FED8 User defined range #1
+FED9 E386 FED9 User defined range #1
+FEDA E387 FEDA User defined range #1
+FEDB E388 FEDB User defined range #1
+FEDC E389 FEDC User defined range #1
+FEDD E38A FEDD User defined range #1
+FEDE E38B FEDE User defined range #1
+FEDF E38C FEDF User defined range #1
+FEE0 E38D FEE0 User defined range #1
+FEE1 E38E FEE1 User defined range #1
+FEE2 E38F FEE2 User defined range #1
+FEE3 E390 FEE3 User defined range #1
+FEE4 E391 FEE4 User defined range #1
+FEE5 E392 FEE5 User defined range #1
+FEE6 E393 FEE6 User defined range #1
+FEE7 E394 FEE7 User defined range #1
+FEE8 E395 FEE8 User defined range #1
+FEE9 E396 FEE9 User defined range #1
+FEEA E397 FEEA User defined range #1
+FEEB E398 FEEB User defined range #1
+FEEC E399 FEEC User defined range #1
+FEED E39A FEED User defined range #1
+FEEE E39B FEEE User defined range #1
+FEEF E39C FEEF User defined range #1
+FEF0 E39D FEF0 User defined range #1
+FEF1 E39E FEF1 User defined range #1
+FEF2 E39F FEF2 User defined range #1
+FEF3 E3A0 FEF3 User defined range #1
+FEF4 E3A1 FEF4 User defined range #1
+FEF5 E3A2 FEF5 User defined range #1
+FEF6 E3A3 FEF6 User defined range #1
+FEF7 E3A4 FEF7 User defined range #1
+FEF8 E3A5 FEF8 User defined range #1
+FEF9 E3A6 FEF9 User defined range #1
+FEFA E3A7 FEFA User defined range #1
+FEFB E3A8 FEFB User defined range #1
+FEFC E3A9 FEFC User defined range #1
+FEFD E3AA FEFD User defined range #1
+FEFE E3AB FEFE User defined range #1
+Characters with unsafe Unicode round trip
+select hex(ujis), hex(ucs2), hex(ujis2), name from t1 where ujis<>ujis2 order by ujis;
+hex(ujis) hex(ucs2) hex(ujis2) name
+8FA1A1 003F 3F UNASSIGNED
+8FA1A2 003F 3F UNASSIGNED
+8FA1A3 003F 3F UNASSIGNED
+8FA1A4 003F 3F UNASSIGNED
+8FA1A5 003F 3F UNASSIGNED
+8FA1A6 003F 3F UNASSIGNED
+8FA1A7 003F 3F UNASSIGNED
+8FA1A8 003F 3F UNASSIGNED
+8FA1A9 003F 3F UNASSIGNED
+8FA1AA 003F 3F UNASSIGNED
+8FA1AB 003F 3F UNASSIGNED
+8FA1AC 003F 3F UNASSIGNED
+8FA1AD 003F 3F UNASSIGNED
+8FA1AE 003F 3F UNASSIGNED
+8FA1AF 003F 3F UNASSIGNED
+8FA1B0 003F 3F UNASSIGNED
+8FA1B1 003F 3F UNASSIGNED
+8FA1B2 003F 3F UNASSIGNED
+8FA1B3 003F 3F UNASSIGNED
+8FA1B4 003F 3F UNASSIGNED
+8FA1B5 003F 3F UNASSIGNED
+8FA1B6 003F 3F UNASSIGNED
+8FA1B7 003F 3F UNASSIGNED
+8FA1B8 003F 3F UNASSIGNED
+8FA1B9 003F 3F UNASSIGNED
+8FA1BA 003F 3F UNASSIGNED
+8FA1BB 003F 3F UNASSIGNED
+8FA1BC 003F 3F UNASSIGNED
+8FA1BD 003F 3F UNASSIGNED
+8FA1BE 003F 3F UNASSIGNED
+8FA1BF 003F 3F UNASSIGNED
+8FA1C0 003F 3F UNASSIGNED
+8FA1C1 003F 3F UNASSIGNED
+8FA1C2 003F 3F UNASSIGNED
+8FA1C3 003F 3F UNASSIGNED
+8FA1C4 003F 3F UNASSIGNED
+8FA1C5 003F 3F UNASSIGNED
+8FA1C6 003F 3F UNASSIGNED
+8FA1C7 003F 3F UNASSIGNED
+8FA1C8 003F 3F UNASSIGNED
+8FA1C9 003F 3F UNASSIGNED
+8FA1CA 003F 3F UNASSIGNED
+8FA1CB 003F 3F UNASSIGNED
+8FA1CC 003F 3F UNASSIGNED
+8FA1CD 003F 3F UNASSIGNED
+8FA1CE 003F 3F UNASSIGNED
+8FA1CF 003F 3F UNASSIGNED
+8FA1D0 003F 3F UNASSIGNED
+8FA1D1 003F 3F UNASSIGNED
+8FA1D2 003F 3F UNASSIGNED
+8FA1D3 003F 3F UNASSIGNED
+8FA1D4 003F 3F UNASSIGNED
+8FA1D5 003F 3F UNASSIGNED
+8FA1D6 003F 3F UNASSIGNED
+8FA1D7 003F 3F UNASSIGNED
+8FA1D8 003F 3F UNASSIGNED
+8FA1D9 003F 3F UNASSIGNED
+8FA1DA 003F 3F UNASSIGNED
+8FA1DB 003F 3F UNASSIGNED
+8FA1DC 003F 3F UNASSIGNED
+8FA1DD 003F 3F UNASSIGNED
+8FA1DE 003F 3F UNASSIGNED
+8FA1DF 003F 3F UNASSIGNED
+8FA1E0 003F 3F UNASSIGNED
+8FA1E1 003F 3F UNASSIGNED
+8FA1E2 003F 3F UNASSIGNED
+8FA1E3 003F 3F UNASSIGNED
+8FA1E4 003F 3F UNASSIGNED
+8FA1E5 003F 3F UNASSIGNED
+8FA1E6 003F 3F UNASSIGNED
+8FA1E7 003F 3F UNASSIGNED
+8FA1E8 003F 3F UNASSIGNED
+8FA1E9 003F 3F UNASSIGNED
+8FA1EA 003F 3F UNASSIGNED
+8FA1EB 003F 3F UNASSIGNED
+8FA1EC 003F 3F UNASSIGNED
+8FA1ED 003F 3F UNASSIGNED
+8FA1EE 003F 3F UNASSIGNED
+8FA1EF 003F 3F UNASSIGNED
+8FA1F0 003F 3F UNASSIGNED
+8FA1F1 003F 3F UNASSIGNED
+8FA1F2 003F 3F UNASSIGNED
+8FA1F3 003F 3F UNASSIGNED
+8FA1F4 003F 3F UNASSIGNED
+8FA1F5 003F 3F UNASSIGNED
+8FA1F6 003F 3F UNASSIGNED
+8FA1F7 003F 3F UNASSIGNED
+8FA1F8 003F 3F UNASSIGNED
+8FA1F9 003F 3F UNASSIGNED
+8FA1FA 003F 3F UNASSIGNED
+8FA1FB 003F 3F UNASSIGNED
+8FA1FC 003F 3F UNASSIGNED
+8FA1FD 003F 3F UNASSIGNED
+8FA1FE 003F 3F UNASSIGNED
+8FA2A1 003F 3F UNASSIGNED
+8FA2A2 003F 3F UNASSIGNED
+8FA2A3 003F 3F UNASSIGNED
+8FA2A4 003F 3F UNASSIGNED
+8FA2A5 003F 3F UNASSIGNED
+8FA2A6 003F 3F UNASSIGNED
+8FA2A7 003F 3F UNASSIGNED
+8FA2A8 003F 3F UNASSIGNED
+8FA2A9 003F 3F UNASSIGNED
+8FA2AA 003F 3F UNASSIGNED
+8FA2AB 003F 3F UNASSIGNED
+8FA2AC 003F 3F UNASSIGNED
+8FA2AD 003F 3F UNASSIGNED
+8FA2AE 003F 3F UNASSIGNED
+8FA2B7 007E 7E U+007E TILDE
+8FA2BA 003F 3F UNASSIGNED
+8FA2BB 003F 3F UNASSIGNED
+8FA2BC 003F 3F UNASSIGNED
+8FA2BD 003F 3F UNASSIGNED
+8FA2BE 003F 3F UNASSIGNED
+8FA2BF 003F 3F UNASSIGNED
+8FA2C0 003F 3F UNASSIGNED
+8FA2C1 003F 3F UNASSIGNED
+8FA2C5 003F 3F UNASSIGNED
+8FA2C6 003F 3F UNASSIGNED
+8FA2C7 003F 3F UNASSIGNED
+8FA2C8 003F 3F UNASSIGNED
+8FA2C9 003F 3F UNASSIGNED
+8FA2CA 003F 3F UNASSIGNED
+8FA2CB 003F 3F UNASSIGNED
+8FA2CC 003F 3F UNASSIGNED
+8FA2CD 003F 3F UNASSIGNED
+8FA2CE 003F 3F UNASSIGNED
+8FA2CF 003F 3F UNASSIGNED
+8FA2D0 003F 3F UNASSIGNED
+8FA2D1 003F 3F UNASSIGNED
+8FA2D2 003F 3F UNASSIGNED
+8FA2D3 003F 3F UNASSIGNED
+8FA2D4 003F 3F UNASSIGNED
+8FA2D5 003F 3F UNASSIGNED
+8FA2D6 003F 3F UNASSIGNED
+8FA2D7 003F 3F UNASSIGNED
+8FA2D8 003F 3F UNASSIGNED
+8FA2D9 003F 3F UNASSIGNED
+8FA2DA 003F 3F UNASSIGNED
+8FA2DB 003F 3F UNASSIGNED
+8FA2DC 003F 3F UNASSIGNED
+8FA2DD 003F 3F UNASSIGNED
+8FA2DE 003F 3F UNASSIGNED
+8FA2DF 003F 3F UNASSIGNED
+8FA2E0 003F 3F UNASSIGNED
+8FA2E1 003F 3F UNASSIGNED
+8FA2E2 003F 3F UNASSIGNED
+8FA2E3 003F 3F UNASSIGNED
+8FA2E4 003F 3F UNASSIGNED
+8FA2E5 003F 3F UNASSIGNED
+8FA2E6 003F 3F UNASSIGNED
+8FA2E7 003F 3F UNASSIGNED
+8FA2E8 003F 3F UNASSIGNED
+8FA2E9 003F 3F UNASSIGNED
+8FA2EA 003F 3F UNASSIGNED
+8FA2F2 003F 3F UNASSIGNED
+8FA2F3 003F 3F UNASSIGNED
+8FA2F4 003F 3F UNASSIGNED
+8FA2F5 003F 3F UNASSIGNED
+8FA2F6 003F 3F UNASSIGNED
+8FA2F7 003F 3F UNASSIGNED
+8FA2F8 003F 3F UNASSIGNED
+8FA2F9 003F 3F UNASSIGNED
+8FA2FA 003F 3F UNASSIGNED
+8FA2FB 003F 3F UNASSIGNED
+8FA2FC 003F 3F UNASSIGNED
+8FA2FD 003F 3F UNASSIGNED
+8FA2FE 003F 3F UNASSIGNED
+8FA3A1 003F 3F UNASSIGNED
+8FA3A2 003F 3F UNASSIGNED
+8FA3A3 003F 3F UNASSIGNED
+8FA3A4 003F 3F UNASSIGNED
+8FA3A5 003F 3F UNASSIGNED
+8FA3A6 003F 3F UNASSIGNED
+8FA3A7 003F 3F UNASSIGNED
+8FA3A8 003F 3F UNASSIGNED
+8FA3A9 003F 3F UNASSIGNED
+8FA3AA 003F 3F UNASSIGNED
+8FA3AB 003F 3F UNASSIGNED
+8FA3AC 003F 3F UNASSIGNED
+8FA3AD 003F 3F UNASSIGNED
+8FA3AE 003F 3F UNASSIGNED
+8FA3AF 003F 3F UNASSIGNED
+8FA3B0 003F 3F UNASSIGNED
+8FA3B1 003F 3F UNASSIGNED
+8FA3B2 003F 3F UNASSIGNED
+8FA3B3 003F 3F UNASSIGNED
+8FA3B4 003F 3F UNASSIGNED
+8FA3B5 003F 3F UNASSIGNED
+8FA3B6 003F 3F UNASSIGNED
+8FA3B7 003F 3F UNASSIGNED
+8FA3B8 003F 3F UNASSIGNED
+8FA3B9 003F 3F UNASSIGNED
+8FA3BA 003F 3F UNASSIGNED
+8FA3BB 003F 3F UNASSIGNED
+8FA3BC 003F 3F UNASSIGNED
+8FA3BD 003F 3F UNASSIGNED
+8FA3BE 003F 3F UNASSIGNED
+8FA3BF 003F 3F UNASSIGNED
+8FA3C0 003F 3F UNASSIGNED
+8FA3C1 003F 3F UNASSIGNED
+8FA3C2 003F 3F UNASSIGNED
+8FA3C3 003F 3F UNASSIGNED
+8FA3C4 003F 3F UNASSIGNED
+8FA3C5 003F 3F UNASSIGNED
+8FA3C6 003F 3F UNASSIGNED
+8FA3C7 003F 3F UNASSIGNED
+8FA3C8 003F 3F UNASSIGNED
+8FA3C9 003F 3F UNASSIGNED
+8FA3CA 003F 3F UNASSIGNED
+8FA3CB 003F 3F UNASSIGNED
+8FA3CC 003F 3F UNASSIGNED
+8FA3CD 003F 3F UNASSIGNED
+8FA3CE 003F 3F UNASSIGNED
+8FA3CF 003F 3F UNASSIGNED
+8FA3D0 003F 3F UNASSIGNED
+8FA3D1 003F 3F UNASSIGNED
+8FA3D2 003F 3F UNASSIGNED
+8FA3D3 003F 3F UNASSIGNED
+8FA3D4 003F 3F UNASSIGNED
+8FA3D5 003F 3F UNASSIGNED
+8FA3D6 003F 3F UNASSIGNED
+8FA3D7 003F 3F UNASSIGNED
+8FA3D8 003F 3F UNASSIGNED
+8FA3D9 003F 3F UNASSIGNED
+8FA3DA 003F 3F UNASSIGNED
+8FA3DB 003F 3F UNASSIGNED
+8FA3DC 003F 3F UNASSIGNED
+8FA3DD 003F 3F UNASSIGNED
+8FA3DE 003F 3F UNASSIGNED
+8FA3DF 003F 3F UNASSIGNED
+8FA3E0 003F 3F UNASSIGNED
+8FA3E1 003F 3F UNASSIGNED
+8FA3E2 003F 3F UNASSIGNED
+8FA3E3 003F 3F UNASSIGNED
+8FA3E4 003F 3F UNASSIGNED
+8FA3E5 003F 3F UNASSIGNED
+8FA3E6 003F 3F UNASSIGNED
+8FA3E7 003F 3F UNASSIGNED
+8FA3E8 003F 3F UNASSIGNED
+8FA3E9 003F 3F UNASSIGNED
+8FA3EA 003F 3F UNASSIGNED
+8FA3EB 003F 3F UNASSIGNED
+8FA3EC 003F 3F UNASSIGNED
+8FA3ED 003F 3F UNASSIGNED
+8FA3EE 003F 3F UNASSIGNED
+8FA3EF 003F 3F UNASSIGNED
+8FA3F0 003F 3F UNASSIGNED
+8FA3F1 003F 3F UNASSIGNED
+8FA3F2 003F 3F UNASSIGNED
+8FA3F3 003F 3F UNASSIGNED
+8FA3F4 003F 3F UNASSIGNED
+8FA3F5 003F 3F UNASSIGNED
+8FA3F6 003F 3F UNASSIGNED
+8FA3F7 003F 3F UNASSIGNED
+8FA3F8 003F 3F UNASSIGNED
+8FA3F9 003F 3F UNASSIGNED
+8FA3FA 003F 3F UNASSIGNED
+8FA3FB 003F 3F UNASSIGNED
+8FA3FC 003F 3F UNASSIGNED
+8FA3FD 003F 3F UNASSIGNED
+8FA3FE 003F 3F UNASSIGNED
+8FA4A1 003F 3F UNASSIGNED
+8FA4A2 003F 3F UNASSIGNED
+8FA4A3 003F 3F UNASSIGNED
+8FA4A4 003F 3F UNASSIGNED
+8FA4A5 003F 3F UNASSIGNED
+8FA4A6 003F 3F UNASSIGNED
+8FA4A7 003F 3F UNASSIGNED
+8FA4A8 003F 3F UNASSIGNED
+8FA4A9 003F 3F UNASSIGNED
+8FA4AA 003F 3F UNASSIGNED
+8FA4AB 003F 3F UNASSIGNED
+8FA4AC 003F 3F UNASSIGNED
+8FA4AD 003F 3F UNASSIGNED
+8FA4AE 003F 3F UNASSIGNED
+8FA4AF 003F 3F UNASSIGNED
+8FA4B0 003F 3F UNASSIGNED
+8FA4B1 003F 3F UNASSIGNED
+8FA4B2 003F 3F UNASSIGNED
+8FA4B3 003F 3F UNASSIGNED
+8FA4B4 003F 3F UNASSIGNED
+8FA4B5 003F 3F UNASSIGNED
+8FA4B6 003F 3F UNASSIGNED
+8FA4B7 003F 3F UNASSIGNED
+8FA4B8 003F 3F UNASSIGNED
+8FA4B9 003F 3F UNASSIGNED
+8FA4BA 003F 3F UNASSIGNED
+8FA4BB 003F 3F UNASSIGNED
+8FA4BC 003F 3F UNASSIGNED
+8FA4BD 003F 3F UNASSIGNED
+8FA4BE 003F 3F UNASSIGNED
+8FA4BF 003F 3F UNASSIGNED
+8FA4C0 003F 3F UNASSIGNED
+8FA4C1 003F 3F UNASSIGNED
+8FA4C2 003F 3F UNASSIGNED
+8FA4C3 003F 3F UNASSIGNED
+8FA4C4 003F 3F UNASSIGNED
+8FA4C5 003F 3F UNASSIGNED
+8FA4C6 003F 3F UNASSIGNED
+8FA4C7 003F 3F UNASSIGNED
+8FA4C8 003F 3F UNASSIGNED
+8FA4C9 003F 3F UNASSIGNED
+8FA4CA 003F 3F UNASSIGNED
+8FA4CB 003F 3F UNASSIGNED
+8FA4CC 003F 3F UNASSIGNED
+8FA4CD 003F 3F UNASSIGNED
+8FA4CE 003F 3F UNASSIGNED
+8FA4CF 003F 3F UNASSIGNED
+8FA4D0 003F 3F UNASSIGNED
+8FA4D1 003F 3F UNASSIGNED
+8FA4D2 003F 3F UNASSIGNED
+8FA4D3 003F 3F UNASSIGNED
+8FA4D4 003F 3F UNASSIGNED
+8FA4D5 003F 3F UNASSIGNED
+8FA4D6 003F 3F UNASSIGNED
+8FA4D7 003F 3F UNASSIGNED
+8FA4D8 003F 3F UNASSIGNED
+8FA4D9 003F 3F UNASSIGNED
+8FA4DA 003F 3F UNASSIGNED
+8FA4DB 003F 3F UNASSIGNED
+8FA4DC 003F 3F UNASSIGNED
+8FA4DD 003F 3F UNASSIGNED
+8FA4DE 003F 3F UNASSIGNED
+8FA4DF 003F 3F UNASSIGNED
+8FA4E0 003F 3F UNASSIGNED
+8FA4E1 003F 3F UNASSIGNED
+8FA4E2 003F 3F UNASSIGNED
+8FA4E3 003F 3F UNASSIGNED
+8FA4E4 003F 3F UNASSIGNED
+8FA4E5 003F 3F UNASSIGNED
+8FA4E6 003F 3F UNASSIGNED
+8FA4E7 003F 3F UNASSIGNED
+8FA4E8 003F 3F UNASSIGNED
+8FA4E9 003F 3F UNASSIGNED
+8FA4EA 003F 3F UNASSIGNED
+8FA4EB 003F 3F UNASSIGNED
+8FA4EC 003F 3F UNASSIGNED
+8FA4ED 003F 3F UNASSIGNED
+8FA4EE 003F 3F UNASSIGNED
+8FA4EF 003F 3F UNASSIGNED
+8FA4F0 003F 3F UNASSIGNED
+8FA4F1 003F 3F UNASSIGNED
+8FA4F2 003F 3F UNASSIGNED
+8FA4F3 003F 3F UNASSIGNED
+8FA4F4 003F 3F UNASSIGNED
+8FA4F5 003F 3F UNASSIGNED
+8FA4F6 003F 3F UNASSIGNED
+8FA4F7 003F 3F UNASSIGNED
+8FA4F8 003F 3F UNASSIGNED
+8FA4F9 003F 3F UNASSIGNED
+8FA4FA 003F 3F UNASSIGNED
+8FA4FB 003F 3F UNASSIGNED
+8FA4FC 003F 3F UNASSIGNED
+8FA4FD 003F 3F UNASSIGNED
+8FA4FE 003F 3F UNASSIGNED
+8FA5A1 003F 3F UNASSIGNED
+8FA5A2 003F 3F UNASSIGNED
+8FA5A3 003F 3F UNASSIGNED
+8FA5A4 003F 3F UNASSIGNED
+8FA5A5 003F 3F UNASSIGNED
+8FA5A6 003F 3F UNASSIGNED
+8FA5A7 003F 3F UNASSIGNED
+8FA5A8 003F 3F UNASSIGNED
+8FA5A9 003F 3F UNASSIGNED
+8FA5AA 003F 3F UNASSIGNED
+8FA5AB 003F 3F UNASSIGNED
+8FA5AC 003F 3F UNASSIGNED
+8FA5AD 003F 3F UNASSIGNED
+8FA5AE 003F 3F UNASSIGNED
+8FA5AF 003F 3F UNASSIGNED
+8FA5B0 003F 3F UNASSIGNED
+8FA5B1 003F 3F UNASSIGNED
+8FA5B2 003F 3F UNASSIGNED
+8FA5B3 003F 3F UNASSIGNED
+8FA5B4 003F 3F UNASSIGNED
+8FA5B5 003F 3F UNASSIGNED
+8FA5B6 003F 3F UNASSIGNED
+8FA5B7 003F 3F UNASSIGNED
+8FA5B8 003F 3F UNASSIGNED
+8FA5B9 003F 3F UNASSIGNED
+8FA5BA 003F 3F UNASSIGNED
+8FA5BB 003F 3F UNASSIGNED
+8FA5BC 003F 3F UNASSIGNED
+8FA5BD 003F 3F UNASSIGNED
+8FA5BE 003F 3F UNASSIGNED
+8FA5BF 003F 3F UNASSIGNED
+8FA5C0 003F 3F UNASSIGNED
+8FA5C1 003F 3F UNASSIGNED
+8FA5C2 003F 3F UNASSIGNED
+8FA5C3 003F 3F UNASSIGNED
+8FA5C4 003F 3F UNASSIGNED
+8FA5C5 003F 3F UNASSIGNED
+8FA5C6 003F 3F UNASSIGNED
+8FA5C7 003F 3F UNASSIGNED
+8FA5C8 003F 3F UNASSIGNED
+8FA5C9 003F 3F UNASSIGNED
+8FA5CA 003F 3F UNASSIGNED
+8FA5CB 003F 3F UNASSIGNED
+8FA5CC 003F 3F UNASSIGNED
+8FA5CD 003F 3F UNASSIGNED
+8FA5CE 003F 3F UNASSIGNED
+8FA5CF 003F 3F UNASSIGNED
+8FA5D0 003F 3F UNASSIGNED
+8FA5D1 003F 3F UNASSIGNED
+8FA5D2 003F 3F UNASSIGNED
+8FA5D3 003F 3F UNASSIGNED
+8FA5D4 003F 3F UNASSIGNED
+8FA5D5 003F 3F UNASSIGNED
+8FA5D6 003F 3F UNASSIGNED
+8FA5D7 003F 3F UNASSIGNED
+8FA5D8 003F 3F UNASSIGNED
+8FA5D9 003F 3F UNASSIGNED
+8FA5DA 003F 3F UNASSIGNED
+8FA5DB 003F 3F UNASSIGNED
+8FA5DC 003F 3F UNASSIGNED
+8FA5DD 003F 3F UNASSIGNED
+8FA5DE 003F 3F UNASSIGNED
+8FA5DF 003F 3F UNASSIGNED
+8FA5E0 003F 3F UNASSIGNED
+8FA5E1 003F 3F UNASSIGNED
+8FA5E2 003F 3F UNASSIGNED
+8FA5E3 003F 3F UNASSIGNED
+8FA5E4 003F 3F UNASSIGNED
+8FA5E5 003F 3F UNASSIGNED
+8FA5E6 003F 3F UNASSIGNED
+8FA5E7 003F 3F UNASSIGNED
+8FA5E8 003F 3F UNASSIGNED
+8FA5E9 003F 3F UNASSIGNED
+8FA5EA 003F 3F UNASSIGNED
+8FA5EB 003F 3F UNASSIGNED
+8FA5EC 003F 3F UNASSIGNED
+8FA5ED 003F 3F UNASSIGNED
+8FA5EE 003F 3F UNASSIGNED
+8FA5EF 003F 3F UNASSIGNED
+8FA5F0 003F 3F UNASSIGNED
+8FA5F1 003F 3F UNASSIGNED
+8FA5F2 003F 3F UNASSIGNED
+8FA5F3 003F 3F UNASSIGNED
+8FA5F4 003F 3F UNASSIGNED
+8FA5F5 003F 3F UNASSIGNED
+8FA5F6 003F 3F UNASSIGNED
+8FA5F7 003F 3F UNASSIGNED
+8FA5F8 003F 3F UNASSIGNED
+8FA5F9 003F 3F UNASSIGNED
+8FA5FA 003F 3F UNASSIGNED
+8FA5FB 003F 3F UNASSIGNED
+8FA5FC 003F 3F UNASSIGNED
+8FA5FD 003F 3F UNASSIGNED
+8FA5FE 003F 3F UNASSIGNED
+8FA6A1 003F 3F UNASSIGNED
+8FA6A2 003F 3F UNASSIGNED
+8FA6A3 003F 3F UNASSIGNED
+8FA6A4 003F 3F UNASSIGNED
+8FA6A5 003F 3F UNASSIGNED
+8FA6A6 003F 3F UNASSIGNED
+8FA6A7 003F 3F UNASSIGNED
+8FA6A8 003F 3F UNASSIGNED
+8FA6A9 003F 3F UNASSIGNED
+8FA6AA 003F 3F UNASSIGNED
+8FA6AB 003F 3F UNASSIGNED
+8FA6AC 003F 3F UNASSIGNED
+8FA6AD 003F 3F UNASSIGNED
+8FA6AE 003F 3F UNASSIGNED
+8FA6AF 003F 3F UNASSIGNED
+8FA6B0 003F 3F UNASSIGNED
+8FA6B1 003F 3F UNASSIGNED
+8FA6B2 003F 3F UNASSIGNED
+8FA6B3 003F 3F UNASSIGNED
+8FA6B4 003F 3F UNASSIGNED
+8FA6B5 003F 3F UNASSIGNED
+8FA6B6 003F 3F UNASSIGNED
+8FA6B7 003F 3F UNASSIGNED
+8FA6B8 003F 3F UNASSIGNED
+8FA6B9 003F 3F UNASSIGNED
+8FA6BA 003F 3F UNASSIGNED
+8FA6BB 003F 3F UNASSIGNED
+8FA6BC 003F 3F UNASSIGNED
+8FA6BD 003F 3F UNASSIGNED
+8FA6BE 003F 3F UNASSIGNED
+8FA6BF 003F 3F UNASSIGNED
+8FA6C0 003F 3F UNASSIGNED
+8FA6C1 003F 3F UNASSIGNED
+8FA6C2 003F 3F UNASSIGNED
+8FA6C3 003F 3F UNASSIGNED
+8FA6C4 003F 3F UNASSIGNED
+8FA6C5 003F 3F UNASSIGNED
+8FA6C6 003F 3F UNASSIGNED
+8FA6C7 003F 3F UNASSIGNED
+8FA6C8 003F 3F UNASSIGNED
+8FA6C9 003F 3F UNASSIGNED
+8FA6CA 003F 3F UNASSIGNED
+8FA6CB 003F 3F UNASSIGNED
+8FA6CC 003F 3F UNASSIGNED
+8FA6CD 003F 3F UNASSIGNED
+8FA6CE 003F 3F UNASSIGNED
+8FA6CF 003F 3F UNASSIGNED
+8FA6D0 003F 3F UNASSIGNED
+8FA6D1 003F 3F UNASSIGNED
+8FA6D2 003F 3F UNASSIGNED
+8FA6D3 003F 3F UNASSIGNED
+8FA6D4 003F 3F UNASSIGNED
+8FA6D5 003F 3F UNASSIGNED
+8FA6D6 003F 3F UNASSIGNED
+8FA6D7 003F 3F UNASSIGNED
+8FA6D8 003F 3F UNASSIGNED
+8FA6D9 003F 3F UNASSIGNED
+8FA6DA 003F 3F UNASSIGNED
+8FA6DB 003F 3F UNASSIGNED
+8FA6DC 003F 3F UNASSIGNED
+8FA6DD 003F 3F UNASSIGNED
+8FA6DE 003F 3F UNASSIGNED
+8FA6DF 003F 3F UNASSIGNED
+8FA6E0 003F 3F UNASSIGNED
+8FA6E6 003F 3F UNASSIGNED
+8FA6E8 003F 3F UNASSIGNED
+8FA6EB 003F 3F UNASSIGNED
+8FA6ED 003F 3F UNASSIGNED
+8FA6EE 003F 3F UNASSIGNED
+8FA6EF 003F 3F UNASSIGNED
+8FA6F0 003F 3F UNASSIGNED
+8FA6FD 003F 3F UNASSIGNED
+8FA6FE 003F 3F UNASSIGNED
+8FA7A1 003F 3F UNASSIGNED
+8FA7A2 003F 3F UNASSIGNED
+8FA7A3 003F 3F UNASSIGNED
+8FA7A4 003F 3F UNASSIGNED
+8FA7A5 003F 3F UNASSIGNED
+8FA7A6 003F 3F UNASSIGNED
+8FA7A7 003F 3F UNASSIGNED
+8FA7A8 003F 3F UNASSIGNED
+8FA7A9 003F 3F UNASSIGNED
+8FA7AA 003F 3F UNASSIGNED
+8FA7AB 003F 3F UNASSIGNED
+8FA7AC 003F 3F UNASSIGNED
+8FA7AD 003F 3F UNASSIGNED
+8FA7AE 003F 3F UNASSIGNED
+8FA7AF 003F 3F UNASSIGNED
+8FA7B0 003F 3F UNASSIGNED
+8FA7B1 003F 3F UNASSIGNED
+8FA7B2 003F 3F UNASSIGNED
+8FA7B3 003F 3F UNASSIGNED
+8FA7B4 003F 3F UNASSIGNED
+8FA7B5 003F 3F UNASSIGNED
+8FA7B6 003F 3F UNASSIGNED
+8FA7B7 003F 3F UNASSIGNED
+8FA7B8 003F 3F UNASSIGNED
+8FA7B9 003F 3F UNASSIGNED
+8FA7BA 003F 3F UNASSIGNED
+8FA7BB 003F 3F UNASSIGNED
+8FA7BC 003F 3F UNASSIGNED
+8FA7BD 003F 3F UNASSIGNED
+8FA7BE 003F 3F UNASSIGNED
+8FA7BF 003F 3F UNASSIGNED
+8FA7C0 003F 3F UNASSIGNED
+8FA7C1 003F 3F UNASSIGNED
+8FA7CF 003F 3F UNASSIGNED
+8FA7D0 003F 3F UNASSIGNED
+8FA7D1 003F 3F UNASSIGNED
+8FA7D2 003F 3F UNASSIGNED
+8FA7D3 003F 3F UNASSIGNED
+8FA7D4 003F 3F UNASSIGNED
+8FA7D5 003F 3F UNASSIGNED
+8FA7D6 003F 3F UNASSIGNED
+8FA7D7 003F 3F UNASSIGNED
+8FA7D8 003F 3F UNASSIGNED
+8FA7D9 003F 3F UNASSIGNED
+8FA7DA 003F 3F UNASSIGNED
+8FA7DB 003F 3F UNASSIGNED
+8FA7DC 003F 3F UNASSIGNED
+8FA7DD 003F 3F UNASSIGNED
+8FA7DE 003F 3F UNASSIGNED
+8FA7DF 003F 3F UNASSIGNED
+8FA7E0 003F 3F UNASSIGNED
+8FA7E1 003F 3F UNASSIGNED
+8FA7E2 003F 3F UNASSIGNED
+8FA7E3 003F 3F UNASSIGNED
+8FA7E4 003F 3F UNASSIGNED
+8FA7E5 003F 3F UNASSIGNED
+8FA7E6 003F 3F UNASSIGNED
+8FA7E7 003F 3F UNASSIGNED
+8FA7E8 003F 3F UNASSIGNED
+8FA7E9 003F 3F UNASSIGNED
+8FA7EA 003F 3F UNASSIGNED
+8FA7EB 003F 3F UNASSIGNED
+8FA7EC 003F 3F UNASSIGNED
+8FA7ED 003F 3F UNASSIGNED
+8FA7EE 003F 3F UNASSIGNED
+8FA7EF 003F 3F UNASSIGNED
+8FA7F0 003F 3F UNASSIGNED
+8FA7F1 003F 3F UNASSIGNED
+8FA8A1 003F 3F UNASSIGNED
+8FA8A2 003F 3F UNASSIGNED
+8FA8A3 003F 3F UNASSIGNED
+8FA8A4 003F 3F UNASSIGNED
+8FA8A5 003F 3F UNASSIGNED
+8FA8A6 003F 3F UNASSIGNED
+8FA8A7 003F 3F UNASSIGNED
+8FA8A8 003F 3F UNASSIGNED
+8FA8A9 003F 3F UNASSIGNED
+8FA8AA 003F 3F UNASSIGNED
+8FA8AB 003F 3F UNASSIGNED
+8FA8AC 003F 3F UNASSIGNED
+8FA8AD 003F 3F UNASSIGNED
+8FA8AE 003F 3F UNASSIGNED
+8FA8AF 003F 3F UNASSIGNED
+8FA8B0 003F 3F UNASSIGNED
+8FA8B1 003F 3F UNASSIGNED
+8FA8B2 003F 3F UNASSIGNED
+8FA8B3 003F 3F UNASSIGNED
+8FA8B4 003F 3F UNASSIGNED
+8FA8B5 003F 3F UNASSIGNED
+8FA8B6 003F 3F UNASSIGNED
+8FA8B7 003F 3F UNASSIGNED
+8FA8B8 003F 3F UNASSIGNED
+8FA8B9 003F 3F UNASSIGNED
+8FA8BA 003F 3F UNASSIGNED
+8FA8BB 003F 3F UNASSIGNED
+8FA8BC 003F 3F UNASSIGNED
+8FA8BD 003F 3F UNASSIGNED
+8FA8BE 003F 3F UNASSIGNED
+8FA8BF 003F 3F UNASSIGNED
+8FA8C0 003F 3F UNASSIGNED
+8FA8C1 003F 3F UNASSIGNED
+8FA8C2 003F 3F UNASSIGNED
+8FA8C3 003F 3F UNASSIGNED
+8FA8C4 003F 3F UNASSIGNED
+8FA8C5 003F 3F UNASSIGNED
+8FA8C6 003F 3F UNASSIGNED
+8FA8C7 003F 3F UNASSIGNED
+8FA8C8 003F 3F UNASSIGNED
+8FA8C9 003F 3F UNASSIGNED
+8FA8CA 003F 3F UNASSIGNED
+8FA8CB 003F 3F UNASSIGNED
+8FA8CC 003F 3F UNASSIGNED
+8FA8CD 003F 3F UNASSIGNED
+8FA8CE 003F 3F UNASSIGNED
+8FA8CF 003F 3F UNASSIGNED
+8FA8D0 003F 3F UNASSIGNED
+8FA8D1 003F 3F UNASSIGNED
+8FA8D2 003F 3F UNASSIGNED
+8FA8D3 003F 3F UNASSIGNED
+8FA8D4 003F 3F UNASSIGNED
+8FA8D5 003F 3F UNASSIGNED
+8FA8D6 003F 3F UNASSIGNED
+8FA8D7 003F 3F UNASSIGNED
+8FA8D8 003F 3F UNASSIGNED
+8FA8D9 003F 3F UNASSIGNED
+8FA8DA 003F 3F UNASSIGNED
+8FA8DB 003F 3F UNASSIGNED
+8FA8DC 003F 3F UNASSIGNED
+8FA8DD 003F 3F UNASSIGNED
+8FA8DE 003F 3F UNASSIGNED
+8FA8DF 003F 3F UNASSIGNED
+8FA8E0 003F 3F UNASSIGNED
+8FA8E1 003F 3F UNASSIGNED
+8FA8E2 003F 3F UNASSIGNED
+8FA8E3 003F 3F UNASSIGNED
+8FA8E4 003F 3F UNASSIGNED
+8FA8E5 003F 3F UNASSIGNED
+8FA8E6 003F 3F UNASSIGNED
+8FA8E7 003F 3F UNASSIGNED
+8FA8E8 003F 3F UNASSIGNED
+8FA8E9 003F 3F UNASSIGNED
+8FA8EA 003F 3F UNASSIGNED
+8FA8EB 003F 3F UNASSIGNED
+8FA8EC 003F 3F UNASSIGNED
+8FA8ED 003F 3F UNASSIGNED
+8FA8EE 003F 3F UNASSIGNED
+8FA8EF 003F 3F UNASSIGNED
+8FA8F0 003F 3F UNASSIGNED
+8FA8F1 003F 3F UNASSIGNED
+8FA8F2 003F 3F UNASSIGNED
+8FA8F3 003F 3F UNASSIGNED
+8FA8F4 003F 3F UNASSIGNED
+8FA8F5 003F 3F UNASSIGNED
+8FA8F6 003F 3F UNASSIGNED
+8FA8F7 003F 3F UNASSIGNED
+8FA8F8 003F 3F UNASSIGNED
+8FA8F9 003F 3F UNASSIGNED
+8FA8FA 003F 3F UNASSIGNED
+8FA8FB 003F 3F UNASSIGNED
+8FA8FC 003F 3F UNASSIGNED
+8FA8FD 003F 3F UNASSIGNED
+8FA8FE 003F 3F UNASSIGNED
+8FA9A3 003F 3F UNASSIGNED
+8FA9A5 003F 3F UNASSIGNED
+8FA9A7 003F 3F UNASSIGNED
+8FA9AA 003F 3F UNASSIGNED
+8FA9AE 003F 3F UNASSIGNED
+8FA9B1 003F 3F UNASSIGNED
+8FA9B2 003F 3F UNASSIGNED
+8FA9B3 003F 3F UNASSIGNED
+8FA9B4 003F 3F UNASSIGNED
+8FA9B5 003F 3F UNASSIGNED
+8FA9B6 003F 3F UNASSIGNED
+8FA9B7 003F 3F UNASSIGNED
+8FA9B8 003F 3F UNASSIGNED
+8FA9B9 003F 3F UNASSIGNED
+8FA9BA 003F 3F UNASSIGNED
+8FA9BB 003F 3F UNASSIGNED
+8FA9BC 003F 3F UNASSIGNED
+8FA9BD 003F 3F UNASSIGNED
+8FA9BE 003F 3F UNASSIGNED
+8FA9BF 003F 3F UNASSIGNED
+8FA9C0 003F 3F UNASSIGNED
+8FA9D1 003F 3F UNASSIGNED
+8FA9D2 003F 3F UNASSIGNED
+8FA9D3 003F 3F UNASSIGNED
+8FA9D4 003F 3F UNASSIGNED
+8FA9D5 003F 3F UNASSIGNED
+8FA9D6 003F 3F UNASSIGNED
+8FA9D7 003F 3F UNASSIGNED
+8FA9D8 003F 3F UNASSIGNED
+8FA9D9 003F 3F UNASSIGNED
+8FA9DA 003F 3F UNASSIGNED
+8FA9DB 003F 3F UNASSIGNED
+8FA9DC 003F 3F UNASSIGNED
+8FA9DD 003F 3F UNASSIGNED
+8FA9DE 003F 3F UNASSIGNED
+8FA9DF 003F 3F UNASSIGNED
+8FA9E0 003F 3F UNASSIGNED
+8FA9E1 003F 3F UNASSIGNED
+8FA9E2 003F 3F UNASSIGNED
+8FA9E3 003F 3F UNASSIGNED
+8FA9E4 003F 3F UNASSIGNED
+8FA9E5 003F 3F UNASSIGNED
+8FA9E6 003F 3F UNASSIGNED
+8FA9E7 003F 3F UNASSIGNED
+8FA9E8 003F 3F UNASSIGNED
+8FA9E9 003F 3F UNASSIGNED
+8FA9EA 003F 3F UNASSIGNED
+8FA9EB 003F 3F UNASSIGNED
+8FA9EC 003F 3F UNASSIGNED
+8FA9ED 003F 3F UNASSIGNED
+8FA9EE 003F 3F UNASSIGNED
+8FA9EF 003F 3F UNASSIGNED
+8FA9F0 003F 3F UNASSIGNED
+8FA9F1 003F 3F UNASSIGNED
+8FA9F2 003F 3F UNASSIGNED
+8FA9F3 003F 3F UNASSIGNED
+8FA9F4 003F 3F UNASSIGNED
+8FA9F5 003F 3F UNASSIGNED
+8FA9F6 003F 3F UNASSIGNED
+8FA9F7 003F 3F UNASSIGNED
+8FA9F8 003F 3F UNASSIGNED
+8FA9F9 003F 3F UNASSIGNED
+8FA9FA 003F 3F UNASSIGNED
+8FA9FB 003F 3F UNASSIGNED
+8FA9FC 003F 3F UNASSIGNED
+8FA9FD 003F 3F UNASSIGNED
+8FA9FE 003F 3F UNASSIGNED
+8FAAB9 003F 3F UNASSIGNED
+8FAAF8 003F 3F UNASSIGNED
+8FAAF9 003F 3F UNASSIGNED
+8FAAFA 003F 3F UNASSIGNED
+8FAAFB 003F 3F UNASSIGNED
+8FAAFC 003F 3F UNASSIGNED
+8FAAFD 003F 3F UNASSIGNED
+8FAAFE 003F 3F UNASSIGNED
+8FABBC 003F 3F UNASSIGNED
+8FABC4 003F 3F UNASSIGNED
+8FABF8 003F 3F UNASSIGNED
+8FABF9 003F 3F UNASSIGNED
+8FABFA 003F 3F UNASSIGNED
+8FABFB 003F 3F UNASSIGNED
+8FABFC 003F 3F UNASSIGNED
+8FABFD 003F 3F UNASSIGNED
+8FABFE 003F 3F UNASSIGNED
+8FACA1 003F 3F UNASSIGNED
+8FACA2 003F 3F UNASSIGNED
+8FACA3 003F 3F UNASSIGNED
+8FACA4 003F 3F UNASSIGNED
+8FACA5 003F 3F UNASSIGNED
+8FACA6 003F 3F UNASSIGNED
+8FACA7 003F 3F UNASSIGNED
+8FACA8 003F 3F UNASSIGNED
+8FACA9 003F 3F UNASSIGNED
+8FACAA 003F 3F UNASSIGNED
+8FACAB 003F 3F UNASSIGNED
+8FACAC 003F 3F UNASSIGNED
+8FACAD 003F 3F UNASSIGNED
+8FACAE 003F 3F UNASSIGNED
+8FACAF 003F 3F UNASSIGNED
+8FACB0 003F 3F UNASSIGNED
+8FACB1 003F 3F UNASSIGNED
+8FACB2 003F 3F UNASSIGNED
+8FACB3 003F 3F UNASSIGNED
+8FACB4 003F 3F UNASSIGNED
+8FACB5 003F 3F UNASSIGNED
+8FACB6 003F 3F UNASSIGNED
+8FACB7 003F 3F UNASSIGNED
+8FACB8 003F 3F UNASSIGNED
+8FACB9 003F 3F UNASSIGNED
+8FACBA 003F 3F UNASSIGNED
+8FACBB 003F 3F UNASSIGNED
+8FACBC 003F 3F UNASSIGNED
+8FACBD 003F 3F UNASSIGNED
+8FACBE 003F 3F UNASSIGNED
+8FACBF 003F 3F UNASSIGNED
+8FACC0 003F 3F UNASSIGNED
+8FACC1 003F 3F UNASSIGNED
+8FACC2 003F 3F UNASSIGNED
+8FACC3 003F 3F UNASSIGNED
+8FACC4 003F 3F UNASSIGNED
+8FACC5 003F 3F UNASSIGNED
+8FACC6 003F 3F UNASSIGNED
+8FACC7 003F 3F UNASSIGNED
+8FACC8 003F 3F UNASSIGNED
+8FACC9 003F 3F UNASSIGNED
+8FACCA 003F 3F UNASSIGNED
+8FACCB 003F 3F UNASSIGNED
+8FACCC 003F 3F UNASSIGNED
+8FACCD 003F 3F UNASSIGNED
+8FACCE 003F 3F UNASSIGNED
+8FACCF 003F 3F UNASSIGNED
+8FACD0 003F 3F UNASSIGNED
+8FACD1 003F 3F UNASSIGNED
+8FACD2 003F 3F UNASSIGNED
+8FACD3 003F 3F UNASSIGNED
+8FACD4 003F 3F UNASSIGNED
+8FACD5 003F 3F UNASSIGNED
+8FACD6 003F 3F UNASSIGNED
+8FACD7 003F 3F UNASSIGNED
+8FACD8 003F 3F UNASSIGNED
+8FACD9 003F 3F UNASSIGNED
+8FACDA 003F 3F UNASSIGNED
+8FACDB 003F 3F UNASSIGNED
+8FACDC 003F 3F UNASSIGNED
+8FACDD 003F 3F UNASSIGNED
+8FACDE 003F 3F UNASSIGNED
+8FACDF 003F 3F UNASSIGNED
+8FACE0 003F 3F UNASSIGNED
+8FACE1 003F 3F UNASSIGNED
+8FACE2 003F 3F UNASSIGNED
+8FACE3 003F 3F UNASSIGNED
+8FACE4 003F 3F UNASSIGNED
+8FACE5 003F 3F UNASSIGNED
+8FACE6 003F 3F UNASSIGNED
+8FACE7 003F 3F UNASSIGNED
+8FACE8 003F 3F UNASSIGNED
+8FACE9 003F 3F UNASSIGNED
+8FACEA 003F 3F UNASSIGNED
+8FACEB 003F 3F UNASSIGNED
+8FACEC 003F 3F UNASSIGNED
+8FACED 003F 3F UNASSIGNED
+8FACEE 003F 3F UNASSIGNED
+8FACEF 003F 3F UNASSIGNED
+8FACF0 003F 3F UNASSIGNED
+8FACF1 003F 3F UNASSIGNED
+8FACF2 003F 3F UNASSIGNED
+8FACF3 003F 3F UNASSIGNED
+8FACF4 003F 3F UNASSIGNED
+8FACF5 003F 3F UNASSIGNED
+8FACF6 003F 3F UNASSIGNED
+8FACF7 003F 3F UNASSIGNED
+8FACF8 003F 3F UNASSIGNED
+8FACF9 003F 3F UNASSIGNED
+8FACFA 003F 3F UNASSIGNED
+8FACFB 003F 3F UNASSIGNED
+8FACFC 003F 3F UNASSIGNED
+8FACFD 003F 3F UNASSIGNED
+8FACFE 003F 3F UNASSIGNED
+8FADA1 003F 3F UNASSIGNED
+8FADA2 003F 3F UNASSIGNED
+8FADA3 003F 3F UNASSIGNED
+8FADA4 003F 3F UNASSIGNED
+8FADA5 003F 3F UNASSIGNED
+8FADA6 003F 3F UNASSIGNED
+8FADA7 003F 3F UNASSIGNED
+8FADA8 003F 3F UNASSIGNED
+8FADA9 003F 3F UNASSIGNED
+8FADAA 003F 3F UNASSIGNED
+8FADAB 003F 3F UNASSIGNED
+8FADAC 003F 3F UNASSIGNED
+8FADAD 003F 3F UNASSIGNED
+8FADAE 003F 3F UNASSIGNED
+8FADAF 003F 3F UNASSIGNED
+8FADB0 003F 3F UNASSIGNED
+8FADB1 003F 3F UNASSIGNED
+8FADB2 003F 3F UNASSIGNED
+8FADB3 003F 3F UNASSIGNED
+8FADB4 003F 3F UNASSIGNED
+8FADB5 003F 3F UNASSIGNED
+8FADB6 003F 3F UNASSIGNED
+8FADB7 003F 3F UNASSIGNED
+8FADB8 003F 3F UNASSIGNED
+8FADB9 003F 3F UNASSIGNED
+8FADBA 003F 3F UNASSIGNED
+8FADBB 003F 3F UNASSIGNED
+8FADBC 003F 3F UNASSIGNED
+8FADBD 003F 3F UNASSIGNED
+8FADBE 003F 3F UNASSIGNED
+8FADBF 003F 3F UNASSIGNED
+8FADC0 003F 3F UNASSIGNED
+8FADC1 003F 3F UNASSIGNED
+8FADC2 003F 3F UNASSIGNED
+8FADC3 003F 3F UNASSIGNED
+8FADC4 003F 3F UNASSIGNED
+8FADC5 003F 3F UNASSIGNED
+8FADC6 003F 3F UNASSIGNED
+8FADC7 003F 3F UNASSIGNED
+8FADC8 003F 3F UNASSIGNED
+8FADC9 003F 3F UNASSIGNED
+8FADCA 003F 3F UNASSIGNED
+8FADCB 003F 3F UNASSIGNED
+8FADCC 003F 3F UNASSIGNED
+8FADCD 003F 3F UNASSIGNED
+8FADCE 003F 3F UNASSIGNED
+8FADCF 003F 3F UNASSIGNED
+8FADD0 003F 3F UNASSIGNED
+8FADD1 003F 3F UNASSIGNED
+8FADD2 003F 3F UNASSIGNED
+8FADD3 003F 3F UNASSIGNED
+8FADD4 003F 3F UNASSIGNED
+8FADD5 003F 3F UNASSIGNED
+8FADD6 003F 3F UNASSIGNED
+8FADD7 003F 3F UNASSIGNED
+8FADD8 003F 3F UNASSIGNED
+8FADD9 003F 3F UNASSIGNED
+8FADDA 003F 3F UNASSIGNED
+8FADDB 003F 3F UNASSIGNED
+8FADDC 003F 3F UNASSIGNED
+8FADDD 003F 3F UNASSIGNED
+8FADDE 003F 3F UNASSIGNED
+8FADDF 003F 3F UNASSIGNED
+8FADE0 003F 3F UNASSIGNED
+8FADE1 003F 3F UNASSIGNED
+8FADE2 003F 3F UNASSIGNED
+8FADE3 003F 3F UNASSIGNED
+8FADE4 003F 3F UNASSIGNED
+8FADE5 003F 3F UNASSIGNED
+8FADE6 003F 3F UNASSIGNED
+8FADE7 003F 3F UNASSIGNED
+8FADE8 003F 3F UNASSIGNED
+8FADE9 003F 3F UNASSIGNED
+8FADEA 003F 3F UNASSIGNED
+8FADEB 003F 3F UNASSIGNED
+8FADEC 003F 3F UNASSIGNED
+8FADED 003F 3F UNASSIGNED
+8FADEE 003F 3F UNASSIGNED
+8FADEF 003F 3F UNASSIGNED
+8FADF0 003F 3F UNASSIGNED
+8FADF1 003F 3F UNASSIGNED
+8FADF2 003F 3F UNASSIGNED
+8FADF3 003F 3F UNASSIGNED
+8FADF4 003F 3F UNASSIGNED
+8FADF5 003F 3F UNASSIGNED
+8FADF6 003F 3F UNASSIGNED
+8FADF7 003F 3F UNASSIGNED
+8FADF8 003F 3F UNASSIGNED
+8FADF9 003F 3F UNASSIGNED
+8FADFA 003F 3F UNASSIGNED
+8FADFB 003F 3F UNASSIGNED
+8FADFC 003F 3F UNASSIGNED
+8FADFD 003F 3F UNASSIGNED
+8FADFE 003F 3F UNASSIGNED
+8FAEA1 003F 3F UNASSIGNED
+8FAEA2 003F 3F UNASSIGNED
+8FAEA3 003F 3F UNASSIGNED
+8FAEA4 003F 3F UNASSIGNED
+8FAEA5 003F 3F UNASSIGNED
+8FAEA6 003F 3F UNASSIGNED
+8FAEA7 003F 3F UNASSIGNED
+8FAEA8 003F 3F UNASSIGNED
+8FAEA9 003F 3F UNASSIGNED
+8FAEAA 003F 3F UNASSIGNED
+8FAEAB 003F 3F UNASSIGNED
+8FAEAC 003F 3F UNASSIGNED
+8FAEAD 003F 3F UNASSIGNED
+8FAEAE 003F 3F UNASSIGNED
+8FAEAF 003F 3F UNASSIGNED
+8FAEB0 003F 3F UNASSIGNED
+8FAEB1 003F 3F UNASSIGNED
+8FAEB2 003F 3F UNASSIGNED
+8FAEB3 003F 3F UNASSIGNED
+8FAEB4 003F 3F UNASSIGNED
+8FAEB5 003F 3F UNASSIGNED
+8FAEB6 003F 3F UNASSIGNED
+8FAEB7 003F 3F UNASSIGNED
+8FAEB8 003F 3F UNASSIGNED
+8FAEB9 003F 3F UNASSIGNED
+8FAEBA 003F 3F UNASSIGNED
+8FAEBB 003F 3F UNASSIGNED
+8FAEBC 003F 3F UNASSIGNED
+8FAEBD 003F 3F UNASSIGNED
+8FAEBE 003F 3F UNASSIGNED
+8FAEBF 003F 3F UNASSIGNED
+8FAEC0 003F 3F UNASSIGNED
+8FAEC1 003F 3F UNASSIGNED
+8FAEC2 003F 3F UNASSIGNED
+8FAEC3 003F 3F UNASSIGNED
+8FAEC4 003F 3F UNASSIGNED
+8FAEC5 003F 3F UNASSIGNED
+8FAEC6 003F 3F UNASSIGNED
+8FAEC7 003F 3F UNASSIGNED
+8FAEC8 003F 3F UNASSIGNED
+8FAEC9 003F 3F UNASSIGNED
+8FAECA 003F 3F UNASSIGNED
+8FAECB 003F 3F UNASSIGNED
+8FAECC 003F 3F UNASSIGNED
+8FAECD 003F 3F UNASSIGNED
+8FAECE 003F 3F UNASSIGNED
+8FAECF 003F 3F UNASSIGNED
+8FAED0 003F 3F UNASSIGNED
+8FAED1 003F 3F UNASSIGNED
+8FAED2 003F 3F UNASSIGNED
+8FAED3 003F 3F UNASSIGNED
+8FAED4 003F 3F UNASSIGNED
+8FAED5 003F 3F UNASSIGNED
+8FAED6 003F 3F UNASSIGNED
+8FAED7 003F 3F UNASSIGNED
+8FAED8 003F 3F UNASSIGNED
+8FAED9 003F 3F UNASSIGNED
+8FAEDA 003F 3F UNASSIGNED
+8FAEDB 003F 3F UNASSIGNED
+8FAEDC 003F 3F UNASSIGNED
+8FAEDD 003F 3F UNASSIGNED
+8FAEDE 003F 3F UNASSIGNED
+8FAEDF 003F 3F UNASSIGNED
+8FAEE0 003F 3F UNASSIGNED
+8FAEE1 003F 3F UNASSIGNED
+8FAEE2 003F 3F UNASSIGNED
+8FAEE3 003F 3F UNASSIGNED
+8FAEE4 003F 3F UNASSIGNED
+8FAEE5 003F 3F UNASSIGNED
+8FAEE6 003F 3F UNASSIGNED
+8FAEE7 003F 3F UNASSIGNED
+8FAEE8 003F 3F UNASSIGNED
+8FAEE9 003F 3F UNASSIGNED
+8FAEEA 003F 3F UNASSIGNED
+8FAEEB 003F 3F UNASSIGNED
+8FAEEC 003F 3F UNASSIGNED
+8FAEED 003F 3F UNASSIGNED
+8FAEEE 003F 3F UNASSIGNED
+8FAEEF 003F 3F UNASSIGNED
+8FAEF0 003F 3F UNASSIGNED
+8FAEF1 003F 3F UNASSIGNED
+8FAEF2 003F 3F UNASSIGNED
+8FAEF3 003F 3F UNASSIGNED
+8FAEF4 003F 3F UNASSIGNED
+8FAEF5 003F 3F UNASSIGNED
+8FAEF6 003F 3F UNASSIGNED
+8FAEF7 003F 3F UNASSIGNED
+8FAEF8 003F 3F UNASSIGNED
+8FAEF9 003F 3F UNASSIGNED
+8FAEFA 003F 3F UNASSIGNED
+8FAEFB 003F 3F UNASSIGNED
+8FAEFC 003F 3F UNASSIGNED
+8FAEFD 003F 3F UNASSIGNED
+8FAEFE 003F 3F UNASSIGNED
+8FAFA1 003F 3F UNASSIGNED
+8FAFA2 003F 3F UNASSIGNED
+8FAFA3 003F 3F UNASSIGNED
+8FAFA4 003F 3F UNASSIGNED
+8FAFA5 003F 3F UNASSIGNED
+8FAFA6 003F 3F UNASSIGNED
+8FAFA7 003F 3F UNASSIGNED
+8FAFA8 003F 3F UNASSIGNED
+8FAFA9 003F 3F UNASSIGNED
+8FAFAA 003F 3F UNASSIGNED
+8FAFAB 003F 3F UNASSIGNED
+8FAFAC 003F 3F UNASSIGNED
+8FAFAD 003F 3F UNASSIGNED
+8FAFAE 003F 3F UNASSIGNED
+8FAFAF 003F 3F UNASSIGNED
+8FAFB0 003F 3F UNASSIGNED
+8FAFB1 003F 3F UNASSIGNED
+8FAFB2 003F 3F UNASSIGNED
+8FAFB3 003F 3F UNASSIGNED
+8FAFB4 003F 3F UNASSIGNED
+8FAFB5 003F 3F UNASSIGNED
+8FAFB6 003F 3F UNASSIGNED
+8FAFB7 003F 3F UNASSIGNED
+8FAFB8 003F 3F UNASSIGNED
+8FAFB9 003F 3F UNASSIGNED
+8FAFBA 003F 3F UNASSIGNED
+8FAFBB 003F 3F UNASSIGNED
+8FAFBC 003F 3F UNASSIGNED
+8FAFBD 003F 3F UNASSIGNED
+8FAFBE 003F 3F UNASSIGNED
+8FAFBF 003F 3F UNASSIGNED
+8FAFC0 003F 3F UNASSIGNED
+8FAFC1 003F 3F UNASSIGNED
+8FAFC2 003F 3F UNASSIGNED
+8FAFC3 003F 3F UNASSIGNED
+8FAFC4 003F 3F UNASSIGNED
+8FAFC5 003F 3F UNASSIGNED
+8FAFC6 003F 3F UNASSIGNED
+8FAFC7 003F 3F UNASSIGNED
+8FAFC8 003F 3F UNASSIGNED
+8FAFC9 003F 3F UNASSIGNED
+8FAFCA 003F 3F UNASSIGNED
+8FAFCB 003F 3F UNASSIGNED
+8FAFCC 003F 3F UNASSIGNED
+8FAFCD 003F 3F UNASSIGNED
+8FAFCE 003F 3F UNASSIGNED
+8FAFCF 003F 3F UNASSIGNED
+8FAFD0 003F 3F UNASSIGNED
+8FAFD1 003F 3F UNASSIGNED
+8FAFD2 003F 3F UNASSIGNED
+8FAFD3 003F 3F UNASSIGNED
+8FAFD4 003F 3F UNASSIGNED
+8FAFD5 003F 3F UNASSIGNED
+8FAFD6 003F 3F UNASSIGNED
+8FAFD7 003F 3F UNASSIGNED
+8FAFD8 003F 3F UNASSIGNED
+8FAFD9 003F 3F UNASSIGNED
+8FAFDA 003F 3F UNASSIGNED
+8FAFDB 003F 3F UNASSIGNED
+8FAFDC 003F 3F UNASSIGNED
+8FAFDD 003F 3F UNASSIGNED
+8FAFDE 003F 3F UNASSIGNED
+8FAFDF 003F 3F UNASSIGNED
+8FAFE0 003F 3F UNASSIGNED
+8FAFE1 003F 3F UNASSIGNED
+8FAFE2 003F 3F UNASSIGNED
+8FAFE3 003F 3F UNASSIGNED
+8FAFE4 003F 3F UNASSIGNED
+8FAFE5 003F 3F UNASSIGNED
+8FAFE6 003F 3F UNASSIGNED
+8FAFE7 003F 3F UNASSIGNED
+8FAFE8 003F 3F UNASSIGNED
+8FAFE9 003F 3F UNASSIGNED
+8FAFEA 003F 3F UNASSIGNED
+8FAFEB 003F 3F UNASSIGNED
+8FAFEC 003F 3F UNASSIGNED
+8FAFED 003F 3F UNASSIGNED
+8FAFEE 003F 3F UNASSIGNED
+8FAFEF 003F 3F UNASSIGNED
+8FAFF0 003F 3F UNASSIGNED
+8FAFF1 003F 3F UNASSIGNED
+8FAFF2 003F 3F UNASSIGNED
+8FAFF3 003F 3F UNASSIGNED
+8FAFF4 003F 3F UNASSIGNED
+8FAFF5 003F 3F UNASSIGNED
+8FAFF6 003F 3F UNASSIGNED
+8FAFF7 003F 3F UNASSIGNED
+8FAFF8 003F 3F UNASSIGNED
+8FAFF9 003F 3F UNASSIGNED
+8FAFFA 003F 3F UNASSIGNED
+8FAFFB 003F 3F UNASSIGNED
+8FAFFC 003F 3F UNASSIGNED
+8FAFFD 003F 3F UNASSIGNED
+8FAFFE 003F 3F UNASSIGNED
+8FEDE4 003F 3F UNASSIGNED
+8FEDE5 003F 3F UNASSIGNED
+8FEDE6 003F 3F UNASSIGNED
+8FEDE7 003F 3F UNASSIGNED
+8FEDE8 003F 3F UNASSIGNED
+8FEDE9 003F 3F UNASSIGNED
+8FEDEA 003F 3F UNASSIGNED
+8FEDEB 003F 3F UNASSIGNED
+8FEDEC 003F 3F UNASSIGNED
+8FEDED 003F 3F UNASSIGNED
+8FEDEE 003F 3F UNASSIGNED
+8FEDEF 003F 3F UNASSIGNED
+8FEDF0 003F 3F UNASSIGNED
+8FEDF1 003F 3F UNASSIGNED
+8FEDF2 003F 3F UNASSIGNED
+8FEDF3 003F 3F UNASSIGNED
+8FEDF4 003F 3F UNASSIGNED
+8FEDF5 003F 3F UNASSIGNED
+8FEDF6 003F 3F UNASSIGNED
+8FEDF7 003F 3F UNASSIGNED
+8FEDF8 003F 3F UNASSIGNED
+8FEDF9 003F 3F UNASSIGNED
+8FEDFA 003F 3F UNASSIGNED
+8FEDFB 003F 3F UNASSIGNED
+8FEDFC 003F 3F UNASSIGNED
+8FEDFD 003F 3F UNASSIGNED
+8FEDFE 003F 3F UNASSIGNED
+8FEEA1 003F 3F UNASSIGNED
+8FEEA2 003F 3F UNASSIGNED
+8FEEA3 003F 3F UNASSIGNED
+8FEEA4 003F 3F UNASSIGNED
+8FEEA5 003F 3F UNASSIGNED
+8FEEA6 003F 3F UNASSIGNED
+8FEEA7 003F 3F UNASSIGNED
+8FEEA8 003F 3F UNASSIGNED
+8FEEA9 003F 3F UNASSIGNED
+8FEEAA 003F 3F UNASSIGNED
+8FEEAB 003F 3F UNASSIGNED
+8FEEAC 003F 3F UNASSIGNED
+8FEEAD 003F 3F UNASSIGNED
+8FEEAE 003F 3F UNASSIGNED
+8FEEAF 003F 3F UNASSIGNED
+8FEEB0 003F 3F UNASSIGNED
+8FEEB1 003F 3F UNASSIGNED
+8FEEB2 003F 3F UNASSIGNED
+8FEEB3 003F 3F UNASSIGNED
+8FEEB4 003F 3F UNASSIGNED
+8FEEB5 003F 3F UNASSIGNED
+8FEEB6 003F 3F UNASSIGNED
+8FEEB7 003F 3F UNASSIGNED
+8FEEB8 003F 3F UNASSIGNED
+8FEEB9 003F 3F UNASSIGNED
+8FEEBA 003F 3F UNASSIGNED
+8FEEBB 003F 3F UNASSIGNED
+8FEEBC 003F 3F UNASSIGNED
+8FEEBD 003F 3F UNASSIGNED
+8FEEBE 003F 3F UNASSIGNED
+8FEEBF 003F 3F UNASSIGNED
+8FEEC0 003F 3F UNASSIGNED
+8FEEC1 003F 3F UNASSIGNED
+8FEEC2 003F 3F UNASSIGNED
+8FEEC3 003F 3F UNASSIGNED
+8FEEC4 003F 3F UNASSIGNED
+8FEEC5 003F 3F UNASSIGNED
+8FEEC6 003F 3F UNASSIGNED
+8FEEC7 003F 3F UNASSIGNED
+8FEEC8 003F 3F UNASSIGNED
+8FEEC9 003F 3F UNASSIGNED
+8FEECA 003F 3F UNASSIGNED
+8FEECB 003F 3F UNASSIGNED
+8FEECC 003F 3F UNASSIGNED
+8FEECD 003F 3F UNASSIGNED
+8FEECE 003F 3F UNASSIGNED
+8FEECF 003F 3F UNASSIGNED
+8FEED0 003F 3F UNASSIGNED
+8FEED1 003F 3F UNASSIGNED
+8FEED2 003F 3F UNASSIGNED
+8FEED3 003F 3F UNASSIGNED
+8FEED4 003F 3F UNASSIGNED
+8FEED5 003F 3F UNASSIGNED
+8FEED6 003F 3F UNASSIGNED
+8FEED7 003F 3F UNASSIGNED
+8FEED8 003F 3F UNASSIGNED
+8FEED9 003F 3F UNASSIGNED
+8FEEDA 003F 3F UNASSIGNED
+8FEEDB 003F 3F UNASSIGNED
+8FEEDC 003F 3F UNASSIGNED
+8FEEDD 003F 3F UNASSIGNED
+8FEEDE 003F 3F UNASSIGNED
+8FEEDF 003F 3F UNASSIGNED
+8FEEE0 003F 3F UNASSIGNED
+8FEEE1 003F 3F UNASSIGNED
+8FEEE2 003F 3F UNASSIGNED
+8FEEE3 003F 3F UNASSIGNED
+8FEEE4 003F 3F UNASSIGNED
+8FEEE5 003F 3F UNASSIGNED
+8FEEE6 003F 3F UNASSIGNED
+8FEEE7 003F 3F UNASSIGNED
+8FEEE8 003F 3F UNASSIGNED
+8FEEE9 003F 3F UNASSIGNED
+8FEEEA 003F 3F UNASSIGNED
+8FEEEB 003F 3F UNASSIGNED
+8FEEEC 003F 3F UNASSIGNED
+8FEEED 003F 3F UNASSIGNED
+8FEEEE 003F 3F UNASSIGNED
+8FEEEF 003F 3F UNASSIGNED
+8FEEF0 003F 3F UNASSIGNED
+8FEEF1 003F 3F UNASSIGNED
+8FEEF2 003F 3F UNASSIGNED
+8FEEF3 003F 3F UNASSIGNED
+8FEEF4 003F 3F UNASSIGNED
+8FEEF5 003F 3F UNASSIGNED
+8FEEF6 003F 3F UNASSIGNED
+8FEEF7 003F 3F UNASSIGNED
+8FEEF8 003F 3F UNASSIGNED
+8FEEF9 003F 3F UNASSIGNED
+8FEEFA 003F 3F UNASSIGNED
+8FEEFB 003F 3F UNASSIGNED
+8FEEFC 003F 3F UNASSIGNED
+8FEEFD 003F 3F UNASSIGNED
+8FEEFE 003F 3F UNASSIGNED
+8FEFA1 003F 3F UNASSIGNED
+8FEFA2 003F 3F UNASSIGNED
+8FEFA3 003F 3F UNASSIGNED
+8FEFA4 003F 3F UNASSIGNED
+8FEFA5 003F 3F UNASSIGNED
+8FEFA6 003F 3F UNASSIGNED
+8FEFA7 003F 3F UNASSIGNED
+8FEFA8 003F 3F UNASSIGNED
+8FEFA9 003F 3F UNASSIGNED
+8FEFAA 003F 3F UNASSIGNED
+8FEFAB 003F 3F UNASSIGNED
+8FEFAC 003F 3F UNASSIGNED
+8FEFAD 003F 3F UNASSIGNED
+8FEFAE 003F 3F UNASSIGNED
+8FEFAF 003F 3F UNASSIGNED
+8FEFB0 003F 3F UNASSIGNED
+8FEFB1 003F 3F UNASSIGNED
+8FEFB2 003F 3F UNASSIGNED
+8FEFB3 003F 3F UNASSIGNED
+8FEFB4 003F 3F UNASSIGNED
+8FEFB5 003F 3F UNASSIGNED
+8FEFB6 003F 3F UNASSIGNED
+8FEFB7 003F 3F UNASSIGNED
+8FEFB8 003F 3F UNASSIGNED
+8FEFB9 003F 3F UNASSIGNED
+8FEFBA 003F 3F UNASSIGNED
+8FEFBB 003F 3F UNASSIGNED
+8FEFBC 003F 3F UNASSIGNED
+8FEFBD 003F 3F UNASSIGNED
+8FEFBE 003F 3F UNASSIGNED
+8FEFBF 003F 3F UNASSIGNED
+8FEFC0 003F 3F UNASSIGNED
+8FEFC1 003F 3F UNASSIGNED
+8FEFC2 003F 3F UNASSIGNED
+8FEFC3 003F 3F UNASSIGNED
+8FEFC4 003F 3F UNASSIGNED
+8FEFC5 003F 3F UNASSIGNED
+8FEFC6 003F 3F UNASSIGNED
+8FEFC7 003F 3F UNASSIGNED
+8FEFC8 003F 3F UNASSIGNED
+8FEFC9 003F 3F UNASSIGNED
+8FEFCA 003F 3F UNASSIGNED
+8FEFCB 003F 3F UNASSIGNED
+8FEFCC 003F 3F UNASSIGNED
+8FEFCD 003F 3F UNASSIGNED
+8FEFCE 003F 3F UNASSIGNED
+8FEFCF 003F 3F UNASSIGNED
+8FEFD0 003F 3F UNASSIGNED
+8FEFD1 003F 3F UNASSIGNED
+8FEFD2 003F 3F UNASSIGNED
+8FEFD3 003F 3F UNASSIGNED
+8FEFD4 003F 3F UNASSIGNED
+8FEFD5 003F 3F UNASSIGNED
+8FEFD6 003F 3F UNASSIGNED
+8FEFD7 003F 3F UNASSIGNED
+8FEFD8 003F 3F UNASSIGNED
+8FEFD9 003F 3F UNASSIGNED
+8FEFDA 003F 3F UNASSIGNED
+8FEFDB 003F 3F UNASSIGNED
+8FEFDC 003F 3F UNASSIGNED
+8FEFDD 003F 3F UNASSIGNED
+8FEFDE 003F 3F UNASSIGNED
+8FEFDF 003F 3F UNASSIGNED
+8FEFE0 003F 3F UNASSIGNED
+8FEFE1 003F 3F UNASSIGNED
+8FEFE2 003F 3F UNASSIGNED
+8FEFE3 003F 3F UNASSIGNED
+8FEFE4 003F 3F UNASSIGNED
+8FEFE5 003F 3F UNASSIGNED
+8FEFE6 003F 3F UNASSIGNED
+8FEFE7 003F 3F UNASSIGNED
+8FEFE8 003F 3F UNASSIGNED
+8FEFE9 003F 3F UNASSIGNED
+8FEFEA 003F 3F UNASSIGNED
+8FEFEB 003F 3F UNASSIGNED
+8FEFEC 003F 3F UNASSIGNED
+8FEFED 003F 3F UNASSIGNED
+8FEFEE 003F 3F UNASSIGNED
+8FEFEF 003F 3F UNASSIGNED
+8FEFF0 003F 3F UNASSIGNED
+8FEFF1 003F 3F UNASSIGNED
+8FEFF2 003F 3F UNASSIGNED
+8FEFF3 003F 3F UNASSIGNED
+8FEFF4 003F 3F UNASSIGNED
+8FEFF5 003F 3F UNASSIGNED
+8FEFF6 003F 3F UNASSIGNED
+8FEFF7 003F 3F UNASSIGNED
+8FEFF8 003F 3F UNASSIGNED
+8FEFF9 003F 3F UNASSIGNED
+8FEFFA 003F 3F UNASSIGNED
+8FEFFB 003F 3F UNASSIGNED
+8FEFFC 003F 3F UNASSIGNED
+8FEFFD 003F 3F UNASSIGNED
+8FEFFE 003F 3F UNASSIGNED
+8FF0A1 003F 3F UNASSIGNED
+8FF0A2 003F 3F UNASSIGNED
+8FF0A3 003F 3F UNASSIGNED
+8FF0A4 003F 3F UNASSIGNED
+8FF0A5 003F 3F UNASSIGNED
+8FF0A6 003F 3F UNASSIGNED
+8FF0A7 003F 3F UNASSIGNED
+8FF0A8 003F 3F UNASSIGNED
+8FF0A9 003F 3F UNASSIGNED
+8FF0AA 003F 3F UNASSIGNED
+8FF0AB 003F 3F UNASSIGNED
+8FF0AC 003F 3F UNASSIGNED
+8FF0AD 003F 3F UNASSIGNED
+8FF0AE 003F 3F UNASSIGNED
+8FF0AF 003F 3F UNASSIGNED
+8FF0B0 003F 3F UNASSIGNED
+8FF0B1 003F 3F UNASSIGNED
+8FF0B2 003F 3F UNASSIGNED
+8FF0B3 003F 3F UNASSIGNED
+8FF0B4 003F 3F UNASSIGNED
+8FF0B5 003F 3F UNASSIGNED
+8FF0B6 003F 3F UNASSIGNED
+8FF0B7 003F 3F UNASSIGNED
+8FF0B8 003F 3F UNASSIGNED
+8FF0B9 003F 3F UNASSIGNED
+8FF0BA 003F 3F UNASSIGNED
+8FF0BB 003F 3F UNASSIGNED
+8FF0BC 003F 3F UNASSIGNED
+8FF0BD 003F 3F UNASSIGNED
+8FF0BE 003F 3F UNASSIGNED
+8FF0BF 003F 3F UNASSIGNED
+8FF0C0 003F 3F UNASSIGNED
+8FF0C1 003F 3F UNASSIGNED
+8FF0C2 003F 3F UNASSIGNED
+8FF0C3 003F 3F UNASSIGNED
+8FF0C4 003F 3F UNASSIGNED
+8FF0C5 003F 3F UNASSIGNED
+8FF0C6 003F 3F UNASSIGNED
+8FF0C7 003F 3F UNASSIGNED
+8FF0C8 003F 3F UNASSIGNED
+8FF0C9 003F 3F UNASSIGNED
+8FF0CA 003F 3F UNASSIGNED
+8FF0CB 003F 3F UNASSIGNED
+8FF0CC 003F 3F UNASSIGNED
+8FF0CD 003F 3F UNASSIGNED
+8FF0CE 003F 3F UNASSIGNED
+8FF0CF 003F 3F UNASSIGNED
+8FF0D0 003F 3F UNASSIGNED
+8FF0D1 003F 3F UNASSIGNED
+8FF0D2 003F 3F UNASSIGNED
+8FF0D3 003F 3F UNASSIGNED
+8FF0D4 003F 3F UNASSIGNED
+8FF0D5 003F 3F UNASSIGNED
+8FF0D6 003F 3F UNASSIGNED
+8FF0D7 003F 3F UNASSIGNED
+8FF0D8 003F 3F UNASSIGNED
+8FF0D9 003F 3F UNASSIGNED
+8FF0DA 003F 3F UNASSIGNED
+8FF0DB 003F 3F UNASSIGNED
+8FF0DC 003F 3F UNASSIGNED
+8FF0DD 003F 3F UNASSIGNED
+8FF0DE 003F 3F UNASSIGNED
+8FF0DF 003F 3F UNASSIGNED
+8FF0E0 003F 3F UNASSIGNED
+8FF0E1 003F 3F UNASSIGNED
+8FF0E2 003F 3F UNASSIGNED
+8FF0E3 003F 3F UNASSIGNED
+8FF0E4 003F 3F UNASSIGNED
+8FF0E5 003F 3F UNASSIGNED
+8FF0E6 003F 3F UNASSIGNED
+8FF0E7 003F 3F UNASSIGNED
+8FF0E8 003F 3F UNASSIGNED
+8FF0E9 003F 3F UNASSIGNED
+8FF0EA 003F 3F UNASSIGNED
+8FF0EB 003F 3F UNASSIGNED
+8FF0EC 003F 3F UNASSIGNED
+8FF0ED 003F 3F UNASSIGNED
+8FF0EE 003F 3F UNASSIGNED
+8FF0EF 003F 3F UNASSIGNED
+8FF0F0 003F 3F UNASSIGNED
+8FF0F1 003F 3F UNASSIGNED
+8FF0F2 003F 3F UNASSIGNED
+8FF0F3 003F 3F UNASSIGNED
+8FF0F4 003F 3F UNASSIGNED
+8FF0F5 003F 3F UNASSIGNED
+8FF0F6 003F 3F UNASSIGNED
+8FF0F7 003F 3F UNASSIGNED
+8FF0F8 003F 3F UNASSIGNED
+8FF0F9 003F 3F UNASSIGNED
+8FF0FA 003F 3F UNASSIGNED
+8FF0FB 003F 3F UNASSIGNED
+8FF0FC 003F 3F UNASSIGNED
+8FF0FD 003F 3F UNASSIGNED
+8FF0FE 003F 3F UNASSIGNED
+8FF1A1 003F 3F UNASSIGNED
+8FF1A2 003F 3F UNASSIGNED
+8FF1A3 003F 3F UNASSIGNED
+8FF1A4 003F 3F UNASSIGNED
+8FF1A5 003F 3F UNASSIGNED
+8FF1A6 003F 3F UNASSIGNED
+8FF1A7 003F 3F UNASSIGNED
+8FF1A8 003F 3F UNASSIGNED
+8FF1A9 003F 3F UNASSIGNED
+8FF1AA 003F 3F UNASSIGNED
+8FF1AB 003F 3F UNASSIGNED
+8FF1AC 003F 3F UNASSIGNED
+8FF1AD 003F 3F UNASSIGNED
+8FF1AE 003F 3F UNASSIGNED
+8FF1AF 003F 3F UNASSIGNED
+8FF1B0 003F 3F UNASSIGNED
+8FF1B1 003F 3F UNASSIGNED
+8FF1B2 003F 3F UNASSIGNED
+8FF1B3 003F 3F UNASSIGNED
+8FF1B4 003F 3F UNASSIGNED
+8FF1B5 003F 3F UNASSIGNED
+8FF1B6 003F 3F UNASSIGNED
+8FF1B7 003F 3F UNASSIGNED
+8FF1B8 003F 3F UNASSIGNED
+8FF1B9 003F 3F UNASSIGNED
+8FF1BA 003F 3F UNASSIGNED
+8FF1BB 003F 3F UNASSIGNED
+8FF1BC 003F 3F UNASSIGNED
+8FF1BD 003F 3F UNASSIGNED
+8FF1BE 003F 3F UNASSIGNED
+8FF1BF 003F 3F UNASSIGNED
+8FF1C0 003F 3F UNASSIGNED
+8FF1C1 003F 3F UNASSIGNED
+8FF1C2 003F 3F UNASSIGNED
+8FF1C3 003F 3F UNASSIGNED
+8FF1C4 003F 3F UNASSIGNED
+8FF1C5 003F 3F UNASSIGNED
+8FF1C6 003F 3F UNASSIGNED
+8FF1C7 003F 3F UNASSIGNED
+8FF1C8 003F 3F UNASSIGNED
+8FF1C9 003F 3F UNASSIGNED
+8FF1CA 003F 3F UNASSIGNED
+8FF1CB 003F 3F UNASSIGNED
+8FF1CC 003F 3F UNASSIGNED
+8FF1CD 003F 3F UNASSIGNED
+8FF1CE 003F 3F UNASSIGNED
+8FF1CF 003F 3F UNASSIGNED
+8FF1D0 003F 3F UNASSIGNED
+8FF1D1 003F 3F UNASSIGNED
+8FF1D2 003F 3F UNASSIGNED
+8FF1D3 003F 3F UNASSIGNED
+8FF1D4 003F 3F UNASSIGNED
+8FF1D5 003F 3F UNASSIGNED
+8FF1D6 003F 3F UNASSIGNED
+8FF1D7 003F 3F UNASSIGNED
+8FF1D8 003F 3F UNASSIGNED
+8FF1D9 003F 3F UNASSIGNED
+8FF1DA 003F 3F UNASSIGNED
+8FF1DB 003F 3F UNASSIGNED
+8FF1DC 003F 3F UNASSIGNED
+8FF1DD 003F 3F UNASSIGNED
+8FF1DE 003F 3F UNASSIGNED
+8FF1DF 003F 3F UNASSIGNED
+8FF1E0 003F 3F UNASSIGNED
+8FF1E1 003F 3F UNASSIGNED
+8FF1E2 003F 3F UNASSIGNED
+8FF1E3 003F 3F UNASSIGNED
+8FF1E4 003F 3F UNASSIGNED
+8FF1E5 003F 3F UNASSIGNED
+8FF1E6 003F 3F UNASSIGNED
+8FF1E7 003F 3F UNASSIGNED
+8FF1E8 003F 3F UNASSIGNED
+8FF1E9 003F 3F UNASSIGNED
+8FF1EA 003F 3F UNASSIGNED
+8FF1EB 003F 3F UNASSIGNED
+8FF1EC 003F 3F UNASSIGNED
+8FF1ED 003F 3F UNASSIGNED
+8FF1EE 003F 3F UNASSIGNED
+8FF1EF 003F 3F UNASSIGNED
+8FF1F0 003F 3F UNASSIGNED
+8FF1F1 003F 3F UNASSIGNED
+8FF1F2 003F 3F UNASSIGNED
+8FF1F3 003F 3F UNASSIGNED
+8FF1F4 003F 3F UNASSIGNED
+8FF1F5 003F 3F UNASSIGNED
+8FF1F6 003F 3F UNASSIGNED
+8FF1F7 003F 3F UNASSIGNED
+8FF1F8 003F 3F UNASSIGNED
+8FF1F9 003F 3F UNASSIGNED
+8FF1FA 003F 3F UNASSIGNED
+8FF1FB 003F 3F UNASSIGNED
+8FF1FC 003F 3F UNASSIGNED
+8FF1FD 003F 3F UNASSIGNED
+8FF1FE 003F 3F UNASSIGNED
+8FF2A1 003F 3F UNASSIGNED
+8FF2A2 003F 3F UNASSIGNED
+8FF2A3 003F 3F UNASSIGNED
+8FF2A4 003F 3F UNASSIGNED
+8FF2A5 003F 3F UNASSIGNED
+8FF2A6 003F 3F UNASSIGNED
+8FF2A7 003F 3F UNASSIGNED
+8FF2A8 003F 3F UNASSIGNED
+8FF2A9 003F 3F UNASSIGNED
+8FF2AA 003F 3F UNASSIGNED
+8FF2AB 003F 3F UNASSIGNED
+8FF2AC 003F 3F UNASSIGNED
+8FF2AD 003F 3F UNASSIGNED
+8FF2AE 003F 3F UNASSIGNED
+8FF2AF 003F 3F UNASSIGNED
+8FF2B0 003F 3F UNASSIGNED
+8FF2B1 003F 3F UNASSIGNED
+8FF2B2 003F 3F UNASSIGNED
+8FF2B3 003F 3F UNASSIGNED
+8FF2B4 003F 3F UNASSIGNED
+8FF2B5 003F 3F UNASSIGNED
+8FF2B6 003F 3F UNASSIGNED
+8FF2B7 003F 3F UNASSIGNED
+8FF2B8 003F 3F UNASSIGNED
+8FF2B9 003F 3F UNASSIGNED
+8FF2BA 003F 3F UNASSIGNED
+8FF2BB 003F 3F UNASSIGNED
+8FF2BC 003F 3F UNASSIGNED
+8FF2BD 003F 3F UNASSIGNED
+8FF2BE 003F 3F UNASSIGNED
+8FF2BF 003F 3F UNASSIGNED
+8FF2C0 003F 3F UNASSIGNED
+8FF2C1 003F 3F UNASSIGNED
+8FF2C2 003F 3F UNASSIGNED
+8FF2C3 003F 3F UNASSIGNED
+8FF2C4 003F 3F UNASSIGNED
+8FF2C5 003F 3F UNASSIGNED
+8FF2C6 003F 3F UNASSIGNED
+8FF2C7 003F 3F UNASSIGNED
+8FF2C8 003F 3F UNASSIGNED
+8FF2C9 003F 3F UNASSIGNED
+8FF2CA 003F 3F UNASSIGNED
+8FF2CB 003F 3F UNASSIGNED
+8FF2CC 003F 3F UNASSIGNED
+8FF2CD 003F 3F UNASSIGNED
+8FF2CE 003F 3F UNASSIGNED
+8FF2CF 003F 3F UNASSIGNED
+8FF2D0 003F 3F UNASSIGNED
+8FF2D1 003F 3F UNASSIGNED
+8FF2D2 003F 3F UNASSIGNED
+8FF2D3 003F 3F UNASSIGNED
+8FF2D4 003F 3F UNASSIGNED
+8FF2D5 003F 3F UNASSIGNED
+8FF2D6 003F 3F UNASSIGNED
+8FF2D7 003F 3F UNASSIGNED
+8FF2D8 003F 3F UNASSIGNED
+8FF2D9 003F 3F UNASSIGNED
+8FF2DA 003F 3F UNASSIGNED
+8FF2DB 003F 3F UNASSIGNED
+8FF2DC 003F 3F UNASSIGNED
+8FF2DD 003F 3F UNASSIGNED
+8FF2DE 003F 3F UNASSIGNED
+8FF2DF 003F 3F UNASSIGNED
+8FF2E0 003F 3F UNASSIGNED
+8FF2E1 003F 3F UNASSIGNED
+8FF2E2 003F 3F UNASSIGNED
+8FF2E3 003F 3F UNASSIGNED
+8FF2E4 003F 3F UNASSIGNED
+8FF2E5 003F 3F UNASSIGNED
+8FF2E6 003F 3F UNASSIGNED
+8FF2E7 003F 3F UNASSIGNED
+8FF2E8 003F 3F UNASSIGNED
+8FF2E9 003F 3F UNASSIGNED
+8FF2EA 003F 3F UNASSIGNED
+8FF2EB 003F 3F UNASSIGNED
+8FF2EC 003F 3F UNASSIGNED
+8FF2ED 003F 3F UNASSIGNED
+8FF2EE 003F 3F UNASSIGNED
+8FF2EF 003F 3F UNASSIGNED
+8FF2F0 003F 3F UNASSIGNED
+8FF2F1 003F 3F UNASSIGNED
+8FF2F2 003F 3F UNASSIGNED
+8FF2F3 003F 3F UNASSIGNED
+8FF2F4 003F 3F UNASSIGNED
+8FF2F5 003F 3F UNASSIGNED
+8FF2F6 003F 3F UNASSIGNED
+8FF2F7 003F 3F UNASSIGNED
+8FF2F8 003F 3F UNASSIGNED
+8FF2F9 003F 3F UNASSIGNED
+8FF2FA 003F 3F UNASSIGNED
+8FF2FB 003F 3F UNASSIGNED
+8FF2FC 003F 3F UNASSIGNED
+8FF2FD 003F 3F UNASSIGNED
+8FF2FE 003F 3F UNASSIGNED
+8FF3A1 003F 3F UNASSIGNED
+8FF3A2 003F 3F UNASSIGNED
+8FF3A3 003F 3F UNASSIGNED
+8FF3A4 003F 3F UNASSIGNED
+8FF3A5 003F 3F UNASSIGNED
+8FF3A6 003F 3F UNASSIGNED
+8FF3A7 003F 3F UNASSIGNED
+8FF3A8 003F 3F UNASSIGNED
+8FF3A9 003F 3F UNASSIGNED
+8FF3AA 003F 3F UNASSIGNED
+8FF3AB 003F 3F UNASSIGNED
+8FF3AC 003F 3F UNASSIGNED
+8FF3AD 003F 3F UNASSIGNED
+8FF3AE 003F 3F UNASSIGNED
+8FF3AF 003F 3F UNASSIGNED
+8FF3B0 003F 3F UNASSIGNED
+8FF3B1 003F 3F UNASSIGNED
+8FF3B2 003F 3F UNASSIGNED
+8FF3B3 003F 3F UNASSIGNED
+8FF3B4 003F 3F UNASSIGNED
+8FF3B5 003F 3F UNASSIGNED
+8FF3B6 003F 3F UNASSIGNED
+8FF3B7 003F 3F UNASSIGNED
+8FF3B8 003F 3F UNASSIGNED
+8FF3B9 003F 3F UNASSIGNED
+8FF3BA 003F 3F UNASSIGNED
+8FF3BB 003F 3F UNASSIGNED
+8FF3BC 003F 3F UNASSIGNED
+8FF3BD 003F 3F UNASSIGNED
+8FF3BE 003F 3F UNASSIGNED
+8FF3BF 003F 3F UNASSIGNED
+8FF3C0 003F 3F UNASSIGNED
+8FF3C1 003F 3F UNASSIGNED
+8FF3C2 003F 3F UNASSIGNED
+8FF3C3 003F 3F UNASSIGNED
+8FF3C4 003F 3F UNASSIGNED
+8FF3C5 003F 3F UNASSIGNED
+8FF3C6 003F 3F UNASSIGNED
+8FF3C7 003F 3F UNASSIGNED
+8FF3C8 003F 3F UNASSIGNED
+8FF3C9 003F 3F UNASSIGNED
+8FF3CA 003F 3F UNASSIGNED
+8FF3CB 003F 3F UNASSIGNED
+8FF3CC 003F 3F UNASSIGNED
+8FF3CD 003F 3F UNASSIGNED
+8FF3CE 003F 3F UNASSIGNED
+8FF3CF 003F 3F UNASSIGNED
+8FF3D0 003F 3F UNASSIGNED
+8FF3D1 003F 3F UNASSIGNED
+8FF3D2 003F 3F UNASSIGNED
+8FF3D3 003F 3F UNASSIGNED
+8FF3D4 003F 3F UNASSIGNED
+8FF3D5 003F 3F UNASSIGNED
+8FF3D6 003F 3F UNASSIGNED
+8FF3D7 003F 3F UNASSIGNED
+8FF3D8 003F 3F UNASSIGNED
+8FF3D9 003F 3F UNASSIGNED
+8FF3DA 003F 3F UNASSIGNED
+8FF3DB 003F 3F UNASSIGNED
+8FF3DC 003F 3F UNASSIGNED
+8FF3DD 003F 3F UNASSIGNED
+8FF3DE 003F 3F UNASSIGNED
+8FF3DF 003F 3F UNASSIGNED
+8FF3E0 003F 3F UNASSIGNED
+8FF3E1 003F 3F UNASSIGNED
+8FF3E2 003F 3F UNASSIGNED
+8FF3E3 003F 3F UNASSIGNED
+8FF3E4 003F 3F UNASSIGNED
+8FF3E5 003F 3F UNASSIGNED
+8FF3E6 003F 3F UNASSIGNED
+8FF3E7 003F 3F UNASSIGNED
+8FF3E8 003F 3F UNASSIGNED
+8FF3E9 003F 3F UNASSIGNED
+8FF3EA 003F 3F UNASSIGNED
+8FF3EB 003F 3F UNASSIGNED
+8FF3EC 003F 3F UNASSIGNED
+8FF3ED 003F 3F UNASSIGNED
+8FF3EE 003F 3F UNASSIGNED
+8FF3EF 003F 3F UNASSIGNED
+8FF3F0 003F 3F UNASSIGNED
+8FF3F1 003F 3F UNASSIGNED
+8FF3F2 003F 3F UNASSIGNED
+8FF3F3 003F 3F UNASSIGNED
+8FF3F4 003F 3F UNASSIGNED
+8FF3F5 003F 3F UNASSIGNED
+8FF3F6 003F 3F UNASSIGNED
+8FF3F7 003F 3F UNASSIGNED
+8FF3F8 003F 3F UNASSIGNED
+8FF3F9 003F 3F UNASSIGNED
+8FF3FA 003F 3F UNASSIGNED
+8FF3FB 003F 3F UNASSIGNED
+8FF3FC 003F 3F UNASSIGNED
+8FF3FD 003F 3F UNASSIGNED
+8FF3FE 003F 3F UNASSIGNED
+8FF4A1 003F 3F UNASSIGNED
+8FF4A2 003F 3F UNASSIGNED
+8FF4A3 003F 3F UNASSIGNED
+8FF4A4 003F 3F UNASSIGNED
+8FF4A5 003F 3F UNASSIGNED
+8FF4A6 003F 3F UNASSIGNED
+8FF4A7 003F 3F UNASSIGNED
+8FF4A8 003F 3F UNASSIGNED
+8FF4A9 003F 3F UNASSIGNED
+8FF4AA 003F 3F UNASSIGNED
+8FF4AB 003F 3F UNASSIGNED
+8FF4AC 003F 3F UNASSIGNED
+8FF4AD 003F 3F UNASSIGNED
+8FF4AE 003F 3F UNASSIGNED
+8FF4AF 003F 3F UNASSIGNED
+8FF4B0 003F 3F UNASSIGNED
+8FF4B1 003F 3F UNASSIGNED
+8FF4B2 003F 3F UNASSIGNED
+8FF4B3 003F 3F UNASSIGNED
+8FF4B4 003F 3F UNASSIGNED
+8FF4B5 003F 3F UNASSIGNED
+8FF4B6 003F 3F UNASSIGNED
+8FF4B7 003F 3F UNASSIGNED
+8FF4B8 003F 3F UNASSIGNED
+8FF4B9 003F 3F UNASSIGNED
+8FF4BA 003F 3F UNASSIGNED
+8FF4BB 003F 3F UNASSIGNED
+8FF4BC 003F 3F UNASSIGNED
+8FF4BD 003F 3F UNASSIGNED
+8FF4BE 003F 3F UNASSIGNED
+8FF4BF 003F 3F UNASSIGNED
+8FF4C0 003F 3F UNASSIGNED
+8FF4C1 003F 3F UNASSIGNED
+8FF4C2 003F 3F UNASSIGNED
+8FF4C3 003F 3F UNASSIGNED
+8FF4C4 003F 3F UNASSIGNED
+8FF4C5 003F 3F UNASSIGNED
+8FF4C6 003F 3F UNASSIGNED
+8FF4C7 003F 3F UNASSIGNED
+8FF4C8 003F 3F UNASSIGNED
+8FF4C9 003F 3F UNASSIGNED
+8FF4CA 003F 3F UNASSIGNED
+8FF4CB 003F 3F UNASSIGNED
+8FF4CC 003F 3F UNASSIGNED
+8FF4CD 003F 3F UNASSIGNED
+8FF4CE 003F 3F UNASSIGNED
+8FF4CF 003F 3F UNASSIGNED
+8FF4D0 003F 3F UNASSIGNED
+8FF4D1 003F 3F UNASSIGNED
+8FF4D2 003F 3F UNASSIGNED
+8FF4D3 003F 3F UNASSIGNED
+8FF4D4 003F 3F UNASSIGNED
+8FF4D5 003F 3F UNASSIGNED
+8FF4D6 003F 3F UNASSIGNED
+8FF4D7 003F 3F UNASSIGNED
+8FF4D8 003F 3F UNASSIGNED
+8FF4D9 003F 3F UNASSIGNED
+8FF4DA 003F 3F UNASSIGNED
+8FF4DB 003F 3F UNASSIGNED
+8FF4DC 003F 3F UNASSIGNED
+8FF4DD 003F 3F UNASSIGNED
+8FF4DE 003F 3F UNASSIGNED
+8FF4DF 003F 3F UNASSIGNED
+8FF4E0 003F 3F UNASSIGNED
+8FF4E1 003F 3F UNASSIGNED
+8FF4E2 003F 3F UNASSIGNED
+8FF4E3 003F 3F UNASSIGNED
+8FF4E4 003F 3F UNASSIGNED
+8FF4E5 003F 3F UNASSIGNED
+8FF4E6 003F 3F UNASSIGNED
+8FF4E7 003F 3F UNASSIGNED
+8FF4E8 003F 3F UNASSIGNED
+8FF4E9 003F 3F UNASSIGNED
+8FF4EA 003F 3F UNASSIGNED
+8FF4EB 003F 3F UNASSIGNED
+8FF4EC 003F 3F UNASSIGNED
+8FF4ED 003F 3F UNASSIGNED
+8FF4EE 003F 3F UNASSIGNED
+8FF4EF 003F 3F UNASSIGNED
+8FF4F0 003F 3F UNASSIGNED
+8FF4F1 003F 3F UNASSIGNED
+8FF4F2 003F 3F UNASSIGNED
+8FF4F3 003F 3F UNASSIGNED
+8FF4F4 003F 3F UNASSIGNED
+8FF4F5 003F 3F UNASSIGNED
+8FF4F6 003F 3F UNASSIGNED
+8FF4F7 003F 3F UNASSIGNED
+8FF4F8 003F 3F UNASSIGNED
+8FF4F9 003F 3F UNASSIGNED
+8FF4FA 003F 3F UNASSIGNED
+8FF4FB 003F 3F UNASSIGNED
+8FF4FC 003F 3F UNASSIGNED
+8FF4FD 003F 3F UNASSIGNED
+8FF4FE 003F 3F UNASSIGNED
+A1C0 005C 5C U+005C REVERSE SOLIDUS
+A2AF 003F 3F UNASSIGNED
+A2B0 003F 3F UNASSIGNED
+A2B1 003F 3F UNASSIGNED
+A2B2 003F 3F UNASSIGNED
+A2B3 003F 3F UNASSIGNED
+A2B4 003F 3F UNASSIGNED
+A2B5 003F 3F UNASSIGNED
+A2B6 003F 3F UNASSIGNED
+A2B7 003F 3F UNASSIGNED
+A2B8 003F 3F UNASSIGNED
+A2B9 003F 3F UNASSIGNED
+A2C2 003F 3F UNASSIGNED
+A2C3 003F 3F UNASSIGNED
+A2C4 003F 3F UNASSIGNED
+A2C5 003F 3F UNASSIGNED
+A2C6 003F 3F UNASSIGNED
+A2C7 003F 3F UNASSIGNED
+A2C8 003F 3F UNASSIGNED
+A2C9 003F 3F UNASSIGNED
+A2D1 003F 3F UNASSIGNED
+A2D2 003F 3F UNASSIGNED
+A2D3 003F 3F UNASSIGNED
+A2D4 003F 3F UNASSIGNED
+A2D5 003F 3F UNASSIGNED
+A2D6 003F 3F UNASSIGNED
+A2D7 003F 3F UNASSIGNED
+A2D8 003F 3F UNASSIGNED
+A2D9 003F 3F UNASSIGNED
+A2DA 003F 3F UNASSIGNED
+A2DB 003F 3F UNASSIGNED
+A2EB 003F 3F UNASSIGNED
+A2EC 003F 3F UNASSIGNED
+A2ED 003F 3F UNASSIGNED
+A2EE 003F 3F UNASSIGNED
+A2EF 003F 3F UNASSIGNED
+A2F0 003F 3F UNASSIGNED
+A2F1 003F 3F UNASSIGNED
+A2FA 003F 3F UNASSIGNED
+A2FB 003F 3F UNASSIGNED
+A2FC 003F 3F UNASSIGNED
+A2FD 003F 3F UNASSIGNED
+A3A1 003F 3F UNASSIGNED
+A3A2 003F 3F UNASSIGNED
+A3A3 003F 3F UNASSIGNED
+A3A4 003F 3F UNASSIGNED
+A3A5 003F 3F UNASSIGNED
+A3A6 003F 3F UNASSIGNED
+A3A7 003F 3F UNASSIGNED
+A3A8 003F 3F UNASSIGNED
+A3A9 003F 3F UNASSIGNED
+A3AA 003F 3F UNASSIGNED
+A3AB 003F 3F UNASSIGNED
+A3AC 003F 3F UNASSIGNED
+A3AD 003F 3F UNASSIGNED
+A3AE 003F 3F UNASSIGNED
+A3AF 003F 3F UNASSIGNED
+A3BA 003F 3F UNASSIGNED
+A3BB 003F 3F UNASSIGNED
+A3BC 003F 3F UNASSIGNED
+A3BD 003F 3F UNASSIGNED
+A3BE 003F 3F UNASSIGNED
+A3BF 003F 3F UNASSIGNED
+A3C0 003F 3F UNASSIGNED
+A3DB 003F 3F UNASSIGNED
+A3DC 003F 3F UNASSIGNED
+A3DD 003F 3F UNASSIGNED
+A3DE 003F 3F UNASSIGNED
+A3DF 003F 3F UNASSIGNED
+A3E0 003F 3F UNASSIGNED
+A3FB 003F 3F UNASSIGNED
+A3FC 003F 3F UNASSIGNED
+A3FD 003F 3F UNASSIGNED
+A3FE 003F 3F UNASSIGNED
+A4F4 003F 3F UNASSIGNED
+A4F5 003F 3F UNASSIGNED
+A4F6 003F 3F UNASSIGNED
+A4F7 003F 3F UNASSIGNED
+A4F8 003F 3F UNASSIGNED
+A4F9 003F 3F UNASSIGNED
+A4FA 003F 3F UNASSIGNED
+A4FB 003F 3F UNASSIGNED
+A4FC 003F 3F UNASSIGNED
+A4FD 003F 3F UNASSIGNED
+A4FE 003F 3F UNASSIGNED
+A5F7 003F 3F UNASSIGNED
+A5F8 003F 3F UNASSIGNED
+A5F9 003F 3F UNASSIGNED
+A5FA 003F 3F UNASSIGNED
+A5FB 003F 3F UNASSIGNED
+A5FC 003F 3F UNASSIGNED
+A5FD 003F 3F UNASSIGNED
+A5FE 003F 3F UNASSIGNED
+A6B9 003F 3F UNASSIGNED
+A6BA 003F 3F UNASSIGNED
+A6BB 003F 3F UNASSIGNED
+A6BC 003F 3F UNASSIGNED
+A6BD 003F 3F UNASSIGNED
+A6BE 003F 3F UNASSIGNED
+A6BF 003F 3F UNASSIGNED
+A6C0 003F 3F UNASSIGNED
+A6D9 003F 3F UNASSIGNED
+A6DA 003F 3F UNASSIGNED
+A6DB 003F 3F UNASSIGNED
+A6DC 003F 3F UNASSIGNED
+A6DD 003F 3F UNASSIGNED
+A6DE 003F 3F UNASSIGNED
+A6DF 003F 3F UNASSIGNED
+A6E0 003F 3F UNASSIGNED
+A6E1 003F 3F UNASSIGNED
+A6E2 003F 3F UNASSIGNED
+A6E3 003F 3F UNASSIGNED
+A6E4 003F 3F UNASSIGNED
+A6E5 003F 3F UNASSIGNED
+A6E6 003F 3F UNASSIGNED
+A6E7 003F 3F UNASSIGNED
+A6E8 003F 3F UNASSIGNED
+A6E9 003F 3F UNASSIGNED
+A6EA 003F 3F UNASSIGNED
+A6EB 003F 3F UNASSIGNED
+A6EC 003F 3F UNASSIGNED
+A6ED 003F 3F UNASSIGNED
+A6EE 003F 3F UNASSIGNED
+A6EF 003F 3F UNASSIGNED
+A6F0 003F 3F UNASSIGNED
+A6F1 003F 3F UNASSIGNED
+A6F2 003F 3F UNASSIGNED
+A6F3 003F 3F UNASSIGNED
+A6F4 003F 3F UNASSIGNED
+A6F5 003F 3F UNASSIGNED
+A6F6 003F 3F UNASSIGNED
+A6F7 003F 3F UNASSIGNED
+A6F8 003F 3F UNASSIGNED
+A6F9 003F 3F UNASSIGNED
+A6FA 003F 3F UNASSIGNED
+A6FB 003F 3F UNASSIGNED
+A6FC 003F 3F UNASSIGNED
+A6FD 003F 3F UNASSIGNED
+A6FE 003F 3F UNASSIGNED
+A7C2 003F 3F UNASSIGNED
+A7C3 003F 3F UNASSIGNED
+A7C4 003F 3F UNASSIGNED
+A7C5 003F 3F UNASSIGNED
+A7C6 003F 3F UNASSIGNED
+A7C7 003F 3F UNASSIGNED
+A7C8 003F 3F UNASSIGNED
+A7C9 003F 3F UNASSIGNED
+A7CA 003F 3F UNASSIGNED
+A7CB 003F 3F UNASSIGNED
+A7CC 003F 3F UNASSIGNED
+A7CD 003F 3F UNASSIGNED
+A7CE 003F 3F UNASSIGNED
+A7CF 003F 3F UNASSIGNED
+A7D0 003F 3F UNASSIGNED
+A7F2 003F 3F UNASSIGNED
+A7F3 003F 3F UNASSIGNED
+A7F4 003F 3F UNASSIGNED
+A7F5 003F 3F UNASSIGNED
+A7F6 003F 3F UNASSIGNED
+A7F7 003F 3F UNASSIGNED
+A7F8 003F 3F UNASSIGNED
+A7F9 003F 3F UNASSIGNED
+A7FA 003F 3F UNASSIGNED
+A7FB 003F 3F UNASSIGNED
+A7FC 003F 3F UNASSIGNED
+A7FD 003F 3F UNASSIGNED
+A7FE 003F 3F UNASSIGNED
+A8C1 003F 3F UNASSIGNED
+A8C2 003F 3F UNASSIGNED
+A8C3 003F 3F UNASSIGNED
+A8C4 003F 3F UNASSIGNED
+A8C5 003F 3F UNASSIGNED
+A8C6 003F 3F UNASSIGNED
+A8C7 003F 3F UNASSIGNED
+A8C8 003F 3F UNASSIGNED
+A8C9 003F 3F UNASSIGNED
+A8CA 003F 3F UNASSIGNED
+A8CB 003F 3F UNASSIGNED
+A8CC 003F 3F UNASSIGNED
+A8CD 003F 3F UNASSIGNED
+A8CE 003F 3F UNASSIGNED
+A8CF 003F 3F UNASSIGNED
+A8D0 003F 3F UNASSIGNED
+A8D1 003F 3F UNASSIGNED
+A8D2 003F 3F UNASSIGNED
+A8D3 003F 3F UNASSIGNED
+A8D4 003F 3F UNASSIGNED
+A8D5 003F 3F UNASSIGNED
+A8D6 003F 3F UNASSIGNED
+A8D7 003F 3F UNASSIGNED
+A8D8 003F 3F UNASSIGNED
+A8D9 003F 3F UNASSIGNED
+A8DA 003F 3F UNASSIGNED
+A8DB 003F 3F UNASSIGNED
+A8DC 003F 3F UNASSIGNED
+A8DD 003F 3F UNASSIGNED
+A8DE 003F 3F UNASSIGNED
+A8DF 003F 3F UNASSIGNED
+A8E0 003F 3F UNASSIGNED
+A8E1 003F 3F UNASSIGNED
+A8E2 003F 3F UNASSIGNED
+A8E3 003F 3F UNASSIGNED
+A8E4 003F 3F UNASSIGNED
+A8E5 003F 3F UNASSIGNED
+A8E6 003F 3F UNASSIGNED
+A8E7 003F 3F UNASSIGNED
+A8E8 003F 3F UNASSIGNED
+A8E9 003F 3F UNASSIGNED
+A8EA 003F 3F UNASSIGNED
+A8EB 003F 3F UNASSIGNED
+A8EC 003F 3F UNASSIGNED
+A8ED 003F 3F UNASSIGNED
+A8EE 003F 3F UNASSIGNED
+A8EF 003F 3F UNASSIGNED
+A8F0 003F 3F UNASSIGNED
+A8F1 003F 3F UNASSIGNED
+A8F2 003F 3F UNASSIGNED
+A8F3 003F 3F UNASSIGNED
+A8F4 003F 3F UNASSIGNED
+A8F5 003F 3F UNASSIGNED
+A8F6 003F 3F UNASSIGNED
+A8F7 003F 3F UNASSIGNED
+A8F8 003F 3F UNASSIGNED
+A8F9 003F 3F UNASSIGNED
+A8FA 003F 3F UNASSIGNED
+A8FB 003F 3F UNASSIGNED
+A8FC 003F 3F UNASSIGNED
+A8FD 003F 3F UNASSIGNED
+A8FE 003F 3F UNASSIGNED
+A9A1 003F 3F UNASSIGNED
+A9A2 003F 3F UNASSIGNED
+A9A3 003F 3F UNASSIGNED
+A9A4 003F 3F UNASSIGNED
+A9A5 003F 3F UNASSIGNED
+A9A6 003F 3F UNASSIGNED
+A9A7 003F 3F UNASSIGNED
+A9A8 003F 3F UNASSIGNED
+A9A9 003F 3F UNASSIGNED
+A9AA 003F 3F UNASSIGNED
+A9AB 003F 3F UNASSIGNED
+A9AC 003F 3F UNASSIGNED
+A9AD 003F 3F UNASSIGNED
+A9AE 003F 3F UNASSIGNED
+A9AF 003F 3F UNASSIGNED
+A9B0 003F 3F UNASSIGNED
+A9B1 003F 3F UNASSIGNED
+A9B2 003F 3F UNASSIGNED
+A9B3 003F 3F UNASSIGNED
+A9B4 003F 3F UNASSIGNED
+A9B5 003F 3F UNASSIGNED
+A9B6 003F 3F UNASSIGNED
+A9B7 003F 3F UNASSIGNED
+A9B8 003F 3F UNASSIGNED
+A9B9 003F 3F UNASSIGNED
+A9BA 003F 3F UNASSIGNED
+A9BB 003F 3F UNASSIGNED
+A9BC 003F 3F UNASSIGNED
+A9BD 003F 3F UNASSIGNED
+A9BE 003F 3F UNASSIGNED
+A9BF 003F 3F UNASSIGNED
+A9C0 003F 3F UNASSIGNED
+A9C1 003F 3F UNASSIGNED
+A9C2 003F 3F UNASSIGNED
+A9C3 003F 3F UNASSIGNED
+A9C4 003F 3F UNASSIGNED
+A9C5 003F 3F UNASSIGNED
+A9C6 003F 3F UNASSIGNED
+A9C7 003F 3F UNASSIGNED
+A9C8 003F 3F UNASSIGNED
+A9C9 003F 3F UNASSIGNED
+A9CA 003F 3F UNASSIGNED
+A9CB 003F 3F UNASSIGNED
+A9CC 003F 3F UNASSIGNED
+A9CD 003F 3F UNASSIGNED
+A9CE 003F 3F UNASSIGNED
+A9CF 003F 3F UNASSIGNED
+A9D0 003F 3F UNASSIGNED
+A9D1 003F 3F UNASSIGNED
+A9D2 003F 3F UNASSIGNED
+A9D3 003F 3F UNASSIGNED
+A9D4 003F 3F UNASSIGNED
+A9D5 003F 3F UNASSIGNED
+A9D6 003F 3F UNASSIGNED
+A9D7 003F 3F UNASSIGNED
+A9D8 003F 3F UNASSIGNED
+A9D9 003F 3F UNASSIGNED
+A9DA 003F 3F UNASSIGNED
+A9DB 003F 3F UNASSIGNED
+A9DC 003F 3F UNASSIGNED
+A9DD 003F 3F UNASSIGNED
+A9DE 003F 3F UNASSIGNED
+A9DF 003F 3F UNASSIGNED
+A9E0 003F 3F UNASSIGNED
+A9E1 003F 3F UNASSIGNED
+A9E2 003F 3F UNASSIGNED
+A9E3 003F 3F UNASSIGNED
+A9E4 003F 3F UNASSIGNED
+A9E5 003F 3F UNASSIGNED
+A9E6 003F 3F UNASSIGNED
+A9E7 003F 3F UNASSIGNED
+A9E8 003F 3F UNASSIGNED
+A9E9 003F 3F UNASSIGNED
+A9EA 003F 3F UNASSIGNED
+A9EB 003F 3F UNASSIGNED
+A9EC 003F 3F UNASSIGNED
+A9ED 003F 3F UNASSIGNED
+A9EE 003F 3F UNASSIGNED
+A9EF 003F 3F UNASSIGNED
+A9F0 003F 3F UNASSIGNED
+A9F1 003F 3F UNASSIGNED
+A9F2 003F 3F UNASSIGNED
+A9F3 003F 3F UNASSIGNED
+A9F4 003F 3F UNASSIGNED
+A9F5 003F 3F UNASSIGNED
+A9F6 003F 3F UNASSIGNED
+A9F7 003F 3F UNASSIGNED
+A9F8 003F 3F UNASSIGNED
+A9F9 003F 3F UNASSIGNED
+A9FA 003F 3F UNASSIGNED
+A9FB 003F 3F UNASSIGNED
+A9FC 003F 3F UNASSIGNED
+A9FD 003F 3F UNASSIGNED
+A9FE 003F 3F UNASSIGNED
+AAA1 003F 3F UNASSIGNED
+AAA2 003F 3F UNASSIGNED
+AAA3 003F 3F UNASSIGNED
+AAA4 003F 3F UNASSIGNED
+AAA5 003F 3F UNASSIGNED
+AAA6 003F 3F UNASSIGNED
+AAA7 003F 3F UNASSIGNED
+AAA8 003F 3F UNASSIGNED
+AAA9 003F 3F UNASSIGNED
+AAAA 003F 3F UNASSIGNED
+AAAB 003F 3F UNASSIGNED
+AAAC 003F 3F UNASSIGNED
+AAAD 003F 3F UNASSIGNED
+AAAE 003F 3F UNASSIGNED
+AAAF 003F 3F UNASSIGNED
+AAB0 003F 3F UNASSIGNED
+AAB1 003F 3F UNASSIGNED
+AAB2 003F 3F UNASSIGNED
+AAB3 003F 3F UNASSIGNED
+AAB4 003F 3F UNASSIGNED
+AAB5 003F 3F UNASSIGNED
+AAB6 003F 3F UNASSIGNED
+AAB7 003F 3F UNASSIGNED
+AAB8 003F 3F UNASSIGNED
+AAB9 003F 3F UNASSIGNED
+AABA 003F 3F UNASSIGNED
+AABB 003F 3F UNASSIGNED
+AABC 003F 3F UNASSIGNED
+AABD 003F 3F UNASSIGNED
+AABE 003F 3F UNASSIGNED
+AABF 003F 3F UNASSIGNED
+AAC0 003F 3F UNASSIGNED
+AAC1 003F 3F UNASSIGNED
+AAC2 003F 3F UNASSIGNED
+AAC3 003F 3F UNASSIGNED
+AAC4 003F 3F UNASSIGNED
+AAC5 003F 3F UNASSIGNED
+AAC6 003F 3F UNASSIGNED
+AAC7 003F 3F UNASSIGNED
+AAC8 003F 3F UNASSIGNED
+AAC9 003F 3F UNASSIGNED
+AACA 003F 3F UNASSIGNED
+AACB 003F 3F UNASSIGNED
+AACC 003F 3F UNASSIGNED
+AACD 003F 3F UNASSIGNED
+AACE 003F 3F UNASSIGNED
+AACF 003F 3F UNASSIGNED
+AAD0 003F 3F UNASSIGNED
+AAD1 003F 3F UNASSIGNED
+AAD2 003F 3F UNASSIGNED
+AAD3 003F 3F UNASSIGNED
+AAD4 003F 3F UNASSIGNED
+AAD5 003F 3F UNASSIGNED
+AAD6 003F 3F UNASSIGNED
+AAD7 003F 3F UNASSIGNED
+AAD8 003F 3F UNASSIGNED
+AAD9 003F 3F UNASSIGNED
+AADA 003F 3F UNASSIGNED
+AADB 003F 3F UNASSIGNED
+AADC 003F 3F UNASSIGNED
+AADD 003F 3F UNASSIGNED
+AADE 003F 3F UNASSIGNED
+AADF 003F 3F UNASSIGNED
+AAE0 003F 3F UNASSIGNED
+AAE1 003F 3F UNASSIGNED
+AAE2 003F 3F UNASSIGNED
+AAE3 003F 3F UNASSIGNED
+AAE4 003F 3F UNASSIGNED
+AAE5 003F 3F UNASSIGNED
+AAE6 003F 3F UNASSIGNED
+AAE7 003F 3F UNASSIGNED
+AAE8 003F 3F UNASSIGNED
+AAE9 003F 3F UNASSIGNED
+AAEA 003F 3F UNASSIGNED
+AAEB 003F 3F UNASSIGNED
+AAEC 003F 3F UNASSIGNED
+AAED 003F 3F UNASSIGNED
+AAEE 003F 3F UNASSIGNED
+AAEF 003F 3F UNASSIGNED
+AAF0 003F 3F UNASSIGNED
+AAF1 003F 3F UNASSIGNED
+AAF2 003F 3F UNASSIGNED
+AAF3 003F 3F UNASSIGNED
+AAF4 003F 3F UNASSIGNED
+AAF5 003F 3F UNASSIGNED
+AAF6 003F 3F UNASSIGNED
+AAF7 003F 3F UNASSIGNED
+AAF8 003F 3F UNASSIGNED
+AAF9 003F 3F UNASSIGNED
+AAFA 003F 3F UNASSIGNED
+AAFB 003F 3F UNASSIGNED
+AAFC 003F 3F UNASSIGNED
+AAFD 003F 3F UNASSIGNED
+AAFE 003F 3F UNASSIGNED
+ABA1 003F 3F UNASSIGNED
+ABA2 003F 3F UNASSIGNED
+ABA3 003F 3F UNASSIGNED
+ABA4 003F 3F UNASSIGNED
+ABA5 003F 3F UNASSIGNED
+ABA6 003F 3F UNASSIGNED
+ABA7 003F 3F UNASSIGNED
+ABA8 003F 3F UNASSIGNED
+ABA9 003F 3F UNASSIGNED
+ABAA 003F 3F UNASSIGNED
+ABAB 003F 3F UNASSIGNED
+ABAC 003F 3F UNASSIGNED
+ABAD 003F 3F UNASSIGNED
+ABAE 003F 3F UNASSIGNED
+ABAF 003F 3F UNASSIGNED
+ABB0 003F 3F UNASSIGNED
+ABB1 003F 3F UNASSIGNED
+ABB2 003F 3F UNASSIGNED
+ABB3 003F 3F UNASSIGNED
+ABB4 003F 3F UNASSIGNED
+ABB5 003F 3F UNASSIGNED
+ABB6 003F 3F UNASSIGNED
+ABB7 003F 3F UNASSIGNED
+ABB8 003F 3F UNASSIGNED
+ABB9 003F 3F UNASSIGNED
+ABBA 003F 3F UNASSIGNED
+ABBB 003F 3F UNASSIGNED
+ABBC 003F 3F UNASSIGNED
+ABBD 003F 3F UNASSIGNED
+ABBE 003F 3F UNASSIGNED
+ABBF 003F 3F UNASSIGNED
+ABC0 003F 3F UNASSIGNED
+ABC1 003F 3F UNASSIGNED
+ABC2 003F 3F UNASSIGNED
+ABC3 003F 3F UNASSIGNED
+ABC4 003F 3F UNASSIGNED
+ABC5 003F 3F UNASSIGNED
+ABC6 003F 3F UNASSIGNED
+ABC7 003F 3F UNASSIGNED
+ABC8 003F 3F UNASSIGNED
+ABC9 003F 3F UNASSIGNED
+ABCA 003F 3F UNASSIGNED
+ABCB 003F 3F UNASSIGNED
+ABCC 003F 3F UNASSIGNED
+ABCD 003F 3F UNASSIGNED
+ABCE 003F 3F UNASSIGNED
+ABCF 003F 3F UNASSIGNED
+ABD0 003F 3F UNASSIGNED
+ABD1 003F 3F UNASSIGNED
+ABD2 003F 3F UNASSIGNED
+ABD3 003F 3F UNASSIGNED
+ABD4 003F 3F UNASSIGNED
+ABD5 003F 3F UNASSIGNED
+ABD6 003F 3F UNASSIGNED
+ABD7 003F 3F UNASSIGNED
+ABD8 003F 3F UNASSIGNED
+ABD9 003F 3F UNASSIGNED
+ABDA 003F 3F UNASSIGNED
+ABDB 003F 3F UNASSIGNED
+ABDC 003F 3F UNASSIGNED
+ABDD 003F 3F UNASSIGNED
+ABDE 003F 3F UNASSIGNED
+ABDF 003F 3F UNASSIGNED
+ABE0 003F 3F UNASSIGNED
+ABE1 003F 3F UNASSIGNED
+ABE2 003F 3F UNASSIGNED
+ABE3 003F 3F UNASSIGNED
+ABE4 003F 3F UNASSIGNED
+ABE5 003F 3F UNASSIGNED
+ABE6 003F 3F UNASSIGNED
+ABE7 003F 3F UNASSIGNED
+ABE8 003F 3F UNASSIGNED
+ABE9 003F 3F UNASSIGNED
+ABEA 003F 3F UNASSIGNED
+ABEB 003F 3F UNASSIGNED
+ABEC 003F 3F UNASSIGNED
+ABED 003F 3F UNASSIGNED
+ABEE 003F 3F UNASSIGNED
+ABEF 003F 3F UNASSIGNED
+ABF0 003F 3F UNASSIGNED
+ABF1 003F 3F UNASSIGNED
+ABF2 003F 3F UNASSIGNED
+ABF3 003F 3F UNASSIGNED
+ABF4 003F 3F UNASSIGNED
+ABF5 003F 3F UNASSIGNED
+ABF6 003F 3F UNASSIGNED
+ABF7 003F 3F UNASSIGNED
+ABF8 003F 3F UNASSIGNED
+ABF9 003F 3F UNASSIGNED
+ABFA 003F 3F UNASSIGNED
+ABFB 003F 3F UNASSIGNED
+ABFC 003F 3F UNASSIGNED
+ABFD 003F 3F UNASSIGNED
+ABFE 003F 3F UNASSIGNED
+ACA1 003F 3F UNASSIGNED
+ACA2 003F 3F UNASSIGNED
+ACA3 003F 3F UNASSIGNED
+ACA4 003F 3F UNASSIGNED
+ACA5 003F 3F UNASSIGNED
+ACA6 003F 3F UNASSIGNED
+ACA7 003F 3F UNASSIGNED
+ACA8 003F 3F UNASSIGNED
+ACA9 003F 3F UNASSIGNED
+ACAA 003F 3F UNASSIGNED
+ACAB 003F 3F UNASSIGNED
+ACAC 003F 3F UNASSIGNED
+ACAD 003F 3F UNASSIGNED
+ACAE 003F 3F UNASSIGNED
+ACAF 003F 3F UNASSIGNED
+ACB0 003F 3F UNASSIGNED
+ACB1 003F 3F UNASSIGNED
+ACB2 003F 3F UNASSIGNED
+ACB3 003F 3F UNASSIGNED
+ACB4 003F 3F UNASSIGNED
+ACB5 003F 3F UNASSIGNED
+ACB6 003F 3F UNASSIGNED
+ACB7 003F 3F UNASSIGNED
+ACB8 003F 3F UNASSIGNED
+ACB9 003F 3F UNASSIGNED
+ACBA 003F 3F UNASSIGNED
+ACBB 003F 3F UNASSIGNED
+ACBC 003F 3F UNASSIGNED
+ACBD 003F 3F UNASSIGNED
+ACBE 003F 3F UNASSIGNED
+ACBF 003F 3F UNASSIGNED
+ACC0 003F 3F UNASSIGNED
+ACC1 003F 3F UNASSIGNED
+ACC2 003F 3F UNASSIGNED
+ACC3 003F 3F UNASSIGNED
+ACC4 003F 3F UNASSIGNED
+ACC5 003F 3F UNASSIGNED
+ACC6 003F 3F UNASSIGNED
+ACC7 003F 3F UNASSIGNED
+ACC8 003F 3F UNASSIGNED
+ACC9 003F 3F UNASSIGNED
+ACCA 003F 3F UNASSIGNED
+ACCB 003F 3F UNASSIGNED
+ACCC 003F 3F UNASSIGNED
+ACCD 003F 3F UNASSIGNED
+ACCE 003F 3F UNASSIGNED
+ACCF 003F 3F UNASSIGNED
+ACD0 003F 3F UNASSIGNED
+ACD1 003F 3F UNASSIGNED
+ACD2 003F 3F UNASSIGNED
+ACD3 003F 3F UNASSIGNED
+ACD4 003F 3F UNASSIGNED
+ACD5 003F 3F UNASSIGNED
+ACD6 003F 3F UNASSIGNED
+ACD7 003F 3F UNASSIGNED
+ACD8 003F 3F UNASSIGNED
+ACD9 003F 3F UNASSIGNED
+ACDA 003F 3F UNASSIGNED
+ACDB 003F 3F UNASSIGNED
+ACDC 003F 3F UNASSIGNED
+ACDD 003F 3F UNASSIGNED
+ACDE 003F 3F UNASSIGNED
+ACDF 003F 3F UNASSIGNED
+ACE0 003F 3F UNASSIGNED
+ACE1 003F 3F UNASSIGNED
+ACE2 003F 3F UNASSIGNED
+ACE3 003F 3F UNASSIGNED
+ACE4 003F 3F UNASSIGNED
+ACE5 003F 3F UNASSIGNED
+ACE6 003F 3F UNASSIGNED
+ACE7 003F 3F UNASSIGNED
+ACE8 003F 3F UNASSIGNED
+ACE9 003F 3F UNASSIGNED
+ACEA 003F 3F UNASSIGNED
+ACEB 003F 3F UNASSIGNED
+ACEC 003F 3F UNASSIGNED
+ACED 003F 3F UNASSIGNED
+ACEE 003F 3F UNASSIGNED
+ACEF 003F 3F UNASSIGNED
+ACF0 003F 3F UNASSIGNED
+ACF1 003F 3F UNASSIGNED
+ACF2 003F 3F UNASSIGNED
+ACF3 003F 3F UNASSIGNED
+ACF4 003F 3F UNASSIGNED
+ACF5 003F 3F UNASSIGNED
+ACF6 003F 3F UNASSIGNED
+ACF7 003F 3F UNASSIGNED
+ACF8 003F 3F UNASSIGNED
+ACF9 003F 3F UNASSIGNED
+ACFA 003F 3F UNASSIGNED
+ACFB 003F 3F UNASSIGNED
+ACFC 003F 3F UNASSIGNED
+ACFD 003F 3F UNASSIGNED
+ACFE 003F 3F UNASSIGNED
+ADA1 003F 3F UNASSIGNED
+ADA2 003F 3F UNASSIGNED
+ADA3 003F 3F UNASSIGNED
+ADA4 003F 3F UNASSIGNED
+ADA5 003F 3F UNASSIGNED
+ADA6 003F 3F UNASSIGNED
+ADA7 003F 3F UNASSIGNED
+ADA8 003F 3F UNASSIGNED
+ADA9 003F 3F UNASSIGNED
+ADAA 003F 3F UNASSIGNED
+ADAB 003F 3F UNASSIGNED
+ADAC 003F 3F UNASSIGNED
+ADAD 003F 3F UNASSIGNED
+ADAE 003F 3F UNASSIGNED
+ADAF 003F 3F UNASSIGNED
+ADB0 003F 3F UNASSIGNED
+ADB1 003F 3F UNASSIGNED
+ADB2 003F 3F UNASSIGNED
+ADB3 003F 3F UNASSIGNED
+ADB4 003F 3F UNASSIGNED
+ADB5 003F 3F UNASSIGNED
+ADB6 003F 3F UNASSIGNED
+ADB7 003F 3F UNASSIGNED
+ADB8 003F 3F UNASSIGNED
+ADB9 003F 3F UNASSIGNED
+ADBA 003F 3F UNASSIGNED
+ADBB 003F 3F UNASSIGNED
+ADBC 003F 3F UNASSIGNED
+ADBD 003F 3F UNASSIGNED
+ADBE 003F 3F UNASSIGNED
+ADBF 003F 3F UNASSIGNED
+ADC0 003F 3F UNASSIGNED
+ADC1 003F 3F UNASSIGNED
+ADC2 003F 3F UNASSIGNED
+ADC3 003F 3F UNASSIGNED
+ADC4 003F 3F UNASSIGNED
+ADC5 003F 3F UNASSIGNED
+ADC6 003F 3F UNASSIGNED
+ADC7 003F 3F UNASSIGNED
+ADC8 003F 3F UNASSIGNED
+ADC9 003F 3F UNASSIGNED
+ADCA 003F 3F UNASSIGNED
+ADCB 003F 3F UNASSIGNED
+ADCC 003F 3F UNASSIGNED
+ADCD 003F 3F UNASSIGNED
+ADCE 003F 3F UNASSIGNED
+ADCF 003F 3F UNASSIGNED
+ADD0 003F 3F UNASSIGNED
+ADD1 003F 3F UNASSIGNED
+ADD2 003F 3F UNASSIGNED
+ADD3 003F 3F UNASSIGNED
+ADD4 003F 3F UNASSIGNED
+ADD5 003F 3F UNASSIGNED
+ADD6 003F 3F UNASSIGNED
+ADD7 003F 3F UNASSIGNED
+ADD8 003F 3F UNASSIGNED
+ADD9 003F 3F UNASSIGNED
+ADDA 003F 3F UNASSIGNED
+ADDB 003F 3F UNASSIGNED
+ADDC 003F 3F UNASSIGNED
+ADDD 003F 3F UNASSIGNED
+ADDE 003F 3F UNASSIGNED
+ADDF 003F 3F UNASSIGNED
+ADE0 003F 3F UNASSIGNED
+ADE1 003F 3F UNASSIGNED
+ADE2 003F 3F UNASSIGNED
+ADE3 003F 3F UNASSIGNED
+ADE4 003F 3F UNASSIGNED
+ADE5 003F 3F UNASSIGNED
+ADE6 003F 3F UNASSIGNED
+ADE7 003F 3F UNASSIGNED
+ADE8 003F 3F UNASSIGNED
+ADE9 003F 3F UNASSIGNED
+ADEA 003F 3F UNASSIGNED
+ADEB 003F 3F UNASSIGNED
+ADEC 003F 3F UNASSIGNED
+ADED 003F 3F UNASSIGNED
+ADEE 003F 3F UNASSIGNED
+ADEF 003F 3F UNASSIGNED
+ADF0 003F 3F UNASSIGNED
+ADF1 003F 3F UNASSIGNED
+ADF2 003F 3F UNASSIGNED
+ADF3 003F 3F UNASSIGNED
+ADF4 003F 3F UNASSIGNED
+ADF5 003F 3F UNASSIGNED
+ADF6 003F 3F UNASSIGNED
+ADF7 003F 3F UNASSIGNED
+ADF8 003F 3F UNASSIGNED
+ADF9 003F 3F UNASSIGNED
+ADFA 003F 3F UNASSIGNED
+ADFB 003F 3F UNASSIGNED
+ADFC 003F 3F UNASSIGNED
+ADFD 003F 3F UNASSIGNED
+ADFE 003F 3F UNASSIGNED
+AEA1 003F 3F UNASSIGNED
+AEA2 003F 3F UNASSIGNED
+AEA3 003F 3F UNASSIGNED
+AEA4 003F 3F UNASSIGNED
+AEA5 003F 3F UNASSIGNED
+AEA6 003F 3F UNASSIGNED
+AEA7 003F 3F UNASSIGNED
+AEA8 003F 3F UNASSIGNED
+AEA9 003F 3F UNASSIGNED
+AEAA 003F 3F UNASSIGNED
+AEAB 003F 3F UNASSIGNED
+AEAC 003F 3F UNASSIGNED
+AEAD 003F 3F UNASSIGNED
+AEAE 003F 3F UNASSIGNED
+AEAF 003F 3F UNASSIGNED
+AEB0 003F 3F UNASSIGNED
+AEB1 003F 3F UNASSIGNED
+AEB2 003F 3F UNASSIGNED
+AEB3 003F 3F UNASSIGNED
+AEB4 003F 3F UNASSIGNED
+AEB5 003F 3F UNASSIGNED
+AEB6 003F 3F UNASSIGNED
+AEB7 003F 3F UNASSIGNED
+AEB8 003F 3F UNASSIGNED
+AEB9 003F 3F UNASSIGNED
+AEBA 003F 3F UNASSIGNED
+AEBB 003F 3F UNASSIGNED
+AEBC 003F 3F UNASSIGNED
+AEBD 003F 3F UNASSIGNED
+AEBE 003F 3F UNASSIGNED
+AEBF 003F 3F UNASSIGNED
+AEC0 003F 3F UNASSIGNED
+AEC1 003F 3F UNASSIGNED
+AEC2 003F 3F UNASSIGNED
+AEC3 003F 3F UNASSIGNED
+AEC4 003F 3F UNASSIGNED
+AEC5 003F 3F UNASSIGNED
+AEC6 003F 3F UNASSIGNED
+AEC7 003F 3F UNASSIGNED
+AEC8 003F 3F UNASSIGNED
+AEC9 003F 3F UNASSIGNED
+AECA 003F 3F UNASSIGNED
+AECB 003F 3F UNASSIGNED
+AECC 003F 3F UNASSIGNED
+AECD 003F 3F UNASSIGNED
+AECE 003F 3F UNASSIGNED
+AECF 003F 3F UNASSIGNED
+AED0 003F 3F UNASSIGNED
+AED1 003F 3F UNASSIGNED
+AED2 003F 3F UNASSIGNED
+AED3 003F 3F UNASSIGNED
+AED4 003F 3F UNASSIGNED
+AED5 003F 3F UNASSIGNED
+AED6 003F 3F UNASSIGNED
+AED7 003F 3F UNASSIGNED
+AED8 003F 3F UNASSIGNED
+AED9 003F 3F UNASSIGNED
+AEDA 003F 3F UNASSIGNED
+AEDB 003F 3F UNASSIGNED
+AEDC 003F 3F UNASSIGNED
+AEDD 003F 3F UNASSIGNED
+AEDE 003F 3F UNASSIGNED
+AEDF 003F 3F UNASSIGNED
+AEE0 003F 3F UNASSIGNED
+AEE1 003F 3F UNASSIGNED
+AEE2 003F 3F UNASSIGNED
+AEE3 003F 3F UNASSIGNED
+AEE4 003F 3F UNASSIGNED
+AEE5 003F 3F UNASSIGNED
+AEE6 003F 3F UNASSIGNED
+AEE7 003F 3F UNASSIGNED
+AEE8 003F 3F UNASSIGNED
+AEE9 003F 3F UNASSIGNED
+AEEA 003F 3F UNASSIGNED
+AEEB 003F 3F UNASSIGNED
+AEEC 003F 3F UNASSIGNED
+AEED 003F 3F UNASSIGNED
+AEEE 003F 3F UNASSIGNED
+AEEF 003F 3F UNASSIGNED
+AEF0 003F 3F UNASSIGNED
+AEF1 003F 3F UNASSIGNED
+AEF2 003F 3F UNASSIGNED
+AEF3 003F 3F UNASSIGNED
+AEF4 003F 3F UNASSIGNED
+AEF5 003F 3F UNASSIGNED
+AEF6 003F 3F UNASSIGNED
+AEF7 003F 3F UNASSIGNED
+AEF8 003F 3F UNASSIGNED
+AEF9 003F 3F UNASSIGNED
+AEFA 003F 3F UNASSIGNED
+AEFB 003F 3F UNASSIGNED
+AEFC 003F 3F UNASSIGNED
+AEFD 003F 3F UNASSIGNED
+AEFE 003F 3F UNASSIGNED
+AFA1 003F 3F UNASSIGNED
+AFA2 003F 3F UNASSIGNED
+AFA3 003F 3F UNASSIGNED
+AFA4 003F 3F UNASSIGNED
+AFA5 003F 3F UNASSIGNED
+AFA6 003F 3F UNASSIGNED
+AFA7 003F 3F UNASSIGNED
+AFA8 003F 3F UNASSIGNED
+AFA9 003F 3F UNASSIGNED
+AFAA 003F 3F UNASSIGNED
+AFAB 003F 3F UNASSIGNED
+AFAC 003F 3F UNASSIGNED
+AFAD 003F 3F UNASSIGNED
+AFAE 003F 3F UNASSIGNED
+AFAF 003F 3F UNASSIGNED
+AFB0 003F 3F UNASSIGNED
+AFB1 003F 3F UNASSIGNED
+AFB2 003F 3F UNASSIGNED
+AFB3 003F 3F UNASSIGNED
+AFB4 003F 3F UNASSIGNED
+AFB5 003F 3F UNASSIGNED
+AFB6 003F 3F UNASSIGNED
+AFB7 003F 3F UNASSIGNED
+AFB8 003F 3F UNASSIGNED
+AFB9 003F 3F UNASSIGNED
+AFBA 003F 3F UNASSIGNED
+AFBB 003F 3F UNASSIGNED
+AFBC 003F 3F UNASSIGNED
+AFBD 003F 3F UNASSIGNED
+AFBE 003F 3F UNASSIGNED
+AFBF 003F 3F UNASSIGNED
+AFC0 003F 3F UNASSIGNED
+AFC1 003F 3F UNASSIGNED
+AFC2 003F 3F UNASSIGNED
+AFC3 003F 3F UNASSIGNED
+AFC4 003F 3F UNASSIGNED
+AFC5 003F 3F UNASSIGNED
+AFC6 003F 3F UNASSIGNED
+AFC7 003F 3F UNASSIGNED
+AFC8 003F 3F UNASSIGNED
+AFC9 003F 3F UNASSIGNED
+AFCA 003F 3F UNASSIGNED
+AFCB 003F 3F UNASSIGNED
+AFCC 003F 3F UNASSIGNED
+AFCD 003F 3F UNASSIGNED
+AFCE 003F 3F UNASSIGNED
+AFCF 003F 3F UNASSIGNED
+AFD0 003F 3F UNASSIGNED
+AFD1 003F 3F UNASSIGNED
+AFD2 003F 3F UNASSIGNED
+AFD3 003F 3F UNASSIGNED
+AFD4 003F 3F UNASSIGNED
+AFD5 003F 3F UNASSIGNED
+AFD6 003F 3F UNASSIGNED
+AFD7 003F 3F UNASSIGNED
+AFD8 003F 3F UNASSIGNED
+AFD9 003F 3F UNASSIGNED
+AFDA 003F 3F UNASSIGNED
+AFDB 003F 3F UNASSIGNED
+AFDC 003F 3F UNASSIGNED
+AFDD 003F 3F UNASSIGNED
+AFDE 003F 3F UNASSIGNED
+AFDF 003F 3F UNASSIGNED
+AFE0 003F 3F UNASSIGNED
+AFE1 003F 3F UNASSIGNED
+AFE2 003F 3F UNASSIGNED
+AFE3 003F 3F UNASSIGNED
+AFE4 003F 3F UNASSIGNED
+AFE5 003F 3F UNASSIGNED
+AFE6 003F 3F UNASSIGNED
+AFE7 003F 3F UNASSIGNED
+AFE8 003F 3F UNASSIGNED
+AFE9 003F 3F UNASSIGNED
+AFEA 003F 3F UNASSIGNED
+AFEB 003F 3F UNASSIGNED
+AFEC 003F 3F UNASSIGNED
+AFED 003F 3F UNASSIGNED
+AFEE 003F 3F UNASSIGNED
+AFEF 003F 3F UNASSIGNED
+AFF0 003F 3F UNASSIGNED
+AFF1 003F 3F UNASSIGNED
+AFF2 003F 3F UNASSIGNED
+AFF3 003F 3F UNASSIGNED
+AFF4 003F 3F UNASSIGNED
+AFF5 003F 3F UNASSIGNED
+AFF6 003F 3F UNASSIGNED
+AFF7 003F 3F UNASSIGNED
+AFF8 003F 3F UNASSIGNED
+AFF9 003F 3F UNASSIGNED
+AFFA 003F 3F UNASSIGNED
+AFFB 003F 3F UNASSIGNED
+AFFC 003F 3F UNASSIGNED
+AFFD 003F 3F UNASSIGNED
+AFFE 003F 3F UNASSIGNED
+CFD4 003F 3F UNASSIGNED
+CFD5 003F 3F UNASSIGNED
+CFD6 003F 3F UNASSIGNED
+CFD7 003F 3F UNASSIGNED
+CFD8 003F 3F UNASSIGNED
+CFD9 003F 3F UNASSIGNED
+CFDA 003F 3F UNASSIGNED
+CFDB 003F 3F UNASSIGNED
+CFDC 003F 3F UNASSIGNED
+CFDD 003F 3F UNASSIGNED
+CFDE 003F 3F UNASSIGNED
+CFDF 003F 3F UNASSIGNED
+CFE0 003F 3F UNASSIGNED
+CFE1 003F 3F UNASSIGNED
+CFE2 003F 3F UNASSIGNED
+CFE3 003F 3F UNASSIGNED
+CFE4 003F 3F UNASSIGNED
+CFE5 003F 3F UNASSIGNED
+CFE6 003F 3F UNASSIGNED
+CFE7 003F 3F UNASSIGNED
+CFE8 003F 3F UNASSIGNED
+CFE9 003F 3F UNASSIGNED
+CFEA 003F 3F UNASSIGNED
+CFEB 003F 3F UNASSIGNED
+CFEC 003F 3F UNASSIGNED
+CFED 003F 3F UNASSIGNED
+CFEE 003F 3F UNASSIGNED
+CFEF 003F 3F UNASSIGNED
+CFF0 003F 3F UNASSIGNED
+CFF1 003F 3F UNASSIGNED
+CFF2 003F 3F UNASSIGNED
+CFF3 003F 3F UNASSIGNED
+CFF4 003F 3F UNASSIGNED
+CFF5 003F 3F UNASSIGNED
+CFF6 003F 3F UNASSIGNED
+CFF7 003F 3F UNASSIGNED
+CFF8 003F 3F UNASSIGNED
+CFF9 003F 3F UNASSIGNED
+CFFA 003F 3F UNASSIGNED
+CFFB 003F 3F UNASSIGNED
+CFFC 003F 3F UNASSIGNED
+CFFD 003F 3F UNASSIGNED
+CFFE 003F 3F UNASSIGNED
+F4A7 003F 3F UNASSIGNED
+F4A8 003F 3F UNASSIGNED
+F4A9 003F 3F UNASSIGNED
+F4AA 003F 3F UNASSIGNED
+F4AB 003F 3F UNASSIGNED
+F4AC 003F 3F UNASSIGNED
+F4AD 003F 3F UNASSIGNED
+F4AE 003F 3F UNASSIGNED
+F4AF 003F 3F UNASSIGNED
+F4B0 003F 3F UNASSIGNED
+F4B1 003F 3F UNASSIGNED
+F4B2 003F 3F UNASSIGNED
+F4B3 003F 3F UNASSIGNED
+F4B4 003F 3F UNASSIGNED
+F4B5 003F 3F UNASSIGNED
+F4B6 003F 3F UNASSIGNED
+F4B7 003F 3F UNASSIGNED
+F4B8 003F 3F UNASSIGNED
+F4B9 003F 3F UNASSIGNED
+F4BA 003F 3F UNASSIGNED
+F4BB 003F 3F UNASSIGNED
+F4BC 003F 3F UNASSIGNED
+F4BD 003F 3F UNASSIGNED
+F4BE 003F 3F UNASSIGNED
+F4BF 003F 3F UNASSIGNED
+F4C0 003F 3F UNASSIGNED
+F4C1 003F 3F UNASSIGNED
+F4C2 003F 3F UNASSIGNED
+F4C3 003F 3F UNASSIGNED
+F4C4 003F 3F UNASSIGNED
+F4C5 003F 3F UNASSIGNED
+F4C6 003F 3F UNASSIGNED
+F4C7 003F 3F UNASSIGNED
+F4C8 003F 3F UNASSIGNED
+F4C9 003F 3F UNASSIGNED
+F4CA 003F 3F UNASSIGNED
+F4CB 003F 3F UNASSIGNED
+F4CC 003F 3F UNASSIGNED
+F4CD 003F 3F UNASSIGNED
+F4CE 003F 3F UNASSIGNED
+F4CF 003F 3F UNASSIGNED
+F4D0 003F 3F UNASSIGNED
+F4D1 003F 3F UNASSIGNED
+F4D2 003F 3F UNASSIGNED
+F4D3 003F 3F UNASSIGNED
+F4D4 003F 3F UNASSIGNED
+F4D5 003F 3F UNASSIGNED
+F4D6 003F 3F UNASSIGNED
+F4D7 003F 3F UNASSIGNED
+F4D8 003F 3F UNASSIGNED
+F4D9 003F 3F UNASSIGNED
+F4DA 003F 3F UNASSIGNED
+F4DB 003F 3F UNASSIGNED
+F4DC 003F 3F UNASSIGNED
+F4DD 003F 3F UNASSIGNED
+F4DE 003F 3F UNASSIGNED
+F4DF 003F 3F UNASSIGNED
+F4E0 003F 3F UNASSIGNED
+F4E1 003F 3F UNASSIGNED
+F4E2 003F 3F UNASSIGNED
+F4E3 003F 3F UNASSIGNED
+F4E4 003F 3F UNASSIGNED
+F4E5 003F 3F UNASSIGNED
+F4E6 003F 3F UNASSIGNED
+F4E7 003F 3F UNASSIGNED
+F4E8 003F 3F UNASSIGNED
+F4E9 003F 3F UNASSIGNED
+F4EA 003F 3F UNASSIGNED
+F4EB 003F 3F UNASSIGNED
+F4EC 003F 3F UNASSIGNED
+F4ED 003F 3F UNASSIGNED
+F4EE 003F 3F UNASSIGNED
+F4EF 003F 3F UNASSIGNED
+F4F0 003F 3F UNASSIGNED
+F4F1 003F 3F UNASSIGNED
+F4F2 003F 3F UNASSIGNED
+F4F3 003F 3F UNASSIGNED
+F4F4 003F 3F UNASSIGNED
+F4F5 003F 3F UNASSIGNED
+F4F6 003F 3F UNASSIGNED
+F4F7 003F 3F UNASSIGNED
+F4F8 003F 3F UNASSIGNED
+F4F9 003F 3F UNASSIGNED
+F4FA 003F 3F UNASSIGNED
+F4FB 003F 3F UNASSIGNED
+F4FC 003F 3F UNASSIGNED
+F4FD 003F 3F UNASSIGNED
+F4FE 003F 3F UNASSIGNED
+drop table t1;
+drop table t2;
+create table t1 (
+ujis varchar(1) character set ujis,
+name varchar(64),
+ucs2 varchar(1) character set ucs2,
+ujis2 varchar(1) character set ujis
+);
+insert into t1 (ujis,name) values (0x5C, 'U+005C REVERSE SOLIDUS');
+insert into t1 (ujis,name) values (0x7E, 'U+007E TILDE');
+insert into t1 (ujis,name) values (0xA1B1, 'U+FFE3 FULLWIDTH MACRON');
+insert into t1 (ujis,name) values (0xA1BD, 'U+2015 HORIZONTAL BAR');
+insert into t1 (ujis,name) values (0xA1C0, 'U+005C REVERSE SOLIDUS');
+insert into t1 (ujis,name) values (0xA1C1, 'U+301C WAVE DASH');
+insert into t1 (ujis,name) values (0xA1C2, 'U+2016 DOUBLE VERTICAL LINE');
+insert into t1 (ujis,name) values (0xA1DD, 'U+2212 MINUS SIGN');
+insert into t1 (ujis,name) values (0xA1F1, 'U+00A2 CENT SIGN');
+insert into t1 (ujis,name) values (0xA1F2, 'U+00A3 POUND SIGN');
+insert into t1 (ujis,name) values (0xA1EF, 'U+FFE5 FULLWIDTH YEN SIGN');
+insert into t1 (ujis,name) values (0xA2CC, 'U+00AC NOT SIGN');
+insert into t1 (ujis,name) values (0x8FA2B7, 'U+007E TILDE');
+insert into t1 (ujis,name) values (0x8FA2C3, 'U+00A6 BROKEN BAR');
+update t1 set ucs2=ujis, ujis2=ucs2;
+select hex(ujis), hex(ucs2), hex(ujis2), name from t1;
+hex(ujis) hex(ucs2) hex(ujis2) name
+5C 005C 5C U+005C REVERSE SOLIDUS
+7E 007E 7E U+007E TILDE
+A1B1 FFE3 A1B1 U+FFE3 FULLWIDTH MACRON
+A1BD 2015 A1BD U+2015 HORIZONTAL BAR
+A1C0 005C 5C U+005C REVERSE SOLIDUS
+A1C1 301C A1C1 U+301C WAVE DASH
+A1C2 2016 A1C2 U+2016 DOUBLE VERTICAL LINE
+A1DD 2212 A1DD U+2212 MINUS SIGN
+A1F1 00A2 A1F1 U+00A2 CENT SIGN
+A1F2 00A3 A1F2 U+00A3 POUND SIGN
+A1EF FFE5 A1EF U+FFE5 FULLWIDTH YEN SIGN
+A2CC 00AC A2CC U+00AC NOT SIGN
+8FA2B7 007E 7E U+007E TILDE
+8FA2C3 00A6 8FA2C3 U+00A6 BROKEN BAR
+drop table t1;
+create table t1 (
+ujis char(1) character set ujis,
+ucs2 char(1) character set ucs2,
+name char(64)
+);
+insert into t1 (ucs2,name) values (0x00A5,'U+00A5 YEN SIGN');
+insert into t1 (ucs2,name) values (0x2014,'U+2014 EM DASH');
+insert into t1 (ucs2,name) values (0x203E,'U+203E OVERLINE');
+insert into t1 (ucs2,name) values (0x2225,'U+2225 PARALLEL TO');
+insert into t1 (ucs2,name) values (0xFF0D,'U+FF0D FULLWIDTH HYPHEN-MINUS');
+insert into t1 (ucs2,name) values (0xFF3C,'U+FF3C FULLWIDTH REVERSE SOLIDUS');
+insert into t1 (ucs2,name) values (0xFF5E,'U+FF5E FULLWIDTH TILDE');
+insert into t1 (ucs2,name) values (0xFFE0,'U+FFE0 FULLWIDTH CENT SIGN');
+insert into t1 (ucs2,name) values (0xFFE1,'U+FFE1 FULLWIDTH POUND SIGN');
+insert into t1 (ucs2,name) values (0xFFE2,'U+FFE2 FULLWIDTH NOT SIGN');
+insert into t1 (ucs2,name) values (0xFFE4,'U+FFE4 FULLWIDTH BROKEN BAR');
+update t1 set ujis=ucs2;
+Warnings:
+Warning 1366 Incorrect string value: '\x00\xA5' for column 'ujis' at row 1
+Warning 1366 Incorrect string value: '\x20\x14' for column 'ujis' at row 2
+Warning 1366 Incorrect string value: '\x20\x3E' for column 'ujis' at row 3
+Warning 1366 Incorrect string value: '\x22\x25' for column 'ujis' at row 4
+Warning 1366 Incorrect string value: '\xFF\x0D' for column 'ujis' at row 5
+Warning 1366 Incorrect string value: '\xFF\x3C' for column 'ujis' at row 6
+Warning 1366 Incorrect string value: '\xFF\x5E' for column 'ujis' at row 7
+Warning 1366 Incorrect string value: '\xFF\xE0' for column 'ujis' at row 8
+Warning 1366 Incorrect string value: '\xFF\xE1' for column 'ujis' at row 9
+Warning 1366 Incorrect string value: '\xFF\xE2' for column 'ujis' at row 10
+Warning 1366 Incorrect string value: '\xFF\xE4' for column 'ujis' at row 11
+select hex(ucs2),hex(ujis),name from t1 order by name;
+hex(ucs2) hex(ujis) name
+00A5 3F U+00A5 YEN SIGN
+2014 3F U+2014 EM DASH
+203E 3F U+203E OVERLINE
+2225 3F U+2225 PARALLEL TO
+FF0D 3F U+FF0D FULLWIDTH HYPHEN-MINUS
+FF3C 3F U+FF3C FULLWIDTH REVERSE SOLIDUS
+FF5E 3F U+FF5E FULLWIDTH TILDE
+FFE0 3F U+FFE0 FULLWIDTH CENT SIGN
+FFE1 3F U+FFE1 FULLWIDTH POUND SIGN
+FFE2 3F U+FFE2 FULLWIDTH NOT SIGN
+FFE4 3F U+FFE4 FULLWIDTH BROKEN BAR
+drop table t1;
+End of 5.1 tests
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 3abba528164..715dfb1b7d8 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -1454,8 +1454,8 @@ insert into t1 values ('123'), ('456');
explain
select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE Y ALL NULL NULL NULL NULL 2 Using temporary; Using filesort; Using join cache
-1 SIMPLE Z ALL NULL NULL NULL NULL 2 Using where
+1 SIMPLE Y ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
+1 SIMPLE Z ALL NULL NULL NULL NULL 2 Using where; Using join buffer
select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1;
substr(Z.a,-1) a
3 123
@@ -1639,6 +1639,42 @@ coercibility(col1) collation(col1)
0 utf8_swedish_ci
drop view v1, v2;
drop table t1;
+set names utf8;
+create table t1 (a varchar(10) character set latin1, b int);
+insert into t1 values ('a',1);
+select concat(a, if(b>10, N'x', N'y')) from t1;
+concat(a, if(b>10, N'x', N'y'))
+ay
+select concat(a, if(b>10, N'æ', N'ß')) from t1;
+ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation 'concat'
+drop table t1;
+set names utf8;
+create table t1 (a varchar(10) character set latin1, b int);
+insert into t1 values ('a',1);
+select concat(a, if(b>10, _utf8'x', _utf8'y')) from t1;
+concat(a, if(b>10, _utf8'x', _utf8'y'))
+ay
+select concat(a, if(b>10, _utf8'æ', _utf8'ß')) from t1;
+ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation 'concat'
+drop table t1;
+set names utf8;
+create table t1 (a varchar(10) character set latin1, b int);
+insert into t1 values ('a',1);
+select concat(a, if(b>10, _utf8 0x78, _utf8 0x79)) from t1;
+concat(a, if(b>10, _utf8 0x78, _utf8 0x79))
+ay
+select concat(a, if(b>10, _utf8 0xC3A6, _utf8 0xC3AF)) from t1;
+ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation 'concat'
+drop table t1;
+set names utf8;
+create table t1 (a varchar(10) character set latin1, b int);
+insert into t1 values ('a',1);
+select concat(a, if(b>10, 'x' 'x', 'y' 'y')) from t1;
+concat(a, if(b>10, 'x' 'x', 'y' 'y'))
+ayy
+select concat(a, if(b>10, 'x' 'æ', 'y' 'ß')) from t1;
+ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation 'concat'
+drop table t1;
CREATE TABLE t1 (
colA int(11) NOT NULL,
colB varchar(255) character set utf8 NOT NULL,
@@ -1657,3 +1693,40 @@ colA colB colA colB
1 foo 1 foo
2 foo bar 2 foo bar
DROP TABLE t1, t2;
+SELECT 'н1234567890' UNION SELECT _binary '1';
+н1234567890
+н1234567890
+1
+SELECT 'н1234567890' UNION SELECT 1;
+н1234567890
+н1234567890
+1
+SELECT '1' UNION SELECT 'н1234567890';
+1
+1
+н1234567890
+SELECT 1 UNION SELECT 'н1234567890';
+1
+1
+н1234567890
+CREATE TABLE t1 (c VARCHAR(11)) CHARACTER SET utf8;
+CREATE TABLE t2 (b CHAR(1) CHARACTER SET binary, i INT);
+INSERT INTO t1 (c) VALUES ('н1234567890');
+INSERT INTO t2 (b, i) VALUES ('1', 1);
+SELECT c FROM t1 UNION SELECT b FROM t2;
+c
+н1234567890
+1
+SELECT c FROM t1 UNION SELECT i FROM t2;
+c
+н1234567890
+1
+SELECT b FROM t2 UNION SELECT c FROM t1;
+b
+1
+н1234567890
+SELECT i FROM t2 UNION SELECT c FROM t1;
+i
+1
+н1234567890
+DROP TABLE t1, t2;
diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result
index 7375260d863..c1c8b7b060e 100644
--- a/mysql-test/r/date_formats.result
+++ b/mysql-test/r/date_formats.result
@@ -1,17 +1,13 @@
drop table if exists t1;
-SHOW GLOBAL VARIABLES LIKE "%_format%";
+SHOW GLOBAL VARIABLES LIKE "%e_format";
Variable_name Value
-binlog_format <format>
date_format %d.%m.%Y
datetime_format %Y-%m-%d %H:%i:%s
-default_week_format 0
time_format %H.%i.%s
-SHOW SESSION VARIABLES LIKE "%_format%";
+SHOW SESSION VARIABLES LIKE "%e_format";
Variable_name Value
-binlog_format <format>
date_format %d.%m.%Y
datetime_format %Y-%m-%d %H:%i:%s
-default_week_format 0
time_format %H.%i.%s
SET time_format='%H%i%s';
SET time_format='%H:%i:%s.%f';
@@ -30,12 +26,10 @@ set datetime_format= '%H:%i:%s %Y-%m-%d';
set datetime_format= '%H:%i:%s.%f %m-%d-%Y';
set datetime_format= '%h:%i:%s %p %Y-%m-%d';
set datetime_format= '%h:%i:%s.%f %p %Y-%m-%d';
-SHOW SESSION VARIABLES LIKE "%format";
+SHOW SESSION VARIABLES LIKE "%e_format";
Variable_name Value
-binlog_format <format>
date_format %m-%d-%Y
datetime_format %h:%i:%s.%f %p %Y-%m-%d
-default_week_format 0
time_format %h:%i:%s%p
SET time_format='%h:%i:%s';
ERROR 42000: Variable 'time_format' can't be set to the value of '%h:%i:%s'
@@ -86,7 +80,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_time
+Error 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'),
@@ -358,21 +352,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_time
-Error 1411 Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_time
-Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_time
-Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AN' for function str_to_time
-Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_time
-Error 1411 Incorrect datetime value: '10:20:10AM' for function str_to_time
-Error 1411 Incorrect datetime value: '15 Septembei 2001' for function str_to_time
-Error 1411 Incorrect datetime value: '15 Ju 2001' for function str_to_time
-Error 1411 Incorrect datetime value: 'Sund 15 MA' for function str_to_time
-Error 1411 Incorrect datetime value: 'Thursdai 12 1998' for function str_to_time
-Error 1411 Incorrect datetime value: 'Sunday 01 2001' for function str_to_time
-Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time
-Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time
-Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time
-Error 1411 Incorrect datetime value: '7 53 1998' for function str_to_time
+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
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
@@ -392,21 +386,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_time
-Error 1411 Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_time
-Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_time
-Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AN' for function str_to_time
-Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_time
-Error 1411 Incorrect datetime value: '10:20:10AM' for function str_to_time
-Error 1411 Incorrect datetime value: '15 Septembei 2001' for function str_to_time
-Error 1411 Incorrect datetime value: '15 Ju 2001' for function str_to_time
-Error 1411 Incorrect datetime value: 'Sund 15 MA' for function str_to_time
-Error 1411 Incorrect datetime value: 'Thursdai 12 1998' for function str_to_time
-Error 1411 Incorrect datetime value: 'Sunday 01 2001' for function str_to_time
-Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time
-Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time
-Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time
-Error 1411 Incorrect datetime value: '7 53 1998' for function str_to_time
+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
truncate table t1;
insert into t1 values
('10:20:10AM', '%h:%i:%s'),
@@ -446,7 +440,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_time
+Error 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
new file mode 100644
index 00000000000..3d38319df21
--- /dev/null
+++ b/mysql-test/r/ddl_i18n_koi8r.result
@@ -0,0 +1,2795 @@
+set names koi8r;
+
+-------------------------------------------------------------------
+Views
+-------------------------------------------------------------------
+
+DROP DATABASE IF EXISTS mysqltest1|
+CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+use mysqltest1|
+CREATE TABLE t1(ËÏÌ INT)|
+INSERT INTO t1 VALUES(1)|
+
+CREATE VIEW v1 AS
+SELECT 'ÔÅÓÔ' AS c1, ËÏÌ AS c2
+FROM t1|
+
+CREATE VIEW v2 AS SELECT _utf8'теÑÑ‚' as c1|
+
+
+
+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 _koi8r'ÔÅÓÔ' AS `c1`,`t1`.`ËÏÌ` AS `c2` from `t1` koi8r koi8r_general_ci
+
+SHOW CREATE VIEW v2|
+View Create View character_set_client collation_connection
+v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select _utf8'теÑÑ‚' AS `c1` koi8r koi8r_general_ci
+
+
+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, ËÏÌ AS c2 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
+
+
+SELECT COLLATION(c1), COLLATION(c2) FROM v1|
+COLLATION(c1) COLLATION(c2)
+koi8r_general_ci binary
+
+SELECT COLLATION(c1) FROM v2|
+COLLATION(c1)
+utf8_general_ci
+
+
+ALTER DATABASE mysqltest1 COLLATE cp866_general_ci|
+
+---> connection: con2
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+SELECT * FROM mysqltest1.v1|
+SELECT * FROM mysqltest1.v2|
+use mysqltest1|
+set names koi8r|
+
+
+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 _koi8r'ÔÅÓÔ' AS `c1`,`t1`.`ËÏÌ` AS `c2` from `t1` koi8r koi8r_general_ci
+
+SHOW CREATE VIEW v2|
+View Create View character_set_client collation_connection
+v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select _utf8'теÑÑ‚' AS `c1` koi8r koi8r_general_ci
+
+
+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, ËÏÌ AS c2 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
+
+
+SELECT COLLATION(c1), COLLATION(c2) FROM v1|
+COLLATION(c1) COLLATION(c2)
+koi8r_general_ci binary
+
+SELECT COLLATION(c1) FROM v2|
+COLLATION(c1)
+utf8_general_ci
+
+---> Dumping mysqltest1 to ddl_i18n_koi8r.views.mysqltest1.sql
+
+
+DROP DATABASE mysqltest1|
+
+
+---> Restoring mysqltest1...
+
+---> connection: con3
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+SELECT * FROM mysqltest1.v1|
+SELECT * FROM mysqltest1.v2|
+use mysqltest1|
+set names koi8r|
+
+
+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 _koi8r'ÔÅÓÔ' AS `c1`,`t1`.`ËÏÌ` AS `c2` from `t1` koi8r koi8r_general_ci
+
+SHOW CREATE VIEW v2|
+View Create View character_set_client collation_connection
+v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select _utf8'теÑÑ‚' AS `c1` koi8r koi8r_general_ci
+
+
+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`,`t1`.`ËÏÌ` AS `c2` from `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
+
+
+SELECT COLLATION(c1), COLLATION(c2) FROM v1|
+COLLATION(c1) COLLATION(c2)
+koi8r_general_ci binary
+
+SELECT COLLATION(c1) FROM v2|
+COLLATION(c1)
+utf8_general_ci
+
+---> connection: default
+use test|
+DROP DATABASE mysqltest1|
+
+-------------------------------------------------------------------
+Stored procedures/functions
+-------------------------------------------------------------------
+
+DROP DATABASE IF EXISTS mysqltest1|
+DROP DATABASE IF EXISTS mysqltest2|
+CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+use mysqltest1|
+
+CREATE PROCEDURE p1(
+INOUT ÐÁÒÁÍ1 CHAR(10),
+OUT ÐÁÒÁÍ2 CHAR(10))
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c5,
+COLLATION(_utf8 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END|
+
+CREATE PROCEDURE p2(
+INOUT ÐÁÒÁÍ1 CHAR(10) CHARACTER SET utf8,
+OUT ÐÁÒÁÍ2 CHAR(10) CHARACTER SET utf8)
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c5,
+COLLATION(_utf8 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END|
+
+CREATE PROCEDURE mysqltest2.p3(
+INOUT ÐÁÒÁÍ1 CHAR(10),
+OUT ÐÁÒÁÍ2 CHAR(10))
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c5,
+COLLATION(_utf8 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END|
+
+CREATE PROCEDURE mysqltest2.p4(
+INOUT ÐÁÒÁÍ1 CHAR(10) CHARACTER SET utf8,
+OUT ÐÁÒÁÍ2 CHAR(10) CHARACTER SET utf8)
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c5,
+COLLATION(_utf8 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END|
+
+
+SHOW CREATE PROCEDURE p1|
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`(
+INOUT ÐÁÒÁÍ1 CHAR(10),
+OUT ÐÁÒÁÍ2 CHAR(10))
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c5,
+COLLATION(_utf8 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW CREATE PROCEDURE p2|
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p2 CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`(
+INOUT ÐÁÒÁÍ1 CHAR(10) CHARACTER SET utf8,
+OUT ÐÁÒÁÍ2 CHAR(10) CHARACTER SET utf8)
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c5,
+COLLATION(_utf8 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW CREATE PROCEDURE mysqltest2.p3|
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p3 CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`(
+INOUT ÐÁÒÁÍ1 CHAR(10),
+OUT ÐÁÒÁÍ2 CHAR(10))
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c5,
+COLLATION(_utf8 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW CREATE PROCEDURE mysqltest2.p4|
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p4 CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`(
+INOUT ÐÁÒÁÍ1 CHAR(10) CHARACTER SET utf8,
+OUT ÐÁÒÁÍ2 CHAR(10) CHARACTER SET utf8)
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c5,
+COLLATION(_utf8 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END koi8r koi8r_general_ci utf8_unicode_ci
+
+
+SHOW PROCEDURE STATUS LIKE 'p1'|
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+mysqltest1 p1 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW PROCEDURE STATUS LIKE 'p2'|
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+mysqltest1 p2 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW PROCEDURE STATUS LIKE 'p3'|
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+mysqltest2 p3 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW PROCEDURE STATUS LIKE 'p4'|
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_general_ci utf8_unicode_ci
+
+
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION( 'ÔÅËÓÔ') AS c5,
+COLLATION( 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'|
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
+p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION( 'ÔÅËÓÔ') AS c5,
+COLLATION( 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'|
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
+p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION( 'ÔÅËÓÔ') AS c5,
+COLLATION( 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'|
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
+p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION( 'ÔÅËÓÔ') AS c5,
+COLLATION( 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+
+
+SET @a = '1'|
+SET @b = '2'|
+
+
+CALL p1(@a, @b)|
+c1 c2 c3
+utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci
+c4 c5 c6 c7 c8
+koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r
+SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
+ca cb
+utf8_unicode_ci utf8_unicode_ci
+
+CALL p2(@a, @b)|
+c1 c2 c3
+utf8_general_ci utf8_general_ci utf8_general_ci
+c4 c5 c6 c7 c8
+koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r
+SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
+ca cb
+utf8_general_ci utf8_general_ci
+
+CALL mysqltest2.p3(@a, @b)|
+c1 c2 c3
+utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci
+c4 c5 c6 c7 c8
+koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r
+SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
+ca cb
+utf8_unicode_ci utf8_unicode_ci
+
+CALL mysqltest2.p4(@a, @b)|
+c1 c2 c3
+utf8_general_ci utf8_general_ci utf8_general_ci
+c4 c5 c6 c7 c8
+koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r
+SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
+ca cb
+utf8_general_ci utf8_general_ci
+
+
+ALTER DATABASE mysqltest1 COLLATE cp866_general_ci|
+ALTER DATABASE mysqltest2 COLLATE cp866_general_ci|
+
+---> connection: con2
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+CALL p1(@a, @b)|
+c1 c2 c3
+utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci
+c4 c5 c6 c7 c8
+koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r
+CALL p2(@a, @b)|
+c1 c2 c3
+utf8_general_ci utf8_general_ci utf8_general_ci
+c4 c5 c6 c7 c8
+koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r
+CALL mysqltest2.p3(@a, @b)|
+c1 c2 c3
+utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci
+c4 c5 c6 c7 c8
+koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r
+CALL mysqltest2.p4(@a, @b)|
+c1 c2 c3
+utf8_general_ci utf8_general_ci utf8_general_ci
+c4 c5 c6 c7 c8
+koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r
+set names koi8r|
+
+
+SHOW CREATE PROCEDURE p1|
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`(
+INOUT ÐÁÒÁÍ1 CHAR(10),
+OUT ÐÁÒÁÍ2 CHAR(10))
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c5,
+COLLATION(_utf8 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW CREATE PROCEDURE p2|
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p2 CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`(
+INOUT ÐÁÒÁÍ1 CHAR(10) CHARACTER SET utf8,
+OUT ÐÁÒÁÍ2 CHAR(10) CHARACTER SET utf8)
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c5,
+COLLATION(_utf8 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW CREATE PROCEDURE mysqltest2.p3|
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p3 CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`(
+INOUT ÐÁÒÁÍ1 CHAR(10),
+OUT ÐÁÒÁÍ2 CHAR(10))
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c5,
+COLLATION(_utf8 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW CREATE PROCEDURE mysqltest2.p4|
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p4 CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`(
+INOUT ÐÁÒÁÍ1 CHAR(10) CHARACTER SET utf8,
+OUT ÐÁÒÁÍ2 CHAR(10) CHARACTER SET utf8)
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c5,
+COLLATION(_utf8 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END koi8r koi8r_general_ci utf8_unicode_ci
+
+
+SHOW PROCEDURE STATUS LIKE 'p1'|
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+mysqltest1 p1 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW PROCEDURE STATUS LIKE 'p2'|
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+mysqltest1 p2 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW PROCEDURE STATUS LIKE 'p3'|
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+mysqltest2 p3 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW PROCEDURE STATUS LIKE 'p4'|
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_general_ci utf8_unicode_ci
+
+
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION( 'ÔÅËÓÔ') AS c5,
+COLLATION( 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'|
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
+p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION( 'ÔÅËÓÔ') AS c5,
+COLLATION( 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'|
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
+p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION( 'ÔÅËÓÔ') AS c5,
+COLLATION( 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'|
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
+p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION( 'ÔÅËÓÔ') AS c5,
+COLLATION( 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+
+
+SET @a = '1'|
+SET @b = '2'|
+
+
+CALL p1(@a, @b)|
+c1 c2 c3
+utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci
+c4 c5 c6 c7 c8
+koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r
+SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
+ca cb
+utf8_unicode_ci utf8_unicode_ci
+
+CALL p2(@a, @b)|
+c1 c2 c3
+utf8_general_ci utf8_general_ci utf8_general_ci
+c4 c5 c6 c7 c8
+koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r
+SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
+ca cb
+utf8_general_ci utf8_general_ci
+
+CALL mysqltest2.p3(@a, @b)|
+c1 c2 c3
+utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci
+c4 c5 c6 c7 c8
+koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r
+SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
+ca cb
+utf8_unicode_ci utf8_unicode_ci
+
+CALL mysqltest2.p4(@a, @b)|
+c1 c2 c3
+utf8_general_ci utf8_general_ci utf8_general_ci
+c4 c5 c6 c7 c8
+koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r
+SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
+ca cb
+utf8_general_ci utf8_general_ci
+
+---> Dump of mysqltest1
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp866 */;
+
+USE `mysqltest1`;
+ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = koi8r */ ;
+/*!50003 SET character_set_results = koi8r */ ;
+/*!50003 SET collation_connection = koi8r_general_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = '' */ ;
+DELIMITER ;;
+/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `p1`(
+INOUT ÐÁÒÁÍ1 CHAR(10),
+OUT ÐÁÒÁÍ2 CHAR(10))
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c5,
+COLLATION(_utf8 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END */;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ;
+ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = koi8r */ ;
+/*!50003 SET character_set_results = koi8r */ ;
+/*!50003 SET collation_connection = koi8r_general_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = '' */ ;
+DELIMITER ;;
+/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `p2`(
+INOUT ÐÁÒÁÍ1 CHAR(10) CHARACTER SET utf8,
+OUT ÐÁÒÁÍ2 CHAR(10) CHARACTER SET utf8)
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c5,
+COLLATION(_utf8 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END */;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ;
+
+---> Dumping mysqltest1 to ddl_i18n_koi8r.sp.mysqltest1.sql
+
+---> Dump of mysqltest2
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER SET cp866 */;
+
+USE `mysqltest2`;
+ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = koi8r */ ;
+/*!50003 SET character_set_results = koi8r */ ;
+/*!50003 SET collation_connection = koi8r_general_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = '' */ ;
+DELIMITER ;;
+/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `p3`(
+INOUT ÐÁÒÁÍ1 CHAR(10),
+OUT ÐÁÒÁÍ2 CHAR(10))
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c5,
+COLLATION(_utf8 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END */;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ;
+ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = koi8r */ ;
+/*!50003 SET character_set_results = koi8r */ ;
+/*!50003 SET collation_connection = koi8r_general_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = '' */ ;
+DELIMITER ;;
+/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `p4`(
+INOUT ÐÁÒÁÍ1 CHAR(10) CHARACTER SET utf8,
+OUT ÐÁÒÁÍ2 CHAR(10) CHARACTER SET utf8)
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c5,
+COLLATION(_utf8 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END */;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ;
+
+---> Dumping mysqltest2 to ddl_i18n_koi8r.sp.mysqltest2.sql
+
+
+DROP DATABASE mysqltest1|
+DROP DATABASE mysqltest2|
+
+
+---> Restoring mysqltest1...
+---> Restoring mysqltest2...
+
+---> connection: con3
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+CALL p1(@a, @b)|
+c1 c2 c3
+utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci
+c4 c5 c6 c7 c8
+koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r
+CALL p2(@a, @b)|
+c1 c2 c3
+utf8_general_ci utf8_general_ci utf8_general_ci
+c4 c5 c6 c7 c8
+koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r
+CALL mysqltest2.p3(@a, @b)|
+c1 c2 c3
+utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci
+c4 c5 c6 c7 c8
+koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r
+CALL mysqltest2.p4(@a, @b)|
+c1 c2 c3
+utf8_general_ci utf8_general_ci utf8_general_ci
+c4 c5 c6 c7 c8
+koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r
+set names koi8r|
+
+
+SHOW CREATE PROCEDURE p1|
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`(
+INOUT ÐÁÒÁÍ1 CHAR(10),
+OUT ÐÁÒÁÍ2 CHAR(10))
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c5,
+COLLATION(_utf8 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW CREATE PROCEDURE p2|
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p2 CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`(
+INOUT ÐÁÒÁÍ1 CHAR(10) CHARACTER SET utf8,
+OUT ÐÁÒÁÍ2 CHAR(10) CHARACTER SET utf8)
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c5,
+COLLATION(_utf8 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW CREATE PROCEDURE mysqltest2.p3|
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p3 CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`(
+INOUT ÐÁÒÁÍ1 CHAR(10),
+OUT ÐÁÒÁÍ2 CHAR(10))
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c5,
+COLLATION(_utf8 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW CREATE PROCEDURE mysqltest2.p4|
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p4 CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`(
+INOUT ÐÁÒÁÍ1 CHAR(10) CHARACTER SET utf8,
+OUT ÐÁÒÁÍ2 CHAR(10) CHARACTER SET utf8)
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c5,
+COLLATION(_utf8 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END koi8r koi8r_general_ci utf8_unicode_ci
+
+
+SHOW PROCEDURE STATUS LIKE 'p1'|
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+mysqltest1 p1 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW PROCEDURE STATUS LIKE 'p2'|
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+mysqltest1 p2 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW PROCEDURE STATUS LIKE 'p3'|
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+mysqltest2 p3 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW PROCEDURE STATUS LIKE 'p4'|
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_general_ci utf8_unicode_ci
+
+
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION( 'ÔÅËÓÔ') AS c5,
+COLLATION( 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'|
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
+p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION( 'ÔÅËÓÔ') AS c5,
+COLLATION( 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'|
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
+p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION( 'ÔÅËÓÔ') AS c5,
+COLLATION( 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'|
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
+p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION(ÐÁÒÁÍ1) AS c2,
+COLLATION(ÐÁÒÁÍ2) AS c3;
+SELECT
+COLLATION('ÔÅËÓÔ') AS c4,
+COLLATION( 'ÔÅËÓÔ') AS c5,
+COLLATION( 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET ÐÁÒÁÍ1 = 'a';
+SET ÐÁÒÁÍ2 = 'b';
+END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+
+
+SET @a = '1'|
+SET @b = '2'|
+
+
+CALL p1(@a, @b)|
+c1 c2 c3
+utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci
+c4 c5 c6 c7 c8
+koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r
+SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
+ca cb
+utf8_unicode_ci utf8_unicode_ci
+
+CALL p2(@a, @b)|
+c1 c2 c3
+utf8_general_ci utf8_general_ci utf8_general_ci
+c4 c5 c6 c7 c8
+koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r
+SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
+ca cb
+utf8_general_ci utf8_general_ci
+
+CALL mysqltest2.p3(@a, @b)|
+c1 c2 c3
+utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci
+c4 c5 c6 c7 c8
+koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r
+SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
+ca cb
+utf8_unicode_ci utf8_unicode_ci
+
+CALL mysqltest2.p4(@a, @b)|
+c1 c2 c3
+utf8_general_ci utf8_general_ci utf8_general_ci
+c4 c5 c6 c7 c8
+koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r
+SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
+ca cb
+utf8_general_ci utf8_general_ci
+
+---> connection: default
+use test|
+DROP DATABASE mysqltest1|
+DROP DATABASE mysqltest2|
+
+-------------------------------------------------------------------
+Triggers
+-------------------------------------------------------------------
+
+DROP DATABASE IF EXISTS mysqltest1|
+DROP DATABASE IF EXISTS mysqltest2|
+CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+use mysqltest1|
+CREATE TABLE t1(c INT)|
+CREATE TABLE mysqltest2.t1(c INT)|
+CREATE TABLE log(msg VARCHAR(255))|
+CREATE TABLE mysqltest2.log(msg VARCHAR(255))|
+
+CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'ÔÅËÓÔ';
+SET @a1 = _koi8r 'ÔÅËÓÔ';
+SET @a2 = _utf8 'текÑÑ‚';
+END|
+
+CREATE TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'ÔÅËÓÔ';
+SET @b1 = _koi8r 'ÔÅËÓÔ';
+SET @b2 = _utf8 'текÑÑ‚';
+END|
+
+CREATE TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'ÔÅËÓÔ';
+SET @a1 = _koi8r 'ÔÅËÓÔ';
+SET @a2 = _utf8 'текÑÑ‚';
+END|
+
+CREATE TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'ÔÅËÓÔ';
+SET @b1 = _koi8r 'ÔÅËÓÔ';
+SET @b2 = _utf8 'текÑÑ‚';
+END|
+
+
+
+SHOW CREATE TRIGGER trg1|
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+trg1 CREATE DEFINER=`root`@`localhost` TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'ÔÅËÓÔ';
+SET @a1 = _koi8r 'ÔÅËÓÔ';
+SET @a2 = _utf8 'текÑÑ‚';
+END koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW CREATE TRIGGER trg2|
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+trg2 CREATE DEFINER=`root`@`localhost` TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'ÔÅËÓÔ';
+SET @b1 = _koi8r 'ÔÅËÓÔ';
+SET @b2 = _utf8 'текÑÑ‚';
+END koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW CREATE TRIGGER mysqltest2.trg3|
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+trg3 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'ÔÅËÓÔ';
+SET @a1 = _koi8r 'ÔÅËÓÔ';
+SET @a2 = _utf8 'текÑÑ‚';
+END koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW CREATE TRIGGER mysqltest2.trg4|
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+trg4 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'ÔÅËÓÔ';
+SET @b1 = _koi8r 'ÔÅËÓÔ';
+SET @b2 = _utf8 'текÑÑ‚';
+END koi8r koi8r_general_ci utf8_unicode_ci
+
+
+SHOW TRIGGERS|
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+trg1 INSERT t1 BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'ÔÅËÓÔ';
+SET @a1 = 'ÔÅËÓÔ';
+SET @a2 = 'ÔÅËÓÔ';
+END BEFORE NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+trg2 INSERT t1 BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'ÔÅËÓÔ';
+SET @b1 = 'ÔÅËÓÔ';
+SET @b2 = 'ÔÅËÓÔ';
+END AFTER NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+
+use mysqltest2|
+
+SHOW TRIGGERS|
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+trg3 INSERT t1 BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'ÔÅËÓÔ';
+SET @a1 = 'ÔÅËÓÔ';
+SET @a2 = 'ÔÅËÓÔ';
+END BEFORE NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+trg4 INSERT t1 BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'ÔÅËÓÔ';
+SET @b1 = 'ÔÅËÓÔ';
+SET @b2 = 'ÔÅËÓÔ';
+END AFTER NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'ÔÅËÓÔ';
+SET @a1 = 'ÔÅËÓÔ';
+SET @a2 = 'ÔÅËÓÔ';
+END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_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
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'ÔÅËÓÔ';
+SET @b1 = 'ÔÅËÓÔ';
+SET @b2 = 'ÔÅËÓÔ';
+END ROW AFTER NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'ÔÅËÓÔ';
+SET @a1 = 'ÔÅËÓÔ';
+SET @a2 = 'ÔÅËÓÔ';
+END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_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
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'ÔÅËÓÔ';
+SET @b1 = 'ÔÅËÓÔ';
+SET @b2 = 'ÔÅËÓÔ';
+END ROW AFTER NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+
+
+SET @a1 = '1'|
+SET @a2 = '1'|
+SET @a3 = '1'|
+SET @b1 = '2'|
+SET @b2 = '2'|
+SET @b3 = '2'|
+
+
+INSERT INTO t1 VALUES(1)|
+
+---> Log:
+SELECT msg FROM log|
+msg
+utf8_unicode_ci
+koi8r_general_ci
+koi8r_general_ci
+utf8_general_ci
+koi8r_general_ci
+koi8r
+utf8_general_ci
+koi8r_general_ci
+koi8r_general_ci
+utf8_general_ci
+koi8r_general_ci
+koi8r
+
+SELECT
+COLLATION(@a1) AS ca1,
+COLLATION(@a2) AS ca2,
+COLLATION(@a3) AS ca3,
+COLLATION(@b1) AS cb1,
+COLLATION(@b2) AS cb2,
+COLLATION(@b3) AS cb3|
+ca1 ca2 ca3 cb1 cb2 cb3
+koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci
+
+DELETE FROM log|
+
+
+INSERT INTO mysqltest2.t1 VALUES(1)|
+
+---> Log:
+SELECT msg FROM mysqltest2.log|
+msg
+utf8_unicode_ci
+koi8r_general_ci
+koi8r_general_ci
+utf8_general_ci
+koi8r_general_ci
+koi8r
+utf8_general_ci
+koi8r_general_ci
+koi8r_general_ci
+utf8_general_ci
+koi8r_general_ci
+koi8r
+
+SELECT
+COLLATION(@a1) AS ca1,
+COLLATION(@a2) AS ca2,
+COLLATION(@a3) AS ca3,
+COLLATION(@b1) AS cb1,
+COLLATION(@b2) AS cb2,
+COLLATION(@b3) AS cb3|
+ca1 ca2 ca3 cb1 cb2 cb3
+koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci
+
+DELETE FROM mysqltest2.log|
+
+
+ALTER DATABASE mysqltest1 COLLATE cp866_general_ci|
+ALTER DATABASE mysqltest2 COLLATE cp866_general_ci|
+ALTER TABLE t1 ADD COLUMN fake INT|
+ALTER TABLE t1 DROP COLUMN fake|
+ALTER TABLE mysqltest2.t1 ADD COLUMN fake INT|
+ALTER TABLE mysqltest2.t1 DROP COLUMN fake|
+
+---> connection: con2
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+INSERT INTO mysqltest1.t1 VALUES(0)|
+INSERT INTO mysqltest2.t1 VALUES(0)|
+DELETE FROM mysqltest1.log|
+DELETE FROM mysqltest2.log|
+set names koi8r|
+use mysqltest1|
+
+
+SHOW CREATE TRIGGER trg1|
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+trg1 CREATE DEFINER=`root`@`localhost` TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'ÔÅËÓÔ';
+SET @a1 = _koi8r 'ÔÅËÓÔ';
+SET @a2 = _utf8 'текÑÑ‚';
+END koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW CREATE TRIGGER trg2|
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+trg2 CREATE DEFINER=`root`@`localhost` TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'ÔÅËÓÔ';
+SET @b1 = _koi8r 'ÔÅËÓÔ';
+SET @b2 = _utf8 'текÑÑ‚';
+END koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW CREATE TRIGGER mysqltest2.trg3|
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+trg3 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'ÔÅËÓÔ';
+SET @a1 = _koi8r 'ÔÅËÓÔ';
+SET @a2 = _utf8 'текÑÑ‚';
+END koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW CREATE TRIGGER mysqltest2.trg4|
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+trg4 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'ÔÅËÓÔ';
+SET @b1 = _koi8r 'ÔÅËÓÔ';
+SET @b2 = _utf8 'текÑÑ‚';
+END koi8r koi8r_general_ci utf8_unicode_ci
+
+
+SHOW TRIGGERS|
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+trg1 INSERT t1 BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'ÔÅËÓÔ';
+SET @a1 = 'ÔÅËÓÔ';
+SET @a2 = 'ÔÅËÓÔ';
+END BEFORE NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+trg2 INSERT t1 BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'ÔÅËÓÔ';
+SET @b1 = 'ÔÅËÓÔ';
+SET @b2 = 'ÔÅËÓÔ';
+END AFTER NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+
+use mysqltest2|
+
+SHOW TRIGGERS|
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+trg3 INSERT t1 BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'ÔÅËÓÔ';
+SET @a1 = 'ÔÅËÓÔ';
+SET @a2 = 'ÔÅËÓÔ';
+END BEFORE NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+trg4 INSERT t1 BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'ÔÅËÓÔ';
+SET @b1 = 'ÔÅËÓÔ';
+SET @b2 = 'ÔÅËÓÔ';
+END AFTER NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'ÔÅËÓÔ';
+SET @a1 = 'ÔÅËÓÔ';
+SET @a2 = 'ÔÅËÓÔ';
+END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_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
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'ÔÅËÓÔ';
+SET @b1 = 'ÔÅËÓÔ';
+SET @b2 = 'ÔÅËÓÔ';
+END ROW AFTER NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'ÔÅËÓÔ';
+SET @a1 = 'ÔÅËÓÔ';
+SET @a2 = 'ÔÅËÓÔ';
+END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_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
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'ÔÅËÓÔ';
+SET @b1 = 'ÔÅËÓÔ';
+SET @b2 = 'ÔÅËÓÔ';
+END ROW AFTER NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+
+
+SET @a1 = '1'|
+SET @a2 = '1'|
+SET @a3 = '1'|
+SET @b1 = '2'|
+SET @b2 = '2'|
+SET @b3 = '2'|
+
+
+INSERT INTO t1 VALUES(1)|
+
+---> Log:
+SELECT msg FROM log|
+msg
+utf8_unicode_ci
+koi8r_general_ci
+koi8r_general_ci
+utf8_general_ci
+koi8r_general_ci
+koi8r
+utf8_general_ci
+koi8r_general_ci
+koi8r_general_ci
+utf8_general_ci
+koi8r_general_ci
+koi8r
+
+SELECT
+COLLATION(@a1) AS ca1,
+COLLATION(@a2) AS ca2,
+COLLATION(@a3) AS ca3,
+COLLATION(@b1) AS cb1,
+COLLATION(@b2) AS cb2,
+COLLATION(@b3) AS cb3|
+ca1 ca2 ca3 cb1 cb2 cb3
+koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci
+
+DELETE FROM log|
+
+
+INSERT INTO mysqltest2.t1 VALUES(1)|
+
+---> Log:
+SELECT msg FROM mysqltest2.log|
+msg
+utf8_unicode_ci
+koi8r_general_ci
+koi8r_general_ci
+utf8_general_ci
+koi8r_general_ci
+koi8r
+utf8_general_ci
+koi8r_general_ci
+koi8r_general_ci
+utf8_general_ci
+koi8r_general_ci
+koi8r
+
+SELECT
+COLLATION(@a1) AS ca1,
+COLLATION(@a2) AS ca2,
+COLLATION(@a3) AS ca3,
+COLLATION(@b1) AS cb1,
+COLLATION(@b2) AS cb2,
+COLLATION(@b3) AS cb3|
+ca1 ca2 ca3 cb1 cb2 cb3
+koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci
+
+DELETE FROM mysqltest2.log|
+
+---> Dump of mysqltest1
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp866 */;
+
+USE `mysqltest1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `log` (
+ `msg` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+SET character_set_client = @saved_cs_client;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `t1` (
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+SET character_set_client = @saved_cs_client;
+INSERT INTO `t1` VALUES (1),(0),(1);
+ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = koi8r */ ;
+/*!50003 SET character_set_results = koi8r */ ;
+/*!50003 SET collation_connection = koi8r_general_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = '' */ ;
+DELIMITER ;;
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'ÔÅËÓÔ';
+SET @a1 = _koi8r 'ÔÅËÓÔ';
+SET @a2 = _utf8 'текÑÑ‚';
+END */;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ;
+ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = koi8r */ ;
+/*!50003 SET character_set_results = koi8r */ ;
+/*!50003 SET collation_connection = koi8r_general_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = '' */ ;
+DELIMITER ;;
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'ÔÅËÓÔ';
+SET @b1 = _koi8r 'ÔÅËÓÔ';
+SET @b2 = _utf8 'текÑÑ‚';
+END */;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ;
+
+---> Dumping mysqltest1 to ddl_i18n_koi8r.triggers.mysqltest1.sql
+
+---> Dump of mysqltest2
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER SET cp866 */;
+
+USE `mysqltest2`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `log` (
+ `msg` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+SET character_set_client = @saved_cs_client;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `t1` (
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+SET character_set_client = @saved_cs_client;
+INSERT INTO `t1` VALUES (1),(0),(1);
+ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = koi8r */ ;
+/*!50003 SET character_set_results = koi8r */ ;
+/*!50003 SET collation_connection = koi8r_general_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = '' */ ;
+DELIMITER ;;
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'ÔÅËÓÔ';
+SET @a1 = _koi8r 'ÔÅËÓÔ';
+SET @a2 = _utf8 'текÑÑ‚';
+END */;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ;
+ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = koi8r */ ;
+/*!50003 SET character_set_results = koi8r */ ;
+/*!50003 SET collation_connection = koi8r_general_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = '' */ ;
+DELIMITER ;;
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'ÔÅËÓÔ';
+SET @b1 = _koi8r 'ÔÅËÓÔ';
+SET @b2 = _utf8 'текÑÑ‚';
+END */;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ;
+
+---> Dumping mysqltest2 to ddl_i18n_koi8r.triggers.mysqltest2.sql
+
+
+DROP DATABASE mysqltest1|
+DROP DATABASE mysqltest2|
+
+
+---> Restoring mysqltest1...
+---> Restoring mysqltest2...
+ALTER TABLE mysqltest1.t1 ADD COLUMN fake INT|
+ALTER TABLE mysqltest1.t1 DROP COLUMN fake|
+ALTER TABLE mysqltest2.t1 ADD COLUMN fake INT|
+ALTER TABLE mysqltest2.t1 DROP COLUMN fake|
+
+---> connection: con3
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+INSERT INTO mysqltest1.t1 VALUES(0)|
+INSERT INTO mysqltest2.t1 VALUES(0)|
+DELETE FROM mysqltest1.log|
+DELETE FROM mysqltest2.log|
+set names koi8r|
+use mysqltest1|
+
+
+SHOW CREATE TRIGGER trg1|
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+trg1 CREATE DEFINER=`root`@`localhost` TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'ÔÅËÓÔ';
+SET @a1 = _koi8r 'ÔÅËÓÔ';
+SET @a2 = _utf8 'текÑÑ‚';
+END koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW CREATE TRIGGER trg2|
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+trg2 CREATE DEFINER=`root`@`localhost` TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'ÔÅËÓÔ';
+SET @b1 = _koi8r 'ÔÅËÓÔ';
+SET @b2 = _utf8 'текÑÑ‚';
+END koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW CREATE TRIGGER mysqltest2.trg3|
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+trg3 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'ÔÅËÓÔ';
+SET @a1 = _koi8r 'ÔÅËÓÔ';
+SET @a2 = _utf8 'текÑÑ‚';
+END koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW CREATE TRIGGER mysqltest2.trg4|
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+trg4 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'ÔÅËÓÔ';
+SET @b1 = _koi8r 'ÔÅËÓÔ';
+SET @b2 = _utf8 'текÑÑ‚';
+END koi8r koi8r_general_ci utf8_unicode_ci
+
+
+SHOW TRIGGERS|
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+trg1 INSERT t1 BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'ÔÅËÓÔ';
+SET @a1 = 'ÔÅËÓÔ';
+SET @a2 = 'ÔÅËÓÔ';
+END BEFORE NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+trg2 INSERT t1 BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'ÔÅËÓÔ';
+SET @b1 = 'ÔÅËÓÔ';
+SET @b2 = 'ÔÅËÓÔ';
+END AFTER NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+
+use mysqltest2|
+
+SHOW TRIGGERS|
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+trg3 INSERT t1 BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'ÔÅËÓÔ';
+SET @a1 = 'ÔÅËÓÔ';
+SET @a2 = 'ÔÅËÓÔ';
+END BEFORE NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+trg4 INSERT t1 BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'ÔÅËÓÔ';
+SET @b1 = 'ÔÅËÓÔ';
+SET @b2 = 'ÔÅËÓÔ';
+END AFTER NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'ÔÅËÓÔ';
+SET @a1 = 'ÔÅËÓÔ';
+SET @a2 = 'ÔÅËÓÔ';
+END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_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
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'ÔÅËÓÔ';
+SET @b1 = 'ÔÅËÓÔ';
+SET @b2 = 'ÔÅËÓÔ';
+END ROW AFTER NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'ÔÅËÓÔ';
+SET @a1 = 'ÔÅËÓÔ';
+SET @a2 = 'ÔÅËÓÔ';
+END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_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
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(COLLATION( 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'ÔÅËÓÔ';
+SET @b1 = 'ÔÅËÓÔ';
+SET @b2 = 'ÔÅËÓÔ';
+END ROW AFTER NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci
+
+
+SET @a1 = '1'|
+SET @a2 = '1'|
+SET @a3 = '1'|
+SET @b1 = '2'|
+SET @b2 = '2'|
+SET @b3 = '2'|
+
+
+INSERT INTO t1 VALUES(1)|
+
+---> Log:
+SELECT msg FROM log|
+msg
+utf8_unicode_ci
+koi8r_general_ci
+koi8r_general_ci
+utf8_general_ci
+koi8r_general_ci
+koi8r
+utf8_general_ci
+koi8r_general_ci
+koi8r_general_ci
+utf8_general_ci
+koi8r_general_ci
+koi8r
+
+SELECT
+COLLATION(@a1) AS ca1,
+COLLATION(@a2) AS ca2,
+COLLATION(@a3) AS ca3,
+COLLATION(@b1) AS cb1,
+COLLATION(@b2) AS cb2,
+COLLATION(@b3) AS cb3|
+ca1 ca2 ca3 cb1 cb2 cb3
+koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci
+
+DELETE FROM log|
+
+
+INSERT INTO mysqltest2.t1 VALUES(1)|
+
+---> Log:
+SELECT msg FROM mysqltest2.log|
+msg
+utf8_unicode_ci
+koi8r_general_ci
+koi8r_general_ci
+utf8_general_ci
+koi8r_general_ci
+koi8r
+utf8_general_ci
+koi8r_general_ci
+koi8r_general_ci
+utf8_general_ci
+koi8r_general_ci
+koi8r
+
+SELECT
+COLLATION(@a1) AS ca1,
+COLLATION(@a2) AS ca2,
+COLLATION(@a3) AS ca3,
+COLLATION(@b1) AS cb1,
+COLLATION(@b2) AS cb2,
+COLLATION(@b3) AS cb3|
+ca1 ca2 ca3 cb1 cb2 cb3
+koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci
+
+DELETE FROM mysqltest2.log|
+
+---> connection: default
+use test|
+DROP DATABASE mysqltest1|
+DROP DATABASE mysqltest2|
+
+-------------------------------------------------------------------
+Events
+-------------------------------------------------------------------
+
+DROP DATABASE IF EXISTS mysqltest1|
+DROP DATABASE IF EXISTS mysqltest2|
+CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+use mysqltest1|
+
+CREATE EVENT ev1 ON SCHEDULE AT '2030-01-01 00:00:00' DO
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c3,
+COLLATION(_utf8 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END|
+
+CREATE EVENT ev2 ON SCHEDULE AT '2030-01-01 00:00:00' DO
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c3,
+COLLATION(_utf8 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END|
+
+CREATE EVENT mysqltest2.ev3 ON SCHEDULE AT '2030-01-01 00:00:00' DO
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c3,
+COLLATION(_utf8 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END|
+
+CREATE EVENT mysqltest2.ev4 ON SCHEDULE AT '2030-01-01 00:00:00' DO
+BEGIN
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c3,
+COLLATION(_utf8 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c3,
+COLLATION(_utf8 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c3,
+COLLATION(_utf8 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c3,
+COLLATION(_utf8 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c3,
+COLLATION(_utf8 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END koi8r koi8r_general_ci utf8_unicode_ci
+
+
+SHOW EVENTS LIKE 'ev1'|
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+mysqltest1 ev1 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW EVENTS LIKE 'ev2'|
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+mysqltest1 ev2 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW EVENTS LIKE 'ev3'|
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+
+SHOW EVENTS LIKE 'ev4'|
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+
+
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION( 'ÔÅËÓÔ') AS c3,
+COLLATION( 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci
+
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION( 'ÔÅËÓÔ') AS c3,
+COLLATION( 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci
+
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION( 'ÔÅËÓÔ') AS c3,
+COLLATION( 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci
+
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION( 'ÔÅËÓÔ') AS c3,
+COLLATION( 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci
+
+
+ALTER DATABASE mysqltest1 COLLATE cp866_general_ci|
+ALTER DATABASE mysqltest2 COLLATE cp866_general_ci|
+
+---> connection: con2
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+SHOW CREATE EVENT ev1|
+SHOW CREATE EVENT ev2|
+SHOW CREATE EVENT mysqltest2.ev3|
+SHOW CREATE EVENT mysqltest2.ev4|
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c3,
+COLLATION(_utf8 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c3,
+COLLATION(_utf8 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c3,
+COLLATION(_utf8 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c3,
+COLLATION(_utf8 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END koi8r koi8r_general_ci utf8_unicode_ci
+
+
+SHOW EVENTS LIKE 'ev1'|
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+mysqltest1 ev1 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW EVENTS LIKE 'ev2'|
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+mysqltest1 ev2 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW EVENTS LIKE 'ev3'|
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+
+SHOW EVENTS LIKE 'ev4'|
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+
+
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION( 'ÔÅËÓÔ') AS c3,
+COLLATION( 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci
+
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION( 'ÔÅËÓÔ') AS c3,
+COLLATION( 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci
+
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION( 'ÔÅËÓÔ') AS c3,
+COLLATION( 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci
+
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION( 'ÔÅËÓÔ') AS c3,
+COLLATION( 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci
+
+---> Dump of mysqltest1
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp866 */;
+
+USE `mysqltest1`;
+/*!50106 SET @save_time_zone= @@TIME_ZONE */ ;
+DELIMITER ;;
+ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;;
+/*!50003 SET character_set_client = koi8r */ ;;
+/*!50003 SET character_set_results = koi8r */ ;;
+/*!50003 SET collation_connection = koi8r_general_ci */ ;;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;;
+/*!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
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c3,
+COLLATION(_utf8 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END */ ;;
+/*!50003 SET time_zone = @saved_time_zone */ ;;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;;
+/*!50003 SET character_set_client = @saved_cs_client */ ;;
+/*!50003 SET character_set_results = @saved_cs_results */ ;;
+/*!50003 SET collation_connection = @saved_col_connection */ ;;
+ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ;;
+DELIMITER ;;
+ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;;
+/*!50003 SET character_set_client = koi8r */ ;;
+/*!50003 SET character_set_results = koi8r */ ;;
+/*!50003 SET collation_connection = koi8r_general_ci */ ;;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;;
+/*!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
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c3,
+COLLATION(_utf8 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END */ ;;
+/*!50003 SET time_zone = @saved_time_zone */ ;;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;;
+/*!50003 SET character_set_client = @saved_cs_client */ ;;
+/*!50003 SET character_set_results = @saved_cs_results */ ;;
+/*!50003 SET collation_connection = @saved_col_connection */ ;;
+ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ;;
+DELIMITER ;
+/*!50106 SET TIME_ZONE= @save_time_zone */ ;
+
+---> Dumping mysqltest1 to ddl_i18n_koi8r.events.mysqltest1.sql
+
+---> Dump of mysqltest2
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER SET cp866 */;
+
+USE `mysqltest2`;
+/*!50106 SET @save_time_zone= @@TIME_ZONE */ ;
+DELIMITER ;;
+ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;;
+/*!50003 SET character_set_client = koi8r */ ;;
+/*!50003 SET character_set_results = koi8r */ ;;
+/*!50003 SET collation_connection = koi8r_general_ci */ ;;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;;
+/*!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
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c3,
+COLLATION(_utf8 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END */ ;;
+/*!50003 SET time_zone = @saved_time_zone */ ;;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;;
+/*!50003 SET character_set_client = @saved_cs_client */ ;;
+/*!50003 SET character_set_results = @saved_cs_results */ ;;
+/*!50003 SET collation_connection = @saved_col_connection */ ;;
+ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ;;
+DELIMITER ;;
+ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;;
+/*!50003 SET character_set_client = koi8r */ ;;
+/*!50003 SET character_set_results = koi8r */ ;;
+/*!50003 SET collation_connection = koi8r_general_ci */ ;;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;;
+/*!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
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c3,
+COLLATION(_utf8 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END */ ;;
+/*!50003 SET time_zone = @saved_time_zone */ ;;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;;
+/*!50003 SET character_set_client = @saved_cs_client */ ;;
+/*!50003 SET character_set_results = @saved_cs_results */ ;;
+/*!50003 SET collation_connection = @saved_col_connection */ ;;
+ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ;;
+DELIMITER ;
+/*!50106 SET TIME_ZONE= @save_time_zone */ ;
+
+---> Dumping mysqltest2 to ddl_i18n_koi8r.events.mysqltest2.sql
+
+
+DROP DATABASE mysqltest1|
+DROP DATABASE mysqltest2|
+
+
+---> Restoring mysqltest1...
+---> Restoring mysqltest2...
+
+---> connection: con3
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+SHOW CREATE EVENT ev1|
+SHOW CREATE EVENT ev2|
+SHOW CREATE EVENT mysqltest2.ev3|
+SHOW CREATE EVENT mysqltest2.ev4|
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c3,
+COLLATION(_utf8 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c3,
+COLLATION(_utf8 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c3,
+COLLATION(_utf8 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c3,
+COLLATION(_utf8 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END koi8r koi8r_general_ci utf8_unicode_ci
+
+
+SHOW EVENTS LIKE 'ev1'|
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+mysqltest1 ev1 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW EVENTS LIKE 'ev2'|
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+mysqltest1 ev2 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 koi8r koi8r_general_ci utf8_unicode_ci
+
+SHOW EVENTS LIKE 'ev3'|
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+
+SHOW EVENTS LIKE 'ev4'|
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+
+
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10);
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION( 'ÔÅËÓÔ') AS c3,
+COLLATION( 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci
+
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION( 'ÔÅËÓÔ') AS c3,
+COLLATION( 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci
+
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION( 'ÔÅËÓÔ') AS c3,
+COLLATION( 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci
+
+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
+DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(ÐÅÒÅÍ1) AS c1,
+COLLATION('ÔÅËÓÔ') AS c2,
+COLLATION( 'ÔÅËÓÔ') AS c3,
+COLLATION( 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci
+
+-------------------------------------------------------------------
+DDL statements within stored routine.
+-------------------------------------------------------------------
+
+DROP DATABASE IF EXISTS mysqltest1|
+DROP DATABASE IF EXISTS mysqltest2|
+CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+use mysqltest1|
+
+CREATE PROCEDURE p1()
+BEGIN
+CREATE TABLE t1(col1 VARCHAR(10));
+SHOW CREATE TABLE t1;
+END|
+
+CREATE PROCEDURE mysqltest2.p2()
+BEGIN
+CREATE TABLE t2(col1 VARCHAR(10));
+SHOW CREATE TABLE t2;
+END|
+
+CALL p1()|
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `col1` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
+
+SHOW CREATE TABLE t1|
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `col1` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
+
+
+CALL mysqltest2.p2()|
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `col1` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
+
+SHOW CREATE TABLE mysqltest2.t2|
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `col1` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
+
+ALTER DATABASE mysqltest1 COLLATE cp1251_general_cs|
+ALTER DATABASE mysqltest2 COLLATE cp1251_general_cs|
+DROP TABLE t1|
+DROP TABLE mysqltest2.t2|
+
+CALL p1()|
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `col1` varchar(10) COLLATE cp1251_general_cs DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=cp1251 COLLATE=cp1251_general_cs
+
+SHOW CREATE TABLE t1|
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `col1` varchar(10) COLLATE cp1251_general_cs DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=cp1251 COLLATE=cp1251_general_cs
+
+
+CALL mysqltest2.p2()|
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `col1` varchar(10) COLLATE cp1251_general_cs DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=cp1251 COLLATE=cp1251_general_cs
+
+SHOW CREATE TABLE mysqltest2.t2|
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `col1` varchar(10) COLLATE cp1251_general_cs DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=cp1251 COLLATE=cp1251_general_cs
+
+---> connection: default
+use test|
+DROP DATABASE mysqltest1|
+DROP DATABASE mysqltest2|
diff --git a/mysql-test/r/ddl_i18n_utf8.result b/mysql-test/r/ddl_i18n_utf8.result
new file mode 100644
index 00000000000..b8e690bfeb7
--- /dev/null
+++ b/mysql-test/r/ddl_i18n_utf8.result
@@ -0,0 +1,2795 @@
+set names utf8;
+
+-------------------------------------------------------------------
+Views
+-------------------------------------------------------------------
+
+DROP DATABASE IF EXISTS mysqltest1|
+CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+use mysqltest1|
+CREATE TABLE t1(кол INT)|
+INSERT INTO t1 VALUES(1)|
+
+CREATE VIEW v1 AS
+SELECT 'теÑÑ‚' AS c1, кол AS c2
+FROM t1|
+
+CREATE VIEW v2 AS SELECT _koi8r'ÔÅÓÔ' as c1|
+
+
+
+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 _utf8'теÑÑ‚' AS `c1`,`t1`.`кол` AS `c2` from `t1` utf8 utf8_general_ci
+
+SHOW CREATE VIEW v2|
+View Create View character_set_client collation_connection
+v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select _koi8r'ÔÅÓÔ' AS `c1` utf8 utf8_general_ci
+
+
+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, кол AS c2 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
+
+
+SELECT COLLATION(c1), COLLATION(c2) FROM v1|
+COLLATION(c1) COLLATION(c2)
+utf8_general_ci binary
+
+SELECT COLLATION(c1) FROM v2|
+COLLATION(c1)
+koi8r_general_ci
+
+
+ALTER DATABASE mysqltest1 COLLATE cp866_general_ci|
+
+---> connection: con2
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+SELECT * FROM mysqltest1.v1|
+SELECT * FROM mysqltest1.v2|
+use mysqltest1|
+set names utf8|
+
+
+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 _utf8'теÑÑ‚' AS `c1`,`t1`.`кол` AS `c2` from `t1` utf8 utf8_general_ci
+
+SHOW CREATE VIEW v2|
+View Create View character_set_client collation_connection
+v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select _koi8r'ÔÅÓÔ' AS `c1` utf8 utf8_general_ci
+
+
+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, кол AS c2 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
+
+
+SELECT COLLATION(c1), COLLATION(c2) FROM v1|
+COLLATION(c1) COLLATION(c2)
+utf8_general_ci binary
+
+SELECT COLLATION(c1) FROM v2|
+COLLATION(c1)
+koi8r_general_ci
+
+---> Dumping mysqltest1 to ddl_i18n_utf8views.mysqltest1.sql
+
+
+DROP DATABASE mysqltest1|
+
+
+---> Restoring mysqltest1...
+
+---> connection: con3
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+SELECT * FROM mysqltest1.v1|
+SELECT * FROM mysqltest1.v2|
+use mysqltest1|
+set names utf8|
+
+
+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 _utf8'теÑÑ‚' AS `c1`,`t1`.`кол` AS `c2` from `t1` utf8 utf8_general_ci
+
+SHOW CREATE VIEW v2|
+View Create View character_set_client collation_connection
+v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select _koi8r'ÔÅÓÔ' AS `c1` utf8 utf8_general_ci
+
+
+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`,`t1`.`кол` AS `c2` from `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
+
+
+SELECT COLLATION(c1), COLLATION(c2) FROM v1|
+COLLATION(c1) COLLATION(c2)
+utf8_general_ci binary
+
+SELECT COLLATION(c1) FROM v2|
+COLLATION(c1)
+koi8r_general_ci
+
+---> connection: default
+use test|
+DROP DATABASE mysqltest1|
+
+-------------------------------------------------------------------
+Stored procedures/functions
+-------------------------------------------------------------------
+
+DROP DATABASE IF EXISTS mysqltest1|
+DROP DATABASE IF EXISTS mysqltest2|
+CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+use mysqltest1|
+
+CREATE PROCEDURE p1(
+INOUT парам1 CHAR(10),
+OUT парам2 CHAR(10))
+BEGIN
+DECLARE перем1 CHAR(10);
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION(_utf8 'текÑÑ‚') AS c5,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END|
+
+CREATE PROCEDURE p2(
+INOUT парам1 CHAR(10) CHARACTER SET utf8,
+OUT парам2 CHAR(10) CHARACTER SET utf8)
+BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION(_utf8 'текÑÑ‚') AS c5,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END|
+
+CREATE PROCEDURE mysqltest2.p3(
+INOUT парам1 CHAR(10),
+OUT парам2 CHAR(10))
+BEGIN
+DECLARE перем1 CHAR(10);
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION(_utf8 'текÑÑ‚') AS c5,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END|
+
+CREATE PROCEDURE mysqltest2.p4(
+INOUT парам1 CHAR(10) CHARACTER SET utf8,
+OUT парам2 CHAR(10) CHARACTER SET utf8)
+BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION(_utf8 'текÑÑ‚') AS c5,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END|
+
+
+SHOW CREATE PROCEDURE p1|
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`(
+INOUT парам1 CHAR(10),
+OUT парам2 CHAR(10))
+BEGIN
+DECLARE перем1 CHAR(10);
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION(_utf8 'текÑÑ‚') AS c5,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW CREATE PROCEDURE p2|
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p2 CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`(
+INOUT парам1 CHAR(10) CHARACTER SET utf8,
+OUT парам2 CHAR(10) CHARACTER SET utf8)
+BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION(_utf8 'текÑÑ‚') AS c5,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW CREATE PROCEDURE mysqltest2.p3|
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p3 CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`(
+INOUT парам1 CHAR(10),
+OUT парам2 CHAR(10))
+BEGIN
+DECLARE перем1 CHAR(10);
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION(_utf8 'текÑÑ‚') AS c5,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW CREATE PROCEDURE mysqltest2.p4|
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p4 CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`(
+INOUT парам1 CHAR(10) CHARACTER SET utf8,
+OUT парам2 CHAR(10) CHARACTER SET utf8)
+BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION(_utf8 'текÑÑ‚') AS c5,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END utf8 utf8_general_ci utf8_unicode_ci
+
+
+SHOW PROCEDURE STATUS LIKE 'p1'|
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+mysqltest1 p1 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW PROCEDURE STATUS LIKE 'p2'|
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+mysqltest1 p2 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW PROCEDURE STATUS LIKE 'p3'|
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+mysqltest2 p3 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW PROCEDURE STATUS LIKE 'p4'|
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_general_ci utf8_unicode_ci
+
+
+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
+DECLARE перем1 CHAR(10);
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION( 'текÑÑ‚') AS c5,
+COLLATION( 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci
+
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'|
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
+p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION( 'текÑÑ‚') AS c5,
+COLLATION( 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci
+
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'|
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
+p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN
+DECLARE перем1 CHAR(10);
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION( 'текÑÑ‚') AS c5,
+COLLATION( 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci
+
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'|
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
+p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION( 'текÑÑ‚') AS c5,
+COLLATION( 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci
+
+
+SET @a = '1'|
+SET @b = '2'|
+
+
+CALL p1(@a, @b)|
+c1 c2 c3
+utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci
+c4 c5 c6 c7 c8
+utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8
+SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
+ca cb
+utf8_unicode_ci utf8_unicode_ci
+
+CALL p2(@a, @b)|
+c1 c2 c3
+utf8_general_ci utf8_general_ci utf8_general_ci
+c4 c5 c6 c7 c8
+utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8
+SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
+ca cb
+utf8_general_ci utf8_general_ci
+
+CALL mysqltest2.p3(@a, @b)|
+c1 c2 c3
+utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci
+c4 c5 c6 c7 c8
+utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8
+SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
+ca cb
+utf8_unicode_ci utf8_unicode_ci
+
+CALL mysqltest2.p4(@a, @b)|
+c1 c2 c3
+utf8_general_ci utf8_general_ci utf8_general_ci
+c4 c5 c6 c7 c8
+utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8
+SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
+ca cb
+utf8_general_ci utf8_general_ci
+
+
+ALTER DATABASE mysqltest1 COLLATE cp866_general_ci|
+ALTER DATABASE mysqltest2 COLLATE cp866_general_ci|
+
+---> connection: con2
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+CALL p1(@a, @b)|
+c1 c2 c3
+utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci
+c4 c5 c6 c7 c8
+utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8
+CALL p2(@a, @b)|
+c1 c2 c3
+utf8_general_ci utf8_general_ci utf8_general_ci
+c4 c5 c6 c7 c8
+utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8
+CALL mysqltest2.p3(@a, @b)|
+c1 c2 c3
+utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci
+c4 c5 c6 c7 c8
+utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8
+CALL mysqltest2.p4(@a, @b)|
+c1 c2 c3
+utf8_general_ci utf8_general_ci utf8_general_ci
+c4 c5 c6 c7 c8
+utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8
+set names utf8|
+
+
+SHOW CREATE PROCEDURE p1|
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`(
+INOUT парам1 CHAR(10),
+OUT парам2 CHAR(10))
+BEGIN
+DECLARE перем1 CHAR(10);
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION(_utf8 'текÑÑ‚') AS c5,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW CREATE PROCEDURE p2|
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p2 CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`(
+INOUT парам1 CHAR(10) CHARACTER SET utf8,
+OUT парам2 CHAR(10) CHARACTER SET utf8)
+BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION(_utf8 'текÑÑ‚') AS c5,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW CREATE PROCEDURE mysqltest2.p3|
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p3 CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`(
+INOUT парам1 CHAR(10),
+OUT парам2 CHAR(10))
+BEGIN
+DECLARE перем1 CHAR(10);
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION(_utf8 'текÑÑ‚') AS c5,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW CREATE PROCEDURE mysqltest2.p4|
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p4 CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`(
+INOUT парам1 CHAR(10) CHARACTER SET utf8,
+OUT парам2 CHAR(10) CHARACTER SET utf8)
+BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION(_utf8 'текÑÑ‚') AS c5,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END utf8 utf8_general_ci utf8_unicode_ci
+
+
+SHOW PROCEDURE STATUS LIKE 'p1'|
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+mysqltest1 p1 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW PROCEDURE STATUS LIKE 'p2'|
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+mysqltest1 p2 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW PROCEDURE STATUS LIKE 'p3'|
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+mysqltest2 p3 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW PROCEDURE STATUS LIKE 'p4'|
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_general_ci utf8_unicode_ci
+
+
+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
+DECLARE перем1 CHAR(10);
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION( 'текÑÑ‚') AS c5,
+COLLATION( 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci
+
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'|
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
+p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION( 'текÑÑ‚') AS c5,
+COLLATION( 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci
+
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'|
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
+p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN
+DECLARE перем1 CHAR(10);
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION( 'текÑÑ‚') AS c5,
+COLLATION( 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci
+
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'|
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
+p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION( 'текÑÑ‚') AS c5,
+COLLATION( 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci
+
+
+SET @a = '1'|
+SET @b = '2'|
+
+
+CALL p1(@a, @b)|
+c1 c2 c3
+utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci
+c4 c5 c6 c7 c8
+utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8
+SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
+ca cb
+utf8_unicode_ci utf8_unicode_ci
+
+CALL p2(@a, @b)|
+c1 c2 c3
+utf8_general_ci utf8_general_ci utf8_general_ci
+c4 c5 c6 c7 c8
+utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8
+SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
+ca cb
+utf8_general_ci utf8_general_ci
+
+CALL mysqltest2.p3(@a, @b)|
+c1 c2 c3
+utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci
+c4 c5 c6 c7 c8
+utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8
+SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
+ca cb
+utf8_unicode_ci utf8_unicode_ci
+
+CALL mysqltest2.p4(@a, @b)|
+c1 c2 c3
+utf8_general_ci utf8_general_ci utf8_general_ci
+c4 c5 c6 c7 c8
+utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8
+SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
+ca cb
+utf8_general_ci utf8_general_ci
+
+---> Dump of mysqltest1
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp866 */;
+
+USE `mysqltest1`;
+ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = utf8 */ ;
+/*!50003 SET character_set_results = utf8 */ ;
+/*!50003 SET collation_connection = utf8_general_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = '' */ ;
+DELIMITER ;;
+/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `p1`(
+INOUT парам1 CHAR(10),
+OUT парам2 CHAR(10))
+BEGIN
+DECLARE перем1 CHAR(10);
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION(_utf8 'текÑÑ‚') AS c5,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END */;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ;
+ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = utf8 */ ;
+/*!50003 SET character_set_results = utf8 */ ;
+/*!50003 SET collation_connection = utf8_general_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = '' */ ;
+DELIMITER ;;
+/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `p2`(
+INOUT парам1 CHAR(10) CHARACTER SET utf8,
+OUT парам2 CHAR(10) CHARACTER SET utf8)
+BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION(_utf8 'текÑÑ‚') AS c5,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END */;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ;
+
+---> Dumping mysqltest1 to ddl_i18n_utf8sp.mysqltest1.sql
+
+---> Dump of mysqltest2
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER SET cp866 */;
+
+USE `mysqltest2`;
+ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = utf8 */ ;
+/*!50003 SET character_set_results = utf8 */ ;
+/*!50003 SET collation_connection = utf8_general_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = '' */ ;
+DELIMITER ;;
+/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `p3`(
+INOUT парам1 CHAR(10),
+OUT парам2 CHAR(10))
+BEGIN
+DECLARE перем1 CHAR(10);
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION(_utf8 'текÑÑ‚') AS c5,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END */;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ;
+ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = utf8 */ ;
+/*!50003 SET character_set_results = utf8 */ ;
+/*!50003 SET collation_connection = utf8_general_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = '' */ ;
+DELIMITER ;;
+/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `p4`(
+INOUT парам1 CHAR(10) CHARACTER SET utf8,
+OUT парам2 CHAR(10) CHARACTER SET utf8)
+BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION(_utf8 'текÑÑ‚') AS c5,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END */;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ;
+
+---> Dumping mysqltest2 to ddl_i18n_utf8sp.mysqltest2.sql
+
+
+DROP DATABASE mysqltest1|
+DROP DATABASE mysqltest2|
+
+
+---> Restoring mysqltest1...
+---> Restoring mysqltest2...
+
+---> connection: con3
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+CALL p1(@a, @b)|
+c1 c2 c3
+utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci
+c4 c5 c6 c7 c8
+utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8
+CALL p2(@a, @b)|
+c1 c2 c3
+utf8_general_ci utf8_general_ci utf8_general_ci
+c4 c5 c6 c7 c8
+utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8
+CALL mysqltest2.p3(@a, @b)|
+c1 c2 c3
+utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci
+c4 c5 c6 c7 c8
+utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8
+CALL mysqltest2.p4(@a, @b)|
+c1 c2 c3
+utf8_general_ci utf8_general_ci utf8_general_ci
+c4 c5 c6 c7 c8
+utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8
+set names utf8|
+
+
+SHOW CREATE PROCEDURE p1|
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`(
+INOUT парам1 CHAR(10),
+OUT парам2 CHAR(10))
+BEGIN
+DECLARE перем1 CHAR(10);
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION(_utf8 'текÑÑ‚') AS c5,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW CREATE PROCEDURE p2|
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p2 CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`(
+INOUT парам1 CHAR(10) CHARACTER SET utf8,
+OUT парам2 CHAR(10) CHARACTER SET utf8)
+BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION(_utf8 'текÑÑ‚') AS c5,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW CREATE PROCEDURE mysqltest2.p3|
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p3 CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`(
+INOUT парам1 CHAR(10),
+OUT парам2 CHAR(10))
+BEGIN
+DECLARE перем1 CHAR(10);
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION(_utf8 'текÑÑ‚') AS c5,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW CREATE PROCEDURE mysqltest2.p4|
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p4 CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`(
+INOUT парам1 CHAR(10) CHARACTER SET utf8,
+OUT парам2 CHAR(10) CHARACTER SET utf8)
+BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION(_utf8 'текÑÑ‚') AS c5,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END utf8 utf8_general_ci utf8_unicode_ci
+
+
+SHOW PROCEDURE STATUS LIKE 'p1'|
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+mysqltest1 p1 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW PROCEDURE STATUS LIKE 'p2'|
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+mysqltest1 p2 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW PROCEDURE STATUS LIKE 'p3'|
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+mysqltest2 p3 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW PROCEDURE STATUS LIKE 'p4'|
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_general_ci utf8_unicode_ci
+
+
+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
+DECLARE перем1 CHAR(10);
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION( 'текÑÑ‚') AS c5,
+COLLATION( 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci
+
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'|
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
+p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION( 'текÑÑ‚') AS c5,
+COLLATION( 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci
+
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'|
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
+p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN
+DECLARE перем1 CHAR(10);
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION( 'текÑÑ‚') AS c5,
+COLLATION( 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci
+
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'|
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
+p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION(парам1) AS c2,
+COLLATION(парам2) AS c3;
+SELECT
+COLLATION('текÑÑ‚') AS c4,
+COLLATION( 'текÑÑ‚') AS c5,
+COLLATION( 'текÑÑ‚') AS c6,
+@@collation_connection AS c7,
+@@character_set_client AS c8;
+SET парам1 = 'a';
+SET парам2 = 'b';
+END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci
+
+
+SET @a = '1'|
+SET @b = '2'|
+
+
+CALL p1(@a, @b)|
+c1 c2 c3
+utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci
+c4 c5 c6 c7 c8
+utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8
+SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
+ca cb
+utf8_unicode_ci utf8_unicode_ci
+
+CALL p2(@a, @b)|
+c1 c2 c3
+utf8_general_ci utf8_general_ci utf8_general_ci
+c4 c5 c6 c7 c8
+utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8
+SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
+ca cb
+utf8_general_ci utf8_general_ci
+
+CALL mysqltest2.p3(@a, @b)|
+c1 c2 c3
+utf8_unicode_ci utf8_unicode_ci utf8_unicode_ci
+c4 c5 c6 c7 c8
+utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8
+SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
+ca cb
+utf8_unicode_ci utf8_unicode_ci
+
+CALL mysqltest2.p4(@a, @b)|
+c1 c2 c3
+utf8_general_ci utf8_general_ci utf8_general_ci
+c4 c5 c6 c7 c8
+utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8
+SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
+ca cb
+utf8_general_ci utf8_general_ci
+
+---> connection: default
+use test|
+DROP DATABASE mysqltest1|
+DROP DATABASE mysqltest2|
+
+-------------------------------------------------------------------
+Triggers
+-------------------------------------------------------------------
+
+DROP DATABASE IF EXISTS mysqltest1|
+DROP DATABASE IF EXISTS mysqltest2|
+CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+use mysqltest1|
+CREATE TABLE t1(c INT)|
+CREATE TABLE mysqltest2.t1(c INT)|
+CREATE TABLE log(msg VARCHAR(255))|
+CREATE TABLE mysqltest2.log(msg VARCHAR(255))|
+
+CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE перем1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'текÑÑ‚';
+SET @a2 = _utf8 'текÑÑ‚';
+SET @a3 = _koi8r 'ÔÅËÓÔ';
+END|
+
+CREATE TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'текÑÑ‚';
+SET @b2 = _utf8 'текÑÑ‚';
+SET @b3 = _koi8r 'ÔÅËÓÔ';
+END|
+
+CREATE TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW
+BEGIN
+DECLARE перем1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'текÑÑ‚';
+SET @a2 = _utf8 'текÑÑ‚';
+SET @a3 = _koi8r 'ÔÅËÓÔ';
+END|
+
+CREATE TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW
+BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'текÑÑ‚';
+SET @b2 = _utf8 'текÑÑ‚';
+SET @b3 = _koi8r 'ÔÅËÓÔ';
+END|
+
+
+
+SHOW CREATE TRIGGER trg1|
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+trg1 CREATE DEFINER=`root`@`localhost` TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE перем1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'текÑÑ‚';
+SET @a2 = _utf8 'текÑÑ‚';
+SET @a3 = _koi8r 'ÔÅËÓÔ';
+END utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW CREATE TRIGGER trg2|
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+trg2 CREATE DEFINER=`root`@`localhost` TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'текÑÑ‚';
+SET @b2 = _utf8 'текÑÑ‚';
+SET @b3 = _koi8r 'ÔÅËÓÔ';
+END utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW CREATE TRIGGER mysqltest2.trg3|
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+trg3 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW
+BEGIN
+DECLARE перем1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'текÑÑ‚';
+SET @a2 = _utf8 'текÑÑ‚';
+SET @a3 = _koi8r 'ÔÅËÓÔ';
+END utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW CREATE TRIGGER mysqltest2.trg4|
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+trg4 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW
+BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'текÑÑ‚';
+SET @b2 = _utf8 'текÑÑ‚';
+SET @b3 = _koi8r 'ÔÅËÓÔ';
+END utf8 utf8_general_ci utf8_unicode_ci
+
+
+SHOW TRIGGERS|
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+trg1 INSERT t1 BEGIN
+DECLARE перем1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'текÑÑ‚';
+SET @a2 = 'текÑÑ‚';
+SET @a3 = 'текÑÑ‚';
+END BEFORE NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci
+trg2 INSERT t1 BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'текÑÑ‚';
+SET @b2 = 'текÑÑ‚';
+SET @b3 = 'текÑÑ‚';
+END AFTER NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci
+
+use mysqltest2|
+
+SHOW TRIGGERS|
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+trg3 INSERT t1 BEGIN
+DECLARE перем1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'текÑÑ‚';
+SET @a2 = 'текÑÑ‚';
+SET @a3 = 'текÑÑ‚';
+END BEFORE NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci
+trg4 INSERT t1 BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'текÑÑ‚';
+SET @b2 = 'текÑÑ‚';
+SET @b3 = 'текÑÑ‚';
+END AFTER NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci
+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
+DECLARE перем1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'текÑÑ‚';
+SET @a2 = 'текÑÑ‚';
+SET @a3 = 'текÑÑ‚';
+END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_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
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'текÑÑ‚';
+SET @b2 = 'текÑÑ‚';
+SET @b3 = 'текÑÑ‚';
+END ROW AFTER NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci
+
+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
+DECLARE перем1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'текÑÑ‚';
+SET @a2 = 'текÑÑ‚';
+SET @a3 = 'текÑÑ‚';
+END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_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
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'текÑÑ‚';
+SET @b2 = 'текÑÑ‚';
+SET @b3 = 'текÑÑ‚';
+END ROW AFTER NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci
+
+
+SET @a1 = '1'|
+SET @a2 = '1'|
+SET @a3 = '1'|
+SET @b1 = '2'|
+SET @b2 = '2'|
+SET @b3 = '2'|
+
+
+INSERT INTO t1 VALUES(1)|
+
+---> Log:
+SELECT msg FROM log|
+msg
+utf8_unicode_ci
+utf8_general_ci
+utf8_general_ci
+koi8r_general_ci
+utf8_general_ci
+utf8
+utf8_general_ci
+utf8_general_ci
+utf8_general_ci
+koi8r_general_ci
+utf8_general_ci
+utf8
+
+SELECT
+COLLATION(@a1) AS ca1,
+COLLATION(@a2) AS ca2,
+COLLATION(@a3) AS ca3,
+COLLATION(@b1) AS cb1,
+COLLATION(@b2) AS cb2,
+COLLATION(@b3) AS cb3|
+ca1 ca2 ca3 cb1 cb2 cb3
+utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8_general_ci koi8r_general_ci
+
+DELETE FROM log|
+
+
+INSERT INTO mysqltest2.t1 VALUES(1)|
+
+---> Log:
+SELECT msg FROM mysqltest2.log|
+msg
+utf8_unicode_ci
+utf8_general_ci
+utf8_general_ci
+koi8r_general_ci
+utf8_general_ci
+utf8
+utf8_general_ci
+utf8_general_ci
+utf8_general_ci
+koi8r_general_ci
+utf8_general_ci
+utf8
+
+SELECT
+COLLATION(@a1) AS ca1,
+COLLATION(@a2) AS ca2,
+COLLATION(@a3) AS ca3,
+COLLATION(@b1) AS cb1,
+COLLATION(@b2) AS cb2,
+COLLATION(@b3) AS cb3|
+ca1 ca2 ca3 cb1 cb2 cb3
+utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8_general_ci koi8r_general_ci
+
+DELETE FROM mysqltest2.log|
+
+
+ALTER DATABASE mysqltest1 COLLATE cp866_general_ci|
+ALTER DATABASE mysqltest2 COLLATE cp866_general_ci|
+ALTER TABLE t1 ADD COLUMN fake INT|
+ALTER TABLE t1 DROP COLUMN fake|
+ALTER TABLE mysqltest2.t1 ADD COLUMN fake INT|
+ALTER TABLE mysqltest2.t1 DROP COLUMN fake|
+
+---> connection: con2
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+INSERT INTO mysqltest1.t1 VALUES(0)|
+INSERT INTO mysqltest2.t1 VALUES(0)|
+DELETE FROM mysqltest1.log|
+DELETE FROM mysqltest2.log|
+set names utf8|
+use mysqltest1|
+
+
+SHOW CREATE TRIGGER trg1|
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+trg1 CREATE DEFINER=`root`@`localhost` TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE перем1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'текÑÑ‚';
+SET @a2 = _utf8 'текÑÑ‚';
+SET @a3 = _koi8r 'ÔÅËÓÔ';
+END utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW CREATE TRIGGER trg2|
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+trg2 CREATE DEFINER=`root`@`localhost` TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'текÑÑ‚';
+SET @b2 = _utf8 'текÑÑ‚';
+SET @b3 = _koi8r 'ÔÅËÓÔ';
+END utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW CREATE TRIGGER mysqltest2.trg3|
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+trg3 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW
+BEGIN
+DECLARE перем1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'текÑÑ‚';
+SET @a2 = _utf8 'текÑÑ‚';
+SET @a3 = _koi8r 'ÔÅËÓÔ';
+END utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW CREATE TRIGGER mysqltest2.trg4|
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+trg4 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW
+BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'текÑÑ‚';
+SET @b2 = _utf8 'текÑÑ‚';
+SET @b3 = _koi8r 'ÔÅËÓÔ';
+END utf8 utf8_general_ci utf8_unicode_ci
+
+
+SHOW TRIGGERS|
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+trg1 INSERT t1 BEGIN
+DECLARE перем1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'текÑÑ‚';
+SET @a2 = 'текÑÑ‚';
+SET @a3 = 'текÑÑ‚';
+END BEFORE NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci
+trg2 INSERT t1 BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'текÑÑ‚';
+SET @b2 = 'текÑÑ‚';
+SET @b3 = 'текÑÑ‚';
+END AFTER NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci
+
+use mysqltest2|
+
+SHOW TRIGGERS|
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+trg3 INSERT t1 BEGIN
+DECLARE перем1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'текÑÑ‚';
+SET @a2 = 'текÑÑ‚';
+SET @a3 = 'текÑÑ‚';
+END BEFORE NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci
+trg4 INSERT t1 BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'текÑÑ‚';
+SET @b2 = 'текÑÑ‚';
+SET @b3 = 'текÑÑ‚';
+END AFTER NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci
+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
+DECLARE перем1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'текÑÑ‚';
+SET @a2 = 'текÑÑ‚';
+SET @a3 = 'текÑÑ‚';
+END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_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
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'текÑÑ‚';
+SET @b2 = 'текÑÑ‚';
+SET @b3 = 'текÑÑ‚';
+END ROW AFTER NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci
+
+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
+DECLARE перем1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'текÑÑ‚';
+SET @a2 = 'текÑÑ‚';
+SET @a3 = 'текÑÑ‚';
+END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_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
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'текÑÑ‚';
+SET @b2 = 'текÑÑ‚';
+SET @b3 = 'текÑÑ‚';
+END ROW AFTER NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci
+
+
+SET @a1 = '1'|
+SET @a2 = '1'|
+SET @a3 = '1'|
+SET @b1 = '2'|
+SET @b2 = '2'|
+SET @b3 = '2'|
+
+
+INSERT INTO t1 VALUES(1)|
+
+---> Log:
+SELECT msg FROM log|
+msg
+utf8_unicode_ci
+utf8_general_ci
+utf8_general_ci
+koi8r_general_ci
+utf8_general_ci
+utf8
+utf8_general_ci
+utf8_general_ci
+utf8_general_ci
+koi8r_general_ci
+utf8_general_ci
+utf8
+
+SELECT
+COLLATION(@a1) AS ca1,
+COLLATION(@a2) AS ca2,
+COLLATION(@a3) AS ca3,
+COLLATION(@b1) AS cb1,
+COLLATION(@b2) AS cb2,
+COLLATION(@b3) AS cb3|
+ca1 ca2 ca3 cb1 cb2 cb3
+utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8_general_ci koi8r_general_ci
+
+DELETE FROM log|
+
+
+INSERT INTO mysqltest2.t1 VALUES(1)|
+
+---> Log:
+SELECT msg FROM mysqltest2.log|
+msg
+utf8_unicode_ci
+utf8_general_ci
+utf8_general_ci
+koi8r_general_ci
+utf8_general_ci
+utf8
+utf8_general_ci
+utf8_general_ci
+utf8_general_ci
+koi8r_general_ci
+utf8_general_ci
+utf8
+
+SELECT
+COLLATION(@a1) AS ca1,
+COLLATION(@a2) AS ca2,
+COLLATION(@a3) AS ca3,
+COLLATION(@b1) AS cb1,
+COLLATION(@b2) AS cb2,
+COLLATION(@b3) AS cb3|
+ca1 ca2 ca3 cb1 cb2 cb3
+utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8_general_ci koi8r_general_ci
+
+DELETE FROM mysqltest2.log|
+
+---> Dump of mysqltest1
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp866 */;
+
+USE `mysqltest1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `log` (
+ `msg` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+SET character_set_client = @saved_cs_client;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `t1` (
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+SET character_set_client = @saved_cs_client;
+INSERT INTO `t1` VALUES (1),(0),(1);
+ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = utf8 */ ;
+/*!50003 SET character_set_results = utf8 */ ;
+/*!50003 SET collation_connection = utf8_general_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = '' */ ;
+DELIMITER ;;
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE перем1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'текÑÑ‚';
+SET @a2 = _utf8 'текÑÑ‚';
+SET @a3 = _koi8r 'ÔÅËÓÔ';
+END */;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ;
+ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = utf8 */ ;
+/*!50003 SET character_set_results = utf8 */ ;
+/*!50003 SET collation_connection = utf8_general_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = '' */ ;
+DELIMITER ;;
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'текÑÑ‚';
+SET @b2 = _utf8 'текÑÑ‚';
+SET @b3 = _koi8r 'ÔÅËÓÔ';
+END */;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ;
+
+---> Dumping mysqltest1 to ddl_i18n_utf8triggers.mysqltest1.sql
+
+---> Dump of mysqltest2
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER SET cp866 */;
+
+USE `mysqltest2`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `log` (
+ `msg` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+SET character_set_client = @saved_cs_client;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `t1` (
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+SET character_set_client = @saved_cs_client;
+INSERT INTO `t1` VALUES (1),(0),(1);
+ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = utf8 */ ;
+/*!50003 SET character_set_results = utf8 */ ;
+/*!50003 SET collation_connection = utf8_general_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = '' */ ;
+DELIMITER ;;
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW
+BEGIN
+DECLARE перем1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'текÑÑ‚';
+SET @a2 = _utf8 'текÑÑ‚';
+SET @a3 = _koi8r 'ÔÅËÓÔ';
+END */;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ;
+ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = utf8 */ ;
+/*!50003 SET character_set_results = utf8 */ ;
+/*!50003 SET collation_connection = utf8_general_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = '' */ ;
+DELIMITER ;;
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW
+BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'текÑÑ‚';
+SET @b2 = _utf8 'текÑÑ‚';
+SET @b3 = _koi8r 'ÔÅËÓÔ';
+END */;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ;
+
+---> Dumping mysqltest2 to ddl_i18n_utf8triggers.mysqltest2.sql
+
+
+DROP DATABASE mysqltest1|
+DROP DATABASE mysqltest2|
+
+
+---> Restoring mysqltest1...
+---> Restoring mysqltest2...
+ALTER TABLE mysqltest1.t1 ADD COLUMN fake INT|
+ALTER TABLE mysqltest1.t1 DROP COLUMN fake|
+ALTER TABLE mysqltest2.t1 ADD COLUMN fake INT|
+ALTER TABLE mysqltest2.t1 DROP COLUMN fake|
+
+---> connection: con3
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+INSERT INTO mysqltest1.t1 VALUES(0)|
+INSERT INTO mysqltest2.t1 VALUES(0)|
+DELETE FROM mysqltest1.log|
+DELETE FROM mysqltest2.log|
+set names utf8|
+use mysqltest1|
+
+
+SHOW CREATE TRIGGER trg1|
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+trg1 CREATE DEFINER=`root`@`localhost` TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE перем1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'текÑÑ‚';
+SET @a2 = _utf8 'текÑÑ‚';
+SET @a3 = _koi8r 'ÔÅËÓÔ';
+END utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW CREATE TRIGGER trg2|
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+trg2 CREATE DEFINER=`root`@`localhost` TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'текÑÑ‚';
+SET @b2 = _utf8 'текÑÑ‚';
+SET @b3 = _koi8r 'ÔÅËÓÔ';
+END utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW CREATE TRIGGER mysqltest2.trg3|
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+trg3 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW
+BEGIN
+DECLARE перем1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'текÑÑ‚';
+SET @a2 = _utf8 'текÑÑ‚';
+SET @a3 = _koi8r 'ÔÅËÓÔ';
+END utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW CREATE TRIGGER mysqltest2.trg4|
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+trg4 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW
+BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'текÑÑ‚';
+SET @b2 = _utf8 'текÑÑ‚';
+SET @b3 = _koi8r 'ÔÅËÓÔ';
+END utf8 utf8_general_ci utf8_unicode_ci
+
+
+SHOW TRIGGERS|
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+trg1 INSERT t1 BEGIN
+DECLARE перем1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'текÑÑ‚';
+SET @a2 = 'текÑÑ‚';
+SET @a3 = 'текÑÑ‚';
+END BEFORE NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci
+trg2 INSERT t1 BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'текÑÑ‚';
+SET @b2 = 'текÑÑ‚';
+SET @b3 = 'текÑÑ‚';
+END AFTER NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci
+
+use mysqltest2|
+
+SHOW TRIGGERS|
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+trg3 INSERT t1 BEGIN
+DECLARE перем1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'текÑÑ‚';
+SET @a2 = 'текÑÑ‚';
+SET @a3 = 'текÑÑ‚';
+END BEFORE NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci
+trg4 INSERT t1 BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'текÑÑ‚';
+SET @b2 = 'текÑÑ‚';
+SET @b3 = 'текÑÑ‚';
+END AFTER NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci
+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
+DECLARE перем1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'текÑÑ‚';
+SET @a2 = 'текÑÑ‚';
+SET @a3 = 'текÑÑ‚';
+END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_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
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'текÑÑ‚';
+SET @b2 = 'текÑÑ‚';
+SET @b3 = 'текÑÑ‚';
+END ROW AFTER NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci
+
+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
+DECLARE перем1 CHAR(10);
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @a1 = 'текÑÑ‚';
+SET @a2 = 'текÑÑ‚';
+SET @a3 = 'текÑÑ‚';
+END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_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
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+INSERT INTO log VALUES(COLLATION(перем1));
+INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(COLLATION( 'текÑÑ‚'));
+INSERT INTO log VALUES(@@collation_connection);
+INSERT INTO log VALUES(@@character_set_client);
+SET @b1 = 'текÑÑ‚';
+SET @b2 = 'текÑÑ‚';
+SET @b3 = 'текÑÑ‚';
+END ROW AFTER NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci
+
+
+SET @a1 = '1'|
+SET @a2 = '1'|
+SET @a3 = '1'|
+SET @b1 = '2'|
+SET @b2 = '2'|
+SET @b3 = '2'|
+
+
+INSERT INTO t1 VALUES(1)|
+
+---> Log:
+SELECT msg FROM log|
+msg
+utf8_unicode_ci
+utf8_general_ci
+utf8_general_ci
+koi8r_general_ci
+utf8_general_ci
+utf8
+utf8_general_ci
+utf8_general_ci
+utf8_general_ci
+koi8r_general_ci
+utf8_general_ci
+utf8
+
+SELECT
+COLLATION(@a1) AS ca1,
+COLLATION(@a2) AS ca2,
+COLLATION(@a3) AS ca3,
+COLLATION(@b1) AS cb1,
+COLLATION(@b2) AS cb2,
+COLLATION(@b3) AS cb3|
+ca1 ca2 ca3 cb1 cb2 cb3
+utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8_general_ci koi8r_general_ci
+
+DELETE FROM log|
+
+
+INSERT INTO mysqltest2.t1 VALUES(1)|
+
+---> Log:
+SELECT msg FROM mysqltest2.log|
+msg
+utf8_unicode_ci
+utf8_general_ci
+utf8_general_ci
+koi8r_general_ci
+utf8_general_ci
+utf8
+utf8_general_ci
+utf8_general_ci
+utf8_general_ci
+koi8r_general_ci
+utf8_general_ci
+utf8
+
+SELECT
+COLLATION(@a1) AS ca1,
+COLLATION(@a2) AS ca2,
+COLLATION(@a3) AS ca3,
+COLLATION(@b1) AS cb1,
+COLLATION(@b2) AS cb2,
+COLLATION(@b3) AS cb3|
+ca1 ca2 ca3 cb1 cb2 cb3
+utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8_general_ci koi8r_general_ci
+
+DELETE FROM mysqltest2.log|
+
+---> connection: default
+use test|
+DROP DATABASE mysqltest1|
+DROP DATABASE mysqltest2|
+
+-------------------------------------------------------------------
+Events
+-------------------------------------------------------------------
+
+DROP DATABASE IF EXISTS mysqltest1|
+DROP DATABASE IF EXISTS mysqltest2|
+CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+use mysqltest1|
+
+CREATE EVENT ev1 ON SCHEDULE AT '2030-01-01 00:00:00' DO
+BEGIN
+DECLARE перем1 CHAR(10);
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION(_utf8 'текÑÑ‚') AS c3,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END|
+
+CREATE EVENT ev2 ON SCHEDULE AT '2030-01-01 00:00:00' DO
+BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION(_utf8 'текÑÑ‚') AS c3,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END|
+
+CREATE EVENT mysqltest2.ev3 ON SCHEDULE AT '2030-01-01 00:00:00' DO
+BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION(_utf8 'текÑÑ‚') AS c3,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END|
+
+CREATE EVENT mysqltest2.ev4 ON SCHEDULE AT '2030-01-01 00:00:00' DO
+BEGIN
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION(_utf8 'текÑÑ‚') AS c3,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+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
+DECLARE перем1 CHAR(10);
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION(_utf8 'текÑÑ‚') AS c3,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+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
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION(_utf8 'текÑÑ‚') AS c3,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+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
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION(_utf8 'текÑÑ‚') AS c3,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+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
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION(_utf8 'текÑÑ‚') AS c3,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END utf8 utf8_general_ci utf8_unicode_ci
+
+
+SHOW EVENTS LIKE 'ev1'|
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+mysqltest1 ev1 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW EVENTS LIKE 'ev2'|
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+mysqltest1 ev2 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW EVENTS LIKE 'ev3'|
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+
+SHOW EVENTS LIKE 'ev4'|
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+
+
+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
+DECLARE перем1 CHAR(10);
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION( 'текÑÑ‚') AS c3,
+COLLATION( 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci
+
+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
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION( 'текÑÑ‚') AS c3,
+COLLATION( 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci
+
+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
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION( 'текÑÑ‚') AS c3,
+COLLATION( 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci
+
+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
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION( 'текÑÑ‚') AS c3,
+COLLATION( 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci
+
+
+ALTER DATABASE mysqltest1 COLLATE cp866_general_ci|
+ALTER DATABASE mysqltest2 COLLATE cp866_general_ci|
+
+---> connection: con2
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+SHOW CREATE EVENT ev1|
+SHOW CREATE EVENT ev2|
+SHOW CREATE EVENT mysqltest2.ev3|
+SHOW CREATE EVENT mysqltest2.ev4|
+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
+DECLARE перем1 CHAR(10);
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION(_utf8 'текÑÑ‚') AS c3,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+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
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION(_utf8 'текÑÑ‚') AS c3,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+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
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION(_utf8 'текÑÑ‚') AS c3,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+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
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION(_utf8 'текÑÑ‚') AS c3,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END utf8 utf8_general_ci utf8_unicode_ci
+
+
+SHOW EVENTS LIKE 'ev1'|
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+mysqltest1 ev1 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW EVENTS LIKE 'ev2'|
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+mysqltest1 ev2 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW EVENTS LIKE 'ev3'|
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+
+SHOW EVENTS LIKE 'ev4'|
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+
+
+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
+DECLARE перем1 CHAR(10);
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION( 'текÑÑ‚') AS c3,
+COLLATION( 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci
+
+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
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION( 'текÑÑ‚') AS c3,
+COLLATION( 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci
+
+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
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION( 'текÑÑ‚') AS c3,
+COLLATION( 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci
+
+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
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION( 'текÑÑ‚') AS c3,
+COLLATION( 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci
+
+---> Dump of mysqltest1
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp866 */;
+
+USE `mysqltest1`;
+/*!50106 SET @save_time_zone= @@TIME_ZONE */ ;
+DELIMITER ;;
+ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;;
+/*!50003 SET character_set_client = utf8 */ ;;
+/*!50003 SET character_set_results = utf8 */ ;;
+/*!50003 SET collation_connection = utf8_general_ci */ ;;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;;
+/*!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
+DECLARE перем1 CHAR(10);
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION(_utf8 'текÑÑ‚') AS c3,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END */ ;;
+/*!50003 SET time_zone = @saved_time_zone */ ;;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;;
+/*!50003 SET character_set_client = @saved_cs_client */ ;;
+/*!50003 SET character_set_results = @saved_cs_results */ ;;
+/*!50003 SET collation_connection = @saved_col_connection */ ;;
+ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ;;
+DELIMITER ;;
+ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;;
+/*!50003 SET character_set_client = utf8 */ ;;
+/*!50003 SET character_set_results = utf8 */ ;;
+/*!50003 SET collation_connection = utf8_general_ci */ ;;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;;
+/*!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
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION(_utf8 'текÑÑ‚') AS c3,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END */ ;;
+/*!50003 SET time_zone = @saved_time_zone */ ;;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;;
+/*!50003 SET character_set_client = @saved_cs_client */ ;;
+/*!50003 SET character_set_results = @saved_cs_results */ ;;
+/*!50003 SET collation_connection = @saved_col_connection */ ;;
+ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ;;
+DELIMITER ;
+/*!50106 SET TIME_ZONE= @save_time_zone */ ;
+
+---> Dumping mysqltest1 to ddl_i18n_utf8events.mysqltest1.sql
+
+---> Dump of mysqltest2
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER SET cp866 */;
+
+USE `mysqltest2`;
+/*!50106 SET @save_time_zone= @@TIME_ZONE */ ;
+DELIMITER ;;
+ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;;
+/*!50003 SET character_set_client = utf8 */ ;;
+/*!50003 SET character_set_results = utf8 */ ;;
+/*!50003 SET collation_connection = utf8_general_ci */ ;;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;;
+/*!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
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION(_utf8 'текÑÑ‚') AS c3,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END */ ;;
+/*!50003 SET time_zone = @saved_time_zone */ ;;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;;
+/*!50003 SET character_set_client = @saved_cs_client */ ;;
+/*!50003 SET character_set_results = @saved_cs_results */ ;;
+/*!50003 SET collation_connection = @saved_col_connection */ ;;
+ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ;;
+DELIMITER ;;
+ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;;
+/*!50003 SET character_set_client = utf8 */ ;;
+/*!50003 SET character_set_results = utf8 */ ;;
+/*!50003 SET collation_connection = utf8_general_ci */ ;;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;;
+/*!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
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION(_utf8 'текÑÑ‚') AS c3,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END */ ;;
+/*!50003 SET time_zone = @saved_time_zone */ ;;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;;
+/*!50003 SET character_set_client = @saved_cs_client */ ;;
+/*!50003 SET character_set_results = @saved_cs_results */ ;;
+/*!50003 SET collation_connection = @saved_col_connection */ ;;
+ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ;;
+DELIMITER ;
+/*!50106 SET TIME_ZONE= @save_time_zone */ ;
+
+---> Dumping mysqltest2 to ddl_i18n_utf8events.mysqltest2.sql
+
+
+DROP DATABASE mysqltest1|
+DROP DATABASE mysqltest2|
+
+
+---> Restoring mysqltest1...
+---> Restoring mysqltest2...
+
+---> connection: con3
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+SHOW CREATE EVENT ev1|
+SHOW CREATE EVENT ev2|
+SHOW CREATE EVENT mysqltest2.ev3|
+SHOW CREATE EVENT mysqltest2.ev4|
+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
+DECLARE перем1 CHAR(10);
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION(_utf8 'текÑÑ‚') AS c3,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+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
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION(_utf8 'текÑÑ‚') AS c3,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+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
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION(_utf8 'текÑÑ‚') AS c3,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+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
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION(_utf8 'текÑÑ‚') AS c3,
+COLLATION(_koi8r 'ÔÅËÓÔ') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END utf8 utf8_general_ci utf8_unicode_ci
+
+
+SHOW EVENTS LIKE 'ev1'|
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+mysqltest1 ev1 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW EVENTS LIKE 'ev2'|
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+mysqltest1 ev2 root@localhost SYSTEM ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED 1 utf8 utf8_general_ci utf8_unicode_ci
+
+SHOW EVENTS LIKE 'ev3'|
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+
+SHOW EVENTS LIKE 'ev4'|
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+
+
+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
+DECLARE перем1 CHAR(10);
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION( 'текÑÑ‚') AS c3,
+COLLATION( 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci
+
+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
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION( 'текÑÑ‚') AS c3,
+COLLATION( 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci
+
+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
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION( 'текÑÑ‚') AS c3,
+COLLATION( 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci
+
+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
+DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+SELECT
+COLLATION(перем1) AS c1,
+COLLATION('текÑÑ‚') AS c2,
+COLLATION( 'текÑÑ‚') AS c3,
+COLLATION( 'текÑÑ‚') AS c4,
+@@collation_connection AS c5,
+@@character_set_client AS c6;
+END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci
+
+-------------------------------------------------------------------
+DDL statements within stored routine.
+-------------------------------------------------------------------
+
+DROP DATABASE IF EXISTS mysqltest1|
+DROP DATABASE IF EXISTS mysqltest2|
+CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+use mysqltest1|
+
+CREATE PROCEDURE p1()
+BEGIN
+CREATE TABLE t1(col1 VARCHAR(10));
+SHOW CREATE TABLE t1;
+END|
+
+CREATE PROCEDURE mysqltest2.p2()
+BEGIN
+CREATE TABLE t2(col1 VARCHAR(10));
+SHOW CREATE TABLE t2;
+END|
+
+CALL p1()|
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `col1` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
+
+SHOW CREATE TABLE t1|
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `col1` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
+
+
+CALL mysqltest2.p2()|
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `col1` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
+
+SHOW CREATE TABLE mysqltest2.t2|
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `col1` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
+
+ALTER DATABASE mysqltest1 COLLATE cp1251_general_cs|
+ALTER DATABASE mysqltest2 COLLATE cp1251_general_cs|
+DROP TABLE t1|
+DROP TABLE mysqltest2.t2|
+
+CALL p1()|
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `col1` varchar(10) COLLATE cp1251_general_cs DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=cp1251 COLLATE=cp1251_general_cs
+
+SHOW CREATE TABLE t1|
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `col1` varchar(10) COLLATE cp1251_general_cs DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=cp1251 COLLATE=cp1251_general_cs
+
+
+CALL mysqltest2.p2()|
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `col1` varchar(10) COLLATE cp1251_general_cs DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=cp1251 COLLATE=cp1251_general_cs
+
+SHOW CREATE TABLE mysqltest2.t2|
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `col1` varchar(10) COLLATE cp1251_general_cs DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=cp1251 COLLATE=cp1251_general_cs
+
+---> connection: default
+use test|
+DROP DATABASE mysqltest1|
+DROP DATABASE mysqltest2|
diff --git a/mysql-test/r/deadlock_innodb.result b/mysql-test/r/deadlock_innodb.result
index a0686d1c844..7a4874d6aab 100644
--- a/mysql-test/r/deadlock_innodb.result
+++ b/mysql-test/r/deadlock_innodb.result
@@ -112,3 +112,14 @@ id x
commit;
# Switch to connection default + disconnect con1 and con2
drop table t1, t2;
+End of 4.1 tests
+set storage_engine=innodb;
+drop table if exists a;
+drop table if exists A;
+create table A (c int);
+insert into A (c) values (0);
+create table a as select * from A;
+drop table A;
+drop table if exists a;
+set storage_engine=default;
+End of 5.0 tests.
diff --git a/mysql-test/r/default.result b/mysql-test/r/default.result
index cf9ef4f8f8b..e65e015eff9 100644
--- a/mysql-test/r/default.result
+++ b/mysql-test/r/default.result
@@ -115,7 +115,7 @@ Warning 1364 Field 'd' doesn't have a default value
desc bug20691;
Field Type Null Key Default Extra
i int(11) YES NULL
-d datetime NO
+d datetime NO NULL
dn datetime NO 0000-00-00 00:00:00
insert into bug20691 values (3, DEFAULT, DEFAULT), (3, '1975-07-10 07:10:03', '1978-01-13 14:08:51'), (3, DEFAULT, DEFAULT);
Warnings:
diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result
index 4bdf1c770d3..5084498c01c 100644
--- a/mysql-test/r/delete.result
+++ b/mysql-test/r/delete.result
@@ -183,6 +183,17 @@ select @a;
@a
1
drop table t1;
+CREATE TABLE t1 (
+`date` date ,
+`time` time ,
+`seq` int(10) unsigned NOT NULL auto_increment,
+PRIMARY KEY (`seq`),
+KEY `seq` (`seq`),
+KEY `time` (`time`),
+KEY `date` (`date`)
+);
+DELETE FROM t1 ORDER BY date ASC, time ASC LIMIT 1;
+drop table t1;
End of 4.1 tests
CREATE TABLE t1 (a int not null,b int not null);
CREATE TABLE t2 (a int not null, b int not null, primary key (a,b));
@@ -223,3 +234,40 @@ ERROR 42S22: Unknown column 't2.x' in 'order clause'
DELETE FROM t1 ORDER BY (SELECT x);
ERROR 42S22: Unknown column 'x' in 'field list'
DROP TABLE t1;
+CREATE TABLE t1 (
+a INT
+);
+CREATE TABLE t2 (
+a INT
+);
+CREATE DATABASE db1;
+CREATE TABLE db1.t1 (
+a INT
+);
+INSERT INTO db1.t1 (a) SELECT * FROM t1;
+CREATE DATABASE db2;
+CREATE TABLE db2.t1 (
+a INT
+);
+INSERT INTO db2.t1 (a) SELECT * FROM t2;
+DELETE FROM t1 alias USING t1, t2 alias WHERE t1.a = alias.a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'alias USING t1, t2 alias WHERE t1.a = alias.a' at line 1
+DELETE FROM alias USING t1, t2 alias WHERE t1.a = alias.a;
+DELETE FROM t1, alias USING t1, t2 alias WHERE t1.a = alias.a;
+DELETE FROM t1, t2 USING t1, t2 alias WHERE t1.a = alias.a;
+ERROR 42S02: Unknown table 't2' in MULTI DELETE
+DELETE FROM db1.t1 alias USING db1.t1, db2.t1 alias WHERE db1.t1.a = alias.a;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'alias USING db1.t1, db2.t1 alias WHERE db1.t1.a = alias.a' at line 1
+DELETE FROM alias USING db1.t1, db2.t1 alias WHERE db1.t1.a = alias.a;
+ERROR 42S02: Unknown table 'alias' in MULTI DELETE
+DELETE FROM db2.alias USING db1.t1, db2.t1 alias WHERE db1.t1.a = alias.a;
+DELETE FROM t1 USING t1 WHERE a = 1;
+SELECT * FROM t1;
+a
+DELETE FROM t1 alias USING t1 alias WHERE a = 2;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'alias USING t1 alias WHERE a = 2' at line 1
+SELECT * FROM t1;
+a
+DROP TABLE t1, t2;
+DROP DATABASE db1;
+DROP DATABASE db2;
diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result
index 750d542d14d..7da82ada121 100644
--- a/mysql-test/r/derived.result
+++ b/mysql-test/r/derived.result
@@ -57,8 +57,8 @@ a b a b
3 c 3 c
explain select * from t1 as x1, (select * from t1) as x2;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY x1 ALL NULL NULL NULL NULL 4 Using join cache
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 4
+1 PRIMARY x1 ALL NULL NULL NULL NULL 4
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 4 Using join buffer
2 DERIVED t1 ALL NULL NULL NULL NULL 4
drop table if exists t2,t3;
select * from (select 1) as a;
@@ -188,14 +188,14 @@ pla_id test
105 3
explain SELECT STRAIGHT_JOIN d.pla_id, m2.mat_id FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY m2 ALL NULL NULL NULL NULL 9 Using join cache
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 6 Using where
+1 PRIMARY m2 ALL NULL NULL NULL NULL 9
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 6 Using where; Using join buffer
2 DERIVED mp ALL NULL NULL NULL NULL 9 Using temporary; Using filesort
2 DERIVED m1 eq_ref PRIMARY PRIMARY 3 test.mp.mat_id 1
explain SELECT STRAIGHT_JOIN d.pla_id, m2.test FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY m2 ALL NULL NULL NULL NULL 9 Using join cache
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 6 Using where
+1 PRIMARY m2 ALL NULL NULL NULL NULL 9
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 6 Using where; Using join buffer
2 DERIVED mp ALL NULL NULL NULL NULL 9 Using temporary; Using filesort
2 DERIVED m1 eq_ref PRIMARY PRIMARY 3 test.mp.mat_id 1
drop table t1,t2;
@@ -245,8 +245,8 @@ a a
2 2
explain select * from ( select * from t1 union select * from t1) a,(select * from t1 union select * from t1) b;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 Using join cache
-1 PRIMARY <derived4> ALL NULL NULL NULL NULL 2
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2
+1 PRIMARY <derived4> ALL NULL NULL NULL NULL 2 Using join buffer
4 DERIVED t1 ALL NULL NULL NULL NULL 2
5 UNION t1 ALL NULL NULL NULL NULL 2
NULL UNION RESULT <union4,5> ALL NULL NULL NULL NULL NULL
@@ -312,8 +312,8 @@ b 3.5000
explain SELECT s.name, AVG(s.val) AS median FROM (SELECT x.name, x.val FROM t1 x, t1 y WHERE x.name=y.name GROUP BY x.name, x.val HAVING SUM(y.val <= x.val) >= COUNT(*)/2 AND SUM(y.val >= x.val) >= COUNT(*)/2) AS s GROUP BY s.name;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3 Using temporary; Using filesort
-2 DERIVED x ALL NULL NULL NULL NULL 17 Using temporary; Using filesort; Using join cache
-2 DERIVED y ALL NULL NULL NULL NULL 17 Using where
+2 DERIVED x ALL NULL NULL NULL NULL 17 Using temporary; Using filesort
+2 DERIVED y ALL NULL NULL NULL NULL 17 Using where; Using join buffer
drop table t1;
create table t2 (a int, b int, primary key (a));
insert into t2 values (1,7),(2,7);
diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result
index 3419ce150eb..b2a9eb04c04 100644
--- a/mysql-test/r/distinct.result
+++ b/mysql-test/r/distinct.result
@@ -174,8 +174,8 @@ INSERT INTO t3 VALUES (1,'1'),(2,'2'),(1,'1'),(2,'2');
explain SELECT distinct t3.a FROM t3,t2,t1 WHERE t3.a=t1.b AND t1.a=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 4 Using temporary
-1 SIMPLE t3 ref a a 5 test.t1.b 2 Using where; Using index; Using join cache
-1 SIMPLE t2 index a a 4 NULL 5 Using where; Using index; Distinct
+1 SIMPLE t3 ref a a 5 test.t1.b 2 Using where; Using index
+1 SIMPLE t2 index a a 4 NULL 5 Using where; Using index; Distinct; Using join buffer
SELECT distinct t3.a FROM t3,t2,t1 WHERE t3.a=t1.b AND t1.a=t2.a;
a
1
@@ -209,16 +209,16 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 Using index
explain SELECT distinct t1.a from t1 order by a desc limit 1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 Using index
+1 SIMPLE t1 index NULL PRIMARY 4 NULL 1 Using index
explain SELECT distinct a from t3 order by a desc limit 2;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t3 index NULL a 5 NULL 204 Using index
+1 SIMPLE t3 index NULL a 5 NULL 40 Using index
explain SELECT distinct a,b from t3 order by a+1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 ALL NULL NULL NULL NULL 204 Using temporary; Using filesort
-explain SELECT distinct a,b from t3 order by a limit 10;
+explain SELECT distinct a,b from t3 order by a limit 2;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t3 index NULL a 5 NULL 204 Using temporary
+1 SIMPLE t3 index NULL a 5 NULL 2 Using temporary
explain SELECT a,b from t3 group by a,b order by a+1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 ALL NULL NULL NULL NULL 204 Using temporary; Using filesort
@@ -299,12 +299,12 @@ WHERE
((t1.id=j_lj_t2.id AND t2_lj.id IS NULL) OR (t1.id=t2.id AND t2.idx=2))
AND ((t1.id=j_lj_t3.id AND t3_lj.id IS NULL) OR (t1.id=t3.id AND t3.idx=2));
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index id id 4 NULL 2 Using index; Using temporary; Using join cache
-1 SIMPLE t2 index id id 8 NULL 1 Using index; Distinct; Using join cache
-1 SIMPLE t3 index id id 8 NULL 1 Using index; Distinct; Using join cache
-1 SIMPLE j_lj_t2 index id id 4 NULL 2 Using where; Using index; Distinct
-1 SIMPLE t2_lj ref id id 4 test.j_lj_t2.id 1 Using where; Using index; Distinct; Using join cache
-1 SIMPLE j_lj_t3 index id id 4 NULL 2 Using where; Using index; Distinct
+1 SIMPLE t1 index id id 4 NULL 2 Using index; Using temporary
+1 SIMPLE t2 index id id 8 NULL 1 Using index; Distinct; Using join buffer
+1 SIMPLE t3 index id id 8 NULL 1 Using index; Distinct; Using join buffer
+1 SIMPLE j_lj_t2 index id id 4 NULL 2 Using where; Using index; Distinct; Using join buffer
+1 SIMPLE t2_lj ref id id 4 test.j_lj_t2.id 1 Using where; Using index; Distinct
+1 SIMPLE j_lj_t3 index id id 4 NULL 2 Using where; Using index; Distinct; Using join buffer
1 SIMPLE t3_lj ref id id 4 test.j_lj_t3.id 1 Using where; Using index; Distinct
SELECT DISTINCT
t1.id
@@ -514,8 +514,8 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
EXPLAIN SELECT DISTINCT t1_1.a, t1_1.b FROM t1 t1_1, t1 t1_2;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1_1 ALL NULL NULL NULL NULL 3 Using temporary; Using join cache
-1 SIMPLE t1_2 index NULL PRIMARY 4 NULL 3 Using index; Distinct
+1 SIMPLE t1_1 ALL NULL NULL NULL NULL 3 Using temporary
+1 SIMPLE t1_2 index NULL PRIMARY 4 NULL 3 Using index; Distinct; Using join buffer
EXPLAIN SELECT DISTINCT t1_1.a, t1_1.b FROM t1 t1_1, t1 t1_2
WHERE t1_1.a = t1_2.a;
id select_type table type possible_keys key key_len ref rows Extra
@@ -526,10 +526,10 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL PRIMARY 4 NULL 3 Using index
EXPLAIN SELECT a,b FROM t1 GROUP BY a,b;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using filesort
EXPLAIN SELECT DISTINCT a,b FROM t1 GROUP BY a,b;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using filesort
CREATE TABLE t2(a INT, b INT NOT NULL, c INT NOT NULL, d INT,
PRIMARY KEY (a,b));
INSERT INTO t2 VALUES (1,1,1,50), (1,2,3,40), (2,1,3,4);
@@ -554,7 +554,7 @@ id select_type table type possible_keys key key_len ref rows Extra
CREATE UNIQUE INDEX c_b_unq ON t2 (c,b);
EXPLAIN SELECT DISTINCT a,b,d FROM t2 GROUP BY c,b,d;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using filesort
DROP TABLE t1,t2;
create table t1 (id int, dsc varchar(50));
insert into t1 values (1, "line number one"), (2, "line number two"), (3, "line number three");
diff --git a/mysql-test/r/endspace.result b/mysql-test/r/endspace.result
index 6fb33dee826..9c8d12362c4 100644
--- a/mysql-test/r/endspace.result
+++ b/mysql-test/r/endspace.result
@@ -154,7 +154,7 @@ teststring
teststring
explain select * from t1 order by text1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL key1 34 NULL 3
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using filesort
alter table t1 modify text1 char(32) binary not null;
select * from t1 order by text1;
text1
diff --git a/mysql-test/r/error_simulation.result b/mysql-test/r/error_simulation.result
new file mode 100644
index 00000000000..77599ba303b
--- /dev/null
+++ b/mysql-test/r/error_simulation.result
@@ -0,0 +1,19 @@
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 (
+a varchar(32) character set utf8 collate utf8_bin NOT NULL,
+b varchar(32) character set utf8 collate utf8_bin NOT NULL )
+ENGINE=MyISAM DEFAULT CHARSET=utf8;
+INSERT INTO t1 VALUES
+('AAAAAAAAAA','AAAAAAAAAA'), ('AAAAAAAAAB','AAAAAAAAAB '),
+('AAAAAAAAAB','AAAAAAAAAB'), ('AAAAAAAAAC','AAAAAAAAAC'),
+('AAAAAAAAAD','AAAAAAAAAD'), ('AAAAAAAAAE','AAAAAAAAAE'),
+('AAAAAAAAAF','AAAAAAAAAF'), ('AAAAAAAAAG','AAAAAAAAAG'),
+('AAAAAAAAAH','AAAAAAAAAH'), ('AAAAAAAAAI','AAAAAAAAAI'),
+('AAAAAAAAAJ','AAAAAAAAAJ'), ('AAAAAAAAAK','AAAAAAAAAK');
+set tmp_table_size=1024;
+SELECT MAX(a) FROM t1 GROUP BY a,b;
+ERROR 23000: Can't write; duplicate key in table 'tmp_table'
+set tmp_table_size=default;
+DROP TABLE t1;
diff --git a/mysql-test/r/errors.result b/mysql-test/r/errors.result
index 94debb1785f..022a32d9c9b 100644
--- a/mysql-test/r/errors.result
+++ b/mysql-test/r/errors.result
@@ -41,3 +41,17 @@ SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0)));
a
1
DROP TABLE t1;
+CREATE TABLE t1( a INT );
+SELECT b FROM t1;
+ERROR 42S22: Unknown column 'b' in 'field list'
+SHOW ERRORS;
+Level Code Message
+Error 1054 Unknown column 'b' in 'field list'
+CREATE TABLE t2 SELECT b FROM t1;
+ERROR 42S22: Unknown column 'b' in 'field list'
+SHOW ERRORS;
+Level Code Message
+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;
diff --git a/mysql-test/r/events.result b/mysql-test/r/events.result
index 0b1cd67f559..d1ee6d1c5a1 100644
--- a/mysql-test/r/events.result
+++ b/mysql-test/r/events.result
@@ -122,82 +122,105 @@ drop table t_event3;
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
-root6 SYSTEM CREATE EVENT `root6` ON SCHEDULE EVERY '10:20' MINUTE_SECOND STARTS '#' ON COMPLETION PRESERVE ENABLE COMMENT 'some comment' DO select 1
+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
create event root7 on schedule every 2 year do select 1;
SHOW CREATE EVENT root7;
-Event sql_mode time_zone Create Event
-root7 SYSTEM CREATE EVENT `root7` ON SCHEDULE EVERY 2 YEAR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1
+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
create event root8 on schedule every '2:5' year_month do select 1;
SHOW CREATE EVENT root8;
-Event sql_mode time_zone Create Event
-root8 SYSTEM CREATE EVENT `root8` ON SCHEDULE EVERY '2-5' YEAR_MONTH STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1
+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
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
-root8_1 SYSTEM CREATE EVENT `root8_1` ON SCHEDULE EVERY '3-3' YEAR_MONTH STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 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
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
-root9 SYSTEM CREATE EVENT `root9` ON SCHEDULE EVERY 2 WEEK STARTS '#' ON COMPLETION PRESERVE DISABLE COMMENT 'коментар на кирилица' DO select 1
+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
create event root10 on schedule every '20:5' day_hour do select 1;
SHOW CREATE EVENT root10;
-Event sql_mode time_zone Create Event
-root10 SYSTEM CREATE EVENT `root10` ON SCHEDULE EVERY '20 5' DAY_HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1
+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
create event root11 on schedule every '20:25' day_hour do select 1;
SHOW CREATE EVENT root11;
-Event sql_mode time_zone Create Event
-root11 SYSTEM CREATE EVENT `root11` ON SCHEDULE EVERY '21 1' DAY_HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1
+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
create event root12 on schedule every '20:25' hour_minute do select 1;
SHOW CREATE EVENT root12;
-Event sql_mode time_zone Create Event
-root12 SYSTEM CREATE EVENT `root12` ON SCHEDULE EVERY '20:25' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1
+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
create event root13 on schedule every '25:25' hour_minute do select 1;
SHOW CREATE EVENT root13;
-Event sql_mode time_zone Create Event
-root13 SYSTEM CREATE EVENT `root13` ON SCHEDULE EVERY '25:25' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1
+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
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
-root13_1 SYSTEM CREATE EVENT `root13_1` ON SCHEDULE EVERY '12:5' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 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
create event root14 on schedule every '35:35' minute_second do select 1;
SHOW CREATE EVENT root14;
-Event sql_mode time_zone Create Event
-root14 SYSTEM CREATE EVENT `root14` ON SCHEDULE EVERY '35:35' MINUTE_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1
+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
create event root15 on schedule every '35:66' minute_second do select 1;
SHOW CREATE EVENT root15;
-Event sql_mode time_zone Create Event
-root15 SYSTEM CREATE EVENT `root15` ON SCHEDULE EVERY '36:6' MINUTE_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1
+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
create event root16 on schedule every '35:56' day_minute do select 1;
SHOW CREATE EVENT root16;
-Event sql_mode time_zone Create Event
-root16 SYSTEM CREATE EVENT `root16` ON SCHEDULE EVERY '1 11:56' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1
+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
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
-root17 SYSTEM CREATE EVENT `root17` ON SCHEDULE EVERY '35 12:45' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1
+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
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
-root17_1 SYSTEM CREATE EVENT `root17_1` ON SCHEDULE EVERY '36 2:5' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 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
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
-root18 SYSTEM CREATE EVENT `root18` ON SCHEDULE EVERY '35:12:45' HOUR_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1
+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
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
-root19 SYSTEM CREATE EVENT `root19` ON SCHEDULE EVERY '16:0:25' HOUR_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1
+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
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
-root20 SYSTEM CREATE EVENT `root20` ON SCHEDULE EVERY '50 20:12:45' DAY_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1
+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
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
-ðóóò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
-insert into mysql.event (db, name, body, definer, interval_value, interval_field, originator) values (database(), "root22", "select 1", user(), 100, "SECOND_MICROSECOND", 1);
+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
+insert into mysql.event (
+db,
+name,
+body,
+definer,
+interval_value,
+interval_field,
+originator,
+character_set_client,
+collation_connection,
+db_collation,
+body_utf8)
+values (
+database(),
+"root22",
+"select 1",
+user(),
+100,
+"SECOND_MICROSECOND",
+1,
+'utf8',
+'utf8_general_ci',
+'utf8_general_ci',
+'select 1');
show create event root22;
ERROR 42000: This version of MySQL doesn't yet support 'MICROSECOND'
SHOW EVENTS;
@@ -231,8 +254,8 @@ Create a test event. Only event metadata is relevant,
the actual schedule and body are not.
CREATE EVENT intact_check ON SCHEDULE EVERY 10 HOUR DO SELECT "nothing";
SHOW EVENTS;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
-events_test intact_check root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1
+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 intact_check root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
Try to alter mysql.event: the server should fail to load
event information after mysql.event was tampered with.
@@ -241,14 +264,14 @@ works as before
ALTER TABLE mysql.event ADD dummy INT;
SHOW EVENTS;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
-events_test intact_check root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1
+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 intact_check root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
SELECT event_name FROM INFORMATION_SCHEMA.events;
event_name
intact_check
SHOW CREATE EVENT intact_check;
-Event sql_mode time_zone Create Event
-intact_check SYSTEM CREATE EVENT `intact_check` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO SELECT "nothing"
+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
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;
@@ -330,7 +353,7 @@ ERROR HY000: Cannot load from mysql.event. The table is probably corrupted
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;
-ERROR HY000: Column count of mysql.event is wrong. Expected 18, found 16. The table is probably corrupted
+ERROR HY000: Column count of mysql.event is wrong. Expected 22, found 20. The table is probably corrupted
ALTER EVENT intact_check_1 ON SCHEDULE EVERY 8 HOUR DO SELECT 8;
ERROR HY000: Unknown event 'intact_check_1'
ALTER EVENT intact_check_1 RENAME TO intact_check_2;
@@ -400,7 +423,7 @@ Restore the original table.
CREATE TABLE mysql.event like event_like;
DROP TABLE event_like;
SHOW EVENTS;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
create event e_26 on schedule at '2017-01-01 00:00:00' disable do set @a = 5;
select db, name, body, definer, convert_tz(execute_at, 'UTC', 'SYSTEM'), on_completion from mysql.event;
db name body definer convert_tz(execute_at, 'UTC', 'SYSTEM') on_completion
@@ -431,8 +454,11 @@ create event закачка on schedule every 10 hour do select get_lock("test_l
select definer, name, db from mysql.event;
definer name db
root@localhost закачка events_test
-"Should be only 1 process"
-select /*1*/ user, host, db, command, state, info from information_schema.processlist where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info;
+"Should be only 0 process"
+select /*1*/ user, host, db, command, state, info
+from information_schema.processlist
+where (user='event_scheduler')
+order by info;
user host db command state info
select release_lock("test_lock1");
release_lock("test_lock1")
@@ -449,14 +475,15 @@ get_lock("test_lock2", 20)
1
"Create an event which tries to acquire a mutex. The event locks on the mutex"
create event закачка on schedule every 10 hour do select get_lock("test_lock2", 20);
-"Let some time pass to the event starts"
"Should have only 2 processes: the scheduler and the locked event"
-select /*2*/ user, host, db, command, state, info from information_schema.processlist where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info;
+select /*2*/ user, host, db, command, state, info
+from information_schema.processlist
+where (info like "select get_lock%" OR user='event_scheduler')
+order by info;
user host db command state info
event_scheduler localhost NULL Daemon Waiting for next activation NULL
root localhost events_test Connect User lock select get_lock("test_lock2", 20)
"Release the mutex, the event worker should finish."
-"Release the mutex, the event worker should finish."
select release_lock("test_lock2");
release_lock("test_lock2")
1
@@ -466,16 +493,25 @@ select get_lock("test_lock2_1", 20);
get_lock("test_lock2_1", 20)
1
create event закачка21 on schedule every 10 hour do select get_lock("test_lock2_1", 20);
-"Should have only 3 processes: the scheduler, our conn and the locked event"
-select /*3*/ user, host, db, command, state, info from information_schema.processlist where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info;
+"Should have only 2 processes: the scheduler and the locked event"
+select /*3*/ user, host, db, command, state, info
+from information_schema.processlist
+where (info like "select get_lock%" OR user='event_scheduler')
+order by info;
user host db command state info
event_scheduler localhost NULL Daemon Waiting for next activation NULL
root localhost events_test Connect User lock select get_lock("test_lock2_1", 20)
set global event_scheduler=off;
"Should have only our process now:"
-select /*4*/ user, host, db, command, state, info from information_schema.processlist where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info;
+select /*4*/ user, host, db, command, state, info
+from information_schema.processlist
+where (info like "select get_lock%" OR user='event_scheduler')
+order by info;
user host db command state info
root localhost events_test Connect User lock select get_lock("test_lock2_1", 20)
+select release_lock("test_lock2_1");
+release_lock("test_lock2_1")
+1
drop event закачка21;
create table t_16 (s1 int);
create trigger t_16_bi before insert on t_16 for each row create event e_16 on schedule every 1 second do set @a=5;
@@ -512,7 +548,7 @@ ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
SHOW EVENTS FROM ``;
ERROR 42000: Incorrect database name ''
SHOW EVENTS FROM `events\\test`;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
LOCK TABLES mode.
@@ -520,8 +556,8 @@ create table t1 (a int);
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
-e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1
+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
select event_name from information_schema.events;
event_name
e1
@@ -538,8 +574,8 @@ ERROR HY000: Table 'event' was not locked with LOCK TABLES
unlock tables;
lock table t1 write;
show create event e1;
-Event sql_mode time_zone Create Event
-e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1
+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
select event_name from information_schema.events;
event_name
e1
@@ -556,8 +592,8 @@ ERROR HY000: Table 'event' was not locked with LOCK TABLES
unlock tables;
lock table t1 read, mysql.event read;
show create event e1;
-Event sql_mode time_zone Create Event
-e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1
+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
select event_name from information_schema.events;
event_name
e1
@@ -574,8 +610,8 @@ ERROR HY000: Table 'event' was locked with a READ lock and can't be updated
unlock tables;
lock table t1 write, mysql.event read;
show create event e1;
-Event sql_mode time_zone Create Event
-e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1
+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
select event_name from information_schema.events;
event_name
e1
@@ -596,8 +632,8 @@ lock table t1 write, mysql.event write;
ERROR HY000: You can't combine write-locking of system tables with other tables or lock types
lock table mysql.event write;
show create event e1;
-Event sql_mode time_zone Create Event
-e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1
+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
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 c4053bcfb47..3c9e6384c64 100644
--- a/mysql-test/r/events_bugs.result
+++ b/mysql-test/r/events_bugs.result
@@ -31,9 +31,9 @@ create event e_55 on schedule at 10000101000000 do drop table t;
ERROR HY000: Incorrect AT value: '10000101000000'
create event e_55 on schedule at 20000101000000 do drop table t;
Warnings:
-Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created
+Note 1587 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
show events;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
create event e_55 on schedule at 20200101000000 starts 10000101000000 do drop table t;
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 'starts 10000101000000 do drop table t' at line 1
create event e_55 on schedule at 20200101000000 ends 10000101000000 do drop table t;
@@ -53,7 +53,6 @@ get_lock('test_bug16407', 60)
create event e_16407 on schedule every 60 second do
begin
select get_lock('test_bug16407', 60);
-drop table "hashed_num";
end|
"Now if everything is fine the event has compiled and is locked"
select /*1*/ user, host, db, info from information_schema.processlist where command!='Daemon' and (info is null or info not like '%processlist%') order by info;
@@ -390,30 +389,30 @@ SET TIME_ZONE= '+00:00';
SET TIMESTAMP= UNIX_TIMESTAMP('2005-12-31 23:58:59');
CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
SHOW EVENTS;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
-events_test e1 root@localhost +00:00 RECURRING NULL 1 DAY 2005-12-31 23:58:59 NULL ENABLED 1
+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 +00:00 RECURRING NULL 1 DAY 2005-12-31 23:58:59 NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
SET TIME_ZONE= '-01:00';
ALTER EVENT e1 ON SCHEDULE EVERY 1 DAY STARTS '2000-01-01 00:00:00';
SHOW EVENTS;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
-events_test e1 root@localhost -01:00 RECURRING NULL 1 DAY 2000-01-01 00:00:00 NULL ENABLED 1
+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 -01:00 RECURRING NULL 1 DAY 2000-01-01 00:00:00 NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
SET TIME_ZONE= '+02:00';
ALTER EVENT e1 ON SCHEDULE AT '2000-01-02 00:00:00'
ON COMPLETION PRESERVE DISABLE;
SHOW EVENTS;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
-events_test e1 root@localhost +02:00 ONE TIME 2000-01-02 00:00:00 NULL NULL NULL NULL DISABLED 1
+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 +02:00 ONE TIME 2000-01-02 00:00:00 NULL NULL NULL NULL DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
SET TIME_ZONE= '-03:00';
ALTER EVENT e1 ON SCHEDULE EVERY 1 DAY ENDS '2030-01-03 00:00:00'
ON COMPLETION PRESERVE DISABLE;
SHOW EVENTS;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
-events_test e1 root@localhost -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 DISABLED 1
+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 -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
SET TIME_ZONE= '+04:00';
ALTER EVENT e1 DO SELECT 2;
SHOW EVENTS;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
-events_test e1 root@localhost -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 ENABLED 1
+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 -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
DROP EVENT e1;
SET TIME_ZONE='+05:00';
CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO
@@ -427,75 +426,75 @@ SET TIME_ZONE='+00:00';
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
-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
-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
-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
+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
SHOW EVENTS;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
-events_test e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1
-events_test e2 root@localhost -05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1
-events_test e3 root@localhost +00:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1
+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
+events_test e2 root@localhost -05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+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
-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
+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
SHOW CREATE EVENT e2;
-Event sql_mode time_zone Create Event
-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
+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
SHOW CREATE EVENT e3;
-Event sql_mode time_zone Create Event
-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
+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
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';
-ERROR HY000: Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been altered
+ERROR HY000: Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'
ENDS '1999-01-02 00:00:00' DISABLE;
-ERROR HY000: Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been altered
+ERROR HY000: Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
The following should give warnings, and nothing should be created.
CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'
ENDS '1999-01-02 00:00:00'
DO
SELECT 1;
Warnings:
-Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created
+Note 1587 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'
ENDS '1999-01-02 00:00:00' DISABLE
DO
SELECT 1;
Warnings:
-Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created
+Note 1587 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
CREATE EVENT e4 ON SCHEDULE AT '1999-01-01 00:00:00' DO
SELECT 1;
Warnings:
-Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created
+Note 1587 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
CREATE EVENT e4 ON SCHEDULE AT '1999-01-01 00:00:00' DISABLE
DO
SELECT 1;
Warnings:
-Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created
+Note 1587 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
SHOW EVENTS;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
-events_test e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1
-events_test e2 root@localhost -05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1
-events_test e3 root@localhost +00:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1
+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
+events_test e2 root@localhost -05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+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
The following should succeed giving a warning.
ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'
ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE;
Warnings:
-Note 1533 Event execution time is in the past. Event has been disabled
+Note 1543 Event execution time is in the past. Event has been disabled
CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'
ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE
DO
SELECT 1;
Warnings:
-Note 1533 Event execution time is in the past. Event has been disabled
+Note 1543 Event execution time is in the past. Event has been disabled
CREATE EVENT e5 ON SCHEDULE AT '1999-01-01 00:00:00'
ON COMPLETION PRESERVE
DO
SELECT 1;
Warnings:
-Note 1533 Event execution time is in the past. Event has been disabled
+Note 1543 Event execution time is in the past. Event has been disabled
The following should succeed without warnings.
ALTER EVENT e2 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00';
ALTER EVENT e3 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'
@@ -511,15 +510,15 @@ CREATE EVENT e8 ON SCHEDULE AT '1999-01-01 00:00:00'
DO
SELECT 1;
SHOW EVENTS;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
-events_test e1 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED 1
-events_test e2 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 NULL ENABLED 1
-events_test e3 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED 1
-events_test e4 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED 1
-events_test e5 root@localhost +00:00 ONE TIME 1999-01-01 00:00:00 NULL NULL NULL NULL DISABLED 1
-events_test e6 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 NULL ENABLED 1
-events_test e7 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED 1
-events_test e8 root@localhost +00:00 ONE TIME 1999-01-01 00:00:00 NULL NULL NULL NULL DISABLED 1
+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 +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+events_test e2 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+events_test e3 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+events_test e4 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+events_test e5 root@localhost +00:00 ONE TIME 1999-01-01 00:00:00 NULL NULL NULL NULL DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+events_test e6 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+events_test e7 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+events_test e8 root@localhost +00:00 ONE TIME 1999-01-01 00:00:00 NULL NULL NULL NULL DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
DROP EVENT e8;
DROP EVENT e7;
DROP EVENT e6;
@@ -529,4 +528,93 @@ DROP EVENT e3;
DROP EVENT e2;
DROP EVENT e1;
SET TIME_ZONE=@save_time_zone;
-drop database events_test;
+drop event if exists new_event;
+CREATE EVENT new_event ON SCHEDULE EVERY 0 SECOND DO SELECT 1;
+ERROR HY000: INTERVAL is either not positive or too big
+CREATE EVENT new_event ON SCHEDULE EVERY (SELECT 0) SECOND DO SELECT 1;
+ERROR HY000: INTERVAL is either not positive or too big
+CREATE EVENT new_event ON SCHEDULE EVERY "abcdef" SECOND DO SELECT 1;
+ERROR HY000: INTERVAL is either not positive or too big
+CREATE EVENT new_event ON SCHEDULE EVERY "0abcdef" SECOND DO SELECT 1;
+ERROR HY000: INTERVAL is either not positive or too big
+CREATE EVENT new_event ON SCHEDULE EVERY "a1bcdef" SECOND DO SELECT 1;
+ERROR HY000: INTERVAL is either not positive or too big
+CREATE EVENT new_event ON SCHEDULE EVERY (SELECT "abcdef" UNION SELECT "abcdef") SECOND DO SELECT 1;
+ERROR HY000: INTERVAL is either not positive or too big
+CREATE EVENT new_event ON SCHEDULE EVERY (SELECT "0abcdef") SECOND DO SELECT 1;
+ERROR HY000: INTERVAL is either not positive or too big
+CREATE EVENT new_event ON SCHEDULE EVERY (SELECT "a1bcdef") SECOND DO SELECT 1;
+ERROR HY000: INTERVAL is either not positive or too big
+CREATE EVENT new_event ON SCHEDULE AT "every day" DO SELECT 1;
+ERROR HY000: Incorrect AT value: 'every day'
+CREATE EVENT new_event ON SCHEDULE AT "0every day" DO SELECT 1;
+ERROR HY000: Incorrect AT value: '0every day'
+CREATE EVENT new_event ON SCHEDULE AT (SELECT "every day") DO SELECT 1;
+ERROR HY000: Incorrect AT value: 'every day'
+CREATE EVENT new_event ON SCHEDULE AT NOW() STARTS NOW() DO SELECT 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STARTS NOW() DO SELECT 1' at line 1
+CREATE EVENT new_event ON SCHEDULE AT NOW() ENDS NOW() DO SELECT 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ENDS NOW() DO SELECT 1' at line 1
+CREATE EVENT new_event ON SCHEDULE AT NOW() STARTS NOW() ENDS NOW() DO SELECT 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STARTS NOW() ENDS NOW() DO SELECT 1' at line 1
+USE test;
+SHOW GRANTS FOR CURRENT_USER;
+Grants for root@localhost
+GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+SET GLOBAL event_scheduler = ON;
+CREATE TABLE event_log (id int KEY AUTO_INCREMENT,
+ev_nm char(40), ev_cnt int,
+ev_tm timestamp) ENGINE=MyISAM;
+SET @ev_base_date = 20281224180000;
+SET autocommit=0;
+CREATE USER evtest1@localhost;
+SET PASSWORD FOR evtest1@localhost = password('ev1');
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM evtest1@localhost;
+GRANT create, insert, select, event ON events_test.* TO evtest1@localhost;
+GRANT select,insert ON test.* TO evtest1@localhost;
+SHOW GRANTS FOR evtest1@localhost;
+Grants for evtest1@localhost
+GRANT USAGE ON *.* TO 'evtest1'@'localhost' IDENTIFIED BY PASSWORD '*3170F3644E31580C25DE4A08F4C07CC9A2D40C32'
+GRANT SELECT, INSERT ON `test`.* TO 'evtest1'@'localhost'
+GRANT SELECT, INSERT, CREATE, EVENT ON `events_test`.* TO 'evtest1'@'localhost'
+connection e1;
+USE events_test;
+CREATE EVENT ev_sched_1823 ON SCHEDULE EVERY 2 SECOND
+DO BEGIN
+SET AUTOCOMMIT = 0;
+SET @evname = 'ev_sched_1823';
+SET @cnt = 0;
+SELECT COUNT(*) INTO @cnt FROM test.event_log WHERE ev_nm = @evname;
+IF @cnt < 6 THEN
+INSERT INTO test.event_log VALUES (NULL,@evname,@cnt+1,current_timestamp());
+COMMIT;
+END IF;
+SELECT COUNT(*) INTO @cnt FROM test.event_log WHERE ev_nm = @evname;
+IF @cnt < 6 THEN
+INSERT INTO test.event_log VALUES (NULL,@evname,@cnt+1,current_timestamp());
+ROLLBACK;
+END IF;
+END;|
+connection default;
+DROP EVENT ev_sched_1823;
+DROP USER evtest1@localhost;
+USE test;
+=====================================================================================
+select id,ev_nm,ev_cnt from event_log order by id;
+id ev_nm ev_cnt
+1 ev_sched_1823 1
+2 ev_sched_1823 2
+3 ev_sched_1823 3
+4 ev_sched_1823 4
+5 ev_sched_1823 5
+6 ev_sched_1823 6
+DROP TABLE event_log;
+SET GLOBAL event_scheduler = OFF;
+DROP DATABASE events_test;
+SET GLOBAL event_scheduler= ON;
+CREATE EVENT bug28641 ON SCHEDULE AT '2038.01.18 03:00:00'
+ DO BEGIN
+SELECT 1;
+END;|
+SET GLOBAL event_scheduler= OFF;
+DROP EVENT bug28641;
diff --git a/mysql-test/r/events_grant.result b/mysql-test/r/events_grant.result
index 278cc5956f5..1aadf7e11f4 100644
--- a/mysql-test/r/events_grant.result
+++ b/mysql-test/r/events_grant.result
@@ -2,8 +2,8 @@ CREATE DATABASE IF NOT EXISTS events_test;
use events_test;
CREATE EVENT one_event ON SCHEDULE EVERY 10 SECOND DO SELECT 123;
SHOW EVENTS;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
-events_test one_event root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1
+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 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
@@ -29,8 +29,8 @@ ERROR 42000: Access denied for user 'ev_test'@'localhost' to database 'events_te
USE events_test;
"We should see one event";
SHOW EVENTS;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
-events_test one_event root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1
+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 one_event root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
SELECT CONCAT("Let's create some new events from the name of ", USER());
CONCAT("Let's create some new events from the name of ", USER())
Let's create some new events from the name of ev_test@localhost
@@ -40,18 +40,18 @@ CREATE EVENT two_event ON SCHEDULE EVERY 20 SECOND ON COMPLETION NOT PRESERVE CO
CREATE EVENT three_event ON SCHEDULE EVERY 20 SECOND ON COMPLETION PRESERVE COMMENT "three event" DO SELECT 123;
"Now we should see 3 events:";
SHOW EVENTS;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
-events_test one_event root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1
-events_test three_event ev_test@localhost SYSTEM RECURRING NULL 20 # # NULL ENABLED 1
-events_test two_event ev_test@localhost SYSTEM RECURRING NULL 20 # # NULL ENABLED 1
+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 one_event root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+events_test three_event ev_test@localhost SYSTEM RECURRING NULL 20 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+events_test two_event ev_test@localhost SYSTEM RECURRING NULL 20 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
"This should show us only 2 events:";
SHOW EVENTS LIKE 't%event';
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
-events_test three_event ev_test@localhost SYSTEM RECURRING NULL 20 # # NULL ENABLED 1
-events_test two_event ev_test@localhost SYSTEM RECURRING NULL 20 # # NULL ENABLED 1
+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 three_event ev_test@localhost SYSTEM RECURRING NULL 20 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+events_test two_event ev_test@localhost SYSTEM RECURRING NULL 20 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
"This should show us no events:";
SHOW EVENTS FROM test LIKE '%';
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
GRANT EVENT ON events_test2.* TO ev_test@localhost;
USE events_test2;
CREATE EVENT four_event ON SCHEDULE EVERY 20 SECOND DO SELECT 42;
diff --git a/mysql-test/r/events_logs_tests.result b/mysql-test/r/events_logs_tests.result
index 0d49060f4a9..b7faf56f466 100644
--- a/mysql-test/r/events_logs_tests.result
+++ b/mysql-test/r/events_logs_tests.result
@@ -1,100 +1,72 @@
-CREATE DATABASE IF NOT EXISTS events_test;
-USE events_test;
-"We use procedure here because its statements won't be logged into the general log"
-"If we had used normal select that are logged in different ways depending on whether"
-"the test suite is run in normal mode or with --ps-protocol"
-CREATE procedure select_general_log()
-BEGIN
-SELECT user_host, argument FROM mysql.general_log WHERE argument LIKE '%alabala%';
-END|
-"Check General Query Log"
-CALL select_general_log();
+drop database if exists events_test;
+create database if not exists events_test;
+use events_test;
+
+We use procedure here because its statements won't be
+logged into the general log. If we had used normal select
+that are logged in different ways depending on whether the
+test suite is run in normal mode or with --ps-protocol
+
+create procedure select_general_log()
+begin
+select user_host, argument from mysql.general_log
+where argument like '%events_logs_test%';
+end|
+
+Check that general query log works, but sub-statements
+of the stored procedure do not leave traces in it.
+
+truncate mysql.general_log;
+select 'events_logs_tests' as outside_event;
+outside_event
+events_logs_tests
+call select_general_log();
user_host argument
-USER_HOST CREATE procedure select_general_log()
-BEGIN
-SELECT user_host, argument FROM mysql.general_log WHERE argument LIKE '%alabala%';
-END
-SET GLOBAL event_scheduler=on;
-TRUNCATE mysql.general_log;
-CREATE EVENT log_general ON SCHEDULE EVERY 1 MINUTE DO SELECT 'alabala', SLEEP(1) FROM DUAL;
-"Wait the scheduler to start"
-"Should see 2 rows - the 'SELECT' is in the middle. The other two are selects from general_log"
-CALL select_general_log();
+USER_HOST select 'events_logs_tests' as outside_event
+
+Check that unlike sub-statements of stored procedures,
+sub-statements of events are present in the general log.
+
+set global event_scheduler=on;
+truncate mysql.general_log;
+create event ev_log_general on schedule at now() on completion not preserve do select 'events_logs_test' as inside_event;
+call select_general_log();
user_host argument
-USER_HOST CREATE EVENT log_general ON SCHEDULE EVERY 1 MINUTE DO SELECT 'alabala', SLEEP(1) FROM DUAL
-USER_HOST SELECT 'alabala', SLEEP(1) FROM DUAL
-DROP PROCEDURE select_general_log;
-DROP EVENT log_general;
-SET GLOBAL event_scheduler=off;
-"Check slow query log"
-"Save the values"
-SET @old_global_long_query_time:=(select get_value());
-SET @old_session_long_query_time:=@@long_query_time;
-SHOW VARIABLES LIKE 'log_slow_queries';
+USER_HOST create event ev_log_general on schedule at now() on completion not preserve do select 'events_logs_test' as inside_event
+USER_HOST select 'events_logs_test' as inside_event
+
+Check slow query log
+
+Ensure that slow logging is on
+show variables like 'log_slow_queries';
Variable_name Value
log_slow_queries ON
-DROP FUNCTION get_value;
-"Make it quite long"
-SET SESSION long_query_time=300;
-TRUNCATE mysql.slow_log;
-SELECT user_host, query_time, db, sql_text FROM mysql.slow_log;
-user_host query_time db sql_text
-"Set new values"
-SET GLOBAL long_query_time=4;
-SET SESSION long_query_time=1;
-"Check that logging is working"
-SELECT SLEEP(2);
-SLEEP(2)
-0
-SELECT user_host, query_time, db, sql_text FROM mysql.slow_log;
-user_host query_time db sql_text
-USER_HOST SLEEPVAL events_test SELECT SLEEP(2)
-SET SESSION long_query_time=300;
-"Make it quite long"
-TRUNCATE mysql.slow_log;
-CREATE TABLE slow_event_test (slo_val tinyint, val tinyint);
-SET SESSION long_query_time=1;
-"This won't go to the slow log"
-SELECT * FROM slow_event_test;
-slo_val val
-SET SESSION long_query_time=1;
-SET GLOBAL event_scheduler=on;
-SET GLOBAL long_query_time=20;
-CREATE EVENT long_event ON SCHEDULE EVERY 1 MINUTE DO INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(1.5);
-"Sleep some more time than the actual event run will take"
-SHOW VARIABLES LIKE 'event_scheduler';
-Variable_name Value
-event_scheduler ON
-"Check our table. Should see 1 row"
-SELECT * FROM slow_event_test;
-slo_val val
-20 0
-"Check slow log. Should not see anything because 1.5 is under the threshold of 20 for GLOBAL, though over SESSION which is 1"
-"This should show that the GLOBAL value is regarded and not the SESSION one of the current connection"
-SELECT user_host, query_time, db, sql_text FROM mysql.slow_log;
-user_host query_time db sql_text
-"Another test to show that GLOBAL is regarded and not SESSION."
-"This should go to the slow log"
-SET SESSION long_query_time=10;
-DROP EVENT long_event;
-SET GLOBAL long_query_time=1;
-CREATE EVENT long_event2 ON SCHEDULE EVERY 1 MINUTE DO INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(2);
-"Sleep some more time than the actual event run will take"
-"Check our table. Should see 2 rows"
-SELECT * FROM slow_event_test;
-slo_val val
-20 0
-1 0
-"Check slow log. Should see 1 row because 2 is over the threshold of 1 for GLOBAL, though under SESSION which is 10"
-SELECT user_host, query_time, db, sql_text FROM mysql.slow_log;
-user_host query_time db sql_text
-USER_HOST SLEEPVAL events_test INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(2)
-DROP EVENT long_event2;
-"Make it quite long"
-SET SESSION long_query_time=300;
-TRUNCATE mysql.slow_log;
-DROP TABLE slow_event_test;
-SET GLOBAL long_query_time =@old_global_long_query_time;
-SET SESSION long_query_time =@old_session_long_query_time;
-DROP DATABASE events_test;
-SET GLOBAL event_scheduler=off;
+
+Demonstrate that session value has no effect
+
+set @@session.long_query_time=1;
+set @@global.long_query_time=300;
+truncate mysql.slow_log;
+create event ev_log_general on schedule at now() on completion not preserve
+do select 'events_logs_test' as inside_event, sleep(1.5);
+
+Nothing should be logged
+
+select user_host, db, sql_text from mysql.slow_log
+where sql_text like 'select \'events_logs_test\'%';
+user_host db sql_text
+set @@global.long_query_time=1;
+truncate mysql.slow_log;
+create event ev_log_general on schedule at now() on completion not preserve
+do select 'events_logs_test' as inside_event, sleep(1.5);
+
+Event sub-statement should be logged.
+
+select user_host, db, sql_text from mysql.slow_log
+where sql_text like 'select \'events_logs_test\'%';
+user_host db sql_text
+USER_HOST events_test select 'events_logs_test' as inside_event, sleep(1.5)
+drop database events_test;
+set global event_scheduler=off;
+set @@global.long_query_time=default;
+set @@session.long_query_time=default;
diff --git a/mysql-test/r/events_restart_phase3.result b/mysql-test/r/events_restart_phase3.result
index 8ac00fdc70d..abed0a2babc 100644
--- a/mysql-test/r/events_restart_phase3.result
+++ b/mysql-test/r/events_restart_phase3.result
@@ -2,11 +2,5 @@ use events_test;
select @@event_scheduler;
@@event_scheduler
ON
-"Should get 3 rows : abc1, abc2, abc3
-select distinct name from execution_log order by name;
-name
-abc1
-abc2
-abc3
drop table execution_log;
drop database events_test;
diff --git a/mysql-test/r/events_trans.result b/mysql-test/r/events_trans.result
index a9829db0c61..984e22a2c1a 100644
--- a/mysql-test/r/events_trans.result
+++ b/mysql-test/r/events_trans.result
@@ -63,7 +63,7 @@ begin work;
insert into t1 (a) values ("OK: create event if not exists");
create event if not exists e1 on schedule every 2 day do select 2;
Warnings:
-Note 1526 Event 'e1' already exists
+Note 1536 Event 'e1' already exists
rollback work;
select * from t1;
a
diff --git a/mysql-test/r/federated.result b/mysql-test/r/federated.result
index 6e0c139ee14..8f1fe20ea3b 100644
--- a/mysql-test/r/federated.result
+++ b/mysql-test/r/federated.result
@@ -40,17 +40,18 @@ CREATE TABLE federated.t1 (
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t3';
-ERROR HY000: Can't create federated table. Foreign data src error: error: 1146 'Table 'federated.t3' doesn't exist'
+SELECT * FROM federated.t1;
+ERROR HY000: The foreign data source you are trying to reference does not exist. Data source error: error: 1146 'Table 'federated.t3' doesn't exist'
+DROP TABLE federated.t1;
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
`name` varchar(32) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='mysql://user:pass@127.0.0.1:SLAVE_PORT/federated/t1';
-ERROR HY000: Unable to connect to foreign data source: database: 'federated' username: 'user' hostname: '127.0.0.1'
-DROP TABLE IF EXISTS federated.t1;
-Warnings:
-Note 1051 Unknown table 't1'
+SELECT * FROM federated.t1;
+ERROR HY000: Unable to connect to foreign data source: Access denied for user 'user'@'localhost' (using password: YES)
+DROP TABLE federated.t1;
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
`name` varchar(32) NOT NULL default ''
@@ -1843,6 +1844,118 @@ C3A4C3B6C3BCC39F
D18DD184D184D0B5D0BAD182D0B8D0B2D0BDD183D18E
drop table federated.t1;
drop table federated.t1;
+CREATE TABLE federated.t1 (
+categoryId int(11) NOT NULL AUTO_INCREMENT,
+domainId varchar(745) NOT NULL DEFAULT '',
+categoryName varchar(255) NOT NULL DEFAULT '',
+PRIMARY KEY (categoryId),
+UNIQUE KEY idx_unique_category_categoryName (domainId, categoryName),
+KEY idx_category_domainId (domainId)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+CREATE TABLE federated.t1 (
+categoryId int(11) NOT NULL AUTO_INCREMENT,
+domainId varchar(745) NOT NULL DEFAULT '',
+categoryName varchar(255) NOT NULL DEFAULT '',
+PRIMARY KEY (categoryId),
+UNIQUE KEY idx_unique_category_categoryName (domainId, categoryName),
+KEY idx_category_domainId (domainId)
+) ENGINE=FEDERATED DEFAULT CHARSET=latin1
+CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
+insert into federated.t1 (domainId, categoryName) values ( '1231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231 300', '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345 250');
+insert into federated.t1 (domainId, categoryName) values ( '12312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312 301', '12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456 250');
+insert into federated.t1 (domainId, categoryName) values ('a', 'b');
+select categoryId from federated.t1 order by domainId, categoryName;
+categoryId
+1
+2
+3
+select categoryId from federated.t1 where domainId='a' and categoryName='b' order by categoryId;
+categoryId
+3
+select categoryId from federated.t1 where domainId='a' and categoryName='b' order by categoryId;
+categoryId
+3
+select categoryId from federated.t1 where domainId<>'a' and categoryName<>'b' order by categoryId;
+categoryId
+1
+2
+drop table federated.t1;
+drop table federated.t1;
+create table federated.t1 (a int primary key, b varchar(64))
+DEFAULT CHARSET=utf8;
+create table federated.t1 (a int primary key, b varchar(64))
+ENGINE=FEDERATED
+connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1'
+ DEFAULT CHARSET=utf8;
+insert ignore into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe");
+select * from federated.t1;
+a b
+1 Larry
+2 Curly
+truncate federated.t1;
+replace into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe");
+select * from federated.t1;
+a b
+1 Moe
+2 Curly
+update ignore federated.t1 set a=a+1;
+select * from federated.t1;
+a b
+1 Moe
+3 Curly
+drop table federated.t1;
+drop table federated.t1;
+create table federated.t1 (a int primary key, b varchar(64))
+DEFAULT CHARSET=utf8;
+create table federated.t1 (a int primary key, b varchar(64))
+ENGINE=FEDERATED
+connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1'
+ DEFAULT CHARSET=utf8;
+insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe")
+on duplicate key update a=a+100;
+ERROR 23000: Can't write; duplicate key in table 't1'
+select * from federated.t1;
+a b
+1 Larry
+2 Curly
+drop table federated.t1;
+drop table federated.t1;
+
+Bug#18287 create federated table always times out, error 1159 ' '
+
+Test that self-references work
+
+create table federated.t1 (a int primary key);
+create table federated.t2 (a int primary key)
+ENGINE=FEDERATED
+connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
+insert into federated.t1 (a) values (1);
+select * from federated.t2;
+a
+1
+drop table federated.t1, federated.t2;
+CREATE TABLE federated.t1 (a INT PRIMARY KEY) DEFAULT CHARSET=utf8;
+CREATE TABLE federated.t1 (a INT PRIMARY KEY)
+ENGINE=FEDERATED
+CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1'
+ DEFAULT CHARSET=utf8;
+SELECT transactions FROM information_schema.engines WHERE engine="FEDERATED";
+transactions
+NO
+INSERT INTO federated.t1 VALUES (1);
+SET autocommit=0;
+INSERT INTO federated.t1 VALUES (2);
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+SET autocommit=1;
+SELECT * FROM federated.t1;
+a
+1
+2
+DROP TABLE federated.t1;
+DROP TABLE federated.t1;
+End of 5.1 tests
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
DROP TABLE IF EXISTS federated.t1;
diff --git a/mysql-test/r/federated_bug_25714.result b/mysql-test/r/federated_bug_25714.result
new file mode 100644
index 00000000000..12554f7af3a
--- /dev/null
+++ b/mysql-test/r/federated_bug_25714.result
@@ -0,0 +1,56 @@
+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;
+DROP DATABASE IF EXISTS federated;
+CREATE DATABASE federated;
+DROP DATABASE IF EXISTS federated;
+CREATE DATABASE federated;
+DROP TABLE IF EXISTS federated.bug_13118_table;
+CREATE TABLE federated.t1 (
+`id` int auto_increment primary key,
+`value` int
+) ENGINE=MyISAM;
+INSERT INTO federated.t1 SET value=1;
+INSERT INTO federated.t1 SET value=2;
+INSERT INTO federated.t1 SET value=2;
+DROP TABLE IF EXISTS federated.t1;
+CREATE TABLE federated.t1 (
+`id` int auto_increment primary key,
+`value` int
+) ENGINE=FEDERATED
+CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
+SELECT * from federated.t1;
+id value
+1 1
+2 2
+3 2
+INSERT INTO federated.t1 SET value=4;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+4
+
+5 inserted
+6 inserted
+
+7 inserted
+8 inserted
+SELECT * from federated.t1;
+id value
+1 1
+2 2
+3 2
+4 4
+5 54
+6 55
+7 54
+8 55
+DROP TABLE federated.t1;
+DROP TABLE federated.t1;
+DROP TABLE IF EXISTS federated.t1;
+DROP DATABASE IF EXISTS federated;
+DROP TABLE IF EXISTS federated.t1;
+DROP DATABASE IF EXISTS federated;
diff --git a/mysql-test/r/federated_innodb.result b/mysql-test/r/federated_innodb.result
new file mode 100644
index 00000000000..70ba3acb279
--- /dev/null
+++ b/mysql-test/r/federated_innodb.result
@@ -0,0 +1,34 @@
+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;
+DROP DATABASE IF EXISTS federated;
+CREATE DATABASE federated;
+DROP DATABASE IF EXISTS federated;
+CREATE DATABASE federated;
+create table federated.t1 (a int primary key, b varchar(64))
+engine=myisam;
+create table federated.t1 (a int primary key, b varchar(64))
+engine=federated
+connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
+insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe");
+ERROR 23000: Can't write; duplicate key in table 't1'
+select * from federated.t1;
+a b
+1 Larry
+2 Curly
+truncate federated.t1;
+alter table federated.t1 engine=innodb;
+insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe");
+ERROR 23000: Can't write; duplicate key in table 't1'
+select * from federated.t1;
+a b
+drop table federated.t1;
+drop table federated.t1;
+DROP TABLE IF EXISTS federated.t1;
+DROP DATABASE IF EXISTS federated;
+DROP TABLE IF EXISTS federated.t1;
+DROP DATABASE IF EXISTS federated;
diff --git a/mysql-test/r/flush.result b/mysql-test/r/flush.result
index 7eb7fd16edb..dcbffd6f7c8 100644
--- a/mysql-test/r/flush.result
+++ b/mysql-test/r/flush.result
@@ -55,3 +55,19 @@ flush tables with read lock;
insert into t2 values(1);
unlock tables;
drop table t1, t2;
+End of 5.0 tests
+set @old_general_log= @@general_log;
+set @old_read_only= @@read_only;
+set global general_log= on;
+flush tables with read lock;
+flush logs;
+unlock tables;
+set global read_only=1;
+flush logs;
+unlock tables;
+flush tables with read lock;
+flush logs;
+unlock tables;
+set global general_log= @old_general_log;
+set global read_only= @old_read_only;
+End of 5.1 tests
diff --git a/mysql-test/r/flush2.result b/mysql-test/r/flush2.result
index 13bcc371ef6..5056955c7b7 100644
--- a/mysql-test/r/flush2.result
+++ b/mysql-test/r/flush2.result
@@ -4,9 +4,11 @@ show variables like 'log_bin%';
Variable_name Value
log_bin OFF
log_bin_trust_function_creators ON
+log_bin_trust_routine_creators ON
flush logs;
show variables like 'log_bin%';
Variable_name Value
log_bin OFF
log_bin_trust_function_creators ON
+log_bin_trust_routine_creators ON
set global expire_logs_days = 0;
diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result
index d8e3d53f7b1..96ebb9bf254 100644
--- a/mysql-test/r/fulltext.result
+++ b/mysql-test/r/fulltext.result
@@ -476,3 +476,15 @@ ALTER TABLE t1 DISABLE KEYS;
SELECT * FROM t1 WHERE MATCH(a) AGAINST('test');
ERROR HY000: Can't find FULLTEXT index matching the column list
DROP TABLE t1;
+CREATE TABLE t1(a VARCHAR(20), FULLTEXT(a));
+INSERT INTO t1 VALUES('Offside'),('City Of God');
+SELECT a FROM t1 WHERE MATCH a AGAINST ('+city of*' IN BOOLEAN MODE);
+a
+City Of God
+SELECT a FROM t1 WHERE MATCH a AGAINST ('+city (of*)' IN BOOLEAN MODE);
+a
+City Of God
+SELECT a FROM t1 WHERE MATCH a AGAINST ('+city* of*' IN BOOLEAN MODE);
+a
+City Of God
+DROP TABLE t1;
diff --git a/mysql-test/r/fulltext3.result b/mysql-test/r/fulltext3.result
new file mode 100644
index 00000000000..4ec48369ad1
--- /dev/null
+++ b/mysql-test/r/fulltext3.result
@@ -0,0 +1,17 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(a VARCHAR(255) CHARACTER SET gbk, FULLTEXT(a));
+SET NAMES utf8;
+INSERT INTO t1 VALUES(0xF043616161),(0xBEF361616197C22061616161);
+SELECT HEX(a) FROM t1 WHERE MATCH(a) AGAINST(0x97C22061616161 IN BOOLEAN MODE);
+HEX(a)
+BEF361616197C22061616161
+DELETE FROM t1 LIMIT 1;
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+SET NAMES latin1;
+DROP TABLE t1;
+CREATE TABLE t1(a VARCHAR(2) CHARACTER SET big5 COLLATE big5_chinese_ci,
+FULLTEXT(a));
+INSERT INTO t1 VALUES(0xA3C2);
+DROP TABLE t1;
diff --git a/mysql-test/r/func_date_add.result b/mysql-test/r/func_date_add.result
index ac5709260fd..a7f2383848d 100644
--- a/mysql-test/r/func_date_add.result
+++ b/mysql-test/r/func_date_add.result
@@ -84,4 +84,15 @@ CAST('2006-09-26' AS DATE) + INTERVAL 1 YEAR
SELECT CAST('2006-09-26' AS DATE) + INTERVAL 1 WEEK;
CAST('2006-09-26' AS DATE) + INTERVAL 1 WEEK
2006-10-03
+create table t1 (a int, b varchar(10));
+insert into t1 values (1, '2001-01-01'),(2, '2002-02-02');
+select '2007-01-01' + interval a day from t1;
+'2007-01-01' + interval a day
+2007-01-02
+2007-01-03
+select b + interval a day from t1;
+b + interval a day
+2001-01-02
+2002-02-04
+drop table t1;
End of 5.0 tests
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
index 4c7baac051a..b17c5e5409c 100644
--- a/mysql-test/r/func_gconcat.result
+++ b/mysql-test/r/func_gconcat.result
@@ -743,4 +743,86 @@ SELECT GROUP_CONCAT(DISTINCT UCASE(b)) FROM t1;
GROUP_CONCAT(DISTINCT UCASE(b))
ONE.1,TWO.2,ONE.3
DROP TABLE t1;
+CREATE TABLE t1( a VARCHAR( 10 ), b INT );
+INSERT INTO t1 VALUES ( repeat( 'a', 10 ), 1),
+( repeat( 'b', 10 ), 2);
+SET group_concat_max_len = 20;
+SELECT GROUP_CONCAT( a ) FROM t1;
+GROUP_CONCAT( a )
+aaaaaaaaaa,bbbbbbbbb
+Warnings:
+Warning 1260 1 line(s) were 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()
+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()
+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()
+SET group_concat_max_len = DEFAULT;
+DROP TABLE t1;
+SET group_concat_max_len= 65535;
+CREATE TABLE t1( a TEXT, b INTEGER );
+INSERT INTO t1 VALUES ( 'a', 0 ), ( 'b', 1 );
+SELECT GROUP_CONCAT( a ORDER BY b ) FROM t1;
+GROUP_CONCAT( a ORDER BY b )
+a,b
+SELECT GROUP_CONCAT(DISTINCT a ORDER BY b) FROM t1;
+GROUP_CONCAT(DISTINCT a ORDER BY b)
+a,b
+SELECT GROUP_CONCAT(DISTINCT a) FROM t1;
+GROUP_CONCAT(DISTINCT a)
+a,b
+SET group_concat_max_len= 10;
+SELECT GROUP_CONCAT(a ORDER BY b) FROM t1;
+GROUP_CONCAT(a ORDER BY b)
+a,b
+SELECT GROUP_CONCAT(DISTINCT a ORDER BY b) FROM t1;
+GROUP_CONCAT(DISTINCT a ORDER BY b)
+a,b
+SELECT GROUP_CONCAT(DISTINCT a) FROM t1;
+GROUP_CONCAT(DISTINCT a)
+a,b
+SET group_concat_max_len= 65535;
+CREATE TABLE t2( a TEXT );
+INSERT INTO t2 VALUES( REPEAT( 'a', 5000 ) );
+INSERT INTO t2 VALUES( REPEAT( 'b', 5000 ) );
+INSERT INTO t2 VALUES( REPEAT( 'a', 5000 ) );
+SELECT LENGTH( GROUP_CONCAT( DISTINCT a ) ) FROM t2;
+LENGTH( GROUP_CONCAT( DISTINCT a ) )
+10001
+CREATE TABLE t3( a TEXT, b INT );
+INSERT INTO t3 VALUES( REPEAT( 'a', 65534 ), 1 );
+INSERT INTO t3 VALUES( REPEAT( 'a', 65535 ), 2 );
+INSERT INTO t3 VALUES( REPEAT( 'a', 65536 ), 3 );
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+SELECT LENGTH( GROUP_CONCAT( a ) ) FROM t3 WHERE b = 1;
+LENGTH( GROUP_CONCAT( a ) )
+65534
+SELECT LENGTH( GROUP_CONCAT( a ) ) FROM t3 WHERE b = 2;
+LENGTH( GROUP_CONCAT( a ) )
+65535
+SELECT LENGTH( GROUP_CONCAT( a ) ) FROM t3 WHERE b = 3;
+LENGTH( GROUP_CONCAT( a ) )
+65535
+SET group_concat_max_len= DEFAULT;
+DROP TABLE t1, t2, t3;
+set names latin1;
+create table t1 (id int, name varchar(20)) DEFAULT CHARSET=utf8;
+insert into t1 (id, name) values (1, "óra");
+insert into t1 (id, name) values (2, "óra");
+select b.id, group_concat(b.name) from t1 a, t1 b group by b.id;
+id group_concat(b.name)
+1 óra,óra
+2 óra,óra
+drop table t1;
End of 5.0 tests
diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result
index 0e6cae2f103..fce01ffd171 100644
--- a/mysql-test/r/func_group.result
+++ b/mysql-test/r/func_group.result
@@ -613,8 +613,8 @@ id select_type table type possible_keys key key_len ref rows Extra
explain
select max(t1.a3), min(t2.a2) from t1, t2 where t1.a2 = 2 and t1.a3 < 'MIN' and t2.a3 > 'CA';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range k1 k1 7 NULL 1 Using where; Using index; Using join cache
-1 SIMPLE t2 range k1 k1 3 NULL 4 Using where; Using index
+1 SIMPLE t1 range k1 k1 7 NULL 1 Using where; Using index
+1 SIMPLE t2 range k1 k1 3 NULL 4 Using where; Using index; Using join buffer
explain
select min(a4 - 0.01) from t1;
id select_type table type possible_keys key key_len ref rows Extra
@@ -650,8 +650,8 @@ id select_type table type possible_keys key key_len ref rows Extra
explain
select concat(min(t1.a1),min(t2.a4)) from t1, t2 where t2.a4 <> 'AME';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 range k2 k2 4 NULL 6 Using where; Using index; Using join cache
-1 SIMPLE t1 index NULL PRIMARY 3 NULL 15 Using index
+1 SIMPLE t2 range k2 k2 4 NULL 6 Using where; Using index
+1 SIMPLE t1 index NULL PRIMARY 3 NULL 15 Using index; Using join buffer
drop table t1, t2;
create table t1 (a char(10));
insert into t1 values ('a'),('b'),('c');
@@ -1321,4 +1321,51 @@ SELECT a,AVG(DISTINCT b) AS average FROM t1 GROUP BY a HAVING average > 50;
a average
1 32768.5000
DROP TABLE t1;
+CREATE TABLE t1 ( a INT, b INT, KEY(a) );
+INSERT INTO t1 VALUES (NULL, 1), (NULL, 2);
+EXPLAIN SELECT MIN(a), MIN(b) FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2
+SELECT MIN(a), MIN(b) FROM t1;
+MIN(a) MIN(b)
+NULL 1
+CREATE TABLE t2( a INT, b INT, c INT, KEY(a, b) );
+INSERT INTO t2 ( a, b, c ) VALUES ( 1, NULL, 2 ), ( 1, 3, 4 ), ( 1, 4, 4 );
+EXPLAIN SELECT MIN(b), MIN(c) FROM t2 WHERE a = 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref a a 5 const 2 Using where
+SELECT MIN(b), MIN(c) FROM t2 WHERE a = 1;
+MIN(b) MIN(c)
+3 2
+CREATE TABLE t3 (a INT, b INT, c int, KEY(a, b));
+INSERT INTO t3 VALUES (1, NULL, 1), (2, NULL, 2), (2, NULL, 2), (3, NULL, 3);
+EXPLAIN SELECT MIN(a), MIN(b) FROM t3 where a = 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+SELECT MIN(a), MIN(b) FROM t3 where a = 2;
+MIN(a) MIN(b)
+2 NULL
+CREATE TABLE t4 (a INT, b INT, c int, KEY(a, b));
+INSERT INTO t4 VALUES (1, 1, 1), (2, NULL, 2), (2, NULL, 2), (3, 1, 3);
+EXPLAIN SELECT MIN(a), MIN(b) FROM t4 where a = 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+SELECT MIN(a), MIN(b) FROM t4 where a = 2;
+MIN(a) MIN(b)
+2 NULL
+SELECT MIN(b), min(c) FROM t4 where a = 2;
+MIN(b) min(c)
+NULL 2
+CREATE TABLE t5( a INT, b INT, KEY( a, b) );
+INSERT INTO t5 VALUES( 1, 1 ), ( 1, 2 );
+EXPLAIN SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1;
+MIN(a) MIN(b)
+1 1
+SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1 and b > 1;
+MIN(a) MIN(b)
+1 2
+DROP TABLE t1, t2, t3, t4, t5;
End of 5.0 tests
diff --git a/mysql-test/r/func_group_innodb.result b/mysql-test/r/func_group_innodb.result
index dba546a72de..908e85c1652 100644
--- a/mysql-test/r/func_group_innodb.result
+++ b/mysql-test/r/func_group_innodb.result
@@ -78,8 +78,8 @@ min(7)
7
explain select min(7) from t2i join t1i;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2i ALL NULL NULL NULL NULL 1 Using join cache
-1 SIMPLE t1i ALL NULL NULL NULL NULL 1
+1 SIMPLE t2i ALL NULL NULL NULL NULL 1
+1 SIMPLE t1i ALL NULL NULL NULL NULL 1 Using join buffer
select min(7) from t2i join t1i;
min(7)
NULL
@@ -94,8 +94,8 @@ max(7)
7
explain select max(7) from t2i join t1i;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2i ALL NULL NULL NULL NULL 1 Using join cache
-1 SIMPLE t1i ALL NULL NULL NULL NULL 1
+1 SIMPLE t2i ALL NULL NULL NULL NULL 1
+1 SIMPLE t1i ALL NULL NULL NULL NULL 1 Using join buffer
select max(7) from t2i join t1i;
max(7)
NULL
diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result
index 992d1cd418b..4f64d39ccc0 100644
--- a/mysql-test/r/func_in.result
+++ b/mysql-test/r/func_in.result
@@ -225,8 +225,8 @@ a
46
CREATE VIEW v1 AS SELECT * FROM t1 WHERE a NOT IN (45);
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` <> 45)
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` <> 45) latin1 latin1_swedish_ci
SELECT * FROM v1;
a
44
@@ -432,37 +432,40 @@ insert into t2 values(13491727406643098568),
(0x8000000400000001),
(0x8000004000000001),
(0x8000040000000001);
-SELECT HEX(a) FROM t2 WHERE a IN (0xBB3C3E98175D33C8, 42);
+SELECT HEX(a) FROM t2 WHERE a IN
+(CAST(0xBB3C3E98175D33C8 AS UNSIGNED),
+42);
HEX(a)
BB3C3E98175D33C8
SELECT HEX(a) FROM t2 WHERE a IN
-(0xBB3C3E98175D33C8,
-0x7fffffffffffffff,
-0x8000000000000000,
-0x8000000000000400,
-0x8000000000000401,
+(CAST(0xBB3C3E98175D33C8 AS UNSIGNED),
+CAST(0x7fffffffffffffff AS UNSIGNED),
+CAST(0x8000000000000000 AS UNSIGNED),
+CAST(0x8000000000000400 AS UNSIGNED),
+CAST(0x8000000000000401 AS UNSIGNED),
42);
HEX(a)
BB3C3E98175D33C8
-7FFFFFFFFFFFFEFF
-7FFFFFFFFFFFFFEF
-7FFFFFFFFFFFFFFE
7FFFFFFFFFFFFFFF
8000000000000000
-8000000000000001
-8000000000000002
-8000000000000300
8000000000000400
8000000000000401
-SELECT HEX(a) FROM t2 WHERE a IN (0x7fffffffffffffff,0x8000000000000001);
+SELECT HEX(a) FROM t2 WHERE a IN
+(CAST(0x7fffffffffffffff AS UNSIGNED),
+CAST(0x8000000000000001 AS UNSIGNED));
HEX(a)
7FFFFFFFFFFFFFFF
8000000000000001
-SELECT HEX(a) FROM t2 WHERE a IN (0x7ffffffffffffffe,0x7fffffffffffffff);
+SELECT HEX(a) FROM t2 WHERE a IN
+(CAST(0x7ffffffffffffffe AS UNSIGNED),
+CAST(0x7fffffffffffffff AS UNSIGNED));
HEX(a)
7FFFFFFFFFFFFFFE
7FFFFFFFFFFFFFFF
-SELECT HEX(a) FROM t2 WHERE a IN (0x7ffffffffffffffe,0x7fffffffffffffff,'abc');
+SELECT HEX(a) FROM t2 WHERE a IN
+(0x7ffffffffffffffe,
+0x7fffffffffffffff,
+'abc');
HEX(a)
7FFFFFFFFFFFFFFE
7FFFFFFFFFFFFFFF
@@ -474,6 +477,7 @@ CREATE TABLE t4 (a DATE);
INSERT INTO t4 VALUES ('1972-02-06'), ('1972-07-29');
SELECT * FROM t4 WHERE a IN ('1972-02-06','19772-07-29');
a
+1972-02-06
Warnings:
Warning 1292 Incorrect date value: '19772-07-29' for column 'a' at row 1
DROP TABLE t1,t2,t3,t4;
diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result
index b4c6f0f6699..39bf1470afe 100644
--- a/mysql-test/r/func_misc.result
+++ b/mysql-test/r/func_misc.result
@@ -1,3 +1,4 @@
+DROP TABLE IF EXISTS t1;
select format(1.5555,0),format(123.5555,1),format(1234.5555,2),format(12345.55555,3),format(123456.5555,4),format(1234567.5555,5),format("12345.2399",2);
format(1.5555,0) format(123.5555,1) format(1234.5555,2) format(12345.55555,3) format(123456.5555,4) format(1234567.5555,5) format("12345.2399",2)
2 123.6 1,234.56 12,345.556 123,456.5555 1,234,567.55550 12,345.24
@@ -22,6 +23,11 @@ hex(inet_aton('127.1.1'))
select length(uuid()), charset(uuid()), length(unhex(replace(uuid(),_utf8'-',_utf8'')));
length(uuid()) charset(uuid()) length(unhex(replace(uuid(),_utf8'-',_utf8'')))
36 utf8 16
+set @a= uuid_short();
+set @b= uuid_short();
+select cast(@a - @b as signed);
+cast(@a - @b as signed)
+-1
select length(format('nan', 2)) > 0;
length(format('nan', 2)) > 0
1
@@ -51,7 +57,6 @@ select a from t1 where mid(a+0,6,3) = ( mid(20040106123400,6,3) );
a
2004-01-06 12:34:00
drop table t1;
-DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (conn CHAR(7), connection_id INT);
INSERT INTO t1 VALUES ('default', CONNECTION_ID());
SELECT GET_LOCK('bug16501',600);
@@ -186,3 +191,7 @@ drop table table_26093;
drop function func_26093_a;
drop function func_26093_b;
End of 5.0 tests
+select connection_id() > 0;
+connection_id() > 0
+1
+End of tests
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 9253f28d038..6fbb9c811a7 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -2394,4 +2394,96 @@ C
2707236321
DROP TABLE t1, t2;
DROP VIEW v1;
+SELECT LOCATE('foo', NULL) FROM DUAL;
+LOCATE('foo', NULL)
+NULL
+SELECT LOCATE(NULL, 'o') FROM DUAL;
+LOCATE(NULL, 'o')
+NULL
+SELECT LOCATE(NULL, NULL) FROM DUAL;
+LOCATE(NULL, NULL)
+NULL
+SELECT LOCATE('foo', NULL) IS NULL FROM DUAL;
+LOCATE('foo', NULL) IS NULL
+1
+SELECT LOCATE(NULL, 'o') IS NULL FROM DUAL;
+LOCATE(NULL, 'o') IS NULL
+1
+SELECT LOCATE(NULL, NULL) IS NULL FROM DUAL;
+LOCATE(NULL, NULL) IS NULL
+1
+SELECT ISNULL(LOCATE('foo', NULL)) FROM DUAL;
+ISNULL(LOCATE('foo', NULL))
+1
+SELECT ISNULL(LOCATE(NULL, 'o')) FROM DUAL;
+ISNULL(LOCATE(NULL, 'o'))
+1
+SELECT ISNULL(LOCATE(NULL, NULL)) FROM DUAL;
+ISNULL(LOCATE(NULL, NULL))
+1
+SELECT LOCATE('foo', NULL) <=> NULL FROM DUAL;
+LOCATE('foo', NULL) <=> NULL
+1
+SELECT LOCATE(NULL, 'o') <=> NULL FROM DUAL;
+LOCATE(NULL, 'o') <=> NULL
+1
+SELECT LOCATE(NULL, NULL) <=> NULL FROM DUAL;
+LOCATE(NULL, NULL) <=> NULL
+1
+CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, a varchar(10), p varchar(10));
+INSERT INTO t1 VALUES (1, 'foo', 'o');
+INSERT INTO t1 VALUES (2, 'foo', NULL);
+INSERT INTO t1 VALUES (3, NULL, 'o');
+INSERT INTO t1 VALUES (4, NULL, NULL);
+SELECT id, LOCATE(a,p) FROM t1;
+id LOCATE(a,p)
+1 0
+2 NULL
+3 NULL
+4 NULL
+SELECT id, LOCATE(a,p) IS NULL FROM t1;
+id LOCATE(a,p) IS NULL
+1 0
+2 1
+3 1
+4 1
+SELECT id, ISNULL(LOCATE(a,p)) FROM t1;
+id ISNULL(LOCATE(a,p))
+1 0
+2 1
+3 1
+4 1
+SELECT id, LOCATE(a,p) <=> NULL FROM t1;
+id LOCATE(a,p) <=> NULL
+1 0
+2 1
+3 1
+4 1
+SELECT id FROM t1 WHERE LOCATE(a,p) IS NULL;
+id
+2
+3
+4
+SELECT id FROM t1 WHERE LOCATE(a,p) <=> NULL;
+id
+2
+3
+4
+DROP TABLE t1;
+SELECT SUBSTR('foo',1,0) FROM DUAL;
+SUBSTR('foo',1,0)
+
+SELECT SUBSTR('foo',1,CAST(0 AS SIGNED)) FROM DUAL;
+SUBSTR('foo',1,CAST(0 AS SIGNED))
+
+SELECT SUBSTR('foo',1,CAST(0 AS UNSIGNED)) FROM DUAL;
+SUBSTR('foo',1,CAST(0 AS UNSIGNED))
+
+CREATE TABLE t1 (a varchar(10), len int unsigned);
+INSERT INTO t1 VALUES ('bar', 2), ('foo', 0);
+SELECT SUBSTR(a,1,len) FROM t1;
+SUBSTR(a,1,len)
+ba
+
+DROP TABLE t1;
End of 5.0 tests
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index 2d59a32218c..3105bc3b578 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -840,11 +840,11 @@ 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
Warnings:
Note 1003 select period_add(_latin1'9602',-(12)) AS `period_add("9602",-12)`,period_diff(199505,_latin1'9404') AS `period_diff(199505,"9404")`,from_days(to_days(_latin1'960101')) AS `from_days(to_days("960101"))`,dayofmonth(_latin1'1997-01-02') AS `dayofmonth("1997-01-02")`,month(_latin1'1997-01-02') AS `month("1997-01-02")`,monthname(_latin1'1972-03-04') AS `monthname("1972-03-04")`,dayofyear(_latin1'0000-00-00') AS `dayofyear("0000-00-00")`,hour(_latin1'1997-03-03 23:03:22') AS `HOUR("1997-03-03 23:03:22")`,minute(_latin1'23:03:22') AS `MINUTE("23:03:22")`,second(230322) AS `SECOND(230322)`,quarter(980303) AS `QUARTER(980303)`,week(_latin1'1998-03-03',0) AS `WEEK("1998-03-03")`,yearweek(_latin1'2000-01-01',1) AS `yearweek("2000-01-01",1)`,week(19950101,1) AS `week(19950101,1)`,year(_latin1'98-02-03') AS `year("98-02-03")`,(weekday(curdate()) - weekday(now())) AS `weekday(curdate())-weekday(now())`,dayname(_latin1'1962-03-03') AS `dayname("1962-03-03")`,unix_timestamp() AS `unix_timestamp()`,sec_to_time((time_to_sec(_latin1'0:30:47') / 6.21)) AS `sec_to_time(time_to_sec("0:30:47")/6.21)`,curtime() AS `curtime()`,utc_time() AS `utc_time()`,curdate() AS `curdate()`,utc_date() AS `utc_date()`,utc_timestamp() AS `utc_timestamp()`,date_format(_latin1'1997-01-02 03:04:05',_latin1'%M %W %D %Y %y %m %d %h %i %s %w') AS `date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w")`,from_unixtime(unix_timestamp(_latin1'1994-03-02 10:11:12')) AS `from_unixtime(unix_timestamp("1994-03-02 10:11:12"))`,(_latin1'1997-12-31 23:59:59' + interval 1 second) AS `"1997-12-31 23:59:59" + INTERVAL 1 SECOND`,(_latin1'1998-01-01 00:00:00' - interval 1 second) AS `"1998-01-01 00:00:00" - INTERVAL 1 SECOND`,(_latin1'1997-12-31' + interval 1 day) AS `INTERVAL 1 DAY + "1997-12-31"`,extract(year from _latin1'1999-01-02 10:11:12') AS `extract(YEAR FROM "1999-01-02 10:11:12")`,(_latin1'1997-12-31 23:59:59' + interval 1 second) AS `date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND)`
-SET @TMP=NOW();
+SET @TMP='2007-08-01 12:22:49';
CREATE TABLE t1 (d DATETIME);
-INSERT INTO t1 VALUES (NOW());
-INSERT INTO t1 VALUES (NOW());
-INSERT INTO t1 VALUES (NOW());
+INSERT INTO t1 VALUES ('2007-08-01 12:22:59');
+INSERT INTO t1 VALUES ('2007-08-01 12:23:01');
+INSERT INTO t1 VALUES ('2007-08-01 12:23:20');
SELECT count(*) FROM t1 WHERE d>FROM_DAYS(TO_DAYS(@TMP)) AND d<=FROM_DAYS(TO_DAYS(@TMP)+1);
count(*)
3
@@ -1222,6 +1222,21 @@ SELECT TIME_FORMAT(SEC_TO_TIME(a),"%H:%i:%s") FROM (SELECT 3020399 AS a UNION SE
TIME_FORMAT(SEC_TO_TIME(a),"%H:%i:%s")
838:59:58
838:59:59
+set names latin1;
+create table t1 (a varchar(15) character set ascii not null);
+insert into t1 values ('070514-000000');
+select concat(a,ifnull(min(date_format(now(), '%Y-%m-%d')),' ull')) from t1;
+concat(a,ifnull(min(date_format(now(), '%Y-%m-%d')),' ull'))
+#
+set names swe7;
+select concat(a,ifnull(min(date_format(now(), '%Y-%m-%d')),' ull')) from t1;
+ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (swe7_swedish_ci,COERCIBLE) for operation 'concat'
+set names latin1;
+set lc_time_names=fr_FR;
+select concat(a,ifnull(min(date_format(now(), '%Y-%m-%d')),' ull')) from t1;
+ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation 'concat'
+set lc_time_names=en_US;
+drop table t1;
End of 5.0 tests
select date_sub("0050-01-01 00:00:01",INTERVAL 2 SECOND);
date_sub("0050-01-01 00:00:01",INTERVAL 2 SECOND)
diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result
index a3955e8c008..6e3aebe8d47 100644
--- a/mysql-test/r/gis-rtree.result
+++ b/mysql-test/r/gis-rtree.result
@@ -1444,3 +1444,16 @@ OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
DROP TABLE t1;
+CREATE TABLE t1 (a INT, b GEOMETRY NOT NULL, SPATIAL KEY b(b));
+INSERT INTO t1 VALUES (1, GEOMFROMTEXT('LINESTRING(1102218.456 1,2000000 2)'));
+INSERT INTO t1 VALUES (2, GEOMFROMTEXT('LINESTRING(1102218.456 1,2000000 2)'));
+SELECT COUNT(*) FROM t1 WHERE
+MBRINTERSECTS(b, GEOMFROMTEXT('LINESTRING(1 1,1102219 2)') );
+COUNT(*)
+2
+SELECT COUNT(*) FROM t1 IGNORE INDEX (b) WHERE
+MBRINTERSECTS(b, GEOMFROMTEXT('LINESTRING(1 1,1102219 2)') );
+COUNT(*)
+2
+DROP TABLE t1;
+End of 5.0 tests.
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index 62486936e02..7b4b02f3ff3 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -9,35 +9,35 @@ CREATE TABLE gis_geometrycollection (fid INTEGER NOT NULL PRIMARY KEY, g GEOMET
CREATE TABLE gis_geometry (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRY);
SHOW FIELDS FROM gis_point;
Field Type Null Key Default Extra
-fid int(11) NO PRI
+fid int(11) NO PRI NULL
g point YES NULL
SHOW FIELDS FROM gis_line;
Field Type Null Key Default Extra
-fid int(11) NO PRI
+fid int(11) NO PRI NULL
g linestring YES NULL
SHOW FIELDS FROM gis_polygon;
Field Type Null Key Default Extra
-fid int(11) NO PRI
+fid int(11) NO PRI NULL
g polygon YES NULL
SHOW FIELDS FROM gis_multi_point;
Field Type Null Key Default Extra
-fid int(11) NO PRI
+fid int(11) NO PRI NULL
g multipoint YES NULL
SHOW FIELDS FROM gis_multi_line;
Field Type Null Key Default Extra
-fid int(11) NO PRI
+fid int(11) NO PRI NULL
g multilinestring YES NULL
SHOW FIELDS FROM gis_multi_polygon;
Field Type Null Key Default Extra
-fid int(11) NO PRI
+fid int(11) NO PRI NULL
g multipolygon YES NULL
SHOW FIELDS FROM gis_geometrycollection;
Field Type Null Key Default Extra
-fid int(11) NO PRI
+fid int(11) NO PRI NULL
g geometrycollection YES NULL
SHOW FIELDS FROM gis_geometry;
Field Type Null Key Default Extra
-fid int(11) NO PRI
+fid int(11) NO PRI NULL
g geometry YES NULL
INSERT INTO gis_point VALUES
(101, PointFromText('POINT(10 10)')),
@@ -394,8 +394,8 @@ Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE g1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort; Using join cache
-1 SIMPLE g2 ALL NULL NULL NULL NULL 2 100.00
+1 SIMPLE g1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort
+1 SIMPLE g2 ALL NULL NULL NULL NULL 2 100.00 Using join buffer
Warnings:
Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,overlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,equals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,disjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,intersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid`
DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
@@ -430,7 +430,7 @@ mln multilinestring YES NULL
mpg multipolygon YES NULL
gc geometrycollection YES NULL
gm geometry YES NULL
-fid int(11) NO
+fid int(11) NO NULL
DROP TABLE t1;
SELECT AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)'))));
AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)'))))
@@ -745,10 +745,10 @@ drop table t1;
drop procedure if exists fn3;
create function fn3 () returns point deterministic return GeomFromText("point(1 1)");
show create function fn3;
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
fn3 CREATE DEFINER=`root`@`localhost` FUNCTION `fn3`() RETURNS point
DETERMINISTIC
-return GeomFromText("point(1 1)")
+return GeomFromText("point(1 1)") latin1 latin1_swedish_ci latin1_swedish_ci
select astext(fn3());
astext(fn3())
POINT(1 1)
@@ -865,6 +865,30 @@ SELECT Overlaps(@horiz1, @point2) FROM DUAL;
Overlaps(@horiz1, @point2)
0
DROP TABLE t1;
+create table t1(f1 geometry, f2 point, f3 linestring);
+select f1 from t1 union select f1 from t1;
+f1
+insert into t1 (f2,f3) values (GeomFromText('POINT(1 1)'),
+GeomFromText('LINESTRING(0 0,1 1,2 2)'));
+select AsText(f2),AsText(f3) from t1;
+AsText(f2) AsText(f3)
+POINT(1 1) LINESTRING(0 0,1 1,2 2)
+select AsText(a) from (select f2 as a from t1 union select f3 from t1) t;
+AsText(a)
+POINT(1 1)
+LINESTRING(0 0,1 1,2 2)
+create table t2 as select f2 as a from t1 union select f3 from t1;
+desc t2;
+Field Type Null Key Default Extra
+a point YES NULL
+select AsText(a) from t2;
+AsText(a)
+POINT(1 1)
+LINESTRING(0 0,1 1,2 2)
+drop table t1, t2;
+SELECT 1;
+1
+1
End of 5.0 tests
create table t1 (f1 tinyint(1), f2 char(1), f3 varchar(1), f4 geometry, f5 datetime);
create view v1 as select * from t1;
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
index 9493413ade9..0d4dad39882 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -907,11 +907,11 @@ ERROR 42000: SHOW VIEW command denied to user 'mysqltest_1'@'localhost' for tabl
SHOW CREATE TABLE mysqltest2.v_yn;
ERROR 42000: SHOW VIEW command denied to user 'mysqltest_1'@'localhost' for table 'v_yn'
SHOW CREATE TABLE mysqltest2.v_ny;
-View Create View
-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`
+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 VIEW mysqltest2.v_ny;
-View Create View
-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`
+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'
SHOW CREATE VIEW mysqltest3.t_nn;
@@ -928,17 +928,17 @@ t_nn CREATE TABLE `t_nn` (
SHOW CREATE VIEW mysqltest2.t_nn;
ERROR HY000: 'mysqltest2.t_nn' is not VIEW
SHOW CREATE VIEW mysqltest2.v_yy;
-View Create View
-v_yy CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest2`.`v_yy` AS select `mysqltest2`.`t_nn`.`c1` AS `c1` from `mysqltest2`.`t_nn` where (`mysqltest2`.`t_nn`.`c1` = 55)
+View Create View character_set_client collation_connection
+v_yy CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest2`.`v_yy` AS select `mysqltest2`.`t_nn`.`c1` AS `c1` from `mysqltest2`.`t_nn` where (`mysqltest2`.`t_nn`.`c1` = 55) latin1 latin1_swedish_ci
SHOW CREATE TABLE mysqltest2.v_yy;
-View Create View
-v_yy CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest2`.`v_yy` AS select `mysqltest2`.`t_nn`.`c1` AS `c1` from `mysqltest2`.`t_nn` where (`mysqltest2`.`t_nn`.`c1` = 55)
+View Create View character_set_client collation_connection
+v_yy CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest2`.`v_yy` AS select `mysqltest2`.`t_nn`.`c1` AS `c1` from `mysqltest2`.`t_nn` where (`mysqltest2`.`t_nn`.`c1` = 55) latin1 latin1_swedish_ci
SHOW CREATE TABLE mysqltest2.v_nn;
-View Create View
-v_nn CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_nn` AS select `t_nn`.`c1` AS `c1` from `t_nn`
+View Create View character_set_client collation_connection
+v_nn CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_nn` AS select `t_nn`.`c1` AS `c1` from `t_nn` latin1 latin1_swedish_ci
SHOW CREATE VIEW mysqltest2.v_nn;
-View Create View
-v_nn CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_nn` AS select `t_nn`.`c1` AS `c1` from `t_nn`
+View Create View character_set_client collation_connection
+v_nn CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_nn` AS select `t_nn`.`c1` AS `c1` from `t_nn` latin1 latin1_swedish_ci
SHOW CREATE TABLE mysqltest2.t_nn;
Table Create Table
t_nn CREATE TABLE `t_nn` (
@@ -1194,6 +1194,25 @@ ERROR 42000: SELECT command denied to user 'mysqltest_2'@'localhost' for table '
DROP DATABASE mysqltest1;
DROP DATABASE mysqltest2;
DROP USER mysqltest_1@localhost;
+use test;
+CREATE TABLE t1 (f1 int, f2 int);
+INSERT INTO t1 VALUES(1,1), (2,2);
+CREATE DATABASE db27878;
+GRANT UPDATE(f1) ON t1 TO 'mysqltest_1'@'localhost';
+GRANT SELECT ON `test`.* TO 'mysqltest_1'@'localhost';
+GRANT ALL ON db27878.* TO 'mysqltest_1'@'localhost';
+use db27878;
+CREATE SQL SECURITY INVOKER VIEW db27878.v1 AS SELECT * FROM test.t1;
+use db27878;
+UPDATE v1 SET f2 = 4;
+ERROR HY000: View 'db27878.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+SELECT * FROM test.t1;
+f1 f2
+1 1
+2 2
+DROP DATABASE db27878;
+use test;
+DROP TABLE t1;
End of 5.0 tests
set names utf8;
grant select on test.* to юзер_юзер@localhost;
diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result
index 03019bd5c1f..21bad4fddcb 100644
--- a/mysql-test/r/grant2.result
+++ b/mysql-test/r/grant2.result
@@ -381,3 +381,45 @@ drop table t2;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM `a@`@localhost;
drop user `a@`@localhost;
SET GLOBAL log_bin_trust_function_creators = 0;
+drop database if exists mysqltest_1;
+drop database if exists mysqltest_2;
+drop user mysqltest_u1@localhost;
+create database mysqltest_1;
+create database mysqltest_2;
+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'
+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;
+show create table mysqltest_2.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+create table t1 like mysqltest_2.t1;
+use test;
+drop database mysqltest_1;
+drop database mysqltest_2;
+drop user mysqltest_u1@localhost;
+grant all on `mysqltest\_%`.* to mysqltest_1@localhost with grant option;
+grant usage on *.* to mysqltest_2@localhost;
+create database mysqltest_1;
+use mysqltest_1;
+create table t1 (f1 int);
+grant create on `mysqltest\_1`.* to mysqltest_2@localhost;
+grant select on mysqltest_1.t1 to mysqltest_2@localhost;
+create database mysqltest_3;
+ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'mysqltest_3'
+use mysqltest_1;
+create table t2(f1 int);
+select * from t1;
+f1
+drop database mysqltest_1;
+revoke all privileges, grant option from mysqltest_1@localhost;
+revoke all privileges, grant option from mysqltest_2@localhost;
+drop user mysqltest_1@localhost;
+drop user mysqltest_2@localhost;
+End of 5.0 tests
diff --git a/mysql-test/r/grant_cache.result b/mysql-test/r/grant_cache.result
deleted file mode 100644
index 2c6840d77d0..00000000000
--- a/mysql-test/r/grant_cache.result
+++ /dev/null
@@ -1,210 +0,0 @@
-drop table if exists test.t1,mysqltest.t1,mysqltest.t2;
-drop database if exists mysqltest;
-set GLOBAL query_cache_size=1355776;
-reset query cache;
-flush status;
-show grants for current_user;
-Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
-show grants;
-Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
-create database if not exists mysqltest;
-create table mysqltest.t1 (a int,b int,c int);
-create table mysqltest.t2 (a int,b int,c int);
-insert into mysqltest.t1 values (1,1,1),(2,2,2);
-insert into mysqltest.t2 values (3,3,3);
-create table test.t1 (a char (10));
-insert into test.t1 values ("test.t1");
-select * from t1;
-a
-test.t1
-select * from t1;
-a b c
-1 1 1
-2 2 2
-select a from t1;
-a
-1
-2
-select c from t1;
-c
-1
-2
-select * from t2;
-a b c
-3 3 3
-select * from mysqltest.t1,test.t1;
-a b c a
-1 1 1 test.t1
-2 2 2 test.t1
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 6
-show status like "Qcache_hits%";
-Variable_name Value
-Qcache_hits 0
-grant SELECT on mysqltest.* to mysqltest_1@localhost;
-grant SELECT on mysqltest.t1 to mysqltest_2@localhost;
-grant SELECT on test.t1 to mysqltest_2@localhost;
-grant SELECT(a) on mysqltest.t1 to mysqltest_3@localhost;
-show grants for current_user();
-Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 6
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 0
-show status like "Qcache_not_cached";
-Variable_name Value
-Qcache_not_cached 0
-select "user1";
-user1
-user1
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 6
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 0
-show status like "Qcache_not_cached";
-Variable_name Value
-Qcache_not_cached 1
-select * from t1;
-a b c
-1 1 1
-2 2 2
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 6
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 1
-show status like "Qcache_not_cached";
-Variable_name Value
-Qcache_not_cached 1
-select a from t1 ;
-a
-1
-2
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 6
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 2
-show status like "Qcache_not_cached";
-Variable_name Value
-Qcache_not_cached 1
-select c from t1;
-c
-1
-2
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 6
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 3
-show status like "Qcache_not_cached";
-Variable_name Value
-Qcache_not_cached 1
-show grants for current_user();
-Grants for @localhost
-GRANT USAGE ON *.* TO ''@'localhost'
-select "user2";
-user2
-user2
-select * from t1;
-a b c
-1 1 1
-2 2 2
-select a from t1;
-a
-1
-2
-select c from t1;
-c
-1
-2
-select * from mysqltest.t1,test.t1;
-a b c a
-1 1 1 test.t1
-2 2 2 test.t1
-select * from t2;
-ERROR 42000: SELECT command denied to user 'mysqltest_2'@'localhost' for table 't2'
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 6
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 7
-show status like "Qcache_not_cached";
-Variable_name Value
-Qcache_not_cached 2
-select "user3";
-user3
-user3
-select * from t1;
-ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'b' in table 't1'
-select a from t1;
-a
-1
-2
-select c from t1;
-ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'c' in table 't1'
-select * from t2;
-ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for table 't2'
-select mysqltest.t1.c from test.t1,mysqltest.t1;
-ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'c' in table 't1'
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 6
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 7
-show status like "Qcache_not_cached";
-Variable_name Value
-Qcache_not_cached 7
-select "user4";
-user4
-user4
-show grants;
-Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
-select a from t1;
-ERROR 3D000: No database selected
-select * from mysqltest.t1,test.t1;
-a b c a
-1 1 1 test.t1
-2 2 2 test.t1
-select a from mysqltest.t1;
-a
-1
-2
-select a from mysqltest.t1;
-a
-1
-2
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 8
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 8
-show status like "Qcache_not_cached";
-Variable_name Value
-Qcache_not_cached 8
-set names binary;
-delete from mysql.user where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
-delete from mysql.db where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
-delete from mysql.tables_priv where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
-delete from mysql.columns_priv where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
-flush privileges;
-drop table test.t1,mysqltest.t1,mysqltest.t2;
-drop database mysqltest;
-set GLOBAL query_cache_size=default;
diff --git a/mysql-test/r/grant_cache_no_prot.result b/mysql-test/r/grant_cache_no_prot.result
new file mode 100644
index 00000000000..02360c4c325
--- /dev/null
+++ b/mysql-test/r/grant_cache_no_prot.result
@@ -0,0 +1,218 @@
+drop table if exists test.t1,mysqltest.t1,mysqltest.t2;
+drop database if exists mysqltest;
+set GLOBAL query_cache_size=1355776;
+reset query cache;
+flush status;
+----- establish connection root -----
+show grants for current_user;
+Grants for root@localhost
+GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+show grants;
+Grants for root@localhost
+GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+create database if not exists mysqltest;
+create table mysqltest.t1 (a int,b int,c int);
+create table mysqltest.t2 (a int,b int,c int);
+insert into mysqltest.t1 values (1,1,1),(2,2,2);
+insert into mysqltest.t2 values (3,3,3);
+create table test.t1 (a char (10));
+insert into test.t1 values ("test.t1");
+select * from t1;
+a
+test.t1
+----- establish connection root2 -----
+select * from t1;
+a b c
+1 1 1
+2 2 2
+select a from t1;
+a
+1
+2
+select c from t1;
+c
+1
+2
+select * from t2;
+a b c
+3 3 3
+select * from mysqltest.t1,test.t1;
+a b c a
+1 1 1 test.t1
+2 2 2 test.t1
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 6
+show status like "Qcache_hits%";
+Variable_name Value
+Qcache_hits 0
+grant SELECT on mysqltest.* to mysqltest_1@localhost;
+grant SELECT on mysqltest.t1 to mysqltest_2@localhost;
+grant SELECT on test.t1 to mysqltest_2@localhost;
+grant SELECT(a) on mysqltest.t1 to mysqltest_3@localhost;
+----- establish connection user1 (user=mysqltest_1) -----
+show grants for current_user();
+Grants for mysqltest_1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
+GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 6
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 0
+show status like "Qcache_not_cached";
+Variable_name Value
+Qcache_not_cached 0
+select "user1";
+user1
+user1
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 6
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 0
+show status like "Qcache_not_cached";
+Variable_name Value
+Qcache_not_cached 1
+select * from t1;
+a b c
+1 1 1
+2 2 2
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 6
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 1
+show status like "Qcache_not_cached";
+Variable_name Value
+Qcache_not_cached 1
+select a from t1 ;
+a
+1
+2
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 6
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 2
+show status like "Qcache_not_cached";
+Variable_name Value
+Qcache_not_cached 1
+select c from t1;
+c
+1
+2
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 6
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+show status like "Qcache_not_cached";
+Variable_name Value
+Qcache_not_cached 1
+----- establish connection unkuser (user=unkuser) -----
+show grants for current_user();
+Grants for @localhost
+GRANT USAGE ON *.* TO ''@'localhost'
+----- establish connection user2 (user=mysqltest_2) -----
+select "user2";
+user2
+user2
+select * from t1;
+a b c
+1 1 1
+2 2 2
+select a from t1;
+a
+1
+2
+select c from t1;
+c
+1
+2
+select * from mysqltest.t1,test.t1;
+a b c a
+1 1 1 test.t1
+2 2 2 test.t1
+select * from t2;
+ERROR 42000: SELECT command denied to user 'mysqltest_2'@'localhost' for table 't2'
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 6
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 7
+show status like "Qcache_not_cached";
+Variable_name Value
+Qcache_not_cached 2
+----- establish connection user3 (user=mysqltest_3) -----
+select "user3";
+user3
+user3
+select * from t1;
+ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'b' in table 't1'
+select a from t1;
+a
+1
+2
+select c from t1;
+ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'c' in table 't1'
+select * from t2;
+ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for table 't2'
+select mysqltest.t1.c from test.t1,mysqltest.t1;
+ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'c' in table 't1'
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 6
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 7
+show status like "Qcache_not_cached";
+Variable_name Value
+Qcache_not_cached 7
+----- establish connection user4 (user=mysqltest_1) -----
+select "user4";
+user4
+user4
+show grants;
+Grants for mysqltest_1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
+GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
+select a from t1;
+ERROR 3D000: No database selected
+select * from mysqltest.t1,test.t1;
+a b c a
+1 1 1 test.t1
+2 2 2 test.t1
+select a from mysqltest.t1;
+a
+1
+2
+select a from mysqltest.t1;
+a
+1
+2
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 8
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 8
+show status like "Qcache_not_cached";
+Variable_name Value
+Qcache_not_cached 8
+----- switch to connection default and close connections -----
+set names binary;
+delete from mysql.user where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
+delete from mysql.db where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
+delete from mysql.tables_priv where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
+delete from mysql.columns_priv where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
+flush privileges;
+drop table test.t1,mysqltest.t1,mysqltest.t2;
+drop database mysqltest;
+set GLOBAL query_cache_size=default;
diff --git a/mysql-test/r/grant_cache_ps_prot.result b/mysql-test/r/grant_cache_ps_prot.result
new file mode 100644
index 00000000000..1e2cd1baa3a
--- /dev/null
+++ b/mysql-test/r/grant_cache_ps_prot.result
@@ -0,0 +1,218 @@
+drop table if exists test.t1,mysqltest.t1,mysqltest.t2;
+drop database if exists mysqltest;
+set GLOBAL query_cache_size=1355776;
+reset query cache;
+flush status;
+----- establish connection root -----
+show grants for current_user;
+Grants for root@localhost
+GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+show grants;
+Grants for root@localhost
+GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+create database if not exists mysqltest;
+create table mysqltest.t1 (a int,b int,c int);
+create table mysqltest.t2 (a int,b int,c int);
+insert into mysqltest.t1 values (1,1,1),(2,2,2);
+insert into mysqltest.t2 values (3,3,3);
+create table test.t1 (a char (10));
+insert into test.t1 values ("test.t1");
+select * from t1;
+a
+test.t1
+----- establish connection root2 -----
+select * from t1;
+a b c
+1 1 1
+2 2 2
+select a from t1;
+a
+1
+2
+select c from t1;
+c
+1
+2
+select * from t2;
+a b c
+3 3 3
+select * from mysqltest.t1,test.t1;
+a b c a
+1 1 1 test.t1
+2 2 2 test.t1
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 6
+show status like "Qcache_hits%";
+Variable_name Value
+Qcache_hits 0
+grant SELECT on mysqltest.* to mysqltest_1@localhost;
+grant SELECT on mysqltest.t1 to mysqltest_2@localhost;
+grant SELECT on test.t1 to mysqltest_2@localhost;
+grant SELECT(a) on mysqltest.t1 to mysqltest_3@localhost;
+----- establish connection user1 (user=mysqltest_1) -----
+show grants for current_user();
+Grants for mysqltest_1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
+GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 6
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 0
+show status like "Qcache_not_cached";
+Variable_name Value
+Qcache_not_cached 0
+select "user1";
+user1
+user1
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 6
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 0
+show status like "Qcache_not_cached";
+Variable_name Value
+Qcache_not_cached 1
+select * from t1;
+a b c
+1 1 1
+2 2 2
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 6
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 1
+show status like "Qcache_not_cached";
+Variable_name Value
+Qcache_not_cached 1
+select a from t1 ;
+a
+1
+2
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 6
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 2
+show status like "Qcache_not_cached";
+Variable_name Value
+Qcache_not_cached 1
+select c from t1;
+c
+1
+2
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 6
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 3
+show status like "Qcache_not_cached";
+Variable_name Value
+Qcache_not_cached 1
+----- establish connection unkuser (user=unkuser) -----
+show grants for current_user();
+Grants for @localhost
+GRANT USAGE ON *.* TO ''@'localhost'
+----- establish connection user2 (user=mysqltest_2) -----
+select "user2";
+user2
+user2
+select * from t1;
+a b c
+1 1 1
+2 2 2
+select a from t1;
+a
+1
+2
+select c from t1;
+c
+1
+2
+select * from mysqltest.t1,test.t1;
+a b c a
+1 1 1 test.t1
+2 2 2 test.t1
+select * from t2;
+ERROR 42000: SELECT command denied to user 'mysqltest_2'@'localhost' for table 't2'
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 6
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 7
+show status like "Qcache_not_cached";
+Variable_name Value
+Qcache_not_cached 2
+----- establish connection user3 (user=mysqltest_3) -----
+select "user3";
+user3
+user3
+select * from t1;
+ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'b' in table 't1'
+select a from t1;
+a
+1
+2
+select c from t1;
+ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'c' in table 't1'
+select * from t2;
+ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for table 't2'
+select mysqltest.t1.c from test.t1,mysqltest.t1;
+ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'c' in table 't1'
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 6
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 7
+show status like "Qcache_not_cached";
+Variable_name Value
+Qcache_not_cached 4
+----- establish connection user4 (user=mysqltest_1) -----
+select "user4";
+user4
+user4
+show grants;
+Grants for mysqltest_1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
+GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
+select a from t1;
+ERROR 3D000: No database selected
+select * from mysqltest.t1,test.t1;
+a b c a
+1 1 1 test.t1
+2 2 2 test.t1
+select a from mysqltest.t1;
+a
+1
+2
+select a from mysqltest.t1;
+a
+1
+2
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 8
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 8
+show status like "Qcache_not_cached";
+Variable_name Value
+Qcache_not_cached 5
+----- switch to connection default and close connections -----
+set names binary;
+delete from mysql.user where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
+delete from mysql.db where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
+delete from mysql.tables_priv where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
+delete from mysql.columns_priv where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
+flush privileges;
+drop table test.t1,mysqltest.t1,mysqltest.t2;
+drop database mysqltest;
+set GLOBAL query_cache_size=default;
diff --git a/mysql-test/r/greedy_optimizer.result b/mysql-test/r/greedy_optimizer.result
index ebd2468c9af..9e8c66722e3 100644
--- a/mysql-test/r/greedy_optimizer.result
+++ b/mysql-test/r/greedy_optimizer.result
@@ -120,72 +120,72 @@ select @@optimizer_search_depth;
63
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 821.837037
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 821.837037
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index; Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index; Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 794.837037
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index; Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index; Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 794.837037
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where; Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where; Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 794.837037
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where; Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where; Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
show status like 'Last_query_cost';
Variable_name Value
@@ -200,72 +200,72 @@ select @@optimizer_search_depth;
0
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 821.837037
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 821.837037
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using join buffer
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index; Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 289.418727
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using join buffer
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index; Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 289.418727
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where; Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 289.418727
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where; Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
show status like 'Last_query_cost';
Variable_name Value
@@ -276,24 +276,24 @@ select @@optimizer_search_depth;
1
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 821.837037
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
show status like 'Last_query_cost';
Variable_name Value
@@ -303,10 +303,10 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
-1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index; Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 794.837037
@@ -315,10 +315,10 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
-1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index; Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 794.837037
@@ -327,10 +327,10 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
-1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where; Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 794.837037
@@ -339,10 +339,10 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
-1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where; Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 794.837037
@@ -352,72 +352,72 @@ select @@optimizer_search_depth;
62
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 821.837037
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 821.837037
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using join buffer
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index; Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 289.418727
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using join buffer
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index; Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 289.418727
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where; Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 289.418727
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where; Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
show status like 'Last_query_cost';
Variable_name Value
@@ -432,72 +432,72 @@ select @@optimizer_search_depth;
0
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 821.837037
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 821.837037
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index; Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index; Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 794.837037
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index; Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index; Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 794.837037
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where; Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where; Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 794.837037
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where; Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where; Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
show status like 'Last_query_cost';
Variable_name Value
@@ -508,24 +508,24 @@ select @@optimizer_search_depth;
1
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 821.837037
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
show status like 'Last_query_cost';
Variable_name Value
@@ -535,10 +535,10 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
-1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index; Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 794.837037
@@ -547,10 +547,10 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
-1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index; Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 794.837037
@@ -559,10 +559,10 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
-1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where; Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 794.837037
@@ -571,10 +571,10 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
-1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where; Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 794.837037
@@ -584,72 +584,72 @@ select @@optimizer_search_depth;
62
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 821.837037
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 821.837037
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index; Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index; Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 794.837037
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index; Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index; Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 794.837037
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where; Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where; Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
show status like 'Last_query_cost';
Variable_name Value
Last_query_cost 794.837037
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where; Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where; Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where
+1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer
+1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
+1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
show status like 'Last_query_cost';
Variable_name Value
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index 807986c5f4e..2faf7832aca 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -536,12 +536,12 @@ a b
1 1
explain select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort; Using join cache
-1 SIMPLE t2 ALL a NULL NULL NULL 4 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort
+1 SIMPLE t2 ALL a NULL NULL NULL 4 Using where; Using join buffer
explain select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b ORDER BY NULL;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using temporary; Using join cache
-1 SIMPLE t2 ALL a NULL NULL NULL 4 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using temporary
+1 SIMPLE t2 ALL a NULL NULL NULL 4 Using where; Using join buffer
drop table t1,t2;
create table t1 (a int, b int);
insert into t1 values (1, 4),(10, 40),(1, 4),(10, 43),(1, 4),(10, 41),(1, 4),(10, 43),(1, 4);
@@ -824,6 +824,23 @@ a
2
1
DROP TABLE t1;
+CREATE TABLE t1 (
+f1 int(10) unsigned NOT NULL auto_increment primary key,
+f2 varchar(100) NOT NULL default ''
+);
+CREATE TABLE t2 (
+f1 varchar(10) NOT NULL default '',
+f2 char(3) NOT NULL default '',
+PRIMARY KEY (`f1`),
+KEY `k1` (`f2`,`f1`)
+);
+INSERT INTO t1 values(NULL, '');
+INSERT INTO `t2` VALUES ('486878','WDT'),('486910','WDT');
+SELECT SQL_BUFFER_RESULT avg(t2.f1) FROM t1, t2 where t2.f2 = 'SIR' GROUP BY t1.f1;
+avg(t2.f1)
+SELECT avg(t2.f1) FROM t1, t2 where t2.f2 = 'SIR' GROUP BY t1.f1;
+avg(t2.f1)
+DROP TABLE t1, t2;
create table t1 (c1 char(3), c2 char(3));
create table t2 (c3 char(3), c4 char(3));
insert into t1 values ('aaa', 'bb1'), ('aaa', 'bb2');
@@ -1055,47 +1072,47 @@ INSERT INTO t1 SELECT a + 8,b FROM t1;
INSERT INTO t1 SELECT a + 16,b FROM t1;
INSERT INTO t1 SELECT a + 32,b FROM t1;
INSERT INTO t1 SELECT a + 64,b FROM t1;
-INSERT INTO t1 SELECT a + 128,b FROM t1;
+INSERT INTO t1 SELECT a + 128,b FROM t1 limit 16;
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
EXPLAIN SELECT a FROM t1 WHERE a < 2;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range PRIMARY,i2 PRIMARY 4 NULL 2 Using where; Using index
+1 SIMPLE t1 range PRIMARY,i2 PRIMARY 4 NULL 1 Using where; Using index
EXPLAIN SELECT a FROM t1 WHERE a < 2 ORDER BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range PRIMARY,i2 PRIMARY 4 NULL 2 Using where; Using index
+1 SIMPLE t1 range PRIMARY,i2 PRIMARY 4 NULL 1 Using where; Using index
EXPLAIN SELECT a FROM t1 WHERE a < 2 GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range PRIMARY,i2 PRIMARY 4 NULL 2 Using where; Using index
+1 SIMPLE t1 range PRIMARY,i2 PRIMARY 4 NULL 1 Using where; Using index
EXPLAIN SELECT a FROM t1 IGNORE INDEX (PRIMARY,i2);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 256
+1 SIMPLE t1 ALL NULL NULL NULL NULL 144
EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR JOIN (PRIMARY,i2);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 256
+1 SIMPLE t1 ALL NULL NULL NULL NULL 144
EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR GROUP BY (PRIMARY,i2) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL PRIMARY 4 NULL 256 Using index
+1 SIMPLE t1 index NULL PRIMARY 4 NULL 144 Using index; Using filesort
EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY,i2) ORDER BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL PRIMARY 4 NULL 256 Using index; Using filesort
+1 SIMPLE t1 index NULL PRIMARY 4 NULL 144 Using index; Using filesort
EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY)
IGNORE INDEX FOR GROUP BY (i2) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL PRIMARY 4 NULL 256 Using index
+1 SIMPLE t1 index NULL PRIMARY 4 NULL 144 Using index
EXPLAIN SELECT a FROM t1 IGNORE INDEX (PRIMARY) IGNORE INDEX FOR ORDER BY (i2);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL i2 9 NULL 256 Using index
+1 SIMPLE t1 index NULL i2 9 NULL 144 Using index
EXPLAIN SELECT a FROM t1 FORCE INDEX (i2);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL i2 9 NULL 256 Using index
+1 SIMPLE t1 index NULL i2 9 NULL 144 Using index
EXPLAIN SELECT a FROM t1 USE INDEX ();
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 256
+1 SIMPLE t1 ALL NULL NULL NULL NULL 144
EXPLAIN SELECT a FROM t1 USE INDEX () USE INDEX (i2);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 256
+1 SIMPLE t1 ALL NULL NULL NULL NULL 144
EXPLAIN SELECT a FROM t1
FORCE INDEX (PRIMARY)
IGNORE INDEX FOR GROUP BY (i2)
@@ -1104,7 +1121,7 @@ USE INDEX (i2);
ERROR HY000: Incorrect usage of USE INDEX and FORCE INDEX
EXPLAIN SELECT a FROM t1 USE INDEX (i2) USE INDEX ();
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL i2 9 NULL 256 Using index
+1 SIMPLE t1 index NULL i2 9 NULL 144 Using index
EXPLAIN SELECT a FROM t1 FORCE INDEX ();
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
EXPLAIN SELECT a FROM t1 IGNORE INDEX ();
@@ -1112,39 +1129,39 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
EXPLAIN SELECT a FROM t1 USE INDEX FOR JOIN (i2)
USE INDEX FOR GROUP BY (i2) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL i2 9 NULL 256 Using index
+1 SIMPLE t1 # NULL i2 # NULL # #
EXPLAIN SELECT a FROM t1 FORCE INDEX FOR JOIN (i2)
FORCE INDEX FOR GROUP BY (i2) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL i2 4 NULL 257 Using index for group-by
+1 SIMPLE t1 range NULL i2 4 NULL 145 Using index for group-by
EXPLAIN SELECT a FROM t1 USE INDEX () IGNORE INDEX (i2);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 256
+1 SIMPLE t1 ALL NULL NULL NULL NULL 144
EXPLAIN SELECT a FROM t1 IGNORE INDEX (i2) USE INDEX ();
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 256
+1 SIMPLE t1 ALL NULL NULL NULL NULL 144
EXPLAIN SELECT a FROM t1
USE INDEX FOR GROUP BY (i2)
USE INDEX FOR ORDER BY (i2)
USE INDEX FOR JOIN (i2);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL i2 9 NULL 256 Using index
+1 SIMPLE t1 index NULL i2 9 NULL 144 Using index
EXPLAIN SELECT a FROM t1
USE INDEX FOR JOIN (i2)
USE INDEX FOR JOIN (i2)
USE INDEX FOR JOIN (i2,i2);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL i2 9 NULL 256 Using index
+1 SIMPLE t1 index NULL i2 9 NULL 144 Using index
EXPLAIN SELECT 1 FROM t1 WHERE a IN
(SELECT a FROM t1 USE INDEX (i2) IGNORE INDEX (i2));
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 index NULL PRIMARY 4 NULL 256 Using where; Using index
-2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 256 Using where
+1 PRIMARY t1 index NULL PRIMARY 4 NULL 144 Using where; Using index
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 144 Using where
CREATE TABLE t2 (a INT, b INT, KEY(a));
INSERT INTO t2 VALUES (1, 1), (2, 2), (3,3), (4,4);
EXPLAIN SELECT a, SUM(b) FROM t2 GROUP BY a LIMIT 2;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 index NULL a 5 NULL 4
+1 SIMPLE t2 index NULL a 5 NULL 2
EXPLAIN SELECT a, SUM(b) FROM t2 IGNORE INDEX (a) GROUP BY a LIMIT 2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using temporary; Using filesort
@@ -1152,10 +1169,101 @@ EXPLAIN SELECT 1 FROM t2 WHERE a IN
(SELECT a FROM t1 USE INDEX (i2) IGNORE INDEX (i2));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 index NULL a 5 NULL 4 Using where; Using index
-2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 256 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 144 Using where
SHOW VARIABLES LIKE 'old';
Variable_name Value
old OFF
SET @@old = off;
ERROR HY000: Variable 'old' is a read only variable
DROP TABLE t1, t2;
+CREATE TABLE t1(
+a INT,
+b INT NOT NULL,
+c INT NOT NULL,
+d INT,
+UNIQUE KEY (c,b)
+);
+INSERT INTO t1 VALUES (1,1,1,50), (1,2,3,40), (2,1,3,4);
+CREATE TABLE t2(
+a INT,
+b INT,
+UNIQUE KEY(a,b)
+);
+INSERT INTO t2 VALUES (NULL, NULL), (NULL, NULL), (NULL, 1), (1, NULL), (1, 1), (1,2);
+EXPLAIN SELECT c,b,d FROM t1 GROUP BY c,b,d;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using filesort
+SELECT c,b,d FROM t1 GROUP BY c,b,d;
+c b d
+1 1 50
+3 1 4
+3 2 40
+EXPLAIN SELECT c,b,d FROM t1 GROUP BY c,b,d ORDER BY NULL;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3
+SELECT c,b,d FROM t1 GROUP BY c,b,d ORDER BY NULL;
+c b d
+1 1 50
+3 2 40
+3 1 4
+EXPLAIN SELECT c,b,d FROM t1 ORDER BY c,b,d;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using filesort
+SELECT c,b,d FROM t1 ORDER BY c,b,d;
+c b d
+1 1 50
+3 1 4
+3 2 40
+EXPLAIN SELECT c,b,d FROM t1 GROUP BY c,b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using filesort
+SELECT c,b,d FROM t1 GROUP BY c,b;
+c b d
+1 1 50
+3 1 4
+3 2 40
+EXPLAIN SELECT c,b FROM t1 GROUP BY c,b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL c 8 NULL 3 Using index
+SELECT c,b FROM t1 GROUP BY c,b;
+c b
+1 1
+3 1
+3 2
+EXPLAIN SELECT a,b from t2 ORDER BY a,b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 index NULL a 10 NULL 6 Using index
+SELECT a,b from t2 ORDER BY a,b;
+a b
+NULL NULL
+NULL NULL
+NULL 1
+1 NULL
+1 1
+1 2
+EXPLAIN SELECT a,b from t2 GROUP BY a,b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 index NULL a 10 NULL 6 Using index
+SELECT a,b from t2 GROUP BY a,b;
+a b
+NULL NULL
+NULL 1
+1 NULL
+1 1
+1 2
+EXPLAIN SELECT a from t2 GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 index NULL a 10 NULL 6 Using index
+SELECT a from t2 GROUP BY a;
+a
+NULL
+1
+EXPLAIN SELECT b from t2 GROUP BY b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 index NULL a 10 NULL 6 Using index; Using temporary; Using filesort
+SELECT b from t2 GROUP BY b;
+b
+NULL
+1
+2
+DROP TABLE t1;
diff --git a/mysql-test/r/group_min_max.result b/mysql-test/r/group_min_max.result
index bc07b933895..02b1459afd0 100644
--- a/mysql-test/r/group_min_max.result
+++ b/mysql-test/r/group_min_max.result
@@ -1963,20 +1963,20 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 128 Using temporary; Using filesort
explain select a1,a2,count(a2) from t1 group by a1,a2,b;
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 index
+1 SIMPLE t1 index NULL idx_t1_2 147 NULL 128 Using index
explain extended select a1,a2,count(a2) from t1 where (a1 > 'a') group by a1,a2,b;
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_1 163 NULL 128 75.00 Using where; Using index
+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
Warnings:
Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,count(`test`.`t1`.`a2`) AS `count(a2)` from `test`.`t1` where (`test`.`t1`.`a1` > _latin1'a') group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`
explain extended select sum(ord(a1)) from t1 where (a1 > 'a') group by a1,a2,b;
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_1 163 NULL 128 75.00 Using where; Using index
+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
Warnings:
Note 1003 select sum(ord(`test`.`t1`.`a1`)) AS `sum(ord(a1))` from `test`.`t1` where (`test`.`t1`.`a1` > _latin1'a') group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`
explain select distinct(a1) from t1 where ord(a2) = 98;
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 index NULL idx_t1_2 147 NULL 128 Using where; Using index
select distinct(a1) from t1 where ord(a2) = 98;
a1
a
@@ -2256,7 +2256,7 @@ EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE
a IN (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1_outer index NULL a 10 NULL 15 Using where; Using index
-2 DEPENDENT SUBQUERY t1 index NULL a 10 NULL 15 Using index
+2 DEPENDENT SUBQUERY t1 index NULL a 10 NULL 1 Using index
EXPLAIN SELECT 1 FROM t1 AS t1_outer GROUP BY a HAVING
a > (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2);
id select_type table type possible_keys key key_len ref rows Extra
@@ -2266,8 +2266,8 @@ EXPLAIN SELECT 1 FROM t1 AS t1_outer1 JOIN t1 AS t1_outer2
ON t1_outer1.a = (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2)
AND t1_outer1.b = t1_outer2.b;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1_outer1 ref a a 5 const 1 Using where; Using index; Using join cache
-1 PRIMARY t1_outer2 index NULL a 10 NULL 15 Using where; Using index
+1 PRIMARY t1_outer1 ref a a 5 const 1 Using where; Using index
+1 PRIMARY t1_outer2 index NULL a 10 NULL 15 Using where; Using index; Using join buffer
2 SUBQUERY t1 range NULL a 5 NULL 8 Using index for group-by
EXPLAIN SELECT (SELECT (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) x
FROM t1 AS t1_outer) x2 FROM t1 AS t1_outer2;
@@ -2306,3 +2306,24 @@ Variable_name Value
Handler_read_key 8
Handler_read_next 1
DROP TABLE t1,t2,t3;
+CREATE TABLE t1 (a int, INDEX idx(a));
+INSERT INTO t1 VALUES
+(4), (2), (1), (2), (4), (2), (1), (4),
+(4), (2), (1), (2), (2), (4), (1), (4);
+EXPLAIN SELECT DISTINCT(a) FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL idx 5 NULL 9 Using index for group-by
+SELECT DISTINCT(a) FROM t1;
+a
+1
+2
+4
+EXPLAIN SELECT SQL_BIG_RESULT DISTINCT(a) FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL idx 5 NULL 9 Using index for group-by
+SELECT SQL_BIG_RESULT DISTINCT(a) FROM t1;
+a
+1
+2
+4
+DROP TABLE t1;
diff --git a/mysql-test/r/handler_innodb.result b/mysql-test/r/handler_innodb.result
index 1bd50612a3f..98b8922bc5f 100644
--- a/mysql-test/r/handler_innodb.result
+++ b/mysql-test/r/handler_innodb.result
@@ -515,3 +515,23 @@ ERROR 42S02: Table 'test.t1' doesn't exist
drop table if exists t1;
Warnings:
Note 1051 Unknown table 't1'
+drop table if exists t1;
+create table t1 (a int) ENGINE=MEMORY;
+--> client 2
+handler t1 open;
+ERROR HY000: Table storage engine for 't1' doesn't have this option
+--> client 1
+drop table t1;
+drop table if exists t1;
+create table t1 (a int);
+handler t1 open as t1_alias;
+handler t1_alias read a next;
+ERROR 42000: Key 'a' doesn't exist in table 't1_alias'
+handler t1_alias READ a next where inexistent > 0;
+ERROR 42S22: Unknown column 'inexistent' in 'field list'
+handler t1_alias read a next;
+ERROR 42000: Key 'a' doesn't exist in table 't1_alias'
+handler t1_alias READ a next where inexistent > 0;
+ERROR 42S22: Unknown column 'inexistent' in 'field list'
+handler t1_alias close;
+drop table t1;
diff --git a/mysql-test/r/handler_myisam.result b/mysql-test/r/handler_myisam.result
index beb1a40c318..464b775b795 100644
--- a/mysql-test/r/handler_myisam.result
+++ b/mysql-test/r/handler_myisam.result
@@ -515,3 +515,23 @@ ERROR 42S02: Table 'test.t1' doesn't exist
drop table if exists t1;
Warnings:
Note 1051 Unknown table 't1'
+drop table if exists t1;
+create table t1 (a int) ENGINE=MEMORY;
+--> client 2
+handler t1 open;
+ERROR HY000: Table storage engine for 't1' doesn't have this option
+--> client 1
+drop table t1;
+drop table if exists t1;
+create table t1 (a int);
+handler t1 open as t1_alias;
+handler t1_alias read a next;
+ERROR 42000: Key 'a' doesn't exist in table 't1_alias'
+handler t1_alias READ a next where inexistent > 0;
+ERROR 42S22: Unknown column 'inexistent' in 'field list'
+handler t1_alias read a next;
+ERROR 42000: Key 'a' doesn't exist in table 't1_alias'
+handler t1_alias READ a next where inexistent > 0;
+ERROR 42S22: Unknown column 'inexistent' in 'field list'
+handler t1_alias close;
+drop table t1;
diff --git a/mysql-test/r/have_bug25714.require b/mysql-test/r/have_bug25714.require
new file mode 100644
index 00000000000..5acc378dcf7
--- /dev/null
+++ b/mysql-test/r/have_bug25714.require
@@ -0,0 +1,2 @@
+have_bug25714_exe
+1
diff --git a/mysql-test/r/have_cp1251.require b/mysql-test/r/have_cp1251.require
new file mode 100644
index 00000000000..465e8338084
--- /dev/null
+++ b/mysql-test/r/have_cp1251.require
@@ -0,0 +1,2 @@
+Collation Charset Id Default Compiled Sortlen
+cp1251_general_ci cp1251 51 Yes 0
diff --git a/mysql-test/r/have_cp866.require b/mysql-test/r/have_cp866.require
new file mode 100644
index 00000000000..da2a3e2f05e
--- /dev/null
+++ b/mysql-test/r/have_cp866.require
@@ -0,0 +1,2 @@
+Collation Charset Id Default Compiled Sortlen
+cp866_general_ci cp866 36 Yes 0
diff --git a/mysql-test/r/have_koi8r.require b/mysql-test/r/have_koi8r.require
new file mode 100644
index 00000000000..b109b9ae520
--- /dev/null
+++ b/mysql-test/r/have_koi8r.require
@@ -0,0 +1,2 @@
+Collation Charset Id Default Compiled Sortlen
+koi8r_general_ci koi8r 7 Yes 0
diff --git a/mysql-test/r/have_log_bin.require b/mysql-test/r/have_log_bin.require
new file mode 100644
index 00000000000..d4fd77e4f8d
--- /dev/null
+++ b/mysql-test/r/have_log_bin.require
@@ -0,0 +1,2 @@
+Variable_name Value
+log_bin ON
diff --git a/mysql-test/r/have_utf8.require b/mysql-test/r/have_utf8.require
new file mode 100644
index 00000000000..71f8ccfff47
--- /dev/null
+++ b/mysql-test/r/have_utf8.require
@@ -0,0 +1,2 @@
+Collation Charset Id Default Compiled Sortlen
+utf8_general_ci utf8 33 Yes Yes 1
diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result
index 149391396b6..a5a96fd4958 100644
--- a/mysql-test/r/having.result
+++ b/mysql-test/r/having.result
@@ -158,6 +158,25 @@ EXPLAIN SELECT 0 AS x, a FROM t1 GROUP BY x,a HAVING x=1 AND a > 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible HAVING
DROP table t1;
+CREATE TABLE t1 (a int PRIMARY KEY);
+CREATE TABLE t2 (b int PRIMARY KEY, a int);
+CREATE TABLE t3 (b int, flag int);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1,1), (2,1), (3,1);
+INSERT INTO t3(b,flag) VALUES (2, 1);
+SELECT t1.a
+FROM t1 INNER JOIN t2 ON t1.a=t2.a LEFT JOIN t3 ON t2.b=t3.b
+GROUP BY t1.a, t2.b HAVING MAX(t3.flag)=0;
+a
+SELECT DISTINCT t1.a, MAX(t3.flag)
+FROM t1 INNER JOIN t2 ON t1.a=t2.a LEFT JOIN t3 ON t2.b=t3.b
+GROUP BY t1.a, t2.b HAVING MAX(t3.flag)=0;
+a MAX(t3.flag)
+SELECT DISTINCT t1.a
+FROM t1 INNER JOIN t2 ON t1.a=t2.a LEFT JOIN t3 ON t2.b=t3.b
+GROUP BY t1.a, t2.b HAVING MAX(t3.flag)=0;
+a
+DROP TABLE t1,t2,t3;
create table t1 (col1 int, col2 varchar(5), col_t1 int);
create table t2 (col1 int, col2 varchar(5), col_t2 int);
create table t3 (col1 int, col2 varchar(5), col_t3 int);
diff --git a/mysql-test/r/heap_hash.result b/mysql-test/r/heap_hash.result
index 41f00fd2ad8..bae49af462f 100644
--- a/mysql-test/r/heap_hash.result
+++ b/mysql-test/r/heap_hash.result
@@ -366,3 +366,19 @@ explain select a from t1 where a in (1,3);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 5 NULL 4 Using where
drop table t1;
+End of 4.1 tests
+CREATE TABLE t1(col1 VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
+col2 VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
+UNIQUE KEY key1 USING HASH (col1, col2)) ENGINE=MEMORY;
+INSERT INTO t1 VALUES('A', 'A');
+INSERT INTO t1 VALUES('A ', 'A ');
+ERROR 23000: Duplicate entry 'A -A ' for key 'key1'
+DROP TABLE t1;
+CREATE TABLE t1(col1 VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
+col2 VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
+UNIQUE KEY key1 USING HASH (col1, col2)) ENGINE=MEMORY;
+INSERT INTO t1 VALUES('A', 'A');
+INSERT INTO t1 VALUES('A ', 'A ');
+ERROR 23000: Duplicate entry 'A -A ' for key 'key1'
+DROP TABLE t1;
+End of 5.0 tests
diff --git a/mysql-test/r/im_options.result b/mysql-test/r/im_options.result
deleted file mode 100644
index 3225db0c8c5..00000000000
--- a/mysql-test/r/im_options.result
+++ /dev/null
@@ -1,149 +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
-skip-stack-trace option_value
-skip-innodb option_value
-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
-skip-stack-trace option_value
-skip-innodb option_value
-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/r/im_utils.result b/mysql-test/r/im_utils.result
deleted file mode 100644
index 397050635e1..00000000000
--- a/mysql-test/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
-skip-innodb VALUE
-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
-skip-innodb VALUE
-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/r/index_merge_myisam.result b/mysql-test/r/index_merge_myisam.result
index e8a37257782..9d7d06f7f1b 100644
--- a/mysql-test/r/index_merge_myisam.result
+++ b/mysql-test/r/index_merge_myisam.result
@@ -270,8 +270,8 @@ id select_type table type possible_keys key key_len ref rows Extra
explain select * from t0,t1 where t0.key1 = 5 and
(t1.key1 = t0.key1 or t1.key8 = t0.key1);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t0 ref i1 i1 4 const 1 Using join cache
-1 SIMPLE t1 index_merge i1,i8 i1,i8 4,4 NULL 2 Using union(i1,i8); Using where
+1 SIMPLE t0 ref i1 i1 4 const 1
+1 SIMPLE t1 index_merge i1,i8 i1,i8 4,4 NULL 2 Using union(i1,i8); Using where; Using join buffer
explain select * from t0,t1 where t0.key1 < 3 and
(t1.key1 = t0.key1 or t1.key8 = t0.key1);
id select_type table type possible_keys key key_len ref rows Extra
@@ -347,8 +347,8 @@ from t0 as A force index(i1,i2), t0 as B force index (i1,i2)
where (A.key1 < 500000 or A.key2 < 3)
and (B.key1 < 500000 or B.key2 < 3);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE A index_merge i1,i2 i1,i2 4,4 NULL 1013 Using sort_union(i1,i2); Using where; Using join cache
-1 SIMPLE B index_merge i1,i2 i1,i2 4,4 NULL 1013 Using sort_union(i1,i2); Using where
+1 SIMPLE A index_merge i1,i2 i1,i2 4,4 NULL 1013 Using sort_union(i1,i2); Using where
+1 SIMPLE B index_merge i1,i2 i1,i2 4,4 NULL 1013 Using sort_union(i1,i2); Using where; Using join buffer
select max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.key5 + B.key5)
from t0 as A force index(i1,i2), t0 as B force index (i1,i2)
where (A.key1 < 500000 or A.key2 < 3)
@@ -361,8 +361,8 @@ from t0 as A force index(i1,i2), t0 as B force index (i1,i2)
where (A.key1 = 1 or A.key2 = 1)
and (B.key1 = 1 or B.key2 = 1);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE A index_merge i1,i2 i1,i2 4,4 NULL 1020 Using union(i1,i2); Using where; Using join cache
-1 SIMPLE B index_merge i1,i2 i1,i2 4,4 NULL 1020 Using union(i1,i2); Using where
+1 SIMPLE A index_merge i1,i2 i1,i2 4,4 NULL 1020 Using union(i1,i2); Using where
+1 SIMPLE B index_merge i1,i2 i1,i2 4,4 NULL 1020 Using union(i1,i2); Using where; Using join buffer
select max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.key5 + B.key5)
from t0 as A force index(i1,i2), t0 as B force index (i1,i2)
where (A.key1 = 1 or A.key2 = 1)
@@ -376,8 +376,8 @@ from t0 as A, t0 as B
where (A.key1 = 1 and A.key2 = 1 and A.key3 = 1 and A.key4=1 and A.key5=1 and A.key6=1 and A.key7 = 1 or A.key8=1)
and (B.key1 = 1 and B.key2 = 1 and B.key3 = 1 and B.key4=1 and B.key5=1 and B.key6=1 and B.key7 = 1 or B.key8=1);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE A index_merge i1,i2,i3,i4,i5,i6,i7?,i8 i2,i3,i4,i5,i6,i7?,i8 X NULL # Using union(intersect(i2,i3,i4,i5,i6,i7?),i8); Using where; Using join cache
-1 SIMPLE B index_merge i1,i2,i3,i4,i5,i6,i7?,i8 i2,i3,i4,i5,i6,i7?,i8 X NULL # Using union(intersect(i2,i3,i4,i5,i6,i7?),i8); Using where
+1 SIMPLE A index_merge i1,i2,i3,i4,i5,i6,i7?,i8 i2,i3,i4,i5,i6,i7?,i8 X NULL # Using union(intersect(i2,i3,i4,i5,i6,i7?),i8); Using where
+1 SIMPLE B index_merge i1,i2,i3,i4,i5,i6,i7?,i8 i2,i3,i4,i5,i6,i7?,i8 X NULL # Using union(intersect(i2,i3,i4,i5,i6,i7?),i8); Using where; Using join buffer
select max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.key5 + B.key5)
from t0 as A, t0 as B
where (A.key1 = 1 and A.key2 = 1 and A.key3 = 1 and A.key4=1 and A.key5=1 and A.key6=1 and A.key7 = 1 or A.key8=1)
@@ -457,6 +457,67 @@ a
1
UNLOCK TABLES;
DROP TABLE t1, t2;
+CREATE TABLE `t1` (
+`a` int(11) DEFAULT NULL,
+`filler` char(200) DEFAULT NULL,
+`b` int(11) DEFAULT NULL,
+KEY `a` (`a`),
+KEY `b` (`b`)
+) ENGINE=MEMORY DEFAULT CHARSET=latin1;
+insert into t1 values
+(0, 'filler', 0), (1, 'filler', 1), (2, 'filler', 2), (3, 'filler', 3),
+(4, 'filler', 4), (5, 'filler', 5), (6, 'filler', 6), (7, 'filler', 7),
+(8, 'filler', 8), (9, 'filler', 9), (0, 'filler', 0), (1, 'filler', 1),
+(2, 'filler', 2), (3, 'filler', 3), (4, 'filler', 4), (5, 'filler', 5),
+(6, 'filler', 6), (7, 'filler', 7), (8, 'filler', 8), (9, 'filler', 9),
+(10, 'filler', 10), (11, 'filler', 11), (12, 'filler', 12), (13, 'filler', 13),
+(14, 'filler', 14), (15, 'filler', 15), (16, 'filler', 16), (17, 'filler', 17),
+(18, 'filler', 18), (19, 'filler', 19), (4, '5 ', 0), (5, '4 ', 0),
+(4, '4 ', 0), (4, 'qq ', 5), (5, 'qq ', 4), (4, 'zz ', 4);
+create table t2(
+`a` int(11) DEFAULT NULL,
+`filler` char(200) DEFAULT NULL,
+`b` int(11) DEFAULT NULL,
+KEY USING BTREE (`a`),
+KEY USING BTREE (`b`)
+) ENGINE=MEMORY DEFAULT CHARSET=latin1;
+insert into t2 select * from t1;
+must use sort-union rather than union:
+explain select * from t1 where a=4 or b=4;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index_merge a,b a,b 5,5 NULL # Using sort_union(a,b); Using where
+select * from t1 where a=4 or b=4;
+a filler b
+4 4 0
+4 5 0
+4 filler 4
+4 filler 4
+4 qq 5
+4 zz 4
+5 qq 4
+select * from t1 ignore index(a,b) where a=4 or b=4;
+a filler b
+4 4 0
+4 5 0
+4 filler 4
+4 filler 4
+4 qq 5
+4 zz 4
+5 qq 4
+must use union, not sort-union:
+explain select * from t2 where a=4 or b=4;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 index_merge a,b a,b 5,5 NULL # Using union(a,b); Using where
+select * from t2 where a=4 or b=4;
+a filler b
+4 4 0
+4 5 0
+4 filler 4
+4 filler 4
+4 qq 5
+4 zz 4
+5 qq 4
+drop table t1, t2;
#---------------- ROR-index_merge tests -----------------------
SET SESSION STORAGE_ENGINE = MyISAM;
drop table if exists t0,t1,t2;
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index ff664f7b80c..8aa9254e125 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -197,7 +197,6 @@ t1 a select
show columns from mysqltest.t1;
Field Type Null Key Default Extra
a int(11) YES NULL
-b varchar(30) YES MUL NULL
select table_name, column_name, privileges from information_schema.columns
where table_schema = 'mysqltest' and table_name = 'v1';
table_name column_name privileges
@@ -275,11 +274,11 @@ parameter_style sql_data_access dtd_identifier
SQL CONTAINS SQL NULL
SQL CONTAINS SQL int(11)
show procedure status;
-Db Name Type Definer Modified Created Security_type Comment
-test sel2 PROCEDURE root@localhost # # DEFINER
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test sel2 PROCEDURE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
show function status;
-Db Name Type Definer Modified Created Security_type Comment
-test sub1 FUNCTION root@localhost # # DEFINER
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test sub1 FUNCTION root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
select a.ROUTINE_NAME from information_schema.ROUTINES a,
information_schema.SCHEMATA b where
a.ROUTINE_SCHEMA = b.SCHEMA_NAME;
@@ -290,8 +289,8 @@ explain select a.ROUTINE_NAME from information_schema.ROUTINES a,
information_schema.SCHEMATA b where
a.ROUTINE_SCHEMA = b.SCHEMA_NAME;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE # ALL NULL NULL NULL NULL 2 Using join cache
-1 SIMPLE # ALL NULL NULL NULL NULL 2 Using where
+1 SIMPLE # ALL NULL NULL NULL NULL NULL
+1 SIMPLE # ALL NULL NULL NULL NULL NULL Using where; Using join buffer
select a.ROUTINE_NAME, b.name from information_schema.ROUTINES a,
mysql.proc b where a.ROUTINE_NAME = convert(b.name using utf8) order by 1;
ROUTINE_NAME name
@@ -328,26 +327,26 @@ sel2 NULL
sub1 NULL
sub2 return i+1
show create procedure sel2;
-Procedure sql_mode Create Procedure
-sel2 NULL
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+sel2 NULL latin1 latin1_swedish_ci latin1_swedish_ci
show create function sub1;
-Function sql_mode Create Function
-sub1 NULL
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+sub1 NULL latin1 latin1_swedish_ci latin1_swedish_ci
show create function sub2;
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
sub2 CREATE DEFINER=`mysqltest_1`@`localhost` FUNCTION `sub2`(i int) RETURNS int(11)
-return i+1
+return i+1 latin1 latin1_swedish_ci latin1_swedish_ci
show function status like "sub2";
-Db Name Type Definer Modified Created Security_type Comment
-test sub2 FUNCTION mysqltest_1@localhost # # DEFINER
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test sub2 FUNCTION mysqltest_1@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
drop function sub2;
show create procedure sel2;
-Procedure sql_mode Create Procedure
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
sel2 CREATE DEFINER=`root`@`localhost` PROCEDURE `sel2`()
begin
select * from t1;
select * from t2;
-end
+end latin1 latin1_swedish_ci latin1_swedish_ci
create view v0 (c) as select schema_name from information_schema.schemata;
select * from v0;
c
@@ -356,7 +355,7 @@ mysql
test
explain select * from v0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE # ALL NULL NULL NULL NULL 2
+1 SIMPLE # ALL NULL NULL NULL NULL NULL
create view v1 (c) as select table_name from information_schema.tables
where table_name="v1";
select * from v1;
@@ -387,12 +386,12 @@ latin1_spanish_ci
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
-NULL test v0 /* ALGORITHM=UNDEFINED */ select `schemata`.`SCHEMA_NAME` AS `c` from `information_schema`.`schemata` NONE NO root@localhost DEFINER
-NULL test v1 /* ALGORITHM=UNDEFINED */ select `tables`.`TABLE_NAME` AS `c` from `information_schema`.`tables` where (`tables`.`TABLE_NAME` = _utf8'v1') NONE NO root@localhost DEFINER
-NULL test v2 /* ALGORITHM=UNDEFINED */ select `columns`.`COLUMN_NAME` AS `c` from `information_schema`.`columns` where (`columns`.`TABLE_NAME` = _utf8'v2') NONE NO root@localhost DEFINER
-NULL test v3 /* ALGORITHM=UNDEFINED */ select `character_sets`.`CHARACTER_SET_NAME` AS `c` from `information_schema`.`character_sets` where (`character_sets`.`CHARACTER_SET_NAME` like _utf8'latin1%') NONE NO root@localhost DEFINER
-NULL test v4 /* ALGORITHM=UNDEFINED */ select `collations`.`COLLATION_NAME` AS `c` from `information_schema`.`collations` where (`collations`.`COLLATION_NAME` like _utf8'latin1%') NONE NO root@localhost DEFINER
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
+NULL test v0 select schema_name from information_schema.schemata NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+NULL test v1 select table_name from information_schema.tables NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+NULL test v2 select column_name from information_schema.columns NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+NULL test v3 select CHARACTER_SET_NAME from information_schema.character_sets NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+NULL test v4 select COLLATION_NAME from information_schema.collations 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;
@@ -484,10 +483,10 @@ create view v1 (c) as select a from t1 with check option;
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
-NULL test v1 /* ALGORITHM=UNDEFINED */ select `test`.`t1`.`a` AS `c` from `test`.`t1` CASCADED YES root@localhost DEFINER
-NULL test v2 /* ALGORITHM=UNDEFINED */ select `test`.`t1`.`a` AS `c` from `test`.`t1` LOCAL YES root@localhost DEFINER
-NULL test v3 /* ALGORITHM=UNDEFINED */ select `test`.`t1`.`a` AS `c` from `test`.`t1` CASCADED YES root@localhost DEFINER
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
+NULL test v1 select a from t1 with check option CASCADED YES root@localhost DEFINER latin1 latin1_swedish_ci
+NULL test v2 select a from t1 WITH LOCAL CHECK OPTION LOCAL YES root@localhost DEFINER latin1 latin1_swedish_ci
+NULL test v3 select a from t1 WITH CASCADED CHECK OPTION 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
@@ -587,6 +586,10 @@ 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')
proc comment char(64)
+proc character_set_client char(32)
+proc collation_connection char(32)
+proc db_collation char(32)
+proc body_utf8 longblob
drop table t115;
create procedure p108 () begin declare c cursor for select data_type
from information_schema.columns; open c; open c; end;//
@@ -676,17 +679,11 @@ where table_schema='test';
table_name
v2
v3
-Warnings:
-Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
-Warning 1356 View 'test.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select table_name from information_schema.views
where table_schema='test';
table_name
v2
v3
-Warnings:
-Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
-Warning 1356 View 'test.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select column_name from information_schema.columns
where table_schema='test';
column_name
@@ -701,13 +698,13 @@ select constraint_name from information_schema.table_constraints
where table_schema='test';
constraint_name
show create view v2;
-View Create View
-v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `test`.`t1`.`f1` AS `c` from `t1`
+View Create View character_set_client collation_connection
+v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `test`.`t1`.`f1` AS `c` from `t1` latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
show create table v3;
-View Create View
-v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `sub1`(1) AS `c`
+View Create View character_set_client collation_connection
+v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `sub1`(1) AS `c` latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'test.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
drop view v2;
@@ -762,7 +759,6 @@ information_schema COLUMNS COLUMN_DEFAULT
information_schema COLUMNS COLUMN_TYPE
information_schema EVENTS EVENT_DEFINITION
information_schema EVENTS SQL_MODE
-information_schema GLOBAL_VARIABLES VARIABLE_VALUE
information_schema PARTITIONS PARTITION_EXPRESSION
information_schema PARTITIONS SUBPARTITION_EXPRESSION
information_schema PARTITIONS PARTITION_DESCRIPTION
@@ -770,7 +766,6 @@ information_schema PLUGINS PLUGIN_DESCRIPTION
information_schema PROCESSLIST INFO
information_schema ROUTINES ROUTINE_DEFINITION
information_schema ROUTINES SQL_MODE
-information_schema SESSION_VARIABLES VARIABLE_VALUE
information_schema TRIGGERS ACTION_CONDITION
information_schema TRIGGERS ACTION_STATEMENT
information_schema TRIGGERS SQL_MODE
@@ -875,39 +870,39 @@ set @fired:= "Yes";
end if;
end|
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1 INSERT t1 begin
if new.j > 10 then
set new.j := 10;
end if;
-end BEFORE NULL root@localhost
+end BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
trg2 UPDATE t1 begin
if old.i % 2 = 0 then
set new.j := -1;
end if;
-end BEFORE NULL root@localhost
+end BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
trg3 UPDATE t1 begin
if new.j = -1 then
set @fired:= "Yes";
end if;
-end AFTER NULL root@localhost
+end AFTER NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
select * from information_schema.triggers;
-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
+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
if new.j > 10 then
set new.j := 10;
end if;
-end ROW BEFORE NULL NULL OLD NEW NULL root@localhost
+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
if old.i % 2 = 0 then
set new.j := -1;
end if;
-end ROW BEFORE NULL NULL OLD NEW NULL root@localhost
+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
if new.j = -1 then
set @fired:= "Yes";
end if;
-end ROW AFTER NULL NULL OLD NEW NULL root@localhost
+end ROW AFTER NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
drop trigger trg1;
drop trigger trg2;
drop trigger trg3;
@@ -1042,7 +1037,7 @@ b NULL
use test;
show columns from t1;
Field Type Null Key Default Extra
-a int(11) NO
+a int(11) NO NULL
b int(11) YES NULL
drop table t1;
CREATE TABLE t1 (a int);
@@ -1065,7 +1060,7 @@ c int(11) YES NULL
drop view v1;
drop table t1;
alter database information_schema;
-ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+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
drop database information_schema;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
drop table information_schema.tables;
@@ -1159,7 +1154,7 @@ drop table t1;
use mysql;
INSERT INTO `proc` VALUES ('test','','PROCEDURE','','SQL','CONTAINS_SQL',
'NO','DEFINER','','','BEGIN\r\n \r\nEND','root@%','2006-03-02 18:40:03',
-'2006-03-02 18:40:03','','');
+'2006-03-02 18:40:03','','','utf8','utf8_general_ci','utf8_general_ci','n/a');
select routine_name from information_schema.routines;
routine_name
@@ -1172,9 +1167,9 @@ create definer = mysqltest_1@localhost
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
-NULL test v1 NONE YES root@localhost DEFINER
-NULL test v2 /* ALGORITHM=UNDEFINED */ select 1 AS `1` NONE NO mysqltest_1@localhost DEFINER
+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 NONE NO mysqltest_1@localhost DEFINER latin1 latin1_swedish_ci
drop view v1, v2;
drop table t1;
drop user mysqltest_1@localhost;
@@ -1199,23 +1194,23 @@ ROUTINE_NAME ROUTINE_DEFINITION
f1 RETURN @a + 1
p1 SET @a= 1
SHOW CREATE PROCEDURE p1;
-Procedure sql_mode Create Procedure
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
-SET @a= 1
+SET @a= 1 latin1 latin1_swedish_ci latin1_swedish_ci
SHOW CREATE FUNCTION f1;
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
-RETURN @a + 1
+RETURN @a + 1 latin1 latin1_swedish_ci latin1_swedish_ci
SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES;
ROUTINE_NAME ROUTINE_DEFINITION
f1 NULL
p1 NULL
SHOW CREATE PROCEDURE p1;
-Procedure sql_mode Create Procedure
-p1 NULL
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p1 NULL latin1 latin1_swedish_ci latin1_swedish_ci
SHOW CREATE FUNCTION f1;
-Function sql_mode Create Function
-f1 NULL
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+f1 NULL latin1 latin1_swedish_ci latin1_swedish_ci
CALL p1();
SELECT f1();
f1()
@@ -1338,11 +1333,11 @@ from information_schema.tables
order by object_schema;
explain select * from v1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tables ALL NULL NULL NULL NULL 2 Using filesort
+1 SIMPLE tables ALL NULL NULL NULL NULL NULL Open_frm_only; Scanned all databases; Using filesort
explain select * from (select table_name from information_schema.tables) as a;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> system NULL NULL NULL NULL 0 const row not found
-2 DERIVED tables ALL NULL NULL NULL NULL 2
+2 DERIVED tables ALL NULL NULL NULL NULL NULL Skip_open_table; Scanned all databases
drop view v1;
create table t1 (f1 int(11));
create table t2 (f1 int(11), f2 int(11));
@@ -1403,10 +1398,81 @@ TABLE_PRIVILEGES information_schema.TABLE_PRIVILEGES 1
TRIGGERS information_schema.TRIGGERS 1
USER_PRIVILEGES information_schema.USER_PRIVILEGES 1
VIEWS information_schema.VIEWS 1
+create table t1(f1 int);
+create view v1 as select f1+1 as a from t1;
+create table t2 (f1 int, f2 int);
+create view v2 as select f1+1 as a, f2 as b from t2;
+select table_name, is_updatable from information_schema.views;
+table_name is_updatable
+v1 NO
+v2 YES
+delete from v1;
+drop view v1,v2;
+drop table t1,t2;
+alter database;
+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
+alter database test;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
+create database mysqltest;
+create table mysqltest.t1(a int, b int, c int);
+create trigger mysqltest.t1_ai after insert on mysqltest.t1
+for each row set @a = new.a + new.b + new.c;
+grant select(b) on mysqltest.t1 to mysqltest_1@localhost;
+select trigger_name from information_schema.triggers
+where event_object_table='t1';
+trigger_name
+t1_ai
+show triggers from mysqltest;
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+t1_ai INSERT t1 set @a = new.a + new.b + new.c AFTER NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+show columns from t1;
+Field Type Null Key Default Extra
+b int(11) YES NULL
+select column_name from information_schema.columns where table_name='t1';
+column_name
+b
+show triggers;
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+select trigger_name from information_schema.triggers
+where event_object_table='t1';
+trigger_name
+drop user mysqltest_1@localhost;
+drop database mysqltest;
+create table t1 (
+f1 varchar(50),
+f2 varchar(50) not null,
+f3 varchar(50) default '',
+f4 varchar(50) default NULL,
+f5 bigint not null,
+f6 bigint not null default 10,
+f7 datetime not null,
+f8 datetime default '2006-01-01'
+);
+select column_default from information_schema.columns where table_name= 't1';
+column_default
+NULL
+NULL
+
+NULL
+NULL
+10
+NULL
+2006-01-01 00:00:00
+show columns from t1;
+Field Type Null Key Default Extra
+f1 varchar(50) YES NULL
+f2 varchar(50) NO NULL
+f3 varchar(50) YES
+f4 varchar(50) YES NULL
+f5 bigint(20) NO NULL
+f6 bigint(20) NO 10
+f7 datetime NO NULL
+f8 datetime YES 2006-01-01 00:00:00
+drop table t1;
End of 5.0 tests.
select * from information_schema.engines WHERE ENGINE="MyISAM";
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-MyISAM ENABLED Default engine as of MySQL 3.23 with great performance NO NO NO
+MyISAM DEFAULT Default engine as of MySQL 3.23 with great performance NO NO NO
grant select on *.* to user3148@localhost;
select user,db from information_schema.processlist;
user db
@@ -1432,4 +1498,50 @@ ABORTED_CONNECTS
BINLOG_CACHE_DISK_USE
DROP TABLE server_status;
SET GLOBAL event_scheduler=0;
+explain select table_name from information_schema.views where
+table_schema='test' and table_name='v1';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE views ALL NULL TABLE_SCHEMA,TABLE_NAME NULL NULL NULL Using where; Open_frm_only; Scanned 0 databases
+explain select * from information_schema.tables;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE tables ALL NULL NULL NULL NULL NULL Open_full_table; Scanned all databases
+explain select * from information_schema.collations;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE collations ALL NULL NULL NULL NULL NULL
+explain select * from information_schema.tables where
+table_schema='test' and table_name= 't1';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE tables ALL NULL TABLE_SCHEMA,TABLE_NAME NULL NULL NULL Using where; Open_full_table; Scanned 0 databases
+explain select table_name, table_type from information_schema.tables
+where table_schema='test';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE tables ALL NULL TABLE_SCHEMA NULL NULL NULL Using where; Open_frm_only; Scanned 1 database
+explain select b.table_name
+from information_schema.tables a, information_schema.columns b
+where a.table_name='t1' and a.table_schema='test' and b.table_name=a.table_name;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE a ALL NULL TABLE_SCHEMA,TABLE_NAME NULL NULL NULL Using where; Skip_open_table; Scanned 0 databases
+1 SIMPLE b ALL NULL NULL NULL NULL NULL Using where; Open_frm_only; Scanned all databases; Using join buffer
+SELECT * FROM INFORMATION_SCHEMA.SCHEMATA
+WHERE SCHEMA_NAME = 'mysqltest';
+CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
+SELECT * FROM INFORMATION_SCHEMA.SCHEMATA
+WHERE SCHEMA_NAME = '';
+CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
+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
+select count(*) from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysql' AND TABLE_NAME='nonexisting';
+count(*)
+0
+select count(*) from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysql' AND TABLE_NAME='';
+count(*)
+0
+select count(*) from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='' AND TABLE_NAME='';
+count(*)
+0
+select count(*) from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='' AND TABLE_NAME='nonexisting';
+count(*)
+0
End of 5.1 tests.
diff --git a/mysql-test/r/information_schema_db.result b/mysql-test/r/information_schema_db.result
index c0708694178..2be2928001f 100644
--- a/mysql-test/r/information_schema_db.result
+++ b/mysql-test/r/information_schema_db.result
@@ -75,11 +75,11 @@ drop table t1;
select table_name, table_type, table_comment from information_schema.tables
where table_schema='inf%' and func2();
table_name table_type table_comment
-v1 VIEW View 'inf%.v1' references invalid table(s) or column(s) or function(s) or define
+v1 VIEW VIEW
select table_name, table_type, table_comment from information_schema.tables
where table_schema='inf%' and func2();
table_name table_type table_comment
-v1 VIEW View 'inf%.v1' references invalid table(s) or column(s) or function(s) or define
+v1 VIEW VIEW
drop view v1;
drop function func1;
drop function func2;
@@ -133,11 +133,11 @@ 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
-v6 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v6` AS select `t1`.`f1` AS `f1` from `t1`
+View Create View character_set_client collation_connection
+v6 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v6` AS select `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
show create view testdb_1.v7;
-View Create View
-v7 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such_user`@`no_such_host` SQL SECURITY DEFINER VIEW `v7` AS select `testdb_1`.`t2`.`f1` AS `f1` from `t2`
+View Create View character_set_client collation_connection
+v7 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such_user`@`no_such_host` SQL SECURITY DEFINER VIEW `v7` AS select `testdb_1`.`t2`.`f1` AS `f1` from `t2` latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'testdb_1.v7' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
show fields from testdb_1.v7;
@@ -152,24 +152,22 @@ 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
-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`
+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
-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`
+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
show fields from testdb_1.v7;
Field Type Null Key Default Extra
f1 null YES NULL
Warnings:
Note 1449 There is no 'no_such_user'@'no_such_host' registered
show create view testdb_1.v7;
-View Create View
-v7 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such_user`@`no_such_host` SQL SECURITY DEFINER VIEW `v7` AS select `testdb_1`.`t2`.`f1` AS `f1` from `t2`
+View Create View character_set_client collation_connection
+v7 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such_user`@`no_such_host` SQL SECURITY DEFINER VIEW `v7` AS select `testdb_1`.`t2`.`f1` AS `f1` from `t2` latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'testdb_1.v7' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
revoke insert(f1) on v3 from testdb_2@localhost;
@@ -201,8 +199,8 @@ show fields from testdb_1.v1;
Field Type Null Key Default Extra
f1 char(4) YES NULL
show create view v2;
-View Create View
-v2 CREATE ALGORITHM=UNDEFINED DEFINER=`testdb_2`@`localhost` SQL SECURITY DEFINER VIEW `test`.`v2` AS select `v1`.`f1` AS `f1` from `testdb_1`.`v1`
+View Create View character_set_client collation_connection
+v2 CREATE ALGORITHM=UNDEFINED DEFINER=`testdb_2`@`localhost` SQL SECURITY DEFINER VIEW `test`.`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'
select table_name from information_schema.columns a
@@ -212,7 +210,7 @@ v2
select view_definition from information_schema.views a
where a.table_name = 'v2';
view_definition
-/* ALGORITHM=UNDEFINED */ select `v1`.`f1` AS `f1` from `testdb_1`.`v1`
+select f1 from testdb_1.v1
select view_definition from information_schema.views a
where a.table_name = 'testdb_1.v1';
view_definition
diff --git a/mysql-test/r/information_schema_part.result b/mysql-test/r/information_schema_part.result
index df3abdbee0a..8455c8e014e 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 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 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 default ts3
+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
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 default ts1
-NULL test t2 x2 NULL 2 NULL RANGE NULL a NULL 10 0 0 0 # 1024 0 # # NULL NULL default default ts2
-NULL test t2 x3 NULL 3 NULL RANGE NULL a NULL MAXVALUE 0 0 0 # 1024 0 # # NULL NULL default default ts3
+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
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 default NULL
-NULL test t3 p1 NULL 2 NULL HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default default NULL
-NULL test t3 p2 NULL 3 NULL HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default default NULL
+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
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 default NULL
-NULL test t4 p1 NULL 2 NULL KEY NULL f1,f2 NULL NULL 0 0 0 # 1024 0 # # NULL NULL default default NULL
-NULL test t4 p2 NULL 3 NULL KEY NULL f1,f2 NULL NULL 0 0 0 # 1024 0 # # NULL NULL default default NULL
+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
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 default t1
-NULL test t1 x1 x12 1 2 RANGE HASH a a+b 1 0 0 0 # 1024 0 # # NULL NULL default default t2
-NULL test t1 x2 x21 2 1 RANGE HASH a a+b 5 0 0 0 # 1024 0 # # NULL NULL default default t1
-NULL test t1 x2 x22 2 2 RANGE HASH a a+b 5 0 0 0 # 1024 0 # # NULL NULL default default t2
-NULL test t2 x1 x11 1 1 RANGE KEY a a 1 0 0 0 # 1024 0 # # NULL NULL default default t1
-NULL test t2 x1 x12 1 2 RANGE KEY a a 1 0 0 0 # 1024 0 # # NULL NULL default default t2
-NULL test t2 x2 x21 2 1 RANGE KEY a a 5 0 0 0 # 1024 0 # # NULL NULL default default t1
-NULL test t2 x2 x22 2 2 RANGE KEY a a 5 0 0 0 # 1024 0 # # NULL NULL default default t2
+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
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 default 0 t1
-NULL test t1 x1 x12 1 2 RANGE HASH a a+b 1 0 0 0 # 1024 0 # # NULL NULL default 1 t2
-NULL test t1 x2 x21 2 1 RANGE HASH a a+b 5 0 0 0 # 1024 0 # # NULL NULL default 0 t1
-NULL test t1 x2 x22 2 2 RANGE HASH a a+b 5 0 0 0 # 1024 0 # # NULL NULL default 1 t2
+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
show tables;
Tables_in_test
t1
@@ -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 default NULL
-NULL test t1 p1 NULL 2 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default default NULL
-NULL test t1 p2 NULL 3 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default default NULL
+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
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 8ba70ffd535..d0b67e90afb 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -501,7 +501,7 @@ ERROR 23000: Duplicate entry 'test2' for key 'ggid'
select * from t1;
id ggid email passwd
1 this will work
-3 test2 this will work
+4 test2 this will work
select * from t1 where id=1;
id ggid email passwd
1 this will work
@@ -947,7 +947,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL PRIMARY 4 NULL #
explain select * from t1 order by b;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL b 4 NULL #
+1 SIMPLE t1 ALL NULL NULL NULL NULL # Using filesort
explain select * from t1 order by c;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL # Using filesort
@@ -1607,7 +1607,7 @@ t2 CREATE TABLE `t2` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t2;
create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb;
-ERROR HY000: Can't create table 'test.t2' (errno: 150)
+ERROR 42000: Incorrect foreign key definition for 't1_id_fk': Key reference and table reference don't match
create table t2 (a int auto_increment primary key, b int, index(b), foreign key (b) references t1(id), unique(b)) engine=innodb;
show create table t2;
Table Create Table
@@ -1632,30 +1632,6 @@ t2 CREATE TABLE `t2` (
CONSTRAINT `t2_ibfk_2` FOREIGN KEY (`b`) REFERENCES `t1` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t2, t1;
-flush status;
-show status like "binlog_cache_use";
-Variable_name Value
-Binlog_cache_use 0
-show status like "binlog_cache_disk_use";
-Variable_name Value
-Binlog_cache_disk_use 0
-create table t1 (a int) engine=innodb;
-show status like "binlog_cache_use";
-Variable_name Value
-Binlog_cache_use 1
-show status like "binlog_cache_disk_use";
-Variable_name Value
-Binlog_cache_disk_use 1
-begin;
-delete from t1;
-commit;
-show status like "binlog_cache_use";
-Variable_name Value
-Binlog_cache_use 2
-show status like "binlog_cache_disk_use";
-Variable_name Value
-Binlog_cache_disk_use 1
-drop table t1;
create table t1 (c char(10), index (c,c)) engine=innodb;
ERROR 42S21: Duplicate column name 'c'
create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)) engine=innodb;
@@ -1775,10 +1751,10 @@ Variable_name Value
Innodb_page_size 16384
show status like "Innodb_rows_deleted";
Variable_name Value
-Innodb_rows_deleted 2070
+Innodb_rows_deleted 70
show status like "Innodb_rows_inserted";
Variable_name Value
-Innodb_rows_inserted 3083
+Innodb_rows_inserted 1083
show status like "Innodb_rows_updated";
Variable_name Value
Innodb_rows_updated 886
@@ -3202,3 +3178,14 @@ t1 CREATE TABLE `t1` (
CONSTRAINT `t1_t2` FOREIGN KEY (`id`) REFERENCES `t2` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=349 DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
+CREATE TABLE t1 (
+c01 CHAR(255), c02 CHAR(255), c03 CHAR(255), c04 CHAR(255),
+c05 CHAR(255), c06 CHAR(255), c07 CHAR(255), c08 CHAR(255),
+c09 CHAR(255), c10 CHAR(255), c11 CHAR(255), c12 CHAR(255),
+c13 CHAR(255), c14 CHAR(255), c15 CHAR(255), c16 CHAR(255),
+c17 CHAR(255), c18 CHAR(255), c19 CHAR(255), c20 CHAR(255),
+c21 CHAR(255), c22 CHAR(255), c23 CHAR(255), c24 CHAR(255),
+c25 CHAR(255), c26 CHAR(255), c27 CHAR(255), c28 CHAR(255),
+c29 CHAR(255), c30 CHAR(255), c31 CHAR(255), c32 CHAR(255)
+) ENGINE = InnoDB;
+ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
diff --git a/mysql-test/r/innodb_gis.result b/mysql-test/r/innodb_gis.result
index 945eca234bb..7f54a78087b 100644
--- a/mysql-test/r/innodb_gis.result
+++ b/mysql-test/r/innodb_gis.result
@@ -402,8 +402,8 @@ Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE g1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort; Using join cache
-1 SIMPLE g2 ALL NULL NULL NULL NULL 2 100.00
+1 SIMPLE g1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort
+1 SIMPLE g2 ALL NULL NULL NULL NULL 2 100.00 Using join buffer
Warnings:
Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,overlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,equals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,disjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,intersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid`
DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result
index 36d6f62c72c..0757936a8f7 100644
--- a/mysql-test/r/innodb_mysql.result
+++ b/mysql-test/r/innodb_mysql.result
@@ -1,5 +1,5 @@
SET SESSION STORAGE_ENGINE = InnoDB;
-drop table if exists t1,t2,t1m,t1i,t2m,t2i,t4;
+drop table if exists t1,t2,t3,t1m,t1i,t2m,t2i,t4;
create table t1 (
c_id int(11) not null default '0',
org_id int(11) default null,
@@ -145,7 +145,27 @@ SELECT * FROM t1;
c1 cnt
1a 2
DROP TABLE t1;
-End of 4.1 tests
+CREATE TABLE t1 (
+a1 decimal(10,0) DEFAULT NULL,
+a2 blob,
+a3 time DEFAULT NULL,
+a4 blob,
+a5 char(175) DEFAULT NULL,
+a6 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+a7 tinyblob,
+INDEX idx (a6,a7(239),a5)
+) ENGINE=InnoDB;
+EXPLAIN SELECT a4 FROM t1 WHERE
+a6=NULL AND
+a4='UNcT5pIde4I6c2SheTo4gt92OV1jgJCVkXmzyf325R1DwLURkbYHwhydANIZMbKTgdcR5xS';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+EXPLAIN SELECT t1.a4 FROM t1, t1 t WHERE
+t.a6=t.a6 AND t1.a6=NULL AND
+t1.a4='UNcT5pIde4I6c2SheTo4gt92OV1jgJCVkXmzyf325R1DwLURkbYHwhydANIZMbKTgdcR5xS';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+DROP TABLE t1;
create table t1m (a int) engine = MEMORY;
create table t1i (a int);
create table t2m (a int) engine = MEMORY;
@@ -163,8 +183,8 @@ min(7)
7
explain select min(7) from t2i join t1i;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2i ALL NULL NULL NULL NULL 1 Using join cache
-1 SIMPLE t1i ALL NULL NULL NULL NULL 1
+1 SIMPLE t2i ALL NULL NULL NULL NULL 1
+1 SIMPLE t1i ALL NULL NULL NULL NULL 1 Using join buffer
select min(7) from t2i join t1i;
min(7)
NULL
@@ -179,8 +199,8 @@ max(7)
7
explain select max(7) from t2i join t1i;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2i ALL NULL NULL NULL NULL 1 Using join cache
-1 SIMPLE t1i ALL NULL NULL NULL NULL 1
+1 SIMPLE t2i ALL NULL NULL NULL NULL 1
+1 SIMPLE t1i ALL NULL NULL NULL NULL 1 Using join buffer
select max(7) from t2i join t1i;
max(7)
NULL
@@ -341,22 +361,6 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index NULL fkey 5 NULL 5 Using index
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.fkey 1 Using where
DROP TABLE t1,t2;
-CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c FLOAT, KEY b(b)) ENGINE = INNODB;
-INSERT INTO t1 VALUES ( 1 , 1 , 1);
-INSERT INTO t1 SELECT a + 1 , MOD(a + 1 , 20), 1 FROM t1;
-INSERT INTO t1 SELECT a + 2 , MOD(a + 2 , 20), 1 FROM t1;
-INSERT INTO t1 SELECT a + 4 , MOD(a + 4 , 20), 1 FROM t1;
-INSERT INTO t1 SELECT a + 8 , MOD(a + 8 , 20), 1 FROM t1;
-INSERT INTO t1 SELECT a + 16, MOD(a + 16, 20), 1 FROM t1;
-INSERT INTO t1 SELECT a + 32, MOD(a + 32, 20), 1 FROM t1;
-INSERT INTO t1 SELECT a + 64, MOD(a + 64, 20), 1 FROM t1;
-EXPLAIN SELECT b, SUM(c) FROM t1 GROUP BY b;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL b 5 NULL 128
-EXPLAIN SELECT SQL_BIG_RESULT b, SUM(c) FROM t1 GROUP BY b;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 128 Using filesort
-DROP TABLE t1;
CREATE TABLE t1 (
id int NOT NULL,
name varchar(20) NOT NULL,
@@ -482,33 +486,6 @@ a
2
5
drop table t1;
-set @save_qcache_size=@@global.query_cache_size;
-set @save_qcache_type=@@global.query_cache_type;
-set global query_cache_size=10*1024*1024;
-set global query_cache_type=1;
-drop table if exists `test`;
-Warnings:
-Note 1051 Unknown table 'test'
-CREATE TABLE `test` (`test1` varchar(3) NOT NULL,
-`test2` varchar(4) NOT NULL,PRIMARY KEY (`test1`))
-ENGINE=InnoDB DEFAULT CHARSET=latin1;
-INSERT INTO `test` (`test1`, `test2`) VALUES ('tes', '5678');
-select * from test;
-test1 test2
-tes 5678
-INSERT INTO `test` (`test1`, `test2`) VALUES ('tes', '1234')
-ON DUPLICATE KEY UPDATE `test2` = '1234';
-select * from test;
-test1 test2
-tes 1234
-flush tables;
-select * from test;
-test1 test2
-tes 1234
-drop table test;
-set global query_cache_type=@save_qcache_type;
-set global query_cache_size=@save_qcache_size;
-End of 5.0 tests
create table t1(
id int auto_increment,
c char(1) not null,
@@ -548,7 +525,176 @@ id c counter
3 b 2
4 a 2
drop table t1;
-End of 5.0 tests
+CREATE TABLE t1(
+id int AUTO_INCREMENT PRIMARY KEY,
+stat_id int NOT NULL,
+acct_id int DEFAULT NULL,
+INDEX idx1 (stat_id, acct_id),
+INDEX idx2 (acct_id)
+) ENGINE=MyISAM;
+CREATE TABLE t2(
+id int AUTO_INCREMENT PRIMARY KEY,
+stat_id int NOT NULL,
+acct_id int DEFAULT NULL,
+INDEX idx1 (stat_id, acct_id),
+INDEX idx2 (acct_id)
+) ENGINE=InnoDB;
+INSERT INTO t1(stat_id,acct_id) VALUES
+(1,759), (2,831), (3,785), (4,854), (1,921),
+(1,553), (2,589), (3,743), (2,827), (2,545),
+(4,779), (4,783), (1,597), (1,785), (4,832),
+(1,741), (1,833), (3,788), (2,973), (1,907);
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+UPDATE t1 SET acct_id=785
+WHERE MOD(stat_id,2)=0 AND MOD(id,stat_id)=MOD(acct_id,stat_id);
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+40960
+SELECT COUNT(*) FROM t1 WHERE acct_id=785;
+COUNT(*)
+8702
+EXPLAIN SELECT COUNT(*) FROM t1 WHERE stat_id IN (1,3) AND acct_id=785;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range idx1,idx2 idx1 9 NULL 2 Using where; Using index
+INSERT INTO t2 SELECT * FROM t1;
+OPTIMIZE TABLE t2;
+Table Op Msg_type Msg_text
+test.t2 optimize status OK
+EXPLAIN SELECT COUNT(*) FROM t2 WHERE stat_id IN (1,3) AND acct_id=785;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range idx1,idx2 idx1 9 NULL 2 Using where; Using index
+DROP TABLE t1,t2;
+create table t1(a int) engine=innodb;
+alter table t1 comment '123';
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='123'
+drop table t1;
+CREATE TABLE t1 (a CHAR(2), KEY (a)) ENGINE = InnoDB DEFAULT CHARSET=UTF8;
+INSERT INTO t1 VALUES ('uk'),('bg');
+SELECT * FROM t1 WHERE a = 'uk';
+a
+uk
+DELETE FROM t1 WHERE a = 'uk';
+SELECT * FROM t1 WHERE a = 'uk';
+a
+UPDATE t1 SET a = 'us' WHERE a = 'uk';
+SELECT * FROM t1 WHERE a = 'uk';
+a
+CREATE TABLE t2 (a CHAR(2), KEY (a)) ENGINE = InnoDB;
+INSERT INTO t2 VALUES ('uk'),('bg');
+SELECT * FROM t2 WHERE a = 'uk';
+a
+uk
+DELETE FROM t2 WHERE a = 'uk';
+SELECT * FROM t2 WHERE a = 'uk';
+a
+INSERT INTO t2 VALUES ('uk');
+UPDATE t2 SET a = 'us' WHERE a = 'uk';
+SELECT * FROM t2 WHERE a = 'uk';
+a
+CREATE TABLE t3 (a CHAR(2), KEY (a)) ENGINE = MyISAM;
+INSERT INTO t3 VALUES ('uk'),('bg');
+SELECT * FROM t3 WHERE a = 'uk';
+a
+uk
+DELETE FROM t3 WHERE a = 'uk';
+SELECT * FROM t3 WHERE a = 'uk';
+a
+INSERT INTO t3 VALUES ('uk');
+UPDATE t3 SET a = 'us' WHERE a = 'uk';
+SELECT * FROM t3 WHERE a = 'uk';
+a
+DROP TABLE t1,t2,t3;
+create table t1 (a int) engine=innodb;
+select * from bug29807;
+ERROR 42S02: Table 'test.bug29807' doesn't exist
+drop table t1;
+drop table bug29807;
+ERROR 42S02: Unknown table 'bug29807'
+create table bug29807 (a int);
+drop table bug29807;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+CREATE TABLE t2 (a INT) ENGINE=InnoDB;
+switch to connection c1
+SET AUTOCOMMIT=0;
+INSERT INTO t2 VALUES (1);
+switch to connection c2
+SET AUTOCOMMIT=0;
+LOCK TABLES t1 READ, t2 READ;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+switch to connection c1
+COMMIT;
+INSERT INTO t1 VALUES (1);
+switch to connection default
+SET AUTOCOMMIT=default;
+DROP TABLE t1,t2;
+CREATE TABLE t1 (
+id int NOT NULL auto_increment PRIMARY KEY,
+b int NOT NULL,
+c datetime NOT NULL,
+INDEX idx_b(b),
+INDEX idx_c(c)
+) ENGINE=InnoDB;
+CREATE TABLE t2 (
+b int NOT NULL auto_increment PRIMARY KEY,
+c datetime NOT NULL
+) ENGINE= MyISAM;
+INSERT INTO t2(c) VALUES ('2007-01-01');
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t1(b,c) SELECT b,c FROM t2;
+UPDATE t2 SET c='2007-01-02';
+INSERT INTO t1(b,c) SELECT b,c FROM t2;
+UPDATE t2 SET c='2007-01-03';
+INSERT INTO t1(b,c) SELECT b,c FROM t2;
+set @@sort_buffer_size=8192;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+3072
+EXPLAIN
+SELECT COUNT(*) FROM t1
+WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL idx_b,idx_c NULL NULL NULL # Using where
+SELECT COUNT(*) FROM t1
+WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1;
+COUNT(*)
+3072
+EXPLAIN
+SELECT COUNT(*) FROM t1 FORCE INDEX(idx_b, idx_c)
+WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index_merge idx_b,idx_c idx_c,idx_b 8,4 NULL # Using sort_union(idx_c,idx_b); Using where
+SELECT COUNT(*) FROM t1 FORCE INDEX(idx_b, idx_c)
+WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1;
+COUNT(*)
+3072
+set @@sort_buffer_size=default;
+DROP TABLE t1,t2;
CREATE TABLE t1 (a int, b int);
insert into t1 values (1,1),(1,2);
CREATE TABLE t2 (primary key (a)) select * from t1;
@@ -609,7 +755,7 @@ drop table t1,t2;
create table t1(f1 varchar(800) binary not null, key(f1))
character set utf8 collate utf8_general_ci;
Warnings:
-Warning 1071 Specified key was too long; max key length is 765 bytes
+Warning 1071 Specified key was too long; max key length is 767 bytes
insert into t1 values('aaa');
drop table t1;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c FLOAT, KEY b(b)) ENGINE = INNODB;
@@ -664,6 +810,483 @@ a
2
5
drop table t1;
+drop table if exists t1;
+create table t1 (a int) engine=innodb;
+alter table t1 alter a set default 1;
+drop table t1;
+
+Bug#24918 drop table and lock / inconsistent between
+perm and temp tables
+
+Check transactional tables under LOCK TABLES
+
+drop table if exists t24918, t24918_tmp, t24918_trans, t24918_trans_tmp,
+t24918_access;
+create table t24918_access (id int);
+create table t24918 (id int) engine=myisam;
+create temporary table t24918_tmp (id int) engine=myisam;
+create table t24918_trans (id int) engine=innodb;
+create temporary table t24918_trans_tmp (id int) engine=innodb;
+lock table t24918 write, t24918_tmp write, t24918_trans write, t24918_trans_tmp write;
+drop table t24918;
+select * from t24918_access;
+ERROR HY000: Table 't24918_access' was not locked with LOCK TABLES
+drop table t24918_trans;
+select * from t24918_access;
+ERROR HY000: Table 't24918_access' was not locked with LOCK TABLES
+drop table t24918_trans_tmp;
+select * from t24918_access;
+ERROR HY000: Table 't24918_access' was not locked with LOCK TABLES
+drop table t24918_tmp;
+select * from t24918_access;
+ERROR HY000: Table 't24918_access' was not locked with LOCK TABLES
+unlock tables;
+drop table t24918_access;
+CREATE TABLE t1 (a int, b int, PRIMARY KEY (a), KEY bkey (b)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,2),(3,2),(2,2),(4,2),(5,2),(6,2),(7,2),(8,2);
+INSERT INTO t1 SELECT a + 8, 2 FROM t1;
+INSERT INTO t1 SELECT a + 16, 1 FROM t1;
+EXPLAIN SELECT * FROM t1 WHERE b=2 ORDER BY a;
+id 1
+select_type SIMPLE
+table t1
+type ref
+possible_keys bkey
+key bkey
+key_len 5
+ref const
+rows 16
+Extra Using where; Using index
+SELECT * FROM t1 WHERE b=2 ORDER BY a;
+a b
+1 2
+2 2
+3 2
+4 2
+5 2
+6 2
+7 2
+8 2
+9 2
+10 2
+11 2
+12 2
+13 2
+14 2
+15 2
+16 2
+EXPLAIN SELECT * FROM t1 WHERE b BETWEEN 1 AND 2 ORDER BY a;
+id 1
+select_type SIMPLE
+table t1
+type index
+possible_keys bkey
+key PRIMARY
+key_len 4
+ref NULL
+rows 32
+Extra Using where
+SELECT * FROM t1 WHERE b BETWEEN 1 AND 2 ORDER BY a;
+a b
+1 2
+2 2
+3 2
+4 2
+5 2
+6 2
+7 2
+8 2
+9 2
+10 2
+11 2
+12 2
+13 2
+14 2
+15 2
+16 2
+17 1
+18 1
+19 1
+20 1
+21 1
+22 1
+23 1
+24 1
+25 1
+26 1
+27 1
+28 1
+29 1
+30 1
+31 1
+32 1
+EXPLAIN SELECT * FROM t1 WHERE b BETWEEN 1 AND 2 ORDER BY b,a;
+id 1
+select_type SIMPLE
+table t1
+type range
+possible_keys bkey
+key bkey
+key_len 5
+ref NULL
+rows 16
+Extra Using where; Using index
+SELECT * FROM t1 WHERE b BETWEEN 1 AND 2 ORDER BY b,a;
+a b
+17 1
+18 1
+19 1
+20 1
+21 1
+22 1
+23 1
+24 1
+25 1
+26 1
+27 1
+28 1
+29 1
+30 1
+31 1
+32 1
+1 2
+2 2
+3 2
+4 2
+5 2
+6 2
+7 2
+8 2
+9 2
+10 2
+11 2
+12 2
+13 2
+14 2
+15 2
+16 2
+CREATE TABLE t2 (a int, b int, c int, PRIMARY KEY (a), KEY bkey (b,c))
+ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1,1,1),(3,1,1),(2,1,1),(4,1,1);
+INSERT INTO t2 SELECT a + 4, 1, 1 FROM t2;
+INSERT INTO t2 SELECT a + 8, 1, 1 FROM t2;
+EXPLAIN SELECT * FROM t2 WHERE b=1 ORDER BY a;
+id 1
+select_type SIMPLE
+table t2
+type index
+possible_keys bkey
+key PRIMARY
+key_len 4
+ref NULL
+rows 16
+Extra Using where; Using index
+SELECT * FROM t2 WHERE b=1 ORDER BY a;
+a b c
+1 1 1
+2 1 1
+3 1 1
+4 1 1
+5 1 1
+6 1 1
+7 1 1
+8 1 1
+9 1 1
+10 1 1
+11 1 1
+12 1 1
+13 1 1
+14 1 1
+15 1 1
+16 1 1
+EXPLAIN SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY a;
+id 1
+select_type SIMPLE
+table t2
+type ref
+possible_keys bkey
+key bkey
+key_len 10
+ref const,const
+rows 8
+Extra Using where; Using index
+SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY a;
+a b c
+1 1 1
+2 1 1
+3 1 1
+4 1 1
+5 1 1
+6 1 1
+7 1 1
+8 1 1
+9 1 1
+10 1 1
+11 1 1
+12 1 1
+13 1 1
+14 1 1
+15 1 1
+16 1 1
+EXPLAIN SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY b,c,a;
+id 1
+select_type SIMPLE
+table t2
+type ref
+possible_keys bkey
+key bkey
+key_len 10
+ref const,const
+rows 8
+Extra Using where; Using index
+SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY b,c,a;
+a b c
+1 1 1
+2 1 1
+3 1 1
+4 1 1
+5 1 1
+6 1 1
+7 1 1
+8 1 1
+9 1 1
+10 1 1
+11 1 1
+12 1 1
+13 1 1
+14 1 1
+15 1 1
+16 1 1
+EXPLAIN SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY c,a;
+id 1
+select_type SIMPLE
+table t2
+type ref
+possible_keys bkey
+key bkey
+key_len 10
+ref const,const
+rows 8
+Extra Using where; Using index
+SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY c,a;
+a b c
+1 1 1
+2 1 1
+3 1 1
+4 1 1
+5 1 1
+6 1 1
+7 1 1
+8 1 1
+9 1 1
+10 1 1
+11 1 1
+12 1 1
+13 1 1
+14 1 1
+15 1 1
+16 1 1
+DROP TABLE t1,t2;
+CREATE TABLE t1 (a INT, PRIMARY KEY (a)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8);
+INSERT INTO t1 SELECT a + 8 FROM t1;
+INSERT INTO t1 SELECT a + 16 FROM t1;
+CREATE PROCEDURE p1 ()
+BEGIN
+DECLARE i INT DEFAULT 50;
+DECLARE cnt INT;
+START TRANSACTION;
+ALTER TABLE t1 ENGINE=InnoDB;
+COMMIT;
+START TRANSACTION;
+WHILE (i > 0) DO
+SET i = i - 1;
+SELECT COUNT(*) INTO cnt FROM t1 LOCK IN SHARE MODE;
+END WHILE;
+COMMIT;
+END;|
+CALL p1();
+CALL p1();
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+create table t1(a text) engine=innodb default charset=utf8;
+insert into t1 values('aaa');
+alter table t1 add index(a(1024));
+Warnings:
+Warning 1071 Specified key was too long; max key length is 767 bytes
+Warning 1071 Specified key was too long; max key length is 767 bytes
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` text,
+ KEY `a` (`a`(255))
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+drop table t1;
+CREATE TABLE t1 (
+a INT,
+b INT,
+KEY (b)
+) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,10), (2,10), (2,20), (3,30);
+START TRANSACTION;
+SELECT * FROM t1 WHERE b=20 FOR UPDATE;
+a b
+2 20
+START TRANSACTION;
+SELECT * FROM t1 WHERE b=10 ORDER BY A FOR UPDATE;
+a b
+1 10
+2 10
+ROLLBACK;
+ROLLBACK;
+DROP TABLE t1;
+CREATE TABLE t1(
+a INT,
+b INT NOT NULL,
+c INT NOT NULL,
+d INT,
+UNIQUE KEY (c,b)
+) engine=innodb;
+INSERT INTO t1 VALUES (1,1,1,50), (1,2,3,40), (2,1,3,4);
+EXPLAIN SELECT c,b,d FROM t1 GROUP BY c,b,d;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using filesort
+SELECT c,b,d FROM t1 GROUP BY c,b,d;
+c b d
+1 1 50
+3 1 4
+3 2 40
+EXPLAIN SELECT c,b,d FROM t1 GROUP BY c,b,d ORDER BY NULL;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3
+SELECT c,b,d FROM t1 GROUP BY c,b,d ORDER BY NULL;
+c b d
+1 1 50
+3 1 4
+3 2 40
+EXPLAIN SELECT c,b,d FROM t1 ORDER BY c,b,d;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using filesort
+SELECT c,b,d FROM t1 ORDER BY c,b,d;
+c b d
+1 1 50
+3 1 4
+3 2 40
+EXPLAIN SELECT c,b,d FROM t1 GROUP BY c,b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL c 8 NULL 3
+SELECT c,b,d FROM t1 GROUP BY c,b;
+c b d
+1 1 50
+3 1 4
+3 2 40
+EXPLAIN SELECT c,b FROM t1 GROUP BY c,b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL c 8 NULL 3 Using index
+SELECT c,b FROM t1 GROUP BY c,b;
+c b
+1 1
+3 1
+3 2
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a), INDEX b (b)) ENGINE=InnoDB;
+INSERT INTO t1(a,b) VALUES (1,1), (2,2), (3,2);
+EXPLAIN SELECT * FROM t1 WHERE b=2 ORDER BY a ASC;
+id 1
+select_type SIMPLE
+table t1
+type ref
+possible_keys b
+key b
+key_len 5
+ref const
+rows 1
+Extra Using where; Using index
+SELECT * FROM t1 WHERE b=2 ORDER BY a ASC;
+a b
+2 2
+3 2
+EXPLAIN SELECT * FROM t1 WHERE b=2 ORDER BY a DESC;
+id 1
+select_type SIMPLE
+table t1
+type ref
+possible_keys b
+key b
+key_len 5
+ref const
+rows 1
+Extra Using where; Using index
+SELECT * FROM t1 WHERE b=2 ORDER BY a DESC;
+a b
+3 2
+2 2
+EXPLAIN SELECT * FROM t1 ORDER BY b ASC, a ASC;
+id 1
+select_type SIMPLE
+table t1
+type index
+possible_keys NULL
+key b
+key_len 5
+ref NULL
+rows 3
+Extra Using index
+SELECT * FROM t1 ORDER BY b ASC, a ASC;
+a b
+1 1
+2 2
+3 2
+EXPLAIN SELECT * FROM t1 ORDER BY b DESC, a DESC;
+id 1
+select_type SIMPLE
+table t1
+type index
+possible_keys NULL
+key b
+key_len 5
+ref NULL
+rows 3
+Extra Using index
+SELECT * FROM t1 ORDER BY b DESC, a DESC;
+a b
+3 2
+2 2
+1 1
+EXPLAIN SELECT * FROM t1 ORDER BY b ASC, a DESC;
+id 1
+select_type SIMPLE
+table t1
+type index
+possible_keys NULL
+key b
+key_len 5
+ref NULL
+rows 3
+Extra Using index; Using filesort
+SELECT * FROM t1 ORDER BY b ASC, a DESC;
+a b
+1 1
+3 2
+2 2
+EXPLAIN SELECT * FROM t1 ORDER BY b DESC, a ASC;
+id 1
+select_type SIMPLE
+table t1
+type index
+possible_keys NULL
+key b
+key_len 5
+ref NULL
+rows 3
+Extra Using index; Using filesort
+SELECT * FROM t1 ORDER BY b DESC, a ASC;
+a b
+2 2
+3 2
+1 1
+DROP TABLE t1;
End of 5.0 tests
CREATE TABLE `t2` (
`k` int(11) NOT NULL auto_increment,
@@ -733,4 +1356,67 @@ k a c
11 15 1
12 20 1
drop table t2;
+drop table if exists t1, t2;
+create table t1 (i int);
+alter table t1 modify i int default 1;
+alter table t1 modify i int default 2, rename t2;
+lock table t2 write;
+alter table t2 modify i int default 3;
+unlock tables;
+lock table t2 write;
+alter table t2 modify i int default 4, rename t1;
+unlock tables;
+drop table t1;
+drop table if exists t1;
+create table t1 (i int);
+insert into t1 values ();
+lock table t1 write;
+alter table t1 modify i int default 1;
+insert into t1 values ();
+select * from t1;
+i
+NULL
+1
+alter table t1 change i c char(10) default "Two";
+insert into t1 values ();
+select * from t1;
+c
+NULL
+1
+Two
+unlock tables;
+select * from t1;
+c
+NULL
+1
+Two
+drop tables t1;
+create table t1(f1 varchar(5) unique, f2 timestamp NOT NULL DEFAULT
+CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
+insert into t1(f1) values(1);
+select @a:=f2 from t1;
+@a:=f2
+#
+update t1 set f1=1;
+select @b:=f2 from t1;
+@b:=f2
+#
+select if(@a=@b,"ok","wrong");
+if(@a=@b,"ok","wrong")
+ok
+insert into t1(f1) values (1) on duplicate key update f1="1";
+select @b:=f2 from t1;
+@b:=f2
+#
+select if(@a=@b,"ok","wrong");
+if(@a=@b,"ok","wrong")
+ok
+insert into t1(f1) select f1 from t1 on duplicate key update f1="1";
+select @b:=f2 from t1;
+@b:=f2
+#
+select if(@a=@b,"ok","wrong");
+if(@a=@b,"ok","wrong")
+ok
+drop table t1;
End of 5.1 tests
diff --git a/mysql-test/r/innodb_trx_weight.result b/mysql-test/r/innodb_trx_weight.result
new file mode 100644
index 00000000000..195775f74c8
--- /dev/null
+++ b/mysql-test/r/innodb_trx_weight.result
@@ -0,0 +1 @@
+SET storage_engine=InnoDB;
diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result
index 2ddd904c5ea..8dbba4d454a 100644
--- a/mysql-test/r/insert.result
+++ b/mysql-test/r/insert.result
@@ -384,3 +384,119 @@ id data
8 140
9 150
drop table t1;
+DROP TABLE IF EXISTS t1;
+DROP FUNCTION IF EXISTS f1;
+DROP FUNCTION IF EXISTS f2;
+CREATE TABLE t1 (i INT);
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+INSERT INTO t1 VALUES (1);
+RETURN 1;
+END |
+CREATE FUNCTION f2() RETURNS INT
+BEGIN
+INSERT DELAYED INTO t1 VALUES (2);
+RETURN 1;
+END |
+SELECT f1();
+f1()
+1
+SELECT f2();
+f2()
+1
+INSERT INTO t1 VALUES (3);
+INSERT DELAYED INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (f1());
+ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
+INSERT DELAYED INTO t1 VALUES (f1());
+ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
+INSERT INTO t1 VALUES (f2());
+ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
+INSERT DELAYED INTO t1 VALUES (f2());
+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 t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+INSERT INTO t1 VALUES (NEW.i);
+INSERT INTO t1 VALUES (1);
+ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
+INSERT DELAYED INTO t1 VALUES (1);
+ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
+SELECT * FROM t1;
+i
+1
+2
+3
+4
+DROP FUNCTION f2;
+DROP FUNCTION f1;
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1 (i INT);
+CREATE TABLE t2 (i INT);
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+INSERT DELAYED INTO t2 VALUES (NEW.i);
+CREATE TRIGGER t1_bu BEFORE UPDATE ON t1 FOR EACH ROW
+INSERT DELAYED INTO t2 VALUES (NEW.i);
+CREATE TRIGGER t1_bd BEFORE DELETE ON t1 FOR EACH ROW
+INSERT DELAYED INTO t2 VALUES (OLD.i);
+INSERT INTO t1 VALUES (1);
+INSERT DELAYED INTO t1 VALUES (2);
+SELECT * FROM t1;
+i
+1
+2
+UPDATE t1 SET i = 3 WHERE i = 1;
+SELECT * FROM t1;
+i
+3
+2
+DELETE FROM t1 WHERE i = 3;
+SELECT * FROM t1;
+i
+2
+SELECT * FROM t2;
+i
+1
+2
+3
+3
+DROP TABLE t1, t2;
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1 (i INT);
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+SET @a= NEW.i;
+SET @a= 0;
+INSERT DELAYED INTO t1 VALUES (1);
+SELECT @a;
+@a
+1
+INSERT DELAYED INTO t1 VALUES (2);
+SELECT @a;
+@a
+2
+DROP TABLE t1;
+CREATE TABLE t1 (i INT);
+CREATE TABLE t2 (i INT);
+CREATE TRIGGER t1_ai AFTER INSERT ON t1 FOR EACH ROW
+INSERT INTO t2 VALUES (NEW.i);
+CREATE TRIGGER t1_au AFTER UPDATE ON t1 FOR EACH ROW
+INSERT DELAYED INTO t2 VALUES (NEW.i);
+CREATE TRIGGER t1_ad AFTER DELETE ON t1 FOR EACH ROW
+INSERT DELAYED INTO t2 VALUES (OLD.i);
+INSERT DELAYED INTO t1 VALUES (1);
+SELECT * FROM t1;
+i
+1
+UPDATE t1 SET i = 2 WHERE i = 1;
+SELECT * FROM t1;
+i
+2
+DELETE FROM t1 WHERE i = 2;
+SELECT * FROM t1;
+i
+SELECT * FROM t2;
+i
+1
+2
+2
+DROP TABLE t1, t2;
+End of 5.0 tests.
diff --git a/mysql-test/r/insert_notembedded.result b/mysql-test/r/insert_notembedded.result
index 816060b7ec9..ac69cb65972 100644
--- a/mysql-test/r/insert_notembedded.result
+++ b/mysql-test/r/insert_notembedded.result
@@ -105,3 +105,22 @@ DROP VIEW view_target2;
DROP VIEW view_target3;
DROP USER user20989@localhost;
DROP DATABASE meow;
+connection: default
+set low_priority_updates=1;
+drop table if exists t1;
+create table t1 (a int, b int, unique key t1$a (a));
+lock table t1 read;
+connection: update
+set low_priority_updates=1;
+show variables like 'low_priority_updates';
+Variable_name Value
+low_priority_updates ON
+insert into t1 values (1, 2) ON DUPLICATE KEY UPDATE b = 2;;
+connection: select
+select * from t1;
+a b
+connection: default
+select * from t1;
+a b
+drop table t1;
+set low_priority_updates=default;
diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result
index 57339b2e29f..2604e4bf648 100644
--- a/mysql-test/r/insert_select.result
+++ b/mysql-test/r/insert_select.result
@@ -688,8 +688,43 @@ ERROR 42S22: Unknown column 't2.x' in 'field list'
drop table t1,t2;
CREATE TABLE t1 (a int PRIMARY KEY);
INSERT INTO t1 values (1), (2);
+flush status;
INSERT INTO t1 SELECT a + 2 FROM t1 LIMIT 1;
+show status like 'Handler_read%';
+Variable_name Value
+Handler_read_first 1
+Handler_read_key 0
+Handler_read_next 0
+Handler_read_prev 0
+Handler_read_rnd 0
+Handler_read_rnd_next 1
DROP TABLE t1;
+CREATE TABLE t1 (
+f1 int(10) unsigned NOT NULL auto_increment PRIMARY KEY,
+f2 varchar(100) NOT NULL default ''
+);
+CREATE TABLE t2 (
+f1 varchar(10) NOT NULL default '',
+f2 char(3) NOT NULL default '',
+PRIMARY KEY (`f1`),
+KEY `k1` (`f2`, `f1`)
+);
+INSERT INTO t1 values(NULL, '');
+INSERT INTO `t2` VALUES ('486878','WDT'),('486910','WDT');
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT min(t2.f1) FROM t1, t2 where t2.f2 = 'SIR' GROUP BY t1.f1;
+min(t2.f1)
+INSERT INTO t1 (f2)
+SELECT min(t2.f1) FROM t1, t2 where t2.f2 = 'SIR' GROUP BY t1.f1;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT * FROM t1;
+f1 f2
+1
+DROP TABLE t1, t2;
CREATE TABLE t1 (x int, y int);
CREATE TABLE t2 (z int, y int);
CREATE TABLE t3 (a int, b int);
@@ -759,3 +794,25 @@ d
20
20
DROP TABLE t1,t2;
+CREATE TABLE t1 (
+id INT AUTO_INCREMENT PRIMARY KEY,
+prev_id INT,
+join_id INT DEFAULT 0);
+INSERT INTO t1 (prev_id) VALUES (NULL), (1), (2);
+SELECT * FROM t1;
+id prev_id join_id
+1 NULL 0
+2 1 0
+3 2 0
+CREATE TABLE t2 (join_id INT);
+INSERT INTO t2 (join_id) VALUES (0);
+INSERT INTO t1 (prev_id) SELECT id
+FROM t2 LEFT JOIN t1 ON t1.join_id = t2.join_id
+ORDER BY id DESC LIMIT 1;
+SELECT * FROM t1;
+id prev_id join_id
+1 NULL 0
+2 1 0
+3 2 0
+4 3 0
+DROP TABLE t1,t2;
diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result
index fed66ed47a7..704cf444681 100644
--- a/mysql-test/r/insert_update.result
+++ b/mysql-test/r/insert_update.result
@@ -336,3 +336,74 @@ id f1
0 test1
DROP TABLE t1;
SET SQL_MODE='';
+CREATE TABLE t1 (
+id INT AUTO_INCREMENT PRIMARY KEY,
+c1 CHAR(1) UNIQUE KEY,
+cnt INT DEFAULT 1
+);
+INSERT INTO t1 (c1) VALUES ('A'), ('B'), ('C');
+SELECT * FROM t1;
+id c1 cnt
+1 A 1
+2 B 1
+3 C 1
+INSERT INTO t1 (c1) VALUES ('A'), ('X'), ('Y'), ('Z')
+ON DUPLICATE KEY UPDATE cnt=cnt+1;
+SELECT * FROM t1;
+id c1 cnt
+1 A 2
+2 B 1
+3 C 1
+4 X 1
+5 Y 1
+6 Z 1
+DROP TABLE t1;
+CREATE TABLE t1 (
+id INT AUTO_INCREMENT PRIMARY KEY,
+c1 INT NOT NULL,
+cnt INT DEFAULT 1
+);
+INSERT INTO t1 (id,c1) VALUES (1,10);
+SELECT * FROM t1;
+id c1 cnt
+1 10 1
+CREATE TABLE t2 (id INT, c1 INT);
+INSERT INTO t2 VALUES (1,NULL), (2,2);
+INSERT INTO t1 (id,c1) SELECT 1,NULL
+ON DUPLICATE KEY UPDATE c1=NULL;
+ERROR 23000: Column 'c1' cannot be null
+SELECT * FROM t1;
+id c1 cnt
+1 10 1
+INSERT IGNORE INTO t1 (id,c1) SELECT 1,NULL
+ON DUPLICATE KEY UPDATE c1=NULL, cnt=cnt+1;
+Warnings:
+Warning 1048 Column 'c1' cannot be null
+Error 1048 Column 'c1' cannot be null
+SELECT * FROM t1;
+id c1 cnt
+1 0 2
+INSERT IGNORE INTO t1 (id,c1) SELECT * FROM t2
+ON DUPLICATE KEY UPDATE c1=NULL, cnt=cnt+1;
+Warnings:
+Warning 1048 Column 'c1' cannot be null
+Error 1048 Column 'c1' cannot be null
+SELECT * FROM t1;
+id c1 cnt
+1 0 3
+2 2 1
+DROP TABLE t1;
+create table t1(f1 int primary key,
+f2 timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP);
+insert into t1(f1) values(1);
+select @stamp1:=f2 from t1;
+@stamp1:=f2
+#
+insert into t1(f1) values(1) on duplicate key update f1=1;
+select @stamp2:=f2 from t1;
+@stamp2:=f2
+#
+select if( @stamp1 = @stamp2, "correct", "wrong");
+if( @stamp1 = @stamp2, "correct", "wrong")
+correct
+drop table t1;
diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result
index 86c206195b1..fcb141a3510 100644
--- a/mysql-test/r/join.result
+++ b/mysql-test/r/join.result
@@ -403,8 +403,8 @@ EXPLAIN
SELECT STRAIGHT_JOIN t2.e FROM t1,t2 WHERE t2.d=1 AND t1.b=t2.e
ORDER BY t1.b, t1.c;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using temporary; Using filesort; Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 16 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using temporary; Using filesort
+1 SIMPLE t2 ALL NULL NULL NULL NULL 16 Using where; Using join buffer
SELECT STRAIGHT_JOIN t2.e FROM t1,t2 WHERE t2.d=1 AND t1.b=t2.e
ORDER BY t1.b, t1.c;
e
diff --git a/mysql-test/r/join_nested.result b/mysql-test/r/join_nested.result
index d080b1a2a46..2bdac08e7fd 100644
--- a/mysql-test/r/join_nested.result
+++ b/mysql-test/r/join_nested.result
@@ -228,8 +228,8 @@ LEFT JOIN
t8
ON t7.b=t8.b AND t6.b < 10;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00 Using join cache
-1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00
+1 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00
+1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using join buffer
1 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00
Warnings:
Note 1003 select `test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b` from `test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t7`.`b` = `test`.`t8`.`b`) and (`test`.`t6`.`b` < 10))) where 1
@@ -543,8 +543,8 @@ WHERE t0.a=1 AND
t0.b=t1.b AND
(t2.a >= 4 OR t2.c IS NULL);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join cache
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00
1 SIMPLE t4 ALL NULL NULL NULL NULL 2 100.00
@@ -638,16 +638,16 @@ t0.b=t1.b AND
(t8.b=t9.b OR t8.c IS NULL) AND
(t9.a=1);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join cache
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where
1 SIMPLE t4 ALL NULL NULL NULL NULL 2 100.00 Using where
1 SIMPLE t5 ALL NULL NULL NULL NULL 3 100.00 Using where
1 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00 Using where
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join cache
-1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where
+1 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00 Using where
+1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
Warnings:
Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t3`.`a` = 1))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t9`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`)))
SELECT t9.a,t9.b
@@ -835,8 +835,8 @@ t2
ON t3.a=1 AND t2.b=t4.b
WHERE t1.a <= 2;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using join buffer
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00
1 SIMPLE t4 ALL NULL NULL NULL NULL 2 100.00
Warnings:
@@ -849,8 +849,8 @@ LEFT JOIN
(t1,t2)
ON t3.a=1 AND t3.b=t2.b AND t2.b=t4.b;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using join cache
-1 SIMPLE t4 ALL NULL NULL NULL NULL 2 100.00
+1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00
+1 SIMPLE t4 ALL NULL NULL NULL NULL 2 100.00 Using join buffer
1 SIMPLE t2 ref idx_b idx_b 5 test.t3.b 2 100.00
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
Warnings:
@@ -905,16 +905,16 @@ t0.b=t1.b AND
(t8.b=t9.b OR t8.c IS NULL) AND
(t9.a=1);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join cache
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where
1 SIMPLE t4 ALL NULL NULL NULL NULL 2 100.00 Using where
1 SIMPLE t5 ALL NULL NULL NULL NULL 3 100.00 Using where
1 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00 Using where
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join cache
-1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where
+1 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00 Using where
+1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
Warnings:
Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t3`.`a` = 1))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t9`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`)))
CREATE INDEX idx_b ON t4(b);
@@ -955,16 +955,16 @@ t0.b=t1.b AND
(t8.b=t9.b OR t8.c IS NULL) AND
(t9.a=1);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join cache
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where
1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 2 100.00 Using where
1 SIMPLE t5 ALL idx_b NULL NULL NULL 3 100.00 Using where
1 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00 Using where
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join cache
-1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where
+1 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00 Using where
+1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
Warnings:
Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t3`.`a` = 1))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t9`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`)))
CREATE INDEX idx_b ON t8(b);
@@ -1004,16 +1004,16 @@ t0.b=t1.b AND
(t8.b=t9.b OR t8.c IS NULL) AND
(t9.a=1);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join cache
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where
1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 2 100.00 Using where
1 SIMPLE t5 ALL idx_b NULL NULL NULL 3 100.00 Using where
1 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00 Using where
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 100.00 Using where; Using join cache
-1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where
+1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 100.00 Using where
+1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
Warnings:
Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t3`.`a` = 1))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t9`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`)))
CREATE INDEX idx_b ON t1(b);
@@ -1062,8 +1062,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t5 ALL idx_b NULL NULL NULL 3 100.00 Using where
1 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00 Using where
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 100.00 Using where; Using join cache
-1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where
+1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 100.00 Using where
+1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
Warnings:
Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t3`.`a` = 1))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t9`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`)))
SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
@@ -1632,4 +1632,115 @@ INSERT INTO t3 VALUES (1,1);
SELECT * FROM t1 JOIN (t2 JOIN t3 USING (b)) USING (a);
ERROR 23000: Column 'a' in from clause is ambiguous
DROP TABLE t1,t2,t3;
+CREATE TABLE t1 (
+carrier char(2) default NULL,
+id int NOT NULL auto_increment PRIMARY KEY
+);
+INSERT INTO t1 VALUES
+('CO',235371754),('CO',235376554),('CO',235376884),('CO',235377874),
+('CO',231060394),('CO',231059224),('CO',231059314),('CO',231060484),
+('CO',231060274),('CO',231060124),('CO',231060244),('CO',231058594),
+('CO',231058924),('CO',231058504),('CO',231059344),('CO',231060424),
+('CO',231059554),('CO',231060304),('CO',231059644),('CO',231059464),
+('CO',231059764),('CO',231058294),('CO',231058624),('CO',231058864),
+('CO',231059374),('CO',231059584),('CO',231059734),('CO',231059014),
+('CO',231059854),('CO',231059494),('CO',231059794),('CO',231058534),
+('CO',231058324),('CO',231058684),('CO',231059524),('CO',231059974);
+CREATE TABLE t2 (
+scan_date date default NULL,
+package_id int default NULL,
+INDEX scan_date(scan_date),
+INDEX package_id(package_id)
+);
+INSERT INTO t2 VALUES
+('2008-12-29',231062944),('2008-12-29',231065764),('2008-12-29',231066124),
+('2008-12-29',231060094),('2008-12-29',231061054),('2008-12-29',231065644),
+('2008-12-29',231064384),('2008-12-29',231064444),('2008-12-29',231073774),
+('2008-12-29',231058594),('2008-12-29',231059374),('2008-12-29',231066004),
+('2008-12-29',231068494),('2008-12-29',231070174),('2008-12-29',231071884),
+('2008-12-29',231063274),('2008-12-29',231063754),('2008-12-29',231064144),
+('2008-12-29',231069424),('2008-12-29',231073714),('2008-12-29',231058414),
+('2008-12-29',231060994),('2008-12-29',231069154),('2008-12-29',231068614),
+('2008-12-29',231071464),('2008-12-29',231074014),('2008-12-29',231059614),
+('2008-12-29',231059074),('2008-12-29',231059464),('2008-12-29',231069094),
+('2008-12-29',231067294),('2008-12-29',231070144),('2008-12-29',231073804),
+('2008-12-29',231072634),('2008-12-29',231058294),('2008-12-29',231065344),
+('2008-12-29',231066094),('2008-12-29',231069034),('2008-12-29',231058594),
+('2008-12-29',231059854),('2008-12-29',231059884),('2008-12-29',231059914),
+('2008-12-29',231063664),('2008-12-29',231063814),('2008-12-29',231063904);
+CREATE TABLE t3 (
+package_id int default NULL,
+INDEX package_id(package_id)
+);
+INSERT INTO t3 VALUES
+(231058294),(231058324),(231058354),(231058384),(231058414),(231058444),
+(231058474),(231058504),(231058534),(231058564),(231058594),(231058624),
+(231058684),(231058744),(231058804),(231058864),(231058924),(231058954),
+(231059014),(231059074),(231059104),(231059134),(231059164),(231059194),
+(231059224),(231059254),(231059284),(231059314),(231059344),(231059374),
+(231059404),(231059434),(231059464),(231059494),(231059524),(231059554),
+(231059584),(231059614),(231059644),(231059674),(231059704),(231059734),
+(231059764),(231059794),(231059824),(231059854),(231059884),(231059914),
+(231059944),(231059974),(231060004),(231060034),(231060064),(231060094),
+(231060124),(231060154),(231060184),(231060214),(231060244),(231060274),
+(231060304),(231060334),(231060364),(231060394),(231060424),(231060454),
+(231060484),(231060514),(231060544),(231060574),(231060604),(231060634),
+(231060664),(231060694),(231060724),(231060754),(231060784),(231060814),
+(231060844),(231060874),(231060904),(231060934),(231060964),(231060994),
+(231061024),(231061054),(231061084),(231061144),(231061174),(231061204),
+(231061234),(231061294),(231061354),(231061384),(231061414),(231061474),
+(231061564),(231061594),(231061624),(231061684),(231061714),(231061774),
+(231061804),(231061894),(231061984),(231062074),(231062134),(231062224),
+(231062254),(231062314),(231062374),(231062434),(231062494),(231062554),
+(231062584),(231062614),(231062644),(231062704),(231062734),(231062794),
+(231062854),(231062884),(231062944),(231063004),(231063034),(231063064),
+(231063124),(231063154),(231063184),(231063214),(231063274),(231063334),
+(231063394),(231063424),(231063454),(231063514),(231063574),(231063664);
+CREATE TABLE t4 (
+carrier char(2) NOT NULL default '' PRIMARY KEY,
+id int(11) default NULL,
+INDEX id(id)
+);
+INSERT INTO t4 VALUES
+('99',6),('SK',456),('UA',486),('AI',1081),('OS',1111),('VS',1510);
+CREATE TABLE t5 (
+carrier_id int default NULL,
+INDEX carrier_id(carrier_id)
+);
+INSERT INTO t5 VALUES
+(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),
+(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),
+(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),
+(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),
+(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),
+(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(456),(456),(456),
+(456),(456),(456),(456),(456),(456),(456),(456),(456),(456),(456),(456),
+(456),(486),(1081),(1111),(1111),(1111),(1111),(1510);
+SELECT COUNT(*)
+FROM((t2 JOIN t1 ON t2.package_id = t1.id)
+JOIN t3 ON t3.package_id = t1.id);
+COUNT(*)
+6
+EXPLAIN
+SELECT COUNT(*)
+FROM ((t2 JOIN t1 ON t2.package_id = t1.id)
+JOIN t3 ON t3.package_id = t1.id)
+LEFT JOIN
+(t5 JOIN t4 ON t5.carrier_id = t4.id)
+ON t4.carrier = t1.carrier;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 index package_id package_id 5 NULL 45 Using index
+1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.package_id 1
+1 SIMPLE t4 eq_ref PRIMARY,id PRIMARY 2 test.t1.carrier 1
+1 SIMPLE t5 ref carrier_id carrier_id 5 test.t4.id 22 Using index
+1 SIMPLE t3 ref package_id package_id 5 test.t1.id 1 Using where; Using index
+SELECT COUNT(*)
+FROM ((t2 JOIN t1 ON t2.package_id = t1.id)
+JOIN t3 ON t3.package_id = t1.id)
+LEFT JOIN
+(t5 JOIN t4 ON t5.carrier_id = t4.id)
+ON t4.carrier = t1.carrier;
+COUNT(*)
+6
+DROP TABLE t1,t2,t3,t4,t5;
End of 5.0 tests
diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result
index 62dfb36bb52..1e4fc91b8bd 100644
--- a/mysql-test/r/join_outer.result
+++ b/mysql-test/r/join_outer.result
@@ -1239,3 +1239,18 @@ Handler_read_prev 0
Handler_read_rnd 0
Handler_read_rnd_next 6
DROP TABLE t1,t2;
+CREATE TABLE t1 (c int PRIMARY KEY, e int NOT NULL);
+INSERT INTO t1 VALUES (1,0), (2,1);
+CREATE TABLE t2 (d int PRIMARY KEY);
+INSERT INTO t2 VALUES (1), (2), (3);
+EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON e<>0 WHERE c=1 AND d IS NULL;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
+1 SIMPLE t2 index NULL PRIMARY 4 NULL 3 Using where; Using index; Not exists
+SELECT * FROM t1 LEFT JOIN t2 ON e<>0 WHERE c=1 AND d IS NULL;
+c e d
+1 0 NULL
+SELECT * FROM t1 LEFT JOIN t2 ON e<>0 WHERE c=1 AND d<=>NULL;
+c e d
+1 0 NULL
+DROP TABLE t1,t2;
diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result
index e348a387252..a2bed75a709 100644
--- a/mysql-test/r/key.result
+++ b/mysql-test/r/key.result
@@ -336,8 +336,8 @@ UNIQUE i1idx (i1),
UNIQUE i2idx (i2));
desc t1;
Field Type Null Key Default Extra
-i1 int(11) NO PRI
-i2 int(11) NO UNI
+i1 int(11) NO PRI NULL
+i2 int(11) NO UNI NULL
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -392,27 +392,27 @@ drop table t1;
create table t1 (a int not null primary key, b varchar(20) not null unique);
desc t1;
Field Type Null Key Default Extra
-a int(11) NO PRI
-b varchar(20) NO UNI
+a int(11) NO PRI NULL
+b varchar(20) NO UNI NULL
drop table t1;
create table t1 (a int not null primary key, b int not null unique);
desc t1;
Field Type Null Key Default Extra
-a int(11) NO PRI
-b int(11) NO UNI
+a int(11) NO PRI NULL
+b int(11) NO UNI NULL
drop table t1;
create table t1 (a int not null primary key, b varchar(20) not null, unique (b(10)));
desc t1;
Field Type Null Key Default Extra
-a int(11) NO PRI
-b varchar(20) NO UNI
+a int(11) NO PRI NULL
+b varchar(20) NO UNI NULL
drop table t1;
create table t1 (a int not null primary key, b varchar(20) not null, c varchar(20) not null, unique(b(10),c(10)));
desc t1;
Field Type Null Key Default Extra
-a int(11) NO PRI
-b varchar(20) NO MUL
-c varchar(20) NO
+a int(11) NO PRI NULL
+b varchar(20) NO MUL NULL
+c varchar(20) NO NULL
drop table t1;
create table t1 (
c1 int,
diff --git a/mysql-test/r/key_cache.result b/mysql-test/r/key_cache.result
index a1bf3d0e128..08d8059f61b 100644
--- a/mysql-test/r/key_cache.result
+++ b/mysql-test/r/key_cache.result
@@ -191,10 +191,8 @@ cache index t1 in unknown_key_cache;
ERROR HY000: Unknown key cache 'unknown_key_cache'
cache index t1 key (unknown_key) in keycache1;
Table Op Msg_type Msg_text
-test.t1 assign_to_keycache error Key 'unknown_key' doesn't exist in table 't1'
+test.t1 assign_to_keycache Error Key 'unknown_key' doesn't exist in table 't1'
test.t1 assign_to_keycache status Operation failed
-Warnings:
-Error 1176 Key 'unknown_key' doesn't exist in table 't1'
select @@keycache2.key_buffer_size;
@@keycache2.key_buffer_size
4194304
@@ -341,3 +339,30 @@ Warning 1438 Cannot drop default keycache
select @@global.key_buffer_size;
@@global.key_buffer_size
2097152
+SET @bug28478_key_cache_block_size= @@global.key_cache_block_size;
+SET GLOBAL key_cache_block_size= 1536;
+CREATE TABLE t1 (
+id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+c1 CHAR(150),
+c2 CHAR(150),
+c3 CHAR(150),
+KEY(c1, c2, c3)
+) ENGINE= MyISAM;
+INSERT INTO t1 (c1, c2, c3) VALUES
+('a', 'b', 'c'), ('b', 'c', 'd'), ('c', 'd', 'e'), ('d', 'e', 'f'),
+('e', 'f', 'g'), ('f', 'g', 'h'), ('g', 'h', 'i'), ('h', 'i', 'j'),
+('i', 'j', 'k'), ('j', 'k', 'l'), ('k', 'l', 'm'), ('l', 'm', 'n'),
+('m', 'n', 'o'), ('n', 'o', 'p'), ('o', 'p', 'q'), ('p', 'q', 'r'),
+('q', 'r', 's'), ('r', 's', 't'), ('s', 't', 'u'), ('t', 'u', 'v'),
+('u', 'v', 'w'), ('v', 'w', 'x'), ('w', 'x', 'y'), ('x', 'y', 'z');
+INSERT INTO t1 (c1, c2, c3) SELECT c1, c2, c3 from t1;
+INSERT INTO t1 (c1, c2, c3) SELECT c1, c2, c3 from t1;
+INSERT INTO t1 (c1, c2, c3) SELECT c1, c2, c3 from t1;
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+SHOW VARIABLES LIKE 'key_cache_block_size';
+Variable_name Value
+key_cache_block_size 1536
+SET GLOBAL key_cache_block_size= @bug28478_key_cache_block_size;
+DROP TABLE t1;
diff --git a/mysql-test/r/key_diff.result b/mysql-test/r/key_diff.result
index 35aad39edbf..9d26bee4557 100644
--- a/mysql-test/r/key_diff.result
+++ b/mysql-test/r/key_diff.result
@@ -35,8 +35,8 @@ D E a a
a a a a
explain select t1.*,t2.* from t1,t1 as t2 where t1.A=t2.B;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL a NULL NULL NULL 5 Using join cache
-1 SIMPLE t2 ALL b NULL NULL NULL 5 Using where
+1 SIMPLE t1 ALL a NULL NULL NULL 5
+1 SIMPLE t2 ALL b NULL NULL NULL 5 Using where; Using join buffer
select t1.*,t2.* from t1,t1 as t2 where t1.A=t2.B order by binary t1.a,t2.a;
a b a b
A B a a
diff --git a/mysql-test/r/kill.result b/mysql-test/r/kill.result
index d198c943496..a08be429a83 100644
--- a/mysql-test/r/kill.result
+++ b/mysql-test/r/kill.result
@@ -22,7 +22,7 @@ create table t2 (id int unsigned not null);
insert into t2 select id from t1;
create table t3 (kill_id int);
insert into t3 values(connection_id());
-select id from t1 where id in (select distinct id from t2);
+select id from t1 where id in (select distinct a.id from t2 a, t2 b, t2 c, t2 d group by a.id, b.id, c.id, d.id having a.id between 10 and 20);
select ((@id := kill_id) - kill_id) from t3;
((@id := kill_id) - kill_id)
0
@@ -41,3 +41,87 @@ select 1;
select RELEASE_LOCK("a");
RELEASE_LOCK("a")
1
+create table t1(f1 int);
+create function bug27563() returns int(11)
+deterministic
+begin
+declare continue handler for sqlstate '70100' set @a:= 'killed';
+declare continue handler for sqlexception set @a:= 'exception';
+set @a= get_lock("lock27563", 10);
+return 1;
+end|
+select get_lock("lock27563",10);
+get_lock("lock27563",10)
+1
+insert into t1 values (bug27563());
+ERROR 70100: Query execution was interrupted
+select @a;
+@a
+NULL
+select * from t1;
+f1
+insert into t1 values(0);
+update t1 set f1= bug27563();
+ERROR 70100: Query execution was interrupted
+select @a;
+@a
+NULL
+select * from t1;
+f1
+0
+insert into t1 values(1);
+delete from t1 where bug27563() is null;
+ERROR 70100: Query execution was interrupted
+select @a;
+@a
+NULL
+select * from t1;
+f1
+0
+1
+select * from t1 where f1= bug27563();
+ERROR 70100: Query execution was interrupted
+select @a;
+@a
+NULL
+create procedure proc27563()
+begin
+declare continue handler for sqlstate '70100' set @a:= 'killed';
+declare continue handler for sqlexception set @a:= 'exception';
+select get_lock("lock27563",10);
+select "shouldn't be selected";
+end|
+call proc27563();
+get_lock("lock27563",10)
+NULL
+ERROR 70100: Query execution was interrupted
+select @a;
+@a
+NULL
+create table t2 (f2 int);
+create trigger trg27563 before insert on t1 for each row
+begin
+declare continue handler for sqlstate '70100' set @a:= 'killed';
+declare continue handler for sqlexception set @a:= 'exception';
+set @a:= get_lock("lock27563",10);
+insert into t2 values(1);
+end|
+insert into t1 values(2),(3);
+ERROR 70100: Query execution was interrupted
+select @a;
+@a
+NULL
+select * from t1;
+f1
+0
+1
+select * from t2;
+f2
+select release_lock("lock27563");
+release_lock("lock27563")
+1
+drop table t1, t2;
+drop function bug27563;
+drop procedure proc27563;
+PREPARE stmt FROM 'EXPLAIN SELECT * FROM t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40 WHERE a1=a2 AND a2=a3 AND a3=a4 AND a4=a5 AND a5=a6 AND a6=a7 AND a7=a8 AND a8=a9 AND a9=a10 AND a10=a11 AND a11=a12 AND a12=a13 AND a13=a14 AND a14=a15 AND a15=a16 AND a16=a17 AND a17=a18 AND a18=a19 AND a19=a20 AND a20=a21 AND a21=a22 AND a22=a23 AND a23=a24 AND a24=a25 AND a25=a26 AND a26=a27 AND a27=a28 AND a28=a29 AND a29=a30 AND a30=a31 AND a31=a32 AND a32=a33 AND a33=a34 AND a34=a35 AND a35=a36 AND a36=a37 AND a37=a38 AND a38=a39 AND a39=a40 ';
+EXECUTE stmt;
diff --git a/mysql-test/r/limit.result b/mysql-test/r/limit.result
index ac96ac8ff17..01d7d7ca218 100644
--- a/mysql-test/r/limit.result
+++ b/mysql-test/r/limit.result
@@ -91,3 +91,14 @@ select sum(a) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3;
c
28
drop table t1;
+prepare s from "select 1 limit ?";
+set @a='qwe';
+execute s using @a;
+ERROR HY000: Incorrect arguments to EXECUTE
+prepare s from "select 1 limit 1, ?";
+execute s using @a;
+ERROR HY000: Incorrect arguments to EXECUTE
+prepare s from "select 1 limit ?, ?";
+execute s using @a, @a;
+ERROR HY000: Incorrect arguments to EXECUTE
+End of 5.0 tests
diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result
index bb222db74da..98e221b0dea 100644
--- a/mysql-test/r/loaddata.result
+++ b/mysql-test/r/loaddata.result
@@ -86,6 +86,60 @@ field1 field2
a"b cd"ef
a"b c"d"e
drop table t1;
+CREATE TABLE t1 (
+id INT AUTO_INCREMENT PRIMARY KEY,
+c1 VARCHAR(255)
+);
+CREATE TABLE t2 (
+id INT,
+c2 VARCHAR(255)
+);
+INSERT INTO t1 (c1) VALUES
+('r'), ('rr'), ('rrr'), ('rrrr'),
+('.r'), ('.rr'), ('.rrr'), ('.rrrr'),
+('r.'), ('rr.'), ('rrr.'), ('rrrr.'),
+('.r.'), ('.rr.'), ('.rrr.'), ('.rrrr.');
+SELECT * FROM t1;
+id c1
+1 r
+2 rr
+3 rrr
+4 rrrr
+5 .r
+6 .rr
+7 .rrr
+8 .rrrr
+9 r.
+10 rr.
+11 rrr.
+12 rrrr.
+13 .r.
+14 .rr.
+15 .rrr.
+16 .rrrr.
+SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1' FIELDS ENCLOSED BY 'r' FROM t1;
+r1r rrrr
+r2r rrrrrr
+r3r rrrrrrrr
+r4r rrrrrrrrrr
+r5r r.rrr
+r6r r.rrrrr
+r7r r.rrrrrrr
+r8r r.rrrrrrrrr
+r9r rrr.r
+r10r rrrrr.r
+r11r rrrrrrr.r
+r12r rrrrrrrrr.r
+r13r r.rr.r
+r14r r.rrrr.r
+r15r r.rrrrrr.r
+r16r r.rrrrrrrr.r
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1' INTO TABLE t2 FIELDS ENCLOSED BY 'r';
+SELECT t1.id, c1, c2 FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE c1 != c2;
+id c1 c2
+SELECT t1.id, c1, c2 FROM t1 RIGHT JOIN t2 ON t1.id=t2.id WHERE c1 != c2;
+id c1 c2
+DROP TABLE t1,t2;
create table t1 (a int default 100, b int, c varchar(60));
load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (a, @b) set b=@b+10, c=concat("b=",@b);
select * from t1;
@@ -174,6 +228,39 @@ f2
2
SET @@SQL_MODE=@OLD_SQL_MODE;
drop table t1,t2;
+create table t1(f1 int, f2 timestamp not null default current_timestamp);
+create table t2(f1 int);
+insert into t2 values(1),(2);
+Warnings:
+Warning 1261 Row 1 doesn't contain data for all columns
+Warning 1261 Row 2 doesn't contain data for all columns
+select f1 from t1 where f2 <> '0000-00-00 00:00:00' order by f1;
+f1
+1
+2
+delete from t1;
+Warnings:
+Warning 1261 Row 1 doesn't contain data for all columns
+Warning 1261 Row 2 doesn't contain data for all columns
+select f1 from t1 where f2 <> '0000-00-00 00:00:00' order by f1;
+f1
+1
+2
+drop table t1,t2;
+CREATE TABLE t1 (c1 INT, c2 TIMESTAMP, c3 REAL, c4 DOUBLE);
+INSERT INTO t1 (c1, c2, c3, c4) VALUES (10, '1970-02-01 01:02:03', 1.1E-100, 1.1E+100);
+SELECT * FROM t1;
+c1 c2 c3 c4
+10 1970-02-01 01:02:03 1.1e-100 1.1e+100
+SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1' FIELDS ENCLOSED BY '-' FROM t1;
+-10- -1970\-02\-01 01:02:03- -1.1e\-100- -1.1e+100-
+EOF
+TRUNCATE t1;
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1' INTO TABLE t1 FIELDS ENCLOSED BY '-';
+SELECT * FROM t1;
+c1 c2 c3 c4
+10 1970-02-01 01:02:03 1.1e-100 1.1e+100
+DROP TABLE t1;
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (1);
SET NAMES latin1;
diff --git a/mysql-test/r/lock.result b/mysql-test/r/lock.result
index 1a2099b7a94..6152e403637 100644
--- a/mysql-test/r/lock.result
+++ b/mysql-test/r/lock.result
@@ -40,7 +40,8 @@ test.t1 check status OK
lock tables t1 write;
check table t2;
Table Op Msg_type Msg_text
-test.t2 check error Table 't2' was not locked with LOCK TABLES
+test.t2 check Error Table 't2' was not locked with LOCK TABLES
+test.t2 check error Corrupt
insert into t1 select index1,nr from t1;
ERROR HY000: Table 't1' was not locked with LOCK TABLES
unlock tables;
@@ -95,4 +96,74 @@ ERROR HY000: You can't combine write-locking of system tables with other tables
LOCK TABLES mysql.time_zone READ, mysql.proc WRITE;
ERROR HY000: You can't combine write-locking of system tables with other tables or lock types
DROP TABLE t1;
+
+Bug#5719 impossible to lock VIEW
+
+Just covering existing behaviour with tests.
+Consistency has not been found here.
+
+drop view if exists v_bug5719;
+drop table if exists t1, t2, t3;
+create table t1 (a int);
+create temporary table t2 (a int);
+create table t3 (a int);
+create view v_bug5719 as select 1;
+lock table v_bug5719 write;
+select * from t1;
+ERROR HY000: Table 't1' was not locked with LOCK TABLES
+
+Allowed to select from a temporary talbe under LOCK TABLES
+
+select * from t2;
+a
+select * from t3;
+ERROR HY000: Table 't3' was not locked with LOCK TABLES
+select * from v_bug5719;
+1
+1
+drop view v_bug5719;
+
+sic: did not left LOCK TABLES mode automatically
+
+select * from t1;
+ERROR HY000: Table 't1' was not locked with LOCK TABLES
+unlock tables;
+create view v_bug5719 as select * from t1;
+lock tables v_bug5719 write;
+select * from v_bug5719;
+a
+
+Allowed to use an underlying table under LOCK TABLES <view>
+
+select * from t1;
+a
+
+Allowed to select from a temporary table under LOCK TABLES
+
+select * from t2;
+a
+select * from t3;
+ERROR HY000: Table 't3' was not locked with LOCK TABLES
+drop table t1;
+
+sic: left LOCK TABLES mode
+
+select * from t3;
+a
+select * from v_bug5719;
+ERROR HY000: View 'test.v_bug5719' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+unlock tables;
+drop view v_bug5719;
+
+When limitation to use temporary tables in views is removed, please
+add a test that shows what happens under LOCK TABLES when a view
+references a temporary table, is locked, and the underlying table
+is dropped.
+
+create view v_bug5719 as select * from t2;
+ERROR HY000: View's SELECT refers to a temporary table 't2'
+
+Cleanup.
+
+drop table t2, t3;
End of 5.1 tests.
diff --git a/mysql-test/r/lock_multi.result b/mysql-test/r/lock_multi.result
index 2445b3e0c69..4a0f70a7b88 100644
--- a/mysql-test/r/lock_multi.result
+++ b/mysql-test/r/lock_multi.result
@@ -13,9 +13,9 @@ insert into t1 values (1);
lock tables t1 read;
update low_priority t1 set n = 4;
select n from t1;
-unlock tables;
n
1
+unlock tables;
drop table t1;
create table t1 (a int, b int);
create table t2 (c int, d int);
@@ -43,6 +43,7 @@ insert t1 select * from t2;
drop table t2;
ERROR 42S02: Table 'test.t2' doesn't exist
drop table t1;
+End of 4.1 tests
create table t1(a int);
lock tables t1 write;
show columns from t1;
@@ -91,7 +92,25 @@ DROP DATABASE mysqltest_1;
ERROR HY000: Can't drop database 'mysqltest_1'; database doesn't exist
create table t1 (f1 int(12) unsigned not null auto_increment, primary key(f1)) engine=innodb;
lock tables t1 write;
-alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; //
-alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; //
+alter table t1 auto_increment=0;
+alter table t1 auto_increment=0;
+unlock tables;
+drop table t1;
+End of 5.0 tests
+create table t1 (i int);
+lock table t1 read;
+update t1 set i= 10;;
+select * from t1;;
+kill query ID;
+i
+ERROR 70100: Query execution was interrupted
unlock tables;
drop table t1;
+drop table if exists t1;
+create table t1 (a int) ENGINE=MEMORY;
+--> client 2
+handler t1 open;
+ERROR HY000: Table storage engine for 't1' doesn't have this option
+--> client 1
+drop table t1;
+End of 5.1 tests
diff --git a/mysql-test/r/log_state.result b/mysql-test/r/log_state.result
index 946797aeec7..3a3ef584ce3 100644
--- a/mysql-test/r/log_state.result
+++ b/mysql-test/r/log_state.result
@@ -37,14 +37,14 @@ set session long_query_time=1;
select sleep(2);
sleep(2)
0
-select * from mysql.slow_log;
+select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text
set global slow_query_log= ON;
set session long_query_time=1;
select sleep(2);
sleep(2)
0
-select * from mysql.slow_log;
+select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text
TIMESTAMP USER_HOST QUERY_TIME 00:00:00 1 0 test 0 0 1 select sleep(2)
show global variables
@@ -131,7 +131,7 @@ set global general_log=ON;
set global log_output=default;
show variables like 'log_output';
Variable_name Value
-log_output TABLE
+log_output FILE
set global general_log=OFF;
set global log_output=FILE;
truncate table mysql.general_log;
@@ -153,3 +153,25 @@ select * from mysql.general_log;
event_time user_host thread_id server_id command_type argument
TIMESTAMP USER_HOST # 1 Query drop table t1
TIMESTAMP USER_HOST # 1 Query select * from mysql.general_log
+SET @old_general_log_state = @@global.general_log;
+SET @old_slow_log_state = @@global.slow_query_log;
+SET GLOBAL general_log = ON;
+SET GLOBAL slow_query_log = ON;
+FLUSH TABLES WITH READ LOCK;
+SET GLOBAL general_log = OFF;
+SET GLOBAL slow_query_log = OFF;
+UNLOCK TABLES;
+FLUSH TABLES WITH READ LOCK;
+SET GLOBAL general_log = ON;
+SET GLOBAL slow_query_log = ON;
+UNLOCK TABLES;
+SET GLOBAL READ_ONLY = ON;
+SET GLOBAL general_log = OFF;
+SET GLOBAL slow_query_log = OFF;
+SET GLOBAL READ_ONLY = OFF;
+SET GLOBAL READ_ONLY = ON;
+SET GLOBAL general_log = ON;
+SET GLOBAL slow_query_log = ON;
+SET GLOBAL READ_ONLY = OFF;
+SET GLOBAL general_log = @old_general_log_state;
+SET GLOBAL slow_query_log = @old_slow_log_state;
diff --git a/mysql-test/r/log_tables.result b/mysql-test/r/log_tables.result
index 8264f252287..5e18e1273c0 100644
--- a/mysql-test/r/log_tables.result
+++ b/mysql-test/r/log_tables.result
@@ -29,30 +29,83 @@ on (mysql.general_log.command_type = join_test.command_type)
drop table join_test;
flush logs;
lock tables mysql.general_log WRITE;
-ERROR HY000: You can't write-lock a log table. Only read access is possible
+ERROR HY000: You can't use locks with log tables.
lock tables mysql.slow_log WRITE;
-ERROR HY000: You can't write-lock a log table. Only read access is possible
+ERROR HY000: You can't use locks with log tables.
lock tables mysql.general_log READ;
-ERROR HY000: You can't use usual read lock with log tables. Try READ LOCAL instead
+ERROR HY000: You can't use locks with log tables.
lock tables mysql.slow_log READ;
-ERROR HY000: You can't use usual read lock with log tables. Try READ LOCAL instead
+ERROR HY000: You can't use locks with log tables.
lock tables mysql.slow_log READ LOCAL, mysql.general_log READ LOCAL;
-unlock tables;
-lock tables mysql.general_log READ LOCAL;
+ERROR HY000: You can't use locks with log tables.
+show create table mysql.general_log;
+Table Create Table
+general_log CREATE TABLE `general_log` (
+ `event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `user_host` mediumtext,
+ `thread_id` int(11) DEFAULT NULL,
+ `server_id` int(11) DEFAULT NULL,
+ `command_type` varchar(64) DEFAULT NULL,
+ `argument` mediumtext
+) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log'
+show fields from mysql.general_log;
+Field Type Null Key Default Extra
+event_time timestamp NO CURRENT_TIMESTAMP
+user_host mediumtext YES NULL
+thread_id int(11) YES NULL
+server_id int(11) YES NULL
+command_type varchar(64) YES NULL
+argument mediumtext YES NULL
+show create table mysql.slow_log;
+Table Create Table
+slow_log CREATE TABLE `slow_log` (
+ `start_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `user_host` mediumtext NOT NULL,
+ `query_time` time NOT NULL,
+ `lock_time` time NOT NULL,
+ `rows_sent` int(11) NOT NULL,
+ `rows_examined` int(11) NOT NULL,
+ `db` varchar(512) DEFAULT NULL,
+ `last_insert_id` int(11) DEFAULT NULL,
+ `insert_id` int(11) DEFAULT NULL,
+ `server_id` int(11) DEFAULT NULL,
+ `sql_text` mediumtext NOT NULL
+) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
+show fields from mysql.slow_log;
+Field Type Null Key Default Extra
+start_time timestamp NO CURRENT_TIMESTAMP
+user_host mediumtext NO NULL
+query_time time NO NULL
+lock_time time NO NULL
+rows_sent int(11) NO NULL
+rows_examined int(11) NO NULL
+db varchar(512) YES NULL
+last_insert_id int(11) YES NULL
+insert_id int(11) YES NULL
+server_id int(11) YES NULL
+sql_text mediumtext NO NULL
flush logs;
-unlock tables;
-select "Mark that we woke up from flush logs in the test"
- as "test passed";
-test passed
-Mark that we woke up from flush logs in the test
-lock tables mysql.general_log READ LOCAL;
-truncate mysql.general_log;
-unlock tables;
-select "Mark that we woke up from TRUNCATE in the test"
- as "test passed";
-test passed
-Mark that we woke up from TRUNCATE in the test
-use test;
+flush tables;
+SET GLOBAL GENERAL_LOG=ON;
+SET GLOBAL SLOW_QUERY_LOG=ON;
+show open tables;
+Database Table In_use Name_locked
+mysql general_log 0 0
+flush logs;
+show open tables;
+Database Table In_use Name_locked
+mysql general_log 0 0
+flush tables;
+show open tables;
+Database Table In_use Name_locked
+mysql general_log 0 0
+SET GLOBAL GENERAL_LOG=OFF;
+SET GLOBAL SLOW_QUERY_LOG=OFF;
+flush tables;
+show open tables;
+Database Table In_use Name_locked
+SET GLOBAL GENERAL_LOG=ON;
+SET GLOBAL SLOW_QUERY_LOG=ON;
truncate table mysql.general_log;
set names utf8;
create table bug16905 (s char(15) character set utf8 default 'пуÑто');
@@ -71,7 +124,7 @@ sleep(2)
0
select * from mysql.slow_log;
start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text
-TIMESTAMP USER_HOST QUERY_TIME 00:00:00 1 0 test 0 0 1 select sleep(2)
+TIMESTAMP USER_HOST QUERY_TIME 00:00:00 1 0 mysql 0 0 1 select sleep(2)
alter table mysql.general_log engine=myisam;
ERROR HY000: You cannot 'ALTER' a log table if logging is enabled
alter table mysql.slow_log engine=myisam;
@@ -158,17 +211,17 @@ TIMESTAMP USER_HOST THREAD_ID 1 Query set global slow_query_log='ON'
TIMESTAMP USER_HOST THREAD_ID 1 Query select * from mysql.general_log
flush logs;
lock tables mysql.general_log WRITE;
-ERROR HY000: You can't write-lock a log table. Only read access is possible
+ERROR HY000: You can't use locks with log tables.
lock tables mysql.slow_log WRITE;
-ERROR HY000: You can't write-lock a log table. Only read access is possible
+ERROR HY000: You can't use locks with log tables.
lock tables mysql.general_log READ;
-ERROR HY000: You can't use usual read lock with log tables. Try READ LOCAL instead
+ERROR HY000: You can't use locks with log tables.
lock tables mysql.slow_log READ;
-ERROR HY000: You can't use usual read lock with log tables. Try READ LOCAL instead
-lock tables mysql.slow_log READ LOCAL, mysql.general_log READ LOCAL;
-unlock tables;
+ERROR HY000: You can't use locks with log tables.
set global general_log='OFF';
set global slow_query_log='OFF';
+set @save_storage_engine= @@session.storage_engine;
+set storage_engine= MEMORY;
alter table mysql.slow_log engine=ndb;
ERROR HY000: This storage engine cannot be used for log tables"
alter table mysql.slow_log engine=innodb;
@@ -177,6 +230,7 @@ alter table mysql.slow_log engine=archive;
ERROR HY000: This storage engine cannot be used for log tables"
alter table mysql.slow_log engine=blackhole;
ERROR HY000: This storage engine cannot be used for log tables"
+set storage_engine= @save_storage_engine;
drop table mysql.slow_log;
drop table mysql.general_log;
drop table mysql.general_log;
@@ -214,6 +268,7 @@ flush tables with read lock;
unlock tables;
use mysql;
lock tables general_log read local, help_category read local;
+ERROR HY000: You can't use locks with log tables.
unlock tables;
use mysql;
RENAME TABLE general_log TO renamed_general_log;
@@ -255,9 +310,9 @@ RENAME TABLE general_log TO general_log2;
set global slow_query_log='OFF';
RENAME TABLE slow_log TO slow_log2;
set global general_log='ON';
-ERROR HY000: Cannot activate 'general' log
+ERROR 42S02: Table 'mysql.general_log' doesn't exist
set global slow_query_log='ON';
-ERROR HY000: Cannot activate 'slow query' log
+ERROR 42S02: Table 'mysql.slow_log' doesn't exist
RENAME TABLE general_log2 TO general_log;
RENAME TABLE slow_log2 TO slow_log;
set global general_log='ON';
@@ -284,3 +339,265 @@ slow_log
slow_log_new
drop table slow_log_new, general_log_new;
use test;
+SET GLOBAL LOG_OUTPUT = 'TABLE';
+SET GLOBAL general_log = 0;
+FLUSH LOGS;
+TRUNCATE TABLE mysql.general_log;
+ALTER TABLE mysql.general_log ENGINE = MyISAM;
+ALTER TABLE mysql.general_log
+ADD COLUMN seq BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY;
+SET GLOBAL general_log = 1;
+FLUSH LOGS;
+SELECT * FROM mysql.general_log;
+event_time user_host thread_id server_id command_type argument seq
+EVENT_TIME USER_HOST THREAD_ID SERVER_ID Query FLUSH LOGS 1
+EVENT_TIME USER_HOST THREAD_ID SERVER_ID Query SELECT * FROM mysql.general_log 2
+SELECT * FROM mysql.general_log;
+event_time user_host thread_id server_id command_type argument seq
+EVENT_TIME USER_HOST THREAD_ID SERVER_ID Query FLUSH LOGS 1
+EVENT_TIME USER_HOST THREAD_ID SERVER_ID Query SELECT * FROM mysql.general_log 2
+EVENT_TIME USER_HOST THREAD_ID SERVER_ID Query SELECT * FROM mysql.general_log 3
+SELECT "My own query 1";
+My own query 1
+My own query 1
+SELECT "My own query 2";
+My own query 2
+My own query 2
+SELECT * FROM mysql.general_log;
+event_time user_host thread_id server_id command_type argument seq
+EVENT_TIME USER_HOST THREAD_ID SERVER_ID Query FLUSH LOGS 1
+EVENT_TIME USER_HOST THREAD_ID SERVER_ID Query SELECT * FROM mysql.general_log 2
+EVENT_TIME USER_HOST THREAD_ID SERVER_ID Query SELECT * FROM mysql.general_log 3
+EVENT_TIME USER_HOST THREAD_ID SERVER_ID Query SELECT "My own query 1" 4
+EVENT_TIME USER_HOST THREAD_ID SERVER_ID Query SELECT "My own query 2" 5
+EVENT_TIME USER_HOST THREAD_ID SERVER_ID Query SELECT * FROM mysql.general_log 6
+SET GLOBAL general_log = 0;
+FLUSH LOGS;
+ALTER TABLE mysql.general_log DROP COLUMN seq;
+ALTER TABLE mysql.general_log ENGINE = CSV;
+SET @old_long_query_time:=@@long_query_time;
+SET GLOBAL slow_query_log = 0;
+FLUSH LOGS;
+TRUNCATE TABLE mysql.slow_log;
+ALTER TABLE mysql.slow_log ENGINE = MyISAM;
+ALTER TABLE mysql.slow_log
+ADD COLUMN seq BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY;
+SET SESSION long_query_time = 1;
+SET GLOBAL slow_query_log = 1;
+FLUSH LOGS;
+SELECT "My own slow query", sleep(2);
+My own slow query sleep(2)
+My own slow query 0
+SELECT "My own slow query", sleep(2);
+My own slow query sleep(2)
+My own slow query 0
+SELECT "My own slow query", sleep(2);
+My own slow query sleep(2)
+My own slow query 0
+SELECT "My own slow query", sleep(2);
+My own slow query sleep(2)
+My own slow query 0
+SELECT * FROM mysql.slow_log WHERE seq >= 2 LIMIT 3;
+start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text seq
+START_TIME USER_HOST QUERY_TIME 00:00:00 1 0 test NULL NULL 1 SELECT "My own slow query", sleep(2) 2
+START_TIME USER_HOST QUERY_TIME 00:00:00 1 0 test NULL NULL 1 SELECT "My own slow query", sleep(2) 3
+START_TIME USER_HOST QUERY_TIME 00:00:00 1 0 test NULL NULL 1 SELECT "My own slow query", sleep(2) 4
+SET GLOBAL slow_query_log = 0;
+SET SESSION long_query_time =@old_long_query_time;
+FLUSH LOGS;
+ALTER TABLE mysql.slow_log DROP COLUMN seq;
+ALTER TABLE mysql.slow_log ENGINE = CSV;
+drop procedure if exists proc25422_truncate_slow;
+drop procedure if exists proc25422_truncate_general;
+drop procedure if exists proc25422_alter_slow;
+drop procedure if exists proc25422_alter_general;
+use test//
+create procedure proc25422_truncate_slow (loops int)
+begin
+declare v1 int default 0;
+declare continue handler for sqlexception /* errors from truncate */
+begin end;
+while v1 < loops do
+truncate mysql.slow_log;
+set v1 = v1 + 1;
+end while;
+end//
+create procedure proc25422_truncate_general (loops int)
+begin
+declare v1 int default 0;
+declare continue handler for sqlexception /* errors from truncate */
+begin end;
+while v1 < loops do
+truncate mysql.general_log;
+set v1 = v1 + 1;
+end while;
+end//
+create procedure proc25422_alter_slow (loops int)
+begin
+declare v1 int default 0;
+declare ER_BAD_LOG_STATEMENT condition for 1575;
+declare continue handler for ER_BAD_LOG_STATEMENT begin end;
+while v1 < loops do
+set @old_log_state = @@global.slow_query_log;
+set global slow_query_log = 'OFF';
+alter table mysql.slow_log engine = CSV;
+set global slow_query_log = @old_log_state;
+set v1 = v1 + 1;
+end while;
+end//
+create procedure proc25422_alter_general (loops int)
+begin
+declare v1 int default 0;
+declare ER_BAD_LOG_STATEMENT condition for 1575;
+declare continue handler for ER_BAD_LOG_STATEMENT begin end;
+while v1 < loops do
+set @old_log_state = @@global.general_log;
+set global general_log = 'OFF';
+alter table mysql.general_log engine = CSV;
+set global general_log = @old_log_state;
+set v1 = v1 + 1;
+end while;
+end//
+set @iterations=100;
+"Serial test (proc25422_truncate_slow)"
+call proc25422_truncate_slow(@iterations);
+"Serial test (proc25422_truncate_general)"
+call proc25422_truncate_general(@iterations);
+"Serial test (proc25422_alter_slow)"
+call proc25422_alter_slow(@iterations);
+"Serial test (proc25422_alter_general)"
+call proc25422_alter_general(@iterations);
+"Parallel test"
+call proc25422_truncate_slow(@iterations);
+call proc25422_truncate_slow(@iterations);
+call proc25422_truncate_general(@iterations);
+call proc25422_truncate_general(@iterations);
+call proc25422_alter_slow(@iterations);
+call proc25422_alter_slow(@iterations);
+call proc25422_alter_general(@iterations);
+call proc25422_alter_general(@iterations);
+drop procedure proc25422_truncate_slow;
+drop procedure proc25422_truncate_general;
+drop procedure proc25422_alter_slow;
+drop procedure proc25422_alter_general;
+FLUSH TABLE mysql.general_log;
+show warnings;
+Level Code Message
+FLUSH TABLE mysql.slow_log;
+show warnings;
+Level Code Message
+DROP TABLE IF EXISTS `db_17876.slow_log_data`;
+DROP TABLE IF EXISTS `db_17876.general_log_data`;
+DROP PROCEDURE IF EXISTS `db_17876.archiveSlowLog`;
+DROP PROCEDURE IF EXISTS `db_17876.archiveGeneralLog`;
+DROP DATABASE IF EXISTS `db_17876`;
+CREATE DATABASE db_17876;
+CREATE TABLE `db_17876.slow_log_data` (
+`start_time` timestamp default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+`user_host` mediumtext ,
+`query_time` time ,
+`lock_time` time ,
+`rows_sent` int(11) ,
+`rows_examined` int(11) ,
+`db` varchar(512) default NULL,
+`last_insert_id` int(11) default NULL,
+`insert_id` int(11) default NULL,
+`server_id` int(11) default NULL,
+`sql_text` mediumtext
+);
+CREATE TABLE `db_17876.general_log_data` (
+`event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+`user_host` mediumtext,
+`thread_id` int(11) DEFAULT NULL,
+`server_id` int(11) DEFAULT NULL,
+`command_type` varchar(64) DEFAULT NULL,
+`argument` mediumtext
+);
+CREATE procedure `db_17876.archiveSlowLog`()
+BEGIN
+DECLARE start_time, query_time, lock_time CHAR(20);
+DECLARE user_host MEDIUMTEXT;
+DECLARE rows_set, rows_examined, last_insert_id, insert_id, server_id INT;
+DECLARE dbname MEDIUMTEXT;
+DECLARE sql_text BLOB;
+DECLARE done INT DEFAULT 0;
+DECLARE ER_SP_FETCH_NO_DATA CONDITION for 1329;
+DECLARE cur1 CURSOR FOR SELECT * FROM mysql.slow_log;
+OPEN cur1;
+REPEAT
+BEGIN
+BEGIN
+DECLARE CONTINUE HANDLER FOR ER_SP_FETCH_NO_DATA SET done = 1;
+FETCH cur1 INTO
+start_time, user_host, query_time, lock_time,
+rows_set, rows_examined, dbname, last_insert_id,
+insert_id, server_id, sql_text;
+END;
+IF NOT done THEN
+BEGIN
+INSERT INTO
+`db_17876.slow_log_data`
+ VALUES(start_time, user_host, query_time, lock_time, rows_set, rows_examined,
+dbname, last_insert_id, insert_id, server_id, sql_text);
+END;
+END IF;
+END;
+UNTIL done END REPEAT;
+CLOSE cur1;
+TRUNCATE mysql.slow_log;
+END //
+CREATE procedure `db_17876.archiveGeneralLog`()
+BEGIN
+DECLARE event_time CHAR(20);
+DECLARE user_host, argument MEDIUMTEXT;
+DECLARE thread_id, server_id INT;
+DECLARE sql_text BLOB;
+DECLARE done INT DEFAULT 0;
+DECLARE command_type VARCHAR(64);
+DECLARE ER_SP_FETCH_NO_DATA CONDITION for 1329;
+DECLARE cur1 CURSOR FOR SELECT * FROM mysql.general_log;
+OPEN cur1;
+REPEAT
+BEGIN
+BEGIN
+DECLARE CONTINUE HANDLER FOR ER_SP_FETCH_NO_DATA SET done = 1;
+FETCH cur1 INTO
+event_time, user_host, thread_id, server_id,
+command_type, argument;
+END;
+IF NOT done THEN
+BEGIN
+INSERT INTO
+`db_17876.general_log_data`
+ VALUES(event_time, user_host, thread_id, server_id,
+command_type, argument);
+END;
+END IF;
+END;
+UNTIL done END REPEAT;
+CLOSE cur1;
+TRUNCATE mysql.general_log;
+END //
+SET @old_general_log_state = @@global.general_log;
+SET @old_slow_log_state = @@global.slow_query_log;
+SET GLOBAL general_log = ON;
+SET GLOBAL slow_query_log = ON;
+select "put something into general_log";
+put something into general_log
+put something into general_log
+select "... and something more ...";
+... and something more ...
+... and something more ...
+call `db_17876.archiveSlowLog`();
+call `db_17876.archiveGeneralLog`();
+SET GLOBAL general_log = OFF;
+SET GLOBAL slow_query_log = OFF;
+call `db_17876.archiveSlowLog`();
+call `db_17876.archiveGeneralLog`();
+DROP TABLE `db_17876.slow_log_data`;
+DROP TABLE `db_17876.general_log_data`;
+DROP PROCEDURE IF EXISTS `db_17876.archiveSlowLog`;
+DROP PROCEDURE IF EXISTS `db_17876.archiveGeneralLog`;
+DROP DATABASE IF EXISTS `db_17876`;
+SET GLOBAL general_log = @old_general_log_state;
+SET GLOBAL slow_query_log = @old_slow_log_state;
diff --git a/mysql-test/r/long_tmpdir.result b/mysql-test/r/long_tmpdir.result
new file mode 100644
index 00000000000..7e6dd34ced1
--- /dev/null
+++ b/mysql-test/r/long_tmpdir.result
@@ -0,0 +1,3 @@
+create view v1 as select table_name from information_schema.tables;
+drop view v1;
+End of 5.0 tests
diff --git a/mysql-test/r/lowercase_table3.result b/mysql-test/r/lowercase_table3.result
index 995a2c0d08a..14cff4f98c9 100644
--- a/mysql-test/r/lowercase_table3.result
+++ b/mysql-test/r/lowercase_table3.result
@@ -4,7 +4,7 @@ SELECT * from T1;
a
drop table t1;
flush tables;
-CREATE TABLE t1 (a int) ENGINE=INNODB;
-SELECT * from T1;
-ERROR 42S02: Table 'test.T1' doesn't exist
-drop table t1;
+CREATE TABLE bug29839 (a int) ENGINE=INNODB;
+SELECT * from BUG29839;
+ERROR 42S02: Table 'test.BUG29839' doesn't exist
+drop table bug29839;
diff --git a/mysql-test/r/lowercase_view.result b/mysql-test/r/lowercase_view.result
index f09725dafcb..3653461c6b8 100644
--- a/mysql-test/r/lowercase_view.result
+++ b/mysql-test/r/lowercase_view.result
@@ -6,8 +6,8 @@ use MySQLTest;
create table TaB (Field int);
create view ViE as select * from TAb;
show create table VIe;
-View Create View
-vie CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vie` AS select `tab`.`Field` AS `Field` from `tab`
+View Create View character_set_client collation_connection
+vie CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vie` AS select `tab`.`Field` AS `Field` from `tab` latin1 latin1_swedish_ci
drop database MySQLTest;
use test;
create table t1Aa (col1 int);
@@ -118,8 +118,8 @@ drop table t1Aa,t2Aa;
create table t1Aa (col1 int);
create view v1Aa as select col1 from t1Aa as AaA;
show create view v1AA;
-View Create View
-v1aa CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1aa` AS select `aaa`.`col1` AS `col1` from `t1aa` `AaA`
+View Create View character_set_client collation_connection
+v1aa CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1aa` AS select `aaa`.`col1` AS `col1` from `t1aa` `AaA` latin1 latin1_swedish_ci
drop view v1AA;
select Aaa.col1 from t1Aa as AaA;
col1
@@ -127,7 +127,7 @@ create view v1Aa as select Aaa.col1 from t1Aa as AaA;
drop view v1AA;
create view v1Aa as select AaA.col1 from t1Aa as AaA;
show create view v1AA;
-View Create View
-v1aa CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1aa` AS select `aaa`.`col1` AS `col1` from `t1aa` `AaA`
+View Create View character_set_client collation_connection
+v1aa CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1aa` AS select `aaa`.`col1` AS `col1` from `t1aa` `AaA` latin1 latin1_swedish_ci
drop view v1AA;
drop table t1Aa;
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index 17a3bc0877e..5aa4288500c 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -86,7 +86,7 @@ a b
19 Testing
explain select a from t3 order by a desc limit 10;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t3 index NULL a 4 NULL 1131 Using index
+1 SIMPLE t3 index NULL a 4 NULL 10 Using index
select a from t3 order by a desc limit 10;
a
699
@@ -847,4 +847,36 @@ insert into t1 values (1);
ERROR HY000: Table 't1' is read only
drop table t2;
drop table t1;
+CREATE TABLE tm1(a INT) ENGINE=MERGE UNION=(t1, t2);
+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.t1' is differently defined or of non-MyISAM type or doesn't exist
+test.tm1 check Error 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
+CREATE TABLE t1(a INT);
+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 Error Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
+test.tm1 check error Corrupt
+CREATE TABLE t2(a BLOB);
+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 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;
+SELECT * FROM tm1;
+a
+CHECK TABLE tm1;
+Table Op Msg_type Msg_text
+test.tm1 check status OK
+DROP TABLE tm1, t1, t2;
End of 5.0 tests
diff --git a/mysql-test/r/metadata.result b/mysql-test/r/metadata.result
index 34e961395c4..4a776b6a253 100644
--- a/mysql-test/r/metadata.result
+++ b/mysql-test/r/metadata.result
@@ -130,3 +130,55 @@ def v3 renamed 8 12 0 Y 32896 0 63
renamed
drop table t1;
drop view v1,v2,v3;
+select a.* from (select 2147483648 as v_large) a;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def a v_large v_large 8 10 10 N 32769 0 63
+v_large
+2147483648
+select a.* from (select 214748364 as v_small) a;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def a v_small v_small 3 9 9 N 32769 0 63
+v_small
+214748364
+CREATE TABLE t1 (c1 CHAR(1));
+CREATE TABLE t2 (c2 CHAR(1));
+CREATE VIEW v1 AS SELECT t1.c1 FROM t1;
+CREATE VIEW v2 AS SELECT t2.c2 FROM t2;
+INSERT INTO t1 VALUES ('1'), ('2'), ('3');
+INSERT INTO t2 VALUES ('1'), ('2'), ('3'), ('2');
+SELECT v1.c1 FROM v1 JOIN t2 ON c1=c2 ORDER BY 1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 v1 c1 c1 254 1 1 Y 0 0 8
+c1
+1
+2
+2
+3
+SELECT v1.c1, v2.c2 FROM v1 JOIN v2 ON c1=c2;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 v1 c1 c1 254 1 1 Y 0 0 8
+def test t2 v2 c2 c2 254 1 1 Y 0 0 8
+c1 c2
+1 1
+2 2
+3 3
+2 2
+SELECT v1.c1, v2.c2 FROM v1 JOIN v2 ON c1=c2 GROUP BY v1.c1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 v1 c1 c1 254 1 1 Y 32768 0 8
+def test t2 v2 c2 c2 254 1 1 Y 0 0 8
+c1 c2
+1 1
+2 2
+3 3
+SELECT v1.c1, v2.c2 FROM v1 JOIN v2 ON c1=c2 GROUP BY v1.c1 ORDER BY v2.c2;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 v1 c1 c1 254 1 1 Y 32768 0 8
+def test t2 v2 c2 c2 254 1 1 Y 0 0 8
+c1 c2
+1 1
+2 2
+3 3
+DROP VIEW v1,v2;
+DROP TABLE t1,t2;
+End of 5.0 tests
diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result
index 6d8e5dfdf2c..55e47756312 100644
--- a/mysql-test/r/multi_update.result
+++ b/mysql-test/r/multi_update.result
@@ -604,3 +604,38 @@ id c1 c2
2 test t ppc
9 abc ppc
drop table t1, t2;
+CREATE TABLE `t1` (
+`a` int(11) NOT NULL auto_increment,
+`b` int(11) default NULL,
+PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
+CREATE TABLE `t2` (
+`a` int(11) NOT NULL auto_increment,
+`b` int(11) default NULL,
+PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
+set @@session.binlog_format= mixed;
+insert into t1 values (1,1),(2,2);
+insert into t2 values (1,1),(4,4);
+reset master;
+UPDATE t2,t1 SET t2.a=t1.a+2;
+ERROR 23000: Duplicate entry '3' for key 'PRIMARY'
+select * from t2 /* must be (3,1), (4,4) */;
+a b
+3 1
+4 4
+show master status /* there must be the UPDATE query event */;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000001 197
+delete from t1;
+delete from t2;
+insert into t1 values (1,2),(3,4),(4,4);
+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 the UPDATE query event */;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000001 212
+drop table t1, t2;
+end of tests
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
index e9d798d998d..73661897ee1 100644
--- a/mysql-test/r/myisam.result
+++ b/mysql-test/r/myisam.result
@@ -345,12 +345,12 @@ t1 1 c_2 1 c A 5 NULL NULL YES BTREE
t1 1 c_2 2 a A 5 NULL NULL BTREE
explain select * from t1,t2 where t1.a=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL a NULL NULL NULL 2 Using join cache
-1 SIMPLE t1 ALL a NULL NULL NULL 5 Using where
+1 SIMPLE t2 ALL a NULL NULL NULL 2
+1 SIMPLE t1 ALL a NULL NULL NULL 5 Using where; Using join buffer
explain select * from t1,t2 force index(a) where t1.a=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL a NULL NULL NULL 2 Using join cache
-1 SIMPLE t1 ALL a NULL NULL NULL 5 Using where
+1 SIMPLE t2 ALL a NULL NULL NULL 2
+1 SIMPLE t1 ALL a NULL NULL NULL 5 Using where; Using join buffer
explain select * from t1 force index(a),t2 force index(a) where t1.a=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL a NULL NULL NULL 2
@@ -361,8 +361,8 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref b b 5 test.t2.b 1 Using where
explain select * from t1,t2 force index(c) where t1.a=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using join cache
-1 SIMPLE t1 ALL a NULL NULL NULL 5 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 2
+1 SIMPLE t1 ALL a NULL NULL NULL 5 Using where; Using join buffer
explain select * from t1 where a=0 or a=2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL a NULL NULL NULL 5 Using where
@@ -1768,6 +1768,32 @@ create table t3 (c1 int) engine=myisam pack_keys=default;
create table t4 (c1 int) engine=myisam pack_keys=2;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '2' at line 1
drop table t1, t2, t3;
+CREATE TABLE t1(a INT, b INT, KEY inx (a), UNIQUE KEY uinx (b)) ENGINE=MyISAM;
+INSERT INTO t1(a,b) VALUES (1,1),(2,2),(3,3),(4,4),(5,5);
+SELECT a FROM t1 FORCE INDEX (inx) WHERE a=1;
+a
+1
+ALTER TABLE t1 DISABLE KEYS;
+SELECT a FROM t1 FORCE INDEX (inx) WHERE a=1;
+a
+1
+SELECT a FROM t1 USE INDEX (inx) WHERE a=1;
+a
+1
+SELECT b FROM t1 FORCE INDEX (uinx) WHERE b=1;
+b
+1
+SELECT b FROM t1 USE INDEX (uinx) WHERE b=1;
+b
+1
+SELECT a FROM t1 FORCE INDEX (inx,uinx) WHERE a=1;
+a
+1
+ALTER TABLE t1 ENABLE KEYS;
+SELECT a FROM t1 FORCE INDEX (inx) WHERE a=1;
+a
+1
+DROP TABLE t1;
End of 5.0 tests
create table t1 (a int not null, key `a` (a) key_block_size=1024);
show create table t1;
diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result
index 57e1f2e4ef6..4e39fb28454 100644
--- a/mysql-test/r/mysql.result
+++ b/mysql-test/r/mysql.result
@@ -91,7 +91,7 @@ i j k
NULL 1 NULL
Field Type Null Key Default Extra
i int(11) YES NULL
-j int(11) NO
+j int(11) NO NULL
k int(11) YES NULL
+------+---+------+
| i | j | k |
@@ -102,7 +102,7 @@ k int(11) YES NULL
| Field | Type | Null | Key | Default | Extra |
+-------+---------+------+-----+---------+-------+
| i | int(11) | YES | | NULL | |
-| j | int(11) | NO | | | |
+| j | int(11) | NO | | NULL | |
| k | int(11) | YES | | NULL | |
+-------+---------+------+-----+---------+-------+
i s1
@@ -176,4 +176,7 @@ ERROR at line 1: DELIMITER cannot contain a backslash character
ERROR at line 1: DELIMITER cannot contain a backslash character
1
1
+1
+1
End of 5.0 tests
+WARNING: --server-arg option not supported in this configuration.
diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result
index 95aa795a2eb..31846f68b7b 100644
--- a/mysql-test/r/mysql_upgrade.result
+++ b/mysql-test/r/mysql_upgrade.result
@@ -3,7 +3,9 @@ mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
-mysql.general_log OK
+mysql.general_log
+Error : You can't use locks with log tables.
+status : OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
@@ -14,7 +16,9 @@ mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.servers OK
-mysql.slow_log OK
+mysql.slow_log
+Error : You can't use locks with log tables.
+status : OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
@@ -29,7 +33,9 @@ mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
-mysql.general_log OK
+mysql.general_log
+Error : You can't use locks with log tables.
+status : OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
@@ -40,7 +46,9 @@ mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.servers OK
-mysql.slow_log OK
+mysql.slow_log
+Error : You can't use locks with log tables.
+status : OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
@@ -55,7 +63,9 @@ mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
-mysql.general_log OK
+mysql.general_log
+Error : You can't use locks with log tables.
+status : OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
@@ -66,7 +76,9 @@ mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.servers OK
-mysql.slow_log OK
+mysql.slow_log
+Error : You can't use locks with log tables.
+status : OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
@@ -78,3 +90,32 @@ DROP USER mysqltest1@'%';
Run mysql_upgrade with a non existing server socket
mysqlcheck: Got error: 2005: Unknown MySQL server host 'not_existing_host' (errno) when trying to connect
FATAL ERROR: Upgrade failed
+set GLOBAL sql_mode='STRICT_ALL_TABLES,ANSI_QUOTES,NO_ZERO_DATE';
+mysql.columns_priv OK
+mysql.db OK
+mysql.event OK
+mysql.func OK
+mysql.general_log
+Error : You can't use locks with log tables.
+status : OK
+mysql.help_category OK
+mysql.help_keyword OK
+mysql.help_relation OK
+mysql.help_topic OK
+mysql.host OK
+mysql.ndb_binlog_index OK
+mysql.plugin OK
+mysql.proc OK
+mysql.procs_priv OK
+mysql.servers OK
+mysql.slow_log
+Error : You can't use locks with log tables.
+status : OK
+mysql.tables_priv OK
+mysql.time_zone OK
+mysql.time_zone_leap_second OK
+mysql.time_zone_name OK
+mysql.time_zone_transition OK
+mysql.time_zone_transition_type OK
+mysql.user OK
+set GLOBAL sql_mode=default;
diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result
index 57961698034..f10ae4b4df5 100644
--- a/mysql-test/r/mysqlbinlog.result
+++ b/mysql-test/r/mysqlbinlog.result
@@ -313,6 +313,19 @@ DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+CREATE TABLE t1 (c1 CHAR(10));
+flush logs;
+INSERT INTO t1 VALUES ('0123456789');
+flush logs;
+DROP TABLE t1;
+# Query thread_id=REMOVED exec_time=REMOVED error_code=REMOVED
+flush logs;
+create table t1(a int);
+insert into t1 values(connection_id());
+flush logs;
+drop table t1;
+1
+drop table t1;
End of 5.0 tests
flush logs;
End of 5.1 tests
diff --git a/mysql-test/r/mysqlbinlog2.result b/mysql-test/r/mysqlbinlog2.result
index ef6e4ee80fd..5347787d829 100644
--- a/mysql-test/r/mysqlbinlog2.result
+++ b/mysql-test/r/mysqlbinlog2.result
@@ -18,7 +18,11 @@ insert into t1 values(null, "f");
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
+# at {pos}
+#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Start: binlog v #, server v ## created {yymmdd} {HH:MM:SS} at startup
ROLLBACK/*!*/;
+# at {pos}
+#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
@@ -26,21 +30,43 @@ SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))/*!*/;
+# at {pos}
+#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar
SET INSERT_ID=1/*!*/;
+# at {pos}
+#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")/*!*/;
+# at {pos}
+#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar
SET INSERT_ID=2/*!*/;
+# at {pos}
+#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")/*!*/;
+# at {pos}
+#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar
SET INSERT_ID=3/*!*/;
+# at {pos}
+#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0
SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")/*!*/;
+# at {pos}
+#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar
SET INSERT_ID=4/*!*/;
+# at {pos}
+#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")/*!*/;
+# at {pos}
+#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar
SET INSERT_ID=5/*!*/;
+# at {pos}
+#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")/*!*/;
+# at {pos}
+#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Rotate to master-bin.000002 pos: {pos}
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
diff --git a/mysql-test/r/mysqldump-compat.result b/mysql-test/r/mysqldump-compat.result
new file mode 100644
index 00000000000..f15cc7a1d7a
--- /dev/null
+++ b/mysql-test/r/mysqldump-compat.result
@@ -0,0 +1,4 @@
+CREATE DATABASE mysqldump_30126;
+USE mysqldump_30126;
+CREATE TABLE t1 (c1 int);
+DROP DATABASE mysqldump_30126;
diff --git a/mysql-test/r/mysqldump-max.result b/mysql-test/r/mysqldump-max.result
index e78fc4d386a..2d118092a2c 100644
--- a/mysql-test/r/mysqldump-max.result
+++ b/mysql-test/r/mysqldump-max.result
@@ -93,55 +93,73 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
USE `test`;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
DROP TABLE IF EXISTS `t2`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t2` (
`id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
DROP TABLE IF EXISTS `t3`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t3` (
`id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
/*!40000 ALTER TABLE `t3` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t3` ENABLE KEYS */;
DROP TABLE IF EXISTS `t4`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t4` (
`id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
/*!40000 ALTER TABLE `t4` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t4` ENABLE KEYS */;
DROP TABLE IF EXISTS `t5`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t5` (
`id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
/*!40000 ALTER TABLE `t5` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t5` ENABLE KEYS */;
DROP TABLE IF EXISTS `t6`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t6` (
`id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
/*!40000 ALTER TABLE `t6` DISABLE KEYS */;
INSERT IGNORE INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
@@ -172,55 +190,73 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
USE `test`;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
INSERT DELAYED INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
DROP TABLE IF EXISTS `t2`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t2` (
`id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
INSERT DELAYED INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
DROP TABLE IF EXISTS `t3`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t3` (
`id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
/*!40000 ALTER TABLE `t3` DISABLE KEYS */;
INSERT DELAYED INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t3` ENABLE KEYS */;
DROP TABLE IF EXISTS `t4`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t4` (
`id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
/*!40000 ALTER TABLE `t4` DISABLE KEYS */;
INSERT DELAYED INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t4` ENABLE KEYS */;
DROP TABLE IF EXISTS `t5`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t5` (
`id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
/*!40000 ALTER TABLE `t5` DISABLE KEYS */;
INSERT DELAYED INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t5` ENABLE KEYS */;
DROP TABLE IF EXISTS `t6`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t6` (
`id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
/*!40000 ALTER TABLE `t6` DISABLE KEYS */;
INSERT INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index af0db95d97c..d8688ea5509 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -29,9 +29,12 @@ DROP TABLE t1;
CREATE TABLE t1 (a decimal(64, 20));
INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890"),
("0987654321098765432109876543210987654321");
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` decimal(64,20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
INSERT INTO `t1` VALUES ('1234567890123456789012345678901234567890.00000000000000000000'),('987654321098765432109876543210987654321.00000000000000000000');
DROP TABLE t1;
#
@@ -41,9 +44,12 @@ CREATE TABLE t1 (a double);
INSERT INTO t1 VALUES ('-9e999999');
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` double DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
INSERT INTO `t1` VALUES (RES);
DROP TABLE t1;
#
@@ -59,15 +65,21 @@ INSERT INTO t1 VALUES ('1.2345', 2.3456);
INSERT INTO t1 VALUES ("1.2345", 2.3456);
ERROR 42S22: Unknown column '1.2345' in 'field list'
SET SQL_MODE=@OLD_SQL_MODE;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` decimal(10,5) DEFAULT NULL,
`b` float DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+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);
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` decimal(10,5) DEFAULT NULL,
`b` float DEFAULT NULL
);
+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);
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
@@ -81,10 +93,13 @@ INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456)
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` decimal(10,5) DEFAULT NULL,
`b` float DEFAULT NULL
);
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -107,10 +122,13 @@ UNLOCK TABLES;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` decimal(10,5) DEFAULT NULL,
`b` float DEFAULT NULL
);
+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);
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -186,9 +204,12 @@ INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL);
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=koi8r;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -219,9 +240,12 @@ INSERT INTO t1 VALUES (1), (2);
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL40' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) TYPE=MyISAM;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -242,9 +266,12 @@ UNLOCK TABLES;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) TYPE=MyISAM;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -263,9 +290,12 @@ DROP TABLE t1;
# Bug #2592 'mysqldump doesn't quote "tricky" names correctly'
#
create table ```a` (i int);
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE ```a` (
`i` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
drop table ```a`;
#
# Bug #2591 "mysqldump quotes names inconsistently"
@@ -283,9 +313,12 @@ create table t1(a int);
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -308,9 +341,12 @@ UNLOCK TABLES;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS "t1";
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE "t1" (
"a" int(11) DEFAULT NULL
);
+SET character_set_client = @saved_cs_client;
LOCK TABLES "t1" WRITE;
/*!40000 ALTER TABLE "t1" DISABLE KEYS */;
@@ -336,9 +372,12 @@ set global sql_mode='ANSI_QUOTES';
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -361,9 +400,12 @@ UNLOCK TABLES;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS "t1";
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE "t1" (
"a" int(11) DEFAULT NULL
);
+SET character_set_client = @saved_cs_client;
LOCK TABLES "t1" WRITE;
/*!40000 ALTER TABLE "t1" DISABLE KEYS */;
@@ -393,9 +435,12 @@ insert into t1 values (1),(2),(3);
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -484,9 +529,12 @@ INSERT INTO t1 VALUES (_latin1 'ÄÖÜß');
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` char(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -517,9 +565,12 @@ UNLOCK TABLES;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` char(10) DEFAULT NULL
) TYPE=MyISAM;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -540,9 +591,12 @@ UNLOCK TABLES;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` char(10) DEFAULT NULL
) TYPE=MyISAM;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -563,9 +617,12 @@ UNLOCK TABLES;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` char(10) DEFAULT NULL
) TYPE=MyISAM;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -599,9 +656,12 @@ INSERT INTO t2 VALUES (4),(5),(6);
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t2`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t2` WRITE;
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
@@ -637,9 +697,12 @@ INSERT INTO `t1` VALUES (0x602010000280100005E71A);
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`b` blob
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -675,9 +738,12 @@ INSERT INTO t1 VALUES (4),(5),(6);
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -706,9 +772,12 @@ UNLOCK TABLES;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6);
@@ -1072,6 +1141,8 @@ insert into t1 (F_8d3bba7425e7c98c50f52ca1b52d3735) values (1);
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`F_c4ca4238a0b923820dcc509a6f75849b` int(11) DEFAULT NULL,
`F_c81e728d9d4c2f636f067f89cc14862c` int(11) DEFAULT NULL,
@@ -1404,6 +1475,7 @@ CREATE TABLE `t1` (
`F_6faa8040da20ef399b63a72d0e4ab575` int(11) DEFAULT NULL,
`F_fe73f687e5bc5280214e0486b273a5f9` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -1444,9 +1516,12 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
USE `test`;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -1485,13 +1560,19 @@ INSERT INTO t2 VALUES (1), (2);
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `t2`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@@ -1514,13 +1595,19 @@ CREATE TABLE `t2` (
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `t2`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@@ -1720,17 +1807,26 @@ create table t3(a int);
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t3`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t3` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `t2`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@@ -1760,9 +1856,12 @@ mysqldump: Got error: 1064: You have an error in your SQL syntax; check the manu
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -1793,12 +1892,15 @@ insert into t1 values (0815, 4711, 2006);
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS "t1";
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE "t1" (
"a b" int(11) NOT NULL DEFAULT '0',
"c""d" int(11) NOT NULL DEFAULT '0',
"e`f" int(11) NOT NULL DEFAULT '0',
PRIMARY KEY ("a b","c""d","e`f")
);
+SET character_set_client = @saved_cs_client;
LOCK TABLES "t1" WRITE;
/*!40000 ALTER TABLE "t1" DISABLE KEYS */;
@@ -1824,12 +1926,15 @@ UNLOCK TABLES;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a b` int(11) NOT NULL DEFAULT '0',
`c"d` int(11) NOT NULL DEFAULT '0',
`e``f` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`a b`,`c"d`,`e``f`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -1875,10 +1980,13 @@ create view v2 as select * from t2 where a like 'a%' with check option;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t2`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t2` (
`a` varchar(30) DEFAULT NULL,
KEY `a` (`a`(5))
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t2` WRITE;
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
@@ -1887,15 +1995,27 @@ INSERT INTO `t2` VALUES ('alfred'),('angie'),('bingo'),('waffle'),('lemon');
UNLOCK TABLES;
DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
/*!50001 CREATE TABLE `v2` (
`a` varchar(30)
) */;
-/*!50001 DROP TABLE IF EXISTS `v2`*/;
+SET character_set_client = @saved_cs_client;
+/*!50001 DROP TABLE `v2`*/;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
+/*!50001 SET @saved_cs_client = @@character_set_client */;
+/*!50001 SET @saved_cs_results = @@character_set_results */;
+/*!50001 SET @saved_col_connection = @@collation_connection */;
+/*!50001 SET character_set_client = latin1 */;
+/*!50001 SET character_set_results = latin1 */;
+/*!50001 SET collation_connection = latin1_swedish_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v2` AS select `t2`.`a` AS `a` from `t2` where (`t2`.`a` like _latin1'a%') */
/*!50002 WITH CASCADED CHECK OPTION */;
+/*!50001 SET character_set_client = @saved_cs_client */;
+/*!50001 SET character_set_results = @saved_cs_results */;
+/*!50001 SET collation_connection = @saved_col_connection */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@@ -1959,9 +2079,12 @@ create view v1 as select * from t1;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -1969,14 +2092,26 @@ LOCK TABLES `t1` WRITE;
UNLOCK TABLES;
DROP TABLE IF EXISTS `v1`;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
/*!50001 CREATE TABLE `v1` (
`a` int(11)
) */;
-/*!50001 DROP TABLE IF EXISTS `v1`*/;
+SET character_set_client = @saved_cs_client;
+/*!50001 DROP TABLE `v1`*/;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
+/*!50001 SET @saved_cs_client = @@character_set_client */;
+/*!50001 SET @saved_cs_results = @@character_set_results */;
+/*!50001 SET @saved_col_connection = @@collation_connection */;
+/*!50001 SET character_set_client = latin1 */;
+/*!50001 SET character_set_results = latin1 */;
+/*!50001 SET collation_connection = latin1_swedish_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v1` AS select `t1`.`a` AS `a` from `t1` */;
+/*!50001 SET character_set_client = @saved_cs_client */;
+/*!50001 SET character_set_results = @saved_cs_results */;
+/*!50001 SET collation_connection = @saved_col_connection */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@@ -2016,10 +2151,13 @@ create view v2 as select * from t2 where a like 'a%' with check option;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t2`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t2` (
`a` varchar(30) DEFAULT NULL,
KEY `a` (`a`(5))
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t2` WRITE;
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
@@ -2028,15 +2166,27 @@ INSERT INTO `t2` VALUES ('alfred'),('angie'),('bingo'),('waffle'),('lemon');
UNLOCK TABLES;
DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
/*!50001 CREATE TABLE `v2` (
`a` varchar(30)
) */;
-/*!50001 DROP TABLE IF EXISTS `v2`*/;
+SET character_set_client = @saved_cs_client;
+/*!50001 DROP TABLE `v2`*/;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
+/*!50001 SET @saved_cs_client = @@character_set_client */;
+/*!50001 SET @saved_cs_results = @@character_set_results */;
+/*!50001 SET @saved_col_connection = @@collation_connection */;
+/*!50001 SET character_set_client = latin1 */;
+/*!50001 SET character_set_results = latin1 */;
+/*!50001 SET collation_connection = latin1_swedish_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v2` AS select `t2`.`a` AS `a` from `t2` where (`t2`.`a` like _latin1'a%') */
/*!50002 WITH CASCADED CHECK OPTION */;
+/*!50001 SET character_set_client = @saved_cs_client */;
+/*!50001 SET character_set_results = @saved_cs_results */;
+/*!50001 SET collation_connection = @saved_col_connection */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@@ -2068,9 +2218,12 @@ INSERT INTO t1 VALUES ('\'');
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` char(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -2111,11 +2264,14 @@ select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
`c` varchar(30) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -2124,38 +2280,74 @@ INSERT INTO `t1` VALUES (1,2,'one'),(2,4,'two'),(3,6,'three');
UNLOCK TABLES;
DROP TABLE IF EXISTS `v1`;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
/*!50001 CREATE TABLE `v1` (
`a` int(11),
`b` int(11),
`c` varchar(30)
) */;
+SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
/*!50001 CREATE TABLE `v2` (
`a` int(11)
) */;
+SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `v3`;
/*!50001 DROP VIEW IF EXISTS `v3`*/;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
/*!50001 CREATE TABLE `v3` (
`a` int(11),
`b` int(11),
`c` varchar(30)
) */;
-/*!50001 DROP TABLE IF EXISTS `v1`*/;
+SET character_set_client = @saved_cs_client;
+/*!50001 DROP TABLE `v1`*/;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
+/*!50001 SET @saved_cs_client = @@character_set_client */;
+/*!50001 SET @saved_cs_results = @@character_set_results */;
+/*!50001 SET @saved_col_connection = @@collation_connection */;
+/*!50001 SET character_set_client = latin1 */;
+/*!50001 SET character_set_results = latin1 */;
+/*!50001 SET collation_connection = latin1_swedish_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v1` AS select `v3`.`a` AS `a`,`v3`.`b` AS `b`,`v3`.`c` AS `c` from `v3` where (`v3`.`b` in (1,2,3,4,5,6,7)) */;
-/*!50001 DROP TABLE IF EXISTS `v2`*/;
+/*!50001 SET character_set_client = @saved_cs_client */;
+/*!50001 SET character_set_results = @saved_cs_results */;
+/*!50001 SET collation_connection = @saved_col_connection */;
+/*!50001 DROP TABLE `v2`*/;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
+/*!50001 SET @saved_cs_client = @@character_set_client */;
+/*!50001 SET @saved_cs_results = @@character_set_results */;
+/*!50001 SET @saved_col_connection = @@collation_connection */;
+/*!50001 SET character_set_client = latin1 */;
+/*!50001 SET character_set_results = latin1 */;
+/*!50001 SET collation_connection = latin1_swedish_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v2` AS select `v3`.`a` AS `a` from (`v3` join `v1`) where ((`v1`.`a` = `v3`.`a`) and (`v3`.`b` = 3)) limit 1 */;
-/*!50001 DROP TABLE IF EXISTS `v3`*/;
+/*!50001 SET character_set_client = @saved_cs_client */;
+/*!50001 SET character_set_results = @saved_cs_results */;
+/*!50001 SET collation_connection = @saved_col_connection */;
+/*!50001 DROP TABLE `v3`*/;
/*!50001 DROP VIEW IF EXISTS `v3`*/;
+/*!50001 SET @saved_cs_client = @@character_set_client */;
+/*!50001 SET @saved_cs_results = @@character_set_results */;
+/*!50001 SET @saved_col_connection = @@collation_connection */;
+/*!50001 SET character_set_client = latin1 */;
+/*!50001 SET character_set_results = latin1 */;
+/*!50001 SET collation_connection = latin1_swedish_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v3` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b`,`t1`.`c` AS `c` from `t1` */;
+/*!50001 SET character_set_client = @saved_cs_client */;
+/*!50001 SET character_set_results = @saved_cs_results */;
+/*!50001 SET collation_connection = @saved_col_connection */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@@ -2198,21 +2390,21 @@ end if;
end|
set sql_mode=default|
show triggers like "t1";
-Trigger Event Table Statement Timing Created sql_mode Definer
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1 INSERT t1 begin
if new.a > 10 then
set new.a := 10;
set new.a := 11;
end if;
-end BEFORE 0000-00-00 00:00:00 root@localhost
+end BEFORE 0000-00-00 00:00:00 root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
trg2 UPDATE t1 begin
if old.a % 2 = 0 then set new.b := 12; end if;
-end BEFORE 0000-00-00 00:00:00 root@localhost
+end BEFORE 0000-00-00 00:00:00 root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
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
+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
INSERT INTO t1 (a) VALUES (1),(2),(3),(22);
update t1 set a = 4 where a=3;
@@ -2231,62 +2423,109 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
USE `test`;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
INSERT INTO `t1` VALUES (1,NULL),(2,NULL),(4,NULL),(11,NULL);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
-
-/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = latin1 */ ;
+/*!50003 SET character_set_results = latin1 */ ;
+/*!50003 SET collation_connection = latin1_swedish_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
-/*!50003 SET SESSION SQL_MODE="" */;;
-/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `trg1` BEFORE INSERT ON `t1` FOR EACH ROW begin
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 trigger trg1 before insert on t1 for each row
+begin
if new.a > 10 then
set new.a := 10;
set new.a := 11;
end if;
end */;;
-
-/*!50003 SET SESSION SQL_MODE="" */;;
-/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `trg2` BEFORE UPDATE ON `t1` FOR EACH ROW begin
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = latin1 */ ;
+/*!50003 SET character_set_results = latin1 */ ;
+/*!50003 SET collation_connection = latin1_swedish_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = '' */ ;
+DELIMITER ;;
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 trigger trg2 before update on t1 for each row begin
if old.a % 2 = 0 then set new.b := 12; end if;
end */;;
-
-/*!50003 SET SESSION 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 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `trg3` AFTER UPDATE ON `t1` FOR EACH ROW begin
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = latin1 */ ;
+/*!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' */ ;
+DELIMITER ;;
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 trigger trg3 after update on t1 for each row
+begin
if new.a = -1 then
set @fired:= "Yes";
end if;
end */;;
-
DELIMITER ;
-/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
DROP TABLE IF EXISTS `t2`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t2` WRITE;
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
UNLOCK TABLES;
-
-/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = latin1 */ ;
+/*!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' */ ;
DELIMITER ;;
-/*!50003 SET SESSION 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 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `trg4` BEFORE INSERT ON `t2` FOR EACH ROW begin
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 trigger trg4 before insert on t2 for each row
+begin
if new.a > 10 then
set @fired:= "No";
end if;
end */;;
-
DELIMITER ;
-/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@@ -2313,10 +2552,13 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
USE `test`;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -2324,9 +2566,12 @@ INSERT INTO `t1` VALUES (1,NULL),(2,NULL),(4,NULL),(11,NULL);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `t2`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t2` WRITE;
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
@@ -2348,26 +2593,26 @@ Tables_in_test
t1
t2
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1 INSERT t1 begin
if new.a > 10 then
set new.a := 10;
set new.a := 11;
end if;
-end BEFORE # root@localhost
+end BEFORE # root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
trg2 UPDATE t1 begin
if old.a % 2 = 0 then set new.b := 12; end if;
-end BEFORE # root@localhost
+end BEFORE # root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
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
+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
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
+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
DROP TABLE t1, t2;
#
# Bugs #9136, #12917: problems with --defaults-extra-file option
@@ -2396,9 +2641,9 @@ SELECT * FROM `test2`;
a2
1
SHOW TRIGGERS;
-Trigger Event Table Statement Timing Created sql_mode Definer
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
testref INSERT test1 BEGIN
-INSERT INTO test2 SET a2 = NEW.a1; END BEFORE NULL root@localhost
+INSERT INTO test2 SET a2 = NEW.a1; END BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
SELECT * FROM `test1`;
a1
1
@@ -2450,47 +2695,108 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
USE `test`;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`id` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
INSERT INTO `t1` VALUES (1),(2),(3),(4),(5);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
+/*!50003 DROP FUNCTION IF EXISTS `bug9056_func1` */;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = latin1 */ ;
+/*!50003 SET character_set_results = latin1 */ ;
+/*!50003 SET collation_connection = latin1_swedish_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
-/*!50003 DROP FUNCTION IF EXISTS `bug9056_func1` */;;
-/*!50003 SET SESSION SQL_MODE=""*/;;
/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 FUNCTION `bug9056_func1`(a INT, b INT) RETURNS int(11)
RETURN a+b */;;
-/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;;
-/*!50003 DROP FUNCTION IF EXISTS `bug9056_func2` */;;
-/*!50003 SET SESSION SQL_MODE=""*/;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+/*!50003 DROP FUNCTION IF EXISTS `bug9056_func2` */;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = latin1 */ ;
+/*!50003 SET character_set_results = latin1 */ ;
+/*!50003 SET collation_connection = latin1_swedish_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = '' */ ;
+DELIMITER ;;
/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 FUNCTION `bug9056_func2`(f1 char binary) RETURNS char(1) CHARSET latin1
begin
set f1= concat( 'hello', f1 );
return f1;
end */;;
-/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;;
-/*!50003 DROP PROCEDURE IF EXISTS `a'b` */;;
-/*!50003 SET SESSION SQL_MODE="REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI"*/;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+/*!50003 DROP PROCEDURE IF EXISTS `a'b` */;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = latin1 */ ;
+/*!50003 SET character_set_results = latin1 */ ;
+/*!50003 SET collation_connection = latin1_swedish_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI' */ ;
+DELIMITER ;;
/*!50003 CREATE*/ /*!50020 DEFINER="root"@"localhost"*/ /*!50003 PROCEDURE "a'b"()
select 1 */;;
-/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;;
-/*!50003 DROP PROCEDURE IF EXISTS `bug9056_proc1` */;;
-/*!50003 SET SESSION SQL_MODE=""*/;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+/*!50003 DROP PROCEDURE IF EXISTS `bug9056_proc1` */;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = latin1 */ ;
+/*!50003 SET character_set_results = latin1 */ ;
+/*!50003 SET collation_connection = latin1_swedish_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = '' */ ;
+DELIMITER ;;
/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `bug9056_proc1`(IN a INT, IN b INT, OUT c INT)
BEGIN SELECT a+b INTO c; end */;;
-/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;;
-/*!50003 DROP PROCEDURE IF EXISTS `bug9056_proc2` */;;
-/*!50003 SET SESSION SQL_MODE=""*/;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+/*!50003 DROP PROCEDURE IF EXISTS `bug9056_proc2` */;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = latin1 */ ;
+/*!50003 SET character_set_results = latin1 */ ;
+/*!50003 SET collation_connection = latin1_swedish_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = '' */ ;
+DELIMITER ;;
/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `bug9056_proc2`(OUT a INT)
BEGIN
select sum(id) from t1 into a;
END */;;
-/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;;
DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@@ -2540,10 +2846,13 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
USE `test`;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`d` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
UNIQUE KEY `d` (`d`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -2574,10 +2883,13 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
USE `test`;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`d` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
UNIQUE KEY `d` (`d`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -2624,28 +2936,41 @@ a2
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS "t1 test";
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE "t1 test" (
"a1" int(11) DEFAULT NULL
);
+SET character_set_client = @saved_cs_client;
LOCK TABLES "t1 test" WRITE;
/*!40000 ALTER TABLE "t1 test" DISABLE KEYS */;
INSERT INTO "t1 test" VALUES (1),(2),(3);
/*!40000 ALTER TABLE "t1 test" ENABLE KEYS */;
UNLOCK TABLES;
-
-/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = latin1 */ ;
+/*!50003 SET character_set_results = latin1 */ ;
+/*!50003 SET collation_connection = latin1_swedish_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
-/*!50003 SET SESSION SQL_MODE="" */;;
-/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `test trig` BEFORE INSERT ON `t1 test` FOR EACH ROW BEGIN
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `test trig` BEFORE INSERT ON `t1 test` FOR EACH ROW BEGIN
INSERT INTO `t2 test` SET a2 = NEW.a1; END */;;
-
DELIMITER ;
-/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
DROP TABLE IF EXISTS "t2 test";
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE "t2 test" (
"a2" int(11) DEFAULT NULL
);
+SET character_set_client = @saved_cs_client;
LOCK TABLES "t2 test" WRITE;
/*!40000 ALTER TABLE "t2 test" DISABLE KEYS */;
@@ -2694,11 +3019,14 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
USE `test`;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` varchar(32) DEFAULT NULL,
`c` varchar(32) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -2707,42 +3035,78 @@ INSERT INTO `t1` VALUES (1,'first value','xxxx'),(2,'second value','tttt'),(3,'t
UNLOCK TABLES;
DROP TABLE IF EXISTS `v0`;
/*!50001 DROP VIEW IF EXISTS `v0`*/;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
/*!50001 CREATE TABLE `v0` (
`a` int(11),
`b` varchar(32),
`c` varchar(32)
) */;
+SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `v1`;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
/*!50001 CREATE TABLE `v1` (
`a` int(11),
`b` varchar(32),
`c` varchar(32)
) */;
+SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
/*!50001 CREATE TABLE `v2` (
`a` int(11),
`b` varchar(32),
`c` varchar(32)
) */;
+SET character_set_client = @saved_cs_client;
USE `test`;
-/*!50001 DROP TABLE IF EXISTS `v0`*/;
+/*!50001 DROP TABLE `v0`*/;
/*!50001 DROP VIEW IF EXISTS `v0`*/;
+/*!50001 SET @saved_cs_client = @@character_set_client */;
+/*!50001 SET @saved_cs_results = @@character_set_results */;
+/*!50001 SET @saved_col_connection = @@collation_connection */;
+/*!50001 SET character_set_client = latin1 */;
+/*!50001 SET character_set_results = latin1 */;
+/*!50001 SET collation_connection = latin1_swedish_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v0` AS select `v1`.`a` AS `a`,`v1`.`b` AS `b`,`v1`.`c` AS `c` from `v1` */;
-/*!50001 DROP TABLE IF EXISTS `v1`*/;
+/*!50001 SET character_set_client = @saved_cs_client */;
+/*!50001 SET character_set_results = @saved_cs_results */;
+/*!50001 SET collation_connection = @saved_col_connection */;
+/*!50001 DROP TABLE `v1`*/;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
+/*!50001 SET @saved_cs_client = @@character_set_client */;
+/*!50001 SET @saved_cs_results = @@character_set_results */;
+/*!50001 SET @saved_col_connection = @@collation_connection */;
+/*!50001 SET character_set_client = latin1 */;
+/*!50001 SET character_set_results = latin1 */;
+/*!50001 SET collation_connection = latin1_swedish_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b`,`t1`.`c` AS `c` from `t1` */;
-/*!50001 DROP TABLE IF EXISTS `v2`*/;
+/*!50001 SET character_set_client = @saved_cs_client */;
+/*!50001 SET character_set_results = @saved_cs_results */;
+/*!50001 SET collation_connection = @saved_col_connection */;
+/*!50001 DROP TABLE `v2`*/;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
+/*!50001 SET @saved_cs_client = @@character_set_client */;
+/*!50001 SET @saved_cs_results = @@character_set_results */;
+/*!50001 SET @saved_col_connection = @@collation_connection */;
+/*!50001 SET character_set_client = latin1 */;
+/*!50001 SET character_set_results = latin1 */;
+/*!50001 SET collation_connection = latin1_swedish_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v2` AS select `v0`.`a` AS `a`,`v0`.`b` AS `b`,`v0`.`c` AS `c` from `v0` */;
+/*!50001 SET character_set_client = @saved_cs_client */;
+/*!50001 SET character_set_results = @saved_cs_results */;
+/*!50001 SET collation_connection = @saved_col_connection */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@@ -2786,24 +3150,36 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
USE `test`;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
-
-/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = latin1 */ ;
+/*!50003 SET character_set_results = latin1 */ ;
+/*!50003 SET collation_connection = latin1_swedish_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'IGNORE_SPACE' */ ;
DELIMITER ;;
-/*!50003 SET SESSION SQL_MODE="IGNORE_SPACE" */;;
-/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `tr1` BEFORE INSERT ON `t1` FOR EACH ROW BEGIN
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER tr1 BEFORE INSERT ON t1
+FOR EACH ROW
+BEGIN
SET new.a = 0;
END */;;
-
DELIMITER ;
-/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@@ -2833,10 +3209,13 @@ insert into t1 values ('','');
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` binary(1) DEFAULT NULL,
`b` blob
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -2865,10 +3244,13 @@ UNLOCK TABLES;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` binary(1) DEFAULT NULL,
`b` blob
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -2931,12 +3313,12 @@ drop trigger tr1;
drop trigger tr2;
drop table t1, t2;
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
tr1 INSERT t1 set
-new.created=now() BEFORE # root@localhost
+new.created=now() BEFORE # root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
tr2 INSERT t1 begin
insert into t2 set b=new.a and created=new.created;
-end AFTER # root@localhost
+end AFTER # root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
drop trigger tr1;
drop trigger tr2;
drop table t1, t2;
@@ -2949,14 +3331,34 @@ insert into t values(5, 51);
create view v1 as select qty, price, qty*price as value from t;
create view v2 as select qty from v1;
mysqldump {
+/*!50001 DROP TABLE `v1`*/;
+/*!50001 SET @saved_cs_client = @@character_set_client */;
+/*!50001 SET @saved_cs_results = @@character_set_results */;
+/*!50001 SET @saved_col_connection = @@collation_connection */;
+/*!50001 SET character_set_client = latin1 */;
+/*!50001 SET character_set_results = latin1 */;
+/*!50001 SET collation_connection = latin1_swedish_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v1` AS select `t`.`qty` AS `qty`,`t`.`price` AS `price`,(`t`.`qty` * `t`.`price`) AS `value` from `t` */;
+/*!50001 SET character_set_client = @saved_cs_client */;
+/*!50001 SET character_set_results = @saved_cs_results */;
+/*!50001 SET collation_connection = @saved_col_connection */;
} mysqldump {
+/*!50001 DROP TABLE `v2`*/;
+/*!50001 SET @saved_cs_client = @@character_set_client */;
+/*!50001 SET @saved_cs_results = @@character_set_results */;
+/*!50001 SET @saved_col_connection = @@collation_connection */;
+/*!50001 SET character_set_client = latin1 */;
+/*!50001 SET character_set_results = latin1 */;
+/*!50001 SET collation_connection = latin1_swedish_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v2` AS select `v1`.`qty` AS `qty` from `v1` */;
+/*!50001 SET character_set_client = @saved_cs_client */;
+/*!50001 SET character_set_results = @saved_cs_results */;
+/*!50001 SET collation_connection = @saved_col_connection */;
} mysqldump
drop view v1;
@@ -2971,13 +3373,13 @@ return 42 */|
/*!50003 CREATE PROCEDURE `p`()
select 42 */|
show create function f;
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
f CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS bigint(20)
-return 42
+return 42 latin1 latin1_swedish_ci latin1_swedish_ci
show create procedure p;
-Procedure sql_mode Create Procedure
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
p CREATE DEFINER=`root`@`localhost` PROCEDURE `p`()
-select 42
+select 42 latin1 latin1_swedish_ci latin1_swedish_ci
drop function f;
drop procedure p;
#
@@ -3021,9 +3423,12 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_test_db` /*!40100 DEFAULT CH
USE `mysqldump_test_db`;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`id` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -3032,16 +3437,28 @@ INSERT INTO `t1` VALUES (1232131),(4711),(3231),(815);
UNLOCK TABLES;
DROP TABLE IF EXISTS `v1`;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
/*!50001 CREATE TABLE `v1` (
`id` int(11)
) */;
+SET character_set_client = @saved_cs_client;
USE `mysqldump_test_db`;
-/*!50001 DROP TABLE IF EXISTS `v1`*/;
+/*!50001 DROP TABLE `v1`*/;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
+/*!50001 SET @saved_cs_client = @@character_set_client */;
+/*!50001 SET @saved_cs_results = @@character_set_results */;
+/*!50001 SET @saved_col_connection = @@collation_connection */;
+/*!50001 SET character_set_client = latin1 */;
+/*!50001 SET character_set_results = latin1 */;
+/*!50001 SET collation_connection = latin1_swedish_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v1` AS select `t1`.`id` AS `id` from `t1` */;
+/*!50001 SET character_set_client = @saved_cs_client */;
+/*!50001 SET character_set_results = @saved_cs_results */;
+/*!50001 SET collation_connection = @saved_col_connection */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@@ -3068,25 +3485,41 @@ create view nasishnasifu as select mysqldump_tables.basetable.id from mysqldump_
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_tables` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `mysqldump_tables`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `basetable` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`tag` varchar(64) DEFAULT NULL,
UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_views` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `mysqldump_views`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
/*!50001 CREATE TABLE `nasishnasifu` (
`id` bigint(20) unsigned
) */;
+SET character_set_client = @saved_cs_client;
USE `mysqldump_tables`;
USE `mysqldump_views`;
+/*!50001 DROP TABLE `nasishnasifu`*/;
+/*!50001 SET @saved_cs_client = @@character_set_client */;
+/*!50001 SET @saved_cs_results = @@character_set_results */;
+/*!50001 SET @saved_col_connection = @@collation_connection */;
+/*!50001 SET character_set_client = latin1 */;
+/*!50001 SET character_set_results = latin1 */;
+/*!50001 SET collation_connection = latin1_swedish_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `mysqldump_views`.`nasishnasifu` AS select `mysqldump_tables`.`basetable`.`id` AS `id` from `mysqldump_tables`.`basetable` */;
+/*!50001 SET character_set_client = @saved_cs_client */;
+/*!50001 SET character_set_results = @saved_cs_results */;
+/*!50001 SET collation_connection = @saved_col_connection */;
drop view nasishnasifu;
drop database mysqldump_views;
drop table mysqldump_tables.basetable;
@@ -3209,7 +3642,7 @@ DROP TABLE t1;
#
CREATE TABLE t1(a int);
INSERT INTO t1 VALUES (1), (2);
-mysqldump: Input filename or options too long: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+mysqldump: Input filename too long: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
DROP TABLE t1;
CREATE TABLE t2 (a int);
CREATE TABLE t3 (a int);
@@ -3226,22 +3659,31 @@ CREATE TABLE t1 (a int) ENGINE=merge UNION=(t2, t3);
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`t2`,`t3`);
+SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `t2`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t2` WRITE;
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `t3`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t3` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t3` WRITE;
/*!40000 ALTER TABLE `t3` DISABLE KEYS */;
@@ -3273,11 +3715,11 @@ create function f2() returns int return f1();
create view v3 as select bug23491_original.f1();
use bug23491_restore;
show create view bug23491_restore.v2;
-View Create View
-v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `f1`() AS `f1()`
+View Create View character_set_client collation_connection
+v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `f1`() AS `f1()` latin1 latin1_swedish_ci
show create view bug23491_restore.v3;
-View Create View
-v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `bug23491_original`.`f1`() AS `bug23491_original.f1()`
+View Create View character_set_client collation_connection
+v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `bug23491_original`.`f1`() AS `bug23491_original.f1()` latin1 latin1_swedish_ci
drop database bug23491_original;
drop database bug23491_restore;
use test;
@@ -3292,23 +3734,77 @@ create database mysqldump_test_db;
grant all privileges on mysqldump_test_db.* to user1;
grant all privileges on mysqldump_test_db.* to user2;
create procedure mysqldump_test_db.sp1() select 'hello';
-DELIMITER ;;
-- insufficient privileges to SHOW CREATE PROCEDURE `sp1`
-- does user2 have permissions on mysql.proc?
-DELIMITER ;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = latin1 */ ;
+/*!50003 SET character_set_results = latin1 */ ;
+/*!50003 SET collation_connection = latin1_swedish_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
-/*!50003 SET SESSION SQL_MODE=""*/;;
/*!50003 CREATE*/ /*!50020 DEFINER=`user1`@`%`*/ /*!50003 PROCEDURE `sp1`()
select 'hello' */;;
-/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;;
DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
drop procedure sp1;
drop user user1;
drop user user2;
drop database mysqldump_test_db;
#
+# Bug #28522: buffer overrun by '\0' byte using --hex-blob.
+#
+CREATE TABLE t1 (c1 INT, c2 LONGBLOB);
+INSERT INTO t1 SET c1=11, c2=REPEAT('q',509);
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `t1` (
+ `c1` int(11) DEFAULT NULL,
+ `c2` longblob
+);
+SET character_set_client = @saved_cs_client;
+INSERT INTO `t1` VALUES (11,0x7171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171);
+DROP TABLE t1;
+#
+# Bug #28524: mysqldump --skip-add-drop-table is not
+# compatible with views
+#
+CREATE VIEW v1 AS SELECT 1;
+DROP VIEW v1;
+SELECT * FROM v1;
+1
+1
+DROP VIEW v1;
+#
+# Bug #29788: mysqldump discards the NO_AUTO_VALUE_ON_ZERO value of
+# the SQL_MODE variable after the dumping of triggers.
+#
+CREATE TABLE t1 (c1 INT);
+CREATE TRIGGER t1bd BEFORE DELETE ON t1 FOR EACH ROW BEGIN END;
+CREATE TABLE t2 (c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
+SET @TMP_SQL_MODE = @@SQL_MODE;
+SET SQL_MODE = 'NO_AUTO_VALUE_ON_ZERO';
+INSERT INTO t2 VALUES (0), (1), (2);
+SET SQL_MODE = @TMP_SQL_MODE;
+SELECT * FROM t2;
+c1
+0
+1
+2
+SELECT * FROM t2;
+c1
+0
+1
+2
+DROP TABLE t1,t2;
+#
# End of 5.0 tests
#
drop table if exists t1;
@@ -3328,10 +3824,13 @@ INSERT INTO t1 VALUES (3,4), (4,5);
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -3532,35 +4031,35 @@ use first;
set time_zone = 'UTC';
create event ee1 on schedule at '2035-12-31 20:01:23' do set @a=5;
show events;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
-first ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+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
-ee1 UTC CREATE EVENT `ee1` ON SCHEDULE AT '2035-12-31 20:01:23' ON COMPLETION NOT PRESERVE ENABLE DO set @a=5
+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
drop database first;
create database second;
use second;
show events;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
-second ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+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
-ee1 NO_AUTO_VALUE_ON_ZERO UTC CREATE EVENT `ee1` ON SCHEDULE AT '2035-12-31 20:01:23' ON COMPLETION NOT PRESERVE ENABLE DO set @a=5
+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
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;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
-second ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1
-second ee2 root@localhost UTC ONE TIME 2018-12-31 21:01:23 NULL NULL NULL NULL ENABLED 1
-second ee3 root@localhost UTC ONE TIME 2030-12-31 22:01:23 NULL NULL NULL NULL ENABLED 1
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+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
+second ee2 root@localhost UTC ONE TIME 2018-12-31 21:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+second ee3 root@localhost UTC ONE TIME 2030-12-31 22:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
drop database second;
create database third;
use third;
show events;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
-third ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1
-third ee2 root@localhost UTC ONE TIME 2018-12-31 21:01:23 NULL NULL NULL NULL ENABLED 1
-third ee3 root@localhost UTC ONE TIME 2030-12-31 22:01:23 NULL NULL NULL NULL ENABLED 1
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+third 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
+third ee2 root@localhost UTC ONE TIME 2018-12-31 21:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+third ee3 root@localhost UTC ONE TIME 2030-12-31 22:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
drop database third;
set time_zone = 'SYSTEM';
use test;
@@ -3595,9 +4094,12 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_test_db` /*!40100 DEFAULT CH
USE `mysqldump_test_db`;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`id` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -3606,16 +4108,28 @@ INSERT INTO `t1` VALUES (1232131),(4711),(3231),(815);
UNLOCK TABLES;
DROP TABLE IF EXISTS `v1`;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
/*!50001 CREATE TABLE `v1` (
`id` int(11)
) */;
+SET character_set_client = @saved_cs_client;
USE `mysqldump_test_db`;
-/*!50001 DROP TABLE IF EXISTS `v1`*/;
+/*!50001 DROP TABLE `v1`*/;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
+/*!50001 SET @saved_cs_client = @@character_set_client */;
+/*!50001 SET @saved_cs_results = @@character_set_results */;
+/*!50001 SET @saved_col_connection = @@collation_connection */;
+/*!50001 SET character_set_client = latin1 */;
+/*!50001 SET character_set_results = latin1 */;
+/*!50001 SET collation_connection = latin1_swedish_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v1` AS select `t1`.`id` AS `id` from `t1` */;
+/*!50001 SET character_set_client = @saved_cs_client */;
+/*!50001 SET character_set_results = @saved_cs_results */;
+/*!50001 SET collation_connection = @saved_col_connection */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@@ -3630,5 +4144,51 @@ drop view v1;
drop table t1;
drop database mysqldump_test_db;
#
+# Bug #30027: mysqldump does not dump views properly.
+#
+
+# Cleanup.
+DROP DATABASE IF EXISTS mysqldump_test_db;
+
+# Create objects.
+CREATE DATABASE mysqldump_test_db;
+set names koi8r;
+CREATE VIEW mysqldump_test_db.v2 AS SELECT 1 AS ËÏÌÏÎËÁ1;
+CREATE VIEW mysqldump_test_db.v1 AS SELECT ËÏÌÏÎËÁ1 FROM mysqldump_test_db.v2;
+set names latin1;
+
+# Dump mysqldump_test_db to bug30027.sql.
+
+# Drop mysqldump_test_db.
+DROP DATABASE mysqldump_test_db;
+
+# Restore mysqldump_test_db from bug30027.sql.
+
+# Check the view.
+set names utf8;
+SHOW CREATE VIEW mysqldump_test_db.v1;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqldump_test_db`.`v1` AS select `v2`.`колонка1` AS `колонка1` from `mysqldump_test_db`.`v2` koi8r koi8r_general_ci
+SHOW CREATE VIEW mysqldump_test_db.v2;
+View Create View character_set_client collation_connection
+v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqldump_test_db`.`v2` AS select 1 AS `колонка1` koi8r koi8r_general_ci
+set names latin1;
+
+# Cleanup.
+DROP DATABASE mysqldump_test_db;
+#
+# BUG#29938: wrong behavior of mysqldump --skip-events
+# with --all-databases
+#
+TRUNCATE mysql.event;
+USE test;
+CREATE event e29938 ON SCHEDULE AT '2035-12-31 20:01:23' DO SET @bug29938=29938;
+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
+test e29938 root@localhost SYSTEM ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+TRUNCATE mysql.event;
+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
+#
# End of 5.1 tests
#
diff --git a/mysql-test/r/mysqlslap.result b/mysql-test/r/mysqlslap.result
index bca7919d78c..dfe721d10d2 100644
--- a/mysql-test/r/mysqlslap.result
+++ b/mysql-test/r/mysqlslap.result
@@ -129,7 +129,6 @@ INSERT INTO t1 VALUES (1, 'This is a test');
insert into t2 values ('test', 'test2');
select * from t1;
select * from t2;
-select * from t1;
DROP SCHEMA IF EXISTS `mysqlslap`;
DROP SCHEMA IF EXISTS `mysqlslap`;
CREATE SCHEMA `mysqlslap`;
@@ -141,7 +140,32 @@ INSERT INTO t1 VALUES (1, 'This is a test');
insert into t2 values ('test', 'test2');
select * from t1;
select * from t2;
+DROP SCHEMA IF EXISTS `mysqlslap`;
+DROP SCHEMA IF EXISTS `mysqlslap`;
+CREATE SCHEMA `mysqlslap`;
+use mysqlslap;
+set storage_engine=`heap`;
+CREATE TABLE t1 (id int, name varchar(64));
+create table t2(foo1 varchar(32), foo2 varchar(32));
+INSERT INTO t1 VALUES (1, 'This is a test');
+insert into t2 values ('test', 'test2');
+SHOW TABLES;
+select * from t1;
+select * from t2;
+SHOW TABLES;
+DROP SCHEMA IF EXISTS `mysqlslap`;
+DROP SCHEMA IF EXISTS `mysqlslap`;
+CREATE SCHEMA `mysqlslap`;
+use mysqlslap;
+set storage_engine=`myisam`;
+CREATE TABLE t1 (id int, name varchar(64));
+create table t2(foo1 varchar(32), foo2 varchar(32));
+INSERT INTO t1 VALUES (1, 'This is a test');
+insert into t2 values ('test', 'test2');
+SHOW TABLES;
select * from t1;
+select * from t2;
+SHOW TABLES;
DROP SCHEMA IF EXISTS `mysqlslap`;
DROP SCHEMA IF EXISTS `mysqlslap`;
CREATE SCHEMA `mysqlslap`;
@@ -151,8 +175,18 @@ CREATE TABLE t1 (id int, name varchar(64));
create table t2(foo1 varchar(32), foo2 varchar(32));
INSERT INTO t1 VALUES (1, 'This is a test');
insert into t2 values ('test', 'test2');
+SET AUTOCOMMIT=0;
SHOW TABLES;
select * from t1;
+select * from t2;
+COMMIT;
+select * from t1;
+select * from t2;
+COMMIT;
+select * from t1;
+select * from t2;
+COMMIT;
+COMMIT;
SHOW TABLES;
DROP SCHEMA IF EXISTS `mysqlslap`;
DROP SCHEMA IF EXISTS `mysqlslap`;
@@ -163,7 +197,17 @@ CREATE TABLE t1 (id int, name varchar(64));
create table t2(foo1 varchar(32), foo2 varchar(32));
INSERT INTO t1 VALUES (1, 'This is a test');
insert into t2 values ('test', 'test2');
+SET AUTOCOMMIT=0;
SHOW TABLES;
select * from t1;
+select * from t2;
+COMMIT;
+select * from t1;
+select * from t2;
+COMMIT;
+select * from t1;
+select * from t2;
+COMMIT;
+COMMIT;
SHOW TABLES;
DROP SCHEMA IF EXISTS `mysqlslap`;
diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result
index c4ed4d8b19d..d03e21b1bb0 100644
--- a/mysql-test/r/mysqltest.result
+++ b/mysql-test/r/mysqltest.result
@@ -280,8 +280,20 @@ let $B = changed value of B;
var2: content of variable 1
var3: content of variable 1 content of variable 1
length of var3 is longer than 0
+var1
+hi 1 hi there
+var2
+2
+var2 again
+2
+var3 two columns with same name
+1 2 3
+var4 from query that returns NULL
+var5 from query that returns no row
+failing query in let
+mysqltest: At line 1: Error running query 'failing query': 1064 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 'failing query' at line 1
mysqltest: At line 1: Missing required argument 'filename' to command 'source'
-mysqltest: At line 1: Could not open file ./non_existingFile
+mysqltest: At line 1: Could not open file './non_existingFile'
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/recursive.sql": At line 1: Source directives are nesting too deep
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/error.sql": At line 1: query 'garbage ' failed: 1064: 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 'garbage' at line 1
@@ -339,6 +351,9 @@ here is the sourced script
In loop
here is the sourced script
+here is the sourced script
+"hello"
+"hello"
mysqltest: At line 1: Missing argument to sleep
mysqltest: At line 1: Missing argument to real_sleep
mysqltest: At line 1: Invalid argument to sleep "abc"
@@ -410,7 +425,6 @@ mysqltest: At line 1: Wrong column number to replace_column in 'replace_column a
mysqltest: At line 1: Wrong column number to replace_column in 'replace_column a 1'
mysqltest: At line 1: Wrong column number to replace_column in 'replace_column 1 b c '
mysqltest: At line 1: Invalid integer argument "10!"
-mysqltest: At line 1: End of line junk detected: "!"
mysqltest: At line 1: Invalid integer argument "a"
mysqltest: At line 1: Missing required argument 'connection name' to command 'connect'
mysqltest: At line 1: Missing required argument 'connection name' to command 'connect'
@@ -420,7 +434,7 @@ mysqltest: At line 1: query 'connect con2,localhost,root,,illegal_db' failed: 1
mysqltest: At line 1: Illegal argument for port: 'illegal_port'
mysqltest: At line 1: Illegal option to connect: SMTP
OK
-mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": At line 7: Connection limit exhausted, you can have max 128 connections
+mysqltest: The test didn't produce any output
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": At line 3: connection 'test_con1' not found in connection pool
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": At line 2: Connection test_con1 already exists
connect(localhost,root,,test,MASTER_PORT,MASTER_SOCKET);
@@ -461,7 +475,6 @@ root@localhost
--------------------------------------------------------------------------------
this will be executed
this will be executed
-mysqltest: Result length mismatch
mysqltest: The test didn't produce any output
Failing multi statement query
mysqltest: At line 3: query 'create table t1 (a int primary key);
@@ -473,6 +486,8 @@ mysqltest: At line 3: query 'create table t1 (a int primary key);
insert into t1 values (1);
select 'select-me';
insertz 'error query'' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insertz 'error query'' at line 1
+
+More results from queries before failure can be found in MYSQLTEST_VARDIR/log/bug11731.log
drop table t1;
Multi statement using expected error
create table t1 (a int primary key);
@@ -520,17 +535,19 @@ drop table t1;
mysqltest: At line 1: Missing required argument 'filename' to command 'remove_file'
mysqltest: At line 1: Missing required argument 'filename' to command 'write_file'
mysqltest: At line 1: End of file encountered before 'EOF' delimiter was found
+Content for test_file1
+mysqltest: At line 1: File already exist: 'MYSQLTEST_VARDIR/tmp/test_file1.tmp'
Some data
for cat_file command
of mysqltest
-mysqltest: At line 1: Failed to open file non_existing_file
+mysqltest: At line 1: Failed to open file 'non_existing_file'
mysqltest: At line 1: Missing required argument 'filename' to command 'file_exists'
mysqltest: At line 1: Missing required argument 'from_file' to command 'copy_file'
mysqltest: At line 1: Missing required argument 'to_file' to command 'copy_file'
mysqltest: At line 1: Missing required argument 'mode' to command 'chmod'
mysqltest: At line 1: You must write a 4 digit octal number for mode
mysqltest: At line 1: You must write a 4 digit octal number for mode
-mysqltest: At line 1: Missing required argument 'file' to command 'chmod'
+mysqltest: At line 1: Missing required argument 'filename' to command 'chmod'
mysqltest: At line 1: You must write a 4 digit octal number for mode
mysqltest: At line 1: You must write a 4 digit octal number for mode
hello
@@ -557,6 +574,12 @@ a b c
2 Part 2 2007-04-05 00:00:00
2 Part 3 2007-04-05 00:00:00
select * from t1;
+a b c
+1 Line 1 2007-04-05 00:00:00
+2 Part 2 2007-04-05 00:00:00
+1 Line 1 2007-04-05 00:00:00
+2 Part 3 2007-04-05 00:00:00
+select * from t1;
select '';
@@ -572,4 +595,131 @@ hep
select "hepp";
hepp
hepp
+drop table t1;
+SELECT 2 as "my_col"
+UNION
+SELECT 1;
+my_col
+1
+2
+SELECT 2 as "my_col" UNION SELECT 1;
+my_col
+1
+2
+SELECT 2 as "my_col"
+UNION
+SELECT 1;
+my_col
+1
+2
+SELECT '2' as "3"
+UNION
+SELECT '1';
+3
+1
+2
+CREATE TABLE t1( a CHAR);
+SELECT * FROM t1;
+a
+DROP TABLE t1;
+SELECT NULL as "my_col1",2 AS "my_col2"
+UNION
+SELECT NULL,1;
+my_col1 my_col2
+NULL 2
+NULL 1
+SELECT NULL as "my_col1",2 AS "my_col2"
+UNION
+SELECT NULL,1;
+my_col1 my_col2
+NULL 1
+NULL 2
+SELECT 2 as "my_col1",NULL AS "my_col2"
+UNION
+SELECT 1,NULL;
+my_col1 my_col2
+2 NULL
+1 NULL
+SELECT 2 as "my_col1",NULL AS "my_col2"
+UNION
+SELECT 1,NULL;
+my_col1 my_col2
+1 NULL
+2 NULL
+SET @a = 17;
+SELECT 2 as "my_col"
+UNION
+SELECT 1;
+my_col
+2
+1
+SELECT 2 as "my_col"
+UNION
+SELECT 1;
+my_col
+1
+2
+SELECT '2' as "my_col1",2 as "my_col2"
+UNION
+SELECT '1',1 from t2;
+ERROR 42S02: Table 'test.t2' doesn't exist
+SELECT '1' as "my_col1",2 as "my_col2"
+UNION
+SELECT '2',1;
+my_col1 my_col2
+# 1
+# 2
+CREATE TABLE t1 (f1 INT);
+INSERT INTO t1 SET f1 = 1024;
+INSERT INTO t1 SELECT f1 - 1 FROM t1;
+INSERT INTO t1 SELECT f1 - 2 FROM t1;
+INSERT INTO t1 SELECT f1 - 4 FROM t1;
+INSERT INTO t1 SELECT f1 - 8 FROM t1;
+INSERT INTO t1 SELECT f1 - 16 FROM t1;
+INSERT INTO t1 SELECT f1 - 32 FROM t1;
+INSERT INTO t1 SELECT f1 - 64 FROM t1;
+INSERT INTO t1 SELECT f1 - 128 FROM t1;
+INSERT INTO t1 SELECT f1 - 256 FROM t1;
+INSERT INTO t1 SELECT f1 - 512 FROM t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+CREATE TABLE t1(
+a int, b varchar(255), c datetime
+);
+SHOW COLUMNS FROM t1;
+Field Type Null Key Default Extra
+a int(11) YES NULL
+b varchar(255) YES NULL
+c datetime YES NULL
+statement=SHOW COLUMNS FROM t1 row_number=1, column_name="Type", Value=int(11)
+statement="SHOW COLUMNS FROM t1" row_number=1, column_name="Type", Value=int(11)
+statement=SHOW COLUMNS FROM t1 row_number=1, column_name=Default, Value=NULL
+value= ->A B<-
+value= 1
+mysqltest: At line 1: query_get_value - argument list started with '(' must be ended with ')'
+mysqltest: At line 1: Missing required argument 'query' to command 'query_get_value'
+mysqltest: At line 1: Missing required argument 'column name' to command 'query_get_value'
+mysqltest: At line 1: Missing required argument 'row number' to command 'query_get_value'
+value= No such row
+value= No such row
+mysqltest: At line 1: Invalid row number: 'notnumber'
+mysqltest: At line 1: Could not find column 'column_not_exists' in the result of 'SHOW COLUMNS FROM t1'
+mysqltest: At line 1: Query 'SET @A = 1' didn't return a result set
+mysqltest: At line 1: Could not find column '1 AS B' in the result of 'SELECT 1 AS A'
+value= No such row
+mysqltest: At line 1: Error running query 'SHOW COLNS FROM t1': 1064 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 'COLNS FROM t1' at line 1
+
+Field Type Null Key Default Extra
+a int(11) YES -><- NULL
+b varchar(255) YES -><- NULL
+c datetime YES -><- NULL
+
+Number of columns with Default NULL: 3
+
+SHOW COLUMNS FROM t1;
+Field Type Null Key Default Extra
+a int(11) YES NULL
+b varchar(255) YES NULL
+c datetime YES NULL
+drop table t1;
End of tests
diff --git a/mysql-test/r/ndb_alter_table.result b/mysql-test/r/ndb_alter_table.result
deleted file mode 100644
index 13c445b44ca..00000000000
--- a/mysql-test/r/ndb_alter_table.result
+++ /dev/null
@@ -1,401 +0,0 @@
-DROP TABLE IF EXISTS t1, t2;
-drop database if exists mysqltest;
-CREATE TABLE t1 (
-a INT NOT NULL,
-b INT NOT NULL
-) ENGINE=ndbcluster;
-INSERT INTO t1 VALUES (9410,9412);
-ALTER TABLE t1 ADD COLUMN c int not null;
-SELECT * FROM t1;
-a b c
-9410 9412 0
-DROP TABLE t1;
-CREATE DATABASE mysqltest;
-USE mysqltest;
-CREATE TABLE t1 (
-a INT NOT NULL,
-b INT NOT NULL
-) ENGINE=ndbcluster;
-RENAME TABLE t1 TO test.t1;
-SHOW TABLES;
-Tables_in_mysqltest
-DROP DATABASE mysqltest;
-USE test;
-SHOW TABLES;
-Tables_in_test
-t1
-DROP TABLE t1;
-create table t1 (
-col1 int not null auto_increment primary key,
-col2 varchar(30) not null,
-col3 varchar (20) not null,
-col4 varchar(4) not null,
-col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null,
-col6 int not null, to_be_deleted int) ENGINE=ndbcluster;
-show table status;
-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
-t1 NDBCLUSTER 10 Dynamic 0 # # # 0 # 1 # # # latin1_swedish_ci NULL #
-SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
-insert into t1 values
-(0,4,3,5,"PENDING",1,7),(NULL,4,3,5,"PENDING",1,7),(31,4,3,5,"PENDING",1,7), (7,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7), (100,4,3,5,"PENDING",1,7), (99,4,3,5,"PENDING",1,7), (8,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7);
-show table status;
-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
-t1 NDBCLUSTER 10 Dynamic 9 # # # 0 # 102 # # # latin1_swedish_ci NULL #
-select * from t1 order by col1;
-col1 col2 col3 col4 col5 col6 to_be_deleted
-0 4 3 5 PENDING 1 7
-1 4 3 5 PENDING 1 7
-7 4 3 5 PENDING 1 7
-8 4 3 5 PENDING 1 7
-31 4 3 5 PENDING 1 7
-32 4 3 5 PENDING 1 7
-99 4 3 5 PENDING 1 7
-100 4 3 5 PENDING 1 7
-101 4 3 5 PENDING 1 7
-alter table t1
-add column col4_5 varchar(20) not null after col4,
-add column col7 varchar(30) not null after col5,
-add column col8 datetime not null, drop column to_be_deleted,
-change column col2 fourth varchar(30) not null after col3,
-modify column col6 int not null first;
-show table status;
-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
-t1 NDBCLUSTER 10 Dynamic 9 # # # 0 # 102 # # # latin1_swedish_ci NULL #
-select * from t1 order by col1;
-col6 col1 col3 fourth col4 col4_5 col5 col7 col8
-1 0 3 4 5 PENDING 0000-00-00 00:00:00
-1 1 3 4 5 PENDING 0000-00-00 00:00:00
-1 7 3 4 5 PENDING 0000-00-00 00:00:00
-1 8 3 4 5 PENDING 0000-00-00 00:00:00
-1 31 3 4 5 PENDING 0000-00-00 00:00:00
-1 32 3 4 5 PENDING 0000-00-00 00:00:00
-1 99 3 4 5 PENDING 0000-00-00 00:00:00
-1 100 3 4 5 PENDING 0000-00-00 00:00:00
-1 101 3 4 5 PENDING 0000-00-00 00:00:00
-insert into t1 values (2, NULL,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00');
-show table status;
-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
-t1 NDBCLUSTER 10 Dynamic 10 # # # 0 # 103 # # # latin1_swedish_ci NULL #
-select * from t1 order by col1;
-col6 col1 col3 fourth col4 col4_5 col5 col7 col8
-1 0 3 4 5 PENDING 0000-00-00 00:00:00
-1 1 3 4 5 PENDING 0000-00-00 00:00:00
-1 7 3 4 5 PENDING 0000-00-00 00:00:00
-1 8 3 4 5 PENDING 0000-00-00 00:00:00
-1 31 3 4 5 PENDING 0000-00-00 00:00:00
-1 32 3 4 5 PENDING 0000-00-00 00:00:00
-1 99 3 4 5 PENDING 0000-00-00 00:00:00
-1 100 3 4 5 PENDING 0000-00-00 00:00:00
-1 101 3 4 5 PENDING 0000-00-00 00:00:00
-2 102 4 3 5 99 PENDING EXTRA 2004-01-01 00:00:00
-delete from t1;
-insert into t1 values (0,0,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00');
-SET SQL_MODE='';
-insert into t1 values (1,0,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00');
-select * from t1 order by col1;
-col6 col1 col3 fourth col4 col4_5 col5 col7 col8
-0 0 4 3 5 99 PENDING EXTRA 2004-01-01 00:00:00
-1 103 4 3 5 99 PENDING EXTRA 2004-01-01 00:00:00
-alter table t1 drop column col4_5;
-insert into t1 values (2,0,4,3,5,"PENDING","EXTRA",'2004-01-01 00:00:00');
-select * from t1 order by col1;
-col6 col1 col3 fourth col4 col5 col7 col8
-0 0 4 3 5 PENDING EXTRA 2004-01-01 00:00:00
-1 103 4 3 5 PENDING EXTRA 2004-01-01 00:00:00
-2 104 4 3 5 PENDING EXTRA 2004-01-01 00:00:00
-drop table t1;
-CREATE TABLE t1 (
-a INT NOT NULL,
-b INT NOT NULL
-) ENGINE=ndbcluster;
-INSERT INTO t1 VALUES (9410,9412);
-ALTER TABLE t1 ADD COLUMN c int not null;
-select * from t1 order by a;
-a b c
-9410 9412 0
-select * from t1 order by a;
-a b c
-9410 9412 0
-alter table t1 drop c;
-select * from t1 order by a;
-a b
-9410 9412
-drop table t1;
-select * from t1 order by a;
-ERROR 42S02: Table 'test.t1' doesn't exist
-CREATE TABLE t1 (
-a INT NOT NULL PRIMARY KEY,
-b INT NOT NULL
-) ENGINE=ndbcluster;
-INSERT INTO t1 VALUES (0,1),(17,18);
-select * from t1 order by a;
-a b
-0 1
-17 18
-SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
-alter table t1 modify column a int not null auto_increment;
-SET SQL_MODE='';
-select * from t1 order by a;
-a b
-0 1
-17 18
-INSERT INTO t1 VALUES (0,19),(20,21);
-select * from t1 order by a;
-a b
-0 1
-17 18
-18 19
-20 21
-drop table t1;
-CREATE TABLE t1 (
-a INT NOT NULL PRIMARY KEY,
-b INT NOT NULL
-) ENGINE=ndbcluster;
-INSERT INTO t1 VALUES (0,1),(17,18);
-select * from t1 order by a;
-a b
-0 1
-17 18
-alter table t1 add c int not null unique auto_increment;
-select c from t1 order by c;
-c
-1
-2
-INSERT INTO t1 VALUES (1,2,0),(18,19,4),(20,21,0);
-select c from t1 order by c;
-c
-1
-2
-3
-4
-5
-drop table t1;
-create table t1 (
-ai bigint auto_increment,
-c001 int(11) not null,
-c002 int(11) not null,
-c003 int(11) not null,
-c004 int(11) not null,
-c005 int(11) not null,
-c006 int(11) not null,
-c007 int(11) not null,
-c008 int(11) not null,
-c009 int(11) not null,
-c010 int(11) not null,
-c011 int(11) not null,
-c012 int(11) not null,
-c013 int(11) not null,
-c014 int(11) not null,
-c015 int(11) not null,
-c016 int(11) not null,
-c017 int(11) not null,
-c018 int(11) not null,
-c019 int(11) not null,
-c020 int(11) not null,
-c021 int(11) not null,
-c022 int(11) not null,
-c023 int(11) not null,
-c024 int(11) not null,
-c025 int(11) not null,
-c026 int(11) not null,
-c027 int(11) not null,
-c028 int(11) not null,
-c029 int(11) not null,
-c030 int(11) not null,
-c031 int(11) not null,
-c032 int(11) not null,
-c033 int(11) not null,
-c034 int(11) not null,
-c035 int(11) not null,
-c036 int(11) not null,
-c037 int(11) not null,
-c038 int(11) not null,
-c039 int(11) not null,
-c040 int(11) not null,
-c041 int(11) not null,
-c042 int(11) not null,
-c043 int(11) not null,
-c044 int(11) not null,
-c045 int(11) not null,
-c046 int(11) not null,
-c047 int(11) not null,
-c048 int(11) not null,
-c049 int(11) not null,
-c050 int(11) not null,
-c051 int(11) not null,
-c052 int(11) not null,
-c053 int(11) not null,
-c054 int(11) not null,
-c055 int(11) not null,
-c056 int(11) not null,
-c057 int(11) not null,
-c058 int(11) not null,
-c059 int(11) not null,
-c060 int(11) not null,
-c061 int(11) not null,
-c062 int(11) not null,
-c063 int(11) not null,
-c064 int(11) not null,
-c065 int(11) not null,
-c066 int(11) not null,
-c067 int(11) not null,
-c068 int(11) not null,
-c069 int(11) not null,
-c070 int(11) not null,
-c071 int(11) not null,
-c072 int(11) not null,
-c073 int(11) not null,
-c074 int(11) not null,
-c075 int(11) not null,
-c076 int(11) not null,
-c077 int(11) not null,
-c078 int(11) not null,
-c079 int(11) not null,
-c080 int(11) not null,
-c081 int(11) not null,
-c082 int(11) not null,
-c083 int(11) not null,
-c084 int(11) not null,
-c085 int(11) not null,
-c086 int(11) not null,
-c087 int(11) not null,
-c088 int(11) not null,
-c089 int(11) not null,
-c090 int(11) not null,
-c091 int(11) not null,
-c092 int(11) not null,
-c093 int(11) not null,
-c094 int(11) not null,
-c095 int(11) not null,
-c096 int(11) not null,
-c097 int(11) not null,
-c098 int(11) not null,
-c099 int(11) not null,
-c100 int(11) not null,
-c101 int(11) not null,
-c102 int(11) not null,
-c103 int(11) not null,
-c104 int(11) not null,
-c105 int(11) not null,
-c106 int(11) not null,
-c107 int(11) not null,
-c108 int(11) not null,
-c109 int(11) not null,
-primary key (ai),
-unique key tx1 (c002, c003, c004, c005)) engine=ndb;
-create index tx2
-on t1 (c010, c011, c012, c013);
-drop table t1;
-CREATE TABLE t1 (
-auto int(5) unsigned NOT NULL auto_increment,
-string char(10),
-vstring varchar(10),
-bin binary(2),
-vbin varbinary(7),
-tiny tinyint(4) DEFAULT '0' NOT NULL ,
-short smallint(6) DEFAULT '1' NOT NULL ,
-medium mediumint(8) DEFAULT '0' NOT NULL,
-long_int int(11) DEFAULT '0' NOT NULL,
-longlong bigint(13) DEFAULT '0' NOT NULL,
-real_float float(13,1) DEFAULT 0.0 NOT NULL,
-real_double double(16,4),
-real_decimal decimal(16,4),
-utiny tinyint(3) unsigned DEFAULT '0' NOT NULL,
-ushort smallint(5) unsigned zerofill DEFAULT '00000' NOT NULL,
-umedium mediumint(8) unsigned DEFAULT '0' NOT NULL,
-ulong int(11) unsigned DEFAULT '0' NOT NULL,
-ulonglong bigint(13) unsigned DEFAULT '0' NOT NULL,
-bits bit(3),
-options enum('zero','one','two','three','four') not null,
-flags set('zero','one','two','three','four') not null,
-date_field date,
-year_field year,
-time_field time,
-date_time datetime,
-time_stamp timestamp,
-PRIMARY KEY (auto)
-) engine=ndb;
-CREATE TEMPORARY TABLE ndb_show_tables (id INT, type VARCHAR(20), state VARCHAR(20), logging VARCHAR(20), _database VARCHAR(255), _schema VARCHAR(20), name VARCHAR(255));
-LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
-set @t1_id = (select id from ndb_show_tables where name like '%t1%');
-truncate ndb_show_tables;
-alter table t1 change tiny new_tiny tinyint(4) DEFAULT '0' NOT NULL;
-LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
-select 'no_copy' from ndb_show_tables where id = @t1_id and name like '%t1%';
-no_copy
-set @t1_id = (select id from ndb_show_tables where name like '%t1%');
-truncate ndb_show_tables;
-create index i1 on t1(medium);
-alter table t1 add index i2(new_tiny);
-drop index i1 on t1;
-LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
-select 'no_copy' from ndb_show_tables where id = @t1_id and name like '%t1%';
-no_copy
-no_copy
-DROP TABLE t1, ndb_show_tables;
-create table t1 (a int primary key auto_increment, b int) engine=ndb;
-insert into t1 (b) values (101),(102),(103);
-select * from t1 where a = 3;
-a b
-3 103
-alter table t1 rename t2;
-insert into t2 (b) values (201),(202),(203);
-select * from t2 where a = 6;
-a b
-6 203
-alter table t2 add c int;
-insert into t2 (b) values (301),(302),(303);
-select * from t2 where a = 9;
-a b c
-9 303 NULL
-alter table t2 rename t1;
-insert into t1 (b) values (401),(402),(403);
-select * from t1 where a = 12;
-a b c
-12 403 NULL
-drop table t1;
-create table t1 (a int not null, b varchar(10)) engine=ndb;
-show index from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-alter table t1 add primary key (a);
-show index from t1;
-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 0 NULL NULL BTREE
-alter table t1 drop primary key;
-show index from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-drop table t1;
-create table t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb;
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) NOT NULL DEFAULT '0',
- `c` varchar(254) DEFAULT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-alter table t1 alter b set default 1;
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) NOT NULL DEFAULT '1',
- `c` varchar(254) DEFAULT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-drop table t1;
-create table t1 (a int not null, b int not null) engine=ndb;
-insert into t1 values (1, 300), (2, 200), (3, 100);
-select * from t1 order by a;
-a b
-1 300
-2 200
-3 100
-alter table t1 order by b;
-select * from t1 order by b;
-a b
-3 100
-2 200
-1 300
-drop table t1;
-End of 5.1 tests
diff --git a/mysql-test/r/ndb_autodiscover.result b/mysql-test/r/ndb_autodiscover.result
deleted file mode 100644
index cb85c4ac873..00000000000
--- a/mysql-test/r/ndb_autodiscover.result
+++ /dev/null
@@ -1,397 +0,0 @@
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
-flush status;
-create table t1(
-id int not null primary key,
-name char(20)
-) engine=ndb;
-insert into t1 values(1, "Autodiscover");
-flush tables;
-select * from t1;
-id name
-1 Autodiscover
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 1
-flush tables;
-insert into t1 values (2, "Auto 2");
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 2
-insert into t1 values (3, "Discover 3");
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 2
-flush tables;
-select * from t1 order by id;
-id name
-1 Autodiscover
-2 Auto 2
-3 Discover 3
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 3
-flush tables;
-update t1 set name="Autodiscover" where id = 2;
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 4
-select * from t1 order by id;
-id name
-1 Autodiscover
-2 Autodiscover
-3 Discover 3
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 4
-flush tables;
-delete from t1 where id = 3;
-select * from t1 order by id;
-id name
-1 Autodiscover
-2 Autodiscover
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 5
-drop table t1;
-flush status;
-create table t2(
-id int not null primary key,
-name char(22)
-) engine=ndb;
-insert into t2 values (1, "Discoverer");
-select * from t2;
-id name
-1 Discoverer
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 0
-flush tables;
-select * from t2;
-id name
-1 Discoverer
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 1
-drop table t2;
-flush status;
-create table t3(
-id int not null primary key,
-name char(255)
-) engine=ndb;
-insert into t3 values (1, "Explorer");
-select * from t3;
-id name
-1 Explorer
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 0
-flush tables;
-create table t3(
-id int not null primary key,
-name char(20), a int, b float, c char(24)
-) engine=ndb;
-ERROR 42S01: Table 't3' already exists
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 0
-create table IF NOT EXISTS t3(
-id int not null primary key,
-id2 int not null,
-name char(20)
-) engine=ndb;
-Warnings:
-Note 1050 Table 't3' already exists
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 0
-SHOW CREATE TABLE t3;
-Table Create Table
-t3 CREATE TABLE `t3` (
- `id` int(11) NOT NULL,
- `name` char(255) default NULL,
- PRIMARY KEY (`id`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY ()
-select * from t3;
-id name
-1 Explorer
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 1
-drop table t3;
-flush status;
-create table t7(
-id int not null primary key,
-name char(255)
-) engine=ndb;
-create table t6(
-id int not null primary key,
-name char(255)
-) engine=MyISAM;
-insert into t7 values (1, "Explorer");
-insert into t6 values (2, "MyISAM table");
-select * from t7;
-id name
-1 Explorer
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 0
-flush tables;
-show tables from test;
-Tables_in_test
-t6
-t7
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 1
-flush tables;
-show table status;
-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
-t6 MyISAM 10 Fixed 1 # # # # 0 NULL # # NULL # NULL #
-t7 NDBCLUSTER 10 Fixed 1 # # # # 0 NULL # # NULL # NULL #
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 2
-drop table t6, t7;
-flush status;
-create table t4(
-id int not null primary key,
-name char(27)
-) engine=ndb;
-insert into t4 values (1, "Automatic");
-select * from t4;
-id name
-1 Automatic
-select * from t4;
-ERROR 42S02: Table 'test.t4' doesn't exist
-select * from t4;
-ERROR 42S02: Table 'test.t4' doesn't exist
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 0
-drop table t4;
-ERROR 42S02: Unknown table 't4'
-create table t4(
-id int not null primary key,
-name char(27)
-) engine=ndb;
-insert into t4 values (1, "Automatic");
-select * from t4;
-id name
-1 Automatic
-select * from t4;
-ERROR 42S02: Table 'test.t4' doesn't exist
-drop table if exists t4;
-Warnings:
-Error 155 Table 'test.t4' doesn't exist
-drop table t5;
-ERROR 42S02: Unknown table 't5'
-drop table if exists t5;
-Warnings:
-Note 1051 Unknown table 't5'
-flush status;
-create table t4(
-id int not null primary key,
-id2 int,
-name char(27)
-) engine=ndb;
-insert into t4 values (1, 76, "Automatic2");
-select * from t4;
-id id2 name
-1 76 Automatic2
-flush tables;
-SHOW TABLES;
-Tables_in_test
-select * from t4;
-ERROR 42S02: Table 'test.t4' doesn't exist
-flush status;
-create table t1(id int) engine=ndbcluster;
-create table t2(id int, b char(255)) engine=myisam;
-create table t3(id int, c char(255)) engine=ndbcluster;
-create table t4(id int) engine=myisam;
-create table t5(id int, d char(56)) engine=ndbcluster;
-create table t6(id int) engine=ndbcluster;
-create table t7(id int) engine=ndbcluster;
-create table t8(id int, e char(34)) engine=myisam;
-create table t9(id int) engine=myisam;
-insert into t2 values (2, "myisam table 2");
-insert into t3 values (3, "ndb table 3");
-insert into t5 values (5, "ndb table 5");
-insert into t6 values (6);
-insert into t8 values (8, "myisam table 8");
-insert into t9 values (9);
-SHOW TABLES;
-Tables_in_test
-t1
-t2
-t4
-t8
-t9
-t7
-t6
-select * from t6;
-id
-6
-select * from t7;
-id
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 2
-drop table t1, t2, t4, t6, t7, t8, t9;
-flush status;
-create table t1(id int) engine=ndbcluster;
-create table t2(id int, b char(255)) engine=myisam;
-create table t3(id int, c char(255)) engine=ndbcluster;
-create table t4(id int) engine=myisam;
-create table t5(id int, d char(56)) engine=ndbcluster;
-create table t6(id int) engine=ndbcluster;
-create table t7(id int) engine=ndbcluster;
-create table t8(id int, e char(34)) engine=myisam;
-create table t9(id int) engine=myisam;
-insert into t2 values (2, "myisam table 2");
-insert into t3 values (3, "ndb table 3");
-insert into t5 values (5, "ndb table 5");
-insert into t6 values (6);
-insert into t8 values (8, "myisam table 8");
-insert into t9 values (9);
-SHOW TABLES LIKE 't6';
-Tables_in_test (t6)
-t6
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 1
-create table t3(a int);
-ERROR 42S01: Table 't3' already exists
-create table t5(a int);
-ERROR 42S01: Table 't5' already exists
-SHOW TABLES LIKE 't%';
-Tables_in_test (t%)
-t1
-t2
-t4
-t6
-t8
-t9
-t7
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 2
-drop table t1, t2, t4, t6, t7, t8, t9;
-flush status;
-create table t1(id int) engine=ndbcluster;
-create table t2(id int, b char(255)) engine=ndbcluster;
-create table t3(id int, c char(255)) engine=ndbcluster;
-create table t4(id int) engine=myisam;
-insert into t1 values (1);
-insert into t2 values (2, "table 2");
-insert into t3 values (3, "ndb table 3");
-insert into t4 values (4);
-flush tables;
-select * from t1, t2, t3, t4;
-id id b id c id
-1 2 table 2 3 ndb table 3 4
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 3
-drop table t1, t2, t3, t4;
-flush status;
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 0
-create table t5(
-id int not null primary key,
-name char(200)
-) engine=ndb;
-insert into t5 values (1, "Magnus");
-select * from t5;
-id name
-1 Magnus
-ALTER TABLE t5 ADD COLUMN adress char(255) FIRST;
-select * from t5;
-adress id name
-NULL 1 Magnus
-insert into t5 values
-("Adress for record 2", 2, "Carl-Gustav"),
-("Adress for record 3", 3, "Karl-Emil");
-update t5 set name="Bertil" where id = 2;
-select * from t5 order by id;
-adress id name
-NULL 1 Magnus
-Adress for record 2 2 Bertil
-Adress for record 3 3 Karl-Emil
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 0
-drop table t5;
-flush status;
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 0
-create table t6(
-id int not null primary key,
-name char(20)
-) engine=ndb;
-insert into t6 values (1, "Magnus");
-select * from t6;
-id name
-1 Magnus
-ALTER TABLE t6 ADD COLUMN adress char(255) FIRST;
-select * from t6;
-adress id name
-NULL 1 Magnus
-insert into t6 values
-("Adress for record 2", 2, "Carl-Gustav"),
-("Adress for record 3", 3, "Karl-Emil");
-update t6 set name="Bertil" where id = 2;
-select * from t6 order by id;
-adress id name
-NULL 1 Magnus
-Adress for record 2 2 Bertil
-Adress for record 3 3 Karl-Emil
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 0
-drop table t6;
-show tables;
-Tables_in_test
-create table t1 (a int,b longblob) engine=ndb;
-show tables;
-Tables_in_test
-t1
-create database test2;
-use test2;
-show tables;
-Tables_in_test2
-select * from t1;
-ERROR 42S02: Table 'test2.t1' doesn't exist
-create table t2 (b int,c longblob) engine=ndb;
-use test;
-select * from t1;
-a b
-show tables;
-Tables_in_test
-t1
-drop table t1;
-use test2;
-drop table t2;
-drop database test2;
-use test;
-drop database if exists test_only_ndb_tables;
-create database test_only_ndb_tables;
-use test_only_ndb_tables;
-create table t1 (a int primary key) engine=ndb;
-select * from t1;
-a
-select * from t1;
-ERROR HY000: Can't lock file (errno: 4009)
-use test;
-drop database test_only_ndb_tables;
-CREATE TABLE t9 (
-a int NOT NULL PRIMARY KEY,
-b int
-) engine=ndb;
-insert t9 values(1, 2), (2,3), (3, 4), (4, 5);
-create table t10 (
-a int not null primary key,
-b blob
-) engine=ndb;
-insert into t10 values (1, 'kalle');
diff --git a/mysql-test/r/ndb_basic.result b/mysql-test/r/ndb_basic.result
deleted file mode 100644
index 7717e9fe72a..00000000000
--- a/mysql-test/r/ndb_basic.result
+++ /dev/null
@@ -1,867 +0,0 @@
-DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7;
-drop database if exists mysqltest;
-CREATE TABLE t1 (
-pk1 INT NOT NULL PRIMARY KEY,
-attr1 INT NOT NULL,
-attr2 INT,
-attr3 VARCHAR(10)
-) ENGINE=ndbcluster;
-SHOW INDEX FROM t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 0 PRIMARY 1 pk1 A 0 NULL NULL BTREE
-INSERT INTO t1 VALUES (9410,9412, NULL, '9412'), (9411,9413, 17, '9413');
-SHOW INDEX FROM t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t1 0 PRIMARY 1 pk1 A 2 NULL NULL BTREE
-SELECT pk1 FROM t1 ORDER BY pk1;
-pk1
-9410
-9411
-SELECT * FROM t1 ORDER BY pk1;
-pk1 attr1 attr2 attr3
-9410 9412 NULL 9412
-9411 9413 17 9413
-SELECT t1.* FROM t1 ORDER BY pk1;
-pk1 attr1 attr2 attr3
-9410 9412 NULL 9412
-9411 9413 17 9413
-UPDATE t1 SET attr1=1 WHERE pk1=9410;
-SELECT * FROM t1 ORDER BY pk1;
-pk1 attr1 attr2 attr3
-9410 1 NULL 9412
-9411 9413 17 9413
-UPDATE t1 SET pk1=2 WHERE attr1=1;
-SELECT * FROM t1 ORDER BY pk1;
-pk1 attr1 attr2 attr3
-2 1 NULL 9412
-9411 9413 17 9413
-UPDATE t1 SET pk1=pk1 + 1;
-SELECT * FROM t1 ORDER BY pk1;
-pk1 attr1 attr2 attr3
-3 1 NULL 9412
-9412 9413 17 9413
-UPDATE t1 SET pk1=4 WHERE pk1 = 3;
-SELECT * FROM t1 ORDER BY pk1;
-pk1 attr1 attr2 attr3
-4 1 NULL 9412
-9412 9413 17 9413
-DELETE FROM t1;
-SELECT * FROM t1;
-pk1 attr1 attr2 attr3
-INSERT INTO t1 VALUES (9410,9412, NULL, '9412'), (9408, 8765, NULL, '8765'),
-(7,8, NULL, NULL), (8,9, NULL, NULL), (9,10, NULL, NULL), (10,11, NULL, NULL), (11,12, NULL, NULL), (12,13, NULL, NULL), (13,14, NULL, NULL);
-UPDATE t1 SET attr1 = 9999;
-SELECT * FROM t1 ORDER BY pk1;
-pk1 attr1 attr2 attr3
-7 9999 NULL NULL
-8 9999 NULL NULL
-9 9999 NULL NULL
-10 9999 NULL NULL
-11 9999 NULL NULL
-12 9999 NULL NULL
-13 9999 NULL NULL
-9408 9999 NULL 8765
-9410 9999 NULL 9412
-UPDATE t1 SET attr1 = 9998 WHERE pk1 < 1000;
-SELECT * FROM t1 ORDER BY pk1;
-pk1 attr1 attr2 attr3
-7 9998 NULL NULL
-8 9998 NULL NULL
-9 9998 NULL NULL
-10 9998 NULL NULL
-11 9998 NULL NULL
-12 9998 NULL NULL
-13 9998 NULL NULL
-9408 9999 NULL 8765
-9410 9999 NULL 9412
-UPDATE t1 SET attr1 = 9997 WHERE attr1 = 9999;
-SELECT * FROM t1 ORDER BY pk1;
-pk1 attr1 attr2 attr3
-7 9998 NULL NULL
-8 9998 NULL NULL
-9 9998 NULL NULL
-10 9998 NULL NULL
-11 9998 NULL NULL
-12 9998 NULL NULL
-13 9998 NULL NULL
-9408 9997 NULL 8765
-9410 9997 NULL 9412
-DELETE FROM t1 WHERE pk1 = 9410;
-SELECT * FROM t1 ORDER BY pk1;
-pk1 attr1 attr2 attr3
-7 9998 NULL NULL
-8 9998 NULL NULL
-9 9998 NULL NULL
-10 9998 NULL NULL
-11 9998 NULL NULL
-12 9998 NULL NULL
-13 9998 NULL NULL
-9408 9997 NULL 8765
-DELETE FROM t1;
-SELECT * FROM t1;
-pk1 attr1 attr2 attr3
-INSERT INTO t1 values (1, 4, NULL, NULL), (2, 4, NULL, NULL), (3, 5, NULL, NULL), (4, 4, NULL, NULL), (5, 5, NULL, NULL);
-DELETE FROM t1 WHERE attr1=4;
-SELECT * FROM t1 order by pk1;
-pk1 attr1 attr2 attr3
-3 5 NULL NULL
-5 5 NULL NULL
-DELETE FROM t1;
-INSERT INTO t1 VALUES (9410,9412, NULL, NULL), (9411, 9413, NULL, NULL);
-DELETE FROM t1 WHERE pk1 = 9410;
-SELECT * FROM t1;
-pk1 attr1 attr2 attr3
-9411 9413 NULL NULL
-DROP TABLE t1;
-CREATE TABLE t1 (id INT, id2 int) engine=ndbcluster;
-INSERT INTO t1 values(3456, 7890);
-SELECT * FROM t1;
-id id2
-3456 7890
-UPDATE t1 SET id=2 WHERE id2=12;
-SELECT * FROM t1;
-id id2
-3456 7890
-UPDATE t1 SET id=1234 WHERE id2=7890;
-SELECT * FROM t1;
-id id2
-1234 7890
-DELETE FROM t1;
-INSERT INTO t1 values(3456, 7890), (3456, 7890), (3456, 7890), (3454, 7890);
-SELECT * FROM t1 ORDER BY id;
-id id2
-3454 7890
-3456 7890
-3456 7890
-3456 7890
-DELETE FROM t1 WHERE id = 3456;
-SELECT * FROM t1 ORDER BY id;
-id id2
-3454 7890
-DROP TABLE t1;
-CREATE TABLE t1 (
-pk1 INT NOT NULL PRIMARY KEY,
-attr1 INT NOT NULL
-) ENGINE=NDBCLUSTER;
-INSERT INTO t1 values(1, 9999);
-DROP TABLE t1;
-CREATE TABLE t1 (
-pk1 INT NOT NULL PRIMARY KEY,
-attr1 INT NOT NULL
-) ENGINE=NDB;
-INSERT INTO t1 values(1, 9999);
-DROP TABLE t1;
-CREATE TABLE t2 (
-a bigint unsigned NOT NULL PRIMARY KEY,
-b int unsigned not null,
-c int unsigned
-) engine=ndbcluster;
-CREATE TABLE t3 (
-a bigint unsigned NOT NULL,
-b bigint unsigned not null,
-c bigint unsigned,
-PRIMARY KEY(a)
-) engine=ndbcluster;
-CREATE TABLE t4 (
-a bigint unsigned NOT NULL,
-b bigint unsigned not null,
-c bigint unsigned NOT NULL,
-d int unsigned,
-PRIMARY KEY(a, b, c)
-) engine=ndbcluster;
-select * from t2 where a = 7 order by b;
-a b c
-7 16 5
-select * from t2 where a = 7 order by a;
-a b c
-7 16 5
-select * from t2 where a = 7 order by 2;
-a b c
-7 16 5
-select * from t2 where a = 7 order by c;
-a b c
-7 16 5
-select * from t2 where a = 7 and b = 16 order by b;
-a b c
-7 16 5
-select * from t2 where a = 7 and b = 16 order by a;
-a b c
-7 16 5
-select * from t2 where a = 7 and b = 17 order by a;
-a b c
-select * from t2 where a = 7 and b != 16 order by b;
-a b c
-select * from t2 where a = 7 and b = 16 and c = 5 order by b;
-a b c
-7 16 5
-select * from t2 where a = 7 and b = 16 and c = 5 order by a;
-a b c
-7 16 5
-select * from t2 where a = 7 and b = 16 and c = 6 order by a;
-a b c
-select * from t2 where a = 7 and b != 16 and c = 5 order by b;
-a b c
-select * from t3 where a = 7 order by b;
-a b c
-7 16 5
-select * from t3 where a = 7 order by a;
-a b c
-7 16 5
-select * from t3 where a = 7 order by 2;
-a b c
-7 16 5
-select * from t3 where a = 7 order by c;
-a b c
-7 16 5
-select * from t3 where a = 7 and b = 16 order by b;
-a b c
-7 16 5
-select * from t3 where a = 7 and b = 16 order by a;
-a b c
-7 16 5
-select * from t3 where a = 7 and b = 17 order by a;
-a b c
-select * from t3 where a = 7 and b != 16 order by b;
-a b c
-select * from t4 where a = 7 order by b;
-a b c d
-7 16 5 26007
-select * from t4 where a = 7 order by a;
-a b c d
-7 16 5 26007
-select * from t4 where a = 7 order by 2;
-a b c d
-7 16 5 26007
-select * from t4 where a = 7 order by c;
-a b c d
-7 16 5 26007
-select * from t4 where a = 7 and b = 16 order by b;
-a b c d
-7 16 5 26007
-select * from t4 where a = 7 and b = 16 order by a;
-a b c d
-7 16 5 26007
-select * from t4 where a = 7 and b = 17 order by a;
-a b c d
-select * from t4 where a = 7 and b != 16 order by b;
-a b c d
-delete from t2 where a > 5;
-select x1.a, x1.b from t2 x1, t2 x2 where x1.b = x2.b order by x1.a;
-a b
-1 10
-3 12
-5 14
-select a, b FROM t2 outer_table where
-a = (select a from t2 where b = outer_table.b ) order by a;
-a b
-1 10
-3 12
-5 14
-delete from t2;
-delete from t3;
-delete from t4;
-drop table t2;
-drop table t3;
-drop table t4;
-CREATE TABLE t5 (
-a bigint unsigned NOT NULL,
-b bigint unsigned not null,
-c bigint unsigned NOT NULL,
-d int unsigned,
-PRIMARY KEY(a, b, c)
-) engine=ndbcluster;
-insert into t5 values(10, 19, 5, 26010);
-delete from t5 where a=10 and b=19 and c=5;
-select * from t5;
-a b c d
-insert into t5 values(10, 19, 5, 26010);
-update t5 set d=21997 where a=10 and b=19 and c=5;
-select * from t5;
-a b c d
-10 19 5 21997
-delete from t5;
-drop table t5;
-CREATE TABLE t6 (
-adress char(255),
-a int NOT NULL PRIMARY KEY,
-b int
-) engine = NDB;
-insert into t6 values
-("Nice road 3456", 1, 23),
-("Street Road 78", 3, 92),
-("Road street 89C", 5, 71),
-(NULL, 7, NULL);
-select * from t6 order by a;
-adress a b
-Nice road 3456 1 23
-Street Road 78 3 92
-Road street 89C 5 71
-NULL 7 NULL
-select a, b from t6 order by a;
-a b
-1 23
-3 92
-5 71
-7 NULL
-update t6 set adress="End of road 09" where a=3;
-update t6 set b=181, adress="Street 76" where a=7;
-select * from t6 order by a;
-adress a b
-Nice road 3456 1 23
-End of road 09 3 92
-Road street 89C 5 71
-Street 76 7 181
-select * from t6 where a=1;
-adress a b
-Nice road 3456 1 23
-delete from t6 where a=1;
-select * from t6 order by a;
-adress a b
-End of road 09 3 92
-Road street 89C 5 71
-Street 76 7 181
-delete from t6 where b=71;
-select * from t6 order by a;
-adress a b
-End of road 09 3 92
-Street 76 7 181
-drop table t6;
-CREATE TABLE t7 (
-adress char(255),
-a int NOT NULL,
-b int,
-c int NOT NULL,
-PRIMARY KEY(a, c)
-) engine = NDB;
-insert into t7 values
-("Highway 3456", 1, 23, 2),
-("Street Road 78", 3, 92, 3),
-("Main street 89C", 5, 71, 4),
-(NULL, 8, NULL, 12);
-select * from t7 order by a;
-adress a b c
-Highway 3456 1 23 2
-Street Road 78 3 92 3
-Main street 89C 5 71 4
-NULL 8 NULL 12
-select a, b from t7 order by a;
-a b
-1 23
-3 92
-5 71
-8 NULL
-update t7 set adress="End of road 09" where a=3;
-update t7 set adress="Gatuvägen 90C" where a=5 and c=4;
-update t7 set adress="No adress" where adress is NULL;
-select * from t7 order by a;
-adress a b c
-Highway 3456 1 23 2
-End of road 09 3 92 3
-Gatuvägen 90C 5 71 4
-No adress 8 NULL 12
-select * from t7 where a=1 and c=2;
-adress a b c
-Highway 3456 1 23 2
-delete from t7 where a=1;
-delete from t7 where a=3 and c=3;
-delete from t7 where a=5 and c=4;
-select * from t7;
-adress a b c
-No adress 8 NULL 12
-delete from t7 where b=23;
-select * from t7;
-adress a b c
-No adress 8 NULL 12
-drop table t7;
-CREATE TABLE t1 (
-pk1 INT NOT NULL PRIMARY KEY,
-attr1 INT NOT NULL,
-attr2 INT,
-attr3 VARCHAR(10)
-) ENGINE=ndbcluster;
-INSERT INTO t1 VALUES (9410,9412, NULL, '9412'), (9411,9413, 17, '9413');
-create database mysqltest;
-use mysqltest;
-CREATE TABLE t2 (
-a bigint unsigned NOT NULL PRIMARY KEY,
-b int unsigned not null,
-c int unsigned
-) engine=ndbcluster;
-insert into t2 select pk1,attr1,attr2 from test.t1;
-select * from t2 order by a;
-a b c
-9410 9412 NULL
-9411 9413 17
-select b from test.t1, t2 where c = test.t1.attr2;
-b
-9413
-select b,test.t1.attr1 from test.t1, t2 where test.t1.pk1 < a;
-b attr1
-9413 9412
-drop table test.t1, t2;
-drop database mysqltest;
-drop database if exists ndbtest1;
-create database ndbtest1;
-use ndbtest1;
-create table t1(id int) engine=ndbcluster;
-drop database ndbtest1;
-drop database ndbtest1;
-ERROR HY000: Can't drop database 'ndbtest1'; database doesn't exist
-use test;
-create table t1 (a int primary key, b char(0));
-insert into t1 values (1,"");
-insert into t1 values (2,NULL);
-select * from t1 order by a;
-a b
-1
-2 NULL
-select * from t1 order by b;
-a b
-2 NULL
-1
-select * from t1 where b IS NULL;
-a b
-2 NULL
-select * from t1 where b IS NOT NULL;
-a b
-1
-drop table t1;
-create table t1 (
-c1 int,
-c2 int,
-c3 int,
-c4 int,
-c5 int,
-c6 int,
-c7 int,
-c8 int,
-c9 int,
-c10 int,
-c11 int,
-c12 int,
-c13 int,
-c14 int,
-c15 int,
-c16 int,
-c17 int,
-c18 int,
-c19 int,
-c20 int,
-c21 int,
-c22 int,
-c23 int,
-c24 int,
-c25 int,
-c26 int,
-c27 int,
-c28 int,
-c29 int,
-c30 int,
-c31 int,
-c32 int,
-c33 int,
-c34 int,
-c35 int,
-c36 int,
-c37 int,
-c38 int,
-c39 int,
-c40 int,
-c41 int,
-c42 int,
-c43 int,
-c44 int,
-c45 int,
-c46 int,
-c47 int,
-c48 int,
-c49 int,
-c50 int,
-c51 int,
-c52 int,
-c53 int,
-c54 int,
-c55 int,
-c56 int,
-c57 int,
-c58 int,
-c59 int,
-c60 int,
-c61 int,
-c62 int,
-c63 int,
-c64 int,
-c65 int,
-c66 int,
-c67 int,
-c68 int,
-c69 int,
-c70 int,
-c71 int,
-c72 int,
-c73 int,
-c74 int,
-c75 int,
-c76 int,
-c77 int,
-c78 int,
-c79 int,
-c80 int,
-c81 int,
-c82 int,
-c83 int,
-c84 int,
-c85 int,
-c86 int,
-c87 int,
-c88 int,
-c89 int,
-c90 int,
-c91 int,
-c92 int,
-c93 int,
-c94 int,
-c95 int,
-c96 int,
-c97 int,
-c98 int,
-c99 int,
-c100 int,
-c101 int,
-c102 int,
-c103 int,
-c104 int,
-c105 int,
-c106 int,
-c107 int,
-c108 int,
-c109 int,
-c110 int,
-c111 int,
-c112 int,
-c113 int,
-c114 int,
-c115 int,
-c116 int,
-c117 int,
-c118 int,
-c119 int,
-c120 int,
-c121 int,
-c122 int,
-c123 int,
-c124 int,
-c125 int,
-c126 int,
-c127 int,
-c128 int,
-primary key using hash(c1)) engine=ndb partition by key(c1);
-drop table t1;
-create table t1 (
-a1234567890123456789012345678901234567890 int primary key,
-a12345678901234567890123456789a1234567890 int,
-index(a12345678901234567890123456789a1234567890)
-) engine=ndb;
-show tables;
-Tables_in_test
-t1
-insert into t1 values (1,1),(2,1),(3,1),(4,1),(5,2),(6,1),(7,1);
-explain select * from t1 where a12345678901234567890123456789a1234567890=2;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref a12345678901234567890123456789a1234567890 a12345678901234567890123456789a1234567890 5 const # Using where with pushed condition
-select * from t1 where a12345678901234567890123456789a1234567890=2;
-a1234567890123456789012345678901234567890 a12345678901234567890123456789a1234567890
-5 2
-drop table t1;
-create table t1
-(a bigint, b bigint, c bigint, d bigint,
-primary key (a,b,c,d))
-engine=ndb
-max_rows=800000000;
-Warnings:
-Warning 1105 Ndb might have problems storing the max amount of rows specified
-insert into t1 values
-(1,2,3,4),(2,3,4,5),(3,4,5,6),
-(3,2,3,4),(1,3,4,5),(2,4,5,6),
-(1,2,3,5),(2,3,4,8),(3,4,5,9),
-(3,2,3,5),(1,3,4,8),(2,4,5,9),
-(1,2,3,6),(2,3,4,6),(3,4,5,7),
-(3,2,3,6),(1,3,4,6),(2,4,5,7),
-(1,2,3,7),(2,3,4,7),(3,4,5,8),
-(3,2,3,7),(1,3,4,7),(2,4,5,8),
-(1,3,3,4),(2,4,4,5),(3,5,5,6),
-(3,3,3,4),(1,4,4,5),(2,5,5,6),
-(1,3,3,5),(2,4,4,8),(3,5,5,9),
-(3,3,3,5),(1,4,4,8),(2,5,5,9),
-(1,3,3,6),(2,4,4,6),(3,5,5,7),
-(3,3,3,6),(1,4,4,6),(2,5,5,7),
-(1,3,3,7),(2,4,4,7),(3,5,5,8),
-(3,3,3,7),(1,4,4,7),(2,5,5,8);
-select count(*) from t1;
-count(*)
-48
-drop table t1;
-create table t1
-(a bigint, b bigint, c bigint, d bigint,
-primary key (a))
-engine=ndb
-max_rows=1;
-drop table t1;
-create table t1
-(counter int(64) NOT NULL auto_increment,
-datavalue char(40) default 'XXXX',
-primary key (counter)
-) ENGINE=ndbcluster;
-insert into t1 (datavalue) values ('newval');
-insert into t1 (datavalue) values ('newval');
-select * from t1 order by counter;
-counter datavalue
-1 newval
-2 newval
-insert into t1 (datavalue) select datavalue from t1 where counter < 100;
-insert into t1 (datavalue) select datavalue from t1 where counter < 100;
-select * from t1 order by counter;
-counter datavalue
-1 newval
-2 newval
-3 newval
-4 newval
-5 newval
-6 newval
-7 newval
-8 newval
-insert into t1 (datavalue) select datavalue from t1 where counter < 100;
-insert into t1 (datavalue) select datavalue from t1 where counter < 100;
-select * from t1 order by counter;
-counter datavalue
-1 newval
-2 newval
-3 newval
-4 newval
-5 newval
-6 newval
-7 newval
-8 newval
-9 newval
-10 newval
-11 newval
-12 newval
-13 newval
-14 newval
-15 newval
-16 newval
-17 newval
-18 newval
-19 newval
-20 newval
-21 newval
-22 newval
-23 newval
-24 newval
-25 newval
-26 newval
-27 newval
-28 newval
-29 newval
-30 newval
-31 newval
-32 newval
-drop table t1;
-CREATE TABLE t1 ( b INT ) PACK_KEYS = 0 ENGINE = ndb;
-select * from t1;
-b
-drop table t1;
-create table t1 (a int) engine=ndb;
-create table t2 (a int) engine=ndb;
-insert into t1 values (1);
-insert into t2 values (1);
-delete t1.* from t1, t2 where t1.a = t2.a;
-select * from t1;
-a
-select * from t2;
-a
-1
-drop table t1;
-drop table t2;
-CREATE TABLE t1 (
-i INT,
-j INT,
-x INT,
-y INT,
-z INT
-) engine=ndb;
-CREATE TABLE t2 (
-i INT,
-k INT,
-x INT,
-y INT,
-z INT
-) engine=ndb;
-CREATE TABLE t3 (
-j INT,
-k INT,
-x INT,
-y INT,
-z INT
-) engine=ndb;
-INSERT INTO t1 VALUES ( 1, 2,13,14,15);
-INSERT INTO t2 VALUES ( 1, 3,23,24,25);
-INSERT INTO t3 VALUES ( 2, 3, 1,34,35), ( 2, 3, 1,34,36);
-UPDATE t1 AS a
-INNER JOIN t2 AS b
-ON a.i = b.i
-INNER JOIN t3 AS c
-ON a.j = c.j AND b.k = c.k
-SET a.x = b.x,
-a.y = b.y,
-a.z = (
-SELECT sum(z)
-FROM t3
-WHERE y = 34
-)
-WHERE b.x = 23;
-select * from t1;
-i j x y z
-1 2 23 24 71
-drop table t1;
-drop table t2;
-drop table t3;
-create table atablewithareallylongandirritatingname (a int);
-insert into atablewithareallylongandirritatingname values (2);
-select * from atablewithareallylongandirritatingname;
-a
-2
-drop table atablewithareallylongandirritatingname;
-create table t1 (f1 varchar(50), f2 text,f3 int, primary key(f1)) engine=NDB;
-insert into t1 (f1,f2,f3)VALUES("111111","aaaaaa",1);
-insert into t1 (f1,f2,f3)VALUES("222222","bbbbbb",2);
-select * from t1 order by f1;
-f1 f2 f3
-111111 aaaaaa 1
-222222 bbbbbb 2
-select * from t1 order by f2;
-f1 f2 f3
-111111 aaaaaa 1
-222222 bbbbbb 2
-select * from t1 order by f3;
-f1 f2 f3
-111111 aaaaaa 1
-222222 bbbbbb 2
-drop table t1;
-Illegal ndb error code: 1186
-CREATE TABLE t1 (
-a VARBINARY(40) NOT NULL,
-b VARCHAR (256) CHARACTER SET UTF8 NOT NULL,
-c VARCHAR(256) CHARACTER SET UTF8 NOT NULL,
-PRIMARY KEY (b,c)) ENGINE=ndbcluster;
-INSERT INTO t1 VALUES
-("a","ab","abc"),("b","abc","abcd"),("c","abc","ab"),("d","ab","ab"),("e","abc","abc");
-SELECT * FROM t1 ORDER BY a;
-a b c
-a ab abc
-b abc abcd
-c abc ab
-d ab ab
-e abc abc
-DROP TABLE t1;
-End of 5.0 tests
-CREATE TABLE t1 (a VARCHAR(255) NOT NULL,
-CONSTRAINT pk_a PRIMARY KEY (a))engine=ndb;
-CREATE TABLE t2(a VARCHAR(255) NOT NULL,
-b VARCHAR(255) NOT NULL,
-c VARCHAR(255) NOT NULL,
-CONSTRAINT pk_b_c_id PRIMARY KEY (b,c),
-CONSTRAINT fk_a FOREIGN KEY(a) REFERENCES t1(a))engine=ndb;
-drop table t1, t2;
-create table t1 (a int not null primary key, b int) engine=ndb;
-insert into t1 values(1,1),(2,2),(3,3);
-create table t2 like t1;
-insert into t2 select * from t1;
-select * from t1 order by a;
-a b
-1 1
-2 2
-3 3
-select * from t2 order by a;
-a b
-1 1
-2 2
-3 3
-drop table t1, t2;
-create table t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb;
-create table if not exists t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb;
-create table t2 like t1;
-rename table t1 to t10, t2 to t20;
-drop table t10,t20;
-create table t1 (a int not null primary key, b int not null) engine=ndb;
-create table t2 (a int not null primary key, b int not null) engine=ndb;
-insert into t1 values (1,10), (2,20), (3,30);
-insert into t2 values (1,10), (2,20), (3,30);
-select * from t1 order by a;
-a b
-1 10
-2 20
-3 30
-delete from t1 where a > 0 order by a desc limit 1;
-select * from t1 order by a;
-a b
-1 10
-2 20
-delete from t1,t2 using t1,t2 where t1.a = t2.a;
-select * from t2 order by a;
-a b
-3 30
-drop table t1,t2;
-create table t1 (a int not null primary key, b int not null) engine=ndb;
-insert into t1 values (1,10), (2,20), (3,30);
-insert into t1 set a=1, b=100;
-ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
-insert ignore into t1 set a=1, b=100;
-select * from t1 order by a;
-a b
-1 10
-2 20
-3 30
-insert into t1 set a=1, b=1000 on duplicate key update b=b+1;
-select * from t1 order by a;
-a b
-1 11
-2 20
-3 30
-drop table t1;
-create table t1 (a int not null primary key, b int not null) engine=ndb;
-create table t2 (c int not null primary key, d int not null) engine=ndb;
-insert into t1 values (1,10), (2,10), (3,30), (4, 30);
-insert into t2 values (1,10), (2,10), (3,30), (4, 30);
-update t1 set a = 1 where a = 3;
-ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
-select * from t1 order by a;
-a b
-1 10
-2 10
-3 30
-4 30
-update t1 set b = 1 where a > 1 order by a desc limit 1;
-select * from t1 order by a;
-a b
-1 10
-2 10
-3 30
-4 1
-update t1,t2 set a = 1, c = 1 where a = 3 and c = 3;
-ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
-select * from t1 order by a;
-a b
-1 10
-2 10
-3 30
-4 1
-update ignore t1,t2 set a = 1, c = 1 where a = 3 and c = 3;
-select * from t1 order by a;
-a b
-1 10
-2 10
-3 1
-4 1
-drop table t1,t2;
-End of 5.1 tests
diff --git a/mysql-test/r/ndb_binlog_basic.result b/mysql-test/r/ndb_binlog_basic.result
deleted file mode 100644
index 931d01dbebe..00000000000
--- a/mysql-test/r/ndb_binlog_basic.result
+++ /dev/null
@@ -1,51 +0,0 @@
-drop table if exists t1, t2;
-drop database if exists mysqltest;
-create database mysqltest;
-use mysqltest;
-drop database mysqltest;
-use test;
-create table t1 (a int primary key) engine=ndb;
-insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-select @max_epoch:=max(epoch)-1 from mysql.ndb_binlog_index;
-@max_epoch:=max(epoch)-1
-#
-delete from t1;
-alter table t1 add (b int);
-insert into t1 values (3,3),(4,4);
-alter table t1 rename t2;
-begin;
-insert into t2 values (1,1),(2,2);
-update t2 set b=1 where a=3;
-delete from t2 where a=4;
-commit;
-drop table t2;
-select inserts from mysql.ndb_binlog_index where epoch > @max_epoch and inserts > 5;
-inserts
-10
-select deletes from mysql.ndb_binlog_index where epoch > @max_epoch and deletes > 5;
-deletes
-10
-select inserts,updates,deletes from
-mysql.ndb_binlog_index where epoch > @max_epoch and updates > 0;
-inserts updates deletes
-2 1 1
-flush logs;
-purge master logs before now();
-select count(*) from mysql.ndb_binlog_index;
-count(*)
-0
-create table t1 (a int primary key, b int) engine=ndb;
-create database mysqltest;
-use mysqltest;
-create table t1 (c int, d int primary key) engine=ndb;
-use test;
-insert into mysqltest.t1 values (2,1),(2,2);
-select @max_epoch:=max(epoch)-1 from mysql.ndb_binlog_index;
-@max_epoch:=max(epoch)-1
-#
-drop table t1;
-drop database mysqltest;
-select inserts,updates,deletes from
-mysql.ndb_binlog_index where epoch > @max_epoch and inserts > 0;
-inserts updates deletes
-2 0 0
diff --git a/mysql-test/r/ndb_binlog_basic2.result b/mysql-test/r/ndb_binlog_basic2.result
deleted file mode 100644
index 9b9f642bd86..00000000000
--- a/mysql-test/r/ndb_binlog_basic2.result
+++ /dev/null
@@ -1,12 +0,0 @@
-set session binlog_format=row;
-ERROR HY000: The NDB cluster engine does not support changing the binlog format on the fly yet
-set session binlog_format=statement;
-ERROR HY000: The NDB cluster engine does not support changing the binlog format on the fly yet
-set global binlog_format=row;
-ERROR HY000: The NDB cluster engine does not support changing the binlog format on the fly yet
-set global binlog_format=statement;
-ERROR HY000: The NDB cluster engine does not support changing the binlog format on the fly yet
-set session binlog_format=default;
-ERROR HY000: The NDB cluster engine does not support changing the binlog format on the fly yet
-set global binlog_format=default;
-ERROR HY000: The NDB cluster engine does not support changing the binlog format on the fly yet
diff --git a/mysql-test/r/ndb_binlog_multi.result b/mysql-test/r/ndb_binlog_multi.result
deleted file mode 100644
index bf9b34db64b..00000000000
--- a/mysql-test/r/ndb_binlog_multi.result
+++ /dev/null
@@ -1,84 +0,0 @@
-drop table if exists t1,t2,t3;
-drop table if exists t1,t2,t3;
-CREATE TABLE t3 (dummy INT PRIMARY KEY) ENGINE = NDB;
-DROP TABLE t3;
-reset master;
-reset master;
-CREATE TABLE t2 (a INT PRIMARY KEY, b int) ENGINE = NDB;
-INSERT INTO t2 VALUES (1,1),(2,2);
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin1.000001 # Query 102 # use `test`; CREATE TABLE t2 (a INT PRIMARY KEY, b int) ENGINE = NDB
-master-bin1.000001 # Query 102 # BEGIN
-master-bin1.000001 # Table_map 102 # table_id: # (test.t2)
-master-bin1.000001 # Table_map 102 # table_id: # (mysql.ndb_apply_status)
-master-bin1.000001 # Write_rows 102 # table_id: #
-master-bin1.000001 # Write_rows 102 # table_id: #
-master-bin1.000001 # Write_rows 102 # table_id: # flags: STMT_END_F
-master-bin1.000001 # Query 102 # COMMIT
-select * from t2 order by a;
-a b
-1 1
-2 2
-SELECT @the_epoch:=epoch,inserts,updates,deletes,schemaops FROM
-mysql.ndb_binlog_index ORDER BY epoch DESC LIMIT 1;
-@the_epoch:=epoch inserts updates deletes schemaops
-<the_epoch> 2 0 0 0
-SELECT * FROM t2 ORDER BY a;
-a b
-1 1
-2 2
-DROP TABLE t2;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query 102 # use `test`; CREATE TABLE t2 (a INT PRIMARY KEY, b int) ENGINE = NDB
-master-bin.000001 # Query 1 # BEGIN
-master-bin.000001 # Table_map 1 # table_id: # (test.t2)
-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: #
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Query 1 # COMMIT
-master-bin.000001 # Query 1 # use `test`; DROP TABLE t2
-SELECT inserts,updates,deletes,schemaops FROM
-mysql.ndb_binlog_index WHERE epoch=<the_epoch>;
-inserts updates deletes schemaops
-2 0 0 0
-reset master;
-reset master;
-CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = NDB;
-INSERT INTO t1 VALUES (1),(2);
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin1.000001 # Query 102 # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = NDB
-master-bin1.000001 # Query 102 # BEGIN
-master-bin1.000001 # Table_map 102 # table_id: # (test.t1)
-master-bin1.000001 # Table_map 102 # table_id: # (mysql.ndb_apply_status)
-master-bin1.000001 # Write_rows 102 # table_id: #
-master-bin1.000001 # Write_rows 102 # table_id: #
-master-bin1.000001 # Write_rows 102 # table_id: # flags: STMT_END_F
-master-bin1.000001 # Query 102 # COMMIT
-SELECT @the_epoch2:=epoch,inserts,updates,deletes,schemaops FROM
-mysql.ndb_binlog_index ORDER BY epoch DESC LIMIT 1;
-@the_epoch2:=epoch inserts updates deletes schemaops
-<the_epoch2> 2 0 0 0
-SELECT inserts,updates,deletes,schemaops FROM
-mysql.ndb_binlog_index WHERE epoch > <the_epoch> AND epoch <= <the_epoch2>;
-inserts updates deletes schemaops
-2 0 0 0
-drop table t1;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin1.000001 # Query 102 # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = NDB
-master-bin1.000001 # Query 102 # BEGIN
-master-bin1.000001 # Table_map 102 # table_id: # (test.t1)
-master-bin1.000001 # Table_map 102 # table_id: # (mysql.ndb_apply_status)
-master-bin1.000001 # Write_rows 102 # table_id: #
-master-bin1.000001 # Write_rows 102 # table_id: #
-master-bin1.000001 # Write_rows 102 # table_id: # flags: STMT_END_F
-master-bin1.000001 # Query 102 # COMMIT
-master-bin1.000001 # Query 102 # use `test`; drop table t1
-SELECT inserts,updates,deletes,schemaops FROM
-mysql.ndb_binlog_index WHERE epoch > <the_epoch> AND epoch <= <the_epoch2>;
-inserts updates deletes schemaops
-2 0 0 0
diff --git a/mysql-test/r/ndb_condition_pushdown.result b/mysql-test/r/ndb_condition_pushdown.result
deleted file mode 100644
index df281230c9e..00000000000
--- a/mysql-test/r/ndb_condition_pushdown.result
+++ /dev/null
@@ -1,1892 +0,0 @@
-DROP TABLE IF EXISTS t1,t2,t3,t4;
-CREATE TABLE t1 (
-auto int(5) unsigned NOT NULL auto_increment,
-string char(10),
-vstring varchar(10),
-bin binary(2),
-vbin varbinary(7),
-tiny tinyint(4) DEFAULT '0' NOT NULL ,
-short smallint(6) DEFAULT '1' NOT NULL ,
-medium mediumint(8) DEFAULT '0' NOT NULL,
-long_int int(11) DEFAULT '0' NOT NULL,
-longlong bigint(13) DEFAULT '0' NOT NULL,
-real_float float(13,1) DEFAULT 0.0 NOT NULL,
-real_double double(16,4),
-real_decimal decimal(16,4),
-utiny tinyint(3) unsigned DEFAULT '0' NOT NULL,
-ushort smallint(5) unsigned zerofill DEFAULT '00000' NOT NULL,
-umedium mediumint(8) unsigned DEFAULT '0' NOT NULL,
-ulong int(11) unsigned DEFAULT '0' NOT NULL,
-ulonglong bigint(13) unsigned DEFAULT '0' NOT NULL,
-bits bit(3),
-options enum('zero','one','two','three','four') not null,
-flags set('zero','one','two','three','four') not null,
-date_field date,
-year_field year,
-time_field time,
-date_time datetime,
-time_stamp timestamp,
-PRIMARY KEY (auto)
-) engine=ndb;
-insert into t1 values
-(NULL,"aaaa","aaaa",0xAAAA,0xAAAA,-1,-1,-1,-1,-1,1.1,1.1,1.1,1,1,1,1,1,
-b'001','one','one',
-'1901-01-01','1901',
-'01:01:01','1901-01-01 01:01:01',NULL),
-(NULL,"bbbb","bbbb",0xBBBB,0xBBBB,-2,-2,-2,-2,-2,2.2,2.2,2.2,2,2,2,2,2,
-b'010','two','one,two',
-'1902-02-02','1902',
-'02:02:02','1902-02-02 02:02:02',NULL),
-(NULL,"cccc","cccc",0xCCCC,0xCCCC,-3,-3,-3,-3,-3,3.3,3.3,3.3,3,3,3,3,3,
-b'011','three','one,two,three',
-'1903-03-03','1903',
-'03:03:03','1903-03-03 03:03:03',NULL),
-(NULL,"dddd","dddd",0xDDDD,0xDDDD,-4,-4,-4,-4,-4,4.4,4.4,4.4,4,4,4,4,4,
-b'100','four','one,two,three,four',
-'1904-04-04','1904',
-'04:04:04','1904-04-04 04:04:04',NULL);
-CREATE TABLE t2 (pk1 int unsigned NOT NULL PRIMARY KEY, attr1 int unsigned NOT NULL, attr2 int unsigned, attr3 VARCHAR(10) ) ENGINE=ndbcluster;
-insert into t2 values (0,0,0, "a"),(1,1,1,"b"),(2,2,NULL,NULL),(3,3,3,"d"),(4,4,4,"e"),(5,5,5,"f");
-CREATE TABLE t3 (pk1 int unsigned NOT NULL PRIMARY KEY, attr1 int unsigned NOT NULL, attr2 bigint unsigned, attr3 tinyint unsigned, attr4 VARCHAR(10) ) ENGINE=ndbcluster;
-insert into t3 values (0,0,0,0,"a"),(1,1,9223372036854775803,1,"b"),(2,2,9223372036854775804,2,"c"),(3,3,9223372036854775805,3,"d"),(4,4,9223372036854775806,4,"e"),(5,5,9223372036854775807,5,"f");
-CREATE TABLE t4 (pk1 int unsigned NOT NULL PRIMARY KEY, attr1 int unsigned NOT NULL, attr2 bigint unsigned, attr3 tinyint unsigned, attr4 VARCHAR(10) , KEY (attr1)) ENGINE=ndbcluster;
-insert into t4 values (0,0,0,0,"a"),(1,1,9223372036854775803,1,"b"),(2,2,9223372036854775804,2,"c"),(3,3,9223372036854775805,3,"d"),(4,4,9223372036854775806,4,"e"),(5,5,9223372036854775807,5,"f");
-set @old_ecpd = @@session.engine_condition_pushdown;
-set engine_condition_pushdown = off;
-select auto from t1 where
-string = "aaaa" and
-vstring = "aaaa" and
-bin = 0xAAAA and
-vbin = 0xAAAA and
-tiny = -1 and
-short = -1 and
-medium = -1 and
-long_int = -1 and
-longlong = -1 and
-real_float > 1.0 and real_float < 2.0 and
-real_double > 1.0 and real_double < 2.0 and
-real_decimal > 1.0 and real_decimal < 2.0 and
-utiny = 1 and
-ushort = 1 and
-umedium = 1 and
-ulong = 1 and
-ulonglong = 1 and
-bits = b'001' and
-options = 'one' and
-flags = 'one' and
-date_field = '1901-01-01' and
-year_field = '1901' and
-time_field = '01:01:01' and
-date_time = '1901-01-01 01:01:01'
-order by auto;
-auto
-1
-select auto from t1 where
-string != "aaaa" and
-vstring != "aaaa" and
-bin != 0xAAAA and
-vbin != 0xAAAA and
-tiny != -1 and
-short != -1 and
-medium != -1 and
-long_int != -1 and
-longlong != -1 and
-(real_float < 1.0 or real_float > 2.0) and
-(real_double < 1.0 or real_double > 2.0) and
-(real_decimal < 1.0 or real_decimal > 2.0) and
-utiny != 1 and
-ushort != 1 and
-umedium != 1 and
-ulong != 1 and
-ulonglong != 1 and
-bits != b'001' and
-options != 'one' and
-flags != 'one' and
-date_field != '1901-01-01' and
-year_field != '1901' and
-time_field != '01:01:01' and
-date_time != '1901-01-01 01:01:01'
-order by auto;
-auto
-2
-3
-4
-select auto from t1 where
-string > "aaaa" and
-vstring > "aaaa" and
-bin > 0xAAAA and
-vbin > 0xAAAA and
-tiny < -1 and
-short < -1 and
-medium < -1 and
-long_int < -1 and
-longlong < -1 and
-real_float > 1.1 and
-real_double > 1.1 and
-real_decimal > 1.1 and
-utiny > 1 and
-ushort > 1 and
-umedium > 1 and
-ulong > 1 and
-ulonglong > 1 and
-bits > b'001' and
-(options = 'two' or options = 'three' or options = 'four') and
-(flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
-date_field > '1901-01-01' and
-year_field > '1901' and
-time_field > '01:01:01' and
-date_time > '1901-01-01 01:01:01'
-order by auto;
-auto
-2
-3
-4
-select auto from t1 where
-string >= "aaaa" and
-vstring >= "aaaa" and
-bin >= 0xAAAA and
-vbin >= 0xAAAA and
-tiny <= -1 and
-short <= -1 and
-medium <= -1 and
-long_int <= -1 and
-longlong <= -1 and
-real_float >= 1.0 and
-real_double >= 1.0 and
-real_decimal >= 1.0 and
-utiny >= 1 and
-ushort >= 1 and
-umedium >= 1 and
-ulong >= 1 and
-ulonglong >= 1 and
-bits >= b'001' and
-(options = 'one' or options = 'two' or options = 'three' or options = 'four') and
-(flags = 'one' or flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
-date_field >= '1901-01-01' and
-year_field >= '1901' and
-time_field >= '01:01:01' and
-date_time >= '1901-01-01 01:01:01'
-order by auto;
-auto
-1
-2
-3
-4
-select auto from t1 where
-string < "dddd" and
-vstring < "dddd" and
-bin < 0xDDDD and
-vbin < 0xDDDD and
-tiny > -4 and
-short > -4 and
-medium > -4 and
-long_int > -4 and
-longlong > -4 and
-real_float < 4.4 and
-real_double < 4.4 and
-real_decimal < 4.4 and
-utiny < 4 and
-ushort < 4 and
-umedium < 4 and
-ulong < 4 and
-ulonglong < 4 and
-bits < b'100' and
-(options = 'one' or options = 'two' or options = 'three') and
-(flags = 'one' or flags = 'one,two' or flags = 'one,two,three') and
-date_field < '1904-01-01' and
-year_field < '1904' and
-time_field < '04:04:04' and
-date_time < '1904-04-04 04:04:04'
-order by auto;
-auto
-1
-2
-3
-select auto from t1 where
-string <= "dddd" and
-vstring <= "dddd" and
-bin <= 0xDDDD and
-vbin <= 0xDDDD and
-tiny >= -4 and
-short >= -4 and
-medium >= -4 and
-long_int >= -4 and
-longlong >= -4 and
-real_float <= 4.5 and
-real_double <= 4.5 and
-real_decimal <= 4.5 and
-utiny <= 4 and
-ushort <= 4 and
-umedium <= 4 and
-ulong <= 4 and
-ulonglong <= 4 and
-bits <= b'100' and
-(options = 'one' or options = 'two' or options = 'three' or options = 'four') and
-(flags = 'one' or flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
-date_field <= '1904-04-04' and
-year_field <= '1904' and
-time_field <= '04:04:04' and
-date_time <= '1904-04-04 04:04:04'
-order by auto;
-auto
-1
-2
-3
-4
-select auto from t1 where
-string like "b%" and
-vstring like "b%" and
-bin like concat(0xBB, '%') and
-vbin like concat(0xBB, '%')
-order by auto;
-auto
-2
-select auto from t1 where
-string not like "b%" and
-vstring not like "b%" and
-bin not like concat(0xBB, '%') and
-vbin not like concat(0xBB, '%')
-order by auto;
-auto
-1
-3
-4
-select auto from t1 where
-(string between "aaaa" and "cccc") and
-(vstring between "aaaa" and "cccc") and
-(bin between 0xAAAA and 0xCCCC) and
-(vbin between 0xAAAA and 0xCCCC) and
-(tiny between -3 and -1) and
-(short between -3 and -1) and
-(medium between -3 and -1) and
-(long_int between -3 and -1) and
-(longlong between -3 and -1) and
-(utiny between 1 and 3) and
-(ushort between 1 and 3) and
-(umedium between 1 and 3) and
-(ulong between 1 and 3) and
-(ulonglong between 1 and 3) and
-(bits between b'001' and b'011') and
-(options between 'one' and 'three') and
-(flags between 'one' and 'one,two,three') and
-(date_field between '1901-01-01' and '1903-03-03') and
-(year_field between '1901' and '1903') and
-(time_field between '01:01:01' and '03:03:03') and
-(date_time between '1901-01-01 01:01:01' and '1903-03-03 03:03:03')
-order by auto;
-auto
-1
-3
-select auto from t1 where
-("aaaa" between string and string) and
-("aaaa" between vstring and vstring) and
-(0xAAAA between bin and bin) and
-(0xAAAA between vbin and vbin) and
-(-1 between tiny and tiny) and
-(-1 between short and short) and
-(-1 between medium and medium) and
-(-1 between long_int and long_int) and
-(-1 between longlong and longlong) and
-(1 between utiny and utiny) and
-(1 between ushort and ushort) and
-(1 between umedium and umedium) and
-(1 between ulong and ulong) and
-(1 between ulonglong and ulonglong) and
-(b'001' between bits and bits) and
-('one' between options and options) and
-('one' between flags and flags) and
-('1901-01-01' between date_field and date_field) and
-('1901' between year_field and year_field) and
-('01:01:01' between time_field and time_field) and
-('1901-01-01 01:01:01' between date_time and date_time)
-order by auto;
-auto
-1
-select auto from t1 where
-(string not between "aaaa" and "cccc") and
-(vstring not between "aaaa" and "cccc") and
-(bin not between 0xAAAA and 0xCCCC) and
-(vbin not between 0xAAAA and 0xCCCC) and
-(tiny not between -3 and -1) and
-(short not between -3 and -1) and
-(medium not between -3 and -1) and
-(long_int not between -3 and -1) and
-(longlong not between -3 and -1) and
-(utiny not between 1 and 3) and
-(ushort not between 1 and 3) and
-(umedium not between 1 and 3) and
-(ulong not between 1 and 3) and
-(ulonglong not between 1 and 3) and
-(bits not between b'001' and b'011') and
-(options not between 'one' and 'three') and
-(flags not between 'one' and 'one,two,three') and
-(date_field not between '1901-01-01' and '1903-03-03') and
-(year_field not between '1901' and '1903') and
-(time_field not between '01:01:01' and '03:03:03') and
-(date_time not between '1901-01-01 01:01:01' and '1903-03-03 03:03:03')
-order by auto;
-auto
-4
-select auto from t1 where
-("aaaa" not between string and string) and
-("aaaa" not between vstring and vstring) and
-(0xAAAA not between bin and bin) and
-(0xAAAA not between vbin and vbin) and
-(-1 not between tiny and tiny) and
-(-1 not between short and short) and
-(-1 not between medium and medium) and
-(-1 not between long_int and long_int) and
-(-1 not between longlong and longlong) and
-(1 not between utiny and utiny) and
-(1 not between ushort and ushort) and
-(1 not between umedium and umedium) and
-(1 not between ulong and ulong) and
-(1 not between ulonglong and ulonglong) and
-(b'001' not between bits and bits) and
-('one' not between options and options) and
-('one' not between flags and flags) and
-('1901-01-01' not between date_field and date_field) and
-('1901' not between year_field and year_field) and
-('01:01:01' not between time_field and time_field) and
-('1901-01-01 01:01:01' not between date_time and date_time)
-order by auto;
-auto
-2
-3
-4
-select auto from t1 where
-string in("aaaa","cccc") and
-vstring in("aaaa","cccc") and
-bin in(0xAAAA,0xCCCC) and
-vbin in(0xAAAA,0xCCCC) and
-tiny in(-1,-3) and
-short in(-1,-3) and
-medium in(-1,-3) and
-long_int in(-1,-3) and
-longlong in(-1,-3) and
-utiny in(1,3) and
-ushort in(1,3) and
-umedium in(1,3) and
-ulong in(1,3) and
-ulonglong in(1,3) and
-bits in(b'001',b'011') and
-options in('one','three') and
-flags in('one','one,two,three') and
-date_field in('1901-01-01','1903-03-03') and
-year_field in('1901','1903') and
-time_field in('01:01:01','03:03:03') and
-date_time in('1901-01-01 01:01:01','1903-03-03 03:03:03')
-order by auto;
-auto
-1
-3
-select auto from t1 where
-"aaaa" in(string) and
-"aaaa" in(vstring) and
-0xAAAA in(bin) and
-0xAAAA in(vbin) and
-(-1 in(tiny)) and
-(-1 in(short)) and
-(-1 in(medium)) and
-(-1 in(long_int)) and
-(-1 in(longlong)) and
-1 in(utiny) and
-1 in(ushort) and
-1 in(umedium) and
-1 in(ulong) and
-1 in(ulonglong) and
-b'001' in(bits) and
-'one' in(options) and
-'one' in(flags) and
-'1901-01-01' in(date_field) and
-'1901' in(year_field) and
-'01:01:01' in(time_field) and
-'1901-01-01 01:01:01' in(date_time)
-order by auto;
-auto
-1
-select auto from t1 where
-string not in("aaaa","cccc") and
-vstring not in("aaaa","cccc") and
-bin not in(0xAAAA,0xCCCC) and
-vbin not in(0xAAAA,0xCCCC) and
-tiny not in(-1,-3) and
-short not in(-1,-3) and
-medium not in(-1,-3) and
-long_int not in(-1,-3) and
-longlong not in(-1,-3) and
-utiny not in(1,3) and
-ushort not in(1,3) and
-umedium not in(1,3) and
-ulong not in(1,3) and
-ulonglong not in(1,3) and
-bits not in(b'001',b'011') and
-options not in('one','three') and
-flags not in('one','one,two,three') and
-date_field not in('1901-01-01','1903-03-03') and
-year_field not in('1901','1903') and
-time_field not in('01:01:01','03:03:03') and
-date_time not in('1901-01-01 01:01:01','1903-03-03 03:03:03')
-order by auto;
-auto
-2
-4
-select auto from t1 where
-"aaaa" not in(string) and
-"aaaa" not in(vstring) and
-0xAAAA not in(bin) and
-0xAAAA not in(vbin) and
-(-1 not in(tiny)) and
-(-1 not in(short)) and
-(-1 not in(medium)) and
-(-1 not in(long_int)) and
-(-1 not in(longlong)) and
-1 not in(utiny) and
-1 not in(ushort) and
-1 not in(umedium) and
-1 not in(ulong) and
-1 not in(ulonglong) and
-b'001' not in(bits) and
-'one' not in(options) and
-'one' not in(flags) and
-'1901-01-01' not in(date_field) and
-'1901' not in(year_field) and
-'01:01:01' not in(time_field) and
-'1901-01-01 01:01:01' not in(date_time)
-order by auto;
-auto
-2
-3
-4
-select * from t2 where attr3 is null or attr1 > 2 and pk1= 3 order by pk1;
-pk1 attr1 attr2 attr3
-2 2 NULL NULL
-3 3 3 d
-select * from t2 where attr3 is not null and attr1 > 2 order by pk1;
-pk1 attr1 attr2 attr3
-3 3 3 d
-4 4 4 e
-5 5 5 f
-select * from t3 where attr2 > 9223372036854775803 and attr3 != 3 order by pk1;
-pk1 attr1 attr2 attr3 attr4
-2 2 9223372036854775804 2 c
-4 4 9223372036854775806 4 e
-5 5 9223372036854775807 5 f
-select * from t2,t3 where t2.attr1 < 1 and t2.attr2 = t3.attr2 and t3.attr1 < 5 order by t2.pk1;
-pk1 attr1 attr2 attr3 pk1 attr1 attr2 attr3 attr4
-0 0 0 a 0 0 0 0 a
-select * from t4 where attr1 < 5 and attr2 > 9223372036854775803 and attr3 != 3 order by t4.pk1;
-pk1 attr1 attr2 attr3 attr4
-2 2 9223372036854775804 2 c
-4 4 9223372036854775806 4 e
-select * from t3,t4 where t4.attr1 > 1 and t4.attr2 = t3.attr2 and t4.attr3 < 5 order by t4.pk1;
-pk1 attr1 attr2 attr3 attr4 pk1 attr1 attr2 attr3 attr4
-2 2 9223372036854775804 2 c 2 2 9223372036854775804 2 c
-3 3 9223372036854775805 3 d 3 3 9223372036854775805 3 d
-4 4 9223372036854775806 4 e 4 4 9223372036854775806 4 e
-set engine_condition_pushdown = on;
-explain
-select auto from t1 where
-string = "aaaa" and
-vstring = "aaaa" and
-bin = 0xAAAA and
-vbin = 0xAAAA and
-tiny = -1 and
-short = -1 and
-medium = -1 and
-long_int = -1 and
-longlong = -1 and
-real_float > 1.0 and real_float < 2.0 and
-real_double > 1.0 and real_double < 2.0 and
-real_decimal > 1.0 and real_decimal < 2.0 and
-utiny = 1 and
-ushort = 1 and
-umedium = 1 and
-ulong = 1 and
-ulonglong = 1 and
-/* bits = b'001' and */
-options = 'one' and
-flags = 'one' and
-date_field = '1901-01-01' and
-year_field = '1901' and
-time_field = '01:01:01' and
-date_time = '1901-01-01 01:01:01'
-order by auto;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
-select auto from t1 where
-string = "aaaa" and
-vstring = "aaaa" and
-bin = 0xAAAA and
-vbin = 0xAAAA and
-tiny = -1 and
-short = -1 and
-medium = -1 and
-long_int = -1 and
-longlong = -1 and
-real_float > 1.0 and real_float < 2.0 and
-real_double > 1.0 and real_double < 2.0 and
-real_decimal > 1.0 and real_decimal < 2.0 and
-utiny = 1 and
-ushort = 1 and
-umedium = 1 and
-ulong = 1 and
-ulonglong = 1 and
-/* bits = b'001' and */
-options = 'one' and
-flags = 'one' and
-date_field = '1901-01-01' and
-year_field = '1901' and
-time_field = '01:01:01' and
-date_time = '1901-01-01 01:01:01'
-order by auto;
-auto
-1
-explain
-select auto from t1 where
-string != "aaaa" and
-vstring != "aaaa" and
-bin != 0xAAAA and
-vbin != 0xAAAA and
-tiny != -1 and
-short != -1 and
-medium != -1 and
-long_int != -1 and
-longlong != -1 and
-(real_float < 1.0 or real_float > 2.0) and
-(real_double < 1.0 or real_double > 2.0) and
-(real_decimal < 1.0 or real_decimal > 2.0) and
-utiny != 1 and
-ushort != 1 and
-umedium != 1 and
-ulong != 1 and
-ulonglong != 1 and
-/* bits != b'001' and */
-options != 'one' and
-flags != 'one' and
-date_field != '1901-01-01' and
-year_field != '1901' and
-time_field != '01:01:01' and
-date_time != '1901-01-01 01:01:01'
-order by auto;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
-select auto from t1 where
-string != "aaaa" and
-vstring != "aaaa" and
-bin != 0xAAAA and
-vbin != 0xAAAA and
-tiny != -1 and
-short != -1 and
-medium != -1 and
-long_int != -1 and
-longlong != -1 and
-(real_float < 1.0 or real_float > 2.0) and
-(real_double < 1.0 or real_double > 2.0) and
-(real_decimal < 1.0 or real_decimal > 2.0) and
-utiny != 1 and
-ushort != 1 and
-umedium != 1 and
-ulong != 1 and
-ulonglong != 1 and
-/* bits != b'001' and */
-options != 'one' and
-flags != 'one' and
-date_field != '1901-01-01' and
-year_field != '1901' and
-time_field != '01:01:01' and
-date_time != '1901-01-01 01:01:01'
-order by auto;
-auto
-2
-3
-4
-explain
-select auto from t1 where
-string > "aaaa" and
-vstring > "aaaa" and
-bin > 0xAAAA and
-vbin > 0xAAAA and
-tiny < -1 and
-short < -1 and
-medium < -1 and
-long_int < -1 and
-longlong < -1 and
-real_float > 1.1 and
-real_double > 1.1 and
-real_decimal > 1.1 and
-utiny > 1 and
-ushort > 1 and
-umedium > 1 and
-ulong > 1 and
-ulonglong > 1 and
-/* bits > b'001' and */
-(options = 'two' or options = 'three' or options = 'four') and
-(flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
-date_field > '1901-01-01' and
-year_field > '1901' and
-time_field > '01:01:01' and
-date_time > '1901-01-01 01:01:01'
-order by auto;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
-select auto from t1 where
-string > "aaaa" and
-vstring > "aaaa" and
-bin > 0xAAAA and
-vbin > 0xAAAA and
-tiny < -1 and
-short < -1 and
-medium < -1 and
-long_int < -1 and
-longlong < -1 and
-real_float > 1.1 and
-real_double > 1.1 and
-real_decimal > 1.1 and
-utiny > 1 and
-ushort > 1 and
-umedium > 1 and
-ulong > 1 and
-ulonglong > 1 and
-/* bits > b'001' and */
-(options = 'two' or options = 'three' or options = 'four') and
-(flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
-date_field > '1901-01-01' and
-year_field > '1901' and
-time_field > '01:01:01' and
-date_time > '1901-01-01 01:01:01'
-order by auto;
-auto
-2
-3
-4
-explain
-select auto from t1 where
-string >= "aaaa" and
-vstring >= "aaaa" and
-bin >= 0xAAAA and
-vbin >= 0xAAAA and
-tiny <= -1 and
-short <= -1 and
-medium <= -1 and
-long_int <= -1 and
-longlong <= -1 and
-real_float >= 1.0 and
-real_double >= 1.0 and
-real_decimal >= 1.0 and
-utiny >= 1 and
-ushort >= 1 and
-umedium >= 1 and
-ulong >= 1 and
-ulonglong >= 1 and
-/* bits >= b'001' and */
-(options = 'one' or options = 'two' or options = 'three' or options = 'four') and
-(flags = 'one' or flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
-date_field >= '1901-01-01' and
-year_field >= '1901' and
-time_field >= '01:01:01' and
-date_time >= '1901-01-01 01:01:01'
-order by auto;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
-select auto from t1 where
-string >= "aaaa" and
-vstring >= "aaaa" and
-bin >= 0xAAAA and
-vbin >= 0xAAAA and
-tiny <= -1 and
-short <= -1 and
-medium <= -1 and
-long_int <= -1 and
-longlong <= -1 and
-real_float >= 1.0 and
-real_double >= 1.0 and
-real_decimal >= 1.0 and
-utiny >= 1 and
-ushort >= 1 and
-umedium >= 1 and
-ulong >= 1 and
-ulonglong >= 1 and
-/* bits >= b'001' and */
-(options = 'one' or options = 'two' or options = 'three' or options = 'four') and
-(flags = 'one' or flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
-date_field >= '1901-01-01' and
-year_field >= '1901' and
-time_field >= '01:01:01' and
-date_time >= '1901-01-01 01:01:01'
-order by auto;
-auto
-1
-2
-3
-4
-explain
-select auto from t1 where
-string < "dddd" and
-vstring < "dddd" and
-bin < 0xDDDD and
-vbin < 0xDDDD and
-tiny > -4 and
-short > -4 and
-medium > -4 and
-long_int > -4 and
-longlong > -4 and
-real_float < 4.4 and
-real_double < 4.4 and
-real_decimal < 4.4 and
-utiny < 4 and
-ushort < 4 and
-umedium < 4 and
-ulong < 4 and
-ulonglong < 4 and
-/* bits < b'100' and */
-(options = 'one' or options = 'two' or options = 'three') and
-(flags = 'one' or flags = 'one,two' or flags = 'one,two,three') and
-date_field < '1904-01-01' and
-year_field < '1904' and
-time_field < '04:04:04' and
-date_time < '1904-04-04 04:04:04'
-order by auto;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
-select auto from t1 where
-string < "dddd" and
-vstring < "dddd" and
-bin < 0xDDDD and
-vbin < 0xDDDD and
-tiny > -4 and
-short > -4 and
-medium > -4 and
-long_int > -4 and
-longlong > -4 and
-real_float < 4.4 and
-real_double < 4.4 and
-real_decimal < 4.4 and
-utiny < 4 and
-ushort < 4 and
-umedium < 4 and
-ulong < 4 and
-ulonglong < 4 and
-/* bits < b'100' and */
-(options = 'one' or options = 'two' or options = 'three') and
-(flags = 'one' or flags = 'one,two' or flags = 'one,two,three') and
-date_field < '1904-01-01' and
-year_field < '1904' and
-time_field < '04:04:04' and
-date_time < '1904-04-04 04:04:04'
-order by auto;
-auto
-1
-2
-3
-explain
-select auto from t1 where
-string <= "dddd" and
-vstring <= "dddd" and
-bin <= 0xDDDD and
-vbin <= 0xDDDD and
-tiny >= -4 and
-short >= -4 and
-medium >= -4 and
-long_int >= -4 and
-longlong >= -4 and
-real_float <= 4.5 and
-real_double <= 4.5 and
-real_decimal <= 4.5 and
-utiny <= 4 - 1 + 1 and /* Checking function composition */
-ushort <= 4 and
-umedium <= 4 and
-ulong <= 4 and
-ulonglong <= 4 and
-/* bits <= b'100' and */
-(options = 'one' or options = 'two' or options = 'three' or options = 'four') and
-(flags = 'one' or flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
-date_field <= '1904-04-04' and
-year_field <= '1904' and
-time_field <= '04:04:04' and
-date_time <= '1904-04-04 04:04:04'
-order by auto;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
-select auto from t1 where
-string <= "dddd" and
-vstring <= "dddd" and
-bin <= 0xDDDD and
-vbin <= 0xDDDD and
-tiny >= -4 and
-short >= -4 and
-medium >= -4 and
-long_int >= -4 and
-longlong >= -4 and
-real_float <= 4.5 and
-real_double <= 4.5 and
-real_decimal <= 4.5 and
-utiny <= 4 - 1 + 1 and /* Checking function composition */
-ushort <= 4 and
-umedium <= 4 and
-ulong <= 4 and
-ulonglong <= 4 and
-/* bits <= b'100' and */
-(options = 'one' or options = 'two' or options = 'three' or options = 'four') and
-(flags = 'one' or flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
-date_field <= '1904-04-04' and
-year_field <= '1904' and
-time_field <= '04:04:04' and
-date_time <= '1904-04-04 04:04:04'
-order by auto;
-auto
-1
-2
-3
-4
-create index medium_index on t1(medium);
-explain
-select auto from t1 where
-string = "aaaa" and
-vstring = "aaaa" and
-bin = 0xAAAA and
-vbin = 0xAAAA and
-tiny = -1 and
-short = -1 and
-medium = -1 and
-long_int = -1 and
-longlong = -1 and
-real_float > 1.0 and real_float < 2.0 and
-real_double > 1.0 and real_double < 2.0 and
-real_decimal > 1.0 and real_decimal < 2.0 and
-utiny = 1 and
-ushort = 1 and
-umedium = 1 and
-ulong = 1 and
-ulonglong = 1 and
-/* bits = b'001' and */
-options = 'one' and
-flags = 'one' and
-date_field = '1901-01-01' and
-year_field = '1901' and
-time_field = '01:01:01' and
-date_time = '1901-01-01 01:01:01'
-order by auto;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref medium_index medium_index 3 const # Using where with pushed condition; Using filesort
-select auto from t1 where
-string = "aaaa" and
-vstring = "aaaa" and
-bin = 0xAAAA and
-vbin = 0xAAAA and
-tiny = -1 and
-short = -1 and
-medium = -1 and
-long_int = -1 and
-longlong = -1 and
-real_float > 1.0 and real_float < 2.0 and
-real_double > 1.0 and real_double < 2.0 and
-real_decimal > 1.0 and real_decimal < 2.0 and
-utiny = 1 and
-ushort = 1 and
-umedium = 1 and
-ulong = 1 and
-ulonglong = 1 and
-/* bits = b'001' and */
-options = 'one' and
-flags = 'one' and
-date_field = '1901-01-01' and
-year_field = '1901' and
-time_field = '01:01:01' and
-date_time = '1901-01-01 01:01:01'
-order by auto;
-auto
-1
-explain
-select auto from t1 where
-string != "aaaa" and
-vstring != "aaaa" and
-bin != 0xAAAA and
-vbin != 0xAAAA and
-tiny != -1 and
-short != -1 and
-medium != -1 and
-long_int != -1 and
-longlong != -1 and
-(real_float < 1.0 or real_float > 2.0) and
-(real_double < 1.0 or real_double > 2.0) and
-(real_decimal < 1.0 or real_decimal > 2.0) and
-utiny != 1 and
-ushort != 1 and
-umedium != 1 and
-ulong != 1 and
-ulonglong != 1 and
-/* bits != b'001' and */
-options != 'one' and
-flags != 'one' and
-date_field != '1901-01-01' and
-year_field != '1901' and
-time_field != '01:01:01' and
-date_time != '1901-01-01 01:01:01'
-order by auto;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
-select auto from t1 where
-string != "aaaa" and
-vstring != "aaaa" and
-bin != 0xAAAA and
-vbin != 0xAAAA and
-tiny != -1 and
-short != -1 and
-medium != -1 and
-long_int != -1 and
-longlong != -1 and
-(real_float < 1.0 or real_float > 2.0) and
-(real_double < 1.0 or real_double > 2.0) and
-(real_decimal < 1.0 or real_decimal > 2.0) and
-utiny != 1 and
-ushort != 1 and
-umedium != 1 and
-ulong != 1 and
-ulonglong != 1 and
-/* bits != b'001' and */
-options != 'one' and
-flags != 'one' and
-date_field != '1901-01-01' and
-year_field != '1901' and
-time_field != '01:01:01' and
-date_time != '1901-01-01 01:01:01'
-order by auto;
-auto
-2
-3
-4
-explain
-select auto from t1 where
-string > "aaaa" and
-vstring > "aaaa" and
-bin > 0xAAAA and
-vbin > 0xAAAA and
-tiny < -1 and
-short < -1 and
-medium < -1 and
-long_int < -1 and
-longlong < -1 and
-real_float > 1.1 and
-real_double > 1.1 and
-real_decimal > 1.1 and
-utiny > 1 and
-ushort > 1 and
-umedium > 1 and
-ulong > 1 and
-ulonglong > 1 and
-/* bits > b'001' and */
-(options = 'two' or options = 'three' or options = 'four') and
-(flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
-date_field > '1901-01-01' and
-year_field > '1901' and
-time_field > '01:01:01' and
-date_time > '1901-01-01 01:01:01'
-order by auto;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
-select auto from t1 where
-string > "aaaa" and
-vstring > "aaaa" and
-bin > 0xAAAA and
-vbin > 0xAAAA and
-tiny < -1 and
-short < -1 and
-medium < -1 and
-long_int < -1 and
-longlong < -1 and
-real_float > 1.1 and
-real_double > 1.1 and
-real_decimal > 1.1 and
-utiny > 1 and
-ushort > 1 and
-umedium > 1 and
-ulong > 1 and
-ulonglong > 1 and
-/* bits > b'001' and */
-(options = 'two' or options = 'three' or options = 'four') and
-(flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
-date_field > '1901-01-01' and
-year_field > '1901' and
-time_field > '01:01:01' and
-date_time > '1901-01-01 01:01:01'
-order by auto;
-auto
-2
-3
-4
-explain
-select auto from t1 where
-string >= "aaaa" and
-vstring >= "aaaa" and
-bin >= 0xAAAA and
-vbin >= 0xAAAA and
-tiny <= -1 and
-short <= -1 and
-medium <= -1 and
-long_int <= -1 and
-longlong <= -1 and
-real_float >= 1.0 and
-real_double >= 1.0 and
-real_decimal >= 1.0 and
-utiny >= 1 and
-ushort >= 1 and
-umedium >= 1 and
-ulong >= 1 and
-ulonglong >= 1 and
-/* bits >= b'001' and */
-(options = 'one' or options = 'two' or options = 'three' or options = 'four') and
-(flags = 'one' or flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
-date_field >= '1901-01-01' and
-year_field >= '1901' and
-time_field >= '01:01:01' and
-date_time >= '1901-01-01 01:01:01'
-order by auto;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
-select auto from t1 where
-string >= "aaaa" and
-vstring >= "aaaa" and
-bin >= 0xAAAA and
-vbin >= 0xAAAA and
-tiny <= -1 and
-short <= -1 and
-medium <= -1 and
-long_int <= -1 and
-longlong <= -1 and
-real_float >= 1.0 and
-real_double >= 1.0 and
-real_decimal >= 1.0 and
-utiny >= 1 and
-ushort >= 1 and
-umedium >= 1 and
-ulong >= 1 and
-ulonglong >= 1 and
-/* bits >= b'001' and */
-(options = 'one' or options = 'two' or options = 'three' or options = 'four') and
-(flags = 'one' or flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
-date_field >= '1901-01-01' and
-year_field >= '1901' and
-time_field >= '01:01:01' and
-date_time >= '1901-01-01 01:01:01'
-order by auto;
-auto
-1
-2
-3
-4
-explain
-select auto from t1 where
-string < "dddd" and
-vstring < "dddd" and
-bin < 0xDDDD and
-vbin < 0xDDDD and
-tiny > -4 and
-short > -4 and
-medium > -4 and
-long_int > -4 and
-longlong > -4 and
-real_float < 4.4 and
-real_double < 4.4 and
-real_decimal < 4.4 and
-utiny < 4 and
-ushort < 4 and
-umedium < 4 and
-ulong < 4 and
-ulonglong < 4 and
-/* bits < b'100' and */
-(options = 'one' or options = 'two' or options = 'three') and
-(flags = 'one' or flags = 'one,two' or flags = 'one,two,three') and
-date_field < '1904-01-01' and
-year_field < '1904' and
-time_field < '04:04:04' and
-date_time < '1904-04-04 04:04:04'
-order by auto;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
-select auto from t1 where
-string < "dddd" and
-vstring < "dddd" and
-bin < 0xDDDD and
-vbin < 0xDDDD and
-tiny > -4 and
-short > -4 and
-medium > -4 and
-long_int > -4 and
-longlong > -4 and
-real_float < 4.4 and
-real_double < 4.4 and
-real_decimal < 4.4 and
-utiny < 4 and
-ushort < 4 and
-umedium < 4 and
-ulong < 4 and
-ulonglong < 4 and
-/* bits < b'100' and */
-(options = 'one' or options = 'two' or options = 'three') and
-(flags = 'one' or flags = 'one,two' or flags = 'one,two,three') and
-date_field < '1904-01-01' and
-year_field < '1904' and
-time_field < '04:04:04' and
-date_time < '1904-04-04 04:04:04'
-order by auto;
-auto
-1
-2
-3
-explain
-select auto from t1 where
-string <= "dddd" and
-vstring <= "dddd" and
-bin <= 0xDDDD and
-vbin <= 0xDDDD and
-tiny >= -4 and
-short >= -4 and
-medium >= -4 and
-long_int >= -4 and
-longlong >= -4 and
-real_float <= 4.5 and
-real_double <= 4.5 and
-real_decimal <= 4.5 and
-utiny <= 4 - 1 + 1 and /* Checking function composition */
-ushort <= 4 and
-umedium <= 4 and
-ulong <= 4 and
-ulonglong <= 4 and
-/* bits <= b'100' and */
-(options = 'one' or options = 'two' or options = 'three' or options = 'four') and
-(flags = 'one' or flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
-date_field <= '1904-04-04' and
-year_field <= '1904' and
-time_field <= '04:04:04' and
-date_time <= '1904-04-04 04:04:04'
-order by auto;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
-select auto from t1 where
-string <= "dddd" and
-vstring <= "dddd" and
-bin <= 0xDDDD and
-vbin <= 0xDDDD and
-tiny >= -4 and
-short >= -4 and
-medium >= -4 and
-long_int >= -4 and
-longlong >= -4 and
-real_float <= 4.5 and
-real_double <= 4.5 and
-real_decimal <= 4.5 and
-utiny <= 4 - 1 + 1 and /* Checking function composition */
-ushort <= 4 and
-umedium <= 4 and
-ulong <= 4 and
-ulonglong <= 4 and
-/* bits <= b'100' and */
-(options = 'one' or options = 'two' or options = 'three' or options = 'four') and
-(flags = 'one' or flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
-date_field <= '1904-04-04' and
-year_field <= '1904' and
-time_field <= '04:04:04' and
-date_time <= '1904-04-04 04:04:04'
-order by auto;
-auto
-1
-2
-3
-4
-explain
-select auto from t1 where
-string like "b%" and
-vstring like "b%" and
-bin like concat(0xBB, '%') and
-vbin like concat(0xBB, '%')
-order by auto;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
-select auto from t1 where
-string like "b%" and
-vstring like "b%" and
-bin like concat(0xBB, '%') and
-vbin like concat(0xBB, '%')
-order by auto;
-auto
-2
-explain
-select auto from t1 where
-string not like "b%" and
-vstring not like "b%" and
-bin not like concat(0xBB, '%') and
-vbin not like concat(0xBB, '%')
-order by auto;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
-select auto from t1 where
-string not like "b%" and
-vstring not like "b%" and
-bin not like concat(0xBB, '%') and
-vbin not like concat(0xBB, '%')
-order by auto;
-auto
-1
-3
-4
-explain
-select auto from t1 where
-(string between "aaaa" and "cccc") and
-(vstring between "aaaa" and "cccc") and
-(bin between 0xAAAA and 0xCCCC) and
-(vbin between 0xAAAA and 0xCCCC) and
-(tiny between -3 and -1) and
-(short between -3 and -1) and
-(medium between -3 and -1) and
-(long_int between -3 and -1) and
-(longlong between -3 and -1) and
-(utiny between 1 and 3) and
-(ushort between 1 and 3) and
-(umedium between 1 and 3) and
-(ulong between 1 and 3) and
-(ulonglong between 1 and 3) and
-/* (bits between b'001' and b'011') and */
-(options between 'one' and 'three') and
-(flags between 'one' and 'one,two,three') and
-(date_field between '1901-01-01' and '1903-03-03') and
-(year_field between '1901' and '1903') and
-(time_field between '01:01:01' and '03:03:03') and
-(date_time between '1901-01-01 01:01:01' and '1903-03-03 03:03:03')
-order by auto;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
-select auto from t1 where
-(string between "aaaa" and "cccc") and
-(vstring between "aaaa" and "cccc") and
-(bin between 0xAAAA and 0xCCCC) and
-(vbin between 0xAAAA and 0xCCCC) and
-(tiny between -3 and -1) and
-(short between -3 and -1) and
-(medium between -3 and -1) and
-(long_int between -3 and -1) and
-(longlong between -3 and -1) and
-(utiny between 1 and 3) and
-(ushort between 1 and 3) and
-(umedium between 1 and 3) and
-(ulong between 1 and 3) and
-(ulonglong between 1 and 3) and
-/* (bits between b'001' and b'011') and */
-(options between 'one' and 'three') and
-(flags between 'one' and 'one,two,three') and
-(date_field between '1901-01-01' and '1903-03-03') and
-(year_field between '1901' and '1903') and
-(time_field between '01:01:01' and '03:03:03') and
-(date_time between '1901-01-01 01:01:01' and '1903-03-03 03:03:03')
-order by auto;
-auto
-1
-3
-explain
-select auto from t1 where
-("aaaa" between string and string) and
-("aaaa" between vstring and vstring) and
-(0xAAAA between bin and bin) and
-(0xAAAA between vbin and vbin) and
-(-1 between tiny and tiny) and
-(-1 between short and short) and
-(-1 between medium and medium) and
-(-1 between long_int and long_int) and
-(-1 between longlong and longlong) and
-(1 between utiny and utiny) and
-(1 between ushort and ushort) and
-(1 between umedium and umedium) and
-(1 between ulong and ulong) and
-(1 between ulonglong and ulonglong) and
-/* (b'001' between bits and bits) and */
-('one' between options and options) and
-('one' between flags and flags) and
-('1901-01-01' between date_field and date_field) and
-('1901' between year_field and year_field) and
-('01:01:01' between time_field and time_field) and
-('1901-01-01 01:01:01' between date_time and date_time)
-order by auto;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
-select auto from t1 where
-("aaaa" between string and string) and
-("aaaa" between vstring and vstring) and
-(0xAAAA between bin and bin) and
-(0xAAAA between vbin and vbin) and
-(-1 between tiny and tiny) and
-(-1 between short and short) and
-(-1 between medium and medium) and
-(-1 between long_int and long_int) and
-(-1 between longlong and longlong) and
-(1 between utiny and utiny) and
-(1 between ushort and ushort) and
-(1 between umedium and umedium) and
-(1 between ulong and ulong) and
-(1 between ulonglong and ulonglong) and
-/* (b'001' between bits and bits) and */
-('one' between options and options) and
-('one' between flags and flags) and
-('1901-01-01' between date_field and date_field) and
-('1901' between year_field and year_field) and
-('01:01:01' between time_field and time_field) and
-('1901-01-01 01:01:01' between date_time and date_time)
-order by auto;
-auto
-1
-explain
-select auto from t1 where
-(string not between "aaaa" and "cccc") and
-(vstring not between "aaaa" and "cccc") and
-(bin not between 0xAAAA and 0xCCCC) and
-(vbin not between 0xAAAA and 0xCCCC) and
-(tiny not between -3 and -1) and
-(short not between -3 and -1) and
-(medium not between -3 and -1) and
-(long_int not between -3 and -1) and
-(longlong not between -3 and -1) and
-(utiny not between 1 and 3) and
-(ushort not between 1 and 3) and
-(umedium not between 1 and 3) and
-(ulong not between 1 and 3) and
-(ulonglong not between 1 and 3) and
-/* (bits not between b'001' and b'011') and */
-(options not between 'one' and 'three') and
-(flags not between 'one' and 'one,two,three') and
-(date_field not between '1901-01-01' and '1903-03-03') and
-(year_field not between '1901' and '1903') and
-(time_field not between '01:01:01' and '03:03:03') and
-(date_time not between '1901-01-01 01:01:01' and '1903-03-03 03:03:03')
-order by auto;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
-select auto from t1 where
-(string not between "aaaa" and "cccc") and
-(vstring not between "aaaa" and "cccc") and
-(bin not between 0xAAAA and 0xCCCC) and
-(vbin not between 0xAAAA and 0xCCCC) and
-(tiny not between -3 and -1) and
-(short not between -3 and -1) and
-(medium not between -3 and -1) and
-(long_int not between -3 and -1) and
-(longlong not between -3 and -1) and
-(utiny not between 1 and 3) and
-(ushort not between 1 and 3) and
-(umedium not between 1 and 3) and
-(ulong not between 1 and 3) and
-(ulonglong not between 1 and 3) and
-/* (bits not between b'001' and b'011') and */
-(options not between 'one' and 'three') and
-(flags not between 'one' and 'one,two,three') and
-(date_field not between '1901-01-01' and '1903-03-03') and
-(year_field not between '1901' and '1903') and
-(time_field not between '01:01:01' and '03:03:03') and
-(date_time not between '1901-01-01 01:01:01' and '1903-03-03 03:03:03')
-order by auto;
-auto
-4
-explain
-select auto from t1 where
-("aaaa" not between string and string) and
-("aaaa" not between vstring and vstring) and
-(0xAAAA not between bin and bin) and
-(0xAAAA not between vbin and vbin) and
-(-1 not between tiny and tiny) and
-(-1 not between short and short) and
-(-1 not between medium and medium) and
-(-1 not between long_int and long_int) and
-(-1 not between longlong and longlong) and
-(1 not between utiny and utiny) and
-(1 not between ushort and ushort) and
-(1 not between umedium and umedium) and
-(1 not between ulong and ulong) and
-(1 not between ulonglong and ulonglong) and
-/* (b'001' not between bits and bits) and */
-('one' not between options and options) and
-('one' not between flags and flags) and
-('1901-01-01' not between date_field and date_field) and
-('1901' not between year_field and year_field) and
-('01:01:01' not between time_field and time_field) and
-('1901-01-01 01:01:01' not between date_time and date_time)
-order by auto;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
-select auto from t1 where
-("aaaa" not between string and string) and
-("aaaa" not between vstring and vstring) and
-(0xAAAA not between bin and bin) and
-(0xAAAA not between vbin and vbin) and
-(-1 not between tiny and tiny) and
-(-1 not between short and short) and
-(-1 not between medium and medium) and
-(-1 not between long_int and long_int) and
-(-1 not between longlong and longlong) and
-(1 not between utiny and utiny) and
-(1 not between ushort and ushort) and
-(1 not between umedium and umedium) and
-(1 not between ulong and ulong) and
-(1 not between ulonglong and ulonglong) and
-/* (b'001' not between bits and bits) and */
-('one' not between options and options) and
-('one' not between flags and flags) and
-('1901-01-01' not between date_field and date_field) and
-('1901' not between year_field and year_field) and
-('01:01:01' not between time_field and time_field) and
-('1901-01-01 01:01:01' not between date_time and date_time)
-order by auto;
-auto
-2
-3
-4
-explain
-select auto from t1 where
-string in("aaaa","cccc") and
-vstring in("aaaa","cccc") and
-bin in(0xAAAA,0xCCCC) and
-vbin in(0xAAAA,0xCCCC) and
-tiny in(-1,-3) and
-short in(-1,-3) and
-medium in(-1,-3) and
-long_int in(-1,-3) and
-longlong in(-1,-3) and
-utiny in(1,3) and
-ushort in(1,3) and
-umedium in(1,3) and
-ulong in(1,3) and
-ulonglong in(1,3) and
-/* bits in(b'001',b'011') and */
-options in('one','three') and
-flags in('one','one,two,three') and
-date_field in('1901-01-01','1903-03-03') and
-year_field in('1901','1903') and
-time_field in('01:01:01','03:03:03') and
-date_time in('1901-01-01 01:01:01','1903-03-03 03:03:03')
-order by auto;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
-select auto from t1 where
-string in("aaaa","cccc") and
-vstring in("aaaa","cccc") and
-bin in(0xAAAA,0xCCCC) and
-vbin in(0xAAAA,0xCCCC) and
-tiny in(-1,-3) and
-short in(-1,-3) and
-medium in(-1,-3) and
-long_int in(-1,-3) and
-longlong in(-1,-3) and
-utiny in(1,3) and
-ushort in(1,3) and
-umedium in(1,3) and
-ulong in(1,3) and
-ulonglong in(1,3) and
-/* bits in(b'001',b'011') and */
-options in('one','three') and
-flags in('one','one,two,three') and
-date_field in('1901-01-01','1903-03-03') and
-year_field in('1901','1903') and
-time_field in('01:01:01','03:03:03') and
-date_time in('1901-01-01 01:01:01','1903-03-03 03:03:03')
-order by auto;
-auto
-1
-3
-explain
-select auto from t1 where
-"aaaa" in(string) and
-"aaaa" in(vstring) and
-0xAAAA in(bin) and
-0xAAAA in(vbin) and
-(-1 in(tiny)) and
-(-1 in (short)) and
-(-1 in(medium)) and
-(-1 in(long_int)) and
-(-1 in(longlong)) and
-1 in(utiny) and
-1 in(ushort) and
-1 in(umedium) and
-1 in(ulong) and
-1 in(ulonglong) and
-/* b'001' in(bits) and */
-'one' in(options) and
-'one' in(flags) and
-'1901-01-01' in(date_field) and
-'1901' in(year_field) and
-'01:01:01' in(time_field) and
-'1901-01-01 01:01:01' in(date_time)
-order by auto;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref medium_index medium_index 3 const # Using where with pushed condition; Using filesort
-select auto from t1 where
-"aaaa" in(string) and
-"aaaa" in(vstring) and
-0xAAAA in(bin) and
-0xAAAA in(vbin) and
-(-1 in(tiny)) and
-(-1 in (short)) and
-(-1 in(medium)) and
-(-1 in(long_int)) and
-(-1 in(longlong)) and
-1 in(utiny) and
-1 in(ushort) and
-1 in(umedium) and
-1 in(ulong) and
-1 in(ulonglong) and
-/* b'001' in(bits) and */
-'one' in(options) and
-'one' in(flags) and
-'1901-01-01' in(date_field) and
-'1901' in(year_field) and
-'01:01:01' in(time_field) and
-'1901-01-01 01:01:01' in(date_time)
-order by auto;
-auto
-1
-explain
-select auto from t1 where
-string not in("aaaa","cccc") and
-vstring not in("aaaa","cccc") and
-bin not in(0xAAAA,0xCCCC) and
-vbin not in(0xAAAA,0xCCCC) and
-tiny not in(-1,-3) and
-short not in(-1,-3) and
-medium not in(-1,-3) and
-long_int not in(-1,-3) and
-longlong not in(-1,-3) and
-utiny not in(1,3) and
-ushort not in(1,3) and
-umedium not in(1,3) and
-ulong not in(1,3) and
-ulonglong not in(1,3) and
-/* bits not in(b'001',b'011') and */
-options not in('one','three') and
-flags not in('one','one,two,three') and
-date_field not in('1901-01-01','1903-03-03') and
-year_field not in('1901','1903') and
-time_field not in('01:01:01','03:03:03') and
-date_time not in('1901-01-01 01:01:01','1903-03-03 03:03:03')
-order by auto;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
-select auto from t1 where
-string not in("aaaa","cccc") and
-vstring not in("aaaa","cccc") and
-bin not in(0xAAAA,0xCCCC) and
-vbin not in(0xAAAA,0xCCCC) and
-tiny not in(-1,-3) and
-short not in(-1,-3) and
-medium not in(-1,-3) and
-long_int not in(-1,-3) and
-longlong not in(-1,-3) and
-utiny not in(1,3) and
-ushort not in(1,3) and
-umedium not in(1,3) and
-ulong not in(1,3) and
-ulonglong not in(1,3) and
-/* bits not in(b'001',b'011') and */
-options not in('one','three') and
-flags not in('one','one,two,three') and
-date_field not in('1901-01-01','1903-03-03') and
-year_field not in('1901','1903') and
-time_field not in('01:01:01','03:03:03') and
-date_time not in('1901-01-01 01:01:01','1903-03-03 03:03:03')
-order by auto;
-auto
-2
-4
-explain
-select auto from t1 where
-"aaaa" not in(string) and
-"aaaa" not in(vstring) and
-0xAAAA not in(bin) and
-0xAAAA not in(vbin) and
-(-1 not in(tiny)) and
-(-1 not in(short)) and
-(-1 not in(medium)) and
-(-1 not in(long_int)) and
-(-1 not in(longlong)) and
-1 not in(utiny) and
-1 not in(ushort) and
-1 not in(umedium) and
-1 not in(ulong) and
-1 not in(ulonglong) and
-/* b'001' not in(bits) and */
-'one' not in(options) and
-'one' not in(flags) and
-'1901-01-01' not in(date_field) and
-'1901' not in(year_field) and
-'01:01:01' not in(time_field) and
-'1901-01-01 01:01:01' not in(date_time)
-order by auto;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
-select auto from t1 where
-"aaaa" not in(string) and
-"aaaa" not in(vstring) and
-0xAAAA not in(bin) and
-0xAAAA not in(vbin) and
-(-1 not in(tiny)) and
-(-1 not in(short)) and
-(-1 not in(medium)) and
-(-1 not in(long_int)) and
-(-1 not in(longlong)) and
-1 not in(utiny) and
-1 not in(ushort) and
-1 not in(umedium) and
-1 not in(ulong) and
-1 not in(ulonglong) and
-/* b'001' not in(bits) and */
-'one' not in(options) and
-'one' not in(flags) and
-'1901-01-01' not in(date_field) and
-'1901' not in(year_field) and
-'01:01:01' not in(time_field) and
-'1901-01-01 01:01:01' not in(date_time)
-order by auto;
-auto
-2
-3
-4
-update t1
-set medium = 17
-where
-string = "aaaa" and
-vstring = "aaaa" and
-bin = 0xAAAA and
-vbin = 0xAAAA and
-tiny = -1 and
-short = -1 and
-medium = -1 and
-long_int = -1 and
-longlong = -1 and
-real_float > 1.0 and real_float < 2.0 and
-real_double > 1.0 and real_double < 2.0 and
-real_decimal > 1.0 and real_decimal < 2.0 and
-utiny = 1 and
-ushort = 1 and
-umedium = 1 and
-ulong = 1 and
-ulonglong = 1 and
-/* bits = b'001' and */
-options = 'one' and
-flags = 'one' and
-date_field = '1901-01-01' and
-year_field = '1901' and
-time_field = '01:01:01' and
-date_time = '1901-01-01 01:01:01';
-delete from t1
-where
-string = "aaaa" and
-vstring = "aaaa" and
-bin = 0xAAAA and
-vbin = 0xAAAA and
-tiny = -1 and
-short = -1 and
-medium = 17 and
-long_int = -1 and
-longlong = -1 and
-real_float > 1.0 and real_float < 2.0 and
-real_double > 1.0 and real_double < 2.0 and
-real_decimal > 1.0 and real_decimal < 2.0 and
-utiny = 1 and
-ushort = 1 and
-umedium = 1 and
-ulong = 1 and
-ulonglong = 1 and
-/* bits = b'001' and */
-options = 'one' and
-flags = 'one' and
-date_field = '1901-01-01' and
-year_field = '1901' and
-time_field = '01:01:01' and
-date_time = '1901-01-01 01:01:01';
-select count(*) from t1;
-count(*)
-3
-explain
-select * from t2 where attr3 is null or attr1 > 2 and pk1= 3 order by pk1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL PRIMARY NULL NULL NULL # Using where with pushed condition; Using filesort
-select * from t2 where attr3 is null or attr1 > 2 and pk1= 3 order by pk1;
-pk1 attr1 attr2 attr3
-2 2 NULL NULL
-3 3 3 d
-explain
-select * from t2 where attr3 is not null and attr1 > 2 order by pk1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
-select * from t2 where attr3 is not null and attr1 > 2 order by pk1;
-pk1 attr1 attr2 attr3
-3 3 3 d
-4 4 4 e
-5 5 5 f
-explain
-select * from t3 where attr2 > 9223372036854775803 and attr3 != 3 order by pk1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t3 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
-select * from t3 where attr2 > 9223372036854775803 and attr3 != 3 order by pk1;
-pk1 attr1 attr2 attr3 attr4
-2 2 9223372036854775804 2 c
-4 4 9223372036854775806 4 e
-5 5 9223372036854775807 5 f
-explain
-select * from t2,t3 where t2.attr1 < 1 and t2.attr2 = t3.attr2 and t3.attr1 < 5 order by t2.pk1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL # Using where with pushed condition; Using temporary; Using filesort; Using join cache
-1 SIMPLE t3 ALL NULL NULL NULL NULL # Using where with pushed condition
-select * from t2,t3 where t2.attr1 < 1 and t2.attr2 = t3.attr2 and t3.attr1 < 5 order by t2.pk1;
-pk1 attr1 attr2 attr3 pk1 attr1 attr2 attr3 attr4
-0 0 0 a 0 0 0 0 a
-explain
-select * from t4 where attr1 < 5 and attr2 > 9223372036854775803 and attr3 != 3 order by t4.pk1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 range attr1 attr1 4 NULL # Using where with pushed condition; Using filesort
-select * from t4 where attr1 < 5 and attr2 > 9223372036854775803 and attr3 != 3 order by t4.pk1;
-pk1 attr1 attr2 attr3 attr4
-2 2 9223372036854775804 2 c
-4 4 9223372036854775806 4 e
-explain
-select * from t3,t4 where t4.attr1 > 1 and t4.attr2 = t3.attr2 and t4.attr3 < 5 order by t4.pk1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 range attr1 attr1 4 NULL # Using where with pushed condition; Using temporary; Using filesort; Using join cache
-1 SIMPLE t3 ALL NULL NULL NULL NULL # Using where
-select * from t3,t4 where t4.attr1 > 1 and t4.attr2 = t3.attr2 and t4.attr3 < 5 order by t4.pk1;
-pk1 attr1 attr2 attr3 attr4 pk1 attr1 attr2 attr3 attr4
-2 2 9223372036854775804 2 c 2 2 9223372036854775804 2 c
-3 3 9223372036854775805 3 d 3 3 9223372036854775805 3 d
-4 4 9223372036854775806 4 e 4 4 9223372036854775806 4 e
-explain
-select auto from t1 where string = "aaaa" collate latin1_general_ci order by auto;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where; Using filesort
-explain
-select * from t2 where (attr1 < 2) = (attr2 < 2) order by pk1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL # Using where; Using filesort
-explain
-select * from t3 left join t4 on t4.attr2 = t3.attr2 where t4.attr1 > 1 and t4.attr3 < 5 or t4.attr1 is null order by t4.pk1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t3 ALL NULL NULL NULL NULL # Using temporary; Using filesort
-1 SIMPLE t4 ALL NULL NULL NULL NULL # Using where
-create table t5 (a int primary key auto_increment, b tinytext not null)
-engine = ndb;
-insert into t5 (b) values ('jonas'), ('jensing'), ('johan');
-set engine_condition_pushdown = off;
-select * from t5 where b like '%jo%' order by a;
-a b
-1 jonas
-3 johan
-set engine_condition_pushdown = on;
-explain select * from t5 where b like '%jo%';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t5 ALL NULL NULL NULL NULL # Using where
-select * from t5 where b like '%jo%' order by a;
-a b
-1 jonas
-3 johan
-set engine_condition_pushdown = off;
-select auto from t1 where date_time like '1902-02-02 %' order by auto;
-auto
-2
-select auto from t1 where date_time not like '1902-02-02 %' order by auto;
-auto
-3
-4
-set engine_condition_pushdown = on;
-explain select auto from t1 where date_time like '1902-02-02 %';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where
-select auto from t1 where date_time like '1902-02-02 %' order by auto;
-auto
-2
-explain select auto from t1 where date_time not like '1902-02-02 %';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where
-select auto from t1 where date_time not like '1902-02-02 %' order by auto;
-auto
-3
-4
-drop table t1;
-create table t1 (a int, b varchar(3), primary key using hash(a))
-engine=ndb;
-insert into t1 values (1,'a'), (2,'ab'), (3,'abc');
-set engine_condition_pushdown = off;
-select * from t1 where b like 'ab';
-a b
-2 ab
-select * from t1 where b like 'ab' or b like 'ab';
-a b
-2 ab
-select * from t1 where b like 'abc';
-a b
-3 abc
-select * from t1 where b like 'abc' or b like 'abc';
-a b
-3 abc
-set engine_condition_pushdown = on;
-select * from t1 where b like 'ab';
-a b
-2 ab
-select * from t1 where b like 'ab' or b like 'ab';
-a b
-2 ab
-select * from t1 where b like 'abc';
-a b
-3 abc
-select * from t1 where b like 'abc' or b like 'abc';
-a b
-3 abc
-drop table t1;
-create table t1 (a int, b char(3), primary key using hash(a))
-engine=ndb;
-insert into t1 values (1,'a'), (2,'ab'), (3,'abc');
-set engine_condition_pushdown = off;
-select * from t1 where b like 'ab';
-a b
-2 ab
-select * from t1 where b like 'ab' or b like 'ab';
-a b
-2 ab
-select * from t1 where b like 'abc';
-a b
-3 abc
-select * from t1 where b like 'abc' or b like 'abc';
-a b
-3 abc
-set engine_condition_pushdown = on;
-select * from t1 where b like 'ab';
-a b
-2 ab
-select * from t1 where b like 'ab' or b like 'ab';
-a b
-2 ab
-select * from t1 where b like 'abc';
-a b
-3 abc
-select * from t1 where b like 'abc' or b like 'abc';
-a b
-3 abc
-drop table t1;
-create table t1 ( fname varchar(255), lname varchar(255) )
-engine=ndbcluster;
-insert into t1 values ("Young","Foo");
-set engine_condition_pushdown = 0;
-SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
-fname lname
-Young Foo
-set engine_condition_pushdown = 1;
-SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
-fname lname
-Young Foo
-insert into t1 values ("aaa", "aaa");
-insert into t1 values ("bbb", "bbb");
-insert into t1 values ("ccc", "ccc");
-insert into t1 values ("ddd", "ddd");
-set engine_condition_pushdown = 0;
-SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
-fname lname
-Young Foo
-set engine_condition_pushdown = 1;
-SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
-fname lname
-Young Foo
-set engine_condition_pushdown = @old_ecpd;
-DROP TABLE t1,t2,t3,t4,t5;
diff --git a/mysql-test/r/ndb_dd_alter.result b/mysql-test/r/ndb_dd_alter.result
deleted file mode 100644
index e4bd96ab384..00000000000
--- a/mysql-test/r/ndb_dd_alter.result
+++ /dev/null
@@ -1,560 +0,0 @@
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t2;
-**** Test Setup Section ****
-CREATE LOGFILE GROUP lg
-ADD UNDOFILE './lg_group/undofile.dat'
- INITIAL_SIZE 16M
-UNDO_BUFFER_SIZE = 1M
-ENGINE=NDB;
-CREATE TABLESPACE ts
-ADD DATAFILE './table_space/datafile.dat'
- USE LOGFILE GROUP lg
-INITIAL_SIZE 12M
-ENGINE NDB;
-CREATE TABLE test.t1 (
-a1 smallint NOT NULL,
-a2 int NOT NULL,
-a3 bigint NOT NULL,
-a4 char(10),
-a5 decimal(5,1),
-a6 time,
-a7 date,
-a8 datetime,
-a9 VARCHAR(255),
-a10 blob,
-PRIMARY KEY(a1)
-) ENGINE=InnoDB;
-SHOW CREATE TABLE test.t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a1` smallint(6) NOT NULL,
- `a2` int(11) NOT NULL,
- `a3` bigint(20) NOT NULL,
- `a4` char(10) DEFAULT NULL,
- `a5` decimal(5,1) DEFAULT NULL,
- `a6` time DEFAULT NULL,
- `a7` date DEFAULT NULL,
- `a8` datetime DEFAULT NULL,
- `a9` varchar(255) DEFAULT NULL,
- `a10` blob,
- PRIMARY KEY (`a1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-SELECT * FROM test.t1 ORDER BY a1;
-a1 a2 a3 a4 a5 a6 a7 a8 a9 a10
-1 2 2000000001 aaa1 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb1 binary data
-2 3 2000000002 aaa2 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb2 binary data
-3 4 2000000003 aaa3 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb3 binary data
-4 5 2000000004 aaa4 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb4 binary data
-5 6 2000000005 aaa5 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb5 binary data
-6 7 2000000006 aaa6 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb6 binary data
-7 8 2000000007 aaa7 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb7 binary data
-8 9 2000000008 aaa8 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb8 binary data
-9 10 2000000009 aaa9 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb9 binary data
-10 11 2000000010 aaa10 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb10 binary data
-11 12 2000000011 aaa11 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb11 binary data
-12 13 2000000012 aaa12 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb12 binary data
-13 14 2000000013 aaa13 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb13 binary data
-14 15 2000000014 aaa14 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb14 binary data
-15 16 2000000015 aaa15 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb15 binary data
-16 17 2000000016 aaa16 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb16 binary data
-17 18 2000000017 aaa17 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb17 binary data
-18 19 2000000018 aaa18 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb18 binary data
-19 20 2000000019 aaa19 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb19 binary data
-20 21 2000000020 aaa20 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb20 binary data
-ALTER TABLE test.t1 TABLESPACE ts STORAGE DISK ENGINE=NDB;
-SHOW CREATE TABLE test.t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a1` smallint(6) NOT NULL,
- `a2` int(11) NOT NULL,
- `a3` bigint(20) NOT NULL,
- `a4` char(10) DEFAULT NULL,
- `a5` decimal(5,1) DEFAULT NULL,
- `a6` time DEFAULT NULL,
- `a7` date DEFAULT NULL,
- `a8` datetime DEFAULT NULL,
- `a9` varchar(255) DEFAULT NULL,
- `a10` blob,
- PRIMARY KEY (`a1`)
-) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
-a1 Smallint PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
-a2 Int NOT NULL AT=FIXED ST=DISK
-a3 Bigint NOT NULL AT=FIXED ST=DISK
-a4 Char(10;latin1_swedish_ci) NULL AT=FIXED ST=DISK
-a5 Decimal(5,1) NULL AT=FIXED ST=DISK
-a6 Time NULL AT=FIXED ST=DISK
-a7 Date NULL AT=FIXED ST=DISK
-a8 Datetime NULL AT=FIXED ST=DISK
-a9 Varchar(255;latin1_swedish_ci) NULL AT=FIXED ST=DISK
-a10 Blob(256,2000;16) NULL AT=FIXED ST=MEMORY
-SELECT * FROM test.t1 ORDER BY a1;
-a1 a2 a3 a4 a5 a6 a7 a8 a9 a10
-1 2 2000000001 aaa1 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb1 binary data
-2 3 2000000002 aaa2 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb2 binary data
-3 4 2000000003 aaa3 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb3 binary data
-4 5 2000000004 aaa4 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb4 binary data
-5 6 2000000005 aaa5 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb5 binary data
-6 7 2000000006 aaa6 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb6 binary data
-7 8 2000000007 aaa7 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb7 binary data
-8 9 2000000008 aaa8 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb8 binary data
-9 10 2000000009 aaa9 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb9 binary data
-10 11 2000000010 aaa10 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb10 binary data
-11 12 2000000011 aaa11 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb11 binary data
-12 13 2000000012 aaa12 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb12 binary data
-13 14 2000000013 aaa13 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb13 binary data
-14 15 2000000014 aaa14 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb14 binary data
-15 16 2000000015 aaa15 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb15 binary data
-16 17 2000000016 aaa16 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb16 binary data
-17 18 2000000017 aaa17 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb17 binary data
-18 19 2000000018 aaa18 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb18 binary data
-19 20 2000000019 aaa19 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb19 binary data
-20 21 2000000020 aaa20 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb20 binary data
-DROP TABLE test.t1;
-CREATE TABLE test.t1 (
-a1 smallint NOT NULL,
-a2 int NOT NULL,
-a3 bigint NOT NULL,
-a4 char(10),
-a5 decimal(5,1),
-a6 time,
-a7 date,
-a8 datetime,
-a9 VARCHAR(255),
-a10 blob,
-PRIMARY KEY(a1)
-) ENGINE=MyISAM;
-SHOW CREATE TABLE test.t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a1` smallint(6) NOT NULL,
- `a2` int(11) NOT NULL,
- `a3` bigint(20) NOT NULL,
- `a4` char(10) DEFAULT NULL,
- `a5` decimal(5,1) DEFAULT NULL,
- `a6` time DEFAULT NULL,
- `a7` date DEFAULT NULL,
- `a8` datetime DEFAULT NULL,
- `a9` varchar(255) DEFAULT NULL,
- `a10` blob,
- PRIMARY KEY (`a1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT * FROM test.t1 ORDER BY a1;
-a1 a2 a3 a4 a5 a6 a7 a8 a9 a10
-1 2 2000000001 aaa1 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb1 binary data
-2 3 2000000002 aaa2 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb2 binary data
-3 4 2000000003 aaa3 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb3 binary data
-4 5 2000000004 aaa4 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb4 binary data
-5 6 2000000005 aaa5 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb5 binary data
-6 7 2000000006 aaa6 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb6 binary data
-7 8 2000000007 aaa7 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb7 binary data
-8 9 2000000008 aaa8 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb8 binary data
-9 10 2000000009 aaa9 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb9 binary data
-10 11 2000000010 aaa10 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb10 binary data
-11 12 2000000011 aaa11 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb11 binary data
-12 13 2000000012 aaa12 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb12 binary data
-13 14 2000000013 aaa13 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb13 binary data
-14 15 2000000014 aaa14 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb14 binary data
-15 16 2000000015 aaa15 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb15 binary data
-16 17 2000000016 aaa16 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb16 binary data
-17 18 2000000017 aaa17 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb17 binary data
-18 19 2000000018 aaa18 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb18 binary data
-19 20 2000000019 aaa19 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb19 binary data
-20 21 2000000020 aaa20 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb20 binary data
-ALTER TABLE test.t1 TABLESPACE ts STORAGE DISK ENGINE=NDB;
-SHOW CREATE TABLE test.t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a1` smallint(6) NOT NULL,
- `a2` int(11) NOT NULL,
- `a3` bigint(20) NOT NULL,
- `a4` char(10) DEFAULT NULL,
- `a5` decimal(5,1) DEFAULT NULL,
- `a6` time DEFAULT NULL,
- `a7` date DEFAULT NULL,
- `a8` datetime DEFAULT NULL,
- `a9` varchar(255) DEFAULT NULL,
- `a10` blob,
- PRIMARY KEY (`a1`)
-) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
-a1 Smallint PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
-a2 Int NOT NULL AT=FIXED ST=DISK
-a3 Bigint NOT NULL AT=FIXED ST=DISK
-a4 Char(10;latin1_swedish_ci) NULL AT=FIXED ST=DISK
-a5 Decimal(5,1) NULL AT=FIXED ST=DISK
-a6 Time NULL AT=FIXED ST=DISK
-a7 Date NULL AT=FIXED ST=DISK
-a8 Datetime NULL AT=FIXED ST=DISK
-a9 Varchar(255;latin1_swedish_ci) NULL AT=FIXED ST=DISK
-a10 Blob(256,2000;16) NULL AT=FIXED ST=MEMORY
-SELECT * FROM test.t1 ORDER BY a1;
-a1 a2 a3 a4 a5 a6 a7 a8 a9 a10
-1 2 2000000001 aaa1 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb1 binary data
-2 3 2000000002 aaa2 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb2 binary data
-3 4 2000000003 aaa3 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb3 binary data
-4 5 2000000004 aaa4 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb4 binary data
-5 6 2000000005 aaa5 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb5 binary data
-6 7 2000000006 aaa6 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb6 binary data
-7 8 2000000007 aaa7 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb7 binary data
-8 9 2000000008 aaa8 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb8 binary data
-9 10 2000000009 aaa9 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb9 binary data
-10 11 2000000010 aaa10 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb10 binary data
-11 12 2000000011 aaa11 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb11 binary data
-12 13 2000000012 aaa12 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb12 binary data
-13 14 2000000013 aaa13 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb13 binary data
-14 15 2000000014 aaa14 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb14 binary data
-15 16 2000000015 aaa15 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb15 binary data
-16 17 2000000016 aaa16 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb16 binary data
-17 18 2000000017 aaa17 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb17 binary data
-18 19 2000000018 aaa18 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb18 binary data
-19 20 2000000019 aaa19 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb19 binary data
-20 21 2000000020 aaa20 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb20 binary data
-ALTER TABLE test.t1 ENGINE=InnoDB;
-SHOW CREATE TABLE test.t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a1` smallint(6) NOT NULL,
- `a2` int(11) NOT NULL,
- `a3` bigint(20) NOT NULL,
- `a4` char(10) DEFAULT NULL,
- `a5` decimal(5,1) DEFAULT NULL,
- `a6` time DEFAULT NULL,
- `a7` date DEFAULT NULL,
- `a8` datetime DEFAULT NULL,
- `a9` varchar(255) DEFAULT NULL,
- `a10` blob,
- PRIMARY KEY (`a1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-SELECT * FROM test.t1 ORDER BY a1;
-a1 a2 a3 a4 a5 a6 a7 a8 a9 a10
-1 2 2000000001 aaa1 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb1 binary data
-2 3 2000000002 aaa2 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb2 binary data
-3 4 2000000003 aaa3 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb3 binary data
-4 5 2000000004 aaa4 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb4 binary data
-5 6 2000000005 aaa5 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb5 binary data
-6 7 2000000006 aaa6 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb6 binary data
-7 8 2000000007 aaa7 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb7 binary data
-8 9 2000000008 aaa8 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb8 binary data
-9 10 2000000009 aaa9 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb9 binary data
-10 11 2000000010 aaa10 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb10 binary data
-11 12 2000000011 aaa11 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb11 binary data
-12 13 2000000012 aaa12 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb12 binary data
-13 14 2000000013 aaa13 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb13 binary data
-14 15 2000000014 aaa14 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb14 binary data
-15 16 2000000015 aaa15 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb15 binary data
-16 17 2000000016 aaa16 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb16 binary data
-17 18 2000000017 aaa17 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb17 binary data
-18 19 2000000018 aaa18 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb18 binary data
-19 20 2000000019 aaa19 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb19 binary data
-20 21 2000000020 aaa20 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb20 binary data
-ALTER TABLE test.t1 TABLESPACE ts STORAGE DISK ENGINE=NDB;
-SHOW CREATE TABLE test.t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a1` smallint(6) NOT NULL,
- `a2` int(11) NOT NULL,
- `a3` bigint(20) NOT NULL,
- `a4` char(10) DEFAULT NULL,
- `a5` decimal(5,1) DEFAULT NULL,
- `a6` time DEFAULT NULL,
- `a7` date DEFAULT NULL,
- `a8` datetime DEFAULT NULL,
- `a9` varchar(255) DEFAULT NULL,
- `a10` blob,
- PRIMARY KEY (`a1`)
-) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
-a1 Smallint PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
-a2 Int NOT NULL AT=FIXED ST=DISK
-a3 Bigint NOT NULL AT=FIXED ST=DISK
-a4 Char(10;latin1_swedish_ci) NULL AT=FIXED ST=DISK
-a5 Decimal(5,1) NULL AT=FIXED ST=DISK
-a6 Time NULL AT=FIXED ST=DISK
-a7 Date NULL AT=FIXED ST=DISK
-a8 Datetime NULL AT=FIXED ST=DISK
-a9 Varchar(255;latin1_swedish_ci) NULL AT=FIXED ST=DISK
-a10 Blob(256,2000;16) NULL AT=FIXED ST=MEMORY
-ALTER TABLE test.t1 ENGINE=MyISAM;
-SHOW CREATE TABLE test.t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a1` smallint(6) NOT NULL,
- `a2` int(11) NOT NULL,
- `a3` bigint(20) NOT NULL,
- `a4` char(10) DEFAULT NULL,
- `a5` decimal(5,1) DEFAULT NULL,
- `a6` time DEFAULT NULL,
- `a7` date DEFAULT NULL,
- `a8` datetime DEFAULT NULL,
- `a9` varchar(255) DEFAULT NULL,
- `a10` blob,
- PRIMARY KEY (`a1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-DROP TABLE test.t1;
-CREATE TABLE test.t1 (a1 INT PRIMARY KEY) TABLESPACE ts STORAGE DISK ENGINE=NDB;
-SELECT * FROM test.t1 ORDER BY a1;
-a1
-1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-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 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 default ts
-SELECT * FROM test.t1 ORDER BY a1;
-a1 a2 a3
-1 2.2345 20000001
-2 3.2345 20000002
-3 4.2345 20000003
-4 5.2345 20000004
-5 6.2345 20000005
-6 7.2345 20000006
-7 8.2345 20000007
-8 9.2345 20000008
-9 10.2345 20000009
-10 11.2345 20000010
-11 12.2345 20000011
-12 13.2345 20000012
-13 14.2345 20000013
-14 15.2345 20000014
-15 16.2345 20000015
-16 17.2345 20000016
-17 18.2345 20000017
-18 19.2345 20000018
-19 20.2345 20000019
-20 21.2345 20000020
-ALTER TABLE test.t1 ADD a4 BIT, ADD a5 TINYINT, ADD a6 BIGINT, ADD a7 DATE, ADD a8 TIME;
-SELECT a1,a2,a3,hex(a4), a5,a6,a7,a8 FROM test.t1 ORDER BY a1;
-a1 a2 a3 hex(a4) a5 a6 a7 a8
-1 2.2345 20000001 0 1 23457 2006-01-01 07:04:00
-2 3.2345 20000002 0 1 23458 2006-01-01 07:04:00
-3 4.2345 20000003 0 1 23459 2006-01-01 07:04:00
-4 5.2345 20000004 0 1 23460 2006-01-01 07:04:00
-5 6.2345 20000005 0 1 23461 2006-01-01 07:04:00
-6 7.2345 20000006 0 1 23462 2006-01-01 07:04:00
-7 8.2345 20000007 0 1 23463 2006-01-01 07:04:00
-8 9.2345 20000008 0 1 23464 2006-01-01 07:04:00
-9 10.2345 20000009 0 1 23465 2006-01-01 07:04:00
-10 11.2345 20000010 0 1 23466 2006-01-01 07:04:00
-11 12.2345 20000011 0 1 23467 2006-01-01 07:04:00
-12 13.2345 20000012 0 1 23468 2006-01-01 07:04:00
-13 14.2345 20000013 0 1 23469 2006-01-01 07:04:00
-14 15.2345 20000014 0 1 23470 2006-01-01 07:04:00
-15 16.2345 20000015 0 1 23471 2006-01-01 07:04:00
-16 17.2345 20000016 0 1 23472 2006-01-01 07:04:00
-17 18.2345 20000017 0 1 23473 2006-01-01 07:04:00
-18 19.2345 20000018 0 1 23474 2006-01-01 07:04:00
-19 20.2345 20000019 0 1 23475 2006-01-01 07:04:00
-20 21.2345 20000020 0 1 23476 2006-01-01 07:04:00
-ALTER TABLE test.t1 ADD a9 DATETIME, ADD a10 TINYTEXT, ADD a11 MEDIUMTEXT, ADD a12 LONGTEXT, ADD a13 TEXT, ADD a14 BLOB;
-SHOW CREATE TABLE test.t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a1` int(11) NOT NULL,
- `a2` float DEFAULT NULL,
- `a3` double DEFAULT NULL,
- `a4` bit(1) DEFAULT NULL,
- `a5` tinyint(4) DEFAULT NULL,
- `a6` bigint(20) DEFAULT NULL,
- `a7` date DEFAULT NULL,
- `a8` time DEFAULT NULL,
- `a9` datetime DEFAULT NULL,
- `a10` tinytext,
- `a11` mediumtext,
- `a12` longtext,
- `a13` text,
- `a14` blob,
- PRIMARY KEY (`a1`)
-) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
-a1 Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
-a2 Float NULL AT=FIXED ST=DISK
-a3 Double NULL AT=FIXED ST=DISK
-a4 Bit(1) NULL AT=FIXED ST=DISK
-a5 Tinyint NULL AT=FIXED ST=DISK
-a6 Bigint NULL AT=FIXED ST=DISK
-a7 Date NULL AT=FIXED ST=DISK
-a8 Time NULL AT=FIXED ST=DISK
-a9 Datetime NULL AT=FIXED ST=DISK
-a10 Text(256,0;0;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
-a11 Text(256,4000;8;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
-a12 Text(256,8000;4;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
-a13 Text(256,2000;16;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
-a14 Blob(256,2000;16) NULL AT=FIXED ST=MEMORY
-SELECT a1, a2,a3,hex(a4),a5,a6,a7,a8,a9,a10,a11,a12,a13 FROM test.t1 ORDER BY a1;
-a1 a2 a3 hex(a4) a5 a6 a7 a8 a9 a10 a11 a12 a13
-1 2.2345 20000001 0 1 23457 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
-2 3.2345 20000002 0 1 23458 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
-3 4.2345 20000003 0 1 23459 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
-4 5.2345 20000004 0 1 23460 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
-5 6.2345 20000005 0 1 23461 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
-6 7.2345 20000006 0 1 23462 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
-7 8.2345 20000007 0 1 23463 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
-8 9.2345 20000008 0 1 23464 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
-9 10.2345 20000009 0 1 23465 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
-10 11.2345 20000010 0 1 23466 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
-11 12.2345 20000011 0 1 23467 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
-12 13.2345 20000012 0 1 23468 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
-13 14.2345 20000013 0 1 23469 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
-14 15.2345 20000014 0 1 23470 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
-15 16.2345 20000015 0 1 23471 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
-16 17.2345 20000016 0 1 23472 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
-17 18.2345 20000017 0 1 23473 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
-18 19.2345 20000018 0 1 23474 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
-19 20.2345 20000019 0 1 23475 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
-20 21.2345 20000020 0 1 23476 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
-ALTER TABLE test.t1 ADD INDEX a2_i (a2), ADD INDEX a3_i (a3);
-SHOW CREATE TABLE test.t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a1` int(11) NOT NULL,
- `a2` float DEFAULT NULL,
- `a3` double DEFAULT NULL,
- `a4` bit(1) DEFAULT NULL,
- `a5` tinyint(4) DEFAULT NULL,
- `a6` bigint(20) DEFAULT NULL,
- `a7` date DEFAULT NULL,
- `a8` time DEFAULT NULL,
- `a9` datetime DEFAULT NULL,
- `a10` tinytext,
- `a11` mediumtext,
- `a12` longtext,
- `a13` text,
- `a14` blob,
- PRIMARY KEY (`a1`),
- KEY `a2_i` (`a2`),
- KEY `a3_i` (`a3`)
-) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
-a1 Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
-a2 Float NULL AT=FIXED ST=MEMORY
-a3 Double NULL AT=FIXED ST=MEMORY
-a4 Bit(1) NULL AT=FIXED ST=DISK
-a5 Tinyint NULL AT=FIXED ST=DISK
-a6 Bigint NULL AT=FIXED ST=DISK
-a7 Date NULL AT=FIXED ST=DISK
-a8 Time NULL AT=FIXED ST=DISK
-a9 Datetime NULL AT=FIXED ST=DISK
-a10 Text(256,0;0;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
-a11 Text(256,4000;8;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
-a12 Text(256,8000;4;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
-a13 Text(256,2000;16;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
-a14 Blob(256,2000;16) NULL AT=FIXED ST=MEMORY
-ALTER TABLE test.t1 DROP INDEX a2_i;
-SHOW CREATE TABLE test.t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a1` int(11) NOT NULL,
- `a2` float DEFAULT NULL,
- `a3` double DEFAULT NULL,
- `a4` bit(1) DEFAULT NULL,
- `a5` tinyint(4) DEFAULT NULL,
- `a6` bigint(20) DEFAULT NULL,
- `a7` date DEFAULT NULL,
- `a8` time DEFAULT NULL,
- `a9` datetime DEFAULT NULL,
- `a10` tinytext,
- `a11` mediumtext,
- `a12` longtext,
- `a13` text,
- `a14` blob,
- PRIMARY KEY (`a1`),
- KEY `a3_i` (`a3`)
-) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
-a1 Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
-a2 Float NULL AT=FIXED ST=DISK
-a3 Double NULL AT=FIXED ST=MEMORY
-a4 Bit(1) NULL AT=FIXED ST=DISK
-a5 Tinyint NULL AT=FIXED ST=DISK
-a6 Bigint NULL AT=FIXED ST=DISK
-a7 Date NULL AT=FIXED ST=DISK
-a8 Time NULL AT=FIXED ST=DISK
-a9 Datetime NULL AT=FIXED ST=DISK
-a10 Text(256,0;0;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
-a11 Text(256,4000;8;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
-a12 Text(256,8000;4;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
-a13 Text(256,2000;16;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
-a14 Blob(256,2000;16) NULL AT=FIXED ST=MEMORY
-TRUNCATE TABLE test.t1;
-SHOW CREATE TABLE test.t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a1` int(11) NOT NULL,
- `a2` float DEFAULT NULL,
- `a3` double DEFAULT NULL,
- `a4` bit(1) DEFAULT NULL,
- `a5` tinyint(4) DEFAULT NULL,
- `a6` bigint(20) DEFAULT NULL,
- `a7` date DEFAULT NULL,
- `a8` time DEFAULT NULL,
- `a9` datetime DEFAULT NULL,
- `a10` tinytext,
- `a11` mediumtext,
- `a12` longtext,
- `a13` text,
- `a14` blob,
- PRIMARY KEY (`a1`),
- KEY `a3_i` (`a3`)
-) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
-a1 Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
-a2 Float NULL AT=FIXED ST=DISK
-a3 Double NULL AT=FIXED ST=MEMORY
-a4 Bit(1) NULL AT=FIXED ST=DISK
-a5 Tinyint NULL AT=FIXED ST=DISK
-a6 Bigint NULL AT=FIXED ST=DISK
-a7 Date NULL AT=FIXED ST=DISK
-a8 Time NULL AT=FIXED ST=DISK
-a9 Datetime NULL AT=FIXED ST=DISK
-a10 Text(256,0;0;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
-a11 Text(256,4000;8;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
-a12 Text(256,8000;4;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
-a13 Text(256,2000;16;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
-a14 Blob(256,2000;16) NULL AT=FIXED ST=MEMORY
-ALTER TABLE test.t1 DROP a14;
-ALTER TABLE test.t1 DROP a13;
-ALTER TABLE test.t1 DROP a12;
-ALTER TABLE test.t1 DROP a11;
-ALTER TABLE test.t1 DROP a10;
-ALTER TABLE test.t1 DROP a9;
-ALTER TABLE test.t1 DROP a8;
-ALTER TABLE test.t1 DROP a7;
-ALTER TABLE test.t1 DROP a6;
-ALTER TABLE test.t1 DROP PRIMARY KEY;
-SHOW CREATE TABLE test.t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a1` int(11) NOT NULL,
- `a2` float DEFAULT NULL,
- `a3` double DEFAULT NULL,
- `a4` bit(1) DEFAULT NULL,
- `a5` tinyint(4) DEFAULT NULL,
- KEY `a3_i` (`a3`)
-) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
-a1 Int NOT NULL AT=FIXED ST=DISK
-a2 Float NULL AT=FIXED ST=DISK
-a3 Double NULL AT=FIXED ST=MEMORY
-a4 Bit(1) NULL AT=FIXED ST=DISK
-a5 Tinyint NULL AT=FIXED ST=DISK
-$PK Bigunsigned PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
-DROP TABLE test.t1;
-ALTER TABLESPACE ts
-DROP DATAFILE './table_space/datafile.dat'
- ENGINE NDB;
-DROP TABLESPACE ts ENGINE NDB;
-DROP LOGFILE GROUP lg ENGINE=NDB;
diff --git a/mysql-test/r/ndb_dd_backuprestore.result b/mysql-test/r/ndb_dd_backuprestore.result
deleted file mode 100644
index 1dd609b932d..00000000000
--- a/mysql-test/r/ndb_dd_backuprestore.result
+++ /dev/null
@@ -1,487 +0,0 @@
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t2;
-DROP TABLE IF EXISTS test.t3;
-DROP TABLE IF EXISTS test.t4;
-DROP TABLE IF EXISTS test.t5;
-DROP TABLE IF EXISTS test.t6;
-**** Test 1 Simple DD backup and restore ****
-CREATE LOGFILE GROUP log_group1
-ADD UNDOFILE './log_group1/undofile.dat'
-INITIAL_SIZE 16M
-UNDO_BUFFER_SIZE = 1M
-ENGINE=NDB;
-CREATE TABLESPACE table_space1
-ADD DATAFILE './table_space1/datafile.dat'
-USE LOGFILE GROUP log_group1
-INITIAL_SIZE 12M
-ENGINE NDB;
-CREATE TABLE test.t1
-(pk1 MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 CHAR(50) NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL) TABLESPACE table_space1 STORAGE DISK ENGINE=NDB;
-SELECT COUNT(*) FROM test.t1;
-COUNT(*)
-500
-SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY pk1 LIMIT 5;
-pk1 c2 c3 hex(c4)
-1 Sweden 500 1
-2 Sweden 499 1
-3 Sweden 498 1
-4 Sweden 497 1
-5 Sweden 496 1
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-DELETE FROM test.backup_info;
-LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-SELECT @the_backup_id:=backup_id FROM test.backup_info;
-@the_backup_id:=backup_id
-<the_backup_id>
-DROP TABLE test.backup_info;
-DROP TABLE test.t1;
-ALTER TABLESPACE table_space1
-DROP DATAFILE './table_space1/datafile.dat'
-ENGINE = NDB;
-DROP TABLESPACE table_space1
-ENGINE = NDB;
-DROP LOGFILE GROUP log_group1
-ENGINE =NDB;
-SELECT COUNT(*) FROM test.t1;
-COUNT(*)
-500
-SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY pk1 LIMIT 5;
-pk1 c2 c3 hex(c4)
-1 Sweden 500 1
-2 Sweden 499 1
-3 Sweden 498 1
-4 Sweden 497 1
-5 Sweden 496 1
-**** Test 2 Mixed Cluster Test backup and restore ****
-CREATE TABLE test.t2
-(pk1 MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 VARCHAR(200) NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL)ENGINE=NDB;
-CREATE TABLE test.t3 (c1 int not null auto_increment, data LONGBLOB, PRIMARY KEY(c1))TABLESPACE table_space1 STORAGE DISK ENGINE=NDB;
-CREATE TABLE test.t4 (c1 int not null auto_increment, data LONGBLOB, PRIMARY KEY(c1))ENGINE=NDB;
-SELECT COUNT(*) FROM test.t1;
-COUNT(*)
-500
-SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY pk1 LIMIT 5;
-pk1 c2 c3 hex(c4)
-1 Sweden 500 1
-2 Sweden 499 1
-3 Sweden 498 1
-4 Sweden 497 1
-5 Sweden 496 1
-SELECT COUNT(*) FROM test.t2;
-COUNT(*)
-500
-SELECT pk1, c2, c3, hex(c4) FROM test.t2 ORDER BY pk1 LIMIT 5;
-pk1 c2 c3 hex(c4)
-1 Sweden, Texas 500 0
-2 Sweden, Texas 499 0
-3 Sweden, Texas 498 0
-4 Sweden, Texas 497 0
-5 Sweden, Texas 496 0
-SELECT COUNT(*) FROM test.t3;
-COUNT(*)
-100
-SELECT LENGTH(data) FROM test.t3 WHERE c1 = 1;
-LENGTH(data)
-1024
-SELECT LENGTH(data) FROM test.t3 WHERE c1 = 2;
-LENGTH(data)
-16384
-SELECT COUNT(*) FROM test.t4;
-COUNT(*)
-100
-SELECT LENGTH(data) FROM test.t4 WHERE c1 = 1;
-LENGTH(data)
-1024
-SELECT LENGTH(data) FROM test.t4 WHERE c1 = 2;
-LENGTH(data)
-16384
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-DELETE FROM test.backup_info;
-LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-SELECT @the_backup_id:=backup_id FROM test.backup_info;
-@the_backup_id:=backup_id
-<the_backup_id>
-DROP TABLE test.backup_info;
-DROP TABLE test.t1;
-DROP TABLE test.t2;
-DROP TABLE test.t3;
-DROP TABLE test.t4;
-ALTER TABLESPACE table_space1
-DROP DATAFILE './table_space1/datafile.dat'
-ENGINE = NDB;
-DROP TABLESPACE table_space1
-ENGINE = NDB;
-DROP LOGFILE GROUP log_group1
-ENGINE =NDB;
-SELECT COUNT(*) FROM test.t1;
-COUNT(*)
-500
-SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY pk1 LIMIT 5;
-pk1 c2 c3 hex(c4)
-1 Sweden 500 1
-2 Sweden 499 1
-3 Sweden 498 1
-4 Sweden 497 1
-5 Sweden 496 1
-SELECT COUNT(*) FROM test.t2;
-COUNT(*)
-500
-SELECT pk1, c2, c3, hex(c4) FROM test.t2 ORDER BY pk1 LIMIT 5;
-pk1 c2 c3 hex(c4)
-1 Sweden, Texas 500 0
-2 Sweden, Texas 499 0
-3 Sweden, Texas 498 0
-4 Sweden, Texas 497 0
-5 Sweden, Texas 496 0
-SELECT COUNT(*) FROM test.t3;
-COUNT(*)
-100
-SELECT LENGTH(data) FROM test.t3 WHERE c1 = 1;
-LENGTH(data)
-1024
-SELECT LENGTH(data) FROM test.t3 WHERE c1 = 2;
-LENGTH(data)
-16384
-SELECT COUNT(*) FROM test.t4;
-COUNT(*)
-100
-SELECT LENGTH(data) FROM test.t4 WHERE c1 = 1;
-LENGTH(data)
-1024
-SELECT LENGTH(data) FROM test.t4 WHERE c1 = 2;
-LENGTH(data)
-16384
-DROP TABLE test.t1;
-DROP TABLE test.t2;
-DROP TABLE test.t3;
-DROP TABLE test.t4;
-**** Test 3 Adding partition Test backup and restore ****
-CREATE TABLESPACE table_space2
-ADD DATAFILE './table_space2/datafile.dat'
-USE LOGFILE GROUP log_group1
-INITIAL_SIZE 12M
-ENGINE NDB;
-CREATE TABLE test.t1 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 VARCHAR(150) NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))TABLESPACE table_space1 STORAGE DISK ENGINE=NDB PARTITION BY HASH(c3) PARTITIONS 4;
-CREATE TABLE test.t4 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 VARCHAR(180) NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))ENGINE=NDB PARTITION BY HASH(c3) PARTITIONS 2;
-CREATE TABLE test.t2 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 TEXT NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))TABLESPACE table_space2 STORAGE DISK ENGINE=NDB PARTITION BY KEY(c3) (PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB);
-CREATE TABLE test.t5 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 TEXT NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))ENGINE=NDB PARTITION BY KEY(pk1) (PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB);
-CREATE TABLE test.t3 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 VARCHAR(202) NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))TABLESPACE table_space2 STORAGE DISK ENGINE=NDB PARTITION BY RANGE (c3) PARTITIONS 3 (PARTITION x1 VALUES LESS THAN (105), PARTITION x2 VALUES LESS THAN (333), PARTITION x3 VALUES LESS THAN (720));
-CREATE TABLE test.t6 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 VARCHAR(220) NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))ENGINE=NDB PARTITION BY RANGE (pk1) PARTITIONS 2 (PARTITION x1 VALUES LESS THAN (333), PARTITION x2 VALUES LESS THAN (720));
-SHOW CREATE TABLE test.t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `pk1` mediumint(9) NOT NULL AUTO_INCREMENT,
- `c2` varchar(150) NOT NULL,
- `c3` int(11) NOT NULL,
- `c4` bit(1) NOT NULL,
- PRIMARY KEY (`pk1`,`c3`)
-) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 4 */
-SHOW CREATE TABLE test.t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `pk1` mediumint(9) NOT NULL AUTO_INCREMENT,
- `c2` text NOT NULL,
- `c3` int(11) NOT NULL,
- `c4` bit(1) NOT NULL,
- PRIMARY KEY (`pk1`,`c3`)
-) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
-SHOW CREATE TABLE test.t3;
-Table Create Table
-t3 CREATE TABLE `t3` (
- `pk1` mediumint(9) NOT NULL AUTO_INCREMENT,
- `c2` varchar(202) NOT NULL,
- `c3` int(11) NOT NULL,
- `c4` bit(1) NOT NULL,
- PRIMARY KEY (`pk1`,`c3`)
-) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */
-SHOW CREATE TABLE test.t4;
-Table Create Table
-t4 CREATE TABLE `t4` (
- `pk1` mediumint(9) NOT NULL AUTO_INCREMENT,
- `c2` varchar(180) NOT NULL,
- `c3` int(11) NOT NULL,
- `c4` bit(1) NOT NULL,
- PRIMARY KEY (`pk1`,`c3`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 2 */
-SHOW CREATE TABLE test.t5;
-Table Create Table
-t5 CREATE TABLE `t5` (
- `pk1` mediumint(9) NOT NULL AUTO_INCREMENT,
- `c2` text NOT NULL,
- `c3` int(11) NOT NULL,
- `c4` bit(1) NOT NULL,
- PRIMARY KEY (`pk1`,`c3`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (pk1) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
-SHOW CREATE TABLE test.t6;
-Table Create Table
-t6 CREATE TABLE `t6` (
- `pk1` mediumint(9) NOT NULL AUTO_INCREMENT,
- `c2` varchar(220) NOT NULL,
- `c3` int(11) NOT NULL,
- `c4` bit(1) NOT NULL,
- PRIMARY KEY (`pk1`,`c3`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (pk1) (PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) */
-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 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default default table_space1
-NULL test t1 p1 NULL 2 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default default table_space1
-NULL test t1 p2 NULL 3 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default default table_space1
-NULL test t1 p3 NULL 4 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default default table_space1
-SELECT * FROM information_schema.partitions WHERE 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 p0 NULL 1 NULL KEY NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default default table_space2
-NULL test t2 p1 NULL 2 NULL KEY NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default default table_space2
-SELECT * FROM information_schema.partitions WHERE 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 x1 NULL 1 NULL RANGE NULL c3 NULL 105 0 0 0 NULL 0 0 NULL NULL NULL NULL default default table_space2
-NULL test t3 x2 NULL 2 NULL RANGE NULL c3 NULL 333 0 0 0 NULL 0 0 NULL NULL NULL NULL default default table_space2
-NULL test t3 x3 NULL 3 NULL RANGE NULL c3 NULL 720 0 0 0 NULL 0 0 NULL NULL NULL NULL default default table_space2
-SELECT * FROM information_schema.partitions WHERE 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 HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default default NULL
-NULL test t4 p1 NULL 2 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default default NULL
-SELECT * FROM information_schema.partitions WHERE table_name= 't5';
-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 t5 p0 NULL 1 NULL KEY NULL pk1 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default default NULL
-NULL test t5 p1 NULL 2 NULL KEY NULL pk1 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default default NULL
-SELECT * FROM information_schema.partitions WHERE table_name= 't6';
-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 t6 x1 NULL 1 NULL RANGE NULL pk1 NULL 333 0 0 0 NULL 0 0 NULL NULL NULL NULL default default NULL
-NULL test t6 x2 NULL 2 NULL RANGE NULL pk1 NULL 720 0 0 0 NULL 0 0 NULL NULL NULL NULL default default NULL
-SELECT COUNT(*) FROM test.t1;
-COUNT(*)
-250
-SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY c3 LIMIT 5;
-pk1 c2 c3 hex(c4)
-250 Sweden, Texas 2 0
-249 Sweden, Texas 4 0
-248 Sweden, Texas 6 0
-247 Sweden, Texas 8 0
-246 Sweden, Texas 10 0
-SELECT COUNT(*) FROM test.t2;
-COUNT(*)
-250
-SELECT pk1, c2, c3, hex(c4) FROM test.t2 ORDER BY c3 LIMIT 5;
-pk1 c2 c3 hex(c4)
-250 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 1 1
-249 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 3 1
-248 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 5 1
-247 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 7 1
-246 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 9 1
-SELECT COUNT(*) FROM test.t3;
-COUNT(*)
-250
-SELECT pk1, c2, c3, hex(c4) FROM test.t3 ORDER BY c3 LIMIT 5;
-pk1 c2 c3 hex(c4)
-250 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 0 1
-249 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 2 1
-248 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 4 1
-247 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 6 1
-246 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 8 1
-SELECT COUNT(*) FROM test.t4;
-COUNT(*)
-250
-SELECT pk1, c2, c3, hex(c4) FROM test.t4 ORDER BY c3 LIMIT 5;
-pk1 c2 c3 hex(c4)
-250 Sweden, Texas 2 0
-249 Sweden, Texas 4 0
-248 Sweden, Texas 6 0
-247 Sweden, Texas 8 0
-246 Sweden, Texas 10 0
-SELECT COUNT(*) FROM test.t5;
-COUNT(*)
-250
-SELECT pk1, c2, c3, hex(c4) FROM test.t5 ORDER BY c3 LIMIT 5;
-pk1 c2 c3 hex(c4)
-250 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 1 1
-249 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 3 1
-248 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 5 1
-247 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 7 1
-246 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 9 1
-SELECT COUNT(*) FROM test.t6;
-COUNT(*)
-250
-SELECT pk1, c2, c3, hex(c4) FROM test.t6 ORDER BY c3 LIMIT 5;
-pk1 c2 c3 hex(c4)
-250 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 0 1
-249 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 2 1
-248 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 4 1
-247 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 6 1
-246 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 8 1
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-DELETE FROM test.backup_info;
-LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-SELECT @the_backup_id:=backup_id FROM test.backup_info;
-@the_backup_id:=backup_id
-<the_backup_id>
-DROP TABLE test.backup_info;
-DROP TABLE test.t1;
-DROP TABLE test.t2;
-DROP TABLE test.t3;
-DROP TABLE test.t4;
-DROP TABLE test.t5;
-DROP TABLE test.t6;
-ALTER TABLESPACE table_space1
-DROP DATAFILE './table_space1/datafile.dat'
-ENGINE = NDB;
-ALTER TABLESPACE table_space2
-DROP DATAFILE './table_space2/datafile.dat'
-ENGINE = NDB;
-DROP TABLESPACE table_space1
-ENGINE = NDB;
-DROP TABLESPACE table_space2
-ENGINE = NDB;
-DROP LOGFILE GROUP log_group1
-ENGINE =NDB;
-SHOW CREATE TABLE test.t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `pk1` mediumint(9) NOT NULL AUTO_INCREMENT,
- `c2` varchar(150) NOT NULL,
- `c3` int(11) NOT NULL,
- `c4` bit(1) NOT NULL,
- PRIMARY KEY (`pk1`,`c3`)
-) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 4 */
-SHOW CREATE TABLE test.t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `pk1` mediumint(9) NOT NULL AUTO_INCREMENT,
- `c2` text NOT NULL,
- `c3` int(11) NOT NULL,
- `c4` bit(1) NOT NULL,
- PRIMARY KEY (`pk1`,`c3`)
-) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
-SHOW CREATE TABLE test.t3;
-Table Create Table
-t3 CREATE TABLE `t3` (
- `pk1` mediumint(9) NOT NULL AUTO_INCREMENT,
- `c2` varchar(202) NOT NULL,
- `c3` int(11) NOT NULL,
- `c4` bit(1) NOT NULL,
- PRIMARY KEY (`pk1`,`c3`)
-) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */
-SHOW CREATE TABLE test.t4;
-Table Create Table
-t4 CREATE TABLE `t4` (
- `pk1` mediumint(9) NOT NULL AUTO_INCREMENT,
- `c2` varchar(180) NOT NULL,
- `c3` int(11) NOT NULL,
- `c4` bit(1) NOT NULL,
- PRIMARY KEY (`pk1`,`c3`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 2 */
-SHOW CREATE TABLE test.t5;
-Table Create Table
-t5 CREATE TABLE `t5` (
- `pk1` mediumint(9) NOT NULL AUTO_INCREMENT,
- `c2` text NOT NULL,
- `c3` int(11) NOT NULL,
- `c4` bit(1) NOT NULL,
- PRIMARY KEY (`pk1`,`c3`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (pk1) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
-SHOW CREATE TABLE test.t6;
-Table Create Table
-t6 CREATE TABLE `t6` (
- `pk1` mediumint(9) NOT NULL AUTO_INCREMENT,
- `c2` varchar(220) NOT NULL,
- `c3` int(11) NOT NULL,
- `c4` bit(1) NOT NULL,
- PRIMARY KEY (`pk1`,`c3`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (pk1) (PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) */
-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 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default default table_space1
-NULL test t1 p1 NULL 2 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default default table_space1
-NULL test t1 p2 NULL 3 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default default table_space1
-NULL test t1 p3 NULL 4 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default default table_space1
-SELECT * FROM information_schema.partitions WHERE 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 p0 NULL 1 NULL KEY NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default default table_space2
-NULL test t2 p1 NULL 2 NULL KEY NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default default table_space2
-SELECT * FROM information_schema.partitions WHERE 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 x1 NULL 1 NULL RANGE NULL c3 NULL 105 0 0 0 NULL 0 0 NULL NULL NULL NULL default default table_space2
-NULL test t3 x2 NULL 2 NULL RANGE NULL c3 NULL 333 0 0 0 NULL 0 0 NULL NULL NULL NULL default default table_space2
-NULL test t3 x3 NULL 3 NULL RANGE NULL c3 NULL 720 0 0 0 NULL 0 0 NULL NULL NULL NULL default default table_space2
-SELECT * FROM information_schema.partitions WHERE 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 HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default default NULL
-NULL test t4 p1 NULL 2 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default default NULL
-SELECT * FROM information_schema.partitions WHERE table_name= 't5';
-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 t5 p0 NULL 1 NULL KEY NULL pk1 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default default NULL
-NULL test t5 p1 NULL 2 NULL KEY NULL pk1 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default default NULL
-SELECT * FROM information_schema.partitions WHERE table_name= 't6';
-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 t6 x1 NULL 1 NULL RANGE NULL pk1 NULL 333 0 0 0 NULL 0 0 NULL NULL NULL NULL default default NULL
-NULL test t6 x2 NULL 2 NULL RANGE NULL pk1 NULL 720 0 0 0 NULL 0 0 NULL NULL NULL NULL default default NULL
-SELECT COUNT(*) FROM test.t1;
-COUNT(*)
-250
-SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY c3 LIMIT 5;
-pk1 c2 c3 hex(c4)
-250 Sweden, Texas 2 0
-249 Sweden, Texas 4 0
-248 Sweden, Texas 6 0
-247 Sweden, Texas 8 0
-246 Sweden, Texas 10 0
-SELECT COUNT(*) FROM test.t2;
-COUNT(*)
-250
-SELECT pk1, c2, c3, hex(c4) FROM test.t2 ORDER BY c3 LIMIT 5;
-pk1 c2 c3 hex(c4)
-250 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 1 1
-249 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 3 1
-248 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 5 1
-247 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 7 1
-246 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 9 1
-SELECT COUNT(*) FROM test.t3;
-COUNT(*)
-250
-SELECT pk1, c2, c3, hex(c4) FROM test.t3 ORDER BY c3 LIMIT 5;
-pk1 c2 c3 hex(c4)
-250 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 0 1
-249 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 2 1
-248 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 4 1
-247 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 6 1
-246 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 8 1
-SELECT COUNT(*) FROM test.t4;
-COUNT(*)
-250
-SELECT pk1, c2, c3, hex(c4) FROM test.t4 ORDER BY c3 LIMIT 5;
-pk1 c2 c3 hex(c4)
-250 Sweden, Texas 2 0
-249 Sweden, Texas 4 0
-248 Sweden, Texas 6 0
-247 Sweden, Texas 8 0
-246 Sweden, Texas 10 0
-SELECT COUNT(*) FROM test.t5;
-COUNT(*)
-250
-SELECT pk1, c2, c3, hex(c4) FROM test.t5 ORDER BY c3 LIMIT 5;
-pk1 c2 c3 hex(c4)
-250 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 1 1
-249 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 3 1
-248 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 5 1
-247 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 7 1
-246 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 9 1
-SELECT COUNT(*) FROM test.t6;
-COUNT(*)
-250
-SELECT pk1, c2, c3, hex(c4) FROM test.t6 ORDER BY c3 LIMIT 5;
-pk1 c2 c3 hex(c4)
-250 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 0 1
-249 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 2 1
-248 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 4 1
-247 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 6 1
-246 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 8 1
-DROP TABLE test.t1;
-DROP TABLE test.t2;
-DROP TABLE test.t3;
-DROP TABLE test.t4;
-DROP TABLE test.t5;
-DROP TABLE test.t6;
-ALTER TABLESPACE table_space1 DROP DATAFILE './table_space1/datafile.dat' ENGINE=NDB;
-ALTER TABLESPACE table_space2 DROP DATAFILE './table_space2/datafile.dat' ENGINE=NDB;
-DROP TABLESPACE table_space1 ENGINE = NDB;
-DROP TABLESPACE table_space2 ENGINE = NDB;
-DROP LOGFILE GROUP log_group1 ENGINE = NDB;
diff --git a/mysql-test/r/ndb_dd_basic.result b/mysql-test/r/ndb_dd_basic.result
deleted file mode 100644
index 7aeb156869b..00000000000
--- a/mysql-test/r/ndb_dd_basic.result
+++ /dev/null
@@ -1,510 +0,0 @@
-DROP TABLE IF EXISTS t1;
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-INITIAL_SIZE 16M
-UNDO_BUFFER_SIZE = 1M
-ENGINE=MYISAM;
-Warnings:
-Error 1466 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 1466 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 1466 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'
-INITIAL_SIZE 16M
-UNDO_BUFFER_SIZE = 1M;
-ALTER LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile02.dat'
-INITIAL_SIZE = 4M
-ENGINE=NDB;
-set storage_engine=myisam;
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 12M
-ENGINE NDB;
-ALTER TABLESPACE ts1
-ADD DATAFILE 'datafile02.dat'
-INITIAL_SIZE = 4M
-ENGINE=NDB;
-CREATE TABLE t1
-(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
-TABLESPACE ts1 STORAGE DISK
-ENGINE=NDB;
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `pk1` int(11) NOT NULL,
- `b` int(11) NOT NULL,
- `c` int(11) NOT NULL,
- PRIMARY KEY (`pk1`)
-) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
-INSERT INTO t1 VALUES (0, 0, 0);
-SELECT * FROM t1;
-pk1 b c
-0 0 0
-INSERT INTO t1 VALUES
-(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
-(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10),
-(11,11,11),(12,12,12),(13,13,13),(14,14,14),(15,15,15),
-(16,16,16),(17,17,17),(18,18,18),(19,19,19),(20,20,20),
-(21,21,21),(22,22,22),(23,23,23),(24,24,24),(25,25,25),
-(26,26,26),(27,27,27),(28,28,28),(29,29,29),(30,30,30),
-(31,31,31),(32,32,32),(33,33,33),(34,34,34),(35,35,35),
-(36,36,36),(37,37,37),(38,38,38),(39,39,39),(40,40,40),
-(41,41,41),(42,42,42),(43,43,43),(44,44,44),(45,45,45),
-(46,46,46),(47,47,47),(48,48,48),(49,49,49),(50,50,50),
-(51,51,51),(52,52,52),(53,53,53),(54,54,54),(55,55,55),
-(56,56,56),(57,57,57),(58,58,58),(59,59,59),(60,60,60),
-(61,61,61),(62,62,62),(63,63,63),(64,64,64),(65,65,65),
-(66,66,66),(67,67,67),(68,68,68),(69,69,69),(70,70,70),
-(71,71,71),(72,72,72),(73,73,73),(74,74,74),(75,75,75),
-(76,76,76),(77,77,77),(78,78,78),(79,79,79),(80,80,80),
-(81,81,81),(82,82,82),(83,83,83),(84,84,84),(85,85,85),
-(86,86,86),(87,87,87),(88,88,88),(89,89,89),(90,90,90),
-(91,91,91),(92,92,92),(93,93,93),(94,94,94),(95,95,95),
-(96,96,96),(97,97,97),(98,98,98),(99,99,99),(100,100,100),
-(101,101,101),(102,102,102),(103,103,103),(104,104,104),(105,105,105),
-(106,106,106),(107,107,107),(108,108,108),(109,109,109),(110,110,110),
-(111,111,111),(112,112,112),(113,113,113),(114,114,114),(115,115,115),
-(116,116,116),(117,117,117),(118,118,118),(119,119,119),(120,120,120),
-(121,121,121),(122,122,122),(123,123,123),(124,124,124),(125,125,125),
-(126,126,126),(127,127,127),(128,128,128),(129,129,129),(130,130,130),
-(131,131,131),(132,132,132),(133,133,133),(134,134,134),(135,135,135),
-(136,136,136),(137,137,137),(138,138,138),(139,139,139),(140,140,140),
-(141,141,141),(142,142,142),(143,143,143),(144,144,144),(145,145,145),
-(146,146,146),(147,147,147),(148,148,148),(149,149,149),(150,150,150),
-(151,151,151),(152,152,152),(153,153,153),(154,154,154),(155,155,155),
-(156,156,156),(157,157,157),(158,158,158),(159,159,159),(160,160,160),
-(161,161,161),(162,162,162),(163,163,163),(164,164,164),(165,165,165),
-(166,166,166),(167,167,167),(168,168,168),(169,169,169),(170,170,170),
-(171,171,171),(172,172,172),(173,173,173),(174,174,174),(175,175,175),
-(176,176,176),(177,177,177),(178,178,178),(179,179,179),(180,180,180),
-(181,181,181),(182,182,182),(183,183,183),(184,184,184),(185,185,185),
-(186,186,186),(187,187,187),(188,188,188),(189,189,189),(190,190,190),
-(191,191,191),(192,192,192),(193,193,193),(194,194,194),(195,195,195),
-(196,196,196),(197,197,197),(198,198,198),(199,199,199),(200,200,200),
-(201,201,201),(202,202,202),(203,203,203),(204,204,204),(205,205,205),
-(206,206,206),(207,207,207),(208,208,208),(209,209,209),(210,210,210),
-(211,211,211),(212,212,212),(213,213,213),(214,214,214),(215,215,215),
-(216,216,216),(217,217,217),(218,218,218),(219,219,219),(220,220,220),
-(221,221,221),(222,222,222),(223,223,223),(224,224,224),(225,225,225),
-(226,226,226),(227,227,227),(228,228,228),(229,229,229),(230,230,230),
-(231,231,231),(232,232,232),(233,233,233),(234,234,234),(235,235,235),
-(236,236,236),(237,237,237),(238,238,238),(239,239,239),(240,240,240),
-(241,241,241),(242,242,242),(243,243,243),(244,244,244),(245,245,245),
-(246,246,246),(247,247,247),(248,248,248),(249,249,249),(250,250,250),
-(251,251,251),(252,252,252),(253,253,253),(254,254,254),(255,255,255),
-(256,256,256),(257,257,257),(258,258,258),(259,259,259),(260,260,260),
-(261,261,261),(262,262,262),(263,263,263),(264,264,264),(265,265,265),
-(266,266,266),(267,267,267),(268,268,268),(269,269,269),(270,270,270),
-(271,271,271),(272,272,272),(273,273,273),(274,274,274),(275,275,275),
-(276,276,276),(277,277,277),(278,278,278),(279,279,279),(280,280,280),
-(281,281,281),(282,282,282),(283,283,283),(284,284,284),(285,285,285),
-(286,286,286),(287,287,287),(288,288,288),(289,289,289),(290,290,290),
-(291,291,291),(292,292,292),(293,293,293),(294,294,294),(295,295,295),
-(296,296,296),(297,297,297),(298,298,298),(299,299,299),(300,300,300),
-(301,301,301),(302,302,302),(303,303,303),(304,304,304),(305,305,305),
-(306,306,306),(307,307,307),(308,308,308),(309,309,309),(310,310,310),
-(311,311,311),(312,312,312),(313,313,313),(314,314,314),(315,315,315),
-(316,316,316),(317,317,317),(318,318,318),(319,319,319),(320,320,320),
-(321,321,321),(322,322,322),(323,323,323),(324,324,324),(325,325,325),
-(326,326,326),(327,327,327),(328,328,328),(329,329,329),(330,330,330),
-(331,331,331),(332,332,332),(333,333,333),(334,334,334),(335,335,335),
-(336,336,336),(337,337,337),(338,338,338),(339,339,339),(340,340,340),
-(341,341,341),(342,342,342),(343,343,343),(344,344,344),(345,345,345),
-(346,346,346),(347,347,347),(348,348,348),(349,349,349),(350,350,350),
-(351,351,351),(352,352,352),(353,353,353),(354,354,354),(355,355,355),
-(356,356,356),(357,357,357),(358,358,358),(359,359,359),(360,360,360),
-(361,361,361),(362,362,362),(363,363,363),(364,364,364),(365,365,365),
-(366,366,366),(367,367,367),(368,368,368),(369,369,369),(370,370,370),
-(371,371,371),(372,372,372),(373,373,373),(374,374,374),(375,375,375),
-(376,376,376),(377,377,377),(378,378,378),(379,379,379),(380,380,380),
-(381,381,381),(382,382,382),(383,383,383),(384,384,384),(385,385,385),
-(386,386,386),(387,387,387),(388,388,388),(389,389,389),(390,390,390),
-(391,391,391),(392,392,392),(393,393,393),(394,394,394),(395,395,395),
-(396,396,396),(397,397,397),(398,398,398),(399,399,399),(400,400,400),
-(401,401,401),(402,402,402),(403,403,403),(404,404,404),(405,405,405),
-(406,406,406),(407,407,407),(408,408,408),(409,409,409),(410,410,410),
-(411,411,411),(412,412,412),(413,413,413),(414,414,414),(415,415,415),
-(416,416,416),(417,417,417),(418,418,418),(419,419,419),(420,420,420),
-(421,421,421),(422,422,422),(423,423,423),(424,424,424),(425,425,425),
-(426,426,426),(427,427,427),(428,428,428),(429,429,429),(430,430,430),
-(431,431,431),(432,432,432),(433,433,433),(434,434,434),(435,435,435),
-(436,436,436),(437,437,437),(438,438,438),(439,439,439),(440,440,440),
-(441,441,441),(442,442,442),(443,443,443),(444,444,444),(445,445,445),
-(446,446,446),(447,447,447),(448,448,448),(449,449,449),(450,450,450),
-(451,451,451),(452,452,452),(453,453,453),(454,454,454),(455,455,455),
-(456,456,456),(457,457,457),(458,458,458),(459,459,459),(460,460,460),
-(461,461,461),(462,462,462),(463,463,463),(464,464,464),(465,465,465),
-(466,466,466),(467,467,467),(468,468,468),(469,469,469),(470,470,470),
-(471,471,471),(472,472,472),(473,473,473),(474,474,474),(475,475,475),
-(476,476,476),(477,477,477),(478,478,478),(479,479,479),(480,480,480),
-(481,481,481),(482,482,482),(483,483,483),(484,484,484),(485,485,485),
-(486,486,486),(487,487,487),(488,488,488),(489,489,489),(490,490,490),
-(491,491,491),(492,492,492),(493,493,493),(494,494,494),(495,495,495),
-(496,496,496),(497,497,497),(498,498,498),(499,499,499),(500, 500, 500);
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-501
-CREATE LOGFILE GROUP lg2
-ADD UNDOFILE 'x.dat'
-INITIAL_SIZE 10y
-ENGINE = NDB;
-ERROR HY000: A size parameter was incorrectly specified, either number or on the form 10M
-CREATE LOGFILE GROUP lg2
-ADD UNDOFILE 'x.dat'
-INITIAL_SIZE 10MB
-ENGINE = NDB;
-ERROR HY000: A size parameter was incorrectly specified, either number or on the form 10M
-CREATE LOGFILE GROUP lg2
-ADD UNDOFILE 'x.dat'
-INITIAL_SIZE 10 MB
-ENGINE = NDB;
-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 'MB
-ENGINE = NDB' at line 3
-CREATE LOGFILE GROUP lg2
-ADD UNDOFILE 'x.dat'
-INITIAL_SIZE 10 M
-ENGINE = NDB;
-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 'M
-ENGINE = NDB' at line 3
-CREATE LOGFILE GROUP lg2
-ADD UNDOFILE 'x.dat'
-INITIAL_SIZE 1000000000000K
-ENGINE = NDB;
-ERROR HY000: The size number was correct but we don't allow the digit part to be more than 2 billion
-DROP TABLE t1;
-create tablespace ts2
-add datafile 'datafile2_1.dat'
-use logfile group lg1
-initial_size 12M
-engine ndb;
-CREATE TABLE City (
-ID int(11) NOT NULL AUTO_INCREMENT,
-Name char(35) NOT NULL,
-CountryCode char(3) NOT NULL,
-District char(20) NOT NULL,
-Population int(11) NOT NULL,
-PRIMARY KEY (ID)
-) ENGINE=ndbcluster
-tablespace ts2
-storage disk;
-alter tablespace ts2
-drop datafile 'datafile2_1.dat'
-engine ndb;
-insert
-into City (Name,CountryCode,District,Population)
-values ('BeiJing','CN','Beijing',2000);
-ERROR HY000: Got error 1602 'No datafile in tablespace' from NDBCLUSTER
-drop tablespace ts2
-engine ndb;
-ERROR HY000: Failed to drop TABLESPACE
-drop table City;
-drop tablespace ts2
-engine ndb;
-CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(4) NOT NULL, c CHAR(4) NOT NULL, KEY(b)) TABLESPACE ts1 STORAGE DISK ENGINE = NDB;
-INSERT INTO t1 VALUES (1,'1','1'), (2,'2','2'), (3,'3','3');
-BEGIN;
-UPDATE t1 SET b = '2' WHERE a = 1;
-SELECT b FROM t1 WHERE a = 1;
-b
-2
-SELECT * FROM t1 WHERE a = 1;
-a b c
-1 2 1
-UPDATE t1 SET c = '2' WHERE a = 1;
-SELECT b FROM t1 WHERE a = 1;
-b
-2
-SELECT * FROM t1 WHERE a = 1;
-a b c
-1 2 2
-UPDATE t1 SET b = '3' WHERE a = 1;
-SELECT b FROM t1 WHERE a = 1;
-b
-3
-SELECT * FROM t1 WHERE a = 1;
-a b c
-1 3 2
-COMMIT;
-SELECT * FROM t1 ORDER BY 1;
-a b c
-1 3 2
-2 2 2
-3 3 3
-BEGIN;
-UPDATE t1 SET c = '3' WHERE a = 1;
-SELECT b FROM t1 WHERE a = 1;
-b
-3
-SELECT * FROM t1 WHERE a = 1;
-a b c
-1 3 3
-UPDATE t1 SET b = '4' WHERE a = 1;
-SELECT b FROM t1 WHERE a = 1;
-b
-4
-SELECT * FROM t1 WHERE a = 1;
-a b c
-1 4 3
-UPDATE t1 SET c = '4' WHERE a = 1;
-SELECT b FROM t1 WHERE a = 1;
-b
-4
-SELECT * FROM t1 WHERE a = 1;
-a b c
-1 4 4
-COMMIT;
-SELECT * FROM t1 ORDER BY 1;
-a b c
-1 4 4
-2 2 2
-3 3 3
-UPDATE t1 SET b = '5' WHERE a = 1;
-SELECT * FROM t1 ORDER BY 1;
-a b c
-1 5 4
-2 2 2
-3 3 3
-UPDATE t1 SET b = '6' WHERE b = '5';
-SELECT * FROM t1 ORDER BY 1;
-a b c
-1 6 4
-2 2 2
-3 3 3
-UPDATE t1 SET b = '7'WHERE c = '4';
-SELECT * FROM t1 ORDER BY 1;
-a b c
-1 7 4
-2 2 2
-3 3 3
-UPDATE t1 SET c = '5' WHERE a = 1;
-SELECT * FROM t1 ORDER BY 1;
-a b c
-1 7 5
-2 2 2
-3 3 3
-UPDATE t1 SET c = '6' WHERE b = '7';
-SELECT * FROM t1 ORDER BY 1;
-a b c
-1 7 6
-2 2 2
-3 3 3
-UPDATE t1 SET c = '7' WHERE c = '6';
-SELECT * FROM t1 ORDER BY 1;
-a b c
-1 7 7
-2 2 2
-3 3 3
-DROP TABLE t1;
-CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(4) NOT NULL, c CHAR(4) NOT NULL, KEY(b)) TABLESPACE ts1 STORAGE DISK ENGINE NDB;
-INSERT INTO t1 VALUE (1,'1','1'), (2,'2','2'), (3,'3','3');
-BEGIN;
-UPDATE t1 SET b = '2' WHERE a = 1;
-SELECT b FROM t1 WHERE a = 1;
-b
-2
-SELECT * FROM t1 WHERE a = 1;
-a b c
-1 2 1
-UPDATE t1 SET c = '2' WHERE a = 1;
-SELECT b FROM t1 WHERE a = 1;
-b
-2
-SELECT * FROM t1 WHERE a = 1;
-a b c
-1 2 2
-UPDATE t1 SET b = '3' WHERE a = 1;
-SELECT b FROM t1 WHERE a = 1;
-b
-3
-SELECT * FROM t1 WHERE a = 1;
-a b c
-1 3 2
-COMMIT;
-SELECT * FROM t1 ORDER BY 1;
-a b c
-1 3 2
-2 2 2
-3 3 3
-BEGIN;
-UPDATE t1 SET c = '3' WHERE a = 1;
-SELECT b FROM t1 WHERE a = 1;
-b
-3
-SELECT * FROM t1 WHERE a = 1;
-a b c
-1 3 3
-UPDATE t1 SET b = '4' WHERE a = 1;
-SELECT b FROM t1 WHERE a = 1;
-b
-4
-SELECT * FROM t1 WHERE a = 1;
-a b c
-1 4 3
-UPDATE t1 SET c = '4' WHERE a = 1;
-SELECT b FROM t1 WHERE a = 1;
-b
-4
-SELECT * FROM t1 WHERE a = 1;
-a b c
-1 4 4
-COMMIT;
-SELECT * FROM t1 ORDER BY 1;
-a b c
-1 4 4
-2 2 2
-3 3 3
-UPDATE t1 SET b = '5' WHERE a = 1;
-SELECT * FROM t1 ORDER BY 1;
-a b c
-1 5 4
-2 2 2
-3 3 3
-UPDATE t1 SET b = '6' WHERE b = '5';
-SELECT * FROM t1 ORDER BY 1;
-a b c
-1 6 4
-2 2 2
-3 3 3
-UPDATE t1 SET b = '7' WHERE c = '4';
-SELECT * FROM t1 ORDER BY 1;
-a b c
-1 7 4
-2 2 2
-3 3 3
-UPDATE t1 SET c = '5' WHERE a = 1;
-SELECT * FROM t1 ORDER BY 1;
-a b c
-1 7 5
-2 2 2
-3 3 3
-UPDATE t1 SET c = '6' WHERE b = '7';
-SELECT * FROM t1 ORDER BY 1;
-a b c
-1 7 6
-2 2 2
-3 3 3
-UPDATE t1 SET c = '7' WHERE c = '6';
-SELECT * FROM t1 ORDER BY 1;
-a b c
-1 7 7
-2 2 2
-3 3 3
-DROP TABLE t1;
-CREATE TABLE t1 (
-a INT NOT NULL PRIMARY KEY,
-b TEXT NOT NULL
-) TABLESPACE ts1 STORAGE DISK ENGINE=NDBCLUSTER;
-set @x0 = '01234567012345670123456701234567';
-set @x0 = concat(@x0,@x0,@x0,@x0,@x0,@x0,@x0,@x0);
-set @b1 = 'b1';
-set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
-set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
-set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
-set @b1 = concat(@b1,@x0);
-set @b2 = 'b2';
-set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
-set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
-set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
-set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
-INSERT INTO t1 VALUES(1,@b1);
-INSERT INTO t1 VALUES(2,@b2);
-SELECT a,length(b),substr(b,1+2*900,2) FROM t1 WHERE a=1;
-a length(b) substr(b,1+2*900,2)
-1 2256 b1
-SELECT a,length(b),substr(b,1+2*9000,2) FROM t1 WHERE a=2;
-a length(b) substr(b,1+2*9000,2)
-2 20000 b2
-UPDATE t1 SET b=@b2 WHERE a=1;
-UPDATE t1 SET b=@b1 WHERE a=2;
-SELECT a,length(b),substr(b,1+2*9000,2) FROM t1 WHERE a=1;
-a length(b) substr(b,1+2*9000,2)
-1 20000 b2
-SELECT a,length(b),substr(b,1+2*900,2) FROM t1 WHERE a=2;
-a length(b) substr(b,1+2*900,2)
-2 2256 b1
-UPDATE t1 SET b=concat(b,b) WHERE a=1;
-UPDATE t1 SET b=concat(b,b) WHERE a=2;
-SELECT a,length(b),substr(b,1+4*9000,2) FROM t1 WHERE a=1;
-a length(b) substr(b,1+4*9000,2)
-1 40000 b2
-SELECT a,length(b),substr(b,1+4*900,2) FROM t1 WHERE a=2;
-a length(b) substr(b,1+4*900,2)
-2 4512 b1
-DELETE FROM t1 WHERE a=1;
-DELETE FROM t1 WHERE a=2;
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-0
-DROP TABLE t1;
-CREATE TABLE t1 (
-a int NOT NULL,
-b varchar(4000), -- must use 2 pages undo
-PRIMARY KEY using hash (a)
-)
-TABLESPACE ts1 STORAGE DISK ENGINE=NDBCLUSTER;
-set autocommit = 0;
-insert into t1 values(0,'x');
-insert into t1 values(1,'x');
-insert into t1 values(2,'x');
-insert into t1 values(3,'x');
-insert into t1 values(4,'x');
-insert into t1 values(5,'x');
-insert into t1 values(6,'x');
-insert into t1 values(7,'x');
-insert into t1 values(8,'x');
-delete from t1 where a = 0;
-commit;
-delete from t1;
-begin;
-insert into t1 values (1, 'x');
-select * from t1;
-a b
-1 x
-rollback;
-set autocommit = 1;
-drop table t1;
-create table test.t1 (f1 varchar(50) primary key, f2 text,f3 int)
-TABLESPACE ts1 STORAGE DISK engine=NDB;
-insert into test.t1 (f1,f2,f3)VALUES("111111","aaaaaa",1);
-insert into test.t1 (f1,f2,f3)VALUES("222222","bbbbbb",2);
-select * from test.t1 order by f1;
-f1 f2 f3
-111111 aaaaaa 1
-222222 bbbbbb 2
-select f1,f2 from test.t1 order by f2;
-f1 f2
-111111 aaaaaa
-222222 bbbbbb
-select f2 from test.t1 order by f2;
-f2
-aaaaaa
-bbbbbb
-select f1,f2 from test.t1 order by f1;
-f1 f2
-111111 aaaaaa
-222222 bbbbbb
-drop table test.t1;
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile.dat'
-ENGINE = NDB;
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile02.dat'
-ENGINE = NDB;
-DROP TABLESPACE ts1
-ENGINE = NDB;
-DROP LOGFILE GROUP lg1
-ENGINE =NDB;
diff --git a/mysql-test/r/ndb_dd_ddl.result b/mysql-test/r/ndb_dd_ddl.result
deleted file mode 100644
index 67857d39ab6..00000000000
--- a/mysql-test/r/ndb_dd_ddl.result
+++ /dev/null
@@ -1,240 +0,0 @@
-DROP TABLE IF EXISTS t1;
-DROP DATABASE IF EXISTS mysqltest;
-CREATE DATABASE mysqltest;
-**** Begin Duplicate Statement Testing ****
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-INITIAL_SIZE 1M
-UNDO_BUFFER_SIZE = 1M
-ENGINE=NDB;
-CREATE LOGFILE GROUP lg2
-ADD UNDOFILE 'undofile2.dat'
-INITIAL_SIZE 1M
-UNDO_BUFFER_SIZE 1M
-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
-Error 1516 Failed to create LOGFILE GROUP
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-INITIAL_SIZE 1M
-UNDO_BUFFER_SIZE = 1M
-ENGINE=NDB;
-ERROR HY000: Failed to create LOGFILE GROUP
-ALTER LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile02.dat'
-INITIAL_SIZE 1M ENGINE NDB;
-ALTER LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile02.dat'
-INITIAL_SIZE 1M ENGINE=NDB;
-ERROR HY000: Failed to alter: CREATE UNDOFILE
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 1M
-ENGINE NDB;
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 1M
-ENGINE NDB;
-ERROR HY000: Failed to create TABLESPACE
-ALTER TABLESPACE ts1
-ADD DATAFILE 'datafile2.dat'
-INITIAL_SIZE 1M
-ENGINE=NDB;
-ALTER TABLESPACE ts1
-ADD DATAFILE 'datafile2.dat'
-INITIAL_SIZE 1M
-ENGINE=NDB;
-ERROR HY000: Failed to alter: CREATE DATAFILE
-CREATE TABLE mysqltest.t1
-(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
-TABLESPACE ts1 STORAGE DISK
-ENGINE=NDB;
-CREATE TABLE mysqltest.t1
-(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
-TABLESPACE ts1 STORAGE DISK
-ENGINE=NDB;
-ERROR 42S01: Table 't1' already exists
-CREATE TABLE mysqltest.t1
-(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
-ENGINE=NDB;
-ERROR 42S01: Table 't1' already exists
-DROP TABLE mysqltest.t1;
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile2.dat'
-ENGINE=NDB;
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile2.dat'
-ENGINE=NDB;
-ERROR HY000: Failed to alter: NO SUCH FILE
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile.dat'
-ENGINE=NDB;
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile.dat'
-ENGINE=NDB;
-ERROR HY000: Failed to alter: NO SUCH FILE
-DROP TABLESPACE ts1
-ENGINE=NDB;
-DROP TABLESPACE ts1
-ENGINE=NDB;
-ERROR HY000: Failed to drop TABLESPACE
-DROP LOGFILE GROUP lg1
-ENGINE=NDB;
-DROP LOGFILE GROUP lg1
-ENGINE=NDB;
-ERROR HY000: Failed to drop LOGFILE GROUP
-DROP DATABASE IF EXISTS mysqltest;
-**** End Duplicate Statement Testing ****
-
-**** Begin Statment CaSe Testing ****
-creaTE LOgfilE GrOuP lg1
-adD undoFILE 'undofile.dat'
-initiAL_siZE 1M
-UnDo_BuFfEr_SiZe = 1M
-ENGInE=NDb;
-altER LOgFiLE GrOUp lg1
-AdD UnDOfILe 'uNdOfiLe02.daT'
-INItIAl_SIzE 1M ENgINE nDB;
-CrEAtE TABLEspaCE ts1
-ADD DATAfilE 'datafile.dat'
-UsE LoGFiLE GRoUP lg1
-INITiaL_SizE 1M
-ENGiNe NDb;
-AlTeR tAbLeSpAcE ts1
-AdD DaTaFiLe 'dAtAfiLe2.daT'
-InItIaL_SiZe 1M
-EnGiNe=NDB;
-CREATE TABLE t1
-(pk1 int not null primary key, b int not null, c int not null)
-TABLEspace ts1 storAGE dISk
-ENGine nDb;
-DROP TABLE t1;
-AlteR TAblespaCE ts1
-droP DATAfile 'dAtAfiLe2.daT'
-ENGINE=NDB;
-ALter tablesPACE ts1
-dROp dAtAfIlE 'datafile.dat'
-ENGine=Ndb;
-DrOp TaBleSpAcE ts1
-engINE=ndB;
-DrOp lOgFiLe GrOuP lg1
-EnGiNe=nDb;
-**** End Statment CaSe Testing ****
-
-**** Begin = And No = Testing ****
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-INITIAL_SIZE=1M
-UNDO_BUFFER_SIZE=1M
-ENGINE=NDB;
-ALTER LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile02.dat'
-INITIAL_SIZE=1M
-ENGINE=NDB;
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE=1M
-ENGINE=NDB;
-ALTER TABLESPACE ts1
-ADD DATAFILE 'datafile2.dat'
-INITIAL_SIZE=1M
-ENGINE=NDB;
-CREATE TABLE t1
-(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
-TABLESPACE ts1 STORAGE DISK
-ENGINE=NDB;
-DROP TABLE t1;
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile2.dat'
-ENGINE=NDB;
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile.dat'
-ENGINE=NDB;
-DROP TABLESPACE ts1
-ENGINE=NDB;
-DROP LOGFILE GROUP lg1
-ENGINE=NDB;
-
-**** End of = ****
-
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-INITIAL_SIZE 1M
-UNDO_BUFFER_SIZE 1M
-ENGINE NDB;
-ALTER LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile02.dat'
-INITIAL_SIZE 1M
-ENGINE NDB;
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 1M
-ENGINE NDB;
-ALTER TABLESPACE ts1
-ADD DATAFILE 'datafile2.dat'
-INITIAL_SIZE 1M
-ENGINE NDB;
-CREATE TABLE t1
-(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
-TABLESPACE ts1 STORAGE MEMORY
-ENGINE NDB;
-ERROR HY000: Can't create table 'test.t1' (errno: 138)
-CREATE TABLE t1
-(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
-TABLESPACE ts1 STORAGE DISK
-ENGINE NDB;
-CREATE INDEX b_i on t1(b);
-CREATE INDEX bc_i on t1(b, c);
-DROP TABLE t1;
-CREATE TABLESPACE ts2
-ADD DATAFILE 'datafile3.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 1M
-ENGINE NDB;
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile3.dat'
-ENGINE NDB;
-ERROR HY000: Failed to alter: NO SUCH FILE
-ALTER TABLESPACE ts2
-DROP DATAFILE 'datafile2.dat'
-ENGINE NDB;
-ERROR HY000: Failed to alter: NO SUCH FILE
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile2.dat'
-ENGINE NDB;
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile.dat'
-ENGINE NDB;
-DROP TABLESPACE ts1
-ENGINE NDB;
-ALTER TABLESPACE ts2
-DROP DATAFILE 'datafile3.dat'
-ENGINE NDB;
-DROP TABLESPACE ts2
-ENGINE NDB;
-DROP LOGFILE GROUP lg1
-ENGINE NDB;
-**** End = And No = ****
-create table t1 (a int primary key) engine = myisam;
-create logfile group lg1 add undofile 'MYSQLTEST_VARDIR/master-data/test/t1.frm' initial_size 1M undo_buffer_size = 1M engine=ndb;;
-ERROR HY000: Failed to create UNDOFILE
-create logfile group lg1
-add undofile 'undofile.dat'
-initial_size 1M
-undo_buffer_size = 1M
-engine=ndb;
-create tablespace ts1 add datafile 'MYSQLTEST_VARDIR/master-data/test/t1.frm' use logfile group lg1 initial_size 1M engine ndb;;
-ERROR HY000: Failed to create DATAFILE
-drop tablespace ts1
-engine ndb;
-ERROR HY000: Failed to drop TABLESPACE
-drop logfile group lg1
-engine ndb;
-drop table t1;
diff --git a/mysql-test/r/ndb_dd_dump.result b/mysql-test/r/ndb_dd_dump.result
deleted file mode 100644
index 9b1a1295588..00000000000
--- a/mysql-test/r/ndb_dd_dump.result
+++ /dev/null
@@ -1,218 +0,0 @@
-DROP TABLE IF EXISTS t1, t2, t3;
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile_lg1_01.dat'
-INITIAL_SIZE 2M
-UNDO_BUFFER_SIZE = 1M
-ENGINE NDB;
-ALTER LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile_lg1_02.dat'
-INITIAL_SIZE = 4M
-ENGINE NDB;
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile_ts1_01.dat'
-USE LOGFILE GROUP lg1
-EXTENT_SIZE 1M
-INITIAL_SIZE 2M
-ENGINE NDB;
-ALTER TABLESPACE ts1
-ADD DATAFILE 'datafile_ts1_02.dat'
-INITIAL_SIZE = 1M
-ENGINE=NDB;
-CREATE TABLESPACE ts2
-ADD DATAFILE 'datafile_ts2_01.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 2M
-ENGINE NDB;
-CREATE TABLESPACE ts3
-ADD DATAFILE 'datafile_ts3_01.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 4M
-ENGINE NDB;
-CREATE TABLE t1
-(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
-TABLESPACE ts1 STORAGE DISK
-ENGINE=NDB;
-CREATE TABLE t2
-(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
-TABLESPACE ts2 STORAGE DISK
-ENGINE=NDB;
-CREATE TABLE t3
-(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
-TABLESPACE ts3 STORAGE DISK
-ENGINE=NDB;
-INSERT INTO t1 VALUES
-(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
-(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10),
-(11,11,11),(12,12,12),(13,13,13),(14,14,14),(15,15,15),
-(16,16,16),(17,17,17),(18,18,18),(19,19,19),(20,20,20),
-(21,21,21),(22,22,22),(23,23,23),(24,24,24),(25,25,25),
-(26,26,26),(27,27,27),(28,28,28),(29,29,29),(30,30,30),
-(31,31,31),(32,32,32),(33,33,33),(34,34,34),(35,35,35),
-(36,36,36),(37,37,37),(38,38,38),(39,39,39),(40,40,40),
-(41,41,41),(42,42,42),(43,43,43),(44,44,44),(45,45,45),
-(46,46,46),(47,47,47),(48,48,48),(49,49,49),(50,50,50),
-(51,51,51),(52,52,52),(53,53,53),(54,54,54),(55,55,55),
-(56,56,56),(57,57,57),(58,58,58),(59,59,59),(60,60,60),
-(61,61,61),(62,62,62),(63,63,63),(64,64,64),(65,65,65),
-(66,66,66),(67,67,67),(68,68,68),(69,69,69),(70,70,70),
-(71,71,71),(72,72,72),(73,73,73),(74,74,74),(75,75,75),
-(76,76,76),(77,77,77),(78,78,78),(79,79,79),(80,80,80),
-(81,81,81),(82,82,82),(83,83,83),(84,84,84),(85,85,85),
-(86,86,86),(87,87,87),(88,88,88),(89,89,89),(90,90,90),
-(91,91,91),(92,92,92),(93,93,93),(94,94,94),(95,95,95),
-(96,96,96),(97,97,97),(98,98,98),(99,99,99),(100,100,100),
-(101,101,101),(102,102,102),(103,103,103),(104,104,104),(105,105,105),
-(106,106,106),(107,107,107),(108,108,108),(109,109,109),(110,110,110),
-(111,111,111),(112,112,112),(113,113,113),(114,114,114),(115,115,115),
-(116,116,116),(117,117,117),(118,118,118),(119,119,119),(120,120,120),
-(121,121,121),(122,122,122),(123,123,123),(124,124,124),(125,125,125),
-(126,126,126),(127,127,127),(128,128,128),(129,129,129),(130,130,130),
-(131,131,131),(132,132,132),(133,133,133),(134,134,134),(135,135,135),
-(136,136,136),(137,137,137),(138,138,138),(139,139,139),(140,140,140),
-(141,141,141),(142,142,142),(143,143,143),(144,144,144),(145,145,145),
-(146,146,146),(147,147,147),(148,148,148),(149,149,149),(150,150,150),
-(151,151,151),(152,152,152),(153,153,153),(154,154,154),(155,155,155),
-(156,156,156),(157,157,157),(158,158,158),(159,159,159),(160,160,160),
-(161,161,161),(162,162,162),(163,163,163),(164,164,164),(165,165,165),
-(166,166,166),(167,167,167),(168,168,168),(169,169,169),(170,170,170),
-(171,171,171),(172,172,172),(173,173,173),(174,174,174),(175,175,175),
-(176,176,176),(177,177,177),(178,178,178),(179,179,179),(180,180,180),
-(181,181,181),(182,182,182),(183,183,183),(184,184,184),(185,185,185),
-(186,186,186),(187,187,187),(188,188,188),(189,189,189),(190,190,190),
-(191,191,191),(192,192,192),(193,193,193),(194,194,194),(195,195,195),
-(196,196,196),(197,197,197),(198,198,198),(199,199,199),(200,200,200),
-(201,201,201),(202,202,202),(203,203,203),(204,204,204),(205,205,205),
-(206,206,206),(207,207,207),(208,208,208),(209,209,209),(210,210,210),
-(211,211,211),(212,212,212),(213,213,213),(214,214,214),(215,215,215),
-(216,216,216),(217,217,217),(218,218,218),(219,219,219),(220,220,220),
-(221,221,221),(222,222,222),(223,223,223),(224,224,224),(225,225,225),
-(226,226,226),(227,227,227),(228,228,228),(229,229,229),(230,230,230),
-(231,231,231),(232,232,232),(233,233,233),(234,234,234),(235,235,235),
-(236,236,236),(237,237,237),(238,238,238),(239,239,239),(240,240,240),
-(241,241,241),(242,242,242),(243,243,243),(244,244,244),(245,245,245),
-(246,246,246),(247,247,247),(248,248,248),(249,249,249),(250,250,250),
-(251,251,251),(252,252,252),(253,253,253),(254,254,254),(255,255,255),
-(256,256,256),(257,257,257),(258,258,258),(259,259,259),(260,260,260),
-(261,261,261),(262,262,262),(263,263,263),(264,264,264),(265,265,265),
-(266,266,266),(267,267,267),(268,268,268),(269,269,269),(270,270,270),
-(271,271,271),(272,272,272),(273,273,273),(274,274,274),(275,275,275),
-(276,276,276),(277,277,277),(278,278,278),(279,279,279),(280,280,280),
-(281,281,281),(282,282,282),(283,283,283),(284,284,284),(285,285,285),
-(286,286,286),(287,287,287),(288,288,288),(289,289,289),(290,290,290),
-(291,291,291),(292,292,292),(293,293,293),(294,294,294),(295,295,295),
-(296,296,296),(297,297,297),(298,298,298),(299,299,299),(300,300,300),
-(301,301,301),(302,302,302),(303,303,303),(304,304,304),(305,305,305),
-(306,306,306),(307,307,307),(308,308,308),(309,309,309),(310,310,310),
-(311,311,311),(312,312,312),(313,313,313),(314,314,314),(315,315,315),
-(316,316,316),(317,317,317),(318,318,318),(319,319,319),(320,320,320),
-(321,321,321),(322,322,322),(323,323,323),(324,324,324),(325,325,325),
-(326,326,326),(327,327,327),(328,328,328),(329,329,329),(330,330,330),
-(331,331,331),(332,332,332),(333,333,333),(334,334,334),(335,335,335),
-(336,336,336),(337,337,337),(338,338,338),(339,339,339),(340,340,340),
-(341,341,341),(342,342,342),(343,343,343),(344,344,344),(345,345,345),
-(346,346,346),(347,347,347),(348,348,348),(349,349,349),(350,350,350),
-(351,351,351),(352,352,352),(353,353,353),(354,354,354),(355,355,355),
-(356,356,356),(357,357,357),(358,358,358),(359,359,359),(360,360,360),
-(361,361,361),(362,362,362),(363,363,363),(364,364,364),(365,365,365),
-(366,366,366),(367,367,367),(368,368,368),(369,369,369),(370,370,370),
-(371,371,371),(372,372,372),(373,373,373),(374,374,374),(375,375,375),
-(376,376,376),(377,377,377),(378,378,378),(379,379,379),(380,380,380),
-(381,381,381),(382,382,382),(383,383,383),(384,384,384),(385,385,385),
-(386,386,386),(387,387,387),(388,388,388),(389,389,389),(390,390,390),
-(391,391,391),(392,392,392),(393,393,393),(394,394,394),(395,395,395),
-(396,396,396),(397,397,397),(398,398,398),(399,399,399),(400,400,400),
-(401,401,401),(402,402,402),(403,403,403),(404,404,404),(405,405,405),
-(406,406,406),(407,407,407),(408,408,408),(409,409,409),(410,410,410),
-(411,411,411),(412,412,412),(413,413,413),(414,414,414),(415,415,415),
-(416,416,416),(417,417,417),(418,418,418),(419,419,419),(420,420,420),
-(421,421,421),(422,422,422),(423,423,423),(424,424,424),(425,425,425),
-(426,426,426),(427,427,427),(428,428,428),(429,429,429),(430,430,430),
-(431,431,431),(432,432,432),(433,433,433),(434,434,434),(435,435,435),
-(436,436,436),(437,437,437),(438,438,438),(439,439,439),(440,440,440),
-(441,441,441),(442,442,442),(443,443,443),(444,444,444),(445,445,445),
-(446,446,446),(447,447,447),(448,448,448),(449,449,449),(450,450,450),
-(451,451,451),(452,452,452),(453,453,453),(454,454,454),(455,455,455),
-(456,456,456),(457,457,457),(458,458,458),(459,459,459),(460,460,460),
-(461,461,461),(462,462,462),(463,463,463),(464,464,464),(465,465,465),
-(466,466,466),(467,467,467),(468,468,468),(469,469,469),(470,470,470),
-(471,471,471),(472,472,472),(473,473,473),(474,474,474),(475,475,475),
-(476,476,476),(477,477,477),(478,478,478),(479,479,479),(480,480,480),
-(481,481,481),(482,482,482),(483,483,483),(484,484,484),(485,485,485),
-(486,486,486),(487,487,487),(488,488,488),(489,489,489),(490,490,490),
-(491,491,491),(492,492,492),(493,493,493),(494,494,494),(495,495,495),
-(496,496,496),(497,497,497),(498,498,498),(499,499,499),(500, 500, 500);
-INSERT INTO t2 VALUES
-(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5);
-INSERT INTO t3 VALUES
-(1,1,1);
-DROP TABLE t1;
-DROP TABLE t2;
-DROP TABLE t3;
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile_ts1_01.dat'
-ENGINE = NDB;
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile_ts1_02.dat'
-ENGINE = NDB;
-ALTER TABLESPACE ts2
-DROP DATAFILE 'datafile_ts2_01.dat'
-ENGINE = NDB;
-ALTER TABLESPACE ts3
-DROP DATAFILE 'datafile_ts3_01.dat'
-ENGINE = NDB;
-DROP TABLESPACE ts1 ENGINE = NDB;
-DROP TABLESPACE ts2 ENGINE = NDB;
-DROP TABLESPACE ts3 ENGINE = NDB;
-DROP LOGFILE GROUP lg1 ENGINE = NDB;
-SELECT DISTINCT
-LOGFILE_GROUP_NAME,
-FILE_NAME,
-TOTAL_EXTENTS,
-INITIAL_SIZE,
-ENGINE
-FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE="UNDO LOG" ORDER BY FILE_NAME;
-LOGFILE_GROUP_NAME FILE_NAME TOTAL_EXTENTS INITIAL_SIZE ENGINE
-lg1 NULL NULL NULL ndbcluster
-lg1 undofile_lg1_01.dat 524288 2097152 ndbcluster
-lg1 undofile_lg1_02.dat 1048576 4194304 ndbcluster
-SELECT DISTINCT
-TABLESPACE_NAME,
-LOGFILE_GROUP_NAME,
-FILE_NAME,
-EXTENT_SIZE,
-INITIAL_SIZE,
-ENGINE
-FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE="DATAFILE" ORDER BY FILE_NAME;
-TABLESPACE_NAME LOGFILE_GROUP_NAME FILE_NAME EXTENT_SIZE INITIAL_SIZE ENGINE
-ts1 lg1 datafile_ts1_01.dat 1048576 2097152 ndbcluster
-ts1 lg1 datafile_ts1_02.dat 1048576 1048576 ndbcluster
-ts2 lg1 datafile_ts2_01.dat 1048576 2097152 ndbcluster
-ts3 lg1 datafile_ts3_01.dat 1048576 4194304 ndbcluster
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-500
-SELECT COUNT(*) FROM t2;
-COUNT(*)
-5
-SELECT COUNT(*) FROM t3;
-COUNT(*)
-1
-DROP TABLE t1;
-DROP TABLE t2;
-DROP TABLE t3;
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile_ts1_01.dat'
-ENGINE = NDB;
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile_ts1_02.dat'
-ENGINE = NDB;
-ALTER TABLESPACE ts2
-DROP DATAFILE 'datafile_ts2_01.dat'
-ENGINE = NDB;
-ALTER TABLESPACE ts3
-DROP DATAFILE 'datafile_ts3_01.dat'
-ENGINE = NDB;
-DROP TABLESPACE ts1 ENGINE = NDB;
-DROP TABLESPACE ts2 ENGINE = NDB;
-DROP TABLESPACE ts3 ENGINE = NDB;
-DROP LOGFILE GROUP lg1 ENGINE = NDB;
diff --git a/mysql-test/r/ndb_gis.result b/mysql-test/r/ndb_gis.result
deleted file mode 100644
index c01c1673e44..00000000000
--- a/mysql-test/r/ndb_gis.result
+++ /dev/null
@@ -1,1100 +0,0 @@
-SET storage_engine=ndbcluster;
-DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
-CREATE TABLE gis_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT);
-CREATE TABLE gis_line (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g LINESTRING);
-CREATE TABLE gis_polygon (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POLYGON);
-CREATE TABLE gis_multi_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g MULTIPOINT);
-CREATE TABLE gis_multi_line (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g MULTILINESTRING);
-CREATE TABLE gis_multi_polygon (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g MULTIPOLYGON);
-CREATE TABLE gis_geometrycollection (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g GEOMETRYCOLLECTION);
-CREATE TABLE gis_geometry (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g GEOMETRY);
-SHOW CREATE TABLE gis_point;
-Table Create Table
-gis_point CREATE TABLE `gis_point` (
- `fid` int(11) NOT NULL AUTO_INCREMENT,
- `g` point DEFAULT NULL,
- PRIMARY KEY (`fid`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-SHOW FIELDS FROM gis_point;
-Field Type Null Key Default Extra
-fid int(11) NO PRI NULL auto_increment
-g point YES NULL
-SHOW FIELDS FROM gis_line;
-Field Type Null Key Default Extra
-fid int(11) NO PRI NULL auto_increment
-g linestring YES NULL
-SHOW FIELDS FROM gis_polygon;
-Field Type Null Key Default Extra
-fid int(11) NO PRI NULL auto_increment
-g polygon YES NULL
-SHOW FIELDS FROM gis_multi_point;
-Field Type Null Key Default Extra
-fid int(11) NO PRI NULL auto_increment
-g multipoint YES NULL
-SHOW FIELDS FROM gis_multi_line;
-Field Type Null Key Default Extra
-fid int(11) NO PRI NULL auto_increment
-g multilinestring YES NULL
-SHOW FIELDS FROM gis_multi_polygon;
-Field Type Null Key Default Extra
-fid int(11) NO PRI NULL auto_increment
-g multipolygon YES NULL
-SHOW FIELDS FROM gis_geometrycollection;
-Field Type Null Key Default Extra
-fid int(11) NO PRI NULL auto_increment
-g geometrycollection YES NULL
-SHOW FIELDS FROM gis_geometry;
-Field Type Null Key Default Extra
-fid int(11) NO PRI NULL auto_increment
-g geometry YES NULL
-INSERT INTO gis_point VALUES
-(101, PointFromText('POINT(10 10)')),
-(102, PointFromText('POINT(20 10)')),
-(103, PointFromText('POINT(20 20)')),
-(104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)'))));
-INSERT INTO gis_line VALUES
-(105, LineFromText('LINESTRING(0 0,0 10,10 0)')),
-(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')),
-(107, LineStringFromWKB(LineString(Point(10, 10), Point(40, 10))));
-INSERT INTO gis_polygon VALUES
-(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')),
-(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')),
-(110, PolyFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))));
-INSERT INTO gis_multi_point VALUES
-(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')),
-(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')),
-(113, MPointFromWKB(MultiPoint(Point(3, 6), Point(4, 10))));
-INSERT INTO gis_multi_line VALUES
-(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')),
-(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')),
-(116, MLineFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))));
-INSERT INTO gis_multi_polygon VALUES
-(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
-(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
-(119, MPolyFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))));
-INSERT INTO gis_geometrycollection VALUES
-(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')),
-(121, GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))));
-INSERT into gis_geometry SELECT * FROM gis_point;
-INSERT into gis_geometry SELECT * FROM gis_line;
-INSERT into gis_geometry SELECT * FROM gis_polygon;
-INSERT into gis_geometry SELECT * FROM gis_multi_point;
-INSERT into gis_geometry SELECT * FROM gis_multi_line;
-INSERT into gis_geometry SELECT * FROM gis_multi_polygon;
-INSERT into gis_geometry SELECT * FROM gis_geometrycollection;
-SELECT fid, AsText(g) FROM gis_point ORDER by fid;
-fid AsText(g)
-101 POINT(10 10)
-102 POINT(20 10)
-103 POINT(20 20)
-104 POINT(10 20)
-SELECT fid, AsText(g) FROM gis_line ORDER by fid;
-fid AsText(g)
-105 LINESTRING(0 0,0 10,10 0)
-106 LINESTRING(10 10,20 10,20 20,10 20,10 10)
-107 LINESTRING(10 10,40 10)
-SELECT fid, AsText(g) FROM gis_polygon ORDER by fid;
-fid AsText(g)
-108 POLYGON((10 10,20 10,20 20,10 20,10 10))
-109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10))
-110 POLYGON((0 0,30 0,30 30,0 0))
-SELECT fid, AsText(g) FROM gis_multi_point ORDER by fid;
-fid AsText(g)
-111 MULTIPOINT(0 0,10 10,10 20,20 20)
-112 MULTIPOINT(1 1,11 11,11 21,21 21)
-113 MULTIPOINT(3 6,4 10)
-SELECT fid, AsText(g) FROM gis_multi_line ORDER by fid;
-fid AsText(g)
-114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))
-115 MULTILINESTRING((10 48,10 21,10 0))
-116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7))
-SELECT fid, AsText(g) FROM gis_multi_polygon ORDER by fid;
-fid AsText(g)
-117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
-118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
-119 MULTIPOLYGON(((0 3,3 3,3 0,0 3)))
-SELECT fid, AsText(g) FROM gis_geometrycollection ORDER by fid;
-fid AsText(g)
-120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10))
-121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9))
-SELECT fid, AsText(g) FROM gis_geometry ORDER by fid;
-fid AsText(g)
-101 POINT(10 10)
-102 POINT(20 10)
-103 POINT(20 20)
-104 POINT(10 20)
-105 LINESTRING(0 0,0 10,10 0)
-106 LINESTRING(10 10,20 10,20 20,10 20,10 10)
-107 LINESTRING(10 10,40 10)
-108 POLYGON((10 10,20 10,20 20,10 20,10 10))
-109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10))
-110 POLYGON((0 0,30 0,30 30,0 0))
-111 MULTIPOINT(0 0,10 10,10 20,20 20)
-112 MULTIPOINT(1 1,11 11,11 21,21 21)
-113 MULTIPOINT(3 6,4 10)
-114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))
-115 MULTILINESTRING((10 48,10 21,10 0))
-116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7))
-117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
-118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
-119 MULTIPOLYGON(((0 3,3 3,3 0,0 3)))
-120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10))
-121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9))
-SELECT fid, Dimension(g) FROM gis_geometry ORDER by fid;
-fid Dimension(g)
-101 0
-102 0
-103 0
-104 0
-105 1
-106 1
-107 1
-108 2
-109 2
-110 2
-111 0
-112 0
-113 0
-114 1
-115 1
-116 1
-117 2
-118 2
-119 2
-120 1
-121 1
-SELECT fid, GeometryType(g) FROM gis_geometry ORDER by fid;
-fid GeometryType(g)
-101 POINT
-102 POINT
-103 POINT
-104 POINT
-105 LINESTRING
-106 LINESTRING
-107 LINESTRING
-108 POLYGON
-109 POLYGON
-110 POLYGON
-111 MULTIPOINT
-112 MULTIPOINT
-113 MULTIPOINT
-114 MULTILINESTRING
-115 MULTILINESTRING
-116 MULTILINESTRING
-117 MULTIPOLYGON
-118 MULTIPOLYGON
-119 MULTIPOLYGON
-120 GEOMETRYCOLLECTION
-121 GEOMETRYCOLLECTION
-SELECT fid, IsEmpty(g) FROM gis_geometry ORDER by fid;
-fid IsEmpty(g)
-101 0
-102 0
-103 0
-104 0
-105 0
-106 0
-107 0
-108 0
-109 0
-110 0
-111 0
-112 0
-113 0
-114 0
-115 0
-116 0
-117 0
-118 0
-119 0
-120 0
-121 0
-SELECT fid, AsText(Envelope(g)) FROM gis_geometry ORDER by fid;
-fid AsText(Envelope(g))
-101 POLYGON((10 10,10 10,10 10,10 10,10 10))
-102 POLYGON((20 10,20 10,20 10,20 10,20 10))
-103 POLYGON((20 20,20 20,20 20,20 20,20 20))
-104 POLYGON((10 20,10 20,10 20,10 20,10 20))
-105 POLYGON((0 0,10 0,10 10,0 10,0 0))
-106 POLYGON((10 10,20 10,20 20,10 20,10 10))
-107 POLYGON((10 10,40 10,40 10,10 10,10 10))
-108 POLYGON((10 10,20 10,20 20,10 20,10 10))
-109 POLYGON((0 0,50 0,50 50,0 50,0 0))
-110 POLYGON((0 0,30 0,30 30,0 30,0 0))
-111 POLYGON((0 0,20 0,20 20,0 20,0 0))
-112 POLYGON((1 1,21 1,21 21,1 21,1 1))
-113 POLYGON((3 6,4 6,4 10,3 10,3 6))
-114 POLYGON((10 0,16 0,16 48,10 48,10 0))
-115 POLYGON((10 0,10 0,10 48,10 48,10 0))
-116 POLYGON((1 2,21 2,21 8,1 8,1 2))
-117 POLYGON((28 0,84 0,84 42,28 42,28 0))
-118 POLYGON((28 0,84 0,84 42,28 42,28 0))
-119 POLYGON((0 0,3 0,3 3,0 3,0 0))
-120 POLYGON((0 0,10 0,10 10,0 10,0 0))
-121 POLYGON((3 6,44 6,44 9,3 9,3 6))
-explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelope(g)) from gis_geometry;
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE gis_geometry ALL NULL NULL NULL NULL 21 100.00
-Warnings:
-Note 1003 select dimension(`test`.`gis_geometry`.`g`) AS `Dimension(g)`,geometrytype(`test`.`gis_geometry`.`g`) AS `GeometryType(g)`,isempty(`test`.`gis_geometry`.`g`) AS `IsEmpty(g)`,astext(envelope(`test`.`gis_geometry`.`g`)) AS `AsText(Envelope(g))` from `test`.`gis_geometry`
-SELECT fid, X(g) FROM gis_point ORDER by fid;
-fid X(g)
-101 10
-102 20
-103 20
-104 10
-SELECT fid, Y(g) FROM gis_point ORDER by fid;
-fid Y(g)
-101 10
-102 10
-103 20
-104 20
-explain extended select X(g),Y(g) FROM gis_point;
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE gis_point ALL NULL NULL NULL NULL 4 100.00
-Warnings:
-Note 1003 select x(`test`.`gis_point`.`g`) AS `X(g)`,y(`test`.`gis_point`.`g`) AS `Y(g)` from `test`.`gis_point`
-SELECT fid, AsText(StartPoint(g)) FROM gis_line ORDER by fid;
-fid AsText(StartPoint(g))
-105 POINT(0 0)
-106 POINT(10 10)
-107 POINT(10 10)
-SELECT fid, AsText(EndPoint(g)) FROM gis_line ORDER by fid;
-fid AsText(EndPoint(g))
-105 POINT(10 0)
-106 POINT(10 10)
-107 POINT(40 10)
-SELECT fid, GLength(g) FROM gis_line ORDER by fid;
-fid GLength(g)
-105 24.142135623731
-106 40
-107 30
-SELECT fid, NumPoints(g) FROM gis_line ORDER by fid;
-fid NumPoints(g)
-105 3
-106 5
-107 2
-SELECT fid, AsText(PointN(g, 2)) FROM gis_line ORDER by fid;
-fid AsText(PointN(g, 2))
-105 POINT(0 10)
-106 POINT(20 10)
-107 POINT(40 10)
-SELECT fid, IsClosed(g) FROM gis_line ORDER by fid;
-fid IsClosed(g)
-105 0
-106 1
-107 0
-explain extended select AsText(StartPoint(g)),AsText(EndPoint(g)),GLength(g),NumPoints(g),AsText(PointN(g, 2)),IsClosed(g) FROM gis_line;
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE gis_line ALL NULL NULL NULL NULL 3 100.00
-Warnings:
-Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint(g))`,astext(endpoint(`test`.`gis_line`.`g`)) AS `AsText(EndPoint(g))`,glength(`test`.`gis_line`.`g`) AS `GLength(g)`,numpoints(`test`.`gis_line`.`g`) AS `NumPoints(g)`,astext(pointn(`test`.`gis_line`.`g`,2)) AS `AsText(PointN(g, 2))`,isclosed(`test`.`gis_line`.`g`) AS `IsClosed(g)` from `test`.`gis_line`
-SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid;
-fid AsText(Centroid(g))
-108 POINT(15 15)
-109 POINT(25.416666666667 25.416666666667)
-110 POINT(20 10)
-SELECT fid, Area(g) FROM gis_polygon ORDER by fid;
-fid Area(g)
-108 100
-109 2400
-110 450
-SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon ORDER by fid;
-fid AsText(ExteriorRing(g))
-108 LINESTRING(10 10,20 10,20 20,10 20,10 10)
-109 LINESTRING(0 0,50 0,50 50,0 50,0 0)
-110 LINESTRING(0 0,30 0,30 30,0 0)
-SELECT fid, NumInteriorRings(g) FROM gis_polygon ORDER by fid;
-fid NumInteriorRings(g)
-108 0
-109 1
-110 0
-SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon ORDER by fid;
-fid AsText(InteriorRingN(g, 1))
-108 NULL
-109 LINESTRING(10 10,20 10,20 20,10 20,10 10)
-110 NULL
-explain extended select AsText(Centroid(g)),Area(g),AsText(ExteriorRing(g)),NumInteriorRings(g),AsText(InteriorRingN(g, 1)) FROM gis_polygon;
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE gis_polygon ALL NULL NULL NULL NULL 3 100.00
-Warnings:
-Note 1003 select astext(centroid(`test`.`gis_polygon`.`g`)) AS `AsText(Centroid(g))`,area(`test`.`gis_polygon`.`g`) AS `Area(g)`,astext(exteriorring(`test`.`gis_polygon`.`g`)) AS `AsText(ExteriorRing(g))`,numinteriorrings(`test`.`gis_polygon`.`g`) AS `NumInteriorRings(g)`,astext(interiorringn(`test`.`gis_polygon`.`g`,1)) AS `AsText(InteriorRingN(g, 1))` from `test`.`gis_polygon`
-SELECT fid, IsClosed(g) FROM gis_multi_line ORDER by fid;
-fid IsClosed(g)
-114 0
-115 0
-116 0
-SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
-fid AsText(Centroid(g))
-117 POINT(55.588527753042 17.426536064114)
-118 POINT(55.588527753042 17.426536064114)
-119 POINT(2 2)
-SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
-fid Area(g)
-117 1684.5
-118 1684.5
-119 4.5
-SELECT fid, NumGeometries(g) from gis_multi_point ORDER by fid;
-fid NumGeometries(g)
-111 4
-112 4
-113 2
-SELECT fid, NumGeometries(g) from gis_multi_line ORDER by fid;
-fid NumGeometries(g)
-114 2
-115 1
-116 2
-SELECT fid, NumGeometries(g) from gis_multi_polygon ORDER by fid;
-fid NumGeometries(g)
-117 2
-118 2
-119 1
-SELECT fid, NumGeometries(g) from gis_geometrycollection ORDER by fid;
-fid NumGeometries(g)
-120 2
-121 2
-explain extended SELECT fid, NumGeometries(g) from gis_multi_point;
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3 100.00
-Warnings:
-Note 1003 select `test`.`gis_multi_point`.`fid` AS `fid`,numgeometries(`test`.`gis_multi_point`.`g`) AS `NumGeometries(g)` from `test`.`gis_multi_point`
-SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point ORDER by fid;
-fid AsText(GeometryN(g, 2))
-111 POINT(10 10)
-112 POINT(11 11)
-113 POINT(4 10)
-SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line ORDER by fid;
-fid AsText(GeometryN(g, 2))
-114 LINESTRING(16 0,16 23,16 48)
-115 NULL
-116 LINESTRING(2 5,5 8,21 7)
-SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon ORDER by fid;
-fid AsText(GeometryN(g, 2))
-117 POLYGON((59 18,67 18,67 13,59 13,59 18))
-118 POLYGON((59 18,67 18,67 13,59 13,59 18))
-119 NULL
-SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection ORDER by fid;
-fid AsText(GeometryN(g, 2))
-120 LINESTRING(0 0,10 10)
-121 LINESTRING(3 6,7 9)
-SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection ORDER by fid;
-fid AsText(GeometryN(g, 1))
-120 POINT(0 0)
-121 POINT(44 6)
-explain extended SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point;
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3 100.00
-Warnings:
-Note 1003 select `test`.`gis_multi_point`.`fid` AS `fid`,astext(geometryn(`test`.`gis_multi_point`.`g`,2)) AS `AsText(GeometryN(g, 2))` from `test`.`gis_multi_point`
-SELECT g1.fid as first, g2.fid as second,
-Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
-Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
-Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
-FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
-first second w c o e d t i r
-120 120 1 1 0 1 0 0 1 0
-120 121 0 0 1 0 0 0 1 0
-121 120 0 0 1 0 0 0 1 0
-121 121 1 1 0 1 0 0 1 0
-explain extended SELECT g1.fid as first, g2.fid as second,
-Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
-Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
-Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
-FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE g1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort; Using join cache
-1 SIMPLE g2 ALL NULL NULL NULL NULL 2 100.00
-Warnings:
-Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,overlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,equals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,disjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,intersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid`
-DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
-CREATE TABLE t1 (
-a INTEGER PRIMARY KEY AUTO_INCREMENT,
-gp point,
-ln linestring,
-pg polygon,
-mp multipoint,
-mln multilinestring,
-mpg multipolygon,
-gc geometrycollection,
-gm geometry
-);
-SHOW FIELDS FROM t1;
-Field Type Null Key Default Extra
-a int(11) NO PRI NULL auto_increment
-gp point YES NULL
-ln linestring YES NULL
-pg polygon YES NULL
-mp multipoint YES NULL
-mln multilinestring YES NULL
-mpg multipolygon YES NULL
-gc geometrycollection YES NULL
-gm geometry YES NULL
-ALTER TABLE t1 ADD fid INT;
-SHOW FIELDS FROM t1;
-Field Type Null Key Default Extra
-a int(11) NO PRI NULL auto_increment
-gp point YES NULL
-ln linestring YES NULL
-pg polygon YES NULL
-mp multipoint YES NULL
-mln multilinestring YES NULL
-mpg multipolygon YES NULL
-gc geometrycollection YES NULL
-gm geometry YES NULL
-fid int(11) YES NULL
-DROP TABLE t1;
-create table t1 (pk integer primary key auto_increment, a geometry not null);
-insert into t1 (a) values (GeomFromText('Point(1 2)'));
-insert into t1 (a) values ('Garbage');
-ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
-insert IGNORE into t1 (a) values ('Garbage');
-ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
-drop table t1;
-create table t1 (pk integer primary key auto_increment, fl geometry not null);
-insert into t1 (fl) values (1);
-ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
-insert into t1 (fl) values (1.11);
-ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
-insert into t1 (fl) values ("qwerty");
-ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
-insert into t1 (fl) values (pointfromtext('point(1,1)'));
-ERROR 23000: Column 'fl' cannot be null
-drop table t1;
-End of 4.1 tests
-CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY);
-Warnings:
-Error 1466 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))'));
-INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))'));
-INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))'));
-INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))'));
-INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))'));
-INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))'));
-INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))'));
-INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))'));
-INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))'));
-INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))'));
-INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))'));
-INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))'));
-INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))'));
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-mbrcontains
-center,small
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrdisjoint FROM t1 a1 JOIN t1 a2 ON MBRDisjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-mbrdisjoint
-down3,left3,right3,up3
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrequal FROM t1 a1 JOIN t1 a2 ON MBREqual( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-mbrequal
-center
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrintersect FROM t1 a1 JOIN t1 a2 ON MBRIntersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-mbrintersect
-big,center,down,down2,left,left2,right,right2,small,up,up2
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbroverlaps FROM t1 a1 JOIN t1 a2 ON MBROverlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-mbroverlaps
-down,left,right,up
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-mbrtouches
-down2,left2,right2,up2
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-mbrwithin
-big,center
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains FROM t1 a1 JOIN t1 a2 ON Contains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-contains
-center,small
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint FROM t1 a1 JOIN t1 a2 ON Disjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-disjoint
-down3,left3,right3,up3
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS equals FROM t1 a1 JOIN t1 a2 ON Equals( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-equals
-center
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersect FROM t1 a1 JOIN t1 a2 ON Intersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-intersect
-big,center,down,down2,left,left2,right,right2,small,up,up2
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS overlaps FROM t1 a1 JOIN t1 a2 ON Overlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-overlaps
-down,left,right,up
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-touches
-down2,left2,right2,up2
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-within
-big,center
-SET @vert1 = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))');
-SET @horiz1 = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))');
-SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))');
-SET @horiz3 = GeomFromText('POLYGON ((2 0, 3 0, 2 0))');
-SET @point1 = GeomFromText('POLYGON ((0 0))');
-SET @point2 = GeomFromText('POLYGON ((-2 0))');
-SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @vert1) GROUP BY a1.name;
-overlaps
-SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @horiz1) GROUP BY a1.name;
-overlaps
-SELECT Overlaps(@horiz1, @vert1) FROM DUAL;
-Overlaps(@horiz1, @vert1)
-0
-SELECT Overlaps(@horiz1, @horiz2) FROM DUAL;
-Overlaps(@horiz1, @horiz2)
-1
-SELECT Overlaps(@horiz1, @horiz3) FROM DUAL;
-Overlaps(@horiz1, @horiz3)
-0
-SELECT Overlaps(@horiz1, @point1) FROM DUAL;
-Overlaps(@horiz1, @point1)
-0
-SELECT Overlaps(@horiz1, @point2) FROM DUAL;
-Overlaps(@horiz1, @point2)
-0
-DROP TABLE t1;
-End of 5.0 tests
-set engine_condition_pushdown = on;
-DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
-CREATE TABLE gis_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT);
-CREATE TABLE gis_line (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g LINESTRING);
-CREATE TABLE gis_polygon (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POLYGON);
-CREATE TABLE gis_multi_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g MULTIPOINT);
-CREATE TABLE gis_multi_line (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g MULTILINESTRING);
-CREATE TABLE gis_multi_polygon (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g MULTIPOLYGON);
-CREATE TABLE gis_geometrycollection (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g GEOMETRYCOLLECTION);
-CREATE TABLE gis_geometry (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g GEOMETRY);
-SHOW CREATE TABLE gis_point;
-Table Create Table
-gis_point CREATE TABLE `gis_point` (
- `fid` int(11) NOT NULL AUTO_INCREMENT,
- `g` point DEFAULT NULL,
- PRIMARY KEY (`fid`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-SHOW FIELDS FROM gis_point;
-Field Type Null Key Default Extra
-fid int(11) NO PRI NULL auto_increment
-g point YES NULL
-SHOW FIELDS FROM gis_line;
-Field Type Null Key Default Extra
-fid int(11) NO PRI NULL auto_increment
-g linestring YES NULL
-SHOW FIELDS FROM gis_polygon;
-Field Type Null Key Default Extra
-fid int(11) NO PRI NULL auto_increment
-g polygon YES NULL
-SHOW FIELDS FROM gis_multi_point;
-Field Type Null Key Default Extra
-fid int(11) NO PRI NULL auto_increment
-g multipoint YES NULL
-SHOW FIELDS FROM gis_multi_line;
-Field Type Null Key Default Extra
-fid int(11) NO PRI NULL auto_increment
-g multilinestring YES NULL
-SHOW FIELDS FROM gis_multi_polygon;
-Field Type Null Key Default Extra
-fid int(11) NO PRI NULL auto_increment
-g multipolygon YES NULL
-SHOW FIELDS FROM gis_geometrycollection;
-Field Type Null Key Default Extra
-fid int(11) NO PRI NULL auto_increment
-g geometrycollection YES NULL
-SHOW FIELDS FROM gis_geometry;
-Field Type Null Key Default Extra
-fid int(11) NO PRI NULL auto_increment
-g geometry YES NULL
-INSERT INTO gis_point VALUES
-(101, PointFromText('POINT(10 10)')),
-(102, PointFromText('POINT(20 10)')),
-(103, PointFromText('POINT(20 20)')),
-(104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)'))));
-INSERT INTO gis_line VALUES
-(105, LineFromText('LINESTRING(0 0,0 10,10 0)')),
-(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')),
-(107, LineStringFromWKB(LineString(Point(10, 10), Point(40, 10))));
-INSERT INTO gis_polygon VALUES
-(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')),
-(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')),
-(110, PolyFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))));
-INSERT INTO gis_multi_point VALUES
-(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')),
-(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')),
-(113, MPointFromWKB(MultiPoint(Point(3, 6), Point(4, 10))));
-INSERT INTO gis_multi_line VALUES
-(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')),
-(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')),
-(116, MLineFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))));
-INSERT INTO gis_multi_polygon VALUES
-(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
-(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
-(119, MPolyFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))));
-INSERT INTO gis_geometrycollection VALUES
-(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')),
-(121, GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))));
-INSERT into gis_geometry SELECT * FROM gis_point;
-INSERT into gis_geometry SELECT * FROM gis_line;
-INSERT into gis_geometry SELECT * FROM gis_polygon;
-INSERT into gis_geometry SELECT * FROM gis_multi_point;
-INSERT into gis_geometry SELECT * FROM gis_multi_line;
-INSERT into gis_geometry SELECT * FROM gis_multi_polygon;
-INSERT into gis_geometry SELECT * FROM gis_geometrycollection;
-SELECT fid, AsText(g) FROM gis_point ORDER by fid;
-fid AsText(g)
-101 POINT(10 10)
-102 POINT(20 10)
-103 POINT(20 20)
-104 POINT(10 20)
-SELECT fid, AsText(g) FROM gis_line ORDER by fid;
-fid AsText(g)
-105 LINESTRING(0 0,0 10,10 0)
-106 LINESTRING(10 10,20 10,20 20,10 20,10 10)
-107 LINESTRING(10 10,40 10)
-SELECT fid, AsText(g) FROM gis_polygon ORDER by fid;
-fid AsText(g)
-108 POLYGON((10 10,20 10,20 20,10 20,10 10))
-109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10))
-110 POLYGON((0 0,30 0,30 30,0 0))
-SELECT fid, AsText(g) FROM gis_multi_point ORDER by fid;
-fid AsText(g)
-111 MULTIPOINT(0 0,10 10,10 20,20 20)
-112 MULTIPOINT(1 1,11 11,11 21,21 21)
-113 MULTIPOINT(3 6,4 10)
-SELECT fid, AsText(g) FROM gis_multi_line ORDER by fid;
-fid AsText(g)
-114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))
-115 MULTILINESTRING((10 48,10 21,10 0))
-116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7))
-SELECT fid, AsText(g) FROM gis_multi_polygon ORDER by fid;
-fid AsText(g)
-117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
-118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
-119 MULTIPOLYGON(((0 3,3 3,3 0,0 3)))
-SELECT fid, AsText(g) FROM gis_geometrycollection ORDER by fid;
-fid AsText(g)
-120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10))
-121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9))
-SELECT fid, AsText(g) FROM gis_geometry ORDER by fid;
-fid AsText(g)
-101 POINT(10 10)
-102 POINT(20 10)
-103 POINT(20 20)
-104 POINT(10 20)
-105 LINESTRING(0 0,0 10,10 0)
-106 LINESTRING(10 10,20 10,20 20,10 20,10 10)
-107 LINESTRING(10 10,40 10)
-108 POLYGON((10 10,20 10,20 20,10 20,10 10))
-109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10))
-110 POLYGON((0 0,30 0,30 30,0 0))
-111 MULTIPOINT(0 0,10 10,10 20,20 20)
-112 MULTIPOINT(1 1,11 11,11 21,21 21)
-113 MULTIPOINT(3 6,4 10)
-114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))
-115 MULTILINESTRING((10 48,10 21,10 0))
-116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7))
-117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
-118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
-119 MULTIPOLYGON(((0 3,3 3,3 0,0 3)))
-120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10))
-121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9))
-SELECT fid, Dimension(g) FROM gis_geometry ORDER by fid;
-fid Dimension(g)
-101 0
-102 0
-103 0
-104 0
-105 1
-106 1
-107 1
-108 2
-109 2
-110 2
-111 0
-112 0
-113 0
-114 1
-115 1
-116 1
-117 2
-118 2
-119 2
-120 1
-121 1
-SELECT fid, GeometryType(g) FROM gis_geometry ORDER by fid;
-fid GeometryType(g)
-101 POINT
-102 POINT
-103 POINT
-104 POINT
-105 LINESTRING
-106 LINESTRING
-107 LINESTRING
-108 POLYGON
-109 POLYGON
-110 POLYGON
-111 MULTIPOINT
-112 MULTIPOINT
-113 MULTIPOINT
-114 MULTILINESTRING
-115 MULTILINESTRING
-116 MULTILINESTRING
-117 MULTIPOLYGON
-118 MULTIPOLYGON
-119 MULTIPOLYGON
-120 GEOMETRYCOLLECTION
-121 GEOMETRYCOLLECTION
-SELECT fid, IsEmpty(g) FROM gis_geometry ORDER by fid;
-fid IsEmpty(g)
-101 0
-102 0
-103 0
-104 0
-105 0
-106 0
-107 0
-108 0
-109 0
-110 0
-111 0
-112 0
-113 0
-114 0
-115 0
-116 0
-117 0
-118 0
-119 0
-120 0
-121 0
-SELECT fid, AsText(Envelope(g)) FROM gis_geometry ORDER by fid;
-fid AsText(Envelope(g))
-101 POLYGON((10 10,10 10,10 10,10 10,10 10))
-102 POLYGON((20 10,20 10,20 10,20 10,20 10))
-103 POLYGON((20 20,20 20,20 20,20 20,20 20))
-104 POLYGON((10 20,10 20,10 20,10 20,10 20))
-105 POLYGON((0 0,10 0,10 10,0 10,0 0))
-106 POLYGON((10 10,20 10,20 20,10 20,10 10))
-107 POLYGON((10 10,40 10,40 10,10 10,10 10))
-108 POLYGON((10 10,20 10,20 20,10 20,10 10))
-109 POLYGON((0 0,50 0,50 50,0 50,0 0))
-110 POLYGON((0 0,30 0,30 30,0 30,0 0))
-111 POLYGON((0 0,20 0,20 20,0 20,0 0))
-112 POLYGON((1 1,21 1,21 21,1 21,1 1))
-113 POLYGON((3 6,4 6,4 10,3 10,3 6))
-114 POLYGON((10 0,16 0,16 48,10 48,10 0))
-115 POLYGON((10 0,10 0,10 48,10 48,10 0))
-116 POLYGON((1 2,21 2,21 8,1 8,1 2))
-117 POLYGON((28 0,84 0,84 42,28 42,28 0))
-118 POLYGON((28 0,84 0,84 42,28 42,28 0))
-119 POLYGON((0 0,3 0,3 3,0 3,0 0))
-120 POLYGON((0 0,10 0,10 10,0 10,0 0))
-121 POLYGON((3 6,44 6,44 9,3 9,3 6))
-explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelope(g)) from gis_geometry;
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE gis_geometry ALL NULL NULL NULL NULL 21 100.00
-Warnings:
-Note 1003 select dimension(`test`.`gis_geometry`.`g`) AS `Dimension(g)`,geometrytype(`test`.`gis_geometry`.`g`) AS `GeometryType(g)`,isempty(`test`.`gis_geometry`.`g`) AS `IsEmpty(g)`,astext(envelope(`test`.`gis_geometry`.`g`)) AS `AsText(Envelope(g))` from `test`.`gis_geometry`
-SELECT fid, X(g) FROM gis_point ORDER by fid;
-fid X(g)
-101 10
-102 20
-103 20
-104 10
-SELECT fid, Y(g) FROM gis_point ORDER by fid;
-fid Y(g)
-101 10
-102 10
-103 20
-104 20
-explain extended select X(g),Y(g) FROM gis_point;
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE gis_point ALL NULL NULL NULL NULL 4 100.00
-Warnings:
-Note 1003 select x(`test`.`gis_point`.`g`) AS `X(g)`,y(`test`.`gis_point`.`g`) AS `Y(g)` from `test`.`gis_point`
-SELECT fid, AsText(StartPoint(g)) FROM gis_line ORDER by fid;
-fid AsText(StartPoint(g))
-105 POINT(0 0)
-106 POINT(10 10)
-107 POINT(10 10)
-SELECT fid, AsText(EndPoint(g)) FROM gis_line ORDER by fid;
-fid AsText(EndPoint(g))
-105 POINT(10 0)
-106 POINT(10 10)
-107 POINT(40 10)
-SELECT fid, GLength(g) FROM gis_line ORDER by fid;
-fid GLength(g)
-105 24.142135623731
-106 40
-107 30
-SELECT fid, NumPoints(g) FROM gis_line ORDER by fid;
-fid NumPoints(g)
-105 3
-106 5
-107 2
-SELECT fid, AsText(PointN(g, 2)) FROM gis_line ORDER by fid;
-fid AsText(PointN(g, 2))
-105 POINT(0 10)
-106 POINT(20 10)
-107 POINT(40 10)
-SELECT fid, IsClosed(g) FROM gis_line ORDER by fid;
-fid IsClosed(g)
-105 0
-106 1
-107 0
-explain extended select AsText(StartPoint(g)),AsText(EndPoint(g)),GLength(g),NumPoints(g),AsText(PointN(g, 2)),IsClosed(g) FROM gis_line;
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE gis_line ALL NULL NULL NULL NULL 3 100.00
-Warnings:
-Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint(g))`,astext(endpoint(`test`.`gis_line`.`g`)) AS `AsText(EndPoint(g))`,glength(`test`.`gis_line`.`g`) AS `GLength(g)`,numpoints(`test`.`gis_line`.`g`) AS `NumPoints(g)`,astext(pointn(`test`.`gis_line`.`g`,2)) AS `AsText(PointN(g, 2))`,isclosed(`test`.`gis_line`.`g`) AS `IsClosed(g)` from `test`.`gis_line`
-SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid;
-fid AsText(Centroid(g))
-108 POINT(15 15)
-109 POINT(25.416666666667 25.416666666667)
-110 POINT(20 10)
-SELECT fid, Area(g) FROM gis_polygon ORDER by fid;
-fid Area(g)
-108 100
-109 2400
-110 450
-SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon ORDER by fid;
-fid AsText(ExteriorRing(g))
-108 LINESTRING(10 10,20 10,20 20,10 20,10 10)
-109 LINESTRING(0 0,50 0,50 50,0 50,0 0)
-110 LINESTRING(0 0,30 0,30 30,0 0)
-SELECT fid, NumInteriorRings(g) FROM gis_polygon ORDER by fid;
-fid NumInteriorRings(g)
-108 0
-109 1
-110 0
-SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon ORDER by fid;
-fid AsText(InteriorRingN(g, 1))
-108 NULL
-109 LINESTRING(10 10,20 10,20 20,10 20,10 10)
-110 NULL
-explain extended select AsText(Centroid(g)),Area(g),AsText(ExteriorRing(g)),NumInteriorRings(g),AsText(InteriorRingN(g, 1)) FROM gis_polygon;
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE gis_polygon ALL NULL NULL NULL NULL 3 100.00
-Warnings:
-Note 1003 select astext(centroid(`test`.`gis_polygon`.`g`)) AS `AsText(Centroid(g))`,area(`test`.`gis_polygon`.`g`) AS `Area(g)`,astext(exteriorring(`test`.`gis_polygon`.`g`)) AS `AsText(ExteriorRing(g))`,numinteriorrings(`test`.`gis_polygon`.`g`) AS `NumInteriorRings(g)`,astext(interiorringn(`test`.`gis_polygon`.`g`,1)) AS `AsText(InteriorRingN(g, 1))` from `test`.`gis_polygon`
-SELECT fid, IsClosed(g) FROM gis_multi_line ORDER by fid;
-fid IsClosed(g)
-114 0
-115 0
-116 0
-SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
-fid AsText(Centroid(g))
-117 POINT(55.588527753042 17.426536064114)
-118 POINT(55.588527753042 17.426536064114)
-119 POINT(2 2)
-SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
-fid Area(g)
-117 1684.5
-118 1684.5
-119 4.5
-SELECT fid, NumGeometries(g) from gis_multi_point ORDER by fid;
-fid NumGeometries(g)
-111 4
-112 4
-113 2
-SELECT fid, NumGeometries(g) from gis_multi_line ORDER by fid;
-fid NumGeometries(g)
-114 2
-115 1
-116 2
-SELECT fid, NumGeometries(g) from gis_multi_polygon ORDER by fid;
-fid NumGeometries(g)
-117 2
-118 2
-119 1
-SELECT fid, NumGeometries(g) from gis_geometrycollection ORDER by fid;
-fid NumGeometries(g)
-120 2
-121 2
-explain extended SELECT fid, NumGeometries(g) from gis_multi_point;
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3 100.00
-Warnings:
-Note 1003 select `test`.`gis_multi_point`.`fid` AS `fid`,numgeometries(`test`.`gis_multi_point`.`g`) AS `NumGeometries(g)` from `test`.`gis_multi_point`
-SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point ORDER by fid;
-fid AsText(GeometryN(g, 2))
-111 POINT(10 10)
-112 POINT(11 11)
-113 POINT(4 10)
-SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line ORDER by fid;
-fid AsText(GeometryN(g, 2))
-114 LINESTRING(16 0,16 23,16 48)
-115 NULL
-116 LINESTRING(2 5,5 8,21 7)
-SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon ORDER by fid;
-fid AsText(GeometryN(g, 2))
-117 POLYGON((59 18,67 18,67 13,59 13,59 18))
-118 POLYGON((59 18,67 18,67 13,59 13,59 18))
-119 NULL
-SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection ORDER by fid;
-fid AsText(GeometryN(g, 2))
-120 LINESTRING(0 0,10 10)
-121 LINESTRING(3 6,7 9)
-SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection ORDER by fid;
-fid AsText(GeometryN(g, 1))
-120 POINT(0 0)
-121 POINT(44 6)
-explain extended SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point;
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3 100.00
-Warnings:
-Note 1003 select `test`.`gis_multi_point`.`fid` AS `fid`,astext(geometryn(`test`.`gis_multi_point`.`g`,2)) AS `AsText(GeometryN(g, 2))` from `test`.`gis_multi_point`
-SELECT g1.fid as first, g2.fid as second,
-Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
-Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
-Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
-FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
-first second w c o e d t i r
-120 120 1 1 0 1 0 0 1 0
-120 121 0 0 1 0 0 0 1 0
-121 120 0 0 1 0 0 0 1 0
-121 121 1 1 0 1 0 0 1 0
-explain extended SELECT g1.fid as first, g2.fid as second,
-Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
-Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
-Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
-FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE g1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort; Using join cache
-1 SIMPLE g2 ALL NULL NULL NULL NULL 2 100.00
-Warnings:
-Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,overlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,equals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,disjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,intersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid`
-DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
-CREATE TABLE t1 (
-a INTEGER PRIMARY KEY AUTO_INCREMENT,
-gp point,
-ln linestring,
-pg polygon,
-mp multipoint,
-mln multilinestring,
-mpg multipolygon,
-gc geometrycollection,
-gm geometry
-);
-SHOW FIELDS FROM t1;
-Field Type Null Key Default Extra
-a int(11) NO PRI NULL auto_increment
-gp point YES NULL
-ln linestring YES NULL
-pg polygon YES NULL
-mp multipoint YES NULL
-mln multilinestring YES NULL
-mpg multipolygon YES NULL
-gc geometrycollection YES NULL
-gm geometry YES NULL
-ALTER TABLE t1 ADD fid INT;
-SHOW FIELDS FROM t1;
-Field Type Null Key Default Extra
-a int(11) NO PRI NULL auto_increment
-gp point YES NULL
-ln linestring YES NULL
-pg polygon YES NULL
-mp multipoint YES NULL
-mln multilinestring YES NULL
-mpg multipolygon YES NULL
-gc geometrycollection YES NULL
-gm geometry YES NULL
-fid int(11) YES NULL
-DROP TABLE t1;
-create table t1 (pk integer primary key auto_increment, a geometry not null);
-insert into t1 (a) values (GeomFromText('Point(1 2)'));
-insert into t1 (a) values ('Garbage');
-ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
-insert IGNORE into t1 (a) values ('Garbage');
-ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
-drop table t1;
-create table t1 (pk integer primary key auto_increment, fl geometry not null);
-insert into t1 (fl) values (1);
-ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
-insert into t1 (fl) values (1.11);
-ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
-insert into t1 (fl) values ("qwerty");
-ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
-insert into t1 (fl) values (pointfromtext('point(1,1)'));
-ERROR 23000: Column 'fl' cannot be null
-drop table t1;
-End of 4.1 tests
-CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY);
-Warnings:
-Error 1466 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))'));
-INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))'));
-INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))'));
-INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))'));
-INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))'));
-INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))'));
-INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))'));
-INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))'));
-INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))'));
-INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))'));
-INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))'));
-INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))'));
-INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))'));
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-mbrcontains
-center,small
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrdisjoint FROM t1 a1 JOIN t1 a2 ON MBRDisjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-mbrdisjoint
-down3,left3,right3,up3
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrequal FROM t1 a1 JOIN t1 a2 ON MBREqual( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-mbrequal
-center
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrintersect FROM t1 a1 JOIN t1 a2 ON MBRIntersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-mbrintersect
-big,center,down,down2,left,left2,right,right2,small,up,up2
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbroverlaps FROM t1 a1 JOIN t1 a2 ON MBROverlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-mbroverlaps
-down,left,right,up
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-mbrtouches
-down2,left2,right2,up2
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-mbrwithin
-big,center
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains FROM t1 a1 JOIN t1 a2 ON Contains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-contains
-center,small
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint FROM t1 a1 JOIN t1 a2 ON Disjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-disjoint
-down3,left3,right3,up3
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS equals FROM t1 a1 JOIN t1 a2 ON Equals( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-equals
-center
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersect FROM t1 a1 JOIN t1 a2 ON Intersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-intersect
-big,center,down,down2,left,left2,right,right2,small,up,up2
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS overlaps FROM t1 a1 JOIN t1 a2 ON Overlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-overlaps
-down,left,right,up
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-touches
-down2,left2,right2,up2
-SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
-within
-big,center
-SET @vert1 = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))');
-SET @horiz1 = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))');
-SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))');
-SET @horiz3 = GeomFromText('POLYGON ((2 0, 3 0, 2 0))');
-SET @point1 = GeomFromText('POLYGON ((0 0))');
-SET @point2 = GeomFromText('POLYGON ((-2 0))');
-SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @vert1) GROUP BY a1.name;
-overlaps
-SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @horiz1) GROUP BY a1.name;
-overlaps
-SELECT Overlaps(@horiz1, @vert1) FROM DUAL;
-Overlaps(@horiz1, @vert1)
-0
-SELECT Overlaps(@horiz1, @horiz2) FROM DUAL;
-Overlaps(@horiz1, @horiz2)
-1
-SELECT Overlaps(@horiz1, @horiz3) FROM DUAL;
-Overlaps(@horiz1, @horiz3)
-0
-SELECT Overlaps(@horiz1, @point1) FROM DUAL;
-Overlaps(@horiz1, @point1)
-0
-SELECT Overlaps(@horiz1, @point2) FROM DUAL;
-Overlaps(@horiz1, @point2)
-0
-DROP TABLE t1;
-End of 5.0 tests
diff --git a/mysql-test/r/ndb_insert.result b/mysql-test/r/ndb_insert.result
deleted file mode 100644
index 7551dc71823..00000000000
--- a/mysql-test/r/ndb_insert.result
+++ /dev/null
@@ -1,659 +0,0 @@
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (
-pk1 INT NOT NULL PRIMARY KEY,
-b INT NOT NULL,
-c INT NOT NULL
-) ENGINE=ndbcluster;
-INSERT INTO t1 VALUES (0, 0, 0);
-SELECT * FROM t1;
-pk1 b c
-0 0 0
-INSERT INTO t1 VALUES
-(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
-(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10),
-(11,11,11),(12,12,12),(13,13,13),(14,14,14),(15,15,15),
-(16,16,16),(17,17,17),(18,18,18),(19,19,19),(20,20,20),
-(21,21,21),(22,22,22),(23,23,23),(24,24,24),(25,25,25),
-(26,26,26),(27,27,27),(28,28,28),(29,29,29),(30,30,30),
-(31,31,31),(32,32,32),(33,33,33),(34,34,34),(35,35,35),
-(36,36,36),(37,37,37),(38,38,38),(39,39,39),(40,40,40),
-(41,41,41),(42,42,42),(43,43,43),(44,44,44),(45,45,45),
-(46,46,46),(47,47,47),(48,48,48),(49,49,49),(50,50,50),
-(51,51,51),(52,52,52),(53,53,53),(54,54,54),(55,55,55),
-(56,56,56),(57,57,57),(58,58,58),(59,59,59),(60,60,60),
-(61,61,61),(62,62,62),(63,63,63),(64,64,64),(65,65,65),
-(66,66,66),(67,67,67),(68,68,68),(69,69,69),(70,70,70),
-(71,71,71),(72,72,72),(73,73,73),(74,74,74),(75,75,75),
-(76,76,76),(77,77,77),(78,78,78),(79,79,79),(80,80,80),
-(81,81,81),(82,82,82),(83,83,83),(84,84,84),(85,85,85),
-(86,86,86),(87,87,87),(88,88,88),(89,89,89),(90,90,90),
-(91,91,91),(92,92,92),(93,93,93),(94,94,94),(95,95,95),
-(96,96,96),(97,97,97),(98,98,98),(99,99,99),(100,100,100),
-(101,101,101),(102,102,102),(103,103,103),(104,104,104),(105,105,105),
-(106,106,106),(107,107,107),(108,108,108),(109,109,109),(110,110,110),
-(111,111,111),(112,112,112),(113,113,113),(114,114,114),(115,115,115),
-(116,116,116),(117,117,117),(118,118,118),(119,119,119),(120,120,120),
-(121,121,121),(122,122,122),(123,123,123),(124,124,124),(125,125,125),
-(126,126,126),(127,127,127),(128,128,128),(129,129,129),(130,130,130),
-(131,131,131),(132,132,132),(133,133,133),(134,134,134),(135,135,135),
-(136,136,136),(137,137,137),(138,138,138),(139,139,139),(140,140,140),
-(141,141,141),(142,142,142),(143,143,143),(144,144,144),(145,145,145),
-(146,146,146),(147,147,147),(148,148,148),(149,149,149),(150,150,150),
-(151,151,151),(152,152,152),(153,153,153),(154,154,154),(155,155,155),
-(156,156,156),(157,157,157),(158,158,158),(159,159,159),(160,160,160),
-(161,161,161),(162,162,162),(163,163,163),(164,164,164),(165,165,165),
-(166,166,166),(167,167,167),(168,168,168),(169,169,169),(170,170,170),
-(171,171,171),(172,172,172),(173,173,173),(174,174,174),(175,175,175),
-(176,176,176),(177,177,177),(178,178,178),(179,179,179),(180,180,180),
-(181,181,181),(182,182,182),(183,183,183),(184,184,184),(185,185,185),
-(186,186,186),(187,187,187),(188,188,188),(189,189,189),(190,190,190),
-(191,191,191),(192,192,192),(193,193,193),(194,194,194),(195,195,195),
-(196,196,196),(197,197,197),(198,198,198),(199,199,199),(200,200,200),
-(201,201,201),(202,202,202),(203,203,203),(204,204,204),(205,205,205),
-(206,206,206),(207,207,207),(208,208,208),(209,209,209),(210,210,210),
-(211,211,211),(212,212,212),(213,213,213),(214,214,214),(215,215,215),
-(216,216,216),(217,217,217),(218,218,218),(219,219,219),(220,220,220),
-(221,221,221),(222,222,222),(223,223,223),(224,224,224),(225,225,225),
-(226,226,226),(227,227,227),(228,228,228),(229,229,229),(230,230,230),
-(231,231,231),(232,232,232),(233,233,233),(234,234,234),(235,235,235),
-(236,236,236),(237,237,237),(238,238,238),(239,239,239),(240,240,240),
-(241,241,241),(242,242,242),(243,243,243),(244,244,244),(245,245,245),
-(246,246,246),(247,247,247),(248,248,248),(249,249,249),(250,250,250),
-(251,251,251),(252,252,252),(253,253,253),(254,254,254),(255,255,255),
-(256,256,256),(257,257,257),(258,258,258),(259,259,259),(260,260,260),
-(261,261,261),(262,262,262),(263,263,263),(264,264,264),(265,265,265),
-(266,266,266),(267,267,267),(268,268,268),(269,269,269),(270,270,270),
-(271,271,271),(272,272,272),(273,273,273),(274,274,274),(275,275,275),
-(276,276,276),(277,277,277),(278,278,278),(279,279,279),(280,280,280),
-(281,281,281),(282,282,282),(283,283,283),(284,284,284),(285,285,285),
-(286,286,286),(287,287,287),(288,288,288),(289,289,289),(290,290,290),
-(291,291,291),(292,292,292),(293,293,293),(294,294,294),(295,295,295),
-(296,296,296),(297,297,297),(298,298,298),(299,299,299),(300,300,300),
-(301,301,301),(302,302,302),(303,303,303),(304,304,304),(305,305,305),
-(306,306,306),(307,307,307),(308,308,308),(309,309,309),(310,310,310),
-(311,311,311),(312,312,312),(313,313,313),(314,314,314),(315,315,315),
-(316,316,316),(317,317,317),(318,318,318),(319,319,319),(320,320,320),
-(321,321,321),(322,322,322),(323,323,323),(324,324,324),(325,325,325),
-(326,326,326),(327,327,327),(328,328,328),(329,329,329),(330,330,330),
-(331,331,331),(332,332,332),(333,333,333),(334,334,334),(335,335,335),
-(336,336,336),(337,337,337),(338,338,338),(339,339,339),(340,340,340),
-(341,341,341),(342,342,342),(343,343,343),(344,344,344),(345,345,345),
-(346,346,346),(347,347,347),(348,348,348),(349,349,349),(350,350,350),
-(351,351,351),(352,352,352),(353,353,353),(354,354,354),(355,355,355),
-(356,356,356),(357,357,357),(358,358,358),(359,359,359),(360,360,360),
-(361,361,361),(362,362,362),(363,363,363),(364,364,364),(365,365,365),
-(366,366,366),(367,367,367),(368,368,368),(369,369,369),(370,370,370),
-(371,371,371),(372,372,372),(373,373,373),(374,374,374),(375,375,375),
-(376,376,376),(377,377,377),(378,378,378),(379,379,379),(380,380,380),
-(381,381,381),(382,382,382),(383,383,383),(384,384,384),(385,385,385),
-(386,386,386),(387,387,387),(388,388,388),(389,389,389),(390,390,390),
-(391,391,391),(392,392,392),(393,393,393),(394,394,394),(395,395,395),
-(396,396,396),(397,397,397),(398,398,398),(399,399,399),(400,400,400),
-(401,401,401),(402,402,402),(403,403,403),(404,404,404),(405,405,405),
-(406,406,406),(407,407,407),(408,408,408),(409,409,409),(410,410,410),
-(411,411,411),(412,412,412),(413,413,413),(414,414,414),(415,415,415),
-(416,416,416),(417,417,417),(418,418,418),(419,419,419),(420,420,420),
-(421,421,421),(422,422,422),(423,423,423),(424,424,424),(425,425,425),
-(426,426,426),(427,427,427),(428,428,428),(429,429,429),(430,430,430),
-(431,431,431),(432,432,432),(433,433,433),(434,434,434),(435,435,435),
-(436,436,436),(437,437,437),(438,438,438),(439,439,439),(440,440,440),
-(441,441,441),(442,442,442),(443,443,443),(444,444,444),(445,445,445),
-(446,446,446),(447,447,447),(448,448,448),(449,449,449),(450,450,450),
-(451,451,451),(452,452,452),(453,453,453),(454,454,454),(455,455,455),
-(456,456,456),(457,457,457),(458,458,458),(459,459,459),(460,460,460),
-(461,461,461),(462,462,462),(463,463,463),(464,464,464),(465,465,465),
-(466,466,466),(467,467,467),(468,468,468),(469,469,469),(470,470,470),
-(471,471,471),(472,472,472),(473,473,473),(474,474,474),(475,475,475),
-(476,476,476),(477,477,477),(478,478,478),(479,479,479),(480,480,480),
-(481,481,481),(482,482,482),(483,483,483),(484,484,484),(485,485,485),
-(486,486,486),(487,487,487),(488,488,488),(489,489,489),(490,490,490),
-(491,491,491),(492,492,492),(493,493,493),(494,494,494),(495,495,495),
-(496,496,496),(497,497,497),(498,498,498),(499,499,499),(500, 500, 500);
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-501
-INSERT INTO t1 VALUES
-(501,501,501),(502,502,502),(503,503,503),(504,504,504),(505,505,505),
-(506,506,506),(507,507,507),(508,508,508),(509,509,509),(510,510,510),
-(511,511,511),(512,512,512),(513,513,513),(514,514,514),(515,515,515),
-(516,516,516),(517,517,517),(518,518,518),(519,519,519),(520,520,520),
-(521,521,521),(522,522,522),(523,523,523),(524,524,524),(525,525,525),
-(526,526,526),(527,527,527),(528,528,528),(529,529,529),(530,530,530),
-(531,531,531),(532,532,532),(533,533,533),(534,534,534),(535,535,535),
-(536,536,536),(537,537,537),(538,538,538),(539,539,539),(540,540,540),
-(541,541,541),(542,542,542),(543,543,543),(544,544,544),(545,545,545),
-(546,546,546),(547,547,547),(548,548,548),(549,549,549),(550,550,550),
-(551,551,551),(552,552,552),(553,553,553),(554,554,554),(555,555,555),
-(556,556,556),(557,557,557),(558,558,558),(559,559,559),(560,560,560),
-(561,561,561),(562,562,562),(563,563,563),(564,564,564),(565,565,565),
-(566,566,566),(567,567,567),(568,568,568),(569,569,569),(570,570,570),
-(571,571,571),(572,572,572),(573,573,573),(574,574,574),(575,575,575),
-(576,576,576),(577,577,577),(578,578,578),(579,579,579),(580,580,580),
-(581,581,581),(582,582,582),(583,583,583),(584,584,584),(585,585,585),
-(586,586,586),(587,587,587),(588,588,588),(589,589,589),(590,590,590),
-(591,591,591),(592,592,592),(593,593,593),(594,594,594),(595,595,595),
-(596,596,596),(597,597,597),(598,598,598),(599,599,599),(600,600,600),
-(601,601,601),(602,602,602),(603,603,603),(604,604,604),(605,605,605),
-(606,606,606),(607,607,607),(608,608,608),(609,609,609),(610,610,610),
-(611,611,611),(612,612,612),(613,613,613),(614,614,614),(615,615,615),
-(616,616,616),(617,617,617),(618,618,618),(619,619,619),(620,620,620),
-(621,621,621),(622,622,622),(623,623,623),(624,624,624),(625,625,625),
-(626,626,626),(627,627,627),(628,628,628),(629,629,629),(630,630,630),
-(631,631,631),(632,632,632),(633,633,633),(634,634,634),(635,635,635),
-(636,636,636),(637,637,637),(638,638,638),(639,639,639),(640,640,640),
-(641,641,641),(642,642,642),(643,643,643),(644,644,644),(645,645,645),
-(646,646,646),(647,647,647),(648,648,648),(649,649,649),(650,650,650),
-(651,651,651),(652,652,652),(653,653,653),(654,654,654),(655,655,655),
-(656,656,656),(657,657,657),(658,658,658),(659,659,659),(660,660,660),
-(661,661,661),(662,662,662),(663,663,663),(664,664,664),(665,665,665),
-(666,666,666),(667,667,667),(668,668,668),(669,669,669),(670,670,670),
-(671,671,671),(672,672,672),(673,673,673),(674,674,674),(675,675,675),
-(676,676,676),(677,677,677),(678,678,678),(679,679,679),(680,680,680),
-(681,681,681),(682,682,682),(683,683,683),(684,684,684),(685,685,685),
-(686,686,686),(687,687,687),(688,688,688),(689,689,689),(690,690,690),
-(691,691,691),(692,692,692),(693,693,693),(694,694,694),(695,695,695),
-(696,696,696),(697,697,697),(698,698,698),(699,699,699),(700,700,700),
-(701,701,701),(702,702,702),(703,703,703),(704,704,704),(705,705,705),
-(706,706,706),(707,707,707),(708,708,708),(709,709,709),(710,710,710),
-(711,711,711),(712,712,712),(713,713,713),(714,714,714),(715,715,715),
-(716,716,716),(717,717,717),(718,718,718),(719,719,719),(720,720,720),
-(721,721,721),(722,722,722),(723,723,723),(724,724,724),(725,725,725),
-(726,726,726),(727,727,727),(728,728,728),(729,729,729),(730,730,730),
-(731,731,731),(732,732,732),(733,733,733),(734,734,734),(735,735,735),
-(736,736,736),(737,737,737),(738,738,738),(739,739,739),(740,740,740),
-(741,741,741),(742,742,742),(743,743,743),(744,744,744),(745,745,745),
-(746,746,746),(747,747,747),(748,748,748),(749,749,749),(750,750,750),
-(751,751,751),(752,752,752),(753,753,753),(754,754,754),(755,755,755),
-(756,756,756),(757,757,757),(758,758,758),(759,759,759),(760,760,760),
-(761,761,761),(762,762,762),(763,763,763),(764,764,764),(765,765,765),
-(766,766,766),(767,767,767),(768,768,768),(769,769,769),(770,770,770),
-(771,771,771),(772,772,772),(773,773,773),(774,774,774),(775,775,775),
-(776,776,776),(777,777,777),(778,778,778),(779,779,779),(780,780,780),
-(781,781,781),(782,782,782),(783,783,783),(784,784,784),(785,785,785),
-(786,786,786),(787,787,787),(788,788,788),(789,789,789),(790,790,790),
-(791,791,791),(792,792,792),(793,793,793),(794,794,794),(795,795,795),
-(796,796,796),(797,797,797),(798,798,798),(799,799,799),(800,800,800),
-(801,801,801),(802,802,802),(803,803,803),(804,804,804),(805,805,805),
-(806,806,806),(807,807,807),(808,808,808),(809,809,809),(810,810,810),
-(811,811,811),(812,812,812),(813,813,813),(814,814,814),(815,815,815),
-(816,816,816),(817,817,817),(818,818,818),(819,819,819),(820,820,820),
-(821,821,821),(822,822,822),(823,823,823),(824,824,824),(825,825,825),
-(826,826,826),(827,827,827),(828,828,828),(829,829,829),(830,830,830),
-(831,831,831),(832,832,832),(833,833,833),(834,834,834),(835,835,835),
-(836,836,836),(837,837,837),(838,838,838),(839,839,839),(840,840,840),
-(841,841,841),(842,842,842),(843,843,843),(844,844,844),(845,845,845),
-(846,846,846),(847,847,847),(848,848,848),(849,849,849),(850,850,850),
-(851,851,851),(852,852,852),(853,853,853),(854,854,854),(855,855,855),
-(856,856,856),(857,857,857),(858,858,858),(859,859,859),(860,860,860),
-(861,861,861),(862,862,862),(863,863,863),(864,864,864),(865,865,865),
-(866,866,866),(867,867,867),(868,868,868),(869,869,869),(870,870,870),
-(871,871,871),(872,872,872),(873,873,873),(874,874,874),(875,875,875),
-(876,876,876),(877,877,877),(878,878,878),(879,879,879),(880,880,880),
-(881,881,881),(882,882,882),(883,883,883),(884,884,884),(885,885,885),
-(886,886,886),(887,887,887),(888,888,888),(889,889,889),(890,890,890),
-(891,891,891),(892,892,892),(893,893,893),(894,894,894),(895,895,895),
-(896,896,896),(897,897,897),(898,898,898),(899,899,899),(900,900,900),
-(901,901,901),(902,902,902),(903,903,903),(904,904,904),(905,905,905),
-(906,906,906),(907,907,907),(908,908,908),(909,909,909),(910,910,910),
-(911,911,911),(912,912,912),(913,913,913),(914,914,914),(915,915,915),
-(916,916,916),(917,917,917),(918,918,918),(919,919,919),(920,920,920),
-(921,921,921),(922,922,922),(923,923,923),(924,924,924),(925,925,925),
-(926,926,926),(927,927,927),(928,928,928),(929,929,929),(930,930,930),
-(931,931,931),(932,932,932),(933,933,933),(934,934,934),(935,935,935),
-(936,936,936),(937,937,937),(938,938,938),(939,939,939),(940,940,940),
-(941,941,941),(942,942,942),(943,943,943),(944,944,944),(945,945,945),
-(946,946,946),(947,947,947),(948,948,948),(949,949,949),(950,950,950),
-(951,951,951),(952,952,952),(953,953,953),(954,954,954),(955,955,955),
-(956,956,956),(957,957,957),(958,958,958),(959,959,959),(960,960,960),
-(961,961,961),(962,962,962),(963,963,963),(964,964,964),(965,965,965),
-(966,966,966),(967,967,967),(968,968,968),(969,969,969),(970,970,970),
-(971,971,971),(972,972,972),(973,973,973),(974,974,974),(975,975,975),
-(976,976,976),(977,977,977),(978,978,978),(979,979,979),(980,980,980),
-(981,981,981),(982,982,982),(983,983,983),(984,984,984),(985,985,985),
-(986,986,986),(987,987,987),(988,988,988),(989,989,989),(990,990,990),
-(991,991,991),(992,992,992),(993,993,993),(994,994,994),(995,995,995),
-(996,996,996),(997,997,997),(998,998,998),(999,999,999),(1000,1000,1000),
-(1001,1001,1001),(1002,1002,1002),(1003,1003,1003),(1004,1004,1004),(1005,1005,1005),
-(1006,1006,1006),(1007,1007,1007),(1008,1008,1008),(1009,1009,1009),(1010,1010,1010),
-(1011,1011,1011),(1012,1012,1012),(1013,1013,1013),(1014,1014,1014),(1015,1015,1015),
-(1016,1016,1016),(1017,1017,1017),(1018,1018,1018),(1019,1019,1019),(1020,1020,1020),
-(1021,1021,1021),(1022,1022,1022),(1023,1023,1023),(1024,1024,1024),(1025,1025,1025),
-(1026,1026,1026),(1027,1027,1027),(1028,1028,1028),(1029,1029,1029),(1030,1030,1030),
-(1031,1031,1031),(1032,1032,1032),(1033,1033,1033),(1034,1034,1034),(1035,1035,1035),
-(1036,1036,1036),(1037,1037,1037),(1038,1038,1038),(1039,1039,1039),(1040,1040,1040),
-(1041,1041,1041),(1042,1042,1042),(1043,1043,1043),(1044,1044,1044),(1045,1045,1045),
-(1046,1046,1046),(1047,1047,1047),(1048,1048,1048),(1049,1049,1049),(1050,1050,1050),
-(1051,1051,1051),(1052,1052,1052),(1053,1053,1053),(1054,1054,1054),(1055,1055,1055),
-(1056,1056,1056),(1057,1057,1057),(1058,1058,1058),(1059,1059,1059),(1060,1060,1060),
-(1061,1061,1061),(1062,1062,1062),(1063,1063,1063),(1064,1064,1064),(1065,1065,1065),
-(1066,1066,1066),(1067,1067,1067),(1068,1068,1068),(1069,1069,1069),(1070,1070,1070),
-(1071,1071,1071),(1072,1072,1072),(1073,1073,1073),(1074,1074,1074),(1075,1075,1075),
-(1076,1076,1076),(1077,1077,1077),(1078,1078,1078),(1079,1079,1079),(1080,1080,1080),
-(1081,1081,1081),(1082,1082,1082),(1083,1083,1083),(1084,1084,1084),(1085,1085,1085),
-(1086,1086,1086),(1087,1087,1087),(1088,1088,1088),(1089,1089,1089),(1090,1090,1090),
-(1091,1091,1091),(1092,1092,1092),(1093,1093,1093),(1094,1094,1094),(1095,1095,1095),
-(1096,1096,1096),(1097,1097,1097),(1098,1098,1098),(1099,1099,1099),(1100,1100,1100),
-(1101,1101,1101),(1102,1102,1102),(1103,1103,1103),(1104,1104,1104),(1105,1105,1105),
-(1106,1106,1106),(1107,1107,1107),(1108,1108,1108),(1109,1109,1109),(1110,1110,1110),
-(1111,1111,1111),(1112,1112,1112),(1113,1113,1113),(1114,1114,1114),(1115,1115,1115),
-(1116,1116,1116),(1117,1117,1117),(1118,1118,1118),(1119,1119,1119),(1120,1120,1120),
-(1121,1121,1121),(1122,1122,1122),(1123,1123,1123),(1124,1124,1124),(1125,1125,1125),
-(1126,1126,1126),(1127,1127,1127),(1128,1128,1128),(1129,1129,1129),(1130,1130,1130),
-(1131,1131,1131),(1132,1132,1132),(1133,1133,1133),(1134,1134,1134),(1135,1135,1135),
-(1136,1136,1136),(1137,1137,1137),(1138,1138,1138),(1139,1139,1139),(1140,1140,1140),
-(1141,1141,1141),(1142,1142,1142),(1143,1143,1143),(1144,1144,1144),(1145,1145,1145),
-(1146,1146,1146),(1147,1147,1147),(1148,1148,1148),(1149,1149,1149),(1150,1150,1150),
-(1151,1151,1151),(1152,1152,1152),(1153,1153,1153),(1154,1154,1154),(1155,1155,1155),
-(1156,1156,1156),(1157,1157,1157),(1158,1158,1158),(1159,1159,1159),(1160,1160,1160),
-(1161,1161,1161),(1162,1162,1162),(1163,1163,1163),(1164,1164,1164),(1165,1165,1165),
-(1166,1166,1166),(1167,1167,1167),(1168,1168,1168),(1169,1169,1169),(1170,1170,1170),
-(1171,1171,1171),(1172,1172,1172),(1173,1173,1173),(1174,1174,1174),(1175,1175,1175),
-(1176,1176,1176),(1177,1177,1177),(1178,1178,1178),(1179,1179,1179),(1180,1180,1180),
-(1181,1181,1181),(1182,1182,1182),(1183,1183,1183),(1184,1184,1184),(1185,1185,1185),
-(1186,1186,1186),(1187,1187,1187),(1188,1188,1188),(1189,1189,1189),(1190,1190,1190),
-(1191,1191,1191),(1192,1192,1192),(1193,1193,1193),(1194,1194,1194),(1195,1195,1195),
-(1196,1196,1196),(1197,1197,1197),(1198,1198,1198),(1199,1199,1199),(1200,1200,1200),
-(1201,1201,1201),(1202,1202,1202),(1203,1203,1203),(1204,1204,1204),(1205,1205,1205),
-(1206,1206,1206),(1207,1207,1207),(1208,1208,1208),(1209,1209,1209),(1210,1210,1210),
-(1211,1211,1211),(1212,1212,1212),(1213,1213,1213),(1214,1214,1214),(1215,1215,1215),
-(1216,1216,1216),(1217,1217,1217),(1218,1218,1218),(1219,1219,1219),(1220,1220,1220),
-(1221,1221,1221),(1222,1222,1222),(1223,1223,1223),(1224,1224,1224),(1225,1225,1225),
-(1226,1226,1226),(1227,1227,1227),(1228,1228,1228),(1229,1229,1229),(1230,1230,1230),
-(1231,1231,1231),(1232,1232,1232),(1233,1233,1233),(1234,1234,1234),(1235,1235,1235),
-(1236,1236,1236),(1237,1237,1237),(1238,1238,1238),(1239,1239,1239),(1240,1240,1240),
-(1241,1241,1241),(1242,1242,1242),(1243,1243,1243),(1244,1244,1244),(1245,1245,1245),
-(1246,1246,1246),(1247,1247,1247),(1248,1248,1248),(1249,1249,1249),(1250,1250,1250),
-(1251,1251,1251),(1252,1252,1252),(1253,1253,1253),(1254,1254,1254),(1255,1255,1255),
-(1256,1256,1256),(1257,1257,1257),(1258,1258,1258),(1259,1259,1259),(1260,1260,1260),
-(1261,1261,1261),(1262,1262,1262),(1263,1263,1263),(1264,1264,1264),(1265,1265,1265),
-(1266,1266,1266),(1267,1267,1267),(1268,1268,1268),(1269,1269,1269),(1270,1270,1270),
-(1271,1271,1271),(1272,1272,1272),(1273,1273,1273),(1274,1274,1274),(1275,1275,1275),
-(1276,1276,1276),(1277,1277,1277),(1278,1278,1278),(1279,1279,1279),(1280,1280,1280),
-(1281,1281,1281),(1282,1282,1282),(1283,1283,1283),(1284,1284,1284),(1285,1285,1285),
-(1286,1286,1286),(1287,1287,1287),(1288,1288,1288),(1289,1289,1289),(1290,1290,1290),
-(1291,1291,1291),(1292,1292,1292),(1293,1293,1293),(1294,1294,1294),(1295,1295,1295),
-(1296,1296,1296),(1297,1297,1297),(1298,1298,1298),(1299,1299,1299),(1300,1300,1300),
-(1301,1301,1301),(1302,1302,1302),(1303,1303,1303),(1304,1304,1304),(1305,1305,1305),
-(1306,1306,1306),(1307,1307,1307),(1308,1308,1308),(1309,1309,1309),(1310,1310,1310),
-(1311,1311,1311),(1312,1312,1312),(1313,1313,1313),(1314,1314,1314),(1315,1315,1315),
-(1316,1316,1316),(1317,1317,1317),(1318,1318,1318),(1319,1319,1319),(1320,1320,1320),
-(1321,1321,1321),(1322,1322,1322),(1323,1323,1323),(1324,1324,1324),(1325,1325,1325),
-(1326,1326,1326),(1327,1327,1327),(1328,1328,1328),(1329,1329,1329),(1330,1330,1330),
-(1331,1331,1331),(1332,1332,1332),(1333,1333,1333),(1334,1334,1334),(1335,1335,1335),
-(1336,1336,1336),(1337,1337,1337),(1338,1338,1338),(1339,1339,1339),(1340,1340,1340),
-(1341,1341,1341),(1342,1342,1342),(1343,1343,1343),(1344,1344,1344),(1345,1345,1345),
-(1346,1346,1346),(1347,1347,1347),(1348,1348,1348),(1349,1349,1349),(1350,1350,1350),
-(1351,1351,1351),(1352,1352,1352),(1353,1353,1353),(1354,1354,1354),(1355,1355,1355),
-(1356,1356,1356),(1357,1357,1357),(1358,1358,1358),(1359,1359,1359),(1360,1360,1360),
-(1361,1361,1361),(1362,1362,1362),(1363,1363,1363),(1364,1364,1364),(1365,1365,1365),
-(1366,1366,1366),(1367,1367,1367),(1368,1368,1368),(1369,1369,1369),(1370,1370,1370),
-(1371,1371,1371),(1372,1372,1372),(1373,1373,1373),(1374,1374,1374),(1375,1375,1375),
-(1376,1376,1376),(1377,1377,1377),(1378,1378,1378),(1379,1379,1379),(1380,1380,1380),
-(1381,1381,1381),(1382,1382,1382),(1383,1383,1383),(1384,1384,1384),(1385,1385,1385),
-(1386,1386,1386),(1387,1387,1387),(1388,1388,1388),(1389,1389,1389),(1390,1390,1390),
-(1391,1391,1391),(1392,1392,1392),(1393,1393,1393),(1394,1394,1394),(1395,1395,1395),
-(1396,1396,1396),(1397,1397,1397),(1398,1398,1398),(1399,1399,1399),(1400,1400,1400),
-(1401,1401,1401),(1402,1402,1402),(1403,1403,1403),(1404,1404,1404),(1405,1405,1405),
-(1406,1406,1406),(1407,1407,1407),(1408,1408,1408),(1409,1409,1409),(1410,1410,1410),
-(1411,1411,1411),(1412,1412,1412),(1413,1413,1413),(1414,1414,1414),(1415,1415,1415),
-(1416,1416,1416),(1417,1417,1417),(1418,1418,1418),(1419,1419,1419),(1420,1420,1420),
-(1421,1421,1421),(1422,1422,1422),(1423,1423,1423),(1424,1424,1424),(1425,1425,1425),
-(1426,1426,1426),(1427,1427,1427),(1428,1428,1428),(1429,1429,1429),(1430,1430,1430),
-(1431,1431,1431),(1432,1432,1432),(1433,1433,1433),(1434,1434,1434),(1435,1435,1435),
-(1436,1436,1436),(1437,1437,1437),(1438,1438,1438),(1439,1439,1439),(1440,1440,1440),
-(1441,1441,1441),(1442,1442,1442),(1443,1443,1443),(1444,1444,1444),(1445,1445,1445),
-(1446,1446,1446),(1447,1447,1447),(1448,1448,1448),(1449,1449,1449),(1450,1450,1450),
-(1451,1451,1451),(1452,1452,1452),(1453,1453,1453),(1454,1454,1454),(1455,1455,1455),
-(1456,1456,1456),(1457,1457,1457),(1458,1458,1458),(1459,1459,1459),(1460,1460,1460),
-(1461,1461,1461),(1462,1462,1462),(1463,1463,1463),(1464,1464,1464),(1465,1465,1465),
-(1466,1466,1466),(1467,1467,1467),(1468,1468,1468),(1469,1469,1469),(1470,1470,1470),
-(1471,1471,1471),(1472,1472,1472),(1473,1473,1473),(1474,1474,1474),(1475,1475,1475),
-(1476,1476,1476),(1477,1477,1477),(1478,1478,1478),(1479,1479,1479),(1480,1480,1480),
-(1481,1481,1481),(1482,1482,1482),(1483,1483,1483),(1484,1484,1484),(1485,1485,1485),
-(1486,1486,1486),(1487,1487,1487),(1488,1488,1488),(1489,1489,1489),(1490,1490,1490),
-(1491,1491,1491),(1492,1492,1492),(1493,1493,1493),(1494,1494,1494),(1495,1495,1495),
-(1496,1496,1496),(1497,1497,1497),(1498,1498,1498),(1499,1499,1499),(1500,1500,1500),
-(1501,1501,1501),(1502,1502,1502),(1503,1503,1503),(1504,1504,1504),(1505,1505,1505),
-(1506,1506,1506),(1507,1507,1507),(1508,1508,1508),(1509,1509,1509),(1510,1510,1510),
-(1511,1511,1511),(1512,1512,1512),(1513,1513,1513),(1514,1514,1514),(1515,1515,1515),
-(1516,1516,1516),(1517,1517,1517),(1518,1518,1518),(1519,1519,1519),(1520,1520,1520),
-(1521,1521,1521),(1522,1522,1522),(1523,1523,1523),(1524,1524,1524),(1525,1525,1525),
-(1526,1526,1526),(1527,1527,1527),(1528,1528,1528),(1529,1529,1529),(1530,1530,1530),
-(1531,1531,1531),(1532,1532,1532),(1533,1533,1533),(1534,1534,1534),(1535,1535,1535),
-(1536,1536,1536),(1537,1537,1537),(1538,1538,1538),(1539,1539,1539),(1540,1540,1540),
-(1541,1541,1541),(1542,1542,1542),(1543,1543,1543),(1544,1544,1544),(1545,1545,1545),
-(1546,1546,1546),(1547,1547,1547),(1548,1548,1548),(1549,1549,1549),(1550,1550,1550),
-(1551,1551,1551),(1552,1552,1552),(1553,1553,1553),(1554,1554,1554),(1555,1555,1555),
-(1556,1556,1556),(1557,1557,1557),(1558,1558,1558),(1559,1559,1559),(1560,1560,1560),
-(1561,1561,1561),(1562,1562,1562),(1563,1563,1563),(1564,1564,1564),(1565,1565,1565),
-(1566,1566,1566),(1567,1567,1567),(1568,1568,1568),(1569,1569,1569),(1570,1570,1570),
-(1571,1571,1571),(1572,1572,1572),(1573,1573,1573),(1574,1574,1574),(1575,1575,1575),
-(1576,1576,1576),(1577,1577,1577),(1578,1578,1578),(1579,1579,1579),(1580,1580,1580),
-(1581,1581,1581),(1582,1582,1582),(1583,1583,1583),(1584,1584,1584),(1585,1585,1585),
-(1586,1586,1586),(1587,1587,1587),(1588,1588,1588),(1589,1589,1589),(1590,1590,1590),
-(1591,1591,1591),(1592,1592,1592),(1593,1593,1593),(1594,1594,1594),(1595,1595,1595),
-(1596,1596,1596),(1597,1597,1597),(1598,1598,1598),(1599,1599,1599),(1600,1600,1600),
-(1601,1601,1601),(1602,1602,1602),(1603,1603,1603),(1604,1604,1604),(1605,1605,1605),
-(1606,1606,1606),(1607,1607,1607),(1608,1608,1608),(1609,1609,1609),(1610,1610,1610),
-(1611,1611,1611),(1612,1612,1612),(1613,1613,1613),(1614,1614,1614),(1615,1615,1615),
-(1616,1616,1616),(1617,1617,1617),(1618,1618,1618),(1619,1619,1619),(1620,1620,1620),
-(1621,1621,1621),(1622,1622,1622),(1623,1623,1623),(1624,1624,1624),(1625,1625,1625),
-(1626,1626,1626),(1627,1627,1627),(1628,1628,1628),(1629,1629,1629),(1630,1630,1630),
-(1631,1631,1631),(1632,1632,1632),(1633,1633,1633),(1634,1634,1634),(1635,1635,1635),
-(1636,1636,1636),(1637,1637,1637),(1638,1638,1638),(1639,1639,1639),(1640,1640,1640),
-(1641,1641,1641),(1642,1642,1642),(1643,1643,1643),(1644,1644,1644),(1645,1645,1645),
-(1646,1646,1646),(1647,1647,1647),(1648,1648,1648),(1649,1649,1649),(1650,1650,1650),
-(1651,1651,1651),(1652,1652,1652),(1653,1653,1653),(1654,1654,1654),(1655,1655,1655),
-(1656,1656,1656),(1657,1657,1657),(1658,1658,1658),(1659,1659,1659),(1660,1660,1660),
-(1661,1661,1661),(1662,1662,1662),(1663,1663,1663),(1664,1664,1664),(1665,1665,1665),
-(1666,1666,1666),(1667,1667,1667),(1668,1668,1668),(1669,1669,1669),(1670,1670,1670),
-(1671,1671,1671),(1672,1672,1672),(1673,1673,1673),(1674,1674,1674),(1675,1675,1675),
-(1676,1676,1676),(1677,1677,1677),(1678,1678,1678),(1679,1679,1679),(1680,1680,1680),
-(1681,1681,1681),(1682,1682,1682),(1683,1683,1683),(1684,1684,1684),(1685,1685,1685),
-(1686,1686,1686),(1687,1687,1687),(1688,1688,1688),(1689,1689,1689),(1690,1690,1690),
-(1691,1691,1691),(1692,1692,1692),(1693,1693,1693),(1694,1694,1694),(1695,1695,1695),
-(1696,1696,1696),(1697,1697,1697),(1698,1698,1698),(1699,1699,1699),(1700,1700,1700),
-(1701,1701,1701),(1702,1702,1702),(1703,1703,1703),(1704,1704,1704),(1705,1705,1705),
-(1706,1706,1706),(1707,1707,1707),(1708,1708,1708),(1709,1709,1709),(1710,1710,1710),
-(1711,1711,1711),(1712,1712,1712),(1713,1713,1713),(1714,1714,1714),(1715,1715,1715),
-(1716,1716,1716),(1717,1717,1717),(1718,1718,1718),(1719,1719,1719),(1720,1720,1720),
-(1721,1721,1721),(1722,1722,1722),(1723,1723,1723),(1724,1724,1724),(1725,1725,1725),
-(1726,1726,1726),(1727,1727,1727),(1728,1728,1728),(1729,1729,1729),(1730,1730,1730),
-(1731,1731,1731),(1732,1732,1732),(1733,1733,1733),(1734,1734,1734),(1735,1735,1735),
-(1736,1736,1736),(1737,1737,1737),(1738,1738,1738),(1739,1739,1739),(1740,1740,1740),
-(1741,1741,1741),(1742,1742,1742),(1743,1743,1743),(1744,1744,1744),(1745,1745,1745),
-(1746,1746,1746),(1747,1747,1747),(1748,1748,1748),(1749,1749,1749),(1750,1750,1750),
-(1751,1751,1751),(1752,1752,1752),(1753,1753,1753),(1754,1754,1754),(1755,1755,1755),
-(1756,1756,1756),(1757,1757,1757),(1758,1758,1758),(1759,1759,1759),(1760,1760,1760),
-(1761,1761,1761),(1762,1762,1762),(1763,1763,1763),(1764,1764,1764),(1765,1765,1765),
-(1766,1766,1766),(1767,1767,1767),(1768,1768,1768),(1769,1769,1769),(1770,1770,1770),
-(1771,1771,1771),(1772,1772,1772),(1773,1773,1773),(1774,1774,1774),(1775,1775,1775),
-(1776,1776,1776),(1777,1777,1777),(1778,1778,1778),(1779,1779,1779),(1780,1780,1780),
-(1781,1781,1781),(1782,1782,1782),(1783,1783,1783),(1784,1784,1784),(1785,1785,1785),
-(1786,1786,1786),(1787,1787,1787),(1788,1788,1788),(1789,1789,1789),(1790,1790,1790),
-(1791,1791,1791),(1792,1792,1792),(1793,1793,1793),(1794,1794,1794),(1795,1795,1795),
-(1796,1796,1796),(1797,1797,1797),(1798,1798,1798),(1799,1799,1799),(1800,1800,1800),
-(1801,1801,1801),(1802,1802,1802),(1803,1803,1803),(1804,1804,1804),(1805,1805,1805),
-(1806,1806,1806),(1807,1807,1807),(1808,1808,1808),(1809,1809,1809),(1810,1810,1810),
-(1811,1811,1811),(1812,1812,1812),(1813,1813,1813),(1814,1814,1814),(1815,1815,1815),
-(1816,1816,1816),(1817,1817,1817),(1818,1818,1818),(1819,1819,1819),(1820,1820,1820),
-(1821,1821,1821),(1822,1822,1822),(1823,1823,1823),(1824,1824,1824),(1825,1825,1825),
-(1826,1826,1826),(1827,1827,1827),(1828,1828,1828),(1829,1829,1829),(1830,1830,1830),
-(1831,1831,1831),(1832,1832,1832),(1833,1833,1833),(1834,1834,1834),(1835,1835,1835),
-(1836,1836,1836),(1837,1837,1837),(1838,1838,1838),(1839,1839,1839),(1840,1840,1840),
-(1841,1841,1841),(1842,1842,1842),(1843,1843,1843),(1844,1844,1844),(1845,1845,1845),
-(1846,1846,1846),(1847,1847,1847),(1848,1848,1848),(1849,1849,1849),(1850,1850,1850),
-(1851,1851,1851),(1852,1852,1852),(1853,1853,1853),(1854,1854,1854),(1855,1855,1855),
-(1856,1856,1856),(1857,1857,1857),(1858,1858,1858),(1859,1859,1859),(1860,1860,1860),
-(1861,1861,1861),(1862,1862,1862),(1863,1863,1863),(1864,1864,1864),(1865,1865,1865),
-(1866,1866,1866),(1867,1867,1867),(1868,1868,1868),(1869,1869,1869),(1870,1870,1870),
-(1871,1871,1871),(1872,1872,1872),(1873,1873,1873),(1874,1874,1874),(1875,1875,1875),
-(1876,1876,1876),(1877,1877,1877),(1878,1878,1878),(1879,1879,1879),(1880,1880,1880),
-(1881,1881,1881),(1882,1882,1882),(1883,1883,1883),(1884,1884,1884),(1885,1885,1885),
-(1886,1886,1886),(1887,1887,1887),(1888,1888,1888),(1889,1889,1889),(1890,1890,1890),
-(1891,1891,1891),(1892,1892,1892),(1893,1893,1893),(1894,1894,1894),(1895,1895,1895),
-(1896,1896,1896),(1897,1897,1897),(1898,1898,1898),(1899,1899,1899),(1900,1900,1900),
-(1901,1901,1901),(1902,1902,1902),(1903,1903,1903),(1904,1904,1904),(1905,1905,1905),
-(1906,1906,1906),(1907,1907,1907),(1908,1908,1908),(1909,1909,1909),(1910,1910,1910),
-(1911,1911,1911),(1912,1912,1912),(1913,1913,1913),(1914,1914,1914),(1915,1915,1915),
-(1916,1916,1916),(1917,1917,1917),(1918,1918,1918),(1919,1919,1919),(1920,1920,1920),
-(1921,1921,1921),(1922,1922,1922),(1923,1923,1923),(1924,1924,1924),(1925,1925,1925),
-(1926,1926,1926),(1927,1927,1927),(1928,1928,1928),(1929,1929,1929),(1930,1930,1930),
-(1931,1931,1931),(1932,1932,1932),(1933,1933,1933),(1934,1934,1934),(1935,1935,1935),
-(1936,1936,1936),(1937,1937,1937),(1938,1938,1938),(1939,1939,1939),(1940,1940,1940),
-(1941,1941,1941),(1942,1942,1942),(1943,1943,1943),(1944,1944,1944),(1945,1945,1945),
-(1946,1946,1946),(1947,1947,1947),(1948,1948,1948),(1949,1949,1949),(1950,1950,1950),
-(1951,1951,1951),(1952,1952,1952),(1953,1953,1953),(1954,1954,1954),(1955,1955,1955),
-(1956,1956,1956),(1957,1957,1957),(1958,1958,1958),(1959,1959,1959),(1960,1960,1960),
-(1961,1961,1961),(1962,1962,1962),(1963,1963,1963),(1964,1964,1964),(1965,1965,1965),
-(1966,1966,1966),(1967,1967,1967),(1968,1968,1968),(1969,1969,1969),(1970,1970,1970),
-(1971,1971,1971),(1972,1972,1972),(1973,1973,1973),(1974,1974,1974),(1975,1975,1975),
-(1976,1976,1976),(1977,1977,1977),(1978,1978,1978),(1979,1979,1979),(1980,1980,1980),
-(1981,1981,1981),(1982,1982,1982),(1983,1983,1983),(1984,1984,1984),(1985,1985,1985),
-(1986,1986,1986),(1987,1987,1987),(1988,1988,1988),(1989,1989,1989),(1990,1990,1990),
-(1991,1991,1991),(1992,1992,1992),(1993,1993,1993),(1994,1994,1994),(1995,1995,1995),
-(1996,1996,1996),(1997,1997,1997),(1998,1998,1998),(1999,1999,1999);
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-2000
-INSERT INTO t1 VALUES (1,1,1);
-ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
-INSERT INTO t1 VALUES
-(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
-(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
-ERROR 23000: Can't write; duplicate key in table 't1'
-select count(*) from t1;
-count(*)
-2000
-begin;
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-2000
-INSERT INTO t1 VALUES
-(2001,2001,2001),(2002,2002,2002),(2003,2003,2003),(2004,2004,2004),(2005,2005,2005);
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-2005
-rollback;
-begin;
-INSERT INTO t1 VALUES
-(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
-(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
-ERROR 23000: Can't write; duplicate key in table 't1'
-commit;
-ERROR HY000: Got error 4350 'Transaction already aborted' from NDBCLUSTER
-select * from t1 where pk1=1;
-pk1 b c
-1 1 1
-select * from t1 where pk1=10;
-pk1 b c
-10 10 10
-select count(*) from t1 where pk1 <= 10 order by pk1;
-count(*)
-11
-select count(*) from t1;
-count(*)
-2000
-begin;
-INSERT INTO t1 VALUES
-(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
-(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
-ERROR 23000: Can't write; duplicate key in table 't1'
-rollback;
-select * from t1 where pk1=1;
-pk1 b c
-1 1 1
-select * from t1 where pk1=10;
-pk1 b c
-10 10 10
-select count(*) from t1 where pk1 <= 10 order by pk1;
-count(*)
-11
-select count(*) from t1;
-count(*)
-2000
-begin;
-INSERT INTO t1 VALUES
-(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
-(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
-ERROR 23000: Can't write; duplicate key in table 't1'
-SELECT * FROM t1 WHERE pk1=10;
-ERROR HY000: Got error 4350 'Transaction already aborted' from NDBCLUSTER
-rollback;
-select * from t1 where pk1=1;
-pk1 b c
-1 1 1
-select * from t1 where pk1=10;
-pk1 b c
-10 10 10
-select count(*) from t1 where pk1 <= 10 order by pk1;
-count(*)
-11
-select count(*) from t1;
-count(*)
-2000
-begin;
-INSERT INTO t1 VALUES
-(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
-(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
-ERROR 23000: Can't write; duplicate key in table 't1'
-SELECT * FROM t1 WHERE pk1=10;
-ERROR HY000: Got error 4350 'Transaction already aborted' from NDBCLUSTER
-SELECT * FROM t1 WHERE pk1=10;
-ERROR HY000: Got error 4350 'Transaction already aborted' from NDBCLUSTER
-commit;
-ERROR HY000: Got error 4350 'Transaction already aborted' from NDBCLUSTER
-select * from t1 where pk1=1;
-pk1 b c
-1 1 1
-select * from t1 where pk1=10;
-pk1 b c
-10 10 10
-select count(*) from t1 where pk1 <= 10 order by pk1;
-count(*)
-11
-select count(*) from t1;
-count(*)
-2000
-begin;
-INSERT INTO t1 VALUES
-(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
-(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
-ERROR 23000: Can't write; duplicate key in table 't1'
-INSERT INTO t1 values (4000, 40, 44);
-ERROR HY000: Got error 4350 'Transaction already aborted' from NDBCLUSTER
-rollback;
-select * from t1 where pk1=1;
-pk1 b c
-1 1 1
-select * from t1 where pk1=10;
-pk1 b c
-10 10 10
-select count(*) from t1 where pk1 <= 10 order by pk1;
-count(*)
-11
-select count(*) from t1;
-count(*)
-2000
-insert into t1 select * from t1 where b < 10 order by pk1;
-ERROR 23000: Can't write; duplicate key in table 't1'
-DELETE FROM t1 WHERE pk1=2;
-begin;
-INSERT IGNORE INTO t1 VALUES(1,2,3),(2,3,4);
-select * from t1 where pk1 < 3 order by pk1;
-pk1 b c
-0 0 0
-1 1 1
-2 3 4
-rollback;
-INSERT IGNORE INTO t1 VALUES(1,2,3),(2,3,4);
-select * from t1 where pk1 < 3 order by pk1;
-pk1 b c
-0 0 0
-1 1 1
-2 3 4
-REPLACE INTO t1 values(1, 78, 3);
-select * from t1 where pk1=1;
-pk1 b c
-1 78 3
-INSERT INTO t1 VALUES(1,1,1),(3,4,5) ON DUPLICATE KEY UPDATE b=79;
-select * from t1 where pk1 < 4 order by pk1;
-pk1 b c
-0 0 0
-1 79 3
-2 3 4
-3 79 3
-INSERT INTO t1 VALUES(1,1,1),(3,4,5) ON DUPLICATE KEY UPDATE b=pk1+c;
-select * from t1 where pk1 < 4 order by pk1;
-pk1 b c
-0 0 0
-1 4 3
-2 3 4
-3 6 3
-DELETE FROM t1 WHERE pk1 = 2 OR pk1 = 4 OR pk1 = 6;
-INSERT INTO t1 VALUES(1,1,1),(2,2,17),(3,4,5) ON DUPLICATE KEY UPDATE pk1=b;
-select * from t1 where pk1 = b and b != c order by pk1;
-pk1 b c
-2 2 17
-4 4 3
-6 6 3
-DELETE FROM t1;
-CREATE UNIQUE INDEX bi ON t1(b);
-INSERT INTO t1 VALUES
-(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
-(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
-INSERT INTO t1 VALUES(0,1,0),(21,21,21) ON DUPLICATE KEY UPDATE pk1=b+10,b=b+10;
-select * from t1 order by pk1;
-pk1 b c
-2 2 2
-3 3 3
-4 4 4
-5 5 5
-6 6 6
-7 7 7
-8 8 8
-9 9 9
-10 10 10
-11 11 1
-21 21 21
-DROP TABLE t1;
-CREATE TABLE t1(a INT) ENGINE=ndb;
-INSERT IGNORE INTO t1 VALUES (1);
-INSERT IGNORE INTO t1 VALUES (1);
-INSERT IGNORE INTO t1 SELECT a FROM t1;
-INSERT IGNORE INTO t1 SELECT a FROM t1;
-INSERT IGNORE INTO t1 SELECT a FROM t1;
-INSERT IGNORE INTO t1 VALUES (1);
-INSERT IGNORE INTO t1 VALUES (1);
-SELECT * FROM t1 ORDER BY a;
-a
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-DELETE FROM t1;
-CREATE UNIQUE INDEX ai ON t1(a);
-INSERT IGNORE INTO t1 VALUES (1);
-INSERT IGNORE INTO t1 VALUES (1);
-INSERT IGNORE INTO t1 VALUES (NULL),(2);
-SELECT * FROM t1 ORDER BY a;
-a
-NULL
-1
-2
-DROP TABLE t1;
-CREATE TABLE t1(pk INT NOT NULL PRIMARY KEY, a INT, UNIQUE (a)) ENGINE=ndb;
-INSERT IGNORE INTO t1 VALUES (1,1),(2,2),(3,3);
-INSERT IGNORE INTO t1 VALUES (4,NULL),(5,NULL),(6,NULL),(7,4);
-SELECT * FROM t1 ORDER BY pk;
-pk a
-1 1
-2 2
-3 3
-4 NULL
-5 NULL
-6 NULL
-7 4
-DROP TABLE t1;
-create table t1(a int primary key, b int, unique key(b)) engine=ndb;
-insert ignore into t1 values (1,0), (2,0), (2,null), (3,null);
-select * from t1 order by a;
-a b
-1 0
-2 NULL
-3 NULL
-drop table t1;
diff --git a/mysql-test/r/ndb_partition_range.result b/mysql-test/r/ndb_partition_range.result
deleted file mode 100644
index 8057ac59613..00000000000
--- a/mysql-test/r/ndb_partition_range.result
+++ /dev/null
@@ -1,263 +0,0 @@
-drop table if exists t1;
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b),
-index (a))
-engine = ndb
-partition by range (a)
-partitions 3
-(partition x1 values less than (5),
-partition x2 values less than (10),
-partition x3 values less than (20));
-INSERT into t1 values (1, 1, 1);
-INSERT into t1 values (6, 1, 1);
-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 default NULL
-NULL test t1 x2 NULL 2 NULL RANGE NULL a NULL 10 0 0 0 # 0 0 # # NULL NULL default default NULL
-NULL test t1 x3 NULL 3 NULL RANGE NULL a NULL 20 0 0 0 # 0 0 # # NULL NULL default default NULL
-select * from t1 order by a;
-a b c
-1 1 1
-6 1 1
-10 1 1
-15 1 1
-select * from t1 where a=1 order by a;
-a b c
-1 1 1
-select * from t1 where a=15 and b=1 order by a;
-a b c
-15 1 1
-select * from t1 where a=21 and b=1 order by a;
-a b c
-select * from t1 where a=21 order by a;
-a b c
-select * from t1 where a in (1,6,10,21) order by a;
-a b c
-1 1 1
-6 1 1
-10 1 1
-select * from t1 where b=1 and a in (1,6,10,21) order by a;
-a b c
-1 1 1
-6 1 1
-10 1 1
-drop table t1;
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(b),
-unique (a))
-engine = ndb
-partition by range (b)
-partitions 3
-(partition x1 values less than (5),
-partition x2 values less than (10),
-partition x3 values less than (20));
-INSERT into t1 values (1, 1, 1);
-INSERT into t1 values (2, 6, 1);
-INSERT into t1 values (3, 10, 1);
-INSERT into t1 values (4, 15, 1);
-select * from t1 order by a;
-a b c
-1 1 1
-2 6 1
-3 10 1
-4 15 1
-UPDATE t1 set a = 5 WHERE b = 15;
-select * from t1 order by a;
-a b c
-1 1 1
-2 6 1
-3 10 1
-5 15 1
-UPDATE t1 set a = 6 WHERE a = 5;
-select * from t1 order by a;
-a b c
-1 1 1
-2 6 1
-3 10 1
-6 15 1
-select * from t1 where b=1 order by b;
-a b c
-1 1 1
-select * from t1 where b=15 and a=1 order by b;
-a b c
-select * from t1 where b=21 and a=1 order by b;
-a b c
-select * from t1 where b=21 order by b;
-a b c
-select * from t1 where b in (1,6,10,21) order by b;
-a b c
-1 1 1
-2 6 1
-3 10 1
-select * from t1 where a in (1,2,5,6) order by b;
-a b c
-1 1 1
-2 6 1
-6 15 1
-select * from t1 where a=1 and b in (1,6,10,21) order by b;
-a b c
-1 1 1
-DELETE from t1 WHERE b = 6;
-DELETE from t1 WHERE a = 6;
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) NOT NULL,
- `c` int(11) NOT NULL,
- PRIMARY KEY (`b`),
- UNIQUE KEY `a` (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (b) (PARTITION x1 VALUES LESS THAN (5) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (10) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (20) ENGINE = ndbcluster) */
-drop table t1;
-CREATE TABLE t1
-(id MEDIUMINT NOT NULL,
-b1 BIT(8),
-vc VARCHAR(255),
-bc CHAR(255),
-d DECIMAL(10,4) DEFAULT 0,
-f FLOAT DEFAULT 0,
-total BIGINT UNSIGNED,
-y YEAR,
-t DATE) ENGINE=NDB
-PARTITION BY RANGE (YEAR(t))
-(PARTITION p0 VALUES LESS THAN (1901),
-PARTITION p1 VALUES LESS THAN (1946),
-PARTITION p2 VALUES LESS THAN (1966),
-PARTITION p3 VALUES LESS THAN (1986),
-PARTITION p4 VALUES LESS THAN (2005),
-PARTITION p5 VALUES LESS THAN MAXVALUE);
-INSERT INTO t1 VALUES (0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-SELECT * FROM t1;
-id b1 vc bc d f total y t
-0 NULL NULL NULL NULL NULL NULL NULL NULL
-ALTER TABLE t1 ENGINE=MYISAM;
-SELECT * FROM t1;
-id b1 vc bc d f total y t
-0 NULL NULL NULL NULL NULL NULL NULL NULL
-DROP TABLE t1;
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
- INITIAL_SIZE 16M
-UNDO_BUFFER_SIZE=1M
-ENGINE=NDB;
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
- USE LOGFILE GROUP lg1
-INITIAL_SIZE 12M
-ENGINE NDB;
-CREATE TABLE test.t1 (
-a1 INT,
-a2 TEXT NOT NULL,
-a3 BIT NOT NULL,
-a4 DECIMAL(8,3),
-a5 INT NOT NULL,
-a6 INT,
-PRIMARY KEY(a1))
-TABLESPACE ts1 STORAGE DISK ENGINE=NDB
-PARTITION BY LIST (a1)
-(PARTITION p0 VALUES IN (1,2,3,4,5),
-PARTITION p1 VALUES IN (6,7,8,9, 10),
-PARTITION p2 VALUES IN (11, 12, 13, 14, 15));
-ALTER TABLE test.t1 DROP COLUMN a6;
-ALTER TABLE test.t1 ADD COLUMN a6 VARCHAR(255);
-SELECT COUNT(*) FROM test.t1;
-COUNT(*)
-15
-ALTER TABLE test.t1 DROP COLUMN a4;
-SELECT COUNT(*) FROM test.t1;
-COUNT(*)
-15
-DROP TABLE t1;
-CREATE TABLE test.t1 (
-a1 INT,
-a2 TEXT NOT NULL,
-a3 BIT NOT NULL,
-a4 DECIMAL(8,3),
-a5 INT NOT NULL,
-a6 VARCHAR(255),
-PRIMARY KEY(a1))
-TABLESPACE ts1 STORAGE DISK ENGINE=NDB
-PARTITION BY HASH(a1)
-PARTITIONS 4;
-SELECT COUNT(*) FROM test.t1;
-COUNT(*)
-15
-ALTER TABLE test.t1 DROP COLUMN a4;
-SELECT COUNT(*) FROM test.t1;
-COUNT(*)
-15
-DROP TABLE t1;
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile.dat'
-ENGINE=NDB;
-DROP TABLESPACE ts1 ENGINE=NDB;
-DROP LOGFILE GROUP lg1 ENGINE=NDB;
-CREATE TABLE t1
-(id MEDIUMINT NOT NULL,
-b1 BIT(8),
-vc VARCHAR(255),
-bc CHAR(255),
-d DECIMAL(10,4) DEFAULT 0,
-f FLOAT DEFAULT 0,
-total BIGINT UNSIGNED,
-y YEAR,
-t DATE) ENGINE=NDB
-PARTITION BY LIST(id)
-(PARTITION p0 VALUES IN (2, 4),
-PARTITION p1 VALUES IN (42, 142));
-INSERT INTO t1 VALUES (2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-SELECT * FROM t1;
-id b1 vc bc d f total y t
-2 NULL NULL NULL NULL NULL NULL NULL NULL
-ALTER TABLE t1 ADD PARTITION
-(PARTITION p2 VALUES IN (412));
-SELECT * FROM t1;
-id b1 vc bc d f total y t
-2 NULL NULL NULL NULL NULL NULL NULL NULL
-DROP TABLE t1;
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null)
-partition by list(a)
-partitions 2
-(partition x123 values in (1,5,6),
-partition x234 values in (4,7,8));
-INSERT into t1 VALUES (5,1,1);
-select * from t1;
-a b c
-5 1 1
-UPDATE t1 SET a=8 WHERE a=5 AND b=1;
-select * from t1;
-a b c
-8 1 1
-drop table t1;
-CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) engine=ndb
-PARTITION BY RANGE(f1)
-( PARTITION part1 VALUES LESS THAN (2),
-PARTITION part2 VALUES LESS THAN (1000));
-INSERT INTO t1 VALUES(1, '---1---');
-INSERT INTO t1 VALUES(2, '---2---');
-select * from t1 order by f1;
-f1 f2
-1 ---1---
-2 ---2---
-UPDATE t1 SET f1 = f1 + 4 WHERE f1 = 2;
-select * from t1 order by f1;
-f1 f2
-1 ---1---
-6 ---2---
-UPDATE t1 SET f1 = f1 + 4 WHERE f1 = 1;
-select * from t1 order by f1;
-f1 f2
-5 ---1---
-6 ---2---
-drop table t1;
diff --git a/mysql-test/r/ndb_read_multi_range.result b/mysql-test/r/ndb_read_multi_range.result
deleted file mode 100644
index aef009212a4..00000000000
--- a/mysql-test/r/ndb_read_multi_range.result
+++ /dev/null
@@ -1,475 +0,0 @@
-DROP TABLE IF EXISTS t1, t2, r1;
-create table t1 (
-a int primary key,
-b int not null,
-c int not null,
-index(b), unique index using hash(c)
-) engine = ndb;
-insert into t1 values
-(1,2,1),(2,3,2),(3,4,3),(4,5,4),
-(5,2,12),(6,3,11),(7,4,10),(8,5,9),
-(9,2,8),(10,3,7),(11,4,6),(12,5,5);
-create table r1 as select * from t1 where a in (2,8,12);
-select * from r1 order by a;
-a b c
-2 3 2
-8 5 9
-12 5 5
-drop table r1;
-create table r1 as select * from t1 where b in (1,2,5);
-select * from r1 order by a;
-a b c
-1 2 1
-4 5 4
-5 2 12
-8 5 9
-9 2 8
-12 5 5
-drop table r1;
-create table r1 as select * from t1 where c in (2,8,12);
-select * from r1 order by a;
-a b c
-2 3 2
-5 2 12
-9 2 8
-drop table r1;
-create table r1 as select * from t1 where a in (2,8) or (a > 11) or (a <= 1);
-select * from r1 order by a;
-a b c
-1 2 1
-2 3 2
-8 5 9
-12 5 5
-drop table r1;
-create table r1 as select * from t1 where a in (33,8,12);
-select * from r1 order by a;
-a b c
-8 5 9
-12 5 5
-drop table r1;
-create table r1 as select * from t1 where a in (2,33,8,12,34);
-select * from r1 order by a;
-a b c
-2 3 2
-8 5 9
-12 5 5
-drop table r1;
-create table r1 as select * from t1 where b in (1,33,5);
-select * from r1 order by a;
-a b c
-4 5 4
-8 5 9
-12 5 5
-drop table r1;
-select * from t1 where b in (1,33,5) order by a;
-a b c
-4 5 4
-8 5 9
-12 5 5
-create table r1 as select * from t1 where b in (45,1,33,5,44);
-select * from r1 order by a;
-a b c
-4 5 4
-8 5 9
-12 5 5
-drop table r1;
-select * from t1 where b in (45,22) order by a;
-a b c
-create table r1 as select * from t1 where c in (2,8,33);
-select * from r1 order by a;
-a b c
-2 3 2
-9 2 8
-drop table r1;
-create table r1 as select * from t1 where c in (13,2,8,33,12);
-select * from r1 order by a;
-a b c
-2 3 2
-5 2 12
-9 2 8
-drop table r1;
-select * from t1 where a in (33,8,12) order by a;
-a b c
-8 5 9
-12 5 5
-select * from t1 where a in (33,34,35) order by a;
-a b c
-select * from t1 where a in (2,8) or (a > 11) or (a <= 1) order by a;
-a b c
-1 2 1
-2 3 2
-8 5 9
-12 5 5
-select * from t1 where b in (6,7) or (b <= 5) or (b >= 10) order by b,a;
-a b c
-1 2 1
-5 2 12
-9 2 8
-2 3 2
-6 3 11
-10 3 7
-3 4 3
-7 4 10
-11 4 6
-4 5 4
-8 5 9
-12 5 5
-select * from t1 where c in (13,2,8,33,12) order by c,a;
-a b c
-2 3 2
-9 2 8
-5 2 12
-drop table t1;
-create table t1 (
-a int not null,
-b int not null,
-c int not null,
-d int not null,
-e int not null,
-primary key (a,b,c,d), index (d)
-) engine = ndb;
-insert into t1 values
-(1,2,1,1,1),(2,3,2,3,1),(3,4,3,1,1),(4,5,4,7,1),
-(5,2,12,12,1),(6,3,11,1,1),(7,4,10,3,1),(8,5,9,5,1),
-(9,2,8,6,1),(10,3,7,5,1),(11,4,6,3,1),(12,5,5,2,1),
-(1,2,1,2,1),
-(1,2,1,3,1),
-(1,2,1,4,1),
-(1,2,1,5,1);
-create table r1 as select * from t1
-where a=1 and b=2 and c=1 and d in (1,4,3,2);
-select * from r1 order by a,b,c,d;
-a b c d e
-1 2 1 1 1
-1 2 1 2 1
-1 2 1 3 1
-1 2 1 4 1
-drop table r1;
-update t1 set e = 100
-where d in (12,6,7);
-select * from t1 where d in (12,6,7) order by a,b,c,d;
-a b c d e
-4 5 4 7 100
-5 2 12 12 100
-9 2 8 6 100
-select * from t1 where d not in (12,6,7) and e = 100;
-a b c d e
-update t1
-set e = 101
-where a=1 and
-b=2 and
-c=1 and
-d in (1,4,3,2);
-select *
-from t1
-where a=1 and b=2 and c=1 and d in (1,4,3,2)
-order by a,b,c,d;
-a b c d e
-1 2 1 1 101
-1 2 1 2 101
-1 2 1 3 101
-1 2 1 4 101
-select *
-from t1
-where not (a=1 and b=2 and c=1 and d in (1,4,3,2))
-and e=101;
-a b c d e
-update t1
-set e =
-(case d
-when 12 then 112
-when 6 then 106
-when 7 then 107
-end)
-where d in (12,6,7);
-select * from t1 where d in (12,6,7) order by a,b,c,d;
-a b c d e
-4 5 4 7 107
-5 2 12 12 112
-9 2 8 6 106
-update t1
-set e =
-(case d
-when 1 then 111
-when 4 then 444
-when 3 then 333
-when 2 then 222
-end)
-where a=1 and
-b=2 and
-c=1 and
-d in (1,4,3,2);
-select *
-from t1
-where a=1 and b=2 and c=1 and d in (1,4,3,2)
-order by a,b,c,d;
-a b c d e
-1 2 1 1 111
-1 2 1 2 222
-1 2 1 3 333
-1 2 1 4 444
-delete from t1 where d in (12,6,7);
-select * from t1 where d in (12,6,7);
-a b c d e
-drop table t1;
-create table t1 (
-a int not null primary key,
-b int,
-c int,
-d int,
-unique index (b),
-index(c)
-) engine = ndb;
-insert into t1 values
-(1,null,1,1),
-(2,2,2,2),
-(3,null,null,3),
-(4,4,null,4),
-(5,null,5,null),
-(6,6,6,null),
-(7,null,null,null),
-(8,8,null,null),
-(9,null,9,9),
-(10,10,10,10),
-(11,null,null,11),
-(12,12,null,12),
-(13,null,13,null),
-(14,14,14,null),
-(15,null,null,null),
-(16,16,null,null);
-create table t2 as select * from t1 where a in (5,6,7,8,9,10);
-select * from t2 order by a;
-a b c d
-5 NULL 5 NULL
-6 6 6 NULL
-7 NULL NULL NULL
-8 8 NULL NULL
-9 NULL 9 9
-10 10 10 10
-drop table t2;
-create table t2 as select * from t1 where b in (5,6,7,8,9,10);
-select * from t2 order by a;
-a b c d
-6 6 6 NULL
-8 8 NULL NULL
-10 10 10 10
-drop table t2;
-create table t2 as select * from t1 where c in (5,6,7,8,9,10);
-select * from t2 order by a;
-a b c d
-5 NULL 5 NULL
-6 6 6 NULL
-9 NULL 9 9
-10 10 10 10
-drop table t2;
-drop table t1;
-CREATE TABLE t1 (
-a int(11) NOT NULL,
-b int(11) NOT NULL,
-c datetime default NULL,
-PRIMARY KEY (a),
-KEY idx_bc (b,c)
-) ENGINE=ndbcluster;
-INSERT INTO t1 VALUES
-(406989,67,'2006-02-23 17:08:46'), (150078,67,'2005-10-26 11:17:45'),
-(406993,67,'2006-02-27 11:20:57'), (245655,67,'2005-12-08 15:59:08'),
-(406994,67,'2006-02-27 11:26:46'), (256,67,NULL),
-(398341,67,'2006-02-20 04:48:44'), (254,67,NULL),(1120,67,NULL),
-(406988,67,'2006-02-23 17:07:22'), (255,67,NULL),
-(398340,67,'2006-02-20 04:38:53'),(406631,67,'2006-02-23 10:49:42'),
-(245653,67,'2005-12-08 15:59:07'),(406992,67,'2006-02-24 16:47:18'),
-(245654,67,'2005-12-08 15:59:08'),(406995,67,'2006-02-28 11:55:00'),
-(127261,67,'2005-10-13 12:17:58'),(406991,67,'2006-02-24 16:42:32'),
-(245652,67,'2005-12-08 15:58:27'),(398545,67,'2006-02-20 04:53:13'),
-(154504,67,'2005-10-28 11:53:01'),(9199,67,NULL),(1,67,'2006-02-23 15:01:35'),
-(223456,67,NULL),(4101,67,NULL),(1133,67,NULL),
-(406990,67,'2006-02-23 18:01:45'),(148815,67,'2005-10-25 15:34:17'),
-(148812,67,'2005-10-25 15:30:01'),(245651,67,'2005-12-08 15:58:27'),
-(154503,67,'2005-10-28 11:52:38');
-create table t11 engine = ndbcluster select * from t1 where b = 67 AND (c IS NULL OR c > NOW()) order by 3 asc;
-create table t12 engine = ndbcluster select * from t1 where b = 67 AND (c IS NULL OR c > NOW()) order by 3 desc;
-create table t21 select * from t1 where b = 67 AND (c IS NULL OR c > '2005-12-08') order by 3 asc;
-create table t22 engine = ndbcluster select * from t1 where b = 67 AND (c IS NULL OR c > '2005-12-08') order by 3 desc;
-select * from t11 order by 1,2,3;
-a b c
-254 67 NULL
-255 67 NULL
-256 67 NULL
-1120 67 NULL
-1133 67 NULL
-4101 67 NULL
-9199 67 NULL
-223456 67 NULL
-select * from t12 order by 1,2,3;
-a b c
-254 67 NULL
-255 67 NULL
-256 67 NULL
-1120 67 NULL
-1133 67 NULL
-4101 67 NULL
-9199 67 NULL
-223456 67 NULL
-select * from t21 order by 1,2,3;
-a b c
-1 67 2006-02-23 15:01:35
-254 67 NULL
-255 67 NULL
-256 67 NULL
-1120 67 NULL
-1133 67 NULL
-4101 67 NULL
-9199 67 NULL
-223456 67 NULL
-245651 67 2005-12-08 15:58:27
-245652 67 2005-12-08 15:58:27
-245653 67 2005-12-08 15:59:07
-245654 67 2005-12-08 15:59:08
-245655 67 2005-12-08 15:59:08
-398340 67 2006-02-20 04:38:53
-398341 67 2006-02-20 04:48:44
-398545 67 2006-02-20 04:53:13
-406631 67 2006-02-23 10:49:42
-406988 67 2006-02-23 17:07:22
-406989 67 2006-02-23 17:08:46
-406990 67 2006-02-23 18:01:45
-406991 67 2006-02-24 16:42:32
-406992 67 2006-02-24 16:47:18
-406993 67 2006-02-27 11:20:57
-406994 67 2006-02-27 11:26:46
-406995 67 2006-02-28 11:55:00
-select * from t22 order by 1,2,3;
-a b c
-1 67 2006-02-23 15:01:35
-254 67 NULL
-255 67 NULL
-256 67 NULL
-1120 67 NULL
-1133 67 NULL
-4101 67 NULL
-9199 67 NULL
-223456 67 NULL
-245651 67 2005-12-08 15:58:27
-245652 67 2005-12-08 15:58:27
-245653 67 2005-12-08 15:59:07
-245654 67 2005-12-08 15:59:08
-245655 67 2005-12-08 15:59:08
-398340 67 2006-02-20 04:38:53
-398341 67 2006-02-20 04:48:44
-398545 67 2006-02-20 04:53:13
-406631 67 2006-02-23 10:49:42
-406988 67 2006-02-23 17:07:22
-406989 67 2006-02-23 17:08:46
-406990 67 2006-02-23 18:01:45
-406991 67 2006-02-24 16:42:32
-406992 67 2006-02-24 16:47:18
-406993 67 2006-02-27 11:20:57
-406994 67 2006-02-27 11:26:46
-406995 67 2006-02-28 11:55:00
-select t12.a from t11, t12 where t11.a in(255,256) and t11.a = t12.a and t11.c is null order by t12.a;
-a
-255
-256
-update t22 set c = '2005-12-08 15:58:27' where a = 255;
-select * from t22 order by 1,2,3;
-a b c
-1 67 2006-02-23 15:01:35
-254 67 NULL
-255 67 2005-12-08 15:58:27
-256 67 NULL
-1120 67 NULL
-1133 67 NULL
-4101 67 NULL
-9199 67 NULL
-223456 67 NULL
-245651 67 2005-12-08 15:58:27
-245652 67 2005-12-08 15:58:27
-245653 67 2005-12-08 15:59:07
-245654 67 2005-12-08 15:59:08
-245655 67 2005-12-08 15:59:08
-398340 67 2006-02-20 04:38:53
-398341 67 2006-02-20 04:48:44
-398545 67 2006-02-20 04:53:13
-406631 67 2006-02-23 10:49:42
-406988 67 2006-02-23 17:07:22
-406989 67 2006-02-23 17:08:46
-406990 67 2006-02-23 18:01:45
-406991 67 2006-02-24 16:42:32
-406992 67 2006-02-24 16:47:18
-406993 67 2006-02-27 11:20:57
-406994 67 2006-02-27 11:26:46
-406995 67 2006-02-28 11:55:00
-select t21.* from t21,t22 where t21.a = t22.a and
-t22.a in (select t12.a from t11, t12 where t11.a in(255,256) and t11.a = t12.a and t11.c is null) and t22.c is null order by t21.a;
-a b c
-256 67 NULL
-delete from t22 where a > 245651;
-update t22 set b = a + 1;
-select * from t22 order by 1,2,3;
-a b c
-1 2 2006-02-23 15:01:35
-254 255 NULL
-255 256 2005-12-08 15:58:27
-256 257 NULL
-1120 1121 NULL
-1133 1134 NULL
-4101 4102 NULL
-9199 9200 NULL
-223456 223457 NULL
-245651 245652 2005-12-08 15:58:27
-select t21.c, count(*)
-from t21
-inner join t22 using (a)
-where t22.b in (2,256,257,1121,1134,4102,9200,223457,245652)
-group by t21.c
-order by t21.c;
-c count(*)
-NULL 7
-2005-12-08 15:58:27 1
-2006-02-23 15:01:35 1
-DROP TABLE t1, t11, t12, t21, t22;
-CREATE TABLE t1 (id varchar(255) NOT NULL,
-tag int(11) NOT NULL,
-doc text NOT NULL,
-type varchar(150) NOT NULL,
-modified timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
-PRIMARY KEY (id)
-) ENGINE=ndbcluster;
-INSERT INTO t1 VALUES ('sakila',1,'Some text goes here','text',CURRENT_TIMESTAMP);
-SELECT id, tag, doc, type FROM t1 WHERE id IN ('flipper','orka');
-id tag doc type
-SELECT id, tag, doc, type FROM t1 WHERE id IN ('flipper','sakila');
-id tag doc type
-sakila 1 Some text goes here text
-DROP TABLE t1;
-CREATE TABLE t1 (
-var1 int(2) NOT NULL,
-var2 int(2) NOT NULL,
-PRIMARY KEY (var1)
-) ENGINE=ndbcluster DEFAULT CHARSET=ascii CHECKSUM=1;
-CREATE TABLE t2 (
-var1 int(2) NOT NULL,
-var2 int(2) NOT NULL,
-PRIMARY KEY (var1)
-) ENGINE=MyISAM DEFAULT CHARSET=ascii CHECKSUM=1;
-CREATE TRIGGER testtrigger
-AFTER UPDATE ON t1 FOR EACH ROW BEGIN
-REPLACE INTO t2 SELECT * FROM t1 WHERE t1.var1 = NEW.var1;END|
-INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
-UPDATE t1 SET var2 = 9 WHERE var1 IN(1,2,3);
-DROP TRIGGER testtrigger;
-DROP TABLE t1, t2;
-create table t1 (a int, b int, primary key (a), key ab (a,b)) engine=ndbcluster;
-insert into t1 values (1,1), (10,10);
-select * from t1 use index (ab) where a in(1,10) order by a;
-a b
-1 1
-10 10
-create table t2 (a int, b int, primary key (a,b)) engine=ndbcluster
-partition by key(a);
-insert into t2 values (1,1), (10,10);
-select * from t2 where a in (1,10) order by a;
-a b
-1 1
-10 10
-drop table t1, t2;
diff --git a/mysql-test/r/ndb_restore.result b/mysql-test/r/ndb_restore.result
deleted file mode 100644
index 8ecffa437b0..00000000000
--- a/mysql-test/r/ndb_restore.result
+++ /dev/null
@@ -1,485 +0,0 @@
-use test;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
-drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
-CREATE TABLE `t1_c` (
-`capgoaledatta` mediumint(5) unsigned NOT NULL auto_increment,
-`goaledatta` char(2) NOT NULL default '',
-`maturegarbagefa` varchar(32) NOT NULL default '',
-PRIMARY KEY (`capgoaledatta`,`goaledatta`,`maturegarbagefa`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-INSERT INTO `t1_c` VALUES (2,'3','q3plus.qt'),(400,'4','q3plus.qt'),(1,'3','q3.net'),(3,'4','q3.net'),(3000,'20','threetrees.qt');
-CREATE TABLE `t2_c` (
-`capgotod` smallint(5) unsigned NOT NULL auto_increment,
-`gotod` smallint(5) unsigned NOT NULL default '0',
-`goaledatta` char(2) default NULL,
-`maturegarbagefa` varchar(32) default NULL,
-`descrpooppo` varchar(64) default NULL,
-`svcutonsa` varchar(64) NOT NULL default '',
-PRIMARY KEY (`capgotod`),
-KEY `i quadaddsvr` (`gotod`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-INSERT INTO `t2_c` VALUES (500,4,'','q3.net','addavp:MK_CASELECTOR=1','postorod rattoaa'),(2,1,'4','','addavp:MK_BRANDTAD=345','REDS Brandtad'),(3,2,'4','q3.net','execorder','fixedRatediPO REDS'),(1,1,'3','','addavp:MK_BRANDTAD=123','TEST Brandtad'),(6,5,'','told.q3.net','addavp:MK_BRANDTAD=123','Brandtad Toldzone'),(4,3,'3','q3.net','addavp:MK_POOLHINT=2','ratedi PO TEST');
-CREATE TABLE `t3_c` (
-`CapGoaledatta` smallint(5) unsigned NOT NULL default '0',
-`capgotod` smallint(5) unsigned NOT NULL default '0',
-PRIMARY KEY (`capgotod`,`CapGoaledatta`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED;
-INSERT INTO `t3_c` VALUES (5,3),(2,4),(5,4),(1,3);
-CREATE TABLE `t4_c` (
-`capfa` bigint(20) unsigned NOT NULL auto_increment,
-`realm` varchar(32) NOT NULL default '',
-`authpwchap` varchar(32) default NULL,
-`fa` varchar(32) NOT NULL default '',
-`payyingatta` tinyint(4) NOT NULL default '0',
-`status` char(1) default NULL,
-PRIMARY KEY (`fa`,`realm`),
-KEY `capfa` (`capfa`),
-KEY `i_quadentity` (`fa`,`realm`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-INSERT INTO `t4_c` VALUES (18,'john.smith','q3.net','dessjohn.smith',0,NULL),(21,'quad_katt_with_brandtad','q3.net','acne',0,NULL),(2200,'quad_katt_carattoaa','q3.net','acne',0,NULL),(26,'436462612809','sqasdt.q3.net','N/A',0,'6'),(19,'john','smith.qt','dessjohn',0,NULL),(33,'436643196120','sqasdt.q3.net','N/A',1,'6'),(28,'436642900019','sqasdt.q3.net','N/A',0,'6'),(30,'436462900209','sqasdt.q3.net','N/A',0,'6'),(16,'436640006666','sqasdt.q3.net','',0,NULL),(19,'dette','el-redun.com','dessdette',0,NULL),(12,'quad_kattPP','q3.net','acne',2,NULL),(14,'436640008888','sqasdt.q3.net','',0,NULL),(29,'463624900028','sqasdt.q3.net','N/A',0,'6'),(15,'436640099099','sqasdt.q3.net','',0,NULL),(13,'pap','q3plus.qt','acne',1,NULL),(19,'436642612091','sqasdt.q3.net','N/A',0,'6'),(12,'quad_katt','q3.net','acne',0,NULL),(11,'quad_kattVK','q3.net','acne',1,NULL),(32000,'463641969502','sqasdt.q3.net','N/A',1,'6'),(20,'joe','q3.net','joedesswd',0,NULL),(290000000,'436642900034','sqasdt.q3.net','N/A',0,'6'),(25,'contind','armerde.qt','acne',1,NULL);
-CREATE TABLE `t5_c` (
-`capfa` bigint(20) unsigned NOT NULL default '0',
-`gotod` smallint(5) unsigned NOT NULL default '0',
-`orderutonsa` varchar(64) NOT NULL default '',
-PRIMARY KEY (`capfa`,`gotod`,`orderutonsa`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-INSERT INTO `t5_c` VALUES (21,2,''),(21,1,''),(22,4,'');
-CREATE TABLE `t6_c` (
-`capfa_parent` bigint(20) unsigned NOT NULL default '0',
-`capfa_child` bigint(20) unsigned NOT NULL default '0',
-`relatta` smallint(5) unsigned NOT NULL default '0',
-PRIMARY KEY (`capfa_child`,`capfa_parent`,`relatta`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-INSERT INTO `t6_c` VALUES (15,16,0),(19,20,0),(18326932092909551615,30,0),(26,29,0),(18326932092909551615,29,0),(19,18,0),(26,28,0),(12,14,0);
-CREATE TABLE `t7_c` (
-`dardpo` char(15) NOT NULL default '',
-`dardtestard` tinyint(3) unsigned NOT NULL auto_increment,
-`FastFA` char(5) NOT NULL default '',
-`FastCode` char(6) NOT NULL default '',
-`Fastca` char(1) NOT NULL default '',
-`Fastmag` char(1) NOT NULL default '',
-`Beareratta` char(2) NOT NULL default '',
-PRIMARY KEY (`dardpo`,`dardtestard`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-INSERT INTO `t7_c` VALUES ('2.6.2.4',24,'CECHP','54545','0','0','5'),('2.2.5.4',26,'CANFA','33223','1','1','4'),('4.3.2.4',28,'ITALD','54222','1','0','5'),('129..0.0.eins',28,'G','99999','1','1','5'),('1.1.1.1',24,'AUTPT','32323','0','1','3');
-CREATE TABLE `t8_c` (
-`kattjame` varchar(32) NOT NULL default '',
-`realm` varchar(32) NOT NULL default '',
-`realm_entered` varchar(32) NOT NULL default '',
-`maturegarbagefa` varchar(32) NOT NULL default '',
-`hunderaaarbagefa_parent` varchar(32) NOT NULL default '',
-`kattjame_entered` varchar(32) NOT NULL default '',
-`hunderaaarbagefa` varchar(32) NOT NULL default '',
-`gest` varchar(16) default NULL,
-`hassetino` varchar(16) NOT NULL default '',
-`aaaproxysessfa` varchar(255) default NULL,
-`autologonallowed` char(1) default NULL,
-`squardporoot` varchar(15) NOT NULL default '',
-`naspo` varchar(15) default NULL,
-`beareratta` char(2) default NULL,
-`fastCode` varchar(6) default NULL,
-`fastFA` varchar(5) default NULL,
-`fastca` char(1) default NULL,
-`fastmag` char(1) default NULL,
-`lastupdate` datetime default NULL,
-`hassetistart` datetime NOT NULL default '0000-00-00 00:00:00',
-`accthassetitime` int(10) unsigned default NULL,
-`acctoutputoctets` bigint(20) unsigned default NULL,
-`acctinputoctets` bigint(20) unsigned default NULL,
-PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`),
-KEY `squardporoot` (`squardporoot`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-INSERT INTO `t8_c` VALUES ('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643196120','436643196929','8956234534568968','5524595699','uxasmt21.net.acne.qt/481889229462692422','','1.1.1.1','2.2.4.6','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565),('4545435545','john','q3.net','q3.net','acne.li','436643196120','436643196929','45345234568968','995696699','uxasmt21.net.acne.qt/481889229462692423','','1.1.1.1','2.2.9.8','2','86989','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8821923,169,3565),('versteckter_q3net_katt','joe','q3.net','elredun.com','q3.net','436643196120','436643196939','91341234568968','695595699','uxasmt21.net.acne.qt/481889229462692421','','1.1.1.1','2.5.2.5','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',1923123,9569,6565);
-CREATE TABLE `t9_c` (
-`kattjame` varchar(32) NOT NULL default '',
-`kattjame_entered` varchar(32) NOT NULL default '',
-`realm` varchar(32) NOT NULL default '',
-`realm_entered` varchar(32) NOT NULL default '',
-`maturegarbagefa` varchar(32) NOT NULL default '',
-`hunderaaarbagefa` varchar(32) NOT NULL default '',
-`hunderaaarbagefa_parent` varchar(32) NOT NULL default '',
-`gest` varchar(16) default NULL,
-`hassetino` varchar(16) NOT NULL default '',
-`squardporoot` varchar(15) NOT NULL default '',
-`naspo` varchar(15) default NULL,
-`beareratta` char(2) default NULL,
-`fastCode` varchar(6) default NULL,
-`fastFA` varchar(5) default NULL,
-`fastca` char(1) default NULL,
-`fastmag` char(1) default NULL,
-`lastupdate` datetime default NULL,
-`hassetistart` datetime NOT NULL default '0000-00-00 00:00:00',
-`accthassetitime` int(10) unsigned default NULL,
-`actcoutpuocttets` bigint(20) unsigned default NULL,
-`actinputocctets` bigint(20) unsigned default NULL,
-`terminateraste` tinyint(3) unsigned default NULL,
-PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-INSERT INTO `t9_c` VALUES ('3g4jh8gar2t','joe','q3.net','elredun.com','q3.net','436643316120','436643316939','91341234568968','695595699','1.1.1.1','2.2.6.2','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',3123123,9569,6565,1),('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643316120','436643316939','8956234534568968','5254595969','1.1.1.1','8.6.2.2','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565,2),('4545435545','john','q3.net','q3.net','acne.li','436643316120','436643316939','45345234568968','995696699','1.1.1.1','2.9.9.2','2','86998','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8823123,169,3565,3);
-CREATE TABLE t10_c (a INT AUTO_INCREMENT KEY) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-INSERT INTO t10_c VALUES (1),(2),(3);
-insert into t10_c values (10000),(2000),(3000);
-create table t1 engine=myisam as select * from t1_c;
-create table t2 engine=myisam as select * from t2_c;
-create table t3 engine=myisam as select * from t3_c;
-create table t4 engine=myisam as select * from t4_c;
-create table t5 engine=myisam as select * from t5_c;
-create table t6 engine=myisam as select * from t6_c;
-create table t7 engine=myisam as select * from t7_c;
-create table t8 engine=myisam as select * from t8_c;
-create table t9 engine=myisam as select * from t9_c;
-create table t10 engine=myisam as select * from t10_c;
-ForceVarPart: 0
-ForceVarPart: 1
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-DELETE FROM test.backup_info;
-LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-SELECT @the_backup_id:=backup_id FROM test.backup_info;
-@the_backup_id:=backup_id
-<the_backup_id>
-DROP TABLE test.backup_info;
-drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
-ForceVarPart: 0
-ForceVarPart: 1
-select count(*) from t1;
-count(*)
-5
-select count(*) from t1_c;
-count(*)
-5
-select count(*)
-from (select * from t1 union
-select * from t1_c) a;
-count(*)
-5
-select count(*) from t2;
-count(*)
-6
-select count(*) from t2_c;
-count(*)
-6
-select count(*)
-from (select * from t2 union
-select * from t2_c) a;
-count(*)
-6
-select count(*) from t3;
-count(*)
-4
-select count(*) from t3_c;
-count(*)
-4
-select count(*)
-from (select * from t3 union
-select * from t3_c) a;
-count(*)
-4
-select count(*) from t4;
-count(*)
-22
-select count(*) from t4_c;
-count(*)
-22
-select count(*)
-from (select * from t4 union
-select * from t4_c) a;
-count(*)
-22
-select count(*) from t5;
-count(*)
-3
-select count(*) from t5_c;
-count(*)
-3
-select count(*)
-from (select * from t5 union
-select * from t5_c) a;
-count(*)
-3
-select count(*) from t6;
-count(*)
-8
-select count(*) from t6_c;
-count(*)
-8
-select count(*)
-from (select * from t6 union
-select * from t6_c) a;
-count(*)
-8
-select count(*) from t7;
-count(*)
-5
-select count(*) from t7_c;
-count(*)
-5
-select count(*)
-from (select * from t7 union
-select * from t7_c) a;
-count(*)
-5
-select count(*) from t8;
-count(*)
-3
-select count(*) from t8_c;
-count(*)
-3
-select count(*)
-from (select * from t8 union
-select * from t8_c) a;
-count(*)
-3
-select count(*) from t9;
-count(*)
-3
-select count(*) from t9_c;
-count(*)
-3
-select count(*)
-from (select * from t9 union
-select * from t9_c) a;
-count(*)
-3
-select * from t10_c order by a;
-a
-1
-2
-3
-2000
-3000
-10000
-show table status like 't1_c';
-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
-X X X X X X X X X X 3001 X X X X X X X
-show table status like 't2_c';
-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
-X X X X X X X X X X 501 X X X X X X X
-show table status like 't4_c';
-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
-X X X X X X X X X X 290000001 X X X X X X X
-show table status like 't7_c';
-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
-X X X X X X X X X X 29 X X X X X X X
-show table status like 't10_c';
-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
-X X X X X X X X X X 10001 X X X X X X X
-ALTER TABLE t7_c
-PARTITION BY LINEAR KEY (`dardtestard`);
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-DELETE FROM test.backup_info;
-LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-SELECT @the_backup_id:=backup_id FROM test.backup_info;
-@the_backup_id:=backup_id
-<the_backup_id>
-DROP TABLE test.backup_info;
-drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
-select count(*) from t1;
-count(*)
-5
-select count(*) from t1_c;
-count(*)
-5
-select count(*)
-from (select * from t1 union
-select * from t1_c) a;
-count(*)
-5
-select count(*) from t2;
-count(*)
-6
-select count(*) from t2_c;
-count(*)
-6
-select count(*)
-from (select * from t2 union
-select * from t2_c) a;
-count(*)
-6
-select count(*) from t3;
-count(*)
-4
-select count(*) from t3_c;
-count(*)
-4
-select count(*)
-from (select * from t3 union
-select * from t3_c) a;
-count(*)
-4
-select count(*) from t4;
-count(*)
-22
-select count(*) from t4_c;
-count(*)
-22
-select count(*)
-from (select * from t4 union
-select * from t4_c) a;
-count(*)
-22
-select count(*) from t5;
-count(*)
-3
-select count(*) from t5_c;
-count(*)
-3
-select count(*)
-from (select * from t5 union
-select * from t5_c) a;
-count(*)
-3
-select count(*) from t6;
-count(*)
-8
-select count(*) from t6_c;
-count(*)
-8
-select count(*)
-from (select * from t6 union
-select * from t6_c) a;
-count(*)
-8
-select count(*) from t7;
-count(*)
-5
-select count(*) from t7_c;
-count(*)
-5
-select count(*)
-from (select * from t7 union
-select * from t7_c) a;
-count(*)
-5
-select count(*) from t8;
-count(*)
-3
-select count(*) from t8_c;
-count(*)
-3
-select count(*)
-from (select * from t8 union
-select * from t8_c) a;
-count(*)
-3
-select count(*) from t9;
-count(*)
-3
-select count(*) from t9_c;
-count(*)
-3
-select count(*)
-from (select * from t9 union
-select * from t9_c) a;
-count(*)
-3
-drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
-select count(*) from t1;
-count(*)
-5
-select count(*) from t1_c;
-count(*)
-5
-select count(*)
-from (select * from t1 union
-select * from t1_c) a;
-count(*)
-5
-select count(*) from t2;
-count(*)
-6
-select count(*) from t2_c;
-count(*)
-6
-select count(*)
-from (select * from t2 union
-select * from t2_c) a;
-count(*)
-6
-select count(*) from t3;
-count(*)
-4
-select count(*) from t3_c;
-count(*)
-4
-select count(*)
-from (select * from t3 union
-select * from t3_c) a;
-count(*)
-4
-select count(*) from t4;
-count(*)
-22
-select count(*) from t4_c;
-count(*)
-22
-select count(*)
-from (select * from t4 union
-select * from t4_c) a;
-count(*)
-22
-select count(*) from t5;
-count(*)
-3
-select count(*) from t5_c;
-count(*)
-3
-select count(*)
-from (select * from t5 union
-select * from t5_c) a;
-count(*)
-3
-select count(*) from t6;
-count(*)
-8
-select count(*) from t6_c;
-count(*)
-8
-select count(*)
-from (select * from t6 union
-select * from t6_c) a;
-count(*)
-8
-select count(*) from t7;
-count(*)
-5
-select count(*) from t7_c;
-count(*)
-5
-select count(*)
-from (select * from t7 union
-select * from t7_c) a;
-count(*)
-5
-select count(*) from t8;
-count(*)
-3
-select count(*) from t8_c;
-count(*)
-3
-select count(*)
-from (select * from t8 union
-select * from t8_c) a;
-count(*)
-3
-select count(*) from t9;
-count(*)
-3
-select count(*) from t9_c;
-count(*)
-3
-select count(*)
-from (select * from t9 union
-select * from t9_c) a;
-count(*)
-3
-drop table t1_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-DELETE FROM test.backup_info;
-LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-SELECT @the_backup_id:=backup_id FROM test.backup_info;
-@the_backup_id:=backup_id
-<the_backup_id>
-DROP TABLE test.backup_info;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
-drop table if exists t2_c;
-520093696,<the_backup_id>
diff --git a/mysql-test/r/ndb_restore_compat.result b/mysql-test/r/ndb_restore_compat.result
deleted file mode 100644
index db17f9af32b..00000000000
--- a/mysql-test/r/ndb_restore_compat.result
+++ /dev/null
@@ -1,114 +0,0 @@
-DROP DATABASE IF EXISTS BANK;
-CREATE DATABASE BANK default charset=latin1 default collate=latin1_bin;
-USE BANK;
-SHOW TABLES;
-Tables_in_BANK
-ACCOUNT
-GL
-ACCOUNT_TYPE
-TRANSACTION
-SYSTEM_VALUES
-SELECT * FROM GL ORDER BY TIME,ACCOUNT_TYPE;
-TIME ACCOUNT_TYPE BALANCE DEPOSIT_COUNT DEPOSIT_SUM WITHDRAWAL_COUNT WITHDRAWAL_SUM PURGED
-0 0 10000000 0 0 0 0 1
-0 1 30000 0 0 0 0 1
-0 2 20000 0 0 0 0 1
-0 3 20000 0 0 0 0 1
-0 4 20000 0 0 0 0 1
-1 0 10000000 0 0 0 0 0
-1 1 30000 0 0 0 0 0
-1 2 20000 0 0 0 0 0
-1 3 20000 0 0 0 0 0
-1 4 20000 0 0 0 0 0
-2 0 9981761 17 80457 19 98696 0
-2 1 17823 55 203688 46 215865 0
-2 2 47056 33 159275 33 132219 0
-2 3 15719 26 126833 29 131114 0
-2 4 27641 32 133459 36 125818 0
-SELECT * FROM ACCOUNT ORDER BY ACCOUNT_ID;
-ACCOUNT_ID OWNER BALANCE ACCOUNT_TYPE
-0 0 9863546 0
-1 3001 12885 1
-2 3002 11012 2
-3 3003 32789 3
-4 3004 10992 4
-5 3005 2247 1
-6 3006 3170 1
-7 3007 60321 2
-8 3008 30508 3
-9 3009 62530 4
-SELECT COUNT(*) FROM TRANSACTION;
-COUNT(*)
-3444
-SELECT * FROM SYSTEM_VALUES ORDER BY SYSTEM_VALUES_ID;
-SYSTEM_VALUES_ID VALUE
-0 2039
-1 3
-SELECT * FROM mysql.ndb_apply_status WHERE server_id=0;
-server_id epoch log_name start_pos end_pos
-0 151 0 0
-ForceVarPart: 1
-ForceVarPart: 1
-ForceVarPart: 1
-ForceVarPart: 1
-ForceVarPart: 1
-TRUNCATE GL;
-TRUNCATE ACCOUNT;
-TRUNCATE TRANSACTION;
-TRUNCATE SYSTEM_VALUES;
-TRUNCATE ACCOUNT_TYPE;
-ForceVarPart: 1
-ForceVarPart: 1
-ForceVarPart: 1
-ForceVarPart: 1
-ForceVarPart: 1
-SELECT * FROM GL ORDER BY TIME,ACCOUNT_TYPE;
-TIME ACCOUNT_TYPE BALANCE DEPOSIT_COUNT DEPOSIT_SUM WITHDRAWAL_COUNT WITHDRAWAL_SUM PURGED
-0 0 10000000 0 0 0 0 1
-0 1 30000 0 0 0 0 1
-0 2 20000 0 0 0 0 1
-0 3 20000 0 0 0 0 1
-0 4 20000 0 0 0 0 1
-1 0 10000000 0 0 0 0 1
-1 1 30000 0 0 0 0 1
-1 2 20000 0 0 0 0 1
-1 3 20000 0 0 0 0 1
-1 4 20000 0 0 0 0 1
-2 0 10000000 0 0 0 0 1
-2 1 30000 0 0 0 0 1
-2 2 20000 0 0 0 0 1
-2 3 20000 0 0 0 0 1
-2 4 20000 0 0 0 0 1
-3 0 9963591 14 59111 19 95520 0
-3 1 44264 49 255559 53 241295 0
-3 2 25515 39 177806 36 172291 0
-3 3 16779 26 129200 29 132421 0
-3 4 39851 43 182771 34 162920 0
-4 0 9733661 141 632616 162 862546 0
-4 1 63853 426 2005337 415 1985748 0
-4 2 140473 314 1548632 297 1433674 0
-4 3 13481 310 1528043 324 1531341 0
-4 4 138532 316 1540206 309 1441525 0
-SELECT * FROM ACCOUNT ORDER BY ACCOUNT_ID;
-ACCOUNT_ID OWNER BALANCE ACCOUNT_TYPE
-0 0 9679579 0
-1 3001 18130 1
-2 3002 12318 2
-3 3003 3049 3
-4 3004 39517 4
-5 3005 37051 1
-6 3006 144497 1
-7 3007 130670 2
-8 3008 13747 3
-9 3009 11442 4
-SELECT COUNT(*) FROM TRANSACTION;
-COUNT(*)
-4056
-SELECT * FROM SYSTEM_VALUES ORDER BY SYSTEM_VALUES_ID;
-SYSTEM_VALUES_ID VALUE
-0 2297
-1 5
-SELECT * FROM mysql.ndb_apply_status WHERE server_id=0;
-server_id epoch log_name start_pos end_pos
-0 331 0 0
-DROP DATABASE BANK;
diff --git a/mysql-test/r/ndb_row_format.result b/mysql-test/r/ndb_row_format.result
deleted file mode 100644
index ae165d87c5c..00000000000
--- a/mysql-test/r/ndb_row_format.result
+++ /dev/null
@@ -1,65 +0,0 @@
-DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7;
-drop database if exists mysqltest;
-CREATE TABLE t1
-( a INT KEY,
-b VARCHAR(10) )
-ROW_FORMAT=FIXED
-ENGINE=NDB;
-ERROR HY000: Can't create table 'test.t1' (errno: 138)
-SHOW WARNINGS;
-Level Code Message
-Error 1466 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,
-b INT )
-ENGINE=NDB;
-ForceVarPart: 1
-DROP TABLE t1;
-CREATE TABLE t1
-( a INT KEY,
-b INT )
-ROW_FORMAT=DEFAULT
-ENGINE=NDB;
-ForceVarPart: 1
-DROP TABLE t1;
-CREATE TABLE t1
-( a INT KEY,
-b INT )
-ROW_FORMAT=FIXED
-ENGINE=NDB;
-ForceVarPart: 0
-DROP TABLE t1;
-CREATE TABLE t1
-( a INT KEY,
-b INT )
-ROW_FORMAT=DYNAMIC
-ENGINE=NDB;
-ForceVarPart: 1
-DROP TABLE t1;
-create table t1 (a int auto_increment primary key, b varchar(1000)) engine = ndb;
-insert into t1(b) values ('0123456789');
-insert into t1(b) select b from t1;
-insert into t1(b) select b from t1;
-insert into t1(b) select b from t1;
-insert into t1(b) select b from t1;
-insert into t1(b) select b from t1;
-insert into t1(b) select b from t1;
-insert into t1(b) select b from t1;
-insert into t1(b) select b from t1;
-insert into t1(b) select b from t1;
-insert into t1(b) select b from t1;
-select count(*) from t1;
-count(*)
-1024
-begin;
-update t1 set b = concat(b,b);
-update t1 set b = concat(b,b);
-update t1 set b = concat(b,b);
-update t1 set b = concat(b,b);
-update t1 set b = concat(b,b);
-rollback;
-select count(*),b from t1 group by b;
-count(*) b
-1024 0123456789
-drop table t1;
diff --git a/mysql-test/r/ndb_single_user.result b/mysql-test/r/ndb_single_user.result
deleted file mode 100644
index 54ae99b2f4f..00000000000
--- a/mysql-test/r/ndb_single_user.result
+++ /dev/null
@@ -1,119 +0,0 @@
-use test;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
-create table t1 (a int key, b int unique, c int) engine ndb;
-ERROR HY000: Can't create table 'test.t1' (errno: 299)
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-INITIAL_SIZE 16M
-UNDO_BUFFER_SIZE = 1M
-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
-Error 1516 Failed to create LOGFILE GROUP
-create table t1 (a int key, b int unique, c int) engine ndb;
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-INITIAL_SIZE 16M
-UNDO_BUFFER_SIZE = 1M
-ENGINE=NDB;
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 12M
-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
-Error 1516 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
-Error 1517 Failed to drop LOGFILE GROUP
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 12M
-ENGINE NDB;
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile.dat'
-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
-Error 1521 Failed to alter: DROP DATAFILE
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile.dat'
-ENGINE NDB;
-DROP TABLESPACE ts1
-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
-Error 1517 Failed to drop TABLESPACE
-DROP TABLESPACE ts1
-ENGINE NDB;
-DROP LOGFILE GROUP lg1
-ENGINE =NDB;
-insert into t1 values (1,1,0),(2,2,0),(3,3,0),(4,4,0),(5,5,0),(6,6,0),(7,7,0),(8,8,0),(9,9,0),(10,10,0);
-create table t2 as select * from t1;
-select * from t1 where a = 1;
-a b c
-1 1 0
-select * from t1 where b = 4;
-a b c
-4 4 0
-select * from t1 where a > 4 order by a;
-a b c
-5 5 0
-6 6 0
-7 7 0
-8 8 0
-9 9 0
-10 10 0
-update t1 set b=102 where a = 2;
-update t1 set b=103 where b = 3;
-update t1 set b=b+100;
-update t1 set b=b+100 where a > 7;
-delete from t1;
-insert into t1 select * from t2;
-create unique index new_index on t1 (b,c);
-drop table t1;
-ERROR 42S02: Unknown table 't1'
-create index new_index_fail on t1 (c);
-ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from NDBCLUSTER
-insert into t1 values (21,21,0),(22,22,0),(23,23,0),(24,24,0),(25,25,0),(26,26,0),(27,27,0),(28,28,0),(29,29,0),(210,210,0);
-ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from NDBCLUSTER
-select * from t1 where a = 1;
-ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from NDBCLUSTER
-select * from t1 where b = 4;
-ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from NDBCLUSTER
-update t1 set b=102 where a = 2;
-ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from NDBCLUSTER
-update t1 set b=103 where b = 3;
-ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from NDBCLUSTER
-update t1 set b=b+100;
-ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from NDBCLUSTER
-update t1 set b=b+100 where a > 7;
-ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from NDBCLUSTER
-BEGIN;
-update t1 set b=b+100 where a=1;
-BEGIN;
-update t1 set b=b+100 where a=2;
-update t1 set b=b+100 where a=3;
-COMMIT;
-update t1 set b=b+100 where a=4;
-ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from NDBCLUSTER
-COMMIT;
-ERROR HY000: Got error 4350 'Transaction already aborted' from NDBCLUSTER
-create table t2 (a int) engine myisam;
-alter table t2 add column (b int);
-drop table t2;
-drop table t1;
diff --git a/mysql-test/r/ndb_sp.result b/mysql-test/r/ndb_sp.result
deleted file mode 100644
index 32e6d2eddd7..00000000000
--- a/mysql-test/r/ndb_sp.result
+++ /dev/null
@@ -1,44 +0,0 @@
-drop table if exists t1;
-create table t1 (
-a int not null primary key,
-b int not null
-) engine=ndb;
-insert into t1 values (1,10), (2,20), (3,100), (4, 100);
-create procedure test_proc1 (in var_in int)
-begin
-select * from t1 where a = var_in;
-end;
-create procedure test_proc2 (out var_out int)
-begin
-select b from t1 where a = 1 into var_out;
-end;
-create procedure test_proc3 (inout var_inout int)
-begin
-select b from t1 where a = var_inout into var_inout;
-end;
-//
-call test_proc1(1);
-a b
-1 10
-call test_proc2(@test_var);
-select @test_var;
-@test_var
-10
-set @test_var = 1;
-call test_proc3(@test_var);
-select @test_var;
-@test_var
-10
-alter procedure test_proc1 comment 'new comment';
-show create procedure test_proc1;
-Procedure sql_mode Create Procedure
-test_proc1 CREATE DEFINER=`root`@`localhost` PROCEDURE `test_proc1`(in var_in int)
- COMMENT 'new comment'
-begin
-select * from t1 where a = var_in;
-end
-drop procedure test_proc1;
-drop procedure test_proc2;
-drop procedure test_proc3;
-drop table t1;
-End of 5.1 tests
diff --git a/mysql-test/r/ndb_temporary.result b/mysql-test/r/ndb_temporary.result
deleted file mode 100644
index 61fc1561e4f..00000000000
--- a/mysql-test/r/ndb_temporary.result
+++ /dev/null
@@ -1,21 +0,0 @@
-DROP TABLE IF EXISTS t1;
-create temporary table t1 (a int key) engine=ndb;
-ERROR HY000: Table storage engine 'ndbcluster' does not support the create option 'TEMPORARY'
-create temporary table t1 (a int key) engine=myisam;
-alter table t1 engine=ndb;
-ERROR HY000: Table storage engine 'ndbcluster' does not support the create option 'TEMPORARY'
-drop table t1;
-SET SESSION storage_engine=NDBCLUSTER;
-create table t1 (a int key);
-select engine from information_schema.tables where table_name = 't1';
-engine
-NDBCLUSTER
-drop table t1;
-create temporary table t1 (a int key);
-show create table t1;
-Table Create Table
-t1 CREATE TEMPORARY TABLE `t1` (
- `a` int(11) NOT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-drop table t1;
diff --git a/mysql-test/r/ndb_trigger.result b/mysql-test/r/ndb_trigger.result
deleted file mode 100644
index 28f9f9bdc37..00000000000
--- a/mysql-test/r/ndb_trigger.result
+++ /dev/null
@@ -1,315 +0,0 @@
-drop table if exists t1, t2, t3, t4, t5;
-create table t1 (id int primary key, a int not null, b decimal (63,30) default 0) engine=ndb;
-create table t2 (op char(1), a int not null, b decimal (63,30));
-create table t3 select 1 as i;
-create table t4 (a int not null primary key, b int) engine=ndb;
-create table t5 (a int not null primary key, b int) engine=ndb;
-create trigger t1_bu before update on t1 for each row
-begin
-insert into t2 values ("u", old.a, old.b);
-set new.b = old.b + 10;
-end;//
-create trigger t1_bd before delete on t1 for each row
-begin
-insert into t2 values ("d", old.a, old.b);
-end;//
-create trigger t4_au after update on t4
-for each row begin
-update t5 set b = b+1;
-end;
-//
-create trigger t4_ad after delete on t4
-for each row begin
-update t5 set b = b+1;
-end;
-//
-insert into t1 values (1, 1, 1.05), (2, 2, 2.05), (3, 3, 3.05), (4, 4, 4.05);
-insert into t4 values (1,1), (2,2), (3,3), (4, 4);
-insert into t5 values (1,0);
-update t1 set a=5 where a != 3;
-select * from t1 order by id;
-id a b
-1 5 11.050000000000000000000000000000
-2 5 12.050000000000000000000000000000
-3 3 3.050000000000000000000000000000
-4 5 14.050000000000000000000000000000
-select * from t2 order by op, a, b;
-op a b
-u 1 1.050000000000000000000000000000
-u 2 2.050000000000000000000000000000
-u 4 4.050000000000000000000000000000
-delete from t2;
-update t1, t3 set a=6 where a = 5;
-select * from t1 order by id;
-id a b
-1 6 21.050000000000000000000000000000
-2 6 22.050000000000000000000000000000
-3 3 3.050000000000000000000000000000
-4 6 24.050000000000000000000000000000
-select * from t2 order by op, a, b;
-op a b
-u 5 11.050000000000000000000000000000
-u 5 12.050000000000000000000000000000
-u 5 14.050000000000000000000000000000
-delete from t2;
-delete from t1 where a != 3;
-select * from t1 order by id;
-id a b
-3 3 3.050000000000000000000000000000
-select * from t2 order by op, a, b;
-op a b
-d 6 21.050000000000000000000000000000
-d 6 22.050000000000000000000000000000
-d 6 24.050000000000000000000000000000
-delete from t2;
-insert into t1 values (1, 1, 1.05), (2, 2, 2.05), (4, 4, 4.05);
-delete t1 from t1, t3 where a != 3;
-select * from t1 order by id;
-id a b
-3 3 3.050000000000000000000000000000
-select * from t2 order by op, a, b;
-op a b
-d 1 1.050000000000000000000000000000
-d 2 2.050000000000000000000000000000
-d 4 4.050000000000000000000000000000
-delete from t2;
-insert into t1 values (4, 4, 4.05);
-insert into t1 (id, a) values (4, 1), (3, 1) on duplicate key update a= a + 1;
-select * from t1 order by id;
-id a b
-3 4 13.050000000000000000000000000000
-4 5 14.050000000000000000000000000000
-select * from t2 order by op, a, b;
-op a b
-u 3 3.050000000000000000000000000000
-u 4 4.050000000000000000000000000000
-delete from t2;
-delete from t3;
-insert into t3 values (4), (3);
-insert into t1 (id, a) (select i, 1 from t3) on duplicate key update a= a + 1;
-select * from t1 order by id;
-id a b
-3 5 23.050000000000000000000000000000
-4 6 24.050000000000000000000000000000
-select * from t2 order by op, a, b;
-op a b
-u 4 13.050000000000000000000000000000
-u 5 14.050000000000000000000000000000
-delete from t2;
-replace into t1 (id, a) values (4, 1), (3, 1);
-select * from t1 order by id;
-id a b
-3 1 0.000000000000000000000000000000
-4 1 0.000000000000000000000000000000
-select * from t2 order by op, a, b;
-op a b
-d 5 23.050000000000000000000000000000
-d 6 24.050000000000000000000000000000
-delete from t1;
-delete from t2;
-insert into t1 values (3, 1, 1.05), (4, 1, 2.05);
-replace into t1 (id, a) (select i, 2 from t3);
-select * from t1 order by id;
-id a b
-3 2 0.000000000000000000000000000000
-4 2 0.000000000000000000000000000000
-select * from t2 order by op, a, b;
-op a b
-d 1 1.050000000000000000000000000000
-d 1 2.050000000000000000000000000000
-delete from t1;
-delete from t2;
-insert into t1 values (3, 1, 1.05), (5, 2, 2.05);
-load data infile '../std_data_ln/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (id, a);
-select * from t1 order by id;
-id a b
-3 4 0.000000000000000000000000000000
-5 6 0.000000000000000000000000000000
-select * from t2 order by op, a, b;
-op a b
-d 1 1.050000000000000000000000000000
-d 2 2.050000000000000000000000000000
-update t4 set b = 10 where a = 1;
-select * from t5 order by a;
-a b
-1 1
-update t5 set b = 0;
-delete from t4 where a = 1;
-select * from t5 order by a;
-a b
-1 1
-drop trigger t4_au;
-drop trigger t4_ad;
-drop table t1, t2, t3, t4, t5;
-CREATE TABLE t1 (
-id INT NOT NULL PRIMARY KEY,
-xy INT
-) ENGINE=ndbcluster;
-INSERT INTO t1 VALUES (1, 0);
-CREATE TRIGGER t1_update AFTER UPDATE ON t1 FOR EACH ROW BEGIN REPLACE INTO t2 SELECT * FROM t1 WHERE t1.id = NEW.id; END //
-CREATE TABLE t2 (
-id INT NOT NULL PRIMARY KEY,
-xy INT
-) ENGINE=ndbcluster;
-INSERT INTO t2 VALUES (2, 0);
-CREATE TABLE t3 (id INT NOT NULL PRIMARY KEY) ENGINE=ndbcluster;
-INSERT INTO t3 VALUES (1);
-CREATE TABLE t4 LIKE t1;
-CREATE TRIGGER t4_update AFTER UPDATE ON t4 FOR EACH ROW BEGIN REPLACE INTO t5 SELECT * FROM t4 WHERE t4.id = NEW.id; END //
-CREATE TABLE t5 LIKE t2;
-UPDATE t1 SET xy = 3 WHERE id = 1;
-SELECT xy FROM t1 where id = 1;
-xy
-3
-SELECT xy FROM t2 where id = 1;
-xy
-3
-UPDATE t1 SET xy = 4 WHERE id IN (SELECT id FROM t3 WHERE id = 1);
-SELECT xy FROM t1 where id = 1;
-xy
-4
-SELECT xy FROM t2 where id = 1;
-xy
-4
-INSERT INTO t4 SELECT * FROM t1;
-INSERT INTO t5 SELECT * FROM t2;
-UPDATE t1,t4 SET t1.xy = 3, t4.xy = 3 WHERE t1.id = 1 AND t4.id = 1;
-SELECT xy FROM t1 where id = 1;
-xy
-3
-SELECT xy FROM t2 where id = 1;
-xy
-3
-SELECT xy FROM t4 where id = 1;
-xy
-3
-SELECT xy FROM t5 where id = 1;
-xy
-3
-UPDATE t1,t4 SET t1.xy = 4, t4.xy = 4 WHERE t1.id IN (SELECT id FROM t3 WHERE id = 1) AND t4.id IN (SELECT id FROM t3 WHERE id = 1);
-SELECT xy FROM t1 where id = 1;
-xy
-4
-SELECT xy FROM t2 where id = 1;
-xy
-4
-SELECT xy FROM t4 where id = 1;
-xy
-4
-SELECT xy FROM t5 where id = 1;
-xy
-4
-INSERT INTO t1 VALUES (1,0) ON DUPLICATE KEY UPDATE xy = 5;
-SELECT xy FROM t1 where id = 1;
-xy
-5
-SELECT xy FROM t2 where id = 1;
-xy
-5
-DROP TRIGGER t1_update;
-DROP TRIGGER t4_update;
-CREATE TRIGGER t1_delete AFTER DELETE ON t1 FOR EACH ROW BEGIN REPLACE INTO t2 SELECT * FROM t1 WHERE t1.id > 4; END //
-CREATE TRIGGER t4_delete AFTER DELETE ON t4 FOR EACH ROW BEGIN REPLACE INTO t5 SELECT * FROM t4 WHERE t4.id > 4; END //
-INSERT INTO t1 VALUES (5, 0),(6,0);
-INSERT INTO t2 VALUES (5, 1),(6,1);
-INSERT INTO t3 VALUES (5);
-SELECT * FROM t1 order by id;
-id xy
-1 5
-5 0
-6 0
-SELECT * FROM t2 order by id;
-id xy
-1 5
-2 0
-5 1
-6 1
-DELETE FROM t1 WHERE id IN (SELECT id FROM t3 WHERE id = 5);
-SELECT * FROM t1 order by id;
-id xy
-1 5
-6 0
-SELECT * FROM t2 order by id;
-id xy
-1 5
-2 0
-5 1
-6 0
-INSERT INTO t1 VALUES (5,0);
-UPDATE t2 SET xy = 1 WHERE id = 6;
-TRUNCATE t4;
-INSERT INTO t4 SELECT * FROM t1;
-TRUNCATE t5;
-INSERT INTO t5 SELECT * FROM t2;
-SELECT * FROM t1 order by id;
-id xy
-1 5
-5 0
-6 0
-SELECT * FROM t2 order by id;
-id xy
-1 5
-2 0
-5 1
-6 1
-SELECT * FROM t4 order by id;
-id xy
-1 5
-5 0
-6 0
-SELECT * FROM t5 order by id;
-id xy
-1 5
-2 0
-5 1
-6 1
-DELETE FROM t1,t4 USING t1,t3,t4 WHERE t1.id IN (SELECT id FROM t3 WHERE id = 5) AND t4.id IN (SELECT id FROM t3 WHERE id = 5);
-SELECT * FROM t1 order by id;
-id xy
-1 5
-6 0
-SELECT * FROM t2 order by id;
-id xy
-1 5
-2 0
-5 1
-6 0
-SELECT * FROM t4 order by id;
-id xy
-1 5
-6 0
-SELECT * FROM t5 order by id;
-id xy
-1 5
-2 0
-5 1
-6 0
-INSERT INTO t1 VALUES (5, 0);
-REPLACE INTO t2 VALUES (6,1);
-SELECT * FROM t1 order by id;
-id xy
-1 5
-5 0
-6 0
-SELECT * FROM t2 order by id;
-id xy
-1 5
-2 0
-5 1
-6 1
-REPLACE INTO t1 VALUES (5, 1);
-SELECT * FROM t1 order by id;
-id xy
-1 5
-5 1
-6 0
-SELECT * FROM t2 order by id;
-id xy
-1 5
-2 0
-5 1
-6 0
-DROP TRIGGER t1_delete;
-DROP TRIGGER t4_delete;
-DROP TABLE t1, t2, t3, t4, t5;
-End of 5.1 tests
diff --git a/mysql-test/r/ndb_update.result b/mysql-test/r/ndb_update.result
deleted file mode 100644
index 919b8c44a40..00000000000
--- a/mysql-test/r/ndb_update.result
+++ /dev/null
@@ -1,42 +0,0 @@
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (
-pk1 INT NOT NULL PRIMARY KEY,
-b INT NOT NULL,
-c INT NOT NULL UNIQUE
-) ENGINE=ndbcluster;
-INSERT INTO t1 VALUES (0, 1, 0),(1,2,1),(2,3,2);
-UPDATE t1 set b = c;
-select * from t1 order by pk1;
-pk1 b c
-0 0 0
-1 1 1
-2 2 2
-UPDATE t1 set pk1 = 4 where pk1 = 1;
-select * from t1 order by pk1;
-pk1 b c
-0 0 0
-2 2 2
-4 1 1
-UPDATE t1 set pk1 = 4 where pk1 = 2;
-ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
-UPDATE IGNORE t1 set pk1 = 4 where pk1 = 2;
-select * from t1 order by pk1;
-pk1 b c
-0 0 0
-2 2 2
-4 1 1
-UPDATE t1 set pk1 = 1, c = 2 where pk1 = 4;
-ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
-UPDATE IGNORE t1 set pk1 = 1, c = 2 where pk1 = 4;
-select * from t1 order by pk1;
-pk1 b c
-0 0 0
-2 2 2
-4 1 1
-UPDATE t1 set pk1 = pk1 + 10;
-select * from t1 order by pk1;
-pk1 b c
-10 0 0
-12 2 2
-14 1 1
-DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result
index f5544b4d115..67c45b698ce 100644
--- a/mysql-test/r/olap.result
+++ b/mysql-test/r/olap.result
@@ -696,8 +696,8 @@ CREATE VIEW v1 AS
SELECT a, LENGTH(a), COUNT(*) FROM t1 GROUP BY a WITH ROLLUP;
DESC v1;
Field Type Null Key Default Extra
-a int(11) YES 0
-LENGTH(a) int(10) YES NULL
+a bigint(11) YES NULL
+LENGTH(a) bigint(10) YES NULL
COUNT(*) bigint(21) NO 0
SELECT * FROM v1;
a LENGTH(a) COUNT(*)
diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result
index c01a9643e8a..a042d0a5dc3 100644
--- a/mysql-test/r/openssl_1.result
+++ b/mysql-test/r/openssl_1.result
@@ -73,8 +73,8 @@ variable_name LIKE 'SSL_CALLBACK_CACHE_HITS';
END$$
SELECT variable_name, variable_value FROM thread_status;
variable_name variable_value
-SSL_ACCEPTS 0.0000000
-SSL_CALLBACK_CACHE_HITS 0.0000000
+SSL_ACCEPTS 0
+SSL_CALLBACK_CACHE_HITS 0
DROP TABLE thread_status;
SET GLOBAL event_scheduler=0;
End of 5.1 tests
@@ -99,9 +99,12 @@ INSERT INTO t1 VALUES (1), (2);
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
);
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -130,9 +133,12 @@ UNLOCK TABLES;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
);
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -161,9 +167,12 @@ UNLOCK TABLES;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
);
+SET character_set_client = @saved_cs_client;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result
index 25fbeadf21b..ff4882d6cd8 100644
--- a/mysql-test/r/order_by.result
+++ b/mysql-test/r/order_by.result
@@ -1073,3 +1073,61 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const PRIMARY,b b 5 const 1
1 SIMPLE t2 ref a a 5 const 2 Using where; Using index
DROP TABLE t1,t2;
+CREATE TABLE t1(
+id int auto_increment PRIMARY KEY, c2 int, c3 int, INDEX k2(c2), INDEX k3(c3));
+INSERT INTO t1 (c2,c3) VALUES
+(31,34),(35,38),(34,31),(32,35),(31,39),
+(11,14),(15,18),(14,11),(12,15),(11,19);
+INSERT INTO t1 (c2,c3) SELECT c2,c3 FROM t1;
+INSERT INTO t1 (c2,c3) SELECT c2,c3 FROM t1;
+INSERT INTO t1 (c2,c3) SELECT c2,c3 FROM t1;
+INSERT INTO t1 (c2,c3) SELECT c2,c3 FROM t1;
+INSERT INTO t1 (c2,c3) SELECT c2,c3 FROM t1;
+INSERT INTO t1 (c2,c3) SELECT c2,c3 FROM t1;
+INSERT INTO t1 (c2,c3) SELECT c2,c3 FROM t1;
+INSERT INTO t1 (c2,c3) SELECT c2,c3 FROM t1;
+INSERT INTO t1 (c2,c3) SELECT c2,c3 FROM t1;
+INSERT INTO t1 (c2,c3) SELECT c2,c3 FROM t1;
+INSERT INTO t1 (c2,c3) SELECT c2,c3 FROM t1;
+INSERT INTO t1 (c2,c3) SELECT c2,c3 FROM t1;
+UPDATE t1 SET c2=20 WHERE id%100 = 0;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+40960
+CREATE TABLE t2 LIKE t1;
+INSERT INTO t2 SELECT * FROM t1 ORDER BY id;
+EXPLAIN SELECT id,c3 FROM t2 WHERE c2=11 ORDER BY c3 LIMIT 20;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 index k2 k3 5 NULL 111 Using where
+EXPLAIN SELECT id,c3 FROM t2 WHERE c2=11 ORDER BY c3 LIMIT 4000;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref k2 k2 5 const 7341 Using where; Using filesort
+EXPLAIN SELECT id,c3 FROM t2 WHERE c2 BETWEEN 10 AND 12 ORDER BY c3 LIMIT 20;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 index k2 k3 5 NULL 73 Using where
+EXPLAIN SELECT id,c3 FROM t2 WHERE c2 BETWEEN 20 AND 30 ORDER BY c3 LIMIT 4000;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range k2 k2 5 NULL 386 Using where; Using filesort
+SELECT id,c3 FROM t2 WHERE c2=11 ORDER BY c3 LIMIT 20;
+id c3
+6 14
+16 14
+26 14
+36 14
+46 14
+56 14
+66 14
+76 14
+86 14
+96 14
+106 14
+116 14
+126 14
+136 14
+146 14
+156 14
+166 14
+176 14
+186 14
+196 14
+DROP TABLE t1,t2;
diff --git a/mysql-test/r/parser.result b/mysql-test/r/parser.result
index cb44a235f25..76326f65f08 100644
--- a/mysql-test/r/parser.result
+++ b/mysql-test/r/parser.result
@@ -273,6 +273,16 @@ create table VAR_SAMP(a 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 'VAR_SAMP(a int)' at line 1
create table VAR_SAMP (a 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 'VAR_SAMP (a int)' at line 1
+DROP TABLE IF EXISTS table_25930_a;
+DROP TABLE IF EXISTS table_25930_b;
+SET SQL_MODE = 'ANSI_QUOTES';
+CREATE TABLE table_25930_a ( "blah" INT );
+CREATE TABLE table_25930_b SELECT "blah" - 1 FROM table_25930_a;
+desc table_25930_b;
+Field Type Null Key Default Extra
+"blah" - 1 bigint(12) YES NULL
+DROP TABLE table_25930_a;
+DROP TABLE table_25930_b;
SET @@sql_mode=@save_sql_mode;
select pi(3.14);
ERROR 42000: Incorrect parameter count in the call to native function 'pi'
diff --git a/mysql-test/r/parser_precedence.result b/mysql-test/r/parser_precedence.result
new file mode 100644
index 00000000000..cf301ec677b
--- /dev/null
+++ b/mysql-test/r/parser_precedence.result
@@ -0,0 +1,747 @@
+drop table if exists t1_30237_bool;
+create table t1_30237_bool(A boolean, B boolean, C boolean);
+insert into t1_30237_bool values
+(FALSE, FALSE, FALSE),
+(FALSE, FALSE, NULL),
+(FALSE, FALSE, TRUE),
+(FALSE, NULL, FALSE),
+(FALSE, NULL, NULL),
+(FALSE, NULL, TRUE),
+(FALSE, TRUE, FALSE),
+(FALSE, TRUE, NULL),
+(FALSE, TRUE, TRUE),
+(NULL, FALSE, FALSE),
+(NULL, FALSE, NULL),
+(NULL, FALSE, TRUE),
+(NULL, NULL, FALSE),
+(NULL, NULL, NULL),
+(NULL, NULL, TRUE),
+(NULL, TRUE, FALSE),
+(NULL, TRUE, NULL),
+(NULL, TRUE, TRUE),
+(TRUE, FALSE, FALSE),
+(TRUE, FALSE, NULL),
+(TRUE, FALSE, TRUE),
+(TRUE, NULL, FALSE),
+(TRUE, NULL, NULL),
+(TRUE, NULL, TRUE),
+(TRUE, TRUE, FALSE),
+(TRUE, TRUE, NULL),
+(TRUE, TRUE, TRUE) ;
+Testing OR, XOR, AND
+select A, B, A OR B, A XOR B, A AND B
+from t1_30237_bool where C is null order by A, B;
+A B A OR B A XOR B A AND B
+NULL NULL NULL NULL NULL
+NULL 0 NULL NULL 0
+NULL 1 1 NULL NULL
+0 NULL NULL NULL 0
+0 0 0 0 0
+0 1 1 1 0
+1 NULL 1 NULL NULL
+1 0 1 1 0
+1 1 1 0 1
+Testing that OR is associative
+select A, B, C, (A OR B) OR C, A OR (B OR C), A OR B OR C
+from t1_30237_bool order by A, B, C;
+A B C (A OR B) OR C A OR (B OR C) A OR B OR C
+NULL NULL NULL NULL NULL NULL
+NULL NULL 0 NULL NULL NULL
+NULL NULL 1 1 1 1
+NULL 0 NULL NULL NULL NULL
+NULL 0 0 NULL NULL NULL
+NULL 0 1 1 1 1
+NULL 1 NULL 1 1 1
+NULL 1 0 1 1 1
+NULL 1 1 1 1 1
+0 NULL NULL NULL NULL NULL
+0 NULL 0 NULL NULL NULL
+0 NULL 1 1 1 1
+0 0 NULL NULL NULL NULL
+0 0 0 0 0 0
+0 0 1 1 1 1
+0 1 NULL 1 1 1
+0 1 0 1 1 1
+0 1 1 1 1 1
+1 NULL NULL 1 1 1
+1 NULL 0 1 1 1
+1 NULL 1 1 1 1
+1 0 NULL 1 1 1
+1 0 0 1 1 1
+1 0 1 1 1 1
+1 1 NULL 1 1 1
+1 1 0 1 1 1
+1 1 1 1 1 1
+select count(*) from t1_30237_bool
+where ((A OR B) OR C) != (A OR (B OR C));
+count(*)
+0
+Testing that XOR is associative
+select A, B, C, (A XOR B) XOR C, A XOR (B XOR C), A XOR B XOR C
+from t1_30237_bool order by A, B, C;
+A B C (A XOR B) XOR C A XOR (B XOR C) A XOR B XOR C
+NULL NULL NULL NULL NULL NULL
+NULL NULL 0 NULL NULL NULL
+NULL NULL 1 NULL NULL NULL
+NULL 0 NULL NULL NULL NULL
+NULL 0 0 NULL NULL NULL
+NULL 0 1 NULL NULL NULL
+NULL 1 NULL NULL NULL NULL
+NULL 1 0 NULL NULL NULL
+NULL 1 1 NULL NULL NULL
+0 NULL NULL NULL NULL NULL
+0 NULL 0 NULL NULL NULL
+0 NULL 1 NULL NULL NULL
+0 0 NULL NULL NULL NULL
+0 0 0 0 0 0
+0 0 1 1 1 1
+0 1 NULL NULL NULL NULL
+0 1 0 1 1 1
+0 1 1 0 0 0
+1 NULL NULL NULL NULL NULL
+1 NULL 0 NULL NULL NULL
+1 NULL 1 NULL NULL NULL
+1 0 NULL NULL NULL NULL
+1 0 0 1 1 1
+1 0 1 0 0 0
+1 1 NULL NULL NULL NULL
+1 1 0 0 0 0
+1 1 1 1 1 1
+select count(*) from t1_30237_bool
+where ((A XOR B) XOR C) != (A XOR (B XOR C));
+count(*)
+0
+Testing that AND is associative
+select A, B, C, (A AND B) AND C, A AND (B AND C), A AND B AND C
+from t1_30237_bool order by A, B, C;
+A B C (A AND B) AND C A AND (B AND C) A AND B AND C
+NULL NULL NULL NULL NULL NULL
+NULL NULL 0 0 0 0
+NULL NULL 1 NULL NULL NULL
+NULL 0 NULL 0 0 0
+NULL 0 0 0 0 0
+NULL 0 1 0 0 0
+NULL 1 NULL NULL NULL NULL
+NULL 1 0 0 0 0
+NULL 1 1 NULL NULL NULL
+0 NULL NULL 0 0 0
+0 NULL 0 0 0 0
+0 NULL 1 0 0 0
+0 0 NULL 0 0 0
+0 0 0 0 0 0
+0 0 1 0 0 0
+0 1 NULL 0 0 0
+0 1 0 0 0 0
+0 1 1 0 0 0
+1 NULL NULL NULL NULL NULL
+1 NULL 0 0 0 0
+1 NULL 1 NULL NULL NULL
+1 0 NULL 0 0 0
+1 0 0 0 0 0
+1 0 1 0 0 0
+1 1 NULL NULL NULL NULL
+1 1 0 0 0 0
+1 1 1 1 1 1
+select count(*) from t1_30237_bool
+where ((A AND B) AND C) != (A AND (B AND C));
+count(*)
+0
+Testing that AND has precedence over OR
+select A, B, C, (A OR B) AND C, A OR (B AND C), A OR B AND C
+from t1_30237_bool order by A, B, C;
+A B C (A OR B) AND C A OR (B AND C) A OR B AND C
+NULL NULL NULL NULL NULL NULL
+NULL NULL 0 0 NULL NULL
+NULL NULL 1 NULL NULL NULL
+NULL 0 NULL NULL NULL NULL
+NULL 0 0 0 NULL NULL
+NULL 0 1 NULL NULL NULL
+NULL 1 NULL NULL NULL NULL
+NULL 1 0 0 NULL NULL
+NULL 1 1 1 1 1
+0 NULL NULL NULL NULL NULL
+0 NULL 0 0 0 0
+0 NULL 1 NULL NULL NULL
+0 0 NULL 0 0 0
+0 0 0 0 0 0
+0 0 1 0 0 0
+0 1 NULL NULL NULL NULL
+0 1 0 0 0 0
+0 1 1 1 1 1
+1 NULL NULL NULL 1 1
+1 NULL 0 0 1 1
+1 NULL 1 1 1 1
+1 0 NULL NULL 1 1
+1 0 0 0 1 1
+1 0 1 1 1 1
+1 1 NULL NULL 1 1
+1 1 0 0 1 1
+1 1 1 1 1 1
+select count(*) from t1_30237_bool
+where (A OR (B AND C)) != (A OR B AND C);
+count(*)
+0
+select A, B, C, (A AND B) OR C, A AND (B OR C), A AND B OR C
+from t1_30237_bool order by A, B, C;
+A B C (A AND B) OR C A AND (B OR C) A AND B OR C
+NULL NULL NULL NULL NULL NULL
+NULL NULL 0 NULL NULL NULL
+NULL NULL 1 1 NULL 1
+NULL 0 NULL NULL NULL NULL
+NULL 0 0 0 0 0
+NULL 0 1 1 NULL 1
+NULL 1 NULL NULL NULL NULL
+NULL 1 0 NULL NULL NULL
+NULL 1 1 1 NULL 1
+0 NULL NULL NULL 0 NULL
+0 NULL 0 0 0 0
+0 NULL 1 1 0 1
+0 0 NULL NULL 0 NULL
+0 0 0 0 0 0
+0 0 1 1 0 1
+0 1 NULL NULL 0 NULL
+0 1 0 0 0 0
+0 1 1 1 0 1
+1 NULL NULL NULL NULL NULL
+1 NULL 0 NULL NULL NULL
+1 NULL 1 1 1 1
+1 0 NULL NULL NULL NULL
+1 0 0 0 0 0
+1 0 1 1 1 1
+1 1 NULL 1 1 1
+1 1 0 1 1 1
+1 1 1 1 1 1
+select count(*) from t1_30237_bool
+where ((A AND B) OR C) != (A AND B OR C);
+count(*)
+0
+Testing that AND has precedence over XOR
+select A, B, C, (A XOR B) AND C, A XOR (B AND C), A XOR B AND C
+from t1_30237_bool order by A, B, C;
+A B C (A XOR B) AND C A XOR (B AND C) A XOR B AND C
+NULL NULL NULL NULL NULL NULL
+NULL NULL 0 0 NULL NULL
+NULL NULL 1 NULL NULL NULL
+NULL 0 NULL NULL NULL NULL
+NULL 0 0 0 NULL NULL
+NULL 0 1 NULL NULL NULL
+NULL 1 NULL NULL NULL NULL
+NULL 1 0 0 NULL NULL
+NULL 1 1 NULL NULL NULL
+0 NULL NULL NULL NULL NULL
+0 NULL 0 0 0 0
+0 NULL 1 NULL NULL NULL
+0 0 NULL 0 0 0
+0 0 0 0 0 0
+0 0 1 0 0 0
+0 1 NULL NULL NULL NULL
+0 1 0 0 0 0
+0 1 1 1 1 1
+1 NULL NULL NULL NULL NULL
+1 NULL 0 0 1 1
+1 NULL 1 NULL NULL NULL
+1 0 NULL NULL 1 1
+1 0 0 0 1 1
+1 0 1 1 1 1
+1 1 NULL 0 NULL NULL
+1 1 0 0 1 1
+1 1 1 0 0 0
+select count(*) from t1_30237_bool
+where (A XOR (B AND C)) != (A XOR B AND C);
+count(*)
+0
+select A, B, C, (A AND B) XOR C, A AND (B XOR C), A AND B XOR C
+from t1_30237_bool order by A, B, C;
+A B C (A AND B) XOR C A AND (B XOR C) A AND B XOR C
+NULL NULL NULL NULL NULL NULL
+NULL NULL 0 NULL NULL NULL
+NULL NULL 1 NULL NULL NULL
+NULL 0 NULL NULL NULL NULL
+NULL 0 0 0 0 0
+NULL 0 1 1 NULL 1
+NULL 1 NULL NULL NULL NULL
+NULL 1 0 NULL NULL NULL
+NULL 1 1 NULL 0 NULL
+0 NULL NULL NULL 0 NULL
+0 NULL 0 0 0 0
+0 NULL 1 1 0 1
+0 0 NULL NULL 0 NULL
+0 0 0 0 0 0
+0 0 1 1 0 1
+0 1 NULL NULL 0 NULL
+0 1 0 0 0 0
+0 1 1 1 0 1
+1 NULL NULL NULL NULL NULL
+1 NULL 0 NULL NULL NULL
+1 NULL 1 NULL NULL NULL
+1 0 NULL NULL NULL NULL
+1 0 0 0 0 0
+1 0 1 1 1 1
+1 1 NULL NULL NULL NULL
+1 1 0 1 1 1
+1 1 1 0 0 0
+select count(*) from t1_30237_bool
+where ((A AND B) XOR C) != (A AND B XOR C);
+count(*)
+0
+Testing that XOR has precedence over OR
+select A, B, C, (A XOR B) OR C, A XOR (B OR C), A XOR B OR C
+from t1_30237_bool order by A, B, C;
+A B C (A XOR B) OR C A XOR (B OR C) A XOR B OR C
+NULL NULL NULL NULL NULL NULL
+NULL NULL 0 NULL NULL NULL
+NULL NULL 1 1 NULL 1
+NULL 0 NULL NULL NULL NULL
+NULL 0 0 NULL NULL NULL
+NULL 0 1 1 NULL 1
+NULL 1 NULL NULL NULL NULL
+NULL 1 0 NULL NULL NULL
+NULL 1 1 1 NULL 1
+0 NULL NULL NULL NULL NULL
+0 NULL 0 NULL NULL NULL
+0 NULL 1 1 1 1
+0 0 NULL NULL NULL NULL
+0 0 0 0 0 0
+0 0 1 1 1 1
+0 1 NULL 1 1 1
+0 1 0 1 1 1
+0 1 1 1 1 1
+1 NULL NULL NULL NULL NULL
+1 NULL 0 NULL NULL NULL
+1 NULL 1 1 0 1
+1 0 NULL 1 NULL 1
+1 0 0 1 1 1
+1 0 1 1 0 1
+1 1 NULL NULL 0 NULL
+1 1 0 0 0 0
+1 1 1 1 0 1
+select count(*) from t1_30237_bool
+where ((A XOR B) OR C) != (A XOR B OR C);
+count(*)
+0
+select A, B, C, (A OR B) XOR C, A OR (B XOR C), A OR B XOR C
+from t1_30237_bool order by A, B, C;
+A B C (A OR B) XOR C A OR (B XOR C) A OR B XOR C
+NULL NULL NULL NULL NULL NULL
+NULL NULL 0 NULL NULL NULL
+NULL NULL 1 NULL NULL NULL
+NULL 0 NULL NULL NULL NULL
+NULL 0 0 NULL NULL NULL
+NULL 0 1 NULL 1 1
+NULL 1 NULL NULL NULL NULL
+NULL 1 0 1 1 1
+NULL 1 1 0 NULL NULL
+0 NULL NULL NULL NULL NULL
+0 NULL 0 NULL NULL NULL
+0 NULL 1 NULL NULL NULL
+0 0 NULL NULL NULL NULL
+0 0 0 0 0 0
+0 0 1 1 1 1
+0 1 NULL NULL NULL NULL
+0 1 0 1 1 1
+0 1 1 0 0 0
+1 NULL NULL NULL 1 1
+1 NULL 0 1 1 1
+1 NULL 1 0 1 1
+1 0 NULL NULL 1 1
+1 0 0 1 1 1
+1 0 1 0 1 1
+1 1 NULL NULL 1 1
+1 1 0 1 1 1
+1 1 1 0 1 1
+select count(*) from t1_30237_bool
+where (A OR (B XOR C)) != (A OR B XOR C);
+count(*)
+0
+drop table t1_30237_bool;
+Testing that NOT has precedence over OR
+select (NOT FALSE) OR TRUE, NOT (FALSE OR TRUE), NOT FALSE OR TRUE;
+(NOT FALSE) OR TRUE NOT (FALSE OR TRUE) NOT FALSE OR TRUE
+1 0 1
+Testing that NOT has precedence over XOR
+select (NOT FALSE) XOR FALSE, NOT (FALSE XOR FALSE), NOT FALSE XOR FALSE;
+(NOT FALSE) XOR FALSE NOT (FALSE XOR FALSE) NOT FALSE XOR FALSE
+1 1 1
+Testing that NOT has precedence over AND
+select (NOT FALSE) AND FALSE, NOT (FALSE AND FALSE), NOT FALSE AND FALSE;
+(NOT FALSE) AND FALSE NOT (FALSE AND FALSE) NOT FALSE AND FALSE
+0 1 0
+Testing that NOT is associative
+select NOT NOT TRUE, NOT NOT NOT FALSE;
+NOT NOT TRUE NOT NOT NOT FALSE
+1 1
+Testing that IS has precedence over NOT
+select (NOT NULL) IS TRUE, NOT (NULL IS TRUE), NOT NULL IS TRUE;
+(NOT NULL) IS TRUE NOT (NULL IS TRUE) NOT NULL IS TRUE
+0 1 1
+select (NOT NULL) IS NOT TRUE, NOT (NULL IS NOT TRUE), NOT NULL IS NOT TRUE;
+(NOT NULL) IS NOT TRUE NOT (NULL IS NOT TRUE) NOT NULL IS NOT TRUE
+1 0 0
+select (NOT NULL) IS FALSE, NOT (NULL IS FALSE), NOT NULL IS FALSE;
+(NOT NULL) IS FALSE NOT (NULL IS FALSE) NOT NULL IS FALSE
+0 1 1
+select (NOT NULL) IS NOT FALSE, NOT (NULL IS NOT FALSE), NOT NULL IS NOT FALSE;
+(NOT NULL) IS NOT FALSE NOT (NULL IS NOT FALSE) NOT NULL IS NOT FALSE
+1 0 0
+select (NOT TRUE) IS UNKNOWN, NOT (TRUE IS UNKNOWN), NOT TRUE IS UNKNOWN;
+(NOT TRUE) IS UNKNOWN NOT (TRUE IS UNKNOWN) NOT TRUE IS UNKNOWN
+0 1 1
+select (NOT TRUE) IS NOT UNKNOWN, NOT (TRUE IS NOT UNKNOWN), NOT TRUE IS NOT UNKNOWN;
+(NOT TRUE) IS NOT UNKNOWN NOT (TRUE IS NOT UNKNOWN) NOT TRUE IS NOT UNKNOWN
+1 0 0
+select (NOT TRUE) IS NULL, NOT (TRUE IS NULL), NOT TRUE IS NULL;
+(NOT TRUE) IS NULL NOT (TRUE IS NULL) NOT TRUE IS NULL
+0 1 1
+select (NOT TRUE) IS NOT NULL, NOT (TRUE IS NOT NULL), NOT TRUE IS NOT NULL;
+(NOT TRUE) IS NOT NULL NOT (TRUE IS NOT NULL) NOT TRUE IS NOT NULL
+1 0 0
+Testing that IS [NOT] TRUE/FALSE/UNKNOWN predicates are not associative
+select TRUE IS TRUE IS TRUE IS 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 'IS TRUE IS TRUE' at line 1
+select FALSE IS NOT TRUE IS NOT TRUE IS NOT 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 'IS NOT TRUE IS NOT TRUE' at line 1
+select NULL IS FALSE IS FALSE IS FALSE;
+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 'IS FALSE IS FALSE' at line 1
+select TRUE IS NOT FALSE IS NOT FALSE IS NOT FALSE;
+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 'IS NOT FALSE IS NOT FALSE' at line 1
+select FALSE IS UNKNOWN IS UNKNOWN IS UNKNOWN;
+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 'IS UNKNOWN IS UNKNOWN' at line 1
+select TRUE IS NOT UNKNOWN IS NOT UNKNOWN IS NOT UNKNOWN;
+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 'IS NOT UNKNOWN IS NOT UNKNOWN' at line 1
+Testing that IS [NOT] NULL predicates are associative
+select FALSE IS NULL IS NULL IS NULL;
+FALSE IS NULL IS NULL IS NULL
+0
+select TRUE IS NOT NULL IS NOT NULL IS NOT NULL;
+TRUE IS NOT NULL IS NOT NULL IS NOT NULL
+1
+Testing that comparison operators are left associative
+select 1 <=> 2 <=> 2, (1 <=> 2) <=> 2, 1 <=> (2 <=> 2);
+1 <=> 2 <=> 2 (1 <=> 2) <=> 2 1 <=> (2 <=> 2)
+0 0 1
+select 1 = 2 = 2, (1 = 2) = 2, 1 = (2 = 2);
+1 = 2 = 2 (1 = 2) = 2 1 = (2 = 2)
+0 0 1
+select 1 != 2 != 3, (1 != 2) != 3, 1 != (2 != 3);
+1 != 2 != 3 (1 != 2) != 3 1 != (2 != 3)
+1 1 0
+select 1 <> 2 <> 3, (1 <> 2) <> 3, 1 <> (2 <> 3);
+1 <> 2 <> 3 (1 <> 2) <> 3 1 <> (2 <> 3)
+1 1 0
+select 1 < 2 < 3, (1 < 2) < 3, 1 < (2 < 3);
+1 < 2 < 3 (1 < 2) < 3 1 < (2 < 3)
+1 1 0
+select 3 <= 2 <= 1, (3 <= 2) <= 1, 3 <= (2 <= 1);
+3 <= 2 <= 1 (3 <= 2) <= 1 3 <= (2 <= 1)
+1 1 0
+select 1 > 2 > 3, (1 > 2) > 3, 1 > (2 > 3);
+1 > 2 > 3 (1 > 2) > 3 1 > (2 > 3)
+0 0 1
+select 1 >= 2 >= 3, (1 >= 2) >= 3, 1 >= (2 >= 3);
+1 >= 2 >= 3 (1 >= 2) >= 3 1 >= (2 >= 3)
+0 0 1
+Testing that | is associative
+select 0xF0 | 0x0F | 0x55, (0xF0 | 0x0F) | 0x55, 0xF0 | (0x0F | 0x55);
+0xF0 | 0x0F | 0x55 (0xF0 | 0x0F) | 0x55 0xF0 | (0x0F | 0x55)
+255 255 255
+Testing that & is associative
+select 0xF5 & 0x5F & 0x55, (0xF5 & 0x5F) & 0x55, 0xF5 & (0x5F & 0x55);
+0xF5 & 0x5F & 0x55 (0xF5 & 0x5F) & 0x55 0xF5 & (0x5F & 0x55)
+85 85 85
+Testing that << is left associative
+select 4 << 3 << 2, (4 << 3) << 2, 4 << (3 << 2);
+4 << 3 << 2 (4 << 3) << 2 4 << (3 << 2)
+128 128 16384
+Testing that >> is left associative
+select 256 >> 3 >> 2, (256 >> 3) >> 2, 256 >> (3 >> 2);
+256 >> 3 >> 2 (256 >> 3) >> 2 256 >> (3 >> 2)
+8 8 256
+Testing that & has precedence over |
+select 0xF0 & 0x0F | 0x55, (0xF0 & 0x0F) | 0x55, 0xF0 & (0x0F | 0x55);
+0xF0 & 0x0F | 0x55 (0xF0 & 0x0F) | 0x55 0xF0 & (0x0F | 0x55)
+85 85 80
+select 0x55 | 0xF0 & 0x0F, (0x55 | 0xF0) & 0x0F, 0x55 | (0xF0 & 0x0F);
+0x55 | 0xF0 & 0x0F (0x55 | 0xF0) & 0x0F 0x55 | (0xF0 & 0x0F)
+85 5 85
+Testing that << has precedence over |
+select 0x0F << 4 | 0x0F, (0x0F << 4) | 0x0F, 0x0F << (4 | 0x0F);
+0x0F << 4 | 0x0F (0x0F << 4) | 0x0F 0x0F << (4 | 0x0F)
+255 255 491520
+select 0x0F | 0x0F << 4, (0x0F | 0x0F) << 4, 0x0F | (0x0F << 4);
+0x0F | 0x0F << 4 (0x0F | 0x0F) << 4 0x0F | (0x0F << 4)
+255 240 255
+Testing that >> has precedence over |
+select 0xF0 >> 4 | 0xFF, (0xF0 >> 4) | 0xFF, 0xF0 >> (4 | 0xFF);
+0xF0 >> 4 | 0xFF (0xF0 >> 4) | 0xFF 0xF0 >> (4 | 0xFF)
+255 255 0
+select 0xFF | 0xF0 >> 4, (0xFF | 0xF0) >> 4, 0xFF | (0xF0 >> 4);
+0xFF | 0xF0 >> 4 (0xFF | 0xF0) >> 4 0xFF | (0xF0 >> 4)
+255 15 255
+Testing that << has precedence over &
+select 0x0F << 4 & 0xF0, (0x0F << 4) & 0xF0, 0x0F << (4 & 0xF0);
+0x0F << 4 & 0xF0 (0x0F << 4) & 0xF0 0x0F << (4 & 0xF0)
+240 240 15
+select 0xF0 & 0x0F << 4, (0xF0 & 0x0F) << 4, 0xF0 & (0x0F << 4);
+0xF0 & 0x0F << 4 (0xF0 & 0x0F) << 4 0xF0 & (0x0F << 4)
+240 0 240
+Testing that >> has precedence over &
+select 0xF0 >> 4 & 0x55, (0xF0 >> 4) & 0x55, 0xF0 >> (4 & 0x55);
+0xF0 >> 4 & 0x55 (0xF0 >> 4) & 0x55 0xF0 >> (4 & 0x55)
+5 5 15
+select 0x0F & 0xF0 >> 4, (0x0F & 0xF0) >> 4, 0x0F & (0xF0 >> 4);
+0x0F & 0xF0 >> 4 (0x0F & 0xF0) >> 4 0x0F & (0xF0 >> 4)
+15 0 15
+Testing that >> and << have the same precedence
+select 0xFF >> 4 << 2, (0xFF >> 4) << 2, 0xFF >> (4 << 2);
+0xFF >> 4 << 2 (0xFF >> 4) << 2 0xFF >> (4 << 2)
+60 60 0
+select 0x0F << 4 >> 2, (0x0F << 4) >> 2, 0x0F << (4 >> 2);
+0x0F << 4 >> 2 (0x0F << 4) >> 2 0x0F << (4 >> 2)
+60 60 30
+Testing that binary + is associative
+select 1 + 2 + 3, (1 + 2) + 3, 1 + (2 + 3);
+1 + 2 + 3 (1 + 2) + 3 1 + (2 + 3)
+6 6 6
+Testing that binary - is left associative
+select 1 - 2 - 3, (1 - 2) - 3, 1 - (2 - 3);
+1 - 2 - 3 (1 - 2) - 3 1 - (2 - 3)
+-4 -4 2
+Testing that binary + and binary - have the same precedence
+select 1 + 2 - 3, (1 + 2) - 3, 1 + (2 - 3);
+1 + 2 - 3 (1 + 2) - 3 1 + (2 - 3)
+0 0 0
+select 1 - 2 + 3, (1 - 2) + 3, 1 - (2 + 3);
+1 - 2 + 3 (1 - 2) + 3 1 - (2 + 3)
+2 2 -4
+Testing that binary + has precedence over |
+select 0xF0 + 0x0F | 0x55, (0xF0 + 0x0F) | 0x55, 0xF0 + (0x0F | 0x55);
+0xF0 + 0x0F | 0x55 (0xF0 + 0x0F) | 0x55 0xF0 + (0x0F | 0x55)
+255 255 335
+select 0x55 | 0xF0 + 0x0F, (0x55 | 0xF0) + 0x0F, 0x55 | (0xF0 + 0x0F);
+0x55 | 0xF0 + 0x0F (0x55 | 0xF0) + 0x0F 0x55 | (0xF0 + 0x0F)
+255 260 255
+Testing that binary + has precedence over &
+select 0xF0 + 0x0F & 0x55, (0xF0 + 0x0F) & 0x55, 0xF0 + (0x0F & 0x55);
+0xF0 + 0x0F & 0x55 (0xF0 + 0x0F) & 0x55 0xF0 + (0x0F & 0x55)
+85 85 245
+select 0x55 & 0xF0 + 0x0F, (0x55 & 0xF0) + 0x0F, 0x55 & (0xF0 + 0x0F);
+0x55 & 0xF0 + 0x0F (0x55 & 0xF0) + 0x0F 0x55 & (0xF0 + 0x0F)
+85 95 85
+Testing that binary + has precedence over <<
+select 2 + 3 << 4, (2 + 3) << 4, 2 + (3 << 4);
+2 + 3 << 4 (2 + 3) << 4 2 + (3 << 4)
+80 80 50
+select 3 << 4 + 2, (3 << 4) + 2, 3 << (4 + 2);
+3 << 4 + 2 (3 << 4) + 2 3 << (4 + 2)
+192 50 192
+Testing that binary + has precedence over >>
+select 4 + 3 >> 2, (4 + 3) >> 2, 4 + (3 >> 2);
+4 + 3 >> 2 (4 + 3) >> 2 4 + (3 >> 2)
+1 1 4
+select 3 >> 2 + 1, (3 >> 2) + 1, 3 >> (2 + 1);
+3 >> 2 + 1 (3 >> 2) + 1 3 >> (2 + 1)
+0 1 0
+Testing that binary - has precedence over |
+select 0xFF - 0x0F | 0x55, (0xFF - 0x0F) | 0x55, 0xFF - (0x0F | 0x55);
+0xFF - 0x0F | 0x55 (0xFF - 0x0F) | 0x55 0xFF - (0x0F | 0x55)
+245 245 160
+select 0x55 | 0xFF - 0xF0, (0x55 | 0xFF) - 0xF0, 0x55 | (0xFF - 0xF0);
+0x55 | 0xFF - 0xF0 (0x55 | 0xFF) - 0xF0 0x55 | (0xFF - 0xF0)
+95 15 95
+Testing that binary - has precedence over &
+select 0xFF - 0xF0 & 0x55, (0xFF - 0xF0) & 0x55, 0xFF - (0xF0 & 0x55);
+0xFF - 0xF0 & 0x55 (0xFF - 0xF0) & 0x55 0xFF - (0xF0 & 0x55)
+5 5 175
+select 0x55 & 0xFF - 0xF0, (0x55 & 0xFF) - 0xF0, 0x55 & (0xFF - 0xF0);
+0x55 & 0xFF - 0xF0 (0x55 & 0xFF) - 0xF0 0x55 & (0xFF - 0xF0)
+5 -155 5
+Testing that binary - has precedence over <<
+select 16 - 3 << 2, (16 - 3) << 2, 16 - (3 << 2);
+16 - 3 << 2 (16 - 3) << 2 16 - (3 << 2)
+52 52 4
+select 4 << 3 - 2, (4 << 3) - 2, 4 << (3 - 2);
+4 << 3 - 2 (4 << 3) - 2 4 << (3 - 2)
+8 30 8
+Testing that binary - has precedence over >>
+select 16 - 3 >> 2, (16 - 3) >> 2, 16 - (3 >> 2);
+16 - 3 >> 2 (16 - 3) >> 2 16 - (3 >> 2)
+3 3 16
+select 16 >> 3 - 2, (16 >> 3) - 2, 16 >> (3 - 2);
+16 >> 3 - 2 (16 >> 3) - 2 16 >> (3 - 2)
+8 0 8
+Testing that * is associative
+select 2 * 3 * 4, (2 * 3) * 4, 2 * (3 * 4);
+2 * 3 * 4 (2 * 3) * 4 2 * (3 * 4)
+24 24 24
+Testing that * has precedence over |
+select 2 * 0x40 | 0x0F, (2 * 0x40) | 0x0F, 2 * (0x40 | 0x0F);
+2 * 0x40 | 0x0F (2 * 0x40) | 0x0F 2 * (0x40 | 0x0F)
+143 143 158
+select 0x0F | 2 * 0x40, (0x0F | 2) * 0x40, 0x0F | (2 * 0x40);
+0x0F | 2 * 0x40 (0x0F | 2) * 0x40 0x0F | (2 * 0x40)
+143 960 143
+Testing that * has precedence over &
+select 2 * 0x40 & 0x55, (2 * 0x40) & 0x55, 2 * (0x40 & 0x55);
+2 * 0x40 & 0x55 (2 * 0x40) & 0x55 2 * (0x40 & 0x55)
+0 0 128
+select 0xF0 & 2 * 0x40, (0xF0 & 2) * 0x40, 0xF0 & (2 * 0x40);
+0xF0 & 2 * 0x40 (0xF0 & 2) * 0x40 0xF0 & (2 * 0x40)
+128 0 128
+Testing that * has precedence over <<
+select 5 * 3 << 4, (5 * 3) << 4, 5 * (3 << 4);
+5 * 3 << 4 (5 * 3) << 4 5 * (3 << 4)
+240 240 240
+select 2 << 3 * 4, (2 << 3) * 4, 2 << (3 * 4);
+2 << 3 * 4 (2 << 3) * 4 2 << (3 * 4)
+8192 64 8192
+Testing that * has precedence over >>
+select 3 * 4 >> 2, (3 * 4) >> 2, 3 * (4 >> 2);
+3 * 4 >> 2 (3 * 4) >> 2 3 * (4 >> 2)
+3 3 3
+select 4 >> 2 * 3, (4 >> 2) * 3, 4 >> (2 * 3);
+4 >> 2 * 3 (4 >> 2) * 3 4 >> (2 * 3)
+0 3 0
+Testing that * has precedence over binary +
+select 2 * 3 + 4, (2 * 3) + 4, 2 * (3 + 4);
+2 * 3 + 4 (2 * 3) + 4 2 * (3 + 4)
+10 10 14
+select 2 + 3 * 4, (2 + 3) * 4, 2 + (3 * 4);
+2 + 3 * 4 (2 + 3) * 4 2 + (3 * 4)
+14 20 14
+Testing that * has precedence over binary -
+select 4 * 3 - 2, (4 * 3) - 2, 4 * (3 - 2);
+4 * 3 - 2 (4 * 3) - 2 4 * (3 - 2)
+10 10 4
+select 4 - 3 * 2, (4 - 3) * 2, 4 - (3 * 2);
+4 - 3 * 2 (4 - 3) * 2 4 - (3 * 2)
+-2 2 -2
+Testing that / is left associative
+select 15 / 5 / 3, (15 / 5) / 3, 15 / (5 / 3);
+15 / 5 / 3 (15 / 5) / 3 15 / (5 / 3)
+1.00000000 1.00000000 9.0000
+Testing that / has precedence over |
+select 105 / 5 | 2, (105 / 5) | 2, 105 / (5 | 2);
+105 / 5 | 2 (105 / 5) | 2 105 / (5 | 2)
+23 23 15.0000
+select 105 | 2 / 5, (105 | 2) / 5, 105 | (2 / 5);
+105 | 2 / 5 (105 | 2) / 5 105 | (2 / 5)
+105 21.4000 105
+Testing that / has precedence over &
+select 105 / 5 & 0x0F, (105 / 5) & 0x0F, 105 / (5 & 0x0F);
+105 / 5 & 0x0F (105 / 5) & 0x0F 105 / (5 & 0x0F)
+5 5 21.0000
+select 0x0F & 105 / 5, (0x0F & 105) / 5, 0x0F & (105 / 5);
+0x0F & 105 / 5 (0x0F & 105) / 5 0x0F & (105 / 5)
+5 1.8000 5
+Testing that / has precedence over <<
+select 0x80 / 4 << 2, (0x80 / 4) << 2, 0x80 / (4 << 2);
+0x80 / 4 << 2 (0x80 / 4) << 2 0x80 / (4 << 2)
+128 128 8.0000
+select 0x80 << 4 / 2, (0x80 << 4) / 2, 0x80 << (4 / 2);
+0x80 << 4 / 2 (0x80 << 4) / 2 0x80 << (4 / 2)
+512 1024.0000 512
+Testing that / has precedence over >>
+select 0x80 / 4 >> 2, (0x80 / 4) >> 2, 0x80 / (4 >> 2);
+0x80 / 4 >> 2 (0x80 / 4) >> 2 0x80 / (4 >> 2)
+8 8 128.0000
+select 0x80 >> 4 / 2, (0x80 >> 4) / 2, 0x80 >> (4 / 2);
+0x80 >> 4 / 2 (0x80 >> 4) / 2 0x80 >> (4 / 2)
+32 4.0000 32
+Testing that / has precedence over binary +
+select 0x80 / 2 + 2, (0x80 / 2) + 2, 0x80 / (2 + 2);
+0x80 / 2 + 2 (0x80 / 2) + 2 0x80 / (2 + 2)
+66.0000 66.0000 32.0000
+select 0x80 + 2 / 2, (0x80 + 2) / 2, 0x80 + (2 / 2);
+0x80 + 2 / 2 (0x80 + 2) / 2 0x80 + (2 / 2)
+129.0000 65.0000 129.0000
+Testing that / has precedence over binary -
+select 0x80 / 4 - 2, (0x80 / 4) - 2, 0x80 / (4 - 2);
+0x80 / 4 - 2 (0x80 / 4) - 2 0x80 / (4 - 2)
+30.0000 30.0000 64.0000
+select 0x80 - 4 / 2, (0x80 - 4) / 2, 0x80 - (4 / 2);
+0x80 - 4 / 2 (0x80 - 4) / 2 0x80 - (4 / 2)
+126.0000 62.0000 126.0000
+Testing that ^ is associative
+select 0xFF ^ 0xF0 ^ 0x0F, (0xFF ^ 0xF0) ^ 0x0F, 0xFF ^ (0xF0 ^ 0x0F);
+0xFF ^ 0xF0 ^ 0x0F (0xFF ^ 0xF0) ^ 0x0F 0xFF ^ (0xF0 ^ 0x0F)
+0 0 0
+select 0xFF ^ 0xF0 ^ 0x55, (0xFF ^ 0xF0) ^ 0x55, 0xFF ^ (0xF0 ^ 0x55);
+0xFF ^ 0xF0 ^ 0x55 (0xFF ^ 0xF0) ^ 0x55 0xFF ^ (0xF0 ^ 0x55)
+90 90 90
+Testing that ^ has precedence over |
+select 0xFF ^ 0xF0 | 0x0F, (0xFF ^ 0xF0) | 0x0F, 0xFF ^ (0xF0 | 0x0F);
+0xFF ^ 0xF0 | 0x0F (0xFF ^ 0xF0) | 0x0F 0xFF ^ (0xF0 | 0x0F)
+15 15 0
+select 0xF0 | 0xFF ^ 0xF0, (0xF0 | 0xFF) ^ 0xF0, 0xF0 | (0xFF ^ 0xF0);
+0xF0 | 0xFF ^ 0xF0 (0xF0 | 0xFF) ^ 0xF0 0xF0 | (0xFF ^ 0xF0)
+255 15 255
+Testing that ^ has precedence over &
+select 0xFF ^ 0xF0 & 0x0F, (0xFF ^ 0xF0) & 0x0F, 0xFF ^ (0xF0 & 0x0F);
+0xFF ^ 0xF0 & 0x0F (0xFF ^ 0xF0) & 0x0F 0xFF ^ (0xF0 & 0x0F)
+15 15 255
+select 0x0F & 0xFF ^ 0xF0, (0x0F & 0xFF) ^ 0xF0, 0x0F & (0xFF ^ 0xF0);
+0x0F & 0xFF ^ 0xF0 (0x0F & 0xFF) ^ 0xF0 0x0F & (0xFF ^ 0xF0)
+15 255 15
+Testing that ^ has precedence over <<
+select 0xFF ^ 0xF0 << 2, (0xFF ^ 0xF0) << 2, 0xFF ^ (0xF0 << 2);
+0xFF ^ 0xF0 << 2 (0xFF ^ 0xF0) << 2 0xFF ^ (0xF0 << 2)
+60 60 831
+select 0x0F << 2 ^ 0xFF, (0x0F << 2) ^ 0xFF, 0x0F << (2 ^ 0xFF);
+0x0F << 2 ^ 0xFF (0x0F << 2) ^ 0xFF 0x0F << (2 ^ 0xFF)
+0 195 0
+Testing that ^ has precedence over >>
+select 0xFF ^ 0xF0 >> 2, (0xFF ^ 0xF0) >> 2, 0xFF ^ (0xF0 >> 2);
+0xFF ^ 0xF0 >> 2 (0xFF ^ 0xF0) >> 2 0xFF ^ (0xF0 >> 2)
+3 3 195
+select 0xFF >> 2 ^ 0xF0, (0xFF >> 2) ^ 0xF0, 0xFF >> (2 ^ 0xF0);
+0xFF >> 2 ^ 0xF0 (0xFF >> 2) ^ 0xF0 0xFF >> (2 ^ 0xF0)
+0 207 0
+Testing that ^ has precedence over binary +
+select 0xFF ^ 0xF0 + 0x0F, (0xFF ^ 0xF0) + 0x0F, 0xFF ^ (0xF0 + 0x0F);
+0xFF ^ 0xF0 + 0x0F (0xFF ^ 0xF0) + 0x0F 0xFF ^ (0xF0 + 0x0F)
+30 30 0
+select 0x0F + 0xFF ^ 0xF0, (0x0F + 0xFF) ^ 0xF0, 0x0F + (0xFF ^ 0xF0);
+0x0F + 0xFF ^ 0xF0 (0x0F + 0xFF) ^ 0xF0 0x0F + (0xFF ^ 0xF0)
+30 510 30
+Testing that ^ has precedence over binary -
+select 0xFF ^ 0xF0 - 1, (0xFF ^ 0xF0) - 1, 0xFF ^ (0xF0 - 1);
+0xFF ^ 0xF0 - 1 (0xFF ^ 0xF0) - 1 0xFF ^ (0xF0 - 1)
+14 14 16
+select 0x55 - 0x0F ^ 0x55, (0x55 - 0x0F) ^ 0x55, 0x55 - (0x0F ^ 0x55);
+0x55 - 0x0F ^ 0x55 (0x55 - 0x0F) ^ 0x55 0x55 - (0x0F ^ 0x55)
+-5 19 -5
+Testing that ^ has precedence over *
+select 0xFF ^ 0xF0 * 2, (0xFF ^ 0xF0) * 2, 0xFF ^ (0xF0 * 2);
+0xFF ^ 0xF0 * 2 (0xFF ^ 0xF0) * 2 0xFF ^ (0xF0 * 2)
+30 30 287
+select 2 * 0xFF ^ 0xF0, (2 * 0xFF) ^ 0xF0, 2 * (0xFF ^ 0xF0);
+2 * 0xFF ^ 0xF0 (2 * 0xFF) ^ 0xF0 2 * (0xFF ^ 0xF0)
+30 270 30
+Testing that ^ has precedence over /
+select 0xFF ^ 0xF0 / 2, (0xFF ^ 0xF0) / 2, 0xFF ^ (0xF0 / 2);
+0xFF ^ 0xF0 / 2 (0xFF ^ 0xF0) / 2 0xFF ^ (0xF0 / 2)
+7.5000 7.5000 135
+select 0xF2 / 2 ^ 0xF0, (0xF2 / 2) ^ 0xF0, 0xF2 / (2 ^ 0xF0);
+0xF2 / 2 ^ 0xF0 (0xF2 / 2) ^ 0xF0 0xF2 / (2 ^ 0xF0)
+1.0000 137 1.0000
+Testing that ^ has precedence over %
+select 0xFF ^ 0xF0 % 0x20, (0xFF ^ 0xF0) % 0x20, 0xFF ^ (0xF0 % 0x20);
+0xFF ^ 0xF0 % 0x20 (0xFF ^ 0xF0) % 0x20 0xFF ^ (0xF0 % 0x20)
+15 15 239
+select 0xFF % 0x20 ^ 0xF0, (0xFF % 0x20) ^ 0xF0, 0xFF % (0x20 ^ 0xF0);
+0xFF % 0x20 ^ 0xF0 (0xFF % 0x20) ^ 0xF0 0xFF % (0x20 ^ 0xF0)
+47 239 47
+Testing that ^ has precedence over DIV
+select 0xFF ^ 0xF0 DIV 2, (0xFF ^ 0xF0) DIV 2, 0xFF ^ (0xF0 DIV 2);
+0xFF ^ 0xF0 DIV 2 (0xFF ^ 0xF0) DIV 2 0xFF ^ (0xF0 DIV 2)
+7 7 135
+select 0xF2 DIV 2 ^ 0xF0, (0xF2 DIV 2) ^ 0xF0, 0xF2 DIV (2 ^ 0xF0);
+0xF2 DIV 2 ^ 0xF0 (0xF2 DIV 2) ^ 0xF0 0xF2 DIV (2 ^ 0xF0)
+1 137 1
+Testing that ^ has precedence over MOD
+select 0xFF ^ 0xF0 MOD 0x20, (0xFF ^ 0xF0) MOD 0x20, 0xFF ^ (0xF0 MOD 0x20);
+0xFF ^ 0xF0 MOD 0x20 (0xFF ^ 0xF0) MOD 0x20 0xFF ^ (0xF0 MOD 0x20)
+15 15 239
+select 0xFF MOD 0x20 ^ 0xF0, (0xFF MOD 0x20) ^ 0xF0, 0xFF MOD (0x20 ^ 0xF0);
+0xFF MOD 0x20 ^ 0xF0 (0xFF MOD 0x20) ^ 0xF0 0xFF MOD (0x20 ^ 0xF0)
+47 239 47
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index 3549e987d73..5d985d053fc 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -1233,4 +1233,38 @@ select * from t1;
c1 c2
aaa 2
drop table t1;
+create table t1 (s1 bigint) partition by list (s1) (partition p1 values in (-9223372036854775808));
+drop table t1;
+create table t1(a int auto_increment, b int, primary key (b, a))
+partition by hash(b) partitions 2;
+insert into t1 values (null, 1);
+show table status;
+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
+t1 MyISAM 10 Fixed 1 9 9 0 0 0 1 NULL NULL NULL latin1_swedish_ci NULL partitioned
+drop table t1;
+create table t1(a int auto_increment primary key)
+partition by key(a) partitions 2;
+insert into t1 values (null), (null), (null);
+show table status;
+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
+t1 MyISAM 10 Fixed 3 7 21 0 0 0 4 NULL NULL NULL latin1_swedish_ci NULL partitioned
+drop table t1;
+CREATE TABLE t1(a INT NOT NULL, b TINYBLOB, KEY(a))
+PARTITION BY RANGE(a) ( PARTITION p0 VALUES LESS THAN (32));
+INSERT INTO t1 VALUES (1, REPEAT('a', 10));
+INSERT INTO t1 SELECT a + 1, b FROM t1;
+INSERT INTO t1 SELECT a + 2, b FROM t1;
+INSERT INTO t1 SELECT a + 4, b FROM t1;
+INSERT INTO t1 SELECT a + 8, b FROM t1;
+ALTER TABLE t1 ADD PARTITION (PARTITION p1 VALUES LESS THAN (64));
+ALTER TABLE t1 DROP PARTITION p1;
+DROP TABLE t1;
+USE mysql;
+SET GLOBAL general_log = 0;
+ALTER TABLE general_log ENGINE = MyISAM;
+ALTER TABLE general_log PARTITION BY RANGE (TO_DAYS(event_time))
+(PARTITION p0 VALUES LESS THAN (733144), PARTITION p1 VALUES LESS THAN (3000000));
+ERROR HY000: Incorrect usage of PARTITION and log table
+ALTER TABLE general_log ENGINE = CSV;
+SET GLOBAL general_log = default;
End of 5.1 tests
diff --git a/mysql-test/r/partition_bug18198.result b/mysql-test/r/partition_bug18198.result
new file mode 100644
index 00000000000..18d7d904bb0
--- /dev/null
+++ b/mysql-test/r/partition_bug18198.result
@@ -0,0 +1,173 @@
+drop table if exists t1;
+create table t1 (col1 datetime)
+partition by range(datediff(col1,col1))
+(partition p0 values less than (10), partition p1 values less than (30));
+drop table t1;
+create table t1 (col1 int)
+partition by range(greatest(col1,10))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(isnull(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(least(col1,12))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(case when col1>0 then 10 else 20 end)
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(ifnull(col1,5))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(nullif(col1,5))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(bit_length(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 char(5))
+partition by range(bit_length(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(char_length(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 char(5))
+partition by range(char_length(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 char(5))
+partition by range(character_length(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(find_in_set(col1,1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 char(5))
+partition by range(find_in_set(col1,'1'))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(instr(col1,3))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 char(5))
+partition by range(instr(col1,'3'))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 char(5))
+partition by range(length(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 char(5))
+partition by range(locate(1,col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(locate(1,col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 char(5))
+partition by range(octet_length(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 char(5))
+partition by range(position(1 in col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(position(1 in col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 char(5))
+partition by range(strcmp(col1,2))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(strcmp(col1,2))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(crc32(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(round(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(sign(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 datetime)
+partition by range(period_add(col1,5))
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 datetime, col2 datetime)
+partition by range(period_diff(col1,col2))
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int, col2 int)
+partition by range(period_diff(col1,col2))
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 datetime)
+partition by range(timestampdiff(day,5,col1))
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 date)
+partition by range(unix_timestamp(col1))
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 datetime)
+partition by range(week(col1))
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 varchar(25))
+partition by range(cast(col1 as signed))
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 varchar(25))
+partition by range(convert(col1,unsigned))
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(col1 | 20)
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(col1 & 20)
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(col1 ^ 20)
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(col1 << 20)
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(col1 >> 20)
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(~col1)
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(bit_count(col1))
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(inet_aton(col1))
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
diff --git a/mysql-test/r/partition_charset.result b/mysql-test/r/partition_charset.result
index 665e5d55f8f..f8f75e8bee7 100644
--- a/mysql-test/r/partition_charset.result
+++ b/mysql-test/r/partition_charset.result
@@ -16,3 +16,7 @@ s1
1
3
drop table t1;
+create table t1 (a varchar(1), primary key (a))
+partition by list (ascii(a))
+(partition p1 values in (65));
+ERROR HY000: This partition function is not allowed
diff --git a/mysql-test/r/partition_error.result b/mysql-test/r/partition_error.result
index 4b01b759902..7952c8df609 100644
--- a/mysql-test/r/partition_error.result
+++ b/mysql-test/r/partition_error.result
@@ -25,7 +25,7 @@ partitions 3
(partition x1 values in (1,2,9,4) tablespace ts1,
partition x2 values in (3, 11, 5, 7) tablespace ts2,
partition x3 values in (16, 8, 5+19, 70-43) tablespace ts3);
-ERROR HY000: The PARTITION function returns the wrong type
+ERROR HY000: This partition function is not allowed
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -89,7 +89,7 @@ partitions 3
(partition x1 tablespace ts1,
partition x2 tablespace ts2,
partition x3 tablespace ts3);
-ERROR HY000: The PARTITION function returns the wrong type
+ERROR HY000: This partition function is not allowed
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -422,7 +422,7 @@ partition by range (sin(a))
partitions 2
(partition x1 values less than (4),
partition x2 values less than (5));
-ERROR HY000: The PARTITION function returns the wrong type
+ERROR HY000: This partition function is not allowed
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -600,7 +600,7 @@ ERROR HY000: Partition constant is out of partition function domain
create table t1 (v varchar(12))
partition by range (ascii(v))
(partition p0 values less than (10));
-drop table t1;
+ERROR HY000: This partition function is not allowed
create table t1 (a int)
partition by hash (rand(a));
ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2
@@ -619,4 +619,4 @@ partition by range (a + (select count(*) from t1))
ERROR HY000: This partition function is not allowed
create table t1 (a char(10))
partition by hash (extractvalue(a,'a'));
-ERROR HY000: The PARTITION function returns the wrong type
+ERROR HY000: This partition function is not allowed
diff --git a/mysql-test/r/partition_hash.result b/mysql-test/r/partition_hash.result
index 7ef3ee5c6c8..9a82a36d902 100644
--- a/mysql-test/r/partition_hash.result
+++ b/mysql-test/r/partition_hash.result
@@ -1,18 +1,4 @@
drop table if exists t1;
-create table t1 (a varchar(10) charset latin1 collate latin1_bin)
-partition by hash(length(a))
-partitions 10;
-insert into t1 values (''),(' '),('a'),('a '),('a ');
-explain partitions select * from t1 where a='a ';
-id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where
-explain partitions select * from t1 where a='a';
-id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where
-explain partitions select * from t1 where a='a ' OR a='a';
-id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where
-drop table t1;
create table t1 (a int unsigned)
partition by hash(a div 2)
partitions 4;
diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result
index a9e43653506..8282cfc212a 100644
--- a/mysql-test/r/partition_innodb.result
+++ b/mysql-test/r/partition_innodb.result
@@ -55,6 +55,7 @@ engine = x
partition by key (a);
Warnings:
Warning 1286 Unknown table engine 'x'
+Warning 1266 Using storage engine MyISAM for table 't1'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/mysql-test/r/partition_list.result b/mysql-test/r/partition_list.result
index e64a7a8d154..a68a67c6386 100644
--- a/mysql-test/r/partition_list.result
+++ b/mysql-test/r/partition_list.result
@@ -295,3 +295,7 @@ select * from t1;
a
100
drop table t1;
+create table t1 (a char(1))
+partition by list (ascii(ucase(a)))
+(partition p1 values in (2));
+ERROR HY000: This partition function is not allowed
diff --git a/mysql-test/r/partition_mgm.result b/mysql-test/r/partition_mgm.result
index 9b5a34bda50..04ac603fea7 100644
--- a/mysql-test/r/partition_mgm.result
+++ b/mysql-test/r/partition_mgm.result
@@ -10,13 +10,13 @@ subpartition sp01, subpartition sp02));
ERROR HY000: Wrong number of subpartitions defined, mismatch with previous setting
drop table t1;
CREATE TABLE t1 (f_date DATE, f_varchar VARCHAR(30))
-PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER)) PARTITIONS 2;
+PARTITION BY HASH(YEAR(f_date)) PARTITIONS 2;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) PARTITIONS 2 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) PARTITIONS 2 */
hello/master-data/test/t1#P#p0.MYD
hello/master-data/test/t1#P#p0.MYI
hello/master-data/test/t1#P#p1.MYD
@@ -29,7 +29,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) PARTITIONS 1 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) PARTITIONS 1 */
hello/master-data/test/t1#P#p0.MYD
hello/master-data/test/t1#P#p0.MYI
hello/master-data/test/t1.frm
diff --git a/mysql-test/r/partition_pruning.result b/mysql-test/r/partition_pruning.result
index 5fc0058356d..396400f9010 100644
--- a/mysql-test/r/partition_pruning.result
+++ b/mysql-test/r/partition_pruning.result
@@ -676,25 +676,6 @@ f_int1 f_int2
8 8
9 9
drop table t1;
-create table t1 (a char(10) binary)
-partition by list(length(a))
-(partition p1 values in (1),
-partition p2 values in (2),
-partition p3 values in (3),
-partition p4 values in (4),
-partition p5 values in (5)
-);
-insert into t1 values ('a'),('bb'),('ccc'),('dddd'),('eeEee');
-select * from t1 where a>='a' and a <= 'dddd';
-a
-a
-bb
-ccc
-dddd
-explain partitions select * from t1 where a>='a' and a <= 'dddd';
-id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p1,p2,p3,p4,p5 ALL NULL NULL NULL NULL 5 Using where
-drop table t1;
create table t1 (f_int1 integer) partition by list(abs(mod(f_int1,2)))
subpartition by hash(f_int1) subpartitions 2
(
@@ -847,23 +828,58 @@ explain partitions select * from t1 where a = 18446744073709551614;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
drop table t1;
-create table t1 (a int)
-partition by range((a & 0xFF) << 56) (
-partition p0 values less than (0x40 << 56),
-partition p1 values less than (0x80 << 56),
-partition p2 values less than (0xFF << 56)
+create table t1 (a int)
+partition by range(a) (
+partition p0 values less than (64),
+partition p1 values less than (128),
+partition p2 values less than (255)
+);
+create table t2 (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 values (0x20), (0x20), (0x41), (0x41), (0xFE), (0xFE);
+insert into t2 values (0x20), (0x20), (0x41), (0x41), (0xFE), (0xFE);
explain partitions select * from t1 where a=0;
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 t2 where a=0;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where a=0xFE;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p2 ALL NULL NULL NULL NULL 2 Using where
-explain partitions select * from t1 where a>0xFE and a<= 0xFF;
+explain partitions select * from t2 where a=0xFE;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p2 ALL NULL NULL NULL NULL 2 Using where
+explain partitions select * from t1 where a > 0xFE AND a <= 0xFF;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+explain partitions select * from t2 where a > 0xFE AND a <= 0xFF;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+explain partitions select * from t1 where a >= 0xFE AND a <= 0xFF;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p2 ALL NULL NULL NULL NULL 2 Using where
+explain partitions select * from t2 where a >= 0xFE AND a <= 0xFF;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p2 ALL NULL NULL NULL NULL 2 Using where
+explain partitions select * from t1 where a < 64 AND a >= 63;
+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 t2 where a < 64 AND a >= 63;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 2 Using where
+explain partitions select * from t1 where a <= 64 AND a >= 63;
+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 t2 where a <= 64 AND a >= 63;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p0,p1 ALL NULL NULL NULL NULL 4 Using where
drop table t1;
+drop table t2;
create table t1(a bigint unsigned not null) partition by range(a+0) (
partition p1 values less than (10),
partition p2 values less than (20),
@@ -895,3 +911,31 @@ explain partitions select * from t1 where a>-2 and a <=0;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p3 ALL NULL NULL NULL NULL 4 Using where
drop table t1;
+CREATE TABLE t1 ( recdate DATETIME NOT NULL )
+PARTITION BY RANGE( TO_DAYS(recdate) ) (
+PARTITION p0 VALUES LESS THAN ( TO_DAYS('2007-03-08') ),
+PARTITION p1 VALUES LESS THAN ( TO_DAYS('2007-04-01') )
+);
+INSERT INTO t1 VALUES ('2007-03-01 12:00:00');
+INSERT INTO t1 VALUES ('2007-03-07 12:00:00');
+INSERT INTO t1 VALUES ('2007-03-08 12:00:00');
+INSERT INTO t1 VALUES ('2007-03-15 12:00:00');
+must use p0 only:
+explain partitions select * from t1 where recdate < '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
+drop table t1;
+CREATE TABLE t1 ( recdate DATETIME NOT NULL )
+PARTITION BY RANGE( YEAR(recdate) ) (
+PARTITION p0 VALUES LESS THAN (2006),
+PARTITION p1 VALUES LESS THAN (2007)
+);
+INSERT INTO t1 VALUES ('2005-03-01 12:00:00');
+INSERT INTO t1 VALUES ('2005-03-01 12:00:00');
+INSERT INTO t1 VALUES ('2006-03-01 12:00:00');
+INSERT INTO t1 VALUES ('2006-03-01 12:00:00');
+must use p0 only:
+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;
diff --git a/mysql-test/r/partition_range.result b/mysql-test/r/partition_range.result
index d39b39f413a..a61006e87a4 100644
--- a/mysql-test/r/partition_range.result
+++ b/mysql-test/r/partition_range.result
@@ -1,38 +1,4 @@
drop table if exists t1;
-create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int)
-partition by range (length(a) * b)
-(partition p0 values less than (2), partition p1 values less than (400));
-insert into t1 values ('a ', 2),('a',3);
-drop table t1;
-create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int)
-partition by range (b* length(a) * b)
-(partition p0 values less than (2), partition p1 values less than (400));
-insert into t1 values ('a ', 2),('a',3);
-drop table t1;
-create table t1 (a varchar(10) charset latin1 collate latin1_bin,
-b varchar(10) charset latin1 collate latin1_bin)
-partition by range (length(b) * length(a))
-(partition p0 values less than (2), partition p1 values less than (400));
-insert into t1 values ('a ', 'b '),('a','b');
-drop table t1;
-create table t1 (a varchar(10) charset latin1 collate latin1_bin,
-b varchar(10) charset latin1 collate latin1_bin)
-partition by range (length(a) * length(b))
-(partition p0 values less than (2), partition p1 values less than (400));
-insert into t1 values ('a ', 'b '),('a','b');
-drop table t1;
-create table t1 (a varchar(10) charset latin1 collate latin1_bin,
-b varchar(10) charset latin1 collate latin1_bin, c int)
-partition by range (length(a) * c)
-(partition p0 values less than (2), partition p1 values less than (400));
-insert into t1 values ('a ', 'b ', 2),('a','b', 3);
-drop table t1;
-create table t1 (a varchar(10) charset latin1 collate latin1_bin,
-b varchar(10) charset latin1 collate latin1_bin, c int)
-partition by range (c * length(a))
-(partition p0 values less than (2), partition p1 values less than (400));
-insert into t1 values ('a ', 'b ', 2),('a','b', 3);
-drop table t1;
create table t1 (a int unsigned)
partition by range (a)
(partition pnull values less than (0),
@@ -109,7 +75,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 pnull_pnullsp0,pnull_pnullsp1,p0_p0sp0,p0_p0sp1 ALL NULL NULL NULL NULL 4 Using where
explain partitions select * from t1 where a > 1;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p1_p1sp0,p1_p1sp1 ALL NULL NULL NULL NULL 2 Using where
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
drop table t1;
CREATE TABLE t1 (
a int not null,
@@ -743,45 +709,3 @@ WHERE (a >= '2004-07-01' AND a <= '2004-09-30') OR
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p407,p408,p409,p507,p508,p509 ALL NULL NULL NULL NULL 18 Using where
DROP TABLE t1;
-create table t1 (a varchar(20))
-partition by range (crc32(md5(a)))
-(partition p0 values less than (100),
-partition p1 values less than maxvalue);
-insert into t1 values ("12345678901234567890");
-insert into t1 values ("A2345678901234567890");
-insert into t1 values ("B2345678901234567890");
-insert into t1 values ("1234567890123456789");
-insert into t1 values ("1234567890123456");
-select * from t1;
-a
-12345678901234567890
-A2345678901234567890
-B2345678901234567890
-1234567890123456789
-1234567890123456
-explain partitions select * from t1 where a = "12345678901234567890";
-id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 5 Using where
-explain partitions select * from t1 where a = "12345678901234567890" OR
-a = "A2345678901234567890" OR
-a = "B2345678901234567890" OR
-a = "C2345678901234567890";
-id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 5 Using where
-explain partitions select * from t1 where a = "01234567890123456";
-id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 5 Using where
-select * from t1 where a = "01234567890123456";
-a
-select * from t1 where a = "12345678901234567890" OR
-a = "A2345678901234567890" OR
-a = "B2345678901234567890" OR
-a = "C2345678901234567890";
-a
-12345678901234567890
-A2345678901234567890
-B2345678901234567890
-select * from t1 where a = "12345678901234567890";
-a
-12345678901234567890
-drop table t1;
diff --git a/mysql-test/r/plugin.result b/mysql-test/r/plugin.result
index 44641858fca..8628acecf55 100644
--- a/mysql-test/r/plugin.result
+++ b/mysql-test/r/plugin.result
@@ -1,6 +1,7 @@
CREATE TABLE t1(a int) ENGINE=EXAMPLE;
Warnings:
-Error 1286 Unknown table engine 'EXAMPLE'
+Warning 1286 Unknown table engine 'EXAMPLE'
+Warning 1266 Using storage engine MyISAM for table 't1'
DROP TABLE t1;
INSTALL PLUGIN example SONAME 'ha_example.so';
INSTALL PLUGIN EXAMPLE SONAME 'ha_example.so';
@@ -11,5 +12,8 @@ CREATE TABLE t1(a int) ENGINE=EXAMPLE;
SELECT * FROM t1;
a
DROP TABLE t1;
+UNINSTALL PLUGIN example;
+UNINSTALL PLUGIN EXAMPLE;
+ERROR 42000: PLUGIN EXAMPLE does not exist
UNINSTALL PLUGIN non_exist;
ERROR 42000: PLUGIN non_exist does not exist
diff --git a/mysql-test/r/preload.result b/mysql-test/r/preload.result
index 145fd22ffb6..24a6e594a14 100644
--- a/mysql-test/r/preload.result
+++ b/mysql-test/r/preload.result
@@ -143,10 +143,9 @@ Key_read_requests 0
Key_reads 0
load index into cache t3, t2 key (primary,b) ;
Table Op Msg_type Msg_text
-test.t3 preload_keys error Table 'test.t3' doesn't exist
+test.t3 preload_keys Error Table 'test.t3' doesn't exist
+test.t3 preload_keys error Corrupt
test.t2 preload_keys status OK
-Warnings:
-Error 1146 Table 'test.t3' doesn't exist
show status like "key_read%";
Variable_name Value
Key_read_requests 478
@@ -159,12 +158,10 @@ Key_read_requests 0
Key_reads 0
load index into cache t3 key (b), t2 key (c) ;
Table Op Msg_type Msg_text
-test.t3 preload_keys error Table 'test.t3' doesn't exist
-test.t2 preload_keys error Key 'c' doesn't exist in table 't2'
+test.t3 preload_keys Error Table 'test.t3' doesn't exist
+test.t3 preload_keys error Corrupt
+test.t2 preload_keys Error Key 'c' doesn't exist in table 't2'
test.t2 preload_keys status Operation failed
-Warnings:
-Error 1146 Table 'test.t3' doesn't exist
-Error 1176 Key 'c' doesn't exist in table 't2'
show status like "key_read%";
Variable_name Value
Key_read_requests 0
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index 15e1c8730f0..edac68a88d6 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -26,11 +26,11 @@ ERROR HY000: Unknown prepared statement handler (no_such_statement) given to DEA
execute stmt1;
ERROR HY000: Incorrect arguments to EXECUTE
prepare stmt2 from 'prepare nested_stmt from "select 1"';
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"select 1"' at line 1
+ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt2 from 'execute stmt1';
-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 'stmt1' at line 1
+ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt2 from 'deallocate prepare z';
-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 'z' at line 1
+ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt3 from 'insert into t1 values (?,?)';
set @arg1=5, @arg2='five';
execute stmt3 using @arg1, @arg2;
@@ -1062,6 +1062,87 @@ EXECUTE stmt USING @a;
0 0
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1 (i INT);
+PREPARE st_19182
+FROM "CREATE TABLE t2 (i INT, j INT, KEY (i), KEY(j)) SELECT i FROM t1";
+EXECUTE st_19182;
+DESC t2;
+Field Type Null Key Default Extra
+j int(11) YES MUL NULL
+i int(11) YES MUL NULL
+DROP TABLE t2;
+EXECUTE st_19182;
+DESC t2;
+Field Type Null Key Default Extra
+j int(11) YES MUL NULL
+i int(11) YES MUL NULL
+DEALLOCATE PREPARE st_19182;
+DROP TABLE t2, t1;
+drop database if exists mysqltest;
+drop table if exists t1, t2;
+create database mysqltest character set utf8;
+prepare stmt1 from "create table mysqltest.t1 (c char(10))";
+prepare stmt2 from "create table mysqltest.t2 select 'test'";
+execute stmt1;
+execute stmt2;
+show create table mysqltest.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c` char(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8
+show create table mysqltest.t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `test` varchar(4) CHARACTER SET latin1 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=utf8
+drop table mysqltest.t1;
+drop table mysqltest.t2;
+alter database mysqltest character set latin1;
+execute stmt1;
+execute stmt2;
+show create table mysqltest.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c` char(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+show create table mysqltest.t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `test` varchar(4) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop database mysqltest;
+deallocate prepare stmt1;
+deallocate prepare stmt2;
+execute stmt;
+show create table t1;
+drop table t1;
+execute stmt;
+show create table t1;
+drop table t1;
+deallocate prepare stmt;
+CREATE TABLE t1(a int);
+INSERT INTO t1 VALUES (2), (3), (1);
+PREPARE st1 FROM
+'(SELECT a FROM t1) UNION (SELECT a+10 FROM t1) ORDER BY RAND()*0+a';
+EXECUTE st1;
+a
+1
+2
+3
+11
+12
+13
+EXECUTE st1;
+a
+1
+2
+3
+11
+12
+13
+DEALLOCATE PREPARE st1;
+DROP TABLE t1;
End of 4.1 tests.
create table t1 (a varchar(20));
insert into t1 values ('foo');
@@ -1305,45 +1386,39 @@ prepare stmt from "repair table t1, t4, t3";
execute stmt;
Table Op Msg_type Msg_text
test.t1 repair status OK
-test.t4 repair error Table 'test.t4' doesn't exist
+test.t4 repair Error Table 'test.t4' doesn't exist
+test.t4 repair error Corrupt
test.t3 repair status OK
-Warnings:
-Error 1146 Table 'test.t4' doesn't exist
execute stmt;
Table Op Msg_type Msg_text
test.t1 repair status OK
-test.t4 repair error Table 'test.t4' doesn't exist
+test.t4 repair Error Table 'test.t4' doesn't exist
+test.t4 repair error Corrupt
test.t3 repair status OK
-Warnings:
-Error 1146 Table 'test.t4' doesn't exist
prepare stmt from "optimize table t1, t3, t4";
execute stmt;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t3 optimize status OK
-test.t4 optimize error Table 'test.t4' doesn't exist
-Warnings:
-Error 1146 Table 'test.t4' doesn't exist
+test.t4 optimize Error Table 'test.t4' doesn't exist
+test.t4 optimize error Corrupt
execute stmt;
Table Op Msg_type Msg_text
test.t1 optimize status Table is already up to date
test.t3 optimize status Table is already up to date
-test.t4 optimize error Table 'test.t4' doesn't exist
-Warnings:
-Error 1146 Table 'test.t4' doesn't exist
+test.t4 optimize Error Table 'test.t4' doesn't exist
+test.t4 optimize error Corrupt
prepare stmt from "analyze table t4, t1";
execute stmt;
Table Op Msg_type Msg_text
-test.t4 analyze error Table 'test.t4' doesn't exist
+test.t4 analyze Error Table 'test.t4' doesn't exist
+test.t4 analyze error Corrupt
test.t1 analyze status Table is already up to date
-Warnings:
-Error 1146 Table 'test.t4' doesn't exist
execute stmt;
Table Op Msg_type Msg_text
-test.t4 analyze error Table 'test.t4' doesn't exist
+test.t4 analyze Error Table 'test.t4' doesn't exist
+test.t4 analyze error Corrupt
test.t1 analyze status Table is already up to date
-Warnings:
-Error 1146 Table 'test.t4' doesn't exist
deallocate prepare stmt;
drop table t1, t2, t3;
create database mysqltest_long_database_name_to_thrash_heap;
@@ -1544,6 +1619,72 @@ a
2
DEALLOCATE PREPARE stmt;
DROP TABLE t1,t2;
+drop table if exists t1;
+create table t1 (s1 char(20));
+prepare stmt from "alter table t1 modify s1 int";
+execute stmt;
+execute stmt;
+drop table t1;
+deallocate prepare stmt;
+drop table if exists t1;
+create table t1 (a int, b int);
+prepare s_6895 from "alter table t1 drop column b";
+execute s_6895;
+show columns from t1;
+Field Type Null Key Default Extra
+a int(11) YES NULL
+drop table t1;
+create table t1 (a int, b int);
+execute s_6895;
+show columns from t1;
+Field Type Null Key Default Extra
+a int(11) YES NULL
+drop table t1;
+create table t1 (a int, b int);
+execute s_6895;
+show columns from t1;
+Field Type Null Key Default Extra
+a int(11) YES NULL
+deallocate prepare s_6895;
+drop table t1;
+create table t1 (i int primary key auto_increment) comment='comment for table t1';
+create table t2 (i int, j int, k int);
+prepare stmt from "alter table t1 auto_increment=100";
+execute stmt;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `i` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`i`)
+) ENGINE=MyISAM AUTO_INCREMENT=100 DEFAULT CHARSET=latin1 COMMENT='comment for table t1'
+flush tables;
+select * from t2;
+i j k
+execute stmt;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `i` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`i`)
+) ENGINE=MyISAM AUTO_INCREMENT=100 DEFAULT CHARSET=latin1 COMMENT='comment for table t1'
+deallocate prepare stmt;
+drop table t1, t2;
+set @old_character_set_server= @@character_set_server;
+set @@character_set_server= latin1;
+prepare stmt from "create database mysqltest_1";
+execute stmt;
+show create database mysqltest_1;
+Database Create Database
+mysqltest_1 CREATE DATABASE `mysqltest_1` /*!40100 DEFAULT CHARACTER SET latin1 */
+drop database mysqltest_1;
+set @@character_set_server= utf8;
+execute stmt;
+show create database mysqltest_1;
+Database Create Database
+mysqltest_1 CREATE DATABASE `mysqltest_1` /*!40100 DEFAULT CHARACTER SET utf8 */
+drop database mysqltest_1;
+deallocate prepare stmt;
+set @@character_set_server= @old_character_set_server;
drop tables if exists t1;
create table t1 (id int primary key auto_increment, value varchar(10));
insert into t1 (id, value) values (1, 'FIRST'), (2, 'SECOND'), (3, 'THIRD');
@@ -1560,6 +1701,15 @@ execute stmt;
ERROR 42S22: Unknown column 'y.value' in 'field list'
deallocate prepare stmt;
drop tables t1;
+prepare stmt from "create table t1 select ?";
+set @a=1.0;
+execute stmt using @a;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `?` decimal(2,1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
End of 5.0 tests.
create procedure proc_1() reset query cache;
call proc_1();
@@ -1700,63 +1850,55 @@ create procedure proc_1() flush tables;
flush tables;
show open tables from mysql;
Database Table In_use Name_locked
-mysql general_log 1 0
-mysql slow_log 1 0
+mysql general_log 0 0
select Host, User from mysql.user limit 0;
Host User
select Host, Db from mysql.host limit 0;
Host Db
show open tables from mysql;
Database Table In_use Name_locked
-mysql general_log 1 0
-mysql slow_log 1 0
-mysql host 0 0
mysql user 0 0
+mysql general_log 0 0
+mysql host 0 0
call proc_1();
show open tables from mysql;
Database Table In_use Name_locked
-mysql general_log 1 0
-mysql slow_log 1 0
+mysql general_log 0 0
select Host, User from mysql.user limit 0;
Host User
select Host, Db from mysql.host limit 0;
Host Db
show open tables from mysql;
Database Table In_use Name_locked
-mysql general_log 1 0
-mysql slow_log 1 0
-mysql host 0 0
mysql user 0 0
+mysql general_log 0 0
+mysql host 0 0
call proc_1();
show open tables from mysql;
Database Table In_use Name_locked
-mysql general_log 1 0
-mysql slow_log 1 0
+mysql general_log 0 0
select Host, User from mysql.user limit 0;
Host User
select Host, Db from mysql.host limit 0;
Host Db
show open tables from mysql;
Database Table In_use Name_locked
-mysql general_log 1 0
-mysql slow_log 1 0
-mysql host 0 0
mysql user 0 0
+mysql general_log 0 0
+mysql host 0 0
call proc_1();
show open tables from mysql;
Database Table In_use Name_locked
-mysql general_log 1 0
-mysql slow_log 1 0
+mysql general_log 0 0
select Host, User from mysql.user limit 0;
Host User
select Host, Db from mysql.host limit 0;
Host Db
show open tables from mysql;
Database Table In_use Name_locked
-mysql general_log 1 0
-mysql slow_log 1 0
-mysql host 0 0
mysql user 0 0
+mysql general_log 0 0
+mysql host 0 0
flush tables;
create function func_1() returns int begin flush tables; return 1; end|
ERROR 0A000: FLUSH is not allowed in stored function or trigger
@@ -1772,56 +1914,49 @@ select Host, Db from mysql.host limit 0;
Host Db
show open tables from mysql;
Database Table In_use Name_locked
-mysql general_log 1 0
-mysql slow_log 1 0
-mysql host 0 0
mysql user 0 0
+mysql general_log 0 0
+mysql host 0 0
prepare abc from "flush tables";
execute abc;
show open tables from mysql;
Database Table In_use Name_locked
-mysql general_log 1 0
-mysql slow_log 1 0
+mysql general_log 0 0
select Host, User from mysql.user limit 0;
Host User
select Host, Db from mysql.host limit 0;
Host Db
show open tables from mysql;
Database Table In_use Name_locked
-mysql general_log 1 0
-mysql slow_log 1 0
-mysql host 0 0
mysql user 0 0
+mysql general_log 0 0
+mysql host 0 0
execute abc;
show open tables from mysql;
Database Table In_use Name_locked
-mysql general_log 1 0
-mysql slow_log 1 0
+mysql general_log 0 0
select Host, User from mysql.user limit 0;
Host User
select Host, Db from mysql.host limit 0;
Host Db
show open tables from mysql;
Database Table In_use Name_locked
-mysql general_log 1 0
-mysql slow_log 1 0
-mysql host 0 0
mysql user 0 0
+mysql general_log 0 0
+mysql host 0 0
execute abc;
show open tables from mysql;
Database Table In_use Name_locked
-mysql general_log 1 0
-mysql slow_log 1 0
+mysql general_log 0 0
select Host, User from mysql.user limit 0;
Host User
select Host, Db from mysql.host limit 0;
Host Db
show open tables from mysql;
Database Table In_use Name_locked
-mysql general_log 1 0
-mysql slow_log 1 0
-mysql host 0 0
mysql user 0 0
+mysql general_log 0 0
+mysql host 0 0
flush tables;
deallocate prepare abc;
create procedure proc_1() flush logs;
@@ -1968,11 +2103,11 @@ prepare abc from "show master logs";
deallocate prepare abc;
create procedure proc_1() show events;
call proc_1();
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
call proc_1();
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
call proc_1();
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
drop procedure proc_1;
create function func_1() returns int begin show events; return 1; end|
ERROR 0A000: Not allowed to return a result set from a function
@@ -1982,27 +2117,27 @@ drop function func_1;
ERROR 42000: FUNCTION test.func_1 does not exist
prepare abc from "show events";
execute abc;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
execute abc;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
execute abc;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
deallocate prepare abc;
drop procedure if exists a;
create procedure a() select 42;
create procedure proc_1(a char(2)) show create procedure a;
call proc_1("bb");
-Procedure sql_mode Create Procedure
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`()
-select 42
+select 42 latin1 latin1_swedish_ci latin1_swedish_ci
call proc_1("bb");
-Procedure sql_mode Create Procedure
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`()
-select 42
+select 42 latin1 latin1_swedish_ci latin1_swedish_ci
call proc_1("bb");
-Procedure sql_mode Create Procedure
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`()
-select 42
+select 42 latin1 latin1_swedish_ci latin1_swedish_ci
drop procedure proc_1;
create function func_1() returns int begin show create procedure a; return 1; end|
ERROR 0A000: Not allowed to return a result set from a function
@@ -2012,34 +2147,34 @@ drop function func_1;
ERROR 42000: FUNCTION test.func_1 does not exist
prepare abc from "show create procedure a";
execute abc;
-Procedure sql_mode Create Procedure
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`()
-select 42
+select 42 latin1 latin1_swedish_ci latin1_swedish_ci
execute abc;
-Procedure sql_mode Create Procedure
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`()
-select 42
+select 42 latin1 latin1_swedish_ci latin1_swedish_ci
execute abc;
-Procedure sql_mode Create Procedure
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`()
-select 42
+select 42 latin1 latin1_swedish_ci latin1_swedish_ci
deallocate prepare abc;
drop procedure a;
drop function if exists a;
create function a() returns int return 42+13;
create procedure proc_1(a char(2)) show create function a;
call proc_1("bb");
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11)
-return 42+13
+return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci
call proc_1("bb");
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11)
-return 42+13
+return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci
call proc_1("bb");
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11)
-return 42+13
+return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci
drop procedure proc_1;
create function func_1() returns int begin show create function a; return 1; end|
ERROR 0A000: Not allowed to return a result set from a function
@@ -2049,17 +2184,17 @@ drop function func_1;
ERROR 42000: FUNCTION test.func_1 does not exist
prepare abc from "show create function a";
execute abc;
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11)
-return 42+13
+return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci
execute abc;
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11)
-return 42+13
+return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci
execute abc;
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11)
-return 42+13
+return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci
deallocate prepare abc;
drop function a;
drop table if exists tab1;
@@ -2127,14 +2262,14 @@ union all
(select b, count(*) from t1 group by b);
create procedure proc_1() show create view v1;
call proc_1();
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`)
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) latin1 latin1_swedish_ci
call proc_1();
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`)
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) latin1 latin1_swedish_ci
call proc_1();
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`)
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) latin1 latin1_swedish_ci
drop procedure proc_1;
create function func_1() returns int begin show create view v1; return 1; end|
ERROR 0A000: Not allowed to return a result set from a function
@@ -2144,14 +2279,14 @@ drop function func_1;
ERROR 42000: FUNCTION test.func_1 does not exist
prepare abc from "show create view v1";
execute abc;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`)
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) latin1 latin1_swedish_ci
execute abc;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`)
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) latin1 latin1_swedish_ci
execute abc;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`)
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) latin1 latin1_swedish_ci
deallocate prepare abc;
drop view v1;
drop table t1;
@@ -2524,4 +2659,25 @@ i j
4 5
3 NULL
DROP TABLE t1, t2;
+drop table if exists t1;
+Warnings:
+Note 1051 Unknown table 't1'
+prepare stmt
+from "create table t1 (c char(100) character set utf8, key (c(10)))";
+execute stmt;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c` char(100) CHARACTER SET utf8 DEFAULT NULL,
+ KEY `c` (`c`(10))
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+execute stmt;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c` char(100) CHARACTER SET utf8 DEFAULT NULL,
+ KEY `c` (`c`(10))
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
End of 5.1 tests.
diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result
index 391d22d232b..1c5f0e4dfd6 100644
--- a/mysql-test/r/ps_1general.result
+++ b/mysql-test/r/ps_1general.result
@@ -269,7 +269,7 @@ prepare stmt4 from ' show columns from t2 where field in (select ?) ';
SET @arg00="a";
execute stmt4 using @arg00;
Field Type Null Key Default Extra
-a int(11) NO PRI
+a int(11) NO PRI NULL
SET @arg00="b";
execute stmt4 using @arg00;
Field Type Null Key Default Extra
@@ -280,7 +280,7 @@ Field Type Null Key Default Extra
prepare stmt4 from ' show columns from t2 from test like ''a%'' ';
execute stmt4;
Field Type Null Key Default Extra
-a int(11) NO PRI
+a int(11) NO PRI NULL
create index t2_idx on t2(b);
prepare stmt4 from ' show index from t2 from test ';
execute stmt4;
@@ -303,10 +303,9 @@ prepare stmt4 from ' show variables like ''sql_mode'' ';
execute stmt4;
Variable_name Value
sql_mode
-prepare stmt4 from ' show engine bdb logs ';
-ERROR 42000: Unknown table engine 'bdb'
-prepare stmt4 from ' show engine foo logs ';
-ERROR 42000: Unknown table engine 'foo'
+prepare stmt4 from ' show engine myisam logs ';
+execute stmt4;
+Type Name Status
prepare stmt4 from ' show grants for user ';
prepare stmt4 from ' show create table t2 ';
prepare stmt4 from ' show master status ';
@@ -374,11 +373,13 @@ drop table t5 ;
deallocate prepare stmt_do ;
deallocate prepare stmt_set ;
prepare stmt1 from ' prepare stmt2 from '' select 1 '' ' ;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' select 1 '' at line 1
+ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt1 from ' execute stmt2 ' ;
-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 'stmt2' at line 1
+ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt1 from ' deallocate prepare never_prepared ' ;
-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 'never_prepared' at line 1
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+prepare stmt1 from 'alter view v1 as select 2';
+ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt4 from ' use test ' ;
ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt3 from ' create database mysqltest ';
@@ -388,7 +389,7 @@ drop database mysqltest ;
prepare stmt3 from ' describe t2 ';
execute stmt3;
Field Type Null Key Default Extra
-a int(11) NO PRI
+a int(11) NO PRI NULL
b char(10) YES MUL NULL
drop table t2 ;
execute stmt3;
@@ -443,7 +444,7 @@ def table 253 64 2 Y 0 31 8
def type 253 10 3 Y 0 31 8
def possible_keys 253 4096 0 Y 0 31 8
def key 253 64 0 Y 0 31 8
-def key_len 253 4096 0 Y 128 31 63
+def key_len 253 1365 0 Y 0 31 8
def ref 253 1024 0 Y 0 31 8
def rows 8 10 1 Y 32928 0 63
def Extra 253 255 14 N 1 31 8
@@ -459,7 +460,7 @@ def table 253 64 2 Y 0 31 8
def type 253 10 5 Y 0 31 8
def possible_keys 253 4096 7 Y 0 31 8
def key 253 64 7 Y 0 31 8
-def key_len 253 4096 1 Y 128 31 63
+def key_len 253 1365 1 Y 0 31 8
def ref 253 1024 0 Y 0 31 8
def rows 8 10 1 Y 32928 0 63
def Extra 253 255 27 N 1 31 8
diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result
index 2ce35dae092..afc248c027e 100644
--- a/mysql-test/r/ps_2myisam.result
+++ b/mysql-test/r/ps_2myisam.result
@@ -1158,7 +1158,7 @@ def table 253 64 2 Y 0 31 8
def type 253 10 3 Y 0 31 8
def possible_keys 253 4096 0 Y 0 31 8
def key 253 64 0 Y 0 31 8
-def key_len 253 4096 0 Y 128 31 63
+def key_len 253 1365 0 Y 0 31 8
def ref 253 1024 0 Y 0 31 8
def rows 8 10 1 Y 32928 0 63
def Extra 253 255 0 N 1 31 8
@@ -1917,38 +1917,38 @@ from t9 where c1= 1 ;
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 1 Y 128 0 63
-def @arg03 253 20 1 Y 128 0 63
-def @arg04 253 20 1 Y 128 0 63
-def @arg05 253 20 1 Y 128 0 63
-def @arg06 253 20 1 Y 128 0 63
-def @arg07 253 23 1 Y 128 31 63
-def @arg08 253 23 1 Y 128 31 63
-def @arg09 253 23 1 Y 128 31 63
-def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
-def @arg13 253 16777216 10 Y 128 31 63
-def @arg14 253 16777216 19 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 8 Y 128 31 63
-def @arg17 253 20 4 Y 128 0 63
-def @arg18 253 20 1 Y 128 0 63
-def @arg19 253 20 1 Y 128 0 63
-def @arg20 253 16777216 1 Y 0 31 8
-def @arg21 253 16777216 10 Y 0 31 8
-def @arg22 253 16777216 30 Y 0 31 8
-def @arg23 253 16777216 8 Y 128 31 63
-def @arg24 253 16777216 8 Y 0 31 8
-def @arg25 253 16777216 4 Y 128 31 63
-def @arg26 253 16777216 4 Y 0 31 8
-def @arg27 253 16777216 10 Y 128 31 63
-def @arg28 253 16777216 10 Y 0 31 8
-def @arg29 253 16777216 8 Y 128 31 63
-def @arg30 253 16777216 8 Y 0 31 8
-def @arg31 253 16777216 3 Y 0 31 8
-def @arg32 253 16777216 6 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 1 Y 32896 0 63
+def @arg03 8 20 1 Y 32896 0 63
+def @arg04 8 20 1 Y 32896 0 63
+def @arg05 8 20 1 Y 32896 0 63
+def @arg06 8 20 1 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 8 Y 128 31 63
+def @arg17 8 20 4 Y 32928 0 63
+def @arg18 8 20 1 Y 32896 0 63
+def @arg19 8 20 1 Y 32896 0 63
+def @arg20 251 16777216 1 Y 0 31 8
+def @arg21 251 16777216 10 Y 0 31 8
+def @arg22 251 16777216 30 Y 0 31 8
+def @arg23 251 16777216 8 Y 128 31 63
+def @arg24 251 16777216 8 Y 0 31 8
+def @arg25 251 16777216 4 Y 128 31 63
+def @arg26 251 16777216 4 Y 0 31 8
+def @arg27 251 16777216 10 Y 128 31 63
+def @arg28 251 16777216 10 Y 0 31 8
+def @arg29 251 16777216 8 Y 128 31 63
+def @arg30 251 16777216 8 Y 0 31 8
+def @arg31 251 16777216 3 Y 0 31 8
+def @arg32 251 16777216 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
@@ -1964,38 +1964,38 @@ from t9 where c1= 0 ;
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 0 Y 128 0 63
-def @arg03 253 20 0 Y 128 0 63
-def @arg04 253 20 0 Y 128 0 63
-def @arg05 253 20 0 Y 128 0 63
-def @arg06 253 20 0 Y 128 0 63
-def @arg07 253 23 0 Y 128 31 63
-def @arg08 253 23 0 Y 128 31 63
-def @arg09 253 23 0 Y 128 31 63
-def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
-def @arg13 253 16777216 0 Y 128 31 63
-def @arg14 253 16777216 0 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 0 Y 128 31 63
-def @arg17 253 20 0 Y 128 0 63
-def @arg18 253 20 0 Y 128 0 63
-def @arg19 253 20 0 Y 128 0 63
-def @arg20 253 16777216 0 Y 0 31 8
-def @arg21 253 16777216 0 Y 0 31 8
-def @arg22 253 16777216 0 Y 0 31 8
-def @arg23 253 16777216 0 Y 128 31 63
-def @arg24 253 16777216 0 Y 0 31 8
-def @arg25 253 16777216 0 Y 128 31 63
-def @arg26 253 16777216 0 Y 0 31 8
-def @arg27 253 16777216 0 Y 128 31 63
-def @arg28 253 16777216 0 Y 0 31 8
-def @arg29 253 16777216 0 Y 128 31 63
-def @arg30 253 16777216 0 Y 0 31 8
-def @arg31 253 16777216 0 Y 0 31 8
-def @arg32 253 16777216 0 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 0 Y 32896 0 63
+def @arg03 8 20 0 Y 32896 0 63
+def @arg04 8 20 0 Y 32896 0 63
+def @arg05 8 20 0 Y 32896 0 63
+def @arg06 8 20 0 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 0 Y 128 31 63
+def @arg17 8 20 0 Y 32928 0 63
+def @arg18 8 20 0 Y 32896 0 63
+def @arg19 8 20 0 Y 32896 0 63
+def @arg20 251 16777216 0 Y 0 31 8
+def @arg21 251 16777216 0 Y 0 31 8
+def @arg22 251 16777216 0 Y 0 31 8
+def @arg23 251 16777216 0 Y 128 31 63
+def @arg24 251 16777216 0 Y 0 31 8
+def @arg25 251 16777216 0 Y 128 31 63
+def @arg26 251 16777216 0 Y 0 31 8
+def @arg27 251 16777216 0 Y 128 31 63
+def @arg28 251 16777216 0 Y 0 31 8
+def @arg29 251 16777216 0 Y 128 31 63
+def @arg30 251 16777216 0 Y 0 31 8
+def @arg31 251 16777216 0 Y 0 31 8
+def @arg32 251 16777216 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select
@@ -2014,38 +2014,38 @@ execute stmt1 using @my_key ;
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 1 Y 128 0 63
-def @arg03 253 20 1 Y 128 0 63
-def @arg04 253 20 1 Y 128 0 63
-def @arg05 253 20 1 Y 128 0 63
-def @arg06 253 20 1 Y 128 0 63
-def @arg07 253 23 1 Y 128 31 63
-def @arg08 253 23 1 Y 128 31 63
-def @arg09 253 23 1 Y 128 31 63
-def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
-def @arg13 253 16777216 10 Y 128 31 63
-def @arg14 253 16777216 19 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 8 Y 128 31 63
-def @arg17 253 20 4 Y 128 0 63
-def @arg18 253 20 1 Y 128 0 63
-def @arg19 253 20 1 Y 128 0 63
-def @arg20 253 16777216 1 Y 0 31 8
-def @arg21 253 16777216 10 Y 0 31 8
-def @arg22 253 16777216 30 Y 0 31 8
-def @arg23 253 16777216 8 Y 128 31 63
-def @arg24 253 16777216 8 Y 0 31 8
-def @arg25 253 16777216 4 Y 128 31 63
-def @arg26 253 16777216 4 Y 0 31 8
-def @arg27 253 16777216 10 Y 128 31 63
-def @arg28 253 16777216 10 Y 0 31 8
-def @arg29 253 16777216 8 Y 128 31 63
-def @arg30 253 16777216 8 Y 0 31 8
-def @arg31 253 16777216 3 Y 0 31 8
-def @arg32 253 16777216 6 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 1 Y 32896 0 63
+def @arg03 8 20 1 Y 32896 0 63
+def @arg04 8 20 1 Y 32896 0 63
+def @arg05 8 20 1 Y 32896 0 63
+def @arg06 8 20 1 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 8 Y 128 31 63
+def @arg17 8 20 4 Y 32928 0 63
+def @arg18 8 20 1 Y 32896 0 63
+def @arg19 8 20 1 Y 32896 0 63
+def @arg20 251 16777216 1 Y 0 31 8
+def @arg21 251 16777216 10 Y 0 31 8
+def @arg22 251 16777216 30 Y 0 31 8
+def @arg23 251 16777216 8 Y 128 31 63
+def @arg24 251 16777216 8 Y 0 31 8
+def @arg25 251 16777216 4 Y 128 31 63
+def @arg26 251 16777216 4 Y 0 31 8
+def @arg27 251 16777216 10 Y 128 31 63
+def @arg28 251 16777216 10 Y 0 31 8
+def @arg29 251 16777216 8 Y 128 31 63
+def @arg30 251 16777216 8 Y 0 31 8
+def @arg31 251 16777216 3 Y 0 31 8
+def @arg32 251 16777216 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
@@ -2054,38 +2054,38 @@ execute stmt1 using @my_key ;
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 0 Y 128 0 63
-def @arg03 253 20 0 Y 128 0 63
-def @arg04 253 20 0 Y 128 0 63
-def @arg05 253 20 0 Y 128 0 63
-def @arg06 253 20 0 Y 128 0 63
-def @arg07 253 23 0 Y 128 31 63
-def @arg08 253 23 0 Y 128 31 63
-def @arg09 253 23 0 Y 128 31 63
-def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
-def @arg13 253 16777216 0 Y 128 31 63
-def @arg14 253 16777216 0 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 0 Y 128 31 63
-def @arg17 253 20 0 Y 128 0 63
-def @arg18 253 20 0 Y 128 0 63
-def @arg19 253 20 0 Y 128 0 63
-def @arg20 253 16777216 0 Y 0 31 8
-def @arg21 253 16777216 0 Y 0 31 8
-def @arg22 253 16777216 0 Y 0 31 8
-def @arg23 253 16777216 0 Y 128 31 63
-def @arg24 253 16777216 0 Y 0 31 8
-def @arg25 253 16777216 0 Y 128 31 63
-def @arg26 253 16777216 0 Y 0 31 8
-def @arg27 253 16777216 0 Y 128 31 63
-def @arg28 253 16777216 0 Y 0 31 8
-def @arg29 253 16777216 0 Y 128 31 63
-def @arg30 253 16777216 0 Y 0 31 8
-def @arg31 253 16777216 0 Y 0 31 8
-def @arg32 253 16777216 0 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 0 Y 32896 0 63
+def @arg03 8 20 0 Y 32896 0 63
+def @arg04 8 20 0 Y 32896 0 63
+def @arg05 8 20 0 Y 32896 0 63
+def @arg06 8 20 0 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 0 Y 128 31 63
+def @arg17 8 20 0 Y 32928 0 63
+def @arg18 8 20 0 Y 32896 0 63
+def @arg19 8 20 0 Y 32896 0 63
+def @arg20 251 16777216 0 Y 0 31 8
+def @arg21 251 16777216 0 Y 0 31 8
+def @arg22 251 16777216 0 Y 0 31 8
+def @arg23 251 16777216 0 Y 128 31 63
+def @arg24 251 16777216 0 Y 0 31 8
+def @arg25 251 16777216 0 Y 128 31 63
+def @arg26 251 16777216 0 Y 0 31 8
+def @arg27 251 16777216 0 Y 128 31 63
+def @arg28 251 16777216 0 Y 0 31 8
+def @arg29 251 16777216 0 Y 128 31 63
+def @arg30 251 16777216 0 Y 0 31 8
+def @arg31 251 16777216 0 Y 0 31 8
+def @arg32 251 16777216 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select ? := c1 from t9 where c1= 1" ;
@@ -2102,38 +2102,38 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
from t9 where c1= 1 ;
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 1 Y 128 0 63
-def @arg03 253 20 1 Y 128 0 63
-def @arg04 253 20 1 Y 128 0 63
-def @arg05 253 20 1 Y 128 0 63
-def @arg06 253 20 1 Y 128 0 63
-def @arg07 253 23 1 Y 128 31 63
-def @arg08 253 23 1 Y 128 31 63
-def @arg09 253 23 1 Y 128 31 63
-def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
-def @arg13 253 16777216 10 Y 128 31 63
-def @arg14 253 16777216 19 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 8 Y 128 31 63
-def @arg17 253 20 4 Y 128 0 63
-def @arg18 253 20 1 Y 128 0 63
-def @arg19 253 20 1 Y 128 0 63
-def @arg20 253 16777216 1 Y 0 31 8
-def @arg21 253 16777216 10 Y 0 31 8
-def @arg22 253 16777216 30 Y 0 31 8
-def @arg23 253 16777216 8 Y 128 31 63
-def @arg24 253 16777216 8 Y 0 31 8
-def @arg25 253 16777216 4 Y 128 31 63
-def @arg26 253 16777216 4 Y 0 31 8
-def @arg27 253 16777216 10 Y 128 31 63
-def @arg28 253 16777216 10 Y 0 31 8
-def @arg29 253 16777216 8 Y 128 31 63
-def @arg30 253 16777216 8 Y 0 31 8
-def @arg31 253 16777216 3 Y 0 31 8
-def @arg32 253 16777216 6 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 1 Y 32896 0 63
+def @arg03 8 20 1 Y 32896 0 63
+def @arg04 8 20 1 Y 32896 0 63
+def @arg05 8 20 1 Y 32896 0 63
+def @arg06 8 20 1 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 8 Y 128 31 63
+def @arg17 8 20 4 Y 32928 0 63
+def @arg18 8 20 1 Y 32896 0 63
+def @arg19 8 20 1 Y 32896 0 63
+def @arg20 251 16777216 1 Y 0 31 8
+def @arg21 251 16777216 10 Y 0 31 8
+def @arg22 251 16777216 30 Y 0 31 8
+def @arg23 251 16777216 8 Y 128 31 63
+def @arg24 251 16777216 8 Y 0 31 8
+def @arg25 251 16777216 4 Y 128 31 63
+def @arg26 251 16777216 4 Y 0 31 8
+def @arg27 251 16777216 10 Y 128 31 63
+def @arg28 251 16777216 10 Y 0 31 8
+def @arg29 251 16777216 8 Y 128 31 63
+def @arg30 251 16777216 8 Y 0 31 8
+def @arg31 251 16777216 3 Y 0 31 8
+def @arg32 251 16777216 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -2146,38 +2146,38 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
from t9 where c1= 0 ;
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 0 Y 128 0 63
-def @arg03 253 20 0 Y 128 0 63
-def @arg04 253 20 0 Y 128 0 63
-def @arg05 253 20 0 Y 128 0 63
-def @arg06 253 20 0 Y 128 0 63
-def @arg07 253 23 0 Y 128 31 63
-def @arg08 253 23 0 Y 128 31 63
-def @arg09 253 23 0 Y 128 31 63
-def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
-def @arg13 253 16777216 0 Y 128 31 63
-def @arg14 253 16777216 0 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 0 Y 128 31 63
-def @arg17 253 20 0 Y 128 0 63
-def @arg18 253 20 0 Y 128 0 63
-def @arg19 253 20 0 Y 128 0 63
-def @arg20 253 16777216 0 Y 0 31 8
-def @arg21 253 16777216 0 Y 0 31 8
-def @arg22 253 16777216 0 Y 0 31 8
-def @arg23 253 16777216 0 Y 128 31 63
-def @arg24 253 16777216 0 Y 0 31 8
-def @arg25 253 16777216 0 Y 128 31 63
-def @arg26 253 16777216 0 Y 0 31 8
-def @arg27 253 16777216 0 Y 128 31 63
-def @arg28 253 16777216 0 Y 0 31 8
-def @arg29 253 16777216 0 Y 128 31 63
-def @arg30 253 16777216 0 Y 0 31 8
-def @arg31 253 16777216 0 Y 0 31 8
-def @arg32 253 16777216 0 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 0 Y 32896 0 63
+def @arg03 8 20 0 Y 32896 0 63
+def @arg04 8 20 0 Y 32896 0 63
+def @arg05 8 20 0 Y 32896 0 63
+def @arg06 8 20 0 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 0 Y 128 31 63
+def @arg17 8 20 0 Y 32928 0 63
+def @arg18 8 20 0 Y 32896 0 63
+def @arg19 8 20 0 Y 32896 0 63
+def @arg20 251 16777216 0 Y 0 31 8
+def @arg21 251 16777216 0 Y 0 31 8
+def @arg22 251 16777216 0 Y 0 31 8
+def @arg23 251 16777216 0 Y 128 31 63
+def @arg24 251 16777216 0 Y 0 31 8
+def @arg25 251 16777216 0 Y 128 31 63
+def @arg26 251 16777216 0 Y 0 31 8
+def @arg27 251 16777216 0 Y 128 31 63
+def @arg28 251 16777216 0 Y 0 31 8
+def @arg29 251 16777216 0 Y 128 31 63
+def @arg30 251 16777216 0 Y 0 31 8
+def @arg31 251 16777216 0 Y 0 31 8
+def @arg32 251 16777216 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -2192,76 +2192,76 @@ set @my_key= 1 ;
execute stmt1 using @my_key ;
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 1 Y 128 0 63
-def @arg03 253 20 1 Y 128 0 63
-def @arg04 253 20 1 Y 128 0 63
-def @arg05 253 20 1 Y 128 0 63
-def @arg06 253 20 1 Y 128 0 63
-def @arg07 253 23 1 Y 128 31 63
-def @arg08 253 23 1 Y 128 31 63
-def @arg09 253 23 1 Y 128 31 63
-def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
-def @arg13 253 16777216 10 Y 128 31 63
-def @arg14 253 16777216 19 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 8 Y 128 31 63
-def @arg17 253 20 4 Y 128 0 63
-def @arg18 253 20 1 Y 128 0 63
-def @arg19 253 20 1 Y 128 0 63
-def @arg20 253 16777216 1 Y 0 31 8
-def @arg21 253 16777216 10 Y 0 31 8
-def @arg22 253 16777216 30 Y 0 31 8
-def @arg23 253 16777216 8 Y 128 31 63
-def @arg24 253 16777216 8 Y 0 31 8
-def @arg25 253 16777216 4 Y 128 31 63
-def @arg26 253 16777216 4 Y 0 31 8
-def @arg27 253 16777216 10 Y 128 31 63
-def @arg28 253 16777216 10 Y 0 31 8
-def @arg29 253 16777216 8 Y 128 31 63
-def @arg30 253 16777216 8 Y 0 31 8
-def @arg31 253 16777216 3 Y 0 31 8
-def @arg32 253 16777216 6 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 1 Y 32896 0 63
+def @arg03 8 20 1 Y 32896 0 63
+def @arg04 8 20 1 Y 32896 0 63
+def @arg05 8 20 1 Y 32896 0 63
+def @arg06 8 20 1 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 8 Y 128 31 63
+def @arg17 8 20 4 Y 32928 0 63
+def @arg18 8 20 1 Y 32896 0 63
+def @arg19 8 20 1 Y 32896 0 63
+def @arg20 251 16777216 1 Y 0 31 8
+def @arg21 251 16777216 10 Y 0 31 8
+def @arg22 251 16777216 30 Y 0 31 8
+def @arg23 251 16777216 8 Y 128 31 63
+def @arg24 251 16777216 8 Y 0 31 8
+def @arg25 251 16777216 4 Y 128 31 63
+def @arg26 251 16777216 4 Y 0 31 8
+def @arg27 251 16777216 10 Y 128 31 63
+def @arg28 251 16777216 10 Y 0 31 8
+def @arg29 251 16777216 8 Y 128 31 63
+def @arg30 251 16777216 8 Y 0 31 8
+def @arg31 251 16777216 3 Y 0 31 8
+def @arg32 251 16777216 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
execute stmt1 using @my_key ;
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 0 Y 128 0 63
-def @arg03 253 20 0 Y 128 0 63
-def @arg04 253 20 0 Y 128 0 63
-def @arg05 253 20 0 Y 128 0 63
-def @arg06 253 20 0 Y 128 0 63
-def @arg07 253 23 0 Y 128 31 63
-def @arg08 253 23 0 Y 128 31 63
-def @arg09 253 23 0 Y 128 31 63
-def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
-def @arg13 253 16777216 0 Y 128 31 63
-def @arg14 253 16777216 0 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 0 Y 128 31 63
-def @arg17 253 20 0 Y 128 0 63
-def @arg18 253 20 0 Y 128 0 63
-def @arg19 253 20 0 Y 128 0 63
-def @arg20 253 16777216 0 Y 0 31 8
-def @arg21 253 16777216 0 Y 0 31 8
-def @arg22 253 16777216 0 Y 0 31 8
-def @arg23 253 16777216 0 Y 128 31 63
-def @arg24 253 16777216 0 Y 0 31 8
-def @arg25 253 16777216 0 Y 128 31 63
-def @arg26 253 16777216 0 Y 0 31 8
-def @arg27 253 16777216 0 Y 128 31 63
-def @arg28 253 16777216 0 Y 0 31 8
-def @arg29 253 16777216 0 Y 128 31 63
-def @arg30 253 16777216 0 Y 0 31 8
-def @arg31 253 16777216 0 Y 0 31 8
-def @arg32 253 16777216 0 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 0 Y 32896 0 63
+def @arg03 8 20 0 Y 32896 0 63
+def @arg04 8 20 0 Y 32896 0 63
+def @arg05 8 20 0 Y 32896 0 63
+def @arg06 8 20 0 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 0 Y 128 31 63
+def @arg17 8 20 0 Y 32928 0 63
+def @arg18 8 20 0 Y 32896 0 63
+def @arg19 8 20 0 Y 32896 0 63
+def @arg20 251 16777216 0 Y 0 31 8
+def @arg21 251 16777216 0 Y 0 31 8
+def @arg22 251 16777216 0 Y 0 31 8
+def @arg23 251 16777216 0 Y 128 31 63
+def @arg24 251 16777216 0 Y 0 31 8
+def @arg25 251 16777216 0 Y 128 31 63
+def @arg26 251 16777216 0 Y 0 31 8
+def @arg27 251 16777216 0 Y 128 31 63
+def @arg28 251 16777216 0 Y 0 31 8
+def @arg29 251 16777216 0 Y 128 31 63
+def @arg30 251 16777216 0 Y 0 31 8
+def @arg31 251 16777216 0 Y 0 31 8
+def @arg32 251 16777216 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1 into ? from t9 where c1= 1" ;
diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result
index 70181ecccdc..e3f55cee898 100644
--- a/mysql-test/r/ps_3innodb.result
+++ b/mysql-test/r/ps_3innodb.result
@@ -1158,7 +1158,7 @@ def table 253 64 2 Y 0 31 8
def type 253 10 3 Y 0 31 8
def possible_keys 253 4096 0 Y 0 31 8
def key 253 64 0 Y 0 31 8
-def key_len 253 4096 0 Y 128 31 63
+def key_len 253 1365 0 Y 0 31 8
def ref 253 1024 0 Y 0 31 8
def rows 8 10 1 Y 32928 0 63
def Extra 253 255 0 N 1 31 8
@@ -1900,38 +1900,38 @@ from t9 where c1= 1 ;
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 1 Y 128 0 63
-def @arg03 253 20 1 Y 128 0 63
-def @arg04 253 20 1 Y 128 0 63
-def @arg05 253 20 1 Y 128 0 63
-def @arg06 253 20 1 Y 128 0 63
-def @arg07 253 23 1 Y 128 31 63
-def @arg08 253 23 1 Y 128 31 63
-def @arg09 253 23 1 Y 128 31 63
-def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
-def @arg13 253 16777216 10 Y 128 31 63
-def @arg14 253 16777216 19 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 8 Y 128 31 63
-def @arg17 253 20 4 Y 128 0 63
-def @arg18 253 20 1 Y 128 0 63
-def @arg19 253 20 1 Y 128 0 63
-def @arg20 253 16777216 1 Y 0 31 8
-def @arg21 253 16777216 10 Y 0 31 8
-def @arg22 253 16777216 30 Y 0 31 8
-def @arg23 253 16777216 8 Y 128 31 63
-def @arg24 253 16777216 8 Y 0 31 8
-def @arg25 253 16777216 4 Y 128 31 63
-def @arg26 253 16777216 4 Y 0 31 8
-def @arg27 253 16777216 10 Y 128 31 63
-def @arg28 253 16777216 10 Y 0 31 8
-def @arg29 253 16777216 8 Y 128 31 63
-def @arg30 253 16777216 8 Y 0 31 8
-def @arg31 253 16777216 3 Y 0 31 8
-def @arg32 253 16777216 6 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 1 Y 32896 0 63
+def @arg03 8 20 1 Y 32896 0 63
+def @arg04 8 20 1 Y 32896 0 63
+def @arg05 8 20 1 Y 32896 0 63
+def @arg06 8 20 1 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 8 Y 128 31 63
+def @arg17 8 20 4 Y 32928 0 63
+def @arg18 8 20 1 Y 32896 0 63
+def @arg19 8 20 1 Y 32896 0 63
+def @arg20 251 16777216 1 Y 0 31 8
+def @arg21 251 16777216 10 Y 0 31 8
+def @arg22 251 16777216 30 Y 0 31 8
+def @arg23 251 16777216 8 Y 128 31 63
+def @arg24 251 16777216 8 Y 0 31 8
+def @arg25 251 16777216 4 Y 128 31 63
+def @arg26 251 16777216 4 Y 0 31 8
+def @arg27 251 16777216 10 Y 128 31 63
+def @arg28 251 16777216 10 Y 0 31 8
+def @arg29 251 16777216 8 Y 128 31 63
+def @arg30 251 16777216 8 Y 0 31 8
+def @arg31 251 16777216 3 Y 0 31 8
+def @arg32 251 16777216 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
@@ -1947,38 +1947,38 @@ from t9 where c1= 0 ;
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 0 Y 128 0 63
-def @arg03 253 20 0 Y 128 0 63
-def @arg04 253 20 0 Y 128 0 63
-def @arg05 253 20 0 Y 128 0 63
-def @arg06 253 20 0 Y 128 0 63
-def @arg07 253 23 0 Y 128 31 63
-def @arg08 253 23 0 Y 128 31 63
-def @arg09 253 23 0 Y 128 31 63
-def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
-def @arg13 253 16777216 0 Y 128 31 63
-def @arg14 253 16777216 0 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 0 Y 128 31 63
-def @arg17 253 20 0 Y 128 0 63
-def @arg18 253 20 0 Y 128 0 63
-def @arg19 253 20 0 Y 128 0 63
-def @arg20 253 16777216 0 Y 0 31 8
-def @arg21 253 16777216 0 Y 0 31 8
-def @arg22 253 16777216 0 Y 0 31 8
-def @arg23 253 16777216 0 Y 128 31 63
-def @arg24 253 16777216 0 Y 0 31 8
-def @arg25 253 16777216 0 Y 128 31 63
-def @arg26 253 16777216 0 Y 0 31 8
-def @arg27 253 16777216 0 Y 128 31 63
-def @arg28 253 16777216 0 Y 0 31 8
-def @arg29 253 16777216 0 Y 128 31 63
-def @arg30 253 16777216 0 Y 0 31 8
-def @arg31 253 16777216 0 Y 0 31 8
-def @arg32 253 16777216 0 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 0 Y 32896 0 63
+def @arg03 8 20 0 Y 32896 0 63
+def @arg04 8 20 0 Y 32896 0 63
+def @arg05 8 20 0 Y 32896 0 63
+def @arg06 8 20 0 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 0 Y 128 31 63
+def @arg17 8 20 0 Y 32928 0 63
+def @arg18 8 20 0 Y 32896 0 63
+def @arg19 8 20 0 Y 32896 0 63
+def @arg20 251 16777216 0 Y 0 31 8
+def @arg21 251 16777216 0 Y 0 31 8
+def @arg22 251 16777216 0 Y 0 31 8
+def @arg23 251 16777216 0 Y 128 31 63
+def @arg24 251 16777216 0 Y 0 31 8
+def @arg25 251 16777216 0 Y 128 31 63
+def @arg26 251 16777216 0 Y 0 31 8
+def @arg27 251 16777216 0 Y 128 31 63
+def @arg28 251 16777216 0 Y 0 31 8
+def @arg29 251 16777216 0 Y 128 31 63
+def @arg30 251 16777216 0 Y 0 31 8
+def @arg31 251 16777216 0 Y 0 31 8
+def @arg32 251 16777216 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select
@@ -1997,38 +1997,38 @@ execute stmt1 using @my_key ;
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 1 Y 128 0 63
-def @arg03 253 20 1 Y 128 0 63
-def @arg04 253 20 1 Y 128 0 63
-def @arg05 253 20 1 Y 128 0 63
-def @arg06 253 20 1 Y 128 0 63
-def @arg07 253 23 1 Y 128 31 63
-def @arg08 253 23 1 Y 128 31 63
-def @arg09 253 23 1 Y 128 31 63
-def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
-def @arg13 253 16777216 10 Y 128 31 63
-def @arg14 253 16777216 19 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 8 Y 128 31 63
-def @arg17 253 20 4 Y 128 0 63
-def @arg18 253 20 1 Y 128 0 63
-def @arg19 253 20 1 Y 128 0 63
-def @arg20 253 16777216 1 Y 0 31 8
-def @arg21 253 16777216 10 Y 0 31 8
-def @arg22 253 16777216 30 Y 0 31 8
-def @arg23 253 16777216 8 Y 128 31 63
-def @arg24 253 16777216 8 Y 0 31 8
-def @arg25 253 16777216 4 Y 128 31 63
-def @arg26 253 16777216 4 Y 0 31 8
-def @arg27 253 16777216 10 Y 128 31 63
-def @arg28 253 16777216 10 Y 0 31 8
-def @arg29 253 16777216 8 Y 128 31 63
-def @arg30 253 16777216 8 Y 0 31 8
-def @arg31 253 16777216 3 Y 0 31 8
-def @arg32 253 16777216 6 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 1 Y 32896 0 63
+def @arg03 8 20 1 Y 32896 0 63
+def @arg04 8 20 1 Y 32896 0 63
+def @arg05 8 20 1 Y 32896 0 63
+def @arg06 8 20 1 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 8 Y 128 31 63
+def @arg17 8 20 4 Y 32928 0 63
+def @arg18 8 20 1 Y 32896 0 63
+def @arg19 8 20 1 Y 32896 0 63
+def @arg20 251 16777216 1 Y 0 31 8
+def @arg21 251 16777216 10 Y 0 31 8
+def @arg22 251 16777216 30 Y 0 31 8
+def @arg23 251 16777216 8 Y 128 31 63
+def @arg24 251 16777216 8 Y 0 31 8
+def @arg25 251 16777216 4 Y 128 31 63
+def @arg26 251 16777216 4 Y 0 31 8
+def @arg27 251 16777216 10 Y 128 31 63
+def @arg28 251 16777216 10 Y 0 31 8
+def @arg29 251 16777216 8 Y 128 31 63
+def @arg30 251 16777216 8 Y 0 31 8
+def @arg31 251 16777216 3 Y 0 31 8
+def @arg32 251 16777216 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
@@ -2037,38 +2037,38 @@ execute stmt1 using @my_key ;
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 0 Y 128 0 63
-def @arg03 253 20 0 Y 128 0 63
-def @arg04 253 20 0 Y 128 0 63
-def @arg05 253 20 0 Y 128 0 63
-def @arg06 253 20 0 Y 128 0 63
-def @arg07 253 23 0 Y 128 31 63
-def @arg08 253 23 0 Y 128 31 63
-def @arg09 253 23 0 Y 128 31 63
-def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
-def @arg13 253 16777216 0 Y 128 31 63
-def @arg14 253 16777216 0 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 0 Y 128 31 63
-def @arg17 253 20 0 Y 128 0 63
-def @arg18 253 20 0 Y 128 0 63
-def @arg19 253 20 0 Y 128 0 63
-def @arg20 253 16777216 0 Y 0 31 8
-def @arg21 253 16777216 0 Y 0 31 8
-def @arg22 253 16777216 0 Y 0 31 8
-def @arg23 253 16777216 0 Y 128 31 63
-def @arg24 253 16777216 0 Y 0 31 8
-def @arg25 253 16777216 0 Y 128 31 63
-def @arg26 253 16777216 0 Y 0 31 8
-def @arg27 253 16777216 0 Y 128 31 63
-def @arg28 253 16777216 0 Y 0 31 8
-def @arg29 253 16777216 0 Y 128 31 63
-def @arg30 253 16777216 0 Y 0 31 8
-def @arg31 253 16777216 0 Y 0 31 8
-def @arg32 253 16777216 0 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 0 Y 32896 0 63
+def @arg03 8 20 0 Y 32896 0 63
+def @arg04 8 20 0 Y 32896 0 63
+def @arg05 8 20 0 Y 32896 0 63
+def @arg06 8 20 0 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 0 Y 128 31 63
+def @arg17 8 20 0 Y 32928 0 63
+def @arg18 8 20 0 Y 32896 0 63
+def @arg19 8 20 0 Y 32896 0 63
+def @arg20 251 16777216 0 Y 0 31 8
+def @arg21 251 16777216 0 Y 0 31 8
+def @arg22 251 16777216 0 Y 0 31 8
+def @arg23 251 16777216 0 Y 128 31 63
+def @arg24 251 16777216 0 Y 0 31 8
+def @arg25 251 16777216 0 Y 128 31 63
+def @arg26 251 16777216 0 Y 0 31 8
+def @arg27 251 16777216 0 Y 128 31 63
+def @arg28 251 16777216 0 Y 0 31 8
+def @arg29 251 16777216 0 Y 128 31 63
+def @arg30 251 16777216 0 Y 0 31 8
+def @arg31 251 16777216 0 Y 0 31 8
+def @arg32 251 16777216 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select ? := c1 from t9 where c1= 1" ;
@@ -2085,38 +2085,38 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
from t9 where c1= 1 ;
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 1 Y 128 0 63
-def @arg03 253 20 1 Y 128 0 63
-def @arg04 253 20 1 Y 128 0 63
-def @arg05 253 20 1 Y 128 0 63
-def @arg06 253 20 1 Y 128 0 63
-def @arg07 253 23 1 Y 128 31 63
-def @arg08 253 23 1 Y 128 31 63
-def @arg09 253 23 1 Y 128 31 63
-def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
-def @arg13 253 16777216 10 Y 128 31 63
-def @arg14 253 16777216 19 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 8 Y 128 31 63
-def @arg17 253 20 4 Y 128 0 63
-def @arg18 253 20 1 Y 128 0 63
-def @arg19 253 20 1 Y 128 0 63
-def @arg20 253 16777216 1 Y 0 31 8
-def @arg21 253 16777216 10 Y 0 31 8
-def @arg22 253 16777216 30 Y 0 31 8
-def @arg23 253 16777216 8 Y 128 31 63
-def @arg24 253 16777216 8 Y 0 31 8
-def @arg25 253 16777216 4 Y 128 31 63
-def @arg26 253 16777216 4 Y 0 31 8
-def @arg27 253 16777216 10 Y 128 31 63
-def @arg28 253 16777216 10 Y 0 31 8
-def @arg29 253 16777216 8 Y 128 31 63
-def @arg30 253 16777216 8 Y 0 31 8
-def @arg31 253 16777216 3 Y 0 31 8
-def @arg32 253 16777216 6 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 1 Y 32896 0 63
+def @arg03 8 20 1 Y 32896 0 63
+def @arg04 8 20 1 Y 32896 0 63
+def @arg05 8 20 1 Y 32896 0 63
+def @arg06 8 20 1 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 8 Y 128 31 63
+def @arg17 8 20 4 Y 32928 0 63
+def @arg18 8 20 1 Y 32896 0 63
+def @arg19 8 20 1 Y 32896 0 63
+def @arg20 251 16777216 1 Y 0 31 8
+def @arg21 251 16777216 10 Y 0 31 8
+def @arg22 251 16777216 30 Y 0 31 8
+def @arg23 251 16777216 8 Y 128 31 63
+def @arg24 251 16777216 8 Y 0 31 8
+def @arg25 251 16777216 4 Y 128 31 63
+def @arg26 251 16777216 4 Y 0 31 8
+def @arg27 251 16777216 10 Y 128 31 63
+def @arg28 251 16777216 10 Y 0 31 8
+def @arg29 251 16777216 8 Y 128 31 63
+def @arg30 251 16777216 8 Y 0 31 8
+def @arg31 251 16777216 3 Y 0 31 8
+def @arg32 251 16777216 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -2129,38 +2129,38 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
from t9 where c1= 0 ;
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 0 Y 128 0 63
-def @arg03 253 20 0 Y 128 0 63
-def @arg04 253 20 0 Y 128 0 63
-def @arg05 253 20 0 Y 128 0 63
-def @arg06 253 20 0 Y 128 0 63
-def @arg07 253 23 0 Y 128 31 63
-def @arg08 253 23 0 Y 128 31 63
-def @arg09 253 23 0 Y 128 31 63
-def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
-def @arg13 253 16777216 0 Y 128 31 63
-def @arg14 253 16777216 0 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 0 Y 128 31 63
-def @arg17 253 20 0 Y 128 0 63
-def @arg18 253 20 0 Y 128 0 63
-def @arg19 253 20 0 Y 128 0 63
-def @arg20 253 16777216 0 Y 0 31 8
-def @arg21 253 16777216 0 Y 0 31 8
-def @arg22 253 16777216 0 Y 0 31 8
-def @arg23 253 16777216 0 Y 128 31 63
-def @arg24 253 16777216 0 Y 0 31 8
-def @arg25 253 16777216 0 Y 128 31 63
-def @arg26 253 16777216 0 Y 0 31 8
-def @arg27 253 16777216 0 Y 128 31 63
-def @arg28 253 16777216 0 Y 0 31 8
-def @arg29 253 16777216 0 Y 128 31 63
-def @arg30 253 16777216 0 Y 0 31 8
-def @arg31 253 16777216 0 Y 0 31 8
-def @arg32 253 16777216 0 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 0 Y 32896 0 63
+def @arg03 8 20 0 Y 32896 0 63
+def @arg04 8 20 0 Y 32896 0 63
+def @arg05 8 20 0 Y 32896 0 63
+def @arg06 8 20 0 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 0 Y 128 31 63
+def @arg17 8 20 0 Y 32928 0 63
+def @arg18 8 20 0 Y 32896 0 63
+def @arg19 8 20 0 Y 32896 0 63
+def @arg20 251 16777216 0 Y 0 31 8
+def @arg21 251 16777216 0 Y 0 31 8
+def @arg22 251 16777216 0 Y 0 31 8
+def @arg23 251 16777216 0 Y 128 31 63
+def @arg24 251 16777216 0 Y 0 31 8
+def @arg25 251 16777216 0 Y 128 31 63
+def @arg26 251 16777216 0 Y 0 31 8
+def @arg27 251 16777216 0 Y 128 31 63
+def @arg28 251 16777216 0 Y 0 31 8
+def @arg29 251 16777216 0 Y 128 31 63
+def @arg30 251 16777216 0 Y 0 31 8
+def @arg31 251 16777216 0 Y 0 31 8
+def @arg32 251 16777216 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -2175,76 +2175,76 @@ set @my_key= 1 ;
execute stmt1 using @my_key ;
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 1 Y 128 0 63
-def @arg03 253 20 1 Y 128 0 63
-def @arg04 253 20 1 Y 128 0 63
-def @arg05 253 20 1 Y 128 0 63
-def @arg06 253 20 1 Y 128 0 63
-def @arg07 253 23 1 Y 128 31 63
-def @arg08 253 23 1 Y 128 31 63
-def @arg09 253 23 1 Y 128 31 63
-def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
-def @arg13 253 16777216 10 Y 128 31 63
-def @arg14 253 16777216 19 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 8 Y 128 31 63
-def @arg17 253 20 4 Y 128 0 63
-def @arg18 253 20 1 Y 128 0 63
-def @arg19 253 20 1 Y 128 0 63
-def @arg20 253 16777216 1 Y 0 31 8
-def @arg21 253 16777216 10 Y 0 31 8
-def @arg22 253 16777216 30 Y 0 31 8
-def @arg23 253 16777216 8 Y 128 31 63
-def @arg24 253 16777216 8 Y 0 31 8
-def @arg25 253 16777216 4 Y 128 31 63
-def @arg26 253 16777216 4 Y 0 31 8
-def @arg27 253 16777216 10 Y 128 31 63
-def @arg28 253 16777216 10 Y 0 31 8
-def @arg29 253 16777216 8 Y 128 31 63
-def @arg30 253 16777216 8 Y 0 31 8
-def @arg31 253 16777216 3 Y 0 31 8
-def @arg32 253 16777216 6 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 1 Y 32896 0 63
+def @arg03 8 20 1 Y 32896 0 63
+def @arg04 8 20 1 Y 32896 0 63
+def @arg05 8 20 1 Y 32896 0 63
+def @arg06 8 20 1 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 8 Y 128 31 63
+def @arg17 8 20 4 Y 32928 0 63
+def @arg18 8 20 1 Y 32896 0 63
+def @arg19 8 20 1 Y 32896 0 63
+def @arg20 251 16777216 1 Y 0 31 8
+def @arg21 251 16777216 10 Y 0 31 8
+def @arg22 251 16777216 30 Y 0 31 8
+def @arg23 251 16777216 8 Y 128 31 63
+def @arg24 251 16777216 8 Y 0 31 8
+def @arg25 251 16777216 4 Y 128 31 63
+def @arg26 251 16777216 4 Y 0 31 8
+def @arg27 251 16777216 10 Y 128 31 63
+def @arg28 251 16777216 10 Y 0 31 8
+def @arg29 251 16777216 8 Y 128 31 63
+def @arg30 251 16777216 8 Y 0 31 8
+def @arg31 251 16777216 3 Y 0 31 8
+def @arg32 251 16777216 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
execute stmt1 using @my_key ;
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 0 Y 128 0 63
-def @arg03 253 20 0 Y 128 0 63
-def @arg04 253 20 0 Y 128 0 63
-def @arg05 253 20 0 Y 128 0 63
-def @arg06 253 20 0 Y 128 0 63
-def @arg07 253 23 0 Y 128 31 63
-def @arg08 253 23 0 Y 128 31 63
-def @arg09 253 23 0 Y 128 31 63
-def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
-def @arg13 253 16777216 0 Y 128 31 63
-def @arg14 253 16777216 0 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 0 Y 128 31 63
-def @arg17 253 20 0 Y 128 0 63
-def @arg18 253 20 0 Y 128 0 63
-def @arg19 253 20 0 Y 128 0 63
-def @arg20 253 16777216 0 Y 0 31 8
-def @arg21 253 16777216 0 Y 0 31 8
-def @arg22 253 16777216 0 Y 0 31 8
-def @arg23 253 16777216 0 Y 128 31 63
-def @arg24 253 16777216 0 Y 0 31 8
-def @arg25 253 16777216 0 Y 128 31 63
-def @arg26 253 16777216 0 Y 0 31 8
-def @arg27 253 16777216 0 Y 128 31 63
-def @arg28 253 16777216 0 Y 0 31 8
-def @arg29 253 16777216 0 Y 128 31 63
-def @arg30 253 16777216 0 Y 0 31 8
-def @arg31 253 16777216 0 Y 0 31 8
-def @arg32 253 16777216 0 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 0 Y 32896 0 63
+def @arg03 8 20 0 Y 32896 0 63
+def @arg04 8 20 0 Y 32896 0 63
+def @arg05 8 20 0 Y 32896 0 63
+def @arg06 8 20 0 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 0 Y 128 31 63
+def @arg17 8 20 0 Y 32928 0 63
+def @arg18 8 20 0 Y 32896 0 63
+def @arg19 8 20 0 Y 32896 0 63
+def @arg20 251 16777216 0 Y 0 31 8
+def @arg21 251 16777216 0 Y 0 31 8
+def @arg22 251 16777216 0 Y 0 31 8
+def @arg23 251 16777216 0 Y 128 31 63
+def @arg24 251 16777216 0 Y 0 31 8
+def @arg25 251 16777216 0 Y 128 31 63
+def @arg26 251 16777216 0 Y 0 31 8
+def @arg27 251 16777216 0 Y 128 31 63
+def @arg28 251 16777216 0 Y 0 31 8
+def @arg29 251 16777216 0 Y 128 31 63
+def @arg30 251 16777216 0 Y 0 31 8
+def @arg31 251 16777216 0 Y 0 31 8
+def @arg32 251 16777216 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1 into ? from t9 where c1= 1" ;
diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result
index 19be5a2707e..fa33dcc395a 100644
--- a/mysql-test/r/ps_4heap.result
+++ b/mysql-test/r/ps_4heap.result
@@ -1159,7 +1159,7 @@ def table 253 64 2 Y 0 31 8
def type 253 10 3 Y 0 31 8
def possible_keys 253 4096 0 Y 0 31 8
def key 253 64 0 Y 0 31 8
-def key_len 253 4096 0 Y 128 31 63
+def key_len 253 1365 0 Y 0 31 8
def ref 253 1024 0 Y 0 31 8
def rows 8 10 1 Y 32928 0 63
def Extra 253 255 0 N 1 31 8
@@ -1901,38 +1901,38 @@ from t9 where c1= 1 ;
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 1 Y 128 0 63
-def @arg03 253 20 1 Y 128 0 63
-def @arg04 253 20 1 Y 128 0 63
-def @arg05 253 20 1 Y 128 0 63
-def @arg06 253 20 1 Y 128 0 63
-def @arg07 253 23 1 Y 128 31 63
-def @arg08 253 23 1 Y 128 31 63
-def @arg09 253 23 1 Y 128 31 63
-def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
-def @arg13 253 16777216 10 Y 128 31 63
-def @arg14 253 16777216 19 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 8 Y 128 31 63
-def @arg17 253 20 4 Y 128 0 63
-def @arg18 253 20 1 Y 128 0 63
-def @arg19 253 20 1 Y 128 0 63
-def @arg20 253 16777216 1 Y 0 31 8
-def @arg21 253 16777216 10 Y 0 31 8
-def @arg22 253 16777216 30 Y 0 31 8
-def @arg23 253 16777216 8 Y 0 31 8
-def @arg24 253 16777216 8 Y 0 31 8
-def @arg25 253 16777216 4 Y 0 31 8
-def @arg26 253 16777216 4 Y 0 31 8
-def @arg27 253 16777216 10 Y 0 31 8
-def @arg28 253 16777216 10 Y 0 31 8
-def @arg29 253 16777216 8 Y 0 31 8
-def @arg30 253 16777216 8 Y 0 31 8
-def @arg31 253 16777216 3 Y 0 31 8
-def @arg32 253 16777216 6 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 1 Y 32896 0 63
+def @arg03 8 20 1 Y 32896 0 63
+def @arg04 8 20 1 Y 32896 0 63
+def @arg05 8 20 1 Y 32896 0 63
+def @arg06 8 20 1 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 8 Y 128 31 63
+def @arg17 8 20 4 Y 32928 0 63
+def @arg18 8 20 1 Y 32896 0 63
+def @arg19 8 20 1 Y 32896 0 63
+def @arg20 251 16777216 1 Y 0 31 8
+def @arg21 251 16777216 10 Y 0 31 8
+def @arg22 251 16777216 30 Y 0 31 8
+def @arg23 251 16777216 8 Y 0 31 8
+def @arg24 251 16777216 8 Y 0 31 8
+def @arg25 251 16777216 4 Y 0 31 8
+def @arg26 251 16777216 4 Y 0 31 8
+def @arg27 251 16777216 10 Y 0 31 8
+def @arg28 251 16777216 10 Y 0 31 8
+def @arg29 251 16777216 8 Y 0 31 8
+def @arg30 251 16777216 8 Y 0 31 8
+def @arg31 251 16777216 3 Y 0 31 8
+def @arg32 251 16777216 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
@@ -1948,38 +1948,38 @@ from t9 where c1= 0 ;
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 0 Y 128 0 63
-def @arg03 253 20 0 Y 128 0 63
-def @arg04 253 20 0 Y 128 0 63
-def @arg05 253 20 0 Y 128 0 63
-def @arg06 253 20 0 Y 128 0 63
-def @arg07 253 23 0 Y 128 31 63
-def @arg08 253 23 0 Y 128 31 63
-def @arg09 253 23 0 Y 128 31 63
-def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
-def @arg13 253 16777216 0 Y 128 31 63
-def @arg14 253 16777216 0 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 0 Y 128 31 63
-def @arg17 253 20 0 Y 128 0 63
-def @arg18 253 20 0 Y 128 0 63
-def @arg19 253 20 0 Y 128 0 63
-def @arg20 253 16777216 0 Y 0 31 8
-def @arg21 253 16777216 0 Y 0 31 8
-def @arg22 253 16777216 0 Y 0 31 8
-def @arg23 253 16777216 0 Y 0 31 8
-def @arg24 253 16777216 0 Y 0 31 8
-def @arg25 253 16777216 0 Y 0 31 8
-def @arg26 253 16777216 0 Y 0 31 8
-def @arg27 253 16777216 0 Y 0 31 8
-def @arg28 253 16777216 0 Y 0 31 8
-def @arg29 253 16777216 0 Y 0 31 8
-def @arg30 253 16777216 0 Y 0 31 8
-def @arg31 253 16777216 0 Y 0 31 8
-def @arg32 253 16777216 0 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 0 Y 32896 0 63
+def @arg03 8 20 0 Y 32896 0 63
+def @arg04 8 20 0 Y 32896 0 63
+def @arg05 8 20 0 Y 32896 0 63
+def @arg06 8 20 0 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 0 Y 128 31 63
+def @arg17 8 20 0 Y 32928 0 63
+def @arg18 8 20 0 Y 32896 0 63
+def @arg19 8 20 0 Y 32896 0 63
+def @arg20 251 16777216 0 Y 0 31 8
+def @arg21 251 16777216 0 Y 0 31 8
+def @arg22 251 16777216 0 Y 0 31 8
+def @arg23 251 16777216 0 Y 0 31 8
+def @arg24 251 16777216 0 Y 0 31 8
+def @arg25 251 16777216 0 Y 0 31 8
+def @arg26 251 16777216 0 Y 0 31 8
+def @arg27 251 16777216 0 Y 0 31 8
+def @arg28 251 16777216 0 Y 0 31 8
+def @arg29 251 16777216 0 Y 0 31 8
+def @arg30 251 16777216 0 Y 0 31 8
+def @arg31 251 16777216 0 Y 0 31 8
+def @arg32 251 16777216 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select
@@ -1998,38 +1998,38 @@ execute stmt1 using @my_key ;
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 1 Y 128 0 63
-def @arg03 253 20 1 Y 128 0 63
-def @arg04 253 20 1 Y 128 0 63
-def @arg05 253 20 1 Y 128 0 63
-def @arg06 253 20 1 Y 128 0 63
-def @arg07 253 23 1 Y 128 31 63
-def @arg08 253 23 1 Y 128 31 63
-def @arg09 253 23 1 Y 128 31 63
-def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
-def @arg13 253 16777216 10 Y 128 31 63
-def @arg14 253 16777216 19 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 8 Y 128 31 63
-def @arg17 253 20 4 Y 128 0 63
-def @arg18 253 20 1 Y 128 0 63
-def @arg19 253 20 1 Y 128 0 63
-def @arg20 253 16777216 1 Y 0 31 8
-def @arg21 253 16777216 10 Y 0 31 8
-def @arg22 253 16777216 30 Y 0 31 8
-def @arg23 253 16777216 8 Y 0 31 8
-def @arg24 253 16777216 8 Y 0 31 8
-def @arg25 253 16777216 4 Y 0 31 8
-def @arg26 253 16777216 4 Y 0 31 8
-def @arg27 253 16777216 10 Y 0 31 8
-def @arg28 253 16777216 10 Y 0 31 8
-def @arg29 253 16777216 8 Y 0 31 8
-def @arg30 253 16777216 8 Y 0 31 8
-def @arg31 253 16777216 3 Y 0 31 8
-def @arg32 253 16777216 6 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 1 Y 32896 0 63
+def @arg03 8 20 1 Y 32896 0 63
+def @arg04 8 20 1 Y 32896 0 63
+def @arg05 8 20 1 Y 32896 0 63
+def @arg06 8 20 1 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 8 Y 128 31 63
+def @arg17 8 20 4 Y 32928 0 63
+def @arg18 8 20 1 Y 32896 0 63
+def @arg19 8 20 1 Y 32896 0 63
+def @arg20 251 16777216 1 Y 0 31 8
+def @arg21 251 16777216 10 Y 0 31 8
+def @arg22 251 16777216 30 Y 0 31 8
+def @arg23 251 16777216 8 Y 0 31 8
+def @arg24 251 16777216 8 Y 0 31 8
+def @arg25 251 16777216 4 Y 0 31 8
+def @arg26 251 16777216 4 Y 0 31 8
+def @arg27 251 16777216 10 Y 0 31 8
+def @arg28 251 16777216 10 Y 0 31 8
+def @arg29 251 16777216 8 Y 0 31 8
+def @arg30 251 16777216 8 Y 0 31 8
+def @arg31 251 16777216 3 Y 0 31 8
+def @arg32 251 16777216 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
@@ -2038,38 +2038,38 @@ execute stmt1 using @my_key ;
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 0 Y 128 0 63
-def @arg03 253 20 0 Y 128 0 63
-def @arg04 253 20 0 Y 128 0 63
-def @arg05 253 20 0 Y 128 0 63
-def @arg06 253 20 0 Y 128 0 63
-def @arg07 253 23 0 Y 128 31 63
-def @arg08 253 23 0 Y 128 31 63
-def @arg09 253 23 0 Y 128 31 63
-def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
-def @arg13 253 16777216 0 Y 128 31 63
-def @arg14 253 16777216 0 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 0 Y 128 31 63
-def @arg17 253 20 0 Y 128 0 63
-def @arg18 253 20 0 Y 128 0 63
-def @arg19 253 20 0 Y 128 0 63
-def @arg20 253 16777216 0 Y 0 31 8
-def @arg21 253 16777216 0 Y 0 31 8
-def @arg22 253 16777216 0 Y 0 31 8
-def @arg23 253 16777216 0 Y 0 31 8
-def @arg24 253 16777216 0 Y 0 31 8
-def @arg25 253 16777216 0 Y 0 31 8
-def @arg26 253 16777216 0 Y 0 31 8
-def @arg27 253 16777216 0 Y 0 31 8
-def @arg28 253 16777216 0 Y 0 31 8
-def @arg29 253 16777216 0 Y 0 31 8
-def @arg30 253 16777216 0 Y 0 31 8
-def @arg31 253 16777216 0 Y 0 31 8
-def @arg32 253 16777216 0 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 0 Y 32896 0 63
+def @arg03 8 20 0 Y 32896 0 63
+def @arg04 8 20 0 Y 32896 0 63
+def @arg05 8 20 0 Y 32896 0 63
+def @arg06 8 20 0 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 0 Y 128 31 63
+def @arg17 8 20 0 Y 32928 0 63
+def @arg18 8 20 0 Y 32896 0 63
+def @arg19 8 20 0 Y 32896 0 63
+def @arg20 251 16777216 0 Y 0 31 8
+def @arg21 251 16777216 0 Y 0 31 8
+def @arg22 251 16777216 0 Y 0 31 8
+def @arg23 251 16777216 0 Y 0 31 8
+def @arg24 251 16777216 0 Y 0 31 8
+def @arg25 251 16777216 0 Y 0 31 8
+def @arg26 251 16777216 0 Y 0 31 8
+def @arg27 251 16777216 0 Y 0 31 8
+def @arg28 251 16777216 0 Y 0 31 8
+def @arg29 251 16777216 0 Y 0 31 8
+def @arg30 251 16777216 0 Y 0 31 8
+def @arg31 251 16777216 0 Y 0 31 8
+def @arg32 251 16777216 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select ? := c1 from t9 where c1= 1" ;
@@ -2086,38 +2086,38 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
from t9 where c1= 1 ;
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 1 Y 128 0 63
-def @arg03 253 20 1 Y 128 0 63
-def @arg04 253 20 1 Y 128 0 63
-def @arg05 253 20 1 Y 128 0 63
-def @arg06 253 20 1 Y 128 0 63
-def @arg07 253 23 1 Y 128 31 63
-def @arg08 253 23 1 Y 128 31 63
-def @arg09 253 23 1 Y 128 31 63
-def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
-def @arg13 253 16777216 10 Y 128 31 63
-def @arg14 253 16777216 19 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 8 Y 128 31 63
-def @arg17 253 20 4 Y 128 0 63
-def @arg18 253 20 1 Y 128 0 63
-def @arg19 253 20 1 Y 128 0 63
-def @arg20 253 16777216 1 Y 0 31 8
-def @arg21 253 16777216 10 Y 0 31 8
-def @arg22 253 16777216 30 Y 0 31 8
-def @arg23 253 16777216 8 Y 0 31 8
-def @arg24 253 16777216 8 Y 0 31 8
-def @arg25 253 16777216 4 Y 0 31 8
-def @arg26 253 16777216 4 Y 0 31 8
-def @arg27 253 16777216 10 Y 0 31 8
-def @arg28 253 16777216 10 Y 0 31 8
-def @arg29 253 16777216 8 Y 0 31 8
-def @arg30 253 16777216 8 Y 0 31 8
-def @arg31 253 16777216 3 Y 0 31 8
-def @arg32 253 16777216 6 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 1 Y 32896 0 63
+def @arg03 8 20 1 Y 32896 0 63
+def @arg04 8 20 1 Y 32896 0 63
+def @arg05 8 20 1 Y 32896 0 63
+def @arg06 8 20 1 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 8 Y 128 31 63
+def @arg17 8 20 4 Y 32928 0 63
+def @arg18 8 20 1 Y 32896 0 63
+def @arg19 8 20 1 Y 32896 0 63
+def @arg20 251 16777216 1 Y 0 31 8
+def @arg21 251 16777216 10 Y 0 31 8
+def @arg22 251 16777216 30 Y 0 31 8
+def @arg23 251 16777216 8 Y 0 31 8
+def @arg24 251 16777216 8 Y 0 31 8
+def @arg25 251 16777216 4 Y 0 31 8
+def @arg26 251 16777216 4 Y 0 31 8
+def @arg27 251 16777216 10 Y 0 31 8
+def @arg28 251 16777216 10 Y 0 31 8
+def @arg29 251 16777216 8 Y 0 31 8
+def @arg30 251 16777216 8 Y 0 31 8
+def @arg31 251 16777216 3 Y 0 31 8
+def @arg32 251 16777216 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -2130,38 +2130,38 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
from t9 where c1= 0 ;
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 0 Y 128 0 63
-def @arg03 253 20 0 Y 128 0 63
-def @arg04 253 20 0 Y 128 0 63
-def @arg05 253 20 0 Y 128 0 63
-def @arg06 253 20 0 Y 128 0 63
-def @arg07 253 23 0 Y 128 31 63
-def @arg08 253 23 0 Y 128 31 63
-def @arg09 253 23 0 Y 128 31 63
-def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
-def @arg13 253 16777216 0 Y 128 31 63
-def @arg14 253 16777216 0 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 0 Y 128 31 63
-def @arg17 253 20 0 Y 128 0 63
-def @arg18 253 20 0 Y 128 0 63
-def @arg19 253 20 0 Y 128 0 63
-def @arg20 253 16777216 0 Y 0 31 8
-def @arg21 253 16777216 0 Y 0 31 8
-def @arg22 253 16777216 0 Y 0 31 8
-def @arg23 253 16777216 0 Y 0 31 8
-def @arg24 253 16777216 0 Y 0 31 8
-def @arg25 253 16777216 0 Y 0 31 8
-def @arg26 253 16777216 0 Y 0 31 8
-def @arg27 253 16777216 0 Y 0 31 8
-def @arg28 253 16777216 0 Y 0 31 8
-def @arg29 253 16777216 0 Y 0 31 8
-def @arg30 253 16777216 0 Y 0 31 8
-def @arg31 253 16777216 0 Y 0 31 8
-def @arg32 253 16777216 0 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 0 Y 32896 0 63
+def @arg03 8 20 0 Y 32896 0 63
+def @arg04 8 20 0 Y 32896 0 63
+def @arg05 8 20 0 Y 32896 0 63
+def @arg06 8 20 0 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 0 Y 128 31 63
+def @arg17 8 20 0 Y 32928 0 63
+def @arg18 8 20 0 Y 32896 0 63
+def @arg19 8 20 0 Y 32896 0 63
+def @arg20 251 16777216 0 Y 0 31 8
+def @arg21 251 16777216 0 Y 0 31 8
+def @arg22 251 16777216 0 Y 0 31 8
+def @arg23 251 16777216 0 Y 0 31 8
+def @arg24 251 16777216 0 Y 0 31 8
+def @arg25 251 16777216 0 Y 0 31 8
+def @arg26 251 16777216 0 Y 0 31 8
+def @arg27 251 16777216 0 Y 0 31 8
+def @arg28 251 16777216 0 Y 0 31 8
+def @arg29 251 16777216 0 Y 0 31 8
+def @arg30 251 16777216 0 Y 0 31 8
+def @arg31 251 16777216 0 Y 0 31 8
+def @arg32 251 16777216 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -2176,76 +2176,76 @@ set @my_key= 1 ;
execute stmt1 using @my_key ;
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 1 Y 128 0 63
-def @arg03 253 20 1 Y 128 0 63
-def @arg04 253 20 1 Y 128 0 63
-def @arg05 253 20 1 Y 128 0 63
-def @arg06 253 20 1 Y 128 0 63
-def @arg07 253 23 1 Y 128 31 63
-def @arg08 253 23 1 Y 128 31 63
-def @arg09 253 23 1 Y 128 31 63
-def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
-def @arg13 253 16777216 10 Y 128 31 63
-def @arg14 253 16777216 19 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 8 Y 128 31 63
-def @arg17 253 20 4 Y 128 0 63
-def @arg18 253 20 1 Y 128 0 63
-def @arg19 253 20 1 Y 128 0 63
-def @arg20 253 16777216 1 Y 0 31 8
-def @arg21 253 16777216 10 Y 0 31 8
-def @arg22 253 16777216 30 Y 0 31 8
-def @arg23 253 16777216 8 Y 0 31 8
-def @arg24 253 16777216 8 Y 0 31 8
-def @arg25 253 16777216 4 Y 0 31 8
-def @arg26 253 16777216 4 Y 0 31 8
-def @arg27 253 16777216 10 Y 0 31 8
-def @arg28 253 16777216 10 Y 0 31 8
-def @arg29 253 16777216 8 Y 0 31 8
-def @arg30 253 16777216 8 Y 0 31 8
-def @arg31 253 16777216 3 Y 0 31 8
-def @arg32 253 16777216 6 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 1 Y 32896 0 63
+def @arg03 8 20 1 Y 32896 0 63
+def @arg04 8 20 1 Y 32896 0 63
+def @arg05 8 20 1 Y 32896 0 63
+def @arg06 8 20 1 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 8 Y 128 31 63
+def @arg17 8 20 4 Y 32928 0 63
+def @arg18 8 20 1 Y 32896 0 63
+def @arg19 8 20 1 Y 32896 0 63
+def @arg20 251 16777216 1 Y 0 31 8
+def @arg21 251 16777216 10 Y 0 31 8
+def @arg22 251 16777216 30 Y 0 31 8
+def @arg23 251 16777216 8 Y 0 31 8
+def @arg24 251 16777216 8 Y 0 31 8
+def @arg25 251 16777216 4 Y 0 31 8
+def @arg26 251 16777216 4 Y 0 31 8
+def @arg27 251 16777216 10 Y 0 31 8
+def @arg28 251 16777216 10 Y 0 31 8
+def @arg29 251 16777216 8 Y 0 31 8
+def @arg30 251 16777216 8 Y 0 31 8
+def @arg31 251 16777216 3 Y 0 31 8
+def @arg32 251 16777216 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
execute stmt1 using @my_key ;
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 0 Y 128 0 63
-def @arg03 253 20 0 Y 128 0 63
-def @arg04 253 20 0 Y 128 0 63
-def @arg05 253 20 0 Y 128 0 63
-def @arg06 253 20 0 Y 128 0 63
-def @arg07 253 23 0 Y 128 31 63
-def @arg08 253 23 0 Y 128 31 63
-def @arg09 253 23 0 Y 128 31 63
-def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
-def @arg13 253 16777216 0 Y 128 31 63
-def @arg14 253 16777216 0 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 0 Y 128 31 63
-def @arg17 253 20 0 Y 128 0 63
-def @arg18 253 20 0 Y 128 0 63
-def @arg19 253 20 0 Y 128 0 63
-def @arg20 253 16777216 0 Y 0 31 8
-def @arg21 253 16777216 0 Y 0 31 8
-def @arg22 253 16777216 0 Y 0 31 8
-def @arg23 253 16777216 0 Y 0 31 8
-def @arg24 253 16777216 0 Y 0 31 8
-def @arg25 253 16777216 0 Y 0 31 8
-def @arg26 253 16777216 0 Y 0 31 8
-def @arg27 253 16777216 0 Y 0 31 8
-def @arg28 253 16777216 0 Y 0 31 8
-def @arg29 253 16777216 0 Y 0 31 8
-def @arg30 253 16777216 0 Y 0 31 8
-def @arg31 253 16777216 0 Y 0 31 8
-def @arg32 253 16777216 0 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 0 Y 32896 0 63
+def @arg03 8 20 0 Y 32896 0 63
+def @arg04 8 20 0 Y 32896 0 63
+def @arg05 8 20 0 Y 32896 0 63
+def @arg06 8 20 0 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 0 Y 128 31 63
+def @arg17 8 20 0 Y 32928 0 63
+def @arg18 8 20 0 Y 32896 0 63
+def @arg19 8 20 0 Y 32896 0 63
+def @arg20 251 16777216 0 Y 0 31 8
+def @arg21 251 16777216 0 Y 0 31 8
+def @arg22 251 16777216 0 Y 0 31 8
+def @arg23 251 16777216 0 Y 0 31 8
+def @arg24 251 16777216 0 Y 0 31 8
+def @arg25 251 16777216 0 Y 0 31 8
+def @arg26 251 16777216 0 Y 0 31 8
+def @arg27 251 16777216 0 Y 0 31 8
+def @arg28 251 16777216 0 Y 0 31 8
+def @arg29 251 16777216 0 Y 0 31 8
+def @arg30 251 16777216 0 Y 0 31 8
+def @arg31 251 16777216 0 Y 0 31 8
+def @arg32 251 16777216 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1 into ? from t9 where c1= 1" ;
diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result
index ebdc5c8c9fd..968342c8a93 100644
--- a/mysql-test/r/ps_5merge.result
+++ b/mysql-test/r/ps_5merge.result
@@ -1201,7 +1201,7 @@ def table 253 64 2 Y 0 31 8
def type 253 10 3 Y 0 31 8
def possible_keys 253 4096 0 Y 0 31 8
def key 253 64 0 Y 0 31 8
-def key_len 253 4096 0 Y 128 31 63
+def key_len 253 1365 0 Y 0 31 8
def ref 253 1024 0 Y 0 31 8
def rows 8 10 1 Y 32928 0 63
def Extra 253 255 0 N 1 31 8
@@ -1837,38 +1837,38 @@ from t9 where c1= 1 ;
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 1 Y 128 0 63
-def @arg03 253 20 1 Y 128 0 63
-def @arg04 253 20 1 Y 128 0 63
-def @arg05 253 20 1 Y 128 0 63
-def @arg06 253 20 1 Y 128 0 63
-def @arg07 253 23 1 Y 128 31 63
-def @arg08 253 23 1 Y 128 31 63
-def @arg09 253 23 1 Y 128 31 63
-def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
-def @arg13 253 16777216 10 Y 128 31 63
-def @arg14 253 16777216 19 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 8 Y 128 31 63
-def @arg17 253 20 4 Y 128 0 63
-def @arg18 253 20 1 Y 128 0 63
-def @arg19 253 20 1 Y 128 0 63
-def @arg20 253 16777216 1 Y 0 31 8
-def @arg21 253 16777216 10 Y 0 31 8
-def @arg22 253 16777216 30 Y 0 31 8
-def @arg23 253 16777216 8 Y 128 31 63
-def @arg24 253 16777216 8 Y 0 31 8
-def @arg25 253 16777216 4 Y 128 31 63
-def @arg26 253 16777216 4 Y 0 31 8
-def @arg27 253 16777216 10 Y 128 31 63
-def @arg28 253 16777216 10 Y 0 31 8
-def @arg29 253 16777216 8 Y 128 31 63
-def @arg30 253 16777216 8 Y 0 31 8
-def @arg31 253 16777216 3 Y 0 31 8
-def @arg32 253 16777216 6 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 1 Y 32896 0 63
+def @arg03 8 20 1 Y 32896 0 63
+def @arg04 8 20 1 Y 32896 0 63
+def @arg05 8 20 1 Y 32896 0 63
+def @arg06 8 20 1 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 8 Y 128 31 63
+def @arg17 8 20 4 Y 32928 0 63
+def @arg18 8 20 1 Y 32896 0 63
+def @arg19 8 20 1 Y 32896 0 63
+def @arg20 251 16777216 1 Y 0 31 8
+def @arg21 251 16777216 10 Y 0 31 8
+def @arg22 251 16777216 30 Y 0 31 8
+def @arg23 251 16777216 8 Y 128 31 63
+def @arg24 251 16777216 8 Y 0 31 8
+def @arg25 251 16777216 4 Y 128 31 63
+def @arg26 251 16777216 4 Y 0 31 8
+def @arg27 251 16777216 10 Y 128 31 63
+def @arg28 251 16777216 10 Y 0 31 8
+def @arg29 251 16777216 8 Y 128 31 63
+def @arg30 251 16777216 8 Y 0 31 8
+def @arg31 251 16777216 3 Y 0 31 8
+def @arg32 251 16777216 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
@@ -1884,38 +1884,38 @@ from t9 where c1= 0 ;
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 0 Y 128 0 63
-def @arg03 253 20 0 Y 128 0 63
-def @arg04 253 20 0 Y 128 0 63
-def @arg05 253 20 0 Y 128 0 63
-def @arg06 253 20 0 Y 128 0 63
-def @arg07 253 23 0 Y 128 31 63
-def @arg08 253 23 0 Y 128 31 63
-def @arg09 253 23 0 Y 128 31 63
-def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
-def @arg13 253 16777216 0 Y 128 31 63
-def @arg14 253 16777216 0 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 0 Y 128 31 63
-def @arg17 253 20 0 Y 128 0 63
-def @arg18 253 20 0 Y 128 0 63
-def @arg19 253 20 0 Y 128 0 63
-def @arg20 253 16777216 0 Y 0 31 8
-def @arg21 253 16777216 0 Y 0 31 8
-def @arg22 253 16777216 0 Y 0 31 8
-def @arg23 253 16777216 0 Y 128 31 63
-def @arg24 253 16777216 0 Y 0 31 8
-def @arg25 253 16777216 0 Y 128 31 63
-def @arg26 253 16777216 0 Y 0 31 8
-def @arg27 253 16777216 0 Y 128 31 63
-def @arg28 253 16777216 0 Y 0 31 8
-def @arg29 253 16777216 0 Y 128 31 63
-def @arg30 253 16777216 0 Y 0 31 8
-def @arg31 253 16777216 0 Y 0 31 8
-def @arg32 253 16777216 0 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 0 Y 32896 0 63
+def @arg03 8 20 0 Y 32896 0 63
+def @arg04 8 20 0 Y 32896 0 63
+def @arg05 8 20 0 Y 32896 0 63
+def @arg06 8 20 0 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 0 Y 128 31 63
+def @arg17 8 20 0 Y 32928 0 63
+def @arg18 8 20 0 Y 32896 0 63
+def @arg19 8 20 0 Y 32896 0 63
+def @arg20 251 16777216 0 Y 0 31 8
+def @arg21 251 16777216 0 Y 0 31 8
+def @arg22 251 16777216 0 Y 0 31 8
+def @arg23 251 16777216 0 Y 128 31 63
+def @arg24 251 16777216 0 Y 0 31 8
+def @arg25 251 16777216 0 Y 128 31 63
+def @arg26 251 16777216 0 Y 0 31 8
+def @arg27 251 16777216 0 Y 128 31 63
+def @arg28 251 16777216 0 Y 0 31 8
+def @arg29 251 16777216 0 Y 128 31 63
+def @arg30 251 16777216 0 Y 0 31 8
+def @arg31 251 16777216 0 Y 0 31 8
+def @arg32 251 16777216 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select
@@ -1934,38 +1934,38 @@ execute stmt1 using @my_key ;
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 1 Y 128 0 63
-def @arg03 253 20 1 Y 128 0 63
-def @arg04 253 20 1 Y 128 0 63
-def @arg05 253 20 1 Y 128 0 63
-def @arg06 253 20 1 Y 128 0 63
-def @arg07 253 23 1 Y 128 31 63
-def @arg08 253 23 1 Y 128 31 63
-def @arg09 253 23 1 Y 128 31 63
-def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
-def @arg13 253 16777216 10 Y 128 31 63
-def @arg14 253 16777216 19 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 8 Y 128 31 63
-def @arg17 253 20 4 Y 128 0 63
-def @arg18 253 20 1 Y 128 0 63
-def @arg19 253 20 1 Y 128 0 63
-def @arg20 253 16777216 1 Y 0 31 8
-def @arg21 253 16777216 10 Y 0 31 8
-def @arg22 253 16777216 30 Y 0 31 8
-def @arg23 253 16777216 8 Y 128 31 63
-def @arg24 253 16777216 8 Y 0 31 8
-def @arg25 253 16777216 4 Y 128 31 63
-def @arg26 253 16777216 4 Y 0 31 8
-def @arg27 253 16777216 10 Y 128 31 63
-def @arg28 253 16777216 10 Y 0 31 8
-def @arg29 253 16777216 8 Y 128 31 63
-def @arg30 253 16777216 8 Y 0 31 8
-def @arg31 253 16777216 3 Y 0 31 8
-def @arg32 253 16777216 6 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 1 Y 32896 0 63
+def @arg03 8 20 1 Y 32896 0 63
+def @arg04 8 20 1 Y 32896 0 63
+def @arg05 8 20 1 Y 32896 0 63
+def @arg06 8 20 1 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 8 Y 128 31 63
+def @arg17 8 20 4 Y 32928 0 63
+def @arg18 8 20 1 Y 32896 0 63
+def @arg19 8 20 1 Y 32896 0 63
+def @arg20 251 16777216 1 Y 0 31 8
+def @arg21 251 16777216 10 Y 0 31 8
+def @arg22 251 16777216 30 Y 0 31 8
+def @arg23 251 16777216 8 Y 128 31 63
+def @arg24 251 16777216 8 Y 0 31 8
+def @arg25 251 16777216 4 Y 128 31 63
+def @arg26 251 16777216 4 Y 0 31 8
+def @arg27 251 16777216 10 Y 128 31 63
+def @arg28 251 16777216 10 Y 0 31 8
+def @arg29 251 16777216 8 Y 128 31 63
+def @arg30 251 16777216 8 Y 0 31 8
+def @arg31 251 16777216 3 Y 0 31 8
+def @arg32 251 16777216 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
@@ -1974,38 +1974,38 @@ execute stmt1 using @my_key ;
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 0 Y 128 0 63
-def @arg03 253 20 0 Y 128 0 63
-def @arg04 253 20 0 Y 128 0 63
-def @arg05 253 20 0 Y 128 0 63
-def @arg06 253 20 0 Y 128 0 63
-def @arg07 253 23 0 Y 128 31 63
-def @arg08 253 23 0 Y 128 31 63
-def @arg09 253 23 0 Y 128 31 63
-def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
-def @arg13 253 16777216 0 Y 128 31 63
-def @arg14 253 16777216 0 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 0 Y 128 31 63
-def @arg17 253 20 0 Y 128 0 63
-def @arg18 253 20 0 Y 128 0 63
-def @arg19 253 20 0 Y 128 0 63
-def @arg20 253 16777216 0 Y 0 31 8
-def @arg21 253 16777216 0 Y 0 31 8
-def @arg22 253 16777216 0 Y 0 31 8
-def @arg23 253 16777216 0 Y 128 31 63
-def @arg24 253 16777216 0 Y 0 31 8
-def @arg25 253 16777216 0 Y 128 31 63
-def @arg26 253 16777216 0 Y 0 31 8
-def @arg27 253 16777216 0 Y 128 31 63
-def @arg28 253 16777216 0 Y 0 31 8
-def @arg29 253 16777216 0 Y 128 31 63
-def @arg30 253 16777216 0 Y 0 31 8
-def @arg31 253 16777216 0 Y 0 31 8
-def @arg32 253 16777216 0 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 0 Y 32896 0 63
+def @arg03 8 20 0 Y 32896 0 63
+def @arg04 8 20 0 Y 32896 0 63
+def @arg05 8 20 0 Y 32896 0 63
+def @arg06 8 20 0 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 0 Y 128 31 63
+def @arg17 8 20 0 Y 32928 0 63
+def @arg18 8 20 0 Y 32896 0 63
+def @arg19 8 20 0 Y 32896 0 63
+def @arg20 251 16777216 0 Y 0 31 8
+def @arg21 251 16777216 0 Y 0 31 8
+def @arg22 251 16777216 0 Y 0 31 8
+def @arg23 251 16777216 0 Y 128 31 63
+def @arg24 251 16777216 0 Y 0 31 8
+def @arg25 251 16777216 0 Y 128 31 63
+def @arg26 251 16777216 0 Y 0 31 8
+def @arg27 251 16777216 0 Y 128 31 63
+def @arg28 251 16777216 0 Y 0 31 8
+def @arg29 251 16777216 0 Y 128 31 63
+def @arg30 251 16777216 0 Y 0 31 8
+def @arg31 251 16777216 0 Y 0 31 8
+def @arg32 251 16777216 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select ? := c1 from t9 where c1= 1" ;
@@ -2022,38 +2022,38 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
from t9 where c1= 1 ;
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 1 Y 128 0 63
-def @arg03 253 20 1 Y 128 0 63
-def @arg04 253 20 1 Y 128 0 63
-def @arg05 253 20 1 Y 128 0 63
-def @arg06 253 20 1 Y 128 0 63
-def @arg07 253 23 1 Y 128 31 63
-def @arg08 253 23 1 Y 128 31 63
-def @arg09 253 23 1 Y 128 31 63
-def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
-def @arg13 253 16777216 10 Y 128 31 63
-def @arg14 253 16777216 19 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 8 Y 128 31 63
-def @arg17 253 20 4 Y 128 0 63
-def @arg18 253 20 1 Y 128 0 63
-def @arg19 253 20 1 Y 128 0 63
-def @arg20 253 16777216 1 Y 0 31 8
-def @arg21 253 16777216 10 Y 0 31 8
-def @arg22 253 16777216 30 Y 0 31 8
-def @arg23 253 16777216 8 Y 128 31 63
-def @arg24 253 16777216 8 Y 0 31 8
-def @arg25 253 16777216 4 Y 128 31 63
-def @arg26 253 16777216 4 Y 0 31 8
-def @arg27 253 16777216 10 Y 128 31 63
-def @arg28 253 16777216 10 Y 0 31 8
-def @arg29 253 16777216 8 Y 128 31 63
-def @arg30 253 16777216 8 Y 0 31 8
-def @arg31 253 16777216 3 Y 0 31 8
-def @arg32 253 16777216 6 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 1 Y 32896 0 63
+def @arg03 8 20 1 Y 32896 0 63
+def @arg04 8 20 1 Y 32896 0 63
+def @arg05 8 20 1 Y 32896 0 63
+def @arg06 8 20 1 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 8 Y 128 31 63
+def @arg17 8 20 4 Y 32928 0 63
+def @arg18 8 20 1 Y 32896 0 63
+def @arg19 8 20 1 Y 32896 0 63
+def @arg20 251 16777216 1 Y 0 31 8
+def @arg21 251 16777216 10 Y 0 31 8
+def @arg22 251 16777216 30 Y 0 31 8
+def @arg23 251 16777216 8 Y 128 31 63
+def @arg24 251 16777216 8 Y 0 31 8
+def @arg25 251 16777216 4 Y 128 31 63
+def @arg26 251 16777216 4 Y 0 31 8
+def @arg27 251 16777216 10 Y 128 31 63
+def @arg28 251 16777216 10 Y 0 31 8
+def @arg29 251 16777216 8 Y 128 31 63
+def @arg30 251 16777216 8 Y 0 31 8
+def @arg31 251 16777216 3 Y 0 31 8
+def @arg32 251 16777216 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -2066,38 +2066,38 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
from t9 where c1= 0 ;
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 0 Y 128 0 63
-def @arg03 253 20 0 Y 128 0 63
-def @arg04 253 20 0 Y 128 0 63
-def @arg05 253 20 0 Y 128 0 63
-def @arg06 253 20 0 Y 128 0 63
-def @arg07 253 23 0 Y 128 31 63
-def @arg08 253 23 0 Y 128 31 63
-def @arg09 253 23 0 Y 128 31 63
-def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
-def @arg13 253 16777216 0 Y 128 31 63
-def @arg14 253 16777216 0 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 0 Y 128 31 63
-def @arg17 253 20 0 Y 128 0 63
-def @arg18 253 20 0 Y 128 0 63
-def @arg19 253 20 0 Y 128 0 63
-def @arg20 253 16777216 0 Y 0 31 8
-def @arg21 253 16777216 0 Y 0 31 8
-def @arg22 253 16777216 0 Y 0 31 8
-def @arg23 253 16777216 0 Y 128 31 63
-def @arg24 253 16777216 0 Y 0 31 8
-def @arg25 253 16777216 0 Y 128 31 63
-def @arg26 253 16777216 0 Y 0 31 8
-def @arg27 253 16777216 0 Y 128 31 63
-def @arg28 253 16777216 0 Y 0 31 8
-def @arg29 253 16777216 0 Y 128 31 63
-def @arg30 253 16777216 0 Y 0 31 8
-def @arg31 253 16777216 0 Y 0 31 8
-def @arg32 253 16777216 0 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 0 Y 32896 0 63
+def @arg03 8 20 0 Y 32896 0 63
+def @arg04 8 20 0 Y 32896 0 63
+def @arg05 8 20 0 Y 32896 0 63
+def @arg06 8 20 0 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 0 Y 128 31 63
+def @arg17 8 20 0 Y 32928 0 63
+def @arg18 8 20 0 Y 32896 0 63
+def @arg19 8 20 0 Y 32896 0 63
+def @arg20 251 16777216 0 Y 0 31 8
+def @arg21 251 16777216 0 Y 0 31 8
+def @arg22 251 16777216 0 Y 0 31 8
+def @arg23 251 16777216 0 Y 128 31 63
+def @arg24 251 16777216 0 Y 0 31 8
+def @arg25 251 16777216 0 Y 128 31 63
+def @arg26 251 16777216 0 Y 0 31 8
+def @arg27 251 16777216 0 Y 128 31 63
+def @arg28 251 16777216 0 Y 0 31 8
+def @arg29 251 16777216 0 Y 128 31 63
+def @arg30 251 16777216 0 Y 0 31 8
+def @arg31 251 16777216 0 Y 0 31 8
+def @arg32 251 16777216 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -2112,76 +2112,76 @@ set @my_key= 1 ;
execute stmt1 using @my_key ;
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 1 Y 128 0 63
-def @arg03 253 20 1 Y 128 0 63
-def @arg04 253 20 1 Y 128 0 63
-def @arg05 253 20 1 Y 128 0 63
-def @arg06 253 20 1 Y 128 0 63
-def @arg07 253 23 1 Y 128 31 63
-def @arg08 253 23 1 Y 128 31 63
-def @arg09 253 23 1 Y 128 31 63
-def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
-def @arg13 253 16777216 10 Y 128 31 63
-def @arg14 253 16777216 19 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 8 Y 128 31 63
-def @arg17 253 20 4 Y 128 0 63
-def @arg18 253 20 1 Y 128 0 63
-def @arg19 253 20 1 Y 128 0 63
-def @arg20 253 16777216 1 Y 0 31 8
-def @arg21 253 16777216 10 Y 0 31 8
-def @arg22 253 16777216 30 Y 0 31 8
-def @arg23 253 16777216 8 Y 128 31 63
-def @arg24 253 16777216 8 Y 0 31 8
-def @arg25 253 16777216 4 Y 128 31 63
-def @arg26 253 16777216 4 Y 0 31 8
-def @arg27 253 16777216 10 Y 128 31 63
-def @arg28 253 16777216 10 Y 0 31 8
-def @arg29 253 16777216 8 Y 128 31 63
-def @arg30 253 16777216 8 Y 0 31 8
-def @arg31 253 16777216 3 Y 0 31 8
-def @arg32 253 16777216 6 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 1 Y 32896 0 63
+def @arg03 8 20 1 Y 32896 0 63
+def @arg04 8 20 1 Y 32896 0 63
+def @arg05 8 20 1 Y 32896 0 63
+def @arg06 8 20 1 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 8 Y 128 31 63
+def @arg17 8 20 4 Y 32928 0 63
+def @arg18 8 20 1 Y 32896 0 63
+def @arg19 8 20 1 Y 32896 0 63
+def @arg20 251 16777216 1 Y 0 31 8
+def @arg21 251 16777216 10 Y 0 31 8
+def @arg22 251 16777216 30 Y 0 31 8
+def @arg23 251 16777216 8 Y 128 31 63
+def @arg24 251 16777216 8 Y 0 31 8
+def @arg25 251 16777216 4 Y 128 31 63
+def @arg26 251 16777216 4 Y 0 31 8
+def @arg27 251 16777216 10 Y 128 31 63
+def @arg28 251 16777216 10 Y 0 31 8
+def @arg29 251 16777216 8 Y 128 31 63
+def @arg30 251 16777216 8 Y 0 31 8
+def @arg31 251 16777216 3 Y 0 31 8
+def @arg32 251 16777216 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
execute stmt1 using @my_key ;
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 0 Y 128 0 63
-def @arg03 253 20 0 Y 128 0 63
-def @arg04 253 20 0 Y 128 0 63
-def @arg05 253 20 0 Y 128 0 63
-def @arg06 253 20 0 Y 128 0 63
-def @arg07 253 23 0 Y 128 31 63
-def @arg08 253 23 0 Y 128 31 63
-def @arg09 253 23 0 Y 128 31 63
-def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
-def @arg13 253 16777216 0 Y 128 31 63
-def @arg14 253 16777216 0 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 0 Y 128 31 63
-def @arg17 253 20 0 Y 128 0 63
-def @arg18 253 20 0 Y 128 0 63
-def @arg19 253 20 0 Y 128 0 63
-def @arg20 253 16777216 0 Y 0 31 8
-def @arg21 253 16777216 0 Y 0 31 8
-def @arg22 253 16777216 0 Y 0 31 8
-def @arg23 253 16777216 0 Y 128 31 63
-def @arg24 253 16777216 0 Y 0 31 8
-def @arg25 253 16777216 0 Y 128 31 63
-def @arg26 253 16777216 0 Y 0 31 8
-def @arg27 253 16777216 0 Y 128 31 63
-def @arg28 253 16777216 0 Y 0 31 8
-def @arg29 253 16777216 0 Y 128 31 63
-def @arg30 253 16777216 0 Y 0 31 8
-def @arg31 253 16777216 0 Y 0 31 8
-def @arg32 253 16777216 0 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 0 Y 32896 0 63
+def @arg03 8 20 0 Y 32896 0 63
+def @arg04 8 20 0 Y 32896 0 63
+def @arg05 8 20 0 Y 32896 0 63
+def @arg06 8 20 0 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 0 Y 128 31 63
+def @arg17 8 20 0 Y 32928 0 63
+def @arg18 8 20 0 Y 32896 0 63
+def @arg19 8 20 0 Y 32896 0 63
+def @arg20 251 16777216 0 Y 0 31 8
+def @arg21 251 16777216 0 Y 0 31 8
+def @arg22 251 16777216 0 Y 0 31 8
+def @arg23 251 16777216 0 Y 128 31 63
+def @arg24 251 16777216 0 Y 0 31 8
+def @arg25 251 16777216 0 Y 128 31 63
+def @arg26 251 16777216 0 Y 0 31 8
+def @arg27 251 16777216 0 Y 128 31 63
+def @arg28 251 16777216 0 Y 0 31 8
+def @arg29 251 16777216 0 Y 128 31 63
+def @arg30 251 16777216 0 Y 0 31 8
+def @arg31 251 16777216 0 Y 0 31 8
+def @arg32 251 16777216 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1 into ? from t9 where c1= 1" ;
@@ -4222,7 +4222,7 @@ def table 253 64 2 Y 0 31 8
def type 253 10 3 Y 0 31 8
def possible_keys 253 4096 0 Y 0 31 8
def key 253 64 0 Y 0 31 8
-def key_len 253 4096 0 Y 128 31 63
+def key_len 253 1365 0 Y 0 31 8
def ref 253 1024 0 Y 0 31 8
def rows 8 10 1 Y 32928 0 63
def Extra 253 255 0 N 1 31 8
@@ -4858,38 +4858,38 @@ from t9 where c1= 1 ;
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 1 Y 128 0 63
-def @arg03 253 20 1 Y 128 0 63
-def @arg04 253 20 1 Y 128 0 63
-def @arg05 253 20 1 Y 128 0 63
-def @arg06 253 20 1 Y 128 0 63
-def @arg07 253 23 1 Y 128 31 63
-def @arg08 253 23 1 Y 128 31 63
-def @arg09 253 23 1 Y 128 31 63
-def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
-def @arg13 253 16777216 10 Y 128 31 63
-def @arg14 253 16777216 19 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 8 Y 128 31 63
-def @arg17 253 20 4 Y 128 0 63
-def @arg18 253 20 1 Y 128 0 63
-def @arg19 253 20 1 Y 128 0 63
-def @arg20 253 16777216 1 Y 0 31 8
-def @arg21 253 16777216 10 Y 0 31 8
-def @arg22 253 16777216 30 Y 0 31 8
-def @arg23 253 16777216 8 Y 128 31 63
-def @arg24 253 16777216 8 Y 0 31 8
-def @arg25 253 16777216 4 Y 128 31 63
-def @arg26 253 16777216 4 Y 0 31 8
-def @arg27 253 16777216 10 Y 128 31 63
-def @arg28 253 16777216 10 Y 0 31 8
-def @arg29 253 16777216 8 Y 128 31 63
-def @arg30 253 16777216 8 Y 0 31 8
-def @arg31 253 16777216 3 Y 0 31 8
-def @arg32 253 16777216 6 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 1 Y 32896 0 63
+def @arg03 8 20 1 Y 32896 0 63
+def @arg04 8 20 1 Y 32896 0 63
+def @arg05 8 20 1 Y 32896 0 63
+def @arg06 8 20 1 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 8 Y 128 31 63
+def @arg17 8 20 4 Y 32928 0 63
+def @arg18 8 20 1 Y 32896 0 63
+def @arg19 8 20 1 Y 32896 0 63
+def @arg20 251 16777216 1 Y 0 31 8
+def @arg21 251 16777216 10 Y 0 31 8
+def @arg22 251 16777216 30 Y 0 31 8
+def @arg23 251 16777216 8 Y 128 31 63
+def @arg24 251 16777216 8 Y 0 31 8
+def @arg25 251 16777216 4 Y 128 31 63
+def @arg26 251 16777216 4 Y 0 31 8
+def @arg27 251 16777216 10 Y 128 31 63
+def @arg28 251 16777216 10 Y 0 31 8
+def @arg29 251 16777216 8 Y 128 31 63
+def @arg30 251 16777216 8 Y 0 31 8
+def @arg31 251 16777216 3 Y 0 31 8
+def @arg32 251 16777216 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
@@ -4905,38 +4905,38 @@ from t9 where c1= 0 ;
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 0 Y 128 0 63
-def @arg03 253 20 0 Y 128 0 63
-def @arg04 253 20 0 Y 128 0 63
-def @arg05 253 20 0 Y 128 0 63
-def @arg06 253 20 0 Y 128 0 63
-def @arg07 253 23 0 Y 128 31 63
-def @arg08 253 23 0 Y 128 31 63
-def @arg09 253 23 0 Y 128 31 63
-def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
-def @arg13 253 16777216 0 Y 128 31 63
-def @arg14 253 16777216 0 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 0 Y 128 31 63
-def @arg17 253 20 0 Y 128 0 63
-def @arg18 253 20 0 Y 128 0 63
-def @arg19 253 20 0 Y 128 0 63
-def @arg20 253 16777216 0 Y 0 31 8
-def @arg21 253 16777216 0 Y 0 31 8
-def @arg22 253 16777216 0 Y 0 31 8
-def @arg23 253 16777216 0 Y 128 31 63
-def @arg24 253 16777216 0 Y 0 31 8
-def @arg25 253 16777216 0 Y 128 31 63
-def @arg26 253 16777216 0 Y 0 31 8
-def @arg27 253 16777216 0 Y 128 31 63
-def @arg28 253 16777216 0 Y 0 31 8
-def @arg29 253 16777216 0 Y 128 31 63
-def @arg30 253 16777216 0 Y 0 31 8
-def @arg31 253 16777216 0 Y 0 31 8
-def @arg32 253 16777216 0 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 0 Y 32896 0 63
+def @arg03 8 20 0 Y 32896 0 63
+def @arg04 8 20 0 Y 32896 0 63
+def @arg05 8 20 0 Y 32896 0 63
+def @arg06 8 20 0 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 0 Y 128 31 63
+def @arg17 8 20 0 Y 32928 0 63
+def @arg18 8 20 0 Y 32896 0 63
+def @arg19 8 20 0 Y 32896 0 63
+def @arg20 251 16777216 0 Y 0 31 8
+def @arg21 251 16777216 0 Y 0 31 8
+def @arg22 251 16777216 0 Y 0 31 8
+def @arg23 251 16777216 0 Y 128 31 63
+def @arg24 251 16777216 0 Y 0 31 8
+def @arg25 251 16777216 0 Y 128 31 63
+def @arg26 251 16777216 0 Y 0 31 8
+def @arg27 251 16777216 0 Y 128 31 63
+def @arg28 251 16777216 0 Y 0 31 8
+def @arg29 251 16777216 0 Y 128 31 63
+def @arg30 251 16777216 0 Y 0 31 8
+def @arg31 251 16777216 0 Y 0 31 8
+def @arg32 251 16777216 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select
@@ -4955,38 +4955,38 @@ execute stmt1 using @my_key ;
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 1 Y 128 0 63
-def @arg03 253 20 1 Y 128 0 63
-def @arg04 253 20 1 Y 128 0 63
-def @arg05 253 20 1 Y 128 0 63
-def @arg06 253 20 1 Y 128 0 63
-def @arg07 253 23 1 Y 128 31 63
-def @arg08 253 23 1 Y 128 31 63
-def @arg09 253 23 1 Y 128 31 63
-def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
-def @arg13 253 16777216 10 Y 128 31 63
-def @arg14 253 16777216 19 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 8 Y 128 31 63
-def @arg17 253 20 4 Y 128 0 63
-def @arg18 253 20 1 Y 128 0 63
-def @arg19 253 20 1 Y 128 0 63
-def @arg20 253 16777216 1 Y 0 31 8
-def @arg21 253 16777216 10 Y 0 31 8
-def @arg22 253 16777216 30 Y 0 31 8
-def @arg23 253 16777216 8 Y 128 31 63
-def @arg24 253 16777216 8 Y 0 31 8
-def @arg25 253 16777216 4 Y 128 31 63
-def @arg26 253 16777216 4 Y 0 31 8
-def @arg27 253 16777216 10 Y 128 31 63
-def @arg28 253 16777216 10 Y 0 31 8
-def @arg29 253 16777216 8 Y 128 31 63
-def @arg30 253 16777216 8 Y 0 31 8
-def @arg31 253 16777216 3 Y 0 31 8
-def @arg32 253 16777216 6 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 1 Y 32896 0 63
+def @arg03 8 20 1 Y 32896 0 63
+def @arg04 8 20 1 Y 32896 0 63
+def @arg05 8 20 1 Y 32896 0 63
+def @arg06 8 20 1 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 8 Y 128 31 63
+def @arg17 8 20 4 Y 32928 0 63
+def @arg18 8 20 1 Y 32896 0 63
+def @arg19 8 20 1 Y 32896 0 63
+def @arg20 251 16777216 1 Y 0 31 8
+def @arg21 251 16777216 10 Y 0 31 8
+def @arg22 251 16777216 30 Y 0 31 8
+def @arg23 251 16777216 8 Y 128 31 63
+def @arg24 251 16777216 8 Y 0 31 8
+def @arg25 251 16777216 4 Y 128 31 63
+def @arg26 251 16777216 4 Y 0 31 8
+def @arg27 251 16777216 10 Y 128 31 63
+def @arg28 251 16777216 10 Y 0 31 8
+def @arg29 251 16777216 8 Y 128 31 63
+def @arg30 251 16777216 8 Y 0 31 8
+def @arg31 251 16777216 3 Y 0 31 8
+def @arg32 251 16777216 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
@@ -4995,38 +4995,38 @@ execute stmt1 using @my_key ;
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 0 Y 128 0 63
-def @arg03 253 20 0 Y 128 0 63
-def @arg04 253 20 0 Y 128 0 63
-def @arg05 253 20 0 Y 128 0 63
-def @arg06 253 20 0 Y 128 0 63
-def @arg07 253 23 0 Y 128 31 63
-def @arg08 253 23 0 Y 128 31 63
-def @arg09 253 23 0 Y 128 31 63
-def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
-def @arg13 253 16777216 0 Y 128 31 63
-def @arg14 253 16777216 0 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 0 Y 128 31 63
-def @arg17 253 20 0 Y 128 0 63
-def @arg18 253 20 0 Y 128 0 63
-def @arg19 253 20 0 Y 128 0 63
-def @arg20 253 16777216 0 Y 0 31 8
-def @arg21 253 16777216 0 Y 0 31 8
-def @arg22 253 16777216 0 Y 0 31 8
-def @arg23 253 16777216 0 Y 128 31 63
-def @arg24 253 16777216 0 Y 0 31 8
-def @arg25 253 16777216 0 Y 128 31 63
-def @arg26 253 16777216 0 Y 0 31 8
-def @arg27 253 16777216 0 Y 128 31 63
-def @arg28 253 16777216 0 Y 0 31 8
-def @arg29 253 16777216 0 Y 128 31 63
-def @arg30 253 16777216 0 Y 0 31 8
-def @arg31 253 16777216 0 Y 0 31 8
-def @arg32 253 16777216 0 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 0 Y 32896 0 63
+def @arg03 8 20 0 Y 32896 0 63
+def @arg04 8 20 0 Y 32896 0 63
+def @arg05 8 20 0 Y 32896 0 63
+def @arg06 8 20 0 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 0 Y 128 31 63
+def @arg17 8 20 0 Y 32928 0 63
+def @arg18 8 20 0 Y 32896 0 63
+def @arg19 8 20 0 Y 32896 0 63
+def @arg20 251 16777216 0 Y 0 31 8
+def @arg21 251 16777216 0 Y 0 31 8
+def @arg22 251 16777216 0 Y 0 31 8
+def @arg23 251 16777216 0 Y 128 31 63
+def @arg24 251 16777216 0 Y 0 31 8
+def @arg25 251 16777216 0 Y 128 31 63
+def @arg26 251 16777216 0 Y 0 31 8
+def @arg27 251 16777216 0 Y 128 31 63
+def @arg28 251 16777216 0 Y 0 31 8
+def @arg29 251 16777216 0 Y 128 31 63
+def @arg30 251 16777216 0 Y 0 31 8
+def @arg31 251 16777216 0 Y 0 31 8
+def @arg32 251 16777216 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select ? := c1 from t9 where c1= 1" ;
@@ -5043,38 +5043,38 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
from t9 where c1= 1 ;
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 1 Y 128 0 63
-def @arg03 253 20 1 Y 128 0 63
-def @arg04 253 20 1 Y 128 0 63
-def @arg05 253 20 1 Y 128 0 63
-def @arg06 253 20 1 Y 128 0 63
-def @arg07 253 23 1 Y 128 31 63
-def @arg08 253 23 1 Y 128 31 63
-def @arg09 253 23 1 Y 128 31 63
-def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
-def @arg13 253 16777216 10 Y 128 31 63
-def @arg14 253 16777216 19 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 8 Y 128 31 63
-def @arg17 253 20 4 Y 128 0 63
-def @arg18 253 20 1 Y 128 0 63
-def @arg19 253 20 1 Y 128 0 63
-def @arg20 253 16777216 1 Y 0 31 8
-def @arg21 253 16777216 10 Y 0 31 8
-def @arg22 253 16777216 30 Y 0 31 8
-def @arg23 253 16777216 8 Y 128 31 63
-def @arg24 253 16777216 8 Y 0 31 8
-def @arg25 253 16777216 4 Y 128 31 63
-def @arg26 253 16777216 4 Y 0 31 8
-def @arg27 253 16777216 10 Y 128 31 63
-def @arg28 253 16777216 10 Y 0 31 8
-def @arg29 253 16777216 8 Y 128 31 63
-def @arg30 253 16777216 8 Y 0 31 8
-def @arg31 253 16777216 3 Y 0 31 8
-def @arg32 253 16777216 6 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 1 Y 32896 0 63
+def @arg03 8 20 1 Y 32896 0 63
+def @arg04 8 20 1 Y 32896 0 63
+def @arg05 8 20 1 Y 32896 0 63
+def @arg06 8 20 1 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 8 Y 128 31 63
+def @arg17 8 20 4 Y 32928 0 63
+def @arg18 8 20 1 Y 32896 0 63
+def @arg19 8 20 1 Y 32896 0 63
+def @arg20 251 16777216 1 Y 0 31 8
+def @arg21 251 16777216 10 Y 0 31 8
+def @arg22 251 16777216 30 Y 0 31 8
+def @arg23 251 16777216 8 Y 128 31 63
+def @arg24 251 16777216 8 Y 0 31 8
+def @arg25 251 16777216 4 Y 128 31 63
+def @arg26 251 16777216 4 Y 0 31 8
+def @arg27 251 16777216 10 Y 128 31 63
+def @arg28 251 16777216 10 Y 0 31 8
+def @arg29 251 16777216 8 Y 128 31 63
+def @arg30 251 16777216 8 Y 0 31 8
+def @arg31 251 16777216 3 Y 0 31 8
+def @arg32 251 16777216 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -5087,38 +5087,38 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
from t9 where c1= 0 ;
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 0 Y 128 0 63
-def @arg03 253 20 0 Y 128 0 63
-def @arg04 253 20 0 Y 128 0 63
-def @arg05 253 20 0 Y 128 0 63
-def @arg06 253 20 0 Y 128 0 63
-def @arg07 253 23 0 Y 128 31 63
-def @arg08 253 23 0 Y 128 31 63
-def @arg09 253 23 0 Y 128 31 63
-def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
-def @arg13 253 16777216 0 Y 128 31 63
-def @arg14 253 16777216 0 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 0 Y 128 31 63
-def @arg17 253 20 0 Y 128 0 63
-def @arg18 253 20 0 Y 128 0 63
-def @arg19 253 20 0 Y 128 0 63
-def @arg20 253 16777216 0 Y 0 31 8
-def @arg21 253 16777216 0 Y 0 31 8
-def @arg22 253 16777216 0 Y 0 31 8
-def @arg23 253 16777216 0 Y 128 31 63
-def @arg24 253 16777216 0 Y 0 31 8
-def @arg25 253 16777216 0 Y 128 31 63
-def @arg26 253 16777216 0 Y 0 31 8
-def @arg27 253 16777216 0 Y 128 31 63
-def @arg28 253 16777216 0 Y 0 31 8
-def @arg29 253 16777216 0 Y 128 31 63
-def @arg30 253 16777216 0 Y 0 31 8
-def @arg31 253 16777216 0 Y 0 31 8
-def @arg32 253 16777216 0 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 0 Y 32896 0 63
+def @arg03 8 20 0 Y 32896 0 63
+def @arg04 8 20 0 Y 32896 0 63
+def @arg05 8 20 0 Y 32896 0 63
+def @arg06 8 20 0 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 0 Y 128 31 63
+def @arg17 8 20 0 Y 32928 0 63
+def @arg18 8 20 0 Y 32896 0 63
+def @arg19 8 20 0 Y 32896 0 63
+def @arg20 251 16777216 0 Y 0 31 8
+def @arg21 251 16777216 0 Y 0 31 8
+def @arg22 251 16777216 0 Y 0 31 8
+def @arg23 251 16777216 0 Y 128 31 63
+def @arg24 251 16777216 0 Y 0 31 8
+def @arg25 251 16777216 0 Y 128 31 63
+def @arg26 251 16777216 0 Y 0 31 8
+def @arg27 251 16777216 0 Y 128 31 63
+def @arg28 251 16777216 0 Y 0 31 8
+def @arg29 251 16777216 0 Y 128 31 63
+def @arg30 251 16777216 0 Y 0 31 8
+def @arg31 251 16777216 0 Y 0 31 8
+def @arg32 251 16777216 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -5133,76 +5133,76 @@ set @my_key= 1 ;
execute stmt1 using @my_key ;
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 1 Y 128 0 63
-def @arg03 253 20 1 Y 128 0 63
-def @arg04 253 20 1 Y 128 0 63
-def @arg05 253 20 1 Y 128 0 63
-def @arg06 253 20 1 Y 128 0 63
-def @arg07 253 23 1 Y 128 31 63
-def @arg08 253 23 1 Y 128 31 63
-def @arg09 253 23 1 Y 128 31 63
-def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
-def @arg13 253 16777216 10 Y 128 31 63
-def @arg14 253 16777216 19 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 8 Y 128 31 63
-def @arg17 253 20 4 Y 128 0 63
-def @arg18 253 20 1 Y 128 0 63
-def @arg19 253 20 1 Y 128 0 63
-def @arg20 253 16777216 1 Y 0 31 8
-def @arg21 253 16777216 10 Y 0 31 8
-def @arg22 253 16777216 30 Y 0 31 8
-def @arg23 253 16777216 8 Y 128 31 63
-def @arg24 253 16777216 8 Y 0 31 8
-def @arg25 253 16777216 4 Y 128 31 63
-def @arg26 253 16777216 4 Y 0 31 8
-def @arg27 253 16777216 10 Y 128 31 63
-def @arg28 253 16777216 10 Y 0 31 8
-def @arg29 253 16777216 8 Y 128 31 63
-def @arg30 253 16777216 8 Y 0 31 8
-def @arg31 253 16777216 3 Y 0 31 8
-def @arg32 253 16777216 6 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 1 Y 32896 0 63
+def @arg03 8 20 1 Y 32896 0 63
+def @arg04 8 20 1 Y 32896 0 63
+def @arg05 8 20 1 Y 32896 0 63
+def @arg06 8 20 1 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 8 Y 128 31 63
+def @arg17 8 20 4 Y 32928 0 63
+def @arg18 8 20 1 Y 32896 0 63
+def @arg19 8 20 1 Y 32896 0 63
+def @arg20 251 16777216 1 Y 0 31 8
+def @arg21 251 16777216 10 Y 0 31 8
+def @arg22 251 16777216 30 Y 0 31 8
+def @arg23 251 16777216 8 Y 128 31 63
+def @arg24 251 16777216 8 Y 0 31 8
+def @arg25 251 16777216 4 Y 128 31 63
+def @arg26 251 16777216 4 Y 0 31 8
+def @arg27 251 16777216 10 Y 128 31 63
+def @arg28 251 16777216 10 Y 0 31 8
+def @arg29 251 16777216 8 Y 128 31 63
+def @arg30 251 16777216 8 Y 0 31 8
+def @arg31 251 16777216 3 Y 0 31 8
+def @arg32 251 16777216 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
execute stmt1 using @my_key ;
execute full_info ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 0 Y 128 0 63
-def @arg03 253 20 0 Y 128 0 63
-def @arg04 253 20 0 Y 128 0 63
-def @arg05 253 20 0 Y 128 0 63
-def @arg06 253 20 0 Y 128 0 63
-def @arg07 253 23 0 Y 128 31 63
-def @arg08 253 23 0 Y 128 31 63
-def @arg09 253 23 0 Y 128 31 63
-def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
-def @arg13 253 16777216 0 Y 128 31 63
-def @arg14 253 16777216 0 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 0 Y 128 31 63
-def @arg17 253 20 0 Y 128 0 63
-def @arg18 253 20 0 Y 128 0 63
-def @arg19 253 20 0 Y 128 0 63
-def @arg20 253 16777216 0 Y 0 31 8
-def @arg21 253 16777216 0 Y 0 31 8
-def @arg22 253 16777216 0 Y 0 31 8
-def @arg23 253 16777216 0 Y 128 31 63
-def @arg24 253 16777216 0 Y 0 31 8
-def @arg25 253 16777216 0 Y 128 31 63
-def @arg26 253 16777216 0 Y 0 31 8
-def @arg27 253 16777216 0 Y 128 31 63
-def @arg28 253 16777216 0 Y 0 31 8
-def @arg29 253 16777216 0 Y 128 31 63
-def @arg30 253 16777216 0 Y 0 31 8
-def @arg31 253 16777216 0 Y 0 31 8
-def @arg32 253 16777216 0 Y 0 31 8
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 0 Y 32896 0 63
+def @arg03 8 20 0 Y 32896 0 63
+def @arg04 8 20 0 Y 32896 0 63
+def @arg05 8 20 0 Y 32896 0 63
+def @arg06 8 20 0 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 0 Y 128 31 63
+def @arg17 8 20 0 Y 32928 0 63
+def @arg18 8 20 0 Y 32896 0 63
+def @arg19 8 20 0 Y 32896 0 63
+def @arg20 251 16777216 0 Y 0 31 8
+def @arg21 251 16777216 0 Y 0 31 8
+def @arg22 251 16777216 0 Y 0 31 8
+def @arg23 251 16777216 0 Y 128 31 63
+def @arg24 251 16777216 0 Y 0 31 8
+def @arg25 251 16777216 0 Y 128 31 63
+def @arg26 251 16777216 0 Y 0 31 8
+def @arg27 251 16777216 0 Y 128 31 63
+def @arg28 251 16777216 0 Y 0 31 8
+def @arg29 251 16777216 0 Y 128 31 63
+def @arg30 251 16777216 0 Y 0 31 8
+def @arg31 251 16777216 0 Y 0 31 8
+def @arg32 251 16777216 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1 into ? from t9 where c1= 1" ;
diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result
deleted file mode 100644
index 2cffb698fc0..00000000000
--- a/mysql-test/r/ps_7ndb.result
+++ /dev/null
@@ -1,3127 +0,0 @@
-use test;
-drop table if exists t1, t9 ;
-create table t1
-(
-a int, b varchar(30),
-primary key(a)
-) engine = 'NDB' ;
-create table t9
-(
-c1 tinyint, c2 smallint, c3 mediumint, c4 int,
-c5 integer, c6 bigint, c7 float, c8 double,
-c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
-c13 date, c14 datetime, c15 timestamp, c16 time,
-c17 year, c18 tinyint, c19 bool, c20 char,
-c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
-c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
-c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'),
-c32 set('monday', 'tuesday', 'wednesday'),
-primary key(c1)
-) engine = 'NDB' ;
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-test_sequence
------- simple select tests ------
-prepare stmt1 from ' select * from t9 order by c1 ' ;
-execute stmt1;
-Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def test t9 t9 c1 c1 1 4 1 N 49155 0 63
-def test t9 t9 c2 c2 2 6 1 Y 32768 0 63
-def test t9 t9 c3 c3 9 9 1 Y 32768 0 63
-def test t9 t9 c4 c4 3 11 1 Y 32768 0 63
-def test t9 t9 c5 c5 3 11 1 Y 32768 0 63
-def test t9 t9 c6 c6 8 20 1 Y 32768 0 63
-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 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 1249 0 63
-def test t9 t9 c16 c16 11 8 8 Y 128 0 63
-def test t9 t9 c17 c17 13 4 4 Y 32864 0 63
-def test t9 t9 c18 c18 1 4 1 Y 32768 0 63
-def test t9 t9 c19 c19 1 1 1 Y 32768 0 63
-def test t9 t9 c20 c20 254 1 1 Y 0 0 8
-def test t9 t9 c21 c21 254 10 10 Y 0 0 8
-def test t9 t9 c22 c22 253 30 30 Y 0 0 8
-def test t9 t9 c23 c23 252 255 8 Y 144 0 63
-def test t9 t9 c24 c24 252 255 8 Y 16 0 8
-def test t9 t9 c25 c25 252 65535 4 Y 144 0 63
-def test t9 t9 c26 c26 252 65535 4 Y 16 0 8
-def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63
-def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8
-def test t9 t9 c29 c29 252 4294967295 8 Y 144 0 63
-def test t9 t9 c30 c30 252 4294967295 8 Y 16 0 8
-def test t9 t9 c31 c31 254 5 3 Y 256 0 8
-def test t9 t9 c32 c32 254 24 7 Y 2048 0 8
-c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
-set @arg00='SELECT' ;
-@arg00 a from t1 where a=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 '@arg00 a from t1 where a=1' at line 1
-prepare stmt1 from ' ? a from t1 where a=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 '? a from t1 where a=1' at line 1
-set @arg00=1 ;
-select @arg00, b from t1 where a=1 ;
-@arg00 b
-1 one
-prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-? b
-1 one
-set @arg00='lion' ;
-select @arg00, b from t1 where a=1 ;
-@arg00 b
-lion one
-prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-? b
-lion one
-set @arg00=NULL ;
-select @arg00, b from t1 where a=1 ;
-@arg00 b
-NULL one
-prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-? b
-NULL one
-set @arg00=1 ;
-select b, a - @arg00 from t1 where a=1 ;
-b a - @arg00
-one 0
-prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-b a - ?
-one 0
-set @arg00=null ;
-select @arg00 as my_col ;
-my_col
-NULL
-prepare stmt1 from ' select ? as my_col';
-execute stmt1 using @arg00 ;
-my_col
-NULL
-select @arg00 + 1 as my_col ;
-my_col
-NULL
-prepare stmt1 from ' select ? + 1 as my_col';
-execute stmt1 using @arg00 ;
-my_col
-NULL
-select 1 + @arg00 as my_col ;
-my_col
-NULL
-prepare stmt1 from ' select 1 + ? as my_col';
-execute stmt1 using @arg00 ;
-my_col
-NULL
-set @arg00='MySQL' ;
-select substr(@arg00,1,2) from t1 where a=1 ;
-substr(@arg00,1,2)
-My
-prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-substr(?,1,2)
-My
-set @arg00=3 ;
-select substr('MySQL',@arg00,5) from t1 where a=1 ;
-substr('MySQL',@arg00,5)
-SQL
-prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-substr('MySQL',?,5)
-SQL
-select substr('MySQL',1,@arg00) from t1 where a=1 ;
-substr('MySQL',1,@arg00)
-MyS
-prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ;
-execute stmt1 using @arg00 ;
-substr('MySQL',1,?)
-MyS
-set @arg00='MySQL' ;
-select a , concat(@arg00,b) from t1 order by a;
-a concat(@arg00,b)
-1 MySQLone
-2 MySQLtwo
-3 MySQLthree
-4 MySQLfour
-prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ;
-execute stmt1 using @arg00;
-a concat(?,b)
-1 MySQLone
-2 MySQLtwo
-3 MySQLthree
-4 MySQLfour
-select a , concat(b,@arg00) from t1 order by a ;
-a concat(b,@arg00)
-1 oneMySQL
-2 twoMySQL
-3 threeMySQL
-4 fourMySQL
-prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ;
-execute stmt1 using @arg00;
-a concat(b,?)
-1 oneMySQL
-2 twoMySQL
-3 threeMySQL
-4 fourMySQL
-set @arg00='MySQL' ;
-select group_concat(@arg00,b order by a) from t1
-group by 'a' ;
-group_concat(@arg00,b order by a)
-MySQLone,MySQLtwo,MySQLthree,MySQLfour
-prepare stmt1 from ' select group_concat(?,b order by a) from t1
-group by ''a'' ' ;
-execute stmt1 using @arg00;
-group_concat(?,b order by a)
-MySQLone,MySQLtwo,MySQLthree,MySQLfour
-select group_concat(b,@arg00 order by a) from t1
-group by 'a' ;
-group_concat(b,@arg00 order by a)
-oneMySQL,twoMySQL,threeMySQL,fourMySQL
-prepare stmt1 from ' select group_concat(b,? order by a) from t1
-group by ''a'' ' ;
-execute stmt1 using @arg00;
-group_concat(b,? order by a)
-oneMySQL,twoMySQL,threeMySQL,fourMySQL
-set @arg00='first' ;
-set @arg01='second' ;
-set @arg02=NULL;
-select @arg00, @arg01 from t1 where a=1 ;
-@arg00 @arg01
-first second
-prepare stmt1 from ' select ?, ? from t1 where a=1 ' ;
-execute stmt1 using @arg00, @arg01 ;
-? ?
-first second
-execute stmt1 using @arg02, @arg01 ;
-? ?
-NULL second
-execute stmt1 using @arg00, @arg02 ;
-? ?
-first NULL
-execute stmt1 using @arg02, @arg02 ;
-? ?
-NULL NULL
-drop table if exists t5 ;
-create table t5 (id1 int(11) not null default '0',
-value2 varchar(100), value1 varchar(100)) ;
-insert into t5 values (1,'hh','hh'),(2,'hh','hh'),
-(1,'ii','ii'),(2,'ii','ii') ;
-prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ;
-set @arg00=1 ;
-set @arg01='hh' ;
-execute stmt1 using @arg00, @arg01 ;
-id1 value1
-1 hh
-1 ii
-2 hh
-drop table t5 ;
-drop table if exists t5 ;
-create table t5(session_id char(9) not null) ;
-insert into t5 values ('abc') ;
-prepare stmt1 from ' select * from t5
-where ?=''1111'' and session_id = ''abc'' ' ;
-set @arg00='abc' ;
-execute stmt1 using @arg00 ;
-session_id
-set @arg00='1111' ;
-execute stmt1 using @arg00 ;
-session_id
-abc
-set @arg00='abc' ;
-execute stmt1 using @arg00 ;
-session_id
-drop table t5 ;
-set @arg00='FROM' ;
-select a @arg00 t1 where a=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 '@arg00 t1 where a=1' at line 1
-prepare stmt1 from ' select a ? t1 where a=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 '? t1 where a=1' at line 1
-set @arg00='t1' ;
-select a from @arg00 where a=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 '@arg00 where a=1' at line 1
-prepare stmt1 from ' select a from ? where a=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 '? where a=1' at line 1
-set @arg00='WHERE' ;
-select a from t1 @arg00 a=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 '@arg00 a=1' at line 1
-prepare stmt1 from ' select a from t1 ? a=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 '? a=1' at line 1
-set @arg00=1 ;
-select a FROM t1 where a=@arg00 ;
-a
-1
-prepare stmt1 from ' select a FROM t1 where a=? ' ;
-execute stmt1 using @arg00 ;
-a
-1
-set @arg00=1000 ;
-execute stmt1 using @arg00 ;
-a
-set @arg00=NULL ;
-select a FROM t1 where a=@arg00 ;
-a
-prepare stmt1 from ' select a FROM t1 where a=? ' ;
-execute stmt1 using @arg00 ;
-a
-set @arg00=4 ;
-select a FROM t1 where a=sqrt(@arg00) ;
-a
-2
-prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ;
-execute stmt1 using @arg00 ;
-a
-2
-set @arg00=NULL ;
-select a FROM t1 where a=sqrt(@arg00) ;
-a
-prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ;
-execute stmt1 using @arg00 ;
-a
-set @arg00=2 ;
-set @arg01=3 ;
-select a FROM t1 where a in (@arg00,@arg01) order by a;
-a
-2
-3
-prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a ';
-execute stmt1 using @arg00, @arg01;
-a
-2
-3
-set @arg00= 'one' ;
-set @arg01= 'two' ;
-set @arg02= 'five' ;
-prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ;
-execute stmt1 using @arg00, @arg01, @arg02 ;
-b
-one
-two
-prepare stmt1 from ' select b FROM t1 where b like ? ';
-set @arg00='two' ;
-execute stmt1 using @arg00 ;
-b
-two
-set @arg00='tw%' ;
-execute stmt1 using @arg00 ;
-b
-two
-set @arg00='%wo' ;
-execute stmt1 using @arg00 ;
-b
-two
-set @arg00=null ;
-insert into t9 set c1= 0, c5 = NULL ;
-select c5 from t9 where c5 > NULL ;
-c5
-prepare stmt1 from ' select c5 from t9 where c5 > ? ';
-execute stmt1 using @arg00 ;
-c5
-select c5 from t9 where c5 < NULL ;
-c5
-prepare stmt1 from ' select c5 from t9 where c5 < ? ';
-execute stmt1 using @arg00 ;
-c5
-select c5 from t9 where c5 = NULL ;
-c5
-prepare stmt1 from ' select c5 from t9 where c5 = ? ';
-execute stmt1 using @arg00 ;
-c5
-select c5 from t9 where c5 <=> NULL ;
-c5
-NULL
-prepare stmt1 from ' select c5 from t9 where c5 <=> ? ';
-execute stmt1 using @arg00 ;
-c5
-NULL
-delete from t9 where c1= 0 ;
-set @arg00='>' ;
-select a FROM t1 where a @arg00 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 '@arg00 1' at line 1
-prepare stmt1 from ' select a FROM t1 where a ? 1 ' ;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? 1' at line 1
-set @arg00=1 ;
-select a,b FROM t1 where a is not NULL
-AND b is not NULL group by a - @arg00 ;
-a b
-1 one
-2 two
-3 three
-4 four
-prepare stmt1 from ' select a,b FROM t1 where a is not NULL
-AND b is not NULL group by a - ? ' ;
-execute stmt1 using @arg00 ;
-a b
-1 one
-2 two
-3 three
-4 four
-set @arg00='two' ;
-select a,b FROM t1 where a is not NULL
-AND b is not NULL having b <> @arg00 order by a ;
-a b
-1 one
-3 three
-4 four
-prepare stmt1 from ' select a,b FROM t1 where a is not NULL
-AND b is not NULL having b <> ? order by a ' ;
-execute stmt1 using @arg00 ;
-a b
-1 one
-3 three
-4 four
-set @arg00=1 ;
-select a,b FROM t1 where a is not NULL
-AND b is not NULL order by a - @arg00 ;
-a b
-1 one
-2 two
-3 three
-4 four
-prepare stmt1 from ' select a,b FROM t1 where a is not NULL
-AND b is not NULL order by a - ? ' ;
-execute stmt1 using @arg00 ;
-a b
-1 one
-2 two
-3 three
-4 four
-set @arg00=2 ;
-select a,b from t1 order by 2 ;
-a b
-4 four
-1 one
-3 three
-2 two
-prepare stmt1 from ' select a,b from t1
-order by ? ';
-execute stmt1 using @arg00;
-a b
-4 four
-1 one
-3 three
-2 two
-set @arg00=1 ;
-execute stmt1 using @arg00;
-a b
-1 one
-2 two
-3 three
-4 four
-set @arg00=0 ;
-execute stmt1 using @arg00;
-ERROR 42S22: Unknown column '?' in 'order clause'
-set @arg00=1;
-prepare stmt1 from ' select a,b from t1 order by a
-limit 1 ';
-execute stmt1 ;
-a b
-1 one
-prepare stmt1 from ' select a,b from t1 order by a limit ? ';
-execute stmt1 using @arg00;
-a b
-1 one
-set @arg00='b' ;
-set @arg01=0 ;
-set @arg02=2 ;
-set @arg03=2 ;
-select sum(a), @arg00 from t1 where a > @arg01
-and b is not null group by substr(b,@arg02)
-having sum(a) <> @arg03 ;
-sum(a) @arg00
-3 b
-1 b
-4 b
-prepare stmt1 from ' select sum(a), ? from t1 where a > ?
-and b is not null group by substr(b,?)
-having sum(a) <> ? ';
-execute stmt1 using @arg00, @arg01, @arg02, @arg03;
-sum(a) ?
-3 b
-1 b
-4 b
-test_sequence
------- join tests ------
-select first.a as a1, second.a as a2
-from t1 first, t1 second
-where first.a = second.a order by a1 ;
-a1 a2
-1 1
-2 2
-3 3
-4 4
-prepare stmt1 from ' select first.a as a1, second.a as a2
- from t1 first, t1 second
- where first.a = second.a order by a1 ';
-execute stmt1 ;
-a1 a2
-1 1
-2 2
-3 3
-4 4
-set @arg00='ABC';
-set @arg01='two';
-set @arg02='one';
-select first.a, @arg00, second.a FROM t1 first, t1 second
-where @arg01 = first.b or first.a = second.a or second.b = @arg02
-order by second.a, first.a;
-a @arg00 a
-1 ABC 1
-2 ABC 1
-3 ABC 1
-4 ABC 1
-2 ABC 2
-2 ABC 3
-3 ABC 3
-2 ABC 4
-4 ABC 4
-prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
- where ? = first.b or first.a = second.a or second.b = ?
- order by second.a, first.a';
-execute stmt1 using @arg00, @arg01, @arg02;
-a ? a
-1 ABC 1
-2 ABC 1
-3 ABC 1
-4 ABC 1
-2 ABC 2
-2 ABC 3
-3 ABC 3
-2 ABC 4
-4 ABC 4
-drop table if exists t2 ;
-create table t2 as select * from t1 ;
-set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ;
-set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ;
-set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ;
-set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ;
-set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ;
-set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ;
-set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ;
-set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ;
-set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ;
-the join statement is:
-SELECT * FROM t2 right join t1 using(a) order by t2.a
-prepare stmt1 from @query9 ;
-execute stmt1 ;
-a b b
-1 one one
-2 two two
-3 three three
-4 four four
-execute stmt1 ;
-a b b
-1 one one
-2 two two
-3 three three
-4 four four
-execute stmt1 ;
-a b b
-1 one one
-2 two two
-3 three three
-4 four four
-the join statement is:
-SELECT * FROM t2 natural right join t1 order by t2.a
-prepare stmt1 from @query8 ;
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-the join statement is:
-SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a
-prepare stmt1 from @query7 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 left join t1 using(a) order by t2.a
-prepare stmt1 from @query6 ;
-execute stmt1 ;
-a b b
-1 one one
-2 two two
-3 three three
-4 four four
-execute stmt1 ;
-a b b
-1 one one
-2 two two
-3 three three
-4 four four
-execute stmt1 ;
-a b b
-1 one one
-2 two two
-3 three three
-4 four four
-the join statement is:
-SELECT * FROM t2 natural left join t1 order by t2.a
-prepare stmt1 from @query5 ;
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-the join statement is:
-SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a
-prepare stmt1 from @query4 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-the join statement is:
-SELECT * FROM t2 join t1 using(a) order by t2.a
-prepare stmt1 from @query3 ;
-execute stmt1 ;
-a b b
-1 one one
-2 two two
-3 three three
-4 four four
-execute stmt1 ;
-a b b
-1 one one
-2 two two
-3 three three
-4 four four
-execute stmt1 ;
-a b b
-1 one one
-2 two two
-3 three three
-4 four four
-the join statement is:
-SELECT * FROM t2 natural join t1 order by t2.a
-prepare stmt1 from @query2 ;
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-the join statement is:
-SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a
-prepare stmt1 from @query1 ;
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-execute stmt1 ;
-a b a b
-1 one 1 one
-2 two 2 two
-3 three 3 three
-4 four 4 four
-drop table t2 ;
-test_sequence
------- subquery tests ------
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = ''two'') ';
-execute stmt1 ;
-a b
-2 two
-set @arg00='two' ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where b = 'two' ) and b=@arg00 ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = ''two'') and b=? ';
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00='two' ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where b = @arg00 ) and b='two' ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = ? ) and b=''two'' ' ;
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00=3 ;
-set @arg01='three' ;
-select a,b FROM t1 where (a,b) in (select 3, 'three');
-a b
-3 three
-select a FROM t1 where (a,b) in (select @arg00,@arg01);
-a
-3
-prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) ';
-execute stmt1 using @arg00, @arg01;
-a
-3
-set @arg00=1 ;
-set @arg01='two' ;
-set @arg02=2 ;
-set @arg03='two' ;
-select a, @arg00, b FROM t1 outer_table where
-b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ;
-a @arg00 b
-2 1 two
-prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
- b=? and a = (select ? from t1 where b = ? ) ' ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
-a ? b
-2 1 two
-prepare stmt1 from 'select c4 FROM t9 where
- c13 = (select MAX(b) from t1 where a = ?) and c22 = ? ' ;
-execute stmt1 using @arg01, @arg02;
-c4
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = outer_table.b ) order by a ';
-execute stmt1 ;
-a b
-1 one
-2 two
-3 three
-4 four
-prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
- (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
-execute stmt1 ;
-ccc
-1
-deallocate prepare stmt1 ;
-prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
- (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
-execute stmt1 ;
-ccc
-1
-deallocate prepare stmt1 ;
-prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
- (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
-execute stmt1 ;
-ccc
-1
-deallocate prepare stmt1 ;
-set @arg00='two' ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where b = outer_table.b ) and b=@arg00 ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where b = outer_table.b) and b=? ';
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00=2 ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ;
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00=2 ;
-select a, b FROM t1 outer_table where
-a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ;
-a b
-2 two
-prepare stmt1 from ' select a, b FROM t1 outer_table where
- a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ;
-execute stmt1 using @arg00;
-a b
-2 two
-set @arg00=1 ;
-set @arg01='two' ;
-set @arg02=2 ;
-set @arg03='two' ;
-select a, @arg00, b FROM t1 outer_table where
-b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03
-and outer_table.a=a ) ;
-a @arg00 b
-2 1 two
-prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
- b=? and a = (select ? from t1 where outer_table.b = ?
- and outer_table.a=a ) ' ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
-a ? b
-2 1 two
-set @arg00=1 ;
-set @arg01=0 ;
-select a, @arg00
-from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2
-where a=@arg01;
-a @arg00
-0 1
-prepare stmt1 from ' select a, ?
- from ( select a - ? as a from t1 where a=? ) as t2
- where a=? ';
-execute stmt1 using @arg00, @arg00, @arg00, @arg01 ;
-a ?
-0 1
-drop table if exists t2 ;
-create table t2 as select * from t1;
-prepare stmt1 from ' select a in (select a from t2) from t1 ' ;
-execute stmt1 ;
-a in (select a from t2)
-1
-1
-1
-1
-drop table if exists t5, t6, t7 ;
-create table t5 (a int , b int) ;
-create table t6 like t5 ;
-create table t7 like t5 ;
-insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7),
-(2, -1), (3, 10) ;
-insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ;
-insert into t7 values (3, 3), (2, 2), (1, 1) ;
-prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6
- where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
- group by t5.a order by sum limit 1) from t7 ' ;
-execute stmt1 ;
-a (select count(distinct t5.b) as sum from t5, t6
- where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
- group by t5.a order by sum limit 1)
-3 1
-2 2
-1 2
-execute stmt1 ;
-a (select count(distinct t5.b) as sum from t5, t6
- where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
- group by t5.a order by sum limit 1)
-3 1
-2 2
-1 2
-execute stmt1 ;
-a (select count(distinct t5.b) as sum from t5, t6
- where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
- group by t5.a order by sum limit 1)
-3 1
-2 2
-1 2
-drop table t5, t6, t7 ;
-drop table if exists t2 ;
-create table t2 as select * from t9;
-set @stmt= ' SELECT
- (SELECT SUM(c1 + c12 + 0.0) FROM t2
- where (t9.c2 - 0e-3) = t2.c2
- GROUP BY t9.c15 LIMIT 1) as scalar_s,
- exists (select 1.0e+0 from t2
- where t2.c3 * 9.0000000000 = t9.c4) as exists_s,
- c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s,
- (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s
-FROM t9,
-(select c25 x, c32 y from t2) tt WHERE x = c25 ' ;
-prepare stmt1 from @stmt ;
-execute stmt1 ;
-execute stmt1 ;
-set @stmt= concat('explain ',@stmt);
-prepare stmt1 from @stmt ;
-execute stmt1 ;
-execute stmt1 ;
-set @stmt= ' SELECT
- (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2
- GROUP BY t9.c15 LIMIT 1) as scalar_s,
- exists (select ? from t2
- where t2.c3*?=t9.c4) as exists_s,
- c5*? in (select c6+? from t2) as in_s,
- (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s
-FROM t9,
-(select c25 x, c32 y from t2) tt WHERE x =c25 ' ;
-set @arg00= 0.0 ;
-set @arg01= 0e-3 ;
-set @arg02= 1.0e+0 ;
-set @arg03= 9.0000000000 ;
-set @arg04= 4 ;
-set @arg05= 0.3e+1 ;
-set @arg06= 4 ;
-set @arg07= 4 ;
-set @arg08= 4.0 ;
-set @arg09= 40e-1 ;
-prepare stmt1 from @stmt ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
-@arg07, @arg08, @arg09 ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
-@arg07, @arg08, @arg09 ;
-set @stmt= concat('explain ',@stmt);
-prepare stmt1 from @stmt ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
-@arg07, @arg08, @arg09 ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
-@arg07, @arg08, @arg09 ;
-drop table t2 ;
-select 1 < (select a from t1) ;
-ERROR 21000: Subquery returns more than 1 row
-prepare stmt1 from ' select 1 < (select a from t1) ' ;
-execute stmt1 ;
-ERROR 21000: Subquery returns more than 1 row
-select 1 as my_col ;
-my_col
-1
-test_sequence
------- union tests ------
-prepare stmt1 from ' select a FROM t1 where a=1
- union distinct
- select a FROM t1 where a=1 ';
-execute stmt1 ;
-a
-1
-execute stmt1 ;
-a
-1
-prepare stmt1 from ' select a FROM t1 where a=1
- union all
- select a FROM t1 where a=1 ';
-execute stmt1 ;
-a
-1
-1
-prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ;
-ERROR 21000: The used SELECT statements have a different number of columns
-prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ;
-ERROR 21000: The used SELECT statements have a different number of columns
-prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ;
-ERROR 21000: The used SELECT statements have a different number of columns
-prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ;
-ERROR 21000: The used SELECT statements have a different number of columns
-set @arg00=1 ;
-select @arg00 FROM t1 where a=1
-union distinct
-select 1 FROM t1 where a=1;
-@arg00
-1
-prepare stmt1 from ' select ? FROM t1 where a=1
- union distinct
- select 1 FROM t1 where a=1 ' ;
-execute stmt1 using @arg00;
-?
-1
-set @arg00=1 ;
-select 1 FROM t1 where a=1
-union distinct
-select @arg00 FROM t1 where a=1;
-1
-1
-prepare stmt1 from ' select 1 FROM t1 where a=1
- union distinct
- select ? FROM t1 where a=1 ' ;
-execute stmt1 using @arg00;
-1
-1
-set @arg00='a' ;
-select @arg00 FROM t1 where a=1
-union distinct
-select @arg00 FROM t1 where a=1;
-@arg00
-a
-prepare stmt1 from ' select ? FROM t1 where a=1
- union distinct
- select ? FROM t1 where a=1 ';
-execute stmt1 using @arg00, @arg00;
-?
-a
-prepare stmt1 from ' select ?
- union distinct
- select ? ';
-execute stmt1 using @arg00, @arg00;
-?
-a
-set @arg00='a' ;
-set @arg01=1 ;
-set @arg02='a' ;
-set @arg03=2 ;
-select @arg00 FROM t1 where a=@arg01
-union distinct
-select @arg02 FROM t1 where a=@arg03;
-@arg00
-a
-prepare stmt1 from ' select ? FROM t1 where a=?
- union distinct
- select ? FROM t1 where a=? ' ;
-execute stmt1 using @arg00, @arg01, @arg02, @arg03;
-?
-a
-set @arg00=1 ;
-prepare stmt1 from ' select sum(a) + 200, ? from t1
-union distinct
-select sum(a) + 200, 1 from t1
-group by b ' ;
-execute stmt1 using @arg00;
-sum(a) + 200 ?
-210 1
-204 1
-201 1
-203 1
-202 1
-set @Oporto='Oporto' ;
-set @Lisboa='Lisboa' ;
-set @0=0 ;
-set @1=1 ;
-set @2=2 ;
-set @3=3 ;
-set @4=4 ;
-select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ;
-@Oporto @Lisboa @0 @1 @2 @3 @4
-Oporto Lisboa 0 1 2 3 4
-select sum(a) + 200 as the_sum, @Oporto as the_town from t1
-group by b
-union distinct
-select sum(a) + 200, @Lisboa from t1
-group by b ;
-the_sum the_town
-204 Oporto
-201 Oporto
-203 Oporto
-202 Oporto
-204 Lisboa
-201 Lisboa
-203 Lisboa
-202 Lisboa
-prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
- group by b
- union distinct
- select sum(a) + 200, ? from t1
- group by b ' ;
-execute stmt1 using @Oporto, @Lisboa;
-the_sum the_town
-204 Oporto
-201 Oporto
-203 Oporto
-202 Oporto
-204 Lisboa
-201 Lisboa
-203 Lisboa
-202 Lisboa
-select sum(a) + 200 as the_sum, @Oporto as the_town from t1
-where a > @1
-group by b
-union distinct
-select sum(a) + 200, @Lisboa from t1
-where a > @2
-group by b ;
-the_sum the_town
-204 Oporto
-203 Oporto
-202 Oporto
-204 Lisboa
-203 Lisboa
-prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
- where a > ?
- group by b
- union distinct
- select sum(a) + 200, ? from t1
- where a > ?
- group by b ' ;
-execute stmt1 using @Oporto, @1, @Lisboa, @2;
-the_sum the_town
-204 Oporto
-203 Oporto
-202 Oporto
-204 Lisboa
-203 Lisboa
-select sum(a) + 200 as the_sum, @Oporto as the_town from t1
-where a > @1
-group by b
-having avg(a) > @2
-union distinct
-select sum(a) + 200, @Lisboa from t1
-where a > @2
-group by b
-having avg(a) > @3;
-the_sum the_town
-204 Oporto
-203 Oporto
-204 Lisboa
-prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
- where a > ?
- group by b
- having avg(a) > ?
- union distinct
- select sum(a) + 200, ? from t1
- where a > ?
- group by b
- having avg(a) > ? ';
-execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3;
-the_sum the_town
-204 Oporto
-203 Oporto
-204 Lisboa
-test_sequence
------- explain select tests ------
-prepare stmt1 from ' explain select * from t9 ' ;
-execute stmt1;
-Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def id 8 3 1 N 32929 0 63
-def select_type 253 19 6 N 1 31 8
-def table 253 64 2 Y 0 31 8
-def type 253 10 3 Y 0 31 8
-def possible_keys 253 4096 0 Y 0 31 8
-def key 253 64 0 Y 0 31 8
-def key_len 253 4096 0 Y 128 31 63
-def ref 253 1024 0 Y 0 31 8
-def rows 8 10 1 Y 32928 0 63
-def Extra 253 255 0 N 1 31 8
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t9 ALL NULL NULL NULL NULL 2
-test_sequence
------- delete tests ------
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-prepare stmt1 from 'delete from t1 where a=2' ;
-execute stmt1;
-select a,b from t1 where a=2;
-a b
-execute stmt1;
-insert into t1 values(0,NULL);
-set @arg00=NULL;
-prepare stmt1 from 'delete from t1 where b=?' ;
-execute stmt1 using @arg00;
-select a,b from t1 where b is NULL ;
-a b
-0 NULL
-set @arg00='one';
-execute stmt1 using @arg00;
-select a,b from t1 where b=@arg00;
-a b
-prepare stmt1 from 'truncate table t1' ;
-test_sequence
------- update tests ------
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ;
-execute stmt1;
-select a,b from t1 where a=2;
-a b
-2 a=two
-execute stmt1;
-select a,b from t1 where a=2;
-a b
-2 a=two
-set @arg00=NULL;
-prepare stmt1 from 'update t1 set b=? where a=2' ;
-execute stmt1 using @arg00;
-select a,b from t1 where a=2;
-a b
-2 NULL
-set @arg00='two';
-execute stmt1 using @arg00;
-select a,b from t1 where a=2;
-a b
-2 two
-set @arg00=2;
-prepare stmt1 from 'update t1 set b=NULL where a=?' ;
-execute stmt1 using @arg00;
-select a,b from t1 where a=@arg00;
-a b
-2 NULL
-update t1 set b='two' where a=@arg00;
-set @arg00=2000;
-execute stmt1 using @arg00;
-select a,b from t1 where a=@arg00;
-a b
-set @arg00=2;
-set @arg01=22;
-prepare stmt1 from 'update t1 set a=? where a=?' ;
-execute stmt1 using @arg00, @arg00;
-select a,b from t1 where a=@arg00;
-a b
-2 two
-execute stmt1 using @arg01, @arg00;
-select a,b from t1 where a=@arg01;
-a b
-22 two
-execute stmt1 using @arg00, @arg01;
-select a,b from t1 where a=@arg00;
-a b
-2 two
-set @arg00=NULL;
-set @arg01=2;
-execute stmt1 using @arg00, @arg01;
-Warnings:
-Warning 1048 Column 'a' cannot be null
-select a,b from t1 order by a;
-a b
-0 two
-1 one
-3 three
-4 four
-set @arg00=0;
-execute stmt1 using @arg01, @arg00;
-select a,b from t1 order by a;
-a b
-1 one
-2 two
-3 three
-4 four
-set @arg00=23;
-set @arg01='two';
-set @arg02=2;
-set @arg03='two';
-set @arg04=2;
-drop table if exists t2;
-create table t2 as select a,b from t1 ;
-prepare stmt1 from 'update t1 set a=? where b=?
- and a in (select ? from t2
- where b = ? or a = ?)';
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select a,b from t1 where a = @arg00 ;
-a b
-23 two
-prepare stmt1 from 'update t1 set a=? where b=?
- and a not in (select ? from t2
- where b = ? or a = ?)';
-execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select a,b from t1 order by a ;
-a b
-1 one
-2 two
-3 three
-4 four
-drop table t2 ;
-create table t2
-(
-a int, b varchar(30),
-primary key(a)
-) engine = 'NDB' ;
-insert into t2(a,b) select a, b from t1 ;
-prepare stmt1 from 'update t1 set a=? where b=?
- and a in (select ? from t2
- where b = ? or a = ?)';
-execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select a,b from t1 where a = @arg00 ;
-a b
-23 two
-prepare stmt1 from 'update t1 set a=? where b=?
- and a not in (select ? from t2
- where b = ? or a = ?)';
-execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select a,b from t1 order by a ;
-a b
-1 one
-2 two
-3 three
-4 four
-drop table t2 ;
-set @arg00=1;
-prepare stmt1 from 'update t1 set b=''bla''
-where a=2
-limit 1';
-execute stmt1 ;
-select a,b from t1 where b = 'bla' ;
-a b
-2 bla
-prepare stmt1 from 'update t1 set b=''bla'' where a=2 limit ?';
-execute stmt1 using @arg00;
-test_sequence
------- insert tests ------
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-prepare stmt1 from 'insert into t1 values(5, ''five'' )';
-execute stmt1;
-select a,b from t1 where a = 5;
-a b
-5 five
-set @arg00='six' ;
-prepare stmt1 from 'insert into t1 values(6, ? )';
-execute stmt1 using @arg00;
-select a,b from t1 where b = @arg00;
-a b
-6 six
-execute stmt1 using @arg00;
-ERROR 23000: Duplicate entry '6' for key 'PRIMARY'
-set @arg00=NULL ;
-prepare stmt1 from 'insert into t1 values(0, ? )';
-execute stmt1 using @arg00;
-select a,b from t1 where b is NULL;
-a b
-0 NULL
-set @arg00=8 ;
-set @arg01='eight' ;
-prepare stmt1 from 'insert into t1 values(?, ? )';
-execute stmt1 using @arg00, @arg01 ;
-select a,b from t1 where b = @arg01;
-a b
-8 eight
-set @NULL= null ;
-set @arg00= 'abc' ;
-execute stmt1 using @NULL, @NULL ;
-ERROR 23000: Column 'a' cannot be null
-execute stmt1 using @NULL, @NULL ;
-ERROR 23000: Column 'a' cannot be null
-execute stmt1 using @NULL, @arg00 ;
-ERROR 23000: Column 'a' cannot be null
-execute stmt1 using @NULL, @arg00 ;
-ERROR 23000: Column 'a' cannot be null
-set @arg01= 10000 + 2 ;
-execute stmt1 using @arg01, @arg00 ;
-set @arg01= 10000 + 1 ;
-execute stmt1 using @arg01, @arg00 ;
-select * from t1 where a > 10000 order by a ;
-a b
-10001 abc
-10002 abc
-delete from t1 where a > 10000 ;
-set @arg01= 10000 + 2 ;
-execute stmt1 using @arg01, @NULL ;
-set @arg01= 10000 + 1 ;
-execute stmt1 using @arg01, @NULL ;
-select * from t1 where a > 10000 order by a ;
-a b
-10001 NULL
-10002 NULL
-delete from t1 where a > 10000 ;
-set @arg01= 10000 + 10 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 9 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 8 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 7 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 6 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 5 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 4 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 3 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 2 ;
-execute stmt1 using @arg01, @arg01 ;
-set @arg01= 10000 + 1 ;
-execute stmt1 using @arg01, @arg01 ;
-select * from t1 where a > 10000 order by a ;
-a b
-10001 10001
-10002 10002
-10003 10003
-10004 10004
-10005 10005
-10006 10006
-10007 10007
-10008 10008
-10009 10009
-10010 10010
-delete from t1 where a > 10000 ;
-set @arg00=81 ;
-set @arg01='8-1' ;
-set @arg02=82 ;
-set @arg03='8-2' ;
-prepare stmt1 from 'insert into t1 values(?,?),(?,?)';
-execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
-select a,b from t1 where a in (@arg00,@arg02) ;
-a b
-81 8-1
-82 8-2
-set @arg00=9 ;
-set @arg01='nine' ;
-prepare stmt1 from 'insert into t1 set a=?, b=? ';
-execute stmt1 using @arg00, @arg01 ;
-select a,b from t1 where a = @arg00 ;
-a b
-9 nine
-set @arg00=6 ;
-set @arg01=1 ;
-prepare stmt1 from 'insert into t1 set a=?, b=''sechs''
- on duplicate key update a=a + ?, b=concat(b,''modified'') ';
-execute stmt1 using @arg00, @arg01;
-select * from t1 order by a;
-a b
-0 NULL
-1 one
-2 two
-3 three
-4 four
-5 five
-7 sixmodified
-8 eight
-9 nine
-81 8-1
-82 8-2
-set @arg00=81 ;
-set @arg01=1 ;
-execute stmt1 using @arg00, @arg01;
-ERROR 23000: Duplicate entry '82' for key 'PRIMARY'
-drop table if exists t2 ;
-create table t2 (id int auto_increment primary key)
-ENGINE= 'NDB' ;
-prepare stmt1 from ' select last_insert_id() ' ;
-insert into t2 values (NULL) ;
-execute stmt1 ;
-last_insert_id()
-1
-insert into t2 values (NULL) ;
-execute stmt1 ;
-last_insert_id()
-2
-drop table t2 ;
-set @1000=1000 ;
-set @x1000_2="x1000_2" ;
-set @x1000_3="x1000_3" ;
-set @x1000="x1000" ;
-set @1100=1100 ;
-set @x1100="x1100" ;
-set @100=100 ;
-set @updated="updated" ;
-insert into t1 values(1000,'x1000_1') ;
-insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3)
-on duplicate key update a = a + @100, b = concat(b,@updated) ;
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1000 x1000_3
-1100 x1000_1updated
-delete from t1 where a >= 1000 ;
-insert into t1 values(1000,'x1000_1') ;
-prepare stmt1 from ' insert into t1 values(?,?),(?,?)
- on duplicate key update a = a + ?, b = concat(b,?) ';
-execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ;
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1000 x1000_3
-1100 x1000_1updated
-delete from t1 where a >= 1000 ;
-insert into t1 values(1000,'x1000_1') ;
-execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ;
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1200 x1000_1updatedupdated
-delete from t1 where a >= 1000 ;
-prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
-execute stmt1;
-execute stmt1;
-execute stmt1;
-test_sequence
------- multi table tests ------
-delete from t1 ;
-delete from t9 ;
-insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ;
-insert into t9 (c1,c21)
-values (1, 'one'), (2, 'two'), (3, 'three') ;
-prepare stmt_delete from " delete t1, t9
- from t1, t9 where t1.a=t9.c1 and t1.b='updated' ";
-prepare stmt_update from " update t1, t9
- set t1.b='updated', t9.c21='updated'
- where t1.a=t9.c1 and t1.a=? ";
-prepare stmt_select1 from " select a, b from t1 order by a" ;
-prepare stmt_select2 from " select c1, c21 from t9 order by c1" ;
-set @arg00= 1 ;
-execute stmt_update using @arg00 ;
-execute stmt_delete ;
-execute stmt_select1 ;
-a b
-2 two
-3 three
-execute stmt_select2 ;
-c1 c21
-2 two
-3 three
-set @arg00= @arg00 + 1 ;
-execute stmt_update using @arg00 ;
-execute stmt_delete ;
-execute stmt_select1 ;
-a b
-3 three
-execute stmt_select2 ;
-c1 c21
-3 three
-set @arg00= @arg00 + 1 ;
-execute stmt_update using @arg00 ;
-execute stmt_delete ;
-execute stmt_select1 ;
-a b
-execute stmt_select2 ;
-c1 c21
-set @arg00= @arg00 + 1 ;
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-insert into t1 values(0,NULL) ;
-set @duplicate='duplicate ' ;
-set @1000=1000 ;
-set @5=5 ;
-select a,b from t1 where a < 5 order by a ;
-a b
-0 NULL
-1 one
-2 two
-3 three
-4 four
-insert into t1 select a + @1000, concat(@duplicate,b) from t1
-where a < @5 ;
-affected rows: 5
-info: Records: 5 Duplicates: 0 Warnings: 0
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1000 NULL
-1001 duplicate one
-1002 duplicate two
-1003 duplicate three
-1004 duplicate four
-delete from t1 where a >= 1000 ;
-prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1
-where a < ? ' ;
-execute stmt1 using @1000, @duplicate, @5;
-affected rows: 5
-info: Records: 5 Duplicates: 0 Warnings: 0
-select a,b from t1 where a >= 1000 order by a ;
-a b
-1000 NULL
-1001 duplicate one
-1002 duplicate two
-1003 duplicate three
-1004 duplicate four
-delete from t1 where a >= 1000 ;
-set @1=1 ;
-set @2=2 ;
-set @100=100 ;
-set @float=1.00;
-set @five='five' ;
-drop table if exists t2;
-create table t2 like t1 ;
-insert into t2 (b,a)
-select @duplicate, sum(first.a) from t1 first, t1 second
-where first.a <> @5 and second.b = first.b
-and second.b <> @five
-group by second.b
-having sum(second.a) > @2
-union
-select b, a + @100 from t1
-where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b
-from t1);
-affected rows: 3
-info: Records: 3 Duplicates: 0 Warnings: 0
-select a,b from t2 order by a ;
-a b
-3 duplicate
-4 duplicate
-103 three
-delete from t2 ;
-prepare stmt1 from ' insert into t2 (b,a)
-select ?, sum(first.a)
- from t1 first, t1 second
- where first.a <> ? and second.b = first.b and second.b <> ?
- group by second.b
- having sum(second.a) > ?
-union
-select b, a + ? from t1
- where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b
- from t1 ) ' ;
-execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ;
-affected rows: 3
-info: Records: 3 Duplicates: 0 Warnings: 0
-select a,b from t2 order by a ;
-a b
-3 duplicate
-4 duplicate
-103 three
-drop table t2;
-drop table if exists t5 ;
-set @arg01= 8;
-set @arg02= 8.0;
-set @arg03= 80.00000000000e-1;
-set @arg04= 'abc' ;
-set @arg05= CAST('abc' as binary) ;
-set @arg06= '1991-08-05' ;
-set @arg07= CAST('1991-08-05' as date);
-set @arg08= '1991-08-05 01:01:01' ;
-set @arg09= CAST('1991-08-05 01:01:01' as datetime) ;
-set @arg10= unix_timestamp('1991-01-01 01:01:01');
-set @arg11= YEAR('1991-01-01 01:01:01');
-set @arg12= 8 ;
-set @arg12= NULL ;
-set @arg13= 8.0 ;
-set @arg13= NULL ;
-set @arg14= 'abc';
-set @arg14= NULL ;
-set @arg15= CAST('abc' as binary) ;
-set @arg15= NULL ;
-create table t5 as select
-8 as const01, @arg01 as param01,
-8.0 as const02, @arg02 as param02,
-80.00000000000e-1 as const03, @arg03 as param03,
-'abc' as const04, @arg04 as param04,
-CAST('abc' as binary) as const05, @arg05 as param05,
-'1991-08-05' as const06, @arg06 as param06,
-CAST('1991-08-05' as date) as const07, @arg07 as param07,
-'1991-08-05 01:01:01' as const08, @arg08 as param08,
-CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09,
-unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10,
-YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11,
-NULL as const12, @arg12 as param12,
-@arg13 as param13,
-@arg14 as param14,
-@arg15 as param15;
-show create table t5 ;
-Table Create Table
-t5 CREATE TABLE `t5` (
- `const01` int(1) NOT NULL DEFAULT '0',
- `param01` bigint(20) DEFAULT NULL,
- `const02` decimal(2,1) NOT NULL DEFAULT '0.0',
- `param02` decimal(65,30) DEFAULT NULL,
- `const03` double NOT NULL DEFAULT '0',
- `param03` double DEFAULT NULL,
- `const04` varchar(3) NOT NULL DEFAULT '',
- `param04` longtext,
- `const05` varbinary(3) NOT NULL DEFAULT '',
- `param05` longblob,
- `const06` varchar(10) NOT NULL DEFAULT '',
- `param06` longtext,
- `const07` date DEFAULT NULL,
- `param07` longblob,
- `const08` varchar(19) NOT NULL DEFAULT '',
- `param08` longtext,
- `const09` datetime DEFAULT NULL,
- `param09` longblob,
- `const10` int(10) NOT NULL DEFAULT '0',
- `param10` bigint(20) DEFAULT NULL,
- `const11` int(4) DEFAULT NULL,
- `param11` bigint(20) DEFAULT NULL,
- `const12` binary(0) DEFAULT NULL,
- `param12` bigint(20) DEFAULT NULL,
- `param13` decimal(65,30) DEFAULT NULL,
- `param14` longtext,
- `param15` longblob
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-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 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
-def test t5 t5 param04 param04 252 4294967295 3 Y 16 0 8
-def test t5 t5 const05 const05 253 3 3 N 129 0 63
-def test t5 t5 param05 param05 252 4294967295 3 Y 144 0 63
-def test t5 t5 const06 const06 253 10 10 N 1 0 8
-def test t5 t5 param06 param06 252 4294967295 10 Y 16 0 8
-def test t5 t5 const07 const07 10 10 10 Y 128 0 63
-def test t5 t5 param07 param07 252 4294967295 10 Y 144 0 63
-def test t5 t5 const08 const08 253 19 19 N 1 0 8
-def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8
-def test t5 t5 const09 const09 12 19 19 Y 128 0 63
-def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63
-def test t5 t5 const10 const10 3 10 9 N 32769 0 63
-def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
-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 param14 param14 252 4294967295 0 Y 16 0 8
-def test t5 t5 param15 param15 252 4294967295 0 Y 144 0 63
-const01 8
-param01 8
-const02 8.0
-param02 8.000000000000000000000000000000
-const03 8
-param03 8
-const04 abc
-param04 abc
-const05 abc
-param05 abc
-const06 1991-08-05
-param06 1991-08-05
-const07 1991-08-05
-param07 1991-08-05
-const08 1991-08-05 01:01:01
-param08 1991-08-05 01:01:01
-const09 1991-08-05 01:01:01
-param09 1991-08-05 01:01:01
-const10 662680861
-param10 662680861
-const11 1991
-param11 1991
-const12 NULL
-param12 NULL
-param13 NULL
-param14 NULL
-param15 NULL
-drop table t5 ;
-test_sequence
------- data type conversion tests ------
-delete from t1 ;
-insert into t1 values (1,'one');
-insert into t1 values (2,'two');
-insert into t1 values (3,'three');
-insert into t1 values (4,'four');
-commit ;
-delete from t9 ;
-insert into t9
-set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
-c10= 1, c11= 1, c12 = 1,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=true, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
-insert into t9
-set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
-c10= 9, c11= 9, c12 = 9,
-c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
-c16= '11:11:11', c17= '2004',
-c18= 1, c19=false, c20= 'a', c21= '123456789a',
-c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
-c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
-c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
-commit ;
-insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ;
-select * from t9 order by c1 ;
-c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
-test_sequence
------- select @parameter:= column ------
-prepare full_info from "select @arg01, @arg02, @arg03, @arg04,
- @arg05, @arg06, @arg07, @arg08,
- @arg09, @arg10, @arg11, @arg12,
- @arg13, @arg14, @arg15, @arg16,
- @arg17, @arg18, @arg19, @arg20,
- @arg21, @arg22, @arg23, @arg24,
- @arg25, @arg26, @arg27, @arg28,
- @arg29, @arg30, @arg31, @arg32" ;
-select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
-@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8,
-@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12,
-@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16,
-@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20,
-@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24,
-@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28,
-@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32
-from t9 where c1= 1 ;
-@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 1 Y 128 0 63
-def @arg03 253 20 1 Y 128 0 63
-def @arg04 253 20 1 Y 128 0 63
-def @arg05 253 20 1 Y 128 0 63
-def @arg06 253 20 1 Y 128 0 63
-def @arg07 253 23 1 Y 128 31 63
-def @arg08 253 23 1 Y 128 31 63
-def @arg09 253 23 1 Y 128 31 63
-def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
-def @arg13 253 16777216 10 Y 128 31 63
-def @arg14 253 16777216 19 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 8 Y 128 31 63
-def @arg17 253 20 4 Y 128 0 63
-def @arg18 253 20 1 Y 128 0 63
-def @arg19 253 20 1 Y 128 0 63
-def @arg20 253 16777216 1 Y 0 31 8
-def @arg21 253 16777216 10 Y 0 31 8
-def @arg22 253 16777216 30 Y 0 31 8
-def @arg23 253 16777216 8 Y 128 31 63
-def @arg24 253 16777216 8 Y 0 31 8
-def @arg25 253 16777216 4 Y 128 31 63
-def @arg26 253 16777216 4 Y 0 31 8
-def @arg27 253 16777216 10 Y 128 31 63
-def @arg28 253 16777216 10 Y 0 31 8
-def @arg29 253 16777216 8 Y 128 31 63
-def @arg30 253 16777216 8 Y 0 31 8
-def @arg31 253 16777216 3 Y 0 31 8
-def @arg32 253 16777216 6 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
-@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8,
-@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12,
-@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16,
-@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20,
-@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24,
-@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28,
-@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32
-from t9 where c1= 0 ;
-@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 0 Y 128 0 63
-def @arg03 253 20 0 Y 128 0 63
-def @arg04 253 20 0 Y 128 0 63
-def @arg05 253 20 0 Y 128 0 63
-def @arg06 253 20 0 Y 128 0 63
-def @arg07 253 23 0 Y 128 31 63
-def @arg08 253 23 0 Y 128 31 63
-def @arg09 253 23 0 Y 128 31 63
-def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
-def @arg13 253 16777216 0 Y 128 31 63
-def @arg14 253 16777216 0 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 0 Y 128 31 63
-def @arg17 253 20 0 Y 128 0 63
-def @arg18 253 20 0 Y 128 0 63
-def @arg19 253 20 0 Y 128 0 63
-def @arg20 253 16777216 0 Y 0 31 8
-def @arg21 253 16777216 0 Y 0 31 8
-def @arg22 253 16777216 0 Y 0 31 8
-def @arg23 253 16777216 0 Y 128 31 63
-def @arg24 253 16777216 0 Y 0 31 8
-def @arg25 253 16777216 0 Y 128 31 63
-def @arg26 253 16777216 0 Y 0 31 8
-def @arg27 253 16777216 0 Y 128 31 63
-def @arg28 253 16777216 0 Y 0 31 8
-def @arg29 253 16777216 0 Y 128 31 63
-def @arg30 253 16777216 0 Y 0 31 8
-def @arg31 253 16777216 0 Y 0 31 8
-def @arg32 253 16777216 0 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-prepare stmt1 from "select
- @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
- @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8,
- @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12,
- @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16,
- @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20,
- @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24,
- @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28,
- @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32
-from t9 where c1= ?" ;
-set @my_key= 1 ;
-execute stmt1 using @my_key ;
-@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 1 Y 128 0 63
-def @arg03 253 20 1 Y 128 0 63
-def @arg04 253 20 1 Y 128 0 63
-def @arg05 253 20 1 Y 128 0 63
-def @arg06 253 20 1 Y 128 0 63
-def @arg07 253 23 1 Y 128 31 63
-def @arg08 253 23 1 Y 128 31 63
-def @arg09 253 23 1 Y 128 31 63
-def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
-def @arg13 253 16777216 10 Y 128 31 63
-def @arg14 253 16777216 19 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 8 Y 128 31 63
-def @arg17 253 20 4 Y 128 0 63
-def @arg18 253 20 1 Y 128 0 63
-def @arg19 253 20 1 Y 128 0 63
-def @arg20 253 16777216 1 Y 0 31 8
-def @arg21 253 16777216 10 Y 0 31 8
-def @arg22 253 16777216 30 Y 0 31 8
-def @arg23 253 16777216 8 Y 128 31 63
-def @arg24 253 16777216 8 Y 0 31 8
-def @arg25 253 16777216 4 Y 128 31 63
-def @arg26 253 16777216 4 Y 0 31 8
-def @arg27 253 16777216 10 Y 128 31 63
-def @arg28 253 16777216 10 Y 0 31 8
-def @arg29 253 16777216 8 Y 128 31 63
-def @arg30 253 16777216 8 Y 0 31 8
-def @arg31 253 16777216 3 Y 0 31 8
-def @arg32 253 16777216 6 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-set @my_key= 0 ;
-execute stmt1 using @my_key ;
-@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 0 Y 128 0 63
-def @arg03 253 20 0 Y 128 0 63
-def @arg04 253 20 0 Y 128 0 63
-def @arg05 253 20 0 Y 128 0 63
-def @arg06 253 20 0 Y 128 0 63
-def @arg07 253 23 0 Y 128 31 63
-def @arg08 253 23 0 Y 128 31 63
-def @arg09 253 23 0 Y 128 31 63
-def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
-def @arg13 253 16777216 0 Y 128 31 63
-def @arg14 253 16777216 0 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 0 Y 128 31 63
-def @arg17 253 20 0 Y 128 0 63
-def @arg18 253 20 0 Y 128 0 63
-def @arg19 253 20 0 Y 128 0 63
-def @arg20 253 16777216 0 Y 0 31 8
-def @arg21 253 16777216 0 Y 0 31 8
-def @arg22 253 16777216 0 Y 0 31 8
-def @arg23 253 16777216 0 Y 128 31 63
-def @arg24 253 16777216 0 Y 0 31 8
-def @arg25 253 16777216 0 Y 128 31 63
-def @arg26 253 16777216 0 Y 0 31 8
-def @arg27 253 16777216 0 Y 128 31 63
-def @arg28 253 16777216 0 Y 0 31 8
-def @arg29 253 16777216 0 Y 128 31 63
-def @arg30 253 16777216 0 Y 0 31 8
-def @arg31 253 16777216 0 Y 0 31 8
-def @arg32 253 16777216 0 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-prepare stmt1 from "select ? := c1 from t9 where c1= 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 ':= c1 from t9 where c1= 1' at line 1
-test_sequence
------- select column, .. into @parm,.. ------
-select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
-c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24,
-c25, c26, c27, c28, c29, c30, c31, c32
-into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
-@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16,
-@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24,
-@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32
-from t9 where c1= 1 ;
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 1 Y 128 0 63
-def @arg03 253 20 1 Y 128 0 63
-def @arg04 253 20 1 Y 128 0 63
-def @arg05 253 20 1 Y 128 0 63
-def @arg06 253 20 1 Y 128 0 63
-def @arg07 253 23 1 Y 128 31 63
-def @arg08 253 23 1 Y 128 31 63
-def @arg09 253 23 1 Y 128 31 63
-def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
-def @arg13 253 16777216 10 Y 128 31 63
-def @arg14 253 16777216 19 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 8 Y 128 31 63
-def @arg17 253 20 4 Y 128 0 63
-def @arg18 253 20 1 Y 128 0 63
-def @arg19 253 20 1 Y 128 0 63
-def @arg20 253 16777216 1 Y 0 31 8
-def @arg21 253 16777216 10 Y 0 31 8
-def @arg22 253 16777216 30 Y 0 31 8
-def @arg23 253 16777216 8 Y 128 31 63
-def @arg24 253 16777216 8 Y 0 31 8
-def @arg25 253 16777216 4 Y 128 31 63
-def @arg26 253 16777216 4 Y 0 31 8
-def @arg27 253 16777216 10 Y 128 31 63
-def @arg28 253 16777216 10 Y 0 31 8
-def @arg29 253 16777216 8 Y 128 31 63
-def @arg30 253 16777216 8 Y 0 31 8
-def @arg31 253 16777216 3 Y 0 31 8
-def @arg32 253 16777216 6 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
-c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24,
-c25, c26, c27, c28, c29, c30, c31, c32
-into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
-@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16,
-@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24,
-@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32
-from t9 where c1= 0 ;
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 0 Y 128 0 63
-def @arg03 253 20 0 Y 128 0 63
-def @arg04 253 20 0 Y 128 0 63
-def @arg05 253 20 0 Y 128 0 63
-def @arg06 253 20 0 Y 128 0 63
-def @arg07 253 23 0 Y 128 31 63
-def @arg08 253 23 0 Y 128 31 63
-def @arg09 253 23 0 Y 128 31 63
-def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
-def @arg13 253 16777216 0 Y 128 31 63
-def @arg14 253 16777216 0 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 0 Y 128 31 63
-def @arg17 253 20 0 Y 128 0 63
-def @arg18 253 20 0 Y 128 0 63
-def @arg19 253 20 0 Y 128 0 63
-def @arg20 253 16777216 0 Y 0 31 8
-def @arg21 253 16777216 0 Y 0 31 8
-def @arg22 253 16777216 0 Y 0 31 8
-def @arg23 253 16777216 0 Y 128 31 63
-def @arg24 253 16777216 0 Y 0 31 8
-def @arg25 253 16777216 0 Y 128 31 63
-def @arg26 253 16777216 0 Y 0 31 8
-def @arg27 253 16777216 0 Y 128 31 63
-def @arg28 253 16777216 0 Y 0 31 8
-def @arg29 253 16777216 0 Y 128 31 63
-def @arg30 253 16777216 0 Y 0 31 8
-def @arg31 253 16777216 0 Y 0 31 8
-def @arg32 253 16777216 0 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
- c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24,
- c25, c26, c27, c28, c29, c30, c31, c32
-into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
- @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16,
- @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24,
- @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32
-from t9 where c1= ?" ;
-set @my_key= 1 ;
-execute stmt1 using @my_key ;
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 1 Y 128 0 63
-def @arg03 253 20 1 Y 128 0 63
-def @arg04 253 20 1 Y 128 0 63
-def @arg05 253 20 1 Y 128 0 63
-def @arg06 253 20 1 Y 128 0 63
-def @arg07 253 23 1 Y 128 31 63
-def @arg08 253 23 1 Y 128 31 63
-def @arg09 253 23 1 Y 128 31 63
-def @arg10 253 23 1 Y 128 31 63
-def @arg11 253 67 6 Y 128 30 63
-def @arg12 253 67 6 Y 128 30 63
-def @arg13 253 16777216 10 Y 128 31 63
-def @arg14 253 16777216 19 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 8 Y 128 31 63
-def @arg17 253 20 4 Y 128 0 63
-def @arg18 253 20 1 Y 128 0 63
-def @arg19 253 20 1 Y 128 0 63
-def @arg20 253 16777216 1 Y 0 31 8
-def @arg21 253 16777216 10 Y 0 31 8
-def @arg22 253 16777216 30 Y 0 31 8
-def @arg23 253 16777216 8 Y 128 31 63
-def @arg24 253 16777216 8 Y 0 31 8
-def @arg25 253 16777216 4 Y 128 31 63
-def @arg26 253 16777216 4 Y 0 31 8
-def @arg27 253 16777216 10 Y 128 31 63
-def @arg28 253 16777216 10 Y 0 31 8
-def @arg29 253 16777216 8 Y 128 31 63
-def @arg30 253 16777216 8 Y 0 31 8
-def @arg31 253 16777216 3 Y 0 31 8
-def @arg32 253 16777216 6 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
-set @my_key= 0 ;
-execute stmt1 using @my_key ;
-execute full_info ;
-Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg01 253 20 1 Y 128 0 63
-def @arg02 253 20 0 Y 128 0 63
-def @arg03 253 20 0 Y 128 0 63
-def @arg04 253 20 0 Y 128 0 63
-def @arg05 253 20 0 Y 128 0 63
-def @arg06 253 20 0 Y 128 0 63
-def @arg07 253 23 0 Y 128 31 63
-def @arg08 253 23 0 Y 128 31 63
-def @arg09 253 23 0 Y 128 31 63
-def @arg10 253 23 0 Y 128 31 63
-def @arg11 253 67 0 Y 128 30 63
-def @arg12 253 67 0 Y 128 30 63
-def @arg13 253 16777216 0 Y 128 31 63
-def @arg14 253 16777216 0 Y 128 31 63
-def @arg15 253 16777216 19 Y 128 31 63
-def @arg16 253 16777216 0 Y 128 31 63
-def @arg17 253 20 0 Y 128 0 63
-def @arg18 253 20 0 Y 128 0 63
-def @arg19 253 20 0 Y 128 0 63
-def @arg20 253 16777216 0 Y 0 31 8
-def @arg21 253 16777216 0 Y 0 31 8
-def @arg22 253 16777216 0 Y 0 31 8
-def @arg23 253 16777216 0 Y 128 31 63
-def @arg24 253 16777216 0 Y 0 31 8
-def @arg25 253 16777216 0 Y 128 31 63
-def @arg26 253 16777216 0 Y 0 31 8
-def @arg27 253 16777216 0 Y 128 31 63
-def @arg28 253 16777216 0 Y 0 31 8
-def @arg29 253 16777216 0 Y 128 31 63
-def @arg30 253 16777216 0 Y 0 31 8
-def @arg31 253 16777216 0 Y 0 31 8
-def @arg32 253 16777216 0 Y 0 31 8
-@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
-0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-prepare stmt1 from "select c1 into ? from t9 where c1= 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 '? from t9 where c1= 1' at line 1
-test_sequence
--- insert into numeric columns --
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ;
-set @arg00= 21 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ;
-execute stmt1 ;
-set @arg00= 23;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0,
-30.0, 30.0, 30.0 ) ;
-set @arg00= 31.0 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0,
- 32.0, 32.0, 32.0 )" ;
-execute stmt1 ;
-set @arg00= 33.0;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( '40', '40', '40', '40', '40', '40', '40', '40',
-'40', '40', '40' ) ;
-set @arg00= '41' ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( '42', '42', '42', '42', '42', '42', '42', '42',
- '42', '42', '42' )" ;
-execute stmt1 ;
-set @arg00= '43';
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( CAST('50' as binary), CAST('50' as binary),
-CAST('50' as binary), CAST('50' as binary), CAST('50' as binary),
-CAST('50' as binary), CAST('50' as binary), CAST('50' as binary),
-CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ;
-set @arg00= CAST('51' as binary) ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( CAST('52' as binary), CAST('52' as binary),
- CAST('52' as binary), CAST('52' as binary), CAST('52' as binary),
- CAST('52' as binary), CAST('52' as binary), CAST('52' as binary),
- CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ;
-execute stmt1 ;
-set @arg00= CAST('53' as binary) ;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-set @arg00= 2 ;
-set @arg00= NULL ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-NULL, NULL, NULL ) ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 61, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt1 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL )" ;
-execute stmt1 ;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-set @arg00= 8.0 ;
-set @arg00= NULL ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 71, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-set @arg00= 'abc' ;
-set @arg00= NULL ;
-insert into t9
-( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
-( 81, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
-prepare stmt2 from "insert into t9
- ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12
-from t9 where c1 >= 20
-order by c1 ;
-c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12
-20 20 20 20 20 20 20 20 20 20 20.0000
-21 21 21 21 21 21 21 21 21 21 21.0000
-22 22 22 22 22 22 22 22 22 22 22.0000
-23 23 23 23 23 23 23 23 23 23 23.0000
-30 30 30 30 30 30 30 30 30 30 30.0000
-31 31 31 31 31 31 31 31 31 31 31.0000
-32 32 32 32 32 32 32 32 32 32 32.0000
-33 33 33 33 33 33 33 33 33 33 33.0000
-40 40 40 40 40 40 40 40 40 40 40.0000
-41 41 41 41 41 41 41 41 41 41 41.0000
-42 42 42 42 42 42 42 42 42 42 42.0000
-43 43 43 43 43 43 43 43 43 43 43.0000
-50 50 50 50 50 50 50 50 50 50 50.0000
-51 51 51 51 51 51 51 51 51 51 51.0000
-52 52 52 52 52 52 52 52 52 52 52.0000
-53 53 53 53 53 53 53 53 53 53 53.0000
-60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-test_sequence
--- select .. where numeric column = .. --
-set @arg00= 20;
-select 'true' as found from t9
-where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20
-and c8= 20 and c9= 20 and c10= 20 and c12= 20;
-found
-true
-select 'true' as found from t9
-where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
-and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
-and c12= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20
- and c8= 20 and c9= 20 and c10= 20 and c12= 20 ";
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
- and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
- and c12= ? ";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= 20.0;
-select 'true' as found from t9
-where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0
-and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0;
-found
-true
-select 'true' as found from t9
-where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
-and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
-and c12= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0
- and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 ";
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
- and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
- and c12= ? ";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-found
-true
-select 'true' as found from t9
-where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20'
- and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20';
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20'
- and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' ";
-execute stmt1 ;
-found
-true
-set @arg00= '20';
-select 'true' as found from t9
-where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
-and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
-and c12= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
- and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
- and c12= ? ";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-found
-true
-select 'true' as found from t9
-where c1= CAST('20' as binary) and c2= CAST('20' as binary) and
-c3= CAST('20' as binary) and c4= CAST('20' as binary) and
-c5= CAST('20' as binary) and c6= CAST('20' as binary) and
-c7= CAST('20' as binary) and c8= CAST('20' as binary) and
-c9= CAST('20' as binary) and c10= CAST('20' as binary) and
-c12= CAST('20' as binary);
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= CAST('20' as binary) and c2= CAST('20' as binary) and
- c3= CAST('20' as binary) and c4= CAST('20' as binary) and
- c5= CAST('20' as binary) and c6= CAST('20' as binary) and
- c7= CAST('20' as binary) and c8= CAST('20' as binary) and
- c9= CAST('20' as binary) and c10= CAST('20' as binary) and
- c12= CAST('20' as binary) ";
-execute stmt1 ;
-found
-true
-set @arg00= CAST('20' as binary) ;
-select 'true' as found from t9
-where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
-and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
-and c12= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
- and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
- and c12= ? ";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00 ;
-found
-true
-delete from t9 ;
-test_sequence
--- some numeric overflow experiments --
-prepare my_insert from "insert into t9
- ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
-values
- ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
-prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12
-from t9 where c21 = 'O' ";
-prepare my_delete from "delete from t9 where c21 = 'O' ";
-set @arg00= 9223372036854775807 ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Out of range value for column 'c1' at row 1
-Warning 1264 Out of range value for column 'c2' at row 1
-Warning 1264 Out of range value for column 'c3' at row 1
-Warning 1264 Out of range value for column 'c4' at row 1
-Warning 1264 Out of range value for column 'c5' at row 1
-Warning 1264 Out of range value for column 'c12' at row 1
-execute my_select ;
-c1 127
-c2 32767
-c3 8388607
-c4 2147483647
-c5 2147483647
-c6 9223372036854775807
-c7 9.22337e+18
-c8 9.22337203685478e+18
-c9 9.22337203685478e+18
-c10 9.22337203685478e+18
-c12 9999.9999
-execute my_delete ;
-set @arg00= '9223372036854775807' ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Out of range value for column 'c1' at row 1
-Warning 1264 Out of range value for column 'c2' at row 1
-Warning 1264 Out of range value for column 'c3' at row 1
-Warning 1264 Out of range value for column 'c4' at row 1
-Warning 1264 Out of range value for column 'c5' at row 1
-Warning 1264 Out of range value for column 'c12' at row 1
-execute my_select ;
-c1 127
-c2 32767
-c3 8388607
-c4 2147483647
-c5 2147483647
-c6 9223372036854775807
-c7 9.22337e+18
-c8 9.22337203685478e+18
-c9 9.22337203685478e+18
-c10 9.22337203685478e+18
-c12 9999.9999
-execute my_delete ;
-set @arg00= -9223372036854775808 ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Out of range value for column 'c1' at row 1
-Warning 1264 Out of range value for column 'c2' at row 1
-Warning 1264 Out of range value for column 'c3' at row 1
-Warning 1264 Out of range value for column 'c4' at row 1
-Warning 1264 Out of range value for column 'c5' at row 1
-Warning 1264 Out of range value for column 'c12' at row 1
-execute my_select ;
-c1 -128
-c2 -32768
-c3 -8388608
-c4 -2147483648
-c5 -2147483648
-c6 -9223372036854775808
-c7 -9.22337e+18
-c8 -9.22337203685478e+18
-c9 -9.22337203685478e+18
-c10 -9.22337203685478e+18
-c12 -9999.9999
-execute my_delete ;
-set @arg00= '-9223372036854775808' ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Out of range value for column 'c1' at row 1
-Warning 1264 Out of range value for column 'c2' at row 1
-Warning 1264 Out of range value for column 'c3' at row 1
-Warning 1264 Out of range value for column 'c4' at row 1
-Warning 1264 Out of range value for column 'c5' at row 1
-Warning 1264 Out of range value for column 'c12' at row 1
-execute my_select ;
-c1 -128
-c2 -32768
-c3 -8388608
-c4 -2147483648
-c5 -2147483648
-c6 -9223372036854775808
-c7 -9.22337e+18
-c8 -9.22337203685478e+18
-c9 -9.22337203685478e+18
-c10 -9.22337203685478e+18
-c12 -9999.9999
-execute my_delete ;
-set @arg00= 1.11111111111111111111e+50 ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Out of range value for column 'c1' at row 1
-Warning 1264 Out of range value for column 'c2' at row 1
-Warning 1264 Out of range value for column 'c3' at row 1
-Warning 1264 Out of range value for column 'c4' at row 1
-Warning 1264 Out of range value for column 'c5' at row 1
-Warning 1264 Out of range value for column 'c6' at row 1
-Warning 1264 Out of range value for column 'c7' at row 1
-Warning 1264 Out of range value for column 'c12' at row 1
-execute my_select ;
-c1 127
-c2 32767
-c3 8388607
-c4 2147483647
-c5 2147483647
-c6 9223372036854775807
-c7 3.40282e+38
-c8 1.11111111111111e+50
-c9 1.11111111111111e+50
-c10 1.11111111111111e+50
-c12 9999.9999
-execute my_delete ;
-set @arg00= '1.11111111111111111111e+50' ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Out of range value for column 'c1' at row 1
-Warning 1264 Out of range value for column 'c2' at row 1
-Warning 1264 Out of range value for column 'c3' at row 1
-Warning 1264 Out of range value for column 'c4' at row 1
-Warning 1264 Out of range value for column 'c5' at row 1
-Warning 1264 Out of range value for column 'c6' at row 1
-Warning 1264 Out of range value for column 'c7' at row 1
-Warning 1264 Out of range value for column 'c12' at row 1
-execute my_select ;
-c1 127
-c2 32767
-c3 8388607
-c4 2147483647
-c5 2147483647
-c6 9223372036854775807
-c7 3.40282e+38
-c8 1.11111111111111e+50
-c9 1.11111111111111e+50
-c10 1.11111111111111e+50
-c12 9999.9999
-execute my_delete ;
-set @arg00= -1.11111111111111111111e+50 ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Out of range value for column 'c1' at row 1
-Warning 1264 Out of range value for column 'c2' at row 1
-Warning 1264 Out of range value for column 'c3' at row 1
-Warning 1264 Out of range value for column 'c4' at row 1
-Warning 1264 Out of range value for column 'c5' at row 1
-Warning 1264 Out of range value for column 'c6' at row 1
-Warning 1264 Out of range value for column 'c7' at row 1
-Warning 1264 Out of range value for column 'c12' at row 1
-execute my_select ;
-c1 -128
-c2 -32768
-c3 -8388608
-c4 -2147483648
-c5 -2147483648
-c6 -9223372036854775808
-c7 -3.40282e+38
-c8 -1.11111111111111e+50
-c9 -1.11111111111111e+50
-c10 -1.11111111111111e+50
-c12 -9999.9999
-execute my_delete ;
-set @arg00= '-1.11111111111111111111e+50' ;
-execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-Warnings:
-Warning 1264 Out of range value for column 'c1' at row 1
-Warning 1264 Out of range value for column 'c2' at row 1
-Warning 1264 Out of range value for column 'c3' at row 1
-Warning 1264 Out of range value for column 'c4' at row 1
-Warning 1264 Out of range value for column 'c5' at row 1
-Warning 1264 Out of range value for column 'c6' at row 1
-Warning 1264 Out of range value for column 'c7' at row 1
-Warning 1264 Out of range value for column 'c12' at row 1
-execute my_select ;
-c1 -128
-c2 -32768
-c3 -8388608
-c4 -2147483648
-c5 -2147483648
-c6 -9223372036854775808
-c7 -3.40282e+38
-c8 -1.11111111111111e+50
-c9 -1.11111111111111e+50
-c10 -1.11111111111111e+50
-c12 -9999.9999
-execute my_delete ;
-test_sequence
--- insert into string columns --
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c20' at row 1
-select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30
-from t9 where c1 >= 20
-order by c1 ;
-c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30
-20 2 20 20 20 20 20 20 20 20 20 20
-21 2 21 21 21 21 21 21 21 21 21 21
-22 2 22 22 22 22 22 22 22 22 22 22
-23 2 23 23 23 23 23 23 23 23 23 23
-30 3 30 30 30 30 30 30 30 30 30 30
-31 3 31 31 31 31 31 31 31 31 31 31
-32 3 32 32 32 32 32 32 32 32 32 32
-33 3 33 33 33 33 33 33 33 33 33 33
-40 4 40 40 40 40 40 40 40 40 40 40
-41 4 41 41 41 41 41 41 41 41 41 41
-42 4 42 42 42 42 42 42 42 42 42 42
-43 4 43 43 43 43 43 43 43 43 43 43
-50 5 50.0 50.0 50.0 50.0 50.0 50.0 50.0 50.0 50.0 50.0
-51 5 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0
-52 5 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0
-53 5 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0
-54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00
-55 5 55 55 55 55 55 55 55 55 55 55
-56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00
-57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00
-60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-test_sequence
--- select .. where string column = .. --
-set @arg00= '20';
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and
-c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and
-c27= '20' and c28= '20' and c29= '20' and c30= '20' ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and
-c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
-c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and
- c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and
- c27= '20' and c28= '20' and c29= '20' and c30= '20'" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and
- c21= ? and c22= ? and c23= ? and c25= ? and
- c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= CAST('20' as binary);
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20)))
-= CAST('20' as binary) and c21= CAST('20' as binary)
-and c22= CAST('20' as binary) and c23= CAST('20' as binary) and
-c24= CAST('20' as binary) and c25= CAST('20' as binary) and
-c26= CAST('20' as binary) and c27= CAST('20' as binary) and
-c28= CAST('20' as binary) and c29= CAST('20' as binary) and
-c30= CAST('20' as binary) ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and
-c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
-c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and
-c30= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20)))
- = CAST('20' as binary) and c21= CAST('20' as binary)
- and c22= CAST('20' as binary) and c23= CAST('20' as binary) and
- c24= CAST('20' as binary) and c25= CAST('20' as binary) and
- c26= CAST('20' as binary) and c27= CAST('20' as binary) and
- c28= CAST('20' as binary) and c29= CAST('20' as binary) and
- c30= CAST('20' as binary)" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and
- c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and
- c29= ? and c30= ?";
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= 20;
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and
-c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and
-c27= 20 and c28= 20 and c29= 20 and c30= 20 ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and
-c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
-c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and
- c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and
- c27= 20 and c28= 20 and c29= 20 and c30= 20" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and
- c21= ? and c22= ? and c23= ? and c25= ? and
- c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= 20.0;
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and
-c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and
-c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and
-c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
-c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and
- c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and
- c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and
- c21= ? and c22= ? and c23= ? and c25= ? and
- c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
-@arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-delete from t9 ;
-test_sequence
--- insert into date/time columns --
-Warnings:
-Note 1265 Data truncated for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Note 1265 Data truncated for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Note 1265 Data truncated for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Note 1265 Data truncated for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Note 1265 Data truncated for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Note 1265 Data truncated for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c17' at row 1
-Warnings:
-Warning 1264 Out of range value for column 'c13' at row 1
-Warning 1264 Out of range value for column 'c14' at row 1
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Out of range value for column 'c16' at row 1
-Warning 1264 Out of range value for column 'c17' at row 1
-Warnings:
-Warning 1264 Out of range value for column 'c13' at row 1
-Warning 1264 Out of range value for column 'c14' at row 1
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Out of range value for column 'c16' at row 1
-Warning 1264 Out of range value for column 'c17' at row 1
-Warnings:
-Warning 1264 Out of range value for column 'c13' at row 1
-Warning 1264 Out of range value for column 'c14' at row 1
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Out of range value for column 'c16' at row 1
-Warning 1264 Out of range value for column 'c17' at row 1
-Warnings:
-Warning 1264 Out of range value for column 'c13' at row 1
-Warning 1264 Out of range value for column 'c14' at row 1
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Out of range value for column 'c16' at row 1
-Warning 1264 Out of range value for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Out of range value for column 'c16' at row 1
-Warning 1264 Out of range value for column 'c17' at row 1
-Warnings:
-Note 1265 Data truncated for column 'c13' at row 1
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Out of range value for column 'c16' at row 1
-Warning 1264 Out of range value for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Out of range value for column 'c16' at row 1
-Warning 1264 Out of range value for column 'c17' at row 1
-Warnings:
-Warning 1265 Data truncated for column 'c15' at row 1
-Warning 1264 Out of range value for column 'c16' at row 1
-Warning 1264 Out of range value for column 'c17' at row 1
-select c1, c13, c14, c15, c16, c17 from t9 order by c1 ;
-c1 c13 c14 c15 c16 c17
-20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
-40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-60 NULL NULL 1991-01-01 01:01:01 NULL NULL
-61 NULL NULL 1991-01-01 01:01:01 NULL NULL
-62 NULL NULL 1991-01-01 01:01:01 NULL NULL
-63 NULL NULL 1991-01-01 01:01:01 NULL NULL
-71 NULL NULL 1991-01-01 01:01:01 NULL NULL
-73 NULL NULL 1991-01-01 01:01:01 NULL NULL
-81 NULL NULL 1991-01-01 01:01:01 NULL NULL
-83 NULL NULL 1991-01-01 01:01:01 NULL NULL
-test_sequence
--- select .. where date/time column = .. --
-set @arg00= '1991-01-01 01:01:01' ;
-select 'true' as found from t9
-where c1= 20 and c13= CAST('1991-01-01 01:01:01' AS DATE) and c14= '1991-01-01 01:01:01' and
-c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
-c17= '1991-01-01 01:01:01' ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and c13= CAST(@arg00 AS DATE) and c14= @arg00 and c15= @arg00 and c16= @arg00
-and c17= @arg00 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= CAST('1991-01-01 01:01:01' AS DATE) and c14= '1991-01-01 01:01:01' and
- c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
- c17= '1991-01-01 01:01:01'" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= CAST(? AS DATE) and c14= ? and c15= ? and c16= ? and c17= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= CAST('1991-01-01 01:01:01' as datetime) ;
-select 'true' as found from t9
-where c1= 20 and c13= CAST('1991-01-01 00:00:00' as datetime) and
-c14= CAST('1991-01-01 01:01:01' as datetime) and
-c15= CAST('1991-01-01 01:01:01' as datetime) and
-c16= CAST('1991-01-01 01:01:01' as datetime) and
-c17= CAST('1991-01-01 01:01:01' as datetime) ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and c13= CAST(@arg00 AS DATE) and c14= @arg00 and c15= @arg00 and c16= @arg00
-and c17= @arg00 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= CAST('1991-01-01 00:00:00' as datetime) and
- c14= CAST('1991-01-01 01:01:01' as datetime) and
- c15= CAST('1991-01-01 01:01:01' as datetime) and
- c16= CAST('1991-01-01 01:01:01' as datetime) and
- c17= CAST('1991-01-01 01:01:01' as datetime)" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c13= CAST(? AS DATE) and c14= ? and c15= ? and c16= ? and c17= ?" ;
-execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
-found
-true
-set @arg00= 1991 ;
-select 'true' as found from t9
-where c1= 20 and c17= 1991 ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and c17= @arg00 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c17= 1991" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and c17= ?" ;
-execute stmt1 using @arg00 ;
-found
-true
-set @arg00= 1.991e+3 ;
-select 'true' as found from t9
-where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ;
-found
-true
-select 'true' as found from t9
-where c1= 20 and abs(c17 - @arg00) < 0.01 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ;
-execute stmt1 ;
-found
-true
-prepare stmt1 from "select 'true' as found from t9
-where c1= 20 and abs(c17 - ?) < 0.01" ;
-execute stmt1 using @arg00 ;
-found
-true
-drop table t1, t9;
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index 66283f16120..321b08628ee 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -181,12 +181,22 @@ a
1
2
3
+select * from t1 where a IN (select sql_cache a from t1);
+a
+1
+2
+3
+select * from t1 where a IN (select a from t1 union select sql_cache a from t1);
+a
+1
+2
+3
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 4
show status like "Qcache_queries_in_cache";
Variable_name Value
-Qcache_queries_in_cache 2
+Qcache_queries_in_cache 1
set query_cache_type=on;
reset query cache;
show status like "Qcache_queries_in_cache";
@@ -197,6 +207,41 @@ a
1
2
3
+select * from t1 union select sql_no_cache * from t1;
+a
+1
+2
+3
+select * from t1 where a IN (select sql_no_cache a from t1);
+a
+1
+2
+3
+select * from t1 where a IN (select a from t1 union select sql_no_cache a from t1);
+a
+1
+2
+3
+select sql_cache sql_no_cache * from t1;
+a
+1
+2
+3
+select sql_cache * from t1 union select sql_no_cache * from t1;
+a
+1
+2
+3
+select sql_cache * from t1 where a IN (select sql_no_cache a from t1);
+a
+1
+2
+3
+select sql_cache * from t1 where a IN (select a from t1 union select sql_no_cache a from t1);
+a
+1
+2
+3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
@@ -1256,6 +1301,7 @@ drop procedure f3;
drop procedure f4;
drop table t1;
set GLOBAL query_cache_size=0;
+End of 4.1 tests
SET GLOBAL query_cache_size=102400;
create table t1(a int);
insert into t1 values(0), (1), (4), (5);
@@ -1343,3 +1389,347 @@ c1
100
drop table t1;
set global query_cache_size=0;
+create table t1 (a int);
+insert into t1 values (1),(2),(3);
+set GLOBAL query_cache_type=1;
+set GLOBAL query_cache_limit=10000;
+set GLOBAL query_cache_min_res_unit=0;
+set GLOBAL query_cache_size= 100000;
+reset query cache;
+set LOCAL default_week_format = 0;
+select week('2007-01-04');
+week('2007-01-04')
+0
+select week('2007-01-04') from t1;
+week('2007-01-04')
+0
+0
+0
+select extract(WEEK FROM '2007-01-04') from t1;
+extract(WEEK FROM '2007-01-04')
+0
+0
+0
+set LOCAL default_week_format = 2;
+select week('2007-01-04');
+week('2007-01-04')
+53
+select week('2007-01-04') from t1;
+week('2007-01-04')
+53
+53
+53
+select extract(WEEK FROM '2007-01-04') from t1;
+extract(WEEK FROM '2007-01-04')
+53
+53
+53
+reset query cache;
+set LOCAL div_precision_increment=2;
+select 1/7;
+1/7
+0.14
+select 1/7 from t1;
+1/7
+0.14
+0.14
+0.14
+set LOCAL div_precision_increment=4;
+select 1/7;
+1/7
+0.1429
+select 1/7 from t1;
+1/7
+0.1429
+0.1429
+0.1429
+drop table t1;
+CREATE TABLE t1 (a VARCHAR(200), b TEXT, FULLTEXT (a,b));
+INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'),
+('Full-text indexes', 'are called collections'),
+('Only MyISAM tables','support collections'),
+('Function MATCH ... AGAINST()','is used to do a search'),
+('Full-text search in MySQL', 'implements vector space model');
+set GLOBAL ft_boolean_syntax='+ -><()~*:""&|';
+select *, MATCH(a,b) AGAINST("+called +collections" IN BOOLEAN MODE) as x from t1;
+a b x
+MySQL has now support for full-text search 0
+Full-text indexes are called collections 1
+Only MyISAM tables support collections 0
+Function MATCH ... AGAINST() is used to do a search 0
+Full-text search in MySQL implements vector space model 0
+set GLOBAL ft_boolean_syntax='- +><()~*:""&|';
+select *, MATCH(a,b) AGAINST("+called +collections" IN BOOLEAN MODE) as x from t1;
+a b x
+MySQL has now support for full-text search 0
+Full-text indexes are called collections 0
+Only MyISAM tables support collections 0
+Function MATCH ... AGAINST() is used to do a search 0
+Full-text search in MySQL implements vector space model 0
+create function change_global() returns integer deterministic
+begin
+set global ft_boolean_syntax='+ -><()~*:""&|';
+return 1;
+end|
+select *, change_global() from t1;
+a b change_global()
+MySQL has now support for full-text search 1
+Full-text indexes are called collections 1
+Only MyISAM tables support collections 1
+Function MATCH ... AGAINST() is used to do a search 1
+Full-text search in MySQL implements vector space model 1
+drop function change_global;
+drop table t1;
+set GLOBAL query_cache_type=default;
+set GLOBAL query_cache_limit=default;
+set GLOBAL query_cache_min_res_unit=default;
+set GLOBAL query_cache_size= default;
+set GLOBAL query_cache_size=1000000;
+create table t1 (a char);
+insert into t1 values ('c');
+a
+drop table t1;
+set GLOBAL query_cache_size= default;
+set GLOBAL query_cache_size=1000000;
+create table t1 (a char);
+insert into t1 values ('c');
+a
+drop table t1;
+set GLOBAL query_cache_size= default;
+SET GLOBAL query_cache_size=64*1024*1024;
+CREATE TABLE t1 (id INT);
+CREATE PROCEDURE proc29856(IN theUPC TEXT)
+BEGIN
+SET @stmtStr := '';
+SELECT CONCAT("SELECT id FROM t1 WHERE id IN (",theUPC,")") INTO @stmtStr;
+PREPARE stmt FROM @stmtStr;
+EXECUTE stmt;
+END |
+CALL proc29856('1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,
+25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,
+51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,
+77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,
+102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,
+121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,
+140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,
+159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,
+178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,
+197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,
+216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,
+235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,
+254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,
+273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,
+292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,
+311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,
+330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,
+349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,
+368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,
+387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,
+406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,
+425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,
+444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,
+463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,
+482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500,
+501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,
+520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,
+539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,
+558,559,560,561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,
+577,578,579,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,
+596,597,598,599,600,601,602,603,604,605,606,607,608,609,610,611,612,613,614,
+615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,632,633,
+634,635,636,637,638,639,640,641,642,643,644,645,646,647,648,649,650,651,652,
+653,654,655,656,657,658,659,660,661,662,663,664,665,666,667,668,669,670,671,
+672,673,674,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,
+691,692,693,694,695,696,697,698,699,700,701,702,703,704,705,706,707,708,709,
+710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,
+729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,
+748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,
+767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,
+786,787,788,789,790,791,792,793,794,795,796,797,798,799,800,801,802,803,804,
+805,806,807,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,
+824,825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,
+843,844,845,846,847,848,849,850,851,852,853,854,855,856,857,858,859,860,861,
+862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879,880,
+881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,
+900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,
+919,920,921,922,923,924,925,926,927,928,929,930,931,932,933,934,935,936,937,
+938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,
+957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,
+976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,
+995,996,997,998,999,1000,1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,
+1011,1012,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023,1024,1025,
+1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,
+1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,
+1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,
+1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,
+1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,
+1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,
+1116,1117,1118,1119,1120,1121,1122,1123,1124,1125,1126,1127,1128,1129,1130,
+1131,1132,1133,1134,1135,1136,1137,1138,1139,1140,1141,1142,1143,1144,1145,
+1146,1147,1148,1149,1150,1151,1152,1153,1154,1155,1156,1157,1158,1159,1160,
+1161,1162,1163,1164,1165,1166,1167,1168,1169,1170,1171,1172,1173,1174,1175,
+1176,1177,1178,1179,1180,1181,1182,1183,1184,1185,1186,1187,1188,1189,1190,
+1191,1192,1193,1194,1195,1196,1197,1198,1199,1200,1201,1202,1203,1204,1205,
+1206,1207,1208,1209,1210,1211,1212,1213,1214,1215,1216,1217,1218,1219,1220,
+1221,1222,1223,1224,1225,1226,1227,1228,1229,1230,1231,1232,1233,1234,1235,
+1236,1237,1238,1239,1240,1241,1242,1243,1244,1245,1246,1247,1248,1249,1250,
+1251,1252,1253,1254,1255,1256,1257,1258,1259,1260,1261,1262,1263,1264,1265,
+1266,1267,1268,1269,1270,1271,1272,1273,1274,1275,1276,1277,1278,1279,1280,
+1281,1282,1283,1284,1285,1286,1287,1288,1289,1290,1291,1292,1293,1294,1295,
+1296,1297,1298,1299,1300,1301,1302,1303,1304,1305,1306,1307,1308,1309,1310,
+1311,1312,1313,1314,1315,1316,1317,1318,1319,1320,1321,1322,1323,1324,1325,
+1326,1327,1328,1329,1330,1331,1332,1333,1334,1335,1336,1337,1338,1339,1340,
+1341,1342,1343,1344,1345,1346,1347,1348,1349,1350,1351,1352,1353,1354,1355,
+1356,1357,1358,1359,1360,1361,1362,1363,1364,1365,1366,1367,1368,1369,1370,
+1371,1372,1373,1374,1375,1376,1377,1378,1379,1380,1381,1382,1383,1384,1385,
+1386,1387,1388,1389,1390,1391,1392,1393,1394,1395,1396,1397,1398,1399,1400,
+1401,1402,1403,1404,1405,1406,1407,1408,1409,1410,1411,1412,1413,1414,1415,
+1416,1417,1418,1419,1420,1421,1422,1423,1424,1425,1426,1427,1428,1429,1430,
+1431,1432,1433,1434,1435,1436,1437,1438,1439,1440,1441,1442,1443,1444,1445,
+1446,1447,1448,1449,1450,1451,1452,1453,1454,1455,1456,1457,1458,1459,1460,
+1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,
+1476,1477,1478,1479,1480,1481,1482,1483,1484,1485,1486,1487,1488,1489,1490,
+1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,
+1506,1507,1508,1509,1510,1511,1512,1513,1514,1515,1516,1517,1518,1519,1520,
+1521,1522,1523,1524,1525,1526,1527,1528,1529,1530,1531,1532,1533,1534,1535,
+1536,1537,1538,1539,1540,1541,1542,1543,1544,1545,1546,1547,1548,1549,1550,
+1551,1552,1553,1554,1555,1556,1557,1558,1559,1560,1561,1562,1563,1564,1565,
+1566,1567,1568,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,
+1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,1595,
+1596,1597,1598,1599,1600,1601,1602,1603,1604,1605,1606,1607,1608,1609,1610,
+1611,1612,1613,1614,1615,1616,1617,1618,1619,1620,1621,1622,1623,1624,1625,
+1626,1627,1628,1629,1630,1631,1632,1633,1634,1635,1636,1637,1638,1639,1640,
+1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,
+1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1669,1670,
+1671,1672,1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,
+1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,
+1701,1702,1703,1704,1705,1706,1707,1708,1709,1710,1711,1712,1713,1714,1715,
+1716,1717,1718,1719,1720,1721,1722,1723,1724,1725,1726,1727,1728,1729,1730,
+1731,1732,1733,1734,1735,1736,1737,1738,1739,1740,1741,1742,1743,1744,1745,
+1746,1747,1748,1749,1750,1751,1752,1753,1754,1755,1756,1757,1758,1759,1760,
+1761,1762,1763,1764,1765,1766,1767,1768,1769,1770,1771,1772,1773,1774,1775,
+1776,1777,1778,1779,1780,1781,1782,1783,1784,1785,1786,1787,1788,1789,1790,
+1791,1792,1793,1794,1795,1796,1797,1798,1799,1800,1801,1802,1803,1804,1805,
+1806,1807,1808,1809,1810,1811');
+id
+DROP PROCEDURE proc29856;
+DROP TABLE t1;
+SET GLOBAL query_cache_size= default;
+Bug#28249 Query Cache returns wrong result with concurrent insert/ certain lock
+set GLOBAL query_cache_type=1;
+set GLOBAL query_cache_limit=10000;
+set GLOBAL query_cache_min_res_unit=0;
+set GLOBAL query_cache_size= 100000;
+flush tables;
+drop table if exists t1, t2;
+create table t1 (a int);
+create table t2 (a int);
+insert into t1 values (1),(2),(3);
+Locking table T2 with a write lock.
+lock table t2 write;
+Select blocked by write lock.
+select *, (select count(*) from t2) from t1;;
+Sleeing is ok, because selecting should be done very fast.
+Inserting into table T1.
+insert into t1 values (4);
+Unlocking the tables.
+unlock tables;
+Collecting result from previously blocked select.
+Next select should contain 4 rows, as the insert is long finished.
+select *, (select count(*) from t2) from t1;
+a (select count(*) from t2)
+1 0
+2 0
+3 0
+4 0
+reset query cache;
+select *, (select count(*) from t2) from t1;
+a (select count(*) from t2)
+1 0
+2 0
+3 0
+4 0
+drop table t1,t2;
+DROP DATABASE IF EXISTS bug30269;
+FLUSH STATUS;
+CREATE DATABASE bug30269;
+USE bug30269;
+CREATE TABLE test1 (id int, name varchar(23));
+CREATE VIEW view1 AS SELECT * FROM test1;
+INSERT INTO test1 VALUES (5, 'testit');
+GRANT SELECT (id) ON TABLE bug30269.test1 TO 'bug30269'@'localhost';
+GRANT SELECT ON TABLE bug30269.view1 TO 'bug30269'@'localhost';
+set global query_cache_size= 81920;
+USE bug30269;
+show status like 'Qcache_queries_in_cache';
+Variable_name Value
+Qcache_queries_in_cache 0
+# Select statement not stored in query cache because of column privileges.
+SELECT id FROM test1 WHERE id>2;
+id
+5
+show status like 'Qcache_queries_in_cache';
+Variable_name Value
+Qcache_queries_in_cache 0
+SELECT id FROM view1 WHERE id>2;
+id
+5
+show status like 'Qcache_queries_in_cache';
+Variable_name Value
+Qcache_queries_in_cache 1
+DROP DATABASE bug30269;
+DROP USER 'bug30269'@'localhost';
+set GLOBAL query_cache_type=default;
+set GLOBAL query_cache_limit=default;
+set GLOBAL query_cache_min_res_unit=default;
+set GLOBAL query_cache_size=default;
+End of 5.0 tests
+drop database if exists db1;
+drop database if exists db2;
+set GLOBAL query_cache_size=15*1024*1024;
+create database db1;
+use db1;
+create table t1(c1 int)engine=myisam;
+insert into t1(c1) values (1);
+select * from db1.t1 f;
+c1
+1
+show status like 'Qcache_queries_in_cache';
+Variable_name Value
+Qcache_queries_in_cache 1
+rename schema db1 to db2;
+show status like 'Qcache_queries_in_cache';
+Variable_name Value
+Qcache_queries_in_cache 0
+drop database db2;
+set global query_cache_size=default;
+drop database if exists db1;
+drop database if exists db3;
+set GLOBAL query_cache_size=15*1024*1024;
+create database db1;
+create database db3;
+use db1;
+create table t1(c1 int) engine=myisam;
+use db3;
+create table t1(c1 int) engine=myisam;
+use db1;
+insert into t1(c1) values (1);
+use mysql;
+select * from db1.t1;
+c1
+1
+select c1+1 from db1.t1;
+c1+1
+2
+select * from db3.t1;
+c1
+show status like 'Qcache_queries_in_cache';
+Variable_name Value
+Qcache_queries_in_cache 3
+rename schema db1 to db2;
+show status like 'Qcache_queries_in_cache';
+Variable_name Value
+Qcache_queries_in_cache 1
+drop database db2;
+drop database db3;
+End of 5.1 tests
diff --git a/mysql-test/r/query_cache_ps_no_prot.result b/mysql-test/r/query_cache_ps_no_prot.result
new file mode 100644
index 00000000000..0efb2540c64
--- /dev/null
+++ b/mysql-test/r/query_cache_ps_no_prot.result
@@ -0,0 +1,533 @@
+---- establish connection con1 (root) ----
+---- switch to connection default ----
+set @initial_query_cache_size = @@global.query_cache_size;
+set @@global.query_cache_size=100000;
+flush status;
+drop table if exists t1;
+create table t1(c1 int);
+insert into t1 values(1),(10),(100);
+prepare stmt1 from "select * from t1 where c1=10";
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 0
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 0
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 1
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 2
+prepare stmt2 from "select * from t1 where c1=10";
+execute stmt2;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 3
+execute stmt2;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 4
+execute stmt2;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 5
+---- switch to connection con1 ----
+prepare stmt3 from "select * from t1 where c1=10";
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 6
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 7
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 8
+---- switch to connection default ----
+prepare stmt10 from "SELECT * FROM t1 WHERE c1 = 100";
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 8
+execute stmt10;
+c1
+100
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 8
+execute stmt10;
+c1
+100
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 9
+SELECT * FROM t1 WHERE c1 = 100;
+c1
+100
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 10
+---- switch to connection con1 ----
+SELECT * FROM t1 WHERE c1 = 100;
+c1
+100
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 11
+---- switch to connection default ----
+prepare stmt11 from "SELECT * FROM t1 WHERE c1 = 1";
+---- switch to connection con1 ----
+prepare stmt12 from "SELECT * FROM t1 WHERE c1 = 1";
+---- switch to connection default ----
+SELECT * FROM t1 WHERE c1 = 1;
+c1
+1
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 11
+SELECT * FROM t1 WHERE c1 = 1;
+c1
+1
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 12
+execute stmt11;
+c1
+1
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 13
+---- switch to connection con1 ----
+execute stmt12;
+c1
+1
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 14
+---- switch to connection default ----
+prepare stmt1 from "select * from t1 where c1=?";
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 14
+set @a=1;
+execute stmt1 using @a;
+c1
+1
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 14
+execute stmt1 using @a;
+c1
+1
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 15
+---- switch to connection con1 ----
+set @a=1;
+prepare stmt4 from "select * from t1 where c1=?";
+execute stmt4 using @a;
+c1
+1
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 16
+prepare stmt4 from "select @a from t1 where c1=?";
+execute stmt4 using @a;
+@a
+1
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 16
+execute stmt4 using @a;
+@a
+1
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 16
+---- switch to connection default ----
+prepare stmt1 from "select * from t1 where c1=10";
+set global query_cache_size=0;
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 16
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 16
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 16
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 16
+---- switch to connection con1 ----
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 16
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 16
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 16
+---- switch to connection default ----
+set global query_cache_size=100000;
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 16
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 17
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 18
+---- switch to connection con1 ----
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 19
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 20
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 21
+---- switch to connection default ----
+set global query_cache_size=0;
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 21
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 21
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 21
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 21
+---- switch to connection con1 ----
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 21
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 21
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 21
+---- switch to connection default ----
+set global query_cache_size=0;
+prepare stmt1 from "select * from t1 where c1=10";
+---- switch to connection con1 ----
+prepare stmt3 from "select * from t1 where c1=10";
+---- switch to connection default ----
+set global query_cache_size=100000;
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 21
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 21
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 21
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 21
+---- switch to connection con1 ----
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 21
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 21
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 21
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 21
+---- switch to connection default ----
+set global query_cache_size=0;
+prepare stmt1 from "select * from t1 where c1=?";
+set global query_cache_size=100000;
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 21
+set @a=1;
+execute stmt1 using @a;
+c1
+1
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 21
+set @a=100;
+execute stmt1 using @a;
+c1
+100
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 21
+set @a=10;
+execute stmt1 using @a;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 21
+drop table t1;
+---- disconnect connection con1 ----
+########################################################################
+#
+# BUG#25843: Changing default database between PREPARE and EXECUTE of
+# statement breaks binlog.
+#
+########################################################################
+
+#
+# Check that default database and its attributes are fixed at the
+# creation time.
+#
+
+DROP DATABASE IF EXISTS mysqltest1;
+DROP DATABASE IF EXISTS mysqltest2;
+
+CREATE DATABASE mysqltest1 COLLATE utf8_unicode_ci;
+CREATE DATABASE mysqltest2 COLLATE utf8_general_ci;
+
+CREATE TABLE mysqltest1.t1(msg VARCHAR(255));
+CREATE TABLE mysqltest2.t1(msg VARCHAR(255));
+
+use mysqltest1;
+PREPARE stmt_a_1 FROM 'INSERT INTO t1 VALUES(DATABASE())';
+PREPARE stmt_a_2 FROM 'INSERT INTO t1 VALUES(@@collation_database)';
+
+EXECUTE stmt_a_1;
+EXECUTE stmt_a_2;
+
+use mysqltest2;
+EXECUTE stmt_a_1;
+EXECUTE stmt_a_2;
+
+SELECT * FROM mysqltest1.t1;
+msg
+mysqltest1
+utf8_unicode_ci
+mysqltest1
+utf8_unicode_ci
+
+SELECT * FROM mysqltest2.t1;
+msg
+
+DROP PREPARE stmt_a_1;
+DROP PREPARE stmt_a_2;
+
+#
+# The Query Cache test case.
+#
+
+DELETE FROM mysqltest1.t1;
+DELETE FROM mysqltest2.t1;
+
+INSERT INTO mysqltest1.t1 VALUES('mysqltest1.t1');
+INSERT INTO mysqltest2.t1 VALUES('mysqltest2.t1');
+
+use mysqltest1;
+PREPARE stmt_b_1 FROM 'SELECT * FROM t1';
+
+use mysqltest2;
+PREPARE stmt_b_2 FROM 'SELECT * FROM t1';
+
+EXECUTE stmt_b_1;
+msg
+mysqltest1.t1
+
+EXECUTE stmt_b_2;
+msg
+mysqltest2.t1
+
+use mysqltest1;
+
+EXECUTE stmt_b_1;
+msg
+mysqltest1.t1
+
+EXECUTE stmt_b_2;
+msg
+mysqltest2.t1
+
+DROP PREPARE stmt_b_1;
+DROP PREPARE stmt_b_2;
+
+use test;
+
+DROP DATABASE mysqltest1;
+DROP DATABASE mysqltest2;
+
+#
+# Check that prepared statements work properly when there is no current
+# database.
+#
+
+CREATE DATABASE mysqltest1 COLLATE utf8_unicode_ci;
+CREATE DATABASE mysqltest2 COLLATE utf8_general_ci;
+
+use mysqltest1;
+
+PREPARE stmt_c_1 FROM 'SELECT DATABASE(), @@collation_database';
+
+use mysqltest2;
+
+PREPARE stmt_c_2 FROM 'SELECT DATABASE(), @@collation_database';
+
+DROP DATABASE mysqltest2;
+
+SELECT DATABASE(), @@collation_database;
+DATABASE() @@collation_database
+NULL latin1_swedish_ci
+
+EXECUTE stmt_c_1;
+DATABASE() @@collation_database
+mysqltest1 utf8_unicode_ci
+
+SELECT DATABASE(), @@collation_database;
+DATABASE() @@collation_database
+NULL latin1_swedish_ci
+
+EXECUTE stmt_c_2;
+DATABASE() @@collation_database
+NULL latin1_swedish_ci
+Warnings:
+Note 1049 Unknown database 'mysqltest2'
+
+SELECT DATABASE(), @@collation_database;
+DATABASE() @@collation_database
+NULL latin1_swedish_ci
+
+PREPARE stmt_c_3 FROM 'SELECT DATABASE(), @@collation_database';
+
+EXECUTE stmt_c_3;
+DATABASE() @@collation_database
+NULL latin1_swedish_ci
+
+use mysqltest1;
+
+EXECUTE stmt_c_2;
+DATABASE() @@collation_database
+NULL latin1_swedish_ci
+Warnings:
+Note 1049 Unknown database 'mysqltest2'
+
+SELECT DATABASE(), @@collation_database;
+DATABASE() @@collation_database
+mysqltest1 utf8_unicode_ci
+
+EXECUTE stmt_c_3;
+DATABASE() @@collation_database
+NULL latin1_swedish_ci
+
+SELECT DATABASE(), @@collation_database;
+DATABASE() @@collation_database
+mysqltest1 utf8_unicode_ci
+
+DROP DATABASE mysqltest1;
+
+use test;
+
+########################################################################
+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
new file mode 100644
index 00000000000..dc0c4a0193a
--- /dev/null
+++ b/mysql-test/r/query_cache_ps_ps_prot.result
@@ -0,0 +1,533 @@
+---- establish connection con1 (root) ----
+---- switch to connection default ----
+set @initial_query_cache_size = @@global.query_cache_size;
+set @@global.query_cache_size=100000;
+flush status;
+drop table if exists t1;
+create table t1(c1 int);
+insert into t1 values(1),(10),(100);
+prepare stmt1 from "select * from t1 where c1=10";
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 0
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 0
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 1
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 2
+prepare stmt2 from "select * from t1 where c1=10";
+execute stmt2;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 3
+execute stmt2;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 4
+execute stmt2;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 5
+---- switch to connection con1 ----
+prepare stmt3 from "select * from t1 where c1=10";
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 6
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 7
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 8
+---- switch to connection default ----
+prepare stmt10 from "SELECT * FROM t1 WHERE c1 = 100";
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 8
+execute stmt10;
+c1
+100
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 8
+execute stmt10;
+c1
+100
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 9
+SELECT * FROM t1 WHERE c1 = 100;
+c1
+100
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 9
+---- switch to connection con1 ----
+SELECT * FROM t1 WHERE c1 = 100;
+c1
+100
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 10
+---- switch to connection default ----
+prepare stmt11 from "SELECT * FROM t1 WHERE c1 = 1";
+---- switch to connection con1 ----
+prepare stmt12 from "SELECT * FROM t1 WHERE c1 = 1";
+---- switch to connection default ----
+SELECT * FROM t1 WHERE c1 = 1;
+c1
+1
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 10
+SELECT * FROM t1 WHERE c1 = 1;
+c1
+1
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 11
+execute stmt11;
+c1
+1
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 11
+---- switch to connection con1 ----
+execute stmt12;
+c1
+1
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 12
+---- switch to connection default ----
+prepare stmt1 from "select * from t1 where c1=?";
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 12
+set @a=1;
+execute stmt1 using @a;
+c1
+1
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 12
+execute stmt1 using @a;
+c1
+1
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 13
+---- switch to connection con1 ----
+set @a=1;
+prepare stmt4 from "select * from t1 where c1=?";
+execute stmt4 using @a;
+c1
+1
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 14
+prepare stmt4 from "select @a from t1 where c1=?";
+execute stmt4 using @a;
+@a
+1
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 14
+execute stmt4 using @a;
+@a
+1
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 14
+---- switch to connection default ----
+prepare stmt1 from "select * from t1 where c1=10";
+set global query_cache_size=0;
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 14
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 14
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 14
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 14
+---- switch to connection con1 ----
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 14
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 14
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 14
+---- switch to connection default ----
+set global query_cache_size=100000;
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 14
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 15
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 16
+---- switch to connection con1 ----
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 17
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 18
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 19
+---- switch to connection default ----
+set global query_cache_size=0;
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 19
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 19
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 19
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 19
+---- switch to connection con1 ----
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 19
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 19
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 19
+---- switch to connection default ----
+set global query_cache_size=0;
+prepare stmt1 from "select * from t1 where c1=10";
+---- switch to connection con1 ----
+prepare stmt3 from "select * from t1 where c1=10";
+---- switch to connection default ----
+set global query_cache_size=100000;
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 19
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 19
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 19
+execute stmt1;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 19
+---- switch to connection con1 ----
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 19
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 19
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 19
+execute stmt3;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 19
+---- switch to connection default ----
+set global query_cache_size=0;
+prepare stmt1 from "select * from t1 where c1=?";
+set global query_cache_size=100000;
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 19
+set @a=1;
+execute stmt1 using @a;
+c1
+1
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 19
+set @a=100;
+execute stmt1 using @a;
+c1
+100
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 19
+set @a=10;
+execute stmt1 using @a;
+c1
+10
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 19
+drop table t1;
+---- disconnect connection con1 ----
+########################################################################
+#
+# BUG#25843: Changing default database between PREPARE and EXECUTE of
+# statement breaks binlog.
+#
+########################################################################
+
+#
+# Check that default database and its attributes are fixed at the
+# creation time.
+#
+
+DROP DATABASE IF EXISTS mysqltest1;
+DROP DATABASE IF EXISTS mysqltest2;
+
+CREATE DATABASE mysqltest1 COLLATE utf8_unicode_ci;
+CREATE DATABASE mysqltest2 COLLATE utf8_general_ci;
+
+CREATE TABLE mysqltest1.t1(msg VARCHAR(255));
+CREATE TABLE mysqltest2.t1(msg VARCHAR(255));
+
+use mysqltest1;
+PREPARE stmt_a_1 FROM 'INSERT INTO t1 VALUES(DATABASE())';
+PREPARE stmt_a_2 FROM 'INSERT INTO t1 VALUES(@@collation_database)';
+
+EXECUTE stmt_a_1;
+EXECUTE stmt_a_2;
+
+use mysqltest2;
+EXECUTE stmt_a_1;
+EXECUTE stmt_a_2;
+
+SELECT * FROM mysqltest1.t1;
+msg
+mysqltest1
+utf8_unicode_ci
+mysqltest1
+utf8_unicode_ci
+
+SELECT * FROM mysqltest2.t1;
+msg
+
+DROP PREPARE stmt_a_1;
+DROP PREPARE stmt_a_2;
+
+#
+# The Query Cache test case.
+#
+
+DELETE FROM mysqltest1.t1;
+DELETE FROM mysqltest2.t1;
+
+INSERT INTO mysqltest1.t1 VALUES('mysqltest1.t1');
+INSERT INTO mysqltest2.t1 VALUES('mysqltest2.t1');
+
+use mysqltest1;
+PREPARE stmt_b_1 FROM 'SELECT * FROM t1';
+
+use mysqltest2;
+PREPARE stmt_b_2 FROM 'SELECT * FROM t1';
+
+EXECUTE stmt_b_1;
+msg
+mysqltest1.t1
+
+EXECUTE stmt_b_2;
+msg
+mysqltest2.t1
+
+use mysqltest1;
+
+EXECUTE stmt_b_1;
+msg
+mysqltest1.t1
+
+EXECUTE stmt_b_2;
+msg
+mysqltest2.t1
+
+DROP PREPARE stmt_b_1;
+DROP PREPARE stmt_b_2;
+
+use test;
+
+DROP DATABASE mysqltest1;
+DROP DATABASE mysqltest2;
+
+#
+# Check that prepared statements work properly when there is no current
+# database.
+#
+
+CREATE DATABASE mysqltest1 COLLATE utf8_unicode_ci;
+CREATE DATABASE mysqltest2 COLLATE utf8_general_ci;
+
+use mysqltest1;
+
+PREPARE stmt_c_1 FROM 'SELECT DATABASE(), @@collation_database';
+
+use mysqltest2;
+
+PREPARE stmt_c_2 FROM 'SELECT DATABASE(), @@collation_database';
+
+DROP DATABASE mysqltest2;
+
+SELECT DATABASE(), @@collation_database;
+DATABASE() @@collation_database
+NULL latin1_swedish_ci
+
+EXECUTE stmt_c_1;
+DATABASE() @@collation_database
+mysqltest1 utf8_unicode_ci
+
+SELECT DATABASE(), @@collation_database;
+DATABASE() @@collation_database
+NULL latin1_swedish_ci
+
+EXECUTE stmt_c_2;
+DATABASE() @@collation_database
+NULL latin1_swedish_ci
+Warnings:
+Note 1049 Unknown database 'mysqltest2'
+
+SELECT DATABASE(), @@collation_database;
+DATABASE() @@collation_database
+NULL latin1_swedish_ci
+
+PREPARE stmt_c_3 FROM 'SELECT DATABASE(), @@collation_database';
+
+EXECUTE stmt_c_3;
+DATABASE() @@collation_database
+NULL latin1_swedish_ci
+
+use mysqltest1;
+
+EXECUTE stmt_c_2;
+DATABASE() @@collation_database
+NULL latin1_swedish_ci
+Warnings:
+Note 1049 Unknown database 'mysqltest2'
+
+SELECT DATABASE(), @@collation_database;
+DATABASE() @@collation_database
+mysqltest1 utf8_unicode_ci
+
+EXECUTE stmt_c_3;
+DATABASE() @@collation_database
+NULL latin1_swedish_ci
+
+SELECT DATABASE(), @@collation_database;
+DATABASE() @@collation_database
+mysqltest1 utf8_unicode_ci
+
+DROP DATABASE mysqltest1;
+
+use test;
+
+########################################################################
+set @@global.query_cache_size=@initial_query_cache_size;
+flush status;
diff --git a/mysql-test/r/query_cache_sql_prepare.result b/mysql-test/r/query_cache_sql_prepare.result
deleted file mode 100644
index 64af5bc4ec2..00000000000
--- a/mysql-test/r/query_cache_sql_prepare.result
+++ /dev/null
@@ -1,204 +0,0 @@
-set global query_cache_size=100000;
-flush status;
-create table t1(c1 int);
-insert into t1 values(1),(10),(100);
-prepare stmt1 from "select * from t1 where c1=10";
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 0
-execute stmt1;
-c1
-10
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 0
-execute stmt1;
-c1
-10
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 1
-execute stmt1;
-c1
-10
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 2
-prepare stmt2 from "select * from t1 where c1=10";
-execute stmt2;
-c1
-10
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 3
-execute stmt2;
-c1
-10
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 4
-execute stmt2;
-c1
-10
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 5
-prepare stmt3 from "select * from t1 where c1=10";
-execute stmt3;
-c1
-10
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 6
-execute stmt3;
-c1
-10
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 7
-execute stmt3;
-c1
-10
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 8
-select * from t1 where c1=10;
-c1
-10
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 9
-flush tables;
-execute stmt1;
-c1
-10
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 9
-select * from t1 where c1=10;
-c1
-10
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 10
-prepare stmt1 from "select * from t1 where c1=?";
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 10
-set @a=1;
-execute stmt1 using @a;
-c1
-1
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 10
-set @a=100;
-execute stmt1 using @a;
-c1
-100
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 10
-set @a=10;
-execute stmt1 using @a;
-c1
-10
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 10
-prepare stmt1 from "select * from t1 where c1=10";
-set global query_cache_size=0;
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 10
-execute stmt1;
-c1
-10
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 10
-execute stmt1;
-c1
-10
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 10
-execute stmt1;
-c1
-10
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 10
-set global query_cache_size=100000;
-execute stmt1;
-c1
-10
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 10
-execute stmt1;
-c1
-10
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 11
-execute stmt1;
-c1
-10
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 12
-set global query_cache_size=0;
-prepare stmt1 from "select * from t1 where c1=10";
-set global query_cache_size=100000;
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 12
-execute stmt1;
-c1
-10
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 12
-execute stmt1;
-c1
-10
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 12
-execute stmt1;
-c1
-10
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 12
-set global query_cache_size=0;
-prepare stmt1 from "select * from t1 where c1=?";
-set global query_cache_size=100000;
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 12
-set @a=1;
-execute stmt1 using @a;
-c1
-1
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 12
-set @a=100;
-execute stmt1 using @a;
-c1
-100
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 12
-set @a=10;
-execute stmt1 using @a;
-c1
-10
-show status like 'Qcache_hits';
-Variable_name Value
-Qcache_hits 12
-drop table t1;
-set global query_cache_size=0;
-flush status;
diff --git a/mysql-test/r/view_query_cache.result b/mysql-test/r/query_cache_with_views.result
index 03430bd504b..03430bd504b 100644
--- a/mysql-test/r/view_query_cache.result
+++ b/mysql-test/r/query_cache_with_views.result
diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result
index c2cb7426a74..108264b3bf2 100644
--- a/mysql-test/r/range.result
+++ b/mysql-test/r/range.result
@@ -220,28 +220,28 @@ insert into t1 (x) values (1),(2),(3),(4),(5),(6),(7),(8),(9);
update t1 set y=x;
explain select * from t1, t1 t2 where t1.y = 8 and t2.x between 7 and t1.y+0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref y y 5 const 1 Using where; Using join cache
-1 SIMPLE t2 range x x 5 NULL 2 Using where
+1 SIMPLE t1 ref y y 5 const 1 Using where
+1 SIMPLE t2 range x x 5 NULL 2 Using where; Using join buffer
explain select * from t1, t1 t2 where t1.y = 8 and t2.x >= 7 and t2.x <= t1.y+0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref y y 5 const 1 Using where; Using join cache
-1 SIMPLE t2 range x x 5 NULL 2 Using where
+1 SIMPLE t1 ref y y 5 const 1 Using where
+1 SIMPLE t2 range x x 5 NULL 2 Using where; Using join buffer
explain select * from t1, t1 t2 where t1.y = 2 and t2.x between t1.y-1 and t1.y+1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref y y 5 const 1 Using where; Using join cache
-1 SIMPLE t2 range x x 5 NULL 3 Using where
+1 SIMPLE t1 ref y y 5 const 1 Using where
+1 SIMPLE t2 range x x 5 NULL 3 Using where; Using join buffer
explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= t1.y-1 and t2.x <= t1.y+1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref y y 5 const 1 Using where; Using join cache
-1 SIMPLE t2 range x x 5 NULL 3 Using where
+1 SIMPLE t1 ref y y 5 const 1 Using where
+1 SIMPLE t2 range x x 5 NULL 3 Using where; Using join buffer
explain select * from t1, t1 t2 where t1.y = 2 and t2.x between 0 and t1.y;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref y y 5 const 1 Using where; Using join cache
-1 SIMPLE t2 range x x 5 NULL 2 Using where
+1 SIMPLE t1 ref y y 5 const 1 Using where
+1 SIMPLE t2 range x x 5 NULL 2 Using where; Using join buffer
explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= 0 and t2.x <= t1.y;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref y y 5 const 1 Using where; Using join cache
-1 SIMPLE t2 range x x 5 NULL 2 Using where
+1 SIMPLE t1 ref y y 5 const 1 Using where
+1 SIMPLE t2 range x x 5 NULL 2 Using where; Using join buffer
explain select count(*) from t1 where x in (1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref x x 5 const 1 Using where; Using index
@@ -255,13 +255,13 @@ CREATE TABLE t2 (keya int(11) NOT NULL default '0', KEY j1 (keya));
INSERT INTO t2 VALUES (0),(0),(1),(1),(2),(2);
explain select * from t1, t2 where (t1.key1 <t2.keya + 1) and t2.keya=3;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ref j1 j1 4 const 1 Using index; Using join cache
-1 SIMPLE t1 index i1 i1 4 NULL 7 Using where; Using index
+1 SIMPLE t2 ref j1 j1 4 const 1 Using index
+1 SIMPLE t1 index i1 i1 4 NULL 7 Using where; Using index; Using join buffer
explain select * from t1 force index(i1), t2 force index(j1) where
(t1.key1 <t2.keya + 1) and t2.keya=3;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ref j1 j1 4 const 1 Using index; Using join cache
-1 SIMPLE t1 index i1 i1 4 NULL 7 Using where; Using index
+1 SIMPLE t2 ref j1 j1 4 const 1 Using index
+1 SIMPLE t1 index i1 i1 4 NULL 7 Using where; Using index; Using join buffer
DROP TABLE t1,t2;
CREATE TABLE t1 (
a int(11) default NULL,
diff --git a/mysql-test/r/read_many_rows_innodb.result b/mysql-test/r/read_many_rows_innodb.result
index ff11535f687..29ec509db5a 100644
--- a/mysql-test/r/read_many_rows_innodb.result
+++ b/mysql-test/r/read_many_rows_innodb.result
@@ -33,3 +33,69 @@ SELECT SUM(id) FROM t3;
SUM(id)
2199024304128
DROP TABLE t1,t2,t3,t4;
+CREATE TABLE t1 (f1 int NOT NULL) ENGINE=InnoDB;
+CREATE TABLE t2 (f2 int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+CREATE TRIGGER t1_bi before INSERT
+ON t1 FOR EACH ROW
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLSTATE '40001' SET @a:= 'deadlock';
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET @a:= 'exception';
+INSERT INTO t2 (f2) VALUES (1);
+DELETE FROM t2 WHERE f2 = 1;
+END;|
+CREATE PROCEDURE proc24989()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLSTATE '40001' SET @b:= 'deadlock';
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET @a:= 'exception';
+INSERT INTO t2 (f2) VALUES (1);
+DELETE FROM t2 WHERE f2 = 1;
+END;|
+create procedure proc24989_2()
+deterministic
+begin
+declare continue handler for sqlexception
+select 'Outer handler' as 'exception';
+insert into t1 values(1);
+select "continued";
+end|
+start transaction;
+insert into t1 values(1);
+start transaction;
+insert into t2 values(123);
+insert into t1 values(1);
+insert into t1 values(1);
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+select @a;
+@a
+NULL
+select * from t2;
+f2
+commit;
+start transaction;
+insert into t1 values(1);
+start transaction;
+insert into t2 values(123);
+call proc24989();
+insert into t1 values(1);
+select @a,@b;
+@a @b
+exception deadlock
+select * from t2;
+f2
+commit;
+start transaction;
+insert into t1 values(1);
+start transaction;
+insert into t2 values(123);
+call proc24989_2();
+insert into t1 values(1);
+commit;
+exception
+Outer handler
+continued
+continued
+select * from t2;
+f2
+drop procedure proc24989;
+drop procedure proc24989_2;
+drop table t1,t2;
diff --git a/mysql-test/r/repair.result b/mysql-test/r/repair.result
index 1269c4c85a9..7fc09c43f4b 100644
--- a/mysql-test/r/repair.result
+++ b/mysql-test/r/repair.result
@@ -26,16 +26,14 @@ t1 1 st_key 1 st A NULL NULL NULL YES BTREE disabled
drop table t1;
repair table t1 use_frm;
Table Op Msg_type Msg_text
-test.t1 repair error Table 'test.t1' doesn't exist
-Warnings:
-Error 1146 Table 'test.t1' doesn't exist
+test.t1 repair Error Table 'test.t1' doesn't exist
+test.t1 repair error Corrupt
create table t1 engine=myisam SELECT 1,"table 1";
flush tables;
repair table t1;
Table Op Msg_type Msg_text
-test.t1 repair error Incorrect file format 't1'
-Warnings:
-Error 130 Incorrect file format 't1'
+test.t1 repair Error Incorrect file format 't1'
+test.t1 repair error Corrupt
repair table t1 use_frm;
Table Op Msg_type Msg_text
test.t1 repair warning Number of rows changed from 0 to 1
@@ -79,12 +77,12 @@ INSERT INTO t1 VALUES
('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
('0'),('0'),('0'),('0'),('0'),('0'),('0');
Warnings:
-Error 1034 sort_buffer_size is to small
+Error 1034 myisam_sort_buffer_size is too small
Error 1034 Number of rows changed from 0 to 157
SET myisam_repair_threads=2;
REPAIR TABLE t1;
Table Op Msg_type Msg_text
-test.t1 repair error sort_buffer_size is to small
+test.t1 repair error myisam_sort_buffer_size is too small
test.t1 repair warning Number of rows changed from 0 to 157
test.t1 repair status OK
SET myisam_repair_threads=@@global.myisam_repair_threads;
diff --git a/mysql-test/r/row.result b/mysql-test/r/row.result
index 684aee864b3..d3d7988316e 100644
--- a/mysql-test/r/row.result
+++ b/mysql-test/r/row.result
@@ -376,8 +376,8 @@ a b a b c
3 2 3 1 3
EXPLAIN EXTENDED SELECT * FROM t1,t2 WHERE (t1.a-1,t1.b)=(t2.a-1,t2.b+1);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 index NULL PRIMARY 8 NULL 6 100.00 Using index; Using join cache
-1 SIMPLE t2 index NULL PRIMARY 12 NULL 7 100.00 Using where; Using index
+1 SIMPLE t1 index NULL PRIMARY 8 NULL 6 100.00 Using index
+1 SIMPLE t2 index NULL PRIMARY 12 NULL 7 100.00 Using where; Using index; Using join buffer
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where (((`test`.`t1`.`a` - 1) = (`test`.`t2`.`a` - 1)) and (`test`.`t1`.`b` = (`test`.`t2`.`b` + 1)))
SELECT * FROM t1,t2 WHERE (t1.a-1,t1.b)=(t2.a-1,t2.b+1);
diff --git a/mysql-test/r/rpl_000015.result b/mysql-test/r/rpl_000015.result
deleted file mode 100644
index 8d23136420f..00000000000
--- a/mysql-test/r/rpl_000015.result
+++ /dev/null
@@ -1,34 +0,0 @@
-reset master;
-show master status;
-File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 106
-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
-change master to master_host='127.0.0.1';
-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
-# 127.0.0.1 test DEFAULT_MASTER_PORT 7 4 # # No No 0 0 0 # None 0 No # No
-change master to master_host='127.0.0.1',master_user='root',
-master_password='',master_port=MASTER_PORT;
-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
-# 127.0.0.1 root MASTER_PORT 7 4 # # No No 0 0 0 # None 0 No # No
-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
-# 127.0.0.1 root MASTER_PORT 7 master-bin.000001 106 # # master-bin.000001 Yes Yes 0 0 106 # None 0 No # No
-drop table if exists t1;
-create table t1 (n int, PRIMARY KEY(n));
-insert into t1 values (10),(45),(90);
-SELECT * FROM t1 ORDER BY n;
-n
-10
-45
-90
-SELECT * FROM t1 ORDER BY n;
-n
-10
-45
-90
-drop table t1;
diff --git a/mysql-test/r/rpl_change_master.result b/mysql-test/r/rpl_change_master.result
deleted file mode 100644
index 680328bcea5..00000000000
--- a/mysql-test/r/rpl_change_master.result
+++ /dev/null
@@ -1,26 +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(n int);
-select * from t1;
-n
-stop slave sql_thread;
-insert into t1 values(1);
-insert into t1 values(2);
-stop 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
-# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 191 # None 0 No # No
-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
-# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 191 # None 0 No # No
-start slave;
-select * from t1;
-n
-1
-2
-drop table t1;
diff --git a/mysql-test/r/rpl_colSize.result b/mysql-test/r/rpl_colSize.result
new file mode 100644
index 00000000000..91456742833
--- /dev/null
+++ b/mysql-test/r/rpl_colSize.result
@@ -0,0 +1,179 @@
+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;
+DROP TABLE IF EXISTS t1;
+**** Testing WL#3228 changes. ****
+*** Create "wider" table on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t1 (
+a float (47),
+b double (143,9),
+c decimal (65,30),
+d numeric (4,0),
+e bit (32),
+f char (21),
+g varchar (1300),
+h binary (33),
+j varbinary (200),
+k enum ('5','6','7', '8','9','0'),
+l set ('1','2','3','4','5','6','7','8','9','0','11','12','13','14','15','16','17','18','19','21','22','23','24','25','26','27','28','29'),
+m TINYBLOB,
+n BLOB,
+o MEDIUMBLOB,
+p LONGBLOB,
+q TINYTEXT,
+r TEXT,
+s MEDIUMTEXT,
+t LONGTEXT
+);
+*** Create same table on master but with narrow columns ***
+CREATE TABLE t1 (
+a float (44),
+b double (10,3),
+c decimal (10,2),
+d numeric (3,0),
+e bit (16),
+f char (10),
+g varchar (100),
+h binary (20),
+j varbinary (20),
+k enum ('5','6','7'),
+l set ('1','2','3','4','5','6','7','8','9','0'),
+m TINYBLOB,
+n BLOB,
+o MEDIUMBLOB,
+p LONGBLOB,
+q TINYTEXT,
+r TEXT,
+s MEDIUMTEXT,
+t LONGTEXT
+);
+RESET MASTER;
+*** Start replication ***
+START SLAVE;
+*** Insert data on master and display it. ***
+INSERT INTO t1 () VALUES (
+17.567,
+2.123,
+10.20,
+125,
+hex(64),
+'TEST',
+'This is a test',
+'binary data',
+'more binary data',
+'6',
+'7',
+"blob 1",
+"blob 2",
+"blob 3",
+"blob 4",
+"text 1",
+"text 2",
+"text 3",
+"text 4");
+SELECT * FROM t1 ORDER BY a;
+a b c d e f g h j k l m n o p q r s t
+17.567 2.123 10.20 125 # TEST This is a test # more binary data 6 7 blob 1 blob 2 blob 3 blob 4 text 1 text 2 text 3 text 4
+*** Select data from slave to compare ***
+SELECT * FROM t1 ORDER BY a;
+a b c d e f g h j k l m n o p q r s t
+17.567 2.123000000 10.200000000000000000000000000000 125 # TEST This is a test # more binary data 6 7 blob 1 blob 2 blob 3 blob 4 text 1 text 2 text 3 text 4
+DROP TABLE t1;
+Create varchar table on master
+CREATE TABLE t1 (
+a VARCHAR(50),
+b VARCHAR(100),
+c VARCHAR(300),
+d CHAR(5)
+);
+Alter varchar table on slave
+ALTER TABLE t1 CHANGE COLUMN a a VARCHAR(100);
+ALTER TABLE t1 CHANGE COLUMN b b VARCHAR(400);
+ALTER TABLE t1 CHANGE COLUMN c c VARCHAR(500);
+ALTER TABLE t1 CHANGE COLUMN d d CHAR(100);
+Insert some values and select them on master
+INSERT INTO t1 VALUES ("This is a test of col a.",
+"This is another test of col b.",
+"This is a test of the large col c.",
+"Col d");
+SELECT * FROM t1;
+a b c d
+This is a test of col a. This is another test of col b. This is a test of the large col c. Col d
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(50) DEFAULT NULL,
+ `b` varchar(100) DEFAULT NULL,
+ `c` varchar(300) DEFAULT NULL,
+ `d` char(5) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+Insert some values and select them on slave
+SELECT * FROM t1;
+a b c d
+This is a test of col a. This is another test of col b. This is a test of the large col c. Col d
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(100) DEFAULT NULL,
+ `b` varchar(400) DEFAULT NULL,
+ `c` varchar(500) DEFAULT NULL,
+ `d` char(100) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+Create bit table on master
+CREATE TABLE t1 (
+a BIT(7),
+b BIT(8),
+c BIT(21),
+d BIT(11),
+e BIT(11)
+);
+Create bit table on slave
+DROP TABLE t1;
+CREATE TABLE t1 (
+a BIT(16),
+b BIT(22),
+c BIT(54),
+d BIT(25),
+e BIT(13)
+);
+Insert some values and select them on master
+INSERT INTO t1 VALUES (
+b'1010101',
+b'10101011',
+b'101010110101010101111',
+b'10101010101',
+b'10101011111'
+ );
+SELECT BIN(a), BIN(b), BIN(c), BIN(d), BIN(e) FROM t1;
+BIN(a) BIN(b) BIN(c) BIN(d) BIN(e)
+1010101 10101011 101010110101010101111 10101010101 10101011111
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` bit(7) DEFAULT NULL,
+ `b` bit(8) DEFAULT NULL,
+ `c` bit(21) DEFAULT NULL,
+ `d` bit(11) DEFAULT NULL,
+ `e` bit(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+Insert some values and select them on master
+SELECT BIN(a), BIN(b), BIN(c), BIN(d), BIN(e) FROM t1;
+BIN(a) BIN(b) BIN(c) BIN(d) BIN(e)
+1010101 10101011 101010110101010101111 10101010101 10101011111
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` bit(16) DEFAULT NULL,
+ `b` bit(22) DEFAULT NULL,
+ `c` bit(54) DEFAULT NULL,
+ `d` bit(25) DEFAULT NULL,
+ `e` bit(13) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+*** Cleanup ***
+DROP TABLE t1;
diff --git a/mysql-test/r/rpl_deadlock_innodb.result b/mysql-test/r/rpl_deadlock_innodb.result
deleted file mode 100644
index 914e1497094..00000000000
--- a/mysql-test/r/rpl_deadlock_innodb.result
+++ /dev/null
@@ -1,199 +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 (a INT NOT NULL, KEY(a)) ENGINE=innodb;
-CREATE TABLE t2 (a INT NOT NULL, KEY(a)) ENGINE=innodb;
-CREATE TABLE t3 (a INT UNIQUE) ENGINE=innodb;
-CREATE TABLE t4 (a INT) ENGINE=innodb;
-show variables like 'slave_transaction_retries';
-Variable_name Value
-slave_transaction_retries 10
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- KEY `a` (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) NOT NULL,
- KEY `a` (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-show variables like 'slave_transaction_retries';
-Variable_name Value
-slave_transaction_retries 2
-stop slave;
-begin;
-insert into t2 values (0);
-insert into t1 values(1);
-commit;
-begin;
-select * from t1 for update;
-a
-start slave;
-select * from t2 for update /* dl */;
-a
-commit;
-select * from t1;
-a
-1
-select * from t2 /* must be 1 */;
-a
-0
-show slave status;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port MASTER_MYPORT
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-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 #
-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
-stop slave;
-delete from t3;
-change master to master_log_pos=548;
-begin;
-select * from t2 for update;
-a
-0
-start slave;
-select count(*) from t3 /* must be zero */;
-count(*)
-0
-commit;
-select * from t1;
-a
-1
-1
-select * from t2;
-a
-0
-0
-show slave status;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port MASTER_MYPORT
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running #
-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 #
-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
-set @my_max_relay_log_size= @@global.max_relay_log_size;
-set global max_relay_log_size=0;
-stop slave;
-delete from t3;
-change master to master_log_pos=548;
-begin;
-select * from t2 for update;
-a
-0
-0
-start slave;
-select count(*) from t3 /* must be zero */;
-count(*)
-0
-commit;
-select * from t1;
-a
-1
-1
-1
-select * from t2;
-a
-0
-0
-0
-show slave status;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port MASTER_MYPORT
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running #
-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 #
-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
-drop table t1,t2,t3,t4;
-set global max_relay_log_size= @my_max_relay_log_size;
-End of 5.1 tests
diff --git a/mysql-test/r/rpl_empty_master_crash.result b/mysql-test/r/rpl_empty_master_crash.result
deleted file mode 100644
index d57600d7396..00000000000
--- a/mysql-test/r/rpl_empty_master_crash.result
+++ /dev/null
@@ -1,12 +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;
-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
-load table t1 from master;
-ERROR 08S01: Error connecting to master: Master is not configured
-load table t1 from master;
-ERROR HY000: Error from master: 'Table 'test.t1' doesn't exist'
diff --git a/mysql-test/r/rpl_events.result b/mysql-test/r/rpl_events.result
deleted file mode 100644
index debfcce0072..00000000000
--- a/mysql-test/r/rpl_events.result
+++ /dev/null
@@ -1,159 +0,0 @@
-set global event_scheduler=1;
-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;
-set binlog_format=row;
-DROP EVENT IF EXISTS test.justonce;
-drop table if exists t1,t2;
-CREATE TABLE `t1` (
-`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
-`c` VARCHAR(50) NOT NULL,
-`ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-PRIMARY KEY (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-INSERT INTO t1 (c) VALUES ('manually');
-CREATE EVENT test.justonce ON SCHEDULE AT NOW() + INTERVAL 2 SECOND DO INSERT INTO t1
-(c) VALUES ('from justonce');
-SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce';
-db name status originator
-test justonce ENABLED 1
-"in the master"
-SELECT * FROM t1 WHERE c = 'from justonce' OR c = 'manually' ORDER BY id;
-id c ts
-1 manually TIMESTAMP
-2 from justonce TIMESTAMP
-affected rows: 2
-"in the slave"
-SELECT * FROM t1 WHERE c = 'from justonce' OR c = 'manually' ORDER BY id;
-id c ts
-1 manually TIMESTAMP
-2 from justonce TIMESTAMP
-affected rows: 2
-SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce';
-db name status originator
-DROP EVENT IF EXISTS test.slave_once;
-CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE DO
-INSERT INTO t1(c) VALUES ('from slave_once');
-SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_once';
-db name status originator
-test slave_once ENABLED 2
-DROP EVENT IF EXISTS test.slave_once;
-DROP EVENT IF EXISTS test.justonce;
-CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND DO
-INSERT INTO t1(c) VALUES ('from er');
-SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
-db name status originator body
-test er ENABLED 1 INSERT INTO t1(c) VALUES ('from er')
-"in the slave"
-SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
-db name status originator body
-test er SLAVESIDE_DISABLED 1 INSERT INTO t1(c) VALUES ('from er')
-"in the master"
-ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND DO INSERT into t1(c) VALUES ('from alter er');
-SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
-db name status originator body
-test er ENABLED 1 INSERT into t1(c) VALUES ('from alter er')
-"in the slave"
-SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
-db name status originator body
-test er SLAVESIDE_DISABLED 1 INSERT into t1(c) VALUES ('from alter er')
-"in the master"
-DROP EVENT test.er;
-SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
-db name status originator
-"in the slave"
-SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
-db name status originator
-CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND
-DO INSERT INTO t1(c) VALUES ('from slave_terminate');
-SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate';
-db name status originator
-test slave_terminate ENABLED 2
-DROP EVENT test.slave_terminate;
-CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND
-DISABLE ON SLAVE DO INSERT INTO t1(c) VALUES ('from slave_terminate');
-SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate';
-db name status originator
-test slave_terminate SLAVESIDE_DISABLED 2
-DROP EVENT test.slave_terminate;
-"in the master"
-DROP TABLE t1;
-set binlog_format=statement;
-DROP EVENT IF EXISTS test.justonce;
-drop table if exists t1,t2;
-CREATE TABLE `t1` (
-`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
-`c` VARCHAR(50) NOT NULL,
-`ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-PRIMARY KEY (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-INSERT INTO t1 (c) VALUES ('manually');
-CREATE EVENT test.justonce ON SCHEDULE AT NOW() + INTERVAL 2 SECOND DO INSERT INTO t1
-(c) VALUES ('from justonce');
-SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce';
-db name status originator
-test justonce ENABLED 1
-"in the master"
-SELECT * FROM t1 WHERE c = 'from justonce' OR c = 'manually' ORDER BY id;
-id c ts
-1 manually TIMESTAMP
-2 from justonce TIMESTAMP
-affected rows: 2
-"in the slave"
-SELECT * FROM t1 WHERE c = 'from justonce' OR c = 'manually' ORDER BY id;
-id c ts
-1 manually TIMESTAMP
-2 from justonce TIMESTAMP
-affected rows: 2
-SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce';
-db name status originator
-DROP EVENT IF EXISTS test.slave_once;
-CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE DO
-INSERT INTO t1(c) VALUES ('from slave_once');
-SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_once';
-db name status originator
-test slave_once ENABLED 2
-DROP EVENT IF EXISTS test.slave_once;
-DROP EVENT IF EXISTS test.justonce;
-CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND DO
-INSERT INTO t1(c) VALUES ('from er');
-SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
-db name status originator body
-test er ENABLED 1 INSERT INTO t1(c) VALUES ('from er')
-"in the slave"
-SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
-db name status originator body
-test er SLAVESIDE_DISABLED 1 INSERT INTO t1(c) VALUES ('from er')
-"in the master"
-ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND DO INSERT into t1(c) VALUES ('from alter er');
-SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
-db name status originator body
-test er ENABLED 1 INSERT into t1(c) VALUES ('from alter er')
-"in the slave"
-SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
-db name status originator body
-test er SLAVESIDE_DISABLED 1 INSERT into t1(c) VALUES ('from alter er')
-"in the master"
-DROP EVENT test.er;
-SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
-db name status originator
-"in the slave"
-SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
-db name status originator
-CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND
-DO INSERT INTO t1(c) VALUES ('from slave_terminate');
-SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate';
-db name status originator
-test slave_terminate ENABLED 2
-DROP EVENT test.slave_terminate;
-CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND
-DISABLE ON SLAVE DO INSERT INTO t1(c) VALUES ('from slave_terminate');
-SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate';
-db name status originator
-test slave_terminate SLAVESIDE_DISABLED 2
-DROP EVENT test.slave_terminate;
-"in the master"
-DROP TABLE t1;
diff --git a/mysql-test/r/rpl_extraCol_innodb.result b/mysql-test/r/rpl_extraCol_innodb.result
deleted file mode 100644
index a237edc8063..00000000000
--- a/mysql-test/r/rpl_extraCol_innodb.result
+++ /dev/null
@@ -1,749 +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;
-**** Diff Table Def Start ****
-*** On Slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t1 (a INT, b INT PRIMARY KEY, c CHAR(20),
-d FLOAT DEFAULT '2.00',
-e CHAR(4) DEFAULT 'TEST')
-ENGINE='InnoDB';
-*** Create t1 on Master ***
-CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c CHAR(10)
-) ENGINE='InnoDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-INSERT INTO t1 () VALUES(1,2,'TEXAS'),(2,1,'AUSTIN'),(3,4,'QA');
-SELECT * FROM t1 ORDER BY a;
-a b c
-1 2 TEXAS
-2 1 AUSTIN
-3 4 QA
-*** Select from slave ***
-SELECT * FROM t1 ORDER BY a;
-a b c d e
-1 2 TEXAS 2 TEST
-2 1 AUSTIN 2 TEST
-3 4 QA 2 TEST
-*** Drop t1 ***
-DROP TABLE t1;
-*** Create t3 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t3 (a INT, b INT PRIMARY KEY, c CHAR(20),
-d FLOAT DEFAULT '2.00',
-e CHAR(5) DEFAULT 'TEST2')
-ENGINE='InnoDB';
-*** Create t3 on Master ***
-CREATE TABLE t3 (a BLOB, b INT PRIMARY KEY, c CHAR(20)
-) ENGINE='InnoDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TESTING');
-********************************************
-*** Expect slave to fail with Error 1522 ***
-********************************************
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1523
-Last_Error Column 0 type mismatch - received type 252, test.t3 has type 3
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-*** Drop t3 ***
-DROP TABLE t3;
-*** Create t4 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t4 (a INT, b INT PRIMARY KEY, c CHAR(20),
-d FLOAT DEFAULT '2.00',
-e CHAR(5) DEFAULT 'TEST2')
-ENGINE='InnoDB';
-*** Create t4 on Master ***
-CREATE TABLE t4 (a DECIMAL(8,2), b INT PRIMARY KEY, c CHAR(20)
-) ENGINE='InnoDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'),
-(30000.22,4,'QA TESTING');
-********************************************
-*** Expect slave to fail with Error 1522 ***
-********************************************
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1523
-Last_Error Column 0 type mismatch - received type 246, test.t4 has type 3
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-*** Drop t4 ***
-DROP TABLE t4;
-*** Create t5 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t5 (a INT PRIMARY KEY, b CHAR(5),
-c FLOAT, d INT, e DOUBLE,
-f DECIMAL(8,2))ENGINE='InnoDB';
-*** Create t5 on Master ***
-CREATE TABLE t5 (a INT PRIMARY KEY, b VARCHAR(6),
-c DECIMAL(8,2), d BIT, e BLOB,
-f FLOAT) ENGINE='InnoDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
-(2,'JOE',300.01,0,'b2b2',1.0000009);
-********************************************
-*** Expect slave to fail with Error 1522 ***
-********************************************
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1523
-Last_Error Column 5 type mismatch - received type 4, test.t5 has type 246
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-*** Drop t5 ***
-DROP TABLE t5;
-*** Create t6 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t6 (a INT PRIMARY KEY, b CHAR(5),
-c FLOAT, d INT)ENGINE='InnoDB';
-*** Create t6 on Master ***
-CREATE TABLE t6 (a INT PRIMARY KEY, b VARCHAR(6),
-c DECIMAL(8,2), d BIT
-) ENGINE='InnoDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
-(2,'JOE',300.01,0);
-********************************************
-*** Expect slave to fail with Error 1522 ***
-********************************************
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1523
-Last_Error Column 3 type mismatch - received type 16, test.t6 has type 3
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
-*** Drop t6 ***
-DROP TABLE t6;
-DROP TABLE t6;
-START SLAVE;
-**** Diff Table Def End ****
-**** Extra Colums Start ****
-*** Create t7 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t7 (a INT KEY, b BLOB, c CHAR(5),
-d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
-e CHAR(20) DEFAULT 'Extra Column Testing')
-ENGINE='InnoDB';
-*** Create t7 on Master ***
-CREATE TABLE t7 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
-) ENGINE='InnoDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t7 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
-SELECT * FROM t7 ORDER BY a;
-a b c
-1 b1b1 Kyle
-2 b1b1 JOE
-3 b1b1 QA
-*** Select from slave ***
-SELECT * FROM t7 ORDER BY a;
-a b c d e
-1 b1b1 Kyle 0000-00-00 00:00:00 Extra Column Testing
-2 b1b1 JOE 0000-00-00 00:00:00 Extra Column Testing
-3 b1b1 QA 0000-00-00 00:00:00 Extra Column Testing
-*** Drop t7 ***
-DROP TABLE t7;
-*** Create t8 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t8 (a INT KEY, b BLOB, c CHAR(5),
-d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
-e INT)ENGINE='InnoDB';
-*** Create t8 on Master ***
-CREATE TABLE t8 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
-) ENGINE='InnoDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t8 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
-*** Drop t8 ***
-DROP TABLE t8;
-*** Create t10 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
-c CHAR(5), e INT DEFAULT '1')ENGINE='InnoDB';
-*** Create t10 on Master ***
-CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
-) ENGINE='InnoDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
-********************************************
-*** Expect slave to fail with Error 1522 ***
-********************************************
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1523
-Last_Error Column 2 type mismatch - received type 254, test.t10 has type 5
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-*** Drop t10 ***
-DROP TABLE t10;
-*** Create t11 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
-c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB';
-*** Create t11 on Master ***
-CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
-) ENGINE='InnoDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
-********************************************
-*** Expect slave to fail with Error 1522 ***
-********************************************
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1523
-Last_Error Column 2 type mismatch - received type 15, test.t11 has type 252
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-*** Drop t11 ***
-DROP TABLE t11;
-*** Create t12 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
-c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB';
-*** Create t12 on Master ***
-CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
-) ENGINE='InnoDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t12 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
-SELECT * FROM t12 ORDER BY a;
-a b c
-1 b1b1b1b1b1b1b1b1 Kyle
-2 b1b1b1b1b1b1b1b1 JOE
-3 b1b1b1b1b1b1b1b1 QA
-*** Select on Slave ***
-SELECT * FROM t12 ORDER BY a;
-a b f c e
-1 b1b1b1b1b1b1b1b1 Kyle test 1
-2 b1b1b1b1b1b1b1b1 JOE test 1
-3 b1b1b1b1b1b1b1b1 QA test 1
-*** Drop t12 ***
-DROP TABLE t12;
-**** Extra Colums End ****
-*** BUG 22177 Start ***
-*** Create t13 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t13 (a INT KEY, b BLOB, c CHAR(5),
-d INT DEFAULT '1',
-e TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='InnoDB';
-*** Create t13 on Master ***
-CREATE TABLE t13 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
-) ENGINE='InnoDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t13 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
-SELECT * FROM t13 ORDER BY a;
-a b c
-1 b1b1b1b1b1b1b1b1 Kyle
-2 b1b1b1b1b1b1b1b1 JOE
-3 b1b1b1b1b1b1b1b1 QA
-*** Select on Slave ****
-SELECT * FROM t13 ORDER BY a;
-a b c d e
-1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
-2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
-3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
-*** Drop t13 ***
-DROP TABLE t13;
-*** 22117 END ***
-*** Alter Master Table Testing Start ***
-*** Create t14 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='InnoDB';
-*** Create t14 on Master ***
-CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='InnoDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
-ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
-(2,2.00,'This Test Should work',@b1,'JOE'),
-(3,3.00,'If is does not, I will open a bug',@b1,'QA');
-SELECT * FROM t14 ORDER BY c1;
-c1 c2 c3 c4 c5
-1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
-2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
-3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
-*** Select on Slave ****
-SELECT * FROM t14 ORDER BY c1;
-c1 c2 c3 c4 c5 c6 c7
-1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
-2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
-3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
-*** connect to master and drop columns ***
-ALTER TABLE t14 DROP COLUMN c2;
-ALTER TABLE t14 DROP COLUMN c4;
-*** Select from Master ***
-SELECT * FROM t14 ORDER BY c1;
-c1 c3 c5
-1 Replication Testing Extra Col Kyle
-2 This Test Should work JOE
-3 If is does not, I will open a bug QA
-*** Select from Slave ***
-SELECT * FROM t14 ORDER BY c1;
-c1 c3 c5 c6 c7
-1 Replication Testing Extra Col Kyle 1 CURRENT_TIMESTAMP
-2 This Test Should work JOE 1 CURRENT_TIMESTAMP
-3 If is does not, I will open a bug QA 1 CURRENT_TIMESTAMP
-*** Drop t14 ***
-DROP TABLE t14;
-*** Create t15 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t15 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
-c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='InnoDB';
-*** Create t15 on Master ***
-CREATE TABLE t15 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
-c4 BLOB, c5 CHAR(5)) ENGINE='InnoDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t15 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
-(2,2.00,'This Test Should work',@b1,'JOE'),
-(3,3.00,'If is does not, I will open a bug',@b1,'QA');
-SELECT * FROM t15 ORDER BY c1;
-c1 c2 c3 c4 c5
-1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
-2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
-3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
-*** Select on Slave ****
-SELECT * FROM t15 ORDER BY c1;
-c1 c2 c3 c4 c5 c6 c7
-1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
-2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
-3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
-*** Add column on master that is a Extra on Slave ***
-ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
-********************************************
-*** Expect slave to fail with Error 1060 ***
-********************************************
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1060
-Last_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5'
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-*** Try to insert in master ****
-INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2);
-SELECT * FROM t15 ORDER BY c1;
-c1 c2 c3 c4 c5 c6
-1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL
-2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL
-3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL
-5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2
-*** Try to select from slave ****
-SELECT * FROM t15 ORDER BY c1;
-c1 c2 c3 c4 c5 c6 c7
-1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
-2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
-3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
-*** DROP TABLE t15 ***
-DROP TABLE t15;
-*** Create t16 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t16 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
-c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='InnoDB';
-*** Create t16 on Master ***
-CREATE TABLE t16 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
-c4 BLOB, c5 CHAR(5))ENGINE='InnoDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t16 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
-(2,2.00,'This Test Should work',@b1,'JOE'),
-(3,3.00,'If is does not, I will open a bug',@b1,'QA');
-SELECT * FROM t16 ORDER BY c1;
-c1 c2 c3 c4 c5
-1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
-2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
-3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
-*** Select on Slave ****
-SELECT * FROM t16 ORDER BY c1;
-c1 c2 c3 c4 c5 c6 c7
-1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
-2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
-3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
-*** Add Partition on master ***
-ALTER TABLE t16 PARTITION BY KEY(c1) PARTITIONS 4;
-INSERT INTO t16 () VALUES(4,1.00,'Replication Rocks',@b1,'Omer');
-SHOW CREATE TABLE t16;
-Table Create Table
-t16 CREATE TABLE `t16` (
- `c1` int(11) NOT NULL,
- `c2` decimal(8,2) DEFAULT NULL,
- `c3` text,
- `c4` blob,
- `c5` char(5) DEFAULT NULL,
- PRIMARY KEY (`c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
-*** Show table on Slave ****
-SHOW CREATE TABLE t16;
-Table Create Table
-t16 CREATE TABLE `t16` (
- `c1` int(11) NOT NULL,
- `c2` decimal(8,2) DEFAULT NULL,
- `c3` text,
- `c4` blob,
- `c5` char(5) DEFAULT NULL,
- `c6` int(11) DEFAULT '1',
- `c7` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (`c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
-*** DROP TABLE t16 ***
-DROP TABLE t16;
-*** Alter Master End ***
-*** Create t17 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t17 (a SMALLINT, b INT PRIMARY KEY, c CHAR(5),
-d FLOAT DEFAULT '2.00',
-e CHAR(5) DEFAULT 'TEST2')
-ENGINE='InnoDB';
-*** Create t17 on Master ***
-CREATE TABLE t17 (a BIGINT PRIMARY KEY, b INT, c CHAR(10)
-) ENGINE='InnoDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
-********************************************
-*** Expect slave to fail with Error 1522 ***
-********************************************
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1523
-Last_Error Column 0 type mismatch - received type 8, test.t17 has type 2
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-** DROP table t17 ***
-DROP TABLE t17;
diff --git a/mysql-test/r/rpl_extraCol_myisam.result b/mysql-test/r/rpl_extraCol_myisam.result
deleted file mode 100644
index 95f99ba1014..00000000000
--- a/mysql-test/r/rpl_extraCol_myisam.result
+++ /dev/null
@@ -1,749 +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;
-**** Diff Table Def Start ****
-*** On Slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t1 (a INT, b INT PRIMARY KEY, c CHAR(20),
-d FLOAT DEFAULT '2.00',
-e CHAR(4) DEFAULT 'TEST')
-ENGINE='MyISAM';
-*** Create t1 on Master ***
-CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c CHAR(10)
-) ENGINE='MyISAM';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-INSERT INTO t1 () VALUES(1,2,'TEXAS'),(2,1,'AUSTIN'),(3,4,'QA');
-SELECT * FROM t1 ORDER BY a;
-a b c
-1 2 TEXAS
-2 1 AUSTIN
-3 4 QA
-*** Select from slave ***
-SELECT * FROM t1 ORDER BY a;
-a b c d e
-1 2 TEXAS 2 TEST
-2 1 AUSTIN 2 TEST
-3 4 QA 2 TEST
-*** Drop t1 ***
-DROP TABLE t1;
-*** Create t3 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t3 (a INT, b INT PRIMARY KEY, c CHAR(20),
-d FLOAT DEFAULT '2.00',
-e CHAR(5) DEFAULT 'TEST2')
-ENGINE='MyISAM';
-*** Create t3 on Master ***
-CREATE TABLE t3 (a BLOB, b INT PRIMARY KEY, c CHAR(20)
-) ENGINE='MyISAM';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TESTING');
-********************************************
-*** Expect slave to fail with Error 1522 ***
-********************************************
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1523
-Last_Error Column 0 type mismatch - received type 252, test.t3 has type 3
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-*** Drop t3 ***
-DROP TABLE t3;
-*** Create t4 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t4 (a INT, b INT PRIMARY KEY, c CHAR(20),
-d FLOAT DEFAULT '2.00',
-e CHAR(5) DEFAULT 'TEST2')
-ENGINE='MyISAM';
-*** Create t4 on Master ***
-CREATE TABLE t4 (a DECIMAL(8,2), b INT PRIMARY KEY, c CHAR(20)
-) ENGINE='MyISAM';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'),
-(30000.22,4,'QA TESTING');
-********************************************
-*** Expect slave to fail with Error 1522 ***
-********************************************
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1523
-Last_Error Column 0 type mismatch - received type 246, test.t4 has type 3
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-*** Drop t4 ***
-DROP TABLE t4;
-*** Create t5 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t5 (a INT PRIMARY KEY, b CHAR(5),
-c FLOAT, d INT, e DOUBLE,
-f DECIMAL(8,2))ENGINE='MyISAM';
-*** Create t5 on Master ***
-CREATE TABLE t5 (a INT PRIMARY KEY, b VARCHAR(6),
-c DECIMAL(8,2), d BIT, e BLOB,
-f FLOAT) ENGINE='MyISAM';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
-(2,'JOE',300.01,0,'b2b2',1.0000009);
-********************************************
-*** Expect slave to fail with Error 1522 ***
-********************************************
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1523
-Last_Error Column 5 type mismatch - received type 4, test.t5 has type 246
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-*** Drop t5 ***
-DROP TABLE t5;
-*** Create t6 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t6 (a INT PRIMARY KEY, b CHAR(5),
-c FLOAT, d INT)ENGINE='MyISAM';
-*** Create t6 on Master ***
-CREATE TABLE t6 (a INT PRIMARY KEY, b VARCHAR(6),
-c DECIMAL(8,2), d BIT
-) ENGINE='MyISAM';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
-(2,'JOE',300.01,0);
-********************************************
-*** Expect slave to fail with Error 1522 ***
-********************************************
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1523
-Last_Error Column 3 type mismatch - received type 16, test.t6 has type 3
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
-*** Drop t6 ***
-DROP TABLE t6;
-DROP TABLE t6;
-START SLAVE;
-**** Diff Table Def End ****
-**** Extra Colums Start ****
-*** Create t7 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t7 (a INT KEY, b BLOB, c CHAR(5),
-d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
-e CHAR(20) DEFAULT 'Extra Column Testing')
-ENGINE='MyISAM';
-*** Create t7 on Master ***
-CREATE TABLE t7 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
-) ENGINE='MyISAM';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t7 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
-SELECT * FROM t7 ORDER BY a;
-a b c
-1 b1b1 Kyle
-2 b1b1 JOE
-3 b1b1 QA
-*** Select from slave ***
-SELECT * FROM t7 ORDER BY a;
-a b c d e
-1 b1b1 Kyle 0000-00-00 00:00:00 Extra Column Testing
-2 b1b1 JOE 0000-00-00 00:00:00 Extra Column Testing
-3 b1b1 QA 0000-00-00 00:00:00 Extra Column Testing
-*** Drop t7 ***
-DROP TABLE t7;
-*** Create t8 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t8 (a INT KEY, b BLOB, c CHAR(5),
-d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
-e INT)ENGINE='MyISAM';
-*** Create t8 on Master ***
-CREATE TABLE t8 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
-) ENGINE='MyISAM';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t8 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
-*** Drop t8 ***
-DROP TABLE t8;
-*** Create t10 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
-c CHAR(5), e INT DEFAULT '1')ENGINE='MyISAM';
-*** Create t10 on Master ***
-CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
-) ENGINE='MyISAM';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
-********************************************
-*** Expect slave to fail with Error 1522 ***
-********************************************
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1523
-Last_Error Column 2 type mismatch - received type 254, test.t10 has type 5
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-*** Drop t10 ***
-DROP TABLE t10;
-*** Create t11 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
-c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM';
-*** Create t11 on Master ***
-CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
-) ENGINE='MyISAM';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
-********************************************
-*** Expect slave to fail with Error 1522 ***
-********************************************
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1523
-Last_Error Column 2 type mismatch - received type 15, test.t11 has type 252
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-*** Drop t11 ***
-DROP TABLE t11;
-*** Create t12 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
-c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM';
-*** Create t12 on Master ***
-CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
-) ENGINE='MyISAM';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t12 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
-SELECT * FROM t12 ORDER BY a;
-a b c
-1 b1b1b1b1b1b1b1b1 Kyle
-2 b1b1b1b1b1b1b1b1 JOE
-3 b1b1b1b1b1b1b1b1 QA
-*** Select on Slave ***
-SELECT * FROM t12 ORDER BY a;
-a b f c e
-1 b1b1b1b1b1b1b1b1 Kyle test 1
-2 b1b1b1b1b1b1b1b1 JOE test 1
-3 b1b1b1b1b1b1b1b1 QA test 1
-*** Drop t12 ***
-DROP TABLE t12;
-**** Extra Colums End ****
-*** BUG 22177 Start ***
-*** Create t13 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t13 (a INT KEY, b BLOB, c CHAR(5),
-d INT DEFAULT '1',
-e TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='MyISAM';
-*** Create t13 on Master ***
-CREATE TABLE t13 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
-) ENGINE='MyISAM';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t13 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
-SELECT * FROM t13 ORDER BY a;
-a b c
-1 b1b1b1b1b1b1b1b1 Kyle
-2 b1b1b1b1b1b1b1b1 JOE
-3 b1b1b1b1b1b1b1b1 QA
-*** Select on Slave ****
-SELECT * FROM t13 ORDER BY a;
-a b c d e
-1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
-2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
-3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
-*** Drop t13 ***
-DROP TABLE t13;
-*** 22117 END ***
-*** Alter Master Table Testing Start ***
-*** Create t14 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='MyISAM';
-*** Create t14 on Master ***
-CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='MyISAM';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
-ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
-(2,2.00,'This Test Should work',@b1,'JOE'),
-(3,3.00,'If is does not, I will open a bug',@b1,'QA');
-SELECT * FROM t14 ORDER BY c1;
-c1 c2 c3 c4 c5
-1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
-2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
-3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
-*** Select on Slave ****
-SELECT * FROM t14 ORDER BY c1;
-c1 c2 c3 c4 c5 c6 c7
-1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
-2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
-3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
-*** connect to master and drop columns ***
-ALTER TABLE t14 DROP COLUMN c2;
-ALTER TABLE t14 DROP COLUMN c4;
-*** Select from Master ***
-SELECT * FROM t14 ORDER BY c1;
-c1 c3 c5
-1 Replication Testing Extra Col Kyle
-2 This Test Should work JOE
-3 If is does not, I will open a bug QA
-*** Select from Slave ***
-SELECT * FROM t14 ORDER BY c1;
-c1 c3 c5 c6 c7
-1 Replication Testing Extra Col Kyle 1 CURRENT_TIMESTAMP
-2 This Test Should work JOE 1 CURRENT_TIMESTAMP
-3 If is does not, I will open a bug QA 1 CURRENT_TIMESTAMP
-*** Drop t14 ***
-DROP TABLE t14;
-*** Create t15 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t15 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
-c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='MyISAM';
-*** Create t15 on Master ***
-CREATE TABLE t15 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
-c4 BLOB, c5 CHAR(5)) ENGINE='MyISAM';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t15 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
-(2,2.00,'This Test Should work',@b1,'JOE'),
-(3,3.00,'If is does not, I will open a bug',@b1,'QA');
-SELECT * FROM t15 ORDER BY c1;
-c1 c2 c3 c4 c5
-1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
-2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
-3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
-*** Select on Slave ****
-SELECT * FROM t15 ORDER BY c1;
-c1 c2 c3 c4 c5 c6 c7
-1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
-2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
-3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
-*** Add column on master that is a Extra on Slave ***
-ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
-********************************************
-*** Expect slave to fail with Error 1060 ***
-********************************************
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1060
-Last_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5'
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-*** Try to insert in master ****
-INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2);
-SELECT * FROM t15 ORDER BY c1;
-c1 c2 c3 c4 c5 c6
-1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL
-2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL
-3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL
-5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2
-*** Try to select from slave ****
-SELECT * FROM t15 ORDER BY c1;
-c1 c2 c3 c4 c5 c6 c7
-1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
-2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
-3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
-*** DROP TABLE t15 ***
-DROP TABLE t15;
-*** Create t16 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t16 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
-c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='MyISAM';
-*** Create t16 on Master ***
-CREATE TABLE t16 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
-c4 BLOB, c5 CHAR(5))ENGINE='MyISAM';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t16 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
-(2,2.00,'This Test Should work',@b1,'JOE'),
-(3,3.00,'If is does not, I will open a bug',@b1,'QA');
-SELECT * FROM t16 ORDER BY c1;
-c1 c2 c3 c4 c5
-1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
-2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
-3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
-*** Select on Slave ****
-SELECT * FROM t16 ORDER BY c1;
-c1 c2 c3 c4 c5 c6 c7
-1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
-2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
-3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
-*** Add Partition on master ***
-ALTER TABLE t16 PARTITION BY KEY(c1) PARTITIONS 4;
-INSERT INTO t16 () VALUES(4,1.00,'Replication Rocks',@b1,'Omer');
-SHOW CREATE TABLE t16;
-Table Create Table
-t16 CREATE TABLE `t16` (
- `c1` int(11) NOT NULL,
- `c2` decimal(8,2) DEFAULT NULL,
- `c3` text,
- `c4` blob,
- `c5` char(5) DEFAULT NULL,
- PRIMARY KEY (`c1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
-*** Show table on Slave ****
-SHOW CREATE TABLE t16;
-Table Create Table
-t16 CREATE TABLE `t16` (
- `c1` int(11) NOT NULL,
- `c2` decimal(8,2) DEFAULT NULL,
- `c3` text,
- `c4` blob,
- `c5` char(5) DEFAULT NULL,
- `c6` int(11) DEFAULT '1',
- `c7` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (`c1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
-*** DROP TABLE t16 ***
-DROP TABLE t16;
-*** Alter Master End ***
-*** Create t17 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t17 (a SMALLINT, b INT PRIMARY KEY, c CHAR(5),
-d FLOAT DEFAULT '2.00',
-e CHAR(5) DEFAULT 'TEST2')
-ENGINE='MyISAM';
-*** Create t17 on Master ***
-CREATE TABLE t17 (a BIGINT PRIMARY KEY, b INT, c CHAR(10)
-) ENGINE='MyISAM';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
-********************************************
-*** Expect slave to fail with Error 1522 ***
-********************************************
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1523
-Last_Error Column 0 type mismatch - received type 8, test.t17 has type 2
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-** DROP table t17 ***
-DROP TABLE t17;
diff --git a/mysql-test/r/rpl_extraColmaster_innodb.result b/mysql-test/r/rpl_extraColmaster_innodb.result
new file mode 100644
index 00000000000..27d6592a7ad
--- /dev/null
+++ b/mysql-test/r/rpl_extraColmaster_innodb.result
Binary files differ
diff --git a/mysql-test/r/rpl_extraColmaster_myisam.result b/mysql-test/r/rpl_extraColmaster_myisam.result
new file mode 100644
index 00000000000..9a77ae6ca19
--- /dev/null
+++ b/mysql-test/r/rpl_extraColmaster_myisam.result
Binary files differ
diff --git a/mysql-test/r/rpl_failed_optimize.result b/mysql-test/r/rpl_failed_optimize.result
deleted file mode 100644
index ec0b3856ae7..00000000000
--- a/mysql-test/r/rpl_failed_optimize.result
+++ /dev/null
@@ -1,25 +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 ( a int ) ENGINE=InnoDB;
-BEGIN;
-INSERT INTO t1 VALUES (1);
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize error Lock wait timeout exceeded; try restarting transaction
-test.t1 optimize status Operation failed
-Warnings:
-Error 1205 Lock wait timeout exceeded; try restarting transaction
-OPTIMIZE TABLE non_existing;
-Table Op Msg_type Msg_text
-test.non_existing optimize error Table 'test.non_existing' doesn't exist
-Warnings:
-Error 1146 Table 'test.non_existing' doesn't exist
-select * from t1;
-a
-1
-commit;
-drop table t1;
diff --git a/mysql-test/r/rpl_flushlog_loop.result b/mysql-test/r/rpl_flushlog_loop.result
deleted file mode 100644
index 1e90796b2ea..00000000000
--- a/mysql-test/r/rpl_flushlog_loop.result
+++ /dev/null
@@ -1,54 +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;
-stop slave;
-change master to master_host='127.0.0.1',master_user='root',
-master_password='',master_port=MASTER_PORT;
-start slave;
-stop slave;
-change master to master_host='127.0.0.1',master_user='root',
-master_password='',master_port=SLAVE_PORT;
-start slave;
-
-let $result_pattern= '%127.0.0.1%root%slave-bin.000001%slave-bin.000001%Yes%Yes%0%0%None%' ;
-
---source include/wait_slave_status.inc
-flush logs;
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port SLAVE_PORT
-Connect_Retry 60
-Master_Log_File slave-bin.000001
-Read_Master_Log_Pos 216
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File slave-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 216
-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
diff --git a/mysql-test/r/rpl_incident.result b/mysql-test/r/rpl_incident.result
deleted file mode 100644
index aea35c5f477..00000000000
--- a/mysql-test/r/rpl_incident.result
+++ /dev/null
@@ -1,107 +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;
-**** On Master ****
-CREATE TABLE t1 (a INT);
-INSERT INTO t1 VALUES (1),(2),(3);
-SELECT * FROM t1;
-a
-1
-2
-3
-REPLACE INTO t1 VALUES (4);
-SELECT * FROM t1;
-a
-1
-2
-3
-4
-**** On Slave ****
-SELECT * FROM t1;
-a
-1
-2
-3
-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.000002
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1586
-Last_Error The incident LOST_EVENTS occured on the master. Message: <none>
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
-SELECT * FROM t1;
-a
-1
-2
-3
-4
-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.000002
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000002
-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 #
-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
-DROP TABLE t1;
-DROP TABLE t1;
diff --git a/mysql-test/r/rpl_innodb.result b/mysql-test/r/rpl_innodb.result
deleted file mode 100644
index 765de8af458..00000000000
--- a/mysql-test/r/rpl_innodb.result
+++ /dev/null
@@ -1,37 +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 t4 (
-id INT(5) unsigned NOT NULL auto_increment,
-name varchar(15) NOT NULL default '',
-number varchar(35) NOT NULL default 'default',
-PRIMARY KEY (id),
-UNIQUE KEY unique_rec (name,number)
-) ENGINE=InnoDB;
-LOAD DATA
-INFILE '../std_data_ln/loaddata_pair.dat'
-REPLACE INTO TABLE t4
-(name,number);
-SELECT * FROM t4;
-id name number
-1 XXX 12345
-2 XXY 12345
-SELECT * FROM t4;
-id name number
-1 XXX 12345
-2 XXY 12345
-LOAD DATA
-INFILE '../std_data_ln/loaddata_pair.dat'
-REPLACE INTO TABLE t4
-(name,number);
-SELECT * FROM t4;
-id name number
-3 XXX 12345
-4 XXY 12345
-SELECT * FROM t4;
-id name number
-3 XXX 12345
-4 XXY 12345
diff --git a/mysql-test/r/rpl_known_bugs_detection.result b/mysql-test/r/rpl_known_bugs_detection.result
deleted file mode 100644
index 318bc3d63e7..00000000000
--- a/mysql-test/r/rpl_known_bugs_detection.result
+++ /dev/null
@@ -1,135 +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 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT,
-UNIQUE(b));
-INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10;
-SELECT * FROM t1;
-a b
-1 10
-2 2
-show slave status;;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 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
-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
-SELECT * FROM t1;
-a b
-stop slave;
-reset slave;
-reset master;
-drop table t1;
-start slave;
-CREATE TABLE t1 (
-id bigint(20) unsigned NOT NULL auto_increment,
-field_1 int(10) unsigned NOT NULL,
-field_2 varchar(255) NOT NULL,
-field_3 varchar(255) NOT NULL,
-PRIMARY KEY (id),
-UNIQUE KEY field_1 (field_1, field_2)
-);
-CREATE TABLE t2 (
-field_a int(10) unsigned NOT NULL,
-field_b varchar(255) NOT NULL,
-field_c varchar(255) NOT NULL
-);
-INSERT INTO t2 (field_a, field_b, field_c) VALUES (1, 'a', '1a');
-INSERT INTO t2 (field_a, field_b, field_c) VALUES (2, 'b', '2b');
-INSERT INTO t2 (field_a, field_b, field_c) VALUES (3, 'c', '3c');
-INSERT INTO t2 (field_a, field_b, field_c) VALUES (4, 'd', '4d');
-INSERT INTO t2 (field_a, field_b, field_c) VALUES (5, 'e', '5e');
-INSERT INTO t1 (field_1, field_2, field_3)
-SELECT t2.field_a, t2.field_b, t2.field_c
-FROM t2
-ON DUPLICATE KEY UPDATE
-t1.field_3 = t2.field_c;
-INSERT INTO t2 (field_a, field_b, field_c) VALUES (6, 'f', '6f');
-INSERT INTO t1 (field_1, field_2, field_3)
-SELECT t2.field_a, t2.field_b, t2.field_c
-FROM t2
-ON DUPLICATE KEY UPDATE
-t1.field_3 = t2.field_c;
-SELECT * FROM t1;
-id field_1 field_2 field_3
-1 1 a 1a
-2 2 b 2b
-3 3 c 3c
-4 4 d 4d
-5 5 e 5e
-6 6 f 6f
-show slave status;;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 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 (field_1, field_2, field_3)
-SELECT t2.field_a, t2.field_b, t2.field_c
-FROM t2
-ON DUPLICATE KEY UPDATE
-t1.field_3 = t2.field_c'
-Skip_Counter 0
-Exec_Master_Log_Pos 1278
-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
-SELECT * FROM t1;
-id field_1 field_2 field_3
-drop table t1, t2;
-drop table t1, t2;
diff --git a/mysql-test/r/rpl_loaddata.result b/mysql-test/r/rpl_loaddata.result
deleted file mode 100644
index cabc20b7057..00000000000
--- a/mysql-test/r/rpl_loaddata.result
+++ /dev/null
@@ -1,88 +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;
-reset master;
-select last_insert_id();
-last_insert_id()
-0
-create table t1(a int not null auto_increment, b int, primary key(a) );
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
-select last_insert_id();
-last_insert_id()
-1
-create temporary table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60));
-load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines;
-create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60));
-insert into t3 select * from t2;
-select * from t1;
-a b
-1 10
-2 15
-select * from t3;
-day id category name
-2003-02-22 2461 b a a a @ %  ' " a
-2003-03-22 2161 c asdf
-2003-03-22 2416 a bbbbb
-show master status;
-File Position Binlog_Do_DB Binlog_Ignore_DB
-slave-bin.000001 1280
-drop table t1;
-drop table t2;
-drop table t3;
-create table t1(a int, b int, unique(b));
-insert into t1 values(1,10);
-load data infile '../std_data_ln/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
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1797 # # master-bin.000001 Yes Yes # 0 0 1797 # None 0 No # No
-set sql_log_bin=0;
-delete from t1;
-set sql_log_bin=1;
-load data infile '../std_data_ln/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
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1832 # # master-bin.000001 No No # 0 0 1832 # None 0 No # No
-set global sql_slave_skip_counter=1;
-start slave;
-set sql_log_bin=0;
-delete from t1;
-set sql_log_bin=1;
-load data infile '../std_data_ln/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
-# 127.0.0.1 root MASTER_PORT 1 4 # # No No # 0 0 0 # None 0 No # No
-reset master;
-create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
-unique(day)) engine=MyISAM;
-load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields
-terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
-'\n##\n' starting by '>' ignore 1 lines;
-ERROR 23000: Duplicate entry '2003-03-22' for key 'day'
-select * from t2;
-day id category name
-2003-02-22 2461 b a a a @ %  ' " a
-2003-03-22 2161 c asdf
-start slave;
-select * from t2;
-day id category name
-2003-02-22 2461 b a a a @ %  ' " a
-2003-03-22 2161 c asdf
-alter table t2 drop key day;
-delete from t2;
-load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields
-terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
-'\n##\n' starting by '>' ignore 1 lines;
-ERROR 23000: Duplicate entry '2003-03-22' for key 'day'
-drop table t2;
-drop table t2;
-drop table t1;
diff --git a/mysql-test/r/rpl_log_pos.result b/mysql-test/r/rpl_log_pos.result
deleted file mode 100644
index 28ddbaf33a0..00000000000
--- a/mysql-test/r/rpl_log_pos.result
+++ /dev/null
@@ -1,46 +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;
-show master status;
-File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 106 <Binlog_Ignore_DB>
-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
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 Yes Yes 0 0 106 # None 0 No # No
-stop slave;
-change master to master_log_pos=75;
-start slave;
-stop slave;
-change master to master_log_pos=75;
-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
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 75 # # master-bin.000001 No No 0 0 75 # None 0 No # No
-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
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 75 # # master-bin.000001 No Yes 0 0 75 # None 0 No # No
-stop slave;
-change master to master_log_pos=178;
-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
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 178 # # master-bin.000001 # Yes 0 0 178 # None 0 No # No
-show master status;
-File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 106 <Binlog_Ignore_DB>
-create table if not exists t1 (n int);
-drop table if exists t1;
-create table t1 (n int);
-insert into t1 values (1),(2),(3);
-stop slave;
-change master to master_log_pos=106;
-start slave;
-select * from t1 ORDER BY n;
-n
-1
-2
-3
-drop table t1;
diff --git a/mysql-test/r/rpl_misc_functions.result b/mysql-test/r/rpl_misc_functions.result
deleted file mode 100644
index 526414cec9c..00000000000
--- a/mysql-test/r/rpl_misc_functions.result
+++ /dev/null
@@ -1,46 +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(id int, i int, r1 int, r2 int, p varchar(100));
-insert into t1 values(1, connection_id(), 0, 0, "");
-insert into t1 values(2, 0, rand()*1000, rand()*1000, "");
-set sql_log_bin=0;
-insert into t1 values(6, 0, rand(), rand(), "");
-delete from t1 where id=6;
-set sql_log_bin=1;
-insert into t1 values(3, 0, 0, 0, password('does_this_work?'));
-insert into t1 values(4, connection_id(), rand()*1000, rand()*1000, password('does_this_still_work?'));
-select * into outfile 'rpl_misc_functions.outfile' from t1;
-create table t2 like t1;
-load data local infile 'MYSQLTEST_VARDIR/master-data/test/rpl_misc_functions.outfile' into table t2;
-select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p);
-id i r1 r2 p id i r1 r2 p
-drop table t1;
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (col_a double default NULL);
-CREATE PROCEDURE test_replication_sp1()
-BEGIN
-INSERT INTO t1 VALUES (rand()), (rand());
-INSERT INTO t1 VALUES (rand());
-END|
-CREATE PROCEDURE test_replication_sp2()
-BEGIN
-CALL test_replication_sp1();
-CALL test_replication_sp1();
-END|
-CREATE FUNCTION test_replication_sf() RETURNS DOUBLE DETERMINISTIC
-BEGIN
-RETURN (rand() + rand());
-END|
-CALL test_replication_sp1();
-CALL test_replication_sp2();
-INSERT INTO t1 VALUES (test_replication_sf());
-INSERT INTO t1 VALUES (test_replication_sf());
-INSERT INTO t1 VALUES (test_replication_sf());
-DROP PROCEDURE IF EXISTS test_replication_sp1;
-DROP PROCEDURE IF EXISTS test_replication_sp2;
-DROP FUNCTION IF EXISTS test_replication_sf;
-DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/r/rpl_ndb_UUID.result b/mysql-test/r/rpl_ndb_UUID.result
deleted file mode 100644
index 422379d4f55..00000000000
--- a/mysql-test/r/rpl_ndb_UUID.result
+++ /dev/null
@@ -1,40 +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;
-DROP PROCEDURE IF EXISTS test.p1;
-DROP TABLE IF EXISTS test.t1;
-CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, vchar_column VARCHAR(100), PRIMARY KEY(a)) engine=NDB;
-INSERT INTO test.t1 VALUES(1,UUID(),UUID());
-create procedure test.p1()
-begin
-INSERT INTO test.t1 VALUES(2,UUID(),UUID());
-INSERT INTO test.t1 VALUES(3,UUID(),UUID());
-end|
-CALL test.p1();
-create function test.fn1(x int)
-returns int
-begin
-insert into t1 values (4+x,UUID(),UUID());
-insert into t1 values (5+x,UUID(),UUID());
-return 0;
-end|
-select fn1(0);
-fn1(0)
-0
-create table t2 (a int);
-insert into t2 values(fn1(2));
-SHOW CREATE TABLE test.t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL DEFAULT '0',
- `blob_column` longblob,
- `vchar_column` varchar(100) DEFAULT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-DROP PROCEDURE test.p1;
-DROP FUNCTION test.fn1;
-DROP TABLE test.t1;
-DROP TABLE test.t2;
diff --git a/mysql-test/r/rpl_ndb_basic.result b/mysql-test/r/rpl_ndb_basic.result
deleted file mode 100644
index 4dab05b31de..00000000000
--- a/mysql-test/r/rpl_ndb_basic.result
+++ /dev/null
@@ -1,227 +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` ( `nid` int(11) NOT NULL default '0',
-`nom` char(4) default NULL,
-`prenom` char(4) default NULL,
-PRIMARY KEY (`nid`))
-ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-INSERT INTO t1 VALUES(1,"XYZ1","ABC1");
-select * from t1 order by nid;
-nid nom prenom
-1 XYZ1 ABC1
-select * from t1 order by nid;
-nid nom prenom
-1 XYZ1 ABC1
-delete from t1;
-INSERT INTO t1 VALUES(1,"XYZ2","ABC2");
-select * from t1 order by nid;
-nid nom prenom
-1 XYZ2 ABC2
-select * from t1 order by nid;
-nid nom prenom
-1 XYZ2 ABC2
-delete from t1;
-insert into t1 values(1,"AA", "AA");
-insert into t1 values(2,"BB", "BB");
-insert into t1 values(3,"CC", "CC");
-insert into t1 values(4,"DD", "DD");
-begin;
-delete from t1 where nid = 1;
-insert into t1 values (1,"A2", "A2");
-update t1 set nom="B2" where nid = 2;
-delete from t1 where nid = 2;
-update t1 set nom = "D2" where nid = 4;
-delete from t1 where nid = 4;
-insert into t1 values (4, "D3", "D3");
-update t1 set nom = "D4" where nid = 4;
-insert into t1 values (5, "EE", "EE");
-delete from t1 where nid = 5;
-commit;
-select * from t1 order by 1;
-nid nom prenom
-1 A2 A2
-3 CC CC
-4 D4 D3
-select * from t1 order by 1;
-nid nom prenom
-1 A2 A2
-3 CC CC
-4 D4 D3
-DROP table t1;
-CREATE TABLE `t1` ( `nid` int(11) NOT NULL default '0',
-`nom` char(4) default NULL,
-`prenom` char(4) default NULL)
-ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-INSERT INTO t1 VALUES(1,"XYZ1","ABC1"),(2,"AAA","BBB"),(3,"CCC","DDD");
-select * from t1 order by nid;
-nid nom prenom
-1 XYZ1 ABC1
-2 AAA BBB
-3 CCC DDD
-select * from t1 order by nid;
-nid nom prenom
-1 XYZ1 ABC1
-2 AAA BBB
-3 CCC DDD
-delete from t1 where nid = 2;
-INSERT INTO t1 VALUES(4,"EEE","FFF");
-select * from t1 order by nid;
-nid nom prenom
-1 XYZ1 ABC1
-3 CCC DDD
-4 EEE FFF
-select * from t1 order by nid;
-nid nom prenom
-1 XYZ1 ABC1
-3 CCC DDD
-4 EEE FFF
-UPDATE t1 set nid=nid+1;
-UPDATE t1 set nom="CCP" where nid = 4;
-select * from t1 order by nid;
-nid nom prenom
-2 XYZ1 ABC1
-4 CCP DDD
-5 EEE FFF
-select * from t1 order by nid;
-nid nom prenom
-2 XYZ1 ABC1
-4 CCP DDD
-5 EEE FFF
-DROP table t1;
-CREATE TABLE `t1` (
-`prid` int(10) unsigned NOT NULL,
-`id_type` enum('IMSI','SIP') NOT NULL,
-`fkimssub` varchar(50) NOT NULL,
-`user_id` varchar(20) DEFAULT NULL,
-`password` varchar(20) DEFAULT NULL,
-`ptg_nbr` varchar(20) DEFAULT NULL,
-`old_tmsi` int(10) unsigned DEFAULT NULL,
-`new_tmsi` int(10) unsigned DEFAULT NULL,
-`dev_capability` int(10) unsigned DEFAULT NULL,
-`dev_oid` bigint(20) unsigned DEFAULT NULL,
-`lac_cell_id` bigint(20) unsigned DEFAULT NULL,
-`ms_classmark1` int(10) unsigned DEFAULT NULL,
-`cipher_key` int(10) unsigned DEFAULT NULL,
-`priid_master` int(10) unsigned DEFAULT NULL,
-PRIMARY KEY (`prid`),
-UNIQUE KEY `fkimssub` (`fkimssub`,`ptg_nbr`) USING HASH
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-Warnings:
-Warning 1121 Ndb does not support unique index on NULL valued attributes, index access with NULL value will become full table scan
-INSERT INTO `t1` VALUES (183342,'IMSI','config3_sub_2Privates_3Publics_imssub_36668','user_id_73336','user_id_73336','73336',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(47617,'IMSI','config3_sub_2Privates_3Publics_imssub_9523','user_id_19046','user_id_19046','19046',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(200332,'IMSI','config3_sub_2Privates_3Publics_imssub_40066','user_id_80132','user_id_80132','80132',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(478882,'IMSI','config3_sub_2Privates_3Publics_imssub_95776','user_id_191552','user_id_191552','191552',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(490146,'IMSI','config3_sub_2Privates_3Publics_imssub_98029','user_id_196057','user_id_196057','196057',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(499301,'IMSI','config3_sub_2Privates_3Publics_imssub_99860','user_id_199719','user_id_199719','199719',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(506101,'IMSI','config3_sub_2Privates_3Publics_imssub_101220','user_id_202439','user_id_202439','202439',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(510142,'IMSI','config3_sub_2Privates_3Publics_imssub_102028','user_id_204056','user_id_204056','204056',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(515871,'IMSI','config3_sub_2Privates_3Publics_imssub_103174','user_id_206347','user_id_206347','206347',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(209842,'IMSI','config3_sub_2Privates_3Publics_imssub_41968','user_id_83936','user_id_83936','83936',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(365902,'IMSI','config3_sub_2Privates_3Publics_imssub_73180','user_id_146360','user_id_146360','146360',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(11892,'IMSI','config3_sub_2Privates_3Publics_imssub_2378','user_id_4756','user_id_4756','4756',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL);
-select count(*) from t1;
-count(*)
-12
-select count(*) from t1;
-count(*)
-12
-update t1 set dev_oid=dev_oid+1;
-select count(*) from t1;
-count(*)
-12
-select count(*) from t1;
-count(*)
-12
-DROP table t1;
-CREATE TABLE `t1` ( `nid` int(11) NOT NULL default '0',
-`nom` char(4) default NULL,
-`prenom` char(4) default NULL,
-PRIMARY KEY USING HASH (`nid`))
-ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-INSERT INTO t1 VALUES(1,"XYZ1","ABC1");
-**** On Slave ****
-BEGIN;
-UPDATE t1 SET `nom`="LOCK" WHERE `nid`=1;
-set GLOBAL slave_transaction_retries=1;
-**** On Master ****
-UPDATE t1 SET `nom`="DEAD" WHERE `nid`=1;
-**** On Slave ****
-SHOW SLAVE STATUS;;
-Slave_IO_State <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 <Read_Master_Log_Pos>
-Relay_Log_File <Relay_Log_File>
-Relay_Log_Pos <Relay_Log_Pos>
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table <Replicate_Ignore_Table>
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1105
-Last_Error Unknown error
-Skip_Counter 0
-Exec_Master_Log_Pos <Exec_Master_Log_Pos>
-Relay_Log_Space <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 <Seconds_Behind_Master>
-Master_SSL_Verify_Server_Cert No
-set GLOBAL slave_transaction_retries=10;
-START SLAVE;
-select * from t1 order by nid;
-nid nom prenom
-1 LOCK ABC1
-COMMIT;
-select * from t1 order by nid;
-nid nom prenom
-1 DEAD ABC1
-DROP TABLE t1;
-CREATE TABLE t1 (c1 INT KEY) ENGINE=NDB;
-INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
-ALTER TABLE t1 ADD c2 INT;
-SELECT * FROM t1 ORDER BY c1;
-c1 c2
-1 NULL
-2 NULL
-3 NULL
-4 NULL
-5 NULL
-6 NULL
-7 NULL
-8 NULL
-9 NULL
-10 NULL
-ALTER TABLE t1 CHANGE c2 c2 TEXT CHARACTER SET utf8;
-ALTER TABLE t1 CHANGE c2 c2 BLOB;
-SELECT * FROM t1 ORDER BY c1 LIMIT 5;
-c1 c2
-1 NULL
-2 NULL
-3 NULL
-4 NULL
-5 NULL
-TRUNCATE t1;
-SELECT count(*) FROM t1;
-count(*)
-0
-INSERT INTO t1 VALUES (101,NULL),(102,NULL),(103,NULL),(104,NULL),(105,NULL),(106,NULL),(107,NULL),(108,NULL),(109,NULL),(1010,NULL);
-SELECT count(*) FROM t1;
-count(*)
-10
-SELECT c1 FROM t1 ORDER BY c1 LIMIT 5;
-c1
-101
-102
-103
-104
-105
-DROP TABLE t1;
diff --git a/mysql-test/r/rpl_ndb_circular.result b/mysql-test/r/rpl_ndb_circular.result
deleted file mode 100644
index 88516b757df..00000000000
--- a/mysql-test/r/rpl_ndb_circular.result
+++ /dev/null
@@ -1,95 +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;
-RESET MASTER;
-CHANGE MASTER TO master_host="127.0.0.1",master_port=SLAVE_PORT,master_user="root";
-START SLAVE;
-CREATE TABLE t1 (a int key, b int) ENGINE=ndb;
-SHOW TABLES;
-Tables_in_test
-t1
-INSERT INTO t1 VALUES (1,2);
-INSERT INTO t1 VALUES (2,3);
-SELECT * FROM t1 ORDER BY a;
-a b
-1 2
-2 3
-show slave status;;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-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 #
-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
-SELECT * FROM t1 ORDER BY a;
-a b
-1 2
-2 3
-show slave status;;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 60
-Master_Log_File slave-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File slave-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 #
-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
-STOP SLAVE;
-DROP TABLE t1;
diff --git a/mysql-test/r/rpl_ndb_circular_simplex.result b/mysql-test/r/rpl_ndb_circular_simplex.result
deleted file mode 100644
index ee452f345f9..00000000000
--- a/mysql-test/r/rpl_ndb_circular_simplex.result
+++ /dev/null
@@ -1,97 +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 (a int key, b int) ENGINE=NDB;
-SHOW TABLES;
-Tables_in_test
-t1
-RESET MASTER;
-INSERT INTO t1 VALUES (1,2);
-INSERT INTO t1 VALUES (2,3);
-STOP SLAVE;
-CHANGE MASTER TO MASTER_HOST="127.0.0.1",MASTER_PORT=SLAVE_PORT,MASTER_USER="root";
-RESET MASTER;
-START SLAVE;
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port SLAVE_PORT
-Connect_Retry 60
-Master_Log_File slave-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File slave-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 #
-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
-SELECT * FROM t1 ORDER BY a;
-a b
-1 2
-2 3
-STOP SLAVE;
-START SLAVE;
-SELECT * FROM t1 ORDER BY a;
-a b
-1 2
-2 3
-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 #
-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 #
-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
diff --git a/mysql-test/r/rpl_ndb_dd_advance.result b/mysql-test/r/rpl_ndb_dd_advance.result
deleted file mode 100644
index a4614b4b484..00000000000
--- a/mysql-test/r/rpl_ndb_dd_advance.result
+++ /dev/null
@@ -1,417 +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;
-DROP TABLE IF EXISTS t1, t2, t3;
-***** Test 1 RPL of CDD and Alter *****
-***** Test 1 setup *****
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-INITIAL_SIZE 16M
-UNDO_BUFFER_SIZE = 1M
-ENGINE=NDB;
-ALTER LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile02.dat'
-INITIAL_SIZE 4M
-ENGINE=NDB;
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 12M
-ENGINE=NDB;
-ALTER TABLESPACE ts1
-ADD DATAFILE 'datafile02.dat'
-INITIAL_SIZE 4M
-ENGINE=NDB;
-CREATE TABLE t1
-(c1 INT NOT NULL PRIMARY KEY,
-c2 INT NOT NULL,
-c3 INT NOT NULL)
-TABLESPACE ts1 STORAGE DISK
-ENGINE=NDB;
-***** insert some data *****
-***** Select from Master *****
-SELECT * FROM t1 ORDER BY c1 LIMIT 5;
-c1 c2 c3
-1 2 4
-2 4 5
-3 6 6
-4 8 7
-5 10 8
-***** Select from Slave *****
-SELECT * FROM t1 ORDER BY c1 LIMIT 5;
-c1 c2 c3
-1 2 4
-2 4 5
-3 6 6
-4 8 7
-5 10 8
-FILE_NAME FILE_TYPE TABLESPACE_NAME LOGFILE_GROUP_NAME
-NULL UNDO LOG NULL lg1
-datafile.dat DATAFILE ts1 lg1
-datafile02.dat DATAFILE ts1 lg1
-undofile.dat UNDO LOG NULL lg1
-undofile02.dat UNDO LOG NULL lg1
-**** Do First Set of ALTERs in the master table ****
-CREATE INDEX t1_i ON t1(c2, c3);
-ALTER TABLE t1 ADD c4 TIMESTAMP;
-ALTER TABLE t1 ADD c5 DOUBLE;
-ALTER TABLE t1 ADD INDEX (c5);
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL,
- `c2` int(11) NOT NULL,
- `c3` int(11) NOT NULL,
- `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
- `c5` double DEFAULT NULL,
- PRIMARY KEY (`c1`),
- KEY `t1_i` (`c2`,`c3`),
- KEY `c5` (`c5`)
-) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
-**** Show first set of ALTERs on SLAVE ****
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL,
- `c2` int(11) NOT NULL,
- `c3` int(11) NOT NULL,
- `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
- `c5` double DEFAULT NULL,
- PRIMARY KEY (`c1`),
- KEY `t1_i` (`c2`,`c3`),
- KEY `c5` (`c5`)
-) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
-**** Second set of alters test 1 ****
-ALTER TABLE t1 RENAME t2;
-ALTER TABLE t2 DROP INDEX c5;
-CREATE TABLE t1(c1 INT)ENGINE=NDB;
-INSERT INTO t1 VALUES(1);
-DROP TABLE t1;
-ALTER TABLE t2 RENAME t1;
-**** Show second set of ALTERs on MASTER ****
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL,
- `c2` int(11) NOT NULL,
- `c3` int(11) NOT NULL,
- `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
- `c5` double DEFAULT NULL,
- PRIMARY KEY (`c1`),
- KEY `t1_i` (`c2`,`c3`)
-) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
-**** Show second set of ALTERs on SLAVE ****
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL,
- `c2` int(11) NOT NULL,
- `c3` int(11) NOT NULL,
- `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
- `c5` double DEFAULT NULL,
- PRIMARY KEY (`c1`),
- KEY `t1_i` (`c2`,`c3`)
-) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
-**** Third and last set of alters for test1 ****
-ALTER TABLE t1 CHANGE c1 c1 DOUBLE;
-ALTER TABLE t1 CHANGE c2 c2 DECIMAL(10,2);
-ALTER TABLE t1 DROP COLUMN c3;
-ALTER TABLE t1 CHANGE c4 c4 TEXT CHARACTER SET utf8;
-ALTER TABLE t1 CHANGE c4 c4 BLOB;
-ALTER TABLE t1 CHANGE c4 c3 BLOB;
-set @b1 = 'b1';
-set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
-UPDATE t1 SET c3=@b1 where c1 = 1;
-UPDATE t1 SET c3=@b1 where c1 = 2;
-**** Show last set of ALTERs on MASTER ****
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` double NOT NULL DEFAULT '0',
- `c2` decimal(10,2) DEFAULT NULL,
- `c3` blob,
- `c5` double DEFAULT NULL,
- PRIMARY KEY (`c1`),
- KEY `t1_i` (`c2`)
-) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
-SELECT * FROM t1 ORDER BY c1 LIMIT 5;
-c1 c2 c3 c5
-1 2.00 b1b1b1b1b1b1b1b1b1b1 NULL
-2 4.00 b1b1b1b1b1b1b1b1b1b1 NULL
-3 6.00 0000-00-00 00:00:00 NULL
-4 8.00 0000-00-00 00:00:00 NULL
-5 10.00 0000-00-00 00:00:00 NULL
-**** Show last set of ALTERs on SLAVE ****
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` double NOT NULL DEFAULT '0',
- `c2` decimal(10,2) DEFAULT NULL,
- `c3` blob,
- `c5` double DEFAULT NULL,
- PRIMARY KEY (`c1`),
- KEY `t1_i` (`c2`)
-) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
-SELECT * FROM t1 where c1 = 1;
-c1 c2 c3 c5
-1 2.00 b1b1b1b1b1b1b1b1b1b1 NULL
-DROP TABLE t1;
-STOP SLAVE;
-RESET SLAVE;
-RESET MASTER;
-START SLAVE;
-******** Create additional TABLESPACE test 2 **************
-CREATE TABLESPACE ts2
-ADD DATAFILE 'datafile03.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 12M
-ENGINE=NDB;
-ALTER TABLESPACE ts2
-ADD DATAFILE 'datafile04.dat'
-INITIAL_SIZE 12M
-ENGINE=NDB;
-DROP DATABASE IF EXISTS tpcb;
-Warnings:
-Note 1008 Can't drop database 'tpcb'; database doesn't exist
-CREATE DATABASE tpcb;
-*********** Create TPCB Tables *****************
-CREATE TABLE tpcb.account
-(id INT, bid INT, balance DECIMAL(10,2),
-filler CHAR(255), PRIMARY KEY(id))
-TABLESPACE ts1 STORAGE DISK
-ENGINE=NDB;
-CREATE TABLE tpcb.branch
-(bid INT, balance DECIMAL(10,2), filler VARCHAR(255),
-PRIMARY KEY(bid))
-ENGINE=NDB;
-CREATE TABLE tpcb.teller
-(tid INT, balance DECIMAL(10,2), filler VARCHAR(255),
-PRIMARY KEY(tid))
-TABLESPACE ts2 STORAGE DISK
-ENGINE=NDB;
-CREATE TABLE tpcb.history
-(id MEDIUMINT NOT NULL AUTO_INCREMENT,aid INT,
-tid INT, bid INT, amount DECIMAL(10,2),
-tdate DATETIME, teller CHAR(20), uuidf LONGBLOB,
-filler CHAR(80),PRIMARY KEY (id))
-TABLESPACE ts2 STORAGE DISK
-ENGINE=NDB;
-********* Create Procedures and Functions ************
-CREATE PROCEDURE tpcb.load()
-BEGIN
-DECLARE acct INT DEFAULT 1000;
-DECLARE brch INT DEFAULT 100;
-DECLARE tell INT DEFAULT 1000;
-DECLARE tmp INT DEFAULT 100;
-WHILE brch > 0 DO
-SET tmp = 100;
-WHILE tmp > 0 DO
-INSERT INTO tpcb.account VALUES (acct, brch, 0.0, "FRESH ACCOUNT");
-SET acct = acct - 1;
-SET tmp = tmp -1;
-END WHILE;
-INSERT INTO tpcb.branch VALUES (brch, 0.0, "FRESH BRANCH");
-SET brch = brch - 1;
-END WHILE;
-WHILE tell > 0 DO
-INSERT INTO tpcb.teller VALUES (tell, 0.0, "FRESH TELLER");
-SET tell = tell - 1;
-END WHILE;
-END|
-CREATE FUNCTION tpcb.account_id () RETURNS INT
-BEGIN
-DECLARE num INT;
-DECLARE ran INT;
-SELECT RAND() * 10 INTO ran;
-IF (ran < 2)
-THEN
-SELECT RAND() * 10 INTO num;
-ELSEIF (ran < 4)
-THEN
-SELECT RAND() * 100 INTO num;
-ELSE
-SELECT RAND() * 1000 INTO num;
-END IF;
-IF (num < 1)
-THEN
-RETURN 1;
-END IF;
-RETURN num;
-END|
-CREATE FUNCTION tpcb.teller_id () RETURNS INT
-BEGIN
-DECLARE num INT;
-DECLARE ran INT;
-SELECT RAND() * 10 INTO ran;
-IF (ran < 2)
-THEN
-SELECT RAND() * 10 INTO num;
-ELSEIF (ran < 5)
-THEN
-SELECT RAND() * 100 INTO num;
-ELSE
-SELECT RAND() * 1000 INTO num;
-END IF;
-IF (num < 1)
-THEN
-RETURN 1;
-END IF;
-RETURN num;
-END|
-CREATE PROCEDURE tpcb.trans()
-BEGIN
-DECLARE acct INT DEFAULT 0;
-DECLARE brch INT DEFAULT 0;
-DECLARE tell INT DEFAULT 0;
-DECLARE bal DECIMAL(10,2) DEFAULT 0.0;
-DECLARE amount DECIMAL(10,2) DEFAULT 1.00;
-DECLARE test INT DEFAULT 0;
-DECLARE bbal DECIMAL(10,2) DEFAULT 0.0;
-DECLARE tbal DECIMAL(10,2) DEFAULT 0.0;
-DECLARE local_uuid VARCHAR(255);
-DECLARE local_user VARCHAR(255);
-DECLARE local_time TIMESTAMP;
-SELECT RAND() * 10 INTO test;
-SELECT tpcb.account_id() INTO acct;
-SELECT tpcb.teller_id() INTO tell;
-SELECT account.balance INTO bal FROM tpcb.account WHERE id = acct;
-SELECT account.bid INTO brch FROM tpcb.account WHERE id = acct;
-SELECT teller.balance INTO tbal FROM tpcb.teller WHERE tid = tell;
-SELECT branch.balance INTO bbal FROM tpcb.branch WHERE bid = brch;
-IF (test < 5)
-THEN
-SET bal = bal + amount;
-SET bbal = bbal + amount;
-SET tbal = tbal + amount;
-UPDATE tpcb.account SET balance = bal, filler = 'account updated'
- WHERE id = acct;
-UPDATE tpcb.branch SET balance = bbal, filler = 'branch updated'
- WHERE bid = brch;
-UPDATE tpcb.teller SET balance = tbal, filler = 'teller updated'
- WHERE tid = tell;
-ELSE
-SET bal = bal - amount;
-SET bbal = bbal - amount;
-SET tbal = tbal - amount;
-UPDATE tpcb.account SET balance = bal, filler = 'account updated'
- WHERE id = acct;
-UPDATE tpcb.branch SET balance = bbal, filler = 'branch updated'
- WHERE bid = brch;
-UPDATE tpcb.teller SET balance = tbal, filler = 'teller updated'
- WHERE tid = tell;
-END IF;
-SET local_uuid=UUID();
-SET local_user=USER();
-SET local_time= NOW();
-INSERT INTO tpcb.history VALUES(NULL,acct,tell,brch,amount, local_time,local_user,
-local_uuid,'completed trans');
-END|
-****** TEST 2 test time *********************************
-USE tpcb;
-*********** Load up the database ******************
-CALL tpcb.load();
-********** Check load master and slave **************
-SELECT COUNT(*) FROM account;
-COUNT(*)
-10000
-USE tpcb;
-SELECT COUNT(*) FROM account;
-COUNT(*)
-10000
-******** Run in some transactions ***************
-***** Time to try slave sync ***********
-**** Must make sure slave is clean *****
-STOP SLAVE;
-RESET SLAVE;
-DROP PROCEDURE IF EXISTS tpcb.load;
-DROP PROCEDURE IF EXISTS tpcb.trans;
-DROP TABLE IF EXISTS tpcb.account;
-DROP TABLE IF EXISTS tpcb.teller;
-DROP TABLE IF EXISTS tpcb.branch;
-DROP TABLE IF EXISTS tpcb.history;
-DROP DATABASE tpcb;
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile.dat'
-ENGINE=NDB;
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile02.dat'
-ENGINE=NDB;
-DROP TABLESPACE ts1 ENGINE=NDB;
-ALTER TABLESPACE ts2
-DROP DATAFILE 'datafile03.dat'
-ENGINE=NDB;
-ALTER TABLESPACE ts2
-DROP DATAFILE 'datafile04.dat'
-ENGINE=NDB;
-DROP TABLESPACE ts2 ENGINE=NDB;
-DROP LOGFILE GROUP lg1 ENGINE=NDB;
-********** Take a backup of the Master *************
-SELECT COUNT(*) FROM history;
-COUNT(*)
-1000
-SELECT COUNT(*) FROM history;
-COUNT(*)
-2000
-CREATE TEMPORARY TABLE IF NOT EXISTS mysql.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-DELETE FROM mysql.backup_info;
-LOAD DATA INFILE '../tmp.dat' INTO TABLE mysql.backup_info FIELDS TERMINATED BY ',';
-SELECT @the_backup_id:=backup_id FROM mysql.backup_info;
-@the_backup_id:=backup_id
-<the_backup_id>
-DROP TABLE IF EXISTS mysql.backup_info;
-************ Restore the slave ************************
-CREATE DATABASE tpcb;
-***** Check a few slave restore values ***************
-USE tpcb;
-SELECT COUNT(*) FROM account;
-COUNT(*)
-10000
-***** Add some more records to master *********
-***** Finsh the slave sync process *******
-@the_epoch:=MAX(epoch)
-<the_epoch>
-@the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1)
-<the_pos> master-bin.000001
-* 4. *
-* 5. *
-START SLAVE;
-**** We should be ready to continue on *************
-****** Let's make sure we match *******
-***** MASTER *******
-USE tpcb;
-SELECT COUNT(*) FROM history;
-COUNT(*)
-4050
-****** SLAVE ********
-USE tpcb;
-SELECT COUNT(*) FROM history;
-COUNT(*)
-4050
-*** DUMP MASTER & SLAVE FOR COMPARE ********
-*************** TEST 2 CLEANUP SECTION ********************
-DROP PROCEDURE IF EXISTS tpcb.load;
-DROP PROCEDURE IF EXISTS tpcb.trans;
-DROP TABLE tpcb.account;
-DROP TABLE tpcb.teller;
-DROP TABLE tpcb.branch;
-DROP TABLE tpcb.history;
-DROP DATABASE tpcb;
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile.dat'
-ENGINE=NDB;
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile02.dat'
-ENGINE=NDB;
-DROP TABLESPACE ts1 ENGINE=NDB;
-ALTER TABLESPACE ts2
-DROP DATAFILE 'datafile03.dat'
-ENGINE=NDB;
-ALTER TABLESPACE ts2
-DROP DATAFILE 'datafile04.dat'
-ENGINE=NDB;
-DROP TABLESPACE ts2 ENGINE=NDB;
-DROP LOGFILE GROUP lg1 ENGINE=NDB;
-****** Do dumps compare ************
diff --git a/mysql-test/r/rpl_ndb_dd_basic.result b/mysql-test/r/rpl_ndb_dd_basic.result
deleted file mode 100644
index f1cc6e9af24..00000000000
--- a/mysql-test/r/rpl_ndb_dd_basic.result
+++ /dev/null
@@ -1,72 +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;
-DROP TABLE IF EXISTS t1;
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-INITIAL_SIZE 16M
-UNDO_BUFFER_SIZE = 1M
-ENGINE=NDB;
-alter logfile group lg1
-add undofile 'undofile02.dat'
-initial_size 4M engine=ndb;
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 12M
-ENGINE NDB;
-alter tablespace ts1
-add datafile 'datafile02.dat'
-initial_size 4M engine=ndb;
-CREATE TABLE t1
-(pk1 int not null primary key, b int not null, c int not null)
-tablespace ts1 storage disk
-engine ndb;
-insert into t1 values (1,2,3);
-select * from t1 order by pk1;
-pk1 b c
-1 2 3
-select * from t1 order by pk1;
-pk1 b c
-1 2 3
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query 1 # use `test`; DROP TABLE IF EXISTS t1
-master-bin.000001 # Query 1 # CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-INITIAL_SIZE 16M
-UNDO_BUFFER_SIZE = 1M
-ENGINE=NDB
-master-bin.000001 # Query 1 # alter logfile group lg1
-add undofile 'undofile02.dat'
-initial_size 4M engine=ndb
-master-bin.000001 # Query 1 # CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 12M
-ENGINE NDB
-master-bin.000001 # Query 1 # alter tablespace ts1
-add datafile 'datafile02.dat'
-initial_size 4M engine=ndb
-master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1
-(pk1 int not null primary key, b int not null, c int not null)
-tablespace ts1 storage disk
-engine ndb
-master-bin.000001 # Query 1 # BEGIN
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-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
-drop table t1;
-alter tablespace ts1
-drop datafile 'datafile.dat'
-engine=ndb;
-alter tablespace ts1
-drop datafile 'datafile02.dat'
-engine=ndb;
-DROP TABLESPACE ts1 ENGINE=NDB;
-DROP LOGFILE GROUP lg1 ENGINE=NDB;
diff --git a/mysql-test/r/rpl_ndb_dd_partitions.result b/mysql-test/r/rpl_ndb_dd_partitions.result
deleted file mode 100644
index ece6b84c227..00000000000
--- a/mysql-test/r/rpl_ndb_dd_partitions.result
+++ /dev/null
@@ -1,726 +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;
---- Doing pre test cleanup ---
-DROP TABLE IF EXISTS t1;
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-INITIAL_SIZE 16M
-UNDO_BUFFER_SIZE = 1M
-ENGINE=NDB;
-ALTER LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile02.dat'
-INITIAL_SIZE = 4M
-ENGINE=NDB;
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 12M
-ENGINE NDB;
-ALTER TABLESPACE ts1
-ADD DATAFILE 'datafile02.dat'
-INITIAL_SIZE = 4M
-ENGINE=NDB;
---- Start test 2 partition RANGE testing --
---- Do setup --
-CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63),
-bc CHAR(63), d DECIMAL(10,4) DEFAULT 0,
-f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
-y YEAR, t DATE)
-TABLESPACE ts1 STORAGE DISK
-ENGINE=NDB
-PARTITION BY RANGE (YEAR(t))
-(PARTITION p0 VALUES LESS THAN (1901),
-PARTITION p1 VALUES LESS THAN (1946),
-PARTITION p2 VALUES LESS THAN (1966),
-PARTITION p3 VALUES LESS THAN (1986),
-PARTITION p4 VALUES LESS THAN (2005),
-PARTITION p5 VALUES LESS THAN MAXVALUE);
---- Show table on master ---
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `id` mediumint(9) NOT NULL,
- `b1` bit(8) DEFAULT NULL,
- `vc` varchar(63) DEFAULT NULL,
- `bc` char(63) DEFAULT NULL,
- `d` decimal(10,4) DEFAULT '0.0000',
- `f` float DEFAULT '0',
- `total` bigint(20) unsigned DEFAULT NULL,
- `y` year(4) DEFAULT NULL,
- `t` date DEFAULT NULL
-) TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster)
---- Show table on slave --
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `id` mediumint(9) NOT NULL,
- `b1` bit(8) DEFAULT NULL,
- `vc` varchar(63) DEFAULT NULL,
- `bc` char(63) DEFAULT NULL,
- `d` decimal(10,4) DEFAULT '0.0000',
- `f` float DEFAULT '0',
- `total` bigint(20) unsigned DEFAULT NULL,
- `y` year(4) DEFAULT NULL,
- `t` date DEFAULT NULL
-) TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster)
---- Perform basic operation on master ---
---- and ensure replicated correctly ---
-"--- Insert into t1 --" as "";
---- Select from t1 on master ---
-select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
-id hex(b1) vc bc d f total y t
-2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
-4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
-42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
-142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
-412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
---- Select from t1 on slave ---
-select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
-id hex(b1) vc bc d f total y t
-2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
-4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
-42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
-142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
-412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
---- Update t1 on master --
-UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
---- Check the update on master ---
-SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
-id hex(b1) vc bc d f total y t
-412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
---- Check Update on slave ---
-SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
-id hex(b1) vc bc d f total y t
-412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
---- Remove a record from t1 on master ---
-DELETE FROM t1 WHERE id = 42;
---- Show current count on master for t1 ---
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-4
---- Show current count on slave for t1 ---
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-4
-DELETE FROM t1;
---- Check that simple Alter statements are replicated correctly ---
-ALTER TABLE t1 MODIFY vc VARCHAR(255);
---- Show the new improved table on the master ---
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `id` mediumint(9) NOT NULL,
- `b1` bit(8) DEFAULT NULL,
- `vc` varchar(255) DEFAULT NULL,
- `bc` char(63) DEFAULT NULL,
- `d` decimal(10,4) DEFAULT '0.0000',
- `f` float DEFAULT '0',
- `total` bigint(20) unsigned DEFAULT NULL,
- `y` year(4) DEFAULT NULL,
- `t` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster)
---- Make sure that our tables on slave are still same engine ---
---- and that the alter statements replicated correctly ---
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `id` mediumint(9) NOT NULL,
- `b1` bit(8) DEFAULT NULL,
- `vc` varchar(255) DEFAULT NULL,
- `bc` char(63) DEFAULT NULL,
- `d` decimal(10,4) DEFAULT '0.0000',
- `f` float DEFAULT '0',
- `total` bigint(20) unsigned DEFAULT NULL,
- `y` year(4) DEFAULT NULL,
- `t` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster)
---- Perform basic operation on master ---
---- and ensure replicated correctly ---
-"--- Insert into t1 --" as "";
---- Select from t1 on master ---
-select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
-id hex(b1) vc bc d f total y t
-2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
-4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
-42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
-142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
-412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
---- Select from t1 on slave ---
-select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
-id hex(b1) vc bc d f total y t
-2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
-4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
-42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
-142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
-412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
---- Update t1 on master --
-UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
---- Check the update on master ---
-SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
-id hex(b1) vc bc d f total y t
-412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
---- Check Update on slave ---
-SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
-id hex(b1) vc bc d f total y t
-412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
---- Remove a record from t1 on master ---
-DELETE FROM t1 WHERE id = 42;
---- Show current count on master for t1 ---
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-4
---- Show current count on slave for t1 ---
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-4
-DELETE FROM t1;
---- End test 2 partition RANGE testing ---
---- Do Cleanup ---
-DROP TABLE IF EXISTS t1;
---- Start test 3 partition LIST testing ---
---- Do setup ---
-CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63),
-bc CHAR(63), d DECIMAL(10,4) DEFAULT 0,
-f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
-y YEAR, t DATE)
-TABLESPACE ts1 STORAGE DISK
-ENGINE=NDB
-PARTITION BY LIST(id)
-(PARTITION p0 VALUES IN (2, 4),
-PARTITION p1 VALUES IN (42, 142));
---- Test 3 Alter to add partition ---
-ALTER TABLE t1 ADD PARTITION (PARTITION p2 VALUES IN (412));
---- Show table on master ---
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `id` mediumint(9) NOT NULL,
- `b1` bit(8) DEFAULT NULL,
- `vc` varchar(63) DEFAULT NULL,
- `bc` char(63) DEFAULT NULL,
- `d` decimal(10,4) DEFAULT '0.0000',
- `f` float DEFAULT '0',
- `total` bigint(20) unsigned DEFAULT NULL,
- `y` year(4) DEFAULT NULL,
- `t` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster)
---- Show table on slave ---
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `id` mediumint(9) NOT NULL,
- `b1` bit(8) DEFAULT NULL,
- `vc` varchar(63) DEFAULT NULL,
- `bc` char(63) DEFAULT NULL,
- `d` decimal(10,4) DEFAULT '0.0000',
- `f` float DEFAULT '0',
- `total` bigint(20) unsigned DEFAULT NULL,
- `y` year(4) DEFAULT NULL,
- `t` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster)
---- Perform basic operation on master ---
---- and ensure replicated correctly ---
-"--- Insert into t1 --" as "";
---- Select from t1 on master ---
-select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
-id hex(b1) vc bc d f total y t
-2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
-4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
-42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
-142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
-412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
---- Select from t1 on slave ---
-select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
-id hex(b1) vc bc d f total y t
-2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
-4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
-42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
-142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
-412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
---- Update t1 on master --
-UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
---- Check the update on master ---
-SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
-id hex(b1) vc bc d f total y t
-412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
---- Check Update on slave ---
-SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
-id hex(b1) vc bc d f total y t
-412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
---- Remove a record from t1 on master ---
-DELETE FROM t1 WHERE id = 42;
---- Show current count on master for t1 ---
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-4
---- Show current count on slave for t1 ---
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-4
-DELETE FROM t1;
---- Check that simple Alter statements are replicated correctly ---
-ALTER TABLE t1 MODIFY vc VARCHAR(255);
---- Show the new improved table on the master ---
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `id` mediumint(9) NOT NULL,
- `b1` bit(8) DEFAULT NULL,
- `vc` varchar(255) DEFAULT NULL,
- `bc` char(63) DEFAULT NULL,
- `d` decimal(10,4) DEFAULT '0.0000',
- `f` float DEFAULT '0',
- `total` bigint(20) unsigned DEFAULT NULL,
- `y` year(4) DEFAULT NULL,
- `t` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster)
---- Make sure that our tables on slave are still same engine ---
---- and that the alter statements replicated correctly ---
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `id` mediumint(9) NOT NULL,
- `b1` bit(8) DEFAULT NULL,
- `vc` varchar(255) DEFAULT NULL,
- `bc` char(63) DEFAULT NULL,
- `d` decimal(10,4) DEFAULT '0.0000',
- `f` float DEFAULT '0',
- `total` bigint(20) unsigned DEFAULT NULL,
- `y` year(4) DEFAULT NULL,
- `t` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster)
---- Perform basic operation on master ---
---- and ensure replicated correctly ---
-"--- Insert into t1 --" as "";
---- Select from t1 on master ---
-select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
-id hex(b1) vc bc d f total y t
-2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
-4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
-42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
-142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
-412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
---- Select from t1 on slave ---
-select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
-id hex(b1) vc bc d f total y t
-2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
-4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
-42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
-142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
-412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
---- Update t1 on master --
-UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
---- Check the update on master ---
-SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
-id hex(b1) vc bc d f total y t
-412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
---- Check Update on slave ---
-SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
-id hex(b1) vc bc d f total y t
-412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
---- Remove a record from t1 on master ---
-DELETE FROM t1 WHERE id = 42;
---- Show current count on master for t1 ---
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-4
---- Show current count on slave for t1 ---
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-4
-DELETE FROM t1;
---- End test 3 partition LIST testing ---
---- Do Cleanup --
-DROP TABLE IF EXISTS t1;
---- Start test 4 partition HASH testing ---
---- Do setup ---
-CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63),
-bc CHAR(63), d DECIMAL(10,4) DEFAULT 0,
-f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
-y YEAR, t DATE)
-TABLESPACE ts1 STORAGE DISK
-ENGINE=NDB
-PARTITION BY HASH( YEAR(t) )
-PARTITIONS 4;
---- show that tables have been created correctly ---
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `id` mediumint(9) NOT NULL,
- `b1` bit(8) DEFAULT NULL,
- `vc` varchar(63) DEFAULT NULL,
- `bc` char(63) DEFAULT NULL,
- `d` decimal(10,4) DEFAULT '0.0000',
- `f` float DEFAULT '0',
- `total` bigint(20) unsigned DEFAULT NULL,
- `y` year(4) DEFAULT NULL,
- `t` date DEFAULT NULL
-) TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `id` mediumint(9) NOT NULL,
- `b1` bit(8) DEFAULT NULL,
- `vc` varchar(63) DEFAULT NULL,
- `bc` char(63) DEFAULT NULL,
- `d` decimal(10,4) DEFAULT '0.0000',
- `f` float DEFAULT '0',
- `total` bigint(20) unsigned DEFAULT NULL,
- `y` year(4) DEFAULT NULL,
- `t` date DEFAULT NULL
-) TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4
---- Perform basic operation on master ---
---- and ensure replicated correctly ---
-"--- Insert into t1 --" as "";
---- Select from t1 on master ---
-select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
-id hex(b1) vc bc d f total y t
-2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
-4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
-42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
-142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
-412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
---- Select from t1 on slave ---
-select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
-id hex(b1) vc bc d f total y t
-2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
-4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
-42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
-142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
-412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
---- Update t1 on master --
-UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
---- Check the update on master ---
-SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
-id hex(b1) vc bc d f total y t
-412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
---- Check Update on slave ---
-SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
-id hex(b1) vc bc d f total y t
-412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
---- Remove a record from t1 on master ---
-DELETE FROM t1 WHERE id = 42;
---- Show current count on master for t1 ---
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-4
---- Show current count on slave for t1 ---
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-4
-DELETE FROM t1;
---- Check that simple Alter statements are replicated correctly ---
-ALTER TABLE t1 MODIFY vc VARCHAR(255);
---- Show the new improved table on the master ---
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `id` mediumint(9) NOT NULL,
- `b1` bit(8) DEFAULT NULL,
- `vc` varchar(255) DEFAULT NULL,
- `bc` char(63) DEFAULT NULL,
- `d` decimal(10,4) DEFAULT '0.0000',
- `f` float DEFAULT '0',
- `total` bigint(20) unsigned DEFAULT NULL,
- `y` year(4) DEFAULT NULL,
- `t` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4
---- Make sure that our tables on slave are still same engine ---
---- and that the alter statements replicated correctly ---
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `id` mediumint(9) NOT NULL,
- `b1` bit(8) DEFAULT NULL,
- `vc` varchar(255) DEFAULT NULL,
- `bc` char(63) DEFAULT NULL,
- `d` decimal(10,4) DEFAULT '0.0000',
- `f` float DEFAULT '0',
- `total` bigint(20) unsigned DEFAULT NULL,
- `y` year(4) DEFAULT NULL,
- `t` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4
---- Perform basic operation on master ---
---- and ensure replicated correctly ---
-"--- Insert into t1 --" as "";
---- Select from t1 on master ---
-select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
-id hex(b1) vc bc d f total y t
-2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
-4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
-42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
-142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
-412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
---- Select from t1 on slave ---
-select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
-id hex(b1) vc bc d f total y t
-2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
-4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
-42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
-142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
-412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
---- Update t1 on master --
-UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
---- Check the update on master ---
-SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
-id hex(b1) vc bc d f total y t
-412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
---- Check Update on slave ---
-SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
-id hex(b1) vc bc d f total y t
-412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
---- Remove a record from t1 on master ---
-DELETE FROM t1 WHERE id = 42;
---- Show current count on master for t1 ---
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-4
---- Show current count on slave for t1 ---
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-4
-DELETE FROM t1;
---- End test 4 partition HASH testing ---
---- Do Cleanup --
-DROP TABLE IF EXISTS t1;
---- Start test 5 partition by key testing ---
---- Create Table Section ---
-CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63),
-bc CHAR(63), d DECIMAL(10,4) DEFAULT 0,
-f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
-y YEAR, t DATE,PRIMARY KEY(id))
-TABLESPACE ts1 STORAGE DISK
-ENGINE=NDB
-PARTITION BY KEY()
-PARTITIONS 4;
---- Show that tables on master are ndbcluster tables ---
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `id` mediumint(9) NOT NULL,
- `b1` bit(8) DEFAULT NULL,
- `vc` varchar(63) DEFAULT NULL,
- `bc` char(63) DEFAULT NULL,
- `d` decimal(10,4) DEFAULT '0.0000',
- `f` float DEFAULT '0',
- `total` bigint(20) unsigned DEFAULT NULL,
- `y` year(4) DEFAULT NULL,
- `t` date DEFAULT NULL,
- PRIMARY KEY (`id`)
-) TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4
---- Show that tables on slave ---
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `id` mediumint(9) NOT NULL,
- `b1` bit(8) DEFAULT NULL,
- `vc` varchar(63) DEFAULT NULL,
- `bc` char(63) DEFAULT NULL,
- `d` decimal(10,4) DEFAULT '0.0000',
- `f` float DEFAULT '0',
- `total` bigint(20) unsigned DEFAULT NULL,
- `y` year(4) DEFAULT NULL,
- `t` date DEFAULT NULL,
- PRIMARY KEY (`id`)
-) TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4
---- Perform basic operation on master ---
---- and ensure replicated correctly ---
-"--- Insert into t1 --" as "";
---- Select from t1 on master ---
-select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
-id hex(b1) vc bc d f total y t
-2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
-4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
-42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
-142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
-412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
---- Select from t1 on slave ---
-select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
-id hex(b1) vc bc d f total y t
-2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
-4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
-42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
-142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
-412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
---- Update t1 on master --
-UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
---- Check the update on master ---
-SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
-id hex(b1) vc bc d f total y t
-412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
---- Check Update on slave ---
-SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
-id hex(b1) vc bc d f total y t
-412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
---- Remove a record from t1 on master ---
-DELETE FROM t1 WHERE id = 42;
---- Show current count on master for t1 ---
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-4
---- Show current count on slave for t1 ---
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-4
-DELETE FROM t1;
---- Check that simple Alter statements are replicated correctly ---
-ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total);
---- Show the new improved table on the master ---
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `id` mediumint(9) NOT NULL,
- `b1` bit(8) DEFAULT NULL,
- `vc` varchar(63) DEFAULT NULL,
- `bc` char(63) DEFAULT NULL,
- `d` decimal(10,4) DEFAULT '0.0000',
- `f` float DEFAULT '0',
- `total` bigint(20) unsigned NOT NULL DEFAULT '0',
- `y` year(4) DEFAULT NULL,
- `t` date DEFAULT NULL,
- PRIMARY KEY (`id`,`total`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4
---- Make sure that our tables on slave are still right type ---
---- and that the alter statements replicated correctly ---
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `id` mediumint(9) NOT NULL,
- `b1` bit(8) DEFAULT NULL,
- `vc` varchar(63) DEFAULT NULL,
- `bc` char(63) DEFAULT NULL,
- `d` decimal(10,4) DEFAULT '0.0000',
- `f` float DEFAULT '0',
- `total` bigint(20) unsigned NOT NULL DEFAULT '0',
- `y` year(4) DEFAULT NULL,
- `t` date DEFAULT NULL,
- PRIMARY KEY (`id`,`total`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4
---- Perform basic operation on master ---
---- and ensure replicated correctly ---
-"--- Insert into t1 --" as "";
---- Select from t1 on master ---
-select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
-id hex(b1) vc bc d f total y t
-2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
-4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
-42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
-142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
-412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
---- Select from t1 on slave ---
-select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
-id hex(b1) vc bc d f total y t
-2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
-4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
-42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
-142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
-412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
---- Update t1 on master --
-UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
---- Check the update on master ---
-SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
-id hex(b1) vc bc d f total y t
-412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
---- Check Update on slave ---
-SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
-id hex(b1) vc bc d f total y t
-412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
---- Remove a record from t1 on master ---
-DELETE FROM t1 WHERE id = 42;
---- Show current count on master for t1 ---
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-4
---- Show current count on slave for t1 ---
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-4
-DELETE FROM t1;
---- Check that simple Alter statements are replicated correctly ---
-ALTER TABLE t1 MODIFY vc VARCHAR(255);
---- Show the new improved table on the master ---
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `id` mediumint(9) NOT NULL,
- `b1` bit(8) DEFAULT NULL,
- `vc` varchar(255) DEFAULT NULL,
- `bc` char(63) DEFAULT NULL,
- `d` decimal(10,4) DEFAULT '0.0000',
- `f` float DEFAULT '0',
- `total` bigint(20) unsigned NOT NULL DEFAULT '0',
- `y` year(4) DEFAULT NULL,
- `t` date DEFAULT NULL,
- PRIMARY KEY (`id`,`total`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4
---- Make sure that our tables on slave are still same engine ---
---- and that the alter statements replicated correctly ---
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `id` mediumint(9) NOT NULL,
- `b1` bit(8) DEFAULT NULL,
- `vc` varchar(255) DEFAULT NULL,
- `bc` char(63) DEFAULT NULL,
- `d` decimal(10,4) DEFAULT '0.0000',
- `f` float DEFAULT '0',
- `total` bigint(20) unsigned NOT NULL DEFAULT '0',
- `y` year(4) DEFAULT NULL,
- `t` date DEFAULT NULL,
- PRIMARY KEY (`id`,`total`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4
---- Perform basic operation on master ---
---- and ensure replicated correctly ---
-"--- Insert into t1 --" as "";
---- Select from t1 on master ---
-select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
-id hex(b1) vc bc d f total y t
-2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
-4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
-42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
-142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
-412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
---- Select from t1 on slave ---
-select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
-id hex(b1) vc bc d f total y t
-2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
-4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
-42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
-142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
-412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
---- Update t1 on master --
-UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
---- Check the update on master ---
-SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
-id hex(b1) vc bc d f total y t
-412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
---- Check Update on slave ---
-SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
-id hex(b1) vc bc d f total y t
-412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
---- Remove a record from t1 on master ---
-DELETE FROM t1 WHERE id = 42;
---- Show current count on master for t1 ---
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-4
---- Show current count on slave for t1 ---
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-4
-DELETE FROM t1;
---- End test 5 key partition testing ---
---- Do Cleanup ---
-DROP TABLE IF EXISTS t1;
-alter tablespace ts1
-drop datafile 'datafile.dat'
-engine=ndb;
-alter tablespace ts1
-drop datafile 'datafile02.dat'
-engine=ndb;
-DROP TABLESPACE ts1 ENGINE=NDB;
-DROP LOGFILE GROUP lg1 ENGINE=NDB;
diff --git a/mysql-test/r/rpl_ndb_extraCol.result b/mysql-test/r/rpl_ndb_extraCol.result
deleted file mode 100644
index 8f6dae7c5b5..00000000000
--- a/mysql-test/r/rpl_ndb_extraCol.result
+++ /dev/null
@@ -1,750 +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;
-**** Diff Table Def Start ****
-*** On Slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t1 (a INT, b INT PRIMARY KEY, c CHAR(20),
-d FLOAT DEFAULT '2.00',
-e CHAR(4) DEFAULT 'TEST')
-ENGINE='NDB';
-*** Create t1 on Master ***
-CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c CHAR(10)
-) ENGINE='NDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-INSERT INTO t1 () VALUES(1,2,'TEXAS'),(2,1,'AUSTIN'),(3,4,'QA');
-SELECT * FROM t1 ORDER BY a;
-a b c
-1 2 TEXAS
-2 1 AUSTIN
-3 4 QA
-*** Select from slave ***
-SELECT * FROM t1 ORDER BY a;
-a b c d e
-1 2 TEXAS NULL NULL
-2 1 AUSTIN NULL NULL
-3 4 QA NULL NULL
-*** Drop t1 ***
-DROP TABLE t1;
-*** Create t3 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t3 (a INT, b INT PRIMARY KEY, c CHAR(20),
-d FLOAT DEFAULT '2.00',
-e CHAR(5) DEFAULT 'TEST2')
-ENGINE='NDB';
-*** Create t3 on Master ***
-CREATE TABLE t3 (a BLOB, b INT PRIMARY KEY, c CHAR(20)
-) ENGINE='NDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TESTING');
-********************************************
-*** Expect slave to fail with Error 1522 ***
-********************************************
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1523
-Last_Error Column 0 type mismatch - received type 252, test.t3 has type 3
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-*** Drop t3 ***
-DROP TABLE t3;
-*** Create t4 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t4 (a INT, b INT PRIMARY KEY, c CHAR(20),
-d FLOAT DEFAULT '2.00',
-e CHAR(5) DEFAULT 'TEST2')
-ENGINE='NDB';
-*** Create t4 on Master ***
-CREATE TABLE t4 (a DECIMAL(8,2), b INT PRIMARY KEY, c CHAR(20)
-) ENGINE='NDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'),
-(30000.22,4,'QA TESTING');
-********************************************
-*** Expect slave to fail with Error 1522 ***
-********************************************
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1523
-Last_Error Column 0 type mismatch - received type 246, test.t4 has type 3
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-*** Drop t4 ***
-DROP TABLE t4;
-*** Create t5 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t5 (a INT PRIMARY KEY, b CHAR(5),
-c FLOAT, d INT, e DOUBLE,
-f DECIMAL(8,2))ENGINE='NDB';
-*** Create t5 on Master ***
-CREATE TABLE t5 (a INT PRIMARY KEY, b VARCHAR(6),
-c DECIMAL(8,2), d BIT, e BLOB,
-f FLOAT) ENGINE='NDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
-(2,'JOE',300.01,0,'b2b2',1.0000009);
-********************************************
-*** Expect slave to fail with Error 1522 ***
-********************************************
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1523
-Last_Error Column 5 type mismatch - received type 4, test.t5 has type 246
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-*** Drop t5 ***
-DROP TABLE t5;
-*** Create t6 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t6 (a INT PRIMARY KEY, b CHAR(5),
-c FLOAT, d INT)ENGINE='NDB';
-*** Create t6 on Master ***
-CREATE TABLE t6 (a INT PRIMARY KEY, b VARCHAR(6),
-c DECIMAL(8,2), d BIT
-) ENGINE='NDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
-(2,'JOE',300.01,0);
-********************************************
-*** Expect slave to fail with Error 1522 ***
-********************************************
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1523
-Last_Error Column 3 type mismatch - received type 16, test.t6 has type 3
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
-*** Drop t6 ***
-DROP TABLE t6;
-DROP TABLE t6;
-START SLAVE;
-**** Diff Table Def End ****
-**** Extra Colums Start ****
-*** Create t7 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t7 (a INT KEY, b BLOB, c CHAR(5),
-d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
-e CHAR(20) DEFAULT 'Extra Column Testing')
-ENGINE='NDB';
-*** Create t7 on Master ***
-CREATE TABLE t7 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
-) ENGINE='NDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t7 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
-SELECT * FROM t7 ORDER BY a;
-a b c
-1 b1b1 Kyle
-2 b1b1 JOE
-3 b1b1 QA
-*** Select from slave ***
-SELECT * FROM t7 ORDER BY a;
-a b c d e
-1 b1b1 Kyle NULL NULL
-2 b1b1 JOE NULL NULL
-3 b1b1 QA NULL NULL
-*** Drop t7 ***
-DROP TABLE t7;
-*** Create t8 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t8 (a INT KEY, b BLOB, c CHAR(5),
-d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
-e INT)ENGINE='NDB';
-*** Create t8 on Master ***
-CREATE TABLE t8 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
-) ENGINE='NDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t8 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
-*** Drop t8 ***
-DROP TABLE t8;
-*** Create t10 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
-c CHAR(5), e INT DEFAULT '1')ENGINE='NDB';
-*** Create t10 on Master ***
-CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
-) ENGINE='NDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
-********************************************
-*** Expect slave to fail with Error 1522 ***
-********************************************
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1523
-Last_Error Column 2 type mismatch - received type 254, test.t10 has type 5
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-*** Drop t10 ***
-DROP TABLE t10;
-*** Create t11 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
-c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='NDB';
-*** Create t11 on Master ***
-CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
-) ENGINE='NDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
-********************************************
-*** Expect slave to fail with Error 1522 ***
-********************************************
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1523
-Last_Error Column 2 type mismatch - received type 15, test.t11 has type 252
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-*** Drop t11 ***
-DROP TABLE t11;
-*** Create t12 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
-c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='NDB';
-*** Create t12 on Master ***
-CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
-) ENGINE='NDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t12 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
-SELECT * FROM t12 ORDER BY a;
-a b c
-1 b1b1b1b1b1b1b1b1 Kyle
-2 b1b1b1b1b1b1b1b1 JOE
-3 b1b1b1b1b1b1b1b1 QA
-*** Select on Slave ***
-SELECT * FROM t12 ORDER BY a;
-a b f c e
-1 b1b1b1b1b1b1b1b1 Kyle NULL NULL
-2 b1b1b1b1b1b1b1b1 JOE NULL NULL
-3 b1b1b1b1b1b1b1b1 QA NULL NULL
-*** Drop t12 ***
-DROP TABLE t12;
-**** Extra Colums End ****
-*** BUG 22177 Start ***
-*** Create t13 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t13 (a INT KEY, b BLOB, c CHAR(5),
-d INT DEFAULT '1',
-e TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='NDB';
-*** Create t13 on Master ***
-CREATE TABLE t13 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
-) ENGINE='NDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t13 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
-SELECT * FROM t13 ORDER BY a;
-a b c
-1 b1b1b1b1b1b1b1b1 Kyle
-2 b1b1b1b1b1b1b1b1 JOE
-3 b1b1b1b1b1b1b1b1 QA
-*** Select on Slave ****
-SELECT * FROM t13 ORDER BY a;
-a b c d e
-1 b1b1b1b1b1b1b1b1 Kyle NULL CURRENT_TIMESTAMP
-2 b1b1b1b1b1b1b1b1 JOE NULL CURRENT_TIMESTAMP
-3 b1b1b1b1b1b1b1b1 QA NULL CURRENT_TIMESTAMP
-*** Drop t13 ***
-DROP TABLE t13;
-*** 22117 END ***
-*** Alter Master Table Testing Start ***
-*** Create t14 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='NDB';
-*** Create t14 on Master ***
-CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='NDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
-ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
-(2,2.00,'This Test Should work',@b1,'JOE'),
-(3,3.00,'If is does not, I will open a bug',@b1,'QA');
-SELECT * FROM t14 ORDER BY c1;
-c1 c2 c3 c4 c5
-1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
-2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
-3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
-*** Select on Slave ****
-SELECT * FROM t14 ORDER BY c1;
-c1 c2 c3 c4 c5 c6 c7
-1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL CURRENT_TIMESTAMP
-2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL CURRENT_TIMESTAMP
-3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL CURRENT_TIMESTAMP
-*** connect to master and drop columns ***
-ALTER TABLE t14 DROP COLUMN c2;
-ALTER TABLE t14 DROP COLUMN c4;
-*** Select from Master ***
-SELECT * FROM t14 ORDER BY c1;
-c1 c3 c5
-1 Replication Testing Extra Col Kyle
-2 This Test Should work JOE
-3 If is does not, I will open a bug QA
-*** Select from Slave ***
-SELECT * FROM t14 ORDER BY c1;
-c1 c3 c5 c6 c7
-1 Replication Testing Extra Col Kyle NULL CURRENT_TIMESTAMP
-2 This Test Should work JOE NULL CURRENT_TIMESTAMP
-3 If is does not, I will open a bug QA NULL CURRENT_TIMESTAMP
-*** Drop t14 ***
-DROP TABLE t14;
-*** Create t15 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t15 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
-c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='NDB';
-*** Create t15 on Master ***
-CREATE TABLE t15 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
-c4 BLOB, c5 CHAR(5)) ENGINE='NDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t15 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
-(2,2.00,'This Test Should work',@b1,'JOE'),
-(3,3.00,'If is does not, I will open a bug',@b1,'QA');
-SELECT * FROM t15 ORDER BY c1;
-c1 c2 c3 c4 c5
-1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
-2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
-3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
-*** Select on Slave ****
-SELECT * FROM t15 ORDER BY c1;
-c1 c2 c3 c4 c5 c6 c7
-1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL CURRENT_TIMESTAMP
-2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL CURRENT_TIMESTAMP
-3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL CURRENT_TIMESTAMP
-*** Add column on master that is a Extra on Slave ***
-ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
-********************************************
-*** Expect slave to fail with Error 1060 ***
-********************************************
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1060
-Last_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5'
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-*** Try to insert in master ****
-INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2);
-SELECT * FROM t15 ORDER BY c1;
-c1 c2 c3 c4 c5 c6
-1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL
-2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL
-3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL
-5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2
-*** Try to select from slave ****
-SELECT * FROM t15 ORDER BY c1;
-c1 c2 c3 c4 c5 c6 c7
-1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL CURRENT_TIMESTAMP
-2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL CURRENT_TIMESTAMP
-3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL CURRENT_TIMESTAMP
-5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2 CURRENT_TIMESTAMP
-*** DROP TABLE t15 ***
-DROP TABLE t15;
-*** Create t16 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t16 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
-c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='NDB';
-*** Create t16 on Master ***
-CREATE TABLE t16 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
-c4 BLOB, c5 CHAR(5))ENGINE='NDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t16 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
-(2,2.00,'This Test Should work',@b1,'JOE'),
-(3,3.00,'If is does not, I will open a bug',@b1,'QA');
-SELECT * FROM t16 ORDER BY c1;
-c1 c2 c3 c4 c5
-1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
-2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
-3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
-*** Select on Slave ****
-SELECT * FROM t16 ORDER BY c1;
-c1 c2 c3 c4 c5 c6 c7
-1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL CURRENT_TIMESTAMP
-2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL CURRENT_TIMESTAMP
-3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL CURRENT_TIMESTAMP
-*** Add Partition on master ***
-ALTER TABLE t16 PARTITION BY KEY(c1) PARTITIONS 4;
-INSERT INTO t16 () VALUES(4,1.00,'Replication Rocks',@b1,'Omer');
-SHOW CREATE TABLE t16;
-Table Create Table
-t16 CREATE TABLE `t16` (
- `c1` int(11) NOT NULL,
- `c2` decimal(8,2) DEFAULT NULL,
- `c3` text,
- `c4` blob,
- `c5` char(5) DEFAULT NULL,
- PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
-*** Show table on Slave ****
-SHOW CREATE TABLE t16;
-Table Create Table
-t16 CREATE TABLE `t16` (
- `c1` int(11) NOT NULL,
- `c2` decimal(8,2) DEFAULT NULL,
- `c3` text,
- `c4` blob,
- `c5` char(5) DEFAULT NULL,
- `c6` int(11) DEFAULT '1',
- `c7` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
-*** DROP TABLE t16 ***
-DROP TABLE t16;
-*** Alter Master End ***
-*** Create t17 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t17 (a SMALLINT, b INT PRIMARY KEY, c CHAR(5),
-d FLOAT DEFAULT '2.00',
-e CHAR(5) DEFAULT 'TEST2')
-ENGINE='NDB';
-*** Create t17 on Master ***
-CREATE TABLE t17 (a BIGINT PRIMARY KEY, b INT, c CHAR(10)
-) ENGINE='NDB';
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
-********************************************
-*** Expect slave to fail with Error 1522 ***
-********************************************
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1523
-Last_Error Column 0 type mismatch - received type 8, test.t17 has type 2
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-** DROP table t17 ***
-DROP TABLE t17;
diff --git a/mysql-test/r/rpl_ndb_idempotent.result b/mysql-test/r/rpl_ndb_idempotent.result
deleted file mode 100644
index 2f2273c145e..00000000000
--- a/mysql-test/r/rpl_ndb_idempotent.result
+++ /dev/null
@@ -1,73 +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 (c1 CHAR(15), c2 CHAR(15), c3 INT, PRIMARY KEY (c3)) ENGINE = NDB ;
-INSERT INTO t1 VALUES ("row1","will go away",1);
-SELECT * FROM t1 ORDER BY c3;
-c1 c2 c3
-row1 will go away 1
-SELECT @the_epoch:=MAX(epoch) FROM mysql.ndb_apply_status;
-@the_epoch:=MAX(epoch)
-<the_epoch>
-SELECT * FROM t1 ORDER BY c3;
-c1 c2 c3
-row1 will go away 1
-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)
-<the_pos> master-bin.000001
-INSERT INTO t1 VALUES ("row2","will go away",2),("row3","will change",3),("row4","D",4);
-DELETE FROM t1 WHERE c3 = 1;
-UPDATE t1 SET c2="should go away" WHERE c3 = 2;
-UPDATE t1 SET c2="C" WHERE c3 = 3;
-DELETE FROM t1 WHERE c3 = 2;
-SELECT * FROM t1 ORDER BY c3;
-c1 c2 c3
-row3 C 3
-row4 D 4
-SELECT * FROM t1 ORDER BY c3;
-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
-<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
-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
-<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
-START SLAVE;
-SELECT * FROM t1 ORDER BY c3;
-c1 c2 c3
-row3 C 3
-row4 D 4
-SELECT * FROM t1 ORDER BY c3;
-c1 c2 c3
-row3 C 3
-row4 D 4
-STOP SLAVE;
-DROP TABLE t1;
-RESET master;
-DROP TABLE t1;
-RESET slave;
-START SLAVE;
-CREATE TABLE t1 (c1 CHAR(15) NOT NULL, c2 CHAR(15) NOT NULL, c3 INT NOT NULL, PRIMARY KEY (c3)) ENGINE = NDB ;
-INSERT INTO t1 VALUES ("row1","remove on slave",1);
-DELETE FROM t1;
-BEGIN;
-UPDATE t1 SET c2="does not exist" WHERE c3=1;
-INSERT INTO t1 VALUES ("row2","new on slave",2);
-COMMIT;
-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
-<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
-DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/r/rpl_ndb_log.result b/mysql-test/r/rpl_ndb_log.result
deleted file mode 100644
index db2ce27d43b..00000000000
--- a/mysql-test/r/rpl_ndb_log.result
+++ /dev/null
@@ -1,151 +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;
-stop slave;
-reset master;
-reset slave;
-reset master;
-create table t1(n int not null auto_increment primary key)ENGINE=NDB;
-insert into t1 values (NULL);
-drop table t1;
-create table t1 (word char(20) not null)ENGINE=NDB;
-load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines;
-select count(*) from t1;
-count(*)
-69
-show binlog events;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
-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
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-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
-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=NDB
-master-bin.000001 # Query 1 # BEGIN
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-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: #
-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;
-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;
-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;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-flush logs;
-create table t3 (a int)ENGINE=NDB;
-start slave;
-
-let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%' ;
-
---source include/wait_slave_status.inc
-flush logs;
-stop slave;
-create table t2 (n int)ENGINE=NDB;
-insert into t2 values (1);
-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(n int not null auto_increment primary key)ENGINE=NDB
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # use `test`; drop table t1
-master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=NDB
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: #
-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
-show binlog events in 'master-bin.000002';
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
-master-bin.000002 # Query 1 # use `test`; create table t3 (a int)ENGINE=NDB
-master-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=NDB
-master-bin.000002 # Query 1 # BEGIN
-master-bin.000002 # Table_map 1 # table_id: # (test.t2)
-master-bin.000002 # Table_map 1 # table_id: # (mysql.ndb_apply_status)
-master-bin.000002 # Write_rows 1 # table_id: #
-master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000002 # Query 1 # COMMIT
-show binary logs;
-Log_name File_size
-master-bin.000001 1775
-master-bin.000002 617
-start slave;
-show binary logs;
-Log_name File_size
-slave-bin.000001 1870
-slave-bin.000002 202
-show binlog events in 'slave-bin.000001' from 4;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
-slave-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB
-slave-bin.000001 # Query 2 # BEGIN
-slave-bin.000001 # Table_map 2 # table_id: # (test.t1)
-slave-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status)
-slave-bin.000001 # Write_rows 2 # table_id: #
-slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-slave-bin.000001 # Query 2 # COMMIT
-slave-bin.000001 # Query 1 # use `test`; drop table t1
-slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=NDB
-slave-bin.000001 # Query 2 # BEGIN
-slave-bin.000001 # Table_map 2 # table_id: # (test.t1)
-slave-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status)
-slave-bin.000001 # Write_rows 2 # table_id: #
-slave-bin.000001 # Write_rows 1 # table_id: #
-slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-slave-bin.000001 # Query 2 # COMMIT
-slave-bin.000001 # Query 1 # use `test`; create table t3 (a int)ENGINE=NDB
-slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4
-show binlog events in 'slave-bin.000002' from 4;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
-slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=NDB
-slave-bin.000002 # Query 2 # BEGIN
-slave-bin.000002 # Table_map 2 # table_id: # (test.t2)
-slave-bin.000002 # Table_map 2 # table_id: # (mysql.ndb_apply_status)
-slave-bin.000002 # Write_rows 2 # table_id: #
-slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
-slave-bin.000002 # Query 2 # COMMIT
-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
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 617 # # master-bin.000002 Yes Yes # 0 0 617 # None 0 No # No
-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;
-DROP TABLE t2;
-DROP TABLE t3;
-create table t1(a int auto_increment primary key, b int);
-insert into t1 values (NULL, 1);
-reset master;
-set insert_id=5;
-insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-select * from t1;
-a b
-1 1
-5 1
-6 1
-drop table t1;
diff --git a/mysql-test/r/rpl_ndb_stm_innodb.result b/mysql-test/r/rpl_ndb_stm_innodb.result
deleted file mode 100644
index 9ed54a11c1c..00000000000
--- a/mysql-test/r/rpl_ndb_stm_innodb.result
+++ /dev/null
@@ -1,37 +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 (a int key, b int) engine innodb;
-create table t2 (a int key, b int) engine innodb;
-alter table t1 engine ndb;
-alter table t2 engine ndb;
-insert into t1 values (1,2);
-select @start_pos:=start_pos, @end_pos:=end_pos from mysql.ndb_apply_status;
-@start_pos:=start_pos @end_pos:=end_pos
-<start_pos> <end_pos>
-show binlog events from <start_pos> limit 1;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 <start_pos> Query 1 # use `test`; insert into t1 values (1,2)
-show binlog events from <start_pos> limit 1,1;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Xid 1 445 COMMIT /* XID */
-begin;
-insert into t1 values (2,3);
-insert into t2 values (3,4);
-commit;
-select @start_pos:=start_pos, @end_pos:=end_pos from mysql.ndb_apply_status;
-@start_pos:=start_pos @end_pos:=end_pos
-<start_pos> <end_pos>
-show binlog events from <start_pos> limit 1;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 <start_pos> Query 1 # use `test`; BEGIN
-show binlog events from <start_pos> limit 1,2;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; insert into t1 values (2,3)
-master-bin.000001 # Query # # use `test`; insert into t2 values (3,4)
-show binlog events from <start_pos> limit 3,1;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Xid 1 <end_pos> COMMIT /* XID */
diff --git a/mysql-test/r/rpl_ndb_sync.result b/mysql-test/r/rpl_ndb_sync.result
deleted file mode 100644
index f2797eaa623..00000000000
--- a/mysql-test/r/rpl_ndb_sync.result
+++ /dev/null
@@ -1,96 +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;
-STOP SLAVE;
-CREATE DATABASE ndbsynctest;
-USE ndbsynctest;
-CREATE DATABASE ndbsynctest;
-USE ndbsynctest;
-CREATE TABLE t1 (c1 BIT(1) NOT NULL, c2 BIT(1) NOT NULL, c3 CHAR(15), PRIMARY KEY(c3)) ENGINE = NDB ;
-INSERT INTO t1 VALUES (1,1,"row1"),(0,1,"row2"),(1,0,"row3"),(0,0,"row4");
-CREATE TABLE t2 (c1 CHAR(15), c2 BIT(1) NOT NULL, c3 BIT(1) NOT NULL, PRIMARY KEY(c1)) ENGINE = NDB ;
-INSERT INTO t2 VALUES ("ABC",1,1),("BCDEF",0,1),("CD",1,0),("DEFGHIJKL",0,0);
-SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
-hex(c1) hex(c2) c3
-1 1 row1
-0 1 row2
-1 0 row3
-0 0 row4
-SELECT hex(c2),hex(c3),c1 FROM t2 ORDER BY c1;
-hex(c2) hex(c3) c1
-1 1 ABC
-0 1 BCDEF
-1 0 CD
-0 0 DEFGHIJKL
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-DELETE FROM test.backup_info;
-LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-SELECT @the_backup_id:=backup_id FROM test.backup_info;
-@the_backup_id:=backup_id
-<the_backup_id>
-DROP TABLE test.backup_info;
-UPDATE t1 SET c2=0 WHERE c3="row2";
-SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
-hex(c1) hex(c2) c3
-1 1 row1
-0 0 row2
-1 0 row3
-0 0 row4
-SHOW TABLES;
-Tables_in_ndbsynctest
-DROP DATABASE ndbsynctest;
-CREATE DATABASE ndbsynctest;
-USE ndbsynctest;
-SHOW TABLES;
-Tables_in_ndbsynctest
-t1
-t2
-SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
-hex(c1) hex(c2) c3
-1 1 row1
-0 1 row2
-1 0 row3
-0 0 row4
-SELECT hex(c2),hex(c3),c1 FROM t2 ORDER BY c1;
-hex(c2) hex(c3) c1
-1 1 ABC
-0 1 BCDEF
-1 0 CD
-0 0 DEFGHIJKL
-SELECT @the_epoch:=MAX(epoch) FROM mysql.ndb_apply_status;
-@the_epoch:=MAX(epoch)
-<the_epoch>
-SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
-FROM mysql.ndb_binlog_index WHERE epoch > <the_epoch> ORDER BY epoch ASC LIMIT 1;
-@the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1)
-<the_pos> master-bin.000001
-CHANGE MASTER TO
-master_log_file = 'master-bin.000001',
-master_log_pos = <the_pos> ;
-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
-<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
-SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
-hex(c1) hex(c2) c3
-1 1 row1
-0 0 row2
-1 0 row3
-0 0 row4
-SELECT hex(c2),hex(c3),c1 FROM t2 ORDER BY c1;
-hex(c2) hex(c3) c1
-1 1 ABC
-0 1 BCDEF
-1 0 CD
-0 0 DEFGHIJKL
-DROP DATABASE ndbsynctest;
-STOP SLAVE;
-reset master;
-select * from mysql.ndb_binlog_index;
-Position File epoch inserts updates deletes schemaops
-reset slave;
-select * from mysql.ndb_apply_status;
-server_id epoch log_name start_pos end_pos
diff --git a/mysql-test/r/rpl_packet.result b/mysql-test/r/rpl_packet.result
deleted file mode 100644
index 8f4a16341b6..00000000000
--- a/mysql-test/r/rpl_packet.result
+++ /dev/null
@@ -1,32 +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;
-drop database if exists DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
-create database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
-select @@net_buffer_length, @@max_allowed_packet;
-@@net_buffer_length @@max_allowed_packet
-1024 1024
-create table `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
-INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1023');
-select count(*) from `DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________`.`t1` /* must be 1 */;
-count(*)
-1
-SHOW STATUS LIKE 'Slave_running';
-Variable_name Value
-Slave_running ON
-select * from information_schema.session_status where variable_name= 'SLAVE_RUNNING';
-VARIABLE_NAME VARIABLE_VALUE
-SLAVE_RUNNING 1.0000000
-drop database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
-SET @@global.max_allowed_packet=4096;
-SET @@global.net_buffer_length=4096;
-STOP SLAVE;
-START SLAVE;
-CREATE TABLe `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
-INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
-SHOW STATUS LIKE 'Slave_running';
-Variable_name Value
-Slave_running OFF
diff --git a/mysql-test/r/rpl_ps.result b/mysql-test/r/rpl_ps.result
deleted file mode 100644
index 73c36af4862..00000000000
--- a/mysql-test/r/rpl_ps.result
+++ /dev/null
@@ -1,30 +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;
-drop table if exists t1;
-create table t1(n char(30));
-prepare stmt1 from 'insert into t1 values (?)';
-set @var1= "from-master-1";
-execute stmt1 using @var1;
-set @var1= "from-master-2-'',";
-execute stmt1 using @var1;
-SELECT * FROM t1 ORDER BY n;
-n
-from-master-1
-from-master-2-'',
-set @var2= 'insert into t1 values (concat("from-var-", ?))';
-prepare stmt2 from @var2;
-set @var1='from-master-3';
-execute stmt2 using @var1;
-SELECT * FROM t1 ORDER BY n;
-n
-from-master-1
-from-master-2-'',
-from-var-from-master-3
-drop table t1;
-stop slave;
-reset master;
-reset slave;
diff --git a/mysql-test/r/rpl_rbr_to_sbr.result b/mysql-test/r/rpl_rbr_to_sbr.result
deleted file mode 100644
index 47adb70bcf5..00000000000
--- a/mysql-test/r/rpl_rbr_to_sbr.result
+++ /dev/null
@@ -1,67 +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;
-SET BINLOG_FORMAT=MIXED;
-SET GLOBAL BINLOG_FORMAT=MIXED;
-SELECT @@GLOBAL.BINLOG_FORMAT, @@SESSION.BINLOG_FORMAT;
-@@GLOBAL.BINLOG_FORMAT @@SESSION.BINLOG_FORMAT
-MIXED MIXED
-**** On Master ****
-CREATE TABLE t1 (a INT, b LONG);
-INSERT INTO t1 VALUES (1,1), (2,2);
-INSERT INTO t1 VALUES (3,UUID()), (4,UUID());
-SHOW BINLOG EVENTS;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
-master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1 (a INT, b LONG)
-master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES (1,1), (2,2)
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-**** On Slave ****
-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 454
-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 454
-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
-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
-slave-bin.000001 # Query 2 # use `test`; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9
-slave-bin.000001 # Query 1 # use `test`; CREATE TABLE t1 (a INT, b LONG)
-slave-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES (1,1), (2,2)
-slave-bin.000001 # Table_map 1 # table_id: # (test.t1)
-slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/r/rpl_redirect.result b/mysql-test/r/rpl_redirect.result
deleted file mode 100644
index 64866df1c15..00000000000
--- a/mysql-test/r/rpl_redirect.result
+++ /dev/null
@@ -1,41 +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;
-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
-SHOW SLAVE HOSTS;
-Server_id Host Port Rpl_recovery_rank Master_id
-2 127.0.0.1 SLAVE_PORT 2 1
-create table t1 ( n int);
-insert into t1 values (1),(2),(3),(4);
-insert into t1 values(5);
-SELECT * FROM t1 ORDER BY n;
-n
-1
-2
-3
-4
-5
-SELECT * FROM t1 ORDER BY n;
-n
-1
-2
-3
-4
-SELECT * FROM t1 ORDER BY n;
-n
-1
-2
-3
-4
-SELECT * FROM t1 ORDER BY n;
-n
-1
-2
-3
-4
-5
-drop table t1;
diff --git a/mysql-test/r/rpl_replicate_do.result b/mysql-test/r/rpl_replicate_do.result
deleted file mode 100644
index fa4f7e224d1..00000000000
--- a/mysql-test/r/rpl_replicate_do.result
+++ /dev/null
@@ -1,77 +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;
-drop table if exists t11;
-drop table if exists t11;
-create table t2 (n int);
-insert into t2 values(4);
-create table t2 (s char(20));
-load data infile '../std_data_ln/words.dat' into table t2;
-insert into t2 values('five');
-create table t1 (m int);
-insert into t1 values(15),(16),(17);
-update t1 set m=20 where m=16;
-delete from t1 where m=17;
-create table t11 select * from t1;
-select * from t1 ORDER BY m;
-m
-15
-20
-select * from t2;
-n
-4
-select * from t11;
-ERROR 42S02: Table 'test.t11' doesn't exist
-drop table if exists t1,t2,t11;
-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
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 # # # master-bin.000001 Yes Yes test.t1 # 0 0 # # None 0 No # No
-create table t1 (ts timestamp);
-set one_shot time_zone='met';
-insert into t1 values('2005-08-12 00:00:00');
-set one_shot time_zone='met';
-select * from t1;
-ts
-2005-08-12 00:00:00
-set one_shot time_zone='met';
-select * from t1;
-ts
-2005-08-12 00:00:00
-drop table t1;
-*** master ***
-create table t1 (a int, b int);
-create trigger trg1 before insert on t1 for each row set new.b=2;
-create table t2 (a int, b int);
-create trigger trg2 before insert on t2 for each row set new.b=2;
-show tables;
-Tables_in_test
-t1
-t2
-show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
-trg1 INSERT t1 set new.b=2 BEFORE NULL root@localhost
-trg2 INSERT t2 set new.b=2 BEFORE NULL root@localhost
-*** slave ***
-show tables;
-Tables_in_test
-t1
-show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
-trg1 INSERT t1 set new.b=2 BEFORE NULL root@localhost
-*** master ***
-drop trigger trg1;
-drop trigger trg2;
-show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
-*** slave ***
-show tables;
-Tables_in_test
-t1
-show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
-*** master ***
-drop table t1;
-drop table t2;
diff --git a/mysql-test/r/rpl_rotate_logs.result b/mysql-test/r/rpl_rotate_logs.result
deleted file mode 100644
index 9adde45f87a..00000000000
--- a/mysql-test/r/rpl_rotate_logs.result
+++ /dev/null
@@ -1,94 +0,0 @@
-drop table if exists t1, t2, t3, t4;
-drop table if exists t1, t2, t3, t4;
-start slave;
-Got one of the listed errors
-start slave;
-ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log
-change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
-ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log
-reset slave;
-change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
-reset master;
-start slave;
-create temporary table temp_table (a char(80) not null);
-insert into temp_table values ("testing temporary tables");
-create table t1 (s text);
-insert into t1 values('Could not break slave'),('Tried hard');
-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
-# 127.0.0.1 root MASTER_PORT 60 master-bin.000001 556 # # master-bin.000001 Yes Yes # 0 0 556 # None 0 No # No
-select * from t1;
-s
-Could not break slave
-Tried hard
-flush logs;
-create table t2(m int not null auto_increment primary key);
-insert into t2 values (34),(67),(123);
-flush logs;
-show binary logs;
-Log_name File_size
-master-bin.000001 600
-master-bin.000002 371
-master-bin.000003 106
-create table t3 select * from temp_table;
-select * from t3;
-a
-testing temporary tables
-drop table temp_table, t3;
-insert into t2 values(1234);
-set insert_id=1234;
-insert into t2 values(NULL);
-set global sql_slave_skip_counter=1;
-start slave;
-purge master logs to 'master-bin.000002';
-show master logs;
-Log_name File_size
-master-bin.000002 371
-master-bin.000003 415
-purge binary logs to 'master-bin.000002';
-show binary logs;
-Log_name File_size
-master-bin.000002 371
-master-bin.000003 415
-purge master logs before now();
-show binary logs;
-Log_name File_size
-master-bin.000003 415
-insert into t2 values (65);
-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
-# 127.0.0.1 root MASTER_PORT 60 master-bin.000003 504 # # master-bin.000003 Yes Yes # 0 0 504 # None 0 No # No
-select * from t2;
-m
-34
-65
-67
-123
-1234
-create temporary table temp_table (a char(80) not null);
-insert into temp_table values ("testing temporary tables part 2");
-create table t3 (n int);
-select count(*) from t3 where n >= 4;
-count(*)
-100
-create table t4 select * from temp_table;
-show binary logs;
-Log_name File_size
-master-bin.000003 4193
-master-bin.000004 4198
-master-bin.000005 2040
-show master status;
-File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000005 2040
-select * from t4;
-a
-testing temporary tables part 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
-# 127.0.0.1 root MASTER_PORT 60 master-bin.000005 2040 # # master-bin.000005 Yes Yes # 0 0 2040 # None 0 No # No
-lock tables t3 read;
-select count(*) from t3 where n >= 4;
-count(*)
-100
-unlock tables;
-drop table if exists t1,t2,t3,t4;
diff --git a/mysql-test/r/rpl_row_UUID.result b/mysql-test/r/rpl_row_UUID.result
deleted file mode 100644
index f56dc145901..00000000000
--- a/mysql-test/r/rpl_row_UUID.result
+++ /dev/null
@@ -1,40 +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;
-DROP PROCEDURE IF EXISTS test.p1;
-DROP TABLE IF EXISTS test.t1;
-CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, vchar_column VARCHAR(100), PRIMARY KEY(a)) engine=myisam;
-INSERT INTO test.t1 VALUES(1,UUID(),UUID());
-create procedure test.p1()
-begin
-INSERT INTO test.t1 VALUES(2,UUID(),UUID());
-INSERT INTO test.t1 VALUES(3,UUID(),UUID());
-end|
-CALL test.p1();
-create function test.fn1(x int)
-returns int
-begin
-insert into t1 values (4+x,UUID(),UUID());
-insert into t1 values (5+x,UUID(),UUID());
-return 0;
-end|
-select fn1(0);
-fn1(0)
-0
-create table t2 (a int);
-insert into t2 values(fn1(2));
-SHOW CREATE TABLE test.t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL DEFAULT '0',
- `blob_column` longblob,
- `vchar_column` varchar(100) DEFAULT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-DROP PROCEDURE test.p1;
-DROP FUNCTION test.fn1;
-DROP TABLE test.t1;
-DROP TABLE test.t2;
diff --git a/mysql-test/r/rpl_row_basic_11bugs.result b/mysql-test/r/rpl_row_basic_11bugs.result
deleted file mode 100644
index 1025b965589..00000000000
--- a/mysql-test/r/rpl_row_basic_11bugs.result
+++ /dev/null
@@ -1,220 +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 DATABASE test_ignore;
-**** On Master ****
-SHOW DATABASES;
-Database
-information_schema
-mysql
-test
-test_ignore
-USE test;
-CREATE TABLE t1 (a INT, b INT);
-SHOW TABLES;
-Tables_in_test
-t1
-INSERT INTO t1 VALUES (1,1), (2,2);
-USE test_ignore;
-CREATE TABLE t2 (a INT, b INT);
-SHOW TABLES;
-Tables_in_test_ignore
-t2
-INSERT INTO t2 VALUES (3,3), (4,4);
-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, b INT)
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-**** On Slave ****
-SHOW DATABASES;
-Database
-information_schema
-mysql
-test
-USE test;
-SHOW TABLES;
-Tables_in_test
-t1
-USE test_ignore;
-ERROR 42000: Unknown database 'test_ignore'
-DROP DATABASE test_ignore;
-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);
-DELETE FROM t1;
-INSERT INTO t1 VALUES (1),(2);
-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 Table_map 1 231 table_id: # (test.t1)
-master-bin.000001 231 Write_rows 1 270 table_id: # flags: STMT_END_F
-DROP TABLE t1;
-================ Test for BUG#17620 ================
-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;
-**** On Slave ****
-SET GLOBAL QUERY_CACHE_SIZE=0;
-**** On Master ****
-CREATE TABLE t1 (a INT);
-INSERT INTO t1 VALUES (1),(2),(3);
-**** On Slave ****
-SET GLOBAL QUERY_CACHE_SIZE=16*1024*1024;
-**** On Master ****
-INSERT INTO t1 VALUES (4),(5),(6);
-**** On Slave ****
-SELECT * FROM t1;
-a
-1
-2
-3
-4
-5
-6
-**** On Master ****
-INSERT INTO t1 VALUES (7),(8),(9);
-**** On Slave ****
-SELECT * FROM t1;
-a
-1
-2
-3
-4
-5
-6
-7
-8
-9
-SET GLOBAL QUERY_CACHE_SIZE=0;
-================ Test for BUG#22550 ================
-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 BIT(1), b INT) ENGINE=MYISAM;
-INSERT INTO t1 VALUES(1,2);
-SELECT HEX(a),b FROM t1;
-HEX(a) b
-1 2
-SELECT HEX(a),b FROM t1;
-HEX(a) b
-1 2
-UPDATE t1 SET a=0 WHERE b=2;
-SELECT HEX(a),b FROM t1;
-HEX(a) b
-0 2
-SELECT HEX(a),b FROM t1;
-HEX(a) b
-0 2
-DROP TABLE IF EXISTS t1;
-================ Test for BUG#22583 ================
-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;
-**** On Master ****
-CREATE TABLE t1_myisam (k INT, a BIT(1), b BIT(9)) ENGINE=MYISAM;
-CREATE TABLE t1_innodb (k INT, a BIT(1), b BIT(9)) ENGINE=INNODB;
-CREATE TABLE t2_myisam (k INT, a BIT(1) NOT NULL, b BIT(4) NOT NULL) ENGINE=MYISAM;
-CREATE TABLE t2_innodb (k INT, a BIT(1) NOT NULL, b BIT(4) NOT NULL) ENGINE=INNODB;
-**** On Slave ****
-ALTER TABLE t1_myisam ENGINE=INNODB;
-ALTER TABLE t1_innodb ENGINE=MYISAM;
-ALTER TABLE t2_myisam ENGINE=INNODB;
-ALTER TABLE t2_innodb ENGINE=MYISAM;
-**** On Master ****
-INSERT INTO t1_myisam VALUES(1, b'0', 257);
-INSERT INTO t1_myisam VALUES(2, b'1', 256);
-INSERT INTO t1_innodb VALUES(1, b'0', 257);
-INSERT INTO t1_innodb VALUES(2, b'1', 256);
-SELECT k, HEX(a),HEX(b) FROM t1_myisam;
-k HEX(a) HEX(b)
-1 0 101
-2 1 100
-SELECT k, HEX(a),HEX(b) FROM t1_innodb;
-k HEX(a) HEX(b)
-1 0 101
-2 1 100
-INSERT INTO t2_myisam VALUES(1, b'0', 9);
-INSERT INTO t2_myisam VALUES(2, b'1', 8);
-INSERT INTO t2_innodb VALUES(1, b'0', 9);
-INSERT INTO t2_innodb VALUES(2, b'1', 8);
-SELECT k, HEX(a),HEX(b) FROM t2_myisam;
-k HEX(a) HEX(b)
-1 0 9
-2 1 8
-SELECT k, HEX(a),HEX(b) FROM t2_innodb;
-k HEX(a) HEX(b)
-1 0 9
-2 1 8
-**** On Slave ****
-SELECT k, HEX(a),HEX(b) FROM t1_myisam;
-k HEX(a) HEX(b)
-1 0 101
-2 1 100
-SELECT k, HEX(a),HEX(b) FROM t1_innodb;
-k HEX(a) HEX(b)
-1 0 101
-2 1 100
-SELECT k, HEX(a),HEX(b) FROM t2_myisam;
-k HEX(a) HEX(b)
-1 0 9
-2 1 8
-SELECT k, HEX(a),HEX(b) FROM t2_innodb;
-k HEX(a) HEX(b)
-1 0 9
-2 1 8
-**** On Master ****
-UPDATE t1_myisam SET a=0 WHERE k=2;
-SELECT k, HEX(a),HEX(b) FROM t1_myisam;
-k HEX(a) HEX(b)
-1 0 101
-2 0 100
-UPDATE t1_innodb SET a=0 WHERE k=2;
-SELECT k, HEX(a),HEX(b) FROM t1_innodb;
-k HEX(a) HEX(b)
-1 0 101
-2 0 100
-UPDATE t2_myisam SET a=0 WHERE k=2;
-SELECT k, HEX(a),HEX(b) FROM t2_myisam;
-k HEX(a) HEX(b)
-1 0 9
-2 0 8
-UPDATE t2_innodb SET a=0 WHERE k=2;
-SELECT k, HEX(a),HEX(b) FROM t2_innodb;
-k HEX(a) HEX(b)
-1 0 9
-2 0 8
-**** On Slave ****
-SELECT k, HEX(a),HEX(b) FROM t1_myisam;
-k HEX(a) HEX(b)
-1 0 101
-2 0 100
-SELECT k, HEX(a),HEX(b) FROM t1_innodb;
-k HEX(a) HEX(b)
-1 0 101
-2 0 100
-SELECT k, HEX(a),HEX(b) FROM t2_myisam;
-k HEX(a) HEX(b)
-1 0 9
-2 0 8
-SELECT k, HEX(a),HEX(b) FROM t2_innodb;
-k HEX(a) HEX(b)
-1 0 9
-2 0 8
-**** On Master ****
-DROP TABLE IF EXISTS t1_myisam, t1_innodb, t2_myisam, t2_innodb;
diff --git a/mysql-test/r/rpl_row_create_table.result b/mysql-test/r/rpl_row_create_table.result
deleted file mode 100644
index e76ce5b962d..00000000000
--- a/mysql-test/r/rpl_row_create_table.result
+++ /dev/null
@@ -1,403 +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 (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 216;
-Log_name #
-Pos 216
-Event_type Query
-Server_id #
-End_log_pos 309
-Info use `test`; CREATE TABLE t1 (a INT, b INT)
-Log_name #
-Pos 309
-Event_type Query
-Server_id #
-End_log_pos 415
-Info use `test`; CREATE TABLE t2 (a INT, b INT) ENGINE=Merge
-Log_name #
-Pos 415
-Event_type Query
-Server_id #
-End_log_pos 521
-Info use `test`; CREATE TABLE t3 (a INT, b INT) CHARSET=utf8
-Log_name #
-Pos 521
-Event_type Query
-Server_id #
-End_log_pos 640
-Info use `test`; CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8
-**** On Master ****
-SHOW CREATE TABLE t1;
-Table t1
-Create Table CREATE TABLE `t1` (
- `a` int(11) DEFAULT NULL,
- `b` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SHOW CREATE TABLE t2;
-Table t2
-Create Table CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` int(11) DEFAULT NULL
-) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=()
-SHOW CREATE TABLE t3;
-Table t3
-Create Table CREATE TABLE `t3` (
- `a` int(11) DEFAULT NULL,
- `b` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=utf8
-**** On Slave ****
-SHOW CREATE TABLE t1;
-Table t1
-Create Table CREATE TABLE `t1` (
- `a` int(11) DEFAULT NULL,
- `b` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1
-SHOW CREATE TABLE t2;
-Table t2
-Create Table CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` int(11) DEFAULT NULL
-) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=()
-SHOW CREATE TABLE t3;
-Table t3
-Create Table CREATE TABLE `t3` (
- `a` int(11) DEFAULT NULL,
- `b` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=utf8
-CREATE TABLE t5 (b INT, c INT) SELECT * FROM t3;
-CREATE TEMPORARY TABLE tt3 (a INT, b INT);
-INSERT INTO tt3 VALUES (1,2), (2,4), (3,6), (4,2), (5,10), (6,12);
-CREATE TABLE t6 (b INT, c INT) SELECT * FROM tt3;
-**** On Master ****
-SHOW CREATE TABLE t5;
-Table t5
-Create Table CREATE TABLE `t5` (
- `c` int(11) DEFAULT NULL,
- `a` int(11) DEFAULT NULL,
- `b` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT * FROM t5 ORDER BY a,b,c;
-c a b
-SHOW CREATE TABLE t6;
-Table t6
-Create Table CREATE TABLE `t6` (
- `c` int(11) DEFAULT NULL,
- `a` int(11) DEFAULT NULL,
- `b` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT * FROM t6 ORDER BY a,b,c;
-c a b
-NULL 1 2
-NULL 2 4
-NULL 3 6
-NULL 4 2
-NULL 5 10
-NULL 6 12
-**** On Slave ****
-SHOW CREATE TABLE t5;
-Table t5
-Create Table CREATE TABLE `t5` (
- `c` int(11) DEFAULT NULL,
- `a` int(11) DEFAULT NULL,
- `b` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1
-SELECT * FROM t5 ORDER BY a,b,c;
-c a b
-SHOW CREATE TABLE t6;
-Table t6
-Create Table CREATE TABLE `t6` (
- `c` int(11) DEFAULT NULL,
- `a` int(11) DEFAULT NULL,
- `b` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1
-SELECT * FROM t6 ORDER BY a,b,c;
-c a b
-NULL 1 2
-NULL 2 4
-NULL 3 6
-NULL 4 2
-NULL 5 10
-NULL 6 12
-CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3;
-ERROR 23000: Duplicate entry '2' for key 'b'
-SHOW BINLOG EVENTS FROM 1098;
-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;
-ERROR 23000: Duplicate entry '2' for key 'b'
-SELECT * FROM t7 ORDER BY a,b;
-a b
-1 2
-2 4
-3 6
-SHOW BINLOG EVENTS FROM 1098;
-Log_name Pos Event_type Server_id End_log_pos Info
-# 1098 Query # 1198 use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE)
-# 1198 Table_map # 1238 table_id: # (test.t7)
-# 1238 Write_rows # 1294 table_id: # flags: STMT_END_F
-SELECT * FROM t7 ORDER BY a,b;
-a b
-1 2
-2 4
-3 6
-CREATE TEMPORARY TABLE tt4 (a INT, b INT);
-INSERT INTO tt4 VALUES (4,8), (5,10), (6,12);
-BEGIN;
-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 1294;
-Log_name Pos Event_type Server_id End_log_pos Info
-# 1294 Table_map # 1334 table_id: # (test.t7)
-# 1334 Write_rows # 1390 table_id: # flags: STMT_END_F
-SELECT * FROM t7 ORDER BY a,b;
-a b
-1 2
-2 4
-3 6
-4 8
-5 10
-6 12
-SELECT * FROM t7 ORDER BY a,b;
-a b
-1 2
-2 4
-3 6
-4 8
-5 10
-6 12
-CREATE TABLE t8 LIKE t4;
-CREATE TABLE t9 LIKE tt4;
-CREATE TEMPORARY TABLE tt5 LIKE t4;
-CREATE TEMPORARY TABLE tt6 LIKE tt4;
-CREATE TEMPORARY TABLE tt7 SELECT 1;
-**** On Master ****
-SHOW CREATE TABLE t8;
-Table t8
-Create Table CREATE TABLE `t8` (
- `a` int(11) DEFAULT NULL,
- `b` int(11) DEFAULT NULL
-) ENGINE=MRG_MyISAM DEFAULT CHARSET=utf8 UNION=()
-SHOW CREATE TABLE t9;
-Table t9
-Create Table CREATE TABLE `t9` (
- `a` int(11) DEFAULT NULL,
- `b` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SHOW BINLOG EVENTS FROM 1390;
-Log_name Pos Event_type Server_id End_log_pos Info
-# 1390 Query # 1476 use `test`; CREATE TABLE t8 LIKE t4
-# 1476 Query # 1615 use `test`; CREATE TABLE `t9` (
- `a` int(11) DEFAULT NULL,
- `b` int(11) DEFAULT NULL
-)
-**** On Slave ****
-SHOW CREATE TABLE t8;
-Table t8
-Create Table CREATE TABLE `t8` (
- `a` int(11) DEFAULT NULL,
- `b` int(11) DEFAULT NULL
-) ENGINE=MRG_MyISAM DEFAULT CHARSET=utf8 UNION=()
-SHOW CREATE TABLE t9;
-Table t9
-Create Table CREATE TABLE `t9` (
- `a` int(11) DEFAULT NULL,
- `b` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1
-DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
-STOP SLAVE;
-SET GLOBAL storage_engine=@storage_engine;
-START SLAVE;
-================ BUG#22864 ================
-STOP SLAVE;
-RESET SLAVE;
-RESET MASTER;
-START SLAVE;
-SET AUTOCOMMIT=0;
-CREATE TABLE t1 (a INT);
-INSERT INTO t1 VALUES (1),(2),(3);
-CREATE TABLE t2 ENGINE=INNODB SELECT * FROM t1;
-ROLLBACK;
-CREATE TABLE t3 ENGINE=INNODB SELECT * FROM t1;
-INSERT INTO t3 VALUES (4),(5),(6);
-ROLLBACK;
-CREATE TABLE t4 ENGINE=INNODB SELECT * FROM t1;
-INSERT INTO t1 VALUES (4),(5),(6);
-ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-SHOW TABLES;
-Tables_in_test
-t1
-t2
-t3
-t4
-SELECT TABLE_NAME,ENGINE
-FROM INFORMATION_SCHEMA.TABLES
-WHERE TABLE_NAME LIKE 't_'
-ORDER BY TABLE_NAME;
-TABLE_NAME ENGINE
-t1 MyISAM
-t2 InnoDB
-t3 InnoDB
-t4 InnoDB
-SELECT * FROM t1 ORDER BY a;
-a
-1
-2
-3
-4
-5
-6
-SELECT * FROM t2 ORDER BY a;
-a
-1
-2
-3
-SELECT * FROM t3 ORDER BY a;
-a
-1
-2
-3
-SELECT * FROM t4 ORDER BY a;
-a
-1
-2
-3
-SHOW BINLOG EVENTS;
-Log_name Pos Event_type Server_id End_log_pos Info
-# 4 Format_desc # 106 Server ver: #, Binlog ver: #
-# 106 Query # 192 use `test`; CREATE TABLE t1 (a INT)
-# 192 Table_map # 231 table_id: # (test.t1)
-# 231 Write_rows # 275 table_id: # flags: STMT_END_F
-# 275 Query # 343 use `test`; BEGIN
-# 343 Query # 125 use `test`; CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL
-) ENGINE=InnoDB
-# 468 Table_map # 164 table_id: # (test.t2)
-# 507 Write_rows # 208 table_id: # flags: STMT_END_F
-# 551 Xid # 578 COMMIT /* XID */
-# 578 Query # 646 use `test`; BEGIN
-# 646 Query # 125 use `test`; CREATE TABLE `t3` (
- `a` int(11) DEFAULT NULL
-) ENGINE=InnoDB
-# 771 Table_map # 164 table_id: # (test.t3)
-# 810 Write_rows # 208 table_id: # flags: STMT_END_F
-# 854 Xid # 881 COMMIT /* XID */
-# 881 Query # 949 use `test`; BEGIN
-# 949 Query # 125 use `test`; CREATE TABLE `t4` (
- `a` int(11) DEFAULT NULL
-) ENGINE=InnoDB
-# 1074 Table_map # 164 table_id: # (test.t4)
-# 1113 Write_rows # 208 table_id: # flags: STMT_END_F
-# 1157 Xid # 1184 COMMIT /* XID */
-# 1184 Table_map # 1223 table_id: # (test.t1)
-# 1223 Write_rows # 1267 table_id: # flags: STMT_END_F
-SHOW TABLES;
-Tables_in_test
-t1
-t2
-t3
-t4
-SELECT TABLE_NAME,ENGINE
-FROM INFORMATION_SCHEMA.TABLES
-WHERE TABLE_NAME LIKE 't_'
-ORDER BY TABLE_NAME;
-TABLE_NAME ENGINE
-t1 MyISAM
-t2 InnoDB
-t3 InnoDB
-t4 InnoDB
-SELECT * FROM t1 ORDER BY a;
-a
-1
-2
-3
-4
-5
-6
-SELECT * FROM t2 ORDER BY a;
-a
-1
-2
-3
-SELECT * FROM t3 ORDER BY a;
-a
-1
-2
-3
-SELECT * FROM t4 ORDER BY a;
-a
-1
-2
-3
-DROP TABLE IF EXISTS t1,t2,t3,t4;
-SET AUTOCOMMIT=1;
-STOP SLAVE;
-RESET SLAVE;
-RESET MASTER;
-START SLAVE;
-CREATE TABLE t1 (a INT);
-INSERT INTO t1 VALUES (1),(2),(3);
-CREATE TABLE t2 (a INT) ENGINE=INNODB;
-BEGIN;
-INSERT INTO t2 SELECT a*a FROM t1;
-CREATE TEMPORARY TABLE tt1
-SELECT a+1 AS a
-FROM t1
-WHERE a MOD 2 = 1;
-INSERT INTO t2 SELECT a+2 FROM tt1;
-COMMIT;
-SELECT * FROM t2 ORDER BY a;
-a
-1
-4
-4
-6
-9
-SHOW BINLOG EVENTS;
-Log_name Pos Event_type Server_id End_log_pos Info
-# 4 Format_desc # 106 Server ver: #, Binlog ver: #
-# 106 Query # 192 use `test`; CREATE TABLE t1 (a INT)
-# 192 Table_map # 231 table_id: # (test.t1)
-# 231 Write_rows # 275 table_id: # flags: STMT_END_F
-# 275 Query # 375 use `test`; CREATE TABLE t2 (a INT) ENGINE=INNODB
-# 375 Query # 443 use `test`; BEGIN
-# 443 Table_map # 39 table_id: # (test.t2)
-# 482 Write_rows # 83 table_id: # flags: STMT_END_F
-# 526 Table_map # 122 table_id: # (test.t2)
-# 565 Write_rows # 161 table_id: # flags: STMT_END_F
-# 604 Xid # 631 COMMIT /* XID */
-SELECT * FROM t2 ORDER BY a;
-a
-1
-4
-4
-6
-9
-TRUNCATE TABLE t2;
-BEGIN;
-INSERT INTO t2 SELECT a*a FROM t1;
-CREATE TEMPORARY TABLE tt2
-SELECT a+1 AS a
-FROM t1
-WHERE a MOD 2 = 1;
-INSERT INTO t2 SELECT a+2 FROM tt2;
-ROLLBACK;
-SELECT * FROM t2 ORDER BY a;
-a
-SHOW BINLOG EVENTS FROM 631;
-Log_name Pos Event_type Server_id End_log_pos Info
-# 631 Query # 80 use `test`; TRUNCATE TABLE t2
-# 711 Xid # 738 COMMIT /* XID */
-SELECT * FROM t2 ORDER BY a;
-a
-DROP TABLE t1,t2;
diff --git a/mysql-test/r/rpl_row_flsh_tbls.result b/mysql-test/r/rpl_row_flsh_tbls.result
deleted file mode 100644
index 942a6b83bf6..00000000000
--- a/mysql-test/r/rpl_row_flsh_tbls.result
+++ /dev/null
@@ -1,33 +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 (a int);
-insert into t1 values (10);
-create table t2 (a int);
-create table t3 (a int) engine=merge union(t1);
-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 619 ;
-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 619 ;
-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
-select * from t3;
-a
-stop slave;
-drop table t1;
-flush tables with read lock;
-start slave;
-stop slave;
-ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
-drop table t3, t4, t5;
diff --git a/mysql-test/r/rpl_row_inexist_tbl.result b/mysql-test/r/rpl_row_inexist_tbl.result
deleted file mode 100644
index 4412a1fa75c..00000000000
--- a/mysql-test/r/rpl_row_inexist_tbl.result
+++ /dev/null
@@ -1,55 +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 (a int not null primary key);
-insert into t1 values (1);
-create table t2 (a int);
-insert into t2 values (1);
-update t1, t2 set t1.a = 0 where t1.a = t2.a;
-show tables;
-Tables_in_test
-t1
-select * from t1;
-a
-0
-drop table t1;
-insert into t1 values (1);
-show slave status;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port MASTER_MYPORT
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table test.t2
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1146
-Last_Error Error 'Table 'test.t1' doesn't exist' on opening table `test`.`t1`
-Skip_Counter 0
-Exec_Master_Log_Pos 524
-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
-drop table t1, t2;
diff --git a/mysql-test/r/rpl_row_insert_delayed.result b/mysql-test/r/rpl_row_insert_delayed.result
deleted file mode 100644
index 2044672f49d..00000000000
--- a/mysql-test/r/rpl_row_insert_delayed.result
+++ /dev/null
@@ -1,48 +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;
-set @old_global_binlog_format = @@global.binlog_format;
-set @@global.binlog_format = row;
-CREATE SCHEMA IF NOT EXISTS mysqlslap;
-USE mysqlslap;
-select @@global.binlog_format;
-@@global.binlog_format
-ROW
-CREATE TABLE t1 (id INT primary key auto_increment, name VARCHAR(64));
-FLUSH TABLE t1;
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-5000
-use mysqlslap;
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-5000
-truncate table t1;
-insert delayed into t1 values(10, "my name");
-insert delayed into t1 values(10, "is Bond"), (20, "James Bond");
-flush table t1;
-select * from t1;
-id name
-10 my name
-20 James Bond
-select * from t1;
-id name
-10 my name
-20 James Bond
-delete from t1 where id!=10;
-insert delayed into t1 values(20, "is Bond"), (10, "James Bond");
-flush table t1;
-select * from t1;
-id name
-10 my name
-20 is Bond
-select * from t1;
-id name
-10 my name
-20 is Bond
-USE test;
-DROP SCHEMA mysqlslap;
-set @@global.binlog_format = @old_global_binlog_format;
diff --git a/mysql-test/r/rpl_row_log.result b/mysql-test/r/rpl_row_log.result
deleted file mode 100644
index 9de0d3d0ebb..00000000000
--- a/mysql-test/r/rpl_row_log.result
+++ /dev/null
@@ -1,116 +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;
-stop slave;
-reset master;
-reset slave;
-reset master;
-create table t1(n int not null auto_increment primary key)ENGINE=MyISAM;
-insert into t1 values (NULL);
-drop table t1;
-create table t1 (word char(20) not null)ENGINE=MyISAM;
-load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines;
-select count(*) from t1;
-count(*)
-69
-show binlog events;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
-master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM
-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 # 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 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-show binlog events from 106 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;
-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 # Table_map 1 # table_id: # (test.t1)
-show binlog events from 106 limit 2,1;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-flush logs;
-create table t3 (a int)ENGINE=MyISAM;
-start slave;
-
-let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%' ;
-
---source include/wait_slave_status.inc
-flush logs;
-stop slave;
-create table t2 (n int)ENGINE=MyISAM;
-insert into t2 values (1);
-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(n int not null auto_increment primary key)ENGINE=MyISAM
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `test`; drop table t1
-master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Rotate # # master-bin.000002;pos=4
-show binlog events in 'master-bin.000002';
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
-master-bin.000002 # Query 1 # use `test`; create table t3 (a int)ENGINE=MyISAM
-master-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM
-master-bin.000002 # Table_map 1 # table_id: # (test.t2)
-master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
-show binary logs;
-Log_name File_size
-master-bin.000001 1260
-master-bin.000002 377
-start slave;
-show binary logs;
-Log_name File_size
-slave-bin.000001 1358
-slave-bin.000002 278
-show binlog events in 'slave-bin.000001' from 4;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
-slave-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM
-slave-bin.000001 # Table_map 1 # table_id: # (test.t1)
-slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-slave-bin.000001 # Query 1 # use `test`; drop table t1
-slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
-slave-bin.000001 # Table_map 1 # table_id: # (test.t1)
-slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-slave-bin.000001 # Query 1 # use `test`; create table t3 (a int)ENGINE=MyISAM
-slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4
-show binlog events in 'slave-bin.000002' from 4;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
-slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM
-slave-bin.000002 # Table_map 1 # table_id: # (test.t2)
-slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
-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
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 377 # # master-bin.000002 Yes Yes # 0 0 377 # None 0 No # No
-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;
-DROP TABLE t2;
-DROP TABLE t3;
-create table t1(a int auto_increment primary key, b int);
-insert into t1 values (NULL, 1);
-reset master;
-set insert_id=5;
-insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-select * from t1;
-a b
-1 1
-5 1
-6 1
-drop table t1;
diff --git a/mysql-test/r/rpl_row_log_innodb.result b/mysql-test/r/rpl_row_log_innodb.result
deleted file mode 100644
index 4d8175142b2..00000000000
--- a/mysql-test/r/rpl_row_log_innodb.result
+++ /dev/null
@@ -1,124 +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;
-stop slave;
-reset master;
-reset slave;
-reset master;
-create table t1(n int not null auto_increment primary key)ENGINE=InnoDB;
-insert into t1 values (NULL);
-drop table t1;
-create table t1 (word char(20) not null)ENGINE=InnoDB;
-load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines;
-select count(*) from t1;
-count(*)
-69
-show binlog events;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
-master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB
-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 # Query 1 # use `test`; drop table t1
-master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=InnoDB
-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;
-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;
-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 # Table_map 1 # table_id: # (test.t1)
-show binlog events from 106 limit 2,1;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-flush logs;
-create table t3 (a int)ENGINE=InnoDB;
-start slave;
-
-let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%' ;
-
---source include/wait_slave_status.inc
-flush logs;
-stop slave;
-create table t2 (n int)ENGINE=InnoDB;
-insert into t2 values (1);
-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(n int not null auto_increment primary key)ENGINE=InnoDB
-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 # # use `test`; drop table t1
-master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=InnoDB
-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 # Rotate # # master-bin.000002;pos=4
-show binlog events in 'master-bin.000002';
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
-master-bin.000002 # Query 1 # use `test`; create table t3 (a int)ENGINE=InnoDB
-master-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=InnoDB
-master-bin.000002 # Table_map 1 # table_id: # (test.t2)
-master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000002 # Xid 1 # COMMIT /* XID */
-show binary logs;
-Log_name File_size
-master-bin.000001 1314
-master-bin.000002 404
-start slave;
-show binary logs;
-Log_name File_size
-slave-bin.000001 1412
-slave-bin.000002 305
-show binlog events in 'slave-bin.000001' from 4;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
-slave-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB
-slave-bin.000001 # Table_map 1 # table_id: # (test.t1)
-slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-slave-bin.000001 # Xid 1 # COMMIT /* XID */
-slave-bin.000001 # Query 1 # use `test`; drop table t1
-slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=InnoDB
-slave-bin.000001 # Table_map 1 # table_id: # (test.t1)
-slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-slave-bin.000001 # Xid 1 # COMMIT /* XID */
-slave-bin.000001 # Query 1 # use `test`; create table t3 (a int)ENGINE=InnoDB
-slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4
-show binlog events in 'slave-bin.000002' from 4;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
-slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=InnoDB
-slave-bin.000002 # Table_map 1 # table_id: # (test.t2)
-slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
-slave-bin.000002 # Xid 1 # COMMIT /* XID */
-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
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 404 # # master-bin.000002 Yes Yes # 0 0 404 # None 0 No # No
-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;
-DROP TABLE t2;
-DROP TABLE t3;
-create table t1(a int auto_increment primary key, b int);
-insert into t1 values (NULL, 1);
-reset master;
-set insert_id=5;
-insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-select * from t1;
-a b
-1 1
-5 1
-6 1
-drop table t1;
diff --git a/mysql-test/r/rpl_row_max_relay_size.result b/mysql-test/r/rpl_row_max_relay_size.result
deleted file mode 100644
index cb1692568fc..00000000000
--- a/mysql-test/r/rpl_row_max_relay_size.result
+++ /dev/null
@@ -1,281 +0,0 @@
-SET SESSION BINLOG_FORMAT=ROW;
-SET GLOBAL BINLOG_FORMAT=ROW;
-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;
-#
-# Generate a big enough master's binlog to cause relay log rotations
-#
-create table t1 (a int);
-drop table t1;
-reset slave;
-#
-# Test 1
-#
-set @my_max_binlog_size= @@global.max_binlog_size;
-set global max_binlog_size=8192;
-set global max_relay_log_size=8192-1;
-select @@global.max_relay_log_size;
-@@global.max_relay_log_size
-4096
-start slave;
-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 58668
-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 58668
-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
-#
-# Test 2
-#
-stop slave;
-reset slave;
-set global max_relay_log_size=(5*4096);
-select @@global.max_relay_log_size;
-@@global.max_relay_log_size 20480
-start slave;
-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 58668
-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 58668
-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
-#
-# Test 3: max_relay_log_size = 0
-#
-stop slave;
-reset slave;
-set global max_relay_log_size=0;
-select @@global.max_relay_log_size;
-@@global.max_relay_log_size 0
-start slave;
-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 58668
-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 58668
-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
-#
-# Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
-#
-stop slave;
-reset slave;
-flush logs;
-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
-#
-# Test 5
-#
-reset slave;
-start slave;
-flush logs;
-create table t1 (a 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 58754
-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 58754
-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
-#
-# Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
-#
-flush logs;
-drop table t1;
-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 58830
-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 58830
-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
-flush logs;
-show master status;
-File master-bin.000002
-Position 106
-Binlog_Do_DB <Binlog_Ignore_DB>
-Binlog_Ignore_DB
-set global max_binlog_size= @my_max_binlog_size;
-#
-# End of 4.1 tests
-#
diff --git a/mysql-test/r/rpl_row_mysqlbinlog.result b/mysql-test/r/rpl_row_mysqlbinlog.result
deleted file mode 100644
index c9f46e73cfd..00000000000
--- a/mysql-test/r/rpl_row_mysqlbinlog.result
+++ /dev/null
@@ -1,276 +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;
-
----Setup Section --
-set timestamp=1000000000;
-DROP TABLE IF EXISTS t1,t2,t3;
-CREATE TABLE t1(word VARCHAR(20));
-CREATE TABLE t2(id INT AUTO_INCREMENT NOT NULL PRIMARY KEY);
-CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT);
-
----Test1 check table load --
-SELECT COUNT(*) from t1;
-COUNT(*)
-351
-SELECT COUNT(*) from t2;
-COUNT(*)
-500
-SELECT COUNT(*) from t3;
-COUNT(*)
-500
-SELECT * FROM t1 ORDER BY word LIMIT 5;
-word
-Aarhus
-Aarhus
-Aarhus
-Aarhus
-Aarhus
-SELECT * FROM t2 ORDER BY id LIMIT 5;
-id
-1
-2
-3
-4
-5
-SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5;
-c1 c3 c4 c5
-1 2006-02-22 00:00:00 Tested in Texas 2.2
-2 2006-02-22 00:00:00 Tested in Texas 4.4
-3 2006-02-22 00:00:00 Tested in Texas 6.6
-4 2006-02-22 00:00:00 Tested in Texas 8.8
-5 2006-02-22 00:00:00 Tested in Texas 11
-SELECT COUNT(*) from t1;
-COUNT(*)
-351
-SELECT COUNT(*) from t2;
-COUNT(*)
-500
-SELECT COUNT(*) from t3;
-COUNT(*)
-500
-SELECT * FROM t1 ORDER BY word LIMIT 5;
-word
-Aarhus
-Aarhus
-Aarhus
-Aarhus
-Aarhus
-SELECT * FROM t2 ORDER BY id LIMIT 5;
-id
-1
-2
-3
-4
-5
-SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5;
-c1 c3 c4 c5
-1 2006-02-22 00:00:00 Tested in Texas 2.2
-2 2006-02-22 00:00:00 Tested in Texas 4.4
-3 2006-02-22 00:00:00 Tested in Texas 6.6
-4 2006-02-22 00:00:00 Tested in Texas 8.8
-5 2006-02-22 00:00:00 Tested in Texas 11
-insert into t1 values ("Alas");
-flush logs;
-
---- Test 1 Dump binlog to file --
-
---- Test 1 delete tables, clean master and slave --
-DROP TABLE t1;
-DROP TABLE t2;
-DROP TABLE t3;
-stop slave;
-reset master;
-reset slave;
-start slave;
-
---- Test 1 Load from Dump binlog file --
-
---- Test 1 Check Load Results --
-SELECT COUNT(*) from t1;
-COUNT(*)
-352
-SELECT COUNT(*) from t2;
-COUNT(*)
-500
-SELECT COUNT(*) from t3;
-COUNT(*)
-500
-SELECT * FROM t1 ORDER BY word LIMIT 5;
-word
-Aarhus
-Aarhus
-Aarhus
-Aarhus
-Aarhus
-SELECT * FROM t2 ORDER BY id LIMIT 5;
-id
-1
-2
-3
-4
-5
-SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5;
-c1 c3 c4 c5
-1 2006-02-22 00:00:00 Tested in Texas 2.2
-2 2006-02-22 00:00:00 Tested in Texas 4.4
-3 2006-02-22 00:00:00 Tested in Texas 6.6
-4 2006-02-22 00:00:00 Tested in Texas 8.8
-5 2006-02-22 00:00:00 Tested in Texas 11
-SELECT COUNT(*) from t1;
-COUNT(*)
-352
-SELECT COUNT(*) from t2;
-COUNT(*)
-500
-SELECT COUNT(*) from t3;
-COUNT(*)
-500
-SELECT * FROM t1 ORDER BY word LIMIT 5;
-word
-Aarhus
-Aarhus
-Aarhus
-Aarhus
-Aarhus
-SELECT * FROM t2 ORDER BY id LIMIT 5;
-id
-1
-2
-3
-4
-5
-SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5;
-c1 c3 c4 c5
-1 2006-02-22 00:00:00 Tested in Texas 2.2
-2 2006-02-22 00:00:00 Tested in Texas 4.4
-3 2006-02-22 00:00:00 Tested in Texas 6.6
-4 2006-02-22 00:00:00 Tested in Texas 8.8
-5 2006-02-22 00:00:00 Tested in Texas 11
-
---- Test 2 position test --
-/*!40019 SET @@session.max_insert_delayed_threads=0*/;
-/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
-DELIMITER /*!*/;
-use test/*!*/;
-SET TIMESTAMP=1000000000/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
-SET @@session.sql_mode=0/*!*/;
-/*!\C latin1 *//*!*/;
-SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT)/*!*/;
-DELIMITER ;
-# End of log file
-ROLLBACK /* added by mysqlbinlog */;
-/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
-
---- Test 3 First Remote test --
-/*!40019 SET @@session.max_insert_delayed_threads=0*/;
-/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
-DELIMITER /*!*/;
-ROLLBACK/*!*/;
-use test/*!*/;
-SET TIMESTAMP=1000000000/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
-SET @@session.sql_mode=0/*!*/;
-/*!\C latin1 *//*!*/;
-SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-DROP TABLE IF EXISTS t1,t2,t3/*!*/;
-SET TIMESTAMP=1000000000/*!*/;
-CREATE TABLE t1(word VARCHAR(20))/*!*/;
-SET TIMESTAMP=1000000000/*!*/;
-CREATE TABLE t2(id INT AUTO_INCREMENT NOT NULL PRIMARY KEY)/*!*/;
-SET TIMESTAMP=1000000000/*!*/;
-CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT)/*!*/;
-DELIMITER ;
-# End of log file
-ROLLBACK /* added by mysqlbinlog */;
-/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
-
---- Test 5 LOAD DATA --
-/*!40019 SET @@session.max_insert_delayed_threads=0*/;
-/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
-DELIMITER /*!*/;
-DELIMITER ;
-# End of log file
-ROLLBACK /* added by mysqlbinlog */;
-/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
-
---- Test 6 reading stdin --
-/*!40019 SET @@session.max_insert_delayed_threads=0*/;
-/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
-DELIMITER /*!*/;
-ROLLBACK/*!*/;
-use test/*!*/;
-SET TIMESTAMP=1000000000/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
-SET @@session.sql_mode=0/*!*/;
-/*!\C latin1 *//*!*/;
-SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-DROP TABLE IF EXISTS t1,t2,t3/*!*/;
-SET TIMESTAMP=1000000000/*!*/;
-CREATE TABLE t1(word VARCHAR(20))/*!*/;
-SET TIMESTAMP=1000000000/*!*/;
-CREATE TABLE t2(id INT AUTO_INCREMENT NOT NULL PRIMARY KEY)/*!*/;
-SET TIMESTAMP=1000000000/*!*/;
-CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT)/*!*/;
-DELIMITER ;
-# End of log file
-ROLLBACK /* added by mysqlbinlog */;
-/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
-
---- Test 7 reading stdin w/position --
-/*!40019 SET @@session.max_insert_delayed_threads=0*/;
-/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
-DELIMITER /*!*/;
-use test/*!*/;
-SET TIMESTAMP=1000000000/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
-SET @@session.sql_mode=0/*!*/;
-/*!\C latin1 *//*!*/;
-SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT)/*!*/;
-DELIMITER ;
-# End of log file
-ROLLBACK /* added by mysqlbinlog */;
-/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
-
---- Test 8 switch internal charset --
-stop slave;
-reset master;
-reset slave;
-start slave;
-create table t4 (f text character set utf8);
-create table t5 (f text character set cp932);
-flush logs;
-rename table t4 to t04, t5 to t05;
-select HEX(f) from t04;
-HEX(f)
-E382BD
-select HEX(f) from t4;
-HEX(f)
-E382BD
-select HEX(f) from t05;
-HEX(f)
-835C
-select HEX(f) from t5;
-HEX(f)
-835C
-select HEX(f) from t04;
-HEX(f)
-E382BD
-select HEX(f) from t4;
-HEX(f)
-E382BD
-select HEX(f) from t05;
-HEX(f)
-835C
-select HEX(f) from t5;
-HEX(f)
-835C
-
---- Test cleanup --
-DROP TABLE IF EXISTS t1, t2, t3, t04, t05, t4, t5;
diff --git a/mysql-test/r/rpl_row_reset_slave.result b/mysql-test/r/rpl_row_reset_slave.result
deleted file mode 100644
index c9ae5ced7bc..00000000000
--- a/mysql-test/r/rpl_row_reset_slave.result
+++ /dev/null
@@ -1,32 +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;
-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
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 Yes Yes # 0 0 106 # None 0 No # No
-stop slave;
-change master to master_user='test';
-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
-# 127.0.0.1 test MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 No No # 0 0 106 # None 0 No # No
-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
-# 127.0.0.1 root MASTER_PORT 1 4 # # No No # 0 0 0 # None 0 No # No
-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
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 Yes Yes # 0 0 106 # None 0 No # No
-stop slave;
-reset slave;
-start slave;
-create temporary table t1 (a int);
-stop slave;
-reset slave;
-start slave;
-show status like 'slave_open_temp_tables';
-Variable_name Value
-Slave_open_temp_tables 0
diff --git a/mysql-test/r/rpl_row_tabledefs_2myisam.result b/mysql-test/r/rpl_row_tabledefs_2myisam.result
deleted file mode 100644
index 4eca19ff098..00000000000
--- a/mysql-test/r/rpl_row_tabledefs_2myisam.result
+++ /dev/null
@@ -1,389 +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;
-STOP SLAVE;
-SET @my_sql_mode= @@global.sql_mode;
-SET GLOBAL SQL_MODE='STRICT_ALL_TABLES';
-START SLAVE;
-CREATE TABLE t1_int (a INT PRIMARY KEY, b INT) ENGINE='MyISAM';
-CREATE TABLE t1_bit (a INT PRIMARY KEY, b INT) ENGINE='MyISAM';
-CREATE TABLE t1_char (a INT PRIMARY KEY, b INT) ENGINE='MyISAM';
-CREATE TABLE t1_nodef (a INT PRIMARY KEY, b INT) ENGINE='MyISAM';
-CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE='MyISAM';
-CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE='MyISAM';
-CREATE TABLE t4 (a INT) ENGINE='MyISAM';
-CREATE TABLE t5 (a INT, b INT, c INT) ENGINE='MyISAM';
-CREATE TABLE t6 (a INT, b INT, c INT) ENGINE='MyISAM';
-CREATE TABLE t7 (a INT NOT NULL) ENGINE='MyISAM';
-CREATE TABLE t8 (a INT NOT NULL) ENGINE='MyISAM';
-CREATE TABLE t9 (a INT) ENGINE='MyISAM';
-ALTER TABLE t1_int ADD x INT DEFAULT 42;
-ALTER TABLE t1_bit
-ADD x BIT(3) DEFAULT b'011',
-ADD y BIT(5) DEFAULT b'10101',
-ADD z BIT(2) DEFAULT b'10';
-ALTER TABLE t1_char ADD x CHAR(20) DEFAULT 'Just a test';
-ALTER TABLE t1_nodef ADD x INT NOT NULL;
-ALTER TABLE t2 DROP b;
-ALTER TABLE t4 MODIFY a FLOAT;
-ALTER TABLE t5 MODIFY b FLOAT;
-ALTER TABLE t6 MODIFY c FLOAT;
-ALTER TABLE t7 ADD e1 INT, ADD e2 INT, ADD e3 INT, ADD e4 INT,
-ADD e5 INT, ADD e6 INT, ADD e7 INT, ADD e8 INT;
-ALTER TABLE t8 ADD e1 INT NOT NULL DEFAULT 0, ADD e2 INT NOT NULL DEFAULT 0,
-ADD e3 INT NOT NULL DEFAULT 0, ADD e4 INT NOT NULL DEFAULT 0,
-ADD e5 INT NOT NULL DEFAULT 0, ADD e6 INT NOT NULL DEFAULT 0,
-ADD e7 INT NOT NULL DEFAULT 0, ADD e8 INT NOT NULL DEFAULT 0;
-INSERT INTO t1_int VALUES (2, 4, 4711);
-INSERT INTO t1_char VALUES (2, 4, 'Foo is a bar');
-INSERT INTO t1_bit VALUES (2, 4, b'101', b'11100', b'01');
-**** On Master ****
-INSERT INTO t1_int VALUES (1,2);
-INSERT INTO t1_int VALUES (2,5);
-INSERT INTO t1_bit VALUES (1,2);
-INSERT INTO t1_bit VALUES (2,5);
-INSERT INTO t1_char VALUES (1,2);
-INSERT INTO t1_char VALUES (2,5);
-SELECT * FROM t1_int ORDER BY a;
-a b
-1 2
-2 5
-SELECT * FROM t1_bit ORDER BY a;
-a b
-1 2
-2 5
-SELECT * FROM t1_char ORDER BY a;
-a b
-1 2
-2 5
-**** On Slave ****
-SELECT a,b,x FROM t1_int ORDER BY a;
-a b x
-1 2 42
-2 5 4711
-SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a;
-a b HEX(x) HEX(y) HEX(z)
-1 2 3 15 2
-2 5 5 1C 1
-SELECT a,b,x FROM t1_char ORDER BY a;
-a b x
-1 2 Just a test
-2 5 Foo is a bar
-**** On Master ****
-UPDATE t1_int SET b=2*b WHERE a=2;
-UPDATE t1_char SET b=2*b WHERE a=2;
-UPDATE t1_bit SET b=2*b WHERE a=2;
-SELECT * FROM t1_int ORDER BY a;
-a b
-1 2
-2 10
-SELECT * FROM t1_bit ORDER BY a;
-a b
-1 2
-2 10
-SELECT * FROM t1_char ORDER BY a;
-a b
-1 2
-2 10
-**** On Slave ****
-SELECT a,b,x FROM t1_int ORDER BY a;
-a b x
-1 2 42
-2 10 4711
-SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a;
-a b HEX(x) HEX(y) HEX(z)
-1 2 3 15 2
-2 10 5 1C 1
-SELECT a,b,x FROM t1_char ORDER BY a;
-a b x
-1 2 Just a test
-2 10 Foo is a bar
-INSERT INTO t9 VALUES (2);
-INSERT INTO t1_nodef VALUES (1,2);
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1105
-Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-INSERT INTO t9 VALUES (2);
-INSERT INTO t2 VALUES (2,4);
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1523
-Last_Error Table width mismatch - received 2 columns, test.t2 has 1 columns
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-INSERT INTO t9 VALUES (4);
-INSERT INTO t4 VALUES (4);
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1523
-Last_Error Column 0 type mismatch - received type 3, test.t4 has type 4
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-INSERT INTO t9 VALUES (5);
-INSERT INTO t5 VALUES (5,10,25);
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1523
-Last_Error Column 1 type mismatch - received type 3, test.t5 has type 4
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-INSERT INTO t9 VALUES (6);
-INSERT INTO t6 VALUES (6,12,36);
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1523
-Last_Error Column 2 type mismatch - received type 3, test.t6 has type 4
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-INSERT INTO t9 VALUES (6);
-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 #
-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 #
-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
-INSERT INTO t7 VALUES (1),(2),(3);
-INSERT INTO t8 VALUES (1),(2),(3);
-SELECT * FROM t7 ORDER BY a;
-a
-1
-2
-3
-SELECT * FROM t8 ORDER BY a;
-a
-1
-2
-3
-SELECT * FROM t7 ORDER BY a;
-a e1 e2 e3 e4 e5 e6 e7 e8
-1 NULL NULL NULL NULL NULL NULL NULL NULL
-2 NULL NULL NULL NULL NULL NULL NULL NULL
-3 NULL NULL NULL NULL NULL NULL NULL NULL
-SELECT * FROM t8 ORDER BY a;
-a e1 e2 e3 e4 e5 e6 e7 e8
-1 0 0 0 0 0 0 0 0
-2 0 0 0 0 0 0 0 0
-3 0 0 0 0 0 0 0 0
-**** On Master ****
-TRUNCATE t1_nodef;
-SET SQL_LOG_BIN=0;
-INSERT INTO t1_nodef VALUES (1,2);
-INSERT INTO t1_nodef VALUES (2,4);
-SET SQL_LOG_BIN=1;
-**** On Slave ****
-INSERT INTO t1_nodef VALUES (1,2,3);
-INSERT INTO t1_nodef VALUES (2,4,6);
-**** On Master ****
-UPDATE t1_nodef SET b=2*b WHERE a=1;
-SELECT * FROM t1_nodef ORDER BY a;
-a b
-1 4
-2 4
-**** On Slave ****
-SELECT * FROM t1_nodef ORDER BY a;
-a b x
-1 4 3
-2 4 6
-**** On Master ****
-DELETE FROM t1_nodef WHERE a=2;
-SELECT * FROM t1_nodef ORDER BY a;
-a b
-1 4
-**** On Slave ****
-SELECT * FROM t1_nodef ORDER BY a;
-a b x
-1 4 3
-**** Cleanup ****
-DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
-DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9;
-SET @@global.sql_mode= @my_sql_mode;
diff --git a/mysql-test/r/rpl_row_tabledefs_3innodb.result b/mysql-test/r/rpl_row_tabledefs_3innodb.result
deleted file mode 100644
index 687108e17e5..00000000000
--- a/mysql-test/r/rpl_row_tabledefs_3innodb.result
+++ /dev/null
@@ -1,389 +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;
-STOP SLAVE;
-SET @my_sql_mode= @@global.sql_mode;
-SET GLOBAL SQL_MODE='STRICT_ALL_TABLES';
-START SLAVE;
-CREATE TABLE t1_int (a INT PRIMARY KEY, b INT) ENGINE='InnoDB';
-CREATE TABLE t1_bit (a INT PRIMARY KEY, b INT) ENGINE='InnoDB';
-CREATE TABLE t1_char (a INT PRIMARY KEY, b INT) ENGINE='InnoDB';
-CREATE TABLE t1_nodef (a INT PRIMARY KEY, b INT) ENGINE='InnoDB';
-CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE='InnoDB';
-CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE='InnoDB';
-CREATE TABLE t4 (a INT) ENGINE='InnoDB';
-CREATE TABLE t5 (a INT, b INT, c INT) ENGINE='InnoDB';
-CREATE TABLE t6 (a INT, b INT, c INT) ENGINE='InnoDB';
-CREATE TABLE t7 (a INT NOT NULL) ENGINE='InnoDB';
-CREATE TABLE t8 (a INT NOT NULL) ENGINE='InnoDB';
-CREATE TABLE t9 (a INT) ENGINE='InnoDB';
-ALTER TABLE t1_int ADD x INT DEFAULT 42;
-ALTER TABLE t1_bit
-ADD x BIT(3) DEFAULT b'011',
-ADD y BIT(5) DEFAULT b'10101',
-ADD z BIT(2) DEFAULT b'10';
-ALTER TABLE t1_char ADD x CHAR(20) DEFAULT 'Just a test';
-ALTER TABLE t1_nodef ADD x INT NOT NULL;
-ALTER TABLE t2 DROP b;
-ALTER TABLE t4 MODIFY a FLOAT;
-ALTER TABLE t5 MODIFY b FLOAT;
-ALTER TABLE t6 MODIFY c FLOAT;
-ALTER TABLE t7 ADD e1 INT, ADD e2 INT, ADD e3 INT, ADD e4 INT,
-ADD e5 INT, ADD e6 INT, ADD e7 INT, ADD e8 INT;
-ALTER TABLE t8 ADD e1 INT NOT NULL DEFAULT 0, ADD e2 INT NOT NULL DEFAULT 0,
-ADD e3 INT NOT NULL DEFAULT 0, ADD e4 INT NOT NULL DEFAULT 0,
-ADD e5 INT NOT NULL DEFAULT 0, ADD e6 INT NOT NULL DEFAULT 0,
-ADD e7 INT NOT NULL DEFAULT 0, ADD e8 INT NOT NULL DEFAULT 0;
-INSERT INTO t1_int VALUES (2, 4, 4711);
-INSERT INTO t1_char VALUES (2, 4, 'Foo is a bar');
-INSERT INTO t1_bit VALUES (2, 4, b'101', b'11100', b'01');
-**** On Master ****
-INSERT INTO t1_int VALUES (1,2);
-INSERT INTO t1_int VALUES (2,5);
-INSERT INTO t1_bit VALUES (1,2);
-INSERT INTO t1_bit VALUES (2,5);
-INSERT INTO t1_char VALUES (1,2);
-INSERT INTO t1_char VALUES (2,5);
-SELECT * FROM t1_int ORDER BY a;
-a b
-1 2
-2 5
-SELECT * FROM t1_bit ORDER BY a;
-a b
-1 2
-2 5
-SELECT * FROM t1_char ORDER BY a;
-a b
-1 2
-2 5
-**** On Slave ****
-SELECT a,b,x FROM t1_int ORDER BY a;
-a b x
-1 2 42
-2 5 4711
-SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a;
-a b HEX(x) HEX(y) HEX(z)
-1 2 3 15 2
-2 5 5 1C 1
-SELECT a,b,x FROM t1_char ORDER BY a;
-a b x
-1 2 Just a test
-2 5 Foo is a bar
-**** On Master ****
-UPDATE t1_int SET b=2*b WHERE a=2;
-UPDATE t1_char SET b=2*b WHERE a=2;
-UPDATE t1_bit SET b=2*b WHERE a=2;
-SELECT * FROM t1_int ORDER BY a;
-a b
-1 2
-2 10
-SELECT * FROM t1_bit ORDER BY a;
-a b
-1 2
-2 10
-SELECT * FROM t1_char ORDER BY a;
-a b
-1 2
-2 10
-**** On Slave ****
-SELECT a,b,x FROM t1_int ORDER BY a;
-a b x
-1 2 42
-2 10 4711
-SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a;
-a b HEX(x) HEX(y) HEX(z)
-1 2 3 15 2
-2 10 5 1C 1
-SELECT a,b,x FROM t1_char ORDER BY a;
-a b x
-1 2 Just a test
-2 10 Foo is a bar
-INSERT INTO t9 VALUES (2);
-INSERT INTO t1_nodef VALUES (1,2);
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1105
-Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-INSERT INTO t9 VALUES (2);
-INSERT INTO t2 VALUES (2,4);
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1523
-Last_Error Table width mismatch - received 2 columns, test.t2 has 1 columns
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-INSERT INTO t9 VALUES (4);
-INSERT INTO t4 VALUES (4);
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1523
-Last_Error Column 0 type mismatch - received type 3, test.t4 has type 4
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-INSERT INTO t9 VALUES (5);
-INSERT INTO t5 VALUES (5,10,25);
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1523
-Last_Error Column 1 type mismatch - received type 3, test.t5 has type 4
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-INSERT INTO t9 VALUES (6);
-INSERT INTO t6 VALUES (6,12,36);
-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 #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 1523
-Last_Error Column 2 type mismatch - received type 3, test.t6 has type 4
-Skip_Counter 0
-Exec_Master_Log_Pos #
-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
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-INSERT INTO t9 VALUES (6);
-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 #
-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 #
-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
-INSERT INTO t7 VALUES (1),(2),(3);
-INSERT INTO t8 VALUES (1),(2),(3);
-SELECT * FROM t7 ORDER BY a;
-a
-1
-2
-3
-SELECT * FROM t8 ORDER BY a;
-a
-1
-2
-3
-SELECT * FROM t7 ORDER BY a;
-a e1 e2 e3 e4 e5 e6 e7 e8
-1 NULL NULL NULL NULL NULL NULL NULL NULL
-2 NULL NULL NULL NULL NULL NULL NULL NULL
-3 NULL NULL NULL NULL NULL NULL NULL NULL
-SELECT * FROM t8 ORDER BY a;
-a e1 e2 e3 e4 e5 e6 e7 e8
-1 0 0 0 0 0 0 0 0
-2 0 0 0 0 0 0 0 0
-3 0 0 0 0 0 0 0 0
-**** On Master ****
-TRUNCATE t1_nodef;
-SET SQL_LOG_BIN=0;
-INSERT INTO t1_nodef VALUES (1,2);
-INSERT INTO t1_nodef VALUES (2,4);
-SET SQL_LOG_BIN=1;
-**** On Slave ****
-INSERT INTO t1_nodef VALUES (1,2,3);
-INSERT INTO t1_nodef VALUES (2,4,6);
-**** On Master ****
-UPDATE t1_nodef SET b=2*b WHERE a=1;
-SELECT * FROM t1_nodef ORDER BY a;
-a b
-1 4
-2 4
-**** On Slave ****
-SELECT * FROM t1_nodef ORDER BY a;
-a b x
-1 4 3
-2 4 6
-**** On Master ****
-DELETE FROM t1_nodef WHERE a=2;
-SELECT * FROM t1_nodef ORDER BY a;
-a b
-1 4
-**** On Slave ****
-SELECT * FROM t1_nodef ORDER BY a;
-a b x
-1 4 3
-**** Cleanup ****
-DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
-DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9;
-SET @@global.sql_mode= @my_sql_mode;
diff --git a/mysql-test/r/rpl_row_until.result b/mysql-test/r/rpl_row_until.result
deleted file mode 100644
index c691185650a..00000000000
--- a/mysql-test/r/rpl_row_until.result
+++ /dev/null
@@ -1,62 +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;
-stop slave;
-create table t1(n int not null auto_increment primary key);
-insert into t1 values (1),(2),(3),(4);
-drop table t1;
-create table t2(n int not null auto_increment primary key);
-insert into t2 values (1),(2);
-insert into t2 values (3),(4);
-drop table t2;
-start slave until master_log_file='master-bin.000001', master_log_pos=311;
-select * from t1;
-n
-1
-2
-3
-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
-# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 744 slave-relay-bin.000004 # master-bin.000001 # No 0 0 315 # Master master-bin.000001 311 No # No
-start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
-select * from t1;
-n
-1
-2
-3
-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
-# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 744 slave-relay-bin.000004 # master-bin.000001 # No 0 0 315 # Master master-no-such-bin.000001 291 No # No
-start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=728;
-select * from t2;
-n
-1
-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
-# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 744 slave-relay-bin.000004 # master-bin.000001 # No 0 0 590 # Relay slave-relay-bin.000004 728 No # No
-start slave;
-stop slave;
-start slave until master_log_file='master-bin.000001', master_log_pos=740;
-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
-# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 744 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 744 # Master master-bin.000001 740 No # No
-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;
-ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
-start slave until master_log_file='master-bin.000001';
-ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
-start slave until relay_log_file='slave-relay-bin.000002';
-ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
-start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
-ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
-start slave sql_thread;
-start slave until master_log_file='master-bin.000001', master_log_pos=740;
-Warnings:
-Note 1254 Slave is already running
diff --git a/mysql-test/r/rpl_server_id1.result b/mysql-test/r/rpl_server_id1.result
deleted file mode 100644
index 8f82ca8ea12..00000000000
--- a/mysql-test/r/rpl_server_id1.result
+++ /dev/null
@@ -1,19 +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 (n int);
-reset master;
-stop slave;
-change master to master_port=SLAVE_PORT;
-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
- 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # # 0 0 0 106 None 0 No NULL No
-start slave;
-insert into t1 values (1);
-show status like "slave_running";
-Variable_name Value
-Slave_running OFF
-drop table t1;
diff --git a/mysql-test/r/rpl_server_id2.result b/mysql-test/r/rpl_server_id2.result
deleted file mode 100644
index a5c7fc07714..00000000000
--- a/mysql-test/r/rpl_server_id2.result
+++ /dev/null
@@ -1,21 +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 (n int);
-reset master;
-stop slave;
-change master to master_port=SLAVE_PORT;
-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
- 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 106 None 0 No NULL No
-start slave;
-insert into t1 values (1);
-select * from t1;
-n
-1
-1
-stop slave;
-drop table t1;
diff --git a/mysql-test/r/rpl_session_var.result b/mysql-test/r/rpl_session_var.result
deleted file mode 100644
index b5b4b815ade..00000000000
--- a/mysql-test/r/rpl_session_var.result
+++ /dev/null
@@ -1,43 +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;
-drop table if exists t1;
-Warnings:
-Note 1051 Unknown table 't1'
-create table t1(a varchar(100),b int);
-set @@session.sql_mode=pipes_as_concat;
-insert into t1 values('My'||'SQL', 1);
-set @@session.sql_mode=default;
-insert into t1 values('1'||'2', 2);
-select * from t1 where b<3 order by a;
-a b
-1 2
-MySQL 1
-select * from t1 where b<3 order by a;
-a b
-1 2
-MySQL 1
-set @@session.sql_mode=ignore_space;
-insert into t1 values(password ('MySQL'), 3);
-set @@session.sql_mode=ansi_quotes;
-create table "t2" ("a" int);
-drop table t1, t2;
-set @@session.sql_mode=default;
-create table t1(a int auto_increment primary key);
-create table t2(b int, a int);
-set @@session.sql_auto_is_null=1;
-insert into t1 values(null);
-insert into t2 select 1,a from t1 where a is null;
-set @@session.sql_auto_is_null=0;
-insert into t1 values(null);
-insert into t2 select 2,a from t1 where a is null;
-select * from t2 order by b;
-b a
-1 1
-select * from t2 order by b;
-b a
-1 1
-drop table t1,t2;
diff --git a/mysql-test/r/rpl_skip_error.result b/mysql-test/r/rpl_skip_error.result
deleted file mode 100644
index 248ce5b52c3..00000000000
--- a/mysql-test/r/rpl_skip_error.result
+++ /dev/null
@@ -1,16 +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 (n int not null primary key);
-insert into t1 values (1);
-insert into t1 values (1);
-insert into t1 values (2),(3);
-select * from t1 ORDER BY n;
-n
-1
-2
-3
-drop table t1;
diff --git a/mysql-test/r/rpl_slave_status.result b/mysql-test/r/rpl_slave_status.result
deleted file mode 100644
index 29ec7b77b45..00000000000
--- a/mysql-test/r/rpl_slave_status.result
+++ /dev/null
@@ -1,58 +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;
-grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl';
-stop slave;
-change master to master_user='rpl',master_password='rpl';
-start slave;
-drop table if exists t1;
-create table t1 (n int);
-insert into t1 values (1);
-select * from t1;
-n
-1
-delete from mysql.user where user='rpl';
-flush privileges;
-stop slave;
-start slave;
-show slave status;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User rpl
-Master_Port MASTER_MYPORT
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running No
-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 #
-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 NULL
-Master_SSL_Verify_Server_Cert No
-drop table t1;
-delete from mysql.user where user='rpl';
-drop table t1;
diff --git a/mysql-test/r/rpl_sp.result b/mysql-test/r/rpl_sp.result
deleted file mode 100644
index 6dc3be94e32..00000000000
--- a/mysql-test/r/rpl_sp.result
+++ /dev/null
@@ -1,536 +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;
-drop database if exists mysqltest1;
-create database mysqltest1;
-use mysqltest1;
-create table t1 (a varchar(100));
-use mysqltest1;
-create procedure foo()
-begin
-declare b int;
-set b = 8;
-insert into t1 values (b);
-insert into t1 values (unix_timestamp());
-end|
-select * from mysql.proc where name='foo' and db='mysqltest1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment
-mysqltest1 foo PROCEDURE foo SQL CONTAINS_SQL NO DEFINER begin
-declare b int;
-set b = 8;
-insert into t1 values (b);
-insert into t1 values (unix_timestamp());
-end root@localhost # #
-select * from mysql.proc where name='foo' and db='mysqltest1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment
-mysqltest1 foo PROCEDURE foo SQL CONTAINS_SQL NO DEFINER begin
-declare b int;
-set b = 8;
-insert into t1 values (b);
-insert into t1 values (unix_timestamp());
-end root@localhost # #
-set timestamp=1000000000;
-call foo();
-select * from t1;
-a
-8
-1000000000
-select * from t1;
-a
-8
-1000000000
-delete from t1;
-create procedure foo2()
-select * from mysqltest1.t1;
-call foo2();
-a
-alter procedure foo2 contains sql;
-drop table t1;
-create table t1 (a int);
-create table t2 like t1;
-create procedure foo3()
-deterministic
-insert into t1 values (15);
-grant CREATE ROUTINE, EXECUTE on mysqltest1.* to "zedjzlcsjhd"@127.0.0.1;
-grant SELECT on mysqltest1.t1 to "zedjzlcsjhd"@127.0.0.1;
-grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1;
-SELECT 1;
-1
-1
-create procedure foo4()
-deterministic
-begin
-insert into t2 values(3);
-insert into t1 values (5);
-end|
-call foo4();
-Got one of the listed errors
-call foo3();
-show warnings;
-Level Code Message
-call foo4();
-Got one of the listed errors
-alter procedure foo4 sql security invoker;
-call foo4();
-show warnings;
-Level Code Message
-select * from t1;
-a
-15
-5
-select * from t2;
-a
-3
-3
-3
-select * from t1;
-a
-15
-5
-select * from t2;
-a
-3
-3
-3
-delete from t2;
-alter table t2 add unique (a);
-drop procedure foo4;
-create procedure foo4()
-deterministic
-begin
-insert into t2 values(20),(20);
-end|
-call foo4();
-ERROR 23000: Duplicate entry '20' for key 'a'
-show warnings;
-Level Code Message
-Error 1582 Duplicate entry '20' for key 'a'
-select * from t2;
-a
-20
-select * from t2;
-a
-20
-select * from mysql.proc where name="foo4" and db='mysqltest1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment
-mysqltest1 foo4 PROCEDURE foo4 SQL CONTAINS_SQL YES DEFINER begin
-insert into t2 values(20),(20);
-end root@localhost # #
-drop procedure foo4;
-select * from mysql.proc where name="foo4" and db='mysqltest1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment
-select * from mysql.proc where name="foo4" and db='mysqltest1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment
-drop procedure foo;
-drop procedure foo2;
-drop procedure foo3;
-create function fn1(x int)
-returns int
-begin
-insert into t1 values (x);
-return x+2;
-end|
-ERROR HY000: 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)
-create function fn1(x int)
-returns int
-deterministic
-begin
-insert into t1 values (x);
-return x+2;
-end|
-delete t1,t2 from t1,t2;
-select fn1(20);
-fn1(20)
-22
-insert into t2 values(fn1(21));
-select * from t1;
-a
-21
-20
-select * from t2;
-a
-23
-select * from t1;
-a
-21
-20
-select * from t2;
-a
-23
-drop function fn1;
-create function fn1()
-returns int
-no sql
-begin
-return unix_timestamp();
-end|
-alter function fn1 contains sql;
-ERROR HY000: 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)
-delete from t1;
-set timestamp=1000000000;
-insert into t1 values(fn1());
-create function fn2()
-returns int
-no sql
-begin
-return unix_timestamp();
-end|
-ERROR HY000: 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)
-set global log_bin_trust_routine_creators=1;
-Warnings:
-Warning 1543 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead
-set global log_bin_trust_function_creators=0;
-set global log_bin_trust_function_creators=1;
-set global log_bin_trust_function_creators=1;
-create function fn2()
-returns int
-no sql
-begin
-return unix_timestamp();
-end|
-create function fn3()
-returns int
-not deterministic
-reads sql data
-begin
-return 0;
-end|
-select fn3();
-fn3()
-0
-select * from mysql.proc where db='mysqltest1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment
-mysqltest1 fn1 FUNCTION fn1 SQL NO_SQL NO DEFINER int(11) begin
-return unix_timestamp();
-end root@localhost # #
-mysqltest1 fn2 FUNCTION fn2 SQL NO_SQL NO DEFINER int(11) begin
-return unix_timestamp();
-end zedjzlcsjhd@localhost # #
-mysqltest1 fn3 FUNCTION fn3 SQL READS_SQL_DATA NO DEFINER int(11) begin
-return 0;
-end root@localhost # #
-select * from t1;
-a
-1000000000
-use mysqltest1;
-select * from t1;
-a
-1000000000
-select * from mysql.proc where db='mysqltest1';
-db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment
-mysqltest1 fn1 FUNCTION fn1 SQL NO_SQL NO DEFINER int(11) begin
-return unix_timestamp();
-end root@localhost # #
-mysqltest1 fn2 FUNCTION fn2 SQL NO_SQL NO DEFINER int(11) begin
-return unix_timestamp();
-end zedjzlcsjhd@localhost # #
-mysqltest1 fn3 FUNCTION fn3 SQL READS_SQL_DATA NO DEFINER int(11) begin
-return 0;
-end root@localhost # #
-delete from t2;
-alter table t2 add unique (a);
-drop function fn1;
-create function fn1(x int)
-returns int
-begin
-insert into t2 values(x),(x);
-return 10;
-end|
-do fn1(100);
-Warnings:
-Error 1582 Duplicate entry '100' for key 'a'
-select fn1(20);
-ERROR 23000: Duplicate entry '20' for key 'a'
-select * from t2;
-a
-20
-100
-select * from t2;
-a
-20
-100
-create trigger trg before insert on t1 for each row set new.a= 10;
-ERROR 42000: TRIGGER command denied to user 'zedjzlcsjhd'@'localhost' for table 't1'
-delete from t1;
-create trigger trg before insert on t1 for each row set new.a= 10;
-insert into t1 values (1);
-select * from t1;
-a
-10
-select * from t1;
-a
-10
-delete from t1;
-drop trigger trg;
-insert into t1 values (1);
-select * from t1;
-a
-1
-select * from t1;
-a
-1
-create procedure foo()
-not deterministic
-reads sql data
-select * from t1;
-call foo();
-a
-1
-drop procedure foo;
-drop function fn1;
-drop database mysqltest1;
-drop user "zedjzlcsjhd"@127.0.0.1;
-use test;
-use test;
-drop function if exists f1;
-create function f1() returns int reads sql data
-begin
-declare var integer;
-declare c cursor for select a from v1;
-open c;
-fetch c into var;
-close c;
-return var;
-end|
-create view v1 as select 1 as a;
-create table t1 (a int);
-insert into t1 (a) values (f1());
-select * from t1;
-a
-1
-drop view v1;
-drop function f1;
-select * from t1;
-a
-1
-DROP PROCEDURE IF EXISTS p1;
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1(col VARCHAR(10));
-CREATE PROCEDURE p1(arg VARCHAR(10))
-INSERT INTO t1 VALUES(arg);
-CALL p1('test');
-SELECT * FROM t1;
-col
-test
-SELECT * FROM t1;
-col
-test
-DROP PROCEDURE p1;
-
----> Test for BUG#20438
-
----> Preparing environment...
----> connection: master
-DROP PROCEDURE IF EXISTS p1;
-DROP FUNCTION IF EXISTS f1;
-
----> Synchronizing slave with master...
-
----> connection: master
-
----> Creating procedure...
-/*!50003 CREATE PROCEDURE p1() SET @a = 1 */;
-/*!50003 CREATE FUNCTION f1() RETURNS INT RETURN 0 */;
-
----> Checking on master...
-SHOW CREATE PROCEDURE p1;
-Procedure sql_mode Create Procedure
-p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
-SET @a = 1
-SHOW CREATE FUNCTION f1;
-Function sql_mode Create Function
-f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
-RETURN 0
-
----> Synchronizing slave with master...
----> connection: master
-
----> Checking on slave...
-SHOW CREATE PROCEDURE p1;
-Procedure sql_mode Create Procedure
-p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
-SET @a = 1
-SHOW CREATE FUNCTION f1;
-Function sql_mode Create Function
-f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
-RETURN 0
-
----> connection: master
-
----> Cleaning up...
-DROP PROCEDURE p1;
-DROP FUNCTION f1;
-drop table t1;
-drop database if exists mysqltest;
-drop database if exists mysqltest2;
-create database mysqltest;
-create database mysqltest2;
-use mysqltest2;
-create table t ( t integer );
-create procedure mysqltest.test() begin end;
-insert into t values ( 1 );
-create procedure `\\`.test() begin end;
-ERROR 42000: Unknown database '\\'
-create function f1 () returns int
-begin
-insert into t values (1);
-return 0;
-end|
-use mysqltest;
-set @a:= mysqltest2.f1();
-show binlog events in 'master-bin.000001' from 106;
-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()
-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()
-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()
-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()
-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()
-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
-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
-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
-no sql
-begin
-return unix_timestamp();
-end
-master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function fn3()
-returns int
-not deterministic
-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
-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()
-not deterministic
-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`; CREATE DEFINER=`root`@`localhost` function f1() returns int reads sql data
-begin
-declare var integer;
-declare c cursor for select a from v1;
-open c;
-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 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))
-INSERT INTO t1 VALUES(arg)
-master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES( NAME_CONST('arg',_latin1'test'))
-master-bin.000001 # Query 1 # use `test`; DROP PROCEDURE p1
-master-bin.000001 # Query 1 # 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 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() 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
-begin
-insert into t values (1);
-return 0;
-end
-master-bin.000001 # Query 1 # use `mysqltest`; SELECT `mysqltest2`.`f1`()
-set global log_bin_trust_function_creators=0;
-set global log_bin_trust_function_creators=0;
-drop database mysqltest;
-drop database mysqltest2;
-End of 5.0 tests
-End of 5.1 tests
diff --git a/mysql-test/r/rpl_ssl.result b/mysql-test/r/rpl_ssl.result
deleted file mode 100644
index 908f0020188..00000000000
--- a/mysql-test/r/rpl_ssl.result
+++ /dev/null
@@ -1,98 +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;
-grant replication slave on *.* to replssl@localhost require ssl;
-create table t1 (t int auto_increment, KEY(t));
-stop slave;
-change master to
-master_user='replssl',
-master_password='',
-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';
-start slave;
-insert into t1 values(1);
-select * from t1;
-t
-1
-show slave status;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User replssl
-Master_Port MASTER_MYPORT
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-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 #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed Yes
-Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem
-Master_SSL_CA_Path
-Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem
-Master_SSL_Cipher
-Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-STOP SLAVE;
-select * from t1;
-t
-1
-insert into t1 values (NULL);
-show slave status;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User replssl
-Master_Port MASTER_MYPORT
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-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 #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed Yes
-Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem
-Master_SSL_CA_Path
-Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem
-Master_SSL_Cipher
-Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-drop user replssl@localhost;
-drop table t1;
diff --git a/mysql-test/r/rpl_ssl1.result b/mysql-test/r/rpl_ssl1.result
deleted file mode 100644
index 6bc4b53849f..00000000000
--- a/mysql-test/r/rpl_ssl1.result
+++ /dev/null
@@ -1,146 +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;
-grant replication slave on *.* to replssl@localhost require ssl;
-create table t1 (t int);
-stop slave;
-change master to master_user='replssl',master_password='';
-start slave;
-insert into t1 values (1);
-select * from t1;
-t
-stop slave;
-change master to 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';
-start slave;
-select * from t1;
-t
-1
-show slave status;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User replssl
-Master_Port MASTER_MYPORT
-Connect_Retry 1
-Master_Log_File #
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File #
-Slave_IO_Running #
-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 #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed Yes
-Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem
-Master_SSL_CA_Path
-Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem
-Master_SSL_Cipher
-Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-stop slave;
-change master to master_user='root',master_password='', master_ssl=0;
-start slave;
-drop user replssl@localhost;
-drop table t1;
-show slave status;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port MASTER_MYPORT
-Connect_Retry 1
-Master_Log_File #
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File #
-Slave_IO_Running #
-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 #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem
-Master_SSL_CA_Path
-Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem
-Master_SSL_Cipher
-Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-stop slave;
-change master to
-master_host="localhost",
-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',
-master_ssl_verify_server_cert=1;
-start slave;
-create table t1 (t int);
-insert into t1 values (1);
-on slave
-select * from t1;
-t
-1
-show slave status;
-Slave_IO_State #
-Master_Host localhost
-Master_User root
-Master_Port MASTER_MYPORT
-Connect_Retry 1
-Master_Log_File #
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File #
-Slave_IO_Running #
-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 #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed Yes
-Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem
-Master_SSL_CA_Path
-Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem
-Master_SSL_Cipher
-Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert Yes
-drop table t1;
diff --git a/mysql-test/r/rpl_stm_insert_delayed.result b/mysql-test/r/rpl_stm_insert_delayed.result
deleted file mode 100644
index 1c003856eb9..00000000000
--- a/mysql-test/r/rpl_stm_insert_delayed.result
+++ /dev/null
@@ -1,88 +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;
-set @old_global_binlog_format = @@global.binlog_format;
-set @@global.binlog_format = statement;
-CREATE SCHEMA IF NOT EXISTS mysqlslap;
-USE mysqlslap;
-select @@global.binlog_format;
-@@global.binlog_format
-STATEMENT
-CREATE TABLE t1 (id INT primary key auto_increment, name VARCHAR(64));
-FLUSH TABLE t1;
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-5000
-use mysqlslap;
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-5000
-truncate table t1;
-insert delayed into t1 values(10, "my name");
-insert delayed into t1 values(10, "is Bond"), (20, "James Bond");
-ERROR 23000: Duplicate entry '10' for key 'PRIMARY'
-flush table t1;
-select * from t1;
-id name
-10 my name
-select * from t1;
-id name
-10 my name
-delete from t1 where id!=10;
-insert delayed into t1 values(20, "is Bond"), (10, "James Bond");
-ERROR 23000: Duplicate entry '10' for key 'PRIMARY'
-flush table t1;
-select * from t1;
-id name
-10 my name
-20 is Bond
-select * from t1;
-id name
-10 my name
-20 is Bond
-USE test;
-DROP SCHEMA mysqlslap;
-set @@global.binlog_format = mixed;
-CREATE SCHEMA IF NOT EXISTS mysqlslap;
-USE mysqlslap;
-select @@global.binlog_format;
-@@global.binlog_format
-MIXED
-CREATE TABLE t1 (id INT primary key auto_increment, name VARCHAR(64));
-FLUSH TABLE t1;
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-5000
-use mysqlslap;
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-5000
-truncate table t1;
-insert delayed into t1 values(10, "my name");
-insert delayed into t1 values(10, "is Bond"), (20, "James Bond");
-flush table t1;
-select * from t1;
-id name
-10 my name
-20 James Bond
-select * from t1;
-id name
-10 my name
-20 James Bond
-delete from t1 where id!=10;
-insert delayed into t1 values(20, "is Bond"), (10, "James Bond");
-flush table t1;
-select * from t1;
-id name
-10 my name
-20 is Bond
-select * from t1;
-id name
-10 my name
-20 is Bond
-USE test;
-DROP SCHEMA mysqlslap;
-set @@global.binlog_format = @old_global_binlog_format;
diff --git a/mysql-test/r/rpl_stm_log.result b/mysql-test/r/rpl_stm_log.result
deleted file mode 100644
index 3ee2d990159..00000000000
--- a/mysql-test/r/rpl_stm_log.result
+++ /dev/null
@@ -1,115 +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;
-stop slave;
-reset master;
-reset slave;
-reset master;
-create table t1(n int not null auto_increment primary key)ENGINE=MyISAM;
-insert into t1 values (NULL);
-drop table t1;
-create table t1 (word char(20) not null)ENGINE=MyISAM;
-load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines;
-select count(*) from t1;
-count(*)
-69
-show binlog events;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
-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
-master-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL)
-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_ln/words.dat' into table t1 ignore 1 lines ;file_id=1
-show binlog events from 106 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;
-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;
-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;
-create table t3 (a int)ENGINE=MyISAM;
-start slave;
-
-let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%' ;
-
---source include/wait_slave_status.inc
-flush logs;
-stop slave;
-create table t2 (n int)ENGINE=MyISAM;
-insert into t2 values (1);
-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(n int not null auto_increment primary key)ENGINE=MyISAM
-master-bin.000001 # Intvar # # INSERT_ID=1
-master-bin.000001 # Query # # use `test`; insert into t1 values (NULL)
-master-bin.000001 # Query # # use `test`; drop table t1
-master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
-master-bin.000001 # Begin_load_query # # ;file_id=1;block_len=581
-master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=1
-master-bin.000001 # Rotate # # master-bin.000002;pos=4
-show binlog events in 'master-bin.000002';
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
-master-bin.000002 # Query 1 # use `test`; create table t3 (a int)ENGINE=MyISAM
-master-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM
-master-bin.000002 # Query 1 # use `test`; insert into t2 values (1)
-show binary logs;
-Log_name File_size
-master-bin.000001 1347
-master-bin.000002 392
-start slave;
-show binary logs;
-Log_name File_size
-slave-bin.000001 1447
-slave-bin.000002 293
-show binlog events in 'slave-bin.000001' from 4;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
-slave-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM
-slave-bin.000001 # Intvar 1 # INSERT_ID=1
-slave-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL)
-slave-bin.000001 # Query 1 # use `test`; drop table t1
-slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
-slave-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581
-slave-bin.000001 # Execute_load_query 1 # use `test`; load data INFILE '../tmp/SQL_LOAD-2-1-1.data' INTO table t1 ignore 1 lines ;file_id=1
-slave-bin.000001 # Query 1 # use `test`; create table t3 (a int)ENGINE=MyISAM
-slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4
-show binlog events in 'slave-bin.000002' from 4;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
-slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM
-slave-bin.000002 # Query 1 # use `test`; insert into t2 values (1)
-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
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 392 # # master-bin.000002 Yes Yes # 0 0 392 # None 0 No # No
-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;
-DROP TABLE t2;
-DROP TABLE t3;
-create table t1(a int auto_increment primary key, b int);
-insert into t1 values (NULL, 1);
-reset master;
-set insert_id=5;
-insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Intvar # # LAST_INSERT_ID=1
-master-bin.000001 # Intvar # # INSERT_ID=5
-master-bin.000001 # Query # # use `test`; insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id())
-select * from t1;
-a b
-1 1
-5 1
-6 1
-drop table t1;
diff --git a/mysql-test/r/rpl_stm_max_relay_size.result b/mysql-test/r/rpl_stm_max_relay_size.result
deleted file mode 100644
index c2e57be6ad4..00000000000
--- a/mysql-test/r/rpl_stm_max_relay_size.result
+++ /dev/null
@@ -1,279 +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;
-stop slave;
-#
-# Generate a big enough master's binlog to cause relay log rotations
-#
-create table t1 (a int);
-drop table t1;
-reset slave;
-#
-# Test 1
-#
-set @my_max_binlog_size= @@global.max_binlog_size;
-set global max_binlog_size=8192;
-set global max_relay_log_size=8192-1;
-select @@global.max_relay_log_size;
-@@global.max_relay_log_size
-4096
-start slave;
-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 72960
-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 72960
-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
-#
-# Test 2
-#
-stop slave;
-reset slave;
-set global max_relay_log_size=(5*4096);
-select @@global.max_relay_log_size;
-@@global.max_relay_log_size 20480
-start slave;
-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 72960
-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 72960
-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
-#
-# Test 3: max_relay_log_size = 0
-#
-stop slave;
-reset slave;
-set global max_relay_log_size=0;
-select @@global.max_relay_log_size;
-@@global.max_relay_log_size 0
-start slave;
-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 72960
-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 72960
-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
-#
-# Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
-#
-stop slave;
-reset slave;
-flush logs;
-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
-#
-# Test 5
-#
-reset slave;
-start slave;
-flush logs;
-create table t1 (a 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 73046
-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 73046
-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
-#
-# Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
-#
-flush logs;
-drop table t1;
-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 73122
-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 73122
-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
-flush logs;
-show master status;
-File master-bin.000002
-Position 106
-Binlog_Do_DB <Binlog_Ignore_DB>
-Binlog_Ignore_DB
-set global max_binlog_size= @my_max_binlog_size;
-#
-# End of 4.1 tests
-#
diff --git a/mysql-test/r/rpl_stm_reset_slave.result b/mysql-test/r/rpl_stm_reset_slave.result
deleted file mode 100644
index e134629d597..00000000000
--- a/mysql-test/r/rpl_stm_reset_slave.result
+++ /dev/null
@@ -1,32 +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;
-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
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 Yes Yes # 0 0 106 # None 0 No # No
-stop slave;
-change master to master_user='test';
-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
-# 127.0.0.1 test MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 No No # 0 0 106 # None 0 No # No
-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
-# 127.0.0.1 root MASTER_PORT 1 4 # # No No # 0 0 0 # None 0 No # No
-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
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 Yes Yes # 0 0 106 # None 0 No # No
-stop slave;
-reset slave;
-start slave;
-create temporary table t1 (a int);
-stop slave;
-reset slave;
-start slave;
-show status like 'slave_open_temp_tables';
-Variable_name Value
-Slave_open_temp_tables 1
diff --git a/mysql-test/r/rpl_stm_until.result b/mysql-test/r/rpl_stm_until.result
deleted file mode 100644
index ffe6216a42b..00000000000
--- a/mysql-test/r/rpl_stm_until.result
+++ /dev/null
@@ -1,190 +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;
-stop slave;
-create table t1(n int not null auto_increment primary key);
-insert into t1 values (1),(2),(3),(4);
-drop table t1;
-create table t2(n int not null auto_increment primary key);
-insert into t2 values (1),(2);
-insert into t2 values (3),(4);
-drop table t2;
-start slave until master_log_file='master-bin.000001', master_log_pos=323;
-select * from t1;
-n
-1
-2
-3
-4
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port MASTER_MYPORT
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos 784
-Relay_Log_File slave-relay-bin.000004
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running #
-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 327
-Relay_Log_Space #
-Until_Condition Master
-Until_Log_File master-bin.000001
-Until_Log_Pos 323
-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
-start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
-select * from t1;
-n
-1
-2
-3
-4
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port MASTER_MYPORT
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos 784
-Relay_Log_File slave-relay-bin.000004
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running #
-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 327
-Relay_Log_Space #
-Until_Condition Master
-Until_Log_File master-no-such-bin.000001
-Until_Log_Pos 291
-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
-start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746;
-select * from t2;
-n
-1
-2
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port MASTER_MYPORT
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos 784
-Relay_Log_File slave-relay-bin.000004
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running #
-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 616
-Relay_Log_Space #
-Until_Condition Relay
-Until_Log_File slave-relay-bin.000004
-Until_Log_Pos 746
-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
-start slave;
-stop slave;
-start slave until master_log_file='master-bin.000001', master_log_pos=776;
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port MASTER_MYPORT
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos 784
-Relay_Log_File slave-relay-bin.000004
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-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 784
-Relay_Log_Space #
-Until_Condition Master
-Until_Log_File master-bin.000001
-Until_Log_Pos 776
-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
-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;
-ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
-start slave until master_log_file='master-bin.000001';
-ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
-start slave until relay_log_file='slave-relay-bin.000002';
-ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
-start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
-ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
-start slave sql_thread;
-start slave until master_log_file='master-bin.000001', master_log_pos=776;
-Warnings:
-Note 1254 Slave is already running
diff --git a/mysql-test/r/rpl_switch_stm_row_mixed.result b/mysql-test/r/rpl_switch_stm_row_mixed.result
deleted file mode 100644
index 6d9f1a32980..00000000000
--- a/mysql-test/r/rpl_switch_stm_row_mixed.result
+++ /dev/null
@@ -1,1029 +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;
-drop database if exists mysqltest1;
-create database mysqltest1;
-use mysqltest1;
-set @my_binlog_format= @@global.binlog_format;
-set session binlog_format=mixed;
-show session variables like "binlog_format%";
-Variable_name Value
-binlog_format MIXED
-set session binlog_format=statement;
-show session variables like "binlog_format%";
-Variable_name Value
-binlog_format STATEMENT
-set session binlog_format=row;
-show session variables like "binlog_format%";
-Variable_name Value
-binlog_format ROW
-set global binlog_format=DEFAULT;
-show global variables like "binlog_format%";
-Variable_name Value
-binlog_format MIXED
-set global binlog_format=MIXED;
-show global variables like "binlog_format%";
-Variable_name Value
-binlog_format MIXED
-set global binlog_format=STATEMENT;
-show global variables like "binlog_format%";
-Variable_name Value
-binlog_format STATEMENT
-set global binlog_format=ROW;
-show global variables like "binlog_format%";
-Variable_name Value
-binlog_format ROW
-show session variables like "binlog_format%";
-Variable_name Value
-binlog_format ROW
-select @@global.binlog_format, @@session.binlog_format;
-@@global.binlog_format @@session.binlog_format
-ROW ROW
-CREATE TABLE t1 (a varchar(100));
-prepare stmt1 from 'insert into t1 select concat(UUID(),?)';
-set @string="emergency_1_";
-insert into t1 values("work_2_");
-execute stmt1 using @string;
-deallocate prepare stmt1;
-prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values(concat(UUID(),"work_3_"));
-execute stmt1 using @string;
-deallocate prepare stmt1;
-insert into t1 values(concat("for_4_",UUID()));
-insert into t1 select "yesterday_5_";
-create temporary table tmp(a char(100));
-insert into tmp values("see_6_");
-set binlog_format=statement;
-ERROR HY000: Cannot switch out of the row-based binary log format when the session has open temporary tables
-insert into t1 select * from tmp;
-drop temporary table tmp;
-set binlog_format=statement;
-show global variables like "binlog_format%";
-Variable_name Value
-binlog_format ROW
-show session variables like "binlog_format%";
-Variable_name Value
-binlog_format STATEMENT
-select @@global.binlog_format, @@session.binlog_format;
-@@global.binlog_format @@session.binlog_format
-ROW STATEMENT
-set global binlog_format=statement;
-show global variables like "binlog_format%";
-Variable_name Value
-binlog_format STATEMENT
-show session variables like "binlog_format%";
-Variable_name Value
-binlog_format STATEMENT
-select @@global.binlog_format, @@session.binlog_format;
-@@global.binlog_format @@session.binlog_format
-STATEMENT STATEMENT
-prepare stmt1 from 'insert into t1 select ?';
-set @string="emergency_7_";
-insert into t1 values("work_8_");
-execute stmt1 using @string;
-deallocate prepare stmt1;
-prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values("work_9_");
-execute stmt1 using @string;
-deallocate prepare stmt1;
-insert into t1 values("for_10_");
-insert into t1 select "yesterday_11_";
-set binlog_format=statement;
-select @@global.binlog_format, @@session.binlog_format;
-@@global.binlog_format @@session.binlog_format
-STATEMENT STATEMENT
-set global binlog_format=statement;
-select @@global.binlog_format, @@session.binlog_format;
-@@global.binlog_format @@session.binlog_format
-STATEMENT STATEMENT
-prepare stmt1 from 'insert into t1 select ?';
-set @string="emergency_12_";
-insert into t1 values("work_13_");
-execute stmt1 using @string;
-deallocate prepare stmt1;
-prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values("work_14_");
-execute stmt1 using @string;
-deallocate prepare stmt1;
-insert into t1 values("for_15_");
-insert into t1 select "yesterday_16_";
-set global binlog_format=mixed;
-select @@global.binlog_format, @@session.binlog_format;
-@@global.binlog_format @@session.binlog_format
-MIXED STATEMENT
-set binlog_format=default;
-select @@global.binlog_format, @@session.binlog_format;
-@@global.binlog_format @@session.binlog_format
-MIXED MIXED
-prepare stmt1 from 'insert into t1 select concat(UUID(),?)';
-set @string="emergency_17_";
-insert into t1 values("work_18_");
-execute stmt1 using @string;
-deallocate prepare stmt1;
-prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values(concat(UUID(),"work_19_"));
-execute stmt1 using @string;
-deallocate prepare stmt1;
-insert into t1 values(concat("for_20_",UUID()));
-insert into t1 select "yesterday_21_";
-prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values(concat(UUID(),"work_22_"));
-execute stmt1 using @string;
-deallocate prepare stmt1;
-insert into t1 values(concat("for_23_",UUID()));
-insert into t1 select "yesterday_24_";
-create table t2 select rpad(UUID(),100,' ');
-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);
-insert into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
-create procedure foo()
-begin
-insert into t1 values("work_25_");
-insert into t1 values(concat("for_26_",UUID()));
-insert into t1 select "yesterday_27_";
-end|
-create procedure foo2()
-begin
-insert into t1 values(concat("emergency_28_",UUID()));
-insert into t1 values("work_29_");
-insert into t1 values(concat("for_30_",UUID()));
-set session binlog_format=row; # accepted for stored procs
-insert into t1 values("more work_31_");
-set session binlog_format=mixed;
-end|
-create function foo3() returns bigint unsigned
-begin
-set session binlog_format=row; # rejected for stored funcs
-insert into t1 values("alarm");
-return 100;
-end|
-create procedure foo4(x varchar(100))
-begin
-insert into t1 values(concat("work_250_",x));
-insert into t1 select "yesterday_270_";
-end|
-call foo();
-call foo2();
-call foo4("hello");
-call foo4(UUID());
-call foo4("world");
-select foo3();
-ERROR HY000: Cannot change the binary logging format inside a stored function or trigger
-select * from t1 where a="alarm";
-a
-drop function foo3;
-create function foo3() returns bigint unsigned
-begin
-insert into t1 values("foo3_32_");
-call foo();
-return 100;
-end|
-insert into t2 select foo3();
-prepare stmt1 from 'insert into t2 select foo3()';
-execute stmt1;
-execute stmt1;
-deallocate prepare stmt1;
-create function foo4() returns bigint unsigned
-begin
-insert into t2 select foo3();
-return 100;
-end|
-select foo4();
-foo4()
-100
-prepare stmt1 from 'select foo4()';
-execute stmt1;
-foo4()
-100
-execute stmt1;
-foo4()
-100
-deallocate prepare stmt1;
-create function foo5() returns bigint unsigned
-begin
-insert into t2 select UUID();
-return 100;
-end|
-select foo5();
-foo5()
-100
-prepare stmt1 from 'select foo5()';
-execute stmt1;
-foo5()
-100
-execute stmt1;
-foo5()
-100
-deallocate prepare stmt1;
-create function foo6(x varchar(100)) returns bigint unsigned
-begin
-insert into t2 select x;
-return 100;
-end|
-select foo6("foo6_1_");
-foo6("foo6_1_")
-100
-select foo6(concat("foo6_2_",UUID()));
-foo6(concat("foo6_2_",UUID()))
-100
-prepare stmt1 from 'select foo6(concat("foo6_3_",UUID()))';
-execute stmt1;
-foo6(concat("foo6_3_",UUID()))
-100
-execute stmt1;
-foo6(concat("foo6_3_",UUID()))
-100
-deallocate prepare stmt1;
-create view v1 as select uuid();
-create table t11 (data varchar(255));
-insert into t11 select * from v1;
-insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11');
-prepare stmt1 from "insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11')";
-execute stmt1;
-execute stmt1;
-deallocate prepare stmt1;
-create trigger t11_bi before insert on t11 for each row
-begin
-set NEW.data = concat(NEW.data,UUID());
-end|
-insert into t11 values("try_560_");
-insert delayed into t2 values("delay_1_");
-insert delayed into t2 values(concat("delay_2_",UUID()));
-insert delayed into t2 values("delay_6_");
-insert delayed into t2 values(rand());
-set @a=2.345;
-insert delayed into t2 values(@a);
-create table t20 select * from t1;
-create table t21 select * from t2;
-create table t22 select * from t3;
-drop table t1,t2,t3;
-create table t1 (a int primary key auto_increment, b varchar(100));
-create table t2 (a int primary key auto_increment, b varchar(100));
-create table t3 (b varchar(100));
-create function f (x varchar(100)) returns int deterministic
-begin
-insert into t1 values(null,x);
-insert into t2 values(null,x);
-return 1;
-end|
-select f("try_41_");
-f("try_41_")
-1
-use mysqltest1;
-insert into t2 values(2,null),(3,null),(4,null);
-delete from t2 where a>=2;
-select f("try_42_");
-f("try_42_")
-1
-insert into t2 values(3,null),(4,null);
-delete from t2 where a>=3;
-prepare stmt1 from 'select f(?)';
-set @string="try_43_";
-insert into t1 values(null,"try_44_");
-execute stmt1 using @string;
-f(?)
-1
-deallocate prepare stmt1;
-create table t12 select * from t1;
-drop table t1;
-create table t1 (a int, b varchar(100), key(a));
-select f("try_45_");
-f("try_45_")
-1
-create table t13 select * from t1;
-drop table t1;
-create table t1 (a int primary key auto_increment, b varchar(100));
-drop function f;
-create table t14 (unique (a)) select * from t2;
-truncate table t2;
-create function f1 (x varchar(100)) returns int deterministic
-begin
-insert into t1 values(null,x);
-return 1;
-end|
-create function f2 (x varchar(100)) returns int deterministic
-begin
-insert into t2 values(null,x);
-return 1;
-end|
-select f1("try_46_"),f2("try_47_");
-f1("try_46_") f2("try_47_")
-1 1
-insert into t2 values(2,null),(3,null),(4,null);
-delete from t2 where a>=2;
-select f1("try_48_"),f2("try_49_");
-f1("try_48_") f2("try_49_")
-1 1
-insert into t3 values(concat("try_50_",f1("try_51_"),f2("try_52_")));
-drop function f2;
-create function f2 (x varchar(100)) returns int deterministic
-begin
-declare y int;
-insert into t1 values(null,x);
-set y = (select count(*) from t2);
-return y;
-end|
-select f1("try_53_"),f2("try_54_");
-f1("try_53_") f2("try_54_")
-1 3
-drop function f2;
-create trigger t1_bi before insert on t1 for each row
-begin
-insert into t2 values(null,"try_55_");
-end|
-insert into t1 values(null,"try_56_");
-alter table t1 modify a int, drop primary key;
-insert into t1 values(null,"try_57_");
-CREATE TEMPORARY TABLE t15 SELECT UUID();
-create table t16 like t15;
-INSERT INTO t16 SELECT * FROM t15;
-insert into t16 values("try_65_");
-drop table t15;
-insert into t16 values("try_66_");
-select count(*) from t1;
-count(*)
-7
-select count(*) from t2;
-count(*)
-5
-select count(*) from t3;
-count(*)
-1
-select count(*) from t4;
-count(*)
-29
-select count(*) from t5;
-count(*)
-58
-select count(*) from t11;
-count(*)
-8
-select count(*) from t20;
-count(*)
-66
-select count(*) from t21;
-count(*)
-19
-select count(*) from t22;
-count(*)
-2
-select count(*) from t12;
-count(*)
-4
-select count(*) from t13;
-count(*)
-1
-select count(*) from t14;
-count(*)
-4
-select count(*) from t16;
-count(*)
-3
-DROP TABLE IF EXISTS t11;
-SET SESSION BINLOG_FORMAT=STATEMENT;
-CREATE TABLE t11 (song VARCHAR(255));
-LOCK TABLES t11 WRITE;
-SET SESSION BINLOG_FORMAT=ROW;
-INSERT INTO t11 VALUES('Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict');
-SET SESSION BINLOG_FORMAT=STATEMENT;
-INSERT INTO t11 VALUES('Careful With That Axe, Eugene');
-UNLOCK TABLES;
-SELECT * FROM t11;
-song Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict
-song Careful With That Axe, Eugene
-USE mysqltest1;
-SELECT * FROM t11;
-song Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict
-song Careful With That Axe, Eugene
-DROP TABLE IF EXISTS t12;
-SET SESSION BINLOG_FORMAT=MIXED;
-CREATE TABLE t12 (data LONG);
-LOCK TABLES t12 WRITE;
-INSERT INTO t12 VALUES(UUID());
-UNLOCK TABLES;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-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 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_8_")
-master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F375F COLLATE latin1_swedish_ci
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string'
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_9_")
-master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F375F COLLATE latin1_swedish_ci
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string'
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("for_10_")
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_11_"
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_13_")
-master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F31325F COLLATE latin1_swedish_ci
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string'
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_14_")
-master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F31325F COLLATE latin1_swedish_ci
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string'
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("for_15_")
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_16_"
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_18_")
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F31375F COLLATE latin1_swedish_ci
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string'
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_21_"
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F31375F COLLATE latin1_swedish_ci
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string'
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_24_"
-master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t2` (
- `rpad(UUID(),100,' ')` varchar(100) CHARACTER SET utf8 NOT NULL DEFAULT ''
-)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t3` (
- `1` varbinary(36) NOT NULL DEFAULT ''
-)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t3)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t4` (
- `a` varchar(100) DEFAULT NULL
-)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t4)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t5)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo()
-begin
-insert into t1 values("work_25_");
-insert into t1 values(concat("for_26_",UUID()));
-insert into t1 select "yesterday_27_";
-end
-master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo2()
-begin
-insert into t1 values(concat("emergency_28_",UUID()));
-insert into t1 values("work_29_");
-insert into t1 values(concat("for_30_",UUID()));
-set session binlog_format=row; # accepted for stored procs
-insert into t1 values("more work_31_");
-set session binlog_format=mixed;
-end
-master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo3() returns bigint unsigned
-begin
-set session binlog_format=row; # rejected for stored funcs
-insert into t1 values("alarm");
-return 100;
-end
-master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo4(x varchar(100))
-begin
-insert into t1 values(concat("work_250_",x));
-insert into t1 select "yesterday_270_";
-end
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(concat("work_250_", NAME_CONST('x',_latin1'hello')))
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_270_"
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(concat("work_250_", NAME_CONST('x',_latin1'world')))
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_270_"
-master-bin.000001 # Query # # use `mysqltest1`; drop function foo3
-master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo3() returns bigint unsigned
-begin
-insert into t1 values("foo3_32_");
-call foo();
-return 100;
-end
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo4() returns bigint unsigned
-begin
-insert into t2 select foo3();
-return 100;
-end
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo5() returns bigint unsigned
-begin
-insert into t2 select UUID();
-return 100;
-end
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo6(x varchar(100)) returns bigint unsigned
-begin
-insert into t2 select x;
-return 100;
-end
-master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`foo6`(_latin1'foo6_1_')
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select uuid()
-master-bin.000001 # Query # # use `mysqltest1`; create table t11 (data varchar(255))
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t11)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11')
-master-bin.000001 # Query # # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11')
-master-bin.000001 # Query # # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11')
-master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t11_bi before insert on t11 for each row
-begin
-set NEW.data = concat(NEW.data,UUID());
-end
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t11)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; create table t20 select * from t1
-master-bin.000001 # Query # # use `mysqltest1`; create table t21 select * from t2
-master-bin.000001 # Query # # use `mysqltest1`; create table t22 select * from t3
-master-bin.000001 # Query # # use `mysqltest1`; drop table t1,t2,t3
-master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100))
-master-bin.000001 # Query # # use `mysqltest1`; create table t2 (a int primary key auto_increment, b varchar(100))
-master-bin.000001 # Query # # use `mysqltest1`; create table t3 (b varchar(100))
-master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f (x varchar(100)) returns int deterministic
-begin
-insert into t1 values(null,x);
-insert into t2 values(null,x);
-return 1;
-end
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Intvar # # INSERT_ID=3
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(null,"try_44_")
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; create table t12 select * from t1
-master-bin.000001 # Query # # use `mysqltest1`; drop table t1
-master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a int, b varchar(100), key(a))
-master-bin.000001 # Intvar # # INSERT_ID=4
-master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`f`(_latin1'try_45_')
-master-bin.000001 # Query # # use `mysqltest1`; create table t13 select * from t1
-master-bin.000001 # Query # # use `mysqltest1`; drop table t1
-master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100))
-master-bin.000001 # Query # # use `mysqltest1`; drop function f
-master-bin.000001 # Query # # use `mysqltest1`; create table t14 (unique (a)) select * from t2
-master-bin.000001 # Query # # use `mysqltest1`; truncate table t2
-master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f1 (x varchar(100)) returns int deterministic
-begin
-insert into t1 values(null,x);
-return 1;
-end
-master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f2 (x varchar(100)) returns int deterministic
-begin
-insert into t2 values(null,x);
-return 1;
-end
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t3)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; drop function f2
-master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f2 (x varchar(100)) returns int deterministic
-begin
-declare y int;
-insert into t1 values(null,x);
-set y = (select count(*) from t2);
-return y;
-end
-master-bin.000001 # Intvar # # INSERT_ID=4
-master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`f1`(_latin1'try_53_')
-master-bin.000001 # Intvar # # INSERT_ID=5
-master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`f2`(_latin1'try_54_')
-master-bin.000001 # Query # # use `mysqltest1`; drop function f2
-master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t1_bi before insert on t1 for each row
-begin
-insert into t2 values(null,"try_55_");
-end
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; alter table t1 modify a int, drop primary key
-master-bin.000001 # Intvar # # INSERT_ID=5
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(null,"try_57_")
-master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t16` (
- `UUID()` varchar(36) CHARACTER SET utf8 NOT NULL DEFAULT ''
-)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t16)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t16)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; insert into t16 values("try_66_")
-master-bin.000001 # Query # # use `mysqltest1`; DROP TABLE IF EXISTS t11
-master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE t11 (song VARCHAR(255))
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t11)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; INSERT INTO t11 VALUES('Careful With That Axe, Eugene')
-master-bin.000001 # Query # # use `mysqltest1`; DROP TABLE IF EXISTS t12
-master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE t12 (data LONG)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t12)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-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 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_8_")
-master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F375F COLLATE latin1_swedish_ci
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string'
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_9_")
-master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F375F COLLATE latin1_swedish_ci
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string'
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("for_10_")
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_11_"
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_13_")
-master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F31325F COLLATE latin1_swedish_ci
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string'
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_14_")
-master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F31325F COLLATE latin1_swedish_ci
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string'
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("for_15_")
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_16_"
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_18_")
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F31375F COLLATE latin1_swedish_ci
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string'
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_21_"
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F31375F COLLATE latin1_swedish_ci
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string'
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_24_"
-master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t2` (
- `rpad(UUID(),100,' ')` varchar(100) CHARACTER SET utf8 NOT NULL DEFAULT ''
-)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t3` (
- `1` varbinary(36) NOT NULL DEFAULT ''
-)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t3)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t4` (
- `a` varchar(100) DEFAULT NULL
-)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t4)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t5)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo()
-begin
-insert into t1 values("work_25_");
-insert into t1 values(concat("for_26_",UUID()));
-insert into t1 select "yesterday_27_";
-end
-master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo2()
-begin
-insert into t1 values(concat("emergency_28_",UUID()));
-insert into t1 values("work_29_");
-insert into t1 values(concat("for_30_",UUID()));
-set session binlog_format=row; # accepted for stored procs
-insert into t1 values("more work_31_");
-set session binlog_format=mixed;
-end
-master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo3() returns bigint unsigned
-begin
-set session binlog_format=row; # rejected for stored funcs
-insert into t1 values("alarm");
-return 100;
-end
-master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo4(x varchar(100))
-begin
-insert into t1 values(concat("work_250_",x));
-insert into t1 select "yesterday_270_";
-end
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(concat("work_250_", NAME_CONST('x',_latin1'hello')))
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_270_"
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(concat("work_250_", NAME_CONST('x',_latin1'world')))
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_270_"
-master-bin.000001 # Query # # use `mysqltest1`; drop function foo3
-master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo3() returns bigint unsigned
-begin
-insert into t1 values("foo3_32_");
-call foo();
-return 100;
-end
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo4() returns bigint unsigned
-begin
-insert into t2 select foo3();
-return 100;
-end
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo5() returns bigint unsigned
-begin
-insert into t2 select UUID();
-return 100;
-end
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo6(x varchar(100)) returns bigint unsigned
-begin
-insert into t2 select x;
-return 100;
-end
-master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`foo6`(_latin1'foo6_1_')
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select uuid()
-master-bin.000001 # Query # # use `mysqltest1`; create table t11 (data varchar(255))
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t11)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11')
-master-bin.000001 # Query # # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11')
-master-bin.000001 # Query # # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11')
-master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t11_bi before insert on t11 for each row
-begin
-set NEW.data = concat(NEW.data,UUID());
-end
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t11)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; create table t20 select * from t1
-master-bin.000001 # Query # # use `mysqltest1`; create table t21 select * from t2
-master-bin.000001 # Query # # use `mysqltest1`; create table t22 select * from t3
-master-bin.000001 # Query # # use `mysqltest1`; drop table t1,t2,t3
-master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100))
-master-bin.000001 # Query # # use `mysqltest1`; create table t2 (a int primary key auto_increment, b varchar(100))
-master-bin.000001 # Query # # use `mysqltest1`; create table t3 (b varchar(100))
-master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f (x varchar(100)) returns int deterministic
-begin
-insert into t1 values(null,x);
-insert into t2 values(null,x);
-return 1;
-end
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Intvar # # INSERT_ID=3
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(null,"try_44_")
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; create table t12 select * from t1
-master-bin.000001 # Query # # use `mysqltest1`; drop table t1
-master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a int, b varchar(100), key(a))
-master-bin.000001 # Intvar # # INSERT_ID=4
-master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`f`(_latin1'try_45_')
-master-bin.000001 # Query # # use `mysqltest1`; create table t13 select * from t1
-master-bin.000001 # Query # # use `mysqltest1`; drop table t1
-master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100))
-master-bin.000001 # Query # # use `mysqltest1`; drop function f
-master-bin.000001 # Query # # use `mysqltest1`; create table t14 (unique (a)) select * from t2
-master-bin.000001 # Query # # use `mysqltest1`; truncate table t2
-master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f1 (x varchar(100)) returns int deterministic
-begin
-insert into t1 values(null,x);
-return 1;
-end
-master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f2 (x varchar(100)) returns int deterministic
-begin
-insert into t2 values(null,x);
-return 1;
-end
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t3)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; drop function f2
-master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f2 (x varchar(100)) returns int deterministic
-begin
-declare y int;
-insert into t1 values(null,x);
-set y = (select count(*) from t2);
-return y;
-end
-master-bin.000001 # Intvar # # INSERT_ID=4
-master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`f1`(_latin1'try_53_')
-master-bin.000001 # Intvar # # INSERT_ID=5
-master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`f2`(_latin1'try_54_')
-master-bin.000001 # Query # # use `mysqltest1`; drop function f2
-master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t1_bi before insert on t1 for each row
-begin
-insert into t2 values(null,"try_55_");
-end
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
-master-bin.000001 # Write_rows # # table_id: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; alter table t1 modify a int, drop primary key
-master-bin.000001 # Intvar # # INSERT_ID=5
-master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(null,"try_57_")
-master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t16` (
- `UUID()` varchar(36) CHARACTER SET utf8 NOT NULL DEFAULT ''
-)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t16)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t16)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; insert into t16 values("try_66_")
-master-bin.000001 # Query # # use `mysqltest1`; DROP TABLE IF EXISTS t11
-master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE t11 (song VARCHAR(255))
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t11)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `mysqltest1`; INSERT INTO t11 VALUES('Careful With That Axe, Eugene')
-master-bin.000001 # Query # # use `mysqltest1`; DROP TABLE IF EXISTS t12
-master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE t12 (data LONG)
-master-bin.000001 # Table_map # # table_id: # (mysqltest1.t12)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-drop database mysqltest1;
-set global binlog_format =@my_binlog_format;
diff --git a/mysql-test/r/rpl_timezone.result b/mysql-test/r/rpl_timezone.result
deleted file mode 100644
index 47ef16b9d49..00000000000
--- a/mysql-test/r/rpl_timezone.result
+++ /dev/null
@@ -1,107 +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;
-set @my_time_zone= @@global.time_zone;
-set timestamp=100000000;
-create table t1 (t timestamp, n int not null auto_increment, PRIMARY KEY(n));
-create table t2 (t char(32), n int not null auto_increment, PRIMARY KEY(n));
-select @@time_zone;
-@@time_zone
-Japan
-select @@time_zone;
-@@time_zone
-Europe/Moscow
-insert into t1 values ('20050101000000', NULL), ('20050611093902',NULL);
-insert into t1 values ('20040101000000',NULL), ('20040611093902',NULL);
-SELECT * FROM t1 ORDER BY n;
-t n
-2005-01-01 00:00:00 1
-2005-06-11 09:39:02 2
-2004-01-01 00:00:00 3
-2004-06-11 09:39:02 4
-SELECT * FROM t1 ORDER BY n;
-t n
-2005-01-01 06:00:00 1
-2005-06-11 14:39:02 2
-2004-01-01 06:00:00 3
-2004-06-11 14:39:02 4
-delete from t1;
-set time_zone='Europe/Moscow';
-insert into t1 values ('20040101000000',NULL), ('20040611093902',NULL);
-SELECT * FROM t1 ORDER BY n;
-t n
-2004-01-01 00:00:00 5
-2004-06-11 09:39:02 6
-set time_zone='Europe/Moscow';
-SELECT * FROM t1 ORDER BY n;
-t n
-2004-01-01 00:00:00 5
-2004-06-11 09:39:02 6
-delete from t1;
-set time_zone='UTC';
-load data infile '../std_data_ln/rpl_timezone2.dat' into table t1;
-Warnings:
-Warning 1265 Data truncated for column 't' at row 1
-Warning 1261 Row 1 doesn't contain data for all columns
-Warning 1265 Data truncated for column 't' at row 2
-Warning 1261 Row 2 doesn't contain data for all columns
-SELECT * FROM t1 ORDER BY n;
-t n
-0000-00-00 00:00:00 7
-0000-00-00 00:00:00 8
-set time_zone='UTC';
-SELECT * FROM t1 ORDER BY n;
-t n
-0000-00-00 00:00:00 7
-0000-00-00 00:00:00 8
-set time_zone='Europe/Moscow';
-set time_zone='Europe/Moscow';
-delete from t1;
-insert into t1 values ('20040101000000',NULL), ('20040611093902',NULL);
-set time_zone='MET';
-insert into t2 (select * from t1);
-SELECT * FROM t1 ORDER BY n;
-t n
-2003-12-31 22:00:00 9
-2004-06-11 07:39:02 10
-SELECT * FROM t2 ORDER BY n;
-t n
-2003-12-31 22:00:00 9
-2004-06-11 07:39:02 10
-delete from t2;
-set timestamp=1000072000;
-insert into t2 values (current_timestamp,NULL), (current_date,NULL), (current_time,NULL);
-SELECT * FROM t2 ORDER BY n;
-t n
-2001-09-09 23:46:40 11
-2001-09-09 12
-23:46:40 13
-delete from t2;
-insert into t2 values (from_unixtime(1000000000),NULL),
-(unix_timestamp('2001-09-09 03:46:40'),NULL);
-SELECT * FROM t2 ORDER BY n;
-t n
-2001-09-09 03:46:40 14
-1000000000 15
-SELECT * FROM t2 ORDER BY n;
-t n
-2001-09-09 03:46:40 14
-1000000000 15
-set global time_zone='MET';
-delete from t2;
-set time_zone='UTC';
-insert into t2 values(convert_tz('2004-01-01 00:00:00','MET',@@time_zone),NULL);
-insert into t2 values(convert_tz('2005-01-01 00:00:00','MET','Japan'),NULL);
-SELECT * FROM t2 ORDER BY n;
-t n
-2003-12-31 23:00:00 16
-2005-01-01 08:00:00 17
-SELECT * FROM t2 ORDER BY n;
-t n
-2003-12-31 23:00:00 16
-2005-01-01 08:00:00 17
-drop table t1, t2;
-set global time_zone= @my_time_zone;
diff --git a/mysql-test/r/rpl_trigger.result b/mysql-test/r/rpl_trigger.result
deleted file mode 100644
index 815a87eede5..00000000000
--- a/mysql-test/r/rpl_trigger.result
+++ /dev/null
@@ -1,973 +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;
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t2;
-DROP TABLE IF EXISTS t3;
-create table t1 (a int auto_increment, primary key (a), b int, rand_value double not null);
-create table t2 (a int auto_increment, primary key (a), b int);
-create table t3 (a int auto_increment, primary key (a), name varchar(64) not null, old_a int, old_b int, rand_value double not null);
-create trigger t1 before insert on t1 for each row
-begin
-insert into t3 values (NULL, "t1", new.a, new.b, rand());
-end|
-create trigger t2 after insert on t2 for each row
-begin
-insert into t3 values (NULL, "t2", new.a, new.b, rand());
-end|
-insert into t3 values(100,"log",0,0,0);
-SET @@RAND_SEED1=658490765, @@RAND_SEED2=635893186;
-insert into t1 values(1,1,rand()),(NULL,2,rand());
-insert into t2 (b) values(last_insert_id());
-insert into t2 values(3,0),(NULL,0);
-insert into t2 values(NULL,0),(500,0);
-select a,b, truncate(rand_value,4) from t1;
-a b truncate(rand_value,4)
-1 1 0.4320
-2 2 0.3055
-select * from t2;
-a b
-1 2
-3 0
-4 0
-5 0
-500 0
-select a,name, old_a, old_b, truncate(rand_value,4) from t3;
-a name old_a old_b truncate(rand_value,4)
-100 log 0 0 0.0000
-101 t1 1 1 0.3203
-102 t1 0 2 0.5666
-103 t2 1 2 0.9164
-104 t2 3 0 0.8826
-105 t2 4 0 0.6635
-106 t2 5 0 0.6699
-107 t2 500 0 0.3593
-
---- On slave --
-select a,b, truncate(rand_value,4) from t1;
-a b truncate(rand_value,4)
-1 1 0.4320
-2 2 0.3055
-select * from t2;
-a b
-1 2
-3 0
-4 0
-5 0
-500 0
-select a,name, old_a, old_b, truncate(rand_value,4) from t3;
-a name old_a old_b truncate(rand_value,4)
-100 log 0 0 0.0000
-101 t1 1 1 0.3203
-102 t1 0 2 0.5666
-103 t2 1 2 0.9164
-104 t2 3 0 0.8826
-105 t2 4 0 0.6635
-106 t2 5 0 0.6699
-107 t2 500 0 0.3593
-drop table t1,t2,t3;
-select get_lock("bug12480",2);
-get_lock("bug12480",2)
-1
-create table t1 (a datetime,b datetime, c datetime);
-drop function if exists bug12480;
-create function bug12480() returns datetime
-begin
-set @a=get_lock("bug12480",2);
-return now();
-end|
-create trigger t1_first before insert on t1
-for each row begin
-set @a=get_lock("bug12480",2);
-set new.b= now();
-set new.c= bug12480();
-end
-|
-insert into t1 set a = now();
-select a=b && a=c from t1;
-a=b && a=c
-1
-SELECT routine_name, definer
-FROM information_schema.routines;
-routine_name definer
-bug12480 root@localhost
-SELECT trigger_name, definer
-FROM information_schema.triggers;
-trigger_name definer
-t1_first root@localhost
-
---- On slave --
-SELECT routine_name, definer
-FROM information_schema.routines;
-routine_name definer
-bug12480 root@localhost
-SELECT trigger_name, definer
-FROM information_schema.triggers;
-trigger_name definer
-t1_first root@localhost
-select a=b && a=c from t1;
-a=b && a=c
-1
-test
-1
-truncate table t1;
-drop trigger t1_first;
-insert into t1 values ("2003-03-03","2003-03-03","2003-03-03"),(bug12480(),bug12480(),bug12480()),(now(),now(),now());
-select a=b && a=c from t1;
-a=b && a=c
-1
-1
-1
-drop function bug12480;
-drop table t1;
-create table t1 (i int);
-create table t2 (i int);
-create trigger tr1 before insert on t1 for each row
-begin
-insert into t2 values (1);
-end|
-create database other;
-use other;
-insert into test.t1 values (1);
-use test;
-drop table t1,t2;
-drop database other;
-test case for BUG#13227
--------------------
-10
--------------------
-drop table if exists t110;
-drop table if exists t210,t310;
-create table t110 (f1 int) /* 2 replicate */;
-insert into t110 values (-5);
-insert into t110 values (-4);
-insert into t110 values (-3);
-insert into t110 values (-2);
-insert into t110 values (-1);
-select * from t110;
-f1
--5
--4
--3
--2
--1
-create trigger trg110 before update on t110 /* slave local */
-for each row
-begin
-DECLARE r integer;
-SELECT f2 INTO r FROM t210 where f1=NEW.f1;
-INSERT INTO t310 values (r);
-end|
-create table t210 (f1 int, f2 int) /* slave local */;
-create table t310 (f3 int) /* slave local */;
-insert into t210 values (5, 5*100);
-insert into t210 values (4, 4*100);
-insert into t210 values (3, 3*100);
-insert into t210 values (2, 2*100);
-insert into t210 values (1, 1*100);
-select * from t210;
-f1 f2
-5 500
-4 400
-3 300
-2 200
-1 100
-UPDATE t110 SET f1=5 where f1=-5;
-SELECT * from t110 /* must be f1 5, 1 - 5 2 - 5 ... -1 */;
-f1
-5
--4
--3
--2
--1
-SELECT * from t310 /* must be f3 5*100 */;
-f3
-500
-UPDATE t110 SET f1=5 where f1=-5;
-UPDATE t110 SET f1=4 where f1=-4;
-UPDATE t110 SET f1=3 where f1=-3;
-UPDATE t110 SET f1=2 where f1=-2;
-UPDATE t110 SET f1=1 where f1=-1;
-SELECT * from t110 /* must be f1 5 ... 1 */;
-f1
-5
-4
-3
-2
-1
-SELECT * from t310 /* must be f3 5 * 100 ... 100 */;
-f3
-500
-400
-300
-200
-100
-drop trigger trg110;
-drop table t210,t310;
-drop table t110;
--------------------
-9
--------------------
-drop table if exists t19;
-drop table if exists t29,t39;
-create table t19 (f1 int) /* 2 replicate */;
-insert into t19 values (-5);
-insert into t19 values (-4);
-insert into t19 values (-3);
-insert into t19 values (-2);
-insert into t19 values (-1);
-select * from t19;
-f1
--5
--4
--3
--2
--1
-create trigger trg19 before update on t19 /* slave local */
-for each row
-begin
-DECLARE r integer;
-SELECT f2 INTO r FROM t29 where f1=NEW.f1;
-INSERT INTO t39 values (r);
-end|
-create table t29 (f1 int, f2 int) /* slave local */;
-create table t39 (f3 int) /* slave local */;
-insert into t29 values (5, 5*100);
-insert into t29 values (4, 4*100);
-insert into t29 values (3, 3*100);
-insert into t29 values (2, 2*100);
-insert into t29 values (1, 1*100);
-select * from t29;
-f1 f2
-5 500
-4 400
-3 300
-2 200
-1 100
-UPDATE t19 SET f1=5 where f1=-5;
-SELECT * from t19 /* must be f1 5, 1 - 5 2 - 5 ... -1 */;
-f1
-5
--4
--3
--2
--1
-SELECT * from t39 /* must be f3 5*100 */;
-f3
-500
-UPDATE t19 SET f1=5 where f1=-5;
-UPDATE t19 SET f1=4 where f1=-4;
-UPDATE t19 SET f1=3 where f1=-3;
-UPDATE t19 SET f1=2 where f1=-2;
-UPDATE t19 SET f1=1 where f1=-1;
-SELECT * from t19 /* must be f1 5 ... 1 */;
-f1
-5
-4
-3
-2
-1
-SELECT * from t39 /* must be f3 5 * 100 ... 100 */;
-f3
-500
-400
-300
-200
-100
-drop trigger trg19;
-drop table t29,t39;
-drop table t19;
--------------------
-8
--------------------
-drop table if exists t18;
-drop table if exists t28,t38;
-create table t18 (f1 int) /* 2 replicate */;
-insert into t18 values (-5);
-insert into t18 values (-4);
-insert into t18 values (-3);
-insert into t18 values (-2);
-insert into t18 values (-1);
-select * from t18;
-f1
--5
--4
--3
--2
--1
-create trigger trg18 before update on t18 /* slave local */
-for each row
-begin
-DECLARE r integer;
-SELECT f2 INTO r FROM t28 where f1=NEW.f1;
-INSERT INTO t38 values (r);
-end|
-create table t28 (f1 int, f2 int) /* slave local */;
-create table t38 (f3 int) /* slave local */;
-insert into t28 values (5, 5*100);
-insert into t28 values (4, 4*100);
-insert into t28 values (3, 3*100);
-insert into t28 values (2, 2*100);
-insert into t28 values (1, 1*100);
-select * from t28;
-f1 f2
-5 500
-4 400
-3 300
-2 200
-1 100
-UPDATE t18 SET f1=5 where f1=-5;
-SELECT * from t18 /* must be f1 5, 1 - 5 2 - 5 ... -1 */;
-f1
-5
--4
--3
--2
--1
-SELECT * from t38 /* must be f3 5*100 */;
-f3
-500
-UPDATE t18 SET f1=5 where f1=-5;
-UPDATE t18 SET f1=4 where f1=-4;
-UPDATE t18 SET f1=3 where f1=-3;
-UPDATE t18 SET f1=2 where f1=-2;
-UPDATE t18 SET f1=1 where f1=-1;
-SELECT * from t18 /* must be f1 5 ... 1 */;
-f1
-5
-4
-3
-2
-1
-SELECT * from t38 /* must be f3 5 * 100 ... 100 */;
-f3
-500
-400
-300
-200
-100
-drop trigger trg18;
-drop table t28,t38;
-drop table t18;
--------------------
-7
--------------------
-drop table if exists t17;
-drop table if exists t27,t37;
-create table t17 (f1 int) /* 2 replicate */;
-insert into t17 values (-5);
-insert into t17 values (-4);
-insert into t17 values (-3);
-insert into t17 values (-2);
-insert into t17 values (-1);
-select * from t17;
-f1
--5
--4
--3
--2
--1
-create trigger trg17 before update on t17 /* slave local */
-for each row
-begin
-DECLARE r integer;
-SELECT f2 INTO r FROM t27 where f1=NEW.f1;
-INSERT INTO t37 values (r);
-end|
-create table t27 (f1 int, f2 int) /* slave local */;
-create table t37 (f3 int) /* slave local */;
-insert into t27 values (5, 5*100);
-insert into t27 values (4, 4*100);
-insert into t27 values (3, 3*100);
-insert into t27 values (2, 2*100);
-insert into t27 values (1, 1*100);
-select * from t27;
-f1 f2
-5 500
-4 400
-3 300
-2 200
-1 100
-UPDATE t17 SET f1=5 where f1=-5;
-SELECT * from t17 /* must be f1 5, 1 - 5 2 - 5 ... -1 */;
-f1
-5
--4
--3
--2
--1
-SELECT * from t37 /* must be f3 5*100 */;
-f3
-500
-UPDATE t17 SET f1=5 where f1=-5;
-UPDATE t17 SET f1=4 where f1=-4;
-UPDATE t17 SET f1=3 where f1=-3;
-UPDATE t17 SET f1=2 where f1=-2;
-UPDATE t17 SET f1=1 where f1=-1;
-SELECT * from t17 /* must be f1 5 ... 1 */;
-f1
-5
-4
-3
-2
-1
-SELECT * from t37 /* must be f3 5 * 100 ... 100 */;
-f3
-500
-400
-300
-200
-100
-drop trigger trg17;
-drop table t27,t37;
-drop table t17;
--------------------
-6
--------------------
-drop table if exists t16;
-drop table if exists t26,t36;
-create table t16 (f1 int) /* 2 replicate */;
-insert into t16 values (-5);
-insert into t16 values (-4);
-insert into t16 values (-3);
-insert into t16 values (-2);
-insert into t16 values (-1);
-select * from t16;
-f1
--5
--4
--3
--2
--1
-create trigger trg16 before update on t16 /* slave local */
-for each row
-begin
-DECLARE r integer;
-SELECT f2 INTO r FROM t26 where f1=NEW.f1;
-INSERT INTO t36 values (r);
-end|
-create table t26 (f1 int, f2 int) /* slave local */;
-create table t36 (f3 int) /* slave local */;
-insert into t26 values (5, 5*100);
-insert into t26 values (4, 4*100);
-insert into t26 values (3, 3*100);
-insert into t26 values (2, 2*100);
-insert into t26 values (1, 1*100);
-select * from t26;
-f1 f2
-5 500
-4 400
-3 300
-2 200
-1 100
-UPDATE t16 SET f1=5 where f1=-5;
-SELECT * from t16 /* must be f1 5, 1 - 5 2 - 5 ... -1 */;
-f1
-5
--4
--3
--2
--1
-SELECT * from t36 /* must be f3 5*100 */;
-f3
-500
-UPDATE t16 SET f1=5 where f1=-5;
-UPDATE t16 SET f1=4 where f1=-4;
-UPDATE t16 SET f1=3 where f1=-3;
-UPDATE t16 SET f1=2 where f1=-2;
-UPDATE t16 SET f1=1 where f1=-1;
-SELECT * from t16 /* must be f1 5 ... 1 */;
-f1
-5
-4
-3
-2
-1
-SELECT * from t36 /* must be f3 5 * 100 ... 100 */;
-f3
-500
-400
-300
-200
-100
-drop trigger trg16;
-drop table t26,t36;
-drop table t16;
--------------------
-5
--------------------
-drop table if exists t15;
-drop table if exists t25,t35;
-create table t15 (f1 int) /* 2 replicate */;
-insert into t15 values (-5);
-insert into t15 values (-4);
-insert into t15 values (-3);
-insert into t15 values (-2);
-insert into t15 values (-1);
-select * from t15;
-f1
--5
--4
--3
--2
--1
-create trigger trg15 before update on t15 /* slave local */
-for each row
-begin
-DECLARE r integer;
-SELECT f2 INTO r FROM t25 where f1=NEW.f1;
-INSERT INTO t35 values (r);
-end|
-create table t25 (f1 int, f2 int) /* slave local */;
-create table t35 (f3 int) /* slave local */;
-insert into t25 values (5, 5*100);
-insert into t25 values (4, 4*100);
-insert into t25 values (3, 3*100);
-insert into t25 values (2, 2*100);
-insert into t25 values (1, 1*100);
-select * from t25;
-f1 f2
-5 500
-4 400
-3 300
-2 200
-1 100
-UPDATE t15 SET f1=5 where f1=-5;
-SELECT * from t15 /* must be f1 5, 1 - 5 2 - 5 ... -1 */;
-f1
-5
--4
--3
--2
--1
-SELECT * from t35 /* must be f3 5*100 */;
-f3
-500
-UPDATE t15 SET f1=5 where f1=-5;
-UPDATE t15 SET f1=4 where f1=-4;
-UPDATE t15 SET f1=3 where f1=-3;
-UPDATE t15 SET f1=2 where f1=-2;
-UPDATE t15 SET f1=1 where f1=-1;
-SELECT * from t15 /* must be f1 5 ... 1 */;
-f1
-5
-4
-3
-2
-1
-SELECT * from t35 /* must be f3 5 * 100 ... 100 */;
-f3
-500
-400
-300
-200
-100
-drop trigger trg15;
-drop table t25,t35;
-drop table t15;
--------------------
-4
--------------------
-drop table if exists t14;
-drop table if exists t24,t34;
-create table t14 (f1 int) /* 2 replicate */;
-insert into t14 values (-5);
-insert into t14 values (-4);
-insert into t14 values (-3);
-insert into t14 values (-2);
-insert into t14 values (-1);
-select * from t14;
-f1
--5
--4
--3
--2
--1
-create trigger trg14 before update on t14 /* slave local */
-for each row
-begin
-DECLARE r integer;
-SELECT f2 INTO r FROM t24 where f1=NEW.f1;
-INSERT INTO t34 values (r);
-end|
-create table t24 (f1 int, f2 int) /* slave local */;
-create table t34 (f3 int) /* slave local */;
-insert into t24 values (5, 5*100);
-insert into t24 values (4, 4*100);
-insert into t24 values (3, 3*100);
-insert into t24 values (2, 2*100);
-insert into t24 values (1, 1*100);
-select * from t24;
-f1 f2
-5 500
-4 400
-3 300
-2 200
-1 100
-UPDATE t14 SET f1=5 where f1=-5;
-SELECT * from t14 /* must be f1 5, 1 - 5 2 - 5 ... -1 */;
-f1
-5
--4
--3
--2
--1
-SELECT * from t34 /* must be f3 5*100 */;
-f3
-500
-UPDATE t14 SET f1=5 where f1=-5;
-UPDATE t14 SET f1=4 where f1=-4;
-UPDATE t14 SET f1=3 where f1=-3;
-UPDATE t14 SET f1=2 where f1=-2;
-UPDATE t14 SET f1=1 where f1=-1;
-SELECT * from t14 /* must be f1 5 ... 1 */;
-f1
-5
-4
-3
-2
-1
-SELECT * from t34 /* must be f3 5 * 100 ... 100 */;
-f3
-500
-400
-300
-200
-100
-drop trigger trg14;
-drop table t24,t34;
-drop table t14;
--------------------
-3
--------------------
-drop table if exists t13;
-drop table if exists t23,t33;
-create table t13 (f1 int) /* 2 replicate */;
-insert into t13 values (-5);
-insert into t13 values (-4);
-insert into t13 values (-3);
-insert into t13 values (-2);
-insert into t13 values (-1);
-select * from t13;
-f1
--5
--4
--3
--2
--1
-create trigger trg13 before update on t13 /* slave local */
-for each row
-begin
-DECLARE r integer;
-SELECT f2 INTO r FROM t23 where f1=NEW.f1;
-INSERT INTO t33 values (r);
-end|
-create table t23 (f1 int, f2 int) /* slave local */;
-create table t33 (f3 int) /* slave local */;
-insert into t23 values (5, 5*100);
-insert into t23 values (4, 4*100);
-insert into t23 values (3, 3*100);
-insert into t23 values (2, 2*100);
-insert into t23 values (1, 1*100);
-select * from t23;
-f1 f2
-5 500
-4 400
-3 300
-2 200
-1 100
-UPDATE t13 SET f1=5 where f1=-5;
-SELECT * from t13 /* must be f1 5, 1 - 5 2 - 5 ... -1 */;
-f1
-5
--4
--3
--2
--1
-SELECT * from t33 /* must be f3 5*100 */;
-f3
-500
-UPDATE t13 SET f1=5 where f1=-5;
-UPDATE t13 SET f1=4 where f1=-4;
-UPDATE t13 SET f1=3 where f1=-3;
-UPDATE t13 SET f1=2 where f1=-2;
-UPDATE t13 SET f1=1 where f1=-1;
-SELECT * from t13 /* must be f1 5 ... 1 */;
-f1
-5
-4
-3
-2
-1
-SELECT * from t33 /* must be f3 5 * 100 ... 100 */;
-f3
-500
-400
-300
-200
-100
-drop trigger trg13;
-drop table t23,t33;
-drop table t13;
--------------------
-2
--------------------
-drop table if exists t12;
-drop table if exists t22,t32;
-create table t12 (f1 int) /* 2 replicate */;
-insert into t12 values (-5);
-insert into t12 values (-4);
-insert into t12 values (-3);
-insert into t12 values (-2);
-insert into t12 values (-1);
-select * from t12;
-f1
--5
--4
--3
--2
--1
-create trigger trg12 before update on t12 /* slave local */
-for each row
-begin
-DECLARE r integer;
-SELECT f2 INTO r FROM t22 where f1=NEW.f1;
-INSERT INTO t32 values (r);
-end|
-create table t22 (f1 int, f2 int) /* slave local */;
-create table t32 (f3 int) /* slave local */;
-insert into t22 values (5, 5*100);
-insert into t22 values (4, 4*100);
-insert into t22 values (3, 3*100);
-insert into t22 values (2, 2*100);
-insert into t22 values (1, 1*100);
-select * from t22;
-f1 f2
-5 500
-4 400
-3 300
-2 200
-1 100
-UPDATE t12 SET f1=5 where f1=-5;
-SELECT * from t12 /* must be f1 5, 1 - 5 2 - 5 ... -1 */;
-f1
-5
--4
--3
--2
--1
-SELECT * from t32 /* must be f3 5*100 */;
-f3
-500
-UPDATE t12 SET f1=5 where f1=-5;
-UPDATE t12 SET f1=4 where f1=-4;
-UPDATE t12 SET f1=3 where f1=-3;
-UPDATE t12 SET f1=2 where f1=-2;
-UPDATE t12 SET f1=1 where f1=-1;
-SELECT * from t12 /* must be f1 5 ... 1 */;
-f1
-5
-4
-3
-2
-1
-SELECT * from t32 /* must be f3 5 * 100 ... 100 */;
-f3
-500
-400
-300
-200
-100
-drop trigger trg12;
-drop table t22,t32;
-drop table t12;
--------------------
-1
--------------------
-drop table if exists t11;
-drop table if exists t21,t31;
-create table t11 (f1 int) /* 2 replicate */;
-insert into t11 values (-5);
-insert into t11 values (-4);
-insert into t11 values (-3);
-insert into t11 values (-2);
-insert into t11 values (-1);
-select * from t11;
-f1
--5
--4
--3
--2
--1
-create trigger trg11 before update on t11 /* slave local */
-for each row
-begin
-DECLARE r integer;
-SELECT f2 INTO r FROM t21 where f1=NEW.f1;
-INSERT INTO t31 values (r);
-end|
-create table t21 (f1 int, f2 int) /* slave local */;
-create table t31 (f3 int) /* slave local */;
-insert into t21 values (5, 5*100);
-insert into t21 values (4, 4*100);
-insert into t21 values (3, 3*100);
-insert into t21 values (2, 2*100);
-insert into t21 values (1, 1*100);
-select * from t21;
-f1 f2
-5 500
-4 400
-3 300
-2 200
-1 100
-UPDATE t11 SET f1=5 where f1=-5;
-SELECT * from t11 /* must be f1 5, 1 - 5 2 - 5 ... -1 */;
-f1
-5
--4
--3
--2
--1
-SELECT * from t31 /* must be f3 5*100 */;
-f3
-500
-UPDATE t11 SET f1=5 where f1=-5;
-UPDATE t11 SET f1=4 where f1=-4;
-UPDATE t11 SET f1=3 where f1=-3;
-UPDATE t11 SET f1=2 where f1=-2;
-UPDATE t11 SET f1=1 where f1=-1;
-SELECT * from t11 /* must be f1 5 ... 1 */;
-f1
-5
-4
-3
-2
-1
-SELECT * from t31 /* must be f3 5 * 100 ... 100 */;
-f3
-500
-400
-300
-200
-100
-drop trigger trg11;
-drop table t21,t31;
-drop table t11;
-STOP SLAVE;
-FLUSH LOGS;
-RESET SLAVE;
-START SLAVE;
-SELECT MASTER_POS_WAIT('master-bin.000001', 513) >= 0;
-MASTER_POS_WAIT('master-bin.000001', 513) >= 0
-1
-SHOW TABLES LIKE 't_';
-Tables_in_test (t_)
-t1
-t2
-SHOW TRIGGERS;
-Trigger Event Table Statement Timing Created sql_mode Definer
-trg1 INSERT t1 INSERT INTO t2 VALUES(CURRENT_USER()) AFTER NULL
-SELECT * FROM t1;
-c
-1
-SELECT * FROM t2;
-s
-@
-INSERT INTO t1 VALUES(2);
-SELECT * FROM t1;
-c
-1
-2
-SELECT * FROM t2;
-s
-@
-root@localhost
-DROP TRIGGER trg1;
-Warnings:
-Warning 1454 No definer attribute for trigger 'test'.'trg1'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger.
-DROP TABLE t1;
-DROP TABLE t2;
-STOP SLAVE;
-RESET SLAVE;
-SHOW TABLES LIKE 't_';
-Tables_in_test (t_)
-SHOW TRIGGERS;
-Trigger Event Table Statement Timing Created sql_mode Definer
-RESET MASTER;
-START SLAVE;
-
----> Test for BUG#20438
-
----> Preparing environment...
----> connection: master
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t2;
-
----> Synchronizing slave with master...
-
----> connection: master
-
----> Creating objects...
-CREATE TABLE t1(c INT);
-CREATE TABLE t2(c INT);
-/*!50003 CREATE TRIGGER t1_bi BEFORE INSERT ON t1
-FOR EACH ROW
-INSERT INTO t2 VALUES(NEW.c * 10) */;
-
----> Inserting value...
-INSERT INTO t1 VALUES(1);
-
----> Checking on master...
-SELECT * FROM t1;
-c
-1
-SELECT * FROM t2;
-c
-10
-
----> Synchronizing slave with master...
----> connection: master
-
----> Checking on slave...
-SELECT * FROM t1;
-c
-1
-SELECT * FROM t2;
-c
-10
-
----> connection: master
-
----> Cleaning up...
-DROP TABLE t1;
-DROP TABLE t2;
-drop table if exists t1;
-create table t1(a int, b varchar(50));
-drop trigger not_a_trigger;
-ERROR HY000: Trigger does not exist
-drop trigger if exists not_a_trigger;
-Warnings:
-Note 1360 Trigger does not exist
-create trigger t1_bi before insert on t1
-for each row set NEW.b := "In trigger t1_bi";
-insert into t1 values (1, "a");
-drop trigger if exists t1_bi;
-insert into t1 values (2, "b");
-drop trigger if exists t1_bi;
-Warnings:
-Note 1360 Trigger does not exist
-insert into t1 values (3, "c");
-select * from t1;
-a b
-1 In trigger t1_bi
-2 b
-3 c
-select * from t1;
-a b
-1 In trigger t1_bi
-2 b
-3 c
-drop table t1;
diff --git a/mysql-test/r/rpl_truncate_7ndb.result b/mysql-test/r/rpl_truncate_7ndb.result
deleted file mode 100644
index 62ace911e45..00000000000
--- a/mysql-test/r/rpl_truncate_7ndb.result
+++ /dev/null
@@ -1,95 +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;
-**** On Master ****
-CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
-INSERT INTO t1 VALUES (1,1), (2,2);
-SELECT * FROM t1 ORDER BY a,b;
-a b
-1 1
-2 2
-**** On Slave ****
-INSERT INTO t1 VALUE (3,3);
-SELECT * FROM t1 ORDER BY a,b;
-a b
-1 1
-2 2
-3 3
-**** On Master ****
-TRUNCATE TABLE t1;
-SELECT * FROM t1 ORDER BY a,b;
-a b
-**** On Slave ****
-SELECT * FROM t1 ORDER BY a,b;
-a b
-**** On Master ****
-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 40 table_id: # (test.t1)
-master-bin.000001 327 Table_map 1 98 table_id: # (mysql.ndb_apply_status)
-master-bin.000001 385 Write_rows 1 157 table_id: #
-master-bin.000001 444 Write_rows 1 195 table_id: #
-master-bin.000001 482 Write_rows 1 233 table_id: # flags: STMT_END_F
-master-bin.000001 520 Query 1 585 COMMIT
-master-bin.000001 585 Query 1 665 use `test`; TRUNCATE TABLE t1
-master-bin.000001 665 Query 1 741 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);
-SELECT * FROM t1 ORDER BY a,b;
-a b
-1 1
-2 2
-**** On Slave ****
-INSERT INTO t1 VALUE (3,3);
-SELECT * FROM t1 ORDER BY a,b;
-a b
-1 1
-2 2
-3 3
-**** On Master ****
-DELETE FROM t1;
-SELECT * FROM t1 ORDER BY a,b;
-a b
-**** On Slave ****
-SELECT * FROM t1 ORDER BY a,b;
-a b
-3 3
-**** On Master ****
-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 40 table_id: # (test.t1)
-master-bin.000001 327 Table_map 1 98 table_id: # (mysql.ndb_apply_status)
-master-bin.000001 385 Write_rows 1 157 table_id: #
-master-bin.000001 444 Write_rows 1 195 table_id: #
-master-bin.000001 482 Write_rows 1 233 table_id: # flags: STMT_END_F
-master-bin.000001 520 Query 1 585 COMMIT
-master-bin.000001 585 Query 1 665 use `test`; TRUNCATE TABLE t1
-master-bin.000001 665 Query 1 741 use `test`; DROP TABLE t1
-master-bin.000001 741 Query 1 858 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
-master-bin.000001 858 Query 1 922 BEGIN
-master-bin.000001 922 Table_map 1 40 table_id: # (test.t1)
-master-bin.000001 962 Table_map 1 98 table_id: # (mysql.ndb_apply_status)
-master-bin.000001 1020 Write_rows 1 157 table_id: #
-master-bin.000001 1079 Write_rows 1 195 table_id: #
-master-bin.000001 1117 Write_rows 1 233 table_id: # flags: STMT_END_F
-master-bin.000001 1155 Query 1 1220 COMMIT
-master-bin.000001 1220 Query 1 1284 BEGIN
-master-bin.000001 1284 Table_map 1 40 table_id: # (test.t1)
-master-bin.000001 1324 Table_map 1 98 table_id: # (mysql.ndb_apply_status)
-master-bin.000001 1382 Write_rows 1 157 table_id: #
-master-bin.000001 1441 Delete_rows 1 191 table_id: #
-master-bin.000001 1475 Delete_rows 1 225 table_id: # flags: STMT_END_F
-master-bin.000001 1509 Query 1 1574 COMMIT
-master-bin.000001 1574 Query 1 1650 use `test`; DROP TABLE t1
diff --git a/mysql-test/r/rpl_truncate_7ndb_2.result b/mysql-test/r/rpl_truncate_7ndb_2.result
deleted file mode 100644
index ca323e193fa..00000000000
--- a/mysql-test/r/rpl_truncate_7ndb_2.result
+++ /dev/null
@@ -1,91 +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;
-**** On Master ****
-CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
-INSERT INTO t1 VALUES (1,1), (2,2);
-SELECT * FROM t1 ORDER BY a,b;
-a b
-1 1
-2 2
-**** On Slave ****
-INSERT INTO t1 VALUE (3,3);
-SELECT * FROM t1 ORDER BY a,b;
-a b
-1 1
-2 2
-3 3
-**** On Master ****
-TRUNCATE TABLE t1;
-SELECT * FROM t1 ORDER BY a,b;
-a b
-**** On Slave ****
-SELECT * FROM t1 ORDER BY a,b;
-a b
-**** On Master ****
-DROP TABLE t1;
-SHOW BINLOG EVENTS;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4
-master-bin.000001 102 Query 1 219 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
-master-bin.000001 219 Query 1 283 BEGIN
-master-bin.000001 283 Table_map 1 40 table_id: # (test.t1)
-master-bin.000001 323 Table_map 1 93 table_id: # (mysql.apply_status)
-master-bin.000001 376 Write_rows 1 135 table_id: #
-master-bin.000001 418 Write_rows 1 182 table_id: # flags: STMT_END_F
-master-bin.000001 465 Query 1 530 COMMIT
-master-bin.000001 530 Query 1 610 use `test`; TRUNCATE TABLE t1
-master-bin.000001 610 Query 1 686 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);
-SELECT * FROM t1 ORDER BY a,b;
-a b
-1 1
-2 2
-**** On Slave ****
-INSERT INTO t1 VALUE (3,3);
-SELECT * FROM t1 ORDER BY a,b;
-a b
-1 1
-2 2
-3 3
-**** On Master ****
-DELETE FROM t1;
-SELECT * FROM t1 ORDER BY a,b;
-a b
-**** On Slave ****
-SELECT * FROM t1 ORDER BY a,b;
-a b
-3 3
-**** On Master ****
-DROP TABLE t1;
-SHOW BINLOG EVENTS;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4
-master-bin.000001 102 Query 1 219 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
-master-bin.000001 219 Query 1 283 BEGIN
-master-bin.000001 283 Table_map 1 40 table_id: # (test.t1)
-master-bin.000001 323 Table_map 1 93 table_id: # (mysql.apply_status)
-master-bin.000001 376 Write_rows 1 135 table_id: #
-master-bin.000001 418 Write_rows 1 182 table_id: # flags: STMT_END_F
-master-bin.000001 465 Query 1 530 COMMIT
-master-bin.000001 530 Query 1 610 use `test`; TRUNCATE TABLE t1
-master-bin.000001 610 Query 1 686 use `test`; DROP TABLE t1
-master-bin.000001 686 Query 1 803 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
-master-bin.000001 803 Query 1 867 BEGIN
-master-bin.000001 867 Table_map 1 40 table_id: # (test.t1)
-master-bin.000001 907 Table_map 1 93 table_id: # (mysql.apply_status)
-master-bin.000001 960 Write_rows 1 135 table_id: #
-master-bin.000001 1002 Write_rows 1 182 table_id: # flags: STMT_END_F
-master-bin.000001 1049 Query 1 1114 COMMIT
-master-bin.000001 1114 Query 1 1178 BEGIN
-master-bin.000001 1178 Table_map 1 40 table_id: # (test.t1)
-master-bin.000001 1218 Table_map 1 93 table_id: # (mysql.apply_status)
-master-bin.000001 1271 Write_rows 1 135 table_id: #
-master-bin.000001 1313 Delete_rows 1 174 table_id: # flags: STMT_END_F
-master-bin.000001 1352 Query 1 1417 COMMIT
-master-bin.000001 1417 Query 1 1493 use `test`; DROP TABLE t1
diff --git a/mysql-test/r/rpl_udf.result b/mysql-test/r/rpl_udf.result
deleted file mode 100644
index 6587632bca0..00000000000
--- a/mysql-test/r/rpl_udf.result
+++ /dev/null
@@ -1,310 +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;
-set binlog_format=row;
-drop table if exists t1;
-"*** Test 1) Test UDFs via loadable libraries ***
-"Running on the master"
-CREATE FUNCTION myfunc_double RETURNS REAL SONAME "UDF_EXAMPLE_LIB";
-affected rows: 0
-CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB";
-affected rows: 0
-CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB";
-ERROR HY000: Can't find symbol 'myfunc_nonexist' in library
-SELECT * FROM mysql.func;
-name ret dl type
-myfunc_double 1 UDF_LIB function
-myfunc_int 2 UDF_LIB function
-affected rows: 2
-"Running on the slave"
-SELECT * FROM mysql.func;
-name ret dl type
-myfunc_double 1 UDF_LIB function
-myfunc_int 2 UDF_LIB function
-affected rows: 2
-"Running on the master"
-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
-INSERT INTO t1 VALUES(myfunc_int(10), myfunc_double(5.00));
-affected rows: 1
-INSERT INTO t1 VALUES(myfunc_int(200), myfunc_double(25.00));
-affected rows: 1
-INSERT INTO t1 VALUES(myfunc_int(1), myfunc_double(500.00));
-affected rows: 1
-SELECT * FROM t1 ORDER BY sum;
-sum price
-1 48.5
-10 48.75
-100 48.6
-200 49
-affected rows: 4
-"Running on the slave"
-SELECT * FROM t1 ORDER BY sum;
-sum price
-1 48.5
-10 48.75
-100 48.6
-200 49
-affected rows: 4
-SELECT myfunc_int(25);
-myfunc_int(25)
-25
-affected rows: 1
-SELECT myfunc_double(75.00);
-myfunc_double(75.00)
-50.00
-affected rows: 1
-"Running on the master"
-DROP FUNCTION myfunc_double;
-affected rows: 0
-DROP FUNCTION myfunc_int;
-affected rows: 0
-SELECT * FROM mysql.func;
-name ret dl type
-affected rows: 0
-"Running on the slave"
-SELECT * FROM mysql.func;
-name ret dl type
-affected rows: 0
-"Running on the master"
-DROP TABLE t1;
-affected rows: 0
-"*** Test 2) Test UDFs with SQL body ***
-"Running on the master"
-CREATE FUNCTION myfuncsql_int(i INT) RETURNS INTEGER DETERMINISTIC RETURN i;
-affected rows: 0
-CREATE FUNCTION myfuncsql_double(d DOUBLE) RETURNS INTEGER DETERMINISTIC RETURN d * 2.00;
-affected rows: 0
-SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
-db name type param_list body comment
-test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00
-test myfuncsql_int FUNCTION i INT RETURN i
-affected rows: 2
-"Running on the slave"
-SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
-db name type param_list body comment
-test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00
-test myfuncsql_int FUNCTION i INT RETURN i
-affected rows: 2
-"Running on the master"
-CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=MyISAM;
-affected rows: 0
-INSERT INTO t1 VALUES(myfuncsql_int(100), myfuncsql_double(50.00));
-affected rows: 1
-INSERT INTO t1 VALUES(myfuncsql_int(10), myfuncsql_double(5.00));
-affected rows: 1
-INSERT INTO t1 VALUES(myfuncsql_int(200), myfuncsql_double(25.00));
-affected rows: 1
-INSERT INTO t1 VALUES(myfuncsql_int(1), myfuncsql_double(500.00));
-affected rows: 1
-SELECT * FROM t1 ORDER BY sum;
-sum price
-1 1000
-10 10
-100 100
-200 50
-affected rows: 4
-"Running on the slave"
-SELECT * FROM t1 ORDER BY sum;
-sum price
-1 1000
-10 10
-100 100
-200 50
-affected rows: 4
-"Running on the master"
-ALTER FUNCTION myfuncsql_int COMMENT "This was altered.";
-affected rows: 0
-ALTER FUNCTION myfuncsql_double COMMENT "This was altered.";
-affected rows: 0
-SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
-db name type param_list body comment
-test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00 This was altered.
-test myfuncsql_int FUNCTION i INT RETURN i This was altered.
-affected rows: 2
-"Running on the slave"
-SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
-db name type param_list body comment
-test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00 This was altered.
-test myfuncsql_int FUNCTION i INT RETURN i This was altered.
-affected rows: 2
-SELECT myfuncsql_int(25);
-myfuncsql_int(25)
-25
-affected rows: 1
-SELECT myfuncsql_double(75.00);
-myfuncsql_double(75.00)
-150
-affected rows: 1
-"Running on the master"
-DROP FUNCTION myfuncsql_double;
-affected rows: 0
-DROP FUNCTION myfuncsql_int;
-affected rows: 0
-SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
-db name type param_list body comment
-affected rows: 0
-"Running on the slave"
-SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
-db name type param_list body comment
-affected rows: 0
-"Running on the master"
-DROP TABLE t1;
-affected rows: 0
-set binlog_format=statement;
-drop table if exists t1;
-"*** Test 1) Test UDFs via loadable libraries ***
-"Running on the master"
-CREATE FUNCTION myfunc_double RETURNS REAL SONAME "UDF_EXAMPLE_LIB";
-affected rows: 0
-CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB";
-affected rows: 0
-CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB";
-ERROR HY000: Can't find symbol 'myfunc_nonexist' in library
-SELECT * FROM mysql.func;
-name ret dl type
-myfunc_int 2 UDF_LIB function
-myfunc_double 1 UDF_LIB function
-affected rows: 2
-"Running on the slave"
-SELECT * FROM mysql.func;
-name ret dl type
-myfunc_int 2 UDF_LIB function
-myfunc_double 1 UDF_LIB function
-affected rows: 2
-"Running on the master"
-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
-INSERT INTO t1 VALUES(myfunc_int(10), myfunc_double(5.00));
-affected rows: 1
-INSERT INTO t1 VALUES(myfunc_int(200), myfunc_double(25.00));
-affected rows: 1
-INSERT INTO t1 VALUES(myfunc_int(1), myfunc_double(500.00));
-affected rows: 1
-SELECT * FROM t1 ORDER BY sum;
-sum price
-1 48.5
-10 48.75
-100 48.6
-200 49
-affected rows: 4
-"Running on the slave"
-SELECT * FROM t1 ORDER BY sum;
-sum price
-1 48.5
-10 48.75
-100 48.6
-200 49
-affected rows: 4
-SELECT myfunc_int(25);
-myfunc_int(25)
-25
-affected rows: 1
-SELECT myfunc_double(75.00);
-myfunc_double(75.00)
-50.00
-affected rows: 1
-"Running on the master"
-DROP FUNCTION myfunc_double;
-affected rows: 0
-DROP FUNCTION myfunc_int;
-affected rows: 0
-SELECT * FROM mysql.func;
-name ret dl type
-affected rows: 0
-"Running on the slave"
-SELECT * FROM mysql.func;
-name ret dl type
-affected rows: 0
-"Running on the master"
-DROP TABLE t1;
-affected rows: 0
-"*** Test 2) Test UDFs with SQL body ***
-"Running on the master"
-CREATE FUNCTION myfuncsql_int(i INT) RETURNS INTEGER DETERMINISTIC RETURN i;
-affected rows: 0
-CREATE FUNCTION myfuncsql_double(d DOUBLE) RETURNS INTEGER DETERMINISTIC RETURN d * 2.00;
-affected rows: 0
-SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
-db name type param_list body comment
-test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00
-test myfuncsql_int FUNCTION i INT RETURN i
-affected rows: 2
-"Running on the slave"
-SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
-db name type param_list body comment
-test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00
-test myfuncsql_int FUNCTION i INT RETURN i
-affected rows: 2
-"Running on the master"
-CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=MyISAM;
-affected rows: 0
-INSERT INTO t1 VALUES(myfuncsql_int(100), myfuncsql_double(50.00));
-affected rows: 1
-INSERT INTO t1 VALUES(myfuncsql_int(10), myfuncsql_double(5.00));
-affected rows: 1
-INSERT INTO t1 VALUES(myfuncsql_int(200), myfuncsql_double(25.00));
-affected rows: 1
-INSERT INTO t1 VALUES(myfuncsql_int(1), myfuncsql_double(500.00));
-affected rows: 1
-SELECT * FROM t1 ORDER BY sum;
-sum price
-1 1000
-10 10
-100 100
-200 50
-affected rows: 4
-"Running on the slave"
-SELECT * FROM t1 ORDER BY sum;
-sum price
-1 1000
-10 10
-100 100
-200 50
-affected rows: 4
-"Running on the master"
-ALTER FUNCTION myfuncsql_int COMMENT "This was altered.";
-affected rows: 0
-ALTER FUNCTION myfuncsql_double COMMENT "This was altered.";
-affected rows: 0
-SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
-db name type param_list body comment
-test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00 This was altered.
-test myfuncsql_int FUNCTION i INT RETURN i This was altered.
-affected rows: 2
-"Running on the slave"
-SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
-db name type param_list body comment
-test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00 This was altered.
-test myfuncsql_int FUNCTION i INT RETURN i This was altered.
-affected rows: 2
-SELECT myfuncsql_int(25);
-myfuncsql_int(25)
-25
-affected rows: 1
-SELECT myfuncsql_double(75.00);
-myfuncsql_double(75.00)
-150
-affected rows: 1
-"Running on the master"
-DROP FUNCTION myfuncsql_double;
-affected rows: 0
-DROP FUNCTION myfuncsql_int;
-affected rows: 0
-SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
-db name type param_list body comment
-affected rows: 0
-"Running on the slave"
-SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%';
-db name type param_list body comment
-affected rows: 0
-"Running on the master"
-DROP TABLE t1;
-affected rows: 0
diff --git a/mysql-test/r/rpl_user_variables.result b/mysql-test/r/rpl_user_variables.result
deleted file mode 100644
index 3b6002a5d2d..00000000000
--- a/mysql-test/r/rpl_user_variables.result
+++ /dev/null
@@ -1,257 +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;
-reset master;
-create table t1(n char(30));
-set @i1:=12345678901234, @i2:=-12345678901234, @i3:=0, @i4:=-1;
-set @s1:='This is a test', @r1:=12.5, @r2:=-12.5;
-set @n1:=null;
-set @s2:='', @s3:='abc\'def', @s4:= 'abc\\def', @s5:= 'abc''def';
-insert into t1 values (@i1), (@i2), (@i3), (@i4);
-insert into t1 values (@r1), (@r2);
-insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5);
-insert into t1 values (@n1);
-insert into t1 values (@n2);
-insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1);
-insert into t1 values (@a+(@b:=@a+1));
-set @q:='abc';
-insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2'));
-set @a:=5;
-insert into t1 values (@a),(@a);
-select * from t1 where n = '<nonexistant>';
-n
-insert into t1 values (@a),(@a),(@a*5);
-SELECT * FROM t1 ORDER BY n;
-n
-NULL
-NULL
-NULL
-NULL
-NULL
-
--1
--12.5
--12345678901234
-0
-0
-1
-12.5
-12345678901234
-2
-5
-5
-5
-abc
-abc'def
-abc'def
-abcn1
-abcn1n2
-abc\def
-This is a test
-SELECT * FROM t1 ORDER BY n;
-n
-NULL
-NULL
-NULL
-NULL
-NULL
-
--1
--12.5
--12345678901234
-0
-0
-1
-12.5
-12345678901234
-2
-5
-5
-5
-abc
-abc'def
-abc'def
-abcn1
-abcn1n2
-abc\def
-This is a test
-insert into t1 select * FROM (select @var1 union select @var2) AS t2;
-drop table t1;
-End of 4.1 tests.
-DROP TABLE IF EXISTS t20;
-DROP TABLE IF EXISTS t21;
-DROP PROCEDURE IF EXISTS test.insert;
-CREATE TABLE t20 (a VARCHAR(20));
-CREATE TABLE t21 (a VARCHAR(20));
-CREATE PROCEDURE test.insert()
-BEGIN
-IF (@VAR)
-THEN
-INSERT INTO test.t20 VALUES ('SP_TRUE');
-ELSE
-INSERT INTO test.t20 VALUES ('SP_FALSE');
-END IF;
-END|
-CREATE TRIGGER test.insert_bi BEFORE INSERT
-ON test.t20 FOR EACH ROW
-BEGIN
-IF (@VAR)
-THEN
-INSERT INTO test.t21 VALUES ('TRIG_TRUE');
-ELSE
-INSERT INTO test.t21 VALUES ('TRIG_FALSE');
-END IF;
-END|
-SET @VAR=0;
-CALL test.insert();
-SET @VAR=1;
-CALL test.insert();
-On master: Check the tables for correct data
-SELECT * FROM t20;
-a
-SP_FALSE
-SP_TRUE
-SELECT * FROM t21;
-a
-TRIG_FALSE
-TRIG_TRUE
-On slave: Check the tables for correct data and it matches master
-SELECT * FROM t20;
-a
-SP_FALSE
-SP_TRUE
-SELECT * FROM t21;
-a
-TRIG_FALSE
-TRIG_TRUE
-DROP TABLE t20;
-DROP TABLE t21;
-DROP PROCEDURE test.insert;
-DROP TABLE IF EXISTS t1;
-DROP FUNCTION IF EXISTS test.square;
-CREATE TABLE t1 (i INT);
-CREATE FUNCTION test.square() RETURNS INTEGER DETERMINISTIC RETURN
-(@var * @var);
-SET @var = 1;
-INSERT INTO t1 VALUES (square());
-SET @var = 2;
-INSERT INTO t1 VALUES (square());
-SET @var = 3;
-INSERT INTO t1 VALUES (square());
-SET @var = 4;
-INSERT INTO t1 VALUES (square());
-SET @var = 5;
-INSERT INTO t1 VALUES (square());
-On master: Retrieve the values from the table
-SELECT * FROM t1;
-i
-1
-4
-9
-16
-25
-On slave: Retrieve the values from the table and verify they are the same as on master
-SELECT * FROM t1;
-i
-1
-4
-9
-16
-25
-DROP TABLE t1;
-DROP FUNCTION test.square;
-DROP TABLE IF EXISTS t1;
-DROP FUNCTION IF EXISTS f1;
-DROP FUNCTION IF EXISTS f2;
-CREATE TABLE t1(a int);
-CREATE FUNCTION f1() returns int deterministic BEGIN
-return @a;
-END |
-CREATE FUNCTION f2() returns int deterministic BEGIN
-IF (@b > 0) then
-SET @c = (@a + @b);
-else
-SET @c = (@a - 1);
-END if;
-return @c;
-END |
-SET @a=500;
-INSERT INTO t1 values(f1());
-SET @b = 125;
-SET @c = 1;
-INSERT INTO t1 values(f2());
-On master: Retrieve the values from the table
-SELECT * from t1;
-a
-500
-625
-On slave: Check the tables for correct data and it matches master
-SELECT * from t1;
-a
-500
-625
-DROP TABLE t1;
-DROP FUNCTION f1;
-DROP FUNCTION f2;
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t2;
-CREATE TABLE t1 (i int);
-CREATE TABLE t2 (k int);
-CREATE trigger t1_bi before INSERT on t1 for each row BEGIN
-INSERT INTO t2 values (@a);
-SET @a:=42;
-INSERT INTO t2 values (@a);
-END |
-SET @a:=100;
-INSERT INTO t1 values (5);
-On master: Check to see that data was inserted correctly in both tables
-SELECT * from t1;
-i
-5
-SELECT * from t2;
-k
-100
-42
-On slave: Check the tables for correct data and it matches master
-SELECT * from t1;
-i
-5
-SELECT * from t2;
-k
-100
-42
-End of 5.0 tests.
-DROP TABLE t1;
-DROP TABLE t2;
-DROP TABLE IF EXISTS t1;
-DROP FUNCTION IF EXISTS f1;
-DROP FUNCTION IF EXISTS f2;
-CREATE TABLE t1 (i INT);
-CREATE FUNCTION f1() RETURNS INT RETURN @a;
-CREATE
-FUNCTION f2() RETURNS INT BEGIN
-INSERT INTO t1 VALUES (10 + @a);
-RETURN 0;
-END|
-SET @a:=123;
-SELECT f1(), f2();
-f1() f2()
-123 0
-On master: Check to see that data was inserted correctly
-INSERT INTO t1 VALUES(f1());
-SELECT * FROM t1;
-i
-133
-123
-On slave: Check the table for correct data and it matches master
-SELECT * FROM t1;
-i
-133
-123
-DROP FUNCTION f1;
-DROP FUNCTION f2;
-DROP TABLE t1;
-stop slave;
diff --git a/mysql-test/r/rpl_view.result b/mysql-test/r/rpl_view.result
deleted file mode 100644
index f5ddb9e13ba..00000000000
--- a/mysql-test/r/rpl_view.result
+++ /dev/null
@@ -1,98 +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;
-drop table if exists t1,v1;
-drop view if exists t1,v1;
-reset master;
-create table t1 (a int);
-insert into t1 values (1);
-create view v1 as select a from t1;
-insert into v1 values (2);
-select * from v1 order by a;
-a
-1
-2
-select * from v1 order by a;
-a
-1
-2
-update v1 set a=3 where a=1;
-select * from v1 order by a;
-a
-2
-3
-select * from v1 order by a;
-a
-2
-3
-delete from v1 where a=2;
-select * from v1 order by a;
-a
-3
-select * from v1 order by a;
-a
-3
-alter view v1 as select a as b from t1;
-select * from v1 order by 1;
-b
-3
-drop view v1;
-select * from v1 order by a;
-ERROR 42S02: Table 'test.v1' doesn't exist
-drop table t1;
-
----> Test for BUG#20438
-
----> Preparing environment...
----> connection: master
-DROP TABLE IF EXISTS t1;
-DROP VIEW IF EXISTS v1;
-
----> Synchronizing slave with master...
-
----> connection: master
-
----> Creating objects...
-CREATE TABLE t1(c INT);
-/*!50003 CREATE VIEW v1 AS SELECT * FROM t1 */;
-
----> Inserting value...
-INSERT INTO t1 VALUES(1);
-
----> Checking on master...
-SELECT * FROM t1;
-c
-1
-
----> Synchronizing slave with master...
----> connection: master
-
----> Checking on slave...
-SELECT * FROM t1;
-c
-1
-
----> connection: master
-
----> Cleaning up...
-DROP VIEW v1;
-DROP TABLE t1;
-create table t1(a int, b int);
-insert into t1 values (1, 1), (1, 2), (1, 3);
-create view v1(a, b) as select a, sum(b) from t1 group by a;
-explain v1;
-Field Type Null Key Default Extra
-a int(11) YES NULL
-b decimal(32,0) YES NULL
-show create table v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,sum(`t1`.`b`) AS `b` from `t1` group by `t1`.`a`
-select * from v1;
-a b
-1 6
-drop table t1;
-drop view v1;
-End of 5.0 tests
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index 1d6ef6fee5c..ed61cfffa6b 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -1430,8 +1430,8 @@ companynr companynr
41 40
explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary; Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where; Using join buffer
select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008;
fld1 companynr fld3 period
038008 37 reporters 1008
@@ -2362,16 +2362,16 @@ insert into t1 values (1,2), (2,2), (3,2), (4,2);
insert into t2 values (1,3), (2,3), (3,4), (4,4);
explain select * from t1 left join t2 on a=c where d in (4);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ref c,d d 5 const 2 Using where; Using join cache
-1 SIMPLE t1 ALL a NULL NULL NULL 4 Using where
+1 SIMPLE t2 ref c,d d 5 const 2 Using where
+1 SIMPLE t1 ALL a NULL NULL NULL 4 Using where; Using join buffer
select * from t1 left join t2 on a=c where d in (4);
a b c d
3 2 3 4
4 2 4 4
explain select * from t1 left join t2 on a=c where d = 4;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ref c,d d 5 const 2 Using where; Using join cache
-1 SIMPLE t1 ALL a NULL NULL NULL 4 Using where
+1 SIMPLE t2 ref c,d d 5 const 2 Using where
+1 SIMPLE t1 ALL a NULL NULL NULL 4 Using where; Using join buffer
select * from t1 left join t2 on a=c where d = 4;
a b c d
3 2 3 4
@@ -2716,8 +2716,8 @@ explain select straight_join DISTINCT t2.a,t2.b, t1.c from t1, t3, t2
where (t1.c=t2.a or (t1.c=t3.a and t2.a=t3.b)) and t1.b=556476786 and
t2.b like '%%' order by t2.b limit 0,1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref b,c b 5 const 1 Using where; Using temporary; Using filesort; Using join cache
-1 SIMPLE t3 index PRIMARY,a,b PRIMARY 8 NULL 2 Using index
+1 SIMPLE t1 ref b,c b 5 const 1 Using where; Using temporary; Using filesort
+1 SIMPLE t3 index PRIMARY,a,b PRIMARY 8 NULL 2 Using index; Using join buffer
1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 2 Range checked for each record (index map: 0x1)
DROP TABLE t1,t2,t3;
CREATE TABLE t1 (a int, INDEX idx(a));
@@ -2737,8 +2737,8 @@ INSERT INTO t2 VALUES (1,NULL), (2,10);
ALTER TABLE t1 ENABLE KEYS;
EXPLAIN SELECT STRAIGHT_JOIN SQL_NO_CACHE COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 index b b 5 NULL 2 Using index; Using join cache
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t2 index b b 5 NULL 2 Using index
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where; Using join buffer
SELECT STRAIGHT_JOIN SQL_NO_CACHE * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL;
a b a b
1 NULL 1 1
@@ -2747,8 +2747,8 @@ a b a b
2 10 4 10
EXPLAIN SELECT STRAIGHT_JOIN SQL_NO_CACHE COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 index b b 5 NULL 2 Using index; Using join cache
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t2 index b b 5 NULL 2 Using index
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where; Using join buffer
SELECT STRAIGHT_JOIN SQL_NO_CACHE * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL;
a b a b
1 NULL 1 1
@@ -2901,12 +2901,12 @@ a
4
EXPLAIN SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 5
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where; Using join buffer
EXPLAIN SELECT t1.a FROM t1 INNER JOIN t2 ON t1.a=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using join cache
-1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where; Using join buffer
DROP TABLE t1,t2;
select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0;
x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0
@@ -3492,7 +3492,7 @@ SELECT 0.9888889889 * 1.011111411911;
0.9998769417899202067879
prepare stmt from 'select 1 as " a "';
Warnings:
-Warning 1548 Leading spaces are removed from name ' a '
+Warning 1466 Leading spaces are removed from name ' a '
execute stmt;
a
1
@@ -3980,4 +3980,122 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE f1 index inx inx 10 NULL 7 Using where; Using index
1 SIMPLE f2 ref inx inx 5 test.f1.b 1 Using where; Using index
DROP TABLE t1;
+CREATE TABLE t1 (c1 INT, c2 INT);
+INSERT INTO t1 VALUES (1,11), (2,22), (2,22);
+EXPLAIN SELECT c1 FROM t1 WHERE (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT COUNT(c2)))))))))))))))))))))))))))))))) > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where
+31 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
+32 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
+EXPLAIN SELECT c1 FROM t1 WHERE (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT COUNT(c2))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) > 0;
+ERROR HY000: Too high level of nesting for select
+DROP TABLE t1;
+CREATE TABLE t1 (
+c1 int(11) NOT NULL AUTO_INCREMENT,
+c2 varchar(1000) DEFAULT NULL,
+c3 bigint(20) DEFAULT NULL,
+c4 bigint(20) DEFAULT NULL,
+PRIMARY KEY (c1)
+);
+EXPLAIN EXTENDED
+SELECT join_2.c1
+FROM
+t1 AS join_0,
+t1 AS join_1,
+t1 AS join_2,
+t1 AS join_3,
+t1 AS join_4,
+t1 AS join_5,
+t1 AS join_6,
+t1 AS join_7
+WHERE
+join_0.c1=join_1.c1 AND
+join_1.c1=join_2.c1 AND
+join_2.c1=join_3.c1 AND
+join_3.c1=join_4.c1 AND
+join_4.c1=join_5.c1 AND
+join_5.c1=join_6.c1 AND
+join_6.c1=join_7.c1
+OR
+join_0.c2 < '?' AND
+join_1.c2 < '?' AND
+join_2.c2 > '?' AND
+join_2.c2 < '!' AND
+join_3.c2 > '?' AND
+join_4.c2 = '?' AND
+join_5.c2 <> '?' AND
+join_6.c2 <> '?' AND
+join_7.c2 >= '?' AND
+join_0.c1=join_1.c1 AND
+join_1.c1=join_2.c1 AND
+join_2.c1=join_3.c1 AND
+join_3.c1=join_4.c1 AND
+join_4.c1=join_5.c1 AND
+join_5.c1=join_6.c1 AND
+join_6.c1=join_7.c1
+GROUP BY
+join_3.c1,
+join_2.c1,
+join_7.c1,
+join_1.c1,
+join_0.c1;
+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 '0' AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by '0','0','0','0','0'
+SHOW WARNINGS;
+Level Code Message
+Note 1003 select '0' AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by '0','0','0','0','0'
+DROP TABLE t1;
+SELECT 1 AS ` `;
+
+1
+Warnings:
+Warning 1474 Name ' ' has become ''
+SELECT 1 AS ` `;
+
+1
+Warnings:
+Warning 1474 Name ' ' has become ''
+SELECT 1 AS ` x`;
+x
+1
+Warnings:
+Warning 1466 Leading spaces are removed from name ' x'
+CREATE VIEW v1 AS SELECT 1 AS ` `;
+Warnings:
+Warning 1474 Name ' ' has become ''
+SELECT `` FROM v1;
+
+1
+CREATE VIEW v2 AS SELECT 1 AS ` `;
+Warnings:
+Warning 1474 Name ' ' has become ''
+SELECT `` FROM v2;
+
+1
+CREATE VIEW v3 AS SELECT 1 AS ` x`;
+Warnings:
+Warning 1466 Leading spaces are removed from name ' x'
+SELECT `x` FROM v3;
+x
+1
+DROP VIEW v1, v2, v3;
End of 5.0 tests
+create table t1(a INT, KEY (a));
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
+SELECT a FROM t1 ORDER BY a LIMIT 2;
+a
+1
+2
+SELECT a FROM t1 ORDER BY a LIMIT 2,4294967296;
+a
+3
+4
+5
+SELECT a FROM t1 ORDER BY a LIMIT 2,4294967297;
+a
+3
+4
+5
+DROP TABLE t1;
diff --git a/mysql-test/r/select_found.result b/mysql-test/r/select_found.result
index 7abd65beb46..7896f8a9f4e 100644
--- a/mysql-test/r/select_found.result
+++ b/mysql-test/r/select_found.result
@@ -84,7 +84,7 @@ UNIQUE KEY e_n (email,name)
EXPLAIN SELECT SQL_CALC_FOUND_ROWS DISTINCT email FROM t2 LEFT JOIN t1 ON kid = t2.id WHERE t1.id IS NULL LIMIT 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system PRIMARY,kid NULL NULL NULL 0 const row not found
-1 SIMPLE t2 index NULL e_n 104 NULL 200
+1 SIMPLE t2 index NULL e_n 104 NULL 10
SELECT SQL_CALC_FOUND_ROWS DISTINCT email FROM t2 LEFT JOIN t1 ON kid = t2.id WHERE t1.id IS NULL LIMIT 10;
email
email1
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index acab2f17910..04a5253e6a8 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -7,60 +7,157 @@ delete from mysql.db where user='mysqltest_1' || user='mysqltest_2' || user='mys
flush privileges;
create table t1 (a int not null primary key, b int not null,c int not null, key(b,c));
insert into t1 values (1,2,2),(2,2,3),(3,2,4),(4,2,4);
+-- Here we enable metadata just to check that the collation of the
+-- resultset is non-binary for string type. This should be changed
+-- after Bug#29394 is implemented.
check table t1 fast;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def Table 253 42 7 Y 0 31 8
+def Op 253 3 5 Y 0 31 8
+def Msg_type 253 3 6 Y 0 31 8
+def Msg_text 253 85 27 Y 0 31 8
Table Op Msg_type Msg_text
test.t1 check status Table is already up to date
check table t1 fast;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def Table 253 42 7 Y 0 31 8
+def Op 253 3 5 Y 0 31 8
+def Msg_type 253 3 6 Y 0 31 8
+def Msg_text 253 85 27 Y 0 31 8
Table Op Msg_type Msg_text
test.t1 check status Table is already up to date
check table t1 changed;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def Table 253 42 7 Y 0 31 8
+def Op 253 3 5 Y 0 31 8
+def Msg_type 253 3 6 Y 0 31 8
+def Msg_text 253 85 2 Y 0 31 8
Table Op Msg_type Msg_text
test.t1 check status OK
insert into t1 values (5,5,5);
check table t1 changed;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def Table 253 42 7 Y 0 31 8
+def Op 253 3 5 Y 0 31 8
+def Msg_type 253 3 6 Y 0 31 8
+def Msg_text 253 85 2 Y 0 31 8
Table Op Msg_type Msg_text
test.t1 check status OK
check table t1 medium;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def Table 253 42 7 Y 0 31 8
+def Op 253 3 5 Y 0 31 8
+def Msg_type 253 3 6 Y 0 31 8
+def Msg_text 253 85 2 Y 0 31 8
Table Op Msg_type Msg_text
test.t1 check status OK
check table t1 extended;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def Table 253 42 7 Y 0 31 8
+def Op 253 3 5 Y 0 31 8
+def Msg_type 253 3 6 Y 0 31 8
+def Msg_text 253 85 2 Y 0 31 8
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
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
t1 1 b 2 c A 5 NULL NULL BTREE
insert into t1 values (5,5,5);
ERROR 23000: Duplicate entry '5' for key 'PRIMARY'
+-- Here we enable metadata just to check that the collation of the
+-- resultset is non-binary for string type. This should be changed
+-- after Bug#29394 is implemented.
optimize table t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def Table 253 42 7 Y 0 31 8
+def Op 253 3 8 Y 0 31 8
+def Msg_type 253 3 6 Y 0 31 8
+def Msg_text 253 85 2 Y 0 31 8
Table Op Msg_type Msg_text
test.t1 optimize status OK
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize status Table is already up to date
drop table t1;
+-- Here we enable metadata just to check that the collation of the
+-- resultset is non-binary for string type. This should be changed
+-- 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 20480 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 20480 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 20480 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 64 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
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
Database
information_schema
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
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));
insert into t1 values (1,1,1,0),(1,1,2,0),(1,1,3,0),(1,2,1,0),(1,2,2,0),(1,2,3,0),(1,3,1,0),(1,3,2,0),(1,3,3,0),(1,1,1,1),(1,1,2,1),(1,1,3,1),(1,2,1,1),(1,2,2,1),(1,2,3,1),(1,3,1,1),(1,3,2,1),(1,3,3,1);
+-- Here we enable metadata just to check that the collation of the
+-- resultset is non-binary for string type. This should be changed
+-- after Bug#29394 is implemented.
analyze table t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def Table 253 42 7 Y 0 31 8
+def Op 253 3 7 Y 0 31 8
+def Msg_type 253 3 6 Y 0 31 8
+def Msg_text 253 85 2 Y 0 31 8
Table Op Msg_type Msg_text
test.t1 analyze status OK
show index from t1;
@@ -69,7 +166,15 @@ t1 0 PRIMARY 1 f1 A 1 NULL NULL BTREE
t1 0 PRIMARY 2 f2 A 3 NULL NULL BTREE
t1 0 PRIMARY 3 f3 A 9 NULL NULL BTREE
t1 0 PRIMARY 4 f4 A 18 NULL NULL BTREE
+-- Here we enable metadata just to check that the collation of the
+-- resultset is non-binary for string type. This should be changed
+-- after Bug#29394 is implemented.
repair table t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def Table 253 42 7 Y 0 31 8
+def Op 253 3 6 Y 0 31 8
+def Msg_type 253 3 6 Y 0 31 8
+def Msg_text 253 85 2 Y 0 31 8
Table Op Msg_type Msg_text
test.t1 repair status OK
show index from t1;
@@ -123,7 +228,7 @@ show full columns from t1;
Field Type Collation Null Key Default Extra Privileges Comment
test_set set('val1','val2','val3') latin1_swedish_ci NO select,insert,update,references
name char(20) latin1_swedish_ci YES O'Brien select,insert,update,references O'Brien as default
-c int(11) NULL NO select,insert,update,references int column
+c int(11) NULL NO NULL select,insert,update,references int column
c-b int(11) NULL YES NULL select,insert,update,references name with a minus
space 2 int(11) NULL YES NULL select,insert,update,references name with a space
drop table t1;
@@ -146,15 +251,13 @@ drop table t1;
flush tables;
show open tables;
Database Table In_use Name_locked
-mysql general_log 1 0
-mysql slow_log 1 0
+mysql general_log 0 0
create table t1(n int);
insert into t1 values (1);
show open tables;
Database Table In_use Name_locked
-mysql general_log 1 0
-mysql slow_log 1 0
test t1 0 0
+mysql general_log 0 0
drop table t1;
create table t1 (a int not null, b VARCHAR(10), INDEX (b) ) AVG_ROW_LENGTH=10 CHECKSUM=1 COMMENT="test" ENGINE=MYISAM MIN_ROWS=10 MAX_ROWS=100 PACK_KEYS=1 DELAY_KEY_WRITE=1 ROW_FORMAT=fixed;
show create table t1;
@@ -567,23 +670,21 @@ SELECT 1 FROM mysql.db, mysql.proc, mysql.user, mysql.time_zone, mysql.time_zone
1
SHOW OPEN TABLES;
Database Table In_use Name_locked
-mysql proc 0 0
+mysql db 0 0
test urkunde 0 0
mysql time_zone 0 0
-mysql db 0 0
+mysql general_log 0 0
test txt1 0 0
-mysql slow_log 1 0
+mysql proc 0 0
test tyt2 0 0
-mysql general_log 1 0
mysql user 0 0
mysql time_zone_name 0 0
SHOW OPEN TABLES FROM mysql;
Database Table In_use Name_locked
-mysql proc 0 0
-mysql time_zone 0 0
mysql db 0 0
-mysql slow_log 1 0
-mysql general_log 1 0
+mysql time_zone 0 0
+mysql general_log 0 0
+mysql proc 0 0
mysql user 0 0
mysql time_zone_name 0 0
SHOW OPEN TABLES FROM mysql LIKE 'u%';
@@ -597,16 +698,14 @@ test tyt2 0 0
mysql time_zone_name 0 0
SHOW OPEN TABLES LIKE '%o%';
Database Table In_use Name_locked
-mysql proc 0 0
mysql time_zone 0 0
-mysql slow_log 1 0
-mysql general_log 1 0
+mysql general_log 0 0
+mysql proc 0 0
mysql time_zone_name 0 0
FLUSH TABLES;
SHOW OPEN TABLES;
Database Table In_use Name_locked
-mysql general_log 1 0
-mysql slow_log 1 0
+mysql general_log 0 0
DROP TABLE txt1;
DROP TABLE tyt2;
DROP TABLE urkunde;
@@ -617,48 +716,48 @@ DROP VIEW IF EXISTS v1;
DROP PROCEDURE IF EXISTS p1;
CREATE VIEW v1 AS SELECT 1;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `1` binary binary
DROP VIEW v1;
CREATE VIEW v1 AS SELECT SQL_CACHE 1;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_cache 1 AS `1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_cache 1 AS `1` binary binary
DROP VIEW v1;
CREATE VIEW v1 AS SELECT SQL_NO_CACHE 1;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_no_cache 1 AS `1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_no_cache 1 AS `1` binary binary
DROP VIEW v1;
CREATE VIEW v1 AS SELECT NOW();
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select now() AS `NOW()`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select now() AS `NOW()` binary binary
DROP VIEW v1;
CREATE VIEW v1 AS SELECT SQL_CACHE NOW();
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_cache now() AS `NOW()`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_cache now() AS `NOW()` binary binary
DROP VIEW v1;
CREATE VIEW v1 AS SELECT SQL_NO_CACHE NOW();
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_no_cache now() AS `NOW()`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_no_cache now() AS `NOW()` binary binary
DROP VIEW v1;
CREATE VIEW v1 AS SELECT SQL_CACHE SQL_NO_CACHE NOW();
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_no_cache now() AS `NOW()`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_no_cache now() AS `NOW()` binary binary
DROP VIEW v1;
CREATE VIEW v1 AS SELECT SQL_NO_CACHE SQL_CACHE NOW();
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_no_cache now() AS `NOW()`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_no_cache now() AS `NOW()` binary binary
DROP VIEW v1;
CREATE VIEW v1 AS SELECT SQL_CACHE SQL_NO_CACHE SQL_CACHE NOW();
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_no_cache now() AS `NOW()`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_no_cache now() AS `NOW()` binary binary
DROP VIEW v1;
CREATE PROCEDURE p1()
BEGIN
@@ -669,8 +768,8 @@ DROP PREPARE stmt;
END |
CALL p1();
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_cache 1 AS `1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_cache 1 AS `1` binary binary
DROP PROCEDURE p1;
DROP VIEW v1;
SHOW TABLES FROM no_such_database;
@@ -685,14 +784,476 @@ show tables;
Tables_in_test
show status like 'slow_queries';
Variable_name Value
+Slow_queries 0
+select 1 from information_schema.tables limit 1;
+1
+1
+show status like 'slow_queries';
+Variable_name Value
Slow_queries 1
+create table t1 (a int);
+create trigger tr1 before insert on t1 for each row
+begin
+end;
+create view v1 as select a from t1;
+create procedure p1()
+begin
+end;
+create function f1()
+returns int
+return 0;
+create event e1 on schedule every 1 year starts now()
+ends date_add(now(), interval 5 hour) do
+begin
+end;
+flush status;
+show databases;
+show tables;
+show events;
+show table status;
+show open tables;
+show plugins;
+show columns in t1;
+show slave hosts;
+show keys in t1;
+show column types;
+show table types;
+show storage engines;
+show authors;
+show contributors;
+show privileges;
+show count(*) warnings;
+show count(*) errors;
+show warnings;
+show status;
+show processlist;
+show variables;
+show charset;
+show collation;
+show grants;
+show create database test;
+show create table t1;
+show create view v1;
+show master status;
+show slave status;
+show create procedure p1;
+show create function f1;
+show create trigger tr1;
+show procedure status;
+show create event e1;
+show status like 'slow_queries';
+Variable_name Value
+Slow_queries 0
+drop view v1;
+drop table t1;
+drop procedure p1;
+drop function f1;
+drop event e1;
+DROP DATABASE IF EXISTS mysqltest1;
+DROP TABLE IF EXISTS t1;
+DROP VIEW IF EXISTS v1;
+DROP PROCEDURE IF EXISTS p1;
+DROP FUNCTION IF EXISTS f1;
+CREATE DATABASE mysqltest1;
+CREATE TABLE t1(c INT NOT NULL PRIMARY KEY);
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1;
+CREATE VIEW v1 AS SELECT 1;
+CREATE PROCEDURE p1() SELECT 1;
+CREATE FUNCTION f1() RETURNS INT RETURN 1;
+set names utf8;
+-- Here we enable metadata just to check that the collation of the
+-- resultset is non-binary for string type. This should be changed
+-- after Bug#29394 is implemented.
+----------------------------------------------------------------
+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 192 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 192 15 N 1 0 33
+def 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 192 10 N 1 0 33
+def COLLATIONS CHARACTER_SET_NAME Charset 253 192 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
+Collation Charset Id Default Compiled Sortlen
+latin1_bin latin1 47 Yes 1
+----------------------------------------------------------------
+SHOW CREATE DATABASE mysqltest1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def Database 253 63 10 N 1 31 33
+def Create Database 253 1023 69 N 1 31 33
+Database Create Database
+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
+Database (mysqltest1)
+mysqltest1
+----------------------------------------------------------------
+SHOW CREATE TABLE t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def Table 253 63 2 N 1 31 33
+def Create Table 253 1023 102 N 1 31 33
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c` int(11) NOT NULL,
+ PRIMARY KEY (`c`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+----------------------------------------------------------------
+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
+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
+----------------------------------------------------------------
+SELECT
+TABLE_CATALOG,
+TABLE_SCHEMA,
+TABLE_NAME,
+TABLE_TYPE,
+ENGINE,
+ROW_FORMAT,
+TABLE_COLLATION,
+CREATE_OPTIONS,
+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 192 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
+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
+----------------------------------------------------------------
+SELECT
+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
+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 192 0 Y 0 0 33
+def COLUMNS COLLATION_NAME COLLATION_NAME 253 192 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 60 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
+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
+----------------------------------------------------------------
+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
+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 60 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 252 589815 0 N 17 0 33
+def TRIGGERS DEFINER Definer 252 589815 14 N 17 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
+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
+----------------------------------------------------------------
+SELECT
+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
+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 252 589815 0 N 17 0 33
+def TRIGGERS DEFINER DEFINER 252 589815 14 N 17 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
+----------------------------------------------------------------
+SHOW CREATE VIEW v1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def View 253 63 2 N 1 31 33
+def Create View 253 1023 103 N 1 31 33
+def character_set_client 253 30 6 N 1 31 33
+def collation_connection 253 30 6 N 1 31 33
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `1` binary binary
+----------------------------------------------------------------
+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 8 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
+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 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
+def Procedure 253 63 2 N 1 31 33
+def sql_mode 253 0 0 N 1 31 33
+def Create Procedure 253 1023 59 Y 0 31 33
+def character_set_client 253 30 6 N 1 31 33
+def collation_connection 253 30 6 N 1 31 33
+def Database Collation 253 30 17 N 1 31 33
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
+SELECT 1 binary binary latin1_swedish_ci
+----------------------------------------------------------------
+SELECT
+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
+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 252 589815 0 N 17 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
+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
+----------------------------------------------------------------
+SHOW CREATE FUNCTION f1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def Function 253 63 2 N 1 31 33
+def sql_mode 253 0 0 N 1 31 33
+def Create Function 253 1023 74 Y 0 31 33
+def character_set_client 253 30 6 N 1 31 33
+def collation_connection 253 30 6 N 1 31 33
+def Database Collation 253 30 17 N 1 31 33
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
+RETURN 1 binary binary latin1_swedish_ci
+----------------------------------------------------------------
+SELECT
+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
+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 252 589815 0 N 17 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
+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
+----------------------------------------------------------------
+DROP DATABASE mysqltest1;
+DROP TABLE t1;
+DROP VIEW v1;
+DROP PROCEDURE p1;
+DROP FUNCTION f1;
+set names koi8r;
+DROP DATABASE IF EXISTS mysqltest1;
+CREATE DATABASE mysqltest1;
+use mysqltest1;
+CREATE TABLE t1(ËÏÌÏÎËÁ1 INT);
+
+---> Dumping mysqltest1 to show_check.mysqltest1.sql
+
+
+DROP DATABASE mysqltest1;
+
+
+---> Restoring mysqltest1...
+SHOW CREATE TABLE mysqltest1.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `ËÏÌÏÎËÁ1` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP DATABASE mysqltest1;
+use test;
+flush status;
+show variables like "log_queries_not_using_indexes";
+Variable_name Value
+log_queries_not_using_indexes ON
+select 1 from information_schema.tables limit 1;
+1
+1
+show status like 'slow_queries';
+Variable_name Value
+Slow_queries 1
+set global log_queries_not_using_indexes=OFF;
+show variables like "log_queries_not_using_indexes";
+Variable_name Value
+log_queries_not_using_indexes OFF
+select 1 from information_schema.tables limit 1;
+1
+1
+show status like 'slow_queries';
+Variable_name Value
+Slow_queries 1
+set global log_queries_not_using_indexes=ON;
+show variables like "log_queries_not_using_indexes";
+Variable_name Value
+log_queries_not_using_indexes ON
select 1 from information_schema.tables limit 1;
1
1
show status like 'slow_queries';
Variable_name Value
Slow_queries 2
-End of 5.0 tests.
+show variables like 'myisam_recover_options';
+Variable_name Value
+myisam_recover_options OFF
+End of 5.0 tests
SHOW AUTHORS;
create database mysqltest;
show create database mysqltest;
@@ -712,7 +1273,7 @@ drop database mysqltest;
show full plugin;
show warnings;
Level Code Message
-Warning 1543 The syntax 'SHOW PLUGIN' is deprecated and will be removed in MySQL 5.2. Please use 'SHOW PLUGINS' instead
+Warning 1287 The syntax 'SHOW PLUGIN' is deprecated and will be removed in MySQL 5.2. Please use 'SHOW PLUGINS' instead
show plugin;
show plugins;
create database `mysqlttest\1`;
@@ -752,4 +1313,118 @@ Tables_in_test Table_type
été BASE TABLE
drop table `été`;
set names latin1;
+show columns from `#mysql50#????????`;
+Got one of the listed errors
+DROP TABLE IF EXISTS t1;
+DROP PROCEDURE IF EXISTS p1;
+CREATE TABLE t1(c1 INT);
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1;
+SHOW CREATE TRIGGER t1_bi;
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+CREATE PROCEDURE p1() SHOW CREATE TRIGGER t1_bi;
+CALL p1();
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+CALL p1();
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+CALL p1();
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+CALL p1();
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+CALL p1();
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+CALL p1();
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+CALL p1();
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+CALL p1();
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+CALL p1();
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+CALL p1();
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+PREPARE stmt1 FROM 'SHOW CREATE TRIGGER t1_bi';
+EXECUTE stmt1;
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+EXECUTE stmt1;
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+EXECUTE stmt1;
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+EXECUTE stmt1;
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+EXECUTE stmt1;
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+EXECUTE stmt1;
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+EXECUTE stmt1;
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+EXECUTE stmt1;
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+EXECUTE stmt1;
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+EXECUTE stmt1;
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+DROP TABLE t1;
+DROP PROCEDURE p1;
+DEALLOCATE PREPARE stmt1;
+set names koi8r;
+DROP VIEW IF EXISTS v1;
+DROP PROCEDURE IF EXISTS p1;
+DROP FUNCTION IF EXISTS f1;
+DROP TABLE IF EXISTS t1;
+DROP EVENT IF EXISTS ev1;
+CREATE VIEW v1 AS SELECT 'ÔÅÓÔ' AS test;
+CREATE PROCEDURE p1() SELECT 'ÔÅÓÔ' AS test;
+CREATE FUNCTION f1() RETURNS CHAR(10) RETURN 'ÔÅÓÔ';
+CREATE TABLE t1(c1 CHAR(10));
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1
+FOR EACH ROW
+SET NEW.c1 = 'ÔÅÓÔ';
+CREATE EVENT ev1 ON SCHEDULE AT '2030-01-01 00:00:00' DO SELECT 'ÔÅÓÔ' AS test;
+set names utf8;
+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 _koi8r'теÑÑ‚' AS `test` koi8r koi8r_general_ci
+SHOW CREATE PROCEDURE p1;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
+SELECT 'теÑÑ‚' AS test koi8r koi8r_general_ci latin1_swedish_ci
+SHOW CREATE FUNCTION f1;
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS char(10) CHARSET latin1
+RETURN 'теÑÑ‚' koi8r koi8r_general_ci latin1_swedish_ci
+SHOW CREATE TRIGGER t1_bi;
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1
+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
+DROP VIEW v1;
+DROP PROCEDURE p1;
+DROP FUNCTION f1;
+DROP TABLE t1;
+DROP EVENT ev1;
+SHOW TABLE TYPES;
End of 5.1 tests
diff --git a/mysql-test/r/skip_grants.result b/mysql-test/r/skip_grants.result
index 0961ffd734c..6bb8cbea2f1 100644
--- a/mysql-test/r/skip_grants.result
+++ b/mysql-test/r/skip_grants.result
@@ -35,16 +35,16 @@ SELECT 3;
CREATE DEFINER=a@'' FUNCTION f3() RETURNS INT
RETURN 3;
SHOW CREATE VIEW v3;
-View Create View
-v3 CREATE ALGORITHM=UNDEFINED DEFINER=`a`@`` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`c` AS `c` from `t1`
+View Create View character_set_client collation_connection
+v3 CREATE ALGORITHM=UNDEFINED DEFINER=`a`@`` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`c` AS `c` from `t1` latin1 latin1_swedish_ci
SHOW CREATE PROCEDURE p3;
-Procedure sql_mode Create Procedure
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
p3 CREATE DEFINER=`a`@`` PROCEDURE `p3`()
-SELECT 3
+SELECT 3 latin1 latin1_swedish_ci latin1_swedish_ci
SHOW CREATE FUNCTION f3;
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
f3 CREATE DEFINER=`a`@`` FUNCTION `f3`() RETURNS int(11)
-RETURN 3
+RETURN 3 latin1 latin1_swedish_ci latin1_swedish_ci
DROP TRIGGER t1_bi;
DROP TRIGGER ti_ai;
DROP TRIGGER ti_bu;
diff --git a/mysql-test/r/sp-code.result b/mysql-test/r/sp-code.result
index d56ad426585..b2bcfff0fdb 100644
--- a/mysql-test/r/sp-code.result
+++ b/mysql-test/r/sp-code.result
@@ -620,6 +620,119 @@ SHOW PROCEDURE CODE p1;
Pos Instruction
0 stmt 2 "CREATE INDEX idx ON t1 (c1)"
DROP PROCEDURE p1;
+drop table if exists t1;
+drop procedure if exists proc_26977_broken;
+drop procedure if exists proc_26977_works;
+create table t1(a int unique);
+create procedure proc_26977_broken(v int)
+begin
+declare i int default 5;
+declare continue handler for sqlexception
+begin
+select 'caught something';
+retry:
+while i > 0 do
+begin
+set i = i - 1;
+select 'looping', i;
+end;
+end while retry;
+end;
+select 'do something';
+insert into t1 values (v);
+select 'do something again';
+insert into t1 values (v);
+end//
+create procedure proc_26977_works(v int)
+begin
+declare i int default 5;
+declare continue handler for sqlexception
+begin
+select 'caught something';
+retry:
+while i > 0 do
+begin
+set i = i - 1;
+select 'looping', i;
+end;
+end while retry;
+select 'optimizer: keep hreturn';
+end;
+select 'do something';
+insert into t1 values (v);
+select 'do something again';
+insert into t1 values (v);
+end//
+show procedure code proc_26977_broken;
+Pos Instruction
+0 set i@1 5
+1 hpush_jump 8 2 CONTINUE
+2 stmt 0 "select 'caught something'"
+3 jump_if_not 7(7) (i@1 > 0)
+4 set i@1 (i@1 - 1)
+5 stmt 0 "select 'looping', i"
+6 jump 3
+7 hreturn 2
+8 stmt 0 "select 'do something'"
+9 stmt 5 "insert into t1 values (v)"
+10 stmt 0 "select 'do something again'"
+11 stmt 5 "insert into t1 values (v)"
+12 hpop 1
+show procedure code proc_26977_works;
+Pos Instruction
+0 set i@1 5
+1 hpush_jump 9 2 CONTINUE
+2 stmt 0 "select 'caught something'"
+3 jump_if_not 7(7) (i@1 > 0)
+4 set i@1 (i@1 - 1)
+5 stmt 0 "select 'looping', i"
+6 jump 3
+7 stmt 0 "select 'optimizer: keep hreturn'"
+8 hreturn 2
+9 stmt 0 "select 'do something'"
+10 stmt 5 "insert into t1 values (v)"
+11 stmt 0 "select 'do something again'"
+12 stmt 5 "insert into t1 values (v)"
+13 hpop 1
+call proc_26977_broken(1);
+do something
+do something
+do something again
+do something again
+caught something
+caught something
+looping i
+looping 4
+looping i
+looping 3
+looping i
+looping 2
+looping i
+looping 1
+looping i
+looping 0
+call proc_26977_works(2);
+do something
+do something
+do something again
+do something again
+caught something
+caught something
+looping i
+looping 4
+looping i
+looping 3
+looping i
+looping 2
+looping i
+looping 1
+looping i
+looping 0
+optimizer: keep hreturn
+optimizer: keep hreturn
+drop table t1;
+drop procedure proc_26977_broken;
+drop procedure proc_26977_works;
End of 5.0 tests.
CREATE PROCEDURE p1()
BEGIN
diff --git a/mysql-test/r/sp-destruct.result b/mysql-test/r/sp-destruct.result
index 4df8086c84e..ae294f05b25 100644
--- a/mysql-test/r/sp-destruct.result
+++ b/mysql-test/r/sp-destruct.result
@@ -37,26 +37,33 @@ insert into mysql.proc
(
db, name, type, specific_name, language, sql_data_access, is_deterministic,
security_type, param_list, returns, body, definer, created, modified,
-sql_mode, comment
+sql_mode, comment, character_set_client, collation_connection, db_collation,
+body_utf8
)
values
(
'test', 'bug14233_1', 'FUNCTION', 'bug14233_1', 'SQL', 'READS_SQL_DATA', 'NO',
'DEFINER', '', 'int(10)',
'select count(*) from mysql.user',
-'root@localhost', NOW() , '0000-00-00 00:00:00', '', ''
+'root@localhost', NOW() , '0000-00-00 00:00:00', '', '',
+'', '', '',
+'select count(*) from mysql.user'
),
(
'test', 'bug14233_2', 'FUNCTION', 'bug14233_2', 'SQL', 'READS_SQL_DATA', 'NO',
'DEFINER', '', 'int(10)',
'begin declare x int; select count(*) into x from mysql.user; end',
-'root@localhost', NOW() , '0000-00-00 00:00:00', '', ''
+'root@localhost', NOW() , '0000-00-00 00:00:00', '', '',
+'', '', '',
+'begin declare x int; select count(*) into x from mysql.user; end'
),
(
'test', 'bug14233_3', 'PROCEDURE', 'bug14233_3', 'SQL', 'READS_SQL_DATA','NO',
'DEFINER', '', '',
'alksj wpsj sa ^#!@ ',
-'root@localhost', NOW() , '0000-00-00 00:00:00', '', ''
+'root@localhost', NOW() , '0000-00-00 00:00:00', '', '',
+'', '', '',
+'alksj wpsj sa ^#!@ '
);
select bug14233_1();
ERROR HY000: Failed to load routine test.bug14233_1. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)
@@ -78,6 +85,6 @@ drop function bug14233_1;
drop function bug14233_2;
drop procedure bug14233_3;
show procedure status;
-Db Name Type Definer Modified Created Security_type Comment
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
show function status;
-Db Name Type Definer Modified Created Security_type Comment
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
diff --git a/mysql-test/r/sp-dynamic.result b/mysql-test/r/sp-dynamic.result
index f1c7e6076e5..34b76a9424f 100644
--- a/mysql-test/r/sp-dynamic.result
+++ b/mysql-test/r/sp-dynamic.result
@@ -87,6 +87,10 @@ prepare stmt from "create table t1 (a int)";
execute stmt;
insert into t1 (a) values (1);
select * from t1;
+prepare stmt_alter from "alter table t1 add (b int)";
+execute stmt_alter;
+insert into t1 (a,b) values (2,1);
+deallocate prepare stmt_alter;
deallocate prepare stmt;
deallocate prepare stmt_drop;
end|
@@ -245,6 +249,9 @@ a
1
drop procedure p1|
drop table if exists t1|
+drop table if exists t2|
+Warnings:
+Note 1051 Unknown table 't2'
create table t1 (id integer primary key auto_increment,
stmt_text char(35), status varchar(20))|
insert into t1 (stmt_text) values
@@ -255,7 +262,10 @@ insert into t1 (stmt_text) values
("help help"), ("show databases"), ("show tables"),
("show table status"), ("show open tables"), ("show storage engines"),
("insert into t1 (id) values (1)"), ("update t1 set status=''"),
-("delete from t1"), ("truncate t1"), ("call p1()"), ("foo bar")|
+("delete from t1"), ("truncate t1"), ("call p1()"), ("foo bar"),
+("create view v1 as select 1"), ("alter view v1 as select 2"),
+("drop view v1"),("create table t2 (a int)"),("alter table t2 add (b int)"),
+("drop table t2")|
create procedure p1()
begin
declare v_stmt_text varchar(255);
@@ -305,6 +315,12 @@ id stmt_text status
20 truncate t1 supported
21 call p1() supported
22 foo bar syntax error
+23 create view v1 as select 1 supported
+24 alter view v1 as select 2 not supported
+25 drop view v1 supported
+26 create table t2 (a int) supported
+27 alter table t2 add (b int) supported
+28 drop table t2 supported
drop procedure p1|
drop table t1|
prepare stmt from 'select 1'|
diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result
index 3dcdc46de2b..2e0d437aeb6 100644
--- a/mysql-test/r/sp-error.result
+++ b/mysql-test/r/sp-error.result
@@ -682,8 +682,8 @@ create procedure bug17015_012345678901234567890123456789012345678901234567890123
begin
end|
show procedure status like 'bug17015%'|
-Db Name Type Definer Modified Created Security_type Comment
-test bug17015_0123456789012345678901234567890123456789012345678901234 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test bug17015_0123456789012345678901234567890123456789012345678901234 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
drop procedure bug17015_0123456789012345678901234567890123456789012345678901234|
drop procedure if exists bug10969|
create procedure bug10969()
@@ -969,6 +969,18 @@ CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN create user 'mysqltest
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
CREATE FUNCTION bug_13627_f() returns int BEGIN create user 'mysqltest_1'; return 1; END |
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
+CREATE TRIGGER bug21975 BEFORE INSERT ON t1 FOR EACH ROW BEGIN grant select on t1 to 'mysqltest_1'; END |
+ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
+CREATE FUNCTION bug21975() returns int BEGIN grant select on t1 to 'mysqltest_1'; return 1; END |
+ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
+CREATE TRIGGER bug21975 BEFORE INSERT ON t1 FOR EACH ROW BEGIN revoke select on t1 from 'mysqltest_1'; END |
+ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
+CREATE FUNCTION bug21975() returns int BEGIN revoke select on t1 from 'mysqltest_1'; return 1; END |
+ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
+CREATE TRIGGER bug21975 BEFORE INSERT ON t1 FOR EACH ROW BEGIN revoke all privileges on *.* from 'mysqltest_1'; END |
+ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
+CREATE FUNCTION bug21975() returns int BEGIN revoke all privileges on *.* from 'mysqltest_1'; return 1; END |
+ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN drop user 'mysqltest_1'; END |
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
CREATE FUNCTION bug_13627_f() returns int BEGIN drop user 'mysqltest_1'; return 1; END |
@@ -982,9 +994,9 @@ ERROR HY000: Explicit or implicit commit is not allowed in stored function or tr
CREATE FUNCTION bug_13627_f() returns int BEGIN create view v1 as select 1; return 1; END |
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN alter view v1 as select 1; END |
-ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
+ERROR 0A000: ALTER VIEW is not allowed in stored procedures
CREATE FUNCTION bug_13627_f() returns int BEGIN alter view v1 as select 1; return 1; END |
-ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
+ERROR 0A000: ALTER VIEW is not allowed in stored procedures
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN drop view v1; END |
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
CREATE FUNCTION bug_13627_f() returns int BEGIN drop view v1; return 1; END |
@@ -1030,7 +1042,7 @@ select bug12329();
bug12329()
101
execute stmt1;
-ERROR HY000: Table 't2' was not locked with LOCK TABLES
+ERROR 42S02: Table 'test.t2' doesn't exist
deallocate prepare stmt1;
drop function bug12329;
drop table t1, t2;
@@ -1087,8 +1099,8 @@ create procedure p2() select version();
ERROR 3D000: No database selected
use mysqltest2;
show procedure status;
-Db Name Type Definer Modified Created Security_type Comment
-mysqltest2 p1 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+mysqltest2 p1 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
drop database mysqltest2;
use test;
DROP FUNCTION IF EXISTS bug13012|
@@ -1152,12 +1164,12 @@ create trigger t1_ai after insert on t1 for each row insert into t2 values (new.
create view v1 as select * from t1;
drop table t2;
insert into v1 values (1);
-ERROR HY000: Table 't2' was not locked with LOCK TABLES
+ERROR 42S02: Table 'test.t2' doesn't exist
drop trigger t1_ai;
create function bug11555_1() returns int return (select max(i) from t2);
create trigger t1_ai after insert on t1 for each row set @a:=bug11555_1();
insert into v1 values (2);
-ERROR HY000: Table 't2' was not locked with LOCK TABLES
+ERROR 42S02: Table 'test.t2' doesn't exist
drop function bug11555_1;
drop table t1;
drop view v1;
@@ -1177,8 +1189,8 @@ call ` bug15658`();
1
1
show procedure status;
-Db Name Type Definer Modified Created Security_type Comment
-test bug15658 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test bug15658 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
drop procedure ` bug15658`;
drop function if exists bug14270;
drop table if exists t1;
diff --git a/mysql-test/r/sp-prelocking.result b/mysql-test/r/sp-prelocking.result
index 7d8dd862748..186b2c05d34 100644
--- a/mysql-test/r/sp-prelocking.result
+++ b/mysql-test/r/sp-prelocking.result
@@ -254,4 +254,69 @@ execute stmt;
deallocate prepare stmt;
drop function bug19634;
drop table t1, t2, t3;
+drop table if exists bug_27907_logs;
+drop table if exists bug_27907_t1;
+create table bug_27907_logs (a int);
+create table bug_27907_t1 (a int);
+create trigger bug_27907_t1_ai after insert on bug_27907_t1
+for each row
+begin
+insert into bug_27907_logs (a) values (1);
+end|
+drop table bug_27907_logs;
+insert into bug_27907_t1(a) values (1);
+ERROR 42S02: Table 'test.bug_27907_logs' doesn't exist
+drop table bug_27907_t1;
+
+Bug#22427 create table if not exists + stored function results in
+inconsistent behavior
+
+Add a test case, the bug itself was fixed by the patch for
+Bug#20662
+
+drop table if exists t1;
+drop function if exists f_bug22427;
+create table t1 (i int);
+insert into t1 values (1);
+create function f_bug22427() returns int return (select max(i) from t1);
+select f_bug22427();
+f_bug22427()
+1
+create table if not exists t1 select f_bug22427() as i;
+Warnings:
+Note 1050 Table 't1' already exists
+create table t1 select f_bug22427() as i;
+ERROR 42S01: Table 't1' already exists
+drop table t1;
+drop function f_bug22427;
+#
+# Bug #29929 LOCK TABLES does not pre-lock tables used in triggers of the locked tables
+#
+DROP table IF EXISTS t1,t2;
+CREATE TABLE t1 (c1 INT);
+CREATE TABLE t2 (c2 INT);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (2);
+CREATE TRIGGER t1_ai AFTER INSERT ON t1 FOR EACH ROW
+BEGIN
+UPDATE t2 SET c2= c2 + 1;
+END//
+# Take a table lock on t1.
+# This should pre-lock t2 through the trigger.
+LOCK TABLE t1 WRITE;
+INSERT INTO t1 VALUES (3);
+UNLOCK TABLES;
+LOCK TABLE t1 READ;
+INSERT INTO t2 values(4);
+ERROR HY000: Table 't2' was not locked with LOCK TABLES
+UNLOCK TABLES;
+SELECT * FROM t1;
+c1
+1
+3
+SELECT * FROM t2;
+c2
+3
+DROP TRIGGER t1_ai;
+DROP TABLE t1, t2;
End of 5.0 tests
diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result
index 7315ef40083..1a1645ca971 100644
--- a/mysql-test/r/sp-security.result
+++ b/mysql-test/r/sp-security.result
@@ -12,8 +12,8 @@ insert into t1 values('test', 0);
create procedure stamp(i int)
insert into db1_secret.t1 values (user(), i);
show procedure status like 'stamp';
-Db Name Type Definer Modified Created Security_type Comment
-db1_secret stamp PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+db1_secret stamp PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
create function db() returns varchar(64)
begin
declare v varchar(64);
@@ -21,8 +21,8 @@ select u into v from t1 limit 1;
return v;
end|
show function status like 'db';
-Db Name Type Definer Modified Created Security_type Comment
-db1_secret db FUNCTION root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+db1_secret db FUNCTION root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
call stamp(1);
select * from t1;
u i
@@ -71,12 +71,12 @@ user1@localhost 2
anon@localhost 3
alter procedure stamp sql security invoker;
show procedure status like 'stamp';
-Db Name Type Definer Modified Created Security_type Comment
-db1_secret stamp PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 INVOKER
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+db1_secret stamp PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 INVOKER latin1 latin1_swedish_ci latin1_swedish_ci
alter function db sql security invoker;
show function status like 'db';
-Db Name Type Definer Modified Created Security_type Comment
-db1_secret db FUNCTION root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 INVOKER
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+db1_secret db FUNCTION root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 INVOKER latin1 latin1_swedish_ci latin1_swedish_ci
call stamp(4);
select * from t1;
u i
@@ -365,21 +365,21 @@ Note 1449 There is no 'a @ b @ c'@'localhost' registered
---> connection: con1root
use mysqltest;
SHOW CREATE PROCEDURE wl2897_p1;
-Procedure sql_mode Create Procedure
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
wl2897_p1 CREATE DEFINER=`mysqltest_2`@`localhost` PROCEDURE `wl2897_p1`()
-SELECT 1
+SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
SHOW CREATE PROCEDURE wl2897_p3;
-Procedure sql_mode Create Procedure
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
wl2897_p3 CREATE DEFINER=`a @ b @ c`@`localhost` PROCEDURE `wl2897_p3`()
-SELECT 3
+SELECT 3 latin1 latin1_swedish_ci latin1_swedish_ci
SHOW CREATE FUNCTION wl2897_f1;
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
wl2897_f1 CREATE DEFINER=`mysqltest_2`@`localhost` FUNCTION `wl2897_f1`() RETURNS int(11)
-RETURN 1
+RETURN 1 latin1 latin1_swedish_ci latin1_swedish_ci
SHOW CREATE FUNCTION wl2897_f3;
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
wl2897_f3 CREATE DEFINER=`a @ b @ c`@`localhost` FUNCTION `wl2897_f3`() RETURNS int(11)
-RETURN 3
+RETURN 3 latin1 latin1_swedish_ci latin1_swedish_ci
DROP USER mysqltest_1@localhost;
DROP USER mysqltest_2@localhost;
DROP DATABASE mysqltest;
@@ -443,14 +443,14 @@ SET a=1;
SELECT a;
END //
SHOW CREATE PROCEDURE test.sp19857;
-Procedure sql_mode Create Procedure
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
sp19857 CREATE DEFINER=`user19857`@`localhost` PROCEDURE `sp19857`()
DETERMINISTIC
BEGIN
DECLARE a INT;
SET a=1;
SELECT a;
-END
+END latin1 latin1_swedish_ci latin1_swedish_ci
DROP PROCEDURE IF EXISTS test.sp19857;
---> connection: root
diff --git a/mysql-test/r/sp-vars.result b/mysql-test/r/sp-vars.result
index 968bb75309b..f5420a62f63 100644
--- a/mysql-test/r/sp-vars.result
+++ b/mysql-test/r/sp-vars.result
@@ -1161,3 +1161,70 @@ CALL p1();
v_text
abc|def
DROP PROCEDURE p1;
+DROP PROCEDURE IF EXISTS bug27415_text_test|
+DROP PROCEDURE IF EXISTS bug27415_text_test2|
+CREATE PROCEDURE bug27415_text_test(entity_id_str_in text)
+BEGIN
+DECLARE str_remainder text;
+SET str_remainder = entity_id_str_in;
+select 'before substr', str_remainder;
+SET str_remainder = SUBSTRING(str_remainder, 3);
+select 'after substr', str_remainder;
+END|
+CREATE PROCEDURE bug27415_text_test2(entity_id_str_in text)
+BEGIN
+DECLARE str_remainder text;
+DECLARE str_remainder2 text;
+SET str_remainder2 = entity_id_str_in;
+select 'before substr', str_remainder2;
+SET str_remainder = SUBSTRING(str_remainder2, 3);
+select 'after substr', str_remainder;
+END|
+CALL bug27415_text_test('a,b,c')|
+before substr str_remainder
+before substr a,b,c
+after substr str_remainder
+after substr b,c
+CALL bug27415_text_test('a,b,c')|
+before substr str_remainder
+before substr a,b,c
+after substr str_remainder
+after substr b,c
+CALL bug27415_text_test2('a,b,c')|
+before substr str_remainder2
+before substr a,b,c
+after substr str_remainder
+after substr b,c
+CALL bug27415_text_test('a,b,c')|
+before substr str_remainder
+before substr a,b,c
+after substr str_remainder
+after substr b,c
+DROP PROCEDURE bug27415_text_test|
+DROP PROCEDURE bug27415_text_test2|
+drop function if exists f1;
+drop table if exists t1;
+create function f1() returns int
+begin
+if @a=1 then set @b='abc';
+else set @b=1;
+end if;
+set @a=1;
+return 0;
+end|
+create table t1 (a int)|
+insert into t1 (a) values (1), (2)|
+set @b=1|
+set @a=0|
+select f1(), @b from t1|
+f1() @b
+0 1
+0 0
+set @b:='test'|
+set @a=0|
+select f1(), @b from t1|
+f1() @b
+0 1
+0 abc
+drop function f1;
+drop table t1;
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index e3406e4bbde..55b27b0a733 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -1,5 +1,10 @@
use test;
drop table if exists t1,t2,t3,t4;
+drop view if exists v1;
+drop procedure if exists p1;
+drop procedure if exists p2;
+drop function if exists f1;
+drop function if exists f2;
create table t1 (
id char(16) not null default '',
data int not null
@@ -787,11 +792,11 @@ sql security definer
comment 'Characteristics procedure test'
insert into t1 values ("chistics", 1)|
show create procedure chistics|
-Procedure sql_mode Create Procedure
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
chistics CREATE DEFINER=`root`@`localhost` PROCEDURE `chistics`()
MODIFIES SQL DATA
COMMENT 'Characteristics procedure test'
-insert into t1 values ("chistics", 1)
+insert into t1 values ("chistics", 1) latin1 latin1_swedish_ci latin1_swedish_ci
call chistics()|
select * from t1|
id data
@@ -799,12 +804,12 @@ chistics 1
delete from t1|
alter procedure chistics sql security invoker|
show create procedure chistics|
-Procedure sql_mode Create Procedure
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
chistics CREATE DEFINER=`root`@`localhost` PROCEDURE `chistics`()
MODIFIES SQL DATA
SQL SECURITY INVOKER
COMMENT 'Characteristics procedure test'
-insert into t1 values ("chistics", 1)
+insert into t1 values ("chistics", 1) latin1 latin1_swedish_ci latin1_swedish_ci
drop procedure chistics|
drop function if exists chistics|
create function chistics() returns int
@@ -814,12 +819,12 @@ sql security invoker
comment 'Characteristics procedure test'
return 42|
show create function chistics|
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
chistics CREATE DEFINER=`root`@`localhost` FUNCTION `chistics`() RETURNS int(11)
DETERMINISTIC
SQL SECURITY INVOKER
COMMENT 'Characteristics procedure test'
-return 42
+return 42 latin1 latin1_swedish_ci latin1_swedish_ci
select chistics()|
chistics()
42
@@ -827,13 +832,13 @@ alter function chistics
no sql
comment 'Characteristics function test'|
show create function chistics|
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
chistics CREATE DEFINER=`root`@`localhost` FUNCTION `chistics`() RETURNS int(11)
NO SQL
DETERMINISTIC
SQL SECURITY INVOKER
COMMENT 'Characteristics function test'
-return 42
+return 42 latin1 latin1_swedish_ci latin1_swedish_ci
drop function chistics|
insert into t1 values ("foo", 1), ("bar", 2), ("zip", 3)|
set @@sql_mode = 'ANSI'|
@@ -1223,12 +1228,12 @@ n f
20 2432902008176640000
drop table t3|
show function status like '%f%'|
-Db Name Type Definer Modified Created Security_type Comment
-test fac FUNCTION root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test fac FUNCTION root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
drop procedure ifac|
drop function fac|
show function status like '%f%'|
-Db Name Type Definer Modified Created Security_type Comment
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
drop table if exists t3|
create table t3 (
i int unsigned not null primary key,
@@ -1290,7 +1295,7 @@ end;
end while;
end|
show create procedure opp|
-Procedure sql_mode Create Procedure
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
opp CREATE DEFINER=`root`@`localhost` PROCEDURE `opp`(n bigint unsigned, out pp bool)
begin
declare r double;
@@ -1316,11 +1321,11 @@ set s = s+1;
end;
end if;
end loop;
-end
+end latin1 latin1_swedish_ci latin1_swedish_ci
show procedure status like '%p%'|
-Db Name Type Definer Modified Created Security_type Comment
-test ip PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER
-test opp PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test ip PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+test opp PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
call ip(200)|
select * from t3 where i=45 or i=100 or i=199|
i p
@@ -1331,7 +1336,7 @@ drop table t3|
drop procedure opp|
drop procedure ip|
show procedure status like '%p%'|
-Db Name Type Definer Modified Created Security_type Comment
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
drop table if exists t3|
create table t3 ( f bigint unsigned not null )|
drop procedure if exists fib|
@@ -1383,19 +1388,19 @@ create procedure bar(x char(16), y int)
comment "111111111111" sql security invoker
insert into test.t1 values (x, y)|
show procedure status like 'bar'|
-Db Name Type Definer Modified Created Security_type Comment
-test bar PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 INVOKER 111111111111
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test bar PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 INVOKER 111111111111 latin1 latin1_swedish_ci latin1_swedish_ci
alter procedure bar comment "2222222222" sql security definer|
alter procedure bar comment "3333333333"|
alter procedure bar|
show create procedure bar|
-Procedure sql_mode Create Procedure
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
bar CREATE DEFINER=`root`@`localhost` PROCEDURE `bar`(x char(16), y int)
COMMENT '3333333333'
-insert into test.t1 values (x, y)
+insert into test.t1 values (x, y) latin1 latin1_swedish_ci latin1_swedish_ci
show procedure status like 'bar'|
-Db Name Type Definer Modified Created Security_type Comment
-test bar PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER 3333333333
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test bar PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER 3333333333 latin1 latin1_swedish_ci latin1_swedish_ci
drop procedure bar|
drop procedure if exists p1|
create procedure p1 ()
@@ -1497,10 +1502,10 @@ insert into t3 (a) values (1)|
create procedure h_ee()
deterministic
begin
-declare continue handler for 1582 -- ER_DUP_ENTRY_WITH_KEY_NAME
+declare continue handler for 1062 -- ER_DUP_ENTRY
select 'Outer (bad)' as 'h_ee';
begin
-declare continue handler for 1582 -- ER_DUP_ENTRY_WITH_KEY_NAME
+declare continue handler for 1062 -- ER_DUP_ENTRY
select 'Inner (good)' as 'h_ee';
insert into t3 values (1);
end;
@@ -1508,7 +1513,7 @@ end|
create procedure h_es()
deterministic
begin
-declare continue handler for 1582 -- ER_DUP_ENTRY_WITH_KEY_NAME
+declare continue handler for 1062 -- ER_DUP_ENTRY
select 'Outer (good)' as 'h_es';
begin
-- integrity constraint violation
@@ -1545,7 +1550,7 @@ end|
create procedure h_ex()
deterministic
begin
-declare continue handler for 1582 -- ER_DUP_ENTRY_WITH_KEY_NAME
+declare continue handler for 1062 -- ER_DUP_ENTRY
select 'Outer (good)' as 'h_ex';
begin
declare continue handler for sqlexception
@@ -1560,7 +1565,7 @@ begin
declare continue handler for sqlstate '23000'
select 'Outer (bad)' as 'h_se';
begin
-declare continue handler for 1582 -- ER_DUP_ENTRY_WITH_KEY_NAME
+declare continue handler for 1062 -- ER_DUP_ENTRY
select 'Inner (good)' as 'h_se';
insert into t3 values (1);
end;
@@ -1700,7 +1705,7 @@ begin
declare continue handler for sqlexception
select 'Outer (bad)' as 'h_xe';
begin
-declare continue handler for 1582 -- ER_DUP_ENTRY_WITH_KEY_NAME
+declare continue handler for 1062 -- ER_DUP_ENTRY
select 'Inner (good)' as 'h_xe';
insert into t3 values (1);
end;
@@ -1960,24 +1965,24 @@ show create function bug2267_4;
end|
create function bug2267_4() returns int return 100|
call bug2267_1()|
-Db Name Type Definer Modified Created Security_type Comment
-test bug2267_1 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER
-test bug2267_2 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER
-test bug2267_3 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER
-test bug2267_4 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test bug2267_1 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+test bug2267_2 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+test bug2267_3 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+test bug2267_4 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
call bug2267_2()|
-Db Name Type Definer Modified Created Security_type Comment
-test bug2267_4 FUNCTION root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test bug2267_4 FUNCTION root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
call bug2267_3()|
-Procedure sql_mode Create Procedure
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
bug2267_1 CREATE DEFINER=`root`@`localhost` PROCEDURE `bug2267_1`()
begin
show procedure status;
-end
+end latin1 latin1_swedish_ci latin1_swedish_ci
call bug2267_4()|
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
bug2267_4 CREATE DEFINER=`root`@`localhost` FUNCTION `bug2267_4`() RETURNS int(11)
-return 100
+return 100 latin1 latin1_swedish_ci latin1_swedish_ci
drop procedure bug2267_1|
drop procedure bug2267_2|
drop procedure bug2267_3|
@@ -2308,22 +2313,22 @@ create function bug2564_4(x int, y int) returns int
return x || y$
set @@sql_mode = ''|
show create procedure bug2564_1|
-Procedure sql_mode Create Procedure
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
bug2564_1 CREATE DEFINER=`root`@`localhost` PROCEDURE `bug2564_1`()
COMMENT 'Joe''s procedure'
-insert into `t1` values ("foo", 1)
+insert into `t1` values ("foo", 1) latin1 latin1_swedish_ci latin1_swedish_ci
show create procedure bug2564_2|
-Procedure sql_mode Create Procedure
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
bug2564_2 ANSI_QUOTES CREATE DEFINER="root"@"localhost" PROCEDURE "bug2564_2"()
-insert into "t1" values ('foo', 1)
+insert into "t1" values ('foo', 1) latin1 latin1_swedish_ci latin1_swedish_ci
show create function bug2564_3|
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
bug2564_3 CREATE DEFINER=`root`@`localhost` FUNCTION `bug2564_3`(x int, y int) RETURNS int(11)
-return x || y
+return x || y latin1 latin1_swedish_ci latin1_swedish_ci
show create function bug2564_4|
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
bug2564_4 REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI CREATE DEFINER="root"@"localhost" FUNCTION "bug2564_4"(x int, y int) RETURNS int(11)
-return x || y
+return x || y latin1 latin1_swedish_ci latin1_swedish_ci
drop procedure bug2564_1|
drop procedure bug2564_2|
drop function bug2564_3|
@@ -2464,7 +2469,7 @@ Database (foo)
Level Code Message
Field Type Null Key Default Extra
id char(16) NO
-data int(11) NO
+data int(11) NO NULL
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
Database Table In_use Name_locked
Privilege Context Comment
@@ -2518,7 +2523,7 @@ Database (foo)
Level Code Message
Field Type Null Key Default Extra
id char(16) NO
-data int(11) NO
+data int(11) NO NULL
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
Database Table In_use Name_locked
Privilege Context Comment
@@ -3999,11 +4004,11 @@ main_loop: begin
return 42;
end */;;
show create function bug14723;;
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
bug14723 CREATE DEFINER=`root`@`localhost` FUNCTION `bug14723`() RETURNS bigint(20)
main_loop: begin
return 42;
-end
+end latin1 latin1_swedish_ci latin1_swedish_ci
select bug14723();;
bug14723()
42
@@ -4012,11 +4017,11 @@ main_loop: begin
select 42;
end */;;
show create procedure bug14723;;
-Procedure sql_mode Create Procedure
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
bug14723 CREATE DEFINER=`root`@`localhost` PROCEDURE `bug14723`()
main_loop: begin
select 42;
-end
+end latin1 latin1_swedish_ci latin1_swedish_ci
call bug14723();;
42
42
@@ -4404,8 +4409,10 @@ call bug13012()|
Table Op Msg_type Msg_text
test.t1 repair status OK
Table Op Msg_type Msg_text
+test.t1 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
test.t1 backup status OK
Table Op Msg_type Msg_text
+test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
test.t1 restore status OK
drop procedure bug13012|
create view v1 as select * from t1|
@@ -4420,61 +4427,58 @@ Table Op Msg_type Msg_text
test.t1 repair status OK
test.t2 repair status OK
test.t3 repair status OK
-test.v1 repair error 'test.v1' is not BASE TABLE
+test.v1 repair Error 'test.v1' is not BASE TABLE
+test.v1 repair error Corrupt
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t2 optimize status OK
test.t3 optimize status OK
-test.v1 optimize error 'test.v1' is not BASE TABLE
+test.v1 optimize Error 'test.v1' is not BASE TABLE
+test.v1 optimize error Corrupt
Table Op Msg_type Msg_text
test.t1 analyze status Table is already up to date
test.t2 analyze status Table is already up to date
test.t3 analyze status Table is already up to date
-test.v1 analyze error 'test.v1' is not BASE TABLE
-Warnings:
-Error 1347 'test.v1' is not BASE TABLE
-Error 1347 'test.v1' is not BASE TABLE
-Error 1347 'test.v1' is not BASE TABLE
+test.v1 analyze Error 'test.v1' is not BASE TABLE
+test.v1 analyze error Corrupt
call bug13012()|
Table Op Msg_type Msg_text
test.t1 repair status OK
test.t2 repair status OK
test.t3 repair status OK
-test.v1 repair error 'test.v1' is not BASE TABLE
+test.v1 repair Error 'test.v1' is not BASE TABLE
+test.v1 repair error Corrupt
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t2 optimize status OK
test.t3 optimize status OK
-test.v1 optimize error 'test.v1' is not BASE TABLE
+test.v1 optimize Error 'test.v1' is not BASE TABLE
+test.v1 optimize error Corrupt
Table Op Msg_type Msg_text
test.t1 analyze status Table is already up to date
test.t2 analyze status Table is already up to date
test.t3 analyze status Table is already up to date
-test.v1 analyze error 'test.v1' is not BASE TABLE
-Warnings:
-Error 1347 'test.v1' is not BASE TABLE
-Error 1347 'test.v1' is not BASE TABLE
-Error 1347 'test.v1' is not BASE TABLE
+test.v1 analyze Error 'test.v1' is not BASE TABLE
+test.v1 analyze error Corrupt
call bug13012()|
Table Op Msg_type Msg_text
test.t1 repair status OK
test.t2 repair status OK
test.t3 repair status OK
-test.v1 repair error 'test.v1' is not BASE TABLE
+test.v1 repair Error 'test.v1' is not BASE TABLE
+test.v1 repair error Corrupt
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t2 optimize status OK
test.t3 optimize status OK
-test.v1 optimize error 'test.v1' is not BASE TABLE
+test.v1 optimize Error 'test.v1' is not BASE TABLE
+test.v1 optimize error Corrupt
Table Op Msg_type Msg_text
test.t1 analyze status Table is already up to date
test.t2 analyze status Table is already up to date
test.t3 analyze status Table is already up to date
-test.v1 analyze error 'test.v1' is not BASE TABLE
-Warnings:
-Error 1347 'test.v1' is not BASE TABLE
-Error 1347 'test.v1' is not BASE TABLE
-Error 1347 'test.v1' is not BASE TABLE
+test.v1 analyze Error 'test.v1' is not BASE TABLE
+test.v1 analyze error Corrupt
drop procedure bug13012|
drop view v1|
select * from t1 order by data|
@@ -4705,10 +4709,10 @@ insert into t3 values (1)|
create procedure bug15011()
deterministic
begin
-declare continue handler for 1582
+declare continue handler for 1062
select 'Outer' as 'Handler';
begin
-declare continue handler for 1582
+declare continue handler for 1062
select 'Inner' as 'Handler';
insert into t3 values (1);
end;
@@ -4910,7 +4914,7 @@ create table t3 as select * from v1|
show create table t3|
Table Create Table
t3 CREATE TABLE `t3` (
- `j` int(11) DEFAULT NULL
+ `j` bigint(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t3|
j
@@ -5072,21 +5076,21 @@ RETURN ""|
CREATE FUNCTION mysqltest2.bug16211_f4() RETURNS CHAR(10) CHARSET koi8r
RETURN ""|
SHOW CREATE FUNCTION bug16211_f1|
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
bug16211_f1 CREATE DEFINER=`root`@`localhost` FUNCTION `bug16211_f1`() RETURNS char(10) CHARSET utf8
-RETURN ""
+RETURN "" latin1 latin1_swedish_ci utf8_general_ci
SHOW CREATE FUNCTION bug16211_f2|
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
bug16211_f2 CREATE DEFINER=`root`@`localhost` FUNCTION `bug16211_f2`() RETURNS char(10) CHARSET koi8r
-RETURN ""
+RETURN "" latin1 latin1_swedish_ci utf8_general_ci
SHOW CREATE FUNCTION mysqltest2.bug16211_f3|
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
bug16211_f3 CREATE DEFINER=`root`@`localhost` FUNCTION `bug16211_f3`() RETURNS char(10) CHARSET utf8
-RETURN ""
+RETURN "" latin1 latin1_swedish_ci utf8_general_ci
SHOW CREATE FUNCTION mysqltest2.bug16211_f4|
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
bug16211_f4 CREATE DEFINER=`root`@`localhost` FUNCTION `bug16211_f4`() RETURNS char(10) CHARSET koi8r
-RETURN ""
+RETURN "" latin1 latin1_swedish_ci utf8_general_ci
SELECT dtd_identifier
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_SCHEMA = "mysqltest1" AND ROUTINE_NAME = "bug16211_f1"|
@@ -5122,21 +5126,21 @@ koi8r
ALTER DATABASE mysqltest1 CHARACTER SET cp1251|
ALTER DATABASE mysqltest2 CHARACTER SET cp1251|
SHOW CREATE FUNCTION bug16211_f1|
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
bug16211_f1 CREATE DEFINER=`root`@`localhost` FUNCTION `bug16211_f1`() RETURNS char(10) CHARSET utf8
-RETURN ""
+RETURN "" latin1 latin1_swedish_ci utf8_general_ci
SHOW CREATE FUNCTION bug16211_f2|
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
bug16211_f2 CREATE DEFINER=`root`@`localhost` FUNCTION `bug16211_f2`() RETURNS char(10) CHARSET koi8r
-RETURN ""
+RETURN "" latin1 latin1_swedish_ci utf8_general_ci
SHOW CREATE FUNCTION mysqltest2.bug16211_f3|
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
bug16211_f3 CREATE DEFINER=`root`@`localhost` FUNCTION `bug16211_f3`() RETURNS char(10) CHARSET utf8
-RETURN ""
+RETURN "" latin1 latin1_swedish_ci utf8_general_ci
SHOW CREATE FUNCTION mysqltest2.bug16211_f4|
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
bug16211_f4 CREATE DEFINER=`root`@`localhost` FUNCTION `bug16211_f4`() RETURNS char(10) CHARSET koi8r
-RETURN ""
+RETURN "" latin1 latin1_swedish_ci utf8_general_ci
SELECT dtd_identifier
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_SCHEMA = "mysqltest1" AND ROUTINE_NAME = "bug16211_f1"|
@@ -5381,9 +5385,9 @@ ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghi
drop procedure if exists bug21416|
create procedure bug21416() show create procedure bug21416|
call bug21416()|
-Procedure sql_mode Create Procedure
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
bug21416 CREATE DEFINER=`root`@`localhost` PROCEDURE `bug21416`()
-show create procedure bug21416
+show create procedure bug21416 latin1 latin1_swedish_ci latin1_swedish_ci
drop procedure bug21416|
DROP PROCEDURE IF EXISTS bug21414|
CREATE PROCEDURE bug21414() SELECT 1|
@@ -5396,7 +5400,7 @@ DROP PROCEDURE bug21414|
set names utf8|
drop database if exists това_е_дълго_име_за_база_данни_нали|
create database това_е_дълго_име_за_база_данни_нали|
-INSERT INTO mysql.proc VALUES ('това_е_дълго_име_за_база_данни_нали','това_е_процедура_Ñ_доÑта_дълго_име_нали_и_още_по_дълго','PROCEDURE','това_е_процедура_Ñ_доÑта_дълго_име_нали_и_още_по_дълго','SQL','CONTAINS_SQL','NO','DEFINER','','','bad_body','root@localhost',now(), now(),'','')|
+INSERT INTO mysql.proc VALUES ('това_е_дълго_име_за_база_данни_нали','това_е_процедура_Ñ_доÑта_дълго_име_нали_и_още_по_дълго','PROCEDURE','това_е_процедура_Ñ_доÑта_дълго_име_нали_и_още_по_дълго','SQL','CONTAINS_SQL','NO','DEFINER','','','bad_body','root@localhost',now(), now(),'','', 'utf8', 'utf8_general_ci', 'utf8_general_ci', 'n/a')|
call това_е_дълго_име_за_база_данни_нали.това_е_процедура_Ñ_доÑта_дълго_име_нали_и_още_по_дълго()|
ERROR HY000: Failed to load routine това_е_дълго_име_за_база_данни_нали.това_е_процедура_Ñ_доÑта_дълго_име_нали_и_още_по_дълго. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)
drop database това_е_дълго_име_за_база_данни_нали|
@@ -5617,6 +5621,23 @@ Called B
Called B
drop procedure proc_21462_a|
drop procedure proc_21462_b|
+drop table if exists t3|
+drop procedure if exists proc_bug19733|
+create table t3 (s1 int)|
+create procedure proc_bug19733()
+begin
+declare v int default 0;
+while v < 100 do
+create index i on t3 (s1);
+drop index i on t3;
+set v = v + 1;
+end while;
+end|
+call proc_bug19733()|
+call proc_bug19733()|
+call proc_bug19733()|
+drop procedure proc_bug19733|
+drop table t3|
DROP PROCEDURE IF EXISTS p1|
DROP VIEW IF EXISTS v1, v2|
DROP TABLE IF EXISTS t3, t4|
@@ -5649,7 +5670,7 @@ drop function if exists pi;
create function pi() returns varchar(50)
return "pie, my favorite desert.";
Warnings:
-Note 1581 This function 'pi' has the same name as a native function
+Note 1584 This function 'pi' has the same name as a native function
SET @save_sql_mode=@@sql_mode;
SET SQL_MODE='IGNORE_SPACE';
select pi(), pi ();
@@ -5698,15 +5719,15 @@ use test;
create function `database`() returns varchar(50)
return "Stored function database";
Warnings:
-Note 1581 This function 'database' has the same name as a native function
+Note 1584 This function 'database' has the same name as a native function
create function `current_user`() returns varchar(50)
return "Stored function current_user";
Warnings:
-Note 1581 This function 'current_user' has the same name as a native function
+Note 1584 This function 'current_user' has the same name as a native function
create function md5(x varchar(50)) returns varchar(50)
return "Stored function md5";
Warnings:
-Note 1581 This function 'md5' has the same name as a native function
+Note 1584 This function 'md5' has the same name as a native function
SET SQL_MODE='IGNORE_SPACE';
select database(), database ();
database() database ()
@@ -6110,6 +6131,8 @@ select bug20777(9223372036854775810) as '9223372036854775810 2**63+2';
select bug20777(-9223372036854775808) as 'lower bounds signed bigint';
lower bounds signed bigint
0
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
select bug20777(9223372036854775807) as 'upper bounds signed bigint';
upper bounds signed bigint
9223372036854775807
@@ -6122,9 +6145,13 @@ upper bounds unsigned bigint
select bug20777(18446744073709551616) as 'upper bounds unsigned bigint + 1';
upper bounds unsigned bigint + 1
18446744073709551615
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
select bug20777(-1) as 'lower bounds unsigned bigint - 1';
lower bounds unsigned bigint - 1
0
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
create table examplebug20777 as select
0 as 'i',
bug20777(9223372036854775806) as '2**63-2',
@@ -6136,7 +6163,12 @@ bug20777(18446744073709551615) as '2**64-1',
bug20777(18446744073709551616) as '2**64',
bug20777(0) as '0',
bug20777(-1) as '-1';
+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
insert into examplebug20777 values (1, 9223372036854775806, 9223372036854775807, 223372036854775808, 9223372036854775809, 18446744073709551614, 18446744073709551615, 8446744073709551616, 0, -1);
+Warnings:
+Warning 1264 Out of range value for column '-1' at row 1
show create table examplebug20777;
Table Create Table
examplebug20777 CREATE TABLE `examplebug20777` (
@@ -6210,12 +6242,19 @@ 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|
+create procedure proc_21513()`my_label`:BEGIN END|
+show create procedure proc_21513|
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+proc_21513 CREATE DEFINER=`root`@`localhost` PROCEDURE `proc_21513`()
+`my_label`:BEGIN END utf8 utf8_general_ci latin1_swedish_ci
+drop procedure proc_21513|
End of 5.0 tests.
drop table t1,t2;
CREATE TABLE t1 (a int auto_increment primary key) engine=MyISAM;
CREATE TABLE t2 (a int auto_increment primary key, b int) engine=innodb;
set @a=0;
-CREATE function bug27354() RETURNS int deterministic
+CREATE function bug27354() RETURNS int not deterministic
begin
insert into t1 values (null);
set @a=@a+1;
@@ -6237,3 +6276,348 @@ count(*)
3
drop table t1,t2;
drop function bug27354;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE FUNCTION metered(a INT) RETURNS INT RETURN 12;
+CREATE VIEW v1 AS SELECT test.metered(a) as metered FROM t1;
+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 `test`.`metered`(`t1`.`a`) AS `metered` from `t1` utf8 utf8_general_ci
+DROP VIEW v1;
+DROP FUNCTION metered;
+DROP TABLE t1;
+SET @p1_p2_cnt= 2;
+CREATE TABLE t1 (c1 INT);
+CREATE VIEW v1 AS SELECT * FROM t1;
+PREPARE s1 FROM 'SELECT c1 FROM v1';
+EXECUTE s1;
+c1
+EXECUTE s1;
+c1
+CREATE PROCEDURE p1(IN loops BIGINT(19) UNSIGNED)
+BEGIN
+WHILE loops > 0 DO
+SELECT c1 FROM v1;
+SET loops = loops - 1;
+END WHILE;
+END|
+CREATE PROCEDURE p2(IN loops BIGINT(19) UNSIGNED)
+BEGIN
+WHILE loops > 0 DO
+SELECT c1 FROM v1;
+CALL p1(@p1_p2_cnt);
+SET loops = loops - 1;
+END WHILE;
+END|
+CREATE FUNCTION f1(loops INT UNSIGNED)
+RETURNS INT
+BEGIN
+DECLARE tmp INT;
+WHILE loops > 0 DO
+SELECT c1 INTO tmp FROM v1;
+SET loops = loops - 1;
+END WHILE;
+RETURN loops;
+END|
+CALL p1(2);
+c1
+c1
+CALL p2(2);
+c1
+c1
+c1
+c1
+c1
+c1
+SELECT f1(2);
+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;
+DROP VIEW v1;
+DROP TABLE t1;
+drop database if exists mysqltest_db1;
+create database mysqltest_db1;
+create procedure mysqltest_db1.sp_bug28551() begin end;
+call mysqltest_db1.sp_bug28551();
+show warnings;
+Level Code Message
+drop database mysqltest_db1;
+drop database if exists mysqltest_db1;
+drop table if exists test.t1;
+create database mysqltest_db1;
+use mysqltest_db1;
+drop database mysqltest_db1;
+create table test.t1 (id int);
+insert into test.t1 (id) values (1);
+create procedure test.sp_bug29050() begin select * from t1; end//
+show warnings;
+Level Code Message
+call test.sp_bug29050();
+id
+1
+show warnings;
+Level Code Message
+use test;
+drop procedure sp_bug29050;
+drop table t1;
+SET NAMES latin1;
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE áâä INT;
+SELECT áâä;
+END|
+CALL p1();
+áâä
+NULL
+SET NAMES default;
+DROP PROCEDURE p1;
+drop procedure if exists proc_25411_a;
+drop procedure if exists proc_25411_b;
+drop procedure if exists proc_25411_c;
+create procedure proc_25411_a()
+begin
+/* real comment */
+select 1;
+/*! select 2; */
+select 3;
+/*!00000 select 4; */
+/*!99999 select 5; */
+end
+$$
+create procedure proc_25411_b(
+/* real comment */
+/*! p1 int, */
+/*!00000 p2 int */
+/*!99999 ,p3 int */
+)
+begin
+select p1, p2;
+end
+$$
+create procedure proc_25411_c()
+begin
+select 1/*!,2*//*!00000,3*//*!99999,4*/;
+select 1/*! ,2*//*!00000 ,3*//*!99999 ,4*/;
+select 1/*!,2 *//*!00000,3 *//*!99999,4 */;
+select 1/*! ,2 *//*!00000 ,3 *//*!99999 ,4 */;
+select 1 /*!,2*/ /*!00000,3*/ /*!99999,4*/ ;
+end
+$$
+show create procedure proc_25411_a;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+proc_25411_a CREATE DEFINER=`root`@`localhost` PROCEDURE `proc_25411_a`()
+begin
+/* real comment */
+select 1;
+ select 2;
+select 3;
+ select 4;
+
+end latin1 latin1_swedish_ci latin1_swedish_ci
+call proc_25411_a();
+1
+1
+2
+2
+3
+3
+4
+4
+show create procedure proc_25411_b;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+proc_25411_b CREATE DEFINER=`root`@`localhost` PROCEDURE `proc_25411_b`(
+/* real comment */
+ p1 int,
+ p2 int
+
+)
+begin
+select p1, p2;
+end latin1 latin1_swedish_ci latin1_swedish_ci
+select name, param_list, body from mysql.proc where name like "%25411%";
+name param_list body
+proc_25411_a begin
+/* real comment */
+select 1;
+ select 2;
+select 3;
+ select 4;
+
+end
+proc_25411_b
+/* real comment */
+ p1 int,
+ p2 int
+
+ begin
+select p1, p2;
+end
+proc_25411_c begin
+select 1,2,3;
+select 1 ,2 ,3;
+select 1,2 ,3 ;
+select 1 ,2 ,3 ;
+select 1 ,2 ,3 ;
+end
+call proc_25411_b(10, 20);
+p1 p2
+10 20
+show create procedure proc_25411_c;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+proc_25411_c CREATE DEFINER=`root`@`localhost` PROCEDURE `proc_25411_c`()
+begin
+select 1,2,3;
+select 1 ,2 ,3;
+select 1,2 ,3 ;
+select 1 ,2 ,3 ;
+select 1 ,2 ,3 ;
+end latin1 latin1_swedish_ci latin1_swedish_ci
+call proc_25411_c();
+1 2 3
+1 2 3
+1 2 3
+1 2 3
+1 2 3
+1 2 3
+1 2 3
+1 2 3
+1 2 3
+1 2 3
+drop procedure proc_25411_a;
+drop procedure proc_25411_b;
+drop procedure proc_25411_c;
+drop procedure if exists proc_26302;
+create procedure proc_26302()
+select 1 /* testing */;
+show create procedure proc_26302;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+proc_26302 CREATE DEFINER=`root`@`localhost` PROCEDURE `proc_26302`()
+select 1 /* testing */ latin1 latin1_swedish_ci latin1_swedish_ci
+select ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES
+where ROUTINE_NAME = "proc_26302";
+ROUTINE_NAME ROUTINE_DEFINITION
+proc_26302 select 1 /* testing */
+drop procedure proc_26302;
+CREATE FUNCTION f1() RETURNS INT DETERMINISTIC RETURN 2;
+CREATE FUNCTION f2(I INT) RETURNS INT DETERMINISTIC RETURN 3;
+CREATE TABLE t1 (c1 INT, INDEX(c1));
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
+CREATE VIEW v1 AS SELECT c1 FROM t1;
+EXPLAIN SELECT * FROM t1 WHERE c1=1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref c1 c1 5 const 1 Using where; Using index
+EXPLAIN SELECT * FROM t1 WHERE c1=f1();
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref c1 c1 5 const 1 Using where; Using index
+EXPLAIN SELECT * FROM v1 WHERE c1=1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref c1 c1 5 const 1 Using where; Using index
+EXPLAIN SELECT * FROM v1 WHERE c1=f1();
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref c1 c1 5 const 1 Using where; Using index
+EXPLAIN SELECT * FROM t1 WHERE c1=f2(10);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref c1 c1 5 const 1 Using where; Using index
+EXPLAIN SELECT * FROM t1 WHERE c1=f2(c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL c1 5 NULL 5 Using where; Using index
+EXPLAIN SELECT * FROM t1 WHERE c1=f2(rand());
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL c1 5 NULL 5 Using where; Using index
+DROP VIEW v1;
+DROP FUNCTION f1;
+DROP FUNCTION f2;
+DROP TABLE t1;
+create function f1()
+returns int(11)
+not deterministic
+contains sql
+sql security definer
+comment ''
+begin
+declare x int(11);
+set x=-1;
+return x;
+end|
+create view v1 as select 1 as one, f1() as days;
+show create view test.v1;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test`.`v1` AS select 1 AS `one`,`f1`() AS `days` latin1 latin1_swedish_ci
+select column_name from information_schema.columns
+where table_name='v1' and table_schema='test';
+column_name
+one
+days
+drop view v1;
+drop function f1;
+
+# Bug#13675.
+
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p2;
+DROP TABLE IF EXISTS t1;
+
+CREATE PROCEDURE p1(v DATETIME) CREATE TABLE t1 SELECT v;
+CREATE PROCEDURE p2(v INT) CREATE TABLE t1 SELECT v;
+
+CALL p1(NOW());
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `v` datetime DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+DROP TABLE t1;
+
+CALL p1('text');
+Warnings:
+Warning 1264 Out of range value for column 'v' at row 1
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `v` datetime DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+DROP TABLE t1;
+
+CALL p2(10);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `v` bigint(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+DROP TABLE t1;
+
+CALL p2('text');
+Warnings:
+Warning 1366 Incorrect integer value: 'text' for column 'v' at row 1
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `v` bigint(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+DROP TABLE t1;
+
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+End of 5.0 tests
diff --git a/mysql-test/r/sp_gis.result b/mysql-test/r/sp_gis.result
index fddf2a6bc18..b0960dec647 100644
--- a/mysql-test/r/sp_gis.result
+++ b/mysql-test/r/sp_gis.result
@@ -7,11 +7,11 @@ return 1;
create function x() returns int
return 2;
Warnings:
-Note 1581 This function 'x' has the same name as a native function
+Note 1584 This function 'x' has the same name as a native function
create function y() returns int
return 3;
Warnings:
-Note 1581 This function 'y' has the same name as a native function
+Note 1584 This function 'y' has the same name as a native function
select a();
a()
1
diff --git a/mysql-test/r/sp_notembedded.result b/mysql-test/r/sp_notembedded.result
index 0b1fa565d28..277eea8570e 100644
--- a/mysql-test/r/sp_notembedded.result
+++ b/mysql-test/r/sp_notembedded.result
@@ -208,3 +208,26 @@ GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
drop user mysqltest_1@localhost;
drop procedure 15298_1;
drop procedure 15298_2;
+drop table if exists t1;
+drop procedure if exists p1;
+create table t1 (value varchar(15));
+create procedure p1() update t1 set value='updated' where value='old';
+call p1();
+insert into t1 (value) values ("old");
+select get_lock('b26162',120);
+get_lock('b26162',120)
+1
+select 'rl_acquirer', value from t1 where get_lock('b26162',120);;
+set session low_priority_updates=on;
+call p1();;
+select 'rl_contender', value from t1;
+rl_contender value
+rl_contender old
+select release_lock('b26162');
+release_lock('b26162')
+1
+rl_acquirer value
+rl_acquirer old
+drop procedure p1;
+drop table t1;
+set session low_priority_updates=default;
diff --git a/mysql-test/r/sp_trans.result b/mysql-test/r/sp_trans.result
index a0d687e565b..abd454ac907 100644
--- a/mysql-test/r/sp_trans.result
+++ b/mysql-test/r/sp_trans.result
@@ -535,7 +535,7 @@ use db_bug7787|
CREATE PROCEDURE p1()
SHOW INNODB STATUS; |
Warnings:
-Warning 1543 The syntax 'SHOW INNODB STATUS' is deprecated and will be removed in MySQL 5.2. Please use 'SHOW ENGINE INNODB STATUS' instead
+Warning 1287 The syntax 'SHOW INNODB STATUS' is deprecated and will be removed in MySQL 5.2. Please use 'SHOW ENGINE INNODB STATUS' instead
GRANT EXECUTE ON PROCEDURE p1 TO user_bug7787@localhost|
DROP DATABASE db_bug7787|
drop user user_bug7787@localhost|
diff --git a/mysql-test/r/sql_mode.result b/mysql-test/r/sql_mode.result
index c7be653ca2e..2b34ff8c021 100644
--- a/mysql-test/r/sql_mode.result
+++ b/mysql-test/r/sql_mode.result
@@ -426,37 +426,37 @@ a\b a\'b a"\b a"\'b
SET @@SQL_MODE='';
create function `foo` () returns int return 5;
show create function `foo`;
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
foo CREATE DEFINER=`root`@`localhost` FUNCTION `foo`() RETURNS int(11)
-return 5
+return 5 latin1 latin1_swedish_ci latin1_swedish_ci
SET @@SQL_MODE='ANSI_QUOTES';
show create function `foo`;
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
foo CREATE DEFINER=`root`@`localhost` FUNCTION `foo`() RETURNS int(11)
-return 5
+return 5 latin1 latin1_swedish_ci latin1_swedish_ci
drop function `foo`;
create function `foo` () returns int return 5;
show create function `foo`;
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
foo ANSI_QUOTES CREATE DEFINER="root"@"localhost" FUNCTION "foo"() RETURNS int(11)
-return 5
+return 5 latin1 latin1_swedish_ci latin1_swedish_ci
SET @@SQL_MODE='';
show create function `foo`;
-Function sql_mode Create Function
+Function sql_mode Create Function character_set_client collation_connection Database Collation
foo ANSI_QUOTES CREATE DEFINER="root"@"localhost" FUNCTION "foo"() RETURNS int(11)
-return 5
+return 5 latin1 latin1_swedish_ci latin1_swedish_ci
drop function `foo`;
SET @@SQL_MODE='';
create table t1 (a int);
create table t2 (a int);
create view v1 as select a from t1;
show create view v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` latin1 latin1_swedish_ci
SET @@SQL_MODE='ANSI_QUOTES';
show create view v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER="root"@"localhost" SQL SECURITY DEFINER VIEW "v1" AS select "t1"."a" AS "a" from "t1"
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER="root"@"localhost" SQL SECURITY DEFINER VIEW "v1" AS select "t1"."a" AS "a" from "t1" latin1 latin1_swedish_ci
create view v2 as select a from t2 where a in (select a from v1);
drop view v2, v1;
drop table t1, t2;
@@ -475,9 +475,24 @@ set sql_mode=16384+(65536*4);
select @@sql_mode;
@@sql_mode
REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,NO_TABLE_OPTIONS,ANSI
-set sql_mode=2147483648;
-ERROR 42000: Variable 'sql_mode' can't be set to the value of '2147483648'
+set sql_mode=2147483648*2;
+ERROR 42000: Variable 'sql_mode' can't be set to the value of '4294967296'
select @@sql_mode;
@@sql_mode
REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,NO_TABLE_OPTIONS,ANSI
+set sql_mode=PAD_CHAR_TO_FULL_LENGTH;
+create table t1 (a int auto_increment primary key, b char(5));
+insert into t1 (b) values('a'),('b\t'),('c ');
+select concat('x',b,'x') from t1;
+concat('x',b,'x')
+xa x
+xb x
+xc x
+set sql_mode=0;
+select concat('x',b,'x') from t1;
+concat('x',b,'x')
+xax
+xb x
+xcx
+drop table t1;
SET @@SQL_MODE=@OLD_SQL_MODE;
diff --git a/mysql-test/r/ssl-big.result b/mysql-test/r/ssl-big.result
new file mode 100644
index 00000000000..39c4f34e46c
--- /dev/null
+++ b/mysql-test/r/ssl-big.result
@@ -0,0 +1,3 @@
+DROP TABLE IF EXISTS t1, t2;
+create table t1 (a int);
+drop table t1;
diff --git a/mysql-test/r/ssl.result b/mysql-test/r/ssl.result
index 47b86d1a039..1f1a6ec9e22 100644
--- a/mysql-test/r/ssl.result
+++ b/mysql-test/r/ssl.result
@@ -1431,8 +1431,8 @@ companynr companynr
41 40
explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary; Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where; Using join buffer
select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008;
fld1 companynr fld3 period
038008 37 reporters 1008
diff --git a/mysql-test/r/ssl_8k_key.result b/mysql-test/r/ssl_8k_key.result
new file mode 100644
index 00000000000..b33a1d2854f
--- /dev/null
+++ b/mysql-test/r/ssl_8k_key.result
@@ -0,0 +1,2 @@
+Variable_name Value
+Ssl_cipher DHE-RSA-AES256-SHA
diff --git a/mysql-test/r/ssl_compress.result b/mysql-test/r/ssl_compress.result
index e19dcb712cf..e77fcefeafd 100644
--- a/mysql-test/r/ssl_compress.result
+++ b/mysql-test/r/ssl_compress.result
@@ -1434,8 +1434,8 @@ companynr companynr
41 40
explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary; Using join cache
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where; Using join buffer
select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008;
fld1 companynr fld3 period
038008 37 reporters 1008
diff --git a/mysql-test/r/status.result b/mysql-test/r/status.result
index e9891e4d495..db75044ee5d 100644
--- a/mysql-test/r/status.result
+++ b/mysql-test/r/status.result
@@ -1,12 +1,12 @@
flush status;
show status like 'Table_lock%';
Variable_name Value
-Table_locks_immediate 0
+Table_locks_immediate 1
Table_locks_waited 0
select * from information_schema.session_status where variable_name like 'Table_lock%';
VARIABLE_NAME VARIABLE_VALUE
-TABLE_LOCKS_IMMEDIATE 0.0000000
-TABLE_LOCKS_WAITED 0.0000000
+TABLE_LOCKS_IMMEDIATE 2
+TABLE_LOCKS_WAITED 0
SET SQL_LOG_BIN=0;
drop table if exists t1;
create table t1(n int) engine=myisam;
@@ -16,14 +16,9 @@ unlock tables;
lock tables t1 read;
update t1 set n = 3;
unlock tables;
-show status like 'Table_lock%';
+show status like 'Table_locks_waited';
Variable_name Value
-Table_locks_immediate 3
Table_locks_waited 1
-select * from information_schema.session_status where variable_name like 'Table_lock%';
-VARIABLE_NAME VARIABLE_VALUE
-TABLE_LOCKS_IMMEDIATE 3.0000000
-TABLE_LOCKS_WAITED 1.0000000
drop table t1;
select 1;
1
@@ -63,7 +58,7 @@ Variable_name Value
Max_used_connections 1
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
VARIABLE_NAME VARIABLE_VALUE
-MAX_USED_CONNECTIONS 1.0000000
+MAX_USED_CONNECTIONS 1
SET @save_thread_cache_size=@@thread_cache_size;
SET GLOBAL thread_cache_size=3;
SHOW STATUS LIKE 'max_used_connections';
@@ -71,33 +66,81 @@ Variable_name Value
Max_used_connections 3
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
VARIABLE_NAME VARIABLE_VALUE
-MAX_USED_CONNECTIONS 3.0000000
+MAX_USED_CONNECTIONS 3
FLUSH STATUS;
SHOW STATUS LIKE 'max_used_connections';
Variable_name Value
Max_used_connections 2
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
VARIABLE_NAME VARIABLE_VALUE
-MAX_USED_CONNECTIONS 2.0000000
+MAX_USED_CONNECTIONS 2
SHOW STATUS LIKE 'max_used_connections';
Variable_name Value
Max_used_connections 3
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
VARIABLE_NAME VARIABLE_VALUE
-MAX_USED_CONNECTIONS 3.0000000
+MAX_USED_CONNECTIONS 3
SHOW STATUS LIKE 'max_used_connections';
Variable_name Value
Max_used_connections 4
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
VARIABLE_NAME VARIABLE_VALUE
-MAX_USED_CONNECTIONS 4.0000000
+MAX_USED_CONNECTIONS 4
SET GLOBAL thread_cache_size=@save_thread_cache_size;
+CREATE TABLE t1 ( a INT );
+INSERT INTO t1 VALUES (1), (2);
+SELECT a FROM t1 LIMIT 1;
+a
+1
+SHOW SESSION STATUS LIKE 'Last_query_cost';
+Variable_name Value
+Last_query_cost 2.402418
+EXPLAIN SELECT a FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2
+SHOW SESSION STATUS LIKE 'Last_query_cost';
+Variable_name Value
+Last_query_cost 2.402418
+SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY a;
+a
+1
+2
+SHOW SESSION STATUS LIKE 'Last_query_cost';
+Variable_name Value
+Last_query_cost 0.000000
+EXPLAIN SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2
+2 UNION t1 ALL NULL NULL NULL NULL 2
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL Using filesort
+SHOW SESSION STATUS LIKE 'Last_query_cost';
+Variable_name Value
+Last_query_cost 0.000000
+SELECT a IN (SELECT a FROM t1) FROM t1 LIMIT 1;
+a IN (SELECT a FROM t1)
+1
+SHOW SESSION STATUS LIKE 'Last_query_cost';
+Variable_name Value
+Last_query_cost 0.000000
+SELECT (SELECT a FROM t1 LIMIT 1) x FROM t1 LIMIT 1;
+x
+1
+SHOW SESSION STATUS LIKE 'Last_query_cost';
+Variable_name Value
+Last_query_cost 0.000000
+SELECT * FROM t1 a, t1 b LIMIT 1;
+a a
+1 1
+SHOW SESSION STATUS LIKE 'Last_query_cost';
+Variable_name Value
+Last_query_cost 4.805836
+DROP TABLE t1;
show status like 'com_show_status';
Variable_name Value
Com_show_status 3
show status like 'hand%write%';
Variable_name Value
-Handler_write 0
+Handler_write 5
show status like '%tmp%';
Variable_name Value
Created_tmp_disk_tables 0
@@ -105,7 +148,7 @@ Created_tmp_files 0
Created_tmp_tables 0
show status like 'hand%write%';
Variable_name Value
-Handler_write 0
+Handler_write 7
show status like '%tmp%';
Variable_name Value
Created_tmp_disk_tables 0
diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result
index 3b2fda4248a..cc1a2535896 100644
--- a/mysql-test/r/strict.result
+++ b/mysql-test/r/strict.result
@@ -3,7 +3,7 @@ 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
-DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (col1 date);
INSERT INTO t1 VALUES('2004-01-01'),('2004-02-29');
INSERT INTO t1 VALUES('0000-10-31');
@@ -215,11 +215,11 @@ ERROR 22007: Incorrect date value: '2004-10-00 15:30:00' for column 'col1' at ro
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.9.2004 15.30','%d.%m.%Y %H.%i'));
ERROR 22007: Incorrect date value: '2004-09-31 15:30:00' for column 'col1' at row 1
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i'));
-ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_time
+ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_date
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('29.02.2003 15.30','%d.%m.%Y %H.%i'));
ERROR 22007: Incorrect date value: '2003-02-29 15:30:00' for column 'col1' at row 1
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('15.13.2004 15.30','%d.%m.%Y %H.%i'));
-ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_time
+ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_date
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y'));
ERROR 22007: Incorrect date value: '0000-00-00' for column 'col1' at row 1
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
@@ -230,11 +230,11 @@ ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col2' a
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.9.2004 15.30','%d.%m.%Y %H.%i'));
ERROR 22007: Incorrect datetime value: '2004-09-31 15:30:00' for column 'col2' at row 1
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i'));
-ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_time
+ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_date
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('29.02.2003 15.30','%d.%m.%Y %H.%i'));
ERROR 22007: Incorrect datetime value: '2003-02-29 15:30:00' for column 'col2' at row 1
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('15.13.2004 15.30','%d.%m.%Y %H.%i'));
-ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_time
+ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_date
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y'));
ERROR 22007: Incorrect datetime value: '0000-00-00' for column 'col2' at row 1
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
@@ -246,11 +246,11 @@ ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col3' a
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.9.2004 15.30','%d.%m.%Y %H.%i'));
ERROR 22007: Incorrect datetime value: '2004-09-31 15:30:00' for column 'col3' at row 1
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i'));
-ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_time
+ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_date
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('29.02.2003 15.30','%d.%m.%Y %H.%i'));
ERROR 22007: Incorrect datetime value: '2003-02-29 15:30:00' for column 'col3' at row 1
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('15.13.2004 15.30','%d.%m.%Y %H.%i'));
-ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_time
+ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_date
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y'));
ERROR 22007: Incorrect datetime value: '0000-00-00' for column 'col3' at row 1
drop table t1;
@@ -1070,24 +1070,24 @@ create table t1 (col1 datetime);
insert into t1 values(STR_TO_DATE('31.10.2004 15.30 abc','%d.%m.%Y %H.%i'));
ERROR 22007: 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'));
-ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_time
+ERROR HY000: 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'));
-ERROR HY000: Incorrect time value: '22:22:33 AM' for function str_to_time
+ERROR HY000: 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'));
-ERROR HY000: Incorrect time value: 'abc' for function str_to_time
+ERROR HY000: Incorrect time value: 'abc' for function str_to_date
set sql_mode='';
insert into t1 values(STR_TO_DATE('31.10.2004 15.30 abc','%d.%m.%Y %H.%i'));
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_time
+Error 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_time
+Error 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_time
+Error 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'));
@@ -1105,9 +1105,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_time
-Error 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_time
-Error 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_time
+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
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 e90f43b9870..a25183a0e6d 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -904,8 +904,8 @@ a t1.a in (select t2.a from t2,t3 where t3.a=t2.a)
explain extended SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 index NULL PRIMARY 4 NULL 4 100.00 Using index
-2 DEPENDENT SUBQUERY t2 ref_or_null a a 5 func 2 100.00 Using where; Using index; Using join cache
-2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
+2 DEPENDENT SUBQUERY t2 ref_or_null a a 5 func 2 100.00 Using where; Using index
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,<in_optimizer>(`test`.`t1`.`a`,<exists>(select 1 AS `Not_used` from `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and ((<cache>(`test`.`t1`.`a`) = `test`.`t2`.`a`) or isnull(`test`.`t2`.`a`))) having <is_not_null_test>(`test`.`t2`.`a`))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1`
drop table t1,t2,t3;
@@ -1354,8 +1354,8 @@ a
explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index
-2 DEPENDENT SUBQUERY t1 ref a a 5 func 1001 100.00 Using where; Using index; Using join cache
-2 DEPENDENT SUBQUERY t3 index a a 5 NULL 3 100.00 Using where; Using index
+2 DEPENDENT SUBQUERY t1 ref a a 5 func 1001 100.00 Using where; Using index
+2 DEPENDENT SUBQUERY t3 index a a 5 NULL 3 100.00 Using where; Using index; Using join buffer
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(select 1 AS `Not_used` from `test`.`t1` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t1`.`b`) and (<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`))))
insert into t1 values (3,31);
@@ -2853,7 +2853,6 @@ a
3
4
DROP TABLE t1,t2,t3;
-purge master logs before (select adddate(current_timestamp(), interval -4 day));
CREATE TABLE t1 (f1 INT);
CREATE TABLE t2 (f2 INT);
INSERT INTO t1 VALUES (1);
@@ -3420,7 +3419,7 @@ EXPLAIN
SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 9 Using where
-2 DEPENDENT SUBQUERY t1 index NULL a 8 NULL 9 Using filesort
+2 DEPENDENT SUBQUERY t1 index NULL a 8 NULL 1 Using filesort
DROP TABLE t1;
create table t1( f1 int,f2 int);
insert into t1 values (1,1),(2,2);
@@ -4041,6 +4040,105 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ref a a 5 const 1 Using where; Using index
2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
DROP TABLE t1;
+CREATE TABLE t1 (id int NOT NULL, st CHAR(2), INDEX idx(id));
+INSERT INTO t1 VALUES
+(3,'FL'), (2,'GA'), (4,'FL'), (1,'GA'), (5,'NY'), (7,'FL'), (6,'NY');
+CREATE TABLE t2 (id int NOT NULL, INDEX idx(id));
+INSERT INTO t2 VALUES (7), (5), (1), (3);
+SELECT id, st FROM t1
+WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id);
+id st
+3 FL
+1 GA
+7 FL
+SELECT id, st FROM t1
+WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id)
+GROUP BY id;
+id st
+1 GA
+3 FL
+7 FL
+SELECT id, st FROM t1
+WHERE st IN ('GA','FL') AND NOT EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id);
+id st
+2 GA
+4 FL
+SELECT id, st FROM t1
+WHERE st IN ('GA','FL') AND NOT EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id)
+GROUP BY id;
+id st
+2 GA
+4 FL
+DROP TABLE t1,t2;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 VALUES (1), (2);
+EXPLAIN EXTENDED
+SELECT * FROM (SELECT count(*) FROM t1 GROUP BY a) as res;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 100.00
+2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort
+Warnings:
+Note 1003 select `res`.`count(*)` AS `count(*)` from (select count(0) AS `count(*)` from `test`.`t1` group by `test`.`t1`.`a`) `res`
+DROP TABLE t1;
+CREATE TABLE t1 (
+a varchar(255) default NULL,
+b timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+INDEX idx(a,b)
+);
+CREATE TABLE t2 (
+a varchar(255) default NULL
+);
+INSERT INTO t1 VALUES ('abcdefghijk','2007-05-07 06:00:24');
+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` VALUES ('asdf','2007-02-08 01:11:26');
+INSERT INTO `t2` VALUES ('abcdefghijk');
+INSERT INTO `t2` VALUES ('asdf');
+SET session sort_buffer_size=8192;
+SELECT (SELECT 1 FROM t1 WHERE t1.a=t2.a ORDER BY t1.b LIMIT 1) AS d1 FROM t2;
+d1
+1
+1
+DROP TABLE t1,t2;
+CREATE TABLE t1 (a INTEGER, b INTEGER);
+CREATE TABLE t2 (x INTEGER);
+INSERT INTO t1 VALUES (1,11), (2,22), (2,22);
+INSERT INTO t2 VALUES (1), (2);
+SELECT a, COUNT(b), (SELECT COUNT(b) FROM t2) FROM t1 GROUP BY a;
+ERROR 21000: Subquery returns more than 1 row
+SELECT a, COUNT(b), (SELECT COUNT(b)+0 FROM t2) FROM t1 GROUP BY a;
+ERROR 21000: Subquery returns more than 1 row
+SELECT (SELECT SUM(t1.a)/AVG(t2.x) FROM t2) FROM t1;
+(SELECT SUM(t1.a)/AVG(t2.x) FROM t2)
+3.3333
+DROP TABLE t1,t2;
+CREATE TABLE t1 (a INT, b INT);
+INSERT INTO t1 VALUES (1, 2), (1,3), (1,4), (2,1), (2,2);
+SELECT a1.a, COUNT(*) FROM t1 a1 WHERE a1.a = 1
+AND EXISTS( SELECT a2.a FROM t1 a2 WHERE a2.a = a1.a)
+GROUP BY a1.a;
+a COUNT(*)
+1 3
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+INSERT INTO t2 VALUES (1),(2);
+SELECT (SELECT SUM(t1.a) FROM t2 WHERE a=0) FROM t1;
+(SELECT SUM(t1.a) FROM t2 WHERE a=0)
+NULL
+SELECT (SELECT SUM(t1.a) FROM t2 WHERE a!=0) FROM t1;
+ERROR 21000: Subquery returns more than 1 row
+SELECT (SELECT SUM(t1.a) FROM t2 WHERE a=1) FROM t1;
+(SELECT SUM(t1.a) FROM t2 WHERE a=1)
+3
+DROP TABLE t1,t2;
End of 5.0 tests.
CREATE TABLE t1 (a int, b int);
INSERT INTO t1 VALUES (2,22),(1,11),(2,22);
diff --git a/mysql-test/r/subselect3.result b/mysql-test/r/subselect3.result
index 132c36fbf11..2f3ea31a2a4 100644
--- a/mysql-test/r/subselect3.result
+++ b/mysql-test/r/subselect3.result
@@ -254,8 +254,8 @@ select a,b, oref,
from t2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00
-2 DEPENDENT SUBQUERY t1 ref_or_null a a 5 func 2 100.00 Using where; Full scan on NULL key; Using join cache
-2 DEPENDENT SUBQUERY t4 ALL NULL NULL NULL NULL 100 100.00 Using where
+2 DEPENDENT SUBQUERY t1 ref_or_null a a 5 func 2 100.00 Using where; Full scan on NULL key
+2 DEPENDENT SUBQUERY t4 ALL NULL NULL NULL NULL 100 100.00 Using where; Using join buffer
Warnings:
Note 1276 Field or reference 'test.t2.oref' of SELECT #2 was resolved in SELECT #1
Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`oref` AS `oref`,<in_optimizer>((`test`.`t2`.`a`,`test`.`t2`.`b`),<exists>(select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` join `test`.`t4` where ((`test`.`t1`.`c` = `test`.`t2`.`oref`) and trigcond(((<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`) or isnull(`test`.`t1`.`a`))) and trigcond(((<cache>(`test`.`t2`.`b`) = `test`.`t1`.`b`) or isnull(`test`.`t1`.`b`)))) having (trigcond(<is_not_null_test>(`test`.`t1`.`a`)) and trigcond(<is_not_null_test>(`test`.`t1`.`b`))))) AS `Z` from `test`.`t2`
@@ -711,3 +711,52 @@ a
1
4
DROP TABLE t1,t2;
+CREATE TABLE t1 (id int);
+CREATE TABLE t2 (id int PRIMARY KEY);
+CREATE TABLE t3 (id int PRIMARY KEY, name varchar(10));
+INSERT INTO t1 VALUES (2), (NULL), (3), (1);
+INSERT INTO t2 VALUES (234), (345), (457);
+INSERT INTO t3 VALUES (222,'bbb'), (333,'ccc'), (111,'aaa');
+EXPLAIN
+SELECT * FROM t1
+WHERE t1.id NOT IN (SELECT t2.id FROM t2,t3
+WHERE t3.name='xxx' AND t2.id=t3.id);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
+2 DEPENDENT SUBQUERY t2 eq_ref PRIMARY PRIMARY 4 func 1 Using where; Using index; Full scan on NULL key
+2 DEPENDENT SUBQUERY t3 eq_ref PRIMARY PRIMARY 4 func 1 Using where; Full scan on NULL key
+SELECT * FROM t1
+WHERE t1.id NOT IN (SELECT t2.id FROM t2,t3
+WHERE t3.name='xxx' AND t2.id=t3.id);
+id
+2
+NULL
+3
+1
+SELECT (t1.id IN (SELECT t2.id FROM t2,t3
+WHERE t3.name='xxx' AND t2.id=t3.id)) AS x
+FROM t1;
+x
+0
+0
+0
+0
+DROP TABLE t1,t2,t3;
+CREATE TABLE t1 (a INT NOT NULL);
+INSERT INTO t1 VALUES (1),(-1), (65),(66);
+CREATE TABLE t2 (a INT UNSIGNED NOT NULL PRIMARY KEY);
+INSERT INTO t2 VALUES (65),(66);
+SELECT a FROM t1 WHERE a NOT IN (65,66);
+a
+1
+-1
+SELECT a FROM t1 WHERE a NOT IN (SELECT a FROM t2);
+a
+1
+-1
+EXPLAIN SELECT a FROM t1 WHERE a NOT IN (SELECT a FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
+2 DEPENDENT SUBQUERY t2 unique_subquery PRIMARY PRIMARY 4 func 1 Using index
+DROP TABLE t1;
+End of 5.0 tests
diff --git a/mysql-test/r/subselect_notembedded.result b/mysql-test/r/subselect_notembedded.result
index dd4b0701c32..44ae055425e 100644
--- a/mysql-test/r/subselect_notembedded.result
+++ b/mysql-test/r/subselect_notembedded.result
@@ -1 +1,3 @@
purge master logs before (select adddate(current_timestamp(), interval -4 day));
+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 'select adddate(current_timestamp(), interval -4 day))' at line 1
+purge master logs before adddate(current_timestamp(), interval -4 day);
diff --git a/mysql-test/r/symlink.result b/mysql-test/r/symlink.result
index 8ffe88acfa4..aba60f757c6 100644
--- a/mysql-test/r/symlink.result
+++ b/mysql-test/r/symlink.result
@@ -133,4 +133,26 @@ a
42
drop table t1;
End of 4.1 tests
+CREATE DATABASE db1;
+CREATE DATABASE db2;
+USE db2;
+INSERT INTO db2.t1 VALUES (1);
+SELECT * FROM db2.t1;
+b
+1
+RESET QUERY CACHE;
+USE db1;
+SET SESSION keep_files_on_create = TRUE;
+CREATE TABLE t1 (a INT) ENGINE MYISAM;
+Got one of the listed errors
+CREATE TABLE t3 (a INT) Engine=MyISAM;
+INSERT INTO t3 VALUES (1),(2),(3);
+TRUNCATE TABLE t3;
+SELECT * from t3;
+a
+SET SESSION keep_files_on_create = DEFAULT;
+DROP TABLE db2.t1, db1.t3;
+DROP DATABASE db1;
+DROP DATABASE db2;
+USE test;
End of 5.0 tests
diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result
index 5acbace480a..7696afdf06d 100644
--- a/mysql-test/r/system_mysql_db.result
+++ b/mysql-test/r/system_mysql_db.result
@@ -203,6 +203,10 @@ proc CREATE TABLE `proc` (
`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') NOT NULL DEFAULT '',
`comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
+ `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,
+ `body_utf8` longblob,
PRIMARY KEY (`db`,`name`,`type`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Stored Procedures'
show create table event;
@@ -226,6 +230,10 @@ event CREATE TABLE `event` (
`comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
`originator` int(10) NOT NULL,
`time_zone` char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM',
+ `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,
+ `body_utf8` longblob,
PRIMARY KEY (`db`,`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Events'
show create table general_log;
diff --git a/mysql-test/r/temp_table.result b/mysql-test/r/temp_table.result
index 9cb4a6b2427..46724de4281 100644
--- a/mysql-test/r/temp_table.result
+++ b/mysql-test/r/temp_table.result
@@ -111,8 +111,8 @@ v1 CREATE TEMPORARY TABLE `v1` (
`A` varchar(19) NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show create view v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select _latin1'This is view' AS `A`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select _latin1'This is view' AS `A` latin1 latin1_swedish_ci
drop view v1;
select * from v1;
A
diff --git a/mysql-test/r/trigger-compat.result b/mysql-test/r/trigger-compat.result
index 068bf6c6968..1609707fb09 100644
--- a/mysql-test/r/trigger-compat.result
+++ b/mysql-test/r/trigger-compat.result
@@ -32,9 +32,9 @@ Warnings:
Warning 1454 No definer attribute for trigger 'mysqltest_db1'.'wl2818_trg1'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger.
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS ORDER BY trigger_name;
-TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER
-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
-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
+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
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-grant.result b/mysql-test/r/trigger-grant.result
index 49c36513fbc..14b8c98f2fa 100644
--- a/mysql-test/r/trigger-grant.result
+++ b/mysql-test/r/trigger-grant.result
@@ -137,9 +137,9 @@ Note 1449 There is no 'mysqltest_nonexs'@'localhost' registered
INSERT INTO t1 VALUES(6);
ERROR HY000: There is no 'mysqltest_nonexs'@'localhost' registered
SHOW TRIGGERS;
-Trigger Event Table Statement Timing Created sql_mode Definer
-trg1 INSERT t1 SET @new_sum = 0 BEFORE NULL mysqltest_inv@localhost
-trg2 INSERT t1 SET @new_sum = 0 AFTER NULL mysqltest_nonexs@localhost
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+trg1 INSERT t1 SET @new_sum = 0 BEFORE NULL mysqltest_inv@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+trg2 INSERT t1 SET @new_sum = 0 AFTER NULL mysqltest_nonexs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
DROP TRIGGER trg1;
DROP TRIGGER trg2;
CREATE TRIGGER trg1 BEFORE INSERT ON t1
@@ -169,12 +169,12 @@ Warnings:
Warning 1454 No definer attribute for trigger 'mysqltest_db1'.'trg1'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger.
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS ORDER BY trigger_name;
-TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER
-NULL mysqltest_db1 trg1 INSERT NULL mysqltest_db1 t1 0 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW NULL
-NULL mysqltest_db1 trg2 INSERT NULL mysqltest_db1 t1 0 NULL SET @a = 2 ROW AFTER NULL NULL OLD NEW NULL @
-NULL mysqltest_db1 trg3 UPDATE NULL mysqltest_db1 t1 0 NULL SET @a = 3 ROW BEFORE NULL NULL OLD NEW NULL @abc@def@@
-NULL mysqltest_db1 trg4 UPDATE NULL mysqltest_db1 t1 0 NULL SET @a = 4 ROW AFTER NULL NULL OLD NEW NULL @hostname
-NULL mysqltest_db1 trg5 DELETE NULL mysqltest_db1 t1 0 NULL SET @a = 5 ROW BEFORE NULL NULL OLD NEW NULL @abcdef@@@hostname
+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
---> connection: default
DROP USER mysqltest_dfn@localhost;
diff --git a/mysql-test/r/trigger-trans.result b/mysql-test/r/trigger-trans.result
index b56abf1f59a..cd5f629564f 100644
--- a/mysql-test/r/trigger-trans.result
+++ b/mysql-test/r/trigger-trans.result
@@ -82,3 +82,62 @@ ALICE 33 1 0
THE CROWN 43 1 0
THE PIE 53 1 1
drop table t1;
+
+Bug#26141 mixing table types in trigger causes full
+table lock on innodb table
+
+Ensure we do not open and lock tables for the triggers we do not
+fire.
+
+drop table if exists t1, t2, t3;
+drop trigger if exists trg_bug26141_au;
+drop trigger if exists trg_bug26141_ai;
+create table t1 (c int primary key) engine=innodb;
+create table t2 (c int) engine=myisam;
+create table t3 (c int) engine=myisam;
+insert into t1 (c) values (1);
+create trigger trg_bug26141_ai after insert on t1
+for each row
+begin
+insert into t2 (c) values (1);
+# We need the 'sync' lock to synchronously wait in connection 2 till
+# the moment when the trigger acquired all the locks.
+select release_lock("lock_bug26141_sync") into @a;
+# 1000 is time in seconds of lock wait timeout -- this is a way
+# to cause a manageable sleep up to 1000 seconds
+select get_lock("lock_bug26141_wait", 1000) into @a;
+end|
+create trigger trg_bug26141_au after update on t1
+for each row
+begin
+insert into t3 (c) values (1);
+end|
+select get_lock("lock_bug26141_wait", 0);
+get_lock("lock_bug26141_wait", 0)
+1
+select get_lock("lock_bug26141_sync", /* must not be priorly locked */ 0);
+get_lock("lock_bug26141_sync", /* must not be priorly locked */ 0)
+1
+insert into t1 (c) values (2);
+select get_lock("lock_bug26141_sync", 1000);
+get_lock("lock_bug26141_sync", 1000)
+1
+update t1 set c=3 where c=1;
+select release_lock("lock_bug26141_sync");
+release_lock("lock_bug26141_sync")
+1
+select release_lock("lock_bug26141_wait");
+release_lock("lock_bug26141_wait")
+1
+select * from t1;
+c
+2
+3
+select * from t2;
+c
+1
+select * from t3;
+c
+1
+drop table t1, t2, t3;
+End of 5.0 tests
diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result
index c24f7b6b06f..189722bfe9b 100644
--- a/mysql-test/r/trigger.result
+++ b/mysql-test/r/trigger.result
@@ -351,7 +351,7 @@ create trigger trg1 before insert on mysqltest.t1 for each row set @a:= 1;
ERROR HY000: Trigger in wrong schema
use mysqltest;
create trigger test.trg1 before insert on t1 for each row set @a:= 1;
-ERROR HY000: Trigger in wrong schema
+ERROR 42S02: Table 'test.t1' doesn't exist
drop database mysqltest;
use test;
create table t1 (i int, j int default 10, k int not null, key (k));
@@ -600,9 +600,9 @@ select @a;
@a
10
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
-t1_bi INSERT t1 set new."t1 column" = 5 BEFORE # REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI root@localhost
-t1_af INSERT t1 set @a=10 AFTER # root@localhost
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+t1_bi INSERT t1 set new."t1 column" = 5 BEFORE # REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+t1_af INSERT t1 set @a=10 AFTER # root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
drop table t1;
set sql_mode="traditional";
create table t1 (a date);
@@ -622,8 +622,8 @@ t1 CREATE TABLE `t1` (
`a` date DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
-t1_bi INSERT t1 set new.a = '2004-01-00' BEFORE # root@localhost
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+t1_bi INSERT t1 set new.a = '2004-01-00' BEFORE # root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
drop table t1;
create table t1 (id int);
create trigger t1_ai after insert on t1 for each row reset query cache;
@@ -820,9 +820,9 @@ call p1();
drop trigger t1_bi;
create trigger t1_bi after insert on t1 for each row insert into t3 values (new.id);
execute stmt1;
-ERROR HY000: Table 't3' was not locked with LOCK TABLES
+ERROR 42S02: Table 'test.t3' doesn't exist
call p1();
-ERROR HY000: Table 't3' was not locked with LOCK TABLES
+ERROR 42S02: Table 'test.t3' doesn't exist
deallocate prepare stmt1;
drop procedure p1;
drop table t1, t2, t3;
@@ -842,7 +842,7 @@ drop table t1;
create trigger t1_bi before insert on test.t1 for each row set @a:=0;
ERROR 3D000: No database selected
create trigger test.t1_bi before insert on t1 for each row set @a:=0;
-ERROR 3D000: No database selected
+ERROR 42S02: Table 'test.t1' doesn't exist
drop trigger t1_bi;
ERROR 3D000: No database selected
create table t1 (id int);
@@ -1414,4 +1414,567 @@ id val
DROP TRIGGER trg27006_a_insert;
DROP TRIGGER trg27006_a_update;
drop table t1,t2;
+drop table if exists t1, t2, t3;
+create table t1 (i int);
+create trigger t1_bi before insert on t1 for each row set new.i = 7;
+create trigger t1_ai after insert on t1 for each row set @a := 7;
+create table t2 (j int);
+insert into t2 values (1), (2);
+set @a:="";
+create table if not exists t1 select * from t2;
+Warnings:
+Note 1050 Table 't1' already exists
+select * from t1;
+i
+7
+7
+select @a;
+@a
+7
+drop trigger t1_bi;
+drop trigger t1_ai;
+create table t3 (isave int);
+create trigger t1_bi before insert on t1 for each row insert into t3 values (new.i);
+create table if not exists t1 select * from t2;
+Warnings:
+Note 1050 Table 't1' already exists
+select * from t1;
+i
+7
+7
+1
+2
+select * from t3;
+isave
+1
+2
+drop table t1, t2, t3;
+CREATE TABLE t1 (id INTEGER);
+CREATE TABLE t2 (id INTEGER);
+INSERT INTO t2 VALUES (1),(2);
+CREATE TRIGGER t1_test AFTER INSERT ON t1 FOR EACH ROW
+INSERT INTO t2 VALUES (new.id);
+SELECT GET_LOCK('B26162',120);
+GET_LOCK('B26162',120)
+1
+SELECT 'rl_acquirer', GET_LOCK('B26162',120), id FROM t2 WHERE id = 1;
+SET SESSION LOW_PRIORITY_UPDATES=1;
+SET GLOBAL LOW_PRIORITY_UPDATES=1;
+INSERT INTO t1 VALUES (5);
+SELECT 'rl_contender', id FROM t2 WHERE id > 1;
+SELECT RELEASE_LOCK('B26162');
+RELEASE_LOCK('B26162')
+1
+rl_acquirer GET_LOCK('B26162',120) id
+rl_acquirer 1 1
+SELECT RELEASE_LOCK('B26162');
+RELEASE_LOCK('B26162')
+1
+rl_contender id
+rl_contender 2
+DROP TRIGGER t1_test;
+DROP TABLE t1,t2;
+SET SESSION LOW_PRIORITY_UPDATES=DEFAULT;
+SET GLOBAL LOW_PRIORITY_UPDATES=DEFAULT;
+
+Bug#28502 Triggers that update another innodb table will block
+on X lock unnecessarily
+
+Ensure we do not open and lock tables for triggers we do not fire.
+
+drop table if exists t1, t2;
+drop trigger if exists trg_bug28502_au;
+create table t1 (id int, count int);
+create table t2 (id int);
+create trigger trg_bug28502_au before update on t2
+for each row
+begin
+if (new.id is not null) then
+update t1 set count= count + 1 where id = old.id;
+end if;
+end|
+insert into t1 (id, count) values (1, 0);
+lock table t1 write;
+insert into t2 set id=1;
+unlock tables;
+update t2 set id=1 where id=1;
+select * from t1;
+id count
+1 1
+select * from t2;
+id
+1
+drop table t1, t2;
+
+Additionally, provide test coverage for triggers and
+all MySQL data changing commands.
+
+drop table if exists t1, t2, t1_op_log;
+drop view if exists v1;
+drop trigger if exists trg_bug28502_bi;
+drop trigger if exists trg_bug28502_ai;
+drop trigger if exists trg_bug28502_bu;
+drop trigger if exists trg_bug28502_au;
+drop trigger if exists trg_bug28502_bd;
+drop trigger if exists trg_bug28502_ad;
+create table t1 (id int primary key auto_increment, operation varchar(255));
+create table t2 (id int primary key);
+create table t1_op_log(operation varchar(255));
+create view v1 as select * from t1;
+create trigger trg_bug28502_bi before insert on t1
+for each row
+insert into t1_op_log (operation)
+values (concat("Before INSERT, new=", new.operation));
+create trigger trg_bug28502_ai after insert on t1
+for each row
+insert into t1_op_log (operation)
+values (concat("After INSERT, new=", new.operation));
+create trigger trg_bug28502_bu before update on t1
+for each row
+insert into t1_op_log (operation)
+values (concat("Before UPDATE, new=", new.operation,
+", old=", old.operation));
+create trigger trg_bug28502_au after update on t1
+for each row
+insert into t1_op_log (operation)
+values (concat("After UPDATE, new=", new.operation,
+", old=", old.operation));
+create trigger trg_bug28502_bd before delete on t1
+for each row
+insert into t1_op_log (operation)
+values (concat("Before DELETE, old=", old.operation));
+create trigger trg_bug28502_ad after delete on t1
+for each row
+insert into t1_op_log (operation)
+values (concat("After DELETE, old=", old.operation));
+insert into t1 (operation) values ("INSERT");
+set @id=last_insert_id();
+select * from t1;
+id operation
+1 INSERT
+select * from t1_op_log;
+operation
+Before INSERT, new=INSERT
+After INSERT, new=INSERT
+truncate t1_op_log;
+update t1 set operation="UPDATE" where id=@id;
+select * from t1;
+id operation
+1 UPDATE
+select * from t1_op_log;
+operation
+Before UPDATE, new=UPDATE, old=INSERT
+After UPDATE, new=UPDATE, old=INSERT
+truncate t1_op_log;
+delete from t1 where id=@id;
+select * from t1;
+id operation
+select * from t1_op_log;
+operation
+Before DELETE, old=UPDATE
+After DELETE, old=UPDATE
+truncate t1;
+truncate t1_op_log;
+insert into t1 (id, operation) values
+(NULL, "INSERT ON DUPLICATE KEY UPDATE, inserting a new key")
+on duplicate key update id=NULL, operation="Should never happen";
+set @id=last_insert_id();
+select * from t1;
+id operation
+1 INSERT ON DUPLICATE KEY UPDATE, inserting a new key
+select * from t1_op_log;
+operation
+Before INSERT, new=INSERT ON DUPLICATE KEY UPDATE, inserting a new key
+After INSERT, new=INSERT ON DUPLICATE KEY UPDATE, inserting a new key
+truncate t1_op_log;
+insert into t1 (id, operation) values
+(@id, "INSERT ON DUPLICATE KEY UPDATE, the key value is the same")
+on duplicate key update id=NULL,
+operation="INSERT ON DUPLICATE KEY UPDATE, updating the duplicate";
+select * from t1;
+id operation
+0 INSERT ON DUPLICATE KEY UPDATE, updating the duplicate
+select * from t1_op_log;
+operation
+Before INSERT, new=INSERT ON DUPLICATE KEY UPDATE, the key value is the same
+Before UPDATE, new=INSERT ON DUPLICATE KEY UPDATE, updating the duplicate, old=INSERT ON DUPLICATE KEY UPDATE, inserting a new key
+After UPDATE, new=INSERT ON DUPLICATE KEY UPDATE, updating the duplicate, old=INSERT ON DUPLICATE KEY UPDATE, inserting a new key
+truncate t1;
+truncate t1_op_log;
+replace into t1 values (NULL, "REPLACE, inserting a new key");
+set @id=last_insert_id();
+select * from t1;
+id operation
+1 REPLACE, inserting a new key
+select * from t1_op_log;
+operation
+Before INSERT, new=REPLACE, inserting a new key
+After INSERT, new=REPLACE, inserting a new key
+truncate t1_op_log;
+replace into t1 values (@id, "REPLACE, deleting the duplicate");
+select * from t1;
+id operation
+1 REPLACE, deleting the duplicate
+select * from t1_op_log;
+operation
+Before INSERT, new=REPLACE, deleting the duplicate
+Before DELETE, old=REPLACE, inserting a new key
+After DELETE, old=REPLACE, inserting a new key
+After INSERT, new=REPLACE, deleting the duplicate
+truncate t1;
+truncate t1_op_log;
+create table if not exists t1
+select NULL, "CREATE TABLE ... SELECT, inserting a new key";
+Warnings:
+Note 1050 Table 't1' already exists
+set @id=last_insert_id();
+select * from t1;
+id operation
+1 CREATE TABLE ... SELECT, inserting a new key
+select * from t1_op_log;
+operation
+Before INSERT, new=CREATE TABLE ... SELECT, inserting a new key
+After INSERT, new=CREATE TABLE ... SELECT, inserting a new key
+truncate t1_op_log;
+create table if not exists t1 replace
+select @id, "CREATE TABLE ... REPLACE SELECT, deleting a duplicate key";
+Warnings:
+Note 1050 Table 't1' already exists
+select * from t1;
+id operation
+1 CREATE TABLE ... REPLACE SELECT, deleting a duplicate key
+select * from t1_op_log;
+operation
+Before INSERT, new=CREATE TABLE ... REPLACE SELECT, deleting a duplicate key
+Before DELETE, old=CREATE TABLE ... SELECT, inserting a new key
+After DELETE, old=CREATE TABLE ... SELECT, inserting a new key
+After INSERT, new=CREATE TABLE ... REPLACE SELECT, deleting a duplicate key
+truncate t1;
+truncate t1_op_log;
+insert into t1 (id, operation)
+select NULL, "INSERT ... SELECT, inserting a new key";
+set @id=last_insert_id();
+select * from t1;
+id operation
+1 INSERT ... SELECT, inserting a new key
+select * from t1_op_log;
+operation
+Before INSERT, new=INSERT ... SELECT, inserting a new key
+After INSERT, new=INSERT ... SELECT, inserting a new key
+truncate t1_op_log;
+insert into t1 (id, operation)
+select @id,
+"INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate"
+on duplicate key update id=NULL,
+operation="INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate";
+select * from t1;
+id operation
+0 INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate
+select * from t1_op_log;
+operation
+Before INSERT, new=INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate
+Before UPDATE, new=INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate, old=INSERT ... SELECT, inserting a new key
+After UPDATE, new=INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate, old=INSERT ... SELECT, inserting a new key
+truncate t1;
+truncate t1_op_log;
+replace into t1 (id, operation)
+select NULL, "REPLACE ... SELECT, inserting a new key";
+set @id=last_insert_id();
+select * from t1;
+id operation
+1 REPLACE ... SELECT, inserting a new key
+select * from t1_op_log;
+operation
+Before INSERT, new=REPLACE ... SELECT, inserting a new key
+After INSERT, new=REPLACE ... SELECT, inserting a new key
+truncate t1_op_log;
+replace into t1 (id, operation)
+select @id, "REPLACE ... SELECT, deleting a duplicate";
+select * from t1;
+id operation
+1 REPLACE ... SELECT, deleting a duplicate
+select * from t1_op_log;
+operation
+Before INSERT, new=REPLACE ... SELECT, deleting a duplicate
+Before DELETE, old=REPLACE ... SELECT, inserting a new key
+After DELETE, old=REPLACE ... SELECT, inserting a new key
+After INSERT, new=REPLACE ... SELECT, deleting a duplicate
+truncate t1;
+truncate t1_op_log;
+insert into t1 (id, operation) values (1, "INSERT for multi-DELETE");
+insert into t2 (id) values (1);
+delete t1.*, t2.* from t1, t2 where t1.id=1;
+select * from t1;
+id operation
+select * from t2;
+id
+select * from t1_op_log;
+operation
+Before INSERT, new=INSERT for multi-DELETE
+After INSERT, new=INSERT for multi-DELETE
+Before DELETE, old=INSERT for multi-DELETE
+After DELETE, old=INSERT for multi-DELETE
+truncate t1;
+truncate t2;
+truncate t1_op_log;
+insert into t1 (id, operation) values (1, "INSERT for multi-UPDATE");
+insert into t2 (id) values (1);
+update t1, t2 set t1.id=2, operation="multi-UPDATE" where t1.id=1;
+update t1, t2
+set t2.id=3, operation="multi-UPDATE, SET for t2, but the trigger is fired" where t1.id=2;
+select * from t1;
+id operation
+2 multi-UPDATE, SET for t2, but the trigger is fired
+select * from t2;
+id
+3
+select * from t1_op_log;
+operation
+Before INSERT, new=INSERT for multi-UPDATE
+After INSERT, new=INSERT for multi-UPDATE
+Before UPDATE, new=multi-UPDATE, old=INSERT for multi-UPDATE
+After UPDATE, new=multi-UPDATE, old=INSERT for multi-UPDATE
+Before UPDATE, new=multi-UPDATE, SET for t2, but the trigger is fired, old=multi-UPDATE
+After UPDATE, new=multi-UPDATE, SET for t2, but the trigger is fired, old=multi-UPDATE
+truncate table t1;
+truncate table t2;
+truncate table t1_op_log;
+
+Now do the same but use a view instead of the base table.
+
+insert into v1 (operation) values ("INSERT");
+set @id=last_insert_id();
+select * from t1;
+id operation
+1 INSERT
+select * from t1_op_log;
+operation
+Before INSERT, new=INSERT
+After INSERT, new=INSERT
+truncate t1_op_log;
+update v1 set operation="UPDATE" where id=@id;
+select * from t1;
+id operation
+1 UPDATE
+select * from t1_op_log;
+operation
+Before UPDATE, new=UPDATE, old=INSERT
+After UPDATE, new=UPDATE, old=INSERT
+truncate t1_op_log;
+delete from v1 where id=@id;
+select * from t1;
+id operation
+select * from t1_op_log;
+operation
+Before DELETE, old=UPDATE
+After DELETE, old=UPDATE
+truncate t1;
+truncate t1_op_log;
+insert into v1 (id, operation) values
+(NULL, "INSERT ON DUPLICATE KEY UPDATE, inserting a new key")
+on duplicate key update id=NULL, operation="Should never happen";
+set @id=last_insert_id();
+select * from t1;
+id operation
+1 INSERT ON DUPLICATE KEY UPDATE, inserting a new key
+select * from t1_op_log;
+operation
+Before INSERT, new=INSERT ON DUPLICATE KEY UPDATE, inserting a new key
+After INSERT, new=INSERT ON DUPLICATE KEY UPDATE, inserting a new key
+truncate t1_op_log;
+insert into v1 (id, operation) values
+(@id, "INSERT ON DUPLICATE KEY UPDATE, the key value is the same")
+on duplicate key update id=NULL,
+operation="INSERT ON DUPLICATE KEY UPDATE, updating the duplicate";
+select * from t1;
+id operation
+0 INSERT ON DUPLICATE KEY UPDATE, updating the duplicate
+select * from t1_op_log;
+operation
+Before INSERT, new=INSERT ON DUPLICATE KEY UPDATE, the key value is the same
+Before UPDATE, new=INSERT ON DUPLICATE KEY UPDATE, updating the duplicate, old=INSERT ON DUPLICATE KEY UPDATE, inserting a new key
+After UPDATE, new=INSERT ON DUPLICATE KEY UPDATE, updating the duplicate, old=INSERT ON DUPLICATE KEY UPDATE, inserting a new key
+truncate t1;
+truncate t1_op_log;
+replace into v1 values (NULL, "REPLACE, inserting a new key");
+set @id=last_insert_id();
+select * from t1;
+id operation
+1 REPLACE, inserting a new key
+select * from t1_op_log;
+operation
+Before INSERT, new=REPLACE, inserting a new key
+After INSERT, new=REPLACE, inserting a new key
+truncate t1_op_log;
+replace into v1 values (@id, "REPLACE, deleting the duplicate");
+select * from t1;
+id operation
+1 REPLACE, deleting the duplicate
+select * from t1_op_log;
+operation
+Before INSERT, new=REPLACE, deleting the duplicate
+Before DELETE, old=REPLACE, inserting a new key
+After DELETE, old=REPLACE, inserting a new key
+After INSERT, new=REPLACE, deleting the duplicate
+truncate t1;
+truncate t1_op_log;
+create table if not exists v1
+select NULL, "CREATE TABLE ... SELECT, inserting a new key";
+Warnings:
+Note 1050 Table 'v1' already exists
+set @id=last_insert_id();
+select * from t1;
+id operation
+1 CREATE TABLE ... SELECT, inserting a new key
+select * from t1_op_log;
+operation
+Before INSERT, new=CREATE TABLE ... SELECT, inserting a new key
+After INSERT, new=CREATE TABLE ... SELECT, inserting a new key
+truncate t1_op_log;
+create table if not exists v1 replace
+select @id, "CREATE TABLE ... REPLACE SELECT, deleting a duplicate key";
+Warnings:
+Note 1050 Table 'v1' already exists
+select * from t1;
+id operation
+1 CREATE TABLE ... REPLACE SELECT, deleting a duplicate key
+select * from t1_op_log;
+operation
+Before INSERT, new=CREATE TABLE ... REPLACE SELECT, deleting a duplicate key
+Before DELETE, old=CREATE TABLE ... SELECT, inserting a new key
+After DELETE, old=CREATE TABLE ... SELECT, inserting a new key
+After INSERT, new=CREATE TABLE ... REPLACE SELECT, deleting a duplicate key
+truncate t1;
+truncate t1_op_log;
+insert into v1 (id, operation)
+select NULL, "INSERT ... SELECT, inserting a new key";
+set @id=last_insert_id();
+select * from t1;
+id operation
+1 INSERT ... SELECT, inserting a new key
+select * from t1_op_log;
+operation
+Before INSERT, new=INSERT ... SELECT, inserting a new key
+After INSERT, new=INSERT ... SELECT, inserting a new key
+truncate t1_op_log;
+insert into v1 (id, operation)
+select @id,
+"INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate"
+on duplicate key update id=NULL,
+operation="INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate";
+select * from t1;
+id operation
+0 INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate
+select * from t1_op_log;
+operation
+Before INSERT, new=INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate
+Before UPDATE, new=INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate, old=INSERT ... SELECT, inserting a new key
+After UPDATE, new=INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate, old=INSERT ... SELECT, inserting a new key
+truncate t1;
+truncate t1_op_log;
+replace into v1 (id, operation)
+select NULL, "REPLACE ... SELECT, inserting a new key";
+set @id=last_insert_id();
+select * from t1;
+id operation
+1 REPLACE ... SELECT, inserting a new key
+select * from t1_op_log;
+operation
+Before INSERT, new=REPLACE ... SELECT, inserting a new key
+After INSERT, new=REPLACE ... SELECT, inserting a new key
+truncate t1_op_log;
+replace into v1 (id, operation)
+select @id, "REPLACE ... SELECT, deleting a duplicate";
+select * from t1;
+id operation
+1 REPLACE ... SELECT, deleting a duplicate
+select * from t1_op_log;
+operation
+Before INSERT, new=REPLACE ... SELECT, deleting a duplicate
+Before DELETE, old=REPLACE ... SELECT, inserting a new key
+After DELETE, old=REPLACE ... SELECT, inserting a new key
+After INSERT, new=REPLACE ... SELECT, deleting a duplicate
+truncate t1;
+truncate t1_op_log;
+insert into v1 (id, operation) values (1, "INSERT for multi-DELETE");
+insert into t2 (id) values (1);
+delete v1.*, t2.* from v1, t2 where v1.id=1;
+select * from t1;
+id operation
+select * from t2;
+id
+select * from t1_op_log;
+operation
+Before INSERT, new=INSERT for multi-DELETE
+After INSERT, new=INSERT for multi-DELETE
+Before DELETE, old=INSERT for multi-DELETE
+After DELETE, old=INSERT for multi-DELETE
+truncate t1;
+truncate t2;
+truncate t1_op_log;
+insert into v1 (id, operation) values (1, "INSERT for multi-UPDATE");
+insert into t2 (id) values (1);
+update v1, t2 set v1.id=2, operation="multi-UPDATE" where v1.id=1;
+update v1, t2
+set t2.id=3, operation="multi-UPDATE, SET for t2, but the trigger is fired" where v1.id=2;
+select * from t1;
+id operation
+2 multi-UPDATE, SET for t2, but the trigger is fired
+select * from t2;
+id
+3
+select * from t1_op_log;
+operation
+Before INSERT, new=INSERT for multi-UPDATE
+After INSERT, new=INSERT for multi-UPDATE
+Before UPDATE, new=multi-UPDATE, old=INSERT for multi-UPDATE
+After UPDATE, new=multi-UPDATE, old=INSERT for multi-UPDATE
+Before UPDATE, new=multi-UPDATE, SET for t2, but the trigger is fired, old=multi-UPDATE
+After UPDATE, new=multi-UPDATE, SET for t2, but the trigger is fired, old=multi-UPDATE
+drop view v1;
+drop table t1, t2, t1_op_log;
+
+Bug#27248 Triggers: error if insert affects temporary table
+
+The bug was fixed by the fix for Bug#26141
+
+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
+delete from t1;
+select * from t1;
+s1
+select * from t2;
+s1
+drop table t1;
+drop temporary table t2;
End of 5.0 tests
+drop table if exists table_25411_a;
+drop table if exists table_25411_b;
+create table table_25411_a(a int);
+create table table_25411_b(b int);
+create trigger trg_25411a_ai after insert on table_25411_a
+for each row
+insert into table_25411_b select new.*;
+select * from table_25411_a;
+a
+insert into table_25411_a values (1);
+ERROR 42S02: Unknown table 'new'
+select * from table_25411_a;
+a
+1
+drop table table_25411_a;
+drop table table_25411_b;
diff --git a/mysql-test/r/type_bit.result b/mysql-test/r/type_bit.result
index e1e51f9a469..dc8ab079ad8 100644
--- a/mysql-test/r/type_bit.result
+++ b/mysql-test/r/type_bit.result
@@ -618,4 +618,84 @@ bit_field int_field
 2
handler t1 close;
drop table t1;
+CREATE TABLE t1 (b BIT(2), a VARCHAR(5));
+INSERT INTO t1 (b, a) VALUES (1, "x"), (3, "zz"), (0, "y"), (3, "z");
+SELECT b+0, COUNT(DISTINCT a) FROM t1 GROUP BY b;
+b+0 COUNT(DISTINCT a)
+0 1
+1 1
+3 2
+DROP TABLE t1;
+CREATE TABLE t1 (a CHAR(5), b BIT(2));
+INSERT INTO t1 (b, a) VALUES (1, "x"), (3, "zz"), (0, "y"), (3, "z");
+SELECT b+0, COUNT(DISTINCT a) FROM t1 GROUP BY b;
+b+0 COUNT(DISTINCT a)
+0 1
+1 1
+3 2
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, b BIT(2));
+INSERT INTO t1 (b, a) VALUES (1, 1), (3, 2), (0, 3), (3, 4);
+SELECT b+0, COUNT(DISTINCT a) FROM t1 GROUP BY b;
+b+0 COUNT(DISTINCT a)
+0 1
+1 1
+3 2
+DROP TABLE t1;
+CREATE TABLE t1 (b BIT);
+INSERT INTO t1 (b) VALUES (1), (0);
+SELECT DISTINCT b FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 b b 16 1 1 Y 32 0 63
+b
+#
+#
+SELECT b FROM t1 GROUP BY b;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 b b 16 1 1 Y 32 0 63
+b
+#
+#
+DROP TABLE t1;
+CREATE TABLE t1 (a int, b bit(2));
+INSERT INTO t1 VALUES (3, 2), (2, 3), (2, 0), (3, 2), (3, 1);
+SELECT COUNT(DISTINCT b) FROM t1 GROUP BY a;
+COUNT(DISTINCT b)
+2
+2
+DROP TABLE t1;
+create table t2 (a int, b bit(2), c char(10));
+INSERT INTO t2 VALUES (3, 2, 'two'), (2, 3, 'three'), (2, 0, 'zero'),
+(3, 2, 'two'), (3, 1, 'one');
+SELECT COUNT(DISTINCT b,c) FROM t2 GROUP BY a;
+COUNT(DISTINCT b,c)
+2
+2
+DROP TABLE t2;
End of 5.0 tests
+create table t1(a bit(7));
+insert into t1 values(0x40);
+alter table t1 modify column a bit(8);
+select hex(a) from t1;
+hex(a)
+40
+insert into t1 values(0x80);
+select hex(a) from t1;
+hex(a)
+40
+80
+create index a on t1(a);
+insert into t1 values(0x81);
+select hex(a) from t1;
+hex(a)
+40
+80
+81
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` bit(8) DEFAULT NULL,
+ KEY `a` (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+End of 5.1 tests
diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result
index 6d5218873ce..d6a01727813 100644
--- a/mysql-test/r/type_date.result
+++ b/mysql-test/r/type_date.result
@@ -110,15 +110,24 @@ select 1 from t1 where cast('2000-01-01 12:01:01' as datetime) between start_dat
1
1
drop table t1;
-select @d:=1111, year(@d), month(@d), day(@d), cast(@d as date);
-@d:=1111 year(@d) month(@d) day(@d) cast(@d as date)
-1111 2000 11 11 2000-11-11
-select @d:=011111, year(@d), month(@d), day(@d), cast(@d as date);
-@d:=011111 year(@d) month(@d) day(@d) cast(@d as date)
-11111 2001 11 11 2001-11-11
-select @d:=1311, year(@d), month(@d), day(@d), cast(@d as date);
-@d:=1311 year(@d) month(@d) day(@d) cast(@d as date)
-1311 NULL NULL NULL NULL
+select @d:=1111;
+@d:=1111
+1111
+select year(@d), month(@d), day(@d), cast(@d as date);
+year(@d) month(@d) day(@d) cast(@d as date)
+2000 11 11 2000-11-11
+select @d:=011111;
+@d:=011111
+11111
+select year(@d), month(@d), day(@d), cast(@d as date);
+year(@d) month(@d) day(@d) cast(@d as date)
+2001 11 11 2001-11-11
+select @d:=1311;
+@d:=1311
+1311
+select year(@d), month(@d), day(@d), cast(@d as date);
+year(@d) month(@d) day(@d) cast(@d as date)
+NULL NULL NULL NULL
Warnings:
Warning 1292 Incorrect datetime value: '1311'
Warning 1292 Incorrect datetime value: '1311'
diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result
index b12d3cbde79..ffe4bac142d 100644
--- a/mysql-test/r/type_datetime.result
+++ b/mysql-test/r/type_datetime.result
@@ -192,6 +192,41 @@ CAST(CAST('2006-08-10 10:11:12' AS DATETIME) + INTERVAL 14 MICROSECOND AS DECIMA
SELECT CAST(CAST('10:11:12.098700' AS TIME) AS DECIMAL(20,6));
CAST(CAST('10:11:12.098700' AS TIME) AS DECIMAL(20,6))
101112.098700
+set @org_mode=@@sql_mode;
+create table t1 (da date default '1962-03-03 23:33:34', dt datetime default '1962-03-03');
+Warnings:
+Note 1265 Data truncated for column 'da' at row 1
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `da` date DEFAULT '1962-03-03',
+ `dt` datetime DEFAULT '1962-03-03 00:00:00'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into t1 values ();
+insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38');
+Warnings:
+Note 1265 Data truncated for column 'da' at row 1
+set @@sql_mode='ansi,traditional';
+insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38');
+Warnings:
+Note 1265 Data truncated for column 'da' at row 1
+insert into t1 set dt='2007-03-23 13:49:38',da=dt;
+Warnings:
+Note 1265 Data truncated for column 'da' at row 1
+insert into t1 values ('2007-03-32','2007-03-23 13:49:38');
+ERROR 22007: Incorrect date value: '2007-03-32' for column 'da' at row 1
+select * from t1;
+da dt
+1962-03-03 1962-03-03 00:00:00
+2007-03-23 2007-03-23 13:49:38
+2007-03-23 2007-03-23 13:49:38
+2007-03-23 2007-03-23 13:49:38
+drop table t1;
+create table t1 (da date default '1962-03-32 23:33:34', dt datetime default '1962-03-03');
+ERROR 42000: Invalid default value for 'da'
+create table t1 (t time default '916:00:00 a');
+ERROR 42000: Invalid default value for 't'
+set @@sql_mode= @org_mode;
create table t1 (f1 date, f2 datetime, f3 timestamp);
insert into t1(f1) values(curdate());
select curdate() < now(), f1 < now(), cast(f1 as date) < now() from t1;
@@ -264,6 +299,52 @@ f2
SELECT 1 from dual where NOW() BETWEEN CURRENT_DATE() - INTERVAL 1 DAY AND CURRENT_DATE();
1
drop table t1;
+create table t1 (f1 date);
+insert into t1 values('01-01-01'),('01-01-02'),('01-01-03');
+select * from t1 where f1 in ('01-01-01','2001-01-02','2001-01-03 00:00:00');
+f1
+2001-01-01
+2001-01-02
+2001-01-03
+create table t2(f2 datetime);
+insert into t2 values('01-01-01 00:00:00'),('01-02-03 12:34:56'),('02-04-06 11:22:33');
+select * from t2 where f2 in ('01-01-01','01-02-03 12:34:56','01-02-03');
+f2
+2001-01-01 00:00:00
+2001-02-03 12:34:56
+select * from t1,t2 where '01-01-02' in (f1, cast(f2 as date));
+f1 f2
+2001-01-02 2001-01-01 00:00:00
+2001-01-02 2001-02-03 12:34:56
+2001-01-02 2002-04-06 11:22:33
+select * from t1,t2 where '01-01-01' in (f1, '01-02-03');
+f1 f2
+2001-01-01 2001-01-01 00:00:00
+2001-01-01 2001-02-03 12:34:56
+2001-01-01 2002-04-06 11:22:33
+select * from t1,t2 where if(1,'01-02-03 12:34:56','') in (f1, f2);
+f1 f2
+2001-01-01 2001-02-03 12:34:56
+2001-01-02 2001-02-03 12:34:56
+2001-01-03 2001-02-03 12:34:56
+create table t3(f3 varchar(20));
+insert into t3 select * from t2;
+select * from t2,t3 where f2 in (f3,'03-04-05');
+f2 f3
+2001-01-01 00:00:00 2001-01-01 00:00:00
+2001-02-03 12:34:56 2001-02-03 12:34:56
+2002-04-06 11:22:33 2002-04-06 11:22:33
+select f1,f2,f3 from t1,t2,t3 where (f1,'1') in ((f2,'1'),(f3,'1'));
+f1 f2 f3
+2001-01-01 2001-01-01 00:00:00 2001-01-01 00:00:00
+2001-01-01 2001-02-03 12:34:56 2001-01-01 00:00:00
+2001-01-01 2002-04-06 11:22:33 2001-01-01 00:00:00
+2001-01-01 2001-01-01 00:00:00 2001-02-03 12:34:56
+2001-01-01 2001-01-01 00:00:00 2002-04-06 11:22:33
+select f1 from t1 where ('1',f1) in (('1','01-01-01'),('1','2001-1-1 0:0:0'),('1','02-02-02'));
+f1
+2001-01-01
+drop table t1,t2,t3;
select least(cast('01-01-01' as date), '01-01-02');
least(cast('01-01-01' as date), '01-01-02')
2001-01-01
@@ -279,6 +360,12 @@ greatest(cast('01-01-01' as date), '01-01-02') + 0
select least(cast('01-01-01' as datetime), '01-01-02') + 0;
least(cast('01-01-01' as datetime), '01-01-02') + 0
20010101000000
+select cast(least(cast('01-01-01' as datetime), '01-01-02') as signed);
+cast(least(cast('01-01-01' as datetime), '01-01-02') as signed)
+20010101000000
+select cast(least(cast('01-01-01' as datetime), '01-01-02') as decimal(16,2));
+cast(least(cast('01-01-01' as datetime), '01-01-02') as decimal(16,2))
+20010101000000.00
DROP PROCEDURE IF EXISTS test27759 ;
CREATE PROCEDURE test27759()
BEGIN
@@ -294,6 +381,52 @@ call test27759();
a b a_then_b b_then_a c_then_a
2007-04-10 2007-04-11 2007-04-10 2007-04-10 2004-04-09 00:00:00
drop procedure test27759;
+create table t1 (f1 date);
+insert into t1 values (curdate());
+select left(f1,10) = curdate() from t1;
+left(f1,10) = curdate()
+1
+drop table t1;
+create table t1(f1 date);
+insert into t1 values('01-01-01'),('02-02-02'),('01-01-01'),('02-02-02');
+set @bug28261='';
+select if(@bug28261 = f1, '', @bug28261:= f1) from t1;
+if(@bug28261 = f1, '', @bug28261:= f1)
+2001-01-01
+2002-02-02
+2001-01-01
+2002-02-02
+Warnings:
+Warning 1292 Incorrect date value: '' for column 'f1' at row 1
+select if(@bug28261 = f1, '', @bug28261:= f1) from t1;
+if(@bug28261 = f1, '', @bug28261:= f1)
+2001-01-01
+2002-02-02
+2001-01-01
+2002-02-02
+select if(@bug28261 = f1, '', @bug28261:= f1) from t1;
+if(@bug28261 = f1, '', @bug28261:= f1)
+2001-01-01
+2002-02-02
+2001-01-01
+2002-02-02
+drop table t1;
+create table t1(f1 datetime);
+insert into t1 values('2001-01-01'),('2002-02-02');
+select * from t1 where f1 between 20020101 and 20070101000000;
+f1
+2002-02-02 00:00:00
+select * from t1 where f1 between 2002010 and 20070101000000;
+f1
+2001-01-01 00:00:00
+2002-02-02 00:00:00
+Warnings:
+Warning 1292 Incorrect datetime value: '2002010' for column 'f1' at row 1
+select * from t1 where f1 between 20020101 and 2007010100000;
+f1
+Warnings:
+Warning 1292 Incorrect datetime value: '2007010100000' for column 'f1' at row 1
+drop table t1;
set @org_mode=@@sql_mode;
create table t1 (da date default '1962-03-03 23:33:34', dt datetime default '1962-03-03');
Warnings:
diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result
index dfbd6619436..efac8cbe580 100644
--- a/mysql-test/r/type_decimal.result
+++ b/mysql-test/r/type_decimal.result
@@ -790,3 +790,12 @@ Warning 1292 Incorrect datetime value: '0000-00-00'
Warning 1292 Incorrect datetime value: '0000-00-00'
Warning 1292 Incorrect datetime value: '0000-00-00'
drop table t1;
+CREATE TABLE t1 (
+qty decimal(16,6) default NULL,
+dps tinyint(3) unsigned default NULL
+);
+INSERT INTO t1 VALUES (1.1325,3);
+SELECT ROUND(qty,3), dps, ROUND(qty,dps) FROM t1;
+ROUND(qty,3) dps ROUND(qty,dps)
+1.133 3 1.133
+DROP TABLE t1;
diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result
index 70ef98af420..813f912c5af 100644
--- a/mysql-test/r/type_enum.result
+++ b/mysql-test/r/type_enum.result
@@ -1675,7 +1675,7 @@ t1 CREATE TABLE `t1` (
show columns from t1;
Field Type Null Key Default Extra
a int(11) YES 1
-b enum('value','öäü_value','ÊÃÕ') NO
+b enum('value','öäü_value','ÊÃÕ') NO NULL
drop table t1;
CREATE TABLE t1 (c enum('a', 'A') BINARY);
INSERT INTO t1 VALUES ('a'),('A');
@@ -1754,7 +1754,6 @@ t1 CREATE TABLE `t1` (
`f2` enum('ÿÿ') DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
-End of 4.1 tests
create table t1(russian enum('E','F','EÿF','FÿE') NOT NULL DEFAULT'E');
show create table t1;
Table Create Table
@@ -1779,4 +1778,79 @@ drop table t1;
create table t1(exhausting_charset enum('ABCDEFGHIJKLMNOPQRSTUVWXYZ','
 !"','#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~','xx\','yy\€','zz‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ'));
ERROR 42000: Field separator argument is not what is expected; check the manual
+CREATE TABLE t1 (
+id INT AUTO_INCREMENT PRIMARY KEY,
+c1 ENUM('a', '', 'b')
+);
+INSERT INTO t1 (c1) VALUES (0), ('a'), (''), ('b');
+Warnings:
+Warning 1265 Data truncated for column 'c1' at row 1
+SELECT id, c1 + 0, c1 FROM t1;
+id c1 + 0 c1
+1 0
+2 1 a
+3 2
+4 3 b
+ALTER TABLE t1 CHANGE c1 c1 ENUM('a', '') NOT NULL;
+Warnings:
+Warning 1265 Data truncated for column 'c1' at row 4
+SELECT id, c1 + 0, c1 FROM t1;
+id c1 + 0 c1
+1 0
+2 1 a
+3 2
+4 0
+DROP TABLE t1;
+End of 4.1 tests
+create table t1(f1 set('a','b'), index(f1));
+insert into t1 values(''),(''),('a'),('b');
+select * from t1 where f1='';
+f1
+
+
+drop table t1;
+CREATE TABLE t1 (c1 ENUM('a', '', 'b'));
+INSERT INTO t1 (c1) VALUES ('b');
+INSERT INTO t1 (c1) VALUES ('');
+INSERT INTO t1 (c1) VALUES (0);
+Warnings:
+Warning 1265 Data truncated for column 'c1' at row 1
+INSERT INTO t1 (c1) VALUES ('');
+SELECT c1 + 0, COUNT(c1) FROM t1 GROUP BY c1;
+c1 + 0 COUNT(c1)
+0 1
+2 2
+3 1
+CREATE TABLE t2 SELECT * FROM t1;
+SELECT c1 + 0 FROM t2;
+c1 + 0
+3
+2
+0
+2
+DROP TABLE t1,t2;
+CREATE TABLE t1(a enum('a','b','c','d'));
+INSERT INTO t1 VALUES (4),(1),(0),(3);
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 3
+SELECT a FROM t1;
+a
+d
+a
+
+c
+EXPLAIN SELECT a FROM t1 WHERE a=0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
+SELECT a FROM t1 WHERE a=0;
+a
+
+ALTER TABLE t1 ADD PRIMARY KEY (a);
+EXPLAIN SELECT a FROM t1 WHERE a=0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 const PRIMARY PRIMARY 1 const 1 Using index
+SELECT a FROM t1 WHERE a=0;
+a
+
+DROP TABLE t1;
End of 5.1 tests
diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result
index ac1270d33a0..33ad3928835 100644
--- a/mysql-test/r/type_float.result
+++ b/mysql-test/r/type_float.result
@@ -344,3 +344,36 @@ create table t1 (s1 float(0,2));
ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 's1').
create table t1 (s1 float(1,2));
ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 's1').
+create table t1 (f1 double(200, 0));
+insert into t1 values (1e199), (-1e199);
+insert into t1 values (1e200), (-1e200);
+insert into t1 values (2e200), (-2e200);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 2
+select f1 + 0e0 from t1;
+f1 + 0e0
+1e+199
+-1e+199
+1e+200
+-1e+200
+1e+200
+-1e+200
+drop table t1;
+create table t1 (f1 float(30, 0));
+insert into t1 values (1e29), (-1e29);
+insert into t1 values (1e30), (-1e30);
+insert into t1 values (2e30), (-2e30);
+Warnings:
+Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 2
+select f1 + 0e0 from t1;
+f1 + 0e0
+1.0000000150475e+29
+-1.0000000150475e+29
+1.0000000150475e+30
+-1.0000000150475e+30
+1.0000000150475e+30
+-1.0000000150475e+30
+drop table t1;
+End of 5.0 tests
diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result
index 04baa03ce4d..24be10a7a29 100644
--- a/mysql-test/r/type_newdecimal.result
+++ b/mysql-test/r/type_newdecimal.result
@@ -1440,6 +1440,75 @@ select * from t1;
a
123456789012345678
drop table t1;
+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
+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
+select cast(a as DECIMAL(3,2))
+from (select 11.1233 as a
+UNION select 11.1234
+UNION select 12.1234
+) t;
+cast(a as DECIMAL(3,2))
+9.99
+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
+select cast(a as DECIMAL(3,2)), count(*)
+from (select 11.1233 as a
+UNION select 11.1234
+UNION select 12.1234
+) t group by 1;
+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
+create table t1 (s varchar(100));
+insert into t1 values (0.00000000010000000000000000364321973154977415791655470655996396089904010295867919921875);
+drop table t1;
+SELECT 1.000000000000 * 99.999999999998 / 100 a,1.000000000000 * (99.999999999998 / 100) b;
+a b
+0.9999999999999800000000000000 0.9999999999999800000000000000
+SELECT CAST(1 AS decimal(65,10));
+CAST(1 AS decimal(65,10))
+1.0000000000
+SELECT CAST(1 AS decimal(66,10));
+ERROR 42000: Too big precision 66 specified for column '1'. Maximum is 65.
+SELECT CAST(1 AS decimal(65,30));
+CAST(1 AS decimal(65,30))
+1.000000000000000000000000000000
+SELECT CAST(1 AS decimal(65,31));
+ERROR 42000: Too big scale 31 specified for column '1'. Maximum is 30.
+CREATE TABLE t1 (a int DEFAULT NULL, b int DEFAULT NULL);
+INSERT INTO t1 VALUES (3,30), (1,10), (2,10);
+SELECT a+CAST(1 AS decimal(65,30)) AS aa, SUM(b) FROM t1 GROUP BY aa;
+aa SUM(b)
+2.000000000000000000000000000000 10
+3.000000000000000000000000000000 10
+4.000000000000000000000000000000 30
+SELECT a+CAST(1 AS decimal(65,31)) AS aa, SUM(b) FROM t1 GROUP BY aa;
+ERROR 42000: Too big scale 31 specified for column '1'. Maximum is 30.
+DROP TABLE t1;
+CREATE TABLE t1 (a int DEFAULT NULL, b int DEFAULT NULL);
+INSERT INTO t1 VALUES (3,30), (1,10), (2,10);
+SET @a= CAST(1 AS decimal);
+SELECT 1 FROM t1 GROUP BY @b := @a, @b;
+1
+1
+1
+DROP TABLE t1;
End of 5.0 tests
select cast(143.481 as decimal(4,1));
cast(143.481 as decimal(4,1))
diff --git a/mysql-test/r/type_ranges.result b/mysql-test/r/type_ranges.result
index ce5bb9ceb2f..149f0d2dca5 100644
--- a/mysql-test/r/type_ranges.result
+++ b/mysql-test/r/type_ranges.result
@@ -63,9 +63,9 @@ time_field time NULL YES NULL #
date_time datetime NULL YES NULL #
blob_col blob NULL YES NULL #
tinyblob_col tinyblob NULL YES NULL #
-mediumblob_col mediumblob NULL NO #
-longblob_col longblob NULL NO #
-options enum('one','two','tree') latin1_swedish_ci NO MUL #
+mediumblob_col mediumblob NULL NO NULL #
+longblob_col longblob NULL NO NULL #
+options enum('one','two','tree') latin1_swedish_ci NO MUL NULL #
flags set('one','two','tree') latin1_swedish_ci NO #
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
@@ -208,17 +208,13 @@ options flags
one one
drop table t2;
create table t2 select * from t1;
-Warnings:
-Warning 1265 Data truncated for column 'options' at row 4
-Warning 1265 Data truncated for column 'options' at row 5
-Warning 1265 Data truncated for column 'options' at row 6
update t2 set string="changed" where auto=16;
show full columns from t1;
Field Type Collation Null Key Default Extra Privileges Comment
auto int(5) unsigned NULL NO MUL NULL auto_increment #
string char(10) latin1_swedish_ci YES newdefault #
tiny tinyint(4) NULL NO MUL 0 #
-short smallint(6) NULL NO MUL #
+short smallint(6) NULL NO MUL NULL #
medium mediumint(8) NULL NO MUL 0 #
long_int int(11) NULL NO 0 #
longlong bigint(13) NULL NO MUL 0 #
@@ -235,8 +231,8 @@ time_field time NULL YES NULL #
date_time datetime NULL YES NULL #
new_blob_col varchar(20) latin1_swedish_ci YES NULL #
tinyblob_col tinyblob NULL YES NULL #
-mediumblob_col mediumblob NULL NO #
-options enum('one','two','tree') latin1_swedish_ci NO MUL #
+mediumblob_col mediumblob NULL NO NULL #
+options enum('one','two','tree') latin1_swedish_ci NO MUL NULL #
flags set('one','two','tree') latin1_swedish_ci NO #
new_field char(10) latin1_swedish_ci NO new #
show full columns from t2;
@@ -244,7 +240,7 @@ Field Type Collation Null Key Default Extra Privileges Comment
auto int(5) unsigned NULL NO 0 #
string char(10) latin1_swedish_ci YES newdefault #
tiny tinyint(4) NULL NO 0 #
-short smallint(6) NULL NO #
+short smallint(6) NULL NO NULL #
medium mediumint(8) NULL NO 0 #
long_int int(11) NULL NO 0 #
longlong bigint(13) NULL NO 0 #
@@ -261,8 +257,8 @@ time_field time NULL YES NULL #
date_time datetime NULL YES NULL #
new_blob_col varchar(20) latin1_swedish_ci YES NULL #
tinyblob_col tinyblob NULL YES NULL #
-mediumblob_col mediumblob NULL NO #
-options enum('one','two','tree') latin1_swedish_ci NO #
+mediumblob_col mediumblob NULL NO NULL #
+options enum('one','two','tree') latin1_swedish_ci NO NULL #
flags set('one','two','tree') latin1_swedish_ci NO #
new_field char(10) latin1_swedish_ci NO new #
select t1.auto,t2.auto from t1,t2 where t1.auto=t2.auto and ((t1.string<>t2.string and (t1.string is not null or t2.string is not null)) or (t1.tiny<>t2.tiny and (t1.tiny is not null or t2.tiny is not null)) or (t1.short<>t2.short and (t1.short is not null or t2.short is not null)) or (t1.medium<>t2.medium and (t1.medium is not null or t2.medium is not null)) or (t1.long_int<>t2.long_int and (t1.long_int is not null or t2.long_int is not null)) or (t1.longlong<>t2.longlong and (t1.longlong is not null or t2.longlong is not null)) or (t1.real_float<>t2.real_float and (t1.real_float is not null or t2.real_float is not null)) or (t1.real_double<>t2.real_double and (t1.real_double is not null or t2.real_double is not null)) or (t1.utiny<>t2.utiny and (t1.utiny is not null or t2.utiny is not null)) or (t1.ushort<>t2.ushort and (t1.ushort is not null or t2.ushort is not null)) or (t1.umedium<>t2.umedium and (t1.umedium is not null or t2.umedium is not null)) or (t1.ulong<>t2.ulong and (t1.ulong is not null or t2.ulong is not null)) or (t1.ulonglong<>t2.ulonglong and (t1.ulonglong is not null or t2.ulonglong is not null)) or (t1.time_stamp<>t2.time_stamp and (t1.time_stamp is not null or t2.time_stamp is not null)) or (t1.date_field<>t2.date_field and (t1.date_field is not null or t2.date_field is not null)) or (t1.time_field<>t2.time_field and (t1.time_field is not null or t2.time_field is not null)) or (t1.date_time<>t2.date_time and (t1.date_time is not null or t2.date_time is not null)) or (t1.new_blob_col<>t2.new_blob_col and (t1.new_blob_col is not null or t2.new_blob_col is not null)) or (t1.tinyblob_col<>t2.tinyblob_col and (t1.tinyblob_col is not null or t2.tinyblob_col is not null)) or (t1.mediumblob_col<>t2.mediumblob_col and (t1.mediumblob_col is not null or t2.mediumblob_col is not null)) or (t1.options<>t2.options and (t1.options is not null or t2.options is not null)) or (t1.flags<>t2.flags and (t1.flags is not null or t2.flags is not null)) or (t1.new_field<>t2.new_field and (t1.new_field is not null or t2.new_field is not null)));
@@ -280,8 +276,8 @@ t1 int(1) NULL NO 0 #
t2 varchar(1) latin1_swedish_ci NO #
t3 varchar(256) latin1_swedish_ci NO #
t4 varbinary(256) NULL NO #
-t5 longtext latin1_swedish_ci NO #
-t6 longblob NULL NO #
+t5 longtext latin1_swedish_ci NO NULL #
+t6 longblob NULL NO NULL #
t7 char(0) latin1_swedish_ci NO #
t8 binary(0) NULL NO #
select t1,t2,length(t3),length(t4),length(t5),length(t6),t7,t8 from t2;
diff --git a/mysql-test/r/type_time.result b/mysql-test/r/type_time.result
index ce820c0cb8e..d80a3973555 100644
--- a/mysql-test/r/type_time.result
+++ b/mysql-test/r/type_time.result
@@ -85,3 +85,46 @@ sec_to_time(time_to_sec(t))
13:00:00
09:00:00
drop table t1;
+select cast('100:55:50' as time) < cast('24:00:00' as time);
+cast('100:55:50' as time) < cast('24:00:00' as time)
+0
+select cast('100:55:50' as time) < cast('024:00:00' as time);
+cast('100:55:50' as time) < cast('024:00:00' as time)
+0
+select cast('300:55:50' as time) < cast('240:00:00' as time);
+cast('300:55:50' as time) < cast('240:00:00' as time)
+0
+select cast('100:55:50' as time) > cast('24:00:00' as time);
+cast('100:55:50' as time) > cast('24:00:00' as time)
+1
+select cast('100:55:50' as time) > cast('024:00:00' as time);
+cast('100:55:50' as time) > cast('024:00:00' as time)
+1
+select cast('300:55:50' as time) > cast('240:00:00' as time);
+cast('300:55:50' as time) > cast('240:00:00' as time)
+1
+create table t1 (f1 time);
+insert into t1 values ('24:00:00');
+select cast('24:00:00' as time) = (select f1 from t1);
+cast('24:00:00' as time) = (select f1 from t1)
+1
+drop table t1;
+create table t1(f1 time, f2 time);
+insert into t1 values('20:00:00','150:00:00');
+select 1 from t1 where cast('100:00:00' as time) between f1 and f2;
+1
+1
+drop table t1;
+CREATE TABLE t1 (
+f2 date NOT NULL,
+f3 int(11) unsigned NOT NULL default '0',
+PRIMARY KEY (f3, f2)
+);
+insert into t1 values('2007-07-01', 1);
+insert into t1 values('2007-07-01', 2);
+insert into t1 values('2007-07-02', 1);
+insert into t1 values('2007-07-02', 2);
+SELECT sum(f3) FROM t1 where f2='2007-07-01 00:00:00' group by f2;
+sum(f3)
+3
+drop table t1;
diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result
index c075a199dae..7caf7e78fe9 100644
--- a/mysql-test/r/type_timestamp.result
+++ b/mysql-test/r/type_timestamp.result
@@ -101,13 +101,13 @@ create table t1 (t2 timestamp(2), t4 timestamp(4), t6 timestamp(6),
t8 timestamp(8), t10 timestamp(10), t12 timestamp(12),
t14 timestamp(14));
Warnings:
-Warning 1543 The syntax 'TIMESTAMP(2)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
-Warning 1543 The syntax 'TIMESTAMP(4)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
-Warning 1543 The syntax 'TIMESTAMP(6)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
-Warning 1543 The syntax 'TIMESTAMP(8)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
-Warning 1543 The syntax 'TIMESTAMP(10)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
-Warning 1543 The syntax 'TIMESTAMP(12)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
-Warning 1543 The syntax 'TIMESTAMP(14)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
+Warning 1287 The syntax 'TIMESTAMP(2)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
+Warning 1287 The syntax 'TIMESTAMP(4)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
+Warning 1287 The syntax 'TIMESTAMP(6)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
+Warning 1287 The syntax 'TIMESTAMP(8)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
+Warning 1287 The syntax 'TIMESTAMP(10)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
+Warning 1287 The syntax 'TIMESTAMP(12)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
+Warning 1287 The syntax 'TIMESTAMP(14)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
insert t1 values (0,0,0,0,0,0,0),
("1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59",
"1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59",
diff --git a/mysql-test/r/udf.result b/mysql-test/r/udf.result
index c7a9b0982a9..f1e47905f5d 100644
--- a/mysql-test/r/udf.result
+++ b/mysql-test/r/udf.result
@@ -311,4 +311,51 @@ drop function f3;
drop function metaphon;
drop function myfunc_double;
drop function myfunc_int;
+CREATE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
+create table t1 (a char);
+set GLOBAL query_cache_size=1355776;
+reset query cache;
+select metaphon('MySQL') from t1;
+metaphon('MySQL')
+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
+select metaphon('MySQL') from t1;
+metaphon('MySQL')
+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
+drop table t1;
+drop function metaphon;
+set GLOBAL query_cache_size=default;
+CREATE TABLE const_len_bug (
+str_const varchar(4000),
+result1 varchar(4000),
+result2 varchar(4000)
+);
+CREATE TRIGGER check_const_len_trigger BEFORE INSERT ON const_len_bug FOR EACH ROW BEGIN
+set NEW.str_const = 'bar';
+set NEW.result2 = check_const_len(NEW.str_const);
+END |
+CREATE PROCEDURE check_const_len_sp (IN str_const VARCHAR(4000))
+BEGIN
+DECLARE result VARCHAR(4000);
+SET result = check_const_len(str_const);
+insert into const_len_bug values(str_const, result, "");
+END |
+CREATE FUNCTION check_const_len RETURNS string SONAME "UDF_EXAMPLE_LIB";
+CALL check_const_len_sp("foo");
+SELECT * from const_len_bug;
+str_const result1 result2
+bar Correct length Correct length
+DROP FUNCTION check_const_len;
+DROP PROCEDURE check_const_len_sp;
+DROP TRIGGER check_const_len_trigger;
+DROP TABLE const_len_bug;
End of 5.0 tests.
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index acf237bf125..6fc630ec33c 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -499,8 +499,8 @@ a b
explain (select * from t1 where a=1 and b=10) union (select straight_join t1.a,t2.a from t1,t2 where t1.a=t2.a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
-2 UNION t1 index PRIMARY PRIMARY 4 NULL 4 Using index; Using join cache
-2 UNION t2 index PRIMARY PRIMARY 4 NULL 4 Using where; Using index
+2 UNION t1 index PRIMARY PRIMARY 4 NULL 4 Using index
+2 UNION t2 index PRIMARY PRIMARY 4 NULL 4 Using where; Using index; Using join buffer
NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
explain (select * from t1 where a=1) union (select * from t1 where b=1);
id select_type table type possible_keys key key_len ref rows Extra
diff --git a/mysql-test/r/unsafe_binlog_innodb.result b/mysql-test/r/unsafe_binlog_innodb.result
index 54a24a52d57..b2cf16ad58f 100644
--- a/mysql-test/r/unsafe_binlog_innodb.result
+++ b/mysql-test/r/unsafe_binlog_innodb.result
@@ -1,4 +1,4 @@
-drop table if exists t1,t2;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
create table t1 (id int not null, f_id int not null, f int not null,
primary key(f_id, id)) engine = InnoDB;
create table t2 (id int not null,s_id int not null,s varchar(200),
diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result
index 3a70dcddd24..6fd7b39f226 100644
--- a/mysql-test/r/user_var.result
+++ b/mysql-test/r/user_var.result
@@ -91,7 +91,7 @@ NULL test test
set @g=1;
select @g,(@g:=c),@g from t1;
@g (@g:=c) @g
-1 test test
+1 test 0
select @c, @d, @e, @f;
@c @d @e @f
1 1 2 test
@@ -317,3 +317,39 @@ SHOW COUNT(*) WARNINGS;
SHOW COUNT(*) ERRORS;
@@session.error_count
1
+create table t1(f1 int, f2 varchar(2), f3 float, f4 decimal(2,1));
+insert into t1 values
+(1, "a", 1.5, 1.6), (1, "a", 1.5, 1.6), (2, "b", 2.5, 2.6),
+(3, "c", 3.5, 3.6), (4, "d", 4.5, 4.6), (1, "a", 1.5, 1.6),
+(3, "c", 3.5, 3.6), (1, "a", 1.5, 1.6);
+select @a:=f1, count(f1) from t1 group by 1 desc;
+@a:=f1 count(f1)
+4 1
+3 2
+2 1
+1 4
+select @a:=f1, count(f1) from t1 group by 1 asc;
+@a:=f1 count(f1)
+1 4
+2 1
+3 2
+4 1
+select @a:=f2, count(f2) from t1 group by 1 desc;
+@a:=f2 count(f2)
+d 1
+c 2
+b 1
+a 4
+select @a:=f3, count(f3) from t1 group by 1 desc;
+@a:=f3 count(f3)
+4.5 1
+3.5 2
+2.5 1
+1.5 4
+select @a:=f4, count(f4) from t1 group by 1 desc;
+@a:=f4 count(f4)
+4.6 1
+3.6 2
+2.6 1
+1.6 4
+drop table t1;
diff --git a/mysql-test/r/varbinary.result b/mysql-test/r/varbinary.result
index f30af2ea1a3..6d39d8301c5 100644
--- a/mysql-test/r/varbinary.result
+++ b/mysql-test/r/varbinary.result
@@ -79,3 +79,19 @@ select length(a) from t1;
length(a)
6
drop table t1;
+drop table if exists table_28127_a;
+drop table if exists table_28127_b;
+create table table_28127_a(0b02 int);
+show create table table_28127_a;
+Table Create Table
+table_28127_a CREATE TABLE `table_28127_a` (
+ `0b02` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+create table table_28127_b(0b2 int);
+show create table table_28127_b;
+Table Create Table
+table_28127_b CREATE TABLE `table_28127_b` (
+ `0b2` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table table_28127_a;
+drop table table_28127_b;
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index 8d601596648..19b48efe6b4 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -235,7 +235,7 @@ net_buffer_length 1024
net_read_timeout 300
net_retry_count 10
net_write_timeout 200
-select * from information_schema.global_variables where variable_name like 'net_%';
+select * from information_schema.global_variables where variable_name like 'net_%' order by 1;
VARIABLE_NAME VARIABLE_VALUE
NET_BUFFER_LENGTH 1024
NET_READ_TIMEOUT 300
@@ -247,7 +247,7 @@ net_buffer_length 2048
net_read_timeout 600
net_retry_count 10
net_write_timeout 500
-select * from information_schema.session_variables where variable_name like 'net_%';
+select * from information_schema.session_variables where variable_name like 'net_%' order by 1;
VARIABLE_NAME VARIABLE_VALUE
NET_BUFFER_LENGTH 2048
NET_READ_TIMEOUT 600
@@ -260,7 +260,7 @@ net_buffer_length 1024
net_read_timeout 900
net_retry_count 10
net_write_timeout 1000
-select * from information_schema.global_variables where variable_name like 'net_%';
+select * from information_schema.global_variables where variable_name like 'net_%' order by 1;
VARIABLE_NAME VARIABLE_VALUE
NET_BUFFER_LENGTH 1024
NET_READ_TIMEOUT 900
@@ -272,7 +272,7 @@ net_buffer_length 7168
net_read_timeout 600
net_retry_count 10
net_write_timeout 500
-select * from information_schema.session_variables where variable_name like 'net_%';
+select * from information_schema.session_variables where variable_name like 'net_%' order by 1;
VARIABLE_NAME VARIABLE_VALUE
NET_BUFFER_LENGTH 7168
NET_READ_TIMEOUT 600
@@ -313,7 +313,7 @@ query_prealloc_size 8192
range_alloc_block_size 2048
transaction_alloc_block_size 8192
transaction_prealloc_size 4096
-select * from information_schema.session_variables where variable_name like '%alloc%';
+select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
VARIABLE_NAME VARIABLE_VALUE
QUERY_ALLOC_BLOCK_SIZE 8192
QUERY_PREALLOC_SIZE 8192
@@ -335,7 +335,7 @@ query_prealloc_size 18432
range_alloc_block_size 16384
transaction_alloc_block_size 19456
transaction_prealloc_size 20480
-select * from information_schema.session_variables where variable_name like '%alloc%';
+select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
VARIABLE_NAME VARIABLE_VALUE
QUERY_ALLOC_BLOCK_SIZE 17408
QUERY_PREALLOC_SIZE 18432
@@ -352,7 +352,7 @@ query_prealloc_size 8192
range_alloc_block_size 2048
transaction_alloc_block_size 8192
transaction_prealloc_size 4096
-select * from information_schema.session_variables where variable_name like '%alloc%';
+select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
VARIABLE_NAME VARIABLE_VALUE
QUERY_ALLOC_BLOCK_SIZE 8192
QUERY_PREALLOC_SIZE 8192
@@ -444,7 +444,14 @@ set interactive_timeout=100;
set join_buffer_size=100;
set last_insert_id=1;
set global local_infile=1;
-set long_query_time=100;
+set long_query_time=0.000001;
+select @@long_query_time;
+@@long_query_time
+0.000001
+set long_query_time=100.000001;
+select @@long_query_time;
+@@long_query_time
+100.000001
set low_priority_updates=1;
set max_allowed_packet=100;
set global max_binlog_cache_size=100;
@@ -516,6 +523,7 @@ set tmp_table_size=100;
set tx_isolation="READ-COMMITTED";
set wait_timeout=100;
set log_warnings=1;
+set global log_warnings=1;
select @@session.insert_id;
@@session.insert_id
1
@@ -911,7 +919,7 @@ ssl_capath #
ssl_cert #
ssl_cipher #
ssl_key #
-select * from information_schema.session_variables where variable_name like 'ssl%';
+select * from information_schema.session_variables where variable_name like 'ssl%' order by 1;
VARIABLE_NAME VARIABLE_VALUE
SSL_CA #
SSL_CAPATH #
@@ -970,3 +978,8 @@ set global server_id =@my_server_id;
set global slow_launch_time =@my_slow_launch_time;
set global storage_engine =@my_storage_engine;
set global thread_cache_size =@my_thread_cache_size;
+show global variables where Variable_name='table_definition_cache' or
+Variable_name='table_lock_wait_timeout';
+Variable_name Value
+table_definition_cache #
+table_lock_wait_timeout #
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index cc353f5e1db..8a926d44f5f 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -23,6 +23,9 @@ c
5
6
11
+select is_updatable from information_schema.views where table_name='v1';
+is_updatable
+NO
create temporary table t1 (a int, b int);
select * from t1;
a b
@@ -34,11 +37,11 @@ c
6
11
show create table v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (`t1`.`b` + 1) AS `c` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (`t1`.`b` + 1) AS `c` from `t1` latin1 latin1_swedish_ci
show create view v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (`t1`.`b` + 1) AS `c` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (`t1`.`b` + 1) AS `c` from `t1` latin1 latin1_swedish_ci
show create view t1;
ERROR HY000: 'test.t1' is not VIEW
drop table t1;
@@ -57,8 +60,8 @@ Warnings:
Note 1003 select (`test`.`t1`.`b` + 1) AS `c` from `test`.`t1`
create algorithm=temptable view v2 (c) as select b+1 from t1;
show create view v2;
-View Create View
-v2 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t1`.`b` + 1) AS `c` from `t1`
+View Create View character_set_client collation_connection
+v2 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t1`.`b` + 1) AS `c` from `t1` latin1 latin1_swedish_ci
select c from v2;
c
3
@@ -322,6 +325,12 @@ create table t1 (a int, b int, primary key(a));
insert into t1 values (10,2), (20,3), (30,4), (40,5), (50,10);
create view v1 (a,c) as select a, b+1 from t1;
create algorithm=temptable view v2 (a,c) as select a, b+1 from t1;
+select is_updatable from information_schema.views where table_name='v2';
+is_updatable
+NO
+select is_updatable from information_schema.views where table_name='v1';
+is_updatable
+YES
update v1 set c=a+c;
ERROR HY000: Column 'c' is not updatable
update v2 set a=a+c;
@@ -567,8 +576,8 @@ set sql_mode='ansi';
create table t1 ("a*b" int);
create view v1 as select "a*b" from t1;
show create view v1;
-View Create View
-v1 CREATE VIEW "v1" AS select "t1"."a*b" AS "a*b" from "t1"
+View Create View character_set_client collation_connection
+v1 CREATE VIEW "v1" AS select "t1"."a*b" AS "a*b" from "t1" latin1 latin1_swedish_ci
drop view v1;
drop table t1;
set sql_mode=default;
@@ -604,6 +613,10 @@ insert into t1 values(5,'Hello, world of views');
create view v1 as select * from t1;
create view v2 as select * from v1;
update v2 set col2='Hello, view world';
+select is_updatable from information_schema.views;
+is_updatable
+YES
+YES
select * from t1;
col1 col2
5 Hello, view world
@@ -669,8 +682,8 @@ drop view v1;
drop table t1;
CREATE VIEW v1 (f1,f2,f3,f4) AS SELECT connection_id(), pi(), current_user(), version();
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select connection_id() AS `f1`,pi() AS `f2`,current_user() AS `f3`,version() AS `f4`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select connection_id() AS `f1`,pi() AS `f2`,current_user() AS `f3`,version() AS `f4` latin1 latin1_swedish_ci
drop view v1;
create table t1 (s1 int);
create table t2 (s2 int);
@@ -703,14 +716,14 @@ create table t2 (a int);
create view v1 as select a from t1;
create view v2 as select a from t2 where a in (select a from v1);
show create view v2;
-View Create View
-v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t2`.`a` AS `a` from `t2` where `t2`.`a` in (select `v1`.`a` AS `a` from `v1`)
+View Create View character_set_client collation_connection
+v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t2`.`a` AS `a` from `t2` where `t2`.`a` in (select `v1`.`a` AS `a` from `v1`) latin1 latin1_swedish_ci
drop view v2, v1;
drop table t1, t2;
CREATE VIEW `v 1` AS select 5 AS `5`;
show create view `v 1`;
-View Create View
-v 1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v 1` AS select 5 AS `5`
+View Create View character_set_client collation_connection
+v 1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v 1` AS select 5 AS `5` latin1 latin1_swedish_ci
drop view `v 1`;
create database mysqltest;
create table mysqltest.t1 (a int, b int);
@@ -777,15 +790,15 @@ select * from v3;
a b
1 1
show create view v3;
-View Create View
-v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `v1`.`col1` AS `a`,`v2`.`col1` AS `b` from (`v1` join `v2`) where (`v1`.`col1` = `v2`.`col1`)
+View Create View character_set_client collation_connection
+v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `v1`.`col1` AS `a`,`v2`.`col1` AS `b` from (`v1` join `v2`) where (`v1`.`col1` = `v2`.`col1`) latin1 latin1_swedish_ci
drop view v3, v2, v1;
drop table t2, t1;
create function `f``1` () returns int return 5;
create view v1 as select test.`f``1` ();
show create view v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`f``1`() AS `test.``f````1`` ()`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`f``1`() AS `test.``f````1`` ()` latin1 latin1_swedish_ci
select * from v1;
test.`f``1` ()
5
@@ -801,11 +814,11 @@ drop function a;
create table t2 (col1 char collate latin1_german2_ci);
create view v2 as select col1 collate latin1_german1_ci from t2;
show create view v2;
-View Create View
-v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t2`.`col1` collate latin1_german1_ci) AS `col1 collate latin1_german1_ci` from `t2`
+View Create View character_set_client collation_connection
+v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t2`.`col1` collate latin1_german1_ci) AS `col1 collate latin1_german1_ci` from `t2` latin1 latin1_swedish_ci
show create view v2;
-View Create View
-v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t2`.`col1` collate latin1_german1_ci) AS `col1 collate latin1_german1_ci` from `t2`
+View Create View character_set_client collation_connection
+v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t2`.`col1` collate latin1_german1_ci) AS `col1 collate latin1_german1_ci` from `t2` latin1 latin1_swedish_ci
drop view v2;
drop table t2;
create table t1 (a int);
@@ -831,9 +844,12 @@ drop view v1;
drop table t1;
create view v1 as select 99999999999999999999999999999999999999999999999999999 as col1;
show create view v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 99999999999999999999999999999999999999999999999999999 AS `col1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 99999999999999999999999999999999999999999999999999999 AS `col1` latin1 latin1_swedish_ci
drop view v1;
+SET @old_cs_client = @@character_set_client;
+SET @old_cs_results = @@character_set_results;
+SET @old_cs_connection = @@character_set_connection;
set names utf8;
create table tü (cü char);
create view vü as select cü from tü;
@@ -843,7 +859,9 @@ cü
ü
drop view vü;
drop table tü;
-set names latin1;
+SET character_set_client = @old_cs_client;
+SET character_set_results = @old_cs_results;
+SET character_set_connection = @old_cs_connection;
create table t1 (a int, b int);
insert into t1 values (1,2), (1,3), (2,4), (2,5), (3,10);
create view v1(c) as select a+1 from t1 where b >= 4;
@@ -854,8 +872,8 @@ drop view v1;
drop table t1;
create view v1 as select cast(1 as char(3));
show create view v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(1 as char(3) charset latin1) AS `cast(1 as char(3))`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(1 as char(3) charset latin1) AS `cast(1 as char(3))` latin1 latin1_swedish_ci
select * from v1;
cast(1 as char(3))
1
@@ -1186,20 +1204,20 @@ drop table t1;
create table t1 (a int);
create view v1 as select * from t1;
show create view v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` latin1 latin1_swedish_ci
alter algorithm=undefined view v1 as select * from t1 with check option;
show create view v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` WITH CASCADED CHECK OPTION
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` WITH CASCADED CHECK OPTION latin1 latin1_swedish_ci
alter algorithm=merge view v1 as select * from t1 with cascaded check option;
show create view v1;
-View Create View
-v1 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` WITH CASCADED CHECK OPTION
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` WITH CASCADED CHECK OPTION latin1 latin1_swedish_ci
alter algorithm=temptable view v1 as select * from t1;
show create view v1;
-View Create View
-v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` latin1 latin1_swedish_ci
drop view v1;
drop table t1;
create table t1 (s1 int);
@@ -1378,7 +1396,9 @@ test.t1 check status OK
drop table t1;
check table v1;
Table Op Msg_type Msg_text
-test.v1 check error View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+test.v1 check Error Table 'test.t1' doesn't exist
+test.v1 check Error View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+test.v1 check error Corrupt
drop view v1;
create table t1 (a int);
create table t2 (a int);
@@ -1870,25 +1890,25 @@ create table t1 (a timestamp default now());
create table t2 (b timestamp default now());
create view v1 as select a,b,t1.a < now() from t1,t2 where t1.a < now();
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t2`.`b` AS `b`,(`t1`.`a` < now()) AS `t1.a < now()` from (`t1` join `t2`) where (`t1`.`a` < now())
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t2`.`b` AS `b`,(`t1`.`a` < now()) AS `t1.a < now()` from (`t1` join `t2`) where (`t1`.`a` < now()) latin1 latin1_swedish_ci
drop view v1;
drop table t1, t2;
CREATE TABLE t1 ( a varchar(50) );
CREATE VIEW v1 AS SELECT * FROM t1 WHERE a = CURRENT_USER();
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` = current_user())
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` = current_user()) latin1 latin1_swedish_ci
DROP VIEW v1;
CREATE VIEW v1 AS SELECT * FROM t1 WHERE a = VERSION();
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` = version())
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` = version()) latin1 latin1_swedish_ci
DROP VIEW v1;
CREATE VIEW v1 AS SELECT * FROM t1 WHERE a = DATABASE();
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` = database())
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` = database()) latin1 latin1_swedish_ci
DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (col1 time);
@@ -1902,11 +1922,17 @@ CREATE VIEW v6 AS SELECT CONVERT_TZ(col1,'GMT','MET') FROM t2;
DROP TABLE t1;
CHECK TABLE v1, v2, v3, v4, v5, v6;
Table Op Msg_type Msg_text
-test.v1 check error View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+test.v1 check Error Table 'test.t1' doesn't exist
+test.v1 check Error View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+test.v1 check error Corrupt
test.v2 check status OK
-test.v3 check error View 'test.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+test.v3 check Error Table 'test.t1' doesn't exist
+test.v3 check Error View 'test.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+test.v3 check error Corrupt
test.v4 check status OK
-test.v5 check error View 'test.v5' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+test.v5 check Error Table 'test.t1' doesn't exist
+test.v5 check Error View 'test.v5' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+test.v5 check error Corrupt
test.v6 check status OK
drop view v1, v2, v3, v4, v5, v6;
drop table t2;
@@ -1926,11 +1952,17 @@ CREATE VIEW v6 AS SELECT f2() FROM t3;
drop function f1;
CHECK TABLE v1, v2, v3, v4, v5, v6;
Table Op Msg_type Msg_text
-test.v1 check error View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+test.v1 check Error FUNCTION test.f1 does not exist
+test.v1 check Error View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+test.v1 check error Corrupt
test.v2 check status OK
-test.v3 check error View 'test.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+test.v3 check Error FUNCTION test.f1 does not exist
+test.v3 check Error View 'test.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+test.v3 check error Corrupt
test.v4 check status OK
-test.v5 check error View 'test.v5' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+test.v5 check Error FUNCTION test.f1 does not exist
+test.v5 check Error View 'test.v5' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+test.v5 check error Corrupt
test.v6 check status OK
create function f1 () returns int return (select max(col1) from t1);
DROP TABLE t1;
@@ -1978,8 +2010,8 @@ drop table t1;
create table t1 (s1 int);
create view v1 as select var_samp(s1) from t1;
show create view v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select var_samp(`t1`.`s1`) AS `var_samp(s1)` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select var_samp(`t1`.`s1`) AS `var_samp(s1)` from `t1` latin1 latin1_swedish_ci
drop view v1;
drop table t1;
set sql_mode='strict_all_tables';
@@ -2224,16 +2256,16 @@ CREATE TABLE t1 (date DATE NOT NULL);
INSERT INTO t1 VALUES ('2005-09-06');
CREATE VIEW v1 AS SELECT DAYNAME(date) FROM t1;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select dayname(`t1`.`date`) AS `DAYNAME(date)` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select dayname(`t1`.`date`) AS `DAYNAME(date)` from `t1` latin1 latin1_swedish_ci
CREATE VIEW v2 AS SELECT DAYOFWEEK(date) FROM t1;
SHOW CREATE VIEW v2;
-View Create View
-v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select dayofweek(`t1`.`date`) AS `DAYOFWEEK(date)` from `t1`
+View Create View character_set_client collation_connection
+v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select dayofweek(`t1`.`date`) AS `DAYOFWEEK(date)` from `t1` latin1 latin1_swedish_ci
CREATE VIEW v3 AS SELECT WEEKDAY(date) FROM t1;
SHOW CREATE VIEW v3;
-View Create View
-v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select weekday(`t1`.`date`) AS `WEEKDAY(date)` from `t1`
+View Create View character_set_client collation_connection
+v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select weekday(`t1`.`date`) AS `WEEKDAY(date)` from `t1` latin1 latin1_swedish_ci
SELECT DAYNAME('2005-09-06');
DAYNAME('2005-09-06')
Tuesday
@@ -2317,8 +2349,8 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ref a a 10 const,test.t1.b 2 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; Using join cache
-1 SIMPLE t3 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t1 ref a a 5 const 1 Using where; Using index
+1 SIMPLE t3 ALL NULL NULL NULL NULL 3 Using where; Using join buffer
DROP VIEW v1,v2;
DROP TABLE t1,t2,t3;
create table t1 (f1 int);
@@ -2366,45 +2398,39 @@ CREATE TABLE t1(id INT);
CREATE VIEW v1 AS SELECT id FROM t1;
OPTIMIZE TABLE v1;
Table Op Msg_type Msg_text
-test.v1 optimize error 'test.v1' is not BASE TABLE
-Warnings:
-Error 1347 'test.v1' is not BASE TABLE
+test.v1 optimize Error 'test.v1' is not BASE TABLE
+test.v1 optimize error Corrupt
ANALYZE TABLE v1;
Table Op Msg_type Msg_text
-test.v1 analyze error 'test.v1' is not BASE TABLE
-Warnings:
-Error 1347 'test.v1' is not BASE TABLE
+test.v1 analyze Error 'test.v1' is not BASE TABLE
+test.v1 analyze error Corrupt
REPAIR TABLE v1;
Table Op Msg_type Msg_text
-test.v1 repair error 'test.v1' is not BASE TABLE
-Warnings:
-Error 1347 'test.v1' is not BASE TABLE
+test.v1 repair Error 'test.v1' is not BASE TABLE
+test.v1 repair error Corrupt
DROP TABLE t1;
OPTIMIZE TABLE v1;
Table Op Msg_type Msg_text
-test.v1 optimize error 'test.v1' is not BASE TABLE
-Warnings:
-Error 1347 'test.v1' is not BASE TABLE
+test.v1 optimize Error 'test.v1' is not BASE TABLE
+test.v1 optimize error Corrupt
ANALYZE TABLE v1;
Table Op Msg_type Msg_text
-test.v1 analyze error 'test.v1' is not BASE TABLE
-Warnings:
-Error 1347 'test.v1' is not BASE TABLE
+test.v1 analyze Error 'test.v1' is not BASE TABLE
+test.v1 analyze error Corrupt
REPAIR TABLE v1;
Table Op Msg_type Msg_text
-test.v1 repair error 'test.v1' is not BASE TABLE
-Warnings:
-Error 1347 'test.v1' is not BASE TABLE
+test.v1 repair Error 'test.v1' is not BASE TABLE
+test.v1 repair error Corrupt
DROP VIEW v1;
create definer = current_user() sql security invoker view v1 as select 1;
show create view v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select 1 AS `1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select 1 AS `1` latin1 latin1_swedish_ci
drop view v1;
create definer = current_user sql security invoker view v1 as select 1;
show create view v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select 1 AS `1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select 1 AS `1` latin1 latin1_swedish_ci
drop view v1;
create table t1 (id INT, primary key(id));
insert into t1 values (1),(2);
@@ -2433,8 +2459,8 @@ end;
//
call p1();
show create view v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `1` latin1 latin1_swedish_ci
drop view v1;
drop procedure p1;
CREATE VIEW v1 AS SELECT 42 AS Meaning;
@@ -2539,8 +2565,8 @@ drop table t1;
show create view v1;
drop view v1;
//
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`id` AS `id` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`id` AS `id` from `t1` latin1 latin1_swedish_ci
create table t1(f1 int, f2 int);
create view v1 as select ta.f1 as a, tb.f1 as b from t1 ta, t1 tb where ta.f1=tb
.f1 and ta.f2=tb.f2;
@@ -2656,8 +2682,8 @@ CREATE VIEW v1 AS
SELECT id, date(d) + INTERVAL TIME_TO_SEC(d) SECOND AS t, COUNT(*)
FROM t1 GROUP BY id, t;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`id` AS `id`,(cast(`t1`.`d` as date) + interval time_to_sec(`t1`.`d`) second) AS `t`,count(0) AS `COUNT(*)` from `t1` group by `t1`.`id`,(cast(`t1`.`d` as date) + interval time_to_sec(`t1`.`d`) second)
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`id` AS `id`,(cast(`t1`.`d` as date) + interval time_to_sec(`t1`.`d`) second) AS `t`,count(0) AS `COUNT(*)` from `t1` group by `t1`.`id`,(cast(`t1`.`d` as date) + interval time_to_sec(`t1`.`d`) second) latin1 latin1_swedish_ci
SELECT * FROM v1;
id t COUNT(*)
DROP VIEW v1;
@@ -2684,8 +2710,8 @@ CREATE VIEW v1 AS
SELECT (year(now())-year(DOB)) AS Age
FROM t1 HAVING Age < 75;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (year(now()) - year(`t1`.`DOB`)) AS `Age` from `t1` having (`Age` < 75)
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (year(now()) - year(`t1`.`DOB`)) AS `Age` from `t1` having (`Age` < 75) latin1 latin1_swedish_ci
set timestamp=1136066400;
SELECT (year(now())-year(DOB)) AS Age FROM t1 HAVING Age < 75;
Age
@@ -2771,7 +2797,7 @@ CREATE TABLE t1 (i int, j int);
CREATE VIEW v1 AS SELECT COALESCE(i,j) FROM t1;
DESCRIBE v1;
Field Type Null Key Default Extra
-COALESCE(i,j) int(11) YES NULL
+COALESCE(i,j) bigint(11) YES NULL
CREATE TABLE t2 SELECT COALESCE(i,j) FROM t1;
DESCRIBE t2;
Field Type Null Key Default Extra
@@ -2814,12 +2840,12 @@ DROP TABLE t1;
CREATE TABLE t1 (x INT, y INT);
CREATE ALGORITHM=TEMPTABLE SQL SECURITY INVOKER VIEW v1 AS SELECT x FROM t1;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select `t1`.`x` AS `x` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select `t1`.`x` AS `x` from `t1` latin1 latin1_swedish_ci
ALTER VIEW v1 AS SELECT x, y FROM t1;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select `t1`.`x` AS `x`,`t1`.`y` AS `y` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select `t1`.`x` AS `x`,`t1`.`y` AS `y` from `t1` latin1 latin1_swedish_ci
DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (s1 char);
@@ -2879,8 +2905,8 @@ USE test;
create table t1 (f1 datetime);
create view v1 as select * from t1 where f1 between now() and now() + interval 1 minute;
show create view v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` where (`t1`.`f1` between now() and (now() + interval 1 minute))
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` where (`t1`.`f1` between now() and (now() + interval 1 minute)) latin1 latin1_swedish_ci
drop view v1;
drop table t1;
DROP TABLE IF EXISTS t1;
@@ -2956,8 +2982,8 @@ t2.ver = (SELECT MAX(t.ver) FROM t2 t WHERE t.org = t2.org);
SHOW WARNINGS;
Level Code Message
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`pk` AS `pk` from (`t1` join `t2` on(((`t2`.`fk` = `t1`.`pk`) and (`t2`.`ver` = (select max(`t`.`ver`) AS `MAX(t.ver)` from `t2` `t` where (`t`.`org` = `t2`.`org`))))))
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`pk` AS `pk` from (`t1` join `t2` on(((`t2`.`fk` = `t1`.`pk`) and (`t2`.`ver` = (select max(`t`.`ver`) AS `MAX(t.ver)` from `t2` `t` where (`t`.`org` = `t2`.`org`)))))) latin1 latin1_swedish_ci
DROP VIEW v1;
DROP TABLE t1, t2;
DROP FUNCTION IF EXISTS f1;
@@ -3020,8 +3046,8 @@ DROP VIEW v1, v2;
DROP TABLE t1;
CREATE VIEW v AS SELECT !0 * 5 AS x FROM DUAL;
SHOW CREATE VIEW v;
-View Create View
-v CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select ((not(0)) * 5) AS `x`
+View Create View character_set_client collation_connection
+v CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select ((not(0)) * 5) AS `x` latin1 latin1_swedish_ci
SELECT !0 * 5 AS x FROM DUAL;
x
5
@@ -3035,8 +3061,8 @@ SELECT * FROM v1;
TheEnd
TheEnd
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select _latin1'The\ZEnd' AS `TheEnd`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select _latin1'The\ZEnd' AS `TheEnd` latin1 latin1_swedish_ci
DROP VIEW v1;
CREATE TABLE t1 (mydate DATETIME);
INSERT INTO t1 VALUES
@@ -3257,8 +3283,8 @@ old_isfalse int(1) NO 0
a IS NOT FALSE int(1) NO 0
old_isnotfalse int(1) NO 0
show create view view_24532_b;
-View Create View
-view_24532_b CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_24532_b` AS select (`table_24532`.`a` is true) AS `a IS TRUE`,if(ifnull(`table_24532`.`a`,0),1,0) AS `old_istrue`,(`table_24532`.`a` is not true) AS `a IS NOT TRUE`,if(ifnull(`table_24532`.`a`,0),0,1) AS `old_isnottrue`,(`table_24532`.`a` is false) AS `a IS FALSE`,if(ifnull(`table_24532`.`a`,1),0,1) AS `old_isfalse`,(`table_24532`.`a` is not false) AS `a IS NOT FALSE`,if(ifnull(`table_24532`.`a`,1),1,0) AS `old_isnotfalse` from `table_24532`
+View Create View character_set_client collation_connection
+view_24532_b CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_24532_b` AS select (`table_24532`.`a` is true) AS `a IS TRUE`,if(ifnull(`table_24532`.`a`,0),1,0) AS `old_istrue`,(`table_24532`.`a` is not true) AS `a IS NOT TRUE`,if(ifnull(`table_24532`.`a`,0),0,1) AS `old_isnottrue`,(`table_24532`.`a` is false) AS `a IS FALSE`,if(ifnull(`table_24532`.`a`,1),0,1) AS `old_isfalse`,(`table_24532`.`a` is not false) AS `a IS NOT FALSE`,if(ifnull(`table_24532`.`a`,1),1,0) AS `old_isnotfalse` from `table_24532` latin1 latin1_swedish_ci
insert into table_24532 values (0, 0, 0, 0);
select * from view_24532_b;
a IS TRUE old_istrue a IS NOT TRUE old_isnottrue a IS FALSE old_isfalse a IS NOT FALSE old_isnotfalse
@@ -3346,6 +3372,193 @@ id select_type table type possible_keys key key_len ref rows Extra
NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL Using filesort
DROP VIEW v1;
DROP TABLE t1;
+CREATE VIEW v1 AS SELECT CAST( 1.23456789 AS DECIMAL( 7,5 ) ) AS col;
+SELECT * FROM v1;
+col
+1.23457
+DESCRIBE v1;
+Field Type Null Key Default Extra
+col decimal(7,5) NO 0.00000
+DROP VIEW v1;
+CREATE VIEW v1 AS SELECT CAST(1.23456789 AS DECIMAL(8,0)) AS col;
+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(1.23456789 as decimal(8,0)) AS `col` latin1 latin1_swedish_ci
+DROP VIEW v1;
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (b INT, c INT DEFAULT 0);
+INSERT INTO t1 (a) VALUES (1), (2);
+INSERT INTO t2 (b) VALUES (1), (2);
+CREATE VIEW v1 AS SELECT t2.b,t2.c FROM t1, t2
+WHERE t1.a=t2.b AND t2.b < 3 WITH CHECK OPTION;
+SELECT * FROM v1;
+b c
+1 0
+2 0
+UPDATE v1 SET c=1 WHERE b=1;
+SELECT * FROM v1;
+b c
+1 1
+2 0
+DROP VIEW v1;
+DROP TABLE t1,t2;
+CREATE TABLE t1 (id int);
+CREATE TABLE t2 (id int, c int DEFAULT 0);
+INSERT INTO t1 (id) VALUES (1);
+INSERT INTO t2 (id) VALUES (1);
+CREATE VIEW v1 AS
+SELECT t2.c FROM t1, t2
+WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION;
+UPDATE v1 SET c=1;
+DROP VIEW v1;
+DROP TABLE t1,t2;
+CREATE TABLE t1 (a1 INT, c INT DEFAULT 0);
+CREATE TABLE t2 (a2 INT);
+CREATE TABLE t3 (a3 INT);
+CREATE TABLE t4 (a4 INT);
+INSERT INTO t1 (a1) VALUES (1),(2);
+INSERT INTO t2 (a2) VALUES (1),(2);
+INSERT INTO t3 (a3) VALUES (1),(2);
+INSERT INTO t4 (a4) VALUES (1),(2);
+CREATE VIEW v1 AS
+SELECT t1.a1, t1.c FROM t1 JOIN t2 ON t1.a1=t2.a2 AND t1.c < 3
+WITH CHECK OPTION;
+SELECT * FROM v1;
+a1 c
+1 0
+2 0
+UPDATE v1 SET c=3;
+ERROR HY000: CHECK OPTION failed 'test.v1'
+PREPARE t FROM 'UPDATE v1 SET c=3';
+EXECUTE t;
+ERROR HY000: CHECK OPTION failed 'test.v1'
+EXECUTE t;
+ERROR HY000: CHECK OPTION failed 'test.v1'
+INSERT INTO v1(a1, c) VALUES (3, 3);
+ERROR HY000: CHECK OPTION failed 'test.v1'
+UPDATE v1 SET c=1 WHERE a1=1;
+SELECT * FROM v1;
+a1 c
+1 1
+2 0
+SELECT * FROM t1;
+a1 c
+1 1
+2 0
+CREATE VIEW v2 AS SELECT t1.a1, t1.c
+FROM (t1 JOIN t2 ON t1.a1=t2.a2 AND t1.c < 3)
+JOIN (t3 JOIN t4 ON t3.a3=t4.a4)
+ON t2.a2=t3.a3 WITH CHECK OPTION;
+SELECT * FROM v2;
+a1 c
+1 1
+2 0
+UPDATE v2 SET c=3;
+ERROR HY000: CHECK OPTION failed 'test.v2'
+PREPARE t FROM 'UPDATE v2 SET c=3';
+EXECUTE t;
+ERROR HY000: CHECK OPTION failed 'test.v2'
+EXECUTE t;
+ERROR HY000: CHECK OPTION failed 'test.v2'
+INSERT INTO v2(a1, c) VALUES (3, 3);
+ERROR HY000: CHECK OPTION failed 'test.v2'
+UPDATE v2 SET c=2 WHERE a1=1;
+SELECT * FROM v2;
+a1 c
+1 2
+2 0
+SELECT * FROM t1;
+a1 c
+1 2
+2 0
+DROP VIEW v1,v2;
+DROP TABLE t1,t2,t3,t4;
+CREATE TABLE t1 (a int, b int);
+INSERT INTO t1 VALUES (1,2), (2,2), (1,3), (1,2);
+CREATE VIEW v1 AS SELECT a, b+1 as b FROM t1;
+SELECT b, SUM(a) FROM v1 WHERE b=3 GROUP BY b;
+b SUM(a)
+3 4
+EXPLAIN SELECT b, SUM(a) FROM v1 WHERE b=3 GROUP BY b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
+SELECT a, SUM(b) FROM v1 WHERE b=3 GROUP BY a;
+a SUM(b)
+1 6
+2 3
+EXPLAIN SELECT a, SUM(b) FROM v1 WHERE b=3 GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where; Using temporary; Using filesort
+SELECT a, SUM(b) FROM v1 WHERE a=1 GROUP BY a;
+a SUM(b)
+1 10
+EXPLAIN SELECT a, SUM(b) FROM v1 WHERE a=1 GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
+DROP VIEW v1;
+DROP TABLE t1;
+CREATE TABLE t1 (
+person_id int NOT NULL PRIMARY KEY,
+username varchar(40) default NULL,
+status_flg char(1) NOT NULL default 'A'
+);
+CREATE TABLE t2 (
+person_role_id int NOT NULL auto_increment PRIMARY KEY,
+role_id int NOT NULL,
+person_id int NOT NULL,
+INDEX idx_person_id (person_id),
+INDEX idx_role_id (role_id)
+);
+CREATE TABLE t3 (
+role_id int NOT NULL auto_increment PRIMARY KEY,
+role_name varchar(100) default NULL,
+app_name varchar(40) NOT NULL,
+INDEX idx_app_name(app_name)
+);
+CREATE VIEW v1 AS
+SELECT profile.person_id AS person_id
+FROM t1 profile, t2 userrole, t3 role
+WHERE userrole.person_id = profile.person_id AND
+role.role_id = userrole.role_id AND
+profile.status_flg = 'A'
+ ORDER BY profile.person_id,role.app_name,role.role_name;
+INSERT INTO t1 VALUES
+(6,'Sw','A'), (-1136332546,'ols','e'), (0,' *\n','0'),
+(-717462680,'ENTS Ta','0'), (-904346964,'ndard SQL\n','0');
+INSERT INTO t2 VALUES
+(1,3,6),(2,4,7),(3,5,8),(4,6,9),(5,1,6),(6,1,7),(7,1,8),(8,1,9),(9,1,10);
+INSERT INTO t3 VALUES
+(1,'NUCANS_APP_USER','NUCANSAPP'),(2,'NUCANS_TRGAPP_USER','NUCANSAPP'),
+(3,'IA_INTAKE_COORDINATOR','IACANS'),(4,'IA_SCREENER','IACANS'),
+(5,'IA_SUPERVISOR','IACANS'),(6,'IA_READONLY','IACANS'),
+(7,'SOC_USER','SOCCANS'),(8,'CAYIT_USER','CAYITCANS'),
+(9,'RTOS_DCFSPOS_SUPERVISOR','RTOS');
+EXPLAIN SELECT t.person_id AS a, t.person_id AS b FROM v1 t WHERE t.person_id=6;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE profile const PRIMARY PRIMARY 4 const 1 Using temporary; Using filesort
+1 SIMPLE userrole ref idx_person_id,idx_role_id idx_person_id 4 const 2
+1 SIMPLE role eq_ref PRIMARY PRIMARY 4 test.userrole.role_id 1
+SELECT t.person_id AS a, t.person_id AS b FROM v1 t WHERE t.person_id=6;
+a b
+6 6
+6 6
+DROP VIEW v1;
+DROP TABLE t1,t2,t3;
+create table t1 (i int);
+insert into t1 values (1), (2), (1), (3), (2), (4);
+create view v1 as select distinct i from t1;
+select * from v1;
+i
+1
+2
+3
+4
+select table_name, is_updatable from information_schema.views
+where table_name = 'v1';
+table_name is_updatable
+v1 NO
+drop view v1;
+drop table t1;
End of 5.0 tests.
DROP DATABASE IF EXISTS `d-1`;
CREATE DATABASE `d-1`;
diff --git a/mysql-test/r/view_grant.result b/mysql-test/r/view_grant.result
index 51d131f0044..49c98d8e03f 100644
--- a/mysql-test/r/view_grant.result
+++ b/mysql-test/r/view_grant.result
@@ -27,8 +27,8 @@ ERROR 42000: CREATE VIEW command denied to user 'mysqltest_1'@'localhost' for ta
create view v2 as select * from mysqltest.t2;
ERROR 42000: ANY command denied to user 'mysqltest_1'@'localhost' for table 't2'
show create view v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_1`@`localhost` SQL SECURITY DEFINER VIEW `test`.`v1` AS select `mysqltest`.`t1`.`a` AS `a`,`mysqltest`.`t1`.`b` AS `b` from `mysqltest`.`t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_1`@`localhost` SQL SECURITY DEFINER VIEW `test`.`v1` AS select `mysqltest`.`t1`.`a` AS `a`,`mysqltest`.`t1`.`b` AS `b` from `mysqltest`.`t1` latin1 latin1_swedish_ci
grant create view,drop,select on test.* to mysqltest_1@localhost;
use test;
alter view v1 as select * from mysqltest.t1;
@@ -127,28 +127,28 @@ explain select c from mysqltest.v1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found
show create view mysqltest.v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v1` AS select (`mysqltest`.`t1`.`a` + 1) AS `c`,(`mysqltest`.`t1`.`b` + 1) AS `d` from `mysqltest`.`t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v1` AS select (`mysqltest`.`t1`.`a` + 1) AS `c`,(`mysqltest`.`t1`.`b` + 1) AS `d` from `mysqltest`.`t1` latin1 latin1_swedish_ci
explain select c from mysqltest.v2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> system NULL NULL NULL NULL 0 const row not found
2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
show create view mysqltest.v2;
-View Create View
-v2 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v2` AS select (`mysqltest`.`t1`.`a` + 1) AS `c`,(`mysqltest`.`t1`.`b` + 1) AS `d` from `mysqltest`.`t1`
+View Create View character_set_client collation_connection
+v2 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v2` AS select (`mysqltest`.`t1`.`a` + 1) AS `c`,(`mysqltest`.`t1`.`b` + 1) AS `d` from `mysqltest`.`t1` latin1 latin1_swedish_ci
explain select c from mysqltest.v3;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 system NULL NULL NULL NULL 0 const row not found
show create view mysqltest.v3;
-View Create View
-v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v3` AS select (`mysqltest`.`t2`.`a` + 1) AS `c`,(`mysqltest`.`t2`.`b` + 1) AS `d` from `mysqltest`.`t2`
+View Create View character_set_client collation_connection
+v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v3` AS select (`mysqltest`.`t2`.`a` + 1) AS `c`,(`mysqltest`.`t2`.`b` + 1) AS `d` from `mysqltest`.`t2` latin1 latin1_swedish_ci
explain select c from mysqltest.v4;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> system NULL NULL NULL NULL 0 const row not found
2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
show create view mysqltest.v4;
-View Create View
-v4 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v4` AS select (`mysqltest`.`t2`.`a` + 1) AS `c`,(`mysqltest`.`t2`.`b` + 1) AS `d` from `mysqltest`.`t2`
+View Create View character_set_client collation_connection
+v4 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v4` AS select (`mysqltest`.`t2`.`a` + 1) AS `c`,(`mysqltest`.`t2`.`b` + 1) AS `d` from `mysqltest`.`t2` latin1 latin1_swedish_ci
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
delete from mysql.user where user='mysqltest_1';
drop database mysqltest;
@@ -308,8 +308,8 @@ grant select on mysqltest.t1 to mysqltest_1@localhost;
grant create view,select on test.* to mysqltest_1@localhost;
create view v1 as select * from mysqltest.t1;
show create view v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_1`@`localhost` SQL SECURITY DEFINER VIEW `test`.`v1` AS select `mysqltest`.`t1`.`a` AS `a`,`mysqltest`.`t1`.`b` AS `b` from `mysqltest`.`t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_1`@`localhost` SQL SECURITY DEFINER VIEW `test`.`v1` AS select `mysqltest`.`t1`.`a` AS `a`,`mysqltest`.`t1`.`b` AS `b` from `mysqltest`.`t1` latin1 latin1_swedish_ci
revoke select on mysqltest.t1 from mysqltest_1@localhost;
select * from v1;
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
@@ -476,15 +476,15 @@ grant all on test.* to 'test14256'@'%';
use test;
create view v1 as select 42;
show create view v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`test14256`@`%` SQL SECURITY DEFINER VIEW `v1` AS select 42 AS `42`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`test14256`@`%` SQL SECURITY DEFINER VIEW `v1` AS select 42 AS `42` latin1 latin1_swedish_ci
select definer into @v1def1 from information_schema.views
where table_schema = 'test' and table_name='v1';
drop view v1;
create definer=`test14256`@`%` view v1 as select 42;
show create view v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`test14256`@`%` SQL SECURITY DEFINER VIEW `v1` AS select 42 AS `42`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`test14256`@`%` SQL SECURITY DEFINER VIEW `v1` AS select 42 AS `42` latin1 latin1_swedish_ci
select definer into @v1def2 from information_schema.views
where table_schema = 'test' and table_name='v1';
drop view v1;
@@ -500,8 +500,8 @@ use mysqltest;
CREATE TABLE t1 (i INT);
CREATE VIEW v1 AS SELECT * FROM t1;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
GRANT SELECT, LOCK TABLES ON mysqltest.* TO mysqltest_1@localhost;
use mysqltest;
LOCK TABLES v1 READ;
@@ -519,11 +519,11 @@ create definer=some_user@localhost sql security invoker view v2 as select 1;
Warnings:
Note 1449 There is no 'some_user'@'localhost' registered
show create view v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`some_user`@`` SQL SECURITY INVOKER VIEW `v1` AS select 1 AS `1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`some_user`@`` SQL SECURITY INVOKER VIEW `v1` AS select 1 AS `1` latin1 latin1_swedish_ci
show create view v2;
-View Create View
-v2 CREATE ALGORITHM=UNDEFINED DEFINER=`some_user`@`localhost` SQL SECURITY INVOKER VIEW `v2` AS select 1 AS `1`
+View Create View character_set_client collation_connection
+v2 CREATE ALGORITHM=UNDEFINED DEFINER=`some_user`@`localhost` SQL SECURITY INVOKER VIEW `v2` AS select 1 AS `1` latin1 latin1_swedish_ci
drop view v1;
drop view v2;
CREATE DATABASE mysqltest1;
@@ -602,10 +602,10 @@ CREATE DEFINER = 'no-such-user'@localhost VIEW v AS SELECT a from t1;
Warnings:
Note 1449 There is no 'no-such-user'@'localhost' registered
SHOW CREATE VIEW v;
-View Create View
-v CREATE ALGORITHM=UNDEFINED DEFINER=`no-such-user`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select `t1`.`a` AS `a` from `t1`
+View Create View character_set_client collation_connection
+v CREATE ALGORITHM=UNDEFINED DEFINER=`no-such-user`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select `test`.`t1`.`a` AS `a` from `t1` latin1 latin1_swedish_ci
Warnings:
-Note 1449 There is no 'no-such-user'@'localhost' registered
+Warning 1356 View 'test.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
SELECT * FROM v;
ERROR HY000: There is no 'no-such-user'@'localhost' registered
DROP VIEW v;
@@ -619,14 +619,14 @@ CREATE TABLE t1 (f1 INTEGER);
CREATE VIEW view1 AS
SELECT * FROM t1;
SHOW CREATE VIEW view1;
-View Create View
-view1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_db1`@`localhost` SQL SECURITY DEFINER VIEW `view1` AS select `t1`.`f1` AS `f1` from `t1`
+View Create View character_set_client collation_connection
+view1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_db1`@`localhost` SQL SECURITY DEFINER VIEW `view1` AS select `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
CREATE VIEW view2 AS
SELECT * FROM view1;
# Here comes a suspicious warning
SHOW CREATE VIEW view2;
-View Create View
-view2 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_db1`@`localhost` SQL SECURITY DEFINER VIEW `view2` AS select `view1`.`f1` AS `f1` from `view1`
+View Create View character_set_client collation_connection
+view2 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_db1`@`localhost` SQL SECURITY DEFINER VIEW `view2` AS select `view1`.`f1` AS `f1` from `view1` latin1 latin1_swedish_ci
# But the view view2 is usable
SELECT * FROM view2;
f1
@@ -783,8 +783,8 @@ ALTER VIEW v2 AS SELECT f2 FROM t1;
ERROR 42000: DROP command denied to user 'u26813'@'localhost' for table 'v2'
ALTER VIEW v3 AS SELECT f2 FROM t1;
SHOW CREATE VIEW v3;
-View Create View
-v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`f2` AS `f2` from `t1`
+View Create View character_set_client collation_connection
+v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`f2` AS `f2` from `t1` latin1 latin1_swedish_ci
DROP USER u26813@localhost;
DROP DATABASE db26813;
DROP DATABASE IF EXISTS mysqltest1;
@@ -882,30 +882,30 @@ CREATE TABLE t1 (i INT);
CREATE VIEW v1 AS SELECT * FROM t1;
ALTER VIEW v1 AS SELECT * FROM t1;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
ALTER DEFINER=no_such@user_1 VIEW v1 AS SELECT * FROM t1;
Warnings:
Note 1449 There is no 'no_such'@'user_1' registered
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such`@`user_1` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such`@`user_1` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
Warnings:
-Note 1449 There is no 'no_such'@'user_1' registered
+Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
ALTER ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=MERGE DEFINER=`no_such`@`user_1` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=MERGE DEFINER=`no_such`@`user_1` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
Warnings:
-Note 1449 There is no 'no_such'@'user_1' registered
+Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
ALTER ALGORITHM=TEMPTABLE DEFINER=no_such@user_2 VIEW v1 AS SELECT * FROM t1;
Warnings:
Note 1449 There is no 'no_such'@'user_2' registered
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`no_such`@`user_2` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`no_such`@`user_2` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
Warnings:
-Note 1449 There is no 'no_such'@'user_2' registered
+Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
DROP VIEW v1;
DROP TABLE t1;
End of 5.1 tests.
diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result
index 01b1c77887f..2929328a9b1 100644
--- a/mysql-test/r/warnings.result
+++ b/mysql-test/r/warnings.result
@@ -168,7 +168,7 @@ max_error_count 10
drop table t1;
set table_type=MYISAM;
Warnings:
-Warning 1543 The syntax 'table_type' is deprecated and will be removed in MySQL 5.2. Please use 'storage_engine' instead
+Warning 1287 The syntax 'table_type' is deprecated and will be removed in MySQL 5.2. Please use 'storage_engine' instead
create table t1 (a int);
insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
update t1 set a='abc';
diff --git a/mysql-test/r/windows_shm.result b/mysql-test/r/windows_shm.result
new file mode 100644
index 00000000000..c60049bece8
--- /dev/null
+++ b/mysql-test/r/windows_shm.result
@@ -0,0 +1,2 @@
+mysqld is alive
+End of 5.0 tests.
diff --git a/mysql-test/r/xml.result b/mysql-test/r/xml.result
index 236c50774bd..a1f2c80e766 100644
--- a/mysql-test/r/xml.result
+++ b/mysql-test/r/xml.result
@@ -547,6 +547,13 @@ UpdateXML(@xml, '/a/b/@bb2', '')
select UpdateXML(@xml, '/a/b/@bb2', 'bb3="bb3"');
UpdateXML(@xml, '/a/b/@bb2', 'bb3="bb3"')
<a aa1="aa1" aa2="aa2"><b bb1="bb1" bb3="bb3">bb</b></a>
+select updatexml('<div><div><span>1</span><span>2</span></div></div>',
+'/','<tr><td>1</td><td>2</td></tr>') as upd1;
+upd1
+<tr><td>1</td><td>2</td></tr>
+select updatexml('', '/', '') as upd2;
+upd2
+
SET @xml= '<order><clerk>lesser wombat</clerk></order>';
select extractvalue(@xml,'order/clerk');
extractvalue(@xml,'order/clerk')
@@ -640,32 +647,32 @@ select extractValue('<a>a','/a');
extractValue('<a>a','/a')
NULL
Warnings:
-Warning 1513 Incorrect XML value: 'parse error at line 1 pos 5: unexpected END-OF-INPUT'
+Warning 1524 Incorrect XML value: 'parse error at line 1 pos 5: unexpected END-OF-INPUT'
select extractValue('<a>a<','/a');
extractValue('<a>a<','/a')
NULL
Warnings:
-Warning 1513 Incorrect XML value: 'parse error at line 1 pos 6: END-OF-INPUT unexpected (ident or '/' wanted)'
+Warning 1524 Incorrect XML value: 'parse error at line 1 pos 6: END-OF-INPUT unexpected (ident or '/' wanted)'
select extractValue('<a>a</','/a');
extractValue('<a>a</','/a')
NULL
Warnings:
-Warning 1513 Incorrect XML value: 'parse error at line 1 pos 7: END-OF-INPUT unexpected (ident wanted)'
+Warning 1524 Incorrect XML value: 'parse error at line 1 pos 7: END-OF-INPUT unexpected (ident wanted)'
select extractValue('<a>a</a','/a');
extractValue('<a>a</a','/a')
NULL
Warnings:
-Warning 1513 Incorrect XML value: 'parse error at line 1 pos 8: END-OF-INPUT unexpected ('>' wanted)'
+Warning 1524 Incorrect XML value: 'parse error at line 1 pos 8: END-OF-INPUT unexpected ('>' wanted)'
select extractValue('<a>a</a></b>','/a');
extractValue('<a>a</a></b>','/a')
NULL
Warnings:
-Warning 1513 Incorrect XML value: 'parse error at line 1 pos 12: '</b>' unexpected (END-OF-INPUT wanted)'
+Warning 1524 Incorrect XML value: 'parse error at line 1 pos 12: '</b>' unexpected (END-OF-INPUT wanted)'
select extractValue('<a b=>a</a>','/a');
extractValue('<a b=>a</a>','/a')
NULL
Warnings:
-Warning 1513 Incorrect XML value: 'parse error at line 1 pos 7: '>' unexpected (ident or string wanted)'
+Warning 1524 Incorrect XML value: 'parse error at line 1 pos 7: '>' unexpected (ident or string wanted)'
select extractValue('<e>1</e>','position()');
ERROR HY000: XPATH syntax error: ''
select extractValue('<e>1</e>','last()');
@@ -716,17 +723,17 @@ select extractValue('<zot><tim0><01>10:39:15</01><02>140</02></tim0></zot>','//*
extractValue('<zot><tim0><01>10:39:15</01><02>140</02></tim0></zot>','//*')
NULL
Warnings:
-Warning 1513 Incorrect XML value: 'parse error at line 1 pos 13: unknown token unexpected (ident or '/' wanted)'
+Warning 1524 Incorrect XML value: 'parse error at line 1 pos 13: unknown token unexpected (ident or '/' wanted)'
select extractValue('<.>test</.>','//*');
extractValue('<.>test</.>','//*')
NULL
Warnings:
-Warning 1513 Incorrect XML value: 'parse error at line 1 pos 2: unknown token unexpected (ident or '/' wanted)'
+Warning 1524 Incorrect XML value: 'parse error at line 1 pos 2: unknown token unexpected (ident or '/' wanted)'
select extractValue('<->test</->','//*');
extractValue('<->test</->','//*')
NULL
Warnings:
-Warning 1513 Incorrect XML value: 'parse error at line 1 pos 2: unknown token unexpected (ident or '/' wanted)'
+Warning 1524 Incorrect XML value: 'parse error at line 1 pos 2: unknown token unexpected (ident or '/' wanted)'
select extractValue('<:>test</:>','//*');
extractValue('<:>test</:>','//*')
test
@@ -884,3 +891,124 @@ test
select ExtractValue('<a><self>test</self></a>', '/a/self');
ExtractValue('<a><self>test</self></a>', '/a/self')
test
+set @i=1;
+select ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b[$@i]');
+ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b[$@i]')
+b1
+set @i=2;
+select ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b[$@i]');
+ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b[$@i]')
+b2
+set @i=NULL;
+select ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b[$@i]');
+ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b[$@i]')
+
+CREATE PROCEDURE spxml(xml VARCHAR(128))
+BEGIN
+DECLARE c INT;
+DECLARE i INT DEFAULT 1;
+SET c= ExtractValue(xml,'count(/a/b)');
+SET @i= c;
+WHILE i <= c DO
+BEGIN
+SELECT i, @i, ExtractValue(xml,'/a/b[$i]'), ExtractValue(xml,'/a/b[$@i]');
+SET i= i + 1;
+SET @i= @i - 1;
+END;
+END WHILE;
+END|
+call spxml('<a><b>b1</b><b>b2</b><b>b3</b></a>');
+i @i ExtractValue(xml,'/a/b[$i]') ExtractValue(xml,'/a/b[$@i]')
+1 3 b1 b3
+i @i ExtractValue(xml,'/a/b[$i]') ExtractValue(xml,'/a/b[$@i]')
+2 2 b2 b2
+i @i ExtractValue(xml,'/a/b[$i]') ExtractValue(xml,'/a/b[$@i]')
+3 1 b3 b1
+drop procedure spxml;
+Multiple matches, but no index specification
+SELECT ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b');
+ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b')
+b1 b2
+No matches
+SELECT ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/c');
+ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/c')
+
+Index out of range
+SELECT ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b[-1]');
+ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b[-1]')
+
+SELECT ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b[10]');
+ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b[10]')
+
+With string-to-number conversion
+SELECT ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b["1"]');
+ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b["1"]')
+b1
+SELECT ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b["1 and string"]');
+ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b["1 and string"]')
+b1
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: '1 and string"]'
+Warning 1292 Truncated incorrect INTEGER value: '1 and string"]'
+SELECT ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b["string and 1"]');
+ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b["string and 1"]')
+
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: 'string and 1"]'
+Warning 1292 Truncated incorrect INTEGER value: 'string and 1"]'
+SELECT ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b["string"]');
+ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b["string"]')
+
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: 'string"]'
+Warning 1292 Truncated incorrect INTEGER value: 'string"]'
+String-to-number conversion from a user variable
+SET @i='1';
+SELECT ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b[$@i]');
+ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b[$@i]')
+b1
+SET @i='1 and string';
+SELECT ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b[$@i]');
+ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b[$@i]')
+b1
+SET @i='string and 1';
+SELECT ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b[$@i]');
+ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b[$@i]')
+
+SET @i='string';
+SELECT ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b[$@i]');
+ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b[$@i]')
+
+String-to-number conversion with a CHAR SP variable
+CREATE PROCEDURE spxml(xml VARCHAR(128), i CHAR(16))
+BEGIN
+SELECT ExtractValue(xml,'/a/b[$i]');
+END|
+CALL spxml('<a><b>b1</b><b>b2</b></a>', '1');
+ExtractValue(xml,'/a/b[$i]')
+b1
+CALL spxml('<a><b>b1</b><b>b2</b></a>', '1 and string');
+ExtractValue(xml,'/a/b[$i]')
+b1
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: '1 and string '
+Warning 1292 Truncated incorrect INTEGER value: '1 and string '
+CALL spxml('<a><b>b1</b><b>b2</b></a>', 'string and 1');
+ExtractValue(xml,'/a/b[$i]')
+
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: 'string and 1 '
+Warning 1292 Truncated incorrect INTEGER value: 'string and 1 '
+CALL spxml('<a><b>b1</b><b>b2</b></a>', 'string');
+ExtractValue(xml,'/a/b[$i]')
+
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: 'string '
+Warning 1292 Truncated incorrect INTEGER value: 'string '
+DROP PROCEDURE spxml;
+select UpdateXML('<a>a</a>',repeat('a b ',1000),'');
+ERROR HY000: XPATH syntax error: 'b a b a b a b a b a b a b a b a '
+select ExtractValue('<a>a</a>', '/a[@x=@y0123456789_0123456789_0123456789_0123456789]');
+ERROR HY000: XPATH error: comparison of two nodesets is not supported: '=@y0123456789_0123456789_0123456'
+select ExtractValue('<a>a</a>', '/a[@x=$y0123456789_0123456789_0123456789_0123456789]');
+ERROR HY000: Unknown XPATH variable at: '$y0123456789_0123456789_01234567'
diff --git a/mysql-test/std_data/Index.xml b/mysql-test/std_data/Index.xml
new file mode 100644
index 00000000000..988dddcc68a
--- /dev/null
+++ b/mysql-test/std_data/Index.xml
@@ -0,0 +1,71 @@
+<charsets>
+
+ <charset name="utf8">
+ <collation name="utf8_test_ci" id="240">
+ <rules>
+ <reset>a</reset>
+ <s>b</s>
+ </rules>
+ </collation>
+
+ </charset>
+
+ <charset name="ucs2">
+ <collation name="ucs2_test_ci" id="241">
+ <rules>
+ <reset>a</reset>
+ <s>b</s>
+ </rules>
+ </collation>
+ <collation name="ucs2_vn_ci" id="242">
+ <!-- Vietnamese experimental collation -->
+ <rules>
+ <reset>A</reset>
+ <p>\u0103</p><t>\u0102</t>
+ <s>\u1EB1</s><t>\u1EB0</t>
+ <s>\u1EB3</s><t>\u1EB2</t>
+ <s>\u1EB5</s><t>\u1EB4</t>
+ <s>\u1EAF</s><t>\u1EAE</t>
+ <s>\u1EB7</s><t>\u1EB6</t>
+ <p>\u00E2</p><t>\u00C2</t>
+ <s>\u1EA7</s><t>\u1EA6</t>
+ <s>\u1EA9</s><t>\u1EA8</t>
+ <s>\u1EAB</s><t>\u1EAA</t>
+ <s>\u1EA5</s><t>\u1EA4</t>
+ <s>\u1EAD</s><t>\u1EAC</t>
+ <reset>D</reset>
+ <p>\u0111</p><t>\u0110</t>
+ <reset>E</reset>
+ <p>\u00EA</p><t>\u00CA</t>
+ <s>\u1EC1</s><t>\u1EC0</t>
+ <s>\u1EC3</s><t>\u1EC2</t>
+ <s>\u1EC5</s><t>\u1EC4</t>
+ <s>\u1EBF</s><t>\u1EBE</t>
+ <s>\u1EC7</s><t>\u1EC6</t>
+ <reset>O</reset>
+ <p>\u00F4</p><t>\u00D4</t>
+ <s>\u1ED3</s><t>\u1ED2</t>
+ <s>\u1ED5</s><t>\u1ED4</t>
+ <s>\u1ED7</s><t>\u1ED6</t>
+ <s>\u1ED1</s><t>\u1ED0</t>
+ <s>\u1ED9</s><t>\u1ED8</t>
+ <p>\u01A1</p><t>\u01A0</t>
+ <s>\u1EDD</s><t>\u1EDC</t>
+ <s>\u1EDF</s><t>\u1EDE</t>
+ <s>\u1EE1</s><t>\u1EE0</t>
+ <s>\u1EDB</s><t>\u1EDA</t>
+ <s>\u1EE3</s><t>\u1EE2</t>
+ <reset>U</reset>
+ <p>\u01B0</p><t>\u01AF</t>
+ <s>\u1EEB</s><t>\u1EEA</t>
+ <s>\u1EED</s><t>\u1EEC</t>
+ <s>\u1EEF</s><t>\u1EEE</t>
+ <s>\u1EE9</s><t>\u1EE8</t>
+ <s>\u1EF1</s><t>\u1EF0</t>
+ </rules>
+
+ </collation>
+
+ </charset>
+
+</charsets>
diff --git a/mysql-test/std_data/ndb_backup50/BACKUP-2-0.1.Data b/mysql-test/std_data/ndb_backup50/BACKUP-2-0.1.Data
new file mode 100644
index 00000000000..09e63064666
--- /dev/null
+++ b/mysql-test/std_data/ndb_backup50/BACKUP-2-0.1.Data
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup50/BACKUP-2-0.2.Data b/mysql-test/std_data/ndb_backup50/BACKUP-2-0.2.Data
new file mode 100644
index 00000000000..a8332239d8f
--- /dev/null
+++ b/mysql-test/std_data/ndb_backup50/BACKUP-2-0.2.Data
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup50/BACKUP-2.1.ctl b/mysql-test/std_data/ndb_backup50/BACKUP-2.1.ctl
new file mode 100644
index 00000000000..f54103a2a44
--- /dev/null
+++ b/mysql-test/std_data/ndb_backup50/BACKUP-2.1.ctl
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup50/BACKUP-2.1.log b/mysql-test/std_data/ndb_backup50/BACKUP-2.1.log
new file mode 100644
index 00000000000..5564f952e66
--- /dev/null
+++ b/mysql-test/std_data/ndb_backup50/BACKUP-2.1.log
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup50/BACKUP-2.2.ctl b/mysql-test/std_data/ndb_backup50/BACKUP-2.2.ctl
new file mode 100644
index 00000000000..f54103a2a44
--- /dev/null
+++ b/mysql-test/std_data/ndb_backup50/BACKUP-2.2.ctl
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup50/BACKUP-2.2.log b/mysql-test/std_data/ndb_backup50/BACKUP-2.2.log
new file mode 100644
index 00000000000..5564f952e66
--- /dev/null
+++ b/mysql-test/std_data/ndb_backup50/BACKUP-2.2.log
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1-0.1.Data b/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1-0.1.Data
new file mode 100644
index 00000000000..2df8080956a
--- /dev/null
+++ b/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1-0.1.Data
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1-0.2.Data b/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1-0.2.Data
new file mode 100644
index 00000000000..9033c2735e1
--- /dev/null
+++ b/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1-0.2.Data
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.1.ctl b/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.1.ctl
new file mode 100644
index 00000000000..30fd0a2dda1
--- /dev/null
+++ b/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.1.ctl
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.1.log b/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.1.log
new file mode 100644
index 00000000000..39f7244b014
--- /dev/null
+++ b/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.1.log
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.2.ctl b/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.2.ctl
new file mode 100644
index 00000000000..30fd0a2dda1
--- /dev/null
+++ b/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.2.ctl
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.2.log b/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.2.log
new file mode 100644
index 00000000000..39f7244b014
--- /dev/null
+++ b/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1.2.log
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1-0.1.Data b/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1-0.1.Data
new file mode 100644
index 00000000000..45d4d536c02
--- /dev/null
+++ b/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1-0.1.Data
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1-0.2.Data b/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1-0.2.Data
new file mode 100644
index 00000000000..2c6f93e93b6
--- /dev/null
+++ b/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1-0.2.Data
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.1.ctl b/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.1.ctl
new file mode 100644
index 00000000000..949b7d0be8b
--- /dev/null
+++ b/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.1.ctl
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.1.log b/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.1.log
new file mode 100644
index 00000000000..3686d2718a2
--- /dev/null
+++ b/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.1.log
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.2.ctl b/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.2.ctl
new file mode 100644
index 00000000000..949b7d0be8b
--- /dev/null
+++ b/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.2.ctl
Binary files differ
diff --git a/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.2.log b/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.2.log
new file mode 100644
index 00000000000..3686d2718a2
--- /dev/null
+++ b/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1.2.log
Binary files differ
diff --git a/mysql-test/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc b/mysql-test/std_data/parts/part_supported_sql_funcs_int_ch1.inc
index 8ae6e5fc807..8ae6e5fc807 100644
--- a/mysql-test/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc
+++ b/mysql-test/std_data/parts/part_supported_sql_funcs_int_ch1.inc
diff --git a/mysql-test/suite/parts/inc/part_supported_sql_funcs_int_date.inc b/mysql-test/std_data/parts/part_supported_sql_funcs_int_date.inc
index 9eb41fb007b..9eb41fb007b 100644
--- a/mysql-test/suite/parts/inc/part_supported_sql_funcs_int_date.inc
+++ b/mysql-test/std_data/parts/part_supported_sql_funcs_int_date.inc
diff --git a/mysql-test/suite/parts/inc/part_supported_sql_funcs_int_float.inc b/mysql-test/std_data/parts/part_supported_sql_funcs_int_float.inc
index 34d8b1d1c4d..34d8b1d1c4d 100644
--- a/mysql-test/suite/parts/inc/part_supported_sql_funcs_int_float.inc
+++ b/mysql-test/std_data/parts/part_supported_sql_funcs_int_float.inc
diff --git a/mysql-test/suite/parts/inc/part_supported_sql_funcs_int_int.inc b/mysql-test/std_data/parts/part_supported_sql_funcs_int_int.inc
index d2f5c82a241..d2f5c82a241 100644
--- a/mysql-test/suite/parts/inc/part_supported_sql_funcs_int_int.inc
+++ b/mysql-test/std_data/parts/part_supported_sql_funcs_int_int.inc
diff --git a/mysql-test/suite/parts/inc/part_supported_sql_funcs_int_time.inc b/mysql-test/std_data/parts/part_supported_sql_funcs_int_time.inc
index 941ba418f32..941ba418f32 100644
--- a/mysql-test/suite/parts/inc/part_supported_sql_funcs_int_time.inc
+++ b/mysql-test/std_data/parts/part_supported_sql_funcs_int_time.inc
diff --git a/mysql-test/std_data/server8k-cert.pem b/mysql-test/std_data/server8k-cert.pem
new file mode 100644
index 00000000000..a0750f9e69e
--- /dev/null
+++ b/mysql-test/std_data/server8k-cert.pem
@@ -0,0 +1,51 @@
+-----BEGIN CERTIFICATE-----
+MIIJHDCCBQQCAQEwDQYJKoZIhvcNAQEEBQAwTjELMAkGA1UEBhMCU0UxEDAOBgNV
+BAgTB1VwcHNhbGExETAPBgNVBAoTCE15U1FMIEFCMQ0wCwYDVQQLEwRUZXN0MQsw
+CQYDVQQDEwJDQTAeFw0wNzA3MTMwNzU2MjVaFw0xMDA0MDgwNzU2MjVaMFoxCzAJ
+BgNVBAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxhMRkwFwYDVQQKFBBNeVNRTCAgIAog
+ICAgIEFCMQ0wCwYDVQQLEwRUZXN0MQ8wDQYDVQQDEwZzZXJ2ZXIwggQiMA0GCSqG
+SIb3DQEBAQUAA4IEDwAwggQKAoIEAQDUFlh/3mwov5YaICFXOdJXgHV/uDkTjXB6
+9oxlipshQaYPX8LDT5vhI3gPciS1Z1sRE2dTcC4Mk2K4LDUIjp3WkeTfFAHZPV3E
+Y+3OH/ftH4N6SEIBTKE4EY6ah0nJtU98M0JhxOh5zHje6zQp1SkBnhEOQYexYRqj
+OtGloZ9RyF0iFAXcyu2Ap14u37l5Yla0cyPzvZqP4mFYlcXwaRfAacJmqMM1vuQv
+Fx1JITUTBugMF3VGZ1F0tw63EIUH/FW/WWncPqvG18na40qlv9ZkBw0FhZeKS8cK
+JIY5y4J30jn/eV8p1lTO7K+ASTuGZWmdRDgjUG0Y9OGuKsPPoaE6ml0HTnMBsBSQ
+fXUq9XkwGt8DTgPioAKHBHjLbILEy4FMYWrlTZlPTzNqyhayec/2T15oDladNSt7
+JpDLpX70UECXFhdEGxsGxtXdKbIBvNm2yT4X2nxW9ItsECjSSgD+94TgGoa8QKDw
+rpmgq+Wqpm54CZ1vN1oqyMUw1sjNEX/iLByHAjSALby2Kffk5cl5mnsR6d/k4jsi
+c3Qsciwkd+rQt/8VMhS2ns3nkez/BK3FvQA2Ms8xJhFLfszVrBhnjcFRTNT2+/KM
+lr1oT5Q1XZKL7qVXTpabPL51JlVBL5CSHl1QRkffsqfqcgJkcHBq+kKjUiFs4lad
+hTrvNBCXYa5+NkA2QqIfdOpNwl62/gdE7/7zU1uh40vkVKyzL+APkLPywPEXBOpQ
+yIDNkgoXmS10+JMD44K7uZyUmxZL7W7Xbi30NuEFrVOzoUmVXhapPbpQnkQHxn8n
+tqKPYXdBcvXcCKyJ6i79H2Vk9fM6rBYiwNcE7QyWqfd2QMjzr76veF04sXkPR+tG
+5Y1lrF9Zp3vabFXQg2RJuGA3rV6MR2GFNXuChIYu410vhIhPNtmdKEVoIVZsFsug
++dtn0PDCFrR8VEd/sshp0naNa9Ad1lY+marJkOJOVpPgCs2yJDPAUB/YdvSJ4avW
+6ZdvNTwhBL8fEJMS2DSqkaa6A3+i/SqITpU8ToJxsMGagBsLieXgvJALFysSRfR/
+2dmEu9/J0PPc28inHXwjiLb99VKlkuEz8wX9UkuoqFl0pLa8jrlM8hzdPQ9QHb3k
+9c5knfgPCYkOIWwGXH+NwANHdQRK7CmGAFV24k9+P3q0g5ikabVHr+4ZQ3WPd+1H
+K0+Msbb/vv53vFJWa+pYeNeFcwNCyW2kJBTMiI6qmlL4IWCcX+QDzpRLalbAWWHj
+l5Zk39QEaCL024DYK948IDXCqDg6utEs7YnMdaIF0meYMKjehZFp0fVQ8e8Od+rp
+bbjdj/w60wMgBpSOeYxVrs3QKNZd/if4Az3LggoVHB09SjXKiWpvAgMBAAEwDQYJ
+KoZIhvcNAQEEBQADggQBABncOBW0wQwJdEB6W3d9CrhFp40q1OM54GPfX0/0aUfP
+aOQPxS1uCKcFhxAmR4OT9RiJx+0bhDctekkuMkj5yy3u0a/4PxHIhnVxXTyB0/Hj
+N1gLz6cQricunl6Q4Ldi54gR5/KUehKLBWnqsfxhgzWBHosvhlJC0xh/uio7JTqz
+ns60djyL7R4wGbSqiGdhT9L2HfpJo3dmmWLDxe02jaHkbL1Z6NQMxrRgs3+gctp/
+Wd5UxNl4BHbNsSbzaK9V9gXUcj4TjZGGSqVki0+pEZ3dmksGZdoW9cSKtzKvgUQ6
+vhhqO4dcopxkY2zYeVOpspgTm0XLZSbNPXv5rSFwa4cpWSfD7u8o8KhHvkkSMahw
+cMuH17W4voHHFDtWP8Oq9rA7uE/4/LKCl0JmJl2RWM+G6PMH8w4X4auHPssgRvb/
+Ge1AvgqQJrvi7zWx3XYKKJ0ISBy7fi5Jo/wYgLagRYcG3mwdm1+gAdw+77C/ZGmG
+FbWFIPB1+Mc6azhhk9m/vqP7o/Wuncc99mp2zPMzdAEzuzp/IJ9UJNat0edA7jiC
+bQ7JSRJ1DSzdJZSWWHdardLNKipPfrEHVm7f5QvL5DQLnGpt+rCWL361KsGtvETC
+o+Ph7+kDJsJLokUYfs/BEZopzspNPy/NQ2ECwQp7T4Yq/PBE6Ce/dFaoZysMUOrG
+TcALtJW6It98dRmTJPiqjlrlHNTrfoV3Aiy+tK4rpyGuApSHc+1Y+t7YvWotRlQ4
+GEboBqR8evjDPJ1xAaUZqwLkebf3mlpl4MzHM9uNWBkQdJilkQs/IrAaApG3Ayt0
+nIymNHmDslBEdrRGmT4aNWAWYvVYzyKDy3H0fzYdWwuA9goJUL4tj3eMJa8pgEU/
+rG3HfflVi+xuwm1UnLXPSIE8hixgV8ebnwcCnEjlUBvwpl7f5Ub40jKcdycdGvVu
+gcTUzuRl1+Ikfk/MXKPbdi4A5Pjtz6AG4Ez9q5j7X77JqskTI5Z/f1RPiKwFBJHg
+cN4+BPnEuSWGcjiNDOfQxhk5exlWRf/gpEhnQpGHe3a7tZgfxHUb/pWU9BYpf8OH
+vtV3WSDXlUqsEEH6/bmvj8lmFWJLmeZv+qLy1wHxcXR9/GJ6TwCF8niQIl3MrBAL
+sKPLft1drmpqdIQpZQIJxtN/AQuD9mxEdW7XA6rkvFySKcswJpS1QjkSWpafCBWE
+wu+SPxZL8oFrnNMTU3JloUjcRp70FkNXLLm/Dy+MjW2qFBtIoBgNptVGp94L1uZS
+amd2XJMcOQ+X9fcH3wAdM3IHGn3NiLf6eTW92JNNA0IN6aNtyVaJKmFJ1JfXOl9r
+ujr4SorRSesaerjIcuzW1u1YE5RlgeI4kizV2/D5kYc=
+-----END CERTIFICATE-----
diff --git a/mysql-test/std_data/server8k-key.pem b/mysql-test/std_data/server8k-key.pem
new file mode 100644
index 00000000000..608593a5096
--- /dev/null
+++ b/mysql-test/std_data/server8k-key.pem
@@ -0,0 +1,99 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIISKQIBAAKCBAEA1BZYf95sKL+WGiAhVznSV4B1f7g5E41wevaMZYqbIUGmD1/C
+w0+b4SN4D3IktWdbERNnU3AuDJNiuCw1CI6d1pHk3xQB2T1dxGPtzh/37R+DekhC
+AUyhOBGOmodJybVPfDNCYcToecx43us0KdUpAZ4RDkGHsWEaozrRpaGfUchdIhQF
+3MrtgKdeLt+5eWJWtHMj872aj+JhWJXF8GkXwGnCZqjDNb7kLxcdSSE1EwboDBd1
+RmdRdLcOtxCFB/xVv1lp3D6rxtfJ2uNKpb/WZAcNBYWXikvHCiSGOcuCd9I5/3lf
+KdZUzuyvgEk7hmVpnUQ4I1BtGPThrirDz6GhOppdB05zAbAUkH11KvV5MBrfA04D
+4qAChwR4y2yCxMuBTGFq5U2ZT08zasoWsnnP9k9eaA5WnTUreyaQy6V+9FBAlxYX
+RBsbBsbV3SmyAbzZtsk+F9p8VvSLbBAo0koA/veE4BqGvECg8K6ZoKvlqqZueAmd
+bzdaKsjFMNbIzRF/4iwchwI0gC28tin35OXJeZp7Eenf5OI7InN0LHIsJHfq0Lf/
+FTIUtp7N55Hs/wStxb0ANjLPMSYRS37M1awYZ43BUUzU9vvyjJa9aE+UNV2Si+6l
+V06Wmzy+dSZVQS+Qkh5dUEZH37Kn6nICZHBwavpCo1IhbOJWnYU67zQQl2GufjZA
+NkKiH3TqTcJetv4HRO/+81NboeNL5FSssy/gD5Cz8sDxFwTqUMiAzZIKF5ktdPiT
+A+OCu7mclJsWS+1u124t9DbhBa1Ts6FJlV4WqT26UJ5EB8Z/J7aij2F3QXL13Ais
+ieou/R9lZPXzOqwWIsDXBO0Mlqn3dkDI86++r3hdOLF5D0frRuWNZaxfWad72mxV
+0INkSbhgN61ejEdhhTV7goSGLuNdL4SITzbZnShFaCFWbBbLoPnbZ9Dwwha0fFRH
+f7LIadJ2jWvQHdZWPpmqyZDiTlaT4ArNsiQzwFAf2Hb0ieGr1umXbzU8IQS/HxCT
+Etg0qpGmugN/ov0qiE6VPE6CcbDBmoAbC4nl4LyQCxcrEkX0f9nZhLvfydDz3NvI
+px18I4i2/fVSpZLhM/MF/VJLqKhZdKS2vI65TPIc3T0PUB295PXOZJ34DwmJDiFs
+Blx/jcADR3UESuwphgBVduJPfj96tIOYpGm1R6/uGUN1j3ftRytPjLG2/77+d7xS
+VmvqWHjXhXMDQsltpCQUzIiOqppS+CFgnF/kA86US2pWwFlh45eWZN/UBGgi9NuA
+2CvePCA1wqg4OrrRLO2JzHWiBdJnmDCo3oWRadH1UPHvDnfq6W243Y/8OtMDIAaU
+jnmMVa7N0CjWXf4n+AM9y4IKFRwdPUo1yolqbwIDAQABAoIEAQDI3u0tFoWMRoCs
+99d8HLiaxYED2YC9gw2QeKjal198LQhRsVnu0ByMLKLOxkX8RgrbbmxDe5Exufob
+A0urciAOFJoXqoRhs5x2oEqgGmkf/ePx0jQptOFREFfnBdGeKIpC0O3DWdLxYPbt
+8wixwkEXVhVDUk9pcdXf2ZqsbBpQRBvpZdtzlgNCAcLTVHP/gmMqf48CkIauVjPq
+ydfybibfx4sm3hodclH+Q78p/zicb8MhiKo7ZymgCKz4N743pQe1tsLrpbPeHY0C
+MpoFyF8O2Bq+KxwvELxQX+19GcHVKJhj3hmCr4wde9BxCWtGTBCusekVkVvy8iQ5
+aCmTIrtonMEVZXjJlXK0sw5hBKOmKx0jrSVC5FfgdxzNVlW4fCJXLEEpMsjMc+/3
+6bV7jqGn4N5CYaopNS2ccxdaucE3NjcmofahO6bqUTJHSPFecfYmCA42W2m+ldjj
+HZ78JLkyw03nT1hjPjbwHf5FTem1KfKg4EJrDprowMT7D8KZb0SW+z59pFoDOM5u
+Heu6sOSUtvpvKfozdw2ZAI58dhpW4/jTfCEtewRhPqE3/V7g3haTnQFxU8gm/a4N
+uefZTCjFE16QWNuvnUrJWw/DlvOBY8GjpQCWY0mDeBHPNOI0Xg9oRTgOCrKSLUya
+YSbg6BmhSKwKsYQU834jrQb3fXFlXZVIxlcNePOWMhHFFNAHucHF822Nr7u/3FOT
+twcbBIOXCGfDT6ed8d4dNum1L7k9Blju16CWkfuciL8PGXY4mGAmF4nZMXGZgK8B
+Cz9cxhtvFLe8gz5615DtBAsuVm7Q4AAHiULAMg6t6auyxCb8pXbAL0Ec5X4zS3+f
+I2riODYiyHCh/qTtjawOzUZZEtjZRMSDi+jk8wjjDdkFU8McOaYoPyqT3TDy2v6m
+NiPJs8GWQ2NCNo9CNoGbEIIFFP5iSz18XLFAOF+2dN/KHHl9nKyi7kOhYbbzoNku
+2wQV40yVsrS4E/hd/7+2IB2Muduxiu7NxCUSUXsw6p0hZTYMpIoduEfRSk1al0lS
+862GD8JgJ4RhJ0uIOTDJS52MQmO8zFIL86emdjjV1CzVvadYSQLTX7ZgR0i8g46A
+y0muCFAC8EJpnEtHzqtQ/z22zB8TCJShFuUK9KF6K8nOlbc6ShcUXU2J6r1sc8aT
+Dx0yzRXfCL15fpCJBP49EYaKhArTNmFRa2GaLiJP0OYkTrrwVOGuS6x2+kRVoP/8
+BcNMZ5x8mXP1LgotHCztgMKX30Hn5CLxbH8QfcWKemGva1jBmhCWxS17Gh3Ld9T3
+/WKkBa6JDq83rlO84x/iF3mB3tYkZPfcYtYURn5wwm/BmVV/9G1VwAatJdxmfCSy
+5JwC9WDBAoICAQD7xStPk3lq+qYHAtLZidujmzSNv7XG+E8UC9yvMRFuBwSM5ZE4
+YGD2LDev2nghB+7OSR8KJIkxeaNjP91Zf3s8wjCuxLg/cLGI6mf6uWy9+zypFg3i
+J+ylDKa6NBuqYyY75W7Pj63xvGQlw5kX5+mB3ulQbActT4cUiVdEkyDytzubqLzY
+s15QGFrL9gqLow+C+7LKQKdeXq8OavFV1PWkMDAJUki6cIir9m+f5Mqr2cQCLKgx
+38aX8c9UWJv6pI5zQQuBjpaBOwz07WnyTXiFpc71x/8i85uLGDM0e3VO5ZPGeRBj
+jZ0ucHatOHJ3i/nPRG16rsPR+q97QiDHoLF0quHEG+ND+rwTBzNGIwzYRE16p1o3
+UdzFk1RzlDCfOX7QgszCwK6mf8TbCK9f/FxJ5e6TCkt3iHXSrlLS4op6k9nEpKFH
+KHf4nPtCy9GriP+A8+dA6K1s+DgejoIojBMBTsnl4TEf+m8BaenTXGuU7KYyc8dR
+JqmpmDggDRT/ImHRhXirY7lIIYXnI7tRjN5gmnKpEiHScT1r848zpQ4gWH1Dx/ks
+mKT6NZ8nF45saQCYbKEYc0RH9Kw0O7vr1kVtNPc2dEZtVgt4bC5fnl7xX1/YTk3m
++h1qfzbku/+MX5rRjHLR2l8a71UltlnnnpP5NKBBgtxll6aCIkk6CdH8YQKCAgEA
+16aBaVa0cOZmiOQwPQkpuXIbV7msz1ttWEAHElCy6waniOCON89PYFCb7F0NjV3Q
+i+pGaRgG1iZGbjjHwyqTrHhMloFm+IsSWZqOZzrHgSJgA4bgTJFgp+5b31sQXGfJ
+14QQSqMJLC61/M+CnrNtiuI3IVHx6BFRxI42uE7PfTyUMaFhL9F0/SLl0Mw0oMPj
+S5kmarduuKpRn1tN9WO+ywEvYwopvH3e9PBssZzPpttlLiE/Wulb0iEtlVXYB9DS
+Vzc94N2dzFMIvWUDF9BQ+IBMRzXRm15Psy6LfzoK+9S6w38Dx3BVV8ykSMKeW1UR
+ZwTajjdnIBLdE3onD5XMmrSOPw/WtV5zXEYY4DObhIPoN2iD8GJP0IubPb6fonH5
+VHmuVZoXrroFEe7rdt2wgmBdPPl6fqvBKVhjJOpYQctrFLgWh63bXZKaBWqbQM9W
+fECq8We1VN3fzqwfwJQit3z5R/DjQNk8eQx7SnnkOzAY6ZgpysHCwaoPOnPVuiYF
+ZU0+X3iwfsdeefWmGEDIzoZk6nYaljs61lOhhEoWHngZHDkMOp5kg0n9f8BUP02+
+WJ4QhwzZ73hr4FPBuPHHXECw9TCAgCBHBFrnrXg5QalDhRXz4F+3tCY7UUpD/ikZ
+L6Daxm5zGJ5u3rXs6WwKy2EHVVS9zfqs4Q259pQdWM8CggIAcIKpGzOVM+h033c0
+kIBZxeAq+Rlt+0+lzxiJ80RjPJ8oOmqwndf8HKaf8BcaTfCEmGz20QqIwLJSAJ1e
+posgoINLTB6fE8Kho8TU2KeaX7/xWMKBS8p5pzxjGZ0Fq/wI7wVVoq3blsaQnout
+U5CQujfKXeUYw/fhLp09gWiadbzKh4I9ej2V7QclNDZsegBRg0BForqH0NVRN4k0
+9h1n9IqQPOonlCGMAgTr1zFgHLIBNNOOClOtJOOruk6qzbRR8FFl+eyld3TTEnUy
+PlS+gkMZnJ5WduEUZnFXGKH/R1Wy1yPs3gA/+KvLbRdnl+LWrPgwUH3fBmwXlWZ0
+zaETDEb9Ay1PP2bCO2KhWDt7lv3W/fPhjg0oMqbnO4tCuzTvZfC93l5K7h708skL
+zkIxX9i/57fXB8DUnmTGoHUaWzLNQ2IqrGj6TACjDDOXLCfZvl/AvTH9pk+6jHU0
+1zfZmmECOpeK43Z/ussA8jI/5Vpn3u38aVh0w1RB6JjQBD/yJLaXuUekWgaZFzTR
+ldz014jNqp5uvONcBmzeVr7w9CV3PR4VTQed2i6yQ770J6A44uTQjOOd5OYDOohj
+Lz4e4nGj9BK8Eko8cAEwLAzS8tyjMT+08n5dPOVCu68DwVBMGE7CVONYUuoXS/YU
+cTxddiU9ZGk9Yq0FfOwjeys+SqECggIAdn3M2b6Egwx2Bn2ra74fKQBjub4SEBWi
+bT0xJYUl6jHL2E/alRvZ94gTRLqUebq0nkxpx9El4IFDbcjRKpG4dqnbG0+a7rIr
+sQRVfq8zc+cZbparpCa1P1CfNojo4n080KiF8xzGK3q3EGRM1zqr1AYcWLiX/PWX
+QjMKKhdTtvKUUvjjV8z1RSnpsOKjgDpiJ+XM0BJeSiV7l94pZc4axZyvFvI8oI9g
+9KEueCE7j+k5HTGziBZ1F26Xh1iVzSWWjcmSvH3I+L4fLUHVgz45X3HPd8lAlOgr
+Tr8icxPHeTwYKtcdknZMzmNpWXlmXbTOTRbDqCUVCvCSfOM/lzauJ8tR5aCkTx/I
+r0js3jQ9HYEFFXzeEjVSubob4L9fI3kQkLQTcIGsxZr8si/fPX7uP5UHZjuGbRee
+mUMxptUFDZHiEo5cAs0qna2x54v+JoxGbxtxUhez8R/Am+TDxaMfuEZ5Cmh31egH
+bFPJYtC68TKqXZ/4RqpUgukYWPvQ0emWSWU6AmdkQyT06nppeyYNsDz0MkgWr7l3
+yNBHDVNP+Anxcip+Z68kd2cuXQWmxOnIzxR67FnJXeWDEM20whRHgI8jLHYsBTq3
+CtOQPSaz/zosGXJIgF7Xp6riKPZvibW3Ww49Z47EuyBCtyirNk7hV4LG7sITUJyO
+ZVKPfcdAoM0CggIBANz3EBZGyt3af2UjFFKbazV01KcHF8OxqdQzsLqHCXWb98V6
+PggQnrF76U7DvqOWho9djDBPrbQU55HG5nXq+eZKPwhsOdwQ8bxOhaVxQcATZOI7
+FtJYnjM1/+zMzzS0iPR5DA2pbB3AKH2Z+wODmF23CK2XTwoJyPKxvlyGKrIqq3gN
+kOmocNu2Qm5bJf+D/hYPm5Ust2wzD52NnvJU536bZ0ZMo1/kaK2idqSAzqo4TkR1
+j9U0fdW2rIBDo/qFmBBdJhYVjYLj4qR8CEEoIjshD4Nztf1xRM5C8irE/gJcT5+r
+4bPJJ5TjAtHxPiQqZruSprSEUbMsPqBap64ow0SmbNNWSgyaz2ha1rG0p52NBzH4
+XM52LBqS9QHPHvB0ooYfBTfPpDM3CePuuNyzjPAw86ncUo38FKXuc2oViJJ6C5I7
+v2sKhLK5gu3uPBB2ludDEXSpWBqiraynolOT/o52r+taYp9YY2WU3GrhOiV/A1FV
+Nl118xiF6FOFpEeTbhHvy27A8kZEKXgeSs+f4aC0XG9kLVD1CiCbQiqHTDcDS4nV
+O1N1eQxhP81X+YKE4Lgufh07REqYVwtCj2lQcMp73WDyfBLKTEFlmHusoqmT5JCH
+X0BWNjk5Dn1g5h63/lQb+EjNRILBhDFYhrDRDQtw5p0/7IY3AcNKDUHv+XGn
+-----END RSA PRIVATE KEY-----
diff --git a/mysql-test/suite/binlog/r/binlog_innodb.result b/mysql-test/suite/binlog/r/binlog_innodb.result
new file mode 100644
index 00000000000..34538eb5215
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_innodb.result
@@ -0,0 +1,171 @@
+SET BINLOG_FORMAT=MIXED;
+RESET MASTER;
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=INNODB;
+INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6);
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+UPDATE t1 SET b = 2*a WHERE a > 1;
+COMMIT;
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+UPDATE t1 SET b = a * a WHERE a > 3;
+COMMIT;
+SET BINLOG_FORMAT=STATEMENT;
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+UPDATE t1 SET b = 1*a WHERE a > 1;
+ERROR HY000: Binary logging not possible. Message: Transaction level 'READ-UNCOMMITTED' in InnoDB is not safe for binlog mode 'STATEMENT'
+COMMIT;
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+UPDATE t1 SET b = 2*a WHERE a > 2;
+ERROR HY000: Binary logging not possible. Message: Transaction level 'READ-COMMITTED' in InnoDB is not safe for binlog mode 'STATEMENT'
+COMMIT;
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+UPDATE t1 SET b = 3*a WHERE a > 3;
+COMMIT;
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+UPDATE t1 SET b = 4*a WHERE a > 4;
+COMMIT;
+SET BINLOG_FORMAT=MIXED;
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+UPDATE t1 SET b = 1*a WHERE a > 1;
+COMMIT;
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+UPDATE t1 SET b = 2*a WHERE a > 2;
+COMMIT;
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+UPDATE t1 SET b = 3*a WHERE a > 3;
+COMMIT;
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+UPDATE t1 SET b = 4*a WHERE a > 4;
+COMMIT;
+SET BINLOG_FORMAT=ROW;
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+UPDATE t1 SET b = 1*a WHERE a > 1;
+COMMIT;
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+UPDATE t1 SET b = 2*a WHERE a > 2;
+COMMIT;
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+UPDATE t1 SET b = 3*a WHERE a > 3;
+COMMIT;
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+UPDATE t1 SET b = 4*a WHERE a > 4;
+COMMIT;
+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 PRIMARY KEY, b INT) ENGINE=INNODB
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6)
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Query # # use `test`; UPDATE t1 SET b = 2*a WHERE a > 1
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Query # # use `test`; UPDATE t1 SET b = 3*a WHERE a > 3
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Query # # use `test`; UPDATE t1 SET b = 4*a WHERE a > 4
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Query # # use `test`; UPDATE t1 SET b = 3*a WHERE a > 3
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Query # # use `test`; UPDATE t1 SET b = 4*a WHERE a > 4
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+DROP TABLE t1;
+show status like "binlog_cache_use";
+Variable_name Value
+Binlog_cache_use 13
+show status like "binlog_cache_disk_use";
+Variable_name Value
+Binlog_cache_disk_use 0
+create table t1 (a int) engine=innodb;
+show status like "binlog_cache_use";
+Variable_name Value
+Binlog_cache_use 14
+show status like "binlog_cache_disk_use";
+Variable_name Value
+Binlog_cache_disk_use 1
+begin;
+delete from t1;
+commit;
+show status like "binlog_cache_use";
+Variable_name Value
+Binlog_cache_use 15
+show status like "binlog_cache_disk_use";
+Variable_name Value
+Binlog_cache_disk_use 1
+drop table t1;
+CREATE TABLE `t1` (
+`a` int(11) NOT NULL auto_increment,
+`b` int(11) default NULL,
+PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
+CREATE TABLE `t2` (
+`a` int(11) NOT NULL auto_increment,
+`b` int(11) default NULL,
+PRIMARY KEY (`a`)
+) ENGINE=INNODB DEFAULT CHARSET=latin1 ;
+insert into t1 values (1,1),(2,2);
+insert into t2 values (1,1),(4,4);
+reset master;
+UPDATE t2,t1 SET t2.a=t1.a+2;
+ERROR 23000: Duplicate entry '3' for key 'PRIMARY'
+select * from t2 /* must be (3,1), (4,4) */;
+a b
+1 1
+4 4
+show master status /* there must no UPDATE in binlog */;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000001 106
+delete from t1;
+delete from t2;
+insert into t1 values (1,2),(3,4),(4,4);
+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 */;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000001 106
+drop table t1, t2;
+End of tests
diff --git a/mysql-test/suite/binlog/r/binlog_killed.result b/mysql-test/suite/binlog/r/binlog_killed.result
new file mode 100644
index 00000000000..ba4f38fb4c1
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_killed.result
@@ -0,0 +1,12 @@
+create table t1 (a int auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB;
+create table t2 (a int auto_increment, b int, PRIMARY KEY (a)) ENGINE=MyISAM;
+create table t3 (a int auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB;
+select get_lock("a", 20);
+get_lock("a", 20)
+1
+reset master;
+insert into t2 values (null, null), (null, get_lock("a", 10));
+select @result /* must be zero either way */;
+@result
+0
+drop table t1,t2,t3;
diff --git a/mysql-test/suite/binlog/r/binlog_multi_engine.result b/mysql-test/suite/binlog/r/binlog_multi_engine.result
new file mode 100644
index 00000000000..67c3412ec15
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_multi_engine.result
@@ -0,0 +1,86 @@
+CREATE TABLE t1m (m INT, n INT) ENGINE=MYISAM;
+CREATE TABLE t1b (b INT, c INT) ENGINE=BLACKHOLE;
+CREATE TABLE t1n (e INT, f INT) ENGINE=NDB;
+RESET MASTER;
+SET SESSION BINLOG_FORMAT=STATEMENT;
+INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2);
+INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2);
+UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c;
+*** Please look in binlog_multi_engine.test if you have a diff here ****
+START TRANSACTION;
+INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2);
+UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
+UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c;
+COMMIT;
+TRUNCATE t1m;
+TRUNCATE t1b;
+TRUNCATE t1n;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2)
+master-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Query # # use `test`; INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2)
+master-bin.000001 # Query # # use `test`; UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f
+master-bin.000001 # Query # # use `test`; UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c
+master-bin.000001 # Query # # use `test`; COMMIT
+master-bin.000001 # Query # # use `test`; TRUNCATE t1m
+master-bin.000001 # Query # # use `test`; TRUNCATE t1b
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1n)
+master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Query # # use `test`; TRUNCATE t1n
+RESET MASTER;
+SET SESSION BINLOG_FORMAT=MIXED;
+INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2);
+INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2);
+INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2);
+UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c;
+UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
+ERROR HY000: Binary logging not possible. Message: Statement cannot be written atomically since more than one engine involved and at least one engine is self-logging
+UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c;
+ERROR HY000: Binary logging not possible. Message: Statement cannot be written atomically since more than one engine involved and at least one engine is self-logging
+TRUNCATE t1m;
+TRUNCATE t1b;
+TRUNCATE t1n;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2)
+master-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c
+master-bin.000001 # Query # # use `test`; TRUNCATE t1m
+master-bin.000001 # Query # # use `test`; TRUNCATE t1b
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1n)
+master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Query # # use `test`; TRUNCATE t1n
+RESET MASTER;
+SET SESSION BINLOG_FORMAT=ROW;
+INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2);
+INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2);
+ERROR HY000: Binary logging not possible. Message: Row-based format required for this statement, but not allowed by this combination of engines
+INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2);
+UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c;
+ERROR HY000: Binary logging not possible. Message: Row-based format required for this statement, but not allowed by this combination of engines
+UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
+ERROR HY000: Binary logging not possible. Message: Statement cannot be written atomically since more than one engine involved and at least one engine is self-logging
+UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c;
+ERROR HY000: Binary logging not possible. Message: Row-based format required for this statement, but not allowed by this combination of engines
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Table_map # # table_id: # (test.t1m)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1n)
+master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+RESET MASTER;
+DROP TABLE t1m, t1b, t1n;
diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result
new file mode 100644
index 00000000000..fd91f65bbb5
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result
@@ -0,0 +1,1177 @@
+drop table if exists t1, t2;
+reset master;
+create table t1 (a int) engine=innodb;
+create table t2 (a int) engine=innodb;
+begin;
+insert t1 values (5);
+commit;
+begin;
+insert t2 values (5);
+commit;
+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) engine=innodb
+master-bin.000001 # Query # # use `test`; create table t2 (a int) engine=innodb
+master-bin.000001 # Query # # use `test`; 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 # # use `test`; BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t2)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+drop table t1,t2;
+reset master;
+create table t1 (n int) engine=innodb;
+begin;
+commit;
+drop table t1;
+show binlog events in 'master-bin.000001' from 106;
+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 # use `test`; 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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+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 # 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;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Query 1 # use `test`; drop table t1
+set @ac = @@autocommit;
+set autocommit= 0;
+reset master;
+create table t1(n int) engine=innodb;
+begin;
+insert into t1 values (1);
+insert into t1 values (2);
+insert into t1 values (3);
+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 use `test`; 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 206 Query 1 274 use `test`; 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
+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
+drop table t1;
+set global binlog_cache_size=@bcs;
+set session autocommit = @ac;
+End of 5.0 tests
+reset master;
+create table t1 (id tinyint auto_increment primary key);
+set insert_id=128;
+insert into t1 values(null);
+Warnings:
+Warning 1264 Out of range value for column 'id' at row 1
+select * from t1;
+id
+127
+drop table t1;
+create table t1 (a int);
+create table if not exists t2 select * from t1;
+create temporary table tt1 (a int);
+create table if not exists t3 like tt1;
+USE mysql;
+INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test');
+UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@';
+DELETE FROM user WHERE host='localhost' AND user='@#@';
+use test;
+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 (id tinyint auto_increment primary key)
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `test`; drop table t1
+master-bin.000001 # Query # # use `test`; create table t1 (a int)
+master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t2` (
+ `a` int(11) DEFAULT NULL
+)
+master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t3` (
+ `a` int(11) DEFAULT NULL
+)
+master-bin.000001 # Table_map # # table_id: # (mysql.user)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysql.user)
+master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysql.user)
+master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
+drop table t1,t2,t3,tt1;
+create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
+set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
+insert delayed into t1 values (207);
+insert delayed into t1 values (null);
+insert delayed into t1 values (300);
+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 (id tinyint auto_increment primary key)
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `test`; drop table t1
+master-bin.000001 # Query # # use `test`; create table t1 (a int)
+master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t2` (
+ `a` int(11) DEFAULT NULL
+)
+master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t3` (
+ `a` int(11) DEFAULT NULL
+)
+master-bin.000001 # Table_map # # table_id: # (mysql.user)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysql.user)
+master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysql.user)
+master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2`,`t3` /* generated by server */
+master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam
+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 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+insert delayed into t1 values (null),(null),(null),(null);
+insert delayed into t1 values (null),(null),(400),(null);
+11 == 11
+select * from t1;
+a
+207
+208
+300
+301
+302
+303
+304
+305
+306
+400
+401
+drop table t1;
+reset master;
+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
+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
+drop table t3;
diff --git a/mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result b/mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result
new file mode 100644
index 00000000000..ef9f76b7d9c
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result
@@ -0,0 +1,11393 @@
+drop table if exists t1;
+drop table if exists t2;
+drop table if exists t3;
+drop table if exists t4;
+set names cp932;
+set character_set_database = cp932;
+CREATE TABLE t1(c1 CHAR(1)) DEFAULT CHARACTER SET = cp932;
+INSERT INTO t1 VALUES
+(0x05),(0x7E),(0x815C),(0x815F),(0x8160),(0x8161),(0x817C),(0x8191),(0x8192),(0x81CA);
+INSERT INTO t1 VALUES
+(0x8740),(0x8741),(0x8742),(0x8743),(0x8744),(0x8745),(0x8746),(0x8747),
+(0x8748),(0x8749),(0x874A),(0x874B),(0x874C),(0x874D),(0x874E),(0x874F),
+(0x8750),(0x8751),(0x8752),(0x8753),(0x8754),(0x8755),(0x8756),(0x8757),
+(0x8758),(0x8759),(0x875A),(0x875B),(0x875C),(0x875D),(0x875F),
+(0x8760),(0x8761),(0x8762),(0x8763),(0x8764),(0x8765),(0x8766),(0x8767),
+(0x8768),(0x8769),(0x876A),(0x876B),(0x876C),(0x876D),(0x876E),(0x876F),
+(0x8770),(0x8771),(0x8772),(0x8773),(0x8774),(0x8775),(0x877E),
+(0x8780),(0x8781),(0x8782),(0x8783),(0x8784),(0x8785),(0x8786),(0x8787),
+(0x8788),(0x8789),(0x878A),(0x878B),(0x878C),(0x878D),(0x878E),(0x878F),
+(0x8790),(0x8791),(0x8792),(0x8793),(0x8794),(0x8795),(0x8796),(0x8797),
+(0x8798),(0x8799),(0x879A),(0x879B),(0x879C);
+INSERT INTO t1 VALUES
+(0xED40),(0xED41),(0xED42),(0xED43),(0xED44),(0xED45),(0xED46),(0xED47),
+(0xED48),(0xED49),(0xED4A),(0xED4B),(0xED4C),(0xED4D),(0xED4E),(0xED4F),
+(0xED50),(0xED51),(0xED52),(0xED53),(0xED54),(0xED55),(0xED56),(0xED57),
+(0xED58),(0xED59),(0xED5A),(0xED5B),(0xED5C),(0xED5D),(0xED5E),(0xED5F),
+(0xED60),(0xED61),(0xED62),(0xED63),(0xED64),(0xED65),(0xED66),(0xED67),
+(0xED68),(0xED69),(0xED6A),(0xED6B),(0xED6C),(0xED6D),(0xED6E),(0xED6F),
+(0xED70),(0xED71),(0xED72),(0xED73),(0xED74),(0xED75),(0xED76),(0xED77),
+(0xED78),(0xED79),(0xED7A),(0xED7B),(0xED7C),(0xED7D),(0xED7E),
+(0xED80),(0xED81),(0xED82),(0xED83),(0xED84),(0xED85),(0xED86),(0xED87),
+(0xED88),(0xED89),(0xED8A),(0xED8B),(0xED8C),(0xED8D),(0xED8E),(0xED8F),
+(0xED90),(0xED91),(0xED92),(0xED93),(0xED94),(0xED95),(0xED96),(0xED97),
+(0xED98),(0xED99),(0xED9A),(0xED9B),(0xED9C),(0xED9D),(0xED9E),(0xED9F),
+(0xEDA0),(0xEDA1),(0xEDA2),(0xEDA3),(0xEDA4),(0xEDA5),(0xEDA6),(0xEDA7),
+(0xEDA8),(0xEDA9),(0xEDAA),(0xEDAB),(0xEDAC),(0xEDAD),(0xEDAE),(0xEDAF),
+(0xEDB0),(0xEDB1),(0xEDB2),(0xEDB3),(0xEDB4),(0xEDB5),(0xEDB6),(0xEDB7),
+(0xEDB8),(0xEDB9),(0xEDBA),(0xEDBB),(0xEDBC),(0xEDBD),(0xEDBE),(0xEDBF),
+(0xEDC0),(0xEDC1),(0xEDC2),(0xEDC3),(0xEDC4),(0xEDC5),(0xEDC6),(0xEDC7),
+(0xEDC8),(0xEDC9),(0xEDCA),(0xEDCB),(0xEDCC),(0xEDCD),(0xEDCE),(0xEDCF),
+(0xEDD0),(0xEDD1),(0xEDD2),(0xEDD3),(0xEDD4),(0xEDD5),(0xEDD6),(0xEDD7),
+(0xEDD8),(0xEDD9),(0xEDDA),(0xEDDB),(0xEDDC),(0xEDDD),(0xEDDE),(0xEDDF),
+(0xEDE0),(0xEDE1),(0xEDE2),(0xEDE3),(0xEDE4),(0xEDE5),(0xEDE6),(0xEDE7),
+(0xEDE8),(0xEDE9),(0xEDEA),(0xEDEB),(0xEDEC),(0xEDED),(0xEDEE),(0xEDEF),
+(0xEDF0),(0xEDF1),(0xEDF2),(0xEDF3),(0xEDF4),(0xEDF5),(0xEDF6),(0xEDF7),
+(0xEDF8),(0xEDF9),(0xEDFA),(0xEDFB),(0xEDFC),
+(0xEE40),(0xEE41),(0xEE42),(0xEE43),(0xEE44),(0xEE45),(0xEE46),(0xEE47),
+(0xEE48),(0xEE49),(0xEE4A),(0xEE4B),(0xEE4C),(0xEE4D),(0xEE4E),(0xEE4F),
+(0xEE50),(0xEE51),(0xEE52),(0xEE53),(0xEE54),(0xEE55),(0xEE56),(0xEE57),
+(0xEE58),(0xEE59),(0xEE5A),(0xEE5B),(0xEE5C),(0xEE5D),(0xEE5E),(0xEE5F),
+(0xEE60),(0xEE61),(0xEE62),(0xEE63),(0xEE64),(0xEE65),(0xEE66),(0xEE67),
+(0xEE68),(0xEE69),(0xEE6A),(0xEE6B),(0xEE6C),(0xEE6D),(0xEE6E),(0xEE6F),
+(0xEE70),(0xEE71),(0xEE72),(0xEE73),(0xEE74),(0xEE75),(0xEE76),(0xEE77),
+(0xEE78),(0xEE79),(0xEE7A),(0xEE7B),(0xEE7C),(0xEE7D),(0xEE7E),
+(0xEE80),(0xEE81),(0xEE82),(0xEE83),(0xEE84),(0xEE85),(0xEE86),(0xEE87),
+(0xEE88),(0xEE89),(0xEE8A),(0xEE8B),(0xEE8C),(0xEE8D),(0xEE8E),(0xEE8F),
+(0xEE90),(0xEE91),(0xEE92),(0xEE93),(0xEE94),(0xEE95),(0xEE96),(0xEE97),
+(0xEE98),(0xEE99),(0xEE9A),(0xEE9B),(0xEE9C),(0xEE9D),(0xEE9E),(0xEE9F),
+(0xEEA0),(0xEEA1),(0xEEA2),(0xEEA3),(0xEEA4),(0xEEA5),(0xEEA6),(0xEEA7),
+(0xEEA8),(0xEEA9),(0xEEAA),(0xEEAB),(0xEEAC),(0xEEAD),(0xEEAE),(0xEEAF),
+(0xEEB0),(0xEEB1),(0xEEB2),(0xEEB3),(0xEEB4),(0xEEB5),(0xEEB6),(0xEEB7),
+(0xEEB8),(0xEEB9),(0xEEBA),(0xEEBB),(0xEEBC),(0xEEBD),(0xEEBE),(0xEEBF),
+(0xEEC0),(0xEEC1),(0xEEC2),(0xEEC3),(0xEEC4),(0xEEC5),(0xEEC6),(0xEEC7),
+(0xEEC8),(0xEEC9),(0xEECA),(0xEECB),(0xEECC),(0xEECD),(0xEECE),(0xEECF),
+(0xEED0),(0xEED1),(0xEED2),(0xEED3),(0xEED4),(0xEED5),(0xEED6),(0xEED7),
+(0xEED8),(0xEED9),(0xEEDA),(0xEEDB),(0xEEDC),(0xEEDD),(0xEEDE),(0xEEDF),
+(0xEEE0),(0xEEE1),(0xEEE2),(0xEEE3),(0xEEE4),(0xEEE5),(0xEEE6),(0xEEE7),
+(0xEEE8),(0xEEE9),(0xEEEA),(0xEEEB),(0xEEEC),(0xEEEF),
+(0xEEF0),(0xEEF1),(0xEEF2),(0xEEF3),(0xEEF4),(0xEEF5),(0xEEF6),(0xEEF7),
+(0xEEF8),(0xEEF9),(0xEEFA),(0xEEFB),(0xEEFC);
+INSERT INTO t1 VALUES
+(0xFA40),(0xFA41),(0xFA42),(0xFA43),(0xFA44),(0xFA45),(0xFA46),(0xFA47),
+(0xFA48),(0xFA49),(0xFA4A),(0xFA4B),(0xFA4C),(0xFA4D),(0xFA4E),(0xFA4F),
+(0xFA50),(0xFA51),(0xFA52),(0xFA53),(0xFA54),(0xFA55),(0xFA56),(0xFA57),
+(0xFA58),(0xFA59),(0xFA5A),(0xFA5B),(0xFA5C),(0xFA5D),(0xFA5E),(0xFA5F),
+(0xFA60),(0xFA61),(0xFA62),(0xFA63),(0xFA64),(0xFA65),(0xFA66),(0xFA67),
+(0xFA68),(0xFA69),(0xFA6A),(0xFA6B),(0xFA6C),(0xFA6D),(0xFA6E),(0xFA6F),
+(0xFA70),(0xFA71),(0xFA72),(0xFA73),(0xFA74),(0xFA75),(0xFA76),(0xFA77),
+(0xFA78),(0xFA79),(0xFA7A),(0xFA7B),(0xFA7C),(0xFA7D),(0xFA7E),
+(0xFA80),(0xFA81),(0xFA82),(0xFA83),(0xFA84),(0xFA85),(0xFA86),(0xFA87),
+(0xFA88),(0xFA89),(0xFA8A),(0xFA8B),(0xFA8C),(0xFA8D),(0xFA8E),(0xFA8F),
+(0xFA90),(0xFA91),(0xFA92),(0xFA93),(0xFA94),(0xFA95),(0xFA96),(0xFA97),
+(0xFA98),(0xFA99),(0xFA9A),(0xFA9B),(0xFA9C),(0xFA9D),(0xFA9E),(0xFA9F),
+(0xFAA0),(0xFAA1),(0xFAA2),(0xFAA3),(0xFAA4),(0xFAA5),(0xFAA6),(0xFAA7),
+(0xFAA8),(0xFAA9),(0xFAAA),(0xFAAB),(0xFAAC),(0xFAAD),(0xFAAE),(0xFAAF),
+(0xFAB0),(0xFAB1),(0xFAB2),(0xFAB3),(0xFAB4),(0xFAB5),(0xFAB6),(0xFAB7),
+(0xFAB8),(0xFAB9),(0xFABA),(0xFABB),(0xFABC),(0xFABD),(0xFABE),(0xFABF),
+(0xFAC0),(0xFAC1),(0xFAC2),(0xFAC3),(0xFAC4),(0xFAC5),(0xFAC6),(0xFAC7),
+(0xFAC8),(0xFAC9),(0xFACA),(0xFACB),(0xFACC),(0xFACD),(0xFACE),(0xFACF),
+(0xFAD0),(0xFAD1),(0xFAD2),(0xFAD3),(0xFAD4),(0xFAD5),(0xFAD6),(0xFAD7),
+(0xFAD8),(0xFAD9),(0xFADA),(0xFADB),(0xFADC),(0xFADD),(0xFADE),(0xFADF),
+(0xFAE0),(0xFAE1),(0xFAE2),(0xFAE3),(0xFAE4),(0xFAE5),(0xFAE6),(0xFAE7),
+(0xFAE8),(0xFAE9),(0xFAEA),(0xFAEB),(0xFAEC),(0xFAED),(0xFAEE),(0xFAEF),
+(0xFAF0),(0xFAF1),(0xFAF2),(0xFAF3),(0xFAF4),(0xFAF5),(0xFAF6),(0xFAF7),
+(0xFAF8),(0xFAF9),(0xFAFA),(0xFAFB),(0xFAFC),
+(0xFB40),(0xFB41),(0xFB42),(0xFB43),(0xFB44),(0xFB45),(0xFB46),(0xFB47),
+(0xFB48),(0xFB49),(0xFB4A),(0xFB4B),(0xFB4C),(0xFB4D),(0xFB4E),(0xFB4F),
+(0xFB50),(0xFB51),(0xFB52),(0xFB53),(0xFB54),(0xFB55),(0xFB56),(0xFB57),
+(0xFB58),(0xFB59),(0xFB5A),(0xFB5B),(0xFB5C),(0xFB5D),(0xFB5E),(0xFB5F),
+(0xFB60),(0xFB61),(0xFB62),(0xFB63),(0xFB64),(0xFB65),(0xFB66),(0xFB67),
+(0xFB68),(0xFB69),(0xFB6A),(0xFB6B),(0xFB6C),(0xFB6D),(0xFB6E),(0xFB6F),
+(0xFB70),(0xFB71),(0xFB72),(0xFB73),(0xFB74),(0xFB75),(0xFB76),(0xFB77),
+(0xFB78),(0xFB79),(0xFB7A),(0xFB7B),(0xFB7C),(0xFB7D),(0xFB7E),
+(0xFB80),(0xFB81),(0xFB82),(0xFB83),(0xFB84),(0xFB85),(0xFB86),(0xFB87),
+(0xFB88),(0xFB89),(0xFB8A),(0xFB8B),(0xFB8C),(0xFB8D),(0xFB8E),(0xFB8F),
+(0xFB90),(0xFB91),(0xFB92),(0xFB93),(0xFB94),(0xFB95),(0xFB96),(0xFB97),
+(0xFB98),(0xFB99),(0xFB9A),(0xFB9B),(0xFB9C),(0xFB9D),(0xFB9E),(0xFB9F),
+(0xFBA0),(0xFBA1),(0xFBA2),(0xFBA3),(0xFBA4),(0xFBA5),(0xFBA6),(0xFBA7),
+(0xFBA8),(0xFBA9),(0xFBAA),(0xFBAB),(0xFBAC),(0xFBAD),(0xFBAE),(0xFBAF),
+(0xFBB0),(0xFBB1),(0xFBB2),(0xFBB3),(0xFBB4),(0xFBB5),(0xFBB6),(0xFBB7),
+(0xFBB8),(0xFBB9),(0xFBBA),(0xFBBB),(0xFBBC),(0xFBBD),(0xFBBE),(0xFBBF),
+(0xFBC0),(0xFBC1),(0xFBC2),(0xFBC3),(0xFBC4),(0xFBC5),(0xFBC6),(0xFBC7),
+(0xFBC8),(0xFBC9),(0xFBCA),(0xFBCB),(0xFBCC),(0xFBCD),(0xFBCE),(0xFBCF),
+(0xFBD0),(0xFBD1),(0xFBD2),(0xFBD3),(0xFBD4),(0xFBD5),(0xFBD6),(0xFBD7),
+(0xFBD8),(0xFBD9),(0xFBDA),(0xFBDB),(0xFBDC),(0xFBDD),(0xFBDE),(0xFBDF),
+(0xFBE0),(0xFBE1),(0xFBE2),(0xFBE3),(0xFBE4),(0xFBE5),(0xFBE6),(0xFBE7),
+(0xFBE8),(0xFBE9),(0xFBEA),(0xFBEB),(0xFBEC),(0xFBED),(0xFBEE),(0xFBEF),
+(0xFBF0),(0xFBF1),(0xFBF2),(0xFBF3),(0xFBF4),(0xFBF5),(0xFBF6),(0xFBF7),
+(0xFBF8),(0xFBF9),(0xFBFA),(0xFBFB),(0xFBFC),
+(0xFC40),(0xFC41),(0xFC42),(0xFC43),(0xFC44),(0xFC45),(0xFC46),(0xFC47),
+(0xFC48),(0xFC49),(0xFC4A),(0xFC4B);
+INSERT INTO t1 VALUES
+(0xF040),(0xF041),(0xF042),(0xF043),(0xF044),(0xF045),(0xF046),(0xF047),
+(0xF048),(0xF049),(0xF04A),(0xF04B),(0xF04C),(0xF04D),(0xF04E),(0xF04F),
+(0xF050),(0xF051),(0xF052),(0xF053),(0xF054),(0xF055),(0xF056),(0xF057),
+(0xF058),(0xF059),(0xF05A),(0xF05B),(0xF05C),(0xF05D),(0xF05E),(0xF05F),
+(0xF060),(0xF061),(0xF062),(0xF063),(0xF064),(0xF065),(0xF066),(0xF067),
+(0xF068),(0xF069),(0xF06A),(0xF06B),(0xF06C),(0xF06D),(0xF06E),(0xF06F),
+(0xF070),(0xF071),(0xF072),(0xF073),(0xF074),(0xF075),(0xF076),(0xF077),
+(0xF078),(0xF079),(0xF07A),(0xF07B),(0xF07C),(0xF07D),(0xF07E),
+(0xF080),(0xF081),(0xF082),(0xF083),(0xF084),(0xF085),(0xF086),(0xF087),
+(0xF088),(0xF089),(0xF08A),(0xF08B),(0xF08C),(0xF08D),(0xF08E),(0xF08F),
+(0xF090),(0xF091),(0xF092),(0xF093),(0xF094),(0xF095),(0xF096),(0xF097),
+(0xF098),(0xF099),(0xF09A),(0xF09B),(0xF09C),(0xF09D),(0xF09E),(0xF09F),
+(0xF0A0),(0xF0A1),(0xF0A2),(0xF0A3),(0xF0A4),(0xF0A5),(0xF0A6),(0xF0A7),
+(0xF0A8),(0xF0A9),(0xF0AA),(0xF0AB),(0xF0AC),(0xF0AD),(0xF0AE),(0xF0AF),
+(0xF0B0),(0xF0B1),(0xF0B2),(0xF0B3),(0xF0B4),(0xF0B5),(0xF0B6),(0xF0B7),
+(0xF0B8),(0xF0B9),(0xF0BA),(0xF0BB),(0xF0BC),(0xF0BD),(0xF0BE),(0xF0BF),
+(0xF0C0),(0xF0C1),(0xF0C2),(0xF0C3),(0xF0C4),(0xF0C5),(0xF0C6),(0xF0C7),
+(0xF0C8),(0xF0C9),(0xF0CA),(0xF0CB),(0xF0CC),(0xF0CD),(0xF0CE),(0xF0CF),
+(0xF0D0),(0xF0D1),(0xF0D2),(0xF0D3),(0xF0D4),(0xF0D5),(0xF0D6),(0xF0D7),
+(0xF0D8),(0xF0D9),(0xF0DA),(0xF0DB),(0xF0DC),(0xF0DD),(0xF0DE),(0xF0DF),
+(0xF0E0),(0xF0E1),(0xF0E2),(0xF0E3),(0xF0E4),(0xF0E5),(0xF0E6),(0xF0E7),
+(0xF0E8),(0xF0E9),(0xF0EA),(0xF0EB),(0xF0EC),(0xF0ED),(0xF0EE),(0xF0EF),
+(0xF0F0),(0xF0F1),(0xF0F2),(0xF0F3),(0xF0F4),(0xF0F5),(0xF0F6),(0xF0F7),
+(0xF0F8),(0xF0F9),(0xF0FA),(0xF0FB),(0xF0FC),
+(0xF140),(0xF141),(0xF142),(0xF143),(0xF144),(0xF145),(0xF146),(0xF147),
+(0xF148),(0xF149),(0xF14A),(0xF14B),(0xF14C),(0xF14D),(0xF14E),(0xF14F),
+(0xF150),(0xF151),(0xF152),(0xF153),(0xF154),(0xF155),(0xF156),(0xF157),
+(0xF158),(0xF159),(0xF15A),(0xF15B),(0xF15C),(0xF15D),(0xF15E),(0xF15F),
+(0xF160),(0xF161),(0xF162),(0xF163),(0xF164),(0xF165),(0xF166),(0xF167),
+(0xF168),(0xF169),(0xF16A),(0xF16B),(0xF16C),(0xF16D),(0xF16E),(0xF16F),
+(0xF170),(0xF171),(0xF172),(0xF173),(0xF174),(0xF175),(0xF176),(0xF177),
+(0xF178),(0xF179),(0xF17A),(0xF17B),(0xF17C),(0xF17D),(0xF17E),
+(0xF180),(0xF181),(0xF182),(0xF183),(0xF184),(0xF185),(0xF186),(0xF187),
+(0xF188),(0xF189),(0xF18A),(0xF18B),(0xF18C),(0xF18D),(0xF18E),(0xF18F),
+(0xF190),(0xF191),(0xF192),(0xF193),(0xF194),(0xF195),(0xF196),(0xF197),
+(0xF198),(0xF199),(0xF19A),(0xF19B),(0xF19C),(0xF19D),(0xF19E),(0xF19F),
+(0xF1A0),(0xF1A1),(0xF1A2),(0xF1A3),(0xF1A4),(0xF1A5),(0xF1A6),(0xF1A7),
+(0xF1A8),(0xF1A9),(0xF1AA),(0xF1AB),(0xF1AC),(0xF1AD),(0xF1AE),(0xF1AF),
+(0xF1B0),(0xF1B1),(0xF1B2),(0xF1B3),(0xF1B4),(0xF1B5),(0xF1B6),(0xF1B7),
+(0xF1B8),(0xF1B9),(0xF1BA),(0xF1BB),(0xF1BC),(0xF1BD),(0xF1BE),(0xF1BF),
+(0xF1C0),(0xF1C1),(0xF1C2),(0xF1C3),(0xF1C4),(0xF1C5),(0xF1C6),(0xF1C7),
+(0xF1C8),(0xF1C9),(0xF1CA),(0xF1CB),(0xF1CC),(0xF1CD),(0xF1CE),(0xF1CF),
+(0xF1D0),(0xF1D1),(0xF1D2),(0xF1D3),(0xF1D4),(0xF1D5),(0xF1D6),(0xF1D7),
+(0xF1D8),(0xF1D9),(0xF1DA),(0xF1DB),(0xF1DC),(0xF1DD),(0xF1DE),(0xF1DF),
+(0xF1E0),(0xF1E1),(0xF1E2),(0xF1E3),(0xF1E4),(0xF1E5),(0xF1E6),(0xF1E7),
+(0xF1E8),(0xF1E9),(0xF1EA),(0xF1EB),(0xF1EC),(0xF1ED),(0xF1EE),(0xF1EF),
+(0xF1F0),(0xF1F1),(0xF1F2),(0xF1F3),(0xF1F4),(0xF1F5),(0xF1F6),(0xF1F7),
+(0xF1F8),(0xF1F9),(0xF1FA),(0xF1FB),(0xF1FC),
+(0xF240),(0xF241),(0xF242),(0xF243),(0xF244),(0xF245),(0xF246),(0xF247),
+(0xF248),(0xF249),(0xF24A),(0xF24B),(0xF24C),(0xF24D),(0xF24E),(0xF24F),
+(0xF250),(0xF251),(0xF252),(0xF253),(0xF254),(0xF255),(0xF256),(0xF257),
+(0xF258),(0xF259),(0xF25A),(0xF25B),(0xF25C),(0xF25D),(0xF25E),(0xF25F),
+(0xF260),(0xF261),(0xF262),(0xF263),(0xF264),(0xF265),(0xF266),(0xF267),
+(0xF268),(0xF269),(0xF26A),(0xF26B),(0xF26C),(0xF26D),(0xF26E),(0xF26F),
+(0xF270),(0xF271),(0xF272),(0xF273),(0xF274),(0xF275),(0xF276),(0xF277),
+(0xF278),(0xF279),(0xF27A),(0xF27B),(0xF27C),(0xF27D),(0xF27E),
+(0xF280),(0xF281),(0xF282),(0xF283),(0xF284),(0xF285),(0xF286),(0xF287),
+(0xF288),(0xF289),(0xF28A),(0xF28B),(0xF28C),(0xF28D),(0xF28E),(0xF28F),
+(0xF290),(0xF291),(0xF292),(0xF293),(0xF294),(0xF295),(0xF296),(0xF297),
+(0xF298),(0xF299),(0xF29A),(0xF29B),(0xF29C),(0xF29D),(0xF29E),(0xF29F),
+(0xF2A0),(0xF2A1),(0xF2A2),(0xF2A3),(0xF2A4),(0xF2A5),(0xF2A6),(0xF2A7),
+(0xF2A8),(0xF2A9),(0xF2AA),(0xF2AB),(0xF2AC),(0xF2AD),(0xF2AE),(0xF2AF),
+(0xF2B0),(0xF2B1),(0xF2B2),(0xF2B3),(0xF2B4),(0xF2B5),(0xF2B6),(0xF2B7),
+(0xF2B8),(0xF2B9),(0xF2BA),(0xF2BB),(0xF2BC),(0xF2BD),(0xF2BE),(0xF2BF),
+(0xF2C0),(0xF2C1),(0xF2C2),(0xF2C3),(0xF2C4),(0xF2C5),(0xF2C6),(0xF2C7),
+(0xF2C8),(0xF2C9),(0xF2CA),(0xF2CB),(0xF2CC),(0xF2CD),(0xF2CE),(0xF2CF),
+(0xF2D0),(0xF2D1),(0xF2D2),(0xF2D3),(0xF2D4),(0xF2D5),(0xF2D6),(0xF2D7),
+(0xF2D8),(0xF2D9),(0xF2DA),(0xF2DB),(0xF2DC),(0xF2DD),(0xF2DE),(0xF2DF),
+(0xF2E0),(0xF2E1),(0xF2E2),(0xF2E3),(0xF2E4),(0xF2E5),(0xF2E6),(0xF2E7),
+(0xF2E8),(0xF2E9),(0xF2EA),(0xF2EB),(0xF2EC),(0xF2ED),(0xF2EE),(0xF2EF),
+(0xF2F0),(0xF2F1),(0xF2F2),(0xF2F3),(0xF2F4),(0xF2F5),(0xF2F6),(0xF2F7),
+(0xF2F8),(0xF2F9),(0xF2FA),(0xF2FB),(0xF2FC),
+(0xF340),(0xF341),(0xF342),(0xF343),(0xF344),(0xF345),(0xF346),(0xF347),
+(0xF348),(0xF349),(0xF34A),(0xF34B),(0xF34C),(0xF34D),(0xF34E),(0xF34F),
+(0xF350),(0xF351),(0xF352),(0xF353),(0xF354),(0xF355),(0xF356),(0xF357),
+(0xF358),(0xF359),(0xF35A),(0xF35B),(0xF35C),(0xF35D),(0xF35E),(0xF35F),
+(0xF360),(0xF361),(0xF362),(0xF363),(0xF364),(0xF365),(0xF366),(0xF367),
+(0xF368),(0xF369),(0xF36A),(0xF36B),(0xF36C),(0xF36D),(0xF36E),(0xF36F),
+(0xF370),(0xF371),(0xF372),(0xF373),(0xF374),(0xF375),(0xF376),(0xF377),
+(0xF378),(0xF379),(0xF37A),(0xF37B),(0xF37C),(0xF37D),(0xF37E),
+(0xF380),(0xF381),(0xF382),(0xF383),(0xF384),(0xF385),(0xF386),(0xF387),
+(0xF388),(0xF389),(0xF38A),(0xF38B),(0xF38C),(0xF38D),(0xF38E),(0xF38F),
+(0xF390),(0xF391),(0xF392),(0xF393),(0xF394),(0xF395),(0xF396),(0xF397),
+(0xF398),(0xF399),(0xF39A),(0xF39B),(0xF39C),(0xF39D),(0xF39E),(0xF39F),
+(0xF3A0),(0xF3A1),(0xF3A2),(0xF3A3),(0xF3A4),(0xF3A5),(0xF3A6),(0xF3A7),
+(0xF3A8),(0xF3A9),(0xF3AA),(0xF3AB),(0xF3AC),(0xF3AD),(0xF3AE),(0xF3AF),
+(0xF3B0),(0xF3B1),(0xF3B2),(0xF3B3),(0xF3B4),(0xF3B5),(0xF3B6),(0xF3B7),
+(0xF3B8),(0xF3B9),(0xF3BA),(0xF3BB),(0xF3BC),(0xF3BD),(0xF3BE),(0xF3BF),
+(0xF3C0),(0xF3C1),(0xF3C2),(0xF3C3),(0xF3C4),(0xF3C5),(0xF3C6),(0xF3C7),
+(0xF3C8),(0xF3C9),(0xF3CA),(0xF3CB),(0xF3CC),(0xF3CD),(0xF3CE),(0xF3CF),
+(0xF3D0),(0xF3D1),(0xF3D2),(0xF3D3),(0xF3D4),(0xF3D5),(0xF3D6),(0xF3D7),
+(0xF3D8),(0xF3D9),(0xF3DA),(0xF3DB),(0xF3DC),(0xF3DD),(0xF3DE),(0xF3DF),
+(0xF3E0),(0xF3E1),(0xF3E2),(0xF3E3),(0xF3E4),(0xF3E5),(0xF3E6),(0xF3E7),
+(0xF3E8),(0xF3E9),(0xF3EA),(0xF3EB),(0xF3EC),(0xF3ED),(0xF3EE),(0xF3EF),
+(0xF3F0),(0xF3F1),(0xF3F2),(0xF3F3),(0xF3F4),(0xF3F5),(0xF3F6),(0xF3F7),
+(0xF3F8),(0xF3F9),(0xF3FA),(0xF3FB),(0xF3FC),
+(0xF440),(0xF441),(0xF442),(0xF443),(0xF444),(0xF445),(0xF446),(0xF447),
+(0xF448),(0xF449),(0xF44A),(0xF44B),(0xF44C),(0xF44D),(0xF44E),(0xF44F),
+(0xF450),(0xF451),(0xF452),(0xF453),(0xF454),(0xF455),(0xF456),(0xF457),
+(0xF458),(0xF459),(0xF45A),(0xF45B),(0xF45C),(0xF45D),(0xF45E),(0xF45F),
+(0xF460),(0xF461),(0xF462),(0xF463),(0xF464),(0xF465),(0xF466),(0xF467),
+(0xF468),(0xF469),(0xF46A),(0xF46B),(0xF46C),(0xF46D),(0xF46E),(0xF46F),
+(0xF470),(0xF471),(0xF472),(0xF473),(0xF474),(0xF475),(0xF476),(0xF477),
+(0xF478),(0xF479),(0xF47A),(0xF47B),(0xF47C),(0xF47D),(0xF47E),
+(0xF480),(0xF481),(0xF482),(0xF483),(0xF484),(0xF485),(0xF486),(0xF487),
+(0xF488),(0xF489),(0xF48A),(0xF48B),(0xF48C),(0xF48D),(0xF48E),(0xF48F),
+(0xF490),(0xF491),(0xF492),(0xF493),(0xF494),(0xF495),(0xF496),(0xF497),
+(0xF498),(0xF499),(0xF49A),(0xF49B),(0xF49C),(0xF49D),(0xF49E),(0xF49F),
+(0xF4A0),(0xF4A1),(0xF4A2),(0xF4A3),(0xF4A4),(0xF4A5),(0xF4A6),(0xF4A7),
+(0xF4A8),(0xF4A9),(0xF4AA),(0xF4AB),(0xF4AC),(0xF4AD),(0xF4AE),(0xF4AF),
+(0xF4B0),(0xF4B1),(0xF4B2),(0xF4B3),(0xF4B4),(0xF4B5),(0xF4B6),(0xF4B7),
+(0xF4B8),(0xF4B9),(0xF4BA),(0xF4BB),(0xF4BC),(0xF4BD),(0xF4BE),(0xF4BF),
+(0xF4C0),(0xF4C1),(0xF4C2),(0xF4C3),(0xF4C4),(0xF4C5),(0xF4C6),(0xF4C7),
+(0xF4C8),(0xF4C9),(0xF4CA),(0xF4CB),(0xF4CC),(0xF4CD),(0xF4CE),(0xF4CF),
+(0xF4D0),(0xF4D1),(0xF4D2),(0xF4D3),(0xF4D4),(0xF4D5),(0xF4D6),(0xF4D7),
+(0xF4D8),(0xF4D9),(0xF4DA),(0xF4DB),(0xF4DC),(0xF4DD),(0xF4DE),(0xF4DF),
+(0xF4E0),(0xF4E1),(0xF4E2),(0xF4E3),(0xF4E4),(0xF4E5),(0xF4E6),(0xF4E7),
+(0xF4E8),(0xF4E9),(0xF4EA),(0xF4EB),(0xF4EC),(0xF4ED),(0xF4EE),(0xF4EF),
+(0xF4F0),(0xF4F1),(0xF4F2),(0xF4F3),(0xF4F4),(0xF4F5),(0xF4F6),(0xF4F7),
+(0xF4F8),(0xF4F9),(0xF4FA),(0xF4FB),(0xF4FC),
+(0xF540),(0xF541),(0xF542),(0xF543),(0xF544),(0xF545),(0xF546),(0xF547),
+(0xF548),(0xF549),(0xF54A),(0xF54B),(0xF54C),(0xF54D),(0xF54E),(0xF54F),
+(0xF550),(0xF551),(0xF552),(0xF553),(0xF554),(0xF555),(0xF556),(0xF557),
+(0xF558),(0xF559),(0xF55A),(0xF55B),(0xF55C),(0xF55D),(0xF55E),(0xF55F),
+(0xF560),(0xF561),(0xF562),(0xF563),(0xF564),(0xF565),(0xF566),(0xF567),
+(0xF568),(0xF569),(0xF56A),(0xF56B),(0xF56C),(0xF56D),(0xF56E),(0xF56F),
+(0xF570),(0xF571),(0xF572),(0xF573),(0xF574),(0xF575),(0xF576),(0xF577),
+(0xF578),(0xF579),(0xF57A),(0xF57B),(0xF57C),(0xF57D),(0xF57E),
+(0xF580),(0xF581),(0xF582),(0xF583),(0xF584),(0xF585),(0xF586),(0xF587),
+(0xF588),(0xF589),(0xF58A),(0xF58B),(0xF58C),(0xF58D),(0xF58E),(0xF58F),
+(0xF590),(0xF591),(0xF592),(0xF593),(0xF594),(0xF595),(0xF596),(0xF597),
+(0xF598),(0xF599),(0xF59A),(0xF59B),(0xF59C),(0xF59D),(0xF59E),(0xF59F),
+(0xF5A0),(0xF5A1),(0xF5A2),(0xF5A3),(0xF5A4),(0xF5A5),(0xF5A6),(0xF5A7),
+(0xF5A8),(0xF5A9),(0xF5AA),(0xF5AB),(0xF5AC),(0xF5AD),(0xF5AE),(0xF5AF),
+(0xF5B0),(0xF5B1),(0xF5B2),(0xF5B3),(0xF5B4),(0xF5B5),(0xF5B6),(0xF5B7),
+(0xF5B8),(0xF5B9),(0xF5BA),(0xF5BB),(0xF5BC),(0xF5BD),(0xF5BE),(0xF5BF),
+(0xF5C0),(0xF5C1),(0xF5C2),(0xF5C3),(0xF5C4),(0xF5C5),(0xF5C6),(0xF5C7),
+(0xF5C8),(0xF5C9),(0xF5CA),(0xF5CB),(0xF5CC),(0xF5CD),(0xF5CE),(0xF5CF),
+(0xF5D0),(0xF5D1),(0xF5D2),(0xF5D3),(0xF5D4),(0xF5D5),(0xF5D6),(0xF5D7),
+(0xF5D8),(0xF5D9),(0xF5DA),(0xF5DB),(0xF5DC),(0xF5DD),(0xF5DE),(0xF5DF),
+(0xF5E0),(0xF5E1),(0xF5E2),(0xF5E3),(0xF5E4),(0xF5E5),(0xF5E6),(0xF5E7),
+(0xF5E8),(0xF5E9),(0xF5EA),(0xF5EB),(0xF5EC),(0xF5ED),(0xF5EE),(0xF5EF),
+(0xF5F0),(0xF5F1),(0xF5F2),(0xF5F3),(0xF5F4),(0xF5F5),(0xF5F6),(0xF5F7),
+(0xF5F8),(0xF5F9),(0xF5FA),(0xF5FB),(0xF5FC),
+(0xF640),(0xF641),(0xF642),(0xF643),(0xF644),(0xF645),(0xF646),(0xF647),
+(0xF648),(0xF649),(0xF64A),(0xF64B),(0xF64C),(0xF64D),(0xF64E),(0xF64F),
+(0xF650),(0xF651),(0xF652),(0xF653),(0xF654),(0xF655),(0xF656),(0xF657),
+(0xF658),(0xF659),(0xF65A),(0xF65B),(0xF65C),(0xF65D),(0xF65E),(0xF65F),
+(0xF660),(0xF661),(0xF662),(0xF663),(0xF664),(0xF665),(0xF666),(0xF667),
+(0xF668),(0xF669),(0xF66A),(0xF66B),(0xF66C),(0xF66D),(0xF66E),(0xF66F),
+(0xF670),(0xF671),(0xF672),(0xF673),(0xF674),(0xF675),(0xF676),(0xF677),
+(0xF678),(0xF679),(0xF67A),(0xF67B),(0xF67C),(0xF67D),(0xF67E),
+(0xF680),(0xF681),(0xF682),(0xF683),(0xF684),(0xF685),(0xF686),(0xF687),
+(0xF688),(0xF689),(0xF68A),(0xF68B),(0xF68C),(0xF68D),(0xF68E),(0xF68F),
+(0xF690),(0xF691),(0xF692),(0xF693),(0xF694),(0xF695),(0xF696),(0xF697),
+(0xF698),(0xF699),(0xF69A),(0xF69B),(0xF69C),(0xF69D),(0xF69E),(0xF69F),
+(0xF6A0),(0xF6A1),(0xF6A2),(0xF6A3),(0xF6A4),(0xF6A5),(0xF6A6),(0xF6A7),
+(0xF6A8),(0xF6A9),(0xF6AA),(0xF6AB),(0xF6AC),(0xF6AD),(0xF6AE),(0xF6AF),
+(0xF6B0),(0xF6B1),(0xF6B2),(0xF6B3),(0xF6B4),(0xF6B5),(0xF6B6),(0xF6B7),
+(0xF6B8),(0xF6B9),(0xF6BA),(0xF6BB),(0xF6BC),(0xF6BD),(0xF6BE),(0xF6BF),
+(0xF6C0),(0xF6C1),(0xF6C2),(0xF6C3),(0xF6C4),(0xF6C5),(0xF6C6),(0xF6C7),
+(0xF6C8),(0xF6C9),(0xF6CA),(0xF6CB),(0xF6CC),(0xF6CD),(0xF6CE),(0xF6CF),
+(0xF6D0),(0xF6D1),(0xF6D2),(0xF6D3),(0xF6D4),(0xF6D5),(0xF6D6),(0xF6D7),
+(0xF6D8),(0xF6D9),(0xF6DA),(0xF6DB),(0xF6DC),(0xF6DD),(0xF6DE),(0xF6DF),
+(0xF6E0),(0xF6E1),(0xF6E2),(0xF6E3),(0xF6E4),(0xF6E5),(0xF6E6),(0xF6E7),
+(0xF6E8),(0xF6E9),(0xF6EA),(0xF6EB),(0xF6EC),(0xF6ED),(0xF6EE),(0xF6EF),
+(0xF6F0),(0xF6F1),(0xF6F2),(0xF6F3),(0xF6F4),(0xF6F5),(0xF6F6),(0xF6F7),
+(0xF6F8),(0xF6F9),(0xF6FA),(0xF6FB),(0xF6FC),
+(0xF740),(0xF741),(0xF742),(0xF743),(0xF744),(0xF745),(0xF746),(0xF747),
+(0xF748),(0xF749),(0xF74A),(0xF74B),(0xF74C),(0xF74D),(0xF74E),(0xF74F),
+(0xF750),(0xF751),(0xF752),(0xF753),(0xF754),(0xF755),(0xF756),(0xF757),
+(0xF758),(0xF759),(0xF75A),(0xF75B),(0xF75C),(0xF75D),(0xF75E),(0xF75F),
+(0xF760),(0xF761),(0xF762),(0xF763),(0xF764),(0xF765),(0xF766),(0xF767),
+(0xF768),(0xF769),(0xF76A),(0xF76B),(0xF76C),(0xF76D),(0xF76E),(0xF76F),
+(0xF770),(0xF771),(0xF772),(0xF773),(0xF774),(0xF775),(0xF776),(0xF777),
+(0xF778),(0xF779),(0xF77A),(0xF77B),(0xF77C),(0xF77D),(0xF77E),
+(0xF780),(0xF781),(0xF782),(0xF783),(0xF784),(0xF785),(0xF786),(0xF787),
+(0xF788),(0xF789),(0xF78A),(0xF78B),(0xF78C),(0xF78D),(0xF78E),(0xF78F),
+(0xF790),(0xF791),(0xF792),(0xF793),(0xF794),(0xF795),(0xF796),(0xF797),
+(0xF798),(0xF799),(0xF79A),(0xF79B),(0xF79C),(0xF79D),(0xF79E),(0xF79F),
+(0xF7A0),(0xF7A1),(0xF7A2),(0xF7A3),(0xF7A4),(0xF7A5),(0xF7A6),(0xF7A7),
+(0xF7A8),(0xF7A9),(0xF7AA),(0xF7AB),(0xF7AC),(0xF7AD),(0xF7AE),(0xF7AF),
+(0xF7B0),(0xF7B1),(0xF7B2),(0xF7B3),(0xF7B4),(0xF7B5),(0xF7B6),(0xF7B7),
+(0xF7B8),(0xF7B9),(0xF7BA),(0xF7BB),(0xF7BC),(0xF7BD),(0xF7BE),(0xF7BF),
+(0xF7C0),(0xF7C1),(0xF7C2),(0xF7C3),(0xF7C4),(0xF7C5),(0xF7C6),(0xF7C7),
+(0xF7C8),(0xF7C9),(0xF7CA),(0xF7CB),(0xF7CC),(0xF7CD),(0xF7CE),(0xF7CF),
+(0xF7D0),(0xF7D1),(0xF7D2),(0xF7D3),(0xF7D4),(0xF7D5),(0xF7D6),(0xF7D7),
+(0xF7D8),(0xF7D9),(0xF7DA),(0xF7DB),(0xF7DC),(0xF7DD),(0xF7DE),(0xF7DF),
+(0xF7E0),(0xF7E1),(0xF7E2),(0xF7E3),(0xF7E4),(0xF7E5),(0xF7E6),(0xF7E7),
+(0xF7E8),(0xF7E9),(0xF7EA),(0xF7EB),(0xF7EC),(0xF7ED),(0xF7EE),(0xF7EF),
+(0xF7F0),(0xF7F1),(0xF7F2),(0xF7F3),(0xF7F4),(0xF7F5),(0xF7F6),(0xF7F7),
+(0xF7F8),(0xF7F9),(0xF7FA),(0xF7FB),(0xF7FC),
+(0xF840),(0xF841),(0xF842),(0xF843),(0xF844),(0xF845),(0xF846),(0xF847),
+(0xF848),(0xF849),(0xF84A),(0xF84B),(0xF84C),(0xF84D),(0xF84E),(0xF84F),
+(0xF850),(0xF851),(0xF852),(0xF853),(0xF854),(0xF855),(0xF856),(0xF857),
+(0xF858),(0xF859),(0xF85A),(0xF85B),(0xF85C),(0xF85D),(0xF85E),(0xF85F),
+(0xF860),(0xF861),(0xF862),(0xF863),(0xF864),(0xF865),(0xF866),(0xF867),
+(0xF868),(0xF869),(0xF86A),(0xF86B),(0xF86C),(0xF86D),(0xF86E),(0xF86F),
+(0xF870),(0xF871),(0xF872),(0xF873),(0xF874),(0xF875),(0xF876),(0xF877),
+(0xF878),(0xF879),(0xF87A),(0xF87B),(0xF87C),(0xF87D),(0xF87E),
+(0xF880),(0xF881),(0xF882),(0xF883),(0xF884),(0xF885),(0xF886),(0xF887),
+(0xF888),(0xF889),(0xF88A),(0xF88B),(0xF88C),(0xF88D),(0xF88E),(0xF88F),
+(0xF890),(0xF891),(0xF892),(0xF893),(0xF894),(0xF895),(0xF896),(0xF897),
+(0xF898),(0xF899),(0xF89A),(0xF89B),(0xF89C),(0xF89D),(0xF89E),(0xF89F),
+(0xF8A0),(0xF8A1),(0xF8A2),(0xF8A3),(0xF8A4),(0xF8A5),(0xF8A6),(0xF8A7),
+(0xF8A8),(0xF8A9),(0xF8AA),(0xF8AB),(0xF8AC),(0xF8AD),(0xF8AE),(0xF8AF),
+(0xF8B0),(0xF8B1),(0xF8B2),(0xF8B3),(0xF8B4),(0xF8B5),(0xF8B6),(0xF8B7),
+(0xF8B8),(0xF8B9),(0xF8BA),(0xF8BB),(0xF8BC),(0xF8BD),(0xF8BE),(0xF8BF),
+(0xF8C0),(0xF8C1),(0xF8C2),(0xF8C3),(0xF8C4),(0xF8C5),(0xF8C6),(0xF8C7),
+(0xF8C8),(0xF8C9),(0xF8CA),(0xF8CB),(0xF8CC),(0xF8CD),(0xF8CE),(0xF8CF),
+(0xF8D0),(0xF8D1),(0xF8D2),(0xF8D3),(0xF8D4),(0xF8D5),(0xF8D6),(0xF8D7),
+(0xF8D8),(0xF8D9),(0xF8DA),(0xF8DB),(0xF8DC),(0xF8DD),(0xF8DE),(0xF8DF),
+(0xF8E0),(0xF8E1),(0xF8E2),(0xF8E3),(0xF8E4),(0xF8E5),(0xF8E6),(0xF8E7),
+(0xF8E8),(0xF8E9),(0xF8EA),(0xF8EB),(0xF8EC),(0xF8ED),(0xF8EE),(0xF8EF),
+(0xF8F0),(0xF8F1),(0xF8F2),(0xF8F3),(0xF8F4),(0xF8F5),(0xF8F6),(0xF8F7),
+(0xF8F8),(0xF8F9),(0xF8FA),(0xF8FB),(0xF8FC),
+(0xF940),(0xF941),(0xF942),(0xF943),(0xF944),(0xF945),(0xF946),(0xF947),
+(0xF948),(0xF949),(0xF94A),(0xF94B),(0xF94C),(0xF94D),(0xF94E),(0xF94F),
+(0xF950),(0xF951),(0xF952),(0xF953),(0xF954),(0xF955),(0xF956),(0xF957),
+(0xF958),(0xF959),(0xF95A),(0xF95B),(0xF95C),(0xF95D),(0xF95E),(0xF95F),
+(0xF960),(0xF961),(0xF962),(0xF963),(0xF964),(0xF965),(0xF966),(0xF967),
+(0xF968),(0xF969),(0xF96A),(0xF96B),(0xF96C),(0xF96D),(0xF96E),(0xF96F),
+(0xF970),(0xF971),(0xF972),(0xF973),(0xF974),(0xF975),(0xF976),(0xF977),
+(0xF978),(0xF979),(0xF97A),(0xF97B),(0xF97C),(0xF97D),(0xF97E),
+(0xF980),(0xF981),(0xF982),(0xF983),(0xF984),(0xF985),(0xF986),(0xF987),
+(0xF988),(0xF989),(0xF98A),(0xF98B),(0xF98C),(0xF98D),(0xF98E),(0xF98F),
+(0xF990),(0xF991),(0xF992),(0xF993),(0xF994),(0xF995),(0xF996),(0xF997),
+(0xF998),(0xF999),(0xF99A),(0xF99B),(0xF99C),(0xF99D),(0xF99E),(0xF99F),
+(0xF9A0),(0xF9A1),(0xF9A2),(0xF9A3),(0xF9A4),(0xF9A5),(0xF9A6),(0xF9A7),
+(0xF9A8),(0xF9A9),(0xF9AA),(0xF9AB),(0xF9AC),(0xF9AD),(0xF9AE),(0xF9AF),
+(0xF9B0),(0xF9B1),(0xF9B2),(0xF9B3),(0xF9B4),(0xF9B5),(0xF9B6),(0xF9B7),
+(0xF9B8),(0xF9B9),(0xF9BA),(0xF9BB),(0xF9BC),(0xF9BD),(0xF9BE),(0xF9BF),
+(0xF9C0),(0xF9C1),(0xF9C2),(0xF9C3),(0xF9C4),(0xF9C5),(0xF9C6),(0xF9C7),
+(0xF9C8),(0xF9C9),(0xF9CA),(0xF9CB),(0xF9CC),(0xF9CD),(0xF9CE),(0xF9CF),
+(0xF9D0),(0xF9D1),(0xF9D2),(0xF9D3),(0xF9D4),(0xF9D5),(0xF9D6),(0xF9D7),
+(0xF9D8),(0xF9D9),(0xF9DA),(0xF9DB),(0xF9DC),(0xF9DD),(0xF9DE),(0xF9DF),
+(0xF9E0),(0xF9E1),(0xF9E2),(0xF9E3),(0xF9E4),(0xF9E5),(0xF9E6),(0xF9E7),
+(0xF9E8),(0xF9E9),(0xF9EA),(0xF9EB),(0xF9EC),(0xF9ED),(0xF9EE),(0xF9EF),
+(0xF9F0),(0xF9F1),(0xF9F2),(0xF9F3),(0xF9F4),(0xF9F5),(0xF9F6),(0xF9F7),
+(0xF9F8),(0xF9F9),(0xF9FA),(0xF9FB),(0xF9FC);
+SELECT HEX(c1) FROM t1;
+HEX(c1)
+05
+7E
+815C
+815F
+8160
+8161
+817C
+8191
+8192
+81CA
+8740
+8741
+8742
+8743
+8744
+8745
+8746
+8747
+8748
+8749
+874A
+874B
+874C
+874D
+874E
+874F
+8750
+8751
+8752
+8753
+8754
+8755
+8756
+8757
+8758
+8759
+875A
+875B
+875C
+875D
+875F
+8760
+8761
+8762
+8763
+8764
+8765
+8766
+8767
+8768
+8769
+876A
+876B
+876C
+876D
+876E
+876F
+8770
+8771
+8772
+8773
+8774
+8775
+877E
+8780
+8781
+8782
+8783
+8784
+8785
+8786
+8787
+8788
+8789
+878A
+878B
+878C
+878D
+878E
+878F
+8790
+8791
+8792
+8793
+8794
+8795
+8796
+8797
+8798
+8799
+879A
+879B
+879C
+ED40
+ED41
+ED42
+ED43
+ED44
+ED45
+ED46
+ED47
+ED48
+ED49
+ED4A
+ED4B
+ED4C
+ED4D
+ED4E
+ED4F
+ED50
+ED51
+ED52
+ED53
+ED54
+ED55
+ED56
+ED57
+ED58
+ED59
+ED5A
+ED5B
+ED5C
+ED5D
+ED5E
+ED5F
+ED60
+ED61
+ED62
+ED63
+ED64
+ED65
+ED66
+ED67
+ED68
+ED69
+ED6A
+ED6B
+ED6C
+ED6D
+ED6E
+ED6F
+ED70
+ED71
+ED72
+ED73
+ED74
+ED75
+ED76
+ED77
+ED78
+ED79
+ED7A
+ED7B
+ED7C
+ED7D
+ED7E
+ED80
+ED81
+ED82
+ED83
+ED84
+ED85
+ED86
+ED87
+ED88
+ED89
+ED8A
+ED8B
+ED8C
+ED8D
+ED8E
+ED8F
+ED90
+ED91
+ED92
+ED93
+ED94
+ED95
+ED96
+ED97
+ED98
+ED99
+ED9A
+ED9B
+ED9C
+ED9D
+ED9E
+ED9F
+EDA0
+EDA1
+EDA2
+EDA3
+EDA4
+EDA5
+EDA6
+EDA7
+EDA8
+EDA9
+EDAA
+EDAB
+EDAC
+EDAD
+EDAE
+EDAF
+EDB0
+EDB1
+EDB2
+EDB3
+EDB4
+EDB5
+EDB6
+EDB7
+EDB8
+EDB9
+EDBA
+EDBB
+EDBC
+EDBD
+EDBE
+EDBF
+EDC0
+EDC1
+EDC2
+EDC3
+EDC4
+EDC5
+EDC6
+EDC7
+EDC8
+EDC9
+EDCA
+EDCB
+EDCC
+EDCD
+EDCE
+EDCF
+EDD0
+EDD1
+EDD2
+EDD3
+EDD4
+EDD5
+EDD6
+EDD7
+EDD8
+EDD9
+EDDA
+EDDB
+EDDC
+EDDD
+EDDE
+EDDF
+EDE0
+EDE1
+EDE2
+EDE3
+EDE4
+EDE5
+EDE6
+EDE7
+EDE8
+EDE9
+EDEA
+EDEB
+EDEC
+EDED
+EDEE
+EDEF
+EDF0
+EDF1
+EDF2
+EDF3
+EDF4
+EDF5
+EDF6
+EDF7
+EDF8
+EDF9
+EDFA
+EDFB
+EDFC
+EE40
+EE41
+EE42
+EE43
+EE44
+EE45
+EE46
+EE47
+EE48
+EE49
+EE4A
+EE4B
+EE4C
+EE4D
+EE4E
+EE4F
+EE50
+EE51
+EE52
+EE53
+EE54
+EE55
+EE56
+EE57
+EE58
+EE59
+EE5A
+EE5B
+EE5C
+EE5D
+EE5E
+EE5F
+EE60
+EE61
+EE62
+EE63
+EE64
+EE65
+EE66
+EE67
+EE68
+EE69
+EE6A
+EE6B
+EE6C
+EE6D
+EE6E
+EE6F
+EE70
+EE71
+EE72
+EE73
+EE74
+EE75
+EE76
+EE77
+EE78
+EE79
+EE7A
+EE7B
+EE7C
+EE7D
+EE7E
+EE80
+EE81
+EE82
+EE83
+EE84
+EE85
+EE86
+EE87
+EE88
+EE89
+EE8A
+EE8B
+EE8C
+EE8D
+EE8E
+EE8F
+EE90
+EE91
+EE92
+EE93
+EE94
+EE95
+EE96
+EE97
+EE98
+EE99
+EE9A
+EE9B
+EE9C
+EE9D
+EE9E
+EE9F
+EEA0
+EEA1
+EEA2
+EEA3
+EEA4
+EEA5
+EEA6
+EEA7
+EEA8
+EEA9
+EEAA
+EEAB
+EEAC
+EEAD
+EEAE
+EEAF
+EEB0
+EEB1
+EEB2
+EEB3
+EEB4
+EEB5
+EEB6
+EEB7
+EEB8
+EEB9
+EEBA
+EEBB
+EEBC
+EEBD
+EEBE
+EEBF
+EEC0
+EEC1
+EEC2
+EEC3
+EEC4
+EEC5
+EEC6
+EEC7
+EEC8
+EEC9
+EECA
+EECB
+EECC
+EECD
+EECE
+EECF
+EED0
+EED1
+EED2
+EED3
+EED4
+EED5
+EED6
+EED7
+EED8
+EED9
+EEDA
+EEDB
+EEDC
+EEDD
+EEDE
+EEDF
+EEE0
+EEE1
+EEE2
+EEE3
+EEE4
+EEE5
+EEE6
+EEE7
+EEE8
+EEE9
+EEEA
+EEEB
+EEEC
+EEEF
+EEF0
+EEF1
+EEF2
+EEF3
+EEF4
+EEF5
+EEF6
+EEF7
+EEF8
+EEF9
+EEFA
+EEFB
+EEFC
+FA40
+FA41
+FA42
+FA43
+FA44
+FA45
+FA46
+FA47
+FA48
+FA49
+FA4A
+FA4B
+FA4C
+FA4D
+FA4E
+FA4F
+FA50
+FA51
+FA52
+FA53
+FA54
+FA55
+FA56
+FA57
+FA58
+FA59
+FA5A
+FA5B
+FA5C
+FA5D
+FA5E
+FA5F
+FA60
+FA61
+FA62
+FA63
+FA64
+FA65
+FA66
+FA67
+FA68
+FA69
+FA6A
+FA6B
+FA6C
+FA6D
+FA6E
+FA6F
+FA70
+FA71
+FA72
+FA73
+FA74
+FA75
+FA76
+FA77
+FA78
+FA79
+FA7A
+FA7B
+FA7C
+FA7D
+FA7E
+FA80
+FA81
+FA82
+FA83
+FA84
+FA85
+FA86
+FA87
+FA88
+FA89
+FA8A
+FA8B
+FA8C
+FA8D
+FA8E
+FA8F
+FA90
+FA91
+FA92
+FA93
+FA94
+FA95
+FA96
+FA97
+FA98
+FA99
+FA9A
+FA9B
+FA9C
+FA9D
+FA9E
+FA9F
+FAA0
+FAA1
+FAA2
+FAA3
+FAA4
+FAA5
+FAA6
+FAA7
+FAA8
+FAA9
+FAAA
+FAAB
+FAAC
+FAAD
+FAAE
+FAAF
+FAB0
+FAB1
+FAB2
+FAB3
+FAB4
+FAB5
+FAB6
+FAB7
+FAB8
+FAB9
+FABA
+FABB
+FABC
+FABD
+FABE
+FABF
+FAC0
+FAC1
+FAC2
+FAC3
+FAC4
+FAC5
+FAC6
+FAC7
+FAC8
+FAC9
+FACA
+FACB
+FACC
+FACD
+FACE
+FACF
+FAD0
+FAD1
+FAD2
+FAD3
+FAD4
+FAD5
+FAD6
+FAD7
+FAD8
+FAD9
+FADA
+FADB
+FADC
+FADD
+FADE
+FADF
+FAE0
+FAE1
+FAE2
+FAE3
+FAE4
+FAE5
+FAE6
+FAE7
+FAE8
+FAE9
+FAEA
+FAEB
+FAEC
+FAED
+FAEE
+FAEF
+FAF0
+FAF1
+FAF2
+FAF3
+FAF4
+FAF5
+FAF6
+FAF7
+FAF8
+FAF9
+FAFA
+FAFB
+FAFC
+FB40
+FB41
+FB42
+FB43
+FB44
+FB45
+FB46
+FB47
+FB48
+FB49
+FB4A
+FB4B
+FB4C
+FB4D
+FB4E
+FB4F
+FB50
+FB51
+FB52
+FB53
+FB54
+FB55
+FB56
+FB57
+FB58
+FB59
+FB5A
+FB5B
+FB5C
+FB5D
+FB5E
+FB5F
+FB60
+FB61
+FB62
+FB63
+FB64
+FB65
+FB66
+FB67
+FB68
+FB69
+FB6A
+FB6B
+FB6C
+FB6D
+FB6E
+FB6F
+FB70
+FB71
+FB72
+FB73
+FB74
+FB75
+FB76
+FB77
+FB78
+FB79
+FB7A
+FB7B
+FB7C
+FB7D
+FB7E
+FB80
+FB81
+FB82
+FB83
+FB84
+FB85
+FB86
+FB87
+FB88
+FB89
+FB8A
+FB8B
+FB8C
+FB8D
+FB8E
+FB8F
+FB90
+FB91
+FB92
+FB93
+FB94
+FB95
+FB96
+FB97
+FB98
+FB99
+FB9A
+FB9B
+FB9C
+FB9D
+FB9E
+FB9F
+FBA0
+FBA1
+FBA2
+FBA3
+FBA4
+FBA5
+FBA6
+FBA7
+FBA8
+FBA9
+FBAA
+FBAB
+FBAC
+FBAD
+FBAE
+FBAF
+FBB0
+FBB1
+FBB2
+FBB3
+FBB4
+FBB5
+FBB6
+FBB7
+FBB8
+FBB9
+FBBA
+FBBB
+FBBC
+FBBD
+FBBE
+FBBF
+FBC0
+FBC1
+FBC2
+FBC3
+FBC4
+FBC5
+FBC6
+FBC7
+FBC8
+FBC9
+FBCA
+FBCB
+FBCC
+FBCD
+FBCE
+FBCF
+FBD0
+FBD1
+FBD2
+FBD3
+FBD4
+FBD5
+FBD6
+FBD7
+FBD8
+FBD9
+FBDA
+FBDB
+FBDC
+FBDD
+FBDE
+FBDF
+FBE0
+FBE1
+FBE2
+FBE3
+FBE4
+FBE5
+FBE6
+FBE7
+FBE8
+FBE9
+FBEA
+FBEB
+FBEC
+FBED
+FBEE
+FBEF
+FBF0
+FBF1
+FBF2
+FBF3
+FBF4
+FBF5
+FBF6
+FBF7
+FBF8
+FBF9
+FBFA
+FBFB
+FBFC
+FC40
+FC41
+FC42
+FC43
+FC44
+FC45
+FC46
+FC47
+FC48
+FC49
+FC4A
+FC4B
+F040
+F041
+F042
+F043
+F044
+F045
+F046
+F047
+F048
+F049
+F04A
+F04B
+F04C
+F04D
+F04E
+F04F
+F050
+F051
+F052
+F053
+F054
+F055
+F056
+F057
+F058
+F059
+F05A
+F05B
+F05C
+F05D
+F05E
+F05F
+F060
+F061
+F062
+F063
+F064
+F065
+F066
+F067
+F068
+F069
+F06A
+F06B
+F06C
+F06D
+F06E
+F06F
+F070
+F071
+F072
+F073
+F074
+F075
+F076
+F077
+F078
+F079
+F07A
+F07B
+F07C
+F07D
+F07E
+F080
+F081
+F082
+F083
+F084
+F085
+F086
+F087
+F088
+F089
+F08A
+F08B
+F08C
+F08D
+F08E
+F08F
+F090
+F091
+F092
+F093
+F094
+F095
+F096
+F097
+F098
+F099
+F09A
+F09B
+F09C
+F09D
+F09E
+F09F
+F0A0
+F0A1
+F0A2
+F0A3
+F0A4
+F0A5
+F0A6
+F0A7
+F0A8
+F0A9
+F0AA
+F0AB
+F0AC
+F0AD
+F0AE
+F0AF
+F0B0
+F0B1
+F0B2
+F0B3
+F0B4
+F0B5
+F0B6
+F0B7
+F0B8
+F0B9
+F0BA
+F0BB
+F0BC
+F0BD
+F0BE
+F0BF
+F0C0
+F0C1
+F0C2
+F0C3
+F0C4
+F0C5
+F0C6
+F0C7
+F0C8
+F0C9
+F0CA
+F0CB
+F0CC
+F0CD
+F0CE
+F0CF
+F0D0
+F0D1
+F0D2
+F0D3
+F0D4
+F0D5
+F0D6
+F0D7
+F0D8
+F0D9
+F0DA
+F0DB
+F0DC
+F0DD
+F0DE
+F0DF
+F0E0
+F0E1
+F0E2
+F0E3
+F0E4
+F0E5
+F0E6
+F0E7
+F0E8
+F0E9
+F0EA
+F0EB
+F0EC
+F0ED
+F0EE
+F0EF
+F0F0
+F0F1
+F0F2
+F0F3
+F0F4
+F0F5
+F0F6
+F0F7
+F0F8
+F0F9
+F0FA
+F0FB
+F0FC
+F140
+F141
+F142
+F143
+F144
+F145
+F146
+F147
+F148
+F149
+F14A
+F14B
+F14C
+F14D
+F14E
+F14F
+F150
+F151
+F152
+F153
+F154
+F155
+F156
+F157
+F158
+F159
+F15A
+F15B
+F15C
+F15D
+F15E
+F15F
+F160
+F161
+F162
+F163
+F164
+F165
+F166
+F167
+F168
+F169
+F16A
+F16B
+F16C
+F16D
+F16E
+F16F
+F170
+F171
+F172
+F173
+F174
+F175
+F176
+F177
+F178
+F179
+F17A
+F17B
+F17C
+F17D
+F17E
+F180
+F181
+F182
+F183
+F184
+F185
+F186
+F187
+F188
+F189
+F18A
+F18B
+F18C
+F18D
+F18E
+F18F
+F190
+F191
+F192
+F193
+F194
+F195
+F196
+F197
+F198
+F199
+F19A
+F19B
+F19C
+F19D
+F19E
+F19F
+F1A0
+F1A1
+F1A2
+F1A3
+F1A4
+F1A5
+F1A6
+F1A7
+F1A8
+F1A9
+F1AA
+F1AB
+F1AC
+F1AD
+F1AE
+F1AF
+F1B0
+F1B1
+F1B2
+F1B3
+F1B4
+F1B5
+F1B6
+F1B7
+F1B8
+F1B9
+F1BA
+F1BB
+F1BC
+F1BD
+F1BE
+F1BF
+F1C0
+F1C1
+F1C2
+F1C3
+F1C4
+F1C5
+F1C6
+F1C7
+F1C8
+F1C9
+F1CA
+F1CB
+F1CC
+F1CD
+F1CE
+F1CF
+F1D0
+F1D1
+F1D2
+F1D3
+F1D4
+F1D5
+F1D6
+F1D7
+F1D8
+F1D9
+F1DA
+F1DB
+F1DC
+F1DD
+F1DE
+F1DF
+F1E0
+F1E1
+F1E2
+F1E3
+F1E4
+F1E5
+F1E6
+F1E7
+F1E8
+F1E9
+F1EA
+F1EB
+F1EC
+F1ED
+F1EE
+F1EF
+F1F0
+F1F1
+F1F2
+F1F3
+F1F4
+F1F5
+F1F6
+F1F7
+F1F8
+F1F9
+F1FA
+F1FB
+F1FC
+F240
+F241
+F242
+F243
+F244
+F245
+F246
+F247
+F248
+F249
+F24A
+F24B
+F24C
+F24D
+F24E
+F24F
+F250
+F251
+F252
+F253
+F254
+F255
+F256
+F257
+F258
+F259
+F25A
+F25B
+F25C
+F25D
+F25E
+F25F
+F260
+F261
+F262
+F263
+F264
+F265
+F266
+F267
+F268
+F269
+F26A
+F26B
+F26C
+F26D
+F26E
+F26F
+F270
+F271
+F272
+F273
+F274
+F275
+F276
+F277
+F278
+F279
+F27A
+F27B
+F27C
+F27D
+F27E
+F280
+F281
+F282
+F283
+F284
+F285
+F286
+F287
+F288
+F289
+F28A
+F28B
+F28C
+F28D
+F28E
+F28F
+F290
+F291
+F292
+F293
+F294
+F295
+F296
+F297
+F298
+F299
+F29A
+F29B
+F29C
+F29D
+F29E
+F29F
+F2A0
+F2A1
+F2A2
+F2A3
+F2A4
+F2A5
+F2A6
+F2A7
+F2A8
+F2A9
+F2AA
+F2AB
+F2AC
+F2AD
+F2AE
+F2AF
+F2B0
+F2B1
+F2B2
+F2B3
+F2B4
+F2B5
+F2B6
+F2B7
+F2B8
+F2B9
+F2BA
+F2BB
+F2BC
+F2BD
+F2BE
+F2BF
+F2C0
+F2C1
+F2C2
+F2C3
+F2C4
+F2C5
+F2C6
+F2C7
+F2C8
+F2C9
+F2CA
+F2CB
+F2CC
+F2CD
+F2CE
+F2CF
+F2D0
+F2D1
+F2D2
+F2D3
+F2D4
+F2D5
+F2D6
+F2D7
+F2D8
+F2D9
+F2DA
+F2DB
+F2DC
+F2DD
+F2DE
+F2DF
+F2E0
+F2E1
+F2E2
+F2E3
+F2E4
+F2E5
+F2E6
+F2E7
+F2E8
+F2E9
+F2EA
+F2EB
+F2EC
+F2ED
+F2EE
+F2EF
+F2F0
+F2F1
+F2F2
+F2F3
+F2F4
+F2F5
+F2F6
+F2F7
+F2F8
+F2F9
+F2FA
+F2FB
+F2FC
+F340
+F341
+F342
+F343
+F344
+F345
+F346
+F347
+F348
+F349
+F34A
+F34B
+F34C
+F34D
+F34E
+F34F
+F350
+F351
+F352
+F353
+F354
+F355
+F356
+F357
+F358
+F359
+F35A
+F35B
+F35C
+F35D
+F35E
+F35F
+F360
+F361
+F362
+F363
+F364
+F365
+F366
+F367
+F368
+F369
+F36A
+F36B
+F36C
+F36D
+F36E
+F36F
+F370
+F371
+F372
+F373
+F374
+F375
+F376
+F377
+F378
+F379
+F37A
+F37B
+F37C
+F37D
+F37E
+F380
+F381
+F382
+F383
+F384
+F385
+F386
+F387
+F388
+F389
+F38A
+F38B
+F38C
+F38D
+F38E
+F38F
+F390
+F391
+F392
+F393
+F394
+F395
+F396
+F397
+F398
+F399
+F39A
+F39B
+F39C
+F39D
+F39E
+F39F
+F3A0
+F3A1
+F3A2
+F3A3
+F3A4
+F3A5
+F3A6
+F3A7
+F3A8
+F3A9
+F3AA
+F3AB
+F3AC
+F3AD
+F3AE
+F3AF
+F3B0
+F3B1
+F3B2
+F3B3
+F3B4
+F3B5
+F3B6
+F3B7
+F3B8
+F3B9
+F3BA
+F3BB
+F3BC
+F3BD
+F3BE
+F3BF
+F3C0
+F3C1
+F3C2
+F3C3
+F3C4
+F3C5
+F3C6
+F3C7
+F3C8
+F3C9
+F3CA
+F3CB
+F3CC
+F3CD
+F3CE
+F3CF
+F3D0
+F3D1
+F3D2
+F3D3
+F3D4
+F3D5
+F3D6
+F3D7
+F3D8
+F3D9
+F3DA
+F3DB
+F3DC
+F3DD
+F3DE
+F3DF
+F3E0
+F3E1
+F3E2
+F3E3
+F3E4
+F3E5
+F3E6
+F3E7
+F3E8
+F3E9
+F3EA
+F3EB
+F3EC
+F3ED
+F3EE
+F3EF
+F3F0
+F3F1
+F3F2
+F3F3
+F3F4
+F3F5
+F3F6
+F3F7
+F3F8
+F3F9
+F3FA
+F3FB
+F3FC
+F440
+F441
+F442
+F443
+F444
+F445
+F446
+F447
+F448
+F449
+F44A
+F44B
+F44C
+F44D
+F44E
+F44F
+F450
+F451
+F452
+F453
+F454
+F455
+F456
+F457
+F458
+F459
+F45A
+F45B
+F45C
+F45D
+F45E
+F45F
+F460
+F461
+F462
+F463
+F464
+F465
+F466
+F467
+F468
+F469
+F46A
+F46B
+F46C
+F46D
+F46E
+F46F
+F470
+F471
+F472
+F473
+F474
+F475
+F476
+F477
+F478
+F479
+F47A
+F47B
+F47C
+F47D
+F47E
+F480
+F481
+F482
+F483
+F484
+F485
+F486
+F487
+F488
+F489
+F48A
+F48B
+F48C
+F48D
+F48E
+F48F
+F490
+F491
+F492
+F493
+F494
+F495
+F496
+F497
+F498
+F499
+F49A
+F49B
+F49C
+F49D
+F49E
+F49F
+F4A0
+F4A1
+F4A2
+F4A3
+F4A4
+F4A5
+F4A6
+F4A7
+F4A8
+F4A9
+F4AA
+F4AB
+F4AC
+F4AD
+F4AE
+F4AF
+F4B0
+F4B1
+F4B2
+F4B3
+F4B4
+F4B5
+F4B6
+F4B7
+F4B8
+F4B9
+F4BA
+F4BB
+F4BC
+F4BD
+F4BE
+F4BF
+F4C0
+F4C1
+F4C2
+F4C3
+F4C4
+F4C5
+F4C6
+F4C7
+F4C8
+F4C9
+F4CA
+F4CB
+F4CC
+F4CD
+F4CE
+F4CF
+F4D0
+F4D1
+F4D2
+F4D3
+F4D4
+F4D5
+F4D6
+F4D7
+F4D8
+F4D9
+F4DA
+F4DB
+F4DC
+F4DD
+F4DE
+F4DF
+F4E0
+F4E1
+F4E2
+F4E3
+F4E4
+F4E5
+F4E6
+F4E7
+F4E8
+F4E9
+F4EA
+F4EB
+F4EC
+F4ED
+F4EE
+F4EF
+F4F0
+F4F1
+F4F2
+F4F3
+F4F4
+F4F5
+F4F6
+F4F7
+F4F8
+F4F9
+F4FA
+F4FB
+F4FC
+F540
+F541
+F542
+F543
+F544
+F545
+F546
+F547
+F548
+F549
+F54A
+F54B
+F54C
+F54D
+F54E
+F54F
+F550
+F551
+F552
+F553
+F554
+F555
+F556
+F557
+F558
+F559
+F55A
+F55B
+F55C
+F55D
+F55E
+F55F
+F560
+F561
+F562
+F563
+F564
+F565
+F566
+F567
+F568
+F569
+F56A
+F56B
+F56C
+F56D
+F56E
+F56F
+F570
+F571
+F572
+F573
+F574
+F575
+F576
+F577
+F578
+F579
+F57A
+F57B
+F57C
+F57D
+F57E
+F580
+F581
+F582
+F583
+F584
+F585
+F586
+F587
+F588
+F589
+F58A
+F58B
+F58C
+F58D
+F58E
+F58F
+F590
+F591
+F592
+F593
+F594
+F595
+F596
+F597
+F598
+F599
+F59A
+F59B
+F59C
+F59D
+F59E
+F59F
+F5A0
+F5A1
+F5A2
+F5A3
+F5A4
+F5A5
+F5A6
+F5A7
+F5A8
+F5A9
+F5AA
+F5AB
+F5AC
+F5AD
+F5AE
+F5AF
+F5B0
+F5B1
+F5B2
+F5B3
+F5B4
+F5B5
+F5B6
+F5B7
+F5B8
+F5B9
+F5BA
+F5BB
+F5BC
+F5BD
+F5BE
+F5BF
+F5C0
+F5C1
+F5C2
+F5C3
+F5C4
+F5C5
+F5C6
+F5C7
+F5C8
+F5C9
+F5CA
+F5CB
+F5CC
+F5CD
+F5CE
+F5CF
+F5D0
+F5D1
+F5D2
+F5D3
+F5D4
+F5D5
+F5D6
+F5D7
+F5D8
+F5D9
+F5DA
+F5DB
+F5DC
+F5DD
+F5DE
+F5DF
+F5E0
+F5E1
+F5E2
+F5E3
+F5E4
+F5E5
+F5E6
+F5E7
+F5E8
+F5E9
+F5EA
+F5EB
+F5EC
+F5ED
+F5EE
+F5EF
+F5F0
+F5F1
+F5F2
+F5F3
+F5F4
+F5F5
+F5F6
+F5F7
+F5F8
+F5F9
+F5FA
+F5FB
+F5FC
+F640
+F641
+F642
+F643
+F644
+F645
+F646
+F647
+F648
+F649
+F64A
+F64B
+F64C
+F64D
+F64E
+F64F
+F650
+F651
+F652
+F653
+F654
+F655
+F656
+F657
+F658
+F659
+F65A
+F65B
+F65C
+F65D
+F65E
+F65F
+F660
+F661
+F662
+F663
+F664
+F665
+F666
+F667
+F668
+F669
+F66A
+F66B
+F66C
+F66D
+F66E
+F66F
+F670
+F671
+F672
+F673
+F674
+F675
+F676
+F677
+F678
+F679
+F67A
+F67B
+F67C
+F67D
+F67E
+F680
+F681
+F682
+F683
+F684
+F685
+F686
+F687
+F688
+F689
+F68A
+F68B
+F68C
+F68D
+F68E
+F68F
+F690
+F691
+F692
+F693
+F694
+F695
+F696
+F697
+F698
+F699
+F69A
+F69B
+F69C
+F69D
+F69E
+F69F
+F6A0
+F6A1
+F6A2
+F6A3
+F6A4
+F6A5
+F6A6
+F6A7
+F6A8
+F6A9
+F6AA
+F6AB
+F6AC
+F6AD
+F6AE
+F6AF
+F6B0
+F6B1
+F6B2
+F6B3
+F6B4
+F6B5
+F6B6
+F6B7
+F6B8
+F6B9
+F6BA
+F6BB
+F6BC
+F6BD
+F6BE
+F6BF
+F6C0
+F6C1
+F6C2
+F6C3
+F6C4
+F6C5
+F6C6
+F6C7
+F6C8
+F6C9
+F6CA
+F6CB
+F6CC
+F6CD
+F6CE
+F6CF
+F6D0
+F6D1
+F6D2
+F6D3
+F6D4
+F6D5
+F6D6
+F6D7
+F6D8
+F6D9
+F6DA
+F6DB
+F6DC
+F6DD
+F6DE
+F6DF
+F6E0
+F6E1
+F6E2
+F6E3
+F6E4
+F6E5
+F6E6
+F6E7
+F6E8
+F6E9
+F6EA
+F6EB
+F6EC
+F6ED
+F6EE
+F6EF
+F6F0
+F6F1
+F6F2
+F6F3
+F6F4
+F6F5
+F6F6
+F6F7
+F6F8
+F6F9
+F6FA
+F6FB
+F6FC
+F740
+F741
+F742
+F743
+F744
+F745
+F746
+F747
+F748
+F749
+F74A
+F74B
+F74C
+F74D
+F74E
+F74F
+F750
+F751
+F752
+F753
+F754
+F755
+F756
+F757
+F758
+F759
+F75A
+F75B
+F75C
+F75D
+F75E
+F75F
+F760
+F761
+F762
+F763
+F764
+F765
+F766
+F767
+F768
+F769
+F76A
+F76B
+F76C
+F76D
+F76E
+F76F
+F770
+F771
+F772
+F773
+F774
+F775
+F776
+F777
+F778
+F779
+F77A
+F77B
+F77C
+F77D
+F77E
+F780
+F781
+F782
+F783
+F784
+F785
+F786
+F787
+F788
+F789
+F78A
+F78B
+F78C
+F78D
+F78E
+F78F
+F790
+F791
+F792
+F793
+F794
+F795
+F796
+F797
+F798
+F799
+F79A
+F79B
+F79C
+F79D
+F79E
+F79F
+F7A0
+F7A1
+F7A2
+F7A3
+F7A4
+F7A5
+F7A6
+F7A7
+F7A8
+F7A9
+F7AA
+F7AB
+F7AC
+F7AD
+F7AE
+F7AF
+F7B0
+F7B1
+F7B2
+F7B3
+F7B4
+F7B5
+F7B6
+F7B7
+F7B8
+F7B9
+F7BA
+F7BB
+F7BC
+F7BD
+F7BE
+F7BF
+F7C0
+F7C1
+F7C2
+F7C3
+F7C4
+F7C5
+F7C6
+F7C7
+F7C8
+F7C9
+F7CA
+F7CB
+F7CC
+F7CD
+F7CE
+F7CF
+F7D0
+F7D1
+F7D2
+F7D3
+F7D4
+F7D5
+F7D6
+F7D7
+F7D8
+F7D9
+F7DA
+F7DB
+F7DC
+F7DD
+F7DE
+F7DF
+F7E0
+F7E1
+F7E2
+F7E3
+F7E4
+F7E5
+F7E6
+F7E7
+F7E8
+F7E9
+F7EA
+F7EB
+F7EC
+F7ED
+F7EE
+F7EF
+F7F0
+F7F1
+F7F2
+F7F3
+F7F4
+F7F5
+F7F6
+F7F7
+F7F8
+F7F9
+F7FA
+F7FB
+F7FC
+F840
+F841
+F842
+F843
+F844
+F845
+F846
+F847
+F848
+F849
+F84A
+F84B
+F84C
+F84D
+F84E
+F84F
+F850
+F851
+F852
+F853
+F854
+F855
+F856
+F857
+F858
+F859
+F85A
+F85B
+F85C
+F85D
+F85E
+F85F
+F860
+F861
+F862
+F863
+F864
+F865
+F866
+F867
+F868
+F869
+F86A
+F86B
+F86C
+F86D
+F86E
+F86F
+F870
+F871
+F872
+F873
+F874
+F875
+F876
+F877
+F878
+F879
+F87A
+F87B
+F87C
+F87D
+F87E
+F880
+F881
+F882
+F883
+F884
+F885
+F886
+F887
+F888
+F889
+F88A
+F88B
+F88C
+F88D
+F88E
+F88F
+F890
+F891
+F892
+F893
+F894
+F895
+F896
+F897
+F898
+F899
+F89A
+F89B
+F89C
+F89D
+F89E
+F89F
+F8A0
+F8A1
+F8A2
+F8A3
+F8A4
+F8A5
+F8A6
+F8A7
+F8A8
+F8A9
+F8AA
+F8AB
+F8AC
+F8AD
+F8AE
+F8AF
+F8B0
+F8B1
+F8B2
+F8B3
+F8B4
+F8B5
+F8B6
+F8B7
+F8B8
+F8B9
+F8BA
+F8BB
+F8BC
+F8BD
+F8BE
+F8BF
+F8C0
+F8C1
+F8C2
+F8C3
+F8C4
+F8C5
+F8C6
+F8C7
+F8C8
+F8C9
+F8CA
+F8CB
+F8CC
+F8CD
+F8CE
+F8CF
+F8D0
+F8D1
+F8D2
+F8D3
+F8D4
+F8D5
+F8D6
+F8D7
+F8D8
+F8D9
+F8DA
+F8DB
+F8DC
+F8DD
+F8DE
+F8DF
+F8E0
+F8E1
+F8E2
+F8E3
+F8E4
+F8E5
+F8E6
+F8E7
+F8E8
+F8E9
+F8EA
+F8EB
+F8EC
+F8ED
+F8EE
+F8EF
+F8F0
+F8F1
+F8F2
+F8F3
+F8F4
+F8F5
+F8F6
+F8F7
+F8F8
+F8F9
+F8FA
+F8FB
+F8FC
+F940
+F941
+F942
+F943
+F944
+F945
+F946
+F947
+F948
+F949
+F94A
+F94B
+F94C
+F94D
+F94E
+F94F
+F950
+F951
+F952
+F953
+F954
+F955
+F956
+F957
+F958
+F959
+F95A
+F95B
+F95C
+F95D
+F95E
+F95F
+F960
+F961
+F962
+F963
+F964
+F965
+F966
+F967
+F968
+F969
+F96A
+F96B
+F96C
+F96D
+F96E
+F96F
+F970
+F971
+F972
+F973
+F974
+F975
+F976
+F977
+F978
+F979
+F97A
+F97B
+F97C
+F97D
+F97E
+F980
+F981
+F982
+F983
+F984
+F985
+F986
+F987
+F988
+F989
+F98A
+F98B
+F98C
+F98D
+F98E
+F98F
+F990
+F991
+F992
+F993
+F994
+F995
+F996
+F997
+F998
+F999
+F99A
+F99B
+F99C
+F99D
+F99E
+F99F
+F9A0
+F9A1
+F9A2
+F9A3
+F9A4
+F9A5
+F9A6
+F9A7
+F9A8
+F9A9
+F9AA
+F9AB
+F9AC
+F9AD
+F9AE
+F9AF
+F9B0
+F9B1
+F9B2
+F9B3
+F9B4
+F9B5
+F9B6
+F9B7
+F9B8
+F9B9
+F9BA
+F9BB
+F9BC
+F9BD
+F9BE
+F9BF
+F9C0
+F9C1
+F9C2
+F9C3
+F9C4
+F9C5
+F9C6
+F9C7
+F9C8
+F9C9
+F9CA
+F9CB
+F9CC
+F9CD
+F9CE
+F9CF
+F9D0
+F9D1
+F9D2
+F9D3
+F9D4
+F9D5
+F9D6
+F9D7
+F9D8
+F9D9
+F9DA
+F9DB
+F9DC
+F9DD
+F9DE
+F9DF
+F9E0
+F9E1
+F9E2
+F9E3
+F9E4
+F9E5
+F9E6
+F9E7
+F9E8
+F9E9
+F9EA
+F9EB
+F9EC
+F9ED
+F9EE
+F9EF
+F9F0
+F9F1
+F9F2
+F9F3
+F9F4
+F9F5
+F9F6
+F9F7
+F9F8
+F9F9
+F9FA
+F9FB
+F9FC
+CREATE TABLE t2 SELECT CONVERT(c1 USING ucs2) AS c1 FROM t1;
+SELECT HEX(c1) FROM t2;
+HEX(c1)
+0005
+007E
+2015
+FF3C
+FF5E
+2225
+FF0D
+FFE0
+FFE1
+FFE2
+2460
+2461
+2462
+2463
+2464
+2465
+2466
+2467
+2468
+2469
+246A
+246B
+246C
+246D
+246E
+246F
+2470
+2471
+2472
+2473
+2160
+2161
+2162
+2163
+2164
+2165
+2166
+2167
+2168
+2169
+3349
+3314
+3322
+334D
+3318
+3327
+3303
+3336
+3351
+3357
+330D
+3326
+3323
+332B
+334A
+333B
+339C
+339D
+339E
+338E
+338F
+33C4
+33A1
+337B
+301D
+301F
+2116
+33CD
+2121
+32A4
+32A5
+32A6
+32A7
+32A8
+3231
+3232
+3239
+337E
+337D
+337C
+2252
+2261
+222B
+222E
+2211
+221A
+22A5
+2220
+221F
+22BF
+2235
+2229
+222A
+7E8A
+891C
+9348
+9288
+84DC
+4FC9
+70BB
+6631
+68C8
+92F9
+66FB
+5F45
+4E28
+4EE1
+4EFC
+4F00
+4F03
+4F39
+4F56
+4F92
+4F8A
+4F9A
+4F94
+4FCD
+5040
+5022
+4FFF
+501E
+5046
+5070
+5042
+5094
+50F4
+50D8
+514A
+5164
+519D
+51BE
+51EC
+5215
+529C
+52A6
+52C0
+52DB
+5300
+5307
+5324
+5372
+5393
+53B2
+53DD
+FA0E
+549C
+548A
+54A9
+54FF
+5586
+5759
+5765
+57AC
+57C8
+57C7
+FA0F
+FA10
+589E
+58B2
+590B
+5953
+595B
+595D
+5963
+59A4
+59BA
+5B56
+5BC0
+752F
+5BD8
+5BEC
+5C1E
+5CA6
+5CBA
+5CF5
+5D27
+5D53
+FA11
+5D42
+5D6D
+5DB8
+5DB9
+5DD0
+5F21
+5F34
+5F67
+5FB7
+5FDE
+605D
+6085
+608A
+60DE
+60D5
+6120
+60F2
+6111
+6137
+6130
+6198
+6213
+62A6
+63F5
+6460
+649D
+64CE
+654E
+6600
+6615
+663B
+6609
+662E
+661E
+6624
+6665
+6657
+6659
+FA12
+6673
+6699
+66A0
+66B2
+66BF
+66FA
+670E
+F929
+6766
+67BB
+6852
+67C0
+6801
+6844
+68CF
+FA13
+6968
+FA14
+6998
+69E2
+6A30
+6A6B
+6A46
+6A73
+6A7E
+6AE2
+6AE4
+6BD6
+6C3F
+6C5C
+6C86
+6C6F
+6CDA
+6D04
+6D87
+6D6F
+6D96
+6DAC
+6DCF
+6DF8
+6DF2
+6DFC
+6E39
+6E5C
+6E27
+6E3C
+6EBF
+6F88
+6FB5
+6FF5
+7005
+7007
+7028
+7085
+70AB
+710F
+7104
+715C
+7146
+7147
+FA15
+71C1
+71FE
+72B1
+72BE
+7324
+FA16
+7377
+73BD
+73C9
+73D6
+73E3
+73D2
+7407
+73F5
+7426
+742A
+7429
+742E
+7462
+7489
+749F
+7501
+756F
+7682
+769C
+769E
+769B
+76A6
+FA17
+7746
+52AF
+7821
+784E
+7864
+787A
+7930
+FA18
+FA19
+FA1A
+7994
+FA1B
+799B
+7AD1
+7AE7
+FA1C
+7AEB
+7B9E
+FA1D
+7D48
+7D5C
+7DB7
+7DA0
+7DD6
+7E52
+7F47
+7FA1
+FA1E
+8301
+8362
+837F
+83C7
+83F6
+8448
+84B4
+8553
+8559
+856B
+FA1F
+85B0
+FA20
+FA21
+8807
+88F5
+8A12
+8A37
+8A79
+8AA7
+8ABE
+8ADF
+FA22
+8AF6
+8B53
+8B7F
+8CF0
+8CF4
+8D12
+8D76
+FA23
+8ECF
+FA24
+FA25
+9067
+90DE
+FA26
+9115
+9127
+91DA
+91D7
+91DE
+91ED
+91EE
+91E4
+91E5
+9206
+9210
+920A
+923A
+9240
+923C
+924E
+9259
+9251
+9239
+9267
+92A7
+9277
+9278
+92E7
+92D7
+92D9
+92D0
+FA27
+92D5
+92E0
+92D3
+9325
+9321
+92FB
+FA28
+931E
+92FF
+931D
+9302
+9370
+9357
+93A4
+93C6
+93DE
+93F8
+9431
+9445
+9448
+9592
+F9DC
+FA29
+969D
+96AF
+9733
+973B
+9743
+974D
+974F
+9751
+9755
+9857
+9865
+FA2A
+FA2B
+9927
+FA2C
+999E
+9A4E
+9AD9
+9ADC
+9B75
+9B72
+9B8F
+9BB1
+9BBB
+9C00
+9D70
+9D6B
+FA2D
+9E19
+9ED1
+2170
+2171
+2172
+2173
+2174
+2175
+2176
+2177
+2178
+2179
+FFE2
+FFE4
+FF07
+FF02
+2170
+2171
+2172
+2173
+2174
+2175
+2176
+2177
+2178
+2179
+2160
+2161
+2162
+2163
+2164
+2165
+2166
+2167
+2168
+2169
+FFE2
+FFE4
+FF07
+FF02
+3231
+2116
+2121
+2235
+7E8A
+891C
+9348
+9288
+84DC
+4FC9
+70BB
+6631
+68C8
+92F9
+66FB
+5F45
+4E28
+4EE1
+4EFC
+4F00
+4F03
+4F39
+4F56
+4F92
+4F8A
+4F9A
+4F94
+4FCD
+5040
+5022
+4FFF
+501E
+5046
+5070
+5042
+5094
+50F4
+50D8
+514A
+5164
+519D
+51BE
+51EC
+5215
+529C
+52A6
+52C0
+52DB
+5300
+5307
+5324
+5372
+5393
+53B2
+53DD
+FA0E
+549C
+548A
+54A9
+54FF
+5586
+5759
+5765
+57AC
+57C8
+57C7
+FA0F
+FA10
+589E
+58B2
+590B
+5953
+595B
+595D
+5963
+59A4
+59BA
+5B56
+5BC0
+752F
+5BD8
+5BEC
+5C1E
+5CA6
+5CBA
+5CF5
+5D27
+5D53
+FA11
+5D42
+5D6D
+5DB8
+5DB9
+5DD0
+5F21
+5F34
+5F67
+5FB7
+5FDE
+605D
+6085
+608A
+60DE
+60D5
+6120
+60F2
+6111
+6137
+6130
+6198
+6213
+62A6
+63F5
+6460
+649D
+64CE
+654E
+6600
+6615
+663B
+6609
+662E
+661E
+6624
+6665
+6657
+6659
+FA12
+6673
+6699
+66A0
+66B2
+66BF
+66FA
+670E
+F929
+6766
+67BB
+6852
+67C0
+6801
+6844
+68CF
+FA13
+6968
+FA14
+6998
+69E2
+6A30
+6A6B
+6A46
+6A73
+6A7E
+6AE2
+6AE4
+6BD6
+6C3F
+6C5C
+6C86
+6C6F
+6CDA
+6D04
+6D87
+6D6F
+6D96
+6DAC
+6DCF
+6DF8
+6DF2
+6DFC
+6E39
+6E5C
+6E27
+6E3C
+6EBF
+6F88
+6FB5
+6FF5
+7005
+7007
+7028
+7085
+70AB
+710F
+7104
+715C
+7146
+7147
+FA15
+71C1
+71FE
+72B1
+72BE
+7324
+FA16
+7377
+73BD
+73C9
+73D6
+73E3
+73D2
+7407
+73F5
+7426
+742A
+7429
+742E
+7462
+7489
+749F
+7501
+756F
+7682
+769C
+769E
+769B
+76A6
+FA17
+7746
+52AF
+7821
+784E
+7864
+787A
+7930
+FA18
+FA19
+FA1A
+7994
+FA1B
+799B
+7AD1
+7AE7
+FA1C
+7AEB
+7B9E
+FA1D
+7D48
+7D5C
+7DB7
+7DA0
+7DD6
+7E52
+7F47
+7FA1
+FA1E
+8301
+8362
+837F
+83C7
+83F6
+8448
+84B4
+8553
+8559
+856B
+FA1F
+85B0
+FA20
+FA21
+8807
+88F5
+8A12
+8A37
+8A79
+8AA7
+8ABE
+8ADF
+FA22
+8AF6
+8B53
+8B7F
+8CF0
+8CF4
+8D12
+8D76
+FA23
+8ECF
+FA24
+FA25
+9067
+90DE
+FA26
+9115
+9127
+91DA
+91D7
+91DE
+91ED
+91EE
+91E4
+91E5
+9206
+9210
+920A
+923A
+9240
+923C
+924E
+9259
+9251
+9239
+9267
+92A7
+9277
+9278
+92E7
+92D7
+92D9
+92D0
+FA27
+92D5
+92E0
+92D3
+9325
+9321
+92FB
+FA28
+931E
+92FF
+931D
+9302
+9370
+9357
+93A4
+93C6
+93DE
+93F8
+9431
+9445
+9448
+9592
+F9DC
+FA29
+969D
+96AF
+9733
+973B
+9743
+974D
+974F
+9751
+9755
+9857
+9865
+FA2A
+FA2B
+9927
+FA2C
+999E
+9A4E
+9AD9
+9ADC
+9B75
+9B72
+9B8F
+9BB1
+9BBB
+9C00
+9D70
+9D6B
+FA2D
+9E19
+9ED1
+E000
+E001
+E002
+E003
+E004
+E005
+E006
+E007
+E008
+E009
+E00A
+E00B
+E00C
+E00D
+E00E
+E00F
+E010
+E011
+E012
+E013
+E014
+E015
+E016
+E017
+E018
+E019
+E01A
+E01B
+E01C
+E01D
+E01E
+E01F
+E020
+E021
+E022
+E023
+E024
+E025
+E026
+E027
+E028
+E029
+E02A
+E02B
+E02C
+E02D
+E02E
+E02F
+E030
+E031
+E032
+E033
+E034
+E035
+E036
+E037
+E038
+E039
+E03A
+E03B
+E03C
+E03D
+E03E
+E03F
+E040
+E041
+E042
+E043
+E044
+E045
+E046
+E047
+E048
+E049
+E04A
+E04B
+E04C
+E04D
+E04E
+E04F
+E050
+E051
+E052
+E053
+E054
+E055
+E056
+E057
+E058
+E059
+E05A
+E05B
+E05C
+E05D
+E05E
+E05F
+E060
+E061
+E062
+E063
+E064
+E065
+E066
+E067
+E068
+E069
+E06A
+E06B
+E06C
+E06D
+E06E
+E06F
+E070
+E071
+E072
+E073
+E074
+E075
+E076
+E077
+E078
+E079
+E07A
+E07B
+E07C
+E07D
+E07E
+E07F
+E080
+E081
+E082
+E083
+E084
+E085
+E086
+E087
+E088
+E089
+E08A
+E08B
+E08C
+E08D
+E08E
+E08F
+E090
+E091
+E092
+E093
+E094
+E095
+E096
+E097
+E098
+E099
+E09A
+E09B
+E09C
+E09D
+E09E
+E09F
+E0A0
+E0A1
+E0A2
+E0A3
+E0A4
+E0A5
+E0A6
+E0A7
+E0A8
+E0A9
+E0AA
+E0AB
+E0AC
+E0AD
+E0AE
+E0AF
+E0B0
+E0B1
+E0B2
+E0B3
+E0B4
+E0B5
+E0B6
+E0B7
+E0B8
+E0B9
+E0BA
+E0BB
+E0BC
+E0BD
+E0BE
+E0BF
+E0C0
+E0C1
+E0C2
+E0C3
+E0C4
+E0C5
+E0C6
+E0C7
+E0C8
+E0C9
+E0CA
+E0CB
+E0CC
+E0CD
+E0CE
+E0CF
+E0D0
+E0D1
+E0D2
+E0D3
+E0D4
+E0D5
+E0D6
+E0D7
+E0D8
+E0D9
+E0DA
+E0DB
+E0DC
+E0DD
+E0DE
+E0DF
+E0E0
+E0E1
+E0E2
+E0E3
+E0E4
+E0E5
+E0E6
+E0E7
+E0E8
+E0E9
+E0EA
+E0EB
+E0EC
+E0ED
+E0EE
+E0EF
+E0F0
+E0F1
+E0F2
+E0F3
+E0F4
+E0F5
+E0F6
+E0F7
+E0F8
+E0F9
+E0FA
+E0FB
+E0FC
+E0FD
+E0FE
+E0FF
+E100
+E101
+E102
+E103
+E104
+E105
+E106
+E107
+E108
+E109
+E10A
+E10B
+E10C
+E10D
+E10E
+E10F
+E110
+E111
+E112
+E113
+E114
+E115
+E116
+E117
+E118
+E119
+E11A
+E11B
+E11C
+E11D
+E11E
+E11F
+E120
+E121
+E122
+E123
+E124
+E125
+E126
+E127
+E128
+E129
+E12A
+E12B
+E12C
+E12D
+E12E
+E12F
+E130
+E131
+E132
+E133
+E134
+E135
+E136
+E137
+E138
+E139
+E13A
+E13B
+E13C
+E13D
+E13E
+E13F
+E140
+E141
+E142
+E143
+E144
+E145
+E146
+E147
+E148
+E149
+E14A
+E14B
+E14C
+E14D
+E14E
+E14F
+E150
+E151
+E152
+E153
+E154
+E155
+E156
+E157
+E158
+E159
+E15A
+E15B
+E15C
+E15D
+E15E
+E15F
+E160
+E161
+E162
+E163
+E164
+E165
+E166
+E167
+E168
+E169
+E16A
+E16B
+E16C
+E16D
+E16E
+E16F
+E170
+E171
+E172
+E173
+E174
+E175
+E176
+E177
+E178
+E179
+E17A
+E17B
+E17C
+E17D
+E17E
+E17F
+E180
+E181
+E182
+E183
+E184
+E185
+E186
+E187
+E188
+E189
+E18A
+E18B
+E18C
+E18D
+E18E
+E18F
+E190
+E191
+E192
+E193
+E194
+E195
+E196
+E197
+E198
+E199
+E19A
+E19B
+E19C
+E19D
+E19E
+E19F
+E1A0
+E1A1
+E1A2
+E1A3
+E1A4
+E1A5
+E1A6
+E1A7
+E1A8
+E1A9
+E1AA
+E1AB
+E1AC
+E1AD
+E1AE
+E1AF
+E1B0
+E1B1
+E1B2
+E1B3
+E1B4
+E1B5
+E1B6
+E1B7
+E1B8
+E1B9
+E1BA
+E1BB
+E1BC
+E1BD
+E1BE
+E1BF
+E1C0
+E1C1
+E1C2
+E1C3
+E1C4
+E1C5
+E1C6
+E1C7
+E1C8
+E1C9
+E1CA
+E1CB
+E1CC
+E1CD
+E1CE
+E1CF
+E1D0
+E1D1
+E1D2
+E1D3
+E1D4
+E1D5
+E1D6
+E1D7
+E1D8
+E1D9
+E1DA
+E1DB
+E1DC
+E1DD
+E1DE
+E1DF
+E1E0
+E1E1
+E1E2
+E1E3
+E1E4
+E1E5
+E1E6
+E1E7
+E1E8
+E1E9
+E1EA
+E1EB
+E1EC
+E1ED
+E1EE
+E1EF
+E1F0
+E1F1
+E1F2
+E1F3
+E1F4
+E1F5
+E1F6
+E1F7
+E1F8
+E1F9
+E1FA
+E1FB
+E1FC
+E1FD
+E1FE
+E1FF
+E200
+E201
+E202
+E203
+E204
+E205
+E206
+E207
+E208
+E209
+E20A
+E20B
+E20C
+E20D
+E20E
+E20F
+E210
+E211
+E212
+E213
+E214
+E215
+E216
+E217
+E218
+E219
+E21A
+E21B
+E21C
+E21D
+E21E
+E21F
+E220
+E221
+E222
+E223
+E224
+E225
+E226
+E227
+E228
+E229
+E22A
+E22B
+E22C
+E22D
+E22E
+E22F
+E230
+E231
+E232
+E233
+E234
+E235
+E236
+E237
+E238
+E239
+E23A
+E23B
+E23C
+E23D
+E23E
+E23F
+E240
+E241
+E242
+E243
+E244
+E245
+E246
+E247
+E248
+E249
+E24A
+E24B
+E24C
+E24D
+E24E
+E24F
+E250
+E251
+E252
+E253
+E254
+E255
+E256
+E257
+E258
+E259
+E25A
+E25B
+E25C
+E25D
+E25E
+E25F
+E260
+E261
+E262
+E263
+E264
+E265
+E266
+E267
+E268
+E269
+E26A
+E26B
+E26C
+E26D
+E26E
+E26F
+E270
+E271
+E272
+E273
+E274
+E275
+E276
+E277
+E278
+E279
+E27A
+E27B
+E27C
+E27D
+E27E
+E27F
+E280
+E281
+E282
+E283
+E284
+E285
+E286
+E287
+E288
+E289
+E28A
+E28B
+E28C
+E28D
+E28E
+E28F
+E290
+E291
+E292
+E293
+E294
+E295
+E296
+E297
+E298
+E299
+E29A
+E29B
+E29C
+E29D
+E29E
+E29F
+E2A0
+E2A1
+E2A2
+E2A3
+E2A4
+E2A5
+E2A6
+E2A7
+E2A8
+E2A9
+E2AA
+E2AB
+E2AC
+E2AD
+E2AE
+E2AF
+E2B0
+E2B1
+E2B2
+E2B3
+E2B4
+E2B5
+E2B6
+E2B7
+E2B8
+E2B9
+E2BA
+E2BB
+E2BC
+E2BD
+E2BE
+E2BF
+E2C0
+E2C1
+E2C2
+E2C3
+E2C4
+E2C5
+E2C6
+E2C7
+E2C8
+E2C9
+E2CA
+E2CB
+E2CC
+E2CD
+E2CE
+E2CF
+E2D0
+E2D1
+E2D2
+E2D3
+E2D4
+E2D5
+E2D6
+E2D7
+E2D8
+E2D9
+E2DA
+E2DB
+E2DC
+E2DD
+E2DE
+E2DF
+E2E0
+E2E1
+E2E2
+E2E3
+E2E4
+E2E5
+E2E6
+E2E7
+E2E8
+E2E9
+E2EA
+E2EB
+E2EC
+E2ED
+E2EE
+E2EF
+E2F0
+E2F1
+E2F2
+E2F3
+E2F4
+E2F5
+E2F6
+E2F7
+E2F8
+E2F9
+E2FA
+E2FB
+E2FC
+E2FD
+E2FE
+E2FF
+E300
+E301
+E302
+E303
+E304
+E305
+E306
+E307
+E308
+E309
+E30A
+E30B
+E30C
+E30D
+E30E
+E30F
+E310
+E311
+E312
+E313
+E314
+E315
+E316
+E317
+E318
+E319
+E31A
+E31B
+E31C
+E31D
+E31E
+E31F
+E320
+E321
+E322
+E323
+E324
+E325
+E326
+E327
+E328
+E329
+E32A
+E32B
+E32C
+E32D
+E32E
+E32F
+E330
+E331
+E332
+E333
+E334
+E335
+E336
+E337
+E338
+E339
+E33A
+E33B
+E33C
+E33D
+E33E
+E33F
+E340
+E341
+E342
+E343
+E344
+E345
+E346
+E347
+E348
+E349
+E34A
+E34B
+E34C
+E34D
+E34E
+E34F
+E350
+E351
+E352
+E353
+E354
+E355
+E356
+E357
+E358
+E359
+E35A
+E35B
+E35C
+E35D
+E35E
+E35F
+E360
+E361
+E362
+E363
+E364
+E365
+E366
+E367
+E368
+E369
+E36A
+E36B
+E36C
+E36D
+E36E
+E36F
+E370
+E371
+E372
+E373
+E374
+E375
+E376
+E377
+E378
+E379
+E37A
+E37B
+E37C
+E37D
+E37E
+E37F
+E380
+E381
+E382
+E383
+E384
+E385
+E386
+E387
+E388
+E389
+E38A
+E38B
+E38C
+E38D
+E38E
+E38F
+E390
+E391
+E392
+E393
+E394
+E395
+E396
+E397
+E398
+E399
+E39A
+E39B
+E39C
+E39D
+E39E
+E39F
+E3A0
+E3A1
+E3A2
+E3A3
+E3A4
+E3A5
+E3A6
+E3A7
+E3A8
+E3A9
+E3AA
+E3AB
+E3AC
+E3AD
+E3AE
+E3AF
+E3B0
+E3B1
+E3B2
+E3B3
+E3B4
+E3B5
+E3B6
+E3B7
+E3B8
+E3B9
+E3BA
+E3BB
+E3BC
+E3BD
+E3BE
+E3BF
+E3C0
+E3C1
+E3C2
+E3C3
+E3C4
+E3C5
+E3C6
+E3C7
+E3C8
+E3C9
+E3CA
+E3CB
+E3CC
+E3CD
+E3CE
+E3CF
+E3D0
+E3D1
+E3D2
+E3D3
+E3D4
+E3D5
+E3D6
+E3D7
+E3D8
+E3D9
+E3DA
+E3DB
+E3DC
+E3DD
+E3DE
+E3DF
+E3E0
+E3E1
+E3E2
+E3E3
+E3E4
+E3E5
+E3E6
+E3E7
+E3E8
+E3E9
+E3EA
+E3EB
+E3EC
+E3ED
+E3EE
+E3EF
+E3F0
+E3F1
+E3F2
+E3F3
+E3F4
+E3F5
+E3F6
+E3F7
+E3F8
+E3F9
+E3FA
+E3FB
+E3FC
+E3FD
+E3FE
+E3FF
+E400
+E401
+E402
+E403
+E404
+E405
+E406
+E407
+E408
+E409
+E40A
+E40B
+E40C
+E40D
+E40E
+E40F
+E410
+E411
+E412
+E413
+E414
+E415
+E416
+E417
+E418
+E419
+E41A
+E41B
+E41C
+E41D
+E41E
+E41F
+E420
+E421
+E422
+E423
+E424
+E425
+E426
+E427
+E428
+E429
+E42A
+E42B
+E42C
+E42D
+E42E
+E42F
+E430
+E431
+E432
+E433
+E434
+E435
+E436
+E437
+E438
+E439
+E43A
+E43B
+E43C
+E43D
+E43E
+E43F
+E440
+E441
+E442
+E443
+E444
+E445
+E446
+E447
+E448
+E449
+E44A
+E44B
+E44C
+E44D
+E44E
+E44F
+E450
+E451
+E452
+E453
+E454
+E455
+E456
+E457
+E458
+E459
+E45A
+E45B
+E45C
+E45D
+E45E
+E45F
+E460
+E461
+E462
+E463
+E464
+E465
+E466
+E467
+E468
+E469
+E46A
+E46B
+E46C
+E46D
+E46E
+E46F
+E470
+E471
+E472
+E473
+E474
+E475
+E476
+E477
+E478
+E479
+E47A
+E47B
+E47C
+E47D
+E47E
+E47F
+E480
+E481
+E482
+E483
+E484
+E485
+E486
+E487
+E488
+E489
+E48A
+E48B
+E48C
+E48D
+E48E
+E48F
+E490
+E491
+E492
+E493
+E494
+E495
+E496
+E497
+E498
+E499
+E49A
+E49B
+E49C
+E49D
+E49E
+E49F
+E4A0
+E4A1
+E4A2
+E4A3
+E4A4
+E4A5
+E4A6
+E4A7
+E4A8
+E4A9
+E4AA
+E4AB
+E4AC
+E4AD
+E4AE
+E4AF
+E4B0
+E4B1
+E4B2
+E4B3
+E4B4
+E4B5
+E4B6
+E4B7
+E4B8
+E4B9
+E4BA
+E4BB
+E4BC
+E4BD
+E4BE
+E4BF
+E4C0
+E4C1
+E4C2
+E4C3
+E4C4
+E4C5
+E4C6
+E4C7
+E4C8
+E4C9
+E4CA
+E4CB
+E4CC
+E4CD
+E4CE
+E4CF
+E4D0
+E4D1
+E4D2
+E4D3
+E4D4
+E4D5
+E4D6
+E4D7
+E4D8
+E4D9
+E4DA
+E4DB
+E4DC
+E4DD
+E4DE
+E4DF
+E4E0
+E4E1
+E4E2
+E4E3
+E4E4
+E4E5
+E4E6
+E4E7
+E4E8
+E4E9
+E4EA
+E4EB
+E4EC
+E4ED
+E4EE
+E4EF
+E4F0
+E4F1
+E4F2
+E4F3
+E4F4
+E4F5
+E4F6
+E4F7
+E4F8
+E4F9
+E4FA
+E4FB
+E4FC
+E4FD
+E4FE
+E4FF
+E500
+E501
+E502
+E503
+E504
+E505
+E506
+E507
+E508
+E509
+E50A
+E50B
+E50C
+E50D
+E50E
+E50F
+E510
+E511
+E512
+E513
+E514
+E515
+E516
+E517
+E518
+E519
+E51A
+E51B
+E51C
+E51D
+E51E
+E51F
+E520
+E521
+E522
+E523
+E524
+E525
+E526
+E527
+E528
+E529
+E52A
+E52B
+E52C
+E52D
+E52E
+E52F
+E530
+E531
+E532
+E533
+E534
+E535
+E536
+E537
+E538
+E539
+E53A
+E53B
+E53C
+E53D
+E53E
+E53F
+E540
+E541
+E542
+E543
+E544
+E545
+E546
+E547
+E548
+E549
+E54A
+E54B
+E54C
+E54D
+E54E
+E54F
+E550
+E551
+E552
+E553
+E554
+E555
+E556
+E557
+E558
+E559
+E55A
+E55B
+E55C
+E55D
+E55E
+E55F
+E560
+E561
+E562
+E563
+E564
+E565
+E566
+E567
+E568
+E569
+E56A
+E56B
+E56C
+E56D
+E56E
+E56F
+E570
+E571
+E572
+E573
+E574
+E575
+E576
+E577
+E578
+E579
+E57A
+E57B
+E57C
+E57D
+E57E
+E57F
+E580
+E581
+E582
+E583
+E584
+E585
+E586
+E587
+E588
+E589
+E58A
+E58B
+E58C
+E58D
+E58E
+E58F
+E590
+E591
+E592
+E593
+E594
+E595
+E596
+E597
+E598
+E599
+E59A
+E59B
+E59C
+E59D
+E59E
+E59F
+E5A0
+E5A1
+E5A2
+E5A3
+E5A4
+E5A5
+E5A6
+E5A7
+E5A8
+E5A9
+E5AA
+E5AB
+E5AC
+E5AD
+E5AE
+E5AF
+E5B0
+E5B1
+E5B2
+E5B3
+E5B4
+E5B5
+E5B6
+E5B7
+E5B8
+E5B9
+E5BA
+E5BB
+E5BC
+E5BD
+E5BE
+E5BF
+E5C0
+E5C1
+E5C2
+E5C3
+E5C4
+E5C5
+E5C6
+E5C7
+E5C8
+E5C9
+E5CA
+E5CB
+E5CC
+E5CD
+E5CE
+E5CF
+E5D0
+E5D1
+E5D2
+E5D3
+E5D4
+E5D5
+E5D6
+E5D7
+E5D8
+E5D9
+E5DA
+E5DB
+E5DC
+E5DD
+E5DE
+E5DF
+E5E0
+E5E1
+E5E2
+E5E3
+E5E4
+E5E5
+E5E6
+E5E7
+E5E8
+E5E9
+E5EA
+E5EB
+E5EC
+E5ED
+E5EE
+E5EF
+E5F0
+E5F1
+E5F2
+E5F3
+E5F4
+E5F5
+E5F6
+E5F7
+E5F8
+E5F9
+E5FA
+E5FB
+E5FC
+E5FD
+E5FE
+E5FF
+E600
+E601
+E602
+E603
+E604
+E605
+E606
+E607
+E608
+E609
+E60A
+E60B
+E60C
+E60D
+E60E
+E60F
+E610
+E611
+E612
+E613
+E614
+E615
+E616
+E617
+E618
+E619
+E61A
+E61B
+E61C
+E61D
+E61E
+E61F
+E620
+E621
+E622
+E623
+E624
+E625
+E626
+E627
+E628
+E629
+E62A
+E62B
+E62C
+E62D
+E62E
+E62F
+E630
+E631
+E632
+E633
+E634
+E635
+E636
+E637
+E638
+E639
+E63A
+E63B
+E63C
+E63D
+E63E
+E63F
+E640
+E641
+E642
+E643
+E644
+E645
+E646
+E647
+E648
+E649
+E64A
+E64B
+E64C
+E64D
+E64E
+E64F
+E650
+E651
+E652
+E653
+E654
+E655
+E656
+E657
+E658
+E659
+E65A
+E65B
+E65C
+E65D
+E65E
+E65F
+E660
+E661
+E662
+E663
+E664
+E665
+E666
+E667
+E668
+E669
+E66A
+E66B
+E66C
+E66D
+E66E
+E66F
+E670
+E671
+E672
+E673
+E674
+E675
+E676
+E677
+E678
+E679
+E67A
+E67B
+E67C
+E67D
+E67E
+E67F
+E680
+E681
+E682
+E683
+E684
+E685
+E686
+E687
+E688
+E689
+E68A
+E68B
+E68C
+E68D
+E68E
+E68F
+E690
+E691
+E692
+E693
+E694
+E695
+E696
+E697
+E698
+E699
+E69A
+E69B
+E69C
+E69D
+E69E
+E69F
+E6A0
+E6A1
+E6A2
+E6A3
+E6A4
+E6A5
+E6A6
+E6A7
+E6A8
+E6A9
+E6AA
+E6AB
+E6AC
+E6AD
+E6AE
+E6AF
+E6B0
+E6B1
+E6B2
+E6B3
+E6B4
+E6B5
+E6B6
+E6B7
+E6B8
+E6B9
+E6BA
+E6BB
+E6BC
+E6BD
+E6BE
+E6BF
+E6C0
+E6C1
+E6C2
+E6C3
+E6C4
+E6C5
+E6C6
+E6C7
+E6C8
+E6C9
+E6CA
+E6CB
+E6CC
+E6CD
+E6CE
+E6CF
+E6D0
+E6D1
+E6D2
+E6D3
+E6D4
+E6D5
+E6D6
+E6D7
+E6D8
+E6D9
+E6DA
+E6DB
+E6DC
+E6DD
+E6DE
+E6DF
+E6E0
+E6E1
+E6E2
+E6E3
+E6E4
+E6E5
+E6E6
+E6E7
+E6E8
+E6E9
+E6EA
+E6EB
+E6EC
+E6ED
+E6EE
+E6EF
+E6F0
+E6F1
+E6F2
+E6F3
+E6F4
+E6F5
+E6F6
+E6F7
+E6F8
+E6F9
+E6FA
+E6FB
+E6FC
+E6FD
+E6FE
+E6FF
+E700
+E701
+E702
+E703
+E704
+E705
+E706
+E707
+E708
+E709
+E70A
+E70B
+E70C
+E70D
+E70E
+E70F
+E710
+E711
+E712
+E713
+E714
+E715
+E716
+E717
+E718
+E719
+E71A
+E71B
+E71C
+E71D
+E71E
+E71F
+E720
+E721
+E722
+E723
+E724
+E725
+E726
+E727
+E728
+E729
+E72A
+E72B
+E72C
+E72D
+E72E
+E72F
+E730
+E731
+E732
+E733
+E734
+E735
+E736
+E737
+E738
+E739
+E73A
+E73B
+E73C
+E73D
+E73E
+E73F
+E740
+E741
+E742
+E743
+E744
+E745
+E746
+E747
+E748
+E749
+E74A
+E74B
+E74C
+E74D
+E74E
+E74F
+E750
+E751
+E752
+E753
+E754
+E755
+E756
+E757
+CREATE TABLE t3 SELECT CONVERT(c1 USING cp932) AS c1 FROM t2;
+SELECT HEX(c1) FROM t3;
+HEX(c1)
+05
+7E
+815C
+815F
+8160
+8161
+817C
+8191
+8192
+81CA
+8740
+8741
+8742
+8743
+8744
+8745
+8746
+8747
+8748
+8749
+874A
+874B
+874C
+874D
+874E
+874F
+8750
+8751
+8752
+8753
+8754
+8755
+8756
+8757
+8758
+8759
+875A
+875B
+875C
+875D
+875F
+8760
+8761
+8762
+8763
+8764
+8765
+8766
+8767
+8768
+8769
+876A
+876B
+876C
+876D
+876E
+876F
+8770
+8771
+8772
+8773
+8774
+8775
+877E
+8780
+8781
+8782
+8783
+8784
+8785
+8786
+8787
+8788
+8789
+878A
+878B
+878C
+878D
+878E
+878F
+81E0
+81DF
+81E7
+8793
+8794
+81E3
+81DB
+81DA
+8798
+8799
+81E6
+81BF
+81BE
+FA5C
+FA5D
+FA5E
+FA5F
+FA60
+FA61
+FA62
+FA63
+FA64
+FA65
+FA66
+FA67
+FA68
+FA69
+FA6A
+FA6B
+FA6C
+FA6D
+FA6E
+FA6F
+FA70
+FA71
+FA72
+FA73
+FA74
+FA75
+FA76
+FA77
+FA78
+FA79
+FA7A
+FA7B
+FA7C
+FA7D
+FA7E
+FA80
+FA81
+FA82
+FA83
+FA84
+FA85
+FA86
+FA87
+FA88
+FA89
+FA8A
+FA8B
+FA8C
+FA8D
+FA8E
+FA8F
+FA90
+FA91
+FA92
+FA93
+FA94
+FA95
+FA96
+FA97
+FA98
+FA99
+FA9A
+FA9B
+FA9C
+FA9D
+FA9E
+FA9F
+FAA0
+FAA1
+FAA2
+FAA3
+FAA4
+FAA5
+FAA6
+FAA7
+FAA8
+FAA9
+FAAA
+FAAB
+FAAC
+FAAD
+FAAE
+FAAF
+FAB0
+FAB1
+FAB2
+FAB3
+FAB4
+FAB5
+FAB6
+FAB7
+FAB8
+FAB9
+FABA
+FABB
+FABC
+FABD
+FABE
+FABF
+FAC0
+FAC1
+FAC2
+FAC3
+FAC4
+FAC5
+FAC6
+FAC7
+FAC8
+FAC9
+FACA
+FACB
+FACC
+FACD
+FACE
+FACF
+FAD0
+FAD1
+FAD2
+FAD3
+FAD4
+FAD5
+FAD6
+FAD7
+FAD8
+FAD9
+FADA
+FADB
+FADC
+FADD
+FADE
+FADF
+FAE0
+FAE1
+FAE2
+FAE3
+FAE4
+FAE5
+FAE6
+FAE7
+FAE8
+FAE9
+FAEA
+FAEB
+FAEC
+FAED
+FAEE
+FAEF
+FAF0
+FAF1
+FAF2
+FAF3
+FAF4
+FAF5
+FAF6
+FAF7
+FAF8
+FAF9
+FAFA
+FAFB
+FAFC
+FB40
+FB41
+FB42
+FB43
+FB44
+FB45
+FB46
+FB47
+FB48
+FB49
+FB4A
+FB4B
+FB4C
+FB4D
+FB4E
+FB4F
+FB50
+FB51
+FB52
+FB53
+FB54
+FB55
+FB56
+FB57
+FB58
+FB59
+FB5A
+FB5B
+FB5C
+FB5D
+FB5E
+FB5F
+FB60
+FB61
+FB62
+FB63
+FB64
+FB65
+FB66
+FB67
+FB68
+FB69
+FB6A
+FB6B
+FB6C
+FB6D
+FB6E
+FB6F
+FB70
+FB71
+FB72
+FB73
+FB74
+FB75
+FB76
+FB77
+FB78
+FB79
+FB7A
+FB7B
+FB7C
+FB7D
+FB7E
+FB80
+FB81
+FB82
+FB83
+FB84
+FB85
+FB86
+FB87
+FB88
+FB89
+FB8A
+FB8B
+FB8C
+FB8D
+FB8E
+FB8F
+FB90
+FB91
+FB92
+FB93
+FB94
+FB95
+FB96
+FB97
+FB98
+FB99
+FB9A
+FB9B
+FB9C
+FB9D
+FB9E
+FB9F
+FBA0
+FBA1
+FBA2
+FBA3
+FBA4
+FBA5
+FBA6
+FBA7
+FBA8
+FBA9
+FBAA
+FBAB
+FBAC
+FBAD
+FBAE
+FBAF
+FBB0
+FBB1
+FBB2
+FBB3
+FBB4
+FBB5
+FBB6
+FBB7
+FBB8
+FBB9
+FBBA
+FBBB
+FBBC
+FBBD
+FBBE
+FBBF
+FBC0
+FBC1
+FBC2
+FBC3
+FBC4
+FBC5
+FBC6
+FBC7
+FBC8
+FBC9
+FBCA
+FBCB
+FBCC
+FBCD
+FBCE
+FBCF
+FBD0
+FBD1
+FBD2
+FBD3
+FBD4
+FBD5
+FBD6
+FBD7
+FBD8
+FBD9
+FBDA
+FBDB
+FBDC
+FBDD
+FBDE
+FBDF
+FBE0
+FBE1
+FBE2
+FBE3
+FBE4
+FBE5
+FBE6
+FBE7
+FBE8
+FBE9
+FBEA
+FBEB
+FBEC
+FBED
+FBEE
+FBEF
+FBF0
+FBF1
+FBF2
+FBF3
+FBF4
+FBF5
+FBF6
+FBF7
+FBF8
+FBF9
+FBFA
+FBFB
+FBFC
+FC40
+FC41
+FC42
+FC43
+FC44
+FC45
+FC46
+FC47
+FC48
+FC49
+FC4A
+FC4B
+FA40
+FA41
+FA42
+FA43
+FA44
+FA45
+FA46
+FA47
+FA48
+FA49
+81CA
+FA55
+FA56
+FA57
+FA40
+FA41
+FA42
+FA43
+FA44
+FA45
+FA46
+FA47
+FA48
+FA49
+8754
+8755
+8756
+8757
+8758
+8759
+875A
+875B
+875C
+875D
+81CA
+FA55
+FA56
+FA57
+878A
+8782
+8784
+81E6
+FA5C
+FA5D
+FA5E
+FA5F
+FA60
+FA61
+FA62
+FA63
+FA64
+FA65
+FA66
+FA67
+FA68
+FA69
+FA6A
+FA6B
+FA6C
+FA6D
+FA6E
+FA6F
+FA70
+FA71
+FA72
+FA73
+FA74
+FA75
+FA76
+FA77
+FA78
+FA79
+FA7A
+FA7B
+FA7C
+FA7D
+FA7E
+FA80
+FA81
+FA82
+FA83
+FA84
+FA85
+FA86
+FA87
+FA88
+FA89
+FA8A
+FA8B
+FA8C
+FA8D
+FA8E
+FA8F
+FA90
+FA91
+FA92
+FA93
+FA94
+FA95
+FA96
+FA97
+FA98
+FA99
+FA9A
+FA9B
+FA9C
+FA9D
+FA9E
+FA9F
+FAA0
+FAA1
+FAA2
+FAA3
+FAA4
+FAA5
+FAA6
+FAA7
+FAA8
+FAA9
+FAAA
+FAAB
+FAAC
+FAAD
+FAAE
+FAAF
+FAB0
+FAB1
+FAB2
+FAB3
+FAB4
+FAB5
+FAB6
+FAB7
+FAB8
+FAB9
+FABA
+FABB
+FABC
+FABD
+FABE
+FABF
+FAC0
+FAC1
+FAC2
+FAC3
+FAC4
+FAC5
+FAC6
+FAC7
+FAC8
+FAC9
+FACA
+FACB
+FACC
+FACD
+FACE
+FACF
+FAD0
+FAD1
+FAD2
+FAD3
+FAD4
+FAD5
+FAD6
+FAD7
+FAD8
+FAD9
+FADA
+FADB
+FADC
+FADD
+FADE
+FADF
+FAE0
+FAE1
+FAE2
+FAE3
+FAE4
+FAE5
+FAE6
+FAE7
+FAE8
+FAE9
+FAEA
+FAEB
+FAEC
+FAED
+FAEE
+FAEF
+FAF0
+FAF1
+FAF2
+FAF3
+FAF4
+FAF5
+FAF6
+FAF7
+FAF8
+FAF9
+FAFA
+FAFB
+FAFC
+FB40
+FB41
+FB42
+FB43
+FB44
+FB45
+FB46
+FB47
+FB48
+FB49
+FB4A
+FB4B
+FB4C
+FB4D
+FB4E
+FB4F
+FB50
+FB51
+FB52
+FB53
+FB54
+FB55
+FB56
+FB57
+FB58
+FB59
+FB5A
+FB5B
+FB5C
+FB5D
+FB5E
+FB5F
+FB60
+FB61
+FB62
+FB63
+FB64
+FB65
+FB66
+FB67
+FB68
+FB69
+FB6A
+FB6B
+FB6C
+FB6D
+FB6E
+FB6F
+FB70
+FB71
+FB72
+FB73
+FB74
+FB75
+FB76
+FB77
+FB78
+FB79
+FB7A
+FB7B
+FB7C
+FB7D
+FB7E
+FB80
+FB81
+FB82
+FB83
+FB84
+FB85
+FB86
+FB87
+FB88
+FB89
+FB8A
+FB8B
+FB8C
+FB8D
+FB8E
+FB8F
+FB90
+FB91
+FB92
+FB93
+FB94
+FB95
+FB96
+FB97
+FB98
+FB99
+FB9A
+FB9B
+FB9C
+FB9D
+FB9E
+FB9F
+FBA0
+FBA1
+FBA2
+FBA3
+FBA4
+FBA5
+FBA6
+FBA7
+FBA8
+FBA9
+FBAA
+FBAB
+FBAC
+FBAD
+FBAE
+FBAF
+FBB0
+FBB1
+FBB2
+FBB3
+FBB4
+FBB5
+FBB6
+FBB7
+FBB8
+FBB9
+FBBA
+FBBB
+FBBC
+FBBD
+FBBE
+FBBF
+FBC0
+FBC1
+FBC2
+FBC3
+FBC4
+FBC5
+FBC6
+FBC7
+FBC8
+FBC9
+FBCA
+FBCB
+FBCC
+FBCD
+FBCE
+FBCF
+FBD0
+FBD1
+FBD2
+FBD3
+FBD4
+FBD5
+FBD6
+FBD7
+FBD8
+FBD9
+FBDA
+FBDB
+FBDC
+FBDD
+FBDE
+FBDF
+FBE0
+FBE1
+FBE2
+FBE3
+FBE4
+FBE5
+FBE6
+FBE7
+FBE8
+FBE9
+FBEA
+FBEB
+FBEC
+FBED
+FBEE
+FBEF
+FBF0
+FBF1
+FBF2
+FBF3
+FBF4
+FBF5
+FBF6
+FBF7
+FBF8
+FBF9
+FBFA
+FBFB
+FBFC
+FC40
+FC41
+FC42
+FC43
+FC44
+FC45
+FC46
+FC47
+FC48
+FC49
+FC4A
+FC4B
+F040
+F041
+F042
+F043
+F044
+F045
+F046
+F047
+F048
+F049
+F04A
+F04B
+F04C
+F04D
+F04E
+F04F
+F050
+F051
+F052
+F053
+F054
+F055
+F056
+F057
+F058
+F059
+F05A
+F05B
+F05C
+F05D
+F05E
+F05F
+F060
+F061
+F062
+F063
+F064
+F065
+F066
+F067
+F068
+F069
+F06A
+F06B
+F06C
+F06D
+F06E
+F06F
+F070
+F071
+F072
+F073
+F074
+F075
+F076
+F077
+F078
+F079
+F07A
+F07B
+F07C
+F07D
+F07E
+F080
+F081
+F082
+F083
+F084
+F085
+F086
+F087
+F088
+F089
+F08A
+F08B
+F08C
+F08D
+F08E
+F08F
+F090
+F091
+F092
+F093
+F094
+F095
+F096
+F097
+F098
+F099
+F09A
+F09B
+F09C
+F09D
+F09E
+F09F
+F0A0
+F0A1
+F0A2
+F0A3
+F0A4
+F0A5
+F0A6
+F0A7
+F0A8
+F0A9
+F0AA
+F0AB
+F0AC
+F0AD
+F0AE
+F0AF
+F0B0
+F0B1
+F0B2
+F0B3
+F0B4
+F0B5
+F0B6
+F0B7
+F0B8
+F0B9
+F0BA
+F0BB
+F0BC
+F0BD
+F0BE
+F0BF
+F0C0
+F0C1
+F0C2
+F0C3
+F0C4
+F0C5
+F0C6
+F0C7
+F0C8
+F0C9
+F0CA
+F0CB
+F0CC
+F0CD
+F0CE
+F0CF
+F0D0
+F0D1
+F0D2
+F0D3
+F0D4
+F0D5
+F0D6
+F0D7
+F0D8
+F0D9
+F0DA
+F0DB
+F0DC
+F0DD
+F0DE
+F0DF
+F0E0
+F0E1
+F0E2
+F0E3
+F0E4
+F0E5
+F0E6
+F0E7
+F0E8
+F0E9
+F0EA
+F0EB
+F0EC
+F0ED
+F0EE
+F0EF
+F0F0
+F0F1
+F0F2
+F0F3
+F0F4
+F0F5
+F0F6
+F0F7
+F0F8
+F0F9
+F0FA
+F0FB
+F0FC
+F140
+F141
+F142
+F143
+F144
+F145
+F146
+F147
+F148
+F149
+F14A
+F14B
+F14C
+F14D
+F14E
+F14F
+F150
+F151
+F152
+F153
+F154
+F155
+F156
+F157
+F158
+F159
+F15A
+F15B
+F15C
+F15D
+F15E
+F15F
+F160
+F161
+F162
+F163
+F164
+F165
+F166
+F167
+F168
+F169
+F16A
+F16B
+F16C
+F16D
+F16E
+F16F
+F170
+F171
+F172
+F173
+F174
+F175
+F176
+F177
+F178
+F179
+F17A
+F17B
+F17C
+F17D
+F17E
+F180
+F181
+F182
+F183
+F184
+F185
+F186
+F187
+F188
+F189
+F18A
+F18B
+F18C
+F18D
+F18E
+F18F
+F190
+F191
+F192
+F193
+F194
+F195
+F196
+F197
+F198
+F199
+F19A
+F19B
+F19C
+F19D
+F19E
+F19F
+F1A0
+F1A1
+F1A2
+F1A3
+F1A4
+F1A5
+F1A6
+F1A7
+F1A8
+F1A9
+F1AA
+F1AB
+F1AC
+F1AD
+F1AE
+F1AF
+F1B0
+F1B1
+F1B2
+F1B3
+F1B4
+F1B5
+F1B6
+F1B7
+F1B8
+F1B9
+F1BA
+F1BB
+F1BC
+F1BD
+F1BE
+F1BF
+F1C0
+F1C1
+F1C2
+F1C3
+F1C4
+F1C5
+F1C6
+F1C7
+F1C8
+F1C9
+F1CA
+F1CB
+F1CC
+F1CD
+F1CE
+F1CF
+F1D0
+F1D1
+F1D2
+F1D3
+F1D4
+F1D5
+F1D6
+F1D7
+F1D8
+F1D9
+F1DA
+F1DB
+F1DC
+F1DD
+F1DE
+F1DF
+F1E0
+F1E1
+F1E2
+F1E3
+F1E4
+F1E5
+F1E6
+F1E7
+F1E8
+F1E9
+F1EA
+F1EB
+F1EC
+F1ED
+F1EE
+F1EF
+F1F0
+F1F1
+F1F2
+F1F3
+F1F4
+F1F5
+F1F6
+F1F7
+F1F8
+F1F9
+F1FA
+F1FB
+F1FC
+F240
+F241
+F242
+F243
+F244
+F245
+F246
+F247
+F248
+F249
+F24A
+F24B
+F24C
+F24D
+F24E
+F24F
+F250
+F251
+F252
+F253
+F254
+F255
+F256
+F257
+F258
+F259
+F25A
+F25B
+F25C
+F25D
+F25E
+F25F
+F260
+F261
+F262
+F263
+F264
+F265
+F266
+F267
+F268
+F269
+F26A
+F26B
+F26C
+F26D
+F26E
+F26F
+F270
+F271
+F272
+F273
+F274
+F275
+F276
+F277
+F278
+F279
+F27A
+F27B
+F27C
+F27D
+F27E
+F280
+F281
+F282
+F283
+F284
+F285
+F286
+F287
+F288
+F289
+F28A
+F28B
+F28C
+F28D
+F28E
+F28F
+F290
+F291
+F292
+F293
+F294
+F295
+F296
+F297
+F298
+F299
+F29A
+F29B
+F29C
+F29D
+F29E
+F29F
+F2A0
+F2A1
+F2A2
+F2A3
+F2A4
+F2A5
+F2A6
+F2A7
+F2A8
+F2A9
+F2AA
+F2AB
+F2AC
+F2AD
+F2AE
+F2AF
+F2B0
+F2B1
+F2B2
+F2B3
+F2B4
+F2B5
+F2B6
+F2B7
+F2B8
+F2B9
+F2BA
+F2BB
+F2BC
+F2BD
+F2BE
+F2BF
+F2C0
+F2C1
+F2C2
+F2C3
+F2C4
+F2C5
+F2C6
+F2C7
+F2C8
+F2C9
+F2CA
+F2CB
+F2CC
+F2CD
+F2CE
+F2CF
+F2D0
+F2D1
+F2D2
+F2D3
+F2D4
+F2D5
+F2D6
+F2D7
+F2D8
+F2D9
+F2DA
+F2DB
+F2DC
+F2DD
+F2DE
+F2DF
+F2E0
+F2E1
+F2E2
+F2E3
+F2E4
+F2E5
+F2E6
+F2E7
+F2E8
+F2E9
+F2EA
+F2EB
+F2EC
+F2ED
+F2EE
+F2EF
+F2F0
+F2F1
+F2F2
+F2F3
+F2F4
+F2F5
+F2F6
+F2F7
+F2F8
+F2F9
+F2FA
+F2FB
+F2FC
+F340
+F341
+F342
+F343
+F344
+F345
+F346
+F347
+F348
+F349
+F34A
+F34B
+F34C
+F34D
+F34E
+F34F
+F350
+F351
+F352
+F353
+F354
+F355
+F356
+F357
+F358
+F359
+F35A
+F35B
+F35C
+F35D
+F35E
+F35F
+F360
+F361
+F362
+F363
+F364
+F365
+F366
+F367
+F368
+F369
+F36A
+F36B
+F36C
+F36D
+F36E
+F36F
+F370
+F371
+F372
+F373
+F374
+F375
+F376
+F377
+F378
+F379
+F37A
+F37B
+F37C
+F37D
+F37E
+F380
+F381
+F382
+F383
+F384
+F385
+F386
+F387
+F388
+F389
+F38A
+F38B
+F38C
+F38D
+F38E
+F38F
+F390
+F391
+F392
+F393
+F394
+F395
+F396
+F397
+F398
+F399
+F39A
+F39B
+F39C
+F39D
+F39E
+F39F
+F3A0
+F3A1
+F3A2
+F3A3
+F3A4
+F3A5
+F3A6
+F3A7
+F3A8
+F3A9
+F3AA
+F3AB
+F3AC
+F3AD
+F3AE
+F3AF
+F3B0
+F3B1
+F3B2
+F3B3
+F3B4
+F3B5
+F3B6
+F3B7
+F3B8
+F3B9
+F3BA
+F3BB
+F3BC
+F3BD
+F3BE
+F3BF
+F3C0
+F3C1
+F3C2
+F3C3
+F3C4
+F3C5
+F3C6
+F3C7
+F3C8
+F3C9
+F3CA
+F3CB
+F3CC
+F3CD
+F3CE
+F3CF
+F3D0
+F3D1
+F3D2
+F3D3
+F3D4
+F3D5
+F3D6
+F3D7
+F3D8
+F3D9
+F3DA
+F3DB
+F3DC
+F3DD
+F3DE
+F3DF
+F3E0
+F3E1
+F3E2
+F3E3
+F3E4
+F3E5
+F3E6
+F3E7
+F3E8
+F3E9
+F3EA
+F3EB
+F3EC
+F3ED
+F3EE
+F3EF
+F3F0
+F3F1
+F3F2
+F3F3
+F3F4
+F3F5
+F3F6
+F3F7
+F3F8
+F3F9
+F3FA
+F3FB
+F3FC
+F440
+F441
+F442
+F443
+F444
+F445
+F446
+F447
+F448
+F449
+F44A
+F44B
+F44C
+F44D
+F44E
+F44F
+F450
+F451
+F452
+F453
+F454
+F455
+F456
+F457
+F458
+F459
+F45A
+F45B
+F45C
+F45D
+F45E
+F45F
+F460
+F461
+F462
+F463
+F464
+F465
+F466
+F467
+F468
+F469
+F46A
+F46B
+F46C
+F46D
+F46E
+F46F
+F470
+F471
+F472
+F473
+F474
+F475
+F476
+F477
+F478
+F479
+F47A
+F47B
+F47C
+F47D
+F47E
+F480
+F481
+F482
+F483
+F484
+F485
+F486
+F487
+F488
+F489
+F48A
+F48B
+F48C
+F48D
+F48E
+F48F
+F490
+F491
+F492
+F493
+F494
+F495
+F496
+F497
+F498
+F499
+F49A
+F49B
+F49C
+F49D
+F49E
+F49F
+F4A0
+F4A1
+F4A2
+F4A3
+F4A4
+F4A5
+F4A6
+F4A7
+F4A8
+F4A9
+F4AA
+F4AB
+F4AC
+F4AD
+F4AE
+F4AF
+F4B0
+F4B1
+F4B2
+F4B3
+F4B4
+F4B5
+F4B6
+F4B7
+F4B8
+F4B9
+F4BA
+F4BB
+F4BC
+F4BD
+F4BE
+F4BF
+F4C0
+F4C1
+F4C2
+F4C3
+F4C4
+F4C5
+F4C6
+F4C7
+F4C8
+F4C9
+F4CA
+F4CB
+F4CC
+F4CD
+F4CE
+F4CF
+F4D0
+F4D1
+F4D2
+F4D3
+F4D4
+F4D5
+F4D6
+F4D7
+F4D8
+F4D9
+F4DA
+F4DB
+F4DC
+F4DD
+F4DE
+F4DF
+F4E0
+F4E1
+F4E2
+F4E3
+F4E4
+F4E5
+F4E6
+F4E7
+F4E8
+F4E9
+F4EA
+F4EB
+F4EC
+F4ED
+F4EE
+F4EF
+F4F0
+F4F1
+F4F2
+F4F3
+F4F4
+F4F5
+F4F6
+F4F7
+F4F8
+F4F9
+F4FA
+F4FB
+F4FC
+F540
+F541
+F542
+F543
+F544
+F545
+F546
+F547
+F548
+F549
+F54A
+F54B
+F54C
+F54D
+F54E
+F54F
+F550
+F551
+F552
+F553
+F554
+F555
+F556
+F557
+F558
+F559
+F55A
+F55B
+F55C
+F55D
+F55E
+F55F
+F560
+F561
+F562
+F563
+F564
+F565
+F566
+F567
+F568
+F569
+F56A
+F56B
+F56C
+F56D
+F56E
+F56F
+F570
+F571
+F572
+F573
+F574
+F575
+F576
+F577
+F578
+F579
+F57A
+F57B
+F57C
+F57D
+F57E
+F580
+F581
+F582
+F583
+F584
+F585
+F586
+F587
+F588
+F589
+F58A
+F58B
+F58C
+F58D
+F58E
+F58F
+F590
+F591
+F592
+F593
+F594
+F595
+F596
+F597
+F598
+F599
+F59A
+F59B
+F59C
+F59D
+F59E
+F59F
+F5A0
+F5A1
+F5A2
+F5A3
+F5A4
+F5A5
+F5A6
+F5A7
+F5A8
+F5A9
+F5AA
+F5AB
+F5AC
+F5AD
+F5AE
+F5AF
+F5B0
+F5B1
+F5B2
+F5B3
+F5B4
+F5B5
+F5B6
+F5B7
+F5B8
+F5B9
+F5BA
+F5BB
+F5BC
+F5BD
+F5BE
+F5BF
+F5C0
+F5C1
+F5C2
+F5C3
+F5C4
+F5C5
+F5C6
+F5C7
+F5C8
+F5C9
+F5CA
+F5CB
+F5CC
+F5CD
+F5CE
+F5CF
+F5D0
+F5D1
+F5D2
+F5D3
+F5D4
+F5D5
+F5D6
+F5D7
+F5D8
+F5D9
+F5DA
+F5DB
+F5DC
+F5DD
+F5DE
+F5DF
+F5E0
+F5E1
+F5E2
+F5E3
+F5E4
+F5E5
+F5E6
+F5E7
+F5E8
+F5E9
+F5EA
+F5EB
+F5EC
+F5ED
+F5EE
+F5EF
+F5F0
+F5F1
+F5F2
+F5F3
+F5F4
+F5F5
+F5F6
+F5F7
+F5F8
+F5F9
+F5FA
+F5FB
+F5FC
+F640
+F641
+F642
+F643
+F644
+F645
+F646
+F647
+F648
+F649
+F64A
+F64B
+F64C
+F64D
+F64E
+F64F
+F650
+F651
+F652
+F653
+F654
+F655
+F656
+F657
+F658
+F659
+F65A
+F65B
+F65C
+F65D
+F65E
+F65F
+F660
+F661
+F662
+F663
+F664
+F665
+F666
+F667
+F668
+F669
+F66A
+F66B
+F66C
+F66D
+F66E
+F66F
+F670
+F671
+F672
+F673
+F674
+F675
+F676
+F677
+F678
+F679
+F67A
+F67B
+F67C
+F67D
+F67E
+F680
+F681
+F682
+F683
+F684
+F685
+F686
+F687
+F688
+F689
+F68A
+F68B
+F68C
+F68D
+F68E
+F68F
+F690
+F691
+F692
+F693
+F694
+F695
+F696
+F697
+F698
+F699
+F69A
+F69B
+F69C
+F69D
+F69E
+F69F
+F6A0
+F6A1
+F6A2
+F6A3
+F6A4
+F6A5
+F6A6
+F6A7
+F6A8
+F6A9
+F6AA
+F6AB
+F6AC
+F6AD
+F6AE
+F6AF
+F6B0
+F6B1
+F6B2
+F6B3
+F6B4
+F6B5
+F6B6
+F6B7
+F6B8
+F6B9
+F6BA
+F6BB
+F6BC
+F6BD
+F6BE
+F6BF
+F6C0
+F6C1
+F6C2
+F6C3
+F6C4
+F6C5
+F6C6
+F6C7
+F6C8
+F6C9
+F6CA
+F6CB
+F6CC
+F6CD
+F6CE
+F6CF
+F6D0
+F6D1
+F6D2
+F6D3
+F6D4
+F6D5
+F6D6
+F6D7
+F6D8
+F6D9
+F6DA
+F6DB
+F6DC
+F6DD
+F6DE
+F6DF
+F6E0
+F6E1
+F6E2
+F6E3
+F6E4
+F6E5
+F6E6
+F6E7
+F6E8
+F6E9
+F6EA
+F6EB
+F6EC
+F6ED
+F6EE
+F6EF
+F6F0
+F6F1
+F6F2
+F6F3
+F6F4
+F6F5
+F6F6
+F6F7
+F6F8
+F6F9
+F6FA
+F6FB
+F6FC
+F740
+F741
+F742
+F743
+F744
+F745
+F746
+F747
+F748
+F749
+F74A
+F74B
+F74C
+F74D
+F74E
+F74F
+F750
+F751
+F752
+F753
+F754
+F755
+F756
+F757
+F758
+F759
+F75A
+F75B
+F75C
+F75D
+F75E
+F75F
+F760
+F761
+F762
+F763
+F764
+F765
+F766
+F767
+F768
+F769
+F76A
+F76B
+F76C
+F76D
+F76E
+F76F
+F770
+F771
+F772
+F773
+F774
+F775
+F776
+F777
+F778
+F779
+F77A
+F77B
+F77C
+F77D
+F77E
+F780
+F781
+F782
+F783
+F784
+F785
+F786
+F787
+F788
+F789
+F78A
+F78B
+F78C
+F78D
+F78E
+F78F
+F790
+F791
+F792
+F793
+F794
+F795
+F796
+F797
+F798
+F799
+F79A
+F79B
+F79C
+F79D
+F79E
+F79F
+F7A0
+F7A1
+F7A2
+F7A3
+F7A4
+F7A5
+F7A6
+F7A7
+F7A8
+F7A9
+F7AA
+F7AB
+F7AC
+F7AD
+F7AE
+F7AF
+F7B0
+F7B1
+F7B2
+F7B3
+F7B4
+F7B5
+F7B6
+F7B7
+F7B8
+F7B9
+F7BA
+F7BB
+F7BC
+F7BD
+F7BE
+F7BF
+F7C0
+F7C1
+F7C2
+F7C3
+F7C4
+F7C5
+F7C6
+F7C7
+F7C8
+F7C9
+F7CA
+F7CB
+F7CC
+F7CD
+F7CE
+F7CF
+F7D0
+F7D1
+F7D2
+F7D3
+F7D4
+F7D5
+F7D6
+F7D7
+F7D8
+F7D9
+F7DA
+F7DB
+F7DC
+F7DD
+F7DE
+F7DF
+F7E0
+F7E1
+F7E2
+F7E3
+F7E4
+F7E5
+F7E6
+F7E7
+F7E8
+F7E9
+F7EA
+F7EB
+F7EC
+F7ED
+F7EE
+F7EF
+F7F0
+F7F1
+F7F2
+F7F3
+F7F4
+F7F5
+F7F6
+F7F7
+F7F8
+F7F9
+F7FA
+F7FB
+F7FC
+F840
+F841
+F842
+F843
+F844
+F845
+F846
+F847
+F848
+F849
+F84A
+F84B
+F84C
+F84D
+F84E
+F84F
+F850
+F851
+F852
+F853
+F854
+F855
+F856
+F857
+F858
+F859
+F85A
+F85B
+F85C
+F85D
+F85E
+F85F
+F860
+F861
+F862
+F863
+F864
+F865
+F866
+F867
+F868
+F869
+F86A
+F86B
+F86C
+F86D
+F86E
+F86F
+F870
+F871
+F872
+F873
+F874
+F875
+F876
+F877
+F878
+F879
+F87A
+F87B
+F87C
+F87D
+F87E
+F880
+F881
+F882
+F883
+F884
+F885
+F886
+F887
+F888
+F889
+F88A
+F88B
+F88C
+F88D
+F88E
+F88F
+F890
+F891
+F892
+F893
+F894
+F895
+F896
+F897
+F898
+F899
+F89A
+F89B
+F89C
+F89D
+F89E
+F89F
+F8A0
+F8A1
+F8A2
+F8A3
+F8A4
+F8A5
+F8A6
+F8A7
+F8A8
+F8A9
+F8AA
+F8AB
+F8AC
+F8AD
+F8AE
+F8AF
+F8B0
+F8B1
+F8B2
+F8B3
+F8B4
+F8B5
+F8B6
+F8B7
+F8B8
+F8B9
+F8BA
+F8BB
+F8BC
+F8BD
+F8BE
+F8BF
+F8C0
+F8C1
+F8C2
+F8C3
+F8C4
+F8C5
+F8C6
+F8C7
+F8C8
+F8C9
+F8CA
+F8CB
+F8CC
+F8CD
+F8CE
+F8CF
+F8D0
+F8D1
+F8D2
+F8D3
+F8D4
+F8D5
+F8D6
+F8D7
+F8D8
+F8D9
+F8DA
+F8DB
+F8DC
+F8DD
+F8DE
+F8DF
+F8E0
+F8E1
+F8E2
+F8E3
+F8E4
+F8E5
+F8E6
+F8E7
+F8E8
+F8E9
+F8EA
+F8EB
+F8EC
+F8ED
+F8EE
+F8EF
+F8F0
+F8F1
+F8F2
+F8F3
+F8F4
+F8F5
+F8F6
+F8F7
+F8F8
+F8F9
+F8FA
+F8FB
+F8FC
+F940
+F941
+F942
+F943
+F944
+F945
+F946
+F947
+F948
+F949
+F94A
+F94B
+F94C
+F94D
+F94E
+F94F
+F950
+F951
+F952
+F953
+F954
+F955
+F956
+F957
+F958
+F959
+F95A
+F95B
+F95C
+F95D
+F95E
+F95F
+F960
+F961
+F962
+F963
+F964
+F965
+F966
+F967
+F968
+F969
+F96A
+F96B
+F96C
+F96D
+F96E
+F96F
+F970
+F971
+F972
+F973
+F974
+F975
+F976
+F977
+F978
+F979
+F97A
+F97B
+F97C
+F97D
+F97E
+F980
+F981
+F982
+F983
+F984
+F985
+F986
+F987
+F988
+F989
+F98A
+F98B
+F98C
+F98D
+F98E
+F98F
+F990
+F991
+F992
+F993
+F994
+F995
+F996
+F997
+F998
+F999
+F99A
+F99B
+F99C
+F99D
+F99E
+F99F
+F9A0
+F9A1
+F9A2
+F9A3
+F9A4
+F9A5
+F9A6
+F9A7
+F9A8
+F9A9
+F9AA
+F9AB
+F9AC
+F9AD
+F9AE
+F9AF
+F9B0
+F9B1
+F9B2
+F9B3
+F9B4
+F9B5
+F9B6
+F9B7
+F9B8
+F9B9
+F9BA
+F9BB
+F9BC
+F9BD
+F9BE
+F9BF
+F9C0
+F9C1
+F9C2
+F9C3
+F9C4
+F9C5
+F9C6
+F9C7
+F9C8
+F9C9
+F9CA
+F9CB
+F9CC
+F9CD
+F9CE
+F9CF
+F9D0
+F9D1
+F9D2
+F9D3
+F9D4
+F9D5
+F9D6
+F9D7
+F9D8
+F9D9
+F9DA
+F9DB
+F9DC
+F9DD
+F9DE
+F9DF
+F9E0
+F9E1
+F9E2
+F9E3
+F9E4
+F9E5
+F9E6
+F9E7
+F9E8
+F9E9
+F9EA
+F9EB
+F9EC
+F9ED
+F9EE
+F9EF
+F9F0
+F9F1
+F9F2
+F9F3
+F9F4
+F9F5
+F9F6
+F9F7
+F9F8
+F9F9
+F9FA
+F9FB
+F9FC
+CREATE TABLE t4 SELECT CONVERT(c1 USING eucjpms) AS c1 FROM t1;
+SELECT HEX(c1) FROM t4;
+HEX(c1)
+05
+7E
+A1BD
+A1C0
+A1C1
+A1C2
+A1DD
+A1F1
+A1F2
+A2CC
+ADA1
+ADA2
+ADA3
+ADA4
+ADA5
+ADA6
+ADA7
+ADA8
+ADA9
+ADAA
+ADAB
+ADAC
+ADAD
+ADAE
+ADAF
+ADB0
+ADB1
+ADB2
+ADB3
+ADB4
+ADB5
+ADB6
+ADB7
+ADB8
+ADB9
+ADBA
+ADBB
+ADBC
+ADBD
+ADBE
+ADC0
+ADC1
+ADC2
+ADC3
+ADC4
+ADC5
+ADC6
+ADC7
+ADC8
+ADC9
+ADCA
+ADCB
+ADCC
+ADCD
+ADCE
+ADCF
+ADD0
+ADD1
+ADD2
+ADD3
+ADD4
+ADD5
+ADD6
+ADDF
+ADE0
+ADE1
+ADE2
+ADE3
+ADE4
+ADE5
+ADE6
+ADE7
+ADE8
+ADE9
+ADEA
+ADEB
+ADEC
+ADED
+ADEE
+ADEF
+A2E2
+A2E1
+A2E9
+ADF3
+ADF4
+A2E5
+A2DD
+A2DC
+ADF8
+ADF9
+A2E8
+A2C1
+A2C0
+8FD4E3
+8FDCDF
+8FE4E9
+8FE3F8
+8FD9A1
+8FB1BB
+8FF4AE
+8FC2AD
+8FC3FC
+8FE4D0
+8FC2BF
+8FBCF4
+8FB0A9
+8FB0C8
+8FF4AF
+8FB0D2
+8FB0D4
+8FB0E3
+8FB0EE
+8FB1A7
+8FB1A3
+8FB1AC
+8FB1A9
+8FB1BE
+8FB1DF
+8FB1D8
+8FB1C8
+8FB1D7
+8FB1E3
+8FB1F4
+8FB1E1
+8FB2A3
+8FF4B0
+8FB2BB
+8FB2E6
+8FB2ED
+8FB2F5
+8FB2FC
+8FF4B1
+8FB3B5
+8FB3D8
+8FB3DB
+8FB3E5
+8FB3EE
+8FB3FB
+8FF4B2
+8FF4B3
+8FB4C0
+8FB4C7
+8FB4D0
+8FB4DE
+8FF4B4
+8FB5AA
+8FF4B5
+8FB5AF
+8FB5C4
+8FB5E8
+8FF4B6
+8FB7C2
+8FB7E4
+8FB7E8
+8FB7E7
+8FF4B7
+8FF4B8
+8FF4B9
+8FB8CE
+8FB8E1
+8FB8F5
+8FB8F7
+8FB8F8
+8FB8FC
+8FB9AF
+8FB9B7
+8FBABE
+8FBADB
+8FCDAA
+8FBAE1
+8FF4BA
+8FBAEB
+8FBBB3
+8FBBB8
+8FF4BB
+8FBBCA
+8FF4BC
+8FF4BD
+8FBBD0
+8FBBDE
+8FBBF4
+8FBBF5
+8FBBF9
+8FBCE4
+8FBCED
+8FBCFE
+8FF4BE
+8FBDC2
+8FBDE7
+8FF4BF
+8FBDF0
+8FBEB0
+8FBEAC
+8FF4C0
+8FBEB3
+8FBEBD
+8FBECD
+8FBEC9
+8FBEE4
+8FBFA8
+8FBFC9
+8FC0C4
+8FC0E4
+8FC0F4
+8FC1A6
+8FF4C1
+8FC1F5
+8FC1FC
+8FF4C2
+8FC1F8
+8FC2AB
+8FC2A1
+8FC2A5
+8FF4C3
+8FC2B8
+8FC2BA
+8FF4C4
+8FC2C4
+8FC2D2
+8FC2D7
+8FC2DB
+8FC2DE
+8FC2ED
+8FC2F0
+8FF4C5
+8FC3A1
+8FC3B5
+8FC3C9
+8FC3B9
+8FF4C6
+8FC3D8
+8FC3FE
+8FF4C7
+8FC4CC
+8FF4C8
+8FC4D9
+8FC4EA
+8FC4FD
+8FF4C9
+8FC5A7
+8FC5B5
+8FC5B6
+8FF4CA
+8FC5D5
+8FC6B8
+8FC6D7
+8FC6E0
+8FC6EA
+8FC6E3
+8FC7A1
+8FC7AB
+8FC7C7
+8FC7C3
+8FC7CB
+8FC7CF
+8FC7D9
+8FF4CB
+8FF4CC
+8FC7E6
+8FC7EE
+8FC7FC
+8FC7EB
+8FC7F0
+8FC8B1
+8FC8E5
+8FC8F8
+8FC9A6
+8FC9AB
+8FC9AD
+8FF4CD
+8FC9CA
+8FC9D3
+8FC9E9
+8FC9E3
+8FC9FC
+8FC9F4
+8FC9F5
+8FF4CE
+8FCAB3
+8FCABD
+8FCAEF
+8FCAF1
+8FCBAE
+8FF4CF
+8FCBCA
+8FCBE6
+8FCBEA
+8FCBF0
+8FCBF4
+8FCBEE
+8FCCA5
+8FCBF9
+8FCCAB
+8FCCAE
+8FCCAD
+8FCCB2
+8FCCC2
+8FCCD0
+8FCCD9
+8FF4D0
+8FCDBB
+8FF4D1
+8FCEBB
+8FF4D2
+8FCEBA
+8FCEC3
+8FF4D3
+8FCEF2
+8FB3DD
+8FCFD5
+8FCFE2
+8FCFE9
+8FCFED
+8FF4D4
+8FF4D5
+8FF4D6
+8FF4D7
+8FD0E5
+8FF4D8
+8FD0E9
+8FD1E8
+8FF4D9
+8FF4DA
+8FD1EC
+8FD2BB
+8FF4DB
+8FD3E1
+8FD3E8
+8FD4A7
+8FF4DC
+8FF4DD
+8FD4D4
+8FD4F2
+8FD5AE
+8FF4DE
+8FD7DE
+8FF4DF
+8FD8A2
+8FD8B7
+8FD8C1
+8FD8D1
+8FD8F4
+8FD9C6
+8FD9C8
+8FD9D1
+8FF4E0
+8FF4E1
+8FF4E2
+8FF4E3
+8FF4E4
+8FDCD3
+8FDDC8
+8FDDD4
+8FDDEA
+8FDDFA
+8FDEA4
+8FDEB0
+8FF4E5
+8FDEB5
+8FDECB
+8FF4E6
+8FDFB9
+8FF4E7
+8FDFC3
+8FF4E8
+8FF4E9
+8FE0D9
+8FF4EA
+8FF4EB
+8FE1E2
+8FF4EC
+8FF4ED
+8FF4EE
+8FE2C7
+8FE3A8
+8FE3A6
+8FE3A9
+8FE3AF
+8FE3B0
+8FE3AA
+8FE3AB
+8FE3BC
+8FE3C1
+8FE3BF
+8FE3D5
+8FE3D8
+8FE3D6
+8FE3DF
+8FE3E3
+8FE3E1
+8FE3D4
+8FE3E9
+8FE4A6
+8FE3F1
+8FE3F2
+8FE4CB
+8FE4C1
+8FE4C3
+8FE4BE
+8FF4EF
+8FE4C0
+8FE4C7
+8FE4BF
+8FE4E0
+8FE4DE
+8FE4D1
+8FF4F0
+8FE4DC
+8FE4D2
+8FE4DB
+8FE4D4
+8FE4FA
+8FE4EF
+8FE5B3
+8FE5BF
+8FE5C9
+8FE5D0
+8FE5E2
+8FE5EA
+8FE5EB
+8FF4F1
+8FF4F2
+8FF4F3
+8FE6E8
+8FE6EF
+8FE7AC
+8FF4F4
+8FE7AE
+8FF4F5
+8FE7B1
+8FF4F6
+8FE7B2
+8FE8B1
+8FE8B6
+8FF4F7
+8FF4F8
+8FE8DD
+8FF4F9
+8FF4FA
+8FE9D1
+8FF4FB
+8FE9ED
+8FEACD
+8FF4FC
+8FEADB
+8FEAE6
+8FEAEA
+8FEBA5
+8FEBFB
+8FEBFA
+8FF4FD
+8FECD6
+8FF4FE
+8FF3F3
+8FF3F4
+8FF3F5
+8FF3F6
+8FF3F7
+8FF3F8
+8FF3F9
+8FF3FA
+8FF3FB
+8FF3FC
+A2CC
+8FA2C3
+8FF4A9
+8FF4AA
+8FF3F3
+8FF3F4
+8FF3F5
+8FF3F6
+8FF3F7
+8FF3F8
+8FF3F9
+8FF3FA
+8FF3FB
+8FF3FC
+ADB5
+ADB6
+ADB7
+ADB8
+ADB9
+ADBA
+ADBB
+ADBC
+ADBD
+ADBE
+A2CC
+8FA2C3
+8FF4A9
+8FF4AA
+ADEA
+ADE2
+ADE4
+A2E8
+8FD4E3
+8FDCDF
+8FE4E9
+8FE3F8
+8FD9A1
+8FB1BB
+8FF4AE
+8FC2AD
+8FC3FC
+8FE4D0
+8FC2BF
+8FBCF4
+8FB0A9
+8FB0C8
+8FF4AF
+8FB0D2
+8FB0D4
+8FB0E3
+8FB0EE
+8FB1A7
+8FB1A3
+8FB1AC
+8FB1A9
+8FB1BE
+8FB1DF
+8FB1D8
+8FB1C8
+8FB1D7
+8FB1E3
+8FB1F4
+8FB1E1
+8FB2A3
+8FF4B0
+8FB2BB
+8FB2E6
+8FB2ED
+8FB2F5
+8FB2FC
+8FF4B1
+8FB3B5
+8FB3D8
+8FB3DB
+8FB3E5
+8FB3EE
+8FB3FB
+8FF4B2
+8FF4B3
+8FB4C0
+8FB4C7
+8FB4D0
+8FB4DE
+8FF4B4
+8FB5AA
+8FF4B5
+8FB5AF
+8FB5C4
+8FB5E8
+8FF4B6
+8FB7C2
+8FB7E4
+8FB7E8
+8FB7E7
+8FF4B7
+8FF4B8
+8FF4B9
+8FB8CE
+8FB8E1
+8FB8F5
+8FB8F7
+8FB8F8
+8FB8FC
+8FB9AF
+8FB9B7
+8FBABE
+8FBADB
+8FCDAA
+8FBAE1
+8FF4BA
+8FBAEB
+8FBBB3
+8FBBB8
+8FF4BB
+8FBBCA
+8FF4BC
+8FF4BD
+8FBBD0
+8FBBDE
+8FBBF4
+8FBBF5
+8FBBF9
+8FBCE4
+8FBCED
+8FBCFE
+8FF4BE
+8FBDC2
+8FBDE7
+8FF4BF
+8FBDF0
+8FBEB0
+8FBEAC
+8FF4C0
+8FBEB3
+8FBEBD
+8FBECD
+8FBEC9
+8FBEE4
+8FBFA8
+8FBFC9
+8FC0C4
+8FC0E4
+8FC0F4
+8FC1A6
+8FF4C1
+8FC1F5
+8FC1FC
+8FF4C2
+8FC1F8
+8FC2AB
+8FC2A1
+8FC2A5
+8FF4C3
+8FC2B8
+8FC2BA
+8FF4C4
+8FC2C4
+8FC2D2
+8FC2D7
+8FC2DB
+8FC2DE
+8FC2ED
+8FC2F0
+8FF4C5
+8FC3A1
+8FC3B5
+8FC3C9
+8FC3B9
+8FF4C6
+8FC3D8
+8FC3FE
+8FF4C7
+8FC4CC
+8FF4C8
+8FC4D9
+8FC4EA
+8FC4FD
+8FF4C9
+8FC5A7
+8FC5B5
+8FC5B6
+8FF4CA
+8FC5D5
+8FC6B8
+8FC6D7
+8FC6E0
+8FC6EA
+8FC6E3
+8FC7A1
+8FC7AB
+8FC7C7
+8FC7C3
+8FC7CB
+8FC7CF
+8FC7D9
+8FF4CB
+8FF4CC
+8FC7E6
+8FC7EE
+8FC7FC
+8FC7EB
+8FC7F0
+8FC8B1
+8FC8E5
+8FC8F8
+8FC9A6
+8FC9AB
+8FC9AD
+8FF4CD
+8FC9CA
+8FC9D3
+8FC9E9
+8FC9E3
+8FC9FC
+8FC9F4
+8FC9F5
+8FF4CE
+8FCAB3
+8FCABD
+8FCAEF
+8FCAF1
+8FCBAE
+8FF4CF
+8FCBCA
+8FCBE6
+8FCBEA
+8FCBF0
+8FCBF4
+8FCBEE
+8FCCA5
+8FCBF9
+8FCCAB
+8FCCAE
+8FCCAD
+8FCCB2
+8FCCC2
+8FCCD0
+8FCCD9
+8FF4D0
+8FCDBB
+8FF4D1
+8FCEBB
+8FF4D2
+8FCEBA
+8FCEC3
+8FF4D3
+8FCEF2
+8FB3DD
+8FCFD5
+8FCFE2
+8FCFE9
+8FCFED
+8FF4D4
+8FF4D5
+8FF4D6
+8FF4D7
+8FD0E5
+8FF4D8
+8FD0E9
+8FD1E8
+8FF4D9
+8FF4DA
+8FD1EC
+8FD2BB
+8FF4DB
+8FD3E1
+8FD3E8
+8FD4A7
+8FF4DC
+8FF4DD
+8FD4D4
+8FD4F2
+8FD5AE
+8FF4DE
+8FD7DE
+8FF4DF
+8FD8A2
+8FD8B7
+8FD8C1
+8FD8D1
+8FD8F4
+8FD9C6
+8FD9C8
+8FD9D1
+8FF4E0
+8FF4E1
+8FF4E2
+8FF4E3
+8FF4E4
+8FDCD3
+8FDDC8
+8FDDD4
+8FDDEA
+8FDDFA
+8FDEA4
+8FDEB0
+8FF4E5
+8FDEB5
+8FDECB
+8FF4E6
+8FDFB9
+8FF4E7
+8FDFC3
+8FF4E8
+8FF4E9
+8FE0D9
+8FF4EA
+8FF4EB
+8FE1E2
+8FF4EC
+8FF4ED
+8FF4EE
+8FE2C7
+8FE3A8
+8FE3A6
+8FE3A9
+8FE3AF
+8FE3B0
+8FE3AA
+8FE3AB
+8FE3BC
+8FE3C1
+8FE3BF
+8FE3D5
+8FE3D8
+8FE3D6
+8FE3DF
+8FE3E3
+8FE3E1
+8FE3D4
+8FE3E9
+8FE4A6
+8FE3F1
+8FE3F2
+8FE4CB
+8FE4C1
+8FE4C3
+8FE4BE
+8FF4EF
+8FE4C0
+8FE4C7
+8FE4BF
+8FE4E0
+8FE4DE
+8FE4D1
+8FF4F0
+8FE4DC
+8FE4D2
+8FE4DB
+8FE4D4
+8FE4FA
+8FE4EF
+8FE5B3
+8FE5BF
+8FE5C9
+8FE5D0
+8FE5E2
+8FE5EA
+8FE5EB
+8FF4F1
+8FF4F2
+8FF4F3
+8FE6E8
+8FE6EF
+8FE7AC
+8FF4F4
+8FE7AE
+8FF4F5
+8FE7B1
+8FF4F6
+8FE7B2
+8FE8B1
+8FE8B6
+8FF4F7
+8FF4F8
+8FE8DD
+8FF4F9
+8FF4FA
+8FE9D1
+8FF4FB
+8FE9ED
+8FEACD
+8FF4FC
+8FEADB
+8FEAE6
+8FEAEA
+8FEBA5
+8FEBFB
+8FEBFA
+8FF4FD
+8FECD6
+8FF4FE
+F5A1
+F5A2
+F5A3
+F5A4
+F5A5
+F5A6
+F5A7
+F5A8
+F5A9
+F5AA
+F5AB
+F5AC
+F5AD
+F5AE
+F5AF
+F5B0
+F5B1
+F5B2
+F5B3
+F5B4
+F5B5
+F5B6
+F5B7
+F5B8
+F5B9
+F5BA
+F5BB
+F5BC
+F5BD
+F5BE
+F5BF
+F5C0
+F5C1
+F5C2
+F5C3
+F5C4
+F5C5
+F5C6
+F5C7
+F5C8
+F5C9
+F5CA
+F5CB
+F5CC
+F5CD
+F5CE
+F5CF
+F5D0
+F5D1
+F5D2
+F5D3
+F5D4
+F5D5
+F5D6
+F5D7
+F5D8
+F5D9
+F5DA
+F5DB
+F5DC
+F5DD
+F5DE
+F5DF
+F5E0
+F5E1
+F5E2
+F5E3
+F5E4
+F5E5
+F5E6
+F5E7
+F5E8
+F5E9
+F5EA
+F5EB
+F5EC
+F5ED
+F5EE
+F5EF
+F5F0
+F5F1
+F5F2
+F5F3
+F5F4
+F5F5
+F5F6
+F5F7
+F5F8
+F5F9
+F5FA
+F5FB
+F5FC
+F5FD
+F5FE
+F6A1
+F6A2
+F6A3
+F6A4
+F6A5
+F6A6
+F6A7
+F6A8
+F6A9
+F6AA
+F6AB
+F6AC
+F6AD
+F6AE
+F6AF
+F6B0
+F6B1
+F6B2
+F6B3
+F6B4
+F6B5
+F6B6
+F6B7
+F6B8
+F6B9
+F6BA
+F6BB
+F6BC
+F6BD
+F6BE
+F6BF
+F6C0
+F6C1
+F6C2
+F6C3
+F6C4
+F6C5
+F6C6
+F6C7
+F6C8
+F6C9
+F6CA
+F6CB
+F6CC
+F6CD
+F6CE
+F6CF
+F6D0
+F6D1
+F6D2
+F6D3
+F6D4
+F6D5
+F6D6
+F6D7
+F6D8
+F6D9
+F6DA
+F6DB
+F6DC
+F6DD
+F6DE
+F6DF
+F6E0
+F6E1
+F6E2
+F6E3
+F6E4
+F6E5
+F6E6
+F6E7
+F6E8
+F6E9
+F6EA
+F6EB
+F6EC
+F6ED
+F6EE
+F6EF
+F6F0
+F6F1
+F6F2
+F6F3
+F6F4
+F6F5
+F6F6
+F6F7
+F6F8
+F6F9
+F6FA
+F6FB
+F6FC
+F6FD
+F6FE
+F7A1
+F7A2
+F7A3
+F7A4
+F7A5
+F7A6
+F7A7
+F7A8
+F7A9
+F7AA
+F7AB
+F7AC
+F7AD
+F7AE
+F7AF
+F7B0
+F7B1
+F7B2
+F7B3
+F7B4
+F7B5
+F7B6
+F7B7
+F7B8
+F7B9
+F7BA
+F7BB
+F7BC
+F7BD
+F7BE
+F7BF
+F7C0
+F7C1
+F7C2
+F7C3
+F7C4
+F7C5
+F7C6
+F7C7
+F7C8
+F7C9
+F7CA
+F7CB
+F7CC
+F7CD
+F7CE
+F7CF
+F7D0
+F7D1
+F7D2
+F7D3
+F7D4
+F7D5
+F7D6
+F7D7
+F7D8
+F7D9
+F7DA
+F7DB
+F7DC
+F7DD
+F7DE
+F7DF
+F7E0
+F7E1
+F7E2
+F7E3
+F7E4
+F7E5
+F7E6
+F7E7
+F7E8
+F7E9
+F7EA
+F7EB
+F7EC
+F7ED
+F7EE
+F7EF
+F7F0
+F7F1
+F7F2
+F7F3
+F7F4
+F7F5
+F7F6
+F7F7
+F7F8
+F7F9
+F7FA
+F7FB
+F7FC
+F7FD
+F7FE
+F8A1
+F8A2
+F8A3
+F8A4
+F8A5
+F8A6
+F8A7
+F8A8
+F8A9
+F8AA
+F8AB
+F8AC
+F8AD
+F8AE
+F8AF
+F8B0
+F8B1
+F8B2
+F8B3
+F8B4
+F8B5
+F8B6
+F8B7
+F8B8
+F8B9
+F8BA
+F8BB
+F8BC
+F8BD
+F8BE
+F8BF
+F8C0
+F8C1
+F8C2
+F8C3
+F8C4
+F8C5
+F8C6
+F8C7
+F8C8
+F8C9
+F8CA
+F8CB
+F8CC
+F8CD
+F8CE
+F8CF
+F8D0
+F8D1
+F8D2
+F8D3
+F8D4
+F8D5
+F8D6
+F8D7
+F8D8
+F8D9
+F8DA
+F8DB
+F8DC
+F8DD
+F8DE
+F8DF
+F8E0
+F8E1
+F8E2
+F8E3
+F8E4
+F8E5
+F8E6
+F8E7
+F8E8
+F8E9
+F8EA
+F8EB
+F8EC
+F8ED
+F8EE
+F8EF
+F8F0
+F8F1
+F8F2
+F8F3
+F8F4
+F8F5
+F8F6
+F8F7
+F8F8
+F8F9
+F8FA
+F8FB
+F8FC
+F8FD
+F8FE
+F9A1
+F9A2
+F9A3
+F9A4
+F9A5
+F9A6
+F9A7
+F9A8
+F9A9
+F9AA
+F9AB
+F9AC
+F9AD
+F9AE
+F9AF
+F9B0
+F9B1
+F9B2
+F9B3
+F9B4
+F9B5
+F9B6
+F9B7
+F9B8
+F9B9
+F9BA
+F9BB
+F9BC
+F9BD
+F9BE
+F9BF
+F9C0
+F9C1
+F9C2
+F9C3
+F9C4
+F9C5
+F9C6
+F9C7
+F9C8
+F9C9
+F9CA
+F9CB
+F9CC
+F9CD
+F9CE
+F9CF
+F9D0
+F9D1
+F9D2
+F9D3
+F9D4
+F9D5
+F9D6
+F9D7
+F9D8
+F9D9
+F9DA
+F9DB
+F9DC
+F9DD
+F9DE
+F9DF
+F9E0
+F9E1
+F9E2
+F9E3
+F9E4
+F9E5
+F9E6
+F9E7
+F9E8
+F9E9
+F9EA
+F9EB
+F9EC
+F9ED
+F9EE
+F9EF
+F9F0
+F9F1
+F9F2
+F9F3
+F9F4
+F9F5
+F9F6
+F9F7
+F9F8
+F9F9
+F9FA
+F9FB
+F9FC
+F9FD
+F9FE
+FAA1
+FAA2
+FAA3
+FAA4
+FAA5
+FAA6
+FAA7
+FAA8
+FAA9
+FAAA
+FAAB
+FAAC
+FAAD
+FAAE
+FAAF
+FAB0
+FAB1
+FAB2
+FAB3
+FAB4
+FAB5
+FAB6
+FAB7
+FAB8
+FAB9
+FABA
+FABB
+FABC
+FABD
+FABE
+FABF
+FAC0
+FAC1
+FAC2
+FAC3
+FAC4
+FAC5
+FAC6
+FAC7
+FAC8
+FAC9
+FACA
+FACB
+FACC
+FACD
+FACE
+FACF
+FAD0
+FAD1
+FAD2
+FAD3
+FAD4
+FAD5
+FAD6
+FAD7
+FAD8
+FAD9
+FADA
+FADB
+FADC
+FADD
+FADE
+FADF
+FAE0
+FAE1
+FAE2
+FAE3
+FAE4
+FAE5
+FAE6
+FAE7
+FAE8
+FAE9
+FAEA
+FAEB
+FAEC
+FAED
+FAEE
+FAEF
+FAF0
+FAF1
+FAF2
+FAF3
+FAF4
+FAF5
+FAF6
+FAF7
+FAF8
+FAF9
+FAFA
+FAFB
+FAFC
+FAFD
+FAFE
+FBA1
+FBA2
+FBA3
+FBA4
+FBA5
+FBA6
+FBA7
+FBA8
+FBA9
+FBAA
+FBAB
+FBAC
+FBAD
+FBAE
+FBAF
+FBB0
+FBB1
+FBB2
+FBB3
+FBB4
+FBB5
+FBB6
+FBB7
+FBB8
+FBB9
+FBBA
+FBBB
+FBBC
+FBBD
+FBBE
+FBBF
+FBC0
+FBC1
+FBC2
+FBC3
+FBC4
+FBC5
+FBC6
+FBC7
+FBC8
+FBC9
+FBCA
+FBCB
+FBCC
+FBCD
+FBCE
+FBCF
+FBD0
+FBD1
+FBD2
+FBD3
+FBD4
+FBD5
+FBD6
+FBD7
+FBD8
+FBD9
+FBDA
+FBDB
+FBDC
+FBDD
+FBDE
+FBDF
+FBE0
+FBE1
+FBE2
+FBE3
+FBE4
+FBE5
+FBE6
+FBE7
+FBE8
+FBE9
+FBEA
+FBEB
+FBEC
+FBED
+FBEE
+FBEF
+FBF0
+FBF1
+FBF2
+FBF3
+FBF4
+FBF5
+FBF6
+FBF7
+FBF8
+FBF9
+FBFA
+FBFB
+FBFC
+FBFD
+FBFE
+FCA1
+FCA2
+FCA3
+FCA4
+FCA5
+FCA6
+FCA7
+FCA8
+FCA9
+FCAA
+FCAB
+FCAC
+FCAD
+FCAE
+FCAF
+FCB0
+FCB1
+FCB2
+FCB3
+FCB4
+FCB5
+FCB6
+FCB7
+FCB8
+FCB9
+FCBA
+FCBB
+FCBC
+FCBD
+FCBE
+FCBF
+FCC0
+FCC1
+FCC2
+FCC3
+FCC4
+FCC5
+FCC6
+FCC7
+FCC8
+FCC9
+FCCA
+FCCB
+FCCC
+FCCD
+FCCE
+FCCF
+FCD0
+FCD1
+FCD2
+FCD3
+FCD4
+FCD5
+FCD6
+FCD7
+FCD8
+FCD9
+FCDA
+FCDB
+FCDC
+FCDD
+FCDE
+FCDF
+FCE0
+FCE1
+FCE2
+FCE3
+FCE4
+FCE5
+FCE6
+FCE7
+FCE8
+FCE9
+FCEA
+FCEB
+FCEC
+FCED
+FCEE
+FCEF
+FCF0
+FCF1
+FCF2
+FCF3
+FCF4
+FCF5
+FCF6
+FCF7
+FCF8
+FCF9
+FCFA
+FCFB
+FCFC
+FCFD
+FCFE
+FDA1
+FDA2
+FDA3
+FDA4
+FDA5
+FDA6
+FDA7
+FDA8
+FDA9
+FDAA
+FDAB
+FDAC
+FDAD
+FDAE
+FDAF
+FDB0
+FDB1
+FDB2
+FDB3
+FDB4
+FDB5
+FDB6
+FDB7
+FDB8
+FDB9
+FDBA
+FDBB
+FDBC
+FDBD
+FDBE
+FDBF
+FDC0
+FDC1
+FDC2
+FDC3
+FDC4
+FDC5
+FDC6
+FDC7
+FDC8
+FDC9
+FDCA
+FDCB
+FDCC
+FDCD
+FDCE
+FDCF
+FDD0
+FDD1
+FDD2
+FDD3
+FDD4
+FDD5
+FDD6
+FDD7
+FDD8
+FDD9
+FDDA
+FDDB
+FDDC
+FDDD
+FDDE
+FDDF
+FDE0
+FDE1
+FDE2
+FDE3
+FDE4
+FDE5
+FDE6
+FDE7
+FDE8
+FDE9
+FDEA
+FDEB
+FDEC
+FDED
+FDEE
+FDEF
+FDF0
+FDF1
+FDF2
+FDF3
+FDF4
+FDF5
+FDF6
+FDF7
+FDF8
+FDF9
+FDFA
+FDFB
+FDFC
+FDFD
+FDFE
+FEA1
+FEA2
+FEA3
+FEA4
+FEA5
+FEA6
+FEA7
+FEA8
+FEA9
+FEAA
+FEAB
+FEAC
+FEAD
+FEAE
+FEAF
+FEB0
+FEB1
+FEB2
+FEB3
+FEB4
+FEB5
+FEB6
+FEB7
+FEB8
+FEB9
+FEBA
+FEBB
+FEBC
+FEBD
+FEBE
+FEBF
+FEC0
+FEC1
+FEC2
+FEC3
+FEC4
+FEC5
+FEC6
+FEC7
+FEC8
+FEC9
+FECA
+FECB
+FECC
+FECD
+FECE
+FECF
+FED0
+FED1
+FED2
+FED3
+FED4
+FED5
+FED6
+FED7
+FED8
+FED9
+FEDA
+FEDB
+FEDC
+FEDD
+FEDE
+FEDF
+FEE0
+FEE1
+FEE2
+FEE3
+FEE4
+FEE5
+FEE6
+FEE7
+FEE8
+FEE9
+FEEA
+FEEB
+FEEC
+FEED
+FEEE
+FEEF
+FEF0
+FEF1
+FEF2
+FEF3
+FEF4
+FEF5
+FEF6
+FEF7
+FEF8
+FEF9
+FEFA
+FEFB
+FEFC
+FEFD
+FEFE
+8FF5A1
+8FF5A2
+8FF5A3
+8FF5A4
+8FF5A5
+8FF5A6
+8FF5A7
+8FF5A8
+8FF5A9
+8FF5AA
+8FF5AB
+8FF5AC
+8FF5AD
+8FF5AE
+8FF5AF
+8FF5B0
+8FF5B1
+8FF5B2
+8FF5B3
+8FF5B4
+8FF5B5
+8FF5B6
+8FF5B7
+8FF5B8
+8FF5B9
+8FF5BA
+8FF5BB
+8FF5BC
+8FF5BD
+8FF5BE
+8FF5BF
+8FF5C0
+8FF5C1
+8FF5C2
+8FF5C3
+8FF5C4
+8FF5C5
+8FF5C6
+8FF5C7
+8FF5C8
+8FF5C9
+8FF5CA
+8FF5CB
+8FF5CC
+8FF5CD
+8FF5CE
+8FF5CF
+8FF5D0
+8FF5D1
+8FF5D2
+8FF5D3
+8FF5D4
+8FF5D5
+8FF5D6
+8FF5D7
+8FF5D8
+8FF5D9
+8FF5DA
+8FF5DB
+8FF5DC
+8FF5DD
+8FF5DE
+8FF5DF
+8FF5E0
+8FF5E1
+8FF5E2
+8FF5E3
+8FF5E4
+8FF5E5
+8FF5E6
+8FF5E7
+8FF5E8
+8FF5E9
+8FF5EA
+8FF5EB
+8FF5EC
+8FF5ED
+8FF5EE
+8FF5EF
+8FF5F0
+8FF5F1
+8FF5F2
+8FF5F3
+8FF5F4
+8FF5F5
+8FF5F6
+8FF5F7
+8FF5F8
+8FF5F9
+8FF5FA
+8FF5FB
+8FF5FC
+8FF5FD
+8FF5FE
+8FF6A1
+8FF6A2
+8FF6A3
+8FF6A4
+8FF6A5
+8FF6A6
+8FF6A7
+8FF6A8
+8FF6A9
+8FF6AA
+8FF6AB
+8FF6AC
+8FF6AD
+8FF6AE
+8FF6AF
+8FF6B0
+8FF6B1
+8FF6B2
+8FF6B3
+8FF6B4
+8FF6B5
+8FF6B6
+8FF6B7
+8FF6B8
+8FF6B9
+8FF6BA
+8FF6BB
+8FF6BC
+8FF6BD
+8FF6BE
+8FF6BF
+8FF6C0
+8FF6C1
+8FF6C2
+8FF6C3
+8FF6C4
+8FF6C5
+8FF6C6
+8FF6C7
+8FF6C8
+8FF6C9
+8FF6CA
+8FF6CB
+8FF6CC
+8FF6CD
+8FF6CE
+8FF6CF
+8FF6D0
+8FF6D1
+8FF6D2
+8FF6D3
+8FF6D4
+8FF6D5
+8FF6D6
+8FF6D7
+8FF6D8
+8FF6D9
+8FF6DA
+8FF6DB
+8FF6DC
+8FF6DD
+8FF6DE
+8FF6DF
+8FF6E0
+8FF6E1
+8FF6E2
+8FF6E3
+8FF6E4
+8FF6E5
+8FF6E6
+8FF6E7
+8FF6E8
+8FF6E9
+8FF6EA
+8FF6EB
+8FF6EC
+8FF6ED
+8FF6EE
+8FF6EF
+8FF6F0
+8FF6F1
+8FF6F2
+8FF6F3
+8FF6F4
+8FF6F5
+8FF6F6
+8FF6F7
+8FF6F8
+8FF6F9
+8FF6FA
+8FF6FB
+8FF6FC
+8FF6FD
+8FF6FE
+8FF7A1
+8FF7A2
+8FF7A3
+8FF7A4
+8FF7A5
+8FF7A6
+8FF7A7
+8FF7A8
+8FF7A9
+8FF7AA
+8FF7AB
+8FF7AC
+8FF7AD
+8FF7AE
+8FF7AF
+8FF7B0
+8FF7B1
+8FF7B2
+8FF7B3
+8FF7B4
+8FF7B5
+8FF7B6
+8FF7B7
+8FF7B8
+8FF7B9
+8FF7BA
+8FF7BB
+8FF7BC
+8FF7BD
+8FF7BE
+8FF7BF
+8FF7C0
+8FF7C1
+8FF7C2
+8FF7C3
+8FF7C4
+8FF7C5
+8FF7C6
+8FF7C7
+8FF7C8
+8FF7C9
+8FF7CA
+8FF7CB
+8FF7CC
+8FF7CD
+8FF7CE
+8FF7CF
+8FF7D0
+8FF7D1
+8FF7D2
+8FF7D3
+8FF7D4
+8FF7D5
+8FF7D6
+8FF7D7
+8FF7D8
+8FF7D9
+8FF7DA
+8FF7DB
+8FF7DC
+8FF7DD
+8FF7DE
+8FF7DF
+8FF7E0
+8FF7E1
+8FF7E2
+8FF7E3
+8FF7E4
+8FF7E5
+8FF7E6
+8FF7E7
+8FF7E8
+8FF7E9
+8FF7EA
+8FF7EB
+8FF7EC
+8FF7ED
+8FF7EE
+8FF7EF
+8FF7F0
+8FF7F1
+8FF7F2
+8FF7F3
+8FF7F4
+8FF7F5
+8FF7F6
+8FF7F7
+8FF7F8
+8FF7F9
+8FF7FA
+8FF7FB
+8FF7FC
+8FF7FD
+8FF7FE
+8FF8A1
+8FF8A2
+8FF8A3
+8FF8A4
+8FF8A5
+8FF8A6
+8FF8A7
+8FF8A8
+8FF8A9
+8FF8AA
+8FF8AB
+8FF8AC
+8FF8AD
+8FF8AE
+8FF8AF
+8FF8B0
+8FF8B1
+8FF8B2
+8FF8B3
+8FF8B4
+8FF8B5
+8FF8B6
+8FF8B7
+8FF8B8
+8FF8B9
+8FF8BA
+8FF8BB
+8FF8BC
+8FF8BD
+8FF8BE
+8FF8BF
+8FF8C0
+8FF8C1
+8FF8C2
+8FF8C3
+8FF8C4
+8FF8C5
+8FF8C6
+8FF8C7
+8FF8C8
+8FF8C9
+8FF8CA
+8FF8CB
+8FF8CC
+8FF8CD
+8FF8CE
+8FF8CF
+8FF8D0
+8FF8D1
+8FF8D2
+8FF8D3
+8FF8D4
+8FF8D5
+8FF8D6
+8FF8D7
+8FF8D8
+8FF8D9
+8FF8DA
+8FF8DB
+8FF8DC
+8FF8DD
+8FF8DE
+8FF8DF
+8FF8E0
+8FF8E1
+8FF8E2
+8FF8E3
+8FF8E4
+8FF8E5
+8FF8E6
+8FF8E7
+8FF8E8
+8FF8E9
+8FF8EA
+8FF8EB
+8FF8EC
+8FF8ED
+8FF8EE
+8FF8EF
+8FF8F0
+8FF8F1
+8FF8F2
+8FF8F3
+8FF8F4
+8FF8F5
+8FF8F6
+8FF8F7
+8FF8F8
+8FF8F9
+8FF8FA
+8FF8FB
+8FF8FC
+8FF8FD
+8FF8FE
+8FF9A1
+8FF9A2
+8FF9A3
+8FF9A4
+8FF9A5
+8FF9A6
+8FF9A7
+8FF9A8
+8FF9A9
+8FF9AA
+8FF9AB
+8FF9AC
+8FF9AD
+8FF9AE
+8FF9AF
+8FF9B0
+8FF9B1
+8FF9B2
+8FF9B3
+8FF9B4
+8FF9B5
+8FF9B6
+8FF9B7
+8FF9B8
+8FF9B9
+8FF9BA
+8FF9BB
+8FF9BC
+8FF9BD
+8FF9BE
+8FF9BF
+8FF9C0
+8FF9C1
+8FF9C2
+8FF9C3
+8FF9C4
+8FF9C5
+8FF9C6
+8FF9C7
+8FF9C8
+8FF9C9
+8FF9CA
+8FF9CB
+8FF9CC
+8FF9CD
+8FF9CE
+8FF9CF
+8FF9D0
+8FF9D1
+8FF9D2
+8FF9D3
+8FF9D4
+8FF9D5
+8FF9D6
+8FF9D7
+8FF9D8
+8FF9D9
+8FF9DA
+8FF9DB
+8FF9DC
+8FF9DD
+8FF9DE
+8FF9DF
+8FF9E0
+8FF9E1
+8FF9E2
+8FF9E3
+8FF9E4
+8FF9E5
+8FF9E6
+8FF9E7
+8FF9E8
+8FF9E9
+8FF9EA
+8FF9EB
+8FF9EC
+8FF9ED
+8FF9EE
+8FF9EF
+8FF9F0
+8FF9F1
+8FF9F2
+8FF9F3
+8FF9F4
+8FF9F5
+8FF9F6
+8FF9F7
+8FF9F8
+8FF9F9
+8FF9FA
+8FF9FB
+8FF9FC
+8FF9FD
+8FF9FE
+8FFAA1
+8FFAA2
+8FFAA3
+8FFAA4
+8FFAA5
+8FFAA6
+8FFAA7
+8FFAA8
+8FFAA9
+8FFAAA
+8FFAAB
+8FFAAC
+8FFAAD
+8FFAAE
+8FFAAF
+8FFAB0
+8FFAB1
+8FFAB2
+8FFAB3
+8FFAB4
+8FFAB5
+8FFAB6
+8FFAB7
+8FFAB8
+8FFAB9
+8FFABA
+8FFABB
+8FFABC
+8FFABD
+8FFABE
+8FFABF
+8FFAC0
+8FFAC1
+8FFAC2
+8FFAC3
+8FFAC4
+8FFAC5
+8FFAC6
+8FFAC7
+8FFAC8
+8FFAC9
+8FFACA
+8FFACB
+8FFACC
+8FFACD
+8FFACE
+8FFACF
+8FFAD0
+8FFAD1
+8FFAD2
+8FFAD3
+8FFAD4
+8FFAD5
+8FFAD6
+8FFAD7
+8FFAD8
+8FFAD9
+8FFADA
+8FFADB
+8FFADC
+8FFADD
+8FFADE
+8FFADF
+8FFAE0
+8FFAE1
+8FFAE2
+8FFAE3
+8FFAE4
+8FFAE5
+8FFAE6
+8FFAE7
+8FFAE8
+8FFAE9
+8FFAEA
+8FFAEB
+8FFAEC
+8FFAED
+8FFAEE
+8FFAEF
+8FFAF0
+8FFAF1
+8FFAF2
+8FFAF3
+8FFAF4
+8FFAF5
+8FFAF6
+8FFAF7
+8FFAF8
+8FFAF9
+8FFAFA
+8FFAFB
+8FFAFC
+8FFAFD
+8FFAFE
+8FFBA1
+8FFBA2
+8FFBA3
+8FFBA4
+8FFBA5
+8FFBA6
+8FFBA7
+8FFBA8
+8FFBA9
+8FFBAA
+8FFBAB
+8FFBAC
+8FFBAD
+8FFBAE
+8FFBAF
+8FFBB0
+8FFBB1
+8FFBB2
+8FFBB3
+8FFBB4
+8FFBB5
+8FFBB6
+8FFBB7
+8FFBB8
+8FFBB9
+8FFBBA
+8FFBBB
+8FFBBC
+8FFBBD
+8FFBBE
+8FFBBF
+8FFBC0
+8FFBC1
+8FFBC2
+8FFBC3
+8FFBC4
+8FFBC5
+8FFBC6
+8FFBC7
+8FFBC8
+8FFBC9
+8FFBCA
+8FFBCB
+8FFBCC
+8FFBCD
+8FFBCE
+8FFBCF
+8FFBD0
+8FFBD1
+8FFBD2
+8FFBD3
+8FFBD4
+8FFBD5
+8FFBD6
+8FFBD7
+8FFBD8
+8FFBD9
+8FFBDA
+8FFBDB
+8FFBDC
+8FFBDD
+8FFBDE
+8FFBDF
+8FFBE0
+8FFBE1
+8FFBE2
+8FFBE3
+8FFBE4
+8FFBE5
+8FFBE6
+8FFBE7
+8FFBE8
+8FFBE9
+8FFBEA
+8FFBEB
+8FFBEC
+8FFBED
+8FFBEE
+8FFBEF
+8FFBF0
+8FFBF1
+8FFBF2
+8FFBF3
+8FFBF4
+8FFBF5
+8FFBF6
+8FFBF7
+8FFBF8
+8FFBF9
+8FFBFA
+8FFBFB
+8FFBFC
+8FFBFD
+8FFBFE
+8FFCA1
+8FFCA2
+8FFCA3
+8FFCA4
+8FFCA5
+8FFCA6
+8FFCA7
+8FFCA8
+8FFCA9
+8FFCAA
+8FFCAB
+8FFCAC
+8FFCAD
+8FFCAE
+8FFCAF
+8FFCB0
+8FFCB1
+8FFCB2
+8FFCB3
+8FFCB4
+8FFCB5
+8FFCB6
+8FFCB7
+8FFCB8
+8FFCB9
+8FFCBA
+8FFCBB
+8FFCBC
+8FFCBD
+8FFCBE
+8FFCBF
+8FFCC0
+8FFCC1
+8FFCC2
+8FFCC3
+8FFCC4
+8FFCC5
+8FFCC6
+8FFCC7
+8FFCC8
+8FFCC9
+8FFCCA
+8FFCCB
+8FFCCC
+8FFCCD
+8FFCCE
+8FFCCF
+8FFCD0
+8FFCD1
+8FFCD2
+8FFCD3
+8FFCD4
+8FFCD5
+8FFCD6
+8FFCD7
+8FFCD8
+8FFCD9
+8FFCDA
+8FFCDB
+8FFCDC
+8FFCDD
+8FFCDE
+8FFCDF
+8FFCE0
+8FFCE1
+8FFCE2
+8FFCE3
+8FFCE4
+8FFCE5
+8FFCE6
+8FFCE7
+8FFCE8
+8FFCE9
+8FFCEA
+8FFCEB
+8FFCEC
+8FFCED
+8FFCEE
+8FFCEF
+8FFCF0
+8FFCF1
+8FFCF2
+8FFCF3
+8FFCF4
+8FFCF5
+8FFCF6
+8FFCF7
+8FFCF8
+8FFCF9
+8FFCFA
+8FFCFB
+8FFCFC
+8FFCFD
+8FFCFE
+8FFDA1
+8FFDA2
+8FFDA3
+8FFDA4
+8FFDA5
+8FFDA6
+8FFDA7
+8FFDA8
+8FFDA9
+8FFDAA
+8FFDAB
+8FFDAC
+8FFDAD
+8FFDAE
+8FFDAF
+8FFDB0
+8FFDB1
+8FFDB2
+8FFDB3
+8FFDB4
+8FFDB5
+8FFDB6
+8FFDB7
+8FFDB8
+8FFDB9
+8FFDBA
+8FFDBB
+8FFDBC
+8FFDBD
+8FFDBE
+8FFDBF
+8FFDC0
+8FFDC1
+8FFDC2
+8FFDC3
+8FFDC4
+8FFDC5
+8FFDC6
+8FFDC7
+8FFDC8
+8FFDC9
+8FFDCA
+8FFDCB
+8FFDCC
+8FFDCD
+8FFDCE
+8FFDCF
+8FFDD0
+8FFDD1
+8FFDD2
+8FFDD3
+8FFDD4
+8FFDD5
+8FFDD6
+8FFDD7
+8FFDD8
+8FFDD9
+8FFDDA
+8FFDDB
+8FFDDC
+8FFDDD
+8FFDDE
+8FFDDF
+8FFDE0
+8FFDE1
+8FFDE2
+8FFDE3
+8FFDE4
+8FFDE5
+8FFDE6
+8FFDE7
+8FFDE8
+8FFDE9
+8FFDEA
+8FFDEB
+8FFDEC
+8FFDED
+8FFDEE
+8FFDEF
+8FFDF0
+8FFDF1
+8FFDF2
+8FFDF3
+8FFDF4
+8FFDF5
+8FFDF6
+8FFDF7
+8FFDF8
+8FFDF9
+8FFDFA
+8FFDFB
+8FFDFC
+8FFDFD
+8FFDFE
+8FFEA1
+8FFEA2
+8FFEA3
+8FFEA4
+8FFEA5
+8FFEA6
+8FFEA7
+8FFEA8
+8FFEA9
+8FFEAA
+8FFEAB
+8FFEAC
+8FFEAD
+8FFEAE
+8FFEAF
+8FFEB0
+8FFEB1
+8FFEB2
+8FFEB3
+8FFEB4
+8FFEB5
+8FFEB6
+8FFEB7
+8FFEB8
+8FFEB9
+8FFEBA
+8FFEBB
+8FFEBC
+8FFEBD
+8FFEBE
+8FFEBF
+8FFEC0
+8FFEC1
+8FFEC2
+8FFEC3
+8FFEC4
+8FFEC5
+8FFEC6
+8FFEC7
+8FFEC8
+8FFEC9
+8FFECA
+8FFECB
+8FFECC
+8FFECD
+8FFECE
+8FFECF
+8FFED0
+8FFED1
+8FFED2
+8FFED3
+8FFED4
+8FFED5
+8FFED6
+8FFED7
+8FFED8
+8FFED9
+8FFEDA
+8FFEDB
+8FFEDC
+8FFEDD
+8FFEDE
+8FFEDF
+8FFEE0
+8FFEE1
+8FFEE2
+8FFEE3
+8FFEE4
+8FFEE5
+8FFEE6
+8FFEE7
+8FFEE8
+8FFEE9
+8FFEEA
+8FFEEB
+8FFEEC
+8FFEED
+8FFEEE
+8FFEEF
+8FFEF0
+8FFEF1
+8FFEF2
+8FFEF3
+8FFEF4
+8FFEF5
+8FFEF6
+8FFEF7
+8FFEF8
+8FFEF9
+8FFEFA
+8FFEFB
+8FFEFC
+8FFEFD
+8FFEFE
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP TABLE t4;
+SET collation_connection='cp932_japanese_ci';
+create table t1 select repeat('a',4000) a;
+delete from t1;
+insert into t1 values ('a'), ('a '), ('a\t');
+select collation(a),hex(a) from t1 order by a;
+collation(a) hex(a)
+cp932_japanese_ci 6109
+cp932_japanese_ci 61
+cp932_japanese_ci 6120
+drop table t1;
+SET collation_connection='cp932_bin';
+create table t1 select repeat('a',4000) a;
+delete from t1;
+insert into t1 values ('a'), ('a '), ('a\t');
+select collation(a),hex(a) from t1 order by a;
+collation(a) hex(a)
+cp932_bin 6109
+cp932_bin 61
+cp932_bin 6120
+drop table t1;
+create table t2 (a char(1));
+insert into t2 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7');
+insert into t2 values ('8'),('9'),('A'),('B'),('C'),('D'),('E'),('F');
+create table t1 (
+a varchar(2) character set cp932
+) engine=myisam;
+insert into t1
+select unhex(concat(t24.a, t23.a, t22.a, t21.a))
+from t2 t21, t2 t22, t2 t23, t2 t24;
+delete from t1 where a='';
+alter table t1 add key(a);
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+drop table t1;
+drop table t2;
+create table t1 (col1 varchar(1)) character set cp932;
+insert into t1 values ('a');
+insert into t1 values ('ab');
+Warnings:
+Warning 1265 Data truncated for column 'col1' at row 1
+select * from t1;
+col1
+a
+a
+insert into t1 values ('abc');
+Warnings:
+Warning 1265 Data truncated for column 'col1' at row 1
+select * from t1;
+col1
+a
+a
+a
+drop table t1;
+set names utf8;
+create table t1 (a text) default character set cp932;
+insert into t1 values (_utf8 0xE38182);
+show warnings;
+Level Code Message
+select * from t1;
+a
+ã‚
+select hex(a) from t1;
+hex(a)
+82A0
+drop table t1;
+ƒ\
+ƒ\
+c_cp932
+ƒ\
+ƒ\
+ƒ\
+ソ
+ソ
+ƒ\
+ƒ\
diff --git a/mysql-test/r/binlog_row_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
index 4f4e7bcedd7..4f4e7bcedd7 100644
--- a/mysql-test/r/binlog_row_ctype_ucs.result
+++ b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
diff --git a/mysql-test/r/binlog_row_drop_tmp_tbl.result b/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result
index 503076d66d9..503076d66d9 100644
--- a/mysql-test/r/binlog_row_drop_tmp_tbl.result
+++ b/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result
diff --git a/mysql-test/r/binlog_row_innodb_stat.result b/mysql-test/suite/binlog/r/binlog_row_innodb_stat.result
index e6813ee2719..e6813ee2719 100644
--- a/mysql-test/r/binlog_row_innodb_stat.result
+++ b/mysql-test/suite/binlog/r/binlog_row_innodb_stat.result
diff --git a/mysql-test/r/binlog_row_insert_select.result b/mysql-test/suite/binlog/r/binlog_row_insert_select.result
index cd6ddafc47b..cd6ddafc47b 100644
--- a/mysql-test/r/binlog_row_insert_select.result
+++ b/mysql-test/suite/binlog/r/binlog_row_insert_select.result
diff --git a/mysql-test/r/binlog_row_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
index 6ac942176c7..6ac942176c7 100644
--- a/mysql-test/r/binlog_row_mix_innodb_myisam.result
+++ b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
diff --git a/mysql-test/r/binlog_statement_insert_delayed.result b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result
index 3a2dc441632..3a2dc441632 100644
--- a/mysql-test/r/binlog_statement_insert_delayed.result
+++ b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result
diff --git a/mysql-test/suite/binlog/r/binlog_stm_binlog.result b/mysql-test/suite/binlog/r/binlog_stm_binlog.result
new file mode 100644
index 00000000000..80908e6b450
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result
@@ -0,0 +1,672 @@
+create table t1 (a int, b int) engine=innodb;
+begin;
+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 use `test`; 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 */
+drop table t1;
+drop table if exists t1, t2;
+reset master;
+create table t1 (a int) engine=innodb;
+create table t2 (a int) engine=innodb;
+begin;
+insert t1 values (5);
+commit;
+begin;
+insert t2 values (5);
+commit;
+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) engine=innodb
+master-bin.000001 # Query # # use `test`; create table t2 (a int) engine=innodb
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Query # # use `test`; insert t1 values (5)
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Query # # use `test`; insert t2 values (5)
+master-bin.000001 # Xid # # COMMIT /* XID */
+drop table t1,t2;
+reset master;
+create table t1 (n int) engine=innodb;
+begin;
+commit;
+drop table t1;
+show binlog events in 'master-bin.000001' from 106;
+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 # use `test`; BEGIN
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(100 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(99 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(98 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(97 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(96 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(95 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(94 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(93 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(92 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(91 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(90 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(89 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(88 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(87 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(86 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(85 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(84 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(83 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(82 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(81 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(80 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(79 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(78 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(77 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(76 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(75 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(74 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(73 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(72 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(71 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(70 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(69 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(68 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(67 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(66 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(65 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(64 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(63 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(62 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(61 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(60 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(59 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(58 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(57 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(56 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(55 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(54 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(53 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(52 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(51 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(50 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(49 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(48 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(47 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(46 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(45 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(44 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(43 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(42 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(41 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(40 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(39 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(38 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(37 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(36 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(35 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(34 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(33 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(32 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(31 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(30 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(29 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(28 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(27 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(26 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(25 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(24 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(23 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(22 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(21 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(20 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(19 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(18 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(17 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(16 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(15 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(14 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(13 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(12 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(11 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(10 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(9 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(8 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(7 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(6 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(5 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(4 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(3 + 4)
+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;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Query 1 # use `test`; drop table t1
+set @ac = @@autocommit;
+set autocommit= 0;
+reset master;
+create table t1(n int) engine=innodb;
+begin;
+insert into t1 values (1);
+insert into t1 values (2);
+insert into t1 values (3);
+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 use `test`; 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
+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 use `test`; 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
+drop table t1;
+set global binlog_cache_size=@bcs;
+set session autocommit = @ac;
+End of 5.0 tests
+reset master;
+create table t1 (id tinyint auto_increment primary key);
+set insert_id=128;
+insert into t1 values(null);
+Warnings:
+Warning 1264 Out of range value for column 'id' at row 1
+select * from t1;
+id
+127
+drop table t1;
+create table t1 (a int);
+create table if not exists t2 select * from t1;
+create temporary table tt1 (a int);
+create table if not exists t3 like tt1;
+USE mysql;
+INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test');
+UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@';
+DELETE FROM user WHERE host='localhost' AND user='@#@';
+use test;
+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 (id tinyint auto_increment primary key)
+master-bin.000001 # Intvar # # INSERT_ID=127
+master-bin.000001 # Query # # use `test`; insert into t1 values(null)
+master-bin.000001 # Query # # use `test`; drop table t1
+master-bin.000001 # Query # # use `test`; create table t1 (a int)
+master-bin.000001 # Query # # use `test`; create table if not exists t2 select * from t1
+master-bin.000001 # Query # # use `test`; create temporary table tt1 (a int)
+master-bin.000001 # Query # # use `test`; create table if not exists t3 like tt1
+master-bin.000001 # Query # # use `mysql`; INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test')
+master-bin.000001 # Query # # use `mysql`; UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@'
+master-bin.000001 # Query # # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@'
+drop table t1,t2,t3,tt1;
+create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
+set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
+insert delayed into t1 values (207);
+insert delayed into t1 values (null);
+insert delayed into t1 values (300);
+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 (id tinyint auto_increment primary key)
+master-bin.000001 # Intvar # # INSERT_ID=127
+master-bin.000001 # Query # # use `test`; insert into t1 values(null)
+master-bin.000001 # Query # # use `test`; drop table t1
+master-bin.000001 # Query # # use `test`; create table t1 (a int)
+master-bin.000001 # Query # # use `test`; create table if not exists t2 select * from t1
+master-bin.000001 # Query # # use `test`; create temporary table tt1 (a int)
+master-bin.000001 # Query # # use `test`; create table if not exists t3 like tt1
+master-bin.000001 # Query # # use `mysql`; INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test')
+master-bin.000001 # Query # # use `mysql`; UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@'
+master-bin.000001 # Query # # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@'
+master-bin.000001 # Query # # use `test`; drop table t1,t2,t3,tt1
+master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam
+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 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+insert delayed into t1 values (null),(null),(null),(null);
+insert delayed into t1 values (null),(null),(400),(null);
+11 == 11
+select * from t1;
+a
+207
+208
+300
+301
+302
+303
+304
+305
+306
+400
+401
+drop table t1;
+reset master;
+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
+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
+drop table t3;
diff --git a/mysql-test/suite/binlog/r/binlog_stm_blackhole.result b/mysql-test/suite/binlog/r/binlog_stm_blackhole.result
new file mode 100644
index 00000000000..a1c83ffc73d
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_stm_blackhole.result
@@ -0,0 +1,155 @@
+drop table if exists t1,t2;
+CREATE TABLE t1 (
+Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
+Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
+) ENGINE=blackhole;
+INSERT INTO t1 VALUES (9410,9412);
+select period from t1;
+period
+select * from t1;
+Period Varor_period
+select t1.* from t1;
+Period Varor_period
+CREATE TABLE t2 (
+auto int NOT NULL auto_increment,
+fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL,
+companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL,
+fld3 char(30) DEFAULT '' NOT NULL,
+fld4 char(35) DEFAULT '' NOT NULL,
+fld5 char(35) DEFAULT '' NOT NULL,
+fld6 char(4) DEFAULT '' NOT NULL,
+primary key (auto)
+) ENGINE=blackhole;
+INSERT INTO t2 VALUES (1192,068305,00,'Colombo','hardware','colicky','');
+INSERT INTO t2 VALUES (1193,000000,00,'nondecreasing','implant','thrillingly','');
+select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%";
+fld3
+select fld3 from t2 where fld3 like "%cultivation" ;
+fld3
+select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3;
+fld3 companynr
+select fld3,companynr from t2 where companynr = 58 order by fld3;
+fld3 companynr
+select fld3 from t2 order by fld3 desc limit 10;
+fld3
+select fld3 from t2 order by fld3 desc limit 5;
+fld3
+select fld3 from t2 order by fld3 desc limit 5,5;
+fld3
+select t2.fld3 from t2 where fld3 = 'honeysuckle';
+fld3
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_';
+fld3
+select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_';
+fld3
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%';
+fld3
+select t2.fld3 from t2 where fld3 LIKE 'h%le';
+fld3
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_';
+fld3
+select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%';
+fld3
+select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
+fld3
+select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3;
+fld1 fld3
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(200), b TEXT, FULLTEXT (a,b));
+INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'),
+('Full-text indexes', 'are called collections'),
+('Only MyISAM tables','support collections'),
+('Function MATCH ... AGAINST()','is used to do a search'),
+('Full-text search in MySQL', 'implements vector space model');
+SHOW INDEX FROM t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+t1 1 a 1 a NULL NULL NULL NULL YES FULLTEXT
+t1 1 a 2 b NULL NULL NULL NULL YES FULLTEXT
+select * from t1 where MATCH(a,b) AGAINST ("collections");
+a b
+Only MyISAM tables support collections
+Full-text indexes are called collections
+explain extended select * from t1 where MATCH(a,b) AGAINST ("collections");
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 fulltext a a 0 1 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (match `test`.`t1`.`a`,`test`.`t1`.`b` against (_latin1'collections'))
+select * from t1 where MATCH(a,b) AGAINST ("indexes");
+a b
+Full-text indexes are called collections
+select * from t1 where MATCH(a,b) AGAINST ("indexes collections");
+a b
+Full-text indexes are called collections
+Only MyISAM tables support collections
+select * from t1 where MATCH(a,b) AGAINST ("only");
+a b
+reset master;
+drop table t1,t2;
+create table t1 (a int) engine=blackhole;
+delete from t1 where a=10;
+update t1 set a=11 where a=15;
+insert into t1 values(1);
+insert ignore into t1 values(1);
+replace into t1 values(100);
+create table t2 (a varchar(200)) engine=blackhole;
+load data infile '../std_data_ln/words.dat' into table t2;
+alter table t1 add b int;
+alter table t1 drop b;
+create table t3 like t1;
+insert into t1 select * from t3;
+replace into t1 select * from t3;
+select * from t1;
+a
+select * from t2;
+a
+select * from t3;
+a
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; drop table t1,t2
+master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=blackhole
+master-bin.000001 # Query # # use `test`; delete from t1 where a=10
+master-bin.000001 # Query # # use `test`; update t1 set a=11 where a=15
+master-bin.000001 # Query # # use `test`; insert into t1 values(1)
+master-bin.000001 # Query # # use `test`; insert ignore into t1 values(1)
+master-bin.000001 # Query # # use `test`; replace into t1 values(100)
+master-bin.000001 # Query # # use `test`; create table t2 (a varchar(200)) engine=blackhole
+master-bin.000001 # Begin_load_query # # ;file_id=1;block_len=581
+master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/words.dat' into table t2 ;file_id=1
+master-bin.000001 # Query # # use `test`; alter table t1 add b int
+master-bin.000001 # Query # # use `test`; alter table t1 drop b
+master-bin.000001 # Query # # use `test`; create table t3 like t1
+master-bin.000001 # Query # # use `test`; insert into t1 select * from t3
+master-bin.000001 # Query # # use `test`; replace into t1 select * from t3
+drop table t1,t2,t3;
+CREATE TABLE t1(a INT) ENGINE=BLACKHOLE;
+INSERT DELAYED INTO t1 VALUES(1);
+DROP TABLE t1;
+CREATE TABLE t1(a INT, b INT) ENGINE=BLACKHOLE;
+DELETE FROM t1 WHERE a=10;
+ALTER TABLE t1 ADD INDEX(a);
+DELETE FROM t1 WHERE a=10;
+ALTER TABLE t1 DROP INDEX a;
+ALTER TABLE t1 ADD UNIQUE INDEX(a);
+DELETE FROM t1 WHERE a=10;
+ALTER TABLE t1 DROP INDEX a;
+ALTER TABLE t1 ADD PRIMARY KEY(a);
+DELETE FROM t1 WHERE a=10;
+DROP TABLE t1;
+reset master;
+create table t1 (a int) engine=blackhole;
+set autocommit=0;
+start transaction;
+insert into t1 values(1);
+commit;
+start transaction;
+insert into t1 values(2);
+rollback;
+set autocommit=1;
+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) engine=blackhole
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Query # # use `test`; insert into t1 values(1)
+master-bin.000001 # Query # # use `test`; COMMIT
+drop table if exists t1;
diff --git a/mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result b/mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result
new file mode 100755
index 00000000000..ef9f76b7d9c
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result
@@ -0,0 +1,11393 @@
+drop table if exists t1;
+drop table if exists t2;
+drop table if exists t3;
+drop table if exists t4;
+set names cp932;
+set character_set_database = cp932;
+CREATE TABLE t1(c1 CHAR(1)) DEFAULT CHARACTER SET = cp932;
+INSERT INTO t1 VALUES
+(0x05),(0x7E),(0x815C),(0x815F),(0x8160),(0x8161),(0x817C),(0x8191),(0x8192),(0x81CA);
+INSERT INTO t1 VALUES
+(0x8740),(0x8741),(0x8742),(0x8743),(0x8744),(0x8745),(0x8746),(0x8747),
+(0x8748),(0x8749),(0x874A),(0x874B),(0x874C),(0x874D),(0x874E),(0x874F),
+(0x8750),(0x8751),(0x8752),(0x8753),(0x8754),(0x8755),(0x8756),(0x8757),
+(0x8758),(0x8759),(0x875A),(0x875B),(0x875C),(0x875D),(0x875F),
+(0x8760),(0x8761),(0x8762),(0x8763),(0x8764),(0x8765),(0x8766),(0x8767),
+(0x8768),(0x8769),(0x876A),(0x876B),(0x876C),(0x876D),(0x876E),(0x876F),
+(0x8770),(0x8771),(0x8772),(0x8773),(0x8774),(0x8775),(0x877E),
+(0x8780),(0x8781),(0x8782),(0x8783),(0x8784),(0x8785),(0x8786),(0x8787),
+(0x8788),(0x8789),(0x878A),(0x878B),(0x878C),(0x878D),(0x878E),(0x878F),
+(0x8790),(0x8791),(0x8792),(0x8793),(0x8794),(0x8795),(0x8796),(0x8797),
+(0x8798),(0x8799),(0x879A),(0x879B),(0x879C);
+INSERT INTO t1 VALUES
+(0xED40),(0xED41),(0xED42),(0xED43),(0xED44),(0xED45),(0xED46),(0xED47),
+(0xED48),(0xED49),(0xED4A),(0xED4B),(0xED4C),(0xED4D),(0xED4E),(0xED4F),
+(0xED50),(0xED51),(0xED52),(0xED53),(0xED54),(0xED55),(0xED56),(0xED57),
+(0xED58),(0xED59),(0xED5A),(0xED5B),(0xED5C),(0xED5D),(0xED5E),(0xED5F),
+(0xED60),(0xED61),(0xED62),(0xED63),(0xED64),(0xED65),(0xED66),(0xED67),
+(0xED68),(0xED69),(0xED6A),(0xED6B),(0xED6C),(0xED6D),(0xED6E),(0xED6F),
+(0xED70),(0xED71),(0xED72),(0xED73),(0xED74),(0xED75),(0xED76),(0xED77),
+(0xED78),(0xED79),(0xED7A),(0xED7B),(0xED7C),(0xED7D),(0xED7E),
+(0xED80),(0xED81),(0xED82),(0xED83),(0xED84),(0xED85),(0xED86),(0xED87),
+(0xED88),(0xED89),(0xED8A),(0xED8B),(0xED8C),(0xED8D),(0xED8E),(0xED8F),
+(0xED90),(0xED91),(0xED92),(0xED93),(0xED94),(0xED95),(0xED96),(0xED97),
+(0xED98),(0xED99),(0xED9A),(0xED9B),(0xED9C),(0xED9D),(0xED9E),(0xED9F),
+(0xEDA0),(0xEDA1),(0xEDA2),(0xEDA3),(0xEDA4),(0xEDA5),(0xEDA6),(0xEDA7),
+(0xEDA8),(0xEDA9),(0xEDAA),(0xEDAB),(0xEDAC),(0xEDAD),(0xEDAE),(0xEDAF),
+(0xEDB0),(0xEDB1),(0xEDB2),(0xEDB3),(0xEDB4),(0xEDB5),(0xEDB6),(0xEDB7),
+(0xEDB8),(0xEDB9),(0xEDBA),(0xEDBB),(0xEDBC),(0xEDBD),(0xEDBE),(0xEDBF),
+(0xEDC0),(0xEDC1),(0xEDC2),(0xEDC3),(0xEDC4),(0xEDC5),(0xEDC6),(0xEDC7),
+(0xEDC8),(0xEDC9),(0xEDCA),(0xEDCB),(0xEDCC),(0xEDCD),(0xEDCE),(0xEDCF),
+(0xEDD0),(0xEDD1),(0xEDD2),(0xEDD3),(0xEDD4),(0xEDD5),(0xEDD6),(0xEDD7),
+(0xEDD8),(0xEDD9),(0xEDDA),(0xEDDB),(0xEDDC),(0xEDDD),(0xEDDE),(0xEDDF),
+(0xEDE0),(0xEDE1),(0xEDE2),(0xEDE3),(0xEDE4),(0xEDE5),(0xEDE6),(0xEDE7),
+(0xEDE8),(0xEDE9),(0xEDEA),(0xEDEB),(0xEDEC),(0xEDED),(0xEDEE),(0xEDEF),
+(0xEDF0),(0xEDF1),(0xEDF2),(0xEDF3),(0xEDF4),(0xEDF5),(0xEDF6),(0xEDF7),
+(0xEDF8),(0xEDF9),(0xEDFA),(0xEDFB),(0xEDFC),
+(0xEE40),(0xEE41),(0xEE42),(0xEE43),(0xEE44),(0xEE45),(0xEE46),(0xEE47),
+(0xEE48),(0xEE49),(0xEE4A),(0xEE4B),(0xEE4C),(0xEE4D),(0xEE4E),(0xEE4F),
+(0xEE50),(0xEE51),(0xEE52),(0xEE53),(0xEE54),(0xEE55),(0xEE56),(0xEE57),
+(0xEE58),(0xEE59),(0xEE5A),(0xEE5B),(0xEE5C),(0xEE5D),(0xEE5E),(0xEE5F),
+(0xEE60),(0xEE61),(0xEE62),(0xEE63),(0xEE64),(0xEE65),(0xEE66),(0xEE67),
+(0xEE68),(0xEE69),(0xEE6A),(0xEE6B),(0xEE6C),(0xEE6D),(0xEE6E),(0xEE6F),
+(0xEE70),(0xEE71),(0xEE72),(0xEE73),(0xEE74),(0xEE75),(0xEE76),(0xEE77),
+(0xEE78),(0xEE79),(0xEE7A),(0xEE7B),(0xEE7C),(0xEE7D),(0xEE7E),
+(0xEE80),(0xEE81),(0xEE82),(0xEE83),(0xEE84),(0xEE85),(0xEE86),(0xEE87),
+(0xEE88),(0xEE89),(0xEE8A),(0xEE8B),(0xEE8C),(0xEE8D),(0xEE8E),(0xEE8F),
+(0xEE90),(0xEE91),(0xEE92),(0xEE93),(0xEE94),(0xEE95),(0xEE96),(0xEE97),
+(0xEE98),(0xEE99),(0xEE9A),(0xEE9B),(0xEE9C),(0xEE9D),(0xEE9E),(0xEE9F),
+(0xEEA0),(0xEEA1),(0xEEA2),(0xEEA3),(0xEEA4),(0xEEA5),(0xEEA6),(0xEEA7),
+(0xEEA8),(0xEEA9),(0xEEAA),(0xEEAB),(0xEEAC),(0xEEAD),(0xEEAE),(0xEEAF),
+(0xEEB0),(0xEEB1),(0xEEB2),(0xEEB3),(0xEEB4),(0xEEB5),(0xEEB6),(0xEEB7),
+(0xEEB8),(0xEEB9),(0xEEBA),(0xEEBB),(0xEEBC),(0xEEBD),(0xEEBE),(0xEEBF),
+(0xEEC0),(0xEEC1),(0xEEC2),(0xEEC3),(0xEEC4),(0xEEC5),(0xEEC6),(0xEEC7),
+(0xEEC8),(0xEEC9),(0xEECA),(0xEECB),(0xEECC),(0xEECD),(0xEECE),(0xEECF),
+(0xEED0),(0xEED1),(0xEED2),(0xEED3),(0xEED4),(0xEED5),(0xEED6),(0xEED7),
+(0xEED8),(0xEED9),(0xEEDA),(0xEEDB),(0xEEDC),(0xEEDD),(0xEEDE),(0xEEDF),
+(0xEEE0),(0xEEE1),(0xEEE2),(0xEEE3),(0xEEE4),(0xEEE5),(0xEEE6),(0xEEE7),
+(0xEEE8),(0xEEE9),(0xEEEA),(0xEEEB),(0xEEEC),(0xEEEF),
+(0xEEF0),(0xEEF1),(0xEEF2),(0xEEF3),(0xEEF4),(0xEEF5),(0xEEF6),(0xEEF7),
+(0xEEF8),(0xEEF9),(0xEEFA),(0xEEFB),(0xEEFC);
+INSERT INTO t1 VALUES
+(0xFA40),(0xFA41),(0xFA42),(0xFA43),(0xFA44),(0xFA45),(0xFA46),(0xFA47),
+(0xFA48),(0xFA49),(0xFA4A),(0xFA4B),(0xFA4C),(0xFA4D),(0xFA4E),(0xFA4F),
+(0xFA50),(0xFA51),(0xFA52),(0xFA53),(0xFA54),(0xFA55),(0xFA56),(0xFA57),
+(0xFA58),(0xFA59),(0xFA5A),(0xFA5B),(0xFA5C),(0xFA5D),(0xFA5E),(0xFA5F),
+(0xFA60),(0xFA61),(0xFA62),(0xFA63),(0xFA64),(0xFA65),(0xFA66),(0xFA67),
+(0xFA68),(0xFA69),(0xFA6A),(0xFA6B),(0xFA6C),(0xFA6D),(0xFA6E),(0xFA6F),
+(0xFA70),(0xFA71),(0xFA72),(0xFA73),(0xFA74),(0xFA75),(0xFA76),(0xFA77),
+(0xFA78),(0xFA79),(0xFA7A),(0xFA7B),(0xFA7C),(0xFA7D),(0xFA7E),
+(0xFA80),(0xFA81),(0xFA82),(0xFA83),(0xFA84),(0xFA85),(0xFA86),(0xFA87),
+(0xFA88),(0xFA89),(0xFA8A),(0xFA8B),(0xFA8C),(0xFA8D),(0xFA8E),(0xFA8F),
+(0xFA90),(0xFA91),(0xFA92),(0xFA93),(0xFA94),(0xFA95),(0xFA96),(0xFA97),
+(0xFA98),(0xFA99),(0xFA9A),(0xFA9B),(0xFA9C),(0xFA9D),(0xFA9E),(0xFA9F),
+(0xFAA0),(0xFAA1),(0xFAA2),(0xFAA3),(0xFAA4),(0xFAA5),(0xFAA6),(0xFAA7),
+(0xFAA8),(0xFAA9),(0xFAAA),(0xFAAB),(0xFAAC),(0xFAAD),(0xFAAE),(0xFAAF),
+(0xFAB0),(0xFAB1),(0xFAB2),(0xFAB3),(0xFAB4),(0xFAB5),(0xFAB6),(0xFAB7),
+(0xFAB8),(0xFAB9),(0xFABA),(0xFABB),(0xFABC),(0xFABD),(0xFABE),(0xFABF),
+(0xFAC0),(0xFAC1),(0xFAC2),(0xFAC3),(0xFAC4),(0xFAC5),(0xFAC6),(0xFAC7),
+(0xFAC8),(0xFAC9),(0xFACA),(0xFACB),(0xFACC),(0xFACD),(0xFACE),(0xFACF),
+(0xFAD0),(0xFAD1),(0xFAD2),(0xFAD3),(0xFAD4),(0xFAD5),(0xFAD6),(0xFAD7),
+(0xFAD8),(0xFAD9),(0xFADA),(0xFADB),(0xFADC),(0xFADD),(0xFADE),(0xFADF),
+(0xFAE0),(0xFAE1),(0xFAE2),(0xFAE3),(0xFAE4),(0xFAE5),(0xFAE6),(0xFAE7),
+(0xFAE8),(0xFAE9),(0xFAEA),(0xFAEB),(0xFAEC),(0xFAED),(0xFAEE),(0xFAEF),
+(0xFAF0),(0xFAF1),(0xFAF2),(0xFAF3),(0xFAF4),(0xFAF5),(0xFAF6),(0xFAF7),
+(0xFAF8),(0xFAF9),(0xFAFA),(0xFAFB),(0xFAFC),
+(0xFB40),(0xFB41),(0xFB42),(0xFB43),(0xFB44),(0xFB45),(0xFB46),(0xFB47),
+(0xFB48),(0xFB49),(0xFB4A),(0xFB4B),(0xFB4C),(0xFB4D),(0xFB4E),(0xFB4F),
+(0xFB50),(0xFB51),(0xFB52),(0xFB53),(0xFB54),(0xFB55),(0xFB56),(0xFB57),
+(0xFB58),(0xFB59),(0xFB5A),(0xFB5B),(0xFB5C),(0xFB5D),(0xFB5E),(0xFB5F),
+(0xFB60),(0xFB61),(0xFB62),(0xFB63),(0xFB64),(0xFB65),(0xFB66),(0xFB67),
+(0xFB68),(0xFB69),(0xFB6A),(0xFB6B),(0xFB6C),(0xFB6D),(0xFB6E),(0xFB6F),
+(0xFB70),(0xFB71),(0xFB72),(0xFB73),(0xFB74),(0xFB75),(0xFB76),(0xFB77),
+(0xFB78),(0xFB79),(0xFB7A),(0xFB7B),(0xFB7C),(0xFB7D),(0xFB7E),
+(0xFB80),(0xFB81),(0xFB82),(0xFB83),(0xFB84),(0xFB85),(0xFB86),(0xFB87),
+(0xFB88),(0xFB89),(0xFB8A),(0xFB8B),(0xFB8C),(0xFB8D),(0xFB8E),(0xFB8F),
+(0xFB90),(0xFB91),(0xFB92),(0xFB93),(0xFB94),(0xFB95),(0xFB96),(0xFB97),
+(0xFB98),(0xFB99),(0xFB9A),(0xFB9B),(0xFB9C),(0xFB9D),(0xFB9E),(0xFB9F),
+(0xFBA0),(0xFBA1),(0xFBA2),(0xFBA3),(0xFBA4),(0xFBA5),(0xFBA6),(0xFBA7),
+(0xFBA8),(0xFBA9),(0xFBAA),(0xFBAB),(0xFBAC),(0xFBAD),(0xFBAE),(0xFBAF),
+(0xFBB0),(0xFBB1),(0xFBB2),(0xFBB3),(0xFBB4),(0xFBB5),(0xFBB6),(0xFBB7),
+(0xFBB8),(0xFBB9),(0xFBBA),(0xFBBB),(0xFBBC),(0xFBBD),(0xFBBE),(0xFBBF),
+(0xFBC0),(0xFBC1),(0xFBC2),(0xFBC3),(0xFBC4),(0xFBC5),(0xFBC6),(0xFBC7),
+(0xFBC8),(0xFBC9),(0xFBCA),(0xFBCB),(0xFBCC),(0xFBCD),(0xFBCE),(0xFBCF),
+(0xFBD0),(0xFBD1),(0xFBD2),(0xFBD3),(0xFBD4),(0xFBD5),(0xFBD6),(0xFBD7),
+(0xFBD8),(0xFBD9),(0xFBDA),(0xFBDB),(0xFBDC),(0xFBDD),(0xFBDE),(0xFBDF),
+(0xFBE0),(0xFBE1),(0xFBE2),(0xFBE3),(0xFBE4),(0xFBE5),(0xFBE6),(0xFBE7),
+(0xFBE8),(0xFBE9),(0xFBEA),(0xFBEB),(0xFBEC),(0xFBED),(0xFBEE),(0xFBEF),
+(0xFBF0),(0xFBF1),(0xFBF2),(0xFBF3),(0xFBF4),(0xFBF5),(0xFBF6),(0xFBF7),
+(0xFBF8),(0xFBF9),(0xFBFA),(0xFBFB),(0xFBFC),
+(0xFC40),(0xFC41),(0xFC42),(0xFC43),(0xFC44),(0xFC45),(0xFC46),(0xFC47),
+(0xFC48),(0xFC49),(0xFC4A),(0xFC4B);
+INSERT INTO t1 VALUES
+(0xF040),(0xF041),(0xF042),(0xF043),(0xF044),(0xF045),(0xF046),(0xF047),
+(0xF048),(0xF049),(0xF04A),(0xF04B),(0xF04C),(0xF04D),(0xF04E),(0xF04F),
+(0xF050),(0xF051),(0xF052),(0xF053),(0xF054),(0xF055),(0xF056),(0xF057),
+(0xF058),(0xF059),(0xF05A),(0xF05B),(0xF05C),(0xF05D),(0xF05E),(0xF05F),
+(0xF060),(0xF061),(0xF062),(0xF063),(0xF064),(0xF065),(0xF066),(0xF067),
+(0xF068),(0xF069),(0xF06A),(0xF06B),(0xF06C),(0xF06D),(0xF06E),(0xF06F),
+(0xF070),(0xF071),(0xF072),(0xF073),(0xF074),(0xF075),(0xF076),(0xF077),
+(0xF078),(0xF079),(0xF07A),(0xF07B),(0xF07C),(0xF07D),(0xF07E),
+(0xF080),(0xF081),(0xF082),(0xF083),(0xF084),(0xF085),(0xF086),(0xF087),
+(0xF088),(0xF089),(0xF08A),(0xF08B),(0xF08C),(0xF08D),(0xF08E),(0xF08F),
+(0xF090),(0xF091),(0xF092),(0xF093),(0xF094),(0xF095),(0xF096),(0xF097),
+(0xF098),(0xF099),(0xF09A),(0xF09B),(0xF09C),(0xF09D),(0xF09E),(0xF09F),
+(0xF0A0),(0xF0A1),(0xF0A2),(0xF0A3),(0xF0A4),(0xF0A5),(0xF0A6),(0xF0A7),
+(0xF0A8),(0xF0A9),(0xF0AA),(0xF0AB),(0xF0AC),(0xF0AD),(0xF0AE),(0xF0AF),
+(0xF0B0),(0xF0B1),(0xF0B2),(0xF0B3),(0xF0B4),(0xF0B5),(0xF0B6),(0xF0B7),
+(0xF0B8),(0xF0B9),(0xF0BA),(0xF0BB),(0xF0BC),(0xF0BD),(0xF0BE),(0xF0BF),
+(0xF0C0),(0xF0C1),(0xF0C2),(0xF0C3),(0xF0C4),(0xF0C5),(0xF0C6),(0xF0C7),
+(0xF0C8),(0xF0C9),(0xF0CA),(0xF0CB),(0xF0CC),(0xF0CD),(0xF0CE),(0xF0CF),
+(0xF0D0),(0xF0D1),(0xF0D2),(0xF0D3),(0xF0D4),(0xF0D5),(0xF0D6),(0xF0D7),
+(0xF0D8),(0xF0D9),(0xF0DA),(0xF0DB),(0xF0DC),(0xF0DD),(0xF0DE),(0xF0DF),
+(0xF0E0),(0xF0E1),(0xF0E2),(0xF0E3),(0xF0E4),(0xF0E5),(0xF0E6),(0xF0E7),
+(0xF0E8),(0xF0E9),(0xF0EA),(0xF0EB),(0xF0EC),(0xF0ED),(0xF0EE),(0xF0EF),
+(0xF0F0),(0xF0F1),(0xF0F2),(0xF0F3),(0xF0F4),(0xF0F5),(0xF0F6),(0xF0F7),
+(0xF0F8),(0xF0F9),(0xF0FA),(0xF0FB),(0xF0FC),
+(0xF140),(0xF141),(0xF142),(0xF143),(0xF144),(0xF145),(0xF146),(0xF147),
+(0xF148),(0xF149),(0xF14A),(0xF14B),(0xF14C),(0xF14D),(0xF14E),(0xF14F),
+(0xF150),(0xF151),(0xF152),(0xF153),(0xF154),(0xF155),(0xF156),(0xF157),
+(0xF158),(0xF159),(0xF15A),(0xF15B),(0xF15C),(0xF15D),(0xF15E),(0xF15F),
+(0xF160),(0xF161),(0xF162),(0xF163),(0xF164),(0xF165),(0xF166),(0xF167),
+(0xF168),(0xF169),(0xF16A),(0xF16B),(0xF16C),(0xF16D),(0xF16E),(0xF16F),
+(0xF170),(0xF171),(0xF172),(0xF173),(0xF174),(0xF175),(0xF176),(0xF177),
+(0xF178),(0xF179),(0xF17A),(0xF17B),(0xF17C),(0xF17D),(0xF17E),
+(0xF180),(0xF181),(0xF182),(0xF183),(0xF184),(0xF185),(0xF186),(0xF187),
+(0xF188),(0xF189),(0xF18A),(0xF18B),(0xF18C),(0xF18D),(0xF18E),(0xF18F),
+(0xF190),(0xF191),(0xF192),(0xF193),(0xF194),(0xF195),(0xF196),(0xF197),
+(0xF198),(0xF199),(0xF19A),(0xF19B),(0xF19C),(0xF19D),(0xF19E),(0xF19F),
+(0xF1A0),(0xF1A1),(0xF1A2),(0xF1A3),(0xF1A4),(0xF1A5),(0xF1A6),(0xF1A7),
+(0xF1A8),(0xF1A9),(0xF1AA),(0xF1AB),(0xF1AC),(0xF1AD),(0xF1AE),(0xF1AF),
+(0xF1B0),(0xF1B1),(0xF1B2),(0xF1B3),(0xF1B4),(0xF1B5),(0xF1B6),(0xF1B7),
+(0xF1B8),(0xF1B9),(0xF1BA),(0xF1BB),(0xF1BC),(0xF1BD),(0xF1BE),(0xF1BF),
+(0xF1C0),(0xF1C1),(0xF1C2),(0xF1C3),(0xF1C4),(0xF1C5),(0xF1C6),(0xF1C7),
+(0xF1C8),(0xF1C9),(0xF1CA),(0xF1CB),(0xF1CC),(0xF1CD),(0xF1CE),(0xF1CF),
+(0xF1D0),(0xF1D1),(0xF1D2),(0xF1D3),(0xF1D4),(0xF1D5),(0xF1D6),(0xF1D7),
+(0xF1D8),(0xF1D9),(0xF1DA),(0xF1DB),(0xF1DC),(0xF1DD),(0xF1DE),(0xF1DF),
+(0xF1E0),(0xF1E1),(0xF1E2),(0xF1E3),(0xF1E4),(0xF1E5),(0xF1E6),(0xF1E7),
+(0xF1E8),(0xF1E9),(0xF1EA),(0xF1EB),(0xF1EC),(0xF1ED),(0xF1EE),(0xF1EF),
+(0xF1F0),(0xF1F1),(0xF1F2),(0xF1F3),(0xF1F4),(0xF1F5),(0xF1F6),(0xF1F7),
+(0xF1F8),(0xF1F9),(0xF1FA),(0xF1FB),(0xF1FC),
+(0xF240),(0xF241),(0xF242),(0xF243),(0xF244),(0xF245),(0xF246),(0xF247),
+(0xF248),(0xF249),(0xF24A),(0xF24B),(0xF24C),(0xF24D),(0xF24E),(0xF24F),
+(0xF250),(0xF251),(0xF252),(0xF253),(0xF254),(0xF255),(0xF256),(0xF257),
+(0xF258),(0xF259),(0xF25A),(0xF25B),(0xF25C),(0xF25D),(0xF25E),(0xF25F),
+(0xF260),(0xF261),(0xF262),(0xF263),(0xF264),(0xF265),(0xF266),(0xF267),
+(0xF268),(0xF269),(0xF26A),(0xF26B),(0xF26C),(0xF26D),(0xF26E),(0xF26F),
+(0xF270),(0xF271),(0xF272),(0xF273),(0xF274),(0xF275),(0xF276),(0xF277),
+(0xF278),(0xF279),(0xF27A),(0xF27B),(0xF27C),(0xF27D),(0xF27E),
+(0xF280),(0xF281),(0xF282),(0xF283),(0xF284),(0xF285),(0xF286),(0xF287),
+(0xF288),(0xF289),(0xF28A),(0xF28B),(0xF28C),(0xF28D),(0xF28E),(0xF28F),
+(0xF290),(0xF291),(0xF292),(0xF293),(0xF294),(0xF295),(0xF296),(0xF297),
+(0xF298),(0xF299),(0xF29A),(0xF29B),(0xF29C),(0xF29D),(0xF29E),(0xF29F),
+(0xF2A0),(0xF2A1),(0xF2A2),(0xF2A3),(0xF2A4),(0xF2A5),(0xF2A6),(0xF2A7),
+(0xF2A8),(0xF2A9),(0xF2AA),(0xF2AB),(0xF2AC),(0xF2AD),(0xF2AE),(0xF2AF),
+(0xF2B0),(0xF2B1),(0xF2B2),(0xF2B3),(0xF2B4),(0xF2B5),(0xF2B6),(0xF2B7),
+(0xF2B8),(0xF2B9),(0xF2BA),(0xF2BB),(0xF2BC),(0xF2BD),(0xF2BE),(0xF2BF),
+(0xF2C0),(0xF2C1),(0xF2C2),(0xF2C3),(0xF2C4),(0xF2C5),(0xF2C6),(0xF2C7),
+(0xF2C8),(0xF2C9),(0xF2CA),(0xF2CB),(0xF2CC),(0xF2CD),(0xF2CE),(0xF2CF),
+(0xF2D0),(0xF2D1),(0xF2D2),(0xF2D3),(0xF2D4),(0xF2D5),(0xF2D6),(0xF2D7),
+(0xF2D8),(0xF2D9),(0xF2DA),(0xF2DB),(0xF2DC),(0xF2DD),(0xF2DE),(0xF2DF),
+(0xF2E0),(0xF2E1),(0xF2E2),(0xF2E3),(0xF2E4),(0xF2E5),(0xF2E6),(0xF2E7),
+(0xF2E8),(0xF2E9),(0xF2EA),(0xF2EB),(0xF2EC),(0xF2ED),(0xF2EE),(0xF2EF),
+(0xF2F0),(0xF2F1),(0xF2F2),(0xF2F3),(0xF2F4),(0xF2F5),(0xF2F6),(0xF2F7),
+(0xF2F8),(0xF2F9),(0xF2FA),(0xF2FB),(0xF2FC),
+(0xF340),(0xF341),(0xF342),(0xF343),(0xF344),(0xF345),(0xF346),(0xF347),
+(0xF348),(0xF349),(0xF34A),(0xF34B),(0xF34C),(0xF34D),(0xF34E),(0xF34F),
+(0xF350),(0xF351),(0xF352),(0xF353),(0xF354),(0xF355),(0xF356),(0xF357),
+(0xF358),(0xF359),(0xF35A),(0xF35B),(0xF35C),(0xF35D),(0xF35E),(0xF35F),
+(0xF360),(0xF361),(0xF362),(0xF363),(0xF364),(0xF365),(0xF366),(0xF367),
+(0xF368),(0xF369),(0xF36A),(0xF36B),(0xF36C),(0xF36D),(0xF36E),(0xF36F),
+(0xF370),(0xF371),(0xF372),(0xF373),(0xF374),(0xF375),(0xF376),(0xF377),
+(0xF378),(0xF379),(0xF37A),(0xF37B),(0xF37C),(0xF37D),(0xF37E),
+(0xF380),(0xF381),(0xF382),(0xF383),(0xF384),(0xF385),(0xF386),(0xF387),
+(0xF388),(0xF389),(0xF38A),(0xF38B),(0xF38C),(0xF38D),(0xF38E),(0xF38F),
+(0xF390),(0xF391),(0xF392),(0xF393),(0xF394),(0xF395),(0xF396),(0xF397),
+(0xF398),(0xF399),(0xF39A),(0xF39B),(0xF39C),(0xF39D),(0xF39E),(0xF39F),
+(0xF3A0),(0xF3A1),(0xF3A2),(0xF3A3),(0xF3A4),(0xF3A5),(0xF3A6),(0xF3A7),
+(0xF3A8),(0xF3A9),(0xF3AA),(0xF3AB),(0xF3AC),(0xF3AD),(0xF3AE),(0xF3AF),
+(0xF3B0),(0xF3B1),(0xF3B2),(0xF3B3),(0xF3B4),(0xF3B5),(0xF3B6),(0xF3B7),
+(0xF3B8),(0xF3B9),(0xF3BA),(0xF3BB),(0xF3BC),(0xF3BD),(0xF3BE),(0xF3BF),
+(0xF3C0),(0xF3C1),(0xF3C2),(0xF3C3),(0xF3C4),(0xF3C5),(0xF3C6),(0xF3C7),
+(0xF3C8),(0xF3C9),(0xF3CA),(0xF3CB),(0xF3CC),(0xF3CD),(0xF3CE),(0xF3CF),
+(0xF3D0),(0xF3D1),(0xF3D2),(0xF3D3),(0xF3D4),(0xF3D5),(0xF3D6),(0xF3D7),
+(0xF3D8),(0xF3D9),(0xF3DA),(0xF3DB),(0xF3DC),(0xF3DD),(0xF3DE),(0xF3DF),
+(0xF3E0),(0xF3E1),(0xF3E2),(0xF3E3),(0xF3E4),(0xF3E5),(0xF3E6),(0xF3E7),
+(0xF3E8),(0xF3E9),(0xF3EA),(0xF3EB),(0xF3EC),(0xF3ED),(0xF3EE),(0xF3EF),
+(0xF3F0),(0xF3F1),(0xF3F2),(0xF3F3),(0xF3F4),(0xF3F5),(0xF3F6),(0xF3F7),
+(0xF3F8),(0xF3F9),(0xF3FA),(0xF3FB),(0xF3FC),
+(0xF440),(0xF441),(0xF442),(0xF443),(0xF444),(0xF445),(0xF446),(0xF447),
+(0xF448),(0xF449),(0xF44A),(0xF44B),(0xF44C),(0xF44D),(0xF44E),(0xF44F),
+(0xF450),(0xF451),(0xF452),(0xF453),(0xF454),(0xF455),(0xF456),(0xF457),
+(0xF458),(0xF459),(0xF45A),(0xF45B),(0xF45C),(0xF45D),(0xF45E),(0xF45F),
+(0xF460),(0xF461),(0xF462),(0xF463),(0xF464),(0xF465),(0xF466),(0xF467),
+(0xF468),(0xF469),(0xF46A),(0xF46B),(0xF46C),(0xF46D),(0xF46E),(0xF46F),
+(0xF470),(0xF471),(0xF472),(0xF473),(0xF474),(0xF475),(0xF476),(0xF477),
+(0xF478),(0xF479),(0xF47A),(0xF47B),(0xF47C),(0xF47D),(0xF47E),
+(0xF480),(0xF481),(0xF482),(0xF483),(0xF484),(0xF485),(0xF486),(0xF487),
+(0xF488),(0xF489),(0xF48A),(0xF48B),(0xF48C),(0xF48D),(0xF48E),(0xF48F),
+(0xF490),(0xF491),(0xF492),(0xF493),(0xF494),(0xF495),(0xF496),(0xF497),
+(0xF498),(0xF499),(0xF49A),(0xF49B),(0xF49C),(0xF49D),(0xF49E),(0xF49F),
+(0xF4A0),(0xF4A1),(0xF4A2),(0xF4A3),(0xF4A4),(0xF4A5),(0xF4A6),(0xF4A7),
+(0xF4A8),(0xF4A9),(0xF4AA),(0xF4AB),(0xF4AC),(0xF4AD),(0xF4AE),(0xF4AF),
+(0xF4B0),(0xF4B1),(0xF4B2),(0xF4B3),(0xF4B4),(0xF4B5),(0xF4B6),(0xF4B7),
+(0xF4B8),(0xF4B9),(0xF4BA),(0xF4BB),(0xF4BC),(0xF4BD),(0xF4BE),(0xF4BF),
+(0xF4C0),(0xF4C1),(0xF4C2),(0xF4C3),(0xF4C4),(0xF4C5),(0xF4C6),(0xF4C7),
+(0xF4C8),(0xF4C9),(0xF4CA),(0xF4CB),(0xF4CC),(0xF4CD),(0xF4CE),(0xF4CF),
+(0xF4D0),(0xF4D1),(0xF4D2),(0xF4D3),(0xF4D4),(0xF4D5),(0xF4D6),(0xF4D7),
+(0xF4D8),(0xF4D9),(0xF4DA),(0xF4DB),(0xF4DC),(0xF4DD),(0xF4DE),(0xF4DF),
+(0xF4E0),(0xF4E1),(0xF4E2),(0xF4E3),(0xF4E4),(0xF4E5),(0xF4E6),(0xF4E7),
+(0xF4E8),(0xF4E9),(0xF4EA),(0xF4EB),(0xF4EC),(0xF4ED),(0xF4EE),(0xF4EF),
+(0xF4F0),(0xF4F1),(0xF4F2),(0xF4F3),(0xF4F4),(0xF4F5),(0xF4F6),(0xF4F7),
+(0xF4F8),(0xF4F9),(0xF4FA),(0xF4FB),(0xF4FC),
+(0xF540),(0xF541),(0xF542),(0xF543),(0xF544),(0xF545),(0xF546),(0xF547),
+(0xF548),(0xF549),(0xF54A),(0xF54B),(0xF54C),(0xF54D),(0xF54E),(0xF54F),
+(0xF550),(0xF551),(0xF552),(0xF553),(0xF554),(0xF555),(0xF556),(0xF557),
+(0xF558),(0xF559),(0xF55A),(0xF55B),(0xF55C),(0xF55D),(0xF55E),(0xF55F),
+(0xF560),(0xF561),(0xF562),(0xF563),(0xF564),(0xF565),(0xF566),(0xF567),
+(0xF568),(0xF569),(0xF56A),(0xF56B),(0xF56C),(0xF56D),(0xF56E),(0xF56F),
+(0xF570),(0xF571),(0xF572),(0xF573),(0xF574),(0xF575),(0xF576),(0xF577),
+(0xF578),(0xF579),(0xF57A),(0xF57B),(0xF57C),(0xF57D),(0xF57E),
+(0xF580),(0xF581),(0xF582),(0xF583),(0xF584),(0xF585),(0xF586),(0xF587),
+(0xF588),(0xF589),(0xF58A),(0xF58B),(0xF58C),(0xF58D),(0xF58E),(0xF58F),
+(0xF590),(0xF591),(0xF592),(0xF593),(0xF594),(0xF595),(0xF596),(0xF597),
+(0xF598),(0xF599),(0xF59A),(0xF59B),(0xF59C),(0xF59D),(0xF59E),(0xF59F),
+(0xF5A0),(0xF5A1),(0xF5A2),(0xF5A3),(0xF5A4),(0xF5A5),(0xF5A6),(0xF5A7),
+(0xF5A8),(0xF5A9),(0xF5AA),(0xF5AB),(0xF5AC),(0xF5AD),(0xF5AE),(0xF5AF),
+(0xF5B0),(0xF5B1),(0xF5B2),(0xF5B3),(0xF5B4),(0xF5B5),(0xF5B6),(0xF5B7),
+(0xF5B8),(0xF5B9),(0xF5BA),(0xF5BB),(0xF5BC),(0xF5BD),(0xF5BE),(0xF5BF),
+(0xF5C0),(0xF5C1),(0xF5C2),(0xF5C3),(0xF5C4),(0xF5C5),(0xF5C6),(0xF5C7),
+(0xF5C8),(0xF5C9),(0xF5CA),(0xF5CB),(0xF5CC),(0xF5CD),(0xF5CE),(0xF5CF),
+(0xF5D0),(0xF5D1),(0xF5D2),(0xF5D3),(0xF5D4),(0xF5D5),(0xF5D6),(0xF5D7),
+(0xF5D8),(0xF5D9),(0xF5DA),(0xF5DB),(0xF5DC),(0xF5DD),(0xF5DE),(0xF5DF),
+(0xF5E0),(0xF5E1),(0xF5E2),(0xF5E3),(0xF5E4),(0xF5E5),(0xF5E6),(0xF5E7),
+(0xF5E8),(0xF5E9),(0xF5EA),(0xF5EB),(0xF5EC),(0xF5ED),(0xF5EE),(0xF5EF),
+(0xF5F0),(0xF5F1),(0xF5F2),(0xF5F3),(0xF5F4),(0xF5F5),(0xF5F6),(0xF5F7),
+(0xF5F8),(0xF5F9),(0xF5FA),(0xF5FB),(0xF5FC),
+(0xF640),(0xF641),(0xF642),(0xF643),(0xF644),(0xF645),(0xF646),(0xF647),
+(0xF648),(0xF649),(0xF64A),(0xF64B),(0xF64C),(0xF64D),(0xF64E),(0xF64F),
+(0xF650),(0xF651),(0xF652),(0xF653),(0xF654),(0xF655),(0xF656),(0xF657),
+(0xF658),(0xF659),(0xF65A),(0xF65B),(0xF65C),(0xF65D),(0xF65E),(0xF65F),
+(0xF660),(0xF661),(0xF662),(0xF663),(0xF664),(0xF665),(0xF666),(0xF667),
+(0xF668),(0xF669),(0xF66A),(0xF66B),(0xF66C),(0xF66D),(0xF66E),(0xF66F),
+(0xF670),(0xF671),(0xF672),(0xF673),(0xF674),(0xF675),(0xF676),(0xF677),
+(0xF678),(0xF679),(0xF67A),(0xF67B),(0xF67C),(0xF67D),(0xF67E),
+(0xF680),(0xF681),(0xF682),(0xF683),(0xF684),(0xF685),(0xF686),(0xF687),
+(0xF688),(0xF689),(0xF68A),(0xF68B),(0xF68C),(0xF68D),(0xF68E),(0xF68F),
+(0xF690),(0xF691),(0xF692),(0xF693),(0xF694),(0xF695),(0xF696),(0xF697),
+(0xF698),(0xF699),(0xF69A),(0xF69B),(0xF69C),(0xF69D),(0xF69E),(0xF69F),
+(0xF6A0),(0xF6A1),(0xF6A2),(0xF6A3),(0xF6A4),(0xF6A5),(0xF6A6),(0xF6A7),
+(0xF6A8),(0xF6A9),(0xF6AA),(0xF6AB),(0xF6AC),(0xF6AD),(0xF6AE),(0xF6AF),
+(0xF6B0),(0xF6B1),(0xF6B2),(0xF6B3),(0xF6B4),(0xF6B5),(0xF6B6),(0xF6B7),
+(0xF6B8),(0xF6B9),(0xF6BA),(0xF6BB),(0xF6BC),(0xF6BD),(0xF6BE),(0xF6BF),
+(0xF6C0),(0xF6C1),(0xF6C2),(0xF6C3),(0xF6C4),(0xF6C5),(0xF6C6),(0xF6C7),
+(0xF6C8),(0xF6C9),(0xF6CA),(0xF6CB),(0xF6CC),(0xF6CD),(0xF6CE),(0xF6CF),
+(0xF6D0),(0xF6D1),(0xF6D2),(0xF6D3),(0xF6D4),(0xF6D5),(0xF6D6),(0xF6D7),
+(0xF6D8),(0xF6D9),(0xF6DA),(0xF6DB),(0xF6DC),(0xF6DD),(0xF6DE),(0xF6DF),
+(0xF6E0),(0xF6E1),(0xF6E2),(0xF6E3),(0xF6E4),(0xF6E5),(0xF6E6),(0xF6E7),
+(0xF6E8),(0xF6E9),(0xF6EA),(0xF6EB),(0xF6EC),(0xF6ED),(0xF6EE),(0xF6EF),
+(0xF6F0),(0xF6F1),(0xF6F2),(0xF6F3),(0xF6F4),(0xF6F5),(0xF6F6),(0xF6F7),
+(0xF6F8),(0xF6F9),(0xF6FA),(0xF6FB),(0xF6FC),
+(0xF740),(0xF741),(0xF742),(0xF743),(0xF744),(0xF745),(0xF746),(0xF747),
+(0xF748),(0xF749),(0xF74A),(0xF74B),(0xF74C),(0xF74D),(0xF74E),(0xF74F),
+(0xF750),(0xF751),(0xF752),(0xF753),(0xF754),(0xF755),(0xF756),(0xF757),
+(0xF758),(0xF759),(0xF75A),(0xF75B),(0xF75C),(0xF75D),(0xF75E),(0xF75F),
+(0xF760),(0xF761),(0xF762),(0xF763),(0xF764),(0xF765),(0xF766),(0xF767),
+(0xF768),(0xF769),(0xF76A),(0xF76B),(0xF76C),(0xF76D),(0xF76E),(0xF76F),
+(0xF770),(0xF771),(0xF772),(0xF773),(0xF774),(0xF775),(0xF776),(0xF777),
+(0xF778),(0xF779),(0xF77A),(0xF77B),(0xF77C),(0xF77D),(0xF77E),
+(0xF780),(0xF781),(0xF782),(0xF783),(0xF784),(0xF785),(0xF786),(0xF787),
+(0xF788),(0xF789),(0xF78A),(0xF78B),(0xF78C),(0xF78D),(0xF78E),(0xF78F),
+(0xF790),(0xF791),(0xF792),(0xF793),(0xF794),(0xF795),(0xF796),(0xF797),
+(0xF798),(0xF799),(0xF79A),(0xF79B),(0xF79C),(0xF79D),(0xF79E),(0xF79F),
+(0xF7A0),(0xF7A1),(0xF7A2),(0xF7A3),(0xF7A4),(0xF7A5),(0xF7A6),(0xF7A7),
+(0xF7A8),(0xF7A9),(0xF7AA),(0xF7AB),(0xF7AC),(0xF7AD),(0xF7AE),(0xF7AF),
+(0xF7B0),(0xF7B1),(0xF7B2),(0xF7B3),(0xF7B4),(0xF7B5),(0xF7B6),(0xF7B7),
+(0xF7B8),(0xF7B9),(0xF7BA),(0xF7BB),(0xF7BC),(0xF7BD),(0xF7BE),(0xF7BF),
+(0xF7C0),(0xF7C1),(0xF7C2),(0xF7C3),(0xF7C4),(0xF7C5),(0xF7C6),(0xF7C7),
+(0xF7C8),(0xF7C9),(0xF7CA),(0xF7CB),(0xF7CC),(0xF7CD),(0xF7CE),(0xF7CF),
+(0xF7D0),(0xF7D1),(0xF7D2),(0xF7D3),(0xF7D4),(0xF7D5),(0xF7D6),(0xF7D7),
+(0xF7D8),(0xF7D9),(0xF7DA),(0xF7DB),(0xF7DC),(0xF7DD),(0xF7DE),(0xF7DF),
+(0xF7E0),(0xF7E1),(0xF7E2),(0xF7E3),(0xF7E4),(0xF7E5),(0xF7E6),(0xF7E7),
+(0xF7E8),(0xF7E9),(0xF7EA),(0xF7EB),(0xF7EC),(0xF7ED),(0xF7EE),(0xF7EF),
+(0xF7F0),(0xF7F1),(0xF7F2),(0xF7F3),(0xF7F4),(0xF7F5),(0xF7F6),(0xF7F7),
+(0xF7F8),(0xF7F9),(0xF7FA),(0xF7FB),(0xF7FC),
+(0xF840),(0xF841),(0xF842),(0xF843),(0xF844),(0xF845),(0xF846),(0xF847),
+(0xF848),(0xF849),(0xF84A),(0xF84B),(0xF84C),(0xF84D),(0xF84E),(0xF84F),
+(0xF850),(0xF851),(0xF852),(0xF853),(0xF854),(0xF855),(0xF856),(0xF857),
+(0xF858),(0xF859),(0xF85A),(0xF85B),(0xF85C),(0xF85D),(0xF85E),(0xF85F),
+(0xF860),(0xF861),(0xF862),(0xF863),(0xF864),(0xF865),(0xF866),(0xF867),
+(0xF868),(0xF869),(0xF86A),(0xF86B),(0xF86C),(0xF86D),(0xF86E),(0xF86F),
+(0xF870),(0xF871),(0xF872),(0xF873),(0xF874),(0xF875),(0xF876),(0xF877),
+(0xF878),(0xF879),(0xF87A),(0xF87B),(0xF87C),(0xF87D),(0xF87E),
+(0xF880),(0xF881),(0xF882),(0xF883),(0xF884),(0xF885),(0xF886),(0xF887),
+(0xF888),(0xF889),(0xF88A),(0xF88B),(0xF88C),(0xF88D),(0xF88E),(0xF88F),
+(0xF890),(0xF891),(0xF892),(0xF893),(0xF894),(0xF895),(0xF896),(0xF897),
+(0xF898),(0xF899),(0xF89A),(0xF89B),(0xF89C),(0xF89D),(0xF89E),(0xF89F),
+(0xF8A0),(0xF8A1),(0xF8A2),(0xF8A3),(0xF8A4),(0xF8A5),(0xF8A6),(0xF8A7),
+(0xF8A8),(0xF8A9),(0xF8AA),(0xF8AB),(0xF8AC),(0xF8AD),(0xF8AE),(0xF8AF),
+(0xF8B0),(0xF8B1),(0xF8B2),(0xF8B3),(0xF8B4),(0xF8B5),(0xF8B6),(0xF8B7),
+(0xF8B8),(0xF8B9),(0xF8BA),(0xF8BB),(0xF8BC),(0xF8BD),(0xF8BE),(0xF8BF),
+(0xF8C0),(0xF8C1),(0xF8C2),(0xF8C3),(0xF8C4),(0xF8C5),(0xF8C6),(0xF8C7),
+(0xF8C8),(0xF8C9),(0xF8CA),(0xF8CB),(0xF8CC),(0xF8CD),(0xF8CE),(0xF8CF),
+(0xF8D0),(0xF8D1),(0xF8D2),(0xF8D3),(0xF8D4),(0xF8D5),(0xF8D6),(0xF8D7),
+(0xF8D8),(0xF8D9),(0xF8DA),(0xF8DB),(0xF8DC),(0xF8DD),(0xF8DE),(0xF8DF),
+(0xF8E0),(0xF8E1),(0xF8E2),(0xF8E3),(0xF8E4),(0xF8E5),(0xF8E6),(0xF8E7),
+(0xF8E8),(0xF8E9),(0xF8EA),(0xF8EB),(0xF8EC),(0xF8ED),(0xF8EE),(0xF8EF),
+(0xF8F0),(0xF8F1),(0xF8F2),(0xF8F3),(0xF8F4),(0xF8F5),(0xF8F6),(0xF8F7),
+(0xF8F8),(0xF8F9),(0xF8FA),(0xF8FB),(0xF8FC),
+(0xF940),(0xF941),(0xF942),(0xF943),(0xF944),(0xF945),(0xF946),(0xF947),
+(0xF948),(0xF949),(0xF94A),(0xF94B),(0xF94C),(0xF94D),(0xF94E),(0xF94F),
+(0xF950),(0xF951),(0xF952),(0xF953),(0xF954),(0xF955),(0xF956),(0xF957),
+(0xF958),(0xF959),(0xF95A),(0xF95B),(0xF95C),(0xF95D),(0xF95E),(0xF95F),
+(0xF960),(0xF961),(0xF962),(0xF963),(0xF964),(0xF965),(0xF966),(0xF967),
+(0xF968),(0xF969),(0xF96A),(0xF96B),(0xF96C),(0xF96D),(0xF96E),(0xF96F),
+(0xF970),(0xF971),(0xF972),(0xF973),(0xF974),(0xF975),(0xF976),(0xF977),
+(0xF978),(0xF979),(0xF97A),(0xF97B),(0xF97C),(0xF97D),(0xF97E),
+(0xF980),(0xF981),(0xF982),(0xF983),(0xF984),(0xF985),(0xF986),(0xF987),
+(0xF988),(0xF989),(0xF98A),(0xF98B),(0xF98C),(0xF98D),(0xF98E),(0xF98F),
+(0xF990),(0xF991),(0xF992),(0xF993),(0xF994),(0xF995),(0xF996),(0xF997),
+(0xF998),(0xF999),(0xF99A),(0xF99B),(0xF99C),(0xF99D),(0xF99E),(0xF99F),
+(0xF9A0),(0xF9A1),(0xF9A2),(0xF9A3),(0xF9A4),(0xF9A5),(0xF9A6),(0xF9A7),
+(0xF9A8),(0xF9A9),(0xF9AA),(0xF9AB),(0xF9AC),(0xF9AD),(0xF9AE),(0xF9AF),
+(0xF9B0),(0xF9B1),(0xF9B2),(0xF9B3),(0xF9B4),(0xF9B5),(0xF9B6),(0xF9B7),
+(0xF9B8),(0xF9B9),(0xF9BA),(0xF9BB),(0xF9BC),(0xF9BD),(0xF9BE),(0xF9BF),
+(0xF9C0),(0xF9C1),(0xF9C2),(0xF9C3),(0xF9C4),(0xF9C5),(0xF9C6),(0xF9C7),
+(0xF9C8),(0xF9C9),(0xF9CA),(0xF9CB),(0xF9CC),(0xF9CD),(0xF9CE),(0xF9CF),
+(0xF9D0),(0xF9D1),(0xF9D2),(0xF9D3),(0xF9D4),(0xF9D5),(0xF9D6),(0xF9D7),
+(0xF9D8),(0xF9D9),(0xF9DA),(0xF9DB),(0xF9DC),(0xF9DD),(0xF9DE),(0xF9DF),
+(0xF9E0),(0xF9E1),(0xF9E2),(0xF9E3),(0xF9E4),(0xF9E5),(0xF9E6),(0xF9E7),
+(0xF9E8),(0xF9E9),(0xF9EA),(0xF9EB),(0xF9EC),(0xF9ED),(0xF9EE),(0xF9EF),
+(0xF9F0),(0xF9F1),(0xF9F2),(0xF9F3),(0xF9F4),(0xF9F5),(0xF9F6),(0xF9F7),
+(0xF9F8),(0xF9F9),(0xF9FA),(0xF9FB),(0xF9FC);
+SELECT HEX(c1) FROM t1;
+HEX(c1)
+05
+7E
+815C
+815F
+8160
+8161
+817C
+8191
+8192
+81CA
+8740
+8741
+8742
+8743
+8744
+8745
+8746
+8747
+8748
+8749
+874A
+874B
+874C
+874D
+874E
+874F
+8750
+8751
+8752
+8753
+8754
+8755
+8756
+8757
+8758
+8759
+875A
+875B
+875C
+875D
+875F
+8760
+8761
+8762
+8763
+8764
+8765
+8766
+8767
+8768
+8769
+876A
+876B
+876C
+876D
+876E
+876F
+8770
+8771
+8772
+8773
+8774
+8775
+877E
+8780
+8781
+8782
+8783
+8784
+8785
+8786
+8787
+8788
+8789
+878A
+878B
+878C
+878D
+878E
+878F
+8790
+8791
+8792
+8793
+8794
+8795
+8796
+8797
+8798
+8799
+879A
+879B
+879C
+ED40
+ED41
+ED42
+ED43
+ED44
+ED45
+ED46
+ED47
+ED48
+ED49
+ED4A
+ED4B
+ED4C
+ED4D
+ED4E
+ED4F
+ED50
+ED51
+ED52
+ED53
+ED54
+ED55
+ED56
+ED57
+ED58
+ED59
+ED5A
+ED5B
+ED5C
+ED5D
+ED5E
+ED5F
+ED60
+ED61
+ED62
+ED63
+ED64
+ED65
+ED66
+ED67
+ED68
+ED69
+ED6A
+ED6B
+ED6C
+ED6D
+ED6E
+ED6F
+ED70
+ED71
+ED72
+ED73
+ED74
+ED75
+ED76
+ED77
+ED78
+ED79
+ED7A
+ED7B
+ED7C
+ED7D
+ED7E
+ED80
+ED81
+ED82
+ED83
+ED84
+ED85
+ED86
+ED87
+ED88
+ED89
+ED8A
+ED8B
+ED8C
+ED8D
+ED8E
+ED8F
+ED90
+ED91
+ED92
+ED93
+ED94
+ED95
+ED96
+ED97
+ED98
+ED99
+ED9A
+ED9B
+ED9C
+ED9D
+ED9E
+ED9F
+EDA0
+EDA1
+EDA2
+EDA3
+EDA4
+EDA5
+EDA6
+EDA7
+EDA8
+EDA9
+EDAA
+EDAB
+EDAC
+EDAD
+EDAE
+EDAF
+EDB0
+EDB1
+EDB2
+EDB3
+EDB4
+EDB5
+EDB6
+EDB7
+EDB8
+EDB9
+EDBA
+EDBB
+EDBC
+EDBD
+EDBE
+EDBF
+EDC0
+EDC1
+EDC2
+EDC3
+EDC4
+EDC5
+EDC6
+EDC7
+EDC8
+EDC9
+EDCA
+EDCB
+EDCC
+EDCD
+EDCE
+EDCF
+EDD0
+EDD1
+EDD2
+EDD3
+EDD4
+EDD5
+EDD6
+EDD7
+EDD8
+EDD9
+EDDA
+EDDB
+EDDC
+EDDD
+EDDE
+EDDF
+EDE0
+EDE1
+EDE2
+EDE3
+EDE4
+EDE5
+EDE6
+EDE7
+EDE8
+EDE9
+EDEA
+EDEB
+EDEC
+EDED
+EDEE
+EDEF
+EDF0
+EDF1
+EDF2
+EDF3
+EDF4
+EDF5
+EDF6
+EDF7
+EDF8
+EDF9
+EDFA
+EDFB
+EDFC
+EE40
+EE41
+EE42
+EE43
+EE44
+EE45
+EE46
+EE47
+EE48
+EE49
+EE4A
+EE4B
+EE4C
+EE4D
+EE4E
+EE4F
+EE50
+EE51
+EE52
+EE53
+EE54
+EE55
+EE56
+EE57
+EE58
+EE59
+EE5A
+EE5B
+EE5C
+EE5D
+EE5E
+EE5F
+EE60
+EE61
+EE62
+EE63
+EE64
+EE65
+EE66
+EE67
+EE68
+EE69
+EE6A
+EE6B
+EE6C
+EE6D
+EE6E
+EE6F
+EE70
+EE71
+EE72
+EE73
+EE74
+EE75
+EE76
+EE77
+EE78
+EE79
+EE7A
+EE7B
+EE7C
+EE7D
+EE7E
+EE80
+EE81
+EE82
+EE83
+EE84
+EE85
+EE86
+EE87
+EE88
+EE89
+EE8A
+EE8B
+EE8C
+EE8D
+EE8E
+EE8F
+EE90
+EE91
+EE92
+EE93
+EE94
+EE95
+EE96
+EE97
+EE98
+EE99
+EE9A
+EE9B
+EE9C
+EE9D
+EE9E
+EE9F
+EEA0
+EEA1
+EEA2
+EEA3
+EEA4
+EEA5
+EEA6
+EEA7
+EEA8
+EEA9
+EEAA
+EEAB
+EEAC
+EEAD
+EEAE
+EEAF
+EEB0
+EEB1
+EEB2
+EEB3
+EEB4
+EEB5
+EEB6
+EEB7
+EEB8
+EEB9
+EEBA
+EEBB
+EEBC
+EEBD
+EEBE
+EEBF
+EEC0
+EEC1
+EEC2
+EEC3
+EEC4
+EEC5
+EEC6
+EEC7
+EEC8
+EEC9
+EECA
+EECB
+EECC
+EECD
+EECE
+EECF
+EED0
+EED1
+EED2
+EED3
+EED4
+EED5
+EED6
+EED7
+EED8
+EED9
+EEDA
+EEDB
+EEDC
+EEDD
+EEDE
+EEDF
+EEE0
+EEE1
+EEE2
+EEE3
+EEE4
+EEE5
+EEE6
+EEE7
+EEE8
+EEE9
+EEEA
+EEEB
+EEEC
+EEEF
+EEF0
+EEF1
+EEF2
+EEF3
+EEF4
+EEF5
+EEF6
+EEF7
+EEF8
+EEF9
+EEFA
+EEFB
+EEFC
+FA40
+FA41
+FA42
+FA43
+FA44
+FA45
+FA46
+FA47
+FA48
+FA49
+FA4A
+FA4B
+FA4C
+FA4D
+FA4E
+FA4F
+FA50
+FA51
+FA52
+FA53
+FA54
+FA55
+FA56
+FA57
+FA58
+FA59
+FA5A
+FA5B
+FA5C
+FA5D
+FA5E
+FA5F
+FA60
+FA61
+FA62
+FA63
+FA64
+FA65
+FA66
+FA67
+FA68
+FA69
+FA6A
+FA6B
+FA6C
+FA6D
+FA6E
+FA6F
+FA70
+FA71
+FA72
+FA73
+FA74
+FA75
+FA76
+FA77
+FA78
+FA79
+FA7A
+FA7B
+FA7C
+FA7D
+FA7E
+FA80
+FA81
+FA82
+FA83
+FA84
+FA85
+FA86
+FA87
+FA88
+FA89
+FA8A
+FA8B
+FA8C
+FA8D
+FA8E
+FA8F
+FA90
+FA91
+FA92
+FA93
+FA94
+FA95
+FA96
+FA97
+FA98
+FA99
+FA9A
+FA9B
+FA9C
+FA9D
+FA9E
+FA9F
+FAA0
+FAA1
+FAA2
+FAA3
+FAA4
+FAA5
+FAA6
+FAA7
+FAA8
+FAA9
+FAAA
+FAAB
+FAAC
+FAAD
+FAAE
+FAAF
+FAB0
+FAB1
+FAB2
+FAB3
+FAB4
+FAB5
+FAB6
+FAB7
+FAB8
+FAB9
+FABA
+FABB
+FABC
+FABD
+FABE
+FABF
+FAC0
+FAC1
+FAC2
+FAC3
+FAC4
+FAC5
+FAC6
+FAC7
+FAC8
+FAC9
+FACA
+FACB
+FACC
+FACD
+FACE
+FACF
+FAD0
+FAD1
+FAD2
+FAD3
+FAD4
+FAD5
+FAD6
+FAD7
+FAD8
+FAD9
+FADA
+FADB
+FADC
+FADD
+FADE
+FADF
+FAE0
+FAE1
+FAE2
+FAE3
+FAE4
+FAE5
+FAE6
+FAE7
+FAE8
+FAE9
+FAEA
+FAEB
+FAEC
+FAED
+FAEE
+FAEF
+FAF0
+FAF1
+FAF2
+FAF3
+FAF4
+FAF5
+FAF6
+FAF7
+FAF8
+FAF9
+FAFA
+FAFB
+FAFC
+FB40
+FB41
+FB42
+FB43
+FB44
+FB45
+FB46
+FB47
+FB48
+FB49
+FB4A
+FB4B
+FB4C
+FB4D
+FB4E
+FB4F
+FB50
+FB51
+FB52
+FB53
+FB54
+FB55
+FB56
+FB57
+FB58
+FB59
+FB5A
+FB5B
+FB5C
+FB5D
+FB5E
+FB5F
+FB60
+FB61
+FB62
+FB63
+FB64
+FB65
+FB66
+FB67
+FB68
+FB69
+FB6A
+FB6B
+FB6C
+FB6D
+FB6E
+FB6F
+FB70
+FB71
+FB72
+FB73
+FB74
+FB75
+FB76
+FB77
+FB78
+FB79
+FB7A
+FB7B
+FB7C
+FB7D
+FB7E
+FB80
+FB81
+FB82
+FB83
+FB84
+FB85
+FB86
+FB87
+FB88
+FB89
+FB8A
+FB8B
+FB8C
+FB8D
+FB8E
+FB8F
+FB90
+FB91
+FB92
+FB93
+FB94
+FB95
+FB96
+FB97
+FB98
+FB99
+FB9A
+FB9B
+FB9C
+FB9D
+FB9E
+FB9F
+FBA0
+FBA1
+FBA2
+FBA3
+FBA4
+FBA5
+FBA6
+FBA7
+FBA8
+FBA9
+FBAA
+FBAB
+FBAC
+FBAD
+FBAE
+FBAF
+FBB0
+FBB1
+FBB2
+FBB3
+FBB4
+FBB5
+FBB6
+FBB7
+FBB8
+FBB9
+FBBA
+FBBB
+FBBC
+FBBD
+FBBE
+FBBF
+FBC0
+FBC1
+FBC2
+FBC3
+FBC4
+FBC5
+FBC6
+FBC7
+FBC8
+FBC9
+FBCA
+FBCB
+FBCC
+FBCD
+FBCE
+FBCF
+FBD0
+FBD1
+FBD2
+FBD3
+FBD4
+FBD5
+FBD6
+FBD7
+FBD8
+FBD9
+FBDA
+FBDB
+FBDC
+FBDD
+FBDE
+FBDF
+FBE0
+FBE1
+FBE2
+FBE3
+FBE4
+FBE5
+FBE6
+FBE7
+FBE8
+FBE9
+FBEA
+FBEB
+FBEC
+FBED
+FBEE
+FBEF
+FBF0
+FBF1
+FBF2
+FBF3
+FBF4
+FBF5
+FBF6
+FBF7
+FBF8
+FBF9
+FBFA
+FBFB
+FBFC
+FC40
+FC41
+FC42
+FC43
+FC44
+FC45
+FC46
+FC47
+FC48
+FC49
+FC4A
+FC4B
+F040
+F041
+F042
+F043
+F044
+F045
+F046
+F047
+F048
+F049
+F04A
+F04B
+F04C
+F04D
+F04E
+F04F
+F050
+F051
+F052
+F053
+F054
+F055
+F056
+F057
+F058
+F059
+F05A
+F05B
+F05C
+F05D
+F05E
+F05F
+F060
+F061
+F062
+F063
+F064
+F065
+F066
+F067
+F068
+F069
+F06A
+F06B
+F06C
+F06D
+F06E
+F06F
+F070
+F071
+F072
+F073
+F074
+F075
+F076
+F077
+F078
+F079
+F07A
+F07B
+F07C
+F07D
+F07E
+F080
+F081
+F082
+F083
+F084
+F085
+F086
+F087
+F088
+F089
+F08A
+F08B
+F08C
+F08D
+F08E
+F08F
+F090
+F091
+F092
+F093
+F094
+F095
+F096
+F097
+F098
+F099
+F09A
+F09B
+F09C
+F09D
+F09E
+F09F
+F0A0
+F0A1
+F0A2
+F0A3
+F0A4
+F0A5
+F0A6
+F0A7
+F0A8
+F0A9
+F0AA
+F0AB
+F0AC
+F0AD
+F0AE
+F0AF
+F0B0
+F0B1
+F0B2
+F0B3
+F0B4
+F0B5
+F0B6
+F0B7
+F0B8
+F0B9
+F0BA
+F0BB
+F0BC
+F0BD
+F0BE
+F0BF
+F0C0
+F0C1
+F0C2
+F0C3
+F0C4
+F0C5
+F0C6
+F0C7
+F0C8
+F0C9
+F0CA
+F0CB
+F0CC
+F0CD
+F0CE
+F0CF
+F0D0
+F0D1
+F0D2
+F0D3
+F0D4
+F0D5
+F0D6
+F0D7
+F0D8
+F0D9
+F0DA
+F0DB
+F0DC
+F0DD
+F0DE
+F0DF
+F0E0
+F0E1
+F0E2
+F0E3
+F0E4
+F0E5
+F0E6
+F0E7
+F0E8
+F0E9
+F0EA
+F0EB
+F0EC
+F0ED
+F0EE
+F0EF
+F0F0
+F0F1
+F0F2
+F0F3
+F0F4
+F0F5
+F0F6
+F0F7
+F0F8
+F0F9
+F0FA
+F0FB
+F0FC
+F140
+F141
+F142
+F143
+F144
+F145
+F146
+F147
+F148
+F149
+F14A
+F14B
+F14C
+F14D
+F14E
+F14F
+F150
+F151
+F152
+F153
+F154
+F155
+F156
+F157
+F158
+F159
+F15A
+F15B
+F15C
+F15D
+F15E
+F15F
+F160
+F161
+F162
+F163
+F164
+F165
+F166
+F167
+F168
+F169
+F16A
+F16B
+F16C
+F16D
+F16E
+F16F
+F170
+F171
+F172
+F173
+F174
+F175
+F176
+F177
+F178
+F179
+F17A
+F17B
+F17C
+F17D
+F17E
+F180
+F181
+F182
+F183
+F184
+F185
+F186
+F187
+F188
+F189
+F18A
+F18B
+F18C
+F18D
+F18E
+F18F
+F190
+F191
+F192
+F193
+F194
+F195
+F196
+F197
+F198
+F199
+F19A
+F19B
+F19C
+F19D
+F19E
+F19F
+F1A0
+F1A1
+F1A2
+F1A3
+F1A4
+F1A5
+F1A6
+F1A7
+F1A8
+F1A9
+F1AA
+F1AB
+F1AC
+F1AD
+F1AE
+F1AF
+F1B0
+F1B1
+F1B2
+F1B3
+F1B4
+F1B5
+F1B6
+F1B7
+F1B8
+F1B9
+F1BA
+F1BB
+F1BC
+F1BD
+F1BE
+F1BF
+F1C0
+F1C1
+F1C2
+F1C3
+F1C4
+F1C5
+F1C6
+F1C7
+F1C8
+F1C9
+F1CA
+F1CB
+F1CC
+F1CD
+F1CE
+F1CF
+F1D0
+F1D1
+F1D2
+F1D3
+F1D4
+F1D5
+F1D6
+F1D7
+F1D8
+F1D9
+F1DA
+F1DB
+F1DC
+F1DD
+F1DE
+F1DF
+F1E0
+F1E1
+F1E2
+F1E3
+F1E4
+F1E5
+F1E6
+F1E7
+F1E8
+F1E9
+F1EA
+F1EB
+F1EC
+F1ED
+F1EE
+F1EF
+F1F0
+F1F1
+F1F2
+F1F3
+F1F4
+F1F5
+F1F6
+F1F7
+F1F8
+F1F9
+F1FA
+F1FB
+F1FC
+F240
+F241
+F242
+F243
+F244
+F245
+F246
+F247
+F248
+F249
+F24A
+F24B
+F24C
+F24D
+F24E
+F24F
+F250
+F251
+F252
+F253
+F254
+F255
+F256
+F257
+F258
+F259
+F25A
+F25B
+F25C
+F25D
+F25E
+F25F
+F260
+F261
+F262
+F263
+F264
+F265
+F266
+F267
+F268
+F269
+F26A
+F26B
+F26C
+F26D
+F26E
+F26F
+F270
+F271
+F272
+F273
+F274
+F275
+F276
+F277
+F278
+F279
+F27A
+F27B
+F27C
+F27D
+F27E
+F280
+F281
+F282
+F283
+F284
+F285
+F286
+F287
+F288
+F289
+F28A
+F28B
+F28C
+F28D
+F28E
+F28F
+F290
+F291
+F292
+F293
+F294
+F295
+F296
+F297
+F298
+F299
+F29A
+F29B
+F29C
+F29D
+F29E
+F29F
+F2A0
+F2A1
+F2A2
+F2A3
+F2A4
+F2A5
+F2A6
+F2A7
+F2A8
+F2A9
+F2AA
+F2AB
+F2AC
+F2AD
+F2AE
+F2AF
+F2B0
+F2B1
+F2B2
+F2B3
+F2B4
+F2B5
+F2B6
+F2B7
+F2B8
+F2B9
+F2BA
+F2BB
+F2BC
+F2BD
+F2BE
+F2BF
+F2C0
+F2C1
+F2C2
+F2C3
+F2C4
+F2C5
+F2C6
+F2C7
+F2C8
+F2C9
+F2CA
+F2CB
+F2CC
+F2CD
+F2CE
+F2CF
+F2D0
+F2D1
+F2D2
+F2D3
+F2D4
+F2D5
+F2D6
+F2D7
+F2D8
+F2D9
+F2DA
+F2DB
+F2DC
+F2DD
+F2DE
+F2DF
+F2E0
+F2E1
+F2E2
+F2E3
+F2E4
+F2E5
+F2E6
+F2E7
+F2E8
+F2E9
+F2EA
+F2EB
+F2EC
+F2ED
+F2EE
+F2EF
+F2F0
+F2F1
+F2F2
+F2F3
+F2F4
+F2F5
+F2F6
+F2F7
+F2F8
+F2F9
+F2FA
+F2FB
+F2FC
+F340
+F341
+F342
+F343
+F344
+F345
+F346
+F347
+F348
+F349
+F34A
+F34B
+F34C
+F34D
+F34E
+F34F
+F350
+F351
+F352
+F353
+F354
+F355
+F356
+F357
+F358
+F359
+F35A
+F35B
+F35C
+F35D
+F35E
+F35F
+F360
+F361
+F362
+F363
+F364
+F365
+F366
+F367
+F368
+F369
+F36A
+F36B
+F36C
+F36D
+F36E
+F36F
+F370
+F371
+F372
+F373
+F374
+F375
+F376
+F377
+F378
+F379
+F37A
+F37B
+F37C
+F37D
+F37E
+F380
+F381
+F382
+F383
+F384
+F385
+F386
+F387
+F388
+F389
+F38A
+F38B
+F38C
+F38D
+F38E
+F38F
+F390
+F391
+F392
+F393
+F394
+F395
+F396
+F397
+F398
+F399
+F39A
+F39B
+F39C
+F39D
+F39E
+F39F
+F3A0
+F3A1
+F3A2
+F3A3
+F3A4
+F3A5
+F3A6
+F3A7
+F3A8
+F3A9
+F3AA
+F3AB
+F3AC
+F3AD
+F3AE
+F3AF
+F3B0
+F3B1
+F3B2
+F3B3
+F3B4
+F3B5
+F3B6
+F3B7
+F3B8
+F3B9
+F3BA
+F3BB
+F3BC
+F3BD
+F3BE
+F3BF
+F3C0
+F3C1
+F3C2
+F3C3
+F3C4
+F3C5
+F3C6
+F3C7
+F3C8
+F3C9
+F3CA
+F3CB
+F3CC
+F3CD
+F3CE
+F3CF
+F3D0
+F3D1
+F3D2
+F3D3
+F3D4
+F3D5
+F3D6
+F3D7
+F3D8
+F3D9
+F3DA
+F3DB
+F3DC
+F3DD
+F3DE
+F3DF
+F3E0
+F3E1
+F3E2
+F3E3
+F3E4
+F3E5
+F3E6
+F3E7
+F3E8
+F3E9
+F3EA
+F3EB
+F3EC
+F3ED
+F3EE
+F3EF
+F3F0
+F3F1
+F3F2
+F3F3
+F3F4
+F3F5
+F3F6
+F3F7
+F3F8
+F3F9
+F3FA
+F3FB
+F3FC
+F440
+F441
+F442
+F443
+F444
+F445
+F446
+F447
+F448
+F449
+F44A
+F44B
+F44C
+F44D
+F44E
+F44F
+F450
+F451
+F452
+F453
+F454
+F455
+F456
+F457
+F458
+F459
+F45A
+F45B
+F45C
+F45D
+F45E
+F45F
+F460
+F461
+F462
+F463
+F464
+F465
+F466
+F467
+F468
+F469
+F46A
+F46B
+F46C
+F46D
+F46E
+F46F
+F470
+F471
+F472
+F473
+F474
+F475
+F476
+F477
+F478
+F479
+F47A
+F47B
+F47C
+F47D
+F47E
+F480
+F481
+F482
+F483
+F484
+F485
+F486
+F487
+F488
+F489
+F48A
+F48B
+F48C
+F48D
+F48E
+F48F
+F490
+F491
+F492
+F493
+F494
+F495
+F496
+F497
+F498
+F499
+F49A
+F49B
+F49C
+F49D
+F49E
+F49F
+F4A0
+F4A1
+F4A2
+F4A3
+F4A4
+F4A5
+F4A6
+F4A7
+F4A8
+F4A9
+F4AA
+F4AB
+F4AC
+F4AD
+F4AE
+F4AF
+F4B0
+F4B1
+F4B2
+F4B3
+F4B4
+F4B5
+F4B6
+F4B7
+F4B8
+F4B9
+F4BA
+F4BB
+F4BC
+F4BD
+F4BE
+F4BF
+F4C0
+F4C1
+F4C2
+F4C3
+F4C4
+F4C5
+F4C6
+F4C7
+F4C8
+F4C9
+F4CA
+F4CB
+F4CC
+F4CD
+F4CE
+F4CF
+F4D0
+F4D1
+F4D2
+F4D3
+F4D4
+F4D5
+F4D6
+F4D7
+F4D8
+F4D9
+F4DA
+F4DB
+F4DC
+F4DD
+F4DE
+F4DF
+F4E0
+F4E1
+F4E2
+F4E3
+F4E4
+F4E5
+F4E6
+F4E7
+F4E8
+F4E9
+F4EA
+F4EB
+F4EC
+F4ED
+F4EE
+F4EF
+F4F0
+F4F1
+F4F2
+F4F3
+F4F4
+F4F5
+F4F6
+F4F7
+F4F8
+F4F9
+F4FA
+F4FB
+F4FC
+F540
+F541
+F542
+F543
+F544
+F545
+F546
+F547
+F548
+F549
+F54A
+F54B
+F54C
+F54D
+F54E
+F54F
+F550
+F551
+F552
+F553
+F554
+F555
+F556
+F557
+F558
+F559
+F55A
+F55B
+F55C
+F55D
+F55E
+F55F
+F560
+F561
+F562
+F563
+F564
+F565
+F566
+F567
+F568
+F569
+F56A
+F56B
+F56C
+F56D
+F56E
+F56F
+F570
+F571
+F572
+F573
+F574
+F575
+F576
+F577
+F578
+F579
+F57A
+F57B
+F57C
+F57D
+F57E
+F580
+F581
+F582
+F583
+F584
+F585
+F586
+F587
+F588
+F589
+F58A
+F58B
+F58C
+F58D
+F58E
+F58F
+F590
+F591
+F592
+F593
+F594
+F595
+F596
+F597
+F598
+F599
+F59A
+F59B
+F59C
+F59D
+F59E
+F59F
+F5A0
+F5A1
+F5A2
+F5A3
+F5A4
+F5A5
+F5A6
+F5A7
+F5A8
+F5A9
+F5AA
+F5AB
+F5AC
+F5AD
+F5AE
+F5AF
+F5B0
+F5B1
+F5B2
+F5B3
+F5B4
+F5B5
+F5B6
+F5B7
+F5B8
+F5B9
+F5BA
+F5BB
+F5BC
+F5BD
+F5BE
+F5BF
+F5C0
+F5C1
+F5C2
+F5C3
+F5C4
+F5C5
+F5C6
+F5C7
+F5C8
+F5C9
+F5CA
+F5CB
+F5CC
+F5CD
+F5CE
+F5CF
+F5D0
+F5D1
+F5D2
+F5D3
+F5D4
+F5D5
+F5D6
+F5D7
+F5D8
+F5D9
+F5DA
+F5DB
+F5DC
+F5DD
+F5DE
+F5DF
+F5E0
+F5E1
+F5E2
+F5E3
+F5E4
+F5E5
+F5E6
+F5E7
+F5E8
+F5E9
+F5EA
+F5EB
+F5EC
+F5ED
+F5EE
+F5EF
+F5F0
+F5F1
+F5F2
+F5F3
+F5F4
+F5F5
+F5F6
+F5F7
+F5F8
+F5F9
+F5FA
+F5FB
+F5FC
+F640
+F641
+F642
+F643
+F644
+F645
+F646
+F647
+F648
+F649
+F64A
+F64B
+F64C
+F64D
+F64E
+F64F
+F650
+F651
+F652
+F653
+F654
+F655
+F656
+F657
+F658
+F659
+F65A
+F65B
+F65C
+F65D
+F65E
+F65F
+F660
+F661
+F662
+F663
+F664
+F665
+F666
+F667
+F668
+F669
+F66A
+F66B
+F66C
+F66D
+F66E
+F66F
+F670
+F671
+F672
+F673
+F674
+F675
+F676
+F677
+F678
+F679
+F67A
+F67B
+F67C
+F67D
+F67E
+F680
+F681
+F682
+F683
+F684
+F685
+F686
+F687
+F688
+F689
+F68A
+F68B
+F68C
+F68D
+F68E
+F68F
+F690
+F691
+F692
+F693
+F694
+F695
+F696
+F697
+F698
+F699
+F69A
+F69B
+F69C
+F69D
+F69E
+F69F
+F6A0
+F6A1
+F6A2
+F6A3
+F6A4
+F6A5
+F6A6
+F6A7
+F6A8
+F6A9
+F6AA
+F6AB
+F6AC
+F6AD
+F6AE
+F6AF
+F6B0
+F6B1
+F6B2
+F6B3
+F6B4
+F6B5
+F6B6
+F6B7
+F6B8
+F6B9
+F6BA
+F6BB
+F6BC
+F6BD
+F6BE
+F6BF
+F6C0
+F6C1
+F6C2
+F6C3
+F6C4
+F6C5
+F6C6
+F6C7
+F6C8
+F6C9
+F6CA
+F6CB
+F6CC
+F6CD
+F6CE
+F6CF
+F6D0
+F6D1
+F6D2
+F6D3
+F6D4
+F6D5
+F6D6
+F6D7
+F6D8
+F6D9
+F6DA
+F6DB
+F6DC
+F6DD
+F6DE
+F6DF
+F6E0
+F6E1
+F6E2
+F6E3
+F6E4
+F6E5
+F6E6
+F6E7
+F6E8
+F6E9
+F6EA
+F6EB
+F6EC
+F6ED
+F6EE
+F6EF
+F6F0
+F6F1
+F6F2
+F6F3
+F6F4
+F6F5
+F6F6
+F6F7
+F6F8
+F6F9
+F6FA
+F6FB
+F6FC
+F740
+F741
+F742
+F743
+F744
+F745
+F746
+F747
+F748
+F749
+F74A
+F74B
+F74C
+F74D
+F74E
+F74F
+F750
+F751
+F752
+F753
+F754
+F755
+F756
+F757
+F758
+F759
+F75A
+F75B
+F75C
+F75D
+F75E
+F75F
+F760
+F761
+F762
+F763
+F764
+F765
+F766
+F767
+F768
+F769
+F76A
+F76B
+F76C
+F76D
+F76E
+F76F
+F770
+F771
+F772
+F773
+F774
+F775
+F776
+F777
+F778
+F779
+F77A
+F77B
+F77C
+F77D
+F77E
+F780
+F781
+F782
+F783
+F784
+F785
+F786
+F787
+F788
+F789
+F78A
+F78B
+F78C
+F78D
+F78E
+F78F
+F790
+F791
+F792
+F793
+F794
+F795
+F796
+F797
+F798
+F799
+F79A
+F79B
+F79C
+F79D
+F79E
+F79F
+F7A0
+F7A1
+F7A2
+F7A3
+F7A4
+F7A5
+F7A6
+F7A7
+F7A8
+F7A9
+F7AA
+F7AB
+F7AC
+F7AD
+F7AE
+F7AF
+F7B0
+F7B1
+F7B2
+F7B3
+F7B4
+F7B5
+F7B6
+F7B7
+F7B8
+F7B9
+F7BA
+F7BB
+F7BC
+F7BD
+F7BE
+F7BF
+F7C0
+F7C1
+F7C2
+F7C3
+F7C4
+F7C5
+F7C6
+F7C7
+F7C8
+F7C9
+F7CA
+F7CB
+F7CC
+F7CD
+F7CE
+F7CF
+F7D0
+F7D1
+F7D2
+F7D3
+F7D4
+F7D5
+F7D6
+F7D7
+F7D8
+F7D9
+F7DA
+F7DB
+F7DC
+F7DD
+F7DE
+F7DF
+F7E0
+F7E1
+F7E2
+F7E3
+F7E4
+F7E5
+F7E6
+F7E7
+F7E8
+F7E9
+F7EA
+F7EB
+F7EC
+F7ED
+F7EE
+F7EF
+F7F0
+F7F1
+F7F2
+F7F3
+F7F4
+F7F5
+F7F6
+F7F7
+F7F8
+F7F9
+F7FA
+F7FB
+F7FC
+F840
+F841
+F842
+F843
+F844
+F845
+F846
+F847
+F848
+F849
+F84A
+F84B
+F84C
+F84D
+F84E
+F84F
+F850
+F851
+F852
+F853
+F854
+F855
+F856
+F857
+F858
+F859
+F85A
+F85B
+F85C
+F85D
+F85E
+F85F
+F860
+F861
+F862
+F863
+F864
+F865
+F866
+F867
+F868
+F869
+F86A
+F86B
+F86C
+F86D
+F86E
+F86F
+F870
+F871
+F872
+F873
+F874
+F875
+F876
+F877
+F878
+F879
+F87A
+F87B
+F87C
+F87D
+F87E
+F880
+F881
+F882
+F883
+F884
+F885
+F886
+F887
+F888
+F889
+F88A
+F88B
+F88C
+F88D
+F88E
+F88F
+F890
+F891
+F892
+F893
+F894
+F895
+F896
+F897
+F898
+F899
+F89A
+F89B
+F89C
+F89D
+F89E
+F89F
+F8A0
+F8A1
+F8A2
+F8A3
+F8A4
+F8A5
+F8A6
+F8A7
+F8A8
+F8A9
+F8AA
+F8AB
+F8AC
+F8AD
+F8AE
+F8AF
+F8B0
+F8B1
+F8B2
+F8B3
+F8B4
+F8B5
+F8B6
+F8B7
+F8B8
+F8B9
+F8BA
+F8BB
+F8BC
+F8BD
+F8BE
+F8BF
+F8C0
+F8C1
+F8C2
+F8C3
+F8C4
+F8C5
+F8C6
+F8C7
+F8C8
+F8C9
+F8CA
+F8CB
+F8CC
+F8CD
+F8CE
+F8CF
+F8D0
+F8D1
+F8D2
+F8D3
+F8D4
+F8D5
+F8D6
+F8D7
+F8D8
+F8D9
+F8DA
+F8DB
+F8DC
+F8DD
+F8DE
+F8DF
+F8E0
+F8E1
+F8E2
+F8E3
+F8E4
+F8E5
+F8E6
+F8E7
+F8E8
+F8E9
+F8EA
+F8EB
+F8EC
+F8ED
+F8EE
+F8EF
+F8F0
+F8F1
+F8F2
+F8F3
+F8F4
+F8F5
+F8F6
+F8F7
+F8F8
+F8F9
+F8FA
+F8FB
+F8FC
+F940
+F941
+F942
+F943
+F944
+F945
+F946
+F947
+F948
+F949
+F94A
+F94B
+F94C
+F94D
+F94E
+F94F
+F950
+F951
+F952
+F953
+F954
+F955
+F956
+F957
+F958
+F959
+F95A
+F95B
+F95C
+F95D
+F95E
+F95F
+F960
+F961
+F962
+F963
+F964
+F965
+F966
+F967
+F968
+F969
+F96A
+F96B
+F96C
+F96D
+F96E
+F96F
+F970
+F971
+F972
+F973
+F974
+F975
+F976
+F977
+F978
+F979
+F97A
+F97B
+F97C
+F97D
+F97E
+F980
+F981
+F982
+F983
+F984
+F985
+F986
+F987
+F988
+F989
+F98A
+F98B
+F98C
+F98D
+F98E
+F98F
+F990
+F991
+F992
+F993
+F994
+F995
+F996
+F997
+F998
+F999
+F99A
+F99B
+F99C
+F99D
+F99E
+F99F
+F9A0
+F9A1
+F9A2
+F9A3
+F9A4
+F9A5
+F9A6
+F9A7
+F9A8
+F9A9
+F9AA
+F9AB
+F9AC
+F9AD
+F9AE
+F9AF
+F9B0
+F9B1
+F9B2
+F9B3
+F9B4
+F9B5
+F9B6
+F9B7
+F9B8
+F9B9
+F9BA
+F9BB
+F9BC
+F9BD
+F9BE
+F9BF
+F9C0
+F9C1
+F9C2
+F9C3
+F9C4
+F9C5
+F9C6
+F9C7
+F9C8
+F9C9
+F9CA
+F9CB
+F9CC
+F9CD
+F9CE
+F9CF
+F9D0
+F9D1
+F9D2
+F9D3
+F9D4
+F9D5
+F9D6
+F9D7
+F9D8
+F9D9
+F9DA
+F9DB
+F9DC
+F9DD
+F9DE
+F9DF
+F9E0
+F9E1
+F9E2
+F9E3
+F9E4
+F9E5
+F9E6
+F9E7
+F9E8
+F9E9
+F9EA
+F9EB
+F9EC
+F9ED
+F9EE
+F9EF
+F9F0
+F9F1
+F9F2
+F9F3
+F9F4
+F9F5
+F9F6
+F9F7
+F9F8
+F9F9
+F9FA
+F9FB
+F9FC
+CREATE TABLE t2 SELECT CONVERT(c1 USING ucs2) AS c1 FROM t1;
+SELECT HEX(c1) FROM t2;
+HEX(c1)
+0005
+007E
+2015
+FF3C
+FF5E
+2225
+FF0D
+FFE0
+FFE1
+FFE2
+2460
+2461
+2462
+2463
+2464
+2465
+2466
+2467
+2468
+2469
+246A
+246B
+246C
+246D
+246E
+246F
+2470
+2471
+2472
+2473
+2160
+2161
+2162
+2163
+2164
+2165
+2166
+2167
+2168
+2169
+3349
+3314
+3322
+334D
+3318
+3327
+3303
+3336
+3351
+3357
+330D
+3326
+3323
+332B
+334A
+333B
+339C
+339D
+339E
+338E
+338F
+33C4
+33A1
+337B
+301D
+301F
+2116
+33CD
+2121
+32A4
+32A5
+32A6
+32A7
+32A8
+3231
+3232
+3239
+337E
+337D
+337C
+2252
+2261
+222B
+222E
+2211
+221A
+22A5
+2220
+221F
+22BF
+2235
+2229
+222A
+7E8A
+891C
+9348
+9288
+84DC
+4FC9
+70BB
+6631
+68C8
+92F9
+66FB
+5F45
+4E28
+4EE1
+4EFC
+4F00
+4F03
+4F39
+4F56
+4F92
+4F8A
+4F9A
+4F94
+4FCD
+5040
+5022
+4FFF
+501E
+5046
+5070
+5042
+5094
+50F4
+50D8
+514A
+5164
+519D
+51BE
+51EC
+5215
+529C
+52A6
+52C0
+52DB
+5300
+5307
+5324
+5372
+5393
+53B2
+53DD
+FA0E
+549C
+548A
+54A9
+54FF
+5586
+5759
+5765
+57AC
+57C8
+57C7
+FA0F
+FA10
+589E
+58B2
+590B
+5953
+595B
+595D
+5963
+59A4
+59BA
+5B56
+5BC0
+752F
+5BD8
+5BEC
+5C1E
+5CA6
+5CBA
+5CF5
+5D27
+5D53
+FA11
+5D42
+5D6D
+5DB8
+5DB9
+5DD0
+5F21
+5F34
+5F67
+5FB7
+5FDE
+605D
+6085
+608A
+60DE
+60D5
+6120
+60F2
+6111
+6137
+6130
+6198
+6213
+62A6
+63F5
+6460
+649D
+64CE
+654E
+6600
+6615
+663B
+6609
+662E
+661E
+6624
+6665
+6657
+6659
+FA12
+6673
+6699
+66A0
+66B2
+66BF
+66FA
+670E
+F929
+6766
+67BB
+6852
+67C0
+6801
+6844
+68CF
+FA13
+6968
+FA14
+6998
+69E2
+6A30
+6A6B
+6A46
+6A73
+6A7E
+6AE2
+6AE4
+6BD6
+6C3F
+6C5C
+6C86
+6C6F
+6CDA
+6D04
+6D87
+6D6F
+6D96
+6DAC
+6DCF
+6DF8
+6DF2
+6DFC
+6E39
+6E5C
+6E27
+6E3C
+6EBF
+6F88
+6FB5
+6FF5
+7005
+7007
+7028
+7085
+70AB
+710F
+7104
+715C
+7146
+7147
+FA15
+71C1
+71FE
+72B1
+72BE
+7324
+FA16
+7377
+73BD
+73C9
+73D6
+73E3
+73D2
+7407
+73F5
+7426
+742A
+7429
+742E
+7462
+7489
+749F
+7501
+756F
+7682
+769C
+769E
+769B
+76A6
+FA17
+7746
+52AF
+7821
+784E
+7864
+787A
+7930
+FA18
+FA19
+FA1A
+7994
+FA1B
+799B
+7AD1
+7AE7
+FA1C
+7AEB
+7B9E
+FA1D
+7D48
+7D5C
+7DB7
+7DA0
+7DD6
+7E52
+7F47
+7FA1
+FA1E
+8301
+8362
+837F
+83C7
+83F6
+8448
+84B4
+8553
+8559
+856B
+FA1F
+85B0
+FA20
+FA21
+8807
+88F5
+8A12
+8A37
+8A79
+8AA7
+8ABE
+8ADF
+FA22
+8AF6
+8B53
+8B7F
+8CF0
+8CF4
+8D12
+8D76
+FA23
+8ECF
+FA24
+FA25
+9067
+90DE
+FA26
+9115
+9127
+91DA
+91D7
+91DE
+91ED
+91EE
+91E4
+91E5
+9206
+9210
+920A
+923A
+9240
+923C
+924E
+9259
+9251
+9239
+9267
+92A7
+9277
+9278
+92E7
+92D7
+92D9
+92D0
+FA27
+92D5
+92E0
+92D3
+9325
+9321
+92FB
+FA28
+931E
+92FF
+931D
+9302
+9370
+9357
+93A4
+93C6
+93DE
+93F8
+9431
+9445
+9448
+9592
+F9DC
+FA29
+969D
+96AF
+9733
+973B
+9743
+974D
+974F
+9751
+9755
+9857
+9865
+FA2A
+FA2B
+9927
+FA2C
+999E
+9A4E
+9AD9
+9ADC
+9B75
+9B72
+9B8F
+9BB1
+9BBB
+9C00
+9D70
+9D6B
+FA2D
+9E19
+9ED1
+2170
+2171
+2172
+2173
+2174
+2175
+2176
+2177
+2178
+2179
+FFE2
+FFE4
+FF07
+FF02
+2170
+2171
+2172
+2173
+2174
+2175
+2176
+2177
+2178
+2179
+2160
+2161
+2162
+2163
+2164
+2165
+2166
+2167
+2168
+2169
+FFE2
+FFE4
+FF07
+FF02
+3231
+2116
+2121
+2235
+7E8A
+891C
+9348
+9288
+84DC
+4FC9
+70BB
+6631
+68C8
+92F9
+66FB
+5F45
+4E28
+4EE1
+4EFC
+4F00
+4F03
+4F39
+4F56
+4F92
+4F8A
+4F9A
+4F94
+4FCD
+5040
+5022
+4FFF
+501E
+5046
+5070
+5042
+5094
+50F4
+50D8
+514A
+5164
+519D
+51BE
+51EC
+5215
+529C
+52A6
+52C0
+52DB
+5300
+5307
+5324
+5372
+5393
+53B2
+53DD
+FA0E
+549C
+548A
+54A9
+54FF
+5586
+5759
+5765
+57AC
+57C8
+57C7
+FA0F
+FA10
+589E
+58B2
+590B
+5953
+595B
+595D
+5963
+59A4
+59BA
+5B56
+5BC0
+752F
+5BD8
+5BEC
+5C1E
+5CA6
+5CBA
+5CF5
+5D27
+5D53
+FA11
+5D42
+5D6D
+5DB8
+5DB9
+5DD0
+5F21
+5F34
+5F67
+5FB7
+5FDE
+605D
+6085
+608A
+60DE
+60D5
+6120
+60F2
+6111
+6137
+6130
+6198
+6213
+62A6
+63F5
+6460
+649D
+64CE
+654E
+6600
+6615
+663B
+6609
+662E
+661E
+6624
+6665
+6657
+6659
+FA12
+6673
+6699
+66A0
+66B2
+66BF
+66FA
+670E
+F929
+6766
+67BB
+6852
+67C0
+6801
+6844
+68CF
+FA13
+6968
+FA14
+6998
+69E2
+6A30
+6A6B
+6A46
+6A73
+6A7E
+6AE2
+6AE4
+6BD6
+6C3F
+6C5C
+6C86
+6C6F
+6CDA
+6D04
+6D87
+6D6F
+6D96
+6DAC
+6DCF
+6DF8
+6DF2
+6DFC
+6E39
+6E5C
+6E27
+6E3C
+6EBF
+6F88
+6FB5
+6FF5
+7005
+7007
+7028
+7085
+70AB
+710F
+7104
+715C
+7146
+7147
+FA15
+71C1
+71FE
+72B1
+72BE
+7324
+FA16
+7377
+73BD
+73C9
+73D6
+73E3
+73D2
+7407
+73F5
+7426
+742A
+7429
+742E
+7462
+7489
+749F
+7501
+756F
+7682
+769C
+769E
+769B
+76A6
+FA17
+7746
+52AF
+7821
+784E
+7864
+787A
+7930
+FA18
+FA19
+FA1A
+7994
+FA1B
+799B
+7AD1
+7AE7
+FA1C
+7AEB
+7B9E
+FA1D
+7D48
+7D5C
+7DB7
+7DA0
+7DD6
+7E52
+7F47
+7FA1
+FA1E
+8301
+8362
+837F
+83C7
+83F6
+8448
+84B4
+8553
+8559
+856B
+FA1F
+85B0
+FA20
+FA21
+8807
+88F5
+8A12
+8A37
+8A79
+8AA7
+8ABE
+8ADF
+FA22
+8AF6
+8B53
+8B7F
+8CF0
+8CF4
+8D12
+8D76
+FA23
+8ECF
+FA24
+FA25
+9067
+90DE
+FA26
+9115
+9127
+91DA
+91D7
+91DE
+91ED
+91EE
+91E4
+91E5
+9206
+9210
+920A
+923A
+9240
+923C
+924E
+9259
+9251
+9239
+9267
+92A7
+9277
+9278
+92E7
+92D7
+92D9
+92D0
+FA27
+92D5
+92E0
+92D3
+9325
+9321
+92FB
+FA28
+931E
+92FF
+931D
+9302
+9370
+9357
+93A4
+93C6
+93DE
+93F8
+9431
+9445
+9448
+9592
+F9DC
+FA29
+969D
+96AF
+9733
+973B
+9743
+974D
+974F
+9751
+9755
+9857
+9865
+FA2A
+FA2B
+9927
+FA2C
+999E
+9A4E
+9AD9
+9ADC
+9B75
+9B72
+9B8F
+9BB1
+9BBB
+9C00
+9D70
+9D6B
+FA2D
+9E19
+9ED1
+E000
+E001
+E002
+E003
+E004
+E005
+E006
+E007
+E008
+E009
+E00A
+E00B
+E00C
+E00D
+E00E
+E00F
+E010
+E011
+E012
+E013
+E014
+E015
+E016
+E017
+E018
+E019
+E01A
+E01B
+E01C
+E01D
+E01E
+E01F
+E020
+E021
+E022
+E023
+E024
+E025
+E026
+E027
+E028
+E029
+E02A
+E02B
+E02C
+E02D
+E02E
+E02F
+E030
+E031
+E032
+E033
+E034
+E035
+E036
+E037
+E038
+E039
+E03A
+E03B
+E03C
+E03D
+E03E
+E03F
+E040
+E041
+E042
+E043
+E044
+E045
+E046
+E047
+E048
+E049
+E04A
+E04B
+E04C
+E04D
+E04E
+E04F
+E050
+E051
+E052
+E053
+E054
+E055
+E056
+E057
+E058
+E059
+E05A
+E05B
+E05C
+E05D
+E05E
+E05F
+E060
+E061
+E062
+E063
+E064
+E065
+E066
+E067
+E068
+E069
+E06A
+E06B
+E06C
+E06D
+E06E
+E06F
+E070
+E071
+E072
+E073
+E074
+E075
+E076
+E077
+E078
+E079
+E07A
+E07B
+E07C
+E07D
+E07E
+E07F
+E080
+E081
+E082
+E083
+E084
+E085
+E086
+E087
+E088
+E089
+E08A
+E08B
+E08C
+E08D
+E08E
+E08F
+E090
+E091
+E092
+E093
+E094
+E095
+E096
+E097
+E098
+E099
+E09A
+E09B
+E09C
+E09D
+E09E
+E09F
+E0A0
+E0A1
+E0A2
+E0A3
+E0A4
+E0A5
+E0A6
+E0A7
+E0A8
+E0A9
+E0AA
+E0AB
+E0AC
+E0AD
+E0AE
+E0AF
+E0B0
+E0B1
+E0B2
+E0B3
+E0B4
+E0B5
+E0B6
+E0B7
+E0B8
+E0B9
+E0BA
+E0BB
+E0BC
+E0BD
+E0BE
+E0BF
+E0C0
+E0C1
+E0C2
+E0C3
+E0C4
+E0C5
+E0C6
+E0C7
+E0C8
+E0C9
+E0CA
+E0CB
+E0CC
+E0CD
+E0CE
+E0CF
+E0D0
+E0D1
+E0D2
+E0D3
+E0D4
+E0D5
+E0D6
+E0D7
+E0D8
+E0D9
+E0DA
+E0DB
+E0DC
+E0DD
+E0DE
+E0DF
+E0E0
+E0E1
+E0E2
+E0E3
+E0E4
+E0E5
+E0E6
+E0E7
+E0E8
+E0E9
+E0EA
+E0EB
+E0EC
+E0ED
+E0EE
+E0EF
+E0F0
+E0F1
+E0F2
+E0F3
+E0F4
+E0F5
+E0F6
+E0F7
+E0F8
+E0F9
+E0FA
+E0FB
+E0FC
+E0FD
+E0FE
+E0FF
+E100
+E101
+E102
+E103
+E104
+E105
+E106
+E107
+E108
+E109
+E10A
+E10B
+E10C
+E10D
+E10E
+E10F
+E110
+E111
+E112
+E113
+E114
+E115
+E116
+E117
+E118
+E119
+E11A
+E11B
+E11C
+E11D
+E11E
+E11F
+E120
+E121
+E122
+E123
+E124
+E125
+E126
+E127
+E128
+E129
+E12A
+E12B
+E12C
+E12D
+E12E
+E12F
+E130
+E131
+E132
+E133
+E134
+E135
+E136
+E137
+E138
+E139
+E13A
+E13B
+E13C
+E13D
+E13E
+E13F
+E140
+E141
+E142
+E143
+E144
+E145
+E146
+E147
+E148
+E149
+E14A
+E14B
+E14C
+E14D
+E14E
+E14F
+E150
+E151
+E152
+E153
+E154
+E155
+E156
+E157
+E158
+E159
+E15A
+E15B
+E15C
+E15D
+E15E
+E15F
+E160
+E161
+E162
+E163
+E164
+E165
+E166
+E167
+E168
+E169
+E16A
+E16B
+E16C
+E16D
+E16E
+E16F
+E170
+E171
+E172
+E173
+E174
+E175
+E176
+E177
+E178
+E179
+E17A
+E17B
+E17C
+E17D
+E17E
+E17F
+E180
+E181
+E182
+E183
+E184
+E185
+E186
+E187
+E188
+E189
+E18A
+E18B
+E18C
+E18D
+E18E
+E18F
+E190
+E191
+E192
+E193
+E194
+E195
+E196
+E197
+E198
+E199
+E19A
+E19B
+E19C
+E19D
+E19E
+E19F
+E1A0
+E1A1
+E1A2
+E1A3
+E1A4
+E1A5
+E1A6
+E1A7
+E1A8
+E1A9
+E1AA
+E1AB
+E1AC
+E1AD
+E1AE
+E1AF
+E1B0
+E1B1
+E1B2
+E1B3
+E1B4
+E1B5
+E1B6
+E1B7
+E1B8
+E1B9
+E1BA
+E1BB
+E1BC
+E1BD
+E1BE
+E1BF
+E1C0
+E1C1
+E1C2
+E1C3
+E1C4
+E1C5
+E1C6
+E1C7
+E1C8
+E1C9
+E1CA
+E1CB
+E1CC
+E1CD
+E1CE
+E1CF
+E1D0
+E1D1
+E1D2
+E1D3
+E1D4
+E1D5
+E1D6
+E1D7
+E1D8
+E1D9
+E1DA
+E1DB
+E1DC
+E1DD
+E1DE
+E1DF
+E1E0
+E1E1
+E1E2
+E1E3
+E1E4
+E1E5
+E1E6
+E1E7
+E1E8
+E1E9
+E1EA
+E1EB
+E1EC
+E1ED
+E1EE
+E1EF
+E1F0
+E1F1
+E1F2
+E1F3
+E1F4
+E1F5
+E1F6
+E1F7
+E1F8
+E1F9
+E1FA
+E1FB
+E1FC
+E1FD
+E1FE
+E1FF
+E200
+E201
+E202
+E203
+E204
+E205
+E206
+E207
+E208
+E209
+E20A
+E20B
+E20C
+E20D
+E20E
+E20F
+E210
+E211
+E212
+E213
+E214
+E215
+E216
+E217
+E218
+E219
+E21A
+E21B
+E21C
+E21D
+E21E
+E21F
+E220
+E221
+E222
+E223
+E224
+E225
+E226
+E227
+E228
+E229
+E22A
+E22B
+E22C
+E22D
+E22E
+E22F
+E230
+E231
+E232
+E233
+E234
+E235
+E236
+E237
+E238
+E239
+E23A
+E23B
+E23C
+E23D
+E23E
+E23F
+E240
+E241
+E242
+E243
+E244
+E245
+E246
+E247
+E248
+E249
+E24A
+E24B
+E24C
+E24D
+E24E
+E24F
+E250
+E251
+E252
+E253
+E254
+E255
+E256
+E257
+E258
+E259
+E25A
+E25B
+E25C
+E25D
+E25E
+E25F
+E260
+E261
+E262
+E263
+E264
+E265
+E266
+E267
+E268
+E269
+E26A
+E26B
+E26C
+E26D
+E26E
+E26F
+E270
+E271
+E272
+E273
+E274
+E275
+E276
+E277
+E278
+E279
+E27A
+E27B
+E27C
+E27D
+E27E
+E27F
+E280
+E281
+E282
+E283
+E284
+E285
+E286
+E287
+E288
+E289
+E28A
+E28B
+E28C
+E28D
+E28E
+E28F
+E290
+E291
+E292
+E293
+E294
+E295
+E296
+E297
+E298
+E299
+E29A
+E29B
+E29C
+E29D
+E29E
+E29F
+E2A0
+E2A1
+E2A2
+E2A3
+E2A4
+E2A5
+E2A6
+E2A7
+E2A8
+E2A9
+E2AA
+E2AB
+E2AC
+E2AD
+E2AE
+E2AF
+E2B0
+E2B1
+E2B2
+E2B3
+E2B4
+E2B5
+E2B6
+E2B7
+E2B8
+E2B9
+E2BA
+E2BB
+E2BC
+E2BD
+E2BE
+E2BF
+E2C0
+E2C1
+E2C2
+E2C3
+E2C4
+E2C5
+E2C6
+E2C7
+E2C8
+E2C9
+E2CA
+E2CB
+E2CC
+E2CD
+E2CE
+E2CF
+E2D0
+E2D1
+E2D2
+E2D3
+E2D4
+E2D5
+E2D6
+E2D7
+E2D8
+E2D9
+E2DA
+E2DB
+E2DC
+E2DD
+E2DE
+E2DF
+E2E0
+E2E1
+E2E2
+E2E3
+E2E4
+E2E5
+E2E6
+E2E7
+E2E8
+E2E9
+E2EA
+E2EB
+E2EC
+E2ED
+E2EE
+E2EF
+E2F0
+E2F1
+E2F2
+E2F3
+E2F4
+E2F5
+E2F6
+E2F7
+E2F8
+E2F9
+E2FA
+E2FB
+E2FC
+E2FD
+E2FE
+E2FF
+E300
+E301
+E302
+E303
+E304
+E305
+E306
+E307
+E308
+E309
+E30A
+E30B
+E30C
+E30D
+E30E
+E30F
+E310
+E311
+E312
+E313
+E314
+E315
+E316
+E317
+E318
+E319
+E31A
+E31B
+E31C
+E31D
+E31E
+E31F
+E320
+E321
+E322
+E323
+E324
+E325
+E326
+E327
+E328
+E329
+E32A
+E32B
+E32C
+E32D
+E32E
+E32F
+E330
+E331
+E332
+E333
+E334
+E335
+E336
+E337
+E338
+E339
+E33A
+E33B
+E33C
+E33D
+E33E
+E33F
+E340
+E341
+E342
+E343
+E344
+E345
+E346
+E347
+E348
+E349
+E34A
+E34B
+E34C
+E34D
+E34E
+E34F
+E350
+E351
+E352
+E353
+E354
+E355
+E356
+E357
+E358
+E359
+E35A
+E35B
+E35C
+E35D
+E35E
+E35F
+E360
+E361
+E362
+E363
+E364
+E365
+E366
+E367
+E368
+E369
+E36A
+E36B
+E36C
+E36D
+E36E
+E36F
+E370
+E371
+E372
+E373
+E374
+E375
+E376
+E377
+E378
+E379
+E37A
+E37B
+E37C
+E37D
+E37E
+E37F
+E380
+E381
+E382
+E383
+E384
+E385
+E386
+E387
+E388
+E389
+E38A
+E38B
+E38C
+E38D
+E38E
+E38F
+E390
+E391
+E392
+E393
+E394
+E395
+E396
+E397
+E398
+E399
+E39A
+E39B
+E39C
+E39D
+E39E
+E39F
+E3A0
+E3A1
+E3A2
+E3A3
+E3A4
+E3A5
+E3A6
+E3A7
+E3A8
+E3A9
+E3AA
+E3AB
+E3AC
+E3AD
+E3AE
+E3AF
+E3B0
+E3B1
+E3B2
+E3B3
+E3B4
+E3B5
+E3B6
+E3B7
+E3B8
+E3B9
+E3BA
+E3BB
+E3BC
+E3BD
+E3BE
+E3BF
+E3C0
+E3C1
+E3C2
+E3C3
+E3C4
+E3C5
+E3C6
+E3C7
+E3C8
+E3C9
+E3CA
+E3CB
+E3CC
+E3CD
+E3CE
+E3CF
+E3D0
+E3D1
+E3D2
+E3D3
+E3D4
+E3D5
+E3D6
+E3D7
+E3D8
+E3D9
+E3DA
+E3DB
+E3DC
+E3DD
+E3DE
+E3DF
+E3E0
+E3E1
+E3E2
+E3E3
+E3E4
+E3E5
+E3E6
+E3E7
+E3E8
+E3E9
+E3EA
+E3EB
+E3EC
+E3ED
+E3EE
+E3EF
+E3F0
+E3F1
+E3F2
+E3F3
+E3F4
+E3F5
+E3F6
+E3F7
+E3F8
+E3F9
+E3FA
+E3FB
+E3FC
+E3FD
+E3FE
+E3FF
+E400
+E401
+E402
+E403
+E404
+E405
+E406
+E407
+E408
+E409
+E40A
+E40B
+E40C
+E40D
+E40E
+E40F
+E410
+E411
+E412
+E413
+E414
+E415
+E416
+E417
+E418
+E419
+E41A
+E41B
+E41C
+E41D
+E41E
+E41F
+E420
+E421
+E422
+E423
+E424
+E425
+E426
+E427
+E428
+E429
+E42A
+E42B
+E42C
+E42D
+E42E
+E42F
+E430
+E431
+E432
+E433
+E434
+E435
+E436
+E437
+E438
+E439
+E43A
+E43B
+E43C
+E43D
+E43E
+E43F
+E440
+E441
+E442
+E443
+E444
+E445
+E446
+E447
+E448
+E449
+E44A
+E44B
+E44C
+E44D
+E44E
+E44F
+E450
+E451
+E452
+E453
+E454
+E455
+E456
+E457
+E458
+E459
+E45A
+E45B
+E45C
+E45D
+E45E
+E45F
+E460
+E461
+E462
+E463
+E464
+E465
+E466
+E467
+E468
+E469
+E46A
+E46B
+E46C
+E46D
+E46E
+E46F
+E470
+E471
+E472
+E473
+E474
+E475
+E476
+E477
+E478
+E479
+E47A
+E47B
+E47C
+E47D
+E47E
+E47F
+E480
+E481
+E482
+E483
+E484
+E485
+E486
+E487
+E488
+E489
+E48A
+E48B
+E48C
+E48D
+E48E
+E48F
+E490
+E491
+E492
+E493
+E494
+E495
+E496
+E497
+E498
+E499
+E49A
+E49B
+E49C
+E49D
+E49E
+E49F
+E4A0
+E4A1
+E4A2
+E4A3
+E4A4
+E4A5
+E4A6
+E4A7
+E4A8
+E4A9
+E4AA
+E4AB
+E4AC
+E4AD
+E4AE
+E4AF
+E4B0
+E4B1
+E4B2
+E4B3
+E4B4
+E4B5
+E4B6
+E4B7
+E4B8
+E4B9
+E4BA
+E4BB
+E4BC
+E4BD
+E4BE
+E4BF
+E4C0
+E4C1
+E4C2
+E4C3
+E4C4
+E4C5
+E4C6
+E4C7
+E4C8
+E4C9
+E4CA
+E4CB
+E4CC
+E4CD
+E4CE
+E4CF
+E4D0
+E4D1
+E4D2
+E4D3
+E4D4
+E4D5
+E4D6
+E4D7
+E4D8
+E4D9
+E4DA
+E4DB
+E4DC
+E4DD
+E4DE
+E4DF
+E4E0
+E4E1
+E4E2
+E4E3
+E4E4
+E4E5
+E4E6
+E4E7
+E4E8
+E4E9
+E4EA
+E4EB
+E4EC
+E4ED
+E4EE
+E4EF
+E4F0
+E4F1
+E4F2
+E4F3
+E4F4
+E4F5
+E4F6
+E4F7
+E4F8
+E4F9
+E4FA
+E4FB
+E4FC
+E4FD
+E4FE
+E4FF
+E500
+E501
+E502
+E503
+E504
+E505
+E506
+E507
+E508
+E509
+E50A
+E50B
+E50C
+E50D
+E50E
+E50F
+E510
+E511
+E512
+E513
+E514
+E515
+E516
+E517
+E518
+E519
+E51A
+E51B
+E51C
+E51D
+E51E
+E51F
+E520
+E521
+E522
+E523
+E524
+E525
+E526
+E527
+E528
+E529
+E52A
+E52B
+E52C
+E52D
+E52E
+E52F
+E530
+E531
+E532
+E533
+E534
+E535
+E536
+E537
+E538
+E539
+E53A
+E53B
+E53C
+E53D
+E53E
+E53F
+E540
+E541
+E542
+E543
+E544
+E545
+E546
+E547
+E548
+E549
+E54A
+E54B
+E54C
+E54D
+E54E
+E54F
+E550
+E551
+E552
+E553
+E554
+E555
+E556
+E557
+E558
+E559
+E55A
+E55B
+E55C
+E55D
+E55E
+E55F
+E560
+E561
+E562
+E563
+E564
+E565
+E566
+E567
+E568
+E569
+E56A
+E56B
+E56C
+E56D
+E56E
+E56F
+E570
+E571
+E572
+E573
+E574
+E575
+E576
+E577
+E578
+E579
+E57A
+E57B
+E57C
+E57D
+E57E
+E57F
+E580
+E581
+E582
+E583
+E584
+E585
+E586
+E587
+E588
+E589
+E58A
+E58B
+E58C
+E58D
+E58E
+E58F
+E590
+E591
+E592
+E593
+E594
+E595
+E596
+E597
+E598
+E599
+E59A
+E59B
+E59C
+E59D
+E59E
+E59F
+E5A0
+E5A1
+E5A2
+E5A3
+E5A4
+E5A5
+E5A6
+E5A7
+E5A8
+E5A9
+E5AA
+E5AB
+E5AC
+E5AD
+E5AE
+E5AF
+E5B0
+E5B1
+E5B2
+E5B3
+E5B4
+E5B5
+E5B6
+E5B7
+E5B8
+E5B9
+E5BA
+E5BB
+E5BC
+E5BD
+E5BE
+E5BF
+E5C0
+E5C1
+E5C2
+E5C3
+E5C4
+E5C5
+E5C6
+E5C7
+E5C8
+E5C9
+E5CA
+E5CB
+E5CC
+E5CD
+E5CE
+E5CF
+E5D0
+E5D1
+E5D2
+E5D3
+E5D4
+E5D5
+E5D6
+E5D7
+E5D8
+E5D9
+E5DA
+E5DB
+E5DC
+E5DD
+E5DE
+E5DF
+E5E0
+E5E1
+E5E2
+E5E3
+E5E4
+E5E5
+E5E6
+E5E7
+E5E8
+E5E9
+E5EA
+E5EB
+E5EC
+E5ED
+E5EE
+E5EF
+E5F0
+E5F1
+E5F2
+E5F3
+E5F4
+E5F5
+E5F6
+E5F7
+E5F8
+E5F9
+E5FA
+E5FB
+E5FC
+E5FD
+E5FE
+E5FF
+E600
+E601
+E602
+E603
+E604
+E605
+E606
+E607
+E608
+E609
+E60A
+E60B
+E60C
+E60D
+E60E
+E60F
+E610
+E611
+E612
+E613
+E614
+E615
+E616
+E617
+E618
+E619
+E61A
+E61B
+E61C
+E61D
+E61E
+E61F
+E620
+E621
+E622
+E623
+E624
+E625
+E626
+E627
+E628
+E629
+E62A
+E62B
+E62C
+E62D
+E62E
+E62F
+E630
+E631
+E632
+E633
+E634
+E635
+E636
+E637
+E638
+E639
+E63A
+E63B
+E63C
+E63D
+E63E
+E63F
+E640
+E641
+E642
+E643
+E644
+E645
+E646
+E647
+E648
+E649
+E64A
+E64B
+E64C
+E64D
+E64E
+E64F
+E650
+E651
+E652
+E653
+E654
+E655
+E656
+E657
+E658
+E659
+E65A
+E65B
+E65C
+E65D
+E65E
+E65F
+E660
+E661
+E662
+E663
+E664
+E665
+E666
+E667
+E668
+E669
+E66A
+E66B
+E66C
+E66D
+E66E
+E66F
+E670
+E671
+E672
+E673
+E674
+E675
+E676
+E677
+E678
+E679
+E67A
+E67B
+E67C
+E67D
+E67E
+E67F
+E680
+E681
+E682
+E683
+E684
+E685
+E686
+E687
+E688
+E689
+E68A
+E68B
+E68C
+E68D
+E68E
+E68F
+E690
+E691
+E692
+E693
+E694
+E695
+E696
+E697
+E698
+E699
+E69A
+E69B
+E69C
+E69D
+E69E
+E69F
+E6A0
+E6A1
+E6A2
+E6A3
+E6A4
+E6A5
+E6A6
+E6A7
+E6A8
+E6A9
+E6AA
+E6AB
+E6AC
+E6AD
+E6AE
+E6AF
+E6B0
+E6B1
+E6B2
+E6B3
+E6B4
+E6B5
+E6B6
+E6B7
+E6B8
+E6B9
+E6BA
+E6BB
+E6BC
+E6BD
+E6BE
+E6BF
+E6C0
+E6C1
+E6C2
+E6C3
+E6C4
+E6C5
+E6C6
+E6C7
+E6C8
+E6C9
+E6CA
+E6CB
+E6CC
+E6CD
+E6CE
+E6CF
+E6D0
+E6D1
+E6D2
+E6D3
+E6D4
+E6D5
+E6D6
+E6D7
+E6D8
+E6D9
+E6DA
+E6DB
+E6DC
+E6DD
+E6DE
+E6DF
+E6E0
+E6E1
+E6E2
+E6E3
+E6E4
+E6E5
+E6E6
+E6E7
+E6E8
+E6E9
+E6EA
+E6EB
+E6EC
+E6ED
+E6EE
+E6EF
+E6F0
+E6F1
+E6F2
+E6F3
+E6F4
+E6F5
+E6F6
+E6F7
+E6F8
+E6F9
+E6FA
+E6FB
+E6FC
+E6FD
+E6FE
+E6FF
+E700
+E701
+E702
+E703
+E704
+E705
+E706
+E707
+E708
+E709
+E70A
+E70B
+E70C
+E70D
+E70E
+E70F
+E710
+E711
+E712
+E713
+E714
+E715
+E716
+E717
+E718
+E719
+E71A
+E71B
+E71C
+E71D
+E71E
+E71F
+E720
+E721
+E722
+E723
+E724
+E725
+E726
+E727
+E728
+E729
+E72A
+E72B
+E72C
+E72D
+E72E
+E72F
+E730
+E731
+E732
+E733
+E734
+E735
+E736
+E737
+E738
+E739
+E73A
+E73B
+E73C
+E73D
+E73E
+E73F
+E740
+E741
+E742
+E743
+E744
+E745
+E746
+E747
+E748
+E749
+E74A
+E74B
+E74C
+E74D
+E74E
+E74F
+E750
+E751
+E752
+E753
+E754
+E755
+E756
+E757
+CREATE TABLE t3 SELECT CONVERT(c1 USING cp932) AS c1 FROM t2;
+SELECT HEX(c1) FROM t3;
+HEX(c1)
+05
+7E
+815C
+815F
+8160
+8161
+817C
+8191
+8192
+81CA
+8740
+8741
+8742
+8743
+8744
+8745
+8746
+8747
+8748
+8749
+874A
+874B
+874C
+874D
+874E
+874F
+8750
+8751
+8752
+8753
+8754
+8755
+8756
+8757
+8758
+8759
+875A
+875B
+875C
+875D
+875F
+8760
+8761
+8762
+8763
+8764
+8765
+8766
+8767
+8768
+8769
+876A
+876B
+876C
+876D
+876E
+876F
+8770
+8771
+8772
+8773
+8774
+8775
+877E
+8780
+8781
+8782
+8783
+8784
+8785
+8786
+8787
+8788
+8789
+878A
+878B
+878C
+878D
+878E
+878F
+81E0
+81DF
+81E7
+8793
+8794
+81E3
+81DB
+81DA
+8798
+8799
+81E6
+81BF
+81BE
+FA5C
+FA5D
+FA5E
+FA5F
+FA60
+FA61
+FA62
+FA63
+FA64
+FA65
+FA66
+FA67
+FA68
+FA69
+FA6A
+FA6B
+FA6C
+FA6D
+FA6E
+FA6F
+FA70
+FA71
+FA72
+FA73
+FA74
+FA75
+FA76
+FA77
+FA78
+FA79
+FA7A
+FA7B
+FA7C
+FA7D
+FA7E
+FA80
+FA81
+FA82
+FA83
+FA84
+FA85
+FA86
+FA87
+FA88
+FA89
+FA8A
+FA8B
+FA8C
+FA8D
+FA8E
+FA8F
+FA90
+FA91
+FA92
+FA93
+FA94
+FA95
+FA96
+FA97
+FA98
+FA99
+FA9A
+FA9B
+FA9C
+FA9D
+FA9E
+FA9F
+FAA0
+FAA1
+FAA2
+FAA3
+FAA4
+FAA5
+FAA6
+FAA7
+FAA8
+FAA9
+FAAA
+FAAB
+FAAC
+FAAD
+FAAE
+FAAF
+FAB0
+FAB1
+FAB2
+FAB3
+FAB4
+FAB5
+FAB6
+FAB7
+FAB8
+FAB9
+FABA
+FABB
+FABC
+FABD
+FABE
+FABF
+FAC0
+FAC1
+FAC2
+FAC3
+FAC4
+FAC5
+FAC6
+FAC7
+FAC8
+FAC9
+FACA
+FACB
+FACC
+FACD
+FACE
+FACF
+FAD0
+FAD1
+FAD2
+FAD3
+FAD4
+FAD5
+FAD6
+FAD7
+FAD8
+FAD9
+FADA
+FADB
+FADC
+FADD
+FADE
+FADF
+FAE0
+FAE1
+FAE2
+FAE3
+FAE4
+FAE5
+FAE6
+FAE7
+FAE8
+FAE9
+FAEA
+FAEB
+FAEC
+FAED
+FAEE
+FAEF
+FAF0
+FAF1
+FAF2
+FAF3
+FAF4
+FAF5
+FAF6
+FAF7
+FAF8
+FAF9
+FAFA
+FAFB
+FAFC
+FB40
+FB41
+FB42
+FB43
+FB44
+FB45
+FB46
+FB47
+FB48
+FB49
+FB4A
+FB4B
+FB4C
+FB4D
+FB4E
+FB4F
+FB50
+FB51
+FB52
+FB53
+FB54
+FB55
+FB56
+FB57
+FB58
+FB59
+FB5A
+FB5B
+FB5C
+FB5D
+FB5E
+FB5F
+FB60
+FB61
+FB62
+FB63
+FB64
+FB65
+FB66
+FB67
+FB68
+FB69
+FB6A
+FB6B
+FB6C
+FB6D
+FB6E
+FB6F
+FB70
+FB71
+FB72
+FB73
+FB74
+FB75
+FB76
+FB77
+FB78
+FB79
+FB7A
+FB7B
+FB7C
+FB7D
+FB7E
+FB80
+FB81
+FB82
+FB83
+FB84
+FB85
+FB86
+FB87
+FB88
+FB89
+FB8A
+FB8B
+FB8C
+FB8D
+FB8E
+FB8F
+FB90
+FB91
+FB92
+FB93
+FB94
+FB95
+FB96
+FB97
+FB98
+FB99
+FB9A
+FB9B
+FB9C
+FB9D
+FB9E
+FB9F
+FBA0
+FBA1
+FBA2
+FBA3
+FBA4
+FBA5
+FBA6
+FBA7
+FBA8
+FBA9
+FBAA
+FBAB
+FBAC
+FBAD
+FBAE
+FBAF
+FBB0
+FBB1
+FBB2
+FBB3
+FBB4
+FBB5
+FBB6
+FBB7
+FBB8
+FBB9
+FBBA
+FBBB
+FBBC
+FBBD
+FBBE
+FBBF
+FBC0
+FBC1
+FBC2
+FBC3
+FBC4
+FBC5
+FBC6
+FBC7
+FBC8
+FBC9
+FBCA
+FBCB
+FBCC
+FBCD
+FBCE
+FBCF
+FBD0
+FBD1
+FBD2
+FBD3
+FBD4
+FBD5
+FBD6
+FBD7
+FBD8
+FBD9
+FBDA
+FBDB
+FBDC
+FBDD
+FBDE
+FBDF
+FBE0
+FBE1
+FBE2
+FBE3
+FBE4
+FBE5
+FBE6
+FBE7
+FBE8
+FBE9
+FBEA
+FBEB
+FBEC
+FBED
+FBEE
+FBEF
+FBF0
+FBF1
+FBF2
+FBF3
+FBF4
+FBF5
+FBF6
+FBF7
+FBF8
+FBF9
+FBFA
+FBFB
+FBFC
+FC40
+FC41
+FC42
+FC43
+FC44
+FC45
+FC46
+FC47
+FC48
+FC49
+FC4A
+FC4B
+FA40
+FA41
+FA42
+FA43
+FA44
+FA45
+FA46
+FA47
+FA48
+FA49
+81CA
+FA55
+FA56
+FA57
+FA40
+FA41
+FA42
+FA43
+FA44
+FA45
+FA46
+FA47
+FA48
+FA49
+8754
+8755
+8756
+8757
+8758
+8759
+875A
+875B
+875C
+875D
+81CA
+FA55
+FA56
+FA57
+878A
+8782
+8784
+81E6
+FA5C
+FA5D
+FA5E
+FA5F
+FA60
+FA61
+FA62
+FA63
+FA64
+FA65
+FA66
+FA67
+FA68
+FA69
+FA6A
+FA6B
+FA6C
+FA6D
+FA6E
+FA6F
+FA70
+FA71
+FA72
+FA73
+FA74
+FA75
+FA76
+FA77
+FA78
+FA79
+FA7A
+FA7B
+FA7C
+FA7D
+FA7E
+FA80
+FA81
+FA82
+FA83
+FA84
+FA85
+FA86
+FA87
+FA88
+FA89
+FA8A
+FA8B
+FA8C
+FA8D
+FA8E
+FA8F
+FA90
+FA91
+FA92
+FA93
+FA94
+FA95
+FA96
+FA97
+FA98
+FA99
+FA9A
+FA9B
+FA9C
+FA9D
+FA9E
+FA9F
+FAA0
+FAA1
+FAA2
+FAA3
+FAA4
+FAA5
+FAA6
+FAA7
+FAA8
+FAA9
+FAAA
+FAAB
+FAAC
+FAAD
+FAAE
+FAAF
+FAB0
+FAB1
+FAB2
+FAB3
+FAB4
+FAB5
+FAB6
+FAB7
+FAB8
+FAB9
+FABA
+FABB
+FABC
+FABD
+FABE
+FABF
+FAC0
+FAC1
+FAC2
+FAC3
+FAC4
+FAC5
+FAC6
+FAC7
+FAC8
+FAC9
+FACA
+FACB
+FACC
+FACD
+FACE
+FACF
+FAD0
+FAD1
+FAD2
+FAD3
+FAD4
+FAD5
+FAD6
+FAD7
+FAD8
+FAD9
+FADA
+FADB
+FADC
+FADD
+FADE
+FADF
+FAE0
+FAE1
+FAE2
+FAE3
+FAE4
+FAE5
+FAE6
+FAE7
+FAE8
+FAE9
+FAEA
+FAEB
+FAEC
+FAED
+FAEE
+FAEF
+FAF0
+FAF1
+FAF2
+FAF3
+FAF4
+FAF5
+FAF6
+FAF7
+FAF8
+FAF9
+FAFA
+FAFB
+FAFC
+FB40
+FB41
+FB42
+FB43
+FB44
+FB45
+FB46
+FB47
+FB48
+FB49
+FB4A
+FB4B
+FB4C
+FB4D
+FB4E
+FB4F
+FB50
+FB51
+FB52
+FB53
+FB54
+FB55
+FB56
+FB57
+FB58
+FB59
+FB5A
+FB5B
+FB5C
+FB5D
+FB5E
+FB5F
+FB60
+FB61
+FB62
+FB63
+FB64
+FB65
+FB66
+FB67
+FB68
+FB69
+FB6A
+FB6B
+FB6C
+FB6D
+FB6E
+FB6F
+FB70
+FB71
+FB72
+FB73
+FB74
+FB75
+FB76
+FB77
+FB78
+FB79
+FB7A
+FB7B
+FB7C
+FB7D
+FB7E
+FB80
+FB81
+FB82
+FB83
+FB84
+FB85
+FB86
+FB87
+FB88
+FB89
+FB8A
+FB8B
+FB8C
+FB8D
+FB8E
+FB8F
+FB90
+FB91
+FB92
+FB93
+FB94
+FB95
+FB96
+FB97
+FB98
+FB99
+FB9A
+FB9B
+FB9C
+FB9D
+FB9E
+FB9F
+FBA0
+FBA1
+FBA2
+FBA3
+FBA4
+FBA5
+FBA6
+FBA7
+FBA8
+FBA9
+FBAA
+FBAB
+FBAC
+FBAD
+FBAE
+FBAF
+FBB0
+FBB1
+FBB2
+FBB3
+FBB4
+FBB5
+FBB6
+FBB7
+FBB8
+FBB9
+FBBA
+FBBB
+FBBC
+FBBD
+FBBE
+FBBF
+FBC0
+FBC1
+FBC2
+FBC3
+FBC4
+FBC5
+FBC6
+FBC7
+FBC8
+FBC9
+FBCA
+FBCB
+FBCC
+FBCD
+FBCE
+FBCF
+FBD0
+FBD1
+FBD2
+FBD3
+FBD4
+FBD5
+FBD6
+FBD7
+FBD8
+FBD9
+FBDA
+FBDB
+FBDC
+FBDD
+FBDE
+FBDF
+FBE0
+FBE1
+FBE2
+FBE3
+FBE4
+FBE5
+FBE6
+FBE7
+FBE8
+FBE9
+FBEA
+FBEB
+FBEC
+FBED
+FBEE
+FBEF
+FBF0
+FBF1
+FBF2
+FBF3
+FBF4
+FBF5
+FBF6
+FBF7
+FBF8
+FBF9
+FBFA
+FBFB
+FBFC
+FC40
+FC41
+FC42
+FC43
+FC44
+FC45
+FC46
+FC47
+FC48
+FC49
+FC4A
+FC4B
+F040
+F041
+F042
+F043
+F044
+F045
+F046
+F047
+F048
+F049
+F04A
+F04B
+F04C
+F04D
+F04E
+F04F
+F050
+F051
+F052
+F053
+F054
+F055
+F056
+F057
+F058
+F059
+F05A
+F05B
+F05C
+F05D
+F05E
+F05F
+F060
+F061
+F062
+F063
+F064
+F065
+F066
+F067
+F068
+F069
+F06A
+F06B
+F06C
+F06D
+F06E
+F06F
+F070
+F071
+F072
+F073
+F074
+F075
+F076
+F077
+F078
+F079
+F07A
+F07B
+F07C
+F07D
+F07E
+F080
+F081
+F082
+F083
+F084
+F085
+F086
+F087
+F088
+F089
+F08A
+F08B
+F08C
+F08D
+F08E
+F08F
+F090
+F091
+F092
+F093
+F094
+F095
+F096
+F097
+F098
+F099
+F09A
+F09B
+F09C
+F09D
+F09E
+F09F
+F0A0
+F0A1
+F0A2
+F0A3
+F0A4
+F0A5
+F0A6
+F0A7
+F0A8
+F0A9
+F0AA
+F0AB
+F0AC
+F0AD
+F0AE
+F0AF
+F0B0
+F0B1
+F0B2
+F0B3
+F0B4
+F0B5
+F0B6
+F0B7
+F0B8
+F0B9
+F0BA
+F0BB
+F0BC
+F0BD
+F0BE
+F0BF
+F0C0
+F0C1
+F0C2
+F0C3
+F0C4
+F0C5
+F0C6
+F0C7
+F0C8
+F0C9
+F0CA
+F0CB
+F0CC
+F0CD
+F0CE
+F0CF
+F0D0
+F0D1
+F0D2
+F0D3
+F0D4
+F0D5
+F0D6
+F0D7
+F0D8
+F0D9
+F0DA
+F0DB
+F0DC
+F0DD
+F0DE
+F0DF
+F0E0
+F0E1
+F0E2
+F0E3
+F0E4
+F0E5
+F0E6
+F0E7
+F0E8
+F0E9
+F0EA
+F0EB
+F0EC
+F0ED
+F0EE
+F0EF
+F0F0
+F0F1
+F0F2
+F0F3
+F0F4
+F0F5
+F0F6
+F0F7
+F0F8
+F0F9
+F0FA
+F0FB
+F0FC
+F140
+F141
+F142
+F143
+F144
+F145
+F146
+F147
+F148
+F149
+F14A
+F14B
+F14C
+F14D
+F14E
+F14F
+F150
+F151
+F152
+F153
+F154
+F155
+F156
+F157
+F158
+F159
+F15A
+F15B
+F15C
+F15D
+F15E
+F15F
+F160
+F161
+F162
+F163
+F164
+F165
+F166
+F167
+F168
+F169
+F16A
+F16B
+F16C
+F16D
+F16E
+F16F
+F170
+F171
+F172
+F173
+F174
+F175
+F176
+F177
+F178
+F179
+F17A
+F17B
+F17C
+F17D
+F17E
+F180
+F181
+F182
+F183
+F184
+F185
+F186
+F187
+F188
+F189
+F18A
+F18B
+F18C
+F18D
+F18E
+F18F
+F190
+F191
+F192
+F193
+F194
+F195
+F196
+F197
+F198
+F199
+F19A
+F19B
+F19C
+F19D
+F19E
+F19F
+F1A0
+F1A1
+F1A2
+F1A3
+F1A4
+F1A5
+F1A6
+F1A7
+F1A8
+F1A9
+F1AA
+F1AB
+F1AC
+F1AD
+F1AE
+F1AF
+F1B0
+F1B1
+F1B2
+F1B3
+F1B4
+F1B5
+F1B6
+F1B7
+F1B8
+F1B9
+F1BA
+F1BB
+F1BC
+F1BD
+F1BE
+F1BF
+F1C0
+F1C1
+F1C2
+F1C3
+F1C4
+F1C5
+F1C6
+F1C7
+F1C8
+F1C9
+F1CA
+F1CB
+F1CC
+F1CD
+F1CE
+F1CF
+F1D0
+F1D1
+F1D2
+F1D3
+F1D4
+F1D5
+F1D6
+F1D7
+F1D8
+F1D9
+F1DA
+F1DB
+F1DC
+F1DD
+F1DE
+F1DF
+F1E0
+F1E1
+F1E2
+F1E3
+F1E4
+F1E5
+F1E6
+F1E7
+F1E8
+F1E9
+F1EA
+F1EB
+F1EC
+F1ED
+F1EE
+F1EF
+F1F0
+F1F1
+F1F2
+F1F3
+F1F4
+F1F5
+F1F6
+F1F7
+F1F8
+F1F9
+F1FA
+F1FB
+F1FC
+F240
+F241
+F242
+F243
+F244
+F245
+F246
+F247
+F248
+F249
+F24A
+F24B
+F24C
+F24D
+F24E
+F24F
+F250
+F251
+F252
+F253
+F254
+F255
+F256
+F257
+F258
+F259
+F25A
+F25B
+F25C
+F25D
+F25E
+F25F
+F260
+F261
+F262
+F263
+F264
+F265
+F266
+F267
+F268
+F269
+F26A
+F26B
+F26C
+F26D
+F26E
+F26F
+F270
+F271
+F272
+F273
+F274
+F275
+F276
+F277
+F278
+F279
+F27A
+F27B
+F27C
+F27D
+F27E
+F280
+F281
+F282
+F283
+F284
+F285
+F286
+F287
+F288
+F289
+F28A
+F28B
+F28C
+F28D
+F28E
+F28F
+F290
+F291
+F292
+F293
+F294
+F295
+F296
+F297
+F298
+F299
+F29A
+F29B
+F29C
+F29D
+F29E
+F29F
+F2A0
+F2A1
+F2A2
+F2A3
+F2A4
+F2A5
+F2A6
+F2A7
+F2A8
+F2A9
+F2AA
+F2AB
+F2AC
+F2AD
+F2AE
+F2AF
+F2B0
+F2B1
+F2B2
+F2B3
+F2B4
+F2B5
+F2B6
+F2B7
+F2B8
+F2B9
+F2BA
+F2BB
+F2BC
+F2BD
+F2BE
+F2BF
+F2C0
+F2C1
+F2C2
+F2C3
+F2C4
+F2C5
+F2C6
+F2C7
+F2C8
+F2C9
+F2CA
+F2CB
+F2CC
+F2CD
+F2CE
+F2CF
+F2D0
+F2D1
+F2D2
+F2D3
+F2D4
+F2D5
+F2D6
+F2D7
+F2D8
+F2D9
+F2DA
+F2DB
+F2DC
+F2DD
+F2DE
+F2DF
+F2E0
+F2E1
+F2E2
+F2E3
+F2E4
+F2E5
+F2E6
+F2E7
+F2E8
+F2E9
+F2EA
+F2EB
+F2EC
+F2ED
+F2EE
+F2EF
+F2F0
+F2F1
+F2F2
+F2F3
+F2F4
+F2F5
+F2F6
+F2F7
+F2F8
+F2F9
+F2FA
+F2FB
+F2FC
+F340
+F341
+F342
+F343
+F344
+F345
+F346
+F347
+F348
+F349
+F34A
+F34B
+F34C
+F34D
+F34E
+F34F
+F350
+F351
+F352
+F353
+F354
+F355
+F356
+F357
+F358
+F359
+F35A
+F35B
+F35C
+F35D
+F35E
+F35F
+F360
+F361
+F362
+F363
+F364
+F365
+F366
+F367
+F368
+F369
+F36A
+F36B
+F36C
+F36D
+F36E
+F36F
+F370
+F371
+F372
+F373
+F374
+F375
+F376
+F377
+F378
+F379
+F37A
+F37B
+F37C
+F37D
+F37E
+F380
+F381
+F382
+F383
+F384
+F385
+F386
+F387
+F388
+F389
+F38A
+F38B
+F38C
+F38D
+F38E
+F38F
+F390
+F391
+F392
+F393
+F394
+F395
+F396
+F397
+F398
+F399
+F39A
+F39B
+F39C
+F39D
+F39E
+F39F
+F3A0
+F3A1
+F3A2
+F3A3
+F3A4
+F3A5
+F3A6
+F3A7
+F3A8
+F3A9
+F3AA
+F3AB
+F3AC
+F3AD
+F3AE
+F3AF
+F3B0
+F3B1
+F3B2
+F3B3
+F3B4
+F3B5
+F3B6
+F3B7
+F3B8
+F3B9
+F3BA
+F3BB
+F3BC
+F3BD
+F3BE
+F3BF
+F3C0
+F3C1
+F3C2
+F3C3
+F3C4
+F3C5
+F3C6
+F3C7
+F3C8
+F3C9
+F3CA
+F3CB
+F3CC
+F3CD
+F3CE
+F3CF
+F3D0
+F3D1
+F3D2
+F3D3
+F3D4
+F3D5
+F3D6
+F3D7
+F3D8
+F3D9
+F3DA
+F3DB
+F3DC
+F3DD
+F3DE
+F3DF
+F3E0
+F3E1
+F3E2
+F3E3
+F3E4
+F3E5
+F3E6
+F3E7
+F3E8
+F3E9
+F3EA
+F3EB
+F3EC
+F3ED
+F3EE
+F3EF
+F3F0
+F3F1
+F3F2
+F3F3
+F3F4
+F3F5
+F3F6
+F3F7
+F3F8
+F3F9
+F3FA
+F3FB
+F3FC
+F440
+F441
+F442
+F443
+F444
+F445
+F446
+F447
+F448
+F449
+F44A
+F44B
+F44C
+F44D
+F44E
+F44F
+F450
+F451
+F452
+F453
+F454
+F455
+F456
+F457
+F458
+F459
+F45A
+F45B
+F45C
+F45D
+F45E
+F45F
+F460
+F461
+F462
+F463
+F464
+F465
+F466
+F467
+F468
+F469
+F46A
+F46B
+F46C
+F46D
+F46E
+F46F
+F470
+F471
+F472
+F473
+F474
+F475
+F476
+F477
+F478
+F479
+F47A
+F47B
+F47C
+F47D
+F47E
+F480
+F481
+F482
+F483
+F484
+F485
+F486
+F487
+F488
+F489
+F48A
+F48B
+F48C
+F48D
+F48E
+F48F
+F490
+F491
+F492
+F493
+F494
+F495
+F496
+F497
+F498
+F499
+F49A
+F49B
+F49C
+F49D
+F49E
+F49F
+F4A0
+F4A1
+F4A2
+F4A3
+F4A4
+F4A5
+F4A6
+F4A7
+F4A8
+F4A9
+F4AA
+F4AB
+F4AC
+F4AD
+F4AE
+F4AF
+F4B0
+F4B1
+F4B2
+F4B3
+F4B4
+F4B5
+F4B6
+F4B7
+F4B8
+F4B9
+F4BA
+F4BB
+F4BC
+F4BD
+F4BE
+F4BF
+F4C0
+F4C1
+F4C2
+F4C3
+F4C4
+F4C5
+F4C6
+F4C7
+F4C8
+F4C9
+F4CA
+F4CB
+F4CC
+F4CD
+F4CE
+F4CF
+F4D0
+F4D1
+F4D2
+F4D3
+F4D4
+F4D5
+F4D6
+F4D7
+F4D8
+F4D9
+F4DA
+F4DB
+F4DC
+F4DD
+F4DE
+F4DF
+F4E0
+F4E1
+F4E2
+F4E3
+F4E4
+F4E5
+F4E6
+F4E7
+F4E8
+F4E9
+F4EA
+F4EB
+F4EC
+F4ED
+F4EE
+F4EF
+F4F0
+F4F1
+F4F2
+F4F3
+F4F4
+F4F5
+F4F6
+F4F7
+F4F8
+F4F9
+F4FA
+F4FB
+F4FC
+F540
+F541
+F542
+F543
+F544
+F545
+F546
+F547
+F548
+F549
+F54A
+F54B
+F54C
+F54D
+F54E
+F54F
+F550
+F551
+F552
+F553
+F554
+F555
+F556
+F557
+F558
+F559
+F55A
+F55B
+F55C
+F55D
+F55E
+F55F
+F560
+F561
+F562
+F563
+F564
+F565
+F566
+F567
+F568
+F569
+F56A
+F56B
+F56C
+F56D
+F56E
+F56F
+F570
+F571
+F572
+F573
+F574
+F575
+F576
+F577
+F578
+F579
+F57A
+F57B
+F57C
+F57D
+F57E
+F580
+F581
+F582
+F583
+F584
+F585
+F586
+F587
+F588
+F589
+F58A
+F58B
+F58C
+F58D
+F58E
+F58F
+F590
+F591
+F592
+F593
+F594
+F595
+F596
+F597
+F598
+F599
+F59A
+F59B
+F59C
+F59D
+F59E
+F59F
+F5A0
+F5A1
+F5A2
+F5A3
+F5A4
+F5A5
+F5A6
+F5A7
+F5A8
+F5A9
+F5AA
+F5AB
+F5AC
+F5AD
+F5AE
+F5AF
+F5B0
+F5B1
+F5B2
+F5B3
+F5B4
+F5B5
+F5B6
+F5B7
+F5B8
+F5B9
+F5BA
+F5BB
+F5BC
+F5BD
+F5BE
+F5BF
+F5C0
+F5C1
+F5C2
+F5C3
+F5C4
+F5C5
+F5C6
+F5C7
+F5C8
+F5C9
+F5CA
+F5CB
+F5CC
+F5CD
+F5CE
+F5CF
+F5D0
+F5D1
+F5D2
+F5D3
+F5D4
+F5D5
+F5D6
+F5D7
+F5D8
+F5D9
+F5DA
+F5DB
+F5DC
+F5DD
+F5DE
+F5DF
+F5E0
+F5E1
+F5E2
+F5E3
+F5E4
+F5E5
+F5E6
+F5E7
+F5E8
+F5E9
+F5EA
+F5EB
+F5EC
+F5ED
+F5EE
+F5EF
+F5F0
+F5F1
+F5F2
+F5F3
+F5F4
+F5F5
+F5F6
+F5F7
+F5F8
+F5F9
+F5FA
+F5FB
+F5FC
+F640
+F641
+F642
+F643
+F644
+F645
+F646
+F647
+F648
+F649
+F64A
+F64B
+F64C
+F64D
+F64E
+F64F
+F650
+F651
+F652
+F653
+F654
+F655
+F656
+F657
+F658
+F659
+F65A
+F65B
+F65C
+F65D
+F65E
+F65F
+F660
+F661
+F662
+F663
+F664
+F665
+F666
+F667
+F668
+F669
+F66A
+F66B
+F66C
+F66D
+F66E
+F66F
+F670
+F671
+F672
+F673
+F674
+F675
+F676
+F677
+F678
+F679
+F67A
+F67B
+F67C
+F67D
+F67E
+F680
+F681
+F682
+F683
+F684
+F685
+F686
+F687
+F688
+F689
+F68A
+F68B
+F68C
+F68D
+F68E
+F68F
+F690
+F691
+F692
+F693
+F694
+F695
+F696
+F697
+F698
+F699
+F69A
+F69B
+F69C
+F69D
+F69E
+F69F
+F6A0
+F6A1
+F6A2
+F6A3
+F6A4
+F6A5
+F6A6
+F6A7
+F6A8
+F6A9
+F6AA
+F6AB
+F6AC
+F6AD
+F6AE
+F6AF
+F6B0
+F6B1
+F6B2
+F6B3
+F6B4
+F6B5
+F6B6
+F6B7
+F6B8
+F6B9
+F6BA
+F6BB
+F6BC
+F6BD
+F6BE
+F6BF
+F6C0
+F6C1
+F6C2
+F6C3
+F6C4
+F6C5
+F6C6
+F6C7
+F6C8
+F6C9
+F6CA
+F6CB
+F6CC
+F6CD
+F6CE
+F6CF
+F6D0
+F6D1
+F6D2
+F6D3
+F6D4
+F6D5
+F6D6
+F6D7
+F6D8
+F6D9
+F6DA
+F6DB
+F6DC
+F6DD
+F6DE
+F6DF
+F6E0
+F6E1
+F6E2
+F6E3
+F6E4
+F6E5
+F6E6
+F6E7
+F6E8
+F6E9
+F6EA
+F6EB
+F6EC
+F6ED
+F6EE
+F6EF
+F6F0
+F6F1
+F6F2
+F6F3
+F6F4
+F6F5
+F6F6
+F6F7
+F6F8
+F6F9
+F6FA
+F6FB
+F6FC
+F740
+F741
+F742
+F743
+F744
+F745
+F746
+F747
+F748
+F749
+F74A
+F74B
+F74C
+F74D
+F74E
+F74F
+F750
+F751
+F752
+F753
+F754
+F755
+F756
+F757
+F758
+F759
+F75A
+F75B
+F75C
+F75D
+F75E
+F75F
+F760
+F761
+F762
+F763
+F764
+F765
+F766
+F767
+F768
+F769
+F76A
+F76B
+F76C
+F76D
+F76E
+F76F
+F770
+F771
+F772
+F773
+F774
+F775
+F776
+F777
+F778
+F779
+F77A
+F77B
+F77C
+F77D
+F77E
+F780
+F781
+F782
+F783
+F784
+F785
+F786
+F787
+F788
+F789
+F78A
+F78B
+F78C
+F78D
+F78E
+F78F
+F790
+F791
+F792
+F793
+F794
+F795
+F796
+F797
+F798
+F799
+F79A
+F79B
+F79C
+F79D
+F79E
+F79F
+F7A0
+F7A1
+F7A2
+F7A3
+F7A4
+F7A5
+F7A6
+F7A7
+F7A8
+F7A9
+F7AA
+F7AB
+F7AC
+F7AD
+F7AE
+F7AF
+F7B0
+F7B1
+F7B2
+F7B3
+F7B4
+F7B5
+F7B6
+F7B7
+F7B8
+F7B9
+F7BA
+F7BB
+F7BC
+F7BD
+F7BE
+F7BF
+F7C0
+F7C1
+F7C2
+F7C3
+F7C4
+F7C5
+F7C6
+F7C7
+F7C8
+F7C9
+F7CA
+F7CB
+F7CC
+F7CD
+F7CE
+F7CF
+F7D0
+F7D1
+F7D2
+F7D3
+F7D4
+F7D5
+F7D6
+F7D7
+F7D8
+F7D9
+F7DA
+F7DB
+F7DC
+F7DD
+F7DE
+F7DF
+F7E0
+F7E1
+F7E2
+F7E3
+F7E4
+F7E5
+F7E6
+F7E7
+F7E8
+F7E9
+F7EA
+F7EB
+F7EC
+F7ED
+F7EE
+F7EF
+F7F0
+F7F1
+F7F2
+F7F3
+F7F4
+F7F5
+F7F6
+F7F7
+F7F8
+F7F9
+F7FA
+F7FB
+F7FC
+F840
+F841
+F842
+F843
+F844
+F845
+F846
+F847
+F848
+F849
+F84A
+F84B
+F84C
+F84D
+F84E
+F84F
+F850
+F851
+F852
+F853
+F854
+F855
+F856
+F857
+F858
+F859
+F85A
+F85B
+F85C
+F85D
+F85E
+F85F
+F860
+F861
+F862
+F863
+F864
+F865
+F866
+F867
+F868
+F869
+F86A
+F86B
+F86C
+F86D
+F86E
+F86F
+F870
+F871
+F872
+F873
+F874
+F875
+F876
+F877
+F878
+F879
+F87A
+F87B
+F87C
+F87D
+F87E
+F880
+F881
+F882
+F883
+F884
+F885
+F886
+F887
+F888
+F889
+F88A
+F88B
+F88C
+F88D
+F88E
+F88F
+F890
+F891
+F892
+F893
+F894
+F895
+F896
+F897
+F898
+F899
+F89A
+F89B
+F89C
+F89D
+F89E
+F89F
+F8A0
+F8A1
+F8A2
+F8A3
+F8A4
+F8A5
+F8A6
+F8A7
+F8A8
+F8A9
+F8AA
+F8AB
+F8AC
+F8AD
+F8AE
+F8AF
+F8B0
+F8B1
+F8B2
+F8B3
+F8B4
+F8B5
+F8B6
+F8B7
+F8B8
+F8B9
+F8BA
+F8BB
+F8BC
+F8BD
+F8BE
+F8BF
+F8C0
+F8C1
+F8C2
+F8C3
+F8C4
+F8C5
+F8C6
+F8C7
+F8C8
+F8C9
+F8CA
+F8CB
+F8CC
+F8CD
+F8CE
+F8CF
+F8D0
+F8D1
+F8D2
+F8D3
+F8D4
+F8D5
+F8D6
+F8D7
+F8D8
+F8D9
+F8DA
+F8DB
+F8DC
+F8DD
+F8DE
+F8DF
+F8E0
+F8E1
+F8E2
+F8E3
+F8E4
+F8E5
+F8E6
+F8E7
+F8E8
+F8E9
+F8EA
+F8EB
+F8EC
+F8ED
+F8EE
+F8EF
+F8F0
+F8F1
+F8F2
+F8F3
+F8F4
+F8F5
+F8F6
+F8F7
+F8F8
+F8F9
+F8FA
+F8FB
+F8FC
+F940
+F941
+F942
+F943
+F944
+F945
+F946
+F947
+F948
+F949
+F94A
+F94B
+F94C
+F94D
+F94E
+F94F
+F950
+F951
+F952
+F953
+F954
+F955
+F956
+F957
+F958
+F959
+F95A
+F95B
+F95C
+F95D
+F95E
+F95F
+F960
+F961
+F962
+F963
+F964
+F965
+F966
+F967
+F968
+F969
+F96A
+F96B
+F96C
+F96D
+F96E
+F96F
+F970
+F971
+F972
+F973
+F974
+F975
+F976
+F977
+F978
+F979
+F97A
+F97B
+F97C
+F97D
+F97E
+F980
+F981
+F982
+F983
+F984
+F985
+F986
+F987
+F988
+F989
+F98A
+F98B
+F98C
+F98D
+F98E
+F98F
+F990
+F991
+F992
+F993
+F994
+F995
+F996
+F997
+F998
+F999
+F99A
+F99B
+F99C
+F99D
+F99E
+F99F
+F9A0
+F9A1
+F9A2
+F9A3
+F9A4
+F9A5
+F9A6
+F9A7
+F9A8
+F9A9
+F9AA
+F9AB
+F9AC
+F9AD
+F9AE
+F9AF
+F9B0
+F9B1
+F9B2
+F9B3
+F9B4
+F9B5
+F9B6
+F9B7
+F9B8
+F9B9
+F9BA
+F9BB
+F9BC
+F9BD
+F9BE
+F9BF
+F9C0
+F9C1
+F9C2
+F9C3
+F9C4
+F9C5
+F9C6
+F9C7
+F9C8
+F9C9
+F9CA
+F9CB
+F9CC
+F9CD
+F9CE
+F9CF
+F9D0
+F9D1
+F9D2
+F9D3
+F9D4
+F9D5
+F9D6
+F9D7
+F9D8
+F9D9
+F9DA
+F9DB
+F9DC
+F9DD
+F9DE
+F9DF
+F9E0
+F9E1
+F9E2
+F9E3
+F9E4
+F9E5
+F9E6
+F9E7
+F9E8
+F9E9
+F9EA
+F9EB
+F9EC
+F9ED
+F9EE
+F9EF
+F9F0
+F9F1
+F9F2
+F9F3
+F9F4
+F9F5
+F9F6
+F9F7
+F9F8
+F9F9
+F9FA
+F9FB
+F9FC
+CREATE TABLE t4 SELECT CONVERT(c1 USING eucjpms) AS c1 FROM t1;
+SELECT HEX(c1) FROM t4;
+HEX(c1)
+05
+7E
+A1BD
+A1C0
+A1C1
+A1C2
+A1DD
+A1F1
+A1F2
+A2CC
+ADA1
+ADA2
+ADA3
+ADA4
+ADA5
+ADA6
+ADA7
+ADA8
+ADA9
+ADAA
+ADAB
+ADAC
+ADAD
+ADAE
+ADAF
+ADB0
+ADB1
+ADB2
+ADB3
+ADB4
+ADB5
+ADB6
+ADB7
+ADB8
+ADB9
+ADBA
+ADBB
+ADBC
+ADBD
+ADBE
+ADC0
+ADC1
+ADC2
+ADC3
+ADC4
+ADC5
+ADC6
+ADC7
+ADC8
+ADC9
+ADCA
+ADCB
+ADCC
+ADCD
+ADCE
+ADCF
+ADD0
+ADD1
+ADD2
+ADD3
+ADD4
+ADD5
+ADD6
+ADDF
+ADE0
+ADE1
+ADE2
+ADE3
+ADE4
+ADE5
+ADE6
+ADE7
+ADE8
+ADE9
+ADEA
+ADEB
+ADEC
+ADED
+ADEE
+ADEF
+A2E2
+A2E1
+A2E9
+ADF3
+ADF4
+A2E5
+A2DD
+A2DC
+ADF8
+ADF9
+A2E8
+A2C1
+A2C0
+8FD4E3
+8FDCDF
+8FE4E9
+8FE3F8
+8FD9A1
+8FB1BB
+8FF4AE
+8FC2AD
+8FC3FC
+8FE4D0
+8FC2BF
+8FBCF4
+8FB0A9
+8FB0C8
+8FF4AF
+8FB0D2
+8FB0D4
+8FB0E3
+8FB0EE
+8FB1A7
+8FB1A3
+8FB1AC
+8FB1A9
+8FB1BE
+8FB1DF
+8FB1D8
+8FB1C8
+8FB1D7
+8FB1E3
+8FB1F4
+8FB1E1
+8FB2A3
+8FF4B0
+8FB2BB
+8FB2E6
+8FB2ED
+8FB2F5
+8FB2FC
+8FF4B1
+8FB3B5
+8FB3D8
+8FB3DB
+8FB3E5
+8FB3EE
+8FB3FB
+8FF4B2
+8FF4B3
+8FB4C0
+8FB4C7
+8FB4D0
+8FB4DE
+8FF4B4
+8FB5AA
+8FF4B5
+8FB5AF
+8FB5C4
+8FB5E8
+8FF4B6
+8FB7C2
+8FB7E4
+8FB7E8
+8FB7E7
+8FF4B7
+8FF4B8
+8FF4B9
+8FB8CE
+8FB8E1
+8FB8F5
+8FB8F7
+8FB8F8
+8FB8FC
+8FB9AF
+8FB9B7
+8FBABE
+8FBADB
+8FCDAA
+8FBAE1
+8FF4BA
+8FBAEB
+8FBBB3
+8FBBB8
+8FF4BB
+8FBBCA
+8FF4BC
+8FF4BD
+8FBBD0
+8FBBDE
+8FBBF4
+8FBBF5
+8FBBF9
+8FBCE4
+8FBCED
+8FBCFE
+8FF4BE
+8FBDC2
+8FBDE7
+8FF4BF
+8FBDF0
+8FBEB0
+8FBEAC
+8FF4C0
+8FBEB3
+8FBEBD
+8FBECD
+8FBEC9
+8FBEE4
+8FBFA8
+8FBFC9
+8FC0C4
+8FC0E4
+8FC0F4
+8FC1A6
+8FF4C1
+8FC1F5
+8FC1FC
+8FF4C2
+8FC1F8
+8FC2AB
+8FC2A1
+8FC2A5
+8FF4C3
+8FC2B8
+8FC2BA
+8FF4C4
+8FC2C4
+8FC2D2
+8FC2D7
+8FC2DB
+8FC2DE
+8FC2ED
+8FC2F0
+8FF4C5
+8FC3A1
+8FC3B5
+8FC3C9
+8FC3B9
+8FF4C6
+8FC3D8
+8FC3FE
+8FF4C7
+8FC4CC
+8FF4C8
+8FC4D9
+8FC4EA
+8FC4FD
+8FF4C9
+8FC5A7
+8FC5B5
+8FC5B6
+8FF4CA
+8FC5D5
+8FC6B8
+8FC6D7
+8FC6E0
+8FC6EA
+8FC6E3
+8FC7A1
+8FC7AB
+8FC7C7
+8FC7C3
+8FC7CB
+8FC7CF
+8FC7D9
+8FF4CB
+8FF4CC
+8FC7E6
+8FC7EE
+8FC7FC
+8FC7EB
+8FC7F0
+8FC8B1
+8FC8E5
+8FC8F8
+8FC9A6
+8FC9AB
+8FC9AD
+8FF4CD
+8FC9CA
+8FC9D3
+8FC9E9
+8FC9E3
+8FC9FC
+8FC9F4
+8FC9F5
+8FF4CE
+8FCAB3
+8FCABD
+8FCAEF
+8FCAF1
+8FCBAE
+8FF4CF
+8FCBCA
+8FCBE6
+8FCBEA
+8FCBF0
+8FCBF4
+8FCBEE
+8FCCA5
+8FCBF9
+8FCCAB
+8FCCAE
+8FCCAD
+8FCCB2
+8FCCC2
+8FCCD0
+8FCCD9
+8FF4D0
+8FCDBB
+8FF4D1
+8FCEBB
+8FF4D2
+8FCEBA
+8FCEC3
+8FF4D3
+8FCEF2
+8FB3DD
+8FCFD5
+8FCFE2
+8FCFE9
+8FCFED
+8FF4D4
+8FF4D5
+8FF4D6
+8FF4D7
+8FD0E5
+8FF4D8
+8FD0E9
+8FD1E8
+8FF4D9
+8FF4DA
+8FD1EC
+8FD2BB
+8FF4DB
+8FD3E1
+8FD3E8
+8FD4A7
+8FF4DC
+8FF4DD
+8FD4D4
+8FD4F2
+8FD5AE
+8FF4DE
+8FD7DE
+8FF4DF
+8FD8A2
+8FD8B7
+8FD8C1
+8FD8D1
+8FD8F4
+8FD9C6
+8FD9C8
+8FD9D1
+8FF4E0
+8FF4E1
+8FF4E2
+8FF4E3
+8FF4E4
+8FDCD3
+8FDDC8
+8FDDD4
+8FDDEA
+8FDDFA
+8FDEA4
+8FDEB0
+8FF4E5
+8FDEB5
+8FDECB
+8FF4E6
+8FDFB9
+8FF4E7
+8FDFC3
+8FF4E8
+8FF4E9
+8FE0D9
+8FF4EA
+8FF4EB
+8FE1E2
+8FF4EC
+8FF4ED
+8FF4EE
+8FE2C7
+8FE3A8
+8FE3A6
+8FE3A9
+8FE3AF
+8FE3B0
+8FE3AA
+8FE3AB
+8FE3BC
+8FE3C1
+8FE3BF
+8FE3D5
+8FE3D8
+8FE3D6
+8FE3DF
+8FE3E3
+8FE3E1
+8FE3D4
+8FE3E9
+8FE4A6
+8FE3F1
+8FE3F2
+8FE4CB
+8FE4C1
+8FE4C3
+8FE4BE
+8FF4EF
+8FE4C0
+8FE4C7
+8FE4BF
+8FE4E0
+8FE4DE
+8FE4D1
+8FF4F0
+8FE4DC
+8FE4D2
+8FE4DB
+8FE4D4
+8FE4FA
+8FE4EF
+8FE5B3
+8FE5BF
+8FE5C9
+8FE5D0
+8FE5E2
+8FE5EA
+8FE5EB
+8FF4F1
+8FF4F2
+8FF4F3
+8FE6E8
+8FE6EF
+8FE7AC
+8FF4F4
+8FE7AE
+8FF4F5
+8FE7B1
+8FF4F6
+8FE7B2
+8FE8B1
+8FE8B6
+8FF4F7
+8FF4F8
+8FE8DD
+8FF4F9
+8FF4FA
+8FE9D1
+8FF4FB
+8FE9ED
+8FEACD
+8FF4FC
+8FEADB
+8FEAE6
+8FEAEA
+8FEBA5
+8FEBFB
+8FEBFA
+8FF4FD
+8FECD6
+8FF4FE
+8FF3F3
+8FF3F4
+8FF3F5
+8FF3F6
+8FF3F7
+8FF3F8
+8FF3F9
+8FF3FA
+8FF3FB
+8FF3FC
+A2CC
+8FA2C3
+8FF4A9
+8FF4AA
+8FF3F3
+8FF3F4
+8FF3F5
+8FF3F6
+8FF3F7
+8FF3F8
+8FF3F9
+8FF3FA
+8FF3FB
+8FF3FC
+ADB5
+ADB6
+ADB7
+ADB8
+ADB9
+ADBA
+ADBB
+ADBC
+ADBD
+ADBE
+A2CC
+8FA2C3
+8FF4A9
+8FF4AA
+ADEA
+ADE2
+ADE4
+A2E8
+8FD4E3
+8FDCDF
+8FE4E9
+8FE3F8
+8FD9A1
+8FB1BB
+8FF4AE
+8FC2AD
+8FC3FC
+8FE4D0
+8FC2BF
+8FBCF4
+8FB0A9
+8FB0C8
+8FF4AF
+8FB0D2
+8FB0D4
+8FB0E3
+8FB0EE
+8FB1A7
+8FB1A3
+8FB1AC
+8FB1A9
+8FB1BE
+8FB1DF
+8FB1D8
+8FB1C8
+8FB1D7
+8FB1E3
+8FB1F4
+8FB1E1
+8FB2A3
+8FF4B0
+8FB2BB
+8FB2E6
+8FB2ED
+8FB2F5
+8FB2FC
+8FF4B1
+8FB3B5
+8FB3D8
+8FB3DB
+8FB3E5
+8FB3EE
+8FB3FB
+8FF4B2
+8FF4B3
+8FB4C0
+8FB4C7
+8FB4D0
+8FB4DE
+8FF4B4
+8FB5AA
+8FF4B5
+8FB5AF
+8FB5C4
+8FB5E8
+8FF4B6
+8FB7C2
+8FB7E4
+8FB7E8
+8FB7E7
+8FF4B7
+8FF4B8
+8FF4B9
+8FB8CE
+8FB8E1
+8FB8F5
+8FB8F7
+8FB8F8
+8FB8FC
+8FB9AF
+8FB9B7
+8FBABE
+8FBADB
+8FCDAA
+8FBAE1
+8FF4BA
+8FBAEB
+8FBBB3
+8FBBB8
+8FF4BB
+8FBBCA
+8FF4BC
+8FF4BD
+8FBBD0
+8FBBDE
+8FBBF4
+8FBBF5
+8FBBF9
+8FBCE4
+8FBCED
+8FBCFE
+8FF4BE
+8FBDC2
+8FBDE7
+8FF4BF
+8FBDF0
+8FBEB0
+8FBEAC
+8FF4C0
+8FBEB3
+8FBEBD
+8FBECD
+8FBEC9
+8FBEE4
+8FBFA8
+8FBFC9
+8FC0C4
+8FC0E4
+8FC0F4
+8FC1A6
+8FF4C1
+8FC1F5
+8FC1FC
+8FF4C2
+8FC1F8
+8FC2AB
+8FC2A1
+8FC2A5
+8FF4C3
+8FC2B8
+8FC2BA
+8FF4C4
+8FC2C4
+8FC2D2
+8FC2D7
+8FC2DB
+8FC2DE
+8FC2ED
+8FC2F0
+8FF4C5
+8FC3A1
+8FC3B5
+8FC3C9
+8FC3B9
+8FF4C6
+8FC3D8
+8FC3FE
+8FF4C7
+8FC4CC
+8FF4C8
+8FC4D9
+8FC4EA
+8FC4FD
+8FF4C9
+8FC5A7
+8FC5B5
+8FC5B6
+8FF4CA
+8FC5D5
+8FC6B8
+8FC6D7
+8FC6E0
+8FC6EA
+8FC6E3
+8FC7A1
+8FC7AB
+8FC7C7
+8FC7C3
+8FC7CB
+8FC7CF
+8FC7D9
+8FF4CB
+8FF4CC
+8FC7E6
+8FC7EE
+8FC7FC
+8FC7EB
+8FC7F0
+8FC8B1
+8FC8E5
+8FC8F8
+8FC9A6
+8FC9AB
+8FC9AD
+8FF4CD
+8FC9CA
+8FC9D3
+8FC9E9
+8FC9E3
+8FC9FC
+8FC9F4
+8FC9F5
+8FF4CE
+8FCAB3
+8FCABD
+8FCAEF
+8FCAF1
+8FCBAE
+8FF4CF
+8FCBCA
+8FCBE6
+8FCBEA
+8FCBF0
+8FCBF4
+8FCBEE
+8FCCA5
+8FCBF9
+8FCCAB
+8FCCAE
+8FCCAD
+8FCCB2
+8FCCC2
+8FCCD0
+8FCCD9
+8FF4D0
+8FCDBB
+8FF4D1
+8FCEBB
+8FF4D2
+8FCEBA
+8FCEC3
+8FF4D3
+8FCEF2
+8FB3DD
+8FCFD5
+8FCFE2
+8FCFE9
+8FCFED
+8FF4D4
+8FF4D5
+8FF4D6
+8FF4D7
+8FD0E5
+8FF4D8
+8FD0E9
+8FD1E8
+8FF4D9
+8FF4DA
+8FD1EC
+8FD2BB
+8FF4DB
+8FD3E1
+8FD3E8
+8FD4A7
+8FF4DC
+8FF4DD
+8FD4D4
+8FD4F2
+8FD5AE
+8FF4DE
+8FD7DE
+8FF4DF
+8FD8A2
+8FD8B7
+8FD8C1
+8FD8D1
+8FD8F4
+8FD9C6
+8FD9C8
+8FD9D1
+8FF4E0
+8FF4E1
+8FF4E2
+8FF4E3
+8FF4E4
+8FDCD3
+8FDDC8
+8FDDD4
+8FDDEA
+8FDDFA
+8FDEA4
+8FDEB0
+8FF4E5
+8FDEB5
+8FDECB
+8FF4E6
+8FDFB9
+8FF4E7
+8FDFC3
+8FF4E8
+8FF4E9
+8FE0D9
+8FF4EA
+8FF4EB
+8FE1E2
+8FF4EC
+8FF4ED
+8FF4EE
+8FE2C7
+8FE3A8
+8FE3A6
+8FE3A9
+8FE3AF
+8FE3B0
+8FE3AA
+8FE3AB
+8FE3BC
+8FE3C1
+8FE3BF
+8FE3D5
+8FE3D8
+8FE3D6
+8FE3DF
+8FE3E3
+8FE3E1
+8FE3D4
+8FE3E9
+8FE4A6
+8FE3F1
+8FE3F2
+8FE4CB
+8FE4C1
+8FE4C3
+8FE4BE
+8FF4EF
+8FE4C0
+8FE4C7
+8FE4BF
+8FE4E0
+8FE4DE
+8FE4D1
+8FF4F0
+8FE4DC
+8FE4D2
+8FE4DB
+8FE4D4
+8FE4FA
+8FE4EF
+8FE5B3
+8FE5BF
+8FE5C9
+8FE5D0
+8FE5E2
+8FE5EA
+8FE5EB
+8FF4F1
+8FF4F2
+8FF4F3
+8FE6E8
+8FE6EF
+8FE7AC
+8FF4F4
+8FE7AE
+8FF4F5
+8FE7B1
+8FF4F6
+8FE7B2
+8FE8B1
+8FE8B6
+8FF4F7
+8FF4F8
+8FE8DD
+8FF4F9
+8FF4FA
+8FE9D1
+8FF4FB
+8FE9ED
+8FEACD
+8FF4FC
+8FEADB
+8FEAE6
+8FEAEA
+8FEBA5
+8FEBFB
+8FEBFA
+8FF4FD
+8FECD6
+8FF4FE
+F5A1
+F5A2
+F5A3
+F5A4
+F5A5
+F5A6
+F5A7
+F5A8
+F5A9
+F5AA
+F5AB
+F5AC
+F5AD
+F5AE
+F5AF
+F5B0
+F5B1
+F5B2
+F5B3
+F5B4
+F5B5
+F5B6
+F5B7
+F5B8
+F5B9
+F5BA
+F5BB
+F5BC
+F5BD
+F5BE
+F5BF
+F5C0
+F5C1
+F5C2
+F5C3
+F5C4
+F5C5
+F5C6
+F5C7
+F5C8
+F5C9
+F5CA
+F5CB
+F5CC
+F5CD
+F5CE
+F5CF
+F5D0
+F5D1
+F5D2
+F5D3
+F5D4
+F5D5
+F5D6
+F5D7
+F5D8
+F5D9
+F5DA
+F5DB
+F5DC
+F5DD
+F5DE
+F5DF
+F5E0
+F5E1
+F5E2
+F5E3
+F5E4
+F5E5
+F5E6
+F5E7
+F5E8
+F5E9
+F5EA
+F5EB
+F5EC
+F5ED
+F5EE
+F5EF
+F5F0
+F5F1
+F5F2
+F5F3
+F5F4
+F5F5
+F5F6
+F5F7
+F5F8
+F5F9
+F5FA
+F5FB
+F5FC
+F5FD
+F5FE
+F6A1
+F6A2
+F6A3
+F6A4
+F6A5
+F6A6
+F6A7
+F6A8
+F6A9
+F6AA
+F6AB
+F6AC
+F6AD
+F6AE
+F6AF
+F6B0
+F6B1
+F6B2
+F6B3
+F6B4
+F6B5
+F6B6
+F6B7
+F6B8
+F6B9
+F6BA
+F6BB
+F6BC
+F6BD
+F6BE
+F6BF
+F6C0
+F6C1
+F6C2
+F6C3
+F6C4
+F6C5
+F6C6
+F6C7
+F6C8
+F6C9
+F6CA
+F6CB
+F6CC
+F6CD
+F6CE
+F6CF
+F6D0
+F6D1
+F6D2
+F6D3
+F6D4
+F6D5
+F6D6
+F6D7
+F6D8
+F6D9
+F6DA
+F6DB
+F6DC
+F6DD
+F6DE
+F6DF
+F6E0
+F6E1
+F6E2
+F6E3
+F6E4
+F6E5
+F6E6
+F6E7
+F6E8
+F6E9
+F6EA
+F6EB
+F6EC
+F6ED
+F6EE
+F6EF
+F6F0
+F6F1
+F6F2
+F6F3
+F6F4
+F6F5
+F6F6
+F6F7
+F6F8
+F6F9
+F6FA
+F6FB
+F6FC
+F6FD
+F6FE
+F7A1
+F7A2
+F7A3
+F7A4
+F7A5
+F7A6
+F7A7
+F7A8
+F7A9
+F7AA
+F7AB
+F7AC
+F7AD
+F7AE
+F7AF
+F7B0
+F7B1
+F7B2
+F7B3
+F7B4
+F7B5
+F7B6
+F7B7
+F7B8
+F7B9
+F7BA
+F7BB
+F7BC
+F7BD
+F7BE
+F7BF
+F7C0
+F7C1
+F7C2
+F7C3
+F7C4
+F7C5
+F7C6
+F7C7
+F7C8
+F7C9
+F7CA
+F7CB
+F7CC
+F7CD
+F7CE
+F7CF
+F7D0
+F7D1
+F7D2
+F7D3
+F7D4
+F7D5
+F7D6
+F7D7
+F7D8
+F7D9
+F7DA
+F7DB
+F7DC
+F7DD
+F7DE
+F7DF
+F7E0
+F7E1
+F7E2
+F7E3
+F7E4
+F7E5
+F7E6
+F7E7
+F7E8
+F7E9
+F7EA
+F7EB
+F7EC
+F7ED
+F7EE
+F7EF
+F7F0
+F7F1
+F7F2
+F7F3
+F7F4
+F7F5
+F7F6
+F7F7
+F7F8
+F7F9
+F7FA
+F7FB
+F7FC
+F7FD
+F7FE
+F8A1
+F8A2
+F8A3
+F8A4
+F8A5
+F8A6
+F8A7
+F8A8
+F8A9
+F8AA
+F8AB
+F8AC
+F8AD
+F8AE
+F8AF
+F8B0
+F8B1
+F8B2
+F8B3
+F8B4
+F8B5
+F8B6
+F8B7
+F8B8
+F8B9
+F8BA
+F8BB
+F8BC
+F8BD
+F8BE
+F8BF
+F8C0
+F8C1
+F8C2
+F8C3
+F8C4
+F8C5
+F8C6
+F8C7
+F8C8
+F8C9
+F8CA
+F8CB
+F8CC
+F8CD
+F8CE
+F8CF
+F8D0
+F8D1
+F8D2
+F8D3
+F8D4
+F8D5
+F8D6
+F8D7
+F8D8
+F8D9
+F8DA
+F8DB
+F8DC
+F8DD
+F8DE
+F8DF
+F8E0
+F8E1
+F8E2
+F8E3
+F8E4
+F8E5
+F8E6
+F8E7
+F8E8
+F8E9
+F8EA
+F8EB
+F8EC
+F8ED
+F8EE
+F8EF
+F8F0
+F8F1
+F8F2
+F8F3
+F8F4
+F8F5
+F8F6
+F8F7
+F8F8
+F8F9
+F8FA
+F8FB
+F8FC
+F8FD
+F8FE
+F9A1
+F9A2
+F9A3
+F9A4
+F9A5
+F9A6
+F9A7
+F9A8
+F9A9
+F9AA
+F9AB
+F9AC
+F9AD
+F9AE
+F9AF
+F9B0
+F9B1
+F9B2
+F9B3
+F9B4
+F9B5
+F9B6
+F9B7
+F9B8
+F9B9
+F9BA
+F9BB
+F9BC
+F9BD
+F9BE
+F9BF
+F9C0
+F9C1
+F9C2
+F9C3
+F9C4
+F9C5
+F9C6
+F9C7
+F9C8
+F9C9
+F9CA
+F9CB
+F9CC
+F9CD
+F9CE
+F9CF
+F9D0
+F9D1
+F9D2
+F9D3
+F9D4
+F9D5
+F9D6
+F9D7
+F9D8
+F9D9
+F9DA
+F9DB
+F9DC
+F9DD
+F9DE
+F9DF
+F9E0
+F9E1
+F9E2
+F9E3
+F9E4
+F9E5
+F9E6
+F9E7
+F9E8
+F9E9
+F9EA
+F9EB
+F9EC
+F9ED
+F9EE
+F9EF
+F9F0
+F9F1
+F9F2
+F9F3
+F9F4
+F9F5
+F9F6
+F9F7
+F9F8
+F9F9
+F9FA
+F9FB
+F9FC
+F9FD
+F9FE
+FAA1
+FAA2
+FAA3
+FAA4
+FAA5
+FAA6
+FAA7
+FAA8
+FAA9
+FAAA
+FAAB
+FAAC
+FAAD
+FAAE
+FAAF
+FAB0
+FAB1
+FAB2
+FAB3
+FAB4
+FAB5
+FAB6
+FAB7
+FAB8
+FAB9
+FABA
+FABB
+FABC
+FABD
+FABE
+FABF
+FAC0
+FAC1
+FAC2
+FAC3
+FAC4
+FAC5
+FAC6
+FAC7
+FAC8
+FAC9
+FACA
+FACB
+FACC
+FACD
+FACE
+FACF
+FAD0
+FAD1
+FAD2
+FAD3
+FAD4
+FAD5
+FAD6
+FAD7
+FAD8
+FAD9
+FADA
+FADB
+FADC
+FADD
+FADE
+FADF
+FAE0
+FAE1
+FAE2
+FAE3
+FAE4
+FAE5
+FAE6
+FAE7
+FAE8
+FAE9
+FAEA
+FAEB
+FAEC
+FAED
+FAEE
+FAEF
+FAF0
+FAF1
+FAF2
+FAF3
+FAF4
+FAF5
+FAF6
+FAF7
+FAF8
+FAF9
+FAFA
+FAFB
+FAFC
+FAFD
+FAFE
+FBA1
+FBA2
+FBA3
+FBA4
+FBA5
+FBA6
+FBA7
+FBA8
+FBA9
+FBAA
+FBAB
+FBAC
+FBAD
+FBAE
+FBAF
+FBB0
+FBB1
+FBB2
+FBB3
+FBB4
+FBB5
+FBB6
+FBB7
+FBB8
+FBB9
+FBBA
+FBBB
+FBBC
+FBBD
+FBBE
+FBBF
+FBC0
+FBC1
+FBC2
+FBC3
+FBC4
+FBC5
+FBC6
+FBC7
+FBC8
+FBC9
+FBCA
+FBCB
+FBCC
+FBCD
+FBCE
+FBCF
+FBD0
+FBD1
+FBD2
+FBD3
+FBD4
+FBD5
+FBD6
+FBD7
+FBD8
+FBD9
+FBDA
+FBDB
+FBDC
+FBDD
+FBDE
+FBDF
+FBE0
+FBE1
+FBE2
+FBE3
+FBE4
+FBE5
+FBE6
+FBE7
+FBE8
+FBE9
+FBEA
+FBEB
+FBEC
+FBED
+FBEE
+FBEF
+FBF0
+FBF1
+FBF2
+FBF3
+FBF4
+FBF5
+FBF6
+FBF7
+FBF8
+FBF9
+FBFA
+FBFB
+FBFC
+FBFD
+FBFE
+FCA1
+FCA2
+FCA3
+FCA4
+FCA5
+FCA6
+FCA7
+FCA8
+FCA9
+FCAA
+FCAB
+FCAC
+FCAD
+FCAE
+FCAF
+FCB0
+FCB1
+FCB2
+FCB3
+FCB4
+FCB5
+FCB6
+FCB7
+FCB8
+FCB9
+FCBA
+FCBB
+FCBC
+FCBD
+FCBE
+FCBF
+FCC0
+FCC1
+FCC2
+FCC3
+FCC4
+FCC5
+FCC6
+FCC7
+FCC8
+FCC9
+FCCA
+FCCB
+FCCC
+FCCD
+FCCE
+FCCF
+FCD0
+FCD1
+FCD2
+FCD3
+FCD4
+FCD5
+FCD6
+FCD7
+FCD8
+FCD9
+FCDA
+FCDB
+FCDC
+FCDD
+FCDE
+FCDF
+FCE0
+FCE1
+FCE2
+FCE3
+FCE4
+FCE5
+FCE6
+FCE7
+FCE8
+FCE9
+FCEA
+FCEB
+FCEC
+FCED
+FCEE
+FCEF
+FCF0
+FCF1
+FCF2
+FCF3
+FCF4
+FCF5
+FCF6
+FCF7
+FCF8
+FCF9
+FCFA
+FCFB
+FCFC
+FCFD
+FCFE
+FDA1
+FDA2
+FDA3
+FDA4
+FDA5
+FDA6
+FDA7
+FDA8
+FDA9
+FDAA
+FDAB
+FDAC
+FDAD
+FDAE
+FDAF
+FDB0
+FDB1
+FDB2
+FDB3
+FDB4
+FDB5
+FDB6
+FDB7
+FDB8
+FDB9
+FDBA
+FDBB
+FDBC
+FDBD
+FDBE
+FDBF
+FDC0
+FDC1
+FDC2
+FDC3
+FDC4
+FDC5
+FDC6
+FDC7
+FDC8
+FDC9
+FDCA
+FDCB
+FDCC
+FDCD
+FDCE
+FDCF
+FDD0
+FDD1
+FDD2
+FDD3
+FDD4
+FDD5
+FDD6
+FDD7
+FDD8
+FDD9
+FDDA
+FDDB
+FDDC
+FDDD
+FDDE
+FDDF
+FDE0
+FDE1
+FDE2
+FDE3
+FDE4
+FDE5
+FDE6
+FDE7
+FDE8
+FDE9
+FDEA
+FDEB
+FDEC
+FDED
+FDEE
+FDEF
+FDF0
+FDF1
+FDF2
+FDF3
+FDF4
+FDF5
+FDF6
+FDF7
+FDF8
+FDF9
+FDFA
+FDFB
+FDFC
+FDFD
+FDFE
+FEA1
+FEA2
+FEA3
+FEA4
+FEA5
+FEA6
+FEA7
+FEA8
+FEA9
+FEAA
+FEAB
+FEAC
+FEAD
+FEAE
+FEAF
+FEB0
+FEB1
+FEB2
+FEB3
+FEB4
+FEB5
+FEB6
+FEB7
+FEB8
+FEB9
+FEBA
+FEBB
+FEBC
+FEBD
+FEBE
+FEBF
+FEC0
+FEC1
+FEC2
+FEC3
+FEC4
+FEC5
+FEC6
+FEC7
+FEC8
+FEC9
+FECA
+FECB
+FECC
+FECD
+FECE
+FECF
+FED0
+FED1
+FED2
+FED3
+FED4
+FED5
+FED6
+FED7
+FED8
+FED9
+FEDA
+FEDB
+FEDC
+FEDD
+FEDE
+FEDF
+FEE0
+FEE1
+FEE2
+FEE3
+FEE4
+FEE5
+FEE6
+FEE7
+FEE8
+FEE9
+FEEA
+FEEB
+FEEC
+FEED
+FEEE
+FEEF
+FEF0
+FEF1
+FEF2
+FEF3
+FEF4
+FEF5
+FEF6
+FEF7
+FEF8
+FEF9
+FEFA
+FEFB
+FEFC
+FEFD
+FEFE
+8FF5A1
+8FF5A2
+8FF5A3
+8FF5A4
+8FF5A5
+8FF5A6
+8FF5A7
+8FF5A8
+8FF5A9
+8FF5AA
+8FF5AB
+8FF5AC
+8FF5AD
+8FF5AE
+8FF5AF
+8FF5B0
+8FF5B1
+8FF5B2
+8FF5B3
+8FF5B4
+8FF5B5
+8FF5B6
+8FF5B7
+8FF5B8
+8FF5B9
+8FF5BA
+8FF5BB
+8FF5BC
+8FF5BD
+8FF5BE
+8FF5BF
+8FF5C0
+8FF5C1
+8FF5C2
+8FF5C3
+8FF5C4
+8FF5C5
+8FF5C6
+8FF5C7
+8FF5C8
+8FF5C9
+8FF5CA
+8FF5CB
+8FF5CC
+8FF5CD
+8FF5CE
+8FF5CF
+8FF5D0
+8FF5D1
+8FF5D2
+8FF5D3
+8FF5D4
+8FF5D5
+8FF5D6
+8FF5D7
+8FF5D8
+8FF5D9
+8FF5DA
+8FF5DB
+8FF5DC
+8FF5DD
+8FF5DE
+8FF5DF
+8FF5E0
+8FF5E1
+8FF5E2
+8FF5E3
+8FF5E4
+8FF5E5
+8FF5E6
+8FF5E7
+8FF5E8
+8FF5E9
+8FF5EA
+8FF5EB
+8FF5EC
+8FF5ED
+8FF5EE
+8FF5EF
+8FF5F0
+8FF5F1
+8FF5F2
+8FF5F3
+8FF5F4
+8FF5F5
+8FF5F6
+8FF5F7
+8FF5F8
+8FF5F9
+8FF5FA
+8FF5FB
+8FF5FC
+8FF5FD
+8FF5FE
+8FF6A1
+8FF6A2
+8FF6A3
+8FF6A4
+8FF6A5
+8FF6A6
+8FF6A7
+8FF6A8
+8FF6A9
+8FF6AA
+8FF6AB
+8FF6AC
+8FF6AD
+8FF6AE
+8FF6AF
+8FF6B0
+8FF6B1
+8FF6B2
+8FF6B3
+8FF6B4
+8FF6B5
+8FF6B6
+8FF6B7
+8FF6B8
+8FF6B9
+8FF6BA
+8FF6BB
+8FF6BC
+8FF6BD
+8FF6BE
+8FF6BF
+8FF6C0
+8FF6C1
+8FF6C2
+8FF6C3
+8FF6C4
+8FF6C5
+8FF6C6
+8FF6C7
+8FF6C8
+8FF6C9
+8FF6CA
+8FF6CB
+8FF6CC
+8FF6CD
+8FF6CE
+8FF6CF
+8FF6D0
+8FF6D1
+8FF6D2
+8FF6D3
+8FF6D4
+8FF6D5
+8FF6D6
+8FF6D7
+8FF6D8
+8FF6D9
+8FF6DA
+8FF6DB
+8FF6DC
+8FF6DD
+8FF6DE
+8FF6DF
+8FF6E0
+8FF6E1
+8FF6E2
+8FF6E3
+8FF6E4
+8FF6E5
+8FF6E6
+8FF6E7
+8FF6E8
+8FF6E9
+8FF6EA
+8FF6EB
+8FF6EC
+8FF6ED
+8FF6EE
+8FF6EF
+8FF6F0
+8FF6F1
+8FF6F2
+8FF6F3
+8FF6F4
+8FF6F5
+8FF6F6
+8FF6F7
+8FF6F8
+8FF6F9
+8FF6FA
+8FF6FB
+8FF6FC
+8FF6FD
+8FF6FE
+8FF7A1
+8FF7A2
+8FF7A3
+8FF7A4
+8FF7A5
+8FF7A6
+8FF7A7
+8FF7A8
+8FF7A9
+8FF7AA
+8FF7AB
+8FF7AC
+8FF7AD
+8FF7AE
+8FF7AF
+8FF7B0
+8FF7B1
+8FF7B2
+8FF7B3
+8FF7B4
+8FF7B5
+8FF7B6
+8FF7B7
+8FF7B8
+8FF7B9
+8FF7BA
+8FF7BB
+8FF7BC
+8FF7BD
+8FF7BE
+8FF7BF
+8FF7C0
+8FF7C1
+8FF7C2
+8FF7C3
+8FF7C4
+8FF7C5
+8FF7C6
+8FF7C7
+8FF7C8
+8FF7C9
+8FF7CA
+8FF7CB
+8FF7CC
+8FF7CD
+8FF7CE
+8FF7CF
+8FF7D0
+8FF7D1
+8FF7D2
+8FF7D3
+8FF7D4
+8FF7D5
+8FF7D6
+8FF7D7
+8FF7D8
+8FF7D9
+8FF7DA
+8FF7DB
+8FF7DC
+8FF7DD
+8FF7DE
+8FF7DF
+8FF7E0
+8FF7E1
+8FF7E2
+8FF7E3
+8FF7E4
+8FF7E5
+8FF7E6
+8FF7E7
+8FF7E8
+8FF7E9
+8FF7EA
+8FF7EB
+8FF7EC
+8FF7ED
+8FF7EE
+8FF7EF
+8FF7F0
+8FF7F1
+8FF7F2
+8FF7F3
+8FF7F4
+8FF7F5
+8FF7F6
+8FF7F7
+8FF7F8
+8FF7F9
+8FF7FA
+8FF7FB
+8FF7FC
+8FF7FD
+8FF7FE
+8FF8A1
+8FF8A2
+8FF8A3
+8FF8A4
+8FF8A5
+8FF8A6
+8FF8A7
+8FF8A8
+8FF8A9
+8FF8AA
+8FF8AB
+8FF8AC
+8FF8AD
+8FF8AE
+8FF8AF
+8FF8B0
+8FF8B1
+8FF8B2
+8FF8B3
+8FF8B4
+8FF8B5
+8FF8B6
+8FF8B7
+8FF8B8
+8FF8B9
+8FF8BA
+8FF8BB
+8FF8BC
+8FF8BD
+8FF8BE
+8FF8BF
+8FF8C0
+8FF8C1
+8FF8C2
+8FF8C3
+8FF8C4
+8FF8C5
+8FF8C6
+8FF8C7
+8FF8C8
+8FF8C9
+8FF8CA
+8FF8CB
+8FF8CC
+8FF8CD
+8FF8CE
+8FF8CF
+8FF8D0
+8FF8D1
+8FF8D2
+8FF8D3
+8FF8D4
+8FF8D5
+8FF8D6
+8FF8D7
+8FF8D8
+8FF8D9
+8FF8DA
+8FF8DB
+8FF8DC
+8FF8DD
+8FF8DE
+8FF8DF
+8FF8E0
+8FF8E1
+8FF8E2
+8FF8E3
+8FF8E4
+8FF8E5
+8FF8E6
+8FF8E7
+8FF8E8
+8FF8E9
+8FF8EA
+8FF8EB
+8FF8EC
+8FF8ED
+8FF8EE
+8FF8EF
+8FF8F0
+8FF8F1
+8FF8F2
+8FF8F3
+8FF8F4
+8FF8F5
+8FF8F6
+8FF8F7
+8FF8F8
+8FF8F9
+8FF8FA
+8FF8FB
+8FF8FC
+8FF8FD
+8FF8FE
+8FF9A1
+8FF9A2
+8FF9A3
+8FF9A4
+8FF9A5
+8FF9A6
+8FF9A7
+8FF9A8
+8FF9A9
+8FF9AA
+8FF9AB
+8FF9AC
+8FF9AD
+8FF9AE
+8FF9AF
+8FF9B0
+8FF9B1
+8FF9B2
+8FF9B3
+8FF9B4
+8FF9B5
+8FF9B6
+8FF9B7
+8FF9B8
+8FF9B9
+8FF9BA
+8FF9BB
+8FF9BC
+8FF9BD
+8FF9BE
+8FF9BF
+8FF9C0
+8FF9C1
+8FF9C2
+8FF9C3
+8FF9C4
+8FF9C5
+8FF9C6
+8FF9C7
+8FF9C8
+8FF9C9
+8FF9CA
+8FF9CB
+8FF9CC
+8FF9CD
+8FF9CE
+8FF9CF
+8FF9D0
+8FF9D1
+8FF9D2
+8FF9D3
+8FF9D4
+8FF9D5
+8FF9D6
+8FF9D7
+8FF9D8
+8FF9D9
+8FF9DA
+8FF9DB
+8FF9DC
+8FF9DD
+8FF9DE
+8FF9DF
+8FF9E0
+8FF9E1
+8FF9E2
+8FF9E3
+8FF9E4
+8FF9E5
+8FF9E6
+8FF9E7
+8FF9E8
+8FF9E9
+8FF9EA
+8FF9EB
+8FF9EC
+8FF9ED
+8FF9EE
+8FF9EF
+8FF9F0
+8FF9F1
+8FF9F2
+8FF9F3
+8FF9F4
+8FF9F5
+8FF9F6
+8FF9F7
+8FF9F8
+8FF9F9
+8FF9FA
+8FF9FB
+8FF9FC
+8FF9FD
+8FF9FE
+8FFAA1
+8FFAA2
+8FFAA3
+8FFAA4
+8FFAA5
+8FFAA6
+8FFAA7
+8FFAA8
+8FFAA9
+8FFAAA
+8FFAAB
+8FFAAC
+8FFAAD
+8FFAAE
+8FFAAF
+8FFAB0
+8FFAB1
+8FFAB2
+8FFAB3
+8FFAB4
+8FFAB5
+8FFAB6
+8FFAB7
+8FFAB8
+8FFAB9
+8FFABA
+8FFABB
+8FFABC
+8FFABD
+8FFABE
+8FFABF
+8FFAC0
+8FFAC1
+8FFAC2
+8FFAC3
+8FFAC4
+8FFAC5
+8FFAC6
+8FFAC7
+8FFAC8
+8FFAC9
+8FFACA
+8FFACB
+8FFACC
+8FFACD
+8FFACE
+8FFACF
+8FFAD0
+8FFAD1
+8FFAD2
+8FFAD3
+8FFAD4
+8FFAD5
+8FFAD6
+8FFAD7
+8FFAD8
+8FFAD9
+8FFADA
+8FFADB
+8FFADC
+8FFADD
+8FFADE
+8FFADF
+8FFAE0
+8FFAE1
+8FFAE2
+8FFAE3
+8FFAE4
+8FFAE5
+8FFAE6
+8FFAE7
+8FFAE8
+8FFAE9
+8FFAEA
+8FFAEB
+8FFAEC
+8FFAED
+8FFAEE
+8FFAEF
+8FFAF0
+8FFAF1
+8FFAF2
+8FFAF3
+8FFAF4
+8FFAF5
+8FFAF6
+8FFAF7
+8FFAF8
+8FFAF9
+8FFAFA
+8FFAFB
+8FFAFC
+8FFAFD
+8FFAFE
+8FFBA1
+8FFBA2
+8FFBA3
+8FFBA4
+8FFBA5
+8FFBA6
+8FFBA7
+8FFBA8
+8FFBA9
+8FFBAA
+8FFBAB
+8FFBAC
+8FFBAD
+8FFBAE
+8FFBAF
+8FFBB0
+8FFBB1
+8FFBB2
+8FFBB3
+8FFBB4
+8FFBB5
+8FFBB6
+8FFBB7
+8FFBB8
+8FFBB9
+8FFBBA
+8FFBBB
+8FFBBC
+8FFBBD
+8FFBBE
+8FFBBF
+8FFBC0
+8FFBC1
+8FFBC2
+8FFBC3
+8FFBC4
+8FFBC5
+8FFBC6
+8FFBC7
+8FFBC8
+8FFBC9
+8FFBCA
+8FFBCB
+8FFBCC
+8FFBCD
+8FFBCE
+8FFBCF
+8FFBD0
+8FFBD1
+8FFBD2
+8FFBD3
+8FFBD4
+8FFBD5
+8FFBD6
+8FFBD7
+8FFBD8
+8FFBD9
+8FFBDA
+8FFBDB
+8FFBDC
+8FFBDD
+8FFBDE
+8FFBDF
+8FFBE0
+8FFBE1
+8FFBE2
+8FFBE3
+8FFBE4
+8FFBE5
+8FFBE6
+8FFBE7
+8FFBE8
+8FFBE9
+8FFBEA
+8FFBEB
+8FFBEC
+8FFBED
+8FFBEE
+8FFBEF
+8FFBF0
+8FFBF1
+8FFBF2
+8FFBF3
+8FFBF4
+8FFBF5
+8FFBF6
+8FFBF7
+8FFBF8
+8FFBF9
+8FFBFA
+8FFBFB
+8FFBFC
+8FFBFD
+8FFBFE
+8FFCA1
+8FFCA2
+8FFCA3
+8FFCA4
+8FFCA5
+8FFCA6
+8FFCA7
+8FFCA8
+8FFCA9
+8FFCAA
+8FFCAB
+8FFCAC
+8FFCAD
+8FFCAE
+8FFCAF
+8FFCB0
+8FFCB1
+8FFCB2
+8FFCB3
+8FFCB4
+8FFCB5
+8FFCB6
+8FFCB7
+8FFCB8
+8FFCB9
+8FFCBA
+8FFCBB
+8FFCBC
+8FFCBD
+8FFCBE
+8FFCBF
+8FFCC0
+8FFCC1
+8FFCC2
+8FFCC3
+8FFCC4
+8FFCC5
+8FFCC6
+8FFCC7
+8FFCC8
+8FFCC9
+8FFCCA
+8FFCCB
+8FFCCC
+8FFCCD
+8FFCCE
+8FFCCF
+8FFCD0
+8FFCD1
+8FFCD2
+8FFCD3
+8FFCD4
+8FFCD5
+8FFCD6
+8FFCD7
+8FFCD8
+8FFCD9
+8FFCDA
+8FFCDB
+8FFCDC
+8FFCDD
+8FFCDE
+8FFCDF
+8FFCE0
+8FFCE1
+8FFCE2
+8FFCE3
+8FFCE4
+8FFCE5
+8FFCE6
+8FFCE7
+8FFCE8
+8FFCE9
+8FFCEA
+8FFCEB
+8FFCEC
+8FFCED
+8FFCEE
+8FFCEF
+8FFCF0
+8FFCF1
+8FFCF2
+8FFCF3
+8FFCF4
+8FFCF5
+8FFCF6
+8FFCF7
+8FFCF8
+8FFCF9
+8FFCFA
+8FFCFB
+8FFCFC
+8FFCFD
+8FFCFE
+8FFDA1
+8FFDA2
+8FFDA3
+8FFDA4
+8FFDA5
+8FFDA6
+8FFDA7
+8FFDA8
+8FFDA9
+8FFDAA
+8FFDAB
+8FFDAC
+8FFDAD
+8FFDAE
+8FFDAF
+8FFDB0
+8FFDB1
+8FFDB2
+8FFDB3
+8FFDB4
+8FFDB5
+8FFDB6
+8FFDB7
+8FFDB8
+8FFDB9
+8FFDBA
+8FFDBB
+8FFDBC
+8FFDBD
+8FFDBE
+8FFDBF
+8FFDC0
+8FFDC1
+8FFDC2
+8FFDC3
+8FFDC4
+8FFDC5
+8FFDC6
+8FFDC7
+8FFDC8
+8FFDC9
+8FFDCA
+8FFDCB
+8FFDCC
+8FFDCD
+8FFDCE
+8FFDCF
+8FFDD0
+8FFDD1
+8FFDD2
+8FFDD3
+8FFDD4
+8FFDD5
+8FFDD6
+8FFDD7
+8FFDD8
+8FFDD9
+8FFDDA
+8FFDDB
+8FFDDC
+8FFDDD
+8FFDDE
+8FFDDF
+8FFDE0
+8FFDE1
+8FFDE2
+8FFDE3
+8FFDE4
+8FFDE5
+8FFDE6
+8FFDE7
+8FFDE8
+8FFDE9
+8FFDEA
+8FFDEB
+8FFDEC
+8FFDED
+8FFDEE
+8FFDEF
+8FFDF0
+8FFDF1
+8FFDF2
+8FFDF3
+8FFDF4
+8FFDF5
+8FFDF6
+8FFDF7
+8FFDF8
+8FFDF9
+8FFDFA
+8FFDFB
+8FFDFC
+8FFDFD
+8FFDFE
+8FFEA1
+8FFEA2
+8FFEA3
+8FFEA4
+8FFEA5
+8FFEA6
+8FFEA7
+8FFEA8
+8FFEA9
+8FFEAA
+8FFEAB
+8FFEAC
+8FFEAD
+8FFEAE
+8FFEAF
+8FFEB0
+8FFEB1
+8FFEB2
+8FFEB3
+8FFEB4
+8FFEB5
+8FFEB6
+8FFEB7
+8FFEB8
+8FFEB9
+8FFEBA
+8FFEBB
+8FFEBC
+8FFEBD
+8FFEBE
+8FFEBF
+8FFEC0
+8FFEC1
+8FFEC2
+8FFEC3
+8FFEC4
+8FFEC5
+8FFEC6
+8FFEC7
+8FFEC8
+8FFEC9
+8FFECA
+8FFECB
+8FFECC
+8FFECD
+8FFECE
+8FFECF
+8FFED0
+8FFED1
+8FFED2
+8FFED3
+8FFED4
+8FFED5
+8FFED6
+8FFED7
+8FFED8
+8FFED9
+8FFEDA
+8FFEDB
+8FFEDC
+8FFEDD
+8FFEDE
+8FFEDF
+8FFEE0
+8FFEE1
+8FFEE2
+8FFEE3
+8FFEE4
+8FFEE5
+8FFEE6
+8FFEE7
+8FFEE8
+8FFEE9
+8FFEEA
+8FFEEB
+8FFEEC
+8FFEED
+8FFEEE
+8FFEEF
+8FFEF0
+8FFEF1
+8FFEF2
+8FFEF3
+8FFEF4
+8FFEF5
+8FFEF6
+8FFEF7
+8FFEF8
+8FFEF9
+8FFEFA
+8FFEFB
+8FFEFC
+8FFEFD
+8FFEFE
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP TABLE t4;
+SET collation_connection='cp932_japanese_ci';
+create table t1 select repeat('a',4000) a;
+delete from t1;
+insert into t1 values ('a'), ('a '), ('a\t');
+select collation(a),hex(a) from t1 order by a;
+collation(a) hex(a)
+cp932_japanese_ci 6109
+cp932_japanese_ci 61
+cp932_japanese_ci 6120
+drop table t1;
+SET collation_connection='cp932_bin';
+create table t1 select repeat('a',4000) a;
+delete from t1;
+insert into t1 values ('a'), ('a '), ('a\t');
+select collation(a),hex(a) from t1 order by a;
+collation(a) hex(a)
+cp932_bin 6109
+cp932_bin 61
+cp932_bin 6120
+drop table t1;
+create table t2 (a char(1));
+insert into t2 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7');
+insert into t2 values ('8'),('9'),('A'),('B'),('C'),('D'),('E'),('F');
+create table t1 (
+a varchar(2) character set cp932
+) engine=myisam;
+insert into t1
+select unhex(concat(t24.a, t23.a, t22.a, t21.a))
+from t2 t21, t2 t22, t2 t23, t2 t24;
+delete from t1 where a='';
+alter table t1 add key(a);
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+drop table t1;
+drop table t2;
+create table t1 (col1 varchar(1)) character set cp932;
+insert into t1 values ('a');
+insert into t1 values ('ab');
+Warnings:
+Warning 1265 Data truncated for column 'col1' at row 1
+select * from t1;
+col1
+a
+a
+insert into t1 values ('abc');
+Warnings:
+Warning 1265 Data truncated for column 'col1' at row 1
+select * from t1;
+col1
+a
+a
+a
+drop table t1;
+set names utf8;
+create table t1 (a text) default character set cp932;
+insert into t1 values (_utf8 0xE38182);
+show warnings;
+Level Code Message
+select * from t1;
+a
+ã‚
+select hex(a) from t1;
+hex(a)
+82A0
+drop table t1;
+ƒ\
+ƒ\
+c_cp932
+ƒ\
+ƒ\
+ƒ\
+ソ
+ソ
+ƒ\
+ƒ\
diff --git a/mysql-test/r/binlog_stm_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result
index c789c618876..c789c618876 100644
--- a/mysql-test/r/binlog_stm_ctype_ucs.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result
diff --git a/mysql-test/r/binlog_stm_drop_tmp_tbl.result b/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result
index dc4349dea59..dc4349dea59 100644
--- a/mysql-test/r/binlog_stm_drop_tmp_tbl.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result
diff --git a/mysql-test/r/binlog_stm_innodb_stat.result b/mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result
index e6813ee2719..e6813ee2719 100644
--- a/mysql-test/r/binlog_stm_innodb_stat.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result
diff --git a/mysql-test/r/binlog_stm_insert_select.result b/mysql-test/suite/binlog/r/binlog_stm_insert_select.result
index a93a8edf4aa..a93a8edf4aa 100644
--- a/mysql-test/r/binlog_stm_insert_select.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_insert_select.result
diff --git a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
new file mode 100644
index 00000000000..5ef36861c30
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
@@ -0,0 +1,487 @@
+drop table if exists t1, t2;
+create table t1 (a int) engine=innodb;
+create table t2 (a int) engine=myisam;
+reset master;
+begin;
+insert into t1 values(1);
+insert into t2 select * from t1;
+commit;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Query # # use `test`; insert into t1 values(1)
+master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
+master-bin.000001 # Xid # # COMMIT /* XID */
+delete from t1;
+delete from t2;
+reset master;
+begin;
+insert into t1 values(2);
+insert into t2 select * from t1;
+rollback;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Query # # use `test`; insert into t1 values(2)
+master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
+master-bin.000001 # Query # # use `test`; ROLLBACK
+delete from t1;
+delete from t2;
+reset master;
+begin;
+insert into t1 values(3);
+savepoint my_savepoint;
+insert into t1 values(4);
+insert into t2 select * from t1;
+rollback to savepoint my_savepoint;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+commit;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Query # # use `test`; insert into t1 values(3)
+master-bin.000001 # Query # # use `test`; savepoint my_savepoint
+master-bin.000001 # Query # # use `test`; insert into t1 values(4)
+master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
+master-bin.000001 # Query # # use `test`; rollback to savepoint my_savepoint
+master-bin.000001 # Xid # # COMMIT /* XID */
+delete from t1;
+delete from t2;
+reset master;
+begin;
+insert into t1 values(5);
+savepoint my_savepoint;
+insert into t1 values(6);
+insert into t2 select * from t1;
+rollback to savepoint my_savepoint;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+insert into t1 values(7);
+commit;
+select a from t1 order by a;
+a
+5
+7
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Query # # use `test`; insert into t1 values(5)
+master-bin.000001 # Query # # use `test`; savepoint my_savepoint
+master-bin.000001 # Query # # use `test`; insert into t1 values(6)
+master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
+master-bin.000001 # Query # # use `test`; rollback to savepoint my_savepoint
+master-bin.000001 # Query # # use `test`; insert into t1 values(7)
+master-bin.000001 # Xid # # COMMIT /* XID */
+delete from t1;
+delete from t2;
+reset master;
+select get_lock("a",10);
+get_lock("a",10)
+1
+begin;
+insert into t1 values(8);
+insert into t2 select * from t1;
+select get_lock("a",10);
+get_lock("a",10)
+1
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Query # # use `test`; insert into t1 values(8)
+master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
+master-bin.000001 # Query # # use `test`; ROLLBACK
+delete from t1;
+delete from t2;
+reset master;
+insert into t1 values(9);
+insert into t2 select * from t1;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; insert into t1 values(9)
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
+delete from t1;
+delete from t2;
+reset master;
+insert into t1 values(10);
+begin;
+insert into t2 select * from t1;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; insert into t1 values(10)
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
+insert into t1 values(11);
+commit;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; insert into t1 values(10)
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Query # # use `test`; insert into t1 values(11)
+master-bin.000001 # Xid # # COMMIT /* XID */
+alter table t2 engine=INNODB;
+delete from t1;
+delete from t2;
+reset master;
+begin;
+insert into t1 values(12);
+insert into t2 select * from t1;
+commit;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Query # # use `test`; insert into t1 values(12)
+master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
+master-bin.000001 # Xid # # COMMIT /* XID */
+delete from t1;
+delete from t2;
+reset master;
+begin;
+insert into t1 values(13);
+insert into t2 select * from t1;
+rollback;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+delete from t1;
+delete from t2;
+reset master;
+begin;
+insert into t1 values(14);
+savepoint my_savepoint;
+insert into t1 values(15);
+insert into t2 select * from t1;
+rollback to savepoint my_savepoint;
+commit;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Query # # use `test`; insert into t1 values(14)
+master-bin.000001 # Xid # # COMMIT /* XID */
+delete from t1;
+delete from t2;
+reset master;
+begin;
+insert into t1 values(16);
+savepoint my_savepoint;
+insert into t1 values(17);
+insert into t2 select * from t1;
+rollback to savepoint my_savepoint;
+insert into t1 values(18);
+commit;
+select a from t1 order by a;
+a
+16
+18
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Query # # use `test`; insert into t1 values(16)
+master-bin.000001 # Query # # use `test`; insert into t1 values(18)
+master-bin.000001 # Xid # # COMMIT /* XID */
+delete from t1;
+delete from t2;
+alter table t2 engine=MyISAM;
+insert into t1 values (1);
+begin;
+select * from t1 for update;
+a
+1
+select (@before:=unix_timestamp())*0;
+(@before:=unix_timestamp())*0
+0
+begin;
+select * from t1 for update;
+insert into t2 values (20);
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+select (@after:=unix_timestamp())*0;
+(@after:=unix_timestamp())*0
+0
+select (@after-@before) >= 2;
+(@after-@before) >= 2
+1
+drop table t1,t2;
+commit;
+begin;
+create temporary table ti (a int) engine=innodb;
+rollback;
+insert into ti values(1);
+set autocommit=0;
+create temporary table t1 (a int) engine=myisam;
+commit;
+insert t1 values (1);
+rollback;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+create table t0 (n int);
+insert t0 select * from t1;
+set autocommit=1;
+insert into t0 select GET_LOCK("lock1",null);
+set autocommit=0;
+create table t2 (n int) engine=innodb;
+insert into t2 values (3);
+select get_lock("lock1",60);
+get_lock("lock1",60)
+1
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Query # # use `test`; insert into t1 values(16)
+master-bin.000001 # Query # # use `test`; insert into t1 values(18)
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test`; delete from t1
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test`; delete from t2
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test`; alter table t2 engine=MyISAM
+master-bin.000001 # Query # # use `test`; insert into t1 values (1)
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test`; insert into t2 values (20)
+master-bin.000001 # Query # # use `test`; drop table t1,t2
+master-bin.000001 # Query # # use `test`; create temporary table ti (a int) engine=innodb
+master-bin.000001 # Query # # use `test`; insert into ti values(1)
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test`; create temporary table t1 (a int) engine=myisam
+master-bin.000001 # Query # # use `test`; insert t1 values (1)
+master-bin.000001 # Query # # use `test`; create table t0 (n int)
+master-bin.000001 # Query # # use `test`; insert t0 select * from t1
+master-bin.000001 # Query # # use `test`; insert into t0 select GET_LOCK("lock1",null)
+master-bin.000001 # Query # # use `test`; create table t2 (n int) engine=innodb
+master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `test`.`t1`,`test`.`ti`
+do release_lock("lock1");
+drop table t0,t2;
+set autocommit=0;
+CREATE TABLE t1 (a int, b int) engine=myisam;
+reset master;
+INSERT INTO t1 values (1,1),(1,2);
+CREATE TABLE t2 (primary key (a)) engine=innodb select * from t1;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+DROP TABLE if exists t2;
+Warnings:
+Note 1051 Unknown table 't2'
+INSERT INTO t1 values (3,3);
+CREATE TEMPORARY TABLE t2 (primary key (a)) engine=innodb select * from t1;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+DROP TABLE IF EXISTS t2;
+Warnings:
+Note 1051 Unknown table 't2'
+CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb;
+INSERT INTO t1 VALUES (4,4);
+CREATE TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+SELECT * from t2;
+a b
+TRUNCATE table t2;
+INSERT INTO t1 VALUES (5,5);
+INSERT INTO t2 select * from t1;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+SELECT * FROM t2;
+a b
+DROP TABLE t2;
+INSERT INTO t1 values (6,6);
+CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a)) engine=innodb ;
+INSERT INTO t1 values (7,7);
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+INSERT INTO t1 values (8,8);
+CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+COMMIT;
+INSERT INTO t1 values (9,9);
+CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+SELECT * from t2;
+a b
+TRUNCATE table t2;
+INSERT INTO t1 values (10,10);
+INSERT INTO t2 select * from t1;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+SELECT * from t1;
+a b
+1 1
+1 2
+3 3
+4 4
+5 5
+6 6
+7 7
+8 8
+9 9
+10 10
+INSERT INTO t2 values (100,100);
+CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+COMMIT;
+INSERT INTO t2 values (101,101);
+CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+ROLLBACK;
+SELECT * from t2;
+a b
+100 100
+DROP TABLE t1,t2;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (1,1),(1,2)
+master-bin.000001 # Query # # use `test`; DROP TABLE if exists t2
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (3,3)
+master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t2
+master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4,4)
+master-bin.000001 # Query # # use `test`; TRUNCATE table t2
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5,5)
+master-bin.000001 # Query # # use `test`; DROP TABLE t2
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (6,6)
+master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a)) engine=innodb
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (7,7)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (8,8)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (9,9)
+master-bin.000001 # Query # # use `test`; TRUNCATE table t2
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (10,10)
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Query # # use `test`; INSERT INTO t2 values (100,100)
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test`; DROP TABLE t1,t2
+reset master;
+create table t1 (a int) engine=innodb;
+create table t2 (a int) engine=myisam;
+select get_lock("a",10);
+get_lock("a",10)
+1
+begin;
+insert into t1 values(8);
+insert into t2 select * from t1;
+select get_lock("a",10);
+get_lock("a",10)
+1
+flush logs;
+select
+(@a:=load_file("MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output"))
+is not null;
+(@a:=load_file("MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output"))
+is not null
+1
+select
+@a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%",
+@a not like "%#%error_code=%error_code=%";
+@a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" @a not like "%#%error_code=%error_code=%"
+1 1
+drop table t1, t2;
+create table tt (a int unique);
+create table ti (a int) engine=innodb;
+reset master;
+show master status;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000001 106
+begin;
+insert into ti values (1);
+insert into ti values (2) ;
+insert into tt select * from ti;
+rollback;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+select count(*) from tt /* 2 */;
+count(*)
+2
+show master status;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000001 515
+show binlog events from 106;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # use `test`; BEGIN
+master-bin.000001 # Query 1 # use `test`; insert into ti values (1)
+master-bin.000001 # Query 1 # use `test`; insert into ti values (2)
+master-bin.000001 # Query 1 # use `test`; insert into tt select * from ti
+master-bin.000001 # Query 1 # use `test`; ROLLBACK
+select count(*) from ti /* zero */;
+count(*)
+0
+insert into ti select * from tt;
+select * from ti /* that is what slave would miss - a bug */;
+a
+1
+2
+delete from ti;
+delete from tt where a=1;
+reset master;
+show master status;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000001 106
+begin;
+insert into ti values (1);
+insert into ti values (2) /* to make the dup error in the following */;
+insert into tt select * from ti /* one affected and error */;
+ERROR 23000: Duplicate entry '2' for key 'a'
+rollback;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+show master status;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000001 589
+show binlog events from 106;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # use `test`; BEGIN
+master-bin.000001 # Query 1 # use `test`; insert into ti values (1)
+master-bin.000001 # Query 1 # use `test`; insert into ti values (2) /* to make the dup error in the following */
+master-bin.000001 # Query 1 # use `test`; insert into tt select * from ti /* one affected and error */
+master-bin.000001 # Query 1 # use `test`; ROLLBACK
+select count(*) from ti /* zero */;
+count(*)
+0
+insert into ti select * from tt;
+select * from tt /* that is what otherwise slave missed - the bug */;
+a
+1
+2
+drop table ti,tt;
+drop function if exists bug27417;
+drop table if exists t1,t2;
+CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM;
+CREATE TABLE t2 (a int NOT NULL auto_increment, PRIMARY KEY (a));
+create function bug27417(n int)
+RETURNS int(11)
+begin
+insert into t1 values (null);
+return n;
+end|
+reset master;
+insert into t2 values (bug27417(1));
+insert into t2 select bug27417(2);
+reset master;
+insert into t2 values (bug27417(2));
+ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
+select count(*) from t1 /* must be 3 */;
+count(*)
+3
+reset master;
+select count(*) from t2;
+count(*)
+2
+delete from t2 where a=bug27417(3);
+select count(*) from t2 /* nothing got deleted */;
+count(*)
+2
+select count(*) from t1 /* must be 5 */;
+count(*)
+5
+delete t2 from t2 where t2.a=bug27417(100) /* must not affect t2 */;
+affected rows: 0
+select count(*) from t1 /* must be 7 */;
+count(*)
+7
+drop function bug27417;
+drop table t1,t2;
+end of tests
diff --git a/mysql-test/suite/binlog/r/binlog_stm_ps.result b/mysql-test/suite/binlog/r/binlog_stm_ps.result
new file mode 100644
index 00000000000..47934665116
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_stm_ps.result
@@ -0,0 +1,20 @@
+drop table if exists t1;
+reset master;
+create table t1 (a int);
+prepare s from "insert into t1 values (@a),(?)";
+set @a=98;
+execute s using @a;
+prepare s from "insert into t1 values (?)";
+set @a=99;
+execute s using @a;
+prepare s from "insert into t1 select 100 limit ?";
+set @a=100;
+execute s using @a;
+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 # User var # # @`a`=98
+master-bin.000001 # Query # # use `test`; insert into t1 values (@a),(98)
+master-bin.000001 # Query # # use `test`; insert into t1 values (99)
+master-bin.000001 # Query # # use `test`; insert into t1 select 100 limit 100
+drop table t1;
diff --git a/mysql-test/suite/binlog/t/binlog_innodb.test b/mysql-test/suite/binlog/t/binlog_innodb.test
new file mode 100644
index 00000000000..df99e3786ee
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_innodb.test
@@ -0,0 +1,172 @@
+source include/have_innodb.inc;
+source include/have_log_bin.inc;
+
+SET BINLOG_FORMAT=MIXED;
+
+RESET MASTER;
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=INNODB;
+INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6);
+
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+# Should be logged as statement
+UPDATE t1 SET b = 2*a WHERE a > 1;
+COMMIT;
+
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+# Should be logged as rows
+UPDATE t1 SET b = a * a WHERE a > 3;
+COMMIT;
+
+# Check that errors are generated when trying to use READ COMMITTED
+# transaction isolation level in STATEMENT binlog mode.
+
+SET BINLOG_FORMAT=STATEMENT;
+
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+error ER_BINLOG_LOGGING_IMPOSSIBLE;
+UPDATE t1 SET b = 1*a WHERE a > 1;
+COMMIT;
+
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+error ER_BINLOG_LOGGING_IMPOSSIBLE;
+UPDATE t1 SET b = 2*a WHERE a > 2;
+COMMIT;
+
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+UPDATE t1 SET b = 3*a WHERE a > 3;
+COMMIT;
+
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+UPDATE t1 SET b = 4*a WHERE a > 4;
+COMMIT;
+
+SET BINLOG_FORMAT=MIXED;
+
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+UPDATE t1 SET b = 1*a WHERE a > 1;
+COMMIT;
+
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+UPDATE t1 SET b = 2*a WHERE a > 2;
+COMMIT;
+
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+UPDATE t1 SET b = 3*a WHERE a > 3;
+COMMIT;
+
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+UPDATE t1 SET b = 4*a WHERE a > 4;
+COMMIT;
+
+SET BINLOG_FORMAT=ROW;
+
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+UPDATE t1 SET b = 1*a WHERE a > 1;
+COMMIT;
+
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+UPDATE t1 SET b = 2*a WHERE a > 2;
+COMMIT;
+
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+UPDATE t1 SET b = 3*a WHERE a > 3;
+COMMIT;
+
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+UPDATE t1 SET b = 4*a WHERE a > 4;
+COMMIT;
+
+source include/show_binlog_events.inc;
+
+DROP TABLE t1;
+
+
+#
+# Let us test binlog_cache_use and binlog_cache_disk_use status vars.
+# Actually this test has nothing to do with innodb per se, it just requires
+# transactional table.
+#
+show status like "binlog_cache_use";
+show status like "binlog_cache_disk_use";
+
+create table t1 (a int) engine=innodb;
+
+# Now we are going to create transaction which is long enough so its
+# transaction binlog will be flushed to disk...
+let $1=2000;
+disable_query_log;
+begin;
+while ($1)
+{
+ eval insert into t1 values( $1 );
+ dec $1;
+}
+commit;
+enable_query_log;
+show status like "binlog_cache_use";
+show status like "binlog_cache_disk_use";
+
+# Transaction which should not be flushed to disk and so should not
+# increase binlog_cache_disk_use.
+begin;
+delete from t1;
+commit;
+show status like "binlog_cache_use";
+show status like "binlog_cache_disk_use";
+drop table t1;
+
+#
+# Bug#27716 multi-update did partially and has not binlogged
+#
+
+CREATE TABLE `t1` (
+ `a` int(11) NOT NULL auto_increment,
+ `b` int(11) default NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
+
+CREATE TABLE `t2` (
+ `a` int(11) NOT NULL auto_increment,
+ `b` int(11) default NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=INNODB DEFAULT CHARSET=latin1 ;
+
+# A. testing multi_update::send_eof() execution branch
+insert into t1 values (1,1),(2,2);
+insert into t2 values (1,1),(4,4);
+reset master;
+--error ER_DUP_ENTRY
+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 */;
+
+# B. testing multi_update::send_error() execution branch
+delete from t1;
+delete from t2;
+insert into t1 values (1,2),(3,4),(4,4);
+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 */;
+
+# cleanup bug#27716
+drop table t1, t2;
+
+--echo End of tests
diff --git a/mysql-test/suite/binlog/t/binlog_killed.test b/mysql-test/suite/binlog/t/binlog_killed.test
new file mode 100644
index 00000000000..6c0b4b46a4e
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_killed.test
@@ -0,0 +1,248 @@
+-- source include/have_innodb.inc
+-- source include/have_binlog_format_mixed_or_statement.inc
+-- source include/not_embedded.inc
+
+###
+### bug#22725 : incorrect killed error in binlogged query
+###
+
+connect (con1, localhost, root,,);
+connect (con2, localhost, root,,);
+
+create table t1 (a int auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB;
+create table t2 (a int auto_increment, b int, PRIMARY KEY (a)) ENGINE=MyISAM;
+create table t3 (a int auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB;
+
+#
+# effective test for bug#22725
+#
+
+connection con1;
+select get_lock("a", 20);
+
+connection con2;
+let $ID= `select connection_id()`;
+reset master;
+send insert into t2 values (null, null), (null, get_lock("a", 10));
+
+
+connection con1;
+
+disable_abort_on_error;
+disable_query_log;
+disable_result_log;
+
+eval kill query $ID;
+
+connection con2;
+--error 0,ER_QUERY_INTERRUPTED
+reap;
+let $rows= `select count(*) from t2 /* must be 2 or 0 */`;
+
+--exec $MYSQL_BINLOG --start-position=134 $MYSQLTEST_VARDIR/log/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"))
+is not null;
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+let $error_code= `select @a like "%#%error_code=0%" /* must return 1 or 0*/`;
+let $insert_binlogged= `select @a like "%insert into%" /* must return 1 or 0 */`;
+eval set @result= $rows- $error_code - $insert_binlogged;
+
+enable_abort_on_error;
+enable_query_log;
+enable_result_log;
+
+select @result /* must be zero either way */;
+
+# the functions are either *insensitive* to killing or killing can cause
+# strange problmes with the error propagation out of SF's stack
+# Bug#27563, Bug#27565, BUG#24971
+#
+# TODO: use if's block as regression test for the bugs or remove
+#
+if (0)
+{
+delimiter |;
+create function bug27563()
+RETURNS int(11)
+DETERMINISTIC
+begin
+ select get_lock("a", 10) into @a;
+ return 1;
+end|
+delimiter ;|
+
+# the function is sensitive to killing requiring innodb though with wrong client error
+# TO FIX in BUG#27565; TODO: remove --error 1105 afterwards
+delimiter |;
+create function bug27565()
+RETURNS int(11)
+DETERMINISTIC
+begin
+ select a from t1 where a=1 into @a for update;
+ return 1;
+end|
+delimiter ;|
+
+reset master;
+
+
+### ta table case: killing causes rollback
+
+# A. autocommit ON
+connection con1;
+select get_lock("a", 20);
+
+connection con2;
+let $ID= `select connection_id()`;
+send insert into t1 values (bug27563(),1);
+
+connection con1;
+eval kill query $ID;
+
+connection con2;
+# todo (re-record test): after bugs 27563,27565 got fixed affected rows will report zero
+--enable_info
+# todo: remove 0 return after fixing Bug#27563
+--error 0,ER_QUERY_INTERRUPTED
+reap; ### pb: wrong error
+--disable_info
+###--replace_column 2 # 5 #
+### show binlog events from 98 /* nothing in binlog unless Bug#27563 */;
+show master status /* must be only FD event unless Bug#27563 */;
+select count(*) from t1 /* must be zero unless Bug#27563 */;
+
+# M. multi-statement-ta
+connection con2;
+let $ID= `select connection_id()`;
+begin;
+send insert into t1 values (bug27563(),1);
+
+connection con1;
+eval kill query $ID;
+connection con2;
+# todo (re-record test): after bugs 27563,27565 got fixed affected rows will report zero
+--enable_info
+# todo: remove 0 return after fixing Bug#27563
+--error 0,ER_QUERY_INTERRUPTED
+reap;
+--disable_info
+select count(*) from t1 /* must be zero unless Bug#27563 */;
+commit;
+
+
+### non-ta table case: killing must be recorded in binlog
+
+reset master;
+
+connection con2;
+let $ID= `select connection_id()`;
+send insert into t2 values (bug27563(),1);
+
+connection con1;
+eval kill query $ID;
+
+connection con2;
+# todo: remove 0 return after fixing Bug#27563
+--error 0,ER_QUERY_INTERRUPTED
+reap;
+select count(*) from t2 /* must be one */;
+#show binlog events from 98 /* must have the insert on non-ta table */;
+show master status /* must have the insert event more to FD */;
+# the value of the error flag of KILLED_QUERY is tested further
+
+connection con1;
+select RELEASE_LOCK("a");
+
+### test with effective killing of SF()
+
+delete from t1;
+delete from t2;
+insert into t1 values (1,1);
+insert into t2 values (1,1);
+
+#
+# Bug#27565
+# test where KILL is propagated as error to the top level
+# still another bug with the error message to the user
+# todo: fix reexecute the result file after fixing
+#
+begin; update t1 set b=0 where a=1;
+
+connection con2;
+let $ID= `select connection_id()`;
+send update t2 set b=bug27565()-1 where a=1;
+
+connection con1;
+eval kill query $ID;
+commit;
+
+connection con2;
+# todo: fix Bug #27565 killed query of SF() is not reported correctly and
+# remove 1105 (wrong)
+#--error ER_QUERY_INTERRUPTED
+--error 1105,ER_QUERY_INTERRUPTED
+reap; ### pb: wrong error
+select * from t1 /* must be: (1,0) */;
+select * from t2 /* must be as before: (1,1) */;
+
+## bug#22725 with effective and propagating killing
+#
+# top-level ta-table
+connection con1;
+delete from t3;
+reset master;
+begin; update t1 set b=0 where a=1;
+
+connection con2;
+let $ID= `select connection_id()`;
+# the query won't perform completely since the function gets interrupted
+send insert into t3 values (0,0),(1,bug27565());
+
+connection con1;
+eval kill query $ID;
+rollback;
+
+connection con2;
+# todo: fix Bug #27565 killed query of SF() is not reported correctly and
+# remove 1105 (wrong)
+#--error ER_QUERY_INTERRUPTED
+--error 1105,ER_QUERY_INTERRUPTED
+reap; ### pb: wrong error
+select count(*) from t3 /* must be zero */;
+show master status /* nothing in binlog */;
+
+# top-level non-ta-table
+connection con1;
+delete from t2;
+reset master;
+begin; update t1 set b=0 where a=1;
+
+connection con2;
+let $ID= `select connection_id()`;
+# the query won't perform completely since the function gets intrurrupted
+send insert into t2 values (0,0),(1,bug27565()) /* non-ta t2 */;
+
+connection con1;
+eval kill query $ID;
+rollback;
+
+connection con2;
+# todo: fix Bug #27565 killed query of SF() is not reported correctly and
+# remove 1105 (wrong)
+#--error ER_QUERY_INTERRUPTED
+--error 1105,ER_QUERY_INTERRUPTED
+reap; ### pb: wrong error
+
+select count(*) from t2 /* count must be one */;
+show master status /* insert into non-ta must be in binlog */;
+
+drop function bug27563;
+drop function bug27565;
+}
+
+system rm $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog ;
+
+drop table t1,t2,t3;
+
diff --git a/mysql-test/suite/binlog/t/binlog_multi_engine.test b/mysql-test/suite/binlog/t/binlog_multi_engine.test
new file mode 100644
index 00000000000..058aca0f715
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_multi_engine.test
@@ -0,0 +1,91 @@
+# Test to test how logging is done depending on the capabilities of
+# the engines. Unfortunately, we don't have a good row-only logging
+# engine, and NDB does not really cut is since it is also
+# self-logging. I'm using it nevertheless.
+
+source include/have_blackhole.inc;
+source include/have_ndb.inc;
+source include/have_log_bin.inc;
+
+CREATE TABLE t1m (m INT, n INT) ENGINE=MYISAM;
+CREATE TABLE t1b (b INT, c INT) ENGINE=BLACKHOLE;
+CREATE TABLE t1n (e INT, f INT) ENGINE=NDB;
+
+RESET MASTER;
+
+SET SESSION BINLOG_FORMAT=STATEMENT;
+
+INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2);
+INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2);
+
+UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c;
+
+echo *** Please look in binlog_multi_engine.test if you have a diff here ****;
+START TRANSACTION;
+INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2);
+UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
+UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c;
+COMMIT;
+
+TRUNCATE t1m;
+TRUNCATE t1b;
+TRUNCATE t1n;
+
+source include/show_binlog_events.inc;
+
+RESET MASTER;
+
+SET SESSION BINLOG_FORMAT=MIXED;
+
+INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2);
+INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2);
+INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2);
+
+UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c;
+error ER_BINLOG_LOGGING_IMPOSSIBLE;
+UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
+
+# Not possible to test this since NDB writes its own binlog, which
+# might cause it to be out of sync with the results from MyISAM.
+# This will generate an error once BUG#28722 is fixed.
+
+#UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
+
+error ER_BINLOG_LOGGING_IMPOSSIBLE;
+UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c;
+
+TRUNCATE t1m;
+TRUNCATE t1b;
+TRUNCATE t1n;
+
+source include/show_binlog_events.inc;
+
+RESET MASTER;
+
+SET SESSION BINLOG_FORMAT=ROW;
+
+INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2);
+error ER_BINLOG_LOGGING_IMPOSSIBLE;
+INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2);
+INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2);
+
+error ER_BINLOG_LOGGING_IMPOSSIBLE;
+UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c;
+error ER_BINLOG_LOGGING_IMPOSSIBLE;
+UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
+
+# Not possible to test this since NDB writes its own binlog, which
+# might cause it to be out of sync with the results from MyISAM.
+# This will generate an error once BUG#28722 is fixed.
+
+#UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
+
+error ER_BINLOG_LOGGING_IMPOSSIBLE;
+UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c;
+
+source include/show_binlog_events.inc;
+
+RESET MASTER;
+
+DROP TABLE t1m, t1b, t1n;
+
diff --git a/mysql-test/t/binlog_row_binlog-master.opt b/mysql-test/suite/binlog/t/binlog_row_binlog-master.opt
index ad2c6a647b5..ad2c6a647b5 100644
--- a/mysql-test/t/binlog_row_binlog-master.opt
+++ b/mysql-test/suite/binlog/t/binlog_row_binlog-master.opt
diff --git a/mysql-test/t/binlog_row_binlog.test b/mysql-test/suite/binlog/t/binlog_row_binlog.test
index 8adc8eee5c1..8adc8eee5c1 100644
--- a/mysql-test/t/binlog_row_binlog.test
+++ b/mysql-test/suite/binlog/t/binlog_row_binlog.test
diff --git a/mysql-test/t/binlog_row_ctype_cp932.test b/mysql-test/suite/binlog/t/binlog_row_ctype_cp932.test
index 595af5a3114..595af5a3114 100644
--- a/mysql-test/t/binlog_row_ctype_cp932.test
+++ b/mysql-test/suite/binlog/t/binlog_row_ctype_cp932.test
diff --git a/mysql-test/t/binlog_row_ctype_ucs.test b/mysql-test/suite/binlog/t/binlog_row_ctype_ucs.test
index 96e14ed8882..96e14ed8882 100644
--- a/mysql-test/t/binlog_row_ctype_ucs.test
+++ b/mysql-test/suite/binlog/t/binlog_row_ctype_ucs.test
diff --git a/mysql-test/t/binlog_row_drop_tmp_tbl.test b/mysql-test/suite/binlog/t/binlog_row_drop_tmp_tbl.test
index 5b503b78d85..5b503b78d85 100644
--- a/mysql-test/t/binlog_row_drop_tmp_tbl.test
+++ b/mysql-test/suite/binlog/t/binlog_row_drop_tmp_tbl.test
diff --git a/mysql-test/t/binlog_row_innodb_stat-master.opt b/mysql-test/suite/binlog/t/binlog_row_innodb_stat-master.opt
index 4cb927540bf..4cb927540bf 100644
--- a/mysql-test/t/binlog_row_innodb_stat-master.opt
+++ b/mysql-test/suite/binlog/t/binlog_row_innodb_stat-master.opt
diff --git a/mysql-test/t/binlog_row_innodb_stat.test b/mysql-test/suite/binlog/t/binlog_row_innodb_stat.test
index e4e6762226b..e4e6762226b 100644
--- a/mysql-test/t/binlog_row_innodb_stat.test
+++ b/mysql-test/suite/binlog/t/binlog_row_innodb_stat.test
diff --git a/mysql-test/t/binlog_row_insert_select.test b/mysql-test/suite/binlog/t/binlog_row_insert_select.test
index 806d495c8fb..806d495c8fb 100644
--- a/mysql-test/t/binlog_row_insert_select.test
+++ b/mysql-test/suite/binlog/t/binlog_row_insert_select.test
diff --git a/mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam-master.opt b/mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam-master.opt
new file mode 100644
index 00000000000..e76299453d3
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam-master.opt
@@ -0,0 +1 @@
+--innodb_lock_wait_timeout=2
diff --git a/mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam.test b/mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam.test
new file mode 100644
index 00000000000..7b7753a487e
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam.test
@@ -0,0 +1,33 @@
+# This is a wrapper for binlog.test so that the same test case can be used
+# For both statement and row based bin logs 9/19/2005 [jbm]
+
+-- source include/have_binlog_format_row.inc
+
+# 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
+# we disable the ps-protocol for this statement.
+--disable_ps_protocol
+
+-- source extra/binlog_tests/mix_innodb_myisam_binlog.test
+
+--enable_ps_protocol
+
+# This piece below cannot be put into
+# extra/binlog_tests/mix_innodb_myisam_binlog.test
+# because the argument of --start-position differs between statement-
+# and row-based (and "eval --exec" doesn't work).
+# we check that the error code of the "ROLLBACK" event is 0 and not
+# ER_SERVER_SHUTDOWN (i.e. disconnection just rolls back transaction
+# and does not make slave to stop)
+flush logs;
+--exec $MYSQL_BINLOG --start-position=524 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval select
+(@a:=load_file("$MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output"))
+is not null;
+
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+eval select
+@a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%",
+@a not like "%#%error_code=%error_code=%";
+drop table t1, t2;
diff --git a/mysql-test/t/binlog_statement_insert_delayed.test b/mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test
index 9b78296236f..9b78296236f 100644
--- a/mysql-test/t/binlog_statement_insert_delayed.test
+++ b/mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test
diff --git a/mysql-test/t/binlog_stm_binlog-master.opt b/mysql-test/suite/binlog/t/binlog_stm_binlog-master.opt
index ad2c6a647b5..ad2c6a647b5 100644
--- a/mysql-test/t/binlog_stm_binlog-master.opt
+++ b/mysql-test/suite/binlog/t/binlog_stm_binlog-master.opt
diff --git a/mysql-test/t/binlog_stm_binlog.test b/mysql-test/suite/binlog/t/binlog_stm_binlog.test
index 280b7a3aef9..280b7a3aef9 100644
--- a/mysql-test/t/binlog_stm_binlog.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_binlog.test
diff --git a/mysql-test/t/binlog_stm_blackhole.test b/mysql-test/suite/binlog/t/binlog_stm_blackhole.test
index 02ba2be095b..02ba2be095b 100644
--- a/mysql-test/t/binlog_stm_blackhole.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_blackhole.test
diff --git a/mysql-test/t/binlog_stm_ctype_cp932.test b/mysql-test/suite/binlog/t/binlog_stm_ctype_cp932.test
index c0791d81445..c0791d81445 100644
--- a/mysql-test/t/binlog_stm_ctype_cp932.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_ctype_cp932.test
diff --git a/mysql-test/t/binlog_stm_ctype_ucs.test b/mysql-test/suite/binlog/t/binlog_stm_ctype_ucs.test
index c8cd7e06398..c8cd7e06398 100644
--- a/mysql-test/t/binlog_stm_ctype_ucs.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_ctype_ucs.test
diff --git a/mysql-test/t/binlog_stm_drop_tmp_tbl.test b/mysql-test/suite/binlog/t/binlog_stm_drop_tmp_tbl.test
index 6017f272d01..6017f272d01 100644
--- a/mysql-test/t/binlog_stm_drop_tmp_tbl.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_drop_tmp_tbl.test
diff --git a/mysql-test/t/binlog_stm_innodb_stat-master.opt b/mysql-test/suite/binlog/t/binlog_stm_innodb_stat-master.opt
index 4cb927540bf..4cb927540bf 100644
--- a/mysql-test/t/binlog_stm_innodb_stat-master.opt
+++ b/mysql-test/suite/binlog/t/binlog_stm_innodb_stat-master.opt
diff --git a/mysql-test/t/binlog_stm_innodb_stat.test b/mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test
index a08039c4a41..a08039c4a41 100644
--- a/mysql-test/t/binlog_stm_innodb_stat.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test
diff --git a/mysql-test/t/binlog_stm_insert_select.test b/mysql-test/suite/binlog/t/binlog_stm_insert_select.test
index 3aefa1e6cf7..3aefa1e6cf7 100644
--- a/mysql-test/t/binlog_stm_insert_select.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_insert_select.test
diff --git a/mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam-master.opt b/mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam-master.opt
new file mode 100644
index 00000000000..e76299453d3
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam-master.opt
@@ -0,0 +1 @@
+--innodb_lock_wait_timeout=2
diff --git a/mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test b/mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test
new file mode 100644
index 00000000000..1815f3deb34
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test
@@ -0,0 +1,146 @@
+# This is a wrapper for binlog.test so that the same test case can be used
+# For both statement and row based bin logs 9/19/2005 [jbm]
+
+-- source include/have_binlog_format_mixed_or_statement.inc
+-- source extra/binlog_tests/mix_innodb_myisam_binlog.test
+
+# This piece below cannot be put into
+# extra/binlog_tests/mix_innodb_myisam_binlog.test
+# because the argument of --start-position differs between statement-
+# and row-based (and "eval --exec" doesn't work).
+# we check that the error code of the "ROLLBACK" event is 0 and not
+# ER_SERVER_SHUTDOWN (i.e. disconnection just rolls back transaction
+# and does not make slave to stop)
+flush logs;
+--exec $MYSQL_BINLOG --start-position=555 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval select
+(@a:=load_file("$MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output"))
+is not null;
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+eval select
+@a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%",
+@a not like "%#%error_code=%error_code=%";
+
+drop table t1, t2;
+
+#
+# Bug #27417 thd->no_trans_update.stmt lost value inside of SF-exec-stack
+# bug #28960 non-trans temp table changes with insert .. select
+# not binlogged after rollback
+#
+# testing appearence of insert into temp_table in binlog.
+# There are two branches of execution that require different setup.
+
+## send_eof() branch
+
+# prepare
+
+create table tt (a int unique);
+create table ti (a int) engine=innodb;
+reset master;
+show master status;
+
+# action
+
+begin;
+insert into ti values (1);
+insert into ti values (2) ;
+insert into tt select * from ti;
+rollback;
+
+# check
+
+select count(*) from tt /* 2 */;
+show master status;
+--replace_column 2 # 5 #
+show binlog events from 106;
+select count(*) from ti /* zero */;
+insert into ti select * from tt;
+select * from ti /* that is what slave would miss - a bug */;
+
+
+## send_error() branch
+delete from ti;
+delete from tt where a=1;
+reset master;
+show master status;
+
+# action
+
+begin;
+insert into ti values (1);
+insert into ti values (2) /* to make the dup error in the following */;
+--error ER_DUP_ENTRY
+insert into tt select * from ti /* one affected and error */;
+rollback;
+
+# check
+
+show master status;
+--replace_column 2 # 5 #
+show binlog events from 106;
+select count(*) from ti /* zero */;
+insert into ti select * from tt;
+select * from tt /* that is what otherwise slave missed - the bug */;
+
+drop table ti,tt;
+
+
+#
+# Bug #27417 thd->no_trans_update.stmt lost value inside of SF-exec-stack
+#
+# Testing asserts: if there is a side effect of modifying non-transactional
+# table thd->no_trans_update.stmt must be TRUE;
+# the assert is active with debug build
+#
+
+--disable_warnings
+drop function if exists bug27417;
+drop table if exists t1,t2;
+--enable_warnings
+# side effect table
+CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM;
+# target tables
+CREATE TABLE t2 (a int NOT NULL auto_increment, PRIMARY KEY (a));
+
+delimiter |;
+create function bug27417(n int)
+RETURNS int(11)
+begin
+ insert into t1 values (null);
+ return n;
+end|
+delimiter ;|
+
+reset master;
+
+# execute
+
+insert into t2 values (bug27417(1));
+insert into t2 select bug27417(2);
+reset master;
+
+--error ER_DUP_ENTRY
+insert into t2 values (bug27417(2));
+#TODO: Andrei: enable this test after 23333 is pushed
+#show master status; /* only (!) with fixes for #23333 will show there is the query */;
+select count(*) from t1 /* must be 3 */;
+
+reset master;
+select count(*) from t2;
+delete from t2 where a=bug27417(3);
+select count(*) from t2 /* nothing got deleted */;
+#TODO: Andrei: enable this test after 23333 is pushed
+#show master status; /* the query must be in regardless of #23333 */;
+select count(*) from t1 /* must be 5 */;
+
+--enable_info
+delete t2 from t2 where t2.a=bug27417(100) /* must not affect t2 */;
+--disable_info
+select count(*) from t1 /* must be 7 */;
+
+drop function bug27417;
+drop table t1,t2;
+
+--echo end of tests
diff --git a/mysql-test/suite/binlog/t/binlog_stm_ps.test b/mysql-test/suite/binlog/t/binlog_stm_ps.test
new file mode 100644
index 00000000000..83add5af3d7
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_stm_ps.test
@@ -0,0 +1,26 @@
+# This test is to verify replication with PS
+
+-- source include/not_embedded.inc
+-- source include/have_binlog_format_mixed_or_statement.inc
+
+-- disable_query_log
+reset master; # get rid of previous tests binlog
+-- enable_query_log
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+reset master;
+
+#
+# Bug #26842: master binary log contains invalid queries - replication fails
+#
+create table t1 (a int);
+prepare s from "insert into t1 values (@a),(?)";
+set @a=98; execute s using @a;
+prepare s from "insert into t1 values (?)";
+set @a=99; execute s using @a;
+prepare s from "insert into t1 select 100 limit ?";
+set @a=100; execute s using @a;
+source include/show_binlog_events.inc;
+drop table t1;
diff --git a/mysql-test/suite/binlog/t/disabled.def b/mysql-test/suite/binlog/t/disabled.def
new file mode 100644
index 00000000000..888298bbb09
--- /dev/null
+++ b/mysql-test/suite/binlog/t/disabled.def
@@ -0,0 +1,11 @@
+##############################################################################
+#
+# 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.
+#
+##############################################################################
diff --git a/mysql-test/suite/funcs_1/README.txt b/mysql-test/suite/funcs_1/README.txt
index 4661864cf5e..e32299dac2d 100644
--- a/mysql-test/suite/funcs_1/README.txt
+++ b/mysql-test/suite/funcs_1/README.txt
@@ -110,3 +110,32 @@ Carsten 16.09.2005
4. Fixed datadict_<engine>.result files after the change that added 2 columns to
the VIEWS table (DEFINER varchar(77), SECURITY_TYPE varchar(7)).
===================================================================
+Matthias 25.08.2007
+-------------------
+Data dictionary tests:
+Fixes for Bugs 30418,30420,30438,30440
+1. Replace error numbers with error names
+2. Replace static "InnoDB" (not all time available) used within an
+ "alter table" by $OTHER_ENGINE_TYPE (set to MEMORY or MyISAM).
+ Minor adjustment of column data type.
+3. Use mysqltest result set sorting in several cases.
+4. Avoid any statistics about help tables, because their content
+ depends on configuration:
+ developer release - help tables are empty
+ build release - help tables have content + growing with version
+5. Add two help table related tests (one for build, one for developer)
+ to ensure that informations about help tables within
+ INFORMATION_SCHEMA.TABLES/STATISTICS are checked.
+6. Note about new Bug#30689 at the beginning of the test.
+ The files with expected results contain incomplete result sets.
+7. Fix the NDB variant of the data dictionary test (ndb__datadict) as far as
+ it was necessary for the bug fixes mentioned above.
+
+
+General note:
+ Most INFORMATION_SCHEMA properties (table layout, permissions etc.)
+ are not affected by our variation of the storage engines except
+ that some properties of our tables using a specific storage
+ engine become visible. So it makes sense to decompose
+ the data dictionary test into a storage engine specific part and
+ a non storage engine specific part in future.
diff --git a/mysql-test/suite/funcs_1/datadict/datadict_load.inc b/mysql-test/suite/funcs_1/datadict/datadict_load.inc
index 4a9bdc9356d..34792080ace 100644
--- a/mysql-test/suite/funcs_1/datadict/datadict_load.inc
+++ b/mysql-test/suite/funcs_1/datadict/datadict_load.inc
@@ -53,7 +53,7 @@ let $SERVER_NAME= `SELECT DISTINCT host FROM mysql.user WHERE host NOT In ("loca
# load tables
# -----------
#
-# this was part of the 3 files $<engine>_datadict.test, but it has been moved
+# this was part of the 4 files $<engine>_datadict.test, but it has been moved
# here to have only one place where all preparation for the test is done.
#
################################################################################
@@ -61,11 +61,15 @@ let $SERVER_NAME= `SELECT DISTINCT host FROM mysql.user WHERE host NOT In ("loca
eval SET @ENGINE_INNODB = IF( '$engine_type' = 'innodb', 1, 0);
eval SET @ENGINE_MEMORY = IF( '$engine_type' = 'memory', 1, 0);
eval SET @ENGINE_MYISAM = IF( '$engine_type' = 'myisam', 1, 0);
+eval SET @ENGINE_NDB = IF( '$engine_type' = 'ndb', 1, 0);
--enable_query_log
let $engine_myisam= `SELECT @ENGINE_MYISAM = 1`;
let $engine_innodb= `SELECT @ENGINE_INNODB = 1`;
let $engine_memory= `SELECT @ENGINE_MEMORY = 1`;
+let $engine_ndb= `SELECT @ENGINE_NDB = 1`;
+# Note: The NDB variant with their own tb1 - tb4 tables is not ready for use.
+let $engine_ndb= 0;
# Decide, if the objects are to be (re)created
#
@@ -117,6 +121,17 @@ if ($run)
USE test1;
--source suite/funcs_1/include/myisam_tb2.inc
}
+
+ if ($engine_ndb)
+ {
+ --source suite/funcs_1/include/ndb_tb1.inc
+ --source suite/funcs_1/include/ndb_tb2.inc
+ --source suite/funcs_1/include/ndb_tb3.inc
+ --source suite/funcs_1/include/ndb_tb4.inc
+ USE test1;
+ --source suite/funcs_1/include/ndb_tb2.inc
+ }
+
USE test;
--source suite/funcs_1/include/sp_tb.inc
}
diff --git a/mysql-test/suite/funcs_1/datadict/datadict_master.inc b/mysql-test/suite/funcs_1/datadict/datadict_master.inc
index 6088a5c5143..ee94f7cb318 100644
--- a/mysql-test/suite/funcs_1/datadict/datadict_master.inc
+++ b/mysql-test/suite/funcs_1/datadict/datadict_master.inc
@@ -1,5 +1,23 @@
#### suite/funcs_1/datadict/datadict_master.inc
#
+# Checks of INFORMATION_SCHEMA table properties and content.
+# (mostly only the features introduced with MySQL 5.1)
+#
+# Please set the variable $OTHER_ENGINE_TYPE before sourcing this script.
+# $OTHER_ENGINE_TYPE must be
+# - <> $engine_type
+# - all time available like MyISAM or MEMORY
+#
+# Last change:
+# 2007-08-24 mleich Fixes for the bugs
+# #30438 "{memory,myisam,ndb}__datadict" tests fail:
+# Use "InnoDB" without checking
+# #30418 "datadict" tests (all engines) fail:
+# Dependency on the host name for ordering
+# #30420 "datadict" tests (all engines) fail:
+# Release build has help tables loaded
+#
+
--disable_abort_on_error
let $message=
.
@@ -13,8 +31,9 @@ let $message=
. *__datadict.test are started. This can be a result of showing e.g. maximum
. values of the number of rows of tables.
.
-. This .result file has been checked OK with Linux 5.0.23-bk,
-. ChangeSet@1.2211, 2006-06-28 10:11:43-07:00.
+. This .result file has been checked OK with Linux 5.0.48,
+. build tree ChangeSet@1.2477.6.3, 2007-07-30
+. except that the not fixed Bug#30020 causes a difference.
.;
--source include/show_msg80.inc
@@ -29,9 +48,11 @@ let $message=
# and otherwise some extra statements needs to be executed as long as the bug is not
# fixed:
let $have_bug_11589= 1;
+ let $have_bug_30689= 1;
#seems not to work: --vertical_results
eval SELECT $have_bug_11589 AS "have_bug_11589";
+ eval SELECT $have_bug_30689 AS "have_bug_30689";
#seems not to work: --horizontal_results
# As long as
@@ -48,6 +69,15 @@ let $message=
Bug#11589: mysqltest, --ps-protocol, strange output, float/double/real with zerofill;
--source include/show_msg80.inc
}
+ if ($have_bug_30689)
+ {
+ let $message= Selects on INFORMATION_SCHEMA.VIEWS present incomplete
+ content for the column VIEW_DEFINITION in cases where
+ the view selects(=is based) on an INFORMATION_SCHEMA table.
+ ---> VIEWS vu and vu1
+ Bug#30689 Wrong content in I_S.VIEWS.VIEW_DEFINITION if VIEW is based on I_S;
+ --source include/show_msg80.inc
+ }
#
################################################################################
@@ -105,6 +135,7 @@ SELECT DISTINCT u,
AS Server_Clean
FROM db_datadict.vu1;
--replace_result $SERVER_NAME <SERVER_NAME>
+--sorted_result
SELECT * FROM db_datadict.vu order by u;
delimiter //;
@@ -156,7 +187,8 @@ SELECT * FROM tables
# 17 CHECK_TIME
--replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
SELECT * FROM tables
- WHERE NOT( table_schema = 'information_schema');
+WHERE NOT( table_schema = 'information_schema')
+ AND NOT (table_schema = 'mysql' AND table_name LIKE 'help_%');
--horizontal_results
--enable_ps_protocol
@@ -176,9 +208,11 @@ select collation_name, character_set_name into @x,@y
select * from routines;
select count(*) from routines;
-select * from statistics;
+select * from statistics
+where not (table_schema = 'mysql' and table_name like 'help_%');
select * from views;
--replace_result $SERVER_NAME <SERVER_NAME>
+--sorted_result
select * from user_privileges order by grantee, privilege_type;
select * from schema_privileges;
select * from table_privileges;
@@ -187,7 +221,8 @@ select * from table_constraints;
select * from key_column_usage;
select count(*) as max_recs from key_column_usage;
-select max(cardinality) from statistics;
+select max(cardinality) from statistics
+where not (table_schema = 'mysql' and table_name like 'help_%');
select concat("View '",
table_name, "' is associated with the database '", table_schema, "'.")
@@ -199,6 +234,7 @@ select concat("Table or view '", table_name,
from tables;
--replace_result $SERVER_NAME <SERVER_NAME>
+--sorted_result
select grantee as "user's having select privilege",
substring( grantee, length(SUBSTRING_INDEX(grantee,_utf8'@',1))+2 )
from user_privileges where privilege_type = 'select'
@@ -233,47 +269,47 @@ let $dd_part2= LIMIT 1;
# check again, but from different database (will fail due to missing database name)
use db_datadict;
---error 1146
+--error ER_NO_SUCH_TABLE
select * from schemata;
---error 1146
+--error ER_NO_SUCH_TABLE
select * from tables;
---error 1146
+--error ER_NO_SUCH_TABLE
select s.catalog_name, s.schema_name, s.default_character_set_name,
t.table_type, t.engine
from schemata s inner join tables t
ORDER BY s.catalog_name, s.schema_name, s.default_character_set_name;
---error 1146
+--error ER_NO_SUCH_TABLE
select * from columns limit 0, 5;
---error 1146
+--error ER_NO_SUCH_TABLE
select * from character_sets limit 0, 5;
---error 1146
+--error ER_NO_SUCH_TABLE
select * from collations limit 0, 5;
---error 1146
+--error ER_NO_SUCH_TABLE
select * from collation_character_set_applicability limit 0, 5;
---error 1146
+--error ER_NO_SUCH_TABLE
select * from routines limit 0, 5;
---error 1146
+--error ER_NO_SUCH_TABLE
select * from statistics limit 0, 5;
---error 1146
+--error ER_NO_SUCH_TABLE
select * from views limit 0, 5;
---error 1146
+--error ER_NO_SUCH_TABLE
select * from user_privileges limit 0, 5;
---error 1146
+--error ER_NO_SUCH_TABLE
select * from schema_privileges limit 0, 5;
---error 1146
+--error ER_NO_SUCH_TABLE
select * from table_privileges limit 0, 5;
---error 1146
+--error ER_NO_SUCH_TABLE
select * from column_privileges limit 0, 5;
---error 1146
+--error ER_NO_SUCH_TABLE
select * from table_constraints limit 0, 5;
---error 1146
+--error ER_NO_SUCH_TABLE
select * from key_column_usage limit 0, 5;
# Reference Manual 22.1.16 - we will add more ...:
-# --error 1146
+# --error ER_NO_SUCH_TABLE
# select * from parameters;
-# --error 1146
+# --error ER_NO_SUCH_TABLE
# select * from referential_constraints;
-# --error 1146
+# --error ER_NO_SUCH_TABLE
# select * from triggers;
let $message= will fail due to missing database name;
let $dd_part1= SELECT * FROM;
@@ -316,7 +352,8 @@ SELECT * FROM information_schema.tables
# 17 CHRCK_TIME
--replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
SELECT * FROM information_schema.tables
- WHERE NOT( table_schema = 'information_schema');
+WHERE NOT( table_schema = 'information_schema')
+ AND NOT (table_schema = 'mysql' AND table_name LIKE 'help_%');
--horizontal_results
--enable_ps_protocol
@@ -383,13 +420,15 @@ select * from collation_character_set_applicability
order by character_set_name desc, collation_name limit 0, 5;
select routine_definition from routines;
-select * from statistics group by index_name asc limit 0, 5;
+select * from statistics where table_name not like 'help_%'
+group by index_name asc limit 0, 5;
select concat(table_schema, ', ', table_name, ', ', view_definition) view_info
from views;
select concat(table_schema, ', ', table_name) "Table_info"
from tables ORDER BY 1;
--replace_result $SERVER_NAME <SERVER_NAME>
+--sorted_result
select distinct grantee from user_privileges order by grantee, privilege_type;
select * from schema_privileges where table_catalog is null limit 0, 5;
select * from table_privileges where grantee like '%r%' limit 0, 5;
@@ -402,8 +441,10 @@ select sum(ordinal_position) from key_column_usage;
select * from schemata limit 0,5;
select * from schemata limit 0,5;
--replace_result $SERVER_NAME <SERVER_NAME>
+--sorted_result
select distinct grantee from user_privileges;
--replace_result $SERVER_NAME <SERVER_NAME>
+--sorted_result
select all grantee from user_privileges order by grantee, privilege_type;
select id , character_set_name from collations order by id asc limit 10;
@@ -437,20 +478,24 @@ eval SELECT *
# check also with a 'simple' user
CREATE USER user_3212@localhost;
GRANT ALL ON db_datadict.* TO user_3212@localhost;
+# OBN: The following line was added following the fix to bug 28181
+# where queries to information_schema will fail if exporting to
+# a file without having the FILE attribute
+GRANT FILE ON *.* TO user_3212@localhost;
+
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (u3212,localhost,user_3212,,db_datadict);
--source suite/funcs_1/include/show_connection.inc
# no db given --> db_datadict.schema does not exist
---error 1045
+--error ER_NO_SUCH_TABLE
eval SELECT *
INTO OUTFILE '../tmp/out.$ENGINE_TYPE.user.file'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM schemata LIMIT 0, 5;
-# FIXME 3.2.1.2: why do we get different error numbers with and without OUTFILE ?
---error 1146
+--error ER_NO_SUCH_TABLE
eval SELECT *
FROM schemata LIMIT 0, 5;
@@ -460,8 +505,6 @@ eval SELECT *
LINES TERMINATED BY '\n'
FROM information_schema.schemata
WHERE schema_name LIKE 'db_%';
-# The above will fail with access error as long as
-# BUBG#28181 - a regression introduced in 5.0.42 is not fixed
eval SELECT *
FROM information_schema.schemata
@@ -469,14 +512,11 @@ eval SELECT *
USE information_schema;
-# no db given --> db_datadict.schema does not exist
eval SELECT *
INTO OUTFILE '../tmp/out.$ENGINE_TYPE.user_2.file'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM schemata LIMIT 0, 5;
-# The above will fail with access error as long as
-# BUBG#28181 - a regression introduced in 5.0.42 is not fixed
eval SELECT *
FROM schemata LIMIT 0, 5;
@@ -487,8 +527,6 @@ eval SELECT *
LINES TERMINATED BY '\n'
FROM information_schema.schemata
WHERE schema_name LIKE 'db_%';
-# The above will fail with access error as long as
-# BUBG#28181 - a regression introduced in 5.0.42 is not fixed
eval SELECT *
FROM information_schema.schemata
@@ -532,43 +570,43 @@ let $message= Testcase 3.2.1.3:;
################################################################################
#FIXME: in this block we had --error 1288 until Mid Sep05, check the change!
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
insert into schemata (catalog_name, schema_name, default_character_set_name, sql_path)
values ('null', 'db1', 'latin1', 'null');
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
insert into tables (table_schema, table_name)values('db_datadict', 't1');
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
insert into columns (table_name, column_name)values('t3', 'f2');
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
insert into character_sets (character_set_name, default_collate_name, description, maxlen)
values('cp1251', 'cp1251_general_ci', 'windows cyrillic', 1);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
insert into collations ( collation_name, character_set_name, id, is_default, is_compiled, sortlen)
values ('cp1251_bin', 'cp1251', 50, '', '', 0);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
insert into collation_character_set_applicability (collation_name, character_set_name)
values (' big5_chinese_ci', 'big6');
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
insert into routines(routine_name, routine_type ) values ('p2', 'procedure');
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
insert into statistics(table_schema, table_name, index_name)
values ('mysql', 'db', 'primary');
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
insert into views(table_schema, table_name) values ('db2', 'v2');
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
insert into user_privileges (privilege_type, is_grantable) values ('select', 'yes');
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
insert into schema_privileges (table_schema, privilege_type) values('db2', 'insert');
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
insert into table_privileges (able_schema, table_name, privilege_type)
values('db2', 'v2', 'insert');
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
insert into column_privileges (table_name, column_name, privilege_type)
values ('t3', 'f3', 'insert');
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
insert into table_constraints ( constraint_schema, constraint_name, table_schema)
values ('primary', 'mysql', 'user');
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
insert into key_column_usage (constraint_schema, constraint_name, table_name)
values ('mysql', 'primary', 'db');
@@ -589,7 +627,7 @@ delimiter ;//
SELECT table_schema, privilege_type FROM information_schema.schema_privileges
WHERE table_schema LIKE 'db%';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
call db_datadict.sp_4_1_3();
#FIXME: check for the diffs Win ./. Linux
@@ -610,7 +648,7 @@ connect (u413,localhost,user_4_1_3,,test);
use information_schema;
#FIXME: check later the change from 1288 to 1044 (since Mid Sep05)
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
insert into table_constraints ( constraint_schema, constraint_name, table_schema)
values ('primary', 'mysql', 'user');
@@ -630,38 +668,38 @@ use information_schema;
--source suite/funcs_1/include/show_connection.inc
#FIXME: check later the change from 1288 to 1044 (since Mid Sep05) in the whole next block
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
update schemata set schema_name = 'db5' where default_character_set_name = 'latin1';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
update tables set table_schema = 'db_datadict1' where table_name = 't1';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
update columns set table_name = 't4' where column_name = 'f2';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
update character_sets set character_set_name = 'cp1252' where maxlen = 1;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
update collations set collation_name = 'cp1253_bin'
where character_set_name = 'cp1251';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
update collation_character_set_applicability set collation_name = 'big6_chinese_ci'
where character_set_name = 'big6';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
update routines set routine_name = p2 where routine_body = 'sql';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
update statistics set table_schema = 'mysql1' where table_name = 'db';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
update views set table_schema = 'db3' where table_name = 'v1';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
update user_privileges set privilege_type = 'insert' where is_grantable = 'yes';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
update schema_privileges set table_schema = 'db2' where privilege_type = 'select';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
update table_privileges set table_name = 'v3' where privilege_type = 'select';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
update column_privileges set table_name = 't4' where column_name = 'f3';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
update table_constraints set constraint_schema = 'primary'
where table_schema = 'proc';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
update key_column_usage set table_name = 'db1' where constraint_name = 'primary';
# update through a procedure
@@ -681,7 +719,7 @@ delimiter ;//
--replace_column 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
select * from information_schema.routines;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
call db_datadict.sp_4_1_4();
#FIXME: check for the diffs Win ./. Linux
@@ -699,7 +737,7 @@ use information_schema;
--source suite/funcs_1/include/show_connection.inc
#FIXME: check later the change from 1288 to 1044 (since Mid Sep05)
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
update user_privileges set privilege_type = 'insert' where is_grantable = 'yes';
connection default;
@@ -723,35 +761,35 @@ let $dd_part2=;
--source suite/funcs_1/datadict/datadict_tables_error_1044.inc
#FIXME: check later the change from 1288 to 1044 (since Mid Sep05) in the whole next block
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
delete from schemata where schema_name = 'mysql';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
delete from tables where table_name = 'abc';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
delete from columns;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
delete from character_sets;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
delete from collations;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
delete from collation_character_set_applicability;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
delete from routines;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
delete from statistics;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
delete from views;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
delete from user_privileges;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
delete from schema_privileges;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
delete from table_privileges;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
delete from column_privileges;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
delete from table_constraints;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
delete from key_column_usage;
# delete through a procedure
@@ -766,7 +804,7 @@ begin
end//
delimiter ;//
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
call db_datadict.sp_4_1_5();
# cleanup
@@ -780,7 +818,7 @@ use information_schema;
--source suite/funcs_1/include/show_connection.inc
#FIXME: check later the change from 1288 to 1044 (since Mid Sep05)
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
delete from tables where table_name = 'abc';
disconnect u413;
@@ -807,7 +845,7 @@ let $dd_part1= CREATE TABLE;
let $dd_part2= ( c1 INT );
--source suite/funcs_1/datadict/datadict_tables_error_1044.inc
#FIXME solved - 3.2.1.6: check for better error message - 42S02: Unknown table '<xxx>' in <db> ?
---error 1109
+--error ER_UNKNOWN_TABLE
create table t1 (f1 int, f2 int, f3 int);
use db_datadict;
@@ -818,7 +856,7 @@ let $dd_part1= CREATE TABLE information_schema.;
let $dd_part2= ( c1 INT );
--source suite/funcs_1/datadict/datadict_tables_error_1044.inc
#FIXME solved - 3.2.1.6: check for better error message - 42S02: Unknown table '<xxx>' in <db> ?
---error 1109
+--error ER_UNKNOWN_TABLE
create table information_schema.t1 (f1 int, f2 int, f3 int);
# create a table in information_schema as a limited user with sufficient permissions
@@ -841,7 +879,7 @@ let $dd_part1= CREATE TABLE;
let $dd_part2= ( c1 INT );
--source suite/funcs_1/datadict/datadict_tables_error_1044.inc
#FIXME solved - 3.2.1.6: check for better error message - 42S02: Unknown table '<xxx>' in <db> ?
---error 1109
+--error ER_UNKNOWN_TABLE
create table t1 (f1 int, f2 int, f3 int);
use test;
@@ -852,7 +890,7 @@ let $dd_part1= CREATE TABLE information_schema.;
let $dd_part2= ( c1 INT );
--source suite/funcs_1/datadict/datadict_tables_error_1044.inc
#FIXME solved - 3.2.1.6: check for better error message - 42S02: Unknown table '<xxx>' in <db> ?
---error 1109
+--error ER_UNKNOWN_TABLE
create table information_schema.t1 (f1 int, f2 int, f3 int);
#cleanup
@@ -877,7 +915,7 @@ let $dd_part2= AS SELECT * FROM mysql.time_zone;
#FIXME: check change from error 1 to 1044
--source suite/funcs_1/datadict/datadict_tables_error_1044.inc
---error 1109
+--error ER_UNKNOWN_TABLE
CREATE VIEW v1 AS SELECT * FROM information_schema.schemata;
USE db_datadict;
@@ -898,7 +936,7 @@ CREATE USER user_4_1_7@localhost;
GRANT ALL ON db_datadict.* TO user_4_1_7@localhost;
#FIXME: check that GRANT ON i_s is no longer allowed
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
GRANT ALL ON information_schema.* TO user_4_1_7@localhost;
FLUSH PRIVILEGES;
@@ -913,7 +951,7 @@ let $dd_part1= CREATE VIEW ;
let $dd_part2= AS SELECT * FROM db_datadict.v1;
#FIXME: check change from error 1 to 1044
--source suite/funcs_1/datadict/datadict_tables_error_1044.inc
---error 1109
+--error ER_UNKNOWN_TABLE
create view v1 as select * from table_privileges;
use db_datadict;
@@ -943,45 +981,45 @@ let $message= Testcase 3.2.1.8:;
use information_schema;
#FIXME: check later the change from 1288 to 1044 (since Mid Sep05)
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i1 on schemata(schema_name);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i2 on tables(table_schema);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i3 on columns(table_name);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i4 on character_sets(character_set_name);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i5 on collations( collation_name);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i6 on collation_character_set_applicability(collation_name);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i7 on routines(routine_name);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i8 on statistics(table_schema);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i9 on views(table_schema);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i10 on user_privileges(privilege_type);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i11 on schema_privileges(table_schema);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i12 on table_privileges(able_schema);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i13 on column_privileges(table_name);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i14 on table_constraints(constraint_schema);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i15 on key_column_usage(constraint_schema);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i16 on triggers(trigger_name);
use db_datadict;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i15 on information_schema.key_column_usage(constraint_schema);
use information_schema;
@@ -999,45 +1037,45 @@ connect (u4, localhost, user_4_1_8, , test);
use information_schema;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i1 on schemata(schema_name);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i2 on tables(table_schema);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i3 on columns(table_name);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i4 on character_sets(character_set_name);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i5 on collations( collation_name);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i6 on collation_character_set_applicability(collation_name);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i7 on routines(routine_name);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i8 on statistics(table_schema);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i9 on views(table_schema);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i10 on user_privileges(privilege_type);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i11 on schema_privileges(table_schema);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i12 on table_privileges(able_schema);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i13 on column_privileges(table_name);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i14 on table_constraints(constraint_schema);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i15 on key_column_usage(constraint_schema);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i16 on triggers(trigger_name);
use db_datadict;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i15 on information_schema.key_column_usage(constraint_schema);
disconnect u4;
@@ -1072,37 +1110,37 @@ let $dd_part2= ADD f1 INT;
#FIXME: check change from error 1146 to 1044
--source suite/funcs_1/datadict/datadict_tables_error_1044.inc
# now more detailed checks
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
alter table schemata add f1 int;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
alter table tables drop primary key;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
alter table columns add f1 int;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
alter table character_sets disable keys;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
alter table collations enable keys;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
alter table collation_character_set_applicability add f1 int;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
alter table routines discard tablespace;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
alter table statistics import tablespace;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
alter table views drop column table_name;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
alter table user_privileges drop index privilege_type;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
alter table schema_privileges drop column is_grantable;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
alter table table_privileges order by constraint_type;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
alter table column_privileges rename to aaxyz;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
alter table table_constraints order by schema_name;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
alter table key_column_usage rename to information_schema.aabxyz;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
alter table triggers rename to information_schema.sql_mode;
# Alter an information_schema table as a limited user with sufficient permissions
@@ -1207,25 +1245,25 @@ connect (u7,localhost,user_4_1_11, ,test);
use information_schema;
--source suite/funcs_1/include/show_connection.inc
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
drop table routines;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
alter table collations enable keys;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create index i5 on collations( collation_name );
---error 1109
+--error ER_UNKNOWN_TABLE
create view v1 as select * from schemata;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
delete from columns;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
update columns set table_name = 't4' where column_name = 'f2';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
insert into collations ( collation_name, character_set_name, id, is_default,
is_compiled, sortlen)
values ('cp1251_bin', 'cp1251', 50, '', '', 0);
@@ -1253,13 +1291,13 @@ CREATE DATABASE db_datadict;
CREATE USER 'u_6_401011'@'localhost';
#FIXME: check that GRANT ON i_s is no longer allowed
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
GRANT ALL ON information_schema.* TO 'u_6_401011'@'localhost';
GRANT ALL ON db_datadict.* TO 'u_6_401011'@'localhost';
FLUSH PRIVILEGES;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
ALTER TABLE information_schema.schemata RENAME db_datadict.schemata;
let $message= root: move table to other DB;
@@ -1273,7 +1311,7 @@ connect (u_6_401011, localhost, u_6_401011, , db_datadict);
USE information_schema;
--source suite/funcs_1/include/show_connection.inc
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
ALTER TABLE information_schema.schemata RENAME db_datadict.schemata;
let $message= user: move table to other DB;
@@ -1309,38 +1347,38 @@ let $dd_part2=;
#FIXME: check change from error 1288 to 1044
--source suite/funcs_1/datadict/datadict_tables_error_1044.inc
# check UPDATE for all ...
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
UPDATE information_schema.tables SET table_name = 't_4711';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
UPDATE information_schema.columns SET table_name = 't_4711';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
UPDATE information_schema.statistics SET table_name = 't_4711';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
UPDATE information_schema.views SET table_name = 't_4711';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
UPDATE information_schema.table_privileges SET table_name = 't_4711';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
UPDATE information_schema.column_privileges SET table_name = 't_4711';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
UPDATE information_schema.table_constraints SET table_name = 't_4711';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
UPDATE information_schema.key_column_usage SET table_name = 't_4711';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
UPDATE information_schema.schemata SET catalog_name = 't_4711';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
UPDATE information_schema.character_sets SET description = 't_4711';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
UPDATE information_schema.collations SET character_set_name = 't_4711';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
UPDATE information_schema.collation_character_set_applicability
SET character_set_name = 't_4711';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
UPDATE information_schema.routines SET routine_type = 't_4711';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
UPDATE information_schema.user_privileges SET grantee = 't_4711';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
UPDATE information_schema.schema_privileges SET grantee = 't_4711';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
UPDATE information_schema.triggers SET sql_mode = 't_4711';
CREATE USER 'u_6_401012'@'localhost';
@@ -1350,28 +1388,28 @@ connect (u_6_401012, localhost, u_6_401012, , test);
use information_schema;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
insert into information_schema.schemata (catalog_name, schema_name,
default_character_set_name, sql_path)
values (null, information_schema1, utf16, null);
#FIXME: check later the change from 1142 to 1044 (since Mid Sep05)
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
alter table information_schema.schemata rename db_datadict1.schemata;
#FIXME: check later the change from 1146 to 1044 (since Mid Sep05)
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
alter table information_schema.tables drop column checksum;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
alter table information_schema.statistics modify packed int;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
alter table information_schema.routines modify created int not null;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
alter table information_schema.key_column_usage drop column ordinal_position;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
alter table information_schema.table_privileges
change privilege_type rights_approved varchar(32);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
update columns set table_name = 't4' where column_name = 'f2';
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
delete from information_schema.collations;
disconnect u_6_401012;
@@ -1452,7 +1490,7 @@ DROP DATABASE IF EXISTS db_datadict;
CREATE DATABASE db_datadict;
USE db_datadict;
-create table res_t_401014(f1 char(10), f2 text(25), f3 int);
+create table res_t_401014(f1 char(10), f2 varchar(25), f3 int);
create view res_v_401014 as select * from res_t_401014;
create procedure sp_6_401014() select 'db_datadict';
create function fn_6_401014() returns int return 0;
@@ -1468,7 +1506,7 @@ let $message= show existing objects >before< changing them ...;
use db_datadict;
alter table res_t_401014 change f1 ff1 int;
-alter table res_t_401014 engine = innodb;
+eval alter table res_t_401014 engine = $OTHER_ENGINE_TYPE;
alter table res_t_401014 change f3 f3_new bigint;
alter view res_v_401014 as select ff1 from res_t_401014;
alter procedure sp_6_401014 sql security invoker;
@@ -1575,7 +1613,7 @@ connection default;
--source suite/funcs_1/include/show_connection.inc
#FIXME: check that GRANT ON i_s is no longer allowed
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
grant usage on information_schema.* to 'u_6_401016'@'localhost';
FLUSH PRIVILEGES;
@@ -1612,7 +1650,7 @@ let $message= Testcase 3.2.1.17:;
CREATE USER 'u_6_401017'@'localhost';
#FIXME: check that GRANT ON i_s is no longer allowed
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
grant select on information_schema.* to u_6_401017@localhost;
FLUSH PRIVILEGES;
@@ -1658,7 +1696,7 @@ let $message= Testcase 3.2.1.18:;
CREATE USER 'u_6_401018'@'localhost';
#FIXME: check GRANT on IS
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
GRANT CREATE VIEW ON information_schema.* TO 'u_6_401018'@'localhost';
GRANT ALL ON db_datadict.* TO 'u_6_401018'@'localhost';
@@ -1699,52 +1737,52 @@ let $message= Testcase 3.2.1.19:;
CREATE USER 'u_6_401019'@'localhost';
#FIXME: check GRANT on IS
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
grant alter on information_schema.* to 'u_6_401019'@'localhost';
#FIXME: check GRANT on IS
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
grant alter routine on information_schema.* to 'u_6_401019'@'localhost';
#FIXME: check GRANT on IS
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
grant create on information_schema.* to 'u_6_401019'@'localhost';
#FIXME: check GRANT on IS
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
grant create routine on information_schema.* to 'u_6_401019'@'localhost';
#FIXME: check GRANT on IS
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
grant create temporary tables
on information_schema.* to 'u_6_401019'@'localhost';
#FIXME: check GRANT on IS
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
grant delete on information_schema.* to 'u_6_401019'@'localhost';
#FIXME: check GRANT on IS
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
grant drop on information_schema.* to 'u_6_401019'@'localhost';
#FIXME: check GRANT on IS
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
grant execute on information_schema.* to 'u_6_401019'@'localhost';
#FIXME: check GRANT on IS
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
grant index on information_schema.* to 'u_6_401019'@'localhost';
#FIXME: check GRANT on IS
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
grant insert on information_schema.* to 'u_6_401019'@'localhost';
#FIXME: check GRANT on IS
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
grant lock tables on information_schema.* to 'u_6_401019'@'localhost';
#FIXME: check GRANT on IS
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
grant update on information_schema.* to 'u_6_401019'@'localhost';
SELECT * FROM information_schema.table_privileges
@@ -1773,18 +1811,18 @@ connect (u_6_401020, localhost, u_6_401020, , test);
USE information_schema;
SELECT * FROM schemata;
---error 1109
+--error ER_UNKNOWN_TABLE
CREATE TABLE tb_not_allowed ( col TEXT );
#FIXME 3.2.1.20: bad message: ERROR 42S02: Unknown table 'tb_not_allowed' in information_schema
#FIXME 3.2.1.20: better: ERROR 42000: Access denied for user 'u_6_401020'@'localhost' to database 'information_schema'
---error 1109
+--error ER_UNKNOWN_TABLE
create view res_v1 as select * from information_schema.schemata;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
alter table schemata modify catalog_name varchar(255);
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
update schemata set catalog_name = 'abc'
where schema_name = 'information_schema';
@@ -1797,7 +1835,7 @@ CREATE PROCEDURE sp_3_2_1_20()
END//
delimiter ;//
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
DELETE FROM schemata WHERE schema_name = 'information_schema';
disconnect u_6_401020;
@@ -1928,6 +1966,11 @@ let $message= Testcase 3.2.4.2:;
# Testcase 3.2.4.2: Ensure that the table shows the relevant information on
# every collation/character set combination for which the
# current user or PUBLIC have the USAGE privilege.
+# Note(2007-08-24 mleich):
+# The amount of collations/character sets grows with new
+# MySQL releases and is a reason why this test might
+# fail with differences. Please check the new entries
+# and update with expected results afterwards.
################################################################################
SELECT * FROM collation_character_set_applicability;
@@ -3155,7 +3198,7 @@ SELECT * FROM information_schema.tables
# 17 CHECK_TIME
--replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
SELECT * FROM information_schema.tables
- WHERE NOT( table_schema = 'information_schema');
+ WHERE NOT( table_schema = 'information_schema') AND NOT (table_schema = 'mysql' AND table_name LIKE 'help_%');
--enable_ps_protocol
# clean-up
@@ -3355,7 +3398,8 @@ SELECT * FROM information_schema.statistics;
connection default;
--source suite/funcs_1/include/show_connection.inc
REVOKE SELECT ON db_datadict.tb_6_401402_1 FROM 'user_1'@'localhost';
-SELECT * FROM information_schema.statistics;
+SELECT * FROM information_schema.statistics
+WHERE NOT (table_schema = 'mysql' AND table_name LIKE 'help_%');
# nothing visible for user_1
connection user_14_1;
@@ -3657,14 +3701,14 @@ eval $cmd3;
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (user_16_2, localhost, user_2, , db_datadict);
eval $cmd1;
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
eval $cmd2;
eval $cmd3;
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (user_16_3, localhost, user_3, , test);
eval $cmd1;
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
eval $cmd2;
eval $cmd3;
@@ -3682,22 +3726,22 @@ eval $cmd3;
connection user_16_1;
--source suite/funcs_1/include/show_connection.inc
eval $cmd1;
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
eval $cmd2;
eval $cmd3;
--source suite/funcs_1/include/show_connection.inc
# checks entered before bug #12269 was reported
# OK, user_1 has no privs here
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
CREATE TABLE db_datadict.tb_55 ( c1 TEXT );
--source suite/funcs_1/include/show_connection.inc
eval $cmd1;
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
eval $cmd2;
eval $cmd3;
# OK, user_1 has no privs here
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
CREATE TABLE db_datadict.tb_66 ( c1 TEXT );
let $message= add ALL on db_datadict.* (and select on mysql.user) to user_1;
@@ -3720,7 +3764,7 @@ eval $cmd2;
eval $cmd3;
# OK, user_1 has no privs here
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
CREATE TABLE db_datadict.tb_56 ( c1 TEXT );
# using 'USE' lets the server read the privileges new, so now the CREATE works
@@ -3746,13 +3790,13 @@ eval $cmd3;
connection user_16_1;
--source suite/funcs_1/include/show_connection.inc
eval $cmd1;
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
eval $cmd2;
eval $cmd3;
# WORKS, as the existing old privileges are used!
CREATE TABLE db_datadict.tb_58 ( c1 TEXT );
# existing privileges are "read" new when USE is called, user has no priviliges
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
USE db_datadict;
#FIXME 3.2.16: check that it is correct that this now 'works': --error 1142
CREATE TABLE db_datadict.tb_59 ( c1 TEXT );
@@ -3864,7 +3908,7 @@ let $is_table= parameters;
# and don't forget to add the test description to QATestPlanV50func
let $message= checking a table that will be implemented later;
--source include/show_msg.inc
---error 1109
+--error ER_UNKNOWN_TABLE
eval DESC $is_table;
#--source suite/funcs_1/datadict/datadict_show_table_design.inc
# -------------------------------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/datadict/datadict_priv.inc b/mysql-test/suite/funcs_1/datadict/datadict_priv.inc
new file mode 100644
index 00000000000..36143e1526e
--- /dev/null
+++ b/mysql-test/suite/funcs_1/datadict/datadict_priv.inc
@@ -0,0 +1,107 @@
+############## suite/funcs_1/datadict/datadict_priv.inc ################
+# #
+# DDL and DML operations on information_schema tables #
+# #
+# Creation: #
+# 2007-08 hhunger Implement this test as part of #
+# WL#3982 Test information_schema.processlist #
+# #
+# Last update: #
+# 2007-08-14 mleich Some cleanup #
+# #
+########################################################################
+
+# These variables have to be set before sourcing this file.
+#
+# information_schema table to be tested
+# let $table= processlist;
+#
+# columns of the information_schema table e.g. to use in a select.
+# let $columns= ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO;
+#
+# Where clause for an update.
+# let $update_where= WHERE id=1 ;
+#
+# Column to be used in the SET of an update.
+# let $set_column= user='any_user' ;
+#
+# Where clause of a delete.
+# let $delete_where= WHERE id=1 ;
+#
+# Column to be dropped.
+# let $drop_column= user;
+#
+# Column to be indexed
+# let $index_col= user;
+
+
+# data access
+
+eval CREATE TEMPORARY TABLE test.t_$table AS SELECT * FROM $table;
+
+eval UPDATE test.t_$table SET user='horst' $update_where ;
+
+--error ER_DBACCESS_DENIED_ERROR
+eval INSERT INTO $table SELECT * FROM test.t_$table;
+
+# bug#30208: CREATE TABLE ...LIKE does not accept dbname.tablename:unknown database
+eval DROP TABLE test.t_$table;
+
+--error ER_VIEW_NONUPD_CHECK
+eval CREATE VIEW test.v_$table ($columns) AS SELECT * FROM $table WITH CHECK OPTION;
+
+eval CREATE VIEW test.v_$table ($columns) AS SELECT * FROM $table;
+
+--error ER_DBACCESS_DENIED_ERROR
+eval UPDATE test.v_$TABLE SET TIME=NOW() WHERE id = 1;
+
+eval DROP VIEW test.v_$table;
+
+--error ER_DBACCESS_DENIED_ERROR
+eval UPDATE $table SET $set_column $update_where;
+
+--error ER_DBACCESS_DENIED_ERROR
+eval DELETE FROM $table $delete_where;
+
+# change privileges
+
+--error ER_DBACCESS_DENIED_ERROR
+eval REVOKE ALL ON $table FROM current_user;
+
+--error ER_DBACCESS_DENIED_ERROR
+eval GRANT INSERT,UPDATE ON $table TO current_user;
+
+SHOW GRANTS;
+
+#----------------------------------------------------------------------
+# table access
+
+--error ER_DBACCESS_DENIED_ERROR
+eval CREATE INDEX i_$table ON $table ($index_col);
+
+--error ER_DBACCESS_DENIED_ERROR
+eval DROP TABLE $table;
+
+--error ER_DBACCESS_DENIED_ERROR
+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
+eval RENAME TABLE $table TO new_$table;
+
+--error ER_DBACCESS_DENIED_ERROR
+eval RENAME TABLE $table TO files;
+
+--error ER_UNKNOWN_TABLE
+eval CREATE TABLE new_$table AS SELECT * FROM $table;
+
+#----------------------------------------------------------------------
+# database access
+
+--error ER_DBACCESS_DENIED_ERROR
+DROP DATABASE information_schema;
+
+--error ER_DBACCESS_DENIED_ERROR
+RENAME DATABASE information_schema TO info_schema;
diff --git a/mysql-test/suite/funcs_1/datadict/datadict_tables_error_1044.inc b/mysql-test/suite/funcs_1/datadict/datadict_tables_error_1044.inc
index a8876ee7db6..a8876ee7db6 100644..100755
--- a/mysql-test/suite/funcs_1/datadict/datadict_tables_error_1044.inc
+++ b/mysql-test/suite/funcs_1/datadict/datadict_tables_error_1044.inc
diff --git a/mysql-test/suite/funcs_1/datadict/processlist_priv.inc b/mysql-test/suite/funcs_1/datadict/processlist_priv.inc
new file mode 100644
index 00000000000..337ddf5df60
--- /dev/null
+++ b/mysql-test/suite/funcs_1/datadict/processlist_priv.inc
@@ -0,0 +1,434 @@
+############ suite/funcs_1/datadict/processlist_priv.inc ###############
+# #
+# Testing of privileges around #
+# SELECT ... PROCESSLIST/SHOW PROCESSLIST #
+# #
+# Note(mleich): #
+# There is a significant risk to get an unstable test because of #
+# timing issues. #
+# Example1: #
+# 1. Disconnect connection X #
+# 2. Switch to connection Y #
+# 3. SHOW PROCESSLIST might present a record like #
+# <ID> <user> <host> <db> Quit 0 cleaning up NULL #
+# or even a row where connection X is without #
+# "Quit" or "cleaning up". #
+# That means our SHOW PROCESSLIST can come too early. #
+# Solution: #
+# Close the connections at the end of the test. #
+# Example2: #
+# 1. connection X: SHOW PROCESSLIST/GRANT ... etc. #
+# 2. Switch to connection Y #
+# 3. SHOW PROCESSLIST might present a record like #
+# <ID> <user> <host> <db> Query TIME cleaning up <command> #
+# <ID> <user> <host> <db> Query TIME writing to net <command> #
+# Problems happens more often in case of slow filesystem! #
+# First Solution: #
+# Insert a dummy SQL command where the cleanup is most probably #
+# fast before switching to another connection and running #
+# SHOW/SELECT PROCESSLIST. #
+# Suppress writing to protocol by assignment to $variable. #
+# let $my_var= `SELECT 1`; #
+# Even the 'SELECT 1' was in some cases in state #
+# "writing to net". #
+# Final Solution: #
+# --real_sleep 0.3 #
+# This value was at least on my box sufficient. #
+# Please inform us if this test fails so that we can adjust #
+# the sleep time better or switch to poll routines. #
+# #
+# Storage engine variants of this test do not make sense. #
+# - I_S tables use the MEMORY storage engine whenever possible. #
+# - There are some I_S table which need column data types which #
+# are not supported by MEMORY. Example: LONGTEXT/BLOB #
+# MyISAM will be used for such tables. #
+# The column PROCESSLIST.INFO is of data type LONGTEXT #
+# ----> MyISAM #
+# - There is no impact of the GLOBAL(server) or SESSION default #
+# storage engine setting on the engine used for I_S tables. #
+# That means we cannot get NDB or InnoDB instead. #
+# #
+# Creation: #
+# 2007-08 hhunger Implement this test as part of #
+# WL#3982 Test information_schema.processlist #
+# #
+# Last update: #
+# 2007-08-14 mleich Corrections #
+# #
+########################################################################
+
+# The following variables are used in "datadict_priv.inc" and here.
+#
+# information_schema table to be tested
+let $table= processlist;
+#
+# columns of the information_schema table e.g. to use in a select.
+let $columns= ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO;
+#
+# Where clause for an update.
+let $update_where= WHERE id=1 ;
+#
+# Column to be used in the SET of an update.
+let $set_column= user='any_user' ;
+#
+# Where clause of a delete.
+let $delete_where= WHERE id=1 ;
+#
+# Column to be dropped.
+let $drop_column= user;
+#
+# Column to be indexed
+let $index_col= user;
+
+USE information_schema;
+
+--echo ####################################################################################
+--echo 1 Prepare test.
+--echo connection default (user=root)
+--echo ####################################################################################
+
+--echo ####################################################################################
+--echo 1.1 Create two user
+--echo ####################################################################################
+# access to info tables as normal user
+--disable_abort_on_error
+DROP USER ddicttestuser1@'localhost';
+DROP USER ddicttestuser2@'localhost';
+--enable_abort_on_error
+CREATE USER ddicttestuser1@'localhost';
+CREATE USER ddicttestuser2@'localhost';
+SET PASSWORD FOR ddicttestuser1@'localhost' = PASSWORD('ddictpass');
+SET PASSWORD FOR ddicttestuser2@'localhost' = PASSWORD('ddictpass');
+
+--echo ####################################################################################
+--echo 1.2 Establish connection con100 (user=ddicttestuser1 with no PROCESS privilege):
+connect (con100,localhost,ddicttestuser1,ddictpass,information_schema);
+--echo ####################################################################################
+
+
+--echo ####################################################################################
+--echo 2 connection default(user=root with default privileges):
+--echo SHOW/SELECT shows all processes/threads.
+--echo ####################################################################################
+connection default;
+eval SHOW CREATE TABLE $table;
+--replace_column 6 TIME
+eval SHOW $table;
+--replace_column 6 TIME
+eval SELECT * FROM $table $select_where ORDER BY id;
+--replace_column 6 TIME
+eval SELECT $columns FROM $table $select_where ORDER BY id;
+--source suite/funcs_1/datadict/datadict_priv.inc
+--real_sleep 0.3
+
+
+--echo ####################################################################################
+--echo 3 Switch to connection con100 (user=ddicttestuser1 with no PROCESS privilege):
+connection con100;
+--echo SHOW/SELECT shows only the processes (1) of the user.
+--echo ####################################################################################
+eval SHOW CREATE TABLE $table;
+--replace_column 6 TIME
+eval SHOW $table;
+--replace_column 6 TIME
+eval SELECT * FROM $table $select_where ORDER BY id;
+--replace_column 6 TIME
+eval SELECT $columns FROM $table $select_where ORDER BY id;
+--source suite/funcs_1/datadict/datadict_priv.inc
+--real_sleep 0.3
+
+
+--echo ####################################################################################
+--echo 4 Grant PROCESS privilege to ddicttestuser1
+--echo connection default (user=root)
+--echo ####################################################################################
+connection default;
+GRANT PROCESS ON *.* TO ddicttestuser1@'localhost' IDENTIFIED BY 'ddictpass';
+--real_sleep 0.3
+
+--echo ####################################################################################
+--echo 4.1 Existing connection con100 (ddicttestuser1)
+--echo The user ddicttestuser1 has the PROCESS privilege, but the connection was
+--echo established before PROCESS was granted.
+--echo SHOW/SELECT shows only the processes (1) of the user.
+--echo ####################################################################################
+connection con100;
+SHOW GRANTS;
+--replace_column 6 TIME
+SHOW processlist;
+--replace_column 6 TIME
+SELECT * FROM information_schema.processlist;
+--real_sleep 0.3
+
+--echo ####################################################################################
+--echo 4.2 New connection con101 (ddicttestuser1 with PROCESS privilege)
+--echo SHOW/SELECT shows all processes/threads.
+--echo ####################################################################################
+connect (con101,localhost,ddicttestuser1,ddictpass,information_schema);
+SHOW GRANTS;
+--replace_column 6 TIME
+SHOW processlist;
+--replace_column 6 TIME
+SELECT * FROM information_schema.processlist;
+--real_sleep 0.3
+
+
+--echo ####################################################################################
+--echo 5 Grant PROCESS privilege to anonymous user.
+--echo connection default (user=root)
+--echo ####################################################################################
+connection default;
+GRANT PROCESS ON *.* TO ''@'localhost';
+--real_sleep 0.3
+
+--echo ####################################################################################
+--echo 5.1 Establish connection (anonymous1,localhost,'',,information_schema)
+--echo anonymous user with PROCESS privilege
+--echo SHOW/SELECT shows all processes/threads.
+--echo ####################################################################################
+connect (anonymous1,localhost,'',,information_schema);
+SHOW GRANTS;
+--replace_column 6 TIME
+SHOW processlist;
+--replace_column 6 TIME
+SELECT * FROM information_schema.processlist;
+--real_sleep 0.3
+
+
+--echo ####################################################################################
+--echo 6 Revoke PROCESS privilege from ddicttestuser1
+--echo connection default (user=root)
+--echo ####################################################################################
+connection default;
+REVOKE PROCESS ON *.* FROM ddicttestuser1@'localhost' IDENTIFIED BY 'ddictpass';
+--real_sleep 0.3
+
+--echo ####################################################################################
+--echo 6.1 New connection con102 (ddicttestuser1 has no more PROCESS privilege)
+connect (con102,localhost,ddicttestuser1,ddictpass,information_schema);
+--echo Again (compared to state before GRANT PROCESS) only the processes of
+--echo ddicttestuser1 are visible.
+--echo ####################################################################################
+SHOW GRANTS;
+--replace_column 6 TIME
+SHOW processlist;
+--replace_column 6 TIME
+SELECT * FROM information_schema.processlist;
+--real_sleep 0.3
+
+
+--echo ####################################################################################
+--echo 7 Revoke PROCESS privilege from anonymous user + disconnect ddicttestuser1
+--echo connection default (user=root)
+--echo ####################################################################################
+connection default;
+REVOKE PROCESS ON *.* FROM ''@'localhost';
+--real_sleep 0.3
+
+--echo ####################################################################################
+--echo 7.1 New connection (anonymous2,localhost,'',,information_schema)
+connect (anonymous2,localhost,'',,information_schema);
+--echo The anonymous user has no more the PROCESS privilege
+--echo Again only the processes of the anonymous user are visible.
+--echo ####################################################################################
+SHOW GRANTS FOR ''@'localhost';
+if ($fixed_bug_30395)
+{
+# Bug#30395 strange results after REVOKE PROCESS ON *.* FROM ...
+--replace_column 6 TIME
+SHOW processlist;
+}
+--replace_column 6 TIME
+SELECT * FROM information_schema.processlist;
+--real_sleep 0.3
+
+
+--echo ####################################################################################
+--echo 8 Grant SUPER (does not imply PROCESS) privilege to ddicttestuser1
+--echo connection default (user=root)
+--echo ####################################################################################
+connection default;
+GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost';
+--real_sleep 0.3
+
+--echo ####################################################################################
+--echo 8.1 New connection con103 (ddicttestuser1 with SUPER privilege)
+connect (con103,localhost,ddicttestuser1,ddictpass,information_schema);
+--echo Only the processes of ddicttestuser1 user are visible.
+--echo ####################################################################################
+SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
+--replace_column 6 TIME
+SHOW processlist;
+--replace_column 6 TIME
+SELECT * FROM information_schema.processlist;
+--real_sleep 0.3
+
+
+--echo ####################################################################################
+--echo 9 Revoke SUPER privilege from user ddicttestuser1
+--echo connection default (user=root)
+--echo ####################################################################################
+connection default;
+REVOKE SUPER ON *.* FROM 'ddicttestuser1'@'localhost';
+--real_sleep 0.3
+
+--echo ####################################################################################
+--echo 9.1 New connection con104 (ddicttestuser1 without SUPER privilege)
+connect (con104,localhost,ddicttestuser1,ddictpass,information_schema);
+--echo ddicttestuser1 has no more the SUPER privilege.
+--echo Only the processes of ddicttestuser1 are visible.
+--echo ####################################################################################
+SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
+--replace_column 6 TIME
+SHOW processlist;
+--replace_column 6 TIME
+SELECT * FROM information_schema.processlist;
+--real_sleep 0.3
+
+
+--echo ####################################################################################
+--echo 10 Grant SUPER privilege with grant option to user ddicttestuser1.
+--echo connection default (user=root)
+--echo ####################################################################################
+connection default;
+GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost' WITH GRANT OPTION;
+--real_sleep 0.3
+
+--echo ####################################################################################
+--echo 10.1 New connection con105 (ddicttestuser1 with SUPER privilege and GRANT OPTION)
+connect (con105,localhost,ddicttestuser1,ddictpass,information_schema);
+--echo Try to grant PROCESS privilege to user ddicttestuser2 without having it.
+--echo ####################################################################################
+SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
+--error ER_ACCESS_DENIED_ERROR
+GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
+
+--echo ####################################################################################
+--echo 10.2 Grant SUPER and PROCESS privilege with grant option to user ddicttestuser1
+--echo connection default (user=root)
+--echo ####################################################################################
+connection default;
+GRANT SUPER,PROCESS ON *.* TO 'ddicttestuser1'@'localhost' WITH GRANT OPTION;
+--real_sleep 0.3
+
+--echo ####################################################################################
+--echo 10.3 New connection con106 (ddicttestuser1 with SUPER,PROCESS WITH GRANT OPTION)
+connect (con106,localhost,ddicttestuser1,ddictpass,information_schema);
+--echo Grant PROCESS privilege to user ddicttestuser2
+--echo ####################################################################################
+SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
+GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
+--real_sleep 0.3
+
+--echo ####################################################################################
+--echo 10.4 New connection con200 (ddicttestuser2 with PROCESS privilege)
+connect (con200,localhost,ddicttestuser2,ddictpass,information_schema);
+--echo ddicttestuser2 has now the PROCESS privilege and sees all connections
+--echo ####################################################################################
+SHOW GRANTS FOR 'ddicttestuser2'@'localhost';
+--replace_column 6 TIME
+SHOW processlist;
+--replace_column 6 TIME
+SELECT * FROM information_schema.processlist;
+--real_sleep 0.3
+
+
+--echo ####################################################################################
+--echo 11 User ddicttestuser1 revokes PROCESS privilege from user ddicttestuser2
+--echo connection ddicttestuser1;
+--echo ####################################################################################
+connection con106;
+REVOKE PROCESS ON *.* FROM 'ddicttestuser2'@'localhost';
+--real_sleep 0.3
+
+--echo ####################################################################################
+--echo 11.1 New connection con201 (ddicttestuser2)
+connect (con201,localhost,ddicttestuser2,ddictpass,information_schema);
+--echo ddicttestuser2 has no more the PROCESS privilege and can only see own connects
+--echo ####################################################################################
+SHOW GRANTS;
+--replace_column 6 TIME
+SHOW processlist;
+--replace_column 6 TIME
+SELECT * FROM information_schema.processlist;
+--real_sleep 0.3
+
+--echo ####################################################################################
+--echo 11.2 Revoke SUPER,PROCESS,GRANT OPTION privilege from user ddicttestuser1
+--echo connection default (user=root)
+--echo ####################################################################################
+connection default;
+REVOKE SUPER,PROCESS,GRANT OPTION ON *.* FROM 'ddicttestuser1'@'localhost';
+--real_sleep 0.3
+
+--echo ####################################################################################
+--echo 11.3 New connection con107 (ddicttestuser1)
+connect (con107,localhost,ddicttestuser1,ddictpass,information_schema);
+--echo ddicttestuser1 has no more the PROCESS privilege and can only see own connects
+--echo He is also unable to GRANT the PROCESS privilege to ddicttestuser2
+--echo ####################################################################################
+SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
+--error ER_ACCESS_DENIED_ERROR
+GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
+--replace_column 6 TIME
+SHOW processlist;
+--replace_column 6 TIME
+SELECT * FROM information_schema.processlist;
+--real_sleep 0.3
+
+
+--echo ####################################################################################
+--echo 12 Revoke the SELECT privilege from user ddicttestuser1
+--echo connection default (user=root)
+--echo ####################################################################################
+connection default;
+REVOKE SELECT ON *.* FROM 'ddicttestuser1'@'localhost';
+--real_sleep 0.3
+
+--echo ####################################################################################
+--echo 12.1 New connection con108 (ddicttestuser1)
+connect (con108,localhost,ddicttestuser1,ddictpass,information_schema);
+--echo ddicttestuser1 has neither PROCESS nor SELECT privilege
+--echo Manual says: Each MySQL user has the right to access these tables, but can see
+--echo only the rows ...
+--echo Therefore the missing SELECT privilege does not affect SELECTs on PROCESSLIST.
+--echo ####################################################################################
+SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
+--replace_column 6 TIME
+SHOW processlist;
+--replace_column 6 TIME
+SELECT * FROM information_schema.processlist;
+--real_sleep 0.3
+
+--echo ####################################################################################
+--echo 12.2 Revoke only the SELECT privilege on the information_schema from ddicttestuser1.
+--echo connection default (user=root)
+--echo ####################################################################################
+connection default;
+--error ER_DBACCESS_DENIED_ERROR
+REVOKE SELECT ON information_schema.* FROM 'ddicttestuser3'@'localhost';
+--real_sleep 0.3
+
+
+--echo ####################################################################################
+--echo connection default (user=root)
+--echo Cleanup: close connections, DROP USER etc.
+--echo ####################################################################################
+connection default;
+disconnect con100;
+disconnect con101;
+disconnect con102;
+disconnect con103;
+disconnect con104;
+disconnect con105;
+disconnect con106;
+disconnect con107;
+disconnect con108;
+disconnect con200;
+disconnect con201;
+disconnect anonymous1;
+disconnect anonymous2;
+DROP USER ddicttestuser1@'localhost';
+DROP USER ddicttestuser2@'localhost';
+REVOKE USAGE ON *.* FROM ''@'localhost';
+DROP USER ''@'localhost';
diff --git a/mysql-test/suite/funcs_1/datadict/processlist_val.inc b/mysql-test/suite/funcs_1/datadict/processlist_val.inc
new file mode 100644
index 00000000000..da2c2950095
--- /dev/null
+++ b/mysql-test/suite/funcs_1/datadict/processlist_val.inc
@@ -0,0 +1,333 @@
+########### suite/funcs_1/datadict/processlist_val.inc #################
+# #
+# Testing of values within INFORMATION_SCHEMA.PROCESSLIST #
+# #
+# Ensure that the values fit to the current state of the connection #
+# and especially that they change if a connection does nothing or #
+# runs some SQL. #
+# Examples: #
+# - change the default database #
+# - send some time no SQL command to the server #
+# - send a long running query #
+# #
+# Note(mleich): #
+# 1. Please inform me if this test fails because of timing problems. #
+# I tried to avoid instabilities but the values within the column #
+# TIME are very sensible to fluctuations of the machine load. #
+# I had to unify some TIME values with "--replace_result" in cases #
+# where they are too unstable. #
+# 2. Storage engine variants of this test do not make sense. #
+# - I_S tables use the MEMORY storage engine whenever possible. #
+# - There are some I_S table which need column data types which #
+# are not supported by MEMORY. Example: LONGTEXT/BLOB #
+# MyISAM will be used for such tables. #
+# The column PROCESSLIST.INFO is of data type LONGTEXT #
+# ----> MyISAM #
+# - There is no impact of the GLOBAL(server) or SESSION default #
+# storage engine setting on the engine used for I_S tables. #
+# That means we cannot get NDB or InnoDB instead. #
+# 3. The SHOW (FULL) PROCESSLIST command are for comparison. #
+# The main test target is INFORMATION_SCHEMA.PROCESSLIST ! #
+# #
+# Creation: #
+# 2007-08-09 mleich Implement this test as part of #
+# WL#3982 Test information_schema.processlist #
+# #
+########################################################################
+
+# Basic preparations
+--disable_abort_on_error
+DROP USER ddicttestuser1@'localhost';
+--enable_abort_on_error
+CREATE USER ddicttestuser1@'localhost';
+GRANT ALL ON *.* TO ddicttestuser1@'localhost';
+REVOKE PROCESS ON *.* FROM ddicttestuser1@'localhost';
+SET PASSWORD FOR ddicttestuser1@'localhost' = PASSWORD('ddictpass');
+--disable_warnings
+DROP TABLE IF EXISTS test.t1;
+--enable_warnings
+CREATE TABLE test.t1 (f1 BIGINT);
+
+
+# Show the definition of the PROCESSLIST table
+#--------------------------------------------------------------------------
+SHOW CREATE TABLE INFORMATION_SCHEMA.PROCESSLIST;
+
+
+# Ensure that the values follow the changing default database and statement
+#--------------------------------------------------------------------------
+# - We have now exact one connection. -> One record
+SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST;
+# - Other expected values
+# - USER = 'root'
+# - HOST = 'localhost'
+# - DB = 'test'
+# - Command = 'Query'
+# - TIME = 0, I hope the testing machines are all time fast enough
+# - State IS NULL
+# - INFO must contain the corresponding SHOW/SELECT PROCESSLIST
+USE test;
+--replace_column 1 <ID>
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+--replace_column 1 <ID>
+SHOW FULL PROCESSLIST;
+#
+# Expect to see now DB = 'information_schema'
+USE information_schema;
+--replace_column 1 <ID> 6 <TIME>
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+--replace_column 1 <ID> 6 <TIME>
+SHOW FULL PROCESSLIST;
+#
+# Expect to see now INFO = 'SELECT INFO FROM INFORMATION_SCHEMA.PROCESSLIST;'
+SELECT INFO FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+
+# Ensure that the values for an additional connection are correct
+#--------------------------------------------------------------------------
+SELECT ID INTO @my_proclist_id FROM INFORMATION_SCHEMA.PROCESSLIST;
+--echo
+--echo ----- establish connection ddicttestuser1 (user = ddicttestuser1) -----
+connect (ddicttestuser1,localhost,ddicttestuser1,ddictpass,information_schema);
+#
+--echo
+--echo ----- switch to connection default (user = root) -----
+connection default;
+# - We have now a second connection.
+# - important values in second connection
+# - USER = ddicttestuser1
+# - HOST = 'localhost'
+# - DB = 'information_schema'
+# - Command = 'Sleep'
+# - TIME = 0, I hope the testing machines are all time fast enough
+# - State IS NULL
+# - INFO must be empty
+--replace_column 1 <ID>
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+# Change the SQL command (affects content of INFO)
+--replace_column 1 <ID>
+SHOW FULL PROCESSLIST;
+#
+--echo # Sleep some time
+# The value of TIME must increase after some sleeps.
+# So poll till TIME changes.
+let $run= 10;
+while ($run)
+{
+ dec $run;
+ if (`SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST
+ WHERE ID = @my_proclist_id + 1 AND TIME > 0`)
+ {
+ let $run= 0;
+ }
+ --real_sleep 0.2
+}
+# Either we have now reached TIME = 1 or we fail with unexpected result.
+# Expect to see now TIME = 1
+--replace_column 1 <ID>
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+--replace_column 1 <ID>
+SHOW FULL PROCESSLIST;
+# The second connection must have an ID = my ID + 1;
+SELECT ID = @my_proclist_id + 1 FROM INFORMATION_SCHEMA.PROCESSLIST
+WHERE USER = 'ddicttestuser1';
+
+
+# Ensure that the user ddicttestuser1 sees only connections with his username
+# because he has not the PROCESS privilege.
+#----------------------------------------------------------------------------
+--echo
+--echo ----- switch to connection ddicttestuser1 (user = ddicttestuser1) -----
+connection ddicttestuser1;
+--replace_column 1 <ID> 6 <TIME>
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+--replace_column 1 <ID> 6 <TIME>
+SHOW FULL PROCESSLIST;
+
+
+# Ensure that the user ddicttestuser1 sees all connections with his username.
+#----------------------------------------------------------------------------
+--echo
+--echo ----- establish connection con2 (user = ddicttestuser1) ------
+connect (con2,localhost,ddicttestuser1,ddictpass,information_schema);
+--replace_column 1 <ID> 6 <TIME>
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+--replace_column 1 <ID> 6 <TIME>
+SHOW FULL PROCESSLIST;
+#
+--echo
+--echo ----- switch to connection default (user = root) -----
+connection default;
+--echo ----- close connection con2 -----
+disconnect con2;
+
+
+# Ensure we see correct values if a connection is during work
+#----------------------------------------------------------------------------
+--echo
+--echo ----- switch to connection ddicttestuser1 (user = ddicttestuser1) -----
+connection ddicttestuser1;
+# "Organise" a long running command to be observed by the root user
+--echo
+--echo
+--echo # Send a long enough running statement to the server, but do not
+--echo # wait till the result comes back. We will pull this later.
+send SELECT sleep(2.5),'Command time';
+#
+--echo
+--echo ----- switch to connection default (user = root) -----
+connection default;
+# Sleep a bit so that we can be nearly sure that we see the SELECT of ddicttestuser1.
+# Expect to see within the processlist the other connection just during statement
+# execution.
+# - USER = ddicttestuser1
+# - HOST = 'localhost'
+# - DB = 'information_schema'
+# - Command = 'Query'
+# - TIME = 1, Attention: check with TIME = 0 is not stable
+# - State IS NULL
+# - INFO = "SELECT sleep(2.5),'Command time'"
+--echo # Sleep some time
+# The command must be at some time in work by the server.
+# So poll till INFO is no more NULL and TIME > 0.
+let $run= 10;
+while ($run)
+{
+ dec $run;
+ if (`SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST
+ WHERE INFO IS NOT NULL AND TIME > 0`)
+ {
+ let $run= 0;
+ }
+ --real_sleep 0.2
+}
+# Expect to see TIME = 1
+--replace_column 1 <ID>
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+--replace_column 1 <ID>
+SHOW FULL PROCESSLIST;
+#
+--echo # Sleep some time
+# The value of TIME must increase after some sleeps therefore
+# poll till TIME changes
+let $run= 10;
+while ($run)
+{
+ dec $run;
+ if (`SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST
+ WHERE ID = @my_proclist_id + 1 AND TIME > 1`)
+ {
+ let $run= 0;
+ }
+ --real_sleep 0.2
+}
+# Either we have now reached TIME = 2 or we fail with unexpected result.
+--replace_column 1 <ID>
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+--replace_column 1 <ID>
+SHOW FULL PROCESSLIST;
+#
+--echo
+--echo ----- switch to connection ddicttestuser1 (user = ddicttestuser1) -----
+connection ddicttestuser1;
+--echo # Pull("reap") the result set from the statement executed with "send".
+reap;
+
+
+# Ensure that SHOW/SELECT processlist can handle extreme long commands
+#----------------------------------------------------------------------------
+--echo
+--echo
+--echo # Send a long (21 KB code and runtime = 2 seconds) statement to the server,
+--echo # but do not wait till the result comes back. We will pull this later.
+# Please do not change the next statement.
+# The annoying long line is intended. Many short lines would be a different test.
+send SELECT sleep(2),'BEGIN this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.END' AS "my_monster_statement";
+#
+--echo
+--echo ----- switch to connection default (user = root) -----
+connection default;
+--echo # Sleep some time
+# The command must be at some time in work by the server.
+# So poll till INFO is no more NULL.
+let $run= 10;
+while ($run)
+{
+ dec $run;
+ if (`SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST
+ WHERE INFO IS NOT NULL`)
+ {
+ let $run= 0;
+ }
+ --real_sleep 0.2
+}
+# Expect to see that SELECT/SHOW PROCESSLIST can handle my statement monster.
+--replace_column 1 <ID> 6 <TIME>
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+--replace_column 1 <ID> 6 <TIME>
+SHOW FULL PROCESSLIST;
+# SHOW PROCESSLIST truncates INFO after 100 characters.
+--replace_column 1 <ID> 6 <TIME>
+SHOW PROCESSLIST;
+--echo
+--echo ----- switch to connection ddicttestuser1 (user = ddicttestuser1) -----
+connection ddicttestuser1;
+--echo # Pull("reap") the result set from the monster statement executed with "send".
+reap;
+
+
+# Ensure that we see that a connection "hangs" when colliding with a
+# WRITE TABLE LOCK
+#----------------------------------------------------------------------------
+--echo
+--echo ----- switch to connection default (user = root) -----
+connection default;
+LOCK TABLE test.t1 WRITE;
+#
+--echo
+--echo ----- switch to connection ddicttestuser1 (user = ddicttestuser1) -----
+connection ddicttestuser1;
+--echo # Send a statement to the server, but do not wait till the result
+--echo # comes back. We will pull this later.
+send SELECT COUNT(*) FROM test.t1;
+#
+--echo
+--echo ----- switch to connection default (user = root) -----
+connection default;
+--echo # Sleep some time
+# The command must be at some time in work by the server.
+# So poll till INFO is no more NULL.
+let $run= 10;
+while ($run)
+{
+ dec $run;
+ if (`SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST
+ WHERE INFO IS NOT NULL`)
+ {
+ let $run= 0;
+ }
+ --real_sleep 0.2
+}
+# Expect to see the state 'Locked' for the second connection because the SELECT
+# collides with the WRITE TABLE LOCK.
+--replace_column 1 <ID> 6 <TIME>
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+--replace_column 1 <ID> 6 <TIME>
+SHOW FULL PROCESSLIST;
+UNLOCK TABLES;
+#
+--echo
+--echo ----- switch to connection ddicttestuser1 (user = ddicttestuser1) -----
+connection ddicttestuser1;
+--echo # Pull("reap") the result set from the statement executed with "send".
+reap;
+
+
+# Cleanup
+--echo
+--echo ----- switch to connection default (user = root) -----
+connection default;
+--echo
+--echo ----- close connection ddicttestuser1 -----
+disconnect ddicttestuser1;
+DROP USER ddicttestuser1@'localhost';
diff --git a/mysql-test/suite/funcs_1/include/ndb_tb2.inc b/mysql-test/suite/funcs_1/include/ndb_tb2.inc
index 4a59ed7bf2d..3e6efe47e18 100644
--- a/mysql-test/suite/funcs_1/include/ndb_tb2.inc
+++ b/mysql-test/suite/funcs_1/include/ndb_tb2.inc
@@ -55,7 +55,7 @@ f106 year(3) not null default 2000,
f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
-) engine = innodb;
+) engine = ndb;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data infile '$MYSQL_TEST_DIR/suite/funcs_1/data/ndb_tb2.txt' into table tb2 ;
diff --git a/mysql-test/suite/funcs_1/r/a_processlist_priv_no_prot.result b/mysql-test/suite/funcs_1/r/a_processlist_priv_no_prot.result
new file mode 100644
index 00000000000..13055b5543b
--- /dev/null
+++ b/mysql-test/suite/funcs_1/r/a_processlist_priv_no_prot.result
@@ -0,0 +1,471 @@
+USE information_schema;
+####################################################################################
+1 Prepare test.
+connection default (user=root)
+####################################################################################
+####################################################################################
+1.1 Create two user
+####################################################################################
+DROP USER ddicttestuser1@'localhost';
+ERROR HY000: Operation DROP USER failed for 'ddicttestuser1'@'localhost'
+DROP USER ddicttestuser2@'localhost';
+ERROR HY000: Operation DROP USER failed for 'ddicttestuser2'@'localhost'
+CREATE USER ddicttestuser1@'localhost';
+CREATE USER ddicttestuser2@'localhost';
+SET PASSWORD FOR ddicttestuser1@'localhost' = PASSWORD('ddictpass');
+SET PASSWORD FOR ddicttestuser2@'localhost' = PASSWORD('ddictpass');
+####################################################################################
+1.2 Establish connection con100 (user=ddicttestuser1 with no PROCESS privilege):
+####################################################################################
+####################################################################################
+2 connection default(user=root with default privileges):
+SHOW/SELECT shows all processes/threads.
+####################################################################################
+SHOW CREATE TABLE processlist;
+Table Create Table
+PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
+ `ID` bigint(4) NOT NULL DEFAULT '0',
+ `USER` varchar(16) NOT NULL DEFAULT '',
+ `HOST` varchar(64) NOT NULL DEFAULT '',
+ `DB` varchar(64) DEFAULT NULL,
+ `COMMAND` varchar(16) NOT NULL DEFAULT '',
+ `TIME` bigint(7) NOT NULL DEFAULT '0',
+ `STATE` varchar(64) DEFAULT NULL,
+ `INFO` longtext
+) ENGINE=MyISAM DEFAULT CHARSET=utf8
+SHOW processlist;
+Id User Host db Command Time State Info
+1 root localhost information_schema Query TIME NULL SHOW processlist
+2 ddicttestuser1 localhost information_schema Sleep TIME NULL
+SELECT * FROM processlist ORDER BY id;
+ID USER HOST DB COMMAND TIME STATE INFO
+1 root localhost information_schema Query TIME preparing SELECT * FROM processlist ORDER BY id
+2 ddicttestuser1 localhost information_schema Sleep TIME NULL
+SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO FROM processlist ORDER BY id;
+ID USER HOST DB COMMAND TIME STATE INFO
+1 root localhost information_schema Query TIME preparing SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO FROM processlist ORDER BY id
+2 ddicttestuser1 localhost information_schema Sleep TIME NULL
+CREATE TEMPORARY TABLE test.t_processlist AS SELECT * FROM processlist;
+UPDATE test.t_processlist SET user='horst' WHERE id=1 ;
+INSERT INTO processlist SELECT * FROM test.t_processlist;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+DROP TABLE test.t_processlist;
+CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO) AS SELECT * FROM processlist WITH CHECK OPTION;
+ERROR HY000: CHECK OPTION on non-updatable view 'test.v_processlist'
+CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO) AS SELECT * FROM processlist;
+UPDATE test.v_processlist SET TIME=NOW() WHERE id = 1;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+DROP VIEW test.v_processlist;
+UPDATE processlist SET user='any_user' WHERE id=1 ;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+DELETE FROM processlist WHERE id=1 ;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+REVOKE ALL ON processlist FROM current_user;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+GRANT INSERT,UPDATE ON processlist TO current_user;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+SHOW GRANTS;
+Grants for root@localhost
+GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+CREATE INDEX i_processlist ON processlist (user);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+DROP TABLE processlist;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+ALTER TABLE processlist DROP COLUMN user;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+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
+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
+DROP DATABASE information_schema;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+RENAME DATABASE information_schema TO info_schema;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+####################################################################################
+3 Switch to connection con100 (user=ddicttestuser1 with no PROCESS privilege):
+SHOW/SELECT shows only the processes (1) of the user.
+####################################################################################
+SHOW CREATE TABLE processlist;
+Table Create Table
+PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
+ `ID` bigint(4) NOT NULL DEFAULT '0',
+ `USER` varchar(16) NOT NULL DEFAULT '',
+ `HOST` varchar(64) NOT NULL DEFAULT '',
+ `DB` varchar(64) DEFAULT NULL,
+ `COMMAND` varchar(16) NOT NULL DEFAULT '',
+ `TIME` bigint(7) NOT NULL DEFAULT '0',
+ `STATE` varchar(64) DEFAULT NULL,
+ `INFO` longtext
+) ENGINE=MyISAM DEFAULT CHARSET=utf8
+SHOW processlist;
+Id User Host db Command Time State Info
+2 ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist
+SELECT * FROM processlist ORDER BY id;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 ddicttestuser1 localhost information_schema Query TIME preparing SELECT * FROM processlist ORDER BY id
+SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO FROM processlist ORDER BY id;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 ddicttestuser1 localhost information_schema Query TIME preparing SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO FROM processlist ORDER BY id
+CREATE TEMPORARY TABLE test.t_processlist AS SELECT * FROM processlist;
+UPDATE test.t_processlist SET user='horst' WHERE id=1 ;
+INSERT INTO processlist SELECT * FROM test.t_processlist;
+ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
+DROP TABLE test.t_processlist;
+CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO) AS SELECT * FROM processlist WITH CHECK OPTION;
+ERROR HY000: CHECK OPTION on non-updatable view 'test.v_processlist'
+CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO) AS SELECT * FROM processlist;
+UPDATE test.v_processlist SET TIME=NOW() WHERE id = 1;
+ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
+DROP VIEW test.v_processlist;
+UPDATE processlist SET user='any_user' WHERE id=1 ;
+ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
+DELETE FROM processlist WHERE id=1 ;
+ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
+REVOKE ALL ON processlist FROM current_user;
+ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
+GRANT INSERT,UPDATE ON processlist TO current_user;
+ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
+SHOW GRANTS;
+Grants for ddicttestuser1@localhost
+GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+CREATE INDEX i_processlist ON processlist (user);
+ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
+DROP TABLE processlist;
+ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
+ALTER TABLE processlist DROP COLUMN user;
+ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
+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
+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
+DROP DATABASE information_schema;
+ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
+RENAME DATABASE information_schema TO info_schema;
+ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
+####################################################################################
+4 Grant PROCESS privilege to ddicttestuser1
+connection default (user=root)
+####################################################################################
+GRANT PROCESS ON *.* TO ddicttestuser1@'localhost' IDENTIFIED BY 'ddictpass';
+####################################################################################
+4.1 Existing connection con100 (ddicttestuser1)
+The user ddicttestuser1 has the PROCESS privilege, but the connection was
+established before PROCESS was granted.
+SHOW/SELECT shows only the processes (1) of the user.
+####################################################################################
+SHOW GRANTS;
+Grants for ddicttestuser1@localhost
+GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+SHOW processlist;
+Id User Host db Command Time State Info
+2 ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist
+SELECT * FROM information_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 ddicttestuser1 localhost information_schema Query TIME preparing SELECT * FROM information_schema.processlist
+####################################################################################
+4.2 New connection con101 (ddicttestuser1 with PROCESS privilege)
+SHOW/SELECT shows all processes/threads.
+####################################################################################
+SHOW GRANTS;
+Grants for ddicttestuser1@localhost
+GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+SHOW processlist;
+Id User Host db Command Time State Info
+1 root localhost information_schema Sleep TIME NULL
+2 ddicttestuser1 localhost information_schema Sleep TIME NULL
+3 ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist
+SELECT * FROM information_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+3 ddicttestuser1 localhost information_schema Query TIME preparing SELECT * FROM information_schema.processlist
+2 ddicttestuser1 localhost information_schema Sleep TIME NULL
+1 root localhost information_schema Sleep TIME NULL
+####################################################################################
+5 Grant PROCESS privilege to anonymous user.
+connection default (user=root)
+####################################################################################
+GRANT PROCESS ON *.* TO ''@'localhost';
+####################################################################################
+5.1 Establish connection (anonymous1,localhost,'',,information_schema)
+anonymous user with PROCESS privilege
+SHOW/SELECT shows all processes/threads.
+####################################################################################
+SHOW GRANTS;
+Grants for @localhost
+GRANT PROCESS ON *.* TO ''@'localhost'
+SHOW processlist;
+Id User Host db Command Time State Info
+1 root localhost information_schema Sleep TIME NULL
+2 ddicttestuser1 localhost information_schema Sleep TIME NULL
+3 ddicttestuser1 localhost information_schema Sleep TIME NULL
+4 localhost information_schema Query TIME NULL SHOW processlist
+SELECT * FROM information_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+4 localhost information_schema Query TIME preparing SELECT * FROM information_schema.processlist
+3 ddicttestuser1 localhost information_schema Sleep TIME NULL
+2 ddicttestuser1 localhost information_schema Sleep TIME NULL
+1 root localhost information_schema Sleep TIME NULL
+####################################################################################
+6 Revoke PROCESS privilege from ddicttestuser1
+connection default (user=root)
+####################################################################################
+REVOKE PROCESS ON *.* FROM ddicttestuser1@'localhost' IDENTIFIED BY 'ddictpass';
+####################################################################################
+6.1 New connection con102 (ddicttestuser1 has no more PROCESS privilege)
+Again (compared to state before GRANT PROCESS) only the processes of
+ddicttestuser1 are visible.
+####################################################################################
+SHOW GRANTS;
+Grants for ddicttestuser1@localhost
+GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+SHOW processlist;
+Id User Host db Command Time State Info
+2 ddicttestuser1 localhost information_schema Sleep TIME NULL
+3 ddicttestuser1 localhost information_schema Sleep TIME NULL
+5 ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist
+SELECT * FROM information_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+5 ddicttestuser1 localhost information_schema Query TIME preparing SELECT * FROM information_schema.processlist
+3 ddicttestuser1 localhost information_schema Sleep TIME NULL
+2 ddicttestuser1 localhost information_schema Sleep TIME NULL
+####################################################################################
+7 Revoke PROCESS privilege from anonymous user + disconnect ddicttestuser1
+connection default (user=root)
+####################################################################################
+REVOKE PROCESS ON *.* FROM ''@'localhost';
+####################################################################################
+7.1 New connection (anonymous2,localhost,'',,information_schema)
+The anonymous user has no more the PROCESS privilege
+Again only the processes of the anonymous user are visible.
+####################################################################################
+SHOW GRANTS FOR ''@'localhost';
+Grants for @localhost
+GRANT USAGE ON *.* TO ''@'localhost'
+SELECT * FROM information_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+6 localhost information_schema Query TIME preparing SELECT * FROM information_schema.processlist
+4 localhost information_schema Sleep TIME NULL
+####################################################################################
+8 Grant SUPER (does not imply PROCESS) privilege to ddicttestuser1
+connection default (user=root)
+####################################################################################
+GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost';
+####################################################################################
+8.1 New connection con103 (ddicttestuser1 with SUPER privilege)
+Only the processes of ddicttestuser1 user are visible.
+####################################################################################
+SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
+Grants for ddicttestuser1@localhost
+GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+SHOW processlist;
+Id User Host db Command Time State Info
+2 ddicttestuser1 localhost information_schema Sleep TIME NULL
+3 ddicttestuser1 localhost information_schema Sleep TIME NULL
+5 ddicttestuser1 localhost information_schema Sleep TIME NULL
+7 ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist
+SELECT * FROM information_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+7 ddicttestuser1 localhost information_schema Query TIME preparing SELECT * FROM information_schema.processlist
+5 ddicttestuser1 localhost information_schema Sleep TIME NULL
+3 ddicttestuser1 localhost information_schema Sleep TIME NULL
+2 ddicttestuser1 localhost information_schema Sleep TIME NULL
+####################################################################################
+9 Revoke SUPER privilege from user ddicttestuser1
+connection default (user=root)
+####################################################################################
+REVOKE SUPER ON *.* FROM 'ddicttestuser1'@'localhost';
+####################################################################################
+9.1 New connection con104 (ddicttestuser1 without SUPER privilege)
+ddicttestuser1 has no more the SUPER privilege.
+Only the processes of ddicttestuser1 are visible.
+####################################################################################
+SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
+Grants for ddicttestuser1@localhost
+GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+SHOW processlist;
+Id User Host db Command Time State Info
+2 ddicttestuser1 localhost information_schema Sleep TIME NULL
+3 ddicttestuser1 localhost information_schema Sleep TIME NULL
+5 ddicttestuser1 localhost information_schema Sleep TIME NULL
+7 ddicttestuser1 localhost information_schema Sleep TIME NULL
+8 ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist
+SELECT * FROM information_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+8 ddicttestuser1 localhost information_schema Query TIME preparing SELECT * FROM information_schema.processlist
+7 ddicttestuser1 localhost information_schema Sleep TIME NULL
+5 ddicttestuser1 localhost information_schema Sleep TIME NULL
+3 ddicttestuser1 localhost information_schema Sleep TIME NULL
+2 ddicttestuser1 localhost information_schema Sleep TIME NULL
+####################################################################################
+10 Grant SUPER privilege with grant option to user ddicttestuser1.
+connection default (user=root)
+####################################################################################
+GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost' WITH GRANT OPTION;
+####################################################################################
+10.1 New connection con105 (ddicttestuser1 with SUPER privilege and GRANT OPTION)
+Try to grant PROCESS privilege to user ddicttestuser2 without having it.
+####################################################################################
+SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
+Grants for ddicttestuser1@localhost
+GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' WITH GRANT OPTION
+GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
+ERROR 28000: Access denied for user 'ddicttestuser1'@'localhost' (using password: YES)
+####################################################################################
+10.2 Grant SUPER and PROCESS privilege with grant option to user ddicttestuser1
+connection default (user=root)
+####################################################################################
+GRANT SUPER,PROCESS ON *.* TO 'ddicttestuser1'@'localhost' WITH GRANT OPTION;
+####################################################################################
+10.3 New connection con106 (ddicttestuser1 with SUPER,PROCESS WITH GRANT OPTION)
+Grant PROCESS privilege to user ddicttestuser2
+####################################################################################
+SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
+Grants for ddicttestuser1@localhost
+GRANT PROCESS, SUPER ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' WITH GRANT OPTION
+GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
+####################################################################################
+10.4 New connection con200 (ddicttestuser2 with PROCESS privilege)
+ddicttestuser2 has now the PROCESS privilege and sees all connections
+####################################################################################
+SHOW GRANTS FOR 'ddicttestuser2'@'localhost';
+Grants for ddicttestuser2@localhost
+GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+SHOW processlist;
+Id User Host db Command Time State Info
+1 root localhost information_schema Sleep TIME NULL
+2 ddicttestuser1 localhost information_schema Sleep TIME NULL
+3 ddicttestuser1 localhost information_schema Sleep TIME NULL
+4 localhost information_schema Sleep TIME NULL
+5 ddicttestuser1 localhost information_schema Sleep TIME NULL
+6 localhost information_schema Sleep TIME NULL
+7 ddicttestuser1 localhost information_schema Sleep TIME NULL
+8 ddicttestuser1 localhost information_schema Sleep TIME NULL
+9 ddicttestuser1 localhost information_schema Sleep TIME NULL
+10 ddicttestuser1 localhost information_schema Sleep TIME NULL
+11 ddicttestuser2 localhost information_schema Query TIME NULL SHOW processlist
+SELECT * FROM information_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+11 ddicttestuser2 localhost information_schema Query TIME preparing SELECT * FROM information_schema.processlist
+10 ddicttestuser1 localhost information_schema Sleep TIME NULL
+9 ddicttestuser1 localhost information_schema Sleep TIME NULL
+8 ddicttestuser1 localhost information_schema Sleep TIME NULL
+7 ddicttestuser1 localhost information_schema Sleep TIME NULL
+6 localhost information_schema Sleep TIME NULL
+5 ddicttestuser1 localhost information_schema Sleep TIME NULL
+4 localhost information_schema Sleep TIME NULL
+3 ddicttestuser1 localhost information_schema Sleep TIME NULL
+2 ddicttestuser1 localhost information_schema Sleep TIME NULL
+1 root localhost information_schema Sleep TIME NULL
+####################################################################################
+11 User ddicttestuser1 revokes PROCESS privilege from user ddicttestuser2
+connection ddicttestuser1;
+####################################################################################
+REVOKE PROCESS ON *.* FROM 'ddicttestuser2'@'localhost';
+####################################################################################
+11.1 New connection con201 (ddicttestuser2)
+ddicttestuser2 has no more the PROCESS privilege and can only see own connects
+####################################################################################
+SHOW GRANTS;
+Grants for ddicttestuser2@localhost
+GRANT USAGE ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+SHOW processlist;
+Id User Host db Command Time State Info
+11 ddicttestuser2 localhost information_schema Sleep TIME NULL
+12 ddicttestuser2 localhost information_schema Query TIME NULL SHOW processlist
+SELECT * FROM information_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+12 ddicttestuser2 localhost information_schema Query TIME preparing SELECT * FROM information_schema.processlist
+11 ddicttestuser2 localhost information_schema Sleep TIME NULL
+####################################################################################
+11.2 Revoke SUPER,PROCESS,GRANT OPTION privilege from user ddicttestuser1
+connection default (user=root)
+####################################################################################
+REVOKE SUPER,PROCESS,GRANT OPTION ON *.* FROM 'ddicttestuser1'@'localhost';
+####################################################################################
+11.3 New connection con107 (ddicttestuser1)
+ddicttestuser1 has no more the PROCESS privilege and can only see own connects
+He is also unable to GRANT the PROCESS privilege to ddicttestuser2
+####################################################################################
+SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
+Grants for ddicttestuser1@localhost
+GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
+ERROR 28000: Access denied for user 'ddicttestuser1'@'localhost' (using password: YES)
+SHOW processlist;
+Id User Host db Command Time State Info
+2 ddicttestuser1 localhost information_schema Sleep TIME NULL
+3 ddicttestuser1 localhost information_schema Sleep TIME NULL
+5 ddicttestuser1 localhost information_schema Sleep TIME NULL
+7 ddicttestuser1 localhost information_schema Sleep TIME NULL
+8 ddicttestuser1 localhost information_schema Sleep TIME NULL
+9 ddicttestuser1 localhost information_schema Sleep TIME NULL
+10 ddicttestuser1 localhost information_schema Sleep TIME NULL
+13 ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist
+SELECT * FROM information_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+13 ddicttestuser1 localhost information_schema Query TIME preparing SELECT * FROM information_schema.processlist
+10 ddicttestuser1 localhost information_schema Sleep TIME NULL
+9 ddicttestuser1 localhost information_schema Sleep TIME NULL
+8 ddicttestuser1 localhost information_schema Sleep TIME NULL
+7 ddicttestuser1 localhost information_schema Sleep TIME NULL
+5 ddicttestuser1 localhost information_schema Sleep TIME NULL
+3 ddicttestuser1 localhost information_schema Sleep TIME NULL
+2 ddicttestuser1 localhost information_schema Sleep TIME NULL
+####################################################################################
+12 Revoke the SELECT privilege from user ddicttestuser1
+connection default (user=root)
+####################################################################################
+REVOKE SELECT ON *.* FROM 'ddicttestuser1'@'localhost';
+####################################################################################
+12.1 New connection con108 (ddicttestuser1)
+ddicttestuser1 has neither PROCESS nor SELECT privilege
+Manual says: Each MySQL user has the right to access these tables, but can see
+only the rows ...
+Therefore the missing SELECT privilege does not affect SELECTs on PROCESSLIST.
+####################################################################################
+SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
+Grants for ddicttestuser1@localhost
+GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+SHOW processlist;
+Id User Host db Command Time State Info
+2 ddicttestuser1 localhost information_schema Sleep TIME NULL
+3 ddicttestuser1 localhost information_schema Sleep TIME NULL
+5 ddicttestuser1 localhost information_schema Sleep TIME NULL
+7 ddicttestuser1 localhost information_schema Sleep TIME NULL
+8 ddicttestuser1 localhost information_schema Sleep TIME NULL
+9 ddicttestuser1 localhost information_schema Sleep TIME NULL
+10 ddicttestuser1 localhost information_schema Sleep TIME NULL
+13 ddicttestuser1 localhost information_schema Sleep TIME NULL
+14 ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist
+SELECT * FROM information_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+14 ddicttestuser1 localhost information_schema Query TIME preparing SELECT * FROM information_schema.processlist
+13 ddicttestuser1 localhost information_schema Sleep TIME NULL
+10 ddicttestuser1 localhost information_schema Sleep TIME NULL
+9 ddicttestuser1 localhost information_schema Sleep TIME NULL
+8 ddicttestuser1 localhost information_schema Sleep TIME NULL
+7 ddicttestuser1 localhost information_schema Sleep TIME NULL
+5 ddicttestuser1 localhost information_schema Sleep TIME NULL
+3 ddicttestuser1 localhost information_schema Sleep TIME NULL
+2 ddicttestuser1 localhost information_schema Sleep TIME NULL
+####################################################################################
+12.2 Revoke only the SELECT privilege on the information_schema from ddicttestuser1.
+connection default (user=root)
+####################################################################################
+REVOKE SELECT ON information_schema.* FROM 'ddicttestuser3'@'localhost';
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+####################################################################################
+connection default (user=root)
+Cleanup: close connections, DROP USER etc.
+####################################################################################
+DROP USER ddicttestuser1@'localhost';
+DROP USER ddicttestuser2@'localhost';
+REVOKE USAGE ON *.* FROM ''@'localhost';
+DROP USER ''@'localhost';
diff --git a/mysql-test/suite/funcs_1/r/a_processlist_val_no_prot.result b/mysql-test/suite/funcs_1/r/a_processlist_val_no_prot.result
new file mode 100644
index 00000000000..9a7c9805b66
--- /dev/null
+++ b/mysql-test/suite/funcs_1/r/a_processlist_val_no_prot.result
@@ -0,0 +1,174 @@
+DROP USER ddicttestuser1@'localhost';
+ERROR HY000: Operation DROP USER failed for 'ddicttestuser1'@'localhost'
+CREATE USER ddicttestuser1@'localhost';
+GRANT ALL ON *.* TO ddicttestuser1@'localhost';
+REVOKE PROCESS ON *.* FROM ddicttestuser1@'localhost';
+SET PASSWORD FOR ddicttestuser1@'localhost' = PASSWORD('ddictpass');
+DROP TABLE IF EXISTS test.t1;
+CREATE TABLE test.t1 (f1 BIGINT);
+SHOW CREATE TABLE INFORMATION_SCHEMA.PROCESSLIST;
+Table Create Table
+PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
+ `ID` bigint(4) NOT NULL DEFAULT '0',
+ `USER` varchar(16) NOT NULL DEFAULT '',
+ `HOST` varchar(64) NOT NULL DEFAULT '',
+ `DB` varchar(64) DEFAULT NULL,
+ `COMMAND` varchar(16) NOT NULL DEFAULT '',
+ `TIME` bigint(7) NOT NULL DEFAULT '0',
+ `STATE` varchar(64) DEFAULT NULL,
+ `INFO` longtext
+) ENGINE=MyISAM DEFAULT CHARSET=utf8
+SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST;
+COUNT(*)
+1
+USE test;
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+<ID> root localhost test Query 0 preparing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<ID> root localhost test Query 0 NULL SHOW FULL PROCESSLIST
+USE information_schema;
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+<ID> root localhost information_schema Query <TIME> preparing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<ID> root localhost information_schema Query <TIME> NULL SHOW FULL PROCESSLIST
+SELECT INFO FROM INFORMATION_SCHEMA.PROCESSLIST;
+INFO
+SELECT INFO FROM INFORMATION_SCHEMA.PROCESSLIST
+SELECT ID INTO @my_proclist_id FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+----- establish connection ddicttestuser1 (user = ddicttestuser1) -----
+
+----- switch to connection default (user = root) -----
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+<ID> ddicttestuser1 localhost information_schema Sleep 0 NULL
+<ID> root localhost information_schema Query 0 preparing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<ID> root localhost information_schema Query 0 NULL SHOW FULL PROCESSLIST
+<ID> ddicttestuser1 localhost information_schema Sleep 0 NULL
+# Sleep some time
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+<ID> ddicttestuser1 localhost information_schema Sleep 1 NULL
+<ID> root localhost information_schema Query 0 preparing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<ID> root localhost information_schema Query 0 NULL SHOW FULL PROCESSLIST
+<ID> ddicttestuser1 localhost information_schema Sleep 1 NULL
+SELECT ID = @my_proclist_id + 1 FROM INFORMATION_SCHEMA.PROCESSLIST
+WHERE USER = 'ddicttestuser1';
+ID = @my_proclist_id + 1
+1
+
+----- switch to connection ddicttestuser1 (user = ddicttestuser1) -----
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+<ID> ddicttestuser1 localhost information_schema Query <TIME> preparing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<ID> ddicttestuser1 localhost information_schema Query <TIME> NULL SHOW FULL PROCESSLIST
+
+----- establish connection con2 (user = ddicttestuser1) ------
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+<ID> ddicttestuser1 localhost information_schema Query <TIME> preparing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+<ID> ddicttestuser1 localhost information_schema Sleep <TIME> NULL
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<ID> ddicttestuser1 localhost information_schema Sleep <TIME> NULL
+<ID> ddicttestuser1 localhost information_schema Query <TIME> NULL SHOW FULL PROCESSLIST
+
+----- switch to connection default (user = root) -----
+----- close connection con2 -----
+
+----- switch to connection ddicttestuser1 (user = ddicttestuser1) -----
+
+
+# Send a long enough running statement to the server, but do not
+# wait till the result comes back. We will pull this later.
+SELECT sleep(2.5),'Command time';
+
+----- switch to connection default (user = root) -----
+# Sleep some time
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+<ID> ddicttestuser1 localhost information_schema Query 1 init SELECT sleep(2.5),'Command time'
+<ID> root localhost information_schema Query 0 preparing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<ID> root localhost information_schema Query 0 NULL SHOW FULL PROCESSLIST
+<ID> ddicttestuser1 localhost information_schema Query 1 init SELECT sleep(2.5),'Command time'
+# Sleep some time
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+<ID> ddicttestuser1 localhost information_schema Query 2 init SELECT sleep(2.5),'Command time'
+<ID> root localhost information_schema Query 0 preparing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<ID> root localhost information_schema Query 0 NULL SHOW FULL PROCESSLIST
+<ID> ddicttestuser1 localhost information_schema Query 2 init SELECT sleep(2.5),'Command time'
+
+----- switch to connection ddicttestuser1 (user = ddicttestuser1) -----
+# Pull("reap") the result set from the statement executed with "send".
+sleep(2.5) Command time
+0 Command time
+
+
+# Send a long (21 KB code and runtime = 2 seconds) statement to the server,
+# but do not wait till the result comes back. We will pull this later.
+SELECT sleep(2),'BEGIN this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.END' AS "my_monster_statement";
+
+----- switch to connection default (user = root) -----
+# Sleep some time
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+<ID> ddicttestuser1 localhost information_schema Query <TIME> init SELECT sleep(2),'BEGIN this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.END' AS "my_monster_statement"
+<ID> root localhost information_schema Query <TIME> preparing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<ID> root localhost information_schema Query <TIME> NULL SHOW FULL PROCESSLIST
+<ID> ddicttestuser1 localhost information_schema Query <TIME> init SELECT sleep(2),'BEGIN this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.END' AS "my_monster_statement"
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+<ID> root localhost information_schema Query <TIME> NULL SHOW PROCESSLIST
+<ID> ddicttestuser1 localhost information_schema Query <TIME> init SELECT sleep(2),'BEGIN this is the representative of a very long statement.this is the representativ
+
+----- switch to connection ddicttestuser1 (user = ddicttestuser1) -----
+# Pull("reap") the result set from the monster statement executed with "send".
+sleep(2) my_monster_statement
+0 BEGIN this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.END
+
+----- switch to connection default (user = root) -----
+LOCK TABLE test.t1 WRITE;
+
+----- switch to connection ddicttestuser1 (user = ddicttestuser1) -----
+# Send a statement to the server, but do not wait till the result
+# comes back. We will pull this later.
+SELECT COUNT(*) FROM test.t1;
+
+----- switch to connection default (user = root) -----
+# Sleep some time
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+<ID> ddicttestuser1 localhost information_schema Query <TIME> Locked SELECT COUNT(*) FROM test.t1
+<ID> root localhost information_schema Query <TIME> preparing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<ID> root localhost information_schema Query <TIME> NULL SHOW FULL PROCESSLIST
+<ID> ddicttestuser1 localhost information_schema Query <TIME> Locked SELECT COUNT(*) FROM test.t1
+UNLOCK TABLES;
+
+----- switch to connection ddicttestuser1 (user = ddicttestuser1) -----
+# Pull("reap") the result set from the statement executed with "send".
+COUNT(*)
+0
+
+----- switch to connection default (user = root) -----
+
+----- close connection ddicttestuser1 -----
+DROP USER ddicttestuser1@'localhost';
diff --git a/mysql-test/suite/funcs_1/r/b_processlist_priv_ps.result b/mysql-test/suite/funcs_1/r/b_processlist_priv_ps.result
new file mode 100644
index 00000000000..b10a6c1a5d2
--- /dev/null
+++ b/mysql-test/suite/funcs_1/r/b_processlist_priv_ps.result
@@ -0,0 +1,471 @@
+USE information_schema;
+####################################################################################
+1 Prepare test.
+connection default (user=root)
+####################################################################################
+####################################################################################
+1.1 Create two user
+####################################################################################
+DROP USER ddicttestuser1@'localhost';
+ERROR HY000: Operation DROP USER failed for 'ddicttestuser1'@'localhost'
+DROP USER ddicttestuser2@'localhost';
+ERROR HY000: Operation DROP USER failed for 'ddicttestuser2'@'localhost'
+CREATE USER ddicttestuser1@'localhost';
+CREATE USER ddicttestuser2@'localhost';
+SET PASSWORD FOR ddicttestuser1@'localhost' = PASSWORD('ddictpass');
+SET PASSWORD FOR ddicttestuser2@'localhost' = PASSWORD('ddictpass');
+####################################################################################
+1.2 Establish connection con100 (user=ddicttestuser1 with no PROCESS privilege):
+####################################################################################
+####################################################################################
+2 connection default(user=root with default privileges):
+SHOW/SELECT shows all processes/threads.
+####################################################################################
+SHOW CREATE TABLE processlist;
+Table Create Table
+PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
+ `ID` bigint(4) NOT NULL DEFAULT '0',
+ `USER` varchar(16) NOT NULL DEFAULT '',
+ `HOST` varchar(64) NOT NULL DEFAULT '',
+ `DB` varchar(64) DEFAULT NULL,
+ `COMMAND` varchar(16) NOT NULL DEFAULT '',
+ `TIME` bigint(7) NOT NULL DEFAULT '0',
+ `STATE` varchar(64) DEFAULT NULL,
+ `INFO` longtext
+) ENGINE=MyISAM DEFAULT CHARSET=utf8
+SHOW processlist;
+Id User Host db Command Time State Info
+3 root localhost information_schema Query TIME NULL SHOW processlist
+4 ddicttestuser1 localhost information_schema Sleep TIME NULL
+SELECT * FROM processlist ORDER BY id;
+ID USER HOST DB COMMAND TIME STATE INFO
+3 root localhost information_schema Execute TIME preparing SELECT * FROM processlist ORDER BY id
+4 ddicttestuser1 localhost information_schema Sleep TIME NULL
+SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO FROM processlist ORDER BY id;
+ID USER HOST DB COMMAND TIME STATE INFO
+3 root localhost information_schema Execute TIME preparing SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO FROM processlist ORDER BY id
+4 ddicttestuser1 localhost information_schema Sleep TIME NULL
+CREATE TEMPORARY TABLE test.t_processlist AS SELECT * FROM processlist;
+UPDATE test.t_processlist SET user='horst' WHERE id=1 ;
+INSERT INTO processlist SELECT * FROM test.t_processlist;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+DROP TABLE test.t_processlist;
+CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO) AS SELECT * FROM processlist WITH CHECK OPTION;
+ERROR HY000: CHECK OPTION on non-updatable view 'test.v_processlist'
+CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO) AS SELECT * FROM processlist;
+UPDATE test.v_processlist SET TIME=NOW() WHERE id = 1;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+DROP VIEW test.v_processlist;
+UPDATE processlist SET user='any_user' WHERE id=1 ;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+DELETE FROM processlist WHERE id=1 ;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+REVOKE ALL ON processlist FROM current_user;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+GRANT INSERT,UPDATE ON processlist TO current_user;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+SHOW GRANTS;
+Grants for root@localhost
+GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+CREATE INDEX i_processlist ON processlist (user);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+DROP TABLE processlist;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+ALTER TABLE processlist DROP COLUMN user;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+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
+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
+DROP DATABASE information_schema;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+RENAME DATABASE information_schema TO info_schema;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+####################################################################################
+3 Switch to connection con100 (user=ddicttestuser1 with no PROCESS privilege):
+SHOW/SELECT shows only the processes (1) of the user.
+####################################################################################
+SHOW CREATE TABLE processlist;
+Table Create Table
+PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
+ `ID` bigint(4) NOT NULL DEFAULT '0',
+ `USER` varchar(16) NOT NULL DEFAULT '',
+ `HOST` varchar(64) NOT NULL DEFAULT '',
+ `DB` varchar(64) DEFAULT NULL,
+ `COMMAND` varchar(16) NOT NULL DEFAULT '',
+ `TIME` bigint(7) NOT NULL DEFAULT '0',
+ `STATE` varchar(64) DEFAULT NULL,
+ `INFO` longtext
+) ENGINE=MyISAM DEFAULT CHARSET=utf8
+SHOW processlist;
+Id User Host db Command Time State Info
+4 ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist
+SELECT * FROM processlist ORDER BY id;
+ID USER HOST DB COMMAND TIME STATE INFO
+4 ddicttestuser1 localhost information_schema Execute TIME preparing SELECT * FROM processlist ORDER BY id
+SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO FROM processlist ORDER BY id;
+ID USER HOST DB COMMAND TIME STATE INFO
+4 ddicttestuser1 localhost information_schema Execute TIME preparing SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO FROM processlist ORDER BY id
+CREATE TEMPORARY TABLE test.t_processlist AS SELECT * FROM processlist;
+UPDATE test.t_processlist SET user='horst' WHERE id=1 ;
+INSERT INTO processlist SELECT * FROM test.t_processlist;
+ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
+DROP TABLE test.t_processlist;
+CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO) AS SELECT * FROM processlist WITH CHECK OPTION;
+ERROR HY000: CHECK OPTION on non-updatable view 'test.v_processlist'
+CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO) AS SELECT * FROM processlist;
+UPDATE test.v_processlist SET TIME=NOW() WHERE id = 1;
+ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
+DROP VIEW test.v_processlist;
+UPDATE processlist SET user='any_user' WHERE id=1 ;
+ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
+DELETE FROM processlist WHERE id=1 ;
+ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
+REVOKE ALL ON processlist FROM current_user;
+ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
+GRANT INSERT,UPDATE ON processlist TO current_user;
+ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
+SHOW GRANTS;
+Grants for ddicttestuser1@localhost
+GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+CREATE INDEX i_processlist ON processlist (user);
+ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
+DROP TABLE processlist;
+ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
+ALTER TABLE processlist DROP COLUMN user;
+ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
+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
+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
+DROP DATABASE information_schema;
+ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
+RENAME DATABASE information_schema TO info_schema;
+ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema'
+####################################################################################
+4 Grant PROCESS privilege to ddicttestuser1
+connection default (user=root)
+####################################################################################
+GRANT PROCESS ON *.* TO ddicttestuser1@'localhost' IDENTIFIED BY 'ddictpass';
+####################################################################################
+4.1 Existing connection con100 (ddicttestuser1)
+The user ddicttestuser1 has the PROCESS privilege, but the connection was
+established before PROCESS was granted.
+SHOW/SELECT shows only the processes (1) of the user.
+####################################################################################
+SHOW GRANTS;
+Grants for ddicttestuser1@localhost
+GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+SHOW processlist;
+Id User Host db Command Time State Info
+4 ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist
+SELECT * FROM information_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+4 ddicttestuser1 localhost information_schema Execute TIME preparing SELECT * FROM information_schema.processlist
+####################################################################################
+4.2 New connection con101 (ddicttestuser1 with PROCESS privilege)
+SHOW/SELECT shows all processes/threads.
+####################################################################################
+SHOW GRANTS;
+Grants for ddicttestuser1@localhost
+GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+SHOW processlist;
+Id User Host db Command Time State Info
+3 root localhost information_schema Sleep TIME NULL
+4 ddicttestuser1 localhost information_schema Sleep TIME NULL
+5 ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist
+SELECT * FROM information_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+5 ddicttestuser1 localhost information_schema Execute TIME preparing SELECT * FROM information_schema.processlist
+4 ddicttestuser1 localhost information_schema Sleep TIME NULL
+3 root localhost information_schema Sleep TIME NULL
+####################################################################################
+5 Grant PROCESS privilege to anonymous user.
+connection default (user=root)
+####################################################################################
+GRANT PROCESS ON *.* TO ''@'localhost';
+####################################################################################
+5.1 Establish connection (anonymous1,localhost,'',,information_schema)
+anonymous user with PROCESS privilege
+SHOW/SELECT shows all processes/threads.
+####################################################################################
+SHOW GRANTS;
+Grants for @localhost
+GRANT PROCESS ON *.* TO ''@'localhost'
+SHOW processlist;
+Id User Host db Command Time State Info
+3 root localhost information_schema Sleep TIME NULL
+4 ddicttestuser1 localhost information_schema Sleep TIME NULL
+5 ddicttestuser1 localhost information_schema Sleep TIME NULL
+6 localhost information_schema Query TIME NULL SHOW processlist
+SELECT * FROM information_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+6 localhost information_schema Execute TIME preparing SELECT * FROM information_schema.processlist
+5 ddicttestuser1 localhost information_schema Sleep TIME NULL
+4 ddicttestuser1 localhost information_schema Sleep TIME NULL
+3 root localhost information_schema Sleep TIME NULL
+####################################################################################
+6 Revoke PROCESS privilege from ddicttestuser1
+connection default (user=root)
+####################################################################################
+REVOKE PROCESS ON *.* FROM ddicttestuser1@'localhost' IDENTIFIED BY 'ddictpass';
+####################################################################################
+6.1 New connection con102 (ddicttestuser1 has no more PROCESS privilege)
+Again (compared to state before GRANT PROCESS) only the processes of
+ddicttestuser1 are visible.
+####################################################################################
+SHOW GRANTS;
+Grants for ddicttestuser1@localhost
+GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+SHOW processlist;
+Id User Host db Command Time State Info
+4 ddicttestuser1 localhost information_schema Sleep TIME NULL
+5 ddicttestuser1 localhost information_schema Sleep TIME NULL
+7 ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist
+SELECT * FROM information_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+7 ddicttestuser1 localhost information_schema Execute TIME preparing SELECT * FROM information_schema.processlist
+5 ddicttestuser1 localhost information_schema Sleep TIME NULL
+4 ddicttestuser1 localhost information_schema Sleep TIME NULL
+####################################################################################
+7 Revoke PROCESS privilege from anonymous user + disconnect ddicttestuser1
+connection default (user=root)
+####################################################################################
+REVOKE PROCESS ON *.* FROM ''@'localhost';
+####################################################################################
+7.1 New connection (anonymous2,localhost,'',,information_schema)
+The anonymous user has no more the PROCESS privilege
+Again only the processes of the anonymous user are visible.
+####################################################################################
+SHOW GRANTS FOR ''@'localhost';
+Grants for @localhost
+GRANT USAGE ON *.* TO ''@'localhost'
+SELECT * FROM information_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+8 localhost information_schema Execute TIME preparing SELECT * FROM information_schema.processlist
+6 localhost information_schema Sleep TIME NULL
+####################################################################################
+8 Grant SUPER (does not imply PROCESS) privilege to ddicttestuser1
+connection default (user=root)
+####################################################################################
+GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost';
+####################################################################################
+8.1 New connection con103 (ddicttestuser1 with SUPER privilege)
+Only the processes of ddicttestuser1 user are visible.
+####################################################################################
+SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
+Grants for ddicttestuser1@localhost
+GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+SHOW processlist;
+Id User Host db Command Time State Info
+4 ddicttestuser1 localhost information_schema Sleep TIME NULL
+5 ddicttestuser1 localhost information_schema Sleep TIME NULL
+7 ddicttestuser1 localhost information_schema Sleep TIME NULL
+9 ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist
+SELECT * FROM information_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+9 ddicttestuser1 localhost information_schema Execute TIME preparing SELECT * FROM information_schema.processlist
+7 ddicttestuser1 localhost information_schema Sleep TIME NULL
+5 ddicttestuser1 localhost information_schema Sleep TIME NULL
+4 ddicttestuser1 localhost information_schema Sleep TIME NULL
+####################################################################################
+9 Revoke SUPER privilege from user ddicttestuser1
+connection default (user=root)
+####################################################################################
+REVOKE SUPER ON *.* FROM 'ddicttestuser1'@'localhost';
+####################################################################################
+9.1 New connection con104 (ddicttestuser1 without SUPER privilege)
+ddicttestuser1 has no more the SUPER privilege.
+Only the processes of ddicttestuser1 are visible.
+####################################################################################
+SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
+Grants for ddicttestuser1@localhost
+GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+SHOW processlist;
+Id User Host db Command Time State Info
+4 ddicttestuser1 localhost information_schema Sleep TIME NULL
+5 ddicttestuser1 localhost information_schema Sleep TIME NULL
+7 ddicttestuser1 localhost information_schema Sleep TIME NULL
+9 ddicttestuser1 localhost information_schema Sleep TIME NULL
+10 ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist
+SELECT * FROM information_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+10 ddicttestuser1 localhost information_schema Execute TIME preparing SELECT * FROM information_schema.processlist
+9 ddicttestuser1 localhost information_schema Sleep TIME NULL
+7 ddicttestuser1 localhost information_schema Sleep TIME NULL
+5 ddicttestuser1 localhost information_schema Sleep TIME NULL
+4 ddicttestuser1 localhost information_schema Sleep TIME NULL
+####################################################################################
+10 Grant SUPER privilege with grant option to user ddicttestuser1.
+connection default (user=root)
+####################################################################################
+GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost' WITH GRANT OPTION;
+####################################################################################
+10.1 New connection con105 (ddicttestuser1 with SUPER privilege and GRANT OPTION)
+Try to grant PROCESS privilege to user ddicttestuser2 without having it.
+####################################################################################
+SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
+Grants for ddicttestuser1@localhost
+GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' WITH GRANT OPTION
+GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
+ERROR 28000: Access denied for user 'ddicttestuser1'@'localhost' (using password: YES)
+####################################################################################
+10.2 Grant SUPER and PROCESS privilege with grant option to user ddicttestuser1
+connection default (user=root)
+####################################################################################
+GRANT SUPER,PROCESS ON *.* TO 'ddicttestuser1'@'localhost' WITH GRANT OPTION;
+####################################################################################
+10.3 New connection con106 (ddicttestuser1 with SUPER,PROCESS WITH GRANT OPTION)
+Grant PROCESS privilege to user ddicttestuser2
+####################################################################################
+SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
+Grants for ddicttestuser1@localhost
+GRANT PROCESS, SUPER ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' WITH GRANT OPTION
+GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
+####################################################################################
+10.4 New connection con200 (ddicttestuser2 with PROCESS privilege)
+ddicttestuser2 has now the PROCESS privilege and sees all connections
+####################################################################################
+SHOW GRANTS FOR 'ddicttestuser2'@'localhost';
+Grants for ddicttestuser2@localhost
+GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+SHOW processlist;
+Id User Host db Command Time State Info
+3 root localhost information_schema Sleep TIME NULL
+4 ddicttestuser1 localhost information_schema Sleep TIME NULL
+5 ddicttestuser1 localhost information_schema Sleep TIME NULL
+6 localhost information_schema Sleep TIME NULL
+7 ddicttestuser1 localhost information_schema Sleep TIME NULL
+8 localhost information_schema Sleep TIME NULL
+9 ddicttestuser1 localhost information_schema Sleep TIME NULL
+10 ddicttestuser1 localhost information_schema Sleep TIME NULL
+11 ddicttestuser1 localhost information_schema Sleep TIME NULL
+12 ddicttestuser1 localhost information_schema Sleep TIME NULL
+13 ddicttestuser2 localhost information_schema Query TIME NULL SHOW processlist
+SELECT * FROM information_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+13 ddicttestuser2 localhost information_schema Execute TIME preparing SELECT * FROM information_schema.processlist
+12 ddicttestuser1 localhost information_schema Sleep TIME NULL
+11 ddicttestuser1 localhost information_schema Sleep TIME NULL
+10 ddicttestuser1 localhost information_schema Sleep TIME NULL
+9 ddicttestuser1 localhost information_schema Sleep TIME NULL
+8 localhost information_schema Sleep TIME NULL
+7 ddicttestuser1 localhost information_schema Sleep TIME NULL
+6 localhost information_schema Sleep TIME NULL
+5 ddicttestuser1 localhost information_schema Sleep TIME NULL
+4 ddicttestuser1 localhost information_schema Sleep TIME NULL
+3 root localhost information_schema Sleep TIME NULL
+####################################################################################
+11 User ddicttestuser1 revokes PROCESS privilege from user ddicttestuser2
+connection ddicttestuser1;
+####################################################################################
+REVOKE PROCESS ON *.* FROM 'ddicttestuser2'@'localhost';
+####################################################################################
+11.1 New connection con201 (ddicttestuser2)
+ddicttestuser2 has no more the PROCESS privilege and can only see own connects
+####################################################################################
+SHOW GRANTS;
+Grants for ddicttestuser2@localhost
+GRANT USAGE ON *.* TO 'ddicttestuser2'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+SHOW processlist;
+Id User Host db Command Time State Info
+13 ddicttestuser2 localhost information_schema Sleep TIME NULL
+14 ddicttestuser2 localhost information_schema Query TIME NULL SHOW processlist
+SELECT * FROM information_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+14 ddicttestuser2 localhost information_schema Execute TIME preparing SELECT * FROM information_schema.processlist
+13 ddicttestuser2 localhost information_schema Sleep TIME NULL
+####################################################################################
+11.2 Revoke SUPER,PROCESS,GRANT OPTION privilege from user ddicttestuser1
+connection default (user=root)
+####################################################################################
+REVOKE SUPER,PROCESS,GRANT OPTION ON *.* FROM 'ddicttestuser1'@'localhost';
+####################################################################################
+11.3 New connection con107 (ddicttestuser1)
+ddicttestuser1 has no more the PROCESS privilege and can only see own connects
+He is also unable to GRANT the PROCESS privilege to ddicttestuser2
+####################################################################################
+SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
+Grants for ddicttestuser1@localhost
+GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
+ERROR 28000: Access denied for user 'ddicttestuser1'@'localhost' (using password: YES)
+SHOW processlist;
+Id User Host db Command Time State Info
+4 ddicttestuser1 localhost information_schema Sleep TIME NULL
+5 ddicttestuser1 localhost information_schema Sleep TIME NULL
+7 ddicttestuser1 localhost information_schema Sleep TIME NULL
+9 ddicttestuser1 localhost information_schema Sleep TIME NULL
+10 ddicttestuser1 localhost information_schema Sleep TIME NULL
+11 ddicttestuser1 localhost information_schema Sleep TIME NULL
+12 ddicttestuser1 localhost information_schema Sleep TIME NULL
+15 ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist
+SELECT * FROM information_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+15 ddicttestuser1 localhost information_schema Execute TIME preparing SELECT * FROM information_schema.processlist
+12 ddicttestuser1 localhost information_schema Sleep TIME NULL
+11 ddicttestuser1 localhost information_schema Sleep TIME NULL
+10 ddicttestuser1 localhost information_schema Sleep TIME NULL
+9 ddicttestuser1 localhost information_schema Sleep TIME NULL
+7 ddicttestuser1 localhost information_schema Sleep TIME NULL
+5 ddicttestuser1 localhost information_schema Sleep TIME NULL
+4 ddicttestuser1 localhost information_schema Sleep TIME NULL
+####################################################################################
+12 Revoke the SELECT privilege from user ddicttestuser1
+connection default (user=root)
+####################################################################################
+REVOKE SELECT ON *.* FROM 'ddicttestuser1'@'localhost';
+####################################################################################
+12.1 New connection con108 (ddicttestuser1)
+ddicttestuser1 has neither PROCESS nor SELECT privilege
+Manual says: Each MySQL user has the right to access these tables, but can see
+only the rows ...
+Therefore the missing SELECT privilege does not affect SELECTs on PROCESSLIST.
+####################################################################################
+SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
+Grants for ddicttestuser1@localhost
+GRANT USAGE ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
+SHOW processlist;
+Id User Host db Command Time State Info
+4 ddicttestuser1 localhost information_schema Sleep TIME NULL
+5 ddicttestuser1 localhost information_schema Sleep TIME NULL
+7 ddicttestuser1 localhost information_schema Sleep TIME NULL
+9 ddicttestuser1 localhost information_schema Sleep TIME NULL
+10 ddicttestuser1 localhost information_schema Sleep TIME NULL
+11 ddicttestuser1 localhost information_schema Sleep TIME NULL
+12 ddicttestuser1 localhost information_schema Sleep TIME NULL
+15 ddicttestuser1 localhost information_schema Sleep TIME NULL
+16 ddicttestuser1 localhost information_schema Query TIME NULL SHOW processlist
+SELECT * FROM information_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+16 ddicttestuser1 localhost information_schema Execute TIME preparing SELECT * FROM information_schema.processlist
+15 ddicttestuser1 localhost information_schema Sleep TIME NULL
+12 ddicttestuser1 localhost information_schema Sleep TIME NULL
+11 ddicttestuser1 localhost information_schema Sleep TIME NULL
+10 ddicttestuser1 localhost information_schema Sleep TIME NULL
+9 ddicttestuser1 localhost information_schema Sleep TIME NULL
+7 ddicttestuser1 localhost information_schema Sleep TIME NULL
+5 ddicttestuser1 localhost information_schema Sleep TIME NULL
+4 ddicttestuser1 localhost information_schema Sleep TIME NULL
+####################################################################################
+12.2 Revoke only the SELECT privilege on the information_schema from ddicttestuser1.
+connection default (user=root)
+####################################################################################
+REVOKE SELECT ON information_schema.* FROM 'ddicttestuser3'@'localhost';
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+####################################################################################
+connection default (user=root)
+Cleanup: close connections, DROP USER etc.
+####################################################################################
+DROP USER ddicttestuser1@'localhost';
+DROP USER ddicttestuser2@'localhost';
+REVOKE USAGE ON *.* FROM ''@'localhost';
+DROP USER ''@'localhost';
diff --git a/mysql-test/suite/funcs_1/r/b_processlist_val_ps.result b/mysql-test/suite/funcs_1/r/b_processlist_val_ps.result
new file mode 100644
index 00000000000..db0a7750077
--- /dev/null
+++ b/mysql-test/suite/funcs_1/r/b_processlist_val_ps.result
@@ -0,0 +1,174 @@
+DROP USER ddicttestuser1@'localhost';
+ERROR HY000: Operation DROP USER failed for 'ddicttestuser1'@'localhost'
+CREATE USER ddicttestuser1@'localhost';
+GRANT ALL ON *.* TO ddicttestuser1@'localhost';
+REVOKE PROCESS ON *.* FROM ddicttestuser1@'localhost';
+SET PASSWORD FOR ddicttestuser1@'localhost' = PASSWORD('ddictpass');
+DROP TABLE IF EXISTS test.t1;
+CREATE TABLE test.t1 (f1 BIGINT);
+SHOW CREATE TABLE INFORMATION_SCHEMA.PROCESSLIST;
+Table Create Table
+PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
+ `ID` bigint(4) NOT NULL DEFAULT '0',
+ `USER` varchar(16) NOT NULL DEFAULT '',
+ `HOST` varchar(64) NOT NULL DEFAULT '',
+ `DB` varchar(64) DEFAULT NULL,
+ `COMMAND` varchar(16) NOT NULL DEFAULT '',
+ `TIME` bigint(7) NOT NULL DEFAULT '0',
+ `STATE` varchar(64) DEFAULT NULL,
+ `INFO` longtext
+) ENGINE=MyISAM DEFAULT CHARSET=utf8
+SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST;
+COUNT(*)
+1
+USE test;
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+<ID> root localhost test Execute 0 preparing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<ID> root localhost test Query 0 NULL SHOW FULL PROCESSLIST
+USE information_schema;
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+<ID> root localhost information_schema Execute <TIME> preparing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<ID> root localhost information_schema Query <TIME> NULL SHOW FULL PROCESSLIST
+SELECT INFO FROM INFORMATION_SCHEMA.PROCESSLIST;
+INFO
+SELECT INFO FROM INFORMATION_SCHEMA.PROCESSLIST
+SELECT ID INTO @my_proclist_id FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+----- establish connection ddicttestuser1 (user = ddicttestuser1) -----
+
+----- switch to connection default (user = root) -----
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+<ID> ddicttestuser1 localhost information_schema Sleep 0 NULL
+<ID> root localhost information_schema Execute 0 preparing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<ID> root localhost information_schema Query 0 NULL SHOW FULL PROCESSLIST
+<ID> ddicttestuser1 localhost information_schema Sleep 0 NULL
+# Sleep some time
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+<ID> ddicttestuser1 localhost information_schema Sleep 1 NULL
+<ID> root localhost information_schema Execute 0 preparing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<ID> root localhost information_schema Query 0 NULL SHOW FULL PROCESSLIST
+<ID> ddicttestuser1 localhost information_schema Sleep 1 NULL
+SELECT ID = @my_proclist_id + 1 FROM INFORMATION_SCHEMA.PROCESSLIST
+WHERE USER = 'ddicttestuser1';
+ID = @my_proclist_id + 1
+1
+
+----- switch to connection ddicttestuser1 (user = ddicttestuser1) -----
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+<ID> ddicttestuser1 localhost information_schema Execute <TIME> preparing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<ID> ddicttestuser1 localhost information_schema Query <TIME> NULL SHOW FULL PROCESSLIST
+
+----- establish connection con2 (user = ddicttestuser1) ------
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+<ID> ddicttestuser1 localhost information_schema Execute <TIME> preparing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+<ID> ddicttestuser1 localhost information_schema Sleep <TIME> NULL
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<ID> ddicttestuser1 localhost information_schema Sleep <TIME> NULL
+<ID> ddicttestuser1 localhost information_schema Query <TIME> NULL SHOW FULL PROCESSLIST
+
+----- switch to connection default (user = root) -----
+----- close connection con2 -----
+
+----- switch to connection ddicttestuser1 (user = ddicttestuser1) -----
+
+
+# Send a long enough running statement to the server, but do not
+# wait till the result comes back. We will pull this later.
+SELECT sleep(2.5),'Command time';
+
+----- switch to connection default (user = root) -----
+# Sleep some time
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+<ID> ddicttestuser1 localhost information_schema Query 1 init SELECT sleep(2.5),'Command time'
+<ID> root localhost information_schema Execute 0 preparing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<ID> root localhost information_schema Query 0 NULL SHOW FULL PROCESSLIST
+<ID> ddicttestuser1 localhost information_schema Query 1 init SELECT sleep(2.5),'Command time'
+# Sleep some time
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+<ID> ddicttestuser1 localhost information_schema Query 2 init SELECT sleep(2.5),'Command time'
+<ID> root localhost information_schema Execute 0 preparing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<ID> root localhost information_schema Query 0 NULL SHOW FULL PROCESSLIST
+<ID> ddicttestuser1 localhost information_schema Query 2 init SELECT sleep(2.5),'Command time'
+
+----- switch to connection ddicttestuser1 (user = ddicttestuser1) -----
+# Pull("reap") the result set from the statement executed with "send".
+sleep(2.5) Command time
+0 Command time
+
+
+# Send a long (21 KB code and runtime = 2 seconds) statement to the server,
+# but do not wait till the result comes back. We will pull this later.
+SELECT sleep(2),'BEGIN this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.END' AS "my_monster_statement";
+
+----- switch to connection default (user = root) -----
+# Sleep some time
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+<ID> ddicttestuser1 localhost information_schema Query <TIME> init SELECT sleep(2),'BEGIN this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.END' AS "my_monster_statement"
+<ID> root localhost information_schema Execute <TIME> preparing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<ID> root localhost information_schema Query <TIME> NULL SHOW FULL PROCESSLIST
+<ID> ddicttestuser1 localhost information_schema Query <TIME> init SELECT sleep(2),'BEGIN this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.END' AS "my_monster_statement"
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+<ID> root localhost information_schema Query <TIME> NULL SHOW PROCESSLIST
+<ID> ddicttestuser1 localhost information_schema Query <TIME> init SELECT sleep(2),'BEGIN this is the representative of a very long statement.this is the representativ
+
+----- switch to connection ddicttestuser1 (user = ddicttestuser1) -----
+# Pull("reap") the result set from the monster statement executed with "send".
+sleep(2) my_monster_statement
+0 BEGIN this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.this is the representative of a very long statement.END
+
+----- switch to connection default (user = root) -----
+LOCK TABLE test.t1 WRITE;
+
+----- switch to connection ddicttestuser1 (user = ddicttestuser1) -----
+# Send a statement to the server, but do not wait till the result
+# comes back. We will pull this later.
+SELECT COUNT(*) FROM test.t1;
+
+----- switch to connection default (user = root) -----
+# Sleep some time
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+<ID> ddicttestuser1 localhost information_schema Query <TIME> Locked SELECT COUNT(*) FROM test.t1
+<ID> root localhost information_schema Execute <TIME> preparing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<ID> root localhost information_schema Query <TIME> NULL SHOW FULL PROCESSLIST
+<ID> ddicttestuser1 localhost information_schema Query <TIME> Locked SELECT COUNT(*) FROM test.t1
+UNLOCK TABLES;
+
+----- switch to connection ddicttestuser1 (user = ddicttestuser1) -----
+# Pull("reap") the result set from the statement executed with "send".
+COUNT(*)
+0
+
+----- switch to connection default (user = root) -----
+
+----- close connection ddicttestuser1 -----
+DROP USER ddicttestuser1@'localhost';
diff --git a/mysql-test/suite/funcs_1/r/datadict_help_tables_build.result b/mysql-test/suite/funcs_1/r/datadict_help_tables_build.result
new file mode 100644
index 00000000000..c81063b6bb2
--- /dev/null
+++ b/mysql-test/suite/funcs_1/r/datadict_help_tables_build.result
@@ -0,0 +1,22 @@
+DELETE FROM mysql.help_category LIMIT <number>;
+DELETE FROM mysql.help_keyword LIMIT <number>;
+DELETE FROM mysql.help_relation LIMIT <number>;
+DELETE FROM mysql.help_topic LIMIT <number>;
+SELECT * FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_SCHEMA = 'mysql' AND TABLE_NAME LIKE 'help_%';
+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 mysql help_category BASE TABLE MyISAM 10 Fixed 30 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help categories
+NULL mysql help_keyword BASE TABLE MyISAM 10 Fixed 320 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help keywords
+NULL mysql help_relation BASE TABLE MyISAM 10 Fixed 640 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL keyword-topic relation
+NULL mysql help_topic BASE TABLE MyISAM 10 Dynamic 380 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help topics
+SELECT * FROM INFORMATION_SCHEMA.STATISTICS
+WHERE TABLE_SCHEMA = 'mysql' AND TABLE_NAME LIKE 'help_%';
+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 help_category 0 mysql PRIMARY 1 help_category_id A 30 NULL NULL BTREE
+NULL mysql help_category 0 mysql name 1 name A 30 NULL NULL BTREE
+NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A 320 NULL NULL BTREE
+NULL mysql help_keyword 0 mysql name 1 name A 320 NULL NULL BTREE
+NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A NULL NULL NULL BTREE
+NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A 640 NULL NULL BTREE
+NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A 380 NULL NULL BTREE
+NULL mysql help_topic 0 mysql name 1 name A 380 NULL NULL BTREE
diff --git a/mysql-test/suite/funcs_1/r/datadict_help_tables_dev.result b/mysql-test/suite/funcs_1/r/datadict_help_tables_dev.result
new file mode 100644
index 00000000000..5a7381e9592
--- /dev/null
+++ b/mysql-test/suite/funcs_1/r/datadict_help_tables_dev.result
@@ -0,0 +1,18 @@
+SELECT * FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_SCHEMA = 'mysql' AND TABLE_NAME LIKE 'help_%';
+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 mysql help_category BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help categories
+NULL mysql help_keyword BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help keywords
+NULL mysql help_relation BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL keyword-topic relation
+NULL mysql help_topic BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help topics
+SELECT * FROM INFORMATION_SCHEMA.STATISTICS
+WHERE TABLE_SCHEMA = 'mysql' AND TABLE_NAME LIKE 'help_%';
+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 help_category 0 mysql PRIMARY 1 help_category_id A 0 NULL NULL BTREE
+NULL mysql help_category 0 mysql name 1 name A 0 NULL NULL BTREE
+NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A 0 NULL NULL BTREE
+NULL mysql help_keyword 0 mysql name 1 name A 0 NULL NULL BTREE
+NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A NULL NULL NULL BTREE
+NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A 0 NULL NULL BTREE
+NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A 0 NULL NULL BTREE
+NULL mysql help_topic 0 mysql name 1 name A 0 NULL NULL BTREE
diff --git a/mysql-test/suite/funcs_1/r/innodb__datadict.result b/mysql-test/suite/funcs_1/r/innodb__datadict.result
index 25c5fbbf358..4ac0f2e16ea 100644
--- a/mysql-test/suite/funcs_1/r/innodb__datadict.result
+++ b/mysql-test/suite/funcs_1/r/innodb__datadict.result
@@ -660,9 +660,9 @@ TABLE_CATALOG NULL
TABLE_SCHEMA information_schema
TABLE_NAME GLOBAL_VARIABLES
TABLE_TYPE SYSTEM VIEW
-ENGINE MyISAM
+ENGINE MEMORY
VERSION 10
-ROW_FORMAT Dynamic
+ROW_FORMAT Fixed
TABLE_ROWS NULL
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
@@ -870,9 +870,9 @@ TABLE_CATALOG NULL
TABLE_SCHEMA information_schema
TABLE_NAME SESSION_VARIABLES
TABLE_TYPE SYSTEM VIEW
-ENGINE MyISAM
+ENGINE MEMORY
VERSION 10
-ROW_FORMAT Dynamic
+ROW_FORMAT Fixed
TABLE_ROWS NULL
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
@@ -1190,7 +1190,7 @@ TABLE_TYPE BASE TABLE
ENGINE CSV
VERSION 10
ROW_FORMAT Dynamic
-TABLE_ROWS 2
+TABLE_ROWS 1
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -1211,7 +1211,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Fixed
-TABLE_ROWS 0
+TABLE_ROWS 37
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -1232,7 +1232,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Fixed
-TABLE_ROWS 0
+TABLE_ROWS 424
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -1253,7 +1253,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Fixed
-TABLE_ROWS 0
+TABLE_ROWS 901
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -1274,7 +1274,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Dynamic
-TABLE_ROWS 0
+TABLE_ROWS 479
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -1602,7 +1602,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t10
@@ -1623,7 +1623,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t11
@@ -1644,7 +1644,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t2
@@ -1665,7 +1665,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t3
@@ -1686,7 +1686,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t4
@@ -1707,7 +1707,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t7
@@ -1728,7 +1728,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t8
@@ -1749,7 +1749,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t9
@@ -1770,7 +1770,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME tb1
@@ -1791,7 +1791,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME tb2
@@ -1812,7 +1812,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME tb3
@@ -1833,7 +1833,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME tb4
@@ -1854,7 +1854,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test1
TABLE_NAME tb2
@@ -1875,7 +1875,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test4
TABLE_NAME t6
@@ -1896,7 +1896,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
select s.catalog_name, s.schema_name, s.default_character_set_name,
t.table_type, t.engine
from schemata s inner join tables t
@@ -1957,8 +1957,8 @@ NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
-NULL db_datadict latin1 SYSTEM VIEW MyISAM
-NULL db_datadict latin1 SYSTEM VIEW MyISAM
+NULL db_datadict latin1 SYSTEM VIEW MEMORY
+NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MyISAM
NULL db_datadict latin1 SYSTEM VIEW MyISAM
NULL db_datadict latin1 SYSTEM VIEW MyISAM
@@ -2025,8 +2025,8 @@ NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
-NULL information_schema utf8 SYSTEM VIEW MyISAM
-NULL information_schema utf8 SYSTEM VIEW MyISAM
+NULL information_schema utf8 SYSTEM VIEW MEMORY
+NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MyISAM
NULL information_schema utf8 SYSTEM VIEW MyISAM
NULL information_schema utf8 SYSTEM VIEW MyISAM
@@ -2093,8 +2093,8 @@ NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
-NULL mysql latin1 SYSTEM VIEW MyISAM
-NULL mysql latin1 SYSTEM VIEW MyISAM
+NULL mysql latin1 SYSTEM VIEW MEMORY
+NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MyISAM
NULL mysql latin1 SYSTEM VIEW MyISAM
NULL mysql latin1 SYSTEM VIEW MyISAM
@@ -2161,8 +2161,8 @@ NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
-NULL test latin1 SYSTEM VIEW MyISAM
-NULL test latin1 SYSTEM VIEW MyISAM
+NULL test latin1 SYSTEM VIEW MEMORY
+NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MyISAM
NULL test latin1 SYSTEM VIEW MyISAM
NULL test latin1 SYSTEM VIEW MyISAM
@@ -2229,8 +2229,8 @@ NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
-NULL test1 latin1 SYSTEM VIEW MyISAM
-NULL test1 latin1 SYSTEM VIEW MyISAM
+NULL test1 latin1 SYSTEM VIEW MEMORY
+NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MyISAM
NULL test1 latin1 SYSTEM VIEW MyISAM
NULL test1 latin1 SYSTEM VIEW MyISAM
@@ -2297,8 +2297,8 @@ NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
-NULL test4 latin1 SYSTEM VIEW MyISAM
-NULL test4 latin1 SYSTEM VIEW MyISAM
+NULL test4 latin1 SYSTEM VIEW MEMORY
+NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MyISAM
NULL test4 latin1 SYSTEM VIEW MyISAM
NULL test4 latin1 SYSTEM VIEW MyISAM
@@ -2377,6 +2377,9 @@ NULL information_schema EVENTS LAST_ALTERED 18 0000-00-00 00:00:00 NO datetime N
NULL information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime 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 ORIGINATOR 21 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10) 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 DATABASE_COLLATION 24 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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
@@ -2416,9 +2419,9 @@ NULL information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 19 0 NULL NU
NULL information_schema FILES STATUS 37 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema FILES EXTRA 38 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -2505,6 +2508,9 @@ NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime
NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 DATABASE_COLLATION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -2516,9 +2522,9 @@ NULL information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL
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 IS_GRANTABLE 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema STATISTICS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -2586,6 +2592,9 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NUL
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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 TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -2598,6 +2607,8 @@ NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+NULL information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL db_datadict v1 TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select,insert,update,references
NULL db_datadict v1 TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
NULL db_datadict v1 TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
@@ -2670,6 +2681,10 @@ NULL mysql event sql_mode 15 NO set 431 1293 NULL NULL utf8 utf8_general_ci set
NULL mysql event comment 16 NO char 64 192 NULL NULL utf8 utf8_bin char(64) select,insert,update,references
NULL mysql event originator 17 NULL NO int NULL NULL 10 0 NULL NULL int(10) 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 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 db_collation 21 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) 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 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 dl 3 NO char 128 384 NULL NULL utf8 utf8_bin char(128) select,insert,update,references
@@ -2739,6 +2754,10 @@ NULL mysql proc created 13 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NU
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 sql_mode 15 NO set 431 1293 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') 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 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 db_collation 19 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) 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 procs_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) 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 User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
@@ -3201,10 +3220,10 @@ select @x, @y;
@x @y
big5_chinese_ci big5
select * from 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
+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_1 NULL db_datadict sp_1 PROCEDURE NULL SQL BEGIN
SELECT * FROM db_datadict.v1;
-END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost
+END 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
select count(*) from routines;
count(*)
1
@@ -3222,14 +3241,14 @@ NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE
NULL mysql event 0 mysql PRIMARY 1 db A NULL NULL NULL BTREE
NULL mysql event 0 mysql PRIMARY 2 name A 0 NULL NULL BTREE
NULL mysql func 0 mysql PRIMARY 1 name A 0 NULL NULL BTREE
-NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 0 NULL NULL BTREE
-NULL mysql help_category 0 mysql name 1 name A 0 NULL NULL BTREE
-NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A 0 NULL NULL BTREE
-NULL mysql help_keyword 0 mysql name 1 name A 0 NULL NULL BTREE
+NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 37 NULL NULL BTREE
+NULL mysql help_category 0 mysql name 1 name A 37 NULL NULL BTREE
+NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A 424 NULL NULL BTREE
+NULL mysql help_keyword 0 mysql name 1 name A 424 NULL NULL BTREE
NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A NULL NULL NULL BTREE
-NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A 0 NULL NULL BTREE
-NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A 0 NULL NULL BTREE
-NULL mysql help_topic 0 mysql name 1 name A 0 NULL NULL BTREE
+NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A 901 NULL NULL BTREE
+NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A 479 NULL NULL BTREE
+NULL mysql help_topic 0 mysql name 1 name A 479 NULL NULL BTREE
NULL mysql host 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
NULL mysql host 0 mysql PRIMARY 2 Db A 0 NULL NULL BTREE
NULL mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A 0 NULL NULL BTREE
@@ -3259,10 +3278,10 @@ NULL mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A 31 N
NULL mysql user 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
NULL mysql user 0 mysql PRIMARY 2 User A 3 NULL NULL BTREE
select * from views;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
-NULL db_datadict v1 /* ALGORITHM=UNDEFINED */ 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` NONE NO root@localhost DEFINER
-NULL db_datadict vu /* ALGORITHM=UNDEFINED */ select distinct `vu1`.`u` AS `u`,substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3)) AS `server`,substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3),(length(substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3))) - 1)) AS `Server_Clean` from `db_datadict`.`vu1` NONE NO root@localhost DEFINER
-NULL db_datadict vu1 /* ALGORITHM=UNDEFINED */ select `user_privileges`.`GRANTEE` AS `u` from `information_schema`.`user_privileges` NONE NO root@localhost DEFINER
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
+NULL db_datadict v1 SELECT * FROM information_schema.tables NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+NULL db_datadict vu SELECT DISTINCT u, NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+NULL db_datadict vu1 SELECT grantee AS u NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
select * from user_privileges order by grantee, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'127.0.0.1' NULL ALTER YES
@@ -3462,7 +3481,7 @@ max_recs
45
select max(cardinality) from statistics;
max(cardinality)
-393
+901
select concat("View '",
table_name, "' is associated with the database '", table_schema, "'.")
AS "Who is Who for the Views"
@@ -3587,8 +3606,8 @@ columns_priv 7
COLUMN_PRIVILEGES 7
db 22
ENGINES 6
-event 18
-EVENTS 21
+event 22
+EVENTS 24
FILES 38
func 4
general_log 6
@@ -3604,11 +3623,11 @@ ndb_binlog_index 7
PARTITIONS 25
plugin 2
PLUGINS 10
-proc 16
+proc 20
PROCESSLIST 8
procs_priv 8
REFERENTIAL_CONSTRAINTS 11
-ROUTINES 20
+ROUTINES 23
SCHEMATA 5
SCHEMA_PRIVILEGES 5
servers 9
@@ -3639,11 +3658,11 @@ time_zone_leap_second 2
time_zone_name 2
time_zone_transition 3
time_zone_transition_type 5
-TRIGGERS 19
+TRIGGERS 22
user 39
USER_PRIVILEGES 4
v1 21
-VIEWS 8
+VIEWS 10
vu 3
vu1 1
@@ -3668,16 +3687,16 @@ SELECT * FROM collation_character_set_applicability LIMIT 1;
COLLATION_NAME CHARACTER_SET_NAME
big5_chinese_ci big5
SELECT * FROM routines LIMIT 1;
-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
+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_1 NULL db_datadict sp_1 PROCEDURE NULL SQL BEGIN
SELECT * FROM db_datadict.v1;
-END NULL NULL SQL NO CONTAINS SQL NULL DEFINER <Created> <Last_Altered> root@localhost
+END NULL NULL SQL NO CONTAINS SQL NULL DEFINER <Created> <Last_Altered> root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
SELECT * FROM statistics LIMIT 1;
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 NULL NULL NULL BTREE
SELECT * FROM views LIMIT 1;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
-NULL db_datadict v1 /* ALGORITHM=UNDEFINED */ 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` NONE NO root@localhost DEFINER
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
+NULL db_datadict v1 SELECT * FROM information_schema.tables NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
SELECT * FROM user_privileges LIMIT 1;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'localhost' NULL SELECT YES
@@ -3695,7 +3714,7 @@ SELECT * FROM key_column_usage LIMIT 1;
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 mysql PRIMARY NULL mysql columns_priv Host 1 NULL NULL NULL NULL
SELECT * FROM triggers LIMIT 1;
-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
+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
SELECT * FROM parameters LIMIT 1;
ERROR 42S02: Unknown table 'parameters' in information_schema
SELECT * FROM referential_constraints LIMIT 1;
@@ -3977,9 +3996,9 @@ TABLE_CATALOG NULL
TABLE_SCHEMA information_schema
TABLE_NAME GLOBAL_VARIABLES
TABLE_TYPE SYSTEM VIEW
-ENGINE MyISAM
+ENGINE MEMORY
VERSION 10
-ROW_FORMAT Dynamic
+ROW_FORMAT Fixed
TABLE_ROWS NULL
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
@@ -4187,9 +4206,9 @@ TABLE_CATALOG NULL
TABLE_SCHEMA information_schema
TABLE_NAME SESSION_VARIABLES
TABLE_TYPE SYSTEM VIEW
-ENGINE MyISAM
+ENGINE MEMORY
VERSION 10
-ROW_FORMAT Dynamic
+ROW_FORMAT Fixed
TABLE_ROWS NULL
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
@@ -4507,7 +4526,7 @@ TABLE_TYPE BASE TABLE
ENGINE CSV
VERSION 10
ROW_FORMAT Dynamic
-TABLE_ROWS 2
+TABLE_ROWS 1
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -4528,7 +4547,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Fixed
-TABLE_ROWS 0
+TABLE_ROWS 37
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -4549,7 +4568,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Fixed
-TABLE_ROWS 0
+TABLE_ROWS 424
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -4570,7 +4589,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Fixed
-TABLE_ROWS 0
+TABLE_ROWS 901
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -4591,7 +4610,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Dynamic
-TABLE_ROWS 0
+TABLE_ROWS 479
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -4919,7 +4938,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t10
@@ -4940,7 +4959,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t11
@@ -4961,7 +4980,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t2
@@ -4982,7 +5001,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t3
@@ -5003,7 +5022,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t4
@@ -5024,7 +5043,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t7
@@ -5045,7 +5064,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t8
@@ -5066,7 +5085,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t9
@@ -5087,7 +5106,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME tb1
@@ -5108,7 +5127,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME tb2
@@ -5129,7 +5148,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME tb3
@@ -5150,7 +5169,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME tb4
@@ -5171,7 +5190,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test1
TABLE_NAME tb2
@@ -5192,7 +5211,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test4
TABLE_NAME t6
@@ -5213,7 +5232,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT InnoDB free: 3072 kB
+TABLE_COMMENT
select s.catalog_name, s.schema_name, s.default_character_set_name,
t.table_type, t.engine
from information_schema.schemata s inner join information_schema.tables t
@@ -5274,8 +5293,8 @@ NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
-NULL db_datadict latin1 SYSTEM VIEW MyISAM
-NULL db_datadict latin1 SYSTEM VIEW MyISAM
+NULL db_datadict latin1 SYSTEM VIEW MEMORY
+NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MyISAM
NULL db_datadict latin1 SYSTEM VIEW MyISAM
NULL db_datadict latin1 SYSTEM VIEW MyISAM
@@ -5342,8 +5361,8 @@ NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
-NULL information_schema utf8 SYSTEM VIEW MyISAM
-NULL information_schema utf8 SYSTEM VIEW MyISAM
+NULL information_schema utf8 SYSTEM VIEW MEMORY
+NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MyISAM
NULL information_schema utf8 SYSTEM VIEW MyISAM
NULL information_schema utf8 SYSTEM VIEW MyISAM
@@ -5410,8 +5429,8 @@ NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
-NULL mysql latin1 SYSTEM VIEW MyISAM
-NULL mysql latin1 SYSTEM VIEW MyISAM
+NULL mysql latin1 SYSTEM VIEW MEMORY
+NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MyISAM
NULL mysql latin1 SYSTEM VIEW MyISAM
NULL mysql latin1 SYSTEM VIEW MyISAM
@@ -5478,8 +5497,8 @@ NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
-NULL test latin1 SYSTEM VIEW MyISAM
-NULL test latin1 SYSTEM VIEW MyISAM
+NULL test latin1 SYSTEM VIEW MEMORY
+NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MyISAM
NULL test latin1 SYSTEM VIEW MyISAM
NULL test latin1 SYSTEM VIEW MyISAM
@@ -5546,8 +5565,8 @@ NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
-NULL test1 latin1 SYSTEM VIEW MyISAM
-NULL test1 latin1 SYSTEM VIEW MyISAM
+NULL test1 latin1 SYSTEM VIEW MEMORY
+NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MyISAM
NULL test1 latin1 SYSTEM VIEW MyISAM
NULL test1 latin1 SYSTEM VIEW MyISAM
@@ -5614,8 +5633,8 @@ NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
-NULL test4 latin1 SYSTEM VIEW MyISAM
-NULL test4 latin1 SYSTEM VIEW MyISAM
+NULL test4 latin1 SYSTEM VIEW MEMORY
+NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MyISAM
NULL test4 latin1 SYSTEM VIEW MyISAM
NULL test4 latin1 SYSTEM VIEW MyISAM
@@ -5656,10 +5675,10 @@ dec8_swedish_ci dec8
dec8_bin dec8
cp850_general_ci cp850
select * from information_schema.routines limit 0, 5;
-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
+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_1 NULL db_datadict sp_1 PROCEDURE NULL SQL BEGIN
SELECT * FROM db_datadict.v1;
-END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost
+END 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
select * from information_schema.statistics limit 0, 5;
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 NULL NULL NULL BTREE
@@ -5668,10 +5687,10 @@ NULL mysql columns_priv 0 mysql PRIMARY 3 User A NULL NULL NULL BTREE
NULL mysql columns_priv 0 mysql PRIMARY 4 Table_name A NULL NULL NULL BTREE
NULL mysql columns_priv 0 mysql PRIMARY 5 Column_name A 0 NULL NULL BTREE
select * from information_schema.views limit 0, 5;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
-NULL db_datadict v1 /* ALGORITHM=UNDEFINED */ 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` NONE NO root@localhost DEFINER
-NULL db_datadict vu /* ALGORITHM=UNDEFINED */ select distinct `vu1`.`u` AS `u`,substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3)) AS `server`,substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3),(length(substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3))) - 1)) AS `Server_Clean` from `db_datadict`.`vu1` NONE NO root@localhost DEFINER
-NULL db_datadict vu1 /* ALGORITHM=UNDEFINED */ select `user_privileges`.`GRANTEE` AS `u` from `information_schema`.`user_privileges` NONE NO root@localhost DEFINER
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
+NULL db_datadict v1 SELECT * FROM information_schema.tables NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+NULL db_datadict vu SELECT DISTINCT u, NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+NULL db_datadict vu1 SELECT grantee AS u NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
select * from information_schema.user_privileges limit 0, 5;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'localhost' NULL SELECT YES
@@ -5718,7 +5737,7 @@ COUNT(*)
68
SELECT COUNT(*) FROM information_schema. columns ;
COUNT(*)
-842
+861
SELECT COUNT(*) FROM information_schema. character_sets ;
COUNT(*)
36
@@ -5783,7 +5802,7 @@ tot_tabs
65
select count(*) as the_cols from columns;
the_cols
-817
+836
select max(maxlen) as the_max from character_sets;
the_max
3
@@ -5807,7 +5826,7 @@ routine_definition
select * from statistics group by index_name asc limit 0, 5;
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 procs_priv 1 mysql Grantor 1 Grantor A NULL NULL NULL BTREE
-NULL mysql help_category 0 mysql name 1 name A 0 NULL NULL BTREE
+NULL mysql help_category 0 mysql name 1 name A 37 NULL NULL BTREE
NULL mysql columns_priv 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE
select concat(table_schema, ', ', table_name, ', ', view_definition) view_info
@@ -6055,6 +6074,7 @@ INTO OUTFILE '../tmp/out.innodb.db.file'
WHERE schema_name LIKE 'db_%';
CREATE USER user_3212@localhost;
GRANT ALL ON db_datadict.* TO user_3212@localhost;
+GRANT FILE ON *.* TO user_3212@localhost;
connect(localhost,user_3212,,db_datadict,MYSQL_PORT,MYSQL_SOCK);
user_3212@localhost db_datadict
@@ -6063,7 +6083,7 @@ INTO OUTFILE '../tmp/out.innodb.user.file'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM schemata LIMIT 0, 5;
-ERROR 28000: Access denied for user 'user_3212'@'localhost' (using password: NO)
+ERROR 42S02: Table 'db_datadict.schemata' doesn't exist
SELECT *
FROM schemata LIMIT 0, 5;
ERROR 42S02: Table 'db_datadict.schemata' doesn't exist
@@ -6296,19 +6316,19 @@ update information_schema.routines set routine_name = 'p2'
where routine_name = 'sp_4_1_4';
end//
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
+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_4_1_4 NULL db_datadict sp_4_1_4 PROCEDURE NULL SQL begin
update information_schema.routines set routine_name = 'p2'
where routine_name = 'sp_4_1_4';
-end NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost
+end 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
call db_datadict.sp_4_1_4();
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
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
+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_4_1_4 NULL db_datadict sp_4_1_4 PROCEDURE NULL SQL begin
update information_schema.routines set routine_name = 'p2'
where routine_name = 'sp_4_1_4';
-end NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost
+end 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
drop procedure db_datadict.sp_4_1_4;
use information_schema;
@@ -7577,7 +7597,7 @@ CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA
SELECT *
FROM information_schema.triggers
WHERE trigger_schema LIKE 'db_datadict%';
-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
+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
DROP DATABASE IF EXISTS db_datadict;
CREATE DATABASE db_datadict;
USE db_datadict;
@@ -7729,7 +7749,7 @@ CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA
SELECT *
FROM information_schema.triggers
WHERE trigger_schema LIKE 'db_datadict%';
-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
+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
use db_datadict;
drop index i_6_401013 on res_t_401013;
drop table db_datadict.res_t_401013;
@@ -7865,7 +7885,7 @@ CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA
SELECT *
FROM information_schema.triggers
WHERE trigger_schema LIKE 'db_datadict%';
-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
+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
Testcase 3.2.1.14:
--------------------------------------------------------------------------------
@@ -8014,7 +8034,7 @@ CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA
SELECT *
FROM information_schema.triggers
WHERE trigger_schema LIKE 'db_datadict%';
-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
+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
use db_datadict;
alter table res_t_401014 change f1 ff1 int;
alter table res_t_401014 engine = innodb;
@@ -8159,7 +8179,7 @@ CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA
SELECT *
FROM information_schema.triggers
WHERE trigger_schema LIKE 'db_datadict%';
-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
+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
use db_datadict;
drop table db_datadict.res_t_401014;
drop view db_datadict.res_v_401014;
@@ -8318,7 +8338,7 @@ CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA
SELECT *
FROM information_schema.triggers
WHERE trigger_schema LIKE 'db_datadict%';
-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
+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
use db_datadict;
drop index i_6_401015 on res_t_401015;
drop table db_datadict.res_t_401015;
@@ -8453,7 +8473,7 @@ CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA
SELECT *
FROM information_schema.triggers
WHERE trigger_schema LIKE 'db_datadict%';
-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
+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
Testcase 3.2.1.16:
--------------------------------------------------------------------------------
@@ -8482,7 +8502,7 @@ information_schema ENGINES MEMORY
information_schema EVENTS MyISAM
information_schema FILES MEMORY
information_schema GLOBAL_STATUS MEMORY
-information_schema GLOBAL_VARIABLES MyISAM
+information_schema GLOBAL_VARIABLES MEMORY
information_schema KEY_COLUMN_USAGE MEMORY
information_schema PARTITIONS MyISAM
information_schema PLUGINS MyISAM
@@ -8492,7 +8512,7 @@ information_schema ROUTINES MyISAM
information_schema SCHEMATA MEMORY
information_schema SCHEMA_PRIVILEGES MEMORY
information_schema SESSION_STATUS MEMORY
-information_schema SESSION_VARIABLES MyISAM
+information_schema SESSION_VARIABLES MEMORY
information_schema STATISTICS MEMORY
information_schema TABLES MEMORY
information_schema TABLE_CONSTRAINTS MEMORY
@@ -8848,6 +8868,9 @@ EVENTS LAST_ALTERED datetime
EVENTS LAST_EXECUTED datetime
EVENTS EVENT_COMMENT varchar(64)
EVENTS ORIGINATOR bigint(10)
+EVENTS CHARACTER_SET_CLIENT varchar(32)
+EVENTS COLLATION_CONNECTION varchar(32)
+EVENTS DATABASE_COLLATION varchar(32)
FILES FILE_ID bigint(4)
FILES FILE_NAME varchar(64)
FILES FILE_TYPE varchar(20)
@@ -8887,9 +8910,9 @@ FILES CHECKSUM bigint(21) unsigned
FILES STATUS varchar(20)
FILES EXTRA varchar(255)
GLOBAL_STATUS VARIABLE_NAME varchar(64)
-GLOBAL_STATUS VARIABLE_VALUE decimal(22,7)
+GLOBAL_STATUS VARIABLE_VALUE varchar(20480)
GLOBAL_VARIABLES VARIABLE_NAME varchar(64)
-GLOBAL_VARIABLES VARIABLE_VALUE longtext
+GLOBAL_VARIABLES VARIABLE_VALUE varchar(20480)
KEY_COLUMN_USAGE CONSTRAINT_CATALOG varchar(4096)
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA varchar(64)
KEY_COLUMN_USAGE CONSTRAINT_NAME varchar(64)
@@ -8976,6 +8999,9 @@ ROUTINES LAST_ALTERED datetime
ROUTINES SQL_MODE longtext
ROUTINES ROUTINE_COMMENT varchar(64)
ROUTINES DEFINER varchar(77)
+ROUTINES CHARACTER_SET_CLIENT varchar(32)
+ROUTINES COLLATION_CONNECTION varchar(32)
+ROUTINES DATABASE_COLLATION varchar(32)
SCHEMATA CATALOG_NAME varchar(4096)
SCHEMATA SCHEMA_NAME varchar(64)
SCHEMATA DEFAULT_CHARACTER_SET_NAME varchar(64)
@@ -8987,9 +9013,9 @@ SCHEMA_PRIVILEGES TABLE_SCHEMA varchar(64)
SCHEMA_PRIVILEGES PRIVILEGE_TYPE varchar(64)
SCHEMA_PRIVILEGES IS_GRANTABLE varchar(3)
SESSION_STATUS VARIABLE_NAME varchar(64)
-SESSION_STATUS VARIABLE_VALUE decimal(22,7)
+SESSION_STATUS VARIABLE_VALUE varchar(20480)
SESSION_VARIABLES VARIABLE_NAME varchar(64)
-SESSION_VARIABLES VARIABLE_VALUE longtext
+SESSION_VARIABLES VARIABLE_VALUE varchar(20480)
STATISTICS TABLE_CATALOG varchar(4096)
STATISTICS TABLE_SCHEMA varchar(64)
STATISTICS TABLE_NAME varchar(64)
@@ -9057,6 +9083,9 @@ TRIGGERS ACTION_REFERENCE_NEW_ROW varchar(3)
TRIGGERS CREATED datetime
TRIGGERS SQL_MODE longtext
TRIGGERS DEFINER longtext
+TRIGGERS CHARACTER_SET_CLIENT varchar(32)
+TRIGGERS COLLATION_CONNECTION varchar(32)
+TRIGGERS DATABASE_COLLATION varchar(32)
USER_PRIVILEGES GRANTEE varchar(81)
USER_PRIVILEGES TABLE_CATALOG varchar(4096)
USER_PRIVILEGES PRIVILEGE_TYPE varchar(64)
@@ -9069,6 +9098,8 @@ VIEWS CHECK_OPTION varchar(8)
VIEWS IS_UPDATABLE varchar(3)
VIEWS DEFINER varchar(77)
VIEWS SECURITY_TYPE varchar(7)
+VIEWS CHARACTER_SET_CLIENT varchar(32)
+VIEWS COLLATION_CONNECTION varchar(32)
t1 f1 char(20)
t1 f2 char(25)
t1 f3 date
@@ -9649,10 +9680,10 @@ WHERE table_schema = 'information_schema'
AND table_name = 'character_sets'
ORDER BY 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 information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 character_sets CHARACTER_SET_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema character_sets DEFAULT_COLLATE_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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
Testcase 3.2.2.2:
--------------------------------------------------------------------------------
@@ -9732,12 +9763,12 @@ WHERE table_schema = 'information_schema'
AND table_name = 'collations'
ORDER BY 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 information_schema COLLATIONS COLLATION_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLLATIONS CHARACTER_SET_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLLATIONS ID 3 0 NO bigint NULL NULL 19 0 NULL NULL bigint(11) 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 IS_COMPILED 5 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 collations COLLATION_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema collations CHARACTER_SET_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema collations ID 3 0 NO bigint NULL NULL 19 0 NULL NULL bigint(11) 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 IS_COMPILED 5 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
Testcase 3.2.3.2:
--------------------------------------------------------------------------------
@@ -9898,8 +9929,8 @@ WHERE table_schema = 'information_schema'
AND table_name = 'collation_character_set_applicability'
ORDER BY 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 information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema collation_character_set_applicability COLLATION_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema collation_character_set_applicability CHARACTER_SET_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
Testcase 3.2.4.2:
--------------------------------------------------------------------------------
@@ -10071,13 +10102,13 @@ WHERE table_schema = 'information_schema'
AND table_name = 'column_privileges'
ORDER BY 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 information_schema COLUMN_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
-NULL information_schema COLUMN_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 COLUMN_PRIVILEGES TABLE_NAME 4 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 PRIVILEGE_TYPE 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
+NULL information_schema column_privileges TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 column_privileges TABLE_NAME 4 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 PRIVILEGE_TYPE 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema column_privileges IS_GRANTABLE 7 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
Testcase 3.2.5.2 + 3.2.5.3 + 3.2.5.4:
--------------------------------------------------------------------------------
@@ -10255,25 +10286,25 @@ WHERE table_schema = 'information_schema'
AND table_name = 'columns'
ORDER BY 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 information_schema COLUMNS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
-NULL information_schema COLUMNS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 COLUMN_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 COLUMN_DEFAULT 6 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DATA_TYPE 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 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 CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMNS COLUMN_TYPE 15 NO 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 EXTRA 17 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
-NULL information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) 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 TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
+NULL information_schema columns TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 COLUMN_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 COLUMN_DEFAULT 6 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DATA_TYPE 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 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 CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema columns COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema columns COLUMN_TYPE 15 NO 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 EXTRA 17 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
+NULL information_schema columns PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
+NULL information_schema columns COLUMN_COMMENT 19 NO varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) select
Testcase 3.2.6.2 + 3.2.6.3:
--------------------------------------------------------------------------------
@@ -10363,6 +10394,9 @@ NULL information_schema EVENTS LAST_ALTERED 18 0000-00-00 00:00:00 NO datetime N
NULL information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime 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 ORIGINATOR 21 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10) 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 DATABASE_COLLATION 24 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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
@@ -10402,9 +10436,9 @@ NULL information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 19 0 NULL NU
NULL information_schema FILES STATUS 37 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema FILES EXTRA 38 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -10491,6 +10525,9 @@ NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime
NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 DATABASE_COLLATION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -10502,9 +10539,9 @@ NULL information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL
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 IS_GRANTABLE 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema STATISTICS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -10572,6 +10609,9 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NUL
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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 TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -10584,6 +10624,8 @@ NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+NULL information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
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 Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI 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
@@ -10631,6 +10673,10 @@ NULL mysql event sql_mode 15 NO set 431 1293 NULL NULL utf8 utf8_general_ci set
NULL mysql event comment 16 NO char 64 192 NULL NULL utf8 utf8_bin char(64) select,insert,update,references
NULL mysql event originator 17 NULL NO int NULL NULL 10 0 NULL NULL int(10) 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 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 db_collation 21 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) 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 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 dl 3 NO char 128 384 NULL NULL utf8 utf8_bin char(128) select,insert,update,references
@@ -10700,6 +10746,10 @@ NULL mysql proc created 13 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NU
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 sql_mode 15 NO set 431 1293 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') 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 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 db_collation 19 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) 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 procs_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) 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 User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
@@ -11186,6 +11236,9 @@ NULL information_schema EVENTS LAST_ALTERED 18 0000-00-00 00:00:00 NO datetime N
NULL information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime 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 ORIGINATOR 21 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10) 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 DATABASE_COLLATION 24 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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
@@ -11225,9 +11278,9 @@ NULL information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 19 0 NULL NU
NULL information_schema FILES STATUS 37 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema FILES EXTRA 38 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -11314,6 +11367,9 @@ NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime
NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 DATABASE_COLLATION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -11325,9 +11381,9 @@ NULL information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL
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 IS_GRANTABLE 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema STATISTICS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -11395,6 +11451,9 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NUL
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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 TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -11407,6 +11466,8 @@ NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+NULL information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
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
@@ -11747,6 +11808,9 @@ NULL information_schema EVENTS LAST_ALTERED 18 0000-00-00 00:00:00 NO datetime N
NULL information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime 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 ORIGINATOR 21 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10) 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 DATABASE_COLLATION 24 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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
@@ -11786,9 +11850,9 @@ NULL information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 19 0 NULL NU
NULL information_schema FILES STATUS 37 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema FILES EXTRA 38 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -11875,6 +11939,9 @@ NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime
NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 DATABASE_COLLATION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -11886,9 +11953,9 @@ NULL information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL
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 IS_GRANTABLE 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema STATISTICS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -11956,6 +12023,9 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NUL
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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 TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -11968,6 +12038,8 @@ NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+NULL information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
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
@@ -12406,6 +12478,9 @@ NULL information_schema EVENTS LAST_ALTERED datetime NULL NULL NULL NULL datetim
NULL information_schema EVENTS LAST_EXECUTED datetime NULL NULL NULL NULL datetime
3.0000 information_schema EVENTS EVENT_COMMENT varchar 64 192 utf8 utf8_general_ci varchar(64)
NULL information_schema EVENTS ORIGINATOR bigint NULL NULL NULL NULL bigint(10)
+3.0000 information_schema EVENTS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema EVENTS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema EVENTS DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
NULL information_schema FILES FILE_ID bigint NULL NULL NULL NULL bigint(4)
3.0000 information_schema FILES FILE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema FILES FILE_TYPE varchar 20 60 utf8 utf8_general_ci varchar(20)
@@ -12445,9 +12520,9 @@ NULL information_schema FILES CHECKSUM bigint NULL NULL NULL NULL bigint(21) uns
3.0000 information_schema FILES STATUS varchar 20 60 utf8 utf8_general_ci varchar(20)
3.0000 information_schema FILES EXTRA varchar 255 765 utf8 utf8_general_ci varchar(255)
3.0000 information_schema GLOBAL_STATUS VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-NULL information_schema GLOBAL_STATUS VARIABLE_VALUE decimal NULL NULL NULL NULL decimal(22,7)
+3.0000 information_schema GLOBAL_STATUS VARIABLE_VALUE varchar 20480 61440 utf8 utf8_general_ci varchar(20480)
3.0000 information_schema GLOBAL_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-1.0000 information_schema GLOBAL_VARIABLES VARIABLE_VALUE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
+3.0000 information_schema GLOBAL_VARIABLES VARIABLE_VALUE varchar 20480 61440 utf8 utf8_general_ci varchar(20480)
3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG varchar 4096 12288 utf8 utf8_general_ci varchar(4096)
3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -12534,6 +12609,9 @@ NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datet
1.0000 information_schema ROUTINES SQL_MODE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
3.0000 information_schema ROUTINES ROUTINE_COMMENT varchar 64 192 utf8 utf8_general_ci varchar(64)
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)
+3.0000 information_schema ROUTINES DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema SCHEMATA CATALOG_NAME varchar 4096 12288 utf8 utf8_general_ci varchar(4096)
3.0000 information_schema SCHEMATA SCHEMA_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -12545,9 +12623,9 @@ NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datet
3.0000 information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema SCHEMA_PRIVILEGES IS_GRANTABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
3.0000 information_schema SESSION_STATUS VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-NULL information_schema SESSION_STATUS VARIABLE_VALUE decimal NULL NULL NULL NULL decimal(22,7)
+3.0000 information_schema SESSION_STATUS VARIABLE_VALUE varchar 20480 61440 utf8 utf8_general_ci varchar(20480)
3.0000 information_schema SESSION_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-1.0000 information_schema SESSION_VARIABLES VARIABLE_VALUE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
+3.0000 information_schema SESSION_VARIABLES VARIABLE_VALUE varchar 20480 61440 utf8 utf8_general_ci varchar(20480)
3.0000 information_schema STATISTICS TABLE_CATALOG varchar 4096 12288 utf8 utf8_general_ci varchar(4096)
3.0000 information_schema STATISTICS TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema STATISTICS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -12615,6 +12693,9 @@ NULL information_schema TRIGGERS ACTION_ORDER bigint NULL NULL NULL NULL bigint(
NULL information_schema TRIGGERS CREATED datetime NULL NULL NULL NULL datetime
1.0000 information_schema TRIGGERS SQL_MODE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
1.0000 information_schema TRIGGERS DEFINER longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
+3.0000 information_schema TRIGGERS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema TRIGGERS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema TRIGGERS DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema USER_PRIVILEGES GRANTEE varchar 81 243 utf8 utf8_general_ci varchar(81)
3.0000 information_schema USER_PRIVILEGES TABLE_CATALOG varchar 4096 12288 utf8 utf8_general_ci varchar(4096)
3.0000 information_schema USER_PRIVILEGES PRIVILEGE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -12627,6 +12708,8 @@ NULL information_schema TRIGGERS CREATED datetime NULL NULL NULL NULL datetime
3.0000 information_schema VIEWS IS_UPDATABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
3.0000 information_schema VIEWS DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77)
3.0000 information_schema VIEWS SECURITY_TYPE varchar 7 21 utf8 utf8_general_ci varchar(7)
+3.0000 information_schema VIEWS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema VIEWS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 mysql columns_priv Host char 60 180 utf8 utf8_bin char(60)
3.0000 mysql columns_priv Db char 64 192 utf8 utf8_bin char(64)
3.0000 mysql columns_priv User char 16 48 utf8 utf8_bin char(16)
@@ -12674,6 +12757,10 @@ NULL mysql event ends datetime NULL NULL NULL NULL datetime
3.0000 mysql event comment char 64 192 utf8 utf8_bin char(64)
NULL mysql event originator int NULL NULL NULL NULL int(10)
1.0000 mysql event time_zone char 64 64 latin1 latin1_swedish_ci char(64)
+3.0000 mysql event character_set_client char 32 96 utf8 utf8_bin char(32)
+3.0000 mysql event collation_connection char 32 96 utf8 utf8_bin char(32)
+3.0000 mysql event db_collation char 32 96 utf8 utf8_bin char(32)
+1.0000 mysql event body_utf8 longblob 4294967295 4294967295 NULL NULL longblob
3.0000 mysql func name char 64 192 utf8 utf8_bin char(64)
NULL mysql func ret tinyint NULL NULL NULL NULL tinyint(1)
3.0000 mysql func dl char 128 384 utf8 utf8_bin char(128)
@@ -12743,6 +12830,10 @@ 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 431 1293 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')
3.0000 mysql proc comment char 64 192 utf8 utf8_bin char(64)
+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)
+1.0000 mysql proc body_utf8 longblob 4294967295 4294967295 NULL NULL longblob
3.0000 mysql procs_priv Host char 60 180 utf8 utf8_bin char(60)
3.0000 mysql procs_priv Db char 64 192 utf8 utf8_bin char(64)
3.0000 mysql procs_priv User char 16 48 utf8 utf8_bin char(16)
@@ -13208,18 +13299,18 @@ WHERE table_schema = 'information_schema'
AND table_name = 'key_column_usage'
ORDER BY 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 information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema KEY_COLUMN_USAGE TABLE_CATALOG 4 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 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 COLUMN_NAME 7 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_TABLE_SCHEMA 10 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_COLUMN_NAME 12 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema key_column_usage CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema key_column_usage TABLE_CATALOG 4 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 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 COLUMN_NAME 7 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_TABLE_SCHEMA 10 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_COLUMN_NAME 12 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
Testcase 3.2.7.2 + 3.2.7.3:
--------------------------------------------------------------------------------
@@ -13335,6 +13426,9 @@ LAST_ALTERED datetime NO 0000-00-00 00:00:00
SQL_MODE longtext NO
ROUTINE_COMMENT varchar(64) NO
DEFINER varchar(77) NO
+CHARACTER_SET_CLIENT varchar(32) NO
+COLLATION_CONNECTION varchar(32) NO
+DATABASE_COLLATION varchar(32) NO
SHOW CREATE TABLE routines;
Table Create Table
ROUTINES CREATE TEMPORARY TABLE `ROUTINES` (
@@ -13357,39 +13451,45 @@ ROUTINES CREATE TEMPORARY TABLE `ROUTINES` (
`LAST_ALTERED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`SQL_MODE` longtext NOT NULL,
`ROUTINE_COMMENT` varchar(64) NOT NULL DEFAULT '',
- `DEFINER` varchar(77) NOT NULL DEFAULT ''
+ `DEFINER` varchar(77) NOT NULL DEFAULT '',
+ `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '',
+ `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '',
+ `DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=utf8
SELECT COUNT(*) FROM information_schema.columns
WHERE table_schema = 'information_schema'
AND table_name = 'routines'
ORDER BY ordinal_position;
COUNT(*)
-20
+23
SELECT * FROM information_schema.columns
WHERE table_schema = 'information_schema'
AND table_name = 'routines'
ORDER BY 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 information_schema ROUTINES SPECIFIC_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema ROUTINES ROUTINE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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_NAME 4 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 DTD_IDENTIFIER 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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_DEFINITION 8 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 EXTERNAL_LANGUAGE 10 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 IS_DETERMINISTIC 12 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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_PATH 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime 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 SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 ROUTINE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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_NAME 4 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 DTD_IDENTIFIER 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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_DEFINITION 8 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 EXTERNAL_LANGUAGE 10 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 IS_DETERMINISTIC 12 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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_PATH 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime 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 SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 DATABASE_COLLATION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
Testcase 3.2.8.2 + 3.2.8.3:
--------------------------------------------------------------------------------
@@ -13427,16 +13527,16 @@ GRANT EXECUTE ON db_datadict_2.* TO 'user_2'@'localhost';
FLUSH PRIVILEGES;
connect(localhost,user_1,,db_datadict,MYSQL_PORT,MYSQL_SOCK);
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
-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
-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
+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
connect(localhost,user_2,,db_datadict,MYSQL_PORT,MYSQL_SOCK);
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
-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
+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
connect(localhost,user_3,,test,MYSQL_PORT,MYSQL_SOCK);
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
+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
root@localhost db_datadict_2
DROP USER 'user_1'@'localhost';
@@ -13661,6 +13761,9 @@ LAST_ALTERED YYYY-MM-DD hh:mm:ss
SQL_MODE
ROUTINE_COMMENT
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
LENGTH(routine_definition) 2549
use db_datadict;
drop procedure sp_6_408004;
@@ -13699,11 +13802,11 @@ WHERE table_schema = 'information_schema'
AND table_name = 'schemata'
ORDER BY 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 information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema SCHEMATA DEFAULT_COLLATION_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema SCHEMATA SQL_PATH 5 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
+NULL information_schema schemata CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema schemata DEFAULT_COLLATION_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema schemata SQL_PATH 5 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
Testcase 3.2.9.2 + 3.2.9.3:
--------------------------------------------------------------------------------
@@ -13783,12 +13886,12 @@ WHERE table_schema = 'information_schema'
AND table_name = 'table_constraints'
ORDER BY 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 information_schema TABLE_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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_NAME 3 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_CONSTRAINTS TABLE_NAME 5 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 CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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_NAME 3 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_constraints TABLE_NAME 5 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
Testcase 3.2.10.2 + 3.2.10.3:
--------------------------------------------------------------------------------
@@ -13863,12 +13966,12 @@ WHERE table_schema = 'information_schema'
AND table_name = 'table_privileges'
ORDER BY 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 information_schema TABLE_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
-NULL information_schema TABLE_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 TABLE_PRIVILEGES TABLE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 IS_GRANTABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 table_privileges TABLE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 IS_GRANTABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
Testcase 3.2.11.2 + 3.2.11.3 + 3.2.11.4:
--------------------------------------------------------------------------------
@@ -14009,27 +14112,27 @@ WHERE table_schema = 'information_schema'
AND table_name = 'tables'
ORDER BY 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 information_schema TABLES TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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_NAME 3 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 ENGINE 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema TABLES VERSION 6 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_ROWS 8 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 DATA_LENGTH 10 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 INDEX_LENGTH 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned 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 AUTO_INCREMENT 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema TABLES CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TABLES UPDATE_TIME 16 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TABLES CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TABLES TABLE_COLLATION 18 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned 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 TABLE_COMMENT 21 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
+NULL information_schema tables TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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_NAME 3 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 ENGINE 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema tables VERSION 6 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_ROWS 8 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 DATA_LENGTH 10 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 INDEX_LENGTH 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned 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 AUTO_INCREMENT 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+NULL information_schema tables CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+NULL information_schema tables UPDATE_TIME 16 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+NULL information_schema tables CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+NULL information_schema tables TABLE_COLLATION 18 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema tables CHECKSUM 19 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned 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 TABLE_COMMENT 21 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
Testcase 3.2.12.2 + 3.2.12.3:
--------------------------------------------------------------------------------
@@ -14064,7 +14167,7 @@ NULL information_schema ENGINES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL
NULL information_schema EVENTS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema FILES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema GLOBAL_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PARTITIONS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PLUGINS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -14074,7 +14177,7 @@ NULL information_schema ROUTINES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #
NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SESSION_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema SESSION_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SESSION_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema STATISTICS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -14089,19 +14192,19 @@ NULL db_datadict tb1 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NUL
NULL db_datadict tb2 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
NULL db_datadict v3 VIEW NULL NULL NULL NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL NULL NULL VIEW
-NULL test t1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t10 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t11 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t7 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t8 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t9 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t10 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t11 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t7 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t8 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t9 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
connect(localhost,user_2,,db_datadict,MYSQL_PORT,MYSQL_SOCK);
SELECT * FROM information_schema.tables
WHERE table_schema = 'information_schema';
@@ -14115,7 +14218,7 @@ NULL information_schema ENGINES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL
NULL information_schema EVENTS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema FILES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema GLOBAL_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PARTITIONS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PLUGINS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -14125,7 +14228,7 @@ NULL information_schema ROUTINES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #
NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SESSION_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema SESSION_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SESSION_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema STATISTICS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -14138,19 +14241,19 @@ WHERE NOT( table_schema = 'information_schema');
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 MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
-NULL test t1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t10 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t11 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t7 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t8 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t9 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t10 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t11 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t7 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t8 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t9 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
connect(localhost,user_3,,db_datadict,MYSQL_PORT,MYSQL_SOCK);
SELECT * FROM information_schema.tables
WHERE table_schema = 'information_schema';
@@ -14164,7 +14267,7 @@ NULL information_schema ENGINES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL
NULL information_schema EVENTS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema FILES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema GLOBAL_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PARTITIONS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PLUGINS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -14174,7 +14277,7 @@ NULL information_schema ROUTINES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #
NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SESSION_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema SESSION_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SESSION_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema STATISTICS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -14187,19 +14290,19 @@ WHERE NOT( table_schema = 'information_schema');
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 MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
NULL db_datadict v3 VIEW NULL NULL NULL NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL NULL NULL VIEW
-NULL test t1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t10 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t11 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t7 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t8 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t9 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t10 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t11 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t7 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t8 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t9 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
root@localhost db_datadict
SELECT * FROM information_schema.tables
@@ -14214,7 +14317,7 @@ NULL information_schema ENGINES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL
NULL information_schema EVENTS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema FILES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema GLOBAL_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PARTITIONS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PLUGINS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -14224,7 +14327,7 @@ NULL information_schema ROUTINES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #
NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SESSION_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema SESSION_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SESSION_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema STATISTICS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -14243,11 +14346,11 @@ NULL mysql columns_priv BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF#
NULL mysql db BASE TABLE MyISAM 10 Fixed 3 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Database privileges
NULL mysql event BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Events
NULL mysql func BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL User defined functions
-NULL mysql general_log BASE TABLE CSV 10 Dynamic 2 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL General log
-NULL mysql help_category BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help categories
-NULL mysql help_keyword BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help keywords
-NULL mysql help_relation BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL keyword-topic relation
-NULL mysql help_topic BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help topics
+NULL mysql general_log BASE TABLE CSV 10 Dynamic 1 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL General log
+NULL mysql help_category BASE TABLE MyISAM 10 Fixed 37 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help categories
+NULL mysql help_keyword BASE TABLE MyISAM 10 Fixed 424 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help keywords
+NULL mysql help_relation BASE TABLE MyISAM 10 Fixed 901 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL keyword-topic relation
+NULL mysql help_topic BASE TABLE MyISAM 10 Dynamic 479 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help topics
NULL mysql host BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Host privileges; Merged with database privileges
NULL mysql ndb_binlog_index BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
NULL mysql plugin BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL MySQL plugins
@@ -14262,21 +14365,21 @@ NULL mysql time_zone_name BASE TABLE MyISAM 10 Fixed 6 #ARL# #DL# #MDL# #IL# #DF
NULL mysql time_zone_transition BASE TABLE MyISAM 10 Fixed 393 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Time zone transitions
NULL mysql time_zone_transition_type BASE TABLE MyISAM 10 Fixed 31 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Time zone transition types
NULL mysql user BASE TABLE MyISAM 10 Dynamic 6 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Users and global privileges
-NULL test t1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t10 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t11 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t7 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t8 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test t9 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test tb4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test1 tb2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
-NULL test4 t6 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL InnoDB free: 3072 kB
+NULL test t1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t10 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t11 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t7 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t8 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t9 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb1 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb3 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test tb4 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test1 tb2 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test4 t6 BASE TABLE InnoDB 10 Compact 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
DROP USER 'user_1'@'localhost';
DROP USER 'user_2'@'localhost';
DROP USER 'user_3'@'localhost';
@@ -14299,6 +14402,8 @@ CHECK_OPTION varchar(8) NO
IS_UPDATABLE varchar(3) NO
DEFINER varchar(77) NO
SECURITY_TYPE varchar(7) NO
+CHARACTER_SET_CLIENT varchar(32) NO
+COLLATION_CONNECTION varchar(32) NO
SHOW CREATE TABLE views;
Table Create Table
VIEWS CREATE TEMPORARY TABLE `VIEWS` (
@@ -14309,27 +14414,31 @@ VIEWS CREATE TEMPORARY TABLE `VIEWS` (
`CHECK_OPTION` varchar(8) NOT NULL DEFAULT '',
`IS_UPDATABLE` varchar(3) NOT NULL DEFAULT '',
`DEFINER` varchar(77) NOT NULL DEFAULT '',
- `SECURITY_TYPE` varchar(7) NOT NULL DEFAULT ''
+ `SECURITY_TYPE` varchar(7) NOT NULL DEFAULT '',
+ `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '',
+ `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=utf8
SELECT COUNT(*) FROM information_schema.columns
WHERE table_schema = 'information_schema'
AND table_name = 'views'
ORDER BY ordinal_position;
COUNT(*)
-8
+10
SELECT * FROM information_schema.columns
WHERE table_schema = 'information_schema'
AND table_name = 'views'
ORDER BY 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 information_schema VIEWS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema VIEWS VIEW_DEFINITION 4 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
-NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema views VIEW_DEFINITION 4 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+NULL information_schema views DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+NULL information_schema views COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
Testcase 3.2.13.2 + 3.2.13.3:
--------------------------------------------------------------------------------
@@ -14347,21 +14456,21 @@ GRANT SELECT ON db_datadict.v_granted_to_1 TO 'user_1'@'localhost';
GRANT SHOW VIEW, CREATE VIEW ON db_datadict.* TO 'user_2'@'localhost';
FLUSH PRIVILEGES;
SELECT * FROM information_schema.views;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
-NULL db_datadict v_granted_glob /* ALGORITHM=UNDEFINED */ select `db_datadict`.`tb_401302`.`f2` AS `f2`,`db_datadict`.`tb_401302`.`f3` AS `f3` from `db_datadict`.`tb_401302` NONE YES root@localhost DEFINER
-NULL db_datadict v_granted_to_1 /* ALGORITHM=UNDEFINED */ select `db_datadict`.`tb_401302`.`f1` AS `f1`,`db_datadict`.`tb_401302`.`f2` AS `f2`,`db_datadict`.`tb_401302`.`f3` AS `f3` from `db_datadict`.`tb_401302` NONE YES root@localhost DEFINER
+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 f2, f3 FROM tb_401302 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
+NULL db_datadict v_granted_to_1 SELECT * FROM tb_401302 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
connect(localhost,user_1,,test,MYSQL_PORT,MYSQL_SOCK);
SELECT * FROM information_schema.views;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
-NULL db_datadict v_granted_to_1 NONE YES root@localhost DEFINER
+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
connect(localhost,user_2,,test,MYSQL_PORT,MYSQL_SOCK);
SELECT * FROM information_schema.views;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
-NULL db_datadict v_granted_glob NONE YES root@localhost DEFINER
-NULL db_datadict v_granted_to_1 NONE YES root@localhost DEFINER
+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
connect(localhost,user_no_views,,test,MYSQL_PORT,MYSQL_SOCK);
SELECT * FROM information_schema.views;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
root@localhost db_datadict
USE db_datadict;
@@ -14424,21 +14533,21 @@ WHERE table_schema = 'information_schema'
AND table_name = 'statistics'
ORDER BY 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 information_schema STATISTICS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
-NULL information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 NON_UNIQUE 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(1) 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_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 COLUMN_NAME 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
-NULL information_schema STATISTICS SUB_PART 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(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 NULLABLE 13 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 COMMENT 15 NULL YES varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16) select
+NULL information_schema statistics TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
+NULL information_schema statistics TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 NON_UNIQUE 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(1) 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_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 COLUMN_NAME 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
+NULL information_schema statistics SUB_PART 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(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 NULLABLE 13 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 COMMENT 15 NULL YES varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16) select
Testcase 3.2.14.2 + 3.2.14.3:
--------------------------------------------------------------------------------
@@ -14492,14 +14601,14 @@ NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE
NULL mysql event 0 mysql PRIMARY 1 db A NULL NULL NULL BTREE
NULL mysql event 0 mysql PRIMARY 2 name A 0 NULL NULL BTREE
NULL mysql func 0 mysql PRIMARY 1 name A 0 NULL NULL BTREE
-NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 0 NULL NULL BTREE
-NULL mysql help_category 0 mysql name 1 name A 0 NULL NULL BTREE
-NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A 0 NULL NULL BTREE
-NULL mysql help_keyword 0 mysql name 1 name A 0 NULL NULL BTREE
+NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 37 NULL NULL BTREE
+NULL mysql help_category 0 mysql name 1 name A 37 NULL NULL BTREE
+NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A 424 NULL NULL BTREE
+NULL mysql help_keyword 0 mysql name 1 name A 424 NULL NULL BTREE
NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A NULL NULL NULL BTREE
-NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A 0 NULL NULL BTREE
-NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A 0 NULL NULL BTREE
-NULL mysql help_topic 0 mysql name 1 name A 0 NULL NULL BTREE
+NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A 901 NULL NULL BTREE
+NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A 479 NULL NULL BTREE
+NULL mysql help_topic 0 mysql name 1 name A 479 NULL NULL BTREE
NULL mysql host 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
NULL mysql host 0 mysql PRIMARY 2 Db A 0 NULL NULL BTREE
NULL mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A 0 NULL NULL BTREE
@@ -14580,11 +14689,11 @@ WHERE table_schema = 'information_schema'
AND table_name = 'schema_privileges'
ORDER BY 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 information_schema SCHEMA_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
-NULL information_schema SCHEMA_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 SCHEMA_PRIVILEGES PRIVILEGE_TYPE 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
+NULL information_schema schema_privileges TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 schema_privileges PRIVILEGE_TYPE 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema schema_privileges IS_GRANTABLE 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
Testcase 3.2.15.2:
--------------------------------------------------------------------------------
@@ -14749,10 +14858,10 @@ WHERE table_schema = 'information_schema'
AND table_name = 'user_privileges'
ORDER BY 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 information_schema USER_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
-NULL information_schema USER_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 IS_GRANTABLE 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 IS_GRANTABLE 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
Testcase 3.2.16.2 + 3.2.16.3 + 3.2.16.4:
--------------------------------------------------------------------------------
@@ -15113,6 +15222,9 @@ ACTION_REFERENCE_NEW_ROW varchar(3) NO
CREATED datetime YES NULL
SQL_MODE longtext NO
DEFINER longtext NO
+CHARACTER_SET_CLIENT varchar(32) NO
+COLLATION_CONNECTION varchar(32) NO
+DATABASE_COLLATION varchar(32) NO
SHOW CREATE TABLE triggers;
Table Create Table
TRIGGERS CREATE TEMPORARY TABLE `TRIGGERS` (
@@ -15134,38 +15246,44 @@ TRIGGERS CREATE TEMPORARY TABLE `TRIGGERS` (
`ACTION_REFERENCE_NEW_ROW` varchar(3) NOT NULL DEFAULT '',
`CREATED` datetime DEFAULT NULL,
`SQL_MODE` longtext NOT NULL,
- `DEFINER` longtext NOT NULL
+ `DEFINER` longtext NOT NULL,
+ `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '',
+ `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '',
+ `DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=utf8
SELECT COUNT(*) FROM information_schema.columns
WHERE table_schema = 'information_schema'
AND table_name = 'triggers'
ORDER BY ordinal_position;
COUNT(*)
-19
+22
SELECT * FROM information_schema.columns
WHERE table_schema = 'information_schema'
AND table_name = 'triggers'
ORDER BY 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 information_schema TRIGGERS TRIGGER_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
-NULL information_schema TRIGGERS TRIGGER_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 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 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) 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_STATEMENT 10 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) 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_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_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
-NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema triggers TRIGGER_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
+NULL information_schema triggers TRIGGER_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 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 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) 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_STATEMENT 10 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) 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_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_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+NULL information_schema triggers CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+NULL information_schema triggers SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema triggers DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
Testcase 3.2.18.2 + 3.2.18.3:
--------------------------------------------------------------------------------
@@ -15233,17 +15351,17 @@ WHERE table_schema = 'information_schema'
AND table_name = 'referential_constraints'
ORDER BY 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 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 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 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 UNIQUE_CONSTRAINT_NAME 6 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 UPDATE_RULE 8 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 TABLE_NAME 10 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 CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 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 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 UNIQUE_CONSTRAINT_NAME 6 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 UPDATE_RULE 8 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 TABLE_NAME 10 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
*** End of Data Dictionary Tests ***
--------------------------------------------------------------------------------
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 ab4508fb302..02ef728fad5 100644
--- a/mysql-test/suite/funcs_1/r/innodb_func_view.result
+++ b/mysql-test/suite/funcs_1/r/innodb_func_view.result
@@ -286,8 +286,8 @@ CREATE VIEW v1 AS SELECT my_char_30, id FROM t1_values;
SELECT my_char_30, id FROM t1_values
WHERE select_id = 190 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 190 OR select_id IS NULL) order by id;
@@ -304,8 +304,8 @@ A<--------30 characters-------> <--------30 characters-------> 3
A ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
A-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select concat(_latin1'A',`t1_values`.`my_char_30`) AS `CONCAT('A',my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select concat(_latin1'A',`t1_values`.`my_char_30`) AS `CONCAT('A',my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 189 OR select_id IS NULL) order by id;
@@ -324,8 +324,8 @@ SELECT LTRIM(my_varbinary_1000),
my_varbinary_1000, id FROM t1_values
WHERE select_id = 188 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_varbinary_1000`) AS `LTRIM(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_varbinary_1000`) AS `LTRIM(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 188 OR select_id IS NULL) order by id;
@@ -338,8 +338,8 @@ SELECT LTRIM(my_binary_30),
my_binary_30, id FROM t1_values
WHERE select_id = 187 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_binary_30`) AS `LTRIM(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_binary_30`) AS `LTRIM(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 187 OR select_id IS NULL) order by id;
@@ -352,8 +352,8 @@ SELECT LTRIM(my_varchar_1000),
my_varchar_1000, id FROM t1_values
WHERE select_id = 186 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_varchar_1000`) AS `LTRIM(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_varchar_1000`) AS `LTRIM(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 186 OR select_id IS NULL) order by id;
@@ -366,8 +366,8 @@ SELECT LTRIM(my_char_30),
my_char_30, id FROM t1_values
WHERE select_id = 185 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_char_30`) AS `LTRIM(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_char_30`) AS `LTRIM(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 185 OR select_id IS NULL) order by id;
@@ -380,8 +380,8 @@ SELECT LOWER(my_varbinary_1000),
my_varbinary_1000, id FROM t1_values
WHERE select_id = 184 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_varbinary_1000`) AS `LOWER(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_varbinary_1000`) AS `LOWER(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 184 OR select_id IS NULL) order by id;
@@ -394,8 +394,8 @@ SELECT LOWER(my_binary_30),
my_binary_30, id FROM t1_values
WHERE select_id = 183 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_binary_30`) AS `LOWER(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_binary_30`) AS `LOWER(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 183 OR select_id IS NULL) order by id;
@@ -408,8 +408,8 @@ SELECT LOWER(my_varchar_1000),
my_varchar_1000, id FROM t1_values
WHERE select_id = 182 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_varchar_1000`) AS `LOWER(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_varchar_1000`) AS `LOWER(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 182 OR select_id IS NULL) order by id;
@@ -422,8 +422,8 @@ SELECT LOWER(my_char_30),
my_char_30, id FROM t1_values
WHERE select_id = 181 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_char_30`) AS `LOWER(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_char_30`) AS `LOWER(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 181 OR select_id IS NULL) order by id;
@@ -436,8 +436,8 @@ SELECT LOCATE('-', ' - -ABC', my_decimal),
my_decimal, id FROM t1_values
WHERE select_id = 180 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',_latin1' - -ABC',`t1_values`.`my_decimal`) AS `LOCATE('-', ' - -ABC', my_decimal)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',_latin1' - -ABC',`t1_values`.`my_decimal`) AS `LOCATE('-', ' - -ABC', my_decimal)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 180 OR select_id IS NULL) order by id;
@@ -450,8 +450,8 @@ SELECT LOCATE('-', ' - -ABC', my_double),
my_double, id FROM t1_values
WHERE select_id = 179 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',_latin1' - -ABC',`t1_values`.`my_double`) AS `LOCATE('-', ' - -ABC', my_double)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',_latin1' - -ABC',`t1_values`.`my_double`) AS `LOCATE('-', ' - -ABC', my_double)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 179 OR select_id IS NULL) order by id;
@@ -464,8 +464,8 @@ SELECT LOCATE('-', ' - -ABC', my_bigint),
my_bigint, id FROM t1_values
WHERE select_id = 178 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',_latin1' - -ABC',`t1_values`.`my_bigint`) AS `LOCATE('-', ' - -ABC', my_bigint)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',_latin1' - -ABC',`t1_values`.`my_bigint`) AS `LOCATE('-', ' - -ABC', my_bigint)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 178 OR select_id IS NULL) order by id;
@@ -478,8 +478,8 @@ SELECT LOCATE('-', my_varbinary_1000, 3),
my_varbinary_1000, id FROM t1_values
WHERE select_id = 177 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_varbinary_1000`,3) AS `LOCATE('-', my_varbinary_1000, 3)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_varbinary_1000`,3) AS `LOCATE('-', my_varbinary_1000, 3)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 177 OR select_id IS NULL) order by id;
@@ -492,8 +492,8 @@ SELECT LOCATE('-', my_binary_30, 3),
my_binary_30, id FROM t1_values
WHERE select_id = 176 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_binary_30`,3) AS `LOCATE('-', my_binary_30, 3)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_binary_30`,3) AS `LOCATE('-', my_binary_30, 3)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 176 OR select_id IS NULL) order by id;
@@ -506,8 +506,8 @@ SELECT LOCATE('-', my_varchar_1000, 3),
my_varchar_1000, id FROM t1_values
WHERE select_id = 175 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_varchar_1000`,3) AS `LOCATE('-', my_varchar_1000, 3)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_varchar_1000`,3) AS `LOCATE('-', my_varchar_1000, 3)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 175 OR select_id IS NULL) order by id;
@@ -520,8 +520,8 @@ SELECT LOCATE('-', my_char_30, 3),
my_char_30, id FROM t1_values
WHERE select_id = 174 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_char_30`,3) AS `LOCATE('-', my_char_30, 3)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_char_30`,3) AS `LOCATE('-', my_char_30, 3)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 174 OR select_id IS NULL) order by id;
@@ -534,8 +534,8 @@ SELECT LOCATE(my_varbinary_1000, my_binary_30 ),
my_varbinary_1000, my_binary_30 id FROM t1_values
WHERE select_id = 173 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_binary_30`) AS `LOCATE(my_varbinary_1000, my_binary_30 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`my_binary_30` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_binary_30`) AS `LOCATE(my_varbinary_1000, my_binary_30 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`my_binary_30` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 173 OR select_id IS NULL) order by id;
@@ -548,8 +548,8 @@ SELECT LOCATE(my_varbinary_1000, my_varchar_1000 ),
my_varbinary_1000, my_varchar_1000 id FROM t1_values
WHERE select_id = 172 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_varbinary_1000, my_varchar_1000 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`my_varchar_1000` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_varbinary_1000, my_varchar_1000 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`my_varchar_1000` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 172 OR select_id IS NULL) order by id;
@@ -562,8 +562,8 @@ SELECT LOCATE(my_varbinary_1000, my_char_30 ),
my_varbinary_1000, my_char_30 id FROM t1_values
WHERE select_id = 171 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_char_30`) AS `LOCATE(my_varbinary_1000, my_char_30 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`my_char_30` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_char_30`) AS `LOCATE(my_varbinary_1000, my_char_30 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`my_char_30` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 171 OR select_id IS NULL) order by id;
@@ -576,8 +576,8 @@ SELECT LOCATE(my_varbinary_1000, my_varbinary_1000 ),
my_varbinary_1000, id FROM t1_values
WHERE select_id = 170 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_varbinary_1000, my_varbinary_1000 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_varbinary_1000, my_varbinary_1000 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 170 OR select_id IS NULL) order by id;
@@ -590,8 +590,8 @@ SELECT LOCATE(my_binary_30, my_varbinary_1000 ),
my_binary_30, my_varbinary_1000 id FROM t1_values
WHERE select_id = 169 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_binary_30, my_varbinary_1000 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`my_varbinary_1000` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_binary_30, my_varbinary_1000 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`my_varbinary_1000` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 169 OR select_id IS NULL) order by id;
@@ -604,8 +604,8 @@ SELECT LOCATE(my_binary_30, my_varchar_1000 ),
my_binary_30, my_varchar_1000 id FROM t1_values
WHERE select_id = 168 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_binary_30, my_varchar_1000 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`my_varchar_1000` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_binary_30, my_varchar_1000 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`my_varchar_1000` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 168 OR select_id IS NULL) order by id;
@@ -618,8 +618,8 @@ SELECT LOCATE(my_binary_30, my_char_30 ),
my_binary_30, my_char_30 id FROM t1_values
WHERE select_id = 167 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_char_30`) AS `LOCATE(my_binary_30, my_char_30 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`my_char_30` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_char_30`) AS `LOCATE(my_binary_30, my_char_30 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`my_char_30` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 167 OR select_id IS NULL) order by id;
@@ -632,8 +632,8 @@ SELECT LOCATE(my_binary_30, my_binary_30 ),
my_binary_30, id FROM t1_values
WHERE select_id = 166 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_binary_30`) AS `LOCATE(my_binary_30, my_binary_30 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_binary_30`) AS `LOCATE(my_binary_30, my_binary_30 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 166 OR select_id IS NULL) order by id;
@@ -646,8 +646,8 @@ SELECT LOCATE(my_varchar_1000, my_varbinary_1000 ),
my_varchar_1000, my_varbinary_1000 id FROM t1_values
WHERE select_id = 165 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_varchar_1000, my_varbinary_1000 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`my_varbinary_1000` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_varchar_1000, my_varbinary_1000 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`my_varbinary_1000` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 165 OR select_id IS NULL) order by id;
@@ -660,8 +660,8 @@ SELECT LOCATE(my_varchar_1000, my_binary_30 ),
my_varchar_1000, my_binary_30 id FROM t1_values
WHERE select_id = 164 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_binary_30`) AS `LOCATE(my_varchar_1000, my_binary_30 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`my_binary_30` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_binary_30`) AS `LOCATE(my_varchar_1000, my_binary_30 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`my_binary_30` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 164 OR select_id IS NULL) order by id;
@@ -674,8 +674,8 @@ SELECT LOCATE(my_varchar_1000, my_char_30 ),
my_varchar_1000, my_char_30 id FROM t1_values
WHERE select_id = 163 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_char_30`) AS `LOCATE(my_varchar_1000, my_char_30 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`my_char_30` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_char_30`) AS `LOCATE(my_varchar_1000, my_char_30 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`my_char_30` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 163 OR select_id IS NULL) order by id;
@@ -688,8 +688,8 @@ SELECT LOCATE(my_varchar_1000, my_varchar_1000 ),
my_varchar_1000, id FROM t1_values
WHERE select_id = 162 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_varchar_1000, my_varchar_1000 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_varchar_1000, my_varchar_1000 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 162 OR select_id IS NULL) order by id;
@@ -702,8 +702,8 @@ SELECT LOCATE(my_char_30, my_varbinary_1000 ),
my_char_30, my_varbinary_1000 id FROM t1_values
WHERE select_id = 161 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_char_30, my_varbinary_1000 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`my_varbinary_1000` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_char_30, my_varbinary_1000 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`my_varbinary_1000` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 161 OR select_id IS NULL) order by id;
@@ -716,8 +716,8 @@ SELECT LOCATE(my_char_30, my_binary_30 ),
my_char_30, my_binary_30 id FROM t1_values
WHERE select_id = 160 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_binary_30`) AS `LOCATE(my_char_30, my_binary_30 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`my_binary_30` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_binary_30`) AS `LOCATE(my_char_30, my_binary_30 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`my_binary_30` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 160 OR select_id IS NULL) order by id;
@@ -730,8 +730,8 @@ SELECT LOCATE(my_char_30, my_varchar_1000 ),
my_char_30, my_varchar_1000 id FROM t1_values
WHERE select_id = 159 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_char_30, my_varchar_1000 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`my_varchar_1000` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_char_30, my_varchar_1000 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`my_varchar_1000` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 159 OR select_id IS NULL) order by id;
@@ -744,8 +744,8 @@ SELECT LOCATE(my_char_30, my_char_30 ),
my_char_30, id FROM t1_values
WHERE select_id = 158 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_char_30`) AS `LOCATE(my_char_30, my_char_30 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_char_30`) AS `LOCATE(my_char_30, my_char_30 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 158 OR select_id IS NULL) order by id;
@@ -758,8 +758,8 @@ SELECT LOCATE('char', my_varbinary_1000),
my_varbinary_1000, id FROM t1_values
WHERE select_id = 157 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_varbinary_1000`) AS `LOCATE('char', my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_varbinary_1000`) AS `LOCATE('char', my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 157 OR select_id IS NULL) order by id;
@@ -772,8 +772,8 @@ SELECT LOCATE('char', my_binary_30),
my_binary_30, id FROM t1_values
WHERE select_id = 156 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_binary_30`) AS `LOCATE('char', my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_binary_30`) AS `LOCATE('char', my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 156 OR select_id IS NULL) order by id;
@@ -786,8 +786,8 @@ SELECT LOCATE('char', my_varchar_1000),
my_varchar_1000, id FROM t1_values
WHERE select_id = 155 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_varchar_1000`) AS `LOCATE('char', my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_varchar_1000`) AS `LOCATE('char', my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 155 OR select_id IS NULL) order by id;
@@ -800,8 +800,8 @@ SELECT LOCATE('char', my_char_30),
my_char_30, id FROM t1_values
WHERE select_id = 154 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_char_30`) AS `LOCATE('char', my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_char_30`) AS `LOCATE('char', my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 154 OR select_id IS NULL) order by id;
@@ -823,8 +823,8 @@ LOAD_FILE('../tmp/func_view.dat') id
äÄ@
5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select load_file(_latin1'../tmp/func_view.dat') AS `LOAD_FILE('../tmp/func_view.dat')`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select load_file(_latin1'../tmp/func_view.dat') AS `LOAD_FILE('../tmp/func_view.dat')`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 153 OR select_id IS NULL) order by id;
@@ -848,8 +848,8 @@ SELECT LENGTH(my_varbinary_1000),
my_varbinary_1000, id FROM t1_values
WHERE select_id = 152 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_varbinary_1000`) AS `LENGTH(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_varbinary_1000`) AS `LENGTH(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 152 OR select_id IS NULL) order by id;
@@ -862,8 +862,8 @@ SELECT LENGTH(my_binary_30),
my_binary_30, id FROM t1_values
WHERE select_id = 151 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_binary_30`) AS `LENGTH(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_binary_30`) AS `LENGTH(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 151 OR select_id IS NULL) order by id;
@@ -876,8 +876,8 @@ SELECT LENGTH(my_varchar_1000),
my_varchar_1000, id FROM t1_values
WHERE select_id = 150 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_varchar_1000`) AS `LENGTH(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_varchar_1000`) AS `LENGTH(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 150 OR select_id IS NULL) order by id;
@@ -890,8 +890,8 @@ SELECT LENGTH(my_char_30),
my_char_30, id FROM t1_values
WHERE select_id = 149 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_char_30`) AS `LENGTH(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_char_30`) AS `LENGTH(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 149 OR select_id IS NULL) order by id;
@@ -911,8 +911,8 @@ Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(_latin1'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`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(_latin1'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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 148 OR select_id IS NULL) order by id;
@@ -938,8 +938,8 @@ NULL NULL 1
- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_varbinary_1000`,2) AS `LEFT(my_varbinary_1000, 2)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_varbinary_1000`,2) AS `LEFT(my_varbinary_1000, 2)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 147 OR select_id IS NULL) order by id;
@@ -962,8 +962,8 @@ NULL NULL 1
- ---äÖüß@µ*$--
-1 -1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_binary_30`,2) AS `LEFT(my_binary_30, 2)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_binary_30`,2) AS `LEFT(my_binary_30, 2)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 146 OR select_id IS NULL) order by id;
@@ -986,8 +986,8 @@ NULL NULL 1
- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_varchar_1000`,2) AS `LEFT(my_varchar_1000, 2)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_varchar_1000`,2) AS `LEFT(my_varchar_1000, 2)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 145 OR select_id IS NULL) order by id;
@@ -1010,8 +1010,8 @@ NULL NULL 1
- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_char_30`,2) AS `LEFT(my_char_30, 2)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_char_30`,2) AS `LEFT(my_char_30, 2)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 144 OR select_id IS NULL) order by id;
@@ -1030,8 +1030,8 @@ SELECT LCASE(my_varchar_1000),
my_varchar_1000, id FROM t1_values
WHERE select_id = 143 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_varchar_1000`) AS `LCASE(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_varchar_1000`) AS `LCASE(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 143 OR select_id IS NULL) order by id;
@@ -1044,8 +1044,8 @@ SELECT INSTR(my_char_30, 'char'),
my_char_30, id FROM t1_values
WHERE select_id = 142 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_char_30`) AS `INSTR(my_char_30, 'char')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_char_30`) AS `INSTR(my_char_30, 'char')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 142 OR select_id IS NULL) order by id;
@@ -1064,8 +1064,8 @@ NULL NULL 1
160 ---äÖüß@µ*$-- 4
16 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_varbinary_1000`) AS `BIT_LENGTH(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_varbinary_1000`) AS `BIT_LENGTH(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 141 OR select_id IS NULL) order by id;
@@ -1090,8 +1090,8 @@ NULL NULL 1
240 ---äÖüß@µ*$--
240 -1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_binary_30`) AS `BIT_LENGTH(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_binary_30`) AS `BIT_LENGTH(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 140 OR select_id IS NULL) order by id;
@@ -1116,8 +1116,8 @@ NULL NULL 1
160 ---äÖüß@µ*$-- 4
16 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_varchar_1000`) AS `BIT_LENGTH(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_varchar_1000`) AS `BIT_LENGTH(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 139 OR select_id IS NULL) order by id;
@@ -1142,8 +1142,8 @@ NULL NULL 1
152 ---äÖüß@µ*$-- 4
16 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_char_30`) AS `BIT_LENGTH(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_char_30`) AS `BIT_LENGTH(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 138 OR select_id IS NULL) order by id;
@@ -1168,8 +1168,8 @@ IS_NULL NULL 1
2000 2000 4
2005 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_year`,_latin1'IS_NULL') AS `IFNULL(my_year,'IS_NULL')`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_year`,_latin1'IS_NULL') AS `IFNULL(my_year,'IS_NULL')`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 137 OR select_id IS NULL) order by id;
@@ -1194,8 +1194,8 @@ IS_NULL NULL 1
13:00:00 13:00:00 4
10:00:00 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_time`,_latin1'IS_NULL') AS `IFNULL(my_time,'IS_NULL')`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_time`,_latin1'IS_NULL') AS `IFNULL(my_time,'IS_NULL')`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 136 OR select_id IS NULL) order by id;
@@ -1220,8 +1220,8 @@ IFNULL(my_timestamp,'IS_NULL') my_timestamp id
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_timestamp`,_latin1'IS_NULL') AS `IFNULL(my_timestamp,'IS_NULL')`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_timestamp`,_latin1'IS_NULL') AS `IFNULL(my_timestamp,'IS_NULL')`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 135 OR select_id IS NULL) order by id;
@@ -1246,8 +1246,8 @@ IS_NULL NULL 1
2004-02-29 2004-02-29 4
2005-06-28 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_date`,_latin1'IS_NULL') AS `IFNULL(my_date,'IS_NULL')`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_date`,_latin1'IS_NULL') AS `IFNULL(my_date,'IS_NULL')`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 134 OR select_id IS NULL) order by id;
@@ -1272,8 +1272,8 @@ IS_NULL NULL 1
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_datetime`,_latin1'IS_NULL') AS `IFNULL(my_datetime,'IS_NULL')`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_datetime`,_latin1'IS_NULL') AS `IFNULL(my_datetime,'IS_NULL')`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 133 OR select_id IS NULL) order by id;
@@ -1298,8 +1298,8 @@ IS_NULL NULL 1
0 0 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_double`,_latin1'IS_NULL') AS `IFNULL(my_double,'IS_NULL')`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_double`,_latin1'IS_NULL') AS `IFNULL(my_double,'IS_NULL')`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 132 OR select_id IS NULL) order by id;
@@ -1324,8 +1324,8 @@ IS_NULL NULL 1
0.000000000000000000000000000000 0.000000000000000000000000000000 4
-1.000000000000000000000000000000 -1.000000000000000000000000000000 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_decimal`,_latin1'IS_NULL') AS `IFNULL(my_decimal,'IS_NULL')`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_decimal`,_latin1'IS_NULL') AS `IFNULL(my_decimal,'IS_NULL')`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 131 OR select_id IS NULL) order by id;
@@ -1350,8 +1350,8 @@ IS_NULL NULL 1
0 0 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_bigint`,_latin1'IS_NULL') AS `IFNULL(my_bigint,'IS_NULL')`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_bigint`,_latin1'IS_NULL') AS `IFNULL(my_bigint,'IS_NULL')`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 130 OR select_id IS NULL) order by id;
@@ -1376,8 +1376,8 @@ IS_NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_varbinary_1000`,_latin1'IS_NULL') AS `IFNULL(my_varbinary_1000,'IS_NULL')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_varbinary_1000`,_latin1'IS_NULL') AS `IFNULL(my_varbinary_1000,'IS_NULL')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 129 OR select_id IS NULL) order by id;
@@ -1402,8 +1402,8 @@ IS_NULL NULL 1
---äÖüß@µ*$--
-1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_binary_30`,_latin1'IS_NULL') AS `IFNULL(my_binary_30,'IS_NULL')`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_binary_30`,_latin1'IS_NULL') AS `IFNULL(my_binary_30,'IS_NULL')`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 128 OR select_id IS NULL) order by id;
@@ -1428,8 +1428,8 @@ IS_NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_varchar_1000`,_latin1'IS_NULL') AS `IFNULL(my_varchar_1000,'IS_NULL')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_varchar_1000`,_latin1'IS_NULL') AS `IFNULL(my_varchar_1000,'IS_NULL')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 127 OR select_id IS NULL) order by id;
@@ -1454,8 +1454,8 @@ IS_NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_char_30`,_latin1'IS_NULL') AS `IFNULL(my_char_30,'IS_NULL')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_char_30`,_latin1'IS_NULL') AS `IFNULL(my_char_30,'IS_NULL')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 126 OR select_id IS NULL) order by id;
@@ -1481,9 +1481,9 @@ IS NOT NULL 2155 3
IS NOT NULL 2000 4
IS NOT NULL 2005 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_year`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_year IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 125 OR select_id IS NULL) order by id;
@@ -1510,9 +1510,9 @@ IS NOT NULL 838:59:59 3
IS NOT NULL 13:00:00 4
IS NOT NULL 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_time`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_time IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 124 OR select_id IS NULL) order by id;
@@ -1539,9 +1539,9 @@ IS NOT NULL 2038-01-01 02:59:59 3
IS NOT NULL 2004-02-29 23:59:59 4
IS NOT NULL 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_timestamp`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_timestamp IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 123 OR select_id IS NULL) order by id;
@@ -1568,9 +1568,9 @@ IS NOT NULL 9999-12-31 3
IS NOT NULL 2004-02-29 4
IS NOT NULL 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_date`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_date IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 122 OR select_id IS NULL) order by id;
@@ -1597,9 +1597,9 @@ IS NOT NULL 9999-12-31 23:59:59 3
IS NOT NULL 2004-02-29 23:59:59 4
IS NOT NULL 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_datetime`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_datetime IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 121 OR select_id IS NULL) order by id;
@@ -1626,9 +1626,9 @@ IS NOT NULL 1.7976931348623e+308 3
IS NOT NULL 0 4
IS NOT NULL -1 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_double`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_double IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 120 OR select_id IS NULL) order by id;
@@ -1655,9 +1655,9 @@ IS NOT NULL 9999999999999999999999999999999999.999999999999999999999999999999 3
IS NOT NULL 0.000000000000000000000000000000 4
IS NOT NULL -1.000000000000000000000000000000 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_decimal`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_decimal IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 119 OR select_id IS NULL) order by id;
@@ -1684,9 +1684,9 @@ IS NOT NULL 9223372036854775807 3
IS NOT NULL 0 4
IS NOT NULL -1 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_bigint`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_bigint IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 118 OR select_id IS NULL) order by id;
@@ -1713,9 +1713,9 @@ IS NOT NULL <---------1000 characters-------------------------------------------
IS NOT NULL ---äÖüß@µ*$-- 4
IS NOT NULL -1 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_varbinary_1000`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_varbinary_1000 IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 117 OR select_id IS NULL) order by id;
@@ -1742,9 +1742,9 @@ IS NOT NULL <--------30 characters-------> 3
IS NOT NULL ---äÖüß@µ*$--
IS NOT NULL -1
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_binary_30`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_binary_30 IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 116 OR select_id IS NULL) order by id;
@@ -1771,9 +1771,9 @@ IS NOT NULL <---------1000 characters-------------------------------------------
IS NOT NULL ---äÖüß@µ*$-- 4
IS NOT NULL -1 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_varchar_1000`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_varchar_1000 IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 115 OR select_id IS NULL) order by id;
@@ -1800,9 +1800,9 @@ IS NOT NULL <--------30 characters-------> 3
IS NOT NULL ---äÖüß@µ*$-- 4
IS NOT NULL -1 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_char_30`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_char_30 IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 114 OR select_id IS NULL) order by id;
@@ -1828,8 +1828,8 @@ IS TRUE 2155 3
IS TRUE 2000 4
IS TRUE 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_year`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_year, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_year, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 113 OR select_id IS NULL) order by id;
@@ -1854,8 +1854,8 @@ IS TRUE 838:59:59 3
IS TRUE 13:00:00 4
IS TRUE 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_time`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_time, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_time, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 112 OR select_id IS NULL) order by id;
@@ -1880,8 +1880,8 @@ IS TRUE 2038-01-01 02:59:59 3
IS TRUE 2004-02-29 23:59:59 4
IS TRUE 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_timestamp`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_timestamp, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_timestamp, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 111 OR select_id IS NULL) order by id;
@@ -1906,8 +1906,8 @@ IS TRUE 9999-12-31 3
IS TRUE 2004-02-29 4
IS TRUE 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_date`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_date, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_date, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 110 OR select_id IS NULL) order by id;
@@ -1932,8 +1932,8 @@ IS TRUE 9999-12-31 23:59:59 3
IS TRUE 2004-02-29 23:59:59 4
IS TRUE 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_datetime`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_datetime, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_datetime, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 109 OR select_id IS NULL) order by id;
@@ -1958,8 +1958,8 @@ IS TRUE 1.7976931348623e+308 3
IS NOT TRUE 0 4
IS TRUE -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_double`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_double, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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_double`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_double, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 108 OR select_id IS NULL) order by id;
@@ -1984,8 +1984,8 @@ IS TRUE 9999999999999999999999999999999999.999999999999999999999999999999 3
IS NOT TRUE 0.000000000000000000000000000000 4
IS TRUE -1.000000000000000000000000000000 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_decimal`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_decimal, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values`
+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_decimal`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_decimal, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 107 OR select_id IS NULL) order by id;
@@ -2010,8 +2010,8 @@ IS TRUE 9223372036854775807 3
IS NOT TRUE 0 4
IS TRUE -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_bigint`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_bigint, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_bigint, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 106 OR select_id IS NULL) order by id;
@@ -2036,8 +2036,8 @@ IS NOT TRUE <---------1000 characters-------------------------------------------
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_varbinary_1000`,_latin1'IS TRUE',_latin1'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`
+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`,_latin1'IS TRUE',_latin1'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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 105 OR select_id IS NULL) order by id;
@@ -2067,8 +2067,8 @@ Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
Warning 1292 Truncated incorrect DOUBLE value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_binary_30`,_latin1'IS TRUE',_latin1'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`
+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`,_latin1'IS TRUE',_latin1'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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 104 OR select_id IS NULL) order by id;
@@ -2098,8 +2098,8 @@ IS NOT TRUE <---------1000 characters-------------------------------------------
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_varchar_1000`,_latin1'IS TRUE',_latin1'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`
+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`,_latin1'IS TRUE',_latin1'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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 103 OR select_id IS NULL) order by id;
@@ -2127,8 +2127,8 @@ Warnings:
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_char_30`,_latin1'IS TRUE',_latin1'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`
+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`,_latin1'IS TRUE',_latin1'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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 102 OR select_id IS NULL) order by id;
@@ -2156,8 +2156,8 @@ NULL NULL 1
---???????÷@??*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varbinary_1000` using koi8r) AS `CONVERT(my_varbinary_1000 USING koi8r)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varbinary_1000` using koi8r) AS `CONVERT(my_varbinary_1000 USING koi8r)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 101 OR select_id IS NULL) order by id;
@@ -2182,8 +2182,8 @@ NULL NULL 1
---???????÷@??*$--
-1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_binary_30` using koi8r) AS `CONVERT(my_binary_30 USING koi8r)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_binary_30` using koi8r) AS `CONVERT(my_binary_30 USING koi8r)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 100 OR select_id IS NULL) order by id;
@@ -2208,8 +2208,8 @@ NULL NULL 1
---????????@??*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varchar_1000` using koi8r) AS `CONVERT(my_varchar_1000 USING koi8r)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varchar_1000` using koi8r) AS `CONVERT(my_varchar_1000 USING koi8r)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 99 OR select_id IS NULL) order by id;
@@ -2234,8 +2234,8 @@ NULL NULL 1
---????????@??*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_char_30` using koi8r) AS `CONVERT(my_char_30 USING koi8r)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_char_30` using koi8r) AS `CONVERT(my_char_30 USING koi8r)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 98 OR select_id IS NULL) order by id;
@@ -2260,8 +2260,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varbinary_1000` using utf8) AS `CONVERT(my_varbinary_1000 USING utf8)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varbinary_1000` using utf8) AS `CONVERT(my_varbinary_1000 USING utf8)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 97 OR select_id IS NULL) order by id;
@@ -2286,8 +2286,8 @@ NULL NULL 1
---äÖüß@µ*$--
-1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_binary_30` using utf8) AS `CONVERT(my_binary_30 USING utf8)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_binary_30` using utf8) AS `CONVERT(my_binary_30 USING utf8)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 96 OR select_id IS NULL) order by id;
@@ -2312,8 +2312,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varchar_1000` using utf8) AS `CONVERT(my_varchar_1000 USING utf8)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varchar_1000` using utf8) AS `CONVERT(my_varchar_1000 USING utf8)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 95 OR select_id IS NULL) order by id;
@@ -2338,8 +2338,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_char_30` using utf8) AS `CONVERT(my_char_30 USING utf8)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_char_30` using utf8) AS `CONVERT(my_char_30 USING utf8)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 94 OR select_id IS NULL) order by id;
@@ -2364,8 +2364,8 @@ NULL NULL 1
2000 2000 4
2005 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as unsigned) AS `CAST(my_year AS UNSIGNED INTEGER)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as unsigned) AS `CAST(my_year AS UNSIGNED INTEGER)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 93 OR select_id IS NULL) order by id;
@@ -2385,34 +2385,22 @@ my_time, id FROM t1_values
WHERE select_id = 92 OR select_id IS NULL order by id;
CAST(my_time AS UNSIGNED INTEGER) my_time id
NULL NULL 1
-18446744073709550778 -838:59:59 2
-838 838:59:59 3
-13 13:00:00 4
-10 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '-838:59:59'
-Warning 1105 Cast to unsigned converted negative integer to it's positive complement
-Warning 1292 Truncated incorrect INTEGER value: '838:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '13:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '10:00:00'
+18446744073701165657 -838:59:59 2
+8385959 838:59:59 3
+130000 13:00:00 4
+100000 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as unsigned) AS `CAST(my_time AS UNSIGNED INTEGER)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as unsigned) AS `CAST(my_time AS UNSIGNED INTEGER)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 92 OR select_id IS NULL) order by id;
CAST(my_time AS UNSIGNED INTEGER) my_time id
NULL NULL 1
-18446744073709550778 -838:59:59 2
-838 838:59:59 3
-13 13:00:00 4
-10 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '-838:59:59'
-Warning 1105 Cast to unsigned converted negative integer to it's positive complement
-Warning 1292 Truncated incorrect INTEGER value: '838:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '13:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '10:00:00'
+18446744073701165657 -838:59:59 2
+8385959 838:59:59 3
+130000 13:00:00 4
+100000 10:00:00 5
DROP VIEW v1;
@@ -2423,34 +2411,22 @@ my_timestamp, id FROM t1_values
WHERE select_id = 91 OR select_id IS NULL order by id;
CAST(my_timestamp AS UNSIGNED INTEGER) my_timestamp id
0 0000-00-00 00:00:00 1
-1970 1970-01-01 03:00:01 2
-2038 2038-01-01 02:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0000-00-00 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '1970-01-01 03:00:01'
-Warning 1292 Truncated incorrect INTEGER value: '2038-01-01 02:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+19700101030001 1970-01-01 03:00:01 2
+20380101025959 2038-01-01 02:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as unsigned) AS `CAST(my_timestamp AS UNSIGNED INTEGER)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as unsigned) AS `CAST(my_timestamp AS UNSIGNED INTEGER)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 91 OR select_id IS NULL) order by id;
CAST(my_timestamp AS UNSIGNED INTEGER) my_timestamp id
0 0000-00-00 00:00:00 1
-1970 1970-01-01 03:00:01 2
-2038 2038-01-01 02:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0000-00-00 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '1970-01-01 03:00:01'
-Warning 1292 Truncated incorrect INTEGER value: '2038-01-01 02:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+19700101030001 1970-01-01 03:00:01 2
+20380101025959 2038-01-01 02:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
DROP VIEW v1;
@@ -2461,32 +2437,22 @@ my_date, id FROM t1_values
WHERE select_id = 90 OR select_id IS NULL order by id;
CAST(my_date AS UNSIGNED INTEGER) my_date id
NULL NULL 1
-1 0001-01-01 2
-9999 9999-12-31 3
-2004 2004-02-29 4
-2005 2005-06-28 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28'
+10101 0001-01-01 2
+99991231 9999-12-31 3
+20040229 2004-02-29 4
+20050628 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as unsigned) AS `CAST(my_date AS UNSIGNED INTEGER)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as unsigned) AS `CAST(my_date AS UNSIGNED INTEGER)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 90 OR select_id IS NULL) order by id;
CAST(my_date AS UNSIGNED INTEGER) my_date id
NULL NULL 1
-1 0001-01-01 2
-9999 9999-12-31 3
-2004 2004-02-29 4
-2005 2005-06-28 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28'
+10101 0001-01-01 2
+99991231 9999-12-31 3
+20040229 2004-02-29 4
+20050628 2005-06-28 5
DROP VIEW v1;
@@ -2497,32 +2463,22 @@ my_datetime, id FROM t1_values
WHERE select_id = 89 OR select_id IS NULL order by id;
CAST(my_datetime AS UNSIGNED INTEGER) my_datetime id
NULL NULL 1
-1 0001-01-01 00:00:00 2
-9999 9999-12-31 23:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+10101000000 0001-01-01 00:00:00 2
+99991231235959 9999-12-31 23:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as unsigned) AS `CAST(my_datetime AS UNSIGNED INTEGER)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as unsigned) AS `CAST(my_datetime AS UNSIGNED INTEGER)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 89 OR select_id IS NULL) order by id;
CAST(my_datetime AS UNSIGNED INTEGER) my_datetime id
NULL NULL 1
-1 0001-01-01 00:00:00 2
-9999 9999-12-31 23:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+10101000000 0001-01-01 00:00:00 2
+99991231235959 9999-12-31 23:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
DROP VIEW v1;
@@ -2542,8 +2498,8 @@ Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
SHOW CREATE VIEW v1;
-View Create View
-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`
+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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 88 OR select_id IS NULL) order by id;
@@ -2572,8 +2528,8 @@ NULL NULL 1
0 0 4
18446744073709551615 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as unsigned) AS `CAST(my_bigint AS UNSIGNED INTEGER)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as unsigned) AS `CAST(my_bigint AS UNSIGNED INTEGER)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 87 OR select_id IS NULL) order by id;
@@ -2603,8 +2559,8 @@ Warning 1292 Truncated incorrect INTEGER value: '<---------1000 characters------
Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$-- '
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as unsigned) AS `CAST(my_varbinary_1000 AS UNSIGNED INTEGER)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 unsigned) AS `CAST(my_varbinary_1000 AS UNSIGNED INTEGER)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 86 OR select_id IS NULL) order by id;
@@ -2640,8 +2596,8 @@ Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$-- '
Warning 1292 Truncated incorrect INTEGER value: '-1'
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as unsigned) AS `CAST(my_binary_30 AS UNSIGNED INTEGER)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 unsigned) AS `CAST(my_binary_30 AS UNSIGNED INTEGER)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 85 OR select_id IS NULL) order by id;
@@ -2677,8 +2633,8 @@ Warning 1292 Truncated incorrect INTEGER value: '<---------1000 characters------
Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$-- '
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as unsigned) AS `CAST(my_varchar_1000 AS UNSIGNED INTEGER)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 unsigned) AS `CAST(my_varchar_1000 AS UNSIGNED INTEGER)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 84 OR select_id IS NULL) order by id;
@@ -2713,8 +2669,8 @@ Warning 1292 Truncated incorrect INTEGER value: '<--------30 characters------->'
Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$--'
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as unsigned) AS `CAST(my_char_30 AS UNSIGNED INTEGER)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 unsigned) AS `CAST(my_char_30 AS UNSIGNED INTEGER)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 83 OR select_id IS NULL) order by id;
@@ -2744,8 +2700,8 @@ NULL NULL 1
2000 2000 4
2005 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as signed) AS `CAST(my_year AS SIGNED INTEGER)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as signed) AS `CAST(my_year AS SIGNED INTEGER)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 82 OR select_id IS NULL) order by id;
@@ -2765,32 +2721,22 @@ my_time, id FROM t1_values
WHERE select_id = 81 OR select_id IS NULL order by id;
CAST(my_time AS SIGNED INTEGER) my_time id
NULL NULL 1
--838 -838:59:59 2
-838 838:59:59 3
-13 13:00:00 4
-10 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '-838:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '838:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '13:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '10:00:00'
+-8385959 -838:59:59 2
+8385959 838:59:59 3
+130000 13:00:00 4
+100000 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as signed) AS `CAST(my_time AS SIGNED INTEGER)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as signed) AS `CAST(my_time AS SIGNED INTEGER)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 81 OR select_id IS NULL) order by id;
CAST(my_time AS SIGNED INTEGER) my_time id
NULL NULL 1
--838 -838:59:59 2
-838 838:59:59 3
-13 13:00:00 4
-10 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '-838:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '838:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '13:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '10:00:00'
+-8385959 -838:59:59 2
+8385959 838:59:59 3
+130000 13:00:00 4
+100000 10:00:00 5
DROP VIEW v1;
@@ -2801,34 +2747,22 @@ my_timestamp, id FROM t1_values
WHERE select_id = 80 OR select_id IS NULL order by id;
CAST(my_timestamp AS SIGNED INTEGER) my_timestamp id
0 0000-00-00 00:00:00 1
-1970 1970-01-01 03:00:01 2
-2038 2038-01-01 02:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0000-00-00 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '1970-01-01 03:00:01'
-Warning 1292 Truncated incorrect INTEGER value: '2038-01-01 02:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+19700101030001 1970-01-01 03:00:01 2
+20380101025959 2038-01-01 02:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as signed) AS `CAST(my_timestamp AS SIGNED INTEGER)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as signed) AS `CAST(my_timestamp AS SIGNED INTEGER)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 80 OR select_id IS NULL) order by id;
CAST(my_timestamp AS SIGNED INTEGER) my_timestamp id
0 0000-00-00 00:00:00 1
-1970 1970-01-01 03:00:01 2
-2038 2038-01-01 02:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0000-00-00 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '1970-01-01 03:00:01'
-Warning 1292 Truncated incorrect INTEGER value: '2038-01-01 02:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+19700101030001 1970-01-01 03:00:01 2
+20380101025959 2038-01-01 02:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
DROP VIEW v1;
@@ -2839,32 +2773,22 @@ my_date, id FROM t1_values
WHERE select_id = 79 OR select_id IS NULL order by id;
CAST(my_date AS SIGNED INTEGER) my_date id
NULL NULL 1
-1 0001-01-01 2
-9999 9999-12-31 3
-2004 2004-02-29 4
-2005 2005-06-28 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28'
+10101 0001-01-01 2
+99991231 9999-12-31 3
+20040229 2004-02-29 4
+20050628 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as signed) AS `CAST(my_date AS SIGNED INTEGER)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as signed) AS `CAST(my_date AS SIGNED INTEGER)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 79 OR select_id IS NULL) order by id;
CAST(my_date AS SIGNED INTEGER) my_date id
NULL NULL 1
-1 0001-01-01 2
-9999 9999-12-31 3
-2004 2004-02-29 4
-2005 2005-06-28 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28'
+10101 0001-01-01 2
+99991231 9999-12-31 3
+20040229 2004-02-29 4
+20050628 2005-06-28 5
DROP VIEW v1;
@@ -2875,32 +2799,22 @@ my_datetime, id FROM t1_values
WHERE select_id = 78 OR select_id IS NULL order by id;
CAST(my_datetime AS SIGNED INTEGER) my_datetime id
NULL NULL 1
-1 0001-01-01 00:00:00 2
-9999 9999-12-31 23:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+10101000000 0001-01-01 00:00:00 2
+99991231235959 9999-12-31 23:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as signed) AS `CAST(my_datetime AS SIGNED INTEGER)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as signed) AS `CAST(my_datetime AS SIGNED INTEGER)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 78 OR select_id IS NULL) order by id;
CAST(my_datetime AS SIGNED INTEGER) my_datetime id
NULL NULL 1
-1 0001-01-01 00:00:00 2
-9999 9999-12-31 23:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+10101000000 0001-01-01 00:00:00 2
+99991231235959 9999-12-31 23:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
DROP VIEW v1;
@@ -2919,8 +2833,8 @@ Warnings:
Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308'
Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as signed) AS `CAST(my_double AS SIGNED INTEGER)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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 signed) AS `CAST(my_double AS SIGNED INTEGER)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 77 OR select_id IS NULL) order by id;
@@ -2943,23 +2857,23 @@ my_decimal, id FROM t1_values
WHERE select_id = 76 OR select_id IS NULL order by id;
CAST(my_decimal AS SIGNED INTEGER) my_decimal id
NULL NULL 1
--10000000000000000 -9999999999999999999999999999999999.999999999999999999999999999999 2
-10000000000000000 9999999999999999999999999999999999.999999999999999999999999999999 3
+-9223372036854775808 -9999999999999999999999999999999999.999999999999999999999999999999 2
+9223372036854775807 9999999999999999999999999999999999.999999999999999999999999999999 3
0 0.000000000000000000000000000000 4
-1 -1.000000000000000000000000000000 5
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
SHOW CREATE VIEW v1;
-View Create View
-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`
+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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 76 OR select_id IS NULL) order by id;
CAST(my_decimal AS SIGNED INTEGER) my_decimal id
NULL NULL 1
--10000000000000000 -9999999999999999999999999999999999.999999999999999999999999999999 2
-10000000000000000 9999999999999999999999999999999999.999999999999999999999999999999 3
+-9223372036854775808 -9999999999999999999999999999999999.999999999999999999999999999999 2
+9223372036854775807 9999999999999999999999999999999999.999999999999999999999999999999 3
0 0.000000000000000000000000000000 4
-1 -1.000000000000000000000000000000 5
Warnings:
@@ -2980,8 +2894,8 @@ NULL NULL 1
0 0 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as signed) AS `CAST(my_bigint AS SIGNED INTEGER)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as signed) AS `CAST(my_bigint AS SIGNED INTEGER)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 75 OR select_id IS NULL) order by id;
@@ -3010,8 +2924,8 @@ Warning 1292 Truncated incorrect INTEGER value: ''
Warning 1292 Truncated incorrect INTEGER value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as signed) AS `CAST(my_varbinary_1000 AS SIGNED INTEGER)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 signed) AS `CAST(my_varbinary_1000 AS SIGNED INTEGER)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 74 OR select_id IS NULL) order by id;
@@ -3045,8 +2959,8 @@ Warning 1292 Truncated incorrect INTEGER value: '<--------30 characters------->'
Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$-- '
Warning 1292 Truncated incorrect INTEGER value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as signed) AS `CAST(my_binary_30 AS SIGNED INTEGER)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 signed) AS `CAST(my_binary_30 AS SIGNED INTEGER)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 73 OR select_id IS NULL) order by id;
@@ -3080,8 +2994,8 @@ Warning 1292 Truncated incorrect INTEGER value: ''
Warning 1292 Truncated incorrect INTEGER value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as signed) AS `CAST(my_varchar_1000 AS SIGNED INTEGER)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 signed) AS `CAST(my_varchar_1000 AS SIGNED INTEGER)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 72 OR select_id IS NULL) order by id;
@@ -3114,8 +3028,8 @@ Warning 1292 Truncated incorrect INTEGER value: ''
Warning 1292 Truncated incorrect INTEGER value: '<--------30 characters------->'
Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$--'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as signed) AS `CAST(my_char_30 AS SIGNED INTEGER)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 signed) AS `CAST(my_char_30 AS SIGNED INTEGER)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 71 OR select_id IS NULL) order by id;
@@ -3132,287 +3046,255 @@ Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$--'
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_year AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_year AS DECIMAL(37,2)),
my_year, id FROM t1_values;
-SELECT CAST(my_year AS DECIMAL),
+SELECT CAST(my_year AS DECIMAL(37,2)),
my_year, id FROM t1_values
WHERE select_id = 70 OR select_id IS NULL order by id;
-CAST(my_year AS DECIMAL) my_year id
+CAST(my_year AS DECIMAL(37,2)) my_year id
NULL NULL 1
-1901 1901 2
-2155 2155 3
-2000 2000 4
-2005 2005 5
+1901.00 1901 2
+2155.00 2155 3
+2000.00 2000 4
+2005.00 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as decimal) AS `CAST(my_year AS DECIMAL)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as decimal(37,2)) AS `CAST(my_year AS DECIMAL(37,2))`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 70 OR select_id IS NULL) order by id;
-CAST(my_year AS DECIMAL) my_year id
+CAST(my_year AS DECIMAL(37,2)) my_year id
NULL NULL 1
-1901 1901 2
-2155 2155 3
-2000 2000 4
-2005 2005 5
+1901.00 1901 2
+2155.00 2155 3
+2000.00 2000 4
+2005.00 2005 5
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_time AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_time AS DECIMAL(37,2)),
my_time, id FROM t1_values;
-SELECT CAST(my_time AS DECIMAL),
+SELECT CAST(my_time AS DECIMAL(37,2)),
my_time, id FROM t1_values
WHERE select_id = 69 OR select_id IS NULL order by id;
-CAST(my_time AS DECIMAL) my_time id
+CAST(my_time AS DECIMAL(37,2)) my_time id
NULL NULL 1
--8385959 -838:59:59 2
-8385959 838:59:59 3
-130000 13:00:00 4
-100000 10:00:00 5
+-8385959.00 -838:59:59 2
+8385959.00 838:59:59 3
+130000.00 13:00:00 4
+100000.00 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as decimal) AS `CAST(my_time AS DECIMAL)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as decimal(37,2)) AS `CAST(my_time AS DECIMAL(37,2))`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 69 OR select_id IS NULL) order by id;
-CAST(my_time AS DECIMAL) my_time id
+CAST(my_time AS DECIMAL(37,2)) my_time id
NULL NULL 1
--8385959 -838:59:59 2
-8385959 838:59:59 3
-130000 13:00:00 4
-100000 10:00:00 5
+-8385959.00 -838:59:59 2
+8385959.00 838:59:59 3
+130000.00 13:00:00 4
+100000.00 10:00:00 5
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_timestamp AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_timestamp AS DECIMAL(37,2)),
my_timestamp, id FROM t1_values;
-SELECT CAST(my_timestamp AS DECIMAL),
+SELECT CAST(my_timestamp AS DECIMAL(37,2)),
my_timestamp, id FROM t1_values
WHERE select_id = 68 OR select_id IS NULL order by id;
-CAST(my_timestamp AS DECIMAL) my_timestamp id
-0 0000-00-00 00:00:00 1
-9999999999 1970-01-01 03:00:01 2
-9999999999 2038-01-01 02:59:59 3
-9999999999 2004-02-29 23:59:59 4
-9999999999 2005-06-28 10:00:00 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
+CAST(my_timestamp AS DECIMAL(37,2)) my_timestamp id
+0.00 0000-00-00 00:00:00 1
+19700101030001.00 1970-01-01 03:00:01 2
+20380101025959.00 2038-01-01 02:59:59 3
+20040229235959.00 2004-02-29 23:59:59 4
+20050628100000.00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as decimal) AS `CAST(my_timestamp AS DECIMAL)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as decimal(37,2)) AS `CAST(my_timestamp AS DECIMAL(37,2))`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 68 OR select_id IS NULL) order by id;
-CAST(my_timestamp AS DECIMAL) my_timestamp id
-0 0000-00-00 00:00:00 1
-9999999999 1970-01-01 03:00:01 2
-9999999999 2038-01-01 02:59:59 3
-9999999999 2004-02-29 23:59:59 4
-9999999999 2005-06-28 10:00:00 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
+CAST(my_timestamp AS DECIMAL(37,2)) my_timestamp id
+0.00 0000-00-00 00:00:00 1
+19700101030001.00 1970-01-01 03:00:01 2
+20380101025959.00 2038-01-01 02:59:59 3
+20040229235959.00 2004-02-29 23:59:59 4
+20050628100000.00 2005-06-28 10:00:00 5
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_date AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_date AS DECIMAL(37,2)),
my_date, id FROM t1_values;
-SELECT CAST(my_date AS DECIMAL),
+SELECT CAST(my_date AS DECIMAL(37,2)),
my_date, id FROM t1_values
WHERE select_id = 67 OR select_id IS NULL order by id;
-CAST(my_date AS DECIMAL) my_date id
+CAST(my_date AS DECIMAL(37,2)) my_date id
NULL NULL 1
-10101 0001-01-01 2
-99991231 9999-12-31 3
-20040229 2004-02-29 4
-20050628 2005-06-28 5
+10101.00 0001-01-01 2
+99991231.00 9999-12-31 3
+20040229.00 2004-02-29 4
+20050628.00 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as decimal) AS `CAST(my_date AS DECIMAL)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as decimal(37,2)) AS `CAST(my_date AS DECIMAL(37,2))`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 67 OR select_id IS NULL) order by id;
-CAST(my_date AS DECIMAL) my_date id
+CAST(my_date AS DECIMAL(37,2)) my_date id
NULL NULL 1
-10101 0001-01-01 2
-99991231 9999-12-31 3
-20040229 2004-02-29 4
-20050628 2005-06-28 5
+10101.00 0001-01-01 2
+99991231.00 9999-12-31 3
+20040229.00 2004-02-29 4
+20050628.00 2005-06-28 5
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_datetime AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_datetime AS DECIMAL(37,2)),
my_datetime, id FROM t1_values;
-SELECT CAST(my_datetime AS DECIMAL),
+SELECT CAST(my_datetime AS DECIMAL(37,2)),
my_datetime, id FROM t1_values
WHERE select_id = 66 OR select_id IS NULL order by id;
-CAST(my_datetime AS DECIMAL) my_datetime id
+CAST(my_datetime AS DECIMAL(37,2)) my_datetime id
NULL NULL 1
-9999999999 0001-01-01 00:00:00 2
-9999999999 9999-12-31 23:59:59 3
-9999999999 2004-02-29 23:59:59 4
-9999999999 2005-06-28 10:00:00 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
+10101000000.00 0001-01-01 00:00:00 2
+99991231235959.00 9999-12-31 23:59:59 3
+20040229235959.00 2004-02-29 23:59:59 4
+20050628100000.00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as decimal) AS `CAST(my_datetime AS DECIMAL)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as decimal(37,2)) AS `CAST(my_datetime AS DECIMAL(37,2))`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 66 OR select_id IS NULL) order by id;
-CAST(my_datetime AS DECIMAL) my_datetime id
+CAST(my_datetime AS DECIMAL(37,2)) my_datetime id
NULL NULL 1
-9999999999 0001-01-01 00:00:00 2
-9999999999 9999-12-31 23:59:59 3
-9999999999 2004-02-29 23:59:59 4
-9999999999 2005-06-28 10:00:00 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
+10101000000.00 0001-01-01 00:00:00 2
+99991231235959.00 9999-12-31 23:59:59 3
+20040229235959.00 2004-02-29 23:59:59 4
+20050628100000.00 2005-06-28 10:00:00 5
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_double AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_double AS DECIMAL(37,2)),
my_double, id FROM t1_values;
-SELECT CAST(my_double AS DECIMAL),
+SELECT CAST(my_double AS DECIMAL(37,2)),
my_double, id FROM t1_values
WHERE select_id = 65 OR select_id IS NULL order by id;
-CAST(my_double AS DECIMAL) my_double id
+CAST(my_double AS DECIMAL(37,2)) my_double id
NULL NULL 1
--9999999999 -1.7976931348623e+308 2
-9999999999 1.7976931348623e+308 3
-0 0 4
--1 -1 5
--3333 -3333.3333 30
+-99999999999999999999999999999999999.99 -1.7976931348623e+308 2
+99999999999999999999999999999999999.99 1.7976931348623e+308 3
+0.00 0 4
+-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)' at row 1
+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)' at row 1
+Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as decimal) AS `CAST(my_double AS DECIMAL)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 65 OR select_id IS NULL) order by id;
-CAST(my_double AS DECIMAL) my_double id
+CAST(my_double AS DECIMAL(37,2)) my_double id
NULL NULL 1
--9999999999 -1.7976931348623e+308 2
-9999999999 1.7976931348623e+308 3
-0 0 4
--1 -1 5
--3333 -3333.3333 30
+-99999999999999999999999999999999999.99 -1.7976931348623e+308 2
+99999999999999999999999999999999999.99 1.7976931348623e+308 3
+0.00 0 4
+-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)' at row 1
+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)' at row 1
+Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_decimal AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_decimal AS DECIMAL(37,2)),
my_decimal, id FROM t1_values;
-SELECT CAST(my_decimal AS DECIMAL),
+SELECT CAST(my_decimal AS DECIMAL(37,2)),
my_decimal, id FROM t1_values
WHERE select_id = 64 OR select_id IS NULL order by id;
-CAST(my_decimal AS DECIMAL) my_decimal id
+CAST(my_decimal AS DECIMAL(37,2)) my_decimal id
NULL NULL 1
--9999999999 -9999999999999999999999999999999999.999999999999999999999999999999 2
-9999999999 9999999999999999999999999999999999.999999999999999999999999999999 3
-0 0.000000000000000000000000000000 4
--1 -1.000000000000000000000000000000 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_decimal AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_decimal AS DECIMAL)' at row 1
+-10000000000000000000000000000000000.00 -9999999999999999999999999999999999.999999999999999999999999999999 2
+10000000000000000000000000000000000.00 9999999999999999999999999999999999.999999999999999999999999999999 3
+0.00 0.000000000000000000000000000000 4
+-1.00 -1.000000000000000000000000000000 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as decimal) AS `CAST(my_decimal AS DECIMAL)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values`
+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 decimal(37,2)) AS `CAST(my_decimal AS DECIMAL(37,2))`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 64 OR select_id IS NULL) order by id;
-CAST(my_decimal AS DECIMAL) my_decimal id
+CAST(my_decimal AS DECIMAL(37,2)) my_decimal id
NULL NULL 1
--9999999999 -9999999999999999999999999999999999.999999999999999999999999999999 2
-9999999999 9999999999999999999999999999999999.999999999999999999999999999999 3
-0 0.000000000000000000000000000000 4
--1 -1.000000000000000000000000000000 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_decimal AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_decimal AS DECIMAL)' at row 1
+-10000000000000000000000000000000000.00 -9999999999999999999999999999999999.999999999999999999999999999999 2
+10000000000000000000000000000000000.00 9999999999999999999999999999999999.999999999999999999999999999999 3
+0.00 0.000000000000000000000000000000 4
+-1.00 -1.000000000000000000000000000000 5
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_bigint AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_bigint AS DECIMAL(37,2)),
my_bigint, id FROM t1_values;
-SELECT CAST(my_bigint AS DECIMAL),
+SELECT CAST(my_bigint AS DECIMAL(37,2)),
my_bigint, id FROM t1_values
WHERE select_id = 63 OR select_id IS NULL order by id;
-CAST(my_bigint AS DECIMAL) my_bigint id
+CAST(my_bigint AS DECIMAL(37,2)) my_bigint id
NULL NULL 1
--9999999999 -9223372036854775808 2
-9999999999 9223372036854775807 3
-0 0 4
--1 -1 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_bigint AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_bigint AS DECIMAL)' at row 1
+-9223372036854775808.00 -9223372036854775808 2
+9223372036854775807.00 9223372036854775807 3
+0.00 0 4
+-1.00 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as decimal) AS `CAST(my_bigint AS DECIMAL)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as decimal(37,2)) AS `CAST(my_bigint AS DECIMAL(37,2))`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 63 OR select_id IS NULL) order by id;
-CAST(my_bigint AS DECIMAL) my_bigint id
+CAST(my_bigint AS DECIMAL(37,2)) my_bigint id
NULL NULL 1
--9999999999 -9223372036854775808 2
-9999999999 9223372036854775807 3
-0 0 4
--1 -1 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_bigint AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_bigint AS DECIMAL)' at row 1
+-9223372036854775808.00 -9223372036854775808 2
+9223372036854775807.00 9223372036854775807 3
+0.00 0 4
+-1.00 -1 5
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_varbinary_1000 AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_varbinary_1000 AS DECIMAL(37,2)),
my_varbinary_1000, id FROM t1_values;
-SELECT CAST(my_varbinary_1000 AS DECIMAL),
+SELECT CAST(my_varbinary_1000 AS DECIMAL(37,2)),
my_varbinary_1000, id FROM t1_values
WHERE select_id = 62 OR select_id IS NULL order by id;
-CAST(my_varbinary_1000 AS DECIMAL) my_varbinary_1000 id
+CAST(my_varbinary_1000 AS DECIMAL(37,2)) my_varbinary_1000 id
NULL NULL 1
-0 2
-0 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
--3333 -3333.3333 29
+0.00 2
+0.00 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
+0.00 ---äÖüß@µ*$-- 4
+-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
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as decimal) AS `CAST(my_varbinary_1000 AS DECIMAL)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 62 OR select_id IS NULL) order by id;
-CAST(my_varbinary_1000 AS DECIMAL) my_varbinary_1000 id
+CAST(my_varbinary_1000 AS DECIMAL(37,2)) my_varbinary_1000 id
NULL NULL 1
-0 2
-0 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
--3333 -3333.3333 29
+0.00 2
+0.00 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
+0.00 ---äÖüß@µ*$-- 4
+-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
@@ -3420,18 +3302,18 @@ Error 1366 Incorrect decimal value: '' for column '' at row -1
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_binary_30 AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_binary_30 AS DECIMAL(37,2)),
my_binary_30, id FROM t1_values;
-SELECT CAST(my_binary_30 AS DECIMAL),
+SELECT CAST(my_binary_30 AS DECIMAL(37,2)),
my_binary_30, id FROM t1_values
WHERE select_id = 61 OR select_id IS NULL order by id;
-CAST(my_binary_30 AS DECIMAL) my_binary_30 id
+CAST(my_binary_30 AS DECIMAL(37,2)) my_binary_30 id
NULL NULL 1
-0
-0 <--------30 characters-------> 3
-0 ---äÖüß@µ*$--
--1 -1
--3333 -3333.3333
+0.00
+0.00 <--------30 characters-------> 3
+0.00 ---äÖüß@µ*$--
+-1.00 -1
+-3333.33 -3333.3333
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ''
@@ -3442,18 +3324,18 @@ Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
Warning 1292 Truncated incorrect DECIMAL value: '-1'
Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as decimal) AS `CAST(my_binary_30 AS DECIMAL)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 61 OR select_id IS NULL) order by id;
-CAST(my_binary_30 AS DECIMAL) my_binary_30 id
+CAST(my_binary_30 AS DECIMAL(37,2)) my_binary_30 id
NULL NULL 1
-0
-0 <--------30 characters-------> 3
-0 ---äÖüß@µ*$--
--1 -1
--3333 -3333.3333
+0.00
+0.00 <--------30 characters-------> 3
+0.00 ---äÖüß@µ*$--
+-1.00 -1
+-3333.33 -3333.3333
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ''
@@ -3466,35 +3348,35 @@ Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333'
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_varchar_1000 AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_varchar_1000 AS DECIMAL(37,2)),
my_varchar_1000, id FROM t1_values;
-SELECT CAST(my_varchar_1000 AS DECIMAL),
+SELECT CAST(my_varchar_1000 AS DECIMAL(37,2)),
my_varchar_1000, id FROM t1_values
WHERE select_id = 60 OR select_id IS NULL order by id;
-CAST(my_varchar_1000 AS DECIMAL) my_varchar_1000 id
+CAST(my_varchar_1000 AS DECIMAL(37,2)) my_varchar_1000 id
NULL NULL 1
-0 2
-0 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
--3333 -3333.3333 27
+0.00 2
+0.00 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
+0.00 ---äÖüß@µ*$-- 4
+-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
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as decimal) AS `CAST(my_varchar_1000 AS DECIMAL)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 60 OR select_id IS NULL) order by id;
-CAST(my_varchar_1000 AS DECIMAL) my_varchar_1000 id
+CAST(my_varchar_1000 AS DECIMAL(37,2)) my_varchar_1000 id
NULL NULL 1
-0 2
-0 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
--3333 -3333.3333 27
+0.00 2
+0.00 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
+0.00 ---äÖüß@µ*$-- 4
+-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
@@ -3502,18 +3384,18 @@ Error 1366 Incorrect decimal value: '' for column '' at row -1
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_char_30 AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_char_30 AS DECIMAL(37,2)),
my_char_30, id FROM t1_values;
-SELECT CAST(my_char_30 AS DECIMAL),
+SELECT CAST(my_char_30 AS DECIMAL(37,2)),
my_char_30, id FROM t1_values
WHERE select_id = 59 OR select_id IS NULL order by id;
-CAST(my_char_30 AS DECIMAL) my_char_30 id
+CAST(my_char_30 AS DECIMAL(37,2)) my_char_30 id
NULL NULL 1
-0 2
-0 <--------30 characters-------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
--3333 -3333.3333 26
+0.00 2
+0.00 <--------30 characters-------> 3
+0.00 ---äÖüß@µ*$-- 4
+-1.00 -1 5
+-3333.33 -3333.3333 26
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' '
@@ -3522,18 +3404,18 @@ Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as decimal) AS `CAST(my_char_30 AS DECIMAL)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 59 OR select_id IS NULL) order by id;
-CAST(my_char_30 AS DECIMAL) my_char_30 id
+CAST(my_char_30 AS DECIMAL(37,2)) my_char_30 id
NULL NULL 1
-0 2
-0 <--------30 characters-------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
--3333 -3333.3333 26
+0.00 2
+0.00 <--------30 characters-------> 3
+0.00 ---äÖüß@µ*$-- 4
+-1.00 -1 5
+-3333.33 -3333.3333 26
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' '
@@ -3556,8 +3438,8 @@ NULL NULL 1
00:20:00 2000 4
00:20:05 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as time) AS `CAST(my_year AS TIME)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as time) AS `CAST(my_year AS TIME)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 58 OR select_id IS NULL) order by id;
@@ -3582,8 +3464,8 @@ NULL NULL 1
13:00:00 13:00:00 4
10:00:00 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as time) AS `CAST(my_time AS TIME)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as time) AS `CAST(my_time AS TIME)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 57 OR select_id IS NULL) order by id;
@@ -3608,8 +3490,8 @@ CAST(my_timestamp AS TIME) my_timestamp id
23:59:59 2004-02-29 23:59:59 4
10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as time) AS `CAST(my_timestamp AS TIME)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as time) AS `CAST(my_timestamp AS TIME)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 56 OR select_id IS NULL) order by id;
@@ -3634,8 +3516,8 @@ NULL NULL 1
00:00:00 2004-02-29 4
00:00:00 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as time) AS `CAST(my_date AS TIME)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as time) AS `CAST(my_date AS TIME)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 55 OR select_id IS NULL) order by id;
@@ -3660,8 +3542,8 @@ NULL NULL 1
23:59:59 2004-02-29 23:59:59 4
10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as time) AS `CAST(my_datetime AS TIME)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as time) AS `CAST(my_datetime AS TIME)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 54 OR select_id IS NULL) order by id;
@@ -3690,8 +3572,8 @@ Warnings:
Warning 1292 Truncated incorrect time value: '-1.7976931348623e+308'
Warning 1292 Truncated incorrect time value: '1.7976931348623e+308'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as time) AS `CAST(my_double AS TIME)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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 time) AS `CAST(my_double AS TIME)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 53 OR select_id IS NULL) order by id;
@@ -3724,8 +3606,8 @@ Warnings:
Warning 1292 Truncated incorrect time value: '-9223372036854775808'
Warning 1292 Truncated incorrect time value: '9223372036854775807'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as time) AS `CAST(my_bigint AS TIME)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as time) AS `CAST(my_bigint AS TIME)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 52 OR select_id IS NULL) order by id;
@@ -3759,8 +3641,8 @@ Warning 1292 Truncated incorrect time value: ''
Warning 1292 Truncated incorrect time value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
Warning 1292 Truncated incorrect time value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as time) AS `CAST(my_varbinary_1000 AS TIME)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 time) AS `CAST(my_varbinary_1000 AS TIME)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 51 OR select_id IS NULL) order by id;
@@ -3797,8 +3679,8 @@ Warning 1292 Truncated incorrect time value: ' ---äÖüß@µ*$-- '
Warning 1292 Truncated incorrect time value: '-1'
Warning 1292 Truncated incorrect time value: '1 17:58'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as time) AS `CAST(my_binary_30 AS TIME)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 time) AS `CAST(my_binary_30 AS TIME)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 50 OR select_id IS NULL) order by id;
@@ -3835,8 +3717,8 @@ Warning 1292 Truncated incorrect time value: ''
Warning 1292 Truncated incorrect time value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
Warning 1292 Truncated incorrect time value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as time) AS `CAST(my_varchar_1000 AS TIME)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 time) AS `CAST(my_varchar_1000 AS TIME)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 49 OR select_id IS NULL) order by id;
@@ -3871,8 +3753,8 @@ Warning 1292 Truncated incorrect time value: ''
Warning 1292 Truncated incorrect time value: '<--------30 characters------->'
Warning 1292 Truncated incorrect time value: ' ---äÖüß@µ*$--'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as time) AS `CAST(my_char_30 AS TIME)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 time) AS `CAST(my_char_30 AS TIME)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 48 OR select_id IS NULL) order by id;
@@ -3907,8 +3789,8 @@ Warning 1292 Incorrect datetime value: '2155'
Warning 1292 Incorrect datetime value: '2000'
Warning 1292 Incorrect datetime value: '2005'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as datetime) AS `CAST(my_year AS DATETIME)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as datetime) AS `CAST(my_year AS DATETIME)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 47 OR select_id IS NULL) order by id;
@@ -3941,8 +3823,8 @@ Warnings:
Warning 1292 Incorrect datetime value: '0000-00-00 838:59:59'
Warning 1292 Incorrect datetime value: '0000-00-00 838:59:59'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as datetime) AS `CAST(my_time AS DATETIME)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as datetime) AS `CAST(my_time AS DATETIME)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 46 OR select_id IS NULL) order by id;
@@ -3970,8 +3852,8 @@ CAST(my_timestamp AS DATETIME) my_timestamp id
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as datetime) AS `CAST(my_timestamp AS DATETIME)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as datetime) AS `CAST(my_timestamp AS DATETIME)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 45 OR select_id IS NULL) order by id;
@@ -3996,8 +3878,8 @@ NULL NULL 1
2004-02-29 00:00:00 2004-02-29 4
2005-06-28 00:00:00 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as datetime) AS `CAST(my_date AS DATETIME)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as datetime) AS `CAST(my_date AS DATETIME)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 44 OR select_id IS NULL) order by id;
@@ -4022,8 +3904,8 @@ NULL NULL 1
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as datetime) AS `CAST(my_datetime AS DATETIME)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as datetime) AS `CAST(my_datetime AS DATETIME)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 43 OR select_id IS NULL) order by id;
@@ -4055,8 +3937,8 @@ Warning 1292 Incorrect datetime value: '0'
Warning 1292 Incorrect datetime value: '-1'
Warning 1292 Incorrect datetime value: '200506271758'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as datetime) AS `CAST(my_double AS DATETIME)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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 datetime) AS `CAST(my_double AS DATETIME)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 42 OR select_id IS NULL) order by id;
@@ -4095,8 +3977,8 @@ Warning 1292 Incorrect datetime value: '0'
Warning 1292 Incorrect datetime value: '-1'
Warning 1292 Incorrect datetime value: '200506271758'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as datetime) AS `CAST(my_bigint AS DATETIME)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as datetime) AS `CAST(my_bigint AS DATETIME)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 41 OR select_id IS NULL) order by id;
@@ -4134,8 +4016,8 @@ Warning 1292 Incorrect datetime value: '<---------1000 characters---------------
Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as datetime) AS `CAST(my_varbinary_1000 AS DATETIME)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 datetime) AS `CAST(my_varbinary_1000 AS DATETIME)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 40 OR select_id IS NULL) order by id;
@@ -4173,8 +4055,8 @@ Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
Warning 1292 Incorrect datetime value: '-1'
Warning 1292 Truncated incorrect datetime value: '2005-06-27 17:58'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as datetime) AS `CAST(my_binary_30 AS DATETIME)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 datetime) AS `CAST(my_binary_30 AS DATETIME)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 39 OR select_id IS NULL) order by id;
@@ -4212,8 +4094,8 @@ Warning 1292 Incorrect datetime value: '<---------1000 characters---------------
Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as datetime) AS `CAST(my_varchar_1000 AS DATETIME)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 datetime) AS `CAST(my_varchar_1000 AS DATETIME)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 38 OR select_id IS NULL) order by id;
@@ -4250,8 +4132,8 @@ Warning 1292 Incorrect datetime value: '<--------30 characters------->'
Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$--'
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as datetime) AS `CAST(my_char_30 AS DATETIME)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 datetime) AS `CAST(my_char_30 AS DATETIME)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 37 OR select_id IS NULL) order by id;
@@ -4287,8 +4169,8 @@ Warning 1292 Incorrect datetime value: '2155'
Warning 1292 Incorrect datetime value: '2000'
Warning 1292 Incorrect datetime value: '2005'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as date) AS `CAST(my_year AS DATE)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as date) AS `CAST(my_year AS DATE)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 36 OR select_id IS NULL) order by id;
@@ -4318,8 +4200,8 @@ NULL NULL 1
0000-00-00 13:00:00 4
0000-00-00 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as date) AS `CAST(my_time AS DATE)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as date) AS `CAST(my_time AS DATE)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 35 OR select_id IS NULL) order by id;
@@ -4344,8 +4226,8 @@ CAST(my_timestamp AS DATE) my_timestamp id
2004-02-29 2004-02-29 23:59:59 4
2005-06-28 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as date) AS `CAST(my_timestamp AS DATE)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as date) AS `CAST(my_timestamp AS DATE)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 34 OR select_id IS NULL) order by id;
@@ -4370,8 +4252,8 @@ NULL NULL 1
2004-02-29 2004-02-29 4
2005-06-28 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as date) AS `CAST(my_date AS DATE)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as date) AS `CAST(my_date AS DATE)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 33 OR select_id IS NULL) order by id;
@@ -4396,8 +4278,8 @@ NULL NULL 1
2004-02-29 2004-02-29 23:59:59 4
2005-06-28 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as date) AS `CAST(my_datetime AS DATE)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as date) AS `CAST(my_datetime AS DATE)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 32 OR select_id IS NULL) order by id;
@@ -4428,8 +4310,8 @@ Warning 1292 Incorrect datetime value: '1.7976931348623e+308'
Warning 1292 Incorrect datetime value: '0'
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as date) AS `CAST(my_double AS DATE)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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 date) AS `CAST(my_double AS DATE)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 31 OR select_id IS NULL) order by id;
@@ -4466,8 +4348,8 @@ Warning 1292 Incorrect datetime value: '9223372036854775807'
Warning 1292 Incorrect datetime value: '0'
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as date) AS `CAST(my_bigint AS DATE)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as date) AS `CAST(my_bigint AS DATE)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 30 OR select_id IS NULL) order by id;
@@ -4504,8 +4386,8 @@ Warning 1292 Incorrect datetime value: '<---------1000 characters---------------
Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as date) AS `CAST(my_varbinary_1000 AS DATE)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 date) AS `CAST(my_varbinary_1000 AS DATE)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 29 OR select_id IS NULL) order by id;
@@ -4543,8 +4425,8 @@ Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
Warning 1292 Incorrect datetime value: '-1'
Warning 1292 Truncated incorrect date value: '2005-06-27'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as date) AS `CAST(my_binary_30 AS DATE)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 date) AS `CAST(my_binary_30 AS DATE)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 28 OR select_id IS NULL) order by id;
@@ -4582,8 +4464,8 @@ Warning 1292 Incorrect datetime value: '<---------1000 characters---------------
Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as date) AS `CAST(my_varchar_1000 AS DATE)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 date) AS `CAST(my_varchar_1000 AS DATE)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 27 OR select_id IS NULL) order by id;
@@ -4620,8 +4502,8 @@ Warning 1292 Incorrect datetime value: '<--------30 characters------->'
Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$--'
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as date) AS `CAST(my_char_30 AS DATE)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 date) AS `CAST(my_char_30 AS DATE)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 26 OR select_id IS NULL) order by id;
@@ -4652,8 +4534,8 @@ NULL NULL 1
2000 2000 4
2005 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as char charset latin1) AS `CAST(my_year AS CHAR)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as char charset latin1) AS `CAST(my_year AS CHAR)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 25 OR select_id IS NULL) order by id;
@@ -4678,8 +4560,8 @@ NULL NULL 1
13:00:00 13:00:00 4
10:00:00 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as char charset latin1) AS `CAST(my_time AS CHAR)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as char charset latin1) AS `CAST(my_time AS CHAR)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 24 OR select_id IS NULL) order by id;
@@ -4704,8 +4586,8 @@ CAST(my_timestamp AS CHAR) my_timestamp id
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as char charset latin1) AS `CAST(my_timestamp AS CHAR)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as char charset latin1) AS `CAST(my_timestamp AS CHAR)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 23 OR select_id IS NULL) order by id;
@@ -4730,8 +4612,8 @@ NULL NULL 1
2004-02-29 2004-02-29 4
2005-06-28 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as char charset latin1) AS `CAST(my_date AS CHAR)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as char charset latin1) AS `CAST(my_date AS CHAR)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 22 OR select_id IS NULL) order by id;
@@ -4756,8 +4638,8 @@ NULL NULL 1
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as char charset latin1) AS `CAST(my_datetime AS CHAR)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as char charset latin1) AS `CAST(my_datetime AS CHAR)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 21 OR select_id IS NULL) order by id;
@@ -4782,8 +4664,8 @@ NULL NULL 1
0 0 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as char charset latin1) AS `CAST(my_double AS CHAR)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset latin1) AS `CAST(my_double AS CHAR)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 20 OR select_id IS NULL) order by id;
@@ -4808,8 +4690,8 @@ NULL NULL 1
0.000000000000000000000000000000 0.000000000000000000000000000000 4
-1.000000000000000000000000000000 -1.000000000000000000000000000000 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as char charset latin1) AS `CAST(my_decimal AS CHAR)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset latin1) AS `CAST(my_decimal AS CHAR)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 19 OR select_id IS NULL) order by id;
@@ -4834,8 +4716,8 @@ NULL NULL 1
0 0 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as char charset latin1) AS `CAST(my_bigint AS CHAR)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as char charset latin1) AS `CAST(my_bigint AS CHAR)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 18 OR select_id IS NULL) order by id;
@@ -4860,8 +4742,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as char charset latin1) AS `CAST(my_varbinary_1000 AS CHAR)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset latin1) AS `CAST(my_varbinary_1000 AS CHAR)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 17 OR select_id IS NULL) order by id;
@@ -4886,8 +4768,8 @@ NULL NULL 1
---äÖüß@µ*$--
-1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as char charset latin1) AS `CAST(my_binary_30 AS CHAR)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset latin1) AS `CAST(my_binary_30 AS CHAR)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 16 OR select_id IS NULL) order by id;
@@ -4912,8 +4794,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as char charset latin1) AS `CAST(my_varchar_1000 AS CHAR)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset latin1) AS `CAST(my_varchar_1000 AS CHAR)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 15 OR select_id IS NULL) order by id;
@@ -4938,8 +4820,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as char charset latin1) AS `CAST(my_char_30 AS CHAR)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset latin1) AS `CAST(my_char_30 AS CHAR)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 14 OR select_id IS NULL) order by id;
@@ -4964,8 +4846,8 @@ NULL NULL 1
2000 2000 4
2005 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as char charset binary) AS `CAST(my_year AS BINARY)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as char charset binary) AS `CAST(my_year AS BINARY)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 13 OR select_id IS NULL) order by id;
@@ -4990,8 +4872,8 @@ NULL NULL 1
13:00:00 13:00:00 4
10:00:00 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as char charset binary) AS `CAST(my_time AS BINARY)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as char charset binary) AS `CAST(my_time AS BINARY)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 12 OR select_id IS NULL) order by id;
@@ -5016,8 +4898,8 @@ CAST(my_timestamp AS BINARY) my_timestamp id
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as char charset binary) AS `CAST(my_timestamp AS BINARY)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as char charset binary) AS `CAST(my_timestamp AS BINARY)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 11 OR select_id IS NULL) order by id;
@@ -5042,8 +4924,8 @@ NULL NULL 1
2004-02-29 2004-02-29 4
2005-06-28 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as char charset binary) AS `CAST(my_date AS BINARY)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as char charset binary) AS `CAST(my_date AS BINARY)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 10 OR select_id IS NULL) order by id;
@@ -5068,8 +4950,8 @@ NULL NULL 1
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as char charset binary) AS `CAST(my_datetime AS BINARY)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as char charset binary) AS `CAST(my_datetime AS BINARY)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 9 OR select_id IS NULL) order by id;
@@ -5094,8 +4976,8 @@ NULL NULL 1
0 0 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as char charset binary) AS `CAST(my_double AS BINARY)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset binary) AS `CAST(my_double AS BINARY)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 8 OR select_id IS NULL) order by id;
@@ -5120,8 +5002,8 @@ NULL NULL 1
0.000000000000000000000000000000 0.000000000000000000000000000000 4
-1.000000000000000000000000000000 -1.000000000000000000000000000000 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as char charset binary) AS `CAST(my_decimal AS BINARY)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset binary) AS `CAST(my_decimal AS BINARY)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 7 OR select_id IS NULL) order by id;
@@ -5146,8 +5028,8 @@ NULL NULL 1
0 0 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as char charset binary) AS `CAST(my_bigint AS BINARY)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as char charset binary) AS `CAST(my_bigint AS BINARY)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 6 OR select_id IS NULL) order by id;
@@ -5172,8 +5054,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as char charset binary) AS `CAST(my_varbinary_1000 AS BINARY)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset binary) AS `CAST(my_varbinary_1000 AS BINARY)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 5 OR select_id IS NULL) order by id;
@@ -5198,8 +5080,8 @@ NULL NULL 1
---äÖüß@µ*$--
-1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as char charset binary) AS `CAST(my_binary_30 AS BINARY)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset binary) AS `CAST(my_binary_30 AS BINARY)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 4 OR select_id IS NULL) order by id;
@@ -5224,8 +5106,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as char charset binary) AS `CAST(my_varchar_1000 AS BINARY)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset binary) AS `CAST(my_varchar_1000 AS BINARY)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 3 OR select_id IS NULL) order by id;
@@ -5250,8 +5132,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as char charset binary) AS `CAST(my_char_30 AS BINARY)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset binary) AS `CAST(my_char_30 AS BINARY)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 2 OR select_id IS NULL) order by id;
@@ -5276,8 +5158,8 @@ NULL -1 5
2 4 6
NULL -25 7
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sqrt(`t1_values`.`my_bigint`) AS `sqrt(my_bigint)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sqrt(`t1_values`.`my_bigint`) AS `sqrt(my_bigint)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 1 OR select_id IS NULL) order by id;
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 60ea7393c73..60ea7393c73 100644..100755
--- a/mysql-test/suite/funcs_1/r/innodb_storedproc_02.result
+++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_02.result
diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc_03.result b/mysql-test/suite/funcs_1/r/innodb_storedproc_03.result
index fe400ceeb6d..fe400ceeb6d 100644..100755
--- a/mysql-test/suite/funcs_1/r/innodb_storedproc_03.result
+++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_03.result
diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result b/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result
index ce3a882000b..689ff606bd9 100644
--- a/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result
+++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result
@@ -81,6 +81,7 @@ BEGIN
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
END//
ERROR 42000: Access denied for user 'user_1'@'localhost' to database 'db_storedproc_1'
+USE db_storedproc_1;
root@localhost db_storedproc_1
GRANT CREATE ROUTINE ON db_storedproc_1.* TO 'user_1'@'localhost';
@@ -92,6 +93,7 @@ CREATE PROCEDURE sp1(v1 char(20))
BEGIN
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
END//
+USE db_storedproc_1;
root@localhost db_storedproc_1
DROP USER 'user_1'@'localhost';
@@ -117,6 +119,7 @@ CREATE FUNCTION fn1(v1 int) returns int
BEGIN
return v1;
END//
+USE db_storedproc_1;
root@localhost db_storedproc_1
drop user 'user_1'@'localhost';
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 cbe20882ec2..7d522bb48d1 100644..100755
--- a/mysql-test/suite/funcs_1/r/innodb_storedproc_07.result
+++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_07.result
@@ -90,7 +90,7 @@ INSERT INTO result VALUES (@cur_val_sql_mode, 'value not restored');
END if;
END//
SHOW CREATE PROCEDURE sp1;
-Procedure sql_mode Create Procedure
+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`()
BEGIN
declare a tinyint;
@@ -104,7 +104,7 @@ INSERT INTO result VALUES (@cur_val_sql_mode, 'value restored');
ELSE
INSERT INTO result VALUES (@cur_val_sql_mode, 'value not restored');
END if;
-END
+END latin1 latin1_swedish_ci latin1_swedish_ci
set @@sql_mode='';
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
@@ -143,12 +143,12 @@ SET @@sql_mode='MAXDB';
SHOW VARIABLES LIKE 'sql_mode';
END//
SHOW CREATE PROCEDURE sp2;
-Procedure sql_mode Create Procedure
+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`()
BEGIN
SET @@sql_mode='MAXDB';
SHOW VARIABLES LIKE 'sql_mode';
-END
+END latin1 latin1_swedish_ci latin1_swedish_ci
... show value prior calling procedure
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
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 91a3a954f57..e4ae77f4da3 100644..100755
--- a/mysql-test/suite/funcs_1/r/innodb_storedproc_08.result
+++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_08.result
@@ -122,6 +122,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -146,6 +149,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT created with INVOKER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -168,6 +174,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -190,6 +199,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT created with INVOKER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode
@@ -199,6 +211,9 @@ set @x=i1;
set @y=@x;
return i4;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE FUNCTION fn_2;
Function fn_2
sql_mode
@@ -210,6 +225,9 @@ set @x=i1;
set @y=@x;
return i4;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_1;
Procedure sp_1
sql_mode
@@ -217,6 +235,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_1`(i1 int)
BEGIN
set @x=i1;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_2;
Procedure sp_2
sql_mode
@@ -226,6 +247,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
BEGIN
set @x=i1;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW FUNCTION STATUS LIKE 'fn_%';
Db db_storedproc
Name fn_1
@@ -235,6 +259,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
Db db_storedproc
Name fn_2
Type FUNCTION
@@ -243,6 +270,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment created with INVOKER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW PROCEDURE STATUS LIKE 'sp_%';
Db db_storedproc
Name sp_1
@@ -252,6 +282,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
Db db_storedproc
Name sp_2
Type PROCEDURE
@@ -260,6 +293,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment created with INVOKER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
... now change some stuff:
--------------------------
@@ -304,6 +340,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT new comment, FN changed to INVOKER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -328,6 +367,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT FN changed to DEFINER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -350,6 +392,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT new comment, SP changed to INVOKER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -372,6 +417,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT SP changed to DEFINER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode
@@ -384,6 +432,9 @@ set @x=i1;
set @y=@x;
return i4;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE FUNCTION fn_2;
Function fn_2
sql_mode
@@ -395,6 +446,9 @@ set @x=i1;
set @y=@x;
return i4;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_1;
Procedure sp_1
sql_mode
@@ -404,6 +458,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_1`(i1 int)
BEGIN
set @x=i1;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_2;
Procedure sp_2
sql_mode
@@ -413,6 +470,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
BEGIN
set @x=i1;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW FUNCTION STATUS LIKE 'fn_%';
Db db_storedproc
Name fn_1
@@ -422,6 +482,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment new comment, FN changed to INVOKER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
Db db_storedproc
Name fn_2
Type FUNCTION
@@ -430,6 +493,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment FN changed to DEFINER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW PROCEDURE STATUS LIKE 'sp_%';
Db db_storedproc
Name sp_1
@@ -439,6 +505,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment new comment, SP changed to INVOKER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
Db db_storedproc
Name sp_2
Type PROCEDURE
@@ -447,6 +516,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment SP changed to DEFINER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
... change back to default and check result:
--------------------------------------------
@@ -479,6 +551,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT new comment, FN changed to INVOKER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -503,6 +578,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT FN changed to DEFINER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -525,6 +603,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT new comment, SP changed to INVOKER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -547,6 +628,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT SP changed to DEFINER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode
@@ -559,6 +643,9 @@ set @x=i1;
set @y=@x;
return i4;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE FUNCTION fn_2;
Function fn_2
sql_mode
@@ -569,6 +656,9 @@ set @x=i1;
set @y=@x;
return i4;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_1;
Procedure sp_1
sql_mode
@@ -578,6 +668,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_1`(i1 int)
BEGIN
set @x=i1;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_2;
Procedure sp_2
sql_mode
@@ -587,6 +680,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
BEGIN
set @x=i1;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW FUNCTION STATUS LIKE 'fn_%';
Db db_storedproc
Name fn_1
@@ -596,6 +692,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment new comment, FN changed to INVOKER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
Db db_storedproc
Name fn_2
Type FUNCTION
@@ -604,6 +703,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment FN changed to DEFINER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW PROCEDURE STATUS LIKE 'sp_%';
Db db_storedproc
Name sp_1
@@ -613,6 +715,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment new comment, SP changed to INVOKER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
Db db_storedproc
Name sp_2
Type PROCEDURE
@@ -621,6 +726,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment SP changed to DEFINER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
... cleanup
-----------
diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc_10.result b/mysql-test/suite/funcs_1/r/innodb_storedproc_10.result
index 5bb5b3cbbc2..84ef164b0dc 100644..100755
--- a/mysql-test/suite/funcs_1/r/innodb_storedproc_10.result
+++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_10.result
@@ -58,7 +58,6 @@ load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11;
Section 3.1.10 - CALL checks:
--------------------------------------------------------------------------------
-USE db_storedproc;
Testcase 3.1.10.2 + 3.1.10.5:
-----------------------------
@@ -95,6 +94,7 @@ CALL sp31102();
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102'
SELECT fn31105( 9 );
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105'
+USE db_storedproc;
root@localhost db_storedproc
CALL sp31102();
@@ -114,6 +114,7 @@ a` a` 1000-01-01 -5000 a` -5000
SELECT fn31105( 9 );
fn31105( 9 )
81
+USE db_storedproc;
root@localhost db_storedproc
REVOKE EXECUTE ON db_storedproc.* FROM 'user_2'@'localhost';
@@ -131,6 +132,7 @@ CALL sp31102();
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102'
SELECT fn31105( 9 );
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105'
+USE db_storedproc;
root@localhost db_storedproc
DROP PROCEDURE sp31102;
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_0102.result b/mysql-test/suite/funcs_1/r/innodb_trig_0102.result
index 02a82db0901..5a4b179144f 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_0102.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_0102.result
@@ -242,7 +242,7 @@ create table t1 (f1 integer) engine = innodb;
use test;
CREATE TRIGGER trig_db.trg6_2 AFTER INSERT on tb3
for each row set @ret_trg6_2 = 5;
-ERROR HY000: Trigger in wrong schema
+ERROR 42S02: Table 'trig_db.tb3' doesn't exist
use trig_db;
CREATE TRIGGER trg6_3 AFTER INSERT on test.tb3
for each row set @ret_trg6_3 = 18;
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 460eb49cfe5..0ccb27b9a48 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_03e.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_03e.result
@@ -263,7 +263,7 @@ select current_user;
current_user
root@localhost
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
grant select, insert, update on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
@@ -296,7 +296,7 @@ select current_user;
current_user
root@localhost
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
show tables;
Tables_in_priv_db
t1
@@ -317,7 +317,7 @@ select current_user;
current_user
test_yesprivs@localhost
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 1_2-yes';
select current_user;
@@ -453,9 +453,9 @@ ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for tabl
create trigger trg1_4 before UPDATE on t1 for each row
set new.f1 = 'trig 1_4-yes';
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
-trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL test_yesprivs@localhost
-trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL test_yesprivs@localhost
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
select current_user;
current_user
test_noprivs@localhost
@@ -570,11 +570,11 @@ current_user
test_yesprivs@localhost
use priv_db;
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
-trg1_1 INSERT t1 set new.f1 = 'trig 1_1-yes' BEFORE NULL test_yesprivs@localhost
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+trg1_1 INSERT t1 set new.f1 = 'trig 1_1-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
select * from information_schema.triggers;
-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
-NULL priv_db trg1_1 INSERT NULL priv_db t1 0 NULL set new.f1 = 'trig 1_1-yes' ROW BEFORE NULL NULL OLD NEW NULL test_yesprivs@localhost
+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 priv_db trg1_1 INSERT NULL priv_db t1 0 NULL set new.f1 = 'trig 1_1-yes' ROW BEFORE NULL NULL OLD NEW NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
drop trigger trg1_1;
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
select current_user;
@@ -863,7 +863,7 @@ select current_user;
current_user
root@localhost
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
grant TRIGGER on priv1_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
@@ -878,7 +878,7 @@ select current_user;
current_user
test_yesprivs@localhost
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 1_2-yes';
create trigger trg2_1 before INSERT on t2 for each row
@@ -990,7 +990,7 @@ select current_user;
current_user
root@localhost
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
grant select, insert, update ,trigger
on priv_db.t1 to test_yesprivs@localhost
with grant option;
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_08.result b/mysql-test/suite/funcs_1/r/innodb_trig_08.result
index 44d53923241..4388950aba1 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_08.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_08.result
@@ -492,9 +492,8 @@ BEGIN
WHILE @counter1 < new.f136
SET @counter1 = @counter1 + 1;
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 'WHILE @counter1 < new.f136
-SET @counter1 = @counter1 + 1;
-END' at line 3
+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 'SET @counter1 = @counter1 + 1;
+END' at line 4
delete from tb3 where f122='Test 3.5.8.5-while';
drop trigger trg7;
diff --git a/mysql-test/suite/funcs_1/r/innodb_views.result b/mysql-test/suite/funcs_1/r/innodb_views.result
index be0f36f49be..48a97f80b14 100644
--- a/mysql-test/suite/funcs_1/r/innodb_views.result
+++ b/mysql-test/suite/funcs_1/r/innodb_views.result
@@ -184,47 +184,47 @@ Insert into t1 values (500,9866);
Drop view if exists v1 ;
CREATE VIEW v1 AS select f59,f60,f61
FROM test.tb2 where f59=250;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f60,f61 limit 0,10;
f59 f60 f61
250 87895654 NULL
Drop view if exists v1 ;
CREATE VIEW v1 AS select f59,f60,f61
FROM test.tb2 limit 100;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59,f60,f61 limit 0,10;
f59 f60 f61
1 1 0000000001
2 2 0000000002
3 3 0000000003
4 4 0000000004
+4 74 NULL
5 5 0000000005
6 6 0000000006
7 7 0000000007
8 8 0000000008
9 9 0000000009
-10 10 0000000010
CREATE or REPLACE VIEW v1 AS select f59,f60,f61
FROM test.tb2 limit 4,3;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59,f60,f61 limit 0,10;
f59 f60 f61
5 5 0000000005
6 6 0000000006
7 7 0000000007
CREATE or REPLACE VIEW v1 AS select distinct f59
FROM test.tb2 limit 4,3;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
5
6
7
ALTER VIEW v1 AS select f59
FROM test.tb2 limit 6,2;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
7
8
CREATE or REPLACE VIEW v1 AS select f59
from tb2 order by f59 limit 100;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
1
2
@@ -266,7 +266,7 @@ f59
660
CREATE or REPLACE VIEW v1 AS select f59
from tb2 group by f59 limit 100;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
1
2
@@ -280,7 +280,7 @@ f59
10
CREATE or REPLACE VIEW v1 AS select f59
from tb2 group by f59 asc limit 100;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
1
2
@@ -294,21 +294,21 @@ f59
10
CREATE or REPLACE VIEW v1 AS select f59
from tb2 group by f59 desc limit 100;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
-569300
-76710
-9112
-7876
-3410
-3330
-2760
-2550
-987
-660
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
CREATE or REPLACE VIEW v1 AS (select f59 from tb2)
union (select f59 from t1) limit 100;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
1
2
@@ -322,7 +322,7 @@ f59
10
CREATE or REPLACE VIEW v1 AS (select f59 FROM tb2)
UNION DISTINCT(select f59 FROM t1) ;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
1
2
@@ -336,103 +336,103 @@ f59
10
CREATE or REPLACE VIEW v1 AS (select f59 FROM tb2)
UNION ALL(select f59 FROM t1) ;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
1
2
3
4
+4
5
6
7
8
9
-10
CREATE or REPLACE VIEW v1 AS select *
FROM test.tb2 WITH LOCAL CHECK OPTION ;
-select * FROM v1 limit 0,50;
+select * FROM v1 order by f59,f60,f61,f62,f63,f64 limit 0,50;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
1 1 0000000001 0000000000000000000000000000000000000000000000000000000000000001 0000000001 0000000000000000000000000000000000000000000000000000000000000001 -5 0.000000000000000000000000000000 1 0.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549435e-38 1.17549e-38 1.175494352e-38 01.17549e-38 00000001.175494352e-38 01.17549e-38 00000001.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 1970-01-02 00:00:01 1902 1902 1902 2enum 2set
2 2 0000000002 0000000000000000000000000000000000000000000000000000000000000002 0000000002 0000000000000000000000000000000000000000000000000000000000000002 -4 1.100000000000000000000000000000 2 1.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494349e-38 1.17549e-38 1.175494353e-38 01.17549e-38 00000001.175494353e-38 01.17549e-38 00000001.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 1970-01-03 00:00:02 1903 1903 1903 1enum 1set,2set
3 3 0000000003 0000000000000000000000000000000000000000000000000000000000000003 0000000003 0000000000000000000000000000000000000000000000000000000000000003 -3 2.200000000000000000000000000000 3 2.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494348e-38 1.17549e-38 1.175494354e-38 01.17549e-38 00000001.175494354e-38 01.17549e-38 00000001.175494354e-38 1000-01-03 838:59:56 1970-01-04 00:00:03 1970-01-04 00:00:03 1904 1904 1904 2enum 1set
4 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
+4 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
5 5 0000000005 0000000000000000000000000000000000000000000000000000000000000005 0000000005 0000000000000000000000000000000000000000000000000000000000000005 -1 4.400000000000000000000000000000 5 4.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494346e-38 1.17549e-38 1.175494356e-38 01.17549e-38 00000001.175494356e-38 01.17549e-38 00000001.175494356e-38 1000-01-05 838:59:54 1970-01-06 00:00:05 1970-01-06 00:00:05 1906 1906 1906 2enum 1set,2set
6 6 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0 5.500000000000000000000000000000 6 5.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494345e-38 1.17549e-38 1.175494357e-38 01.17549e-38 00000001.175494357e-38 01.17549e-38 00000001.175494357e-38 1000-01-06 838:59:53 1970-01-07 00:00:06 1970-01-07 00:00:06 1907 1907 1907 1enum 1set
7 7 0000000007 0000000000000000000000000000000000000000000000000000000000000007 0000000007 0000000000000000000000000000000000000000000000000000000000000007 1 6.600000000000000000000000000000 7 6.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494344e-38 1.17549e-38 1.175494358e-38 01.17549e-38 00000001.175494358e-38 01.17549e-38 00000001.175494358e-38 1000-01-07 838:59:52 1970-01-08 00:00:07 1970-01-08 00:00:07 1908 1908 1908 2enum 2set
8 8 0000000008 0000000000000000000000000000000000000000000000000000000000000008 0000000008 0000000000000000000000000000000000000000000000000000000000000008 2 7.700000000000000000000000000000 8 7.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494343e-38 1.17549e-38 1.175494359e-38 01.17549e-38 00000001.175494359e-38 01.17549e-38 00000001.175494359e-38 1000-01-08 838:59:51 1970-01-09 00:00:08 1970-01-09 00:00:08 1909 1909 1909 1enum 1set,2set
9 9 0000000009 0000000000000000000000000000000000000000000000000000000000000009 0000000009 0000000000000000000000000000000000000000000000000000000000000009 3 8.800000000000000000000000000000 9 8.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494342e-38 1.17549e-38 1.17549436e-38 01.17549e-38 000000001.17549436e-38 01.17549e-38 000000001.17549436e-38 1000-01-09 838:59:50 1970-01-10 00:00:09 1970-01-10 00:00:09 1910 1910 1910 2enum 1set
10 10 0000000010 0000000000000000000000000000000000000000000000000000000000000010 0000000010 0000000000000000000000000000000000000000000000000000000000000010 4 9.900000000000000000000000000000 10 9.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494341e-38 1.17549e-38 1.175494361e-38 01.17549e-38 00000001.175494361e-38 01.17549e-38 00000001.175494361e-38 1000-01-10 838:59:49 1970-01-11 00:00:10 1970-01-11 00:00:10 1911 1911 1911 1enum 2set
-76710 226546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-2760 985654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-569300 9114376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-660 876546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-250 87895654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-340 9984376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-3410 996546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-2550 775654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-3330 764376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-441 16546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-24 51654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-323 14376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-34 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-4 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
15 87 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+17 15 0000000016 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+19 18 0000000014 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
22 93 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-394 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+24 51654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+27 25 0000000026 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+29 28 0000000024 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+34 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
94 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-195 87 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-292 93 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-987 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-7876 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-321 NULL 0000000765 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-9112 NULL 0000008771 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
107 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+107 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+109 108 0000000104 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
109 108 0000000104 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+195 87 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
207 205 0000000206 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
209 208 0000000204 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-27 25 0000000026 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-29 28 0000000024 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-17 15 0000000016 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-19 18 0000000014 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-107 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-109 108 0000000104 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-299 899 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
242 79 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+250 87895654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+292 93 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+299 899 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+321 NULL 0000000765 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+323 14376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+340 9984376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+394 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
424 89 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+441 16546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+660 876546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+987 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+2550 775654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+2760 985654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+3330 764376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+3410 996546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+7876 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+9112 NULL 0000008771 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+76710 226546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+569300 9114376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
CREATE or REPLACE VIEW v1 AS select *
FROM test.tb2 WITH CASCADED CHECK OPTION ;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59,f60,f61,f62,f63,f64 limit 0,10;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
1 1 0000000001 0000000000000000000000000000000000000000000000000000000000000001 0000000001 0000000000000000000000000000000000000000000000000000000000000001 -5 0.000000000000000000000000000000 1 0.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549435e-38 1.17549e-38 1.175494352e-38 01.17549e-38 00000001.175494352e-38 01.17549e-38 00000001.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 1970-01-02 00:00:01 1902 1902 1902 2enum 2set
2 2 0000000002 0000000000000000000000000000000000000000000000000000000000000002 0000000002 0000000000000000000000000000000000000000000000000000000000000002 -4 1.100000000000000000000000000000 2 1.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494349e-38 1.17549e-38 1.175494353e-38 01.17549e-38 00000001.175494353e-38 01.17549e-38 00000001.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 1970-01-03 00:00:02 1903 1903 1903 1enum 1set,2set
3 3 0000000003 0000000000000000000000000000000000000000000000000000000000000003 0000000003 0000000000000000000000000000000000000000000000000000000000000003 -3 2.200000000000000000000000000000 3 2.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494348e-38 1.17549e-38 1.175494354e-38 01.17549e-38 00000001.175494354e-38 01.17549e-38 00000001.175494354e-38 1000-01-03 838:59:56 1970-01-04 00:00:03 1970-01-04 00:00:03 1904 1904 1904 2enum 1set
4 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
+4 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
5 5 0000000005 0000000000000000000000000000000000000000000000000000000000000005 0000000005 0000000000000000000000000000000000000000000000000000000000000005 -1 4.400000000000000000000000000000 5 4.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494346e-38 1.17549e-38 1.175494356e-38 01.17549e-38 00000001.175494356e-38 01.17549e-38 00000001.175494356e-38 1000-01-05 838:59:54 1970-01-06 00:00:05 1970-01-06 00:00:05 1906 1906 1906 2enum 1set,2set
6 6 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0 5.500000000000000000000000000000 6 5.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494345e-38 1.17549e-38 1.175494357e-38 01.17549e-38 00000001.175494357e-38 01.17549e-38 00000001.175494357e-38 1000-01-06 838:59:53 1970-01-07 00:00:06 1970-01-07 00:00:06 1907 1907 1907 1enum 1set
7 7 0000000007 0000000000000000000000000000000000000000000000000000000000000007 0000000007 0000000000000000000000000000000000000000000000000000000000000007 1 6.600000000000000000000000000000 7 6.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494344e-38 1.17549e-38 1.175494358e-38 01.17549e-38 00000001.175494358e-38 01.17549e-38 00000001.175494358e-38 1000-01-07 838:59:52 1970-01-08 00:00:07 1970-01-08 00:00:07 1908 1908 1908 2enum 2set
8 8 0000000008 0000000000000000000000000000000000000000000000000000000000000008 0000000008 0000000000000000000000000000000000000000000000000000000000000008 2 7.700000000000000000000000000000 8 7.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494343e-38 1.17549e-38 1.175494359e-38 01.17549e-38 00000001.175494359e-38 01.17549e-38 00000001.175494359e-38 1000-01-08 838:59:51 1970-01-09 00:00:08 1970-01-09 00:00:08 1909 1909 1909 1enum 1set,2set
9 9 0000000009 0000000000000000000000000000000000000000000000000000000000000009 0000000009 0000000000000000000000000000000000000000000000000000000000000009 3 8.800000000000000000000000000000 9 8.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494342e-38 1.17549e-38 1.17549436e-38 01.17549e-38 000000001.17549436e-38 01.17549e-38 000000001.17549436e-38 1000-01-09 838:59:50 1970-01-10 00:00:09 1970-01-10 00:00:09 1910 1910 1910 2enum 1set
-10 10 0000000010 0000000000000000000000000000000000000000000000000000000000000010 0000000010 0000000000000000000000000000000000000000000000000000000000000010 4 9.900000000000000000000000000000 10 9.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494341e-38 1.17549e-38 1.175494361e-38 01.17549e-38 00000001.175494361e-38 01.17549e-38 00000001.175494361e-38 1000-01-10 838:59:49 1970-01-11 00:00:10 1970-01-11 00:00:10 1911 1911 1911 1enum 2set
CREATE OR REPLACE VIEW v1 AS SELECT F59, F60
FROM test.tb2 WITH CASCADED CHECK OPTION;
-SELECT * FROM v1 limit 0,10;
+SELECT * FROM v1 order by f59,f60 limit 0,10;
F59 F60
1 1
2 2
3 3
4 4
+4 74
5 5
6 6
7 7
8 8
9 9
-10 10
CREATE or REPLACE VIEW v1 AS select f59, f60
from test.tb2 where f59=3330 ;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f60 limit 0,10;
f59 f60
3330 764376
DROP VIEW v1 ;
@@ -863,73 +863,73 @@ CREATE TABLE t1 (f1 BIGINT);
INSERT INTO t1 VALUES(1);
CREATE VIEW test.v1 AS SELECT * FROM t1 limit 2;
SHOW CREATE VIEW test.v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` limit 2
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` limit 2 latin1 latin1_swedish_ci
SELECT * FROM test.v1;
f1
1
CREATE OR REPLACE ALGORITHM = TEMPTABLE VIEW test.v1
AS SELECT * FROM t1 limit 2;
SHOW CREATE VIEW test.v1;
-View Create View
-v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` limit 2
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` limit 2 latin1 latin1_swedish_ci
SELECT * FROM test.v1;
f1
1
-CREATE OR REPLACE VIEW test.v1 AS SELECT * FROM tb2 limit 2;
+CREATE OR REPLACE VIEW test.v1 AS SELECT * FROM tb2 order by f59 limit 2;
SHOW CREATE VIEW test.v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `tb2`.`f59` AS `f59`,`tb2`.`f60` AS `f60`,`tb2`.`f61` AS `f61`,`tb2`.`f62` AS `f62`,`tb2`.`f63` AS `f63`,`tb2`.`f64` AS `f64`,`tb2`.`f65` AS `f65`,`tb2`.`f66` AS `f66`,`tb2`.`f67` AS `f67`,`tb2`.`f68` AS `f68`,`tb2`.`f69` AS `f69`,`tb2`.`f70` AS `f70`,`tb2`.`f71` AS `f71`,`tb2`.`f72` AS `f72`,`tb2`.`f73` AS `f73`,`tb2`.`f74` AS `f74`,`tb2`.`f75` AS `f75`,`tb2`.`f76` AS `f76`,`tb2`.`f77` AS `f77`,`tb2`.`f78` AS `f78`,`tb2`.`f79` AS `f79`,`tb2`.`f80` AS `f80`,`tb2`.`f81` AS `f81`,`tb2`.`f82` AS `f82`,`tb2`.`f83` AS `f83`,`tb2`.`f84` AS `f84`,`tb2`.`f85` AS `f85`,`tb2`.`f86` AS `f86`,`tb2`.`f87` AS `f87`,`tb2`.`f88` AS `f88`,`tb2`.`f89` AS `f89`,`tb2`.`f90` AS `f90`,`tb2`.`f91` AS `f91`,`tb2`.`f92` AS `f92`,`tb2`.`f93` AS `f93`,`tb2`.`f94` AS `f94`,`tb2`.`f95` AS `f95`,`tb2`.`f96` AS `f96`,`tb2`.`f97` AS `f97`,`tb2`.`f98` AS `f98`,`tb2`.`f99` AS `f99`,`tb2`.`f100` AS `f100`,`tb2`.`f101` AS `f101`,`tb2`.`f102` AS `f102`,`tb2`.`f103` AS `f103`,`tb2`.`f104` AS `f104`,`tb2`.`f105` AS `f105`,`tb2`.`f106` AS `f106`,`tb2`.`f107` AS `f107`,`tb2`.`f108` AS `f108`,`tb2`.`f109` AS `f109` from `tb2` limit 2
-SELECT * FROM test.v1 ;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `tb2`.`f59` AS `f59`,`tb2`.`f60` AS `f60`,`tb2`.`f61` AS `f61`,`tb2`.`f62` AS `f62`,`tb2`.`f63` AS `f63`,`tb2`.`f64` AS `f64`,`tb2`.`f65` AS `f65`,`tb2`.`f66` AS `f66`,`tb2`.`f67` AS `f67`,`tb2`.`f68` AS `f68`,`tb2`.`f69` AS `f69`,`tb2`.`f70` AS `f70`,`tb2`.`f71` AS `f71`,`tb2`.`f72` AS `f72`,`tb2`.`f73` AS `f73`,`tb2`.`f74` AS `f74`,`tb2`.`f75` AS `f75`,`tb2`.`f76` AS `f76`,`tb2`.`f77` AS `f77`,`tb2`.`f78` AS `f78`,`tb2`.`f79` AS `f79`,`tb2`.`f80` AS `f80`,`tb2`.`f81` AS `f81`,`tb2`.`f82` AS `f82`,`tb2`.`f83` AS `f83`,`tb2`.`f84` AS `f84`,`tb2`.`f85` AS `f85`,`tb2`.`f86` AS `f86`,`tb2`.`f87` AS `f87`,`tb2`.`f88` AS `f88`,`tb2`.`f89` AS `f89`,`tb2`.`f90` AS `f90`,`tb2`.`f91` AS `f91`,`tb2`.`f92` AS `f92`,`tb2`.`f93` AS `f93`,`tb2`.`f94` AS `f94`,`tb2`.`f95` AS `f95`,`tb2`.`f96` AS `f96`,`tb2`.`f97` AS `f97`,`tb2`.`f98` AS `f98`,`tb2`.`f99` AS `f99`,`tb2`.`f100` AS `f100`,`tb2`.`f101` AS `f101`,`tb2`.`f102` AS `f102`,`tb2`.`f103` AS `f103`,`tb2`.`f104` AS `f104`,`tb2`.`f105` AS `f105`,`tb2`.`f106` AS `f106`,`tb2`.`f107` AS `f107`,`tb2`.`f108` AS `f108`,`tb2`.`f109` AS `f109` from `tb2` order by `tb2`.`f59` limit 2 latin1 latin1_swedish_ci
+SELECT * FROM test.v1 order by f59,f60,f61,f62,f63,f64,f65;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
1 1 0000000001 0000000000000000000000000000000000000000000000000000000000000001 0000000001 0000000000000000000000000000000000000000000000000000000000000001 -5 0.000000000000000000000000000000 1 0.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549435e-38 1.17549e-38 1.175494352e-38 01.17549e-38 00000001.175494352e-38 01.17549e-38 00000001.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 1970-01-02 00:00:01 1902 1902 1902 2enum 2set
2 2 0000000002 0000000000000000000000000000000000000000000000000000000000000002 0000000002 0000000000000000000000000000000000000000000000000000000000000002 -4 1.100000000000000000000000000000 2 1.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494349e-38 1.17549e-38 1.175494353e-38 01.17549e-38 00000001.175494353e-38 01.17549e-38 00000001.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 1970-01-03 00:00:02 1903 1903 1903 1enum 1set,2set
CREATE OR REPLACE VIEW test.v1 AS SELECT F59 FROM tb2 limit 10,100;
SHOW CREATE VIEW test.v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `tb2`.`f59` AS `F59` from `tb2` limit 10,100
-SELECT * FROM test.v1;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `tb2`.`f59` AS `F59` from `tb2` limit 10,100 latin1 latin1_swedish_ci
+SELECT * FROM test.v1 order by F59;
F59
-76710
-2760
-569300
-660
-250
-340
-3410
-2550
-3330
-441
-24
-323
-34
4
15
+17
+19
22
-394
+24
+27
+29
+34
94
-195
-292
-987
-7876
-321
-9112
-500
-500
-500
+107
107
109
+109
+195
207
209
-27
-29
-17
-19
-107
-109
-299
242
+250
+292
+299
+321
+323
+340
+394
424
+441
+500
+500
+500
+660
+987
+2550
+2760
+3330
+3410
+7876
+9112
+76710
+569300
Drop table test.t1 ;
Drop view test.v1 ;
@@ -965,38 +965,38 @@ CREATE TABLE t1 (f1 NUMERIC(15,3));
INSERT INTO t1 VALUES(8.8);
CREATE VIEW v1 AS SELECT * FROM t1;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
f1
8.800
CREATE OR REPLACE VIEW v1 AS SELECT f1 FROM t1;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
f1
8.800
CREATE OR REPLACE VIEW v1 AS SELECT f1 As my_column FROM t1;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `my_column` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `my_column` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
my_column
8.800
CREATE OR REPLACE VIEW v1(column1,column2)
AS SELECT f1 As my_column, f1 FROM t1;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `column1`,`t1`.`f1` AS `column2` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `column1`,`t1`.`f1` AS `column2` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
column1 column2
8.800 8.800
CREATE OR REPLACE VIEW test.v1(column1,column2)
AS SELECT f1 As my_column, f1 FROM test.t1;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `column1`,`t1`.`f1` AS `column2` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `column1`,`t1`.`f1` AS `column2` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
column1 column2
8.800 8.800
@@ -1081,7 +1081,7 @@ Testcase 3.3.1.21
--------------------------------------------------------------------------------
DROP VIEW IF EXISTS v1;
CREATE VIEW test.v1( F59, F60 ) AS SELECT F59, F60 From tb2 LIMIT 2;
-SELECT * FROM test.v1;
+SELECT * FROM test.v1 order by F59, F60 desc;
F59 F60
1 1
2 2
@@ -1190,7 +1190,7 @@ DROP VIEW IF EXISTS test.v1;
Drop VIEW IF EXISTS test.v1_1 ;
Create view test.v1 AS Select * from test.tb2 limit 2 ;
Create view test.v1_1 AS Select F59 from test.v1 ;
-Select * from test.v1_1 limit 20 ;
+Select * from test.v1_1 order by F59 limit 20 ;
F59
1
2
@@ -1204,58 +1204,58 @@ create database test2 ;
Create view test2.v2 AS Select * from test.tb2 limit 50,50;
use test2 ;
Create view v1 AS Select * from test.tb2 limit 50 ;
-Select * from v1 ;
+Select * from v1 order by f59,f60,f61,f62,f63,f64,f65;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
1 1 0000000001 0000000000000000000000000000000000000000000000000000000000000001 0000000001 0000000000000000000000000000000000000000000000000000000000000001 -5 0.000000000000000000000000000000 1 0.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549435e-38 1.17549e-38 1.175494352e-38 01.17549e-38 00000001.175494352e-38 01.17549e-38 00000001.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 1970-01-02 00:00:01 1902 1902 1902 2enum 2set
2 2 0000000002 0000000000000000000000000000000000000000000000000000000000000002 0000000002 0000000000000000000000000000000000000000000000000000000000000002 -4 1.100000000000000000000000000000 2 1.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494349e-38 1.17549e-38 1.175494353e-38 01.17549e-38 00000001.175494353e-38 01.17549e-38 00000001.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 1970-01-03 00:00:02 1903 1903 1903 1enum 1set,2set
3 3 0000000003 0000000000000000000000000000000000000000000000000000000000000003 0000000003 0000000000000000000000000000000000000000000000000000000000000003 -3 2.200000000000000000000000000000 3 2.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494348e-38 1.17549e-38 1.175494354e-38 01.17549e-38 00000001.175494354e-38 01.17549e-38 00000001.175494354e-38 1000-01-03 838:59:56 1970-01-04 00:00:03 1970-01-04 00:00:03 1904 1904 1904 2enum 1set
4 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
+4 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
5 5 0000000005 0000000000000000000000000000000000000000000000000000000000000005 0000000005 0000000000000000000000000000000000000000000000000000000000000005 -1 4.400000000000000000000000000000 5 4.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494346e-38 1.17549e-38 1.175494356e-38 01.17549e-38 00000001.175494356e-38 01.17549e-38 00000001.175494356e-38 1000-01-05 838:59:54 1970-01-06 00:00:05 1970-01-06 00:00:05 1906 1906 1906 2enum 1set,2set
6 6 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0 5.500000000000000000000000000000 6 5.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494345e-38 1.17549e-38 1.175494357e-38 01.17549e-38 00000001.175494357e-38 01.17549e-38 00000001.175494357e-38 1000-01-06 838:59:53 1970-01-07 00:00:06 1970-01-07 00:00:06 1907 1907 1907 1enum 1set
7 7 0000000007 0000000000000000000000000000000000000000000000000000000000000007 0000000007 0000000000000000000000000000000000000000000000000000000000000007 1 6.600000000000000000000000000000 7 6.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494344e-38 1.17549e-38 1.175494358e-38 01.17549e-38 00000001.175494358e-38 01.17549e-38 00000001.175494358e-38 1000-01-07 838:59:52 1970-01-08 00:00:07 1970-01-08 00:00:07 1908 1908 1908 2enum 2set
8 8 0000000008 0000000000000000000000000000000000000000000000000000000000000008 0000000008 0000000000000000000000000000000000000000000000000000000000000008 2 7.700000000000000000000000000000 8 7.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494343e-38 1.17549e-38 1.175494359e-38 01.17549e-38 00000001.175494359e-38 01.17549e-38 00000001.175494359e-38 1000-01-08 838:59:51 1970-01-09 00:00:08 1970-01-09 00:00:08 1909 1909 1909 1enum 1set,2set
9 9 0000000009 0000000000000000000000000000000000000000000000000000000000000009 0000000009 0000000000000000000000000000000000000000000000000000000000000009 3 8.800000000000000000000000000000 9 8.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494342e-38 1.17549e-38 1.17549436e-38 01.17549e-38 000000001.17549436e-38 01.17549e-38 000000001.17549436e-38 1000-01-09 838:59:50 1970-01-10 00:00:09 1970-01-10 00:00:09 1910 1910 1910 2enum 1set
10 10 0000000010 0000000000000000000000000000000000000000000000000000000000000010 0000000010 0000000000000000000000000000000000000000000000000000000000000010 4 9.900000000000000000000000000000 10 9.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494341e-38 1.17549e-38 1.175494361e-38 01.17549e-38 00000001.175494361e-38 01.17549e-38 00000001.175494361e-38 1000-01-10 838:59:49 1970-01-11 00:00:10 1970-01-11 00:00:10 1911 1911 1911 1enum 2set
-76710 226546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-2760 985654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-569300 9114376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-660 876546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-250 87895654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-340 9984376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-3410 996546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-2550 775654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-3330 764376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-441 16546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-24 51654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-323 14376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-34 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-4 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
15 87 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+17 15 0000000016 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+19 18 0000000014 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
22 93 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-394 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+24 51654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+27 25 0000000026 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+29 28 0000000024 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+34 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
94 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-195 87 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-292 93 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-987 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-7876 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-321 NULL 0000000765 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-9112 NULL 0000008771 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+107 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
107 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
109 108 0000000104 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+109 108 0000000104 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+195 87 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
207 205 0000000206 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
209 208 0000000204 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-27 25 0000000026 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-29 28 0000000024 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-17 15 0000000016 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-19 18 0000000014 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-107 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-109 108 0000000104 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-299 899 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
242 79 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+250 87895654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+292 93 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+299 899 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+321 NULL 0000000765 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+323 14376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+340 9984376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+394 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
424 89 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+441 16546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+660 876546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+987 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+2550 775654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+2760 985654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+3330 764376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+3410 996546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+7876 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+9112 NULL 0000008771 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+76710 226546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+569300 9114376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
Select * from test2.v2 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
Drop view if exists test2.v1 ;
@@ -1318,18 +1318,18 @@ CREATE VIEW test.v1
AS SELECT test.v1_firstview.f59, test.v1_firstview.f60
FROM test.v1_firstview INNER JOIN test.v1_secondview
ON test.v1_firstview.f59 = test.v1_secondview.f59 ;
-SELECT * FROM test.v1 limit 0,10;
+SELECT * FROM test.v1 order by f59,f60 limit 0,10;
f59 f60
1 1
2 2
3 3
4 4
+4 4
+4 74
4 74
5 5
6 6
7 7
-8 8
-9 9
Drop view if exists test.v1_firstview ;
Drop view if exists test.v1_secondview ;
Drop view if exists test.v1 ;
@@ -1347,18 +1347,18 @@ CREATE VIEW v1
AS SELECT test.v1_firstview.F59, test.v1_firstview.F60
FROM test.v1_firstview INNER JOIN test.v1_secondview
ON test.v1_firstview.f59 = test.v1_secondview.f59 ;
-SELECT * FROM v1 limit 0,10;
+SELECT * FROM v1 order by f59,f60 limit 0,10;
F59 F60
1 1
2 2
3 3
4 4
+4 4
+4 74
4 74
5 5
6 6
7 7
-8 8
-9 9
Drop view v1 ;
Drop view test.v1_firstview ;
Drop view test.v1_secondview ;
@@ -1373,18 +1373,18 @@ CREATE VIEW test.v1
AS SELECT test.v1_firstview.f59, test.v1_firstview.f60
FROM test.v1_firstview INNER JOIN test.tb2
ON test.v1_firstview.f59 = test.tb2.f59;
-SELECT * FROM test.v1 limit 0,10;
+SELECT * FROM test.v1 order by f59,f60 limit 0,10;
f59 f60
1 1
2 2
3 3
4 4
+4 4
+4 74
4 74
5 5
6 6
7 7
-8 8
-9 9
Drop view test.v1 ;
Drop view test.v1_firstview;
@@ -1397,18 +1397,18 @@ CREATE VIEW v1_firstview AS SELECT * FROM test.tb2 ;
CREATE VIEW v1
AS SELECT v1_firstview.f59, v1_firstview.f60
FROM v1_firstview INNER JOIN test.tb2 ON v1_firstview.f59 = test.tb2.f59 ;
-SELECT * FROM v1 limit 0,10;
+SELECT * FROM v1 order by f59,f60 limit 0,10;
f59 f60
1 1
2 2
3 3
4 4
+4 4
+4 74
4 74
5 5
6 6
7 7
-8 8
-9 9
Drop database test2 ;
Testcase 3.3.1.37
@@ -1420,18 +1420,18 @@ Drop view if exists test.v1_1 ;
Drop view if exists test.v1_1 ;
Drop view if exists test.v1_main ;
Create view test.v1 as Select f59, f60 FROM test.tb2;
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59,f60 limit 0,10;
f59 f60
1 1
2 2
3 3
4 4
+4 74
5 5
6 6
7 7
8 8
9 9
-10 10
Create table t1(f59 int, f60 int);
Insert into t1 values (90,507) ;
Create view v1_1 as Select f59,f60 from t1 ;
@@ -1441,18 +1441,18 @@ f59 f60
Create view v1_main
as SELECT test.tb2.f59 FROM test.tb2 JOIN test.v1
ON test.tb2.f59 = test.v1.f59;
-Select * from v1_main limit 0,10;
+Select * from v1_main order by f59 limit 0,10;
f59
1
2
3
4
4
+4
+4
5
6
7
-8
-9
Drop table t1;
Drop view test.v1 ;
Drop view test.v1_1 ;
@@ -1738,7 +1738,7 @@ Drop view if exists test.v1_main;
Drop view if exists test1.v1_1 ;
Drop database if exists test3 ;
Create view test.v1 as Select f59, f60 FROM test.tb2 limit 20 ;
-Select * from test.v1 ;
+Select * from test.v1 order by f59,f60;
f59 f60
1 1
2 2
@@ -1750,16 +1750,16 @@ f59 f60
8 8
9 9
10 10
-76710 226546
-2760 985654
-569300 9114376
-660 876546
250 87895654
340 9984376
-3410 996546
+441 16546
+660 876546
2550 775654
+2760 985654
3330 764376
-441 16546
+3410 996546
+76710 226546
+569300 9114376
Create table test1.t1 (f59 int,f60 int) ;
Insert into test1.t1 values (199,507) ;
Create view test1.v1_1 as Select f59,f60 from test1.t1 ;
@@ -1792,7 +1792,7 @@ Drop view if exists test.v1 ;
CREATE VIEW test.v1
AS Select f59 from (Select * FROM tb2 limit 20) tx ;
ERROR HY000: View's SELECT contains a subquery in the FROM clause
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by f59 ;
ERROR 42S02: Table 'test.v1' doesn't exist
Drop view if exists test.v1 ;
@@ -1873,7 +1873,7 @@ CREATE VIEW test.v1 AS SELECT * FROM test.tb2 where f59 = 04;
UPDATE test.v1 SET f59 = 30 where F59 = 04 ;
affected rows: 2
info: Rows matched: 2 Changed: 2 Warnings: 0
-SELECT * FROM test.v1 where f59 = 30 ;
+SELECT * FROM test.v1 where f59 = 30 order by f59;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
SELECT * FROM test.tb2 where f59 = 30 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
@@ -1886,7 +1886,7 @@ SELECT * FROM tb2 where f59 = 100 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
100 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
100 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by f59 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
drop view if exists test.v1 ;
Drop TABLE IF EXISTS test.t1 ;
@@ -1962,7 +1962,7 @@ CREATE VIEW test.v1 AS SELECT f59,f60
FROM test.tb2 where f59 = 195 WITH CHECK OPTION ;
UPDATE test.v1 SET f59 = 198 where f59=195 ;
ERROR HY000: CHECK OPTION failed 'test.v1'
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by f59 ;
f59 f60
195 87
drop view if exists test.v1 ;
@@ -1976,7 +1976,7 @@ FROM test.tb2 where F59 = 0987 WITH LOCAL CHECK OPTION ;
CREATE VIEW test.v2 as SELECT * FROM test.v1 ;
UPDATE test.v1 SET F59 = 919 where f59 = 0987 ;
ERROR HY000: CHECK OPTION failed 'test.v1'
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by f59 ;
f59 f60
987 41
UPDATE test.v2 SET F59 = 9879 where f59 = 919 ;
@@ -9671,115 +9671,115 @@ Testcase 3.3.1.50 - 3.3.1.53
--------------------------------------------------------------------------------
DROP VIEW IF EXISTS test.v1;
CREATE VIEW test.v1 AS SELECT * FROM test.tb2 limit 5 ;
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by f59 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
1 1 0000000001 0000000000000000000000000000000000000000000000000000000000000001 0000000001 0000000000000000000000000000000000000000000000000000000000000001 -5 0.000000000000000000000000000000 1 0.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549435e-38 1.17549e-38 1.175494352e-38 01.17549e-38 00000001.175494352e-38 01.17549e-38 00000001.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 1970-01-02 00:00:01 1902 1902 1902 2enum 2set
2 2 0000000002 0000000000000000000000000000000000000000000000000000000000000002 0000000002 0000000000000000000000000000000000000000000000000000000000000002 -4 1.100000000000000000000000000000 2 1.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494349e-38 1.17549e-38 1.175494353e-38 01.17549e-38 00000001.175494353e-38 01.17549e-38 00000001.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 1970-01-03 00:00:02 1903 1903 1903 1enum 1set,2set
3 3 0000000003 0000000000000000000000000000000000000000000000000000000000000003 0000000003 0000000000000000000000000000000000000000000000000000000000000003 -3 2.200000000000000000000000000000 3 2.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494348e-38 1.17549e-38 1.175494354e-38 01.17549e-38 00000001.175494354e-38 01.17549e-38 00000001.175494354e-38 1000-01-03 838:59:56 1970-01-04 00:00:03 1970-01-04 00:00:03 1904 1904 1904 2enum 1set
-100 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
5 5 0000000005 0000000000000000000000000000000000000000000000000000000000000005 0000000005 0000000000000000000000000000000000000000000000000000000000000005 -1 4.400000000000000000000000000000 5 4.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494346e-38 1.17549e-38 1.175494356e-38 01.17549e-38 00000001.175494356e-38 01.17549e-38 00000001.175494356e-38 1000-01-05 838:59:54 1970-01-06 00:00:05 1970-01-06 00:00:05 1906 1906 1906 2enum 1set,2set
+100 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
drop view test.v1 ;
CREATE VIEW test.v1 AS SELECT F59,F61 FROM test.tb2 limit 50 ;
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by F59, F61 ;
F59 F61
1 0000000001
2 0000000002
3 0000000003
-100 0000000004
5 0000000005
6 0000000006
7 0000000007
8 0000000008
9 0000000009
10 0000000010
-76710 NULL
-2760 NULL
-569300 NULL
-660 NULL
-250 NULL
-340 NULL
-3410 NULL
-2550 NULL
-3330 NULL
-441 NULL
-24 NULL
-323 NULL
-34 NULL
-100 NULL
15 NULL
+17 0000000016
+19 0000000014
22 NULL
-394 NULL
+24 NULL
+27 0000000026
+29 0000000024
+34 NULL
94 NULL
-195 NULL
-292 NULL
-987 NULL
-7876 NULL
-321 0000000765
-9112 0000008771
-500 0000000900
-500 0000000900
-500 0000000900
+100 NULL
+100 0000000004
107 0000000106
+107 0000000106
+109 0000000104
109 0000000104
+195 NULL
207 0000000206
209 0000000204
-27 0000000026
-29 0000000024
-17 0000000016
-19 0000000014
-107 0000000106
-109 0000000104
-299 NULL
242 NULL
+250 NULL
+292 NULL
+299 NULL
+321 0000000765
+323 NULL
+340 NULL
+394 NULL
424 NULL
+441 NULL
+500 0000000900
+500 0000000900
+500 0000000900
+660 NULL
+987 NULL
+2550 NULL
+2760 NULL
+3330 NULL
+3410 NULL
+7876 NULL
+9112 0000008771
+76710 NULL
+569300 NULL
drop view test.v1 ;
-CREATE VIEW test.v1 AS SELECT * FROM test.tb2 limit 20 ;
-SELECT * FROM test.v1;
+CREATE VIEW test.v1 AS SELECT * FROM test.tb2 order by f59, f60, f61 limit 20 ;
+SELECT * FROM test.v1 order by f59,f60,f61 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
1 1 0000000001 0000000000000000000000000000000000000000000000000000000000000001 0000000001 0000000000000000000000000000000000000000000000000000000000000001 -5 0.000000000000000000000000000000 1 0.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549435e-38 1.17549e-38 1.175494352e-38 01.17549e-38 00000001.175494352e-38 01.17549e-38 00000001.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 1970-01-02 00:00:01 1902 1902 1902 2enum 2set
2 2 0000000002 0000000000000000000000000000000000000000000000000000000000000002 0000000002 0000000000000000000000000000000000000000000000000000000000000002 -4 1.100000000000000000000000000000 2 1.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494349e-38 1.17549e-38 1.175494353e-38 01.17549e-38 00000001.175494353e-38 01.17549e-38 00000001.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 1970-01-03 00:00:02 1903 1903 1903 1enum 1set,2set
3 3 0000000003 0000000000000000000000000000000000000000000000000000000000000003 0000000003 0000000000000000000000000000000000000000000000000000000000000003 -3 2.200000000000000000000000000000 3 2.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494348e-38 1.17549e-38 1.175494354e-38 01.17549e-38 00000001.175494354e-38 01.17549e-38 00000001.175494354e-38 1000-01-03 838:59:56 1970-01-04 00:00:03 1970-01-04 00:00:03 1904 1904 1904 2enum 1set
-100 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
5 5 0000000005 0000000000000000000000000000000000000000000000000000000000000005 0000000005 0000000000000000000000000000000000000000000000000000000000000005 -1 4.400000000000000000000000000000 5 4.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494346e-38 1.17549e-38 1.175494356e-38 01.17549e-38 00000001.175494356e-38 01.17549e-38 00000001.175494356e-38 1000-01-05 838:59:54 1970-01-06 00:00:05 1970-01-06 00:00:05 1906 1906 1906 2enum 1set,2set
6 6 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0 5.500000000000000000000000000000 6 5.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494345e-38 1.17549e-38 1.175494357e-38 01.17549e-38 00000001.175494357e-38 01.17549e-38 00000001.175494357e-38 1000-01-06 838:59:53 1970-01-07 00:00:06 1970-01-07 00:00:06 1907 1907 1907 1enum 1set
7 7 0000000007 0000000000000000000000000000000000000000000000000000000000000007 0000000007 0000000000000000000000000000000000000000000000000000000000000007 1 6.600000000000000000000000000000 7 6.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494344e-38 1.17549e-38 1.175494358e-38 01.17549e-38 00000001.175494358e-38 01.17549e-38 00000001.175494358e-38 1000-01-07 838:59:52 1970-01-08 00:00:07 1970-01-08 00:00:07 1908 1908 1908 2enum 2set
8 8 0000000008 0000000000000000000000000000000000000000000000000000000000000008 0000000008 0000000000000000000000000000000000000000000000000000000000000008 2 7.700000000000000000000000000000 8 7.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494343e-38 1.17549e-38 1.175494359e-38 01.17549e-38 00000001.175494359e-38 01.17549e-38 00000001.175494359e-38 1000-01-08 838:59:51 1970-01-09 00:00:08 1970-01-09 00:00:08 1909 1909 1909 1enum 1set,2set
9 9 0000000009 0000000000000000000000000000000000000000000000000000000000000009 0000000009 0000000000000000000000000000000000000000000000000000000000000009 3 8.800000000000000000000000000000 9 8.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494342e-38 1.17549e-38 1.17549436e-38 01.17549e-38 000000001.17549436e-38 01.17549e-38 000000001.17549436e-38 1000-01-09 838:59:50 1970-01-10 00:00:09 1970-01-10 00:00:09 1910 1910 1910 2enum 1set
10 10 0000000010 0000000000000000000000000000000000000000000000000000000000000010 0000000010 0000000000000000000000000000000000000000000000000000000000000010 4 9.900000000000000000000000000000 10 9.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494341e-38 1.17549e-38 1.175494361e-38 01.17549e-38 00000001.175494361e-38 01.17549e-38 00000001.175494361e-38 1000-01-10 838:59:49 1970-01-11 00:00:10 1970-01-11 00:00:10 1911 1911 1911 1enum 2set
-76710 226546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-2760 985654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-569300 9114376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-660 876546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-250 87895654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-340 9984376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-3410 996546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-2550 775654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-3330 764376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-441 16546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+15 87 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+17 15 0000000016 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+19 18 0000000014 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+22 93 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+24 51654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+27 25 0000000026 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+29 28 0000000024 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+34 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+94 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+100 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
+100 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
drop view test.v1 ;
CREATE VIEW test.v1 AS SELECT F59,f61 FROM test.tb2 limit 20 ;
-SELECT * FROM test.v1 limit 50;
+SELECT * FROM test.v1 order by f59,f61 desc limit 50;
F59 f61
1 0000000001
2 0000000002
3 0000000003
-100 0000000004
5 0000000005
6 0000000006
7 0000000007
8 0000000008
9 0000000009
10 0000000010
-76710 NULL
-2760 NULL
-569300 NULL
-660 NULL
+100 0000000004
250 NULL
340 NULL
-3410 NULL
+441 NULL
+660 NULL
2550 NULL
+2760 NULL
3330 NULL
-441 NULL
+3410 NULL
+76710 NULL
+569300 NULL
drop view test.v1 ;
Testcase 3.3.1.54
@@ -9798,7 +9798,7 @@ Insert into t2 values (2,2000) ;
Insert into t2 values (31,97) ;
Create view test.v1 as select t1.f59, t1.f60
from t1,t2 where t1.f59=t2.f59 ;
-Select * from test.v1 limit 50 ;
+Select * from test.v1 order by f59 limit 50 ;
f59 f60
1 10
2 20
@@ -9864,7 +9864,7 @@ create or replace view test.v1 as
Select t1.f59 t1_f59, t2.f59 t2_f59, t1.f60 t1_f60, t2.f60 t2_f60,
t1.f61 t1_f61, t2.f61 t2_f61
from t1 inner join t2 where t1.f59 = t2.f59 ;
-select * from test.v1;
+select * from test.v1 order by t1_f59 ;
t1_f59 t2_f59 t1_f60 t2_f60 t1_f61 t2_f61
2 2 double double 6 6
3 3 single-f3 single-f3 4 6
@@ -9877,7 +9877,7 @@ t1_f59 t2_f59 t1_f60 t2_f60 t1_f61 t2_f61
Create or replace view test.v1 as
Select t1.f59 AS t1_f59, t2.f59 AS t2_f59
FROM t2 cross join t1;
-Select * from v1;
+Select * from v1 order by t1_f59,t2_f59;
t1_f59 t2_f59
1 2
1 3
@@ -9903,7 +9903,7 @@ t1_f59 t2_f59
Create or replace view test.v1 as
Select straight_join t1.f59 AS t1_f59, t2.f59 AS t2_f59
FROM t2,t1;
-Select * from v1;
+Select * from v1 order by t1_f59,t2_f59;
t1_f59 t2_f59
1 2
1 3
@@ -9929,7 +9929,7 @@ t1_f59 t2_f59
Create or replace view test.v1 as
Select f59, f60, f61, a, b
FROM t2 natural join t1;
-Select * from v1;
+Select * from v1 order by f59;
f59 f60 f61 a b
2 double 6 2 2
Select f59, f60, f61, a, b
@@ -9940,11 +9940,11 @@ Create or replace view test.v1 as
Select t1.f59 t1_f59, t2.f59 t2_f59, t1.f60 t1_f60, t2.f60 t2_f60,
t1.f61 t1_f61, t2.f61 t2_f61
FROM t2 left outer join t1 on t2.f59=t1.f59;
-Select * from v1;
+Select * from v1 order by t1_f59;
t1_f59 t2_f59 t1_f60 t2_f60 t1_f61 t2_f61
+NULL 4 NULL single NULL 4
2 2 double double 6 6
3 3 single-f3 single-f3 4 6
-NULL 4 NULL single NULL 4
Select t1.f59 t1_f59, t2.f59 t2_f59, t1.f60 t1_f60, t2.f60 t2_f60,
t1.f61 t1_f61, t2.f61 t2_f61
FROM t2 left outer join t1 on t2.f59=t1.f59;
@@ -9955,7 +9955,7 @@ NULL 4 NULL single NULL 4
Create or replace view test.v1 as
Select f59, f60, f61, t1.a, t2.b
FROM t2 natural left outer join t1;
-Select * from v1;
+Select * from v1 order by f59;
f59 f60 f61 a b
2 double 6 2 2
3 single-f3 6 NULL 3
@@ -9970,7 +9970,7 @@ Create or replace view test.v1 as
Select t1.f59 t1_f59, t2.f59 t2_f59, t1.f60 t1_f60, t2.f60 t2_f60,
t1.f61 t1_f61, t2.f61 t2_f61
FROM t2 right outer join t1 on t2.f59=t1.f59;
-Select * from v1;
+Select * from v1 order by t1_f59;
t1_f59 t2_f59 t1_f60 t2_f60 t1_f61 t2_f61
1 NULL single NULL 3 NULL
2 2 double double 6 6
@@ -9985,11 +9985,11 @@ t1_f59 t2_f59 t1_f60 t2_f60 t1_f61 t2_f61
Create or replace view test.v1 as
Select f59, f60, a, b
FROM t2 natural right outer join t1;
-Select * from v1;
+Select * from v1 order by f59 desc;
f59 f60 a b
-1 single 1 NULL
-2 double 2 2
3 single-f3 3 NULL
+2 double 2 2
+1 single 1 NULL
Select f59, f60, a, b
FROM t2 natural right outer join t1;
f59 f60 a b
@@ -10010,18 +10010,18 @@ Insert into t1 values (107,501,601) ;
Insert into t1 values (901,801,401) ;
Create or replace view test.v1 as
Select tb2.f59 FROM tb2 LEFT JOIN t1 on tb2.f59 = t1.f59 ;
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
f59
1
2
3
-100
5
6
7
8
9
10
+15
Drop view if exists test.v1 ;
Drop table if exists t1 ;
Drop view if exists v1;
@@ -10031,7 +10031,7 @@ Insert into t1 values (207,201,201) ;
Insert into t1 values (201,201,201) ;
Create or replace view test.v1
as Select tb2.f59 FROM tb2 INNER JOIN t1 on tb2.f59 = t1.f59 ;
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
f59
207
Drop view if exists test.v1 ;
@@ -10043,7 +10043,7 @@ Insert into t1 values (27,21,21) ;
Insert into t1 values (21,21,21) ;
Create or replace view test.v1
as Select tb2.f59 FROM tb2 CROSS JOIN t1 on tb2.f59 = t1.f59 ;
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
f59
27
Drop view test.v1 ;
@@ -10058,18 +10058,18 @@ Insert into t1 values (17,51,61) ;
Insert into t1 values (91,81,41) ;
Create or replace view test.v1 as (Select f59 FROM tb2 where f59=17 )
Union ALL (Select f59 from t1 where f59=17 );
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
f59
17
17
Create or replace view test.v1 as (Select f59 FROM tb2 where f59=17 )
Union (Select f59 from t1 where f59=17 );
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
f59
17
Create or replace view test.v1 as (Select f59 FROM tb2 where f59=17 )
Union Distinct (Select f59 from t1 where f60=17 );
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
f59
17
Drop view test.v1 ;
@@ -10081,7 +10081,7 @@ insert into t1 values (107,501,601);
insert into t1 values (901,801,401);
create or replace view test.v1 as
select tb2.f59 from tb2 join t1 on tb2.f59 = t1.f59;
-select * from test.v1 limit 0,10;
+select * from test.v1 order by f59 limit 0,10;
f59
107
107
@@ -10089,7 +10089,7 @@ create or replace view test.v1 as
(select f59 from tb2 where f59=107 )
union all
(select f59 from t1 where f59=107 );
-select * from test.v1 limit 0,10;
+select * from test.v1 order by f59 limit 0,10;
f59
107
107
@@ -10098,14 +10098,14 @@ create or replace view test.v1 as
(select f59 from tb2 where f59=107 )
union
(select f59 from t1 where f59=107 );
-select * from test.v1 limit 0,10;
+select * from test.v1 order by f59 limit 0,10;
f59
107
create or replace view test.v1 as
(select f59 from tb2 where f59=107 )
union distinct
(select f59 from t1 where f59=107 );
-select * from test.v1 limit 0,10;
+select * from test.v1 order by f59 limit 0,10;
f59
107
drop view if exists test.v1 ;
@@ -10116,13 +10116,13 @@ Testcase 3.3.1.64
Drop view if exists test.v1 ;
CREATE VIEW test.v1 AS SELECT F59
FROM test.tb2 where test.tb2.F59 = 109;
-SELECT * FROM test.v1 limit 0,10;
+SELECT * FROM test.v1 order by f59 limit 0,10;
F59
109
109
ALTER VIEW test.v1 AS SELECT *
FROM test.tb2 WHERE test.tb2.f59 = 242 ;
-SELECT * FROM test.v1 limit 0,10;
+SELECT * FROM test.v1 order by f59 limit 0,10;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
242 79 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
Drop view test.v1 ;
@@ -10202,7 +10202,8 @@ SHOW FIELDS FROM v1;
ERROR 42S02: Table 'test.v1' doesn't exist
CHECK TABLE v1;
Table Op Msg_type Msg_text
-test.v1 check error Table 'test.v1' doesn't exist
+test.v1 check Error Table 'test.v1' doesn't exist
+test.v1 check error Corrupt
DESCRIBE v1;
ERROR 42S02: Table 'test.v1' doesn't exist
EXPLAIN SELECT * FROM v1;
@@ -10249,8 +10250,8 @@ CREATE VIEW test3.v30 AS SELECT * FROM test3.v29;
CREATE VIEW test3.v31 AS SELECT * FROM test3.v30;
CREATE VIEW test3.v32 AS SELECT * FROM test3.v31;
SHOW CREATE VIEW test3.v32;
-View Create View
-v32 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test3`.`v32` AS select `v31`.`f1` AS `f1` from `test3`.`v31`
+View Create View character_set_client collation_connection
+v32 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test3`.`v32` AS select `v31`.`f1` AS `f1` from `test3`.`v31` latin1 latin1_swedish_ci
SELECT * FROM test3.v32;
f1
1.000
@@ -10259,8 +10260,8 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 1
DROP VIEW test3.v0;
SHOW CREATE VIEW test3.v32;
-View Create View
-v32 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test3`.`v32` AS select `v31`.`f1` AS `f1` from `test3`.`v31`
+View Create View character_set_client collation_connection
+v32 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test3`.`v32` AS select `v31`.`f1` AS `f1` from `test3`.`v31` latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'test3.v32' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
SELECT * FROM test3.v32;
@@ -10268,15 +10269,13 @@ ERROR HY000: View 'test3.v32' references invalid table(s) or column(s) or functi
EXPLAIN SELECT * FROM test3.v32;
ERROR HY000: View 'test3.v32' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
-FIXME - Setting join_limit to 30 - hangs for higher values
+FIXME - Setting join_limit to 28 - hangs for higher values
----------------------------------------------------------
-SET @join_limit = 30;
+SET @join_limit = 28;
SET @max_level = @join_limit - 1;
DROP DATABASE IF EXISTS test3;
DROP TABLE IF EXISTS test1.t1;
DROP TABLE IF EXISTS test2.t1;
-DROP VIEW IF EXISTS test1.v29;
-DROP VIEW IF EXISTS test1.v28;
DROP VIEW IF EXISTS test1.v27;
DROP VIEW IF EXISTS test1.v26;
DROP VIEW IF EXISTS test1.v25;
@@ -10383,15 +10382,11 @@ CREATE OR REPLACE VIEW test1.v26 AS SELECT f1, f2
FROM test3.t1 tab1 NATURAL JOIN test1.v25 tab2;
CREATE OR REPLACE VIEW test1.v27 AS SELECT f1, f2
FROM test1.t1 tab1 NATURAL JOIN test1.v26 tab2;
-CREATE OR REPLACE VIEW test1.v28 AS SELECT f1, f2
-FROM test2.t1 tab1 NATURAL JOIN test1.v27 tab2;
-CREATE OR REPLACE VIEW test1.v29 AS SELECT f1, f2
-FROM test3.t1 tab1 NATURAL JOIN test1.v28 tab2;
-SHOW CREATE VIEW test1.v29;
-View Create View
-v29 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v29` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v28` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`))))
+SHOW CREATE VIEW test1.v27;
+View Create View character_set_client collation_connection
+v27 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v27` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test1`.`t1` `tab1` join `test1`.`v26` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`)))) latin1 latin1_swedish_ci
SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v29;
+CAST(f2 AS CHAR) AS f2 FROM test1.v27;
f1 f2
5 five
@@ -10400,14 +10395,14 @@ differs on some platforms
FIXME Is this a bug ?
--------------------------------------------------------------------------------
EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v29;
-CREATE VIEW test1.v30 AS SELECT f1, f2
-FROM test3.t1 tab1 NATURAL JOIN test1.v29 tab2;
-SHOW CREATE VIEW test1.v30;
-View Create View
-v30 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v30` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v29` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`))))
+CAST(f2 AS CHAR) AS f2 FROM test1.v27;
+CREATE VIEW test1.v28 AS SELECT f1, f2
+FROM test3.t1 tab1 NATURAL JOIN test1.v27 tab2;
+SHOW CREATE VIEW test1.v28;
+View Create View character_set_client collation_connection
+v28 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v28` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v27` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`)))) latin1 latin1_swedish_ci
SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v30;
+CAST(f2 AS CHAR) AS f2 FROM test1.v28;
f1 f2
5 five
@@ -10416,33 +10411,31 @@ differs on some platforms
FIXME Is this a bug ?
--------------------------------------------------------------------------------
EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v30;
-DROP VIEW IF EXISTS test1.v30;
+CAST(f2 AS CHAR) AS f2 FROM test1.v28;
+DROP VIEW IF EXISTS test1.v28;
CREATE OR REPLACE VIEW test1.v0 AS
SELECT f1 as f2, f2 as f1 FROM test2.t1;
CREATE OR REPLACE VIEW test2.v0 AS
SELECT CAST('0001-01-01' AS DATE) as f1, f2 FROM test3.t1;
-SHOW CREATE VIEW test1.v29;
+SHOW CREATE VIEW test1.v27;
SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v29;
+CAST(f2 AS CHAR) AS f2 FROM test1.v27;
EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v29;
+CAST(f2 AS CHAR) AS f2 FROM test1.v27;
CREATE OR REPLACE VIEW test3.v0 AS
SELECT f1 , CONVERT('ßÄäÖöÜü§' USING UCS2) as f2 FROM test1.t1;
-SHOW CREATE VIEW test1.v29;
+SHOW CREATE VIEW test1.v27;
SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v29;
+CAST(f2 AS CHAR) AS f2 FROM test1.v27;
EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v29;
+CAST(f2 AS CHAR) AS f2 FROM test1.v27;
CREATE OR REPLACE VIEW test3.v0 AS
SELECT CONVERT('ßÄäÖöÜü§' USING UCS2) as f1, f2 FROM test1.t1;
-SHOW CREATE VIEW test1.v29;
+SHOW CREATE VIEW test1.v27;
SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v29;
+CAST(f2 AS CHAR) AS f2 FROM test1.v27;
EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v29;
-DROP VIEW IF EXISTS test1.v29;
-DROP VIEW IF EXISTS test1.v28;
+CAST(f2 AS CHAR) AS f2 FROM test1.v27;
DROP VIEW IF EXISTS test1.v27;
DROP VIEW IF EXISTS test1.v26;
DROP VIEW IF EXISTS test1.v25;
@@ -10513,7 +10506,7 @@ info: Rows matched: 1 Changed: 1 Warnings: 0
SELECT * FROM tb2 where f59 = 8 and f60 = 105;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
8 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-SELECT f59,f60 FROM test.v1 where f59 = 8 and f60 = 105;
+SELECT f59,f60 FROM test.v1 where f59 = 8 and f60 = 105 ;
f59 f60
8 105
Drop view test.v1 ;
@@ -10532,7 +10525,7 @@ f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78
891 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
891 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
891 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-SELECT f59,f60 FROM test.v1 where f59 = 891 and f60 = 105;
+SELECT f59,f60 FROM test.v1 where f59 = 891 and f60 = 105 ;
f59 f60
891 105
891 105
@@ -10549,7 +10542,7 @@ DELETE FROM test.v1 where f59 = 789 ;
affected rows: 1
SELECT * FROM tb2 where f59 = 789 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
-SELECT f59,f60 FROM test.v1 where f59 = 789;
+SELECT f59,f60 FROM test.v1 where f59 = 789 order by f60 ;
f59 f60
Drop view test.v1 ;
@@ -10562,7 +10555,7 @@ DELETE FROM test.v1 where f59 = 711 ;
affected rows: 1
SELECT * FROM tb2 where f59 = 711 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
-SELECT f59,f60 FROM test.v1 where f59 = 711;
+SELECT f59,f60 FROM test.v1 where f59 = 711 order by f60 ;
f59 f60
Drop view test.v1 ;
diff --git a/mysql-test/suite/funcs_1/r/memory__datadict.result b/mysql-test/suite/funcs_1/r/memory__datadict.result
index 0ef00f0e553..2f9bbe6eafe 100644
--- a/mysql-test/suite/funcs_1/r/memory__datadict.result
+++ b/mysql-test/suite/funcs_1/r/memory__datadict.result
@@ -658,9 +658,9 @@ TABLE_CATALOG NULL
TABLE_SCHEMA information_schema
TABLE_NAME GLOBAL_VARIABLES
TABLE_TYPE SYSTEM VIEW
-ENGINE MyISAM
+ENGINE MEMORY
VERSION 10
-ROW_FORMAT Dynamic
+ROW_FORMAT Fixed
TABLE_ROWS NULL
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
@@ -868,9 +868,9 @@ TABLE_CATALOG NULL
TABLE_SCHEMA information_schema
TABLE_NAME SESSION_VARIABLES
TABLE_TYPE SYSTEM VIEW
-ENGINE MyISAM
+ENGINE MEMORY
VERSION 10
-ROW_FORMAT Dynamic
+ROW_FORMAT Fixed
TABLE_ROWS NULL
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
@@ -1188,7 +1188,7 @@ TABLE_TYPE BASE TABLE
ENGINE CSV
VERSION 10
ROW_FORMAT Dynamic
-TABLE_ROWS 2
+TABLE_ROWS 1
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -1209,7 +1209,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Fixed
-TABLE_ROWS 0
+TABLE_ROWS 37
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -1230,7 +1230,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Fixed
-TABLE_ROWS 0
+TABLE_ROWS 424
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -1251,7 +1251,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Fixed
-TABLE_ROWS 0
+TABLE_ROWS 901
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -1272,7 +1272,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Dynamic
-TABLE_ROWS 0
+TABLE_ROWS 479
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -1955,8 +1955,8 @@ NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
-NULL db_datadict latin1 SYSTEM VIEW MyISAM
-NULL db_datadict latin1 SYSTEM VIEW MyISAM
+NULL db_datadict latin1 SYSTEM VIEW MEMORY
+NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MyISAM
NULL db_datadict latin1 SYSTEM VIEW MyISAM
NULL db_datadict latin1 SYSTEM VIEW MyISAM
@@ -2023,8 +2023,8 @@ NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
-NULL information_schema utf8 SYSTEM VIEW MyISAM
-NULL information_schema utf8 SYSTEM VIEW MyISAM
+NULL information_schema utf8 SYSTEM VIEW MEMORY
+NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MyISAM
NULL information_schema utf8 SYSTEM VIEW MyISAM
NULL information_schema utf8 SYSTEM VIEW MyISAM
@@ -2091,8 +2091,8 @@ NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
-NULL mysql latin1 SYSTEM VIEW MyISAM
-NULL mysql latin1 SYSTEM VIEW MyISAM
+NULL mysql latin1 SYSTEM VIEW MEMORY
+NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MyISAM
NULL mysql latin1 SYSTEM VIEW MyISAM
NULL mysql latin1 SYSTEM VIEW MyISAM
@@ -2159,8 +2159,8 @@ NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
-NULL test latin1 SYSTEM VIEW MyISAM
-NULL test latin1 SYSTEM VIEW MyISAM
+NULL test latin1 SYSTEM VIEW MEMORY
+NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MyISAM
NULL test latin1 SYSTEM VIEW MyISAM
NULL test latin1 SYSTEM VIEW MyISAM
@@ -2227,8 +2227,8 @@ NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
-NULL test1 latin1 SYSTEM VIEW MyISAM
-NULL test1 latin1 SYSTEM VIEW MyISAM
+NULL test1 latin1 SYSTEM VIEW MEMORY
+NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MyISAM
NULL test1 latin1 SYSTEM VIEW MyISAM
NULL test1 latin1 SYSTEM VIEW MyISAM
@@ -2295,8 +2295,8 @@ NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
-NULL test4 latin1 SYSTEM VIEW MyISAM
-NULL test4 latin1 SYSTEM VIEW MyISAM
+NULL test4 latin1 SYSTEM VIEW MEMORY
+NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MyISAM
NULL test4 latin1 SYSTEM VIEW MyISAM
NULL test4 latin1 SYSTEM VIEW MyISAM
@@ -2375,6 +2375,9 @@ NULL information_schema EVENTS LAST_ALTERED 18 0000-00-00 00:00:00 NO datetime N
NULL information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime 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 ORIGINATOR 21 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10) 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 DATABASE_COLLATION 24 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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
@@ -2414,9 +2417,9 @@ NULL information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 19 0 NULL NU
NULL information_schema FILES STATUS 37 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema FILES EXTRA 38 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -2503,6 +2506,9 @@ NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime
NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 DATABASE_COLLATION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -2514,9 +2520,9 @@ NULL information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL
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 IS_GRANTABLE 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema STATISTICS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -2584,6 +2590,9 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NUL
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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 TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -2596,6 +2605,8 @@ NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+NULL information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL db_datadict v1 TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select,insert,update,references
NULL db_datadict v1 TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
NULL db_datadict v1 TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
@@ -2668,6 +2679,10 @@ NULL mysql event sql_mode 15 NO set 431 1293 NULL NULL utf8 utf8_general_ci set
NULL mysql event comment 16 NO char 64 192 NULL NULL utf8 utf8_bin char(64) select,insert,update,references
NULL mysql event originator 17 NULL NO int NULL NULL 10 0 NULL NULL int(10) 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 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 db_collation 21 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) 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 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 dl 3 NO char 128 384 NULL NULL utf8 utf8_bin char(128) select,insert,update,references
@@ -2737,6 +2752,10 @@ NULL mysql proc created 13 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NU
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 sql_mode 15 NO set 431 1293 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') 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 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 db_collation 19 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) 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 procs_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) 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 User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
@@ -3184,10 +3203,10 @@ select @x, @y;
@x @y
big5_chinese_ci big5
select * from 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
+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_1 NULL db_datadict sp_1 PROCEDURE NULL SQL BEGIN
SELECT * FROM db_datadict.v1;
-END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost
+END 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
select count(*) from routines;
count(*)
1
@@ -3205,14 +3224,14 @@ NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE
NULL mysql event 0 mysql PRIMARY 1 db A NULL NULL NULL BTREE
NULL mysql event 0 mysql PRIMARY 2 name A 0 NULL NULL BTREE
NULL mysql func 0 mysql PRIMARY 1 name A 0 NULL NULL BTREE
-NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 0 NULL NULL BTREE
-NULL mysql help_category 0 mysql name 1 name A 0 NULL NULL BTREE
-NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A 0 NULL NULL BTREE
-NULL mysql help_keyword 0 mysql name 1 name A 0 NULL NULL BTREE
+NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 37 NULL NULL BTREE
+NULL mysql help_category 0 mysql name 1 name A 37 NULL NULL BTREE
+NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A 424 NULL NULL BTREE
+NULL mysql help_keyword 0 mysql name 1 name A 424 NULL NULL BTREE
NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A NULL NULL NULL BTREE
-NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A 0 NULL NULL BTREE
-NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A 0 NULL NULL BTREE
-NULL mysql help_topic 0 mysql name 1 name A 0 NULL NULL BTREE
+NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A 901 NULL NULL BTREE
+NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A 479 NULL NULL BTREE
+NULL mysql help_topic 0 mysql name 1 name A 479 NULL NULL BTREE
NULL mysql host 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
NULL mysql host 0 mysql PRIMARY 2 Db A 0 NULL NULL BTREE
NULL mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A 0 NULL NULL BTREE
@@ -3242,10 +3261,10 @@ NULL mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A 31 N
NULL mysql user 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
NULL mysql user 0 mysql PRIMARY 2 User A 3 NULL NULL BTREE
select * from views;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
-NULL db_datadict v1 /* ALGORITHM=UNDEFINED */ 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` NONE NO root@localhost DEFINER
-NULL db_datadict vu /* ALGORITHM=UNDEFINED */ select distinct `vu1`.`u` AS `u`,substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3)) AS `server`,substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3),(length(substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3))) - 1)) AS `Server_Clean` from `db_datadict`.`vu1` NONE NO root@localhost DEFINER
-NULL db_datadict vu1 /* ALGORITHM=UNDEFINED */ select `user_privileges`.`GRANTEE` AS `u` from `information_schema`.`user_privileges` NONE NO root@localhost DEFINER
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
+NULL db_datadict v1 SELECT * FROM information_schema.tables NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+NULL db_datadict vu SELECT DISTINCT u, NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+NULL db_datadict vu1 SELECT grantee AS u NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
select * from user_privileges order by grantee, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'127.0.0.1' NULL ALTER YES
@@ -3445,7 +3464,7 @@ max_recs
45
select max(cardinality) from statistics;
max(cardinality)
-393
+901
select concat("View '",
table_name, "' is associated with the database '", table_schema, "'.")
AS "Who is Who for the Views"
@@ -3570,8 +3589,8 @@ columns_priv 7
COLUMN_PRIVILEGES 7
db 22
ENGINES 6
-event 18
-EVENTS 21
+event 22
+EVENTS 24
FILES 38
func 4
general_log 6
@@ -3587,11 +3606,11 @@ ndb_binlog_index 7
PARTITIONS 25
plugin 2
PLUGINS 10
-proc 16
+proc 20
PROCESSLIST 8
procs_priv 8
REFERENTIAL_CONSTRAINTS 11
-ROUTINES 20
+ROUTINES 23
SCHEMATA 5
SCHEMA_PRIVILEGES 5
servers 9
@@ -3622,11 +3641,11 @@ time_zone_leap_second 2
time_zone_name 2
time_zone_transition 3
time_zone_transition_type 5
-TRIGGERS 19
+TRIGGERS 22
user 39
USER_PRIVILEGES 4
v1 21
-VIEWS 8
+VIEWS 10
vu 3
vu1 1
@@ -3651,16 +3670,16 @@ SELECT * FROM collation_character_set_applicability LIMIT 1;
COLLATION_NAME CHARACTER_SET_NAME
big5_chinese_ci big5
SELECT * FROM routines LIMIT 1;
-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
+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_1 NULL db_datadict sp_1 PROCEDURE NULL SQL BEGIN
SELECT * FROM db_datadict.v1;
-END NULL NULL SQL NO CONTAINS SQL NULL DEFINER <Created> <Last_Altered> root@localhost
+END NULL NULL SQL NO CONTAINS SQL NULL DEFINER <Created> <Last_Altered> root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
SELECT * FROM statistics LIMIT 1;
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 NULL NULL NULL BTREE
SELECT * FROM views LIMIT 1;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
-NULL db_datadict v1 /* ALGORITHM=UNDEFINED */ 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` NONE NO root@localhost DEFINER
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
+NULL db_datadict v1 SELECT * FROM information_schema.tables NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
SELECT * FROM user_privileges LIMIT 1;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'localhost' NULL SELECT YES
@@ -3678,7 +3697,7 @@ SELECT * FROM key_column_usage LIMIT 1;
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 mysql PRIMARY NULL mysql columns_priv Host 1 NULL NULL NULL NULL
SELECT * FROM triggers LIMIT 1;
-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
+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
SELECT * FROM parameters LIMIT 1;
ERROR 42S02: Unknown table 'parameters' in information_schema
SELECT * FROM referential_constraints LIMIT 1;
@@ -3960,9 +3979,9 @@ TABLE_CATALOG NULL
TABLE_SCHEMA information_schema
TABLE_NAME GLOBAL_VARIABLES
TABLE_TYPE SYSTEM VIEW
-ENGINE MyISAM
+ENGINE MEMORY
VERSION 10
-ROW_FORMAT Dynamic
+ROW_FORMAT Fixed
TABLE_ROWS NULL
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
@@ -4170,9 +4189,9 @@ TABLE_CATALOG NULL
TABLE_SCHEMA information_schema
TABLE_NAME SESSION_VARIABLES
TABLE_TYPE SYSTEM VIEW
-ENGINE MyISAM
+ENGINE MEMORY
VERSION 10
-ROW_FORMAT Dynamic
+ROW_FORMAT Fixed
TABLE_ROWS NULL
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
@@ -4490,7 +4509,7 @@ TABLE_TYPE BASE TABLE
ENGINE CSV
VERSION 10
ROW_FORMAT Dynamic
-TABLE_ROWS 2
+TABLE_ROWS 1
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -4511,7 +4530,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Fixed
-TABLE_ROWS 0
+TABLE_ROWS 37
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -4532,7 +4551,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Fixed
-TABLE_ROWS 0
+TABLE_ROWS 424
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -4553,7 +4572,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Fixed
-TABLE_ROWS 0
+TABLE_ROWS 901
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -4574,7 +4593,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Dynamic
-TABLE_ROWS 0
+TABLE_ROWS 479
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -5257,8 +5276,8 @@ NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
-NULL db_datadict latin1 SYSTEM VIEW MyISAM
-NULL db_datadict latin1 SYSTEM VIEW MyISAM
+NULL db_datadict latin1 SYSTEM VIEW MEMORY
+NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MyISAM
NULL db_datadict latin1 SYSTEM VIEW MyISAM
NULL db_datadict latin1 SYSTEM VIEW MyISAM
@@ -5325,8 +5344,8 @@ NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
-NULL information_schema utf8 SYSTEM VIEW MyISAM
-NULL information_schema utf8 SYSTEM VIEW MyISAM
+NULL information_schema utf8 SYSTEM VIEW MEMORY
+NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MyISAM
NULL information_schema utf8 SYSTEM VIEW MyISAM
NULL information_schema utf8 SYSTEM VIEW MyISAM
@@ -5393,8 +5412,8 @@ NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
-NULL mysql latin1 SYSTEM VIEW MyISAM
-NULL mysql latin1 SYSTEM VIEW MyISAM
+NULL mysql latin1 SYSTEM VIEW MEMORY
+NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MyISAM
NULL mysql latin1 SYSTEM VIEW MyISAM
NULL mysql latin1 SYSTEM VIEW MyISAM
@@ -5461,8 +5480,8 @@ NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
-NULL test latin1 SYSTEM VIEW MyISAM
-NULL test latin1 SYSTEM VIEW MyISAM
+NULL test latin1 SYSTEM VIEW MEMORY
+NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MyISAM
NULL test latin1 SYSTEM VIEW MyISAM
NULL test latin1 SYSTEM VIEW MyISAM
@@ -5529,8 +5548,8 @@ NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
-NULL test1 latin1 SYSTEM VIEW MyISAM
-NULL test1 latin1 SYSTEM VIEW MyISAM
+NULL test1 latin1 SYSTEM VIEW MEMORY
+NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MyISAM
NULL test1 latin1 SYSTEM VIEW MyISAM
NULL test1 latin1 SYSTEM VIEW MyISAM
@@ -5597,8 +5616,8 @@ NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
-NULL test4 latin1 SYSTEM VIEW MyISAM
-NULL test4 latin1 SYSTEM VIEW MyISAM
+NULL test4 latin1 SYSTEM VIEW MEMORY
+NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MyISAM
NULL test4 latin1 SYSTEM VIEW MyISAM
NULL test4 latin1 SYSTEM VIEW MyISAM
@@ -5639,10 +5658,10 @@ dec8_swedish_ci dec8
dec8_bin dec8
cp850_general_ci cp850
select * from information_schema.routines limit 0, 5;
-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
+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_1 NULL db_datadict sp_1 PROCEDURE NULL SQL BEGIN
SELECT * FROM db_datadict.v1;
-END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost
+END 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
select * from information_schema.statistics limit 0, 5;
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 NULL NULL NULL BTREE
@@ -5651,10 +5670,10 @@ NULL mysql columns_priv 0 mysql PRIMARY 3 User A NULL NULL NULL BTREE
NULL mysql columns_priv 0 mysql PRIMARY 4 Table_name A NULL NULL NULL BTREE
NULL mysql columns_priv 0 mysql PRIMARY 5 Column_name A 0 NULL NULL BTREE
select * from information_schema.views limit 0, 5;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
-NULL db_datadict v1 /* ALGORITHM=UNDEFINED */ 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` NONE NO root@localhost DEFINER
-NULL db_datadict vu /* ALGORITHM=UNDEFINED */ select distinct `vu1`.`u` AS `u`,substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3)) AS `server`,substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3),(length(substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3))) - 1)) AS `Server_Clean` from `db_datadict`.`vu1` NONE NO root@localhost DEFINER
-NULL db_datadict vu1 /* ALGORITHM=UNDEFINED */ select `user_privileges`.`GRANTEE` AS `u` from `information_schema`.`user_privileges` NONE NO root@localhost DEFINER
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
+NULL db_datadict v1 SELECT * FROM information_schema.tables NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+NULL db_datadict vu SELECT DISTINCT u, NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+NULL db_datadict vu1 SELECT grantee AS u NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
select * from information_schema.user_privileges limit 0, 5;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'localhost' NULL SELECT YES
@@ -5701,7 +5720,7 @@ COUNT(*)
68
SELECT COUNT(*) FROM information_schema. columns ;
COUNT(*)
-827
+846
SELECT COUNT(*) FROM information_schema. character_sets ;
COUNT(*)
36
@@ -5766,7 +5785,7 @@ tot_tabs
65
select count(*) as the_cols from columns;
the_cols
-802
+821
select max(maxlen) as the_max from character_sets;
the_max
3
@@ -5790,7 +5809,7 @@ routine_definition
select * from statistics group by index_name asc limit 0, 5;
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 procs_priv 1 mysql Grantor 1 Grantor A NULL NULL NULL BTREE
-NULL mysql help_category 0 mysql name 1 name A 0 NULL NULL BTREE
+NULL mysql help_category 0 mysql name 1 name A 37 NULL NULL BTREE
NULL mysql columns_priv 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE
select concat(table_schema, ', ', table_name, ', ', view_definition) view_info
@@ -6038,6 +6057,7 @@ INTO OUTFILE '../tmp/out.memory.db.file'
WHERE schema_name LIKE 'db_%';
CREATE USER user_3212@localhost;
GRANT ALL ON db_datadict.* TO user_3212@localhost;
+GRANT FILE ON *.* TO user_3212@localhost;
connect(localhost,user_3212,,db_datadict,MYSQL_PORT,MYSQL_SOCK);
user_3212@localhost db_datadict
@@ -6046,7 +6066,7 @@ INTO OUTFILE '../tmp/out.memory.user.file'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM schemata LIMIT 0, 5;
-ERROR 28000: Access denied for user 'user_3212'@'localhost' (using password: NO)
+ERROR 42S02: Table 'db_datadict.schemata' doesn't exist
SELECT *
FROM schemata LIMIT 0, 5;
ERROR 42S02: Table 'db_datadict.schemata' doesn't exist
@@ -6279,19 +6299,19 @@ update information_schema.routines set routine_name = 'p2'
where routine_name = 'sp_4_1_4';
end//
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
+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_4_1_4 NULL db_datadict sp_4_1_4 PROCEDURE NULL SQL begin
update information_schema.routines set routine_name = 'p2'
where routine_name = 'sp_4_1_4';
-end NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost
+end 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
call db_datadict.sp_4_1_4();
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
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
+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_4_1_4 NULL db_datadict sp_4_1_4 PROCEDURE NULL SQL begin
update information_schema.routines set routine_name = 'p2'
where routine_name = 'sp_4_1_4';
-end NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost
+end 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
drop procedure db_datadict.sp_4_1_4;
use information_schema;
@@ -7560,7 +7580,7 @@ CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA
SELECT *
FROM information_schema.triggers
WHERE trigger_schema LIKE 'db_datadict%';
-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
+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
DROP DATABASE IF EXISTS db_datadict;
CREATE DATABASE db_datadict;
USE db_datadict;
@@ -7712,7 +7732,7 @@ CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA
SELECT *
FROM information_schema.triggers
WHERE trigger_schema LIKE 'db_datadict%';
-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
+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
use db_datadict;
drop index i_6_401013 on res_t_401013;
drop table db_datadict.res_t_401013;
@@ -7848,7 +7868,7 @@ CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA
SELECT *
FROM information_schema.triggers
WHERE trigger_schema LIKE 'db_datadict%';
-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
+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
Testcase 3.2.1.14:
--------------------------------------------------------------------------------
@@ -7997,7 +8017,7 @@ CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA
SELECT *
FROM information_schema.triggers
WHERE trigger_schema LIKE 'db_datadict%';
-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
+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
use db_datadict;
alter table res_t_401014 change f1 ff1 int;
alter table res_t_401014 engine = innodb;
@@ -8142,7 +8162,7 @@ CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA
SELECT *
FROM information_schema.triggers
WHERE trigger_schema LIKE 'db_datadict%';
-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
+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
use db_datadict;
drop table db_datadict.res_t_401014;
drop view db_datadict.res_v_401014;
@@ -8301,7 +8321,7 @@ CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA
SELECT *
FROM information_schema.triggers
WHERE trigger_schema LIKE 'db_datadict%';
-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
+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
use db_datadict;
drop index i_6_401015 on res_t_401015;
drop table db_datadict.res_t_401015;
@@ -8436,7 +8456,7 @@ CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA
SELECT *
FROM information_schema.triggers
WHERE trigger_schema LIKE 'db_datadict%';
-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
+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
Testcase 3.2.1.16:
--------------------------------------------------------------------------------
@@ -8465,7 +8485,7 @@ information_schema ENGINES MEMORY
information_schema EVENTS MyISAM
information_schema FILES MEMORY
information_schema GLOBAL_STATUS MEMORY
-information_schema GLOBAL_VARIABLES MyISAM
+information_schema GLOBAL_VARIABLES MEMORY
information_schema KEY_COLUMN_USAGE MEMORY
information_schema PARTITIONS MyISAM
information_schema PLUGINS MyISAM
@@ -8475,7 +8495,7 @@ information_schema ROUTINES MyISAM
information_schema SCHEMATA MEMORY
information_schema SCHEMA_PRIVILEGES MEMORY
information_schema SESSION_STATUS MEMORY
-information_schema SESSION_VARIABLES MyISAM
+information_schema SESSION_VARIABLES MEMORY
information_schema STATISTICS MEMORY
information_schema TABLES MEMORY
information_schema TABLE_CONSTRAINTS MEMORY
@@ -8831,6 +8851,9 @@ EVENTS LAST_ALTERED datetime
EVENTS LAST_EXECUTED datetime
EVENTS EVENT_COMMENT varchar(64)
EVENTS ORIGINATOR bigint(10)
+EVENTS CHARACTER_SET_CLIENT varchar(32)
+EVENTS COLLATION_CONNECTION varchar(32)
+EVENTS DATABASE_COLLATION varchar(32)
FILES FILE_ID bigint(4)
FILES FILE_NAME varchar(64)
FILES FILE_TYPE varchar(20)
@@ -8870,9 +8893,9 @@ FILES CHECKSUM bigint(21) unsigned
FILES STATUS varchar(20)
FILES EXTRA varchar(255)
GLOBAL_STATUS VARIABLE_NAME varchar(64)
-GLOBAL_STATUS VARIABLE_VALUE decimal(22,7)
+GLOBAL_STATUS VARIABLE_VALUE varchar(20480)
GLOBAL_VARIABLES VARIABLE_NAME varchar(64)
-GLOBAL_VARIABLES VARIABLE_VALUE longtext
+GLOBAL_VARIABLES VARIABLE_VALUE varchar(20480)
KEY_COLUMN_USAGE CONSTRAINT_CATALOG varchar(4096)
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA varchar(64)
KEY_COLUMN_USAGE CONSTRAINT_NAME varchar(64)
@@ -8959,6 +8982,9 @@ ROUTINES LAST_ALTERED datetime
ROUTINES SQL_MODE longtext
ROUTINES ROUTINE_COMMENT varchar(64)
ROUTINES DEFINER varchar(77)
+ROUTINES CHARACTER_SET_CLIENT varchar(32)
+ROUTINES COLLATION_CONNECTION varchar(32)
+ROUTINES DATABASE_COLLATION varchar(32)
SCHEMATA CATALOG_NAME varchar(4096)
SCHEMATA SCHEMA_NAME varchar(64)
SCHEMATA DEFAULT_CHARACTER_SET_NAME varchar(64)
@@ -8970,9 +8996,9 @@ SCHEMA_PRIVILEGES TABLE_SCHEMA varchar(64)
SCHEMA_PRIVILEGES PRIVILEGE_TYPE varchar(64)
SCHEMA_PRIVILEGES IS_GRANTABLE varchar(3)
SESSION_STATUS VARIABLE_NAME varchar(64)
-SESSION_STATUS VARIABLE_VALUE decimal(22,7)
+SESSION_STATUS VARIABLE_VALUE varchar(20480)
SESSION_VARIABLES VARIABLE_NAME varchar(64)
-SESSION_VARIABLES VARIABLE_VALUE longtext
+SESSION_VARIABLES VARIABLE_VALUE varchar(20480)
STATISTICS TABLE_CATALOG varchar(4096)
STATISTICS TABLE_SCHEMA varchar(64)
STATISTICS TABLE_NAME varchar(64)
@@ -9040,6 +9066,9 @@ TRIGGERS ACTION_REFERENCE_NEW_ROW varchar(3)
TRIGGERS CREATED datetime
TRIGGERS SQL_MODE longtext
TRIGGERS DEFINER longtext
+TRIGGERS CHARACTER_SET_CLIENT varchar(32)
+TRIGGERS COLLATION_CONNECTION varchar(32)
+TRIGGERS DATABASE_COLLATION varchar(32)
USER_PRIVILEGES GRANTEE varchar(81)
USER_PRIVILEGES TABLE_CATALOG varchar(4096)
USER_PRIVILEGES PRIVILEGE_TYPE varchar(64)
@@ -9052,6 +9081,8 @@ VIEWS CHECK_OPTION varchar(8)
VIEWS IS_UPDATABLE varchar(3)
VIEWS DEFINER varchar(77)
VIEWS SECURITY_TYPE varchar(7)
+VIEWS CHARACTER_SET_CLIENT varchar(32)
+VIEWS COLLATION_CONNECTION varchar(32)
t1 f1 char(20)
t1 f2 char(25)
t1 f3 date
@@ -9617,10 +9648,10 @@ WHERE table_schema = 'information_schema'
AND table_name = 'character_sets'
ORDER BY 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 information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 character_sets CHARACTER_SET_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema character_sets DEFAULT_COLLATE_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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
Testcase 3.2.2.2:
--------------------------------------------------------------------------------
@@ -9700,12 +9731,12 @@ WHERE table_schema = 'information_schema'
AND table_name = 'collations'
ORDER BY 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 information_schema COLLATIONS COLLATION_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLLATIONS CHARACTER_SET_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLLATIONS ID 3 0 NO bigint NULL NULL 19 0 NULL NULL bigint(11) 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 IS_COMPILED 5 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 collations COLLATION_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema collations CHARACTER_SET_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema collations ID 3 0 NO bigint NULL NULL 19 0 NULL NULL bigint(11) 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 IS_COMPILED 5 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
Testcase 3.2.3.2:
--------------------------------------------------------------------------------
@@ -9866,8 +9897,8 @@ WHERE table_schema = 'information_schema'
AND table_name = 'collation_character_set_applicability'
ORDER BY 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 information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema collation_character_set_applicability COLLATION_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema collation_character_set_applicability CHARACTER_SET_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
Testcase 3.2.4.2:
--------------------------------------------------------------------------------
@@ -10039,13 +10070,13 @@ WHERE table_schema = 'information_schema'
AND table_name = 'column_privileges'
ORDER BY 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 information_schema COLUMN_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
-NULL information_schema COLUMN_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 COLUMN_PRIVILEGES TABLE_NAME 4 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 PRIVILEGE_TYPE 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
+NULL information_schema column_privileges TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 column_privileges TABLE_NAME 4 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 PRIVILEGE_TYPE 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema column_privileges IS_GRANTABLE 7 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
Testcase 3.2.5.2 + 3.2.5.3 + 3.2.5.4:
--------------------------------------------------------------------------------
@@ -10223,25 +10254,25 @@ WHERE table_schema = 'information_schema'
AND table_name = 'columns'
ORDER BY 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 information_schema COLUMNS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
-NULL information_schema COLUMNS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 COLUMN_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 COLUMN_DEFAULT 6 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DATA_TYPE 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 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 CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMNS COLUMN_TYPE 15 NO 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 EXTRA 17 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
-NULL information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) 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 TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
+NULL information_schema columns TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 COLUMN_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 COLUMN_DEFAULT 6 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DATA_TYPE 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 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 CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema columns COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema columns COLUMN_TYPE 15 NO 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 EXTRA 17 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
+NULL information_schema columns PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
+NULL information_schema columns COLUMN_COMMENT 19 NO varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) select
Testcase 3.2.6.2 + 3.2.6.3:
--------------------------------------------------------------------------------
@@ -10331,6 +10362,9 @@ NULL information_schema EVENTS LAST_ALTERED 18 0000-00-00 00:00:00 NO datetime N
NULL information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime 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 ORIGINATOR 21 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10) 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 DATABASE_COLLATION 24 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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
@@ -10370,9 +10404,9 @@ NULL information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 19 0 NULL NU
NULL information_schema FILES STATUS 37 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema FILES EXTRA 38 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -10459,6 +10493,9 @@ NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime
NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 DATABASE_COLLATION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -10470,9 +10507,9 @@ NULL information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL
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 IS_GRANTABLE 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema STATISTICS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -10540,6 +10577,9 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NUL
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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 TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -10552,6 +10592,8 @@ NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+NULL information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
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 Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI 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
@@ -10599,6 +10641,10 @@ NULL mysql event sql_mode 15 NO set 431 1293 NULL NULL utf8 utf8_general_ci set
NULL mysql event comment 16 NO char 64 192 NULL NULL utf8 utf8_bin char(64) select,insert,update,references
NULL mysql event originator 17 NULL NO int NULL NULL 10 0 NULL NULL int(10) 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 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 db_collation 21 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) 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 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 dl 3 NO char 128 384 NULL NULL utf8 utf8_bin char(128) select,insert,update,references
@@ -10668,6 +10714,10 @@ NULL mysql proc created 13 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NU
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 sql_mode 15 NO set 431 1293 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') 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 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 db_collation 19 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) 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 procs_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) 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 User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
@@ -11139,6 +11189,9 @@ NULL information_schema EVENTS LAST_ALTERED 18 0000-00-00 00:00:00 NO datetime N
NULL information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime 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 ORIGINATOR 21 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10) 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 DATABASE_COLLATION 24 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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
@@ -11178,9 +11231,9 @@ NULL information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 19 0 NULL NU
NULL information_schema FILES STATUS 37 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema FILES EXTRA 38 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -11267,6 +11320,9 @@ NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime
NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 DATABASE_COLLATION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -11278,9 +11334,9 @@ NULL information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL
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 IS_GRANTABLE 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema STATISTICS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -11348,6 +11404,9 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NUL
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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 TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -11360,6 +11419,8 @@ NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+NULL information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
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
@@ -11685,6 +11746,9 @@ NULL information_schema EVENTS LAST_ALTERED 18 0000-00-00 00:00:00 NO datetime N
NULL information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime 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 ORIGINATOR 21 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10) 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 DATABASE_COLLATION 24 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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
@@ -11724,9 +11788,9 @@ NULL information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 19 0 NULL NU
NULL information_schema FILES STATUS 37 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema FILES EXTRA 38 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -11813,6 +11877,9 @@ NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime
NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 DATABASE_COLLATION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -11824,9 +11891,9 @@ NULL information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL
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 IS_GRANTABLE 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema STATISTICS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -11894,6 +11961,9 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NUL
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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 TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -11906,6 +11976,8 @@ NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+NULL information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
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
@@ -12319,6 +12391,9 @@ NULL information_schema EVENTS LAST_ALTERED datetime NULL NULL NULL NULL datetim
NULL information_schema EVENTS LAST_EXECUTED datetime NULL NULL NULL NULL datetime
3.0000 information_schema EVENTS EVENT_COMMENT varchar 64 192 utf8 utf8_general_ci varchar(64)
NULL information_schema EVENTS ORIGINATOR bigint NULL NULL NULL NULL bigint(10)
+3.0000 information_schema EVENTS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema EVENTS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema EVENTS DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
NULL information_schema FILES FILE_ID bigint NULL NULL NULL NULL bigint(4)
3.0000 information_schema FILES FILE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema FILES FILE_TYPE varchar 20 60 utf8 utf8_general_ci varchar(20)
@@ -12358,9 +12433,9 @@ NULL information_schema FILES CHECKSUM bigint NULL NULL NULL NULL bigint(21) uns
3.0000 information_schema FILES STATUS varchar 20 60 utf8 utf8_general_ci varchar(20)
3.0000 information_schema FILES EXTRA varchar 255 765 utf8 utf8_general_ci varchar(255)
3.0000 information_schema GLOBAL_STATUS VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-NULL information_schema GLOBAL_STATUS VARIABLE_VALUE decimal NULL NULL NULL NULL decimal(22,7)
+3.0000 information_schema GLOBAL_STATUS VARIABLE_VALUE varchar 20480 61440 utf8 utf8_general_ci varchar(20480)
3.0000 information_schema GLOBAL_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-1.0000 information_schema GLOBAL_VARIABLES VARIABLE_VALUE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
+3.0000 information_schema GLOBAL_VARIABLES VARIABLE_VALUE varchar 20480 61440 utf8 utf8_general_ci varchar(20480)
3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG varchar 4096 12288 utf8 utf8_general_ci varchar(4096)
3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -12447,6 +12522,9 @@ NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datet
1.0000 information_schema ROUTINES SQL_MODE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
3.0000 information_schema ROUTINES ROUTINE_COMMENT varchar 64 192 utf8 utf8_general_ci varchar(64)
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)
+3.0000 information_schema ROUTINES DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema SCHEMATA CATALOG_NAME varchar 4096 12288 utf8 utf8_general_ci varchar(4096)
3.0000 information_schema SCHEMATA SCHEMA_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -12458,9 +12536,9 @@ NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datet
3.0000 information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema SCHEMA_PRIVILEGES IS_GRANTABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
3.0000 information_schema SESSION_STATUS VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-NULL information_schema SESSION_STATUS VARIABLE_VALUE decimal NULL NULL NULL NULL decimal(22,7)
+3.0000 information_schema SESSION_STATUS VARIABLE_VALUE varchar 20480 61440 utf8 utf8_general_ci varchar(20480)
3.0000 information_schema SESSION_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-1.0000 information_schema SESSION_VARIABLES VARIABLE_VALUE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
+3.0000 information_schema SESSION_VARIABLES VARIABLE_VALUE varchar 20480 61440 utf8 utf8_general_ci varchar(20480)
3.0000 information_schema STATISTICS TABLE_CATALOG varchar 4096 12288 utf8 utf8_general_ci varchar(4096)
3.0000 information_schema STATISTICS TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema STATISTICS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -12528,6 +12606,9 @@ NULL information_schema TRIGGERS ACTION_ORDER bigint NULL NULL NULL NULL bigint(
NULL information_schema TRIGGERS CREATED datetime NULL NULL NULL NULL datetime
1.0000 information_schema TRIGGERS SQL_MODE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
1.0000 information_schema TRIGGERS DEFINER longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
+3.0000 information_schema TRIGGERS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema TRIGGERS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema TRIGGERS DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema USER_PRIVILEGES GRANTEE varchar 81 243 utf8 utf8_general_ci varchar(81)
3.0000 information_schema USER_PRIVILEGES TABLE_CATALOG varchar 4096 12288 utf8 utf8_general_ci varchar(4096)
3.0000 information_schema USER_PRIVILEGES PRIVILEGE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -12540,6 +12621,8 @@ NULL information_schema TRIGGERS CREATED datetime NULL NULL NULL NULL datetime
3.0000 information_schema VIEWS IS_UPDATABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
3.0000 information_schema VIEWS DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77)
3.0000 information_schema VIEWS SECURITY_TYPE varchar 7 21 utf8 utf8_general_ci varchar(7)
+3.0000 information_schema VIEWS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema VIEWS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 mysql columns_priv Host char 60 180 utf8 utf8_bin char(60)
3.0000 mysql columns_priv Db char 64 192 utf8 utf8_bin char(64)
3.0000 mysql columns_priv User char 16 48 utf8 utf8_bin char(16)
@@ -12587,6 +12670,10 @@ NULL mysql event ends datetime NULL NULL NULL NULL datetime
3.0000 mysql event comment char 64 192 utf8 utf8_bin char(64)
NULL mysql event originator int NULL NULL NULL NULL int(10)
1.0000 mysql event time_zone char 64 64 latin1 latin1_swedish_ci char(64)
+3.0000 mysql event character_set_client char 32 96 utf8 utf8_bin char(32)
+3.0000 mysql event collation_connection char 32 96 utf8 utf8_bin char(32)
+3.0000 mysql event db_collation char 32 96 utf8 utf8_bin char(32)
+1.0000 mysql event body_utf8 longblob 4294967295 4294967295 NULL NULL longblob
3.0000 mysql func name char 64 192 utf8 utf8_bin char(64)
NULL mysql func ret tinyint NULL NULL NULL NULL tinyint(1)
3.0000 mysql func dl char 128 384 utf8 utf8_bin char(128)
@@ -12656,6 +12743,10 @@ 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 431 1293 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')
3.0000 mysql proc comment char 64 192 utf8 utf8_bin char(64)
+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)
+1.0000 mysql proc body_utf8 longblob 4294967295 4294967295 NULL NULL longblob
3.0000 mysql procs_priv Host char 60 180 utf8 utf8_bin char(60)
3.0000 mysql procs_priv Db char 64 192 utf8 utf8_bin char(64)
3.0000 mysql procs_priv User char 16 48 utf8 utf8_bin char(16)
@@ -13106,18 +13197,18 @@ WHERE table_schema = 'information_schema'
AND table_name = 'key_column_usage'
ORDER BY 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 information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema KEY_COLUMN_USAGE TABLE_CATALOG 4 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 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 COLUMN_NAME 7 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_TABLE_SCHEMA 10 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_COLUMN_NAME 12 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema key_column_usage CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema key_column_usage TABLE_CATALOG 4 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 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 COLUMN_NAME 7 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_TABLE_SCHEMA 10 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_COLUMN_NAME 12 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
Testcase 3.2.7.2 + 3.2.7.3:
--------------------------------------------------------------------------------
@@ -13233,6 +13324,9 @@ LAST_ALTERED datetime NO 0000-00-00 00:00:00
SQL_MODE longtext NO
ROUTINE_COMMENT varchar(64) NO
DEFINER varchar(77) NO
+CHARACTER_SET_CLIENT varchar(32) NO
+COLLATION_CONNECTION varchar(32) NO
+DATABASE_COLLATION varchar(32) NO
SHOW CREATE TABLE routines;
Table Create Table
ROUTINES CREATE TEMPORARY TABLE `ROUTINES` (
@@ -13255,39 +13349,45 @@ ROUTINES CREATE TEMPORARY TABLE `ROUTINES` (
`LAST_ALTERED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`SQL_MODE` longtext NOT NULL,
`ROUTINE_COMMENT` varchar(64) NOT NULL DEFAULT '',
- `DEFINER` varchar(77) NOT NULL DEFAULT ''
+ `DEFINER` varchar(77) NOT NULL DEFAULT '',
+ `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '',
+ `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '',
+ `DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=utf8
SELECT COUNT(*) FROM information_schema.columns
WHERE table_schema = 'information_schema'
AND table_name = 'routines'
ORDER BY ordinal_position;
COUNT(*)
-20
+23
SELECT * FROM information_schema.columns
WHERE table_schema = 'information_schema'
AND table_name = 'routines'
ORDER BY 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 information_schema ROUTINES SPECIFIC_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema ROUTINES ROUTINE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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_NAME 4 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 DTD_IDENTIFIER 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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_DEFINITION 8 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 EXTERNAL_LANGUAGE 10 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 IS_DETERMINISTIC 12 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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_PATH 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime 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 SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 ROUTINE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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_NAME 4 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 DTD_IDENTIFIER 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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_DEFINITION 8 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 EXTERNAL_LANGUAGE 10 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 IS_DETERMINISTIC 12 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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_PATH 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime 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 SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 DATABASE_COLLATION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
Testcase 3.2.8.2 + 3.2.8.3:
--------------------------------------------------------------------------------
@@ -13325,16 +13425,16 @@ GRANT EXECUTE ON db_datadict_2.* TO 'user_2'@'localhost';
FLUSH PRIVILEGES;
connect(localhost,user_1,,db_datadict,MYSQL_PORT,MYSQL_SOCK);
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
-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
-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
+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
connect(localhost,user_2,,db_datadict,MYSQL_PORT,MYSQL_SOCK);
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
-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
+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
connect(localhost,user_3,,test,MYSQL_PORT,MYSQL_SOCK);
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
+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
root@localhost db_datadict_2
DROP USER 'user_1'@'localhost';
@@ -13559,6 +13659,9 @@ LAST_ALTERED YYYY-MM-DD hh:mm:ss
SQL_MODE
ROUTINE_COMMENT
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
LENGTH(routine_definition) 2549
use db_datadict;
drop procedure sp_6_408004;
@@ -13597,11 +13700,11 @@ WHERE table_schema = 'information_schema'
AND table_name = 'schemata'
ORDER BY 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 information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema SCHEMATA DEFAULT_COLLATION_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema SCHEMATA SQL_PATH 5 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
+NULL information_schema schemata CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema schemata DEFAULT_COLLATION_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema schemata SQL_PATH 5 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
Testcase 3.2.9.2 + 3.2.9.3:
--------------------------------------------------------------------------------
@@ -13681,12 +13784,12 @@ WHERE table_schema = 'information_schema'
AND table_name = 'table_constraints'
ORDER BY 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 information_schema TABLE_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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_NAME 3 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_CONSTRAINTS TABLE_NAME 5 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 CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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_NAME 3 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_constraints TABLE_NAME 5 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
Testcase 3.2.10.2 + 3.2.10.3:
--------------------------------------------------------------------------------
@@ -13761,12 +13864,12 @@ WHERE table_schema = 'information_schema'
AND table_name = 'table_privileges'
ORDER BY 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 information_schema TABLE_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
-NULL information_schema TABLE_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 TABLE_PRIVILEGES TABLE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 IS_GRANTABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 table_privileges TABLE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 IS_GRANTABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
Testcase 3.2.11.2 + 3.2.11.3 + 3.2.11.4:
--------------------------------------------------------------------------------
@@ -13907,27 +14010,27 @@ WHERE table_schema = 'information_schema'
AND table_name = 'tables'
ORDER BY 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 information_schema TABLES TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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_NAME 3 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 ENGINE 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema TABLES VERSION 6 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_ROWS 8 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 DATA_LENGTH 10 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 INDEX_LENGTH 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned 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 AUTO_INCREMENT 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema TABLES CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TABLES UPDATE_TIME 16 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TABLES CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TABLES TABLE_COLLATION 18 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned 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 TABLE_COMMENT 21 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
+NULL information_schema tables TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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_NAME 3 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 ENGINE 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema tables VERSION 6 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_ROWS 8 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 DATA_LENGTH 10 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 INDEX_LENGTH 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned 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 AUTO_INCREMENT 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+NULL information_schema tables CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+NULL information_schema tables UPDATE_TIME 16 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+NULL information_schema tables CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+NULL information_schema tables TABLE_COLLATION 18 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema tables CHECKSUM 19 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned 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 TABLE_COMMENT 21 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
Testcase 3.2.12.2 + 3.2.12.3:
--------------------------------------------------------------------------------
@@ -13962,7 +14065,7 @@ NULL information_schema ENGINES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL
NULL information_schema EVENTS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema FILES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema GLOBAL_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PARTITIONS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PLUGINS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -13972,7 +14075,7 @@ NULL information_schema ROUTINES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #
NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SESSION_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema SESSION_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SESSION_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema STATISTICS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -14013,7 +14116,7 @@ NULL information_schema ENGINES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL
NULL information_schema EVENTS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema FILES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema GLOBAL_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PARTITIONS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PLUGINS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -14023,7 +14126,7 @@ NULL information_schema ROUTINES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #
NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SESSION_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema SESSION_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SESSION_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema STATISTICS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -14062,7 +14165,7 @@ NULL information_schema ENGINES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL
NULL information_schema EVENTS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema FILES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema GLOBAL_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PARTITIONS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PLUGINS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -14072,7 +14175,7 @@ NULL information_schema ROUTINES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #
NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SESSION_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema SESSION_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SESSION_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema STATISTICS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -14112,7 +14215,7 @@ NULL information_schema ENGINES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL
NULL information_schema EVENTS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema FILES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema GLOBAL_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PARTITIONS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PLUGINS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -14122,7 +14225,7 @@ NULL information_schema ROUTINES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #
NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SESSION_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema SESSION_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SESSION_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema STATISTICS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -14141,11 +14244,11 @@ NULL mysql columns_priv BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF#
NULL mysql db BASE TABLE MyISAM 10 Fixed 3 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Database privileges
NULL mysql event BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Events
NULL mysql func BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL User defined functions
-NULL mysql general_log BASE TABLE CSV 10 Dynamic 2 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL General log
-NULL mysql help_category BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help categories
-NULL mysql help_keyword BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help keywords
-NULL mysql help_relation BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL keyword-topic relation
-NULL mysql help_topic BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help topics
+NULL mysql general_log BASE TABLE CSV 10 Dynamic 1 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL General log
+NULL mysql help_category BASE TABLE MyISAM 10 Fixed 37 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help categories
+NULL mysql help_keyword BASE TABLE MyISAM 10 Fixed 424 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help keywords
+NULL mysql help_relation BASE TABLE MyISAM 10 Fixed 901 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL keyword-topic relation
+NULL mysql help_topic BASE TABLE MyISAM 10 Dynamic 479 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help topics
NULL mysql host BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Host privileges; Merged with database privileges
NULL mysql ndb_binlog_index BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
NULL mysql plugin BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL MySQL plugins
@@ -14197,6 +14300,8 @@ CHECK_OPTION varchar(8) NO
IS_UPDATABLE varchar(3) NO
DEFINER varchar(77) NO
SECURITY_TYPE varchar(7) NO
+CHARACTER_SET_CLIENT varchar(32) NO
+COLLATION_CONNECTION varchar(32) NO
SHOW CREATE TABLE views;
Table Create Table
VIEWS CREATE TEMPORARY TABLE `VIEWS` (
@@ -14207,27 +14312,31 @@ VIEWS CREATE TEMPORARY TABLE `VIEWS` (
`CHECK_OPTION` varchar(8) NOT NULL DEFAULT '',
`IS_UPDATABLE` varchar(3) NOT NULL DEFAULT '',
`DEFINER` varchar(77) NOT NULL DEFAULT '',
- `SECURITY_TYPE` varchar(7) NOT NULL DEFAULT ''
+ `SECURITY_TYPE` varchar(7) NOT NULL DEFAULT '',
+ `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '',
+ `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=utf8
SELECT COUNT(*) FROM information_schema.columns
WHERE table_schema = 'information_schema'
AND table_name = 'views'
ORDER BY ordinal_position;
COUNT(*)
-8
+10
SELECT * FROM information_schema.columns
WHERE table_schema = 'information_schema'
AND table_name = 'views'
ORDER BY 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 information_schema VIEWS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema VIEWS VIEW_DEFINITION 4 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
-NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema views VIEW_DEFINITION 4 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+NULL information_schema views DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+NULL information_schema views COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
Testcase 3.2.13.2 + 3.2.13.3:
--------------------------------------------------------------------------------
@@ -14245,21 +14354,21 @@ GRANT SELECT ON db_datadict.v_granted_to_1 TO 'user_1'@'localhost';
GRANT SHOW VIEW, CREATE VIEW ON db_datadict.* TO 'user_2'@'localhost';
FLUSH PRIVILEGES;
SELECT * FROM information_schema.views;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
-NULL db_datadict v_granted_glob /* ALGORITHM=UNDEFINED */ select `db_datadict`.`tb_401302`.`f2` AS `f2`,`db_datadict`.`tb_401302`.`f3` AS `f3` from `db_datadict`.`tb_401302` NONE YES root@localhost DEFINER
-NULL db_datadict v_granted_to_1 /* ALGORITHM=UNDEFINED */ select `db_datadict`.`tb_401302`.`f1` AS `f1`,`db_datadict`.`tb_401302`.`f2` AS `f2`,`db_datadict`.`tb_401302`.`f3` AS `f3` from `db_datadict`.`tb_401302` NONE YES root@localhost DEFINER
+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 f2, f3 FROM tb_401302 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
+NULL db_datadict v_granted_to_1 SELECT * FROM tb_401302 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
connect(localhost,user_1,,test,MYSQL_PORT,MYSQL_SOCK);
SELECT * FROM information_schema.views;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
-NULL db_datadict v_granted_to_1 NONE YES root@localhost DEFINER
+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
connect(localhost,user_2,,test,MYSQL_PORT,MYSQL_SOCK);
SELECT * FROM information_schema.views;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
-NULL db_datadict v_granted_glob NONE YES root@localhost DEFINER
-NULL db_datadict v_granted_to_1 NONE YES root@localhost DEFINER
+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
connect(localhost,user_no_views,,test,MYSQL_PORT,MYSQL_SOCK);
SELECT * FROM information_schema.views;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
root@localhost db_datadict
USE db_datadict;
@@ -14322,21 +14431,21 @@ WHERE table_schema = 'information_schema'
AND table_name = 'statistics'
ORDER BY 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 information_schema STATISTICS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
-NULL information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 NON_UNIQUE 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(1) 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_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 COLUMN_NAME 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
-NULL information_schema STATISTICS SUB_PART 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(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 NULLABLE 13 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 COMMENT 15 NULL YES varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16) select
+NULL information_schema statistics TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
+NULL information_schema statistics TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 NON_UNIQUE 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(1) 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_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 COLUMN_NAME 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
+NULL information_schema statistics SUB_PART 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(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 NULLABLE 13 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 COMMENT 15 NULL YES varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16) select
Testcase 3.2.14.2 + 3.2.14.3:
--------------------------------------------------------------------------------
@@ -14390,14 +14499,14 @@ NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE
NULL mysql event 0 mysql PRIMARY 1 db A NULL NULL NULL BTREE
NULL mysql event 0 mysql PRIMARY 2 name A 0 NULL NULL BTREE
NULL mysql func 0 mysql PRIMARY 1 name A 0 NULL NULL BTREE
-NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 0 NULL NULL BTREE
-NULL mysql help_category 0 mysql name 1 name A 0 NULL NULL BTREE
-NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A 0 NULL NULL BTREE
-NULL mysql help_keyword 0 mysql name 1 name A 0 NULL NULL BTREE
+NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 37 NULL NULL BTREE
+NULL mysql help_category 0 mysql name 1 name A 37 NULL NULL BTREE
+NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A 424 NULL NULL BTREE
+NULL mysql help_keyword 0 mysql name 1 name A 424 NULL NULL BTREE
NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A NULL NULL NULL BTREE
-NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A 0 NULL NULL BTREE
-NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A 0 NULL NULL BTREE
-NULL mysql help_topic 0 mysql name 1 name A 0 NULL NULL BTREE
+NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A 901 NULL NULL BTREE
+NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A 479 NULL NULL BTREE
+NULL mysql help_topic 0 mysql name 1 name A 479 NULL NULL BTREE
NULL mysql host 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
NULL mysql host 0 mysql PRIMARY 2 Db A 0 NULL NULL BTREE
NULL mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A 0 NULL NULL BTREE
@@ -14478,11 +14587,11 @@ WHERE table_schema = 'information_schema'
AND table_name = 'schema_privileges'
ORDER BY 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 information_schema SCHEMA_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
-NULL information_schema SCHEMA_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 SCHEMA_PRIVILEGES PRIVILEGE_TYPE 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
+NULL information_schema schema_privileges TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 schema_privileges PRIVILEGE_TYPE 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema schema_privileges IS_GRANTABLE 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
Testcase 3.2.15.2:
--------------------------------------------------------------------------------
@@ -14647,10 +14756,10 @@ WHERE table_schema = 'information_schema'
AND table_name = 'user_privileges'
ORDER BY 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 information_schema USER_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
-NULL information_schema USER_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 IS_GRANTABLE 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 IS_GRANTABLE 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
Testcase 3.2.16.2 + 3.2.16.3 + 3.2.16.4:
--------------------------------------------------------------------------------
@@ -15011,6 +15120,9 @@ ACTION_REFERENCE_NEW_ROW varchar(3) NO
CREATED datetime YES NULL
SQL_MODE longtext NO
DEFINER longtext NO
+CHARACTER_SET_CLIENT varchar(32) NO
+COLLATION_CONNECTION varchar(32) NO
+DATABASE_COLLATION varchar(32) NO
SHOW CREATE TABLE triggers;
Table Create Table
TRIGGERS CREATE TEMPORARY TABLE `TRIGGERS` (
@@ -15032,38 +15144,44 @@ TRIGGERS CREATE TEMPORARY TABLE `TRIGGERS` (
`ACTION_REFERENCE_NEW_ROW` varchar(3) NOT NULL DEFAULT '',
`CREATED` datetime DEFAULT NULL,
`SQL_MODE` longtext NOT NULL,
- `DEFINER` longtext NOT NULL
+ `DEFINER` longtext NOT NULL,
+ `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '',
+ `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '',
+ `DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=utf8
SELECT COUNT(*) FROM information_schema.columns
WHERE table_schema = 'information_schema'
AND table_name = 'triggers'
ORDER BY ordinal_position;
COUNT(*)
-19
+22
SELECT * FROM information_schema.columns
WHERE table_schema = 'information_schema'
AND table_name = 'triggers'
ORDER BY 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 information_schema TRIGGERS TRIGGER_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
-NULL information_schema TRIGGERS TRIGGER_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 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 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) 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_STATEMENT 10 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) 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_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_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
-NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema triggers TRIGGER_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
+NULL information_schema triggers TRIGGER_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 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 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) 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_STATEMENT 10 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) 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_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_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+NULL information_schema triggers CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+NULL information_schema triggers SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema triggers DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
Testcase 3.2.18.2 + 3.2.18.3:
--------------------------------------------------------------------------------
@@ -15131,17 +15249,17 @@ WHERE table_schema = 'information_schema'
AND table_name = 'referential_constraints'
ORDER BY 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 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 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 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 UNIQUE_CONSTRAINT_NAME 6 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 UPDATE_RULE 8 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 TABLE_NAME 10 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 CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 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 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 UNIQUE_CONSTRAINT_NAME 6 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 UPDATE_RULE 8 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 TABLE_NAME 10 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
*** End of Data Dictionary Tests ***
--------------------------------------------------------------------------------
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 ab4508fb302..02ef728fad5 100644
--- a/mysql-test/suite/funcs_1/r/memory_func_view.result
+++ b/mysql-test/suite/funcs_1/r/memory_func_view.result
@@ -286,8 +286,8 @@ CREATE VIEW v1 AS SELECT my_char_30, id FROM t1_values;
SELECT my_char_30, id FROM t1_values
WHERE select_id = 190 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 190 OR select_id IS NULL) order by id;
@@ -304,8 +304,8 @@ A<--------30 characters-------> <--------30 characters-------> 3
A ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
A-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select concat(_latin1'A',`t1_values`.`my_char_30`) AS `CONCAT('A',my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select concat(_latin1'A',`t1_values`.`my_char_30`) AS `CONCAT('A',my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 189 OR select_id IS NULL) order by id;
@@ -324,8 +324,8 @@ SELECT LTRIM(my_varbinary_1000),
my_varbinary_1000, id FROM t1_values
WHERE select_id = 188 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_varbinary_1000`) AS `LTRIM(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_varbinary_1000`) AS `LTRIM(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 188 OR select_id IS NULL) order by id;
@@ -338,8 +338,8 @@ SELECT LTRIM(my_binary_30),
my_binary_30, id FROM t1_values
WHERE select_id = 187 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_binary_30`) AS `LTRIM(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_binary_30`) AS `LTRIM(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 187 OR select_id IS NULL) order by id;
@@ -352,8 +352,8 @@ SELECT LTRIM(my_varchar_1000),
my_varchar_1000, id FROM t1_values
WHERE select_id = 186 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_varchar_1000`) AS `LTRIM(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_varchar_1000`) AS `LTRIM(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 186 OR select_id IS NULL) order by id;
@@ -366,8 +366,8 @@ SELECT LTRIM(my_char_30),
my_char_30, id FROM t1_values
WHERE select_id = 185 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_char_30`) AS `LTRIM(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_char_30`) AS `LTRIM(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 185 OR select_id IS NULL) order by id;
@@ -380,8 +380,8 @@ SELECT LOWER(my_varbinary_1000),
my_varbinary_1000, id FROM t1_values
WHERE select_id = 184 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_varbinary_1000`) AS `LOWER(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_varbinary_1000`) AS `LOWER(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 184 OR select_id IS NULL) order by id;
@@ -394,8 +394,8 @@ SELECT LOWER(my_binary_30),
my_binary_30, id FROM t1_values
WHERE select_id = 183 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_binary_30`) AS `LOWER(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_binary_30`) AS `LOWER(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 183 OR select_id IS NULL) order by id;
@@ -408,8 +408,8 @@ SELECT LOWER(my_varchar_1000),
my_varchar_1000, id FROM t1_values
WHERE select_id = 182 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_varchar_1000`) AS `LOWER(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_varchar_1000`) AS `LOWER(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 182 OR select_id IS NULL) order by id;
@@ -422,8 +422,8 @@ SELECT LOWER(my_char_30),
my_char_30, id FROM t1_values
WHERE select_id = 181 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_char_30`) AS `LOWER(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_char_30`) AS `LOWER(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 181 OR select_id IS NULL) order by id;
@@ -436,8 +436,8 @@ SELECT LOCATE('-', ' - -ABC', my_decimal),
my_decimal, id FROM t1_values
WHERE select_id = 180 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',_latin1' - -ABC',`t1_values`.`my_decimal`) AS `LOCATE('-', ' - -ABC', my_decimal)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',_latin1' - -ABC',`t1_values`.`my_decimal`) AS `LOCATE('-', ' - -ABC', my_decimal)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 180 OR select_id IS NULL) order by id;
@@ -450,8 +450,8 @@ SELECT LOCATE('-', ' - -ABC', my_double),
my_double, id FROM t1_values
WHERE select_id = 179 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',_latin1' - -ABC',`t1_values`.`my_double`) AS `LOCATE('-', ' - -ABC', my_double)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',_latin1' - -ABC',`t1_values`.`my_double`) AS `LOCATE('-', ' - -ABC', my_double)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 179 OR select_id IS NULL) order by id;
@@ -464,8 +464,8 @@ SELECT LOCATE('-', ' - -ABC', my_bigint),
my_bigint, id FROM t1_values
WHERE select_id = 178 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',_latin1' - -ABC',`t1_values`.`my_bigint`) AS `LOCATE('-', ' - -ABC', my_bigint)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',_latin1' - -ABC',`t1_values`.`my_bigint`) AS `LOCATE('-', ' - -ABC', my_bigint)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 178 OR select_id IS NULL) order by id;
@@ -478,8 +478,8 @@ SELECT LOCATE('-', my_varbinary_1000, 3),
my_varbinary_1000, id FROM t1_values
WHERE select_id = 177 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_varbinary_1000`,3) AS `LOCATE('-', my_varbinary_1000, 3)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_varbinary_1000`,3) AS `LOCATE('-', my_varbinary_1000, 3)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 177 OR select_id IS NULL) order by id;
@@ -492,8 +492,8 @@ SELECT LOCATE('-', my_binary_30, 3),
my_binary_30, id FROM t1_values
WHERE select_id = 176 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_binary_30`,3) AS `LOCATE('-', my_binary_30, 3)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_binary_30`,3) AS `LOCATE('-', my_binary_30, 3)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 176 OR select_id IS NULL) order by id;
@@ -506,8 +506,8 @@ SELECT LOCATE('-', my_varchar_1000, 3),
my_varchar_1000, id FROM t1_values
WHERE select_id = 175 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_varchar_1000`,3) AS `LOCATE('-', my_varchar_1000, 3)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_varchar_1000`,3) AS `LOCATE('-', my_varchar_1000, 3)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 175 OR select_id IS NULL) order by id;
@@ -520,8 +520,8 @@ SELECT LOCATE('-', my_char_30, 3),
my_char_30, id FROM t1_values
WHERE select_id = 174 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_char_30`,3) AS `LOCATE('-', my_char_30, 3)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_char_30`,3) AS `LOCATE('-', my_char_30, 3)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 174 OR select_id IS NULL) order by id;
@@ -534,8 +534,8 @@ SELECT LOCATE(my_varbinary_1000, my_binary_30 ),
my_varbinary_1000, my_binary_30 id FROM t1_values
WHERE select_id = 173 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_binary_30`) AS `LOCATE(my_varbinary_1000, my_binary_30 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`my_binary_30` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_binary_30`) AS `LOCATE(my_varbinary_1000, my_binary_30 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`my_binary_30` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 173 OR select_id IS NULL) order by id;
@@ -548,8 +548,8 @@ SELECT LOCATE(my_varbinary_1000, my_varchar_1000 ),
my_varbinary_1000, my_varchar_1000 id FROM t1_values
WHERE select_id = 172 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_varbinary_1000, my_varchar_1000 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`my_varchar_1000` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_varbinary_1000, my_varchar_1000 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`my_varchar_1000` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 172 OR select_id IS NULL) order by id;
@@ -562,8 +562,8 @@ SELECT LOCATE(my_varbinary_1000, my_char_30 ),
my_varbinary_1000, my_char_30 id FROM t1_values
WHERE select_id = 171 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_char_30`) AS `LOCATE(my_varbinary_1000, my_char_30 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`my_char_30` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_char_30`) AS `LOCATE(my_varbinary_1000, my_char_30 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`my_char_30` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 171 OR select_id IS NULL) order by id;
@@ -576,8 +576,8 @@ SELECT LOCATE(my_varbinary_1000, my_varbinary_1000 ),
my_varbinary_1000, id FROM t1_values
WHERE select_id = 170 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_varbinary_1000, my_varbinary_1000 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_varbinary_1000, my_varbinary_1000 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 170 OR select_id IS NULL) order by id;
@@ -590,8 +590,8 @@ SELECT LOCATE(my_binary_30, my_varbinary_1000 ),
my_binary_30, my_varbinary_1000 id FROM t1_values
WHERE select_id = 169 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_binary_30, my_varbinary_1000 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`my_varbinary_1000` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_binary_30, my_varbinary_1000 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`my_varbinary_1000` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 169 OR select_id IS NULL) order by id;
@@ -604,8 +604,8 @@ SELECT LOCATE(my_binary_30, my_varchar_1000 ),
my_binary_30, my_varchar_1000 id FROM t1_values
WHERE select_id = 168 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_binary_30, my_varchar_1000 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`my_varchar_1000` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_binary_30, my_varchar_1000 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`my_varchar_1000` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 168 OR select_id IS NULL) order by id;
@@ -618,8 +618,8 @@ SELECT LOCATE(my_binary_30, my_char_30 ),
my_binary_30, my_char_30 id FROM t1_values
WHERE select_id = 167 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_char_30`) AS `LOCATE(my_binary_30, my_char_30 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`my_char_30` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_char_30`) AS `LOCATE(my_binary_30, my_char_30 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`my_char_30` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 167 OR select_id IS NULL) order by id;
@@ -632,8 +632,8 @@ SELECT LOCATE(my_binary_30, my_binary_30 ),
my_binary_30, id FROM t1_values
WHERE select_id = 166 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_binary_30`) AS `LOCATE(my_binary_30, my_binary_30 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_binary_30`) AS `LOCATE(my_binary_30, my_binary_30 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 166 OR select_id IS NULL) order by id;
@@ -646,8 +646,8 @@ SELECT LOCATE(my_varchar_1000, my_varbinary_1000 ),
my_varchar_1000, my_varbinary_1000 id FROM t1_values
WHERE select_id = 165 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_varchar_1000, my_varbinary_1000 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`my_varbinary_1000` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_varchar_1000, my_varbinary_1000 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`my_varbinary_1000` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 165 OR select_id IS NULL) order by id;
@@ -660,8 +660,8 @@ SELECT LOCATE(my_varchar_1000, my_binary_30 ),
my_varchar_1000, my_binary_30 id FROM t1_values
WHERE select_id = 164 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_binary_30`) AS `LOCATE(my_varchar_1000, my_binary_30 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`my_binary_30` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_binary_30`) AS `LOCATE(my_varchar_1000, my_binary_30 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`my_binary_30` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 164 OR select_id IS NULL) order by id;
@@ -674,8 +674,8 @@ SELECT LOCATE(my_varchar_1000, my_char_30 ),
my_varchar_1000, my_char_30 id FROM t1_values
WHERE select_id = 163 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_char_30`) AS `LOCATE(my_varchar_1000, my_char_30 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`my_char_30` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_char_30`) AS `LOCATE(my_varchar_1000, my_char_30 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`my_char_30` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 163 OR select_id IS NULL) order by id;
@@ -688,8 +688,8 @@ SELECT LOCATE(my_varchar_1000, my_varchar_1000 ),
my_varchar_1000, id FROM t1_values
WHERE select_id = 162 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_varchar_1000, my_varchar_1000 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_varchar_1000, my_varchar_1000 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 162 OR select_id IS NULL) order by id;
@@ -702,8 +702,8 @@ SELECT LOCATE(my_char_30, my_varbinary_1000 ),
my_char_30, my_varbinary_1000 id FROM t1_values
WHERE select_id = 161 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_char_30, my_varbinary_1000 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`my_varbinary_1000` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_char_30, my_varbinary_1000 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`my_varbinary_1000` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 161 OR select_id IS NULL) order by id;
@@ -716,8 +716,8 @@ SELECT LOCATE(my_char_30, my_binary_30 ),
my_char_30, my_binary_30 id FROM t1_values
WHERE select_id = 160 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_binary_30`) AS `LOCATE(my_char_30, my_binary_30 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`my_binary_30` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_binary_30`) AS `LOCATE(my_char_30, my_binary_30 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`my_binary_30` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 160 OR select_id IS NULL) order by id;
@@ -730,8 +730,8 @@ SELECT LOCATE(my_char_30, my_varchar_1000 ),
my_char_30, my_varchar_1000 id FROM t1_values
WHERE select_id = 159 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_char_30, my_varchar_1000 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`my_varchar_1000` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_char_30, my_varchar_1000 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`my_varchar_1000` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 159 OR select_id IS NULL) order by id;
@@ -744,8 +744,8 @@ SELECT LOCATE(my_char_30, my_char_30 ),
my_char_30, id FROM t1_values
WHERE select_id = 158 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_char_30`) AS `LOCATE(my_char_30, my_char_30 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_char_30`) AS `LOCATE(my_char_30, my_char_30 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 158 OR select_id IS NULL) order by id;
@@ -758,8 +758,8 @@ SELECT LOCATE('char', my_varbinary_1000),
my_varbinary_1000, id FROM t1_values
WHERE select_id = 157 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_varbinary_1000`) AS `LOCATE('char', my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_varbinary_1000`) AS `LOCATE('char', my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 157 OR select_id IS NULL) order by id;
@@ -772,8 +772,8 @@ SELECT LOCATE('char', my_binary_30),
my_binary_30, id FROM t1_values
WHERE select_id = 156 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_binary_30`) AS `LOCATE('char', my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_binary_30`) AS `LOCATE('char', my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 156 OR select_id IS NULL) order by id;
@@ -786,8 +786,8 @@ SELECT LOCATE('char', my_varchar_1000),
my_varchar_1000, id FROM t1_values
WHERE select_id = 155 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_varchar_1000`) AS `LOCATE('char', my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_varchar_1000`) AS `LOCATE('char', my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 155 OR select_id IS NULL) order by id;
@@ -800,8 +800,8 @@ SELECT LOCATE('char', my_char_30),
my_char_30, id FROM t1_values
WHERE select_id = 154 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_char_30`) AS `LOCATE('char', my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_char_30`) AS `LOCATE('char', my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 154 OR select_id IS NULL) order by id;
@@ -823,8 +823,8 @@ LOAD_FILE('../tmp/func_view.dat') id
äÄ@
5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select load_file(_latin1'../tmp/func_view.dat') AS `LOAD_FILE('../tmp/func_view.dat')`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select load_file(_latin1'../tmp/func_view.dat') AS `LOAD_FILE('../tmp/func_view.dat')`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 153 OR select_id IS NULL) order by id;
@@ -848,8 +848,8 @@ SELECT LENGTH(my_varbinary_1000),
my_varbinary_1000, id FROM t1_values
WHERE select_id = 152 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_varbinary_1000`) AS `LENGTH(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_varbinary_1000`) AS `LENGTH(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 152 OR select_id IS NULL) order by id;
@@ -862,8 +862,8 @@ SELECT LENGTH(my_binary_30),
my_binary_30, id FROM t1_values
WHERE select_id = 151 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_binary_30`) AS `LENGTH(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_binary_30`) AS `LENGTH(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 151 OR select_id IS NULL) order by id;
@@ -876,8 +876,8 @@ SELECT LENGTH(my_varchar_1000),
my_varchar_1000, id FROM t1_values
WHERE select_id = 150 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_varchar_1000`) AS `LENGTH(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_varchar_1000`) AS `LENGTH(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 150 OR select_id IS NULL) order by id;
@@ -890,8 +890,8 @@ SELECT LENGTH(my_char_30),
my_char_30, id FROM t1_values
WHERE select_id = 149 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_char_30`) AS `LENGTH(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_char_30`) AS `LENGTH(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 149 OR select_id IS NULL) order by id;
@@ -911,8 +911,8 @@ Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(_latin1'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`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(_latin1'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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 148 OR select_id IS NULL) order by id;
@@ -938,8 +938,8 @@ NULL NULL 1
- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_varbinary_1000`,2) AS `LEFT(my_varbinary_1000, 2)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_varbinary_1000`,2) AS `LEFT(my_varbinary_1000, 2)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 147 OR select_id IS NULL) order by id;
@@ -962,8 +962,8 @@ NULL NULL 1
- ---äÖüß@µ*$--
-1 -1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_binary_30`,2) AS `LEFT(my_binary_30, 2)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_binary_30`,2) AS `LEFT(my_binary_30, 2)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 146 OR select_id IS NULL) order by id;
@@ -986,8 +986,8 @@ NULL NULL 1
- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_varchar_1000`,2) AS `LEFT(my_varchar_1000, 2)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_varchar_1000`,2) AS `LEFT(my_varchar_1000, 2)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 145 OR select_id IS NULL) order by id;
@@ -1010,8 +1010,8 @@ NULL NULL 1
- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_char_30`,2) AS `LEFT(my_char_30, 2)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_char_30`,2) AS `LEFT(my_char_30, 2)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 144 OR select_id IS NULL) order by id;
@@ -1030,8 +1030,8 @@ SELECT LCASE(my_varchar_1000),
my_varchar_1000, id FROM t1_values
WHERE select_id = 143 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_varchar_1000`) AS `LCASE(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_varchar_1000`) AS `LCASE(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 143 OR select_id IS NULL) order by id;
@@ -1044,8 +1044,8 @@ SELECT INSTR(my_char_30, 'char'),
my_char_30, id FROM t1_values
WHERE select_id = 142 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_char_30`) AS `INSTR(my_char_30, 'char')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_char_30`) AS `INSTR(my_char_30, 'char')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 142 OR select_id IS NULL) order by id;
@@ -1064,8 +1064,8 @@ NULL NULL 1
160 ---äÖüß@µ*$-- 4
16 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_varbinary_1000`) AS `BIT_LENGTH(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_varbinary_1000`) AS `BIT_LENGTH(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 141 OR select_id IS NULL) order by id;
@@ -1090,8 +1090,8 @@ NULL NULL 1
240 ---äÖüß@µ*$--
240 -1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_binary_30`) AS `BIT_LENGTH(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_binary_30`) AS `BIT_LENGTH(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 140 OR select_id IS NULL) order by id;
@@ -1116,8 +1116,8 @@ NULL NULL 1
160 ---äÖüß@µ*$-- 4
16 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_varchar_1000`) AS `BIT_LENGTH(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_varchar_1000`) AS `BIT_LENGTH(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 139 OR select_id IS NULL) order by id;
@@ -1142,8 +1142,8 @@ NULL NULL 1
152 ---äÖüß@µ*$-- 4
16 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_char_30`) AS `BIT_LENGTH(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_char_30`) AS `BIT_LENGTH(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 138 OR select_id IS NULL) order by id;
@@ -1168,8 +1168,8 @@ IS_NULL NULL 1
2000 2000 4
2005 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_year`,_latin1'IS_NULL') AS `IFNULL(my_year,'IS_NULL')`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_year`,_latin1'IS_NULL') AS `IFNULL(my_year,'IS_NULL')`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 137 OR select_id IS NULL) order by id;
@@ -1194,8 +1194,8 @@ IS_NULL NULL 1
13:00:00 13:00:00 4
10:00:00 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_time`,_latin1'IS_NULL') AS `IFNULL(my_time,'IS_NULL')`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_time`,_latin1'IS_NULL') AS `IFNULL(my_time,'IS_NULL')`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 136 OR select_id IS NULL) order by id;
@@ -1220,8 +1220,8 @@ IFNULL(my_timestamp,'IS_NULL') my_timestamp id
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_timestamp`,_latin1'IS_NULL') AS `IFNULL(my_timestamp,'IS_NULL')`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_timestamp`,_latin1'IS_NULL') AS `IFNULL(my_timestamp,'IS_NULL')`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 135 OR select_id IS NULL) order by id;
@@ -1246,8 +1246,8 @@ IS_NULL NULL 1
2004-02-29 2004-02-29 4
2005-06-28 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_date`,_latin1'IS_NULL') AS `IFNULL(my_date,'IS_NULL')`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_date`,_latin1'IS_NULL') AS `IFNULL(my_date,'IS_NULL')`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 134 OR select_id IS NULL) order by id;
@@ -1272,8 +1272,8 @@ IS_NULL NULL 1
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_datetime`,_latin1'IS_NULL') AS `IFNULL(my_datetime,'IS_NULL')`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_datetime`,_latin1'IS_NULL') AS `IFNULL(my_datetime,'IS_NULL')`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 133 OR select_id IS NULL) order by id;
@@ -1298,8 +1298,8 @@ IS_NULL NULL 1
0 0 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_double`,_latin1'IS_NULL') AS `IFNULL(my_double,'IS_NULL')`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_double`,_latin1'IS_NULL') AS `IFNULL(my_double,'IS_NULL')`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 132 OR select_id IS NULL) order by id;
@@ -1324,8 +1324,8 @@ IS_NULL NULL 1
0.000000000000000000000000000000 0.000000000000000000000000000000 4
-1.000000000000000000000000000000 -1.000000000000000000000000000000 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_decimal`,_latin1'IS_NULL') AS `IFNULL(my_decimal,'IS_NULL')`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_decimal`,_latin1'IS_NULL') AS `IFNULL(my_decimal,'IS_NULL')`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 131 OR select_id IS NULL) order by id;
@@ -1350,8 +1350,8 @@ IS_NULL NULL 1
0 0 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_bigint`,_latin1'IS_NULL') AS `IFNULL(my_bigint,'IS_NULL')`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_bigint`,_latin1'IS_NULL') AS `IFNULL(my_bigint,'IS_NULL')`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 130 OR select_id IS NULL) order by id;
@@ -1376,8 +1376,8 @@ IS_NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_varbinary_1000`,_latin1'IS_NULL') AS `IFNULL(my_varbinary_1000,'IS_NULL')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_varbinary_1000`,_latin1'IS_NULL') AS `IFNULL(my_varbinary_1000,'IS_NULL')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 129 OR select_id IS NULL) order by id;
@@ -1402,8 +1402,8 @@ IS_NULL NULL 1
---äÖüß@µ*$--
-1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_binary_30`,_latin1'IS_NULL') AS `IFNULL(my_binary_30,'IS_NULL')`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_binary_30`,_latin1'IS_NULL') AS `IFNULL(my_binary_30,'IS_NULL')`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 128 OR select_id IS NULL) order by id;
@@ -1428,8 +1428,8 @@ IS_NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_varchar_1000`,_latin1'IS_NULL') AS `IFNULL(my_varchar_1000,'IS_NULL')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_varchar_1000`,_latin1'IS_NULL') AS `IFNULL(my_varchar_1000,'IS_NULL')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 127 OR select_id IS NULL) order by id;
@@ -1454,8 +1454,8 @@ IS_NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_char_30`,_latin1'IS_NULL') AS `IFNULL(my_char_30,'IS_NULL')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_char_30`,_latin1'IS_NULL') AS `IFNULL(my_char_30,'IS_NULL')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 126 OR select_id IS NULL) order by id;
@@ -1481,9 +1481,9 @@ IS NOT NULL 2155 3
IS NOT NULL 2000 4
IS NOT NULL 2005 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_year`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_year IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 125 OR select_id IS NULL) order by id;
@@ -1510,9 +1510,9 @@ IS NOT NULL 838:59:59 3
IS NOT NULL 13:00:00 4
IS NOT NULL 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_time`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_time IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 124 OR select_id IS NULL) order by id;
@@ -1539,9 +1539,9 @@ IS NOT NULL 2038-01-01 02:59:59 3
IS NOT NULL 2004-02-29 23:59:59 4
IS NOT NULL 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_timestamp`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_timestamp IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 123 OR select_id IS NULL) order by id;
@@ -1568,9 +1568,9 @@ IS NOT NULL 9999-12-31 3
IS NOT NULL 2004-02-29 4
IS NOT NULL 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_date`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_date IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 122 OR select_id IS NULL) order by id;
@@ -1597,9 +1597,9 @@ IS NOT NULL 9999-12-31 23:59:59 3
IS NOT NULL 2004-02-29 23:59:59 4
IS NOT NULL 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_datetime`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_datetime IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 121 OR select_id IS NULL) order by id;
@@ -1626,9 +1626,9 @@ IS NOT NULL 1.7976931348623e+308 3
IS NOT NULL 0 4
IS NOT NULL -1 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_double`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_double IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 120 OR select_id IS NULL) order by id;
@@ -1655,9 +1655,9 @@ IS NOT NULL 9999999999999999999999999999999999.999999999999999999999999999999 3
IS NOT NULL 0.000000000000000000000000000000 4
IS NOT NULL -1.000000000000000000000000000000 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_decimal`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_decimal IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 119 OR select_id IS NULL) order by id;
@@ -1684,9 +1684,9 @@ IS NOT NULL 9223372036854775807 3
IS NOT NULL 0 4
IS NOT NULL -1 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_bigint`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_bigint IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 118 OR select_id IS NULL) order by id;
@@ -1713,9 +1713,9 @@ IS NOT NULL <---------1000 characters-------------------------------------------
IS NOT NULL ---äÖüß@µ*$-- 4
IS NOT NULL -1 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_varbinary_1000`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_varbinary_1000 IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 117 OR select_id IS NULL) order by id;
@@ -1742,9 +1742,9 @@ IS NOT NULL <--------30 characters-------> 3
IS NOT NULL ---äÖüß@µ*$--
IS NOT NULL -1
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_binary_30`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_binary_30 IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 116 OR select_id IS NULL) order by id;
@@ -1771,9 +1771,9 @@ IS NOT NULL <---------1000 characters-------------------------------------------
IS NOT NULL ---äÖüß@µ*$-- 4
IS NOT NULL -1 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_varchar_1000`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_varchar_1000 IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 115 OR select_id IS NULL) order by id;
@@ -1800,9 +1800,9 @@ IS NOT NULL <--------30 characters-------> 3
IS NOT NULL ---äÖüß@µ*$-- 4
IS NOT NULL -1 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_char_30`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_char_30 IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 114 OR select_id IS NULL) order by id;
@@ -1828,8 +1828,8 @@ IS TRUE 2155 3
IS TRUE 2000 4
IS TRUE 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_year`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_year, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_year, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 113 OR select_id IS NULL) order by id;
@@ -1854,8 +1854,8 @@ IS TRUE 838:59:59 3
IS TRUE 13:00:00 4
IS TRUE 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_time`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_time, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_time, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 112 OR select_id IS NULL) order by id;
@@ -1880,8 +1880,8 @@ IS TRUE 2038-01-01 02:59:59 3
IS TRUE 2004-02-29 23:59:59 4
IS TRUE 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_timestamp`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_timestamp, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_timestamp, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 111 OR select_id IS NULL) order by id;
@@ -1906,8 +1906,8 @@ IS TRUE 9999-12-31 3
IS TRUE 2004-02-29 4
IS TRUE 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_date`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_date, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_date, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 110 OR select_id IS NULL) order by id;
@@ -1932,8 +1932,8 @@ IS TRUE 9999-12-31 23:59:59 3
IS TRUE 2004-02-29 23:59:59 4
IS TRUE 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_datetime`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_datetime, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_datetime, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 109 OR select_id IS NULL) order by id;
@@ -1958,8 +1958,8 @@ IS TRUE 1.7976931348623e+308 3
IS NOT TRUE 0 4
IS TRUE -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_double`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_double, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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_double`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_double, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 108 OR select_id IS NULL) order by id;
@@ -1984,8 +1984,8 @@ IS TRUE 9999999999999999999999999999999999.999999999999999999999999999999 3
IS NOT TRUE 0.000000000000000000000000000000 4
IS TRUE -1.000000000000000000000000000000 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_decimal`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_decimal, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values`
+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_decimal`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_decimal, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 107 OR select_id IS NULL) order by id;
@@ -2010,8 +2010,8 @@ IS TRUE 9223372036854775807 3
IS NOT TRUE 0 4
IS TRUE -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_bigint`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_bigint, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_bigint, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 106 OR select_id IS NULL) order by id;
@@ -2036,8 +2036,8 @@ IS NOT TRUE <---------1000 characters-------------------------------------------
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_varbinary_1000`,_latin1'IS TRUE',_latin1'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`
+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`,_latin1'IS TRUE',_latin1'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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 105 OR select_id IS NULL) order by id;
@@ -2067,8 +2067,8 @@ Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
Warning 1292 Truncated incorrect DOUBLE value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_binary_30`,_latin1'IS TRUE',_latin1'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`
+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`,_latin1'IS TRUE',_latin1'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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 104 OR select_id IS NULL) order by id;
@@ -2098,8 +2098,8 @@ IS NOT TRUE <---------1000 characters-------------------------------------------
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_varchar_1000`,_latin1'IS TRUE',_latin1'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`
+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`,_latin1'IS TRUE',_latin1'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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 103 OR select_id IS NULL) order by id;
@@ -2127,8 +2127,8 @@ Warnings:
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_char_30`,_latin1'IS TRUE',_latin1'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`
+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`,_latin1'IS TRUE',_latin1'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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 102 OR select_id IS NULL) order by id;
@@ -2156,8 +2156,8 @@ NULL NULL 1
---???????÷@??*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varbinary_1000` using koi8r) AS `CONVERT(my_varbinary_1000 USING koi8r)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varbinary_1000` using koi8r) AS `CONVERT(my_varbinary_1000 USING koi8r)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 101 OR select_id IS NULL) order by id;
@@ -2182,8 +2182,8 @@ NULL NULL 1
---???????÷@??*$--
-1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_binary_30` using koi8r) AS `CONVERT(my_binary_30 USING koi8r)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_binary_30` using koi8r) AS `CONVERT(my_binary_30 USING koi8r)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 100 OR select_id IS NULL) order by id;
@@ -2208,8 +2208,8 @@ NULL NULL 1
---????????@??*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varchar_1000` using koi8r) AS `CONVERT(my_varchar_1000 USING koi8r)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varchar_1000` using koi8r) AS `CONVERT(my_varchar_1000 USING koi8r)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 99 OR select_id IS NULL) order by id;
@@ -2234,8 +2234,8 @@ NULL NULL 1
---????????@??*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_char_30` using koi8r) AS `CONVERT(my_char_30 USING koi8r)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_char_30` using koi8r) AS `CONVERT(my_char_30 USING koi8r)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 98 OR select_id IS NULL) order by id;
@@ -2260,8 +2260,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varbinary_1000` using utf8) AS `CONVERT(my_varbinary_1000 USING utf8)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varbinary_1000` using utf8) AS `CONVERT(my_varbinary_1000 USING utf8)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 97 OR select_id IS NULL) order by id;
@@ -2286,8 +2286,8 @@ NULL NULL 1
---äÖüß@µ*$--
-1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_binary_30` using utf8) AS `CONVERT(my_binary_30 USING utf8)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_binary_30` using utf8) AS `CONVERT(my_binary_30 USING utf8)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 96 OR select_id IS NULL) order by id;
@@ -2312,8 +2312,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varchar_1000` using utf8) AS `CONVERT(my_varchar_1000 USING utf8)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varchar_1000` using utf8) AS `CONVERT(my_varchar_1000 USING utf8)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 95 OR select_id IS NULL) order by id;
@@ -2338,8 +2338,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_char_30` using utf8) AS `CONVERT(my_char_30 USING utf8)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_char_30` using utf8) AS `CONVERT(my_char_30 USING utf8)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 94 OR select_id IS NULL) order by id;
@@ -2364,8 +2364,8 @@ NULL NULL 1
2000 2000 4
2005 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as unsigned) AS `CAST(my_year AS UNSIGNED INTEGER)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as unsigned) AS `CAST(my_year AS UNSIGNED INTEGER)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 93 OR select_id IS NULL) order by id;
@@ -2385,34 +2385,22 @@ my_time, id FROM t1_values
WHERE select_id = 92 OR select_id IS NULL order by id;
CAST(my_time AS UNSIGNED INTEGER) my_time id
NULL NULL 1
-18446744073709550778 -838:59:59 2
-838 838:59:59 3
-13 13:00:00 4
-10 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '-838:59:59'
-Warning 1105 Cast to unsigned converted negative integer to it's positive complement
-Warning 1292 Truncated incorrect INTEGER value: '838:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '13:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '10:00:00'
+18446744073701165657 -838:59:59 2
+8385959 838:59:59 3
+130000 13:00:00 4
+100000 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as unsigned) AS `CAST(my_time AS UNSIGNED INTEGER)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as unsigned) AS `CAST(my_time AS UNSIGNED INTEGER)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 92 OR select_id IS NULL) order by id;
CAST(my_time AS UNSIGNED INTEGER) my_time id
NULL NULL 1
-18446744073709550778 -838:59:59 2
-838 838:59:59 3
-13 13:00:00 4
-10 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '-838:59:59'
-Warning 1105 Cast to unsigned converted negative integer to it's positive complement
-Warning 1292 Truncated incorrect INTEGER value: '838:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '13:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '10:00:00'
+18446744073701165657 -838:59:59 2
+8385959 838:59:59 3
+130000 13:00:00 4
+100000 10:00:00 5
DROP VIEW v1;
@@ -2423,34 +2411,22 @@ my_timestamp, id FROM t1_values
WHERE select_id = 91 OR select_id IS NULL order by id;
CAST(my_timestamp AS UNSIGNED INTEGER) my_timestamp id
0 0000-00-00 00:00:00 1
-1970 1970-01-01 03:00:01 2
-2038 2038-01-01 02:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0000-00-00 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '1970-01-01 03:00:01'
-Warning 1292 Truncated incorrect INTEGER value: '2038-01-01 02:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+19700101030001 1970-01-01 03:00:01 2
+20380101025959 2038-01-01 02:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as unsigned) AS `CAST(my_timestamp AS UNSIGNED INTEGER)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as unsigned) AS `CAST(my_timestamp AS UNSIGNED INTEGER)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 91 OR select_id IS NULL) order by id;
CAST(my_timestamp AS UNSIGNED INTEGER) my_timestamp id
0 0000-00-00 00:00:00 1
-1970 1970-01-01 03:00:01 2
-2038 2038-01-01 02:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0000-00-00 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '1970-01-01 03:00:01'
-Warning 1292 Truncated incorrect INTEGER value: '2038-01-01 02:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+19700101030001 1970-01-01 03:00:01 2
+20380101025959 2038-01-01 02:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
DROP VIEW v1;
@@ -2461,32 +2437,22 @@ my_date, id FROM t1_values
WHERE select_id = 90 OR select_id IS NULL order by id;
CAST(my_date AS UNSIGNED INTEGER) my_date id
NULL NULL 1
-1 0001-01-01 2
-9999 9999-12-31 3
-2004 2004-02-29 4
-2005 2005-06-28 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28'
+10101 0001-01-01 2
+99991231 9999-12-31 3
+20040229 2004-02-29 4
+20050628 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as unsigned) AS `CAST(my_date AS UNSIGNED INTEGER)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as unsigned) AS `CAST(my_date AS UNSIGNED INTEGER)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 90 OR select_id IS NULL) order by id;
CAST(my_date AS UNSIGNED INTEGER) my_date id
NULL NULL 1
-1 0001-01-01 2
-9999 9999-12-31 3
-2004 2004-02-29 4
-2005 2005-06-28 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28'
+10101 0001-01-01 2
+99991231 9999-12-31 3
+20040229 2004-02-29 4
+20050628 2005-06-28 5
DROP VIEW v1;
@@ -2497,32 +2463,22 @@ my_datetime, id FROM t1_values
WHERE select_id = 89 OR select_id IS NULL order by id;
CAST(my_datetime AS UNSIGNED INTEGER) my_datetime id
NULL NULL 1
-1 0001-01-01 00:00:00 2
-9999 9999-12-31 23:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+10101000000 0001-01-01 00:00:00 2
+99991231235959 9999-12-31 23:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as unsigned) AS `CAST(my_datetime AS UNSIGNED INTEGER)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as unsigned) AS `CAST(my_datetime AS UNSIGNED INTEGER)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 89 OR select_id IS NULL) order by id;
CAST(my_datetime AS UNSIGNED INTEGER) my_datetime id
NULL NULL 1
-1 0001-01-01 00:00:00 2
-9999 9999-12-31 23:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+10101000000 0001-01-01 00:00:00 2
+99991231235959 9999-12-31 23:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
DROP VIEW v1;
@@ -2542,8 +2498,8 @@ Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
SHOW CREATE VIEW v1;
-View Create View
-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`
+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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 88 OR select_id IS NULL) order by id;
@@ -2572,8 +2528,8 @@ NULL NULL 1
0 0 4
18446744073709551615 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as unsigned) AS `CAST(my_bigint AS UNSIGNED INTEGER)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as unsigned) AS `CAST(my_bigint AS UNSIGNED INTEGER)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 87 OR select_id IS NULL) order by id;
@@ -2603,8 +2559,8 @@ Warning 1292 Truncated incorrect INTEGER value: '<---------1000 characters------
Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$-- '
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as unsigned) AS `CAST(my_varbinary_1000 AS UNSIGNED INTEGER)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 unsigned) AS `CAST(my_varbinary_1000 AS UNSIGNED INTEGER)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 86 OR select_id IS NULL) order by id;
@@ -2640,8 +2596,8 @@ Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$-- '
Warning 1292 Truncated incorrect INTEGER value: '-1'
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as unsigned) AS `CAST(my_binary_30 AS UNSIGNED INTEGER)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 unsigned) AS `CAST(my_binary_30 AS UNSIGNED INTEGER)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 85 OR select_id IS NULL) order by id;
@@ -2677,8 +2633,8 @@ Warning 1292 Truncated incorrect INTEGER value: '<---------1000 characters------
Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$-- '
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as unsigned) AS `CAST(my_varchar_1000 AS UNSIGNED INTEGER)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 unsigned) AS `CAST(my_varchar_1000 AS UNSIGNED INTEGER)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 84 OR select_id IS NULL) order by id;
@@ -2713,8 +2669,8 @@ Warning 1292 Truncated incorrect INTEGER value: '<--------30 characters------->'
Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$--'
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as unsigned) AS `CAST(my_char_30 AS UNSIGNED INTEGER)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 unsigned) AS `CAST(my_char_30 AS UNSIGNED INTEGER)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 83 OR select_id IS NULL) order by id;
@@ -2744,8 +2700,8 @@ NULL NULL 1
2000 2000 4
2005 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as signed) AS `CAST(my_year AS SIGNED INTEGER)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as signed) AS `CAST(my_year AS SIGNED INTEGER)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 82 OR select_id IS NULL) order by id;
@@ -2765,32 +2721,22 @@ my_time, id FROM t1_values
WHERE select_id = 81 OR select_id IS NULL order by id;
CAST(my_time AS SIGNED INTEGER) my_time id
NULL NULL 1
--838 -838:59:59 2
-838 838:59:59 3
-13 13:00:00 4
-10 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '-838:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '838:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '13:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '10:00:00'
+-8385959 -838:59:59 2
+8385959 838:59:59 3
+130000 13:00:00 4
+100000 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as signed) AS `CAST(my_time AS SIGNED INTEGER)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as signed) AS `CAST(my_time AS SIGNED INTEGER)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 81 OR select_id IS NULL) order by id;
CAST(my_time AS SIGNED INTEGER) my_time id
NULL NULL 1
--838 -838:59:59 2
-838 838:59:59 3
-13 13:00:00 4
-10 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '-838:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '838:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '13:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '10:00:00'
+-8385959 -838:59:59 2
+8385959 838:59:59 3
+130000 13:00:00 4
+100000 10:00:00 5
DROP VIEW v1;
@@ -2801,34 +2747,22 @@ my_timestamp, id FROM t1_values
WHERE select_id = 80 OR select_id IS NULL order by id;
CAST(my_timestamp AS SIGNED INTEGER) my_timestamp id
0 0000-00-00 00:00:00 1
-1970 1970-01-01 03:00:01 2
-2038 2038-01-01 02:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0000-00-00 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '1970-01-01 03:00:01'
-Warning 1292 Truncated incorrect INTEGER value: '2038-01-01 02:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+19700101030001 1970-01-01 03:00:01 2
+20380101025959 2038-01-01 02:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as signed) AS `CAST(my_timestamp AS SIGNED INTEGER)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as signed) AS `CAST(my_timestamp AS SIGNED INTEGER)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 80 OR select_id IS NULL) order by id;
CAST(my_timestamp AS SIGNED INTEGER) my_timestamp id
0 0000-00-00 00:00:00 1
-1970 1970-01-01 03:00:01 2
-2038 2038-01-01 02:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0000-00-00 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '1970-01-01 03:00:01'
-Warning 1292 Truncated incorrect INTEGER value: '2038-01-01 02:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+19700101030001 1970-01-01 03:00:01 2
+20380101025959 2038-01-01 02:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
DROP VIEW v1;
@@ -2839,32 +2773,22 @@ my_date, id FROM t1_values
WHERE select_id = 79 OR select_id IS NULL order by id;
CAST(my_date AS SIGNED INTEGER) my_date id
NULL NULL 1
-1 0001-01-01 2
-9999 9999-12-31 3
-2004 2004-02-29 4
-2005 2005-06-28 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28'
+10101 0001-01-01 2
+99991231 9999-12-31 3
+20040229 2004-02-29 4
+20050628 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as signed) AS `CAST(my_date AS SIGNED INTEGER)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as signed) AS `CAST(my_date AS SIGNED INTEGER)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 79 OR select_id IS NULL) order by id;
CAST(my_date AS SIGNED INTEGER) my_date id
NULL NULL 1
-1 0001-01-01 2
-9999 9999-12-31 3
-2004 2004-02-29 4
-2005 2005-06-28 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28'
+10101 0001-01-01 2
+99991231 9999-12-31 3
+20040229 2004-02-29 4
+20050628 2005-06-28 5
DROP VIEW v1;
@@ -2875,32 +2799,22 @@ my_datetime, id FROM t1_values
WHERE select_id = 78 OR select_id IS NULL order by id;
CAST(my_datetime AS SIGNED INTEGER) my_datetime id
NULL NULL 1
-1 0001-01-01 00:00:00 2
-9999 9999-12-31 23:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+10101000000 0001-01-01 00:00:00 2
+99991231235959 9999-12-31 23:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as signed) AS `CAST(my_datetime AS SIGNED INTEGER)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as signed) AS `CAST(my_datetime AS SIGNED INTEGER)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 78 OR select_id IS NULL) order by id;
CAST(my_datetime AS SIGNED INTEGER) my_datetime id
NULL NULL 1
-1 0001-01-01 00:00:00 2
-9999 9999-12-31 23:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+10101000000 0001-01-01 00:00:00 2
+99991231235959 9999-12-31 23:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
DROP VIEW v1;
@@ -2919,8 +2833,8 @@ Warnings:
Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308'
Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as signed) AS `CAST(my_double AS SIGNED INTEGER)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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 signed) AS `CAST(my_double AS SIGNED INTEGER)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 77 OR select_id IS NULL) order by id;
@@ -2943,23 +2857,23 @@ my_decimal, id FROM t1_values
WHERE select_id = 76 OR select_id IS NULL order by id;
CAST(my_decimal AS SIGNED INTEGER) my_decimal id
NULL NULL 1
--10000000000000000 -9999999999999999999999999999999999.999999999999999999999999999999 2
-10000000000000000 9999999999999999999999999999999999.999999999999999999999999999999 3
+-9223372036854775808 -9999999999999999999999999999999999.999999999999999999999999999999 2
+9223372036854775807 9999999999999999999999999999999999.999999999999999999999999999999 3
0 0.000000000000000000000000000000 4
-1 -1.000000000000000000000000000000 5
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
SHOW CREATE VIEW v1;
-View Create View
-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`
+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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 76 OR select_id IS NULL) order by id;
CAST(my_decimal AS SIGNED INTEGER) my_decimal id
NULL NULL 1
--10000000000000000 -9999999999999999999999999999999999.999999999999999999999999999999 2
-10000000000000000 9999999999999999999999999999999999.999999999999999999999999999999 3
+-9223372036854775808 -9999999999999999999999999999999999.999999999999999999999999999999 2
+9223372036854775807 9999999999999999999999999999999999.999999999999999999999999999999 3
0 0.000000000000000000000000000000 4
-1 -1.000000000000000000000000000000 5
Warnings:
@@ -2980,8 +2894,8 @@ NULL NULL 1
0 0 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as signed) AS `CAST(my_bigint AS SIGNED INTEGER)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as signed) AS `CAST(my_bigint AS SIGNED INTEGER)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 75 OR select_id IS NULL) order by id;
@@ -3010,8 +2924,8 @@ Warning 1292 Truncated incorrect INTEGER value: ''
Warning 1292 Truncated incorrect INTEGER value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as signed) AS `CAST(my_varbinary_1000 AS SIGNED INTEGER)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 signed) AS `CAST(my_varbinary_1000 AS SIGNED INTEGER)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 74 OR select_id IS NULL) order by id;
@@ -3045,8 +2959,8 @@ Warning 1292 Truncated incorrect INTEGER value: '<--------30 characters------->'
Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$-- '
Warning 1292 Truncated incorrect INTEGER value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as signed) AS `CAST(my_binary_30 AS SIGNED INTEGER)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 signed) AS `CAST(my_binary_30 AS SIGNED INTEGER)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 73 OR select_id IS NULL) order by id;
@@ -3080,8 +2994,8 @@ Warning 1292 Truncated incorrect INTEGER value: ''
Warning 1292 Truncated incorrect INTEGER value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as signed) AS `CAST(my_varchar_1000 AS SIGNED INTEGER)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 signed) AS `CAST(my_varchar_1000 AS SIGNED INTEGER)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 72 OR select_id IS NULL) order by id;
@@ -3114,8 +3028,8 @@ Warning 1292 Truncated incorrect INTEGER value: ''
Warning 1292 Truncated incorrect INTEGER value: '<--------30 characters------->'
Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$--'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as signed) AS `CAST(my_char_30 AS SIGNED INTEGER)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 signed) AS `CAST(my_char_30 AS SIGNED INTEGER)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 71 OR select_id IS NULL) order by id;
@@ -3132,287 +3046,255 @@ Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$--'
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_year AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_year AS DECIMAL(37,2)),
my_year, id FROM t1_values;
-SELECT CAST(my_year AS DECIMAL),
+SELECT CAST(my_year AS DECIMAL(37,2)),
my_year, id FROM t1_values
WHERE select_id = 70 OR select_id IS NULL order by id;
-CAST(my_year AS DECIMAL) my_year id
+CAST(my_year AS DECIMAL(37,2)) my_year id
NULL NULL 1
-1901 1901 2
-2155 2155 3
-2000 2000 4
-2005 2005 5
+1901.00 1901 2
+2155.00 2155 3
+2000.00 2000 4
+2005.00 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as decimal) AS `CAST(my_year AS DECIMAL)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as decimal(37,2)) AS `CAST(my_year AS DECIMAL(37,2))`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 70 OR select_id IS NULL) order by id;
-CAST(my_year AS DECIMAL) my_year id
+CAST(my_year AS DECIMAL(37,2)) my_year id
NULL NULL 1
-1901 1901 2
-2155 2155 3
-2000 2000 4
-2005 2005 5
+1901.00 1901 2
+2155.00 2155 3
+2000.00 2000 4
+2005.00 2005 5
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_time AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_time AS DECIMAL(37,2)),
my_time, id FROM t1_values;
-SELECT CAST(my_time AS DECIMAL),
+SELECT CAST(my_time AS DECIMAL(37,2)),
my_time, id FROM t1_values
WHERE select_id = 69 OR select_id IS NULL order by id;
-CAST(my_time AS DECIMAL) my_time id
+CAST(my_time AS DECIMAL(37,2)) my_time id
NULL NULL 1
--8385959 -838:59:59 2
-8385959 838:59:59 3
-130000 13:00:00 4
-100000 10:00:00 5
+-8385959.00 -838:59:59 2
+8385959.00 838:59:59 3
+130000.00 13:00:00 4
+100000.00 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as decimal) AS `CAST(my_time AS DECIMAL)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as decimal(37,2)) AS `CAST(my_time AS DECIMAL(37,2))`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 69 OR select_id IS NULL) order by id;
-CAST(my_time AS DECIMAL) my_time id
+CAST(my_time AS DECIMAL(37,2)) my_time id
NULL NULL 1
--8385959 -838:59:59 2
-8385959 838:59:59 3
-130000 13:00:00 4
-100000 10:00:00 5
+-8385959.00 -838:59:59 2
+8385959.00 838:59:59 3
+130000.00 13:00:00 4
+100000.00 10:00:00 5
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_timestamp AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_timestamp AS DECIMAL(37,2)),
my_timestamp, id FROM t1_values;
-SELECT CAST(my_timestamp AS DECIMAL),
+SELECT CAST(my_timestamp AS DECIMAL(37,2)),
my_timestamp, id FROM t1_values
WHERE select_id = 68 OR select_id IS NULL order by id;
-CAST(my_timestamp AS DECIMAL) my_timestamp id
-0 0000-00-00 00:00:00 1
-9999999999 1970-01-01 03:00:01 2
-9999999999 2038-01-01 02:59:59 3
-9999999999 2004-02-29 23:59:59 4
-9999999999 2005-06-28 10:00:00 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
+CAST(my_timestamp AS DECIMAL(37,2)) my_timestamp id
+0.00 0000-00-00 00:00:00 1
+19700101030001.00 1970-01-01 03:00:01 2
+20380101025959.00 2038-01-01 02:59:59 3
+20040229235959.00 2004-02-29 23:59:59 4
+20050628100000.00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as decimal) AS `CAST(my_timestamp AS DECIMAL)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as decimal(37,2)) AS `CAST(my_timestamp AS DECIMAL(37,2))`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 68 OR select_id IS NULL) order by id;
-CAST(my_timestamp AS DECIMAL) my_timestamp id
-0 0000-00-00 00:00:00 1
-9999999999 1970-01-01 03:00:01 2
-9999999999 2038-01-01 02:59:59 3
-9999999999 2004-02-29 23:59:59 4
-9999999999 2005-06-28 10:00:00 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
+CAST(my_timestamp AS DECIMAL(37,2)) my_timestamp id
+0.00 0000-00-00 00:00:00 1
+19700101030001.00 1970-01-01 03:00:01 2
+20380101025959.00 2038-01-01 02:59:59 3
+20040229235959.00 2004-02-29 23:59:59 4
+20050628100000.00 2005-06-28 10:00:00 5
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_date AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_date AS DECIMAL(37,2)),
my_date, id FROM t1_values;
-SELECT CAST(my_date AS DECIMAL),
+SELECT CAST(my_date AS DECIMAL(37,2)),
my_date, id FROM t1_values
WHERE select_id = 67 OR select_id IS NULL order by id;
-CAST(my_date AS DECIMAL) my_date id
+CAST(my_date AS DECIMAL(37,2)) my_date id
NULL NULL 1
-10101 0001-01-01 2
-99991231 9999-12-31 3
-20040229 2004-02-29 4
-20050628 2005-06-28 5
+10101.00 0001-01-01 2
+99991231.00 9999-12-31 3
+20040229.00 2004-02-29 4
+20050628.00 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as decimal) AS `CAST(my_date AS DECIMAL)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as decimal(37,2)) AS `CAST(my_date AS DECIMAL(37,2))`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 67 OR select_id IS NULL) order by id;
-CAST(my_date AS DECIMAL) my_date id
+CAST(my_date AS DECIMAL(37,2)) my_date id
NULL NULL 1
-10101 0001-01-01 2
-99991231 9999-12-31 3
-20040229 2004-02-29 4
-20050628 2005-06-28 5
+10101.00 0001-01-01 2
+99991231.00 9999-12-31 3
+20040229.00 2004-02-29 4
+20050628.00 2005-06-28 5
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_datetime AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_datetime AS DECIMAL(37,2)),
my_datetime, id FROM t1_values;
-SELECT CAST(my_datetime AS DECIMAL),
+SELECT CAST(my_datetime AS DECIMAL(37,2)),
my_datetime, id FROM t1_values
WHERE select_id = 66 OR select_id IS NULL order by id;
-CAST(my_datetime AS DECIMAL) my_datetime id
+CAST(my_datetime AS DECIMAL(37,2)) my_datetime id
NULL NULL 1
-9999999999 0001-01-01 00:00:00 2
-9999999999 9999-12-31 23:59:59 3
-9999999999 2004-02-29 23:59:59 4
-9999999999 2005-06-28 10:00:00 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
+10101000000.00 0001-01-01 00:00:00 2
+99991231235959.00 9999-12-31 23:59:59 3
+20040229235959.00 2004-02-29 23:59:59 4
+20050628100000.00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as decimal) AS `CAST(my_datetime AS DECIMAL)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as decimal(37,2)) AS `CAST(my_datetime AS DECIMAL(37,2))`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 66 OR select_id IS NULL) order by id;
-CAST(my_datetime AS DECIMAL) my_datetime id
+CAST(my_datetime AS DECIMAL(37,2)) my_datetime id
NULL NULL 1
-9999999999 0001-01-01 00:00:00 2
-9999999999 9999-12-31 23:59:59 3
-9999999999 2004-02-29 23:59:59 4
-9999999999 2005-06-28 10:00:00 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
+10101000000.00 0001-01-01 00:00:00 2
+99991231235959.00 9999-12-31 23:59:59 3
+20040229235959.00 2004-02-29 23:59:59 4
+20050628100000.00 2005-06-28 10:00:00 5
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_double AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_double AS DECIMAL(37,2)),
my_double, id FROM t1_values;
-SELECT CAST(my_double AS DECIMAL),
+SELECT CAST(my_double AS DECIMAL(37,2)),
my_double, id FROM t1_values
WHERE select_id = 65 OR select_id IS NULL order by id;
-CAST(my_double AS DECIMAL) my_double id
+CAST(my_double AS DECIMAL(37,2)) my_double id
NULL NULL 1
--9999999999 -1.7976931348623e+308 2
-9999999999 1.7976931348623e+308 3
-0 0 4
--1 -1 5
--3333 -3333.3333 30
+-99999999999999999999999999999999999.99 -1.7976931348623e+308 2
+99999999999999999999999999999999999.99 1.7976931348623e+308 3
+0.00 0 4
+-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)' at row 1
+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)' at row 1
+Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as decimal) AS `CAST(my_double AS DECIMAL)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 65 OR select_id IS NULL) order by id;
-CAST(my_double AS DECIMAL) my_double id
+CAST(my_double AS DECIMAL(37,2)) my_double id
NULL NULL 1
--9999999999 -1.7976931348623e+308 2
-9999999999 1.7976931348623e+308 3
-0 0 4
--1 -1 5
--3333 -3333.3333 30
+-99999999999999999999999999999999999.99 -1.7976931348623e+308 2
+99999999999999999999999999999999999.99 1.7976931348623e+308 3
+0.00 0 4
+-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)' at row 1
+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)' at row 1
+Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_decimal AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_decimal AS DECIMAL(37,2)),
my_decimal, id FROM t1_values;
-SELECT CAST(my_decimal AS DECIMAL),
+SELECT CAST(my_decimal AS DECIMAL(37,2)),
my_decimal, id FROM t1_values
WHERE select_id = 64 OR select_id IS NULL order by id;
-CAST(my_decimal AS DECIMAL) my_decimal id
+CAST(my_decimal AS DECIMAL(37,2)) my_decimal id
NULL NULL 1
--9999999999 -9999999999999999999999999999999999.999999999999999999999999999999 2
-9999999999 9999999999999999999999999999999999.999999999999999999999999999999 3
-0 0.000000000000000000000000000000 4
--1 -1.000000000000000000000000000000 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_decimal AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_decimal AS DECIMAL)' at row 1
+-10000000000000000000000000000000000.00 -9999999999999999999999999999999999.999999999999999999999999999999 2
+10000000000000000000000000000000000.00 9999999999999999999999999999999999.999999999999999999999999999999 3
+0.00 0.000000000000000000000000000000 4
+-1.00 -1.000000000000000000000000000000 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as decimal) AS `CAST(my_decimal AS DECIMAL)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values`
+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 decimal(37,2)) AS `CAST(my_decimal AS DECIMAL(37,2))`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 64 OR select_id IS NULL) order by id;
-CAST(my_decimal AS DECIMAL) my_decimal id
+CAST(my_decimal AS DECIMAL(37,2)) my_decimal id
NULL NULL 1
--9999999999 -9999999999999999999999999999999999.999999999999999999999999999999 2
-9999999999 9999999999999999999999999999999999.999999999999999999999999999999 3
-0 0.000000000000000000000000000000 4
--1 -1.000000000000000000000000000000 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_decimal AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_decimal AS DECIMAL)' at row 1
+-10000000000000000000000000000000000.00 -9999999999999999999999999999999999.999999999999999999999999999999 2
+10000000000000000000000000000000000.00 9999999999999999999999999999999999.999999999999999999999999999999 3
+0.00 0.000000000000000000000000000000 4
+-1.00 -1.000000000000000000000000000000 5
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_bigint AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_bigint AS DECIMAL(37,2)),
my_bigint, id FROM t1_values;
-SELECT CAST(my_bigint AS DECIMAL),
+SELECT CAST(my_bigint AS DECIMAL(37,2)),
my_bigint, id FROM t1_values
WHERE select_id = 63 OR select_id IS NULL order by id;
-CAST(my_bigint AS DECIMAL) my_bigint id
+CAST(my_bigint AS DECIMAL(37,2)) my_bigint id
NULL NULL 1
--9999999999 -9223372036854775808 2
-9999999999 9223372036854775807 3
-0 0 4
--1 -1 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_bigint AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_bigint AS DECIMAL)' at row 1
+-9223372036854775808.00 -9223372036854775808 2
+9223372036854775807.00 9223372036854775807 3
+0.00 0 4
+-1.00 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as decimal) AS `CAST(my_bigint AS DECIMAL)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as decimal(37,2)) AS `CAST(my_bigint AS DECIMAL(37,2))`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 63 OR select_id IS NULL) order by id;
-CAST(my_bigint AS DECIMAL) my_bigint id
+CAST(my_bigint AS DECIMAL(37,2)) my_bigint id
NULL NULL 1
--9999999999 -9223372036854775808 2
-9999999999 9223372036854775807 3
-0 0 4
--1 -1 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_bigint AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_bigint AS DECIMAL)' at row 1
+-9223372036854775808.00 -9223372036854775808 2
+9223372036854775807.00 9223372036854775807 3
+0.00 0 4
+-1.00 -1 5
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_varbinary_1000 AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_varbinary_1000 AS DECIMAL(37,2)),
my_varbinary_1000, id FROM t1_values;
-SELECT CAST(my_varbinary_1000 AS DECIMAL),
+SELECT CAST(my_varbinary_1000 AS DECIMAL(37,2)),
my_varbinary_1000, id FROM t1_values
WHERE select_id = 62 OR select_id IS NULL order by id;
-CAST(my_varbinary_1000 AS DECIMAL) my_varbinary_1000 id
+CAST(my_varbinary_1000 AS DECIMAL(37,2)) my_varbinary_1000 id
NULL NULL 1
-0 2
-0 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
--3333 -3333.3333 29
+0.00 2
+0.00 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
+0.00 ---äÖüß@µ*$-- 4
+-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
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as decimal) AS `CAST(my_varbinary_1000 AS DECIMAL)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 62 OR select_id IS NULL) order by id;
-CAST(my_varbinary_1000 AS DECIMAL) my_varbinary_1000 id
+CAST(my_varbinary_1000 AS DECIMAL(37,2)) my_varbinary_1000 id
NULL NULL 1
-0 2
-0 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
--3333 -3333.3333 29
+0.00 2
+0.00 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
+0.00 ---äÖüß@µ*$-- 4
+-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
@@ -3420,18 +3302,18 @@ Error 1366 Incorrect decimal value: '' for column '' at row -1
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_binary_30 AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_binary_30 AS DECIMAL(37,2)),
my_binary_30, id FROM t1_values;
-SELECT CAST(my_binary_30 AS DECIMAL),
+SELECT CAST(my_binary_30 AS DECIMAL(37,2)),
my_binary_30, id FROM t1_values
WHERE select_id = 61 OR select_id IS NULL order by id;
-CAST(my_binary_30 AS DECIMAL) my_binary_30 id
+CAST(my_binary_30 AS DECIMAL(37,2)) my_binary_30 id
NULL NULL 1
-0
-0 <--------30 characters-------> 3
-0 ---äÖüß@µ*$--
--1 -1
--3333 -3333.3333
+0.00
+0.00 <--------30 characters-------> 3
+0.00 ---äÖüß@µ*$--
+-1.00 -1
+-3333.33 -3333.3333
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ''
@@ -3442,18 +3324,18 @@ Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
Warning 1292 Truncated incorrect DECIMAL value: '-1'
Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as decimal) AS `CAST(my_binary_30 AS DECIMAL)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 61 OR select_id IS NULL) order by id;
-CAST(my_binary_30 AS DECIMAL) my_binary_30 id
+CAST(my_binary_30 AS DECIMAL(37,2)) my_binary_30 id
NULL NULL 1
-0
-0 <--------30 characters-------> 3
-0 ---äÖüß@µ*$--
--1 -1
--3333 -3333.3333
+0.00
+0.00 <--------30 characters-------> 3
+0.00 ---äÖüß@µ*$--
+-1.00 -1
+-3333.33 -3333.3333
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ''
@@ -3466,35 +3348,35 @@ Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333'
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_varchar_1000 AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_varchar_1000 AS DECIMAL(37,2)),
my_varchar_1000, id FROM t1_values;
-SELECT CAST(my_varchar_1000 AS DECIMAL),
+SELECT CAST(my_varchar_1000 AS DECIMAL(37,2)),
my_varchar_1000, id FROM t1_values
WHERE select_id = 60 OR select_id IS NULL order by id;
-CAST(my_varchar_1000 AS DECIMAL) my_varchar_1000 id
+CAST(my_varchar_1000 AS DECIMAL(37,2)) my_varchar_1000 id
NULL NULL 1
-0 2
-0 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
--3333 -3333.3333 27
+0.00 2
+0.00 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
+0.00 ---äÖüß@µ*$-- 4
+-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
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as decimal) AS `CAST(my_varchar_1000 AS DECIMAL)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 60 OR select_id IS NULL) order by id;
-CAST(my_varchar_1000 AS DECIMAL) my_varchar_1000 id
+CAST(my_varchar_1000 AS DECIMAL(37,2)) my_varchar_1000 id
NULL NULL 1
-0 2
-0 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
--3333 -3333.3333 27
+0.00 2
+0.00 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
+0.00 ---äÖüß@µ*$-- 4
+-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
@@ -3502,18 +3384,18 @@ Error 1366 Incorrect decimal value: '' for column '' at row -1
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_char_30 AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_char_30 AS DECIMAL(37,2)),
my_char_30, id FROM t1_values;
-SELECT CAST(my_char_30 AS DECIMAL),
+SELECT CAST(my_char_30 AS DECIMAL(37,2)),
my_char_30, id FROM t1_values
WHERE select_id = 59 OR select_id IS NULL order by id;
-CAST(my_char_30 AS DECIMAL) my_char_30 id
+CAST(my_char_30 AS DECIMAL(37,2)) my_char_30 id
NULL NULL 1
-0 2
-0 <--------30 characters-------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
--3333 -3333.3333 26
+0.00 2
+0.00 <--------30 characters-------> 3
+0.00 ---äÖüß@µ*$-- 4
+-1.00 -1 5
+-3333.33 -3333.3333 26
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' '
@@ -3522,18 +3404,18 @@ Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as decimal) AS `CAST(my_char_30 AS DECIMAL)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 59 OR select_id IS NULL) order by id;
-CAST(my_char_30 AS DECIMAL) my_char_30 id
+CAST(my_char_30 AS DECIMAL(37,2)) my_char_30 id
NULL NULL 1
-0 2
-0 <--------30 characters-------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
--3333 -3333.3333 26
+0.00 2
+0.00 <--------30 characters-------> 3
+0.00 ---äÖüß@µ*$-- 4
+-1.00 -1 5
+-3333.33 -3333.3333 26
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' '
@@ -3556,8 +3438,8 @@ NULL NULL 1
00:20:00 2000 4
00:20:05 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as time) AS `CAST(my_year AS TIME)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as time) AS `CAST(my_year AS TIME)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 58 OR select_id IS NULL) order by id;
@@ -3582,8 +3464,8 @@ NULL NULL 1
13:00:00 13:00:00 4
10:00:00 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as time) AS `CAST(my_time AS TIME)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as time) AS `CAST(my_time AS TIME)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 57 OR select_id IS NULL) order by id;
@@ -3608,8 +3490,8 @@ CAST(my_timestamp AS TIME) my_timestamp id
23:59:59 2004-02-29 23:59:59 4
10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as time) AS `CAST(my_timestamp AS TIME)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as time) AS `CAST(my_timestamp AS TIME)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 56 OR select_id IS NULL) order by id;
@@ -3634,8 +3516,8 @@ NULL NULL 1
00:00:00 2004-02-29 4
00:00:00 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as time) AS `CAST(my_date AS TIME)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as time) AS `CAST(my_date AS TIME)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 55 OR select_id IS NULL) order by id;
@@ -3660,8 +3542,8 @@ NULL NULL 1
23:59:59 2004-02-29 23:59:59 4
10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as time) AS `CAST(my_datetime AS TIME)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as time) AS `CAST(my_datetime AS TIME)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 54 OR select_id IS NULL) order by id;
@@ -3690,8 +3572,8 @@ Warnings:
Warning 1292 Truncated incorrect time value: '-1.7976931348623e+308'
Warning 1292 Truncated incorrect time value: '1.7976931348623e+308'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as time) AS `CAST(my_double AS TIME)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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 time) AS `CAST(my_double AS TIME)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 53 OR select_id IS NULL) order by id;
@@ -3724,8 +3606,8 @@ Warnings:
Warning 1292 Truncated incorrect time value: '-9223372036854775808'
Warning 1292 Truncated incorrect time value: '9223372036854775807'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as time) AS `CAST(my_bigint AS TIME)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as time) AS `CAST(my_bigint AS TIME)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 52 OR select_id IS NULL) order by id;
@@ -3759,8 +3641,8 @@ Warning 1292 Truncated incorrect time value: ''
Warning 1292 Truncated incorrect time value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
Warning 1292 Truncated incorrect time value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as time) AS `CAST(my_varbinary_1000 AS TIME)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 time) AS `CAST(my_varbinary_1000 AS TIME)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 51 OR select_id IS NULL) order by id;
@@ -3797,8 +3679,8 @@ Warning 1292 Truncated incorrect time value: ' ---äÖüß@µ*$-- '
Warning 1292 Truncated incorrect time value: '-1'
Warning 1292 Truncated incorrect time value: '1 17:58'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as time) AS `CAST(my_binary_30 AS TIME)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 time) AS `CAST(my_binary_30 AS TIME)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 50 OR select_id IS NULL) order by id;
@@ -3835,8 +3717,8 @@ Warning 1292 Truncated incorrect time value: ''
Warning 1292 Truncated incorrect time value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
Warning 1292 Truncated incorrect time value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as time) AS `CAST(my_varchar_1000 AS TIME)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 time) AS `CAST(my_varchar_1000 AS TIME)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 49 OR select_id IS NULL) order by id;
@@ -3871,8 +3753,8 @@ Warning 1292 Truncated incorrect time value: ''
Warning 1292 Truncated incorrect time value: '<--------30 characters------->'
Warning 1292 Truncated incorrect time value: ' ---äÖüß@µ*$--'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as time) AS `CAST(my_char_30 AS TIME)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 time) AS `CAST(my_char_30 AS TIME)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 48 OR select_id IS NULL) order by id;
@@ -3907,8 +3789,8 @@ Warning 1292 Incorrect datetime value: '2155'
Warning 1292 Incorrect datetime value: '2000'
Warning 1292 Incorrect datetime value: '2005'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as datetime) AS `CAST(my_year AS DATETIME)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as datetime) AS `CAST(my_year AS DATETIME)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 47 OR select_id IS NULL) order by id;
@@ -3941,8 +3823,8 @@ Warnings:
Warning 1292 Incorrect datetime value: '0000-00-00 838:59:59'
Warning 1292 Incorrect datetime value: '0000-00-00 838:59:59'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as datetime) AS `CAST(my_time AS DATETIME)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as datetime) AS `CAST(my_time AS DATETIME)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 46 OR select_id IS NULL) order by id;
@@ -3970,8 +3852,8 @@ CAST(my_timestamp AS DATETIME) my_timestamp id
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as datetime) AS `CAST(my_timestamp AS DATETIME)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as datetime) AS `CAST(my_timestamp AS DATETIME)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 45 OR select_id IS NULL) order by id;
@@ -3996,8 +3878,8 @@ NULL NULL 1
2004-02-29 00:00:00 2004-02-29 4
2005-06-28 00:00:00 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as datetime) AS `CAST(my_date AS DATETIME)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as datetime) AS `CAST(my_date AS DATETIME)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 44 OR select_id IS NULL) order by id;
@@ -4022,8 +3904,8 @@ NULL NULL 1
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as datetime) AS `CAST(my_datetime AS DATETIME)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as datetime) AS `CAST(my_datetime AS DATETIME)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 43 OR select_id IS NULL) order by id;
@@ -4055,8 +3937,8 @@ Warning 1292 Incorrect datetime value: '0'
Warning 1292 Incorrect datetime value: '-1'
Warning 1292 Incorrect datetime value: '200506271758'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as datetime) AS `CAST(my_double AS DATETIME)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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 datetime) AS `CAST(my_double AS DATETIME)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 42 OR select_id IS NULL) order by id;
@@ -4095,8 +3977,8 @@ Warning 1292 Incorrect datetime value: '0'
Warning 1292 Incorrect datetime value: '-1'
Warning 1292 Incorrect datetime value: '200506271758'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as datetime) AS `CAST(my_bigint AS DATETIME)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as datetime) AS `CAST(my_bigint AS DATETIME)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 41 OR select_id IS NULL) order by id;
@@ -4134,8 +4016,8 @@ Warning 1292 Incorrect datetime value: '<---------1000 characters---------------
Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as datetime) AS `CAST(my_varbinary_1000 AS DATETIME)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 datetime) AS `CAST(my_varbinary_1000 AS DATETIME)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 40 OR select_id IS NULL) order by id;
@@ -4173,8 +4055,8 @@ Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
Warning 1292 Incorrect datetime value: '-1'
Warning 1292 Truncated incorrect datetime value: '2005-06-27 17:58'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as datetime) AS `CAST(my_binary_30 AS DATETIME)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 datetime) AS `CAST(my_binary_30 AS DATETIME)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 39 OR select_id IS NULL) order by id;
@@ -4212,8 +4094,8 @@ Warning 1292 Incorrect datetime value: '<---------1000 characters---------------
Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as datetime) AS `CAST(my_varchar_1000 AS DATETIME)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 datetime) AS `CAST(my_varchar_1000 AS DATETIME)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 38 OR select_id IS NULL) order by id;
@@ -4250,8 +4132,8 @@ Warning 1292 Incorrect datetime value: '<--------30 characters------->'
Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$--'
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as datetime) AS `CAST(my_char_30 AS DATETIME)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 datetime) AS `CAST(my_char_30 AS DATETIME)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 37 OR select_id IS NULL) order by id;
@@ -4287,8 +4169,8 @@ Warning 1292 Incorrect datetime value: '2155'
Warning 1292 Incorrect datetime value: '2000'
Warning 1292 Incorrect datetime value: '2005'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as date) AS `CAST(my_year AS DATE)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as date) AS `CAST(my_year AS DATE)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 36 OR select_id IS NULL) order by id;
@@ -4318,8 +4200,8 @@ NULL NULL 1
0000-00-00 13:00:00 4
0000-00-00 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as date) AS `CAST(my_time AS DATE)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as date) AS `CAST(my_time AS DATE)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 35 OR select_id IS NULL) order by id;
@@ -4344,8 +4226,8 @@ CAST(my_timestamp AS DATE) my_timestamp id
2004-02-29 2004-02-29 23:59:59 4
2005-06-28 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as date) AS `CAST(my_timestamp AS DATE)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as date) AS `CAST(my_timestamp AS DATE)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 34 OR select_id IS NULL) order by id;
@@ -4370,8 +4252,8 @@ NULL NULL 1
2004-02-29 2004-02-29 4
2005-06-28 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as date) AS `CAST(my_date AS DATE)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as date) AS `CAST(my_date AS DATE)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 33 OR select_id IS NULL) order by id;
@@ -4396,8 +4278,8 @@ NULL NULL 1
2004-02-29 2004-02-29 23:59:59 4
2005-06-28 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as date) AS `CAST(my_datetime AS DATE)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as date) AS `CAST(my_datetime AS DATE)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 32 OR select_id IS NULL) order by id;
@@ -4428,8 +4310,8 @@ Warning 1292 Incorrect datetime value: '1.7976931348623e+308'
Warning 1292 Incorrect datetime value: '0'
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as date) AS `CAST(my_double AS DATE)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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 date) AS `CAST(my_double AS DATE)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 31 OR select_id IS NULL) order by id;
@@ -4466,8 +4348,8 @@ Warning 1292 Incorrect datetime value: '9223372036854775807'
Warning 1292 Incorrect datetime value: '0'
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as date) AS `CAST(my_bigint AS DATE)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as date) AS `CAST(my_bigint AS DATE)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 30 OR select_id IS NULL) order by id;
@@ -4504,8 +4386,8 @@ Warning 1292 Incorrect datetime value: '<---------1000 characters---------------
Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as date) AS `CAST(my_varbinary_1000 AS DATE)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 date) AS `CAST(my_varbinary_1000 AS DATE)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 29 OR select_id IS NULL) order by id;
@@ -4543,8 +4425,8 @@ Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
Warning 1292 Incorrect datetime value: '-1'
Warning 1292 Truncated incorrect date value: '2005-06-27'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as date) AS `CAST(my_binary_30 AS DATE)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 date) AS `CAST(my_binary_30 AS DATE)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 28 OR select_id IS NULL) order by id;
@@ -4582,8 +4464,8 @@ Warning 1292 Incorrect datetime value: '<---------1000 characters---------------
Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as date) AS `CAST(my_varchar_1000 AS DATE)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 date) AS `CAST(my_varchar_1000 AS DATE)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 27 OR select_id IS NULL) order by id;
@@ -4620,8 +4502,8 @@ Warning 1292 Incorrect datetime value: '<--------30 characters------->'
Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$--'
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as date) AS `CAST(my_char_30 AS DATE)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 date) AS `CAST(my_char_30 AS DATE)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 26 OR select_id IS NULL) order by id;
@@ -4652,8 +4534,8 @@ NULL NULL 1
2000 2000 4
2005 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as char charset latin1) AS `CAST(my_year AS CHAR)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as char charset latin1) AS `CAST(my_year AS CHAR)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 25 OR select_id IS NULL) order by id;
@@ -4678,8 +4560,8 @@ NULL NULL 1
13:00:00 13:00:00 4
10:00:00 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as char charset latin1) AS `CAST(my_time AS CHAR)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as char charset latin1) AS `CAST(my_time AS CHAR)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 24 OR select_id IS NULL) order by id;
@@ -4704,8 +4586,8 @@ CAST(my_timestamp AS CHAR) my_timestamp id
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as char charset latin1) AS `CAST(my_timestamp AS CHAR)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as char charset latin1) AS `CAST(my_timestamp AS CHAR)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 23 OR select_id IS NULL) order by id;
@@ -4730,8 +4612,8 @@ NULL NULL 1
2004-02-29 2004-02-29 4
2005-06-28 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as char charset latin1) AS `CAST(my_date AS CHAR)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as char charset latin1) AS `CAST(my_date AS CHAR)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 22 OR select_id IS NULL) order by id;
@@ -4756,8 +4638,8 @@ NULL NULL 1
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as char charset latin1) AS `CAST(my_datetime AS CHAR)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as char charset latin1) AS `CAST(my_datetime AS CHAR)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 21 OR select_id IS NULL) order by id;
@@ -4782,8 +4664,8 @@ NULL NULL 1
0 0 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as char charset latin1) AS `CAST(my_double AS CHAR)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset latin1) AS `CAST(my_double AS CHAR)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 20 OR select_id IS NULL) order by id;
@@ -4808,8 +4690,8 @@ NULL NULL 1
0.000000000000000000000000000000 0.000000000000000000000000000000 4
-1.000000000000000000000000000000 -1.000000000000000000000000000000 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as char charset latin1) AS `CAST(my_decimal AS CHAR)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset latin1) AS `CAST(my_decimal AS CHAR)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 19 OR select_id IS NULL) order by id;
@@ -4834,8 +4716,8 @@ NULL NULL 1
0 0 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as char charset latin1) AS `CAST(my_bigint AS CHAR)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as char charset latin1) AS `CAST(my_bigint AS CHAR)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 18 OR select_id IS NULL) order by id;
@@ -4860,8 +4742,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as char charset latin1) AS `CAST(my_varbinary_1000 AS CHAR)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset latin1) AS `CAST(my_varbinary_1000 AS CHAR)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 17 OR select_id IS NULL) order by id;
@@ -4886,8 +4768,8 @@ NULL NULL 1
---äÖüß@µ*$--
-1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as char charset latin1) AS `CAST(my_binary_30 AS CHAR)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset latin1) AS `CAST(my_binary_30 AS CHAR)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 16 OR select_id IS NULL) order by id;
@@ -4912,8 +4794,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as char charset latin1) AS `CAST(my_varchar_1000 AS CHAR)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset latin1) AS `CAST(my_varchar_1000 AS CHAR)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 15 OR select_id IS NULL) order by id;
@@ -4938,8 +4820,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as char charset latin1) AS `CAST(my_char_30 AS CHAR)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset latin1) AS `CAST(my_char_30 AS CHAR)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 14 OR select_id IS NULL) order by id;
@@ -4964,8 +4846,8 @@ NULL NULL 1
2000 2000 4
2005 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as char charset binary) AS `CAST(my_year AS BINARY)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as char charset binary) AS `CAST(my_year AS BINARY)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 13 OR select_id IS NULL) order by id;
@@ -4990,8 +4872,8 @@ NULL NULL 1
13:00:00 13:00:00 4
10:00:00 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as char charset binary) AS `CAST(my_time AS BINARY)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as char charset binary) AS `CAST(my_time AS BINARY)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 12 OR select_id IS NULL) order by id;
@@ -5016,8 +4898,8 @@ CAST(my_timestamp AS BINARY) my_timestamp id
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as char charset binary) AS `CAST(my_timestamp AS BINARY)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as char charset binary) AS `CAST(my_timestamp AS BINARY)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 11 OR select_id IS NULL) order by id;
@@ -5042,8 +4924,8 @@ NULL NULL 1
2004-02-29 2004-02-29 4
2005-06-28 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as char charset binary) AS `CAST(my_date AS BINARY)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as char charset binary) AS `CAST(my_date AS BINARY)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 10 OR select_id IS NULL) order by id;
@@ -5068,8 +4950,8 @@ NULL NULL 1
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as char charset binary) AS `CAST(my_datetime AS BINARY)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as char charset binary) AS `CAST(my_datetime AS BINARY)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 9 OR select_id IS NULL) order by id;
@@ -5094,8 +4976,8 @@ NULL NULL 1
0 0 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as char charset binary) AS `CAST(my_double AS BINARY)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset binary) AS `CAST(my_double AS BINARY)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 8 OR select_id IS NULL) order by id;
@@ -5120,8 +5002,8 @@ NULL NULL 1
0.000000000000000000000000000000 0.000000000000000000000000000000 4
-1.000000000000000000000000000000 -1.000000000000000000000000000000 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as char charset binary) AS `CAST(my_decimal AS BINARY)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset binary) AS `CAST(my_decimal AS BINARY)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 7 OR select_id IS NULL) order by id;
@@ -5146,8 +5028,8 @@ NULL NULL 1
0 0 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as char charset binary) AS `CAST(my_bigint AS BINARY)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as char charset binary) AS `CAST(my_bigint AS BINARY)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 6 OR select_id IS NULL) order by id;
@@ -5172,8 +5054,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as char charset binary) AS `CAST(my_varbinary_1000 AS BINARY)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset binary) AS `CAST(my_varbinary_1000 AS BINARY)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 5 OR select_id IS NULL) order by id;
@@ -5198,8 +5080,8 @@ NULL NULL 1
---äÖüß@µ*$--
-1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as char charset binary) AS `CAST(my_binary_30 AS BINARY)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset binary) AS `CAST(my_binary_30 AS BINARY)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 4 OR select_id IS NULL) order by id;
@@ -5224,8 +5106,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as char charset binary) AS `CAST(my_varchar_1000 AS BINARY)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset binary) AS `CAST(my_varchar_1000 AS BINARY)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 3 OR select_id IS NULL) order by id;
@@ -5250,8 +5132,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as char charset binary) AS `CAST(my_char_30 AS BINARY)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset binary) AS `CAST(my_char_30 AS BINARY)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 2 OR select_id IS NULL) order by id;
@@ -5276,8 +5158,8 @@ NULL -1 5
2 4 6
NULL -25 7
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sqrt(`t1_values`.`my_bigint`) AS `sqrt(my_bigint)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sqrt(`t1_values`.`my_bigint`) AS `sqrt(my_bigint)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 1 OR select_id IS NULL) order by id;
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 903f2b3d01f..903f2b3d01f 100644..100755
--- a/mysql-test/suite/funcs_1/r/memory_storedproc_02.result
+++ b/mysql-test/suite/funcs_1/r/memory_storedproc_02.result
diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc_03.result b/mysql-test/suite/funcs_1/r/memory_storedproc_03.result
index 6ee2d712e73..6ee2d712e73 100644..100755
--- a/mysql-test/suite/funcs_1/r/memory_storedproc_03.result
+++ b/mysql-test/suite/funcs_1/r/memory_storedproc_03.result
diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc_06.result b/mysql-test/suite/funcs_1/r/memory_storedproc_06.result
index a627de4b534..2b93431ba5b 100644
--- a/mysql-test/suite/funcs_1/r/memory_storedproc_06.result
+++ b/mysql-test/suite/funcs_1/r/memory_storedproc_06.result
@@ -81,6 +81,7 @@ BEGIN
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
END//
ERROR 42000: Access denied for user 'user_1'@'localhost' to database 'db_storedproc_1'
+USE db_storedproc_1;
root@localhost db_storedproc_1
GRANT CREATE ROUTINE ON db_storedproc_1.* TO 'user_1'@'localhost';
@@ -92,6 +93,7 @@ CREATE PROCEDURE sp1(v1 char(20))
BEGIN
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
END//
+USE db_storedproc_1;
root@localhost db_storedproc_1
DROP USER 'user_1'@'localhost';
@@ -117,6 +119,7 @@ CREATE FUNCTION fn1(v1 int) returns int
BEGIN
return v1;
END//
+USE db_storedproc_1;
root@localhost db_storedproc_1
drop user 'user_1'@'localhost';
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 34e5ff76f29..a44e96501ef 100644..100755
--- a/mysql-test/suite/funcs_1/r/memory_storedproc_07.result
+++ b/mysql-test/suite/funcs_1/r/memory_storedproc_07.result
@@ -90,7 +90,7 @@ INSERT INTO result VALUES (@cur_val_sql_mode, 'value not restored');
END if;
END//
SHOW CREATE PROCEDURE sp1;
-Procedure sql_mode Create Procedure
+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`()
BEGIN
declare a tinyint;
@@ -104,7 +104,7 @@ INSERT INTO result VALUES (@cur_val_sql_mode, 'value restored');
ELSE
INSERT INTO result VALUES (@cur_val_sql_mode, 'value not restored');
END if;
-END
+END latin1 latin1_swedish_ci latin1_swedish_ci
set @@sql_mode='';
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
@@ -143,12 +143,12 @@ SET @@sql_mode='MAXDB';
SHOW VARIABLES LIKE 'sql_mode';
END//
SHOW CREATE PROCEDURE sp2;
-Procedure sql_mode Create Procedure
+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`()
BEGIN
SET @@sql_mode='MAXDB';
SHOW VARIABLES LIKE 'sql_mode';
-END
+END latin1 latin1_swedish_ci latin1_swedish_ci
... show value prior calling procedure
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
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 712d9ae933f..ae7007759c6 100644..100755
--- a/mysql-test/suite/funcs_1/r/memory_storedproc_08.result
+++ b/mysql-test/suite/funcs_1/r/memory_storedproc_08.result
@@ -122,6 +122,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -146,6 +149,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT created with INVOKER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -168,6 +174,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -190,6 +199,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT created with INVOKER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode
@@ -199,6 +211,9 @@ set @x=i1;
set @y=@x;
return i4;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE FUNCTION fn_2;
Function fn_2
sql_mode
@@ -210,6 +225,9 @@ set @x=i1;
set @y=@x;
return i4;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_1;
Procedure sp_1
sql_mode
@@ -217,6 +235,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_1`(i1 int)
BEGIN
set @x=i1;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_2;
Procedure sp_2
sql_mode
@@ -226,6 +247,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
BEGIN
set @x=i1;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW FUNCTION STATUS LIKE 'fn_%';
Db db_storedproc
Name fn_1
@@ -235,6 +259,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
Db db_storedproc
Name fn_2
Type FUNCTION
@@ -243,6 +270,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment created with INVOKER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW PROCEDURE STATUS LIKE 'sp_%';
Db db_storedproc
Name sp_1
@@ -252,6 +282,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
Db db_storedproc
Name sp_2
Type PROCEDURE
@@ -260,6 +293,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment created with INVOKER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
... now change some stuff:
--------------------------
@@ -304,6 +340,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT new comment, FN changed to INVOKER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -328,6 +367,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT FN changed to DEFINER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -350,6 +392,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT new comment, SP changed to INVOKER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -372,6 +417,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT SP changed to DEFINER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode
@@ -384,6 +432,9 @@ set @x=i1;
set @y=@x;
return i4;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE FUNCTION fn_2;
Function fn_2
sql_mode
@@ -395,6 +446,9 @@ set @x=i1;
set @y=@x;
return i4;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_1;
Procedure sp_1
sql_mode
@@ -404,6 +458,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_1`(i1 int)
BEGIN
set @x=i1;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_2;
Procedure sp_2
sql_mode
@@ -413,6 +470,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
BEGIN
set @x=i1;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW FUNCTION STATUS LIKE 'fn_%';
Db db_storedproc
Name fn_1
@@ -422,6 +482,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment new comment, FN changed to INVOKER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
Db db_storedproc
Name fn_2
Type FUNCTION
@@ -430,6 +493,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment FN changed to DEFINER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW PROCEDURE STATUS LIKE 'sp_%';
Db db_storedproc
Name sp_1
@@ -439,6 +505,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment new comment, SP changed to INVOKER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
Db db_storedproc
Name sp_2
Type PROCEDURE
@@ -447,6 +516,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment SP changed to DEFINER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
... change back to default and check result:
--------------------------------------------
@@ -479,6 +551,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT new comment, FN changed to INVOKER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -503,6 +578,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT FN changed to DEFINER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -525,6 +603,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT new comment, SP changed to INVOKER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -547,6 +628,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT SP changed to DEFINER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode
@@ -559,6 +643,9 @@ set @x=i1;
set @y=@x;
return i4;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE FUNCTION fn_2;
Function fn_2
sql_mode
@@ -569,6 +656,9 @@ set @x=i1;
set @y=@x;
return i4;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_1;
Procedure sp_1
sql_mode
@@ -578,6 +668,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_1`(i1 int)
BEGIN
set @x=i1;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_2;
Procedure sp_2
sql_mode
@@ -587,6 +680,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
BEGIN
set @x=i1;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW FUNCTION STATUS LIKE 'fn_%';
Db db_storedproc
Name fn_1
@@ -596,6 +692,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment new comment, FN changed to INVOKER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
Db db_storedproc
Name fn_2
Type FUNCTION
@@ -604,6 +703,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment FN changed to DEFINER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW PROCEDURE STATUS LIKE 'sp_%';
Db db_storedproc
Name sp_1
@@ -613,6 +715,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment new comment, SP changed to INVOKER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
Db db_storedproc
Name sp_2
Type PROCEDURE
@@ -621,6 +726,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment SP changed to DEFINER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
... cleanup
-----------
diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc_10.result b/mysql-test/suite/funcs_1/r/memory_storedproc_10.result
index e924cf0731a..c316ce36dde 100644..100755
--- a/mysql-test/suite/funcs_1/r/memory_storedproc_10.result
+++ b/mysql-test/suite/funcs_1/r/memory_storedproc_10.result
@@ -58,7 +58,6 @@ load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11;
Section 3.1.10 - CALL checks:
--------------------------------------------------------------------------------
-USE db_storedproc;
Testcase 3.1.10.2 + 3.1.10.5:
-----------------------------
@@ -95,6 +94,7 @@ CALL sp31102();
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102'
SELECT fn31105( 9 );
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105'
+USE db_storedproc;
root@localhost db_storedproc
CALL sp31102();
@@ -114,6 +114,7 @@ a` a` 1000-01-01 -5000 a` -5000
SELECT fn31105( 9 );
fn31105( 9 )
81
+USE db_storedproc;
root@localhost db_storedproc
REVOKE EXECUTE ON db_storedproc.* FROM 'user_2'@'localhost';
@@ -131,6 +132,7 @@ CALL sp31102();
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102'
SELECT fn31105( 9 );
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105'
+USE db_storedproc;
root@localhost db_storedproc
DROP PROCEDURE sp31102;
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_0102.result b/mysql-test/suite/funcs_1/r/memory_trig_0102.result
index 1319fc3e361..7ce24bf60d5 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_0102.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_0102.result
@@ -238,7 +238,7 @@ create table t1 (f1 integer) engine = memory;
use test;
CREATE TRIGGER trig_db.trg6_2 AFTER INSERT on tb3
for each row set @ret_trg6_2 = 5;
-ERROR HY000: Trigger in wrong schema
+ERROR 42S02: Table 'trig_db.tb3' doesn't exist
use trig_db;
CREATE TRIGGER trg6_3 AFTER INSERT on test.tb3
for each row set @ret_trg6_3 = 18;
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 65343df5e46..78c07dc6d92 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_03e.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_03e.result
@@ -263,7 +263,7 @@ select current_user;
current_user
root@localhost
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
grant select, insert, update on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
@@ -296,7 +296,7 @@ select current_user;
current_user
root@localhost
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
show tables;
Tables_in_priv_db
t1
@@ -317,7 +317,7 @@ select current_user;
current_user
test_yesprivs@localhost
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 1_2-yes';
select current_user;
@@ -453,9 +453,9 @@ ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for tabl
create trigger trg1_4 before UPDATE on t1 for each row
set new.f1 = 'trig 1_4-yes';
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
-trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL test_yesprivs@localhost
-trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL test_yesprivs@localhost
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
select current_user;
current_user
test_noprivs@localhost
@@ -570,11 +570,11 @@ current_user
test_yesprivs@localhost
use priv_db;
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
-trg1_1 INSERT t1 set new.f1 = 'trig 1_1-yes' BEFORE NULL test_yesprivs@localhost
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+trg1_1 INSERT t1 set new.f1 = 'trig 1_1-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
select * from information_schema.triggers;
-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
-NULL priv_db trg1_1 INSERT NULL priv_db t1 0 NULL set new.f1 = 'trig 1_1-yes' ROW BEFORE NULL NULL OLD NEW NULL test_yesprivs@localhost
+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 priv_db trg1_1 INSERT NULL priv_db t1 0 NULL set new.f1 = 'trig 1_1-yes' ROW BEFORE NULL NULL OLD NEW NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
drop trigger trg1_1;
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
select current_user;
@@ -863,7 +863,7 @@ select current_user;
current_user
root@localhost
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
grant TRIGGER on priv1_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
@@ -878,7 +878,7 @@ select current_user;
current_user
test_yesprivs@localhost
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 1_2-yes';
create trigger trg2_1 before INSERT on t2 for each row
@@ -990,7 +990,7 @@ select current_user;
current_user
root@localhost
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
grant select, insert, update ,trigger
on priv_db.t1 to test_yesprivs@localhost
with grant option;
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_08.result b/mysql-test/suite/funcs_1/r/memory_trig_08.result
index ddc990d1919..c445f03a2c0 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_08.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_08.result
@@ -488,9 +488,8 @@ BEGIN
WHILE @counter1 < new.f136
SET @counter1 = @counter1 + 1;
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 'WHILE @counter1 < new.f136
-SET @counter1 = @counter1 + 1;
-END' at line 3
+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 'SET @counter1 = @counter1 + 1;
+END' at line 4
delete from tb3 where f122='Test 3.5.8.5-while';
drop trigger trg7;
diff --git a/mysql-test/suite/funcs_1/r/memory_views.result b/mysql-test/suite/funcs_1/r/memory_views.result
index 9267cc5a98b..4bc0c4a3fa4 100644
--- a/mysql-test/suite/funcs_1/r/memory_views.result
+++ b/mysql-test/suite/funcs_1/r/memory_views.result
@@ -188,47 +188,47 @@ Insert into t1 values (500,9866);
Drop view if exists v1 ;
CREATE VIEW v1 AS select f59,f60,f61
FROM test.tb2 where f59=250;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f60,f61 limit 0,10;
f59 f60 f61
250 87895654 NULL
Drop view if exists v1 ;
CREATE VIEW v1 AS select f59,f60,f61
FROM test.tb2 limit 100;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59,f60,f61 limit 0,10;
f59 f60 f61
1 1 0000000001
2 2 0000000002
3 3 0000000003
4 4 0000000004
+4 74 NULL
5 5 0000000005
6 6 0000000006
7 7 0000000007
8 8 0000000008
9 9 0000000009
-10 10 0000000010
CREATE or REPLACE VIEW v1 AS select f59,f60,f61
FROM test.tb2 limit 4,3;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59,f60,f61 limit 0,10;
f59 f60 f61
5 5 0000000005
6 6 0000000006
7 7 0000000007
CREATE or REPLACE VIEW v1 AS select distinct f59
FROM test.tb2 limit 4,3;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
5
6
7
ALTER VIEW v1 AS select f59
FROM test.tb2 limit 6,2;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
7
8
CREATE or REPLACE VIEW v1 AS select f59
from tb2 order by f59 limit 100;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
1
2
@@ -270,7 +270,7 @@ f59
660
CREATE or REPLACE VIEW v1 AS select f59
from tb2 group by f59 limit 100;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
1
2
@@ -284,7 +284,7 @@ f59
10
CREATE or REPLACE VIEW v1 AS select f59
from tb2 group by f59 asc limit 100;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
1
2
@@ -298,21 +298,21 @@ f59
10
CREATE or REPLACE VIEW v1 AS select f59
from tb2 group by f59 desc limit 100;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
-569300
-76710
-9112
-7876
-3410
-3330
-2760
-2550
-987
-660
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
CREATE or REPLACE VIEW v1 AS (select f59 from tb2)
union (select f59 from t1) limit 100;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
1
2
@@ -326,7 +326,7 @@ f59
10
CREATE or REPLACE VIEW v1 AS (select f59 FROM tb2)
UNION DISTINCT(select f59 FROM t1) ;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
1
2
@@ -340,103 +340,103 @@ f59
10
CREATE or REPLACE VIEW v1 AS (select f59 FROM tb2)
UNION ALL(select f59 FROM t1) ;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
1
2
3
4
+4
5
6
7
8
9
-10
CREATE or REPLACE VIEW v1 AS select *
FROM test.tb2 WITH LOCAL CHECK OPTION ;
-select * FROM v1 limit 0,50;
+select * FROM v1 order by f59,f60,f61,f62,f63,f64 limit 0,50;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
1 1 0000000001 0000000000000000000000000000000000000000000000000000000000000001 0000000001 0000000000000000000000000000000000000000000000000000000000000001 -5 0.000000000000000000000000000000 1 0.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549435e-38 1.17549e-38 1.175494352e-38 01.17549e-38 00000001.175494352e-38 01.17549e-38 00000001.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 1970-01-02 00:00:01 1902 1902 1902 2enum 2set
2 2 0000000002 0000000000000000000000000000000000000000000000000000000000000002 0000000002 0000000000000000000000000000000000000000000000000000000000000002 -4 1.100000000000000000000000000000 2 1.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494349e-38 1.17549e-38 1.175494353e-38 01.17549e-38 00000001.175494353e-38 01.17549e-38 00000001.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 1970-01-03 00:00:02 1903 1903 1903 1enum 1set,2set
3 3 0000000003 0000000000000000000000000000000000000000000000000000000000000003 0000000003 0000000000000000000000000000000000000000000000000000000000000003 -3 2.200000000000000000000000000000 3 2.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494348e-38 1.17549e-38 1.175494354e-38 01.17549e-38 00000001.175494354e-38 01.17549e-38 00000001.175494354e-38 1000-01-03 838:59:56 1970-01-04 00:00:03 1970-01-04 00:00:03 1904 1904 1904 2enum 1set
4 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
+4 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
5 5 0000000005 0000000000000000000000000000000000000000000000000000000000000005 0000000005 0000000000000000000000000000000000000000000000000000000000000005 -1 4.400000000000000000000000000000 5 4.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494346e-38 1.17549e-38 1.175494356e-38 01.17549e-38 00000001.175494356e-38 01.17549e-38 00000001.175494356e-38 1000-01-05 838:59:54 1970-01-06 00:00:05 1970-01-06 00:00:05 1906 1906 1906 2enum 1set,2set
6 6 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0 5.500000000000000000000000000000 6 5.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494345e-38 1.17549e-38 1.175494357e-38 01.17549e-38 00000001.175494357e-38 01.17549e-38 00000001.175494357e-38 1000-01-06 838:59:53 1970-01-07 00:00:06 1970-01-07 00:00:06 1907 1907 1907 1enum 1set
7 7 0000000007 0000000000000000000000000000000000000000000000000000000000000007 0000000007 0000000000000000000000000000000000000000000000000000000000000007 1 6.600000000000000000000000000000 7 6.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494344e-38 1.17549e-38 1.175494358e-38 01.17549e-38 00000001.175494358e-38 01.17549e-38 00000001.175494358e-38 1000-01-07 838:59:52 1970-01-08 00:00:07 1970-01-08 00:00:07 1908 1908 1908 2enum 2set
8 8 0000000008 0000000000000000000000000000000000000000000000000000000000000008 0000000008 0000000000000000000000000000000000000000000000000000000000000008 2 7.700000000000000000000000000000 8 7.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494343e-38 1.17549e-38 1.175494359e-38 01.17549e-38 00000001.175494359e-38 01.17549e-38 00000001.175494359e-38 1000-01-08 838:59:51 1970-01-09 00:00:08 1970-01-09 00:00:08 1909 1909 1909 1enum 1set,2set
9 9 0000000009 0000000000000000000000000000000000000000000000000000000000000009 0000000009 0000000000000000000000000000000000000000000000000000000000000009 3 8.800000000000000000000000000000 9 8.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494342e-38 1.17549e-38 1.17549436e-38 01.17549e-38 000000001.17549436e-38 01.17549e-38 000000001.17549436e-38 1000-01-09 838:59:50 1970-01-10 00:00:09 1970-01-10 00:00:09 1910 1910 1910 2enum 1set
10 10 0000000010 0000000000000000000000000000000000000000000000000000000000000010 0000000010 0000000000000000000000000000000000000000000000000000000000000010 4 9.900000000000000000000000000000 10 9.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494341e-38 1.17549e-38 1.175494361e-38 01.17549e-38 00000001.175494361e-38 01.17549e-38 00000001.175494361e-38 1000-01-10 838:59:49 1970-01-11 00:00:10 1970-01-11 00:00:10 1911 1911 1911 1enum 2set
-76710 226546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-2760 985654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-569300 9114376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-660 876546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-250 87895654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-340 9984376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-3410 996546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-2550 775654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-3330 764376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-441 16546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-24 51654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-323 14376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-34 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-4 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
15 87 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+17 15 0000000016 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+19 18 0000000014 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
22 93 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-394 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+24 51654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+27 25 0000000026 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+29 28 0000000024 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+34 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
94 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-195 87 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-292 93 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-987 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-7876 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-321 NULL 0000000765 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-9112 NULL 0000008771 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
107 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+107 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+109 108 0000000104 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
109 108 0000000104 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+195 87 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
207 205 0000000206 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
209 208 0000000204 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-27 25 0000000026 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-29 28 0000000024 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-17 15 0000000016 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-19 18 0000000014 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-107 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-109 108 0000000104 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-299 899 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
242 79 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+250 87895654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+292 93 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+299 899 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+321 NULL 0000000765 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+323 14376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+340 9984376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+394 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
424 89 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+441 16546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+660 876546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+987 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+2550 775654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+2760 985654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+3330 764376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+3410 996546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+7876 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+9112 NULL 0000008771 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+76710 226546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+569300 9114376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
CREATE or REPLACE VIEW v1 AS select *
FROM test.tb2 WITH CASCADED CHECK OPTION ;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59,f60,f61,f62,f63,f64 limit 0,10;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
1 1 0000000001 0000000000000000000000000000000000000000000000000000000000000001 0000000001 0000000000000000000000000000000000000000000000000000000000000001 -5 0.000000000000000000000000000000 1 0.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549435e-38 1.17549e-38 1.175494352e-38 01.17549e-38 00000001.175494352e-38 01.17549e-38 00000001.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 1970-01-02 00:00:01 1902 1902 1902 2enum 2set
2 2 0000000002 0000000000000000000000000000000000000000000000000000000000000002 0000000002 0000000000000000000000000000000000000000000000000000000000000002 -4 1.100000000000000000000000000000 2 1.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494349e-38 1.17549e-38 1.175494353e-38 01.17549e-38 00000001.175494353e-38 01.17549e-38 00000001.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 1970-01-03 00:00:02 1903 1903 1903 1enum 1set,2set
3 3 0000000003 0000000000000000000000000000000000000000000000000000000000000003 0000000003 0000000000000000000000000000000000000000000000000000000000000003 -3 2.200000000000000000000000000000 3 2.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494348e-38 1.17549e-38 1.175494354e-38 01.17549e-38 00000001.175494354e-38 01.17549e-38 00000001.175494354e-38 1000-01-03 838:59:56 1970-01-04 00:00:03 1970-01-04 00:00:03 1904 1904 1904 2enum 1set
4 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
+4 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
5 5 0000000005 0000000000000000000000000000000000000000000000000000000000000005 0000000005 0000000000000000000000000000000000000000000000000000000000000005 -1 4.400000000000000000000000000000 5 4.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494346e-38 1.17549e-38 1.175494356e-38 01.17549e-38 00000001.175494356e-38 01.17549e-38 00000001.175494356e-38 1000-01-05 838:59:54 1970-01-06 00:00:05 1970-01-06 00:00:05 1906 1906 1906 2enum 1set,2set
6 6 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0 5.500000000000000000000000000000 6 5.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494345e-38 1.17549e-38 1.175494357e-38 01.17549e-38 00000001.175494357e-38 01.17549e-38 00000001.175494357e-38 1000-01-06 838:59:53 1970-01-07 00:00:06 1970-01-07 00:00:06 1907 1907 1907 1enum 1set
7 7 0000000007 0000000000000000000000000000000000000000000000000000000000000007 0000000007 0000000000000000000000000000000000000000000000000000000000000007 1 6.600000000000000000000000000000 7 6.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494344e-38 1.17549e-38 1.175494358e-38 01.17549e-38 00000001.175494358e-38 01.17549e-38 00000001.175494358e-38 1000-01-07 838:59:52 1970-01-08 00:00:07 1970-01-08 00:00:07 1908 1908 1908 2enum 2set
8 8 0000000008 0000000000000000000000000000000000000000000000000000000000000008 0000000008 0000000000000000000000000000000000000000000000000000000000000008 2 7.700000000000000000000000000000 8 7.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494343e-38 1.17549e-38 1.175494359e-38 01.17549e-38 00000001.175494359e-38 01.17549e-38 00000001.175494359e-38 1000-01-08 838:59:51 1970-01-09 00:00:08 1970-01-09 00:00:08 1909 1909 1909 1enum 1set,2set
9 9 0000000009 0000000000000000000000000000000000000000000000000000000000000009 0000000009 0000000000000000000000000000000000000000000000000000000000000009 3 8.800000000000000000000000000000 9 8.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494342e-38 1.17549e-38 1.17549436e-38 01.17549e-38 000000001.17549436e-38 01.17549e-38 000000001.17549436e-38 1000-01-09 838:59:50 1970-01-10 00:00:09 1970-01-10 00:00:09 1910 1910 1910 2enum 1set
-10 10 0000000010 0000000000000000000000000000000000000000000000000000000000000010 0000000010 0000000000000000000000000000000000000000000000000000000000000010 4 9.900000000000000000000000000000 10 9.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494341e-38 1.17549e-38 1.175494361e-38 01.17549e-38 00000001.175494361e-38 01.17549e-38 00000001.175494361e-38 1000-01-10 838:59:49 1970-01-11 00:00:10 1970-01-11 00:00:10 1911 1911 1911 1enum 2set
CREATE OR REPLACE VIEW v1 AS SELECT F59, F60
FROM test.tb2 WITH CASCADED CHECK OPTION;
-SELECT * FROM v1 limit 0,10;
+SELECT * FROM v1 order by f59,f60 limit 0,10;
F59 F60
1 1
2 2
3 3
4 4
+4 74
5 5
6 6
7 7
8 8
9 9
-10 10
CREATE or REPLACE VIEW v1 AS select f59, f60
from test.tb2 where f59=3330 ;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f60 limit 0,10;
f59 f60
3330 764376
DROP VIEW v1 ;
@@ -867,73 +867,73 @@ CREATE TABLE t1 (f1 BIGINT);
INSERT INTO t1 VALUES(1);
CREATE VIEW test.v1 AS SELECT * FROM t1 limit 2;
SHOW CREATE VIEW test.v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` limit 2
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` limit 2 latin1 latin1_swedish_ci
SELECT * FROM test.v1;
f1
1
CREATE OR REPLACE ALGORITHM = TEMPTABLE VIEW test.v1
AS SELECT * FROM t1 limit 2;
SHOW CREATE VIEW test.v1;
-View Create View
-v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` limit 2
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` limit 2 latin1 latin1_swedish_ci
SELECT * FROM test.v1;
f1
1
-CREATE OR REPLACE VIEW test.v1 AS SELECT * FROM tb2 limit 2;
+CREATE OR REPLACE VIEW test.v1 AS SELECT * FROM tb2 order by f59 limit 2;
SHOW CREATE VIEW test.v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `tb2`.`f59` AS `f59`,`tb2`.`f60` AS `f60`,`tb2`.`f61` AS `f61`,`tb2`.`f62` AS `f62`,`tb2`.`f63` AS `f63`,`tb2`.`f64` AS `f64`,`tb2`.`f65` AS `f65`,`tb2`.`f66` AS `f66`,`tb2`.`f67` AS `f67`,`tb2`.`f68` AS `f68`,`tb2`.`f69` AS `f69`,`tb2`.`f70` AS `f70`,`tb2`.`f71` AS `f71`,`tb2`.`f72` AS `f72`,`tb2`.`f73` AS `f73`,`tb2`.`f74` AS `f74`,`tb2`.`f75` AS `f75`,`tb2`.`f76` AS `f76`,`tb2`.`f77` AS `f77`,`tb2`.`f78` AS `f78`,`tb2`.`f79` AS `f79`,`tb2`.`f80` AS `f80`,`tb2`.`f81` AS `f81`,`tb2`.`f82` AS `f82`,`tb2`.`f83` AS `f83`,`tb2`.`f84` AS `f84`,`tb2`.`f85` AS `f85`,`tb2`.`f86` AS `f86`,`tb2`.`f87` AS `f87`,`tb2`.`f88` AS `f88`,`tb2`.`f89` AS `f89`,`tb2`.`f90` AS `f90`,`tb2`.`f91` AS `f91`,`tb2`.`f92` AS `f92`,`tb2`.`f93` AS `f93`,`tb2`.`f94` AS `f94`,`tb2`.`f95` AS `f95`,`tb2`.`f96` AS `f96`,`tb2`.`f97` AS `f97`,`tb2`.`f98` AS `f98`,`tb2`.`f99` AS `f99`,`tb2`.`f100` AS `f100`,`tb2`.`f101` AS `f101`,`tb2`.`f102` AS `f102`,`tb2`.`f103` AS `f103`,`tb2`.`f104` AS `f104`,`tb2`.`f105` AS `f105`,`tb2`.`f106` AS `f106`,`tb2`.`f107` AS `f107`,`tb2`.`f108` AS `f108`,`tb2`.`f109` AS `f109` from `tb2` limit 2
-SELECT * FROM test.v1 ;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `tb2`.`f59` AS `f59`,`tb2`.`f60` AS `f60`,`tb2`.`f61` AS `f61`,`tb2`.`f62` AS `f62`,`tb2`.`f63` AS `f63`,`tb2`.`f64` AS `f64`,`tb2`.`f65` AS `f65`,`tb2`.`f66` AS `f66`,`tb2`.`f67` AS `f67`,`tb2`.`f68` AS `f68`,`tb2`.`f69` AS `f69`,`tb2`.`f70` AS `f70`,`tb2`.`f71` AS `f71`,`tb2`.`f72` AS `f72`,`tb2`.`f73` AS `f73`,`tb2`.`f74` AS `f74`,`tb2`.`f75` AS `f75`,`tb2`.`f76` AS `f76`,`tb2`.`f77` AS `f77`,`tb2`.`f78` AS `f78`,`tb2`.`f79` AS `f79`,`tb2`.`f80` AS `f80`,`tb2`.`f81` AS `f81`,`tb2`.`f82` AS `f82`,`tb2`.`f83` AS `f83`,`tb2`.`f84` AS `f84`,`tb2`.`f85` AS `f85`,`tb2`.`f86` AS `f86`,`tb2`.`f87` AS `f87`,`tb2`.`f88` AS `f88`,`tb2`.`f89` AS `f89`,`tb2`.`f90` AS `f90`,`tb2`.`f91` AS `f91`,`tb2`.`f92` AS `f92`,`tb2`.`f93` AS `f93`,`tb2`.`f94` AS `f94`,`tb2`.`f95` AS `f95`,`tb2`.`f96` AS `f96`,`tb2`.`f97` AS `f97`,`tb2`.`f98` AS `f98`,`tb2`.`f99` AS `f99`,`tb2`.`f100` AS `f100`,`tb2`.`f101` AS `f101`,`tb2`.`f102` AS `f102`,`tb2`.`f103` AS `f103`,`tb2`.`f104` AS `f104`,`tb2`.`f105` AS `f105`,`tb2`.`f106` AS `f106`,`tb2`.`f107` AS `f107`,`tb2`.`f108` AS `f108`,`tb2`.`f109` AS `f109` from `tb2` order by `tb2`.`f59` limit 2 latin1 latin1_swedish_ci
+SELECT * FROM test.v1 order by f59,f60,f61,f62,f63,f64,f65;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
1 1 0000000001 0000000000000000000000000000000000000000000000000000000000000001 0000000001 0000000000000000000000000000000000000000000000000000000000000001 -5 0.000000000000000000000000000000 1 0.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549435e-38 1.17549e-38 1.175494352e-38 01.17549e-38 00000001.175494352e-38 01.17549e-38 00000001.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 1970-01-02 00:00:01 1902 1902 1902 2enum 2set
2 2 0000000002 0000000000000000000000000000000000000000000000000000000000000002 0000000002 0000000000000000000000000000000000000000000000000000000000000002 -4 1.100000000000000000000000000000 2 1.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494349e-38 1.17549e-38 1.175494353e-38 01.17549e-38 00000001.175494353e-38 01.17549e-38 00000001.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 1970-01-03 00:00:02 1903 1903 1903 1enum 1set,2set
CREATE OR REPLACE VIEW test.v1 AS SELECT F59 FROM tb2 limit 10,100;
SHOW CREATE VIEW test.v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `tb2`.`f59` AS `F59` from `tb2` limit 10,100
-SELECT * FROM test.v1;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `tb2`.`f59` AS `F59` from `tb2` limit 10,100 latin1 latin1_swedish_ci
+SELECT * FROM test.v1 order by F59;
F59
-76710
-2760
-569300
-660
-250
-340
-3410
-2550
-3330
-441
-24
-323
-34
4
15
+17
+19
22
-394
+24
+27
+29
+34
94
-195
-292
-987
-7876
-321
-9112
-500
-500
-500
+107
107
109
+109
+195
207
209
-27
-29
-17
-19
-107
-109
-299
242
+250
+292
+299
+321
+323
+340
+394
424
+441
+500
+500
+500
+660
+987
+2550
+2760
+3330
+3410
+7876
+9112
+76710
+569300
Drop table test.t1 ;
Drop view test.v1 ;
@@ -969,38 +969,38 @@ CREATE TABLE t1 (f1 NUMERIC(15,3));
INSERT INTO t1 VALUES(8.8);
CREATE VIEW v1 AS SELECT * FROM t1;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
f1
8.800
CREATE OR REPLACE VIEW v1 AS SELECT f1 FROM t1;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
f1
8.800
CREATE OR REPLACE VIEW v1 AS SELECT f1 As my_column FROM t1;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `my_column` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `my_column` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
my_column
8.800
CREATE OR REPLACE VIEW v1(column1,column2)
AS SELECT f1 As my_column, f1 FROM t1;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `column1`,`t1`.`f1` AS `column2` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `column1`,`t1`.`f1` AS `column2` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
column1 column2
8.800 8.800
CREATE OR REPLACE VIEW test.v1(column1,column2)
AS SELECT f1 As my_column, f1 FROM test.t1;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `column1`,`t1`.`f1` AS `column2` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `column1`,`t1`.`f1` AS `column2` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
column1 column2
8.800 8.800
@@ -1085,7 +1085,7 @@ Testcase 3.3.1.21
--------------------------------------------------------------------------------
DROP VIEW IF EXISTS v1;
CREATE VIEW test.v1( F59, F60 ) AS SELECT F59, F60 From tb2 LIMIT 2;
-SELECT * FROM test.v1;
+SELECT * FROM test.v1 order by F59, F60 desc;
F59 F60
1 1
2 2
@@ -1194,7 +1194,7 @@ DROP VIEW IF EXISTS test.v1;
Drop VIEW IF EXISTS test.v1_1 ;
Create view test.v1 AS Select * from test.tb2 limit 2 ;
Create view test.v1_1 AS Select F59 from test.v1 ;
-Select * from test.v1_1 limit 20 ;
+Select * from test.v1_1 order by F59 limit 20 ;
F59
1
2
@@ -1208,58 +1208,58 @@ create database test2 ;
Create view test2.v2 AS Select * from test.tb2 limit 50,50;
use test2 ;
Create view v1 AS Select * from test.tb2 limit 50 ;
-Select * from v1 ;
+Select * from v1 order by f59,f60,f61,f62,f63,f64,f65;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
1 1 0000000001 0000000000000000000000000000000000000000000000000000000000000001 0000000001 0000000000000000000000000000000000000000000000000000000000000001 -5 0.000000000000000000000000000000 1 0.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549435e-38 1.17549e-38 1.175494352e-38 01.17549e-38 00000001.175494352e-38 01.17549e-38 00000001.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 1970-01-02 00:00:01 1902 1902 1902 2enum 2set
2 2 0000000002 0000000000000000000000000000000000000000000000000000000000000002 0000000002 0000000000000000000000000000000000000000000000000000000000000002 -4 1.100000000000000000000000000000 2 1.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494349e-38 1.17549e-38 1.175494353e-38 01.17549e-38 00000001.175494353e-38 01.17549e-38 00000001.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 1970-01-03 00:00:02 1903 1903 1903 1enum 1set,2set
3 3 0000000003 0000000000000000000000000000000000000000000000000000000000000003 0000000003 0000000000000000000000000000000000000000000000000000000000000003 -3 2.200000000000000000000000000000 3 2.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494348e-38 1.17549e-38 1.175494354e-38 01.17549e-38 00000001.175494354e-38 01.17549e-38 00000001.175494354e-38 1000-01-03 838:59:56 1970-01-04 00:00:03 1970-01-04 00:00:03 1904 1904 1904 2enum 1set
4 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
+4 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
5 5 0000000005 0000000000000000000000000000000000000000000000000000000000000005 0000000005 0000000000000000000000000000000000000000000000000000000000000005 -1 4.400000000000000000000000000000 5 4.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494346e-38 1.17549e-38 1.175494356e-38 01.17549e-38 00000001.175494356e-38 01.17549e-38 00000001.175494356e-38 1000-01-05 838:59:54 1970-01-06 00:00:05 1970-01-06 00:00:05 1906 1906 1906 2enum 1set,2set
6 6 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0 5.500000000000000000000000000000 6 5.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494345e-38 1.17549e-38 1.175494357e-38 01.17549e-38 00000001.175494357e-38 01.17549e-38 00000001.175494357e-38 1000-01-06 838:59:53 1970-01-07 00:00:06 1970-01-07 00:00:06 1907 1907 1907 1enum 1set
7 7 0000000007 0000000000000000000000000000000000000000000000000000000000000007 0000000007 0000000000000000000000000000000000000000000000000000000000000007 1 6.600000000000000000000000000000 7 6.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494344e-38 1.17549e-38 1.175494358e-38 01.17549e-38 00000001.175494358e-38 01.17549e-38 00000001.175494358e-38 1000-01-07 838:59:52 1970-01-08 00:00:07 1970-01-08 00:00:07 1908 1908 1908 2enum 2set
8 8 0000000008 0000000000000000000000000000000000000000000000000000000000000008 0000000008 0000000000000000000000000000000000000000000000000000000000000008 2 7.700000000000000000000000000000 8 7.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494343e-38 1.17549e-38 1.175494359e-38 01.17549e-38 00000001.175494359e-38 01.17549e-38 00000001.175494359e-38 1000-01-08 838:59:51 1970-01-09 00:00:08 1970-01-09 00:00:08 1909 1909 1909 1enum 1set,2set
9 9 0000000009 0000000000000000000000000000000000000000000000000000000000000009 0000000009 0000000000000000000000000000000000000000000000000000000000000009 3 8.800000000000000000000000000000 9 8.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494342e-38 1.17549e-38 1.17549436e-38 01.17549e-38 000000001.17549436e-38 01.17549e-38 000000001.17549436e-38 1000-01-09 838:59:50 1970-01-10 00:00:09 1970-01-10 00:00:09 1910 1910 1910 2enum 1set
10 10 0000000010 0000000000000000000000000000000000000000000000000000000000000010 0000000010 0000000000000000000000000000000000000000000000000000000000000010 4 9.900000000000000000000000000000 10 9.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494341e-38 1.17549e-38 1.175494361e-38 01.17549e-38 00000001.175494361e-38 01.17549e-38 00000001.175494361e-38 1000-01-10 838:59:49 1970-01-11 00:00:10 1970-01-11 00:00:10 1911 1911 1911 1enum 2set
-76710 226546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-2760 985654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-569300 9114376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-660 876546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-250 87895654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-340 9984376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-3410 996546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-2550 775654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-3330 764376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-441 16546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-24 51654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-323 14376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-34 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-4 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
15 87 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+17 15 0000000016 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+19 18 0000000014 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
22 93 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-394 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+24 51654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+27 25 0000000026 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+29 28 0000000024 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+34 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
94 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-195 87 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-292 93 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-987 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-7876 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-321 NULL 0000000765 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-9112 NULL 0000008771 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+107 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
107 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
109 108 0000000104 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+109 108 0000000104 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+195 87 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
207 205 0000000206 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
209 208 0000000204 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-27 25 0000000026 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-29 28 0000000024 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-17 15 0000000016 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-19 18 0000000014 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-107 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-109 108 0000000104 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-299 899 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
242 79 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+250 87895654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+292 93 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+299 899 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+321 NULL 0000000765 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+323 14376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+340 9984376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+394 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
424 89 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+441 16546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+660 876546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+987 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+2550 775654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+2760 985654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+3330 764376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+3410 996546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+7876 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+9112 NULL 0000008771 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+76710 226546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+569300 9114376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
Select * from test2.v2 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
Drop view if exists test2.v1 ;
@@ -1322,18 +1322,18 @@ CREATE VIEW test.v1
AS SELECT test.v1_firstview.f59, test.v1_firstview.f60
FROM test.v1_firstview INNER JOIN test.v1_secondview
ON test.v1_firstview.f59 = test.v1_secondview.f59 ;
-SELECT * FROM test.v1 limit 0,10;
+SELECT * FROM test.v1 order by f59,f60 limit 0,10;
f59 f60
1 1
2 2
3 3
4 4
+4 4
+4 74
4 74
5 5
6 6
7 7
-8 8
-9 9
Drop view if exists test.v1_firstview ;
Drop view if exists test.v1_secondview ;
Drop view if exists test.v1 ;
@@ -1351,18 +1351,18 @@ CREATE VIEW v1
AS SELECT test.v1_firstview.F59, test.v1_firstview.F60
FROM test.v1_firstview INNER JOIN test.v1_secondview
ON test.v1_firstview.f59 = test.v1_secondview.f59 ;
-SELECT * FROM v1 limit 0,10;
+SELECT * FROM v1 order by f59,f60 limit 0,10;
F59 F60
1 1
2 2
3 3
4 4
+4 4
+4 74
4 74
5 5
6 6
7 7
-8 8
-9 9
Drop view v1 ;
Drop view test.v1_firstview ;
Drop view test.v1_secondview ;
@@ -1377,18 +1377,18 @@ CREATE VIEW test.v1
AS SELECT test.v1_firstview.f59, test.v1_firstview.f60
FROM test.v1_firstview INNER JOIN test.tb2
ON test.v1_firstview.f59 = test.tb2.f59;
-SELECT * FROM test.v1 limit 0,10;
+SELECT * FROM test.v1 order by f59,f60 limit 0,10;
f59 f60
1 1
2 2
3 3
4 4
+4 4
+4 74
4 74
5 5
6 6
7 7
-8 8
-9 9
Drop view test.v1 ;
Drop view test.v1_firstview;
@@ -1401,18 +1401,18 @@ CREATE VIEW v1_firstview AS SELECT * FROM test.tb2 ;
CREATE VIEW v1
AS SELECT v1_firstview.f59, v1_firstview.f60
FROM v1_firstview INNER JOIN test.tb2 ON v1_firstview.f59 = test.tb2.f59 ;
-SELECT * FROM v1 limit 0,10;
+SELECT * FROM v1 order by f59,f60 limit 0,10;
f59 f60
1 1
2 2
3 3
4 4
+4 4
+4 74
4 74
5 5
6 6
7 7
-8 8
-9 9
Drop database test2 ;
Testcase 3.3.1.37
@@ -1424,18 +1424,18 @@ Drop view if exists test.v1_1 ;
Drop view if exists test.v1_1 ;
Drop view if exists test.v1_main ;
Create view test.v1 as Select f59, f60 FROM test.tb2;
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59,f60 limit 0,10;
f59 f60
1 1
2 2
3 3
4 4
+4 74
5 5
6 6
7 7
8 8
9 9
-10 10
Create table t1(f59 int, f60 int);
Insert into t1 values (90,507) ;
Create view v1_1 as Select f59,f60 from t1 ;
@@ -1445,18 +1445,18 @@ f59 f60
Create view v1_main
as SELECT test.tb2.f59 FROM test.tb2 JOIN test.v1
ON test.tb2.f59 = test.v1.f59;
-Select * from v1_main limit 0,10;
+Select * from v1_main order by f59 limit 0,10;
f59
1
2
3
4
4
+4
+4
5
6
7
-8
-9
Drop table t1;
Drop view test.v1 ;
Drop view test.v1_1 ;
@@ -1742,7 +1742,7 @@ Drop view if exists test.v1_main;
Drop view if exists test1.v1_1 ;
Drop database if exists test3 ;
Create view test.v1 as Select f59, f60 FROM test.tb2 limit 20 ;
-Select * from test.v1 ;
+Select * from test.v1 order by f59,f60;
f59 f60
1 1
2 2
@@ -1754,16 +1754,16 @@ f59 f60
8 8
9 9
10 10
-76710 226546
-2760 985654
-569300 9114376
-660 876546
250 87895654
340 9984376
-3410 996546
+441 16546
+660 876546
2550 775654
+2760 985654
3330 764376
-441 16546
+3410 996546
+76710 226546
+569300 9114376
Create table test1.t1 (f59 int,f60 int) ;
Insert into test1.t1 values (199,507) ;
Create view test1.v1_1 as Select f59,f60 from test1.t1 ;
@@ -1796,7 +1796,7 @@ Drop view if exists test.v1 ;
CREATE VIEW test.v1
AS Select f59 from (Select * FROM tb2 limit 20) tx ;
ERROR HY000: View's SELECT contains a subquery in the FROM clause
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by f59 ;
ERROR 42S02: Table 'test.v1' doesn't exist
Drop view if exists test.v1 ;
@@ -1877,7 +1877,7 @@ CREATE VIEW test.v1 AS SELECT * FROM test.tb2 where f59 = 04;
UPDATE test.v1 SET f59 = 30 where F59 = 04 ;
affected rows: 2
info: Rows matched: 2 Changed: 2 Warnings: 0
-SELECT * FROM test.v1 where f59 = 30 ;
+SELECT * FROM test.v1 where f59 = 30 order by f59;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
SELECT * FROM test.tb2 where f59 = 30 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
@@ -1890,7 +1890,7 @@ SELECT * FROM tb2 where f59 = 100 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
100 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
100 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by f59 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
drop view if exists test.v1 ;
Drop TABLE IF EXISTS test.t1 ;
@@ -1967,7 +1967,7 @@ CREATE VIEW test.v1 AS SELECT f59,f60
FROM test.tb2 where f59 = 195 WITH CHECK OPTION ;
UPDATE test.v1 SET f59 = 198 where f59=195 ;
ERROR HY000: CHECK OPTION failed 'test.v1'
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by f59 ;
f59 f60
195 87
drop view if exists test.v1 ;
@@ -1981,7 +1981,7 @@ FROM test.tb2 where F59 = 0987 WITH LOCAL CHECK OPTION ;
CREATE VIEW test.v2 as SELECT * FROM test.v1 ;
UPDATE test.v1 SET F59 = 919 where f59 = 0987 ;
ERROR HY000: CHECK OPTION failed 'test.v1'
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by f59 ;
f59 f60
987 41
UPDATE test.v2 SET F59 = 9879 where f59 = 919 ;
@@ -9676,115 +9676,115 @@ Testcase 3.3.1.50 - 3.3.1.53
--------------------------------------------------------------------------------
DROP VIEW IF EXISTS test.v1;
CREATE VIEW test.v1 AS SELECT * FROM test.tb2 limit 5 ;
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by f59 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
1 1 0000000001 0000000000000000000000000000000000000000000000000000000000000001 0000000001 0000000000000000000000000000000000000000000000000000000000000001 -5 0.000000000000000000000000000000 1 0.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549435e-38 1.17549e-38 1.175494352e-38 01.17549e-38 00000001.175494352e-38 01.17549e-38 00000001.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 1970-01-02 00:00:01 1902 1902 1902 2enum 2set
2 2 0000000002 0000000000000000000000000000000000000000000000000000000000000002 0000000002 0000000000000000000000000000000000000000000000000000000000000002 -4 1.100000000000000000000000000000 2 1.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494349e-38 1.17549e-38 1.175494353e-38 01.17549e-38 00000001.175494353e-38 01.17549e-38 00000001.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 1970-01-03 00:00:02 1903 1903 1903 1enum 1set,2set
3 3 0000000003 0000000000000000000000000000000000000000000000000000000000000003 0000000003 0000000000000000000000000000000000000000000000000000000000000003 -3 2.200000000000000000000000000000 3 2.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494348e-38 1.17549e-38 1.175494354e-38 01.17549e-38 00000001.175494354e-38 01.17549e-38 00000001.175494354e-38 1000-01-03 838:59:56 1970-01-04 00:00:03 1970-01-04 00:00:03 1904 1904 1904 2enum 1set
-100 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
5 5 0000000005 0000000000000000000000000000000000000000000000000000000000000005 0000000005 0000000000000000000000000000000000000000000000000000000000000005 -1 4.400000000000000000000000000000 5 4.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494346e-38 1.17549e-38 1.175494356e-38 01.17549e-38 00000001.175494356e-38 01.17549e-38 00000001.175494356e-38 1000-01-05 838:59:54 1970-01-06 00:00:05 1970-01-06 00:00:05 1906 1906 1906 2enum 1set,2set
+100 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
drop view test.v1 ;
CREATE VIEW test.v1 AS SELECT F59,F61 FROM test.tb2 limit 50 ;
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by F59, F61 ;
F59 F61
1 0000000001
2 0000000002
3 0000000003
-100 0000000004
5 0000000005
6 0000000006
7 0000000007
8 0000000008
9 0000000009
10 0000000010
-76710 NULL
-2760 NULL
-569300 NULL
-660 NULL
-250 NULL
-340 NULL
-3410 NULL
-2550 NULL
-3330 NULL
-441 NULL
-24 NULL
-323 NULL
-34 NULL
-100 NULL
15 NULL
+17 0000000016
+19 0000000014
22 NULL
-394 NULL
+24 NULL
+27 0000000026
+29 0000000024
+34 NULL
94 NULL
-195 NULL
-292 NULL
-987 NULL
-7876 NULL
-321 0000000765
-9112 0000008771
-500 0000000900
-500 0000000900
-500 0000000900
+100 NULL
+100 0000000004
107 0000000106
+107 0000000106
+109 0000000104
109 0000000104
+195 NULL
207 0000000206
209 0000000204
-27 0000000026
-29 0000000024
-17 0000000016
-19 0000000014
-107 0000000106
-109 0000000104
-299 NULL
242 NULL
+250 NULL
+292 NULL
+299 NULL
+321 0000000765
+323 NULL
+340 NULL
+394 NULL
424 NULL
+441 NULL
+500 0000000900
+500 0000000900
+500 0000000900
+660 NULL
+987 NULL
+2550 NULL
+2760 NULL
+3330 NULL
+3410 NULL
+7876 NULL
+9112 0000008771
+76710 NULL
+569300 NULL
drop view test.v1 ;
-CREATE VIEW test.v1 AS SELECT * FROM test.tb2 limit 20 ;
-SELECT * FROM test.v1;
+CREATE VIEW test.v1 AS SELECT * FROM test.tb2 order by f59, f60, f61 limit 20 ;
+SELECT * FROM test.v1 order by f59,f60,f61 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
1 1 0000000001 0000000000000000000000000000000000000000000000000000000000000001 0000000001 0000000000000000000000000000000000000000000000000000000000000001 -5 0.000000000000000000000000000000 1 0.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549435e-38 1.17549e-38 1.175494352e-38 01.17549e-38 00000001.175494352e-38 01.17549e-38 00000001.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 1970-01-02 00:00:01 1902 1902 1902 2enum 2set
2 2 0000000002 0000000000000000000000000000000000000000000000000000000000000002 0000000002 0000000000000000000000000000000000000000000000000000000000000002 -4 1.100000000000000000000000000000 2 1.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494349e-38 1.17549e-38 1.175494353e-38 01.17549e-38 00000001.175494353e-38 01.17549e-38 00000001.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 1970-01-03 00:00:02 1903 1903 1903 1enum 1set,2set
3 3 0000000003 0000000000000000000000000000000000000000000000000000000000000003 0000000003 0000000000000000000000000000000000000000000000000000000000000003 -3 2.200000000000000000000000000000 3 2.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494348e-38 1.17549e-38 1.175494354e-38 01.17549e-38 00000001.175494354e-38 01.17549e-38 00000001.175494354e-38 1000-01-03 838:59:56 1970-01-04 00:00:03 1970-01-04 00:00:03 1904 1904 1904 2enum 1set
-100 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
5 5 0000000005 0000000000000000000000000000000000000000000000000000000000000005 0000000005 0000000000000000000000000000000000000000000000000000000000000005 -1 4.400000000000000000000000000000 5 4.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494346e-38 1.17549e-38 1.175494356e-38 01.17549e-38 00000001.175494356e-38 01.17549e-38 00000001.175494356e-38 1000-01-05 838:59:54 1970-01-06 00:00:05 1970-01-06 00:00:05 1906 1906 1906 2enum 1set,2set
6 6 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0 5.500000000000000000000000000000 6 5.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494345e-38 1.17549e-38 1.175494357e-38 01.17549e-38 00000001.175494357e-38 01.17549e-38 00000001.175494357e-38 1000-01-06 838:59:53 1970-01-07 00:00:06 1970-01-07 00:00:06 1907 1907 1907 1enum 1set
7 7 0000000007 0000000000000000000000000000000000000000000000000000000000000007 0000000007 0000000000000000000000000000000000000000000000000000000000000007 1 6.600000000000000000000000000000 7 6.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494344e-38 1.17549e-38 1.175494358e-38 01.17549e-38 00000001.175494358e-38 01.17549e-38 00000001.175494358e-38 1000-01-07 838:59:52 1970-01-08 00:00:07 1970-01-08 00:00:07 1908 1908 1908 2enum 2set
8 8 0000000008 0000000000000000000000000000000000000000000000000000000000000008 0000000008 0000000000000000000000000000000000000000000000000000000000000008 2 7.700000000000000000000000000000 8 7.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494343e-38 1.17549e-38 1.175494359e-38 01.17549e-38 00000001.175494359e-38 01.17549e-38 00000001.175494359e-38 1000-01-08 838:59:51 1970-01-09 00:00:08 1970-01-09 00:00:08 1909 1909 1909 1enum 1set,2set
9 9 0000000009 0000000000000000000000000000000000000000000000000000000000000009 0000000009 0000000000000000000000000000000000000000000000000000000000000009 3 8.800000000000000000000000000000 9 8.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494342e-38 1.17549e-38 1.17549436e-38 01.17549e-38 000000001.17549436e-38 01.17549e-38 000000001.17549436e-38 1000-01-09 838:59:50 1970-01-10 00:00:09 1970-01-10 00:00:09 1910 1910 1910 2enum 1set
10 10 0000000010 0000000000000000000000000000000000000000000000000000000000000010 0000000010 0000000000000000000000000000000000000000000000000000000000000010 4 9.900000000000000000000000000000 10 9.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494341e-38 1.17549e-38 1.175494361e-38 01.17549e-38 00000001.175494361e-38 01.17549e-38 00000001.175494361e-38 1000-01-10 838:59:49 1970-01-11 00:00:10 1970-01-11 00:00:10 1911 1911 1911 1enum 2set
-76710 226546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-2760 985654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-569300 9114376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-660 876546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-250 87895654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-340 9984376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-3410 996546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-2550 775654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-3330 764376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-441 16546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+15 87 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+17 15 0000000016 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+19 18 0000000014 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+22 93 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+24 51654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+27 25 0000000026 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+29 28 0000000024 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+34 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+94 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+100 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
+100 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
drop view test.v1 ;
CREATE VIEW test.v1 AS SELECT F59,f61 FROM test.tb2 limit 20 ;
-SELECT * FROM test.v1 limit 50;
+SELECT * FROM test.v1 order by f59,f61 desc limit 50;
F59 f61
1 0000000001
2 0000000002
3 0000000003
-100 0000000004
5 0000000005
6 0000000006
7 0000000007
8 0000000008
9 0000000009
10 0000000010
-76710 NULL
-2760 NULL
-569300 NULL
-660 NULL
+100 0000000004
250 NULL
340 NULL
-3410 NULL
+441 NULL
+660 NULL
2550 NULL
+2760 NULL
3330 NULL
-441 NULL
+3410 NULL
+76710 NULL
+569300 NULL
drop view test.v1 ;
Testcase 3.3.1.54
@@ -9803,7 +9803,7 @@ Insert into t2 values (2,2000) ;
Insert into t2 values (31,97) ;
Create view test.v1 as select t1.f59, t1.f60
from t1,t2 where t1.f59=t2.f59 ;
-Select * from test.v1 limit 50 ;
+Select * from test.v1 order by f59 limit 50 ;
f59 f60
1 10
2 20
@@ -9869,7 +9869,7 @@ create or replace view test.v1 as
Select t1.f59 t1_f59, t2.f59 t2_f59, t1.f60 t1_f60, t2.f60 t2_f60,
t1.f61 t1_f61, t2.f61 t2_f61
from t1 inner join t2 where t1.f59 = t2.f59 ;
-select * from test.v1;
+select * from test.v1 order by t1_f59 ;
t1_f59 t2_f59 t1_f60 t2_f60 t1_f61 t2_f61
2 2 double double 6 6
3 3 single-f3 single-f3 4 6
@@ -9882,7 +9882,7 @@ t1_f59 t2_f59 t1_f60 t2_f60 t1_f61 t2_f61
Create or replace view test.v1 as
Select t1.f59 AS t1_f59, t2.f59 AS t2_f59
FROM t2 cross join t1;
-Select * from v1;
+Select * from v1 order by t1_f59,t2_f59;
t1_f59 t2_f59
1 2
1 3
@@ -9908,7 +9908,7 @@ t1_f59 t2_f59
Create or replace view test.v1 as
Select straight_join t1.f59 AS t1_f59, t2.f59 AS t2_f59
FROM t2,t1;
-Select * from v1;
+Select * from v1 order by t1_f59,t2_f59;
t1_f59 t2_f59
1 2
1 3
@@ -9934,7 +9934,7 @@ t1_f59 t2_f59
Create or replace view test.v1 as
Select f59, f60, f61, a, b
FROM t2 natural join t1;
-Select * from v1;
+Select * from v1 order by f59;
f59 f60 f61 a b
2 double 6 2 2
Select f59, f60, f61, a, b
@@ -9945,11 +9945,11 @@ Create or replace view test.v1 as
Select t1.f59 t1_f59, t2.f59 t2_f59, t1.f60 t1_f60, t2.f60 t2_f60,
t1.f61 t1_f61, t2.f61 t2_f61
FROM t2 left outer join t1 on t2.f59=t1.f59;
-Select * from v1;
+Select * from v1 order by t1_f59;
t1_f59 t2_f59 t1_f60 t2_f60 t1_f61 t2_f61
+NULL 4 NULL single NULL 4
2 2 double double 6 6
3 3 single-f3 single-f3 4 6
-NULL 4 NULL single NULL 4
Select t1.f59 t1_f59, t2.f59 t2_f59, t1.f60 t1_f60, t2.f60 t2_f60,
t1.f61 t1_f61, t2.f61 t2_f61
FROM t2 left outer join t1 on t2.f59=t1.f59;
@@ -9960,7 +9960,7 @@ NULL 4 NULL single NULL 4
Create or replace view test.v1 as
Select f59, f60, f61, t1.a, t2.b
FROM t2 natural left outer join t1;
-Select * from v1;
+Select * from v1 order by f59;
f59 f60 f61 a b
2 double 6 2 2
3 single-f3 6 NULL 3
@@ -9975,7 +9975,7 @@ Create or replace view test.v1 as
Select t1.f59 t1_f59, t2.f59 t2_f59, t1.f60 t1_f60, t2.f60 t2_f60,
t1.f61 t1_f61, t2.f61 t2_f61
FROM t2 right outer join t1 on t2.f59=t1.f59;
-Select * from v1;
+Select * from v1 order by t1_f59;
t1_f59 t2_f59 t1_f60 t2_f60 t1_f61 t2_f61
1 NULL single NULL 3 NULL
2 2 double double 6 6
@@ -9990,11 +9990,11 @@ t1_f59 t2_f59 t1_f60 t2_f60 t1_f61 t2_f61
Create or replace view test.v1 as
Select f59, f60, a, b
FROM t2 natural right outer join t1;
-Select * from v1;
+Select * from v1 order by f59 desc;
f59 f60 a b
-1 single 1 NULL
-2 double 2 2
3 single-f3 3 NULL
+2 double 2 2
+1 single 1 NULL
Select f59, f60, a, b
FROM t2 natural right outer join t1;
f59 f60 a b
@@ -10015,18 +10015,18 @@ Insert into t1 values (107,501,601) ;
Insert into t1 values (901,801,401) ;
Create or replace view test.v1 as
Select tb2.f59 FROM tb2 LEFT JOIN t1 on tb2.f59 = t1.f59 ;
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
f59
1
2
3
-100
5
6
7
8
9
10
+15
Drop view if exists test.v1 ;
Drop table if exists t1 ;
Drop view if exists v1;
@@ -10036,7 +10036,7 @@ Insert into t1 values (207,201,201) ;
Insert into t1 values (201,201,201) ;
Create or replace view test.v1
as Select tb2.f59 FROM tb2 INNER JOIN t1 on tb2.f59 = t1.f59 ;
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
f59
207
Drop view if exists test.v1 ;
@@ -10048,7 +10048,7 @@ Insert into t1 values (27,21,21) ;
Insert into t1 values (21,21,21) ;
Create or replace view test.v1
as Select tb2.f59 FROM tb2 CROSS JOIN t1 on tb2.f59 = t1.f59 ;
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
f59
27
Drop view test.v1 ;
@@ -10063,18 +10063,18 @@ Insert into t1 values (17,51,61) ;
Insert into t1 values (91,81,41) ;
Create or replace view test.v1 as (Select f59 FROM tb2 where f59=17 )
Union ALL (Select f59 from t1 where f59=17 );
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
f59
17
17
Create or replace view test.v1 as (Select f59 FROM tb2 where f59=17 )
Union (Select f59 from t1 where f59=17 );
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
f59
17
Create or replace view test.v1 as (Select f59 FROM tb2 where f59=17 )
Union Distinct (Select f59 from t1 where f60=17 );
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
f59
17
Drop view test.v1 ;
@@ -10086,7 +10086,7 @@ insert into t1 values (107,501,601);
insert into t1 values (901,801,401);
create or replace view test.v1 as
select tb2.f59 from tb2 join t1 on tb2.f59 = t1.f59;
-select * from test.v1 limit 0,10;
+select * from test.v1 order by f59 limit 0,10;
f59
107
107
@@ -10094,7 +10094,7 @@ create or replace view test.v1 as
(select f59 from tb2 where f59=107 )
union all
(select f59 from t1 where f59=107 );
-select * from test.v1 limit 0,10;
+select * from test.v1 order by f59 limit 0,10;
f59
107
107
@@ -10103,14 +10103,14 @@ create or replace view test.v1 as
(select f59 from tb2 where f59=107 )
union
(select f59 from t1 where f59=107 );
-select * from test.v1 limit 0,10;
+select * from test.v1 order by f59 limit 0,10;
f59
107
create or replace view test.v1 as
(select f59 from tb2 where f59=107 )
union distinct
(select f59 from t1 where f59=107 );
-select * from test.v1 limit 0,10;
+select * from test.v1 order by f59 limit 0,10;
f59
107
drop view if exists test.v1 ;
@@ -10121,13 +10121,13 @@ Testcase 3.3.1.64
Drop view if exists test.v1 ;
CREATE VIEW test.v1 AS SELECT F59
FROM test.tb2 where test.tb2.F59 = 109;
-SELECT * FROM test.v1 limit 0,10;
+SELECT * FROM test.v1 order by f59 limit 0,10;
F59
109
109
ALTER VIEW test.v1 AS SELECT *
FROM test.tb2 WHERE test.tb2.f59 = 242 ;
-SELECT * FROM test.v1 limit 0,10;
+SELECT * FROM test.v1 order by f59 limit 0,10;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
242 79 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
Drop view test.v1 ;
@@ -10207,7 +10207,8 @@ SHOW FIELDS FROM v1;
ERROR 42S02: Table 'test.v1' doesn't exist
CHECK TABLE v1;
Table Op Msg_type Msg_text
-test.v1 check error Table 'test.v1' doesn't exist
+test.v1 check Error Table 'test.v1' doesn't exist
+test.v1 check error Corrupt
DESCRIBE v1;
ERROR 42S02: Table 'test.v1' doesn't exist
EXPLAIN SELECT * FROM v1;
@@ -10254,8 +10255,8 @@ CREATE VIEW test3.v30 AS SELECT * FROM test3.v29;
CREATE VIEW test3.v31 AS SELECT * FROM test3.v30;
CREATE VIEW test3.v32 AS SELECT * FROM test3.v31;
SHOW CREATE VIEW test3.v32;
-View Create View
-v32 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test3`.`v32` AS select `v31`.`f1` AS `f1` from `test3`.`v31`
+View Create View character_set_client collation_connection
+v32 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test3`.`v32` AS select `v31`.`f1` AS `f1` from `test3`.`v31` latin1 latin1_swedish_ci
SELECT * FROM test3.v32;
f1
1.000
@@ -10264,8 +10265,8 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1
DROP VIEW test3.v0;
SHOW CREATE VIEW test3.v32;
-View Create View
-v32 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test3`.`v32` AS select `v31`.`f1` AS `f1` from `test3`.`v31`
+View Create View character_set_client collation_connection
+v32 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test3`.`v32` AS select `v31`.`f1` AS `f1` from `test3`.`v31` latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'test3.v32' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
SELECT * FROM test3.v32;
@@ -10273,15 +10274,13 @@ ERROR HY000: View 'test3.v32' references invalid table(s) or column(s) or functi
EXPLAIN SELECT * FROM test3.v32;
ERROR HY000: View 'test3.v32' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
-FIXME - Setting join_limit to 30 - hangs for higher values
+FIXME - Setting join_limit to 28 - hangs for higher values
----------------------------------------------------------
-SET @join_limit = 30;
+SET @join_limit = 28;
SET @max_level = @join_limit - 1;
DROP DATABASE IF EXISTS test3;
DROP TABLE IF EXISTS test1.t1;
DROP TABLE IF EXISTS test2.t1;
-DROP VIEW IF EXISTS test1.v29;
-DROP VIEW IF EXISTS test1.v28;
DROP VIEW IF EXISTS test1.v27;
DROP VIEW IF EXISTS test1.v26;
DROP VIEW IF EXISTS test1.v25;
@@ -10388,15 +10387,11 @@ CREATE OR REPLACE VIEW test1.v26 AS SELECT f1, f2
FROM test3.t1 tab1 NATURAL JOIN test1.v25 tab2;
CREATE OR REPLACE VIEW test1.v27 AS SELECT f1, f2
FROM test1.t1 tab1 NATURAL JOIN test1.v26 tab2;
-CREATE OR REPLACE VIEW test1.v28 AS SELECT f1, f2
-FROM test2.t1 tab1 NATURAL JOIN test1.v27 tab2;
-CREATE OR REPLACE VIEW test1.v29 AS SELECT f1, f2
-FROM test3.t1 tab1 NATURAL JOIN test1.v28 tab2;
-SHOW CREATE VIEW test1.v29;
-View Create View
-v29 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v29` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v28` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`))))
+SHOW CREATE VIEW test1.v27;
+View Create View character_set_client collation_connection
+v27 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v27` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test1`.`t1` `tab1` join `test1`.`v26` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`)))) latin1 latin1_swedish_ci
SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v29;
+CAST(f2 AS CHAR) AS f2 FROM test1.v27;
f1 f2
5 five
@@ -10405,14 +10400,14 @@ differs on some platforms
FIXME Is this a bug ?
--------------------------------------------------------------------------------
EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v29;
-CREATE VIEW test1.v30 AS SELECT f1, f2
-FROM test3.t1 tab1 NATURAL JOIN test1.v29 tab2;
-SHOW CREATE VIEW test1.v30;
-View Create View
-v30 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v30` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v29` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`))))
+CAST(f2 AS CHAR) AS f2 FROM test1.v27;
+CREATE VIEW test1.v28 AS SELECT f1, f2
+FROM test3.t1 tab1 NATURAL JOIN test1.v27 tab2;
+SHOW CREATE VIEW test1.v28;
+View Create View character_set_client collation_connection
+v28 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v28` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v27` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`)))) latin1 latin1_swedish_ci
SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v30;
+CAST(f2 AS CHAR) AS f2 FROM test1.v28;
f1 f2
5 five
@@ -10421,33 +10416,31 @@ differs on some platforms
FIXME Is this a bug ?
--------------------------------------------------------------------------------
EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v30;
-DROP VIEW IF EXISTS test1.v30;
+CAST(f2 AS CHAR) AS f2 FROM test1.v28;
+DROP VIEW IF EXISTS test1.v28;
CREATE OR REPLACE VIEW test1.v0 AS
SELECT f1 as f2, f2 as f1 FROM test2.t1;
CREATE OR REPLACE VIEW test2.v0 AS
SELECT CAST('0001-01-01' AS DATE) as f1, f2 FROM test3.t1;
-SHOW CREATE VIEW test1.v29;
+SHOW CREATE VIEW test1.v27;
SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v29;
+CAST(f2 AS CHAR) AS f2 FROM test1.v27;
EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v29;
+CAST(f2 AS CHAR) AS f2 FROM test1.v27;
CREATE OR REPLACE VIEW test3.v0 AS
SELECT f1 , CONVERT('ßÄäÖöÜü§' USING UCS2) as f2 FROM test1.t1;
-SHOW CREATE VIEW test1.v29;
+SHOW CREATE VIEW test1.v27;
SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v29;
+CAST(f2 AS CHAR) AS f2 FROM test1.v27;
EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v29;
+CAST(f2 AS CHAR) AS f2 FROM test1.v27;
CREATE OR REPLACE VIEW test3.v0 AS
SELECT CONVERT('ßÄäÖöÜü§' USING UCS2) as f1, f2 FROM test1.t1;
-SHOW CREATE VIEW test1.v29;
+SHOW CREATE VIEW test1.v27;
SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v29;
+CAST(f2 AS CHAR) AS f2 FROM test1.v27;
EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v29;
-DROP VIEW IF EXISTS test1.v29;
-DROP VIEW IF EXISTS test1.v28;
+CAST(f2 AS CHAR) AS f2 FROM test1.v27;
DROP VIEW IF EXISTS test1.v27;
DROP VIEW IF EXISTS test1.v26;
DROP VIEW IF EXISTS test1.v25;
@@ -10518,7 +10511,7 @@ info: Rows matched: 1 Changed: 1 Warnings: 0
SELECT * FROM tb2 where f59 = 8 and f60 = 105;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
8 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-SELECT f59,f60 FROM test.v1 where f59 = 8 and f60 = 105;
+SELECT f59,f60 FROM test.v1 where f59 = 8 and f60 = 105 ;
f59 f60
8 105
Drop view test.v1 ;
@@ -10537,7 +10530,7 @@ f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78
891 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
891 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
891 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-SELECT f59,f60 FROM test.v1 where f59 = 891 and f60 = 105;
+SELECT f59,f60 FROM test.v1 where f59 = 891 and f60 = 105 ;
f59 f60
891 105
891 105
@@ -10554,7 +10547,7 @@ DELETE FROM test.v1 where f59 = 789 ;
affected rows: 1
SELECT * FROM tb2 where f59 = 789 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
-SELECT f59,f60 FROM test.v1 where f59 = 789;
+SELECT f59,f60 FROM test.v1 where f59 = 789 order by f60 ;
f59 f60
Drop view test.v1 ;
@@ -10567,7 +10560,7 @@ DELETE FROM test.v1 where f59 = 711 ;
affected rows: 1
SELECT * FROM tb2 where f59 = 711 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
-SELECT f59,f60 FROM test.v1 where f59 = 711;
+SELECT f59,f60 FROM test.v1 where f59 = 711 order by f60 ;
f59 f60
Drop view test.v1 ;
diff --git a/mysql-test/suite/funcs_1/r/myisam__datadict.result b/mysql-test/suite/funcs_1/r/myisam__datadict.result
index 36662ad9259..d4571c5d718 100644
--- a/mysql-test/suite/funcs_1/r/myisam__datadict.result
+++ b/mysql-test/suite/funcs_1/r/myisam__datadict.result
@@ -688,9 +688,9 @@ TABLE_CATALOG NULL
TABLE_SCHEMA information_schema
TABLE_NAME GLOBAL_VARIABLES
TABLE_TYPE SYSTEM VIEW
-ENGINE MyISAM
+ENGINE MEMORY
VERSION 10
-ROW_FORMAT Dynamic
+ROW_FORMAT Fixed
TABLE_ROWS NULL
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
@@ -898,9 +898,9 @@ TABLE_CATALOG NULL
TABLE_SCHEMA information_schema
TABLE_NAME SESSION_VARIABLES
TABLE_TYPE SYSTEM VIEW
-ENGINE MyISAM
+ENGINE MEMORY
VERSION 10
-ROW_FORMAT Dynamic
+ROW_FORMAT Fixed
TABLE_ROWS NULL
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
@@ -1218,7 +1218,7 @@ TABLE_TYPE BASE TABLE
ENGINE CSV
VERSION 10
ROW_FORMAT Dynamic
-TABLE_ROWS 2
+TABLE_ROWS 1
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -1239,7 +1239,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Fixed
-TABLE_ROWS 0
+TABLE_ROWS 37
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -1260,7 +1260,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Fixed
-TABLE_ROWS 0
+TABLE_ROWS 424
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -1281,7 +1281,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Fixed
-TABLE_ROWS 0
+TABLE_ROWS 901
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -1302,7 +1302,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Dynamic
-TABLE_ROWS 0
+TABLE_ROWS 479
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -1985,8 +1985,8 @@ NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
-NULL db_datadict latin1 SYSTEM VIEW MyISAM
-NULL db_datadict latin1 SYSTEM VIEW MyISAM
+NULL db_datadict latin1 SYSTEM VIEW MEMORY
+NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MyISAM
NULL db_datadict latin1 SYSTEM VIEW MyISAM
NULL db_datadict latin1 SYSTEM VIEW MyISAM
@@ -2053,8 +2053,8 @@ NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
-NULL information_schema utf8 SYSTEM VIEW MyISAM
-NULL information_schema utf8 SYSTEM VIEW MyISAM
+NULL information_schema utf8 SYSTEM VIEW MEMORY
+NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MyISAM
NULL information_schema utf8 SYSTEM VIEW MyISAM
NULL information_schema utf8 SYSTEM VIEW MyISAM
@@ -2121,8 +2121,8 @@ NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
-NULL mysql latin1 SYSTEM VIEW MyISAM
-NULL mysql latin1 SYSTEM VIEW MyISAM
+NULL mysql latin1 SYSTEM VIEW MEMORY
+NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MyISAM
NULL mysql latin1 SYSTEM VIEW MyISAM
NULL mysql latin1 SYSTEM VIEW MyISAM
@@ -2189,8 +2189,8 @@ NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
-NULL test latin1 SYSTEM VIEW MyISAM
-NULL test latin1 SYSTEM VIEW MyISAM
+NULL test latin1 SYSTEM VIEW MEMORY
+NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MyISAM
NULL test latin1 SYSTEM VIEW MyISAM
NULL test latin1 SYSTEM VIEW MyISAM
@@ -2257,8 +2257,8 @@ NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
-NULL test1 latin1 SYSTEM VIEW MyISAM
-NULL test1 latin1 SYSTEM VIEW MyISAM
+NULL test1 latin1 SYSTEM VIEW MEMORY
+NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MyISAM
NULL test1 latin1 SYSTEM VIEW MyISAM
NULL test1 latin1 SYSTEM VIEW MyISAM
@@ -2325,8 +2325,8 @@ NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
-NULL test4 latin1 SYSTEM VIEW MyISAM
-NULL test4 latin1 SYSTEM VIEW MyISAM
+NULL test4 latin1 SYSTEM VIEW MEMORY
+NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MyISAM
NULL test4 latin1 SYSTEM VIEW MyISAM
NULL test4 latin1 SYSTEM VIEW MyISAM
@@ -2405,6 +2405,9 @@ NULL information_schema EVENTS LAST_ALTERED 18 0000-00-00 00:00:00 NO datetime N
NULL information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime 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 ORIGINATOR 21 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10) 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 DATABASE_COLLATION 24 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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
@@ -2444,9 +2447,9 @@ NULL information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 19 0 NULL NU
NULL information_schema FILES STATUS 37 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema FILES EXTRA 38 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -2533,6 +2536,9 @@ NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime
NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 DATABASE_COLLATION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -2544,9 +2550,9 @@ NULL information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL
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 IS_GRANTABLE 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema STATISTICS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -2614,6 +2620,9 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NUL
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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 TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -2626,6 +2635,8 @@ NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+NULL information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL db_datadict v1 TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select,insert,update,references
NULL db_datadict v1 TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
NULL db_datadict v1 TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
@@ -2698,6 +2709,10 @@ NULL mysql event sql_mode 15 NO set 431 1293 NULL NULL utf8 utf8_general_ci set
NULL mysql event comment 16 NO char 64 192 NULL NULL utf8 utf8_bin char(64) select,insert,update,references
NULL mysql event originator 17 NULL NO int NULL NULL 10 0 NULL NULL int(10) 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 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 db_collation 21 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) 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 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 dl 3 NO char 128 384 NULL NULL utf8 utf8_bin char(128) select,insert,update,references
@@ -2767,6 +2782,10 @@ NULL mysql proc created 13 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NU
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 sql_mode 15 NO set 431 1293 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') 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 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 db_collation 19 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) 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 procs_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) 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 User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
@@ -3254,10 +3273,10 @@ select @x, @y;
@x @y
big5_chinese_ci big5
select * from 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
+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_1 NULL db_datadict sp_1 PROCEDURE NULL SQL BEGIN
SELECT * FROM db_datadict.v1;
-END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost
+END 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
select count(*) from routines;
count(*)
1
@@ -3275,14 +3294,14 @@ NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE
NULL mysql event 0 mysql PRIMARY 1 db A NULL NULL NULL BTREE
NULL mysql event 0 mysql PRIMARY 2 name A 0 NULL NULL BTREE
NULL mysql func 0 mysql PRIMARY 1 name A 0 NULL NULL BTREE
-NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 0 NULL NULL BTREE
-NULL mysql help_category 0 mysql name 1 name A 0 NULL NULL BTREE
-NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A 0 NULL NULL BTREE
-NULL mysql help_keyword 0 mysql name 1 name A 0 NULL NULL BTREE
+NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 37 NULL NULL BTREE
+NULL mysql help_category 0 mysql name 1 name A 37 NULL NULL BTREE
+NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A 424 NULL NULL BTREE
+NULL mysql help_keyword 0 mysql name 1 name A 424 NULL NULL BTREE
NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A NULL NULL NULL BTREE
-NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A 0 NULL NULL BTREE
-NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A 0 NULL NULL BTREE
-NULL mysql help_topic 0 mysql name 1 name A 0 NULL NULL BTREE
+NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A 901 NULL NULL BTREE
+NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A 479 NULL NULL BTREE
+NULL mysql help_topic 0 mysql name 1 name A 479 NULL NULL BTREE
NULL mysql host 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
NULL mysql host 0 mysql PRIMARY 2 Db A 0 NULL NULL BTREE
NULL mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A 0 NULL NULL BTREE
@@ -3312,10 +3331,10 @@ NULL mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A 31 N
NULL mysql user 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
NULL mysql user 0 mysql PRIMARY 2 User A 3 NULL NULL BTREE
select * from views;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
-NULL db_datadict v1 /* ALGORITHM=UNDEFINED */ 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` NONE NO root@localhost DEFINER
-NULL db_datadict vu /* ALGORITHM=UNDEFINED */ select distinct `vu1`.`u` AS `u`,substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3)) AS `server`,substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3),(length(substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3))) - 1)) AS `Server_Clean` from `db_datadict`.`vu1` NONE NO root@localhost DEFINER
-NULL db_datadict vu1 /* ALGORITHM=UNDEFINED */ select `user_privileges`.`GRANTEE` AS `u` from `information_schema`.`user_privileges` NONE NO root@localhost DEFINER
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
+NULL db_datadict v1 SELECT * FROM information_schema.tables NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+NULL db_datadict vu SELECT DISTINCT u, NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+NULL db_datadict vu1 SELECT grantee AS u NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
select * from user_privileges order by grantee, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'127.0.0.1' NULL ALTER YES
@@ -3515,7 +3534,7 @@ max_recs
45
select max(cardinality) from statistics;
max(cardinality)
-393
+901
select concat("View '",
table_name, "' is associated with the database '", table_schema, "'.")
AS "Who is Who for the Views"
@@ -3640,8 +3659,8 @@ columns_priv 7
COLUMN_PRIVILEGES 7
db 22
ENGINES 6
-event 18
-EVENTS 21
+event 22
+EVENTS 24
FILES 38
func 4
general_log 6
@@ -3657,11 +3676,11 @@ ndb_binlog_index 7
PARTITIONS 25
plugin 2
PLUGINS 10
-proc 16
+proc 20
PROCESSLIST 8
procs_priv 8
REFERENTIAL_CONSTRAINTS 11
-ROUTINES 20
+ROUTINES 23
SCHEMATA 5
SCHEMA_PRIVILEGES 5
servers 9
@@ -3692,11 +3711,11 @@ time_zone_leap_second 2
time_zone_name 2
time_zone_transition 3
time_zone_transition_type 5
-TRIGGERS 19
+TRIGGERS 22
user 39
USER_PRIVILEGES 4
v1 21
-VIEWS 8
+VIEWS 10
vu 3
vu1 1
@@ -3721,16 +3740,16 @@ SELECT * FROM collation_character_set_applicability LIMIT 1;
COLLATION_NAME CHARACTER_SET_NAME
big5_chinese_ci big5
SELECT * FROM routines LIMIT 1;
-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
+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_1 NULL db_datadict sp_1 PROCEDURE NULL SQL BEGIN
SELECT * FROM db_datadict.v1;
-END NULL NULL SQL NO CONTAINS SQL NULL DEFINER <Created> <Last_Altered> root@localhost
+END NULL NULL SQL NO CONTAINS SQL NULL DEFINER <Created> <Last_Altered> root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
SELECT * FROM statistics LIMIT 1;
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 NULL NULL NULL BTREE
SELECT * FROM views LIMIT 1;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
-NULL db_datadict v1 /* ALGORITHM=UNDEFINED */ 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` NONE NO root@localhost DEFINER
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
+NULL db_datadict v1 SELECT * FROM information_schema.tables NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
SELECT * FROM user_privileges LIMIT 1;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'localhost' NULL SELECT YES
@@ -3748,7 +3767,7 @@ SELECT * FROM key_column_usage LIMIT 1;
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 mysql PRIMARY NULL mysql columns_priv Host 1 NULL NULL NULL NULL
SELECT * FROM triggers LIMIT 1;
-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
+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
SELECT * FROM parameters LIMIT 1;
ERROR 42S02: Unknown table 'parameters' in information_schema
SELECT * FROM referential_constraints LIMIT 1;
@@ -4030,9 +4049,9 @@ TABLE_CATALOG NULL
TABLE_SCHEMA information_schema
TABLE_NAME GLOBAL_VARIABLES
TABLE_TYPE SYSTEM VIEW
-ENGINE MyISAM
+ENGINE MEMORY
VERSION 10
-ROW_FORMAT Dynamic
+ROW_FORMAT Fixed
TABLE_ROWS NULL
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
@@ -4240,9 +4259,9 @@ TABLE_CATALOG NULL
TABLE_SCHEMA information_schema
TABLE_NAME SESSION_VARIABLES
TABLE_TYPE SYSTEM VIEW
-ENGINE MyISAM
+ENGINE MEMORY
VERSION 10
-ROW_FORMAT Dynamic
+ROW_FORMAT Fixed
TABLE_ROWS NULL
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
@@ -4560,7 +4579,7 @@ TABLE_TYPE BASE TABLE
ENGINE CSV
VERSION 10
ROW_FORMAT Dynamic
-TABLE_ROWS 2
+TABLE_ROWS 1
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -4581,7 +4600,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Fixed
-TABLE_ROWS 0
+TABLE_ROWS 37
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -4602,7 +4621,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Fixed
-TABLE_ROWS 0
+TABLE_ROWS 424
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -4623,7 +4642,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Fixed
-TABLE_ROWS 0
+TABLE_ROWS 901
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -4644,7 +4663,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Dynamic
-TABLE_ROWS 0
+TABLE_ROWS 479
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -5327,8 +5346,8 @@ NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
-NULL db_datadict latin1 SYSTEM VIEW MyISAM
-NULL db_datadict latin1 SYSTEM VIEW MyISAM
+NULL db_datadict latin1 SYSTEM VIEW MEMORY
+NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MyISAM
NULL db_datadict latin1 SYSTEM VIEW MyISAM
NULL db_datadict latin1 SYSTEM VIEW MyISAM
@@ -5395,8 +5414,8 @@ NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
-NULL information_schema utf8 SYSTEM VIEW MyISAM
-NULL information_schema utf8 SYSTEM VIEW MyISAM
+NULL information_schema utf8 SYSTEM VIEW MEMORY
+NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MyISAM
NULL information_schema utf8 SYSTEM VIEW MyISAM
NULL information_schema utf8 SYSTEM VIEW MyISAM
@@ -5463,8 +5482,8 @@ NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
-NULL mysql latin1 SYSTEM VIEW MyISAM
-NULL mysql latin1 SYSTEM VIEW MyISAM
+NULL mysql latin1 SYSTEM VIEW MEMORY
+NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MyISAM
NULL mysql latin1 SYSTEM VIEW MyISAM
NULL mysql latin1 SYSTEM VIEW MyISAM
@@ -5531,8 +5550,8 @@ NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
-NULL test latin1 SYSTEM VIEW MyISAM
-NULL test latin1 SYSTEM VIEW MyISAM
+NULL test latin1 SYSTEM VIEW MEMORY
+NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MyISAM
NULL test latin1 SYSTEM VIEW MyISAM
NULL test latin1 SYSTEM VIEW MyISAM
@@ -5599,8 +5618,8 @@ NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
-NULL test1 latin1 SYSTEM VIEW MyISAM
-NULL test1 latin1 SYSTEM VIEW MyISAM
+NULL test1 latin1 SYSTEM VIEW MEMORY
+NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MyISAM
NULL test1 latin1 SYSTEM VIEW MyISAM
NULL test1 latin1 SYSTEM VIEW MyISAM
@@ -5667,8 +5686,8 @@ NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
-NULL test4 latin1 SYSTEM VIEW MyISAM
-NULL test4 latin1 SYSTEM VIEW MyISAM
+NULL test4 latin1 SYSTEM VIEW MEMORY
+NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MyISAM
NULL test4 latin1 SYSTEM VIEW MyISAM
NULL test4 latin1 SYSTEM VIEW MyISAM
@@ -5709,10 +5728,10 @@ dec8_swedish_ci dec8
dec8_bin dec8
cp850_general_ci cp850
select * from information_schema.routines limit 0, 5;
-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
+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_1 NULL db_datadict sp_1 PROCEDURE NULL SQL BEGIN
SELECT * FROM db_datadict.v1;
-END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost
+END 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
select * from information_schema.statistics limit 0, 5;
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 NULL NULL NULL BTREE
@@ -5721,10 +5740,10 @@ NULL mysql columns_priv 0 mysql PRIMARY 3 User A NULL NULL NULL BTREE
NULL mysql columns_priv 0 mysql PRIMARY 4 Table_name A NULL NULL NULL BTREE
NULL mysql columns_priv 0 mysql PRIMARY 5 Column_name A 0 NULL NULL BTREE
select * from information_schema.views limit 0, 5;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
-NULL db_datadict v1 /* ALGORITHM=UNDEFINED */ 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` NONE NO root@localhost DEFINER
-NULL db_datadict vu /* ALGORITHM=UNDEFINED */ select distinct `vu1`.`u` AS `u`,substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3)) AS `server`,substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3),(length(substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3))) - 1)) AS `Server_Clean` from `db_datadict`.`vu1` NONE NO root@localhost DEFINER
-NULL db_datadict vu1 /* ALGORITHM=UNDEFINED */ select `user_privileges`.`GRANTEE` AS `u` from `information_schema`.`user_privileges` NONE NO root@localhost DEFINER
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
+NULL db_datadict v1 SELECT * FROM information_schema.tables NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+NULL db_datadict vu SELECT DISTINCT u, NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+NULL db_datadict vu1 SELECT grantee AS u NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
select * from information_schema.user_privileges limit 0, 5;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'localhost' NULL SELECT YES
@@ -5771,7 +5790,7 @@ COUNT(*)
68
SELECT COUNT(*) FROM information_schema. columns ;
COUNT(*)
-867
+886
SELECT COUNT(*) FROM information_schema. character_sets ;
COUNT(*)
36
@@ -5836,7 +5855,7 @@ tot_tabs
65
select count(*) as the_cols from columns;
the_cols
-842
+861
select max(maxlen) as the_max from character_sets;
the_max
3
@@ -5860,7 +5879,7 @@ routine_definition
select * from statistics group by index_name asc limit 0, 5;
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 procs_priv 1 mysql Grantor 1 Grantor A NULL NULL NULL BTREE
-NULL mysql help_category 0 mysql name 1 name A 0 NULL NULL BTREE
+NULL mysql help_category 0 mysql name 1 name A 37 NULL NULL BTREE
NULL mysql columns_priv 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE
select concat(table_schema, ', ', table_name, ', ', view_definition) view_info
@@ -6108,6 +6127,7 @@ INTO OUTFILE '../tmp/out.myisam.db.file'
WHERE schema_name LIKE 'db_%';
CREATE USER user_3212@localhost;
GRANT ALL ON db_datadict.* TO user_3212@localhost;
+GRANT FILE ON *.* TO user_3212@localhost;
connect(localhost,user_3212,,db_datadict,MYSQL_PORT,MYSQL_SOCK);
user_3212@localhost db_datadict
@@ -6116,7 +6136,7 @@ INTO OUTFILE '../tmp/out.myisam.user.file'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM schemata LIMIT 0, 5;
-ERROR 28000: Access denied for user 'user_3212'@'localhost' (using password: NO)
+ERROR 42S02: Table 'db_datadict.schemata' doesn't exist
SELECT *
FROM schemata LIMIT 0, 5;
ERROR 42S02: Table 'db_datadict.schemata' doesn't exist
@@ -6349,19 +6369,19 @@ update information_schema.routines set routine_name = 'p2'
where routine_name = 'sp_4_1_4';
end//
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
+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_4_1_4 NULL db_datadict sp_4_1_4 PROCEDURE NULL SQL begin
update information_schema.routines set routine_name = 'p2'
where routine_name = 'sp_4_1_4';
-end NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost
+end 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
call db_datadict.sp_4_1_4();
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
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
+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_4_1_4 NULL db_datadict sp_4_1_4 PROCEDURE NULL SQL begin
update information_schema.routines set routine_name = 'p2'
where routine_name = 'sp_4_1_4';
-end NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost
+end 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
drop procedure db_datadict.sp_4_1_4;
use information_schema;
@@ -7630,7 +7650,7 @@ CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA
SELECT *
FROM information_schema.triggers
WHERE trigger_schema LIKE 'db_datadict%';
-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
+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
DROP DATABASE IF EXISTS db_datadict;
CREATE DATABASE db_datadict;
USE db_datadict;
@@ -7782,7 +7802,7 @@ CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA
SELECT *
FROM information_schema.triggers
WHERE trigger_schema LIKE 'db_datadict%';
-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
+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
use db_datadict;
drop index i_6_401013 on res_t_401013;
drop table db_datadict.res_t_401013;
@@ -7918,7 +7938,7 @@ CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA
SELECT *
FROM information_schema.triggers
WHERE trigger_schema LIKE 'db_datadict%';
-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
+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
Testcase 3.2.1.14:
--------------------------------------------------------------------------------
@@ -8067,7 +8087,7 @@ CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA
SELECT *
FROM information_schema.triggers
WHERE trigger_schema LIKE 'db_datadict%';
-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
+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
use db_datadict;
alter table res_t_401014 change f1 ff1 int;
alter table res_t_401014 engine = innodb;
@@ -8212,7 +8232,7 @@ CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA
SELECT *
FROM information_schema.triggers
WHERE trigger_schema LIKE 'db_datadict%';
-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
+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
use db_datadict;
drop table db_datadict.res_t_401014;
drop view db_datadict.res_v_401014;
@@ -8371,7 +8391,7 @@ CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA
SELECT *
FROM information_schema.triggers
WHERE trigger_schema LIKE 'db_datadict%';
-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
+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
use db_datadict;
drop index i_6_401015 on res_t_401015;
drop table db_datadict.res_t_401015;
@@ -8506,7 +8526,7 @@ CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA
SELECT *
FROM information_schema.triggers
WHERE trigger_schema LIKE 'db_datadict%';
-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
+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
Testcase 3.2.1.16:
--------------------------------------------------------------------------------
@@ -8535,7 +8555,7 @@ information_schema ENGINES MEMORY
information_schema EVENTS MyISAM
information_schema FILES MEMORY
information_schema GLOBAL_STATUS MEMORY
-information_schema GLOBAL_VARIABLES MyISAM
+information_schema GLOBAL_VARIABLES MEMORY
information_schema KEY_COLUMN_USAGE MEMORY
information_schema PARTITIONS MyISAM
information_schema PLUGINS MyISAM
@@ -8545,7 +8565,7 @@ information_schema ROUTINES MyISAM
information_schema SCHEMATA MEMORY
information_schema SCHEMA_PRIVILEGES MEMORY
information_schema SESSION_STATUS MEMORY
-information_schema SESSION_VARIABLES MyISAM
+information_schema SESSION_VARIABLES MEMORY
information_schema STATISTICS MEMORY
information_schema TABLES MEMORY
information_schema TABLE_CONSTRAINTS MEMORY
@@ -8901,6 +8921,9 @@ EVENTS LAST_ALTERED datetime
EVENTS LAST_EXECUTED datetime
EVENTS EVENT_COMMENT varchar(64)
EVENTS ORIGINATOR bigint(10)
+EVENTS CHARACTER_SET_CLIENT varchar(32)
+EVENTS COLLATION_CONNECTION varchar(32)
+EVENTS DATABASE_COLLATION varchar(32)
FILES FILE_ID bigint(4)
FILES FILE_NAME varchar(64)
FILES FILE_TYPE varchar(20)
@@ -8940,9 +8963,9 @@ FILES CHECKSUM bigint(21) unsigned
FILES STATUS varchar(20)
FILES EXTRA varchar(255)
GLOBAL_STATUS VARIABLE_NAME varchar(64)
-GLOBAL_STATUS VARIABLE_VALUE decimal(22,7)
+GLOBAL_STATUS VARIABLE_VALUE varchar(20480)
GLOBAL_VARIABLES VARIABLE_NAME varchar(64)
-GLOBAL_VARIABLES VARIABLE_VALUE longtext
+GLOBAL_VARIABLES VARIABLE_VALUE varchar(20480)
KEY_COLUMN_USAGE CONSTRAINT_CATALOG varchar(4096)
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA varchar(64)
KEY_COLUMN_USAGE CONSTRAINT_NAME varchar(64)
@@ -9029,6 +9052,9 @@ ROUTINES LAST_ALTERED datetime
ROUTINES SQL_MODE longtext
ROUTINES ROUTINE_COMMENT varchar(64)
ROUTINES DEFINER varchar(77)
+ROUTINES CHARACTER_SET_CLIENT varchar(32)
+ROUTINES COLLATION_CONNECTION varchar(32)
+ROUTINES DATABASE_COLLATION varchar(32)
SCHEMATA CATALOG_NAME varchar(4096)
SCHEMATA SCHEMA_NAME varchar(64)
SCHEMATA DEFAULT_CHARACTER_SET_NAME varchar(64)
@@ -9040,9 +9066,9 @@ SCHEMA_PRIVILEGES TABLE_SCHEMA varchar(64)
SCHEMA_PRIVILEGES PRIVILEGE_TYPE varchar(64)
SCHEMA_PRIVILEGES IS_GRANTABLE varchar(3)
SESSION_STATUS VARIABLE_NAME varchar(64)
-SESSION_STATUS VARIABLE_VALUE decimal(22,7)
+SESSION_STATUS VARIABLE_VALUE varchar(20480)
SESSION_VARIABLES VARIABLE_NAME varchar(64)
-SESSION_VARIABLES VARIABLE_VALUE longtext
+SESSION_VARIABLES VARIABLE_VALUE varchar(20480)
STATISTICS TABLE_CATALOG varchar(4096)
STATISTICS TABLE_SCHEMA varchar(64)
STATISTICS TABLE_NAME varchar(64)
@@ -9110,6 +9136,9 @@ TRIGGERS ACTION_REFERENCE_NEW_ROW varchar(3)
TRIGGERS CREATED datetime
TRIGGERS SQL_MODE longtext
TRIGGERS DEFINER longtext
+TRIGGERS CHARACTER_SET_CLIENT varchar(32)
+TRIGGERS COLLATION_CONNECTION varchar(32)
+TRIGGERS DATABASE_COLLATION varchar(32)
USER_PRIVILEGES GRANTEE varchar(81)
USER_PRIVILEGES TABLE_CATALOG varchar(4096)
USER_PRIVILEGES PRIVILEGE_TYPE varchar(64)
@@ -9122,6 +9151,8 @@ VIEWS CHECK_OPTION varchar(8)
VIEWS IS_UPDATABLE varchar(3)
VIEWS DEFINER varchar(77)
VIEWS SECURITY_TYPE varchar(7)
+VIEWS CHARACTER_SET_CLIENT varchar(32)
+VIEWS COLLATION_CONNECTION varchar(32)
t1 f1 char(20)
t1 f2 char(25)
t1 f3 date
@@ -9719,10 +9750,10 @@ WHERE table_schema = 'information_schema'
AND table_name = 'character_sets'
ORDER BY 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 information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 character_sets CHARACTER_SET_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema character_sets DEFAULT_COLLATE_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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
Testcase 3.2.2.2:
--------------------------------------------------------------------------------
@@ -9802,12 +9833,12 @@ WHERE table_schema = 'information_schema'
AND table_name = 'collations'
ORDER BY 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 information_schema COLLATIONS COLLATION_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLLATIONS CHARACTER_SET_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLLATIONS ID 3 0 NO bigint NULL NULL 19 0 NULL NULL bigint(11) 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 IS_COMPILED 5 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 collations COLLATION_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema collations CHARACTER_SET_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema collations ID 3 0 NO bigint NULL NULL 19 0 NULL NULL bigint(11) 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 IS_COMPILED 5 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
Testcase 3.2.3.2:
--------------------------------------------------------------------------------
@@ -9968,8 +9999,8 @@ WHERE table_schema = 'information_schema'
AND table_name = 'collation_character_set_applicability'
ORDER BY 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 information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema collation_character_set_applicability COLLATION_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema collation_character_set_applicability CHARACTER_SET_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
Testcase 3.2.4.2:
--------------------------------------------------------------------------------
@@ -10141,13 +10172,13 @@ WHERE table_schema = 'information_schema'
AND table_name = 'column_privileges'
ORDER BY 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 information_schema COLUMN_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
-NULL information_schema COLUMN_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 COLUMN_PRIVILEGES TABLE_NAME 4 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 PRIVILEGE_TYPE 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
+NULL information_schema column_privileges TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 column_privileges TABLE_NAME 4 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 PRIVILEGE_TYPE 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema column_privileges IS_GRANTABLE 7 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
Testcase 3.2.5.2 + 3.2.5.3 + 3.2.5.4:
--------------------------------------------------------------------------------
@@ -10325,25 +10356,25 @@ WHERE table_schema = 'information_schema'
AND table_name = 'columns'
ORDER BY 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 information_schema COLUMNS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
-NULL information_schema COLUMNS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 COLUMN_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 COLUMN_DEFAULT 6 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DATA_TYPE 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 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 CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMNS COLUMN_TYPE 15 NO 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 EXTRA 17 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
-NULL information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) 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 TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
+NULL information_schema columns TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 COLUMN_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 COLUMN_DEFAULT 6 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DATA_TYPE 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 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 CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema columns COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema columns COLUMN_TYPE 15 NO 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 EXTRA 17 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
+NULL information_schema columns PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
+NULL information_schema columns COLUMN_COMMENT 19 NO varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) select
Testcase 3.2.6.2 + 3.2.6.3:
--------------------------------------------------------------------------------
@@ -10433,6 +10464,9 @@ NULL information_schema EVENTS LAST_ALTERED 18 0000-00-00 00:00:00 NO datetime N
NULL information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime 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 ORIGINATOR 21 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10) 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 DATABASE_COLLATION 24 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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
@@ -10472,9 +10506,9 @@ NULL information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 19 0 NULL NU
NULL information_schema FILES STATUS 37 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema FILES EXTRA 38 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -10561,6 +10595,9 @@ NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime
NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 DATABASE_COLLATION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -10572,9 +10609,9 @@ NULL information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL
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 IS_GRANTABLE 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema STATISTICS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -10642,6 +10679,9 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NUL
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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 TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -10654,6 +10694,8 @@ NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+NULL information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
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 Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI 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
@@ -10701,6 +10743,10 @@ NULL mysql event sql_mode 15 NO set 431 1293 NULL NULL utf8 utf8_general_ci set
NULL mysql event comment 16 NO char 64 192 NULL NULL utf8 utf8_bin char(64) select,insert,update,references
NULL mysql event originator 17 NULL NO int NULL NULL 10 0 NULL NULL int(10) 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 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 db_collation 21 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) 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 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 dl 3 NO char 128 384 NULL NULL utf8 utf8_bin char(128) select,insert,update,references
@@ -10770,6 +10816,10 @@ NULL mysql proc created 13 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NU
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 sql_mode 15 NO set 431 1293 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') 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 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 db_collation 19 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) 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 procs_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) 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 User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
@@ -11281,6 +11331,9 @@ NULL information_schema EVENTS LAST_ALTERED 18 0000-00-00 00:00:00 NO datetime N
NULL information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime 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 ORIGINATOR 21 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10) 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 DATABASE_COLLATION 24 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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
@@ -11320,9 +11373,9 @@ NULL information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 19 0 NULL NU
NULL information_schema FILES STATUS 37 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema FILES EXTRA 38 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -11409,6 +11462,9 @@ NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime
NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 DATABASE_COLLATION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -11420,9 +11476,9 @@ NULL information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL
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 IS_GRANTABLE 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema STATISTICS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -11490,6 +11546,9 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NUL
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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 TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -11502,6 +11561,8 @@ NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+NULL information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
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
@@ -11859,6 +11920,9 @@ NULL information_schema EVENTS LAST_ALTERED 18 0000-00-00 00:00:00 NO datetime N
NULL information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime 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 ORIGINATOR 21 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10) 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 DATABASE_COLLATION 24 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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
@@ -11898,9 +11962,9 @@ NULL information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 19 0 NULL NU
NULL information_schema FILES STATUS 37 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema FILES EXTRA 38 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -11987,6 +12051,9 @@ NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime
NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 DATABASE_COLLATION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -11998,9 +12065,9 @@ NULL information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL
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 IS_GRANTABLE 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema STATISTICS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -12068,6 +12135,9 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NUL
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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 TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -12080,6 +12150,8 @@ NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+NULL information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
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
@@ -12533,6 +12605,9 @@ NULL information_schema EVENTS LAST_ALTERED datetime NULL NULL NULL NULL datetim
NULL information_schema EVENTS LAST_EXECUTED datetime NULL NULL NULL NULL datetime
3.0000 information_schema EVENTS EVENT_COMMENT varchar 64 192 utf8 utf8_general_ci varchar(64)
NULL information_schema EVENTS ORIGINATOR bigint NULL NULL NULL NULL bigint(10)
+3.0000 information_schema EVENTS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema EVENTS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema EVENTS DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
NULL information_schema FILES FILE_ID bigint NULL NULL NULL NULL bigint(4)
3.0000 information_schema FILES FILE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema FILES FILE_TYPE varchar 20 60 utf8 utf8_general_ci varchar(20)
@@ -12572,9 +12647,9 @@ NULL information_schema FILES CHECKSUM bigint NULL NULL NULL NULL bigint(21) uns
3.0000 information_schema FILES STATUS varchar 20 60 utf8 utf8_general_ci varchar(20)
3.0000 information_schema FILES EXTRA varchar 255 765 utf8 utf8_general_ci varchar(255)
3.0000 information_schema GLOBAL_STATUS VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-NULL information_schema GLOBAL_STATUS VARIABLE_VALUE decimal NULL NULL NULL NULL decimal(22,7)
+3.0000 information_schema GLOBAL_STATUS VARIABLE_VALUE varchar 20480 61440 utf8 utf8_general_ci varchar(20480)
3.0000 information_schema GLOBAL_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-1.0000 information_schema GLOBAL_VARIABLES VARIABLE_VALUE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
+3.0000 information_schema GLOBAL_VARIABLES VARIABLE_VALUE varchar 20480 61440 utf8 utf8_general_ci varchar(20480)
3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG varchar 4096 12288 utf8 utf8_general_ci varchar(4096)
3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -12661,6 +12736,9 @@ NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datet
1.0000 information_schema ROUTINES SQL_MODE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
3.0000 information_schema ROUTINES ROUTINE_COMMENT varchar 64 192 utf8 utf8_general_ci varchar(64)
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)
+3.0000 information_schema ROUTINES DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema SCHEMATA CATALOG_NAME varchar 4096 12288 utf8 utf8_general_ci varchar(4096)
3.0000 information_schema SCHEMATA SCHEMA_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -12672,9 +12750,9 @@ NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datet
3.0000 information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema SCHEMA_PRIVILEGES IS_GRANTABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
3.0000 information_schema SESSION_STATUS VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-NULL information_schema SESSION_STATUS VARIABLE_VALUE decimal NULL NULL NULL NULL decimal(22,7)
+3.0000 information_schema SESSION_STATUS VARIABLE_VALUE varchar 20480 61440 utf8 utf8_general_ci varchar(20480)
3.0000 information_schema SESSION_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-1.0000 information_schema SESSION_VARIABLES VARIABLE_VALUE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
+3.0000 information_schema SESSION_VARIABLES VARIABLE_VALUE varchar 20480 61440 utf8 utf8_general_ci varchar(20480)
3.0000 information_schema STATISTICS TABLE_CATALOG varchar 4096 12288 utf8 utf8_general_ci varchar(4096)
3.0000 information_schema STATISTICS TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema STATISTICS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -12742,6 +12820,9 @@ NULL information_schema TRIGGERS ACTION_ORDER bigint NULL NULL NULL NULL bigint(
NULL information_schema TRIGGERS CREATED datetime NULL NULL NULL NULL datetime
1.0000 information_schema TRIGGERS SQL_MODE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
1.0000 information_schema TRIGGERS DEFINER longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
+3.0000 information_schema TRIGGERS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema TRIGGERS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema TRIGGERS DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema USER_PRIVILEGES GRANTEE varchar 81 243 utf8 utf8_general_ci varchar(81)
3.0000 information_schema USER_PRIVILEGES TABLE_CATALOG varchar 4096 12288 utf8 utf8_general_ci varchar(4096)
3.0000 information_schema USER_PRIVILEGES PRIVILEGE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -12754,6 +12835,8 @@ NULL information_schema TRIGGERS CREATED datetime NULL NULL NULL NULL datetime
3.0000 information_schema VIEWS IS_UPDATABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
3.0000 information_schema VIEWS DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77)
3.0000 information_schema VIEWS SECURITY_TYPE varchar 7 21 utf8 utf8_general_ci varchar(7)
+3.0000 information_schema VIEWS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema VIEWS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 mysql columns_priv Host char 60 180 utf8 utf8_bin char(60)
3.0000 mysql columns_priv Db char 64 192 utf8 utf8_bin char(64)
3.0000 mysql columns_priv User char 16 48 utf8 utf8_bin char(16)
@@ -12801,6 +12884,10 @@ NULL mysql event ends datetime NULL NULL NULL NULL datetime
3.0000 mysql event comment char 64 192 utf8 utf8_bin char(64)
NULL mysql event originator int NULL NULL NULL NULL int(10)
1.0000 mysql event time_zone char 64 64 latin1 latin1_swedish_ci char(64)
+3.0000 mysql event character_set_client char 32 96 utf8 utf8_bin char(32)
+3.0000 mysql event collation_connection char 32 96 utf8 utf8_bin char(32)
+3.0000 mysql event db_collation char 32 96 utf8 utf8_bin char(32)
+1.0000 mysql event body_utf8 longblob 4294967295 4294967295 NULL NULL longblob
3.0000 mysql func name char 64 192 utf8 utf8_bin char(64)
NULL mysql func ret tinyint NULL NULL NULL NULL tinyint(1)
3.0000 mysql func dl char 128 384 utf8 utf8_bin char(128)
@@ -12870,6 +12957,10 @@ 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 431 1293 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')
3.0000 mysql proc comment char 64 192 utf8 utf8_bin char(64)
+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)
+1.0000 mysql proc body_utf8 longblob 4294967295 4294967295 NULL NULL longblob
3.0000 mysql procs_priv Host char 60 180 utf8 utf8_bin char(60)
3.0000 mysql procs_priv Db char 64 192 utf8 utf8_bin char(64)
3.0000 mysql procs_priv User char 16 48 utf8 utf8_bin char(16)
@@ -13360,18 +13451,18 @@ WHERE table_schema = 'information_schema'
AND table_name = 'key_column_usage'
ORDER BY 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 information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema KEY_COLUMN_USAGE TABLE_CATALOG 4 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 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 COLUMN_NAME 7 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_TABLE_SCHEMA 10 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_COLUMN_NAME 12 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema key_column_usage CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema key_column_usage TABLE_CATALOG 4 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 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 COLUMN_NAME 7 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_TABLE_SCHEMA 10 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_COLUMN_NAME 12 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
Testcase 3.2.7.2 + 3.2.7.3:
--------------------------------------------------------------------------------
@@ -13487,6 +13578,9 @@ LAST_ALTERED datetime NO 0000-00-00 00:00:00
SQL_MODE longtext NO
ROUTINE_COMMENT varchar(64) NO
DEFINER varchar(77) NO
+CHARACTER_SET_CLIENT varchar(32) NO
+COLLATION_CONNECTION varchar(32) NO
+DATABASE_COLLATION varchar(32) NO
SHOW CREATE TABLE routines;
Table Create Table
ROUTINES CREATE TEMPORARY TABLE `ROUTINES` (
@@ -13509,39 +13603,45 @@ ROUTINES CREATE TEMPORARY TABLE `ROUTINES` (
`LAST_ALTERED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`SQL_MODE` longtext NOT NULL,
`ROUTINE_COMMENT` varchar(64) NOT NULL DEFAULT '',
- `DEFINER` varchar(77) NOT NULL DEFAULT ''
+ `DEFINER` varchar(77) NOT NULL DEFAULT '',
+ `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '',
+ `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '',
+ `DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=utf8
SELECT COUNT(*) FROM information_schema.columns
WHERE table_schema = 'information_schema'
AND table_name = 'routines'
ORDER BY ordinal_position;
COUNT(*)
-20
+23
SELECT * FROM information_schema.columns
WHERE table_schema = 'information_schema'
AND table_name = 'routines'
ORDER BY 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 information_schema ROUTINES SPECIFIC_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema ROUTINES ROUTINE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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_NAME 4 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 DTD_IDENTIFIER 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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_DEFINITION 8 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 EXTERNAL_LANGUAGE 10 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 IS_DETERMINISTIC 12 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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_PATH 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime 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 SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 ROUTINE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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_NAME 4 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 DTD_IDENTIFIER 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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_DEFINITION 8 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 EXTERNAL_LANGUAGE 10 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 IS_DETERMINISTIC 12 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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_PATH 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime 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 SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 DATABASE_COLLATION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
Testcase 3.2.8.2 + 3.2.8.3:
--------------------------------------------------------------------------------
@@ -13579,16 +13679,16 @@ GRANT EXECUTE ON db_datadict_2.* TO 'user_2'@'localhost';
FLUSH PRIVILEGES;
connect(localhost,user_1,,db_datadict,MYSQL_PORT,MYSQL_SOCK);
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
-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
-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
+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
connect(localhost,user_2,,db_datadict,MYSQL_PORT,MYSQL_SOCK);
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
-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
+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
connect(localhost,user_3,,test,MYSQL_PORT,MYSQL_SOCK);
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
+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
root@localhost db_datadict_2
DROP USER 'user_1'@'localhost';
@@ -13813,6 +13913,9 @@ LAST_ALTERED YYYY-MM-DD hh:mm:ss
SQL_MODE
ROUTINE_COMMENT
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
LENGTH(routine_definition) 2549
use db_datadict;
drop procedure sp_6_408004;
@@ -13851,11 +13954,11 @@ WHERE table_schema = 'information_schema'
AND table_name = 'schemata'
ORDER BY 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 information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema SCHEMATA DEFAULT_COLLATION_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema SCHEMATA SQL_PATH 5 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
+NULL information_schema schemata CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema schemata DEFAULT_COLLATION_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema schemata SQL_PATH 5 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
Testcase 3.2.9.2 + 3.2.9.3:
--------------------------------------------------------------------------------
@@ -13935,12 +14038,12 @@ WHERE table_schema = 'information_schema'
AND table_name = 'table_constraints'
ORDER BY 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 information_schema TABLE_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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_NAME 3 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_CONSTRAINTS TABLE_NAME 5 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 CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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_NAME 3 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_constraints TABLE_NAME 5 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
Testcase 3.2.10.2 + 3.2.10.3:
--------------------------------------------------------------------------------
@@ -14015,12 +14118,12 @@ WHERE table_schema = 'information_schema'
AND table_name = 'table_privileges'
ORDER BY 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 information_schema TABLE_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
-NULL information_schema TABLE_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 TABLE_PRIVILEGES TABLE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 IS_GRANTABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 table_privileges TABLE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 IS_GRANTABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
Testcase 3.2.11.2 + 3.2.11.3 + 3.2.11.4:
--------------------------------------------------------------------------------
@@ -14161,27 +14264,27 @@ WHERE table_schema = 'information_schema'
AND table_name = 'tables'
ORDER BY 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 information_schema TABLES TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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_NAME 3 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 ENGINE 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema TABLES VERSION 6 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_ROWS 8 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 DATA_LENGTH 10 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 INDEX_LENGTH 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned 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 AUTO_INCREMENT 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema TABLES CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TABLES UPDATE_TIME 16 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TABLES CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TABLES TABLE_COLLATION 18 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned 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 TABLE_COMMENT 21 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
+NULL information_schema tables TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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_NAME 3 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 ENGINE 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema tables VERSION 6 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_ROWS 8 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 DATA_LENGTH 10 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 INDEX_LENGTH 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned 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 AUTO_INCREMENT 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+NULL information_schema tables CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+NULL information_schema tables UPDATE_TIME 16 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+NULL information_schema tables CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+NULL information_schema tables TABLE_COLLATION 18 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema tables CHECKSUM 19 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned 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 TABLE_COMMENT 21 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
Testcase 3.2.12.2 + 3.2.12.3:
--------------------------------------------------------------------------------
@@ -14216,7 +14319,7 @@ NULL information_schema ENGINES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL
NULL information_schema EVENTS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema FILES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema GLOBAL_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PARTITIONS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PLUGINS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -14226,7 +14329,7 @@ NULL information_schema ROUTINES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #
NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SESSION_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema SESSION_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SESSION_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema STATISTICS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -14267,7 +14370,7 @@ NULL information_schema ENGINES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL
NULL information_schema EVENTS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema FILES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema GLOBAL_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PARTITIONS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PLUGINS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -14277,7 +14380,7 @@ NULL information_schema ROUTINES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #
NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SESSION_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema SESSION_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SESSION_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema STATISTICS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -14316,7 +14419,7 @@ NULL information_schema ENGINES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL
NULL information_schema EVENTS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema FILES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema GLOBAL_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PARTITIONS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PLUGINS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -14326,7 +14429,7 @@ NULL information_schema ROUTINES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #
NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SESSION_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema SESSION_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SESSION_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema STATISTICS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -14366,7 +14469,7 @@ NULL information_schema ENGINES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL
NULL information_schema EVENTS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema FILES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema GLOBAL_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PARTITIONS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PLUGINS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -14376,7 +14479,7 @@ NULL information_schema ROUTINES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #
NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SESSION_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema SESSION_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SESSION_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema STATISTICS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -14395,11 +14498,11 @@ NULL mysql columns_priv BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF#
NULL mysql db BASE TABLE MyISAM 10 Fixed 3 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Database privileges
NULL mysql event BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Events
NULL mysql func BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL User defined functions
-NULL mysql general_log BASE TABLE CSV 10 Dynamic 2 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL General log
-NULL mysql help_category BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help categories
-NULL mysql help_keyword BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help keywords
-NULL mysql help_relation BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL keyword-topic relation
-NULL mysql help_topic BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help topics
+NULL mysql general_log BASE TABLE CSV 10 Dynamic 1 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL General log
+NULL mysql help_category BASE TABLE MyISAM 10 Fixed 37 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help categories
+NULL mysql help_keyword BASE TABLE MyISAM 10 Fixed 424 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help keywords
+NULL mysql help_relation BASE TABLE MyISAM 10 Fixed 901 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL keyword-topic relation
+NULL mysql help_topic BASE TABLE MyISAM 10 Dynamic 479 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help topics
NULL mysql host BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Host privileges; Merged with database privileges
NULL mysql ndb_binlog_index BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
NULL mysql plugin BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL MySQL plugins
@@ -14451,6 +14554,8 @@ CHECK_OPTION varchar(8) NO
IS_UPDATABLE varchar(3) NO
DEFINER varchar(77) NO
SECURITY_TYPE varchar(7) NO
+CHARACTER_SET_CLIENT varchar(32) NO
+COLLATION_CONNECTION varchar(32) NO
SHOW CREATE TABLE views;
Table Create Table
VIEWS CREATE TEMPORARY TABLE `VIEWS` (
@@ -14461,27 +14566,31 @@ VIEWS CREATE TEMPORARY TABLE `VIEWS` (
`CHECK_OPTION` varchar(8) NOT NULL DEFAULT '',
`IS_UPDATABLE` varchar(3) NOT NULL DEFAULT '',
`DEFINER` varchar(77) NOT NULL DEFAULT '',
- `SECURITY_TYPE` varchar(7) NOT NULL DEFAULT ''
+ `SECURITY_TYPE` varchar(7) NOT NULL DEFAULT '',
+ `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '',
+ `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=utf8
SELECT COUNT(*) FROM information_schema.columns
WHERE table_schema = 'information_schema'
AND table_name = 'views'
ORDER BY ordinal_position;
COUNT(*)
-8
+10
SELECT * FROM information_schema.columns
WHERE table_schema = 'information_schema'
AND table_name = 'views'
ORDER BY 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 information_schema VIEWS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema VIEWS VIEW_DEFINITION 4 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
-NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema views VIEW_DEFINITION 4 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+NULL information_schema views DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+NULL information_schema views COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
Testcase 3.2.13.2 + 3.2.13.3:
--------------------------------------------------------------------------------
@@ -14499,21 +14608,21 @@ GRANT SELECT ON db_datadict.v_granted_to_1 TO 'user_1'@'localhost';
GRANT SHOW VIEW, CREATE VIEW ON db_datadict.* TO 'user_2'@'localhost';
FLUSH PRIVILEGES;
SELECT * FROM information_schema.views;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
-NULL db_datadict v_granted_glob /* ALGORITHM=UNDEFINED */ select `db_datadict`.`tb_401302`.`f2` AS `f2`,`db_datadict`.`tb_401302`.`f3` AS `f3` from `db_datadict`.`tb_401302` NONE YES root@localhost DEFINER
-NULL db_datadict v_granted_to_1 /* ALGORITHM=UNDEFINED */ select `db_datadict`.`tb_401302`.`f1` AS `f1`,`db_datadict`.`tb_401302`.`f2` AS `f2`,`db_datadict`.`tb_401302`.`f3` AS `f3` from `db_datadict`.`tb_401302` NONE YES root@localhost DEFINER
+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 f2, f3 FROM tb_401302 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
+NULL db_datadict v_granted_to_1 SELECT * FROM tb_401302 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
connect(localhost,user_1,,test,MYSQL_PORT,MYSQL_SOCK);
SELECT * FROM information_schema.views;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
-NULL db_datadict v_granted_to_1 NONE YES root@localhost DEFINER
+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
connect(localhost,user_2,,test,MYSQL_PORT,MYSQL_SOCK);
SELECT * FROM information_schema.views;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
-NULL db_datadict v_granted_glob NONE YES root@localhost DEFINER
-NULL db_datadict v_granted_to_1 NONE YES root@localhost DEFINER
+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
connect(localhost,user_no_views,,test,MYSQL_PORT,MYSQL_SOCK);
SELECT * FROM information_schema.views;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
root@localhost db_datadict
USE db_datadict;
@@ -14576,21 +14685,21 @@ WHERE table_schema = 'information_schema'
AND table_name = 'statistics'
ORDER BY 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 information_schema STATISTICS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
-NULL information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 NON_UNIQUE 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(1) 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_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 COLUMN_NAME 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
-NULL information_schema STATISTICS SUB_PART 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(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 NULLABLE 13 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 COMMENT 15 NULL YES varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16) select
+NULL information_schema statistics TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
+NULL information_schema statistics TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 NON_UNIQUE 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(1) 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_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 COLUMN_NAME 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
+NULL information_schema statistics SUB_PART 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(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 NULLABLE 13 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 COMMENT 15 NULL YES varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16) select
Testcase 3.2.14.2 + 3.2.14.3:
--------------------------------------------------------------------------------
@@ -14644,14 +14753,14 @@ NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE
NULL mysql event 0 mysql PRIMARY 1 db A NULL NULL NULL BTREE
NULL mysql event 0 mysql PRIMARY 2 name A 0 NULL NULL BTREE
NULL mysql func 0 mysql PRIMARY 1 name A 0 NULL NULL BTREE
-NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 0 NULL NULL BTREE
-NULL mysql help_category 0 mysql name 1 name A 0 NULL NULL BTREE
-NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A 0 NULL NULL BTREE
-NULL mysql help_keyword 0 mysql name 1 name A 0 NULL NULL BTREE
+NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 37 NULL NULL BTREE
+NULL mysql help_category 0 mysql name 1 name A 37 NULL NULL BTREE
+NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A 424 NULL NULL BTREE
+NULL mysql help_keyword 0 mysql name 1 name A 424 NULL NULL BTREE
NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A NULL NULL NULL BTREE
-NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A 0 NULL NULL BTREE
-NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A 0 NULL NULL BTREE
-NULL mysql help_topic 0 mysql name 1 name A 0 NULL NULL BTREE
+NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A 901 NULL NULL BTREE
+NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A 479 NULL NULL BTREE
+NULL mysql help_topic 0 mysql name 1 name A 479 NULL NULL BTREE
NULL mysql host 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
NULL mysql host 0 mysql PRIMARY 2 Db A 0 NULL NULL BTREE
NULL mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A 0 NULL NULL BTREE
@@ -14732,11 +14841,11 @@ WHERE table_schema = 'information_schema'
AND table_name = 'schema_privileges'
ORDER BY 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 information_schema SCHEMA_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
-NULL information_schema SCHEMA_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 SCHEMA_PRIVILEGES PRIVILEGE_TYPE 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
+NULL information_schema schema_privileges TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 schema_privileges PRIVILEGE_TYPE 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema schema_privileges IS_GRANTABLE 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
Testcase 3.2.15.2:
--------------------------------------------------------------------------------
@@ -14901,10 +15010,10 @@ WHERE table_schema = 'information_schema'
AND table_name = 'user_privileges'
ORDER BY 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 information_schema USER_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
-NULL information_schema USER_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 IS_GRANTABLE 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 IS_GRANTABLE 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
Testcase 3.2.16.2 + 3.2.16.3 + 3.2.16.4:
--------------------------------------------------------------------------------
@@ -15265,6 +15374,9 @@ ACTION_REFERENCE_NEW_ROW varchar(3) NO
CREATED datetime YES NULL
SQL_MODE longtext NO
DEFINER longtext NO
+CHARACTER_SET_CLIENT varchar(32) NO
+COLLATION_CONNECTION varchar(32) NO
+DATABASE_COLLATION varchar(32) NO
SHOW CREATE TABLE triggers;
Table Create Table
TRIGGERS CREATE TEMPORARY TABLE `TRIGGERS` (
@@ -15286,38 +15398,44 @@ TRIGGERS CREATE TEMPORARY TABLE `TRIGGERS` (
`ACTION_REFERENCE_NEW_ROW` varchar(3) NOT NULL DEFAULT '',
`CREATED` datetime DEFAULT NULL,
`SQL_MODE` longtext NOT NULL,
- `DEFINER` longtext NOT NULL
+ `DEFINER` longtext NOT NULL,
+ `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '',
+ `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '',
+ `DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=utf8
SELECT COUNT(*) FROM information_schema.columns
WHERE table_schema = 'information_schema'
AND table_name = 'triggers'
ORDER BY ordinal_position;
COUNT(*)
-19
+22
SELECT * FROM information_schema.columns
WHERE table_schema = 'information_schema'
AND table_name = 'triggers'
ORDER BY 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 information_schema TRIGGERS TRIGGER_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
-NULL information_schema TRIGGERS TRIGGER_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 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 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) 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_STATEMENT 10 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) 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_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_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
-NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema triggers TRIGGER_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
+NULL information_schema triggers TRIGGER_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 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 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) 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_STATEMENT 10 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) 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_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_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+NULL information_schema triggers CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+NULL information_schema triggers SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema triggers DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
Testcase 3.2.18.2 + 3.2.18.3:
--------------------------------------------------------------------------------
@@ -15385,17 +15503,17 @@ WHERE table_schema = 'information_schema'
AND table_name = 'referential_constraints'
ORDER BY 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 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 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 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 UNIQUE_CONSTRAINT_NAME 6 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 UPDATE_RULE 8 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 TABLE_NAME 10 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 CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 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 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 UNIQUE_CONSTRAINT_NAME 6 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 UPDATE_RULE 8 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 TABLE_NAME 10 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
*** End of Data Dictionary Tests ***
--------------------------------------------------------------------------------
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 ab4508fb302..02ef728fad5 100644
--- a/mysql-test/suite/funcs_1/r/myisam_func_view.result
+++ b/mysql-test/suite/funcs_1/r/myisam_func_view.result
@@ -286,8 +286,8 @@ CREATE VIEW v1 AS SELECT my_char_30, id FROM t1_values;
SELECT my_char_30, id FROM t1_values
WHERE select_id = 190 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 190 OR select_id IS NULL) order by id;
@@ -304,8 +304,8 @@ A<--------30 characters-------> <--------30 characters-------> 3
A ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
A-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select concat(_latin1'A',`t1_values`.`my_char_30`) AS `CONCAT('A',my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select concat(_latin1'A',`t1_values`.`my_char_30`) AS `CONCAT('A',my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 189 OR select_id IS NULL) order by id;
@@ -324,8 +324,8 @@ SELECT LTRIM(my_varbinary_1000),
my_varbinary_1000, id FROM t1_values
WHERE select_id = 188 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_varbinary_1000`) AS `LTRIM(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_varbinary_1000`) AS `LTRIM(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 188 OR select_id IS NULL) order by id;
@@ -338,8 +338,8 @@ SELECT LTRIM(my_binary_30),
my_binary_30, id FROM t1_values
WHERE select_id = 187 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_binary_30`) AS `LTRIM(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_binary_30`) AS `LTRIM(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 187 OR select_id IS NULL) order by id;
@@ -352,8 +352,8 @@ SELECT LTRIM(my_varchar_1000),
my_varchar_1000, id FROM t1_values
WHERE select_id = 186 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_varchar_1000`) AS `LTRIM(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_varchar_1000`) AS `LTRIM(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 186 OR select_id IS NULL) order by id;
@@ -366,8 +366,8 @@ SELECT LTRIM(my_char_30),
my_char_30, id FROM t1_values
WHERE select_id = 185 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_char_30`) AS `LTRIM(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_char_30`) AS `LTRIM(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 185 OR select_id IS NULL) order by id;
@@ -380,8 +380,8 @@ SELECT LOWER(my_varbinary_1000),
my_varbinary_1000, id FROM t1_values
WHERE select_id = 184 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_varbinary_1000`) AS `LOWER(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_varbinary_1000`) AS `LOWER(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 184 OR select_id IS NULL) order by id;
@@ -394,8 +394,8 @@ SELECT LOWER(my_binary_30),
my_binary_30, id FROM t1_values
WHERE select_id = 183 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_binary_30`) AS `LOWER(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_binary_30`) AS `LOWER(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 183 OR select_id IS NULL) order by id;
@@ -408,8 +408,8 @@ SELECT LOWER(my_varchar_1000),
my_varchar_1000, id FROM t1_values
WHERE select_id = 182 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_varchar_1000`) AS `LOWER(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_varchar_1000`) AS `LOWER(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 182 OR select_id IS NULL) order by id;
@@ -422,8 +422,8 @@ SELECT LOWER(my_char_30),
my_char_30, id FROM t1_values
WHERE select_id = 181 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_char_30`) AS `LOWER(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_char_30`) AS `LOWER(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 181 OR select_id IS NULL) order by id;
@@ -436,8 +436,8 @@ SELECT LOCATE('-', ' - -ABC', my_decimal),
my_decimal, id FROM t1_values
WHERE select_id = 180 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',_latin1' - -ABC',`t1_values`.`my_decimal`) AS `LOCATE('-', ' - -ABC', my_decimal)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',_latin1' - -ABC',`t1_values`.`my_decimal`) AS `LOCATE('-', ' - -ABC', my_decimal)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 180 OR select_id IS NULL) order by id;
@@ -450,8 +450,8 @@ SELECT LOCATE('-', ' - -ABC', my_double),
my_double, id FROM t1_values
WHERE select_id = 179 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',_latin1' - -ABC',`t1_values`.`my_double`) AS `LOCATE('-', ' - -ABC', my_double)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',_latin1' - -ABC',`t1_values`.`my_double`) AS `LOCATE('-', ' - -ABC', my_double)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 179 OR select_id IS NULL) order by id;
@@ -464,8 +464,8 @@ SELECT LOCATE('-', ' - -ABC', my_bigint),
my_bigint, id FROM t1_values
WHERE select_id = 178 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',_latin1' - -ABC',`t1_values`.`my_bigint`) AS `LOCATE('-', ' - -ABC', my_bigint)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',_latin1' - -ABC',`t1_values`.`my_bigint`) AS `LOCATE('-', ' - -ABC', my_bigint)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 178 OR select_id IS NULL) order by id;
@@ -478,8 +478,8 @@ SELECT LOCATE('-', my_varbinary_1000, 3),
my_varbinary_1000, id FROM t1_values
WHERE select_id = 177 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_varbinary_1000`,3) AS `LOCATE('-', my_varbinary_1000, 3)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_varbinary_1000`,3) AS `LOCATE('-', my_varbinary_1000, 3)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 177 OR select_id IS NULL) order by id;
@@ -492,8 +492,8 @@ SELECT LOCATE('-', my_binary_30, 3),
my_binary_30, id FROM t1_values
WHERE select_id = 176 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_binary_30`,3) AS `LOCATE('-', my_binary_30, 3)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_binary_30`,3) AS `LOCATE('-', my_binary_30, 3)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 176 OR select_id IS NULL) order by id;
@@ -506,8 +506,8 @@ SELECT LOCATE('-', my_varchar_1000, 3),
my_varchar_1000, id FROM t1_values
WHERE select_id = 175 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_varchar_1000`,3) AS `LOCATE('-', my_varchar_1000, 3)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_varchar_1000`,3) AS `LOCATE('-', my_varchar_1000, 3)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 175 OR select_id IS NULL) order by id;
@@ -520,8 +520,8 @@ SELECT LOCATE('-', my_char_30, 3),
my_char_30, id FROM t1_values
WHERE select_id = 174 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_char_30`,3) AS `LOCATE('-', my_char_30, 3)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_char_30`,3) AS `LOCATE('-', my_char_30, 3)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 174 OR select_id IS NULL) order by id;
@@ -534,8 +534,8 @@ SELECT LOCATE(my_varbinary_1000, my_binary_30 ),
my_varbinary_1000, my_binary_30 id FROM t1_values
WHERE select_id = 173 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_binary_30`) AS `LOCATE(my_varbinary_1000, my_binary_30 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`my_binary_30` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_binary_30`) AS `LOCATE(my_varbinary_1000, my_binary_30 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`my_binary_30` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 173 OR select_id IS NULL) order by id;
@@ -548,8 +548,8 @@ SELECT LOCATE(my_varbinary_1000, my_varchar_1000 ),
my_varbinary_1000, my_varchar_1000 id FROM t1_values
WHERE select_id = 172 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_varbinary_1000, my_varchar_1000 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`my_varchar_1000` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_varbinary_1000, my_varchar_1000 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`my_varchar_1000` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 172 OR select_id IS NULL) order by id;
@@ -562,8 +562,8 @@ SELECT LOCATE(my_varbinary_1000, my_char_30 ),
my_varbinary_1000, my_char_30 id FROM t1_values
WHERE select_id = 171 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_char_30`) AS `LOCATE(my_varbinary_1000, my_char_30 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`my_char_30` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_char_30`) AS `LOCATE(my_varbinary_1000, my_char_30 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`my_char_30` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 171 OR select_id IS NULL) order by id;
@@ -576,8 +576,8 @@ SELECT LOCATE(my_varbinary_1000, my_varbinary_1000 ),
my_varbinary_1000, id FROM t1_values
WHERE select_id = 170 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_varbinary_1000, my_varbinary_1000 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_varbinary_1000, my_varbinary_1000 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 170 OR select_id IS NULL) order by id;
@@ -590,8 +590,8 @@ SELECT LOCATE(my_binary_30, my_varbinary_1000 ),
my_binary_30, my_varbinary_1000 id FROM t1_values
WHERE select_id = 169 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_binary_30, my_varbinary_1000 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`my_varbinary_1000` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_binary_30, my_varbinary_1000 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`my_varbinary_1000` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 169 OR select_id IS NULL) order by id;
@@ -604,8 +604,8 @@ SELECT LOCATE(my_binary_30, my_varchar_1000 ),
my_binary_30, my_varchar_1000 id FROM t1_values
WHERE select_id = 168 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_binary_30, my_varchar_1000 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`my_varchar_1000` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_binary_30, my_varchar_1000 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`my_varchar_1000` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 168 OR select_id IS NULL) order by id;
@@ -618,8 +618,8 @@ SELECT LOCATE(my_binary_30, my_char_30 ),
my_binary_30, my_char_30 id FROM t1_values
WHERE select_id = 167 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_char_30`) AS `LOCATE(my_binary_30, my_char_30 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`my_char_30` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_char_30`) AS `LOCATE(my_binary_30, my_char_30 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`my_char_30` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 167 OR select_id IS NULL) order by id;
@@ -632,8 +632,8 @@ SELECT LOCATE(my_binary_30, my_binary_30 ),
my_binary_30, id FROM t1_values
WHERE select_id = 166 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_binary_30`) AS `LOCATE(my_binary_30, my_binary_30 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_binary_30`) AS `LOCATE(my_binary_30, my_binary_30 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 166 OR select_id IS NULL) order by id;
@@ -646,8 +646,8 @@ SELECT LOCATE(my_varchar_1000, my_varbinary_1000 ),
my_varchar_1000, my_varbinary_1000 id FROM t1_values
WHERE select_id = 165 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_varchar_1000, my_varbinary_1000 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`my_varbinary_1000` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_varchar_1000, my_varbinary_1000 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`my_varbinary_1000` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 165 OR select_id IS NULL) order by id;
@@ -660,8 +660,8 @@ SELECT LOCATE(my_varchar_1000, my_binary_30 ),
my_varchar_1000, my_binary_30 id FROM t1_values
WHERE select_id = 164 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_binary_30`) AS `LOCATE(my_varchar_1000, my_binary_30 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`my_binary_30` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_binary_30`) AS `LOCATE(my_varchar_1000, my_binary_30 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`my_binary_30` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 164 OR select_id IS NULL) order by id;
@@ -674,8 +674,8 @@ SELECT LOCATE(my_varchar_1000, my_char_30 ),
my_varchar_1000, my_char_30 id FROM t1_values
WHERE select_id = 163 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_char_30`) AS `LOCATE(my_varchar_1000, my_char_30 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`my_char_30` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_char_30`) AS `LOCATE(my_varchar_1000, my_char_30 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`my_char_30` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 163 OR select_id IS NULL) order by id;
@@ -688,8 +688,8 @@ SELECT LOCATE(my_varchar_1000, my_varchar_1000 ),
my_varchar_1000, id FROM t1_values
WHERE select_id = 162 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_varchar_1000, my_varchar_1000 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_varchar_1000, my_varchar_1000 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 162 OR select_id IS NULL) order by id;
@@ -702,8 +702,8 @@ SELECT LOCATE(my_char_30, my_varbinary_1000 ),
my_char_30, my_varbinary_1000 id FROM t1_values
WHERE select_id = 161 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_char_30, my_varbinary_1000 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`my_varbinary_1000` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_char_30, my_varbinary_1000 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`my_varbinary_1000` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 161 OR select_id IS NULL) order by id;
@@ -716,8 +716,8 @@ SELECT LOCATE(my_char_30, my_binary_30 ),
my_char_30, my_binary_30 id FROM t1_values
WHERE select_id = 160 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_binary_30`) AS `LOCATE(my_char_30, my_binary_30 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`my_binary_30` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_binary_30`) AS `LOCATE(my_char_30, my_binary_30 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`my_binary_30` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 160 OR select_id IS NULL) order by id;
@@ -730,8 +730,8 @@ SELECT LOCATE(my_char_30, my_varchar_1000 ),
my_char_30, my_varchar_1000 id FROM t1_values
WHERE select_id = 159 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_char_30, my_varchar_1000 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`my_varchar_1000` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_char_30, my_varchar_1000 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`my_varchar_1000` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 159 OR select_id IS NULL) order by id;
@@ -744,8 +744,8 @@ SELECT LOCATE(my_char_30, my_char_30 ),
my_char_30, id FROM t1_values
WHERE select_id = 158 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_char_30`) AS `LOCATE(my_char_30, my_char_30 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_char_30`) AS `LOCATE(my_char_30, my_char_30 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 158 OR select_id IS NULL) order by id;
@@ -758,8 +758,8 @@ SELECT LOCATE('char', my_varbinary_1000),
my_varbinary_1000, id FROM t1_values
WHERE select_id = 157 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_varbinary_1000`) AS `LOCATE('char', my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_varbinary_1000`) AS `LOCATE('char', my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 157 OR select_id IS NULL) order by id;
@@ -772,8 +772,8 @@ SELECT LOCATE('char', my_binary_30),
my_binary_30, id FROM t1_values
WHERE select_id = 156 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_binary_30`) AS `LOCATE('char', my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_binary_30`) AS `LOCATE('char', my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 156 OR select_id IS NULL) order by id;
@@ -786,8 +786,8 @@ SELECT LOCATE('char', my_varchar_1000),
my_varchar_1000, id FROM t1_values
WHERE select_id = 155 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_varchar_1000`) AS `LOCATE('char', my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_varchar_1000`) AS `LOCATE('char', my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 155 OR select_id IS NULL) order by id;
@@ -800,8 +800,8 @@ SELECT LOCATE('char', my_char_30),
my_char_30, id FROM t1_values
WHERE select_id = 154 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_char_30`) AS `LOCATE('char', my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_char_30`) AS `LOCATE('char', my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 154 OR select_id IS NULL) order by id;
@@ -823,8 +823,8 @@ LOAD_FILE('../tmp/func_view.dat') id
äÄ@
5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select load_file(_latin1'../tmp/func_view.dat') AS `LOAD_FILE('../tmp/func_view.dat')`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select load_file(_latin1'../tmp/func_view.dat') AS `LOAD_FILE('../tmp/func_view.dat')`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 153 OR select_id IS NULL) order by id;
@@ -848,8 +848,8 @@ SELECT LENGTH(my_varbinary_1000),
my_varbinary_1000, id FROM t1_values
WHERE select_id = 152 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_varbinary_1000`) AS `LENGTH(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_varbinary_1000`) AS `LENGTH(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 152 OR select_id IS NULL) order by id;
@@ -862,8 +862,8 @@ SELECT LENGTH(my_binary_30),
my_binary_30, id FROM t1_values
WHERE select_id = 151 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_binary_30`) AS `LENGTH(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_binary_30`) AS `LENGTH(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 151 OR select_id IS NULL) order by id;
@@ -876,8 +876,8 @@ SELECT LENGTH(my_varchar_1000),
my_varchar_1000, id FROM t1_values
WHERE select_id = 150 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_varchar_1000`) AS `LENGTH(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_varchar_1000`) AS `LENGTH(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 150 OR select_id IS NULL) order by id;
@@ -890,8 +890,8 @@ SELECT LENGTH(my_char_30),
my_char_30, id FROM t1_values
WHERE select_id = 149 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_char_30`) AS `LENGTH(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_char_30`) AS `LENGTH(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 149 OR select_id IS NULL) order by id;
@@ -911,8 +911,8 @@ Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(_latin1'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`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(_latin1'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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 148 OR select_id IS NULL) order by id;
@@ -938,8 +938,8 @@ NULL NULL 1
- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_varbinary_1000`,2) AS `LEFT(my_varbinary_1000, 2)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_varbinary_1000`,2) AS `LEFT(my_varbinary_1000, 2)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 147 OR select_id IS NULL) order by id;
@@ -962,8 +962,8 @@ NULL NULL 1
- ---äÖüß@µ*$--
-1 -1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_binary_30`,2) AS `LEFT(my_binary_30, 2)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_binary_30`,2) AS `LEFT(my_binary_30, 2)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 146 OR select_id IS NULL) order by id;
@@ -986,8 +986,8 @@ NULL NULL 1
- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_varchar_1000`,2) AS `LEFT(my_varchar_1000, 2)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_varchar_1000`,2) AS `LEFT(my_varchar_1000, 2)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 145 OR select_id IS NULL) order by id;
@@ -1010,8 +1010,8 @@ NULL NULL 1
- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_char_30`,2) AS `LEFT(my_char_30, 2)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_char_30`,2) AS `LEFT(my_char_30, 2)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 144 OR select_id IS NULL) order by id;
@@ -1030,8 +1030,8 @@ SELECT LCASE(my_varchar_1000),
my_varchar_1000, id FROM t1_values
WHERE select_id = 143 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_varchar_1000`) AS `LCASE(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_varchar_1000`) AS `LCASE(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 143 OR select_id IS NULL) order by id;
@@ -1044,8 +1044,8 @@ SELECT INSTR(my_char_30, 'char'),
my_char_30, id FROM t1_values
WHERE select_id = 142 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_char_30`) AS `INSTR(my_char_30, 'char')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_char_30`) AS `INSTR(my_char_30, 'char')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 142 OR select_id IS NULL) order by id;
@@ -1064,8 +1064,8 @@ NULL NULL 1
160 ---äÖüß@µ*$-- 4
16 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_varbinary_1000`) AS `BIT_LENGTH(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_varbinary_1000`) AS `BIT_LENGTH(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 141 OR select_id IS NULL) order by id;
@@ -1090,8 +1090,8 @@ NULL NULL 1
240 ---äÖüß@µ*$--
240 -1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_binary_30`) AS `BIT_LENGTH(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_binary_30`) AS `BIT_LENGTH(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 140 OR select_id IS NULL) order by id;
@@ -1116,8 +1116,8 @@ NULL NULL 1
160 ---äÖüß@µ*$-- 4
16 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_varchar_1000`) AS `BIT_LENGTH(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_varchar_1000`) AS `BIT_LENGTH(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 139 OR select_id IS NULL) order by id;
@@ -1142,8 +1142,8 @@ NULL NULL 1
152 ---äÖüß@µ*$-- 4
16 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_char_30`) AS `BIT_LENGTH(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_char_30`) AS `BIT_LENGTH(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 138 OR select_id IS NULL) order by id;
@@ -1168,8 +1168,8 @@ IS_NULL NULL 1
2000 2000 4
2005 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_year`,_latin1'IS_NULL') AS `IFNULL(my_year,'IS_NULL')`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_year`,_latin1'IS_NULL') AS `IFNULL(my_year,'IS_NULL')`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 137 OR select_id IS NULL) order by id;
@@ -1194,8 +1194,8 @@ IS_NULL NULL 1
13:00:00 13:00:00 4
10:00:00 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_time`,_latin1'IS_NULL') AS `IFNULL(my_time,'IS_NULL')`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_time`,_latin1'IS_NULL') AS `IFNULL(my_time,'IS_NULL')`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 136 OR select_id IS NULL) order by id;
@@ -1220,8 +1220,8 @@ IFNULL(my_timestamp,'IS_NULL') my_timestamp id
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_timestamp`,_latin1'IS_NULL') AS `IFNULL(my_timestamp,'IS_NULL')`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_timestamp`,_latin1'IS_NULL') AS `IFNULL(my_timestamp,'IS_NULL')`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 135 OR select_id IS NULL) order by id;
@@ -1246,8 +1246,8 @@ IS_NULL NULL 1
2004-02-29 2004-02-29 4
2005-06-28 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_date`,_latin1'IS_NULL') AS `IFNULL(my_date,'IS_NULL')`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_date`,_latin1'IS_NULL') AS `IFNULL(my_date,'IS_NULL')`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 134 OR select_id IS NULL) order by id;
@@ -1272,8 +1272,8 @@ IS_NULL NULL 1
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_datetime`,_latin1'IS_NULL') AS `IFNULL(my_datetime,'IS_NULL')`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_datetime`,_latin1'IS_NULL') AS `IFNULL(my_datetime,'IS_NULL')`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 133 OR select_id IS NULL) order by id;
@@ -1298,8 +1298,8 @@ IS_NULL NULL 1
0 0 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_double`,_latin1'IS_NULL') AS `IFNULL(my_double,'IS_NULL')`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_double`,_latin1'IS_NULL') AS `IFNULL(my_double,'IS_NULL')`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 132 OR select_id IS NULL) order by id;
@@ -1324,8 +1324,8 @@ IS_NULL NULL 1
0.000000000000000000000000000000 0.000000000000000000000000000000 4
-1.000000000000000000000000000000 -1.000000000000000000000000000000 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_decimal`,_latin1'IS_NULL') AS `IFNULL(my_decimal,'IS_NULL')`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_decimal`,_latin1'IS_NULL') AS `IFNULL(my_decimal,'IS_NULL')`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 131 OR select_id IS NULL) order by id;
@@ -1350,8 +1350,8 @@ IS_NULL NULL 1
0 0 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_bigint`,_latin1'IS_NULL') AS `IFNULL(my_bigint,'IS_NULL')`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_bigint`,_latin1'IS_NULL') AS `IFNULL(my_bigint,'IS_NULL')`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 130 OR select_id IS NULL) order by id;
@@ -1376,8 +1376,8 @@ IS_NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_varbinary_1000`,_latin1'IS_NULL') AS `IFNULL(my_varbinary_1000,'IS_NULL')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_varbinary_1000`,_latin1'IS_NULL') AS `IFNULL(my_varbinary_1000,'IS_NULL')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 129 OR select_id IS NULL) order by id;
@@ -1402,8 +1402,8 @@ IS_NULL NULL 1
---äÖüß@µ*$--
-1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_binary_30`,_latin1'IS_NULL') AS `IFNULL(my_binary_30,'IS_NULL')`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_binary_30`,_latin1'IS_NULL') AS `IFNULL(my_binary_30,'IS_NULL')`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 128 OR select_id IS NULL) order by id;
@@ -1428,8 +1428,8 @@ IS_NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_varchar_1000`,_latin1'IS_NULL') AS `IFNULL(my_varchar_1000,'IS_NULL')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_varchar_1000`,_latin1'IS_NULL') AS `IFNULL(my_varchar_1000,'IS_NULL')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 127 OR select_id IS NULL) order by id;
@@ -1454,8 +1454,8 @@ IS_NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_char_30`,_latin1'IS_NULL') AS `IFNULL(my_char_30,'IS_NULL')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_char_30`,_latin1'IS_NULL') AS `IFNULL(my_char_30,'IS_NULL')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 126 OR select_id IS NULL) order by id;
@@ -1481,9 +1481,9 @@ IS NOT NULL 2155 3
IS NOT NULL 2000 4
IS NOT NULL 2005 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_year`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_year IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 125 OR select_id IS NULL) order by id;
@@ -1510,9 +1510,9 @@ IS NOT NULL 838:59:59 3
IS NOT NULL 13:00:00 4
IS NOT NULL 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_time`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_time IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 124 OR select_id IS NULL) order by id;
@@ -1539,9 +1539,9 @@ IS NOT NULL 2038-01-01 02:59:59 3
IS NOT NULL 2004-02-29 23:59:59 4
IS NOT NULL 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_timestamp`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_timestamp IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 123 OR select_id IS NULL) order by id;
@@ -1568,9 +1568,9 @@ IS NOT NULL 9999-12-31 3
IS NOT NULL 2004-02-29 4
IS NOT NULL 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_date`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_date IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 122 OR select_id IS NULL) order by id;
@@ -1597,9 +1597,9 @@ IS NOT NULL 9999-12-31 23:59:59 3
IS NOT NULL 2004-02-29 23:59:59 4
IS NOT NULL 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_datetime`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_datetime IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 121 OR select_id IS NULL) order by id;
@@ -1626,9 +1626,9 @@ IS NOT NULL 1.7976931348623e+308 3
IS NOT NULL 0 4
IS NOT NULL -1 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_double`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_double IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 120 OR select_id IS NULL) order by id;
@@ -1655,9 +1655,9 @@ IS NOT NULL 9999999999999999999999999999999999.999999999999999999999999999999 3
IS NOT NULL 0.000000000000000000000000000000 4
IS NOT NULL -1.000000000000000000000000000000 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_decimal`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_decimal IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 119 OR select_id IS NULL) order by id;
@@ -1684,9 +1684,9 @@ IS NOT NULL 9223372036854775807 3
IS NOT NULL 0 4
IS NOT NULL -1 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_bigint`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_bigint IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 118 OR select_id IS NULL) order by id;
@@ -1713,9 +1713,9 @@ IS NOT NULL <---------1000 characters-------------------------------------------
IS NOT NULL ---äÖüß@µ*$-- 4
IS NOT NULL -1 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_varbinary_1000`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_varbinary_1000 IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 117 OR select_id IS NULL) order by id;
@@ -1742,9 +1742,9 @@ IS NOT NULL <--------30 characters-------> 3
IS NOT NULL ---äÖüß@µ*$--
IS NOT NULL -1
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_binary_30`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_binary_30 IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 116 OR select_id IS NULL) order by id;
@@ -1771,9 +1771,9 @@ IS NOT NULL <---------1000 characters-------------------------------------------
IS NOT NULL ---äÖüß@µ*$-- 4
IS NOT NULL -1 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_varchar_1000`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_varchar_1000 IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 115 OR select_id IS NULL) order by id;
@@ -1800,9 +1800,9 @@ IS NOT NULL <--------30 characters-------> 3
IS NOT NULL ---äÖüß@µ*$-- 4
IS NOT NULL -1 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_char_30`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_char_30 IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 114 OR select_id IS NULL) order by id;
@@ -1828,8 +1828,8 @@ IS TRUE 2155 3
IS TRUE 2000 4
IS TRUE 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_year`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_year, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_year, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 113 OR select_id IS NULL) order by id;
@@ -1854,8 +1854,8 @@ IS TRUE 838:59:59 3
IS TRUE 13:00:00 4
IS TRUE 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_time`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_time, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_time, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 112 OR select_id IS NULL) order by id;
@@ -1880,8 +1880,8 @@ IS TRUE 2038-01-01 02:59:59 3
IS TRUE 2004-02-29 23:59:59 4
IS TRUE 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_timestamp`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_timestamp, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_timestamp, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 111 OR select_id IS NULL) order by id;
@@ -1906,8 +1906,8 @@ IS TRUE 9999-12-31 3
IS TRUE 2004-02-29 4
IS TRUE 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_date`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_date, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_date, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 110 OR select_id IS NULL) order by id;
@@ -1932,8 +1932,8 @@ IS TRUE 9999-12-31 23:59:59 3
IS TRUE 2004-02-29 23:59:59 4
IS TRUE 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_datetime`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_datetime, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_datetime, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 109 OR select_id IS NULL) order by id;
@@ -1958,8 +1958,8 @@ IS TRUE 1.7976931348623e+308 3
IS NOT TRUE 0 4
IS TRUE -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_double`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_double, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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_double`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_double, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 108 OR select_id IS NULL) order by id;
@@ -1984,8 +1984,8 @@ IS TRUE 9999999999999999999999999999999999.999999999999999999999999999999 3
IS NOT TRUE 0.000000000000000000000000000000 4
IS TRUE -1.000000000000000000000000000000 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_decimal`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_decimal, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values`
+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_decimal`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_decimal, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 107 OR select_id IS NULL) order by id;
@@ -2010,8 +2010,8 @@ IS TRUE 9223372036854775807 3
IS NOT TRUE 0 4
IS TRUE -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_bigint`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_bigint, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_bigint, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 106 OR select_id IS NULL) order by id;
@@ -2036,8 +2036,8 @@ IS NOT TRUE <---------1000 characters-------------------------------------------
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_varbinary_1000`,_latin1'IS TRUE',_latin1'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`
+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`,_latin1'IS TRUE',_latin1'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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 105 OR select_id IS NULL) order by id;
@@ -2067,8 +2067,8 @@ Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
Warning 1292 Truncated incorrect DOUBLE value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_binary_30`,_latin1'IS TRUE',_latin1'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`
+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`,_latin1'IS TRUE',_latin1'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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 104 OR select_id IS NULL) order by id;
@@ -2098,8 +2098,8 @@ IS NOT TRUE <---------1000 characters-------------------------------------------
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_varchar_1000`,_latin1'IS TRUE',_latin1'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`
+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`,_latin1'IS TRUE',_latin1'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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 103 OR select_id IS NULL) order by id;
@@ -2127,8 +2127,8 @@ Warnings:
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_char_30`,_latin1'IS TRUE',_latin1'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`
+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`,_latin1'IS TRUE',_latin1'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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 102 OR select_id IS NULL) order by id;
@@ -2156,8 +2156,8 @@ NULL NULL 1
---???????÷@??*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varbinary_1000` using koi8r) AS `CONVERT(my_varbinary_1000 USING koi8r)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varbinary_1000` using koi8r) AS `CONVERT(my_varbinary_1000 USING koi8r)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 101 OR select_id IS NULL) order by id;
@@ -2182,8 +2182,8 @@ NULL NULL 1
---???????÷@??*$--
-1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_binary_30` using koi8r) AS `CONVERT(my_binary_30 USING koi8r)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_binary_30` using koi8r) AS `CONVERT(my_binary_30 USING koi8r)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 100 OR select_id IS NULL) order by id;
@@ -2208,8 +2208,8 @@ NULL NULL 1
---????????@??*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varchar_1000` using koi8r) AS `CONVERT(my_varchar_1000 USING koi8r)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varchar_1000` using koi8r) AS `CONVERT(my_varchar_1000 USING koi8r)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 99 OR select_id IS NULL) order by id;
@@ -2234,8 +2234,8 @@ NULL NULL 1
---????????@??*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_char_30` using koi8r) AS `CONVERT(my_char_30 USING koi8r)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_char_30` using koi8r) AS `CONVERT(my_char_30 USING koi8r)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 98 OR select_id IS NULL) order by id;
@@ -2260,8 +2260,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varbinary_1000` using utf8) AS `CONVERT(my_varbinary_1000 USING utf8)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varbinary_1000` using utf8) AS `CONVERT(my_varbinary_1000 USING utf8)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 97 OR select_id IS NULL) order by id;
@@ -2286,8 +2286,8 @@ NULL NULL 1
---äÖüß@µ*$--
-1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_binary_30` using utf8) AS `CONVERT(my_binary_30 USING utf8)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_binary_30` using utf8) AS `CONVERT(my_binary_30 USING utf8)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 96 OR select_id IS NULL) order by id;
@@ -2312,8 +2312,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varchar_1000` using utf8) AS `CONVERT(my_varchar_1000 USING utf8)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varchar_1000` using utf8) AS `CONVERT(my_varchar_1000 USING utf8)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 95 OR select_id IS NULL) order by id;
@@ -2338,8 +2338,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_char_30` using utf8) AS `CONVERT(my_char_30 USING utf8)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_char_30` using utf8) AS `CONVERT(my_char_30 USING utf8)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 94 OR select_id IS NULL) order by id;
@@ -2364,8 +2364,8 @@ NULL NULL 1
2000 2000 4
2005 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as unsigned) AS `CAST(my_year AS UNSIGNED INTEGER)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as unsigned) AS `CAST(my_year AS UNSIGNED INTEGER)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 93 OR select_id IS NULL) order by id;
@@ -2385,34 +2385,22 @@ my_time, id FROM t1_values
WHERE select_id = 92 OR select_id IS NULL order by id;
CAST(my_time AS UNSIGNED INTEGER) my_time id
NULL NULL 1
-18446744073709550778 -838:59:59 2
-838 838:59:59 3
-13 13:00:00 4
-10 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '-838:59:59'
-Warning 1105 Cast to unsigned converted negative integer to it's positive complement
-Warning 1292 Truncated incorrect INTEGER value: '838:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '13:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '10:00:00'
+18446744073701165657 -838:59:59 2
+8385959 838:59:59 3
+130000 13:00:00 4
+100000 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as unsigned) AS `CAST(my_time AS UNSIGNED INTEGER)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as unsigned) AS `CAST(my_time AS UNSIGNED INTEGER)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 92 OR select_id IS NULL) order by id;
CAST(my_time AS UNSIGNED INTEGER) my_time id
NULL NULL 1
-18446744073709550778 -838:59:59 2
-838 838:59:59 3
-13 13:00:00 4
-10 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '-838:59:59'
-Warning 1105 Cast to unsigned converted negative integer to it's positive complement
-Warning 1292 Truncated incorrect INTEGER value: '838:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '13:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '10:00:00'
+18446744073701165657 -838:59:59 2
+8385959 838:59:59 3
+130000 13:00:00 4
+100000 10:00:00 5
DROP VIEW v1;
@@ -2423,34 +2411,22 @@ my_timestamp, id FROM t1_values
WHERE select_id = 91 OR select_id IS NULL order by id;
CAST(my_timestamp AS UNSIGNED INTEGER) my_timestamp id
0 0000-00-00 00:00:00 1
-1970 1970-01-01 03:00:01 2
-2038 2038-01-01 02:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0000-00-00 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '1970-01-01 03:00:01'
-Warning 1292 Truncated incorrect INTEGER value: '2038-01-01 02:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+19700101030001 1970-01-01 03:00:01 2
+20380101025959 2038-01-01 02:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as unsigned) AS `CAST(my_timestamp AS UNSIGNED INTEGER)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as unsigned) AS `CAST(my_timestamp AS UNSIGNED INTEGER)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 91 OR select_id IS NULL) order by id;
CAST(my_timestamp AS UNSIGNED INTEGER) my_timestamp id
0 0000-00-00 00:00:00 1
-1970 1970-01-01 03:00:01 2
-2038 2038-01-01 02:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0000-00-00 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '1970-01-01 03:00:01'
-Warning 1292 Truncated incorrect INTEGER value: '2038-01-01 02:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+19700101030001 1970-01-01 03:00:01 2
+20380101025959 2038-01-01 02:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
DROP VIEW v1;
@@ -2461,32 +2437,22 @@ my_date, id FROM t1_values
WHERE select_id = 90 OR select_id IS NULL order by id;
CAST(my_date AS UNSIGNED INTEGER) my_date id
NULL NULL 1
-1 0001-01-01 2
-9999 9999-12-31 3
-2004 2004-02-29 4
-2005 2005-06-28 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28'
+10101 0001-01-01 2
+99991231 9999-12-31 3
+20040229 2004-02-29 4
+20050628 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as unsigned) AS `CAST(my_date AS UNSIGNED INTEGER)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as unsigned) AS `CAST(my_date AS UNSIGNED INTEGER)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 90 OR select_id IS NULL) order by id;
CAST(my_date AS UNSIGNED INTEGER) my_date id
NULL NULL 1
-1 0001-01-01 2
-9999 9999-12-31 3
-2004 2004-02-29 4
-2005 2005-06-28 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28'
+10101 0001-01-01 2
+99991231 9999-12-31 3
+20040229 2004-02-29 4
+20050628 2005-06-28 5
DROP VIEW v1;
@@ -2497,32 +2463,22 @@ my_datetime, id FROM t1_values
WHERE select_id = 89 OR select_id IS NULL order by id;
CAST(my_datetime AS UNSIGNED INTEGER) my_datetime id
NULL NULL 1
-1 0001-01-01 00:00:00 2
-9999 9999-12-31 23:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+10101000000 0001-01-01 00:00:00 2
+99991231235959 9999-12-31 23:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as unsigned) AS `CAST(my_datetime AS UNSIGNED INTEGER)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as unsigned) AS `CAST(my_datetime AS UNSIGNED INTEGER)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 89 OR select_id IS NULL) order by id;
CAST(my_datetime AS UNSIGNED INTEGER) my_datetime id
NULL NULL 1
-1 0001-01-01 00:00:00 2
-9999 9999-12-31 23:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+10101000000 0001-01-01 00:00:00 2
+99991231235959 9999-12-31 23:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
DROP VIEW v1;
@@ -2542,8 +2498,8 @@ Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
SHOW CREATE VIEW v1;
-View Create View
-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`
+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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 88 OR select_id IS NULL) order by id;
@@ -2572,8 +2528,8 @@ NULL NULL 1
0 0 4
18446744073709551615 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as unsigned) AS `CAST(my_bigint AS UNSIGNED INTEGER)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as unsigned) AS `CAST(my_bigint AS UNSIGNED INTEGER)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 87 OR select_id IS NULL) order by id;
@@ -2603,8 +2559,8 @@ Warning 1292 Truncated incorrect INTEGER value: '<---------1000 characters------
Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$-- '
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as unsigned) AS `CAST(my_varbinary_1000 AS UNSIGNED INTEGER)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 unsigned) AS `CAST(my_varbinary_1000 AS UNSIGNED INTEGER)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 86 OR select_id IS NULL) order by id;
@@ -2640,8 +2596,8 @@ Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$-- '
Warning 1292 Truncated incorrect INTEGER value: '-1'
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as unsigned) AS `CAST(my_binary_30 AS UNSIGNED INTEGER)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 unsigned) AS `CAST(my_binary_30 AS UNSIGNED INTEGER)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 85 OR select_id IS NULL) order by id;
@@ -2677,8 +2633,8 @@ Warning 1292 Truncated incorrect INTEGER value: '<---------1000 characters------
Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$-- '
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as unsigned) AS `CAST(my_varchar_1000 AS UNSIGNED INTEGER)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 unsigned) AS `CAST(my_varchar_1000 AS UNSIGNED INTEGER)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 84 OR select_id IS NULL) order by id;
@@ -2713,8 +2669,8 @@ Warning 1292 Truncated incorrect INTEGER value: '<--------30 characters------->'
Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$--'
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as unsigned) AS `CAST(my_char_30 AS UNSIGNED INTEGER)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 unsigned) AS `CAST(my_char_30 AS UNSIGNED INTEGER)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 83 OR select_id IS NULL) order by id;
@@ -2744,8 +2700,8 @@ NULL NULL 1
2000 2000 4
2005 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as signed) AS `CAST(my_year AS SIGNED INTEGER)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as signed) AS `CAST(my_year AS SIGNED INTEGER)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 82 OR select_id IS NULL) order by id;
@@ -2765,32 +2721,22 @@ my_time, id FROM t1_values
WHERE select_id = 81 OR select_id IS NULL order by id;
CAST(my_time AS SIGNED INTEGER) my_time id
NULL NULL 1
--838 -838:59:59 2
-838 838:59:59 3
-13 13:00:00 4
-10 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '-838:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '838:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '13:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '10:00:00'
+-8385959 -838:59:59 2
+8385959 838:59:59 3
+130000 13:00:00 4
+100000 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as signed) AS `CAST(my_time AS SIGNED INTEGER)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as signed) AS `CAST(my_time AS SIGNED INTEGER)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 81 OR select_id IS NULL) order by id;
CAST(my_time AS SIGNED INTEGER) my_time id
NULL NULL 1
--838 -838:59:59 2
-838 838:59:59 3
-13 13:00:00 4
-10 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '-838:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '838:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '13:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '10:00:00'
+-8385959 -838:59:59 2
+8385959 838:59:59 3
+130000 13:00:00 4
+100000 10:00:00 5
DROP VIEW v1;
@@ -2801,34 +2747,22 @@ my_timestamp, id FROM t1_values
WHERE select_id = 80 OR select_id IS NULL order by id;
CAST(my_timestamp AS SIGNED INTEGER) my_timestamp id
0 0000-00-00 00:00:00 1
-1970 1970-01-01 03:00:01 2
-2038 2038-01-01 02:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0000-00-00 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '1970-01-01 03:00:01'
-Warning 1292 Truncated incorrect INTEGER value: '2038-01-01 02:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+19700101030001 1970-01-01 03:00:01 2
+20380101025959 2038-01-01 02:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as signed) AS `CAST(my_timestamp AS SIGNED INTEGER)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as signed) AS `CAST(my_timestamp AS SIGNED INTEGER)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 80 OR select_id IS NULL) order by id;
CAST(my_timestamp AS SIGNED INTEGER) my_timestamp id
0 0000-00-00 00:00:00 1
-1970 1970-01-01 03:00:01 2
-2038 2038-01-01 02:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0000-00-00 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '1970-01-01 03:00:01'
-Warning 1292 Truncated incorrect INTEGER value: '2038-01-01 02:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+19700101030001 1970-01-01 03:00:01 2
+20380101025959 2038-01-01 02:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
DROP VIEW v1;
@@ -2839,32 +2773,22 @@ my_date, id FROM t1_values
WHERE select_id = 79 OR select_id IS NULL order by id;
CAST(my_date AS SIGNED INTEGER) my_date id
NULL NULL 1
-1 0001-01-01 2
-9999 9999-12-31 3
-2004 2004-02-29 4
-2005 2005-06-28 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28'
+10101 0001-01-01 2
+99991231 9999-12-31 3
+20040229 2004-02-29 4
+20050628 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as signed) AS `CAST(my_date AS SIGNED INTEGER)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as signed) AS `CAST(my_date AS SIGNED INTEGER)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 79 OR select_id IS NULL) order by id;
CAST(my_date AS SIGNED INTEGER) my_date id
NULL NULL 1
-1 0001-01-01 2
-9999 9999-12-31 3
-2004 2004-02-29 4
-2005 2005-06-28 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28'
+10101 0001-01-01 2
+99991231 9999-12-31 3
+20040229 2004-02-29 4
+20050628 2005-06-28 5
DROP VIEW v1;
@@ -2875,32 +2799,22 @@ my_datetime, id FROM t1_values
WHERE select_id = 78 OR select_id IS NULL order by id;
CAST(my_datetime AS SIGNED INTEGER) my_datetime id
NULL NULL 1
-1 0001-01-01 00:00:00 2
-9999 9999-12-31 23:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+10101000000 0001-01-01 00:00:00 2
+99991231235959 9999-12-31 23:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as signed) AS `CAST(my_datetime AS SIGNED INTEGER)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as signed) AS `CAST(my_datetime AS SIGNED INTEGER)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 78 OR select_id IS NULL) order by id;
CAST(my_datetime AS SIGNED INTEGER) my_datetime id
NULL NULL 1
-1 0001-01-01 00:00:00 2
-9999 9999-12-31 23:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+10101000000 0001-01-01 00:00:00 2
+99991231235959 9999-12-31 23:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
DROP VIEW v1;
@@ -2919,8 +2833,8 @@ Warnings:
Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308'
Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as signed) AS `CAST(my_double AS SIGNED INTEGER)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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 signed) AS `CAST(my_double AS SIGNED INTEGER)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 77 OR select_id IS NULL) order by id;
@@ -2943,23 +2857,23 @@ my_decimal, id FROM t1_values
WHERE select_id = 76 OR select_id IS NULL order by id;
CAST(my_decimal AS SIGNED INTEGER) my_decimal id
NULL NULL 1
--10000000000000000 -9999999999999999999999999999999999.999999999999999999999999999999 2
-10000000000000000 9999999999999999999999999999999999.999999999999999999999999999999 3
+-9223372036854775808 -9999999999999999999999999999999999.999999999999999999999999999999 2
+9223372036854775807 9999999999999999999999999999999999.999999999999999999999999999999 3
0 0.000000000000000000000000000000 4
-1 -1.000000000000000000000000000000 5
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
SHOW CREATE VIEW v1;
-View Create View
-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`
+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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 76 OR select_id IS NULL) order by id;
CAST(my_decimal AS SIGNED INTEGER) my_decimal id
NULL NULL 1
--10000000000000000 -9999999999999999999999999999999999.999999999999999999999999999999 2
-10000000000000000 9999999999999999999999999999999999.999999999999999999999999999999 3
+-9223372036854775808 -9999999999999999999999999999999999.999999999999999999999999999999 2
+9223372036854775807 9999999999999999999999999999999999.999999999999999999999999999999 3
0 0.000000000000000000000000000000 4
-1 -1.000000000000000000000000000000 5
Warnings:
@@ -2980,8 +2894,8 @@ NULL NULL 1
0 0 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as signed) AS `CAST(my_bigint AS SIGNED INTEGER)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as signed) AS `CAST(my_bigint AS SIGNED INTEGER)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 75 OR select_id IS NULL) order by id;
@@ -3010,8 +2924,8 @@ Warning 1292 Truncated incorrect INTEGER value: ''
Warning 1292 Truncated incorrect INTEGER value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as signed) AS `CAST(my_varbinary_1000 AS SIGNED INTEGER)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 signed) AS `CAST(my_varbinary_1000 AS SIGNED INTEGER)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 74 OR select_id IS NULL) order by id;
@@ -3045,8 +2959,8 @@ Warning 1292 Truncated incorrect INTEGER value: '<--------30 characters------->'
Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$-- '
Warning 1292 Truncated incorrect INTEGER value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as signed) AS `CAST(my_binary_30 AS SIGNED INTEGER)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 signed) AS `CAST(my_binary_30 AS SIGNED INTEGER)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 73 OR select_id IS NULL) order by id;
@@ -3080,8 +2994,8 @@ Warning 1292 Truncated incorrect INTEGER value: ''
Warning 1292 Truncated incorrect INTEGER value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as signed) AS `CAST(my_varchar_1000 AS SIGNED INTEGER)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 signed) AS `CAST(my_varchar_1000 AS SIGNED INTEGER)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 72 OR select_id IS NULL) order by id;
@@ -3114,8 +3028,8 @@ Warning 1292 Truncated incorrect INTEGER value: ''
Warning 1292 Truncated incorrect INTEGER value: '<--------30 characters------->'
Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$--'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as signed) AS `CAST(my_char_30 AS SIGNED INTEGER)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 signed) AS `CAST(my_char_30 AS SIGNED INTEGER)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 71 OR select_id IS NULL) order by id;
@@ -3132,287 +3046,255 @@ Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$--'
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_year AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_year AS DECIMAL(37,2)),
my_year, id FROM t1_values;
-SELECT CAST(my_year AS DECIMAL),
+SELECT CAST(my_year AS DECIMAL(37,2)),
my_year, id FROM t1_values
WHERE select_id = 70 OR select_id IS NULL order by id;
-CAST(my_year AS DECIMAL) my_year id
+CAST(my_year AS DECIMAL(37,2)) my_year id
NULL NULL 1
-1901 1901 2
-2155 2155 3
-2000 2000 4
-2005 2005 5
+1901.00 1901 2
+2155.00 2155 3
+2000.00 2000 4
+2005.00 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as decimal) AS `CAST(my_year AS DECIMAL)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as decimal(37,2)) AS `CAST(my_year AS DECIMAL(37,2))`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 70 OR select_id IS NULL) order by id;
-CAST(my_year AS DECIMAL) my_year id
+CAST(my_year AS DECIMAL(37,2)) my_year id
NULL NULL 1
-1901 1901 2
-2155 2155 3
-2000 2000 4
-2005 2005 5
+1901.00 1901 2
+2155.00 2155 3
+2000.00 2000 4
+2005.00 2005 5
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_time AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_time AS DECIMAL(37,2)),
my_time, id FROM t1_values;
-SELECT CAST(my_time AS DECIMAL),
+SELECT CAST(my_time AS DECIMAL(37,2)),
my_time, id FROM t1_values
WHERE select_id = 69 OR select_id IS NULL order by id;
-CAST(my_time AS DECIMAL) my_time id
+CAST(my_time AS DECIMAL(37,2)) my_time id
NULL NULL 1
--8385959 -838:59:59 2
-8385959 838:59:59 3
-130000 13:00:00 4
-100000 10:00:00 5
+-8385959.00 -838:59:59 2
+8385959.00 838:59:59 3
+130000.00 13:00:00 4
+100000.00 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as decimal) AS `CAST(my_time AS DECIMAL)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as decimal(37,2)) AS `CAST(my_time AS DECIMAL(37,2))`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 69 OR select_id IS NULL) order by id;
-CAST(my_time AS DECIMAL) my_time id
+CAST(my_time AS DECIMAL(37,2)) my_time id
NULL NULL 1
--8385959 -838:59:59 2
-8385959 838:59:59 3
-130000 13:00:00 4
-100000 10:00:00 5
+-8385959.00 -838:59:59 2
+8385959.00 838:59:59 3
+130000.00 13:00:00 4
+100000.00 10:00:00 5
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_timestamp AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_timestamp AS DECIMAL(37,2)),
my_timestamp, id FROM t1_values;
-SELECT CAST(my_timestamp AS DECIMAL),
+SELECT CAST(my_timestamp AS DECIMAL(37,2)),
my_timestamp, id FROM t1_values
WHERE select_id = 68 OR select_id IS NULL order by id;
-CAST(my_timestamp AS DECIMAL) my_timestamp id
-0 0000-00-00 00:00:00 1
-9999999999 1970-01-01 03:00:01 2
-9999999999 2038-01-01 02:59:59 3
-9999999999 2004-02-29 23:59:59 4
-9999999999 2005-06-28 10:00:00 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
+CAST(my_timestamp AS DECIMAL(37,2)) my_timestamp id
+0.00 0000-00-00 00:00:00 1
+19700101030001.00 1970-01-01 03:00:01 2
+20380101025959.00 2038-01-01 02:59:59 3
+20040229235959.00 2004-02-29 23:59:59 4
+20050628100000.00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as decimal) AS `CAST(my_timestamp AS DECIMAL)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as decimal(37,2)) AS `CAST(my_timestamp AS DECIMAL(37,2))`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 68 OR select_id IS NULL) order by id;
-CAST(my_timestamp AS DECIMAL) my_timestamp id
-0 0000-00-00 00:00:00 1
-9999999999 1970-01-01 03:00:01 2
-9999999999 2038-01-01 02:59:59 3
-9999999999 2004-02-29 23:59:59 4
-9999999999 2005-06-28 10:00:00 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
+CAST(my_timestamp AS DECIMAL(37,2)) my_timestamp id
+0.00 0000-00-00 00:00:00 1
+19700101030001.00 1970-01-01 03:00:01 2
+20380101025959.00 2038-01-01 02:59:59 3
+20040229235959.00 2004-02-29 23:59:59 4
+20050628100000.00 2005-06-28 10:00:00 5
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_date AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_date AS DECIMAL(37,2)),
my_date, id FROM t1_values;
-SELECT CAST(my_date AS DECIMAL),
+SELECT CAST(my_date AS DECIMAL(37,2)),
my_date, id FROM t1_values
WHERE select_id = 67 OR select_id IS NULL order by id;
-CAST(my_date AS DECIMAL) my_date id
+CAST(my_date AS DECIMAL(37,2)) my_date id
NULL NULL 1
-10101 0001-01-01 2
-99991231 9999-12-31 3
-20040229 2004-02-29 4
-20050628 2005-06-28 5
+10101.00 0001-01-01 2
+99991231.00 9999-12-31 3
+20040229.00 2004-02-29 4
+20050628.00 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as decimal) AS `CAST(my_date AS DECIMAL)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as decimal(37,2)) AS `CAST(my_date AS DECIMAL(37,2))`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 67 OR select_id IS NULL) order by id;
-CAST(my_date AS DECIMAL) my_date id
+CAST(my_date AS DECIMAL(37,2)) my_date id
NULL NULL 1
-10101 0001-01-01 2
-99991231 9999-12-31 3
-20040229 2004-02-29 4
-20050628 2005-06-28 5
+10101.00 0001-01-01 2
+99991231.00 9999-12-31 3
+20040229.00 2004-02-29 4
+20050628.00 2005-06-28 5
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_datetime AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_datetime AS DECIMAL(37,2)),
my_datetime, id FROM t1_values;
-SELECT CAST(my_datetime AS DECIMAL),
+SELECT CAST(my_datetime AS DECIMAL(37,2)),
my_datetime, id FROM t1_values
WHERE select_id = 66 OR select_id IS NULL order by id;
-CAST(my_datetime AS DECIMAL) my_datetime id
+CAST(my_datetime AS DECIMAL(37,2)) my_datetime id
NULL NULL 1
-9999999999 0001-01-01 00:00:00 2
-9999999999 9999-12-31 23:59:59 3
-9999999999 2004-02-29 23:59:59 4
-9999999999 2005-06-28 10:00:00 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
+10101000000.00 0001-01-01 00:00:00 2
+99991231235959.00 9999-12-31 23:59:59 3
+20040229235959.00 2004-02-29 23:59:59 4
+20050628100000.00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as decimal) AS `CAST(my_datetime AS DECIMAL)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as decimal(37,2)) AS `CAST(my_datetime AS DECIMAL(37,2))`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 66 OR select_id IS NULL) order by id;
-CAST(my_datetime AS DECIMAL) my_datetime id
+CAST(my_datetime AS DECIMAL(37,2)) my_datetime id
NULL NULL 1
-9999999999 0001-01-01 00:00:00 2
-9999999999 9999-12-31 23:59:59 3
-9999999999 2004-02-29 23:59:59 4
-9999999999 2005-06-28 10:00:00 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
+10101000000.00 0001-01-01 00:00:00 2
+99991231235959.00 9999-12-31 23:59:59 3
+20040229235959.00 2004-02-29 23:59:59 4
+20050628100000.00 2005-06-28 10:00:00 5
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_double AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_double AS DECIMAL(37,2)),
my_double, id FROM t1_values;
-SELECT CAST(my_double AS DECIMAL),
+SELECT CAST(my_double AS DECIMAL(37,2)),
my_double, id FROM t1_values
WHERE select_id = 65 OR select_id IS NULL order by id;
-CAST(my_double AS DECIMAL) my_double id
+CAST(my_double AS DECIMAL(37,2)) my_double id
NULL NULL 1
--9999999999 -1.7976931348623e+308 2
-9999999999 1.7976931348623e+308 3
-0 0 4
--1 -1 5
--3333 -3333.3333 30
+-99999999999999999999999999999999999.99 -1.7976931348623e+308 2
+99999999999999999999999999999999999.99 1.7976931348623e+308 3
+0.00 0 4
+-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)' at row 1
+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)' at row 1
+Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as decimal) AS `CAST(my_double AS DECIMAL)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 65 OR select_id IS NULL) order by id;
-CAST(my_double AS DECIMAL) my_double id
+CAST(my_double AS DECIMAL(37,2)) my_double id
NULL NULL 1
--9999999999 -1.7976931348623e+308 2
-9999999999 1.7976931348623e+308 3
-0 0 4
--1 -1 5
--3333 -3333.3333 30
+-99999999999999999999999999999999999.99 -1.7976931348623e+308 2
+99999999999999999999999999999999999.99 1.7976931348623e+308 3
+0.00 0 4
+-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)' at row 1
+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)' at row 1
+Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_decimal AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_decimal AS DECIMAL(37,2)),
my_decimal, id FROM t1_values;
-SELECT CAST(my_decimal AS DECIMAL),
+SELECT CAST(my_decimal AS DECIMAL(37,2)),
my_decimal, id FROM t1_values
WHERE select_id = 64 OR select_id IS NULL order by id;
-CAST(my_decimal AS DECIMAL) my_decimal id
+CAST(my_decimal AS DECIMAL(37,2)) my_decimal id
NULL NULL 1
--9999999999 -9999999999999999999999999999999999.999999999999999999999999999999 2
-9999999999 9999999999999999999999999999999999.999999999999999999999999999999 3
-0 0.000000000000000000000000000000 4
--1 -1.000000000000000000000000000000 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_decimal AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_decimal AS DECIMAL)' at row 1
+-10000000000000000000000000000000000.00 -9999999999999999999999999999999999.999999999999999999999999999999 2
+10000000000000000000000000000000000.00 9999999999999999999999999999999999.999999999999999999999999999999 3
+0.00 0.000000000000000000000000000000 4
+-1.00 -1.000000000000000000000000000000 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as decimal) AS `CAST(my_decimal AS DECIMAL)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values`
+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 decimal(37,2)) AS `CAST(my_decimal AS DECIMAL(37,2))`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 64 OR select_id IS NULL) order by id;
-CAST(my_decimal AS DECIMAL) my_decimal id
+CAST(my_decimal AS DECIMAL(37,2)) my_decimal id
NULL NULL 1
--9999999999 -9999999999999999999999999999999999.999999999999999999999999999999 2
-9999999999 9999999999999999999999999999999999.999999999999999999999999999999 3
-0 0.000000000000000000000000000000 4
--1 -1.000000000000000000000000000000 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_decimal AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_decimal AS DECIMAL)' at row 1
+-10000000000000000000000000000000000.00 -9999999999999999999999999999999999.999999999999999999999999999999 2
+10000000000000000000000000000000000.00 9999999999999999999999999999999999.999999999999999999999999999999 3
+0.00 0.000000000000000000000000000000 4
+-1.00 -1.000000000000000000000000000000 5
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_bigint AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_bigint AS DECIMAL(37,2)),
my_bigint, id FROM t1_values;
-SELECT CAST(my_bigint AS DECIMAL),
+SELECT CAST(my_bigint AS DECIMAL(37,2)),
my_bigint, id FROM t1_values
WHERE select_id = 63 OR select_id IS NULL order by id;
-CAST(my_bigint AS DECIMAL) my_bigint id
+CAST(my_bigint AS DECIMAL(37,2)) my_bigint id
NULL NULL 1
--9999999999 -9223372036854775808 2
-9999999999 9223372036854775807 3
-0 0 4
--1 -1 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_bigint AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_bigint AS DECIMAL)' at row 1
+-9223372036854775808.00 -9223372036854775808 2
+9223372036854775807.00 9223372036854775807 3
+0.00 0 4
+-1.00 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as decimal) AS `CAST(my_bigint AS DECIMAL)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as decimal(37,2)) AS `CAST(my_bigint AS DECIMAL(37,2))`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 63 OR select_id IS NULL) order by id;
-CAST(my_bigint AS DECIMAL) my_bigint id
+CAST(my_bigint AS DECIMAL(37,2)) my_bigint id
NULL NULL 1
--9999999999 -9223372036854775808 2
-9999999999 9223372036854775807 3
-0 0 4
--1 -1 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_bigint AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_bigint AS DECIMAL)' at row 1
+-9223372036854775808.00 -9223372036854775808 2
+9223372036854775807.00 9223372036854775807 3
+0.00 0 4
+-1.00 -1 5
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_varbinary_1000 AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_varbinary_1000 AS DECIMAL(37,2)),
my_varbinary_1000, id FROM t1_values;
-SELECT CAST(my_varbinary_1000 AS DECIMAL),
+SELECT CAST(my_varbinary_1000 AS DECIMAL(37,2)),
my_varbinary_1000, id FROM t1_values
WHERE select_id = 62 OR select_id IS NULL order by id;
-CAST(my_varbinary_1000 AS DECIMAL) my_varbinary_1000 id
+CAST(my_varbinary_1000 AS DECIMAL(37,2)) my_varbinary_1000 id
NULL NULL 1
-0 2
-0 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
--3333 -3333.3333 29
+0.00 2
+0.00 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
+0.00 ---äÖüß@µ*$-- 4
+-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
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as decimal) AS `CAST(my_varbinary_1000 AS DECIMAL)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 62 OR select_id IS NULL) order by id;
-CAST(my_varbinary_1000 AS DECIMAL) my_varbinary_1000 id
+CAST(my_varbinary_1000 AS DECIMAL(37,2)) my_varbinary_1000 id
NULL NULL 1
-0 2
-0 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
--3333 -3333.3333 29
+0.00 2
+0.00 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
+0.00 ---äÖüß@µ*$-- 4
+-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
@@ -3420,18 +3302,18 @@ Error 1366 Incorrect decimal value: '' for column '' at row -1
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_binary_30 AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_binary_30 AS DECIMAL(37,2)),
my_binary_30, id FROM t1_values;
-SELECT CAST(my_binary_30 AS DECIMAL),
+SELECT CAST(my_binary_30 AS DECIMAL(37,2)),
my_binary_30, id FROM t1_values
WHERE select_id = 61 OR select_id IS NULL order by id;
-CAST(my_binary_30 AS DECIMAL) my_binary_30 id
+CAST(my_binary_30 AS DECIMAL(37,2)) my_binary_30 id
NULL NULL 1
-0
-0 <--------30 characters-------> 3
-0 ---äÖüß@µ*$--
--1 -1
--3333 -3333.3333
+0.00
+0.00 <--------30 characters-------> 3
+0.00 ---äÖüß@µ*$--
+-1.00 -1
+-3333.33 -3333.3333
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ''
@@ -3442,18 +3324,18 @@ Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
Warning 1292 Truncated incorrect DECIMAL value: '-1'
Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as decimal) AS `CAST(my_binary_30 AS DECIMAL)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 61 OR select_id IS NULL) order by id;
-CAST(my_binary_30 AS DECIMAL) my_binary_30 id
+CAST(my_binary_30 AS DECIMAL(37,2)) my_binary_30 id
NULL NULL 1
-0
-0 <--------30 characters-------> 3
-0 ---äÖüß@µ*$--
--1 -1
--3333 -3333.3333
+0.00
+0.00 <--------30 characters-------> 3
+0.00 ---äÖüß@µ*$--
+-1.00 -1
+-3333.33 -3333.3333
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ''
@@ -3466,35 +3348,35 @@ Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333'
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_varchar_1000 AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_varchar_1000 AS DECIMAL(37,2)),
my_varchar_1000, id FROM t1_values;
-SELECT CAST(my_varchar_1000 AS DECIMAL),
+SELECT CAST(my_varchar_1000 AS DECIMAL(37,2)),
my_varchar_1000, id FROM t1_values
WHERE select_id = 60 OR select_id IS NULL order by id;
-CAST(my_varchar_1000 AS DECIMAL) my_varchar_1000 id
+CAST(my_varchar_1000 AS DECIMAL(37,2)) my_varchar_1000 id
NULL NULL 1
-0 2
-0 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
--3333 -3333.3333 27
+0.00 2
+0.00 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
+0.00 ---äÖüß@µ*$-- 4
+-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
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as decimal) AS `CAST(my_varchar_1000 AS DECIMAL)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 60 OR select_id IS NULL) order by id;
-CAST(my_varchar_1000 AS DECIMAL) my_varchar_1000 id
+CAST(my_varchar_1000 AS DECIMAL(37,2)) my_varchar_1000 id
NULL NULL 1
-0 2
-0 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
--3333 -3333.3333 27
+0.00 2
+0.00 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
+0.00 ---äÖüß@µ*$-- 4
+-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
@@ -3502,18 +3384,18 @@ Error 1366 Incorrect decimal value: '' for column '' at row -1
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_char_30 AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_char_30 AS DECIMAL(37,2)),
my_char_30, id FROM t1_values;
-SELECT CAST(my_char_30 AS DECIMAL),
+SELECT CAST(my_char_30 AS DECIMAL(37,2)),
my_char_30, id FROM t1_values
WHERE select_id = 59 OR select_id IS NULL order by id;
-CAST(my_char_30 AS DECIMAL) my_char_30 id
+CAST(my_char_30 AS DECIMAL(37,2)) my_char_30 id
NULL NULL 1
-0 2
-0 <--------30 characters-------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
--3333 -3333.3333 26
+0.00 2
+0.00 <--------30 characters-------> 3
+0.00 ---äÖüß@µ*$-- 4
+-1.00 -1 5
+-3333.33 -3333.3333 26
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' '
@@ -3522,18 +3404,18 @@ Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as decimal) AS `CAST(my_char_30 AS DECIMAL)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 59 OR select_id IS NULL) order by id;
-CAST(my_char_30 AS DECIMAL) my_char_30 id
+CAST(my_char_30 AS DECIMAL(37,2)) my_char_30 id
NULL NULL 1
-0 2
-0 <--------30 characters-------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
--3333 -3333.3333 26
+0.00 2
+0.00 <--------30 characters-------> 3
+0.00 ---äÖüß@µ*$-- 4
+-1.00 -1 5
+-3333.33 -3333.3333 26
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' '
@@ -3556,8 +3438,8 @@ NULL NULL 1
00:20:00 2000 4
00:20:05 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as time) AS `CAST(my_year AS TIME)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as time) AS `CAST(my_year AS TIME)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 58 OR select_id IS NULL) order by id;
@@ -3582,8 +3464,8 @@ NULL NULL 1
13:00:00 13:00:00 4
10:00:00 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as time) AS `CAST(my_time AS TIME)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as time) AS `CAST(my_time AS TIME)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 57 OR select_id IS NULL) order by id;
@@ -3608,8 +3490,8 @@ CAST(my_timestamp AS TIME) my_timestamp id
23:59:59 2004-02-29 23:59:59 4
10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as time) AS `CAST(my_timestamp AS TIME)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as time) AS `CAST(my_timestamp AS TIME)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 56 OR select_id IS NULL) order by id;
@@ -3634,8 +3516,8 @@ NULL NULL 1
00:00:00 2004-02-29 4
00:00:00 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as time) AS `CAST(my_date AS TIME)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as time) AS `CAST(my_date AS TIME)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 55 OR select_id IS NULL) order by id;
@@ -3660,8 +3542,8 @@ NULL NULL 1
23:59:59 2004-02-29 23:59:59 4
10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as time) AS `CAST(my_datetime AS TIME)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as time) AS `CAST(my_datetime AS TIME)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 54 OR select_id IS NULL) order by id;
@@ -3690,8 +3572,8 @@ Warnings:
Warning 1292 Truncated incorrect time value: '-1.7976931348623e+308'
Warning 1292 Truncated incorrect time value: '1.7976931348623e+308'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as time) AS `CAST(my_double AS TIME)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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 time) AS `CAST(my_double AS TIME)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 53 OR select_id IS NULL) order by id;
@@ -3724,8 +3606,8 @@ Warnings:
Warning 1292 Truncated incorrect time value: '-9223372036854775808'
Warning 1292 Truncated incorrect time value: '9223372036854775807'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as time) AS `CAST(my_bigint AS TIME)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as time) AS `CAST(my_bigint AS TIME)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 52 OR select_id IS NULL) order by id;
@@ -3759,8 +3641,8 @@ Warning 1292 Truncated incorrect time value: ''
Warning 1292 Truncated incorrect time value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
Warning 1292 Truncated incorrect time value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as time) AS `CAST(my_varbinary_1000 AS TIME)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 time) AS `CAST(my_varbinary_1000 AS TIME)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 51 OR select_id IS NULL) order by id;
@@ -3797,8 +3679,8 @@ Warning 1292 Truncated incorrect time value: ' ---äÖüß@µ*$-- '
Warning 1292 Truncated incorrect time value: '-1'
Warning 1292 Truncated incorrect time value: '1 17:58'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as time) AS `CAST(my_binary_30 AS TIME)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 time) AS `CAST(my_binary_30 AS TIME)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 50 OR select_id IS NULL) order by id;
@@ -3835,8 +3717,8 @@ Warning 1292 Truncated incorrect time value: ''
Warning 1292 Truncated incorrect time value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
Warning 1292 Truncated incorrect time value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as time) AS `CAST(my_varchar_1000 AS TIME)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 time) AS `CAST(my_varchar_1000 AS TIME)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 49 OR select_id IS NULL) order by id;
@@ -3871,8 +3753,8 @@ Warning 1292 Truncated incorrect time value: ''
Warning 1292 Truncated incorrect time value: '<--------30 characters------->'
Warning 1292 Truncated incorrect time value: ' ---äÖüß@µ*$--'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as time) AS `CAST(my_char_30 AS TIME)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 time) AS `CAST(my_char_30 AS TIME)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 48 OR select_id IS NULL) order by id;
@@ -3907,8 +3789,8 @@ Warning 1292 Incorrect datetime value: '2155'
Warning 1292 Incorrect datetime value: '2000'
Warning 1292 Incorrect datetime value: '2005'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as datetime) AS `CAST(my_year AS DATETIME)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as datetime) AS `CAST(my_year AS DATETIME)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 47 OR select_id IS NULL) order by id;
@@ -3941,8 +3823,8 @@ Warnings:
Warning 1292 Incorrect datetime value: '0000-00-00 838:59:59'
Warning 1292 Incorrect datetime value: '0000-00-00 838:59:59'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as datetime) AS `CAST(my_time AS DATETIME)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as datetime) AS `CAST(my_time AS DATETIME)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 46 OR select_id IS NULL) order by id;
@@ -3970,8 +3852,8 @@ CAST(my_timestamp AS DATETIME) my_timestamp id
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as datetime) AS `CAST(my_timestamp AS DATETIME)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as datetime) AS `CAST(my_timestamp AS DATETIME)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 45 OR select_id IS NULL) order by id;
@@ -3996,8 +3878,8 @@ NULL NULL 1
2004-02-29 00:00:00 2004-02-29 4
2005-06-28 00:00:00 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as datetime) AS `CAST(my_date AS DATETIME)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as datetime) AS `CAST(my_date AS DATETIME)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 44 OR select_id IS NULL) order by id;
@@ -4022,8 +3904,8 @@ NULL NULL 1
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as datetime) AS `CAST(my_datetime AS DATETIME)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as datetime) AS `CAST(my_datetime AS DATETIME)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 43 OR select_id IS NULL) order by id;
@@ -4055,8 +3937,8 @@ Warning 1292 Incorrect datetime value: '0'
Warning 1292 Incorrect datetime value: '-1'
Warning 1292 Incorrect datetime value: '200506271758'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as datetime) AS `CAST(my_double AS DATETIME)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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 datetime) AS `CAST(my_double AS DATETIME)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 42 OR select_id IS NULL) order by id;
@@ -4095,8 +3977,8 @@ Warning 1292 Incorrect datetime value: '0'
Warning 1292 Incorrect datetime value: '-1'
Warning 1292 Incorrect datetime value: '200506271758'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as datetime) AS `CAST(my_bigint AS DATETIME)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as datetime) AS `CAST(my_bigint AS DATETIME)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 41 OR select_id IS NULL) order by id;
@@ -4134,8 +4016,8 @@ Warning 1292 Incorrect datetime value: '<---------1000 characters---------------
Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as datetime) AS `CAST(my_varbinary_1000 AS DATETIME)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 datetime) AS `CAST(my_varbinary_1000 AS DATETIME)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 40 OR select_id IS NULL) order by id;
@@ -4173,8 +4055,8 @@ Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
Warning 1292 Incorrect datetime value: '-1'
Warning 1292 Truncated incorrect datetime value: '2005-06-27 17:58'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as datetime) AS `CAST(my_binary_30 AS DATETIME)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 datetime) AS `CAST(my_binary_30 AS DATETIME)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 39 OR select_id IS NULL) order by id;
@@ -4212,8 +4094,8 @@ Warning 1292 Incorrect datetime value: '<---------1000 characters---------------
Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as datetime) AS `CAST(my_varchar_1000 AS DATETIME)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 datetime) AS `CAST(my_varchar_1000 AS DATETIME)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 38 OR select_id IS NULL) order by id;
@@ -4250,8 +4132,8 @@ Warning 1292 Incorrect datetime value: '<--------30 characters------->'
Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$--'
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as datetime) AS `CAST(my_char_30 AS DATETIME)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 datetime) AS `CAST(my_char_30 AS DATETIME)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 37 OR select_id IS NULL) order by id;
@@ -4287,8 +4169,8 @@ Warning 1292 Incorrect datetime value: '2155'
Warning 1292 Incorrect datetime value: '2000'
Warning 1292 Incorrect datetime value: '2005'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as date) AS `CAST(my_year AS DATE)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as date) AS `CAST(my_year AS DATE)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 36 OR select_id IS NULL) order by id;
@@ -4318,8 +4200,8 @@ NULL NULL 1
0000-00-00 13:00:00 4
0000-00-00 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as date) AS `CAST(my_time AS DATE)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as date) AS `CAST(my_time AS DATE)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 35 OR select_id IS NULL) order by id;
@@ -4344,8 +4226,8 @@ CAST(my_timestamp AS DATE) my_timestamp id
2004-02-29 2004-02-29 23:59:59 4
2005-06-28 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as date) AS `CAST(my_timestamp AS DATE)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as date) AS `CAST(my_timestamp AS DATE)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 34 OR select_id IS NULL) order by id;
@@ -4370,8 +4252,8 @@ NULL NULL 1
2004-02-29 2004-02-29 4
2005-06-28 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as date) AS `CAST(my_date AS DATE)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as date) AS `CAST(my_date AS DATE)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 33 OR select_id IS NULL) order by id;
@@ -4396,8 +4278,8 @@ NULL NULL 1
2004-02-29 2004-02-29 23:59:59 4
2005-06-28 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as date) AS `CAST(my_datetime AS DATE)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as date) AS `CAST(my_datetime AS DATE)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 32 OR select_id IS NULL) order by id;
@@ -4428,8 +4310,8 @@ Warning 1292 Incorrect datetime value: '1.7976931348623e+308'
Warning 1292 Incorrect datetime value: '0'
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as date) AS `CAST(my_double AS DATE)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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 date) AS `CAST(my_double AS DATE)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 31 OR select_id IS NULL) order by id;
@@ -4466,8 +4348,8 @@ Warning 1292 Incorrect datetime value: '9223372036854775807'
Warning 1292 Incorrect datetime value: '0'
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as date) AS `CAST(my_bigint AS DATE)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as date) AS `CAST(my_bigint AS DATE)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 30 OR select_id IS NULL) order by id;
@@ -4504,8 +4386,8 @@ Warning 1292 Incorrect datetime value: '<---------1000 characters---------------
Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as date) AS `CAST(my_varbinary_1000 AS DATE)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 date) AS `CAST(my_varbinary_1000 AS DATE)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 29 OR select_id IS NULL) order by id;
@@ -4543,8 +4425,8 @@ Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
Warning 1292 Incorrect datetime value: '-1'
Warning 1292 Truncated incorrect date value: '2005-06-27'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as date) AS `CAST(my_binary_30 AS DATE)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 date) AS `CAST(my_binary_30 AS DATE)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 28 OR select_id IS NULL) order by id;
@@ -4582,8 +4464,8 @@ Warning 1292 Incorrect datetime value: '<---------1000 characters---------------
Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as date) AS `CAST(my_varchar_1000 AS DATE)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 date) AS `CAST(my_varchar_1000 AS DATE)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 27 OR select_id IS NULL) order by id;
@@ -4620,8 +4502,8 @@ Warning 1292 Incorrect datetime value: '<--------30 characters------->'
Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$--'
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as date) AS `CAST(my_char_30 AS DATE)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 date) AS `CAST(my_char_30 AS DATE)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 26 OR select_id IS NULL) order by id;
@@ -4652,8 +4534,8 @@ NULL NULL 1
2000 2000 4
2005 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as char charset latin1) AS `CAST(my_year AS CHAR)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as char charset latin1) AS `CAST(my_year AS CHAR)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 25 OR select_id IS NULL) order by id;
@@ -4678,8 +4560,8 @@ NULL NULL 1
13:00:00 13:00:00 4
10:00:00 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as char charset latin1) AS `CAST(my_time AS CHAR)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as char charset latin1) AS `CAST(my_time AS CHAR)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 24 OR select_id IS NULL) order by id;
@@ -4704,8 +4586,8 @@ CAST(my_timestamp AS CHAR) my_timestamp id
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as char charset latin1) AS `CAST(my_timestamp AS CHAR)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as char charset latin1) AS `CAST(my_timestamp AS CHAR)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 23 OR select_id IS NULL) order by id;
@@ -4730,8 +4612,8 @@ NULL NULL 1
2004-02-29 2004-02-29 4
2005-06-28 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as char charset latin1) AS `CAST(my_date AS CHAR)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as char charset latin1) AS `CAST(my_date AS CHAR)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 22 OR select_id IS NULL) order by id;
@@ -4756,8 +4638,8 @@ NULL NULL 1
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as char charset latin1) AS `CAST(my_datetime AS CHAR)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as char charset latin1) AS `CAST(my_datetime AS CHAR)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 21 OR select_id IS NULL) order by id;
@@ -4782,8 +4664,8 @@ NULL NULL 1
0 0 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as char charset latin1) AS `CAST(my_double AS CHAR)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset latin1) AS `CAST(my_double AS CHAR)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 20 OR select_id IS NULL) order by id;
@@ -4808,8 +4690,8 @@ NULL NULL 1
0.000000000000000000000000000000 0.000000000000000000000000000000 4
-1.000000000000000000000000000000 -1.000000000000000000000000000000 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as char charset latin1) AS `CAST(my_decimal AS CHAR)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset latin1) AS `CAST(my_decimal AS CHAR)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 19 OR select_id IS NULL) order by id;
@@ -4834,8 +4716,8 @@ NULL NULL 1
0 0 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as char charset latin1) AS `CAST(my_bigint AS CHAR)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as char charset latin1) AS `CAST(my_bigint AS CHAR)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 18 OR select_id IS NULL) order by id;
@@ -4860,8 +4742,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as char charset latin1) AS `CAST(my_varbinary_1000 AS CHAR)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset latin1) AS `CAST(my_varbinary_1000 AS CHAR)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 17 OR select_id IS NULL) order by id;
@@ -4886,8 +4768,8 @@ NULL NULL 1
---äÖüß@µ*$--
-1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as char charset latin1) AS `CAST(my_binary_30 AS CHAR)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset latin1) AS `CAST(my_binary_30 AS CHAR)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 16 OR select_id IS NULL) order by id;
@@ -4912,8 +4794,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as char charset latin1) AS `CAST(my_varchar_1000 AS CHAR)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset latin1) AS `CAST(my_varchar_1000 AS CHAR)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 15 OR select_id IS NULL) order by id;
@@ -4938,8 +4820,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as char charset latin1) AS `CAST(my_char_30 AS CHAR)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset latin1) AS `CAST(my_char_30 AS CHAR)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 14 OR select_id IS NULL) order by id;
@@ -4964,8 +4846,8 @@ NULL NULL 1
2000 2000 4
2005 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as char charset binary) AS `CAST(my_year AS BINARY)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as char charset binary) AS `CAST(my_year AS BINARY)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 13 OR select_id IS NULL) order by id;
@@ -4990,8 +4872,8 @@ NULL NULL 1
13:00:00 13:00:00 4
10:00:00 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as char charset binary) AS `CAST(my_time AS BINARY)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as char charset binary) AS `CAST(my_time AS BINARY)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 12 OR select_id IS NULL) order by id;
@@ -5016,8 +4898,8 @@ CAST(my_timestamp AS BINARY) my_timestamp id
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as char charset binary) AS `CAST(my_timestamp AS BINARY)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as char charset binary) AS `CAST(my_timestamp AS BINARY)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 11 OR select_id IS NULL) order by id;
@@ -5042,8 +4924,8 @@ NULL NULL 1
2004-02-29 2004-02-29 4
2005-06-28 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as char charset binary) AS `CAST(my_date AS BINARY)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as char charset binary) AS `CAST(my_date AS BINARY)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 10 OR select_id IS NULL) order by id;
@@ -5068,8 +4950,8 @@ NULL NULL 1
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as char charset binary) AS `CAST(my_datetime AS BINARY)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as char charset binary) AS `CAST(my_datetime AS BINARY)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 9 OR select_id IS NULL) order by id;
@@ -5094,8 +4976,8 @@ NULL NULL 1
0 0 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as char charset binary) AS `CAST(my_double AS BINARY)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset binary) AS `CAST(my_double AS BINARY)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 8 OR select_id IS NULL) order by id;
@@ -5120,8 +5002,8 @@ NULL NULL 1
0.000000000000000000000000000000 0.000000000000000000000000000000 4
-1.000000000000000000000000000000 -1.000000000000000000000000000000 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as char charset binary) AS `CAST(my_decimal AS BINARY)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset binary) AS `CAST(my_decimal AS BINARY)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 7 OR select_id IS NULL) order by id;
@@ -5146,8 +5028,8 @@ NULL NULL 1
0 0 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as char charset binary) AS `CAST(my_bigint AS BINARY)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as char charset binary) AS `CAST(my_bigint AS BINARY)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 6 OR select_id IS NULL) order by id;
@@ -5172,8 +5054,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as char charset binary) AS `CAST(my_varbinary_1000 AS BINARY)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset binary) AS `CAST(my_varbinary_1000 AS BINARY)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 5 OR select_id IS NULL) order by id;
@@ -5198,8 +5080,8 @@ NULL NULL 1
---äÖüß@µ*$--
-1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as char charset binary) AS `CAST(my_binary_30 AS BINARY)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset binary) AS `CAST(my_binary_30 AS BINARY)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 4 OR select_id IS NULL) order by id;
@@ -5224,8 +5106,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as char charset binary) AS `CAST(my_varchar_1000 AS BINARY)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset binary) AS `CAST(my_varchar_1000 AS BINARY)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 3 OR select_id IS NULL) order by id;
@@ -5250,8 +5132,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as char charset binary) AS `CAST(my_char_30 AS BINARY)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset binary) AS `CAST(my_char_30 AS BINARY)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 2 OR select_id IS NULL) order by id;
@@ -5276,8 +5158,8 @@ NULL -1 5
2 4 6
NULL -25 7
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sqrt(`t1_values`.`my_bigint`) AS `sqrt(my_bigint)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sqrt(`t1_values`.`my_bigint`) AS `sqrt(my_bigint)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 1 OR select_id IS NULL) order by id;
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 b314b6c7f1a..b314b6c7f1a 100644..100755
--- a/mysql-test/suite/funcs_1/r/myisam_storedproc_02.result
+++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_02.result
diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc_03.result b/mysql-test/suite/funcs_1/r/myisam_storedproc_03.result
index e20c32967e9..e20c32967e9 100644..100755
--- a/mysql-test/suite/funcs_1/r/myisam_storedproc_03.result
+++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_03.result
diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result b/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result
index 11b1d3873b3..3a9c437cfc3 100644
--- a/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result
+++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result
@@ -81,6 +81,7 @@ BEGIN
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
END//
ERROR 42000: Access denied for user 'user_1'@'localhost' to database 'db_storedproc_1'
+USE db_storedproc_1;
root@localhost db_storedproc_1
GRANT CREATE ROUTINE ON db_storedproc_1.* TO 'user_1'@'localhost';
@@ -92,6 +93,7 @@ CREATE PROCEDURE sp1(v1 char(20))
BEGIN
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
END//
+USE db_storedproc_1;
root@localhost db_storedproc_1
DROP USER 'user_1'@'localhost';
@@ -117,6 +119,7 @@ CREATE FUNCTION fn1(v1 int) returns int
BEGIN
return v1;
END//
+USE db_storedproc_1;
root@localhost db_storedproc_1
drop user 'user_1'@'localhost';
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 e4330211306..4608bfe0c9e 100644..100755
--- a/mysql-test/suite/funcs_1/r/myisam_storedproc_07.result
+++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_07.result
@@ -90,7 +90,7 @@ INSERT INTO result VALUES (@cur_val_sql_mode, 'value not restored');
END if;
END//
SHOW CREATE PROCEDURE sp1;
-Procedure sql_mode Create Procedure
+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`()
BEGIN
declare a tinyint;
@@ -104,7 +104,7 @@ INSERT INTO result VALUES (@cur_val_sql_mode, 'value restored');
ELSE
INSERT INTO result VALUES (@cur_val_sql_mode, 'value not restored');
END if;
-END
+END latin1 latin1_swedish_ci latin1_swedish_ci
set @@sql_mode='';
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
@@ -143,12 +143,12 @@ SET @@sql_mode='MAXDB';
SHOW VARIABLES LIKE 'sql_mode';
END//
SHOW CREATE PROCEDURE sp2;
-Procedure sql_mode Create Procedure
+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`()
BEGIN
SET @@sql_mode='MAXDB';
SHOW VARIABLES LIKE 'sql_mode';
-END
+END latin1 latin1_swedish_ci latin1_swedish_ci
... show value prior calling procedure
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
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 4dda7ef69ae..776b2510cab 100644..100755
--- a/mysql-test/suite/funcs_1/r/myisam_storedproc_08.result
+++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_08.result
@@ -122,6 +122,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -146,6 +149,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT created with INVOKER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -168,6 +174,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -190,6 +199,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT created with INVOKER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode
@@ -199,6 +211,9 @@ set @x=i1;
set @y=@x;
return i4;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE FUNCTION fn_2;
Function fn_2
sql_mode
@@ -210,6 +225,9 @@ set @x=i1;
set @y=@x;
return i4;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_1;
Procedure sp_1
sql_mode
@@ -217,6 +235,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_1`(i1 int)
BEGIN
set @x=i1;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_2;
Procedure sp_2
sql_mode
@@ -226,6 +247,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
BEGIN
set @x=i1;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW FUNCTION STATUS LIKE 'fn_%';
Db db_storedproc
Name fn_1
@@ -235,6 +259,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
Db db_storedproc
Name fn_2
Type FUNCTION
@@ -243,6 +270,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment created with INVOKER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW PROCEDURE STATUS LIKE 'sp_%';
Db db_storedproc
Name sp_1
@@ -252,6 +282,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
Db db_storedproc
Name sp_2
Type PROCEDURE
@@ -260,6 +293,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment created with INVOKER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
... now change some stuff:
--------------------------
@@ -304,6 +340,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT new comment, FN changed to INVOKER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -328,6 +367,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT FN changed to DEFINER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -350,6 +392,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT new comment, SP changed to INVOKER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -372,6 +417,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT SP changed to DEFINER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode
@@ -384,6 +432,9 @@ set @x=i1;
set @y=@x;
return i4;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE FUNCTION fn_2;
Function fn_2
sql_mode
@@ -395,6 +446,9 @@ set @x=i1;
set @y=@x;
return i4;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_1;
Procedure sp_1
sql_mode
@@ -404,6 +458,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_1`(i1 int)
BEGIN
set @x=i1;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_2;
Procedure sp_2
sql_mode
@@ -413,6 +470,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
BEGIN
set @x=i1;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW FUNCTION STATUS LIKE 'fn_%';
Db db_storedproc
Name fn_1
@@ -422,6 +482,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment new comment, FN changed to INVOKER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
Db db_storedproc
Name fn_2
Type FUNCTION
@@ -430,6 +493,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment FN changed to DEFINER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW PROCEDURE STATUS LIKE 'sp_%';
Db db_storedproc
Name sp_1
@@ -439,6 +505,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment new comment, SP changed to INVOKER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
Db db_storedproc
Name sp_2
Type PROCEDURE
@@ -447,6 +516,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment SP changed to DEFINER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
... change back to default and check result:
--------------------------------------------
@@ -479,6 +551,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT new comment, FN changed to INVOKER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -503,6 +578,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT FN changed to DEFINER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -525,6 +603,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT new comment, SP changed to INVOKER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -547,6 +628,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT SP changed to DEFINER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode
@@ -559,6 +643,9 @@ set @x=i1;
set @y=@x;
return i4;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE FUNCTION fn_2;
Function fn_2
sql_mode
@@ -569,6 +656,9 @@ set @x=i1;
set @y=@x;
return i4;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_1;
Procedure sp_1
sql_mode
@@ -578,6 +668,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_1`(i1 int)
BEGIN
set @x=i1;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_2;
Procedure sp_2
sql_mode
@@ -587,6 +680,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
BEGIN
set @x=i1;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW FUNCTION STATUS LIKE 'fn_%';
Db db_storedproc
Name fn_1
@@ -596,6 +692,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment new comment, FN changed to INVOKER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
Db db_storedproc
Name fn_2
Type FUNCTION
@@ -604,6 +703,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment FN changed to DEFINER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW PROCEDURE STATUS LIKE 'sp_%';
Db db_storedproc
Name sp_1
@@ -613,6 +715,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment new comment, SP changed to INVOKER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
Db db_storedproc
Name sp_2
Type PROCEDURE
@@ -621,6 +726,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment SP changed to DEFINER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
... cleanup
-----------
diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc_10.result b/mysql-test/suite/funcs_1/r/myisam_storedproc_10.result
index f41d5d7d440..13b14b242fe 100644..100755
--- a/mysql-test/suite/funcs_1/r/myisam_storedproc_10.result
+++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_10.result
@@ -58,7 +58,6 @@ load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11;
Section 3.1.10 - CALL checks:
--------------------------------------------------------------------------------
-USE db_storedproc;
Testcase 3.1.10.2 + 3.1.10.5:
-----------------------------
@@ -95,6 +94,7 @@ CALL sp31102();
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102'
SELECT fn31105( 9 );
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105'
+USE db_storedproc;
root@localhost db_storedproc
CALL sp31102();
@@ -114,6 +114,7 @@ a` a` 1000-01-01 -5000 a` -5000
SELECT fn31105( 9 );
fn31105( 9 )
81
+USE db_storedproc;
root@localhost db_storedproc
REVOKE EXECUTE ON db_storedproc.* FROM 'user_2'@'localhost';
@@ -131,6 +132,7 @@ CALL sp31102();
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102'
SELECT fn31105( 9 );
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105'
+USE db_storedproc;
root@localhost db_storedproc
DROP PROCEDURE sp31102;
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_0102.result b/mysql-test/suite/funcs_1/r/myisam_trig_0102.result
index 4d9a6c64947..eb5ae2e5b92 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_0102.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_0102.result
@@ -242,7 +242,7 @@ create table t1 (f1 integer) engine = myisam;
use test;
CREATE TRIGGER trig_db.trg6_2 AFTER INSERT on tb3
for each row set @ret_trg6_2 = 5;
-ERROR HY000: Trigger in wrong schema
+ERROR 42S02: Table 'trig_db.tb3' doesn't exist
use trig_db;
CREATE TRIGGER trg6_3 AFTER INSERT on test.tb3
for each row set @ret_trg6_3 = 18;
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 fcafd917e62..a51a79f9b88 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_03e.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_03e.result
@@ -263,7 +263,7 @@ select current_user;
current_user
root@localhost
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
grant select, insert, update on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
@@ -296,7 +296,7 @@ select current_user;
current_user
root@localhost
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
show tables;
Tables_in_priv_db
t1
@@ -317,7 +317,7 @@ select current_user;
current_user
test_yesprivs@localhost
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 1_2-yes';
select current_user;
@@ -453,9 +453,9 @@ ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for tabl
create trigger trg1_4 before UPDATE on t1 for each row
set new.f1 = 'trig 1_4-yes';
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
-trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL test_yesprivs@localhost
-trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL test_yesprivs@localhost
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
select current_user;
current_user
test_noprivs@localhost
@@ -570,11 +570,11 @@ current_user
test_yesprivs@localhost
use priv_db;
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
-trg1_1 INSERT t1 set new.f1 = 'trig 1_1-yes' BEFORE NULL test_yesprivs@localhost
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+trg1_1 INSERT t1 set new.f1 = 'trig 1_1-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
select * from information_schema.triggers;
-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
-NULL priv_db trg1_1 INSERT NULL priv_db t1 0 NULL set new.f1 = 'trig 1_1-yes' ROW BEFORE NULL NULL OLD NEW NULL test_yesprivs@localhost
+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 priv_db trg1_1 INSERT NULL priv_db t1 0 NULL set new.f1 = 'trig 1_1-yes' ROW BEFORE NULL NULL OLD NEW NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
drop trigger trg1_1;
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
select current_user;
@@ -863,7 +863,7 @@ select current_user;
current_user
root@localhost
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
grant TRIGGER on priv1_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
@@ -878,7 +878,7 @@ select current_user;
current_user
test_yesprivs@localhost
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 1_2-yes';
create trigger trg2_1 before INSERT on t2 for each row
@@ -990,7 +990,7 @@ select current_user;
current_user
root@localhost
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
grant select, insert, update ,trigger
on priv_db.t1 to test_yesprivs@localhost
with grant option;
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_08.result b/mysql-test/suite/funcs_1/r/myisam_trig_08.result
index 906aea070d9..4f350191099 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_08.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_08.result
@@ -492,9 +492,8 @@ BEGIN
WHILE @counter1 < new.f136
SET @counter1 = @counter1 + 1;
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 'WHILE @counter1 < new.f136
-SET @counter1 = @counter1 + 1;
-END' at line 3
+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 'SET @counter1 = @counter1 + 1;
+END' at line 4
delete from tb3 where f122='Test 3.5.8.5-while';
drop trigger trg7;
diff --git a/mysql-test/suite/funcs_1/r/myisam_views.result b/mysql-test/suite/funcs_1/r/myisam_views.result
index a3620575c8b..3f4ad45f79a 100644
--- a/mysql-test/suite/funcs_1/r/myisam_views.result
+++ b/mysql-test/suite/funcs_1/r/myisam_views.result
@@ -206,47 +206,47 @@ Insert into t1 values (500,9866);
Drop view if exists v1 ;
CREATE VIEW v1 AS select f59,f60,f61
FROM test.tb2 where f59=250;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f60,f61 limit 0,10;
f59 f60 f61
250 87895654 NULL
Drop view if exists v1 ;
CREATE VIEW v1 AS select f59,f60,f61
FROM test.tb2 limit 100;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59,f60,f61 limit 0,10;
f59 f60 f61
1 1 0000000001
2 2 0000000002
3 3 0000000003
4 4 0000000004
+4 74 NULL
5 5 0000000005
6 6 0000000006
7 7 0000000007
8 8 0000000008
9 9 0000000009
-10 10 0000000010
CREATE or REPLACE VIEW v1 AS select f59,f60,f61
FROM test.tb2 limit 4,3;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59,f60,f61 limit 0,10;
f59 f60 f61
5 5 0000000005
6 6 0000000006
7 7 0000000007
CREATE or REPLACE VIEW v1 AS select distinct f59
FROM test.tb2 limit 4,3;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
5
6
7
ALTER VIEW v1 AS select f59
FROM test.tb2 limit 6,2;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
7
8
CREATE or REPLACE VIEW v1 AS select f59
from tb2 order by f59 limit 100;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
1
2
@@ -288,7 +288,7 @@ f59
660
CREATE or REPLACE VIEW v1 AS select f59
from tb2 group by f59 limit 100;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
1
2
@@ -302,7 +302,7 @@ f59
10
CREATE or REPLACE VIEW v1 AS select f59
from tb2 group by f59 asc limit 100;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
1
2
@@ -316,21 +316,21 @@ f59
10
CREATE or REPLACE VIEW v1 AS select f59
from tb2 group by f59 desc limit 100;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
-569300
-76710
-9112
-7876
-3410
-3330
-2760
-2550
-987
-660
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
CREATE or REPLACE VIEW v1 AS (select f59 from tb2)
union (select f59 from t1) limit 100;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
1
2
@@ -344,7 +344,7 @@ f59
10
CREATE or REPLACE VIEW v1 AS (select f59 FROM tb2)
UNION DISTINCT(select f59 FROM t1) ;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
1
2
@@ -358,103 +358,103 @@ f59
10
CREATE or REPLACE VIEW v1 AS (select f59 FROM tb2)
UNION ALL(select f59 FROM t1) ;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
1
2
3
4
+4
5
6
7
8
9
-10
CREATE or REPLACE VIEW v1 AS select *
FROM test.tb2 WITH LOCAL CHECK OPTION ;
-select * FROM v1 limit 0,50;
+select * FROM v1 order by f59,f60,f61,f62,f63,f64 limit 0,50;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109 f110 f111 f112 f113 f114 f115 f116 f117
1 1 0000000001 0000000000000000000000000000000000000000000000000000000000000001 0000000001 0000000000000000000000000000000000000000000000000000000000000001 -5 0.000000000000000000000000000000 1 0.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549435e-38 1.17549e-38 1.175494352e-38 01.17549e-38 00000001.175494352e-38 01.17549e-38 00000001.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 1970-01-02 00:00:01 1902 1902 1902 2enum 2set
2 2 0000000002 0000000000000000000000000000000000000000000000000000000000000002 0000000002 0000000000000000000000000000000000000000000000000000000000000002 -4 1.100000000000000000000000000000 2 1.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494349e-38 1.17549e-38 1.175494353e-38 01.17549e-38 00000001.175494353e-38 01.17549e-38 00000001.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 1970-01-03 00:00:02 1903 1903 1903 1enum 1set,2set
3 3 0000000003 0000000000000000000000000000000000000000000000000000000000000003 0000000003 0000000000000000000000000000000000000000000000000000000000000003 -3 2.200000000000000000000000000000 3 2.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494348e-38 1.17549e-38 1.175494354e-38 01.17549e-38 00000001.175494354e-38 01.17549e-38 00000001.175494354e-38 1000-01-03 838:59:56 1970-01-04 00:00:03 1970-01-04 00:00:03 1904 1904 1904 2enum 1set
4 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
+4 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
5 5 0000000005 0000000000000000000000000000000000000000000000000000000000000005 0000000005 0000000000000000000000000000000000000000000000000000000000000005 -1 4.400000000000000000000000000000 5 4.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494346e-38 1.17549e-38 1.175494356e-38 01.17549e-38 00000001.175494356e-38 01.17549e-38 00000001.175494356e-38 1000-01-05 838:59:54 1970-01-06 00:00:05 1970-01-06 00:00:05 1906 1906 1906 2enum 1set,2set
6 6 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0 5.500000000000000000000000000000 6 5.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494345e-38 1.17549e-38 1.175494357e-38 01.17549e-38 00000001.175494357e-38 01.17549e-38 00000001.175494357e-38 1000-01-06 838:59:53 1970-01-07 00:00:06 1970-01-07 00:00:06 1907 1907 1907 1enum 1set
7 7 0000000007 0000000000000000000000000000000000000000000000000000000000000007 0000000007 0000000000000000000000000000000000000000000000000000000000000007 1 6.600000000000000000000000000000 7 6.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494344e-38 1.17549e-38 1.175494358e-38 01.17549e-38 00000001.175494358e-38 01.17549e-38 00000001.175494358e-38 1000-01-07 838:59:52 1970-01-08 00:00:07 1970-01-08 00:00:07 1908 1908 1908 2enum 2set
8 8 0000000008 0000000000000000000000000000000000000000000000000000000000000008 0000000008 0000000000000000000000000000000000000000000000000000000000000008 2 7.700000000000000000000000000000 8 7.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494343e-38 1.17549e-38 1.175494359e-38 01.17549e-38 00000001.175494359e-38 01.17549e-38 00000001.175494359e-38 1000-01-08 838:59:51 1970-01-09 00:00:08 1970-01-09 00:00:08 1909 1909 1909 1enum 1set,2set
9 9 0000000009 0000000000000000000000000000000000000000000000000000000000000009 0000000009 0000000000000000000000000000000000000000000000000000000000000009 3 8.800000000000000000000000000000 9 8.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494342e-38 1.17549e-38 1.17549436e-38 01.17549e-38 000000001.17549436e-38 01.17549e-38 000000001.17549436e-38 1000-01-09 838:59:50 1970-01-10 00:00:09 1970-01-10 00:00:09 1910 1910 1910 2enum 1set
10 10 0000000010 0000000000000000000000000000000000000000000000000000000000000010 0000000010 0000000000000000000000000000000000000000000000000000000000000010 4 9.900000000000000000000000000000 10 9.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494341e-38 1.17549e-38 1.175494361e-38 01.17549e-38 00000001.175494361e-38 01.17549e-38 00000001.175494361e-38 1000-01-10 838:59:49 1970-01-11 00:00:10 1970-01-11 00:00:10 1911 1911 1911 1enum 2set
-76710 226546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-2760 985654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-569300 9114376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-660 876546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-250 87895654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-340 9984376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-3410 996546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-2550 775654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-3330 764376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-441 16546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-24 51654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-323 14376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-34 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-4 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
15 87 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+17 15 0000000016 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+19 18 0000000014 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
22 93 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-394 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+24 51654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+27 25 0000000026 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+29 28 0000000024 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+34 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
94 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-195 87 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-292 93 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-987 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-7876 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-321 NULL 0000000765 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-9112 NULL 0000008771 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
107 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+107 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+109 108 0000000104 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
109 108 0000000104 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+195 87 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
207 205 0000000206 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
209 208 0000000204 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-27 25 0000000026 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-29 28 0000000024 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-17 15 0000000016 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-19 18 0000000014 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-107 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-109 108 0000000104 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-299 899 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
242 79 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+250 87895654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+292 93 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+299 899 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+321 NULL 0000000765 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+323 14376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+340 9984376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+394 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
424 89 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+441 16546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+660 876546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+987 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+2550 775654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+2760 985654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+3330 764376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+3410 996546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+7876 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+9112 NULL 0000008771 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+76710 226546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+569300 9114376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
CREATE or REPLACE VIEW v1 AS select *
FROM test.tb2 WITH CASCADED CHECK OPTION ;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59,f60,f61,f62,f63,f64 limit 0,10;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109 f110 f111 f112 f113 f114 f115 f116 f117
1 1 0000000001 0000000000000000000000000000000000000000000000000000000000000001 0000000001 0000000000000000000000000000000000000000000000000000000000000001 -5 0.000000000000000000000000000000 1 0.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549435e-38 1.17549e-38 1.175494352e-38 01.17549e-38 00000001.175494352e-38 01.17549e-38 00000001.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 1970-01-02 00:00:01 1902 1902 1902 2enum 2set
2 2 0000000002 0000000000000000000000000000000000000000000000000000000000000002 0000000002 0000000000000000000000000000000000000000000000000000000000000002 -4 1.100000000000000000000000000000 2 1.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494349e-38 1.17549e-38 1.175494353e-38 01.17549e-38 00000001.175494353e-38 01.17549e-38 00000001.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 1970-01-03 00:00:02 1903 1903 1903 1enum 1set,2set
3 3 0000000003 0000000000000000000000000000000000000000000000000000000000000003 0000000003 0000000000000000000000000000000000000000000000000000000000000003 -3 2.200000000000000000000000000000 3 2.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494348e-38 1.17549e-38 1.175494354e-38 01.17549e-38 00000001.175494354e-38 01.17549e-38 00000001.175494354e-38 1000-01-03 838:59:56 1970-01-04 00:00:03 1970-01-04 00:00:03 1904 1904 1904 2enum 1set
4 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
+4 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
5 5 0000000005 0000000000000000000000000000000000000000000000000000000000000005 0000000005 0000000000000000000000000000000000000000000000000000000000000005 -1 4.400000000000000000000000000000 5 4.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494346e-38 1.17549e-38 1.175494356e-38 01.17549e-38 00000001.175494356e-38 01.17549e-38 00000001.175494356e-38 1000-01-05 838:59:54 1970-01-06 00:00:05 1970-01-06 00:00:05 1906 1906 1906 2enum 1set,2set
6 6 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0 5.500000000000000000000000000000 6 5.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494345e-38 1.17549e-38 1.175494357e-38 01.17549e-38 00000001.175494357e-38 01.17549e-38 00000001.175494357e-38 1000-01-06 838:59:53 1970-01-07 00:00:06 1970-01-07 00:00:06 1907 1907 1907 1enum 1set
7 7 0000000007 0000000000000000000000000000000000000000000000000000000000000007 0000000007 0000000000000000000000000000000000000000000000000000000000000007 1 6.600000000000000000000000000000 7 6.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494344e-38 1.17549e-38 1.175494358e-38 01.17549e-38 00000001.175494358e-38 01.17549e-38 00000001.175494358e-38 1000-01-07 838:59:52 1970-01-08 00:00:07 1970-01-08 00:00:07 1908 1908 1908 2enum 2set
8 8 0000000008 0000000000000000000000000000000000000000000000000000000000000008 0000000008 0000000000000000000000000000000000000000000000000000000000000008 2 7.700000000000000000000000000000 8 7.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494343e-38 1.17549e-38 1.175494359e-38 01.17549e-38 00000001.175494359e-38 01.17549e-38 00000001.175494359e-38 1000-01-08 838:59:51 1970-01-09 00:00:08 1970-01-09 00:00:08 1909 1909 1909 1enum 1set,2set
9 9 0000000009 0000000000000000000000000000000000000000000000000000000000000009 0000000009 0000000000000000000000000000000000000000000000000000000000000009 3 8.800000000000000000000000000000 9 8.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494342e-38 1.17549e-38 1.17549436e-38 01.17549e-38 000000001.17549436e-38 01.17549e-38 000000001.17549436e-38 1000-01-09 838:59:50 1970-01-10 00:00:09 1970-01-10 00:00:09 1910 1910 1910 2enum 1set
-10 10 0000000010 0000000000000000000000000000000000000000000000000000000000000010 0000000010 0000000000000000000000000000000000000000000000000000000000000010 4 9.900000000000000000000000000000 10 9.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494341e-38 1.17549e-38 1.175494361e-38 01.17549e-38 00000001.175494361e-38 01.17549e-38 00000001.175494361e-38 1000-01-10 838:59:49 1970-01-11 00:00:10 1970-01-11 00:00:10 1911 1911 1911 1enum 2set
CREATE OR REPLACE VIEW v1 AS SELECT F59, F60
FROM test.tb2 WITH CASCADED CHECK OPTION;
-SELECT * FROM v1 limit 0,10;
+SELECT * FROM v1 order by f59,f60 limit 0,10;
F59 F60
1 1
2 2
3 3
4 4
+4 74
5 5
6 6
7 7
8 8
9 9
-10 10
CREATE or REPLACE VIEW v1 AS select f59, f60
from test.tb2 where f59=3330 ;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f60 limit 0,10;
f59 f60
3330 764376
DROP VIEW v1 ;
@@ -885,73 +885,73 @@ CREATE TABLE t1 (f1 BIGINT);
INSERT INTO t1 VALUES(1);
CREATE VIEW test.v1 AS SELECT * FROM t1 limit 2;
SHOW CREATE VIEW test.v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` limit 2
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` limit 2 latin1 latin1_swedish_ci
SELECT * FROM test.v1;
f1
1
CREATE OR REPLACE ALGORITHM = TEMPTABLE VIEW test.v1
AS SELECT * FROM t1 limit 2;
SHOW CREATE VIEW test.v1;
-View Create View
-v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` limit 2
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` limit 2 latin1 latin1_swedish_ci
SELECT * FROM test.v1;
f1
1
-CREATE OR REPLACE VIEW test.v1 AS SELECT * FROM tb2 limit 2;
+CREATE OR REPLACE VIEW test.v1 AS SELECT * FROM tb2 order by f59 limit 2;
SHOW CREATE VIEW test.v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `tb2`.`f59` AS `f59`,`tb2`.`f60` AS `f60`,`tb2`.`f61` AS `f61`,`tb2`.`f62` AS `f62`,`tb2`.`f63` AS `f63`,`tb2`.`f64` AS `f64`,`tb2`.`f65` AS `f65`,`tb2`.`f66` AS `f66`,`tb2`.`f67` AS `f67`,`tb2`.`f68` AS `f68`,`tb2`.`f69` AS `f69`,`tb2`.`f70` AS `f70`,`tb2`.`f71` AS `f71`,`tb2`.`f72` AS `f72`,`tb2`.`f73` AS `f73`,`tb2`.`f74` AS `f74`,`tb2`.`f75` AS `f75`,`tb2`.`f76` AS `f76`,`tb2`.`f77` AS `f77`,`tb2`.`f78` AS `f78`,`tb2`.`f79` AS `f79`,`tb2`.`f80` AS `f80`,`tb2`.`f81` AS `f81`,`tb2`.`f82` AS `f82`,`tb2`.`f83` AS `f83`,`tb2`.`f84` AS `f84`,`tb2`.`f85` AS `f85`,`tb2`.`f86` AS `f86`,`tb2`.`f87` AS `f87`,`tb2`.`f88` AS `f88`,`tb2`.`f89` AS `f89`,`tb2`.`f90` AS `f90`,`tb2`.`f91` AS `f91`,`tb2`.`f92` AS `f92`,`tb2`.`f93` AS `f93`,`tb2`.`f94` AS `f94`,`tb2`.`f95` AS `f95`,`tb2`.`f96` AS `f96`,`tb2`.`f97` AS `f97`,`tb2`.`f98` AS `f98`,`tb2`.`f99` AS `f99`,`tb2`.`f100` AS `f100`,`tb2`.`f101` AS `f101`,`tb2`.`f102` AS `f102`,`tb2`.`f103` AS `f103`,`tb2`.`f104` AS `f104`,`tb2`.`f105` AS `f105`,`tb2`.`f106` AS `f106`,`tb2`.`f107` AS `f107`,`tb2`.`f108` AS `f108`,`tb2`.`f109` AS `f109`,`tb2`.`f110` AS `f110`,`tb2`.`f111` AS `f111`,`tb2`.`f112` AS `f112`,`tb2`.`f113` AS `f113`,`tb2`.`f114` AS `f114`,`tb2`.`f115` AS `f115`,`tb2`.`f116` AS `f116`,`tb2`.`f117` AS `f117` from `tb2` limit 2
-SELECT * FROM test.v1 ;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `tb2`.`f59` AS `f59`,`tb2`.`f60` AS `f60`,`tb2`.`f61` AS `f61`,`tb2`.`f62` AS `f62`,`tb2`.`f63` AS `f63`,`tb2`.`f64` AS `f64`,`tb2`.`f65` AS `f65`,`tb2`.`f66` AS `f66`,`tb2`.`f67` AS `f67`,`tb2`.`f68` AS `f68`,`tb2`.`f69` AS `f69`,`tb2`.`f70` AS `f70`,`tb2`.`f71` AS `f71`,`tb2`.`f72` AS `f72`,`tb2`.`f73` AS `f73`,`tb2`.`f74` AS `f74`,`tb2`.`f75` AS `f75`,`tb2`.`f76` AS `f76`,`tb2`.`f77` AS `f77`,`tb2`.`f78` AS `f78`,`tb2`.`f79` AS `f79`,`tb2`.`f80` AS `f80`,`tb2`.`f81` AS `f81`,`tb2`.`f82` AS `f82`,`tb2`.`f83` AS `f83`,`tb2`.`f84` AS `f84`,`tb2`.`f85` AS `f85`,`tb2`.`f86` AS `f86`,`tb2`.`f87` AS `f87`,`tb2`.`f88` AS `f88`,`tb2`.`f89` AS `f89`,`tb2`.`f90` AS `f90`,`tb2`.`f91` AS `f91`,`tb2`.`f92` AS `f92`,`tb2`.`f93` AS `f93`,`tb2`.`f94` AS `f94`,`tb2`.`f95` AS `f95`,`tb2`.`f96` AS `f96`,`tb2`.`f97` AS `f97`,`tb2`.`f98` AS `f98`,`tb2`.`f99` AS `f99`,`tb2`.`f100` AS `f100`,`tb2`.`f101` AS `f101`,`tb2`.`f102` AS `f102`,`tb2`.`f103` AS `f103`,`tb2`.`f104` AS `f104`,`tb2`.`f105` AS `f105`,`tb2`.`f106` AS `f106`,`tb2`.`f107` AS `f107`,`tb2`.`f108` AS `f108`,`tb2`.`f109` AS `f109`,`tb2`.`f110` AS `f110`,`tb2`.`f111` AS `f111`,`tb2`.`f112` AS `f112`,`tb2`.`f113` AS `f113`,`tb2`.`f114` AS `f114`,`tb2`.`f115` AS `f115`,`tb2`.`f116` AS `f116`,`tb2`.`f117` AS `f117` from `tb2` order by `tb2`.`f59` limit 2 latin1 latin1_swedish_ci
+SELECT * FROM test.v1 order by f59,f60,f61,f62,f63,f64,f65;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109 f110 f111 f112 f113 f114 f115 f116 f117
1 1 0000000001 0000000000000000000000000000000000000000000000000000000000000001 0000000001 0000000000000000000000000000000000000000000000000000000000000001 -5 0.000000000000000000000000000000 1 0.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549435e-38 1.17549e-38 1.175494352e-38 01.17549e-38 00000001.175494352e-38 01.17549e-38 00000001.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 1970-01-02 00:00:01 1902 1902 1902 2enum 2set
2 2 0000000002 0000000000000000000000000000000000000000000000000000000000000002 0000000002 0000000000000000000000000000000000000000000000000000000000000002 -4 1.100000000000000000000000000000 2 1.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494349e-38 1.17549e-38 1.175494353e-38 01.17549e-38 00000001.175494353e-38 01.17549e-38 00000001.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 1970-01-03 00:00:02 1903 1903 1903 1enum 1set,2set
CREATE OR REPLACE VIEW test.v1 AS SELECT F59 FROM tb2 limit 10,100;
SHOW CREATE VIEW test.v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `tb2`.`f59` AS `F59` from `tb2` limit 10,100
-SELECT * FROM test.v1;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `tb2`.`f59` AS `F59` from `tb2` limit 10,100 latin1 latin1_swedish_ci
+SELECT * FROM test.v1 order by F59;
F59
-76710
-2760
-569300
-660
-250
-340
-3410
-2550
-3330
-441
-24
-323
-34
4
15
+17
+19
22
-394
+24
+27
+29
+34
94
-195
-292
-987
-7876
-321
-9112
-500
-500
-500
107
+107
+109
109
+195
207
209
-27
-29
-17
-19
-107
-109
-299
242
+250
+292
+299
+321
+323
+340
+394
424
+441
+500
+500
+500
+660
+987
+2550
+2760
+3330
+3410
+7876
+9112
+76710
+569300
Drop table test.t1 ;
Drop view test.v1 ;
@@ -987,38 +987,38 @@ CREATE TABLE t1 (f1 NUMERIC(15,3));
INSERT INTO t1 VALUES(8.8);
CREATE VIEW v1 AS SELECT * FROM t1;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
f1
8.800
CREATE OR REPLACE VIEW v1 AS SELECT f1 FROM t1;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
f1
8.800
CREATE OR REPLACE VIEW v1 AS SELECT f1 As my_column FROM t1;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `my_column` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `my_column` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
my_column
8.800
CREATE OR REPLACE VIEW v1(column1,column2)
AS SELECT f1 As my_column, f1 FROM t1;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `column1`,`t1`.`f1` AS `column2` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `column1`,`t1`.`f1` AS `column2` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
column1 column2
8.800 8.800
CREATE OR REPLACE VIEW test.v1(column1,column2)
AS SELECT f1 As my_column, f1 FROM test.t1;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `column1`,`t1`.`f1` AS `column2` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `column1`,`t1`.`f1` AS `column2` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
column1 column2
8.800 8.800
@@ -1103,7 +1103,7 @@ Testcase 3.3.1.21
--------------------------------------------------------------------------------
DROP VIEW IF EXISTS v1;
CREATE VIEW test.v1( F59, F60 ) AS SELECT F59, F60 From tb2 LIMIT 2;
-SELECT * FROM test.v1;
+SELECT * FROM test.v1 order by F59, F60 desc;
F59 F60
1 1
2 2
@@ -1212,7 +1212,7 @@ DROP VIEW IF EXISTS test.v1;
Drop VIEW IF EXISTS test.v1_1 ;
Create view test.v1 AS Select * from test.tb2 limit 2 ;
Create view test.v1_1 AS Select F59 from test.v1 ;
-Select * from test.v1_1 limit 20 ;
+Select * from test.v1_1 order by F59 limit 20 ;
F59
1
2
@@ -1226,58 +1226,58 @@ create database test2 ;
Create view test2.v2 AS Select * from test.tb2 limit 50,50;
use test2 ;
Create view v1 AS Select * from test.tb2 limit 50 ;
-Select * from v1 ;
+Select * from v1 order by f59,f60,f61,f62,f63,f64,f65;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109 f110 f111 f112 f113 f114 f115 f116 f117
1 1 0000000001 0000000000000000000000000000000000000000000000000000000000000001 0000000001 0000000000000000000000000000000000000000000000000000000000000001 -5 0.000000000000000000000000000000 1 0.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549435e-38 1.17549e-38 1.175494352e-38 01.17549e-38 00000001.175494352e-38 01.17549e-38 00000001.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 1970-01-02 00:00:01 1902 1902 1902 2enum 2set
2 2 0000000002 0000000000000000000000000000000000000000000000000000000000000002 0000000002 0000000000000000000000000000000000000000000000000000000000000002 -4 1.100000000000000000000000000000 2 1.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494349e-38 1.17549e-38 1.175494353e-38 01.17549e-38 00000001.175494353e-38 01.17549e-38 00000001.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 1970-01-03 00:00:02 1903 1903 1903 1enum 1set,2set
3 3 0000000003 0000000000000000000000000000000000000000000000000000000000000003 0000000003 0000000000000000000000000000000000000000000000000000000000000003 -3 2.200000000000000000000000000000 3 2.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494348e-38 1.17549e-38 1.175494354e-38 01.17549e-38 00000001.175494354e-38 01.17549e-38 00000001.175494354e-38 1000-01-03 838:59:56 1970-01-04 00:00:03 1970-01-04 00:00:03 1904 1904 1904 2enum 1set
4 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
+4 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
5 5 0000000005 0000000000000000000000000000000000000000000000000000000000000005 0000000005 0000000000000000000000000000000000000000000000000000000000000005 -1 4.400000000000000000000000000000 5 4.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494346e-38 1.17549e-38 1.175494356e-38 01.17549e-38 00000001.175494356e-38 01.17549e-38 00000001.175494356e-38 1000-01-05 838:59:54 1970-01-06 00:00:05 1970-01-06 00:00:05 1906 1906 1906 2enum 1set,2set
6 6 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0 5.500000000000000000000000000000 6 5.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494345e-38 1.17549e-38 1.175494357e-38 01.17549e-38 00000001.175494357e-38 01.17549e-38 00000001.175494357e-38 1000-01-06 838:59:53 1970-01-07 00:00:06 1970-01-07 00:00:06 1907 1907 1907 1enum 1set
7 7 0000000007 0000000000000000000000000000000000000000000000000000000000000007 0000000007 0000000000000000000000000000000000000000000000000000000000000007 1 6.600000000000000000000000000000 7 6.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494344e-38 1.17549e-38 1.175494358e-38 01.17549e-38 00000001.175494358e-38 01.17549e-38 00000001.175494358e-38 1000-01-07 838:59:52 1970-01-08 00:00:07 1970-01-08 00:00:07 1908 1908 1908 2enum 2set
8 8 0000000008 0000000000000000000000000000000000000000000000000000000000000008 0000000008 0000000000000000000000000000000000000000000000000000000000000008 2 7.700000000000000000000000000000 8 7.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494343e-38 1.17549e-38 1.175494359e-38 01.17549e-38 00000001.175494359e-38 01.17549e-38 00000001.175494359e-38 1000-01-08 838:59:51 1970-01-09 00:00:08 1970-01-09 00:00:08 1909 1909 1909 1enum 1set,2set
9 9 0000000009 0000000000000000000000000000000000000000000000000000000000000009 0000000009 0000000000000000000000000000000000000000000000000000000000000009 3 8.800000000000000000000000000000 9 8.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494342e-38 1.17549e-38 1.17549436e-38 01.17549e-38 000000001.17549436e-38 01.17549e-38 000000001.17549436e-38 1000-01-09 838:59:50 1970-01-10 00:00:09 1970-01-10 00:00:09 1910 1910 1910 2enum 1set
10 10 0000000010 0000000000000000000000000000000000000000000000000000000000000010 0000000010 0000000000000000000000000000000000000000000000000000000000000010 4 9.900000000000000000000000000000 10 9.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494341e-38 1.17549e-38 1.175494361e-38 01.17549e-38 00000001.175494361e-38 01.17549e-38 00000001.175494361e-38 1000-01-10 838:59:49 1970-01-11 00:00:10 1970-01-11 00:00:10 1911 1911 1911 1enum 2set
-76710 226546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-2760 985654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-569300 9114376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-660 876546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-250 87895654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-340 9984376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-3410 996546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-2550 775654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-3330 764376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-441 16546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-24 51654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-323 14376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-34 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-4 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
15 87 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+17 15 0000000016 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+19 18 0000000014 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
22 93 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-394 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+24 51654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+27 25 0000000026 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+29 28 0000000024 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+34 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
94 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-195 87 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-292 93 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-987 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-7876 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-321 NULL 0000000765 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-9112 NULL 0000008771 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
107 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+107 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+109 108 0000000104 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
109 108 0000000104 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+195 87 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
207 205 0000000206 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
209 208 0000000204 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-27 25 0000000026 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-29 28 0000000024 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-17 15 0000000016 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-19 18 0000000014 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-107 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-109 108 0000000104 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-299 899 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
242 79 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+250 87895654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+292 93 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+299 899 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+321 NULL 0000000765 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+323 14376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+340 9984376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+394 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
424 89 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+441 16546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+660 876546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+987 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+2550 775654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+2760 985654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+3330 764376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+3410 996546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+7876 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+9112 NULL 0000008771 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+76710 226546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+569300 9114376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
Select * from test2.v2 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109 f110 f111 f112 f113 f114 f115 f116 f117
Drop view if exists test2.v1 ;
@@ -1340,18 +1340,18 @@ CREATE VIEW test.v1
AS SELECT test.v1_firstview.f59, test.v1_firstview.f60
FROM test.v1_firstview INNER JOIN test.v1_secondview
ON test.v1_firstview.f59 = test.v1_secondview.f59 ;
-SELECT * FROM test.v1 limit 0,10;
+SELECT * FROM test.v1 order by f59,f60 limit 0,10;
f59 f60
1 1
2 2
3 3
4 4
+4 4
+4 74
4 74
5 5
6 6
7 7
-8 8
-9 9
Drop view if exists test.v1_firstview ;
Drop view if exists test.v1_secondview ;
Drop view if exists test.v1 ;
@@ -1369,18 +1369,18 @@ CREATE VIEW v1
AS SELECT test.v1_firstview.F59, test.v1_firstview.F60
FROM test.v1_firstview INNER JOIN test.v1_secondview
ON test.v1_firstview.f59 = test.v1_secondview.f59 ;
-SELECT * FROM v1 limit 0,10;
+SELECT * FROM v1 order by f59,f60 limit 0,10;
F59 F60
1 1
2 2
3 3
4 4
+4 4
+4 74
4 74
5 5
6 6
7 7
-8 8
-9 9
Drop view v1 ;
Drop view test.v1_firstview ;
Drop view test.v1_secondview ;
@@ -1395,18 +1395,18 @@ CREATE VIEW test.v1
AS SELECT test.v1_firstview.f59, test.v1_firstview.f60
FROM test.v1_firstview INNER JOIN test.tb2
ON test.v1_firstview.f59 = test.tb2.f59;
-SELECT * FROM test.v1 limit 0,10;
+SELECT * FROM test.v1 order by f59,f60 limit 0,10;
f59 f60
1 1
2 2
3 3
4 4
+4 4
+4 74
4 74
5 5
6 6
7 7
-8 8
-9 9
Drop view test.v1 ;
Drop view test.v1_firstview;
@@ -1419,18 +1419,18 @@ CREATE VIEW v1_firstview AS SELECT * FROM test.tb2 ;
CREATE VIEW v1
AS SELECT v1_firstview.f59, v1_firstview.f60
FROM v1_firstview INNER JOIN test.tb2 ON v1_firstview.f59 = test.tb2.f59 ;
-SELECT * FROM v1 limit 0,10;
+SELECT * FROM v1 order by f59,f60 limit 0,10;
f59 f60
1 1
2 2
3 3
4 4
+4 4
+4 74
4 74
5 5
6 6
7 7
-8 8
-9 9
Drop database test2 ;
Testcase 3.3.1.37
@@ -1442,18 +1442,18 @@ Drop view if exists test.v1_1 ;
Drop view if exists test.v1_1 ;
Drop view if exists test.v1_main ;
Create view test.v1 as Select f59, f60 FROM test.tb2;
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59,f60 limit 0,10;
f59 f60
1 1
2 2
3 3
4 4
+4 74
5 5
6 6
7 7
8 8
9 9
-10 10
Create table t1(f59 int, f60 int);
Insert into t1 values (90,507) ;
Create view v1_1 as Select f59,f60 from t1 ;
@@ -1463,18 +1463,18 @@ f59 f60
Create view v1_main
as SELECT test.tb2.f59 FROM test.tb2 JOIN test.v1
ON test.tb2.f59 = test.v1.f59;
-Select * from v1_main limit 0,10;
+Select * from v1_main order by f59 limit 0,10;
f59
1
2
3
4
4
+4
+4
5
6
7
-8
-9
Drop table t1;
Drop view test.v1 ;
Drop view test.v1_1 ;
@@ -1760,7 +1760,7 @@ Drop view if exists test.v1_main;
Drop view if exists test1.v1_1 ;
Drop database if exists test3 ;
Create view test.v1 as Select f59, f60 FROM test.tb2 limit 20 ;
-Select * from test.v1 ;
+Select * from test.v1 order by f59,f60;
f59 f60
1 1
2 2
@@ -1772,16 +1772,16 @@ f59 f60
8 8
9 9
10 10
-76710 226546
-2760 985654
-569300 9114376
-660 876546
250 87895654
340 9984376
-3410 996546
+441 16546
+660 876546
2550 775654
+2760 985654
3330 764376
-441 16546
+3410 996546
+76710 226546
+569300 9114376
Create table test1.t1 (f59 int,f60 int) ;
Insert into test1.t1 values (199,507) ;
Create view test1.v1_1 as Select f59,f60 from test1.t1 ;
@@ -1814,7 +1814,7 @@ Drop view if exists test.v1 ;
CREATE VIEW test.v1
AS Select f59 from (Select * FROM tb2 limit 20) tx ;
ERROR HY000: View's SELECT contains a subquery in the FROM clause
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by f59 ;
ERROR 42S02: Table 'test.v1' doesn't exist
Drop view if exists test.v1 ;
@@ -1895,7 +1895,7 @@ CREATE VIEW test.v1 AS SELECT * FROM test.tb2 where f59 = 04;
UPDATE test.v1 SET f59 = 30 where F59 = 04 ;
affected rows: 2
info: Rows matched: 2 Changed: 2 Warnings: 0
-SELECT * FROM test.v1 where f59 = 30 ;
+SELECT * FROM test.v1 where f59 = 30 order by f59;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109 f110 f111 f112 f113 f114 f115 f116 f117
SELECT * FROM test.tb2 where f59 = 30 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109 f110 f111 f112 f113 f114 f115 f116 f117
@@ -1908,7 +1908,7 @@ SELECT * FROM tb2 where f59 = 100 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109 f110 f111 f112 f113 f114 f115 f116 f117
100 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
100 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by f59 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109 f110 f111 f112 f113 f114 f115 f116 f117
drop view if exists test.v1 ;
Drop TABLE IF EXISTS test.t1 ;
@@ -1984,7 +1984,7 @@ CREATE VIEW test.v1 AS SELECT f59,f60
FROM test.tb2 where f59 = 195 WITH CHECK OPTION ;
UPDATE test.v1 SET f59 = 198 where f59=195 ;
ERROR HY000: CHECK OPTION failed 'test.v1'
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by f59 ;
f59 f60
195 87
drop view if exists test.v1 ;
@@ -1998,7 +1998,7 @@ FROM test.tb2 where F59 = 0987 WITH LOCAL CHECK OPTION ;
CREATE VIEW test.v2 as SELECT * FROM test.v1 ;
UPDATE test.v1 SET F59 = 919 where f59 = 0987 ;
ERROR HY000: CHECK OPTION failed 'test.v1'
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by f59 ;
f59 f60
987 41
UPDATE test.v2 SET F59 = 9879 where f59 = 919 ;
@@ -9693,115 +9693,115 @@ Testcase 3.3.1.50 - 3.3.1.53
--------------------------------------------------------------------------------
DROP VIEW IF EXISTS test.v1;
CREATE VIEW test.v1 AS SELECT * FROM test.tb2 limit 5 ;
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by f59 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109 f110 f111 f112 f113 f114 f115 f116 f117
1 1 0000000001 0000000000000000000000000000000000000000000000000000000000000001 0000000001 0000000000000000000000000000000000000000000000000000000000000001 -5 0.000000000000000000000000000000 1 0.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549435e-38 1.17549e-38 1.175494352e-38 01.17549e-38 00000001.175494352e-38 01.17549e-38 00000001.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 1970-01-02 00:00:01 1902 1902 1902 2enum 2set
2 2 0000000002 0000000000000000000000000000000000000000000000000000000000000002 0000000002 0000000000000000000000000000000000000000000000000000000000000002 -4 1.100000000000000000000000000000 2 1.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494349e-38 1.17549e-38 1.175494353e-38 01.17549e-38 00000001.175494353e-38 01.17549e-38 00000001.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 1970-01-03 00:00:02 1903 1903 1903 1enum 1set,2set
3 3 0000000003 0000000000000000000000000000000000000000000000000000000000000003 0000000003 0000000000000000000000000000000000000000000000000000000000000003 -3 2.200000000000000000000000000000 3 2.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494348e-38 1.17549e-38 1.175494354e-38 01.17549e-38 00000001.175494354e-38 01.17549e-38 00000001.175494354e-38 1000-01-03 838:59:56 1970-01-04 00:00:03 1970-01-04 00:00:03 1904 1904 1904 2enum 1set
-100 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
5 5 0000000005 0000000000000000000000000000000000000000000000000000000000000005 0000000005 0000000000000000000000000000000000000000000000000000000000000005 -1 4.400000000000000000000000000000 5 4.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494346e-38 1.17549e-38 1.175494356e-38 01.17549e-38 00000001.175494356e-38 01.17549e-38 00000001.175494356e-38 1000-01-05 838:59:54 1970-01-06 00:00:05 1970-01-06 00:00:05 1906 1906 1906 2enum 1set,2set
+100 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
drop view test.v1 ;
CREATE VIEW test.v1 AS SELECT F59,F61 FROM test.tb2 limit 50 ;
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by F59, F61 ;
F59 F61
1 0000000001
2 0000000002
3 0000000003
-100 0000000004
5 0000000005
6 0000000006
7 0000000007
8 0000000008
9 0000000009
10 0000000010
-76710 NULL
-2760 NULL
-569300 NULL
-660 NULL
-250 NULL
-340 NULL
-3410 NULL
-2550 NULL
-3330 NULL
-441 NULL
-24 NULL
-323 NULL
-34 NULL
-100 NULL
15 NULL
+17 0000000016
+19 0000000014
22 NULL
-394 NULL
+24 NULL
+27 0000000026
+29 0000000024
+34 NULL
94 NULL
-195 NULL
-292 NULL
-987 NULL
-7876 NULL
-321 0000000765
-9112 0000008771
-500 0000000900
-500 0000000900
-500 0000000900
+100 NULL
+100 0000000004
+107 0000000106
107 0000000106
109 0000000104
+109 0000000104
+195 NULL
207 0000000206
209 0000000204
-27 0000000026
-29 0000000024
-17 0000000016
-19 0000000014
-107 0000000106
-109 0000000104
-299 NULL
242 NULL
+250 NULL
+292 NULL
+299 NULL
+321 0000000765
+323 NULL
+340 NULL
+394 NULL
424 NULL
+441 NULL
+500 0000000900
+500 0000000900
+500 0000000900
+660 NULL
+987 NULL
+2550 NULL
+2760 NULL
+3330 NULL
+3410 NULL
+7876 NULL
+9112 0000008771
+76710 NULL
+569300 NULL
drop view test.v1 ;
-CREATE VIEW test.v1 AS SELECT * FROM test.tb2 limit 20 ;
-SELECT * FROM test.v1;
+CREATE VIEW test.v1 AS SELECT * FROM test.tb2 order by f59, f60, f61 limit 20 ;
+SELECT * FROM test.v1 order by f59,f60,f61 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109 f110 f111 f112 f113 f114 f115 f116 f117
1 1 0000000001 0000000000000000000000000000000000000000000000000000000000000001 0000000001 0000000000000000000000000000000000000000000000000000000000000001 -5 0.000000000000000000000000000000 1 0.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549435e-38 1.17549e-38 1.175494352e-38 01.17549e-38 00000001.175494352e-38 01.17549e-38 00000001.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 1970-01-02 00:00:01 1902 1902 1902 2enum 2set
2 2 0000000002 0000000000000000000000000000000000000000000000000000000000000002 0000000002 0000000000000000000000000000000000000000000000000000000000000002 -4 1.100000000000000000000000000000 2 1.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494349e-38 1.17549e-38 1.175494353e-38 01.17549e-38 00000001.175494353e-38 01.17549e-38 00000001.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 1970-01-03 00:00:02 1903 1903 1903 1enum 1set,2set
3 3 0000000003 0000000000000000000000000000000000000000000000000000000000000003 0000000003 0000000000000000000000000000000000000000000000000000000000000003 -3 2.200000000000000000000000000000 3 2.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494348e-38 1.17549e-38 1.175494354e-38 01.17549e-38 00000001.175494354e-38 01.17549e-38 00000001.175494354e-38 1000-01-03 838:59:56 1970-01-04 00:00:03 1970-01-04 00:00:03 1904 1904 1904 2enum 1set
-100 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
5 5 0000000005 0000000000000000000000000000000000000000000000000000000000000005 0000000005 0000000000000000000000000000000000000000000000000000000000000005 -1 4.400000000000000000000000000000 5 4.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494346e-38 1.17549e-38 1.175494356e-38 01.17549e-38 00000001.175494356e-38 01.17549e-38 00000001.175494356e-38 1000-01-05 838:59:54 1970-01-06 00:00:05 1970-01-06 00:00:05 1906 1906 1906 2enum 1set,2set
6 6 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0 5.500000000000000000000000000000 6 5.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494345e-38 1.17549e-38 1.175494357e-38 01.17549e-38 00000001.175494357e-38 01.17549e-38 00000001.175494357e-38 1000-01-06 838:59:53 1970-01-07 00:00:06 1970-01-07 00:00:06 1907 1907 1907 1enum 1set
7 7 0000000007 0000000000000000000000000000000000000000000000000000000000000007 0000000007 0000000000000000000000000000000000000000000000000000000000000007 1 6.600000000000000000000000000000 7 6.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494344e-38 1.17549e-38 1.175494358e-38 01.17549e-38 00000001.175494358e-38 01.17549e-38 00000001.175494358e-38 1000-01-07 838:59:52 1970-01-08 00:00:07 1970-01-08 00:00:07 1908 1908 1908 2enum 2set
8 8 0000000008 0000000000000000000000000000000000000000000000000000000000000008 0000000008 0000000000000000000000000000000000000000000000000000000000000008 2 7.700000000000000000000000000000 8 7.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494343e-38 1.17549e-38 1.175494359e-38 01.17549e-38 00000001.175494359e-38 01.17549e-38 00000001.175494359e-38 1000-01-08 838:59:51 1970-01-09 00:00:08 1970-01-09 00:00:08 1909 1909 1909 1enum 1set,2set
9 9 0000000009 0000000000000000000000000000000000000000000000000000000000000009 0000000009 0000000000000000000000000000000000000000000000000000000000000009 3 8.800000000000000000000000000000 9 8.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494342e-38 1.17549e-38 1.17549436e-38 01.17549e-38 000000001.17549436e-38 01.17549e-38 000000001.17549436e-38 1000-01-09 838:59:50 1970-01-10 00:00:09 1970-01-10 00:00:09 1910 1910 1910 2enum 1set
10 10 0000000010 0000000000000000000000000000000000000000000000000000000000000010 0000000010 0000000000000000000000000000000000000000000000000000000000000010 4 9.900000000000000000000000000000 10 9.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494341e-38 1.17549e-38 1.175494361e-38 01.17549e-38 00000001.175494361e-38 01.17549e-38 00000001.175494361e-38 1000-01-10 838:59:49 1970-01-11 00:00:10 1970-01-11 00:00:10 1911 1911 1911 1enum 2set
-76710 226546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-2760 985654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-569300 9114376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-660 876546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-250 87895654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-340 9984376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-3410 996546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-2550 775654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-3330 764376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-441 16546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+15 87 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+17 15 0000000016 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+19 18 0000000014 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+22 93 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+24 51654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+27 25 0000000026 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+29 28 0000000024 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+34 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+94 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
+100 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
+100 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
drop view test.v1 ;
CREATE VIEW test.v1 AS SELECT F59,f61 FROM test.tb2 limit 20 ;
-SELECT * FROM test.v1 limit 50;
+SELECT * FROM test.v1 order by f59,f61 desc limit 50;
F59 f61
1 0000000001
2 0000000002
3 0000000003
-100 0000000004
5 0000000005
6 0000000006
7 0000000007
8 0000000008
9 0000000009
10 0000000010
-76710 NULL
-2760 NULL
-569300 NULL
-660 NULL
+100 0000000004
250 NULL
340 NULL
-3410 NULL
+441 NULL
+660 NULL
2550 NULL
+2760 NULL
3330 NULL
-441 NULL
+3410 NULL
+76710 NULL
+569300 NULL
drop view test.v1 ;
Testcase 3.3.1.54
@@ -9820,7 +9820,7 @@ Insert into t2 values (2,2000) ;
Insert into t2 values (31,97) ;
Create view test.v1 as select t1.f59, t1.f60
from t1,t2 where t1.f59=t2.f59 ;
-Select * from test.v1 limit 50 ;
+Select * from test.v1 order by f59 limit 50 ;
f59 f60
1 10
2 20
@@ -9886,7 +9886,7 @@ create or replace view test.v1 as
Select t1.f59 t1_f59, t2.f59 t2_f59, t1.f60 t1_f60, t2.f60 t2_f60,
t1.f61 t1_f61, t2.f61 t2_f61
from t1 inner join t2 where t1.f59 = t2.f59 ;
-select * from test.v1;
+select * from test.v1 order by t1_f59 ;
t1_f59 t2_f59 t1_f60 t2_f60 t1_f61 t2_f61
2 2 double double 6 6
3 3 single-f3 single-f3 4 6
@@ -9899,7 +9899,7 @@ t1_f59 t2_f59 t1_f60 t2_f60 t1_f61 t2_f61
Create or replace view test.v1 as
Select t1.f59 AS t1_f59, t2.f59 AS t2_f59
FROM t2 cross join t1;
-Select * from v1;
+Select * from v1 order by t1_f59,t2_f59;
t1_f59 t2_f59
1 2
1 3
@@ -9925,7 +9925,7 @@ t1_f59 t2_f59
Create or replace view test.v1 as
Select straight_join t1.f59 AS t1_f59, t2.f59 AS t2_f59
FROM t2,t1;
-Select * from v1;
+Select * from v1 order by t1_f59,t2_f59;
t1_f59 t2_f59
1 2
1 3
@@ -9951,7 +9951,7 @@ t1_f59 t2_f59
Create or replace view test.v1 as
Select f59, f60, f61, a, b
FROM t2 natural join t1;
-Select * from v1;
+Select * from v1 order by f59;
f59 f60 f61 a b
2 double 6 2 2
Select f59, f60, f61, a, b
@@ -9962,11 +9962,11 @@ Create or replace view test.v1 as
Select t1.f59 t1_f59, t2.f59 t2_f59, t1.f60 t1_f60, t2.f60 t2_f60,
t1.f61 t1_f61, t2.f61 t2_f61
FROM t2 left outer join t1 on t2.f59=t1.f59;
-Select * from v1;
+Select * from v1 order by t1_f59;
t1_f59 t2_f59 t1_f60 t2_f60 t1_f61 t2_f61
+NULL 4 NULL single NULL 4
2 2 double double 6 6
3 3 single-f3 single-f3 4 6
-NULL 4 NULL single NULL 4
Select t1.f59 t1_f59, t2.f59 t2_f59, t1.f60 t1_f60, t2.f60 t2_f60,
t1.f61 t1_f61, t2.f61 t2_f61
FROM t2 left outer join t1 on t2.f59=t1.f59;
@@ -9977,7 +9977,7 @@ NULL 4 NULL single NULL 4
Create or replace view test.v1 as
Select f59, f60, f61, t1.a, t2.b
FROM t2 natural left outer join t1;
-Select * from v1;
+Select * from v1 order by f59;
f59 f60 f61 a b
2 double 6 2 2
3 single-f3 6 NULL 3
@@ -9992,7 +9992,7 @@ Create or replace view test.v1 as
Select t1.f59 t1_f59, t2.f59 t2_f59, t1.f60 t1_f60, t2.f60 t2_f60,
t1.f61 t1_f61, t2.f61 t2_f61
FROM t2 right outer join t1 on t2.f59=t1.f59;
-Select * from v1;
+Select * from v1 order by t1_f59;
t1_f59 t2_f59 t1_f60 t2_f60 t1_f61 t2_f61
1 NULL single NULL 3 NULL
2 2 double double 6 6
@@ -10007,11 +10007,11 @@ t1_f59 t2_f59 t1_f60 t2_f60 t1_f61 t2_f61
Create or replace view test.v1 as
Select f59, f60, a, b
FROM t2 natural right outer join t1;
-Select * from v1;
+Select * from v1 order by f59 desc;
f59 f60 a b
-1 single 1 NULL
-2 double 2 2
3 single-f3 3 NULL
+2 double 2 2
+1 single 1 NULL
Select f59, f60, a, b
FROM t2 natural right outer join t1;
f59 f60 a b
@@ -10032,18 +10032,18 @@ Insert into t1 values (107,501,601) ;
Insert into t1 values (901,801,401) ;
Create or replace view test.v1 as
Select tb2.f59 FROM tb2 LEFT JOIN t1 on tb2.f59 = t1.f59 ;
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
f59
1
2
3
-100
5
6
7
8
9
10
+15
Drop view if exists test.v1 ;
Drop table if exists t1 ;
Drop view if exists v1;
@@ -10053,7 +10053,7 @@ Insert into t1 values (207,201,201) ;
Insert into t1 values (201,201,201) ;
Create or replace view test.v1
as Select tb2.f59 FROM tb2 INNER JOIN t1 on tb2.f59 = t1.f59 ;
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
f59
207
Drop view if exists test.v1 ;
@@ -10065,7 +10065,7 @@ Insert into t1 values (27,21,21) ;
Insert into t1 values (21,21,21) ;
Create or replace view test.v1
as Select tb2.f59 FROM tb2 CROSS JOIN t1 on tb2.f59 = t1.f59 ;
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
f59
27
Drop view test.v1 ;
@@ -10080,18 +10080,18 @@ Insert into t1 values (17,51,61) ;
Insert into t1 values (91,81,41) ;
Create or replace view test.v1 as (Select f59 FROM tb2 where f59=17 )
Union ALL (Select f59 from t1 where f59=17 );
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
f59
17
17
Create or replace view test.v1 as (Select f59 FROM tb2 where f59=17 )
Union (Select f59 from t1 where f59=17 );
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
f59
17
Create or replace view test.v1 as (Select f59 FROM tb2 where f59=17 )
Union Distinct (Select f59 from t1 where f60=17 );
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
f59
17
Drop view test.v1 ;
@@ -10103,7 +10103,7 @@ insert into t1 values (107,501,601);
insert into t1 values (901,801,401);
create or replace view test.v1 as
select tb2.f59 from tb2 join t1 on tb2.f59 = t1.f59;
-select * from test.v1 limit 0,10;
+select * from test.v1 order by f59 limit 0,10;
f59
107
107
@@ -10111,7 +10111,7 @@ create or replace view test.v1 as
(select f59 from tb2 where f59=107 )
union all
(select f59 from t1 where f59=107 );
-select * from test.v1 limit 0,10;
+select * from test.v1 order by f59 limit 0,10;
f59
107
107
@@ -10120,14 +10120,14 @@ create or replace view test.v1 as
(select f59 from tb2 where f59=107 )
union
(select f59 from t1 where f59=107 );
-select * from test.v1 limit 0,10;
+select * from test.v1 order by f59 limit 0,10;
f59
107
create or replace view test.v1 as
(select f59 from tb2 where f59=107 )
union distinct
(select f59 from t1 where f59=107 );
-select * from test.v1 limit 0,10;
+select * from test.v1 order by f59 limit 0,10;
f59
107
drop view if exists test.v1 ;
@@ -10138,13 +10138,13 @@ Testcase 3.3.1.64
Drop view if exists test.v1 ;
CREATE VIEW test.v1 AS SELECT F59
FROM test.tb2 where test.tb2.F59 = 109;
-SELECT * FROM test.v1 limit 0,10;
+SELECT * FROM test.v1 order by f59 limit 0,10;
F59
109
109
ALTER VIEW test.v1 AS SELECT *
FROM test.tb2 WHERE test.tb2.f59 = 242 ;
-SELECT * FROM test.v1 limit 0,10;
+SELECT * FROM test.v1 order by f59 limit 0,10;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109 f110 f111 f112 f113 f114 f115 f116 f117
242 79 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
Drop view test.v1 ;
@@ -10224,7 +10224,8 @@ SHOW FIELDS FROM v1;
ERROR 42S02: Table 'test.v1' doesn't exist
CHECK TABLE v1;
Table Op Msg_type Msg_text
-test.v1 check error Table 'test.v1' doesn't exist
+test.v1 check Error Table 'test.v1' doesn't exist
+test.v1 check error Corrupt
DESCRIBE v1;
ERROR 42S02: Table 'test.v1' doesn't exist
EXPLAIN SELECT * FROM v1;
@@ -10271,8 +10272,8 @@ CREATE VIEW test3.v30 AS SELECT * FROM test3.v29;
CREATE VIEW test3.v31 AS SELECT * FROM test3.v30;
CREATE VIEW test3.v32 AS SELECT * FROM test3.v31;
SHOW CREATE VIEW test3.v32;
-View Create View
-v32 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test3`.`v32` AS select `v31`.`f1` AS `f1` from `test3`.`v31`
+View Create View character_set_client collation_connection
+v32 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test3`.`v32` AS select `v31`.`f1` AS `f1` from `test3`.`v31` latin1 latin1_swedish_ci
SELECT * FROM test3.v32;
f1
1.000
@@ -10281,8 +10282,8 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1
DROP VIEW test3.v0;
SHOW CREATE VIEW test3.v32;
-View Create View
-v32 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test3`.`v32` AS select `v31`.`f1` AS `f1` from `test3`.`v31`
+View Create View character_set_client collation_connection
+v32 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test3`.`v32` AS select `v31`.`f1` AS `f1` from `test3`.`v31` latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'test3.v32' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
SELECT * FROM test3.v32;
@@ -10290,15 +10291,13 @@ ERROR HY000: View 'test3.v32' references invalid table(s) or column(s) or functi
EXPLAIN SELECT * FROM test3.v32;
ERROR HY000: View 'test3.v32' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
-FIXME - Setting join_limit to 30 - hangs for higher values
+FIXME - Setting join_limit to 28 - hangs for higher values
----------------------------------------------------------
-SET @join_limit = 30;
+SET @join_limit = 28;
SET @max_level = @join_limit - 1;
DROP DATABASE IF EXISTS test3;
DROP TABLE IF EXISTS test1.t1;
DROP TABLE IF EXISTS test2.t1;
-DROP VIEW IF EXISTS test1.v29;
-DROP VIEW IF EXISTS test1.v28;
DROP VIEW IF EXISTS test1.v27;
DROP VIEW IF EXISTS test1.v26;
DROP VIEW IF EXISTS test1.v25;
@@ -10392,8 +10391,8 @@ FROM test2.t1 tab1 NATURAL JOIN test1.v18 tab2;
CREATE OR REPLACE VIEW test1.v20 AS SELECT f1, f2
FROM test3.t1 tab1 NATURAL JOIN test1.v19 tab2;
SHOW CREATE VIEW test1.v20;
-View Create View
-v20 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v20` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v19` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`))))
+View Create View character_set_client collation_connection
+v20 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v20` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v19` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`)))) latin1 latin1_swedish_ci
SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
CAST(f2 AS CHAR) AS f2 FROM test1.v20;
f1 f2
@@ -10408,8 +10407,8 @@ CAST(f2 AS CHAR) AS f2 FROM test1.v20;
CREATE VIEW test1.v21 AS SELECT f1, f2
FROM test3.t1 tab1 NATURAL JOIN test1.v20 tab2;
SHOW CREATE VIEW test1.v21;
-View Create View
-v21 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v21` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v20` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`))))
+View Create View character_set_client collation_connection
+v21 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v21` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v20` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`)))) latin1 latin1_swedish_ci
SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
CAST(f2 AS CHAR) AS f2 FROM test1.v21;
f1 f2
@@ -10508,7 +10507,7 @@ info: Rows matched: 1 Changed: 1 Warnings: 0
SELECT * FROM tb2 where f59 = 8 and f60 = 105;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109 f110 f111 f112 f113 f114 f115 f116 f117
8 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-SELECT f59,f60 FROM test.v1 where f59 = 8 and f60 = 105;
+SELECT f59,f60 FROM test.v1 where f59 = 8 and f60 = 105 ;
f59 f60
8 105
Drop view test.v1 ;
@@ -10527,7 +10526,7 @@ f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78
891 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
891 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
891 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set NULL NULL NULL NULL NULL NULL NULL NULL
-SELECT f59,f60 FROM test.v1 where f59 = 891 and f60 = 105;
+SELECT f59,f60 FROM test.v1 where f59 = 891 and f60 = 105 ;
f59 f60
891 105
891 105
@@ -10544,7 +10543,7 @@ DELETE FROM test.v1 where f59 = 789 ;
affected rows: 1
SELECT * FROM tb2 where f59 = 789 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109 f110 f111 f112 f113 f114 f115 f116 f117
-SELECT f59,f60 FROM test.v1 where f59 = 789;
+SELECT f59,f60 FROM test.v1 where f59 = 789 order by f60 ;
f59 f60
Drop view test.v1 ;
@@ -10557,7 +10556,7 @@ DELETE FROM test.v1 where f59 = 711 ;
affected rows: 1
SELECT * FROM tb2 where f59 = 711 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109 f110 f111 f112 f113 f114 f115 f116 f117
-SELECT f59,f60 FROM test.v1 where f59 = 711;
+SELECT f59,f60 FROM test.v1 where f59 = 711 order by f60 ;
f59 f60
Drop view test.v1 ;
diff --git a/mysql-test/suite/funcs_1/r/ndb__datadict.result b/mysql-test/suite/funcs_1/r/ndb__datadict.result
index cf3b5c29bfe..ebb45bf6ea2 100644
--- a/mysql-test/suite/funcs_1/r/ndb__datadict.result
+++ b/mysql-test/suite/funcs_1/r/ndb__datadict.result
@@ -345,9 +345,9 @@ TABLE_CATALOG NULL
TABLE_SCHEMA information_schema
TABLE_NAME GLOBAL_VARIABLES
TABLE_TYPE SYSTEM VIEW
-ENGINE MyISAM
+ENGINE MEMORY
VERSION 10
-ROW_FORMAT Dynamic
+ROW_FORMAT Fixed
TABLE_ROWS NULL
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
@@ -555,9 +555,9 @@ TABLE_CATALOG NULL
TABLE_SCHEMA information_schema
TABLE_NAME SESSION_VARIABLES
TABLE_TYPE SYSTEM VIEW
-ENGINE MyISAM
+ENGINE MEMORY
VERSION 10
-ROW_FORMAT Dynamic
+ROW_FORMAT Fixed
TABLE_ROWS NULL
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
@@ -896,7 +896,7 @@ TABLE_TYPE BASE TABLE
ENGINE CSV
VERSION 10
ROW_FORMAT Dynamic
-TABLE_ROWS 2
+TABLE_ROWS 1
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -917,7 +917,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Fixed
-TABLE_ROWS 0
+TABLE_ROWS 37
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -938,7 +938,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Fixed
-TABLE_ROWS 0
+TABLE_ROWS 424
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -959,7 +959,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Fixed
-TABLE_ROWS 0
+TABLE_ROWS 901
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -980,7 +980,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Dynamic
-TABLE_ROWS 0
+TABLE_ROWS 479
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -1019,7 +1019,7 @@ TABLE_CATALOG NULL
TABLE_SCHEMA mysql
TABLE_NAME ndb_apply_status
TABLE_TYPE BASE TABLE
-ENGINE NDBCLUSTER
+ENGINE ndbcluster
VERSION 10
ROW_FORMAT Dynamic
TABLE_ROWS 0
@@ -1035,7 +1035,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT number_of_replicas: 2
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA mysql
TABLE_NAME ndb_binlog_index
@@ -1043,7 +1043,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Dynamic
-TABLE_ROWS 5
+TABLE_ROWS 0
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -1292,7 +1292,7 @@ TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t1
TABLE_TYPE BASE TABLE
-ENGINE NDBCLUSTER
+ENGINE ndbcluster
VERSION 10
ROW_FORMAT Fixed
TABLE_ROWS 10
@@ -1308,12 +1308,12 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT number_of_replicas: 2
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t10
TABLE_TYPE BASE TABLE
-ENGINE NDBCLUSTER
+ENGINE ndbcluster
VERSION 10
ROW_FORMAT Fixed
TABLE_ROWS 10
@@ -1329,12 +1329,12 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT number_of_replicas: 2
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t11
TABLE_TYPE BASE TABLE
-ENGINE NDBCLUSTER
+ENGINE ndbcluster
VERSION 10
ROW_FORMAT Fixed
TABLE_ROWS 10
@@ -1350,12 +1350,12 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT number_of_replicas: 2
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t2
TABLE_TYPE BASE TABLE
-ENGINE NDBCLUSTER
+ENGINE ndbcluster
VERSION 10
ROW_FORMAT Fixed
TABLE_ROWS 10
@@ -1371,12 +1371,12 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT number_of_replicas: 2
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t3
TABLE_TYPE BASE TABLE
-ENGINE NDBCLUSTER
+ENGINE ndbcluster
VERSION 10
ROW_FORMAT Fixed
TABLE_ROWS 10
@@ -1392,12 +1392,12 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT number_of_replicas: 2
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t4
TABLE_TYPE BASE TABLE
-ENGINE NDBCLUSTER
+ENGINE ndbcluster
VERSION 10
ROW_FORMAT Fixed
TABLE_ROWS 10
@@ -1413,12 +1413,12 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT number_of_replicas: 2
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t7
TABLE_TYPE BASE TABLE
-ENGINE NDBCLUSTER
+ENGINE ndbcluster
VERSION 10
ROW_FORMAT Fixed
TABLE_ROWS 10
@@ -1434,12 +1434,12 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT number_of_replicas: 2
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t8
TABLE_TYPE BASE TABLE
-ENGINE NDBCLUSTER
+ENGINE ndbcluster
VERSION 10
ROW_FORMAT Fixed
TABLE_ROWS 10
@@ -1455,12 +1455,12 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT number_of_replicas: 2
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t9
TABLE_TYPE BASE TABLE
-ENGINE NDBCLUSTER
+ENGINE ndbcluster
VERSION 10
ROW_FORMAT Fixed
TABLE_ROWS 10
@@ -1476,7 +1476,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT number_of_replicas: 2
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME tb1
@@ -1565,7 +1565,7 @@ TABLE_CATALOG NULL
TABLE_SCHEMA test4
TABLE_NAME t6
TABLE_TYPE BASE TABLE
-ENGINE NDBCLUSTER
+ENGINE ndbcluster
VERSION 10
ROW_FORMAT Fixed
TABLE_ROWS 10
@@ -1581,7 +1581,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT number_of_replicas: 2
+TABLE_COMMENT
select s.catalog_name, s.schema_name, s.default_character_set_name,
t.table_type, t.engine
from schemata s inner join tables t
@@ -1614,17 +1614,19 @@ NULL db_datadict latin1 BASE TABLE MyISAM
NULL db_datadict latin1 BASE TABLE MyISAM
NULL db_datadict latin1 BASE TABLE MyISAM
NULL db_datadict latin1 BASE TABLE MyISAM
-NULL db_datadict latin1 BASE TABLE NDBCLUSTER
-NULL db_datadict latin1 BASE TABLE NDBCLUSTER
-NULL db_datadict latin1 BASE TABLE NDBCLUSTER
-NULL db_datadict latin1 BASE TABLE NDBCLUSTER
-NULL db_datadict latin1 BASE TABLE NDBCLUSTER
-NULL db_datadict latin1 BASE TABLE NDBCLUSTER
-NULL db_datadict latin1 BASE TABLE NDBCLUSTER
-NULL db_datadict latin1 BASE TABLE NDBCLUSTER
-NULL db_datadict latin1 BASE TABLE NDBCLUSTER
-NULL db_datadict latin1 BASE TABLE NDBCLUSTER
-NULL db_datadict latin1 BASE TABLE NDBCLUSTER
+NULL db_datadict latin1 BASE TABLE ndbcluster
+NULL db_datadict latin1 BASE TABLE ndbcluster
+NULL db_datadict latin1 BASE TABLE ndbcluster
+NULL db_datadict latin1 BASE TABLE ndbcluster
+NULL db_datadict latin1 BASE TABLE ndbcluster
+NULL db_datadict latin1 BASE TABLE ndbcluster
+NULL db_datadict latin1 BASE TABLE ndbcluster
+NULL db_datadict latin1 BASE TABLE ndbcluster
+NULL db_datadict latin1 BASE TABLE ndbcluster
+NULL db_datadict latin1 BASE TABLE ndbcluster
+NULL db_datadict latin1 BASE TABLE ndbcluster
+NULL db_datadict latin1 SYSTEM VIEW MEMORY
+NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
@@ -1642,8 +1644,6 @@ NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
-NULL db_datadict latin1 SYSTEM VIEW MyISAM
-NULL db_datadict latin1 SYSTEM VIEW MyISAM
NULL db_datadict latin1 SYSTEM VIEW MyISAM
NULL db_datadict latin1 SYSTEM VIEW MyISAM
NULL db_datadict latin1 SYSTEM VIEW MyISAM
@@ -1682,17 +1682,19 @@ NULL information_schema utf8 BASE TABLE MyISAM
NULL information_schema utf8 BASE TABLE MyISAM
NULL information_schema utf8 BASE TABLE MyISAM
NULL information_schema utf8 BASE TABLE MyISAM
-NULL information_schema utf8 BASE TABLE NDBCLUSTER
-NULL information_schema utf8 BASE TABLE NDBCLUSTER
-NULL information_schema utf8 BASE TABLE NDBCLUSTER
-NULL information_schema utf8 BASE TABLE NDBCLUSTER
-NULL information_schema utf8 BASE TABLE NDBCLUSTER
-NULL information_schema utf8 BASE TABLE NDBCLUSTER
-NULL information_schema utf8 BASE TABLE NDBCLUSTER
-NULL information_schema utf8 BASE TABLE NDBCLUSTER
-NULL information_schema utf8 BASE TABLE NDBCLUSTER
-NULL information_schema utf8 BASE TABLE NDBCLUSTER
-NULL information_schema utf8 BASE TABLE NDBCLUSTER
+NULL information_schema utf8 BASE TABLE ndbcluster
+NULL information_schema utf8 BASE TABLE ndbcluster
+NULL information_schema utf8 BASE TABLE ndbcluster
+NULL information_schema utf8 BASE TABLE ndbcluster
+NULL information_schema utf8 BASE TABLE ndbcluster
+NULL information_schema utf8 BASE TABLE ndbcluster
+NULL information_schema utf8 BASE TABLE ndbcluster
+NULL information_schema utf8 BASE TABLE ndbcluster
+NULL information_schema utf8 BASE TABLE ndbcluster
+NULL information_schema utf8 BASE TABLE ndbcluster
+NULL information_schema utf8 BASE TABLE ndbcluster
+NULL information_schema utf8 SYSTEM VIEW MEMORY
+NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
@@ -1710,8 +1712,6 @@ NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
-NULL information_schema utf8 SYSTEM VIEW MyISAM
-NULL information_schema utf8 SYSTEM VIEW MyISAM
NULL information_schema utf8 SYSTEM VIEW MyISAM
NULL information_schema utf8 SYSTEM VIEW MyISAM
NULL information_schema utf8 SYSTEM VIEW MyISAM
@@ -1750,17 +1750,19 @@ NULL mysql latin1 BASE TABLE MyISAM
NULL mysql latin1 BASE TABLE MyISAM
NULL mysql latin1 BASE TABLE MyISAM
NULL mysql latin1 BASE TABLE MyISAM
-NULL mysql latin1 BASE TABLE NDBCLUSTER
-NULL mysql latin1 BASE TABLE NDBCLUSTER
-NULL mysql latin1 BASE TABLE NDBCLUSTER
-NULL mysql latin1 BASE TABLE NDBCLUSTER
-NULL mysql latin1 BASE TABLE NDBCLUSTER
-NULL mysql latin1 BASE TABLE NDBCLUSTER
-NULL mysql latin1 BASE TABLE NDBCLUSTER
-NULL mysql latin1 BASE TABLE NDBCLUSTER
-NULL mysql latin1 BASE TABLE NDBCLUSTER
-NULL mysql latin1 BASE TABLE NDBCLUSTER
-NULL mysql latin1 BASE TABLE NDBCLUSTER
+NULL mysql latin1 BASE TABLE ndbcluster
+NULL mysql latin1 BASE TABLE ndbcluster
+NULL mysql latin1 BASE TABLE ndbcluster
+NULL mysql latin1 BASE TABLE ndbcluster
+NULL mysql latin1 BASE TABLE ndbcluster
+NULL mysql latin1 BASE TABLE ndbcluster
+NULL mysql latin1 BASE TABLE ndbcluster
+NULL mysql latin1 BASE TABLE ndbcluster
+NULL mysql latin1 BASE TABLE ndbcluster
+NULL mysql latin1 BASE TABLE ndbcluster
+NULL mysql latin1 BASE TABLE ndbcluster
+NULL mysql latin1 SYSTEM VIEW MEMORY
+NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
@@ -1778,8 +1780,6 @@ NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
-NULL mysql latin1 SYSTEM VIEW MyISAM
-NULL mysql latin1 SYSTEM VIEW MyISAM
NULL mysql latin1 SYSTEM VIEW MyISAM
NULL mysql latin1 SYSTEM VIEW MyISAM
NULL mysql latin1 SYSTEM VIEW MyISAM
@@ -1818,17 +1818,19 @@ NULL test latin1 BASE TABLE MyISAM
NULL test latin1 BASE TABLE MyISAM
NULL test latin1 BASE TABLE MyISAM
NULL test latin1 BASE TABLE MyISAM
-NULL test latin1 BASE TABLE NDBCLUSTER
-NULL test latin1 BASE TABLE NDBCLUSTER
-NULL test latin1 BASE TABLE NDBCLUSTER
-NULL test latin1 BASE TABLE NDBCLUSTER
-NULL test latin1 BASE TABLE NDBCLUSTER
-NULL test latin1 BASE TABLE NDBCLUSTER
-NULL test latin1 BASE TABLE NDBCLUSTER
-NULL test latin1 BASE TABLE NDBCLUSTER
-NULL test latin1 BASE TABLE NDBCLUSTER
-NULL test latin1 BASE TABLE NDBCLUSTER
-NULL test latin1 BASE TABLE NDBCLUSTER
+NULL test latin1 BASE TABLE ndbcluster
+NULL test latin1 BASE TABLE ndbcluster
+NULL test latin1 BASE TABLE ndbcluster
+NULL test latin1 BASE TABLE ndbcluster
+NULL test latin1 BASE TABLE ndbcluster
+NULL test latin1 BASE TABLE ndbcluster
+NULL test latin1 BASE TABLE ndbcluster
+NULL test latin1 BASE TABLE ndbcluster
+NULL test latin1 BASE TABLE ndbcluster
+NULL test latin1 BASE TABLE ndbcluster
+NULL test latin1 BASE TABLE ndbcluster
+NULL test latin1 SYSTEM VIEW MEMORY
+NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
@@ -1846,8 +1848,6 @@ NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
-NULL test latin1 SYSTEM VIEW MyISAM
-NULL test latin1 SYSTEM VIEW MyISAM
NULL test latin1 SYSTEM VIEW MyISAM
NULL test latin1 SYSTEM VIEW MyISAM
NULL test latin1 SYSTEM VIEW MyISAM
@@ -1886,17 +1886,19 @@ NULL test1 latin1 BASE TABLE MyISAM
NULL test1 latin1 BASE TABLE MyISAM
NULL test1 latin1 BASE TABLE MyISAM
NULL test1 latin1 BASE TABLE MyISAM
-NULL test1 latin1 BASE TABLE NDBCLUSTER
-NULL test1 latin1 BASE TABLE NDBCLUSTER
-NULL test1 latin1 BASE TABLE NDBCLUSTER
-NULL test1 latin1 BASE TABLE NDBCLUSTER
-NULL test1 latin1 BASE TABLE NDBCLUSTER
-NULL test1 latin1 BASE TABLE NDBCLUSTER
-NULL test1 latin1 BASE TABLE NDBCLUSTER
-NULL test1 latin1 BASE TABLE NDBCLUSTER
-NULL test1 latin1 BASE TABLE NDBCLUSTER
-NULL test1 latin1 BASE TABLE NDBCLUSTER
-NULL test1 latin1 BASE TABLE NDBCLUSTER
+NULL test1 latin1 BASE TABLE ndbcluster
+NULL test1 latin1 BASE TABLE ndbcluster
+NULL test1 latin1 BASE TABLE ndbcluster
+NULL test1 latin1 BASE TABLE ndbcluster
+NULL test1 latin1 BASE TABLE ndbcluster
+NULL test1 latin1 BASE TABLE ndbcluster
+NULL test1 latin1 BASE TABLE ndbcluster
+NULL test1 latin1 BASE TABLE ndbcluster
+NULL test1 latin1 BASE TABLE ndbcluster
+NULL test1 latin1 BASE TABLE ndbcluster
+NULL test1 latin1 BASE TABLE ndbcluster
+NULL test1 latin1 SYSTEM VIEW MEMORY
+NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
@@ -1914,8 +1916,6 @@ NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
-NULL test1 latin1 SYSTEM VIEW MyISAM
-NULL test1 latin1 SYSTEM VIEW MyISAM
NULL test1 latin1 SYSTEM VIEW MyISAM
NULL test1 latin1 SYSTEM VIEW MyISAM
NULL test1 latin1 SYSTEM VIEW MyISAM
@@ -1954,17 +1954,19 @@ NULL test4 latin1 BASE TABLE MyISAM
NULL test4 latin1 BASE TABLE MyISAM
NULL test4 latin1 BASE TABLE MyISAM
NULL test4 latin1 BASE TABLE MyISAM
-NULL test4 latin1 BASE TABLE NDBCLUSTER
-NULL test4 latin1 BASE TABLE NDBCLUSTER
-NULL test4 latin1 BASE TABLE NDBCLUSTER
-NULL test4 latin1 BASE TABLE NDBCLUSTER
-NULL test4 latin1 BASE TABLE NDBCLUSTER
-NULL test4 latin1 BASE TABLE NDBCLUSTER
-NULL test4 latin1 BASE TABLE NDBCLUSTER
-NULL test4 latin1 BASE TABLE NDBCLUSTER
-NULL test4 latin1 BASE TABLE NDBCLUSTER
-NULL test4 latin1 BASE TABLE NDBCLUSTER
-NULL test4 latin1 BASE TABLE NDBCLUSTER
+NULL test4 latin1 BASE TABLE ndbcluster
+NULL test4 latin1 BASE TABLE ndbcluster
+NULL test4 latin1 BASE TABLE ndbcluster
+NULL test4 latin1 BASE TABLE ndbcluster
+NULL test4 latin1 BASE TABLE ndbcluster
+NULL test4 latin1 BASE TABLE ndbcluster
+NULL test4 latin1 BASE TABLE ndbcluster
+NULL test4 latin1 BASE TABLE ndbcluster
+NULL test4 latin1 BASE TABLE ndbcluster
+NULL test4 latin1 BASE TABLE ndbcluster
+NULL test4 latin1 BASE TABLE ndbcluster
+NULL test4 latin1 SYSTEM VIEW MEMORY
+NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
@@ -1982,8 +1984,6 @@ NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
-NULL test4 latin1 SYSTEM VIEW MyISAM
-NULL test4 latin1 SYSTEM VIEW MyISAM
NULL test4 latin1 SYSTEM VIEW MyISAM
NULL test4 latin1 SYSTEM VIEW MyISAM
NULL test4 latin1 SYSTEM VIEW MyISAM
@@ -2062,6 +2062,9 @@ NULL information_schema EVENTS LAST_ALTERED 18 0000-00-00 00:00:00 NO datetime N
NULL information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime 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 ORIGINATOR 21 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10) 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 DATABASE_COLLATION 24 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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
@@ -2101,9 +2104,9 @@ NULL information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 19 0 NULL NU
NULL information_schema FILES STATUS 37 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema FILES EXTRA 38 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -2190,6 +2193,9 @@ NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime
NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 DATABASE_COLLATION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -2201,9 +2207,9 @@ NULL information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL
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 IS_GRANTABLE 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema STATISTICS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -2271,6 +2277,9 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NUL
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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 TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -2283,6 +2292,8 @@ NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+NULL information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL db_datadict v1 TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select,insert,update,references
NULL db_datadict v1 TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
NULL db_datadict v1 TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
@@ -2394,6 +2405,10 @@ NULL mysql event sql_mode 15 NO set 431 1293 NULL NULL utf8 utf8_general_ci set
NULL mysql event comment 16 NO char 64 192 NULL NULL utf8 utf8_bin char(64) select,insert,update,references
NULL mysql event originator 17 NULL NO int NULL NULL 10 0 NULL NULL int(10) 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 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 db_collation 21 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) 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 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 dl 3 NO char 128 384 NULL NULL utf8 utf8_bin char(128) select,insert,update,references
@@ -2468,6 +2483,10 @@ NULL mysql proc created 13 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NU
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 sql_mode 15 NO set 431 1293 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') 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 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 db_collation 19 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) 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 procs_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) 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 User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
@@ -2857,10 +2876,10 @@ select @x, @y;
@x @y
big5_chinese_ci big5
select * from 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
+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_1 NULL db_datadict sp_1 PROCEDURE NULL SQL BEGIN
SELECT * FROM db_datadict.v1;
-END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost
+END 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
select count(*) from routines;
count(*)
1
@@ -2880,18 +2899,18 @@ NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE
NULL mysql event 0 mysql PRIMARY 1 db A NULL NULL NULL BTREE
NULL mysql event 0 mysql PRIMARY 2 name A 0 NULL NULL BTREE
NULL mysql func 0 mysql PRIMARY 1 name A 0 NULL NULL BTREE
-NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 0 NULL NULL BTREE
-NULL mysql help_category 0 mysql name 1 name A 0 NULL NULL BTREE
-NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A 0 NULL NULL BTREE
-NULL mysql help_keyword 0 mysql name 1 name A 0 NULL NULL BTREE
+NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 37 NULL NULL BTREE
+NULL mysql help_category 0 mysql name 1 name A 37 NULL NULL BTREE
+NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A 424 NULL NULL BTREE
+NULL mysql help_keyword 0 mysql name 1 name A 424 NULL NULL BTREE
NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A NULL NULL NULL BTREE
-NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A 0 NULL NULL BTREE
-NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A 0 NULL NULL BTREE
-NULL mysql help_topic 0 mysql name 1 name A 0 NULL NULL BTREE
+NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A 901 NULL NULL BTREE
+NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A 479 NULL NULL BTREE
+NULL mysql help_topic 0 mysql name 1 name A 479 NULL NULL BTREE
NULL mysql host 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
NULL mysql host 0 mysql PRIMARY 2 Db A 0 NULL NULL BTREE
NULL mysql ndb_apply_status 0 mysql PRIMARY 1 server_id NULL 0 NULL NULL HASH
-NULL mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A 5 NULL NULL BTREE
+NULL mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A 0 NULL NULL BTREE
NULL mysql plugin 0 mysql PRIMARY 1 name A 0 NULL NULL BTREE
NULL mysql proc 0 mysql PRIMARY 1 db A NULL NULL NULL BTREE
NULL mysql proc 0 mysql PRIMARY 2 name A NULL NULL NULL BTREE
@@ -2916,10 +2935,10 @@ NULL mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A 393 NULL NUL
NULL mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A NULL NULL NULL BTREE
NULL mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A 31 NULL NULL BTREE
select * from views;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
-NULL db_datadict v1 /* ALGORITHM=UNDEFINED */ 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` NONE NO root@localhost DEFINER
-NULL db_datadict vu /* ALGORITHM=UNDEFINED */ select distinct `vu1`.`u` AS `u`,substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3)) AS `server`,substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3),(length(substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3))) - 1)) AS `Server_Clean` from `db_datadict`.`vu1` NONE NO root@localhost DEFINER
-NULL db_datadict vu1 /* ALGORITHM=UNDEFINED */ select `user_privileges`.`GRANTEE` AS `u` from `information_schema`.`user_privileges` NONE NO root@localhost DEFINER
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
+NULL db_datadict v1 SELECT * FROM information_schema.tables NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+NULL db_datadict vu SELECT DISTINCT u, NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+NULL db_datadict vu1 SELECT grantee AS u NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
select * from user_privileges order by grantee, privilege_type;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'127.0.0.1' NULL ALTER YES
@@ -3121,7 +3140,7 @@ max_recs
46
select max(cardinality) from statistics;
max(cardinality)
-393
+901
select concat("View '",
table_name, "' is associated with the database '", table_schema, "'.")
AS "Who is Who for the Views"
@@ -3246,8 +3265,8 @@ columns_priv 7
COLUMN_PRIVILEGES 7
db 22
ENGINES 6
-event 18
-EVENTS 21
+event 22
+EVENTS 24
FILES 38
func 4
general_log 6
@@ -3264,11 +3283,11 @@ ndb_binlog_index 7
PARTITIONS 25
plugin 2
PLUGINS 10
-proc 16
+proc 20
PROCESSLIST 8
procs_priv 8
REFERENTIAL_CONSTRAINTS 11
-ROUTINES 20
+ROUTINES 23
SCHEMATA 5
SCHEMA_PRIVILEGES 5
servers 9
@@ -3299,11 +3318,11 @@ time_zone_leap_second 2
time_zone_name 2
time_zone_transition 3
time_zone_transition_type 5
-TRIGGERS 19
+TRIGGERS 22
user 39
USER_PRIVILEGES 4
v1 21
-VIEWS 8
+VIEWS 10
vu 3
vu1 1
@@ -3328,16 +3347,16 @@ SELECT * FROM collation_character_set_applicability LIMIT 1;
COLLATION_NAME CHARACTER_SET_NAME
big5_chinese_ci big5
SELECT * FROM routines LIMIT 1;
-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
+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_1 NULL db_datadict sp_1 PROCEDURE NULL SQL BEGIN
SELECT * FROM db_datadict.v1;
-END NULL NULL SQL NO CONTAINS SQL NULL DEFINER <Created> <Last_Altered> root@localhost
+END NULL NULL SQL NO CONTAINS SQL NULL DEFINER <Created> <Last_Altered> root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
SELECT * FROM statistics LIMIT 1;
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 user 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
SELECT * FROM views LIMIT 1;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
-NULL db_datadict v1 /* ALGORITHM=UNDEFINED */ 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` NONE NO root@localhost DEFINER
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
+NULL db_datadict v1 SELECT * FROM information_schema.tables NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
SELECT * FROM user_privileges LIMIT 1;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'localhost' NULL SELECT YES
@@ -3355,7 +3374,7 @@ SELECT * FROM key_column_usage LIMIT 1;
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 mysql PRIMARY NULL mysql user Host 1 NULL NULL NULL NULL
SELECT * FROM triggers LIMIT 1;
-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
+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
SELECT * FROM parameters LIMIT 1;
ERROR 42S02: Unknown table 'parameters' in information_schema
SELECT * FROM referential_constraints LIMIT 1;
@@ -3637,9 +3656,9 @@ TABLE_CATALOG NULL
TABLE_SCHEMA information_schema
TABLE_NAME GLOBAL_VARIABLES
TABLE_TYPE SYSTEM VIEW
-ENGINE MyISAM
+ENGINE MEMORY
VERSION 10
-ROW_FORMAT Dynamic
+ROW_FORMAT Fixed
TABLE_ROWS NULL
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
@@ -3847,9 +3866,9 @@ TABLE_CATALOG NULL
TABLE_SCHEMA information_schema
TABLE_NAME SESSION_VARIABLES
TABLE_TYPE SYSTEM VIEW
-ENGINE MyISAM
+ENGINE MEMORY
VERSION 10
-ROW_FORMAT Dynamic
+ROW_FORMAT Fixed
TABLE_ROWS NULL
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
@@ -4188,7 +4207,7 @@ TABLE_TYPE BASE TABLE
ENGINE CSV
VERSION 10
ROW_FORMAT Dynamic
-TABLE_ROWS 2
+TABLE_ROWS 1
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -4209,7 +4228,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Fixed
-TABLE_ROWS 0
+TABLE_ROWS 37
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -4230,7 +4249,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Fixed
-TABLE_ROWS 0
+TABLE_ROWS 424
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -4251,7 +4270,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Fixed
-TABLE_ROWS 0
+TABLE_ROWS 901
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -4272,7 +4291,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Dynamic
-TABLE_ROWS 0
+TABLE_ROWS 479
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -4311,7 +4330,7 @@ TABLE_CATALOG NULL
TABLE_SCHEMA mysql
TABLE_NAME ndb_apply_status
TABLE_TYPE BASE TABLE
-ENGINE NDBCLUSTER
+ENGINE ndbcluster
VERSION 10
ROW_FORMAT Dynamic
TABLE_ROWS 0
@@ -4327,7 +4346,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT number_of_replicas: 2
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA mysql
TABLE_NAME ndb_binlog_index
@@ -4335,7 +4354,7 @@ TABLE_TYPE BASE TABLE
ENGINE MyISAM
VERSION 10
ROW_FORMAT Dynamic
-TABLE_ROWS 5
+TABLE_ROWS 0
AVG_ROW_LENGTH #ARL#
DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
@@ -4584,7 +4603,7 @@ TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t1
TABLE_TYPE BASE TABLE
-ENGINE NDBCLUSTER
+ENGINE ndbcluster
VERSION 10
ROW_FORMAT Fixed
TABLE_ROWS 10
@@ -4600,12 +4619,12 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT number_of_replicas: 2
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t10
TABLE_TYPE BASE TABLE
-ENGINE NDBCLUSTER
+ENGINE ndbcluster
VERSION 10
ROW_FORMAT Fixed
TABLE_ROWS 10
@@ -4621,12 +4640,12 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT number_of_replicas: 2
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t11
TABLE_TYPE BASE TABLE
-ENGINE NDBCLUSTER
+ENGINE ndbcluster
VERSION 10
ROW_FORMAT Fixed
TABLE_ROWS 10
@@ -4642,12 +4661,12 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT number_of_replicas: 2
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t2
TABLE_TYPE BASE TABLE
-ENGINE NDBCLUSTER
+ENGINE ndbcluster
VERSION 10
ROW_FORMAT Fixed
TABLE_ROWS 10
@@ -4663,12 +4682,12 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT number_of_replicas: 2
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t3
TABLE_TYPE BASE TABLE
-ENGINE NDBCLUSTER
+ENGINE ndbcluster
VERSION 10
ROW_FORMAT Fixed
TABLE_ROWS 10
@@ -4684,12 +4703,12 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT number_of_replicas: 2
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t4
TABLE_TYPE BASE TABLE
-ENGINE NDBCLUSTER
+ENGINE ndbcluster
VERSION 10
ROW_FORMAT Fixed
TABLE_ROWS 10
@@ -4705,12 +4724,12 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT number_of_replicas: 2
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t7
TABLE_TYPE BASE TABLE
-ENGINE NDBCLUSTER
+ENGINE ndbcluster
VERSION 10
ROW_FORMAT Fixed
TABLE_ROWS 10
@@ -4726,12 +4745,12 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT number_of_replicas: 2
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t8
TABLE_TYPE BASE TABLE
-ENGINE NDBCLUSTER
+ENGINE ndbcluster
VERSION 10
ROW_FORMAT Fixed
TABLE_ROWS 10
@@ -4747,12 +4766,12 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT number_of_replicas: 2
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME t9
TABLE_TYPE BASE TABLE
-ENGINE NDBCLUSTER
+ENGINE ndbcluster
VERSION 10
ROW_FORMAT Fixed
TABLE_ROWS 10
@@ -4768,7 +4787,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT number_of_replicas: 2
+TABLE_COMMENT
TABLE_CATALOG NULL
TABLE_SCHEMA test
TABLE_NAME tb1
@@ -4857,7 +4876,7 @@ TABLE_CATALOG NULL
TABLE_SCHEMA test4
TABLE_NAME t6
TABLE_TYPE BASE TABLE
-ENGINE NDBCLUSTER
+ENGINE ndbcluster
VERSION 10
ROW_FORMAT Fixed
TABLE_ROWS 10
@@ -4873,7 +4892,7 @@ CHECK_TIME YYYY-MM-DD hh:mm:ss
TABLE_COLLATION latin1_swedish_ci
CHECKSUM NULL
CREATE_OPTIONS
-TABLE_COMMENT number_of_replicas: 2
+TABLE_COMMENT
select s.catalog_name, s.schema_name, s.default_character_set_name,
t.table_type, t.engine
from information_schema.schemata s inner join information_schema.tables t
@@ -4906,17 +4925,19 @@ NULL db_datadict latin1 BASE TABLE MyISAM
NULL db_datadict latin1 BASE TABLE MyISAM
NULL db_datadict latin1 BASE TABLE MyISAM
NULL db_datadict latin1 BASE TABLE MyISAM
-NULL db_datadict latin1 BASE TABLE NDBCLUSTER
-NULL db_datadict latin1 BASE TABLE NDBCLUSTER
-NULL db_datadict latin1 BASE TABLE NDBCLUSTER
-NULL db_datadict latin1 BASE TABLE NDBCLUSTER
-NULL db_datadict latin1 BASE TABLE NDBCLUSTER
-NULL db_datadict latin1 BASE TABLE NDBCLUSTER
-NULL db_datadict latin1 BASE TABLE NDBCLUSTER
-NULL db_datadict latin1 BASE TABLE NDBCLUSTER
-NULL db_datadict latin1 BASE TABLE NDBCLUSTER
-NULL db_datadict latin1 BASE TABLE NDBCLUSTER
-NULL db_datadict latin1 BASE TABLE NDBCLUSTER
+NULL db_datadict latin1 BASE TABLE ndbcluster
+NULL db_datadict latin1 BASE TABLE ndbcluster
+NULL db_datadict latin1 BASE TABLE ndbcluster
+NULL db_datadict latin1 BASE TABLE ndbcluster
+NULL db_datadict latin1 BASE TABLE ndbcluster
+NULL db_datadict latin1 BASE TABLE ndbcluster
+NULL db_datadict latin1 BASE TABLE ndbcluster
+NULL db_datadict latin1 BASE TABLE ndbcluster
+NULL db_datadict latin1 BASE TABLE ndbcluster
+NULL db_datadict latin1 BASE TABLE ndbcluster
+NULL db_datadict latin1 BASE TABLE ndbcluster
+NULL db_datadict latin1 SYSTEM VIEW MEMORY
+NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
@@ -4934,8 +4955,6 @@ NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
NULL db_datadict latin1 SYSTEM VIEW MEMORY
-NULL db_datadict latin1 SYSTEM VIEW MyISAM
-NULL db_datadict latin1 SYSTEM VIEW MyISAM
NULL db_datadict latin1 SYSTEM VIEW MyISAM
NULL db_datadict latin1 SYSTEM VIEW MyISAM
NULL db_datadict latin1 SYSTEM VIEW MyISAM
@@ -4974,17 +4993,19 @@ NULL information_schema utf8 BASE TABLE MyISAM
NULL information_schema utf8 BASE TABLE MyISAM
NULL information_schema utf8 BASE TABLE MyISAM
NULL information_schema utf8 BASE TABLE MyISAM
-NULL information_schema utf8 BASE TABLE NDBCLUSTER
-NULL information_schema utf8 BASE TABLE NDBCLUSTER
-NULL information_schema utf8 BASE TABLE NDBCLUSTER
-NULL information_schema utf8 BASE TABLE NDBCLUSTER
-NULL information_schema utf8 BASE TABLE NDBCLUSTER
-NULL information_schema utf8 BASE TABLE NDBCLUSTER
-NULL information_schema utf8 BASE TABLE NDBCLUSTER
-NULL information_schema utf8 BASE TABLE NDBCLUSTER
-NULL information_schema utf8 BASE TABLE NDBCLUSTER
-NULL information_schema utf8 BASE TABLE NDBCLUSTER
-NULL information_schema utf8 BASE TABLE NDBCLUSTER
+NULL information_schema utf8 BASE TABLE ndbcluster
+NULL information_schema utf8 BASE TABLE ndbcluster
+NULL information_schema utf8 BASE TABLE ndbcluster
+NULL information_schema utf8 BASE TABLE ndbcluster
+NULL information_schema utf8 BASE TABLE ndbcluster
+NULL information_schema utf8 BASE TABLE ndbcluster
+NULL information_schema utf8 BASE TABLE ndbcluster
+NULL information_schema utf8 BASE TABLE ndbcluster
+NULL information_schema utf8 BASE TABLE ndbcluster
+NULL information_schema utf8 BASE TABLE ndbcluster
+NULL information_schema utf8 BASE TABLE ndbcluster
+NULL information_schema utf8 SYSTEM VIEW MEMORY
+NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
@@ -5002,8 +5023,6 @@ NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
NULL information_schema utf8 SYSTEM VIEW MEMORY
-NULL information_schema utf8 SYSTEM VIEW MyISAM
-NULL information_schema utf8 SYSTEM VIEW MyISAM
NULL information_schema utf8 SYSTEM VIEW MyISAM
NULL information_schema utf8 SYSTEM VIEW MyISAM
NULL information_schema utf8 SYSTEM VIEW MyISAM
@@ -5042,17 +5061,19 @@ NULL mysql latin1 BASE TABLE MyISAM
NULL mysql latin1 BASE TABLE MyISAM
NULL mysql latin1 BASE TABLE MyISAM
NULL mysql latin1 BASE TABLE MyISAM
-NULL mysql latin1 BASE TABLE NDBCLUSTER
-NULL mysql latin1 BASE TABLE NDBCLUSTER
-NULL mysql latin1 BASE TABLE NDBCLUSTER
-NULL mysql latin1 BASE TABLE NDBCLUSTER
-NULL mysql latin1 BASE TABLE NDBCLUSTER
-NULL mysql latin1 BASE TABLE NDBCLUSTER
-NULL mysql latin1 BASE TABLE NDBCLUSTER
-NULL mysql latin1 BASE TABLE NDBCLUSTER
-NULL mysql latin1 BASE TABLE NDBCLUSTER
-NULL mysql latin1 BASE TABLE NDBCLUSTER
-NULL mysql latin1 BASE TABLE NDBCLUSTER
+NULL mysql latin1 BASE TABLE ndbcluster
+NULL mysql latin1 BASE TABLE ndbcluster
+NULL mysql latin1 BASE TABLE ndbcluster
+NULL mysql latin1 BASE TABLE ndbcluster
+NULL mysql latin1 BASE TABLE ndbcluster
+NULL mysql latin1 BASE TABLE ndbcluster
+NULL mysql latin1 BASE TABLE ndbcluster
+NULL mysql latin1 BASE TABLE ndbcluster
+NULL mysql latin1 BASE TABLE ndbcluster
+NULL mysql latin1 BASE TABLE ndbcluster
+NULL mysql latin1 BASE TABLE ndbcluster
+NULL mysql latin1 SYSTEM VIEW MEMORY
+NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
@@ -5070,8 +5091,6 @@ NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
NULL mysql latin1 SYSTEM VIEW MEMORY
-NULL mysql latin1 SYSTEM VIEW MyISAM
-NULL mysql latin1 SYSTEM VIEW MyISAM
NULL mysql latin1 SYSTEM VIEW MyISAM
NULL mysql latin1 SYSTEM VIEW MyISAM
NULL mysql latin1 SYSTEM VIEW MyISAM
@@ -5110,17 +5129,19 @@ NULL test latin1 BASE TABLE MyISAM
NULL test latin1 BASE TABLE MyISAM
NULL test latin1 BASE TABLE MyISAM
NULL test latin1 BASE TABLE MyISAM
-NULL test latin1 BASE TABLE NDBCLUSTER
-NULL test latin1 BASE TABLE NDBCLUSTER
-NULL test latin1 BASE TABLE NDBCLUSTER
-NULL test latin1 BASE TABLE NDBCLUSTER
-NULL test latin1 BASE TABLE NDBCLUSTER
-NULL test latin1 BASE TABLE NDBCLUSTER
-NULL test latin1 BASE TABLE NDBCLUSTER
-NULL test latin1 BASE TABLE NDBCLUSTER
-NULL test latin1 BASE TABLE NDBCLUSTER
-NULL test latin1 BASE TABLE NDBCLUSTER
-NULL test latin1 BASE TABLE NDBCLUSTER
+NULL test latin1 BASE TABLE ndbcluster
+NULL test latin1 BASE TABLE ndbcluster
+NULL test latin1 BASE TABLE ndbcluster
+NULL test latin1 BASE TABLE ndbcluster
+NULL test latin1 BASE TABLE ndbcluster
+NULL test latin1 BASE TABLE ndbcluster
+NULL test latin1 BASE TABLE ndbcluster
+NULL test latin1 BASE TABLE ndbcluster
+NULL test latin1 BASE TABLE ndbcluster
+NULL test latin1 BASE TABLE ndbcluster
+NULL test latin1 BASE TABLE ndbcluster
+NULL test latin1 SYSTEM VIEW MEMORY
+NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
@@ -5138,8 +5159,6 @@ NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
NULL test latin1 SYSTEM VIEW MEMORY
-NULL test latin1 SYSTEM VIEW MyISAM
-NULL test latin1 SYSTEM VIEW MyISAM
NULL test latin1 SYSTEM VIEW MyISAM
NULL test latin1 SYSTEM VIEW MyISAM
NULL test latin1 SYSTEM VIEW MyISAM
@@ -5178,17 +5197,19 @@ NULL test1 latin1 BASE TABLE MyISAM
NULL test1 latin1 BASE TABLE MyISAM
NULL test1 latin1 BASE TABLE MyISAM
NULL test1 latin1 BASE TABLE MyISAM
-NULL test1 latin1 BASE TABLE NDBCLUSTER
-NULL test1 latin1 BASE TABLE NDBCLUSTER
-NULL test1 latin1 BASE TABLE NDBCLUSTER
-NULL test1 latin1 BASE TABLE NDBCLUSTER
-NULL test1 latin1 BASE TABLE NDBCLUSTER
-NULL test1 latin1 BASE TABLE NDBCLUSTER
-NULL test1 latin1 BASE TABLE NDBCLUSTER
-NULL test1 latin1 BASE TABLE NDBCLUSTER
-NULL test1 latin1 BASE TABLE NDBCLUSTER
-NULL test1 latin1 BASE TABLE NDBCLUSTER
-NULL test1 latin1 BASE TABLE NDBCLUSTER
+NULL test1 latin1 BASE TABLE ndbcluster
+NULL test1 latin1 BASE TABLE ndbcluster
+NULL test1 latin1 BASE TABLE ndbcluster
+NULL test1 latin1 BASE TABLE ndbcluster
+NULL test1 latin1 BASE TABLE ndbcluster
+NULL test1 latin1 BASE TABLE ndbcluster
+NULL test1 latin1 BASE TABLE ndbcluster
+NULL test1 latin1 BASE TABLE ndbcluster
+NULL test1 latin1 BASE TABLE ndbcluster
+NULL test1 latin1 BASE TABLE ndbcluster
+NULL test1 latin1 BASE TABLE ndbcluster
+NULL test1 latin1 SYSTEM VIEW MEMORY
+NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
@@ -5206,8 +5227,6 @@ NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
NULL test1 latin1 SYSTEM VIEW MEMORY
-NULL test1 latin1 SYSTEM VIEW MyISAM
-NULL test1 latin1 SYSTEM VIEW MyISAM
NULL test1 latin1 SYSTEM VIEW MyISAM
NULL test1 latin1 SYSTEM VIEW MyISAM
NULL test1 latin1 SYSTEM VIEW MyISAM
@@ -5246,17 +5265,19 @@ NULL test4 latin1 BASE TABLE MyISAM
NULL test4 latin1 BASE TABLE MyISAM
NULL test4 latin1 BASE TABLE MyISAM
NULL test4 latin1 BASE TABLE MyISAM
-NULL test4 latin1 BASE TABLE NDBCLUSTER
-NULL test4 latin1 BASE TABLE NDBCLUSTER
-NULL test4 latin1 BASE TABLE NDBCLUSTER
-NULL test4 latin1 BASE TABLE NDBCLUSTER
-NULL test4 latin1 BASE TABLE NDBCLUSTER
-NULL test4 latin1 BASE TABLE NDBCLUSTER
-NULL test4 latin1 BASE TABLE NDBCLUSTER
-NULL test4 latin1 BASE TABLE NDBCLUSTER
-NULL test4 latin1 BASE TABLE NDBCLUSTER
-NULL test4 latin1 BASE TABLE NDBCLUSTER
-NULL test4 latin1 BASE TABLE NDBCLUSTER
+NULL test4 latin1 BASE TABLE ndbcluster
+NULL test4 latin1 BASE TABLE ndbcluster
+NULL test4 latin1 BASE TABLE ndbcluster
+NULL test4 latin1 BASE TABLE ndbcluster
+NULL test4 latin1 BASE TABLE ndbcluster
+NULL test4 latin1 BASE TABLE ndbcluster
+NULL test4 latin1 BASE TABLE ndbcluster
+NULL test4 latin1 BASE TABLE ndbcluster
+NULL test4 latin1 BASE TABLE ndbcluster
+NULL test4 latin1 BASE TABLE ndbcluster
+NULL test4 latin1 BASE TABLE ndbcluster
+NULL test4 latin1 SYSTEM VIEW MEMORY
+NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
@@ -5274,8 +5295,6 @@ NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
NULL test4 latin1 SYSTEM VIEW MEMORY
-NULL test4 latin1 SYSTEM VIEW MyISAM
-NULL test4 latin1 SYSTEM VIEW MyISAM
NULL test4 latin1 SYSTEM VIEW MyISAM
NULL test4 latin1 SYSTEM VIEW MyISAM
NULL test4 latin1 SYSTEM VIEW MyISAM
@@ -5316,10 +5335,10 @@ dec8_swedish_ci dec8
dec8_bin dec8
cp850_general_ci cp850
select * from information_schema.routines limit 0, 5;
-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
+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_1 NULL db_datadict sp_1 PROCEDURE NULL SQL BEGIN
SELECT * FROM db_datadict.v1;
-END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost
+END 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
select * from information_schema.statistics limit 0, 5;
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 user 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
@@ -5328,10 +5347,10 @@ NULL mysql columns_priv 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
NULL mysql columns_priv 0 mysql PRIMARY 2 Db A NULL NULL NULL BTREE
NULL mysql columns_priv 0 mysql PRIMARY 3 User A NULL NULL NULL BTREE
select * from information_schema.views limit 0, 5;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
-NULL db_datadict v1 /* ALGORITHM=UNDEFINED */ 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` NONE NO root@localhost DEFINER
-NULL db_datadict vu /* ALGORITHM=UNDEFINED */ select distinct `vu1`.`u` AS `u`,substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3)) AS `server`,substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3),(length(substr(`vu1`.`u`,(length(substring_index(`vu1`.`u`,_utf8'@',1)) + 3))) - 1)) AS `Server_Clean` from `db_datadict`.`vu1` NONE NO root@localhost DEFINER
-NULL db_datadict vu1 /* ALGORITHM=UNDEFINED */ select `user_privileges`.`GRANTEE` AS `u` from `information_schema`.`user_privileges` NONE NO root@localhost DEFINER
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
+NULL db_datadict v1 SELECT * FROM information_schema.tables NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+NULL db_datadict vu SELECT DISTINCT u, NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+NULL db_datadict vu1 SELECT grantee AS u NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
select * from information_schema.user_privileges limit 0, 5;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'root'@'localhost' NULL SELECT YES
@@ -5378,7 +5397,7 @@ COUNT(*)
68
SELECT COUNT(*) FROM information_schema. columns ;
COUNT(*)
-813
+832
SELECT COUNT(*) FROM information_schema. character_sets ;
COUNT(*)
36
@@ -5443,7 +5462,7 @@ tot_tabs
65
select count(*) as the_cols from columns;
the_cols
-788
+807
select max(maxlen) as the_max from character_sets;
the_max
3
@@ -5467,7 +5486,7 @@ routine_definition
select * from statistics group by index_name asc limit 0, 5;
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 procs_priv 1 mysql Grantor 1 Grantor A NULL NULL NULL BTREE
-NULL mysql help_category 0 mysql name 1 name A 0 NULL NULL BTREE
+NULL mysql help_category 0 mysql name 1 name A 37 NULL NULL BTREE
NULL mysql user 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE
select concat(table_schema, ', ', table_name, ', ', view_definition) view_info
@@ -5715,6 +5734,7 @@ INTO OUTFILE '../tmp/out.ndb.db.file'
WHERE schema_name LIKE 'db_%';
CREATE USER user_3212@localhost;
GRANT ALL ON db_datadict.* TO user_3212@localhost;
+GRANT FILE ON *.* TO user_3212@localhost;
connect(localhost,user_3212,,db_datadict,MYSQL_PORT,MYSQL_SOCK);
user_3212@localhost db_datadict
@@ -5723,7 +5743,7 @@ INTO OUTFILE '../tmp/out.ndb.user.file'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM schemata LIMIT 0, 5;
-ERROR 28000: Access denied for user 'user_3212'@'localhost' (using password: NO)
+ERROR 42S02: Table 'db_datadict.schemata' doesn't exist
SELECT *
FROM schemata LIMIT 0, 5;
ERROR 42S02: Table 'db_datadict.schemata' doesn't exist
@@ -5956,19 +5976,19 @@ update information_schema.routines set routine_name = 'p2'
where routine_name = 'sp_4_1_4';
end//
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
+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_4_1_4 NULL db_datadict sp_4_1_4 PROCEDURE NULL SQL begin
update information_schema.routines set routine_name = 'p2'
where routine_name = 'sp_4_1_4';
-end NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost
+end 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
call db_datadict.sp_4_1_4();
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
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
+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_4_1_4 NULL db_datadict sp_4_1_4 PROCEDURE NULL SQL begin
update information_schema.routines set routine_name = 'p2'
where routine_name = 'sp_4_1_4';
-end NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost
+end 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
drop procedure db_datadict.sp_4_1_4;
use information_schema;
@@ -7237,7 +7257,7 @@ CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA
SELECT *
FROM information_schema.triggers
WHERE trigger_schema LIKE 'db_datadict%';
-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
+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
DROP DATABASE IF EXISTS db_datadict;
CREATE DATABASE db_datadict;
USE db_datadict;
@@ -7261,7 +7281,7 @@ select table_catalog, table_schema, engine
from information_schema.tables
where table_schema like 'db_datadict%';
table_catalog table_schema engine
-NULL db_datadict NDBCLUSTER
+NULL db_datadict ndbcluster
NULL db_datadict NULL
select *
from information_schema.columns
@@ -7389,7 +7409,7 @@ CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA
SELECT *
FROM information_schema.triggers
WHERE trigger_schema LIKE 'db_datadict%';
-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
+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
use db_datadict;
drop index i_6_401013 on res_t_401013;
drop table db_datadict.res_t_401013;
@@ -7525,7 +7545,7 @@ CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA
SELECT *
FROM information_schema.triggers
WHERE trigger_schema LIKE 'db_datadict%';
-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
+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
Testcase 3.2.1.14:
--------------------------------------------------------------------------------
@@ -7674,7 +7694,7 @@ CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA
SELECT *
FROM information_schema.triggers
WHERE trigger_schema LIKE 'db_datadict%';
-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
+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
use db_datadict;
alter table res_t_401014 change f1 ff1 int;
alter table res_t_401014 engine = innodb;
@@ -7819,7 +7839,7 @@ CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA
SELECT *
FROM information_schema.triggers
WHERE trigger_schema LIKE 'db_datadict%';
-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
+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
use db_datadict;
drop table db_datadict.res_t_401014;
drop view db_datadict.res_v_401014;
@@ -7978,7 +7998,7 @@ CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA
SELECT *
FROM information_schema.triggers
WHERE trigger_schema LIKE 'db_datadict%';
-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
+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
use db_datadict;
drop index i_6_401015 on res_t_401015;
drop table db_datadict.res_t_401015;
@@ -8113,7 +8133,7 @@ CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA
SELECT *
FROM information_schema.triggers
WHERE trigger_schema LIKE 'db_datadict%';
-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
+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
Testcase 3.2.1.16:
--------------------------------------------------------------------------------
@@ -8142,7 +8162,7 @@ information_schema ENGINES MEMORY
information_schema EVENTS MyISAM
information_schema FILES MEMORY
information_schema GLOBAL_STATUS MEMORY
-information_schema GLOBAL_VARIABLES MyISAM
+information_schema GLOBAL_VARIABLES MEMORY
information_schema KEY_COLUMN_USAGE MEMORY
information_schema PARTITIONS MyISAM
information_schema PLUGINS MyISAM
@@ -8152,7 +8172,7 @@ information_schema ROUTINES MyISAM
information_schema SCHEMATA MEMORY
information_schema SCHEMA_PRIVILEGES MEMORY
information_schema SESSION_STATUS MEMORY
-information_schema SESSION_VARIABLES MyISAM
+information_schema SESSION_VARIABLES MEMORY
information_schema STATISTICS MEMORY
information_schema TABLES MEMORY
information_schema TABLE_CONSTRAINTS MEMORY
@@ -8161,15 +8181,15 @@ information_schema TRIGGERS MyISAM
information_schema USER_PRIVILEGES MEMORY
information_schema VIEWS MyISAM
db_datadict res_t_401016 MyISAM
-test t1 NDBCLUSTER
-test t10 NDBCLUSTER
-test t11 NDBCLUSTER
-test t2 NDBCLUSTER
-test t3 NDBCLUSTER
-test t4 NDBCLUSTER
-test t7 NDBCLUSTER
-test t8 NDBCLUSTER
-test t9 NDBCLUSTER
+test t1 ndbcluster
+test t10 ndbcluster
+test t11 ndbcluster
+test t2 ndbcluster
+test t3 ndbcluster
+test t4 ndbcluster
+test t7 ndbcluster
+test t8 ndbcluster
+test t9 ndbcluster
test tb1 MyISAM
test tb2 MyISAM
test tb3 MyISAM
@@ -8508,6 +8528,9 @@ EVENTS LAST_ALTERED datetime
EVENTS LAST_EXECUTED datetime
EVENTS EVENT_COMMENT varchar(64)
EVENTS ORIGINATOR bigint(10)
+EVENTS CHARACTER_SET_CLIENT varchar(32)
+EVENTS COLLATION_CONNECTION varchar(32)
+EVENTS DATABASE_COLLATION varchar(32)
FILES FILE_ID bigint(4)
FILES FILE_NAME varchar(64)
FILES FILE_TYPE varchar(20)
@@ -8547,9 +8570,9 @@ FILES CHECKSUM bigint(21) unsigned
FILES STATUS varchar(20)
FILES EXTRA varchar(255)
GLOBAL_STATUS VARIABLE_NAME varchar(64)
-GLOBAL_STATUS VARIABLE_VALUE decimal(22,7)
+GLOBAL_STATUS VARIABLE_VALUE varchar(20480)
GLOBAL_VARIABLES VARIABLE_NAME varchar(64)
-GLOBAL_VARIABLES VARIABLE_VALUE longtext
+GLOBAL_VARIABLES VARIABLE_VALUE varchar(20480)
KEY_COLUMN_USAGE CONSTRAINT_CATALOG varchar(4096)
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA varchar(64)
KEY_COLUMN_USAGE CONSTRAINT_NAME varchar(64)
@@ -8636,6 +8659,9 @@ ROUTINES LAST_ALTERED datetime
ROUTINES SQL_MODE longtext
ROUTINES ROUTINE_COMMENT varchar(64)
ROUTINES DEFINER varchar(77)
+ROUTINES CHARACTER_SET_CLIENT varchar(32)
+ROUTINES COLLATION_CONNECTION varchar(32)
+ROUTINES DATABASE_COLLATION varchar(32)
SCHEMATA CATALOG_NAME varchar(4096)
SCHEMATA SCHEMA_NAME varchar(64)
SCHEMATA DEFAULT_CHARACTER_SET_NAME varchar(64)
@@ -8647,9 +8673,9 @@ SCHEMA_PRIVILEGES TABLE_SCHEMA varchar(64)
SCHEMA_PRIVILEGES PRIVILEGE_TYPE varchar(64)
SCHEMA_PRIVILEGES IS_GRANTABLE varchar(3)
SESSION_STATUS VARIABLE_NAME varchar(64)
-SESSION_STATUS VARIABLE_VALUE decimal(22,7)
+SESSION_STATUS VARIABLE_VALUE varchar(20480)
SESSION_VARIABLES VARIABLE_NAME varchar(64)
-SESSION_VARIABLES VARIABLE_VALUE longtext
+SESSION_VARIABLES VARIABLE_VALUE varchar(20480)
STATISTICS TABLE_CATALOG varchar(4096)
STATISTICS TABLE_SCHEMA varchar(64)
STATISTICS TABLE_NAME varchar(64)
@@ -8717,6 +8743,9 @@ TRIGGERS ACTION_REFERENCE_NEW_ROW varchar(3)
TRIGGERS CREATED datetime
TRIGGERS SQL_MODE longtext
TRIGGERS DEFINER longtext
+TRIGGERS CHARACTER_SET_CLIENT varchar(32)
+TRIGGERS COLLATION_CONNECTION varchar(32)
+TRIGGERS DATABASE_COLLATION varchar(32)
USER_PRIVILEGES GRANTEE varchar(81)
USER_PRIVILEGES TABLE_CATALOG varchar(4096)
USER_PRIVILEGES PRIVILEGE_TYPE varchar(64)
@@ -8729,6 +8758,8 @@ VIEWS CHECK_OPTION varchar(8)
VIEWS IS_UPDATABLE varchar(3)
VIEWS DEFINER varchar(77)
VIEWS SECURITY_TYPE varchar(7)
+VIEWS CHARACTER_SET_CLIENT varchar(32)
+VIEWS COLLATION_CONNECTION varchar(32)
t1 f1 char(20)
t1 f2 char(25)
t1 f3 date
@@ -9326,10 +9357,10 @@ WHERE table_schema = 'information_schema'
AND table_name = 'character_sets'
ORDER BY 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 information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 character_sets CHARACTER_SET_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema character_sets DEFAULT_COLLATE_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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
Testcase 3.2.2.2:
--------------------------------------------------------------------------------
@@ -9409,12 +9440,12 @@ WHERE table_schema = 'information_schema'
AND table_name = 'collations'
ORDER BY 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 information_schema COLLATIONS COLLATION_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLLATIONS CHARACTER_SET_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLLATIONS ID 3 0 NO bigint NULL NULL 19 0 NULL NULL bigint(11) 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 IS_COMPILED 5 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 collations COLLATION_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema collations CHARACTER_SET_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema collations ID 3 0 NO bigint NULL NULL 19 0 NULL NULL bigint(11) 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 IS_COMPILED 5 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
Testcase 3.2.3.2:
--------------------------------------------------------------------------------
@@ -9575,8 +9606,8 @@ WHERE table_schema = 'information_schema'
AND table_name = 'collation_character_set_applicability'
ORDER BY 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 information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema collation_character_set_applicability COLLATION_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema collation_character_set_applicability CHARACTER_SET_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
Testcase 3.2.4.2:
--------------------------------------------------------------------------------
@@ -9748,13 +9779,13 @@ WHERE table_schema = 'information_schema'
AND table_name = 'column_privileges'
ORDER BY 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 information_schema COLUMN_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
-NULL information_schema COLUMN_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 COLUMN_PRIVILEGES TABLE_NAME 4 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 PRIVILEGE_TYPE 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
+NULL information_schema column_privileges TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 column_privileges TABLE_NAME 4 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 PRIVILEGE_TYPE 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema column_privileges IS_GRANTABLE 7 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
Testcase 3.2.5.2 + 3.2.5.3 + 3.2.5.4:
--------------------------------------------------------------------------------
@@ -9932,25 +9963,25 @@ WHERE table_schema = 'information_schema'
AND table_name = 'columns'
ORDER BY 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 information_schema COLUMNS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
-NULL information_schema COLUMNS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 COLUMN_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 COLUMN_DEFAULT 6 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DATA_TYPE 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 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 CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema COLUMNS COLUMN_TYPE 15 NO 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 EXTRA 17 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
-NULL information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) 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 TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
+NULL information_schema columns TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 COLUMN_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 COLUMN_DEFAULT 6 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DATA_TYPE 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 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 CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema columns COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema columns COLUMN_TYPE 15 NO 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 EXTRA 17 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
+NULL information_schema columns PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
+NULL information_schema columns COLUMN_COMMENT 19 NO varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) select
Testcase 3.2.6.2 + 3.2.6.3:
--------------------------------------------------------------------------------
@@ -10040,6 +10071,9 @@ NULL information_schema EVENTS LAST_ALTERED 18 0000-00-00 00:00:00 NO datetime N
NULL information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime 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 ORIGINATOR 21 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10) 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 DATABASE_COLLATION 24 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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
@@ -10079,9 +10113,9 @@ NULL information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 19 0 NULL NU
NULL information_schema FILES STATUS 37 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema FILES EXTRA 38 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -10168,6 +10202,9 @@ NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime
NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 DATABASE_COLLATION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -10179,9 +10216,9 @@ NULL information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL
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 IS_GRANTABLE 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema STATISTICS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -10249,6 +10286,9 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NUL
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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 TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -10261,6 +10301,8 @@ NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+NULL information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
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 Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI 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
@@ -10308,6 +10350,10 @@ NULL mysql event sql_mode 15 NO set 431 1293 NULL NULL utf8 utf8_general_ci set
NULL mysql event comment 16 NO char 64 192 NULL NULL utf8 utf8_bin char(64) select,insert,update,references
NULL mysql event originator 17 NULL NO int NULL NULL 10 0 NULL NULL int(10) 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 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 db_collation 21 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) 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 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 dl 3 NO char 128 384 NULL NULL utf8 utf8_bin char(128) select,insert,update,references
@@ -10382,6 +10428,10 @@ NULL mysql proc created 13 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NU
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 sql_mode 15 NO set 431 1293 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') 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 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 db_collation 19 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) 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 procs_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) 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 User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
@@ -10834,6 +10884,9 @@ NULL information_schema EVENTS LAST_ALTERED 18 0000-00-00 00:00:00 NO datetime N
NULL information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime 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 ORIGINATOR 21 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10) 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 DATABASE_COLLATION 24 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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
@@ -10873,9 +10926,9 @@ NULL information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 19 0 NULL NU
NULL information_schema FILES STATUS 37 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema FILES EXTRA 38 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -10962,6 +11015,9 @@ NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime
NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 DATABASE_COLLATION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -10973,9 +11029,9 @@ NULL information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL
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 IS_GRANTABLE 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema STATISTICS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -11043,6 +11099,9 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NUL
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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 TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -11055,6 +11114,8 @@ NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+NULL information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
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
@@ -11412,6 +11473,9 @@ NULL information_schema EVENTS LAST_ALTERED 18 0000-00-00 00:00:00 NO datetime N
NULL information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime 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 ORIGINATOR 21 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10) 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 DATABASE_COLLATION 24 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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
@@ -11451,9 +11515,9 @@ NULL information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 19 0 NULL NU
NULL information_schema FILES STATUS 37 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema FILES EXTRA 38 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -11540,6 +11604,9 @@ NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime
NULL information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 DATABASE_COLLATION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -11551,9 +11618,9 @@ NULL information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL
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 IS_GRANTABLE 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 0.0000000 NO decimal NULL NULL 22 7 NULL NULL decimal(22,7) select
+NULL information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) 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 longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480) select
NULL information_schema STATISTICS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -11621,6 +11688,9 @@ NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NUL
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) 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 TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -11633,6 +11703,8 @@ NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+NULL information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
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
@@ -12087,6 +12159,9 @@ NULL information_schema EVENTS LAST_ALTERED datetime NULL NULL NULL NULL datetim
NULL information_schema EVENTS LAST_EXECUTED datetime NULL NULL NULL NULL datetime
3.0000 information_schema EVENTS EVENT_COMMENT varchar 64 192 utf8 utf8_general_ci varchar(64)
NULL information_schema EVENTS ORIGINATOR bigint NULL NULL NULL NULL bigint(10)
+3.0000 information_schema EVENTS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema EVENTS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema EVENTS DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
NULL information_schema FILES FILE_ID bigint NULL NULL NULL NULL bigint(4)
3.0000 information_schema FILES FILE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema FILES FILE_TYPE varchar 20 60 utf8 utf8_general_ci varchar(20)
@@ -12126,9 +12201,9 @@ NULL information_schema FILES CHECKSUM bigint NULL NULL NULL NULL bigint(21) uns
3.0000 information_schema FILES STATUS varchar 20 60 utf8 utf8_general_ci varchar(20)
3.0000 information_schema FILES EXTRA varchar 255 765 utf8 utf8_general_ci varchar(255)
3.0000 information_schema GLOBAL_STATUS VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-NULL information_schema GLOBAL_STATUS VARIABLE_VALUE decimal NULL NULL NULL NULL decimal(22,7)
+3.0000 information_schema GLOBAL_STATUS VARIABLE_VALUE varchar 20480 61440 utf8 utf8_general_ci varchar(20480)
3.0000 information_schema GLOBAL_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-1.0000 information_schema GLOBAL_VARIABLES VARIABLE_VALUE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
+3.0000 information_schema GLOBAL_VARIABLES VARIABLE_VALUE varchar 20480 61440 utf8 utf8_general_ci varchar(20480)
3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG varchar 4096 12288 utf8 utf8_general_ci varchar(4096)
3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -12215,6 +12290,9 @@ NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datet
1.0000 information_schema ROUTINES SQL_MODE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
3.0000 information_schema ROUTINES ROUTINE_COMMENT varchar 64 192 utf8 utf8_general_ci varchar(64)
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)
+3.0000 information_schema ROUTINES DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema SCHEMATA CATALOG_NAME varchar 4096 12288 utf8 utf8_general_ci varchar(4096)
3.0000 information_schema SCHEMATA SCHEMA_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -12226,9 +12304,9 @@ NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datet
3.0000 information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema SCHEMA_PRIVILEGES IS_GRANTABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
3.0000 information_schema SESSION_STATUS VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-NULL information_schema SESSION_STATUS VARIABLE_VALUE decimal NULL NULL NULL NULL decimal(22,7)
+3.0000 information_schema SESSION_STATUS VARIABLE_VALUE varchar 20480 61440 utf8 utf8_general_ci varchar(20480)
3.0000 information_schema SESSION_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
-1.0000 information_schema SESSION_VARIABLES VARIABLE_VALUE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
+3.0000 information_schema SESSION_VARIABLES VARIABLE_VALUE varchar 20480 61440 utf8 utf8_general_ci varchar(20480)
3.0000 information_schema STATISTICS TABLE_CATALOG varchar 4096 12288 utf8 utf8_general_ci varchar(4096)
3.0000 information_schema STATISTICS TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema STATISTICS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -12296,6 +12374,9 @@ NULL information_schema TRIGGERS ACTION_ORDER bigint NULL NULL NULL NULL bigint(
NULL information_schema TRIGGERS CREATED datetime NULL NULL NULL NULL datetime
1.0000 information_schema TRIGGERS SQL_MODE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
1.0000 information_schema TRIGGERS DEFINER longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
+3.0000 information_schema TRIGGERS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema TRIGGERS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema TRIGGERS DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema USER_PRIVILEGES GRANTEE varchar 81 243 utf8 utf8_general_ci varchar(81)
3.0000 information_schema USER_PRIVILEGES TABLE_CATALOG varchar 4096 12288 utf8 utf8_general_ci varchar(4096)
3.0000 information_schema USER_PRIVILEGES PRIVILEGE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -12308,6 +12389,8 @@ NULL information_schema TRIGGERS CREATED datetime NULL NULL NULL NULL datetime
3.0000 information_schema VIEWS IS_UPDATABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
3.0000 information_schema VIEWS DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77)
3.0000 information_schema VIEWS SECURITY_TYPE varchar 7 21 utf8 utf8_general_ci varchar(7)
+3.0000 information_schema VIEWS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
+3.0000 information_schema VIEWS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 mysql columns_priv Host char 60 180 utf8 utf8_bin char(60)
3.0000 mysql columns_priv Db char 64 192 utf8 utf8_bin char(64)
3.0000 mysql columns_priv User char 16 48 utf8 utf8_bin char(16)
@@ -12355,6 +12438,10 @@ NULL mysql event ends datetime NULL NULL NULL NULL datetime
3.0000 mysql event comment char 64 192 utf8 utf8_bin char(64)
NULL mysql event originator int NULL NULL NULL NULL int(10)
1.0000 mysql event time_zone char 64 64 latin1 latin1_swedish_ci char(64)
+3.0000 mysql event character_set_client char 32 96 utf8 utf8_bin char(32)
+3.0000 mysql event collation_connection char 32 96 utf8 utf8_bin char(32)
+3.0000 mysql event db_collation char 32 96 utf8 utf8_bin char(32)
+1.0000 mysql event body_utf8 longblob 4294967295 4294967295 NULL NULL longblob
3.0000 mysql func name char 64 192 utf8 utf8_bin char(64)
NULL mysql func ret tinyint NULL NULL NULL NULL tinyint(1)
3.0000 mysql func dl char 128 384 utf8 utf8_bin char(128)
@@ -12429,6 +12516,10 @@ 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 431 1293 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')
3.0000 mysql proc comment char 64 192 utf8 utf8_bin char(64)
+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)
+1.0000 mysql proc body_utf8 longblob 4294967295 4294967295 NULL NULL longblob
3.0000 mysql procs_priv Host char 60 180 utf8 utf8_bin char(60)
3.0000 mysql procs_priv Db char 64 192 utf8 utf8_bin char(64)
3.0000 mysql procs_priv User char 16 48 utf8 utf8_bin char(16)
@@ -12860,18 +12951,18 @@ WHERE table_schema = 'information_schema'
AND table_name = 'key_column_usage'
ORDER BY 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 information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema KEY_COLUMN_USAGE TABLE_CATALOG 4 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 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 COLUMN_NAME 7 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_TABLE_SCHEMA 10 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_COLUMN_NAME 12 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema key_column_usage CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema key_column_usage TABLE_CATALOG 4 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 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 COLUMN_NAME 7 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_TABLE_SCHEMA 10 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_COLUMN_NAME 12 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
Testcase 3.2.7.2 + 3.2.7.3:
--------------------------------------------------------------------------------
@@ -12988,6 +13079,9 @@ LAST_ALTERED datetime NO 0000-00-00 00:00:00
SQL_MODE longtext NO
ROUTINE_COMMENT varchar(64) NO
DEFINER varchar(77) NO
+CHARACTER_SET_CLIENT varchar(32) NO
+COLLATION_CONNECTION varchar(32) NO
+DATABASE_COLLATION varchar(32) NO
SHOW CREATE TABLE routines;
Table Create Table
ROUTINES CREATE TEMPORARY TABLE `ROUTINES` (
@@ -13010,39 +13104,45 @@ ROUTINES CREATE TEMPORARY TABLE `ROUTINES` (
`LAST_ALTERED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`SQL_MODE` longtext NOT NULL,
`ROUTINE_COMMENT` varchar(64) NOT NULL DEFAULT '',
- `DEFINER` varchar(77) NOT NULL DEFAULT ''
+ `DEFINER` varchar(77) NOT NULL DEFAULT '',
+ `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '',
+ `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '',
+ `DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=utf8
SELECT COUNT(*) FROM information_schema.columns
WHERE table_schema = 'information_schema'
AND table_name = 'routines'
ORDER BY ordinal_position;
COUNT(*)
-20
+23
SELECT * FROM information_schema.columns
WHERE table_schema = 'information_schema'
AND table_name = 'routines'
ORDER BY 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 information_schema ROUTINES SPECIFIC_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema ROUTINES ROUTINE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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_NAME 4 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 DTD_IDENTIFIER 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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_DEFINITION 8 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 EXTERNAL_LANGUAGE 10 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 IS_DETERMINISTIC 12 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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_PATH 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime 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 SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 ROUTINE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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_NAME 4 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 DTD_IDENTIFIER 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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_DEFINITION 8 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 EXTERNAL_LANGUAGE 10 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 IS_DETERMINISTIC 12 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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_PATH 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime 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 SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 DATABASE_COLLATION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
Testcase 3.2.8.2 + 3.2.8.3:
--------------------------------------------------------------------------------
@@ -13080,16 +13180,16 @@ GRANT EXECUTE ON db_datadict_2.* TO 'user_2'@'localhost';
FLUSH PRIVILEGES;
connect(localhost,user_1,,db_datadict,MYSQL_PORT,MYSQL_SOCK);
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
-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
-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
+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
connect(localhost,user_2,,db_datadict,MYSQL_PORT,MYSQL_SOCK);
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
-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
+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
connect(localhost,user_3,,test,MYSQL_PORT,MYSQL_SOCK);
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
+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
root@localhost db_datadict_2
DROP USER 'user_1'@'localhost';
@@ -13314,6 +13414,9 @@ LAST_ALTERED YYYY-MM-DD hh:mm:ss
SQL_MODE
ROUTINE_COMMENT
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
LENGTH(routine_definition) 2549
use db_datadict;
drop procedure sp_6_408004;
@@ -13352,11 +13455,11 @@ WHERE table_schema = 'information_schema'
AND table_name = 'schemata'
ORDER BY 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 information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema SCHEMATA DEFAULT_COLLATION_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema SCHEMATA SQL_PATH 5 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
+NULL information_schema schemata CATALOG_NAME 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema schemata DEFAULT_COLLATION_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema schemata SQL_PATH 5 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
Testcase 3.2.9.2 + 3.2.9.3:
--------------------------------------------------------------------------------
@@ -13436,12 +13539,12 @@ WHERE table_schema = 'information_schema'
AND table_name = 'table_constraints'
ORDER BY 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 information_schema TABLE_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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_NAME 3 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_CONSTRAINTS TABLE_NAME 5 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 CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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_NAME 3 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_constraints TABLE_NAME 5 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
Testcase 3.2.10.2 + 3.2.10.3:
--------------------------------------------------------------------------------
@@ -13516,12 +13619,12 @@ WHERE table_schema = 'information_schema'
AND table_name = 'table_privileges'
ORDER BY 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 information_schema TABLE_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
-NULL information_schema TABLE_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 TABLE_PRIVILEGES TABLE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 IS_GRANTABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 table_privileges TABLE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 IS_GRANTABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
Testcase 3.2.11.2 + 3.2.11.3 + 3.2.11.4:
--------------------------------------------------------------------------------
@@ -13662,27 +13765,27 @@ WHERE table_schema = 'information_schema'
AND table_name = 'tables'
ORDER BY 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 information_schema TABLES TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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_NAME 3 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 ENGINE 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema TABLES VERSION 6 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_ROWS 8 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 DATA_LENGTH 10 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 INDEX_LENGTH 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned 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 AUTO_INCREMENT 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
-NULL information_schema TABLES CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TABLES UPDATE_TIME 16 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TABLES CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TABLES TABLE_COLLATION 18 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned 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 TABLE_COMMENT 21 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
+NULL information_schema tables TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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_NAME 3 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 ENGINE 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema tables VERSION 6 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_ROWS 8 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 DATA_LENGTH 10 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 INDEX_LENGTH 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned 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 AUTO_INCREMENT 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
+NULL information_schema tables CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+NULL information_schema tables UPDATE_TIME 16 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+NULL information_schema tables CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+NULL information_schema tables TABLE_COLLATION 18 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema tables CHECKSUM 19 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned 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 TABLE_COMMENT 21 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
Testcase 3.2.12.2 + 3.2.12.3:
--------------------------------------------------------------------------------
@@ -13717,7 +13820,7 @@ NULL information_schema ENGINES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL
NULL information_schema EVENTS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema FILES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema GLOBAL_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PARTITIONS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PLUGINS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -13727,7 +13830,7 @@ NULL information_schema ROUTINES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #
NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SESSION_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema SESSION_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SESSION_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema STATISTICS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -13742,15 +13845,15 @@ NULL db_datadict tb1 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NUL
NULL db_datadict tb2 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
NULL db_datadict v3 VIEW NULL NULL NULL NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL NULL NULL VIEW
-NULL test t1 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t10 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t11 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t2 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t3 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t4 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t7 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t8 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t9 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
+NULL test t1 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t10 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t11 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t2 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t3 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t4 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t7 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t8 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t9 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
NULL test tb1 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
NULL test tb2 BASE TABLE MyISAM 10 Dynamic 54 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
NULL test tb3 BASE TABLE MyISAM 10 Dynamic 11 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
@@ -13768,7 +13871,7 @@ NULL information_schema ENGINES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL
NULL information_schema EVENTS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema FILES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema GLOBAL_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PARTITIONS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PLUGINS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -13778,7 +13881,7 @@ NULL information_schema ROUTINES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #
NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SESSION_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema SESSION_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SESSION_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema STATISTICS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -13791,15 +13894,15 @@ WHERE NOT( table_schema = 'information_schema');
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 MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
-NULL test t1 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t10 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t11 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t2 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t3 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t4 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t7 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t8 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t9 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
+NULL test t1 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t10 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t11 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t2 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t3 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t4 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t7 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t8 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t9 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
NULL test tb1 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
NULL test tb2 BASE TABLE MyISAM 10 Dynamic 54 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
NULL test tb3 BASE TABLE MyISAM 10 Dynamic 11 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
@@ -13817,7 +13920,7 @@ NULL information_schema ENGINES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL
NULL information_schema EVENTS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema FILES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema GLOBAL_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PARTITIONS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PLUGINS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -13827,7 +13930,7 @@ NULL information_schema ROUTINES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #
NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SESSION_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema SESSION_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SESSION_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema STATISTICS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -13840,15 +13943,15 @@ WHERE NOT( table_schema = 'information_schema');
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 MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
NULL db_datadict v3 VIEW NULL NULL NULL NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL NULL NULL VIEW
-NULL test t1 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t10 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t11 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t2 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t3 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t4 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t7 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t8 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t9 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
+NULL test t1 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t10 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t11 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t2 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t3 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t4 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t7 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t8 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t9 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
NULL test tb1 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
NULL test tb2 BASE TABLE MyISAM 10 Dynamic 54 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
NULL test tb3 BASE TABLE MyISAM 10 Dynamic 11 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
@@ -13867,7 +13970,7 @@ NULL information_schema ENGINES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL
NULL information_schema EVENTS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema FILES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema GLOBAL_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema GLOBAL_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema KEY_COLUMN_USAGE SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PARTITIONS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema PLUGINS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -13877,7 +13980,7 @@ NULL information_schema ROUTINES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #
NULL information_schema SCHEMATA SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SCHEMA_PRIVILEGES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema SESSION_STATUS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
-NULL information_schema SESSION_VARIABLES SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
+NULL information_schema SESSION_VARIABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema STATISTICS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
NULL information_schema TABLE_CONSTRAINTS SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO#
@@ -13897,14 +14000,14 @@ NULL mysql columns_priv BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF#
NULL mysql db BASE TABLE MyISAM 10 Fixed 3 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Database privileges
NULL mysql event BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Events
NULL mysql func BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL User defined functions
-NULL mysql general_log BASE TABLE CSV 10 Dynamic 2 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL General log
-NULL mysql help_category BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help categories
-NULL mysql help_keyword BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help keywords
-NULL mysql help_relation BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL keyword-topic relation
-NULL mysql help_topic BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help topics
+NULL mysql general_log BASE TABLE CSV 10 Dynamic 1 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL General log
+NULL mysql help_category BASE TABLE MyISAM 10 Fixed 37 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help categories
+NULL mysql help_keyword BASE TABLE MyISAM 10 Fixed 424 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help keywords
+NULL mysql help_relation BASE TABLE MyISAM 10 Fixed 901 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL keyword-topic relation
+NULL mysql help_topic BASE TABLE MyISAM 10 Dynamic 479 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help topics
NULL mysql host BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Host privileges; Merged with database privileges
-NULL mysql ndb_apply_status BASE TABLE NDBCLUSTER 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL mysql ndb_binlog_index BASE TABLE MyISAM 10 Dynamic 5 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL mysql ndb_apply_status BASE TABLE ndbcluster 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL mysql ndb_binlog_index BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
NULL mysql plugin BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL MySQL plugins
NULL mysql proc BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Stored Procedures
NULL mysql procs_priv BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Procedure privileges
@@ -13916,20 +14019,20 @@ NULL mysql time_zone_leap_second BASE TABLE MyISAM 10 Fixed 22 #ARL# #DL# #MDL#
NULL mysql time_zone_name BASE TABLE MyISAM 10 Fixed 6 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Time zone names
NULL mysql time_zone_transition BASE TABLE MyISAM 10 Fixed 393 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Time zone transitions
NULL mysql time_zone_transition_type BASE TABLE MyISAM 10 Fixed 31 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Time zone transition types
-NULL test t1 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t10 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t11 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t2 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t3 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t4 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t7 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t8 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
-NULL test t9 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
+NULL test t1 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t10 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t11 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t2 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t3 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t4 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t7 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t8 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
+NULL test t9 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
NULL test tb1 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
NULL test tb2 BASE TABLE MyISAM 10 Dynamic 54 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
NULL test tb3 BASE TABLE MyISAM 10 Dynamic 11 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
NULL test tb4 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
-NULL test4 t6 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2
+NULL test4 t6 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL
DROP USER 'user_1'@'localhost';
DROP USER 'user_2'@'localhost';
DROP USER 'user_3'@'localhost';
@@ -13952,6 +14055,8 @@ CHECK_OPTION varchar(8) NO
IS_UPDATABLE varchar(3) NO
DEFINER varchar(77) NO
SECURITY_TYPE varchar(7) NO
+CHARACTER_SET_CLIENT varchar(32) NO
+COLLATION_CONNECTION varchar(32) NO
SHOW CREATE TABLE views;
Table Create Table
VIEWS CREATE TEMPORARY TABLE `VIEWS` (
@@ -13962,27 +14067,31 @@ VIEWS CREATE TEMPORARY TABLE `VIEWS` (
`CHECK_OPTION` varchar(8) NOT NULL DEFAULT '',
`IS_UPDATABLE` varchar(3) NOT NULL DEFAULT '',
`DEFINER` varchar(77) NOT NULL DEFAULT '',
- `SECURITY_TYPE` varchar(7) NOT NULL DEFAULT ''
+ `SECURITY_TYPE` varchar(7) NOT NULL DEFAULT '',
+ `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '',
+ `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=utf8
SELECT COUNT(*) FROM information_schema.columns
WHERE table_schema = 'information_schema'
AND table_name = 'views'
ORDER BY ordinal_position;
COUNT(*)
-8
+10
SELECT * FROM information_schema.columns
WHERE table_schema = 'information_schema'
AND table_name = 'views'
ORDER BY 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 information_schema VIEWS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
-NULL information_schema VIEWS VIEW_DEFINITION 4 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
-NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema views VIEW_DEFINITION 4 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+NULL information_schema views DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) 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 CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
+NULL information_schema views COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
Testcase 3.2.13.2 + 3.2.13.3:
--------------------------------------------------------------------------------
@@ -14000,21 +14109,21 @@ GRANT SELECT ON db_datadict.v_granted_to_1 TO 'user_1'@'localhost';
GRANT SHOW VIEW, CREATE VIEW ON db_datadict.* TO 'user_2'@'localhost';
FLUSH PRIVILEGES;
SELECT * FROM information_schema.views;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
-NULL db_datadict v_granted_glob /* ALGORITHM=UNDEFINED */ select `db_datadict`.`tb_401302`.`f2` AS `f2`,`db_datadict`.`tb_401302`.`f3` AS `f3` from `db_datadict`.`tb_401302` NONE YES root@localhost DEFINER
-NULL db_datadict v_granted_to_1 /* ALGORITHM=UNDEFINED */ select `db_datadict`.`tb_401302`.`f1` AS `f1`,`db_datadict`.`tb_401302`.`f2` AS `f2`,`db_datadict`.`tb_401302`.`f3` AS `f3` from `db_datadict`.`tb_401302` NONE YES root@localhost DEFINER
+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 f2, f3 FROM tb_401302 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
+NULL db_datadict v_granted_to_1 SELECT * FROM tb_401302 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
connect(localhost,user_1,,test,MYSQL_PORT,MYSQL_SOCK);
SELECT * FROM information_schema.views;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
-NULL db_datadict v_granted_to_1 NONE YES root@localhost DEFINER
+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
connect(localhost,user_2,,test,MYSQL_PORT,MYSQL_SOCK);
SELECT * FROM information_schema.views;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
-NULL db_datadict v_granted_glob NONE YES root@localhost DEFINER
-NULL db_datadict v_granted_to_1 NONE YES root@localhost DEFINER
+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
connect(localhost,user_no_views,,test,MYSQL_PORT,MYSQL_SOCK);
SELECT * FROM information_schema.views;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
root@localhost db_datadict
USE db_datadict;
@@ -14077,21 +14186,21 @@ WHERE table_schema = 'information_schema'
AND table_name = 'statistics'
ORDER BY 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 information_schema STATISTICS TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
-NULL information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 NON_UNIQUE 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(1) 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_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 COLUMN_NAME 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
-NULL information_schema STATISTICS SUB_PART 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(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 NULLABLE 13 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 COMMENT 15 NULL YES varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16) select
+NULL information_schema statistics TABLE_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
+NULL information_schema statistics TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 NON_UNIQUE 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(1) 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_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 COLUMN_NAME 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
+NULL information_schema statistics SUB_PART 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(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 NULLABLE 13 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 COMMENT 15 NULL YES varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16) select
Testcase 3.2.14.2 + 3.2.14.3:
--------------------------------------------------------------------------------
@@ -14147,18 +14256,18 @@ NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE
NULL mysql event 0 mysql PRIMARY 1 db A NULL NULL NULL BTREE
NULL mysql event 0 mysql PRIMARY 2 name A 0 NULL NULL BTREE
NULL mysql func 0 mysql PRIMARY 1 name A 0 NULL NULL BTREE
-NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 0 NULL NULL BTREE
-NULL mysql help_category 0 mysql name 1 name A 0 NULL NULL BTREE
-NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A 0 NULL NULL BTREE
-NULL mysql help_keyword 0 mysql name 1 name A 0 NULL NULL BTREE
+NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 37 NULL NULL BTREE
+NULL mysql help_category 0 mysql name 1 name A 37 NULL NULL BTREE
+NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A 424 NULL NULL BTREE
+NULL mysql help_keyword 0 mysql name 1 name A 424 NULL NULL BTREE
NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A NULL NULL NULL BTREE
-NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A 0 NULL NULL BTREE
-NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A 0 NULL NULL BTREE
-NULL mysql help_topic 0 mysql name 1 name A 0 NULL NULL BTREE
+NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A 901 NULL NULL BTREE
+NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A 479 NULL NULL BTREE
+NULL mysql help_topic 0 mysql name 1 name A 479 NULL NULL BTREE
NULL mysql host 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE
NULL mysql host 0 mysql PRIMARY 2 Db A 0 NULL NULL BTREE
NULL mysql ndb_apply_status 0 mysql PRIMARY 1 server_id NULL 0 NULL NULL HASH
-NULL mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A 5 NULL NULL BTREE
+NULL mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A 0 NULL NULL BTREE
NULL mysql plugin 0 mysql PRIMARY 1 name A 0 NULL NULL BTREE
NULL mysql proc 0 mysql PRIMARY 1 db A NULL NULL NULL BTREE
NULL mysql proc 0 mysql PRIMARY 2 name A NULL NULL NULL BTREE
@@ -14234,11 +14343,11 @@ WHERE table_schema = 'information_schema'
AND table_name = 'schema_privileges'
ORDER BY 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 information_schema SCHEMA_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
-NULL information_schema SCHEMA_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 SCHEMA_PRIVILEGES PRIVILEGE_TYPE 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
+NULL information_schema schema_privileges TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 schema_privileges PRIVILEGE_TYPE 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema schema_privileges IS_GRANTABLE 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
Testcase 3.2.15.2:
--------------------------------------------------------------------------------
@@ -14403,10 +14512,10 @@ WHERE table_schema = 'information_schema'
AND table_name = 'user_privileges'
ORDER BY 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 information_schema USER_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
-NULL information_schema USER_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 IS_GRANTABLE 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) 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 TABLE_CATALOG 2 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 IS_GRANTABLE 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
Testcase 3.2.16.2 + 3.2.16.3 + 3.2.16.4:
--------------------------------------------------------------------------------
@@ -14767,6 +14876,9 @@ ACTION_REFERENCE_NEW_ROW varchar(3) NO
CREATED datetime YES NULL
SQL_MODE longtext NO
DEFINER longtext NO
+CHARACTER_SET_CLIENT varchar(32) NO
+COLLATION_CONNECTION varchar(32) NO
+DATABASE_COLLATION varchar(32) NO
SHOW CREATE TABLE triggers;
Table Create Table
TRIGGERS CREATE TEMPORARY TABLE `TRIGGERS` (
@@ -14788,38 +14900,44 @@ TRIGGERS CREATE TEMPORARY TABLE `TRIGGERS` (
`ACTION_REFERENCE_NEW_ROW` varchar(3) NOT NULL DEFAULT '',
`CREATED` datetime DEFAULT NULL,
`SQL_MODE` longtext NOT NULL,
- `DEFINER` longtext NOT NULL
+ `DEFINER` longtext NOT NULL,
+ `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '',
+ `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '',
+ `DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=utf8
SELECT COUNT(*) FROM information_schema.columns
WHERE table_schema = 'information_schema'
AND table_name = 'triggers'
ORDER BY ordinal_position;
COUNT(*)
-19
+22
SELECT * FROM information_schema.columns
WHERE table_schema = 'information_schema'
AND table_name = 'triggers'
ORDER BY 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 information_schema TRIGGERS TRIGGER_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
-NULL information_schema TRIGGERS TRIGGER_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 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 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) 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_STATEMENT 10 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) 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_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_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
-NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
-NULL information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
-NULL information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema triggers TRIGGER_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) select
+NULL information_schema triggers TRIGGER_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) 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 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 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) 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_STATEMENT 10 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) 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_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_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
+NULL information_schema triggers CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+NULL information_schema triggers SQL_MODE 18 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
+NULL information_schema triggers DEFINER 19 NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext 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 DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
Testcase 3.2.18.2 + 3.2.18.3:
--------------------------------------------------------------------------------
@@ -14887,17 +15005,17 @@ WHERE table_schema = 'information_schema'
AND table_name = 'referential_constraints'
ORDER BY 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 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 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 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 UNIQUE_CONSTRAINT_NAME 6 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 UPDATE_RULE 8 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 TABLE_NAME 10 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 CONSTRAINT_CATALOG 1 NULL YES varchar 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 CONSTRAINT_NAME 3 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 4096 12288 NULL NULL utf8 utf8_general_ci varchar(4096) 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 UNIQUE_CONSTRAINT_NAME 6 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 UPDATE_RULE 8 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 TABLE_NAME 10 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
*** End of Data Dictionary Tests ***
--------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/r/ndb_cursors.result b/mysql-test/suite/funcs_1/r/ndb_cursors.result
index dd96a8104c6..cf65b615add 100644
--- a/mysql-test/suite/funcs_1/r/ndb_cursors.result
+++ b/mysql-test/suite/funcs_1/r/ndb_cursors.result
@@ -75,7 +75,7 @@ Note 1265 Data truncated for column 'f45' at row 1
Note 1265 Data truncated for column 'f47' at row 1
Note 1265 Data truncated for column 'f49' at row 1
Note 1265 Data truncated for column 'f51' at row 1
-Error 1466 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
+Error 1475 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/ndb_tb1.txt' into table tb1 ;
NOT YET IMPLEMENTED: cursor tests
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 ab4508fb302..02ef728fad5 100644
--- a/mysql-test/suite/funcs_1/r/ndb_func_view.result
+++ b/mysql-test/suite/funcs_1/r/ndb_func_view.result
@@ -286,8 +286,8 @@ CREATE VIEW v1 AS SELECT my_char_30, id FROM t1_values;
SELECT my_char_30, id FROM t1_values
WHERE select_id = 190 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 190 OR select_id IS NULL) order by id;
@@ -304,8 +304,8 @@ A<--------30 characters-------> <--------30 characters-------> 3
A ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
A-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select concat(_latin1'A',`t1_values`.`my_char_30`) AS `CONCAT('A',my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select concat(_latin1'A',`t1_values`.`my_char_30`) AS `CONCAT('A',my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 189 OR select_id IS NULL) order by id;
@@ -324,8 +324,8 @@ SELECT LTRIM(my_varbinary_1000),
my_varbinary_1000, id FROM t1_values
WHERE select_id = 188 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_varbinary_1000`) AS `LTRIM(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_varbinary_1000`) AS `LTRIM(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 188 OR select_id IS NULL) order by id;
@@ -338,8 +338,8 @@ SELECT LTRIM(my_binary_30),
my_binary_30, id FROM t1_values
WHERE select_id = 187 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_binary_30`) AS `LTRIM(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_binary_30`) AS `LTRIM(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 187 OR select_id IS NULL) order by id;
@@ -352,8 +352,8 @@ SELECT LTRIM(my_varchar_1000),
my_varchar_1000, id FROM t1_values
WHERE select_id = 186 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_varchar_1000`) AS `LTRIM(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_varchar_1000`) AS `LTRIM(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 186 OR select_id IS NULL) order by id;
@@ -366,8 +366,8 @@ SELECT LTRIM(my_char_30),
my_char_30, id FROM t1_values
WHERE select_id = 185 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_char_30`) AS `LTRIM(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ltrim(`t1_values`.`my_char_30`) AS `LTRIM(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 185 OR select_id IS NULL) order by id;
@@ -380,8 +380,8 @@ SELECT LOWER(my_varbinary_1000),
my_varbinary_1000, id FROM t1_values
WHERE select_id = 184 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_varbinary_1000`) AS `LOWER(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_varbinary_1000`) AS `LOWER(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 184 OR select_id IS NULL) order by id;
@@ -394,8 +394,8 @@ SELECT LOWER(my_binary_30),
my_binary_30, id FROM t1_values
WHERE select_id = 183 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_binary_30`) AS `LOWER(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_binary_30`) AS `LOWER(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 183 OR select_id IS NULL) order by id;
@@ -408,8 +408,8 @@ SELECT LOWER(my_varchar_1000),
my_varchar_1000, id FROM t1_values
WHERE select_id = 182 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_varchar_1000`) AS `LOWER(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_varchar_1000`) AS `LOWER(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 182 OR select_id IS NULL) order by id;
@@ -422,8 +422,8 @@ SELECT LOWER(my_char_30),
my_char_30, id FROM t1_values
WHERE select_id = 181 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_char_30`) AS `LOWER(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_char_30`) AS `LOWER(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 181 OR select_id IS NULL) order by id;
@@ -436,8 +436,8 @@ SELECT LOCATE('-', ' - -ABC', my_decimal),
my_decimal, id FROM t1_values
WHERE select_id = 180 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',_latin1' - -ABC',`t1_values`.`my_decimal`) AS `LOCATE('-', ' - -ABC', my_decimal)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',_latin1' - -ABC',`t1_values`.`my_decimal`) AS `LOCATE('-', ' - -ABC', my_decimal)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 180 OR select_id IS NULL) order by id;
@@ -450,8 +450,8 @@ SELECT LOCATE('-', ' - -ABC', my_double),
my_double, id FROM t1_values
WHERE select_id = 179 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',_latin1' - -ABC',`t1_values`.`my_double`) AS `LOCATE('-', ' - -ABC', my_double)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',_latin1' - -ABC',`t1_values`.`my_double`) AS `LOCATE('-', ' - -ABC', my_double)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 179 OR select_id IS NULL) order by id;
@@ -464,8 +464,8 @@ SELECT LOCATE('-', ' - -ABC', my_bigint),
my_bigint, id FROM t1_values
WHERE select_id = 178 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',_latin1' - -ABC',`t1_values`.`my_bigint`) AS `LOCATE('-', ' - -ABC', my_bigint)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',_latin1' - -ABC',`t1_values`.`my_bigint`) AS `LOCATE('-', ' - -ABC', my_bigint)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 178 OR select_id IS NULL) order by id;
@@ -478,8 +478,8 @@ SELECT LOCATE('-', my_varbinary_1000, 3),
my_varbinary_1000, id FROM t1_values
WHERE select_id = 177 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_varbinary_1000`,3) AS `LOCATE('-', my_varbinary_1000, 3)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_varbinary_1000`,3) AS `LOCATE('-', my_varbinary_1000, 3)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 177 OR select_id IS NULL) order by id;
@@ -492,8 +492,8 @@ SELECT LOCATE('-', my_binary_30, 3),
my_binary_30, id FROM t1_values
WHERE select_id = 176 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_binary_30`,3) AS `LOCATE('-', my_binary_30, 3)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_binary_30`,3) AS `LOCATE('-', my_binary_30, 3)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 176 OR select_id IS NULL) order by id;
@@ -506,8 +506,8 @@ SELECT LOCATE('-', my_varchar_1000, 3),
my_varchar_1000, id FROM t1_values
WHERE select_id = 175 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_varchar_1000`,3) AS `LOCATE('-', my_varchar_1000, 3)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_varchar_1000`,3) AS `LOCATE('-', my_varchar_1000, 3)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 175 OR select_id IS NULL) order by id;
@@ -520,8 +520,8 @@ SELECT LOCATE('-', my_char_30, 3),
my_char_30, id FROM t1_values
WHERE select_id = 174 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_char_30`,3) AS `LOCATE('-', my_char_30, 3)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'-',`t1_values`.`my_char_30`,3) AS `LOCATE('-', my_char_30, 3)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 174 OR select_id IS NULL) order by id;
@@ -534,8 +534,8 @@ SELECT LOCATE(my_varbinary_1000, my_binary_30 ),
my_varbinary_1000, my_binary_30 id FROM t1_values
WHERE select_id = 173 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_binary_30`) AS `LOCATE(my_varbinary_1000, my_binary_30 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`my_binary_30` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_binary_30`) AS `LOCATE(my_varbinary_1000, my_binary_30 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`my_binary_30` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 173 OR select_id IS NULL) order by id;
@@ -548,8 +548,8 @@ SELECT LOCATE(my_varbinary_1000, my_varchar_1000 ),
my_varbinary_1000, my_varchar_1000 id FROM t1_values
WHERE select_id = 172 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_varbinary_1000, my_varchar_1000 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`my_varchar_1000` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_varbinary_1000, my_varchar_1000 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`my_varchar_1000` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 172 OR select_id IS NULL) order by id;
@@ -562,8 +562,8 @@ SELECT LOCATE(my_varbinary_1000, my_char_30 ),
my_varbinary_1000, my_char_30 id FROM t1_values
WHERE select_id = 171 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_char_30`) AS `LOCATE(my_varbinary_1000, my_char_30 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`my_char_30` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_char_30`) AS `LOCATE(my_varbinary_1000, my_char_30 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`my_char_30` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 171 OR select_id IS NULL) order by id;
@@ -576,8 +576,8 @@ SELECT LOCATE(my_varbinary_1000, my_varbinary_1000 ),
my_varbinary_1000, id FROM t1_values
WHERE select_id = 170 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_varbinary_1000, my_varbinary_1000 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varbinary_1000`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_varbinary_1000, my_varbinary_1000 )`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 170 OR select_id IS NULL) order by id;
@@ -590,8 +590,8 @@ SELECT LOCATE(my_binary_30, my_varbinary_1000 ),
my_binary_30, my_varbinary_1000 id FROM t1_values
WHERE select_id = 169 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_binary_30, my_varbinary_1000 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`my_varbinary_1000` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_binary_30, my_varbinary_1000 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`my_varbinary_1000` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 169 OR select_id IS NULL) order by id;
@@ -604,8 +604,8 @@ SELECT LOCATE(my_binary_30, my_varchar_1000 ),
my_binary_30, my_varchar_1000 id FROM t1_values
WHERE select_id = 168 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_binary_30, my_varchar_1000 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`my_varchar_1000` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_binary_30, my_varchar_1000 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`my_varchar_1000` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 168 OR select_id IS NULL) order by id;
@@ -618,8 +618,8 @@ SELECT LOCATE(my_binary_30, my_char_30 ),
my_binary_30, my_char_30 id FROM t1_values
WHERE select_id = 167 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_char_30`) AS `LOCATE(my_binary_30, my_char_30 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`my_char_30` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_char_30`) AS `LOCATE(my_binary_30, my_char_30 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`my_char_30` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 167 OR select_id IS NULL) order by id;
@@ -632,8 +632,8 @@ SELECT LOCATE(my_binary_30, my_binary_30 ),
my_binary_30, id FROM t1_values
WHERE select_id = 166 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_binary_30`) AS `LOCATE(my_binary_30, my_binary_30 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_binary_30`,`t1_values`.`my_binary_30`) AS `LOCATE(my_binary_30, my_binary_30 )`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 166 OR select_id IS NULL) order by id;
@@ -646,8 +646,8 @@ SELECT LOCATE(my_varchar_1000, my_varbinary_1000 ),
my_varchar_1000, my_varbinary_1000 id FROM t1_values
WHERE select_id = 165 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_varchar_1000, my_varbinary_1000 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`my_varbinary_1000` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_varchar_1000, my_varbinary_1000 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`my_varbinary_1000` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 165 OR select_id IS NULL) order by id;
@@ -660,8 +660,8 @@ SELECT LOCATE(my_varchar_1000, my_binary_30 ),
my_varchar_1000, my_binary_30 id FROM t1_values
WHERE select_id = 164 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_binary_30`) AS `LOCATE(my_varchar_1000, my_binary_30 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`my_binary_30` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_binary_30`) AS `LOCATE(my_varchar_1000, my_binary_30 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`my_binary_30` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 164 OR select_id IS NULL) order by id;
@@ -674,8 +674,8 @@ SELECT LOCATE(my_varchar_1000, my_char_30 ),
my_varchar_1000, my_char_30 id FROM t1_values
WHERE select_id = 163 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_char_30`) AS `LOCATE(my_varchar_1000, my_char_30 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`my_char_30` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_char_30`) AS `LOCATE(my_varchar_1000, my_char_30 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`my_char_30` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 163 OR select_id IS NULL) order by id;
@@ -688,8 +688,8 @@ SELECT LOCATE(my_varchar_1000, my_varchar_1000 ),
my_varchar_1000, id FROM t1_values
WHERE select_id = 162 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_varchar_1000, my_varchar_1000 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_varchar_1000`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_varchar_1000, my_varchar_1000 )`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 162 OR select_id IS NULL) order by id;
@@ -702,8 +702,8 @@ SELECT LOCATE(my_char_30, my_varbinary_1000 ),
my_char_30, my_varbinary_1000 id FROM t1_values
WHERE select_id = 161 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_char_30, my_varbinary_1000 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`my_varbinary_1000` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_varbinary_1000`) AS `LOCATE(my_char_30, my_varbinary_1000 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`my_varbinary_1000` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 161 OR select_id IS NULL) order by id;
@@ -716,8 +716,8 @@ SELECT LOCATE(my_char_30, my_binary_30 ),
my_char_30, my_binary_30 id FROM t1_values
WHERE select_id = 160 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_binary_30`) AS `LOCATE(my_char_30, my_binary_30 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`my_binary_30` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_binary_30`) AS `LOCATE(my_char_30, my_binary_30 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`my_binary_30` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 160 OR select_id IS NULL) order by id;
@@ -730,8 +730,8 @@ SELECT LOCATE(my_char_30, my_varchar_1000 ),
my_char_30, my_varchar_1000 id FROM t1_values
WHERE select_id = 159 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_char_30, my_varchar_1000 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`my_varchar_1000` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_varchar_1000`) AS `LOCATE(my_char_30, my_varchar_1000 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`my_varchar_1000` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 159 OR select_id IS NULL) order by id;
@@ -744,8 +744,8 @@ SELECT LOCATE(my_char_30, my_char_30 ),
my_char_30, id FROM t1_values
WHERE select_id = 158 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_char_30`) AS `LOCATE(my_char_30, my_char_30 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(`t1_values`.`my_char_30`,`t1_values`.`my_char_30`) AS `LOCATE(my_char_30, my_char_30 )`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 158 OR select_id IS NULL) order by id;
@@ -758,8 +758,8 @@ SELECT LOCATE('char', my_varbinary_1000),
my_varbinary_1000, id FROM t1_values
WHERE select_id = 157 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_varbinary_1000`) AS `LOCATE('char', my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_varbinary_1000`) AS `LOCATE('char', my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 157 OR select_id IS NULL) order by id;
@@ -772,8 +772,8 @@ SELECT LOCATE('char', my_binary_30),
my_binary_30, id FROM t1_values
WHERE select_id = 156 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_binary_30`) AS `LOCATE('char', my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_binary_30`) AS `LOCATE('char', my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 156 OR select_id IS NULL) order by id;
@@ -786,8 +786,8 @@ SELECT LOCATE('char', my_varchar_1000),
my_varchar_1000, id FROM t1_values
WHERE select_id = 155 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_varchar_1000`) AS `LOCATE('char', my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_varchar_1000`) AS `LOCATE('char', my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 155 OR select_id IS NULL) order by id;
@@ -800,8 +800,8 @@ SELECT LOCATE('char', my_char_30),
my_char_30, id FROM t1_values
WHERE select_id = 154 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_char_30`) AS `LOCATE('char', my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_char_30`) AS `LOCATE('char', my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 154 OR select_id IS NULL) order by id;
@@ -823,8 +823,8 @@ LOAD_FILE('../tmp/func_view.dat') id
äÄ@
5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select load_file(_latin1'../tmp/func_view.dat') AS `LOAD_FILE('../tmp/func_view.dat')`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select load_file(_latin1'../tmp/func_view.dat') AS `LOAD_FILE('../tmp/func_view.dat')`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 153 OR select_id IS NULL) order by id;
@@ -848,8 +848,8 @@ SELECT LENGTH(my_varbinary_1000),
my_varbinary_1000, id FROM t1_values
WHERE select_id = 152 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_varbinary_1000`) AS `LENGTH(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_varbinary_1000`) AS `LENGTH(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 152 OR select_id IS NULL) order by id;
@@ -862,8 +862,8 @@ SELECT LENGTH(my_binary_30),
my_binary_30, id FROM t1_values
WHERE select_id = 151 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_binary_30`) AS `LENGTH(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_binary_30`) AS `LENGTH(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 151 OR select_id IS NULL) order by id;
@@ -876,8 +876,8 @@ SELECT LENGTH(my_varchar_1000),
my_varchar_1000, id FROM t1_values
WHERE select_id = 150 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_varchar_1000`) AS `LENGTH(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_varchar_1000`) AS `LENGTH(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 150 OR select_id IS NULL) order by id;
@@ -890,8 +890,8 @@ SELECT LENGTH(my_char_30),
my_char_30, id FROM t1_values
WHERE select_id = 149 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_char_30`) AS `LENGTH(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select length(`t1_values`.`my_char_30`) AS `LENGTH(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 149 OR select_id IS NULL) order by id;
@@ -911,8 +911,8 @@ Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(_latin1'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`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(_latin1'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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 148 OR select_id IS NULL) order by id;
@@ -938,8 +938,8 @@ NULL NULL 1
- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_varbinary_1000`,2) AS `LEFT(my_varbinary_1000, 2)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_varbinary_1000`,2) AS `LEFT(my_varbinary_1000, 2)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 147 OR select_id IS NULL) order by id;
@@ -962,8 +962,8 @@ NULL NULL 1
- ---äÖüß@µ*$--
-1 -1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_binary_30`,2) AS `LEFT(my_binary_30, 2)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_binary_30`,2) AS `LEFT(my_binary_30, 2)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 146 OR select_id IS NULL) order by id;
@@ -986,8 +986,8 @@ NULL NULL 1
- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_varchar_1000`,2) AS `LEFT(my_varchar_1000, 2)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_varchar_1000`,2) AS `LEFT(my_varchar_1000, 2)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 145 OR select_id IS NULL) order by id;
@@ -1010,8 +1010,8 @@ NULL NULL 1
- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_char_30`,2) AS `LEFT(my_char_30, 2)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`t1_values`.`my_char_30`,2) AS `LEFT(my_char_30, 2)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 144 OR select_id IS NULL) order by id;
@@ -1030,8 +1030,8 @@ SELECT LCASE(my_varchar_1000),
my_varchar_1000, id FROM t1_values
WHERE select_id = 143 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_varchar_1000`) AS `LCASE(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select lcase(`t1_values`.`my_varchar_1000`) AS `LCASE(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 143 OR select_id IS NULL) order by id;
@@ -1044,8 +1044,8 @@ SELECT INSTR(my_char_30, 'char'),
my_char_30, id FROM t1_values
WHERE select_id = 142 OR select_id IS NULL order by id;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_char_30`) AS `INSTR(my_char_30, 'char')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select locate(_latin1'char',`t1_values`.`my_char_30`) AS `INSTR(my_char_30, 'char')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 142 OR select_id IS NULL) order by id;
@@ -1064,8 +1064,8 @@ NULL NULL 1
160 ---äÖüß@µ*$-- 4
16 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_varbinary_1000`) AS `BIT_LENGTH(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_varbinary_1000`) AS `BIT_LENGTH(my_varbinary_1000)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 141 OR select_id IS NULL) order by id;
@@ -1090,8 +1090,8 @@ NULL NULL 1
240 ---äÖüß@µ*$--
240 -1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_binary_30`) AS `BIT_LENGTH(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_binary_30`) AS `BIT_LENGTH(my_binary_30)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 140 OR select_id IS NULL) order by id;
@@ -1116,8 +1116,8 @@ NULL NULL 1
160 ---äÖüß@µ*$-- 4
16 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_varchar_1000`) AS `BIT_LENGTH(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_varchar_1000`) AS `BIT_LENGTH(my_varchar_1000)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 139 OR select_id IS NULL) order by id;
@@ -1142,8 +1142,8 @@ NULL NULL 1
152 ---äÖüß@µ*$-- 4
16 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_char_30`) AS `BIT_LENGTH(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select bit_length(`t1_values`.`my_char_30`) AS `BIT_LENGTH(my_char_30)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 138 OR select_id IS NULL) order by id;
@@ -1168,8 +1168,8 @@ IS_NULL NULL 1
2000 2000 4
2005 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_year`,_latin1'IS_NULL') AS `IFNULL(my_year,'IS_NULL')`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_year`,_latin1'IS_NULL') AS `IFNULL(my_year,'IS_NULL')`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 137 OR select_id IS NULL) order by id;
@@ -1194,8 +1194,8 @@ IS_NULL NULL 1
13:00:00 13:00:00 4
10:00:00 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_time`,_latin1'IS_NULL') AS `IFNULL(my_time,'IS_NULL')`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_time`,_latin1'IS_NULL') AS `IFNULL(my_time,'IS_NULL')`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 136 OR select_id IS NULL) order by id;
@@ -1220,8 +1220,8 @@ IFNULL(my_timestamp,'IS_NULL') my_timestamp id
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_timestamp`,_latin1'IS_NULL') AS `IFNULL(my_timestamp,'IS_NULL')`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_timestamp`,_latin1'IS_NULL') AS `IFNULL(my_timestamp,'IS_NULL')`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 135 OR select_id IS NULL) order by id;
@@ -1246,8 +1246,8 @@ IS_NULL NULL 1
2004-02-29 2004-02-29 4
2005-06-28 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_date`,_latin1'IS_NULL') AS `IFNULL(my_date,'IS_NULL')`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_date`,_latin1'IS_NULL') AS `IFNULL(my_date,'IS_NULL')`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 134 OR select_id IS NULL) order by id;
@@ -1272,8 +1272,8 @@ IS_NULL NULL 1
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_datetime`,_latin1'IS_NULL') AS `IFNULL(my_datetime,'IS_NULL')`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_datetime`,_latin1'IS_NULL') AS `IFNULL(my_datetime,'IS_NULL')`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 133 OR select_id IS NULL) order by id;
@@ -1298,8 +1298,8 @@ IS_NULL NULL 1
0 0 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_double`,_latin1'IS_NULL') AS `IFNULL(my_double,'IS_NULL')`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_double`,_latin1'IS_NULL') AS `IFNULL(my_double,'IS_NULL')`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 132 OR select_id IS NULL) order by id;
@@ -1324,8 +1324,8 @@ IS_NULL NULL 1
0.000000000000000000000000000000 0.000000000000000000000000000000 4
-1.000000000000000000000000000000 -1.000000000000000000000000000000 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_decimal`,_latin1'IS_NULL') AS `IFNULL(my_decimal,'IS_NULL')`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_decimal`,_latin1'IS_NULL') AS `IFNULL(my_decimal,'IS_NULL')`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 131 OR select_id IS NULL) order by id;
@@ -1350,8 +1350,8 @@ IS_NULL NULL 1
0 0 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_bigint`,_latin1'IS_NULL') AS `IFNULL(my_bigint,'IS_NULL')`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_bigint`,_latin1'IS_NULL') AS `IFNULL(my_bigint,'IS_NULL')`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 130 OR select_id IS NULL) order by id;
@@ -1376,8 +1376,8 @@ IS_NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_varbinary_1000`,_latin1'IS_NULL') AS `IFNULL(my_varbinary_1000,'IS_NULL')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_varbinary_1000`,_latin1'IS_NULL') AS `IFNULL(my_varbinary_1000,'IS_NULL')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 129 OR select_id IS NULL) order by id;
@@ -1402,8 +1402,8 @@ IS_NULL NULL 1
---äÖüß@µ*$--
-1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_binary_30`,_latin1'IS_NULL') AS `IFNULL(my_binary_30,'IS_NULL')`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_binary_30`,_latin1'IS_NULL') AS `IFNULL(my_binary_30,'IS_NULL')`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 128 OR select_id IS NULL) order by id;
@@ -1428,8 +1428,8 @@ IS_NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_varchar_1000`,_latin1'IS_NULL') AS `IFNULL(my_varchar_1000,'IS_NULL')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_varchar_1000`,_latin1'IS_NULL') AS `IFNULL(my_varchar_1000,'IS_NULL')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 127 OR select_id IS NULL) order by id;
@@ -1454,8 +1454,8 @@ IS_NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_char_30`,_latin1'IS_NULL') AS `IFNULL(my_char_30,'IS_NULL')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_char_30`,_latin1'IS_NULL') AS `IFNULL(my_char_30,'IS_NULL')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 126 OR select_id IS NULL) order by id;
@@ -1481,9 +1481,9 @@ IS NOT NULL 2155 3
IS NOT NULL 2000 4
IS NOT NULL 2005 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_year`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_year IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 125 OR select_id IS NULL) order by id;
@@ -1510,9 +1510,9 @@ IS NOT NULL 838:59:59 3
IS NOT NULL 13:00:00 4
IS NOT NULL 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_time`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_time IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 124 OR select_id IS NULL) order by id;
@@ -1539,9 +1539,9 @@ IS NOT NULL 2038-01-01 02:59:59 3
IS NOT NULL 2004-02-29 23:59:59 4
IS NOT NULL 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_timestamp`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_timestamp IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 123 OR select_id IS NULL) order by id;
@@ -1568,9 +1568,9 @@ IS NOT NULL 9999-12-31 3
IS NOT NULL 2004-02-29 4
IS NOT NULL 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_date`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_date IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 122 OR select_id IS NULL) order by id;
@@ -1597,9 +1597,9 @@ IS NOT NULL 9999-12-31 23:59:59 3
IS NOT NULL 2004-02-29 23:59:59 4
IS NOT NULL 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_datetime`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_datetime IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 121 OR select_id IS NULL) order by id;
@@ -1626,9 +1626,9 @@ IS NOT NULL 1.7976931348623e+308 3
IS NOT NULL 0 4
IS NOT NULL -1 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_double`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_double IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 120 OR select_id IS NULL) order by id;
@@ -1655,9 +1655,9 @@ IS NOT NULL 9999999999999999999999999999999999.999999999999999999999999999999 3
IS NOT NULL 0.000000000000000000000000000000 4
IS NOT NULL -1.000000000000000000000000000000 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_decimal`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_decimal IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 119 OR select_id IS NULL) order by id;
@@ -1684,9 +1684,9 @@ IS NOT NULL 9223372036854775807 3
IS NOT NULL 0 4
IS NOT NULL -1 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_bigint`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_bigint IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 118 OR select_id IS NULL) order by id;
@@ -1713,9 +1713,9 @@ IS NOT NULL <---------1000 characters-------------------------------------------
IS NOT NULL ---äÖüß@µ*$-- 4
IS NOT NULL -1 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_varbinary_1000`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_varbinary_1000 IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 117 OR select_id IS NULL) order by id;
@@ -1742,9 +1742,9 @@ IS NOT NULL <--------30 characters-------> 3
IS NOT NULL ---äÖüß@µ*$--
IS NOT NULL -1
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_binary_30`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_binary_30 IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 116 OR select_id IS NULL) order by id;
@@ -1771,9 +1771,9 @@ IS NOT NULL <---------1000 characters-------------------------------------------
IS NOT NULL ---äÖüß@µ*$-- 4
IS NOT NULL -1 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_varchar_1000`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_varchar_1000 IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 115 OR select_id IS NULL) order by id;
@@ -1800,9 +1800,9 @@ IS NOT NULL <--------30 characters-------> 3
IS NOT NULL ---äÖüß@µ*$-- 4
IS NOT NULL -1 5
SHOW CREATE VIEW v1;
-View Create View
+View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_char_30`),_latin1'IS NULL',_latin1'IS NOT NULL') AS `IF(my_char_30 IS NULL, 'IS NULL',
-'IS NOT NULL')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+'IS NOT NULL')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 114 OR select_id IS NULL) order by id;
@@ -1828,8 +1828,8 @@ IS TRUE 2155 3
IS TRUE 2000 4
IS TRUE 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_year`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_year, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_year, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 113 OR select_id IS NULL) order by id;
@@ -1854,8 +1854,8 @@ IS TRUE 838:59:59 3
IS TRUE 13:00:00 4
IS TRUE 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_time`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_time, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_time, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 112 OR select_id IS NULL) order by id;
@@ -1880,8 +1880,8 @@ IS TRUE 2038-01-01 02:59:59 3
IS TRUE 2004-02-29 23:59:59 4
IS TRUE 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_timestamp`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_timestamp, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_timestamp, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 111 OR select_id IS NULL) order by id;
@@ -1906,8 +1906,8 @@ IS TRUE 9999-12-31 3
IS TRUE 2004-02-29 4
IS TRUE 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_date`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_date, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_date, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 110 OR select_id IS NULL) order by id;
@@ -1932,8 +1932,8 @@ IS TRUE 9999-12-31 23:59:59 3
IS TRUE 2004-02-29 23:59:59 4
IS TRUE 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_datetime`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_datetime, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_datetime, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 109 OR select_id IS NULL) order by id;
@@ -1958,8 +1958,8 @@ IS TRUE 1.7976931348623e+308 3
IS NOT TRUE 0 4
IS TRUE -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_double`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_double, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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_double`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_double, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 108 OR select_id IS NULL) order by id;
@@ -1984,8 +1984,8 @@ IS TRUE 9999999999999999999999999999999999.999999999999999999999999999999 3
IS NOT TRUE 0.000000000000000000000000000000 4
IS TRUE -1.000000000000000000000000000000 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_decimal`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_decimal, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values`
+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_decimal`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_decimal, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 107 OR select_id IS NULL) order by id;
@@ -2010,8 +2010,8 @@ IS TRUE 9223372036854775807 3
IS NOT TRUE 0 4
IS TRUE -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_bigint`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_bigint, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint`,_latin1'IS TRUE',_latin1'IS NOT TRUE') AS `IF(my_bigint, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 106 OR select_id IS NULL) order by id;
@@ -2036,8 +2036,8 @@ IS NOT TRUE <---------1000 characters-------------------------------------------
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_varbinary_1000`,_latin1'IS TRUE',_latin1'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`
+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`,_latin1'IS TRUE',_latin1'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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 105 OR select_id IS NULL) order by id;
@@ -2067,8 +2067,8 @@ Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
Warning 1292 Truncated incorrect DOUBLE value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_binary_30`,_latin1'IS TRUE',_latin1'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`
+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`,_latin1'IS TRUE',_latin1'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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 104 OR select_id IS NULL) order by id;
@@ -2098,8 +2098,8 @@ IS NOT TRUE <---------1000 characters-------------------------------------------
IS NOT TRUE ---äÖüß@µ*$-- 4
IS TRUE -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_varchar_1000`,_latin1'IS TRUE',_latin1'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`
+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`,_latin1'IS TRUE',_latin1'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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 103 OR select_id IS NULL) order by id;
@@ -2127,8 +2127,8 @@ Warnings:
Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_char_30`,_latin1'IS TRUE',_latin1'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`
+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`,_latin1'IS TRUE',_latin1'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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 102 OR select_id IS NULL) order by id;
@@ -2156,8 +2156,8 @@ NULL NULL 1
---???????÷@??*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varbinary_1000` using koi8r) AS `CONVERT(my_varbinary_1000 USING koi8r)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varbinary_1000` using koi8r) AS `CONVERT(my_varbinary_1000 USING koi8r)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 101 OR select_id IS NULL) order by id;
@@ -2182,8 +2182,8 @@ NULL NULL 1
---???????÷@??*$--
-1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_binary_30` using koi8r) AS `CONVERT(my_binary_30 USING koi8r)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_binary_30` using koi8r) AS `CONVERT(my_binary_30 USING koi8r)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 100 OR select_id IS NULL) order by id;
@@ -2208,8 +2208,8 @@ NULL NULL 1
---????????@??*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varchar_1000` using koi8r) AS `CONVERT(my_varchar_1000 USING koi8r)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varchar_1000` using koi8r) AS `CONVERT(my_varchar_1000 USING koi8r)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 99 OR select_id IS NULL) order by id;
@@ -2234,8 +2234,8 @@ NULL NULL 1
---????????@??*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_char_30` using koi8r) AS `CONVERT(my_char_30 USING koi8r)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_char_30` using koi8r) AS `CONVERT(my_char_30 USING koi8r)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 98 OR select_id IS NULL) order by id;
@@ -2260,8 +2260,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varbinary_1000` using utf8) AS `CONVERT(my_varbinary_1000 USING utf8)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varbinary_1000` using utf8) AS `CONVERT(my_varbinary_1000 USING utf8)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 97 OR select_id IS NULL) order by id;
@@ -2286,8 +2286,8 @@ NULL NULL 1
---äÖüß@µ*$--
-1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_binary_30` using utf8) AS `CONVERT(my_binary_30 USING utf8)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_binary_30` using utf8) AS `CONVERT(my_binary_30 USING utf8)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 96 OR select_id IS NULL) order by id;
@@ -2312,8 +2312,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varchar_1000` using utf8) AS `CONVERT(my_varchar_1000 USING utf8)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_varchar_1000` using utf8) AS `CONVERT(my_varchar_1000 USING utf8)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 95 OR select_id IS NULL) order by id;
@@ -2338,8 +2338,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_char_30` using utf8) AS `CONVERT(my_char_30 USING utf8)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select convert(`t1_values`.`my_char_30` using utf8) AS `CONVERT(my_char_30 USING utf8)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 94 OR select_id IS NULL) order by id;
@@ -2364,8 +2364,8 @@ NULL NULL 1
2000 2000 4
2005 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as unsigned) AS `CAST(my_year AS UNSIGNED INTEGER)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as unsigned) AS `CAST(my_year AS UNSIGNED INTEGER)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 93 OR select_id IS NULL) order by id;
@@ -2385,34 +2385,22 @@ my_time, id FROM t1_values
WHERE select_id = 92 OR select_id IS NULL order by id;
CAST(my_time AS UNSIGNED INTEGER) my_time id
NULL NULL 1
-18446744073709550778 -838:59:59 2
-838 838:59:59 3
-13 13:00:00 4
-10 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '-838:59:59'
-Warning 1105 Cast to unsigned converted negative integer to it's positive complement
-Warning 1292 Truncated incorrect INTEGER value: '838:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '13:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '10:00:00'
+18446744073701165657 -838:59:59 2
+8385959 838:59:59 3
+130000 13:00:00 4
+100000 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as unsigned) AS `CAST(my_time AS UNSIGNED INTEGER)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as unsigned) AS `CAST(my_time AS UNSIGNED INTEGER)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 92 OR select_id IS NULL) order by id;
CAST(my_time AS UNSIGNED INTEGER) my_time id
NULL NULL 1
-18446744073709550778 -838:59:59 2
-838 838:59:59 3
-13 13:00:00 4
-10 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '-838:59:59'
-Warning 1105 Cast to unsigned converted negative integer to it's positive complement
-Warning 1292 Truncated incorrect INTEGER value: '838:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '13:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '10:00:00'
+18446744073701165657 -838:59:59 2
+8385959 838:59:59 3
+130000 13:00:00 4
+100000 10:00:00 5
DROP VIEW v1;
@@ -2423,34 +2411,22 @@ my_timestamp, id FROM t1_values
WHERE select_id = 91 OR select_id IS NULL order by id;
CAST(my_timestamp AS UNSIGNED INTEGER) my_timestamp id
0 0000-00-00 00:00:00 1
-1970 1970-01-01 03:00:01 2
-2038 2038-01-01 02:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0000-00-00 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '1970-01-01 03:00:01'
-Warning 1292 Truncated incorrect INTEGER value: '2038-01-01 02:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+19700101030001 1970-01-01 03:00:01 2
+20380101025959 2038-01-01 02:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as unsigned) AS `CAST(my_timestamp AS UNSIGNED INTEGER)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as unsigned) AS `CAST(my_timestamp AS UNSIGNED INTEGER)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 91 OR select_id IS NULL) order by id;
CAST(my_timestamp AS UNSIGNED INTEGER) my_timestamp id
0 0000-00-00 00:00:00 1
-1970 1970-01-01 03:00:01 2
-2038 2038-01-01 02:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0000-00-00 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '1970-01-01 03:00:01'
-Warning 1292 Truncated incorrect INTEGER value: '2038-01-01 02:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+19700101030001 1970-01-01 03:00:01 2
+20380101025959 2038-01-01 02:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
DROP VIEW v1;
@@ -2461,32 +2437,22 @@ my_date, id FROM t1_values
WHERE select_id = 90 OR select_id IS NULL order by id;
CAST(my_date AS UNSIGNED INTEGER) my_date id
NULL NULL 1
-1 0001-01-01 2
-9999 9999-12-31 3
-2004 2004-02-29 4
-2005 2005-06-28 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28'
+10101 0001-01-01 2
+99991231 9999-12-31 3
+20040229 2004-02-29 4
+20050628 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as unsigned) AS `CAST(my_date AS UNSIGNED INTEGER)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as unsigned) AS `CAST(my_date AS UNSIGNED INTEGER)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 90 OR select_id IS NULL) order by id;
CAST(my_date AS UNSIGNED INTEGER) my_date id
NULL NULL 1
-1 0001-01-01 2
-9999 9999-12-31 3
-2004 2004-02-29 4
-2005 2005-06-28 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28'
+10101 0001-01-01 2
+99991231 9999-12-31 3
+20040229 2004-02-29 4
+20050628 2005-06-28 5
DROP VIEW v1;
@@ -2497,32 +2463,22 @@ my_datetime, id FROM t1_values
WHERE select_id = 89 OR select_id IS NULL order by id;
CAST(my_datetime AS UNSIGNED INTEGER) my_datetime id
NULL NULL 1
-1 0001-01-01 00:00:00 2
-9999 9999-12-31 23:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+10101000000 0001-01-01 00:00:00 2
+99991231235959 9999-12-31 23:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as unsigned) AS `CAST(my_datetime AS UNSIGNED INTEGER)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as unsigned) AS `CAST(my_datetime AS UNSIGNED INTEGER)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 89 OR select_id IS NULL) order by id;
CAST(my_datetime AS UNSIGNED INTEGER) my_datetime id
NULL NULL 1
-1 0001-01-01 00:00:00 2
-9999 9999-12-31 23:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+10101000000 0001-01-01 00:00:00 2
+99991231235959 9999-12-31 23:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
DROP VIEW v1;
@@ -2542,8 +2498,8 @@ Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
SHOW CREATE VIEW v1;
-View Create View
-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`
+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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 88 OR select_id IS NULL) order by id;
@@ -2572,8 +2528,8 @@ NULL NULL 1
0 0 4
18446744073709551615 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as unsigned) AS `CAST(my_bigint AS UNSIGNED INTEGER)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as unsigned) AS `CAST(my_bigint AS UNSIGNED INTEGER)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 87 OR select_id IS NULL) order by id;
@@ -2603,8 +2559,8 @@ Warning 1292 Truncated incorrect INTEGER value: '<---------1000 characters------
Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$-- '
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as unsigned) AS `CAST(my_varbinary_1000 AS UNSIGNED INTEGER)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 unsigned) AS `CAST(my_varbinary_1000 AS UNSIGNED INTEGER)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 86 OR select_id IS NULL) order by id;
@@ -2640,8 +2596,8 @@ Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$-- '
Warning 1292 Truncated incorrect INTEGER value: '-1'
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as unsigned) AS `CAST(my_binary_30 AS UNSIGNED INTEGER)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 unsigned) AS `CAST(my_binary_30 AS UNSIGNED INTEGER)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 85 OR select_id IS NULL) order by id;
@@ -2677,8 +2633,8 @@ Warning 1292 Truncated incorrect INTEGER value: '<---------1000 characters------
Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$-- '
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as unsigned) AS `CAST(my_varchar_1000 AS UNSIGNED INTEGER)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 unsigned) AS `CAST(my_varchar_1000 AS UNSIGNED INTEGER)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 84 OR select_id IS NULL) order by id;
@@ -2713,8 +2669,8 @@ Warning 1292 Truncated incorrect INTEGER value: '<--------30 characters------->'
Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$--'
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as unsigned) AS `CAST(my_char_30 AS UNSIGNED INTEGER)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 unsigned) AS `CAST(my_char_30 AS UNSIGNED INTEGER)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 83 OR select_id IS NULL) order by id;
@@ -2744,8 +2700,8 @@ NULL NULL 1
2000 2000 4
2005 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as signed) AS `CAST(my_year AS SIGNED INTEGER)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as signed) AS `CAST(my_year AS SIGNED INTEGER)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 82 OR select_id IS NULL) order by id;
@@ -2765,32 +2721,22 @@ my_time, id FROM t1_values
WHERE select_id = 81 OR select_id IS NULL order by id;
CAST(my_time AS SIGNED INTEGER) my_time id
NULL NULL 1
--838 -838:59:59 2
-838 838:59:59 3
-13 13:00:00 4
-10 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '-838:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '838:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '13:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '10:00:00'
+-8385959 -838:59:59 2
+8385959 838:59:59 3
+130000 13:00:00 4
+100000 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as signed) AS `CAST(my_time AS SIGNED INTEGER)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as signed) AS `CAST(my_time AS SIGNED INTEGER)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 81 OR select_id IS NULL) order by id;
CAST(my_time AS SIGNED INTEGER) my_time id
NULL NULL 1
--838 -838:59:59 2
-838 838:59:59 3
-13 13:00:00 4
-10 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '-838:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '838:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '13:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '10:00:00'
+-8385959 -838:59:59 2
+8385959 838:59:59 3
+130000 13:00:00 4
+100000 10:00:00 5
DROP VIEW v1;
@@ -2801,34 +2747,22 @@ my_timestamp, id FROM t1_values
WHERE select_id = 80 OR select_id IS NULL order by id;
CAST(my_timestamp AS SIGNED INTEGER) my_timestamp id
0 0000-00-00 00:00:00 1
-1970 1970-01-01 03:00:01 2
-2038 2038-01-01 02:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0000-00-00 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '1970-01-01 03:00:01'
-Warning 1292 Truncated incorrect INTEGER value: '2038-01-01 02:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+19700101030001 1970-01-01 03:00:01 2
+20380101025959 2038-01-01 02:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as signed) AS `CAST(my_timestamp AS SIGNED INTEGER)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as signed) AS `CAST(my_timestamp AS SIGNED INTEGER)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 80 OR select_id IS NULL) order by id;
CAST(my_timestamp AS SIGNED INTEGER) my_timestamp id
0 0000-00-00 00:00:00 1
-1970 1970-01-01 03:00:01 2
-2038 2038-01-01 02:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0000-00-00 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '1970-01-01 03:00:01'
-Warning 1292 Truncated incorrect INTEGER value: '2038-01-01 02:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+19700101030001 1970-01-01 03:00:01 2
+20380101025959 2038-01-01 02:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
DROP VIEW v1;
@@ -2839,32 +2773,22 @@ my_date, id FROM t1_values
WHERE select_id = 79 OR select_id IS NULL order by id;
CAST(my_date AS SIGNED INTEGER) my_date id
NULL NULL 1
-1 0001-01-01 2
-9999 9999-12-31 3
-2004 2004-02-29 4
-2005 2005-06-28 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28'
+10101 0001-01-01 2
+99991231 9999-12-31 3
+20040229 2004-02-29 4
+20050628 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as signed) AS `CAST(my_date AS SIGNED INTEGER)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as signed) AS `CAST(my_date AS SIGNED INTEGER)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 79 OR select_id IS NULL) order by id;
CAST(my_date AS SIGNED INTEGER) my_date id
NULL NULL 1
-1 0001-01-01 2
-9999 9999-12-31 3
-2004 2004-02-29 4
-2005 2005-06-28 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28'
+10101 0001-01-01 2
+99991231 9999-12-31 3
+20040229 2004-02-29 4
+20050628 2005-06-28 5
DROP VIEW v1;
@@ -2875,32 +2799,22 @@ my_datetime, id FROM t1_values
WHERE select_id = 78 OR select_id IS NULL order by id;
CAST(my_datetime AS SIGNED INTEGER) my_datetime id
NULL NULL 1
-1 0001-01-01 00:00:00 2
-9999 9999-12-31 23:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+10101000000 0001-01-01 00:00:00 2
+99991231235959 9999-12-31 23:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as signed) AS `CAST(my_datetime AS SIGNED INTEGER)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as signed) AS `CAST(my_datetime AS SIGNED INTEGER)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 78 OR select_id IS NULL) order by id;
CAST(my_datetime AS SIGNED INTEGER) my_datetime id
NULL NULL 1
-1 0001-01-01 00:00:00 2
-9999 9999-12-31 23:59:59 3
-2004 2004-02-29 23:59:59 4
-2005 2005-06-28 10:00:00 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '0001-01-01 00:00:00'
-Warning 1292 Truncated incorrect INTEGER value: '9999-12-31 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2004-02-29 23:59:59'
-Warning 1292 Truncated incorrect INTEGER value: '2005-06-28 10:00:00'
+10101000000 0001-01-01 00:00:00 2
+99991231235959 9999-12-31 23:59:59 3
+20040229235959 2004-02-29 23:59:59 4
+20050628100000 2005-06-28 10:00:00 5
DROP VIEW v1;
@@ -2919,8 +2833,8 @@ Warnings:
Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e+308'
Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e+308'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as signed) AS `CAST(my_double AS SIGNED INTEGER)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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 signed) AS `CAST(my_double AS SIGNED INTEGER)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 77 OR select_id IS NULL) order by id;
@@ -2943,23 +2857,23 @@ my_decimal, id FROM t1_values
WHERE select_id = 76 OR select_id IS NULL order by id;
CAST(my_decimal AS SIGNED INTEGER) my_decimal id
NULL NULL 1
--10000000000000000 -9999999999999999999999999999999999.999999999999999999999999999999 2
-10000000000000000 9999999999999999999999999999999999.999999999999999999999999999999 3
+-9223372036854775808 -9999999999999999999999999999999999.999999999999999999999999999999 2
+9223372036854775807 9999999999999999999999999999999999.999999999999999999999999999999 3
0 0.000000000000000000000000000000 4
-1 -1.000000000000000000000000000000 5
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: ''
SHOW CREATE VIEW v1;
-View Create View
-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`
+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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 76 OR select_id IS NULL) order by id;
CAST(my_decimal AS SIGNED INTEGER) my_decimal id
NULL NULL 1
--10000000000000000 -9999999999999999999999999999999999.999999999999999999999999999999 2
-10000000000000000 9999999999999999999999999999999999.999999999999999999999999999999 3
+-9223372036854775808 -9999999999999999999999999999999999.999999999999999999999999999999 2
+9223372036854775807 9999999999999999999999999999999999.999999999999999999999999999999 3
0 0.000000000000000000000000000000 4
-1 -1.000000000000000000000000000000 5
Warnings:
@@ -2980,8 +2894,8 @@ NULL NULL 1
0 0 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as signed) AS `CAST(my_bigint AS SIGNED INTEGER)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as signed) AS `CAST(my_bigint AS SIGNED INTEGER)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 75 OR select_id IS NULL) order by id;
@@ -3010,8 +2924,8 @@ Warning 1292 Truncated incorrect INTEGER value: ''
Warning 1292 Truncated incorrect INTEGER value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as signed) AS `CAST(my_varbinary_1000 AS SIGNED INTEGER)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 signed) AS `CAST(my_varbinary_1000 AS SIGNED INTEGER)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 74 OR select_id IS NULL) order by id;
@@ -3045,8 +2959,8 @@ Warning 1292 Truncated incorrect INTEGER value: '<--------30 characters------->'
Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$-- '
Warning 1292 Truncated incorrect INTEGER value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as signed) AS `CAST(my_binary_30 AS SIGNED INTEGER)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 signed) AS `CAST(my_binary_30 AS SIGNED INTEGER)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 73 OR select_id IS NULL) order by id;
@@ -3080,8 +2994,8 @@ Warning 1292 Truncated incorrect INTEGER value: ''
Warning 1292 Truncated incorrect INTEGER value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as signed) AS `CAST(my_varchar_1000 AS SIGNED INTEGER)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 signed) AS `CAST(my_varchar_1000 AS SIGNED INTEGER)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 72 OR select_id IS NULL) order by id;
@@ -3114,8 +3028,8 @@ Warning 1292 Truncated incorrect INTEGER value: ''
Warning 1292 Truncated incorrect INTEGER value: '<--------30 characters------->'
Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$--'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as signed) AS `CAST(my_char_30 AS SIGNED INTEGER)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 signed) AS `CAST(my_char_30 AS SIGNED INTEGER)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 71 OR select_id IS NULL) order by id;
@@ -3132,287 +3046,255 @@ Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$--'
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_year AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_year AS DECIMAL(37,2)),
my_year, id FROM t1_values;
-SELECT CAST(my_year AS DECIMAL),
+SELECT CAST(my_year AS DECIMAL(37,2)),
my_year, id FROM t1_values
WHERE select_id = 70 OR select_id IS NULL order by id;
-CAST(my_year AS DECIMAL) my_year id
+CAST(my_year AS DECIMAL(37,2)) my_year id
NULL NULL 1
-1901 1901 2
-2155 2155 3
-2000 2000 4
-2005 2005 5
+1901.00 1901 2
+2155.00 2155 3
+2000.00 2000 4
+2005.00 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as decimal) AS `CAST(my_year AS DECIMAL)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as decimal(37,2)) AS `CAST(my_year AS DECIMAL(37,2))`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 70 OR select_id IS NULL) order by id;
-CAST(my_year AS DECIMAL) my_year id
+CAST(my_year AS DECIMAL(37,2)) my_year id
NULL NULL 1
-1901 1901 2
-2155 2155 3
-2000 2000 4
-2005 2005 5
+1901.00 1901 2
+2155.00 2155 3
+2000.00 2000 4
+2005.00 2005 5
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_time AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_time AS DECIMAL(37,2)),
my_time, id FROM t1_values;
-SELECT CAST(my_time AS DECIMAL),
+SELECT CAST(my_time AS DECIMAL(37,2)),
my_time, id FROM t1_values
WHERE select_id = 69 OR select_id IS NULL order by id;
-CAST(my_time AS DECIMAL) my_time id
+CAST(my_time AS DECIMAL(37,2)) my_time id
NULL NULL 1
--8385959 -838:59:59 2
-8385959 838:59:59 3
-130000 13:00:00 4
-100000 10:00:00 5
+-8385959.00 -838:59:59 2
+8385959.00 838:59:59 3
+130000.00 13:00:00 4
+100000.00 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as decimal) AS `CAST(my_time AS DECIMAL)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as decimal(37,2)) AS `CAST(my_time AS DECIMAL(37,2))`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 69 OR select_id IS NULL) order by id;
-CAST(my_time AS DECIMAL) my_time id
+CAST(my_time AS DECIMAL(37,2)) my_time id
NULL NULL 1
--8385959 -838:59:59 2
-8385959 838:59:59 3
-130000 13:00:00 4
-100000 10:00:00 5
+-8385959.00 -838:59:59 2
+8385959.00 838:59:59 3
+130000.00 13:00:00 4
+100000.00 10:00:00 5
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_timestamp AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_timestamp AS DECIMAL(37,2)),
my_timestamp, id FROM t1_values;
-SELECT CAST(my_timestamp AS DECIMAL),
+SELECT CAST(my_timestamp AS DECIMAL(37,2)),
my_timestamp, id FROM t1_values
WHERE select_id = 68 OR select_id IS NULL order by id;
-CAST(my_timestamp AS DECIMAL) my_timestamp id
-0 0000-00-00 00:00:00 1
-9999999999 1970-01-01 03:00:01 2
-9999999999 2038-01-01 02:59:59 3
-9999999999 2004-02-29 23:59:59 4
-9999999999 2005-06-28 10:00:00 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
+CAST(my_timestamp AS DECIMAL(37,2)) my_timestamp id
+0.00 0000-00-00 00:00:00 1
+19700101030001.00 1970-01-01 03:00:01 2
+20380101025959.00 2038-01-01 02:59:59 3
+20040229235959.00 2004-02-29 23:59:59 4
+20050628100000.00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as decimal) AS `CAST(my_timestamp AS DECIMAL)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as decimal(37,2)) AS `CAST(my_timestamp AS DECIMAL(37,2))`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 68 OR select_id IS NULL) order by id;
-CAST(my_timestamp AS DECIMAL) my_timestamp id
-0 0000-00-00 00:00:00 1
-9999999999 1970-01-01 03:00:01 2
-9999999999 2038-01-01 02:59:59 3
-9999999999 2004-02-29 23:59:59 4
-9999999999 2005-06-28 10:00:00 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_timestamp AS DECIMAL)' at row 1
+CAST(my_timestamp AS DECIMAL(37,2)) my_timestamp id
+0.00 0000-00-00 00:00:00 1
+19700101030001.00 1970-01-01 03:00:01 2
+20380101025959.00 2038-01-01 02:59:59 3
+20040229235959.00 2004-02-29 23:59:59 4
+20050628100000.00 2005-06-28 10:00:00 5
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_date AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_date AS DECIMAL(37,2)),
my_date, id FROM t1_values;
-SELECT CAST(my_date AS DECIMAL),
+SELECT CAST(my_date AS DECIMAL(37,2)),
my_date, id FROM t1_values
WHERE select_id = 67 OR select_id IS NULL order by id;
-CAST(my_date AS DECIMAL) my_date id
+CAST(my_date AS DECIMAL(37,2)) my_date id
NULL NULL 1
-10101 0001-01-01 2
-99991231 9999-12-31 3
-20040229 2004-02-29 4
-20050628 2005-06-28 5
+10101.00 0001-01-01 2
+99991231.00 9999-12-31 3
+20040229.00 2004-02-29 4
+20050628.00 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as decimal) AS `CAST(my_date AS DECIMAL)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as decimal(37,2)) AS `CAST(my_date AS DECIMAL(37,2))`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 67 OR select_id IS NULL) order by id;
-CAST(my_date AS DECIMAL) my_date id
+CAST(my_date AS DECIMAL(37,2)) my_date id
NULL NULL 1
-10101 0001-01-01 2
-99991231 9999-12-31 3
-20040229 2004-02-29 4
-20050628 2005-06-28 5
+10101.00 0001-01-01 2
+99991231.00 9999-12-31 3
+20040229.00 2004-02-29 4
+20050628.00 2005-06-28 5
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_datetime AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_datetime AS DECIMAL(37,2)),
my_datetime, id FROM t1_values;
-SELECT CAST(my_datetime AS DECIMAL),
+SELECT CAST(my_datetime AS DECIMAL(37,2)),
my_datetime, id FROM t1_values
WHERE select_id = 66 OR select_id IS NULL order by id;
-CAST(my_datetime AS DECIMAL) my_datetime id
+CAST(my_datetime AS DECIMAL(37,2)) my_datetime id
NULL NULL 1
-9999999999 0001-01-01 00:00:00 2
-9999999999 9999-12-31 23:59:59 3
-9999999999 2004-02-29 23:59:59 4
-9999999999 2005-06-28 10:00:00 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
+10101000000.00 0001-01-01 00:00:00 2
+99991231235959.00 9999-12-31 23:59:59 3
+20040229235959.00 2004-02-29 23:59:59 4
+20050628100000.00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as decimal) AS `CAST(my_datetime AS DECIMAL)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as decimal(37,2)) AS `CAST(my_datetime AS DECIMAL(37,2))`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 66 OR select_id IS NULL) order by id;
-CAST(my_datetime AS DECIMAL) my_datetime id
+CAST(my_datetime AS DECIMAL(37,2)) my_datetime id
NULL NULL 1
-9999999999 0001-01-01 00:00:00 2
-9999999999 9999-12-31 23:59:59 3
-9999999999 2004-02-29 23:59:59 4
-9999999999 2005-06-28 10:00:00 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_datetime AS DECIMAL)' at row 1
+10101000000.00 0001-01-01 00:00:00 2
+99991231235959.00 9999-12-31 23:59:59 3
+20040229235959.00 2004-02-29 23:59:59 4
+20050628100000.00 2005-06-28 10:00:00 5
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_double AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_double AS DECIMAL(37,2)),
my_double, id FROM t1_values;
-SELECT CAST(my_double AS DECIMAL),
+SELECT CAST(my_double AS DECIMAL(37,2)),
my_double, id FROM t1_values
WHERE select_id = 65 OR select_id IS NULL order by id;
-CAST(my_double AS DECIMAL) my_double id
+CAST(my_double AS DECIMAL(37,2)) my_double id
NULL NULL 1
--9999999999 -1.7976931348623e+308 2
-9999999999 1.7976931348623e+308 3
-0 0 4
--1 -1 5
--3333 -3333.3333 30
+-99999999999999999999999999999999999.99 -1.7976931348623e+308 2
+99999999999999999999999999999999999.99 1.7976931348623e+308 3
+0.00 0 4
+-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)' at row 1
+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)' at row 1
+Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as decimal) AS `CAST(my_double AS DECIMAL)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 65 OR select_id IS NULL) order by id;
-CAST(my_double AS DECIMAL) my_double id
+CAST(my_double AS DECIMAL(37,2)) my_double id
NULL NULL 1
--9999999999 -1.7976931348623e+308 2
-9999999999 1.7976931348623e+308 3
-0 0 4
--1 -1 5
--3333 -3333.3333 30
+-99999999999999999999999999999999999.99 -1.7976931348623e+308 2
+99999999999999999999999999999999999.99 1.7976931348623e+308 3
+0.00 0 4
+-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)' at row 1
+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)' at row 1
+Error 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_decimal AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_decimal AS DECIMAL(37,2)),
my_decimal, id FROM t1_values;
-SELECT CAST(my_decimal AS DECIMAL),
+SELECT CAST(my_decimal AS DECIMAL(37,2)),
my_decimal, id FROM t1_values
WHERE select_id = 64 OR select_id IS NULL order by id;
-CAST(my_decimal AS DECIMAL) my_decimal id
+CAST(my_decimal AS DECIMAL(37,2)) my_decimal id
NULL NULL 1
--9999999999 -9999999999999999999999999999999999.999999999999999999999999999999 2
-9999999999 9999999999999999999999999999999999.999999999999999999999999999999 3
-0 0.000000000000000000000000000000 4
--1 -1.000000000000000000000000000000 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_decimal AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_decimal AS DECIMAL)' at row 1
+-10000000000000000000000000000000000.00 -9999999999999999999999999999999999.999999999999999999999999999999 2
+10000000000000000000000000000000000.00 9999999999999999999999999999999999.999999999999999999999999999999 3
+0.00 0.000000000000000000000000000000 4
+-1.00 -1.000000000000000000000000000000 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as decimal) AS `CAST(my_decimal AS DECIMAL)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values`
+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 decimal(37,2)) AS `CAST(my_decimal AS DECIMAL(37,2))`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 64 OR select_id IS NULL) order by id;
-CAST(my_decimal AS DECIMAL) my_decimal id
+CAST(my_decimal AS DECIMAL(37,2)) my_decimal id
NULL NULL 1
--9999999999 -9999999999999999999999999999999999.999999999999999999999999999999 2
-9999999999 9999999999999999999999999999999999.999999999999999999999999999999 3
-0 0.000000000000000000000000000000 4
--1 -1.000000000000000000000000000000 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_decimal AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_decimal AS DECIMAL)' at row 1
+-10000000000000000000000000000000000.00 -9999999999999999999999999999999999.999999999999999999999999999999 2
+10000000000000000000000000000000000.00 9999999999999999999999999999999999.999999999999999999999999999999 3
+0.00 0.000000000000000000000000000000 4
+-1.00 -1.000000000000000000000000000000 5
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_bigint AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_bigint AS DECIMAL(37,2)),
my_bigint, id FROM t1_values;
-SELECT CAST(my_bigint AS DECIMAL),
+SELECT CAST(my_bigint AS DECIMAL(37,2)),
my_bigint, id FROM t1_values
WHERE select_id = 63 OR select_id IS NULL order by id;
-CAST(my_bigint AS DECIMAL) my_bigint id
+CAST(my_bigint AS DECIMAL(37,2)) my_bigint id
NULL NULL 1
--9999999999 -9223372036854775808 2
-9999999999 9223372036854775807 3
-0 0 4
--1 -1 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_bigint AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_bigint AS DECIMAL)' at row 1
+-9223372036854775808.00 -9223372036854775808 2
+9223372036854775807.00 9223372036854775807 3
+0.00 0 4
+-1.00 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as decimal) AS `CAST(my_bigint AS DECIMAL)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as decimal(37,2)) AS `CAST(my_bigint AS DECIMAL(37,2))`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 63 OR select_id IS NULL) order by id;
-CAST(my_bigint AS DECIMAL) my_bigint id
+CAST(my_bigint AS DECIMAL(37,2)) my_bigint id
NULL NULL 1
--9999999999 -9223372036854775808 2
-9999999999 9223372036854775807 3
-0 0 4
--1 -1 5
-Warnings:
-Error 1264 Out of range value for column 'CAST(my_bigint AS DECIMAL)' at row 1
-Error 1264 Out of range value for column 'CAST(my_bigint AS DECIMAL)' at row 1
+-9223372036854775808.00 -9223372036854775808 2
+9223372036854775807.00 9223372036854775807 3
+0.00 0 4
+-1.00 -1 5
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_varbinary_1000 AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_varbinary_1000 AS DECIMAL(37,2)),
my_varbinary_1000, id FROM t1_values;
-SELECT CAST(my_varbinary_1000 AS DECIMAL),
+SELECT CAST(my_varbinary_1000 AS DECIMAL(37,2)),
my_varbinary_1000, id FROM t1_values
WHERE select_id = 62 OR select_id IS NULL order by id;
-CAST(my_varbinary_1000 AS DECIMAL) my_varbinary_1000 id
+CAST(my_varbinary_1000 AS DECIMAL(37,2)) my_varbinary_1000 id
NULL NULL 1
-0 2
-0 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
--3333 -3333.3333 29
+0.00 2
+0.00 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
+0.00 ---äÖüß@µ*$-- 4
+-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
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as decimal) AS `CAST(my_varbinary_1000 AS DECIMAL)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 62 OR select_id IS NULL) order by id;
-CAST(my_varbinary_1000 AS DECIMAL) my_varbinary_1000 id
+CAST(my_varbinary_1000 AS DECIMAL(37,2)) my_varbinary_1000 id
NULL NULL 1
-0 2
-0 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
--3333 -3333.3333 29
+0.00 2
+0.00 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
+0.00 ---äÖüß@µ*$-- 4
+-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
@@ -3420,18 +3302,18 @@ Error 1366 Incorrect decimal value: '' for column '' at row -1
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_binary_30 AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_binary_30 AS DECIMAL(37,2)),
my_binary_30, id FROM t1_values;
-SELECT CAST(my_binary_30 AS DECIMAL),
+SELECT CAST(my_binary_30 AS DECIMAL(37,2)),
my_binary_30, id FROM t1_values
WHERE select_id = 61 OR select_id IS NULL order by id;
-CAST(my_binary_30 AS DECIMAL) my_binary_30 id
+CAST(my_binary_30 AS DECIMAL(37,2)) my_binary_30 id
NULL NULL 1
-0
-0 <--------30 characters-------> 3
-0 ---äÖüß@µ*$--
--1 -1
--3333 -3333.3333
+0.00
+0.00 <--------30 characters-------> 3
+0.00 ---äÖüß@µ*$--
+-1.00 -1
+-3333.33 -3333.3333
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ''
@@ -3442,18 +3324,18 @@ Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
Warning 1292 Truncated incorrect DECIMAL value: '-1'
Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as decimal) AS `CAST(my_binary_30 AS DECIMAL)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 61 OR select_id IS NULL) order by id;
-CAST(my_binary_30 AS DECIMAL) my_binary_30 id
+CAST(my_binary_30 AS DECIMAL(37,2)) my_binary_30 id
NULL NULL 1
-0
-0 <--------30 characters-------> 3
-0 ---äÖüß@µ*$--
--1 -1
--3333 -3333.3333
+0.00
+0.00 <--------30 characters-------> 3
+0.00 ---äÖüß@µ*$--
+-1.00 -1
+-3333.33 -3333.3333
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ''
@@ -3466,35 +3348,35 @@ Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333'
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_varchar_1000 AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_varchar_1000 AS DECIMAL(37,2)),
my_varchar_1000, id FROM t1_values;
-SELECT CAST(my_varchar_1000 AS DECIMAL),
+SELECT CAST(my_varchar_1000 AS DECIMAL(37,2)),
my_varchar_1000, id FROM t1_values
WHERE select_id = 60 OR select_id IS NULL order by id;
-CAST(my_varchar_1000 AS DECIMAL) my_varchar_1000 id
+CAST(my_varchar_1000 AS DECIMAL(37,2)) my_varchar_1000 id
NULL NULL 1
-0 2
-0 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
--3333 -3333.3333 27
+0.00 2
+0.00 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
+0.00 ---äÖüß@µ*$-- 4
+-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
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as decimal) AS `CAST(my_varchar_1000 AS DECIMAL)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 60 OR select_id IS NULL) order by id;
-CAST(my_varchar_1000 AS DECIMAL) my_varchar_1000 id
+CAST(my_varchar_1000 AS DECIMAL(37,2)) my_varchar_1000 id
NULL NULL 1
-0 2
-0 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
--3333 -3333.3333 27
+0.00 2
+0.00 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
+0.00 ---äÖüß@µ*$-- 4
+-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
@@ -3502,18 +3384,18 @@ Error 1366 Incorrect decimal value: '' for column '' at row -1
DROP VIEW v1;
-CREATE VIEW v1 AS SELECT CAST(my_char_30 AS DECIMAL),
+CREATE VIEW v1 AS SELECT CAST(my_char_30 AS DECIMAL(37,2)),
my_char_30, id FROM t1_values;
-SELECT CAST(my_char_30 AS DECIMAL),
+SELECT CAST(my_char_30 AS DECIMAL(37,2)),
my_char_30, id FROM t1_values
WHERE select_id = 59 OR select_id IS NULL order by id;
-CAST(my_char_30 AS DECIMAL) my_char_30 id
+CAST(my_char_30 AS DECIMAL(37,2)) my_char_30 id
NULL NULL 1
-0 2
-0 <--------30 characters-------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
--3333 -3333.3333 26
+0.00 2
+0.00 <--------30 characters-------> 3
+0.00 ---äÖüß@µ*$-- 4
+-1.00 -1 5
+-3333.33 -3333.3333 26
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' '
@@ -3522,18 +3404,18 @@ Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as decimal) AS `CAST(my_char_30 AS DECIMAL)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 59 OR select_id IS NULL) order by id;
-CAST(my_char_30 AS DECIMAL) my_char_30 id
+CAST(my_char_30 AS DECIMAL(37,2)) my_char_30 id
NULL NULL 1
-0 2
-0 <--------30 characters-------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
--3333 -3333.3333 26
+0.00 2
+0.00 <--------30 characters-------> 3
+0.00 ---äÖüß@µ*$-- 4
+-1.00 -1 5
+-3333.33 -3333.3333 26
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
Warning 1292 Truncated incorrect DECIMAL value: ' '
@@ -3556,8 +3438,8 @@ NULL NULL 1
00:20:00 2000 4
00:20:05 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as time) AS `CAST(my_year AS TIME)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as time) AS `CAST(my_year AS TIME)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 58 OR select_id IS NULL) order by id;
@@ -3582,8 +3464,8 @@ NULL NULL 1
13:00:00 13:00:00 4
10:00:00 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as time) AS `CAST(my_time AS TIME)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as time) AS `CAST(my_time AS TIME)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 57 OR select_id IS NULL) order by id;
@@ -3608,8 +3490,8 @@ CAST(my_timestamp AS TIME) my_timestamp id
23:59:59 2004-02-29 23:59:59 4
10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as time) AS `CAST(my_timestamp AS TIME)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as time) AS `CAST(my_timestamp AS TIME)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 56 OR select_id IS NULL) order by id;
@@ -3634,8 +3516,8 @@ NULL NULL 1
00:00:00 2004-02-29 4
00:00:00 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as time) AS `CAST(my_date AS TIME)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as time) AS `CAST(my_date AS TIME)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 55 OR select_id IS NULL) order by id;
@@ -3660,8 +3542,8 @@ NULL NULL 1
23:59:59 2004-02-29 23:59:59 4
10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as time) AS `CAST(my_datetime AS TIME)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as time) AS `CAST(my_datetime AS TIME)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 54 OR select_id IS NULL) order by id;
@@ -3690,8 +3572,8 @@ Warnings:
Warning 1292 Truncated incorrect time value: '-1.7976931348623e+308'
Warning 1292 Truncated incorrect time value: '1.7976931348623e+308'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as time) AS `CAST(my_double AS TIME)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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 time) AS `CAST(my_double AS TIME)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 53 OR select_id IS NULL) order by id;
@@ -3724,8 +3606,8 @@ Warnings:
Warning 1292 Truncated incorrect time value: '-9223372036854775808'
Warning 1292 Truncated incorrect time value: '9223372036854775807'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as time) AS `CAST(my_bigint AS TIME)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as time) AS `CAST(my_bigint AS TIME)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 52 OR select_id IS NULL) order by id;
@@ -3759,8 +3641,8 @@ Warning 1292 Truncated incorrect time value: ''
Warning 1292 Truncated incorrect time value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
Warning 1292 Truncated incorrect time value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as time) AS `CAST(my_varbinary_1000 AS TIME)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 time) AS `CAST(my_varbinary_1000 AS TIME)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 51 OR select_id IS NULL) order by id;
@@ -3797,8 +3679,8 @@ Warning 1292 Truncated incorrect time value: ' ---äÖüß@µ*$-- '
Warning 1292 Truncated incorrect time value: '-1'
Warning 1292 Truncated incorrect time value: '1 17:58'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as time) AS `CAST(my_binary_30 AS TIME)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 time) AS `CAST(my_binary_30 AS TIME)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 50 OR select_id IS NULL) order by id;
@@ -3835,8 +3717,8 @@ Warning 1292 Truncated incorrect time value: ''
Warning 1292 Truncated incorrect time value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
Warning 1292 Truncated incorrect time value: ' ---äÖüß@µ*$-- '
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as time) AS `CAST(my_varchar_1000 AS TIME)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 time) AS `CAST(my_varchar_1000 AS TIME)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 49 OR select_id IS NULL) order by id;
@@ -3871,8 +3753,8 @@ Warning 1292 Truncated incorrect time value: ''
Warning 1292 Truncated incorrect time value: '<--------30 characters------->'
Warning 1292 Truncated incorrect time value: ' ---äÖüß@µ*$--'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as time) AS `CAST(my_char_30 AS TIME)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 time) AS `CAST(my_char_30 AS TIME)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 48 OR select_id IS NULL) order by id;
@@ -3907,8 +3789,8 @@ Warning 1292 Incorrect datetime value: '2155'
Warning 1292 Incorrect datetime value: '2000'
Warning 1292 Incorrect datetime value: '2005'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as datetime) AS `CAST(my_year AS DATETIME)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as datetime) AS `CAST(my_year AS DATETIME)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 47 OR select_id IS NULL) order by id;
@@ -3941,8 +3823,8 @@ Warnings:
Warning 1292 Incorrect datetime value: '0000-00-00 838:59:59'
Warning 1292 Incorrect datetime value: '0000-00-00 838:59:59'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as datetime) AS `CAST(my_time AS DATETIME)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as datetime) AS `CAST(my_time AS DATETIME)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 46 OR select_id IS NULL) order by id;
@@ -3970,8 +3852,8 @@ CAST(my_timestamp AS DATETIME) my_timestamp id
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as datetime) AS `CAST(my_timestamp AS DATETIME)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as datetime) AS `CAST(my_timestamp AS DATETIME)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 45 OR select_id IS NULL) order by id;
@@ -3996,8 +3878,8 @@ NULL NULL 1
2004-02-29 00:00:00 2004-02-29 4
2005-06-28 00:00:00 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as datetime) AS `CAST(my_date AS DATETIME)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as datetime) AS `CAST(my_date AS DATETIME)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 44 OR select_id IS NULL) order by id;
@@ -4022,8 +3904,8 @@ NULL NULL 1
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as datetime) AS `CAST(my_datetime AS DATETIME)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as datetime) AS `CAST(my_datetime AS DATETIME)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 43 OR select_id IS NULL) order by id;
@@ -4055,8 +3937,8 @@ Warning 1292 Incorrect datetime value: '0'
Warning 1292 Incorrect datetime value: '-1'
Warning 1292 Incorrect datetime value: '200506271758'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as datetime) AS `CAST(my_double AS DATETIME)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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 datetime) AS `CAST(my_double AS DATETIME)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 42 OR select_id IS NULL) order by id;
@@ -4095,8 +3977,8 @@ Warning 1292 Incorrect datetime value: '0'
Warning 1292 Incorrect datetime value: '-1'
Warning 1292 Incorrect datetime value: '200506271758'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as datetime) AS `CAST(my_bigint AS DATETIME)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as datetime) AS `CAST(my_bigint AS DATETIME)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 41 OR select_id IS NULL) order by id;
@@ -4134,8 +4016,8 @@ Warning 1292 Incorrect datetime value: '<---------1000 characters---------------
Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as datetime) AS `CAST(my_varbinary_1000 AS DATETIME)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 datetime) AS `CAST(my_varbinary_1000 AS DATETIME)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 40 OR select_id IS NULL) order by id;
@@ -4173,8 +4055,8 @@ Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
Warning 1292 Incorrect datetime value: '-1'
Warning 1292 Truncated incorrect datetime value: '2005-06-27 17:58'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as datetime) AS `CAST(my_binary_30 AS DATETIME)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 datetime) AS `CAST(my_binary_30 AS DATETIME)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 39 OR select_id IS NULL) order by id;
@@ -4212,8 +4094,8 @@ Warning 1292 Incorrect datetime value: '<---------1000 characters---------------
Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as datetime) AS `CAST(my_varchar_1000 AS DATETIME)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 datetime) AS `CAST(my_varchar_1000 AS DATETIME)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 38 OR select_id IS NULL) order by id;
@@ -4250,8 +4132,8 @@ Warning 1292 Incorrect datetime value: '<--------30 characters------->'
Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$--'
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as datetime) AS `CAST(my_char_30 AS DATETIME)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 datetime) AS `CAST(my_char_30 AS DATETIME)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 37 OR select_id IS NULL) order by id;
@@ -4287,8 +4169,8 @@ Warning 1292 Incorrect datetime value: '2155'
Warning 1292 Incorrect datetime value: '2000'
Warning 1292 Incorrect datetime value: '2005'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as date) AS `CAST(my_year AS DATE)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as date) AS `CAST(my_year AS DATE)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 36 OR select_id IS NULL) order by id;
@@ -4318,8 +4200,8 @@ NULL NULL 1
0000-00-00 13:00:00 4
0000-00-00 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as date) AS `CAST(my_time AS DATE)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as date) AS `CAST(my_time AS DATE)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 35 OR select_id IS NULL) order by id;
@@ -4344,8 +4226,8 @@ CAST(my_timestamp AS DATE) my_timestamp id
2004-02-29 2004-02-29 23:59:59 4
2005-06-28 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as date) AS `CAST(my_timestamp AS DATE)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as date) AS `CAST(my_timestamp AS DATE)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 34 OR select_id IS NULL) order by id;
@@ -4370,8 +4252,8 @@ NULL NULL 1
2004-02-29 2004-02-29 4
2005-06-28 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as date) AS `CAST(my_date AS DATE)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as date) AS `CAST(my_date AS DATE)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 33 OR select_id IS NULL) order by id;
@@ -4396,8 +4278,8 @@ NULL NULL 1
2004-02-29 2004-02-29 23:59:59 4
2005-06-28 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as date) AS `CAST(my_datetime AS DATE)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as date) AS `CAST(my_datetime AS DATE)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 32 OR select_id IS NULL) order by id;
@@ -4428,8 +4310,8 @@ Warning 1292 Incorrect datetime value: '1.7976931348623e+308'
Warning 1292 Incorrect datetime value: '0'
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as date) AS `CAST(my_double AS DATE)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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 date) AS `CAST(my_double AS DATE)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 31 OR select_id IS NULL) order by id;
@@ -4466,8 +4348,8 @@ Warning 1292 Incorrect datetime value: '9223372036854775807'
Warning 1292 Incorrect datetime value: '0'
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as date) AS `CAST(my_bigint AS DATE)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as date) AS `CAST(my_bigint AS DATE)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 30 OR select_id IS NULL) order by id;
@@ -4504,8 +4386,8 @@ Warning 1292 Incorrect datetime value: '<---------1000 characters---------------
Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as date) AS `CAST(my_varbinary_1000 AS DATE)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 date) AS `CAST(my_varbinary_1000 AS DATE)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 29 OR select_id IS NULL) order by id;
@@ -4543,8 +4425,8 @@ Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
Warning 1292 Incorrect datetime value: '-1'
Warning 1292 Truncated incorrect date value: '2005-06-27'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as date) AS `CAST(my_binary_30 AS DATE)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 date) AS `CAST(my_binary_30 AS DATE)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 28 OR select_id IS NULL) order by id;
@@ -4582,8 +4464,8 @@ Warning 1292 Incorrect datetime value: '<---------1000 characters---------------
Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as date) AS `CAST(my_varchar_1000 AS DATE)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 date) AS `CAST(my_varchar_1000 AS DATE)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 27 OR select_id IS NULL) order by id;
@@ -4620,8 +4502,8 @@ Warning 1292 Incorrect datetime value: '<--------30 characters------->'
Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$--'
Warning 1292 Incorrect datetime value: '-1'
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as date) AS `CAST(my_char_30 AS DATE)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 date) AS `CAST(my_char_30 AS DATE)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 26 OR select_id IS NULL) order by id;
@@ -4652,8 +4534,8 @@ NULL NULL 1
2000 2000 4
2005 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as char charset latin1) AS `CAST(my_year AS CHAR)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as char charset latin1) AS `CAST(my_year AS CHAR)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 25 OR select_id IS NULL) order by id;
@@ -4678,8 +4560,8 @@ NULL NULL 1
13:00:00 13:00:00 4
10:00:00 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as char charset latin1) AS `CAST(my_time AS CHAR)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as char charset latin1) AS `CAST(my_time AS CHAR)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 24 OR select_id IS NULL) order by id;
@@ -4704,8 +4586,8 @@ CAST(my_timestamp AS CHAR) my_timestamp id
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as char charset latin1) AS `CAST(my_timestamp AS CHAR)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as char charset latin1) AS `CAST(my_timestamp AS CHAR)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 23 OR select_id IS NULL) order by id;
@@ -4730,8 +4612,8 @@ NULL NULL 1
2004-02-29 2004-02-29 4
2005-06-28 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as char charset latin1) AS `CAST(my_date AS CHAR)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as char charset latin1) AS `CAST(my_date AS CHAR)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 22 OR select_id IS NULL) order by id;
@@ -4756,8 +4638,8 @@ NULL NULL 1
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as char charset latin1) AS `CAST(my_datetime AS CHAR)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as char charset latin1) AS `CAST(my_datetime AS CHAR)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 21 OR select_id IS NULL) order by id;
@@ -4782,8 +4664,8 @@ NULL NULL 1
0 0 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as char charset latin1) AS `CAST(my_double AS CHAR)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset latin1) AS `CAST(my_double AS CHAR)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 20 OR select_id IS NULL) order by id;
@@ -4808,8 +4690,8 @@ NULL NULL 1
0.000000000000000000000000000000 0.000000000000000000000000000000 4
-1.000000000000000000000000000000 -1.000000000000000000000000000000 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as char charset latin1) AS `CAST(my_decimal AS CHAR)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset latin1) AS `CAST(my_decimal AS CHAR)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 19 OR select_id IS NULL) order by id;
@@ -4834,8 +4716,8 @@ NULL NULL 1
0 0 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as char charset latin1) AS `CAST(my_bigint AS CHAR)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as char charset latin1) AS `CAST(my_bigint AS CHAR)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 18 OR select_id IS NULL) order by id;
@@ -4860,8 +4742,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as char charset latin1) AS `CAST(my_varbinary_1000 AS CHAR)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset latin1) AS `CAST(my_varbinary_1000 AS CHAR)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 17 OR select_id IS NULL) order by id;
@@ -4886,8 +4768,8 @@ NULL NULL 1
---äÖüß@µ*$--
-1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as char charset latin1) AS `CAST(my_binary_30 AS CHAR)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset latin1) AS `CAST(my_binary_30 AS CHAR)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 16 OR select_id IS NULL) order by id;
@@ -4912,8 +4794,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as char charset latin1) AS `CAST(my_varchar_1000 AS CHAR)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset latin1) AS `CAST(my_varchar_1000 AS CHAR)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 15 OR select_id IS NULL) order by id;
@@ -4938,8 +4820,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as char charset latin1) AS `CAST(my_char_30 AS CHAR)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset latin1) AS `CAST(my_char_30 AS CHAR)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 14 OR select_id IS NULL) order by id;
@@ -4964,8 +4846,8 @@ NULL NULL 1
2000 2000 4
2005 2005 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as char charset binary) AS `CAST(my_year AS BINARY)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values`
+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_year` as char charset binary) AS `CAST(my_year AS BINARY)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 13 OR select_id IS NULL) order by id;
@@ -4990,8 +4872,8 @@ NULL NULL 1
13:00:00 13:00:00 4
10:00:00 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as char charset binary) AS `CAST(my_time AS BINARY)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values`
+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_time` as char charset binary) AS `CAST(my_time AS BINARY)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 12 OR select_id IS NULL) order by id;
@@ -5016,8 +4898,8 @@ CAST(my_timestamp AS BINARY) my_timestamp id
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_timestamp` as char charset binary) AS `CAST(my_timestamp AS BINARY)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values`
+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_timestamp` as char charset binary) AS `CAST(my_timestamp AS BINARY)`,`t1_values`.`my_timestamp` AS `my_timestamp`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 11 OR select_id IS NULL) order by id;
@@ -5042,8 +4924,8 @@ NULL NULL 1
2004-02-29 2004-02-29 4
2005-06-28 2005-06-28 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_date` as char charset binary) AS `CAST(my_date AS BINARY)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values`
+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_date` as char charset binary) AS `CAST(my_date AS BINARY)`,`t1_values`.`my_date` AS `my_date`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 10 OR select_id IS NULL) order by id;
@@ -5068,8 +4950,8 @@ NULL NULL 1
2004-02-29 23:59:59 2004-02-29 23:59:59 4
2005-06-28 10:00:00 2005-06-28 10:00:00 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_datetime` as char charset binary) AS `CAST(my_datetime AS BINARY)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values`
+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_datetime` as char charset binary) AS `CAST(my_datetime AS BINARY)`,`t1_values`.`my_datetime` AS `my_datetime`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 9 OR select_id IS NULL) order by id;
@@ -5094,8 +4976,8 @@ NULL NULL 1
0 0 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as char charset binary) AS `CAST(my_double AS BINARY)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset binary) AS `CAST(my_double AS BINARY)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 8 OR select_id IS NULL) order by id;
@@ -5120,8 +5002,8 @@ NULL NULL 1
0.000000000000000000000000000000 0.000000000000000000000000000000 4
-1.000000000000000000000000000000 -1.000000000000000000000000000000 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as char charset binary) AS `CAST(my_decimal AS BINARY)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset binary) AS `CAST(my_decimal AS BINARY)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 7 OR select_id IS NULL) order by id;
@@ -5146,8 +5028,8 @@ NULL NULL 1
0 0 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_bigint` as char charset binary) AS `CAST(my_bigint AS BINARY)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+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_bigint` as char charset binary) AS `CAST(my_bigint AS BINARY)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 6 OR select_id IS NULL) order by id;
@@ -5172,8 +5054,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as char charset binary) AS `CAST(my_varbinary_1000 AS BINARY)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset binary) AS `CAST(my_varbinary_1000 AS BINARY)`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 5 OR select_id IS NULL) order by id;
@@ -5198,8 +5080,8 @@ NULL NULL 1
---äÖüß@µ*$--
-1
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as char charset binary) AS `CAST(my_binary_30 AS BINARY)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset binary) AS `CAST(my_binary_30 AS BINARY)`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 4 OR select_id IS NULL) order by id;
@@ -5224,8 +5106,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as char charset binary) AS `CAST(my_varchar_1000 AS BINARY)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset binary) AS `CAST(my_varchar_1000 AS BINARY)`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 3 OR select_id IS NULL) order by id;
@@ -5250,8 +5132,8 @@ NULL NULL 1
---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-1 -1 5
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as char charset binary) AS `CAST(my_char_30 AS BINARY)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values`
+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 char charset binary) AS `CAST(my_char_30 AS BINARY)`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 2 OR select_id IS NULL) order by id;
@@ -5276,8 +5158,8 @@ NULL -1 5
2 4 6
NULL -25 7
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sqrt(`t1_values`.`my_bigint`) AS `sqrt(my_bigint)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sqrt(`t1_values`.`my_bigint`) AS `sqrt(my_bigint)`,`t1_values`.`my_bigint` AS `my_bigint`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = 1 OR select_id IS NULL) order by id;
diff --git a/mysql-test/suite/funcs_1/r/ndb_storedproc_06.result b/mysql-test/suite/funcs_1/r/ndb_storedproc_06.result
index 62aa5432e98..7fced87fc3d 100644
--- a/mysql-test/suite/funcs_1/r/ndb_storedproc_06.result
+++ b/mysql-test/suite/funcs_1/r/ndb_storedproc_06.result
@@ -81,6 +81,7 @@ BEGIN
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
END//
ERROR 42000: Access denied for user 'user_1'@'localhost' to database 'db_storedproc_1'
+USE db_storedproc_1;
root@localhost db_storedproc_1
GRANT CREATE ROUTINE ON db_storedproc_1.* TO 'user_1'@'localhost';
@@ -92,6 +93,7 @@ CREATE PROCEDURE sp1(v1 char(20))
BEGIN
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
END//
+USE db_storedproc_1;
root@localhost db_storedproc_1
DROP USER 'user_1'@'localhost';
@@ -117,6 +119,7 @@ CREATE FUNCTION fn1(v1 int) returns int
BEGIN
return v1;
END//
+USE db_storedproc_1;
root@localhost db_storedproc_1
drop user 'user_1'@'localhost';
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 653baa95ab4..bf2299c2f30 100644
--- a/mysql-test/suite/funcs_1/r/ndb_storedproc_07.result
+++ b/mysql-test/suite/funcs_1/r/ndb_storedproc_07.result
@@ -90,7 +90,7 @@ INSERT INTO result VALUES (@cur_val_sql_mode, 'value not restored');
END if;
END//
SHOW CREATE PROCEDURE sp1;
-Procedure sql_mode Create Procedure
+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`()
BEGIN
declare a tinyint;
@@ -104,7 +104,7 @@ INSERT INTO result VALUES (@cur_val_sql_mode, 'value restored');
ELSE
INSERT INTO result VALUES (@cur_val_sql_mode, 'value not restored');
END if;
-END
+END latin1 latin1_swedish_ci latin1_swedish_ci
set @@sql_mode='';
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
@@ -143,12 +143,12 @@ SET @@sql_mode='MAXDB';
SHOW VARIABLES LIKE 'sql_mode';
END//
SHOW CREATE PROCEDURE sp2;
-Procedure sql_mode Create Procedure
+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`()
BEGIN
SET @@sql_mode='MAXDB';
SHOW VARIABLES LIKE 'sql_mode';
-END
+END latin1 latin1_swedish_ci latin1_swedish_ci
... show value prior calling procedure
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
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 69830831843..2c7dcee6a09 100644
--- a/mysql-test/suite/funcs_1/r/ndb_storedproc_08.result
+++ b/mysql-test/suite/funcs_1/r/ndb_storedproc_08.result
@@ -122,6 +122,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -146,6 +149,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT created with INVOKER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -168,6 +174,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -190,6 +199,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT created with INVOKER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode
@@ -199,6 +211,9 @@ set @x=i1;
set @y=@x;
return i4;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE FUNCTION fn_2;
Function fn_2
sql_mode
@@ -210,6 +225,9 @@ set @x=i1;
set @y=@x;
return i4;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_1;
Procedure sp_1
sql_mode
@@ -217,6 +235,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_1`(i1 int)
BEGIN
set @x=i1;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_2;
Procedure sp_2
sql_mode
@@ -226,6 +247,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
BEGIN
set @x=i1;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW FUNCTION STATUS LIKE 'fn_%';
Db db_storedproc
Name fn_1
@@ -235,6 +259,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
Db db_storedproc
Name fn_2
Type FUNCTION
@@ -243,6 +270,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment created with INVOKER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW PROCEDURE STATUS LIKE 'sp_%';
Db db_storedproc
Name sp_1
@@ -252,6 +282,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
Db db_storedproc
Name sp_2
Type PROCEDURE
@@ -260,6 +293,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment created with INVOKER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
... now change some stuff:
--------------------------
@@ -304,6 +340,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT new comment, FN changed to INVOKER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -328,6 +367,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT FN changed to DEFINER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -350,6 +392,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT new comment, SP changed to INVOKER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -372,6 +417,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT SP changed to DEFINER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode
@@ -384,6 +432,9 @@ set @x=i1;
set @y=@x;
return i4;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE FUNCTION fn_2;
Function fn_2
sql_mode
@@ -395,6 +446,9 @@ set @x=i1;
set @y=@x;
return i4;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_1;
Procedure sp_1
sql_mode
@@ -404,6 +458,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_1`(i1 int)
BEGIN
set @x=i1;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_2;
Procedure sp_2
sql_mode
@@ -413,6 +470,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
BEGIN
set @x=i1;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW FUNCTION STATUS LIKE 'fn_%';
Db db_storedproc
Name fn_1
@@ -422,6 +482,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment new comment, FN changed to INVOKER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
Db db_storedproc
Name fn_2
Type FUNCTION
@@ -430,6 +493,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment FN changed to DEFINER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW PROCEDURE STATUS LIKE 'sp_%';
Db db_storedproc
Name sp_1
@@ -439,6 +505,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment new comment, SP changed to INVOKER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
Db db_storedproc
Name sp_2
Type PROCEDURE
@@ -447,6 +516,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment SP changed to DEFINER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
... change back to default and check result:
--------------------------------------------
@@ -479,6 +551,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT new comment, FN changed to INVOKER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -503,6 +578,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT FN changed to DEFINER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -525,6 +603,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT new comment, SP changed to INVOKER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@@ -547,6 +628,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT SP changed to DEFINER
DEFINER root@localhost
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode
@@ -559,6 +643,9 @@ set @x=i1;
set @y=@x;
return i4;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE FUNCTION fn_2;
Function fn_2
sql_mode
@@ -569,6 +656,9 @@ set @x=i1;
set @y=@x;
return i4;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_1;
Procedure sp_1
sql_mode
@@ -578,6 +668,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_1`(i1 int)
BEGIN
set @x=i1;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_2;
Procedure sp_2
sql_mode
@@ -587,6 +680,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
BEGIN
set @x=i1;
END
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW FUNCTION STATUS LIKE 'fn_%';
Db db_storedproc
Name fn_1
@@ -596,6 +692,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment new comment, FN changed to INVOKER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
Db db_storedproc
Name fn_2
Type FUNCTION
@@ -604,6 +703,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment FN changed to DEFINER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
SHOW PROCEDURE STATUS LIKE 'sp_%';
Db db_storedproc
Name sp_1
@@ -613,6 +715,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment new comment, SP changed to INVOKER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
Db db_storedproc
Name sp_2
Type PROCEDURE
@@ -621,6 +726,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment SP changed to DEFINER
+character_set_client latin1
+collation_connection latin1_swedish_ci
+Database Collation latin1_swedish_ci
... cleanup
-----------
diff --git a/mysql-test/suite/funcs_1/r/ndb_storedproc_10.result b/mysql-test/suite/funcs_1/r/ndb_storedproc_10.result
index 4c1f226401f..ffedbec83fe 100644
--- a/mysql-test/suite/funcs_1/r/ndb_storedproc_10.result
+++ b/mysql-test/suite/funcs_1/r/ndb_storedproc_10.result
@@ -58,7 +58,6 @@ load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11;
Section 3.1.10 - CALL checks:
--------------------------------------------------------------------------------
-USE db_storedproc;
Testcase 3.1.10.2 + 3.1.10.5:
-----------------------------
@@ -95,6 +94,7 @@ CALL sp31102();
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102'
SELECT fn31105( 9 );
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105'
+USE db_storedproc;
root@localhost db_storedproc
CALL sp31102();
@@ -114,6 +114,7 @@ a` a` 1000-01-01 -5000 a` -5000
SELECT fn31105( 9 );
fn31105( 9 )
81
+USE db_storedproc;
root@localhost db_storedproc
REVOKE EXECUTE ON db_storedproc.* FROM 'user_2'@'localhost';
@@ -131,6 +132,7 @@ CALL sp31102();
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102'
SELECT fn31105( 9 );
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105'
+USE db_storedproc;
root@localhost db_storedproc
DROP PROCEDURE sp31102;
diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_0102.result b/mysql-test/suite/funcs_1/r/ndb_trig_0102.result
index 0157151e8be..33deedd4b37 100644
--- a/mysql-test/suite/funcs_1/r/ndb_trig_0102.result
+++ b/mysql-test/suite/funcs_1/r/ndb_trig_0102.result
@@ -65,7 +65,7 @@ Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
-Error 1466 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
+Error 1475 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/ndb_tb3.txt' into table tb3 ;
Testcase: 3.5.1.1:
@@ -243,7 +243,7 @@ create table t1 (f1 integer) engine = ndb;
use test;
CREATE TRIGGER trig_db.trg6_2 AFTER INSERT on tb3
for each row set @ret_trg6_2 = 5;
-ERROR HY000: Trigger in wrong schema
+ERROR 42S02: Table 'trig_db.tb3' doesn't exist
use trig_db;
CREATE TRIGGER trg6_3 AFTER INSERT on test.tb3
for each row set @ret_trg6_3 = 18;
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 f046b5a0bc4..35d1e341e8d 100644
--- a/mysql-test/suite/funcs_1/r/ndb_trig_03.result
+++ b/mysql-test/suite/funcs_1/r/ndb_trig_03.result
@@ -65,7 +65,7 @@ Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
-Error 1466 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
+Error 1475 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/ndb_tb3.txt' into table tb3 ;
Testcase 3.5.3:
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 ef24e298dad..505d2ed9f07 100644
--- a/mysql-test/suite/funcs_1/r/ndb_trig_03e.result
+++ b/mysql-test/suite/funcs_1/r/ndb_trig_03e.result
@@ -263,7 +263,7 @@ select current_user;
current_user
root@localhost
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
grant select, insert, update on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
@@ -296,7 +296,7 @@ select current_user;
current_user
root@localhost
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
show tables;
Tables_in_priv_db
t1
@@ -317,7 +317,7 @@ select current_user;
current_user
test_yesprivs@localhost
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 1_2-yes';
select current_user;
@@ -453,9 +453,9 @@ ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for tabl
create trigger trg1_4 before UPDATE on t1 for each row
set new.f1 = 'trig 1_4-yes';
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
-trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL test_yesprivs@localhost
-trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL test_yesprivs@localhost
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
select current_user;
current_user
test_noprivs@localhost
@@ -570,11 +570,11 @@ current_user
test_yesprivs@localhost
use priv_db;
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
-trg1_1 INSERT t1 set new.f1 = 'trig 1_1-yes' BEFORE NULL test_yesprivs@localhost
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+trg1_1 INSERT t1 set new.f1 = 'trig 1_1-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
select * from information_schema.triggers;
-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
-NULL priv_db trg1_1 INSERT NULL priv_db t1 0 NULL set new.f1 = 'trig 1_1-yes' ROW BEFORE NULL NULL OLD NEW NULL test_yesprivs@localhost
+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 priv_db trg1_1 INSERT NULL priv_db t1 0 NULL set new.f1 = 'trig 1_1-yes' ROW BEFORE NULL NULL OLD NEW NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
drop trigger trg1_1;
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
select current_user;
@@ -863,7 +863,7 @@ select current_user;
current_user
root@localhost
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
grant TRIGGER on priv1_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
@@ -878,7 +878,7 @@ select current_user;
current_user
test_yesprivs@localhost
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 1_2-yes';
create trigger trg2_1 before INSERT on t2 for each row
@@ -990,7 +990,7 @@ select current_user;
current_user
root@localhost
show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
grant select, insert, update ,trigger
on priv_db.t1 to test_yesprivs@localhost
with grant option;
diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_0407.result b/mysql-test/suite/funcs_1/r/ndb_trig_0407.result
index de9170048b3..e0c64f7598b 100644
--- a/mysql-test/suite/funcs_1/r/ndb_trig_0407.result
+++ b/mysql-test/suite/funcs_1/r/ndb_trig_0407.result
@@ -65,7 +65,7 @@ Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
-Error 1466 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
+Error 1475 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/ndb_tb3.txt' into table tb3 ;
Testcase: 3.5:
diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_08.result b/mysql-test/suite/funcs_1/r/ndb_trig_08.result
index a60caec0144..5b542a1a4c8 100644
--- a/mysql-test/suite/funcs_1/r/ndb_trig_08.result
+++ b/mysql-test/suite/funcs_1/r/ndb_trig_08.result
@@ -65,7 +65,7 @@ Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
-Error 1466 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
+Error 1475 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/ndb_tb3.txt' into table tb3 ;
Testcase: 3.5:
@@ -493,9 +493,8 @@ BEGIN
WHILE @counter1 < new.f136
SET @counter1 = @counter1 + 1;
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 'WHILE @counter1 < new.f136
-SET @counter1 = @counter1 + 1;
-END' at line 3
+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 'SET @counter1 = @counter1 + 1;
+END' at line 4
delete from tb3 where f122='Test 3.5.8.5-while';
drop trigger trg7;
diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_09.result b/mysql-test/suite/funcs_1/r/ndb_trig_09.result
index 3c5a9526752..6cb05a1d3ff 100644
--- a/mysql-test/suite/funcs_1/r/ndb_trig_09.result
+++ b/mysql-test/suite/funcs_1/r/ndb_trig_09.result
@@ -65,7 +65,7 @@ Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
-Error 1466 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
+Error 1475 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/ndb_tb3.txt' into table tb3 ;
Testcase 3.5.9.1/2:
diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_1011ext.result b/mysql-test/suite/funcs_1/r/ndb_trig_1011ext.result
index b6853469d4f..3d9db02a375 100644
--- a/mysql-test/suite/funcs_1/r/ndb_trig_1011ext.result
+++ b/mysql-test/suite/funcs_1/r/ndb_trig_1011ext.result
@@ -65,7 +65,7 @@ Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
-Error 1466 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
+Error 1475 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/ndb_tb3.txt' into table tb3 ;
Testcase 3.5.10.1/2/3:
diff --git a/mysql-test/suite/funcs_1/r/ndb_views.result b/mysql-test/suite/funcs_1/r/ndb_views.result
index a8dba47ac6e..73efd3309f9 100644
--- a/mysql-test/suite/funcs_1/r/ndb_views.result
+++ b/mysql-test/suite/funcs_1/r/ndb_views.result
@@ -53,7 +53,7 @@ f106 year(3) not null default 2000,
f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
-) engine = innodb;
+) engine = ndb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/ndb_tb2.txt' into table tb2 ;
DROP DATABASE IF EXISTS test1;
CREATE DATABASE test1;
@@ -111,7 +111,7 @@ f106 year(3) not null default 2000,
f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
-) engine = innodb;
+) engine = ndb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/ndb_tb2.txt' into table tb2 ;
USE test;
@@ -184,47 +184,47 @@ Insert into t1 values (500,9866);
Drop view if exists v1 ;
CREATE VIEW v1 AS select f59,f60,f61
FROM test.tb2 where f59=250;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f60,f61 limit 0,10;
f59 f60 f61
250 87895654 NULL
Drop view if exists v1 ;
CREATE VIEW v1 AS select f59,f60,f61
FROM test.tb2 limit 100;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59,f60,f61 limit 0,10;
f59 f60 f61
1 1 0000000001
2 2 0000000002
3 3 0000000003
4 4 0000000004
+4 74 NULL
5 5 0000000005
6 6 0000000006
7 7 0000000007
8 8 0000000008
9 9 0000000009
-10 10 0000000010
CREATE or REPLACE VIEW v1 AS select f59,f60,f61
FROM test.tb2 limit 4,3;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59,f60,f61 limit 0,10;
f59 f60 f61
-5 5 0000000005
-6 6 0000000006
-7 7 0000000007
+10 10 0000000010
+19 18 0000000014
+24 51654 NULL
CREATE or REPLACE VIEW v1 AS select distinct f59
FROM test.tb2 limit 4,3;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
-5
-6
-7
+15
+107
+209
ALTER VIEW v1 AS select f59
FROM test.tb2 limit 6,2;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
-7
-8
+10
+34
CREATE or REPLACE VIEW v1 AS select f59
from tb2 order by f59 limit 100;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
1
2
@@ -266,7 +266,7 @@ f59
660
CREATE or REPLACE VIEW v1 AS select f59
from tb2 group by f59 limit 100;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
1
2
@@ -280,7 +280,7 @@ f59
10
CREATE or REPLACE VIEW v1 AS select f59
from tb2 group by f59 asc limit 100;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
1
2
@@ -294,21 +294,21 @@ f59
10
CREATE or REPLACE VIEW v1 AS select f59
from tb2 group by f59 desc limit 100;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
-569300
-76710
-9112
-7876
-3410
-3330
-2760
-2550
-987
-660
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
CREATE or REPLACE VIEW v1 AS (select f59 from tb2)
union (select f59 from t1) limit 100;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
1
2
@@ -322,7 +322,7 @@ f59
10
CREATE or REPLACE VIEW v1 AS (select f59 FROM tb2)
UNION DISTINCT(select f59 FROM t1) ;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
1
2
@@ -336,103 +336,103 @@ f59
10
CREATE or REPLACE VIEW v1 AS (select f59 FROM tb2)
UNION ALL(select f59 FROM t1) ;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59 limit 0,10;
f59
1
2
3
4
+4
5
6
7
8
9
-10
CREATE or REPLACE VIEW v1 AS select *
FROM test.tb2 WITH LOCAL CHECK OPTION ;
-select * FROM v1 limit 0,50;
+select * FROM v1 order by f59,f60,f61,f62,f63,f64 limit 0,50;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
1 1 0000000001 0000000000000000000000000000000000000000000000000000000000000001 0000000001 0000000000000000000000000000000000000000000000000000000000000001 -5 0.000000000000000000000000000000 1 0.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549435e-38 1.17549e-38 1.175494352e-38 01.17549e-38 00000001.175494352e-38 01.17549e-38 00000001.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 1970-01-02 00:00:01 1902 1902 1902 2enum 2set
2 2 0000000002 0000000000000000000000000000000000000000000000000000000000000002 0000000002 0000000000000000000000000000000000000000000000000000000000000002 -4 1.100000000000000000000000000000 2 1.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494349e-38 1.17549e-38 1.175494353e-38 01.17549e-38 00000001.175494353e-38 01.17549e-38 00000001.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 1970-01-03 00:00:02 1903 1903 1903 1enum 1set,2set
3 3 0000000003 0000000000000000000000000000000000000000000000000000000000000003 0000000003 0000000000000000000000000000000000000000000000000000000000000003 -3 2.200000000000000000000000000000 3 2.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494348e-38 1.17549e-38 1.175494354e-38 01.17549e-38 00000001.175494354e-38 01.17549e-38 00000001.175494354e-38 1000-01-03 838:59:56 1970-01-04 00:00:03 1970-01-04 00:00:03 1904 1904 1904 2enum 1set
4 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
+4 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
5 5 0000000005 0000000000000000000000000000000000000000000000000000000000000005 0000000005 0000000000000000000000000000000000000000000000000000000000000005 -1 4.400000000000000000000000000000 5 4.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494346e-38 1.17549e-38 1.175494356e-38 01.17549e-38 00000001.175494356e-38 01.17549e-38 00000001.175494356e-38 1000-01-05 838:59:54 1970-01-06 00:00:05 1970-01-06 00:00:05 1906 1906 1906 2enum 1set,2set
6 6 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0 5.500000000000000000000000000000 6 5.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494345e-38 1.17549e-38 1.175494357e-38 01.17549e-38 00000001.175494357e-38 01.17549e-38 00000001.175494357e-38 1000-01-06 838:59:53 1970-01-07 00:00:06 1970-01-07 00:00:06 1907 1907 1907 1enum 1set
7 7 0000000007 0000000000000000000000000000000000000000000000000000000000000007 0000000007 0000000000000000000000000000000000000000000000000000000000000007 1 6.600000000000000000000000000000 7 6.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494344e-38 1.17549e-38 1.175494358e-38 01.17549e-38 00000001.175494358e-38 01.17549e-38 00000001.175494358e-38 1000-01-07 838:59:52 1970-01-08 00:00:07 1970-01-08 00:00:07 1908 1908 1908 2enum 2set
8 8 0000000008 0000000000000000000000000000000000000000000000000000000000000008 0000000008 0000000000000000000000000000000000000000000000000000000000000008 2 7.700000000000000000000000000000 8 7.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494343e-38 1.17549e-38 1.175494359e-38 01.17549e-38 00000001.175494359e-38 01.17549e-38 00000001.175494359e-38 1000-01-08 838:59:51 1970-01-09 00:00:08 1970-01-09 00:00:08 1909 1909 1909 1enum 1set,2set
9 9 0000000009 0000000000000000000000000000000000000000000000000000000000000009 0000000009 0000000000000000000000000000000000000000000000000000000000000009 3 8.800000000000000000000000000000 9 8.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494342e-38 1.17549e-38 1.17549436e-38 01.17549e-38 000000001.17549436e-38 01.17549e-38 000000001.17549436e-38 1000-01-09 838:59:50 1970-01-10 00:00:09 1970-01-10 00:00:09 1910 1910 1910 2enum 1set
10 10 0000000010 0000000000000000000000000000000000000000000000000000000000000010 0000000010 0000000000000000000000000000000000000000000000000000000000000010 4 9.900000000000000000000000000000 10 9.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494341e-38 1.17549e-38 1.175494361e-38 01.17549e-38 00000001.175494361e-38 01.17549e-38 00000001.175494361e-38 1000-01-10 838:59:49 1970-01-11 00:00:10 1970-01-11 00:00:10 1911 1911 1911 1enum 2set
-76710 226546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-2760 985654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-569300 9114376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-660 876546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-250 87895654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-340 9984376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-3410 996546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-2550 775654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-3330 764376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-441 16546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-24 51654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-323 14376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-34 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-4 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
15 87 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+17 15 0000000016 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+19 18 0000000014 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
22 93 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-394 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+24 51654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+27 25 0000000026 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+29 28 0000000024 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+34 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
94 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-195 87 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-292 93 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-987 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-7876 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-321 NULL 0000000765 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-9112 NULL 0000008771 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
107 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+107 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+109 108 0000000104 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
109 108 0000000104 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+195 87 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
207 205 0000000206 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
209 208 0000000204 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-27 25 0000000026 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-29 28 0000000024 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-17 15 0000000016 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-19 18 0000000014 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-107 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-109 108 0000000104 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-299 899 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
242 79 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+250 87895654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+292 93 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+299 899 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+321 NULL 0000000765 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+323 14376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+340 9984376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+394 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
424 89 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+441 16546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+660 876546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+987 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+2550 775654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+2760 985654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+3330 764376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+3410 996546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+7876 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+9112 NULL 0000008771 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+76710 226546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+569300 9114376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
CREATE or REPLACE VIEW v1 AS select *
FROM test.tb2 WITH CASCADED CHECK OPTION ;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f59,f60,f61,f62,f63,f64 limit 0,10;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
1 1 0000000001 0000000000000000000000000000000000000000000000000000000000000001 0000000001 0000000000000000000000000000000000000000000000000000000000000001 -5 0.000000000000000000000000000000 1 0.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549435e-38 1.17549e-38 1.175494352e-38 01.17549e-38 00000001.175494352e-38 01.17549e-38 00000001.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 1970-01-02 00:00:01 1902 1902 1902 2enum 2set
2 2 0000000002 0000000000000000000000000000000000000000000000000000000000000002 0000000002 0000000000000000000000000000000000000000000000000000000000000002 -4 1.100000000000000000000000000000 2 1.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494349e-38 1.17549e-38 1.175494353e-38 01.17549e-38 00000001.175494353e-38 01.17549e-38 00000001.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 1970-01-03 00:00:02 1903 1903 1903 1enum 1set,2set
3 3 0000000003 0000000000000000000000000000000000000000000000000000000000000003 0000000003 0000000000000000000000000000000000000000000000000000000000000003 -3 2.200000000000000000000000000000 3 2.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494348e-38 1.17549e-38 1.175494354e-38 01.17549e-38 00000001.175494354e-38 01.17549e-38 00000001.175494354e-38 1000-01-03 838:59:56 1970-01-04 00:00:03 1970-01-04 00:00:03 1904 1904 1904 2enum 1set
4 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
+4 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
5 5 0000000005 0000000000000000000000000000000000000000000000000000000000000005 0000000005 0000000000000000000000000000000000000000000000000000000000000005 -1 4.400000000000000000000000000000 5 4.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494346e-38 1.17549e-38 1.175494356e-38 01.17549e-38 00000001.175494356e-38 01.17549e-38 00000001.175494356e-38 1000-01-05 838:59:54 1970-01-06 00:00:05 1970-01-06 00:00:05 1906 1906 1906 2enum 1set,2set
6 6 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0 5.500000000000000000000000000000 6 5.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494345e-38 1.17549e-38 1.175494357e-38 01.17549e-38 00000001.175494357e-38 01.17549e-38 00000001.175494357e-38 1000-01-06 838:59:53 1970-01-07 00:00:06 1970-01-07 00:00:06 1907 1907 1907 1enum 1set
7 7 0000000007 0000000000000000000000000000000000000000000000000000000000000007 0000000007 0000000000000000000000000000000000000000000000000000000000000007 1 6.600000000000000000000000000000 7 6.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494344e-38 1.17549e-38 1.175494358e-38 01.17549e-38 00000001.175494358e-38 01.17549e-38 00000001.175494358e-38 1000-01-07 838:59:52 1970-01-08 00:00:07 1970-01-08 00:00:07 1908 1908 1908 2enum 2set
8 8 0000000008 0000000000000000000000000000000000000000000000000000000000000008 0000000008 0000000000000000000000000000000000000000000000000000000000000008 2 7.700000000000000000000000000000 8 7.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494343e-38 1.17549e-38 1.175494359e-38 01.17549e-38 00000001.175494359e-38 01.17549e-38 00000001.175494359e-38 1000-01-08 838:59:51 1970-01-09 00:00:08 1970-01-09 00:00:08 1909 1909 1909 1enum 1set,2set
9 9 0000000009 0000000000000000000000000000000000000000000000000000000000000009 0000000009 0000000000000000000000000000000000000000000000000000000000000009 3 8.800000000000000000000000000000 9 8.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494342e-38 1.17549e-38 1.17549436e-38 01.17549e-38 000000001.17549436e-38 01.17549e-38 000000001.17549436e-38 1000-01-09 838:59:50 1970-01-10 00:00:09 1970-01-10 00:00:09 1910 1910 1910 2enum 1set
-10 10 0000000010 0000000000000000000000000000000000000000000000000000000000000010 0000000010 0000000000000000000000000000000000000000000000000000000000000010 4 9.900000000000000000000000000000 10 9.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494341e-38 1.17549e-38 1.175494361e-38 01.17549e-38 00000001.175494361e-38 01.17549e-38 00000001.175494361e-38 1000-01-10 838:59:49 1970-01-11 00:00:10 1970-01-11 00:00:10 1911 1911 1911 1enum 2set
CREATE OR REPLACE VIEW v1 AS SELECT F59, F60
FROM test.tb2 WITH CASCADED CHECK OPTION;
-SELECT * FROM v1 limit 0,10;
+SELECT * FROM v1 order by f59,f60 limit 0,10;
F59 F60
1 1
2 2
3 3
4 4
+4 74
5 5
6 6
7 7
8 8
9 9
-10 10
CREATE or REPLACE VIEW v1 AS select f59, f60
from test.tb2 where f59=3330 ;
-select * FROM v1 limit 0,10;
+select * FROM v1 order by f60 limit 0,10;
f59 f60
3330 764376
DROP VIEW v1 ;
@@ -863,73 +863,73 @@ CREATE TABLE t1 (f1 BIGINT);
INSERT INTO t1 VALUES(1);
CREATE VIEW test.v1 AS SELECT * FROM t1 limit 2;
SHOW CREATE VIEW test.v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` limit 2
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` limit 2 latin1 latin1_swedish_ci
SELECT * FROM test.v1;
f1
1
CREATE OR REPLACE ALGORITHM = TEMPTABLE VIEW test.v1
AS SELECT * FROM t1 limit 2;
SHOW CREATE VIEW test.v1;
-View Create View
-v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` limit 2
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` limit 2 latin1 latin1_swedish_ci
SELECT * FROM test.v1;
f1
1
-CREATE OR REPLACE VIEW test.v1 AS SELECT * FROM tb2 limit 2;
+CREATE OR REPLACE VIEW test.v1 AS SELECT * FROM tb2 order by f59 limit 2;
SHOW CREATE VIEW test.v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `tb2`.`f59` AS `f59`,`tb2`.`f60` AS `f60`,`tb2`.`f61` AS `f61`,`tb2`.`f62` AS `f62`,`tb2`.`f63` AS `f63`,`tb2`.`f64` AS `f64`,`tb2`.`f65` AS `f65`,`tb2`.`f66` AS `f66`,`tb2`.`f67` AS `f67`,`tb2`.`f68` AS `f68`,`tb2`.`f69` AS `f69`,`tb2`.`f70` AS `f70`,`tb2`.`f71` AS `f71`,`tb2`.`f72` AS `f72`,`tb2`.`f73` AS `f73`,`tb2`.`f74` AS `f74`,`tb2`.`f75` AS `f75`,`tb2`.`f76` AS `f76`,`tb2`.`f77` AS `f77`,`tb2`.`f78` AS `f78`,`tb2`.`f79` AS `f79`,`tb2`.`f80` AS `f80`,`tb2`.`f81` AS `f81`,`tb2`.`f82` AS `f82`,`tb2`.`f83` AS `f83`,`tb2`.`f84` AS `f84`,`tb2`.`f85` AS `f85`,`tb2`.`f86` AS `f86`,`tb2`.`f87` AS `f87`,`tb2`.`f88` AS `f88`,`tb2`.`f89` AS `f89`,`tb2`.`f90` AS `f90`,`tb2`.`f91` AS `f91`,`tb2`.`f92` AS `f92`,`tb2`.`f93` AS `f93`,`tb2`.`f94` AS `f94`,`tb2`.`f95` AS `f95`,`tb2`.`f96` AS `f96`,`tb2`.`f97` AS `f97`,`tb2`.`f98` AS `f98`,`tb2`.`f99` AS `f99`,`tb2`.`f100` AS `f100`,`tb2`.`f101` AS `f101`,`tb2`.`f102` AS `f102`,`tb2`.`f103` AS `f103`,`tb2`.`f104` AS `f104`,`tb2`.`f105` AS `f105`,`tb2`.`f106` AS `f106`,`tb2`.`f107` AS `f107`,`tb2`.`f108` AS `f108`,`tb2`.`f109` AS `f109` from `tb2` limit 2
-SELECT * FROM test.v1 ;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `tb2`.`f59` AS `f59`,`tb2`.`f60` AS `f60`,`tb2`.`f61` AS `f61`,`tb2`.`f62` AS `f62`,`tb2`.`f63` AS `f63`,`tb2`.`f64` AS `f64`,`tb2`.`f65` AS `f65`,`tb2`.`f66` AS `f66`,`tb2`.`f67` AS `f67`,`tb2`.`f68` AS `f68`,`tb2`.`f69` AS `f69`,`tb2`.`f70` AS `f70`,`tb2`.`f71` AS `f71`,`tb2`.`f72` AS `f72`,`tb2`.`f73` AS `f73`,`tb2`.`f74` AS `f74`,`tb2`.`f75` AS `f75`,`tb2`.`f76` AS `f76`,`tb2`.`f77` AS `f77`,`tb2`.`f78` AS `f78`,`tb2`.`f79` AS `f79`,`tb2`.`f80` AS `f80`,`tb2`.`f81` AS `f81`,`tb2`.`f82` AS `f82`,`tb2`.`f83` AS `f83`,`tb2`.`f84` AS `f84`,`tb2`.`f85` AS `f85`,`tb2`.`f86` AS `f86`,`tb2`.`f87` AS `f87`,`tb2`.`f88` AS `f88`,`tb2`.`f89` AS `f89`,`tb2`.`f90` AS `f90`,`tb2`.`f91` AS `f91`,`tb2`.`f92` AS `f92`,`tb2`.`f93` AS `f93`,`tb2`.`f94` AS `f94`,`tb2`.`f95` AS `f95`,`tb2`.`f96` AS `f96`,`tb2`.`f97` AS `f97`,`tb2`.`f98` AS `f98`,`tb2`.`f99` AS `f99`,`tb2`.`f100` AS `f100`,`tb2`.`f101` AS `f101`,`tb2`.`f102` AS `f102`,`tb2`.`f103` AS `f103`,`tb2`.`f104` AS `f104`,`tb2`.`f105` AS `f105`,`tb2`.`f106` AS `f106`,`tb2`.`f107` AS `f107`,`tb2`.`f108` AS `f108`,`tb2`.`f109` AS `f109` from `tb2` order by `tb2`.`f59` limit 2 latin1 latin1_swedish_ci
+SELECT * FROM test.v1 order by f59,f60,f61,f62,f63,f64,f65;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
1 1 0000000001 0000000000000000000000000000000000000000000000000000000000000001 0000000001 0000000000000000000000000000000000000000000000000000000000000001 -5 0.000000000000000000000000000000 1 0.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549435e-38 1.17549e-38 1.175494352e-38 01.17549e-38 00000001.175494352e-38 01.17549e-38 00000001.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 1970-01-02 00:00:01 1902 1902 1902 2enum 2set
2 2 0000000002 0000000000000000000000000000000000000000000000000000000000000002 0000000002 0000000000000000000000000000000000000000000000000000000000000002 -4 1.100000000000000000000000000000 2 1.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494349e-38 1.17549e-38 1.175494353e-38 01.17549e-38 00000001.175494353e-38 01.17549e-38 00000001.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 1970-01-03 00:00:02 1903 1903 1903 1enum 1set,2set
CREATE OR REPLACE VIEW test.v1 AS SELECT F59 FROM tb2 limit 10,100;
SHOW CREATE VIEW test.v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `tb2`.`f59` AS `F59` from `tb2` limit 10,100
-SELECT * FROM test.v1;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `tb2`.`f59` AS `F59` from `tb2` limit 10,100 latin1 latin1_swedish_ci
+SELECT * FROM test.v1 order by F59;
F59
-76710
-2760
-569300
-660
-250
-340
-3410
-2550
-3330
-441
-24
-323
-34
+1
+2
+4
4
+6
+7
+8
+9
15
22
-394
+27
+29
94
-195
-292
-987
-7876
-321
-9112
-500
-500
-500
107
+107
+109
109
+195
207
209
-27
-29
-17
-19
-107
-109
-299
242
+250
+292
+299
+321
+323
+340
+394
424
+441
+500
+500
+987
+2550
+2760
+3330
+3410
+9112
+76710
+569300
Drop table test.t1 ;
Drop view test.v1 ;
@@ -946,8 +946,8 @@ Drop table if exists test.v1 ;
CREATE OR REPLACE view test.v1 as select * from tb2 LIMIT 2;
SELECT * FROM test.v1;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
+340 9984376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
1 1 0000000001 0000000000000000000000000000000000000000000000000000000000000001 0000000001 0000000000000000000000000000000000000000000000000000000000000001 -5 0.000000000000000000000000000000 1 0.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549435e-38 1.17549e-38 1.175494352e-38 01.17549e-38 00000001.175494352e-38 01.17549e-38 00000001.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 1970-01-02 00:00:01 1902 1902 1902 2enum 2set
-2 2 0000000002 0000000000000000000000000000000000000000000000000000000000000002 0000000002 0000000000000000000000000000000000000000000000000000000000000002 -4 1.100000000000000000000000000000 2 1.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494349e-38 1.17549e-38 1.175494353e-38 01.17549e-38 00000001.175494353e-38 01.17549e-38 00000001.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 1970-01-03 00:00:02 1903 1903 1903 1enum 1set,2set
Drop view test.v1 ;
Testcase 3.3.1.16 + 3.3.1.17
@@ -965,38 +965,38 @@ CREATE TABLE t1 (f1 NUMERIC(15,3));
INSERT INTO t1 VALUES(8.8);
CREATE VIEW v1 AS SELECT * FROM t1;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
f1
8.800
CREATE OR REPLACE VIEW v1 AS SELECT f1 FROM t1;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
f1
8.800
CREATE OR REPLACE VIEW v1 AS SELECT f1 As my_column FROM t1;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `my_column` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `my_column` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
my_column
8.800
CREATE OR REPLACE VIEW v1(column1,column2)
AS SELECT f1 As my_column, f1 FROM t1;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `column1`,`t1`.`f1` AS `column2` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `column1`,`t1`.`f1` AS `column2` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
column1 column2
8.800 8.800
CREATE OR REPLACE VIEW test.v1(column1,column2)
AS SELECT f1 As my_column, f1 FROM test.t1;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `column1`,`t1`.`f1` AS `column2` from `t1`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `column1`,`t1`.`f1` AS `column2` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
column1 column2
8.800 8.800
@@ -1081,10 +1081,10 @@ Testcase 3.3.1.21
--------------------------------------------------------------------------------
DROP VIEW IF EXISTS v1;
CREATE VIEW test.v1( F59, F60 ) AS SELECT F59, F60 From tb2 LIMIT 2;
-SELECT * FROM test.v1;
+SELECT * FROM test.v1 order by F59, F60 desc;
F59 F60
1 1
-2 2
+340 9984376
Drop view if exists test.v1 ;
Testcase 3.3.1.22
@@ -1093,8 +1093,8 @@ DROP VIEW IF EXISTS v1;
CREATE VIEW test.v1( product ) AS SELECT f59*f60 From tb2 LIMIT 2;
SELECT * FROM test.v1;
product
-1
-4
+9
+25
CREATE OR REPLACE VIEW test.v1( product ) AS SELECT 1*2;
SELECT * FROM test.v1;
product
@@ -1180,8 +1180,8 @@ DROP VIEW IF EXISTS v1;
Create view test.v1 AS Select * from test.tb2 limit 2 ;
Select * from test.v1;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
+340 9984376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
1 1 0000000001 0000000000000000000000000000000000000000000000000000000000000001 0000000001 0000000000000000000000000000000000000000000000000000000000000001 -5 0.000000000000000000000000000000 1 0.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549435e-38 1.17549e-38 1.175494352e-38 01.17549e-38 00000001.175494352e-38 01.17549e-38 00000001.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 1970-01-02 00:00:01 1902 1902 1902 2enum 2set
-2 2 0000000002 0000000000000000000000000000000000000000000000000000000000000002 0000000002 0000000000000000000000000000000000000000000000000000000000000002 -4 1.100000000000000000000000000000 2 1.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494349e-38 1.17549e-38 1.175494353e-38 01.17549e-38 00000001.175494353e-38 01.17549e-38 00000001.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 1970-01-03 00:00:02 1903 1903 1903 1enum 1set,2set
Drop view test.v1 ;
Testcase 3.3.1.27
@@ -1190,10 +1190,10 @@ DROP VIEW IF EXISTS test.v1;
Drop VIEW IF EXISTS test.v1_1 ;
Create view test.v1 AS Select * from test.tb2 limit 2 ;
Create view test.v1_1 AS Select F59 from test.v1 ;
-Select * from test.v1_1 limit 20 ;
+Select * from test.v1_1 order by F59 limit 20 ;
F59
1
-2
+340
Drop view test.v1 ;
Drop view test.v1_1 ;
@@ -1204,58 +1204,58 @@ create database test2 ;
Create view test2.v2 AS Select * from test.tb2 limit 50,50;
use test2 ;
Create view v1 AS Select * from test.tb2 limit 50 ;
-Select * from v1 ;
+Select * from v1 order by f59,f60,f61,f62,f63,f64,f65;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
1 1 0000000001 0000000000000000000000000000000000000000000000000000000000000001 0000000001 0000000000000000000000000000000000000000000000000000000000000001 -5 0.000000000000000000000000000000 1 0.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549435e-38 1.17549e-38 1.175494352e-38 01.17549e-38 00000001.175494352e-38 01.17549e-38 00000001.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 1970-01-02 00:00:01 1902 1902 1902 2enum 2set
2 2 0000000002 0000000000000000000000000000000000000000000000000000000000000002 0000000002 0000000000000000000000000000000000000000000000000000000000000002 -4 1.100000000000000000000000000000 2 1.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494349e-38 1.17549e-38 1.175494353e-38 01.17549e-38 00000001.175494353e-38 01.17549e-38 00000001.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 1970-01-03 00:00:02 1903 1903 1903 1enum 1set,2set
3 3 0000000003 0000000000000000000000000000000000000000000000000000000000000003 0000000003 0000000000000000000000000000000000000000000000000000000000000003 -3 2.200000000000000000000000000000 3 2.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494348e-38 1.17549e-38 1.175494354e-38 01.17549e-38 00000001.175494354e-38 01.17549e-38 00000001.175494354e-38 1000-01-03 838:59:56 1970-01-04 00:00:03 1970-01-04 00:00:03 1904 1904 1904 2enum 1set
4 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
+4 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
5 5 0000000005 0000000000000000000000000000000000000000000000000000000000000005 0000000005 0000000000000000000000000000000000000000000000000000000000000005 -1 4.400000000000000000000000000000 5 4.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494346e-38 1.17549e-38 1.175494356e-38 01.17549e-38 00000001.175494356e-38 01.17549e-38 00000001.175494356e-38 1000-01-05 838:59:54 1970-01-06 00:00:05 1970-01-06 00:00:05 1906 1906 1906 2enum 1set,2set
6 6 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0 5.500000000000000000000000000000 6 5.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494345e-38 1.17549e-38 1.175494357e-38 01.17549e-38 00000001.175494357e-38 01.17549e-38 00000001.175494357e-38 1000-01-06 838:59:53 1970-01-07 00:00:06 1970-01-07 00:00:06 1907 1907 1907 1enum 1set
7 7 0000000007 0000000000000000000000000000000000000000000000000000000000000007 0000000007 0000000000000000000000000000000000000000000000000000000000000007 1 6.600000000000000000000000000000 7 6.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494344e-38 1.17549e-38 1.175494358e-38 01.17549e-38 00000001.175494358e-38 01.17549e-38 00000001.175494358e-38 1000-01-07 838:59:52 1970-01-08 00:00:07 1970-01-08 00:00:07 1908 1908 1908 2enum 2set
8 8 0000000008 0000000000000000000000000000000000000000000000000000000000000008 0000000008 0000000000000000000000000000000000000000000000000000000000000008 2 7.700000000000000000000000000000 8 7.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494343e-38 1.17549e-38 1.175494359e-38 01.17549e-38 00000001.175494359e-38 01.17549e-38 00000001.175494359e-38 1000-01-08 838:59:51 1970-01-09 00:00:08 1970-01-09 00:00:08 1909 1909 1909 1enum 1set,2set
9 9 0000000009 0000000000000000000000000000000000000000000000000000000000000009 0000000009 0000000000000000000000000000000000000000000000000000000000000009 3 8.800000000000000000000000000000 9 8.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494342e-38 1.17549e-38 1.17549436e-38 01.17549e-38 000000001.17549436e-38 01.17549e-38 000000001.17549436e-38 1000-01-09 838:59:50 1970-01-10 00:00:09 1970-01-10 00:00:09 1910 1910 1910 2enum 1set
10 10 0000000010 0000000000000000000000000000000000000000000000000000000000000010 0000000010 0000000000000000000000000000000000000000000000000000000000000010 4 9.900000000000000000000000000000 10 9.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494341e-38 1.17549e-38 1.175494361e-38 01.17549e-38 00000001.175494361e-38 01.17549e-38 00000001.175494361e-38 1000-01-10 838:59:49 1970-01-11 00:00:10 1970-01-11 00:00:10 1911 1911 1911 1enum 2set
-76710 226546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-2760 985654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-569300 9114376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-660 876546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-250 87895654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-340 9984376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-3410 996546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-2550 775654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-3330 764376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-441 16546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-24 51654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-323 14376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-34 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-4 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
15 87 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+17 15 0000000016 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+19 18 0000000014 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
22 93 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-394 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+24 51654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+27 25 0000000026 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+29 28 0000000024 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+34 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
94 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-195 87 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-292 93 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-987 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-7876 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-321 NULL 0000000765 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-9112 NULL 0000008771 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+107 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
107 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
109 108 0000000104 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+109 108 0000000104 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+195 87 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
207 205 0000000206 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
209 208 0000000204 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-27 25 0000000026 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-29 28 0000000024 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-17 15 0000000016 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-19 18 0000000014 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-107 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-109 108 0000000104 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-299 899 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
242 79 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+250 87895654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+292 93 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+299 899 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+321 NULL 0000000765 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+323 14376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+340 9984376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+394 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
424 89 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+441 16546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+500 NULL 0000000900 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+660 876546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+987 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+2550 775654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+2760 985654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+3330 764376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+3410 996546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+7876 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+9112 NULL 0000008771 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+76710 226546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+569300 9114376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
Select * from test2.v2 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
Drop view if exists test2.v1 ;
@@ -1318,18 +1318,18 @@ CREATE VIEW test.v1
AS SELECT test.v1_firstview.f59, test.v1_firstview.f60
FROM test.v1_firstview INNER JOIN test.v1_secondview
ON test.v1_firstview.f59 = test.v1_secondview.f59 ;
-SELECT * FROM test.v1 limit 0,10;
+SELECT * FROM test.v1 order by f59,f60 limit 0,10;
f59 f60
1 1
2 2
3 3
4 4
+4 4
+4 74
4 74
5 5
6 6
7 7
-8 8
-9 9
Drop view if exists test.v1_firstview ;
Drop view if exists test.v1_secondview ;
Drop view if exists test.v1 ;
@@ -1347,18 +1347,18 @@ CREATE VIEW v1
AS SELECT test.v1_firstview.F59, test.v1_firstview.F60
FROM test.v1_firstview INNER JOIN test.v1_secondview
ON test.v1_firstview.f59 = test.v1_secondview.f59 ;
-SELECT * FROM v1 limit 0,10;
+SELECT * FROM v1 order by f59,f60 limit 0,10;
F59 F60
1 1
2 2
3 3
4 4
+4 4
+4 74
4 74
5 5
6 6
7 7
-8 8
-9 9
Drop view v1 ;
Drop view test.v1_firstview ;
Drop view test.v1_secondview ;
@@ -1373,18 +1373,18 @@ CREATE VIEW test.v1
AS SELECT test.v1_firstview.f59, test.v1_firstview.f60
FROM test.v1_firstview INNER JOIN test.tb2
ON test.v1_firstview.f59 = test.tb2.f59;
-SELECT * FROM test.v1 limit 0,10;
+SELECT * FROM test.v1 order by f59,f60 limit 0,10;
f59 f60
1 1
2 2
3 3
4 4
+4 4
+4 74
4 74
5 5
6 6
7 7
-8 8
-9 9
Drop view test.v1 ;
Drop view test.v1_firstview;
@@ -1397,18 +1397,18 @@ CREATE VIEW v1_firstview AS SELECT * FROM test.tb2 ;
CREATE VIEW v1
AS SELECT v1_firstview.f59, v1_firstview.f60
FROM v1_firstview INNER JOIN test.tb2 ON v1_firstview.f59 = test.tb2.f59 ;
-SELECT * FROM v1 limit 0,10;
+SELECT * FROM v1 order by f59,f60 limit 0,10;
f59 f60
1 1
2 2
3 3
4 4
+4 4
+4 74
4 74
5 5
6 6
7 7
-8 8
-9 9
Drop database test2 ;
Testcase 3.3.1.37
@@ -1420,18 +1420,18 @@ Drop view if exists test.v1_1 ;
Drop view if exists test.v1_1 ;
Drop view if exists test.v1_main ;
Create view test.v1 as Select f59, f60 FROM test.tb2;
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59,f60 limit 0,10;
f59 f60
1 1
2 2
3 3
4 4
+4 74
5 5
6 6
7 7
8 8
9 9
-10 10
Create table t1(f59 int, f60 int);
Insert into t1 values (90,507) ;
Create view v1_1 as Select f59,f60 from t1 ;
@@ -1441,18 +1441,18 @@ f59 f60
Create view v1_main
as SELECT test.tb2.f59 FROM test.tb2 JOIN test.v1
ON test.tb2.f59 = test.v1.f59;
-Select * from v1_main limit 0,10;
+Select * from v1_main order by f59 limit 0,10;
f59
1
2
3
4
4
+4
+4
5
6
7
-8
-9
Drop table t1;
Drop view test.v1 ;
Drop view test.v1_1 ;
@@ -1738,28 +1738,28 @@ Drop view if exists test.v1_main;
Drop view if exists test1.v1_1 ;
Drop database if exists test3 ;
Create view test.v1 as Select f59, f60 FROM test.tb2 limit 20 ;
-Select * from test.v1 ;
+Select * from test.v1 order by f59,f60;
f59 f60
-1 1
2 2
3 3
-4 4
5 5
6 6
-7 7
-8 8
9 9
10 10
-76710 226546
-2760 985654
-569300 9114376
+17 15
+19 18
+24 51654
+34 41
+107 105
+323 14376
+441 16546
+500 NULL
+500 NULL
660 876546
-250 87895654
-340 9984376
-3410 996546
2550 775654
3330 764376
-441 16546
+3410 996546
+7876 74
Create table test1.t1 (f59 int,f60 int) ;
Insert into test1.t1 values (199,507) ;
Create view test1.v1_1 as Select f59,f60 from test1.t1 ;
@@ -1792,7 +1792,7 @@ Drop view if exists test.v1 ;
CREATE VIEW test.v1
AS Select f59 from (Select * FROM tb2 limit 20) tx ;
ERROR HY000: View's SELECT contains a subquery in the FROM clause
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by f59 ;
ERROR 42S02: Table 'test.v1' doesn't exist
Drop view if exists test.v1 ;
@@ -1873,7 +1873,7 @@ CREATE VIEW test.v1 AS SELECT * FROM test.tb2 where f59 = 04;
UPDATE test.v1 SET f59 = 30 where F59 = 04 ;
affected rows: 2
info: Rows matched: 2 Changed: 2 Warnings: 0
-SELECT * FROM test.v1 where f59 = 30 ;
+SELECT * FROM test.v1 where f59 = 30 order by f59;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
SELECT * FROM test.tb2 where f59 = 30 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
@@ -1886,7 +1886,7 @@ SELECT * FROM tb2 where f59 = 100 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
100 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
100 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by f59 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
drop view if exists test.v1 ;
Drop TABLE IF EXISTS test.t1 ;
@@ -1962,7 +1962,7 @@ CREATE VIEW test.v1 AS SELECT f59,f60
FROM test.tb2 where f59 = 195 WITH CHECK OPTION ;
UPDATE test.v1 SET f59 = 198 where f59=195 ;
ERROR HY000: CHECK OPTION failed 'test.v1'
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by f59 ;
f59 f60
195 87
drop view if exists test.v1 ;
@@ -1976,7 +1976,7 @@ FROM test.tb2 where F59 = 0987 WITH LOCAL CHECK OPTION ;
CREATE VIEW test.v2 as SELECT * FROM test.v1 ;
UPDATE test.v1 SET F59 = 919 where f59 = 0987 ;
ERROR HY000: CHECK OPTION failed 'test.v1'
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by f59 ;
f59 f60
987 41
UPDATE test.v2 SET F59 = 9879 where f59 = 919 ;
@@ -9671,115 +9671,115 @@ Testcase 3.3.1.50 - 3.3.1.53
--------------------------------------------------------------------------------
DROP VIEW IF EXISTS test.v1;
CREATE VIEW test.v1 AS SELECT * FROM test.tb2 limit 5 ;
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by f59 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
1 1 0000000001 0000000000000000000000000000000000000000000000000000000000000001 0000000001 0000000000000000000000000000000000000000000000000000000000000001 -5 0.000000000000000000000000000000 1 0.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549435e-38 1.17549e-38 1.175494352e-38 01.17549e-38 00000001.175494352e-38 01.17549e-38 00000001.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 1970-01-02 00:00:01 1902 1902 1902 2enum 2set
-2 2 0000000002 0000000000000000000000000000000000000000000000000000000000000002 0000000002 0000000000000000000000000000000000000000000000000000000000000002 -4 1.100000000000000000000000000000 2 1.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494349e-38 1.17549e-38 1.175494353e-38 01.17549e-38 00000001.175494353e-38 01.17549e-38 00000001.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 1970-01-03 00:00:02 1903 1903 1903 1enum 1set,2set
-3 3 0000000003 0000000000000000000000000000000000000000000000000000000000000003 0000000003 0000000000000000000000000000000000000000000000000000000000000003 -3 2.200000000000000000000000000000 3 2.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494348e-38 1.17549e-38 1.175494354e-38 01.17549e-38 00000001.175494354e-38 01.17549e-38 00000001.175494354e-38 1000-01-03 838:59:56 1970-01-04 00:00:03 1970-01-04 00:00:03 1904 1904 1904 2enum 1set
-100 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
-5 5 0000000005 0000000000000000000000000000000000000000000000000000000000000005 0000000005 0000000000000000000000000000000000000000000000000000000000000005 -1 4.400000000000000000000000000000 5 4.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494346e-38 1.17549e-38 1.175494356e-38 01.17549e-38 00000001.175494356e-38 01.17549e-38 00000001.175494356e-38 1000-01-05 838:59:54 1970-01-06 00:00:05 1970-01-06 00:00:05 1906 1906 1906 2enum 1set,2set
+8 8 0000000008 0000000000000000000000000000000000000000000000000000000000000008 0000000008 0000000000000000000000000000000000000000000000000000000000000008 2 7.700000000000000000000000000000 8 7.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494343e-38 1.17549e-38 1.175494359e-38 01.17549e-38 00000001.175494359e-38 01.17549e-38 00000001.175494359e-38 1000-01-08 838:59:51 1970-01-09 00:00:08 1970-01-09 00:00:08 1909 1909 1909 1enum 1set,2set
+15 87 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+340 9984376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+2760 985654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
drop view test.v1 ;
CREATE VIEW test.v1 AS SELECT F59,F61 FROM test.tb2 limit 50 ;
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by F59, F61 ;
F59 F61
1 0000000001
2 0000000002
3 0000000003
-100 0000000004
5 0000000005
6 0000000006
7 0000000007
8 0000000008
9 0000000009
10 0000000010
-76710 NULL
-2760 NULL
-569300 NULL
-660 NULL
-250 NULL
-340 NULL
-3410 NULL
-2550 NULL
-3330 NULL
-441 NULL
-24 NULL
-323 NULL
-34 NULL
-100 NULL
15 NULL
+17 0000000016
+19 0000000014
22 NULL
-394 NULL
+24 NULL
+27 0000000026
+29 0000000024
+34 NULL
94 NULL
-195 NULL
-292 NULL
-987 NULL
-7876 NULL
-321 0000000765
-9112 0000008771
-500 0000000900
-500 0000000900
-500 0000000900
+100 NULL
+100 0000000004
+107 0000000106
107 0000000106
109 0000000104
+109 0000000104
+195 NULL
207 0000000206
209 0000000204
-27 0000000026
-29 0000000024
-17 0000000016
-19 0000000014
-107 0000000106
-109 0000000104
-299 NULL
242 NULL
+250 NULL
+292 NULL
+299 NULL
+321 0000000765
+323 NULL
+340 NULL
+394 NULL
424 NULL
+441 NULL
+500 0000000900
+500 0000000900
+500 0000000900
+660 NULL
+987 NULL
+2550 NULL
+2760 NULL
+3330 NULL
+3410 NULL
+7876 NULL
+9112 0000008771
+76710 NULL
+569300 NULL
drop view test.v1 ;
-CREATE VIEW test.v1 AS SELECT * FROM test.tb2 limit 20 ;
-SELECT * FROM test.v1;
+CREATE VIEW test.v1 AS SELECT * FROM test.tb2 order by f59, f60, f61 limit 20 ;
+SELECT * FROM test.v1 order by f59,f60,f61 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
1 1 0000000001 0000000000000000000000000000000000000000000000000000000000000001 0000000001 0000000000000000000000000000000000000000000000000000000000000001 -5 0.000000000000000000000000000000 1 0.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549435e-38 1.17549e-38 1.175494352e-38 01.17549e-38 00000001.175494352e-38 01.17549e-38 00000001.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 1970-01-02 00:00:01 1902 1902 1902 2enum 2set
2 2 0000000002 0000000000000000000000000000000000000000000000000000000000000002 0000000002 0000000000000000000000000000000000000000000000000000000000000002 -4 1.100000000000000000000000000000 2 1.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494349e-38 1.17549e-38 1.175494353e-38 01.17549e-38 00000001.175494353e-38 01.17549e-38 00000001.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 1970-01-03 00:00:02 1903 1903 1903 1enum 1set,2set
3 3 0000000003 0000000000000000000000000000000000000000000000000000000000000003 0000000003 0000000000000000000000000000000000000000000000000000000000000003 -3 2.200000000000000000000000000000 3 2.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 0000000003 000000000000000000000000000000002.200000000000000000000000000000 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.175494348e-38 1.175494354e-38 00000001.175494354e-38 00000001.175494354e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494348e-38 1.17549e-38 1.175494354e-38 01.17549e-38 00000001.175494354e-38 01.17549e-38 00000001.175494354e-38 1000-01-03 838:59:56 1970-01-04 00:00:03 1970-01-04 00:00:03 1904 1904 1904 2enum 1set
-100 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
5 5 0000000005 0000000000000000000000000000000000000000000000000000000000000005 0000000005 0000000000000000000000000000000000000000000000000000000000000005 -1 4.400000000000000000000000000000 5 4.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 0000000005 000000000000000000000000000000004.400000000000000000000000000000 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.175494346e-38 1.175494356e-38 00000001.175494356e-38 00000001.175494356e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494346e-38 1.17549e-38 1.175494356e-38 01.17549e-38 00000001.175494356e-38 01.17549e-38 00000001.175494356e-38 1000-01-05 838:59:54 1970-01-06 00:00:05 1970-01-06 00:00:05 1906 1906 1906 2enum 1set,2set
6 6 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0000000006 0000000000000000000000000000000000000000000000000000000000000006 0 5.500000000000000000000000000000 6 5.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 0000000006 000000000000000000000000000000005.500000000000000000000000000000 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.175494345e-38 1.175494357e-38 00000001.175494357e-38 00000001.175494357e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494345e-38 1.17549e-38 1.175494357e-38 01.17549e-38 00000001.175494357e-38 01.17549e-38 00000001.175494357e-38 1000-01-06 838:59:53 1970-01-07 00:00:06 1970-01-07 00:00:06 1907 1907 1907 1enum 1set
7 7 0000000007 0000000000000000000000000000000000000000000000000000000000000007 0000000007 0000000000000000000000000000000000000000000000000000000000000007 1 6.600000000000000000000000000000 7 6.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 0000000007 000000000000000000000000000000006.600000000000000000000000000000 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.175494344e-38 1.175494358e-38 00000001.175494358e-38 00000001.175494358e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494344e-38 1.17549e-38 1.175494358e-38 01.17549e-38 00000001.175494358e-38 01.17549e-38 00000001.175494358e-38 1000-01-07 838:59:52 1970-01-08 00:00:07 1970-01-08 00:00:07 1908 1908 1908 2enum 2set
8 8 0000000008 0000000000000000000000000000000000000000000000000000000000000008 0000000008 0000000000000000000000000000000000000000000000000000000000000008 2 7.700000000000000000000000000000 8 7.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 0000000008 000000000000000000000000000000007.700000000000000000000000000000 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.175494343e-38 1.175494359e-38 00000001.175494359e-38 00000001.175494359e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494343e-38 1.17549e-38 1.175494359e-38 01.17549e-38 00000001.175494359e-38 01.17549e-38 00000001.175494359e-38 1000-01-08 838:59:51 1970-01-09 00:00:08 1970-01-09 00:00:08 1909 1909 1909 1enum 1set,2set
9 9 0000000009 0000000000000000000000000000000000000000000000000000000000000009 0000000009 0000000000000000000000000000000000000000000000000000000000000009 3 8.800000000000000000000000000000 9 8.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 0000000009 000000000000000000000000000000008.800000000000000000000000000000 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.175494342e-38 1.17549436e-38 000000001.17549436e-38 000000001.17549436e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494342e-38 1.17549e-38 1.17549436e-38 01.17549e-38 000000001.17549436e-38 01.17549e-38 000000001.17549436e-38 1000-01-09 838:59:50 1970-01-10 00:00:09 1970-01-10 00:00:09 1910 1910 1910 2enum 1set
10 10 0000000010 0000000000000000000000000000000000000000000000000000000000000010 0000000010 0000000000000000000000000000000000000000000000000000000000000010 4 9.900000000000000000000000000000 10 9.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 0000000010 000000000000000000000000000000009.900000000000000000000000000000 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.175494341e-38 1.175494361e-38 00000001.175494361e-38 00000001.175494361e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494341e-38 1.17549e-38 1.175494361e-38 01.17549e-38 00000001.175494361e-38 01.17549e-38 00000001.175494361e-38 1000-01-10 838:59:49 1970-01-11 00:00:10 1970-01-11 00:00:10 1911 1911 1911 1enum 2set
-76710 226546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-2760 985654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-569300 9114376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-660 876546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-250 87895654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-340 9984376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-3410 996546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-2550 775654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-3330 764376 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-441 16546 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+15 87 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+17 15 0000000016 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+19 18 0000000014 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+22 93 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+24 51654 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+27 25 0000000026 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+29 28 0000000024 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+34 41 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+94 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
+100 4 0000000004 0000000000000000000000000000000000000000000000000000000000000004 0000000004 0000000000000000000000000000000000000000000000000000000000000004 -2 3.300000000000000000000000000000 4 3.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 0000000004 000000000000000000000000000000003.300000000000000000000000000000 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.175494347e-38 1.175494355e-38 00000001.175494355e-38 00000001.175494355e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494347e-38 1.17549e-38 1.175494355e-38 01.17549e-38 00000001.175494355e-38 01.17549e-38 00000001.175494355e-38 1000-01-04 838:59:55 1970-01-05 00:00:04 1970-01-05 00:00:04 1905 1905 1905 1enum 2set
+100 74 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
drop view test.v1 ;
CREATE VIEW test.v1 AS SELECT F59,f61 FROM test.tb2 limit 20 ;
-SELECT * FROM test.v1 limit 50;
+SELECT * FROM test.v1 order by f59,f61 desc limit 50;
F59 f61
-1 0000000001
2 0000000002
3 0000000003
-100 0000000004
5 0000000005
6 0000000006
-7 0000000007
-8 0000000008
9 0000000009
10 0000000010
-76710 NULL
-2760 NULL
-569300 NULL
+17 0000000016
+19 0000000014
+24 NULL
+34 NULL
+107 0000000106
+323 NULL
+441 NULL
+500 0000000900
+500 0000000900
660 NULL
-250 NULL
-340 NULL
-3410 NULL
2550 NULL
3330 NULL
-441 NULL
+3410 NULL
+7876 NULL
drop view test.v1 ;
Testcase 3.3.1.54
@@ -9798,7 +9798,7 @@ Insert into t2 values (2,2000) ;
Insert into t2 values (31,97) ;
Create view test.v1 as select t1.f59, t1.f60
from t1,t2 where t1.f59=t2.f59 ;
-Select * from test.v1 limit 50 ;
+Select * from test.v1 order by f59 limit 50 ;
f59 f60
1 10
2 20
@@ -9864,7 +9864,7 @@ create or replace view test.v1 as
Select t1.f59 t1_f59, t2.f59 t2_f59, t1.f60 t1_f60, t2.f60 t2_f60,
t1.f61 t1_f61, t2.f61 t2_f61
from t1 inner join t2 where t1.f59 = t2.f59 ;
-select * from test.v1;
+select * from test.v1 order by t1_f59 ;
t1_f59 t2_f59 t1_f60 t2_f60 t1_f61 t2_f61
2 2 double double 6 6
3 3 single-f3 single-f3 4 6
@@ -9877,7 +9877,7 @@ t1_f59 t2_f59 t1_f60 t2_f60 t1_f61 t2_f61
Create or replace view test.v1 as
Select t1.f59 AS t1_f59, t2.f59 AS t2_f59
FROM t2 cross join t1;
-Select * from v1;
+Select * from v1 order by t1_f59,t2_f59;
t1_f59 t2_f59
1 2
1 3
@@ -9903,7 +9903,7 @@ t1_f59 t2_f59
Create or replace view test.v1 as
Select straight_join t1.f59 AS t1_f59, t2.f59 AS t2_f59
FROM t2,t1;
-Select * from v1;
+Select * from v1 order by t1_f59,t2_f59;
t1_f59 t2_f59
1 2
1 3
@@ -9929,7 +9929,7 @@ t1_f59 t2_f59
Create or replace view test.v1 as
Select f59, f60, f61, a, b
FROM t2 natural join t1;
-Select * from v1;
+Select * from v1 order by f59;
f59 f60 f61 a b
2 double 6 2 2
Select f59, f60, f61, a, b
@@ -9940,11 +9940,11 @@ Create or replace view test.v1 as
Select t1.f59 t1_f59, t2.f59 t2_f59, t1.f60 t1_f60, t2.f60 t2_f60,
t1.f61 t1_f61, t2.f61 t2_f61
FROM t2 left outer join t1 on t2.f59=t1.f59;
-Select * from v1;
+Select * from v1 order by t1_f59;
t1_f59 t2_f59 t1_f60 t2_f60 t1_f61 t2_f61
+NULL 4 NULL single NULL 4
2 2 double double 6 6
3 3 single-f3 single-f3 4 6
-NULL 4 NULL single NULL 4
Select t1.f59 t1_f59, t2.f59 t2_f59, t1.f60 t1_f60, t2.f60 t2_f60,
t1.f61 t1_f61, t2.f61 t2_f61
FROM t2 left outer join t1 on t2.f59=t1.f59;
@@ -9955,7 +9955,7 @@ NULL 4 NULL single NULL 4
Create or replace view test.v1 as
Select f59, f60, f61, t1.a, t2.b
FROM t2 natural left outer join t1;
-Select * from v1;
+Select * from v1 order by f59;
f59 f60 f61 a b
2 double 6 2 2
3 single-f3 6 NULL 3
@@ -9970,7 +9970,7 @@ Create or replace view test.v1 as
Select t1.f59 t1_f59, t2.f59 t2_f59, t1.f60 t1_f60, t2.f60 t2_f60,
t1.f61 t1_f61, t2.f61 t2_f61
FROM t2 right outer join t1 on t2.f59=t1.f59;
-Select * from v1;
+Select * from v1 order by t1_f59;
t1_f59 t2_f59 t1_f60 t2_f60 t1_f61 t2_f61
1 NULL single NULL 3 NULL
2 2 double double 6 6
@@ -9985,11 +9985,11 @@ t1_f59 t2_f59 t1_f60 t2_f60 t1_f61 t2_f61
Create or replace view test.v1 as
Select f59, f60, a, b
FROM t2 natural right outer join t1;
-Select * from v1;
+Select * from v1 order by f59 desc;
f59 f60 a b
-1 single 1 NULL
-2 double 2 2
3 single-f3 3 NULL
+2 double 2 2
+1 single 1 NULL
Select f59, f60, a, b
FROM t2 natural right outer join t1;
f59 f60 a b
@@ -10010,18 +10010,18 @@ Insert into t1 values (107,501,601) ;
Insert into t1 values (901,801,401) ;
Create or replace view test.v1 as
Select tb2.f59 FROM tb2 LEFT JOIN t1 on tb2.f59 = t1.f59 ;
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
f59
1
2
3
-100
5
6
7
8
9
10
+15
Drop view if exists test.v1 ;
Drop table if exists t1 ;
Drop view if exists v1;
@@ -10031,7 +10031,7 @@ Insert into t1 values (207,201,201) ;
Insert into t1 values (201,201,201) ;
Create or replace view test.v1
as Select tb2.f59 FROM tb2 INNER JOIN t1 on tb2.f59 = t1.f59 ;
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
f59
207
Drop view if exists test.v1 ;
@@ -10043,7 +10043,7 @@ Insert into t1 values (27,21,21) ;
Insert into t1 values (21,21,21) ;
Create or replace view test.v1
as Select tb2.f59 FROM tb2 CROSS JOIN t1 on tb2.f59 = t1.f59 ;
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
f59
27
Drop view test.v1 ;
@@ -10058,18 +10058,18 @@ Insert into t1 values (17,51,61) ;
Insert into t1 values (91,81,41) ;
Create or replace view test.v1 as (Select f59 FROM tb2 where f59=17 )
Union ALL (Select f59 from t1 where f59=17 );
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
f59
17
17
Create or replace view test.v1 as (Select f59 FROM tb2 where f59=17 )
Union (Select f59 from t1 where f59=17 );
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
f59
17
Create or replace view test.v1 as (Select f59 FROM tb2 where f59=17 )
Union Distinct (Select f59 from t1 where f60=17 );
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
f59
17
Drop view test.v1 ;
@@ -10081,7 +10081,7 @@ insert into t1 values (107,501,601);
insert into t1 values (901,801,401);
create or replace view test.v1 as
select tb2.f59 from tb2 join t1 on tb2.f59 = t1.f59;
-select * from test.v1 limit 0,10;
+select * from test.v1 order by f59 limit 0,10;
f59
107
107
@@ -10089,7 +10089,7 @@ create or replace view test.v1 as
(select f59 from tb2 where f59=107 )
union all
(select f59 from t1 where f59=107 );
-select * from test.v1 limit 0,10;
+select * from test.v1 order by f59 limit 0,10;
f59
107
107
@@ -10098,14 +10098,14 @@ create or replace view test.v1 as
(select f59 from tb2 where f59=107 )
union
(select f59 from t1 where f59=107 );
-select * from test.v1 limit 0,10;
+select * from test.v1 order by f59 limit 0,10;
f59
107
create or replace view test.v1 as
(select f59 from tb2 where f59=107 )
union distinct
(select f59 from t1 where f59=107 );
-select * from test.v1 limit 0,10;
+select * from test.v1 order by f59 limit 0,10;
f59
107
drop view if exists test.v1 ;
@@ -10116,13 +10116,13 @@ Testcase 3.3.1.64
Drop view if exists test.v1 ;
CREATE VIEW test.v1 AS SELECT F59
FROM test.tb2 where test.tb2.F59 = 109;
-SELECT * FROM test.v1 limit 0,10;
+SELECT * FROM test.v1 order by f59 limit 0,10;
F59
109
109
ALTER VIEW test.v1 AS SELECT *
FROM test.tb2 WHERE test.tb2.f59 = 242 ;
-SELECT * FROM test.v1 limit 0,10;
+SELECT * FROM test.v1 order by f59 limit 0,10;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
242 79 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
Drop view test.v1 ;
@@ -10202,7 +10202,8 @@ SHOW FIELDS FROM v1;
ERROR 42S02: Table 'test.v1' doesn't exist
CHECK TABLE v1;
Table Op Msg_type Msg_text
-test.v1 check error Table 'test.v1' doesn't exist
+test.v1 check Error Table 'test.v1' doesn't exist
+test.v1 check error Corrupt
DESCRIBE v1;
ERROR 42S02: Table 'test.v1' doesn't exist
EXPLAIN SELECT * FROM v1;
@@ -10249,8 +10250,8 @@ CREATE VIEW test3.v30 AS SELECT * FROM test3.v29;
CREATE VIEW test3.v31 AS SELECT * FROM test3.v30;
CREATE VIEW test3.v32 AS SELECT * FROM test3.v31;
SHOW CREATE VIEW test3.v32;
-View Create View
-v32 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test3`.`v32` AS select `v31`.`f1` AS `f1` from `test3`.`v31`
+View Create View character_set_client collation_connection
+v32 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test3`.`v32` AS select `v31`.`f1` AS `f1` from `test3`.`v31` latin1 latin1_swedish_ci
SELECT * FROM test3.v32;
f1
1.000
@@ -10259,8 +10260,8 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 1
DROP VIEW test3.v0;
SHOW CREATE VIEW test3.v32;
-View Create View
-v32 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test3`.`v32` AS select `v31`.`f1` AS `f1` from `test3`.`v31`
+View Create View character_set_client collation_connection
+v32 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test3`.`v32` AS select `v31`.`f1` AS `f1` from `test3`.`v31` latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'test3.v32' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
SELECT * FROM test3.v32;
@@ -10268,15 +10269,13 @@ ERROR HY000: View 'test3.v32' references invalid table(s) or column(s) or functi
EXPLAIN SELECT * FROM test3.v32;
ERROR HY000: View 'test3.v32' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
-FIXME - Setting join_limit to 30 - hangs for higher values
+FIXME - Setting join_limit to 28 - hangs for higher values
----------------------------------------------------------
-SET @join_limit = 30;
+SET @join_limit = 28;
SET @max_level = @join_limit - 1;
DROP DATABASE IF EXISTS test3;
DROP TABLE IF EXISTS test1.t1;
DROP TABLE IF EXISTS test2.t1;
-DROP VIEW IF EXISTS test1.v29;
-DROP VIEW IF EXISTS test1.v28;
DROP VIEW IF EXISTS test1.v27;
DROP VIEW IF EXISTS test1.v26;
DROP VIEW IF EXISTS test1.v25;
@@ -10383,15 +10382,11 @@ CREATE OR REPLACE VIEW test1.v26 AS SELECT f1, f2
FROM test3.t1 tab1 NATURAL JOIN test1.v25 tab2;
CREATE OR REPLACE VIEW test1.v27 AS SELECT f1, f2
FROM test1.t1 tab1 NATURAL JOIN test1.v26 tab2;
-CREATE OR REPLACE VIEW test1.v28 AS SELECT f1, f2
-FROM test2.t1 tab1 NATURAL JOIN test1.v27 tab2;
-CREATE OR REPLACE VIEW test1.v29 AS SELECT f1, f2
-FROM test3.t1 tab1 NATURAL JOIN test1.v28 tab2;
-SHOW CREATE VIEW test1.v29;
-View Create View
-v29 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v29` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v28` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`))))
+SHOW CREATE VIEW test1.v27;
+View Create View character_set_client collation_connection
+v27 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v27` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test1`.`t1` `tab1` join `test1`.`v26` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`)))) latin1 latin1_swedish_ci
SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v29;
+CAST(f2 AS CHAR) AS f2 FROM test1.v27;
f1 f2
5 five
@@ -10400,14 +10395,14 @@ differs on some platforms
FIXME Is this a bug ?
--------------------------------------------------------------------------------
EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v29;
-CREATE VIEW test1.v30 AS SELECT f1, f2
-FROM test3.t1 tab1 NATURAL JOIN test1.v29 tab2;
-SHOW CREATE VIEW test1.v30;
-View Create View
-v30 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v30` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v29` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`))))
+CAST(f2 AS CHAR) AS f2 FROM test1.v27;
+CREATE VIEW test1.v28 AS SELECT f1, f2
+FROM test3.t1 tab1 NATURAL JOIN test1.v27 tab2;
+SHOW CREATE VIEW test1.v28;
+View Create View character_set_client collation_connection
+v28 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v28` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v27` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`)))) latin1 latin1_swedish_ci
SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v30;
+CAST(f2 AS CHAR) AS f2 FROM test1.v28;
ERROR HY000: Got temporary error 4006 'Connect failure - out of connection objects (increase MaxNoOfConcurrentTransactions)' from NDBCLUSTER
The output of following EXPLAIN is deactivated, because the result
@@ -10415,33 +10410,31 @@ differs on some platforms
FIXME Is this a bug ?
--------------------------------------------------------------------------------
EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v30;
-DROP VIEW IF EXISTS test1.v30;
+CAST(f2 AS CHAR) AS f2 FROM test1.v28;
+DROP VIEW IF EXISTS test1.v28;
CREATE OR REPLACE VIEW test1.v0 AS
SELECT f1 as f2, f2 as f1 FROM test2.t1;
CREATE OR REPLACE VIEW test2.v0 AS
SELECT CAST('0001-01-01' AS DATE) as f1, f2 FROM test3.t1;
-SHOW CREATE VIEW test1.v29;
+SHOW CREATE VIEW test1.v27;
SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v29;
+CAST(f2 AS CHAR) AS f2 FROM test1.v27;
EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v29;
+CAST(f2 AS CHAR) AS f2 FROM test1.v27;
CREATE OR REPLACE VIEW test3.v0 AS
SELECT f1 , CONVERT('ßÄäÖöÜü§' USING UCS2) as f2 FROM test1.t1;
-SHOW CREATE VIEW test1.v29;
+SHOW CREATE VIEW test1.v27;
SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v29;
+CAST(f2 AS CHAR) AS f2 FROM test1.v27;
EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v29;
+CAST(f2 AS CHAR) AS f2 FROM test1.v27;
CREATE OR REPLACE VIEW test3.v0 AS
SELECT CONVERT('ßÄäÖöÜü§' USING UCS2) as f1, f2 FROM test1.t1;
-SHOW CREATE VIEW test1.v29;
+SHOW CREATE VIEW test1.v27;
SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v29;
+CAST(f2 AS CHAR) AS f2 FROM test1.v27;
EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-CAST(f2 AS CHAR) AS f2 FROM test1.v29;
-DROP VIEW IF EXISTS test1.v29;
-DROP VIEW IF EXISTS test1.v28;
+CAST(f2 AS CHAR) AS f2 FROM test1.v27;
DROP VIEW IF EXISTS test1.v27;
DROP VIEW IF EXISTS test1.v26;
DROP VIEW IF EXISTS test1.v25;
@@ -10512,7 +10505,7 @@ info: Rows matched: 1 Changed: 1 Warnings: 0
SELECT * FROM tb2 where f59 = 8 and f60 = 105;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
8 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-SELECT f59,f60 FROM test.v1 where f59 = 8 and f60 = 105;
+SELECT f59,f60 FROM test.v1 where f59 = 8 and f60 = 105 ;
f59 f60
8 105
Drop view test.v1 ;
@@ -10531,7 +10524,7 @@ f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78
891 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
891 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
891 105 0000000106 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 7.7 7.7 00000000000000000007.7 00000000000000000008.8 8.8 8.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 0000000008.8 0000000008.8 0000000008.8 8.8 8.8 8.8 8.8 0000000008.8 00000000000000000008.8 0000000008.8 00000000000000000008.8 2000-01-01 00:00:20 0002-02-02 00:00:00 2000-12-31 23:59:59 2000 2000 2000 1enum 1set
-SELECT f59,f60 FROM test.v1 where f59 = 891 and f60 = 105;
+SELECT f59,f60 FROM test.v1 where f59 = 891 and f60 = 105 ;
f59 f60
891 105
891 105
@@ -10548,7 +10541,7 @@ DELETE FROM test.v1 where f59 = 789 ;
affected rows: 1
SELECT * FROM tb2 where f59 = 789 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
-SELECT f59,f60 FROM test.v1 where f59 = 789;
+SELECT f59,f60 FROM test.v1 where f59 = 789 order by f60 ;
f59 f60
Drop view test.v1 ;
@@ -10561,7 +10554,7 @@ DELETE FROM test.v1 where f59 = 711 ;
affected rows: 1
SELECT * FROM tb2 where f59 = 711 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
-SELECT f59,f60 FROM test.v1 where f59 = 711;
+SELECT f59,f60 FROM test.v1 where f59 = 711 order by f60 ;
f59 f60
Drop view test.v1 ;
diff --git a/mysql-test/suite/funcs_1/storedproc/storedproc_02.inc b/mysql-test/suite/funcs_1/storedproc/storedproc_02.inc
index 2efc5a83663..2efc5a83663 100644..100755
--- a/mysql-test/suite/funcs_1/storedproc/storedproc_02.inc
+++ b/mysql-test/suite/funcs_1/storedproc/storedproc_02.inc
diff --git a/mysql-test/suite/funcs_1/storedproc/storedproc_03.inc b/mysql-test/suite/funcs_1/storedproc/storedproc_03.inc
index 9ffa7d7f66c..9ffa7d7f66c 100644..100755
--- a/mysql-test/suite/funcs_1/storedproc/storedproc_03.inc
+++ b/mysql-test/suite/funcs_1/storedproc/storedproc_03.inc
diff --git a/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc b/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc
index e2b9e846b97..02b8690f687 100644..100755
--- a/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc
+++ b/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc
@@ -18,9 +18,9 @@
let $message= Section 3.1.6 - Privilege Checks:;
--source include/show_msg80.inc
-USE db_storedproc_1;
connection default;
+USE db_storedproc_1;
--source suite/funcs_1/include/show_connection.inc
# ------------------------------------------------------------------------------
@@ -58,6 +58,7 @@ disconnect user1a;
# add privilege again and check
connection default;
+USE db_storedproc_1;
--source suite/funcs_1/include/show_connection.inc
GRANT CREATE ROUTINE ON db_storedproc_1.* TO 'user_1'@'localhost';
@@ -77,6 +78,7 @@ disconnect user1b;
# cleanup
connection default;
+USE db_storedproc_1;
--source suite/funcs_1/include/show_connection.inc
DROP USER 'user_1'@'localhost';
@@ -132,6 +134,7 @@ disconnect user2;
# cleanup
connection default;
+USE db_storedproc_1;
--source suite/funcs_1/include/show_connection.inc
drop user 'user_1'@'localhost';
diff --git a/mysql-test/suite/funcs_1/storedproc/storedproc_07.inc b/mysql-test/suite/funcs_1/storedproc/storedproc_07.inc
index 74ef7f4fbed..74ef7f4fbed 100644..100755
--- a/mysql-test/suite/funcs_1/storedproc/storedproc_07.inc
+++ b/mysql-test/suite/funcs_1/storedproc/storedproc_07.inc
diff --git a/mysql-test/suite/funcs_1/storedproc/storedproc_08.inc b/mysql-test/suite/funcs_1/storedproc/storedproc_08.inc
index 9a693c5b96f..9a693c5b96f 100644..100755
--- a/mysql-test/suite/funcs_1/storedproc/storedproc_08.inc
+++ b/mysql-test/suite/funcs_1/storedproc/storedproc_08.inc
diff --git a/mysql-test/suite/funcs_1/storedproc/storedproc_08_show.inc b/mysql-test/suite/funcs_1/storedproc/storedproc_08_show.inc
index 962d9242675..962d9242675 100644..100755
--- a/mysql-test/suite/funcs_1/storedproc/storedproc_08_show.inc
+++ b/mysql-test/suite/funcs_1/storedproc/storedproc_08_show.inc
diff --git a/mysql-test/suite/funcs_1/storedproc/storedproc_10.inc b/mysql-test/suite/funcs_1/storedproc/storedproc_10.inc
index e69a95a724e..2c2e99dc8f4 100644..100755
--- a/mysql-test/suite/funcs_1/storedproc/storedproc_10.inc
+++ b/mysql-test/suite/funcs_1/storedproc/storedproc_10.inc
@@ -21,7 +21,6 @@ let $message= Section 3.1.10 - CALL checks:;
--source include/show_msg80.inc
-USE db_storedproc;
# ------------------------------------------------------------------------------
let $message= Testcase 3.1.10.2 + 3.1.10.5:;
@@ -80,6 +79,7 @@ SELECT fn31105( 9 );
# now 'add' EXECUTE to INVOKER
connection default;
+USE db_storedproc;
--source suite/funcs_1/include/show_connection.inc
# root can execute ...
CALL sp31102();
@@ -98,6 +98,7 @@ disconnect user2_3;
# now 'remove' SELECT from INVOKER
connection default;
+USE db_storedproc;
--source suite/funcs_1/include/show_connection.inc
REVOKE EXECUTE ON db_storedproc.* FROM 'user_2'@'localhost';
FLUSH PRIVILEGES;
@@ -115,6 +116,7 @@ disconnect user2_4;
# cleanup
connection default;
+USE db_storedproc;
--source suite/funcs_1/include/show_connection.inc
DROP PROCEDURE sp31102;
diff --git a/mysql-test/suite/funcs_1/t/a_processlist_priv_no_prot.test b/mysql-test/suite/funcs_1/t/a_processlist_priv_no_prot.test
new file mode 100644
index 00000000000..757377cdb0c
--- /dev/null
+++ b/mysql-test/suite/funcs_1/t/a_processlist_priv_no_prot.test
@@ -0,0 +1,36 @@
+########## suite/funcs_1/t/a_processlist_priv_no_prot.test #############
+# #
+# Testing of privileges around #
+# SELECT ... PROCESSLIST/SHOW PROCESSLIST #
+# #
+# The prepared statement variant of this test is #
+# suite/funcs_1/t/b_processlist_priv_ps.test. #
+# #
+# There is important documentation within #
+# suite/funcs_1/datadict/processlist_priv.inc #
+# #
+# Note(mleich): #
+# The name "a_process..." with the unusual prefix "a_" is #
+# caused by the fact that this test should run as first test, that #
+# means direct after server startup. Otherwise the connection IDs #
+# within the processlist would differ. #
+# #
+# Creation: #
+# 2007-08-14 mleich Create this test as part of #
+# WL#3982 Test information_schema.processlist #
+# #
+########################################################################
+
+# One subtest is skipped because of
+# Bug#30395 strange results after REVOKE PROCESS ON *.* FROM ...
+let $fixed_bug_30395= 0;
+
+# The file with expected results fits only to a run without
+# ps-protocol/sp-protocol/cursor-protocol/view-protocol.
+if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL
+ + $VIEW_PROTOCOL > 0`)
+{
+ --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
+}
+
+--source suite/funcs_1/datadict/processlist_priv.inc
diff --git a/mysql-test/suite/funcs_1/t/a_processlist_val_no_prot.test b/mysql-test/suite/funcs_1/t/a_processlist_val_no_prot.test
new file mode 100644
index 00000000000..3bf7307fbb1
--- /dev/null
+++ b/mysql-test/suite/funcs_1/t/a_processlist_val_no_prot.test
@@ -0,0 +1,31 @@
+########### suite/funcs_1/t/a_processlist_val_no_prot.test #############
+# #
+# Testing of values within INFORMATION_SCHEMA.PROCESSLIST #
+# #
+# The prepared statement variant of this test is #
+# suite/funcs_1/t/b_processlist_val_ps.test. #
+# #
+# There is important documentation within #
+# suite/funcs_1/datadict/processlist_val.inc #
+# #
+# Note(mleich): #
+# The name "a_process..." with the unusual prefix "a_" is #
+# caused by the fact that this test should run as second test, that #
+# means direct after server startup and a_processlist_priv_no_prot. #
+# Otherwise the connection IDs within the processlist would differ. #
+# #
+# Creation: #
+# 2007-08-09 mleich Implement this test as part of #
+# WL#3982 Test information_schema.processlist #
+# #
+########################################################################
+
+# The file with expected results fits only to a run without
+# ps-protocol/sp-protocol/cursor-protocol/view-protocol.
+if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL
+ + $VIEW_PROTOCOL > 0`)
+{
+ --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
+}
+
+--source suite/funcs_1/datadict/processlist_val.inc
diff --git a/mysql-test/suite/funcs_1/t/b_processlist_priv_ps.test b/mysql-test/suite/funcs_1/t/b_processlist_priv_ps.test
new file mode 100644
index 00000000000..9bba85cbad1
--- /dev/null
+++ b/mysql-test/suite/funcs_1/t/b_processlist_priv_ps.test
@@ -0,0 +1,35 @@
+########### suite/funcs_1/t/b_processlist_priv_ps.test #################
+# #
+# Testing of privileges around #
+# SELECT ... PROCESSLIST/SHOW PROCESSLIST #
+# #
+# The no (ps/sp/view/cursor) protocol variant of this test is #
+# suite/funcs_1/t/a_processlist_priv_no_prot.test. #
+# #
+# There is important documentation within #
+# suite/funcs_1/datadict/processlist_priv.inc #
+# #
+# Note(mleich): #
+# The name "b_process..." with the unusual prefix "b_" is #
+# caused by the fact that this test should run as first test, that #
+# means direct after server startup. Otherwise the connection IDs #
+# within the processlist would differ. #
+# #
+# Creation: #
+# 2007-08-14 mleich Create this test as part of #
+# WL#3982 Test information_schema.processlist #
+# #
+########################################################################
+
+# One subtest is skipped because of
+# Bug#30395 strange results after REVOKE PROCESS ON *.* FROM ...
+let $fixed_bug_30395= 0;
+
+# The file with expected results fits only to a run with "--ps-protocol".
+if (`SELECT $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0
+ OR $PS_PROTOCOL = 0`)
+{
+ --skip Test requires: ps-protocol enabled, other protocols disabled
+}
+
+--source suite/funcs_1/datadict/processlist_priv.inc
diff --git a/mysql-test/suite/funcs_1/t/b_processlist_val_ps.test b/mysql-test/suite/funcs_1/t/b_processlist_val_ps.test
new file mode 100644
index 00000000000..1aa57641a07
--- /dev/null
+++ b/mysql-test/suite/funcs_1/t/b_processlist_val_ps.test
@@ -0,0 +1,30 @@
+############## suite/funcs_1/t/b_processlist_val_ps.test ###############
+# #
+# Testing of values within INFORMATION_SCHEMA.PROCESSLIST #
+# #
+# The no (ps/sp/view/cursor) protocol variant of this test is #
+# suite/funcs_1/t/a_processlist_val_no_prot.test. #
+# #
+# There is important documentation within #
+# suite/funcs_1/datadict/processlist_val.inc #
+# #
+# Note(mleich): #
+# The name "b_process..." with the unusual prefix "b_" is #
+# caused by the fact that this test should run as second test, that #
+# means direct after server startup and b_processlist_priv_ps. #
+# Otherwise the connection IDs within the processlist would differ. #
+# #
+# Creation: #
+# 2007-08-09 mleich Implement this test as part of #
+# WL#3982 Test information_schema.processlist #
+# #
+########################################################################
+
+# The file with expected results fits only to a run with "--ps-protocol".
+if (`SELECT $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0
+ OR $PS_PROTOCOL = 0`)
+{
+ --skip Test requires: ps-protocol enabled, other protocols disabled
+}
+
+--source suite/funcs_1/datadict/processlist_val.inc
diff --git a/mysql-test/suite/funcs_1/t/datadict_help_tables_build.test b/mysql-test/suite/funcs_1/t/datadict_help_tables_build.test
new file mode 100644
index 00000000000..370fcf0375c
--- /dev/null
+++ b/mysql-test/suite/funcs_1/t/datadict_help_tables_build.test
@@ -0,0 +1,73 @@
+###### suite/funcs_1/t/datadict_help_tables_dev.test #####
+#
+# Check the information about the help tables within
+# INFORMATION_SCHEMA.TABLES/INFORMATION_SCHEMA.STATISTICS
+#
+# Variant for use during build tests (non empty help tables)
+#
+# Creation:
+# 2007-08-25 mleich Add this test as compensation for the
+# checks removed within datadict_master.inc.
+#
+
+let $c_help_category= `SELECT COUNT(*) FROM mysql.help_category`;
+let $c_help_keyword= `SELECT COUNT(*) FROM mysql.help_keyword`;
+let $c_help_relation= `SELECT COUNT(*) FROM mysql.help_relation`;
+let $c_help_topic= `SELECT COUNT(*) FROM mysql.help_topic`;
+
+if (`SELECT $c_help_category + $c_help_keyword + $c_help_relation
+ + $c_help_topic = 0`)
+{
+ --skip # Test requires non empty help tables = Build test configuration
+}
+
+# We reach this point when we run on a configuration with at least one
+# non empty help table.
+# 2007-08 MySQL 5.0 row count of the help tables
+# help_category help_keyword help_relation help_topic
+# 36 395 809 466
+# Let's assume for all help tables that their content never dramatic
+# shrinks and do some plausibility checks.
+let $limit_help_category = 30;
+let $limit_help_keyword = 320;
+let $limit_help_relation = 640;
+let $limit_help_topic = 380;
+if (`SELECT $c_help_category < $limit_help_category
+ OR $c_help_keyword < $limit_help_keyword
+ OR $c_help_relation < $limit_help_relation
+ OR $c_help_topic < $limit_help_topic`)
+{
+ --echo # The row count within the help tables is unexepected small.
+ SELECT COUNT(*), 'exepected: >= $limit_help_category' FROM mysql.help_category;
+ SELECT COUNT(*), 'exepected: >= $limit_help_keyword' FROM mysql.help_keyword;
+ SELECT COUNT(*), 'exepected: >= $limit_help_relation' FROM mysql.help_relation;
+ SELECT COUNT(*), 'exepected: >= $limit_help_topic' FROM mysql.help_topic;
+ --echo # Either the current help table content (build problem? or
+ --echo # the expected minimum row count within this script is wrong.
+ --echo # Abort
+ exit;
+}
+
+# Enforce a static number of rows within the help tables.
+let $limit= `SELECT $c_help_category - $limit_help_category`;
+--replace_result $limit <number>
+eval DELETE FROM mysql.help_category LIMIT $limit;
+#
+let $limit= `SELECT $c_help_keyword - $limit_help_keyword`;
+--replace_result $limit <number>
+eval DELETE FROM mysql.help_keyword LIMIT $limit;
+#
+let $limit= `SELECT $c_help_relation - $limit_help_relation`;
+--replace_result $limit <number>
+eval DELETE FROM mysql.help_relation LIMIT $limit;
+#
+let $limit= `SELECT $c_help_topic - $limit_help_topic`;
+--replace_result $limit <number>
+eval DELETE FROM mysql.help_topic LIMIT $limit;
+
+
+--replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
+SELECT * FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_SCHEMA = 'mysql' AND TABLE_NAME LIKE 'help_%';
+SELECT * FROM INFORMATION_SCHEMA.STATISTICS
+WHERE TABLE_SCHEMA = 'mysql' AND TABLE_NAME LIKE 'help_%';
diff --git a/mysql-test/suite/funcs_1/t/datadict_help_tables_dev.test b/mysql-test/suite/funcs_1/t/datadict_help_tables_dev.test
new file mode 100644
index 00000000000..3342fbca4be
--- /dev/null
+++ b/mysql-test/suite/funcs_1/t/datadict_help_tables_dev.test
@@ -0,0 +1,27 @@
+###### suite/funcs_1/t/datadict_help_tables_dev.test #####
+#
+# Check the information about the help tables within
+# INFORMATION_SCHEMA.TABLES/INFORMATION_SCHEMA.STATISTICS
+#
+# Variant for use during development (empty help tables)
+#
+# Creation:
+# 2007-08-25 mleich Add this test as compensation for the
+# checks removed within datadict_master.inc.
+#
+
+let $c_help_category= `SELECT COUNT(*) FROM mysql.help_category`;
+let $c_help_keyword= `SELECT COUNT(*) FROM mysql.help_keyword`;
+let $c_help_relation= `SELECT COUNT(*) FROM mysql.help_relation`;
+let $c_help_topic= `SELECT COUNT(*) FROM mysql.help_topic`;
+if (`SELECT $c_help_category + $c_help_keyword + $c_help_relation
+ + $c_help_topic > 0`)
+{
+ --skip # Test requires empty help tables = Development test configuration
+}
+
+--replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
+SELECT * FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_SCHEMA = 'mysql' AND TABLE_NAME LIKE 'help_%';
+SELECT * FROM INFORMATION_SCHEMA.STATISTICS
+WHERE TABLE_SCHEMA = 'mysql' AND TABLE_NAME LIKE 'help_%';
diff --git a/mysql-test/suite/funcs_1/t/innodb__datadict.test b/mysql-test/suite/funcs_1/t/innodb__datadict.test
index d678d2e6959..587ab1d6588 100644
--- a/mysql-test/suite/funcs_1/t/innodb__datadict.test
+++ b/mysql-test/suite/funcs_1/t/innodb__datadict.test
@@ -3,5 +3,9 @@
--source include/have_innodb.inc
let $engine_type= innodb;
+# $OTHER_ENGINE_TYPE must be
+# - <> $engine_type
+# - all time available like MyISAM or MEMORY
+let $OTHER_ENGINE_TYPE= MEMORY;
--source suite/funcs_1/datadict/datadict_master.inc
diff --git a/mysql-test/suite/funcs_1/t/innodb_storedproc_02.test b/mysql-test/suite/funcs_1/t/innodb_storedproc_02.test
index ace4d0cdc37..ace4d0cdc37 100644..100755
--- a/mysql-test/suite/funcs_1/t/innodb_storedproc_02.test
+++ b/mysql-test/suite/funcs_1/t/innodb_storedproc_02.test
diff --git a/mysql-test/suite/funcs_1/t/innodb_storedproc_03.test b/mysql-test/suite/funcs_1/t/innodb_storedproc_03.test
index 3d1d6134b6f..3d1d6134b6f 100644..100755
--- a/mysql-test/suite/funcs_1/t/innodb_storedproc_03.test
+++ b/mysql-test/suite/funcs_1/t/innodb_storedproc_03.test
diff --git a/mysql-test/suite/funcs_1/t/innodb_storedproc_06.test b/mysql-test/suite/funcs_1/t/innodb_storedproc_06.test
index ce061da2299..ce061da2299 100644..100755
--- a/mysql-test/suite/funcs_1/t/innodb_storedproc_06.test
+++ b/mysql-test/suite/funcs_1/t/innodb_storedproc_06.test
diff --git a/mysql-test/suite/funcs_1/t/innodb_storedproc_07.test b/mysql-test/suite/funcs_1/t/innodb_storedproc_07.test
index dd1396e982e..dd1396e982e 100644..100755
--- a/mysql-test/suite/funcs_1/t/innodb_storedproc_07.test
+++ b/mysql-test/suite/funcs_1/t/innodb_storedproc_07.test
diff --git a/mysql-test/suite/funcs_1/t/innodb_storedproc_08.test b/mysql-test/suite/funcs_1/t/innodb_storedproc_08.test
index c8c289c5f49..c8c289c5f49 100644..100755
--- a/mysql-test/suite/funcs_1/t/innodb_storedproc_08.test
+++ b/mysql-test/suite/funcs_1/t/innodb_storedproc_08.test
diff --git a/mysql-test/suite/funcs_1/t/innodb_storedproc_10.test b/mysql-test/suite/funcs_1/t/innodb_storedproc_10.test
index 88a44a263d7..88a44a263d7 100644..100755
--- a/mysql-test/suite/funcs_1/t/innodb_storedproc_10.test
+++ b/mysql-test/suite/funcs_1/t/innodb_storedproc_10.test
diff --git a/mysql-test/suite/funcs_1/t/memory__datadict.test b/mysql-test/suite/funcs_1/t/memory__datadict.test
index 29980be0115..b78a2511f3c 100644
--- a/mysql-test/suite/funcs_1/t/memory__datadict.test
+++ b/mysql-test/suite/funcs_1/t/memory__datadict.test
@@ -1,5 +1,9 @@
#### suite/funcs_1/t/datadict_memory.test
#
let $engine_type= memory;
+# $OTHER_ENGINE_TYPE must be
+# - <> $engine_type
+# - all time available like MyISAM or MEMORY
+let $OTHER_ENGINE_TYPE= MyISAM;
--source suite/funcs_1/datadict/datadict_master.inc
diff --git a/mysql-test/suite/funcs_1/t/memory_storedproc_02.test b/mysql-test/suite/funcs_1/t/memory_storedproc_02.test
index f92657ee665..f92657ee665 100644..100755
--- a/mysql-test/suite/funcs_1/t/memory_storedproc_02.test
+++ b/mysql-test/suite/funcs_1/t/memory_storedproc_02.test
diff --git a/mysql-test/suite/funcs_1/t/memory_storedproc_03.test b/mysql-test/suite/funcs_1/t/memory_storedproc_03.test
index 8a839b255e1..8a839b255e1 100644..100755
--- a/mysql-test/suite/funcs_1/t/memory_storedproc_03.test
+++ b/mysql-test/suite/funcs_1/t/memory_storedproc_03.test
diff --git a/mysql-test/suite/funcs_1/t/memory_storedproc_06.test b/mysql-test/suite/funcs_1/t/memory_storedproc_06.test
index 059528590b9..059528590b9 100644..100755
--- a/mysql-test/suite/funcs_1/t/memory_storedproc_06.test
+++ b/mysql-test/suite/funcs_1/t/memory_storedproc_06.test
diff --git a/mysql-test/suite/funcs_1/t/memory_storedproc_07.test b/mysql-test/suite/funcs_1/t/memory_storedproc_07.test
index 1d7cee3dbd6..1d7cee3dbd6 100644..100755
--- a/mysql-test/suite/funcs_1/t/memory_storedproc_07.test
+++ b/mysql-test/suite/funcs_1/t/memory_storedproc_07.test
diff --git a/mysql-test/suite/funcs_1/t/memory_storedproc_08.test b/mysql-test/suite/funcs_1/t/memory_storedproc_08.test
index 304be8c477a..304be8c477a 100644..100755
--- a/mysql-test/suite/funcs_1/t/memory_storedproc_08.test
+++ b/mysql-test/suite/funcs_1/t/memory_storedproc_08.test
diff --git a/mysql-test/suite/funcs_1/t/memory_storedproc_10.test b/mysql-test/suite/funcs_1/t/memory_storedproc_10.test
index 13fbe99fabf..13fbe99fabf 100644..100755
--- a/mysql-test/suite/funcs_1/t/memory_storedproc_10.test
+++ b/mysql-test/suite/funcs_1/t/memory_storedproc_10.test
diff --git a/mysql-test/suite/funcs_1/t/myisam__datadict.test b/mysql-test/suite/funcs_1/t/myisam__datadict.test
index 5edaeb94ecd..e4baba1de3a 100644
--- a/mysql-test/suite/funcs_1/t/myisam__datadict.test
+++ b/mysql-test/suite/funcs_1/t/myisam__datadict.test
@@ -1,5 +1,10 @@
#### suite/funcs_1/t/datadict_myisam.test
#
+
let $engine_type= myisam;
+# $OTHER_ENGINE_TYPE must be
+# - <> $engine_type
+# - all time available like MyISAM or MEMORY
+let $OTHER_ENGINE_TYPE= MEMORY;
--source suite/funcs_1/datadict/datadict_master.inc
diff --git a/mysql-test/suite/funcs_1/t/myisam_storedproc_02.test b/mysql-test/suite/funcs_1/t/myisam_storedproc_02.test
index 108b0fe5611..108b0fe5611 100644..100755
--- a/mysql-test/suite/funcs_1/t/myisam_storedproc_02.test
+++ b/mysql-test/suite/funcs_1/t/myisam_storedproc_02.test
diff --git a/mysql-test/suite/funcs_1/t/myisam_storedproc_03.test b/mysql-test/suite/funcs_1/t/myisam_storedproc_03.test
index b181e3ce7ab..b181e3ce7ab 100644..100755
--- a/mysql-test/suite/funcs_1/t/myisam_storedproc_03.test
+++ b/mysql-test/suite/funcs_1/t/myisam_storedproc_03.test
diff --git a/mysql-test/suite/funcs_1/t/myisam_storedproc_06.test b/mysql-test/suite/funcs_1/t/myisam_storedproc_06.test
index 81d3d24a01f..81d3d24a01f 100644..100755
--- a/mysql-test/suite/funcs_1/t/myisam_storedproc_06.test
+++ b/mysql-test/suite/funcs_1/t/myisam_storedproc_06.test
diff --git a/mysql-test/suite/funcs_1/t/myisam_storedproc_07.test b/mysql-test/suite/funcs_1/t/myisam_storedproc_07.test
index a02f2f544ee..a02f2f544ee 100644..100755
--- a/mysql-test/suite/funcs_1/t/myisam_storedproc_07.test
+++ b/mysql-test/suite/funcs_1/t/myisam_storedproc_07.test
diff --git a/mysql-test/suite/funcs_1/t/myisam_storedproc_08.test b/mysql-test/suite/funcs_1/t/myisam_storedproc_08.test
index 24e574fa9e2..24e574fa9e2 100644..100755
--- a/mysql-test/suite/funcs_1/t/myisam_storedproc_08.test
+++ b/mysql-test/suite/funcs_1/t/myisam_storedproc_08.test
diff --git a/mysql-test/suite/funcs_1/t/myisam_storedproc_10.test b/mysql-test/suite/funcs_1/t/myisam_storedproc_10.test
index 6b4f6c21b62..6b4f6c21b62 100644..100755
--- a/mysql-test/suite/funcs_1/t/myisam_storedproc_10.test
+++ b/mysql-test/suite/funcs_1/t/myisam_storedproc_10.test
diff --git a/mysql-test/suite/funcs_1/t/ndb__datadict.test b/mysql-test/suite/funcs_1/t/ndb__datadict.test
index fb16a3cca5c..e5207982bf0 100644
--- a/mysql-test/suite/funcs_1/t/ndb__datadict.test
+++ b/mysql-test/suite/funcs_1/t/ndb__datadict.test
@@ -3,5 +3,9 @@
--source include/have_ndb.inc
let $engine_type= ndb;
+# $OTHER_ENGINE_TYPE must be
+# - <> $engine_type
+# - all time available like MyISAM or MEMORY
+let $OTHER_ENGINE_TYPE= MEMORY;
--source suite/funcs_1/datadict/datadict_master.inc
diff --git a/mysql-test/suite/funcs_1/t/suite.opt b/mysql-test/suite/funcs_1/t/suite.opt
new file mode 100644
index 00000000000..9b22c677b83
--- /dev/null
+++ b/mysql-test/suite/funcs_1/t/suite.opt
@@ -0,0 +1,2 @@
+--secure-file-priv=$MYSQL_TEST_DIR
+
diff --git a/mysql-test/suite/funcs_1/triggers/triggers_0102.inc b/mysql-test/suite/funcs_1/triggers/triggers_0102.inc
index af94041d245..e8919a32ca7 100644
--- a/mysql-test/suite/funcs_1/triggers/triggers_0102.inc
+++ b/mysql-test/suite/funcs_1/triggers/triggers_0102.inc
@@ -273,7 +273,7 @@ let $message= Testcase 3.5.1.8:;
# Can't create a trigger in a different database
use test;
- --error 1435
+ --error 1146
CREATE TRIGGER trig_db.trg6_2 AFTER INSERT on tb3
for each row set @ret_trg6_2 = 5;
diff --git a/mysql-test/suite/funcs_1/views/func_view.inc b/mysql-test/suite/funcs_1/views/func_view.inc
index 3bf9e96b332..d78cfb4488a 100644
--- a/mysql-test/suite/funcs_1/views/func_view.inc
+++ b/mysql-test/suite/funcs_1/views/func_view.inc
@@ -606,7 +606,8 @@ let $col_type= my_year;
# 1.1.6. CAST --> DECIMAL
-let $target_type= DECIMAL;
+# Set the following to (37,2) since the default was changed to (10,0) - OBN
+let $target_type= DECIMAL(37,2);
#
let $col_type= my_char_30;
--source suite/funcs_1/views/fv_cast.inc
diff --git a/mysql-test/suite/funcs_1/views/views_master.inc b/mysql-test/suite/funcs_1/views/views_master.inc
index 0e3371bdb18..cb71fd7f790 100644
--- a/mysql-test/suite/funcs_1/views/views_master.inc
+++ b/mysql-test/suite/funcs_1/views/views_master.inc
@@ -145,33 +145,33 @@ Insert into t1 values (500,9866);
--enable_warnings
CREATE VIEW v1 AS select f59,f60,f61
FROM test.tb2 where f59=250;
- select * FROM v1 limit 0,10;
+ select * FROM v1 order by f60,f61 limit 0,10;
#(02)
Drop view if exists v1 ;
CREATE VIEW v1 AS select f59,f60,f61
FROM test.tb2 limit 100;
- select * FROM v1 limit 0,10;
+ select * FROM v1 order by f59,f60,f61 limit 0,10;
#(03)
CREATE or REPLACE VIEW v1 AS select f59,f60,f61
FROM test.tb2 limit 4,3;
- select * FROM v1 limit 0,10;
+ select * FROM v1 order by f59,f60,f61 limit 0,10;
#(04)
CREATE or REPLACE VIEW v1 AS select distinct f59
FROM test.tb2 limit 4,3;
- select * FROM v1 limit 0,10;
+ select * FROM v1 order by f59 limit 0,10;
#(05)
ALTER VIEW v1 AS select f59
FROM test.tb2 limit 6,2;
- select * FROM v1 limit 0,10;
+ select * FROM v1 order by f59 limit 0,10;
#(06)
CREATE or REPLACE VIEW v1 AS select f59
from tb2 order by f59 limit 100;
- select * FROM v1 limit 0,10;
+ select * FROM v1 order by f59 limit 0,10;
#(07)
CREATE or REPLACE VIEW v1 AS select f59
@@ -186,32 +186,32 @@ Insert into t1 values (500,9866);
#(09)
CREATE or REPLACE VIEW v1 AS select f59
from tb2 group by f59 limit 100;
- select * FROM v1 limit 0,10;
+ select * FROM v1 order by f59 limit 0,10;
#(10)
CREATE or REPLACE VIEW v1 AS select f59
from tb2 group by f59 asc limit 100;
- select * FROM v1 limit 0,10;
+ select * FROM v1 order by f59 limit 0,10;
#(11)
CREATE or REPLACE VIEW v1 AS select f59
from tb2 group by f59 desc limit 100;
- select * FROM v1 limit 0,10;
+ select * FROM v1 order by f59 limit 0,10;
#(12)
CREATE or REPLACE VIEW v1 AS (select f59 from tb2)
union (select f59 from t1) limit 100;
- select * FROM v1 limit 0,10;
+ select * FROM v1 order by f59 limit 0,10;
#(13)
CREATE or REPLACE VIEW v1 AS (select f59 FROM tb2)
UNION DISTINCT(select f59 FROM t1) ;
- select * FROM v1 limit 0,10;
+ select * FROM v1 order by f59 limit 0,10;
#(14)
CREATE or REPLACE VIEW v1 AS (select f59 FROM tb2)
UNION ALL(select f59 FROM t1) ;
- select * FROM v1 limit 0,10;
+ select * FROM v1 order by f59 limit 0,10;
#(15)
if ($have_bug_11589)
@@ -220,24 +220,24 @@ if ($have_bug_11589)
}
CREATE or REPLACE VIEW v1 AS select *
FROM test.tb2 WITH LOCAL CHECK OPTION ;
- select * FROM v1 limit 0,50;
+ select * FROM v1 order by f59,f60,f61,f62,f63,f64 limit 0,50;
#(16)
CREATE or REPLACE VIEW v1 AS select *
FROM test.tb2 WITH CASCADED CHECK OPTION ;
- select * FROM v1 limit 0,10;
+ select * FROM v1 order by f59,f60,f61,f62,f63,f64 limit 0,10;
--enable_ps_protocol
#(17)
CREATE OR REPLACE VIEW v1 AS SELECT F59, F60
FROM test.tb2 WITH CASCADED CHECK OPTION;
- SELECT * FROM v1 limit 0,10;
+ SELECT * FROM v1 order by f59,f60 limit 0,10;
#(18)
CREATE or REPLACE VIEW v1 AS select f59, f60
from test.tb2 where f59=3330 ;
- select * FROM v1 limit 0,10;
+ select * FROM v1 order by f60 limit 0,10;
DROP VIEW v1 ;
DROP TABLE t1 ;
@@ -816,18 +816,18 @@ AS SELECT * FROM t1 limit 2;
SHOW CREATE VIEW test.v1;
SELECT * FROM test.v1;
# Switch the base table
-CREATE OR REPLACE VIEW test.v1 AS SELECT * FROM tb2 limit 2;
+CREATE OR REPLACE VIEW test.v1 AS SELECT * FROM tb2 order by f59 limit 2;
SHOW CREATE VIEW test.v1;
if ($have_bug_11589)
{
--disable_ps_protocol
}
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by f59,f60,f61,f62,f63,f64,f65;
--enable_ps_protocol
# Switch the SELECT but not the base table
CREATE OR REPLACE VIEW test.v1 AS SELECT F59 FROM tb2 limit 10,100;
SHOW CREATE VIEW test.v1;
-SELECT * FROM test.v1;
+SELECT * FROM test.v1 order by F59;
Drop table test.t1 ;
Drop view test.v1 ;
@@ -1020,7 +1020,7 @@ let $message= Testcase 3.3.1.21 ;
DROP VIEW IF EXISTS v1;
--enable_warnings
CREATE VIEW test.v1( F59, F60 ) AS SELECT F59, F60 From tb2 LIMIT 2;
-SELECT * FROM test.v1;
+SELECT * FROM test.v1 order by F59, F60 desc;
Drop view if exists test.v1 ;
@@ -1175,7 +1175,7 @@ Drop VIEW IF EXISTS test.v1_1 ;
--enable_warnings
Create view test.v1 AS Select * from test.tb2 limit 2 ;
Create view test.v1_1 AS Select F59 from test.v1 ;
-Select * from test.v1_1 limit 20 ;
+Select * from test.v1_1 order by F59 limit 20 ;
Drop view test.v1 ;
Drop view test.v1_1 ;
@@ -1197,7 +1197,7 @@ if ($have_bug_11589)
{
--disable_ps_protocol
}
-Select * from v1 ;
+Select * from v1 order by f59,f60,f61,f62,f63,f64,f65;
--enable_ps_protocol
Select * from test2.v2 ;
Drop view if exists test2.v1 ;
@@ -1287,7 +1287,7 @@ CREATE VIEW test.v1
AS SELECT test.v1_firstview.f59, test.v1_firstview.f60
FROM test.v1_firstview INNER JOIN test.v1_secondview
ON test.v1_firstview.f59 = test.v1_secondview.f59 ;
-SELECT * FROM test.v1 limit 0,10;
+SELECT * FROM test.v1 order by f59,f60 limit 0,10;
Drop view if exists test.v1_firstview ;
Drop view if exists test.v1_secondview ;
Drop view if exists test.v1 ;
@@ -1314,7 +1314,7 @@ CREATE VIEW v1
AS SELECT test.v1_firstview.F59, test.v1_firstview.F60
FROM test.v1_firstview INNER JOIN test.v1_secondview
ON test.v1_firstview.f59 = test.v1_secondview.f59 ;
-SELECT * FROM v1 limit 0,10;
+SELECT * FROM v1 order by f59,f60 limit 0,10;
Drop view v1 ;
Drop view test.v1_firstview ;
Drop view test.v1_secondview ;
@@ -1339,7 +1339,7 @@ CREATE VIEW test.v1
AS SELECT test.v1_firstview.f59, test.v1_firstview.f60
FROM test.v1_firstview INNER JOIN test.tb2
ON test.v1_firstview.f59 = test.tb2.f59;
-SELECT * FROM test.v1 limit 0,10;
+SELECT * FROM test.v1 order by f59,f60 limit 0,10;
Drop view test.v1 ;
Drop view test.v1_firstview;
@@ -1360,7 +1360,7 @@ CREATE VIEW v1_firstview AS SELECT * FROM test.tb2 ;
CREATE VIEW v1
AS SELECT v1_firstview.f59, v1_firstview.f60
FROM v1_firstview INNER JOIN test.tb2 ON v1_firstview.f59 = test.tb2.f59 ;
-SELECT * FROM v1 limit 0,10;
+SELECT * FROM v1 order by f59,f60 limit 0,10;
Drop database test2 ;
@@ -1385,7 +1385,7 @@ Drop view if exists test.v1_1 ;
Drop view if exists test.v1_main ;
--enable_warnings
Create view test.v1 as Select f59, f60 FROM test.tb2;
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59,f60 limit 0,10;
Create table t1(f59 int, f60 int);
Insert into t1 values (90,507) ;
@@ -1396,7 +1396,7 @@ Select * from v1_1 ;
Create view v1_main
as SELECT test.tb2.f59 FROM test.tb2 JOIN test.v1
ON test.tb2.f59 = test.v1.f59;
-Select * from v1_main limit 0,10;
+Select * from v1_main order by f59 limit 0,10;
Drop table t1;
Drop view test.v1 ;
@@ -1505,7 +1505,7 @@ Drop view if exists test1.v1_1 ;
Drop database if exists test3 ;
--enable_warnings
Create view test.v1 as Select f59, f60 FROM test.tb2 limit 20 ;
-Select * from test.v1 ;
+Select * from test.v1 order by f59,f60;
Create table test1.t1 (f59 int,f60 int) ;
Insert into test1.t1 values (199,507) ;
@@ -1550,7 +1550,7 @@ Drop view if exists test.v1 ;
CREATE VIEW test.v1
AS Select f59 from (Select * FROM tb2 limit 20) tx ;
--error 1146
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by f59 ;
--disable_warnings
Drop view if exists test.v1 ;
--enable_warnings
@@ -1709,7 +1709,7 @@ CREATE VIEW test.v1 AS SELECT * FROM test.tb2 where f59 = 04;
--enable_info
UPDATE test.v1 SET f59 = 30 where F59 = 04 ;
--disable_info
-SELECT * FROM test.v1 where f59 = 30 ;
+SELECT * FROM test.v1 where f59 = 30 order by f59;
if ($have_bug_11589)
{
--disable_ps_protocol
@@ -1726,7 +1726,7 @@ if ($have_bug_11589)
}
SELECT * FROM tb2 where f59 = 100 ;
--enable_ps_protocol
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by f59 ;
drop view if exists test.v1 ;
@@ -1772,7 +1772,8 @@ SELECT * FROM v1 ORDER BY f1;
--enable_info
# 1. The record to be inserted will be within the scope of the view.
# But there is already a record with the PRIMARY KEY f1 = 2 .
---error ER_DUP_ENTRY_WITH_KEY_NAME
+# OBN change for 5.1.21 --error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
INSERT INTO v1 VALUES(2,'two');
# 2. The record to be inserted will be within the scope of the view.
# There is no already existing record with the PRIMARY KEY f1 = 3 .
@@ -1789,7 +1790,8 @@ SELECT * FROM v1 ORDER BY f1;
# 1. The record to be updated is within the scope of the view
# and will stay inside the scope.
# But there is already a record with the PRIMARY KEY f1 = 2 .
---error ER_DUP_ENTRY_WITH_KEY_NAME
+# OBN change for 5.1.21 --error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
UPDATE v1 SET f1 = 2 WHERE f1 = 3;
# 2. The record to be updated is within the scope of the view
# and will stay inside the scope.
@@ -1819,7 +1821,7 @@ FROM test.tb2 where f59 = 195 WITH CHECK OPTION ;
--error 1369
UPDATE test.v1 SET f59 = 198 where f59=195 ;
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by f59 ;
drop view if exists test.v1 ;
@@ -1844,7 +1846,7 @@ CREATE VIEW test.v2 as SELECT * FROM test.v1 ;
# This UPDATE violates the definition of VIEW test.v1.
--error 1369
UPDATE test.v1 SET F59 = 919 where f59 = 0987 ;
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by f59 ;
# ML: This UPDATE violates the definition of VIEW test.v1, but this
# does not count, because the UPDATE runs on test.v2, which
@@ -2297,7 +2299,7 @@ if ($have_bug_11589)
{
--disable_ps_protocol
}
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by f59 ;
--enable_ps_protocol
drop view test.v1 ;
###############################################################################
@@ -2308,7 +2310,7 @@ drop view test.v1 ;
# AS SELECT col1, col3 FROM <table name>.
###############################################################################
CREATE VIEW test.v1 AS SELECT F59,F61 FROM test.tb2 limit 50 ;
-SELECT * FROM test.v1 ;
+SELECT * FROM test.v1 order by F59, F61 ;
drop view test.v1 ;
###############################################################################
# Testcase 3.3.1.52: Ensure that a view that is a subset of every column and
@@ -2317,12 +2319,12 @@ drop view test.v1 ;
# that is semantically equivalent to CREATE VIEW <view name>
# AS SELECT * FROM <table name> WHERE ....
###############################################################################
-CREATE VIEW test.v1 AS SELECT * FROM test.tb2 limit 20 ;
+CREATE VIEW test.v1 AS SELECT * FROM test.tb2 order by f59, f60, f61 limit 20 ;
if ($have_bug_11589)
{
--disable_ps_protocol
}
-SELECT * FROM test.v1;
+SELECT * FROM test.v1 order by f59,f60,f61 ;
--enable_ps_protocol
drop view test.v1 ;
###############################################################################
@@ -2333,7 +2335,7 @@ drop view test.v1 ;
# <view name> AS SELECT col1, col3 FROM <table name> WHERE ..
###############################################################################
CREATE VIEW test.v1 AS SELECT F59,f61 FROM test.tb2 limit 20 ;
-SELECT * FROM test.v1 limit 50;
+SELECT * FROM test.v1 order by f59,f61 desc limit 50;
drop view test.v1 ;
@@ -2361,7 +2363,7 @@ Insert into t2 values (2,2000) ;
Insert into t2 values (31,97) ;
Create view test.v1 as select t1.f59, t1.f60
from t1,t2 where t1.f59=t2.f59 ;
-Select * from test.v1 limit 50 ;
+Select * from test.v1 order by f59 limit 50 ;
drop table test.t1 ;
drop table test.t2 ;
@@ -2455,7 +2457,7 @@ create or replace view test.v1 as
Select t1.f59 t1_f59, t2.f59 t2_f59, t1.f60 t1_f60, t2.f60 t2_f60,
t1.f61 t1_f61, t2.f61 t2_f61
from t1 inner join t2 where t1.f59 = t2.f59 ;
-select * from test.v1;
+select * from test.v1 order by t1_f59 ;
Select t1.f59 t1_f59, t2.f59 t2_f59, t1.f60 t1_f60, t2.f60 t2_f60,
t1.f61 t1_f61, t2.f61 t2_f61
from t1 inner join t2 where t1.f59 = t2.f59;
@@ -2464,7 +2466,7 @@ from t1 inner join t2 where t1.f59 = t2.f59;
Create or replace view test.v1 as
Select t1.f59 AS t1_f59, t2.f59 AS t2_f59
FROM t2 cross join t1;
-Select * from v1;
+Select * from v1 order by t1_f59,t2_f59;
Select t1.f59 AS t1_f59, t2.f59 AS t2_f59
FROM t2 cross join t1;
@@ -2472,7 +2474,7 @@ FROM t2 cross join t1;
Create or replace view test.v1 as
Select straight_join t1.f59 AS t1_f59, t2.f59 AS t2_f59
FROM t2,t1;
-Select * from v1;
+Select * from v1 order by t1_f59,t2_f59;
Select straight_join t1.f59 AS t1_f59, t2.f59 AS t2_f59
FROM t2,t1;
@@ -2480,7 +2482,7 @@ FROM t2,t1;
Create or replace view test.v1 as
Select f59, f60, f61, a, b
FROM t2 natural join t1;
-Select * from v1;
+Select * from v1 order by f59;
Select f59, f60, f61, a, b
FROM t2 natural join t1;
@@ -2489,7 +2491,7 @@ Create or replace view test.v1 as
Select t1.f59 t1_f59, t2.f59 t2_f59, t1.f60 t1_f60, t2.f60 t2_f60,
t1.f61 t1_f61, t2.f61 t2_f61
FROM t2 left outer join t1 on t2.f59=t1.f59;
-Select * from v1;
+Select * from v1 order by t1_f59;
Select t1.f59 t1_f59, t2.f59 t2_f59, t1.f60 t1_f60, t2.f60 t2_f60,
t1.f61 t1_f61, t2.f61 t2_f61
FROM t2 left outer join t1 on t2.f59=t1.f59;
@@ -2498,7 +2500,7 @@ FROM t2 left outer join t1 on t2.f59=t1.f59;
Create or replace view test.v1 as
Select f59, f60, f61, t1.a, t2.b
FROM t2 natural left outer join t1;
-Select * from v1;
+Select * from v1 order by f59;
Select f59, f60, f61, t1.a, t2.b
FROM t2 natural left outer join t1;
@@ -2507,7 +2509,7 @@ Create or replace view test.v1 as
Select t1.f59 t1_f59, t2.f59 t2_f59, t1.f60 t1_f60, t2.f60 t2_f60,
t1.f61 t1_f61, t2.f61 t2_f61
FROM t2 right outer join t1 on t2.f59=t1.f59;
-Select * from v1;
+Select * from v1 order by t1_f59;
Select t1.f59 t1_f59, t2.f59 t2_f59, t1.f60 t1_f60, t2.f60 t2_f60,
t1.f61 t1_f61, t2.f61 t2_f61
FROM t2 right outer join t1 on t2.f59=t1.f59;
@@ -2516,7 +2518,7 @@ FROM t2 right outer join t1 on t2.f59=t1.f59;
Create or replace view test.v1 as
Select f59, f60, a, b
FROM t2 natural right outer join t1;
-Select * from v1;
+Select * from v1 order by f59 desc;
Select f59, f60, a, b
FROM t2 natural right outer join t1;
@@ -2549,7 +2551,7 @@ Insert into t1 values (901,801,401) ;
Create or replace view test.v1 as
Select tb2.f59 FROM tb2 LEFT JOIN t1 on tb2.f59 = t1.f59 ;
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
Drop view if exists test.v1 ;
# Testcase 3.3.1.A2 ;
@@ -2564,7 +2566,7 @@ Insert into t1 values (201,201,201) ;
Create or replace view test.v1
as Select tb2.f59 FROM tb2 INNER JOIN t1 on tb2.f59 = t1.f59 ;
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
Drop view if exists test.v1 ;
# Testcase 3.3.1.A3 ;
@@ -2579,7 +2581,7 @@ Insert into t1 values (21,21,21) ;
Create or replace view test.v1
as Select tb2.f59 FROM tb2 CROSS JOIN t1 on tb2.f59 = t1.f59 ;
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
Drop view test.v1 ;
@@ -2605,15 +2607,15 @@ Insert into t1 values (91,81,41) ;
Create or replace view test.v1 as (Select f59 FROM tb2 where f59=17 )
Union ALL (Select f59 from t1 where f59=17 );
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
Create or replace view test.v1 as (Select f59 FROM tb2 where f59=17 )
Union (Select f59 from t1 where f59=17 );
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
Create or replace view test.v1 as (Select f59 FROM tb2 where f59=17 )
Union Distinct (Select f59 from t1 where f60=17 );
-Select * from test.v1 limit 0,10;
+Select * from test.v1 order by f59 limit 0,10;
Drop view test.v1 ;
@@ -2629,25 +2631,25 @@ insert into t1 values (901,801,401);
create or replace view test.v1 as
select tb2.f59 from tb2 join t1 on tb2.f59 = t1.f59;
-select * from test.v1 limit 0,10;
+select * from test.v1 order by f59 limit 0,10;
create or replace view test.v1 as
(select f59 from tb2 where f59=107 )
union all
(select f59 from t1 where f59=107 );
-select * from test.v1 limit 0,10;
+select * from test.v1 order by f59 limit 0,10;
create or replace view test.v1 as
(select f59 from tb2 where f59=107 )
union
(select f59 from t1 where f59=107 );
-select * from test.v1 limit 0,10;
+select * from test.v1 order by f59 limit 0,10;
create or replace view test.v1 as
(select f59 from tb2 where f59=107 )
union distinct
(select f59 from t1 where f59=107 );
-select * from test.v1 limit 0,10;
+select * from test.v1 order by f59 limit 0,10;
drop view if exists test.v1 ;
drop table t1;
@@ -2666,7 +2668,7 @@ Drop view if exists test.v1 ;
CREATE VIEW test.v1 AS SELECT F59
FROM test.tb2 where test.tb2.F59 = 109;
-SELECT * FROM test.v1 limit 0,10;
+SELECT * FROM test.v1 order by f59 limit 0,10;
ALTER VIEW test.v1 AS SELECT *
FROM test.tb2 WHERE test.tb2.f59 = 242 ;
@@ -2674,7 +2676,7 @@ if ($have_bug_11589)
{
--disable_ps_protocol
}
-SELECT * FROM test.v1 limit 0,10;
+SELECT * FROM test.v1 order by f59 limit 0,10;
--enable_ps_protocol
Drop view test.v1 ;
@@ -2897,10 +2899,14 @@ eval EXPLAIN SELECT * FROM test3.v$toplevel;
# and OBN's box performs excessive paging.
# (RAM: OBN ~384MB RAM, ML 1 GB)
#++++++++++++++++++++++++++++++++++++++++++++++
-let $message= FIXME - Setting join_limit to 30 - hangs for higher values;
+let $message= FIXME - Setting join_limit to 28 - hangs for higher values;
--source include/show_msg.inc
+# OBN - Reduced from 30 in 5.1.21 to avoid hitting the ndbcluster limit
+# of "ERROR HY000:RROR HY000: Got temporary error 4006 'Connect failure
+# - out of connection objects (increase MaxNoOfConcurrentTransactions)'
+# from NDBCLUSTER " to early;
#SET @join_limit = 61;
-SET @join_limit = 30;
+SET @join_limit = 28; # OBN - see above
SET @max_level = @join_limit - 1;
--enable_query_log
@@ -3182,7 +3188,7 @@ if ($have_bug_11589)
}
SELECT * FROM tb2 where f59 = 8 and f60 = 105;
--enable_ps_protocol
-SELECT f59,f60 FROM test.v1 where f59 = 8 and f60 = 105;
+SELECT f59,f60 FROM test.v1 where f59 = 8 and f60 = 105 ;
Drop view test.v1 ;
@@ -3210,7 +3216,7 @@ if ($have_bug_11589)
}
SELECT * FROM tb2 where f59 = 891 and f60 = 105;
--enable_ps_protocol
-SELECT f59,f60 FROM test.v1 where f59 = 891 and f60 = 105;
+SELECT f59,f60 FROM test.v1 where f59 = 891 and f60 = 105 ;
Drop view test.v1 ;
@@ -3231,7 +3237,7 @@ CREATE VIEW test.v1 AS SELECT f59,f60,f61 FROM tb2 where f59 = 789 ;
DELETE FROM test.v1 where f59 = 789 ;
--disable_info
SELECT * FROM tb2 where f59 = 789 ;
-SELECT f59,f60 FROM test.v1 where f59 = 789;
+SELECT f59,f60 FROM test.v1 where f59 = 789 order by f60 ;
Drop view test.v1 ;
@@ -3254,7 +3260,7 @@ DELETE FROM test.v1 where f59 = 711 ;
--disable_info
SELECT * FROM tb2 where f59 = 711 ;
-SELECT f59,f60 FROM test.v1 where f59 = 711;
+SELECT f59,f60 FROM test.v1 where f59 = 711 order by f60 ;
Drop view test.v1 ;
@@ -3287,7 +3293,8 @@ DELETE FROM t1;
# f1 gets the default 0, because we are in the native sql_mode
INSERT INTO v1 SET f2 = 'ABC';
# f1 gets the default 0, but this value is already exists
---error ER_DUP_ENTRY_WITH_KEY_NAME
+# OBN change for 5.1.21 --error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
INSERT INTO v1 SET f2 = 'ABC';
SELECT * from t1;
DELETE FROM t1;
@@ -3375,7 +3382,8 @@ CREATE VIEW v1 AS SELECT f2, f3 FROM t1;
# f1 gets the default 0, because we are in the native sql_mode
INSERT INTO v1 SET f2 = 'ABC';
# f1 gets the default 0 and this value is already exists
---error ER_DUP_ENTRY_WITH_KEY_NAME
+# OBN change for 5.1.21 --error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
INSERT INTO v1 SET f2 = 'ABC';
SELECT * from t1;
DELETE FROM t1;
diff --git a/mysql-test/suite/funcs_2/r/ndb_charset.result b/mysql-test/suite/funcs_2/r/ndb_charset.result
index 538bea5e75e..7a5c63f71d6 100644
--- a/mysql-test/suite/funcs_2/r/ndb_charset.result
+++ b/mysql-test/suite/funcs_2/r/ndb_charset.result
@@ -3,7 +3,7 @@ SET NAMES armscii8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET armscii8 COLLATE armscii8_bin) ENGINE=NDB CHARACTER SET armscii8 COLLATE armscii8_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # armscii8_bin # # #
+t1 ndbcluster # # # # # # # # # # # # armscii8_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -233,7 +233,7 @@ SET NAMES armscii8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET armscii8 COLLATE armscii8_general_ci) ENGINE=NDB CHARACTER SET armscii8 COLLATE armscii8_general_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # armscii8_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # armscii8_general_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -463,7 +463,7 @@ SET NAMES ascii;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET ascii COLLATE ascii_bin) ENGINE=NDB CHARACTER SET ascii COLLATE ascii_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # ascii_bin # # #
+t1 ndbcluster # # # # # # # # # # # # ascii_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -693,7 +693,7 @@ SET NAMES ascii;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET ascii COLLATE ascii_general_ci) ENGINE=NDB CHARACTER SET ascii COLLATE ascii_general_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # ascii_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # ascii_general_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -923,7 +923,7 @@ SET NAMES big5;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET big5 COLLATE big5_bin) ENGINE=NDB CHARACTER SET big5 COLLATE big5_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # big5_bin # # #
+t1 ndbcluster # # # # # # # # # # # # big5_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -1027,7 +1027,7 @@ SET NAMES big5;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET big5 COLLATE big5_chinese_ci) ENGINE=NDB CHARACTER SET big5 COLLATE big5_chinese_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # big5_chinese_ci # # #
+t1 ndbcluster # # # # # # # # # # # # big5_chinese_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -1131,7 +1131,7 @@ SET NAMES binary;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET binary) ENGINE=NDB CHARACTER SET binary;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # binary # # #
+t1 ndbcluster # # # # # # # # # # # # binary # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -1361,7 +1361,7 @@ SET NAMES cp1250;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1250 COLLATE cp1250_bin) ENGINE=NDB CHARACTER SET cp1250 COLLATE cp1250_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # cp1250_bin # # #
+t1 ndbcluster # # # # # # # # # # # # cp1250_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -1591,7 +1591,7 @@ SET NAMES cp1250;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1250 COLLATE cp1250_croatian_ci) ENGINE=NDB CHARACTER SET cp1250 COLLATE cp1250_croatian_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # cp1250_croatian_ci # # #
+t1 ndbcluster # # # # # # # # # # # # cp1250_croatian_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -1821,7 +1821,7 @@ SET NAMES cp1250;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1250 COLLATE cp1250_czech_cs) ENGINE=NDB CHARACTER SET cp1250 COLLATE cp1250_czech_cs;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # cp1250_czech_cs # # #
+t1 ndbcluster # # # # # # # # # # # # cp1250_czech_cs # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
7F 1
@@ -2051,7 +2051,7 @@ SET NAMES cp1250;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1250 COLLATE cp1250_general_ci) ENGINE=NDB CHARACTER SET cp1250 COLLATE cp1250_general_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # cp1250_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # cp1250_general_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
A0 1
@@ -2281,7 +2281,7 @@ SET NAMES cp1251;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1251 COLLATE cp1251_bin) ENGINE=NDB CHARACTER SET cp1251 COLLATE cp1251_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # cp1251_bin # # #
+t1 ndbcluster # # # # # # # # # # # # cp1251_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -2511,7 +2511,7 @@ SET NAMES cp1251;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1251 COLLATE cp1251_bulgarian_ci) ENGINE=NDB CHARACTER SET cp1251 COLLATE cp1251_bulgarian_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # cp1251_bulgarian_ci # # #
+t1 ndbcluster # # # # # # # # # # # # cp1251_bulgarian_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -2741,7 +2741,7 @@ SET NAMES cp1251;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1251 COLLATE cp1251_general_ci) ENGINE=NDB CHARACTER SET cp1251 COLLATE cp1251_general_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # cp1251_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # cp1251_general_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -2971,7 +2971,7 @@ SET NAMES cp1251;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1251 COLLATE cp1251_general_cs) ENGINE=NDB CHARACTER SET cp1251 COLLATE cp1251_general_cs;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # cp1251_general_cs # # #
+t1 ndbcluster # # # # # # # # # # # # cp1251_general_cs # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -3201,7 +3201,7 @@ SET NAMES cp1251;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1251 COLLATE cp1251_ukrainian_ci) ENGINE=NDB CHARACTER SET cp1251 COLLATE cp1251_ukrainian_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # cp1251_ukrainian_ci # # #
+t1 ndbcluster # # # # # # # # # # # # cp1251_ukrainian_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
60 1
@@ -3431,7 +3431,7 @@ SET NAMES cp1256;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1256 COLLATE cp1256_bin) ENGINE=NDB CHARACTER SET cp1256 COLLATE cp1256_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # cp1256_bin # # #
+t1 ndbcluster # # # # # # # # # # # # cp1256_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -3661,7 +3661,7 @@ SET NAMES cp1256;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1256 COLLATE cp1256_general_ci) ENGINE=NDB CHARACTER SET cp1256 COLLATE cp1256_general_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # cp1256_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # cp1256_general_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -3891,7 +3891,7 @@ SET NAMES cp1257;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1257 COLLATE cp1257_bin) ENGINE=NDB CHARACTER SET cp1257 COLLATE cp1257_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # cp1257_bin # # #
+t1 ndbcluster # # # # # # # # # # # # cp1257_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -4121,7 +4121,7 @@ SET NAMES cp1257;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1257 COLLATE cp1257_general_ci) ENGINE=NDB CHARACTER SET cp1257 COLLATE cp1257_general_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # cp1257_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # cp1257_general_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -4351,7 +4351,7 @@ SET NAMES cp1257;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp1257 COLLATE cp1257_lithuanian_ci) ENGINE=NDB CHARACTER SET cp1257 COLLATE cp1257_lithuanian_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # cp1257_lithuanian_ci # # #
+t1 ndbcluster # # # # # # # # # # # # cp1257_lithuanian_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -4581,7 +4581,7 @@ SET NAMES cp850;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp850 COLLATE cp850_bin) ENGINE=NDB CHARACTER SET cp850 COLLATE cp850_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # cp850_bin # # #
+t1 ndbcluster # # # # # # # # # # # # cp850_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -4811,7 +4811,7 @@ SET NAMES cp850;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp850 COLLATE cp850_general_ci) ENGINE=NDB CHARACTER SET cp850 COLLATE cp850_general_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # cp850_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # cp850_general_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -5041,7 +5041,7 @@ SET NAMES cp852;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp852 COLLATE cp852_bin) ENGINE=NDB CHARACTER SET cp852 COLLATE cp852_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # cp852_bin # # #
+t1 ndbcluster # # # # # # # # # # # # cp852_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -5271,7 +5271,7 @@ SET NAMES cp852;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp852 COLLATE cp852_general_ci) ENGINE=NDB CHARACTER SET cp852 COLLATE cp852_general_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # cp852_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # cp852_general_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -5501,7 +5501,7 @@ SET NAMES cp866;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp866 COLLATE cp866_bin) ENGINE=NDB CHARACTER SET cp866 COLLATE cp866_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # cp866_bin # # #
+t1 ndbcluster # # # # # # # # # # # # cp866_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -5731,7 +5731,7 @@ SET NAMES cp866;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp866 COLLATE cp866_general_ci) ENGINE=NDB CHARACTER SET cp866 COLLATE cp866_general_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # cp866_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # cp866_general_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -5961,7 +5961,7 @@ SET NAMES cp932;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp932 COLLATE cp932_bin) ENGINE=NDB CHARACTER SET cp932 COLLATE cp932_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # cp932_bin # # #
+t1 ndbcluster # # # # # # # # # # # # cp932_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -6128,7 +6128,7 @@ SET NAMES cp932;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET cp932 COLLATE cp932_japanese_ci) ENGINE=NDB CHARACTER SET cp932 COLLATE cp932_japanese_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # cp932_japanese_ci # # #
+t1 ndbcluster # # # # # # # # # # # # cp932_japanese_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -6295,7 +6295,7 @@ SET NAMES dec8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET dec8 COLLATE dec8_bin) ENGINE=NDB CHARACTER SET dec8 COLLATE dec8_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # dec8_bin # # #
+t1 ndbcluster # # # # # # # # # # # # dec8_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -6525,7 +6525,7 @@ SET NAMES dec8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET dec8 COLLATE dec8_swedish_ci) ENGINE=NDB CHARACTER SET dec8 COLLATE dec8_swedish_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # dec8_swedish_ci # # #
+t1 ndbcluster # # # # # # # # # # # # dec8_swedish_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -6755,7 +6755,7 @@ SET NAMES eucjpms;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET eucjpms COLLATE eucjpms_bin) ENGINE=NDB CHARACTER SET eucjpms COLLATE eucjpms_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # eucjpms_bin # # #
+t1 ndbcluster # # # # # # # # # # # # eucjpms_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -6859,7 +6859,7 @@ SET NAMES eucjpms;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET eucjpms COLLATE eucjpms_japanese_ci) ENGINE=NDB CHARACTER SET eucjpms COLLATE eucjpms_japanese_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # eucjpms_japanese_ci # # #
+t1 ndbcluster # # # # # # # # # # # # eucjpms_japanese_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -6963,7 +6963,7 @@ SET NAMES euckr;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET euckr COLLATE euckr_bin) ENGINE=NDB CHARACTER SET euckr COLLATE euckr_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # euckr_bin # # #
+t1 ndbcluster # # # # # # # # # # # # euckr_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -7067,7 +7067,7 @@ SET NAMES euckr;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET euckr COLLATE euckr_korean_ci) ENGINE=NDB CHARACTER SET euckr COLLATE euckr_korean_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # euckr_korean_ci # # #
+t1 ndbcluster # # # # # # # # # # # # euckr_korean_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -7171,7 +7171,7 @@ SET NAMES gb2312;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET gb2312 COLLATE gb2312_bin) ENGINE=NDB CHARACTER SET gb2312 COLLATE gb2312_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # gb2312_bin # # #
+t1 ndbcluster # # # # # # # # # # # # gb2312_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -7275,7 +7275,7 @@ SET NAMES gb2312;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET gb2312 COLLATE gb2312_chinese_ci) ENGINE=NDB CHARACTER SET gb2312 COLLATE gb2312_chinese_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # gb2312_chinese_ci # # #
+t1 ndbcluster # # # # # # # # # # # # gb2312_chinese_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -7379,7 +7379,7 @@ SET NAMES gbk;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET gbk COLLATE gbk_bin) ENGINE=NDB CHARACTER SET gbk COLLATE gbk_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # gbk_bin # # #
+t1 ndbcluster # # # # # # # # # # # # gbk_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -7483,7 +7483,7 @@ SET NAMES gbk;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET gbk COLLATE gbk_chinese_ci) ENGINE=NDB CHARACTER SET gbk COLLATE gbk_chinese_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # gbk_chinese_ci # # #
+t1 ndbcluster # # # # # # # # # # # # gbk_chinese_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -7587,7 +7587,7 @@ SET NAMES geostd8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET geostd8 COLLATE geostd8_bin) ENGINE=NDB CHARACTER SET geostd8 COLLATE geostd8_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # geostd8_bin # # #
+t1 ndbcluster # # # # # # # # # # # # geostd8_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -7817,7 +7817,7 @@ SET NAMES geostd8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET geostd8 COLLATE geostd8_general_ci) ENGINE=NDB CHARACTER SET geostd8 COLLATE geostd8_general_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # geostd8_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # geostd8_general_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -8047,7 +8047,7 @@ SET NAMES greek;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET greek COLLATE greek_bin) ENGINE=NDB CHARACTER SET greek COLLATE greek_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # greek_bin # # #
+t1 ndbcluster # # # # # # # # # # # # greek_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -8277,7 +8277,7 @@ SET NAMES greek;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET greek COLLATE greek_general_ci) ENGINE=NDB CHARACTER SET greek COLLATE greek_general_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # greek_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # greek_general_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -8507,7 +8507,7 @@ SET NAMES hebrew;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET hebrew COLLATE hebrew_bin) ENGINE=NDB CHARACTER SET hebrew COLLATE hebrew_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # hebrew_bin # # #
+t1 ndbcluster # # # # # # # # # # # # hebrew_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -8737,7 +8737,7 @@ SET NAMES hebrew;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET hebrew COLLATE hebrew_general_ci) ENGINE=NDB CHARACTER SET hebrew COLLATE hebrew_general_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # hebrew_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # hebrew_general_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -8967,7 +8967,7 @@ SET NAMES hp8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET hp8 COLLATE hp8_bin) ENGINE=NDB CHARACTER SET hp8 COLLATE hp8_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # hp8_bin # # #
+t1 ndbcluster # # # # # # # # # # # # hp8_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -9197,7 +9197,7 @@ SET NAMES hp8;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET hp8 COLLATE hp8_english_ci) ENGINE=NDB CHARACTER SET hp8 COLLATE hp8_english_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # hp8_english_ci # # #
+t1 ndbcluster # # # # # # # # # # # # hp8_english_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -9427,7 +9427,7 @@ SET NAMES keybcs2;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET keybcs2 COLLATE keybcs2_bin) ENGINE=NDB CHARACTER SET keybcs2 COLLATE keybcs2_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # keybcs2_bin # # #
+t1 ndbcluster # # # # # # # # # # # # keybcs2_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -9657,7 +9657,7 @@ SET NAMES keybcs2;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET keybcs2 COLLATE keybcs2_general_ci) ENGINE=NDB CHARACTER SET keybcs2 COLLATE keybcs2_general_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # keybcs2_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # keybcs2_general_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -9887,7 +9887,7 @@ SET NAMES koi8r;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET koi8r COLLATE koi8r_bin) ENGINE=NDB CHARACTER SET koi8r COLLATE koi8r_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # koi8r_bin # # #
+t1 ndbcluster # # # # # # # # # # # # koi8r_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -10117,7 +10117,7 @@ SET NAMES koi8r;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET koi8r COLLATE koi8r_general_ci) ENGINE=NDB CHARACTER SET koi8r COLLATE koi8r_general_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # koi8r_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # koi8r_general_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -10347,7 +10347,7 @@ SET NAMES koi8u;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET koi8u COLLATE koi8u_bin) ENGINE=NDB CHARACTER SET koi8u COLLATE koi8u_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # koi8u_bin # # #
+t1 ndbcluster # # # # # # # # # # # # koi8u_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -10577,7 +10577,7 @@ SET NAMES koi8u;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET koi8u COLLATE koi8u_general_ci) ENGINE=NDB CHARACTER SET koi8u COLLATE koi8u_general_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # koi8u_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # koi8u_general_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
60 1
@@ -10807,7 +10807,7 @@ SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_bin) ENGINE=NDB CHARACTER SET latin1 COLLATE latin1_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # latin1_bin # # #
+t1 ndbcluster # # # # # # # # # # # # latin1_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -11037,7 +11037,7 @@ SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_danish_ci) ENGINE=NDB CHARACTER SET latin1 COLLATE latin1_danish_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # latin1_danish_ci # # #
+t1 ndbcluster # # # # # # # # # # # # latin1_danish_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -11267,7 +11267,7 @@ SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_general_ci) ENGINE=NDB CHARACTER SET latin1 COLLATE latin1_general_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # latin1_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # latin1_general_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -11497,7 +11497,7 @@ SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_general_cs) ENGINE=NDB CHARACTER SET latin1 COLLATE latin1_general_cs;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # latin1_general_cs # # #
+t1 ndbcluster # # # # # # # # # # # # latin1_general_cs # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -11727,7 +11727,7 @@ SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_german1_ci) ENGINE=NDB CHARACTER SET latin1 COLLATE latin1_german1_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # latin1_german1_ci # # #
+t1 ndbcluster # # # # # # # # # # # # latin1_german1_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -11957,7 +11957,7 @@ SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_german2_ci) ENGINE=NDB CHARACTER SET latin1 COLLATE latin1_german2_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # latin1_german2_ci # # #
+t1 ndbcluster # # # # # # # # # # # # latin1_german2_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -12187,7 +12187,7 @@ SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_spanish_ci) ENGINE=NDB CHARACTER SET latin1 COLLATE latin1_spanish_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # latin1_spanish_ci # # #
+t1 ndbcluster # # # # # # # # # # # # latin1_spanish_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -12417,7 +12417,7 @@ SET NAMES latin1;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin1 COLLATE latin1_swedish_ci) ENGINE=NDB CHARACTER SET latin1 COLLATE latin1_swedish_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # latin1_swedish_ci # # #
+t1 ndbcluster # # # # # # # # # # # # latin1_swedish_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -12647,7 +12647,7 @@ SET NAMES latin2;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin2 COLLATE latin2_bin) ENGINE=NDB CHARACTER SET latin2 COLLATE latin2_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # latin2_bin # # #
+t1 ndbcluster # # # # # # # # # # # # latin2_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -12877,7 +12877,7 @@ SET NAMES latin2;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin2 COLLATE latin2_croatian_ci) ENGINE=NDB CHARACTER SET latin2 COLLATE latin2_croatian_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # latin2_croatian_ci # # #
+t1 ndbcluster # # # # # # # # # # # # latin2_croatian_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -13107,7 +13107,7 @@ SET NAMES latin2;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin2 COLLATE latin2_czech_cs) ENGINE=NDB CHARACTER SET latin2 COLLATE latin2_czech_cs;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # latin2_czech_cs # # #
+t1 ndbcluster # # # # # # # # # # # # latin2_czech_cs # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
2E 1
@@ -13337,7 +13337,7 @@ SET NAMES latin2;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin2 COLLATE latin2_general_ci) ENGINE=NDB CHARACTER SET latin2 COLLATE latin2_general_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # latin2_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # latin2_general_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -13567,7 +13567,7 @@ SET NAMES latin2;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin2 COLLATE latin2_hungarian_ci) ENGINE=NDB CHARACTER SET latin2 COLLATE latin2_hungarian_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # latin2_hungarian_ci # # #
+t1 ndbcluster # # # # # # # # # # # # latin2_hungarian_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
7F 1
@@ -13797,7 +13797,7 @@ SET NAMES latin5;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin5 COLLATE latin5_bin) ENGINE=NDB CHARACTER SET latin5 COLLATE latin5_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # latin5_bin # # #
+t1 ndbcluster # # # # # # # # # # # # latin5_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -14027,7 +14027,7 @@ SET NAMES latin5;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin5 COLLATE latin5_turkish_ci) ENGINE=NDB CHARACTER SET latin5 COLLATE latin5_turkish_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # latin5_turkish_ci # # #
+t1 ndbcluster # # # # # # # # # # # # latin5_turkish_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -14257,7 +14257,7 @@ SET NAMES latin7;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin7 COLLATE latin7_bin) ENGINE=NDB CHARACTER SET latin7 COLLATE latin7_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # latin7_bin # # #
+t1 ndbcluster # # # # # # # # # # # # latin7_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -14487,7 +14487,7 @@ SET NAMES latin7;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin7 COLLATE latin7_estonian_cs) ENGINE=NDB CHARACTER SET latin7 COLLATE latin7_estonian_cs;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # latin7_estonian_cs # # #
+t1 ndbcluster # # # # # # # # # # # # latin7_estonian_cs # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
80 1
@@ -14717,7 +14717,7 @@ SET NAMES latin7;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin7 COLLATE latin7_general_ci) ENGINE=NDB CHARACTER SET latin7 COLLATE latin7_general_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # latin7_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # latin7_general_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
7F 1
@@ -14947,7 +14947,7 @@ SET NAMES latin7;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET latin7 COLLATE latin7_general_cs) ENGINE=NDB CHARACTER SET latin7 COLLATE latin7_general_cs;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # latin7_general_cs # # #
+t1 ndbcluster # # # # # # # # # # # # latin7_general_cs # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
7F 1
@@ -15177,7 +15177,7 @@ SET NAMES macce;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET macce COLLATE macce_bin) ENGINE=NDB CHARACTER SET macce COLLATE macce_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # macce_bin # # #
+t1 ndbcluster # # # # # # # # # # # # macce_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -15407,7 +15407,7 @@ SET NAMES macce;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET macce COLLATE macce_general_ci) ENGINE=NDB CHARACTER SET macce COLLATE macce_general_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # macce_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # macce_general_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -15637,7 +15637,7 @@ SET NAMES macroman;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET macroman COLLATE macroman_bin) ENGINE=NDB CHARACTER SET macroman COLLATE macroman_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # macroman_bin # # #
+t1 ndbcluster # # # # # # # # # # # # macroman_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -15867,7 +15867,7 @@ SET NAMES macroman;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET macroman COLLATE macroman_general_ci) ENGINE=NDB CHARACTER SET macroman COLLATE macroman_general_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # macroman_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # macroman_general_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -16097,7 +16097,7 @@ SET NAMES sjis;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET sjis COLLATE sjis_bin) ENGINE=NDB CHARACTER SET sjis COLLATE sjis_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # sjis_bin # # #
+t1 ndbcluster # # # # # # # # # # # # sjis_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -16264,7 +16264,7 @@ SET NAMES sjis;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET sjis COLLATE sjis_japanese_ci) ENGINE=NDB CHARACTER SET sjis COLLATE sjis_japanese_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # sjis_japanese_ci # # #
+t1 ndbcluster # # # # # # # # # # # # sjis_japanese_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -16431,7 +16431,7 @@ SET NAMES swe7;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET swe7 COLLATE swe7_bin) ENGINE=NDB CHARACTER SET swe7 COLLATE swe7_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # swe7_bin # # #
+t1 ndbcluster # # # # # # # # # # # # swe7_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -16661,7 +16661,7 @@ SET NAMES swe7;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET swe7 COLLATE swe7_swedish_ci) ENGINE=NDB CHARACTER SET swe7 COLLATE swe7_swedish_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # swe7_swedish_ci # # #
+t1 ndbcluster # # # # # # # # # # # # swe7_swedish_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -16891,7 +16891,7 @@ SET NAMES tis620;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET tis620 COLLATE tis620_bin) ENGINE=NDB CHARACTER SET tis620 COLLATE tis620_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # tis620_bin # # #
+t1 ndbcluster # # # # # # # # # # # # tis620_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -17121,7 +17121,7 @@ SET NAMES tis620;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET tis620 COLLATE tis620_thai_ci) ENGINE=NDB CHARACTER SET tis620 COLLATE tis620_thai_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # tis620_thai_ci # # #
+t1 ndbcluster # # # # # # # # # # # # tis620_thai_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -17351,7 +17351,7 @@ SET NAMES ujis;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET ujis COLLATE ujis_bin) ENGINE=NDB CHARACTER SET ujis COLLATE ujis_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # ujis_bin # # #
+t1 ndbcluster # # # # # # # # # # # # ujis_bin # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -17455,7 +17455,7 @@ SET NAMES ujis;
CREATE TABLE test.t1 (a VARCHAR(3) CHARACTER SET ujis COLLATE ujis_japanese_ci) ENGINE=NDB CHARACTER SET ujis COLLATE ujis_japanese_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # ujis_japanese_ci # # #
+t1 ndbcluster # # # # # # # # # # # # ujis_japanese_ci # # #
SELECT HEX(ASCII(a)) AS a_ascii, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
a_ascii a_len
21 1
@@ -17562,7 +17562,7 @@ SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=NDB CHARACTER SET utf8;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_general_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_bin;
@@ -20103,7 +20103,7 @@ SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=NDB CHARACTER SET utf8;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_general_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_czech_ci;
@@ -22644,7 +22644,7 @@ SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=NDB CHARACTER SET utf8;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_general_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_danish_ci;
@@ -25185,7 +25185,7 @@ SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=NDB CHARACTER SET utf8;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_general_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_estonian_ci;
@@ -27726,7 +27726,7 @@ SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=NDB CHARACTER SET utf8;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_general_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_general_ci;
@@ -30267,7 +30267,7 @@ SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=NDB CHARACTER SET utf8;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_general_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_hungarian_ci;
@@ -32808,7 +32808,7 @@ SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=NDB CHARACTER SET utf8;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_general_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_icelandic_ci;
@@ -35349,7 +35349,7 @@ SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=NDB CHARACTER SET utf8;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_general_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_latvian_ci;
@@ -37890,7 +37890,7 @@ SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=NDB CHARACTER SET utf8;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_general_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_lithuanian_ci;
@@ -40431,7 +40431,7 @@ SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=NDB CHARACTER SET utf8;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_general_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_persian_ci;
@@ -42972,7 +42972,7 @@ SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=NDB CHARACTER SET utf8;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_general_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_polish_ci;
@@ -45513,7 +45513,7 @@ SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=NDB CHARACTER SET utf8;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_general_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_roman_ci;
@@ -48054,7 +48054,7 @@ SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=NDB CHARACTER SET utf8;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_general_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_romanian_ci;
@@ -50595,7 +50595,7 @@ SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=NDB CHARACTER SET utf8;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_general_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_slovak_ci;
@@ -53136,7 +53136,7 @@ SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=NDB CHARACTER SET utf8;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_general_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_slovenian_ci;
@@ -55677,7 +55677,7 @@ SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=NDB CHARACTER SET utf8;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_general_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_spanish2_ci;
@@ -58218,7 +58218,7 @@ SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=NDB CHARACTER SET utf8;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_general_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_spanish_ci;
@@ -60759,7 +60759,7 @@ SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=NDB CHARACTER SET utf8;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_general_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_swedish_ci;
@@ -63300,7 +63300,7 @@ SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=NDB CHARACTER SET utf8;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_general_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_turkish_ci;
@@ -65841,7 +65841,7 @@ SET NAMES utf8;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=NDB CHARACTER SET utf8;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_general_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
ALTER TABLE test.t1 CHANGE a a CHAR(4) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci;
@@ -68381,7 +68381,7 @@ USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_bin) ENGINE=NDB CHARACTER SET utf8 COLLATE utf8_bin;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_bin # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_bin # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -70920,7 +70920,7 @@ USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_czech_ci) ENGINE=NDB CHARACTER SET utf8 COLLATE utf8_czech_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_czech_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_czech_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -73459,7 +73459,7 @@ USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_danish_ci) ENGINE=NDB CHARACTER SET utf8 COLLATE utf8_danish_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_danish_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_danish_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -75998,7 +75998,7 @@ USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_estonian_ci) ENGINE=NDB CHARACTER SET utf8 COLLATE utf8_estonian_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_estonian_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_estonian_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -78537,7 +78537,7 @@ USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_general_ci) ENGINE=NDB CHARACTER SET utf8 COLLATE utf8_general_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_general_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_general_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -81076,7 +81076,7 @@ USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_hungarian_ci) ENGINE=NDB CHARACTER SET utf8 COLLATE utf8_hungarian_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_hungarian_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_hungarian_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -83615,7 +83615,7 @@ USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_icelandic_ci) ENGINE=NDB CHARACTER SET utf8 COLLATE utf8_icelandic_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_icelandic_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_icelandic_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -86154,7 +86154,7 @@ USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_latvian_ci) ENGINE=NDB CHARACTER SET utf8 COLLATE utf8_latvian_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_latvian_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_latvian_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -88693,7 +88693,7 @@ USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_lithuanian_ci) ENGINE=NDB CHARACTER SET utf8 COLLATE utf8_lithuanian_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_lithuanian_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_lithuanian_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -91232,7 +91232,7 @@ USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_persian_ci) ENGINE=NDB CHARACTER SET utf8 COLLATE utf8_persian_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_persian_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_persian_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -93771,7 +93771,7 @@ USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_polish_ci) ENGINE=NDB CHARACTER SET utf8 COLLATE utf8_polish_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_polish_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_polish_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -96310,7 +96310,7 @@ USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_roman_ci) ENGINE=NDB CHARACTER SET utf8 COLLATE utf8_roman_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_roman_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_roman_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -98849,7 +98849,7 @@ USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_romanian_ci) ENGINE=NDB CHARACTER SET utf8 COLLATE utf8_romanian_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_romanian_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_romanian_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -101388,7 +101388,7 @@ USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_slovak_ci) ENGINE=NDB CHARACTER SET utf8 COLLATE utf8_slovak_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_slovak_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_slovak_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -103927,7 +103927,7 @@ USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_slovenian_ci) ENGINE=NDB CHARACTER SET utf8 COLLATE utf8_slovenian_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_slovenian_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_slovenian_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -106466,7 +106466,7 @@ USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_spanish2_ci) ENGINE=NDB CHARACTER SET utf8 COLLATE utf8_spanish2_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_spanish2_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_spanish2_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -109005,7 +109005,7 @@ USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_spanish_ci) ENGINE=NDB CHARACTER SET utf8 COLLATE utf8_spanish_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_spanish_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_spanish_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -111544,7 +111544,7 @@ USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_swedish_ci) ENGINE=NDB CHARACTER SET utf8 COLLATE utf8_swedish_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_swedish_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_swedish_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -114083,7 +114083,7 @@ USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_turkish_ci) ENGINE=NDB CHARACTER SET utf8 COLLATE utf8_turkish_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_turkish_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_turkish_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
@@ -116622,7 +116622,7 @@ USE test;
CREATE TABLE test.t1 (a CHAR(4) CHARACTER SET utf8 COLLATE utf8_unicode_ci) ENGINE=NDB CHARACTER SET utf8 COLLATE utf8_unicode_ci;
SHOW TABLE STATUS LIKE 't1';
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
-t1 NDBCLUSTER # # # # # # # # # # # # utf8_unicode_ci # # #
+t1 ndbcluster # # # # # # # # # # # # utf8_unicode_ci # # #
LOAD DATA INFILE
'MYSQL_TEST_DIR/suite/funcs_2/data/charset_utf8.txt' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
diff --git a/mysql-test/suite/funcs_2/t/suite.opt b/mysql-test/suite/funcs_2/t/suite.opt
new file mode 100644
index 00000000000..9b22c677b83
--- /dev/null
+++ b/mysql-test/suite/funcs_2/t/suite.opt
@@ -0,0 +1,2 @@
+--secure-file-priv=$MYSQL_TEST_DIR
+
diff --git a/mysql-test/r/im_cmd_line.result b/mysql-test/suite/im/r/im_cmd_line.result
index a862d465904..a862d465904 100644
--- a/mysql-test/r/im_cmd_line.result
+++ b/mysql-test/suite/im/r/im_cmd_line.result
diff --git a/mysql-test/r/im_daemon_life_cycle.result b/mysql-test/suite/im/r/im_daemon_life_cycle.result
index b3afb15f207..b3afb15f207 100644
--- a/mysql-test/r/im_daemon_life_cycle.result
+++ b/mysql-test/suite/im/r/im_daemon_life_cycle.result
diff --git a/mysql-test/r/im_instance_conf.result b/mysql-test/suite/im/r/im_instance_conf.result
index d04ae0270ab..d04ae0270ab 100644
--- a/mysql-test/r/im_instance_conf.result
+++ b/mysql-test/suite/im/r/im_instance_conf.result
diff --git a/mysql-test/r/im_life_cycle.result b/mysql-test/suite/im/r/im_life_cycle.result
index dcabc8cf4f3..dcabc8cf4f3 100644
--- a/mysql-test/r/im_life_cycle.result
+++ b/mysql-test/suite/im/r/im_life_cycle.result
diff --git a/mysql-test/suite/im/r/im_options.result b/mysql-test/suite/im/r/im_options.result
new file mode 100644
index 00000000000..22bd5d5bdf6
--- /dev/null
+++ b/mysql-test/suite/im/r/im_options.result
@@ -0,0 +1,151 @@
+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
new file mode 100644
index 00000000000..586a5ab6a8d
--- /dev/null
+++ b/mysql-test/suite/im/r/im_utils.result
@@ -0,0 +1,96 @@
+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
new file mode 100644
index 00000000000..56828810bf1
--- /dev/null
+++ b/mysql-test/suite/im/t/disabled.def
@@ -0,0 +1,20 @@
+##############################################################################
+#
+# 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/include/im_check_env.inc b/mysql-test/suite/im/t/im_check_env.inc
index 883e5d00fe4..883e5d00fe4 100644
--- a/mysql-test/include/im_check_env.inc
+++ b/mysql-test/suite/im/t/im_check_env.inc
diff --git a/mysql-test/suite/im/t/im_cmd_line.imtest b/mysql-test/suite/im/t/im_cmd_line.imtest
new file mode 100644
index 00000000000..e8264b5bb8a
--- /dev/null
+++ b/mysql-test/suite/im/t/im_cmd_line.imtest
@@ -0,0 +1,68 @@
+###########################################################################
+#
+# 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/t/im_daemon_life_cycle-im.opt b/mysql-test/suite/im/t/im_daemon_life_cycle-im.opt
index 3a45c7a41f7..3a45c7a41f7 100644
--- a/mysql-test/t/im_daemon_life_cycle-im.opt
+++ b/mysql-test/suite/im/t/im_daemon_life_cycle-im.opt
diff --git a/mysql-test/suite/im/t/im_daemon_life_cycle.imtest b/mysql-test/suite/im/t/im_daemon_life_cycle.imtest
new file mode 100644
index 00000000000..c42ab89cc49
--- /dev/null
+++ b/mysql-test/suite/im/t/im_daemon_life_cycle.imtest
@@ -0,0 +1,100 @@
+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/t/im_instance_conf-im.opt b/mysql-test/suite/im/t/im_instance_conf-im.opt
index 34b74ce0c95..34b74ce0c95 100644
--- a/mysql-test/t/im_instance_conf-im.opt
+++ b/mysql-test/suite/im/t/im_instance_conf-im.opt
diff --git a/mysql-test/suite/im/t/im_instance_conf.imtest b/mysql-test/suite/im/t/im_instance_conf.imtest
new file mode 100644
index 00000000000..b667df41f98
--- /dev/null
+++ b/mysql-test/suite/im/t/im_instance_conf.imtest
@@ -0,0 +1,244 @@
+###########################################################################
+#
+# 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/t/im_life_cycle-im.opt b/mysql-test/suite/im/t/im_life_cycle-im.opt
index 34b74ce0c95..34b74ce0c95 100644
--- a/mysql-test/t/im_life_cycle-im.opt
+++ b/mysql-test/suite/im/t/im_life_cycle-im.opt
diff --git a/mysql-test/suite/im/t/im_life_cycle.imtest b/mysql-test/suite/im/t/im_life_cycle.imtest
new file mode 100644
index 00000000000..31f63d82505
--- /dev/null
+++ b/mysql-test/suite/im/t/im_life_cycle.imtest
@@ -0,0 +1,205 @@
+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/t/im_options-im.opt b/mysql-test/suite/im/t/im_options-im.opt
index 34b74ce0c95..34b74ce0c95 100644
--- a/mysql-test/t/im_options-im.opt
+++ b/mysql-test/suite/im/t/im_options-im.opt
diff --git a/mysql-test/suite/im/t/im_options.imtest b/mysql-test/suite/im/t/im_options.imtest
new file mode 100644
index 00000000000..d251b97d8e7
--- /dev/null
+++ b/mysql-test/suite/im/t/im_options.imtest
@@ -0,0 +1,248 @@
+###########################################################################
+#
+# 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/t/im_utils-im.opt b/mysql-test/suite/im/t/im_utils-im.opt
index 34b74ce0c95..34b74ce0c95 100644
--- a/mysql-test/t/im_utils-im.opt
+++ b/mysql-test/suite/im/t/im_utils-im.opt
diff --git a/mysql-test/suite/im/t/im_utils.imtest b/mysql-test/suite/im/t/im_utils.imtest
new file mode 100644
index 00000000000..b935634e96c
--- /dev/null
+++ b/mysql-test/suite/im/t/im_utils.imtest
@@ -0,0 +1,107 @@
+###########################################################################
+#
+# 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/t/kill_n_check.sh b/mysql-test/suite/im/t/kill_n_check.sh
index 6f2a0825dcd..6f2a0825dcd 100755
--- a/mysql-test/t/kill_n_check.sh
+++ b/mysql-test/suite/im/t/kill_n_check.sh
diff --git a/mysql-test/t/log.sh b/mysql-test/suite/im/t/log.sh
index 33ef6d6701f..33ef6d6701f 100755
--- a/mysql-test/t/log.sh
+++ b/mysql-test/suite/im/t/log.sh
diff --git a/mysql-test/t/utils.sh b/mysql-test/suite/im/t/utils.sh
index b3f4744947d..b3f4744947d 100644
--- a/mysql-test/t/utils.sh
+++ b/mysql-test/suite/im/t/utils.sh
diff --git a/mysql-test/t/wait_for_process.sh b/mysql-test/suite/im/t/wait_for_process.sh
index 2143ab2002f..2143ab2002f 100755
--- a/mysql-test/t/wait_for_process.sh
+++ b/mysql-test/suite/im/t/wait_for_process.sh
diff --git a/mysql-test/t/wait_for_socket.sh b/mysql-test/suite/im/t/wait_for_socket.sh
index 2fa7d5c5b7e..2fa7d5c5b7e 100755
--- a/mysql-test/t/wait_for_socket.sh
+++ b/mysql-test/suite/im/t/wait_for_socket.sh
diff --git a/mysql-test/suite/large_tests/README.TXT b/mysql-test/suite/large_tests/README.TXT
new file mode 100644
index 00000000000..51cd4e41a40
--- /dev/null
+++ b/mysql-test/suite/large_tests/README.TXT
@@ -0,0 +1,13 @@
+large_test suite
+================
+
+Iggy Galarza 07/20/07
+---------------------
+
+This test suite should include any test that requires:
+1. Longer than the default timeout to complete.
+2. A considerable amount of disk space.
+
+These tests can be completed with the following command:
+
+mysql-test-run.pl --suite=large_tests --big-test --suite-timeout=6360 --testcase-timeout=795
diff --git a/mysql-test/suite/large_tests/r/alter_table.result b/mysql-test/suite/large_tests/r/alter_table.result
new file mode 100644
index 00000000000..921711e9812
--- /dev/null
+++ b/mysql-test/suite/large_tests/r/alter_table.result
@@ -0,0 +1,37 @@
+drop table if exists t1;
+create table `t1` (`c1` tinyint unsigned not null, key `c1` (`c1`))
+engine=myisam default charset=utf8;
+alter table `t1` disable keys;
+insert into t1 values (1),(2),(3),(4);
+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;
+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;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1 limit 2147483647;
+alter table t1 enable keys;
+drop table t1;
diff --git a/mysql-test/suite/large_tests/t/alter_table.test b/mysql-test/suite/large_tests/t/alter_table.test
new file mode 100644
index 00000000000..61f0b34d904
--- /dev/null
+++ b/mysql-test/suite/large_tests/t/alter_table.test
@@ -0,0 +1,47 @@
+# The test for bug#27029 requires about 8 hours and 20 minutes on my
+# fastest machine. This test requires at least 60 GB of disk space.
+--source include/big_test.inc
+
+#
+# Bug#27029 alter table ... enable keys crashes mysqld on large table
+#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+create table `t1` (`c1` tinyint unsigned not null, key `c1` (`c1`))
+engine=myisam default charset=utf8;
+alter table `t1` disable keys;
+insert into t1 values (1),(2),(3),(4);
+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;
+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;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1 limit 2147483647; #Insert 4294967295 rows.
+alter table t1 enable keys;
+drop table t1;
diff --git a/mysql-test/r/loaddata_autocom_ndb.result b/mysql-test/suite/ndb/r/loaddata_autocom_ndb.result
index f98e6a76981..f98e6a76981 100644
--- a/mysql-test/r/loaddata_autocom_ndb.result
+++ b/mysql-test/suite/ndb/r/loaddata_autocom_ndb.result
diff --git a/mysql-test/suite/ndb/r/ndb_alter_table.result b/mysql-test/suite/ndb/r/ndb_alter_table.result
new file mode 100644
index 00000000000..5798db73403
--- /dev/null
+++ b/mysql-test/suite/ndb/r/ndb_alter_table.result
@@ -0,0 +1,401 @@
+DROP TABLE IF EXISTS t1, t2;
+drop database if exists mysqltest;
+CREATE TABLE t1 (
+a INT NOT NULL,
+b INT NOT NULL
+) ENGINE=ndbcluster;
+INSERT INTO t1 VALUES (9410,9412);
+ALTER TABLE t1 ADD COLUMN c int not null;
+SELECT * FROM t1;
+a b c
+9410 9412 0
+DROP TABLE t1;
+CREATE DATABASE mysqltest;
+USE mysqltest;
+CREATE TABLE t1 (
+a INT NOT NULL,
+b INT NOT NULL
+) ENGINE=ndbcluster;
+RENAME TABLE t1 TO test.t1;
+SHOW TABLES;
+Tables_in_mysqltest
+DROP DATABASE mysqltest;
+USE test;
+SHOW TABLES;
+Tables_in_test
+t1
+DROP TABLE t1;
+create table t1 (
+col1 int not null auto_increment primary key,
+col2 varchar(30) not null,
+col3 varchar (20) not null,
+col4 varchar(4) not null,
+col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null,
+col6 int not null, to_be_deleted int) ENGINE=ndbcluster;
+show table status;
+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
+t1 ndbcluster 10 Dynamic 0 # # # 0 # 1 # # # latin1_swedish_ci NULL #
+SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
+insert into t1 values
+(0,4,3,5,"PENDING",1,7),(NULL,4,3,5,"PENDING",1,7),(31,4,3,5,"PENDING",1,7), (7,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7), (100,4,3,5,"PENDING",1,7), (99,4,3,5,"PENDING",1,7), (8,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7);
+show table status;
+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
+t1 ndbcluster 10 Dynamic 9 # # # 0 # 102 # # # latin1_swedish_ci NULL #
+select * from t1 order by col1;
+col1 col2 col3 col4 col5 col6 to_be_deleted
+0 4 3 5 PENDING 1 7
+1 4 3 5 PENDING 1 7
+7 4 3 5 PENDING 1 7
+8 4 3 5 PENDING 1 7
+31 4 3 5 PENDING 1 7
+32 4 3 5 PENDING 1 7
+99 4 3 5 PENDING 1 7
+100 4 3 5 PENDING 1 7
+101 4 3 5 PENDING 1 7
+alter table t1
+add column col4_5 varchar(20) not null after col4,
+add column col7 varchar(30) not null after col5,
+add column col8 datetime not null, drop column to_be_deleted,
+change column col2 fourth varchar(30) not null after col3,
+modify column col6 int not null first;
+show table status;
+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
+t1 ndbcluster 10 Dynamic 9 # # # 0 # 102 # # # latin1_swedish_ci NULL #
+select * from t1 order by col1;
+col6 col1 col3 fourth col4 col4_5 col5 col7 col8
+1 0 3 4 5 PENDING 0000-00-00 00:00:00
+1 1 3 4 5 PENDING 0000-00-00 00:00:00
+1 7 3 4 5 PENDING 0000-00-00 00:00:00
+1 8 3 4 5 PENDING 0000-00-00 00:00:00
+1 31 3 4 5 PENDING 0000-00-00 00:00:00
+1 32 3 4 5 PENDING 0000-00-00 00:00:00
+1 99 3 4 5 PENDING 0000-00-00 00:00:00
+1 100 3 4 5 PENDING 0000-00-00 00:00:00
+1 101 3 4 5 PENDING 0000-00-00 00:00:00
+insert into t1 values (2, NULL,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00');
+show table status;
+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
+t1 ndbcluster 10 Dynamic 10 # # # 0 # 103 # # # latin1_swedish_ci NULL #
+select * from t1 order by col1;
+col6 col1 col3 fourth col4 col4_5 col5 col7 col8
+1 0 3 4 5 PENDING 0000-00-00 00:00:00
+1 1 3 4 5 PENDING 0000-00-00 00:00:00
+1 7 3 4 5 PENDING 0000-00-00 00:00:00
+1 8 3 4 5 PENDING 0000-00-00 00:00:00
+1 31 3 4 5 PENDING 0000-00-00 00:00:00
+1 32 3 4 5 PENDING 0000-00-00 00:00:00
+1 99 3 4 5 PENDING 0000-00-00 00:00:00
+1 100 3 4 5 PENDING 0000-00-00 00:00:00
+1 101 3 4 5 PENDING 0000-00-00 00:00:00
+2 102 4 3 5 99 PENDING EXTRA 2004-01-01 00:00:00
+delete from t1;
+insert into t1 values (0,0,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00');
+SET SQL_MODE='';
+insert into t1 values (1,0,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00');
+select * from t1 order by col1;
+col6 col1 col3 fourth col4 col4_5 col5 col7 col8
+0 0 4 3 5 99 PENDING EXTRA 2004-01-01 00:00:00
+1 103 4 3 5 99 PENDING EXTRA 2004-01-01 00:00:00
+alter table t1 drop column col4_5;
+insert into t1 values (2,0,4,3,5,"PENDING","EXTRA",'2004-01-01 00:00:00');
+select * from t1 order by col1;
+col6 col1 col3 fourth col4 col5 col7 col8
+0 0 4 3 5 PENDING EXTRA 2004-01-01 00:00:00
+1 103 4 3 5 PENDING EXTRA 2004-01-01 00:00:00
+2 104 4 3 5 PENDING EXTRA 2004-01-01 00:00:00
+drop table t1;
+CREATE TABLE t1 (
+a INT NOT NULL,
+b INT NOT NULL
+) ENGINE=ndbcluster;
+INSERT INTO t1 VALUES (9410,9412);
+ALTER TABLE t1 ADD COLUMN c int not null;
+select * from t1 order by a;
+a b c
+9410 9412 0
+select * from t1 order by a;
+a b c
+9410 9412 0
+alter table t1 drop c;
+select * from t1 order by a;
+a b
+9410 9412
+drop table t1;
+select * from t1 order by a;
+ERROR 42S02: Table 'test.t1' doesn't exist
+CREATE TABLE t1 (
+a INT NOT NULL PRIMARY KEY,
+b INT NOT NULL
+) ENGINE=ndbcluster;
+INSERT INTO t1 VALUES (0,1),(17,18);
+select * from t1 order by a;
+a b
+0 1
+17 18
+SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
+alter table t1 modify column a int not null auto_increment;
+SET SQL_MODE='';
+select * from t1 order by a;
+a b
+0 1
+17 18
+INSERT INTO t1 VALUES (0,19),(20,21);
+select * from t1 order by a;
+a b
+0 1
+17 18
+18 19
+20 21
+drop table t1;
+CREATE TABLE t1 (
+a INT NOT NULL PRIMARY KEY,
+b INT NOT NULL
+) ENGINE=ndbcluster;
+INSERT INTO t1 VALUES (0,1),(17,18);
+select * from t1 order by a;
+a b
+0 1
+17 18
+alter table t1 add c int not null unique auto_increment;
+select c from t1 order by c;
+c
+1
+2
+INSERT INTO t1 VALUES (1,2,0),(18,19,4),(20,21,0);
+select c from t1 order by c;
+c
+1
+2
+3
+4
+5
+drop table t1;
+create table t1 (
+ai bigint auto_increment,
+c001 int(11) not null,
+c002 int(11) not null,
+c003 int(11) not null,
+c004 int(11) not null,
+c005 int(11) not null,
+c006 int(11) not null,
+c007 int(11) not null,
+c008 int(11) not null,
+c009 int(11) not null,
+c010 int(11) not null,
+c011 int(11) not null,
+c012 int(11) not null,
+c013 int(11) not null,
+c014 int(11) not null,
+c015 int(11) not null,
+c016 int(11) not null,
+c017 int(11) not null,
+c018 int(11) not null,
+c019 int(11) not null,
+c020 int(11) not null,
+c021 int(11) not null,
+c022 int(11) not null,
+c023 int(11) not null,
+c024 int(11) not null,
+c025 int(11) not null,
+c026 int(11) not null,
+c027 int(11) not null,
+c028 int(11) not null,
+c029 int(11) not null,
+c030 int(11) not null,
+c031 int(11) not null,
+c032 int(11) not null,
+c033 int(11) not null,
+c034 int(11) not null,
+c035 int(11) not null,
+c036 int(11) not null,
+c037 int(11) not null,
+c038 int(11) not null,
+c039 int(11) not null,
+c040 int(11) not null,
+c041 int(11) not null,
+c042 int(11) not null,
+c043 int(11) not null,
+c044 int(11) not null,
+c045 int(11) not null,
+c046 int(11) not null,
+c047 int(11) not null,
+c048 int(11) not null,
+c049 int(11) not null,
+c050 int(11) not null,
+c051 int(11) not null,
+c052 int(11) not null,
+c053 int(11) not null,
+c054 int(11) not null,
+c055 int(11) not null,
+c056 int(11) not null,
+c057 int(11) not null,
+c058 int(11) not null,
+c059 int(11) not null,
+c060 int(11) not null,
+c061 int(11) not null,
+c062 int(11) not null,
+c063 int(11) not null,
+c064 int(11) not null,
+c065 int(11) not null,
+c066 int(11) not null,
+c067 int(11) not null,
+c068 int(11) not null,
+c069 int(11) not null,
+c070 int(11) not null,
+c071 int(11) not null,
+c072 int(11) not null,
+c073 int(11) not null,
+c074 int(11) not null,
+c075 int(11) not null,
+c076 int(11) not null,
+c077 int(11) not null,
+c078 int(11) not null,
+c079 int(11) not null,
+c080 int(11) not null,
+c081 int(11) not null,
+c082 int(11) not null,
+c083 int(11) not null,
+c084 int(11) not null,
+c085 int(11) not null,
+c086 int(11) not null,
+c087 int(11) not null,
+c088 int(11) not null,
+c089 int(11) not null,
+c090 int(11) not null,
+c091 int(11) not null,
+c092 int(11) not null,
+c093 int(11) not null,
+c094 int(11) not null,
+c095 int(11) not null,
+c096 int(11) not null,
+c097 int(11) not null,
+c098 int(11) not null,
+c099 int(11) not null,
+c100 int(11) not null,
+c101 int(11) not null,
+c102 int(11) not null,
+c103 int(11) not null,
+c104 int(11) not null,
+c105 int(11) not null,
+c106 int(11) not null,
+c107 int(11) not null,
+c108 int(11) not null,
+c109 int(11) not null,
+primary key (ai),
+unique key tx1 (c002, c003, c004, c005)) engine=ndb;
+create index tx2
+on t1 (c010, c011, c012, c013);
+drop table t1;
+CREATE TABLE t1 (
+auto int(5) unsigned NOT NULL auto_increment,
+string char(10),
+vstring varchar(10),
+bin binary(2),
+vbin varbinary(7),
+tiny tinyint(4) DEFAULT '0' NOT NULL ,
+short smallint(6) DEFAULT '1' NOT NULL ,
+medium mediumint(8) DEFAULT '0' NOT NULL,
+long_int int(11) DEFAULT '0' NOT NULL,
+longlong bigint(13) DEFAULT '0' NOT NULL,
+real_float float(13,1) DEFAULT 0.0 NOT NULL,
+real_double double(16,4),
+real_decimal decimal(16,4),
+utiny tinyint(3) unsigned DEFAULT '0' NOT NULL,
+ushort smallint(5) unsigned zerofill DEFAULT '00000' NOT NULL,
+umedium mediumint(8) unsigned DEFAULT '0' NOT NULL,
+ulong int(11) unsigned DEFAULT '0' NOT NULL,
+ulonglong bigint(13) unsigned DEFAULT '0' NOT NULL,
+bits bit(3),
+options enum('zero','one','two','three','four') not null,
+flags set('zero','one','two','three','four') not null,
+date_field date,
+year_field year,
+time_field time,
+date_time datetime,
+time_stamp timestamp,
+PRIMARY KEY (auto)
+) engine=ndb;
+CREATE TEMPORARY TABLE ndb_show_tables (id INT, type VARCHAR(20), state VARCHAR(20), logging VARCHAR(20), _database VARCHAR(255), _schema VARCHAR(20), name VARCHAR(255));
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+set @t1_id = (select id from ndb_show_tables where name like '%t1%');
+truncate ndb_show_tables;
+alter table t1 change tiny new_tiny tinyint(4) DEFAULT '0' NOT NULL;
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+select 'no_copy' from ndb_show_tables where id = @t1_id and name like '%t1%';
+no_copy
+set @t1_id = (select id from ndb_show_tables where name like '%t1%');
+truncate ndb_show_tables;
+create index i1 on t1(medium);
+alter table t1 add index i2(new_tiny);
+drop index i1 on t1;
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+select 'no_copy' from ndb_show_tables where id = @t1_id and name like '%t1%';
+no_copy
+no_copy
+DROP TABLE t1, ndb_show_tables;
+create table t1 (a int primary key auto_increment, b int) engine=ndb;
+insert into t1 (b) values (101),(102),(103);
+select * from t1 where a = 3;
+a b
+3 103
+alter table t1 rename t2;
+insert into t2 (b) values (201),(202),(203);
+select * from t2 where a = 6;
+a b
+6 203
+alter table t2 add c int;
+insert into t2 (b) values (301),(302),(303);
+select * from t2 where a = 9;
+a b c
+9 303 NULL
+alter table t2 rename t1;
+insert into t1 (b) values (401),(402),(403);
+select * from t1 where a = 12;
+a b c
+12 403 NULL
+drop table t1;
+create table t1 (a int not null, b varchar(10)) engine=ndb;
+show index from t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+alter table t1 add primary key (a);
+show index from t1;
+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 0 NULL NULL BTREE
+alter table t1 drop primary key;
+show index from t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+drop table t1;
+create table t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ `b` int(11) NOT NULL DEFAULT '0',
+ `c` varchar(254) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+alter table t1 alter b set default 1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ `b` int(11) NOT NULL DEFAULT '1',
+ `c` varchar(254) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 (a int not null, b int not null) engine=ndb;
+insert into t1 values (1, 300), (2, 200), (3, 100);
+select * from t1 order by a;
+a b
+1 300
+2 200
+3 100
+alter table t1 order by b;
+select * from t1 order by b;
+a b
+3 100
+2 200
+1 300
+drop table t1;
+End of 5.1 tests
diff --git a/mysql-test/r/ndb_alter_table2.result b/mysql-test/suite/ndb/r/ndb_alter_table2.result
index 3783c76447c..3783c76447c 100644
--- a/mysql-test/r/ndb_alter_table2.result
+++ b/mysql-test/suite/ndb/r/ndb_alter_table2.result
diff --git a/mysql-test/r/ndb_alter_table3.result b/mysql-test/suite/ndb/r/ndb_alter_table3.result
index ee7c9b1c7b0..ee7c9b1c7b0 100644
--- a/mysql-test/r/ndb_alter_table3.result
+++ b/mysql-test/suite/ndb/r/ndb_alter_table3.result
diff --git a/mysql-test/suite/ndb/r/ndb_backup_print.result b/mysql-test/suite/ndb/r/ndb_backup_print.result
new file mode 100644
index 00000000000..7fa073bafb5
--- /dev/null
+++ b/mysql-test/suite/ndb/r/ndb_backup_print.result
@@ -0,0 +1,65 @@
+use test;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
+Connected to Management Server at: :
+Waiting for completed, this may take several minutes
+Node : Backup started from node
+Node : Backup started from node completed
+ StartGCP: StopGCP:
+ #Records: #LogRecords:
+ Data: bytes Log: bytes
+create table t1
+(pk int key
+,a1 BIT(1), a2 BIT(5), a3 BIT(33), a4 BIT(63), a5 BIT(64)
+,b1 TINYINT, b2 TINYINT UNSIGNED
+,c1 SMALLINT, c2 SMALLINT UNSIGNED
+,d1 INT, d2 INT UNSIGNED
+,e1 BIGINT, e2 BIGINT UNSIGNED
+,f1 CHAR(1) BINARY, f2 CHAR(32) BINARY, f3 CHAR(255) BINARY
+,g1 VARCHAR(32) BINARY, g2 VARCHAR(255) BINARY, g3 VARCHAR(1000) BINARY
+,h1 BINARY(1), h2 BINARY(8), h3 BINARY(255)
+,i1 VARBINARY(32), i2 VARBINARY(255), i3 VARBINARY(1000)
+) engine ndb;
+insert into t1 values
+(1
+,0x1, 0x17, 0x789a, 0x789abcde, 0xfedc0001
+,127, 255
+,32767, 65535
+,2147483647, 4294967295
+,9223372036854775807, 18446744073709551615
+,'1','12345678901234567890123456789012','123456789'
+ ,'1','12345678901234567890123456789012','123456789'
+ ,0x12,0x123456789abcdef0, 0x012345
+,0x12,0x123456789abcdef0, 0x00123450
+);
+insert into t1 values
+(2
+,0, 0, 0, 0, 0
+,-128, 0
+,-32768, 0
+,-2147483648, 0
+,-9223372036854775808, 0
+,'','',''
+ ,'','',''
+ ,0x0,0x0,0x0
+,0x0,0x0,0x0
+);
+insert into t1 values
+(3
+,NULL,NULL,NULL,NULL,NULL
+,NULL,NULL
+,NULL,NULL
+,NULL,NULL
+,NULL,NULL
+,NULL,NULL,NULL
+,NULL,NULL,NULL
+,NULL,NULL,NULL
+,NULL,NULL,NULL
+);
+Connected to Management Server at: :
+Waiting for completed, this may take several minutes
+Node : Backup started from node
+Node : Backup started from node completed
+ StartGCP: StopGCP:
+ #Records: #LogRecords:
+ Data: bytes Log: bytes
+drop table t1;
diff --git a/mysql-test/suite/ndb/r/ndb_basic.result b/mysql-test/suite/ndb/r/ndb_basic.result
new file mode 100644
index 00000000000..4eddaeb1227
--- /dev/null
+++ b/mysql-test/suite/ndb/r/ndb_basic.result
@@ -0,0 +1,901 @@
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7;
+drop database if exists mysqltest;
+CREATE TABLE t1 (
+pk1 INT NOT NULL PRIMARY KEY,
+attr1 INT NOT NULL,
+attr2 INT,
+attr3 VARCHAR(10)
+) ENGINE=ndbcluster;
+drop table t1;
+SHOW GLOBAL STATUS LIKE 'ndb%';
+Variable_name Value
+Ndb_cluster_node_id #
+Ndb_config_from_host #
+Ndb_config_from_port #
+Ndb_number_of_data_nodes #
+SHOW GLOBAL VARIABLES LIKE 'ndb%';
+Variable_name Value
+ndb_autoincrement_prefetch_sz #
+ndb_cache_check_time #
+ndb_connectstring #
+ndb_extra_logging #
+ndb_force_send #
+ndb_index_stat_cache_entries #
+ndb_index_stat_enable #
+ndb_index_stat_update_freq #
+ndb_report_thresh_binlog_epoch_slip #
+ndb_report_thresh_binlog_mem_usage #
+ndb_use_copying_alter_table #
+ndb_use_exact_count #
+ndb_use_transactions #
+CREATE TABLE t1 (
+pk1 INT NOT NULL PRIMARY KEY,
+attr1 INT NOT NULL,
+attr2 INT,
+attr3 VARCHAR(10)
+) ENGINE=ndbcluster;
+SHOW INDEX FROM t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+t1 0 PRIMARY 1 pk1 A 0 NULL NULL BTREE
+INSERT INTO t1 VALUES (9410,9412, NULL, '9412'), (9411,9413, 17, '9413');
+SHOW INDEX FROM t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+t1 0 PRIMARY 1 pk1 A 2 NULL NULL BTREE
+SELECT pk1 FROM t1 ORDER BY pk1;
+pk1
+9410
+9411
+SELECT * FROM t1 ORDER BY pk1;
+pk1 attr1 attr2 attr3
+9410 9412 NULL 9412
+9411 9413 17 9413
+SELECT t1.* FROM t1 ORDER BY pk1;
+pk1 attr1 attr2 attr3
+9410 9412 NULL 9412
+9411 9413 17 9413
+UPDATE t1 SET attr1=1 WHERE pk1=9410;
+SELECT * FROM t1 ORDER BY pk1;
+pk1 attr1 attr2 attr3
+9410 1 NULL 9412
+9411 9413 17 9413
+UPDATE t1 SET pk1=2 WHERE attr1=1;
+SELECT * FROM t1 ORDER BY pk1;
+pk1 attr1 attr2 attr3
+2 1 NULL 9412
+9411 9413 17 9413
+UPDATE t1 SET pk1=pk1 + 1;
+SELECT * FROM t1 ORDER BY pk1;
+pk1 attr1 attr2 attr3
+3 1 NULL 9412
+9412 9413 17 9413
+UPDATE t1 SET pk1=4 WHERE pk1 = 3;
+SELECT * FROM t1 ORDER BY pk1;
+pk1 attr1 attr2 attr3
+4 1 NULL 9412
+9412 9413 17 9413
+DELETE FROM t1;
+SELECT * FROM t1;
+pk1 attr1 attr2 attr3
+INSERT INTO t1 VALUES (9410,9412, NULL, '9412'), (9408, 8765, NULL, '8765'),
+(7,8, NULL, NULL), (8,9, NULL, NULL), (9,10, NULL, NULL), (10,11, NULL, NULL), (11,12, NULL, NULL), (12,13, NULL, NULL), (13,14, NULL, NULL);
+UPDATE t1 SET attr1 = 9999;
+SELECT * FROM t1 ORDER BY pk1;
+pk1 attr1 attr2 attr3
+7 9999 NULL NULL
+8 9999 NULL NULL
+9 9999 NULL NULL
+10 9999 NULL NULL
+11 9999 NULL NULL
+12 9999 NULL NULL
+13 9999 NULL NULL
+9408 9999 NULL 8765
+9410 9999 NULL 9412
+UPDATE t1 SET attr1 = 9998 WHERE pk1 < 1000;
+SELECT * FROM t1 ORDER BY pk1;
+pk1 attr1 attr2 attr3
+7 9998 NULL NULL
+8 9998 NULL NULL
+9 9998 NULL NULL
+10 9998 NULL NULL
+11 9998 NULL NULL
+12 9998 NULL NULL
+13 9998 NULL NULL
+9408 9999 NULL 8765
+9410 9999 NULL 9412
+UPDATE t1 SET attr1 = 9997 WHERE attr1 = 9999;
+SELECT * FROM t1 ORDER BY pk1;
+pk1 attr1 attr2 attr3
+7 9998 NULL NULL
+8 9998 NULL NULL
+9 9998 NULL NULL
+10 9998 NULL NULL
+11 9998 NULL NULL
+12 9998 NULL NULL
+13 9998 NULL NULL
+9408 9997 NULL 8765
+9410 9997 NULL 9412
+DELETE FROM t1 WHERE pk1 = 9410;
+SELECT * FROM t1 ORDER BY pk1;
+pk1 attr1 attr2 attr3
+7 9998 NULL NULL
+8 9998 NULL NULL
+9 9998 NULL NULL
+10 9998 NULL NULL
+11 9998 NULL NULL
+12 9998 NULL NULL
+13 9998 NULL NULL
+9408 9997 NULL 8765
+DELETE FROM t1;
+SELECT * FROM t1;
+pk1 attr1 attr2 attr3
+INSERT INTO t1 values (1, 4, NULL, NULL), (2, 4, NULL, NULL), (3, 5, NULL, NULL), (4, 4, NULL, NULL), (5, 5, NULL, NULL);
+DELETE FROM t1 WHERE attr1=4;
+SELECT * FROM t1 order by pk1;
+pk1 attr1 attr2 attr3
+3 5 NULL NULL
+5 5 NULL NULL
+DELETE FROM t1;
+INSERT INTO t1 VALUES (9410,9412, NULL, NULL), (9411, 9413, NULL, NULL);
+DELETE FROM t1 WHERE pk1 = 9410;
+SELECT * FROM t1;
+pk1 attr1 attr2 attr3
+9411 9413 NULL NULL
+DROP TABLE t1;
+CREATE TABLE t1 (id INT, id2 int) engine=ndbcluster;
+INSERT INTO t1 values(3456, 7890);
+SELECT * FROM t1;
+id id2
+3456 7890
+UPDATE t1 SET id=2 WHERE id2=12;
+SELECT * FROM t1;
+id id2
+3456 7890
+UPDATE t1 SET id=1234 WHERE id2=7890;
+SELECT * FROM t1;
+id id2
+1234 7890
+DELETE FROM t1;
+INSERT INTO t1 values(3456, 7890), (3456, 7890), (3456, 7890), (3454, 7890);
+SELECT * FROM t1 ORDER BY id;
+id id2
+3454 7890
+3456 7890
+3456 7890
+3456 7890
+DELETE FROM t1 WHERE id = 3456;
+SELECT * FROM t1 ORDER BY id;
+id id2
+3454 7890
+DROP TABLE t1;
+CREATE TABLE t1 (
+pk1 INT NOT NULL PRIMARY KEY,
+attr1 INT NOT NULL
+) ENGINE=NDBCLUSTER;
+INSERT INTO t1 values(1, 9999);
+DROP TABLE t1;
+CREATE TABLE t1 (
+pk1 INT NOT NULL PRIMARY KEY,
+attr1 INT NOT NULL
+) ENGINE=NDB;
+INSERT INTO t1 values(1, 9999);
+DROP TABLE t1;
+CREATE TABLE t2 (
+a bigint unsigned NOT NULL PRIMARY KEY,
+b int unsigned not null,
+c int unsigned
+) engine=ndbcluster;
+CREATE TABLE t3 (
+a bigint unsigned NOT NULL,
+b bigint unsigned not null,
+c bigint unsigned,
+PRIMARY KEY(a)
+) engine=ndbcluster;
+CREATE TABLE t4 (
+a bigint unsigned NOT NULL,
+b bigint unsigned not null,
+c bigint unsigned NOT NULL,
+d int unsigned,
+PRIMARY KEY(a, b, c)
+) engine=ndbcluster;
+select * from t2 where a = 7 order by b;
+a b c
+7 16 5
+select * from t2 where a = 7 order by a;
+a b c
+7 16 5
+select * from t2 where a = 7 order by 2;
+a b c
+7 16 5
+select * from t2 where a = 7 order by c;
+a b c
+7 16 5
+select * from t2 where a = 7 and b = 16 order by b;
+a b c
+7 16 5
+select * from t2 where a = 7 and b = 16 order by a;
+a b c
+7 16 5
+select * from t2 where a = 7 and b = 17 order by a;
+a b c
+select * from t2 where a = 7 and b != 16 order by b;
+a b c
+select * from t2 where a = 7 and b = 16 and c = 5 order by b;
+a b c
+7 16 5
+select * from t2 where a = 7 and b = 16 and c = 5 order by a;
+a b c
+7 16 5
+select * from t2 where a = 7 and b = 16 and c = 6 order by a;
+a b c
+select * from t2 where a = 7 and b != 16 and c = 5 order by b;
+a b c
+select * from t3 where a = 7 order by b;
+a b c
+7 16 5
+select * from t3 where a = 7 order by a;
+a b c
+7 16 5
+select * from t3 where a = 7 order by 2;
+a b c
+7 16 5
+select * from t3 where a = 7 order by c;
+a b c
+7 16 5
+select * from t3 where a = 7 and b = 16 order by b;
+a b c
+7 16 5
+select * from t3 where a = 7 and b = 16 order by a;
+a b c
+7 16 5
+select * from t3 where a = 7 and b = 17 order by a;
+a b c
+select * from t3 where a = 7 and b != 16 order by b;
+a b c
+select * from t4 where a = 7 order by b;
+a b c d
+7 16 5 26007
+select * from t4 where a = 7 order by a;
+a b c d
+7 16 5 26007
+select * from t4 where a = 7 order by 2;
+a b c d
+7 16 5 26007
+select * from t4 where a = 7 order by c;
+a b c d
+7 16 5 26007
+select * from t4 where a = 7 and b = 16 order by b;
+a b c d
+7 16 5 26007
+select * from t4 where a = 7 and b = 16 order by a;
+a b c d
+7 16 5 26007
+select * from t4 where a = 7 and b = 17 order by a;
+a b c d
+select * from t4 where a = 7 and b != 16 order by b;
+a b c d
+delete from t2 where a > 5;
+select x1.a, x1.b from t2 x1, t2 x2 where x1.b = x2.b order by x1.a;
+a b
+1 10
+3 12
+5 14
+select a, b FROM t2 outer_table where
+a = (select a from t2 where b = outer_table.b ) order by a;
+a b
+1 10
+3 12
+5 14
+delete from t2;
+delete from t3;
+delete from t4;
+drop table t2;
+drop table t3;
+drop table t4;
+CREATE TABLE t5 (
+a bigint unsigned NOT NULL,
+b bigint unsigned not null,
+c bigint unsigned NOT NULL,
+d int unsigned,
+PRIMARY KEY(a, b, c)
+) engine=ndbcluster;
+insert into t5 values(10, 19, 5, 26010);
+delete from t5 where a=10 and b=19 and c=5;
+select * from t5;
+a b c d
+insert into t5 values(10, 19, 5, 26010);
+update t5 set d=21997 where a=10 and b=19 and c=5;
+select * from t5;
+a b c d
+10 19 5 21997
+delete from t5;
+drop table t5;
+CREATE TABLE t6 (
+adress char(255),
+a int NOT NULL PRIMARY KEY,
+b int
+) engine = NDB;
+insert into t6 values
+("Nice road 3456", 1, 23),
+("Street Road 78", 3, 92),
+("Road street 89C", 5, 71),
+(NULL, 7, NULL);
+select * from t6 order by a;
+adress a b
+Nice road 3456 1 23
+Street Road 78 3 92
+Road street 89C 5 71
+NULL 7 NULL
+select a, b from t6 order by a;
+a b
+1 23
+3 92
+5 71
+7 NULL
+update t6 set adress="End of road 09" where a=3;
+update t6 set b=181, adress="Street 76" where a=7;
+select * from t6 order by a;
+adress a b
+Nice road 3456 1 23
+End of road 09 3 92
+Road street 89C 5 71
+Street 76 7 181
+select * from t6 where a=1;
+adress a b
+Nice road 3456 1 23
+delete from t6 where a=1;
+select * from t6 order by a;
+adress a b
+End of road 09 3 92
+Road street 89C 5 71
+Street 76 7 181
+delete from t6 where b=71;
+select * from t6 order by a;
+adress a b
+End of road 09 3 92
+Street 76 7 181
+drop table t6;
+CREATE TABLE t7 (
+adress char(255),
+a int NOT NULL,
+b int,
+c int NOT NULL,
+PRIMARY KEY(a, c)
+) engine = NDB;
+insert into t7 values
+("Highway 3456", 1, 23, 2),
+("Street Road 78", 3, 92, 3),
+("Main street 89C", 5, 71, 4),
+(NULL, 8, NULL, 12);
+select * from t7 order by a;
+adress a b c
+Highway 3456 1 23 2
+Street Road 78 3 92 3
+Main street 89C 5 71 4
+NULL 8 NULL 12
+select a, b from t7 order by a;
+a b
+1 23
+3 92
+5 71
+8 NULL
+update t7 set adress="End of road 09" where a=3;
+update t7 set adress="Gatuvägen 90C" where a=5 and c=4;
+update t7 set adress="No adress" where adress is NULL;
+select * from t7 order by a;
+adress a b c
+Highway 3456 1 23 2
+End of road 09 3 92 3
+Gatuvägen 90C 5 71 4
+No adress 8 NULL 12
+select * from t7 where a=1 and c=2;
+adress a b c
+Highway 3456 1 23 2
+delete from t7 where a=1;
+delete from t7 where a=3 and c=3;
+delete from t7 where a=5 and c=4;
+select * from t7;
+adress a b c
+No adress 8 NULL 12
+delete from t7 where b=23;
+select * from t7;
+adress a b c
+No adress 8 NULL 12
+drop table t7;
+CREATE TABLE t1 (
+pk1 INT NOT NULL PRIMARY KEY,
+attr1 INT NOT NULL,
+attr2 INT,
+attr3 VARCHAR(10)
+) ENGINE=ndbcluster;
+INSERT INTO t1 VALUES (9410,9412, NULL, '9412'), (9411,9413, 17, '9413');
+create database mysqltest;
+use mysqltest;
+CREATE TABLE t2 (
+a bigint unsigned NOT NULL PRIMARY KEY,
+b int unsigned not null,
+c int unsigned
+) engine=ndbcluster;
+insert into t2 select pk1,attr1,attr2 from test.t1;
+select * from t2 order by a;
+a b c
+9410 9412 NULL
+9411 9413 17
+select b from test.t1, t2 where c = test.t1.attr2;
+b
+9413
+select b,test.t1.attr1 from test.t1, t2 where test.t1.pk1 < a;
+b attr1
+9413 9412
+drop table test.t1, t2;
+drop database mysqltest;
+drop database if exists ndbtest1;
+create database ndbtest1;
+use ndbtest1;
+create table t1(id int) engine=ndbcluster;
+drop database ndbtest1;
+drop database ndbtest1;
+ERROR HY000: Can't drop database 'ndbtest1'; database doesn't exist
+use test;
+create table t1 (a int primary key, b char(0));
+insert into t1 values (1,"");
+insert into t1 values (2,NULL);
+select * from t1 order by a;
+a b
+1
+2 NULL
+select * from t1 order by b;
+a b
+2 NULL
+1
+select * from t1 where b IS NULL;
+a b
+2 NULL
+select * from t1 where b IS NOT NULL;
+a b
+1
+drop table t1;
+create table t1 (
+c1 int,
+c2 int,
+c3 int,
+c4 int,
+c5 int,
+c6 int,
+c7 int,
+c8 int,
+c9 int,
+c10 int,
+c11 int,
+c12 int,
+c13 int,
+c14 int,
+c15 int,
+c16 int,
+c17 int,
+c18 int,
+c19 int,
+c20 int,
+c21 int,
+c22 int,
+c23 int,
+c24 int,
+c25 int,
+c26 int,
+c27 int,
+c28 int,
+c29 int,
+c30 int,
+c31 int,
+c32 int,
+c33 int,
+c34 int,
+c35 int,
+c36 int,
+c37 int,
+c38 int,
+c39 int,
+c40 int,
+c41 int,
+c42 int,
+c43 int,
+c44 int,
+c45 int,
+c46 int,
+c47 int,
+c48 int,
+c49 int,
+c50 int,
+c51 int,
+c52 int,
+c53 int,
+c54 int,
+c55 int,
+c56 int,
+c57 int,
+c58 int,
+c59 int,
+c60 int,
+c61 int,
+c62 int,
+c63 int,
+c64 int,
+c65 int,
+c66 int,
+c67 int,
+c68 int,
+c69 int,
+c70 int,
+c71 int,
+c72 int,
+c73 int,
+c74 int,
+c75 int,
+c76 int,
+c77 int,
+c78 int,
+c79 int,
+c80 int,
+c81 int,
+c82 int,
+c83 int,
+c84 int,
+c85 int,
+c86 int,
+c87 int,
+c88 int,
+c89 int,
+c90 int,
+c91 int,
+c92 int,
+c93 int,
+c94 int,
+c95 int,
+c96 int,
+c97 int,
+c98 int,
+c99 int,
+c100 int,
+c101 int,
+c102 int,
+c103 int,
+c104 int,
+c105 int,
+c106 int,
+c107 int,
+c108 int,
+c109 int,
+c110 int,
+c111 int,
+c112 int,
+c113 int,
+c114 int,
+c115 int,
+c116 int,
+c117 int,
+c118 int,
+c119 int,
+c120 int,
+c121 int,
+c122 int,
+c123 int,
+c124 int,
+c125 int,
+c126 int,
+c127 int,
+c128 int,
+primary key using hash(c1)) engine=ndb partition by key(c1);
+drop table t1;
+create table t1 (
+a1234567890123456789012345678901234567890 int primary key,
+a12345678901234567890123456789a1234567890 int,
+index(a12345678901234567890123456789a1234567890)
+) engine=ndb;
+show tables;
+Tables_in_test
+t1
+insert into t1 values (1,1),(2,1),(3,1),(4,1),(5,2),(6,1),(7,1);
+explain select * from t1 where a12345678901234567890123456789a1234567890=2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a12345678901234567890123456789a1234567890 a12345678901234567890123456789a1234567890 5 const # Using where with pushed condition
+select * from t1 where a12345678901234567890123456789a1234567890=2;
+a1234567890123456789012345678901234567890 a12345678901234567890123456789a1234567890
+5 2
+drop table t1;
+create table t1
+(a bigint, b bigint, c bigint, d bigint,
+primary key (a,b,c,d))
+engine=ndb
+max_rows=800000000;
+Warnings:
+Warning 1105 Ndb might have problems storing the max amount of rows specified
+insert into t1 values
+(1,2,3,4),(2,3,4,5),(3,4,5,6),
+(3,2,3,4),(1,3,4,5),(2,4,5,6),
+(1,2,3,5),(2,3,4,8),(3,4,5,9),
+(3,2,3,5),(1,3,4,8),(2,4,5,9),
+(1,2,3,6),(2,3,4,6),(3,4,5,7),
+(3,2,3,6),(1,3,4,6),(2,4,5,7),
+(1,2,3,7),(2,3,4,7),(3,4,5,8),
+(3,2,3,7),(1,3,4,7),(2,4,5,8),
+(1,3,3,4),(2,4,4,5),(3,5,5,6),
+(3,3,3,4),(1,4,4,5),(2,5,5,6),
+(1,3,3,5),(2,4,4,8),(3,5,5,9),
+(3,3,3,5),(1,4,4,8),(2,5,5,9),
+(1,3,3,6),(2,4,4,6),(3,5,5,7),
+(3,3,3,6),(1,4,4,6),(2,5,5,7),
+(1,3,3,7),(2,4,4,7),(3,5,5,8),
+(3,3,3,7),(1,4,4,7),(2,5,5,8);
+select count(*) from t1;
+count(*)
+48
+drop table t1;
+create table t1
+(a bigint, b bigint, c bigint, d bigint,
+primary key (a))
+engine=ndb
+max_rows=1;
+drop table t1;
+create table t1
+(counter int(64) NOT NULL auto_increment,
+datavalue char(40) default 'XXXX',
+primary key (counter)
+) ENGINE=ndbcluster;
+insert into t1 (datavalue) values ('newval');
+insert into t1 (datavalue) values ('newval');
+select * from t1 order by counter;
+counter datavalue
+1 newval
+2 newval
+insert into t1 (datavalue) select datavalue from t1 where counter < 100;
+insert into t1 (datavalue) select datavalue from t1 where counter < 100;
+select * from t1 order by counter;
+counter datavalue
+1 newval
+2 newval
+3 newval
+4 newval
+5 newval
+6 newval
+7 newval
+8 newval
+insert into t1 (datavalue) select datavalue from t1 where counter < 100;
+insert into t1 (datavalue) select datavalue from t1 where counter < 100;
+select * from t1 order by counter;
+counter datavalue
+1 newval
+2 newval
+3 newval
+4 newval
+5 newval
+6 newval
+7 newval
+8 newval
+9 newval
+10 newval
+11 newval
+12 newval
+13 newval
+14 newval
+15 newval
+16 newval
+17 newval
+18 newval
+19 newval
+20 newval
+21 newval
+22 newval
+23 newval
+24 newval
+25 newval
+26 newval
+27 newval
+28 newval
+29 newval
+30 newval
+31 newval
+32 newval
+drop table t1;
+create table t1 (a int primary key auto_increment) engine = ndb;
+insert into t1() values (),(),(),(),(),(),(),(),(),(),(),();
+insert into t1(a) values (20),(28);
+insert into t1() values (),(),(),(),(),(),(),(),(),(),(),();
+insert into t1() values (21), (22);
+drop table t1;
+CREATE TABLE t1 ( b INT ) PACK_KEYS = 0 ENGINE = ndb;
+select * from t1;
+b
+drop table t1;
+create table t1 (a int) engine=ndb;
+create table t2 (a int) engine=ndb;
+insert into t1 values (1);
+insert into t2 values (1);
+delete t1.* from t1, t2 where t1.a = t2.a;
+select * from t1;
+a
+select * from t2;
+a
+1
+drop table t1;
+drop table t2;
+CREATE TABLE t1 (
+i INT,
+j INT,
+x INT,
+y INT,
+z INT
+) engine=ndb;
+CREATE TABLE t2 (
+i INT,
+k INT,
+x INT,
+y INT,
+z INT
+) engine=ndb;
+CREATE TABLE t3 (
+j INT,
+k INT,
+x INT,
+y INT,
+z INT
+) engine=ndb;
+INSERT INTO t1 VALUES ( 1, 2,13,14,15);
+INSERT INTO t2 VALUES ( 1, 3,23,24,25);
+INSERT INTO t3 VALUES ( 2, 3, 1,34,35), ( 2, 3, 1,34,36);
+UPDATE t1 AS a
+INNER JOIN t2 AS b
+ON a.i = b.i
+INNER JOIN t3 AS c
+ON a.j = c.j AND b.k = c.k
+SET a.x = b.x,
+a.y = b.y,
+a.z = (
+SELECT sum(z)
+FROM t3
+WHERE y = 34
+)
+WHERE b.x = 23;
+select * from t1;
+i j x y z
+1 2 23 24 71
+drop table t1;
+drop table t2;
+drop table t3;
+create table atablewithareallylongandirritatingname (a int);
+insert into atablewithareallylongandirritatingname values (2);
+select * from atablewithareallylongandirritatingname;
+a
+2
+drop table atablewithareallylongandirritatingname;
+create table t1 (f1 varchar(50), f2 text,f3 int, primary key(f1)) engine=NDB;
+insert into t1 (f1,f2,f3)VALUES("111111","aaaaaa",1);
+insert into t1 (f1,f2,f3)VALUES("222222","bbbbbb",2);
+select * from t1 order by f1;
+f1 f2 f3
+111111 aaaaaa 1
+222222 bbbbbb 2
+select * from t1 order by f2;
+f1 f2 f3
+111111 aaaaaa 1
+222222 bbbbbb 2
+select * from t1 order by f3;
+f1 f2 f3
+111111 aaaaaa 1
+222222 bbbbbb 2
+drop table t1;
+Illegal ndb error code: 1186
+CREATE TABLE t1 (
+a VARBINARY(40) NOT NULL,
+b VARCHAR (256) CHARACTER SET UTF8 NOT NULL,
+c VARCHAR(256) CHARACTER SET UTF8 NOT NULL,
+PRIMARY KEY (b,c)) ENGINE=ndbcluster;
+INSERT INTO t1 VALUES
+("a","ab","abc"),("b","abc","abcd"),("c","abc","ab"),("d","ab","ab"),("e","abc","abc");
+SELECT * FROM t1 ORDER BY a;
+a b c
+a ab abc
+b abc abcd
+c abc ab
+d ab ab
+e abc abc
+DROP TABLE t1;
+create table t1 (a int not null primary key, b int not null) engine=ndb;
+create table t2 (a int not null primary key, b int not null) engine=ndb;
+insert into t1 values (1,10), (2,20), (3,30);
+insert into t2 values (1,10), (2,20), (3,30);
+select * from t1 order by a;
+a b
+1 10
+2 20
+3 30
+delete from t1 where a > 0 order by a desc limit 1;
+select * from t1 order by a;
+a b
+1 10
+2 20
+delete from t1,t2 using t1,t2 where t1.a = t2.a;
+select * from t2 order by a;
+a b
+3 30
+drop table t1,t2;
+create table t1 (a int not null primary key, b int not null) engine=ndb;
+insert into t1 values (1,10), (2,20), (3,30);
+insert into t1 set a=1, b=100;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+insert ignore into t1 set a=1, b=100;
+select * from t1 order by a;
+a b
+1 10
+2 20
+3 30
+insert into t1 set a=1, b=1000 on duplicate key update b=b+1;
+select * from t1 order by a;
+a b
+1 11
+2 20
+3 30
+drop table t1;
+create table t1 (a int not null primary key, b int not null) engine=ndb;
+create table t2 (c int not null primary key, d int not null) engine=ndb;
+insert into t1 values (1,10), (2,10), (3,30), (4, 30);
+insert into t2 values (1,10), (2,10), (3,30), (4, 30);
+update t1 set a = 1 where a = 3;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+select * from t1 order by a;
+a b
+1 10
+2 10
+3 30
+4 30
+update t1 set b = 1 where a > 1 order by a desc limit 1;
+select * from t1 order by a;
+a b
+1 10
+2 10
+3 30
+4 1
+update t1,t2 set a = 1, c = 1 where a = 3 and c = 3;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+select * from t1 order by a;
+a b
+1 10
+2 10
+3 30
+4 1
+update ignore t1,t2 set a = 1, c = 1 where a = 3 and c = 3;
+select * from t1 order by a;
+a b
+1 10
+2 10
+3 30
+4 1
+drop table t1,t2;
+End of 5.0 tests
+CREATE TABLE t1 (a VARCHAR(255) NOT NULL,
+CONSTRAINT pk_a PRIMARY KEY (a))engine=ndb;
+CREATE TABLE t2(a VARCHAR(255) NOT NULL,
+b VARCHAR(255) NOT NULL,
+c VARCHAR(255) NOT NULL,
+CONSTRAINT pk_b_c_id PRIMARY KEY (b,c),
+CONSTRAINT fk_a FOREIGN KEY(a) REFERENCES t1(a))engine=ndb;
+drop table t1, t2;
+create table t1 (a int not null primary key, b int) engine=ndb;
+insert into t1 values(1,1),(2,2),(3,3);
+create table t2 like t1;
+insert into t2 select * from t1;
+select * from t1 order by a;
+a b
+1 1
+2 2
+3 3
+select * from t2 order by a;
+a b
+1 1
+2 2
+3 3
+drop table t1, t2;
+create table t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb;
+create table if not exists t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb;
+create table t2 like t1;
+rename table t1 to t10, t2 to t20;
+drop table t10,t20;
+End of 5.1 tests
diff --git a/mysql-test/suite/ndb/r/ndb_binlog_basic.result b/mysql-test/suite/ndb/r/ndb_binlog_basic.result
new file mode 100644
index 00000000000..09edd78bdb3
--- /dev/null
+++ b/mysql-test/suite/ndb/r/ndb_binlog_basic.result
@@ -0,0 +1,48 @@
+drop table if exists t1, t2;
+drop database if exists mysqltest;
+create database mysqltest;
+use mysqltest;
+drop database mysqltest;
+use test;
+create table t1 (a int primary key) engine=ndb;
+insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+select @max_epoch:=max(epoch)-1 from mysql.ndb_binlog_index;
+@max_epoch:=max(epoch)-1
+#
+delete from t1;
+alter table t1 add (b int);
+insert into t1 values (3,3),(4,4);
+alter table t1 rename t2;
+begin;
+insert into t2 values (1,1),(2,2);
+update t2 set b=1 where a=3;
+delete from t2 where a=4;
+commit;
+drop table t2;
+select inserts from mysql.ndb_binlog_index where epoch > @max_epoch and inserts > 5;
+inserts
+10
+select deletes from mysql.ndb_binlog_index where epoch > @max_epoch and deletes > 5;
+deletes
+10
+select inserts,updates,deletes from
+mysql.ndb_binlog_index where epoch > @max_epoch and updates > 0;
+inserts updates deletes
+2 1 1
+flush logs;
+purge master logs before now();
+create table t1 (a int primary key, b int) engine=ndb;
+create database mysqltest;
+use mysqltest;
+create table t1 (c int, d int primary key) engine=ndb;
+use test;
+insert into mysqltest.t1 values (2,1),(2,2);
+select @max_epoch:=max(epoch)-1 from mysql.ndb_binlog_index;
+@max_epoch:=max(epoch)-1
+#
+drop table t1;
+drop database mysqltest;
+select inserts,updates,deletes from
+mysql.ndb_binlog_index where epoch > @max_epoch and inserts > 0;
+inserts updates deletes
+2 0 0
diff --git a/mysql-test/r/ndb_binlog_ddl_multi.result b/mysql-test/suite/ndb/r/ndb_binlog_ddl_multi.result
index 6631feeaa17..6631feeaa17 100644
--- a/mysql-test/r/ndb_binlog_ddl_multi.result
+++ b/mysql-test/suite/ndb/r/ndb_binlog_ddl_multi.result
diff --git a/mysql-test/r/ndb_binlog_discover.result b/mysql-test/suite/ndb/r/ndb_binlog_discover.result
index 7c3a976c4d5..7c3a976c4d5 100644
--- a/mysql-test/r/ndb_binlog_discover.result
+++ b/mysql-test/suite/ndb/r/ndb_binlog_discover.result
diff --git a/mysql-test/suite/ndb/r/ndb_binlog_format.result b/mysql-test/suite/ndb/r/ndb_binlog_format.result
new file mode 100644
index 00000000000..ed26060e2a4
--- /dev/null
+++ b/mysql-test/suite/ndb/r/ndb_binlog_format.result
@@ -0,0 +1,30 @@
+drop table if exists t1, t2, t3;
+CREATE TABLE t1 (m INT, n INT) ENGINE=MYISAM;
+CREATE TABLE t2 (b INT, c INT) ENGINE=BLACKHOLE;
+CREATE TABLE t3 (e INT, f INT) ENGINE=NDB;
+RESET MASTER;
+SET SESSION BINLOG_FORMAT=STATEMENT;
+INSERT INTO t1 VALUES (1,1), (1,2), (2,1), (2,2);
+INSERT INTO t2 VALUES (1,1), (1,2), (2,1), (2,2);
+UPDATE t1, t2 SET m = 2, b = 3 WHERE n = c;
+START TRANSACTION;
+INSERT INTO t3 VALUES (1,1), (1,2), (2,1), (2,2);
+UPDATE t1, t3 SET m = 2, e = 3 WHERE n = f;
+UPDATE t3, t2 SET e = 2, b = 3 WHERE f = c;
+COMMIT;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (1,2), (2,1), (2,2)
+master-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES (1,1), (1,2), (2,1), (2,2)
+master-bin.000001 # Query # # use `test`; UPDATE t1, t2 SET m = 2, b = 3 WHERE n = c
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Query # # use `test`; INSERT INTO t3 VALUES (1,1), (1,2), (2,1), (2,2)
+master-bin.000001 # Query # # use `test`; UPDATE t1, t3 SET m = 2, e = 3 WHERE n = f
+master-bin.000001 # Query # # use `test`; UPDATE t3, t2 SET e = 2, b = 3 WHERE f = c
+master-bin.000001 # Query # # use `test`; COMMIT
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t3)
+master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+DROP TABLE t1, t2, t3;
diff --git a/mysql-test/r/ndb_binlog_ignore_db.result b/mysql-test/suite/ndb/r/ndb_binlog_ignore_db.result
index e4c9faa802c..e4c9faa802c 100644
--- a/mysql-test/r/ndb_binlog_ignore_db.result
+++ b/mysql-test/suite/ndb/r/ndb_binlog_ignore_db.result
diff --git a/mysql-test/r/ndb_binlog_log_bin.result b/mysql-test/suite/ndb/r/ndb_binlog_log_bin.result
index f80a46324e0..f80a46324e0 100644
--- a/mysql-test/r/ndb_binlog_log_bin.result
+++ b/mysql-test/suite/ndb/r/ndb_binlog_log_bin.result
diff --git a/mysql-test/suite/ndb/r/ndb_binlog_multi.result b/mysql-test/suite/ndb/r/ndb_binlog_multi.result
new file mode 100644
index 00000000000..b2a9da39be0
--- /dev/null
+++ b/mysql-test/suite/ndb/r/ndb_binlog_multi.result
@@ -0,0 +1,80 @@
+drop table if exists t1,t2,t3;
+drop table if exists t1,t2,t3;
+CREATE TABLE t3 (dummy INT PRIMARY KEY) ENGINE = NDB;
+DROP TABLE t3;
+reset master;
+reset master;
+CREATE TABLE t2 (a INT PRIMARY KEY, b int) ENGINE = NDB;
+INSERT INTO t2 VALUES (1,1),(2,2);
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin1.000001 # Query 102 # use `test`; CREATE TABLE t2 (a INT PRIMARY KEY, b int) ENGINE = NDB
+master-bin1.000001 # Query 102 # BEGIN
+master-bin1.000001 # Table_map 102 # table_id: # (test.t2)
+master-bin1.000001 # Table_map 102 # table_id: # (mysql.ndb_apply_status)
+master-bin1.000001 # Write_rows 102 # table_id: #
+master-bin1.000001 # Write_rows 102 # table_id: # flags: STMT_END_F
+master-bin1.000001 # Query 102 # COMMIT
+select * from t2 order by a;
+a b
+1 1
+2 2
+SELECT @the_epoch:=epoch,inserts,updates,deletes,schemaops FROM
+mysql.ndb_binlog_index ORDER BY epoch DESC LIMIT 1;
+@the_epoch:=epoch inserts updates deletes schemaops
+<the_epoch> 2 0 0 0
+SELECT * FROM t2 ORDER BY a;
+a b
+1 1
+2 2
+DROP TABLE t2;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 102 # use `test`; CREATE TABLE t2 (a INT PRIMARY KEY, b int) ENGINE = NDB
+master-bin.000001 # Query 1 # BEGIN
+master-bin.000001 # Table_map 1 # table_id: # (test.t2)
+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
+master-bin.000001 # Query 1 # use `test`; DROP TABLE t2
+SELECT inserts,updates,deletes,schemaops FROM
+mysql.ndb_binlog_index WHERE epoch=<the_epoch>;
+inserts updates deletes schemaops
+2 0 0 0
+reset master;
+reset master;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = NDB;
+INSERT INTO t1 VALUES (1),(2);
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin1.000001 # Query 102 # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = NDB
+master-bin1.000001 # Query 102 # BEGIN
+master-bin1.000001 # Table_map 102 # table_id: # (test.t1)
+master-bin1.000001 # Table_map 102 # table_id: # (mysql.ndb_apply_status)
+master-bin1.000001 # Write_rows 102 # table_id: #
+master-bin1.000001 # Write_rows 102 # table_id: # flags: STMT_END_F
+master-bin1.000001 # Query 102 # COMMIT
+SELECT @the_epoch2:=epoch,inserts,updates,deletes,schemaops FROM
+mysql.ndb_binlog_index ORDER BY epoch DESC LIMIT 1;
+@the_epoch2:=epoch inserts updates deletes schemaops
+<the_epoch2> 2 0 0 0
+SELECT inserts,updates,deletes,schemaops FROM
+mysql.ndb_binlog_index WHERE epoch > <the_epoch> AND epoch <= <the_epoch2>;
+inserts updates deletes schemaops
+2 0 0 0
+drop table t1;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin1.000001 # Query 102 # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = NDB
+master-bin1.000001 # Query 102 # BEGIN
+master-bin1.000001 # Table_map 102 # table_id: # (test.t1)
+master-bin1.000001 # Table_map 102 # table_id: # (mysql.ndb_apply_status)
+master-bin1.000001 # Write_rows 102 # table_id: #
+master-bin1.000001 # Write_rows 102 # table_id: # flags: STMT_END_F
+master-bin1.000001 # Query 102 # COMMIT
+master-bin1.000001 # Query 102 # use `test`; drop table t1
+SELECT inserts,updates,deletes,schemaops FROM
+mysql.ndb_binlog_index WHERE epoch > <the_epoch> AND epoch <= <the_epoch2>;
+inserts updates deletes schemaops
+2 0 0 0
diff --git a/mysql-test/r/ndb_bitfield.result b/mysql-test/suite/ndb/r/ndb_bitfield.result
index 59c4d420b22..59c4d420b22 100644
--- a/mysql-test/r/ndb_bitfield.result
+++ b/mysql-test/suite/ndb/r/ndb_bitfield.result
diff --git a/mysql-test/r/ndb_blob.result b/mysql-test/suite/ndb/r/ndb_blob.result
index 34f2c5fdd66..34f2c5fdd66 100644
--- a/mysql-test/r/ndb_blob.result
+++ b/mysql-test/suite/ndb/r/ndb_blob.result
diff --git a/mysql-test/r/ndb_blob_partition.result b/mysql-test/suite/ndb/r/ndb_blob_partition.result
index b08a91f0cdd..b08a91f0cdd 100644
--- a/mysql-test/r/ndb_blob_partition.result
+++ b/mysql-test/suite/ndb/r/ndb_blob_partition.result
diff --git a/mysql-test/suite/ndb/r/ndb_bug26793.result b/mysql-test/suite/ndb/r/ndb_bug26793.result
new file mode 100644
index 00000000000..a9a8a798546
--- /dev/null
+++ b/mysql-test/suite/ndb/r/ndb_bug26793.result
@@ -0,0 +1,8 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE `test` (
+`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+`t` VARCHAR( 10 ) NOT NULL
+) ENGINE = ndbcluster;
+GRANT USAGE ON *.* TO user1@localhost IDENTIFIED BY 'pass';
+DROP TABLE `test`.`test`;
+drop user user1@localhost;
diff --git a/mysql-test/r/ndb_cache.result b/mysql-test/suite/ndb/r/ndb_cache.result
index 478663b1aa1..478663b1aa1 100644
--- a/mysql-test/r/ndb_cache.result
+++ b/mysql-test/suite/ndb/r/ndb_cache.result
diff --git a/mysql-test/r/ndb_cache2.result b/mysql-test/suite/ndb/r/ndb_cache2.result
index 2876002f864..2876002f864 100644
--- a/mysql-test/r/ndb_cache2.result
+++ b/mysql-test/suite/ndb/r/ndb_cache2.result
diff --git a/mysql-test/r/ndb_cache_multi.result b/mysql-test/suite/ndb/r/ndb_cache_multi.result
index 388131ec30a..388131ec30a 100644
--- a/mysql-test/r/ndb_cache_multi.result
+++ b/mysql-test/suite/ndb/r/ndb_cache_multi.result
diff --git a/mysql-test/r/ndb_cache_multi2.result b/mysql-test/suite/ndb/r/ndb_cache_multi2.result
index 53767bb6d3c..53767bb6d3c 100644
--- a/mysql-test/r/ndb_cache_multi2.result
+++ b/mysql-test/suite/ndb/r/ndb_cache_multi2.result
diff --git a/mysql-test/r/ndb_charset.result b/mysql-test/suite/ndb/r/ndb_charset.result
index 1c65a380039..1c65a380039 100644
--- a/mysql-test/r/ndb_charset.result
+++ b/mysql-test/suite/ndb/r/ndb_charset.result
diff --git a/mysql-test/suite/ndb/r/ndb_condition_pushdown.result b/mysql-test/suite/ndb/r/ndb_condition_pushdown.result
new file mode 100644
index 00000000000..8d1dcc4ef18
--- /dev/null
+++ b/mysql-test/suite/ndb/r/ndb_condition_pushdown.result
@@ -0,0 +1,1892 @@
+DROP TABLE IF EXISTS t1,t2,t3,t4;
+CREATE TABLE t1 (
+auto int(5) unsigned NOT NULL auto_increment,
+string char(10),
+vstring varchar(10),
+bin binary(2),
+vbin varbinary(7),
+tiny tinyint(4) DEFAULT '0' NOT NULL ,
+short smallint(6) DEFAULT '1' NOT NULL ,
+medium mediumint(8) DEFAULT '0' NOT NULL,
+long_int int(11) DEFAULT '0' NOT NULL,
+longlong bigint(13) DEFAULT '0' NOT NULL,
+real_float float(13,1) DEFAULT 0.0 NOT NULL,
+real_double double(16,4),
+real_decimal decimal(16,4),
+utiny tinyint(3) unsigned DEFAULT '0' NOT NULL,
+ushort smallint(5) unsigned zerofill DEFAULT '00000' NOT NULL,
+umedium mediumint(8) unsigned DEFAULT '0' NOT NULL,
+ulong int(11) unsigned DEFAULT '0' NOT NULL,
+ulonglong bigint(13) unsigned DEFAULT '0' NOT NULL,
+bits bit(3),
+options enum('zero','one','two','three','four') not null,
+flags set('zero','one','two','three','four') not null,
+date_field date,
+year_field year,
+time_field time,
+date_time datetime,
+time_stamp timestamp,
+PRIMARY KEY (auto)
+) engine=ndb;
+insert into t1 values
+(NULL,"aaaa","aaaa",0xAAAA,0xAAAA,-1,-1,-1,-1,-1,1.1,1.1,1.1,1,1,1,1,1,
+b'001','one','one',
+'1901-01-01','1901',
+'01:01:01','1901-01-01 01:01:01',NULL),
+(NULL,"bbbb","bbbb",0xBBBB,0xBBBB,-2,-2,-2,-2,-2,2.2,2.2,2.2,2,2,2,2,2,
+b'010','two','one,two',
+'1902-02-02','1902',
+'02:02:02','1902-02-02 02:02:02',NULL),
+(NULL,"cccc","cccc",0xCCCC,0xCCCC,-3,-3,-3,-3,-3,3.3,3.3,3.3,3,3,3,3,3,
+b'011','three','one,two,three',
+'1903-03-03','1903',
+'03:03:03','1903-03-03 03:03:03',NULL),
+(NULL,"dddd","dddd",0xDDDD,0xDDDD,-4,-4,-4,-4,-4,4.4,4.4,4.4,4,4,4,4,4,
+b'100','four','one,two,three,four',
+'1904-04-04','1904',
+'04:04:04','1904-04-04 04:04:04',NULL);
+CREATE TABLE t2 (pk1 int unsigned NOT NULL PRIMARY KEY, attr1 int unsigned NOT NULL, attr2 int unsigned, attr3 VARCHAR(10) ) ENGINE=ndbcluster;
+insert into t2 values (0,0,0, "a"),(1,1,1,"b"),(2,2,NULL,NULL),(3,3,3,"d"),(4,4,4,"e"),(5,5,5,"f");
+CREATE TABLE t3 (pk1 int unsigned NOT NULL PRIMARY KEY, attr1 int unsigned NOT NULL, attr2 bigint unsigned, attr3 tinyint unsigned, attr4 VARCHAR(10) ) ENGINE=ndbcluster;
+insert into t3 values (0,0,0,0,"a"),(1,1,9223372036854775803,1,"b"),(2,2,9223372036854775804,2,"c"),(3,3,9223372036854775805,3,"d"),(4,4,9223372036854775806,4,"e"),(5,5,9223372036854775807,5,"f");
+CREATE TABLE t4 (pk1 int unsigned NOT NULL PRIMARY KEY, attr1 int unsigned NOT NULL, attr2 bigint unsigned, attr3 tinyint unsigned, attr4 VARCHAR(10) , KEY (attr1)) ENGINE=ndbcluster;
+insert into t4 values (0,0,0,0,"a"),(1,1,9223372036854775803,1,"b"),(2,2,9223372036854775804,2,"c"),(3,3,9223372036854775805,3,"d"),(4,4,9223372036854775806,4,"e"),(5,5,9223372036854775807,5,"f");
+set @old_ecpd = @@session.engine_condition_pushdown;
+set engine_condition_pushdown = off;
+select auto from t1 where
+string = "aaaa" and
+vstring = "aaaa" and
+bin = 0xAAAA and
+vbin = 0xAAAA and
+tiny = -1 and
+short = -1 and
+medium = -1 and
+long_int = -1 and
+longlong = -1 and
+real_float > 1.0 and real_float < 2.0 and
+real_double > 1.0 and real_double < 2.0 and
+real_decimal > 1.0 and real_decimal < 2.0 and
+utiny = 1 and
+ushort = 1 and
+umedium = 1 and
+ulong = 1 and
+ulonglong = 1 and
+bits = b'001' and
+options = 'one' and
+flags = 'one' and
+date_field = '1901-01-01' and
+year_field = '1901' and
+time_field = '01:01:01' and
+date_time = '1901-01-01 01:01:01'
+order by auto;
+auto
+1
+select auto from t1 where
+string != "aaaa" and
+vstring != "aaaa" and
+bin != 0xAAAA and
+vbin != 0xAAAA and
+tiny != -1 and
+short != -1 and
+medium != -1 and
+long_int != -1 and
+longlong != -1 and
+(real_float < 1.0 or real_float > 2.0) and
+(real_double < 1.0 or real_double > 2.0) and
+(real_decimal < 1.0 or real_decimal > 2.0) and
+utiny != 1 and
+ushort != 1 and
+umedium != 1 and
+ulong != 1 and
+ulonglong != 1 and
+bits != b'001' and
+options != 'one' and
+flags != 'one' and
+date_field != '1901-01-01' and
+year_field != '1901' and
+time_field != '01:01:01' and
+date_time != '1901-01-01 01:01:01'
+order by auto;
+auto
+2
+3
+4
+select auto from t1 where
+string > "aaaa" and
+vstring > "aaaa" and
+bin > 0xAAAA and
+vbin > 0xAAAA and
+tiny < -1 and
+short < -1 and
+medium < -1 and
+long_int < -1 and
+longlong < -1 and
+real_float > 1.1 and
+real_double > 1.1 and
+real_decimal > 1.1 and
+utiny > 1 and
+ushort > 1 and
+umedium > 1 and
+ulong > 1 and
+ulonglong > 1 and
+bits > b'001' and
+(options = 'two' or options = 'three' or options = 'four') and
+(flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
+date_field > '1901-01-01' and
+year_field > '1901' and
+time_field > '01:01:01' and
+date_time > '1901-01-01 01:01:01'
+order by auto;
+auto
+2
+3
+4
+select auto from t1 where
+string >= "aaaa" and
+vstring >= "aaaa" and
+bin >= 0xAAAA and
+vbin >= 0xAAAA and
+tiny <= -1 and
+short <= -1 and
+medium <= -1 and
+long_int <= -1 and
+longlong <= -1 and
+real_float >= 1.0 and
+real_double >= 1.0 and
+real_decimal >= 1.0 and
+utiny >= 1 and
+ushort >= 1 and
+umedium >= 1 and
+ulong >= 1 and
+ulonglong >= 1 and
+bits >= b'001' and
+(options = 'one' or options = 'two' or options = 'three' or options = 'four') and
+(flags = 'one' or flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
+date_field >= '1901-01-01' and
+year_field >= '1901' and
+time_field >= '01:01:01' and
+date_time >= '1901-01-01 01:01:01'
+order by auto;
+auto
+1
+2
+3
+4
+select auto from t1 where
+string < "dddd" and
+vstring < "dddd" and
+bin < 0xDDDD and
+vbin < 0xDDDD and
+tiny > -4 and
+short > -4 and
+medium > -4 and
+long_int > -4 and
+longlong > -4 and
+real_float < 4.4 and
+real_double < 4.4 and
+real_decimal < 4.4 and
+utiny < 4 and
+ushort < 4 and
+umedium < 4 and
+ulong < 4 and
+ulonglong < 4 and
+bits < b'100' and
+(options = 'one' or options = 'two' or options = 'three') and
+(flags = 'one' or flags = 'one,two' or flags = 'one,two,three') and
+date_field < '1904-01-01' and
+year_field < '1904' and
+time_field < '04:04:04' and
+date_time < '1904-04-04 04:04:04'
+order by auto;
+auto
+1
+2
+3
+select auto from t1 where
+string <= "dddd" and
+vstring <= "dddd" and
+bin <= 0xDDDD and
+vbin <= 0xDDDD and
+tiny >= -4 and
+short >= -4 and
+medium >= -4 and
+long_int >= -4 and
+longlong >= -4 and
+real_float <= 4.5 and
+real_double <= 4.5 and
+real_decimal <= 4.5 and
+utiny <= 4 and
+ushort <= 4 and
+umedium <= 4 and
+ulong <= 4 and
+ulonglong <= 4 and
+bits <= b'100' and
+(options = 'one' or options = 'two' or options = 'three' or options = 'four') and
+(flags = 'one' or flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
+date_field <= '1904-04-04' and
+year_field <= '1904' and
+time_field <= '04:04:04' and
+date_time <= '1904-04-04 04:04:04'
+order by auto;
+auto
+1
+2
+3
+4
+select auto from t1 where
+string like "b%" and
+vstring like "b%" and
+bin like concat(0xBB, '%') and
+vbin like concat(0xBB, '%')
+order by auto;
+auto
+2
+select auto from t1 where
+string not like "b%" and
+vstring not like "b%" and
+bin not like concat(0xBB, '%') and
+vbin not like concat(0xBB, '%')
+order by auto;
+auto
+1
+3
+4
+select auto from t1 where
+(string between "aaaa" and "cccc") and
+(vstring between "aaaa" and "cccc") and
+(bin between 0xAAAA and 0xCCCC) and
+(vbin between 0xAAAA and 0xCCCC) and
+(tiny between -3 and -1) and
+(short between -3 and -1) and
+(medium between -3 and -1) and
+(long_int between -3 and -1) and
+(longlong between -3 and -1) and
+(utiny between 1 and 3) and
+(ushort between 1 and 3) and
+(umedium between 1 and 3) and
+(ulong between 1 and 3) and
+(ulonglong between 1 and 3) and
+(bits between b'001' and b'011') and
+(options between 'one' and 'three') and
+(flags between 'one' and 'one,two,three') and
+(date_field between '1901-01-01' and '1903-03-03') and
+(year_field between '1901' and '1903') and
+(time_field between '01:01:01' and '03:03:03') and
+(date_time between '1901-01-01 01:01:01' and '1903-03-03 03:03:03')
+order by auto;
+auto
+1
+3
+select auto from t1 where
+("aaaa" between string and string) and
+("aaaa" between vstring and vstring) and
+(0xAAAA between bin and bin) and
+(0xAAAA between vbin and vbin) and
+(-1 between tiny and tiny) and
+(-1 between short and short) and
+(-1 between medium and medium) and
+(-1 between long_int and long_int) and
+(-1 between longlong and longlong) and
+(1 between utiny and utiny) and
+(1 between ushort and ushort) and
+(1 between umedium and umedium) and
+(1 between ulong and ulong) and
+(1 between ulonglong and ulonglong) and
+(b'001' between bits and bits) and
+('one' between options and options) and
+('one' between flags and flags) and
+('1901-01-01' between date_field and date_field) and
+('1901' between year_field and year_field) and
+('01:01:01' between time_field and time_field) and
+('1901-01-01 01:01:01' between date_time and date_time)
+order by auto;
+auto
+1
+select auto from t1 where
+(string not between "aaaa" and "cccc") and
+(vstring not between "aaaa" and "cccc") and
+(bin not between 0xAAAA and 0xCCCC) and
+(vbin not between 0xAAAA and 0xCCCC) and
+(tiny not between -3 and -1) and
+(short not between -3 and -1) and
+(medium not between -3 and -1) and
+(long_int not between -3 and -1) and
+(longlong not between -3 and -1) and
+(utiny not between 1 and 3) and
+(ushort not between 1 and 3) and
+(umedium not between 1 and 3) and
+(ulong not between 1 and 3) and
+(ulonglong not between 1 and 3) and
+(bits not between b'001' and b'011') and
+(options not between 'one' and 'three') and
+(flags not between 'one' and 'one,two,three') and
+(date_field not between '1901-01-01' and '1903-03-03') and
+(year_field not between '1901' and '1903') and
+(time_field not between '01:01:01' and '03:03:03') and
+(date_time not between '1901-01-01 01:01:01' and '1903-03-03 03:03:03')
+order by auto;
+auto
+4
+select auto from t1 where
+("aaaa" not between string and string) and
+("aaaa" not between vstring and vstring) and
+(0xAAAA not between bin and bin) and
+(0xAAAA not between vbin and vbin) and
+(-1 not between tiny and tiny) and
+(-1 not between short and short) and
+(-1 not between medium and medium) and
+(-1 not between long_int and long_int) and
+(-1 not between longlong and longlong) and
+(1 not between utiny and utiny) and
+(1 not between ushort and ushort) and
+(1 not between umedium and umedium) and
+(1 not between ulong and ulong) and
+(1 not between ulonglong and ulonglong) and
+(b'001' not between bits and bits) and
+('one' not between options and options) and
+('one' not between flags and flags) and
+('1901-01-01' not between date_field and date_field) and
+('1901' not between year_field and year_field) and
+('01:01:01' not between time_field and time_field) and
+('1901-01-01 01:01:01' not between date_time and date_time)
+order by auto;
+auto
+2
+3
+4
+select auto from t1 where
+string in("aaaa","cccc") and
+vstring in("aaaa","cccc") and
+bin in(0xAAAA,0xCCCC) and
+vbin in(0xAAAA,0xCCCC) and
+tiny in(-1,-3) and
+short in(-1,-3) and
+medium in(-1,-3) and
+long_int in(-1,-3) and
+longlong in(-1,-3) and
+utiny in(1,3) and
+ushort in(1,3) and
+umedium in(1,3) and
+ulong in(1,3) and
+ulonglong in(1,3) and
+bits in(b'001',b'011') and
+options in('one','three') and
+flags in('one','one,two,three') and
+date_field in('1901-01-01','1903-03-03') and
+year_field in('1901','1903') and
+time_field in('01:01:01','03:03:03') and
+date_time in('1901-01-01 01:01:01','1903-03-03 03:03:03')
+order by auto;
+auto
+1
+3
+select auto from t1 where
+"aaaa" in(string) and
+"aaaa" in(vstring) and
+0xAAAA in(bin) and
+0xAAAA in(vbin) and
+(-1 in(tiny)) and
+(-1 in(short)) and
+(-1 in(medium)) and
+(-1 in(long_int)) and
+(-1 in(longlong)) and
+1 in(utiny) and
+1 in(ushort) and
+1 in(umedium) and
+1 in(ulong) and
+1 in(ulonglong) and
+b'001' in(bits) and
+'one' in(options) and
+'one' in(flags) and
+'1901-01-01' in(date_field) and
+'1901' in(year_field) and
+'01:01:01' in(time_field) and
+'1901-01-01 01:01:01' in(date_time)
+order by auto;
+auto
+1
+select auto from t1 where
+string not in("aaaa","cccc") and
+vstring not in("aaaa","cccc") and
+bin not in(0xAAAA,0xCCCC) and
+vbin not in(0xAAAA,0xCCCC) and
+tiny not in(-1,-3) and
+short not in(-1,-3) and
+medium not in(-1,-3) and
+long_int not in(-1,-3) and
+longlong not in(-1,-3) and
+utiny not in(1,3) and
+ushort not in(1,3) and
+umedium not in(1,3) and
+ulong not in(1,3) and
+ulonglong not in(1,3) and
+bits not in(b'001',b'011') and
+options not in('one','three') and
+flags not in('one','one,two,three') and
+date_field not in('1901-01-01','1903-03-03') and
+year_field not in('1901','1903') and
+time_field not in('01:01:01','03:03:03') and
+date_time not in('1901-01-01 01:01:01','1903-03-03 03:03:03')
+order by auto;
+auto
+2
+4
+select auto from t1 where
+"aaaa" not in(string) and
+"aaaa" not in(vstring) and
+0xAAAA not in(bin) and
+0xAAAA not in(vbin) and
+(-1 not in(tiny)) and
+(-1 not in(short)) and
+(-1 not in(medium)) and
+(-1 not in(long_int)) and
+(-1 not in(longlong)) and
+1 not in(utiny) and
+1 not in(ushort) and
+1 not in(umedium) and
+1 not in(ulong) and
+1 not in(ulonglong) and
+b'001' not in(bits) and
+'one' not in(options) and
+'one' not in(flags) and
+'1901-01-01' not in(date_field) and
+'1901' not in(year_field) and
+'01:01:01' not in(time_field) and
+'1901-01-01 01:01:01' not in(date_time)
+order by auto;
+auto
+2
+3
+4
+select * from t2 where attr3 is null or attr1 > 2 and pk1= 3 order by pk1;
+pk1 attr1 attr2 attr3
+2 2 NULL NULL
+3 3 3 d
+select * from t2 where attr3 is not null and attr1 > 2 order by pk1;
+pk1 attr1 attr2 attr3
+3 3 3 d
+4 4 4 e
+5 5 5 f
+select * from t3 where attr2 > 9223372036854775803 and attr3 != 3 order by pk1;
+pk1 attr1 attr2 attr3 attr4
+2 2 9223372036854775804 2 c
+4 4 9223372036854775806 4 e
+5 5 9223372036854775807 5 f
+select * from t2,t3 where t2.attr1 < 1 and t2.attr2 = t3.attr2 and t3.attr1 < 5 order by t2.pk1;
+pk1 attr1 attr2 attr3 pk1 attr1 attr2 attr3 attr4
+0 0 0 a 0 0 0 0 a
+select * from t4 where attr1 < 5 and attr2 > 9223372036854775803 and attr3 != 3 order by t4.pk1;
+pk1 attr1 attr2 attr3 attr4
+2 2 9223372036854775804 2 c
+4 4 9223372036854775806 4 e
+select * from t3,t4 where t4.attr1 > 1 and t4.attr2 = t3.attr2 and t4.attr3 < 5 order by t4.pk1;
+pk1 attr1 attr2 attr3 attr4 pk1 attr1 attr2 attr3 attr4
+2 2 9223372036854775804 2 c 2 2 9223372036854775804 2 c
+3 3 9223372036854775805 3 d 3 3 9223372036854775805 3 d
+4 4 9223372036854775806 4 e 4 4 9223372036854775806 4 e
+set engine_condition_pushdown = on;
+explain
+select auto from t1 where
+string = "aaaa" and
+vstring = "aaaa" and
+bin = 0xAAAA and
+vbin = 0xAAAA and
+tiny = -1 and
+short = -1 and
+medium = -1 and
+long_int = -1 and
+longlong = -1 and
+real_float > 1.0 and real_float < 2.0 and
+real_double > 1.0 and real_double < 2.0 and
+real_decimal > 1.0 and real_decimal < 2.0 and
+utiny = 1 and
+ushort = 1 and
+umedium = 1 and
+ulong = 1 and
+ulonglong = 1 and
+/* bits = b'001' and */
+options = 'one' and
+flags = 'one' and
+date_field = '1901-01-01' and
+year_field = '1901' and
+time_field = '01:01:01' and
+date_time = '1901-01-01 01:01:01'
+order by auto;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
+select auto from t1 where
+string = "aaaa" and
+vstring = "aaaa" and
+bin = 0xAAAA and
+vbin = 0xAAAA and
+tiny = -1 and
+short = -1 and
+medium = -1 and
+long_int = -1 and
+longlong = -1 and
+real_float > 1.0 and real_float < 2.0 and
+real_double > 1.0 and real_double < 2.0 and
+real_decimal > 1.0 and real_decimal < 2.0 and
+utiny = 1 and
+ushort = 1 and
+umedium = 1 and
+ulong = 1 and
+ulonglong = 1 and
+/* bits = b'001' and */
+options = 'one' and
+flags = 'one' and
+date_field = '1901-01-01' and
+year_field = '1901' and
+time_field = '01:01:01' and
+date_time = '1901-01-01 01:01:01'
+order by auto;
+auto
+1
+explain
+select auto from t1 where
+string != "aaaa" and
+vstring != "aaaa" and
+bin != 0xAAAA and
+vbin != 0xAAAA and
+tiny != -1 and
+short != -1 and
+medium != -1 and
+long_int != -1 and
+longlong != -1 and
+(real_float < 1.0 or real_float > 2.0) and
+(real_double < 1.0 or real_double > 2.0) and
+(real_decimal < 1.0 or real_decimal > 2.0) and
+utiny != 1 and
+ushort != 1 and
+umedium != 1 and
+ulong != 1 and
+ulonglong != 1 and
+/* bits != b'001' and */
+options != 'one' and
+flags != 'one' and
+date_field != '1901-01-01' and
+year_field != '1901' and
+time_field != '01:01:01' and
+date_time != '1901-01-01 01:01:01'
+order by auto;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
+select auto from t1 where
+string != "aaaa" and
+vstring != "aaaa" and
+bin != 0xAAAA and
+vbin != 0xAAAA and
+tiny != -1 and
+short != -1 and
+medium != -1 and
+long_int != -1 and
+longlong != -1 and
+(real_float < 1.0 or real_float > 2.0) and
+(real_double < 1.0 or real_double > 2.0) and
+(real_decimal < 1.0 or real_decimal > 2.0) and
+utiny != 1 and
+ushort != 1 and
+umedium != 1 and
+ulong != 1 and
+ulonglong != 1 and
+/* bits != b'001' and */
+options != 'one' and
+flags != 'one' and
+date_field != '1901-01-01' and
+year_field != '1901' and
+time_field != '01:01:01' and
+date_time != '1901-01-01 01:01:01'
+order by auto;
+auto
+2
+3
+4
+explain
+select auto from t1 where
+string > "aaaa" and
+vstring > "aaaa" and
+bin > 0xAAAA and
+vbin > 0xAAAA and
+tiny < -1 and
+short < -1 and
+medium < -1 and
+long_int < -1 and
+longlong < -1 and
+real_float > 1.1 and
+real_double > 1.1 and
+real_decimal > 1.1 and
+utiny > 1 and
+ushort > 1 and
+umedium > 1 and
+ulong > 1 and
+ulonglong > 1 and
+/* bits > b'001' and */
+(options = 'two' or options = 'three' or options = 'four') and
+(flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
+date_field > '1901-01-01' and
+year_field > '1901' and
+time_field > '01:01:01' and
+date_time > '1901-01-01 01:01:01'
+order by auto;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
+select auto from t1 where
+string > "aaaa" and
+vstring > "aaaa" and
+bin > 0xAAAA and
+vbin > 0xAAAA and
+tiny < -1 and
+short < -1 and
+medium < -1 and
+long_int < -1 and
+longlong < -1 and
+real_float > 1.1 and
+real_double > 1.1 and
+real_decimal > 1.1 and
+utiny > 1 and
+ushort > 1 and
+umedium > 1 and
+ulong > 1 and
+ulonglong > 1 and
+/* bits > b'001' and */
+(options = 'two' or options = 'three' or options = 'four') and
+(flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
+date_field > '1901-01-01' and
+year_field > '1901' and
+time_field > '01:01:01' and
+date_time > '1901-01-01 01:01:01'
+order by auto;
+auto
+2
+3
+4
+explain
+select auto from t1 where
+string >= "aaaa" and
+vstring >= "aaaa" and
+bin >= 0xAAAA and
+vbin >= 0xAAAA and
+tiny <= -1 and
+short <= -1 and
+medium <= -1 and
+long_int <= -1 and
+longlong <= -1 and
+real_float >= 1.0 and
+real_double >= 1.0 and
+real_decimal >= 1.0 and
+utiny >= 1 and
+ushort >= 1 and
+umedium >= 1 and
+ulong >= 1 and
+ulonglong >= 1 and
+/* bits >= b'001' and */
+(options = 'one' or options = 'two' or options = 'three' or options = 'four') and
+(flags = 'one' or flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
+date_field >= '1901-01-01' and
+year_field >= '1901' and
+time_field >= '01:01:01' and
+date_time >= '1901-01-01 01:01:01'
+order by auto;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
+select auto from t1 where
+string >= "aaaa" and
+vstring >= "aaaa" and
+bin >= 0xAAAA and
+vbin >= 0xAAAA and
+tiny <= -1 and
+short <= -1 and
+medium <= -1 and
+long_int <= -1 and
+longlong <= -1 and
+real_float >= 1.0 and
+real_double >= 1.0 and
+real_decimal >= 1.0 and
+utiny >= 1 and
+ushort >= 1 and
+umedium >= 1 and
+ulong >= 1 and
+ulonglong >= 1 and
+/* bits >= b'001' and */
+(options = 'one' or options = 'two' or options = 'three' or options = 'four') and
+(flags = 'one' or flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
+date_field >= '1901-01-01' and
+year_field >= '1901' and
+time_field >= '01:01:01' and
+date_time >= '1901-01-01 01:01:01'
+order by auto;
+auto
+1
+2
+3
+4
+explain
+select auto from t1 where
+string < "dddd" and
+vstring < "dddd" and
+bin < 0xDDDD and
+vbin < 0xDDDD and
+tiny > -4 and
+short > -4 and
+medium > -4 and
+long_int > -4 and
+longlong > -4 and
+real_float < 4.4 and
+real_double < 4.4 and
+real_decimal < 4.4 and
+utiny < 4 and
+ushort < 4 and
+umedium < 4 and
+ulong < 4 and
+ulonglong < 4 and
+/* bits < b'100' and */
+(options = 'one' or options = 'two' or options = 'three') and
+(flags = 'one' or flags = 'one,two' or flags = 'one,two,three') and
+date_field < '1904-01-01' and
+year_field < '1904' and
+time_field < '04:04:04' and
+date_time < '1904-04-04 04:04:04'
+order by auto;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
+select auto from t1 where
+string < "dddd" and
+vstring < "dddd" and
+bin < 0xDDDD and
+vbin < 0xDDDD and
+tiny > -4 and
+short > -4 and
+medium > -4 and
+long_int > -4 and
+longlong > -4 and
+real_float < 4.4 and
+real_double < 4.4 and
+real_decimal < 4.4 and
+utiny < 4 and
+ushort < 4 and
+umedium < 4 and
+ulong < 4 and
+ulonglong < 4 and
+/* bits < b'100' and */
+(options = 'one' or options = 'two' or options = 'three') and
+(flags = 'one' or flags = 'one,two' or flags = 'one,two,three') and
+date_field < '1904-01-01' and
+year_field < '1904' and
+time_field < '04:04:04' and
+date_time < '1904-04-04 04:04:04'
+order by auto;
+auto
+1
+2
+3
+explain
+select auto from t1 where
+string <= "dddd" and
+vstring <= "dddd" and
+bin <= 0xDDDD and
+vbin <= 0xDDDD and
+tiny >= -4 and
+short >= -4 and
+medium >= -4 and
+long_int >= -4 and
+longlong >= -4 and
+real_float <= 4.5 and
+real_double <= 4.5 and
+real_decimal <= 4.5 and
+utiny <= 4 - 1 + 1 and /* Checking function composition */
+ushort <= 4 and
+umedium <= 4 and
+ulong <= 4 and
+ulonglong <= 4 and
+/* bits <= b'100' and */
+(options = 'one' or options = 'two' or options = 'three' or options = 'four') and
+(flags = 'one' or flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
+date_field <= '1904-04-04' and
+year_field <= '1904' and
+time_field <= '04:04:04' and
+date_time <= '1904-04-04 04:04:04'
+order by auto;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
+select auto from t1 where
+string <= "dddd" and
+vstring <= "dddd" and
+bin <= 0xDDDD and
+vbin <= 0xDDDD and
+tiny >= -4 and
+short >= -4 and
+medium >= -4 and
+long_int >= -4 and
+longlong >= -4 and
+real_float <= 4.5 and
+real_double <= 4.5 and
+real_decimal <= 4.5 and
+utiny <= 4 - 1 + 1 and /* Checking function composition */
+ushort <= 4 and
+umedium <= 4 and
+ulong <= 4 and
+ulonglong <= 4 and
+/* bits <= b'100' and */
+(options = 'one' or options = 'two' or options = 'three' or options = 'four') and
+(flags = 'one' or flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
+date_field <= '1904-04-04' and
+year_field <= '1904' and
+time_field <= '04:04:04' and
+date_time <= '1904-04-04 04:04:04'
+order by auto;
+auto
+1
+2
+3
+4
+create index medium_index on t1(medium);
+explain
+select auto from t1 where
+string = "aaaa" and
+vstring = "aaaa" and
+bin = 0xAAAA and
+vbin = 0xAAAA and
+tiny = -1 and
+short = -1 and
+medium = -1 and
+long_int = -1 and
+longlong = -1 and
+real_float > 1.0 and real_float < 2.0 and
+real_double > 1.0 and real_double < 2.0 and
+real_decimal > 1.0 and real_decimal < 2.0 and
+utiny = 1 and
+ushort = 1 and
+umedium = 1 and
+ulong = 1 and
+ulonglong = 1 and
+/* bits = b'001' and */
+options = 'one' and
+flags = 'one' and
+date_field = '1901-01-01' and
+year_field = '1901' and
+time_field = '01:01:01' and
+date_time = '1901-01-01 01:01:01'
+order by auto;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref medium_index medium_index 3 const # Using where with pushed condition; Using filesort
+select auto from t1 where
+string = "aaaa" and
+vstring = "aaaa" and
+bin = 0xAAAA and
+vbin = 0xAAAA and
+tiny = -1 and
+short = -1 and
+medium = -1 and
+long_int = -1 and
+longlong = -1 and
+real_float > 1.0 and real_float < 2.0 and
+real_double > 1.0 and real_double < 2.0 and
+real_decimal > 1.0 and real_decimal < 2.0 and
+utiny = 1 and
+ushort = 1 and
+umedium = 1 and
+ulong = 1 and
+ulonglong = 1 and
+/* bits = b'001' and */
+options = 'one' and
+flags = 'one' and
+date_field = '1901-01-01' and
+year_field = '1901' and
+time_field = '01:01:01' and
+date_time = '1901-01-01 01:01:01'
+order by auto;
+auto
+1
+explain
+select auto from t1 where
+string != "aaaa" and
+vstring != "aaaa" and
+bin != 0xAAAA and
+vbin != 0xAAAA and
+tiny != -1 and
+short != -1 and
+medium != -1 and
+long_int != -1 and
+longlong != -1 and
+(real_float < 1.0 or real_float > 2.0) and
+(real_double < 1.0 or real_double > 2.0) and
+(real_decimal < 1.0 or real_decimal > 2.0) and
+utiny != 1 and
+ushort != 1 and
+umedium != 1 and
+ulong != 1 and
+ulonglong != 1 and
+/* bits != b'001' and */
+options != 'one' and
+flags != 'one' and
+date_field != '1901-01-01' and
+year_field != '1901' and
+time_field != '01:01:01' and
+date_time != '1901-01-01 01:01:01'
+order by auto;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
+select auto from t1 where
+string != "aaaa" and
+vstring != "aaaa" and
+bin != 0xAAAA and
+vbin != 0xAAAA and
+tiny != -1 and
+short != -1 and
+medium != -1 and
+long_int != -1 and
+longlong != -1 and
+(real_float < 1.0 or real_float > 2.0) and
+(real_double < 1.0 or real_double > 2.0) and
+(real_decimal < 1.0 or real_decimal > 2.0) and
+utiny != 1 and
+ushort != 1 and
+umedium != 1 and
+ulong != 1 and
+ulonglong != 1 and
+/* bits != b'001' and */
+options != 'one' and
+flags != 'one' and
+date_field != '1901-01-01' and
+year_field != '1901' and
+time_field != '01:01:01' and
+date_time != '1901-01-01 01:01:01'
+order by auto;
+auto
+2
+3
+4
+explain
+select auto from t1 where
+string > "aaaa" and
+vstring > "aaaa" and
+bin > 0xAAAA and
+vbin > 0xAAAA and
+tiny < -1 and
+short < -1 and
+medium < -1 and
+long_int < -1 and
+longlong < -1 and
+real_float > 1.1 and
+real_double > 1.1 and
+real_decimal > 1.1 and
+utiny > 1 and
+ushort > 1 and
+umedium > 1 and
+ulong > 1 and
+ulonglong > 1 and
+/* bits > b'001' and */
+(options = 'two' or options = 'three' or options = 'four') and
+(flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
+date_field > '1901-01-01' and
+year_field > '1901' and
+time_field > '01:01:01' and
+date_time > '1901-01-01 01:01:01'
+order by auto;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
+select auto from t1 where
+string > "aaaa" and
+vstring > "aaaa" and
+bin > 0xAAAA and
+vbin > 0xAAAA and
+tiny < -1 and
+short < -1 and
+medium < -1 and
+long_int < -1 and
+longlong < -1 and
+real_float > 1.1 and
+real_double > 1.1 and
+real_decimal > 1.1 and
+utiny > 1 and
+ushort > 1 and
+umedium > 1 and
+ulong > 1 and
+ulonglong > 1 and
+/* bits > b'001' and */
+(options = 'two' or options = 'three' or options = 'four') and
+(flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
+date_field > '1901-01-01' and
+year_field > '1901' and
+time_field > '01:01:01' and
+date_time > '1901-01-01 01:01:01'
+order by auto;
+auto
+2
+3
+4
+explain
+select auto from t1 where
+string >= "aaaa" and
+vstring >= "aaaa" and
+bin >= 0xAAAA and
+vbin >= 0xAAAA and
+tiny <= -1 and
+short <= -1 and
+medium <= -1 and
+long_int <= -1 and
+longlong <= -1 and
+real_float >= 1.0 and
+real_double >= 1.0 and
+real_decimal >= 1.0 and
+utiny >= 1 and
+ushort >= 1 and
+umedium >= 1 and
+ulong >= 1 and
+ulonglong >= 1 and
+/* bits >= b'001' and */
+(options = 'one' or options = 'two' or options = 'three' or options = 'four') and
+(flags = 'one' or flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
+date_field >= '1901-01-01' and
+year_field >= '1901' and
+time_field >= '01:01:01' and
+date_time >= '1901-01-01 01:01:01'
+order by auto;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
+select auto from t1 where
+string >= "aaaa" and
+vstring >= "aaaa" and
+bin >= 0xAAAA and
+vbin >= 0xAAAA and
+tiny <= -1 and
+short <= -1 and
+medium <= -1 and
+long_int <= -1 and
+longlong <= -1 and
+real_float >= 1.0 and
+real_double >= 1.0 and
+real_decimal >= 1.0 and
+utiny >= 1 and
+ushort >= 1 and
+umedium >= 1 and
+ulong >= 1 and
+ulonglong >= 1 and
+/* bits >= b'001' and */
+(options = 'one' or options = 'two' or options = 'three' or options = 'four') and
+(flags = 'one' or flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
+date_field >= '1901-01-01' and
+year_field >= '1901' and
+time_field >= '01:01:01' and
+date_time >= '1901-01-01 01:01:01'
+order by auto;
+auto
+1
+2
+3
+4
+explain
+select auto from t1 where
+string < "dddd" and
+vstring < "dddd" and
+bin < 0xDDDD and
+vbin < 0xDDDD and
+tiny > -4 and
+short > -4 and
+medium > -4 and
+long_int > -4 and
+longlong > -4 and
+real_float < 4.4 and
+real_double < 4.4 and
+real_decimal < 4.4 and
+utiny < 4 and
+ushort < 4 and
+umedium < 4 and
+ulong < 4 and
+ulonglong < 4 and
+/* bits < b'100' and */
+(options = 'one' or options = 'two' or options = 'three') and
+(flags = 'one' or flags = 'one,two' or flags = 'one,two,three') and
+date_field < '1904-01-01' and
+year_field < '1904' and
+time_field < '04:04:04' and
+date_time < '1904-04-04 04:04:04'
+order by auto;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
+select auto from t1 where
+string < "dddd" and
+vstring < "dddd" and
+bin < 0xDDDD and
+vbin < 0xDDDD and
+tiny > -4 and
+short > -4 and
+medium > -4 and
+long_int > -4 and
+longlong > -4 and
+real_float < 4.4 and
+real_double < 4.4 and
+real_decimal < 4.4 and
+utiny < 4 and
+ushort < 4 and
+umedium < 4 and
+ulong < 4 and
+ulonglong < 4 and
+/* bits < b'100' and */
+(options = 'one' or options = 'two' or options = 'three') and
+(flags = 'one' or flags = 'one,two' or flags = 'one,two,three') and
+date_field < '1904-01-01' and
+year_field < '1904' and
+time_field < '04:04:04' and
+date_time < '1904-04-04 04:04:04'
+order by auto;
+auto
+1
+2
+3
+explain
+select auto from t1 where
+string <= "dddd" and
+vstring <= "dddd" and
+bin <= 0xDDDD and
+vbin <= 0xDDDD and
+tiny >= -4 and
+short >= -4 and
+medium >= -4 and
+long_int >= -4 and
+longlong >= -4 and
+real_float <= 4.5 and
+real_double <= 4.5 and
+real_decimal <= 4.5 and
+utiny <= 4 - 1 + 1 and /* Checking function composition */
+ushort <= 4 and
+umedium <= 4 and
+ulong <= 4 and
+ulonglong <= 4 and
+/* bits <= b'100' and */
+(options = 'one' or options = 'two' or options = 'three' or options = 'four') and
+(flags = 'one' or flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
+date_field <= '1904-04-04' and
+year_field <= '1904' and
+time_field <= '04:04:04' and
+date_time <= '1904-04-04 04:04:04'
+order by auto;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
+select auto from t1 where
+string <= "dddd" and
+vstring <= "dddd" and
+bin <= 0xDDDD and
+vbin <= 0xDDDD and
+tiny >= -4 and
+short >= -4 and
+medium >= -4 and
+long_int >= -4 and
+longlong >= -4 and
+real_float <= 4.5 and
+real_double <= 4.5 and
+real_decimal <= 4.5 and
+utiny <= 4 - 1 + 1 and /* Checking function composition */
+ushort <= 4 and
+umedium <= 4 and
+ulong <= 4 and
+ulonglong <= 4 and
+/* bits <= b'100' and */
+(options = 'one' or options = 'two' or options = 'three' or options = 'four') and
+(flags = 'one' or flags = 'one,two' or flags = 'one,two,three' or flags = 'one,two,three,four') and
+date_field <= '1904-04-04' and
+year_field <= '1904' and
+time_field <= '04:04:04' and
+date_time <= '1904-04-04 04:04:04'
+order by auto;
+auto
+1
+2
+3
+4
+explain
+select auto from t1 where
+string like "b%" and
+vstring like "b%" and
+bin like concat(0xBB, '%') and
+vbin like concat(0xBB, '%')
+order by auto;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
+select auto from t1 where
+string like "b%" and
+vstring like "b%" and
+bin like concat(0xBB, '%') and
+vbin like concat(0xBB, '%')
+order by auto;
+auto
+2
+explain
+select auto from t1 where
+string not like "b%" and
+vstring not like "b%" and
+bin not like concat(0xBB, '%') and
+vbin not like concat(0xBB, '%')
+order by auto;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
+select auto from t1 where
+string not like "b%" and
+vstring not like "b%" and
+bin not like concat(0xBB, '%') and
+vbin not like concat(0xBB, '%')
+order by auto;
+auto
+1
+3
+4
+explain
+select auto from t1 where
+(string between "aaaa" and "cccc") and
+(vstring between "aaaa" and "cccc") and
+(bin between 0xAAAA and 0xCCCC) and
+(vbin between 0xAAAA and 0xCCCC) and
+(tiny between -3 and -1) and
+(short between -3 and -1) and
+(medium between -3 and -1) and
+(long_int between -3 and -1) and
+(longlong between -3 and -1) and
+(utiny between 1 and 3) and
+(ushort between 1 and 3) and
+(umedium between 1 and 3) and
+(ulong between 1 and 3) and
+(ulonglong between 1 and 3) and
+/* (bits between b'001' and b'011') and */
+(options between 'one' and 'three') and
+(flags between 'one' and 'one,two,three') and
+(date_field between '1901-01-01' and '1903-03-03') and
+(year_field between '1901' and '1903') and
+(time_field between '01:01:01' and '03:03:03') and
+(date_time between '1901-01-01 01:01:01' and '1903-03-03 03:03:03')
+order by auto;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
+select auto from t1 where
+(string between "aaaa" and "cccc") and
+(vstring between "aaaa" and "cccc") and
+(bin between 0xAAAA and 0xCCCC) and
+(vbin between 0xAAAA and 0xCCCC) and
+(tiny between -3 and -1) and
+(short between -3 and -1) and
+(medium between -3 and -1) and
+(long_int between -3 and -1) and
+(longlong between -3 and -1) and
+(utiny between 1 and 3) and
+(ushort between 1 and 3) and
+(umedium between 1 and 3) and
+(ulong between 1 and 3) and
+(ulonglong between 1 and 3) and
+/* (bits between b'001' and b'011') and */
+(options between 'one' and 'three') and
+(flags between 'one' and 'one,two,three') and
+(date_field between '1901-01-01' and '1903-03-03') and
+(year_field between '1901' and '1903') and
+(time_field between '01:01:01' and '03:03:03') and
+(date_time between '1901-01-01 01:01:01' and '1903-03-03 03:03:03')
+order by auto;
+auto
+1
+3
+explain
+select auto from t1 where
+("aaaa" between string and string) and
+("aaaa" between vstring and vstring) and
+(0xAAAA between bin and bin) and
+(0xAAAA between vbin and vbin) and
+(-1 between tiny and tiny) and
+(-1 between short and short) and
+(-1 between medium and medium) and
+(-1 between long_int and long_int) and
+(-1 between longlong and longlong) and
+(1 between utiny and utiny) and
+(1 between ushort and ushort) and
+(1 between umedium and umedium) and
+(1 between ulong and ulong) and
+(1 between ulonglong and ulonglong) and
+/* (b'001' between bits and bits) and */
+('one' between options and options) and
+('one' between flags and flags) and
+('1901-01-01' between date_field and date_field) and
+('1901' between year_field and year_field) and
+('01:01:01' between time_field and time_field) and
+('1901-01-01 01:01:01' between date_time and date_time)
+order by auto;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
+select auto from t1 where
+("aaaa" between string and string) and
+("aaaa" between vstring and vstring) and
+(0xAAAA between bin and bin) and
+(0xAAAA between vbin and vbin) and
+(-1 between tiny and tiny) and
+(-1 between short and short) and
+(-1 between medium and medium) and
+(-1 between long_int and long_int) and
+(-1 between longlong and longlong) and
+(1 between utiny and utiny) and
+(1 between ushort and ushort) and
+(1 between umedium and umedium) and
+(1 between ulong and ulong) and
+(1 between ulonglong and ulonglong) and
+/* (b'001' between bits and bits) and */
+('one' between options and options) and
+('one' between flags and flags) and
+('1901-01-01' between date_field and date_field) and
+('1901' between year_field and year_field) and
+('01:01:01' between time_field and time_field) and
+('1901-01-01 01:01:01' between date_time and date_time)
+order by auto;
+auto
+1
+explain
+select auto from t1 where
+(string not between "aaaa" and "cccc") and
+(vstring not between "aaaa" and "cccc") and
+(bin not between 0xAAAA and 0xCCCC) and
+(vbin not between 0xAAAA and 0xCCCC) and
+(tiny not between -3 and -1) and
+(short not between -3 and -1) and
+(medium not between -3 and -1) and
+(long_int not between -3 and -1) and
+(longlong not between -3 and -1) and
+(utiny not between 1 and 3) and
+(ushort not between 1 and 3) and
+(umedium not between 1 and 3) and
+(ulong not between 1 and 3) and
+(ulonglong not between 1 and 3) and
+/* (bits not between b'001' and b'011') and */
+(options not between 'one' and 'three') and
+(flags not between 'one' and 'one,two,three') and
+(date_field not between '1901-01-01' and '1903-03-03') and
+(year_field not between '1901' and '1903') and
+(time_field not between '01:01:01' and '03:03:03') and
+(date_time not between '1901-01-01 01:01:01' and '1903-03-03 03:03:03')
+order by auto;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
+select auto from t1 where
+(string not between "aaaa" and "cccc") and
+(vstring not between "aaaa" and "cccc") and
+(bin not between 0xAAAA and 0xCCCC) and
+(vbin not between 0xAAAA and 0xCCCC) and
+(tiny not between -3 and -1) and
+(short not between -3 and -1) and
+(medium not between -3 and -1) and
+(long_int not between -3 and -1) and
+(longlong not between -3 and -1) and
+(utiny not between 1 and 3) and
+(ushort not between 1 and 3) and
+(umedium not between 1 and 3) and
+(ulong not between 1 and 3) and
+(ulonglong not between 1 and 3) and
+/* (bits not between b'001' and b'011') and */
+(options not between 'one' and 'three') and
+(flags not between 'one' and 'one,two,three') and
+(date_field not between '1901-01-01' and '1903-03-03') and
+(year_field not between '1901' and '1903') and
+(time_field not between '01:01:01' and '03:03:03') and
+(date_time not between '1901-01-01 01:01:01' and '1903-03-03 03:03:03')
+order by auto;
+auto
+4
+explain
+select auto from t1 where
+("aaaa" not between string and string) and
+("aaaa" not between vstring and vstring) and
+(0xAAAA not between bin and bin) and
+(0xAAAA not between vbin and vbin) and
+(-1 not between tiny and tiny) and
+(-1 not between short and short) and
+(-1 not between medium and medium) and
+(-1 not between long_int and long_int) and
+(-1 not between longlong and longlong) and
+(1 not between utiny and utiny) and
+(1 not between ushort and ushort) and
+(1 not between umedium and umedium) and
+(1 not between ulong and ulong) and
+(1 not between ulonglong and ulonglong) and
+/* (b'001' not between bits and bits) and */
+('one' not between options and options) and
+('one' not between flags and flags) and
+('1901-01-01' not between date_field and date_field) and
+('1901' not between year_field and year_field) and
+('01:01:01' not between time_field and time_field) and
+('1901-01-01 01:01:01' not between date_time and date_time)
+order by auto;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
+select auto from t1 where
+("aaaa" not between string and string) and
+("aaaa" not between vstring and vstring) and
+(0xAAAA not between bin and bin) and
+(0xAAAA not between vbin and vbin) and
+(-1 not between tiny and tiny) and
+(-1 not between short and short) and
+(-1 not between medium and medium) and
+(-1 not between long_int and long_int) and
+(-1 not between longlong and longlong) and
+(1 not between utiny and utiny) and
+(1 not between ushort and ushort) and
+(1 not between umedium and umedium) and
+(1 not between ulong and ulong) and
+(1 not between ulonglong and ulonglong) and
+/* (b'001' not between bits and bits) and */
+('one' not between options and options) and
+('one' not between flags and flags) and
+('1901-01-01' not between date_field and date_field) and
+('1901' not between year_field and year_field) and
+('01:01:01' not between time_field and time_field) and
+('1901-01-01 01:01:01' not between date_time and date_time)
+order by auto;
+auto
+2
+3
+4
+explain
+select auto from t1 where
+string in("aaaa","cccc") and
+vstring in("aaaa","cccc") and
+bin in(0xAAAA,0xCCCC) and
+vbin in(0xAAAA,0xCCCC) and
+tiny in(-1,-3) and
+short in(-1,-3) and
+medium in(-1,-3) and
+long_int in(-1,-3) and
+longlong in(-1,-3) and
+utiny in(1,3) and
+ushort in(1,3) and
+umedium in(1,3) and
+ulong in(1,3) and
+ulonglong in(1,3) and
+/* bits in(b'001',b'011') and */
+options in('one','three') and
+flags in('one','one,two,three') and
+date_field in('1901-01-01','1903-03-03') and
+year_field in('1901','1903') and
+time_field in('01:01:01','03:03:03') and
+date_time in('1901-01-01 01:01:01','1903-03-03 03:03:03')
+order by auto;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
+select auto from t1 where
+string in("aaaa","cccc") and
+vstring in("aaaa","cccc") and
+bin in(0xAAAA,0xCCCC) and
+vbin in(0xAAAA,0xCCCC) and
+tiny in(-1,-3) and
+short in(-1,-3) and
+medium in(-1,-3) and
+long_int in(-1,-3) and
+longlong in(-1,-3) and
+utiny in(1,3) and
+ushort in(1,3) and
+umedium in(1,3) and
+ulong in(1,3) and
+ulonglong in(1,3) and
+/* bits in(b'001',b'011') and */
+options in('one','three') and
+flags in('one','one,two,three') and
+date_field in('1901-01-01','1903-03-03') and
+year_field in('1901','1903') and
+time_field in('01:01:01','03:03:03') and
+date_time in('1901-01-01 01:01:01','1903-03-03 03:03:03')
+order by auto;
+auto
+1
+3
+explain
+select auto from t1 where
+"aaaa" in(string) and
+"aaaa" in(vstring) and
+0xAAAA in(bin) and
+0xAAAA in(vbin) and
+(-1 in(tiny)) and
+(-1 in (short)) and
+(-1 in(medium)) and
+(-1 in(long_int)) and
+(-1 in(longlong)) and
+1 in(utiny) and
+1 in(ushort) and
+1 in(umedium) and
+1 in(ulong) and
+1 in(ulonglong) and
+/* b'001' in(bits) and */
+'one' in(options) and
+'one' in(flags) and
+'1901-01-01' in(date_field) and
+'1901' in(year_field) and
+'01:01:01' in(time_field) and
+'1901-01-01 01:01:01' in(date_time)
+order by auto;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref medium_index medium_index 3 const # Using where with pushed condition; Using filesort
+select auto from t1 where
+"aaaa" in(string) and
+"aaaa" in(vstring) and
+0xAAAA in(bin) and
+0xAAAA in(vbin) and
+(-1 in(tiny)) and
+(-1 in (short)) and
+(-1 in(medium)) and
+(-1 in(long_int)) and
+(-1 in(longlong)) and
+1 in(utiny) and
+1 in(ushort) and
+1 in(umedium) and
+1 in(ulong) and
+1 in(ulonglong) and
+/* b'001' in(bits) and */
+'one' in(options) and
+'one' in(flags) and
+'1901-01-01' in(date_field) and
+'1901' in(year_field) and
+'01:01:01' in(time_field) and
+'1901-01-01 01:01:01' in(date_time)
+order by auto;
+auto
+1
+explain
+select auto from t1 where
+string not in("aaaa","cccc") and
+vstring not in("aaaa","cccc") and
+bin not in(0xAAAA,0xCCCC) and
+vbin not in(0xAAAA,0xCCCC) and
+tiny not in(-1,-3) and
+short not in(-1,-3) and
+medium not in(-1,-3) and
+long_int not in(-1,-3) and
+longlong not in(-1,-3) and
+utiny not in(1,3) and
+ushort not in(1,3) and
+umedium not in(1,3) and
+ulong not in(1,3) and
+ulonglong not in(1,3) and
+/* bits not in(b'001',b'011') and */
+options not in('one','three') and
+flags not in('one','one,two,three') and
+date_field not in('1901-01-01','1903-03-03') and
+year_field not in('1901','1903') and
+time_field not in('01:01:01','03:03:03') and
+date_time not in('1901-01-01 01:01:01','1903-03-03 03:03:03')
+order by auto;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
+select auto from t1 where
+string not in("aaaa","cccc") and
+vstring not in("aaaa","cccc") and
+bin not in(0xAAAA,0xCCCC) and
+vbin not in(0xAAAA,0xCCCC) and
+tiny not in(-1,-3) and
+short not in(-1,-3) and
+medium not in(-1,-3) and
+long_int not in(-1,-3) and
+longlong not in(-1,-3) and
+utiny not in(1,3) and
+ushort not in(1,3) and
+umedium not in(1,3) and
+ulong not in(1,3) and
+ulonglong not in(1,3) and
+/* bits not in(b'001',b'011') and */
+options not in('one','three') and
+flags not in('one','one,two,three') and
+date_field not in('1901-01-01','1903-03-03') and
+year_field not in('1901','1903') and
+time_field not in('01:01:01','03:03:03') and
+date_time not in('1901-01-01 01:01:01','1903-03-03 03:03:03')
+order by auto;
+auto
+2
+4
+explain
+select auto from t1 where
+"aaaa" not in(string) and
+"aaaa" not in(vstring) and
+0xAAAA not in(bin) and
+0xAAAA not in(vbin) and
+(-1 not in(tiny)) and
+(-1 not in(short)) and
+(-1 not in(medium)) and
+(-1 not in(long_int)) and
+(-1 not in(longlong)) and
+1 not in(utiny) and
+1 not in(ushort) and
+1 not in(umedium) and
+1 not in(ulong) and
+1 not in(ulonglong) and
+/* b'001' not in(bits) and */
+'one' not in(options) and
+'one' not in(flags) and
+'1901-01-01' not in(date_field) and
+'1901' not in(year_field) and
+'01:01:01' not in(time_field) and
+'1901-01-01 01:01:01' not in(date_time)
+order by auto;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
+select auto from t1 where
+"aaaa" not in(string) and
+"aaaa" not in(vstring) and
+0xAAAA not in(bin) and
+0xAAAA not in(vbin) and
+(-1 not in(tiny)) and
+(-1 not in(short)) and
+(-1 not in(medium)) and
+(-1 not in(long_int)) and
+(-1 not in(longlong)) and
+1 not in(utiny) and
+1 not in(ushort) and
+1 not in(umedium) and
+1 not in(ulong) and
+1 not in(ulonglong) and
+/* b'001' not in(bits) and */
+'one' not in(options) and
+'one' not in(flags) and
+'1901-01-01' not in(date_field) and
+'1901' not in(year_field) and
+'01:01:01' not in(time_field) and
+'1901-01-01 01:01:01' not in(date_time)
+order by auto;
+auto
+2
+3
+4
+update t1
+set medium = 17
+where
+string = "aaaa" and
+vstring = "aaaa" and
+bin = 0xAAAA and
+vbin = 0xAAAA and
+tiny = -1 and
+short = -1 and
+medium = -1 and
+long_int = -1 and
+longlong = -1 and
+real_float > 1.0 and real_float < 2.0 and
+real_double > 1.0 and real_double < 2.0 and
+real_decimal > 1.0 and real_decimal < 2.0 and
+utiny = 1 and
+ushort = 1 and
+umedium = 1 and
+ulong = 1 and
+ulonglong = 1 and
+/* bits = b'001' and */
+options = 'one' and
+flags = 'one' and
+date_field = '1901-01-01' and
+year_field = '1901' and
+time_field = '01:01:01' and
+date_time = '1901-01-01 01:01:01';
+delete from t1
+where
+string = "aaaa" and
+vstring = "aaaa" and
+bin = 0xAAAA and
+vbin = 0xAAAA and
+tiny = -1 and
+short = -1 and
+medium = 17 and
+long_int = -1 and
+longlong = -1 and
+real_float > 1.0 and real_float < 2.0 and
+real_double > 1.0 and real_double < 2.0 and
+real_decimal > 1.0 and real_decimal < 2.0 and
+utiny = 1 and
+ushort = 1 and
+umedium = 1 and
+ulong = 1 and
+ulonglong = 1 and
+/* bits = b'001' and */
+options = 'one' and
+flags = 'one' and
+date_field = '1901-01-01' and
+year_field = '1901' and
+time_field = '01:01:01' and
+date_time = '1901-01-01 01:01:01';
+select count(*) from t1;
+count(*)
+3
+explain
+select * from t2 where attr3 is null or attr1 > 2 and pk1= 3 order by pk1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL PRIMARY NULL NULL NULL # Using where with pushed condition; Using filesort
+select * from t2 where attr3 is null or attr1 > 2 and pk1= 3 order by pk1;
+pk1 attr1 attr2 attr3
+2 2 NULL NULL
+3 3 3 d
+explain
+select * from t2 where attr3 is not null and attr1 > 2 order by pk1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
+select * from t2 where attr3 is not null and attr1 > 2 order by pk1;
+pk1 attr1 attr2 attr3
+3 3 3 d
+4 4 4 e
+5 5 5 f
+explain
+select * from t3 where attr2 > 9223372036854775803 and attr3 != 3 order by pk1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t3 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
+select * from t3 where attr2 > 9223372036854775803 and attr3 != 3 order by pk1;
+pk1 attr1 attr2 attr3 attr4
+2 2 9223372036854775804 2 c
+4 4 9223372036854775806 4 e
+5 5 9223372036854775807 5 f
+explain
+select * from t2,t3 where t2.attr1 < 1 and t2.attr2 = t3.attr2 and t3.attr1 < 5 order by t2.pk1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL # Using where with pushed condition; Using temporary; Using filesort
+1 SIMPLE t3 ALL NULL NULL NULL NULL # Using where with pushed condition; Using join buffer
+select * from t2,t3 where t2.attr1 < 1 and t2.attr2 = t3.attr2 and t3.attr1 < 5 order by t2.pk1;
+pk1 attr1 attr2 attr3 pk1 attr1 attr2 attr3 attr4
+0 0 0 a 0 0 0 0 a
+explain
+select * from t4 where attr1 < 5 and attr2 > 9223372036854775803 and attr3 != 3 order by t4.pk1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 range attr1 attr1 4 NULL # Using where with pushed condition; Using filesort
+select * from t4 where attr1 < 5 and attr2 > 9223372036854775803 and attr3 != 3 order by t4.pk1;
+pk1 attr1 attr2 attr3 attr4
+2 2 9223372036854775804 2 c
+4 4 9223372036854775806 4 e
+explain
+select * from t3,t4 where t4.attr1 > 1 and t4.attr2 = t3.attr2 and t4.attr3 < 5 order by t4.pk1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 range attr1 attr1 4 NULL # Using where with pushed condition; Using temporary; Using filesort
+1 SIMPLE t3 ALL NULL NULL NULL NULL # Using where; Using join buffer
+select * from t3,t4 where t4.attr1 > 1 and t4.attr2 = t3.attr2 and t4.attr3 < 5 order by t4.pk1;
+pk1 attr1 attr2 attr3 attr4 pk1 attr1 attr2 attr3 attr4
+2 2 9223372036854775804 2 c 2 2 9223372036854775804 2 c
+3 3 9223372036854775805 3 d 3 3 9223372036854775805 3 d
+4 4 9223372036854775806 4 e 4 4 9223372036854775806 4 e
+explain
+select auto from t1 where string = "aaaa" collate latin1_general_ci order by auto;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where; Using filesort
+explain
+select * from t2 where (attr1 < 2) = (attr2 < 2) order by pk1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL # Using where; Using filesort
+explain
+select * from t3 left join t4 on t4.attr2 = t3.attr2 where t4.attr1 > 1 and t4.attr3 < 5 or t4.attr1 is null order by t4.pk1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t3 ALL NULL NULL NULL NULL # Using temporary; Using filesort
+1 SIMPLE t4 ALL NULL NULL NULL NULL # Using where
+create table t5 (a int primary key auto_increment, b tinytext not null)
+engine = ndb;
+insert into t5 (b) values ('jonas'), ('jensing'), ('johan');
+set engine_condition_pushdown = off;
+select * from t5 where b like '%jo%' order by a;
+a b
+1 jonas
+3 johan
+set engine_condition_pushdown = on;
+explain select * from t5 where b like '%jo%';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t5 ALL NULL NULL NULL NULL # Using where
+select * from t5 where b like '%jo%' order by a;
+a b
+1 jonas
+3 johan
+set engine_condition_pushdown = off;
+select auto from t1 where date_time like '1902-02-02 %' order by auto;
+auto
+2
+select auto from t1 where date_time not like '1902-02-02 %' order by auto;
+auto
+3
+4
+set engine_condition_pushdown = on;
+explain select auto from t1 where date_time like '1902-02-02 %';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where
+select auto from t1 where date_time like '1902-02-02 %' order by auto;
+auto
+2
+explain select auto from t1 where date_time not like '1902-02-02 %';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where
+select auto from t1 where date_time not like '1902-02-02 %' order by auto;
+auto
+3
+4
+drop table t1;
+create table t1 (a int, b varchar(3), primary key using hash(a))
+engine=ndb;
+insert into t1 values (1,'a'), (2,'ab'), (3,'abc');
+set engine_condition_pushdown = off;
+select * from t1 where b like 'ab';
+a b
+2 ab
+select * from t1 where b like 'ab' or b like 'ab';
+a b
+2 ab
+select * from t1 where b like 'abc';
+a b
+3 abc
+select * from t1 where b like 'abc' or b like 'abc';
+a b
+3 abc
+set engine_condition_pushdown = on;
+select * from t1 where b like 'ab';
+a b
+2 ab
+select * from t1 where b like 'ab' or b like 'ab';
+a b
+2 ab
+select * from t1 where b like 'abc';
+a b
+3 abc
+select * from t1 where b like 'abc' or b like 'abc';
+a b
+3 abc
+drop table t1;
+create table t1 (a int, b char(3), primary key using hash(a))
+engine=ndb;
+insert into t1 values (1,'a'), (2,'ab'), (3,'abc');
+set engine_condition_pushdown = off;
+select * from t1 where b like 'ab';
+a b
+2 ab
+select * from t1 where b like 'ab' or b like 'ab';
+a b
+2 ab
+select * from t1 where b like 'abc';
+a b
+3 abc
+select * from t1 where b like 'abc' or b like 'abc';
+a b
+3 abc
+set engine_condition_pushdown = on;
+select * from t1 where b like 'ab';
+a b
+2 ab
+select * from t1 where b like 'ab' or b like 'ab';
+a b
+2 ab
+select * from t1 where b like 'abc';
+a b
+3 abc
+select * from t1 where b like 'abc' or b like 'abc';
+a b
+3 abc
+drop table t1;
+create table t1 ( fname varchar(255), lname varchar(255) )
+engine=ndbcluster;
+insert into t1 values ("Young","Foo");
+set engine_condition_pushdown = 0;
+SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
+fname lname
+Young Foo
+set engine_condition_pushdown = 1;
+SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
+fname lname
+Young Foo
+insert into t1 values ("aaa", "aaa");
+insert into t1 values ("bbb", "bbb");
+insert into t1 values ("ccc", "ccc");
+insert into t1 values ("ddd", "ddd");
+set engine_condition_pushdown = 0;
+SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
+fname lname
+Young Foo
+set engine_condition_pushdown = 1;
+SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
+fname lname
+Young Foo
+set engine_condition_pushdown = @old_ecpd;
+DROP TABLE t1,t2,t3,t4,t5;
diff --git a/mysql-test/r/ndb_config.result b/mysql-test/suite/ndb/r/ndb_config.result
index 9495af29df6..9495af29df6 100644
--- a/mysql-test/r/ndb_config.result
+++ b/mysql-test/suite/ndb/r/ndb_config.result
diff --git a/mysql-test/r/ndb_config2.result b/mysql-test/suite/ndb/r/ndb_config2.result
index cfd012933c4..cfd012933c4 100644
--- a/mysql-test/r/ndb_config2.result
+++ b/mysql-test/suite/ndb/r/ndb_config2.result
diff --git a/mysql-test/r/ndb_cursor.result b/mysql-test/suite/ndb/r/ndb_cursor.result
index b3b815ef891..b3b815ef891 100644
--- a/mysql-test/r/ndb_cursor.result
+++ b/mysql-test/suite/ndb/r/ndb_cursor.result
diff --git a/mysql-test/r/ndb_database.result b/mysql-test/suite/ndb/r/ndb_database.result
index e3da4af0265..e3da4af0265 100644
--- a/mysql-test/r/ndb_database.result
+++ b/mysql-test/suite/ndb/r/ndb_database.result
diff --git a/mysql-test/suite/ndb/r/ndb_dd_alter.result b/mysql-test/suite/ndb/r/ndb_dd_alter.result
new file mode 100644
index 00000000000..94426546115
--- /dev/null
+++ b/mysql-test/suite/ndb/r/ndb_dd_alter.result
@@ -0,0 +1,560 @@
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+**** Test Setup Section ****
+CREATE LOGFILE GROUP lg
+ADD UNDOFILE './lg_group/undofile.dat'
+ INITIAL_SIZE 16M
+UNDO_BUFFER_SIZE = 1M
+ENGINE=NDB;
+CREATE TABLESPACE ts
+ADD DATAFILE './table_space/datafile.dat'
+ USE LOGFILE GROUP lg
+INITIAL_SIZE 12M
+ENGINE NDB;
+CREATE TABLE test.t1 (
+a1 smallint NOT NULL,
+a2 int NOT NULL,
+a3 bigint NOT NULL,
+a4 char(10),
+a5 decimal(5,1),
+a6 time,
+a7 date,
+a8 datetime,
+a9 VARCHAR(255),
+a10 blob,
+PRIMARY KEY(a1)
+) ENGINE=InnoDB;
+SHOW CREATE TABLE test.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a1` smallint(6) NOT NULL,
+ `a2` int(11) NOT NULL,
+ `a3` bigint(20) NOT NULL,
+ `a4` char(10) DEFAULT NULL,
+ `a5` decimal(5,1) DEFAULT NULL,
+ `a6` time DEFAULT NULL,
+ `a7` date DEFAULT NULL,
+ `a8` datetime DEFAULT NULL,
+ `a9` varchar(255) DEFAULT NULL,
+ `a10` blob,
+ PRIMARY KEY (`a1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT * FROM test.t1 ORDER BY a1;
+a1 a2 a3 a4 a5 a6 a7 a8 a9 a10
+1 2 2000000001 aaa1 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb1 binary data
+2 3 2000000002 aaa2 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb2 binary data
+3 4 2000000003 aaa3 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb3 binary data
+4 5 2000000004 aaa4 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb4 binary data
+5 6 2000000005 aaa5 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb5 binary data
+6 7 2000000006 aaa6 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb6 binary data
+7 8 2000000007 aaa7 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb7 binary data
+8 9 2000000008 aaa8 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb8 binary data
+9 10 2000000009 aaa9 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb9 binary data
+10 11 2000000010 aaa10 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb10 binary data
+11 12 2000000011 aaa11 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb11 binary data
+12 13 2000000012 aaa12 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb12 binary data
+13 14 2000000013 aaa13 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb13 binary data
+14 15 2000000014 aaa14 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb14 binary data
+15 16 2000000015 aaa15 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb15 binary data
+16 17 2000000016 aaa16 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb16 binary data
+17 18 2000000017 aaa17 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb17 binary data
+18 19 2000000018 aaa18 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb18 binary data
+19 20 2000000019 aaa19 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb19 binary data
+20 21 2000000020 aaa20 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb20 binary data
+ALTER TABLE test.t1 TABLESPACE ts STORAGE DISK ENGINE=NDB;
+SHOW CREATE TABLE test.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a1` smallint(6) NOT NULL,
+ `a2` int(11) NOT NULL,
+ `a3` bigint(20) NOT NULL,
+ `a4` char(10) DEFAULT NULL,
+ `a5` decimal(5,1) DEFAULT NULL,
+ `a6` time DEFAULT NULL,
+ `a7` date DEFAULT NULL,
+ `a8` datetime DEFAULT NULL,
+ `a9` varchar(255) DEFAULT NULL,
+ `a10` blob,
+ PRIMARY KEY (`a1`)
+) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+a1 Smallint PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
+a2 Int NOT NULL AT=FIXED ST=DISK
+a3 Bigint NOT NULL AT=FIXED ST=DISK
+a4 Char(10;latin1_swedish_ci) NULL AT=FIXED ST=DISK
+a5 Decimal(5,1) NULL AT=FIXED ST=DISK
+a6 Time NULL AT=FIXED ST=DISK
+a7 Date NULL AT=FIXED ST=DISK
+a8 Datetime NULL AT=FIXED ST=DISK
+a9 Varchar(255;latin1_swedish_ci) NULL AT=FIXED ST=DISK
+a10 Blob(256,2000;16) NULL AT=FIXED ST=MEMORY
+SELECT * FROM test.t1 ORDER BY a1;
+a1 a2 a3 a4 a5 a6 a7 a8 a9 a10
+1 2 2000000001 aaa1 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb1 binary data
+2 3 2000000002 aaa2 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb2 binary data
+3 4 2000000003 aaa3 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb3 binary data
+4 5 2000000004 aaa4 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb4 binary data
+5 6 2000000005 aaa5 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb5 binary data
+6 7 2000000006 aaa6 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb6 binary data
+7 8 2000000007 aaa7 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb7 binary data
+8 9 2000000008 aaa8 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb8 binary data
+9 10 2000000009 aaa9 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb9 binary data
+10 11 2000000010 aaa10 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb10 binary data
+11 12 2000000011 aaa11 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb11 binary data
+12 13 2000000012 aaa12 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb12 binary data
+13 14 2000000013 aaa13 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb13 binary data
+14 15 2000000014 aaa14 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb14 binary data
+15 16 2000000015 aaa15 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb15 binary data
+16 17 2000000016 aaa16 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb16 binary data
+17 18 2000000017 aaa17 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb17 binary data
+18 19 2000000018 aaa18 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb18 binary data
+19 20 2000000019 aaa19 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb19 binary data
+20 21 2000000020 aaa20 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb20 binary data
+DROP TABLE test.t1;
+CREATE TABLE test.t1 (
+a1 smallint NOT NULL,
+a2 int NOT NULL,
+a3 bigint NOT NULL,
+a4 char(10),
+a5 decimal(5,1),
+a6 time,
+a7 date,
+a8 datetime,
+a9 VARCHAR(255),
+a10 blob,
+PRIMARY KEY(a1)
+) ENGINE=MyISAM;
+SHOW CREATE TABLE test.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a1` smallint(6) NOT NULL,
+ `a2` int(11) NOT NULL,
+ `a3` bigint(20) NOT NULL,
+ `a4` char(10) DEFAULT NULL,
+ `a5` decimal(5,1) DEFAULT NULL,
+ `a6` time DEFAULT NULL,
+ `a7` date DEFAULT NULL,
+ `a8` datetime DEFAULT NULL,
+ `a9` varchar(255) DEFAULT NULL,
+ `a10` blob,
+ PRIMARY KEY (`a1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM test.t1 ORDER BY a1;
+a1 a2 a3 a4 a5 a6 a7 a8 a9 a10
+1 2 2000000001 aaa1 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb1 binary data
+2 3 2000000002 aaa2 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb2 binary data
+3 4 2000000003 aaa3 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb3 binary data
+4 5 2000000004 aaa4 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb4 binary data
+5 6 2000000005 aaa5 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb5 binary data
+6 7 2000000006 aaa6 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb6 binary data
+7 8 2000000007 aaa7 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb7 binary data
+8 9 2000000008 aaa8 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb8 binary data
+9 10 2000000009 aaa9 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb9 binary data
+10 11 2000000010 aaa10 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb10 binary data
+11 12 2000000011 aaa11 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb11 binary data
+12 13 2000000012 aaa12 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb12 binary data
+13 14 2000000013 aaa13 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb13 binary data
+14 15 2000000014 aaa14 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb14 binary data
+15 16 2000000015 aaa15 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb15 binary data
+16 17 2000000016 aaa16 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb16 binary data
+17 18 2000000017 aaa17 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb17 binary data
+18 19 2000000018 aaa18 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb18 binary data
+19 20 2000000019 aaa19 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb19 binary data
+20 21 2000000020 aaa20 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb20 binary data
+ALTER TABLE test.t1 TABLESPACE ts STORAGE DISK ENGINE=NDB;
+SHOW CREATE TABLE test.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a1` smallint(6) NOT NULL,
+ `a2` int(11) NOT NULL,
+ `a3` bigint(20) NOT NULL,
+ `a4` char(10) DEFAULT NULL,
+ `a5` decimal(5,1) DEFAULT NULL,
+ `a6` time DEFAULT NULL,
+ `a7` date DEFAULT NULL,
+ `a8` datetime DEFAULT NULL,
+ `a9` varchar(255) DEFAULT NULL,
+ `a10` blob,
+ PRIMARY KEY (`a1`)
+) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+a1 Smallint PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
+a2 Int NOT NULL AT=FIXED ST=DISK
+a3 Bigint NOT NULL AT=FIXED ST=DISK
+a4 Char(10;latin1_swedish_ci) NULL AT=FIXED ST=DISK
+a5 Decimal(5,1) NULL AT=FIXED ST=DISK
+a6 Time NULL AT=FIXED ST=DISK
+a7 Date NULL AT=FIXED ST=DISK
+a8 Datetime NULL AT=FIXED ST=DISK
+a9 Varchar(255;latin1_swedish_ci) NULL AT=FIXED ST=DISK
+a10 Blob(256,2000;16) NULL AT=FIXED ST=MEMORY
+SELECT * FROM test.t1 ORDER BY a1;
+a1 a2 a3 a4 a5 a6 a7 a8 a9 a10
+1 2 2000000001 aaa1 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb1 binary data
+2 3 2000000002 aaa2 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb2 binary data
+3 4 2000000003 aaa3 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb3 binary data
+4 5 2000000004 aaa4 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb4 binary data
+5 6 2000000005 aaa5 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb5 binary data
+6 7 2000000006 aaa6 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb6 binary data
+7 8 2000000007 aaa7 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb7 binary data
+8 9 2000000008 aaa8 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb8 binary data
+9 10 2000000009 aaa9 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb9 binary data
+10 11 2000000010 aaa10 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb10 binary data
+11 12 2000000011 aaa11 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb11 binary data
+12 13 2000000012 aaa12 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb12 binary data
+13 14 2000000013 aaa13 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb13 binary data
+14 15 2000000014 aaa14 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb14 binary data
+15 16 2000000015 aaa15 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb15 binary data
+16 17 2000000016 aaa16 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb16 binary data
+17 18 2000000017 aaa17 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb17 binary data
+18 19 2000000018 aaa18 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb18 binary data
+19 20 2000000019 aaa19 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb19 binary data
+20 21 2000000020 aaa20 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb20 binary data
+ALTER TABLE test.t1 ENGINE=InnoDB;
+SHOW CREATE TABLE test.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a1` smallint(6) NOT NULL,
+ `a2` int(11) NOT NULL,
+ `a3` bigint(20) NOT NULL,
+ `a4` char(10) DEFAULT NULL,
+ `a5` decimal(5,1) DEFAULT NULL,
+ `a6` time DEFAULT NULL,
+ `a7` date DEFAULT NULL,
+ `a8` datetime DEFAULT NULL,
+ `a9` varchar(255) DEFAULT NULL,
+ `a10` blob,
+ PRIMARY KEY (`a1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT * FROM test.t1 ORDER BY a1;
+a1 a2 a3 a4 a5 a6 a7 a8 a9 a10
+1 2 2000000001 aaa1 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb1 binary data
+2 3 2000000002 aaa2 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb2 binary data
+3 4 2000000003 aaa3 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb3 binary data
+4 5 2000000004 aaa4 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb4 binary data
+5 6 2000000005 aaa5 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb5 binary data
+6 7 2000000006 aaa6 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb6 binary data
+7 8 2000000007 aaa7 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb7 binary data
+8 9 2000000008 aaa8 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb8 binary data
+9 10 2000000009 aaa9 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb9 binary data
+10 11 2000000010 aaa10 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb10 binary data
+11 12 2000000011 aaa11 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb11 binary data
+12 13 2000000012 aaa12 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb12 binary data
+13 14 2000000013 aaa13 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb13 binary data
+14 15 2000000014 aaa14 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb14 binary data
+15 16 2000000015 aaa15 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb15 binary data
+16 17 2000000016 aaa16 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb16 binary data
+17 18 2000000017 aaa17 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb17 binary data
+18 19 2000000018 aaa18 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb18 binary data
+19 20 2000000019 aaa19 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb19 binary data
+20 21 2000000020 aaa20 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb20 binary data
+ALTER TABLE test.t1 TABLESPACE ts STORAGE DISK ENGINE=NDB;
+SHOW CREATE TABLE test.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a1` smallint(6) NOT NULL,
+ `a2` int(11) NOT NULL,
+ `a3` bigint(20) NOT NULL,
+ `a4` char(10) DEFAULT NULL,
+ `a5` decimal(5,1) DEFAULT NULL,
+ `a6` time DEFAULT NULL,
+ `a7` date DEFAULT NULL,
+ `a8` datetime DEFAULT NULL,
+ `a9` varchar(255) DEFAULT NULL,
+ `a10` blob,
+ PRIMARY KEY (`a1`)
+) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+a1 Smallint PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
+a2 Int NOT NULL AT=FIXED ST=DISK
+a3 Bigint NOT NULL AT=FIXED ST=DISK
+a4 Char(10;latin1_swedish_ci) NULL AT=FIXED ST=DISK
+a5 Decimal(5,1) NULL AT=FIXED ST=DISK
+a6 Time NULL AT=FIXED ST=DISK
+a7 Date NULL AT=FIXED ST=DISK
+a8 Datetime NULL AT=FIXED ST=DISK
+a9 Varchar(255;latin1_swedish_ci) NULL AT=FIXED ST=DISK
+a10 Blob(256,2000;16) NULL AT=FIXED ST=MEMORY
+ALTER TABLE test.t1 ENGINE=MyISAM;
+SHOW CREATE TABLE test.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a1` smallint(6) NOT NULL,
+ `a2` int(11) NOT NULL,
+ `a3` bigint(20) NOT NULL,
+ `a4` char(10) DEFAULT NULL,
+ `a5` decimal(5,1) DEFAULT NULL,
+ `a6` time DEFAULT NULL,
+ `a7` date DEFAULT NULL,
+ `a8` datetime DEFAULT NULL,
+ `a9` varchar(255) DEFAULT NULL,
+ `a10` blob,
+ PRIMARY KEY (`a1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE test.t1;
+CREATE TABLE test.t1 (a1 INT PRIMARY KEY) TABLESPACE ts STORAGE DISK ENGINE=NDB;
+SELECT * FROM test.t1 ORDER BY a1;
+a1
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+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
+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
+SELECT * FROM test.t1 ORDER BY a1;
+a1 a2 a3
+1 2.2345 20000001
+2 3.2345 20000002
+3 4.2345 20000003
+4 5.2345 20000004
+5 6.2345 20000005
+6 7.2345 20000006
+7 8.2345 20000007
+8 9.2345 20000008
+9 10.2345 20000009
+10 11.2345 20000010
+11 12.2345 20000011
+12 13.2345 20000012
+13 14.2345 20000013
+14 15.2345 20000014
+15 16.2345 20000015
+16 17.2345 20000016
+17 18.2345 20000017
+18 19.2345 20000018
+19 20.2345 20000019
+20 21.2345 20000020
+ALTER TABLE test.t1 ADD a4 BIT, ADD a5 TINYINT, ADD a6 BIGINT, ADD a7 DATE, ADD a8 TIME;
+SELECT a1,a2,a3,hex(a4), a5,a6,a7,a8 FROM test.t1 ORDER BY a1;
+a1 a2 a3 hex(a4) a5 a6 a7 a8
+1 2.2345 20000001 0 1 23457 2006-01-01 07:04:00
+2 3.2345 20000002 0 1 23458 2006-01-01 07:04:00
+3 4.2345 20000003 0 1 23459 2006-01-01 07:04:00
+4 5.2345 20000004 0 1 23460 2006-01-01 07:04:00
+5 6.2345 20000005 0 1 23461 2006-01-01 07:04:00
+6 7.2345 20000006 0 1 23462 2006-01-01 07:04:00
+7 8.2345 20000007 0 1 23463 2006-01-01 07:04:00
+8 9.2345 20000008 0 1 23464 2006-01-01 07:04:00
+9 10.2345 20000009 0 1 23465 2006-01-01 07:04:00
+10 11.2345 20000010 0 1 23466 2006-01-01 07:04:00
+11 12.2345 20000011 0 1 23467 2006-01-01 07:04:00
+12 13.2345 20000012 0 1 23468 2006-01-01 07:04:00
+13 14.2345 20000013 0 1 23469 2006-01-01 07:04:00
+14 15.2345 20000014 0 1 23470 2006-01-01 07:04:00
+15 16.2345 20000015 0 1 23471 2006-01-01 07:04:00
+16 17.2345 20000016 0 1 23472 2006-01-01 07:04:00
+17 18.2345 20000017 0 1 23473 2006-01-01 07:04:00
+18 19.2345 20000018 0 1 23474 2006-01-01 07:04:00
+19 20.2345 20000019 0 1 23475 2006-01-01 07:04:00
+20 21.2345 20000020 0 1 23476 2006-01-01 07:04:00
+ALTER TABLE test.t1 ADD a9 DATETIME, ADD a10 TINYTEXT, ADD a11 MEDIUMTEXT, ADD a12 LONGTEXT, ADD a13 TEXT, ADD a14 BLOB;
+SHOW CREATE TABLE test.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a1` int(11) NOT NULL,
+ `a2` float DEFAULT NULL,
+ `a3` double DEFAULT NULL,
+ `a4` bit(1) DEFAULT NULL,
+ `a5` tinyint(4) DEFAULT NULL,
+ `a6` bigint(20) DEFAULT NULL,
+ `a7` date DEFAULT NULL,
+ `a8` time DEFAULT NULL,
+ `a9` datetime DEFAULT NULL,
+ `a10` tinytext,
+ `a11` mediumtext,
+ `a12` longtext,
+ `a13` text,
+ `a14` blob,
+ PRIMARY KEY (`a1`)
+) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+a1 Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
+a2 Float NULL AT=FIXED ST=DISK
+a3 Double NULL AT=FIXED ST=DISK
+a4 Bit(1) NULL AT=FIXED ST=DISK
+a5 Tinyint NULL AT=FIXED ST=DISK
+a6 Bigint NULL AT=FIXED ST=DISK
+a7 Date NULL AT=FIXED ST=DISK
+a8 Time NULL AT=FIXED ST=DISK
+a9 Datetime NULL AT=FIXED ST=DISK
+a10 Text(256,0;0;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
+a11 Text(256,4000;8;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
+a12 Text(256,8000;4;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
+a13 Text(256,2000;16;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
+a14 Blob(256,2000;16) NULL AT=FIXED ST=MEMORY
+SELECT a1, a2,a3,hex(a4),a5,a6,a7,a8,a9,a10,a11,a12,a13 FROM test.t1 ORDER BY a1;
+a1 a2 a3 hex(a4) a5 a6 a7 a8 a9 a10 a11 a12 a13
+1 2.2345 20000001 0 1 23457 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
+2 3.2345 20000002 0 1 23458 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
+3 4.2345 20000003 0 1 23459 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
+4 5.2345 20000004 0 1 23460 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
+5 6.2345 20000005 0 1 23461 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
+6 7.2345 20000006 0 1 23462 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
+7 8.2345 20000007 0 1 23463 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
+8 9.2345 20000008 0 1 23464 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
+9 10.2345 20000009 0 1 23465 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
+10 11.2345 20000010 0 1 23466 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
+11 12.2345 20000011 0 1 23467 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
+12 13.2345 20000012 0 1 23468 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
+13 14.2345 20000013 0 1 23469 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
+14 15.2345 20000014 0 1 23470 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
+15 16.2345 20000015 0 1 23471 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
+16 17.2345 20000016 0 1 23472 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
+17 18.2345 20000017 0 1 23473 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
+18 19.2345 20000018 0 1 23474 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
+19 20.2345 20000019 0 1 23475 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
+20 21.2345 20000020 0 1 23476 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
+ALTER TABLE test.t1 ADD INDEX a2_i (a2), ADD INDEX a3_i (a3);
+SHOW CREATE TABLE test.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a1` int(11) NOT NULL,
+ `a2` float DEFAULT NULL,
+ `a3` double DEFAULT NULL,
+ `a4` bit(1) DEFAULT NULL,
+ `a5` tinyint(4) DEFAULT NULL,
+ `a6` bigint(20) DEFAULT NULL,
+ `a7` date DEFAULT NULL,
+ `a8` time DEFAULT NULL,
+ `a9` datetime DEFAULT NULL,
+ `a10` tinytext,
+ `a11` mediumtext,
+ `a12` longtext,
+ `a13` text,
+ `a14` blob,
+ PRIMARY KEY (`a1`),
+ KEY `a2_i` (`a2`),
+ KEY `a3_i` (`a3`)
+) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+a1 Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
+a2 Float NULL AT=FIXED ST=MEMORY
+a3 Double NULL AT=FIXED ST=MEMORY
+a4 Bit(1) NULL AT=FIXED ST=DISK
+a5 Tinyint NULL AT=FIXED ST=DISK
+a6 Bigint NULL AT=FIXED ST=DISK
+a7 Date NULL AT=FIXED ST=DISK
+a8 Time NULL AT=FIXED ST=DISK
+a9 Datetime NULL AT=FIXED ST=DISK
+a10 Text(256,0;0;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
+a11 Text(256,4000;8;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
+a12 Text(256,8000;4;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
+a13 Text(256,2000;16;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
+a14 Blob(256,2000;16) NULL AT=FIXED ST=MEMORY
+ALTER TABLE test.t1 DROP INDEX a2_i;
+SHOW CREATE TABLE test.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a1` int(11) NOT NULL,
+ `a2` float DEFAULT NULL,
+ `a3` double DEFAULT NULL,
+ `a4` bit(1) DEFAULT NULL,
+ `a5` tinyint(4) DEFAULT NULL,
+ `a6` bigint(20) DEFAULT NULL,
+ `a7` date DEFAULT NULL,
+ `a8` time DEFAULT NULL,
+ `a9` datetime DEFAULT NULL,
+ `a10` tinytext,
+ `a11` mediumtext,
+ `a12` longtext,
+ `a13` text,
+ `a14` blob,
+ PRIMARY KEY (`a1`),
+ KEY `a3_i` (`a3`)
+) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+a1 Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
+a2 Float NULL AT=FIXED ST=DISK
+a3 Double NULL AT=FIXED ST=MEMORY
+a4 Bit(1) NULL AT=FIXED ST=DISK
+a5 Tinyint NULL AT=FIXED ST=DISK
+a6 Bigint NULL AT=FIXED ST=DISK
+a7 Date NULL AT=FIXED ST=DISK
+a8 Time NULL AT=FIXED ST=DISK
+a9 Datetime NULL AT=FIXED ST=DISK
+a10 Text(256,0;0;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
+a11 Text(256,4000;8;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
+a12 Text(256,8000;4;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
+a13 Text(256,2000;16;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
+a14 Blob(256,2000;16) NULL AT=FIXED ST=MEMORY
+TRUNCATE TABLE test.t1;
+SHOW CREATE TABLE test.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a1` int(11) NOT NULL,
+ `a2` float DEFAULT NULL,
+ `a3` double DEFAULT NULL,
+ `a4` bit(1) DEFAULT NULL,
+ `a5` tinyint(4) DEFAULT NULL,
+ `a6` bigint(20) DEFAULT NULL,
+ `a7` date DEFAULT NULL,
+ `a8` time DEFAULT NULL,
+ `a9` datetime DEFAULT NULL,
+ `a10` tinytext,
+ `a11` mediumtext,
+ `a12` longtext,
+ `a13` text,
+ `a14` blob,
+ PRIMARY KEY (`a1`),
+ KEY `a3_i` (`a3`)
+) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+a1 Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
+a2 Float NULL AT=FIXED ST=DISK
+a3 Double NULL AT=FIXED ST=MEMORY
+a4 Bit(1) NULL AT=FIXED ST=DISK
+a5 Tinyint NULL AT=FIXED ST=DISK
+a6 Bigint NULL AT=FIXED ST=DISK
+a7 Date NULL AT=FIXED ST=DISK
+a8 Time NULL AT=FIXED ST=DISK
+a9 Datetime NULL AT=FIXED ST=DISK
+a10 Text(256,0;0;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
+a11 Text(256,4000;8;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
+a12 Text(256,8000;4;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
+a13 Text(256,2000;16;latin1_swedish_ci) NULL AT=FIXED ST=MEMORY
+a14 Blob(256,2000;16) NULL AT=FIXED ST=MEMORY
+ALTER TABLE test.t1 DROP a14;
+ALTER TABLE test.t1 DROP a13;
+ALTER TABLE test.t1 DROP a12;
+ALTER TABLE test.t1 DROP a11;
+ALTER TABLE test.t1 DROP a10;
+ALTER TABLE test.t1 DROP a9;
+ALTER TABLE test.t1 DROP a8;
+ALTER TABLE test.t1 DROP a7;
+ALTER TABLE test.t1 DROP a6;
+ALTER TABLE test.t1 DROP PRIMARY KEY;
+SHOW CREATE TABLE test.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a1` int(11) NOT NULL,
+ `a2` float DEFAULT NULL,
+ `a3` double DEFAULT NULL,
+ `a4` bit(1) DEFAULT NULL,
+ `a5` tinyint(4) DEFAULT NULL,
+ KEY `a3_i` (`a3`)
+) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+a1 Int NOT NULL AT=FIXED ST=DISK
+a2 Float NULL AT=FIXED ST=DISK
+a3 Double NULL AT=FIXED ST=MEMORY
+a4 Bit(1) NULL AT=FIXED ST=DISK
+a5 Tinyint NULL AT=FIXED ST=DISK
+$PK Bigunsigned PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
+DROP TABLE test.t1;
+ALTER TABLESPACE ts
+DROP DATAFILE './table_space/datafile.dat'
+ ENGINE NDB;
+DROP TABLESPACE ts ENGINE NDB;
+DROP LOGFILE GROUP lg ENGINE=NDB;
diff --git a/mysql-test/suite/ndb/r/ndb_dd_backuprestore.result b/mysql-test/suite/ndb/r/ndb_dd_backuprestore.result
new file mode 100644
index 00000000000..c82fe560121
--- /dev/null
+++ b/mysql-test/suite/ndb/r/ndb_dd_backuprestore.result
@@ -0,0 +1,487 @@
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+DROP TABLE IF EXISTS test.t3;
+DROP TABLE IF EXISTS test.t4;
+DROP TABLE IF EXISTS test.t5;
+DROP TABLE IF EXISTS test.t6;
+**** Test 1 Simple DD backup and restore ****
+CREATE LOGFILE GROUP log_group1
+ADD UNDOFILE './log_group1/undofile.dat'
+INITIAL_SIZE 16M
+UNDO_BUFFER_SIZE = 1M
+ENGINE=NDB;
+CREATE TABLESPACE table_space1
+ADD DATAFILE './table_space1/datafile.dat'
+USE LOGFILE GROUP log_group1
+INITIAL_SIZE 12M
+ENGINE NDB;
+CREATE TABLE test.t1
+(pk1 MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 CHAR(50) NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL) TABLESPACE table_space1 STORAGE DISK ENGINE=NDB;
+SELECT COUNT(*) FROM test.t1;
+COUNT(*)
+500
+SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY pk1 LIMIT 5;
+pk1 c2 c3 hex(c4)
+1 Sweden 500 1
+2 Sweden 499 1
+3 Sweden 498 1
+4 Sweden 497 1
+5 Sweden 496 1
+CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
+DELETE FROM test.backup_info;
+LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
+SELECT @the_backup_id:=backup_id FROM test.backup_info;
+@the_backup_id:=backup_id
+<the_backup_id>
+DROP TABLE test.backup_info;
+DROP TABLE test.t1;
+ALTER TABLESPACE table_space1
+DROP DATAFILE './table_space1/datafile.dat'
+ENGINE = NDB;
+DROP TABLESPACE table_space1
+ENGINE = NDB;
+DROP LOGFILE GROUP log_group1
+ENGINE =NDB;
+SELECT COUNT(*) FROM test.t1;
+COUNT(*)
+500
+SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY pk1 LIMIT 5;
+pk1 c2 c3 hex(c4)
+1 Sweden 500 1
+2 Sweden 499 1
+3 Sweden 498 1
+4 Sweden 497 1
+5 Sweden 496 1
+**** Test 2 Mixed Cluster Test backup and restore ****
+CREATE TABLE test.t2
+(pk1 MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 VARCHAR(200) NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL)ENGINE=NDB;
+CREATE TABLE test.t3 (c1 int not null auto_increment, data LONGBLOB, PRIMARY KEY(c1))TABLESPACE table_space1 STORAGE DISK ENGINE=NDB;
+CREATE TABLE test.t4 (c1 int not null auto_increment, data LONGBLOB, PRIMARY KEY(c1))ENGINE=NDB;
+SELECT COUNT(*) FROM test.t1;
+COUNT(*)
+500
+SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY pk1 LIMIT 5;
+pk1 c2 c3 hex(c4)
+1 Sweden 500 1
+2 Sweden 499 1
+3 Sweden 498 1
+4 Sweden 497 1
+5 Sweden 496 1
+SELECT COUNT(*) FROM test.t2;
+COUNT(*)
+500
+SELECT pk1, c2, c3, hex(c4) FROM test.t2 ORDER BY pk1 LIMIT 5;
+pk1 c2 c3 hex(c4)
+1 Sweden, Texas 500 0
+2 Sweden, Texas 499 0
+3 Sweden, Texas 498 0
+4 Sweden, Texas 497 0
+5 Sweden, Texas 496 0
+SELECT COUNT(*) FROM test.t3;
+COUNT(*)
+100
+SELECT LENGTH(data) FROM test.t3 WHERE c1 = 1;
+LENGTH(data)
+1024
+SELECT LENGTH(data) FROM test.t3 WHERE c1 = 2;
+LENGTH(data)
+16384
+SELECT COUNT(*) FROM test.t4;
+COUNT(*)
+100
+SELECT LENGTH(data) FROM test.t4 WHERE c1 = 1;
+LENGTH(data)
+1024
+SELECT LENGTH(data) FROM test.t4 WHERE c1 = 2;
+LENGTH(data)
+16384
+CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
+DELETE FROM test.backup_info;
+LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
+SELECT @the_backup_id:=backup_id FROM test.backup_info;
+@the_backup_id:=backup_id
+<the_backup_id>
+DROP TABLE test.backup_info;
+DROP TABLE test.t1;
+DROP TABLE test.t2;
+DROP TABLE test.t3;
+DROP TABLE test.t4;
+ALTER TABLESPACE table_space1
+DROP DATAFILE './table_space1/datafile.dat'
+ENGINE = NDB;
+DROP TABLESPACE table_space1
+ENGINE = NDB;
+DROP LOGFILE GROUP log_group1
+ENGINE =NDB;
+SELECT COUNT(*) FROM test.t1;
+COUNT(*)
+500
+SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY pk1 LIMIT 5;
+pk1 c2 c3 hex(c4)
+1 Sweden 500 1
+2 Sweden 499 1
+3 Sweden 498 1
+4 Sweden 497 1
+5 Sweden 496 1
+SELECT COUNT(*) FROM test.t2;
+COUNT(*)
+500
+SELECT pk1, c2, c3, hex(c4) FROM test.t2 ORDER BY pk1 LIMIT 5;
+pk1 c2 c3 hex(c4)
+1 Sweden, Texas 500 0
+2 Sweden, Texas 499 0
+3 Sweden, Texas 498 0
+4 Sweden, Texas 497 0
+5 Sweden, Texas 496 0
+SELECT COUNT(*) FROM test.t3;
+COUNT(*)
+100
+SELECT LENGTH(data) FROM test.t3 WHERE c1 = 1;
+LENGTH(data)
+1024
+SELECT LENGTH(data) FROM test.t3 WHERE c1 = 2;
+LENGTH(data)
+16384
+SELECT COUNT(*) FROM test.t4;
+COUNT(*)
+100
+SELECT LENGTH(data) FROM test.t4 WHERE c1 = 1;
+LENGTH(data)
+1024
+SELECT LENGTH(data) FROM test.t4 WHERE c1 = 2;
+LENGTH(data)
+16384
+DROP TABLE test.t1;
+DROP TABLE test.t2;
+DROP TABLE test.t3;
+DROP TABLE test.t4;
+**** Test 3 Adding partition Test backup and restore ****
+CREATE TABLESPACE table_space2
+ADD DATAFILE './table_space2/datafile.dat'
+USE LOGFILE GROUP log_group1
+INITIAL_SIZE 12M
+ENGINE NDB;
+CREATE TABLE test.t1 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 VARCHAR(150) NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))TABLESPACE table_space1 STORAGE DISK ENGINE=NDB PARTITION BY HASH(c3) PARTITIONS 4;
+CREATE TABLE test.t4 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 VARCHAR(180) NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))ENGINE=NDB PARTITION BY HASH(c3) PARTITIONS 2;
+CREATE TABLE test.t2 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 TEXT NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))TABLESPACE table_space2 STORAGE DISK ENGINE=NDB PARTITION BY KEY(c3) (PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB);
+CREATE TABLE test.t5 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 TEXT NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))ENGINE=NDB PARTITION BY KEY(pk1) (PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB);
+CREATE TABLE test.t3 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 VARCHAR(202) NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))TABLESPACE table_space2 STORAGE DISK ENGINE=NDB PARTITION BY RANGE (c3) PARTITIONS 3 (PARTITION x1 VALUES LESS THAN (105), PARTITION x2 VALUES LESS THAN (333), PARTITION x3 VALUES LESS THAN (720));
+CREATE TABLE test.t6 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 VARCHAR(220) NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))ENGINE=NDB PARTITION BY RANGE (pk1) PARTITIONS 2 (PARTITION x1 VALUES LESS THAN (333), PARTITION x2 VALUES LESS THAN (720));
+SHOW CREATE TABLE test.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `pk1` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `c2` varchar(150) NOT NULL,
+ `c3` int(11) NOT NULL,
+ `c4` bit(1) NOT NULL,
+ PRIMARY KEY (`pk1`,`c3`)
+) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 4 */
+SHOW CREATE TABLE test.t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `pk1` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `c2` text NOT NULL,
+ `c3` int(11) NOT NULL,
+ `c4` bit(1) NOT NULL,
+ PRIMARY KEY (`pk1`,`c3`)
+) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
+SHOW CREATE TABLE test.t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `pk1` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `c2` varchar(202) NOT NULL,
+ `c3` int(11) NOT NULL,
+ `c4` bit(1) NOT NULL,
+ PRIMARY KEY (`pk1`,`c3`)
+) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */
+SHOW CREATE TABLE test.t4;
+Table Create Table
+t4 CREATE TABLE `t4` (
+ `pk1` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `c2` varchar(180) NOT NULL,
+ `c3` int(11) NOT NULL,
+ `c4` bit(1) NOT NULL,
+ PRIMARY KEY (`pk1`,`c3`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 2 */
+SHOW CREATE TABLE test.t5;
+Table Create Table
+t5 CREATE TABLE `t5` (
+ `pk1` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `c2` text NOT NULL,
+ `c3` int(11) NOT NULL,
+ `c4` bit(1) NOT NULL,
+ PRIMARY KEY (`pk1`,`c3`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (pk1) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
+SHOW CREATE TABLE test.t6;
+Table Create Table
+t6 CREATE TABLE `t6` (
+ `pk1` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `c2` varchar(220) NOT NULL,
+ `c3` int(11) NOT NULL,
+ `c4` bit(1) NOT NULL,
+ PRIMARY KEY (`pk1`,`c3`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (pk1) (PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) */
+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 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1
+NULL test t1 p1 NULL 2 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1
+NULL test t1 p2 NULL 3 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1
+NULL test t1 p3 NULL 4 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1
+SELECT * FROM information_schema.partitions WHERE 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 p0 NULL 1 NULL KEY NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2
+NULL test t2 p1 NULL 2 NULL KEY NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2
+SELECT * FROM information_schema.partitions WHERE 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 x1 NULL 1 NULL RANGE NULL c3 NULL 105 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2
+NULL test t3 x2 NULL 2 NULL RANGE NULL c3 NULL 333 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2
+NULL test t3 x3 NULL 3 NULL RANGE NULL c3 NULL 720 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2
+SELECT * FROM information_schema.partitions WHERE 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 HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL
+NULL test t4 p1 NULL 2 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL
+SELECT * FROM information_schema.partitions WHERE table_name= 't5';
+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 t5 p0 NULL 1 NULL KEY NULL pk1 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL
+NULL test t5 p1 NULL 2 NULL KEY NULL pk1 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL
+SELECT * FROM information_schema.partitions WHERE table_name= 't6';
+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 t6 x1 NULL 1 NULL RANGE NULL pk1 NULL 333 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL
+NULL test t6 x2 NULL 2 NULL RANGE NULL pk1 NULL 720 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL
+SELECT COUNT(*) FROM test.t1;
+COUNT(*)
+250
+SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY c3 LIMIT 5;
+pk1 c2 c3 hex(c4)
+250 Sweden, Texas 2 0
+249 Sweden, Texas 4 0
+248 Sweden, Texas 6 0
+247 Sweden, Texas 8 0
+246 Sweden, Texas 10 0
+SELECT COUNT(*) FROM test.t2;
+COUNT(*)
+250
+SELECT pk1, c2, c3, hex(c4) FROM test.t2 ORDER BY c3 LIMIT 5;
+pk1 c2 c3 hex(c4)
+250 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 1 1
+249 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 3 1
+248 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 5 1
+247 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 7 1
+246 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 9 1
+SELECT COUNT(*) FROM test.t3;
+COUNT(*)
+250
+SELECT pk1, c2, c3, hex(c4) FROM test.t3 ORDER BY c3 LIMIT 5;
+pk1 c2 c3 hex(c4)
+250 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 0 1
+249 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 2 1
+248 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 4 1
+247 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 6 1
+246 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 8 1
+SELECT COUNT(*) FROM test.t4;
+COUNT(*)
+250
+SELECT pk1, c2, c3, hex(c4) FROM test.t4 ORDER BY c3 LIMIT 5;
+pk1 c2 c3 hex(c4)
+250 Sweden, Texas 2 0
+249 Sweden, Texas 4 0
+248 Sweden, Texas 6 0
+247 Sweden, Texas 8 0
+246 Sweden, Texas 10 0
+SELECT COUNT(*) FROM test.t5;
+COUNT(*)
+250
+SELECT pk1, c2, c3, hex(c4) FROM test.t5 ORDER BY c3 LIMIT 5;
+pk1 c2 c3 hex(c4)
+250 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 1 1
+249 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 3 1
+248 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 5 1
+247 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 7 1
+246 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 9 1
+SELECT COUNT(*) FROM test.t6;
+COUNT(*)
+250
+SELECT pk1, c2, c3, hex(c4) FROM test.t6 ORDER BY c3 LIMIT 5;
+pk1 c2 c3 hex(c4)
+250 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 0 1
+249 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 2 1
+248 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 4 1
+247 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 6 1
+246 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 8 1
+CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
+DELETE FROM test.backup_info;
+LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
+SELECT @the_backup_id:=backup_id FROM test.backup_info;
+@the_backup_id:=backup_id
+<the_backup_id>
+DROP TABLE test.backup_info;
+DROP TABLE test.t1;
+DROP TABLE test.t2;
+DROP TABLE test.t3;
+DROP TABLE test.t4;
+DROP TABLE test.t5;
+DROP TABLE test.t6;
+ALTER TABLESPACE table_space1
+DROP DATAFILE './table_space1/datafile.dat'
+ENGINE = NDB;
+ALTER TABLESPACE table_space2
+DROP DATAFILE './table_space2/datafile.dat'
+ENGINE = NDB;
+DROP TABLESPACE table_space1
+ENGINE = NDB;
+DROP TABLESPACE table_space2
+ENGINE = NDB;
+DROP LOGFILE GROUP log_group1
+ENGINE =NDB;
+SHOW CREATE TABLE test.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `pk1` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `c2` varchar(150) NOT NULL,
+ `c3` int(11) NOT NULL,
+ `c4` bit(1) NOT NULL,
+ PRIMARY KEY (`pk1`,`c3`)
+) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 4 */
+SHOW CREATE TABLE test.t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `pk1` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `c2` text NOT NULL,
+ `c3` int(11) NOT NULL,
+ `c4` bit(1) NOT NULL,
+ PRIMARY KEY (`pk1`,`c3`)
+) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
+SHOW CREATE TABLE test.t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `pk1` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `c2` varchar(202) NOT NULL,
+ `c3` int(11) NOT NULL,
+ `c4` bit(1) NOT NULL,
+ PRIMARY KEY (`pk1`,`c3`)
+) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */
+SHOW CREATE TABLE test.t4;
+Table Create Table
+t4 CREATE TABLE `t4` (
+ `pk1` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `c2` varchar(180) NOT NULL,
+ `c3` int(11) NOT NULL,
+ `c4` bit(1) NOT NULL,
+ PRIMARY KEY (`pk1`,`c3`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 2 */
+SHOW CREATE TABLE test.t5;
+Table Create Table
+t5 CREATE TABLE `t5` (
+ `pk1` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `c2` text NOT NULL,
+ `c3` int(11) NOT NULL,
+ `c4` bit(1) NOT NULL,
+ PRIMARY KEY (`pk1`,`c3`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (pk1) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
+SHOW CREATE TABLE test.t6;
+Table Create Table
+t6 CREATE TABLE `t6` (
+ `pk1` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `c2` varchar(220) NOT NULL,
+ `c3` int(11) NOT NULL,
+ `c4` bit(1) NOT NULL,
+ PRIMARY KEY (`pk1`,`c3`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (pk1) (PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) */
+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 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1
+NULL test t1 p1 NULL 2 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1
+NULL test t1 p2 NULL 3 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1
+NULL test t1 p3 NULL 4 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1
+SELECT * FROM information_schema.partitions WHERE 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 p0 NULL 1 NULL KEY NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2
+NULL test t2 p1 NULL 2 NULL KEY NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2
+SELECT * FROM information_schema.partitions WHERE 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 x1 NULL 1 NULL RANGE NULL c3 NULL 105 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2
+NULL test t3 x2 NULL 2 NULL RANGE NULL c3 NULL 333 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2
+NULL test t3 x3 NULL 3 NULL RANGE NULL c3 NULL 720 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2
+SELECT * FROM information_schema.partitions WHERE 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 HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL
+NULL test t4 p1 NULL 2 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL
+SELECT * FROM information_schema.partitions WHERE table_name= 't5';
+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 t5 p0 NULL 1 NULL KEY NULL pk1 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL
+NULL test t5 p1 NULL 2 NULL KEY NULL pk1 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL
+SELECT * FROM information_schema.partitions WHERE table_name= 't6';
+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 t6 x1 NULL 1 NULL RANGE NULL pk1 NULL 333 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL
+NULL test t6 x2 NULL 2 NULL RANGE NULL pk1 NULL 720 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL
+SELECT COUNT(*) FROM test.t1;
+COUNT(*)
+250
+SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY c3 LIMIT 5;
+pk1 c2 c3 hex(c4)
+250 Sweden, Texas 2 0
+249 Sweden, Texas 4 0
+248 Sweden, Texas 6 0
+247 Sweden, Texas 8 0
+246 Sweden, Texas 10 0
+SELECT COUNT(*) FROM test.t2;
+COUNT(*)
+250
+SELECT pk1, c2, c3, hex(c4) FROM test.t2 ORDER BY c3 LIMIT 5;
+pk1 c2 c3 hex(c4)
+250 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 1 1
+249 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 3 1
+248 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 5 1
+247 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 7 1
+246 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 9 1
+SELECT COUNT(*) FROM test.t3;
+COUNT(*)
+250
+SELECT pk1, c2, c3, hex(c4) FROM test.t3 ORDER BY c3 LIMIT 5;
+pk1 c2 c3 hex(c4)
+250 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 0 1
+249 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 2 1
+248 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 4 1
+247 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 6 1
+246 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 8 1
+SELECT COUNT(*) FROM test.t4;
+COUNT(*)
+250
+SELECT pk1, c2, c3, hex(c4) FROM test.t4 ORDER BY c3 LIMIT 5;
+pk1 c2 c3 hex(c4)
+250 Sweden, Texas 2 0
+249 Sweden, Texas 4 0
+248 Sweden, Texas 6 0
+247 Sweden, Texas 8 0
+246 Sweden, Texas 10 0
+SELECT COUNT(*) FROM test.t5;
+COUNT(*)
+250
+SELECT pk1, c2, c3, hex(c4) FROM test.t5 ORDER BY c3 LIMIT 5;
+pk1 c2 c3 hex(c4)
+250 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 1 1
+249 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 3 1
+248 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 5 1
+247 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 7 1
+246 Sweden, Texas, ITALY, Kyle, JO, JBM,TU 9 1
+SELECT COUNT(*) FROM test.t6;
+COUNT(*)
+250
+SELECT pk1, c2, c3, hex(c4) FROM test.t6 ORDER BY c3 LIMIT 5;
+pk1 c2 c3 hex(c4)
+250 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 0 1
+249 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 2 1
+248 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 4 1
+247 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 6 1
+246 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 8 1
+DROP TABLE test.t1;
+DROP TABLE test.t2;
+DROP TABLE test.t3;
+DROP TABLE test.t4;
+DROP TABLE test.t5;
+DROP TABLE test.t6;
+ALTER TABLESPACE table_space1 DROP DATAFILE './table_space1/datafile.dat' ENGINE=NDB;
+ALTER TABLESPACE table_space2 DROP DATAFILE './table_space2/datafile.dat' ENGINE=NDB;
+DROP TABLESPACE table_space1 ENGINE = NDB;
+DROP TABLESPACE table_space2 ENGINE = NDB;
+DROP LOGFILE GROUP log_group1 ENGINE = NDB;
diff --git a/mysql-test/suite/ndb/r/ndb_dd_basic.result b/mysql-test/suite/ndb/r/ndb_dd_basic.result
new file mode 100644
index 00000000000..0ff28f889b7
--- /dev/null
+++ b/mysql-test/suite/ndb/r/ndb_dd_basic.result
@@ -0,0 +1,513 @@
+select count(*) from information_schema.columns;
+count(*)
+#
+DROP TABLE IF EXISTS t1;
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+INITIAL_SIZE 16M
+UNDO_BUFFER_SIZE = 1M
+ENGINE=MYISAM;
+Warnings:
+Error 1477 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 1477 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 1477 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'
+INITIAL_SIZE 16M
+UNDO_BUFFER_SIZE = 1M;
+ALTER LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile02.dat'
+INITIAL_SIZE = 4M
+ENGINE=NDB;
+set storage_engine=myisam;
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 12M
+ENGINE NDB;
+ALTER TABLESPACE ts1
+ADD DATAFILE 'datafile02.dat'
+INITIAL_SIZE = 4M
+ENGINE=NDB;
+CREATE TABLE t1
+(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
+TABLESPACE ts1 STORAGE DISK
+ENGINE=NDB;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `pk1` int(11) NOT NULL,
+ `b` int(11) NOT NULL,
+ `c` int(11) NOT NULL,
+ PRIMARY KEY (`pk1`)
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (0, 0, 0);
+SELECT * FROM t1;
+pk1 b c
+0 0 0
+INSERT INTO t1 VALUES
+(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
+(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10),
+(11,11,11),(12,12,12),(13,13,13),(14,14,14),(15,15,15),
+(16,16,16),(17,17,17),(18,18,18),(19,19,19),(20,20,20),
+(21,21,21),(22,22,22),(23,23,23),(24,24,24),(25,25,25),
+(26,26,26),(27,27,27),(28,28,28),(29,29,29),(30,30,30),
+(31,31,31),(32,32,32),(33,33,33),(34,34,34),(35,35,35),
+(36,36,36),(37,37,37),(38,38,38),(39,39,39),(40,40,40),
+(41,41,41),(42,42,42),(43,43,43),(44,44,44),(45,45,45),
+(46,46,46),(47,47,47),(48,48,48),(49,49,49),(50,50,50),
+(51,51,51),(52,52,52),(53,53,53),(54,54,54),(55,55,55),
+(56,56,56),(57,57,57),(58,58,58),(59,59,59),(60,60,60),
+(61,61,61),(62,62,62),(63,63,63),(64,64,64),(65,65,65),
+(66,66,66),(67,67,67),(68,68,68),(69,69,69),(70,70,70),
+(71,71,71),(72,72,72),(73,73,73),(74,74,74),(75,75,75),
+(76,76,76),(77,77,77),(78,78,78),(79,79,79),(80,80,80),
+(81,81,81),(82,82,82),(83,83,83),(84,84,84),(85,85,85),
+(86,86,86),(87,87,87),(88,88,88),(89,89,89),(90,90,90),
+(91,91,91),(92,92,92),(93,93,93),(94,94,94),(95,95,95),
+(96,96,96),(97,97,97),(98,98,98),(99,99,99),(100,100,100),
+(101,101,101),(102,102,102),(103,103,103),(104,104,104),(105,105,105),
+(106,106,106),(107,107,107),(108,108,108),(109,109,109),(110,110,110),
+(111,111,111),(112,112,112),(113,113,113),(114,114,114),(115,115,115),
+(116,116,116),(117,117,117),(118,118,118),(119,119,119),(120,120,120),
+(121,121,121),(122,122,122),(123,123,123),(124,124,124),(125,125,125),
+(126,126,126),(127,127,127),(128,128,128),(129,129,129),(130,130,130),
+(131,131,131),(132,132,132),(133,133,133),(134,134,134),(135,135,135),
+(136,136,136),(137,137,137),(138,138,138),(139,139,139),(140,140,140),
+(141,141,141),(142,142,142),(143,143,143),(144,144,144),(145,145,145),
+(146,146,146),(147,147,147),(148,148,148),(149,149,149),(150,150,150),
+(151,151,151),(152,152,152),(153,153,153),(154,154,154),(155,155,155),
+(156,156,156),(157,157,157),(158,158,158),(159,159,159),(160,160,160),
+(161,161,161),(162,162,162),(163,163,163),(164,164,164),(165,165,165),
+(166,166,166),(167,167,167),(168,168,168),(169,169,169),(170,170,170),
+(171,171,171),(172,172,172),(173,173,173),(174,174,174),(175,175,175),
+(176,176,176),(177,177,177),(178,178,178),(179,179,179),(180,180,180),
+(181,181,181),(182,182,182),(183,183,183),(184,184,184),(185,185,185),
+(186,186,186),(187,187,187),(188,188,188),(189,189,189),(190,190,190),
+(191,191,191),(192,192,192),(193,193,193),(194,194,194),(195,195,195),
+(196,196,196),(197,197,197),(198,198,198),(199,199,199),(200,200,200),
+(201,201,201),(202,202,202),(203,203,203),(204,204,204),(205,205,205),
+(206,206,206),(207,207,207),(208,208,208),(209,209,209),(210,210,210),
+(211,211,211),(212,212,212),(213,213,213),(214,214,214),(215,215,215),
+(216,216,216),(217,217,217),(218,218,218),(219,219,219),(220,220,220),
+(221,221,221),(222,222,222),(223,223,223),(224,224,224),(225,225,225),
+(226,226,226),(227,227,227),(228,228,228),(229,229,229),(230,230,230),
+(231,231,231),(232,232,232),(233,233,233),(234,234,234),(235,235,235),
+(236,236,236),(237,237,237),(238,238,238),(239,239,239),(240,240,240),
+(241,241,241),(242,242,242),(243,243,243),(244,244,244),(245,245,245),
+(246,246,246),(247,247,247),(248,248,248),(249,249,249),(250,250,250),
+(251,251,251),(252,252,252),(253,253,253),(254,254,254),(255,255,255),
+(256,256,256),(257,257,257),(258,258,258),(259,259,259),(260,260,260),
+(261,261,261),(262,262,262),(263,263,263),(264,264,264),(265,265,265),
+(266,266,266),(267,267,267),(268,268,268),(269,269,269),(270,270,270),
+(271,271,271),(272,272,272),(273,273,273),(274,274,274),(275,275,275),
+(276,276,276),(277,277,277),(278,278,278),(279,279,279),(280,280,280),
+(281,281,281),(282,282,282),(283,283,283),(284,284,284),(285,285,285),
+(286,286,286),(287,287,287),(288,288,288),(289,289,289),(290,290,290),
+(291,291,291),(292,292,292),(293,293,293),(294,294,294),(295,295,295),
+(296,296,296),(297,297,297),(298,298,298),(299,299,299),(300,300,300),
+(301,301,301),(302,302,302),(303,303,303),(304,304,304),(305,305,305),
+(306,306,306),(307,307,307),(308,308,308),(309,309,309),(310,310,310),
+(311,311,311),(312,312,312),(313,313,313),(314,314,314),(315,315,315),
+(316,316,316),(317,317,317),(318,318,318),(319,319,319),(320,320,320),
+(321,321,321),(322,322,322),(323,323,323),(324,324,324),(325,325,325),
+(326,326,326),(327,327,327),(328,328,328),(329,329,329),(330,330,330),
+(331,331,331),(332,332,332),(333,333,333),(334,334,334),(335,335,335),
+(336,336,336),(337,337,337),(338,338,338),(339,339,339),(340,340,340),
+(341,341,341),(342,342,342),(343,343,343),(344,344,344),(345,345,345),
+(346,346,346),(347,347,347),(348,348,348),(349,349,349),(350,350,350),
+(351,351,351),(352,352,352),(353,353,353),(354,354,354),(355,355,355),
+(356,356,356),(357,357,357),(358,358,358),(359,359,359),(360,360,360),
+(361,361,361),(362,362,362),(363,363,363),(364,364,364),(365,365,365),
+(366,366,366),(367,367,367),(368,368,368),(369,369,369),(370,370,370),
+(371,371,371),(372,372,372),(373,373,373),(374,374,374),(375,375,375),
+(376,376,376),(377,377,377),(378,378,378),(379,379,379),(380,380,380),
+(381,381,381),(382,382,382),(383,383,383),(384,384,384),(385,385,385),
+(386,386,386),(387,387,387),(388,388,388),(389,389,389),(390,390,390),
+(391,391,391),(392,392,392),(393,393,393),(394,394,394),(395,395,395),
+(396,396,396),(397,397,397),(398,398,398),(399,399,399),(400,400,400),
+(401,401,401),(402,402,402),(403,403,403),(404,404,404),(405,405,405),
+(406,406,406),(407,407,407),(408,408,408),(409,409,409),(410,410,410),
+(411,411,411),(412,412,412),(413,413,413),(414,414,414),(415,415,415),
+(416,416,416),(417,417,417),(418,418,418),(419,419,419),(420,420,420),
+(421,421,421),(422,422,422),(423,423,423),(424,424,424),(425,425,425),
+(426,426,426),(427,427,427),(428,428,428),(429,429,429),(430,430,430),
+(431,431,431),(432,432,432),(433,433,433),(434,434,434),(435,435,435),
+(436,436,436),(437,437,437),(438,438,438),(439,439,439),(440,440,440),
+(441,441,441),(442,442,442),(443,443,443),(444,444,444),(445,445,445),
+(446,446,446),(447,447,447),(448,448,448),(449,449,449),(450,450,450),
+(451,451,451),(452,452,452),(453,453,453),(454,454,454),(455,455,455),
+(456,456,456),(457,457,457),(458,458,458),(459,459,459),(460,460,460),
+(461,461,461),(462,462,462),(463,463,463),(464,464,464),(465,465,465),
+(466,466,466),(467,467,467),(468,468,468),(469,469,469),(470,470,470),
+(471,471,471),(472,472,472),(473,473,473),(474,474,474),(475,475,475),
+(476,476,476),(477,477,477),(478,478,478),(479,479,479),(480,480,480),
+(481,481,481),(482,482,482),(483,483,483),(484,484,484),(485,485,485),
+(486,486,486),(487,487,487),(488,488,488),(489,489,489),(490,490,490),
+(491,491,491),(492,492,492),(493,493,493),(494,494,494),(495,495,495),
+(496,496,496),(497,497,497),(498,498,498),(499,499,499),(500, 500, 500);
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+501
+CREATE LOGFILE GROUP lg2
+ADD UNDOFILE 'x.dat'
+INITIAL_SIZE 10y
+ENGINE = NDB;
+ERROR HY000: A size parameter was incorrectly specified, either number or on the form 10M
+CREATE LOGFILE GROUP lg2
+ADD UNDOFILE 'x.dat'
+INITIAL_SIZE 10MB
+ENGINE = NDB;
+ERROR HY000: A size parameter was incorrectly specified, either number or on the form 10M
+CREATE LOGFILE GROUP lg2
+ADD UNDOFILE 'x.dat'
+INITIAL_SIZE 10 MB
+ENGINE = NDB;
+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 'MB
+ENGINE = NDB' at line 3
+CREATE LOGFILE GROUP lg2
+ADD UNDOFILE 'x.dat'
+INITIAL_SIZE 10 M
+ENGINE = NDB;
+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 'M
+ENGINE = NDB' at line 3
+CREATE LOGFILE GROUP lg2
+ADD UNDOFILE 'x.dat'
+INITIAL_SIZE 1000000000000K
+ENGINE = NDB;
+ERROR HY000: The size number was correct but we don't allow the digit part to be more than 2 billion
+DROP TABLE t1;
+create tablespace ts2
+add datafile 'datafile2_1.dat'
+use logfile group lg1
+initial_size 12M
+engine ndb;
+CREATE TABLE City (
+ID int(11) NOT NULL AUTO_INCREMENT,
+Name char(35) NOT NULL,
+CountryCode char(3) NOT NULL,
+District char(20) NOT NULL,
+Population int(11) NOT NULL,
+PRIMARY KEY (ID)
+) ENGINE=ndbcluster
+tablespace ts2
+storage disk;
+alter tablespace ts2
+drop datafile 'datafile2_1.dat'
+engine ndb;
+insert
+into City (Name,CountryCode,District,Population)
+values ('BeiJing','CN','Beijing',2000);
+ERROR HY000: Got error 1602 'No datafile in tablespace' from NDBCLUSTER
+drop tablespace ts2
+engine ndb;
+ERROR HY000: Failed to drop TABLESPACE
+drop table City;
+drop tablespace ts2
+engine ndb;
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(4) NOT NULL, c CHAR(4) NOT NULL, KEY(b)) TABLESPACE ts1 STORAGE DISK ENGINE = NDB;
+INSERT INTO t1 VALUES (1,'1','1'), (2,'2','2'), (3,'3','3');
+BEGIN;
+UPDATE t1 SET b = '2' WHERE a = 1;
+SELECT b FROM t1 WHERE a = 1;
+b
+2
+SELECT * FROM t1 WHERE a = 1;
+a b c
+1 2 1
+UPDATE t1 SET c = '2' WHERE a = 1;
+SELECT b FROM t1 WHERE a = 1;
+b
+2
+SELECT * FROM t1 WHERE a = 1;
+a b c
+1 2 2
+UPDATE t1 SET b = '3' WHERE a = 1;
+SELECT b FROM t1 WHERE a = 1;
+b
+3
+SELECT * FROM t1 WHERE a = 1;
+a b c
+1 3 2
+COMMIT;
+SELECT * FROM t1 ORDER BY 1;
+a b c
+1 3 2
+2 2 2
+3 3 3
+BEGIN;
+UPDATE t1 SET c = '3' WHERE a = 1;
+SELECT b FROM t1 WHERE a = 1;
+b
+3
+SELECT * FROM t1 WHERE a = 1;
+a b c
+1 3 3
+UPDATE t1 SET b = '4' WHERE a = 1;
+SELECT b FROM t1 WHERE a = 1;
+b
+4
+SELECT * FROM t1 WHERE a = 1;
+a b c
+1 4 3
+UPDATE t1 SET c = '4' WHERE a = 1;
+SELECT b FROM t1 WHERE a = 1;
+b
+4
+SELECT * FROM t1 WHERE a = 1;
+a b c
+1 4 4
+COMMIT;
+SELECT * FROM t1 ORDER BY 1;
+a b c
+1 4 4
+2 2 2
+3 3 3
+UPDATE t1 SET b = '5' WHERE a = 1;
+SELECT * FROM t1 ORDER BY 1;
+a b c
+1 5 4
+2 2 2
+3 3 3
+UPDATE t1 SET b = '6' WHERE b = '5';
+SELECT * FROM t1 ORDER BY 1;
+a b c
+1 6 4
+2 2 2
+3 3 3
+UPDATE t1 SET b = '7'WHERE c = '4';
+SELECT * FROM t1 ORDER BY 1;
+a b c
+1 7 4
+2 2 2
+3 3 3
+UPDATE t1 SET c = '5' WHERE a = 1;
+SELECT * FROM t1 ORDER BY 1;
+a b c
+1 7 5
+2 2 2
+3 3 3
+UPDATE t1 SET c = '6' WHERE b = '7';
+SELECT * FROM t1 ORDER BY 1;
+a b c
+1 7 6
+2 2 2
+3 3 3
+UPDATE t1 SET c = '7' WHERE c = '6';
+SELECT * FROM t1 ORDER BY 1;
+a b c
+1 7 7
+2 2 2
+3 3 3
+DROP TABLE t1;
+CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(4) NOT NULL, c CHAR(4) NOT NULL, KEY(b)) TABLESPACE ts1 STORAGE DISK ENGINE NDB;
+INSERT INTO t1 VALUE (1,'1','1'), (2,'2','2'), (3,'3','3');
+BEGIN;
+UPDATE t1 SET b = '2' WHERE a = 1;
+SELECT b FROM t1 WHERE a = 1;
+b
+2
+SELECT * FROM t1 WHERE a = 1;
+a b c
+1 2 1
+UPDATE t1 SET c = '2' WHERE a = 1;
+SELECT b FROM t1 WHERE a = 1;
+b
+2
+SELECT * FROM t1 WHERE a = 1;
+a b c
+1 2 2
+UPDATE t1 SET b = '3' WHERE a = 1;
+SELECT b FROM t1 WHERE a = 1;
+b
+3
+SELECT * FROM t1 WHERE a = 1;
+a b c
+1 3 2
+COMMIT;
+SELECT * FROM t1 ORDER BY 1;
+a b c
+1 3 2
+2 2 2
+3 3 3
+BEGIN;
+UPDATE t1 SET c = '3' WHERE a = 1;
+SELECT b FROM t1 WHERE a = 1;
+b
+3
+SELECT * FROM t1 WHERE a = 1;
+a b c
+1 3 3
+UPDATE t1 SET b = '4' WHERE a = 1;
+SELECT b FROM t1 WHERE a = 1;
+b
+4
+SELECT * FROM t1 WHERE a = 1;
+a b c
+1 4 3
+UPDATE t1 SET c = '4' WHERE a = 1;
+SELECT b FROM t1 WHERE a = 1;
+b
+4
+SELECT * FROM t1 WHERE a = 1;
+a b c
+1 4 4
+COMMIT;
+SELECT * FROM t1 ORDER BY 1;
+a b c
+1 4 4
+2 2 2
+3 3 3
+UPDATE t1 SET b = '5' WHERE a = 1;
+SELECT * FROM t1 ORDER BY 1;
+a b c
+1 5 4
+2 2 2
+3 3 3
+UPDATE t1 SET b = '6' WHERE b = '5';
+SELECT * FROM t1 ORDER BY 1;
+a b c
+1 6 4
+2 2 2
+3 3 3
+UPDATE t1 SET b = '7' WHERE c = '4';
+SELECT * FROM t1 ORDER BY 1;
+a b c
+1 7 4
+2 2 2
+3 3 3
+UPDATE t1 SET c = '5' WHERE a = 1;
+SELECT * FROM t1 ORDER BY 1;
+a b c
+1 7 5
+2 2 2
+3 3 3
+UPDATE t1 SET c = '6' WHERE b = '7';
+SELECT * FROM t1 ORDER BY 1;
+a b c
+1 7 6
+2 2 2
+3 3 3
+UPDATE t1 SET c = '7' WHERE c = '6';
+SELECT * FROM t1 ORDER BY 1;
+a b c
+1 7 7
+2 2 2
+3 3 3
+DROP TABLE t1;
+CREATE TABLE t1 (
+a INT NOT NULL PRIMARY KEY,
+b TEXT NOT NULL
+) TABLESPACE ts1 STORAGE DISK ENGINE=NDBCLUSTER;
+set @x0 = '01234567012345670123456701234567';
+set @x0 = concat(@x0,@x0,@x0,@x0,@x0,@x0,@x0,@x0);
+set @b1 = 'b1';
+set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
+set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
+set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
+set @b1 = concat(@b1,@x0);
+set @b2 = 'b2';
+set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
+set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
+set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
+set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
+INSERT INTO t1 VALUES(1,@b1);
+INSERT INTO t1 VALUES(2,@b2);
+SELECT a,length(b),substr(b,1+2*900,2) FROM t1 WHERE a=1;
+a length(b) substr(b,1+2*900,2)
+1 2256 b1
+SELECT a,length(b),substr(b,1+2*9000,2) FROM t1 WHERE a=2;
+a length(b) substr(b,1+2*9000,2)
+2 20000 b2
+UPDATE t1 SET b=@b2 WHERE a=1;
+UPDATE t1 SET b=@b1 WHERE a=2;
+SELECT a,length(b),substr(b,1+2*9000,2) FROM t1 WHERE a=1;
+a length(b) substr(b,1+2*9000,2)
+1 20000 b2
+SELECT a,length(b),substr(b,1+2*900,2) FROM t1 WHERE a=2;
+a length(b) substr(b,1+2*900,2)
+2 2256 b1
+UPDATE t1 SET b=concat(b,b) WHERE a=1;
+UPDATE t1 SET b=concat(b,b) WHERE a=2;
+SELECT a,length(b),substr(b,1+4*9000,2) FROM t1 WHERE a=1;
+a length(b) substr(b,1+4*9000,2)
+1 40000 b2
+SELECT a,length(b),substr(b,1+4*900,2) FROM t1 WHERE a=2;
+a length(b) substr(b,1+4*900,2)
+2 4512 b1
+DELETE FROM t1 WHERE a=1;
+DELETE FROM t1 WHERE a=2;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+0
+DROP TABLE t1;
+CREATE TABLE t1 (
+a int NOT NULL,
+b varchar(4000), -- must use 2 pages undo
+PRIMARY KEY using hash (a)
+)
+TABLESPACE ts1 STORAGE DISK ENGINE=NDBCLUSTER;
+set autocommit = 0;
+insert into t1 values(0,'x');
+insert into t1 values(1,'x');
+insert into t1 values(2,'x');
+insert into t1 values(3,'x');
+insert into t1 values(4,'x');
+insert into t1 values(5,'x');
+insert into t1 values(6,'x');
+insert into t1 values(7,'x');
+insert into t1 values(8,'x');
+delete from t1 where a = 0;
+commit;
+delete from t1;
+begin;
+insert into t1 values (1, 'x');
+select * from t1;
+a b
+1 x
+rollback;
+set autocommit = 1;
+drop table t1;
+create table test.t1 (f1 varchar(50) primary key, f2 text,f3 int)
+TABLESPACE ts1 STORAGE DISK engine=NDB;
+insert into test.t1 (f1,f2,f3)VALUES("111111","aaaaaa",1);
+insert into test.t1 (f1,f2,f3)VALUES("222222","bbbbbb",2);
+select * from test.t1 order by f1;
+f1 f2 f3
+111111 aaaaaa 1
+222222 bbbbbb 2
+select f1,f2 from test.t1 order by f2;
+f1 f2
+111111 aaaaaa
+222222 bbbbbb
+select f2 from test.t1 order by f2;
+f2
+aaaaaa
+bbbbbb
+select f1,f2 from test.t1 order by f1;
+f1 f2
+111111 aaaaaa
+222222 bbbbbb
+drop table test.t1;
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile.dat'
+ENGINE = NDB;
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile02.dat'
+ENGINE = NDB;
+DROP TABLESPACE ts1
+ENGINE = NDB;
+DROP LOGFILE GROUP lg1
+ENGINE =NDB;
diff --git a/mysql-test/suite/ndb/r/ndb_dd_ddl.result b/mysql-test/suite/ndb/r/ndb_dd_ddl.result
new file mode 100644
index 00000000000..569769cfaef
--- /dev/null
+++ b/mysql-test/suite/ndb/r/ndb_dd_ddl.result
@@ -0,0 +1,238 @@
+DROP TABLE IF EXISTS t1;
+DROP DATABASE IF EXISTS mysqltest;
+CREATE DATABASE mysqltest;
+**** Begin Duplicate Statement Testing ****
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+INITIAL_SIZE 1M
+UNDO_BUFFER_SIZE = 1M
+ENGINE=NDB;
+CREATE LOGFILE GROUP lg2
+ADD UNDOFILE 'undofile2.dat'
+INITIAL_SIZE 1M
+UNDO_BUFFER_SIZE 1M
+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
+Error 1527 Failed to create LOGFILE GROUP
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+INITIAL_SIZE 1M
+UNDO_BUFFER_SIZE = 1M
+ENGINE=NDB;
+ERROR HY000: Failed to create LOGFILE GROUP
+ALTER LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile02.dat'
+INITIAL_SIZE 1M ENGINE NDB;
+ALTER LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile02.dat'
+INITIAL_SIZE 1M ENGINE=NDB;
+ERROR HY000: Failed to alter: CREATE UNDOFILE
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 1M
+ENGINE NDB;
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 1M
+ENGINE NDB;
+ERROR HY000: Failed to create TABLESPACE
+ALTER TABLESPACE ts1
+ADD DATAFILE 'datafile2.dat'
+INITIAL_SIZE 1M
+ENGINE=NDB;
+ALTER TABLESPACE ts1
+ADD DATAFILE 'datafile2.dat'
+INITIAL_SIZE 1M
+ENGINE=NDB;
+ERROR HY000: Failed to alter: CREATE DATAFILE
+CREATE TABLE mysqltest.t1
+(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
+TABLESPACE ts1 STORAGE DISK
+ENGINE=NDB;
+CREATE TABLE mysqltest.t1
+(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
+TABLESPACE ts1 STORAGE DISK
+ENGINE=NDB;
+ERROR 42S01: Table 't1' already exists
+CREATE TABLE mysqltest.t1
+(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
+ENGINE=NDB;
+ERROR 42S01: Table 't1' already exists
+DROP TABLE mysqltest.t1;
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile2.dat'
+ENGINE=NDB;
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile2.dat'
+ENGINE=NDB;
+ERROR HY000: Failed to alter: NO SUCH FILE
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile.dat'
+ENGINE=NDB;
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile.dat'
+ENGINE=NDB;
+ERROR HY000: Failed to alter: NO SUCH FILE
+DROP TABLESPACE ts1
+ENGINE=NDB;
+DROP TABLESPACE ts1
+ENGINE=NDB;
+ERROR HY000: Failed to drop TABLESPACE
+DROP LOGFILE GROUP lg1
+ENGINE=NDB;
+DROP LOGFILE GROUP lg1
+ENGINE=NDB;
+ERROR HY000: Failed to drop LOGFILE GROUP
+DROP DATABASE IF EXISTS mysqltest;
+**** End Duplicate Statement Testing ****
+
+**** Begin Statment CaSe Testing ****
+creaTE LOgfilE GrOuP lg1
+adD undoFILE 'undofile.dat'
+initiAL_siZE 1M
+UnDo_BuFfEr_SiZe = 1M
+ENGInE=NDb;
+altER LOgFiLE GrOUp lg1
+AdD UnDOfILe 'uNdOfiLe02.daT'
+INItIAl_SIzE 1M ENgINE nDB;
+CrEAtE TABLEspaCE ts1
+ADD DATAfilE 'datafile.dat'
+UsE LoGFiLE GRoUP lg1
+INITiaL_SizE 1M
+ENGiNe NDb;
+AlTeR tAbLeSpAcE ts1
+AdD DaTaFiLe 'dAtAfiLe2.daT'
+InItIaL_SiZe 1M
+EnGiNe=NDB;
+CREATE TABLE t1
+(pk1 int not null primary key, b int not null, c int not null)
+TABLEspace ts1 storAGE dISk
+ENGine nDb;
+DROP TABLE t1;
+AlteR TAblespaCE ts1
+droP DATAfile 'dAtAfiLe2.daT'
+ENGINE=NDB;
+ALter tablesPACE ts1
+dROp dAtAfIlE 'datafile.dat'
+ENGine=Ndb;
+DrOp TaBleSpAcE ts1
+engINE=ndB;
+DrOp lOgFiLe GrOuP lg1
+EnGiNe=nDb;
+**** End Statment CaSe Testing ****
+
+**** Begin = And No = Testing ****
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+INITIAL_SIZE=1M
+UNDO_BUFFER_SIZE=1M
+ENGINE=NDB;
+ALTER LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile02.dat'
+INITIAL_SIZE=1M
+ENGINE=NDB;
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE=1M
+ENGINE=NDB;
+ALTER TABLESPACE ts1
+ADD DATAFILE 'datafile2.dat'
+INITIAL_SIZE=1M
+ENGINE=NDB;
+CREATE TABLE t1
+(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
+TABLESPACE ts1 STORAGE DISK
+ENGINE=NDB;
+DROP TABLE t1;
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile2.dat'
+ENGINE=NDB;
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile.dat'
+ENGINE=NDB;
+DROP TABLESPACE ts1
+ENGINE=NDB;
+DROP LOGFILE GROUP lg1
+ENGINE=NDB;
+
+**** End of = ****
+
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+INITIAL_SIZE 1M
+UNDO_BUFFER_SIZE 1M
+ENGINE NDB;
+ALTER LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile02.dat'
+INITIAL_SIZE 1M
+ENGINE NDB;
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 1M
+ENGINE NDB;
+ALTER TABLESPACE ts1
+ADD DATAFILE 'datafile2.dat'
+INITIAL_SIZE 1M
+ENGINE NDB;
+CREATE TABLE t1
+(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
+TABLESPACE ts1 STORAGE MEMORY
+ENGINE NDB;
+ERROR HY000: Can't create table 'test.t1' (errno: 138)
+CREATE TABLE t1
+(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
+TABLESPACE ts1 STORAGE DISK
+ENGINE NDB;
+CREATE INDEX b_i on t1(b);
+CREATE INDEX bc_i on t1(b, c);
+DROP TABLE t1;
+CREATE TABLESPACE ts2
+ADD DATAFILE 'datafile3.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 1M
+ENGINE NDB;
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile3.dat'
+ENGINE NDB;
+ERROR HY000: Failed to alter: NO SUCH FILE
+ALTER TABLESPACE ts2
+DROP DATAFILE 'datafile2.dat'
+ENGINE NDB;
+ERROR HY000: Failed to alter: NO SUCH FILE
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile2.dat'
+ENGINE NDB;
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile.dat'
+ENGINE NDB;
+DROP TABLESPACE ts1
+ENGINE NDB;
+ALTER TABLESPACE ts2
+DROP DATAFILE 'datafile3.dat'
+ENGINE NDB;
+DROP TABLESPACE ts2
+ENGINE NDB;
+DROP LOGFILE GROUP lg1
+ENGINE NDB;
+**** End = And No = ****
+create logfile group lg1 add undofile 'MYSQLTEST_VARDIR/tmp/t1.frm' initial_size 1M undo_buffer_size = 1M engine=ndb;;
+ERROR HY000: Failed to create UNDOFILE
+create logfile group lg1
+add undofile 'undofile.dat'
+initial_size 1M
+undo_buffer_size = 1M
+engine=ndb;
+create tablespace ts1 add datafile 'MYSQLTEST_VARDIR/tmp/t1.frm' use logfile group lg1 initial_size 1M engine ndb;;
+ERROR HY000: Failed to create DATAFILE
+drop tablespace ts1
+engine ndb;
+ERROR HY000: Failed to drop TABLESPACE
+drop logfile group lg1
+engine ndb;
diff --git a/mysql-test/r/ndb_dd_disk2memory.result b/mysql-test/suite/ndb/r/ndb_dd_disk2memory.result
index 46661f36d1b..46661f36d1b 100644
--- a/mysql-test/r/ndb_dd_disk2memory.result
+++ b/mysql-test/suite/ndb/r/ndb_dd_disk2memory.result
diff --git a/mysql-test/suite/ndb/r/ndb_dd_dump.result b/mysql-test/suite/ndb/r/ndb_dd_dump.result
new file mode 100644
index 00000000000..b48073df1fd
--- /dev/null
+++ b/mysql-test/suite/ndb/r/ndb_dd_dump.result
@@ -0,0 +1,452 @@
+DROP TABLE IF EXISTS t1, t2, t3;
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile_lg1_01.dat'
+INITIAL_SIZE 2M
+UNDO_BUFFER_SIZE = 1M
+ENGINE NDB;
+ALTER LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile_lg1_02.dat'
+INITIAL_SIZE = 4M
+ENGINE NDB;
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile_ts1_01.dat'
+USE LOGFILE GROUP lg1
+EXTENT_SIZE 1M
+INITIAL_SIZE 2M
+ENGINE NDB;
+ALTER TABLESPACE ts1
+ADD DATAFILE 'datafile_ts1_02.dat'
+INITIAL_SIZE = 1M
+ENGINE=NDB;
+CREATE TABLESPACE ts2
+ADD DATAFILE 'datafile_ts2_01.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 2M
+ENGINE NDB;
+CREATE TABLESPACE ts3
+ADD DATAFILE 'datafile_ts3_01.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 4M
+ENGINE NDB;
+CREATE TABLE t1
+(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
+TABLESPACE ts1 STORAGE DISK
+ENGINE=NDB;
+CREATE TABLE t2
+(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
+TABLESPACE ts2 STORAGE DISK
+ENGINE=NDB;
+CREATE TABLE t3
+(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
+TABLESPACE ts3 STORAGE DISK
+ENGINE=NDB;
+INSERT INTO t1 VALUES
+(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
+(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10),
+(11,11,11),(12,12,12),(13,13,13),(14,14,14),(15,15,15),
+(16,16,16),(17,17,17),(18,18,18),(19,19,19),(20,20,20),
+(21,21,21),(22,22,22),(23,23,23),(24,24,24),(25,25,25),
+(26,26,26),(27,27,27),(28,28,28),(29,29,29),(30,30,30),
+(31,31,31),(32,32,32),(33,33,33),(34,34,34),(35,35,35),
+(36,36,36),(37,37,37),(38,38,38),(39,39,39),(40,40,40),
+(41,41,41),(42,42,42),(43,43,43),(44,44,44),(45,45,45),
+(46,46,46),(47,47,47),(48,48,48),(49,49,49),(50,50,50),
+(51,51,51),(52,52,52),(53,53,53),(54,54,54),(55,55,55),
+(56,56,56),(57,57,57),(58,58,58),(59,59,59),(60,60,60),
+(61,61,61),(62,62,62),(63,63,63),(64,64,64),(65,65,65),
+(66,66,66),(67,67,67),(68,68,68),(69,69,69),(70,70,70),
+(71,71,71),(72,72,72),(73,73,73),(74,74,74),(75,75,75),
+(76,76,76),(77,77,77),(78,78,78),(79,79,79),(80,80,80),
+(81,81,81),(82,82,82),(83,83,83),(84,84,84),(85,85,85),
+(86,86,86),(87,87,87),(88,88,88),(89,89,89),(90,90,90),
+(91,91,91),(92,92,92),(93,93,93),(94,94,94),(95,95,95),
+(96,96,96),(97,97,97),(98,98,98),(99,99,99),(100,100,100),
+(101,101,101),(102,102,102),(103,103,103),(104,104,104),(105,105,105),
+(106,106,106),(107,107,107),(108,108,108),(109,109,109),(110,110,110),
+(111,111,111),(112,112,112),(113,113,113),(114,114,114),(115,115,115),
+(116,116,116),(117,117,117),(118,118,118),(119,119,119),(120,120,120),
+(121,121,121),(122,122,122),(123,123,123),(124,124,124),(125,125,125),
+(126,126,126),(127,127,127),(128,128,128),(129,129,129),(130,130,130),
+(131,131,131),(132,132,132),(133,133,133),(134,134,134),(135,135,135),
+(136,136,136),(137,137,137),(138,138,138),(139,139,139),(140,140,140),
+(141,141,141),(142,142,142),(143,143,143),(144,144,144),(145,145,145),
+(146,146,146),(147,147,147),(148,148,148),(149,149,149),(150,150,150),
+(151,151,151),(152,152,152),(153,153,153),(154,154,154),(155,155,155),
+(156,156,156),(157,157,157),(158,158,158),(159,159,159),(160,160,160),
+(161,161,161),(162,162,162),(163,163,163),(164,164,164),(165,165,165),
+(166,166,166),(167,167,167),(168,168,168),(169,169,169),(170,170,170),
+(171,171,171),(172,172,172),(173,173,173),(174,174,174),(175,175,175),
+(176,176,176),(177,177,177),(178,178,178),(179,179,179),(180,180,180),
+(181,181,181),(182,182,182),(183,183,183),(184,184,184),(185,185,185),
+(186,186,186),(187,187,187),(188,188,188),(189,189,189),(190,190,190),
+(191,191,191),(192,192,192),(193,193,193),(194,194,194),(195,195,195),
+(196,196,196),(197,197,197),(198,198,198),(199,199,199),(200,200,200),
+(201,201,201),(202,202,202),(203,203,203),(204,204,204),(205,205,205),
+(206,206,206),(207,207,207),(208,208,208),(209,209,209),(210,210,210),
+(211,211,211),(212,212,212),(213,213,213),(214,214,214),(215,215,215),
+(216,216,216),(217,217,217),(218,218,218),(219,219,219),(220,220,220),
+(221,221,221),(222,222,222),(223,223,223),(224,224,224),(225,225,225),
+(226,226,226),(227,227,227),(228,228,228),(229,229,229),(230,230,230),
+(231,231,231),(232,232,232),(233,233,233),(234,234,234),(235,235,235),
+(236,236,236),(237,237,237),(238,238,238),(239,239,239),(240,240,240),
+(241,241,241),(242,242,242),(243,243,243),(244,244,244),(245,245,245),
+(246,246,246),(247,247,247),(248,248,248),(249,249,249),(250,250,250),
+(251,251,251),(252,252,252),(253,253,253),(254,254,254),(255,255,255),
+(256,256,256),(257,257,257),(258,258,258),(259,259,259),(260,260,260),
+(261,261,261),(262,262,262),(263,263,263),(264,264,264),(265,265,265),
+(266,266,266),(267,267,267),(268,268,268),(269,269,269),(270,270,270),
+(271,271,271),(272,272,272),(273,273,273),(274,274,274),(275,275,275),
+(276,276,276),(277,277,277),(278,278,278),(279,279,279),(280,280,280),
+(281,281,281),(282,282,282),(283,283,283),(284,284,284),(285,285,285),
+(286,286,286),(287,287,287),(288,288,288),(289,289,289),(290,290,290),
+(291,291,291),(292,292,292),(293,293,293),(294,294,294),(295,295,295),
+(296,296,296),(297,297,297),(298,298,298),(299,299,299),(300,300,300),
+(301,301,301),(302,302,302),(303,303,303),(304,304,304),(305,305,305),
+(306,306,306),(307,307,307),(308,308,308),(309,309,309),(310,310,310),
+(311,311,311),(312,312,312),(313,313,313),(314,314,314),(315,315,315),
+(316,316,316),(317,317,317),(318,318,318),(319,319,319),(320,320,320),
+(321,321,321),(322,322,322),(323,323,323),(324,324,324),(325,325,325),
+(326,326,326),(327,327,327),(328,328,328),(329,329,329),(330,330,330),
+(331,331,331),(332,332,332),(333,333,333),(334,334,334),(335,335,335),
+(336,336,336),(337,337,337),(338,338,338),(339,339,339),(340,340,340),
+(341,341,341),(342,342,342),(343,343,343),(344,344,344),(345,345,345),
+(346,346,346),(347,347,347),(348,348,348),(349,349,349),(350,350,350),
+(351,351,351),(352,352,352),(353,353,353),(354,354,354),(355,355,355),
+(356,356,356),(357,357,357),(358,358,358),(359,359,359),(360,360,360),
+(361,361,361),(362,362,362),(363,363,363),(364,364,364),(365,365,365),
+(366,366,366),(367,367,367),(368,368,368),(369,369,369),(370,370,370),
+(371,371,371),(372,372,372),(373,373,373),(374,374,374),(375,375,375),
+(376,376,376),(377,377,377),(378,378,378),(379,379,379),(380,380,380),
+(381,381,381),(382,382,382),(383,383,383),(384,384,384),(385,385,385),
+(386,386,386),(387,387,387),(388,388,388),(389,389,389),(390,390,390),
+(391,391,391),(392,392,392),(393,393,393),(394,394,394),(395,395,395),
+(396,396,396),(397,397,397),(398,398,398),(399,399,399),(400,400,400),
+(401,401,401),(402,402,402),(403,403,403),(404,404,404),(405,405,405),
+(406,406,406),(407,407,407),(408,408,408),(409,409,409),(410,410,410),
+(411,411,411),(412,412,412),(413,413,413),(414,414,414),(415,415,415),
+(416,416,416),(417,417,417),(418,418,418),(419,419,419),(420,420,420),
+(421,421,421),(422,422,422),(423,423,423),(424,424,424),(425,425,425),
+(426,426,426),(427,427,427),(428,428,428),(429,429,429),(430,430,430),
+(431,431,431),(432,432,432),(433,433,433),(434,434,434),(435,435,435),
+(436,436,436),(437,437,437),(438,438,438),(439,439,439),(440,440,440),
+(441,441,441),(442,442,442),(443,443,443),(444,444,444),(445,445,445),
+(446,446,446),(447,447,447),(448,448,448),(449,449,449),(450,450,450),
+(451,451,451),(452,452,452),(453,453,453),(454,454,454),(455,455,455),
+(456,456,456),(457,457,457),(458,458,458),(459,459,459),(460,460,460),
+(461,461,461),(462,462,462),(463,463,463),(464,464,464),(465,465,465),
+(466,466,466),(467,467,467),(468,468,468),(469,469,469),(470,470,470),
+(471,471,471),(472,472,472),(473,473,473),(474,474,474),(475,475,475),
+(476,476,476),(477,477,477),(478,478,478),(479,479,479),(480,480,480),
+(481,481,481),(482,482,482),(483,483,483),(484,484,484),(485,485,485),
+(486,486,486),(487,487,487),(488,488,488),(489,489,489),(490,490,490),
+(491,491,491),(492,492,492),(493,493,493),(494,494,494),(495,495,495),
+(496,496,496),(497,497,497),(498,498,498),(499,499,499),(500, 500, 500);
+INSERT INTO t2 VALUES
+(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5);
+INSERT INTO t3 VALUES
+(1,1,1);
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile_ts1_01.dat'
+ENGINE = NDB;
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile_ts1_02.dat'
+ENGINE = NDB;
+ALTER TABLESPACE ts2
+DROP DATAFILE 'datafile_ts2_01.dat'
+ENGINE = NDB;
+ALTER TABLESPACE ts3
+DROP DATAFILE 'datafile_ts3_01.dat'
+ENGINE = NDB;
+DROP TABLESPACE ts1 ENGINE = NDB;
+DROP TABLESPACE ts2 ENGINE = NDB;
+DROP TABLESPACE ts3 ENGINE = NDB;
+DROP LOGFILE GROUP lg1 ENGINE = NDB;
+SELECT DISTINCT
+LOGFILE_GROUP_NAME,
+FILE_NAME,
+TOTAL_EXTENTS,
+INITIAL_SIZE,
+ENGINE
+FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE="UNDO LOG" ORDER BY FILE_NAME;
+LOGFILE_GROUP_NAME FILE_NAME TOTAL_EXTENTS INITIAL_SIZE ENGINE
+lg1 NULL NULL NULL ndbcluster
+lg1 undofile_lg1_01.dat 524288 2097152 ndbcluster
+lg1 undofile_lg1_02.dat 1048576 4194304 ndbcluster
+SELECT DISTINCT
+TABLESPACE_NAME,
+LOGFILE_GROUP_NAME,
+FILE_NAME,
+EXTENT_SIZE,
+INITIAL_SIZE,
+ENGINE
+FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE="DATAFILE" ORDER BY FILE_NAME;
+TABLESPACE_NAME LOGFILE_GROUP_NAME FILE_NAME EXTENT_SIZE INITIAL_SIZE ENGINE
+ts1 lg1 datafile_ts1_01.dat 1048576 2097152 ndbcluster
+ts1 lg1 datafile_ts1_02.dat 1048576 1048576 ndbcluster
+ts2 lg1 datafile_ts2_01.dat 1048576 2097152 ndbcluster
+ts3 lg1 datafile_ts3_01.dat 1048576 4194304 ndbcluster
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+500
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+5
+SELECT COUNT(*) FROM t3;
+COUNT(*)
+1
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+CREATE TABLE test.t (
+a smallint NOT NULL,
+b int NOT NULL,
+c bigint NOT NULL,
+d char(10),
+e TEXT,
+f VARCHAR(255),
+PRIMARY KEY(a)
+) TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
+ALTER TABLE test.t ADD INDEX (d), ADD INDEX (f);
+SHOW CREATE TABLE test.t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` smallint(6) NOT NULL,
+ `b` int(11) NOT NULL,
+ `c` bigint(20) NOT NULL,
+ `d` char(10) DEFAULT NULL,
+ `e` text,
+ `f` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`a`),
+ KEY `d` (`d`),
+ KEY `f` (`f`)
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+SELECT * FROM test.t order by a;
+a b c d e f
+1 2 3 aaa1 bbb1 ccccc1
+2 3 4 aaa2 bbb2 ccccc2
+3 4 5 aaa3 bbb3 ccccc3
+4 5 6 aaa4 bbb4 ccccc4
+5 6 7 aaa5 bbb5 ccccc5
+6 7 8 aaa6 bbb6 ccccc6
+7 8 9 aaa7 bbb7 ccccc7
+8 9 10 aaa8 bbb8 ccccc8
+9 10 11 aaa9 bbb9 ccccc9
+10 11 12 aaa10 bbb10 ccccc10
+11 12 13 aaa11 bbb11 ccccc11
+12 13 14 aaa12 bbb12 ccccc12
+13 14 15 aaa13 bbb13 ccccc13
+14 15 16 aaa14 bbb14 ccccc14
+15 16 17 aaa15 bbb15 ccccc15
+16 17 18 aaa16 bbb16 ccccc16
+17 18 19 aaa17 bbb17 ccccc17
+18 19 20 aaa18 bbb18 ccccc18
+19 20 21 aaa19 bbb19 ccccc19
+20 21 22 aaa20 bbb20 ccccc20
+21 22 23 aaa21 bbb21 ccccc21
+22 23 24 aaa22 bbb22 ccccc22
+23 24 25 aaa23 bbb23 ccccc23
+24 25 26 aaa24 bbb24 ccccc24
+25 26 27 aaa25 bbb25 ccccc25
+26 27 28 aaa26 bbb26 ccccc26
+27 28 29 aaa27 bbb27 ccccc27
+28 29 30 aaa28 bbb28 ccccc28
+29 30 31 aaa29 bbb29 ccccc29
+30 31 32 aaa30 bbb30 ccccc30
+31 32 33 aaa31 bbb31 ccccc31
+32 33 34 aaa32 bbb32 ccccc32
+33 34 35 aaa33 bbb33 ccccc33
+34 35 36 aaa34 bbb34 ccccc34
+35 36 37 aaa35 bbb35 ccccc35
+36 37 38 aaa36 bbb36 ccccc36
+37 38 39 aaa37 bbb37 ccccc37
+38 39 40 aaa38 bbb38 ccccc38
+39 40 41 aaa39 bbb39 ccccc39
+40 41 42 aaa40 bbb40 ccccc40
+41 42 43 aaa41 bbb41 ccccc41
+42 43 44 aaa42 bbb42 ccccc42
+43 44 45 aaa43 bbb43 ccccc43
+44 45 46 aaa44 bbb44 ccccc44
+45 46 47 aaa45 bbb45 ccccc45
+46 47 48 aaa46 bbb46 ccccc46
+47 48 49 aaa47 bbb47 ccccc47
+48 49 50 aaa48 bbb48 ccccc48
+49 50 51 aaa49 bbb49 ccccc49
+50 51 52 aaa50 bbb50 ccccc50
+51 52 53 aaa51 bbb51 ccccc51
+52 53 54 aaa52 bbb52 ccccc52
+53 54 55 aaa53 bbb53 ccccc53
+54 55 56 aaa54 bbb54 ccccc54
+55 56 57 aaa55 bbb55 ccccc55
+56 57 58 aaa56 bbb56 ccccc56
+57 58 59 aaa57 bbb57 ccccc57
+58 59 60 aaa58 bbb58 ccccc58
+59 60 61 aaa59 bbb59 ccccc59
+60 61 62 aaa60 bbb60 ccccc60
+61 62 63 aaa61 bbb61 ccccc61
+62 63 64 aaa62 bbb62 ccccc62
+63 64 65 aaa63 bbb63 ccccc63
+64 65 66 aaa64 bbb64 ccccc64
+65 66 67 aaa65 bbb65 ccccc65
+66 67 68 aaa66 bbb66 ccccc66
+67 68 69 aaa67 bbb67 ccccc67
+68 69 70 aaa68 bbb68 ccccc68
+69 70 71 aaa69 bbb69 ccccc69
+70 71 72 aaa70 bbb70 ccccc70
+71 72 73 aaa71 bbb71 ccccc71
+72 73 74 aaa72 bbb72 ccccc72
+73 74 75 aaa73 bbb73 ccccc73
+74 75 76 aaa74 bbb74 ccccc74
+75 76 77 aaa75 bbb75 ccccc75
+76 77 78 aaa76 bbb76 ccccc76
+77 78 79 aaa77 bbb77 ccccc77
+78 79 80 aaa78 bbb78 ccccc78
+79 80 81 aaa79 bbb79 ccccc79
+80 81 82 aaa80 bbb80 ccccc80
+81 82 83 aaa81 bbb81 ccccc81
+82 83 84 aaa82 bbb82 ccccc82
+83 84 85 aaa83 bbb83 ccccc83
+84 85 86 aaa84 bbb84 ccccc84
+85 86 87 aaa85 bbb85 ccccc85
+86 87 88 aaa86 bbb86 ccccc86
+87 88 89 aaa87 bbb87 ccccc87
+88 89 90 aaa88 bbb88 ccccc88
+89 90 91 aaa89 bbb89 ccccc89
+90 91 92 aaa90 bbb90 ccccc90
+91 92 93 aaa91 bbb91 ccccc91
+92 93 94 aaa92 bbb92 ccccc92
+93 94 95 aaa93 bbb93 ccccc93
+94 95 96 aaa94 bbb94 ccccc94
+95 96 97 aaa95 bbb95 ccccc95
+96 97 98 aaa96 bbb96 ccccc96
+97 98 99 aaa97 bbb97 ccccc97
+98 99 100 aaa98 bbb98 ccccc98
+99 100 101 aaa99 bbb99 ccccc99
+100 101 102 aaa100 bbb100 ccccc100
+SELECT * INTO OUTFILE 't_backup' FROM test.t;
+TRUNCATE test.t;
+SELECT count(*) FROM test.t;
+count(*)
+0
+LOAD DATA INFILE 't_backup' INTO TABLE test.t;
+SELECT * FROM test.t order by a;
+a b c d e f
+1 2 3 aaa1 bbb1 ccccc1
+2 3 4 aaa2 bbb2 ccccc2
+3 4 5 aaa3 bbb3 ccccc3
+4 5 6 aaa4 bbb4 ccccc4
+5 6 7 aaa5 bbb5 ccccc5
+6 7 8 aaa6 bbb6 ccccc6
+7 8 9 aaa7 bbb7 ccccc7
+8 9 10 aaa8 bbb8 ccccc8
+9 10 11 aaa9 bbb9 ccccc9
+10 11 12 aaa10 bbb10 ccccc10
+11 12 13 aaa11 bbb11 ccccc11
+12 13 14 aaa12 bbb12 ccccc12
+13 14 15 aaa13 bbb13 ccccc13
+14 15 16 aaa14 bbb14 ccccc14
+15 16 17 aaa15 bbb15 ccccc15
+16 17 18 aaa16 bbb16 ccccc16
+17 18 19 aaa17 bbb17 ccccc17
+18 19 20 aaa18 bbb18 ccccc18
+19 20 21 aaa19 bbb19 ccccc19
+20 21 22 aaa20 bbb20 ccccc20
+21 22 23 aaa21 bbb21 ccccc21
+22 23 24 aaa22 bbb22 ccccc22
+23 24 25 aaa23 bbb23 ccccc23
+24 25 26 aaa24 bbb24 ccccc24
+25 26 27 aaa25 bbb25 ccccc25
+26 27 28 aaa26 bbb26 ccccc26
+27 28 29 aaa27 bbb27 ccccc27
+28 29 30 aaa28 bbb28 ccccc28
+29 30 31 aaa29 bbb29 ccccc29
+30 31 32 aaa30 bbb30 ccccc30
+31 32 33 aaa31 bbb31 ccccc31
+32 33 34 aaa32 bbb32 ccccc32
+33 34 35 aaa33 bbb33 ccccc33
+34 35 36 aaa34 bbb34 ccccc34
+35 36 37 aaa35 bbb35 ccccc35
+36 37 38 aaa36 bbb36 ccccc36
+37 38 39 aaa37 bbb37 ccccc37
+38 39 40 aaa38 bbb38 ccccc38
+39 40 41 aaa39 bbb39 ccccc39
+40 41 42 aaa40 bbb40 ccccc40
+41 42 43 aaa41 bbb41 ccccc41
+42 43 44 aaa42 bbb42 ccccc42
+43 44 45 aaa43 bbb43 ccccc43
+44 45 46 aaa44 bbb44 ccccc44
+45 46 47 aaa45 bbb45 ccccc45
+46 47 48 aaa46 bbb46 ccccc46
+47 48 49 aaa47 bbb47 ccccc47
+48 49 50 aaa48 bbb48 ccccc48
+49 50 51 aaa49 bbb49 ccccc49
+50 51 52 aaa50 bbb50 ccccc50
+51 52 53 aaa51 bbb51 ccccc51
+52 53 54 aaa52 bbb52 ccccc52
+53 54 55 aaa53 bbb53 ccccc53
+54 55 56 aaa54 bbb54 ccccc54
+55 56 57 aaa55 bbb55 ccccc55
+56 57 58 aaa56 bbb56 ccccc56
+57 58 59 aaa57 bbb57 ccccc57
+58 59 60 aaa58 bbb58 ccccc58
+59 60 61 aaa59 bbb59 ccccc59
+60 61 62 aaa60 bbb60 ccccc60
+61 62 63 aaa61 bbb61 ccccc61
+62 63 64 aaa62 bbb62 ccccc62
+63 64 65 aaa63 bbb63 ccccc63
+64 65 66 aaa64 bbb64 ccccc64
+65 66 67 aaa65 bbb65 ccccc65
+66 67 68 aaa66 bbb66 ccccc66
+67 68 69 aaa67 bbb67 ccccc67
+68 69 70 aaa68 bbb68 ccccc68
+69 70 71 aaa69 bbb69 ccccc69
+70 71 72 aaa70 bbb70 ccccc70
+71 72 73 aaa71 bbb71 ccccc71
+72 73 74 aaa72 bbb72 ccccc72
+73 74 75 aaa73 bbb73 ccccc73
+74 75 76 aaa74 bbb74 ccccc74
+75 76 77 aaa75 bbb75 ccccc75
+76 77 78 aaa76 bbb76 ccccc76
+77 78 79 aaa77 bbb77 ccccc77
+78 79 80 aaa78 bbb78 ccccc78
+79 80 81 aaa79 bbb79 ccccc79
+80 81 82 aaa80 bbb80 ccccc80
+81 82 83 aaa81 bbb81 ccccc81
+82 83 84 aaa82 bbb82 ccccc82
+83 84 85 aaa83 bbb83 ccccc83
+84 85 86 aaa84 bbb84 ccccc84
+85 86 87 aaa85 bbb85 ccccc85
+86 87 88 aaa86 bbb86 ccccc86
+87 88 89 aaa87 bbb87 ccccc87
+88 89 90 aaa88 bbb88 ccccc88
+89 90 91 aaa89 bbb89 ccccc89
+90 91 92 aaa90 bbb90 ccccc90
+91 92 93 aaa91 bbb91 ccccc91
+92 93 94 aaa92 bbb92 ccccc92
+93 94 95 aaa93 bbb93 ccccc93
+94 95 96 aaa94 bbb94 ccccc94
+95 96 97 aaa95 bbb95 ccccc95
+96 97 98 aaa96 bbb96 ccccc96
+97 98 99 aaa97 bbb97 ccccc97
+98 99 100 aaa98 bbb98 ccccc98
+99 100 101 aaa99 bbb99 ccccc99
+100 101 102 aaa100 bbb100 ccccc100
+DROP TABLE test.t;
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile_ts1_01.dat'
+ENGINE = NDB;
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile_ts1_02.dat'
+ENGINE = NDB;
+ALTER TABLESPACE ts2
+DROP DATAFILE 'datafile_ts2_01.dat'
+ENGINE = NDB;
+ALTER TABLESPACE ts3
+DROP DATAFILE 'datafile_ts3_01.dat'
+ENGINE = NDB;
+DROP TABLESPACE ts1 ENGINE = NDB;
+DROP TABLESPACE ts2 ENGINE = NDB;
+DROP TABLESPACE ts3 ENGINE = NDB;
+DROP LOGFILE GROUP lg1 ENGINE = NDB;
diff --git a/mysql-test/r/ndb_dd_sql_features.result b/mysql-test/suite/ndb/r/ndb_dd_sql_features.result
index 135250fe7e8..135250fe7e8 100644
--- a/mysql-test/r/ndb_dd_sql_features.result
+++ b/mysql-test/suite/ndb/r/ndb_dd_sql_features.result
diff --git a/mysql-test/suite/ndb/r/ndb_gis.result b/mysql-test/suite/ndb/r/ndb_gis.result
new file mode 100644
index 00000000000..b401dee8054
--- /dev/null
+++ b/mysql-test/suite/ndb/r/ndb_gis.result
@@ -0,0 +1,1100 @@
+SET storage_engine=ndbcluster;
+DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
+CREATE TABLE gis_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT);
+CREATE TABLE gis_line (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g LINESTRING);
+CREATE TABLE gis_polygon (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POLYGON);
+CREATE TABLE gis_multi_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g MULTIPOINT);
+CREATE TABLE gis_multi_line (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g MULTILINESTRING);
+CREATE TABLE gis_multi_polygon (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g MULTIPOLYGON);
+CREATE TABLE gis_geometrycollection (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g GEOMETRYCOLLECTION);
+CREATE TABLE gis_geometry (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g GEOMETRY);
+SHOW CREATE TABLE gis_point;
+Table Create Table
+gis_point CREATE TABLE `gis_point` (
+ `fid` int(11) NOT NULL AUTO_INCREMENT,
+ `g` point DEFAULT NULL,
+ PRIMARY KEY (`fid`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+SHOW FIELDS FROM gis_point;
+Field Type Null Key Default Extra
+fid int(11) NO PRI NULL auto_increment
+g point YES NULL
+SHOW FIELDS FROM gis_line;
+Field Type Null Key Default Extra
+fid int(11) NO PRI NULL auto_increment
+g linestring YES NULL
+SHOW FIELDS FROM gis_polygon;
+Field Type Null Key Default Extra
+fid int(11) NO PRI NULL auto_increment
+g polygon YES NULL
+SHOW FIELDS FROM gis_multi_point;
+Field Type Null Key Default Extra
+fid int(11) NO PRI NULL auto_increment
+g multipoint YES NULL
+SHOW FIELDS FROM gis_multi_line;
+Field Type Null Key Default Extra
+fid int(11) NO PRI NULL auto_increment
+g multilinestring YES NULL
+SHOW FIELDS FROM gis_multi_polygon;
+Field Type Null Key Default Extra
+fid int(11) NO PRI NULL auto_increment
+g multipolygon YES NULL
+SHOW FIELDS FROM gis_geometrycollection;
+Field Type Null Key Default Extra
+fid int(11) NO PRI NULL auto_increment
+g geometrycollection YES NULL
+SHOW FIELDS FROM gis_geometry;
+Field Type Null Key Default Extra
+fid int(11) NO PRI NULL auto_increment
+g geometry YES NULL
+INSERT INTO gis_point VALUES
+(101, PointFromText('POINT(10 10)')),
+(102, PointFromText('POINT(20 10)')),
+(103, PointFromText('POINT(20 20)')),
+(104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)'))));
+INSERT INTO gis_line VALUES
+(105, LineFromText('LINESTRING(0 0,0 10,10 0)')),
+(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')),
+(107, LineStringFromWKB(LineString(Point(10, 10), Point(40, 10))));
+INSERT INTO gis_polygon VALUES
+(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')),
+(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')),
+(110, PolyFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))));
+INSERT INTO gis_multi_point VALUES
+(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')),
+(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')),
+(113, MPointFromWKB(MultiPoint(Point(3, 6), Point(4, 10))));
+INSERT INTO gis_multi_line VALUES
+(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')),
+(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')),
+(116, MLineFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))));
+INSERT INTO gis_multi_polygon VALUES
+(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
+(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
+(119, MPolyFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))));
+INSERT INTO gis_geometrycollection VALUES
+(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')),
+(121, GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))));
+INSERT into gis_geometry SELECT * FROM gis_point;
+INSERT into gis_geometry SELECT * FROM gis_line;
+INSERT into gis_geometry SELECT * FROM gis_polygon;
+INSERT into gis_geometry SELECT * FROM gis_multi_point;
+INSERT into gis_geometry SELECT * FROM gis_multi_line;
+INSERT into gis_geometry SELECT * FROM gis_multi_polygon;
+INSERT into gis_geometry SELECT * FROM gis_geometrycollection;
+SELECT fid, AsText(g) FROM gis_point ORDER by fid;
+fid AsText(g)
+101 POINT(10 10)
+102 POINT(20 10)
+103 POINT(20 20)
+104 POINT(10 20)
+SELECT fid, AsText(g) FROM gis_line ORDER by fid;
+fid AsText(g)
+105 LINESTRING(0 0,0 10,10 0)
+106 LINESTRING(10 10,20 10,20 20,10 20,10 10)
+107 LINESTRING(10 10,40 10)
+SELECT fid, AsText(g) FROM gis_polygon ORDER by fid;
+fid AsText(g)
+108 POLYGON((10 10,20 10,20 20,10 20,10 10))
+109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10))
+110 POLYGON((0 0,30 0,30 30,0 0))
+SELECT fid, AsText(g) FROM gis_multi_point ORDER by fid;
+fid AsText(g)
+111 MULTIPOINT(0 0,10 10,10 20,20 20)
+112 MULTIPOINT(1 1,11 11,11 21,21 21)
+113 MULTIPOINT(3 6,4 10)
+SELECT fid, AsText(g) FROM gis_multi_line ORDER by fid;
+fid AsText(g)
+114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))
+115 MULTILINESTRING((10 48,10 21,10 0))
+116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7))
+SELECT fid, AsText(g) FROM gis_multi_polygon ORDER by fid;
+fid AsText(g)
+117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+119 MULTIPOLYGON(((0 3,3 3,3 0,0 3)))
+SELECT fid, AsText(g) FROM gis_geometrycollection ORDER by fid;
+fid AsText(g)
+120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10))
+121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9))
+SELECT fid, AsText(g) FROM gis_geometry ORDER by fid;
+fid AsText(g)
+101 POINT(10 10)
+102 POINT(20 10)
+103 POINT(20 20)
+104 POINT(10 20)
+105 LINESTRING(0 0,0 10,10 0)
+106 LINESTRING(10 10,20 10,20 20,10 20,10 10)
+107 LINESTRING(10 10,40 10)
+108 POLYGON((10 10,20 10,20 20,10 20,10 10))
+109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10))
+110 POLYGON((0 0,30 0,30 30,0 0))
+111 MULTIPOINT(0 0,10 10,10 20,20 20)
+112 MULTIPOINT(1 1,11 11,11 21,21 21)
+113 MULTIPOINT(3 6,4 10)
+114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))
+115 MULTILINESTRING((10 48,10 21,10 0))
+116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7))
+117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+119 MULTIPOLYGON(((0 3,3 3,3 0,0 3)))
+120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10))
+121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9))
+SELECT fid, Dimension(g) FROM gis_geometry ORDER by fid;
+fid Dimension(g)
+101 0
+102 0
+103 0
+104 0
+105 1
+106 1
+107 1
+108 2
+109 2
+110 2
+111 0
+112 0
+113 0
+114 1
+115 1
+116 1
+117 2
+118 2
+119 2
+120 1
+121 1
+SELECT fid, GeometryType(g) FROM gis_geometry ORDER by fid;
+fid GeometryType(g)
+101 POINT
+102 POINT
+103 POINT
+104 POINT
+105 LINESTRING
+106 LINESTRING
+107 LINESTRING
+108 POLYGON
+109 POLYGON
+110 POLYGON
+111 MULTIPOINT
+112 MULTIPOINT
+113 MULTIPOINT
+114 MULTILINESTRING
+115 MULTILINESTRING
+116 MULTILINESTRING
+117 MULTIPOLYGON
+118 MULTIPOLYGON
+119 MULTIPOLYGON
+120 GEOMETRYCOLLECTION
+121 GEOMETRYCOLLECTION
+SELECT fid, IsEmpty(g) FROM gis_geometry ORDER by fid;
+fid IsEmpty(g)
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+SELECT fid, AsText(Envelope(g)) FROM gis_geometry ORDER by fid;
+fid AsText(Envelope(g))
+101 POLYGON((10 10,10 10,10 10,10 10,10 10))
+102 POLYGON((20 10,20 10,20 10,20 10,20 10))
+103 POLYGON((20 20,20 20,20 20,20 20,20 20))
+104 POLYGON((10 20,10 20,10 20,10 20,10 20))
+105 POLYGON((0 0,10 0,10 10,0 10,0 0))
+106 POLYGON((10 10,20 10,20 20,10 20,10 10))
+107 POLYGON((10 10,40 10,40 10,10 10,10 10))
+108 POLYGON((10 10,20 10,20 20,10 20,10 10))
+109 POLYGON((0 0,50 0,50 50,0 50,0 0))
+110 POLYGON((0 0,30 0,30 30,0 30,0 0))
+111 POLYGON((0 0,20 0,20 20,0 20,0 0))
+112 POLYGON((1 1,21 1,21 21,1 21,1 1))
+113 POLYGON((3 6,4 6,4 10,3 10,3 6))
+114 POLYGON((10 0,16 0,16 48,10 48,10 0))
+115 POLYGON((10 0,10 0,10 48,10 48,10 0))
+116 POLYGON((1 2,21 2,21 8,1 8,1 2))
+117 POLYGON((28 0,84 0,84 42,28 42,28 0))
+118 POLYGON((28 0,84 0,84 42,28 42,28 0))
+119 POLYGON((0 0,3 0,3 3,0 3,0 0))
+120 POLYGON((0 0,10 0,10 10,0 10,0 0))
+121 POLYGON((3 6,44 6,44 9,3 9,3 6))
+explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelope(g)) from gis_geometry;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE gis_geometry ALL NULL NULL NULL NULL 21 100.00
+Warnings:
+Note 1003 select dimension(`test`.`gis_geometry`.`g`) AS `Dimension(g)`,geometrytype(`test`.`gis_geometry`.`g`) AS `GeometryType(g)`,isempty(`test`.`gis_geometry`.`g`) AS `IsEmpty(g)`,astext(envelope(`test`.`gis_geometry`.`g`)) AS `AsText(Envelope(g))` from `test`.`gis_geometry`
+SELECT fid, X(g) FROM gis_point ORDER by fid;
+fid X(g)
+101 10
+102 20
+103 20
+104 10
+SELECT fid, Y(g) FROM gis_point ORDER by fid;
+fid Y(g)
+101 10
+102 10
+103 20
+104 20
+explain extended select X(g),Y(g) FROM gis_point;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE gis_point ALL NULL NULL NULL NULL 4 100.00
+Warnings:
+Note 1003 select x(`test`.`gis_point`.`g`) AS `X(g)`,y(`test`.`gis_point`.`g`) AS `Y(g)` from `test`.`gis_point`
+SELECT fid, AsText(StartPoint(g)) FROM gis_line ORDER by fid;
+fid AsText(StartPoint(g))
+105 POINT(0 0)
+106 POINT(10 10)
+107 POINT(10 10)
+SELECT fid, AsText(EndPoint(g)) FROM gis_line ORDER by fid;
+fid AsText(EndPoint(g))
+105 POINT(10 0)
+106 POINT(10 10)
+107 POINT(40 10)
+SELECT fid, GLength(g) FROM gis_line ORDER by fid;
+fid GLength(g)
+105 24.142135623731
+106 40
+107 30
+SELECT fid, NumPoints(g) FROM gis_line ORDER by fid;
+fid NumPoints(g)
+105 3
+106 5
+107 2
+SELECT fid, AsText(PointN(g, 2)) FROM gis_line ORDER by fid;
+fid AsText(PointN(g, 2))
+105 POINT(0 10)
+106 POINT(20 10)
+107 POINT(40 10)
+SELECT fid, IsClosed(g) FROM gis_line ORDER by fid;
+fid IsClosed(g)
+105 0
+106 1
+107 0
+explain extended select AsText(StartPoint(g)),AsText(EndPoint(g)),GLength(g),NumPoints(g),AsText(PointN(g, 2)),IsClosed(g) FROM gis_line;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE gis_line ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint(g))`,astext(endpoint(`test`.`gis_line`.`g`)) AS `AsText(EndPoint(g))`,glength(`test`.`gis_line`.`g`) AS `GLength(g)`,numpoints(`test`.`gis_line`.`g`) AS `NumPoints(g)`,astext(pointn(`test`.`gis_line`.`g`,2)) AS `AsText(PointN(g, 2))`,isclosed(`test`.`gis_line`.`g`) AS `IsClosed(g)` from `test`.`gis_line`
+SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid;
+fid AsText(Centroid(g))
+108 POINT(15 15)
+109 POINT(25.416666666667 25.416666666667)
+110 POINT(20 10)
+SELECT fid, Area(g) FROM gis_polygon ORDER by fid;
+fid Area(g)
+108 100
+109 2400
+110 450
+SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon ORDER by fid;
+fid AsText(ExteriorRing(g))
+108 LINESTRING(10 10,20 10,20 20,10 20,10 10)
+109 LINESTRING(0 0,50 0,50 50,0 50,0 0)
+110 LINESTRING(0 0,30 0,30 30,0 0)
+SELECT fid, NumInteriorRings(g) FROM gis_polygon ORDER by fid;
+fid NumInteriorRings(g)
+108 0
+109 1
+110 0
+SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon ORDER by fid;
+fid AsText(InteriorRingN(g, 1))
+108 NULL
+109 LINESTRING(10 10,20 10,20 20,10 20,10 10)
+110 NULL
+explain extended select AsText(Centroid(g)),Area(g),AsText(ExteriorRing(g)),NumInteriorRings(g),AsText(InteriorRingN(g, 1)) FROM gis_polygon;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE gis_polygon ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1003 select astext(centroid(`test`.`gis_polygon`.`g`)) AS `AsText(Centroid(g))`,area(`test`.`gis_polygon`.`g`) AS `Area(g)`,astext(exteriorring(`test`.`gis_polygon`.`g`)) AS `AsText(ExteriorRing(g))`,numinteriorrings(`test`.`gis_polygon`.`g`) AS `NumInteriorRings(g)`,astext(interiorringn(`test`.`gis_polygon`.`g`,1)) AS `AsText(InteriorRingN(g, 1))` from `test`.`gis_polygon`
+SELECT fid, IsClosed(g) FROM gis_multi_line ORDER by fid;
+fid IsClosed(g)
+114 0
+115 0
+116 0
+SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
+fid AsText(Centroid(g))
+117 POINT(55.588527753042 17.426536064114)
+118 POINT(55.588527753042 17.426536064114)
+119 POINT(2 2)
+SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
+fid Area(g)
+117 1684.5
+118 1684.5
+119 4.5
+SELECT fid, NumGeometries(g) from gis_multi_point ORDER by fid;
+fid NumGeometries(g)
+111 4
+112 4
+113 2
+SELECT fid, NumGeometries(g) from gis_multi_line ORDER by fid;
+fid NumGeometries(g)
+114 2
+115 1
+116 2
+SELECT fid, NumGeometries(g) from gis_multi_polygon ORDER by fid;
+fid NumGeometries(g)
+117 2
+118 2
+119 1
+SELECT fid, NumGeometries(g) from gis_geometrycollection ORDER by fid;
+fid NumGeometries(g)
+120 2
+121 2
+explain extended SELECT fid, NumGeometries(g) from gis_multi_point;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1003 select `test`.`gis_multi_point`.`fid` AS `fid`,numgeometries(`test`.`gis_multi_point`.`g`) AS `NumGeometries(g)` from `test`.`gis_multi_point`
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point ORDER by fid;
+fid AsText(GeometryN(g, 2))
+111 POINT(10 10)
+112 POINT(11 11)
+113 POINT(4 10)
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line ORDER by fid;
+fid AsText(GeometryN(g, 2))
+114 LINESTRING(16 0,16 23,16 48)
+115 NULL
+116 LINESTRING(2 5,5 8,21 7)
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon ORDER by fid;
+fid AsText(GeometryN(g, 2))
+117 POLYGON((59 18,67 18,67 13,59 13,59 18))
+118 POLYGON((59 18,67 18,67 13,59 13,59 18))
+119 NULL
+SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection ORDER by fid;
+fid AsText(GeometryN(g, 2))
+120 LINESTRING(0 0,10 10)
+121 LINESTRING(3 6,7 9)
+SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection ORDER by fid;
+fid AsText(GeometryN(g, 1))
+120 POINT(0 0)
+121 POINT(44 6)
+explain extended SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1003 select `test`.`gis_multi_point`.`fid` AS `fid`,astext(geometryn(`test`.`gis_multi_point`.`g`,2)) AS `AsText(GeometryN(g, 2))` from `test`.`gis_multi_point`
+SELECT g1.fid as first, g2.fid as second,
+Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
+Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
+Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
+FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
+first second w c o e d t i r
+120 120 1 1 0 1 0 0 1 0
+120 121 0 0 1 0 0 0 1 0
+121 120 0 0 1 0 0 0 1 0
+121 121 1 1 0 1 0 0 1 0
+explain extended SELECT g1.fid as first, g2.fid as second,
+Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
+Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
+Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
+FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE g1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort
+1 SIMPLE g2 ALL NULL NULL NULL NULL 2 100.00 Using join buffer
+Warnings:
+Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,overlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,equals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,disjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,intersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid`
+DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
+CREATE TABLE t1 (
+a INTEGER PRIMARY KEY AUTO_INCREMENT,
+gp point,
+ln linestring,
+pg polygon,
+mp multipoint,
+mln multilinestring,
+mpg multipolygon,
+gc geometrycollection,
+gm geometry
+);
+SHOW FIELDS FROM t1;
+Field Type Null Key Default Extra
+a int(11) NO PRI NULL auto_increment
+gp point YES NULL
+ln linestring YES NULL
+pg polygon YES NULL
+mp multipoint YES NULL
+mln multilinestring YES NULL
+mpg multipolygon YES NULL
+gc geometrycollection YES NULL
+gm geometry YES NULL
+ALTER TABLE t1 ADD fid INT;
+SHOW FIELDS FROM t1;
+Field Type Null Key Default Extra
+a int(11) NO PRI NULL auto_increment
+gp point YES NULL
+ln linestring YES NULL
+pg polygon YES NULL
+mp multipoint YES NULL
+mln multilinestring YES NULL
+mpg multipolygon YES NULL
+gc geometrycollection YES NULL
+gm geometry YES NULL
+fid int(11) YES NULL
+DROP TABLE t1;
+create table t1 (pk integer primary key auto_increment, a geometry not null);
+insert into t1 (a) values (GeomFromText('Point(1 2)'));
+insert into t1 (a) values ('Garbage');
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert IGNORE into t1 (a) values ('Garbage');
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+drop table t1;
+create table t1 (pk integer primary key auto_increment, fl geometry not null);
+insert into t1 (fl) values (1);
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert into t1 (fl) values (1.11);
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert into t1 (fl) values ("qwerty");
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert into t1 (fl) values (pointfromtext('point(1,1)'));
+ERROR 23000: Column 'fl' cannot be null
+drop table t1;
+End of 4.1 tests
+CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY);
+Warnings:
+Error 1477 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))'));
+INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))'));
+INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))'));
+INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))'));
+INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))'));
+INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))'));
+INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))'));
+INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))'));
+INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))'));
+INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))'));
+INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))'));
+INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))'));
+INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))'));
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+mbrcontains
+center,small
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrdisjoint FROM t1 a1 JOIN t1 a2 ON MBRDisjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+mbrdisjoint
+down3,left3,right3,up3
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrequal FROM t1 a1 JOIN t1 a2 ON MBREqual( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+mbrequal
+center
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrintersect FROM t1 a1 JOIN t1 a2 ON MBRIntersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+mbrintersect
+big,center,down,down2,left,left2,right,right2,small,up,up2
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbroverlaps FROM t1 a1 JOIN t1 a2 ON MBROverlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+mbroverlaps
+down,left,right,up
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+mbrtouches
+down2,left2,right2,up2
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+mbrwithin
+big,center
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains FROM t1 a1 JOIN t1 a2 ON Contains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+contains
+center,small
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint FROM t1 a1 JOIN t1 a2 ON Disjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+disjoint
+down3,left3,right3,up3
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS equals FROM t1 a1 JOIN t1 a2 ON Equals( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+equals
+center
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersect FROM t1 a1 JOIN t1 a2 ON Intersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+intersect
+big,center,down,down2,left,left2,right,right2,small,up,up2
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS overlaps FROM t1 a1 JOIN t1 a2 ON Overlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+overlaps
+down,left,right,up
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+touches
+down2,left2,right2,up2
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+within
+big,center
+SET @vert1 = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))');
+SET @horiz1 = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))');
+SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))');
+SET @horiz3 = GeomFromText('POLYGON ((2 0, 3 0, 2 0))');
+SET @point1 = GeomFromText('POLYGON ((0 0))');
+SET @point2 = GeomFromText('POLYGON ((-2 0))');
+SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @vert1) GROUP BY a1.name;
+overlaps
+SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @horiz1) GROUP BY a1.name;
+overlaps
+SELECT Overlaps(@horiz1, @vert1) FROM DUAL;
+Overlaps(@horiz1, @vert1)
+0
+SELECT Overlaps(@horiz1, @horiz2) FROM DUAL;
+Overlaps(@horiz1, @horiz2)
+1
+SELECT Overlaps(@horiz1, @horiz3) FROM DUAL;
+Overlaps(@horiz1, @horiz3)
+0
+SELECT Overlaps(@horiz1, @point1) FROM DUAL;
+Overlaps(@horiz1, @point1)
+0
+SELECT Overlaps(@horiz1, @point2) FROM DUAL;
+Overlaps(@horiz1, @point2)
+0
+DROP TABLE t1;
+End of 5.0 tests
+set engine_condition_pushdown = on;
+DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
+CREATE TABLE gis_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT);
+CREATE TABLE gis_line (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g LINESTRING);
+CREATE TABLE gis_polygon (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POLYGON);
+CREATE TABLE gis_multi_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g MULTIPOINT);
+CREATE TABLE gis_multi_line (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g MULTILINESTRING);
+CREATE TABLE gis_multi_polygon (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g MULTIPOLYGON);
+CREATE TABLE gis_geometrycollection (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g GEOMETRYCOLLECTION);
+CREATE TABLE gis_geometry (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g GEOMETRY);
+SHOW CREATE TABLE gis_point;
+Table Create Table
+gis_point CREATE TABLE `gis_point` (
+ `fid` int(11) NOT NULL AUTO_INCREMENT,
+ `g` point DEFAULT NULL,
+ PRIMARY KEY (`fid`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+SHOW FIELDS FROM gis_point;
+Field Type Null Key Default Extra
+fid int(11) NO PRI NULL auto_increment
+g point YES NULL
+SHOW FIELDS FROM gis_line;
+Field Type Null Key Default Extra
+fid int(11) NO PRI NULL auto_increment
+g linestring YES NULL
+SHOW FIELDS FROM gis_polygon;
+Field Type Null Key Default Extra
+fid int(11) NO PRI NULL auto_increment
+g polygon YES NULL
+SHOW FIELDS FROM gis_multi_point;
+Field Type Null Key Default Extra
+fid int(11) NO PRI NULL auto_increment
+g multipoint YES NULL
+SHOW FIELDS FROM gis_multi_line;
+Field Type Null Key Default Extra
+fid int(11) NO PRI NULL auto_increment
+g multilinestring YES NULL
+SHOW FIELDS FROM gis_multi_polygon;
+Field Type Null Key Default Extra
+fid int(11) NO PRI NULL auto_increment
+g multipolygon YES NULL
+SHOW FIELDS FROM gis_geometrycollection;
+Field Type Null Key Default Extra
+fid int(11) NO PRI NULL auto_increment
+g geometrycollection YES NULL
+SHOW FIELDS FROM gis_geometry;
+Field Type Null Key Default Extra
+fid int(11) NO PRI NULL auto_increment
+g geometry YES NULL
+INSERT INTO gis_point VALUES
+(101, PointFromText('POINT(10 10)')),
+(102, PointFromText('POINT(20 10)')),
+(103, PointFromText('POINT(20 20)')),
+(104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)'))));
+INSERT INTO gis_line VALUES
+(105, LineFromText('LINESTRING(0 0,0 10,10 0)')),
+(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')),
+(107, LineStringFromWKB(LineString(Point(10, 10), Point(40, 10))));
+INSERT INTO gis_polygon VALUES
+(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')),
+(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')),
+(110, PolyFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))));
+INSERT INTO gis_multi_point VALUES
+(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')),
+(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')),
+(113, MPointFromWKB(MultiPoint(Point(3, 6), Point(4, 10))));
+INSERT INTO gis_multi_line VALUES
+(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')),
+(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')),
+(116, MLineFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))));
+INSERT INTO gis_multi_polygon VALUES
+(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
+(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
+(119, MPolyFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))));
+INSERT INTO gis_geometrycollection VALUES
+(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')),
+(121, GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))));
+INSERT into gis_geometry SELECT * FROM gis_point;
+INSERT into gis_geometry SELECT * FROM gis_line;
+INSERT into gis_geometry SELECT * FROM gis_polygon;
+INSERT into gis_geometry SELECT * FROM gis_multi_point;
+INSERT into gis_geometry SELECT * FROM gis_multi_line;
+INSERT into gis_geometry SELECT * FROM gis_multi_polygon;
+INSERT into gis_geometry SELECT * FROM gis_geometrycollection;
+SELECT fid, AsText(g) FROM gis_point ORDER by fid;
+fid AsText(g)
+101 POINT(10 10)
+102 POINT(20 10)
+103 POINT(20 20)
+104 POINT(10 20)
+SELECT fid, AsText(g) FROM gis_line ORDER by fid;
+fid AsText(g)
+105 LINESTRING(0 0,0 10,10 0)
+106 LINESTRING(10 10,20 10,20 20,10 20,10 10)
+107 LINESTRING(10 10,40 10)
+SELECT fid, AsText(g) FROM gis_polygon ORDER by fid;
+fid AsText(g)
+108 POLYGON((10 10,20 10,20 20,10 20,10 10))
+109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10))
+110 POLYGON((0 0,30 0,30 30,0 0))
+SELECT fid, AsText(g) FROM gis_multi_point ORDER by fid;
+fid AsText(g)
+111 MULTIPOINT(0 0,10 10,10 20,20 20)
+112 MULTIPOINT(1 1,11 11,11 21,21 21)
+113 MULTIPOINT(3 6,4 10)
+SELECT fid, AsText(g) FROM gis_multi_line ORDER by fid;
+fid AsText(g)
+114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))
+115 MULTILINESTRING((10 48,10 21,10 0))
+116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7))
+SELECT fid, AsText(g) FROM gis_multi_polygon ORDER by fid;
+fid AsText(g)
+117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+119 MULTIPOLYGON(((0 3,3 3,3 0,0 3)))
+SELECT fid, AsText(g) FROM gis_geometrycollection ORDER by fid;
+fid AsText(g)
+120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10))
+121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9))
+SELECT fid, AsText(g) FROM gis_geometry ORDER by fid;
+fid AsText(g)
+101 POINT(10 10)
+102 POINT(20 10)
+103 POINT(20 20)
+104 POINT(10 20)
+105 LINESTRING(0 0,0 10,10 0)
+106 LINESTRING(10 10,20 10,20 20,10 20,10 10)
+107 LINESTRING(10 10,40 10)
+108 POLYGON((10 10,20 10,20 20,10 20,10 10))
+109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10))
+110 POLYGON((0 0,30 0,30 30,0 0))
+111 MULTIPOINT(0 0,10 10,10 20,20 20)
+112 MULTIPOINT(1 1,11 11,11 21,21 21)
+113 MULTIPOINT(3 6,4 10)
+114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))
+115 MULTILINESTRING((10 48,10 21,10 0))
+116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7))
+117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+119 MULTIPOLYGON(((0 3,3 3,3 0,0 3)))
+120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10))
+121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9))
+SELECT fid, Dimension(g) FROM gis_geometry ORDER by fid;
+fid Dimension(g)
+101 0
+102 0
+103 0
+104 0
+105 1
+106 1
+107 1
+108 2
+109 2
+110 2
+111 0
+112 0
+113 0
+114 1
+115 1
+116 1
+117 2
+118 2
+119 2
+120 1
+121 1
+SELECT fid, GeometryType(g) FROM gis_geometry ORDER by fid;
+fid GeometryType(g)
+101 POINT
+102 POINT
+103 POINT
+104 POINT
+105 LINESTRING
+106 LINESTRING
+107 LINESTRING
+108 POLYGON
+109 POLYGON
+110 POLYGON
+111 MULTIPOINT
+112 MULTIPOINT
+113 MULTIPOINT
+114 MULTILINESTRING
+115 MULTILINESTRING
+116 MULTILINESTRING
+117 MULTIPOLYGON
+118 MULTIPOLYGON
+119 MULTIPOLYGON
+120 GEOMETRYCOLLECTION
+121 GEOMETRYCOLLECTION
+SELECT fid, IsEmpty(g) FROM gis_geometry ORDER by fid;
+fid IsEmpty(g)
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+SELECT fid, AsText(Envelope(g)) FROM gis_geometry ORDER by fid;
+fid AsText(Envelope(g))
+101 POLYGON((10 10,10 10,10 10,10 10,10 10))
+102 POLYGON((20 10,20 10,20 10,20 10,20 10))
+103 POLYGON((20 20,20 20,20 20,20 20,20 20))
+104 POLYGON((10 20,10 20,10 20,10 20,10 20))
+105 POLYGON((0 0,10 0,10 10,0 10,0 0))
+106 POLYGON((10 10,20 10,20 20,10 20,10 10))
+107 POLYGON((10 10,40 10,40 10,10 10,10 10))
+108 POLYGON((10 10,20 10,20 20,10 20,10 10))
+109 POLYGON((0 0,50 0,50 50,0 50,0 0))
+110 POLYGON((0 0,30 0,30 30,0 30,0 0))
+111 POLYGON((0 0,20 0,20 20,0 20,0 0))
+112 POLYGON((1 1,21 1,21 21,1 21,1 1))
+113 POLYGON((3 6,4 6,4 10,3 10,3 6))
+114 POLYGON((10 0,16 0,16 48,10 48,10 0))
+115 POLYGON((10 0,10 0,10 48,10 48,10 0))
+116 POLYGON((1 2,21 2,21 8,1 8,1 2))
+117 POLYGON((28 0,84 0,84 42,28 42,28 0))
+118 POLYGON((28 0,84 0,84 42,28 42,28 0))
+119 POLYGON((0 0,3 0,3 3,0 3,0 0))
+120 POLYGON((0 0,10 0,10 10,0 10,0 0))
+121 POLYGON((3 6,44 6,44 9,3 9,3 6))
+explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelope(g)) from gis_geometry;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE gis_geometry ALL NULL NULL NULL NULL 21 100.00
+Warnings:
+Note 1003 select dimension(`test`.`gis_geometry`.`g`) AS `Dimension(g)`,geometrytype(`test`.`gis_geometry`.`g`) AS `GeometryType(g)`,isempty(`test`.`gis_geometry`.`g`) AS `IsEmpty(g)`,astext(envelope(`test`.`gis_geometry`.`g`)) AS `AsText(Envelope(g))` from `test`.`gis_geometry`
+SELECT fid, X(g) FROM gis_point ORDER by fid;
+fid X(g)
+101 10
+102 20
+103 20
+104 10
+SELECT fid, Y(g) FROM gis_point ORDER by fid;
+fid Y(g)
+101 10
+102 10
+103 20
+104 20
+explain extended select X(g),Y(g) FROM gis_point;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE gis_point ALL NULL NULL NULL NULL 4 100.00
+Warnings:
+Note 1003 select x(`test`.`gis_point`.`g`) AS `X(g)`,y(`test`.`gis_point`.`g`) AS `Y(g)` from `test`.`gis_point`
+SELECT fid, AsText(StartPoint(g)) FROM gis_line ORDER by fid;
+fid AsText(StartPoint(g))
+105 POINT(0 0)
+106 POINT(10 10)
+107 POINT(10 10)
+SELECT fid, AsText(EndPoint(g)) FROM gis_line ORDER by fid;
+fid AsText(EndPoint(g))
+105 POINT(10 0)
+106 POINT(10 10)
+107 POINT(40 10)
+SELECT fid, GLength(g) FROM gis_line ORDER by fid;
+fid GLength(g)
+105 24.142135623731
+106 40
+107 30
+SELECT fid, NumPoints(g) FROM gis_line ORDER by fid;
+fid NumPoints(g)
+105 3
+106 5
+107 2
+SELECT fid, AsText(PointN(g, 2)) FROM gis_line ORDER by fid;
+fid AsText(PointN(g, 2))
+105 POINT(0 10)
+106 POINT(20 10)
+107 POINT(40 10)
+SELECT fid, IsClosed(g) FROM gis_line ORDER by fid;
+fid IsClosed(g)
+105 0
+106 1
+107 0
+explain extended select AsText(StartPoint(g)),AsText(EndPoint(g)),GLength(g),NumPoints(g),AsText(PointN(g, 2)),IsClosed(g) FROM gis_line;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE gis_line ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint(g))`,astext(endpoint(`test`.`gis_line`.`g`)) AS `AsText(EndPoint(g))`,glength(`test`.`gis_line`.`g`) AS `GLength(g)`,numpoints(`test`.`gis_line`.`g`) AS `NumPoints(g)`,astext(pointn(`test`.`gis_line`.`g`,2)) AS `AsText(PointN(g, 2))`,isclosed(`test`.`gis_line`.`g`) AS `IsClosed(g)` from `test`.`gis_line`
+SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid;
+fid AsText(Centroid(g))
+108 POINT(15 15)
+109 POINT(25.416666666667 25.416666666667)
+110 POINT(20 10)
+SELECT fid, Area(g) FROM gis_polygon ORDER by fid;
+fid Area(g)
+108 100
+109 2400
+110 450
+SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon ORDER by fid;
+fid AsText(ExteriorRing(g))
+108 LINESTRING(10 10,20 10,20 20,10 20,10 10)
+109 LINESTRING(0 0,50 0,50 50,0 50,0 0)
+110 LINESTRING(0 0,30 0,30 30,0 0)
+SELECT fid, NumInteriorRings(g) FROM gis_polygon ORDER by fid;
+fid NumInteriorRings(g)
+108 0
+109 1
+110 0
+SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon ORDER by fid;
+fid AsText(InteriorRingN(g, 1))
+108 NULL
+109 LINESTRING(10 10,20 10,20 20,10 20,10 10)
+110 NULL
+explain extended select AsText(Centroid(g)),Area(g),AsText(ExteriorRing(g)),NumInteriorRings(g),AsText(InteriorRingN(g, 1)) FROM gis_polygon;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE gis_polygon ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1003 select astext(centroid(`test`.`gis_polygon`.`g`)) AS `AsText(Centroid(g))`,area(`test`.`gis_polygon`.`g`) AS `Area(g)`,astext(exteriorring(`test`.`gis_polygon`.`g`)) AS `AsText(ExteriorRing(g))`,numinteriorrings(`test`.`gis_polygon`.`g`) AS `NumInteriorRings(g)`,astext(interiorringn(`test`.`gis_polygon`.`g`,1)) AS `AsText(InteriorRingN(g, 1))` from `test`.`gis_polygon`
+SELECT fid, IsClosed(g) FROM gis_multi_line ORDER by fid;
+fid IsClosed(g)
+114 0
+115 0
+116 0
+SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
+fid AsText(Centroid(g))
+117 POINT(55.588527753042 17.426536064114)
+118 POINT(55.588527753042 17.426536064114)
+119 POINT(2 2)
+SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
+fid Area(g)
+117 1684.5
+118 1684.5
+119 4.5
+SELECT fid, NumGeometries(g) from gis_multi_point ORDER by fid;
+fid NumGeometries(g)
+111 4
+112 4
+113 2
+SELECT fid, NumGeometries(g) from gis_multi_line ORDER by fid;
+fid NumGeometries(g)
+114 2
+115 1
+116 2
+SELECT fid, NumGeometries(g) from gis_multi_polygon ORDER by fid;
+fid NumGeometries(g)
+117 2
+118 2
+119 1
+SELECT fid, NumGeometries(g) from gis_geometrycollection ORDER by fid;
+fid NumGeometries(g)
+120 2
+121 2
+explain extended SELECT fid, NumGeometries(g) from gis_multi_point;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1003 select `test`.`gis_multi_point`.`fid` AS `fid`,numgeometries(`test`.`gis_multi_point`.`g`) AS `NumGeometries(g)` from `test`.`gis_multi_point`
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point ORDER by fid;
+fid AsText(GeometryN(g, 2))
+111 POINT(10 10)
+112 POINT(11 11)
+113 POINT(4 10)
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line ORDER by fid;
+fid AsText(GeometryN(g, 2))
+114 LINESTRING(16 0,16 23,16 48)
+115 NULL
+116 LINESTRING(2 5,5 8,21 7)
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon ORDER by fid;
+fid AsText(GeometryN(g, 2))
+117 POLYGON((59 18,67 18,67 13,59 13,59 18))
+118 POLYGON((59 18,67 18,67 13,59 13,59 18))
+119 NULL
+SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection ORDER by fid;
+fid AsText(GeometryN(g, 2))
+120 LINESTRING(0 0,10 10)
+121 LINESTRING(3 6,7 9)
+SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection ORDER by fid;
+fid AsText(GeometryN(g, 1))
+120 POINT(0 0)
+121 POINT(44 6)
+explain extended SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1003 select `test`.`gis_multi_point`.`fid` AS `fid`,astext(geometryn(`test`.`gis_multi_point`.`g`,2)) AS `AsText(GeometryN(g, 2))` from `test`.`gis_multi_point`
+SELECT g1.fid as first, g2.fid as second,
+Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
+Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
+Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
+FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
+first second w c o e d t i r
+120 120 1 1 0 1 0 0 1 0
+120 121 0 0 1 0 0 0 1 0
+121 120 0 0 1 0 0 0 1 0
+121 121 1 1 0 1 0 0 1 0
+explain extended SELECT g1.fid as first, g2.fid as second,
+Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
+Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
+Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
+FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE g1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort
+1 SIMPLE g2 ALL NULL NULL NULL NULL 2 100.00 Using join buffer
+Warnings:
+Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,overlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,equals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,disjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,intersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid`
+DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
+CREATE TABLE t1 (
+a INTEGER PRIMARY KEY AUTO_INCREMENT,
+gp point,
+ln linestring,
+pg polygon,
+mp multipoint,
+mln multilinestring,
+mpg multipolygon,
+gc geometrycollection,
+gm geometry
+);
+SHOW FIELDS FROM t1;
+Field Type Null Key Default Extra
+a int(11) NO PRI NULL auto_increment
+gp point YES NULL
+ln linestring YES NULL
+pg polygon YES NULL
+mp multipoint YES NULL
+mln multilinestring YES NULL
+mpg multipolygon YES NULL
+gc geometrycollection YES NULL
+gm geometry YES NULL
+ALTER TABLE t1 ADD fid INT;
+SHOW FIELDS FROM t1;
+Field Type Null Key Default Extra
+a int(11) NO PRI NULL auto_increment
+gp point YES NULL
+ln linestring YES NULL
+pg polygon YES NULL
+mp multipoint YES NULL
+mln multilinestring YES NULL
+mpg multipolygon YES NULL
+gc geometrycollection YES NULL
+gm geometry YES NULL
+fid int(11) YES NULL
+DROP TABLE t1;
+create table t1 (pk integer primary key auto_increment, a geometry not null);
+insert into t1 (a) values (GeomFromText('Point(1 2)'));
+insert into t1 (a) values ('Garbage');
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert IGNORE into t1 (a) values ('Garbage');
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+drop table t1;
+create table t1 (pk integer primary key auto_increment, fl geometry not null);
+insert into t1 (fl) values (1);
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert into t1 (fl) values (1.11);
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert into t1 (fl) values ("qwerty");
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert into t1 (fl) values (pointfromtext('point(1,1)'));
+ERROR 23000: Column 'fl' cannot be null
+drop table t1;
+End of 4.1 tests
+CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY);
+Warnings:
+Error 1477 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))'));
+INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))'));
+INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))'));
+INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))'));
+INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))'));
+INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))'));
+INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))'));
+INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))'));
+INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))'));
+INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))'));
+INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))'));
+INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))'));
+INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))'));
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+mbrcontains
+center,small
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrdisjoint FROM t1 a1 JOIN t1 a2 ON MBRDisjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+mbrdisjoint
+down3,left3,right3,up3
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrequal FROM t1 a1 JOIN t1 a2 ON MBREqual( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+mbrequal
+center
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrintersect FROM t1 a1 JOIN t1 a2 ON MBRIntersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+mbrintersect
+big,center,down,down2,left,left2,right,right2,small,up,up2
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbroverlaps FROM t1 a1 JOIN t1 a2 ON MBROverlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+mbroverlaps
+down,left,right,up
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+mbrtouches
+down2,left2,right2,up2
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+mbrwithin
+big,center
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains FROM t1 a1 JOIN t1 a2 ON Contains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+contains
+center,small
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint FROM t1 a1 JOIN t1 a2 ON Disjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+disjoint
+down3,left3,right3,up3
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS equals FROM t1 a1 JOIN t1 a2 ON Equals( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+equals
+center
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersect FROM t1 a1 JOIN t1 a2 ON Intersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+intersect
+big,center,down,down2,left,left2,right,right2,small,up,up2
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS overlaps FROM t1 a1 JOIN t1 a2 ON Overlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+overlaps
+down,left,right,up
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+touches
+down2,left2,right2,up2
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+within
+big,center
+SET @vert1 = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))');
+SET @horiz1 = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))');
+SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))');
+SET @horiz3 = GeomFromText('POLYGON ((2 0, 3 0, 2 0))');
+SET @point1 = GeomFromText('POLYGON ((0 0))');
+SET @point2 = GeomFromText('POLYGON ((-2 0))');
+SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @vert1) GROUP BY a1.name;
+overlaps
+SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @horiz1) GROUP BY a1.name;
+overlaps
+SELECT Overlaps(@horiz1, @vert1) FROM DUAL;
+Overlaps(@horiz1, @vert1)
+0
+SELECT Overlaps(@horiz1, @horiz2) FROM DUAL;
+Overlaps(@horiz1, @horiz2)
+1
+SELECT Overlaps(@horiz1, @horiz3) FROM DUAL;
+Overlaps(@horiz1, @horiz3)
+0
+SELECT Overlaps(@horiz1, @point1) FROM DUAL;
+Overlaps(@horiz1, @point1)
+0
+SELECT Overlaps(@horiz1, @point2) FROM DUAL;
+Overlaps(@horiz1, @point2)
+0
+DROP TABLE t1;
+End of 5.0 tests
diff --git a/mysql-test/r/ndb_grant.result b/mysql-test/suite/ndb/r/ndb_grant.result
index 6192a7cace5..6192a7cace5 100644
--- a/mysql-test/r/ndb_grant.result
+++ b/mysql-test/suite/ndb/r/ndb_grant.result
diff --git a/mysql-test/r/ndb_index.result b/mysql-test/suite/ndb/r/ndb_index.result
index 5702552b0b5..5702552b0b5 100644
--- a/mysql-test/r/ndb_index.result
+++ b/mysql-test/suite/ndb/r/ndb_index.result
diff --git a/mysql-test/r/ndb_index_ordered.result b/mysql-test/suite/ndb/r/ndb_index_ordered.result
index a29b5343d7c..a29b5343d7c 100644
--- a/mysql-test/r/ndb_index_ordered.result
+++ b/mysql-test/suite/ndb/r/ndb_index_ordered.result
diff --git a/mysql-test/r/ndb_index_unique.result b/mysql-test/suite/ndb/r/ndb_index_unique.result
index cc63ce69760..cc63ce69760 100644
--- a/mysql-test/r/ndb_index_unique.result
+++ b/mysql-test/suite/ndb/r/ndb_index_unique.result
diff --git a/mysql-test/suite/ndb/r/ndb_insert.result b/mysql-test/suite/ndb/r/ndb_insert.result
new file mode 100644
index 00000000000..51b346bbf7b
--- /dev/null
+++ b/mysql-test/suite/ndb/r/ndb_insert.result
@@ -0,0 +1,828 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+pk1 INT NOT NULL PRIMARY KEY,
+b INT NOT NULL,
+c INT NOT NULL
+) ENGINE=ndbcluster;
+INSERT INTO t1 VALUES (0, 0, 0);
+SELECT * FROM t1;
+pk1 b c
+0 0 0
+INSERT INTO t1 VALUES
+(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
+(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10),
+(11,11,11),(12,12,12),(13,13,13),(14,14,14),(15,15,15),
+(16,16,16),(17,17,17),(18,18,18),(19,19,19),(20,20,20),
+(21,21,21),(22,22,22),(23,23,23),(24,24,24),(25,25,25),
+(26,26,26),(27,27,27),(28,28,28),(29,29,29),(30,30,30),
+(31,31,31),(32,32,32),(33,33,33),(34,34,34),(35,35,35),
+(36,36,36),(37,37,37),(38,38,38),(39,39,39),(40,40,40),
+(41,41,41),(42,42,42),(43,43,43),(44,44,44),(45,45,45),
+(46,46,46),(47,47,47),(48,48,48),(49,49,49),(50,50,50),
+(51,51,51),(52,52,52),(53,53,53),(54,54,54),(55,55,55),
+(56,56,56),(57,57,57),(58,58,58),(59,59,59),(60,60,60),
+(61,61,61),(62,62,62),(63,63,63),(64,64,64),(65,65,65),
+(66,66,66),(67,67,67),(68,68,68),(69,69,69),(70,70,70),
+(71,71,71),(72,72,72),(73,73,73),(74,74,74),(75,75,75),
+(76,76,76),(77,77,77),(78,78,78),(79,79,79),(80,80,80),
+(81,81,81),(82,82,82),(83,83,83),(84,84,84),(85,85,85),
+(86,86,86),(87,87,87),(88,88,88),(89,89,89),(90,90,90),
+(91,91,91),(92,92,92),(93,93,93),(94,94,94),(95,95,95),
+(96,96,96),(97,97,97),(98,98,98),(99,99,99),(100,100,100),
+(101,101,101),(102,102,102),(103,103,103),(104,104,104),(105,105,105),
+(106,106,106),(107,107,107),(108,108,108),(109,109,109),(110,110,110),
+(111,111,111),(112,112,112),(113,113,113),(114,114,114),(115,115,115),
+(116,116,116),(117,117,117),(118,118,118),(119,119,119),(120,120,120),
+(121,121,121),(122,122,122),(123,123,123),(124,124,124),(125,125,125),
+(126,126,126),(127,127,127),(128,128,128),(129,129,129),(130,130,130),
+(131,131,131),(132,132,132),(133,133,133),(134,134,134),(135,135,135),
+(136,136,136),(137,137,137),(138,138,138),(139,139,139),(140,140,140),
+(141,141,141),(142,142,142),(143,143,143),(144,144,144),(145,145,145),
+(146,146,146),(147,147,147),(148,148,148),(149,149,149),(150,150,150),
+(151,151,151),(152,152,152),(153,153,153),(154,154,154),(155,155,155),
+(156,156,156),(157,157,157),(158,158,158),(159,159,159),(160,160,160),
+(161,161,161),(162,162,162),(163,163,163),(164,164,164),(165,165,165),
+(166,166,166),(167,167,167),(168,168,168),(169,169,169),(170,170,170),
+(171,171,171),(172,172,172),(173,173,173),(174,174,174),(175,175,175),
+(176,176,176),(177,177,177),(178,178,178),(179,179,179),(180,180,180),
+(181,181,181),(182,182,182),(183,183,183),(184,184,184),(185,185,185),
+(186,186,186),(187,187,187),(188,188,188),(189,189,189),(190,190,190),
+(191,191,191),(192,192,192),(193,193,193),(194,194,194),(195,195,195),
+(196,196,196),(197,197,197),(198,198,198),(199,199,199),(200,200,200),
+(201,201,201),(202,202,202),(203,203,203),(204,204,204),(205,205,205),
+(206,206,206),(207,207,207),(208,208,208),(209,209,209),(210,210,210),
+(211,211,211),(212,212,212),(213,213,213),(214,214,214),(215,215,215),
+(216,216,216),(217,217,217),(218,218,218),(219,219,219),(220,220,220),
+(221,221,221),(222,222,222),(223,223,223),(224,224,224),(225,225,225),
+(226,226,226),(227,227,227),(228,228,228),(229,229,229),(230,230,230),
+(231,231,231),(232,232,232),(233,233,233),(234,234,234),(235,235,235),
+(236,236,236),(237,237,237),(238,238,238),(239,239,239),(240,240,240),
+(241,241,241),(242,242,242),(243,243,243),(244,244,244),(245,245,245),
+(246,246,246),(247,247,247),(248,248,248),(249,249,249),(250,250,250),
+(251,251,251),(252,252,252),(253,253,253),(254,254,254),(255,255,255),
+(256,256,256),(257,257,257),(258,258,258),(259,259,259),(260,260,260),
+(261,261,261),(262,262,262),(263,263,263),(264,264,264),(265,265,265),
+(266,266,266),(267,267,267),(268,268,268),(269,269,269),(270,270,270),
+(271,271,271),(272,272,272),(273,273,273),(274,274,274),(275,275,275),
+(276,276,276),(277,277,277),(278,278,278),(279,279,279),(280,280,280),
+(281,281,281),(282,282,282),(283,283,283),(284,284,284),(285,285,285),
+(286,286,286),(287,287,287),(288,288,288),(289,289,289),(290,290,290),
+(291,291,291),(292,292,292),(293,293,293),(294,294,294),(295,295,295),
+(296,296,296),(297,297,297),(298,298,298),(299,299,299),(300,300,300),
+(301,301,301),(302,302,302),(303,303,303),(304,304,304),(305,305,305),
+(306,306,306),(307,307,307),(308,308,308),(309,309,309),(310,310,310),
+(311,311,311),(312,312,312),(313,313,313),(314,314,314),(315,315,315),
+(316,316,316),(317,317,317),(318,318,318),(319,319,319),(320,320,320),
+(321,321,321),(322,322,322),(323,323,323),(324,324,324),(325,325,325),
+(326,326,326),(327,327,327),(328,328,328),(329,329,329),(330,330,330),
+(331,331,331),(332,332,332),(333,333,333),(334,334,334),(335,335,335),
+(336,336,336),(337,337,337),(338,338,338),(339,339,339),(340,340,340),
+(341,341,341),(342,342,342),(343,343,343),(344,344,344),(345,345,345),
+(346,346,346),(347,347,347),(348,348,348),(349,349,349),(350,350,350),
+(351,351,351),(352,352,352),(353,353,353),(354,354,354),(355,355,355),
+(356,356,356),(357,357,357),(358,358,358),(359,359,359),(360,360,360),
+(361,361,361),(362,362,362),(363,363,363),(364,364,364),(365,365,365),
+(366,366,366),(367,367,367),(368,368,368),(369,369,369),(370,370,370),
+(371,371,371),(372,372,372),(373,373,373),(374,374,374),(375,375,375),
+(376,376,376),(377,377,377),(378,378,378),(379,379,379),(380,380,380),
+(381,381,381),(382,382,382),(383,383,383),(384,384,384),(385,385,385),
+(386,386,386),(387,387,387),(388,388,388),(389,389,389),(390,390,390),
+(391,391,391),(392,392,392),(393,393,393),(394,394,394),(395,395,395),
+(396,396,396),(397,397,397),(398,398,398),(399,399,399),(400,400,400),
+(401,401,401),(402,402,402),(403,403,403),(404,404,404),(405,405,405),
+(406,406,406),(407,407,407),(408,408,408),(409,409,409),(410,410,410),
+(411,411,411),(412,412,412),(413,413,413),(414,414,414),(415,415,415),
+(416,416,416),(417,417,417),(418,418,418),(419,419,419),(420,420,420),
+(421,421,421),(422,422,422),(423,423,423),(424,424,424),(425,425,425),
+(426,426,426),(427,427,427),(428,428,428),(429,429,429),(430,430,430),
+(431,431,431),(432,432,432),(433,433,433),(434,434,434),(435,435,435),
+(436,436,436),(437,437,437),(438,438,438),(439,439,439),(440,440,440),
+(441,441,441),(442,442,442),(443,443,443),(444,444,444),(445,445,445),
+(446,446,446),(447,447,447),(448,448,448),(449,449,449),(450,450,450),
+(451,451,451),(452,452,452),(453,453,453),(454,454,454),(455,455,455),
+(456,456,456),(457,457,457),(458,458,458),(459,459,459),(460,460,460),
+(461,461,461),(462,462,462),(463,463,463),(464,464,464),(465,465,465),
+(466,466,466),(467,467,467),(468,468,468),(469,469,469),(470,470,470),
+(471,471,471),(472,472,472),(473,473,473),(474,474,474),(475,475,475),
+(476,476,476),(477,477,477),(478,478,478),(479,479,479),(480,480,480),
+(481,481,481),(482,482,482),(483,483,483),(484,484,484),(485,485,485),
+(486,486,486),(487,487,487),(488,488,488),(489,489,489),(490,490,490),
+(491,491,491),(492,492,492),(493,493,493),(494,494,494),(495,495,495),
+(496,496,496),(497,497,497),(498,498,498),(499,499,499),(500, 500, 500);
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+501
+INSERT INTO t1 VALUES
+(501,501,501),(502,502,502),(503,503,503),(504,504,504),(505,505,505),
+(506,506,506),(507,507,507),(508,508,508),(509,509,509),(510,510,510),
+(511,511,511),(512,512,512),(513,513,513),(514,514,514),(515,515,515),
+(516,516,516),(517,517,517),(518,518,518),(519,519,519),(520,520,520),
+(521,521,521),(522,522,522),(523,523,523),(524,524,524),(525,525,525),
+(526,526,526),(527,527,527),(528,528,528),(529,529,529),(530,530,530),
+(531,531,531),(532,532,532),(533,533,533),(534,534,534),(535,535,535),
+(536,536,536),(537,537,537),(538,538,538),(539,539,539),(540,540,540),
+(541,541,541),(542,542,542),(543,543,543),(544,544,544),(545,545,545),
+(546,546,546),(547,547,547),(548,548,548),(549,549,549),(550,550,550),
+(551,551,551),(552,552,552),(553,553,553),(554,554,554),(555,555,555),
+(556,556,556),(557,557,557),(558,558,558),(559,559,559),(560,560,560),
+(561,561,561),(562,562,562),(563,563,563),(564,564,564),(565,565,565),
+(566,566,566),(567,567,567),(568,568,568),(569,569,569),(570,570,570),
+(571,571,571),(572,572,572),(573,573,573),(574,574,574),(575,575,575),
+(576,576,576),(577,577,577),(578,578,578),(579,579,579),(580,580,580),
+(581,581,581),(582,582,582),(583,583,583),(584,584,584),(585,585,585),
+(586,586,586),(587,587,587),(588,588,588),(589,589,589),(590,590,590),
+(591,591,591),(592,592,592),(593,593,593),(594,594,594),(595,595,595),
+(596,596,596),(597,597,597),(598,598,598),(599,599,599),(600,600,600),
+(601,601,601),(602,602,602),(603,603,603),(604,604,604),(605,605,605),
+(606,606,606),(607,607,607),(608,608,608),(609,609,609),(610,610,610),
+(611,611,611),(612,612,612),(613,613,613),(614,614,614),(615,615,615),
+(616,616,616),(617,617,617),(618,618,618),(619,619,619),(620,620,620),
+(621,621,621),(622,622,622),(623,623,623),(624,624,624),(625,625,625),
+(626,626,626),(627,627,627),(628,628,628),(629,629,629),(630,630,630),
+(631,631,631),(632,632,632),(633,633,633),(634,634,634),(635,635,635),
+(636,636,636),(637,637,637),(638,638,638),(639,639,639),(640,640,640),
+(641,641,641),(642,642,642),(643,643,643),(644,644,644),(645,645,645),
+(646,646,646),(647,647,647),(648,648,648),(649,649,649),(650,650,650),
+(651,651,651),(652,652,652),(653,653,653),(654,654,654),(655,655,655),
+(656,656,656),(657,657,657),(658,658,658),(659,659,659),(660,660,660),
+(661,661,661),(662,662,662),(663,663,663),(664,664,664),(665,665,665),
+(666,666,666),(667,667,667),(668,668,668),(669,669,669),(670,670,670),
+(671,671,671),(672,672,672),(673,673,673),(674,674,674),(675,675,675),
+(676,676,676),(677,677,677),(678,678,678),(679,679,679),(680,680,680),
+(681,681,681),(682,682,682),(683,683,683),(684,684,684),(685,685,685),
+(686,686,686),(687,687,687),(688,688,688),(689,689,689),(690,690,690),
+(691,691,691),(692,692,692),(693,693,693),(694,694,694),(695,695,695),
+(696,696,696),(697,697,697),(698,698,698),(699,699,699),(700,700,700),
+(701,701,701),(702,702,702),(703,703,703),(704,704,704),(705,705,705),
+(706,706,706),(707,707,707),(708,708,708),(709,709,709),(710,710,710),
+(711,711,711),(712,712,712),(713,713,713),(714,714,714),(715,715,715),
+(716,716,716),(717,717,717),(718,718,718),(719,719,719),(720,720,720),
+(721,721,721),(722,722,722),(723,723,723),(724,724,724),(725,725,725),
+(726,726,726),(727,727,727),(728,728,728),(729,729,729),(730,730,730),
+(731,731,731),(732,732,732),(733,733,733),(734,734,734),(735,735,735),
+(736,736,736),(737,737,737),(738,738,738),(739,739,739),(740,740,740),
+(741,741,741),(742,742,742),(743,743,743),(744,744,744),(745,745,745),
+(746,746,746),(747,747,747),(748,748,748),(749,749,749),(750,750,750),
+(751,751,751),(752,752,752),(753,753,753),(754,754,754),(755,755,755),
+(756,756,756),(757,757,757),(758,758,758),(759,759,759),(760,760,760),
+(761,761,761),(762,762,762),(763,763,763),(764,764,764),(765,765,765),
+(766,766,766),(767,767,767),(768,768,768),(769,769,769),(770,770,770),
+(771,771,771),(772,772,772),(773,773,773),(774,774,774),(775,775,775),
+(776,776,776),(777,777,777),(778,778,778),(779,779,779),(780,780,780),
+(781,781,781),(782,782,782),(783,783,783),(784,784,784),(785,785,785),
+(786,786,786),(787,787,787),(788,788,788),(789,789,789),(790,790,790),
+(791,791,791),(792,792,792),(793,793,793),(794,794,794),(795,795,795),
+(796,796,796),(797,797,797),(798,798,798),(799,799,799),(800,800,800),
+(801,801,801),(802,802,802),(803,803,803),(804,804,804),(805,805,805),
+(806,806,806),(807,807,807),(808,808,808),(809,809,809),(810,810,810),
+(811,811,811),(812,812,812),(813,813,813),(814,814,814),(815,815,815),
+(816,816,816),(817,817,817),(818,818,818),(819,819,819),(820,820,820),
+(821,821,821),(822,822,822),(823,823,823),(824,824,824),(825,825,825),
+(826,826,826),(827,827,827),(828,828,828),(829,829,829),(830,830,830),
+(831,831,831),(832,832,832),(833,833,833),(834,834,834),(835,835,835),
+(836,836,836),(837,837,837),(838,838,838),(839,839,839),(840,840,840),
+(841,841,841),(842,842,842),(843,843,843),(844,844,844),(845,845,845),
+(846,846,846),(847,847,847),(848,848,848),(849,849,849),(850,850,850),
+(851,851,851),(852,852,852),(853,853,853),(854,854,854),(855,855,855),
+(856,856,856),(857,857,857),(858,858,858),(859,859,859),(860,860,860),
+(861,861,861),(862,862,862),(863,863,863),(864,864,864),(865,865,865),
+(866,866,866),(867,867,867),(868,868,868),(869,869,869),(870,870,870),
+(871,871,871),(872,872,872),(873,873,873),(874,874,874),(875,875,875),
+(876,876,876),(877,877,877),(878,878,878),(879,879,879),(880,880,880),
+(881,881,881),(882,882,882),(883,883,883),(884,884,884),(885,885,885),
+(886,886,886),(887,887,887),(888,888,888),(889,889,889),(890,890,890),
+(891,891,891),(892,892,892),(893,893,893),(894,894,894),(895,895,895),
+(896,896,896),(897,897,897),(898,898,898),(899,899,899),(900,900,900),
+(901,901,901),(902,902,902),(903,903,903),(904,904,904),(905,905,905),
+(906,906,906),(907,907,907),(908,908,908),(909,909,909),(910,910,910),
+(911,911,911),(912,912,912),(913,913,913),(914,914,914),(915,915,915),
+(916,916,916),(917,917,917),(918,918,918),(919,919,919),(920,920,920),
+(921,921,921),(922,922,922),(923,923,923),(924,924,924),(925,925,925),
+(926,926,926),(927,927,927),(928,928,928),(929,929,929),(930,930,930),
+(931,931,931),(932,932,932),(933,933,933),(934,934,934),(935,935,935),
+(936,936,936),(937,937,937),(938,938,938),(939,939,939),(940,940,940),
+(941,941,941),(942,942,942),(943,943,943),(944,944,944),(945,945,945),
+(946,946,946),(947,947,947),(948,948,948),(949,949,949),(950,950,950),
+(951,951,951),(952,952,952),(953,953,953),(954,954,954),(955,955,955),
+(956,956,956),(957,957,957),(958,958,958),(959,959,959),(960,960,960),
+(961,961,961),(962,962,962),(963,963,963),(964,964,964),(965,965,965),
+(966,966,966),(967,967,967),(968,968,968),(969,969,969),(970,970,970),
+(971,971,971),(972,972,972),(973,973,973),(974,974,974),(975,975,975),
+(976,976,976),(977,977,977),(978,978,978),(979,979,979),(980,980,980),
+(981,981,981),(982,982,982),(983,983,983),(984,984,984),(985,985,985),
+(986,986,986),(987,987,987),(988,988,988),(989,989,989),(990,990,990),
+(991,991,991),(992,992,992),(993,993,993),(994,994,994),(995,995,995),
+(996,996,996),(997,997,997),(998,998,998),(999,999,999),(1000,1000,1000),
+(1001,1001,1001),(1002,1002,1002),(1003,1003,1003),(1004,1004,1004),(1005,1005,1005),
+(1006,1006,1006),(1007,1007,1007),(1008,1008,1008),(1009,1009,1009),(1010,1010,1010),
+(1011,1011,1011),(1012,1012,1012),(1013,1013,1013),(1014,1014,1014),(1015,1015,1015),
+(1016,1016,1016),(1017,1017,1017),(1018,1018,1018),(1019,1019,1019),(1020,1020,1020),
+(1021,1021,1021),(1022,1022,1022),(1023,1023,1023),(1024,1024,1024),(1025,1025,1025),
+(1026,1026,1026),(1027,1027,1027),(1028,1028,1028),(1029,1029,1029),(1030,1030,1030),
+(1031,1031,1031),(1032,1032,1032),(1033,1033,1033),(1034,1034,1034),(1035,1035,1035),
+(1036,1036,1036),(1037,1037,1037),(1038,1038,1038),(1039,1039,1039),(1040,1040,1040),
+(1041,1041,1041),(1042,1042,1042),(1043,1043,1043),(1044,1044,1044),(1045,1045,1045),
+(1046,1046,1046),(1047,1047,1047),(1048,1048,1048),(1049,1049,1049),(1050,1050,1050),
+(1051,1051,1051),(1052,1052,1052),(1053,1053,1053),(1054,1054,1054),(1055,1055,1055),
+(1056,1056,1056),(1057,1057,1057),(1058,1058,1058),(1059,1059,1059),(1060,1060,1060),
+(1061,1061,1061),(1062,1062,1062),(1063,1063,1063),(1064,1064,1064),(1065,1065,1065),
+(1066,1066,1066),(1067,1067,1067),(1068,1068,1068),(1069,1069,1069),(1070,1070,1070),
+(1071,1071,1071),(1072,1072,1072),(1073,1073,1073),(1074,1074,1074),(1075,1075,1075),
+(1076,1076,1076),(1077,1077,1077),(1078,1078,1078),(1079,1079,1079),(1080,1080,1080),
+(1081,1081,1081),(1082,1082,1082),(1083,1083,1083),(1084,1084,1084),(1085,1085,1085),
+(1086,1086,1086),(1087,1087,1087),(1088,1088,1088),(1089,1089,1089),(1090,1090,1090),
+(1091,1091,1091),(1092,1092,1092),(1093,1093,1093),(1094,1094,1094),(1095,1095,1095),
+(1096,1096,1096),(1097,1097,1097),(1098,1098,1098),(1099,1099,1099),(1100,1100,1100),
+(1101,1101,1101),(1102,1102,1102),(1103,1103,1103),(1104,1104,1104),(1105,1105,1105),
+(1106,1106,1106),(1107,1107,1107),(1108,1108,1108),(1109,1109,1109),(1110,1110,1110),
+(1111,1111,1111),(1112,1112,1112),(1113,1113,1113),(1114,1114,1114),(1115,1115,1115),
+(1116,1116,1116),(1117,1117,1117),(1118,1118,1118),(1119,1119,1119),(1120,1120,1120),
+(1121,1121,1121),(1122,1122,1122),(1123,1123,1123),(1124,1124,1124),(1125,1125,1125),
+(1126,1126,1126),(1127,1127,1127),(1128,1128,1128),(1129,1129,1129),(1130,1130,1130),
+(1131,1131,1131),(1132,1132,1132),(1133,1133,1133),(1134,1134,1134),(1135,1135,1135),
+(1136,1136,1136),(1137,1137,1137),(1138,1138,1138),(1139,1139,1139),(1140,1140,1140),
+(1141,1141,1141),(1142,1142,1142),(1143,1143,1143),(1144,1144,1144),(1145,1145,1145),
+(1146,1146,1146),(1147,1147,1147),(1148,1148,1148),(1149,1149,1149),(1150,1150,1150),
+(1151,1151,1151),(1152,1152,1152),(1153,1153,1153),(1154,1154,1154),(1155,1155,1155),
+(1156,1156,1156),(1157,1157,1157),(1158,1158,1158),(1159,1159,1159),(1160,1160,1160),
+(1161,1161,1161),(1162,1162,1162),(1163,1163,1163),(1164,1164,1164),(1165,1165,1165),
+(1166,1166,1166),(1167,1167,1167),(1168,1168,1168),(1169,1169,1169),(1170,1170,1170),
+(1171,1171,1171),(1172,1172,1172),(1173,1173,1173),(1174,1174,1174),(1175,1175,1175),
+(1176,1176,1176),(1177,1177,1177),(1178,1178,1178),(1179,1179,1179),(1180,1180,1180),
+(1181,1181,1181),(1182,1182,1182),(1183,1183,1183),(1184,1184,1184),(1185,1185,1185),
+(1186,1186,1186),(1187,1187,1187),(1188,1188,1188),(1189,1189,1189),(1190,1190,1190),
+(1191,1191,1191),(1192,1192,1192),(1193,1193,1193),(1194,1194,1194),(1195,1195,1195),
+(1196,1196,1196),(1197,1197,1197),(1198,1198,1198),(1199,1199,1199),(1200,1200,1200),
+(1201,1201,1201),(1202,1202,1202),(1203,1203,1203),(1204,1204,1204),(1205,1205,1205),
+(1206,1206,1206),(1207,1207,1207),(1208,1208,1208),(1209,1209,1209),(1210,1210,1210),
+(1211,1211,1211),(1212,1212,1212),(1213,1213,1213),(1214,1214,1214),(1215,1215,1215),
+(1216,1216,1216),(1217,1217,1217),(1218,1218,1218),(1219,1219,1219),(1220,1220,1220),
+(1221,1221,1221),(1222,1222,1222),(1223,1223,1223),(1224,1224,1224),(1225,1225,1225),
+(1226,1226,1226),(1227,1227,1227),(1228,1228,1228),(1229,1229,1229),(1230,1230,1230),
+(1231,1231,1231),(1232,1232,1232),(1233,1233,1233),(1234,1234,1234),(1235,1235,1235),
+(1236,1236,1236),(1237,1237,1237),(1238,1238,1238),(1239,1239,1239),(1240,1240,1240),
+(1241,1241,1241),(1242,1242,1242),(1243,1243,1243),(1244,1244,1244),(1245,1245,1245),
+(1246,1246,1246),(1247,1247,1247),(1248,1248,1248),(1249,1249,1249),(1250,1250,1250),
+(1251,1251,1251),(1252,1252,1252),(1253,1253,1253),(1254,1254,1254),(1255,1255,1255),
+(1256,1256,1256),(1257,1257,1257),(1258,1258,1258),(1259,1259,1259),(1260,1260,1260),
+(1261,1261,1261),(1262,1262,1262),(1263,1263,1263),(1264,1264,1264),(1265,1265,1265),
+(1266,1266,1266),(1267,1267,1267),(1268,1268,1268),(1269,1269,1269),(1270,1270,1270),
+(1271,1271,1271),(1272,1272,1272),(1273,1273,1273),(1274,1274,1274),(1275,1275,1275),
+(1276,1276,1276),(1277,1277,1277),(1278,1278,1278),(1279,1279,1279),(1280,1280,1280),
+(1281,1281,1281),(1282,1282,1282),(1283,1283,1283),(1284,1284,1284),(1285,1285,1285),
+(1286,1286,1286),(1287,1287,1287),(1288,1288,1288),(1289,1289,1289),(1290,1290,1290),
+(1291,1291,1291),(1292,1292,1292),(1293,1293,1293),(1294,1294,1294),(1295,1295,1295),
+(1296,1296,1296),(1297,1297,1297),(1298,1298,1298),(1299,1299,1299),(1300,1300,1300),
+(1301,1301,1301),(1302,1302,1302),(1303,1303,1303),(1304,1304,1304),(1305,1305,1305),
+(1306,1306,1306),(1307,1307,1307),(1308,1308,1308),(1309,1309,1309),(1310,1310,1310),
+(1311,1311,1311),(1312,1312,1312),(1313,1313,1313),(1314,1314,1314),(1315,1315,1315),
+(1316,1316,1316),(1317,1317,1317),(1318,1318,1318),(1319,1319,1319),(1320,1320,1320),
+(1321,1321,1321),(1322,1322,1322),(1323,1323,1323),(1324,1324,1324),(1325,1325,1325),
+(1326,1326,1326),(1327,1327,1327),(1328,1328,1328),(1329,1329,1329),(1330,1330,1330),
+(1331,1331,1331),(1332,1332,1332),(1333,1333,1333),(1334,1334,1334),(1335,1335,1335),
+(1336,1336,1336),(1337,1337,1337),(1338,1338,1338),(1339,1339,1339),(1340,1340,1340),
+(1341,1341,1341),(1342,1342,1342),(1343,1343,1343),(1344,1344,1344),(1345,1345,1345),
+(1346,1346,1346),(1347,1347,1347),(1348,1348,1348),(1349,1349,1349),(1350,1350,1350),
+(1351,1351,1351),(1352,1352,1352),(1353,1353,1353),(1354,1354,1354),(1355,1355,1355),
+(1356,1356,1356),(1357,1357,1357),(1358,1358,1358),(1359,1359,1359),(1360,1360,1360),
+(1361,1361,1361),(1362,1362,1362),(1363,1363,1363),(1364,1364,1364),(1365,1365,1365),
+(1366,1366,1366),(1367,1367,1367),(1368,1368,1368),(1369,1369,1369),(1370,1370,1370),
+(1371,1371,1371),(1372,1372,1372),(1373,1373,1373),(1374,1374,1374),(1375,1375,1375),
+(1376,1376,1376),(1377,1377,1377),(1378,1378,1378),(1379,1379,1379),(1380,1380,1380),
+(1381,1381,1381),(1382,1382,1382),(1383,1383,1383),(1384,1384,1384),(1385,1385,1385),
+(1386,1386,1386),(1387,1387,1387),(1388,1388,1388),(1389,1389,1389),(1390,1390,1390),
+(1391,1391,1391),(1392,1392,1392),(1393,1393,1393),(1394,1394,1394),(1395,1395,1395),
+(1396,1396,1396),(1397,1397,1397),(1398,1398,1398),(1399,1399,1399),(1400,1400,1400),
+(1401,1401,1401),(1402,1402,1402),(1403,1403,1403),(1404,1404,1404),(1405,1405,1405),
+(1406,1406,1406),(1407,1407,1407),(1408,1408,1408),(1409,1409,1409),(1410,1410,1410),
+(1411,1411,1411),(1412,1412,1412),(1413,1413,1413),(1414,1414,1414),(1415,1415,1415),
+(1416,1416,1416),(1417,1417,1417),(1418,1418,1418),(1419,1419,1419),(1420,1420,1420),
+(1421,1421,1421),(1422,1422,1422),(1423,1423,1423),(1424,1424,1424),(1425,1425,1425),
+(1426,1426,1426),(1427,1427,1427),(1428,1428,1428),(1429,1429,1429),(1430,1430,1430),
+(1431,1431,1431),(1432,1432,1432),(1433,1433,1433),(1434,1434,1434),(1435,1435,1435),
+(1436,1436,1436),(1437,1437,1437),(1438,1438,1438),(1439,1439,1439),(1440,1440,1440),
+(1441,1441,1441),(1442,1442,1442),(1443,1443,1443),(1444,1444,1444),(1445,1445,1445),
+(1446,1446,1446),(1447,1447,1447),(1448,1448,1448),(1449,1449,1449),(1450,1450,1450),
+(1451,1451,1451),(1452,1452,1452),(1453,1453,1453),(1454,1454,1454),(1455,1455,1455),
+(1456,1456,1456),(1457,1457,1457),(1458,1458,1458),(1459,1459,1459),(1460,1460,1460),
+(1461,1461,1461),(1462,1462,1462),(1463,1463,1463),(1464,1464,1464),(1465,1465,1465),
+(1466,1466,1466),(1467,1467,1467),(1468,1468,1468),(1469,1469,1469),(1470,1470,1470),
+(1471,1471,1471),(1472,1472,1472),(1473,1473,1473),(1474,1474,1474),(1475,1475,1475),
+(1476,1476,1476),(1477,1477,1477),(1478,1478,1478),(1479,1479,1479),(1480,1480,1480),
+(1481,1481,1481),(1482,1482,1482),(1483,1483,1483),(1484,1484,1484),(1485,1485,1485),
+(1486,1486,1486),(1487,1487,1487),(1488,1488,1488),(1489,1489,1489),(1490,1490,1490),
+(1491,1491,1491),(1492,1492,1492),(1493,1493,1493),(1494,1494,1494),(1495,1495,1495),
+(1496,1496,1496),(1497,1497,1497),(1498,1498,1498),(1499,1499,1499),(1500,1500,1500),
+(1501,1501,1501),(1502,1502,1502),(1503,1503,1503),(1504,1504,1504),(1505,1505,1505),
+(1506,1506,1506),(1507,1507,1507),(1508,1508,1508),(1509,1509,1509),(1510,1510,1510),
+(1511,1511,1511),(1512,1512,1512),(1513,1513,1513),(1514,1514,1514),(1515,1515,1515),
+(1516,1516,1516),(1517,1517,1517),(1518,1518,1518),(1519,1519,1519),(1520,1520,1520),
+(1521,1521,1521),(1522,1522,1522),(1523,1523,1523),(1524,1524,1524),(1525,1525,1525),
+(1526,1526,1526),(1527,1527,1527),(1528,1528,1528),(1529,1529,1529),(1530,1530,1530),
+(1531,1531,1531),(1532,1532,1532),(1533,1533,1533),(1534,1534,1534),(1535,1535,1535),
+(1536,1536,1536),(1537,1537,1537),(1538,1538,1538),(1539,1539,1539),(1540,1540,1540),
+(1541,1541,1541),(1542,1542,1542),(1543,1543,1543),(1544,1544,1544),(1545,1545,1545),
+(1546,1546,1546),(1547,1547,1547),(1548,1548,1548),(1549,1549,1549),(1550,1550,1550),
+(1551,1551,1551),(1552,1552,1552),(1553,1553,1553),(1554,1554,1554),(1555,1555,1555),
+(1556,1556,1556),(1557,1557,1557),(1558,1558,1558),(1559,1559,1559),(1560,1560,1560),
+(1561,1561,1561),(1562,1562,1562),(1563,1563,1563),(1564,1564,1564),(1565,1565,1565),
+(1566,1566,1566),(1567,1567,1567),(1568,1568,1568),(1569,1569,1569),(1570,1570,1570),
+(1571,1571,1571),(1572,1572,1572),(1573,1573,1573),(1574,1574,1574),(1575,1575,1575),
+(1576,1576,1576),(1577,1577,1577),(1578,1578,1578),(1579,1579,1579),(1580,1580,1580),
+(1581,1581,1581),(1582,1582,1582),(1583,1583,1583),(1584,1584,1584),(1585,1585,1585),
+(1586,1586,1586),(1587,1587,1587),(1588,1588,1588),(1589,1589,1589),(1590,1590,1590),
+(1591,1591,1591),(1592,1592,1592),(1593,1593,1593),(1594,1594,1594),(1595,1595,1595),
+(1596,1596,1596),(1597,1597,1597),(1598,1598,1598),(1599,1599,1599),(1600,1600,1600),
+(1601,1601,1601),(1602,1602,1602),(1603,1603,1603),(1604,1604,1604),(1605,1605,1605),
+(1606,1606,1606),(1607,1607,1607),(1608,1608,1608),(1609,1609,1609),(1610,1610,1610),
+(1611,1611,1611),(1612,1612,1612),(1613,1613,1613),(1614,1614,1614),(1615,1615,1615),
+(1616,1616,1616),(1617,1617,1617),(1618,1618,1618),(1619,1619,1619),(1620,1620,1620),
+(1621,1621,1621),(1622,1622,1622),(1623,1623,1623),(1624,1624,1624),(1625,1625,1625),
+(1626,1626,1626),(1627,1627,1627),(1628,1628,1628),(1629,1629,1629),(1630,1630,1630),
+(1631,1631,1631),(1632,1632,1632),(1633,1633,1633),(1634,1634,1634),(1635,1635,1635),
+(1636,1636,1636),(1637,1637,1637),(1638,1638,1638),(1639,1639,1639),(1640,1640,1640),
+(1641,1641,1641),(1642,1642,1642),(1643,1643,1643),(1644,1644,1644),(1645,1645,1645),
+(1646,1646,1646),(1647,1647,1647),(1648,1648,1648),(1649,1649,1649),(1650,1650,1650),
+(1651,1651,1651),(1652,1652,1652),(1653,1653,1653),(1654,1654,1654),(1655,1655,1655),
+(1656,1656,1656),(1657,1657,1657),(1658,1658,1658),(1659,1659,1659),(1660,1660,1660),
+(1661,1661,1661),(1662,1662,1662),(1663,1663,1663),(1664,1664,1664),(1665,1665,1665),
+(1666,1666,1666),(1667,1667,1667),(1668,1668,1668),(1669,1669,1669),(1670,1670,1670),
+(1671,1671,1671),(1672,1672,1672),(1673,1673,1673),(1674,1674,1674),(1675,1675,1675),
+(1676,1676,1676),(1677,1677,1677),(1678,1678,1678),(1679,1679,1679),(1680,1680,1680),
+(1681,1681,1681),(1682,1682,1682),(1683,1683,1683),(1684,1684,1684),(1685,1685,1685),
+(1686,1686,1686),(1687,1687,1687),(1688,1688,1688),(1689,1689,1689),(1690,1690,1690),
+(1691,1691,1691),(1692,1692,1692),(1693,1693,1693),(1694,1694,1694),(1695,1695,1695),
+(1696,1696,1696),(1697,1697,1697),(1698,1698,1698),(1699,1699,1699),(1700,1700,1700),
+(1701,1701,1701),(1702,1702,1702),(1703,1703,1703),(1704,1704,1704),(1705,1705,1705),
+(1706,1706,1706),(1707,1707,1707),(1708,1708,1708),(1709,1709,1709),(1710,1710,1710),
+(1711,1711,1711),(1712,1712,1712),(1713,1713,1713),(1714,1714,1714),(1715,1715,1715),
+(1716,1716,1716),(1717,1717,1717),(1718,1718,1718),(1719,1719,1719),(1720,1720,1720),
+(1721,1721,1721),(1722,1722,1722),(1723,1723,1723),(1724,1724,1724),(1725,1725,1725),
+(1726,1726,1726),(1727,1727,1727),(1728,1728,1728),(1729,1729,1729),(1730,1730,1730),
+(1731,1731,1731),(1732,1732,1732),(1733,1733,1733),(1734,1734,1734),(1735,1735,1735),
+(1736,1736,1736),(1737,1737,1737),(1738,1738,1738),(1739,1739,1739),(1740,1740,1740),
+(1741,1741,1741),(1742,1742,1742),(1743,1743,1743),(1744,1744,1744),(1745,1745,1745),
+(1746,1746,1746),(1747,1747,1747),(1748,1748,1748),(1749,1749,1749),(1750,1750,1750),
+(1751,1751,1751),(1752,1752,1752),(1753,1753,1753),(1754,1754,1754),(1755,1755,1755),
+(1756,1756,1756),(1757,1757,1757),(1758,1758,1758),(1759,1759,1759),(1760,1760,1760),
+(1761,1761,1761),(1762,1762,1762),(1763,1763,1763),(1764,1764,1764),(1765,1765,1765),
+(1766,1766,1766),(1767,1767,1767),(1768,1768,1768),(1769,1769,1769),(1770,1770,1770),
+(1771,1771,1771),(1772,1772,1772),(1773,1773,1773),(1774,1774,1774),(1775,1775,1775),
+(1776,1776,1776),(1777,1777,1777),(1778,1778,1778),(1779,1779,1779),(1780,1780,1780),
+(1781,1781,1781),(1782,1782,1782),(1783,1783,1783),(1784,1784,1784),(1785,1785,1785),
+(1786,1786,1786),(1787,1787,1787),(1788,1788,1788),(1789,1789,1789),(1790,1790,1790),
+(1791,1791,1791),(1792,1792,1792),(1793,1793,1793),(1794,1794,1794),(1795,1795,1795),
+(1796,1796,1796),(1797,1797,1797),(1798,1798,1798),(1799,1799,1799),(1800,1800,1800),
+(1801,1801,1801),(1802,1802,1802),(1803,1803,1803),(1804,1804,1804),(1805,1805,1805),
+(1806,1806,1806),(1807,1807,1807),(1808,1808,1808),(1809,1809,1809),(1810,1810,1810),
+(1811,1811,1811),(1812,1812,1812),(1813,1813,1813),(1814,1814,1814),(1815,1815,1815),
+(1816,1816,1816),(1817,1817,1817),(1818,1818,1818),(1819,1819,1819),(1820,1820,1820),
+(1821,1821,1821),(1822,1822,1822),(1823,1823,1823),(1824,1824,1824),(1825,1825,1825),
+(1826,1826,1826),(1827,1827,1827),(1828,1828,1828),(1829,1829,1829),(1830,1830,1830),
+(1831,1831,1831),(1832,1832,1832),(1833,1833,1833),(1834,1834,1834),(1835,1835,1835),
+(1836,1836,1836),(1837,1837,1837),(1838,1838,1838),(1839,1839,1839),(1840,1840,1840),
+(1841,1841,1841),(1842,1842,1842),(1843,1843,1843),(1844,1844,1844),(1845,1845,1845),
+(1846,1846,1846),(1847,1847,1847),(1848,1848,1848),(1849,1849,1849),(1850,1850,1850),
+(1851,1851,1851),(1852,1852,1852),(1853,1853,1853),(1854,1854,1854),(1855,1855,1855),
+(1856,1856,1856),(1857,1857,1857),(1858,1858,1858),(1859,1859,1859),(1860,1860,1860),
+(1861,1861,1861),(1862,1862,1862),(1863,1863,1863),(1864,1864,1864),(1865,1865,1865),
+(1866,1866,1866),(1867,1867,1867),(1868,1868,1868),(1869,1869,1869),(1870,1870,1870),
+(1871,1871,1871),(1872,1872,1872),(1873,1873,1873),(1874,1874,1874),(1875,1875,1875),
+(1876,1876,1876),(1877,1877,1877),(1878,1878,1878),(1879,1879,1879),(1880,1880,1880),
+(1881,1881,1881),(1882,1882,1882),(1883,1883,1883),(1884,1884,1884),(1885,1885,1885),
+(1886,1886,1886),(1887,1887,1887),(1888,1888,1888),(1889,1889,1889),(1890,1890,1890),
+(1891,1891,1891),(1892,1892,1892),(1893,1893,1893),(1894,1894,1894),(1895,1895,1895),
+(1896,1896,1896),(1897,1897,1897),(1898,1898,1898),(1899,1899,1899),(1900,1900,1900),
+(1901,1901,1901),(1902,1902,1902),(1903,1903,1903),(1904,1904,1904),(1905,1905,1905),
+(1906,1906,1906),(1907,1907,1907),(1908,1908,1908),(1909,1909,1909),(1910,1910,1910),
+(1911,1911,1911),(1912,1912,1912),(1913,1913,1913),(1914,1914,1914),(1915,1915,1915),
+(1916,1916,1916),(1917,1917,1917),(1918,1918,1918),(1919,1919,1919),(1920,1920,1920),
+(1921,1921,1921),(1922,1922,1922),(1923,1923,1923),(1924,1924,1924),(1925,1925,1925),
+(1926,1926,1926),(1927,1927,1927),(1928,1928,1928),(1929,1929,1929),(1930,1930,1930),
+(1931,1931,1931),(1932,1932,1932),(1933,1933,1933),(1934,1934,1934),(1935,1935,1935),
+(1936,1936,1936),(1937,1937,1937),(1938,1938,1938),(1939,1939,1939),(1940,1940,1940),
+(1941,1941,1941),(1942,1942,1942),(1943,1943,1943),(1944,1944,1944),(1945,1945,1945),
+(1946,1946,1946),(1947,1947,1947),(1948,1948,1948),(1949,1949,1949),(1950,1950,1950),
+(1951,1951,1951),(1952,1952,1952),(1953,1953,1953),(1954,1954,1954),(1955,1955,1955),
+(1956,1956,1956),(1957,1957,1957),(1958,1958,1958),(1959,1959,1959),(1960,1960,1960),
+(1961,1961,1961),(1962,1962,1962),(1963,1963,1963),(1964,1964,1964),(1965,1965,1965),
+(1966,1966,1966),(1967,1967,1967),(1968,1968,1968),(1969,1969,1969),(1970,1970,1970),
+(1971,1971,1971),(1972,1972,1972),(1973,1973,1973),(1974,1974,1974),(1975,1975,1975),
+(1976,1976,1976),(1977,1977,1977),(1978,1978,1978),(1979,1979,1979),(1980,1980,1980),
+(1981,1981,1981),(1982,1982,1982),(1983,1983,1983),(1984,1984,1984),(1985,1985,1985),
+(1986,1986,1986),(1987,1987,1987),(1988,1988,1988),(1989,1989,1989),(1990,1990,1990),
+(1991,1991,1991),(1992,1992,1992),(1993,1993,1993),(1994,1994,1994),(1995,1995,1995),
+(1996,1996,1996),(1997,1997,1997),(1998,1998,1998),(1999,1999,1999);
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+2000
+INSERT INTO t1 VALUES (1,1,1);
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+INSERT INTO t1 VALUES
+(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
+(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
+ERROR 23000: Can't write; duplicate key in table 't1'
+select count(*) from t1;
+count(*)
+2000
+begin;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+2000
+INSERT INTO t1 VALUES
+(2001,2001,2001),(2002,2002,2002),(2003,2003,2003),(2004,2004,2004),(2005,2005,2005);
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+2005
+rollback;
+begin;
+INSERT INTO t1 VALUES
+(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
+(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
+ERROR 23000: Can't write; duplicate key in table 't1'
+commit;
+ERROR HY000: Got error 4350 'Transaction already aborted' from NDBCLUSTER
+select * from t1 where pk1=1;
+pk1 b c
+1 1 1
+select * from t1 where pk1=10;
+pk1 b c
+10 10 10
+select count(*) from t1 where pk1 <= 10 order by pk1;
+count(*)
+11
+select count(*) from t1;
+count(*)
+2000
+begin;
+INSERT INTO t1 VALUES
+(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
+(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
+ERROR 23000: Can't write; duplicate key in table 't1'
+rollback;
+select * from t1 where pk1=1;
+pk1 b c
+1 1 1
+select * from t1 where pk1=10;
+pk1 b c
+10 10 10
+select count(*) from t1 where pk1 <= 10 order by pk1;
+count(*)
+11
+select count(*) from t1;
+count(*)
+2000
+begin;
+INSERT INTO t1 VALUES
+(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
+(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
+ERROR 23000: Can't write; duplicate key in table 't1'
+SELECT * FROM t1 WHERE pk1=10;
+ERROR HY000: Got error 4350 'Transaction already aborted' from NDBCLUSTER
+rollback;
+select * from t1 where pk1=1;
+pk1 b c
+1 1 1
+select * from t1 where pk1=10;
+pk1 b c
+10 10 10
+select count(*) from t1 where pk1 <= 10 order by pk1;
+count(*)
+11
+select count(*) from t1;
+count(*)
+2000
+begin;
+INSERT INTO t1 VALUES
+(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
+(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
+ERROR 23000: Can't write; duplicate key in table 't1'
+SELECT * FROM t1 WHERE pk1=10;
+ERROR HY000: Got error 4350 'Transaction already aborted' from NDBCLUSTER
+SELECT * FROM t1 WHERE pk1=10;
+ERROR HY000: Got error 4350 'Transaction already aborted' from NDBCLUSTER
+commit;
+ERROR HY000: Got error 4350 'Transaction already aborted' from NDBCLUSTER
+select * from t1 where pk1=1;
+pk1 b c
+1 1 1
+select * from t1 where pk1=10;
+pk1 b c
+10 10 10
+select count(*) from t1 where pk1 <= 10 order by pk1;
+count(*)
+11
+select count(*) from t1;
+count(*)
+2000
+begin;
+INSERT INTO t1 VALUES
+(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
+(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
+ERROR 23000: Can't write; duplicate key in table 't1'
+INSERT INTO t1 values (4000, 40, 44);
+ERROR HY000: Got error 4350 'Transaction already aborted' from NDBCLUSTER
+rollback;
+select * from t1 where pk1=1;
+pk1 b c
+1 1 1
+select * from t1 where pk1=10;
+pk1 b c
+10 10 10
+select count(*) from t1 where pk1 <= 10 order by pk1;
+count(*)
+11
+select count(*) from t1;
+count(*)
+2000
+insert into t1 select * from t1 where b < 10 order by pk1;
+ERROR 23000: Can't write; duplicate key in table 't1'
+DELETE FROM t1 WHERE pk1=2;
+begin;
+INSERT IGNORE INTO t1 VALUES(1,2,3),(2,3,4);
+select * from t1 where pk1 < 3 order by pk1;
+pk1 b c
+0 0 0
+1 1 1
+2 3 4
+rollback;
+INSERT IGNORE INTO t1 VALUES(1,2,3),(2,3,4);
+select * from t1 where pk1 < 3 order by pk1;
+pk1 b c
+0 0 0
+1 1 1
+2 3 4
+REPLACE INTO t1 values(1, 78, 3);
+select * from t1 where pk1=1;
+pk1 b c
+1 78 3
+INSERT INTO t1 VALUES(1,1,1),(3,4,5) ON DUPLICATE KEY UPDATE b=79;
+select * from t1 where pk1 < 4 order by pk1;
+pk1 b c
+0 0 0
+1 79 3
+2 3 4
+3 79 3
+INSERT INTO t1 VALUES(1,1,1),(3,4,5) ON DUPLICATE KEY UPDATE b=pk1+c;
+select * from t1 where pk1 < 4 order by pk1;
+pk1 b c
+0 0 0
+1 4 3
+2 3 4
+3 6 3
+DELETE FROM t1 WHERE pk1 = 2 OR pk1 = 4 OR pk1 = 6;
+INSERT INTO t1 VALUES(1,1,1),(2,2,17),(3,4,5) ON DUPLICATE KEY UPDATE pk1=b;
+select * from t1 where pk1 = b and b != c order by pk1;
+pk1 b c
+2 2 17
+4 4 3
+6 6 3
+DELETE FROM t1;
+CREATE UNIQUE INDEX bi ON t1(b);
+INSERT INTO t1 VALUES
+(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
+(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
+INSERT INTO t1 VALUES(0,1,0),(21,21,21) ON DUPLICATE KEY UPDATE pk1=b+10,b=b+10;
+select * from t1 order by pk1;
+pk1 b c
+2 2 2
+3 3 3
+4 4 4
+5 5 5
+6 6 6
+7 7 7
+8 8 8
+9 9 9
+10 10 10
+11 11 1
+21 21 21
+DROP TABLE t1;
+CREATE TABLE t1(a INT) ENGINE=ndb;
+INSERT IGNORE INTO t1 VALUES (1);
+INSERT IGNORE INTO t1 VALUES (1);
+INSERT IGNORE INTO t1 SELECT a FROM t1;
+INSERT IGNORE INTO t1 SELECT a FROM t1;
+INSERT IGNORE INTO t1 SELECT a FROM t1;
+INSERT IGNORE INTO t1 VALUES (1);
+INSERT IGNORE INTO t1 VALUES (1);
+SELECT * FROM t1 ORDER BY a;
+a
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+DELETE FROM t1;
+CREATE UNIQUE INDEX ai ON t1(a);
+INSERT IGNORE INTO t1 VALUES (1);
+INSERT IGNORE INTO t1 VALUES (1);
+INSERT IGNORE INTO t1 VALUES (NULL),(2);
+SELECT * FROM t1 ORDER BY a;
+a
+NULL
+1
+2
+DROP TABLE t1;
+CREATE TABLE t1(pk INT NOT NULL PRIMARY KEY, a INT, UNIQUE (a)) ENGINE=ndb;
+INSERT IGNORE INTO t1 VALUES (1,1),(2,2),(3,3);
+INSERT IGNORE INTO t1 VALUES (4,NULL),(5,NULL),(6,NULL),(7,4);
+SELECT * FROM t1 ORDER BY pk;
+pk a
+1 1
+2 2
+3 3
+4 NULL
+5 NULL
+6 NULL
+7 4
+DROP TABLE t1;
+create table t1(a int primary key, b int, unique key(b)) engine=ndb;
+insert ignore into t1 values (1,0), (2,0), (2,null), (3,null);
+select * from t1 order by a;
+a b
+1 0
+2 NULL
+3 NULL
+drop table t1;
+CREATE TABLE t1 (
+pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+b INT NOT NULL,
+c INT NOT NULL UNIQUE
+) ENGINE=NDBCLUSTER;
+CREATE TABLE t2 (
+pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+b INT NOT NULL,
+c INT NOT NULL UNIQUE
+) ENGINE=MYISAM;
+SET @@session.auto_increment_increment=10;
+INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
+INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
+SELECT * FROM t1 ORDER BY pk;
+pk b c
+1 1 0
+11 2 1
+21 3 2
+SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
+COUNT(t1.pk)
+3
+TRUNCATE t1;
+TRUNCATE t2;
+SET @@session.auto_increment_offset=5;
+INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
+INSERT INTO t1 (pk,b,c) VALUES (27,4,3),(NULL,5,4),(99,6,5),(NULL,7,6);
+INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
+INSERT INTO t2 (pk,b,c) VALUES (27,4,3),(NULL,5,4),(99,6,5),(NULL,7,6);
+SELECT * FROM t1 ORDER BY pk;
+pk b c
+5 1 0
+15 2 1
+25 3 2
+27 4 3
+35 5 4
+99 6 5
+105 7 6
+SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
+COUNT(t1.pk)
+7
+TRUNCATE t1;
+TRUNCATE t2;
+SET @@session.auto_increment_increment=2;
+INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
+INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
+SELECT * FROM t1 ORDER BY pk;
+pk b c
+1 1 0
+3 2 1
+5 3 2
+SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
+COUNT(t1.pk)
+3
+DROP TABLE t1, t2;
+CREATE TABLE t1 (
+pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+b INT NOT NULL,
+c INT NOT NULL UNIQUE
+) ENGINE=NDBCLUSTER AUTO_INCREMENT = 7;
+CREATE TABLE t2 (
+pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+b INT NOT NULL,
+c INT NOT NULL UNIQUE
+) ENGINE=MYISAM AUTO_INCREMENT = 7;
+SET @@session.auto_increment_offset=1;
+SET @@session.auto_increment_increment=1;
+INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
+INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
+SELECT * FROM t1 ORDER BY pk;
+pk b c
+7 1 0
+8 2 1
+9 3 2
+SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
+COUNT(t1.pk)
+3
+DROP TABLE t1, t2;
+CREATE TABLE t1 (
+pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+b INT NOT NULL,
+c INT NOT NULL UNIQUE
+) ENGINE=NDBCLUSTER AUTO_INCREMENT = 3;
+CREATE TABLE t2 (
+pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+b INT NOT NULL,
+c INT NOT NULL UNIQUE
+) ENGINE=MYISAM AUTO_INCREMENT = 3;
+SET @@session.auto_increment_offset=5;
+SET @@session.auto_increment_increment=10;
+INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
+INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
+SELECT * FROM t1 ORDER BY pk;
+pk b c
+5 1 0
+15 2 1
+25 3 2
+SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
+COUNT(t1.pk)
+3
+DROP TABLE t1, t2;
+CREATE TABLE t1 (
+pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+b INT NOT NULL,
+c INT NOT NULL UNIQUE
+) ENGINE=NDBCLUSTER AUTO_INCREMENT = 7;
+CREATE TABLE t2 (
+pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+b INT NOT NULL,
+c INT NOT NULL UNIQUE
+) ENGINE=MYISAM AUTO_INCREMENT = 7;
+SET @@session.auto_increment_offset=5;
+SET @@session.auto_increment_increment=10;
+INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
+INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
+SELECT * FROM t1 ORDER BY pk;
+pk b c
+15 1 0
+25 2 1
+35 3 2
+SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
+COUNT(t1.pk)
+3
+DROP TABLE t1, t2;
+CREATE TABLE t1 (
+pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+b INT NOT NULL,
+c INT NOT NULL UNIQUE
+) ENGINE=NDBCLUSTER AUTO_INCREMENT = 5;
+CREATE TABLE t2 (
+pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+b INT NOT NULL,
+c INT NOT NULL UNIQUE
+) ENGINE=MYISAM AUTO_INCREMENT = 5;
+SET @@session.auto_increment_offset=5;
+SET @@session.auto_increment_increment=10;
+INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
+INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
+SELECT * FROM t1 ORDER BY pk;
+pk b c
+5 1 0
+15 2 1
+25 3 2
+SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
+COUNT(t1.pk)
+3
+DROP TABLE t1, t2;
+CREATE TABLE t1 (
+pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+b INT NOT NULL,
+c INT NOT NULL UNIQUE
+) ENGINE=NDBCLUSTER AUTO_INCREMENT = 100;
+CREATE TABLE t2 (
+pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+b INT NOT NULL,
+c INT NOT NULL UNIQUE
+) ENGINE=MYISAM AUTO_INCREMENT = 100;
+SET @@session.auto_increment_offset=5;
+SET @@session.auto_increment_increment=10;
+INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
+INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
+SELECT * FROM t1 ORDER BY pk;
+pk b c
+105 1 0
+115 2 1
+125 3 2
+SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
+COUNT(t1.pk)
+3
+DROP TABLE t1, t2;
diff --git a/mysql-test/r/ndb_limit.result b/mysql-test/suite/ndb/r/ndb_limit.result
index da1ec3b61c3..da1ec3b61c3 100644
--- a/mysql-test/r/ndb_limit.result
+++ b/mysql-test/suite/ndb/r/ndb_limit.result
diff --git a/mysql-test/r/ndb_load.result b/mysql-test/suite/ndb/r/ndb_load.result
index 416a350066b..416a350066b 100644
--- a/mysql-test/r/ndb_load.result
+++ b/mysql-test/suite/ndb/r/ndb_load.result
diff --git a/mysql-test/r/ndb_loaddatalocal.result b/mysql-test/suite/ndb/r/ndb_loaddatalocal.result
index 1d15c608f03..1d15c608f03 100644
--- a/mysql-test/r/ndb_loaddatalocal.result
+++ b/mysql-test/suite/ndb/r/ndb_loaddatalocal.result
diff --git a/mysql-test/r/ndb_lock.result b/mysql-test/suite/ndb/r/ndb_lock.result
index 9057731c3f4..9057731c3f4 100644
--- a/mysql-test/r/ndb_lock.result
+++ b/mysql-test/suite/ndb/r/ndb_lock.result
diff --git a/mysql-test/r/ndb_minmax.result b/mysql-test/suite/ndb/r/ndb_minmax.result
index cc0c238ac6e..cc0c238ac6e 100644
--- a/mysql-test/r/ndb_minmax.result
+++ b/mysql-test/suite/ndb/r/ndb_minmax.result
diff --git a/mysql-test/r/ndb_multi.result b/mysql-test/suite/ndb/r/ndb_multi.result
index 2bc49bf9b45..2bc49bf9b45 100644
--- a/mysql-test/r/ndb_multi.result
+++ b/mysql-test/suite/ndb/r/ndb_multi.result
diff --git a/mysql-test/r/ndb_multi_row.result b/mysql-test/suite/ndb/r/ndb_multi_row.result
index cf5a76d6f01..cf5a76d6f01 100644
--- a/mysql-test/r/ndb_multi_row.result
+++ b/mysql-test/suite/ndb/r/ndb_multi_row.result
diff --git a/mysql-test/r/ndb_partition_error.result b/mysql-test/suite/ndb/r/ndb_partition_error.result
index d86dc382185..d86dc382185 100644
--- a/mysql-test/r/ndb_partition_error.result
+++ b/mysql-test/suite/ndb/r/ndb_partition_error.result
diff --git a/mysql-test/r/ndb_partition_error2.result b/mysql-test/suite/ndb/r/ndb_partition_error2.result
index a739ef3923c..a739ef3923c 100644
--- a/mysql-test/r/ndb_partition_error2.result
+++ b/mysql-test/suite/ndb/r/ndb_partition_error2.result
diff --git a/mysql-test/r/ndb_partition_key.result b/mysql-test/suite/ndb/r/ndb_partition_key.result
index 60e96ce03b6..60e96ce03b6 100644
--- a/mysql-test/r/ndb_partition_key.result
+++ b/mysql-test/suite/ndb/r/ndb_partition_key.result
diff --git a/mysql-test/r/ndb_partition_list.result b/mysql-test/suite/ndb/r/ndb_partition_list.result
index ce2574ddcc4..ce2574ddcc4 100644
--- a/mysql-test/r/ndb_partition_list.result
+++ b/mysql-test/suite/ndb/r/ndb_partition_list.result
diff --git a/mysql-test/suite/ndb/r/ndb_partition_range.result b/mysql-test/suite/ndb/r/ndb_partition_range.result
new file mode 100644
index 00000000000..0c717ed55e9
--- /dev/null
+++ b/mysql-test/suite/ndb/r/ndb_partition_range.result
@@ -0,0 +1,263 @@
+drop table if exists t1;
+CREATE TABLE t1 (
+a int not null,
+b int not null,
+c int not null,
+primary key(a,b),
+index (a))
+engine = ndb
+partition by range (a)
+partitions 3
+(partition x1 values less than (5),
+partition x2 values less than (10),
+partition x3 values less than (20));
+INSERT into t1 values (1, 1, 1);
+INSERT into t1 values (6, 1, 1);
+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
+select * from t1 order by a;
+a b c
+1 1 1
+6 1 1
+10 1 1
+15 1 1
+select * from t1 where a=1 order by a;
+a b c
+1 1 1
+select * from t1 where a=15 and b=1 order by a;
+a b c
+15 1 1
+select * from t1 where a=21 and b=1 order by a;
+a b c
+select * from t1 where a=21 order by a;
+a b c
+select * from t1 where a in (1,6,10,21) order by a;
+a b c
+1 1 1
+6 1 1
+10 1 1
+select * from t1 where b=1 and a in (1,6,10,21) order by a;
+a b c
+1 1 1
+6 1 1
+10 1 1
+drop table t1;
+CREATE TABLE t1 (
+a int not null,
+b int not null,
+c int not null,
+primary key(b),
+unique (a))
+engine = ndb
+partition by range (b)
+partitions 3
+(partition x1 values less than (5),
+partition x2 values less than (10),
+partition x3 values less than (20));
+INSERT into t1 values (1, 1, 1);
+INSERT into t1 values (2, 6, 1);
+INSERT into t1 values (3, 10, 1);
+INSERT into t1 values (4, 15, 1);
+select * from t1 order by a;
+a b c
+1 1 1
+2 6 1
+3 10 1
+4 15 1
+UPDATE t1 set a = 5 WHERE b = 15;
+select * from t1 order by a;
+a b c
+1 1 1
+2 6 1
+3 10 1
+5 15 1
+UPDATE t1 set a = 6 WHERE a = 5;
+select * from t1 order by a;
+a b c
+1 1 1
+2 6 1
+3 10 1
+6 15 1
+select * from t1 where b=1 order by b;
+a b c
+1 1 1
+select * from t1 where b=15 and a=1 order by b;
+a b c
+select * from t1 where b=21 and a=1 order by b;
+a b c
+select * from t1 where b=21 order by b;
+a b c
+select * from t1 where b in (1,6,10,21) order by b;
+a b c
+1 1 1
+2 6 1
+3 10 1
+select * from t1 where a in (1,2,5,6) order by b;
+a b c
+1 1 1
+2 6 1
+6 15 1
+select * from t1 where a=1 and b in (1,6,10,21) order by b;
+a b c
+1 1 1
+DELETE from t1 WHERE b = 6;
+DELETE from t1 WHERE a = 6;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ `b` int(11) NOT NULL,
+ `c` int(11) NOT NULL,
+ PRIMARY KEY (`b`),
+ UNIQUE KEY `a` (`a`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (b) (PARTITION x1 VALUES LESS THAN (5) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (10) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (20) ENGINE = ndbcluster) */
+drop table t1;
+CREATE TABLE t1
+(id MEDIUMINT NOT NULL,
+b1 BIT(8),
+vc VARCHAR(255),
+bc CHAR(255),
+d DECIMAL(10,4) DEFAULT 0,
+f FLOAT DEFAULT 0,
+total BIGINT UNSIGNED,
+y YEAR,
+t DATE) ENGINE=NDB
+PARTITION BY RANGE (YEAR(t))
+(PARTITION p0 VALUES LESS THAN (1901),
+PARTITION p1 VALUES LESS THAN (1946),
+PARTITION p2 VALUES LESS THAN (1966),
+PARTITION p3 VALUES LESS THAN (1986),
+PARTITION p4 VALUES LESS THAN (2005),
+PARTITION p5 VALUES LESS THAN MAXVALUE);
+INSERT INTO t1 VALUES (0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+SELECT * FROM t1;
+id b1 vc bc d f total y t
+0 NULL NULL NULL NULL NULL NULL NULL NULL
+ALTER TABLE t1 ENGINE=MYISAM;
+SELECT * FROM t1;
+id b1 vc bc d f total y t
+0 NULL NULL NULL NULL NULL NULL NULL NULL
+DROP TABLE t1;
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+ INITIAL_SIZE 16M
+UNDO_BUFFER_SIZE=1M
+ENGINE=NDB;
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+ USE LOGFILE GROUP lg1
+INITIAL_SIZE 12M
+ENGINE NDB;
+CREATE TABLE test.t1 (
+a1 INT,
+a2 TEXT NOT NULL,
+a3 BIT NOT NULL,
+a4 DECIMAL(8,3),
+a5 INT NOT NULL,
+a6 INT,
+PRIMARY KEY(a1))
+TABLESPACE ts1 STORAGE DISK ENGINE=NDB
+PARTITION BY LIST (a1)
+(PARTITION p0 VALUES IN (1,2,3,4,5),
+PARTITION p1 VALUES IN (6,7,8,9, 10),
+PARTITION p2 VALUES IN (11, 12, 13, 14, 15));
+ALTER TABLE test.t1 DROP COLUMN a6;
+ALTER TABLE test.t1 ADD COLUMN a6 VARCHAR(255);
+SELECT COUNT(*) FROM test.t1;
+COUNT(*)
+15
+ALTER TABLE test.t1 DROP COLUMN a4;
+SELECT COUNT(*) FROM test.t1;
+COUNT(*)
+15
+DROP TABLE t1;
+CREATE TABLE test.t1 (
+a1 INT,
+a2 TEXT NOT NULL,
+a3 BIT NOT NULL,
+a4 DECIMAL(8,3),
+a5 INT NOT NULL,
+a6 VARCHAR(255),
+PRIMARY KEY(a1))
+TABLESPACE ts1 STORAGE DISK ENGINE=NDB
+PARTITION BY HASH(a1)
+PARTITIONS 4;
+SELECT COUNT(*) FROM test.t1;
+COUNT(*)
+15
+ALTER TABLE test.t1 DROP COLUMN a4;
+SELECT COUNT(*) FROM test.t1;
+COUNT(*)
+15
+DROP TABLE t1;
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile.dat'
+ENGINE=NDB;
+DROP TABLESPACE ts1 ENGINE=NDB;
+DROP LOGFILE GROUP lg1 ENGINE=NDB;
+CREATE TABLE t1
+(id MEDIUMINT NOT NULL,
+b1 BIT(8),
+vc VARCHAR(255),
+bc CHAR(255),
+d DECIMAL(10,4) DEFAULT 0,
+f FLOAT DEFAULT 0,
+total BIGINT UNSIGNED,
+y YEAR,
+t DATE) ENGINE=NDB
+PARTITION BY LIST(id)
+(PARTITION p0 VALUES IN (2, 4),
+PARTITION p1 VALUES IN (42, 142));
+INSERT INTO t1 VALUES (2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+SELECT * FROM t1;
+id b1 vc bc d f total y t
+2 NULL NULL NULL NULL NULL NULL NULL NULL
+ALTER TABLE t1 ADD PARTITION
+(PARTITION p2 VALUES IN (412));
+SELECT * FROM t1;
+id b1 vc bc d f total y t
+2 NULL NULL NULL NULL NULL NULL NULL NULL
+DROP TABLE t1;
+CREATE TABLE t1 (
+a int not null,
+b int not null,
+c int not null)
+partition by list(a)
+partitions 2
+(partition x123 values in (1,5,6),
+partition x234 values in (4,7,8));
+INSERT into t1 VALUES (5,1,1);
+select * from t1;
+a b c
+5 1 1
+UPDATE t1 SET a=8 WHERE a=5 AND b=1;
+select * from t1;
+a b c
+8 1 1
+drop table t1;
+CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) engine=ndb
+PARTITION BY RANGE(f1)
+( PARTITION part1 VALUES LESS THAN (2),
+PARTITION part2 VALUES LESS THAN (1000));
+INSERT INTO t1 VALUES(1, '---1---');
+INSERT INTO t1 VALUES(2, '---2---');
+select * from t1 order by f1;
+f1 f2
+1 ---1---
+2 ---2---
+UPDATE t1 SET f1 = f1 + 4 WHERE f1 = 2;
+select * from t1 order by f1;
+f1 f2
+1 ---1---
+6 ---2---
+UPDATE t1 SET f1 = f1 + 4 WHERE f1 = 1;
+select * from t1 order by f1;
+f1 f2
+5 ---1---
+6 ---2---
+drop table t1;
diff --git a/mysql-test/suite/ndb/r/ndb_read_multi_range.result b/mysql-test/suite/ndb/r/ndb_read_multi_range.result
new file mode 100644
index 00000000000..4c3496f3f47
--- /dev/null
+++ b/mysql-test/suite/ndb/r/ndb_read_multi_range.result
@@ -0,0 +1,494 @@
+DROP TABLE IF EXISTS t1, t2, r1;
+create table t1 (
+a int primary key,
+b int not null,
+c int not null,
+index(b), unique index using hash(c)
+) engine = ndb;
+insert into t1 values
+(1,2,1),(2,3,2),(3,4,3),(4,5,4),
+(5,2,12),(6,3,11),(7,4,10),(8,5,9),
+(9,2,8),(10,3,7),(11,4,6),(12,5,5);
+create table r1 as select * from t1 where a in (2,8,12);
+select * from r1 order by a;
+a b c
+2 3 2
+8 5 9
+12 5 5
+drop table r1;
+create table r1 as select * from t1 where b in (1,2,5);
+select * from r1 order by a;
+a b c
+1 2 1
+4 5 4
+5 2 12
+8 5 9
+9 2 8
+12 5 5
+drop table r1;
+create table r1 as select * from t1 where c in (2,8,12);
+select * from r1 order by a;
+a b c
+2 3 2
+5 2 12
+9 2 8
+drop table r1;
+create table r1 as select * from t1 where a in (2,8) or (a > 11) or (a <= 1);
+select * from r1 order by a;
+a b c
+1 2 1
+2 3 2
+8 5 9
+12 5 5
+drop table r1;
+create table r1 as select * from t1 where a in (33,8,12);
+select * from r1 order by a;
+a b c
+8 5 9
+12 5 5
+drop table r1;
+create table r1 as select * from t1 where a in (2,33,8,12,34);
+select * from r1 order by a;
+a b c
+2 3 2
+8 5 9
+12 5 5
+drop table r1;
+create table r1 as select * from t1 where b in (1,33,5);
+select * from r1 order by a;
+a b c
+4 5 4
+8 5 9
+12 5 5
+drop table r1;
+select * from t1 where b in (1,33,5) order by a;
+a b c
+4 5 4
+8 5 9
+12 5 5
+create table r1 as select * from t1 where b in (45,1,33,5,44);
+select * from r1 order by a;
+a b c
+4 5 4
+8 5 9
+12 5 5
+drop table r1;
+select * from t1 where b in (45,22) order by a;
+a b c
+create table r1 as select * from t1 where c in (2,8,33);
+select * from r1 order by a;
+a b c
+2 3 2
+9 2 8
+drop table r1;
+create table r1 as select * from t1 where c in (13,2,8,33,12);
+select * from r1 order by a;
+a b c
+2 3 2
+5 2 12
+9 2 8
+drop table r1;
+select * from t1 where a in (33,8,12) order by a;
+a b c
+8 5 9
+12 5 5
+select * from t1 where a in (33,34,35) order by a;
+a b c
+select * from t1 where a in (2,8) or (a > 11) or (a <= 1) order by a;
+a b c
+1 2 1
+2 3 2
+8 5 9
+12 5 5
+select * from t1 where b in (6,7) or (b <= 5) or (b >= 10) order by b,a;
+a b c
+1 2 1
+5 2 12
+9 2 8
+2 3 2
+6 3 11
+10 3 7
+3 4 3
+7 4 10
+11 4 6
+4 5 4
+8 5 9
+12 5 5
+select * from t1 where c in (13,2,8,33,12) order by c,a;
+a b c
+2 3 2
+9 2 8
+5 2 12
+drop table t1;
+create table t1 (
+a int not null,
+b int not null,
+c int not null,
+d int not null,
+e int not null,
+primary key (a,b,c,d), index (d)
+) engine = ndb;
+insert into t1 values
+(1,2,1,1,1),(2,3,2,3,1),(3,4,3,1,1),(4,5,4,7,1),
+(5,2,12,12,1),(6,3,11,1,1),(7,4,10,3,1),(8,5,9,5,1),
+(9,2,8,6,1),(10,3,7,5,1),(11,4,6,3,1),(12,5,5,2,1),
+(1,2,1,2,1),
+(1,2,1,3,1),
+(1,2,1,4,1),
+(1,2,1,5,1);
+create table r1 as select * from t1
+where a=1 and b=2 and c=1 and d in (1,4,3,2);
+select * from r1 order by a,b,c,d;
+a b c d e
+1 2 1 1 1
+1 2 1 2 1
+1 2 1 3 1
+1 2 1 4 1
+drop table r1;
+update t1 set e = 100
+where d in (12,6,7);
+select * from t1 where d in (12,6,7) order by a,b,c,d;
+a b c d e
+4 5 4 7 100
+5 2 12 12 100
+9 2 8 6 100
+select * from t1 where d not in (12,6,7) and e = 100;
+a b c d e
+update t1
+set e = 101
+where a=1 and
+b=2 and
+c=1 and
+d in (1,4,3,2);
+select *
+from t1
+where a=1 and b=2 and c=1 and d in (1,4,3,2)
+order by a,b,c,d;
+a b c d e
+1 2 1 1 101
+1 2 1 2 101
+1 2 1 3 101
+1 2 1 4 101
+select *
+from t1
+where not (a=1 and b=2 and c=1 and d in (1,4,3,2))
+and e=101;
+a b c d e
+update t1
+set e =
+(case d
+when 12 then 112
+when 6 then 106
+when 7 then 107
+end)
+where d in (12,6,7);
+select * from t1 where d in (12,6,7) order by a,b,c,d;
+a b c d e
+4 5 4 7 107
+5 2 12 12 112
+9 2 8 6 106
+update t1
+set e =
+(case d
+when 1 then 111
+when 4 then 444
+when 3 then 333
+when 2 then 222
+end)
+where a=1 and
+b=2 and
+c=1 and
+d in (1,4,3,2);
+select *
+from t1
+where a=1 and b=2 and c=1 and d in (1,4,3,2)
+order by a,b,c,d;
+a b c d e
+1 2 1 1 111
+1 2 1 2 222
+1 2 1 3 333
+1 2 1 4 444
+delete from t1 where d in (12,6,7);
+select * from t1 where d in (12,6,7);
+a b c d e
+drop table t1;
+create table t1 (
+a int not null primary key,
+b int,
+c int,
+d int,
+unique index (b),
+index(c)
+) engine = ndb;
+insert into t1 values
+(1,null,1,1),
+(2,2,2,2),
+(3,null,null,3),
+(4,4,null,4),
+(5,null,5,null),
+(6,6,6,null),
+(7,null,null,null),
+(8,8,null,null),
+(9,null,9,9),
+(10,10,10,10),
+(11,null,null,11),
+(12,12,null,12),
+(13,null,13,null),
+(14,14,14,null),
+(15,null,null,null),
+(16,16,null,null);
+create table t2 as select * from t1 where a in (5,6,7,8,9,10);
+select * from t2 order by a;
+a b c d
+5 NULL 5 NULL
+6 6 6 NULL
+7 NULL NULL NULL
+8 8 NULL NULL
+9 NULL 9 9
+10 10 10 10
+drop table t2;
+create table t2 as select * from t1 where b in (5,6,7,8,9,10);
+select * from t2 order by a;
+a b c d
+6 6 6 NULL
+8 8 NULL NULL
+10 10 10 10
+drop table t2;
+create table t2 as select * from t1 where c in (5,6,7,8,9,10);
+select * from t2 order by a;
+a b c d
+5 NULL 5 NULL
+6 6 6 NULL
+9 NULL 9 9
+10 10 10 10
+drop table t2;
+drop table t1;
+CREATE TABLE t1 (
+a int(11) NOT NULL,
+b int(11) NOT NULL,
+c datetime default NULL,
+PRIMARY KEY (a),
+KEY idx_bc (b,c)
+) ENGINE=ndbcluster;
+INSERT INTO t1 VALUES
+(406989,67,'2006-02-23 17:08:46'), (150078,67,'2005-10-26 11:17:45'),
+(406993,67,'2006-02-27 11:20:57'), (245655,67,'2005-12-08 15:59:08'),
+(406994,67,'2006-02-27 11:26:46'), (256,67,NULL),
+(398341,67,'2006-02-20 04:48:44'), (254,67,NULL),(1120,67,NULL),
+(406988,67,'2006-02-23 17:07:22'), (255,67,NULL),
+(398340,67,'2006-02-20 04:38:53'),(406631,67,'2006-02-23 10:49:42'),
+(245653,67,'2005-12-08 15:59:07'),(406992,67,'2006-02-24 16:47:18'),
+(245654,67,'2005-12-08 15:59:08'),(406995,67,'2006-02-28 11:55:00'),
+(127261,67,'2005-10-13 12:17:58'),(406991,67,'2006-02-24 16:42:32'),
+(245652,67,'2005-12-08 15:58:27'),(398545,67,'2006-02-20 04:53:13'),
+(154504,67,'2005-10-28 11:53:01'),(9199,67,NULL),(1,67,'2006-02-23 15:01:35'),
+(223456,67,NULL),(4101,67,NULL),(1133,67,NULL),
+(406990,67,'2006-02-23 18:01:45'),(148815,67,'2005-10-25 15:34:17'),
+(148812,67,'2005-10-25 15:30:01'),(245651,67,'2005-12-08 15:58:27'),
+(154503,67,'2005-10-28 11:52:38');
+create table t11 engine = ndbcluster select * from t1 where b = 67 AND (c IS NULL OR c > NOW()) order by 3 asc;
+create table t12 engine = ndbcluster select * from t1 where b = 67 AND (c IS NULL OR c > NOW()) order by 3 desc;
+create table t21 select * from t1 where b = 67 AND (c IS NULL OR c > '2005-12-08') order by 3 asc;
+create table t22 engine = ndbcluster select * from t1 where b = 67 AND (c IS NULL OR c > '2005-12-08') order by 3 desc;
+select * from t11 order by 1,2,3;
+a b c
+254 67 NULL
+255 67 NULL
+256 67 NULL
+1120 67 NULL
+1133 67 NULL
+4101 67 NULL
+9199 67 NULL
+223456 67 NULL
+select * from t12 order by 1,2,3;
+a b c
+254 67 NULL
+255 67 NULL
+256 67 NULL
+1120 67 NULL
+1133 67 NULL
+4101 67 NULL
+9199 67 NULL
+223456 67 NULL
+select * from t21 order by 1,2,3;
+a b c
+1 67 2006-02-23 15:01:35
+254 67 NULL
+255 67 NULL
+256 67 NULL
+1120 67 NULL
+1133 67 NULL
+4101 67 NULL
+9199 67 NULL
+223456 67 NULL
+245651 67 2005-12-08 15:58:27
+245652 67 2005-12-08 15:58:27
+245653 67 2005-12-08 15:59:07
+245654 67 2005-12-08 15:59:08
+245655 67 2005-12-08 15:59:08
+398340 67 2006-02-20 04:38:53
+398341 67 2006-02-20 04:48:44
+398545 67 2006-02-20 04:53:13
+406631 67 2006-02-23 10:49:42
+406988 67 2006-02-23 17:07:22
+406989 67 2006-02-23 17:08:46
+406990 67 2006-02-23 18:01:45
+406991 67 2006-02-24 16:42:32
+406992 67 2006-02-24 16:47:18
+406993 67 2006-02-27 11:20:57
+406994 67 2006-02-27 11:26:46
+406995 67 2006-02-28 11:55:00
+select * from t22 order by 1,2,3;
+a b c
+1 67 2006-02-23 15:01:35
+254 67 NULL
+255 67 NULL
+256 67 NULL
+1120 67 NULL
+1133 67 NULL
+4101 67 NULL
+9199 67 NULL
+223456 67 NULL
+245651 67 2005-12-08 15:58:27
+245652 67 2005-12-08 15:58:27
+245653 67 2005-12-08 15:59:07
+245654 67 2005-12-08 15:59:08
+245655 67 2005-12-08 15:59:08
+398340 67 2006-02-20 04:38:53
+398341 67 2006-02-20 04:48:44
+398545 67 2006-02-20 04:53:13
+406631 67 2006-02-23 10:49:42
+406988 67 2006-02-23 17:07:22
+406989 67 2006-02-23 17:08:46
+406990 67 2006-02-23 18:01:45
+406991 67 2006-02-24 16:42:32
+406992 67 2006-02-24 16:47:18
+406993 67 2006-02-27 11:20:57
+406994 67 2006-02-27 11:26:46
+406995 67 2006-02-28 11:55:00
+select t12.a from t11, t12 where t11.a in(255,256) and t11.a = t12.a and t11.c is null order by t12.a;
+a
+255
+256
+update t22 set c = '2005-12-08 15:58:27' where a = 255;
+select * from t22 order by 1,2,3;
+a b c
+1 67 2006-02-23 15:01:35
+254 67 NULL
+255 67 2005-12-08 15:58:27
+256 67 NULL
+1120 67 NULL
+1133 67 NULL
+4101 67 NULL
+9199 67 NULL
+223456 67 NULL
+245651 67 2005-12-08 15:58:27
+245652 67 2005-12-08 15:58:27
+245653 67 2005-12-08 15:59:07
+245654 67 2005-12-08 15:59:08
+245655 67 2005-12-08 15:59:08
+398340 67 2006-02-20 04:38:53
+398341 67 2006-02-20 04:48:44
+398545 67 2006-02-20 04:53:13
+406631 67 2006-02-23 10:49:42
+406988 67 2006-02-23 17:07:22
+406989 67 2006-02-23 17:08:46
+406990 67 2006-02-23 18:01:45
+406991 67 2006-02-24 16:42:32
+406992 67 2006-02-24 16:47:18
+406993 67 2006-02-27 11:20:57
+406994 67 2006-02-27 11:26:46
+406995 67 2006-02-28 11:55:00
+select t21.* from t21,t22 where t21.a = t22.a and
+t22.a in (select t12.a from t11, t12 where t11.a in(255,256) and t11.a = t12.a and t11.c is null) and t22.c is null order by t21.a;
+a b c
+256 67 NULL
+delete from t22 where a > 245651;
+update t22 set b = a + 1;
+select * from t22 order by 1,2,3;
+a b c
+1 2 2006-02-23 15:01:35
+254 255 NULL
+255 256 2005-12-08 15:58:27
+256 257 NULL
+1120 1121 NULL
+1133 1134 NULL
+4101 4102 NULL
+9199 9200 NULL
+223456 223457 NULL
+245651 245652 2005-12-08 15:58:27
+select t21.c, count(*)
+from t21
+inner join t22 using (a)
+where t22.b in (2,256,257,1121,1134,4102,9200,223457,245652)
+group by t21.c
+order by t21.c;
+c count(*)
+NULL 7
+2005-12-08 15:58:27 1
+2006-02-23 15:01:35 1
+DROP TABLE t1, t11, t12, t21, t22;
+CREATE TABLE t1 (id varchar(255) NOT NULL,
+tag int(11) NOT NULL,
+doc text NOT NULL,
+type varchar(150) NOT NULL,
+modified timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+PRIMARY KEY (id)
+) ENGINE=ndbcluster;
+INSERT INTO t1 VALUES ('sakila',1,'Some text goes here','text',CURRENT_TIMESTAMP);
+SELECT id, tag, doc, type FROM t1 WHERE id IN ('flipper','orka');
+id tag doc type
+SELECT id, tag, doc, type FROM t1 WHERE id IN ('flipper','sakila');
+id tag doc type
+sakila 1 Some text goes here text
+DROP TABLE t1;
+CREATE TABLE t1 (
+var1 int(2) NOT NULL,
+var2 int(2) NOT NULL,
+PRIMARY KEY (var1)
+) ENGINE=ndbcluster DEFAULT CHARSET=ascii CHECKSUM=1;
+CREATE TABLE t2 (
+var1 int(2) NOT NULL,
+var2 int(2) NOT NULL,
+PRIMARY KEY (var1)
+) ENGINE=ndbcluster DEFAULT CHARSET=ascii CHECKSUM=1;
+CREATE TRIGGER testtrigger
+AFTER UPDATE ON t1 FOR EACH ROW BEGIN
+REPLACE INTO t2 SELECT * FROM t1 WHERE t1.var1 = NEW.var1;END|
+INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
+UPDATE t1 SET var2 = 9 WHERE var1 IN(1,2,3);
+DROP TRIGGER testtrigger;
+DROP TABLE t1, t2;
+create table t1 (a int, b int, primary key (a), key ab (a,b)) engine=ndbcluster;
+insert into t1 values (1,1), (10,10);
+select * from t1 use index (ab) where a in(1,10) order by a;
+a b
+1 1
+10 10
+create table t2 (a int, b int, primary key (a,b)) engine=ndbcluster
+partition by key(a);
+insert into t2 values (1,1), (10,10);
+select * from t2 where a in (1,10) order by a;
+a b
+1 1
+10 10
+drop table t1, t2;
+create table t1 (id int primary key) engine ndb;
+insert into t1 values (1), (2), (3);
+create table t2 (id int primary key) engine ndb;
+insert into t2 select id from t1;
+create trigger kaboom after delete on t1
+for each row begin
+delete from t2 where id=old.id;
+end|
+select * from t1 order by id;
+id
+1
+2
+3
+delete from t1 where id in (1,2);
+select * from t2 order by id;
+id
+3
+drop trigger kaboom;
+drop table t1;
diff --git a/mysql-test/r/ndb_rename.result b/mysql-test/suite/ndb/r/ndb_rename.result
index 2cc2dfb3ff1..2cc2dfb3ff1 100644
--- a/mysql-test/r/ndb_rename.result
+++ b/mysql-test/suite/ndb/r/ndb_rename.result
diff --git a/mysql-test/r/ndb_replace.result b/mysql-test/suite/ndb/r/ndb_replace.result
index 23844ce3bff..23844ce3bff 100644
--- a/mysql-test/r/ndb_replace.result
+++ b/mysql-test/suite/ndb/r/ndb_replace.result
diff --git a/mysql-test/suite/ndb/r/ndb_restore.result b/mysql-test/suite/ndb/r/ndb_restore.result
new file mode 100644
index 00000000000..aba6997d218
--- /dev/null
+++ b/mysql-test/suite/ndb/r/ndb_restore.result
@@ -0,0 +1,490 @@
+use test;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
+drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
+CREATE TABLE `t1_c` (
+`capgoaledatta` mediumint(5) unsigned NOT NULL auto_increment,
+`goaledatta` char(2) NOT NULL default '',
+`maturegarbagefa` varchar(32) NOT NULL default '',
+PRIMARY KEY (`capgoaledatta`,`goaledatta`,`maturegarbagefa`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
+INSERT INTO `t1_c` VALUES (2,'3','q3plus.qt'),(400,'4','q3plus.qt'),(1,'3','q3.net'),(3,'4','q3.net'),(3000,'20','threetrees.qt');
+CREATE TABLE `t2_c` (
+`capgotod` smallint(5) unsigned NOT NULL auto_increment,
+`gotod` smallint(5) unsigned NOT NULL default '0',
+`goaledatta` char(2) default NULL,
+`maturegarbagefa` varchar(32) default NULL,
+`descrpooppo` varchar(64) default NULL,
+`svcutonsa` varchar(64) NOT NULL default '',
+PRIMARY KEY (`capgotod`),
+KEY `i quadaddsvr` (`gotod`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
+INSERT INTO `t2_c` VALUES (500,4,'','q3.net','addavp:MK_CASELECTOR=1','postorod rattoaa'),(2,1,'4','','addavp:MK_BRANDTAD=345','REDS Brandtad'),(3,2,'4','q3.net','execorder','fixedRatediPO REDS'),(1,1,'3','','addavp:MK_BRANDTAD=123','TEST Brandtad'),(6,5,'','told.q3.net','addavp:MK_BRANDTAD=123','Brandtad Toldzone'),(4,3,'3','q3.net','addavp:MK_POOLHINT=2','ratedi PO TEST'),(5,0,'',NULL,NULL,'');
+CREATE TABLE `t3_c` (
+`CapGoaledatta` smallint(5) unsigned NOT NULL default '0',
+`capgotod` smallint(5) unsigned NOT NULL default '0',
+PRIMARY KEY (`capgotod`,`CapGoaledatta`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED;
+INSERT INTO `t3_c` VALUES (5,3),(2,4),(5,4),(1,3);
+CREATE TABLE `t4_c` (
+`capfa` bigint(20) unsigned NOT NULL auto_increment,
+`realm` varchar(32) NOT NULL default '',
+`authpwchap` varchar(32) default NULL,
+`fa` varchar(32) NOT NULL default '',
+`payyingatta` tinyint(4) NOT NULL default '0',
+`status` char(1) default NULL,
+PRIMARY KEY (`fa`,`realm`),
+KEY `capfa` (`capfa`),
+KEY `i_quadentity` (`fa`,`realm`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
+INSERT INTO `t4_c` VALUES (18,'john.smith','q3.net','dessjohn.smith',0,NULL),(21,'quad_katt_with_brandtad','q3.net','acne',0,NULL),(2200,'quad_katt_carattoaa','q3.net','acne',0,NULL),(26,'436462612809','sqasdt.q3.net','N/A',0,'6'),(19,'john','smith.qt','dessjohn',0,NULL),(33,'436643196120','sqasdt.q3.net','N/A',1,'6'),(28,'436642900019','sqasdt.q3.net','N/A',0,'6'),(30,'436462900209','sqasdt.q3.net','N/A',0,'6'),(16,'436640006666','sqasdt.q3.net','',0,NULL),(19,'dette','el-redun.com','dessdette',0,NULL),(12,'quad_kattPP','q3.net','acne',2,NULL),(14,'436640008888','sqasdt.q3.net','',0,NULL),(29,'463624900028','sqasdt.q3.net','N/A',0,'6'),(15,'436640099099','sqasdt.q3.net','',0,NULL),(13,'pap','q3plus.qt','acne',1,NULL),(19,'436642612091','sqasdt.q3.net','N/A',0,'6'),(12,'quad_katt','q3.net','acne',0,NULL),(11,'quad_kattVK','q3.net','acne',1,NULL),(32000,'463641969502','sqasdt.q3.net','N/A',1,'6'),(20,'joe','q3.net','joedesswd',0,NULL),(290000000,'436642900034','sqasdt.q3.net','N/A',0,'6'),(25,'contind','armerde.qt','acne',1,NULL);
+CREATE TABLE `t5_c` (
+`capfa` bigint(20) unsigned NOT NULL default '0',
+`gotod` smallint(5) unsigned NOT NULL default '0',
+`orderutonsa` varchar(64) NOT NULL default '',
+PRIMARY KEY (`capfa`,`gotod`,`orderutonsa`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
+INSERT INTO `t5_c` VALUES (21,2,''),(21,1,''),(22,4,'');
+CREATE TABLE `t6_c` (
+`capfa_parent` bigint(20) unsigned NOT NULL default '0',
+`capfa_child` bigint(20) unsigned NOT NULL default '0',
+`relatta` smallint(5) unsigned NOT NULL default '0',
+PRIMARY KEY (`capfa_child`,`capfa_parent`,`relatta`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
+INSERT INTO `t6_c` VALUES (15,16,0),(19,20,0),(18326932092909551615,30,0),(26,29,0),(18326932092909551615,29,0),(19,18,0),(26,28,0),(12,14,0);
+CREATE TABLE `t7_c` (
+`dardpo` char(15) NOT NULL default '',
+`dardtestard` tinyint(3) unsigned NOT NULL auto_increment,
+`FastFA` char(5) NOT NULL default '',
+`FastCode` char(6) NOT NULL default '',
+`Fastca` char(1) NOT NULL default '',
+`Fastmag` char(1) NOT NULL default '',
+`Beareratta` char(2) NOT NULL default '',
+PRIMARY KEY (`dardpo`,`dardtestard`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
+INSERT INTO `t7_c` VALUES ('2.6.2.4',24,'CECHP','54545','0','0','5'),('2.2.5.4',26,'CANFA','33223','1','1','4'),('4.3.2.4',28,'ITALD','54222','1','0','5'),('129..0.0.eins',28,'G','99999','1','1','5'),('1.1.1.1',24,'AUTPT','32323','0','1','3');
+CREATE TABLE `t8_c` (
+`kattjame` varchar(32) NOT NULL default '',
+`realm` varchar(32) NOT NULL default '',
+`realm_entered` varchar(32) NOT NULL default '',
+`maturegarbagefa` varchar(32) NOT NULL default '',
+`hunderaaarbagefa_parent` varchar(32) NOT NULL default '',
+`kattjame_entered` varchar(32) NOT NULL default '',
+`hunderaaarbagefa` varchar(32) NOT NULL default '',
+`gest` varchar(16) default NULL,
+`hassetino` varchar(16) NOT NULL default '',
+`aaaproxysessfa` varchar(255) default NULL,
+`autologonallowed` char(1) default NULL,
+`squardporoot` varchar(15) NOT NULL default '',
+`naspo` varchar(15) default NULL,
+`beareratta` char(2) default NULL,
+`fastCode` varchar(6) default NULL,
+`fastFA` varchar(5) default NULL,
+`fastca` char(1) default NULL,
+`fastmag` char(1) default NULL,
+`lastupdate` datetime default NULL,
+`hassetistart` datetime NOT NULL default '0000-00-00 00:00:00',
+`accthassetitime` int(10) unsigned default NULL,
+`acctoutputoctets` bigint(20) unsigned default NULL,
+`acctinputoctets` bigint(20) unsigned default NULL,
+PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`),
+KEY `squardporoot` (`squardporoot`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
+INSERT INTO `t8_c` VALUES ('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643196120','436643196929','8956234534568968','5524595699','uxasmt21.net.acne.qt/481889229462692422','','1.1.1.1','2.2.4.6','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565),('4545435545','john','q3.net','q3.net','acne.li','436643196120','436643196929','45345234568968','995696699','uxasmt21.net.acne.qt/481889229462692423','','1.1.1.1','2.2.9.8','2','86989','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8821923,169,3565),('versteckter_q3net_katt','joe','q3.net','elredun.com','q3.net','436643196120','436643196939','91341234568968','695595699','uxasmt21.net.acne.qt/481889229462692421','','1.1.1.1','2.5.2.5','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',1923123,9569,6565);
+CREATE TABLE `t9_c` (
+`kattjame` varchar(32) NOT NULL default '',
+`kattjame_entered` varchar(32) NOT NULL default '',
+`realm` varchar(32) NOT NULL default '',
+`realm_entered` varchar(32) NOT NULL default '',
+`maturegarbagefa` varchar(32) NOT NULL default '',
+`hunderaaarbagefa` varchar(32) NOT NULL default '',
+`hunderaaarbagefa_parent` varchar(32) NOT NULL default '',
+`gest` varchar(16) default NULL,
+`hassetino` varchar(16) NOT NULL default '',
+`squardporoot` varchar(15) NOT NULL default '',
+`naspo` varchar(15) default NULL,
+`beareratta` char(2) default NULL,
+`fastCode` varchar(6) default NULL,
+`fastFA` varchar(5) default NULL,
+`fastca` char(1) default NULL,
+`fastmag` char(1) default NULL,
+`lastupdate` datetime default NULL,
+`hassetistart` datetime NOT NULL default '0000-00-00 00:00:00',
+`accthassetitime` int(10) unsigned default NULL,
+`actcoutpuocttets` bigint(20) unsigned default NULL,
+`actinputocctets` bigint(20) unsigned default NULL,
+`terminateraste` tinyint(3) unsigned default NULL,
+PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
+INSERT INTO `t9_c` VALUES ('3g4jh8gar2t','joe','q3.net','elredun.com','q3.net','436643316120','436643316939','91341234568968','695595699','1.1.1.1','2.2.6.2','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',3123123,9569,6565,1),('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643316120','436643316939','8956234534568968','5254595969','1.1.1.1','8.6.2.2','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565,2),('4545435545','john','q3.net','q3.net','acne.li','436643316120','436643316939','45345234568968','995696699','1.1.1.1','2.9.9.2','2','86998','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8823123,169,3565,3);
+CREATE TABLE t10_c (a INT AUTO_INCREMENT KEY) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
+INSERT INTO t10_c VALUES (1),(2),(3);
+insert into t10_c values (10000),(2000),(3000);
+create table t1 engine=myisam as select * from t1_c;
+create table t2 engine=myisam as select * from t2_c;
+create table t3 engine=myisam as select * from t3_c;
+create table t4 engine=myisam as select * from t4_c;
+create table t5 engine=myisam as select * from t5_c;
+create table t6 engine=myisam as select * from t6_c;
+create table t7 engine=myisam as select * from t7_c;
+create table t8 engine=myisam as select * from t8_c;
+create table t9 engine=myisam as select * from t9_c;
+create table t10 engine=myisam as select * from t10_c;
+ForceVarPart: 0
+ForceVarPart: 1
+CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
+DELETE FROM test.backup_info;
+LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
+SELECT @the_backup_id:=backup_id FROM test.backup_info;
+@the_backup_id:=backup_id
+<the_backup_id>
+DROP TABLE test.backup_info;
+drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
+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
+select count(*) from t1;
+count(*)
+5
+select count(*) from t1_c;
+count(*)
+5
+select count(*)
+from (select * from t1 union
+select * from t1_c) a;
+count(*)
+5
+select count(*) from t2;
+count(*)
+7
+select count(*) from t2_c;
+count(*)
+7
+select count(*)
+from (select * from t2 union
+select * from t2_c) a;
+count(*)
+7
+select count(*) from t3;
+count(*)
+4
+select count(*) from t3_c;
+count(*)
+4
+select count(*)
+from (select * from t3 union
+select * from t3_c) a;
+count(*)
+4
+select count(*) from t4;
+count(*)
+22
+select count(*) from t4_c;
+count(*)
+22
+select count(*)
+from (select * from t4 union
+select * from t4_c) a;
+count(*)
+22
+select count(*) from t5;
+count(*)
+3
+select count(*) from t5_c;
+count(*)
+3
+select count(*)
+from (select * from t5 union
+select * from t5_c) a;
+count(*)
+3
+select count(*) from t6;
+count(*)
+8
+select count(*) from t6_c;
+count(*)
+8
+select count(*)
+from (select * from t6 union
+select * from t6_c) a;
+count(*)
+8
+select count(*) from t7;
+count(*)
+5
+select count(*) from t7_c;
+count(*)
+5
+select count(*)
+from (select * from t7 union
+select * from t7_c) a;
+count(*)
+5
+select count(*) from t8;
+count(*)
+3
+select count(*) from t8_c;
+count(*)
+3
+select count(*)
+from (select * from t8 union
+select * from t8_c) a;
+count(*)
+3
+select count(*) from t9;
+count(*)
+3
+select count(*) from t9_c;
+count(*)
+3
+select count(*)
+from (select * from t9 union
+select * from t9_c) a;
+count(*)
+3
+select * from t10_c order by a;
+a
+1
+2
+3
+2000
+3000
+10000
+show table status like 't1_c';
+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
+X X X X X X X X X X 3001 X X X X X X X
+show table status like 't2_c';
+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
+X X X X X X X X X X 501 X X X X X X X
+show table status like 't4_c';
+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
+X X X X X X X X X X 290000001 X X X X X X X
+show table status like 't7_c';
+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
+X X X X X X X X X X 29 X X X X X X X
+show table status like 't10_c';
+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
+X X X X X X X X X X 10001 X X X X X X X
+ALTER TABLE t7_c
+PARTITION BY LINEAR KEY (`dardtestard`);
+CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
+DELETE FROM test.backup_info;
+LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
+SELECT @the_backup_id:=backup_id FROM test.backup_info;
+@the_backup_id:=backup_id
+<the_backup_id>
+DROP TABLE test.backup_info;
+drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
+select count(*) from t1;
+count(*)
+5
+select count(*) from t1_c;
+count(*)
+5
+select count(*)
+from (select * from t1 union
+select * from t1_c) a;
+count(*)
+5
+select count(*) from t2;
+count(*)
+7
+select count(*) from t2_c;
+count(*)
+7
+select count(*)
+from (select * from t2 union
+select * from t2_c) a;
+count(*)
+7
+select count(*) from t3;
+count(*)
+4
+select count(*) from t3_c;
+count(*)
+4
+select count(*)
+from (select * from t3 union
+select * from t3_c) a;
+count(*)
+4
+select count(*) from t4;
+count(*)
+22
+select count(*) from t4_c;
+count(*)
+22
+select count(*)
+from (select * from t4 union
+select * from t4_c) a;
+count(*)
+22
+select count(*) from t5;
+count(*)
+3
+select count(*) from t5_c;
+count(*)
+3
+select count(*)
+from (select * from t5 union
+select * from t5_c) a;
+count(*)
+3
+select count(*) from t6;
+count(*)
+8
+select count(*) from t6_c;
+count(*)
+8
+select count(*)
+from (select * from t6 union
+select * from t6_c) a;
+count(*)
+8
+select count(*) from t7;
+count(*)
+5
+select count(*) from t7_c;
+count(*)
+5
+select count(*)
+from (select * from t7 union
+select * from t7_c) a;
+count(*)
+5
+select count(*) from t8;
+count(*)
+3
+select count(*) from t8_c;
+count(*)
+3
+select count(*)
+from (select * from t8 union
+select * from t8_c) a;
+count(*)
+3
+select count(*) from t9;
+count(*)
+3
+select count(*) from t9_c;
+count(*)
+3
+select count(*)
+from (select * from t9 union
+select * from t9_c) a;
+count(*)
+3
+drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
+select count(*) from t1;
+count(*)
+5
+select count(*) from t1_c;
+count(*)
+5
+select count(*)
+from (select * from t1 union
+select * from t1_c) a;
+count(*)
+5
+select count(*) from t2;
+count(*)
+7
+select count(*) from t2_c;
+count(*)
+7
+select count(*)
+from (select * from t2 union
+select * from t2_c) a;
+count(*)
+7
+select count(*) from t3;
+count(*)
+4
+select count(*) from t3_c;
+count(*)
+4
+select count(*)
+from (select * from t3 union
+select * from t3_c) a;
+count(*)
+4
+select count(*) from t4;
+count(*)
+22
+select count(*) from t4_c;
+count(*)
+22
+select count(*)
+from (select * from t4 union
+select * from t4_c) a;
+count(*)
+22
+select count(*) from t5;
+count(*)
+3
+select count(*) from t5_c;
+count(*)
+3
+select count(*)
+from (select * from t5 union
+select * from t5_c) a;
+count(*)
+3
+select count(*) from t6;
+count(*)
+8
+select count(*) from t6_c;
+count(*)
+8
+select count(*)
+from (select * from t6 union
+select * from t6_c) a;
+count(*)
+8
+select count(*) from t7;
+count(*)
+5
+select count(*) from t7_c;
+count(*)
+5
+select count(*)
+from (select * from t7 union
+select * from t7_c) a;
+count(*)
+5
+select count(*) from t8;
+count(*)
+3
+select count(*) from t8_c;
+count(*)
+3
+select count(*)
+from (select * from t8 union
+select * from t8_c) a;
+count(*)
+3
+select count(*) from t9;
+count(*)
+3
+select count(*) from t9_c;
+count(*)
+3
+select count(*)
+from (select * from t9 union
+select * from t9_c) a;
+count(*)
+3
+drop table t1_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
+CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
+DELETE FROM test.backup_info;
+LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
+SELECT @the_backup_id:=backup_id FROM test.backup_info;
+@the_backup_id:=backup_id
+<the_backup_id>
+DROP TABLE test.backup_info;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
+drop table if exists t2_c;
+520093696,<the_backup_id>
diff --git a/mysql-test/suite/ndb/r/ndb_restore_compat.result b/mysql-test/suite/ndb/r/ndb_restore_compat.result
new file mode 100644
index 00000000000..f2630573220
--- /dev/null
+++ b/mysql-test/suite/ndb/r/ndb_restore_compat.result
@@ -0,0 +1,119 @@
+DROP DATABASE IF EXISTS BANK;
+CREATE DATABASE BANK default charset=latin1 default collate=latin1_bin;
+USE BANK;
+SHOW TABLES;
+Tables_in_BANK
+ACCOUNT
+GL
+ACCOUNT_TYPE
+TRANSACTION
+SYSTEM_VALUES
+SELECT * FROM GL ORDER BY TIME,ACCOUNT_TYPE;
+TIME ACCOUNT_TYPE BALANCE DEPOSIT_COUNT DEPOSIT_SUM WITHDRAWAL_COUNT WITHDRAWAL_SUM PURGED
+0 0 10000000 0 0 0 0 1
+0 1 30000 0 0 0 0 1
+0 2 20000 0 0 0 0 1
+0 3 20000 0 0 0 0 1
+0 4 20000 0 0 0 0 1
+1 0 10000000 0 0 0 0 0
+1 1 30000 0 0 0 0 0
+1 2 20000 0 0 0 0 0
+1 3 20000 0 0 0 0 0
+1 4 20000 0 0 0 0 0
+2 0 9981761 17 80457 19 98696 0
+2 1 17823 55 203688 46 215865 0
+2 2 47056 33 159275 33 132219 0
+2 3 15719 26 126833 29 131114 0
+2 4 27641 32 133459 36 125818 0
+SELECT * FROM ACCOUNT ORDER BY ACCOUNT_ID;
+ACCOUNT_ID OWNER BALANCE ACCOUNT_TYPE
+0 0 9863546 0
+1 3001 12885 1
+2 3002 11012 2
+3 3003 32789 3
+4 3004 10992 4
+5 3005 2247 1
+6 3006 3170 1
+7 3007 60321 2
+8 3008 30508 3
+9 3009 62530 4
+SELECT COUNT(*) FROM TRANSACTION;
+COUNT(*)
+3444
+SELECT * FROM SYSTEM_VALUES ORDER BY SYSTEM_VALUES_ID;
+SYSTEM_VALUES_ID VALUE
+0 2039
+1 3
+SELECT * FROM mysql.ndb_apply_status WHERE server_id=0;
+server_id epoch log_name start_pos end_pos
+0 151 0 0
+ForceVarPart: 1
+ForceVarPart: 1
+ForceVarPart: 1
+ForceVarPart: 1
+ForceVarPart: 1
+TRUNCATE GL;
+TRUNCATE ACCOUNT;
+TRUNCATE TRANSACTION;
+TRUNCATE SYSTEM_VALUES;
+TRUNCATE ACCOUNT_TYPE;
+ForceVarPart: 1
+ForceVarPart: 1
+ForceVarPart: 1
+ForceVarPart: 1
+ForceVarPart: 1
+SELECT * FROM GL ORDER BY TIME,ACCOUNT_TYPE;
+TIME ACCOUNT_TYPE BALANCE DEPOSIT_COUNT DEPOSIT_SUM WITHDRAWAL_COUNT WITHDRAWAL_SUM PURGED
+0 0 10000000 0 0 0 0 1
+0 1 30000 0 0 0 0 1
+0 2 20000 0 0 0 0 1
+0 3 20000 0 0 0 0 1
+0 4 20000 0 0 0 0 1
+1 0 10000000 0 0 0 0 1
+1 1 30000 0 0 0 0 1
+1 2 20000 0 0 0 0 1
+1 3 20000 0 0 0 0 1
+1 4 20000 0 0 0 0 1
+2 0 10000000 0 0 0 0 1
+2 1 30000 0 0 0 0 1
+2 2 20000 0 0 0 0 1
+2 3 20000 0 0 0 0 1
+2 4 20000 0 0 0 0 1
+3 0 9963591 14 59111 19 95520 0
+3 1 44264 49 255559 53 241295 0
+3 2 25515 39 177806 36 172291 0
+3 3 16779 26 129200 29 132421 0
+3 4 39851 43 182771 34 162920 0
+4 0 9733661 141 632616 162 862546 0
+4 1 63853 426 2005337 415 1985748 0
+4 2 140473 314 1548632 297 1433674 0
+4 3 13481 310 1528043 324 1531341 0
+4 4 138532 316 1540206 309 1441525 0
+SELECT * FROM ACCOUNT ORDER BY ACCOUNT_ID;
+ACCOUNT_ID OWNER BALANCE ACCOUNT_TYPE
+0 0 9679579 0
+1 3001 18130 1
+2 3002 12318 2
+3 3003 3049 3
+4 3004 39517 4
+5 3005 37051 1
+6 3006 144497 1
+7 3007 130670 2
+8 3008 13747 3
+9 3009 11442 4
+SELECT COUNT(*) FROM TRANSACTION;
+COUNT(*)
+4056
+SELECT * FROM SYSTEM_VALUES ORDER BY SYSTEM_VALUES_ID;
+SYSTEM_VALUES_ID VALUE
+0 2297
+1 5
+SELECT * FROM mysql.ndb_apply_status WHERE server_id=0;
+server_id epoch log_name start_pos end_pos
+0 331 0 0
+SELECT * FROM DESCRIPTION ORDER BY USERNAME;
+USERNAME ADDRESS
+Guangbao Ni Suite 503, 5F NCI Tower, A12 Jianguomenwai Avenue Chaoyang District, Beijing, 100022 PRC
+USERNAME Varchar(255;latin1_swedish_ci) NULL AT=SHORT_VAR ST=MEMORY
+ADDRESS Longvarchar(2002;latin1_swedish_ci) NULL AT=MEDIUM_VAR ST=MEMORY
+DROP DATABASE BANK;
diff --git a/mysql-test/suite/ndb/r/ndb_restore_different_endian_data.result b/mysql-test/suite/ndb/r/ndb_restore_different_endian_data.result
new file mode 100644
index 00000000000..e552de8d854
--- /dev/null
+++ b/mysql-test/suite/ndb/r/ndb_restore_different_endian_data.result
@@ -0,0 +1,200 @@
+USE test;
+DROP TABLE IF EXISTS t_num,t_datetime,t_string_1,t_string_2,t_gis;
+SHOW TABLES;
+Tables_in_test
+t_gis
+t_string_1
+t_datetime
+t_num
+t_string_2
+SHOW CREATE TABLE t_num;
+Table Create Table
+t_num CREATE TABLE `t_num` (
+ `t_pk` int(11) NOT NULL,
+ `t_bit` bit(64) DEFAULT NULL,
+ `t_tinyint` tinyint(4) DEFAULT NULL,
+ `t_bool` tinyint(1) DEFAULT NULL,
+ `t_smallint` smallint(6) DEFAULT NULL,
+ `t_mediumint` mediumint(9) DEFAULT NULL,
+ `t_int` int(11) DEFAULT NULL,
+ `t_bigint` bigint(20) DEFAULT NULL,
+ `t_float` float DEFAULT NULL,
+ `t_double` double DEFAULT NULL,
+ `t_decimal` decimal(37,16) DEFAULT NULL,
+ PRIMARY KEY (`t_pk`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t_datetime;
+Table Create Table
+t_datetime CREATE TABLE `t_datetime` (
+ `t_pk` int(11) NOT NULL,
+ `t_date` date DEFAULT NULL,
+ `t_datetime` datetime DEFAULT NULL,
+ `t_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `t_time` time DEFAULT NULL,
+ `t_year` year(4) DEFAULT NULL,
+ PRIMARY KEY (`t_pk`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t_string_1;
+Table Create Table
+t_string_1 CREATE TABLE `t_string_1` (
+ `t_pk` int(11) NOT NULL,
+ `t_char` char(255) DEFAULT NULL,
+ `t_varchar` varchar(655) DEFAULT NULL,
+ `t_binary` binary(255) DEFAULT NULL,
+ `t_varbinary` varbinary(6553) DEFAULT NULL,
+ PRIMARY KEY (`t_pk`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t_string_2;
+Table Create Table
+t_string_2 CREATE TABLE `t_string_2` (
+ `t_pk` int(11) NOT NULL,
+ `t_tinyblob` tinyblob,
+ `t_tinytext` tinytext,
+ `t_blob` blob,
+ `t_text` text,
+ `t_mediumblob` mediumblob,
+ `t_mediumtext` mediumtext,
+ `t_longblob` longblob,
+ `t_longtext` longtext,
+ `t_enum` enum('001001','001004','001010','001018','001019','001020','001021','001027','001028','001029','001030','001031','001100','002003','002004','002005','002007') NOT NULL DEFAULT '001001',
+ `t_set` set('a','B') DEFAULT NULL,
+ PRIMARY KEY (`t_pk`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t_gis;
+Table Create Table
+t_gis CREATE TABLE `t_gis` (
+ `t_pk` int(11) NOT NULL,
+ `t_point` point DEFAULT NULL,
+ `t_linestring` linestring DEFAULT NULL,
+ `t_polygon` polygon DEFAULT NULL,
+ `t_multipoint` multipoint DEFAULT NULL,
+ `t_multilinestring` multilinestring DEFAULT NULL,
+ `t_multipolygon` multipolygon DEFAULT NULL,
+ `t_geometrycollection` geometrycollection DEFAULT NULL,
+ `t_geometry` geometry DEFAULT NULL,
+ PRIMARY KEY (`t_pk`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+SELECT * FROM t_datetime;
+t_pk t_date t_datetime t_timestamp t_time t_year
+1 1998-01-01 2006-08-10 10:11:12 2002-10-29 16:51:06 19:38:34 2155
+SELECT t_pk,hex(t_bit),t_tinyint,t_bool,t_smallint,t_mediumint,t_int,t_bigint,t_float,t_double,t_decimal FROM t_num;
+t_pk hex(t_bit) t_tinyint t_bool t_smallint t_mediumint t_int t_bigint t_float t_double t_decimal
+1 AAAAAAAAAAAAAAAA 125 1 32765 8388606 2147483647 9223372036854775807 1e+20 1e+150 331.0000000000000000
+SELECT t_pk,t_char,t_varchar,hex(t_binary),hex(t_varbinary) FROM t_string_1;
+t_pk t_char t_varchar hex(t_binary) hex(t_varbinary)
+1 abcdefghijklmn abcdefghijklmnabcdefghijklmnabcdefghijklmnabcdefghijklmn 612020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 4100
+SELECT * FROM t_string_2;
+t_pk t_tinyblob t_tinytext t_blob t_text t_mediumblob t_mediumtext t_longblob t_longtext t_enum t_set
+1 abcdefghijklmnabcdefghijklmn abcdefghijklmnabcdefghijklmn a123456789b123456789c123456789d123456789e123456789f123456789g123456789 a123456789b123456789c123456789d123456789e123456789f123456789g123456789 a123456789b123456789c123456789d123456789e123456789f123456789g123456789 a123456789b123456789c123456789d123456789e123456789f123456789g123456789 a123456789b123456789c123456789d123456789e123456789f123456789g123456789 a123456789b123456789c123456789d123456789e123456789f123456789g123456789 001001 a
+SELECT AsText(t_point), AsText(t_linestring),AsText(t_polygon) FROM t_gis ORDER by t_pk;
+AsText(t_point) AsText(t_linestring) AsText(t_polygon)
+POINT(10 10) LINESTRING(10 10,20 10,20 20,10 20,10 10) POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10))
+POINT(10 20) LINESTRING(10 10,40 10) POLYGON((0 0,30 0,30 30,0 0))
+SELECT AsText(t_multipoint), AsText(t_multilinestring),AsText(t_multipolygon) FROM t_gis ORDER by t_pk;
+AsText(t_multipoint) AsText(t_multilinestring) AsText(t_multipolygon)
+MULTIPOINT(1 1,11 11,11 21,21 21) MULTILINESTRING((10 48,10 21,10 0)) MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+MULTIPOINT(3 6,4 10) MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7)) MULTIPOLYGON(((0 3,3 3,3 0,0 3)))
+SELECT AsText(t_geometrycollection), AsText(t_geometry) FROM t_gis ORDER by t_pk;
+AsText(t_geometrycollection) AsText(t_geometry)
+GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9)) GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9))
+DROP TABLE t_num,t_datetime,t_string_1,t_string_2,t_gis;
+SHOW TABLES;
+Tables_in_test
+t_gis
+t_string_1
+t_datetime
+t_num
+t_string_2
+SHOW CREATE TABLE t_num;
+Table Create Table
+t_num CREATE TABLE `t_num` (
+ `t_pk` int(11) NOT NULL,
+ `t_bit` bit(64) DEFAULT NULL,
+ `t_tinyint` tinyint(4) DEFAULT NULL,
+ `t_bool` tinyint(1) DEFAULT NULL,
+ `t_smallint` smallint(6) DEFAULT NULL,
+ `t_mediumint` mediumint(9) DEFAULT NULL,
+ `t_int` int(11) DEFAULT NULL,
+ `t_bigint` bigint(20) DEFAULT NULL,
+ `t_float` float DEFAULT NULL,
+ `t_double` double DEFAULT NULL,
+ `t_decimal` decimal(37,16) DEFAULT NULL,
+ PRIMARY KEY (`t_pk`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t_datetime;
+Table Create Table
+t_datetime CREATE TABLE `t_datetime` (
+ `t_pk` int(11) NOT NULL,
+ `t_date` date DEFAULT NULL,
+ `t_datetime` datetime DEFAULT NULL,
+ `t_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `t_time` time DEFAULT NULL,
+ `t_year` year(4) DEFAULT NULL,
+ PRIMARY KEY (`t_pk`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t_string_1;
+Table Create Table
+t_string_1 CREATE TABLE `t_string_1` (
+ `t_pk` int(11) NOT NULL,
+ `t_char` char(255) DEFAULT NULL,
+ `t_varchar` varchar(655) DEFAULT NULL,
+ `t_binary` binary(255) DEFAULT NULL,
+ `t_varbinary` varbinary(6553) DEFAULT NULL,
+ PRIMARY KEY (`t_pk`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t_string_2;
+Table Create Table
+t_string_2 CREATE TABLE `t_string_2` (
+ `t_pk` int(11) NOT NULL,
+ `t_tinyblob` tinyblob,
+ `t_tinytext` tinytext,
+ `t_blob` blob,
+ `t_text` text,
+ `t_mediumblob` mediumblob,
+ `t_mediumtext` mediumtext,
+ `t_longblob` longblob,
+ `t_longtext` longtext,
+ `t_enum` enum('001001','001004','001010','001018','001019','001020','001021','001027','001028','001029','001030','001031','001100','002003','002004','002005','002007') NOT NULL DEFAULT '001001',
+ `t_set` set('a','B') DEFAULT NULL,
+ PRIMARY KEY (`t_pk`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t_gis;
+Table Create Table
+t_gis CREATE TABLE `t_gis` (
+ `t_pk` int(11) NOT NULL,
+ `t_point` point DEFAULT NULL,
+ `t_linestring` linestring DEFAULT NULL,
+ `t_polygon` polygon DEFAULT NULL,
+ `t_multipoint` multipoint DEFAULT NULL,
+ `t_multilinestring` multilinestring DEFAULT NULL,
+ `t_multipolygon` multipolygon DEFAULT NULL,
+ `t_geometrycollection` geometrycollection DEFAULT NULL,
+ `t_geometry` geometry DEFAULT NULL,
+ PRIMARY KEY (`t_pk`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+SELECT * FROM t_datetime;
+t_pk t_date t_datetime t_timestamp t_time t_year
+1 1998-01-01 2006-08-10 10:11:12 2002-10-29 16:51:06 19:38:34 2155
+SELECT t_pk,hex(t_bit),t_tinyint,t_bool,t_smallint,t_mediumint,t_int,t_bigint,t_float,t_double,t_decimal FROM t_num;
+t_pk hex(t_bit) t_tinyint t_bool t_smallint t_mediumint t_int t_bigint t_float t_double t_decimal
+1 AAAAAAAAAAAAAAAA 125 1 32765 8388606 2147483647 9223372036854775807 1e+20 1e+150 331.0000000000000000
+SELECT t_pk,t_char,t_varchar,hex(t_binary),hex(t_varbinary) FROM t_string_1;
+t_pk t_char t_varchar hex(t_binary) hex(t_varbinary)
+1 abcdefghijklmn abcdefghijklmnabcdefghijklmnabcdefghijklmnabcdefghijklmn 612020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 4100
+SELECT * FROM t_string_2;
+t_pk t_tinyblob t_tinytext t_blob t_text t_mediumblob t_mediumtext t_longblob t_longtext t_enum t_set
+1 abcdefghijklmnabcdefghijklmn abcdefghijklmnabcdefghijklmn a123456789b123456789c123456789d123456789e123456789f123456789g123456789 a123456789b123456789c123456789d123456789e123456789f123456789g123456789 a123456789b123456789c123456789d123456789e123456789f123456789g123456789 a123456789b123456789c123456789d123456789e123456789f123456789g123456789 a123456789b123456789c123456789d123456789e123456789f123456789g123456789 a123456789b123456789c123456789d123456789e123456789f123456789g123456789 001001 a
+SELECT AsText(t_point), AsText(t_linestring),AsText(t_polygon) FROM t_gis ORDER by t_pk;
+AsText(t_point) AsText(t_linestring) AsText(t_polygon)
+POINT(10 10) LINESTRING(10 10,20 10,20 20,10 20,10 10) POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10))
+POINT(10 20) LINESTRING(10 10,40 10) POLYGON((0 0,30 0,30 30,0 0))
+SELECT AsText(t_multipoint), AsText(t_multilinestring),AsText(t_multipolygon) FROM t_gis ORDER by t_pk;
+AsText(t_multipoint) AsText(t_multilinestring) AsText(t_multipolygon)
+MULTIPOINT(1 1,11 11,11 21,21 21) MULTILINESTRING((10 48,10 21,10 0)) MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+MULTIPOINT(3 6,4 10) MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7)) MULTIPOLYGON(((0 3,3 3,3 0,0 3)))
+SELECT AsText(t_geometrycollection), AsText(t_geometry) FROM t_gis ORDER by t_pk;
+AsText(t_geometrycollection) AsText(t_geometry)
+GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9)) GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9))
+DROP TABLE t_num,t_datetime,t_string_1,t_string_2,t_gis;
diff --git a/mysql-test/r/ndb_restore_partition.result b/mysql-test/suite/ndb/r/ndb_restore_partition.result
index 7dc4057e615..7dc4057e615 100644
--- a/mysql-test/r/ndb_restore_partition.result
+++ b/mysql-test/suite/ndb/r/ndb_restore_partition.result
diff --git a/mysql-test/r/ndb_restore_print.result b/mysql-test/suite/ndb/r/ndb_restore_print.result
index e05f8e43d1a..e05f8e43d1a 100644
--- a/mysql-test/r/ndb_restore_print.result
+++ b/mysql-test/suite/ndb/r/ndb_restore_print.result
diff --git a/mysql-test/suite/ndb/r/ndb_row_format.result b/mysql-test/suite/ndb/r/ndb_row_format.result
new file mode 100644
index 00000000000..ea495e7e9c5
--- /dev/null
+++ b/mysql-test/suite/ndb/r/ndb_row_format.result
@@ -0,0 +1,65 @@
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7;
+drop database if exists mysqltest;
+CREATE TABLE t1
+( a INT KEY,
+b VARCHAR(10) )
+ROW_FORMAT=FIXED
+ENGINE=NDB;
+ERROR HY000: Can't create table 'test.t1' (errno: 138)
+SHOW WARNINGS;
+Level Code Message
+Error 1477 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,
+b INT )
+ENGINE=NDB;
+ForceVarPart: 1
+DROP TABLE t1;
+CREATE TABLE t1
+( a INT KEY,
+b INT )
+ROW_FORMAT=DEFAULT
+ENGINE=NDB;
+ForceVarPart: 1
+DROP TABLE t1;
+CREATE TABLE t1
+( a INT KEY,
+b INT )
+ROW_FORMAT=FIXED
+ENGINE=NDB;
+ForceVarPart: 0
+DROP TABLE t1;
+CREATE TABLE t1
+( a INT KEY,
+b INT )
+ROW_FORMAT=DYNAMIC
+ENGINE=NDB;
+ForceVarPart: 1
+DROP TABLE t1;
+create table t1 (a int auto_increment primary key, b varchar(1000)) engine = ndb;
+insert into t1(b) values ('0123456789');
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+insert into t1(b) select b from t1;
+select count(*) from t1;
+count(*)
+1024
+begin;
+update t1 set b = concat(b,b);
+update t1 set b = concat(b,b);
+update t1 set b = concat(b,b);
+update t1 set b = concat(b,b);
+update t1 set b = concat(b,b);
+rollback;
+select count(*),b from t1 group by b;
+count(*) b
+1024 0123456789
+drop table t1;
diff --git a/mysql-test/suite/ndb/r/ndb_single_user.result b/mysql-test/suite/ndb/r/ndb_single_user.result
new file mode 100644
index 00000000000..552629ae532
--- /dev/null
+++ b/mysql-test/suite/ndb/r/ndb_single_user.result
@@ -0,0 +1,119 @@
+use test;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
+create table t1 (a int key, b int unique, c int) engine ndb;
+ERROR HY000: Can't create table 'test.t1' (errno: 299)
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+INITIAL_SIZE 16M
+UNDO_BUFFER_SIZE = 1M
+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
+Error 1527 Failed to create LOGFILE GROUP
+create table t1 (a int key, b int unique, c int) engine ndb;
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+INITIAL_SIZE 16M
+UNDO_BUFFER_SIZE = 1M
+ENGINE=NDB;
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 12M
+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
+Error 1527 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
+Error 1528 Failed to drop LOGFILE GROUP
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 12M
+ENGINE NDB;
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile.dat'
+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
+Error 1532 Failed to alter: DROP DATAFILE
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile.dat'
+ENGINE NDB;
+DROP TABLESPACE ts1
+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
+Error 1528 Failed to drop TABLESPACE
+DROP TABLESPACE ts1
+ENGINE NDB;
+DROP LOGFILE GROUP lg1
+ENGINE =NDB;
+insert into t1 values (1,1,0),(2,2,0),(3,3,0),(4,4,0),(5,5,0),(6,6,0),(7,7,0),(8,8,0),(9,9,0),(10,10,0);
+create table t2 as select * from t1;
+select * from t1 where a = 1;
+a b c
+1 1 0
+select * from t1 where b = 4;
+a b c
+4 4 0
+select * from t1 where a > 4 order by a;
+a b c
+5 5 0
+6 6 0
+7 7 0
+8 8 0
+9 9 0
+10 10 0
+update t1 set b=102 where a = 2;
+update t1 set b=103 where b = 3;
+update t1 set b=b+100;
+update t1 set b=b+100 where a > 7;
+delete from t1;
+insert into t1 select * from t2;
+create unique index new_index on t1 (b,c);
+drop table t1;
+ERROR 42S02: Unknown table 't1'
+create index new_index_fail on t1 (c);
+ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from NDBCLUSTER
+insert into t1 values (21,21,0),(22,22,0),(23,23,0),(24,24,0),(25,25,0),(26,26,0),(27,27,0),(28,28,0),(29,29,0),(210,210,0);
+ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from NDBCLUSTER
+select * from t1 where a = 1;
+ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from NDBCLUSTER
+select * from t1 where b = 4;
+ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from NDBCLUSTER
+update t1 set b=102 where a = 2;
+ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from NDBCLUSTER
+update t1 set b=103 where b = 3;
+ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from NDBCLUSTER
+update t1 set b=b+100;
+ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from NDBCLUSTER
+update t1 set b=b+100 where a > 7;
+ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from NDBCLUSTER
+BEGIN;
+update t1 set b=b+100 where a=1;
+BEGIN;
+update t1 set b=b+100 where a=2;
+update t1 set b=b+100 where a=3;
+COMMIT;
+update t1 set b=b+100 where a=4;
+ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from NDBCLUSTER
+COMMIT;
+ERROR HY000: Got error 4350 'Transaction already aborted' from NDBCLUSTER
+create table t2 (a int) engine myisam;
+alter table t2 add column (b int);
+drop table t2;
+drop table t1;
diff --git a/mysql-test/suite/ndb/r/ndb_sp.result b/mysql-test/suite/ndb/r/ndb_sp.result
new file mode 100644
index 00000000000..dbd0325044d
--- /dev/null
+++ b/mysql-test/suite/ndb/r/ndb_sp.result
@@ -0,0 +1,44 @@
+drop table if exists t1;
+create table t1 (
+a int not null primary key,
+b int not null
+) engine=ndb;
+insert into t1 values (1,10), (2,20), (3,100), (4, 100);
+create procedure test_proc1 (in var_in int)
+begin
+select * from t1 where a = var_in;
+end;
+create procedure test_proc2 (out var_out int)
+begin
+select b from t1 where a = 1 into var_out;
+end;
+create procedure test_proc3 (inout var_inout int)
+begin
+select b from t1 where a = var_inout into var_inout;
+end;
+//
+call test_proc1(1);
+a b
+1 10
+call test_proc2(@test_var);
+select @test_var;
+@test_var
+10
+set @test_var = 1;
+call test_proc3(@test_var);
+select @test_var;
+@test_var
+10
+alter procedure test_proc1 comment 'new comment';
+show create procedure test_proc1;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+test_proc1 CREATE DEFINER=`root`@`localhost` PROCEDURE `test_proc1`(in var_in int)
+ COMMENT 'new comment'
+begin
+select * from t1 where a = var_in;
+end latin1 latin1_swedish_ci latin1_swedish_ci
+drop procedure test_proc1;
+drop procedure test_proc2;
+drop procedure test_proc3;
+drop table t1;
+End of 5.1 tests
diff --git a/mysql-test/r/ndb_subquery.result b/mysql-test/suite/ndb/r/ndb_subquery.result
index 45662882d3a..45662882d3a 100644
--- a/mysql-test/r/ndb_subquery.result
+++ b/mysql-test/suite/ndb/r/ndb_subquery.result
diff --git a/mysql-test/suite/ndb/r/ndb_temporary.result b/mysql-test/suite/ndb/r/ndb_temporary.result
new file mode 100644
index 00000000000..7b7740003af
--- /dev/null
+++ b/mysql-test/suite/ndb/r/ndb_temporary.result
@@ -0,0 +1,21 @@
+DROP TABLE IF EXISTS t1;
+create temporary table t1 (a int key) engine=ndb;
+ERROR HY000: Table storage engine 'ndbcluster' does not support the create option 'TEMPORARY'
+create temporary table t1 (a int key) engine=myisam;
+alter table t1 engine=ndb;
+ERROR HY000: Table storage engine 'ndbcluster' does not support the create option 'TEMPORARY'
+drop table t1;
+SET SESSION storage_engine=NDBCLUSTER;
+create table t1 (a int key);
+select engine from information_schema.tables where table_name = 't1';
+engine
+ndbcluster
+drop table t1;
+create temporary table t1 (a int key);
+show create table t1;
+Table Create Table
+t1 CREATE TEMPORARY TABLE `t1` (
+ `a` int(11) NOT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
diff --git a/mysql-test/r/ndb_transaction.result b/mysql-test/suite/ndb/r/ndb_transaction.result
index 691b91b1d36..691b91b1d36 100644
--- a/mysql-test/r/ndb_transaction.result
+++ b/mysql-test/suite/ndb/r/ndb_transaction.result
diff --git a/mysql-test/suite/ndb/r/ndb_trigger.result b/mysql-test/suite/ndb/r/ndb_trigger.result
new file mode 100644
index 00000000000..d074ad01c22
--- /dev/null
+++ b/mysql-test/suite/ndb/r/ndb_trigger.result
@@ -0,0 +1,315 @@
+drop table if exists t1, t2, t3, t4, t5;
+create table t1 (id int primary key, a int not null, b decimal (63,30) default 0) engine=ndb;
+create table t2 (op char(1), a int not null, b decimal (63,30)) engine=ndb;
+create table t3 engine=ndb select 1 as i;
+create table t4 (a int not null primary key, b int) engine=ndb;
+create table t5 (a int not null primary key, b int) engine=ndb;
+create trigger t1_bu before update on t1 for each row
+begin
+insert into t2 values ("u", old.a, old.b);
+set new.b = old.b + 10;
+end;//
+create trigger t1_bd before delete on t1 for each row
+begin
+insert into t2 values ("d", old.a, old.b);
+end;//
+create trigger t4_au after update on t4
+for each row begin
+update t5 set b = b+1;
+end;
+//
+create trigger t4_ad after delete on t4
+for each row begin
+update t5 set b = b+1;
+end;
+//
+insert into t1 values (1, 1, 1.05), (2, 2, 2.05), (3, 3, 3.05), (4, 4, 4.05);
+insert into t4 values (1,1), (2,2), (3,3), (4, 4);
+insert into t5 values (1,0);
+update t1 set a=5 where a != 3;
+select * from t1 order by id;
+id a b
+1 5 11.050000000000000000000000000000
+2 5 12.050000000000000000000000000000
+3 3 3.050000000000000000000000000000
+4 5 14.050000000000000000000000000000
+select * from t2 order by op, a, b;
+op a b
+u 1 1.050000000000000000000000000000
+u 2 2.050000000000000000000000000000
+u 4 4.050000000000000000000000000000
+delete from t2;
+update t1, t3 set a=6 where a = 5;
+select * from t1 order by id;
+id a b
+1 6 21.050000000000000000000000000000
+2 6 22.050000000000000000000000000000
+3 3 3.050000000000000000000000000000
+4 6 24.050000000000000000000000000000
+select * from t2 order by op, a, b;
+op a b
+u 5 11.050000000000000000000000000000
+u 5 12.050000000000000000000000000000
+u 5 14.050000000000000000000000000000
+delete from t2;
+delete from t1 where a != 3;
+select * from t1 order by id;
+id a b
+3 3 3.050000000000000000000000000000
+select * from t2 order by op, a, b;
+op a b
+d 6 21.050000000000000000000000000000
+d 6 22.050000000000000000000000000000
+d 6 24.050000000000000000000000000000
+delete from t2;
+insert into t1 values (1, 1, 1.05), (2, 2, 2.05), (4, 4, 4.05);
+delete t1 from t1, t3 where a != 3;
+select * from t1 order by id;
+id a b
+3 3 3.050000000000000000000000000000
+select * from t2 order by op, a, b;
+op a b
+d 1 1.050000000000000000000000000000
+d 2 2.050000000000000000000000000000
+d 4 4.050000000000000000000000000000
+delete from t2;
+insert into t1 values (4, 4, 4.05);
+insert into t1 (id, a) values (4, 1), (3, 1) on duplicate key update a= a + 1;
+select * from t1 order by id;
+id a b
+3 4 13.050000000000000000000000000000
+4 5 14.050000000000000000000000000000
+select * from t2 order by op, a, b;
+op a b
+u 3 3.050000000000000000000000000000
+u 4 4.050000000000000000000000000000
+delete from t2;
+delete from t3;
+insert into t3 values (4), (3);
+insert into t1 (id, a) (select i, 1 from t3) on duplicate key update a= a + 1;
+select * from t1 order by id;
+id a b
+3 5 23.050000000000000000000000000000
+4 6 24.050000000000000000000000000000
+select * from t2 order by op, a, b;
+op a b
+u 4 13.050000000000000000000000000000
+u 5 14.050000000000000000000000000000
+delete from t2;
+replace into t1 (id, a) values (4, 1), (3, 1);
+select * from t1 order by id;
+id a b
+3 1 0.000000000000000000000000000000
+4 1 0.000000000000000000000000000000
+select * from t2 order by op, a, b;
+op a b
+d 5 23.050000000000000000000000000000
+d 6 24.050000000000000000000000000000
+delete from t1;
+delete from t2;
+insert into t1 values (3, 1, 1.05), (4, 1, 2.05);
+replace into t1 (id, a) (select i, 2 from t3);
+select * from t1 order by id;
+id a b
+3 2 0.000000000000000000000000000000
+4 2 0.000000000000000000000000000000
+select * from t2 order by op, a, b;
+op a b
+d 1 1.050000000000000000000000000000
+d 1 2.050000000000000000000000000000
+delete from t1;
+delete from t2;
+insert into t1 values (3, 1, 1.05), (5, 2, 2.05);
+load data infile '../std_data_ln/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (id, a);
+select * from t1 order by id;
+id a b
+3 4 0.000000000000000000000000000000
+5 6 0.000000000000000000000000000000
+select * from t2 order by op, a, b;
+op a b
+d 1 1.050000000000000000000000000000
+d 2 2.050000000000000000000000000000
+update t4 set b = 10 where a = 1;
+select * from t5 order by a;
+a b
+1 1
+update t5 set b = 0;
+delete from t4 where a = 1;
+select * from t5 order by a;
+a b
+1 1
+drop trigger t4_au;
+drop trigger t4_ad;
+drop table t1, t2, t3, t4, t5;
+CREATE TABLE t1 (
+id INT NOT NULL PRIMARY KEY,
+xy INT
+) ENGINE=ndbcluster;
+INSERT INTO t1 VALUES (1, 0);
+CREATE TRIGGER t1_update AFTER UPDATE ON t1 FOR EACH ROW BEGIN REPLACE INTO t2 SELECT * FROM t1 WHERE t1.id = NEW.id; END //
+CREATE TABLE t2 (
+id INT NOT NULL PRIMARY KEY,
+xy INT
+) ENGINE=ndbcluster;
+INSERT INTO t2 VALUES (2, 0);
+CREATE TABLE t3 (id INT NOT NULL PRIMARY KEY) ENGINE=ndbcluster;
+INSERT INTO t3 VALUES (1);
+CREATE TABLE t4 LIKE t1;
+CREATE TRIGGER t4_update AFTER UPDATE ON t4 FOR EACH ROW BEGIN REPLACE INTO t5 SELECT * FROM t4 WHERE t4.id = NEW.id; END //
+CREATE TABLE t5 LIKE t2;
+UPDATE t1 SET xy = 3 WHERE id = 1;
+SELECT xy FROM t1 where id = 1;
+xy
+3
+SELECT xy FROM t2 where id = 1;
+xy
+3
+UPDATE t1 SET xy = 4 WHERE id IN (SELECT id FROM t3 WHERE id = 1);
+SELECT xy FROM t1 where id = 1;
+xy
+4
+SELECT xy FROM t2 where id = 1;
+xy
+4
+INSERT INTO t4 SELECT * FROM t1;
+INSERT INTO t5 SELECT * FROM t2;
+UPDATE t1,t4 SET t1.xy = 3, t4.xy = 3 WHERE t1.id = 1 AND t4.id = 1;
+SELECT xy FROM t1 where id = 1;
+xy
+3
+SELECT xy FROM t2 where id = 1;
+xy
+3
+SELECT xy FROM t4 where id = 1;
+xy
+3
+SELECT xy FROM t5 where id = 1;
+xy
+3
+UPDATE t1,t4 SET t1.xy = 4, t4.xy = 4 WHERE t1.id IN (SELECT id FROM t3 WHERE id = 1) AND t4.id IN (SELECT id FROM t3 WHERE id = 1);
+SELECT xy FROM t1 where id = 1;
+xy
+4
+SELECT xy FROM t2 where id = 1;
+xy
+4
+SELECT xy FROM t4 where id = 1;
+xy
+4
+SELECT xy FROM t5 where id = 1;
+xy
+4
+INSERT INTO t1 VALUES (1,0) ON DUPLICATE KEY UPDATE xy = 5;
+SELECT xy FROM t1 where id = 1;
+xy
+5
+SELECT xy FROM t2 where id = 1;
+xy
+5
+DROP TRIGGER t1_update;
+DROP TRIGGER t4_update;
+CREATE TRIGGER t1_delete AFTER DELETE ON t1 FOR EACH ROW BEGIN REPLACE INTO t2 SELECT * FROM t1 WHERE t1.id > 4; END //
+CREATE TRIGGER t4_delete AFTER DELETE ON t4 FOR EACH ROW BEGIN REPLACE INTO t5 SELECT * FROM t4 WHERE t4.id > 4; END //
+INSERT INTO t1 VALUES (5, 0),(6,0);
+INSERT INTO t2 VALUES (5, 1),(6,1);
+INSERT INTO t3 VALUES (5);
+SELECT * FROM t1 order by id;
+id xy
+1 5
+5 0
+6 0
+SELECT * FROM t2 order by id;
+id xy
+1 5
+2 0
+5 1
+6 1
+DELETE FROM t1 WHERE id IN (SELECT id FROM t3 WHERE id = 5);
+SELECT * FROM t1 order by id;
+id xy
+1 5
+6 0
+SELECT * FROM t2 order by id;
+id xy
+1 5
+2 0
+5 1
+6 0
+INSERT INTO t1 VALUES (5,0);
+UPDATE t2 SET xy = 1 WHERE id = 6;
+TRUNCATE t4;
+INSERT INTO t4 SELECT * FROM t1;
+TRUNCATE t5;
+INSERT INTO t5 SELECT * FROM t2;
+SELECT * FROM t1 order by id;
+id xy
+1 5
+5 0
+6 0
+SELECT * FROM t2 order by id;
+id xy
+1 5
+2 0
+5 1
+6 1
+SELECT * FROM t4 order by id;
+id xy
+1 5
+5 0
+6 0
+SELECT * FROM t5 order by id;
+id xy
+1 5
+2 0
+5 1
+6 1
+DELETE FROM t1,t4 USING t1,t3,t4 WHERE t1.id IN (SELECT id FROM t3 WHERE id = 5) AND t4.id IN (SELECT id FROM t3 WHERE id = 5);
+SELECT * FROM t1 order by id;
+id xy
+1 5
+6 0
+SELECT * FROM t2 order by id;
+id xy
+1 5
+2 0
+5 1
+6 0
+SELECT * FROM t4 order by id;
+id xy
+1 5
+6 0
+SELECT * FROM t5 order by id;
+id xy
+1 5
+2 0
+5 1
+6 0
+INSERT INTO t1 VALUES (5, 0);
+REPLACE INTO t2 VALUES (6,1);
+SELECT * FROM t1 order by id;
+id xy
+1 5
+5 0
+6 0
+SELECT * FROM t2 order by id;
+id xy
+1 5
+2 0
+5 1
+6 1
+REPLACE INTO t1 VALUES (5, 1);
+SELECT * FROM t1 order by id;
+id xy
+1 5
+5 1
+6 0
+SELECT * FROM t2 order by id;
+id xy
+1 5
+2 0
+5 1
+6 0
+DROP TRIGGER t1_delete;
+DROP TRIGGER t4_delete;
+DROP TABLE t1, t2, t3, t4, t5;
+End of 5.1 tests
diff --git a/mysql-test/r/ndb_truncate.result b/mysql-test/suite/ndb/r/ndb_truncate.result
index 811e5e3afeb..811e5e3afeb 100644
--- a/mysql-test/r/ndb_truncate.result
+++ b/mysql-test/suite/ndb/r/ndb_truncate.result
diff --git a/mysql-test/r/ndb_types.result b/mysql-test/suite/ndb/r/ndb_types.result
index ec2858d818a..ec2858d818a 100644
--- a/mysql-test/r/ndb_types.result
+++ b/mysql-test/suite/ndb/r/ndb_types.result
diff --git a/mysql-test/suite/ndb/r/ndb_update.result b/mysql-test/suite/ndb/r/ndb_update.result
new file mode 100644
index 00000000000..daea0e27a6a
--- /dev/null
+++ b/mysql-test/suite/ndb/r/ndb_update.result
@@ -0,0 +1,88 @@
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+CREATE TABLE t1 (
+pk1 INT NOT NULL PRIMARY KEY,
+b INT NOT NULL,
+c INT NOT NULL UNIQUE
+) ENGINE=ndbcluster;
+INSERT INTO t1 VALUES (0, 1, 0),(1,2,1),(2,3,2);
+UPDATE t1 set b = c;
+select * from t1 order by pk1;
+pk1 b c
+0 0 0
+1 1 1
+2 2 2
+UPDATE t1 set pk1 = 4 where pk1 = 1;
+select * from t1 order by pk1;
+pk1 b c
+0 0 0
+2 2 2
+4 1 1
+UPDATE t1 set pk1 = 4 where pk1 = 2;
+ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
+UPDATE IGNORE t1 set pk1 = 4 where pk1 = 2;
+select * from t1 order by pk1;
+pk1 b c
+0 0 0
+2 2 2
+4 1 1
+UPDATE t1 set pk1 = 1, c = 2 where pk1 = 4;
+ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
+UPDATE IGNORE t1 set pk1 = 1, c = 2 where pk1 = 4;
+select * from t1 order by pk1;
+pk1 b c
+0 0 0
+2 2 2
+4 1 1
+UPDATE t1 set pk1 = pk1 + 10;
+select * from t1 order by pk1;
+pk1 b c
+10 0 0
+12 2 2
+14 1 1
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a int, b int, KEY (a, b)) ENGINE=ndbcluster;
+CREATE TABLE t2 (a int, b int, UNIQUE KEY (a, b)) ENGINE=ndbcluster;
+CREATE TABLE t3 (a int, b int, PRIMARY KEY (a, b)) ENGINE=ndbcluster;
+INSERT INTO t1 VALUES (1, 2);
+INSERT INTO t1 VALUES (2, 2);
+INSERT INTO t2 VALUES (1, 2);
+INSERT INTO t2 VALUES (2, 2);
+INSERT INTO t3 VALUES (1, 2);
+INSERT INTO t3 VALUES (2, 2);
+UPDATE t1 SET a = 1;
+UPDATE t1 SET a = 1 ORDER BY a;
+UPDATE t2 SET a = 1;
+ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
+UPDATE t2 SET a = 1 ORDER BY a;
+ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
+UPDATE t3 SET a = 1;
+ERROR 23000: Duplicate entry '1-2' for key 'PRIMARY'
+UPDATE t3 SET a = 1 ORDER BY a;
+ERROR 23000: Duplicate entry '1-2' for key 'PRIMARY'
+SELECT count(*) FROM t1;
+count(*)
+2
+SELECT count(*) FROM t2;
+count(*)
+2
+SELECT count(*) FROM t3;
+count(*)
+2
+SELECT * FROM t1 ORDER by a;
+a b
+1 2
+1 2
+SELECT * FROM t2 ORDER by a;
+a b
+1 2
+2 2
+SELECT * FROM t3 ORDER by a;
+a b
+1 2
+2 2
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+End of 5.1 tests
diff --git a/mysql-test/r/ndb_view.result b/mysql-test/suite/ndb/r/ndb_view.result
index b7d1b6860c8..b7d1b6860c8 100644
--- a/mysql-test/r/ndb_view.result
+++ b/mysql-test/suite/ndb/r/ndb_view.result
diff --git a/mysql-test/r/ndbapi.result b/mysql-test/suite/ndb/r/ndbapi.result
index 8e680391a81..8e680391a81 100644
--- a/mysql-test/r/ndbapi.result
+++ b/mysql-test/suite/ndb/r/ndbapi.result
diff --git a/mysql-test/r/partition_03ndb.result b/mysql-test/suite/ndb/r/partition_03ndb.result
index 28339cc7435..28339cc7435 100644
--- a/mysql-test/r/partition_03ndb.result
+++ b/mysql-test/suite/ndb/r/partition_03ndb.result
diff --git a/mysql-test/suite/ndb/r/ps_7ndb.result b/mysql-test/suite/ndb/r/ps_7ndb.result
new file mode 100644
index 00000000000..82d2d14b075
--- /dev/null
+++ b/mysql-test/suite/ndb/r/ps_7ndb.result
@@ -0,0 +1,3127 @@
+use test;
+drop table if exists t1, t9 ;
+create table t1
+(
+a int, b varchar(30),
+primary key(a)
+) engine = 'NDB' ;
+create table t9
+(
+c1 tinyint, c2 smallint, c3 mediumint, c4 int,
+c5 integer, c6 bigint, c7 float, c8 double,
+c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
+c13 date, c14 datetime, c15 timestamp, c16 time,
+c17 year, c18 tinyint, c19 bool, c20 char,
+c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
+c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
+c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'),
+c32 set('monday', 'tuesday', 'wednesday'),
+primary key(c1)
+) engine = 'NDB' ;
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t9 ;
+insert into t9
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t9
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+commit ;
+test_sequence
+------ simple select tests ------
+prepare stmt1 from ' select * from t9 order by c1 ' ;
+execute stmt1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t9 t9 c1 c1 1 4 1 N 49155 0 63
+def test t9 t9 c2 c2 2 6 1 Y 32768 0 63
+def test t9 t9 c3 c3 9 9 1 Y 32768 0 63
+def test t9 t9 c4 c4 3 11 1 Y 32768 0 63
+def test t9 t9 c5 c5 3 11 1 Y 32768 0 63
+def test t9 t9 c6 c6 8 20 1 Y 32768 0 63
+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 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 1249 0 63
+def test t9 t9 c16 c16 11 8 8 Y 128 0 63
+def test t9 t9 c17 c17 13 4 4 Y 32864 0 63
+def test t9 t9 c18 c18 1 4 1 Y 32768 0 63
+def test t9 t9 c19 c19 1 1 1 Y 32768 0 63
+def test t9 t9 c20 c20 254 1 1 Y 0 0 8
+def test t9 t9 c21 c21 254 10 10 Y 0 0 8
+def test t9 t9 c22 c22 253 30 30 Y 0 0 8
+def test t9 t9 c23 c23 252 255 8 Y 144 0 63
+def test t9 t9 c24 c24 252 255 8 Y 16 0 8
+def test t9 t9 c25 c25 252 65535 4 Y 144 0 63
+def test t9 t9 c26 c26 252 65535 4 Y 16 0 8
+def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63
+def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8
+def test t9 t9 c29 c29 252 4294967295 8 Y 144 0 63
+def test t9 t9 c30 c30 252 4294967295 8 Y 16 0 8
+def test t9 t9 c31 c31 254 5 3 Y 256 0 8
+def test t9 t9 c32 c32 254 24 7 Y 2048 0 8
+c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32
+1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
+9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
+set @arg00='SELECT' ;
+@arg00 a from t1 where a=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 '@arg00 a from t1 where a=1' at line 1
+prepare stmt1 from ' ? a from t1 where a=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 '? a from t1 where a=1' at line 1
+set @arg00=1 ;
+select @arg00, b from t1 where a=1 ;
+@arg00 b
+1 one
+prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+? b
+1 one
+set @arg00='lion' ;
+select @arg00, b from t1 where a=1 ;
+@arg00 b
+lion one
+prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+? b
+lion one
+set @arg00=NULL ;
+select @arg00, b from t1 where a=1 ;
+@arg00 b
+NULL one
+prepare stmt1 from ' select ?, b from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+? b
+NULL one
+set @arg00=1 ;
+select b, a - @arg00 from t1 where a=1 ;
+b a - @arg00
+one 0
+prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+b a - ?
+one 0
+set @arg00=null ;
+select @arg00 as my_col ;
+my_col
+NULL
+prepare stmt1 from ' select ? as my_col';
+execute stmt1 using @arg00 ;
+my_col
+NULL
+select @arg00 + 1 as my_col ;
+my_col
+NULL
+prepare stmt1 from ' select ? + 1 as my_col';
+execute stmt1 using @arg00 ;
+my_col
+NULL
+select 1 + @arg00 as my_col ;
+my_col
+NULL
+prepare stmt1 from ' select 1 + ? as my_col';
+execute stmt1 using @arg00 ;
+my_col
+NULL
+set @arg00='MySQL' ;
+select substr(@arg00,1,2) from t1 where a=1 ;
+substr(@arg00,1,2)
+My
+prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+substr(?,1,2)
+My
+set @arg00=3 ;
+select substr('MySQL',@arg00,5) from t1 where a=1 ;
+substr('MySQL',@arg00,5)
+SQL
+prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+substr('MySQL',?,5)
+SQL
+select substr('MySQL',1,@arg00) from t1 where a=1 ;
+substr('MySQL',1,@arg00)
+MyS
+prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ;
+execute stmt1 using @arg00 ;
+substr('MySQL',1,?)
+MyS
+set @arg00='MySQL' ;
+select a , concat(@arg00,b) from t1 order by a;
+a concat(@arg00,b)
+1 MySQLone
+2 MySQLtwo
+3 MySQLthree
+4 MySQLfour
+prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ;
+execute stmt1 using @arg00;
+a concat(?,b)
+1 MySQLone
+2 MySQLtwo
+3 MySQLthree
+4 MySQLfour
+select a , concat(b,@arg00) from t1 order by a ;
+a concat(b,@arg00)
+1 oneMySQL
+2 twoMySQL
+3 threeMySQL
+4 fourMySQL
+prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ;
+execute stmt1 using @arg00;
+a concat(b,?)
+1 oneMySQL
+2 twoMySQL
+3 threeMySQL
+4 fourMySQL
+set @arg00='MySQL' ;
+select group_concat(@arg00,b order by a) from t1
+group by 'a' ;
+group_concat(@arg00,b order by a)
+MySQLone,MySQLtwo,MySQLthree,MySQLfour
+prepare stmt1 from ' select group_concat(?,b order by a) from t1
+group by ''a'' ' ;
+execute stmt1 using @arg00;
+group_concat(?,b order by a)
+MySQLone,MySQLtwo,MySQLthree,MySQLfour
+select group_concat(b,@arg00 order by a) from t1
+group by 'a' ;
+group_concat(b,@arg00 order by a)
+oneMySQL,twoMySQL,threeMySQL,fourMySQL
+prepare stmt1 from ' select group_concat(b,? order by a) from t1
+group by ''a'' ' ;
+execute stmt1 using @arg00;
+group_concat(b,? order by a)
+oneMySQL,twoMySQL,threeMySQL,fourMySQL
+set @arg00='first' ;
+set @arg01='second' ;
+set @arg02=NULL;
+select @arg00, @arg01 from t1 where a=1 ;
+@arg00 @arg01
+first second
+prepare stmt1 from ' select ?, ? from t1 where a=1 ' ;
+execute stmt1 using @arg00, @arg01 ;
+? ?
+first second
+execute stmt1 using @arg02, @arg01 ;
+? ?
+NULL second
+execute stmt1 using @arg00, @arg02 ;
+? ?
+first NULL
+execute stmt1 using @arg02, @arg02 ;
+? ?
+NULL NULL
+drop table if exists t5 ;
+create table t5 (id1 int(11) not null default '0',
+value2 varchar(100), value1 varchar(100)) ;
+insert into t5 values (1,'hh','hh'),(2,'hh','hh'),
+(1,'ii','ii'),(2,'ii','ii') ;
+prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ;
+set @arg00=1 ;
+set @arg01='hh' ;
+execute stmt1 using @arg00, @arg01 ;
+id1 value1
+1 hh
+1 ii
+2 hh
+drop table t5 ;
+drop table if exists t5 ;
+create table t5(session_id char(9) not null) ;
+insert into t5 values ('abc') ;
+prepare stmt1 from ' select * from t5
+where ?=''1111'' and session_id = ''abc'' ' ;
+set @arg00='abc' ;
+execute stmt1 using @arg00 ;
+session_id
+set @arg00='1111' ;
+execute stmt1 using @arg00 ;
+session_id
+abc
+set @arg00='abc' ;
+execute stmt1 using @arg00 ;
+session_id
+drop table t5 ;
+set @arg00='FROM' ;
+select a @arg00 t1 where a=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 '@arg00 t1 where a=1' at line 1
+prepare stmt1 from ' select a ? t1 where a=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 '? t1 where a=1' at line 1
+set @arg00='t1' ;
+select a from @arg00 where a=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 '@arg00 where a=1' at line 1
+prepare stmt1 from ' select a from ? where a=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 '? where a=1' at line 1
+set @arg00='WHERE' ;
+select a from t1 @arg00 a=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 '@arg00 a=1' at line 1
+prepare stmt1 from ' select a from t1 ? a=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 '? a=1' at line 1
+set @arg00=1 ;
+select a FROM t1 where a=@arg00 ;
+a
+1
+prepare stmt1 from ' select a FROM t1 where a=? ' ;
+execute stmt1 using @arg00 ;
+a
+1
+set @arg00=1000 ;
+execute stmt1 using @arg00 ;
+a
+set @arg00=NULL ;
+select a FROM t1 where a=@arg00 ;
+a
+prepare stmt1 from ' select a FROM t1 where a=? ' ;
+execute stmt1 using @arg00 ;
+a
+set @arg00=4 ;
+select a FROM t1 where a=sqrt(@arg00) ;
+a
+2
+prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ;
+execute stmt1 using @arg00 ;
+a
+2
+set @arg00=NULL ;
+select a FROM t1 where a=sqrt(@arg00) ;
+a
+prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ;
+execute stmt1 using @arg00 ;
+a
+set @arg00=2 ;
+set @arg01=3 ;
+select a FROM t1 where a in (@arg00,@arg01) order by a;
+a
+2
+3
+prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a ';
+execute stmt1 using @arg00, @arg01;
+a
+2
+3
+set @arg00= 'one' ;
+set @arg01= 'two' ;
+set @arg02= 'five' ;
+prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ;
+execute stmt1 using @arg00, @arg01, @arg02 ;
+b
+one
+two
+prepare stmt1 from ' select b FROM t1 where b like ? ';
+set @arg00='two' ;
+execute stmt1 using @arg00 ;
+b
+two
+set @arg00='tw%' ;
+execute stmt1 using @arg00 ;
+b
+two
+set @arg00='%wo' ;
+execute stmt1 using @arg00 ;
+b
+two
+set @arg00=null ;
+insert into t9 set c1= 0, c5 = NULL ;
+select c5 from t9 where c5 > NULL ;
+c5
+prepare stmt1 from ' select c5 from t9 where c5 > ? ';
+execute stmt1 using @arg00 ;
+c5
+select c5 from t9 where c5 < NULL ;
+c5
+prepare stmt1 from ' select c5 from t9 where c5 < ? ';
+execute stmt1 using @arg00 ;
+c5
+select c5 from t9 where c5 = NULL ;
+c5
+prepare stmt1 from ' select c5 from t9 where c5 = ? ';
+execute stmt1 using @arg00 ;
+c5
+select c5 from t9 where c5 <=> NULL ;
+c5
+NULL
+prepare stmt1 from ' select c5 from t9 where c5 <=> ? ';
+execute stmt1 using @arg00 ;
+c5
+NULL
+delete from t9 where c1= 0 ;
+set @arg00='>' ;
+select a FROM t1 where a @arg00 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 '@arg00 1' at line 1
+prepare stmt1 from ' select a FROM t1 where a ? 1 ' ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? 1' at line 1
+set @arg00=1 ;
+select a,b FROM t1 where a is not NULL
+AND b is not NULL group by a - @arg00 ;
+a b
+1 one
+2 two
+3 three
+4 four
+prepare stmt1 from ' select a,b FROM t1 where a is not NULL
+AND b is not NULL group by a - ? ' ;
+execute stmt1 using @arg00 ;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00='two' ;
+select a,b FROM t1 where a is not NULL
+AND b is not NULL having b <> @arg00 order by a ;
+a b
+1 one
+3 three
+4 four
+prepare stmt1 from ' select a,b FROM t1 where a is not NULL
+AND b is not NULL having b <> ? order by a ' ;
+execute stmt1 using @arg00 ;
+a b
+1 one
+3 three
+4 four
+set @arg00=1 ;
+select a,b FROM t1 where a is not NULL
+AND b is not NULL order by a - @arg00 ;
+a b
+1 one
+2 two
+3 three
+4 four
+prepare stmt1 from ' select a,b FROM t1 where a is not NULL
+AND b is not NULL order by a - ? ' ;
+execute stmt1 using @arg00 ;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00=2 ;
+select a,b from t1 order by 2 ;
+a b
+4 four
+1 one
+3 three
+2 two
+prepare stmt1 from ' select a,b from t1
+order by ? ';
+execute stmt1 using @arg00;
+a b
+4 four
+1 one
+3 three
+2 two
+set @arg00=1 ;
+execute stmt1 using @arg00;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00=0 ;
+execute stmt1 using @arg00;
+ERROR 42S22: Unknown column '?' in 'order clause'
+set @arg00=1;
+prepare stmt1 from ' select a,b from t1 order by a
+limit 1 ';
+execute stmt1 ;
+a b
+1 one
+prepare stmt1 from ' select a,b from t1 order by a limit ? ';
+execute stmt1 using @arg00;
+a b
+1 one
+set @arg00='b' ;
+set @arg01=0 ;
+set @arg02=2 ;
+set @arg03=2 ;
+select sum(a), @arg00 from t1 where a > @arg01
+and b is not null group by substr(b,@arg02)
+having sum(a) <> @arg03 ;
+sum(a) @arg00
+3 b
+1 b
+4 b
+prepare stmt1 from ' select sum(a), ? from t1 where a > ?
+and b is not null group by substr(b,?)
+having sum(a) <> ? ';
+execute stmt1 using @arg00, @arg01, @arg02, @arg03;
+sum(a) ?
+3 b
+1 b
+4 b
+test_sequence
+------ join tests ------
+select first.a as a1, second.a as a2
+from t1 first, t1 second
+where first.a = second.a order by a1 ;
+a1 a2
+1 1
+2 2
+3 3
+4 4
+prepare stmt1 from ' select first.a as a1, second.a as a2
+ from t1 first, t1 second
+ where first.a = second.a order by a1 ';
+execute stmt1 ;
+a1 a2
+1 1
+2 2
+3 3
+4 4
+set @arg00='ABC';
+set @arg01='two';
+set @arg02='one';
+select first.a, @arg00, second.a FROM t1 first, t1 second
+where @arg01 = first.b or first.a = second.a or second.b = @arg02
+order by second.a, first.a;
+a @arg00 a
+1 ABC 1
+2 ABC 1
+3 ABC 1
+4 ABC 1
+2 ABC 2
+2 ABC 3
+3 ABC 3
+2 ABC 4
+4 ABC 4
+prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
+ where ? = first.b or first.a = second.a or second.b = ?
+ order by second.a, first.a';
+execute stmt1 using @arg00, @arg01, @arg02;
+a ? a
+1 ABC 1
+2 ABC 1
+3 ABC 1
+4 ABC 1
+2 ABC 2
+2 ABC 3
+3 ABC 3
+2 ABC 4
+4 ABC 4
+drop table if exists t2 ;
+create table t2 as select * from t1 ;
+set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ;
+set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ;
+set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ;
+set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ;
+set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ;
+set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ;
+set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ;
+set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ;
+set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ;
+the join statement is:
+SELECT * FROM t2 right join t1 using(a) order by t2.a
+prepare stmt1 from @query9 ;
+execute stmt1 ;
+a b b
+1 one one
+2 two two
+3 three three
+4 four four
+execute stmt1 ;
+a b b
+1 one one
+2 two two
+3 three three
+4 four four
+execute stmt1 ;
+a b b
+1 one one
+2 two two
+3 three three
+4 four four
+the join statement is:
+SELECT * FROM t2 natural right join t1 order by t2.a
+prepare stmt1 from @query8 ;
+execute stmt1 ;
+a b
+1 one
+2 two
+3 three
+4 four
+execute stmt1 ;
+a b
+1 one
+2 two
+3 three
+4 four
+execute stmt1 ;
+a b
+1 one
+2 two
+3 three
+4 four
+the join statement is:
+SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a
+prepare stmt1 from @query7 ;
+execute stmt1 ;
+a b a b
+1 one 1 one
+2 two 2 two
+3 three 3 three
+4 four 4 four
+execute stmt1 ;
+a b a b
+1 one 1 one
+2 two 2 two
+3 three 3 three
+4 four 4 four
+execute stmt1 ;
+a b a b
+1 one 1 one
+2 two 2 two
+3 three 3 three
+4 four 4 four
+the join statement is:
+SELECT * FROM t2 left join t1 using(a) order by t2.a
+prepare stmt1 from @query6 ;
+execute stmt1 ;
+a b b
+1 one one
+2 two two
+3 three three
+4 four four
+execute stmt1 ;
+a b b
+1 one one
+2 two two
+3 three three
+4 four four
+execute stmt1 ;
+a b b
+1 one one
+2 two two
+3 three three
+4 four four
+the join statement is:
+SELECT * FROM t2 natural left join t1 order by t2.a
+prepare stmt1 from @query5 ;
+execute stmt1 ;
+a b
+1 one
+2 two
+3 three
+4 four
+execute stmt1 ;
+a b
+1 one
+2 two
+3 three
+4 four
+execute stmt1 ;
+a b
+1 one
+2 two
+3 three
+4 four
+the join statement is:
+SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a
+prepare stmt1 from @query4 ;
+execute stmt1 ;
+a b a b
+1 one 1 one
+2 two 2 two
+3 three 3 three
+4 four 4 four
+execute stmt1 ;
+a b a b
+1 one 1 one
+2 two 2 two
+3 three 3 three
+4 four 4 four
+execute stmt1 ;
+a b a b
+1 one 1 one
+2 two 2 two
+3 three 3 three
+4 four 4 four
+the join statement is:
+SELECT * FROM t2 join t1 using(a) order by t2.a
+prepare stmt1 from @query3 ;
+execute stmt1 ;
+a b b
+1 one one
+2 two two
+3 three three
+4 four four
+execute stmt1 ;
+a b b
+1 one one
+2 two two
+3 three three
+4 four four
+execute stmt1 ;
+a b b
+1 one one
+2 two two
+3 three three
+4 four four
+the join statement is:
+SELECT * FROM t2 natural join t1 order by t2.a
+prepare stmt1 from @query2 ;
+execute stmt1 ;
+a b
+1 one
+2 two
+3 three
+4 four
+execute stmt1 ;
+a b
+1 one
+2 two
+3 three
+4 four
+execute stmt1 ;
+a b
+1 one
+2 two
+3 three
+4 four
+the join statement is:
+SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a
+prepare stmt1 from @query1 ;
+execute stmt1 ;
+a b a b
+1 one 1 one
+2 two 2 two
+3 three 3 three
+4 four 4 four
+execute stmt1 ;
+a b a b
+1 one 1 one
+2 two 2 two
+3 three 3 three
+4 four 4 four
+execute stmt1 ;
+a b a b
+1 one 1 one
+2 two 2 two
+3 three 3 three
+4 four 4 four
+drop table t2 ;
+test_sequence
+------ subquery tests ------
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = ''two'') ';
+execute stmt1 ;
+a b
+2 two
+set @arg00='two' ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where b = 'two' ) and b=@arg00 ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = ''two'') and b=? ';
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00='two' ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where b = @arg00 ) and b='two' ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = ? ) and b=''two'' ' ;
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00=3 ;
+set @arg01='three' ;
+select a,b FROM t1 where (a,b) in (select 3, 'three');
+a b
+3 three
+select a FROM t1 where (a,b) in (select @arg00,@arg01);
+a
+3
+prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) ';
+execute stmt1 using @arg00, @arg01;
+a
+3
+set @arg00=1 ;
+set @arg01='two' ;
+set @arg02=2 ;
+set @arg03='two' ;
+select a, @arg00, b FROM t1 outer_table where
+b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ;
+a @arg00 b
+2 1 two
+prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
+ b=? and a = (select ? from t1 where b = ? ) ' ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
+a ? b
+2 1 two
+prepare stmt1 from 'select c4 FROM t9 where
+ c13 = (select MAX(b) from t1 where a = ?) and c22 = ? ' ;
+execute stmt1 using @arg01, @arg02;
+c4
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = outer_table.b ) order by a ';
+execute stmt1 ;
+a b
+1 one
+2 two
+3 three
+4 four
+prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
+ (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
+execute stmt1 ;
+ccc
+1
+deallocate prepare stmt1 ;
+prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
+ (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
+execute stmt1 ;
+ccc
+1
+deallocate prepare stmt1 ;
+prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
+ (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
+execute stmt1 ;
+ccc
+1
+deallocate prepare stmt1 ;
+set @arg00='two' ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where b = outer_table.b ) and b=@arg00 ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where b = outer_table.b) and b=? ';
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00=2 ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ;
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00=2 ;
+select a, b FROM t1 outer_table where
+a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ;
+a b
+2 two
+prepare stmt1 from ' select a, b FROM t1 outer_table where
+ a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ;
+execute stmt1 using @arg00;
+a b
+2 two
+set @arg00=1 ;
+set @arg01='two' ;
+set @arg02=2 ;
+set @arg03='two' ;
+select a, @arg00, b FROM t1 outer_table where
+b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03
+and outer_table.a=a ) ;
+a @arg00 b
+2 1 two
+prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
+ b=? and a = (select ? from t1 where outer_table.b = ?
+ and outer_table.a=a ) ' ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
+a ? b
+2 1 two
+set @arg00=1 ;
+set @arg01=0 ;
+select a, @arg00
+from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2
+where a=@arg01;
+a @arg00
+0 1
+prepare stmt1 from ' select a, ?
+ from ( select a - ? as a from t1 where a=? ) as t2
+ where a=? ';
+execute stmt1 using @arg00, @arg00, @arg00, @arg01 ;
+a ?
+0 1
+drop table if exists t2 ;
+create table t2 as select * from t1;
+prepare stmt1 from ' select a in (select a from t2) from t1 ' ;
+execute stmt1 ;
+a in (select a from t2)
+1
+1
+1
+1
+drop table if exists t5, t6, t7 ;
+create table t5 (a int , b int) ;
+create table t6 like t5 ;
+create table t7 like t5 ;
+insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7),
+(2, -1), (3, 10) ;
+insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ;
+insert into t7 values (3, 3), (2, 2), (1, 1) ;
+prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6
+ where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
+ group by t5.a order by sum limit 1) from t7 ' ;
+execute stmt1 ;
+a (select count(distinct t5.b) as sum from t5, t6
+ where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
+ group by t5.a order by sum limit 1)
+3 1
+2 2
+1 2
+execute stmt1 ;
+a (select count(distinct t5.b) as sum from t5, t6
+ where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
+ group by t5.a order by sum limit 1)
+3 1
+2 2
+1 2
+execute stmt1 ;
+a (select count(distinct t5.b) as sum from t5, t6
+ where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
+ group by t5.a order by sum limit 1)
+3 1
+2 2
+1 2
+drop table t5, t6, t7 ;
+drop table if exists t2 ;
+create table t2 as select * from t9;
+set @stmt= ' SELECT
+ (SELECT SUM(c1 + c12 + 0.0) FROM t2
+ where (t9.c2 - 0e-3) = t2.c2
+ GROUP BY t9.c15 LIMIT 1) as scalar_s,
+ exists (select 1.0e+0 from t2
+ where t2.c3 * 9.0000000000 = t9.c4) as exists_s,
+ c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s,
+ (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s
+FROM t9,
+(select c25 x, c32 y from t2) tt WHERE x = c25 ' ;
+prepare stmt1 from @stmt ;
+execute stmt1 ;
+execute stmt1 ;
+set @stmt= concat('explain ',@stmt);
+prepare stmt1 from @stmt ;
+execute stmt1 ;
+execute stmt1 ;
+set @stmt= ' SELECT
+ (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2
+ GROUP BY t9.c15 LIMIT 1) as scalar_s,
+ exists (select ? from t2
+ where t2.c3*?=t9.c4) as exists_s,
+ c5*? in (select c6+? from t2) as in_s,
+ (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s
+FROM t9,
+(select c25 x, c32 y from t2) tt WHERE x =c25 ' ;
+set @arg00= 0.0 ;
+set @arg01= 0e-3 ;
+set @arg02= 1.0e+0 ;
+set @arg03= 9.0000000000 ;
+set @arg04= 4 ;
+set @arg05= 0.3e+1 ;
+set @arg06= 4 ;
+set @arg07= 4 ;
+set @arg08= 4.0 ;
+set @arg09= 40e-1 ;
+prepare stmt1 from @stmt ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
+@arg07, @arg08, @arg09 ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
+@arg07, @arg08, @arg09 ;
+set @stmt= concat('explain ',@stmt);
+prepare stmt1 from @stmt ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
+@arg07, @arg08, @arg09 ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
+@arg07, @arg08, @arg09 ;
+drop table t2 ;
+select 1 < (select a from t1) ;
+ERROR 21000: Subquery returns more than 1 row
+prepare stmt1 from ' select 1 < (select a from t1) ' ;
+execute stmt1 ;
+ERROR 21000: Subquery returns more than 1 row
+select 1 as my_col ;
+my_col
+1
+test_sequence
+------ union tests ------
+prepare stmt1 from ' select a FROM t1 where a=1
+ union distinct
+ select a FROM t1 where a=1 ';
+execute stmt1 ;
+a
+1
+execute stmt1 ;
+a
+1
+prepare stmt1 from ' select a FROM t1 where a=1
+ union all
+ select a FROM t1 where a=1 ';
+execute stmt1 ;
+a
+1
+1
+prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ;
+ERROR 21000: The used SELECT statements have a different number of columns
+prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ;
+ERROR 21000: The used SELECT statements have a different number of columns
+prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ;
+ERROR 21000: The used SELECT statements have a different number of columns
+prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ;
+ERROR 21000: The used SELECT statements have a different number of columns
+set @arg00=1 ;
+select @arg00 FROM t1 where a=1
+union distinct
+select 1 FROM t1 where a=1;
+@arg00
+1
+prepare stmt1 from ' select ? FROM t1 where a=1
+ union distinct
+ select 1 FROM t1 where a=1 ' ;
+execute stmt1 using @arg00;
+?
+1
+set @arg00=1 ;
+select 1 FROM t1 where a=1
+union distinct
+select @arg00 FROM t1 where a=1;
+1
+1
+prepare stmt1 from ' select 1 FROM t1 where a=1
+ union distinct
+ select ? FROM t1 where a=1 ' ;
+execute stmt1 using @arg00;
+1
+1
+set @arg00='a' ;
+select @arg00 FROM t1 where a=1
+union distinct
+select @arg00 FROM t1 where a=1;
+@arg00
+a
+prepare stmt1 from ' select ? FROM t1 where a=1
+ union distinct
+ select ? FROM t1 where a=1 ';
+execute stmt1 using @arg00, @arg00;
+?
+a
+prepare stmt1 from ' select ?
+ union distinct
+ select ? ';
+execute stmt1 using @arg00, @arg00;
+?
+a
+set @arg00='a' ;
+set @arg01=1 ;
+set @arg02='a' ;
+set @arg03=2 ;
+select @arg00 FROM t1 where a=@arg01
+union distinct
+select @arg02 FROM t1 where a=@arg03;
+@arg00
+a
+prepare stmt1 from ' select ? FROM t1 where a=?
+ union distinct
+ select ? FROM t1 where a=? ' ;
+execute stmt1 using @arg00, @arg01, @arg02, @arg03;
+?
+a
+set @arg00=1 ;
+prepare stmt1 from ' select sum(a) + 200, ? from t1
+union distinct
+select sum(a) + 200, 1 from t1
+group by b ' ;
+execute stmt1 using @arg00;
+sum(a) + 200 ?
+210 1
+204 1
+201 1
+203 1
+202 1
+set @Oporto='Oporto' ;
+set @Lisboa='Lisboa' ;
+set @0=0 ;
+set @1=1 ;
+set @2=2 ;
+set @3=3 ;
+set @4=4 ;
+select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ;
+@Oporto @Lisboa @0 @1 @2 @3 @4
+Oporto Lisboa 0 1 2 3 4
+select sum(a) + 200 as the_sum, @Oporto as the_town from t1
+group by b
+union distinct
+select sum(a) + 200, @Lisboa from t1
+group by b ;
+the_sum the_town
+204 Oporto
+201 Oporto
+203 Oporto
+202 Oporto
+204 Lisboa
+201 Lisboa
+203 Lisboa
+202 Lisboa
+prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
+ group by b
+ union distinct
+ select sum(a) + 200, ? from t1
+ group by b ' ;
+execute stmt1 using @Oporto, @Lisboa;
+the_sum the_town
+204 Oporto
+201 Oporto
+203 Oporto
+202 Oporto
+204 Lisboa
+201 Lisboa
+203 Lisboa
+202 Lisboa
+select sum(a) + 200 as the_sum, @Oporto as the_town from t1
+where a > @1
+group by b
+union distinct
+select sum(a) + 200, @Lisboa from t1
+where a > @2
+group by b ;
+the_sum the_town
+204 Oporto
+203 Oporto
+202 Oporto
+204 Lisboa
+203 Lisboa
+prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
+ where a > ?
+ group by b
+ union distinct
+ select sum(a) + 200, ? from t1
+ where a > ?
+ group by b ' ;
+execute stmt1 using @Oporto, @1, @Lisboa, @2;
+the_sum the_town
+204 Oporto
+203 Oporto
+202 Oporto
+204 Lisboa
+203 Lisboa
+select sum(a) + 200 as the_sum, @Oporto as the_town from t1
+where a > @1
+group by b
+having avg(a) > @2
+union distinct
+select sum(a) + 200, @Lisboa from t1
+where a > @2
+group by b
+having avg(a) > @3;
+the_sum the_town
+204 Oporto
+203 Oporto
+204 Lisboa
+prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1
+ where a > ?
+ group by b
+ having avg(a) > ?
+ union distinct
+ select sum(a) + 200, ? from t1
+ where a > ?
+ group by b
+ having avg(a) > ? ';
+execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3;
+the_sum the_town
+204 Oporto
+203 Oporto
+204 Lisboa
+test_sequence
+------ explain select tests ------
+prepare stmt1 from ' explain select * from t9 ' ;
+execute stmt1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def id 8 3 1 N 32929 0 63
+def select_type 253 19 6 N 1 31 8
+def table 253 64 2 Y 0 31 8
+def type 253 10 3 Y 0 31 8
+def possible_keys 253 4096 0 Y 0 31 8
+def key 253 64 0 Y 0 31 8
+def key_len 253 1365 0 Y 0 31 8
+def ref 253 1024 0 Y 0 31 8
+def rows 8 10 1 Y 32928 0 63
+def Extra 253 255 0 N 1 31 8
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t9 ALL NULL NULL NULL NULL 2
+test_sequence
+------ delete tests ------
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t9 ;
+insert into t9
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t9
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+commit ;
+prepare stmt1 from 'delete from t1 where a=2' ;
+execute stmt1;
+select a,b from t1 where a=2;
+a b
+execute stmt1;
+insert into t1 values(0,NULL);
+set @arg00=NULL;
+prepare stmt1 from 'delete from t1 where b=?' ;
+execute stmt1 using @arg00;
+select a,b from t1 where b is NULL ;
+a b
+0 NULL
+set @arg00='one';
+execute stmt1 using @arg00;
+select a,b from t1 where b=@arg00;
+a b
+prepare stmt1 from 'truncate table t1' ;
+test_sequence
+------ update tests ------
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t9 ;
+insert into t9
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t9
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+commit ;
+prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ;
+execute stmt1;
+select a,b from t1 where a=2;
+a b
+2 a=two
+execute stmt1;
+select a,b from t1 where a=2;
+a b
+2 a=two
+set @arg00=NULL;
+prepare stmt1 from 'update t1 set b=? where a=2' ;
+execute stmt1 using @arg00;
+select a,b from t1 where a=2;
+a b
+2 NULL
+set @arg00='two';
+execute stmt1 using @arg00;
+select a,b from t1 where a=2;
+a b
+2 two
+set @arg00=2;
+prepare stmt1 from 'update t1 set b=NULL where a=?' ;
+execute stmt1 using @arg00;
+select a,b from t1 where a=@arg00;
+a b
+2 NULL
+update t1 set b='two' where a=@arg00;
+set @arg00=2000;
+execute stmt1 using @arg00;
+select a,b from t1 where a=@arg00;
+a b
+set @arg00=2;
+set @arg01=22;
+prepare stmt1 from 'update t1 set a=? where a=?' ;
+execute stmt1 using @arg00, @arg00;
+select a,b from t1 where a=@arg00;
+a b
+2 two
+execute stmt1 using @arg01, @arg00;
+select a,b from t1 where a=@arg01;
+a b
+22 two
+execute stmt1 using @arg00, @arg01;
+select a,b from t1 where a=@arg00;
+a b
+2 two
+set @arg00=NULL;
+set @arg01=2;
+execute stmt1 using @arg00, @arg01;
+Warnings:
+Warning 1048 Column 'a' cannot be null
+select a,b from t1 order by a;
+a b
+0 two
+1 one
+3 three
+4 four
+set @arg00=0;
+execute stmt1 using @arg01, @arg00;
+select a,b from t1 order by a;
+a b
+1 one
+2 two
+3 three
+4 four
+set @arg00=23;
+set @arg01='two';
+set @arg02=2;
+set @arg03='two';
+set @arg04=2;
+drop table if exists t2;
+create table t2 as select a,b from t1 ;
+prepare stmt1 from 'update t1 set a=? where b=?
+ and a in (select ? from t2
+ where b = ? or a = ?)';
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ;
+affected rows: 1
+info: Rows matched: 1 Changed: 1 Warnings: 0
+select a,b from t1 where a = @arg00 ;
+a b
+23 two
+prepare stmt1 from 'update t1 set a=? where b=?
+ and a not in (select ? from t2
+ where b = ? or a = ?)';
+execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
+affected rows: 1
+info: Rows matched: 1 Changed: 1 Warnings: 0
+select a,b from t1 order by a ;
+a b
+1 one
+2 two
+3 three
+4 four
+drop table t2 ;
+create table t2
+(
+a int, b varchar(30),
+primary key(a)
+) engine = 'NDB' ;
+insert into t2(a,b) select a, b from t1 ;
+prepare stmt1 from 'update t1 set a=? where b=?
+ and a in (select ? from t2
+ where b = ? or a = ?)';
+execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ;
+affected rows: 1
+info: Rows matched: 1 Changed: 1 Warnings: 0
+select a,b from t1 where a = @arg00 ;
+a b
+23 two
+prepare stmt1 from 'update t1 set a=? where b=?
+ and a not in (select ? from t2
+ where b = ? or a = ?)';
+execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ;
+affected rows: 1
+info: Rows matched: 1 Changed: 1 Warnings: 0
+select a,b from t1 order by a ;
+a b
+1 one
+2 two
+3 three
+4 four
+drop table t2 ;
+set @arg00=1;
+prepare stmt1 from 'update t1 set b=''bla''
+where a=2
+limit 1';
+execute stmt1 ;
+select a,b from t1 where b = 'bla' ;
+a b
+2 bla
+prepare stmt1 from 'update t1 set b=''bla'' where a=2 limit ?';
+execute stmt1 using @arg00;
+test_sequence
+------ insert tests ------
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t9 ;
+insert into t9
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t9
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+commit ;
+prepare stmt1 from 'insert into t1 values(5, ''five'' )';
+execute stmt1;
+select a,b from t1 where a = 5;
+a b
+5 five
+set @arg00='six' ;
+prepare stmt1 from 'insert into t1 values(6, ? )';
+execute stmt1 using @arg00;
+select a,b from t1 where b = @arg00;
+a b
+6 six
+execute stmt1 using @arg00;
+ERROR 23000: Duplicate entry '6' for key 'PRIMARY'
+set @arg00=NULL ;
+prepare stmt1 from 'insert into t1 values(0, ? )';
+execute stmt1 using @arg00;
+select a,b from t1 where b is NULL;
+a b
+0 NULL
+set @arg00=8 ;
+set @arg01='eight' ;
+prepare stmt1 from 'insert into t1 values(?, ? )';
+execute stmt1 using @arg00, @arg01 ;
+select a,b from t1 where b = @arg01;
+a b
+8 eight
+set @NULL= null ;
+set @arg00= 'abc' ;
+execute stmt1 using @NULL, @NULL ;
+ERROR 23000: Column 'a' cannot be null
+execute stmt1 using @NULL, @NULL ;
+ERROR 23000: Column 'a' cannot be null
+execute stmt1 using @NULL, @arg00 ;
+ERROR 23000: Column 'a' cannot be null
+execute stmt1 using @NULL, @arg00 ;
+ERROR 23000: Column 'a' cannot be null
+set @arg01= 10000 + 2 ;
+execute stmt1 using @arg01, @arg00 ;
+set @arg01= 10000 + 1 ;
+execute stmt1 using @arg01, @arg00 ;
+select * from t1 where a > 10000 order by a ;
+a b
+10001 abc
+10002 abc
+delete from t1 where a > 10000 ;
+set @arg01= 10000 + 2 ;
+execute stmt1 using @arg01, @NULL ;
+set @arg01= 10000 + 1 ;
+execute stmt1 using @arg01, @NULL ;
+select * from t1 where a > 10000 order by a ;
+a b
+10001 NULL
+10002 NULL
+delete from t1 where a > 10000 ;
+set @arg01= 10000 + 10 ;
+execute stmt1 using @arg01, @arg01 ;
+set @arg01= 10000 + 9 ;
+execute stmt1 using @arg01, @arg01 ;
+set @arg01= 10000 + 8 ;
+execute stmt1 using @arg01, @arg01 ;
+set @arg01= 10000 + 7 ;
+execute stmt1 using @arg01, @arg01 ;
+set @arg01= 10000 + 6 ;
+execute stmt1 using @arg01, @arg01 ;
+set @arg01= 10000 + 5 ;
+execute stmt1 using @arg01, @arg01 ;
+set @arg01= 10000 + 4 ;
+execute stmt1 using @arg01, @arg01 ;
+set @arg01= 10000 + 3 ;
+execute stmt1 using @arg01, @arg01 ;
+set @arg01= 10000 + 2 ;
+execute stmt1 using @arg01, @arg01 ;
+set @arg01= 10000 + 1 ;
+execute stmt1 using @arg01, @arg01 ;
+select * from t1 where a > 10000 order by a ;
+a b
+10001 10001
+10002 10002
+10003 10003
+10004 10004
+10005 10005
+10006 10006
+10007 10007
+10008 10008
+10009 10009
+10010 10010
+delete from t1 where a > 10000 ;
+set @arg00=81 ;
+set @arg01='8-1' ;
+set @arg02=82 ;
+set @arg03='8-2' ;
+prepare stmt1 from 'insert into t1 values(?,?),(?,?)';
+execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
+select a,b from t1 where a in (@arg00,@arg02) ;
+a b
+81 8-1
+82 8-2
+set @arg00=9 ;
+set @arg01='nine' ;
+prepare stmt1 from 'insert into t1 set a=?, b=? ';
+execute stmt1 using @arg00, @arg01 ;
+select a,b from t1 where a = @arg00 ;
+a b
+9 nine
+set @arg00=6 ;
+set @arg01=1 ;
+prepare stmt1 from 'insert into t1 set a=?, b=''sechs''
+ on duplicate key update a=a + ?, b=concat(b,''modified'') ';
+execute stmt1 using @arg00, @arg01;
+select * from t1 order by a;
+a b
+0 NULL
+1 one
+2 two
+3 three
+4 four
+5 five
+7 sixmodified
+8 eight
+9 nine
+81 8-1
+82 8-2
+set @arg00=81 ;
+set @arg01=1 ;
+execute stmt1 using @arg00, @arg01;
+ERROR 23000: Duplicate entry '82' for key 'PRIMARY'
+drop table if exists t2 ;
+create table t2 (id int auto_increment primary key)
+ENGINE= 'NDB' ;
+prepare stmt1 from ' select last_insert_id() ' ;
+insert into t2 values (NULL) ;
+execute stmt1 ;
+last_insert_id()
+1
+insert into t2 values (NULL) ;
+execute stmt1 ;
+last_insert_id()
+2
+drop table t2 ;
+set @1000=1000 ;
+set @x1000_2="x1000_2" ;
+set @x1000_3="x1000_3" ;
+set @x1000="x1000" ;
+set @1100=1100 ;
+set @x1100="x1100" ;
+set @100=100 ;
+set @updated="updated" ;
+insert into t1 values(1000,'x1000_1') ;
+insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3)
+on duplicate key update a = a + @100, b = concat(b,@updated) ;
+select a,b from t1 where a >= 1000 order by a ;
+a b
+1000 x1000_3
+1100 x1000_1updated
+delete from t1 where a >= 1000 ;
+insert into t1 values(1000,'x1000_1') ;
+prepare stmt1 from ' insert into t1 values(?,?),(?,?)
+ on duplicate key update a = a + ?, b = concat(b,?) ';
+execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ;
+select a,b from t1 where a >= 1000 order by a ;
+a b
+1000 x1000_3
+1100 x1000_1updated
+delete from t1 where a >= 1000 ;
+insert into t1 values(1000,'x1000_1') ;
+execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ;
+select a,b from t1 where a >= 1000 order by a ;
+a b
+1200 x1000_1updatedupdated
+delete from t1 where a >= 1000 ;
+prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' ';
+execute stmt1;
+execute stmt1;
+execute stmt1;
+test_sequence
+------ multi table tests ------
+delete from t1 ;
+delete from t9 ;
+insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ;
+insert into t9 (c1,c21)
+values (1, 'one'), (2, 'two'), (3, 'three') ;
+prepare stmt_delete from " delete t1, t9
+ from t1, t9 where t1.a=t9.c1 and t1.b='updated' ";
+prepare stmt_update from " update t1, t9
+ set t1.b='updated', t9.c21='updated'
+ where t1.a=t9.c1 and t1.a=? ";
+prepare stmt_select1 from " select a, b from t1 order by a" ;
+prepare stmt_select2 from " select c1, c21 from t9 order by c1" ;
+set @arg00= 1 ;
+execute stmt_update using @arg00 ;
+execute stmt_delete ;
+execute stmt_select1 ;
+a b
+2 two
+3 three
+execute stmt_select2 ;
+c1 c21
+2 two
+3 three
+set @arg00= @arg00 + 1 ;
+execute stmt_update using @arg00 ;
+execute stmt_delete ;
+execute stmt_select1 ;
+a b
+3 three
+execute stmt_select2 ;
+c1 c21
+3 three
+set @arg00= @arg00 + 1 ;
+execute stmt_update using @arg00 ;
+execute stmt_delete ;
+execute stmt_select1 ;
+a b
+execute stmt_select2 ;
+c1 c21
+set @arg00= @arg00 + 1 ;
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t9 ;
+insert into t9
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t9
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+commit ;
+insert into t1 values(0,NULL) ;
+set @duplicate='duplicate ' ;
+set @1000=1000 ;
+set @5=5 ;
+select a,b from t1 where a < 5 order by a ;
+a b
+0 NULL
+1 one
+2 two
+3 three
+4 four
+insert into t1 select a + @1000, concat(@duplicate,b) from t1
+where a < @5 ;
+affected rows: 5
+info: Records: 5 Duplicates: 0 Warnings: 0
+select a,b from t1 where a >= 1000 order by a ;
+a b
+1000 NULL
+1001 duplicate one
+1002 duplicate two
+1003 duplicate three
+1004 duplicate four
+delete from t1 where a >= 1000 ;
+prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1
+where a < ? ' ;
+execute stmt1 using @1000, @duplicate, @5;
+affected rows: 5
+info: Records: 5 Duplicates: 0 Warnings: 0
+select a,b from t1 where a >= 1000 order by a ;
+a b
+1000 NULL
+1001 duplicate one
+1002 duplicate two
+1003 duplicate three
+1004 duplicate four
+delete from t1 where a >= 1000 ;
+set @1=1 ;
+set @2=2 ;
+set @100=100 ;
+set @float=1.00;
+set @five='five' ;
+drop table if exists t2;
+create table t2 like t1 ;
+insert into t2 (b,a)
+select @duplicate, sum(first.a) from t1 first, t1 second
+where first.a <> @5 and second.b = first.b
+and second.b <> @five
+group by second.b
+having sum(second.a) > @2
+union
+select b, a + @100 from t1
+where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b
+from t1);
+affected rows: 3
+info: Records: 3 Duplicates: 0 Warnings: 0
+select a,b from t2 order by a ;
+a b
+3 duplicate
+4 duplicate
+103 three
+delete from t2 ;
+prepare stmt1 from ' insert into t2 (b,a)
+select ?, sum(first.a)
+ from t1 first, t1 second
+ where first.a <> ? and second.b = first.b and second.b <> ?
+ group by second.b
+ having sum(second.a) > ?
+union
+select b, a + ? from t1
+ where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b
+ from t1 ) ' ;
+execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ;
+affected rows: 3
+info: Records: 3 Duplicates: 0 Warnings: 0
+select a,b from t2 order by a ;
+a b
+3 duplicate
+4 duplicate
+103 three
+drop table t2;
+drop table if exists t5 ;
+set @arg01= 8;
+set @arg02= 8.0;
+set @arg03= 80.00000000000e-1;
+set @arg04= 'abc' ;
+set @arg05= CAST('abc' as binary) ;
+set @arg06= '1991-08-05' ;
+set @arg07= CAST('1991-08-05' as date);
+set @arg08= '1991-08-05 01:01:01' ;
+set @arg09= CAST('1991-08-05 01:01:01' as datetime) ;
+set @arg10= unix_timestamp('1991-01-01 01:01:01');
+set @arg11= YEAR('1991-01-01 01:01:01');
+set @arg12= 8 ;
+set @arg12= NULL ;
+set @arg13= 8.0 ;
+set @arg13= NULL ;
+set @arg14= 'abc';
+set @arg14= NULL ;
+set @arg15= CAST('abc' as binary) ;
+set @arg15= NULL ;
+create table t5 as select
+8 as const01, @arg01 as param01,
+8.0 as const02, @arg02 as param02,
+80.00000000000e-1 as const03, @arg03 as param03,
+'abc' as const04, @arg04 as param04,
+CAST('abc' as binary) as const05, @arg05 as param05,
+'1991-08-05' as const06, @arg06 as param06,
+CAST('1991-08-05' as date) as const07, @arg07 as param07,
+'1991-08-05 01:01:01' as const08, @arg08 as param08,
+CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09,
+unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10,
+YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11,
+NULL as const12, @arg12 as param12,
+@arg13 as param13,
+@arg14 as param14,
+@arg15 as param15;
+show create table t5 ;
+Table Create Table
+t5 CREATE TABLE `t5` (
+ `const01` int(1) NOT NULL DEFAULT '0',
+ `param01` bigint(20) DEFAULT NULL,
+ `const02` decimal(2,1) NOT NULL DEFAULT '0.0',
+ `param02` decimal(65,30) DEFAULT NULL,
+ `const03` double NOT NULL DEFAULT '0',
+ `param03` double DEFAULT NULL,
+ `const04` varchar(3) NOT NULL DEFAULT '',
+ `param04` longtext,
+ `const05` varbinary(3) NOT NULL DEFAULT '',
+ `param05` longblob,
+ `const06` varchar(10) NOT NULL DEFAULT '',
+ `param06` longtext,
+ `const07` date DEFAULT NULL,
+ `param07` longblob,
+ `const08` varchar(19) NOT NULL DEFAULT '',
+ `param08` longtext,
+ `const09` datetime DEFAULT NULL,
+ `param09` longblob,
+ `const10` int(10) NOT NULL DEFAULT '0',
+ `param10` bigint(20) DEFAULT NULL,
+ `const11` int(4) DEFAULT NULL,
+ `param11` bigint(20) DEFAULT NULL,
+ `const12` binary(0) DEFAULT NULL,
+ `param12` bigint(20) DEFAULT NULL,
+ `param13` decimal(65,30) DEFAULT NULL,
+ `param14` longtext,
+ `param15` longblob
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+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 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
+def test t5 t5 param04 param04 252 4294967295 3 Y 16 0 8
+def test t5 t5 const05 const05 253 3 3 N 129 0 63
+def test t5 t5 param05 param05 252 4294967295 3 Y 144 0 63
+def test t5 t5 const06 const06 253 10 10 N 1 0 8
+def test t5 t5 param06 param06 252 4294967295 10 Y 16 0 8
+def test t5 t5 const07 const07 10 10 10 Y 128 0 63
+def test t5 t5 param07 param07 252 4294967295 10 Y 144 0 63
+def test t5 t5 const08 const08 253 19 19 N 1 0 8
+def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8
+def test t5 t5 const09 const09 12 19 19 Y 128 0 63
+def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63
+def test t5 t5 const10 const10 3 10 9 N 32769 0 63
+def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
+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 param14 param14 252 4294967295 0 Y 16 0 8
+def test t5 t5 param15 param15 252 4294967295 0 Y 144 0 63
+const01 8
+param01 8
+const02 8.0
+param02 8.000000000000000000000000000000
+const03 8
+param03 8
+const04 abc
+param04 abc
+const05 abc
+param05 abc
+const06 1991-08-05
+param06 1991-08-05
+const07 1991-08-05
+param07 1991-08-05
+const08 1991-08-05 01:01:01
+param08 1991-08-05 01:01:01
+const09 1991-08-05 01:01:01
+param09 1991-08-05 01:01:01
+const10 662680861
+param10 662680861
+const11 1991
+param11 1991
+const12 NULL
+param12 NULL
+param13 NULL
+param14 NULL
+param15 NULL
+drop table t5 ;
+test_sequence
+------ data type conversion tests ------
+delete from t1 ;
+insert into t1 values (1,'one');
+insert into t1 values (2,'two');
+insert into t1 values (3,'three');
+insert into t1 values (4,'four');
+commit ;
+delete from t9 ;
+insert into t9
+set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1,
+c10= 1, c11= 1, c12 = 1,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=true, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday';
+insert into t9
+set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9,
+c10= 9, c11= 9, c12 = 9,
+c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11',
+c16= '11:11:11', c17= '2004',
+c18= 1, c19=false, c20= 'a', c21= '123456789a',
+c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext',
+c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext',
+c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday';
+commit ;
+insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ;
+select * from t9 order by c1 ;
+c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32
+0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
+1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
+9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
+test_sequence
+------ select @parameter:= column ------
+prepare full_info from "select @arg01, @arg02, @arg03, @arg04,
+ @arg05, @arg06, @arg07, @arg08,
+ @arg09, @arg10, @arg11, @arg12,
+ @arg13, @arg14, @arg15, @arg16,
+ @arg17, @arg18, @arg19, @arg20,
+ @arg21, @arg22, @arg23, @arg24,
+ @arg25, @arg26, @arg27, @arg28,
+ @arg29, @arg30, @arg31, @arg32" ;
+select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
+@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8,
+@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12,
+@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16,
+@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20,
+@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24,
+@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28,
+@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32
+from t9 where c1= 1 ;
+@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
+1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
+execute full_info ;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 1 Y 32896 0 63
+def @arg03 8 20 1 Y 32896 0 63
+def @arg04 8 20 1 Y 32896 0 63
+def @arg05 8 20 1 Y 32896 0 63
+def @arg06 8 20 1 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 8 Y 128 31 63
+def @arg17 8 20 4 Y 32928 0 63
+def @arg18 8 20 1 Y 32896 0 63
+def @arg19 8 20 1 Y 32896 0 63
+def @arg20 251 16777216 1 Y 0 31 8
+def @arg21 251 16777216 10 Y 0 31 8
+def @arg22 251 16777216 30 Y 0 31 8
+def @arg23 251 16777216 8 Y 128 31 63
+def @arg24 251 16777216 8 Y 0 31 8
+def @arg25 251 16777216 4 Y 128 31 63
+def @arg26 251 16777216 4 Y 0 31 8
+def @arg27 251 16777216 10 Y 128 31 63
+def @arg28 251 16777216 10 Y 0 31 8
+def @arg29 251 16777216 8 Y 128 31 63
+def @arg30 251 16777216 8 Y 0 31 8
+def @arg31 251 16777216 3 Y 0 31 8
+def @arg32 251 16777216 6 Y 0 31 8
+@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
+1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
+select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
+@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8,
+@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12,
+@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16,
+@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20,
+@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24,
+@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28,
+@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32
+from t9 where c1= 0 ;
+@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
+0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
+execute full_info ;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 0 Y 32896 0 63
+def @arg03 8 20 0 Y 32896 0 63
+def @arg04 8 20 0 Y 32896 0 63
+def @arg05 8 20 0 Y 32896 0 63
+def @arg06 8 20 0 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 0 Y 128 31 63
+def @arg17 8 20 0 Y 32928 0 63
+def @arg18 8 20 0 Y 32896 0 63
+def @arg19 8 20 0 Y 32896 0 63
+def @arg20 251 16777216 0 Y 0 31 8
+def @arg21 251 16777216 0 Y 0 31 8
+def @arg22 251 16777216 0 Y 0 31 8
+def @arg23 251 16777216 0 Y 128 31 63
+def @arg24 251 16777216 0 Y 0 31 8
+def @arg25 251 16777216 0 Y 128 31 63
+def @arg26 251 16777216 0 Y 0 31 8
+def @arg27 251 16777216 0 Y 128 31 63
+def @arg28 251 16777216 0 Y 0 31 8
+def @arg29 251 16777216 0 Y 128 31 63
+def @arg30 251 16777216 0 Y 0 31 8
+def @arg31 251 16777216 0 Y 0 31 8
+def @arg32 251 16777216 0 Y 0 31 8
+@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
+0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
+prepare stmt1 from "select
+ @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
+ @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8,
+ @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12,
+ @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16,
+ @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20,
+ @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24,
+ @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28,
+ @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32
+from t9 where c1= ?" ;
+set @my_key= 1 ;
+execute stmt1 using @my_key ;
+@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
+1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
+execute full_info ;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 1 Y 32896 0 63
+def @arg03 8 20 1 Y 32896 0 63
+def @arg04 8 20 1 Y 32896 0 63
+def @arg05 8 20 1 Y 32896 0 63
+def @arg06 8 20 1 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 8 Y 128 31 63
+def @arg17 8 20 4 Y 32928 0 63
+def @arg18 8 20 1 Y 32896 0 63
+def @arg19 8 20 1 Y 32896 0 63
+def @arg20 251 16777216 1 Y 0 31 8
+def @arg21 251 16777216 10 Y 0 31 8
+def @arg22 251 16777216 30 Y 0 31 8
+def @arg23 251 16777216 8 Y 128 31 63
+def @arg24 251 16777216 8 Y 0 31 8
+def @arg25 251 16777216 4 Y 128 31 63
+def @arg26 251 16777216 4 Y 0 31 8
+def @arg27 251 16777216 10 Y 128 31 63
+def @arg28 251 16777216 10 Y 0 31 8
+def @arg29 251 16777216 8 Y 128 31 63
+def @arg30 251 16777216 8 Y 0 31 8
+def @arg31 251 16777216 3 Y 0 31 8
+def @arg32 251 16777216 6 Y 0 31 8
+@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
+1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
+set @my_key= 0 ;
+execute stmt1 using @my_key ;
+@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32
+0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
+execute full_info ;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 0 Y 32896 0 63
+def @arg03 8 20 0 Y 32896 0 63
+def @arg04 8 20 0 Y 32896 0 63
+def @arg05 8 20 0 Y 32896 0 63
+def @arg06 8 20 0 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 0 Y 128 31 63
+def @arg17 8 20 0 Y 32928 0 63
+def @arg18 8 20 0 Y 32896 0 63
+def @arg19 8 20 0 Y 32896 0 63
+def @arg20 251 16777216 0 Y 0 31 8
+def @arg21 251 16777216 0 Y 0 31 8
+def @arg22 251 16777216 0 Y 0 31 8
+def @arg23 251 16777216 0 Y 128 31 63
+def @arg24 251 16777216 0 Y 0 31 8
+def @arg25 251 16777216 0 Y 128 31 63
+def @arg26 251 16777216 0 Y 0 31 8
+def @arg27 251 16777216 0 Y 128 31 63
+def @arg28 251 16777216 0 Y 0 31 8
+def @arg29 251 16777216 0 Y 128 31 63
+def @arg30 251 16777216 0 Y 0 31 8
+def @arg31 251 16777216 0 Y 0 31 8
+def @arg32 251 16777216 0 Y 0 31 8
+@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
+0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
+prepare stmt1 from "select ? := c1 from t9 where c1= 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 ':= c1 from t9 where c1= 1' at line 1
+test_sequence
+------ select column, .. into @parm,.. ------
+select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
+c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24,
+c25, c26, c27, c28, c29, c30, c31, c32
+into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
+@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16,
+@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24,
+@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32
+from t9 where c1= 1 ;
+execute full_info ;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 1 Y 32896 0 63
+def @arg03 8 20 1 Y 32896 0 63
+def @arg04 8 20 1 Y 32896 0 63
+def @arg05 8 20 1 Y 32896 0 63
+def @arg06 8 20 1 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 8 Y 128 31 63
+def @arg17 8 20 4 Y 32928 0 63
+def @arg18 8 20 1 Y 32896 0 63
+def @arg19 8 20 1 Y 32896 0 63
+def @arg20 251 16777216 1 Y 0 31 8
+def @arg21 251 16777216 10 Y 0 31 8
+def @arg22 251 16777216 30 Y 0 31 8
+def @arg23 251 16777216 8 Y 128 31 63
+def @arg24 251 16777216 8 Y 0 31 8
+def @arg25 251 16777216 4 Y 128 31 63
+def @arg26 251 16777216 4 Y 0 31 8
+def @arg27 251 16777216 10 Y 128 31 63
+def @arg28 251 16777216 10 Y 0 31 8
+def @arg29 251 16777216 8 Y 128 31 63
+def @arg30 251 16777216 8 Y 0 31 8
+def @arg31 251 16777216 3 Y 0 31 8
+def @arg32 251 16777216 6 Y 0 31 8
+@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
+1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
+select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
+c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24,
+c25, c26, c27, c28, c29, c30, c31, c32
+into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
+@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16,
+@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24,
+@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32
+from t9 where c1= 0 ;
+execute full_info ;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 0 Y 32896 0 63
+def @arg03 8 20 0 Y 32896 0 63
+def @arg04 8 20 0 Y 32896 0 63
+def @arg05 8 20 0 Y 32896 0 63
+def @arg06 8 20 0 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 0 Y 128 31 63
+def @arg17 8 20 0 Y 32928 0 63
+def @arg18 8 20 0 Y 32896 0 63
+def @arg19 8 20 0 Y 32896 0 63
+def @arg20 251 16777216 0 Y 0 31 8
+def @arg21 251 16777216 0 Y 0 31 8
+def @arg22 251 16777216 0 Y 0 31 8
+def @arg23 251 16777216 0 Y 128 31 63
+def @arg24 251 16777216 0 Y 0 31 8
+def @arg25 251 16777216 0 Y 128 31 63
+def @arg26 251 16777216 0 Y 0 31 8
+def @arg27 251 16777216 0 Y 128 31 63
+def @arg28 251 16777216 0 Y 0 31 8
+def @arg29 251 16777216 0 Y 128 31 63
+def @arg30 251 16777216 0 Y 0 31 8
+def @arg31 251 16777216 0 Y 0 31 8
+def @arg32 251 16777216 0 Y 0 31 8
+@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
+0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
+prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
+ c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24,
+ c25, c26, c27, c28, c29, c30, c31, c32
+into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
+ @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16,
+ @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24,
+ @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32
+from t9 where c1= ?" ;
+set @my_key= 1 ;
+execute stmt1 using @my_key ;
+execute full_info ;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 1 Y 32896 0 63
+def @arg03 8 20 1 Y 32896 0 63
+def @arg04 8 20 1 Y 32896 0 63
+def @arg05 8 20 1 Y 32896 0 63
+def @arg06 8 20 1 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 8 Y 128 31 63
+def @arg17 8 20 4 Y 32928 0 63
+def @arg18 8 20 1 Y 32896 0 63
+def @arg19 8 20 1 Y 32896 0 63
+def @arg20 251 16777216 1 Y 0 31 8
+def @arg21 251 16777216 10 Y 0 31 8
+def @arg22 251 16777216 30 Y 0 31 8
+def @arg23 251 16777216 8 Y 128 31 63
+def @arg24 251 16777216 8 Y 0 31 8
+def @arg25 251 16777216 4 Y 128 31 63
+def @arg26 251 16777216 4 Y 0 31 8
+def @arg27 251 16777216 10 Y 128 31 63
+def @arg28 251 16777216 10 Y 0 31 8
+def @arg29 251 16777216 8 Y 128 31 63
+def @arg30 251 16777216 8 Y 0 31 8
+def @arg31 251 16777216 3 Y 0 31 8
+def @arg32 251 16777216 6 Y 0 31 8
+@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
+1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
+set @my_key= 0 ;
+execute stmt1 using @my_key ;
+execute full_info ;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def @arg01 8 20 1 Y 32896 0 63
+def @arg02 8 20 0 Y 32896 0 63
+def @arg03 8 20 0 Y 32896 0 63
+def @arg04 8 20 0 Y 32896 0 63
+def @arg05 8 20 0 Y 32896 0 63
+def @arg06 8 20 0 Y 32896 0 63
+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 @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
+def @arg16 251 16777216 0 Y 128 31 63
+def @arg17 8 20 0 Y 32928 0 63
+def @arg18 8 20 0 Y 32896 0 63
+def @arg19 8 20 0 Y 32896 0 63
+def @arg20 251 16777216 0 Y 0 31 8
+def @arg21 251 16777216 0 Y 0 31 8
+def @arg22 251 16777216 0 Y 0 31 8
+def @arg23 251 16777216 0 Y 128 31 63
+def @arg24 251 16777216 0 Y 0 31 8
+def @arg25 251 16777216 0 Y 128 31 63
+def @arg26 251 16777216 0 Y 0 31 8
+def @arg27 251 16777216 0 Y 128 31 63
+def @arg28 251 16777216 0 Y 0 31 8
+def @arg29 251 16777216 0 Y 128 31 63
+def @arg30 251 16777216 0 Y 0 31 8
+def @arg31 251 16777216 0 Y 0 31 8
+def @arg32 251 16777216 0 Y 0 31 8
+@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
+0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
+prepare stmt1 from "select c1 into ? from t9 where c1= 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 '? from t9 where c1= 1' at line 1
+test_sequence
+-- insert into numeric columns --
+insert into t9
+( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
+values
+( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ;
+set @arg00= 21 ;
+insert into t9
+( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
+values
+( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
+prepare stmt1 from "insert into t9
+ ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
+values
+ ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ;
+execute stmt1 ;
+set @arg00= 23;
+prepare stmt2 from "insert into t9
+ ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
+values
+ ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
+execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00 ;
+insert into t9
+( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
+values
+( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0,
+30.0, 30.0, 30.0 ) ;
+set @arg00= 31.0 ;
+insert into t9
+( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
+values
+( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
+prepare stmt1 from "insert into t9
+ ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
+values
+ ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0,
+ 32.0, 32.0, 32.0 )" ;
+execute stmt1 ;
+set @arg00= 33.0;
+prepare stmt2 from "insert into t9
+ ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
+values
+ ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
+execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00 ;
+insert into t9
+( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
+values
+( '40', '40', '40', '40', '40', '40', '40', '40',
+'40', '40', '40' ) ;
+set @arg00= '41' ;
+insert into t9
+( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
+values
+( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
+prepare stmt1 from "insert into t9
+ ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
+values
+ ( '42', '42', '42', '42', '42', '42', '42', '42',
+ '42', '42', '42' )" ;
+execute stmt1 ;
+set @arg00= '43';
+prepare stmt2 from "insert into t9
+ ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
+values
+ ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
+execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00 ;
+insert into t9
+( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
+values
+( CAST('50' as binary), CAST('50' as binary),
+CAST('50' as binary), CAST('50' as binary), CAST('50' as binary),
+CAST('50' as binary), CAST('50' as binary), CAST('50' as binary),
+CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ;
+set @arg00= CAST('51' as binary) ;
+insert into t9
+( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
+values
+( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
+prepare stmt1 from "insert into t9
+ ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
+values
+ ( CAST('52' as binary), CAST('52' as binary),
+ CAST('52' as binary), CAST('52' as binary), CAST('52' as binary),
+ CAST('52' as binary), CAST('52' as binary), CAST('52' as binary),
+ CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ;
+execute stmt1 ;
+set @arg00= CAST('53' as binary) ;
+prepare stmt2 from "insert into t9
+ ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
+values
+ ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
+execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00 ;
+set @arg00= 2 ;
+set @arg00= NULL ;
+insert into t9
+( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
+values
+( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+NULL, NULL, NULL ) ;
+insert into t9
+( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
+values
+( 61, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
+prepare stmt1 from "insert into t9
+ ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
+values
+ ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL )" ;
+execute stmt1 ;
+prepare stmt2 from "insert into t9
+ ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
+values
+ ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
+execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00 ;
+set @arg00= 8.0 ;
+set @arg00= NULL ;
+insert into t9
+( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
+values
+( 71, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
+prepare stmt2 from "insert into t9
+ ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
+values
+ ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
+execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00 ;
+set @arg00= 'abc' ;
+set @arg00= NULL ;
+insert into t9
+( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
+values
+( 81, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00, @arg00 ) ;
+prepare stmt2 from "insert into t9
+ ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
+values
+ ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
+execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00 ;
+select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12
+from t9 where c1 >= 20
+order by c1 ;
+c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12
+20 20 20 20 20 20 20 20 20 20 20.0000
+21 21 21 21 21 21 21 21 21 21 21.0000
+22 22 22 22 22 22 22 22 22 22 22.0000
+23 23 23 23 23 23 23 23 23 23 23.0000
+30 30 30 30 30 30 30 30 30 30 30.0000
+31 31 31 31 31 31 31 31 31 31 31.0000
+32 32 32 32 32 32 32 32 32 32 32.0000
+33 33 33 33 33 33 33 33 33 33 33.0000
+40 40 40 40 40 40 40 40 40 40 40.0000
+41 41 41 41 41 41 41 41 41 41 41.0000
+42 42 42 42 42 42 42 42 42 42 42.0000
+43 43 43 43 43 43 43 43 43 43 43.0000
+50 50 50 50 50 50 50 50 50 50 50.0000
+51 51 51 51 51 51 51 51 51 51 51.0000
+52 52 52 52 52 52 52 52 52 52 52.0000
+53 53 53 53 53 53 53 53 53 53 53.0000
+60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
+61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
+62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
+63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
+71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
+73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
+81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
+83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
+test_sequence
+-- select .. where numeric column = .. --
+set @arg00= 20;
+select 'true' as found from t9
+where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20
+and c8= 20 and c9= 20 and c10= 20 and c12= 20;
+found
+true
+select 'true' as found from t9
+where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
+and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
+and c12= @arg00;
+found
+true
+prepare stmt1 from "select 'true' as found from t9
+where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20
+ and c8= 20 and c9= 20 and c10= 20 and c12= 20 ";
+execute stmt1 ;
+found
+true
+prepare stmt1 from "select 'true' as found from t9
+where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
+ and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
+ and c12= ? ";
+execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00 ;
+found
+true
+set @arg00= 20.0;
+select 'true' as found from t9
+where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0
+and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0;
+found
+true
+select 'true' as found from t9
+where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
+and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
+and c12= @arg00;
+found
+true
+prepare stmt1 from "select 'true' as found from t9
+where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0
+ and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 ";
+execute stmt1 ;
+found
+true
+prepare stmt1 from "select 'true' as found from t9
+where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
+ and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
+ and c12= ? ";
+execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00 ;
+found
+true
+select 'true' as found from t9
+where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20'
+ and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20';
+found
+true
+prepare stmt1 from "select 'true' as found from t9
+where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20'
+ and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' ";
+execute stmt1 ;
+found
+true
+set @arg00= '20';
+select 'true' as found from t9
+where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
+and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
+and c12= @arg00;
+found
+true
+prepare stmt1 from "select 'true' as found from t9
+where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
+ and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
+ and c12= ? ";
+execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00 ;
+found
+true
+select 'true' as found from t9
+where c1= CAST('20' as binary) and c2= CAST('20' as binary) and
+c3= CAST('20' as binary) and c4= CAST('20' as binary) and
+c5= CAST('20' as binary) and c6= CAST('20' as binary) and
+c7= CAST('20' as binary) and c8= CAST('20' as binary) and
+c9= CAST('20' as binary) and c10= CAST('20' as binary) and
+c12= CAST('20' as binary);
+found
+true
+prepare stmt1 from "select 'true' as found from t9
+where c1= CAST('20' as binary) and c2= CAST('20' as binary) and
+ c3= CAST('20' as binary) and c4= CAST('20' as binary) and
+ c5= CAST('20' as binary) and c6= CAST('20' as binary) and
+ c7= CAST('20' as binary) and c8= CAST('20' as binary) and
+ c9= CAST('20' as binary) and c10= CAST('20' as binary) and
+ c12= CAST('20' as binary) ";
+execute stmt1 ;
+found
+true
+set @arg00= CAST('20' as binary) ;
+select 'true' as found from t9
+where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00
+and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00
+and c12= @arg00;
+found
+true
+prepare stmt1 from "select 'true' as found from t9
+where c1= ? and c2= ? and c3= ? and c4= ? and c5= ?
+ and c6= ? and c7= ? and c8= ? and c9= ? and c10= ?
+ and c12= ? ";
+execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00 ;
+found
+true
+delete from t9 ;
+test_sequence
+-- some numeric overflow experiments --
+prepare my_insert from "insert into t9
+ ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 )
+values
+ ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
+prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12
+from t9 where c21 = 'O' ";
+prepare my_delete from "delete from t9 where c21 = 'O' ";
+set @arg00= 9223372036854775807 ;
+execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00, @arg00 ;
+Warnings:
+Warning 1264 Out of range value for column 'c1' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c3' at row 1
+Warning 1264 Out of range value for column 'c4' at row 1
+Warning 1264 Out of range value for column 'c5' at row 1
+Warning 1264 Out of range value for column 'c12' at row 1
+execute my_select ;
+c1 127
+c2 32767
+c3 8388607
+c4 2147483647
+c5 2147483647
+c6 9223372036854775807
+c7 9.22337e+18
+c8 9.22337203685478e+18
+c9 9.22337203685478e+18
+c10 9.22337203685478e+18
+c12 9999.9999
+execute my_delete ;
+set @arg00= '9223372036854775807' ;
+execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00, @arg00 ;
+Warnings:
+Warning 1264 Out of range value for column 'c1' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c3' at row 1
+Warning 1264 Out of range value for column 'c4' at row 1
+Warning 1264 Out of range value for column 'c5' at row 1
+Warning 1264 Out of range value for column 'c12' at row 1
+execute my_select ;
+c1 127
+c2 32767
+c3 8388607
+c4 2147483647
+c5 2147483647
+c6 9223372036854775807
+c7 9.22337e+18
+c8 9.22337203685478e+18
+c9 9.22337203685478e+18
+c10 9.22337203685478e+18
+c12 9999.9999
+execute my_delete ;
+set @arg00= -9223372036854775808 ;
+execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00, @arg00 ;
+Warnings:
+Warning 1264 Out of range value for column 'c1' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c3' at row 1
+Warning 1264 Out of range value for column 'c4' at row 1
+Warning 1264 Out of range value for column 'c5' at row 1
+Warning 1264 Out of range value for column 'c12' at row 1
+execute my_select ;
+c1 -128
+c2 -32768
+c3 -8388608
+c4 -2147483648
+c5 -2147483648
+c6 -9223372036854775808
+c7 -9.22337e+18
+c8 -9.22337203685478e+18
+c9 -9.22337203685478e+18
+c10 -9.22337203685478e+18
+c12 -9999.9999
+execute my_delete ;
+set @arg00= '-9223372036854775808' ;
+execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00, @arg00 ;
+Warnings:
+Warning 1264 Out of range value for column 'c1' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c3' at row 1
+Warning 1264 Out of range value for column 'c4' at row 1
+Warning 1264 Out of range value for column 'c5' at row 1
+Warning 1264 Out of range value for column 'c12' at row 1
+execute my_select ;
+c1 -128
+c2 -32768
+c3 -8388608
+c4 -2147483648
+c5 -2147483648
+c6 -9223372036854775808
+c7 -9.22337e+18
+c8 -9.22337203685478e+18
+c9 -9.22337203685478e+18
+c10 -9.22337203685478e+18
+c12 -9999.9999
+execute my_delete ;
+set @arg00= 1.11111111111111111111e+50 ;
+execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00, @arg00 ;
+Warnings:
+Warning 1264 Out of range value for column 'c1' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c3' at row 1
+Warning 1264 Out of range value for column 'c4' at row 1
+Warning 1264 Out of range value for column 'c5' at row 1
+Warning 1264 Out of range value for column 'c6' at row 1
+Warning 1264 Out of range value for column 'c7' at row 1
+Warning 1264 Out of range value for column 'c12' at row 1
+execute my_select ;
+c1 127
+c2 32767
+c3 8388607
+c4 2147483647
+c5 2147483647
+c6 9223372036854775807
+c7 3.40282e+38
+c8 1.11111111111111e+50
+c9 1.11111111111111e+50
+c10 1.11111111111111e+50
+c12 9999.9999
+execute my_delete ;
+set @arg00= '1.11111111111111111111e+50' ;
+execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00, @arg00 ;
+Warnings:
+Warning 1264 Out of range value for column 'c1' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c3' at row 1
+Warning 1264 Out of range value for column 'c4' at row 1
+Warning 1264 Out of range value for column 'c5' at row 1
+Warning 1264 Out of range value for column 'c6' at row 1
+Warning 1264 Out of range value for column 'c7' at row 1
+Warning 1264 Out of range value for column 'c12' at row 1
+execute my_select ;
+c1 127
+c2 32767
+c3 8388607
+c4 2147483647
+c5 2147483647
+c6 9223372036854775807
+c7 3.40282e+38
+c8 1.11111111111111e+50
+c9 1.11111111111111e+50
+c10 1.11111111111111e+50
+c12 9999.9999
+execute my_delete ;
+set @arg00= -1.11111111111111111111e+50 ;
+execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00, @arg00 ;
+Warnings:
+Warning 1264 Out of range value for column 'c1' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c3' at row 1
+Warning 1264 Out of range value for column 'c4' at row 1
+Warning 1264 Out of range value for column 'c5' at row 1
+Warning 1264 Out of range value for column 'c6' at row 1
+Warning 1264 Out of range value for column 'c7' at row 1
+Warning 1264 Out of range value for column 'c12' at row 1
+execute my_select ;
+c1 -128
+c2 -32768
+c3 -8388608
+c4 -2147483648
+c5 -2147483648
+c6 -9223372036854775808
+c7 -3.40282e+38
+c8 -1.11111111111111e+50
+c9 -1.11111111111111e+50
+c10 -1.11111111111111e+50
+c12 -9999.9999
+execute my_delete ;
+set @arg00= '-1.11111111111111111111e+50' ;
+execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00, @arg00 ;
+Warnings:
+Warning 1264 Out of range value for column 'c1' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c3' at row 1
+Warning 1264 Out of range value for column 'c4' at row 1
+Warning 1264 Out of range value for column 'c5' at row 1
+Warning 1264 Out of range value for column 'c6' at row 1
+Warning 1264 Out of range value for column 'c7' at row 1
+Warning 1264 Out of range value for column 'c12' at row 1
+execute my_select ;
+c1 -128
+c2 -32768
+c3 -8388608
+c4 -2147483648
+c5 -2147483648
+c6 -9223372036854775808
+c7 -3.40282e+38
+c8 -1.11111111111111e+50
+c9 -1.11111111111111e+50
+c10 -1.11111111111111e+50
+c12 -9999.9999
+execute my_delete ;
+test_sequence
+-- insert into string columns --
+Warnings:
+Warning 1265 Data truncated for column 'c20' at row 1
+Warnings:
+Warning 1265 Data truncated for column 'c20' at row 1
+Warnings:
+Warning 1265 Data truncated for column 'c20' at row 1
+Warnings:
+Warning 1265 Data truncated for column 'c20' at row 1
+Warnings:
+Warning 1265 Data truncated for column 'c20' at row 1
+Warnings:
+Warning 1265 Data truncated for column 'c20' at row 1
+Warnings:
+Warning 1265 Data truncated for column 'c20' at row 1
+Warnings:
+Warning 1265 Data truncated for column 'c20' at row 1
+Warnings:
+Warning 1265 Data truncated for column 'c20' at row 1
+Warnings:
+Warning 1265 Data truncated for column 'c20' at row 1
+Warnings:
+Warning 1265 Data truncated for column 'c20' at row 1
+Warnings:
+Warning 1265 Data truncated for column 'c20' at row 1
+Warnings:
+Warning 1265 Data truncated for column 'c20' at row 1
+Warnings:
+Warning 1265 Data truncated for column 'c20' at row 1
+Warnings:
+Warning 1265 Data truncated for column 'c20' at row 1
+Warnings:
+Warning 1265 Data truncated for column 'c20' at row 1
+Warnings:
+Warning 1265 Data truncated for column 'c20' at row 1
+Warnings:
+Warning 1265 Data truncated for column 'c20' at row 1
+Warnings:
+Warning 1265 Data truncated for column 'c20' at row 1
+Warnings:
+Warning 1265 Data truncated for column 'c20' at row 1
+select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30
+from t9 where c1 >= 20
+order by c1 ;
+c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30
+20 2 20 20 20 20 20 20 20 20 20 20
+21 2 21 21 21 21 21 21 21 21 21 21
+22 2 22 22 22 22 22 22 22 22 22 22
+23 2 23 23 23 23 23 23 23 23 23 23
+30 3 30 30 30 30 30 30 30 30 30 30
+31 3 31 31 31 31 31 31 31 31 31 31
+32 3 32 32 32 32 32 32 32 32 32 32
+33 3 33 33 33 33 33 33 33 33 33 33
+40 4 40 40 40 40 40 40 40 40 40 40
+41 4 41 41 41 41 41 41 41 41 41 41
+42 4 42 42 42 42 42 42 42 42 42 42
+43 4 43 43 43 43 43 43 43 43 43 43
+50 5 50.0 50.0 50.0 50.0 50.0 50.0 50.0 50.0 50.0 50.0
+51 5 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0
+52 5 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0
+53 5 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0
+54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00
+55 5 55 55 55 55 55 55 55 55 55 55
+56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00
+57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00
+60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
+61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
+62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
+63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
+71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
+73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
+81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
+83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
+test_sequence
+-- select .. where string column = .. --
+set @arg00= '20';
+select 'true' as found from t9
+where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and
+c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and
+c27= '20' and c28= '20' and c29= '20' and c30= '20' ;
+found
+true
+select 'true' as found from t9
+where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and
+c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
+c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00;
+found
+true
+prepare stmt1 from "select 'true' as found from t9
+where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and
+ c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and
+ c27= '20' and c28= '20' and c29= '20' and c30= '20'" ;
+execute stmt1 ;
+found
+true
+prepare stmt1 from "select 'true' as found from t9
+where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and
+ c21= ? and c22= ? and c23= ? and c25= ? and
+ c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ;
+execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00, @arg00 ;
+found
+true
+set @arg00= CAST('20' as binary);
+select 'true' as found from t9
+where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20)))
+= CAST('20' as binary) and c21= CAST('20' as binary)
+and c22= CAST('20' as binary) and c23= CAST('20' as binary) and
+c24= CAST('20' as binary) and c25= CAST('20' as binary) and
+c26= CAST('20' as binary) and c27= CAST('20' as binary) and
+c28= CAST('20' as binary) and c29= CAST('20' as binary) and
+c30= CAST('20' as binary) ;
+found
+true
+select 'true' as found from t9
+where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and
+c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
+c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and
+c30= @arg00;
+found
+true
+prepare stmt1 from "select 'true' as found from t9
+where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20)))
+ = CAST('20' as binary) and c21= CAST('20' as binary)
+ and c22= CAST('20' as binary) and c23= CAST('20' as binary) and
+ c24= CAST('20' as binary) and c25= CAST('20' as binary) and
+ c26= CAST('20' as binary) and c27= CAST('20' as binary) and
+ c28= CAST('20' as binary) and c29= CAST('20' as binary) and
+ c30= CAST('20' as binary)" ;
+execute stmt1 ;
+found
+true
+prepare stmt1 from "select 'true' as found from t9
+where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and
+ c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and
+ c29= ? and c30= ?";
+execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00, @arg00 ;
+found
+true
+set @arg00= 20;
+select 'true' as found from t9
+where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and
+c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and
+c27= 20 and c28= 20 and c29= 20 and c30= 20 ;
+found
+true
+select 'true' as found from t9
+where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and
+c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
+c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00;
+found
+true
+prepare stmt1 from "select 'true' as found from t9
+where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and
+ c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and
+ c27= 20 and c28= 20 and c29= 20 and c30= 20" ;
+execute stmt1 ;
+found
+true
+prepare stmt1 from "select 'true' as found from t9
+where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and
+ c21= ? and c22= ? and c23= ? and c25= ? and
+ c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ;
+execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00, @arg00 ;
+found
+true
+set @arg00= 20.0;
+select 'true' as found from t9
+where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and
+c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and
+c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ;
+found
+true
+select 'true' as found from t9
+where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and
+c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and
+c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00;
+found
+true
+prepare stmt1 from "select 'true' as found from t9
+where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and
+ c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and
+ c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ;
+execute stmt1 ;
+found
+true
+prepare stmt1 from "select 'true' as found from t9
+where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and
+ c21= ? and c22= ? and c23= ? and c25= ? and
+ c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ;
+execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
+@arg00, @arg00, @arg00, @arg00, @arg00 ;
+found
+true
+delete from t9 ;
+test_sequence
+-- insert into date/time columns --
+Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
+Warning 1265 Data truncated for column 'c17' at row 1
+Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
+Warning 1265 Data truncated for column 'c17' at row 1
+Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
+Warning 1265 Data truncated for column 'c17' at row 1
+Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
+Warning 1265 Data truncated for column 'c17' at row 1
+Warnings:
+Warning 1265 Data truncated for column 'c17' at row 1
+Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
+Warning 1265 Data truncated for column 'c17' at row 1
+Warnings:
+Warning 1265 Data truncated for column 'c17' at row 1
+Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
+Warning 1265 Data truncated for column 'c17' at row 1
+Warnings:
+Warning 1264 Out of range value for column 'c13' at row 1
+Warning 1264 Out of range value for column 'c14' at row 1
+Warning 1265 Data truncated for column 'c15' at row 1
+Warning 1264 Out of range value for column 'c16' at row 1
+Warning 1264 Out of range value for column 'c17' at row 1
+Warnings:
+Warning 1264 Out of range value for column 'c13' at row 1
+Warning 1264 Out of range value for column 'c14' at row 1
+Warning 1265 Data truncated for column 'c15' at row 1
+Warning 1264 Out of range value for column 'c16' at row 1
+Warning 1264 Out of range value for column 'c17' at row 1
+Warnings:
+Warning 1264 Out of range value for column 'c13' at row 1
+Warning 1264 Out of range value for column 'c14' at row 1
+Warning 1265 Data truncated for column 'c15' at row 1
+Warning 1264 Out of range value for column 'c16' at row 1
+Warning 1264 Out of range value for column 'c17' at row 1
+Warnings:
+Warning 1264 Out of range value for column 'c13' at row 1
+Warning 1264 Out of range value for column 'c14' at row 1
+Warning 1265 Data truncated for column 'c15' at row 1
+Warning 1264 Out of range value for column 'c16' at row 1
+Warning 1264 Out of range value for column 'c17' at row 1
+Warnings:
+Warning 1265 Data truncated for column 'c15' at row 1
+Warning 1264 Out of range value for column 'c16' at row 1
+Warning 1264 Out of range value for column 'c17' at row 1
+Warnings:
+Note 1265 Data truncated for column 'c13' at row 1
+Warning 1265 Data truncated for column 'c15' at row 1
+Warning 1264 Out of range value for column 'c16' at row 1
+Warning 1264 Out of range value for column 'c17' at row 1
+Warnings:
+Warning 1265 Data truncated for column 'c15' at row 1
+Warning 1264 Out of range value for column 'c16' at row 1
+Warning 1264 Out of range value for column 'c17' at row 1
+Warnings:
+Warning 1265 Data truncated for column 'c15' at row 1
+Warning 1264 Out of range value for column 'c16' at row 1
+Warning 1264 Out of range value for column 'c17' at row 1
+select c1, c13, c14, c15, c16, c17 from t9 order by c1 ;
+c1 c13 c14 c15 c16 c17
+20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
+21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
+22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
+23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
+30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
+31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
+32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
+33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991
+40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
+41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
+42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
+43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
+50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
+51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
+52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
+53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
+60 NULL NULL 1991-01-01 01:01:01 NULL NULL
+61 NULL NULL 1991-01-01 01:01:01 NULL NULL
+62 NULL NULL 1991-01-01 01:01:01 NULL NULL
+63 NULL NULL 1991-01-01 01:01:01 NULL NULL
+71 NULL NULL 1991-01-01 01:01:01 NULL NULL
+73 NULL NULL 1991-01-01 01:01:01 NULL NULL
+81 NULL NULL 1991-01-01 01:01:01 NULL NULL
+83 NULL NULL 1991-01-01 01:01:01 NULL NULL
+test_sequence
+-- select .. where date/time column = .. --
+set @arg00= '1991-01-01 01:01:01' ;
+select 'true' as found from t9
+where c1= 20 and c13= CAST('1991-01-01 01:01:01' AS DATE) and c14= '1991-01-01 01:01:01' and
+c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
+c17= '1991-01-01 01:01:01' ;
+found
+true
+select 'true' as found from t9
+where c1= 20 and c13= CAST(@arg00 AS DATE) and c14= @arg00 and c15= @arg00 and c16= @arg00
+and c17= @arg00 ;
+found
+true
+prepare stmt1 from "select 'true' as found from t9
+where c1= 20 and c13= CAST('1991-01-01 01:01:01' AS DATE) and c14= '1991-01-01 01:01:01' and
+ c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and
+ c17= '1991-01-01 01:01:01'" ;
+execute stmt1 ;
+found
+true
+prepare stmt1 from "select 'true' as found from t9
+where c1= 20 and c13= CAST(? AS DATE) and c14= ? and c15= ? and c16= ? and c17= ?" ;
+execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
+found
+true
+set @arg00= CAST('1991-01-01 01:01:01' as datetime) ;
+select 'true' as found from t9
+where c1= 20 and c13= CAST('1991-01-01 00:00:00' as datetime) and
+c14= CAST('1991-01-01 01:01:01' as datetime) and
+c15= CAST('1991-01-01 01:01:01' as datetime) and
+c16= CAST('1991-01-01 01:01:01' as datetime) and
+c17= CAST('1991-01-01 01:01:01' as datetime) ;
+found
+true
+select 'true' as found from t9
+where c1= 20 and c13= CAST(@arg00 AS DATE) and c14= @arg00 and c15= @arg00 and c16= @arg00
+and c17= @arg00 ;
+found
+true
+prepare stmt1 from "select 'true' as found from t9
+where c1= 20 and c13= CAST('1991-01-01 00:00:00' as datetime) and
+ c14= CAST('1991-01-01 01:01:01' as datetime) and
+ c15= CAST('1991-01-01 01:01:01' as datetime) and
+ c16= CAST('1991-01-01 01:01:01' as datetime) and
+ c17= CAST('1991-01-01 01:01:01' as datetime)" ;
+execute stmt1 ;
+found
+true
+prepare stmt1 from "select 'true' as found from t9
+where c1= 20 and c13= CAST(? AS DATE) and c14= ? and c15= ? and c16= ? and c17= ?" ;
+execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
+found
+true
+set @arg00= 1991 ;
+select 'true' as found from t9
+where c1= 20 and c17= 1991 ;
+found
+true
+select 'true' as found from t9
+where c1= 20 and c17= @arg00 ;
+found
+true
+prepare stmt1 from "select 'true' as found from t9
+where c1= 20 and c17= 1991" ;
+execute stmt1 ;
+found
+true
+prepare stmt1 from "select 'true' as found from t9
+where c1= 20 and c17= ?" ;
+execute stmt1 using @arg00 ;
+found
+true
+set @arg00= 1.991e+3 ;
+select 'true' as found from t9
+where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ;
+found
+true
+select 'true' as found from t9
+where c1= 20 and abs(c17 - @arg00) < 0.01 ;
+found
+true
+prepare stmt1 from "select 'true' as found from t9
+where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ;
+execute stmt1 ;
+found
+true
+prepare stmt1 from "select 'true' as found from t9
+where c1= 20 and abs(c17 - ?) < 0.01" ;
+execute stmt1 using @arg00 ;
+found
+true
+drop table t1, t9;
diff --git a/mysql-test/r/strict_autoinc_5ndb.result b/mysql-test/suite/ndb/r/strict_autoinc_5ndb.result
index ea6e5ffc741..ea6e5ffc741 100644
--- a/mysql-test/r/strict_autoinc_5ndb.result
+++ b/mysql-test/suite/ndb/r/strict_autoinc_5ndb.result
diff --git a/mysql-test/suite/ndb/t/disabled.def b/mysql-test/suite/ndb/t/disabled.def
new file mode 100644
index 00000000000..9c2dc80d5ee
--- /dev/null
+++ b/mysql-test/suite/ndb/t/disabled.def
@@ -0,0 +1,21 @@
+##############################################################################
+#
+# 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.
+#
+##############################################################################
+ndb_dd_sql_features : Bug#29102 ndb_dd_sql_features fails in pushbuild
+ndb_load : BUG#17233 2006-05-04 tomas failed load data from infile causes mysqld dbug_assert, binlog not flushed
+
+partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table
+
+ndb_partition_error2 : HF is not sure if the test can work as internded on all the platforms
+
+# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
+#ndb_binlog_ddl_multi : BUG#18976 2006-04-10 kent CRBR: multiple binlog, second binlog may miss schema log events
+#ndb_binlog_discover : bug#21806 2006-08-24
diff --git a/mysql-test/t/loaddata_autocom_ndb.test b/mysql-test/suite/ndb/t/loaddata_autocom_ndb.test
index f4a6743aabe..f4a6743aabe 100644
--- a/mysql-test/t/loaddata_autocom_ndb.test
+++ b/mysql-test/suite/ndb/t/loaddata_autocom_ndb.test
diff --git a/mysql-test/suite/ndb/t/ndb_alter_table.test b/mysql-test/suite/ndb/t/ndb_alter_table.test
new file mode 100644
index 00000000000..082fe726927
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_alter_table.test
@@ -0,0 +1,438 @@
+-- source include/have_multi_ndb.inc
+-- source include/not_embedded.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+drop database if exists mysqltest;
+--enable_warnings
+
+connect (con1,localhost,root,,test);
+connect (con2,localhost,root,,test);
+
+connection con2;
+-- sleep 2
+connection con1;
+
+#
+# Basic test to show that the ALTER TABLE
+# is working
+#
+CREATE TABLE t1 (
+ a INT NOT NULL,
+ b INT NOT NULL
+) ENGINE=ndbcluster;
+
+INSERT INTO t1 VALUES (9410,9412);
+
+ALTER TABLE t1 ADD COLUMN c int not null;
+SELECT * FROM t1;
+
+DROP TABLE t1;
+
+#
+# Verfify changing table names between databases
+#
+CREATE DATABASE mysqltest;
+USE mysqltest;
+CREATE TABLE t1 (
+ a INT NOT NULL,
+ b INT NOT NULL
+) ENGINE=ndbcluster;
+RENAME TABLE t1 TO test.t1;
+SHOW TABLES;
+DROP DATABASE mysqltest;
+USE test;
+SHOW TABLES;
+DROP TABLE t1;
+
+#
+# More advanced test
+#
+create table t1 (
+col1 int not null auto_increment primary key,
+col2 varchar(30) not null,
+col3 varchar (20) not null,
+col4 varchar(4) not null,
+col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null,
+col6 int not null, to_be_deleted int) ENGINE=ndbcluster;
+--replace_column 6 # 7 # 8 # 10 # 12 # 13 # 14 # 18 #
+show table status;
+SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
+insert into t1 values
+(0,4,3,5,"PENDING",1,7),(NULL,4,3,5,"PENDING",1,7),(31,4,3,5,"PENDING",1,7), (7,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7), (100,4,3,5,"PENDING",1,7), (99,4,3,5,"PENDING",1,7), (8,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7);
+--replace_column 6 # 7 # 8 # 10 # 12 # 13 # 14 # 18 #
+show table status;
+select * from t1 order by col1;
+alter table t1
+add column col4_5 varchar(20) not null after col4,
+add column col7 varchar(30) not null after col5,
+add column col8 datetime not null, drop column to_be_deleted,
+change column col2 fourth varchar(30) not null after col3,
+modify column col6 int not null first;
+--replace_column 6 # 7 # 8 # 10 # 12 # 13 # 14 # 18 #
+show table status;
+select * from t1 order by col1;
+insert into t1 values (2, NULL,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00');
+--replace_column 6 # 7 # 8 # 10 # 12 # 13 # 14 # 18 #
+show table status;
+select * from t1 order by col1;
+delete from t1;
+insert into t1 values (0,0,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00');
+SET SQL_MODE='';
+insert into t1 values (1,0,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00');
+select * from t1 order by col1;
+alter table t1 drop column col4_5;
+insert into t1 values (2,0,4,3,5,"PENDING","EXTRA",'2004-01-01 00:00:00');
+select * from t1 order by col1;
+drop table t1;
+
+
+#
+# Check that invalidating dictionary cache works
+#
+
+CREATE TABLE t1 (
+ a INT NOT NULL,
+ b INT NOT NULL
+) ENGINE=ndbcluster;
+
+INSERT INTO t1 VALUES (9410,9412);
+
+ALTER TABLE t1 ADD COLUMN c int not null;
+select * from t1 order by a;
+
+connection con2;
+select * from t1 order by a;
+alter table t1 drop c;
+
+connection con1;
+select * from t1 order by a;
+drop table t1;
+
+connection con2;
+--error 1146
+select * from t1 order by a;
+
+CREATE TABLE t1 (
+ a INT NOT NULL PRIMARY KEY,
+ b INT NOT NULL
+) ENGINE=ndbcluster;
+
+INSERT INTO t1 VALUES (0,1),(17,18);
+select * from t1 order by a;
+SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
+alter table t1 modify column a int not null auto_increment;
+SET SQL_MODE='';
+select * from t1 order by a;
+INSERT INTO t1 VALUES (0,19),(20,21);
+select * from t1 order by a;
+drop table t1;
+
+CREATE TABLE t1 (
+ a INT NOT NULL PRIMARY KEY,
+ b INT NOT NULL
+) ENGINE=ndbcluster;
+
+INSERT INTO t1 VALUES (0,1),(17,18);
+select * from t1 order by a;
+alter table t1 add c int not null unique auto_increment;
+select c from t1 order by c;
+INSERT INTO t1 VALUES (1,2,0),(18,19,4),(20,21,0);
+select c from t1 order by c;
+drop table t1;
+
+## Test moved to ndb_alter_table_row|stmt respectively as behaviour differs
+#create table t1 ( a int primary key, b varchar(10), c varchar(10), index (b) )
+#engine=ndb;
+#insert into t1 values (1,'one','one'), (2,'two','two'), (3,'three','three');
+#create index c on t1(c);
+#connection server2;
+#select * from t1 where c = 'two';
+#connection server1;
+#alter table t1 drop index c;
+#connection server2;
+#select * from t1 where c = 'two';
+#connection server1;
+#drop table t1;
+
+#--disable_warnings
+#DROP TABLE IF EXISTS t2;
+#--enable_warnings
+
+#create table t2 (a int NOT NULL PRIMARY KEY) engine=myisam;
+#let $1=12001;
+#disable_query_log;
+#while ($1)
+#{
+# eval insert into t2 values($1);
+# dec $1;
+#}
+#enable_query_log;
+#alter table t2 engine=ndbcluster;
+#alter table t2 add c int;
+#--error 1297
+#delete from t2;
+#to make sure we do a full table scan
+#select count(*) from t2 where a+0 > 0;
+#truncate table t2;
+#select count(*) from t2;
+#drop table t2;
+
+## Test moved to ndb_alter_table_row|stmt respectively as behaviour differs
+#connection server1;
+#create table t3 (a int primary key) engine=ndbcluster;
+
+#connection server2;
+#begin;
+#insert into t3 values (1);
+
+#connection server1;
+#alter table t3 rename t4;
+
+#connection server2;
+## with rbr the below will not work as the "alter" event
+## explicitly invalidates the dictionary cache.
+### This should work as transaction is ongoing...
+##delete from t3;
+##insert into t3 values (1);
+#commit;
+
+## This should fail as its a new transaction
+#--error 1146
+#select * from t3;
+#select * from t4;
+#drop table t4;
+#show tables;
+#connection server1;
+
+create table t1 (
+ai bigint auto_increment,
+c001 int(11) not null,
+c002 int(11) not null,
+c003 int(11) not null,
+c004 int(11) not null,
+c005 int(11) not null,
+c006 int(11) not null,
+c007 int(11) not null,
+c008 int(11) not null,
+c009 int(11) not null,
+c010 int(11) not null,
+c011 int(11) not null,
+c012 int(11) not null,
+c013 int(11) not null,
+c014 int(11) not null,
+c015 int(11) not null,
+c016 int(11) not null,
+c017 int(11) not null,
+c018 int(11) not null,
+c019 int(11) not null,
+c020 int(11) not null,
+c021 int(11) not null,
+c022 int(11) not null,
+c023 int(11) not null,
+c024 int(11) not null,
+c025 int(11) not null,
+c026 int(11) not null,
+c027 int(11) not null,
+c028 int(11) not null,
+c029 int(11) not null,
+c030 int(11) not null,
+c031 int(11) not null,
+c032 int(11) not null,
+c033 int(11) not null,
+c034 int(11) not null,
+c035 int(11) not null,
+c036 int(11) not null,
+c037 int(11) not null,
+c038 int(11) not null,
+c039 int(11) not null,
+c040 int(11) not null,
+c041 int(11) not null,
+c042 int(11) not null,
+c043 int(11) not null,
+c044 int(11) not null,
+c045 int(11) not null,
+c046 int(11) not null,
+c047 int(11) not null,
+c048 int(11) not null,
+c049 int(11) not null,
+c050 int(11) not null,
+c051 int(11) not null,
+c052 int(11) not null,
+c053 int(11) not null,
+c054 int(11) not null,
+c055 int(11) not null,
+c056 int(11) not null,
+c057 int(11) not null,
+c058 int(11) not null,
+c059 int(11) not null,
+c060 int(11) not null,
+c061 int(11) not null,
+c062 int(11) not null,
+c063 int(11) not null,
+c064 int(11) not null,
+c065 int(11) not null,
+c066 int(11) not null,
+c067 int(11) not null,
+c068 int(11) not null,
+c069 int(11) not null,
+c070 int(11) not null,
+c071 int(11) not null,
+c072 int(11) not null,
+c073 int(11) not null,
+c074 int(11) not null,
+c075 int(11) not null,
+c076 int(11) not null,
+c077 int(11) not null,
+c078 int(11) not null,
+c079 int(11) not null,
+c080 int(11) not null,
+c081 int(11) not null,
+c082 int(11) not null,
+c083 int(11) not null,
+c084 int(11) not null,
+c085 int(11) not null,
+c086 int(11) not null,
+c087 int(11) not null,
+c088 int(11) not null,
+c089 int(11) not null,
+c090 int(11) not null,
+c091 int(11) not null,
+c092 int(11) not null,
+c093 int(11) not null,
+c094 int(11) not null,
+c095 int(11) not null,
+c096 int(11) not null,
+c097 int(11) not null,
+c098 int(11) not null,
+c099 int(11) not null,
+c100 int(11) not null,
+c101 int(11) not null,
+c102 int(11) not null,
+c103 int(11) not null,
+c104 int(11) not null,
+c105 int(11) not null,
+c106 int(11) not null,
+c107 int(11) not null,
+c108 int(11) not null,
+c109 int(11) not null,
+primary key (ai),
+unique key tx1 (c002, c003, c004, c005)) engine=ndb;
+
+create index tx2
+on t1 (c010, c011, c012, c013);
+
+drop table t1;
+
+# End of 4.1 tests
+
+# On-line alter table
+
+
+CREATE TABLE t1 (
+ auto int(5) unsigned NOT NULL auto_increment,
+ string char(10),
+ vstring varchar(10),
+ bin binary(2),
+ vbin varbinary(7),
+ tiny tinyint(4) DEFAULT '0' NOT NULL ,
+ short smallint(6) DEFAULT '1' NOT NULL ,
+ medium mediumint(8) DEFAULT '0' NOT NULL,
+ long_int int(11) DEFAULT '0' NOT NULL,
+ longlong bigint(13) DEFAULT '0' NOT NULL,
+ real_float float(13,1) DEFAULT 0.0 NOT NULL,
+ real_double double(16,4),
+ real_decimal decimal(16,4),
+ utiny tinyint(3) unsigned DEFAULT '0' NOT NULL,
+ ushort smallint(5) unsigned zerofill DEFAULT '00000' NOT NULL,
+ umedium mediumint(8) unsigned DEFAULT '0' NOT NULL,
+ ulong int(11) unsigned DEFAULT '0' NOT NULL,
+ ulonglong bigint(13) unsigned DEFAULT '0' NOT NULL,
+ bits bit(3),
+ options enum('zero','one','two','three','four') not null,
+ flags set('zero','one','two','three','four') not null,
+ date_field date,
+ year_field year,
+ time_field time,
+ date_time datetime,
+ time_stamp timestamp,
+ PRIMARY KEY (auto)
+) engine=ndb;
+
+CREATE TEMPORARY TABLE ndb_show_tables (id INT, type VARCHAR(20), state VARCHAR(20), logging VARCHAR(20), _database VARCHAR(255), _schema VARCHAR(20), name VARCHAR(255));
+
+--disable_warnings
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+--enable_warnings
+
+# Ndb doesn't support renaming attributes on-line
+set @t1_id = (select id from ndb_show_tables where name like '%t1%');
+truncate ndb_show_tables;
+
+alter table t1 change tiny new_tiny tinyint(4) DEFAULT '0' NOT NULL;
+--disable_warnings
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+--enable_warnings
+
+select 'no_copy' from ndb_show_tables where id = @t1_id and name like '%t1%';
+
+set @t1_id = (select id from ndb_show_tables where name like '%t1%');
+truncate ndb_show_tables;
+
+create index i1 on t1(medium);
+alter table t1 add index i2(new_tiny);
+drop index i1 on t1;
+
+--disable_warnings
+--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
+LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
+--exec rm $MYSQLTEST_VARDIR/master-data/test/tmp.dat || true
+--enable_warnings
+
+select 'no_copy' from ndb_show_tables where id = @t1_id and name like '%t1%';
+
+DROP TABLE t1, ndb_show_tables;
+
+# simple test that auto incr is not lost at rename or alter
+create table t1 (a int primary key auto_increment, b int) engine=ndb;
+insert into t1 (b) values (101),(102),(103);
+select * from t1 where a = 3;
+alter table t1 rename t2;
+insert into t2 (b) values (201),(202),(203);
+select * from t2 where a = 6;
+alter table t2 add c int;
+insert into t2 (b) values (301),(302),(303);
+select * from t2 where a = 9;
+alter table t2 rename t1;
+insert into t1 (b) values (401),(402),(403);
+select * from t1 where a = 12;
+drop table t1;
+
+# some other ALTER combinations
+# add/drop pk
+create table t1 (a int not null, b varchar(10)) engine=ndb;
+show index from t1;
+alter table t1 add primary key (a);
+show index from t1;
+alter table t1 drop primary key;
+show index from t1;
+drop table t1;
+
+# alter .. alter
+create table t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb;
+show create table t1;
+alter table t1 alter b set default 1;
+show create table t1;
+drop table t1;
+
+# alter .. order by
+create table t1 (a int not null, b int not null) engine=ndb;
+insert into t1 values (1, 300), (2, 200), (3, 100);
+select * from t1 order by a;
+alter table t1 order by b;
+select * from t1 order by b;
+drop table t1;
+
+--echo End of 5.1 tests
diff --git a/mysql-test/suite/ndb/t/ndb_alter_table2.test b/mysql-test/suite/ndb/t/ndb_alter_table2.test
new file mode 100644
index 00000000000..f078ed6b479
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_alter_table2.test
@@ -0,0 +1,84 @@
+-- source include/have_multi_ndb.inc
+-- source include/not_embedded.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+connect (con1,localhost,root,,test);
+connect (con2,localhost,root,,test);
+connect (con3,localhost,root,,test);
+connect (con4,localhost,root,,test);
+connect (con5,localhost,root,,test);
+connect (con6,localhost,root,,test);
+
+CREATE TABLE t1 (
+ a INT NOT NULL PRIMARY KEY,
+ b INT NOT NULL
+) ENGINE=ndbcluster;
+
+connection con1;
+BEGIN;
+INSERT INTO t1 VALUES (9410,9412);
+connection con2;
+BEGIN;
+--send
+INSERT INTO t1 VALUES (9411,9412);
+connection con3;
+BEGIN;
+--send
+INSERT INTO t1 VALUES (9412,9412);
+connection con4;
+BEGIN;
+--send
+INSERT INTO t1 VALUES (9413,9412);
+connection con5;
+BEGIN;
+--send
+INSERT INTO t1 VALUES (9414,9412);
+connection con6;
+BEGIN;
+--send
+INSERT INTO t1 VALUES (9415,9412);
+connection con1;
+sleep 1;
+
+ROLLBACK;
+connection con2;
+reap;
+ROLLBACK;
+connection con3;
+reap;
+ROLLBACK;
+connection con4;
+reap;
+ROLLBACK;
+connection con5;
+reap;
+ROLLBACK;
+connection con6;
+reap;
+ROLLBACK;
+
+connection server2;
+
+drop table t1;
+CREATE TABLE t1 (
+ a INT NOT NULL PRIMARY KEY,
+ b INT NOT NULL,
+ c INT NOT NULL
+) ENGINE=ndbcluster;
+
+connection server1;
+
+--disable_result_log
+--error 0,1412
+select * from t1;
+--enable_result_log
+select * from t1;
+select * from t1;
+select * from t1;
+select * from t1;
+select * from t1;
+
+drop table t1;
diff --git a/mysql-test/suite/ndb/t/ndb_alter_table3.test b/mysql-test/suite/ndb/t/ndb_alter_table3.test
new file mode 100644
index 00000000000..86e664b23b0
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_alter_table3.test
@@ -0,0 +1,48 @@
+-- source include/have_multi_ndb.inc
+-- source include/not_embedded.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+connection server1;
+create table t1 ( a int primary key, b varchar(10), c varchar(10), index (b) )
+engine=ndb;
+insert into t1 values (1,'one','one'), (2,'two','two'), (3,'three','three');
+create index c on t1(c);
+connection server2;
+show indexes from t1;
+select * from t1 where c = 'two';
+connection server1;
+alter table t1 drop index c;
+connection server2;
+show indexes from t1;
+select * from t1 where c = 'two';
+connection server1;
+drop table t1;
+
+connection server1;
+create table t3 (a int primary key) engine=ndbcluster;
+
+connection server2;
+begin;
+insert into t3 values (1);
+
+connection server1;
+alter table t3 rename t4;
+
+connection server2;
+# with rbr the below will not work as the "alter" event
+# explicitly invalidates the dictionary cache.
+## This should work as transaction is ongoing...
+#delete from t3;
+#insert into t3 values (1);
+commit;
+
+# This should fail as its a new transaction
+--error 1146
+select * from t3;
+select * from t4;
+drop table t4;
+show tables;
+connection server1;
diff --git a/mysql-test/suite/ndb/t/ndb_backup_print.test b/mysql-test/suite/ndb/t/ndb_backup_print.test
new file mode 100644
index 00000000000..cf869fd56f5
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_backup_print.test
@@ -0,0 +1,68 @@
+-- source include/have_ndb.inc
+-- source include/ndb_default_cluster.inc
+-- source include/not_embedded.inc
+
+--disable_warnings
+use test;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
+--enable_warnings
+
+#NO.1 test output of backup
+--exec $NDB_MGM --no-defaults -e "start backup" |sed -e 's/[0-9]//g' |sed -e 's/localhost//g' |sed -e 's/\.\.\.*//g'
+
+create table t1
+ (pk int key
+ ,a1 BIT(1), a2 BIT(5), a3 BIT(33), a4 BIT(63), a5 BIT(64)
+ ,b1 TINYINT, b2 TINYINT UNSIGNED
+ ,c1 SMALLINT, c2 SMALLINT UNSIGNED
+ ,d1 INT, d2 INT UNSIGNED
+ ,e1 BIGINT, e2 BIGINT UNSIGNED
+ ,f1 CHAR(1) BINARY, f2 CHAR(32) BINARY, f3 CHAR(255) BINARY
+ ,g1 VARCHAR(32) BINARY, g2 VARCHAR(255) BINARY, g3 VARCHAR(1000) BINARY
+ ,h1 BINARY(1), h2 BINARY(8), h3 BINARY(255)
+ ,i1 VARBINARY(32), i2 VARBINARY(255), i3 VARBINARY(1000)
+ ) engine ndb;
+
+insert into t1 values
+ (1
+ ,0x1, 0x17, 0x789a, 0x789abcde, 0xfedc0001
+ ,127, 255
+ ,32767, 65535
+ ,2147483647, 4294967295
+ ,9223372036854775807, 18446744073709551615
+ ,'1','12345678901234567890123456789012','123456789'
+ ,'1','12345678901234567890123456789012','123456789'
+ ,0x12,0x123456789abcdef0, 0x012345
+ ,0x12,0x123456789abcdef0, 0x00123450
+ );
+
+insert into t1 values
+ (2
+ ,0, 0, 0, 0, 0
+ ,-128, 0
+ ,-32768, 0
+ ,-2147483648, 0
+ ,-9223372036854775808, 0
+ ,'','',''
+ ,'','',''
+ ,0x0,0x0,0x0
+ ,0x0,0x0,0x0
+ );
+
+insert into t1 values
+ (3
+ ,NULL,NULL,NULL,NULL,NULL
+ ,NULL,NULL
+ ,NULL,NULL
+ ,NULL,NULL
+ ,NULL,NULL
+ ,NULL,NULL,NULL
+ ,NULL,NULL,NULL
+ ,NULL,NULL,NULL
+ ,NULL,NULL,NULL
+ );
+
+#NO.2 test output of backup after some simple SQL operations
+--exec $NDB_MGM --no-defaults -e "start backup" |sed -e 's/[0-9]//g' |sed -e 's/localhost//g' |sed -e 's/\.\.\.*//g'
+
+drop table t1;
diff --git a/mysql-test/suite/ndb/t/ndb_basic.test b/mysql-test/suite/ndb/t/ndb_basic.test
new file mode 100644
index 00000000000..b9ccdf9fd0d
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_basic.test
@@ -0,0 +1,843 @@
+-- source include/have_ndb.inc
+-- source include/not_embedded.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7;
+drop database if exists mysqltest;
+--enable_warnings
+
+# workaround for bug#16445
+# remove to reproduce bug and run tests from ndb start
+# and with ndb_autodiscover disabled. Fails on Linux 50 % of the times
+CREATE TABLE t1 (
+ pk1 INT NOT NULL PRIMARY KEY,
+ attr1 INT NOT NULL,
+ attr2 INT,
+ attr3 VARCHAR(10)
+) ENGINE=ndbcluster;
+drop table t1;
+
+#
+# Basic test to show that the NDB
+# table handler is working
+#
+
+#
+# Show status and variables
+#
+--replace_column 2 #
+SHOW GLOBAL STATUS LIKE 'ndb%';
+--replace_column 2 #
+SHOW GLOBAL VARIABLES LIKE 'ndb%';
+
+#
+# Create a normal table with primary key
+#
+CREATE TABLE t1 (
+ pk1 INT NOT NULL PRIMARY KEY,
+ attr1 INT NOT NULL,
+ attr2 INT,
+ attr3 VARCHAR(10)
+) ENGINE=ndbcluster;
+
+SHOW INDEX FROM t1;
+INSERT INTO t1 VALUES (9410,9412, NULL, '9412'), (9411,9413, 17, '9413');
+SHOW INDEX FROM t1;
+SELECT pk1 FROM t1 ORDER BY pk1;
+SELECT * FROM t1 ORDER BY pk1;
+SELECT t1.* FROM t1 ORDER BY pk1;
+
+# Update on record by primary key
+UPDATE t1 SET attr1=1 WHERE pk1=9410;
+SELECT * FROM t1 ORDER BY pk1;
+
+# Update primary key
+UPDATE t1 SET pk1=2 WHERE attr1=1;
+SELECT * FROM t1 ORDER BY pk1;
+UPDATE t1 SET pk1=pk1 + 1;
+SELECT * FROM t1 ORDER BY pk1;
+UPDATE t1 SET pk1=4 WHERE pk1 = 3;
+SELECT * FROM t1 ORDER BY pk1;
+
+# Delete the record
+DELETE FROM t1;
+SELECT * FROM t1;
+
+# Insert more records and update them all at once
+INSERT INTO t1 VALUES (9410,9412, NULL, '9412'), (9408, 8765, NULL, '8765'),
+(7,8, NULL, NULL), (8,9, NULL, NULL), (9,10, NULL, NULL), (10,11, NULL, NULL), (11,12, NULL, NULL), (12,13, NULL, NULL), (13,14, NULL, NULL);
+UPDATE t1 SET attr1 = 9999;
+SELECT * FROM t1 ORDER BY pk1;
+
+UPDATE t1 SET attr1 = 9998 WHERE pk1 < 1000;
+SELECT * FROM t1 ORDER BY pk1;
+
+UPDATE t1 SET attr1 = 9997 WHERE attr1 = 9999;
+SELECT * FROM t1 ORDER BY pk1;
+
+# Delete one record by specifying pk
+DELETE FROM t1 WHERE pk1 = 9410;
+SELECT * FROM t1 ORDER BY pk1;
+
+# Delete all from table
+DELETE FROM t1;
+SELECT * FROM t1;
+
+# Insert three records with attr1=4 and two with attr1=5
+# Delete all with attr1=4
+INSERT INTO t1 values (1, 4, NULL, NULL), (2, 4, NULL, NULL), (3, 5, NULL, NULL), (4, 4, NULL, NULL), (5, 5, NULL, NULL);
+DELETE FROM t1 WHERE attr1=4;
+SELECT * FROM t1 order by pk1;
+DELETE FROM t1;
+
+# Insert two records and delete one
+INSERT INTO t1 VALUES (9410,9412, NULL, NULL), (9411, 9413, NULL, NULL);
+DELETE FROM t1 WHERE pk1 = 9410;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+#
+# Create table without primary key
+# a hidden primary key column is created by handler
+#
+CREATE TABLE t1 (id INT, id2 int) engine=ndbcluster;
+INSERT INTO t1 values(3456, 7890);
+SELECT * FROM t1;
+UPDATE t1 SET id=2 WHERE id2=12;
+SELECT * FROM t1;
+UPDATE t1 SET id=1234 WHERE id2=7890;
+SELECT * FROM t1;
+DELETE FROM t1;
+
+INSERT INTO t1 values(3456, 7890), (3456, 7890), (3456, 7890), (3454, 7890);
+SELECT * FROM t1 ORDER BY id;
+DELETE FROM t1 WHERE id = 3456;
+SELECT * FROM t1 ORDER BY id;
+
+DROP TABLE t1;
+
+# test create with the keyword "engine=NDBCLUSTER"
+CREATE TABLE t1 (
+ pk1 INT NOT NULL PRIMARY KEY,
+ attr1 INT NOT NULL
+) ENGINE=NDBCLUSTER;
+
+INSERT INTO t1 values(1, 9999);
+
+DROP TABLE t1;
+
+# test create with the keyword "engine=NDB"
+CREATE TABLE t1 (
+ pk1 INT NOT NULL PRIMARY KEY,
+ attr1 INT NOT NULL
+) ENGINE=NDB;
+
+INSERT INTO t1 values(1, 9999);
+
+DROP TABLE t1;
+
+
+#
+# A more extensive test with a lot more records
+#
+
+CREATE TABLE t2 (
+ a bigint unsigned NOT NULL PRIMARY KEY,
+ b int unsigned not null,
+ c int unsigned
+) engine=ndbcluster;
+
+CREATE TABLE t3 (
+ a bigint unsigned NOT NULL,
+ b bigint unsigned not null,
+ c bigint unsigned,
+ PRIMARY KEY(a)
+) engine=ndbcluster;
+
+CREATE TABLE t4 (
+ a bigint unsigned NOT NULL,
+ b bigint unsigned not null,
+ c bigint unsigned NOT NULL,
+ d int unsigned,
+ PRIMARY KEY(a, b, c)
+) engine=ndbcluster;
+
+
+#
+# insert more records into tables
+#
+let $1=1000;
+disable_query_log;
+while ($1)
+{
+ eval insert into t2 values($1, $1+9, 5);
+ eval insert into t3 values($1, $1+9, 5);
+ eval insert into t4 values($1, $1+9, 5, $1+26000);
+ dec $1;
+}
+enable_query_log;
+
+
+#
+# delete every other record in the tables
+#
+let $1=1000;
+disable_query_log;
+while ($1)
+{
+ eval delete from t2 where a=$1;
+ eval delete from t3 where a=$1;
+ eval delete from t4 where a=$1 and b=$1+9 and c=5;
+ dec $1;
+ dec $1;
+}
+enable_query_log;
+
+
+select * from t2 where a = 7 order by b;
+select * from t2 where a = 7 order by a;
+select * from t2 where a = 7 order by 2;
+select * from t2 where a = 7 order by c;
+
+select * from t2 where a = 7 and b = 16 order by b;
+select * from t2 where a = 7 and b = 16 order by a;
+select * from t2 where a = 7 and b = 17 order by a;
+select * from t2 where a = 7 and b != 16 order by b;
+
+select * from t2 where a = 7 and b = 16 and c = 5 order by b;
+select * from t2 where a = 7 and b = 16 and c = 5 order by a;
+select * from t2 where a = 7 and b = 16 and c = 6 order by a;
+select * from t2 where a = 7 and b != 16 and c = 5 order by b;
+
+select * from t3 where a = 7 order by b;
+select * from t3 where a = 7 order by a;
+select * from t3 where a = 7 order by 2;
+select * from t3 where a = 7 order by c;
+
+select * from t3 where a = 7 and b = 16 order by b;
+select * from t3 where a = 7 and b = 16 order by a;
+select * from t3 where a = 7 and b = 17 order by a;
+select * from t3 where a = 7 and b != 16 order by b;
+
+select * from t4 where a = 7 order by b;
+select * from t4 where a = 7 order by a;
+select * from t4 where a = 7 order by 2;
+select * from t4 where a = 7 order by c;
+
+select * from t4 where a = 7 and b = 16 order by b;
+select * from t4 where a = 7 and b = 16 order by a;
+select * from t4 where a = 7 and b = 17 order by a;
+select * from t4 where a = 7 and b != 16 order by b;
+
+#
+# update records
+#
+let $1=1000;
+disable_query_log;
+while ($1)
+{
+ eval update t2 set c=$1 where a=$1;
+ eval update t3 set c=7 where a=$1 and b=$1+9 and c=5;
+ eval update t4 set d=$1+21987 where a=$1 and b=$1+9 and c=5;
+ dec $1;
+ dec $1;
+}
+enable_query_log;
+
+delete from t2 where a > 5;
+select x1.a, x1.b from t2 x1, t2 x2 where x1.b = x2.b order by x1.a;
+select a, b FROM t2 outer_table where
+a = (select a from t2 where b = outer_table.b ) order by a;
+
+
+delete from t2;
+delete from t3;
+delete from t4;
+
+drop table t2;
+drop table t3;
+drop table t4;
+
+#
+# Test delete and update from table with 3 keys
+#
+
+CREATE TABLE t5 (
+ a bigint unsigned NOT NULL,
+ b bigint unsigned not null,
+ c bigint unsigned NOT NULL,
+ d int unsigned,
+ PRIMARY KEY(a, b, c)
+) engine=ndbcluster;
+
+insert into t5 values(10, 19, 5, 26010);
+
+delete from t5 where a=10 and b=19 and c=5;
+
+select * from t5;
+
+insert into t5 values(10, 19, 5, 26010);
+
+update t5 set d=21997 where a=10 and b=19 and c=5;
+
+select * from t5;
+
+delete from t5;
+
+drop table t5;
+
+#
+# Test using table with a char(255) column first in table
+#
+
+CREATE TABLE t6 (
+ adress char(255),
+ a int NOT NULL PRIMARY KEY,
+ b int
+) engine = NDB;
+
+insert into t6 values
+ ("Nice road 3456", 1, 23),
+ ("Street Road 78", 3, 92),
+ ("Road street 89C", 5, 71),
+ (NULL, 7, NULL);
+select * from t6 order by a;
+select a, b from t6 order by a;
+
+update t6 set adress="End of road 09" where a=3;
+update t6 set b=181, adress="Street 76" where a=7;
+select * from t6 order by a;
+select * from t6 where a=1;
+delete from t6 where a=1;
+select * from t6 order by a;
+delete from t6 where b=71;
+select * from t6 order by a;
+
+drop table t6;
+
+#
+# Test using table with a char(255) column first in table and a
+# primary key consisting of two columns
+#
+
+CREATE TABLE t7 (
+ adress char(255),
+ a int NOT NULL,
+ b int,
+ c int NOT NULL,
+ PRIMARY KEY(a, c)
+) engine = NDB;
+
+insert into t7 values
+ ("Highway 3456", 1, 23, 2),
+ ("Street Road 78", 3, 92, 3),
+ ("Main street 89C", 5, 71, 4),
+ (NULL, 8, NULL, 12);
+select * from t7 order by a;
+select a, b from t7 order by a;
+
+update t7 set adress="End of road 09" where a=3;
+update t7 set adress="Gatuvägen 90C" where a=5 and c=4;
+update t7 set adress="No adress" where adress is NULL;
+select * from t7 order by a;
+select * from t7 where a=1 and c=2;
+delete from t7 where a=1;
+delete from t7 where a=3 and c=3;
+delete from t7 where a=5 and c=4;
+select * from t7;
+delete from t7 where b=23;
+select * from t7;
+
+drop table t7;
+
+#
+# Test multiple databases in one statement
+#
+
+CREATE TABLE t1 (
+ pk1 INT NOT NULL PRIMARY KEY,
+ attr1 INT NOT NULL,
+ attr2 INT,
+ attr3 VARCHAR(10)
+) ENGINE=ndbcluster;
+
+INSERT INTO t1 VALUES (9410,9412, NULL, '9412'), (9411,9413, 17, '9413');
+
+create database mysqltest;
+use mysqltest;
+
+CREATE TABLE t2 (
+ a bigint unsigned NOT NULL PRIMARY KEY,
+ b int unsigned not null,
+ c int unsigned
+) engine=ndbcluster;
+
+insert into t2 select pk1,attr1,attr2 from test.t1;
+select * from t2 order by a;
+select b from test.t1, t2 where c = test.t1.attr2;
+select b,test.t1.attr1 from test.t1, t2 where test.t1.pk1 < a;
+
+drop table test.t1, t2;
+drop database mysqltest;
+
+#
+# BUG#6031 - DROP DATABASE doesn't drop database on first try
+#
+
+--disable_warnings
+drop database if exists ndbtest1;
+--enable_warnings
+
+create database ndbtest1;
+use ndbtest1;
+create table t1(id int) engine=ndbcluster;
+drop database ndbtest1;
+--error 1008
+drop database ndbtest1;
+
+#
+# test support of char(0)
+#
+
+use test;
+create table t1 (a int primary key, b char(0));
+insert into t1 values (1,"");
+insert into t1 values (2,NULL);
+select * from t1 order by a;
+select * from t1 order by b;
+select * from t1 where b IS NULL;
+select * from t1 where b IS NOT NULL;
+drop table t1;
+
+#
+# test the limit of no of attributes in one table
+#
+# also tests bug#17179, more than 31 attributes in
+# a partitioned table
+#
+create table t1 (
+c1 int,
+c2 int,
+c3 int,
+c4 int,
+c5 int,
+c6 int,
+c7 int,
+c8 int,
+c9 int,
+c10 int,
+c11 int,
+c12 int,
+c13 int,
+c14 int,
+c15 int,
+c16 int,
+c17 int,
+c18 int,
+c19 int,
+c20 int,
+c21 int,
+c22 int,
+c23 int,
+c24 int,
+c25 int,
+c26 int,
+c27 int,
+c28 int,
+c29 int,
+c30 int,
+c31 int,
+c32 int,
+c33 int,
+c34 int,
+c35 int,
+c36 int,
+c37 int,
+c38 int,
+c39 int,
+c40 int,
+c41 int,
+c42 int,
+c43 int,
+c44 int,
+c45 int,
+c46 int,
+c47 int,
+c48 int,
+c49 int,
+c50 int,
+c51 int,
+c52 int,
+c53 int,
+c54 int,
+c55 int,
+c56 int,
+c57 int,
+c58 int,
+c59 int,
+c60 int,
+c61 int,
+c62 int,
+c63 int,
+c64 int,
+c65 int,
+c66 int,
+c67 int,
+c68 int,
+c69 int,
+c70 int,
+c71 int,
+c72 int,
+c73 int,
+c74 int,
+c75 int,
+c76 int,
+c77 int,
+c78 int,
+c79 int,
+c80 int,
+c81 int,
+c82 int,
+c83 int,
+c84 int,
+c85 int,
+c86 int,
+c87 int,
+c88 int,
+c89 int,
+c90 int,
+c91 int,
+c92 int,
+c93 int,
+c94 int,
+c95 int,
+c96 int,
+c97 int,
+c98 int,
+c99 int,
+c100 int,
+c101 int,
+c102 int,
+c103 int,
+c104 int,
+c105 int,
+c106 int,
+c107 int,
+c108 int,
+c109 int,
+c110 int,
+c111 int,
+c112 int,
+c113 int,
+c114 int,
+c115 int,
+c116 int,
+c117 int,
+c118 int,
+c119 int,
+c120 int,
+c121 int,
+c122 int,
+c123 int,
+c124 int,
+c125 int,
+c126 int,
+c127 int,
+c128 int,
+primary key using hash(c1)) engine=ndb partition by key(c1);
+drop table t1;
+
+#
+# test max size of attribute name and truncation
+#
+
+create table t1 (
+a1234567890123456789012345678901234567890 int primary key,
+a12345678901234567890123456789a1234567890 int,
+index(a12345678901234567890123456789a1234567890)
+) engine=ndb;
+show tables;
+insert into t1 values (1,1),(2,1),(3,1),(4,1),(5,2),(6,1),(7,1);
+--replace_column 9 #
+explain select * from t1 where a12345678901234567890123456789a1234567890=2;
+select * from t1 where a12345678901234567890123456789a1234567890=2;
+drop table t1;
+
+#
+# test fragment creation
+#
+# first a table with _many_ fragments per node group
+# then a table with just one fragment per node group
+#
+create table t1
+ (a bigint, b bigint, c bigint, d bigint,
+ primary key (a,b,c,d))
+ engine=ndb
+ max_rows=800000000;
+insert into t1 values
+ (1,2,3,4),(2,3,4,5),(3,4,5,6),
+ (3,2,3,4),(1,3,4,5),(2,4,5,6),
+ (1,2,3,5),(2,3,4,8),(3,4,5,9),
+ (3,2,3,5),(1,3,4,8),(2,4,5,9),
+ (1,2,3,6),(2,3,4,6),(3,4,5,7),
+ (3,2,3,6),(1,3,4,6),(2,4,5,7),
+ (1,2,3,7),(2,3,4,7),(3,4,5,8),
+ (3,2,3,7),(1,3,4,7),(2,4,5,8),
+ (1,3,3,4),(2,4,4,5),(3,5,5,6),
+ (3,3,3,4),(1,4,4,5),(2,5,5,6),
+ (1,3,3,5),(2,4,4,8),(3,5,5,9),
+ (3,3,3,5),(1,4,4,8),(2,5,5,9),
+ (1,3,3,6),(2,4,4,6),(3,5,5,7),
+ (3,3,3,6),(1,4,4,6),(2,5,5,7),
+ (1,3,3,7),(2,4,4,7),(3,5,5,8),
+ (3,3,3,7),(1,4,4,7),(2,5,5,8);
+select count(*) from t1;
+drop table t1;
+
+create table t1
+ (a bigint, b bigint, c bigint, d bigint,
+ primary key (a))
+ engine=ndb
+ max_rows=1;
+drop table t1;
+
+#
+# Test auto_increment
+#
+
+connect (con1,localhost,root,,test);
+connect (con2,localhost,root,,test);
+
+create table t1
+ (counter int(64) NOT NULL auto_increment,
+ datavalue char(40) default 'XXXX',
+ primary key (counter)
+ ) ENGINE=ndbcluster;
+
+connection con1;
+insert into t1 (datavalue) values ('newval');
+insert into t1 (datavalue) values ('newval');
+select * from t1 order by counter;
+insert into t1 (datavalue) select datavalue from t1 where counter < 100;
+insert into t1 (datavalue) select datavalue from t1 where counter < 100;
+select * from t1 order by counter;
+connection con2;
+insert into t1 (datavalue) select datavalue from t1 where counter < 100;
+insert into t1 (datavalue) select datavalue from t1 where counter < 100;
+select * from t1 order by counter;
+
+drop table t1;
+
+#
+# bug#27437
+connection con1;
+create table t1 (a int primary key auto_increment) engine = ndb;
+insert into t1() values (),(),(),(),(),(),(),(),(),(),(),();
+connection con2;
+insert into t1(a) values (20),(28);
+connection con1;
+insert into t1() values (),(),(),(),(),(),(),(),(),(),(),();
+connection con2;
+insert into t1() values (21), (22);
+connection con1;
+
+drop table t1;
+
+#
+# BUG#14514 Creating table with packed key fails silently
+#
+
+CREATE TABLE t1 ( b INT ) PACK_KEYS = 0 ENGINE = ndb;
+select * from t1;
+drop table t1;
+
+#
+# Bug #17249 delete statement with join where clause fails
+# when table do not have pk
+ #
+
+create table t1 (a int) engine=ndb;
+create table t2 (a int) engine=ndb;
+insert into t1 values (1);
+insert into t2 values (1);
+delete t1.* from t1, t2 where t1.a = t2.a;
+select * from t1;
+select * from t2;
+drop table t1;
+drop table t2;
+
+#
+# Bug #17257 update fails for inner joins if tables
+# do not have Primary Key
+#
+
+CREATE TABLE t1 (
+ i INT,
+ j INT,
+ x INT,
+ y INT,
+ z INT
+) engine=ndb;
+
+CREATE TABLE t2 (
+ i INT,
+ k INT,
+ x INT,
+ y INT,
+ z INT
+) engine=ndb;
+
+CREATE TABLE t3 (
+ j INT,
+ k INT,
+ x INT,
+ y INT,
+ z INT
+) engine=ndb;
+
+INSERT INTO t1 VALUES ( 1, 2,13,14,15);
+INSERT INTO t2 VALUES ( 1, 3,23,24,25);
+INSERT INTO t3 VALUES ( 2, 3, 1,34,35), ( 2, 3, 1,34,36);
+
+UPDATE t1 AS a
+INNER JOIN t2 AS b
+ ON a.i = b.i
+INNER JOIN t3 AS c
+ ON a.j = c.j AND b.k = c.k
+SET a.x = b.x,
+ a.y = b.y,
+ a.z = (
+ SELECT sum(z)
+ FROM t3
+ WHERE y = 34
+ )
+WHERE b.x = 23;
+select * from t1;
+drop table t1;
+drop table t2;
+drop table t3;
+
+# End of 4.1 tests
+
+#
+# Test long table name
+#
+create table atablewithareallylongandirritatingname (a int);
+insert into atablewithareallylongandirritatingname values (2);
+select * from atablewithareallylongandirritatingname;
+drop table atablewithareallylongandirritatingname;
+
+#
+# Bug#15682
+#
+create table t1 (f1 varchar(50), f2 text,f3 int, primary key(f1)) engine=NDB;
+insert into t1 (f1,f2,f3)VALUES("111111","aaaaaa",1);
+insert into t1 (f1,f2,f3)VALUES("222222","bbbbbb",2);
+select * from t1 order by f1;
+select * from t1 order by f2;
+select * from t1 order by f3;
+drop table t1;
+# Bug#16561 Unknown ERROR msg "ERROR 1186 (HY000): Binlog closed" by perror
+#
+
+# As long there is no error code 1186 defined by NDB
+# we should get a message "Illegal ndb error code: 1186"
+--error 1
+--exec $MY_PERROR --ndb 1186 2>&1
+
+#
+# Bug #25746 - VARCHAR UTF8 PK issue
+# - prior to bugfix 4209, illegal length parameter would be
+# returned in SELECT *
+
+CREATE TABLE t1 (
+a VARBINARY(40) NOT NULL,
+b VARCHAR (256) CHARACTER SET UTF8 NOT NULL,
+c VARCHAR(256) CHARACTER SET UTF8 NOT NULL,
+PRIMARY KEY (b,c)) ENGINE=ndbcluster;
+INSERT INTO t1 VALUES
+("a","ab","abc"),("b","abc","abcd"),("c","abc","ab"),("d","ab","ab"),("e","abc","abc");
+SELECT * FROM t1 ORDER BY a;
+DROP TABLE t1;
+
+# delete
+create table t1 (a int not null primary key, b int not null) engine=ndb;
+create table t2 (a int not null primary key, b int not null) engine=ndb;
+insert into t1 values (1,10), (2,20), (3,30);
+insert into t2 values (1,10), (2,20), (3,30);
+select * from t1 order by a;
+delete from t1 where a > 0 order by a desc limit 1;
+select * from t1 order by a;
+delete from t1,t2 using t1,t2 where t1.a = t2.a;
+select * from t2 order by a;
+drop table t1,t2;
+
+# insert ignore
+create table t1 (a int not null primary key, b int not null) engine=ndb;
+insert into t1 values (1,10), (2,20), (3,30);
+--error ER_DUP_ENTRY
+insert into t1 set a=1, b=100;
+insert ignore into t1 set a=1, b=100;
+select * from t1 order by a;
+insert into t1 set a=1, b=1000 on duplicate key update b=b+1;
+select * from t1 order by a;
+drop table t1;
+
+# update
+create table t1 (a int not null primary key, b int not null) engine=ndb;
+create table t2 (c int not null primary key, d int not null) engine=ndb;
+insert into t1 values (1,10), (2,10), (3,30), (4, 30);
+insert into t2 values (1,10), (2,10), (3,30), (4, 30);
+--error ER_DUP_ENTRY
+update t1 set a = 1 where a = 3;
+select * from t1 order by a;
+update t1 set b = 1 where a > 1 order by a desc limit 1;
+select * from t1 order by a;
+--error ER_DUP_ENTRY
+update t1,t2 set a = 1, c = 1 where a = 3 and c = 3;
+select * from t1 order by a;
+update ignore t1,t2 set a = 1, c = 1 where a = 3 and c = 3;
+select * from t1 order by a;
+drop table t1,t2;
+
+# End of 5.0 tests
+--echo End of 5.0 tests
+
+
+#
+# Bug #18483 Cannot create table with FK constraint
+# ndb does not support foreign key constraint, it is silently ignored
+# in line with other storage engines
+#
+CREATE TABLE t1 (a VARCHAR(255) NOT NULL,
+ CONSTRAINT pk_a PRIMARY KEY (a))engine=ndb;
+CREATE TABLE t2(a VARCHAR(255) NOT NULL,
+ b VARCHAR(255) NOT NULL,
+ c VARCHAR(255) NOT NULL,
+ CONSTRAINT pk_b_c_id PRIMARY KEY (b,c),
+ CONSTRAINT fk_a FOREIGN KEY(a) REFERENCES t1(a))engine=ndb;
+drop table t1, t2;
+
+# bug#24301
+create table t1 (a int not null primary key, b int) engine=ndb;
+insert into t1 values(1,1),(2,2),(3,3);
+create table t2 like t1;
+insert into t2 select * from t1;
+select * from t1 order by a;
+select * from t2 order by a;
+drop table t1, t2;
+
+# create table if not exists
+--disable_warnings
+create table t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb;
+create table if not exists t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb;
+--enable_warnings
+
+# create like
+create table t2 like t1;
+
+# multi rename
+rename table t1 to t10, t2 to t20;
+drop table t10,t20;
+
+--echo End of 5.1 tests
diff --git a/mysql-test/suite/ndb/t/ndb_binlog_basic.test b/mysql-test/suite/ndb/t/ndb_binlog_basic.test
new file mode 100644
index 00000000000..4d8b7a8b127
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_binlog_basic.test
@@ -0,0 +1,80 @@
+-- source include/have_ndb.inc
+-- source include/have_binlog_format_mixed_or_row.inc
+
+--disable_warnings
+drop table if exists t1, t2;
+drop database if exists mysqltest;
+create database mysqltest;
+use mysqltest;
+drop database mysqltest;
+use test;
+--enable_warnings
+
+#
+# basic insert, update, delete test, alter, rename, drop
+# check that ndb_binlog_index gets the right info
+#
+
+create table t1 (a int primary key) engine=ndb;
+insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+save_master_pos;
+--replace_column 1 #
+select @max_epoch:=max(epoch)-1 from mysql.ndb_binlog_index;
+
+delete from t1;
+alter table t1 add (b int);
+insert into t1 values (3,3),(4,4);
+alter table t1 rename t2;
+
+# get all in one epoch
+begin;
+insert into t2 values (1,1),(2,2);
+update t2 set b=1 where a=3;
+delete from t2 where a=4;
+commit;
+drop table t2;
+
+# check that above is ok
+# (save_master_pos waits for last gcp to complete, ensuring that we have
+# the expected data in the binlog)
+save_master_pos;
+select inserts from mysql.ndb_binlog_index where epoch > @max_epoch and inserts > 5;
+select deletes from mysql.ndb_binlog_index where epoch > @max_epoch and deletes > 5;
+select inserts,updates,deletes from
+ mysql.ndb_binlog_index where epoch > @max_epoch and updates > 0;
+
+#
+# check that purge clears the ndb_binlog_index
+#
+# TODO: make this deterministic
+# This test is disabled until we can make this determistic under load.
+# The problem is that in some cases, the binlog writing thread gets
+# scheduled after the purge, writes pending things, then the select
+# gets scheduled
+#
+flush logs;
+--sleep 1
+purge master logs before now();
+--disable_parsing
+select count(*) from mysql.ndb_binlog_index;
+--enable_parsing
+
+#
+# several tables in different databases
+# check that same table name in different databases don't mix up
+#
+create table t1 (a int primary key, b int) engine=ndb;
+create database mysqltest;
+use mysqltest;
+create table t1 (c int, d int primary key) engine=ndb;
+use test;
+
+insert into mysqltest.t1 values (2,1),(2,2);
+save_master_pos;
+--replace_column 1 #
+select @max_epoch:=max(epoch)-1 from mysql.ndb_binlog_index;
+
+drop table t1;
+drop database mysqltest;
+select inserts,updates,deletes from
+ mysql.ndb_binlog_index where epoch > @max_epoch and inserts > 0;
diff --git a/mysql-test/suite/ndb/t/ndb_binlog_ddl_multi.test b/mysql-test/suite/ndb/t/ndb_binlog_ddl_multi.test
new file mode 100644
index 00000000000..a70dbe2011f
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_binlog_ddl_multi.test
@@ -0,0 +1,190 @@
+-- source include/have_multi_ndb.inc
+-- source include/have_binlog_format_mixed_or_row.inc
+
+--disable_warnings
+connection server2;
+drop database if exists mysqltest;
+drop table if exists t1,t2,t3;
+connection server1;
+drop database if exists mysqltest;
+drop table if exists t1,t2,t3;
+--connection server1
+reset master;
+--connection server2
+reset master;
+--enable_warnings
+
+#
+# basic test to see if ddl distribution works across
+# multiple binlogs
+#
+
+# create database
+--connection server1
+create database mysqltest;
+
+# create table
+--connection server1
+use mysqltest;
+create table t1 (a int primary key) engine=ndb;
+
+--connection server2
+create table t2 (a int primary key) engine=ndb;
+--source include/show_binlog_events2.inc
+
+--connection server1
+--source include/show_binlog_events2.inc
+
+# alter table
+--connection server1
+reset master;
+--connection server2
+reset master;
+
+--connection server2
+alter table t2 add column (b int);
+
+--connection server1
+--source include/show_binlog_events2.inc
+
+# alter database
+--connection server1
+reset master;
+--connection server2
+reset master;
+
+--connection server2
+ALTER DATABASE mysqltest CHARACTER SET latin1;
+
+
+# having drop here instead of below sometimes triggers bug#18976
+## drop table and drop should come after data events
+--connection server2
+drop table mysqltest.t1;
+
+--connection server1
+--source include/show_binlog_events2.inc
+# to track down bug#18976
+--real_sleep 10
+--source include/show_binlog_events2.inc
+
+#--connection server2
+#drop table mysqltest.t1;
+
+# drop database and drop should come after data events
+--connection server1
+reset master;
+--connection server2
+reset master;
+
+--connection server1
+use test;
+insert into t2 values (1,2);
+drop database mysqltest;
+create table t1 (a int primary key) engine=ndb;
+
+--connection server2
+--source include/show_binlog_events2.inc
+
+--connection server2
+drop table t2;
+
+# logfile groups and table spaces
+--connection server1
+reset master;
+--connection server2
+reset master;
+
+--connection server1
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+INITIAL_SIZE 16M
+UNDO_BUFFER_SIZE = 1M
+ENGINE=NDB;
+
+ALTER LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile02.dat'
+INITIAL_SIZE = 4M
+ENGINE=NDB;
+
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 12M
+ENGINE NDB;
+
+ALTER TABLESPACE ts1
+ADD DATAFILE 'datafile02.dat'
+INITIAL_SIZE = 4M
+ENGINE=NDB;
+
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile.dat'
+ENGINE = NDB;
+
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile02.dat'
+ENGINE = NDB;
+
+DROP TABLESPACE ts1
+ENGINE = NDB;
+
+DROP LOGFILE GROUP lg1
+ENGINE =NDB;
+
+# having drop here instead of below sometimes triggers bug#18976
+#drop table t1;
+
+--connection server2
+--source include/show_binlog_events2.inc
+# to track down bug#18976
+--real_sleep 10
+--source include/show_binlog_events2.inc
+
+drop table t1;
+
+#
+# Bug #17827 cluster: rename of several tables in one statement,
+# gets multiply logged
+#
+--connection server1
+reset master;
+show tables;
+--connection server2
+reset master;
+show tables;
+
+--connection server1
+create table t1 (a int key) engine=ndb;
+create table t2 (a int key) engine=ndb;
+create table t3 (a int key) engine=ndb;
+rename table t3 to t4, t2 to t3, t1 to t2, t4 to t1;
+--connection server2
+--source include/show_binlog_events2.inc
+
+drop table t1;
+drop table t2;
+drop table t3;
+
+#
+# Bug #17838 binlog not setup on seconday master after rename
+#
+#
+--connection server1
+reset master;
+show tables;
+--connection server2
+reset master;
+show tables;
+
+--connection server1
+create table t1 (a int key) engine=ndb;
+insert into t1 values(1);
+rename table t1 to t2;
+insert into t2 values(2);
+
+# now we should see data in table t1 _and_ t2
+# prior to bug fix, data was missing for t2
+--connection server2
+drop table t2;
+--source include/show_binlog_events2.inc
diff --git a/mysql-test/suite/ndb/t/ndb_binlog_discover.test b/mysql-test/suite/ndb/t/ndb_binlog_discover.test
new file mode 100644
index 00000000000..e842b57093a
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_binlog_discover.test
@@ -0,0 +1,36 @@
+-- source include/have_ndb.inc
+-- source include/have_binlog_format_mixed_or_row.inc
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+#
+# Bug #14516 Restart of cluster can cause NDB API replication failure
+#
+create table t1 (a int key) engine=ndb;
+reset master;
+--exec $NDB_MGM --no-defaults -e "all restart -n" > /dev/null
+--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults --not-started > /dev/null
+--exec $NDB_MGM --no-defaults -e "all start" > /dev/null
+--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults > /dev/null
+
+--disable_query_log
+let $mysql_errno= 1;
+while ($mysql_errno)
+{
+ # Table t1 is readonly until the mysqld has reconnected properly
+ --error 0,1036,1296
+ insert into t1 values(1);
+ if ($mysql_errno)
+ {
+ --sleep 0.1
+ }
+}
+--enable_query_log
+
+--source include/show_binlog_events2.inc
+PURGE MASTER LOGS TO 'master-bin.000002';
+
+--source include/show_binlog_events2.inc
+drop table t1;
diff --git a/mysql-test/suite/ndb/t/ndb_binlog_format.test b/mysql-test/suite/ndb/t/ndb_binlog_format.test
new file mode 100644
index 00000000000..acb34bb388c
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_binlog_format.test
@@ -0,0 +1,33 @@
+#
+# test different behavior of ndb using different binlog formats
+#
+
+-- source include/have_blackhole.inc
+-- source include/have_ndb.inc
+-- source include/have_log_bin.inc
+
+--disable_warnings
+drop table if exists t1, t2, t3;
+--enable_warnings
+
+#
+# Bug #29222 Statement mode replicates both statement and
+# rows when writing to an NDB table
+#
+CREATE TABLE t1 (m INT, n INT) ENGINE=MYISAM;
+CREATE TABLE t2 (b INT, c INT) ENGINE=BLACKHOLE;
+CREATE TABLE t3 (e INT, f INT) ENGINE=NDB;
+RESET MASTER;
+SET SESSION BINLOG_FORMAT=STATEMENT;
+INSERT INTO t1 VALUES (1,1), (1,2), (2,1), (2,2);
+INSERT INTO t2 VALUES (1,1), (1,2), (2,1), (2,2);
+UPDATE t1, t2 SET m = 2, b = 3 WHERE n = c;
+# A transaction here is not necessary, but I wanted to group the bad statements
+START TRANSACTION;
+INSERT INTO t3 VALUES (1,1), (1,2), (2,1), (2,2);
+UPDATE t1, t3 SET m = 2, e = 3 WHERE n = f;
+UPDATE t3, t2 SET e = 2, b = 3 WHERE f = c;
+COMMIT;
+--source include/show_binlog_events.inc
+DROP TABLE t1, t2, t3;
+
diff --git a/mysql-test/t/ndb_binlog_ignore_db-master.opt b/mysql-test/suite/ndb/t/ndb_binlog_ignore_db-master.opt
index e3947c0eeed..e3947c0eeed 100644
--- a/mysql-test/t/ndb_binlog_ignore_db-master.opt
+++ b/mysql-test/suite/ndb/t/ndb_binlog_ignore_db-master.opt
diff --git a/mysql-test/suite/ndb/t/ndb_binlog_ignore_db.test b/mysql-test/suite/ndb/t/ndb_binlog_ignore_db.test
new file mode 100644
index 00000000000..013df54a76a
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_binlog_ignore_db.test
@@ -0,0 +1,16 @@
+-- source include/have_ndb.inc
+-- source include/have_binlog_format_mixed_or_row.inc
+reset master;
+
+--disable_warnings
+drop table if exists t1;
+drop database if exists mysqltest;
+--enable_warnings
+
+create database mysqltest;
+use mysqltest;
+create table t1 (a int primary key, b int) engine=ndb;
+insert into t1 values (1, 1);
+-- source include/show_binlog_events2.inc
+
+drop database mysqltest;
diff --git a/mysql-test/suite/ndb/t/ndb_binlog_log_bin.test b/mysql-test/suite/ndb/t/ndb_binlog_log_bin.test
new file mode 100644
index 00000000000..75ac766fd25
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_binlog_log_bin.test
@@ -0,0 +1,49 @@
+-- source include/have_multi_ndb.inc
+-- source include/have_binlog_format_mixed_or_row.inc
+
+--disable_warnings
+connection server2;
+drop table if exists t1,t2,t3;
+reset master;
+connection server1;
+drop table if exists t1,t2,t3;
+reset master;
+--enable_warnings
+
+# basic SQL_LOG_BIN functionality
+# see updates from one thread but not the other
+connect (con1,localhost,root,,);
+connect (con2,localhost,root,,);
+# do some stuff with SQL_LOG_BIN=0
+connection con2;
+set SQL_LOG_BIN=0;
+create database mysqltest;
+use mysqltest;
+create table t1 (a int key, b int) engine=ndb;
+create table t2 (a int key, b int) engine=ndb;
+insert into t1 values (1,1);
+alter table t1 add c int;
+# we should not see it in the local server
+-- source include/show_binlog_events2.inc
+reset master;
+# we should not see it in another server
+connection server2;
+use mysqltest;
+insert into t2 values (1,1);
+-- source include/show_binlog_events2.inc
+reset master;
+# but if you do stuff in "default" client setting
+connection con1;
+use mysqltest;
+drop table t1;
+drop table t2;
+create table t1 (d int key, e int) engine=ndb;
+create table t2 (d int key, e int) engine=ndb;
+insert into t1 values (1,1);
+-- source include/show_binlog_events2.inc
+# and in another server
+connection server2;
+use mysqltest;
+insert into t2 values (1,1);
+-- source include/show_binlog_events2.inc
+drop database mysqltest;
diff --git a/mysql-test/suite/ndb/t/ndb_binlog_multi.test b/mysql-test/suite/ndb/t/ndb_binlog_multi.test
new file mode 100644
index 00000000000..c39034c71f6
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_binlog_multi.test
@@ -0,0 +1,82 @@
+-- source include/have_multi_ndb.inc
+-- source include/have_binlog_format_mixed_or_row.inc
+
+--disable_warnings
+connection server2;
+drop table if exists t1,t2,t3;
+connection server1;
+drop table if exists t1,t2,t3;
+--enable_warnings
+
+# Dummy table create/drop to avoid a race where table is created
+# before event subscription is set up, causing test failure (BUG#20677).
+connection server2;
+CREATE TABLE t3 (dummy INT PRIMARY KEY) ENGINE = NDB;
+connection server1;
+DROP TABLE t3;
+
+# reset for test
+connection server1;
+reset master;
+connection server2;
+reset master;
+
+#
+# basic test to see if one server sees the table from the other
+# and sets up the replication correctly
+#
+
+# create table on the other server
+connection server2;
+CREATE TABLE t2 (a INT PRIMARY KEY, b int) ENGINE = NDB;
+
+# insert something on server2
+INSERT INTO t2 VALUES (1,1),(2,2);
+# verify that we get the data in the binlog
+--source include/show_binlog_events2.inc
+select * from t2 order by a;
+--replace_column 1 <the_epoch>
+SELECT @the_epoch:=epoch,inserts,updates,deletes,schemaops FROM
+ mysql.ndb_binlog_index ORDER BY epoch DESC LIMIT 1;
+let $the_epoch= `SELECT @the_epoch`;
+
+# see if we got something on server1
+connection server1;
+SELECT * FROM t2 ORDER BY a;
+# doing drop table will ensure that all the events have been received
+DROP TABLE t2;
+# verify thar we have table and data in binlog
+--source include/show_binlog_events2.inc
+--replace_result $the_epoch <the_epoch>
+eval SELECT inserts,updates,deletes,schemaops FROM
+ mysql.ndb_binlog_index WHERE epoch=$the_epoch;
+
+# reset for next test
+connection server1;
+reset master;
+connection server2;
+reset master;
+
+# single schema ops will not show
+connection server2;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = NDB;
+INSERT INTO t1 VALUES (1),(2);
+--source include/show_binlog_events2.inc
+--replace_column 1 <the_epoch2>
+SELECT @the_epoch2:=epoch,inserts,updates,deletes,schemaops FROM
+ mysql.ndb_binlog_index ORDER BY epoch DESC LIMIT 1;
+let $the_epoch2= `SELECT @the_epoch2`;
+
+--replace_result $the_epoch <the_epoch> $the_epoch2 <the_epoch2>
+eval SELECT inserts,updates,deletes,schemaops FROM
+ mysql.ndb_binlog_index WHERE epoch > $the_epoch AND epoch <= $the_epoch2;
+
+# now see that we have the events on the other server
+connection server2;
+# doing drop table will ensure that all the events have been received
+drop table t1;
+# verify thar we have table and data in binlog
+--source include/show_binlog_events2.inc
+--replace_result $the_epoch <the_epoch> $the_epoch2 <the_epoch2>
+eval SELECT inserts,updates,deletes,schemaops FROM
+ mysql.ndb_binlog_index WHERE epoch > $the_epoch AND epoch <= $the_epoch2;
diff --git a/mysql-test/t/ndb_bitfield.test b/mysql-test/suite/ndb/t/ndb_bitfield.test
index de0ae23bfe6..de0ae23bfe6 100644
--- a/mysql-test/t/ndb_bitfield.test
+++ b/mysql-test/suite/ndb/t/ndb_bitfield.test
diff --git a/mysql-test/t/ndb_blob.test b/mysql-test/suite/ndb/t/ndb_blob.test
index b9a8c7e20ee..b9a8c7e20ee 100644
--- a/mysql-test/t/ndb_blob.test
+++ b/mysql-test/suite/ndb/t/ndb_blob.test
diff --git a/mysql-test/t/ndb_blob_partition.test b/mysql-test/suite/ndb/t/ndb_blob_partition.test
index 35df57b96ba..35df57b96ba 100644
--- a/mysql-test/t/ndb_blob_partition.test
+++ b/mysql-test/suite/ndb/t/ndb_blob_partition.test
diff --git a/mysql-test/suite/ndb/t/ndb_bug26793.test b/mysql-test/suite/ndb/t/ndb_bug26793.test
new file mode 100644
index 00000000000..f35d8808c1a
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_bug26793.test
@@ -0,0 +1,35 @@
+-- source include/have_ndb.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE `test` (
+`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+`t` VARCHAR( 10 ) NOT NULL
+) ENGINE = ndbcluster;
+
+# Add user1@localhost with a specific password
+# and connect as that user
+GRANT USAGE ON *.* TO user1@localhost IDENTIFIED BY 'pass';
+connect (user1,localhost,user1,pass,*NO-ONE*);
+
+# Run the query 100 times
+disable_query_log;
+disable_result_log;
+let $i= 100;
+while ($i)
+{
+select count(*) from information_schema.tables union all select count(*) from information_schema.tables union all select count(*) from information_schema.tables;
+dec $i;
+}
+enable_query_log;
+enable_result_log;
+
+disconnect user1;
+
+# Switch back to the default connection and cleanup
+connection default;
+DROP TABLE `test`.`test`;
+drop user user1@localhost;
+
diff --git a/mysql-test/t/ndb_cache.test b/mysql-test/suite/ndb/t/ndb_cache.test
index 9c299b61c24..9c299b61c24 100644
--- a/mysql-test/t/ndb_cache.test
+++ b/mysql-test/suite/ndb/t/ndb_cache.test
diff --git a/mysql-test/t/ndb_cache2.test b/mysql-test/suite/ndb/t/ndb_cache2.test
index 352b01ef73f..352b01ef73f 100644
--- a/mysql-test/t/ndb_cache2.test
+++ b/mysql-test/suite/ndb/t/ndb_cache2.test
diff --git a/mysql-test/suite/ndb/t/ndb_cache_multi.test b/mysql-test/suite/ndb/t/ndb_cache_multi.test
new file mode 100644
index 00000000000..8c7f186b866
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_cache_multi.test
@@ -0,0 +1,71 @@
+-- source include/have_query_cache.inc
+-- source include/have_multi_ndb.inc
+-- source include/not_embedded.inc
+
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+
+
+# Turn on and reset query cache on server1
+connection server1;
+set GLOBAL query_cache_type=on;
+set GLOBAL query_cache_size=1355776;
+reset query cache;
+flush status;
+
+# Turn on and reset query cache on server2
+connection server2;
+set GLOBAL query_cache_type=on;
+set GLOBAL query_cache_size=1355776;
+reset query cache;
+flush status;
+
+
+
+# Create test tables in NDB and load them into cache
+# on server1
+connection server1;
+create table t1 (a int) engine=ndbcluster;
+create table t2 (a int) engine=ndbcluster;
+insert into t1 value (2);
+insert into t2 value (3);
+select * from t1;
+select * from t2;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+
+
+# Connect server2, load table in to cache, then update the table
+connection server2;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+update t1 set a=3 where a=2;
+
+# Connect to server1 and check that cache is invalidated
+# and correct data is returned
+connection server1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+
+drop table t1, t2;
+
+
+# Turn off query cache on server1
+connection server1;
+set GLOBAL query_cache_size=0;
+
+# Turn off query cache on server2
+connection server2;
+set GLOBAL query_cache_size=0;
diff --git a/mysql-test/suite/ndb/t/ndb_cache_multi2.test b/mysql-test/suite/ndb/t/ndb_cache_multi2.test
new file mode 100644
index 00000000000..853e4090193
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_cache_multi2.test
@@ -0,0 +1,125 @@
+-- source include/have_query_cache.inc
+-- source include/have_multi_ndb.inc
+-- source include/not_embedded.inc
+
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+
+
+# Turn on and reset query cache on server1
+connection server1;
+echo == Connected to server1 ==;
+set GLOBAL query_cache_type=on;
+set GLOBAL query_cache_size=1355776;
+set GLOBAL ndb_cache_check_time=1;
+reset query cache;
+flush status;
+
+# Turn on and reset query cache on server2
+connection server2;
+echo == Connected to server2 ==;
+set GLOBAL query_cache_type=on;
+set GLOBAL query_cache_size=1355776;
+set GLOBAL ndb_cache_check_time=1;
+reset query cache;
+flush status;
+
+# Create test tables in NDB and load them into cache
+# on server1
+connection server1;
+echo == Connected to server1 ==;
+create table t1 (a int) engine=ndbcluster;
+create table t2 (a int) engine=ndbcluster;
+insert into t1 value (2);
+insert into t2 value (3);
+select * from t1;
+# Run the check query once to load it into qc on server1
+# See at the end of this test why we need to disable ps-protocol for
+# this query (*)
+--disable_ps_protocol
+select a != 3 from t1;
+--enable_ps_protocol
+select * from t2;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+
+
+# Connect server2, load table in to cache, then update the table
+connection server2;
+echo == Connected to server2 ==;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+update t1 set a=3 where a=2;
+
+# Connect to server1 and check that cache is invalidated
+# and correct data is returned
+connection server1;
+echo == Connected to server1 ==;
+
+# Loop and wait for max 10 seconds until query cache thread
+# has invalidated the cache and the column a in t1 is equal to 3
+let $retries=20;
+while (`select a != 3 from t1`)
+{
+ dec $retries;
+ if (!$retries)
+ {
+ The query_cache thread failed to invalidate query_cache in 10 seconds;
+ }
+ sleep 0.5;
+}
+
+# Select from t1 one last time for the result file
+# Column a should be 3
+select * from t1;
+
+# There should now be three queries in the cache
+show status like "Qcache_queries_in_cache";
+
+drop table t1, t2;
+
+# Turn off and reset query cache on server1 and server2
+connection server1;
+set GLOBAL query_cache_size=0;
+set GLOBAL ndb_cache_check_time=0;
+reset query cache;
+flush status;
+connection server2;
+set GLOBAL query_cache_size=0;
+set GLOBAL ndb_cache_check_time=0;
+reset query cache;
+flush status;
+
+# (*) Why we need to execute the query in non-ps mode.
+# The principle of this test is: two mysqlds connected to one cluster,
+# both using their query cache. Queries are cached in server1
+# ("select a!=3 from t1", "select * from t1"),
+# table t1 is modified in server2, we want to see that this invalidates
+# the query cache of server1. Invalidation with NDB works like this:
+# when a query is found in the query cache, NDB is asked if the tables
+# have changed. In this test, ha_ndbcluster calls NDB every millisecond
+# to collect change information about tables.
+# Due to this millisecond delay, there is need for a loop ("while...")
+# in this test, which waits until a query1 ("select a!=3 from t1") is
+# invalidated (which is equivalent to it returning
+# up-to-date results), and then expects query2 ("select * from t1")
+# to have been invalidated (see up-to-date results).
+# But when enabling --ps-protocol in this test, the logic breaks,
+# because query1 is still done via mysql_real_query() (see mysqltest.c:
+# eval_expr() always uses mysql_real_query()). So, query1 returning
+# up-to-date results is not a sign of it being invalidated in the cache,
+# because it was NOT in the cache ("select a!=3 from t1" on line 39
+# was done with prep stmts, while `select a!=3 from t1` is not,
+# thus the second does not see the first in the cache). Thus, we may run
+# query2 when cache still has not been invalidated.
+# The solution is to make the initial "select a!=3 from t1" run
+# as a normal query, this repairs the broken logic.
+# But note, "select * from t1" is still using prepared statements
+# which was the goal of this test with --ps-protocol.
diff --git a/mysql-test/suite/ndb/t/ndb_charset.test b/mysql-test/suite/ndb/t/ndb_charset.test
new file mode 100644
index 00000000000..2d9f66564bc
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_charset.test
@@ -0,0 +1,257 @@
+--source include/have_ndb.inc
+-- source include/not_embedded.inc
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+#
+# Minimal NDB charset test.
+#
+
+# pk - binary
+
+create table t1 (
+ a char(3) character set latin1 collate latin1_bin primary key
+) engine=ndb;
+# ok
+insert into t1 values('aAa');
+insert into t1 values('aaa');
+insert into t1 values('AAA');
+# 3
+select * from t1 order by a;
+# 1
+select * from t1 where a = 'aAa';
+# 1
+select * from t1 where a = 'aaa';
+# 0
+select * from t1 where a = 'AaA';
+# 1
+select * from t1 where a = 'AAA';
+drop table t1;
+
+# pk - case insensitive
+
+create table t1 (
+ a char(3) character set latin1 collate latin1_swedish_ci primary key
+) engine=ndb;
+# ok
+insert into t1 values('aAa');
+# fail
+--error ER_DUP_ENTRY
+insert into t1 values('aaa');
+--error ER_DUP_ENTRY
+insert into t1 values('AAA');
+# 1
+select * from t1 order by a;
+# 1
+select * from t1 where a = 'aAa';
+# 1
+select * from t1 where a = 'aaa';
+# 1
+select * from t1 where a = 'AaA';
+# 1
+select * from t1 where a = 'AAA';
+drop table t1;
+
+# pk - varchar
+
+create table t1 (
+ a varchar(20) character set latin1 collate latin1_swedish_ci primary key
+) engine=ndb;
+#
+insert into t1 values ('A'),('b '),('C '),('d '),('E'),('f');
+-- error ER_DUP_ENTRY
+insert into t1 values('b');
+-- error ER_DUP_ENTRY
+insert into t1 values('a ');
+#
+select a,length(a) from t1 order by a;
+select a,length(a) from t1 order by a desc;
+select * from t1 where a = 'a';
+select * from t1 where a = 'a ';
+select * from t1 where a = 'd';
+drop table t1;
+
+# unique hash index - binary
+
+create table t1 (
+ p int primary key,
+ a char(3) character set latin1 collate latin1_bin not null,
+ unique key(a)
+) engine=ndb;
+# ok
+insert into t1 values(1, 'aAa');
+insert into t1 values(2, 'aaa');
+insert into t1 values(3, 'AAA');
+# 3
+select * from t1 order by p;
+# 1
+select * from t1 where a = 'aAa';
+# 1
+select * from t1 where a = 'aaa';
+# 0
+select * from t1 where a = 'AaA';
+# 1
+select * from t1 where a = 'AAA';
+drop table t1;
+
+# unique hash index - case insensitive
+
+create table t1 (
+ p int primary key,
+ a char(3) character set latin1 collate latin1_swedish_ci not null,
+ unique key(a)
+) engine=ndb;
+# ok
+insert into t1 values(1, 'aAa');
+# fail
+--error ER_DUP_ENTRY
+insert into t1 values(2, 'aaa');
+--error ER_DUP_ENTRY
+insert into t1 values(3, 'AAA');
+# 1
+select * from t1 order by p;
+# 1
+select * from t1 where a = 'aAa';
+# 1
+select * from t1 where a = 'aaa';
+# 1
+select * from t1 where a = 'AaA';
+# 1
+select * from t1 where a = 'AAA';
+drop table t1;
+
+# unique hash index - varchar
+
+create table t1 (
+ p int primary key,
+ a varchar(20) character set latin1 collate latin1_swedish_ci not null,
+ unique key(a)
+) engine=ndb;
+#
+insert into t1 values (1,'A'),(2,'b '),(3,'C '),(4,'d '),(5,'E'),(6,'f');
+-- error ER_DUP_ENTRY
+insert into t1 values(99,'b');
+-- error ER_DUP_ENTRY
+insert into t1 values(99,'a ');
+#
+select a,length(a) from t1 order by a;
+select a,length(a) from t1 order by a desc;
+select * from t1 where a = 'a';
+select * from t1 where a = 'a ';
+select * from t1 where a = 'd';
+drop table t1;
+
+# ordered index - binary
+
+create table t1 (
+ p int primary key,
+ a char(3) character set latin1 collate latin1_bin not null,
+ index(a)
+) engine=ndb;
+# ok
+insert into t1 values(1, 'aAa');
+insert into t1 values(2, 'aaa');
+insert into t1 values(3, 'AAA');
+insert into t1 values(4, 'aAa');
+insert into t1 values(5, 'aaa');
+insert into t1 values(6, 'AAA');
+# 6
+select * from t1 order by p;
+# plan too flaky
+#--replace_column 9 #
+#explain select * from t1 where a = 'zZz' order by p;
+# 2
+select * from t1 where a = 'aAa' order by p;
+# 2
+select * from t1 where a = 'aaa' order by p;
+# 0
+select * from t1 where a = 'AaA' order by p;
+# 2
+select * from t1 where a = 'AAA' order by p;
+drop table t1;
+
+# ordered index - case insensitive
+
+create table t1 (
+ p int primary key,
+ a char(3) character set latin1 collate latin1_swedish_ci not null,
+ index(a)
+) engine=ndb;
+# ok
+insert into t1 values(1, 'aAa');
+insert into t1 values(2, 'aaa');
+insert into t1 values(3, 'AAA');
+insert into t1 values(4, 'aAa');
+insert into t1 values(5, 'aaa');
+insert into t1 values(6, 'AAA');
+# 6
+select * from t1 order by p;
+# plan too flaky
+#--replace_column 9 #
+#explain select * from t1 where a = 'zZz' order by p;
+# 6
+select * from t1 where a = 'aAa' order by p;
+# 6
+select * from t1 where a = 'aaa' order by p;
+# 6
+select * from t1 where a = 'AaA' order by p;
+# 6
+select * from t1 where a = 'AAA' order by p;
+drop table t1;
+
+# ordered index - varchar
+
+create table t1 (
+ p int primary key,
+ a varchar(20) character set latin1 collate latin1_swedish_ci not null,
+ index(a, p)
+) engine=ndb;
+#
+insert into t1 values (1,'A'),(2,'b '),(3,'C '),(4,'d '),(5,'E'),(6,'f');
+insert into t1 values (7,'a'),(8,'B '),(9,'c '),(10,'D'),(11,'e'),(12,'F ');
+select p,a,length(a) from t1 order by a, p;
+select * from t1 where a = 'a ' order by a desc, p desc;
+select * from t1 where a >= 'D' order by a, p;
+select * from t1 where a < 'D' order by a, p;
+#
+select count(*) from t1 x, t1 y, t1 z where x.a = y.a and y.a = z.a;
+drop table t1;
+
+# minimal multi-byte test
+# removed by jonas as this requires a configure --with-extra-charsets
+#create table t1 (
+# a char(5) character set ucs2,
+# b varchar(7) character set utf8,
+# primary key(a, b)
+#) engine=ndb;
+#
+#insert into t1 values
+# ('a','A '),('B ','b'),('c','C '),('D','d'),('e ','E'),('F','f '),
+# ('A','b '),('b ','C'),('C','d '),('d','E'),('E ','f'),
+# ('a','C '),('B ','d'),('c','E '),('D','f');
+#-- error ER_DUP_ENTRY
+#insert into t1 values('d','f');
+#
+#select a,b,length(a),length(b) from t1 order by a,b limit 3;
+#select a,b,length(a),length(b) from t1 order by a desc, b desc limit 3;
+#select a,b,length(a),length(b) from t1 where a='c' and b='c';
+#drop table t1;
+
+# bug#14007
+create table t1 (
+ a char(10) primary key
+) engine=ndbcluster default charset=latin1;
+
+insert into t1 values ('aaabb');
+select * from t1;
+replace into t1 set a = 'AAABB';
+select * from t1;
+replace into t1 set a = 'aAaBb';
+select * from t1;
+replace into t1 set a = 'aaabb';
+select * from t1;
+drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ndb_condition_pushdown.test b/mysql-test/suite/ndb/t/ndb_condition_pushdown.test
index ab56430ac1d..ab56430ac1d 100644
--- a/mysql-test/t/ndb_condition_pushdown.test
+++ b/mysql-test/suite/ndb/t/ndb_condition_pushdown.test
diff --git a/mysql-test/t/ndb_config.test b/mysql-test/suite/ndb/t/ndb_config.test
index f63c0087c1e..f63c0087c1e 100644
--- a/mysql-test/t/ndb_config.test
+++ b/mysql-test/suite/ndb/t/ndb_config.test
diff --git a/mysql-test/t/ndb_config2.test b/mysql-test/suite/ndb/t/ndb_config2.test
index 170f1b2e5e7..170f1b2e5e7 100644
--- a/mysql-test/t/ndb_config2.test
+++ b/mysql-test/suite/ndb/t/ndb_config2.test
diff --git a/mysql-test/t/ndb_cursor.test b/mysql-test/suite/ndb/t/ndb_cursor.test
index 406f8629cfe..406f8629cfe 100644
--- a/mysql-test/t/ndb_cursor.test
+++ b/mysql-test/suite/ndb/t/ndb_cursor.test
diff --git a/mysql-test/t/ndb_database.test b/mysql-test/suite/ndb/t/ndb_database.test
index 8bfdf40de88..8bfdf40de88 100644
--- a/mysql-test/t/ndb_database.test
+++ b/mysql-test/suite/ndb/t/ndb_database.test
diff --git a/mysql-test/t/ndb_dd_alter.test b/mysql-test/suite/ndb/t/ndb_dd_alter.test
index 7635a8944da..7635a8944da 100644
--- a/mysql-test/t/ndb_dd_alter.test
+++ b/mysql-test/suite/ndb/t/ndb_dd_alter.test
diff --git a/mysql-test/t/ndb_dd_backuprestore.test b/mysql-test/suite/ndb/t/ndb_dd_backuprestore.test
index 48db8ec3e0b..48db8ec3e0b 100644
--- a/mysql-test/t/ndb_dd_backuprestore.test
+++ b/mysql-test/suite/ndb/t/ndb_dd_backuprestore.test
diff --git a/mysql-test/suite/ndb/t/ndb_dd_basic.test b/mysql-test/suite/ndb/t/ndb_dd_basic.test
new file mode 100644
index 00000000000..8c83c2febe5
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_dd_basic.test
@@ -0,0 +1,460 @@
+#################################
+# Author: JO
+# Org Date: ?
+# Purpose: To test basic Cluster Disk Data
+#################################
+# Change Author: JBM
+# Change Date: 2006-01-11
+# Change: Cleanup and test rename
+#################################
+# Change Author: Guangbao Ni
+# Change Date: 2007-03-20
+# Change: Test insert data when no datafile in spacetable
+#################################
+
+-- source include/have_ndb.inc
+
+#
+# Bug#30322 Server crashes on selecting from i_s.columns when cluster is running -regression
+#
+--replace_column 1 #
+select count(*) from information_schema.columns;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# some negative tests
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+INITIAL_SIZE 16M
+UNDO_BUFFER_SIZE = 1M
+ENGINE=MYISAM;
+
+ALTER LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile02.dat'
+INITIAL_SIZE = 4M
+ENGINE=XYZ;
+
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 12M;
+
+##################################
+# Basic test of disk tables for NDB
+# Start by creating a logfile group
+##################################
+
+set storage_engine=ndb;
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+INITIAL_SIZE 16M
+UNDO_BUFFER_SIZE = 1M;
+
+ALTER LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile02.dat'
+INITIAL_SIZE = 4M
+ENGINE=NDB;
+
+###################################################
+# Create a tablespace connected to the logfile group
+###################################################
+
+set storage_engine=myisam;
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 12M
+ENGINE NDB;
+
+ALTER TABLESPACE ts1
+ADD DATAFILE 'datafile02.dat'
+INITIAL_SIZE = 4M
+ENGINE=NDB;
+
+########################################
+# Create a table using this tablespace
+########################################
+
+CREATE TABLE t1
+(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
+TABLESPACE ts1 STORAGE DISK
+ENGINE=NDB;
+
+SHOW CREATE TABLE t1;
+
+INSERT INTO t1 VALUES (0, 0, 0);
+SELECT * FROM t1;
+
+INSERT INTO t1 VALUES
+(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
+(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10),
+(11,11,11),(12,12,12),(13,13,13),(14,14,14),(15,15,15),
+(16,16,16),(17,17,17),(18,18,18),(19,19,19),(20,20,20),
+(21,21,21),(22,22,22),(23,23,23),(24,24,24),(25,25,25),
+(26,26,26),(27,27,27),(28,28,28),(29,29,29),(30,30,30),
+(31,31,31),(32,32,32),(33,33,33),(34,34,34),(35,35,35),
+(36,36,36),(37,37,37),(38,38,38),(39,39,39),(40,40,40),
+(41,41,41),(42,42,42),(43,43,43),(44,44,44),(45,45,45),
+(46,46,46),(47,47,47),(48,48,48),(49,49,49),(50,50,50),
+(51,51,51),(52,52,52),(53,53,53),(54,54,54),(55,55,55),
+(56,56,56),(57,57,57),(58,58,58),(59,59,59),(60,60,60),
+(61,61,61),(62,62,62),(63,63,63),(64,64,64),(65,65,65),
+(66,66,66),(67,67,67),(68,68,68),(69,69,69),(70,70,70),
+(71,71,71),(72,72,72),(73,73,73),(74,74,74),(75,75,75),
+(76,76,76),(77,77,77),(78,78,78),(79,79,79),(80,80,80),
+(81,81,81),(82,82,82),(83,83,83),(84,84,84),(85,85,85),
+(86,86,86),(87,87,87),(88,88,88),(89,89,89),(90,90,90),
+(91,91,91),(92,92,92),(93,93,93),(94,94,94),(95,95,95),
+(96,96,96),(97,97,97),(98,98,98),(99,99,99),(100,100,100),
+(101,101,101),(102,102,102),(103,103,103),(104,104,104),(105,105,105),
+(106,106,106),(107,107,107),(108,108,108),(109,109,109),(110,110,110),
+(111,111,111),(112,112,112),(113,113,113),(114,114,114),(115,115,115),
+(116,116,116),(117,117,117),(118,118,118),(119,119,119),(120,120,120),
+(121,121,121),(122,122,122),(123,123,123),(124,124,124),(125,125,125),
+(126,126,126),(127,127,127),(128,128,128),(129,129,129),(130,130,130),
+(131,131,131),(132,132,132),(133,133,133),(134,134,134),(135,135,135),
+(136,136,136),(137,137,137),(138,138,138),(139,139,139),(140,140,140),
+(141,141,141),(142,142,142),(143,143,143),(144,144,144),(145,145,145),
+(146,146,146),(147,147,147),(148,148,148),(149,149,149),(150,150,150),
+(151,151,151),(152,152,152),(153,153,153),(154,154,154),(155,155,155),
+(156,156,156),(157,157,157),(158,158,158),(159,159,159),(160,160,160),
+(161,161,161),(162,162,162),(163,163,163),(164,164,164),(165,165,165),
+(166,166,166),(167,167,167),(168,168,168),(169,169,169),(170,170,170),
+(171,171,171),(172,172,172),(173,173,173),(174,174,174),(175,175,175),
+(176,176,176),(177,177,177),(178,178,178),(179,179,179),(180,180,180),
+(181,181,181),(182,182,182),(183,183,183),(184,184,184),(185,185,185),
+(186,186,186),(187,187,187),(188,188,188),(189,189,189),(190,190,190),
+(191,191,191),(192,192,192),(193,193,193),(194,194,194),(195,195,195),
+(196,196,196),(197,197,197),(198,198,198),(199,199,199),(200,200,200),
+(201,201,201),(202,202,202),(203,203,203),(204,204,204),(205,205,205),
+(206,206,206),(207,207,207),(208,208,208),(209,209,209),(210,210,210),
+(211,211,211),(212,212,212),(213,213,213),(214,214,214),(215,215,215),
+(216,216,216),(217,217,217),(218,218,218),(219,219,219),(220,220,220),
+(221,221,221),(222,222,222),(223,223,223),(224,224,224),(225,225,225),
+(226,226,226),(227,227,227),(228,228,228),(229,229,229),(230,230,230),
+(231,231,231),(232,232,232),(233,233,233),(234,234,234),(235,235,235),
+(236,236,236),(237,237,237),(238,238,238),(239,239,239),(240,240,240),
+(241,241,241),(242,242,242),(243,243,243),(244,244,244),(245,245,245),
+(246,246,246),(247,247,247),(248,248,248),(249,249,249),(250,250,250),
+(251,251,251),(252,252,252),(253,253,253),(254,254,254),(255,255,255),
+(256,256,256),(257,257,257),(258,258,258),(259,259,259),(260,260,260),
+(261,261,261),(262,262,262),(263,263,263),(264,264,264),(265,265,265),
+(266,266,266),(267,267,267),(268,268,268),(269,269,269),(270,270,270),
+(271,271,271),(272,272,272),(273,273,273),(274,274,274),(275,275,275),
+(276,276,276),(277,277,277),(278,278,278),(279,279,279),(280,280,280),
+(281,281,281),(282,282,282),(283,283,283),(284,284,284),(285,285,285),
+(286,286,286),(287,287,287),(288,288,288),(289,289,289),(290,290,290),
+(291,291,291),(292,292,292),(293,293,293),(294,294,294),(295,295,295),
+(296,296,296),(297,297,297),(298,298,298),(299,299,299),(300,300,300),
+(301,301,301),(302,302,302),(303,303,303),(304,304,304),(305,305,305),
+(306,306,306),(307,307,307),(308,308,308),(309,309,309),(310,310,310),
+(311,311,311),(312,312,312),(313,313,313),(314,314,314),(315,315,315),
+(316,316,316),(317,317,317),(318,318,318),(319,319,319),(320,320,320),
+(321,321,321),(322,322,322),(323,323,323),(324,324,324),(325,325,325),
+(326,326,326),(327,327,327),(328,328,328),(329,329,329),(330,330,330),
+(331,331,331),(332,332,332),(333,333,333),(334,334,334),(335,335,335),
+(336,336,336),(337,337,337),(338,338,338),(339,339,339),(340,340,340),
+(341,341,341),(342,342,342),(343,343,343),(344,344,344),(345,345,345),
+(346,346,346),(347,347,347),(348,348,348),(349,349,349),(350,350,350),
+(351,351,351),(352,352,352),(353,353,353),(354,354,354),(355,355,355),
+(356,356,356),(357,357,357),(358,358,358),(359,359,359),(360,360,360),
+(361,361,361),(362,362,362),(363,363,363),(364,364,364),(365,365,365),
+(366,366,366),(367,367,367),(368,368,368),(369,369,369),(370,370,370),
+(371,371,371),(372,372,372),(373,373,373),(374,374,374),(375,375,375),
+(376,376,376),(377,377,377),(378,378,378),(379,379,379),(380,380,380),
+(381,381,381),(382,382,382),(383,383,383),(384,384,384),(385,385,385),
+(386,386,386),(387,387,387),(388,388,388),(389,389,389),(390,390,390),
+(391,391,391),(392,392,392),(393,393,393),(394,394,394),(395,395,395),
+(396,396,396),(397,397,397),(398,398,398),(399,399,399),(400,400,400),
+(401,401,401),(402,402,402),(403,403,403),(404,404,404),(405,405,405),
+(406,406,406),(407,407,407),(408,408,408),(409,409,409),(410,410,410),
+(411,411,411),(412,412,412),(413,413,413),(414,414,414),(415,415,415),
+(416,416,416),(417,417,417),(418,418,418),(419,419,419),(420,420,420),
+(421,421,421),(422,422,422),(423,423,423),(424,424,424),(425,425,425),
+(426,426,426),(427,427,427),(428,428,428),(429,429,429),(430,430,430),
+(431,431,431),(432,432,432),(433,433,433),(434,434,434),(435,435,435),
+(436,436,436),(437,437,437),(438,438,438),(439,439,439),(440,440,440),
+(441,441,441),(442,442,442),(443,443,443),(444,444,444),(445,445,445),
+(446,446,446),(447,447,447),(448,448,448),(449,449,449),(450,450,450),
+(451,451,451),(452,452,452),(453,453,453),(454,454,454),(455,455,455),
+(456,456,456),(457,457,457),(458,458,458),(459,459,459),(460,460,460),
+(461,461,461),(462,462,462),(463,463,463),(464,464,464),(465,465,465),
+(466,466,466),(467,467,467),(468,468,468),(469,469,469),(470,470,470),
+(471,471,471),(472,472,472),(473,473,473),(474,474,474),(475,475,475),
+(476,476,476),(477,477,477),(478,478,478),(479,479,479),(480,480,480),
+(481,481,481),(482,482,482),(483,483,483),(484,484,484),(485,485,485),
+(486,486,486),(487,487,487),(488,488,488),(489,489,489),(490,490,490),
+(491,491,491),(492,492,492),(493,493,493),(494,494,494),(495,495,495),
+(496,496,496),(497,497,497),(498,498,498),(499,499,499),(500, 500, 500);
+
+SELECT COUNT(*) FROM t1;
+
+####################################
+# Test error cases with size numbers
+####################################
+--error ER_WRONG_SIZE_NUMBER
+CREATE LOGFILE GROUP lg2
+ADD UNDOFILE 'x.dat'
+INITIAL_SIZE 10y
+ENGINE = NDB;
+
+--error ER_WRONG_SIZE_NUMBER
+CREATE LOGFILE GROUP lg2
+ADD UNDOFILE 'x.dat'
+INITIAL_SIZE 10MB
+ENGINE = NDB;
+
+--error 1064
+CREATE LOGFILE GROUP lg2
+ADD UNDOFILE 'x.dat'
+INITIAL_SIZE 10 MB
+ENGINE = NDB;
+
+--error 1064
+CREATE LOGFILE GROUP lg2
+ADD UNDOFILE 'x.dat'
+INITIAL_SIZE 10 M
+ENGINE = NDB;
+
+--error ER_SIZE_OVERFLOW_ERROR
+CREATE LOGFILE GROUP lg2
+ADD UNDOFILE 'x.dat'
+INITIAL_SIZE 1000000000000K
+ENGINE = NDB;
+
+DROP TABLE t1;
+
+create tablespace ts2
+add datafile 'datafile2_1.dat'
+use logfile group lg1
+initial_size 12M
+engine ndb;
+
+CREATE TABLE City (
+ ID int(11) NOT NULL AUTO_INCREMENT,
+ Name char(35) NOT NULL,
+ CountryCode char(3) NOT NULL,
+ District char(20) NOT NULL,
+ Population int(11) NOT NULL,
+ PRIMARY KEY (ID)
+) ENGINE=ndbcluster
+tablespace ts2
+storage disk;
+
+alter tablespace ts2
+drop datafile 'datafile2_1.dat'
+engine ndb;
+
+#It will give error messages: NoDatafile in tablespace
+--error ER_GET_ERRMSG
+insert
+into City (Name,CountryCode,District,Population)
+values ('BeiJing','CN','Beijing',2000);
+
+--error ER_DROP_FILEGROUP_FAILED
+drop tablespace ts2
+engine ndb;
+
+drop table City;
+
+drop tablespace ts2
+engine ndb;
+
+############################
+# Test update of mm/dd part
+############################
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(4) NOT NULL, c CHAR(4) NOT NULL, KEY(b)) TABLESPACE ts1 STORAGE DISK ENGINE = NDB;
+INSERT INTO t1 VALUES (1,'1','1'), (2,'2','2'), (3,'3','3');
+BEGIN;
+UPDATE t1 SET b = '2' WHERE a = 1;
+SELECT b FROM t1 WHERE a = 1;
+SELECT * FROM t1 WHERE a = 1;
+UPDATE t1 SET c = '2' WHERE a = 1;
+SELECT b FROM t1 WHERE a = 1;
+SELECT * FROM t1 WHERE a = 1;
+UPDATE t1 SET b = '3' WHERE a = 1;
+SELECT b FROM t1 WHERE a = 1;
+SELECT * FROM t1 WHERE a = 1;
+COMMIT;
+SELECT * FROM t1 ORDER BY 1;
+BEGIN;
+UPDATE t1 SET c = '3' WHERE a = 1;
+SELECT b FROM t1 WHERE a = 1;
+SELECT * FROM t1 WHERE a = 1;
+UPDATE t1 SET b = '4' WHERE a = 1;
+SELECT b FROM t1 WHERE a = 1;
+SELECT * FROM t1 WHERE a = 1;
+UPDATE t1 SET c = '4' WHERE a = 1;
+SELECT b FROM t1 WHERE a = 1;
+SELECT * FROM t1 WHERE a = 1;
+COMMIT;
+SELECT * FROM t1 ORDER BY 1;
+UPDATE t1 SET b = '5' WHERE a = 1;
+SELECT * FROM t1 ORDER BY 1;
+UPDATE t1 SET b = '6' WHERE b = '5';
+SELECT * FROM t1 ORDER BY 1;
+UPDATE t1 SET b = '7'WHERE c = '4';
+SELECT * FROM t1 ORDER BY 1;
+UPDATE t1 SET c = '5' WHERE a = 1;
+SELECT * FROM t1 ORDER BY 1;
+UPDATE t1 SET c = '6' WHERE b = '7';
+SELECT * FROM t1 ORDER BY 1;
+UPDATE t1 SET c = '7' WHERE c = '6';
+SELECT * FROM t1 ORDER BY 1;
+DROP TABLE t1;
+
+#####
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(4) NOT NULL, c CHAR(4) NOT NULL, KEY(b)) TABLESPACE ts1 STORAGE DISK ENGINE NDB;
+INSERT INTO t1 VALUE (1,'1','1'), (2,'2','2'), (3,'3','3');
+BEGIN;
+UPDATE t1 SET b = '2' WHERE a = 1;
+SELECT b FROM t1 WHERE a = 1;
+SELECT * FROM t1 WHERE a = 1;
+UPDATE t1 SET c = '2' WHERE a = 1;
+SELECT b FROM t1 WHERE a = 1;
+SELECT * FROM t1 WHERE a = 1;
+UPDATE t1 SET b = '3' WHERE a = 1;
+SELECT b FROM t1 WHERE a = 1;
+SELECT * FROM t1 WHERE a = 1;
+COMMIT;
+SELECT * FROM t1 ORDER BY 1;
+BEGIN;
+UPDATE t1 SET c = '3' WHERE a = 1;
+SELECT b FROM t1 WHERE a = 1;
+SELECT * FROM t1 WHERE a = 1;
+UPDATE t1 SET b = '4' WHERE a = 1;
+SELECT b FROM t1 WHERE a = 1;
+SELECT * FROM t1 WHERE a = 1;
+UPDATE t1 SET c = '4' WHERE a = 1;
+SELECT b FROM t1 WHERE a = 1;
+SELECT * FROM t1 WHERE a = 1;
+COMMIT;
+SELECT * FROM t1 ORDER BY 1;
+UPDATE t1 SET b = '5' WHERE a = 1;
+SELECT * FROM t1 ORDER BY 1;
+UPDATE t1 SET b = '6' WHERE b = '5';
+SELECT * FROM t1 ORDER BY 1;
+UPDATE t1 SET b = '7' WHERE c = '4';
+SELECT * FROM t1 ORDER BY 1;
+UPDATE t1 SET c = '5' WHERE a = 1;
+SELECT * FROM t1 ORDER BY 1;
+UPDATE t1 SET c = '6' WHERE b = '7';
+SELECT * FROM t1 ORDER BY 1;
+UPDATE t1 SET c = '7' WHERE c = '6';
+SELECT * FROM t1 ORDER BY 1;
+DROP TABLE t1;
+
+########################
+# Test for blobs...
+########################
+
+CREATE TABLE t1 (
+ a INT NOT NULL PRIMARY KEY,
+ b TEXT NOT NULL
+) TABLESPACE ts1 STORAGE DISK ENGINE=NDBCLUSTER;
+
+# b1 length 2000+256 (blob part aligned)
+#########################################
+set @x0 = '01234567012345670123456701234567';
+set @x0 = concat(@x0,@x0,@x0,@x0,@x0,@x0,@x0,@x0);
+set @b1 = 'b1';
+set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
+set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
+set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
+set @b1 = concat(@b1,@x0);
+# b2 length 20000
+##########################################
+set @b2 = 'b2';
+set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
+set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
+set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
+set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
+
+INSERT INTO t1 VALUES(1,@b1);
+INSERT INTO t1 VALUES(2,@b2);
+SELECT a,length(b),substr(b,1+2*900,2) FROM t1 WHERE a=1;
+SELECT a,length(b),substr(b,1+2*9000,2) FROM t1 WHERE a=2;
+UPDATE t1 SET b=@b2 WHERE a=1;
+UPDATE t1 SET b=@b1 WHERE a=2;
+SELECT a,length(b),substr(b,1+2*9000,2) FROM t1 WHERE a=1;
+SELECT a,length(b),substr(b,1+2*900,2) FROM t1 WHERE a=2;
+UPDATE t1 SET b=concat(b,b) WHERE a=1;
+UPDATE t1 SET b=concat(b,b) WHERE a=2;
+SELECT a,length(b),substr(b,1+4*9000,2) FROM t1 WHERE a=1;
+SELECT a,length(b),substr(b,1+4*900,2) FROM t1 WHERE a=2;
+DELETE FROM t1 WHERE a=1;
+DELETE FROM t1 WHERE a=2;
+SELECT COUNT(*) FROM t1;
+DROP TABLE t1;
+
+# bug#20612 INS-DEL bug (not pgman bug)
+# found via disk data assert but is not pgman or disk data related
+
+CREATE TABLE t1 (
+ a int NOT NULL,
+ b varchar(4000), -- must use 2 pages undo
+ PRIMARY KEY using hash (a)
+)
+TABLESPACE ts1 STORAGE DISK ENGINE=NDBCLUSTER;
+
+set autocommit = 0;
+insert into t1 values(0,'x');
+insert into t1 values(1,'x');
+insert into t1 values(2,'x');
+insert into t1 values(3,'x');
+insert into t1 values(4,'x');
+insert into t1 values(5,'x');
+insert into t1 values(6,'x');
+insert into t1 values(7,'x');
+insert into t1 values(8,'x');
+delete from t1 where a = 0;
+commit;
+
+delete from t1;
+begin;
+insert into t1 values (1, 'x');
+select * from t1;
+rollback;
+
+set autocommit = 1;
+
+
+drop table t1;
+#############################
+# Customer posted order by test case
+# Org in ndb_dd_advance.test
+#############################
+
+create table test.t1 (f1 varchar(50) primary key, f2 text,f3 int)
+TABLESPACE ts1 STORAGE DISK engine=NDB;
+insert into test.t1 (f1,f2,f3)VALUES("111111","aaaaaa",1);
+insert into test.t1 (f1,f2,f3)VALUES("222222","bbbbbb",2);
+select * from test.t1 order by f1;
+select f1,f2 from test.t1 order by f2;
+select f2 from test.t1 order by f2;
+select f1,f2 from test.t1 order by f1;
+drop table test.t1;
+
+###################
+# Test Cleanup
+###################
+
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile.dat'
+ENGINE = NDB;
+
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile02.dat'
+ENGINE = NDB;
+
+DROP TABLESPACE ts1
+ENGINE = NDB;
+
+DROP LOGFILE GROUP lg1
+ENGINE =NDB;
+
+#End 5.1 test case
diff --git a/mysql-test/suite/ndb/t/ndb_dd_ddl.test b/mysql-test/suite/ndb/t/ndb_dd_ddl.test
new file mode 100644
index 00000000000..d6de7c45326
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_dd_ddl.test
@@ -0,0 +1,370 @@
+#########################################
+# Author: JBM
+# Date: 2006-01-03
+# Purpose: Test the NDB engine reaction to duplicate
+# Table spaces and log groups. Also to test
+# Statement mixed case.
+############################################
+# Change Author:JBM
+# Change Date 2006-01-19
+# Change: Adding to test cases feedback from OB
+# 1) The 'duplicate' tests.
+# a) The test is using the default (test) database and is not
+# attempting to create databases (only logs, table spaces and
+# tables). Is this intentional?
+# b) What about a duplication of table name when one exists on disk and
+# you are trying to create it again in memory?
+#
+#2) 'CaSE SensiTiVE' tests
+# a) Suggest you include a test case where the case difference is in
+# the file name. I know this is not an issue for *nix systems but
+# will be when we expand to Windows and Mac. Better put it in now.
+############################################
+#
+# Jonas 2006-03-10
+# Add verification that ndb currently is limited to 1 logfile group
+#
+
+
+-- source include/have_ndb.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP DATABASE IF EXISTS mysqltest;
+CREATE DATABASE mysqltest;
+--enable_warnings
+
+############## Duplcate Statement Testing #########
+
+--echo **** Begin Duplicate Statement Testing ****
+
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+INITIAL_SIZE 1M
+UNDO_BUFFER_SIZE = 1M
+ENGINE=NDB;
+
+# Verify that one currently can create only 1 logfile group
+--error ER_CREATE_FILEGROUP_FAILED
+CREATE LOGFILE GROUP lg2
+ADD UNDOFILE 'undofile2.dat'
+INITIAL_SIZE 1M
+UNDO_BUFFER_SIZE 1M
+ENGINE NDB;
+SHOW WARNINGS;
+
+--error ER_CREATE_FILEGROUP_FAILED
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+INITIAL_SIZE 1M
+UNDO_BUFFER_SIZE = 1M
+ENGINE=NDB;
+
+ALTER LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile02.dat'
+INITIAL_SIZE 1M ENGINE NDB;
+
+--error ER_ALTER_FILEGROUP_FAILED
+ALTER LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile02.dat'
+INITIAL_SIZE 1M ENGINE=NDB;
+
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 1M
+ENGINE NDB;
+
+--error ER_CREATE_FILEGROUP_FAILED
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 1M
+ENGINE NDB;
+
+
+ALTER TABLESPACE ts1
+ADD DATAFILE 'datafile2.dat'
+INITIAL_SIZE 1M
+ENGINE=NDB;
+
+--error ER_ALTER_FILEGROUP_FAILED
+ALTER TABLESPACE ts1
+ADD DATAFILE 'datafile2.dat'
+INITIAL_SIZE 1M
+ENGINE=NDB;
+
+CREATE TABLE mysqltest.t1
+(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
+TABLESPACE ts1 STORAGE DISK
+ENGINE=NDB;
+
+--error ER_TABLE_EXISTS_ERROR
+CREATE TABLE mysqltest.t1
+(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
+TABLESPACE ts1 STORAGE DISK
+ENGINE=NDB;
+
+--error ER_TABLE_EXISTS_ERROR
+CREATE TABLE mysqltest.t1
+(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
+ENGINE=NDB;
+
+
+DROP TABLE mysqltest.t1;
+
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile2.dat'
+ENGINE=NDB;
+
+--error ER_ALTER_FILEGROUP_FAILED
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile2.dat'
+ENGINE=NDB;
+
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile.dat'
+ENGINE=NDB;
+
+--error ER_ALTER_FILEGROUP_FAILED
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile.dat'
+ENGINE=NDB;
+
+DROP TABLESPACE ts1
+ENGINE=NDB;
+
+--error ER_DROP_FILEGROUP_FAILED
+DROP TABLESPACE ts1
+ENGINE=NDB;
+
+DROP LOGFILE GROUP lg1
+ENGINE=NDB;
+
+--error ER_DROP_FILEGROUP_FAILED
+DROP LOGFILE GROUP lg1
+ENGINE=NDB;
+
+DROP DATABASE IF EXISTS mysqltest;
+
+--echo **** End Duplicate Statement Testing ****
+############# End Duplicate Statments ############
+--echo
+############ Begin CaSe Testing ##################
+--echo **** Begin Statment CaSe Testing ****
+
+creaTE LOgfilE GrOuP lg1
+adD undoFILE 'undofile.dat'
+initiAL_siZE 1M
+UnDo_BuFfEr_SiZe = 1M
+ENGInE=NDb;
+
+altER LOgFiLE GrOUp lg1
+AdD UnDOfILe 'uNdOfiLe02.daT'
+INItIAl_SIzE 1M ENgINE nDB;
+
+CrEAtE TABLEspaCE ts1
+ADD DATAfilE 'datafile.dat'
+UsE LoGFiLE GRoUP lg1
+INITiaL_SizE 1M
+ENGiNe NDb;
+
+AlTeR tAbLeSpAcE ts1
+AdD DaTaFiLe 'dAtAfiLe2.daT'
+InItIaL_SiZe 1M
+EnGiNe=NDB;
+
+CREATE TABLE t1
+(pk1 int not null primary key, b int not null, c int not null)
+TABLEspace ts1 storAGE dISk
+ENGine nDb;
+
+DROP TABLE t1;
+
+AlteR TAblespaCE ts1
+droP DATAfile 'dAtAfiLe2.daT'
+ENGINE=NDB;
+
+ALter tablesPACE ts1
+dROp dAtAfIlE 'datafile.dat'
+ENGine=Ndb;
+
+DrOp TaBleSpAcE ts1
+engINE=ndB;
+
+DrOp lOgFiLe GrOuP lg1
+EnGiNe=nDb;
+
+--echo **** End Statment CaSe Testing ****
+############ End CaSe Testing ##################
+--echo
+############ Begin = and no = Testing ##########
+--echo **** Begin = And No = Testing ****
+
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+INITIAL_SIZE=1M
+UNDO_BUFFER_SIZE=1M
+ENGINE=NDB;
+
+ALTER LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile02.dat'
+INITIAL_SIZE=1M
+ENGINE=NDB;
+
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE=1M
+ENGINE=NDB;
+
+ALTER TABLESPACE ts1
+ADD DATAFILE 'datafile2.dat'
+INITIAL_SIZE=1M
+ENGINE=NDB;
+
+CREATE TABLE t1
+(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
+TABLESPACE ts1 STORAGE DISK
+ENGINE=NDB;
+
+DROP TABLE t1;
+
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile2.dat'
+ENGINE=NDB;
+
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile.dat'
+ENGINE=NDB;
+
+DROP TABLESPACE ts1
+ENGINE=NDB;
+
+DROP LOGFILE GROUP lg1
+ENGINE=NDB;
+
+--echo
+--echo **** End of = ****
+--echo
+
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+INITIAL_SIZE 1M
+UNDO_BUFFER_SIZE 1M
+ENGINE NDB;
+
+ALTER LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile02.dat'
+INITIAL_SIZE 1M
+ENGINE NDB;
+
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 1M
+ENGINE NDB;
+
+ALTER TABLESPACE ts1
+ADD DATAFILE 'datafile2.dat'
+INITIAL_SIZE 1M
+ENGINE NDB;
+
+--error 1005
+CREATE TABLE t1
+(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
+TABLESPACE ts1 STORAGE MEMORY
+ENGINE NDB;
+
+CREATE TABLE t1
+(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
+TABLESPACE ts1 STORAGE DISK
+ENGINE NDB;
+
+
+CREATE INDEX b_i on t1(b);
+CREATE INDEX bc_i on t1(b, c);
+
+DROP TABLE t1;
+
+# bug#20053
+
+CREATE TABLESPACE ts2
+ADD DATAFILE 'datafile3.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 1M
+ENGINE NDB;
+
+--error ER_ALTER_FILEGROUP_FAILED
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile3.dat'
+ENGINE NDB;
+
+--error ER_ALTER_FILEGROUP_FAILED
+ALTER TABLESPACE ts2
+DROP DATAFILE 'datafile2.dat'
+ENGINE NDB;
+# bug#20053
+
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile2.dat'
+ENGINE NDB;
+
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile.dat'
+ENGINE NDB;
+
+DROP TABLESPACE ts1
+ENGINE NDB;
+
+ALTER TABLESPACE ts2
+DROP DATAFILE 'datafile3.dat'
+ENGINE NDB;
+
+DROP TABLESPACE ts2
+ENGINE NDB;
+
+DROP LOGFILE GROUP lg1
+ENGINE NDB;
+
+--echo **** End = And No = ****
+############ End = And No = ##################
+
+###
+#
+# bug#16341
+#create table t1 (a int primary key) engine = myisam;
+# 2007-08-22 Jeb
+# Removed the use of create table and manually
+# created the file to cause failure due to
+# inconsistant results on other OS
+# see #bug30559
+
+--exec touch $MYSQLTEST_VARDIR/tmp/t1.frm
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--error ER_CREATE_FILEGROUP_FAILED
+--eval create logfile group lg1 add undofile '$MYSQLTEST_VARDIR/tmp/t1.frm' initial_size 1M undo_buffer_size = 1M engine=ndb;
+
+create logfile group lg1
+add undofile 'undofile.dat'
+initial_size 1M
+undo_buffer_size = 1M
+engine=ndb;
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--error ER_CREATE_FILEGROUP_FAILED
+--eval create tablespace ts1 add datafile '$MYSQLTEST_VARDIR/tmp/t1.frm' use logfile group lg1 initial_size 1M engine ndb;
+
+--error ER_DROP_FILEGROUP_FAILED
+drop tablespace ts1
+engine ndb;
+
+drop logfile group lg1
+engine ndb;
+
+#drop table t1;
+--exec rm $MYSQLTEST_VARDIR/tmp/t1.frm
+
+
+# End 5.1 test
diff --git a/mysql-test/t/ndb_dd_disk2memory.test b/mysql-test/suite/ndb/t/ndb_dd_disk2memory.test
index 5975f44e087..5975f44e087 100644
--- a/mysql-test/t/ndb_dd_disk2memory.test
+++ b/mysql-test/suite/ndb/t/ndb_dd_disk2memory.test
diff --git a/mysql-test/suite/ndb/t/ndb_dd_dump.test b/mysql-test/suite/ndb/t/ndb_dd_dump.test
new file mode 100644
index 00000000000..7fc315ef167
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_dd_dump.test
@@ -0,0 +1,289 @@
+-- source include/have_ndb.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2, t3;
+--enable_warnings
+
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile_lg1_01.dat'
+INITIAL_SIZE 2M
+UNDO_BUFFER_SIZE = 1M
+ENGINE NDB;
+
+ALTER LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile_lg1_02.dat'
+INITIAL_SIZE = 4M
+ENGINE NDB;
+
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile_ts1_01.dat'
+USE LOGFILE GROUP lg1
+EXTENT_SIZE 1M
+INITIAL_SIZE 2M
+ENGINE NDB;
+
+ALTER TABLESPACE ts1
+ADD DATAFILE 'datafile_ts1_02.dat'
+INITIAL_SIZE = 1M
+ENGINE=NDB;
+
+CREATE TABLESPACE ts2
+ADD DATAFILE 'datafile_ts2_01.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 2M
+ENGINE NDB;
+
+CREATE TABLESPACE ts3
+ADD DATAFILE 'datafile_ts3_01.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 4M
+ENGINE NDB;
+
+########################################
+# Create a table using this tablespace
+########################################
+
+CREATE TABLE t1
+(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
+TABLESPACE ts1 STORAGE DISK
+ENGINE=NDB;
+
+CREATE TABLE t2
+(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
+TABLESPACE ts2 STORAGE DISK
+ENGINE=NDB;
+
+CREATE TABLE t3
+(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
+TABLESPACE ts3 STORAGE DISK
+ENGINE=NDB;
+
+INSERT INTO t1 VALUES
+(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
+(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10),
+(11,11,11),(12,12,12),(13,13,13),(14,14,14),(15,15,15),
+(16,16,16),(17,17,17),(18,18,18),(19,19,19),(20,20,20),
+(21,21,21),(22,22,22),(23,23,23),(24,24,24),(25,25,25),
+(26,26,26),(27,27,27),(28,28,28),(29,29,29),(30,30,30),
+(31,31,31),(32,32,32),(33,33,33),(34,34,34),(35,35,35),
+(36,36,36),(37,37,37),(38,38,38),(39,39,39),(40,40,40),
+(41,41,41),(42,42,42),(43,43,43),(44,44,44),(45,45,45),
+(46,46,46),(47,47,47),(48,48,48),(49,49,49),(50,50,50),
+(51,51,51),(52,52,52),(53,53,53),(54,54,54),(55,55,55),
+(56,56,56),(57,57,57),(58,58,58),(59,59,59),(60,60,60),
+(61,61,61),(62,62,62),(63,63,63),(64,64,64),(65,65,65),
+(66,66,66),(67,67,67),(68,68,68),(69,69,69),(70,70,70),
+(71,71,71),(72,72,72),(73,73,73),(74,74,74),(75,75,75),
+(76,76,76),(77,77,77),(78,78,78),(79,79,79),(80,80,80),
+(81,81,81),(82,82,82),(83,83,83),(84,84,84),(85,85,85),
+(86,86,86),(87,87,87),(88,88,88),(89,89,89),(90,90,90),
+(91,91,91),(92,92,92),(93,93,93),(94,94,94),(95,95,95),
+(96,96,96),(97,97,97),(98,98,98),(99,99,99),(100,100,100),
+(101,101,101),(102,102,102),(103,103,103),(104,104,104),(105,105,105),
+(106,106,106),(107,107,107),(108,108,108),(109,109,109),(110,110,110),
+(111,111,111),(112,112,112),(113,113,113),(114,114,114),(115,115,115),
+(116,116,116),(117,117,117),(118,118,118),(119,119,119),(120,120,120),
+(121,121,121),(122,122,122),(123,123,123),(124,124,124),(125,125,125),
+(126,126,126),(127,127,127),(128,128,128),(129,129,129),(130,130,130),
+(131,131,131),(132,132,132),(133,133,133),(134,134,134),(135,135,135),
+(136,136,136),(137,137,137),(138,138,138),(139,139,139),(140,140,140),
+(141,141,141),(142,142,142),(143,143,143),(144,144,144),(145,145,145),
+(146,146,146),(147,147,147),(148,148,148),(149,149,149),(150,150,150),
+(151,151,151),(152,152,152),(153,153,153),(154,154,154),(155,155,155),
+(156,156,156),(157,157,157),(158,158,158),(159,159,159),(160,160,160),
+(161,161,161),(162,162,162),(163,163,163),(164,164,164),(165,165,165),
+(166,166,166),(167,167,167),(168,168,168),(169,169,169),(170,170,170),
+(171,171,171),(172,172,172),(173,173,173),(174,174,174),(175,175,175),
+(176,176,176),(177,177,177),(178,178,178),(179,179,179),(180,180,180),
+(181,181,181),(182,182,182),(183,183,183),(184,184,184),(185,185,185),
+(186,186,186),(187,187,187),(188,188,188),(189,189,189),(190,190,190),
+(191,191,191),(192,192,192),(193,193,193),(194,194,194),(195,195,195),
+(196,196,196),(197,197,197),(198,198,198),(199,199,199),(200,200,200),
+(201,201,201),(202,202,202),(203,203,203),(204,204,204),(205,205,205),
+(206,206,206),(207,207,207),(208,208,208),(209,209,209),(210,210,210),
+(211,211,211),(212,212,212),(213,213,213),(214,214,214),(215,215,215),
+(216,216,216),(217,217,217),(218,218,218),(219,219,219),(220,220,220),
+(221,221,221),(222,222,222),(223,223,223),(224,224,224),(225,225,225),
+(226,226,226),(227,227,227),(228,228,228),(229,229,229),(230,230,230),
+(231,231,231),(232,232,232),(233,233,233),(234,234,234),(235,235,235),
+(236,236,236),(237,237,237),(238,238,238),(239,239,239),(240,240,240),
+(241,241,241),(242,242,242),(243,243,243),(244,244,244),(245,245,245),
+(246,246,246),(247,247,247),(248,248,248),(249,249,249),(250,250,250),
+(251,251,251),(252,252,252),(253,253,253),(254,254,254),(255,255,255),
+(256,256,256),(257,257,257),(258,258,258),(259,259,259),(260,260,260),
+(261,261,261),(262,262,262),(263,263,263),(264,264,264),(265,265,265),
+(266,266,266),(267,267,267),(268,268,268),(269,269,269),(270,270,270),
+(271,271,271),(272,272,272),(273,273,273),(274,274,274),(275,275,275),
+(276,276,276),(277,277,277),(278,278,278),(279,279,279),(280,280,280),
+(281,281,281),(282,282,282),(283,283,283),(284,284,284),(285,285,285),
+(286,286,286),(287,287,287),(288,288,288),(289,289,289),(290,290,290),
+(291,291,291),(292,292,292),(293,293,293),(294,294,294),(295,295,295),
+(296,296,296),(297,297,297),(298,298,298),(299,299,299),(300,300,300),
+(301,301,301),(302,302,302),(303,303,303),(304,304,304),(305,305,305),
+(306,306,306),(307,307,307),(308,308,308),(309,309,309),(310,310,310),
+(311,311,311),(312,312,312),(313,313,313),(314,314,314),(315,315,315),
+(316,316,316),(317,317,317),(318,318,318),(319,319,319),(320,320,320),
+(321,321,321),(322,322,322),(323,323,323),(324,324,324),(325,325,325),
+(326,326,326),(327,327,327),(328,328,328),(329,329,329),(330,330,330),
+(331,331,331),(332,332,332),(333,333,333),(334,334,334),(335,335,335),
+(336,336,336),(337,337,337),(338,338,338),(339,339,339),(340,340,340),
+(341,341,341),(342,342,342),(343,343,343),(344,344,344),(345,345,345),
+(346,346,346),(347,347,347),(348,348,348),(349,349,349),(350,350,350),
+(351,351,351),(352,352,352),(353,353,353),(354,354,354),(355,355,355),
+(356,356,356),(357,357,357),(358,358,358),(359,359,359),(360,360,360),
+(361,361,361),(362,362,362),(363,363,363),(364,364,364),(365,365,365),
+(366,366,366),(367,367,367),(368,368,368),(369,369,369),(370,370,370),
+(371,371,371),(372,372,372),(373,373,373),(374,374,374),(375,375,375),
+(376,376,376),(377,377,377),(378,378,378),(379,379,379),(380,380,380),
+(381,381,381),(382,382,382),(383,383,383),(384,384,384),(385,385,385),
+(386,386,386),(387,387,387),(388,388,388),(389,389,389),(390,390,390),
+(391,391,391),(392,392,392),(393,393,393),(394,394,394),(395,395,395),
+(396,396,396),(397,397,397),(398,398,398),(399,399,399),(400,400,400),
+(401,401,401),(402,402,402),(403,403,403),(404,404,404),(405,405,405),
+(406,406,406),(407,407,407),(408,408,408),(409,409,409),(410,410,410),
+(411,411,411),(412,412,412),(413,413,413),(414,414,414),(415,415,415),
+(416,416,416),(417,417,417),(418,418,418),(419,419,419),(420,420,420),
+(421,421,421),(422,422,422),(423,423,423),(424,424,424),(425,425,425),
+(426,426,426),(427,427,427),(428,428,428),(429,429,429),(430,430,430),
+(431,431,431),(432,432,432),(433,433,433),(434,434,434),(435,435,435),
+(436,436,436),(437,437,437),(438,438,438),(439,439,439),(440,440,440),
+(441,441,441),(442,442,442),(443,443,443),(444,444,444),(445,445,445),
+(446,446,446),(447,447,447),(448,448,448),(449,449,449),(450,450,450),
+(451,451,451),(452,452,452),(453,453,453),(454,454,454),(455,455,455),
+(456,456,456),(457,457,457),(458,458,458),(459,459,459),(460,460,460),
+(461,461,461),(462,462,462),(463,463,463),(464,464,464),(465,465,465),
+(466,466,466),(467,467,467),(468,468,468),(469,469,469),(470,470,470),
+(471,471,471),(472,472,472),(473,473,473),(474,474,474),(475,475,475),
+(476,476,476),(477,477,477),(478,478,478),(479,479,479),(480,480,480),
+(481,481,481),(482,482,482),(483,483,483),(484,484,484),(485,485,485),
+(486,486,486),(487,487,487),(488,488,488),(489,489,489),(490,490,490),
+(491,491,491),(492,492,492),(493,493,493),(494,494,494),(495,495,495),
+(496,496,496),(497,497,497),(498,498,498),(499,499,499),(500, 500, 500);
+
+INSERT INTO t2 VALUES
+(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5);
+
+INSERT INTO t3 VALUES
+(1,1,1);
+
+--exec $MYSQL_DUMP --skip-comments --compact -Y test > $MYSQLTEST_VARDIR/tmp/ndb_dd_dump.sql
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile_ts1_01.dat'
+ENGINE = NDB;
+
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile_ts1_02.dat'
+ENGINE = NDB;
+
+ALTER TABLESPACE ts2
+DROP DATAFILE 'datafile_ts2_01.dat'
+ENGINE = NDB;
+
+ALTER TABLESPACE ts3
+DROP DATAFILE 'datafile_ts3_01.dat'
+ENGINE = NDB;
+
+DROP TABLESPACE ts1 ENGINE = NDB;
+DROP TABLESPACE ts2 ENGINE = NDB;
+DROP TABLESPACE ts3 ENGINE = NDB;
+
+DROP LOGFILE GROUP lg1 ENGINE = NDB;
+
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ndb_dd_dump.sql
+
+SELECT DISTINCT
+ LOGFILE_GROUP_NAME,
+ FILE_NAME,
+ TOTAL_EXTENTS,
+ INITIAL_SIZE,
+ ENGINE
+FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE="UNDO LOG" ORDER BY FILE_NAME;
+
+SELECT DISTINCT
+ TABLESPACE_NAME,
+ LOGFILE_GROUP_NAME,
+ FILE_NAME,
+ EXTENT_SIZE,
+ INITIAL_SIZE,
+ ENGINE
+FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE="DATAFILE" ORDER BY FILE_NAME;
+
+SELECT COUNT(*) FROM t1;
+SELECT COUNT(*) FROM t2;
+SELECT COUNT(*) FROM t3;
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+
+#### BUG 18856 test case comented out
+##### Use "SELECT * INTO OUTFILE" to dump data and "LOAD DATA INFILE" to load ##### data back to the data file.
+
+CREATE TABLE test.t (
+ a smallint NOT NULL,
+ b int NOT NULL,
+ c bigint NOT NULL,
+ d char(10),
+ e TEXT,
+ f VARCHAR(255),
+ PRIMARY KEY(a)
+) TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
+
+ ALTER TABLE test.t ADD INDEX (d), ADD INDEX (f);
+ SHOW CREATE TABLE test.t;
+
+# insert records into tables
+
+ let $1=100;
+ disable_query_log;
+ while ($1)
+ {
+ eval insert into test.t values($1, $1+1, $1+2, "aaa$1", "bbb$1", "ccccc$1");
+ dec $1;
+ }
+ enable_query_log;
+
+ SELECT * FROM test.t order by a;
+
+ SELECT * INTO OUTFILE 't_backup' FROM test.t;
+ TRUNCATE test.t;
+
+#'TRUNCATE test.t' failed: 1205: Lock wait timeout exceeded; try restarting
+#transaction. TABLESPACE ts STORAGE DISK ENGINE=NDB;
+
+ SELECT count(*) FROM test.t;
+ LOAD DATA INFILE 't_backup' INTO TABLE test.t;
+
+ SELECT * FROM test.t order by a;
+
+ DROP TABLE test.t;
+
+
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile_ts1_01.dat'
+ENGINE = NDB;
+
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile_ts1_02.dat'
+ENGINE = NDB;
+
+ALTER TABLESPACE ts2
+DROP DATAFILE 'datafile_ts2_01.dat'
+ENGINE = NDB;
+
+ALTER TABLESPACE ts3
+DROP DATAFILE 'datafile_ts3_01.dat'
+ENGINE = NDB;
+
+DROP TABLESPACE ts1 ENGINE = NDB;
+DROP TABLESPACE ts2 ENGINE = NDB;
+DROP TABLESPACE ts3 ENGINE = NDB;
+
+DROP LOGFILE GROUP lg1 ENGINE = NDB;
+
+#End 5.1 test case
diff --git a/mysql-test/t/ndb_dd_sql_features.test b/mysql-test/suite/ndb/t/ndb_dd_sql_features.test
index f46cb217ab4..f46cb217ab4 100644
--- a/mysql-test/t/ndb_dd_sql_features.test
+++ b/mysql-test/suite/ndb/t/ndb_dd_sql_features.test
diff --git a/mysql-test/t/ndb_gis.test b/mysql-test/suite/ndb/t/ndb_gis.test
index e14f462c32d..e14f462c32d 100644
--- a/mysql-test/t/ndb_gis.test
+++ b/mysql-test/suite/ndb/t/ndb_gis.test
diff --git a/mysql-test/t/ndb_grant.later b/mysql-test/suite/ndb/t/ndb_grant.later
index 5431d94e1f8..5431d94e1f8 100644
--- a/mysql-test/t/ndb_grant.later
+++ b/mysql-test/suite/ndb/t/ndb_grant.later
diff --git a/mysql-test/t/ndb_index.test b/mysql-test/suite/ndb/t/ndb_index.test
index 272f30e3e6f..272f30e3e6f 100644
--- a/mysql-test/t/ndb_index.test
+++ b/mysql-test/suite/ndb/t/ndb_index.test
diff --git a/mysql-test/t/ndb_index_ordered.test b/mysql-test/suite/ndb/t/ndb_index_ordered.test
index 782f17ca5b2..782f17ca5b2 100644
--- a/mysql-test/t/ndb_index_ordered.test
+++ b/mysql-test/suite/ndb/t/ndb_index_ordered.test
diff --git a/mysql-test/suite/ndb/t/ndb_index_unique.test b/mysql-test/suite/ndb/t/ndb_index_unique.test
new file mode 100644
index 00000000000..78757c3bcf7
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_index_unique.test
@@ -0,0 +1,361 @@
+-- source include/have_ndb.inc
+-- source include/not_embedded.inc
+
+--disable_warnings
+drop table if exists t1, t2, t3, t4, t5, t6, t7, t8;
+--enable_warnings
+
+#
+# Simple test to show use of UNIQUE indexes
+#
+
+CREATE TABLE t1 (
+ a int NOT NULL PRIMARY KEY,
+ b int not null,
+ c int,
+ UNIQUE ib(b)
+) engine=ndbcluster;
+
+insert t1 values(1, 2, 3), (2, 3, 5), (3, 4, 6), (4, 5, 8), (5,6, 2), (6,7, 2);
+select * from t1 order by b;
+select * from t1 where b = 4 order by b;
+insert into t1 values(7,8,3);
+select * from t1 where b = 4 order by a;
+
+-- error ER_DUP_ENTRY
+insert into t1 values(8, 2, 3);
+select * from t1 order by a;
+delete from t1 where a = 1;
+insert into t1 values(8, 2, 3);
+select * from t1 order by a;
+
+alter table t1 drop index ib;
+insert into t1 values(1, 2, 3);
+# Bug# #18129
+--error 1169
+create unique index ib on t1(b);
+
+drop table t1;
+
+#
+# Indexing NULL values
+#
+
+CREATE TABLE t1 (
+ a int unsigned NOT NULL PRIMARY KEY,
+ b int unsigned,
+ c int unsigned,
+ UNIQUE bc(b,c)
+) engine = ndb;
+
+insert into t1 values(1,1,1),(2,NULL,2),(3,NULL,NULL),(4,4,NULL);
+select * from t1 use index (bc) where b IS NULL order by a;
+
+select * from t1 use index (bc)order by a;
+select * from t1 use index (bc) order by a;
+select * from t1 use index (PRIMARY) where b IS NULL order by a;
+select * from t1 use index (bc) where b IS NULL order by a;
+select * from t1 use index (bc) where b IS NULL and c IS NULL order by a;
+select * from t1 use index (bc) where b IS NULL and c = 2 order by a;
+select * from t1 use index (bc) where b < 4 order by a;
+select * from t1 use index (bc) where b IS NOT NULL order by a;
+-- error ER_DUP_ENTRY
+insert into t1 values(5,1,1);
+drop table t1;
+
+
+#
+# Show use of UNIQUE USING HASH indexes
+#
+
+CREATE TABLE t2 (
+ a int unsigned NOT NULL PRIMARY KEY,
+ b int unsigned not null,
+ c int unsigned not null,
+ UNIQUE (b, c) USING HASH
+) engine=ndbcluster;
+
+insert t2 values(1, 2, 3), (2, 3, 5), (3, 4, 6), (4, 5, 8), (5,6, 2), (6,7, 2);
+select * from t2 where a = 3;
+select * from t2 where b = 4;
+select * from t2 where c = 6;
+insert into t2 values(7,8,3);
+select * from t2 where b = 4 order by a;
+
+-- error ER_DUP_ENTRY
+insert into t2 values(8, 2, 3);
+select * from t2 order by a;
+delete from t2 where a = 1;
+insert into t2 values(8, 2, 3);
+select * from t2 order by a;
+
+# Bug #24818 CREATE UNIQUE INDEX (...) USING HASH on a NDB table crashes mysqld
+create unique index bi using hash on t2(b);
+-- error ER_DUP_ENTRY
+insert into t2 values(9, 3, 1);
+alter table t2 drop index bi;
+insert into t2 values(9, 3, 1);
+select * from t2 order by a;
+
+drop table t2;
+
+CREATE TABLE t2 (
+ a int unsigned NOT NULL PRIMARY KEY,
+ b int unsigned not null,
+ c int unsigned,
+ UNIQUE (b, c) USING HASH
+) engine=ndbcluster;
+
+
+insert t2 values(1,1,NULL),(2,2,2),(3,3,NULL),(4,4,4),(5,5,NULL),(6,6,6),(7,7,NULL),(8,3,NULL),(9,3,NULL);
+
+select * from t2 where c IS NULL order by a;
+select * from t2 where b = 3 AND c IS NULL order by a;
+select * from t2 where (b = 3 OR b = 5) AND c IS NULL order by a;
+set @old_ecpd = @@session.engine_condition_pushdown;
+set engine_condition_pushdown = true;
+explain select * from t2 where (b = 3 OR b = 5) AND c IS NULL AND a < 9 order by a;
+select * from t2 where (b = 3 OR b = 5) AND c IS NULL AND a < 9 order by a;
+set engine_condition_pushdown = @old_ecpd;
+
+drop table t2;
+
+#
+# Show use of PRIMARY KEY USING HASH indexes
+#
+
+CREATE TABLE t3 (
+ a int unsigned NOT NULL,
+ b int unsigned not null,
+ c int unsigned,
+ PRIMARY KEY (a, b) USING HASH
+) engine=ndbcluster;
+
+insert t3 values(1, 2, 3), (2, 3, 5), (3, 4, 6), (4, 5, 8), (5,6, 2), (6,7, 2);
+select * from t3 where a = 3;
+select * from t3 where b = 4;
+select * from t3 where c = 6;
+insert into t3 values(7,8,3);
+select * from t3 where b = 4 order by a;
+
+drop table t3;
+
+#
+# Indexes on NULL-able columns
+#
+
+CREATE TABLE t1 (
+ pk int NOT NULL PRIMARY KEY,
+ a int unsigned,
+ UNIQUE KEY (a)
+) engine=ndbcluster;
+
+insert into t1 values (-1,NULL), (0,0), (1,NULL),(2,2),(3,NULL),(4,4);
+
+select * from t1 order by pk;
+
+--error ER_DUP_ENTRY
+insert into t1 values (5,0);
+select * from t1 order by pk;
+delete from t1 where a = 0;
+insert into t1 values (5,0);
+select * from t1 order by pk;
+
+CREATE TABLE t2 (
+ pk int NOT NULL PRIMARY KEY,
+ a int unsigned,
+ b tinyint NOT NULL,
+ c VARCHAR(10),
+ UNIQUE KEY si(a, c)
+) engine=ndbcluster;
+
+insert into t2 values (-1,1,17,NULL),(0,NULL,18,NULL),(1,3,19,'abc');
+
+select * from t2 order by pk;
+
+--error ER_DUP_ENTRY
+insert into t2 values(2,3,19,'abc');
+select * from t2 order by pk;
+delete from t2 where c IS NOT NULL;
+insert into t2 values(2,3,19,'abc');
+select * from t2 order by pk;
+
+drop table t1, t2;
+
+#
+# More complex tables
+#
+
+CREATE TABLE t1 (
+ cid smallint(5) unsigned NOT NULL default '0',
+ cv varchar(250) NOT NULL default '',
+ PRIMARY KEY (cid),
+ UNIQUE KEY cv (cv)
+) engine=ndbcluster;
+INSERT INTO t1 VALUES (8,'dummy');
+CREATE TABLE t2 (
+ cid bigint(20) unsigned NOT NULL auto_increment,
+ cap varchar(255) NOT NULL default '',
+ PRIMARY KEY (cid),
+ UNIQUE KEY (cid, cap)
+) engine=ndbcluster;
+INSERT INTO t2 VALUES (NULL,'another dummy');
+CREATE TABLE t3 (
+ gid bigint(20) unsigned NOT NULL auto_increment,
+ gn varchar(255) NOT NULL default '',
+ must tinyint(4) default NULL,
+ PRIMARY KEY (gid)
+) engine=ndbcluster;
+INSERT INTO t3 VALUES (1,'V1',NULL);
+CREATE TABLE t4 (
+ uid bigint(20) unsigned NOT NULL default '0',
+ gid bigint(20) unsigned NOT NULL,
+ rid bigint(20) unsigned NOT NULL,
+ cid bigint(20) unsigned NOT NULL,
+ UNIQUE KEY m (uid,gid,rid,cid)
+) engine=ndbcluster;
+INSERT INTO t4 VALUES (1,1,2,4);
+INSERT INTO t4 VALUES (1,1,2,3);
+INSERT INTO t4 VALUES (1,1,5,7);
+INSERT INTO t4 VALUES (1,1,10,8);
+CREATE TABLE t5 (
+ rid bigint(20) unsigned NOT NULL auto_increment,
+ rl varchar(255) NOT NULL default '',
+ PRIMARY KEY (rid)
+) engine=ndbcluster;
+CREATE TABLE t6 (
+ uid bigint(20) unsigned NOT NULL auto_increment,
+ un varchar(250) NOT NULL default '',
+ uc smallint(5) unsigned NOT NULL default '0',
+ PRIMARY KEY (uid),
+ UNIQUE KEY nc (un,uc)
+) engine=ndbcluster;
+INSERT INTO t6 VALUES (1,'test',8);
+INSERT INTO t6 VALUES (2,'test2',9);
+INSERT INTO t6 VALUES (3,'tre',3);
+CREATE TABLE t7 (
+ mid bigint(20) unsigned NOT NULL PRIMARY KEY,
+ uid bigint(20) unsigned NOT NULL default '0',
+ gid bigint(20) unsigned NOT NULL,
+ rid bigint(20) unsigned NOT NULL,
+ cid bigint(20) unsigned NOT NULL,
+ UNIQUE KEY m (uid,gid,rid,cid)
+) engine=ndbcluster;
+INSERT INTO t7 VALUES(1, 1, 1, 1, 1);
+INSERT INTO t7 VALUES(2, 2, 1, 1, 1);
+INSERT INTO t7 VALUES(3, 3, 1, 1, 1);
+INSERT INTO t7 VALUES(4, 4, 1, 1, 1);
+INSERT INTO t7 VALUES(5, 5, 1, 1, 1);
+INSERT INTO t7 VALUES(6, 1, 1, 1, 6);
+INSERT INTO t7 VALUES(7, 2, 1, 1, 7);
+INSERT INTO t7 VALUES(8, 3, 1, 1, 8);
+INSERT INTO t7 VALUES(9, 4, 1, 1, 9);
+INSERT INTO t7 VALUES(10, 5, 1, 1, 10);
+
+select * from t1 where cv = 'dummy';
+select * from t1 where cv = 'test';
+select * from t2 where cap = 'another dummy';
+select * from t4 where uid = 1 and gid=1 and rid=2 and cid=4;
+select * from t4 where uid = 1 and gid=1 and rid=1 and cid=4;
+select * from t4 where uid = 1 order by cid;
+select * from t4 where rid = 2 order by cid;
+select * from t6 where un='test' and uc=8;
+select * from t6 where un='test' and uc=7;
+select * from t6 where un='test';
+select * from t7 where mid = 8;
+select * from t7 where uid = 8;
+select * from t7 where uid = 1 order by mid;
+select * from t7 where uid = 4 order by mid;
+select * from t7 where gid = 4;
+select * from t7 where gid = 1 order by mid;
+select * from t7 where cid = 4;
+select * from t7 where cid = 8;
+
+#
+# insert more records into t4
+#
+let $1=100;
+disable_query_log;
+while ($1)
+{
+ eval insert into t4 values(1, $1, 5, 12);
+ eval insert into t4 values($1, 3, 9, 11);
+ dec $1;
+}
+enable_query_log;
+
+select * from t4 where uid = 1 and gid=1 and rid=2 and cid=4;
+select * from t4 where uid = 1 and gid=1 and rid=1 and cid=4;
+select * from t4 where uid = 1 order by gid,cid;
+select * from t4 where uid = 1 order by gid,cid;
+select * from t4 where rid = 2 order by cid;
+
+
+drop table t1,t2,t3,t4,t5,t6,t7;
+
+# test null in indexes
+CREATE TABLE t1 (
+ a int unsigned NOT NULL PRIMARY KEY,
+ b int unsigned,
+ c int unsigned,
+ UNIQUE bc(b,c) ) engine = ndb;
+
+insert into t1 values(1,1,1),(2,NULL,2),(3,NULL,NULL),(4,4,NULL);
+select * from t1 where b=1 and c=1;
+select * from t1 where b is null and c is null;
+select * from t1 where b is null and c = 2;
+select * from t1 where b = 4 and c is null;
+create table t8 as
+select * from t1 where (b = 1 and c = 1)
+ or (b is null and c is null)
+ or (b is null and c = 2)
+ or (b = 4 and c is null);
+select * from t8 order by a;
+select * from t1 order by a;
+drop table t1, t8;
+
+###############################
+# Bug 8101
+#
+# Unique index not specified in the same order as in table
+#
+
+create table t1(
+ id integer not null auto_increment,
+ month integer not null,
+ year integer not null,
+ code varchar( 2) not null,
+ primary key ( id),
+ unique idx_t1( month, code, year)
+) engine=ndb;
+
+INSERT INTO t1 (month, year, code) VALUES (4,2004,'12');
+INSERT INTO t1 (month, year, code) VALUES (5,2004,'12');
+
+select * from t1 where code = '12' and month = 4 and year = 2004 ;
+
+drop table t1;
+
+# bug#15918 Unique Key Limit in NDB Engine
+
+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));
+--error ER_DUP_ENTRY
+insert into t1 values (2, repeat(_utf8 0xe288ab6474, 200));
+select a, sha1(b) from t1;
+
+# perl -e 'print pack("H2000","e288ab6474"x200)' | sha1sum
+
+drop table t1;
+
+# bug#21873 MySQLD Crash on ALTER...ADD..UNIQUE..USING HASH statement for NDB backed table
+
+create table t1(id int not null) engine = NDB;
+
+alter table t1 add constraint uk_test unique (id) using hash;
+
+drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/suite/ndb/t/ndb_insert.test b/mysql-test/suite/ndb/t/ndb_insert.test
new file mode 100644
index 00000000000..5b74cc9202c
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_insert.test
@@ -0,0 +1,779 @@
+-- source include/have_ndb.inc
+-- source include/not_embedded.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+#
+# Basic test of INSERT in NDB
+#
+
+#
+# Create a normal table with primary key
+#
+CREATE TABLE t1 (
+ pk1 INT NOT NULL PRIMARY KEY,
+ b INT NOT NULL,
+ c INT NOT NULL
+) ENGINE=ndbcluster;
+
+INSERT INTO t1 VALUES (0, 0, 0);
+SELECT * FROM t1;
+
+INSERT INTO t1 VALUES
+(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
+(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10),
+(11,11,11),(12,12,12),(13,13,13),(14,14,14),(15,15,15),
+(16,16,16),(17,17,17),(18,18,18),(19,19,19),(20,20,20),
+(21,21,21),(22,22,22),(23,23,23),(24,24,24),(25,25,25),
+(26,26,26),(27,27,27),(28,28,28),(29,29,29),(30,30,30),
+(31,31,31),(32,32,32),(33,33,33),(34,34,34),(35,35,35),
+(36,36,36),(37,37,37),(38,38,38),(39,39,39),(40,40,40),
+(41,41,41),(42,42,42),(43,43,43),(44,44,44),(45,45,45),
+(46,46,46),(47,47,47),(48,48,48),(49,49,49),(50,50,50),
+(51,51,51),(52,52,52),(53,53,53),(54,54,54),(55,55,55),
+(56,56,56),(57,57,57),(58,58,58),(59,59,59),(60,60,60),
+(61,61,61),(62,62,62),(63,63,63),(64,64,64),(65,65,65),
+(66,66,66),(67,67,67),(68,68,68),(69,69,69),(70,70,70),
+(71,71,71),(72,72,72),(73,73,73),(74,74,74),(75,75,75),
+(76,76,76),(77,77,77),(78,78,78),(79,79,79),(80,80,80),
+(81,81,81),(82,82,82),(83,83,83),(84,84,84),(85,85,85),
+(86,86,86),(87,87,87),(88,88,88),(89,89,89),(90,90,90),
+(91,91,91),(92,92,92),(93,93,93),(94,94,94),(95,95,95),
+(96,96,96),(97,97,97),(98,98,98),(99,99,99),(100,100,100),
+(101,101,101),(102,102,102),(103,103,103),(104,104,104),(105,105,105),
+(106,106,106),(107,107,107),(108,108,108),(109,109,109),(110,110,110),
+(111,111,111),(112,112,112),(113,113,113),(114,114,114),(115,115,115),
+(116,116,116),(117,117,117),(118,118,118),(119,119,119),(120,120,120),
+(121,121,121),(122,122,122),(123,123,123),(124,124,124),(125,125,125),
+(126,126,126),(127,127,127),(128,128,128),(129,129,129),(130,130,130),
+(131,131,131),(132,132,132),(133,133,133),(134,134,134),(135,135,135),
+(136,136,136),(137,137,137),(138,138,138),(139,139,139),(140,140,140),
+(141,141,141),(142,142,142),(143,143,143),(144,144,144),(145,145,145),
+(146,146,146),(147,147,147),(148,148,148),(149,149,149),(150,150,150),
+(151,151,151),(152,152,152),(153,153,153),(154,154,154),(155,155,155),
+(156,156,156),(157,157,157),(158,158,158),(159,159,159),(160,160,160),
+(161,161,161),(162,162,162),(163,163,163),(164,164,164),(165,165,165),
+(166,166,166),(167,167,167),(168,168,168),(169,169,169),(170,170,170),
+(171,171,171),(172,172,172),(173,173,173),(174,174,174),(175,175,175),
+(176,176,176),(177,177,177),(178,178,178),(179,179,179),(180,180,180),
+(181,181,181),(182,182,182),(183,183,183),(184,184,184),(185,185,185),
+(186,186,186),(187,187,187),(188,188,188),(189,189,189),(190,190,190),
+(191,191,191),(192,192,192),(193,193,193),(194,194,194),(195,195,195),
+(196,196,196),(197,197,197),(198,198,198),(199,199,199),(200,200,200),
+(201,201,201),(202,202,202),(203,203,203),(204,204,204),(205,205,205),
+(206,206,206),(207,207,207),(208,208,208),(209,209,209),(210,210,210),
+(211,211,211),(212,212,212),(213,213,213),(214,214,214),(215,215,215),
+(216,216,216),(217,217,217),(218,218,218),(219,219,219),(220,220,220),
+(221,221,221),(222,222,222),(223,223,223),(224,224,224),(225,225,225),
+(226,226,226),(227,227,227),(228,228,228),(229,229,229),(230,230,230),
+(231,231,231),(232,232,232),(233,233,233),(234,234,234),(235,235,235),
+(236,236,236),(237,237,237),(238,238,238),(239,239,239),(240,240,240),
+(241,241,241),(242,242,242),(243,243,243),(244,244,244),(245,245,245),
+(246,246,246),(247,247,247),(248,248,248),(249,249,249),(250,250,250),
+(251,251,251),(252,252,252),(253,253,253),(254,254,254),(255,255,255),
+(256,256,256),(257,257,257),(258,258,258),(259,259,259),(260,260,260),
+(261,261,261),(262,262,262),(263,263,263),(264,264,264),(265,265,265),
+(266,266,266),(267,267,267),(268,268,268),(269,269,269),(270,270,270),
+(271,271,271),(272,272,272),(273,273,273),(274,274,274),(275,275,275),
+(276,276,276),(277,277,277),(278,278,278),(279,279,279),(280,280,280),
+(281,281,281),(282,282,282),(283,283,283),(284,284,284),(285,285,285),
+(286,286,286),(287,287,287),(288,288,288),(289,289,289),(290,290,290),
+(291,291,291),(292,292,292),(293,293,293),(294,294,294),(295,295,295),
+(296,296,296),(297,297,297),(298,298,298),(299,299,299),(300,300,300),
+(301,301,301),(302,302,302),(303,303,303),(304,304,304),(305,305,305),
+(306,306,306),(307,307,307),(308,308,308),(309,309,309),(310,310,310),
+(311,311,311),(312,312,312),(313,313,313),(314,314,314),(315,315,315),
+(316,316,316),(317,317,317),(318,318,318),(319,319,319),(320,320,320),
+(321,321,321),(322,322,322),(323,323,323),(324,324,324),(325,325,325),
+(326,326,326),(327,327,327),(328,328,328),(329,329,329),(330,330,330),
+(331,331,331),(332,332,332),(333,333,333),(334,334,334),(335,335,335),
+(336,336,336),(337,337,337),(338,338,338),(339,339,339),(340,340,340),
+(341,341,341),(342,342,342),(343,343,343),(344,344,344),(345,345,345),
+(346,346,346),(347,347,347),(348,348,348),(349,349,349),(350,350,350),
+(351,351,351),(352,352,352),(353,353,353),(354,354,354),(355,355,355),
+(356,356,356),(357,357,357),(358,358,358),(359,359,359),(360,360,360),
+(361,361,361),(362,362,362),(363,363,363),(364,364,364),(365,365,365),
+(366,366,366),(367,367,367),(368,368,368),(369,369,369),(370,370,370),
+(371,371,371),(372,372,372),(373,373,373),(374,374,374),(375,375,375),
+(376,376,376),(377,377,377),(378,378,378),(379,379,379),(380,380,380),
+(381,381,381),(382,382,382),(383,383,383),(384,384,384),(385,385,385),
+(386,386,386),(387,387,387),(388,388,388),(389,389,389),(390,390,390),
+(391,391,391),(392,392,392),(393,393,393),(394,394,394),(395,395,395),
+(396,396,396),(397,397,397),(398,398,398),(399,399,399),(400,400,400),
+(401,401,401),(402,402,402),(403,403,403),(404,404,404),(405,405,405),
+(406,406,406),(407,407,407),(408,408,408),(409,409,409),(410,410,410),
+(411,411,411),(412,412,412),(413,413,413),(414,414,414),(415,415,415),
+(416,416,416),(417,417,417),(418,418,418),(419,419,419),(420,420,420),
+(421,421,421),(422,422,422),(423,423,423),(424,424,424),(425,425,425),
+(426,426,426),(427,427,427),(428,428,428),(429,429,429),(430,430,430),
+(431,431,431),(432,432,432),(433,433,433),(434,434,434),(435,435,435),
+(436,436,436),(437,437,437),(438,438,438),(439,439,439),(440,440,440),
+(441,441,441),(442,442,442),(443,443,443),(444,444,444),(445,445,445),
+(446,446,446),(447,447,447),(448,448,448),(449,449,449),(450,450,450),
+(451,451,451),(452,452,452),(453,453,453),(454,454,454),(455,455,455),
+(456,456,456),(457,457,457),(458,458,458),(459,459,459),(460,460,460),
+(461,461,461),(462,462,462),(463,463,463),(464,464,464),(465,465,465),
+(466,466,466),(467,467,467),(468,468,468),(469,469,469),(470,470,470),
+(471,471,471),(472,472,472),(473,473,473),(474,474,474),(475,475,475),
+(476,476,476),(477,477,477),(478,478,478),(479,479,479),(480,480,480),
+(481,481,481),(482,482,482),(483,483,483),(484,484,484),(485,485,485),
+(486,486,486),(487,487,487),(488,488,488),(489,489,489),(490,490,490),
+(491,491,491),(492,492,492),(493,493,493),(494,494,494),(495,495,495),
+(496,496,496),(497,497,497),(498,498,498),(499,499,499),(500, 500, 500);
+
+SELECT COUNT(*) FROM t1;
+
+INSERT INTO t1 VALUES
+(501,501,501),(502,502,502),(503,503,503),(504,504,504),(505,505,505),
+(506,506,506),(507,507,507),(508,508,508),(509,509,509),(510,510,510),
+(511,511,511),(512,512,512),(513,513,513),(514,514,514),(515,515,515),
+(516,516,516),(517,517,517),(518,518,518),(519,519,519),(520,520,520),
+(521,521,521),(522,522,522),(523,523,523),(524,524,524),(525,525,525),
+(526,526,526),(527,527,527),(528,528,528),(529,529,529),(530,530,530),
+(531,531,531),(532,532,532),(533,533,533),(534,534,534),(535,535,535),
+(536,536,536),(537,537,537),(538,538,538),(539,539,539),(540,540,540),
+(541,541,541),(542,542,542),(543,543,543),(544,544,544),(545,545,545),
+(546,546,546),(547,547,547),(548,548,548),(549,549,549),(550,550,550),
+(551,551,551),(552,552,552),(553,553,553),(554,554,554),(555,555,555),
+(556,556,556),(557,557,557),(558,558,558),(559,559,559),(560,560,560),
+(561,561,561),(562,562,562),(563,563,563),(564,564,564),(565,565,565),
+(566,566,566),(567,567,567),(568,568,568),(569,569,569),(570,570,570),
+(571,571,571),(572,572,572),(573,573,573),(574,574,574),(575,575,575),
+(576,576,576),(577,577,577),(578,578,578),(579,579,579),(580,580,580),
+(581,581,581),(582,582,582),(583,583,583),(584,584,584),(585,585,585),
+(586,586,586),(587,587,587),(588,588,588),(589,589,589),(590,590,590),
+(591,591,591),(592,592,592),(593,593,593),(594,594,594),(595,595,595),
+(596,596,596),(597,597,597),(598,598,598),(599,599,599),(600,600,600),
+(601,601,601),(602,602,602),(603,603,603),(604,604,604),(605,605,605),
+(606,606,606),(607,607,607),(608,608,608),(609,609,609),(610,610,610),
+(611,611,611),(612,612,612),(613,613,613),(614,614,614),(615,615,615),
+(616,616,616),(617,617,617),(618,618,618),(619,619,619),(620,620,620),
+(621,621,621),(622,622,622),(623,623,623),(624,624,624),(625,625,625),
+(626,626,626),(627,627,627),(628,628,628),(629,629,629),(630,630,630),
+(631,631,631),(632,632,632),(633,633,633),(634,634,634),(635,635,635),
+(636,636,636),(637,637,637),(638,638,638),(639,639,639),(640,640,640),
+(641,641,641),(642,642,642),(643,643,643),(644,644,644),(645,645,645),
+(646,646,646),(647,647,647),(648,648,648),(649,649,649),(650,650,650),
+(651,651,651),(652,652,652),(653,653,653),(654,654,654),(655,655,655),
+(656,656,656),(657,657,657),(658,658,658),(659,659,659),(660,660,660),
+(661,661,661),(662,662,662),(663,663,663),(664,664,664),(665,665,665),
+(666,666,666),(667,667,667),(668,668,668),(669,669,669),(670,670,670),
+(671,671,671),(672,672,672),(673,673,673),(674,674,674),(675,675,675),
+(676,676,676),(677,677,677),(678,678,678),(679,679,679),(680,680,680),
+(681,681,681),(682,682,682),(683,683,683),(684,684,684),(685,685,685),
+(686,686,686),(687,687,687),(688,688,688),(689,689,689),(690,690,690),
+(691,691,691),(692,692,692),(693,693,693),(694,694,694),(695,695,695),
+(696,696,696),(697,697,697),(698,698,698),(699,699,699),(700,700,700),
+(701,701,701),(702,702,702),(703,703,703),(704,704,704),(705,705,705),
+(706,706,706),(707,707,707),(708,708,708),(709,709,709),(710,710,710),
+(711,711,711),(712,712,712),(713,713,713),(714,714,714),(715,715,715),
+(716,716,716),(717,717,717),(718,718,718),(719,719,719),(720,720,720),
+(721,721,721),(722,722,722),(723,723,723),(724,724,724),(725,725,725),
+(726,726,726),(727,727,727),(728,728,728),(729,729,729),(730,730,730),
+(731,731,731),(732,732,732),(733,733,733),(734,734,734),(735,735,735),
+(736,736,736),(737,737,737),(738,738,738),(739,739,739),(740,740,740),
+(741,741,741),(742,742,742),(743,743,743),(744,744,744),(745,745,745),
+(746,746,746),(747,747,747),(748,748,748),(749,749,749),(750,750,750),
+(751,751,751),(752,752,752),(753,753,753),(754,754,754),(755,755,755),
+(756,756,756),(757,757,757),(758,758,758),(759,759,759),(760,760,760),
+(761,761,761),(762,762,762),(763,763,763),(764,764,764),(765,765,765),
+(766,766,766),(767,767,767),(768,768,768),(769,769,769),(770,770,770),
+(771,771,771),(772,772,772),(773,773,773),(774,774,774),(775,775,775),
+(776,776,776),(777,777,777),(778,778,778),(779,779,779),(780,780,780),
+(781,781,781),(782,782,782),(783,783,783),(784,784,784),(785,785,785),
+(786,786,786),(787,787,787),(788,788,788),(789,789,789),(790,790,790),
+(791,791,791),(792,792,792),(793,793,793),(794,794,794),(795,795,795),
+(796,796,796),(797,797,797),(798,798,798),(799,799,799),(800,800,800),
+(801,801,801),(802,802,802),(803,803,803),(804,804,804),(805,805,805),
+(806,806,806),(807,807,807),(808,808,808),(809,809,809),(810,810,810),
+(811,811,811),(812,812,812),(813,813,813),(814,814,814),(815,815,815),
+(816,816,816),(817,817,817),(818,818,818),(819,819,819),(820,820,820),
+(821,821,821),(822,822,822),(823,823,823),(824,824,824),(825,825,825),
+(826,826,826),(827,827,827),(828,828,828),(829,829,829),(830,830,830),
+(831,831,831),(832,832,832),(833,833,833),(834,834,834),(835,835,835),
+(836,836,836),(837,837,837),(838,838,838),(839,839,839),(840,840,840),
+(841,841,841),(842,842,842),(843,843,843),(844,844,844),(845,845,845),
+(846,846,846),(847,847,847),(848,848,848),(849,849,849),(850,850,850),
+(851,851,851),(852,852,852),(853,853,853),(854,854,854),(855,855,855),
+(856,856,856),(857,857,857),(858,858,858),(859,859,859),(860,860,860),
+(861,861,861),(862,862,862),(863,863,863),(864,864,864),(865,865,865),
+(866,866,866),(867,867,867),(868,868,868),(869,869,869),(870,870,870),
+(871,871,871),(872,872,872),(873,873,873),(874,874,874),(875,875,875),
+(876,876,876),(877,877,877),(878,878,878),(879,879,879),(880,880,880),
+(881,881,881),(882,882,882),(883,883,883),(884,884,884),(885,885,885),
+(886,886,886),(887,887,887),(888,888,888),(889,889,889),(890,890,890),
+(891,891,891),(892,892,892),(893,893,893),(894,894,894),(895,895,895),
+(896,896,896),(897,897,897),(898,898,898),(899,899,899),(900,900,900),
+(901,901,901),(902,902,902),(903,903,903),(904,904,904),(905,905,905),
+(906,906,906),(907,907,907),(908,908,908),(909,909,909),(910,910,910),
+(911,911,911),(912,912,912),(913,913,913),(914,914,914),(915,915,915),
+(916,916,916),(917,917,917),(918,918,918),(919,919,919),(920,920,920),
+(921,921,921),(922,922,922),(923,923,923),(924,924,924),(925,925,925),
+(926,926,926),(927,927,927),(928,928,928),(929,929,929),(930,930,930),
+(931,931,931),(932,932,932),(933,933,933),(934,934,934),(935,935,935),
+(936,936,936),(937,937,937),(938,938,938),(939,939,939),(940,940,940),
+(941,941,941),(942,942,942),(943,943,943),(944,944,944),(945,945,945),
+(946,946,946),(947,947,947),(948,948,948),(949,949,949),(950,950,950),
+(951,951,951),(952,952,952),(953,953,953),(954,954,954),(955,955,955),
+(956,956,956),(957,957,957),(958,958,958),(959,959,959),(960,960,960),
+(961,961,961),(962,962,962),(963,963,963),(964,964,964),(965,965,965),
+(966,966,966),(967,967,967),(968,968,968),(969,969,969),(970,970,970),
+(971,971,971),(972,972,972),(973,973,973),(974,974,974),(975,975,975),
+(976,976,976),(977,977,977),(978,978,978),(979,979,979),(980,980,980),
+(981,981,981),(982,982,982),(983,983,983),(984,984,984),(985,985,985),
+(986,986,986),(987,987,987),(988,988,988),(989,989,989),(990,990,990),
+(991,991,991),(992,992,992),(993,993,993),(994,994,994),(995,995,995),
+(996,996,996),(997,997,997),(998,998,998),(999,999,999),(1000,1000,1000),
+(1001,1001,1001),(1002,1002,1002),(1003,1003,1003),(1004,1004,1004),(1005,1005,1005),
+(1006,1006,1006),(1007,1007,1007),(1008,1008,1008),(1009,1009,1009),(1010,1010,1010),
+(1011,1011,1011),(1012,1012,1012),(1013,1013,1013),(1014,1014,1014),(1015,1015,1015),
+(1016,1016,1016),(1017,1017,1017),(1018,1018,1018),(1019,1019,1019),(1020,1020,1020),
+(1021,1021,1021),(1022,1022,1022),(1023,1023,1023),(1024,1024,1024),(1025,1025,1025),
+(1026,1026,1026),(1027,1027,1027),(1028,1028,1028),(1029,1029,1029),(1030,1030,1030),
+(1031,1031,1031),(1032,1032,1032),(1033,1033,1033),(1034,1034,1034),(1035,1035,1035),
+(1036,1036,1036),(1037,1037,1037),(1038,1038,1038),(1039,1039,1039),(1040,1040,1040),
+(1041,1041,1041),(1042,1042,1042),(1043,1043,1043),(1044,1044,1044),(1045,1045,1045),
+(1046,1046,1046),(1047,1047,1047),(1048,1048,1048),(1049,1049,1049),(1050,1050,1050),
+(1051,1051,1051),(1052,1052,1052),(1053,1053,1053),(1054,1054,1054),(1055,1055,1055),
+(1056,1056,1056),(1057,1057,1057),(1058,1058,1058),(1059,1059,1059),(1060,1060,1060),
+(1061,1061,1061),(1062,1062,1062),(1063,1063,1063),(1064,1064,1064),(1065,1065,1065),
+(1066,1066,1066),(1067,1067,1067),(1068,1068,1068),(1069,1069,1069),(1070,1070,1070),
+(1071,1071,1071),(1072,1072,1072),(1073,1073,1073),(1074,1074,1074),(1075,1075,1075),
+(1076,1076,1076),(1077,1077,1077),(1078,1078,1078),(1079,1079,1079),(1080,1080,1080),
+(1081,1081,1081),(1082,1082,1082),(1083,1083,1083),(1084,1084,1084),(1085,1085,1085),
+(1086,1086,1086),(1087,1087,1087),(1088,1088,1088),(1089,1089,1089),(1090,1090,1090),
+(1091,1091,1091),(1092,1092,1092),(1093,1093,1093),(1094,1094,1094),(1095,1095,1095),
+(1096,1096,1096),(1097,1097,1097),(1098,1098,1098),(1099,1099,1099),(1100,1100,1100),
+(1101,1101,1101),(1102,1102,1102),(1103,1103,1103),(1104,1104,1104),(1105,1105,1105),
+(1106,1106,1106),(1107,1107,1107),(1108,1108,1108),(1109,1109,1109),(1110,1110,1110),
+(1111,1111,1111),(1112,1112,1112),(1113,1113,1113),(1114,1114,1114),(1115,1115,1115),
+(1116,1116,1116),(1117,1117,1117),(1118,1118,1118),(1119,1119,1119),(1120,1120,1120),
+(1121,1121,1121),(1122,1122,1122),(1123,1123,1123),(1124,1124,1124),(1125,1125,1125),
+(1126,1126,1126),(1127,1127,1127),(1128,1128,1128),(1129,1129,1129),(1130,1130,1130),
+(1131,1131,1131),(1132,1132,1132),(1133,1133,1133),(1134,1134,1134),(1135,1135,1135),
+(1136,1136,1136),(1137,1137,1137),(1138,1138,1138),(1139,1139,1139),(1140,1140,1140),
+(1141,1141,1141),(1142,1142,1142),(1143,1143,1143),(1144,1144,1144),(1145,1145,1145),
+(1146,1146,1146),(1147,1147,1147),(1148,1148,1148),(1149,1149,1149),(1150,1150,1150),
+(1151,1151,1151),(1152,1152,1152),(1153,1153,1153),(1154,1154,1154),(1155,1155,1155),
+(1156,1156,1156),(1157,1157,1157),(1158,1158,1158),(1159,1159,1159),(1160,1160,1160),
+(1161,1161,1161),(1162,1162,1162),(1163,1163,1163),(1164,1164,1164),(1165,1165,1165),
+(1166,1166,1166),(1167,1167,1167),(1168,1168,1168),(1169,1169,1169),(1170,1170,1170),
+(1171,1171,1171),(1172,1172,1172),(1173,1173,1173),(1174,1174,1174),(1175,1175,1175),
+(1176,1176,1176),(1177,1177,1177),(1178,1178,1178),(1179,1179,1179),(1180,1180,1180),
+(1181,1181,1181),(1182,1182,1182),(1183,1183,1183),(1184,1184,1184),(1185,1185,1185),
+(1186,1186,1186),(1187,1187,1187),(1188,1188,1188),(1189,1189,1189),(1190,1190,1190),
+(1191,1191,1191),(1192,1192,1192),(1193,1193,1193),(1194,1194,1194),(1195,1195,1195),
+(1196,1196,1196),(1197,1197,1197),(1198,1198,1198),(1199,1199,1199),(1200,1200,1200),
+(1201,1201,1201),(1202,1202,1202),(1203,1203,1203),(1204,1204,1204),(1205,1205,1205),
+(1206,1206,1206),(1207,1207,1207),(1208,1208,1208),(1209,1209,1209),(1210,1210,1210),
+(1211,1211,1211),(1212,1212,1212),(1213,1213,1213),(1214,1214,1214),(1215,1215,1215),
+(1216,1216,1216),(1217,1217,1217),(1218,1218,1218),(1219,1219,1219),(1220,1220,1220),
+(1221,1221,1221),(1222,1222,1222),(1223,1223,1223),(1224,1224,1224),(1225,1225,1225),
+(1226,1226,1226),(1227,1227,1227),(1228,1228,1228),(1229,1229,1229),(1230,1230,1230),
+(1231,1231,1231),(1232,1232,1232),(1233,1233,1233),(1234,1234,1234),(1235,1235,1235),
+(1236,1236,1236),(1237,1237,1237),(1238,1238,1238),(1239,1239,1239),(1240,1240,1240),
+(1241,1241,1241),(1242,1242,1242),(1243,1243,1243),(1244,1244,1244),(1245,1245,1245),
+(1246,1246,1246),(1247,1247,1247),(1248,1248,1248),(1249,1249,1249),(1250,1250,1250),
+(1251,1251,1251),(1252,1252,1252),(1253,1253,1253),(1254,1254,1254),(1255,1255,1255),
+(1256,1256,1256),(1257,1257,1257),(1258,1258,1258),(1259,1259,1259),(1260,1260,1260),
+(1261,1261,1261),(1262,1262,1262),(1263,1263,1263),(1264,1264,1264),(1265,1265,1265),
+(1266,1266,1266),(1267,1267,1267),(1268,1268,1268),(1269,1269,1269),(1270,1270,1270),
+(1271,1271,1271),(1272,1272,1272),(1273,1273,1273),(1274,1274,1274),(1275,1275,1275),
+(1276,1276,1276),(1277,1277,1277),(1278,1278,1278),(1279,1279,1279),(1280,1280,1280),
+(1281,1281,1281),(1282,1282,1282),(1283,1283,1283),(1284,1284,1284),(1285,1285,1285),
+(1286,1286,1286),(1287,1287,1287),(1288,1288,1288),(1289,1289,1289),(1290,1290,1290),
+(1291,1291,1291),(1292,1292,1292),(1293,1293,1293),(1294,1294,1294),(1295,1295,1295),
+(1296,1296,1296),(1297,1297,1297),(1298,1298,1298),(1299,1299,1299),(1300,1300,1300),
+(1301,1301,1301),(1302,1302,1302),(1303,1303,1303),(1304,1304,1304),(1305,1305,1305),
+(1306,1306,1306),(1307,1307,1307),(1308,1308,1308),(1309,1309,1309),(1310,1310,1310),
+(1311,1311,1311),(1312,1312,1312),(1313,1313,1313),(1314,1314,1314),(1315,1315,1315),
+(1316,1316,1316),(1317,1317,1317),(1318,1318,1318),(1319,1319,1319),(1320,1320,1320),
+(1321,1321,1321),(1322,1322,1322),(1323,1323,1323),(1324,1324,1324),(1325,1325,1325),
+(1326,1326,1326),(1327,1327,1327),(1328,1328,1328),(1329,1329,1329),(1330,1330,1330),
+(1331,1331,1331),(1332,1332,1332),(1333,1333,1333),(1334,1334,1334),(1335,1335,1335),
+(1336,1336,1336),(1337,1337,1337),(1338,1338,1338),(1339,1339,1339),(1340,1340,1340),
+(1341,1341,1341),(1342,1342,1342),(1343,1343,1343),(1344,1344,1344),(1345,1345,1345),
+(1346,1346,1346),(1347,1347,1347),(1348,1348,1348),(1349,1349,1349),(1350,1350,1350),
+(1351,1351,1351),(1352,1352,1352),(1353,1353,1353),(1354,1354,1354),(1355,1355,1355),
+(1356,1356,1356),(1357,1357,1357),(1358,1358,1358),(1359,1359,1359),(1360,1360,1360),
+(1361,1361,1361),(1362,1362,1362),(1363,1363,1363),(1364,1364,1364),(1365,1365,1365),
+(1366,1366,1366),(1367,1367,1367),(1368,1368,1368),(1369,1369,1369),(1370,1370,1370),
+(1371,1371,1371),(1372,1372,1372),(1373,1373,1373),(1374,1374,1374),(1375,1375,1375),
+(1376,1376,1376),(1377,1377,1377),(1378,1378,1378),(1379,1379,1379),(1380,1380,1380),
+(1381,1381,1381),(1382,1382,1382),(1383,1383,1383),(1384,1384,1384),(1385,1385,1385),
+(1386,1386,1386),(1387,1387,1387),(1388,1388,1388),(1389,1389,1389),(1390,1390,1390),
+(1391,1391,1391),(1392,1392,1392),(1393,1393,1393),(1394,1394,1394),(1395,1395,1395),
+(1396,1396,1396),(1397,1397,1397),(1398,1398,1398),(1399,1399,1399),(1400,1400,1400),
+(1401,1401,1401),(1402,1402,1402),(1403,1403,1403),(1404,1404,1404),(1405,1405,1405),
+(1406,1406,1406),(1407,1407,1407),(1408,1408,1408),(1409,1409,1409),(1410,1410,1410),
+(1411,1411,1411),(1412,1412,1412),(1413,1413,1413),(1414,1414,1414),(1415,1415,1415),
+(1416,1416,1416),(1417,1417,1417),(1418,1418,1418),(1419,1419,1419),(1420,1420,1420),
+(1421,1421,1421),(1422,1422,1422),(1423,1423,1423),(1424,1424,1424),(1425,1425,1425),
+(1426,1426,1426),(1427,1427,1427),(1428,1428,1428),(1429,1429,1429),(1430,1430,1430),
+(1431,1431,1431),(1432,1432,1432),(1433,1433,1433),(1434,1434,1434),(1435,1435,1435),
+(1436,1436,1436),(1437,1437,1437),(1438,1438,1438),(1439,1439,1439),(1440,1440,1440),
+(1441,1441,1441),(1442,1442,1442),(1443,1443,1443),(1444,1444,1444),(1445,1445,1445),
+(1446,1446,1446),(1447,1447,1447),(1448,1448,1448),(1449,1449,1449),(1450,1450,1450),
+(1451,1451,1451),(1452,1452,1452),(1453,1453,1453),(1454,1454,1454),(1455,1455,1455),
+(1456,1456,1456),(1457,1457,1457),(1458,1458,1458),(1459,1459,1459),(1460,1460,1460),
+(1461,1461,1461),(1462,1462,1462),(1463,1463,1463),(1464,1464,1464),(1465,1465,1465),
+(1466,1466,1466),(1467,1467,1467),(1468,1468,1468),(1469,1469,1469),(1470,1470,1470),
+(1471,1471,1471),(1472,1472,1472),(1473,1473,1473),(1474,1474,1474),(1475,1475,1475),
+(1476,1476,1476),(1477,1477,1477),(1478,1478,1478),(1479,1479,1479),(1480,1480,1480),
+(1481,1481,1481),(1482,1482,1482),(1483,1483,1483),(1484,1484,1484),(1485,1485,1485),
+(1486,1486,1486),(1487,1487,1487),(1488,1488,1488),(1489,1489,1489),(1490,1490,1490),
+(1491,1491,1491),(1492,1492,1492),(1493,1493,1493),(1494,1494,1494),(1495,1495,1495),
+(1496,1496,1496),(1497,1497,1497),(1498,1498,1498),(1499,1499,1499),(1500,1500,1500),
+(1501,1501,1501),(1502,1502,1502),(1503,1503,1503),(1504,1504,1504),(1505,1505,1505),
+(1506,1506,1506),(1507,1507,1507),(1508,1508,1508),(1509,1509,1509),(1510,1510,1510),
+(1511,1511,1511),(1512,1512,1512),(1513,1513,1513),(1514,1514,1514),(1515,1515,1515),
+(1516,1516,1516),(1517,1517,1517),(1518,1518,1518),(1519,1519,1519),(1520,1520,1520),
+(1521,1521,1521),(1522,1522,1522),(1523,1523,1523),(1524,1524,1524),(1525,1525,1525),
+(1526,1526,1526),(1527,1527,1527),(1528,1528,1528),(1529,1529,1529),(1530,1530,1530),
+(1531,1531,1531),(1532,1532,1532),(1533,1533,1533),(1534,1534,1534),(1535,1535,1535),
+(1536,1536,1536),(1537,1537,1537),(1538,1538,1538),(1539,1539,1539),(1540,1540,1540),
+(1541,1541,1541),(1542,1542,1542),(1543,1543,1543),(1544,1544,1544),(1545,1545,1545),
+(1546,1546,1546),(1547,1547,1547),(1548,1548,1548),(1549,1549,1549),(1550,1550,1550),
+(1551,1551,1551),(1552,1552,1552),(1553,1553,1553),(1554,1554,1554),(1555,1555,1555),
+(1556,1556,1556),(1557,1557,1557),(1558,1558,1558),(1559,1559,1559),(1560,1560,1560),
+(1561,1561,1561),(1562,1562,1562),(1563,1563,1563),(1564,1564,1564),(1565,1565,1565),
+(1566,1566,1566),(1567,1567,1567),(1568,1568,1568),(1569,1569,1569),(1570,1570,1570),
+(1571,1571,1571),(1572,1572,1572),(1573,1573,1573),(1574,1574,1574),(1575,1575,1575),
+(1576,1576,1576),(1577,1577,1577),(1578,1578,1578),(1579,1579,1579),(1580,1580,1580),
+(1581,1581,1581),(1582,1582,1582),(1583,1583,1583),(1584,1584,1584),(1585,1585,1585),
+(1586,1586,1586),(1587,1587,1587),(1588,1588,1588),(1589,1589,1589),(1590,1590,1590),
+(1591,1591,1591),(1592,1592,1592),(1593,1593,1593),(1594,1594,1594),(1595,1595,1595),
+(1596,1596,1596),(1597,1597,1597),(1598,1598,1598),(1599,1599,1599),(1600,1600,1600),
+(1601,1601,1601),(1602,1602,1602),(1603,1603,1603),(1604,1604,1604),(1605,1605,1605),
+(1606,1606,1606),(1607,1607,1607),(1608,1608,1608),(1609,1609,1609),(1610,1610,1610),
+(1611,1611,1611),(1612,1612,1612),(1613,1613,1613),(1614,1614,1614),(1615,1615,1615),
+(1616,1616,1616),(1617,1617,1617),(1618,1618,1618),(1619,1619,1619),(1620,1620,1620),
+(1621,1621,1621),(1622,1622,1622),(1623,1623,1623),(1624,1624,1624),(1625,1625,1625),
+(1626,1626,1626),(1627,1627,1627),(1628,1628,1628),(1629,1629,1629),(1630,1630,1630),
+(1631,1631,1631),(1632,1632,1632),(1633,1633,1633),(1634,1634,1634),(1635,1635,1635),
+(1636,1636,1636),(1637,1637,1637),(1638,1638,1638),(1639,1639,1639),(1640,1640,1640),
+(1641,1641,1641),(1642,1642,1642),(1643,1643,1643),(1644,1644,1644),(1645,1645,1645),
+(1646,1646,1646),(1647,1647,1647),(1648,1648,1648),(1649,1649,1649),(1650,1650,1650),
+(1651,1651,1651),(1652,1652,1652),(1653,1653,1653),(1654,1654,1654),(1655,1655,1655),
+(1656,1656,1656),(1657,1657,1657),(1658,1658,1658),(1659,1659,1659),(1660,1660,1660),
+(1661,1661,1661),(1662,1662,1662),(1663,1663,1663),(1664,1664,1664),(1665,1665,1665),
+(1666,1666,1666),(1667,1667,1667),(1668,1668,1668),(1669,1669,1669),(1670,1670,1670),
+(1671,1671,1671),(1672,1672,1672),(1673,1673,1673),(1674,1674,1674),(1675,1675,1675),
+(1676,1676,1676),(1677,1677,1677),(1678,1678,1678),(1679,1679,1679),(1680,1680,1680),
+(1681,1681,1681),(1682,1682,1682),(1683,1683,1683),(1684,1684,1684),(1685,1685,1685),
+(1686,1686,1686),(1687,1687,1687),(1688,1688,1688),(1689,1689,1689),(1690,1690,1690),
+(1691,1691,1691),(1692,1692,1692),(1693,1693,1693),(1694,1694,1694),(1695,1695,1695),
+(1696,1696,1696),(1697,1697,1697),(1698,1698,1698),(1699,1699,1699),(1700,1700,1700),
+(1701,1701,1701),(1702,1702,1702),(1703,1703,1703),(1704,1704,1704),(1705,1705,1705),
+(1706,1706,1706),(1707,1707,1707),(1708,1708,1708),(1709,1709,1709),(1710,1710,1710),
+(1711,1711,1711),(1712,1712,1712),(1713,1713,1713),(1714,1714,1714),(1715,1715,1715),
+(1716,1716,1716),(1717,1717,1717),(1718,1718,1718),(1719,1719,1719),(1720,1720,1720),
+(1721,1721,1721),(1722,1722,1722),(1723,1723,1723),(1724,1724,1724),(1725,1725,1725),
+(1726,1726,1726),(1727,1727,1727),(1728,1728,1728),(1729,1729,1729),(1730,1730,1730),
+(1731,1731,1731),(1732,1732,1732),(1733,1733,1733),(1734,1734,1734),(1735,1735,1735),
+(1736,1736,1736),(1737,1737,1737),(1738,1738,1738),(1739,1739,1739),(1740,1740,1740),
+(1741,1741,1741),(1742,1742,1742),(1743,1743,1743),(1744,1744,1744),(1745,1745,1745),
+(1746,1746,1746),(1747,1747,1747),(1748,1748,1748),(1749,1749,1749),(1750,1750,1750),
+(1751,1751,1751),(1752,1752,1752),(1753,1753,1753),(1754,1754,1754),(1755,1755,1755),
+(1756,1756,1756),(1757,1757,1757),(1758,1758,1758),(1759,1759,1759),(1760,1760,1760),
+(1761,1761,1761),(1762,1762,1762),(1763,1763,1763),(1764,1764,1764),(1765,1765,1765),
+(1766,1766,1766),(1767,1767,1767),(1768,1768,1768),(1769,1769,1769),(1770,1770,1770),
+(1771,1771,1771),(1772,1772,1772),(1773,1773,1773),(1774,1774,1774),(1775,1775,1775),
+(1776,1776,1776),(1777,1777,1777),(1778,1778,1778),(1779,1779,1779),(1780,1780,1780),
+(1781,1781,1781),(1782,1782,1782),(1783,1783,1783),(1784,1784,1784),(1785,1785,1785),
+(1786,1786,1786),(1787,1787,1787),(1788,1788,1788),(1789,1789,1789),(1790,1790,1790),
+(1791,1791,1791),(1792,1792,1792),(1793,1793,1793),(1794,1794,1794),(1795,1795,1795),
+(1796,1796,1796),(1797,1797,1797),(1798,1798,1798),(1799,1799,1799),(1800,1800,1800),
+(1801,1801,1801),(1802,1802,1802),(1803,1803,1803),(1804,1804,1804),(1805,1805,1805),
+(1806,1806,1806),(1807,1807,1807),(1808,1808,1808),(1809,1809,1809),(1810,1810,1810),
+(1811,1811,1811),(1812,1812,1812),(1813,1813,1813),(1814,1814,1814),(1815,1815,1815),
+(1816,1816,1816),(1817,1817,1817),(1818,1818,1818),(1819,1819,1819),(1820,1820,1820),
+(1821,1821,1821),(1822,1822,1822),(1823,1823,1823),(1824,1824,1824),(1825,1825,1825),
+(1826,1826,1826),(1827,1827,1827),(1828,1828,1828),(1829,1829,1829),(1830,1830,1830),
+(1831,1831,1831),(1832,1832,1832),(1833,1833,1833),(1834,1834,1834),(1835,1835,1835),
+(1836,1836,1836),(1837,1837,1837),(1838,1838,1838),(1839,1839,1839),(1840,1840,1840),
+(1841,1841,1841),(1842,1842,1842),(1843,1843,1843),(1844,1844,1844),(1845,1845,1845),
+(1846,1846,1846),(1847,1847,1847),(1848,1848,1848),(1849,1849,1849),(1850,1850,1850),
+(1851,1851,1851),(1852,1852,1852),(1853,1853,1853),(1854,1854,1854),(1855,1855,1855),
+(1856,1856,1856),(1857,1857,1857),(1858,1858,1858),(1859,1859,1859),(1860,1860,1860),
+(1861,1861,1861),(1862,1862,1862),(1863,1863,1863),(1864,1864,1864),(1865,1865,1865),
+(1866,1866,1866),(1867,1867,1867),(1868,1868,1868),(1869,1869,1869),(1870,1870,1870),
+(1871,1871,1871),(1872,1872,1872),(1873,1873,1873),(1874,1874,1874),(1875,1875,1875),
+(1876,1876,1876),(1877,1877,1877),(1878,1878,1878),(1879,1879,1879),(1880,1880,1880),
+(1881,1881,1881),(1882,1882,1882),(1883,1883,1883),(1884,1884,1884),(1885,1885,1885),
+(1886,1886,1886),(1887,1887,1887),(1888,1888,1888),(1889,1889,1889),(1890,1890,1890),
+(1891,1891,1891),(1892,1892,1892),(1893,1893,1893),(1894,1894,1894),(1895,1895,1895),
+(1896,1896,1896),(1897,1897,1897),(1898,1898,1898),(1899,1899,1899),(1900,1900,1900),
+(1901,1901,1901),(1902,1902,1902),(1903,1903,1903),(1904,1904,1904),(1905,1905,1905),
+(1906,1906,1906),(1907,1907,1907),(1908,1908,1908),(1909,1909,1909),(1910,1910,1910),
+(1911,1911,1911),(1912,1912,1912),(1913,1913,1913),(1914,1914,1914),(1915,1915,1915),
+(1916,1916,1916),(1917,1917,1917),(1918,1918,1918),(1919,1919,1919),(1920,1920,1920),
+(1921,1921,1921),(1922,1922,1922),(1923,1923,1923),(1924,1924,1924),(1925,1925,1925),
+(1926,1926,1926),(1927,1927,1927),(1928,1928,1928),(1929,1929,1929),(1930,1930,1930),
+(1931,1931,1931),(1932,1932,1932),(1933,1933,1933),(1934,1934,1934),(1935,1935,1935),
+(1936,1936,1936),(1937,1937,1937),(1938,1938,1938),(1939,1939,1939),(1940,1940,1940),
+(1941,1941,1941),(1942,1942,1942),(1943,1943,1943),(1944,1944,1944),(1945,1945,1945),
+(1946,1946,1946),(1947,1947,1947),(1948,1948,1948),(1949,1949,1949),(1950,1950,1950),
+(1951,1951,1951),(1952,1952,1952),(1953,1953,1953),(1954,1954,1954),(1955,1955,1955),
+(1956,1956,1956),(1957,1957,1957),(1958,1958,1958),(1959,1959,1959),(1960,1960,1960),
+(1961,1961,1961),(1962,1962,1962),(1963,1963,1963),(1964,1964,1964),(1965,1965,1965),
+(1966,1966,1966),(1967,1967,1967),(1968,1968,1968),(1969,1969,1969),(1970,1970,1970),
+(1971,1971,1971),(1972,1972,1972),(1973,1973,1973),(1974,1974,1974),(1975,1975,1975),
+(1976,1976,1976),(1977,1977,1977),(1978,1978,1978),(1979,1979,1979),(1980,1980,1980),
+(1981,1981,1981),(1982,1982,1982),(1983,1983,1983),(1984,1984,1984),(1985,1985,1985),
+(1986,1986,1986),(1987,1987,1987),(1988,1988,1988),(1989,1989,1989),(1990,1990,1990),
+(1991,1991,1991),(1992,1992,1992),(1993,1993,1993),(1994,1994,1994),(1995,1995,1995),
+(1996,1996,1996),(1997,1997,1997),(1998,1998,1998),(1999,1999,1999);
+
+SELECT COUNT(*) FROM t1;
+
+
+#
+# Insert duplicate rows
+#
+--error ER_DUP_ENTRY
+INSERT INTO t1 VALUES (1,1,1);
+
+--error 1022
+INSERT INTO t1 VALUES
+(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
+(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
+
+select count(*) from t1;
+
+
+#
+# Test that select count(*) can see inserts made in the same transaction
+#
+begin;
+SELECT COUNT(*) FROM t1;
+INSERT INTO t1 VALUES
+(2001,2001,2001),(2002,2002,2002),(2003,2003,2003),(2004,2004,2004),(2005,2005,2005);
+SELECT COUNT(*) FROM t1;
+rollback;
+
+#
+# Insert duplicate rows, inside transaction
+# try to commit
+#
+begin;
+
+--error 1022
+INSERT INTO t1 VALUES
+(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
+(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
+
+--error 1296
+commit;
+
+select * from t1 where pk1=1;
+select * from t1 where pk1=10;
+select count(*) from t1 where pk1 <= 10 order by pk1;
+select count(*) from t1;
+
+
+#
+# Insert duplicate rows, inside transaction
+# rollback
+#
+begin;
+
+--error 1022
+INSERT INTO t1 VALUES
+(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
+(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
+
+rollback;
+
+select * from t1 where pk1=1;
+select * from t1 where pk1=10;
+select count(*) from t1 where pk1 <= 10 order by pk1;
+select count(*) from t1;
+
+
+#
+# Insert duplicate rows, inside transaction
+# then try to select, finally rollback
+#
+begin;
+
+--error 1022
+INSERT INTO t1 VALUES
+(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
+(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
+--error 1296
+SELECT * FROM t1 WHERE pk1=10;
+
+rollback;
+
+select * from t1 where pk1=1;
+select * from t1 where pk1=10;
+select count(*) from t1 where pk1 <= 10 order by pk1;
+select count(*) from t1;
+
+
+#
+# Insert duplicate rows, inside transaction
+# then try to select, finally commit
+#
+begin;
+
+--error 1022
+INSERT INTO t1 VALUES
+(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
+(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
+
+--error 1296
+SELECT * FROM t1 WHERE pk1=10;
+
+--error 1296
+SELECT * FROM t1 WHERE pk1=10;
+
+--error 1296
+commit;
+
+select * from t1 where pk1=1;
+select * from t1 where pk1=10;
+select count(*) from t1 where pk1 <= 10 order by pk1;
+select count(*) from t1;
+
+
+#
+# Insert duplicate rows, inside transaction
+# then try to do another insert
+#
+begin;
+
+--error 1022
+INSERT INTO t1 VALUES
+(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
+(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
+
+--error 1296
+INSERT INTO t1 values (4000, 40, 44);
+
+rollback;
+
+select * from t1 where pk1=1;
+select * from t1 where pk1=10;
+select count(*) from t1 where pk1 <= 10 order by pk1;
+select count(*) from t1;
+
+#
+# Insert duplicate rows using "insert .. select"
+
+#
+--error 1022
+insert into t1 select * from t1 where b < 10 order by pk1;
+
+DELETE FROM t1 WHERE pk1=2;
+
+begin;
+INSERT IGNORE INTO t1 VALUES(1,2,3),(2,3,4);
+select * from t1 where pk1 < 3 order by pk1;
+rollback;
+
+INSERT IGNORE INTO t1 VALUES(1,2,3),(2,3,4);
+select * from t1 where pk1 < 3 order by pk1;
+
+REPLACE INTO t1 values(1, 78, 3);
+select * from t1 where pk1=1;
+
+INSERT INTO t1 VALUES(1,1,1),(3,4,5) ON DUPLICATE KEY UPDATE b=79;
+select * from t1 where pk1 < 4 order by pk1;
+
+INSERT INTO t1 VALUES(1,1,1),(3,4,5) ON DUPLICATE KEY UPDATE b=pk1+c;
+select * from t1 where pk1 < 4 order by pk1;
+
+DELETE FROM t1 WHERE pk1 = 2 OR pk1 = 4 OR pk1 = 6;
+INSERT INTO t1 VALUES(1,1,1),(2,2,17),(3,4,5) ON DUPLICATE KEY UPDATE pk1=b;
+select * from t1 where pk1 = b and b != c order by pk1;
+
+# Test handling of duplicate unique
+DELETE FROM t1;
+CREATE UNIQUE INDEX bi ON t1(b);
+INSERT INTO t1 VALUES
+(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
+(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
+INSERT INTO t1 VALUES(0,1,0),(21,21,21) ON DUPLICATE KEY UPDATE pk1=b+10,b=b+10;
+select * from t1 order by pk1;
+
+DROP TABLE t1;
+
+#
+# Bug #6331: problem with 'insert ignore'
+#
+
+CREATE TABLE t1(a INT) ENGINE=ndb;
+INSERT IGNORE INTO t1 VALUES (1);
+INSERT IGNORE INTO t1 VALUES (1);
+INSERT IGNORE INTO t1 SELECT a FROM t1;
+INSERT IGNORE INTO t1 SELECT a FROM t1;
+INSERT IGNORE INTO t1 SELECT a FROM t1;
+INSERT IGNORE INTO t1 VALUES (1);
+INSERT IGNORE INTO t1 VALUES (1);
+SELECT * FROM t1 ORDER BY a;
+DELETE FROM t1;
+CREATE UNIQUE INDEX ai ON t1(a);
+INSERT IGNORE INTO t1 VALUES (1);
+INSERT IGNORE INTO t1 VALUES (1);
+INSERT IGNORE INTO t1 VALUES (NULL),(2);
+SELECT * FROM t1 ORDER BY a;
+DROP TABLE t1;
+
+# Ignore and NULL values
+CREATE TABLE t1(pk INT NOT NULL PRIMARY KEY, a INT, UNIQUE (a)) ENGINE=ndb;
+INSERT IGNORE INTO t1 VALUES (1,1),(2,2),(3,3);
+INSERT IGNORE INTO t1 VALUES (4,NULL),(5,NULL),(6,NULL),(7,4);
+SELECT * FROM t1 ORDER BY pk;
+DROP TABLE t1;
+
+#
+# Bug #27980 INSERT IGNORE wrongly ignores NULLs in unique index
+#
+
+create table t1(a int primary key, b int, unique key(b)) engine=ndb;
+insert ignore into t1 values (1,0), (2,0), (2,null), (3,null);
+select * from t1 order by a;
+drop table t1;
+
+# Bug#26342 auto_increment_increment AND auto_increment_offset REALLY REALLY anger NDB cluster
+
+CREATE TABLE t1 (
+ pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ b INT NOT NULL,
+ c INT NOT NULL UNIQUE
+) ENGINE=NDBCLUSTER;
+
+CREATE TABLE t2 (
+ pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ b INT NOT NULL,
+ c INT NOT NULL UNIQUE
+) ENGINE=MYISAM;
+
+SET @@session.auto_increment_increment=10;
+INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
+INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
+SELECT * FROM t1 ORDER BY pk;
+SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
+TRUNCATE t1;
+TRUNCATE t2;
+SET @@session.auto_increment_offset=5;
+INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
+INSERT INTO t1 (pk,b,c) VALUES (27,4,3),(NULL,5,4),(99,6,5),(NULL,7,6);
+INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
+INSERT INTO t2 (pk,b,c) VALUES (27,4,3),(NULL,5,4),(99,6,5),(NULL,7,6);
+SELECT * FROM t1 ORDER BY pk;
+SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
+TRUNCATE t1;
+TRUNCATE t2;
+SET @@session.auto_increment_increment=2;
+INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
+INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
+SELECT * FROM t1 ORDER BY pk;
+SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
+DROP TABLE t1, t2;
+
+CREATE TABLE t1 (
+ pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ b INT NOT NULL,
+ c INT NOT NULL UNIQUE
+) ENGINE=NDBCLUSTER AUTO_INCREMENT = 7;
+
+CREATE TABLE t2 (
+ pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ b INT NOT NULL,
+ c INT NOT NULL UNIQUE
+) ENGINE=MYISAM AUTO_INCREMENT = 7;
+
+SET @@session.auto_increment_offset=1;
+SET @@session.auto_increment_increment=1;
+INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
+INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
+SELECT * FROM t1 ORDER BY pk;
+SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
+DROP TABLE t1, t2;
+
+CREATE TABLE t1 (
+ pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ b INT NOT NULL,
+ c INT NOT NULL UNIQUE
+) ENGINE=NDBCLUSTER AUTO_INCREMENT = 3;
+
+CREATE TABLE t2 (
+ pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ b INT NOT NULL,
+ c INT NOT NULL UNIQUE
+) ENGINE=MYISAM AUTO_INCREMENT = 3;
+
+SET @@session.auto_increment_offset=5;
+SET @@session.auto_increment_increment=10;
+INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
+INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
+SELECT * FROM t1 ORDER BY pk;
+SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
+DROP TABLE t1, t2;
+
+CREATE TABLE t1 (
+ pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ b INT NOT NULL,
+ c INT NOT NULL UNIQUE
+) ENGINE=NDBCLUSTER AUTO_INCREMENT = 7;
+
+CREATE TABLE t2 (
+ pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ b INT NOT NULL,
+ c INT NOT NULL UNIQUE
+) ENGINE=MYISAM AUTO_INCREMENT = 7;
+
+SET @@session.auto_increment_offset=5;
+SET @@session.auto_increment_increment=10;
+INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
+INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
+SELECT * FROM t1 ORDER BY pk;
+SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
+DROP TABLE t1, t2;
+
+CREATE TABLE t1 (
+ pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ b INT NOT NULL,
+ c INT NOT NULL UNIQUE
+) ENGINE=NDBCLUSTER AUTO_INCREMENT = 5;
+
+CREATE TABLE t2 (
+ pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ b INT NOT NULL,
+ c INT NOT NULL UNIQUE
+) ENGINE=MYISAM AUTO_INCREMENT = 5;
+
+SET @@session.auto_increment_offset=5;
+SET @@session.auto_increment_increment=10;
+INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
+INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
+SELECT * FROM t1 ORDER BY pk;
+SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
+DROP TABLE t1, t2;
+
+CREATE TABLE t1 (
+ pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ b INT NOT NULL,
+ c INT NOT NULL UNIQUE
+) ENGINE=NDBCLUSTER AUTO_INCREMENT = 100;
+
+CREATE TABLE t2 (
+ pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ b INT NOT NULL,
+ c INT NOT NULL UNIQUE
+) ENGINE=MYISAM AUTO_INCREMENT = 100;
+
+SET @@session.auto_increment_offset=5;
+SET @@session.auto_increment_increment=10;
+INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
+INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
+SELECT * FROM t1 ORDER BY pk;
+SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
+DROP TABLE t1, t2;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ndb_limit.test b/mysql-test/suite/ndb/t/ndb_limit.test
index 01613606d66..01613606d66 100644
--- a/mysql-test/t/ndb_limit.test
+++ b/mysql-test/suite/ndb/t/ndb_limit.test
diff --git a/mysql-test/t/ndb_load.test b/mysql-test/suite/ndb/t/ndb_load.test
index af2df70b74e..af2df70b74e 100644
--- a/mysql-test/t/ndb_load.test
+++ b/mysql-test/suite/ndb/t/ndb_load.test
diff --git a/mysql-test/t/ndb_loaddatalocal.test b/mysql-test/suite/ndb/t/ndb_loaddatalocal.test
index 3eae3891f43..3eae3891f43 100644
--- a/mysql-test/t/ndb_loaddatalocal.test
+++ b/mysql-test/suite/ndb/t/ndb_loaddatalocal.test
diff --git a/mysql-test/t/ndb_lock.test b/mysql-test/suite/ndb/t/ndb_lock.test
index b6cd1ca7eb4..b6cd1ca7eb4 100644
--- a/mysql-test/t/ndb_lock.test
+++ b/mysql-test/suite/ndb/t/ndb_lock.test
diff --git a/mysql-test/t/ndb_minmax.test b/mysql-test/suite/ndb/t/ndb_minmax.test
index a3ac677cd2a..a3ac677cd2a 100644
--- a/mysql-test/t/ndb_minmax.test
+++ b/mysql-test/suite/ndb/t/ndb_minmax.test
diff --git a/mysql-test/suite/ndb/t/ndb_multi.test b/mysql-test/suite/ndb/t/ndb_multi.test
new file mode 100644
index 00000000000..b8e052d606b
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_multi.test
@@ -0,0 +1,125 @@
+-- source include/have_multi_ndb.inc
+-- source include/not_embedded.inc
+
+--disable_warnings
+connection server2;
+drop table if exists t1, t2, t3, t4;
+connection server1;
+drop table if exists t1, t2, t3, t4;
+--enable_warnings
+
+flush status;
+
+# Create test tables on server1
+create table t1 (a int) engine=ndbcluster;
+create table t2 (a int) engine=ndbcluster;
+insert into t1 value (2);
+insert into t2 value (3);
+select * from t1;
+select * from t2;
+show status like 'handler_discover%';
+
+# Check dropping and recreating table on same server
+connect (con1,localhost,root,,test);
+connect (con2,localhost,root,,test);
+connection con1;
+select * from t1;
+connection con2;
+drop table t1;
+create table t1 (a int) engine=ndbcluster;
+insert into t1 value (2);
+connection con1;
+select * from t1;
+
+# Check dropping and recreating table on different server
+connection server2;
+show status like 'handler_discover%';
+drop table t1;
+create table t1 (a int) engine=ndbcluster;
+insert into t1 value (2);
+connection server1;
+select * from t1;
+select * from t1;
+
+# Connect to server2 and use the tables from there
+connection server2;
+flush status;
+select * from t1;
+update t1 set a=3 where a=2;
+show status like 'handler_discover%';
+
+# Create a new table on server2
+create table t3 (a int not null primary key, b varchar(22),
+c int, last_col text) engine=ndb;
+insert into t3 values(1, 'Hi!', 89, 'Longtext column');
+create table t4 (pk int primary key, b int) engine=ndb;
+
+# Check that the tables are accessible from server1
+connection server1;
+select * from t1;
+select * from t3;
+show tables like 't4';
+show tables;
+
+drop table t1, t2, t3, t4;
+# bug#21378
+connection server1;
+create table t1(c1 int key)ENGINE=MyISAM;
+insert into t1 values(1),(3),(5);
+select * from t1 order by c1;
+
+connection server2;
+show tables;
+create table t1(c1 int key)ENGINE=MyISAM;
+insert into t1 values(100),(344),(533);
+select * from t1 order by c1;
+
+connection server1;
+alter table t1 engine=ndb;
+
+connection server2;
+show tables;
+select * from t1 order by c1;
+drop table t1;
+
+connection server1;
+select * from t1 order by c1;
+drop table t1;
+# End of 4.1 tests
+
+# Check distributed drop of database in 5.1
+create database db;
+use db;
+create table t1(x int) engine=ndb;
+
+connection server2;
+use db;
+show tables;
+
+connection server1;
+drop database db;
+
+connection server2;
+--error 1049
+show tables;
+
+connection server1;
+
+# bug#21495
+create database db;
+use db;
+create table t1(x int) engine=ndb;
+
+connection server2;
+use db;
+create table t2(x int) engine=myisam;
+show tables;
+
+connection server1;
+drop database db;
+
+connection server2;
+show tables;
+drop database db;
+
+connection server1;
diff --git a/mysql-test/suite/ndb/t/ndb_multi_row.test b/mysql-test/suite/ndb/t/ndb_multi_row.test
new file mode 100644
index 00000000000..c82307839f4
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_multi_row.test
@@ -0,0 +1,75 @@
+-- source include/have_multi_ndb.inc
+-- source include/not_embedded.inc
+-- source include/have_binlog_format_mixed_or_row.inc
+
+
+--disable_warnings
+connection server2;
+drop table if exists t1, t2, t3, t4;
+connection server1;
+drop table if exists t1, t2, t3, t4;
+--enable_warnings
+
+flush status;
+
+# Create test tables on server1
+create table t1 (a int) engine=ndbcluster;
+create table t2 (a int) engine=ndbcluster;
+insert into t1 value (2);
+insert into t2 value (3);
+select * from t1;
+select * from t2;
+show status like 'handler_discover%';
+
+# Check dropping and recreating table on same server
+connect (con1,localhost,root,,test);
+connect (con2,localhost,root,,test);
+connection con1;
+select * from t1;
+connection con2;
+drop table t1;
+create table t1 (a int) engine=ndbcluster;
+insert into t1 value (2);
+connection con1;
+select * from t1;
+
+# Check dropping and recreating table on different server
+connection server2;
+show status like 'handler_discover%';
+drop table t1;
+create table t1 (a int) engine=ndbcluster;
+insert into t1 value (2);
+connection server1;
+## Currently a retry is required remotely
+#--error 1412
+#select * from t1;
+#show warnings;
+#flush table t1;
+# Table definition change should be propagated automatically
+select * from t1;
+
+# Connect to server2 and use the tables from there
+connection server2;
+flush status;
+select * from t1;
+update t1 set a=3 where a=2;
+show status like 'handler_discover%';
+
+# Create a new table on server2
+create table t3 (a int not null primary key, b varchar(22),
+c int, last_col text) engine=ndb;
+insert into t3 values(1, 'Hi!', 89, 'Longtext column');
+create table t4 (pk int primary key, b int) engine=ndb;
+
+# Check that the tables are accessible from server1
+connection server1;
+select * from t1;
+select * from t3;
+show tables like 't4';
+show tables;
+
+drop table t1, t2, t3, t4;
+connection server2;
+drop table if exists t1, t3, t4;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ndb_partition_error.test b/mysql-test/suite/ndb/t/ndb_partition_error.test
index 9db2a6a6f6d..9db2a6a6f6d 100644
--- a/mysql-test/t/ndb_partition_error.test
+++ b/mysql-test/suite/ndb/t/ndb_partition_error.test
diff --git a/mysql-test/t/ndb_partition_error2-master.opt b/mysql-test/suite/ndb/t/ndb_partition_error2-master.opt
index 955f7692c8b..955f7692c8b 100644
--- a/mysql-test/t/ndb_partition_error2-master.opt
+++ b/mysql-test/suite/ndb/t/ndb_partition_error2-master.opt
diff --git a/mysql-test/t/ndb_partition_error2.test b/mysql-test/suite/ndb/t/ndb_partition_error2.test
index afedd0e3c5c..afedd0e3c5c 100644
--- a/mysql-test/t/ndb_partition_error2.test
+++ b/mysql-test/suite/ndb/t/ndb_partition_error2.test
diff --git a/mysql-test/t/ndb_partition_key.test b/mysql-test/suite/ndb/t/ndb_partition_key.test
index 78e2c9d15c2..78e2c9d15c2 100644
--- a/mysql-test/t/ndb_partition_key.test
+++ b/mysql-test/suite/ndb/t/ndb_partition_key.test
diff --git a/mysql-test/t/ndb_partition_list.test b/mysql-test/suite/ndb/t/ndb_partition_list.test
index ccfcdbc84f4..ccfcdbc84f4 100644
--- a/mysql-test/t/ndb_partition_list.test
+++ b/mysql-test/suite/ndb/t/ndb_partition_list.test
diff --git a/mysql-test/t/ndb_partition_range.test b/mysql-test/suite/ndb/t/ndb_partition_range.test
index 7952ba502d2..7952ba502d2 100644
--- a/mysql-test/t/ndb_partition_range.test
+++ b/mysql-test/suite/ndb/t/ndb_partition_range.test
diff --git a/mysql-test/suite/ndb/t/ndb_read_multi_range.test b/mysql-test/suite/ndb/t/ndb_read_multi_range.test
new file mode 100644
index 00000000000..1965874940b
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_read_multi_range.test
@@ -0,0 +1,340 @@
+-- source include/have_ndb.inc
+-- source include/not_embedded.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2, r1;
+--enable_warnings
+
+#
+# Basic test to see that batching is working
+#
+
+create table t1 (
+ a int primary key,
+ b int not null,
+ c int not null,
+ index(b), unique index using hash(c)
+) engine = ndb;
+insert into t1 values
+ (1,2,1),(2,3,2),(3,4,3),(4,5,4),
+ (5,2,12),(6,3,11),(7,4,10),(8,5,9),
+ (9,2,8),(10,3,7),(11,4,6),(12,5,5);
+
+# batch on primary key
+create table r1 as select * from t1 where a in (2,8,12);
+select * from r1 order by a;
+drop table r1;
+
+# batch on ordered index
+create table r1 as select * from t1 where b in (1,2,5);
+select * from r1 order by a;
+drop table r1;
+
+# batch on unique hash index
+create table r1 as select * from t1 where c in (2,8,12);
+select * from r1 order by a;
+drop table r1;
+
+# batch mixed
+create table r1 as select * from t1 where a in (2,8) or (a > 11) or (a <= 1);
+select * from r1 order by a;
+drop table r1;
+
+# batch on primary key, missing values
+create table r1 as select * from t1 where a in (33,8,12);
+select * from r1 order by a;
+drop table r1;
+create table r1 as select * from t1 where a in (2,33,8,12,34);
+select * from r1 order by a;
+drop table r1;
+
+# batch on ordered index, missing values
+create table r1 as select * from t1 where b in (1,33,5);
+select * from r1 order by a;
+drop table r1;
+select * from t1 where b in (1,33,5) order by a;
+create table r1 as select * from t1 where b in (45,1,33,5,44);
+select * from r1 order by a;
+drop table r1;
+select * from t1 where b in (45,22) order by a;
+
+# batch on unique hash index, missing values
+create table r1 as select * from t1 where c in (2,8,33);
+select * from r1 order by a;
+drop table r1;
+create table r1 as select * from t1 where c in (13,2,8,33,12);
+select * from r1 order by a;
+drop table r1;
+
+select * from t1 where a in (33,8,12) order by a;
+select * from t1 where a in (33,34,35) order by a;
+select * from t1 where a in (2,8) or (a > 11) or (a <= 1) order by a;
+select * from t1 where b in (6,7) or (b <= 5) or (b >= 10) order by b,a;
+select * from t1 where c in (13,2,8,33,12) order by c,a;
+drop table t1;
+
+#
+# Somewhat more complicated
+#
+
+create table t1 (
+ a int not null,
+ b int not null,
+ c int not null,
+ d int not null,
+ e int not null,
+ primary key (a,b,c,d), index (d)
+) engine = ndb;
+
+insert into t1 values
+ (1,2,1,1,1),(2,3,2,3,1),(3,4,3,1,1),(4,5,4,7,1),
+ (5,2,12,12,1),(6,3,11,1,1),(7,4,10,3,1),(8,5,9,5,1),
+ (9,2,8,6,1),(10,3,7,5,1),(11,4,6,3,1),(12,5,5,2,1),
+ (1,2,1,2,1),
+ (1,2,1,3,1),
+ (1,2,1,4,1),
+ (1,2,1,5,1);
+
+# batch on primary key
+create table r1 as select * from t1
+ where a=1 and b=2 and c=1 and d in (1,4,3,2);
+select * from r1 order by a,b,c,d;
+drop table r1;
+
+# batched update ordered index, one value for all
+update t1 set e = 100
+ where d in (12,6,7);
+select * from t1 where d in (12,6,7) order by a,b,c,d;
+select * from t1 where d not in (12,6,7) and e = 100;
+
+# batched update primary key, one value for all
+update t1
+ set e = 101
+ where a=1 and
+ b=2 and
+ c=1 and
+ d in (1,4,3,2);
+select *
+ from t1
+ where a=1 and b=2 and c=1 and d in (1,4,3,2)
+ order by a,b,c,d;
+select *
+ from t1
+ where not (a=1 and b=2 and c=1 and d in (1,4,3,2))
+ and e=101;
+
+
+# batched update ordered index, different values
+update t1
+ set e =
+ (case d
+ when 12 then 112
+ when 6 then 106
+ when 7 then 107
+ end)
+ where d in (12,6,7);
+select * from t1 where d in (12,6,7) order by a,b,c,d;
+
+# batched update primary key, different values
+update t1
+ set e =
+ (case d
+ when 1 then 111
+ when 4 then 444
+ when 3 then 333
+ when 2 then 222
+ end)
+ where a=1 and
+ b=2 and
+ c=1 and
+ d in (1,4,3,2);
+select *
+ from t1
+ where a=1 and b=2 and c=1 and d in (1,4,3,2)
+ order by a,b,c,d;
+
+# batched delete
+delete from t1 where d in (12,6,7);
+select * from t1 where d in (12,6,7);
+
+drop table t1;
+
+# null handling
+create table t1 (
+ a int not null primary key,
+ b int,
+ c int,
+ d int,
+ unique index (b),
+ index(c)
+) engine = ndb;
+
+insert into t1 values
+ (1,null,1,1),
+ (2,2,2,2),
+ (3,null,null,3),
+ (4,4,null,4),
+ (5,null,5,null),
+ (6,6,6,null),
+ (7,null,null,null),
+ (8,8,null,null),
+ (9,null,9,9),
+ (10,10,10,10),
+ (11,null,null,11),
+ (12,12,null,12),
+ (13,null,13,null),
+ (14,14,14,null),
+ (15,null,null,null),
+ (16,16,null,null);
+
+create table t2 as select * from t1 where a in (5,6,7,8,9,10);
+select * from t2 order by a;
+drop table t2;
+
+create table t2 as select * from t1 where b in (5,6,7,8,9,10);
+select * from t2 order by a;
+drop table t2;
+
+create table t2 as select * from t1 where c in (5,6,7,8,9,10);
+select * from t2 order by a;
+drop table t2;
+
+drop table t1;
+
+# bug17729
+
+CREATE TABLE t1 (
+ a int(11) NOT NULL,
+ b int(11) NOT NULL,
+ c datetime default NULL,
+ PRIMARY KEY (a),
+ KEY idx_bc (b,c)
+) ENGINE=ndbcluster;
+
+INSERT INTO t1 VALUES
+(406989,67,'2006-02-23 17:08:46'), (150078,67,'2005-10-26 11:17:45'),
+(406993,67,'2006-02-27 11:20:57'), (245655,67,'2005-12-08 15:59:08'),
+(406994,67,'2006-02-27 11:26:46'), (256,67,NULL),
+(398341,67,'2006-02-20 04:48:44'), (254,67,NULL),(1120,67,NULL),
+(406988,67,'2006-02-23 17:07:22'), (255,67,NULL),
+(398340,67,'2006-02-20 04:38:53'),(406631,67,'2006-02-23 10:49:42'),
+(245653,67,'2005-12-08 15:59:07'),(406992,67,'2006-02-24 16:47:18'),
+(245654,67,'2005-12-08 15:59:08'),(406995,67,'2006-02-28 11:55:00'),
+(127261,67,'2005-10-13 12:17:58'),(406991,67,'2006-02-24 16:42:32'),
+(245652,67,'2005-12-08 15:58:27'),(398545,67,'2006-02-20 04:53:13'),
+(154504,67,'2005-10-28 11:53:01'),(9199,67,NULL),(1,67,'2006-02-23 15:01:35'),
+(223456,67,NULL),(4101,67,NULL),(1133,67,NULL),
+(406990,67,'2006-02-23 18:01:45'),(148815,67,'2005-10-25 15:34:17'),
+(148812,67,'2005-10-25 15:30:01'),(245651,67,'2005-12-08 15:58:27'),
+(154503,67,'2005-10-28 11:52:38');
+
+create table t11 engine = ndbcluster select * from t1 where b = 67 AND (c IS NULL OR c > NOW()) order by 3 asc;
+create table t12 engine = ndbcluster select * from t1 where b = 67 AND (c IS NULL OR c > NOW()) order by 3 desc;
+create table t21 select * from t1 where b = 67 AND (c IS NULL OR c > '2005-12-08') order by 3 asc;
+create table t22 engine = ndbcluster select * from t1 where b = 67 AND (c IS NULL OR c > '2005-12-08') order by 3 desc;
+
+select * from t11 order by 1,2,3;
+select * from t12 order by 1,2,3;
+select * from t21 order by 1,2,3;
+select * from t22 order by 1,2,3;
+
+# join tests
+select t12.a from t11, t12 where t11.a in(255,256) and t11.a = t12.a and t11.c is null order by t12.a;
+
+update t22 set c = '2005-12-08 15:58:27' where a = 255;
+select * from t22 order by 1,2,3;
+select t21.* from t21,t22 where t21.a = t22.a and
+t22.a in (select t12.a from t11, t12 where t11.a in(255,256) and t11.a = t12.a and t11.c is null) and t22.c is null order by t21.a;
+
+delete from t22 where a > 245651;
+update t22 set b = a + 1;
+select * from t22 order by 1,2,3;
+select t21.c, count(*)
+from t21
+inner join t22 using (a)
+where t22.b in (2,256,257,1121,1134,4102,9200,223457,245652)
+group by t21.c
+order by t21.c;
+
+DROP TABLE t1, t11, t12, t21, t22;
+
+# bug#19956
+CREATE TABLE t1 (id varchar(255) NOT NULL,
+ tag int(11) NOT NULL,
+ doc text NOT NULL,
+ type varchar(150) NOT NULL,
+ modified timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (id)
+ ) ENGINE=ndbcluster;
+
+INSERT INTO t1 VALUES ('sakila',1,'Some text goes here','text',CURRENT_TIMESTAMP);
+SELECT id, tag, doc, type FROM t1 WHERE id IN ('flipper','orka');
+SELECT id, tag, doc, type FROM t1 WHERE id IN ('flipper','sakila');
+
+DROP TABLE t1;
+
+#bug#25522
+CREATE TABLE t1 (
+ var1 int(2) NOT NULL,
+ var2 int(2) NOT NULL,
+ PRIMARY KEY (var1)
+ ) ENGINE=ndbcluster DEFAULT CHARSET=ascii CHECKSUM=1;
+
+
+CREATE TABLE t2 (
+ var1 int(2) NOT NULL,
+ var2 int(2) NOT NULL,
+ PRIMARY KEY (var1)
+ ) ENGINE=ndbcluster DEFAULT CHARSET=ascii CHECKSUM=1;
+
+
+DELIMITER |;
+CREATE TRIGGER testtrigger
+ AFTER UPDATE ON t1 FOR EACH ROW BEGIN
+ REPLACE INTO t2 SELECT * FROM t1 WHERE t1.var1 = NEW.var1;END|
+DELIMITER ;|
+
+INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
+
+UPDATE t1 SET var2 = 9 WHERE var1 IN(1,2,3);
+
+DROP TRIGGER testtrigger;
+
+DROP TABLE t1, t2;
+
+#bug#25821
+create table t1 (a int, b int, primary key (a), key ab (a,b)) engine=ndbcluster;
+
+insert into t1 values (1,1), (10,10);
+
+select * from t1 use index (ab) where a in(1,10) order by a;
+
+create table t2 (a int, b int, primary key (a,b)) engine=ndbcluster
+partition by key(a);
+
+insert into t2 values (1,1), (10,10);
+
+select * from t2 where a in (1,10) order by a;
+drop table t1, t2;
+
+#bug#30337
+
+create table t1 (id int primary key) engine ndb;
+insert into t1 values (1), (2), (3);
+
+create table t2 (id int primary key) engine ndb;
+insert into t2 select id from t1;
+
+delimiter |;
+create trigger kaboom after delete on t1
+for each row begin
+ delete from t2 where id=old.id;
+end|
+delimiter ;|
+
+select * from t1 order by id;
+delete from t1 where id in (1,2);
+select * from t2 order by id;
+
+drop trigger kaboom;
+drop table t1;
diff --git a/mysql-test/t/ndb_rename.test b/mysql-test/suite/ndb/t/ndb_rename.test
index 7f9fd0e6984..7f9fd0e6984 100644
--- a/mysql-test/t/ndb_rename.test
+++ b/mysql-test/suite/ndb/t/ndb_rename.test
diff --git a/mysql-test/suite/ndb/t/ndb_replace.test b/mysql-test/suite/ndb/t/ndb_replace.test
new file mode 100644
index 00000000000..aa2072b98dd
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_replace.test
@@ -0,0 +1,104 @@
+-- source include/have_ndb.inc
+-- source include/not_embedded.inc
+
+#
+# Test of REPLACE with NDB
+#
+
+--disable_warnings
+drop table if exists t1,t2;
+--enable_warnings
+
+CREATE TABLE t1 (
+ gesuchnr int(11) DEFAULT '0' NOT NULL,
+ benutzer_id int(11) DEFAULT '0' NOT NULL,
+ PRIMARY KEY (gesuchnr,benutzer_id)
+) engine=ndbcluster;
+
+replace into t1 (gesuchnr,benutzer_id) values (2,1);
+replace into t1 (gesuchnr,benutzer_id) values (1,1);
+replace into t1 (gesuchnr,benutzer_id) values (1,1);
+insert into t1 (gesuchnr, benutzer_id) value (3,2);
+replace into t1 (gesuchnr,benutzer_id) values (1,1);
+replace into t1 (gesuchnr,benutzer_id) values (1,1);
+--error ER_DUP_ENTRY
+insert into t1 (gesuchnr,benutzer_id) values (1,1);
+replace into t1 (gesuchnr,benutzer_id) values (1,1);
+select * from t1 order by gesuchnr;
+drop table t1;
+
+# End of 4.1 tests
+
+# bug#17431
+CREATE TABLE t1(i INT PRIMARY KEY AUTO_INCREMENT,
+ j INT,
+ k INT,
+ UNIQUE INDEX(j)
+ ) ENGINE = ndb;
+INSERT INTO t1 VALUES (1,1,23),(2,2,24);
+REPLACE INTO t1 (j,k) VALUES (1,42);
+REPLACE INTO t1 (i,j) VALUES (17,2);
+SELECT * from t1 ORDER BY i;
+DROP TABLE t1;
+
+# bug#19906
+CREATE TABLE t2 (a INT(11) NOT NULL,
+ b INT(11) NOT NULL,
+ c INT(11) NOT NULL,
+ x TEXT,
+ y TEXT,
+ z TEXT,
+ id INT(10) unsigned NOT NULL AUTO_INCREMENT,
+ i INT(11) DEFAULT NULL,
+ PRIMARY KEY (id),
+ UNIQUE KEY a (a,b,c)
+) ENGINE=ndbcluster;
+
+REPLACE INTO t2 (a,b,c,x,y,z,i) VALUES (1,1,1,'a','a','a',1),(1,1,1,'b','b','b',2), (1,1,1,'c','c','c',3);
+
+SELECT * FROM t2 ORDER BY id;
+
+REPLACE INTO t2(a,b,c,x,y,z,i) values (1,1,1,'a','a','a',1);
+REPLACE INTO t2(a,b,c,x,y,z,i) values (1,1,1,'b','b','b',2);
+
+SELECT * FROM t2 ORDER BY id;
+
+DROP TABLE t2;
+
+#
+# Bug #20728 "REPLACE does not work correctly for NDB table with PK and
+# unique index"
+#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (pk int primary key, apk int unique, data int) engine=ndbcluster;
+# Test for plain replace which updates pk
+insert into t1 values (1, 1, 1), (2, 2, 2), (3, 3, 3);
+replace into t1 (pk, apk) values (4, 1), (5, 2);
+select * from t1 order by pk;
+delete from t1;
+# Another test for plain replace which doesn't touch pk
+insert into t1 values (1, 1, 1), (2, 2, 2), (3, 3, 3);
+replace into t1 (pk, apk) values (1, 4), (2, 5);
+select * from t1 order by pk;
+delete from t1;
+# Test for load data replace which updates pk
+insert into t1 values (1, 1, 1), (4, 4, 4), (6, 6, 6);
+load data infile '../std_data_ln/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (pk, apk);
+select * from t1 order by pk;
+delete from t1;
+# Now test for load data replace which doesn't touch pk
+insert into t1 values (1, 1, 1), (3, 3, 3), (5, 5, 5);
+load data infile '../std_data_ln/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (pk, apk);
+select * from t1 order by pk;
+delete from t1;
+# Finally test for both types of replace ... select
+insert into t1 values (1, 1, 1), (2, 2, 2), (3, 3, 3);
+replace into t1 (pk, apk) select 4, 1;
+replace into t1 (pk, apk) select 2, 4;
+select * from t1 order by pk;
+# Clean-up
+drop table t1;
+
+--echo End of 5.0 tests.
diff --git a/mysql-test/suite/ndb/t/ndb_restore.test b/mysql-test/suite/ndb/t/ndb_restore.test
new file mode 100644
index 00000000000..18efa66ebe0
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_restore.test
@@ -0,0 +1,408 @@
+-- source include/have_ndb.inc
+-- source include/ndb_default_cluster.inc
+-- source include/not_embedded.inc
+
+--disable_warnings
+use test;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
+drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
+--enable_warnings
+
+# Bug #27775 - mediumint auto inc not restored correctly
+# - check mediumint
+CREATE TABLE `t1_c` (
+ `capgoaledatta` mediumint(5) unsigned NOT NULL auto_increment,
+ `goaledatta` char(2) NOT NULL default '',
+ `maturegarbagefa` varchar(32) NOT NULL default '',
+ PRIMARY KEY (`capgoaledatta`,`goaledatta`,`maturegarbagefa`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
+INSERT INTO `t1_c` VALUES (2,'3','q3plus.qt'),(400,'4','q3plus.qt'),(1,'3','q3.net'),(3,'4','q3.net'),(3000,'20','threetrees.qt');
+#
+# Bug #27758 Restoring NDB backups makes table usable in SQL nodes
+# - space in key made table unusable after restore
+#
+# Bug #27775 - mediumint auto inc not restored correctly
+# - check smallint
+CREATE TABLE `t2_c` (
+ `capgotod` smallint(5) unsigned NOT NULL auto_increment,
+ `gotod` smallint(5) unsigned NOT NULL default '0',
+ `goaledatta` char(2) default NULL,
+ `maturegarbagefa` varchar(32) default NULL,
+ `descrpooppo` varchar(64) default NULL,
+ `svcutonsa` varchar(64) NOT NULL default '',
+ PRIMARY KEY (`capgotod`),
+ KEY `i quadaddsvr` (`gotod`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
+INSERT INTO `t2_c` VALUES (500,4,'','q3.net','addavp:MK_CASELECTOR=1','postorod rattoaa'),(2,1,'4','','addavp:MK_BRANDTAD=345','REDS Brandtad'),(3,2,'4','q3.net','execorder','fixedRatediPO REDS'),(1,1,'3','','addavp:MK_BRANDTAD=123','TEST Brandtad'),(6,5,'','told.q3.net','addavp:MK_BRANDTAD=123','Brandtad Toldzone'),(4,3,'3','q3.net','addavp:MK_POOLHINT=2','ratedi PO TEST'),(5,0,'',NULL,NULL,'');
+
+# Added ROW_FORMAT=FIXED to use below to see that setting is preserved
+# by restore
+CREATE TABLE `t3_c` (
+ `CapGoaledatta` smallint(5) unsigned NOT NULL default '0',
+ `capgotod` smallint(5) unsigned NOT NULL default '0',
+ PRIMARY KEY (`capgotod`,`CapGoaledatta`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED;
+INSERT INTO `t3_c` VALUES (5,3),(2,4),(5,4),(1,3);
+
+# Bug #27775 - mediumint auto inc not restored correctly
+# - check bigint
+CREATE TABLE `t4_c` (
+ `capfa` bigint(20) unsigned NOT NULL auto_increment,
+ `realm` varchar(32) NOT NULL default '',
+ `authpwchap` varchar(32) default NULL,
+ `fa` varchar(32) NOT NULL default '',
+ `payyingatta` tinyint(4) NOT NULL default '0',
+ `status` char(1) default NULL,
+ PRIMARY KEY (`fa`,`realm`),
+ KEY `capfa` (`capfa`),
+ KEY `i_quadentity` (`fa`,`realm`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
+INSERT INTO `t4_c` VALUES (18,'john.smith','q3.net','dessjohn.smith',0,NULL),(21,'quad_katt_with_brandtad','q3.net','acne',0,NULL),(2200,'quad_katt_carattoaa','q3.net','acne',0,NULL),(26,'436462612809','sqasdt.q3.net','N/A',0,'6'),(19,'john','smith.qt','dessjohn',0,NULL),(33,'436643196120','sqasdt.q3.net','N/A',1,'6'),(28,'436642900019','sqasdt.q3.net','N/A',0,'6'),(30,'436462900209','sqasdt.q3.net','N/A',0,'6'),(16,'436640006666','sqasdt.q3.net','',0,NULL),(19,'dette','el-redun.com','dessdette',0,NULL),(12,'quad_kattPP','q3.net','acne',2,NULL),(14,'436640008888','sqasdt.q3.net','',0,NULL),(29,'463624900028','sqasdt.q3.net','N/A',0,'6'),(15,'436640099099','sqasdt.q3.net','',0,NULL),(13,'pap','q3plus.qt','acne',1,NULL),(19,'436642612091','sqasdt.q3.net','N/A',0,'6'),(12,'quad_katt','q3.net','acne',0,NULL),(11,'quad_kattVK','q3.net','acne',1,NULL),(32000,'463641969502','sqasdt.q3.net','N/A',1,'6'),(20,'joe','q3.net','joedesswd',0,NULL),(290000000,'436642900034','sqasdt.q3.net','N/A',0,'6'),(25,'contind','armerde.qt','acne',1,NULL);
+
+CREATE TABLE `t5_c` (
+ `capfa` bigint(20) unsigned NOT NULL default '0',
+ `gotod` smallint(5) unsigned NOT NULL default '0',
+ `orderutonsa` varchar(64) NOT NULL default '',
+ PRIMARY KEY (`capfa`,`gotod`,`orderutonsa`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
+INSERT INTO `t5_c` VALUES (21,2,''),(21,1,''),(22,4,'');
+
+CREATE TABLE `t6_c` (
+ `capfa_parent` bigint(20) unsigned NOT NULL default '0',
+ `capfa_child` bigint(20) unsigned NOT NULL default '0',
+ `relatta` smallint(5) unsigned NOT NULL default '0',
+ PRIMARY KEY (`capfa_child`,`capfa_parent`,`relatta`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
+INSERT INTO `t6_c` VALUES (15,16,0),(19,20,0),(18326932092909551615,30,0),(26,29,0),(18326932092909551615,29,0),(19,18,0),(26,28,0),(12,14,0);
+
+# Bug #27775 - mediumint auto inc not restored correctly
+# - check tinyint
+CREATE TABLE `t7_c` (
+ `dardpo` char(15) NOT NULL default '',
+ `dardtestard` tinyint(3) unsigned NOT NULL auto_increment,
+ `FastFA` char(5) NOT NULL default '',
+ `FastCode` char(6) NOT NULL default '',
+ `Fastca` char(1) NOT NULL default '',
+ `Fastmag` char(1) NOT NULL default '',
+ `Beareratta` char(2) NOT NULL default '',
+ PRIMARY KEY (`dardpo`,`dardtestard`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
+INSERT INTO `t7_c` VALUES ('2.6.2.4',24,'CECHP','54545','0','0','5'),('2.2.5.4',26,'CANFA','33223','1','1','4'),('4.3.2.4',28,'ITALD','54222','1','0','5'),('129..0.0.eins',28,'G','99999','1','1','5'),('1.1.1.1',24,'AUTPT','32323','0','1','3');
+
+CREATE TABLE `t8_c` (
+ `kattjame` varchar(32) NOT NULL default '',
+ `realm` varchar(32) NOT NULL default '',
+ `realm_entered` varchar(32) NOT NULL default '',
+ `maturegarbagefa` varchar(32) NOT NULL default '',
+ `hunderaaarbagefa_parent` varchar(32) NOT NULL default '',
+ `kattjame_entered` varchar(32) NOT NULL default '',
+ `hunderaaarbagefa` varchar(32) NOT NULL default '',
+ `gest` varchar(16) default NULL,
+ `hassetino` varchar(16) NOT NULL default '',
+ `aaaproxysessfa` varchar(255) default NULL,
+ `autologonallowed` char(1) default NULL,
+ `squardporoot` varchar(15) NOT NULL default '',
+ `naspo` varchar(15) default NULL,
+ `beareratta` char(2) default NULL,
+ `fastCode` varchar(6) default NULL,
+ `fastFA` varchar(5) default NULL,
+ `fastca` char(1) default NULL,
+ `fastmag` char(1) default NULL,
+ `lastupdate` datetime default NULL,
+ `hassetistart` datetime NOT NULL default '0000-00-00 00:00:00',
+ `accthassetitime` int(10) unsigned default NULL,
+ `acctoutputoctets` bigint(20) unsigned default NULL,
+ `acctinputoctets` bigint(20) unsigned default NULL,
+ PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`),
+ KEY `squardporoot` (`squardporoot`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
+INSERT INTO `t8_c` VALUES ('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643196120','436643196929','8956234534568968','5524595699','uxasmt21.net.acne.qt/481889229462692422','','1.1.1.1','2.2.4.6','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565),('4545435545','john','q3.net','q3.net','acne.li','436643196120','436643196929','45345234568968','995696699','uxasmt21.net.acne.qt/481889229462692423','','1.1.1.1','2.2.9.8','2','86989','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8821923,169,3565),('versteckter_q3net_katt','joe','q3.net','elredun.com','q3.net','436643196120','436643196939','91341234568968','695595699','uxasmt21.net.acne.qt/481889229462692421','','1.1.1.1','2.5.2.5','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',1923123,9569,6565);
+
+CREATE TABLE `t9_c` (
+ `kattjame` varchar(32) NOT NULL default '',
+ `kattjame_entered` varchar(32) NOT NULL default '',
+ `realm` varchar(32) NOT NULL default '',
+ `realm_entered` varchar(32) NOT NULL default '',
+ `maturegarbagefa` varchar(32) NOT NULL default '',
+ `hunderaaarbagefa` varchar(32) NOT NULL default '',
+ `hunderaaarbagefa_parent` varchar(32) NOT NULL default '',
+ `gest` varchar(16) default NULL,
+ `hassetino` varchar(16) NOT NULL default '',
+ `squardporoot` varchar(15) NOT NULL default '',
+ `naspo` varchar(15) default NULL,
+ `beareratta` char(2) default NULL,
+ `fastCode` varchar(6) default NULL,
+ `fastFA` varchar(5) default NULL,
+ `fastca` char(1) default NULL,
+ `fastmag` char(1) default NULL,
+ `lastupdate` datetime default NULL,
+ `hassetistart` datetime NOT NULL default '0000-00-00 00:00:00',
+ `accthassetitime` int(10) unsigned default NULL,
+ `actcoutpuocttets` bigint(20) unsigned default NULL,
+ `actinputocctets` bigint(20) unsigned default NULL,
+ `terminateraste` tinyint(3) unsigned default NULL,
+ PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
+INSERT INTO `t9_c` VALUES ('3g4jh8gar2t','joe','q3.net','elredun.com','q3.net','436643316120','436643316939','91341234568968','695595699','1.1.1.1','2.2.6.2','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',3123123,9569,6565,1),('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643316120','436643316939','8956234534568968','5254595969','1.1.1.1','8.6.2.2','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565,2),('4545435545','john','q3.net','q3.net','acne.li','436643316120','436643316939','45345234568968','995696699','1.1.1.1','2.9.9.2','2','86998','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8823123,169,3565,3);
+
+# Bug #20820
+# auto inc table not handled correctly when restored from cluster backup
+# - before fix ndb_restore would not set auto inc value correct,
+# seen by select below
+CREATE TABLE t10_c (a INT AUTO_INCREMENT KEY) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
+INSERT INTO t10_c VALUES (1),(2),(3);
+# Bug #27775 - mediumint auto inc not restored correctly
+# - check int
+insert into t10_c values (10000),(2000),(3000);
+
+create table t1 engine=myisam as select * from t1_c;
+create table t2 engine=myisam as select * from t2_c;
+create table t3 engine=myisam as select * from t3_c;
+create table t4 engine=myisam as select * from t4_c;
+create table t5 engine=myisam as select * from t5_c;
+create table t6 engine=myisam as select * from t6_c;
+create table t7 engine=myisam as select * from t7_c;
+create table t8 engine=myisam as select * from t8_c;
+create table t9 engine=myisam as select * from t9_c;
+create table t10 engine=myisam as select * from t10_c;
+
+# check that force varpart is preserved by ndb_restore
+# t3_c has ROW_FORMAT=FIXED i.e. ForceVarPart=0
+--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t3_c | grep ForceVarPart
+--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t2_c | grep ForceVarPart
+
+--source include/ndb_backup.inc
+drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b $the_backup_id -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+# check that force varpart is preserved by ndb_restore
+# t3_c has ROW_FORMAT=FIXED i.e. ForceVarPart=0
+--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t3_c | grep ForceVarPart
+--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t2_c | grep ForceVarPart
+
+# Bug #30667
+# ndb table discovery does not work correcly with information schema
+# - prior to bug fix this would yeild no output and a warning
+select * from information_schema.columns where table_name = "t1_c";
+
+# random output order??
+#show tables;
+
+select count(*) from t1;
+select count(*) from t1_c;
+select count(*)
+ from (select * from t1 union
+ select * from t1_c) a;
+
+select count(*) from t2;
+select count(*) from t2_c;
+select count(*)
+ from (select * from t2 union
+ select * from t2_c) a;
+
+select count(*) from t3;
+select count(*) from t3_c;
+select count(*)
+ from (select * from t3 union
+ select * from t3_c) a;
+
+select count(*) from t4;
+select count(*) from t4_c;
+select count(*)
+ from (select * from t4 union
+ select * from t4_c) a;
+
+select count(*) from t5;
+select count(*) from t5_c;
+select count(*)
+ from (select * from t5 union
+ select * from t5_c) a;
+
+select count(*) from t6;
+select count(*) from t6_c;
+select count(*)
+ from (select * from t6 union
+ select * from t6_c) a;
+
+select count(*) from t7;
+select count(*) from t7_c;
+select count(*)
+ from (select * from t7 union
+ select * from t7_c) a;
+
+select count(*) from t8;
+select count(*) from t8_c;
+select count(*)
+ from (select * from t8 union
+ select * from t8_c) a;
+
+select count(*) from t9;
+select count(*) from t9_c;
+select count(*)
+ from (select * from t9 union
+ select * from t9_c) a;
+
+# Bug #20820 cont'd
+select * from t10_c order by a;
+# Bug #27775 cont'd
+# - auto inc info should be correct
+--replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X
+show table status like 't1_c';
+--replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X
+show table status like 't2_c';
+--replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X
+show table status like 't4_c';
+--replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X
+show table status like 't7_c';
+--replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X
+show table status like 't10_c';
+
+#
+# Try Partitioned tables as well
+#
+ALTER TABLE t7_c
+PARTITION BY LINEAR KEY (`dardtestard`);
+
+--source include/ndb_backup.inc
+drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b $the_backup_id -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+
+select count(*) from t1;
+select count(*) from t1_c;
+select count(*)
+ from (select * from t1 union
+ select * from t1_c) a;
+
+select count(*) from t2;
+select count(*) from t2_c;
+select count(*)
+ from (select * from t2 union
+ select * from t2_c) a;
+
+select count(*) from t3;
+select count(*) from t3_c;
+select count(*)
+ from (select * from t3 union
+ select * from t3_c) a;
+
+select count(*) from t4;
+select count(*) from t4_c;
+select count(*)
+ from (select * from t4 union
+ select * from t4_c) a;
+
+select count(*) from t5;
+select count(*) from t5_c;
+select count(*)
+ from (select * from t5 union
+ select * from t5_c) a;
+
+select count(*) from t6;
+select count(*) from t6_c;
+select count(*)
+ from (select * from t6 union
+ select * from t6_c) a;
+
+select count(*) from t7;
+select count(*) from t7_c;
+select count(*)
+ from (select * from t7 union
+ select * from t7_c) a;
+
+select count(*) from t8;
+select count(*) from t8_c;
+select count(*)
+ from (select * from t8 union
+ select * from t8_c) a;
+
+select count(*) from t9;
+select count(*) from t9_c;
+select count(*)
+ from (select * from t9 union
+ select * from t9_c) a;
+
+drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b $the_backup_id -n 1 -m -r --ndb-nodegroup_map '(0,0)' --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b $the_backup_id -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+
+select count(*) from t1;
+select count(*) from t1_c;
+select count(*)
+ from (select * from t1 union
+ select * from t1_c) a;
+
+select count(*) from t2;
+select count(*) from t2_c;
+select count(*)
+ from (select * from t2 union
+ select * from t2_c) a;
+
+select count(*) from t3;
+select count(*) from t3_c;
+select count(*)
+ from (select * from t3 union
+ select * from t3_c) a;
+
+select count(*) from t4;
+select count(*) from t4_c;
+select count(*)
+ from (select * from t4 union
+ select * from t4_c) a;
+
+select count(*) from t5;
+select count(*) from t5_c;
+select count(*)
+ from (select * from t5 union
+ select * from t5_c) a;
+
+select count(*) from t6;
+select count(*) from t6_c;
+select count(*)
+ from (select * from t6 union
+ select * from t6_c) a;
+
+select count(*) from t7;
+select count(*) from t7_c;
+select count(*)
+ from (select * from t7 union
+ select * from t7_c) a;
+
+select count(*) from t8;
+select count(*) from t8_c;
+select count(*)
+ from (select * from t8 union
+ select * from t8_c) a;
+
+select count(*) from t9;
+select count(*) from t9_c;
+select count(*)
+ from (select * from t9 union
+ select * from t9_c) a;
+
+#
+# Drop all table except t2_c
+# This to make sure that error returned from ndb_restore above is
+# guaranteed to be from t2_c, this since order of tables in backup
+# is none deterministic
+#
+drop table t1_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
+--source include/ndb_backup.inc
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --core=0 -b $the_backup_id -n 1 -m -r --ndb-nodegroup_map '(0,1)' $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id 2>&1 | grep Translate || true
+
+#
+# Cleanup
+#
+
+--disable_warnings
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
+drop table if exists t2_c;
+--enable_warnings
+
+#
+# Test BUG#10287
+#
+
+--exec $NDB_TOOLS_DIR/ndb_select_all --no-defaults -d sys -D , SYSTAB_0 | grep 520093696, | sed "s/,$the_backup_id/,<the_backup_id>/"
+
+# End of 5.0 tests (4.1 test intermixed to save test time)
diff --git a/mysql-test/suite/ndb/t/ndb_restore_compat.test b/mysql-test/suite/ndb/t/ndb_restore_compat.test
new file mode 100644
index 00000000000..8e5b30aa6fd
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_restore_compat.test
@@ -0,0 +1,67 @@
+-- source include/have_ndb.inc
+-- source include/not_embedded.inc
+-- source include/have_case_sensitive_file_system.inc
+
+# This test currently requires case sensitive file system as the tables
+# are originally stored with uppercase
+
+#
+# Bug #18594 ndb_restore log boken in 5.1
+#
+
+--disable_warnings
+DROP DATABASE IF EXISTS BANK;
+--enable_warnings
+CREATE DATABASE BANK default charset=latin1 default collate=latin1_bin;
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 1 -n 1 -p 1 -m -r $MYSQL_TEST_DIR/std_data/ndb_backup51 >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -e -b 1 -n 2 -p 1 -r $MYSQL_TEST_DIR/std_data/ndb_backup51 >> $NDB_TOOLS_OUTPUT
+USE BANK;
+SHOW TABLES;
+SELECT * FROM GL ORDER BY TIME,ACCOUNT_TYPE;
+SELECT * FROM ACCOUNT ORDER BY ACCOUNT_ID;
+SELECT COUNT(*) FROM TRANSACTION;
+SELECT * FROM SYSTEM_VALUES ORDER BY SYSTEM_VALUES_ID;
+SELECT * FROM mysql.ndb_apply_status WHERE server_id=0;
+
+# Check that force varpart is set by ndb_restore
+--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK GL | grep ForceVarPart
+--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK ACCOUNT | grep ForceVarPart
+--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK TRANSACTION | grep ForceVarPart
+--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK SYSTEM_VALUES | grep ForceVarPart
+--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK ACCOUNT_TYPE | grep ForceVarPart
+
+#
+# verify restore of 5.0 backup
+# here we must use the already created tables as restoring the old
+# table definitions will not work
+#
+TRUNCATE GL;
+TRUNCATE ACCOUNT;
+TRUNCATE TRANSACTION;
+TRUNCATE SYSTEM_VALUES;
+TRUNCATE ACCOUNT_TYPE;
+
+# Check that force varpart is not changed by truncate
+--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK GL | grep ForceVarPart
+--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK ACCOUNT | grep ForceVarPart
+--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK TRANSACTION | grep ForceVarPart
+--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK SYSTEM_VALUES | grep ForceVarPart
+--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK ACCOUNT_TYPE | grep ForceVarPart
+
+# Restore data
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 1 -n 1 -p 1 -r $MYSQL_TEST_DIR/std_data/ndb_backup50 >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -e -b 1 -n 2 -p 1 -r $MYSQL_TEST_DIR/std_data/ndb_backup50 >> $NDB_TOOLS_OUTPUT
+
+# Check data
+SELECT * FROM GL ORDER BY TIME,ACCOUNT_TYPE;
+SELECT * FROM ACCOUNT ORDER BY ACCOUNT_ID;
+SELECT COUNT(*) FROM TRANSACTION;
+SELECT * FROM SYSTEM_VALUES ORDER BY SYSTEM_VALUES_ID;
+SELECT * FROM mysql.ndb_apply_status WHERE server_id=0;
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 2 -n 1 -m -p 1 -s -r $MYSQL_TEST_DIR/std_data/ndb_backup50 >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 2 -n 2 -p 1 -s -r $MYSQL_TEST_DIR/std_data/ndb_backup50 >> $NDB_TOOLS_OUTPUT
+SELECT * FROM DESCRIPTION ORDER BY USERNAME;
+--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK DESCRIPTION | grep SHORT_VAR
+--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK DESCRIPTION | grep MEDIUM_VAR
+
+DROP DATABASE BANK;
diff --git a/mysql-test/suite/ndb/t/ndb_restore_different_endian_data.test b/mysql-test/suite/ndb/t/ndb_restore_different_endian_data.test
new file mode 100644
index 00000000000..069796f43c4
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_restore_different_endian_data.test
@@ -0,0 +1,185 @@
+-- source include/have_ndb.inc
+-- source include/ndb_default_cluster.inc
+-- source include/not_embedded.inc
+
+#
+# Bug #27543 restore of backup from different endian does not work for blob column
+# Bug #30024 restore of backup from different endian does not work for datetime column
+# Bug #28674 backup will run forever if disk full and later write succes will kill ndb node
+#
+# The table structure and data list below
+#
+# CREATE TABLE t_num (
+# t_pk INT PRIMARY KEY,
+# t_bit BIT(64),
+# t_tinyint TINYINT,
+# t_bool BOOL,
+# t_smallint SMALLINT,
+# t_mediumint MEDIUMINT,
+# t_int INT,
+# t_bigint BIGINT,
+# t_float FLOAT,
+# t_double DOUBLE,
+# t_decimal DECIMAL (37, 16)
+# ) ENGINE=NDBCLUSTER;
+#
+# INSERT INTO t_num VALUE (
+# 1,
+# b'1010101010101010101010101010101010101010101010101010101010101010',
+# 125,
+# 1,
+# 32765,
+# 8388606,
+# 2147483647,
+# 9223372036854775807,
+# 1e+20,
+# 1e+150,
+# '331.0000000000'
+# );
+#
+# CREATE TABLE t_datetime (
+# t_pk INT PRIMARY KEY,
+# t_date DATE,
+# t_datetime DATETIME,
+# t_timestamp TIMESTAMP,
+# t_time TIME,
+# t_year YEAR
+# ) ENGINE=NDBCLUSTER;
+#
+# INSERT INTO t_datetime VALUE (
+# 1,
+# '1998-01-01',
+# '2006-08-10 10:11:12',
+# 20021029165106,
+# '19:38:34',
+# 2155
+# );
+#
+# CREATE TABLE t_string_1 (
+# t_pk INT PRIMARY KEY,
+# t_char CHAR(255),
+# t_varchar VARCHAR(655),
+# t_binary BINARY(255),
+# t_varbinary VARBINARY(6553)
+# ) ENGINE=NDBCLUSTER;
+#
+# CREATE TABLE t_string_2 (
+# t_pk INT PRIMARY KEY,
+# t_tinyblob TINYBLOB,
+# t_tinytext TINYTEXT,
+# t_blob BLOB,
+# t_text TEXT,
+# t_mediumblob MEDIUMBLOB,
+# t_mediumtext MEDIUMTEXT,
+# t_longblob LONGBLOB,
+# t_longtext LONGTEXT,
+# t_enum ENUM('001001','001004','001010','001018','001019','001020','001021','001027','001028','001029','001030','001031','001100','002003','002004','002005','002007')DEFAULT '001001' NOT NULL,
+# t_set SET('a','B')
+# ) ENGINE=NDBCLUSTER;
+#
+# INSERT INTO t_string_1 VALUE (
+# 1,
+# 'abcdefghijklmn',
+# 'abcdefghijklmnabcdefghijklmnabcdefghijklmnabcdefghijklmn',
+# 0x612020,
+# 0x4100
+# );
+#
+# INSERT INTO t_string_2 VALUE (
+# 1,
+# 'abcdefghijklmnabcdefghijklmn',
+# 'abcdefghijklmnabcdefghijklmn',
+# 'a123456789b123456789c123456789d123456789e123456789f123456789g123456789',
+# 'a123456789b123456789c123456789d123456789e123456789f123456789g123456789',
+# 'a123456789b123456789c123456789d123456789e123456789f123456789g123456789',
+# 'a123456789b123456789c123456789d123456789e123456789f123456789g123456789',
+# 'a123456789b123456789c123456789d123456789e123456789f123456789g123456789',
+# 'a123456789b123456789c123456789d123456789e123456789f123456789g123456789',
+# '001001',
+# 'a'
+# );
+#
+# CREATE TABLE t_gis (
+# t_pk INT PRIMARY KEY,
+# t_point POINT,
+# t_linestring LINESTRING,
+# t_polygon POLYGON,
+# t_multipoint MULTIPOINT,
+# t_multilinestring MULTILINESTRING,
+# t_multipolygon MULTIPOLYGON,
+# t_geometrycollection GEOMETRYCOLLECTION,
+# t_geometry GEOMETRY
+# ) ENGINE=NDBCLUSTER;
+#
+# INSERT INTO t_gis VALUE (
+# 1,
+# PointFromText('POINT(10 10)'),
+# LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)'),
+# PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))'),
+# MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)'),
+# MLineFromText('MULTILINESTRING((10 48,10 21,10 0))'),
+# MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))'),
+# GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))'),
+# MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')
+# );
+#
+# INSERT INTO t_gis VALUE (
+# 2,
+# PointFromWKB(AsWKB(PointFromText('POINT(10 20)'))),
+# LineStringFromWKB(LineString(Point(10, 10), Point(40, 10))),
+# PolyFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))),
+# MPointFromWKB(MultiPoint(Point(3, 6), Point(4, 10))),
+# MLineFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))),
+# MPolyFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))),
+# GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))),
+# GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9))))
+# );
+
+
+
+#
+# Restore backup files (from little endian)
+#
+
+--disable_warnings
+USE test;
+DROP TABLE IF EXISTS t_num,t_datetime,t_string_1,t_string_2,t_gis;
+--enable_warnings
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 1 -n 1 -m -r $MYSQL_TEST_DIR/std_data/ndb_backup51_data_le >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 1 -n 2 -r $MYSQL_TEST_DIR/std_data/ndb_backup51_data_le >> $NDB_TOOLS_OUTPUT
+SHOW TABLES;
+SHOW CREATE TABLE t_num;
+SHOW CREATE TABLE t_datetime;
+SHOW CREATE TABLE t_string_1;
+SHOW CREATE TABLE t_string_2;
+SHOW CREATE TABLE t_gis;
+SELECT * FROM t_datetime;
+SELECT t_pk,hex(t_bit),t_tinyint,t_bool,t_smallint,t_mediumint,t_int,t_bigint,t_float,t_double,t_decimal FROM t_num;
+SELECT t_pk,t_char,t_varchar,hex(t_binary),hex(t_varbinary) FROM t_string_1;
+SELECT * FROM t_string_2;
+SELECT AsText(t_point), AsText(t_linestring),AsText(t_polygon) FROM t_gis ORDER by t_pk;
+SELECT AsText(t_multipoint), AsText(t_multilinestring),AsText(t_multipolygon) FROM t_gis ORDER by t_pk;
+SELECT AsText(t_geometrycollection), AsText(t_geometry) FROM t_gis ORDER by t_pk;
+
+#
+# Restore backup files (from big endian)
+#
+
+DROP TABLE t_num,t_datetime,t_string_1,t_string_2,t_gis;
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 1 -n 1 -m -r $MYSQL_TEST_DIR/std_data/ndb_backup51_data_be >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 1 -n 2 -r $MYSQL_TEST_DIR/std_data/ndb_backup51_data_be >> $NDB_TOOLS_OUTPUT
+SHOW TABLES;
+SHOW CREATE TABLE t_num;
+SHOW CREATE TABLE t_datetime;
+SHOW CREATE TABLE t_string_1;
+SHOW CREATE TABLE t_string_2;
+SHOW CREATE TABLE t_gis;
+SELECT * FROM t_datetime;
+SELECT t_pk,hex(t_bit),t_tinyint,t_bool,t_smallint,t_mediumint,t_int,t_bigint,t_float,t_double,t_decimal FROM t_num;
+SELECT t_pk,t_char,t_varchar,hex(t_binary),hex(t_varbinary) FROM t_string_1;
+SELECT * FROM t_string_2;
+SELECT AsText(t_point), AsText(t_linestring),AsText(t_polygon) FROM t_gis ORDER by t_pk;
+SELECT AsText(t_multipoint), AsText(t_multilinestring),AsText(t_multipolygon) FROM t_gis ORDER by t_pk;
+SELECT AsText(t_geometrycollection), AsText(t_geometry) FROM t_gis ORDER by t_pk;
+
+DROP TABLE t_num,t_datetime,t_string_1,t_string_2,t_gis;
diff --git a/mysql-test/t/ndb_restore_partition-master.opt b/mysql-test/suite/ndb/t/ndb_restore_partition-master.opt
index 075c6392dde..075c6392dde 100644
--- a/mysql-test/t/ndb_restore_partition-master.opt
+++ b/mysql-test/suite/ndb/t/ndb_restore_partition-master.opt
diff --git a/mysql-test/t/ndb_restore_partition.test b/mysql-test/suite/ndb/t/ndb_restore_partition.test
index f11324492c2..f11324492c2 100644
--- a/mysql-test/t/ndb_restore_partition.test
+++ b/mysql-test/suite/ndb/t/ndb_restore_partition.test
diff --git a/mysql-test/t/ndb_restore_print.test b/mysql-test/suite/ndb/t/ndb_restore_print.test
index 6dbbfdf5933..6dbbfdf5933 100644
--- a/mysql-test/t/ndb_restore_print.test
+++ b/mysql-test/suite/ndb/t/ndb_restore_print.test
diff --git a/mysql-test/t/ndb_row_format.test b/mysql-test/suite/ndb/t/ndb_row_format.test
index b1582cbe339..b1582cbe339 100644
--- a/mysql-test/t/ndb_row_format.test
+++ b/mysql-test/suite/ndb/t/ndb_row_format.test
diff --git a/mysql-test/suite/ndb/t/ndb_single_user.test b/mysql-test/suite/ndb/t/ndb_single_user.test
new file mode 100644
index 00000000000..07925b25917
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_single_user.test
@@ -0,0 +1,173 @@
+-- source include/have_multi_ndb.inc
+-- source include/ndb_default_cluster.inc
+-- source include/not_embedded.inc
+
+--disable_warnings
+use test;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
+--enable_warnings
+
+# operations allowed while cluster is in single user mode
+
+--connection server1
+--let $node_id= `SHOW STATUS LIKE 'Ndb_cluster_node_id'`
+--disable_query_log
+--eval set @node_id= SUBSTRING('$node_id', 20)+0
+--enable_query_log
+--let $node_id= `SELECT @node_id`
+--exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "enter single user mode $node_id" >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" --single-user >> $NDB_TOOLS_OUTPUT
+
+# verify that we are indeed in single user mode
+# and test that some operations give correct errors
+--connection server2
+--error 1005
+create table t1 (a int key, b int unique, c int) engine ndb;
+# Bug #27712 Single user mode. Creating logfile group and tablespace is allowed
+# - before bug fix these would succeed
+--error ER_CREATE_FILEGROUP_FAILED
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+INITIAL_SIZE 16M
+UNDO_BUFFER_SIZE = 1M
+ENGINE=NDB;
+show warnings;
+
+# test some sql on first mysqld
+--connection server1
+create table t1 (a int key, b int unique, c int) engine ndb;
+# Check that we can create logfile group
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+INITIAL_SIZE 16M
+UNDO_BUFFER_SIZE = 1M
+ENGINE=NDB;
+--connection server2
+--error ER_CREATE_FILEGROUP_FAILED
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 12M
+ENGINE NDB;
+show warnings;
+--error ER_DROP_FILEGROUP_FAILED
+DROP LOGFILE GROUP lg1
+ENGINE =NDB;
+show warnings;
+--connection server1
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 12M
+ENGINE NDB;
+--connection server2
+--error ER_ALTER_FILEGROUP_FAILED
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile.dat'
+ENGINE NDB;
+show warnings;
+--connection server1
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile.dat'
+ENGINE NDB;
+--connection server2
+--error ER_DROP_FILEGROUP_FAILED
+DROP TABLESPACE ts1
+ENGINE NDB;
+show warnings;
+--connection server1
+DROP TABLESPACE ts1
+ENGINE NDB;
+DROP LOGFILE GROUP lg1
+ENGINE =NDB;
+insert into t1 values (1,1,0),(2,2,0),(3,3,0),(4,4,0),(5,5,0),(6,6,0),(7,7,0),(8,8,0),(9,9,0),(10,10,0);
+create table t2 as select * from t1;
+# read with pk
+select * from t1 where a = 1;
+# read with unique index
+select * from t1 where b = 4;
+# read with ordered index
+select * from t1 where a > 4 order by a;
+# update with pk
+update t1 set b=102 where a = 2;
+# update with unique index
+update t1 set b=103 where b = 3;
+# update with full table scan
+update t1 set b=b+100;
+# update with ordered insex scan
+update t1 set b=b+100 where a > 7;
+# delete with full table scan
+delete from t1;
+insert into t1 select * from t2;
+# Bug #27710 Creating unique index fails during single user mode
+# - prior to bugfix this would fail
+create unique index new_index on t1 (b,c);
+
+# test some sql on other mysqld
+--connection server2
+--error 1051
+drop table t1;
+--error 1296
+create index new_index_fail on t1 (c);
+--error 1296
+insert into t1 values (21,21,0),(22,22,0),(23,23,0),(24,24,0),(25,25,0),(26,26,0),(27,27,0),(28,28,0),(29,29,0),(210,210,0);
+--error 1296
+select * from t1 where a = 1;
+--error 1296
+select * from t1 where b = 4;
+--error 1296
+update t1 set b=102 where a = 2;
+--error 1296
+update t1 set b=103 where b = 3;
+--error 1296
+update t1 set b=b+100;
+--error 1296
+update t1 set b=b+100 where a > 7;
+
+--exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "exit single user mode" >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults >> $NDB_TOOLS_OUTPUT
+
+#
+# we should be able to run transaction while in single user mode
+#
+--connection server1
+BEGIN;
+update t1 set b=b+100 where a=1;
+
+--connection server2
+BEGIN;
+update t1 set b=b+100 where a=2;
+
+# enter single user mode
+--exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "enter single user mode $node_id" >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" --single-user >> $NDB_TOOLS_OUTPUT
+
+--connection server1
+update t1 set b=b+100 where a=3;
+COMMIT;
+
+# while on other mysqld it should be aborted
+--connection server2
+--error 1296
+update t1 set b=b+100 where a=4;
+--error 1296
+COMMIT;
+
+# Bug #25275 SINGLE USER MODE prevents ALTER on non-ndb
+# tables for other mysqld nodes
+--connection server2
+create table t2 (a int) engine myisam;
+alter table t2 add column (b int);
+
+# exit single user mode
+--exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "exit single user mode" >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults >> $NDB_TOOLS_OUTPUT
+
+# cleanup
+--connection server2
+drop table t2;
+--connection server1
+drop table t1;
+
+# End of 5.0 tests
+
diff --git a/mysql-test/t/ndb_sp.test b/mysql-test/suite/ndb/t/ndb_sp.test
index b833869cad0..b833869cad0 100644
--- a/mysql-test/t/ndb_sp.test
+++ b/mysql-test/suite/ndb/t/ndb_sp.test
diff --git a/mysql-test/t/ndb_subquery.test b/mysql-test/suite/ndb/t/ndb_subquery.test
index 6282c31c922..6282c31c922 100644
--- a/mysql-test/t/ndb_subquery.test
+++ b/mysql-test/suite/ndb/t/ndb_subquery.test
diff --git a/mysql-test/t/ndb_temporary.test b/mysql-test/suite/ndb/t/ndb_temporary.test
index 7f6902bf745..7f6902bf745 100644
--- a/mysql-test/t/ndb_temporary.test
+++ b/mysql-test/suite/ndb/t/ndb_temporary.test
diff --git a/mysql-test/t/ndb_transaction.test b/mysql-test/suite/ndb/t/ndb_transaction.test
index d3ebadb1a78..d3ebadb1a78 100644
--- a/mysql-test/t/ndb_transaction.test
+++ b/mysql-test/suite/ndb/t/ndb_transaction.test
diff --git a/mysql-test/suite/ndb/t/ndb_trigger.test b/mysql-test/suite/ndb/t/ndb_trigger.test
new file mode 100644
index 00000000000..2e944174fd0
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_trigger.test
@@ -0,0 +1,221 @@
+# Tests which involve triggers and NDB storage engine
+--source include/have_ndb.inc
+--source include/not_embedded.inc
+
+#
+# Test for bug#18437 "Wrong values inserted with a before update
+# trigger on NDB table". SQL-layer didn't properly inform handler
+# about fields which were read and set in triggers. In some cases
+# this resulted in incorrect (garbage) values of OLD variables and
+# lost changes to NEW variables.
+# You can find similar tests for ON INSERT triggers in federated.test
+# since this engine so far is the only engine in MySQL which cares
+# about field mark-up during handler::write_row() operation.
+#
+
+--disable_warnings
+drop table if exists t1, t2, t3, t4, t5;
+--enable_warnings
+
+create table t1 (id int primary key, a int not null, b decimal (63,30) default 0) engine=ndb;
+create table t2 (op char(1), a int not null, b decimal (63,30)) engine=ndb;
+create table t3 engine=ndb select 1 as i;
+create table t4 (a int not null primary key, b int) engine=ndb;
+create table t5 (a int not null primary key, b int) engine=ndb;
+
+delimiter //;
+create trigger t1_bu before update on t1 for each row
+begin
+ insert into t2 values ("u", old.a, old.b);
+ set new.b = old.b + 10;
+end;//
+create trigger t1_bd before delete on t1 for each row
+begin
+ insert into t2 values ("d", old.a, old.b);
+end;//
+create trigger t4_au after update on t4
+ for each row begin
+ update t5 set b = b+1;
+ end;
+//
+create trigger t4_ad after delete on t4
+ for each row begin
+ update t5 set b = b+1;
+ end;
+//
+delimiter ;//
+
+insert into t1 values (1, 1, 1.05), (2, 2, 2.05), (3, 3, 3.05), (4, 4, 4.05);
+insert into t4 values (1,1), (2,2), (3,3), (4, 4);
+insert into t5 values (1,0);
+
+# Check that usual update works as it should
+update t1 set a=5 where a != 3;
+select * from t1 order by id;
+select * from t2 order by op, a, b;
+delete from t2;
+# Check that everything works for multi-update
+update t1, t3 set a=6 where a = 5;
+select * from t1 order by id;
+select * from t2 order by op, a, b;
+delete from t2;
+# Check for delete
+delete from t1 where a != 3;
+select * from t1 order by id;
+select * from t2 order by op, a, b;
+delete from t2;
+# Check for multi-delete
+insert into t1 values (1, 1, 1.05), (2, 2, 2.05), (4, 4, 4.05);
+delete t1 from t1, t3 where a != 3;
+select * from t1 order by id;
+select * from t2 order by op, a, b;
+delete from t2;
+# Check for insert ... on duplicate key update
+insert into t1 values (4, 4, 4.05);
+insert into t1 (id, a) values (4, 1), (3, 1) on duplicate key update a= a + 1;
+select * from t1 order by id;
+select * from t2 order by op, a, b;
+delete from t2;
+# Check for insert ... select ... on duplicate key update
+delete from t3;
+insert into t3 values (4), (3);
+insert into t1 (id, a) (select i, 1 from t3) on duplicate key update a= a + 1;
+select * from t1 order by id;
+select * from t2 order by op, a, b;
+delete from t2;
+# Check for replace
+replace into t1 (id, a) values (4, 1), (3, 1);
+select * from t1 order by id;
+select * from t2 order by op, a, b;
+delete from t1;
+delete from t2;
+# Check for replace ... select ...
+insert into t1 values (3, 1, 1.05), (4, 1, 2.05);
+replace into t1 (id, a) (select i, 2 from t3);
+select * from t1 order by id;
+select * from t2 order by op, a, b;
+delete from t1;
+delete from t2;
+# Check for load data replace
+insert into t1 values (3, 1, 1.05), (5, 2, 2.05);
+load data infile '../std_data_ln/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (id, a);
+select * from t1 order by id;
+select * from t2 order by op, a, b;
+update t4 set b = 10 where a = 1;
+select * from t5 order by a;
+update t5 set b = 0;
+delete from t4 where a = 1;
+select * from t5 order by a;
+drop trigger t4_au;
+drop trigger t4_ad;
+
+drop table t1, t2, t3, t4, t5;
+# Test for bug#26242
+# Verify that AFTER UPDATE/DELETE triggers are executed
+# after the change has actually taken place
+
+CREATE TABLE t1 (
+ id INT NOT NULL PRIMARY KEY,
+ xy INT
+) ENGINE=ndbcluster;
+
+INSERT INTO t1 VALUES (1, 0);
+
+DELIMITER //;
+CREATE TRIGGER t1_update AFTER UPDATE ON t1 FOR EACH ROW BEGIN REPLACE INTO t2 SELECT * FROM t1 WHERE t1.id = NEW.id; END //
+DELIMITER ;//
+
+CREATE TABLE t2 (
+ id INT NOT NULL PRIMARY KEY,
+ xy INT
+) ENGINE=ndbcluster;
+
+INSERT INTO t2 VALUES (2, 0);
+
+CREATE TABLE t3 (id INT NOT NULL PRIMARY KEY) ENGINE=ndbcluster;
+
+INSERT INTO t3 VALUES (1);
+
+CREATE TABLE t4 LIKE t1;
+
+DELIMITER //;
+CREATE TRIGGER t4_update AFTER UPDATE ON t4 FOR EACH ROW BEGIN REPLACE INTO t5 SELECT * FROM t4 WHERE t4.id = NEW.id; END //
+DELIMITER ;//
+
+CREATE TABLE t5 LIKE t2;
+
+UPDATE t1 SET xy = 3 WHERE id = 1;
+SELECT xy FROM t1 where id = 1;
+SELECT xy FROM t2 where id = 1;
+
+UPDATE t1 SET xy = 4 WHERE id IN (SELECT id FROM t3 WHERE id = 1);
+SELECT xy FROM t1 where id = 1;
+SELECT xy FROM t2 where id = 1;
+
+INSERT INTO t4 SELECT * FROM t1;
+INSERT INTO t5 SELECT * FROM t2;
+UPDATE t1,t4 SET t1.xy = 3, t4.xy = 3 WHERE t1.id = 1 AND t4.id = 1;
+SELECT xy FROM t1 where id = 1;
+SELECT xy FROM t2 where id = 1;
+SELECT xy FROM t4 where id = 1;
+SELECT xy FROM t5 where id = 1;
+
+UPDATE t1,t4 SET t1.xy = 4, t4.xy = 4 WHERE t1.id IN (SELECT id FROM t3 WHERE id = 1) AND t4.id IN (SELECT id FROM t3 WHERE id = 1);
+SELECT xy FROM t1 where id = 1;
+SELECT xy FROM t2 where id = 1;
+SELECT xy FROM t4 where id = 1;
+SELECT xy FROM t5 where id = 1;
+
+INSERT INTO t1 VALUES (1,0) ON DUPLICATE KEY UPDATE xy = 5;
+SELECT xy FROM t1 where id = 1;
+SELECT xy FROM t2 where id = 1;
+
+DROP TRIGGER t1_update;
+DROP TRIGGER t4_update;
+
+DELIMITER //;
+CREATE TRIGGER t1_delete AFTER DELETE ON t1 FOR EACH ROW BEGIN REPLACE INTO t2 SELECT * FROM t1 WHERE t1.id > 4; END //
+DELIMITER ;//
+
+DELIMITER //;
+CREATE TRIGGER t4_delete AFTER DELETE ON t4 FOR EACH ROW BEGIN REPLACE INTO t5 SELECT * FROM t4 WHERE t4.id > 4; END //
+DELIMITER ;//
+
+INSERT INTO t1 VALUES (5, 0),(6,0);
+INSERT INTO t2 VALUES (5, 1),(6,1);
+INSERT INTO t3 VALUES (5);
+SELECT * FROM t1 order by id;
+SELECT * FROM t2 order by id;
+DELETE FROM t1 WHERE id IN (SELECT id FROM t3 WHERE id = 5);
+SELECT * FROM t1 order by id;
+SELECT * FROM t2 order by id;
+
+INSERT INTO t1 VALUES (5,0);
+UPDATE t2 SET xy = 1 WHERE id = 6;
+TRUNCATE t4;
+INSERT INTO t4 SELECT * FROM t1;
+TRUNCATE t5;
+INSERT INTO t5 SELECT * FROM t2;
+SELECT * FROM t1 order by id;
+SELECT * FROM t2 order by id;
+SELECT * FROM t4 order by id;
+SELECT * FROM t5 order by id;
+DELETE FROM t1,t4 USING t1,t3,t4 WHERE t1.id IN (SELECT id FROM t3 WHERE id = 5) AND t4.id IN (SELECT id FROM t3 WHERE id = 5);
+SELECT * FROM t1 order by id;
+SELECT * FROM t2 order by id;
+SELECT * FROM t4 order by id;
+SELECT * FROM t5 order by id;
+
+INSERT INTO t1 VALUES (5, 0);
+REPLACE INTO t2 VALUES (6,1);
+SELECT * FROM t1 order by id;
+SELECT * FROM t2 order by id;
+REPLACE INTO t1 VALUES (5, 1);
+SELECT * FROM t1 order by id;
+SELECT * FROM t2 order by id;
+
+DROP TRIGGER t1_delete;
+DROP TRIGGER t4_delete;
+DROP TABLE t1, t2, t3, t4, t5;
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/ndb_truncate.test b/mysql-test/suite/ndb/t/ndb_truncate.test
index a1ef4be0d48..a1ef4be0d48 100644
--- a/mysql-test/t/ndb_truncate.test
+++ b/mysql-test/suite/ndb/t/ndb_truncate.test
diff --git a/mysql-test/t/ndb_types.test b/mysql-test/suite/ndb/t/ndb_types.test
index ab18817132e..ab18817132e 100644
--- a/mysql-test/t/ndb_types.test
+++ b/mysql-test/suite/ndb/t/ndb_types.test
diff --git a/mysql-test/suite/ndb/t/ndb_update.test b/mysql-test/suite/ndb/t/ndb_update.test
new file mode 100644
index 00000000000..c45f990edcc
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_update.test
@@ -0,0 +1,89 @@
+-- source include/have_ndb.inc
+-- source include/not_embedded.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+--enable_warnings
+
+#
+# Basic test of UPDATE in NDB
+#
+
+#
+# Create a normal table with primary key
+#
+CREATE TABLE t1 (
+ pk1 INT NOT NULL PRIMARY KEY,
+ b INT NOT NULL,
+ c INT NOT NULL UNIQUE
+) ENGINE=ndbcluster;
+
+INSERT INTO t1 VALUES (0, 1, 0),(1,2,1),(2,3,2);
+UPDATE t1 set b = c;
+select * from t1 order by pk1;
+UPDATE t1 set pk1 = 4 where pk1 = 1;
+select * from t1 order by pk1;
+--error ER_DUP_ENTRY
+UPDATE t1 set pk1 = 4 where pk1 = 2;
+UPDATE IGNORE t1 set pk1 = 4 where pk1 = 2;
+select * from t1 order by pk1;
+--error ER_DUP_ENTRY
+UPDATE t1 set pk1 = 1, c = 2 where pk1 = 4;
+UPDATE IGNORE t1 set pk1 = 1, c = 2 where pk1 = 4;
+select * from t1 order by pk1;
+UPDATE t1 set pk1 = pk1 + 10;
+select * from t1 order by pk1;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# End of 4.1 tests
+
+#
+# Bug#28158: table->read_set is set incorrectly,
+# causing wrong error message in Falcon
+#
+CREATE TABLE t1 (a int, b int, KEY (a, b)) ENGINE=ndbcluster;
+CREATE TABLE t2 (a int, b int, UNIQUE KEY (a, b)) ENGINE=ndbcluster;
+CREATE TABLE t3 (a int, b int, PRIMARY KEY (a, b)) ENGINE=ndbcluster;
+#
+INSERT INTO t1 VALUES (1, 2);
+INSERT INTO t1 VALUES (2, 2);
+#
+INSERT INTO t2 VALUES (1, 2);
+INSERT INTO t2 VALUES (2, 2);
+#
+INSERT INTO t3 VALUES (1, 2);
+INSERT INTO t3 VALUES (2, 2);
+#
+UPDATE t1 SET a = 1;
+UPDATE t1 SET a = 1 ORDER BY a;
+#
+--error ER_DUP_ENTRY
+UPDATE t2 SET a = 1;
+--error ER_DUP_ENTRY
+UPDATE t2 SET a = 1 ORDER BY a;
+#
+--error ER_DUP_ENTRY
+UPDATE t3 SET a = 1;
+--error ER_DUP_ENTRY
+UPDATE t3 SET a = 1 ORDER BY a;
+#
+SELECT count(*) FROM t1;
+SELECT count(*) FROM t2;
+SELECT count(*) FROM t3;
+SELECT * FROM t1 ORDER by a;
+SELECT * FROM t2 ORDER by a;
+SELECT * FROM t3 ORDER by a;
+#
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+--enable_warnings
+
+--echo End of 5.1 tests
+
diff --git a/mysql-test/t/ndb_view.test b/mysql-test/suite/ndb/t/ndb_view.test
index 3b8fc330b40..3b8fc330b40 100644
--- a/mysql-test/t/ndb_view.test
+++ b/mysql-test/suite/ndb/t/ndb_view.test
diff --git a/mysql-test/t/ndbapi.test b/mysql-test/suite/ndb/t/ndbapi.test
index 3424513f8af..3424513f8af 100644
--- a/mysql-test/t/ndbapi.test
+++ b/mysql-test/suite/ndb/t/ndbapi.test
diff --git a/mysql-test/t/partition_03ndb.test b/mysql-test/suite/ndb/t/partition_03ndb.test
index 3190ab9dfc7..3190ab9dfc7 100644
--- a/mysql-test/t/partition_03ndb.test
+++ b/mysql-test/suite/ndb/t/partition_03ndb.test
diff --git a/mysql-test/t/ps_7ndb.test b/mysql-test/suite/ndb/t/ps_7ndb.test
index e3f65ec2c4e..e3f65ec2c4e 100644
--- a/mysql-test/t/ps_7ndb.test
+++ b/mysql-test/suite/ndb/t/ps_7ndb.test
diff --git a/mysql-test/t/strict_autoinc_5ndb.test b/mysql-test/suite/ndb/t/strict_autoinc_5ndb.test
index 9e2090fddef..9e2090fddef 100644
--- a/mysql-test/t/strict_autoinc_5ndb.test
+++ b/mysql-test/suite/ndb/t/strict_autoinc_5ndb.test
diff --git a/mysql-test/suite/ndb_team/r/ndb_autodiscover.result b/mysql-test/suite/ndb_team/r/ndb_autodiscover.result
new file mode 100644
index 00000000000..487f52f6427
--- /dev/null
+++ b/mysql-test/suite/ndb_team/r/ndb_autodiscover.result
@@ -0,0 +1,397 @@
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
+flush status;
+create table t1(
+id int not null primary key,
+name char(20)
+) engine=ndb;
+insert into t1 values(1, "Autodiscover");
+flush tables;
+select * from t1;
+id name
+1 Autodiscover
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 1
+flush tables;
+insert into t1 values (2, "Auto 2");
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 2
+insert into t1 values (3, "Discover 3");
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 2
+flush tables;
+select * from t1 order by id;
+id name
+1 Autodiscover
+2 Auto 2
+3 Discover 3
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 3
+flush tables;
+update t1 set name="Autodiscover" where id = 2;
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 4
+select * from t1 order by id;
+id name
+1 Autodiscover
+2 Autodiscover
+3 Discover 3
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 4
+flush tables;
+delete from t1 where id = 3;
+select * from t1 order by id;
+id name
+1 Autodiscover
+2 Autodiscover
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 5
+drop table t1;
+flush status;
+create table t2(
+id int not null primary key,
+name char(22)
+) engine=ndb;
+insert into t2 values (1, "Discoverer");
+select * from t2;
+id name
+1 Discoverer
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 0
+flush tables;
+select * from t2;
+id name
+1 Discoverer
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 1
+drop table t2;
+flush status;
+create table t3(
+id int not null primary key,
+name char(255)
+) engine=ndb;
+insert into t3 values (1, "Explorer");
+select * from t3;
+id name
+1 Explorer
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 0
+flush tables;
+create table t3(
+id int not null primary key,
+name char(20), a int, b float, c char(24)
+) engine=ndb;
+ERROR 42S01: Table 't3' already exists
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 0
+create table IF NOT EXISTS t3(
+id int not null primary key,
+id2 int not null,
+name char(20)
+) engine=ndb;
+Warnings:
+Note 1050 Table 't3' already exists
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 0
+SHOW CREATE TABLE t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `id` int(11) NOT NULL,
+ `name` char(255) default NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY ()
+select * from t3;
+id name
+1 Explorer
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 1
+drop table t3;
+flush status;
+create table t7(
+id int not null primary key,
+name char(255)
+) engine=ndb;
+create table t6(
+id int not null primary key,
+name char(255)
+) engine=MyISAM;
+insert into t7 values (1, "Explorer");
+insert into t6 values (2, "MyISAM table");
+select * from t7;
+id name
+1 Explorer
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 0
+flush tables;
+show tables from test;
+Tables_in_test
+t6
+t7
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 1
+flush tables;
+show table status;
+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
+t6 MyISAM 10 Fixed 1 # # # # 0 NULL # # NULL # NULL #
+t7 NDBCLUSTER 10 Fixed 1 # # # # 0 NULL # # NULL # NULL #
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 2
+drop table t6, t7;
+flush status;
+create table t4(
+id int not null primary key,
+name char(27)
+) engine=ndb;
+insert into t4 values (1, "Automatic");
+select * from t4;
+id name
+1 Automatic
+select * from t4;
+ERROR 42S02: Table 'test.t4' doesn't exist
+select * from t4;
+ERROR 42S02: Table 'test.t4' doesn't exist
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 0
+drop table t4;
+ERROR 42S02: Unknown table 't4'
+create table t4(
+id int not null primary key,
+name char(27)
+) engine=ndb;
+insert into t4 values (1, "Automatic");
+select * from t4;
+id name
+1 Automatic
+select * from t4;
+ERROR 42S02: Table 'test.t4' doesn't exist
+drop table if exists t4;
+Warnings:
+Error 155 Table 'test.t4' doesn't exist
+drop table t5;
+ERROR 42S02: Unknown table 't5'
+drop table if exists t5;
+Warnings:
+Note 1051 Unknown table 't5'
+flush status;
+create table t4(
+id int not null primary key,
+id2 int,
+name char(27)
+) engine=ndb;
+insert into t4 values (1, 76, "Automatic2");
+select * from t4;
+id id2 name
+1 76 Automatic2
+flush tables;
+SHOW TABLES;
+Tables_in_test
+select * from t4;
+ERROR 42S02: Table 'test.t4' doesn't exist
+flush status;
+create table t1(id int) engine=ndbcluster;
+create table t2(id int, b char(255)) engine=myisam;
+create table t3(id int, c char(255)) engine=ndbcluster;
+create table t4(id int) engine=myisam;
+create table t5(id int, d char(56)) engine=ndbcluster;
+create table t6(id int) engine=ndbcluster;
+create table t7(id int) engine=ndbcluster;
+create table t8(id int, e char(34)) engine=myisam;
+create table t9(id int) engine=myisam;
+insert into t2 values (2, "myisam table 2");
+insert into t3 values (3, "ndb table 3");
+insert into t5 values (5, "ndb table 5");
+insert into t6 values (6);
+insert into t8 values (8, "myisam table 8");
+insert into t9 values (9);
+SHOW TABLES;
+Tables_in_test
+t1
+t2
+t4
+t8
+t9
+t7
+t6
+select * from t6;
+id
+6
+select * from t7;
+id
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 2
+drop table t1, t2, t4, t6, t7, t8, t9;
+flush status;
+create table t1(id int) engine=ndbcluster;
+create table t2(id int, b char(255)) engine=myisam;
+create table t3(id int, c char(255)) engine=ndbcluster;
+create table t4(id int) engine=myisam;
+create table t5(id int, d char(56)) engine=ndbcluster;
+create table t6(id int) engine=ndbcluster;
+create table t7(id int) engine=ndbcluster;
+create table t8(id int, e char(34)) engine=myisam;
+create table t9(id int) engine=myisam;
+insert into t2 values (2, "myisam table 2");
+insert into t3 values (3, "ndb table 3");
+insert into t5 values (5, "ndb table 5");
+insert into t6 values (6);
+insert into t8 values (8, "myisam table 8");
+insert into t9 values (9);
+SHOW TABLES LIKE 't6';
+Tables_in_test (t6)
+t6
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 1
+create table t3(a int);
+ERROR 42S01: Table 't3' already exists
+create table t5(a int);
+ERROR 42S01: Table 't5' already exists
+SHOW TABLES LIKE 't%';
+Tables_in_test (t%)
+t1
+t2
+t4
+t6
+t8
+t9
+t7
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 2
+drop table t1, t2, t4, t6, t7, t8, t9;
+flush status;
+create table t1(id int) engine=ndbcluster;
+create table t2(id int, b char(255)) engine=ndbcluster;
+create table t3(id int, c char(255)) engine=ndbcluster;
+create table t4(id int) engine=myisam;
+insert into t1 values (1);
+insert into t2 values (2, "table 2");
+insert into t3 values (3, "ndb table 3");
+insert into t4 values (4);
+flush tables;
+select * from t1, t2, t3, t4;
+id id b id c id
+1 2 table 2 3 ndb table 3 4
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 3
+drop table t1, t2, t3, t4;
+flush status;
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 0
+create table t5(
+id int not null primary key,
+name char(200)
+) engine=ndb;
+insert into t5 values (1, "Magnus");
+select * from t5;
+id name
+1 Magnus
+ALTER TABLE t5 ADD COLUMN adress char(255) FIRST;
+select * from t5;
+adress id name
+NULL 1 Magnus
+insert into t5 values
+("Adress for record 2", 2, "Carl-Gustav"),
+("Adress for record 3", 3, "Karl-Emil");
+update t5 set name="Bertil" where id = 2;
+select * from t5 order by id;
+adress id name
+NULL 1 Magnus
+Adress for record 2 2 Bertil
+Adress for record 3 3 Karl-Emil
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 0
+drop table t5;
+flush status;
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 0
+create table t6(
+id int not null primary key,
+name char(20)
+) engine=ndb;
+insert into t6 values (1, "Magnus");
+select * from t6;
+id name
+1 Magnus
+ALTER TABLE t6 ADD COLUMN adress char(255) FIRST;
+select * from t6;
+adress id name
+NULL 1 Magnus
+insert into t6 values
+("Adress for record 2", 2, "Carl-Gustav"),
+("Adress for record 3", 3, "Karl-Emil");
+update t6 set name="Bertil" where id = 2;
+select * from t6 order by id;
+adress id name
+NULL 1 Magnus
+Adress for record 2 2 Bertil
+Adress for record 3 3 Karl-Emil
+show status like 'handler_discover%';
+Variable_name Value
+Handler_discover 0
+drop table t6;
+show tables;
+Tables_in_test
+create table t1 (a int,b longblob) engine=ndb;
+show tables;
+Tables_in_test
+t1
+create database test2;
+use test2;
+show tables;
+Tables_in_test2
+select * from t1;
+ERROR 42S02: Table 'test2.t1' doesn't exist
+create table t2 (b int,c longblob) engine=ndb;
+use test;
+select * from t1;
+a b
+show tables;
+Tables_in_test
+t1
+drop table t1;
+use test2;
+drop table t2;
+drop database test2;
+use test;
+drop database if exists test_only_ndb_tables;
+create database test_only_ndb_tables;
+use test_only_ndb_tables;
+create table t1 (a int primary key) engine=ndb;
+select * from t1;
+a
+select * from t1;
+ERROR HY000: Can't lock file (errno: 157)
+use test;
+drop database test_only_ndb_tables;
+CREATE TABLE t9 (
+a int NOT NULL PRIMARY KEY,
+b int
+) engine=ndb;
+insert t9 values(1, 2), (2,3), (3, 4), (4, 5);
+create table t10 (
+a int not null primary key,
+b blob
+) engine=ndb;
+insert into t10 values (1, 'kalle');
diff --git a/mysql-test/r/ndb_autodiscover2.result b/mysql-test/suite/ndb_team/r/ndb_autodiscover2.result
index 269888e0820..269888e0820 100644
--- a/mysql-test/r/ndb_autodiscover2.result
+++ b/mysql-test/suite/ndb_team/r/ndb_autodiscover2.result
diff --git a/mysql-test/r/ndb_autodiscover3.result b/mysql-test/suite/ndb_team/r/ndb_autodiscover3.result
index 86495ebb3eb..86495ebb3eb 100644
--- a/mysql-test/r/ndb_autodiscover3.result
+++ b/mysql-test/suite/ndb_team/r/ndb_autodiscover3.result
diff --git a/mysql-test/suite/ndb_team/t/disabled.def b/mysql-test/suite/ndb_team/t/disabled.def
new file mode 100644
index 00000000000..8ff2d29147d
--- /dev/null
+++ b/mysql-test/suite/ndb_team/t/disabled.def
@@ -0,0 +1,17 @@
+##############################################################################
+#
+# 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.
+#
+##############################################################################
+ndb_autodiscover : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
+ndb_autodiscover2 : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
+
+# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
+#ndb_autodiscover3 : bug#21806
+#ndb_autodiscover3 : Bug#20872 2007-07-15 ingo master*.err: miscellaneous error messages
diff --git a/mysql-test/t/ndb_autodiscover.test b/mysql-test/suite/ndb_team/t/ndb_autodiscover.test
index 06d47693c10..06d47693c10 100644
--- a/mysql-test/t/ndb_autodiscover.test
+++ b/mysql-test/suite/ndb_team/t/ndb_autodiscover.test
diff --git a/mysql-test/t/ndb_autodiscover2-master.opt b/mysql-test/suite/ndb_team/t/ndb_autodiscover2-master.opt
index e0d075c3fbd..e0d075c3fbd 100644
--- a/mysql-test/t/ndb_autodiscover2-master.opt
+++ b/mysql-test/suite/ndb_team/t/ndb_autodiscover2-master.opt
diff --git a/mysql-test/t/ndb_autodiscover2.test b/mysql-test/suite/ndb_team/t/ndb_autodiscover2.test
index ebe14696cd2..ebe14696cd2 100644
--- a/mysql-test/t/ndb_autodiscover2.test
+++ b/mysql-test/suite/ndb_team/t/ndb_autodiscover2.test
diff --git a/mysql-test/suite/ndb_team/t/ndb_autodiscover3.test b/mysql-test/suite/ndb_team/t/ndb_autodiscover3.test
new file mode 100644
index 00000000000..10416aee11f
--- /dev/null
+++ b/mysql-test/suite/ndb_team/t/ndb_autodiscover3.test
@@ -0,0 +1,104 @@
+-- source include/have_multi_ndb.inc
+-- source include/ndb_default_cluster.inc
+-- source include/not_embedded.inc
+
+# see bug#21563
+-- source include/have_binlog_format_mixed_or_row.inc
+
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+
+connect (con1,127.0.0.1,root,,test,$MASTER_MYPORT,);
+connect (con2,127.0.0.1,root,,test,$MASTER_MYPORT1,);
+
+# Workaround for Bug#27644
+# ndb: connecting api node/mysqld may "steal" node_id from running mysqld
+# - let ndb_waiter use a fixed node id so "steal" cannot happen
+--let connect_str = "nodeid=6;$NDB_CONNECTSTRING"
+
+#
+# Transaction ongoing while cluster is restarted
+#
+--connection server1
+create table t1 (a int key) engine=ndbcluster;
+
+begin;
+insert into t1 values (1);
+
+--exec $NDB_MGM --no-defaults -e "all restart" >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults -c $connect_str >> $NDB_TOOLS_OUTPUT
+# Wait for mysqld to reconnect and exit from readonly mode
+--disable_query_log
+--connection con1
+--source include/ndb_not_readonly.inc
+--connection con2
+--source include/ndb_not_readonly.inc
+--enable_query_log
+
+--connection server1
+--error 1297
+insert into t1 values (2);
+--error 1296
+commit;
+
+drop table t1;
+
+#
+# Stale cache after restart -i
+#
+--connection server1
+create table t2 (a int, b int, primary key(a,b)) engine=ndbcluster;
+insert into t2 values (1,1),(2,1),(3,1),(4,1),(5,1),(6,1),(7,1),(8,1),(9,1),(10,1);
+select * from t2 order by a limit 3;
+
+--exec $NDB_MGM --no-defaults -e "all restart -i" >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults -c $connect_str >> $NDB_TOOLS_OUTPUT
+# to ensure mysqld has connected again, and recreated system tables
+--disable_query_log
+--connection con1
+--source include/ndb_not_readonly.inc
+--connection con2
+--source include/ndb_not_readonly.inc
+--enable_query_log
+
+--connection server2
+--error ER_NO_SUCH_TABLE
+select * from t2;
+show tables like 't2';
+reset master;
+create table t2 (a int key) engine=ndbcluster;
+insert into t2 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+select * from t2 order by a limit 3;
+
+# server 1 should have a stale cache, and in this case wrong frm, transaction must be retried
+--connection server1
+select * from t2 order by a limit 3;
+reset master;
+
+--exec $NDB_MGM --no-defaults -e "all restart -i" >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults -c $connect_str >> $NDB_TOOLS_OUTPUT
+# to ensure mysqld has connected again, and recreated system tables
+--disable_query_log
+--connection con1
+--source include/ndb_not_readonly.inc
+--connection con2
+--source include/ndb_not_readonly.inc
+--enable_query_log
+
+--connection server1
+--error ER_NO_SUCH_TABLE
+select * from t2;
+show tables like 't2';
+reset master;
+create table t2 (a int key) engine=ndbcluster;
+insert into t2 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+select * from t2 order by a limit 3;
+
+# server 2 should have a stale cache, but with right frm, transaction need not be retried
+--connection server2
+select * from t2 order by a limit 3;
+reset master;
+
+drop table t2;
+# End of 4.1 tests
diff --git a/mysql-test/suite/parts/inc/part_blocked_sql_funcs_main.inc b/mysql-test/suite/parts/inc/part_blocked_sql_funcs_main.inc
index ec258b5387b..cba5c47f01b 100644
--- a/mysql-test/suite/parts/inc/part_blocked_sql_funcs_main.inc
+++ b/mysql-test/suite/parts/inc/part_blocked_sql_funcs_main.inc
@@ -17,6 +17,18 @@
--echo --- All SQL functions should be rejected, otherwise BUG (see 18198)
--echo -------------------------------------------------------------------------
+let $sqlfunc = ascii(col1);
+let $valsqlfunc = ascii('a');
+let $coltype = char(30);
+--source suite/parts/inc/partition_blocked_sql_funcs.inc
+# --source include/partition_blocked_sql_funcs.inc
+
+let $sqlfunc = ord(col1);
+let $valsqlfunc = ord('a');
+let $coltype = char(30);
+--source suite/parts/inc/partition_blocked_sql_funcs.inc
+# --source include/partition_blocked_sql_funcs.inc
+
let $sqlfunc = greatest(col1,15);
let $valsqlfunc = greatest(1,15);
let $coltype = int;
@@ -151,12 +163,6 @@ let $coltype = int;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
-let $sqlfunc = datediff(col1,col1);
-let $valsqlfunc = datediff('1997-11-30 23:59:59','1997-12-31');
-let $coltype = datetime;
---source suite/parts/inc/partition_blocked_sql_funcs.inc
-# --source include/partition_blocked_sql_funcs.inc
-
let $sqlfunc = period_add(col1,5);
let $valsqlfunc = period_add(9804,5);
let $coltype = datetime;
@@ -190,6 +196,12 @@ let $coltype = datetime;
--source suite/parts/inc/partition_blocked_sql_funcs.inc
# --source include/partition_blocked_sql_funcs.inc
+let $sqlfunc = weekofyear(col1);
+let $valsqlfunc = weekofyear('2002-05-01');
+let $coltype = datetime;
+--source suite/parts/inc/partition_blocked_sql_funcs.inc
+# --source include/partition_blocked_sql_funcs.inc
+
let $sqlfunc = cast(col1 as signed);
let $valsqlfunc = cast(123 as signed);
let $coltype = varchar(30);
diff --git a/mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc b/mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc
index 4dc0e7bdad3..4761d15c6d3 100644
--- a/mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc
+++ b/mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc
@@ -40,61 +40,42 @@ let $val4 = 15 ;
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
-let $sqlfunc = ascii(col1);
-let $valsqlfunc = ascii('5');
-let $coltype = char(1);
-let $infile = part_supported_sql_funcs_int_ch1.inc;
-let $val1 = '1';
-let $val2 = '9';
-let $val3 = '3';
-let $val4 = '8';
---source suite/parts/inc/partition_supported_sql_funcs.inc
-# --source include/partition_supported_sql_funcs.inc
-let $sqlfunc = cast(ceiling(col1) as signed integer);
-let $valsqlfunc = cast(ceiling(15) as signed integer);
+let $sqlfunc = ceiling(col1);
+let $valsqlfunc = ceiling(15);
let $coltype = float(7,4);
let $infile = part_supported_sql_funcs_int_float.inc;
let $val1 = 5.1230;
let $val2 = 13.345;
let $val3 = 17.987;
let $val4 = 15.654 ;
---source suite/parts/inc/partition_supported_sql_funcs.inc
+# DISABLED due to bug 30577
+#--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
-let $sqlfunc = cast(floor(col1) as signed);
-let $valsqlfunc = cast(floor(15.123) as signed);
+let $sqlfunc = floor(col1);
+let $valsqlfunc = floor(15.123);
let $coltype = float(7,4);
let $infile = part_supported_sql_funcs_int_float.inc;
let $val1 = 5.1230;
let $val2 = 13.345;
let $val3 = 17.987;
let $val4 = 15.654 ;
---source suite/parts/inc/partition_supported_sql_funcs.inc
+# DISABLED due to bug 30577
+#--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
-let $sqlfunc = cast(mod(col1,10) as signed);
-let $valsqlfunc = cast(mod(15,10) as signed);
-let $coltype = float(7,4);
-let $infile = part_supported_sql_funcs_int_float.inc;
-let $val1 = 5.0000;
+let $sqlfunc = mod(col1,10);
+let $valsqlfunc = mod(15,10);
+let $coltype = int;
+let $infile = part_supported_sql_funcs_int_int.inc;
+let $val1 = 5;
let $val2 = 19;
let $val3 = 17;
let $val4 = 15 ;
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
-let $sqlfunc = ord(col1);
-let $valsqlfunc = ord('a');
-let $coltype = char(3);
-let $infile = part_supported_sql_funcs_int_ch1.inc;
-let $val1 = '1';
-let $val2 = '9';
-let $val3 = '3';
-let $val4 = '8';
---source suite/parts/inc/partition_supported_sql_funcs.inc
-# --source include/partition_supported_sql_funcs.inc
-
let $sqlfunc = day(col1);
let $valsqlfunc = day('2006-12-21');
let $coltype = date;
@@ -243,25 +224,26 @@ let $val4 = '2006-02-06';
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
-let $sqlfunc = weekday(col1);
-let $valsqlfunc = weekday('2006-10-14');
+# DATEDIFF() is implemented as (TO_DAYS(d1) - TO_DAYS(d2))
+let $sqlfunc = datediff(col1, '2006-01-01');
+let $valsqlfunc = datediff('2006-02-02', '2006-01-01');
let $coltype = date;
let $infile = part_supported_sql_funcs_int_date.inc;
-let $val1 = '2006-12-03';
-let $val2 = '2006-11-17';
-let $val3 = '2006-05-25';
+let $val1 = '2006-02-03';
+let $val2 = '2006-01-17';
+let $val3 = '2006-01-25';
let $val4 = '2006-02-06';
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
-let $sqlfunc = weekofyear(col1);
-let $valsqlfunc = weekofyear('2006-02-14');
+let $sqlfunc = weekday(col1);
+let $valsqlfunc = weekday('2006-10-14');
let $coltype = date;
let $infile = part_supported_sql_funcs_int_date.inc;
-let $val1 = '2006-01-03';
-let $val2 = '2006-03-17';
+let $val1 = '2006-12-03';
+let $val2 = '2006-11-17';
let $val3 = '2006-05-25';
-let $val4 = '2006-09-06';
+let $val4 = '2006-02-06';
--source suite/parts/inc/partition_supported_sql_funcs.inc
# --source include/partition_supported_sql_funcs.inc
diff --git a/mysql-test/suite/parts/inc/partition_alter3.inc b/mysql-test/suite/parts/inc/partition_alter3.inc
index 48ad61ebe08..4b1539f4260 100644
--- a/mysql-test/suite/parts/inc/partition_alter3.inc
+++ b/mysql-test/suite/parts/inc/partition_alter3.inc
@@ -43,16 +43,16 @@ SELECT IF(9999 - 1000 + 1 > @max_row, @max_row , 9999 - 1000 + 1)
ALTER TABLE t1 ADD PARTITION (PARTITION part2);
#
--echo # 1.1.2 Assign HASH partitioning
-ALTER TABLE t1 PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER));
+ALTER TABLE t1 PARTITION BY HASH(YEAR(f_date));
--source include/partition_layout.inc
--source suite/parts/inc/partition_check_read1.inc
#
--echo # 1.1.3 Assign other HASH partitioning to already partitioned table
--echo # + test and switch back + test
-ALTER TABLE t1 PARTITION BY HASH(CAST(f_varchar AS SIGNED INTEGER));
+ALTER TABLE t1 PARTITION BY HASH(DAYOFYEAR(f_date));
--source include/partition_layout.inc
--source suite/parts/inc/partition_check_read1.inc
-ALTER TABLE t1 PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER));
+ALTER TABLE t1 PARTITION BY HASH(YEAR(f_date));
--source include/partition_layout.inc
--source suite/parts/inc/partition_check_read1.inc
#
diff --git a/mysql-test/suite/parts/inc/partition_alter_1.inc b/mysql-test/suite/parts/inc/partition_alter_1.inc
index 542a67ccbef..1498970547a 100644
--- a/mysql-test/suite/parts/inc/partition_alter_1.inc
+++ b/mysql-test/suite/parts/inc/partition_alter_1.inc
@@ -36,8 +36,9 @@
eval $insert_first_half;
# Possible/Expected return codes for ALTER TABLE ...
# 0
-# 1491: A PRIMARY KEY need to include all fields in the partition function
-# A UNIQUE INDEX need to include all fields in the partition function
+# 1030: ER_GET_ERRNO
+# 1500: ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
+# 1504: ER_DROP_PARTITION_NON_EXISTENT
--disable_abort_on_error
eval $alter;
--enable_abort_on_error
@@ -47,11 +48,11 @@ if ($no_debug)
}
eval SET @my_errno = $mysql_errno;
let $run_test= `SELECT @my_errno = 0`;
-let $unexpected_error= `SELECT @my_errno NOT IN (0,1030,1491,1495)`;
+let $unexpected_error= `SELECT @my_errno NOT IN (0,1030,1500,1504)`;
if ($unexpected_error)
{
--echo # The last command got an unexepected error response.
- --echo # Expected/handled SQL codes are 0,1030,1491,1495
+ --echo # Expected/handled SQL codes are 0,1030,1500,1504
SELECT '# SQL code we got was: ' AS "", @my_errno AS "";
--echo # Sorry, have to abort.
exit;
diff --git a/mysql-test/suite/parts/inc/partition_blocked_sql_funcs.inc b/mysql-test/suite/parts/inc/partition_blocked_sql_funcs.inc
index 7843a44134c..3e6876662fe 100644
--- a/mysql-test/suite/parts/inc/partition_blocked_sql_funcs.inc
+++ b/mysql-test/suite/parts/inc/partition_blocked_sql_funcs.inc
@@ -15,8 +15,7 @@
--echo -------------------------------------------------------------------------
--echo --- $sqlfunc in partition with coltype $coltype
--echo -------------------------------------------------------------------------
---echo must all fail! (delete 0 and comment char, if bug fixed)
---disable_abort_on_error
+--echo must all fail!
--disable_warnings
drop table if exists t1 ;
drop table if exists t2 ;
@@ -26,32 +25,31 @@ drop table if exists t5 ;
drop table if exists t6 ;
--enable_warnings
-#--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
+--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t1 (col1 $coltype) engine=$engine
partition by range($sqlfunc)
(partition p0 values less than (15),
partition p1 values less than (31));
-#--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
+--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t2 (col1 $coltype) engine=$engine
partition by list($sqlfunc)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
-#--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
+--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t3 (col1 $coltype) engine=$engine
partition by hash($sqlfunc);
---enable_abort_on_error
---error 0,ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
+--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t4 (colint int, col1 $coltype) engine=$engine
partition by range(colint)
subpartition by hash($sqlfunc) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
---error 0,ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
+--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t5 (colint int, col1 $coltype) engine=$engine
partition by list(colint)
subpartition by hash($sqlfunc) subpartitions 2
@@ -59,7 +57,7 @@ subpartition by hash($sqlfunc) subpartitions 2
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
---error 0,ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
+--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t6 (colint int, col1 $coltype) engine=$engine
partition by range(colint)
(partition p0 values less than ($valsqlfunc),
@@ -75,50 +73,44 @@ drop table if exists t55 ;
drop table if exists t66 ;
--enable_warnings
-#--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t11 (col1 $coltype) engine=$engine ;
-#--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t22 (col1 $coltype) engine=$engine ;
-#--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t33 (col1 $coltype) engine=$engine ;
---error 0,ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t44 (colint int, col1 $coltype) engine=$engine ;
---error 0,ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t55 (colint int, col1 $coltype) engine=$engine ;
---error 0,ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval create table t66 (colint int, col1 $coltype) engine=$engine ;
-#--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
+--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval alter table t11
partition by range($sqlfunc)
(partition p0 values less than (15),
partition p1 values less than (31));
-#--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
+--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval alter table t22
partition by list($sqlfunc)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
-#--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
+--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval alter table t33
partition by hash($sqlfunc);
--enable_abort_on_error
---error 0,ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
+--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval alter table t44
partition by range(colint)
subpartition by hash($sqlfunc) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
---error 0,ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
+--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval alter table t55
partition by list(colint)
subpartition by hash($sqlfunc) subpartitions 2
@@ -126,7 +118,7 @@ subpartition by hash($sqlfunc) subpartitions 2
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
---error 0,ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
+--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR
eval alter table t66
partition by range(colint)
(partition p0 values less than ($valsqlfunc),
diff --git a/mysql-test/suite/parts/inc/partition_check.inc b/mysql-test/suite/parts/inc/partition_check.inc
index 698e9611af1..6f03ed58241 100644
--- a/mysql-test/suite/parts/inc/partition_check.inc
+++ b/mysql-test/suite/parts/inc/partition_check.inc
@@ -156,8 +156,8 @@ if ($run)
# partitioning mechanism.
# Sideeffect: Attempt to INSERT one record
# DUPLICATE KEY will appear if we have UNIQUE columns
-# 1022: Can't write; duplicate key in table 't1' UIDX/PK(f_int1)
-# 1062: Duplicate entry '2' for key 1 UIDX/PK(f_int2)
+# 1022: ER_DUP_KEY
+# 1062: ER_DUP_ENTRY
--disable_abort_on_error
INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
@@ -200,7 +200,8 @@ if ($any_unique)
## 1.3.1 Check, if f_int1 is UNIQUE
# Sideeffect: Attempt to INSERT one record
# DUPLICATE KEY will appear if we have UNIQUE columns
- # 1022: Can't write; duplicate key in table 't1' UIDX/PK
+ # 1022: ER_DUP_KEY
+ # 1062: ER_DUP_ENTRY
--disable_abort_on_error
INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
@@ -494,8 +495,9 @@ WHERE f_charbig = '#SINGLE#' AND f_int1 IN (-1,@cur_value);
# 4.7 Insert one record with such a big value for f_int1, so that in case
# - f_int1 is used within the partitioning algorithm
# - we use range partitioning
-# we get error ER_NO_PARTITION_FOR_GIVEN_VALUE (1514)
+# we get error ER_NO_PARTITION_FOR_GIVEN_VALUE (1523)
# "Table has no partition for value ...."
+# or ER_SAME_NAME_PARTITION (1514)
--disable_abort_on_error
eval INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#$max_int_4##';
--enable_abort_on_error
@@ -504,11 +506,11 @@ if ($no_debug)
--disable_query_log
}
eval SET @my_errno = $mysql_errno;
-let $unexpected_error= `SELECT @my_errno NOT IN (0,1505,1514)`;
+let $unexpected_error= `SELECT @my_errno NOT IN (0,1514,1523)`;
if ($unexpected_error)
{
--echo # The last command got an unexepected error response.
- --echo # Expected/handled SQL codes are 0,1514
+ --echo # Expected/handled SQL codes are 0,1514,1523
SELECT '# SQL code we got was: ' AS "", @my_errno AS "";
--echo # Sorry, have to abort.
exit;
@@ -555,8 +557,8 @@ INSERT t1 SET f_int1 = 0 , f_int2 = 0,
# f1 "=" NULL is a delicate value which might stress the partitioning
# mechanism if the result of the expression in the partitioning algorithm
# becomes NULL.
-# Not: This INSERT will fail, if f_int1 is PRIMARY KEY or UNIQUE INDEX
-# 1048: Column 'f_int1' cannot be null
+# This INSERT will fail, if f_int1 is PRIMARY KEY or UNIQUE INDEX
+# 1048: ER_BAD_NULL_ERROR
--disable_abort_on_error
INSERT INTO t1
diff --git a/mysql-test/suite/parts/inc/partition_date.inc b/mysql-test/suite/parts/inc/partition_date.inc
index b58a7598236..45f9012604c 100644
--- a/mysql-test/suite/parts/inc/partition_date.inc
+++ b/mysql-test/suite/parts/inc/partition_date.inc
@@ -49,7 +49,7 @@ select * from t2;
drop table t2;
eval create table t3 (a date not null, primary key(a)) engine=$engine
-partition by range (cast(month(a) as unsigned)) subpartition by key (a)
+partition by range (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values less than (4),
partition quarter2 values less than (7),
@@ -69,7 +69,7 @@ select * from t3;
drop table t3;
eval create table t4 (a date not null, primary key(a)) engine=$engine
-partition by list (cast(month(a) as unsigned)) subpartition by key (a)
+partition by list (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values in (1,2,3),
partition quarter2 values in (4,5,6),
diff --git a/mysql-test/suite/parts/inc/partition_datetime.inc b/mysql-test/suite/parts/inc/partition_datetime.inc
index 94c9d3d75da..e948e827b4e 100644
--- a/mysql-test/suite/parts/inc/partition_datetime.inc
+++ b/mysql-test/suite/parts/inc/partition_datetime.inc
@@ -46,7 +46,7 @@ select * from t2;
drop table t2;
eval create table t3 (a datetime not null, primary key(a)) engine=$engine
-partition by range (cast(month(a) as unsigned)) subpartition by key (a)
+partition by range (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values less than (4),
partition quarter2 values less than (7),
@@ -66,7 +66,7 @@ select * from t3;
drop table t3;
eval create table t4 (a datetime not null, primary key(a)) engine=$engine
-partition by list (cast(month(a) as unsigned)) subpartition by key (a)
+partition by list (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values in (1,2,3),
partition quarter2 values in (4,5,6),
diff --git a/mysql-test/suite/parts/inc/partition_decimal.inc b/mysql-test/suite/parts/inc/partition_decimal.inc
index eb35416f395..09eb9b10831 100644
--- a/mysql-test/suite/parts/inc/partition_decimal.inc
+++ b/mysql-test/suite/parts/inc/partition_decimal.inc
@@ -47,8 +47,15 @@ dec $count;
select count(*) from t2;
drop table t2;
+# Bug 30577: FLOOR() and CEILING() not usable as partition functions
+# Partition functions are required to return INT_RESULT; FLOOR() and
+# CEILING() do not, unless they have an INT argument. Disable this
+# portion of the test until bug 30577 is fixed.
+
+--disable_parsing
+
eval create table t3 (a decimal(18,9) not null, primary key(a)) engine=$engine
-partition by range (cast(floor(a) as signed)) subpartition by key (a) subpartitions 2 (
+partition by range (floor(a)) subpartition by key (a) subpartitions 2 (
partition pa2 values less than (2),
partition pa4 values less than (4),
partition pa6 values less than (6),
@@ -70,7 +77,7 @@ select count(*) from t3;
drop table t3;
eval create table t4 (a decimal(18,9) not null, primary key(a)) engine=$engine
-partition by list (cast(floor(a) as signed)) subpartition by key (a) subpartitions 2 (
+partition by list (floor(a)) subpartition by key (a) subpartitions 2 (
partition pa2 values in (1,2),
partition pa4 values in (3,4),
partition pa6 values in (5,6),
@@ -90,3 +97,6 @@ dec $count;
--enable_query_log
select count(*) from t4;
drop table t4;
+
+# Disabled due to Bug 30577
+--enable_parsing
diff --git a/mysql-test/suite/parts/inc/partition_directory.inc b/mysql-test/suite/parts/inc/partition_directory.inc
index 2c765e1f5ab..17748df4f4d 100644
--- a/mysql-test/suite/parts/inc/partition_directory.inc
+++ b/mysql-test/suite/parts/inc/partition_directory.inc
@@ -29,9 +29,9 @@ let $partitioning= ;
if ($with_partitioning)
{
let $partitioning= PARTITION BY HASH(f_int1) PARTITIONS 2;
+--disable_query_log
if ($with_directories)
{
---disable_query_log
eval SET @aux =
'PARTITION BY HASH(f_int1) PARTITIONS 2
(PARTITION p1
@@ -39,7 +39,6 @@ $index_directory,
PARTITION p2
$index_directory)';
let $partitioning= `SELECT @aux`;
---enable_query_log
}
}
eval CREATE TABLE t1 (
@@ -47,6 +46,7 @@ $column_list
$unique
)
$partitioning;
+--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
@@ -54,9 +54,9 @@ DROP TABLE t1;
--source suite/parts/inc/partition_check_drop.inc
#----------- PARTITION BY KEY
+--disable_query_log
if ($with_partitioning)
{
---disable_query_log
eval SET @aux =
'PARTITION BY KEY(f_int1) PARTITIONS 5';
let $partitioning= `SELECT @aux`;
@@ -76,7 +76,6 @@ PARTITION p4,
PARTITION p5
$index_directory)';
let $partitioning= `SELECT @aux`;
---enable_query_log
}
}
eval CREATE TABLE t1 (
@@ -84,6 +83,7 @@ $column_list
$unique
)
$partitioning;
+--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
@@ -91,9 +91,9 @@ DROP TABLE t1;
--source suite/parts/inc/partition_check_drop.inc
#----------- PARTITION BY LIST
+--disable_query_log
if ($with_partitioning)
{
---disable_query_log
eval SET @aux =
'PARTITION BY LIST(MOD(f_int1,4))
(PARTITION part_3 VALUES IN (-3)
@@ -119,6 +119,7 @@ $column_list
$unique
)
$partitioning;
+--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
@@ -126,9 +127,9 @@ DROP TABLE t1;
--source suite/parts/inc/partition_check_drop.inc
#----------- PARTITION BY RANGE
+--disable_query_log
if ($with_partitioning)
{
-#--disable_query_log
eval SET @aux = 'PARTITION BY RANGE(f_int1)
(PARTITION parta VALUES LESS THAN (0)
$index_directory,
@@ -143,13 +144,13 @@ $data_directory,
PARTITION partf VALUES LESS THAN $MAX_VALUE
$index_directory)';
let $partitioning= `SELECT @aux`;
-#--enable_query_log
}
eval CREATE TABLE t1 (
$column_list
$unique
)
$partitioning;
+--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
@@ -157,9 +158,9 @@ DROP TABLE t1;
--source suite/parts/inc/partition_check_drop.inc
#----------- PARTITION BY RANGE -- SUBPARTITION BY HASH
+--disable_query_log
if ($with_partitioning)
{
---disable_query_log
eval SET @aux =
'PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
(PARTITION parta VALUES LESS THAN (0)
@@ -171,13 +172,13 @@ PARTITION partd VALUES LESS THAN $MAX_VALUE
$data_directory
$index_directory)';
let $partitioning= `SELECT @aux`;
---enable_query_log
}
eval CREATE TABLE t1 (
$column_list
$unique
)
$partitioning;
+--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
@@ -185,9 +186,9 @@ DROP TABLE t1;
--source suite/parts/inc/partition_check_drop.inc
#----------- PARTITION BY RANGE -- SUBPARTITION BY KEY
+--disable_query_log
if ($with_partitioning)
{
---disable_query_log
eval SET @aux = 'PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
(PARTITION part1 VALUES LESS THAN (0)
$data_directory
@@ -202,13 +203,13 @@ $index_directory
PARTITION part4 VALUES LESS THAN $MAX_VALUE
(SUBPARTITION subpart41, SUBPARTITION subpart42))';
let $partitioning= `SELECT @aux`;
---enable_query_log
}
eval CREATE TABLE t1 (
$column_list
$unique
)
$partitioning;
+--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
@@ -216,9 +217,9 @@ DROP TABLE t1;
--source suite/parts/inc/partition_check_drop.inc
#----------- PARTITION BY LIST -- SUBPARTITION BY HASH
+--disable_query_log
if ($with_partitioning)
{
---disable_query_log
eval SET @aux =
'PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1)
(PARTITION part1 VALUES IN (0)
@@ -246,13 +247,13 @@ eval SET @aux =
$data_directory
$index_directory))';
let $partitioning= `SELECT @aux`;
---enable_query_log
}
eval CREATE TABLE t1 (
$column_list
$unique
)
$partitioning;
+--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
diff --git a/mysql-test/suite/parts/inc/partition_double.inc b/mysql-test/suite/parts/inc/partition_double.inc
index 96cf7fd4871..57be826bac7 100644
--- a/mysql-test/suite/parts/inc/partition_double.inc
+++ b/mysql-test/suite/parts/inc/partition_double.inc
@@ -48,8 +48,15 @@ select count(*) from t2;
drop table t2;
+# Bug 30577: FLOOR() and CEILING() not usable as partition functions
+# Partition functions are required to return INT_RESULT; FLOOR() and
+# CEILING() do not, unless they have an INT argument. Disable this
+# portion of the test until bug 30577 is fixed.
+
+--disable_parsing
+
eval create table t3 (a double not null, primary key(a)) engine=$engine
-partition by range (cast(floor(a) as signed)) subpartition by key (a) subpartitions 3 (
+partition by range (floor(a)) subpartition by key (a) subpartitions 3 (
partition pa1 values less than (3),
partition pa3 values less than (6),
partition pa10 values less than (10)
@@ -69,7 +76,7 @@ select * from t3;
drop table t3;
eval create table t4 (a double not null, primary key(a)) engine=$engine
-partition by list (cast(floor(a) as signed)) subpartition by key (a) subpartitions 3 (
+partition by list (floor(a)) subpartition by key (a) subpartitions 3 (
partition pa1 values in (1,2,3),
partition pa3 values in (4,5,6),
partition pa10 values in (7,8,9,10)
@@ -87,3 +94,6 @@ dec $count;
select count(*) from t4;
select * from t4;
drop table t4;
+
+# Disabled due to Bug 30577
+--enable_parsing
diff --git a/mysql-test/suite/parts/inc/partition_enum.inc b/mysql-test/suite/parts/inc/partition_enum.inc
index f8fcb1110ae..67e790743f0 100644
--- a/mysql-test/suite/parts/inc/partition_enum.inc
+++ b/mysql-test/suite/parts/inc/partition_enum.inc
@@ -53,7 +53,7 @@ eval create table t3 (a enum (
'M','N','O','P','Q','R','S','T','U','V','W','X',
'Y','Z'
) not null, primary key(a)) engine=$engine
-partition by range (cast(a as unsigned)) subpartition by key (a) subpartitions 3 (
+partition by range (a) subpartition by key (a) subpartitions 3 (
partition pa9 values less than (10),
partition pa18 values less than (19),
partition pa27 values less than (28),
@@ -72,28 +72,3 @@ select count(*) from t3;
select * from t3;
drop table t3;
-eval create table t4 (a enum (
-'1','2','3','4','5','6','7','8','9','0',
-'A','B','C','D','E','F','G','H','I','J','K','L',
-'M','N','O','P','Q','R','S','T','U','V','W','X',
-'Y','Z'
-) not null, primary key(a)) engine=$engine
-partition by list (cast(a as unsigned)) subpartition by key (a) subpartitions 3 (
-partition pa9 values in (1,2,3,4,5,6,7,8,9),
-partition pa18 values in (10,11,12,13,14,15,16,17,18),
-partition pa27 values in (19,20,21,22,23,24,25,26,27),
-partition pa36 values in (28,29,30,31,32,33,34,35,36)
-);
-show create table t4;
-let $letter=36;
---echo $count inserts;
-#--disable_query_log
-while ($letter)
-{
-#eval insert into t4 values ($letter);
-dec $letter;
-}
-select count(*) from t4;
-select * from t4;
-drop table t4;
-
diff --git a/mysql-test/suite/parts/inc/partition_float.inc b/mysql-test/suite/parts/inc/partition_float.inc
index 25c59a10153..45c2f16ac98 100644
--- a/mysql-test/suite/parts/inc/partition_float.inc
+++ b/mysql-test/suite/parts/inc/partition_float.inc
@@ -51,8 +51,15 @@ dec $count;
select count(*) from t2;
drop table t2;
+# Bug 30577: FLOOR() and CEILING() not usable as partition functions
+# Partition functions are required to return INT_RESULT; FLOOR() and
+# CEILING() do not, unless they have an INT argument. Disable this
+# portion of the test until bug 30577 is fixed.
+
+--disable_parsing
+
eval create table t3 (a float not null, primary key(a)) engine=$engine
-partition by range (cast(floor(a) as signed)) subpartition by key (a) subpartitions 3 (
+partition by range (floor(a)) subpartition by key (a) subpartitions 3 (
partition pa1 values less than (3),
partition pa3 values less than (6),
partition pa10 values less than (10)
@@ -72,7 +79,7 @@ select * from t3;
drop table t3;
eval create table t4 (a float not null, primary key(a)) engine=$engine
-partition by list (cast(floor(a) as signed)) subpartition by key (a) subpartitions 3 (
+partition by list (floor(a)) subpartition by key (a) subpartitions 3 (
partition pa1 values in (1,2,3),
partition pa3 values in (4,5,6),
partition pa10 values in (7,8,9,10)
@@ -90,3 +97,6 @@ dec $count;
select count(*) from t4;
select * from t4;
drop table t4;
+
+# Disabled due to Bug 30577
+--enable_parsing
diff --git a/mysql-test/suite/parts/inc/partition_layout_check1.inc b/mysql-test/suite/parts/inc/partition_layout_check1.inc
index fe0d9d138a0..d3441b3d886 100644
--- a/mysql-test/suite/parts/inc/partition_layout_check1.inc
+++ b/mysql-test/suite/parts/inc/partition_layout_check1.inc
@@ -56,6 +56,7 @@ eval INSERT INTO t0_definition SET state = 'old',
file_list = $file_list;
# Print the create table statement into the protocol
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
SELECT create_command FROM t0_definition WHERE state = 'old';
if ($do_file_tests)
{
diff --git a/mysql-test/suite/parts/inc/partition_layout_check2.inc b/mysql-test/suite/parts/inc/partition_layout_check2.inc
index c28387cccd0..8a45613559d 100644
--- a/mysql-test/suite/parts/inc/partition_layout_check2.inc
+++ b/mysql-test/suite/parts/inc/partition_layout_check2.inc
@@ -55,6 +55,7 @@ let $run= `SELECT @aux`;
if ($run)
{
--vertical_results
+ --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
SELECT state,
REPLACE(create_command,'\n',' ') AS "Table definition",
REPLACE(file_list ,'\n',' ') AS "File list"
diff --git a/mysql-test/suite/parts/inc/partition_methods1.inc b/mysql-test/suite/parts/inc/partition_methods1.inc
index bec0c747f28..6e49c51cc3d 100644
--- a/mysql-test/suite/parts/inc/partition_methods1.inc
+++ b/mysql-test/suite/parts/inc/partition_methods1.inc
@@ -44,9 +44,9 @@ let $partitioning= ;
if ($with_partitioning)
{
let $partitioning= PARTITION BY HASH(f_int1) PARTITIONS 2;
+--disable_query_log
if ($with_directories)
{
---disable_query_log
eval SET @aux =
'PARTITION BY HASH(f_int1) PARTITIONS 2
(PARTITION p1
@@ -56,7 +56,6 @@ PARTITION p2
$data_directory
$index_directory)';
let $partitioning= `SELECT @aux`;
---enable_query_log
}
}
eval CREATE TABLE t1 (
@@ -64,6 +63,7 @@ $column_list
$unique
)
$partitioning;
+--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
@@ -71,15 +71,14 @@ DROP TABLE t1;
--source suite/parts/inc/partition_check_drop.inc
#----------- PARTITION BY KEY
+--disable_query_log
if ($with_partitioning)
{
---disable_query_log
eval SET @aux =
'PARTITION BY KEY(f_int1) PARTITIONS 5';
let $partitioning= `SELECT @aux`;
if ($with_directories)
{
---disable_query_log
eval SET @aux =
'PARTITION BY HASH(f_int1) PARTITIONS 5
(PARTITION p1
@@ -98,7 +97,6 @@ PARTITION p5
$data_directory
$index_directory)';
let $partitioning= `SELECT @aux`;
---enable_query_log
}
}
eval CREATE TABLE t1 (
@@ -106,6 +104,7 @@ $column_list
$unique
)
$partitioning;
+--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
@@ -113,9 +112,9 @@ DROP TABLE t1;
--source suite/parts/inc/partition_check_drop.inc
#----------- PARTITION BY LIST
+--disable_query_log
if ($with_partitioning)
{
---disable_query_log
eval SET @aux =
'PARTITION BY LIST(MOD(f_int1,4))
(PARTITION part_3 VALUES IN (-3)
@@ -141,6 +140,7 @@ $column_list
$unique
)
$partitioning;
+--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
@@ -148,9 +148,9 @@ DROP TABLE t1;
--source suite/parts/inc/partition_check_drop.inc
#----------- PARTITION BY RANGE
+--disable_query_log
if ($with_partitioning)
{
-#--disable_query_log
eval SET @aux = 'PARTITION BY RANGE(f_int1)
(PARTITION parta VALUES LESS THAN (0)
$data_directory
@@ -171,13 +171,13 @@ PARTITION partf VALUES LESS THAN $MAX_VALUE
$data_directory
$index_directory)';
let $partitioning= `SELECT @aux`;
-#--enable_query_log
}
eval CREATE TABLE t1 (
$column_list
$unique
)
$partitioning;
+--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
@@ -185,9 +185,9 @@ DROP TABLE t1;
--source suite/parts/inc/partition_check_drop.inc
#----------- PARTITION BY RANGE -- SUBPARTITION BY HASH
+--disable_query_log
if ($with_partitioning)
{
---disable_query_log
eval SET @aux =
'PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
(PARTITION parta VALUES LESS THAN (0)
@@ -203,13 +203,13 @@ PARTITION partd VALUES LESS THAN $MAX_VALUE
$data_directory
$index_directory)';
let $partitioning= `SELECT @aux`;
---enable_query_log
}
eval CREATE TABLE t1 (
$column_list
$unique
)
$partitioning;
+--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
@@ -217,9 +217,9 @@ DROP TABLE t1;
--source suite/parts/inc/partition_check_drop.inc
#----------- PARTITION BY RANGE -- SUBPARTITION BY KEY
+--disable_query_log
if ($with_partitioning)
{
---disable_query_log
eval SET @aux = 'PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
(PARTITION part1 VALUES LESS THAN (0)
$data_directory
@@ -238,13 +238,13 @@ $data_directory
$index_directory
(SUBPARTITION subpart41, SUBPARTITION subpart42))';
let $partitioning= `SELECT @aux`;
---enable_query_log
}
eval CREATE TABLE t1 (
$column_list
$unique
)
$partitioning;
+--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
@@ -252,9 +252,9 @@ DROP TABLE t1;
--source suite/parts/inc/partition_check_drop.inc
#----------- PARTITION BY LIST -- SUBPARTITION BY HASH
+--disable_query_log
if ($with_partitioning)
{
---disable_query_log
eval SET @aux =
'PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1)
(PARTITION part1 VALUES IN (0)
@@ -290,13 +290,13 @@ eval SET @aux =
$data_directory
$index_directory))';
let $partitioning= `SELECT @aux`;
---enable_query_log
}
eval CREATE TABLE t1 (
$column_list
$unique
)
$partitioning;
+--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
@@ -304,9 +304,9 @@ DROP TABLE t1;
--source suite/parts/inc/partition_check_drop.inc
#----------- PARTITION BY LIST -- SUBPARTITION BY KEY
+--disable_query_log
if ($with_partitioning)
{
---disable_query_log
eval SET @aux =
'PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int1) SUBPARTITIONS $sub_part_no
@@ -320,13 +320,13 @@ SUBPARTITION BY KEY(f_int1) SUBPARTITIONS $sub_part_no
$data_directory
$index_directory)';
let $partitioning= `SELECT @aux`;
---enable_query_log
}
eval CREATE TABLE t1 (
$column_list
$unique
)
$partitioning;
+--enable_query_log
eval $insert_all;
--source suite/parts/inc/partition_check.inc
# --source include/partition_check.inc
diff --git a/mysql-test/suite/parts/inc/partition_set.inc b/mysql-test/suite/parts/inc/partition_set.inc
index 76fc1aea4ba..292a28e7e1a 100644
--- a/mysql-test/suite/parts/inc/partition_set.inc
+++ b/mysql-test/suite/parts/inc/partition_set.inc
@@ -43,41 +43,3 @@ insert into t2 values ('1,2,3'),('2,3,4'),('3,4,5'),('4,5,6'),('5,6,7'),('6,7,8'
select count(*) from t2;
select * from t2 order by a;
drop table t2;
-
-eval create table t3 (a set (
-'1','2','3','4','5','6','7','8','9','0'
-) not null, primary key(a)) engine=$engine
-partition by range (cast(a as unsigned)) subpartition by key (a) subpartitions 3 (
-partition pa9 values less than (10),
-partition pa18 values less than (19),
-partition pa27 values less than (28),
-partition pa36 values less than (37),
-partition pa64 values less than (65),
-partition pa128 values less than (129),
-partition pa256 values less than (257),
-partition pa512 values less than (513),
-partition pa768 values less than (769),
-partition pa1024 values less than (1025)
-);
-show create table t3;
-#insert into t3 values ('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9'),('0');
-#insert into t3 values ('1,2'),('2,3'),('3,4'),('4,5'),('5,6'),('6,7'),('7,8'),('8,9'),('9,0'),('0,1');
-#insert into t3 values ('1,2,3'),('2,3,4'),('3,4,5'),('4,5,6'),('5,6,7'),('6,7,8'),('7,8,9'),('8,9,0'),('9,0,1'),('0,1,2');
-select count(*) from t3;
-select * from t3 order by a;
-drop table t3;
-
-eval create table t4 (a set (
-'1','2','3') not null, primary key(a)) engine=$engine
-partition by list (cast(a as unsigned)) subpartition by key (a) subpartitions 3 (
-partition pa9 values in (1,2,3,4,5,6,7,8,9),
-partition pa18 values in (10,11,12,13,14,15,16,17,18),
-partition pa27 values in (19,20,21,22,23,24,25,26,27)
-);
-show create table t4;
-#insert into t4 values ('1'),('2'),('3');
-#insert into t4 values ('1,2'),('2,3'),('3,1');
-#insert into t4 values ('1,2,3');
-select count(*) from t4;
-select * from t4 order by a;
-drop table t4;
diff --git a/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc b/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc
index a26e6650893..0f30fd199f8 100644
--- a/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc
+++ b/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc
@@ -83,14 +83,9 @@ eval insert into t3 values ($val1);
eval insert into t3 values ($val2);
eval insert into t3 values ($val3);
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
-eval load data infile '$MYSQL_TEST_DIR/suite/parts/inc/$infile' into table t4;
-
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
-eval load data infile '$MYSQL_TEST_DIR/suite/parts/inc/$infile' into table t5;
-
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
-eval load data infile '$MYSQL_TEST_DIR/suite/parts/inc/$infile' into table t6;
+eval load data infile '../std_data_ln/parts/$infile' into table t4;
+eval load data infile '../std_data_ln/parts/$infile' into table t5;
+eval load data infile '../std_data_ln/parts/$infile' into table t6;
eval select $sqlfunc from t1 order by col1;
diff --git a/mysql-test/suite/parts/inc/partition_syntax.inc b/mysql-test/suite/parts/inc/partition_syntax.inc
index 3c53861b95b..a2a29d25e48 100644
--- a/mysql-test/suite/parts/inc/partition_syntax.inc
+++ b/mysql-test/suite/parts/inc/partition_syntax.inc
@@ -331,13 +331,13 @@ $column_list
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 (CAST(NULL AS SIGNED INTEGER)) is not allowed
+--echo # 3.5.1.2 VALUE LESS THAN (NULL) is not allowed
--error 1064
eval CREATE TABLE t1 (
$column_list
)
PARTITION BY RANGE(f_int1)
-( PARTITION part1 VALUES LESS THAN (CAST(NULL AS SIGNED INTEGER)),
+( PARTITION part1 VALUES LESS THAN (NULL),
PARTITION part2 VALUES LESS THAN (1000));
--echo # 3.5.2 NULL in LIST partitioning clause
--echo # 3.5.2.1 VALUE IN (NULL)
@@ -349,14 +349,14 @@ PARTITION BY LIST(MOD(f_int1,2))
PARTITION part2 VALUES IN (0),
PARTITION part3 VALUES IN (1));
DROP TABLE t1;
---echo # 3.5.2.2 VALUE IN (CAST(NULL AS SIGNED INTEGER))
+--echo # 3.5.2.2 VALUE IN (NULL)
# Attention: It is intended that there is no partition with
# VALUES IN (0), because there was a time where NULL was treated as zero
eval CREATE TABLE t1 (
$column_list
)
PARTITION BY LIST(MOD(f_int1,2))
-( PARTITION part1 VALUES IN (CAST(NULL AS SIGNED INTEGER)),
+( PARTITION part1 VALUES IN (NULL),
PARTITION part3 VALUES IN (1));
--source suite/parts/inc/partition_layout_check1.inc
# --source include/partition_layout_check1.inc
@@ -368,7 +368,7 @@ eval CREATE TABLE t1 (
$column_list
)
PARTITION BY LIST(MOD(f_int1,2))
-( PARTITION part1 VALUES IN (CAST(NULL AS SIGNED INTEGER)),
+( PARTITION part1 VALUES IN (NULL),
PARTITION part2 VALUES IN (0),
PARTITION part3 VALUES IN (1));
--source suite/parts/inc/partition_layout_check1.inc
diff --git a/mysql-test/suite/parts/inc/partition_syntax_1.inc b/mysql-test/suite/parts/inc/partition_syntax_1.inc
index ac88b5ee668..e3e1b3ccbb7 100644
--- a/mysql-test/suite/parts/inc/partition_syntax_1.inc
+++ b/mysql-test/suite/parts/inc/partition_syntax_1.inc
@@ -28,15 +28,15 @@ eval SET @my_errno= $mysql_errno ;
let $run= `SELECT @my_errno = 0`;
# Expected error codes are
# 0
-# 1064 ERROR 42000: You have an error in your SQL syntax
-# Reason: assign -1 partitions
-# 1486 ERROR HY000: Too many partitions (including subpartitions) were defined
-# 1491 ERROR HY000: Number of partitions = 0 is not an allowed value
-let $unexpected_error= `SELECT @my_errno NOT IN (0,1064,1487,1492)`;
+# 1064 ER_PARSE_ERROR
+# Reason: assign -1 partitions
+# 1496 ER_TOO_MANY_PARTITIONS_ERROR
+# 1501 ER_NO_PARTS_ERROR
+let $unexpected_error= `SELECT @my_errno NOT IN (0,1064,1496,1501)`;
if ($unexpected_error)
{
--echo # The last command got an unexepected error response.
- --echo # Expected/handled SQL codes are 0,1064,1487,1492
+ --echo # Expected/handled SQL codes are 0,1064,1496,1501
SELECT '# SQL code we got was: ' AS "", @my_errno AS "";
--echo # Sorry, have to abort.
exit;
@@ -66,15 +66,15 @@ eval SET @my_errno= $mysql_errno ;
let $run= `SELECT @my_errno = 0`;
# Expected error codes are
# 0
-# 1064 ERROR 42000: You have an error in your SQL syntax
-# Reason: assign -1 subpartitions
-# 1487 ERROR HY000: Too many partitions (including subpartitions) were defined
-# 1492 ERROR HY000: Number of partitions = 0 is not an allowed value
-let $unexpected_error= `SELECT @my_errno NOT IN (0,1064,1487,1492)`;
+# 1064 ER_PARSE_ERROR
+# Reason: assign -1 partitions
+# 1496 ER_TOO_MANY_PARTITIONS_ERROR
+# 1501 ER_NO_PARTS_ERROR
+let $unexpected_error= `SELECT @my_errno NOT IN (0,1064,1496,1501)`;
if ($unexpected_error)
{
--echo # The last command got an unexepected error response.
- --echo # Expected/handled SQL codes are 0,1064,1487,1492
+ --echo # Expected/handled SQL codes are 0,1064,1496,1501
SELECT '# SQL code we got was: ' AS "", @my_errno AS "";
--echo # Sorry, have to abort.
exit;
diff --git a/mysql-test/suite/parts/inc/partition_time.inc b/mysql-test/suite/parts/inc/partition_time.inc
index a3388bdc902..a3f49a156fe 100644
--- a/mysql-test/suite/parts/inc/partition_time.inc
+++ b/mysql-test/suite/parts/inc/partition_time.inc
@@ -46,7 +46,7 @@ select * from t2;
drop table t2;
eval create table t3 (a time not null, primary key(a)) engine=$engine
-partition by range (cast(second(a) as unsigned)) subpartition by key (a)
+partition by range (second(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values less than (16),
partition quarter2 values less than (31),
@@ -66,7 +66,7 @@ select * from t3;
drop table t3;
eval create table t4 (a time not null, primary key(a)) engine=$engine
-partition by list (cast(second(a) as unsigned)) subpartition by key (a)
+partition by list (second(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
partition quarter2 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
diff --git a/mysql-test/suite/parts/inc/partition_timestamp.inc b/mysql-test/suite/parts/inc/partition_timestamp.inc
index 44eb3b5bd55..d4b1699d6c5 100644
--- a/mysql-test/suite/parts/inc/partition_timestamp.inc
+++ b/mysql-test/suite/parts/inc/partition_timestamp.inc
@@ -46,7 +46,7 @@ select * from t2;
drop table t2;
eval create table t3 (a timestamp not null, primary key(a)) engine=$engine
-partition by range (cast(month(a) as unsigned)) subpartition by key (a)
+partition by range (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values less than (4),
partition quarter2 values less than (7),
@@ -66,7 +66,7 @@ select * from t3;
drop table t3;
eval create table t4 (a timestamp not null, primary key(a)) engine=$engine
-partition by list (cast(month(a) as unsigned)) subpartition by key (a)
+partition by list (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values in (0,1,2,3),
partition quarter2 values in (4,5,6),
diff --git a/mysql-test/suite/parts/inc/partition_value.inc b/mysql-test/suite/parts/inc/partition_value.inc
index 75e9afd53d3..58691752bdf 100644
--- a/mysql-test/suite/parts/inc/partition_value.inc
+++ b/mysql-test/suite/parts/inc/partition_value.inc
@@ -12,6 +12,16 @@
# Change: #
################################################################################
+
+--echo
+--echo This test relies on the CAST() function for partitioning, which
+--echo is not allowed. Not deleting it yet, as it may have some useful
+--echo bits in it. See Bug #30581, "partition_value tests use disallowed
+--echo CAST() function"
+--echo
+
+--disable_parsing
+
--echo
--echo #========================================================================
--echo # Calculation of "exotic" results within the partition function
@@ -155,3 +165,5 @@ VALUES(NULL,NULL,NULL,NULL,NULL);
eval SELECT COUNT(*) = 1 FROM t1 WHERE f_char2 IS NULL;
DROP TABLE t1;
#
+
+--enable_parsing
diff --git a/mysql-test/suite/parts/r/part_blocked_sql_func_innodb.result b/mysql-test/suite/parts/r/part_blocked_sql_func_innodb.result
index 675cebaa7e3..57a7b2189ba 100644
--- a/mysql-test/suite/parts/r/part_blocked_sql_func_innodb.result
+++ b/mysql-test/suite/parts/r/part_blocked_sql_func_innodb.result
@@ -2,9 +2,205 @@
--- All SQL functions should be rejected, otherwise BUG (see 18198)
-------------------------------------------------------------------------
-------------------------------------------------------------------------
+--- ascii(col1) in partition with coltype char(30)
+-------------------------------------------------------------------------
+must all fail!
+drop table if exists t1 ;
+drop table if exists t2 ;
+drop table if exists t3 ;
+drop table if exists t4 ;
+drop table if exists t5 ;
+drop table if exists t6 ;
+create table t1 (col1 char(30)) engine='INNODB'
+partition by range(ascii(col1))
+(partition p0 values less than (15),
+partition p1 values less than (31));
+Got one of the listed errors
+create table t2 (col1 char(30)) engine='INNODB'
+partition by list(ascii(col1))
+(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
+partition p1 values in (11,12,13,14,15,16,17,18,19,20),
+partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
+create table t3 (col1 char(30)) engine='INNODB'
+partition by hash(ascii(col1));
+Got one of the listed errors
+create table t4 (colint int, col1 char(30)) engine='INNODB'
+partition by range(colint)
+subpartition by hash(ascii(col1)) subpartitions 2
+(partition p0 values less than (15),
+partition p1 values less than (31));
+Got one of the listed errors
+create table t5 (colint int, col1 char(30)) engine='INNODB'
+partition by list(colint)
+subpartition by hash(ascii(col1)) subpartitions 2
+(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
+partition p1 values in (11,12,13,14,15,16,17,18,19,20),
+partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
+create table t6 (colint int, col1 char(30)) engine='INNODB'
+partition by range(colint)
+(partition p0 values less than (ascii('a')),
+partition p1 values less than maxvalue);
+Got one of the listed errors
+drop table if exists t11 ;
+drop table if exists t22 ;
+drop table if exists t33 ;
+drop table if exists t44 ;
+drop table if exists t55 ;
+drop table if exists t66 ;
+create table t11 (col1 char(30)) engine='INNODB' ;
+create table t22 (col1 char(30)) engine='INNODB' ;
+create table t33 (col1 char(30)) engine='INNODB' ;
+create table t44 (colint int, col1 char(30)) engine='INNODB' ;
+create table t55 (colint int, col1 char(30)) engine='INNODB' ;
+create table t66 (colint int, col1 char(30)) engine='INNODB' ;
+alter table t11
+partition by range(ascii(col1))
+(partition p0 values less than (15),
+partition p1 values less than (31));
+Got one of the listed errors
+alter table t22
+partition by list(ascii(col1))
+(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
+partition p1 values in (11,12,13,14,15,16,17,18,19,20),
+partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
+alter table t33
+partition by hash(ascii(col1));
+Got one of the listed errors
+alter table t44
+partition by range(colint)
+subpartition by hash(ascii(col1)) subpartitions 2
+(partition p0 values less than (15),
+partition p1 values less than (31));
+Got one of the listed errors
+alter table t55
+partition by list(colint)
+subpartition by hash(ascii(col1)) subpartitions 2
+(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
+partition p1 values in (11,12,13,14,15,16,17,18,19,20),
+partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
+alter table t66
+partition by range(colint)
+(partition p0 values less than (ascii('a')),
+partition p1 values less than maxvalue);
+Got one of the listed errors
+drop table if exists t1 ;
+drop table if exists t2 ;
+drop table if exists t3 ;
+drop table if exists t4 ;
+drop table if exists t5 ;
+drop table if exists t6 ;
+drop table if exists t11 ;
+drop table if exists t22 ;
+drop table if exists t33 ;
+drop table if exists t44 ;
+drop table if exists t55 ;
+drop table if exists t66 ;
+-------------------------------------------------------------------------
+--- ord(col1) in partition with coltype char(30)
+-------------------------------------------------------------------------
+must all fail!
+drop table if exists t1 ;
+drop table if exists t2 ;
+drop table if exists t3 ;
+drop table if exists t4 ;
+drop table if exists t5 ;
+drop table if exists t6 ;
+create table t1 (col1 char(30)) engine='INNODB'
+partition by range(ord(col1))
+(partition p0 values less than (15),
+partition p1 values less than (31));
+Got one of the listed errors
+create table t2 (col1 char(30)) engine='INNODB'
+partition by list(ord(col1))
+(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
+partition p1 values in (11,12,13,14,15,16,17,18,19,20),
+partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
+create table t3 (col1 char(30)) engine='INNODB'
+partition by hash(ord(col1));
+Got one of the listed errors
+create table t4 (colint int, col1 char(30)) engine='INNODB'
+partition by range(colint)
+subpartition by hash(ord(col1)) subpartitions 2
+(partition p0 values less than (15),
+partition p1 values less than (31));
+Got one of the listed errors
+create table t5 (colint int, col1 char(30)) engine='INNODB'
+partition by list(colint)
+subpartition by hash(ord(col1)) subpartitions 2
+(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
+partition p1 values in (11,12,13,14,15,16,17,18,19,20),
+partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
+create table t6 (colint int, col1 char(30)) engine='INNODB'
+partition by range(colint)
+(partition p0 values less than (ord('a')),
+partition p1 values less than maxvalue);
+Got one of the listed errors
+drop table if exists t11 ;
+drop table if exists t22 ;
+drop table if exists t33 ;
+drop table if exists t44 ;
+drop table if exists t55 ;
+drop table if exists t66 ;
+create table t11 (col1 char(30)) engine='INNODB' ;
+create table t22 (col1 char(30)) engine='INNODB' ;
+create table t33 (col1 char(30)) engine='INNODB' ;
+create table t44 (colint int, col1 char(30)) engine='INNODB' ;
+create table t55 (colint int, col1 char(30)) engine='INNODB' ;
+create table t66 (colint int, col1 char(30)) engine='INNODB' ;
+alter table t11
+partition by range(ord(col1))
+(partition p0 values less than (15),
+partition p1 values less than (31));
+Got one of the listed errors
+alter table t22
+partition by list(ord(col1))
+(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
+partition p1 values in (11,12,13,14,15,16,17,18,19,20),
+partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
+alter table t33
+partition by hash(ord(col1));
+Got one of the listed errors
+alter table t44
+partition by range(colint)
+subpartition by hash(ord(col1)) subpartitions 2
+(partition p0 values less than (15),
+partition p1 values less than (31));
+Got one of the listed errors
+alter table t55
+partition by list(colint)
+subpartition by hash(ord(col1)) subpartitions 2
+(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
+partition p1 values in (11,12,13,14,15,16,17,18,19,20),
+partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
+alter table t66
+partition by range(colint)
+(partition p0 values less than (ord('a')),
+partition p1 values less than maxvalue);
+Got one of the listed errors
+drop table if exists t1 ;
+drop table if exists t2 ;
+drop table if exists t3 ;
+drop table if exists t4 ;
+drop table if exists t5 ;
+drop table if exists t6 ;
+drop table if exists t11 ;
+drop table if exists t22 ;
+drop table if exists t33 ;
+drop table if exists t44 ;
+drop table if exists t55 ;
+drop table if exists t66 ;
+-------------------------------------------------------------------------
--- greatest(col1,15) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -15,28 +211,34 @@ create table t1 (col1 int) engine='INNODB'
partition by range(greatest(col1,15))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='INNODB'
partition by list(greatest(col1,15))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='INNODB'
partition by hash(greatest(col1,15));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='INNODB'
partition by range(colint)
subpartition by hash(greatest(col1,15)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='INNODB'
partition by list(colint)
subpartition by hash(greatest(col1,15)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='INNODB'
partition by range(colint)
(partition p0 values less than (greatest(1,15)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -53,28 +255,34 @@ alter table t11
partition by range(greatest(col1,15))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(greatest(col1,15))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(greatest(col1,15));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(greatest(col1,15)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(greatest(col1,15)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (greatest(1,15)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -90,7 +298,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- isnull(col1) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -101,28 +309,34 @@ create table t1 (col1 int) engine='INNODB'
partition by range(isnull(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='INNODB'
partition by list(isnull(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='INNODB'
partition by hash(isnull(col1));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='INNODB'
partition by range(colint)
subpartition by hash(isnull(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='INNODB'
partition by list(colint)
subpartition by hash(isnull(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='INNODB'
partition by range(colint)
(partition p0 values less than (isnull(15)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -139,28 +353,34 @@ alter table t11
partition by range(isnull(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(isnull(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(isnull(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(isnull(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(isnull(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (isnull(15)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -176,7 +396,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- least(col1,15) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -187,28 +407,34 @@ create table t1 (col1 int) engine='INNODB'
partition by range(least(col1,15))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='INNODB'
partition by list(least(col1,15))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='INNODB'
partition by hash(least(col1,15));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='INNODB'
partition by range(colint)
subpartition by hash(least(col1,15)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='INNODB'
partition by list(colint)
subpartition by hash(least(col1,15)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='INNODB'
partition by range(colint)
(partition p0 values less than (least(15,30)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -225,28 +451,34 @@ alter table t11
partition by range(least(col1,15))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(least(col1,15))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(least(col1,15));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(least(col1,15)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(least(col1,15)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (least(15,30)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -262,7 +494,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- case when col1>15 then 20 else 10 end in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -273,28 +505,34 @@ create table t1 (col1 int) engine='INNODB'
partition by range(case when col1>15 then 20 else 10 end)
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='INNODB'
partition by list(case when col1>15 then 20 else 10 end)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='INNODB'
partition by hash(case when col1>15 then 20 else 10 end);
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='INNODB'
partition by range(colint)
subpartition by hash(case when col1>15 then 20 else 10 end) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='INNODB'
partition by list(colint)
subpartition by hash(case when col1>15 then 20 else 10 end) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='INNODB'
partition by range(colint)
(partition p0 values less than (case when 1>30 then 20 else 15 end),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -311,28 +549,34 @@ alter table t11
partition by range(case when col1>15 then 20 else 10 end)
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(case when col1>15 then 20 else 10 end)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(case when col1>15 then 20 else 10 end);
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(case when col1>15 then 20 else 10 end) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(case when col1>15 then 20 else 10 end) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (case when 1>30 then 20 else 15 end),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -348,7 +592,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- ifnull(col1,30) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -359,28 +603,34 @@ create table t1 (col1 int) engine='INNODB'
partition by range(ifnull(col1,30))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='INNODB'
partition by list(ifnull(col1,30))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='INNODB'
partition by hash(ifnull(col1,30));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='INNODB'
partition by range(colint)
subpartition by hash(ifnull(col1,30)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='INNODB'
partition by list(colint)
subpartition by hash(ifnull(col1,30)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='INNODB'
partition by range(colint)
(partition p0 values less than (ifnull(1,30)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -397,28 +647,34 @@ alter table t11
partition by range(ifnull(col1,30))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(ifnull(col1,30))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(ifnull(col1,30));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(ifnull(col1,30)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(ifnull(col1,30)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (ifnull(1,30)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -434,7 +690,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- nullif(col1,30) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -445,28 +701,34 @@ create table t1 (col1 int) engine='INNODB'
partition by range(nullif(col1,30))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='INNODB'
partition by list(nullif(col1,30))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='INNODB'
partition by hash(nullif(col1,30));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='INNODB'
partition by range(colint)
subpartition by hash(nullif(col1,30)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='INNODB'
partition by list(colint)
subpartition by hash(nullif(col1,30)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='INNODB'
partition by range(colint)
(partition p0 values less than (nullif(1,30)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -483,28 +745,34 @@ alter table t11
partition by range(nullif(col1,30))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(nullif(col1,30))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(nullif(col1,30));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(nullif(col1,30)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(nullif(col1,30)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (nullif(1,30)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -520,7 +788,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- bit_length(col1) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -531,28 +799,34 @@ create table t1 (col1 int) engine='INNODB'
partition by range(bit_length(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='INNODB'
partition by list(bit_length(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='INNODB'
partition by hash(bit_length(col1));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='INNODB'
partition by range(colint)
subpartition by hash(bit_length(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='INNODB'
partition by list(colint)
subpartition by hash(bit_length(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='INNODB'
partition by range(colint)
(partition p0 values less than (bit_length(255)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -569,28 +843,34 @@ alter table t11
partition by range(bit_length(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(bit_length(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(bit_length(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(bit_length(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(bit_length(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (bit_length(255)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -606,7 +886,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- bit_length(col1) in partition with coltype char(30)
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -617,28 +897,34 @@ create table t1 (col1 char(30)) engine='INNODB'
partition by range(bit_length(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 char(30)) engine='INNODB'
partition by list(bit_length(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 char(30)) engine='INNODB'
partition by hash(bit_length(col1));
+Got one of the listed errors
create table t4 (colint int, col1 char(30)) engine='INNODB'
partition by range(colint)
subpartition by hash(bit_length(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 char(30)) engine='INNODB'
partition by list(colint)
subpartition by hash(bit_length(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 char(30)) engine='INNODB'
partition by range(colint)
(partition p0 values less than (bit_length(255)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -655,28 +941,34 @@ alter table t11
partition by range(bit_length(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(bit_length(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(bit_length(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(bit_length(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(bit_length(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (bit_length(255)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -692,7 +984,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- char_length(col1) in partition with coltype char(30)
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -703,28 +995,34 @@ create table t1 (col1 char(30)) engine='INNODB'
partition by range(char_length(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 char(30)) engine='INNODB'
partition by list(char_length(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 char(30)) engine='INNODB'
partition by hash(char_length(col1));
+Got one of the listed errors
create table t4 (colint int, col1 char(30)) engine='INNODB'
partition by range(colint)
subpartition by hash(char_length(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 char(30)) engine='INNODB'
partition by list(colint)
subpartition by hash(char_length(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 char(30)) engine='INNODB'
partition by range(colint)
(partition p0 values less than (char_length('a')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -741,28 +1039,34 @@ alter table t11
partition by range(char_length(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(char_length(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(char_length(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(char_length(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(char_length(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (char_length('a')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -778,7 +1082,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- character_length(col1) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -789,28 +1093,34 @@ create table t1 (col1 int) engine='INNODB'
partition by range(character_length(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='INNODB'
partition by list(character_length(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='INNODB'
partition by hash(character_length(col1));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='INNODB'
partition by range(colint)
subpartition by hash(character_length(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='INNODB'
partition by list(colint)
subpartition by hash(character_length(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='INNODB'
partition by range(colint)
(partition p0 values less than (find_in_set('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -827,28 +1137,34 @@ alter table t11
partition by range(character_length(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(character_length(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(character_length(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(character_length(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(character_length(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (find_in_set('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -864,7 +1180,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- character_length(col1) in partition with coltype char(30)
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -875,28 +1191,34 @@ create table t1 (col1 char(30)) engine='INNODB'
partition by range(character_length(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 char(30)) engine='INNODB'
partition by list(character_length(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 char(30)) engine='INNODB'
partition by hash(character_length(col1));
+Got one of the listed errors
create table t4 (colint int, col1 char(30)) engine='INNODB'
partition by range(colint)
subpartition by hash(character_length(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 char(30)) engine='INNODB'
partition by list(colint)
subpartition by hash(character_length(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 char(30)) engine='INNODB'
partition by range(colint)
(partition p0 values less than (find_in_set('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -913,28 +1235,34 @@ alter table t11
partition by range(character_length(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(character_length(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(character_length(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(character_length(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(character_length(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (find_in_set('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -950,7 +1278,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- instr(col1,'acb') in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -961,28 +1289,34 @@ create table t1 (col1 int) engine='INNODB'
partition by range(instr(col1,'acb'))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='INNODB'
partition by list(instr(col1,'acb'))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='INNODB'
partition by hash(instr(col1,'acb'));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='INNODB'
partition by range(colint)
subpartition by hash(instr(col1,'acb')) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='INNODB'
partition by list(colint)
subpartition by hash(instr(col1,'acb')) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='INNODB'
partition by range(colint)
(partition p0 values less than (instr('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -999,28 +1333,34 @@ alter table t11
partition by range(instr(col1,'acb'))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(instr(col1,'acb'))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(instr(col1,'acb'));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(instr(col1,'acb')) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(instr(col1,'acb')) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (instr('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1036,7 +1376,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- instr(col1,'acb') in partition with coltype char(30)
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1047,28 +1387,34 @@ create table t1 (col1 char(30)) engine='INNODB'
partition by range(instr(col1,'acb'))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 char(30)) engine='INNODB'
partition by list(instr(col1,'acb'))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 char(30)) engine='INNODB'
partition by hash(instr(col1,'acb'));
+Got one of the listed errors
create table t4 (colint int, col1 char(30)) engine='INNODB'
partition by range(colint)
subpartition by hash(instr(col1,'acb')) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 char(30)) engine='INNODB'
partition by list(colint)
subpartition by hash(instr(col1,'acb')) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 char(30)) engine='INNODB'
partition by range(colint)
(partition p0 values less than (instr('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -1085,28 +1431,34 @@ alter table t11
partition by range(instr(col1,'acb'))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(instr(col1,'acb'))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(instr(col1,'acb'));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(instr(col1,'acb')) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(instr(col1,'acb')) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (instr('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1122,7 +1474,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- length(col1) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1133,28 +1485,34 @@ create table t1 (col1 int) engine='INNODB'
partition by range(length(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='INNODB'
partition by list(length(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='INNODB'
partition by hash(length(col1));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='INNODB'
partition by range(colint)
subpartition by hash(length(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='INNODB'
partition by list(colint)
subpartition by hash(length(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='INNODB'
partition by range(colint)
(partition p0 values less than (length('a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -1171,28 +1529,34 @@ alter table t11
partition by range(length(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(length(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(length(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(length(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(length(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (length('a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1208,7 +1572,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- locate('a',col1) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1219,28 +1583,34 @@ create table t1 (col1 int) engine='INNODB'
partition by range(locate('a',col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='INNODB'
partition by list(locate('a',col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='INNODB'
partition by hash(locate('a',col1));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='INNODB'
partition by range(colint)
subpartition by hash(locate('a',col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='INNODB'
partition by list(colint)
subpartition by hash(locate('a',col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='INNODB'
partition by range(colint)
(partition p0 values less than (locate('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -1257,28 +1627,34 @@ alter table t11
partition by range(locate('a',col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(locate('a',col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(locate('a',col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(locate('a',col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(locate('a',col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (locate('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1294,7 +1670,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- locate('a',col1) in partition with coltype char(30)
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1305,28 +1681,34 @@ create table t1 (col1 char(30)) engine='INNODB'
partition by range(locate('a',col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 char(30)) engine='INNODB'
partition by list(locate('a',col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 char(30)) engine='INNODB'
partition by hash(locate('a',col1));
+Got one of the listed errors
create table t4 (colint int, col1 char(30)) engine='INNODB'
partition by range(colint)
subpartition by hash(locate('a',col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 char(30)) engine='INNODB'
partition by list(colint)
subpartition by hash(locate('a',col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 char(30)) engine='INNODB'
partition by range(colint)
(partition p0 values less than (locate('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -1343,28 +1725,34 @@ alter table t11
partition by range(locate('a',col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(locate('a',col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(locate('a',col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(locate('a',col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(locate('a',col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (locate('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1380,7 +1768,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- octet_length(col1) in partition with coltype char(30)
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1391,28 +1779,34 @@ create table t1 (col1 char(30)) engine='INNODB'
partition by range(octet_length(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 char(30)) engine='INNODB'
partition by list(octet_length(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 char(30)) engine='INNODB'
partition by hash(octet_length(col1));
+Got one of the listed errors
create table t4 (colint int, col1 char(30)) engine='INNODB'
partition by range(colint)
subpartition by hash(octet_length(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 char(30)) engine='INNODB'
partition by list(colint)
subpartition by hash(octet_length(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 char(30)) engine='INNODB'
partition by range(colint)
(partition p0 values less than (octet_length('a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -1429,28 +1823,34 @@ alter table t11
partition by range(octet_length(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(octet_length(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(octet_length(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(octet_length(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(octet_length(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (octet_length('a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1466,7 +1866,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- position('a' in col1) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1477,28 +1877,34 @@ create table t1 (col1 int) engine='INNODB'
partition by range(position('a' in col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='INNODB'
partition by list(position('a' in col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='INNODB'
partition by hash(position('a' in col1));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='INNODB'
partition by range(colint)
subpartition by hash(position('a' in col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='INNODB'
partition by list(colint)
subpartition by hash(position('a' in col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='INNODB'
partition by range(colint)
(partition p0 values less than (position('i' in 'a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -1515,28 +1921,34 @@ alter table t11
partition by range(position('a' in col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(position('a' in col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(position('a' in col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(position('a' in col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(position('a' in col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (position('i' in 'a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1552,7 +1964,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- position('a' in col1) in partition with coltype char(30)
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1563,28 +1975,34 @@ create table t1 (col1 char(30)) engine='INNODB'
partition by range(position('a' in col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 char(30)) engine='INNODB'
partition by list(position('a' in col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 char(30)) engine='INNODB'
partition by hash(position('a' in col1));
+Got one of the listed errors
create table t4 (colint int, col1 char(30)) engine='INNODB'
partition by range(colint)
subpartition by hash(position('a' in col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 char(30)) engine='INNODB'
partition by list(colint)
subpartition by hash(position('a' in col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 char(30)) engine='INNODB'
partition by range(colint)
(partition p0 values less than (position('i' in 'a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -1601,28 +2019,34 @@ alter table t11
partition by range(position('a' in col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(position('a' in col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(position('a' in col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(position('a' in col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(position('a' in col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (position('i' in 'a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1638,7 +2062,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- strcmp(col1,'acb') in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1649,28 +2073,34 @@ create table t1 (col1 int) engine='INNODB'
partition by range(strcmp(col1,'acb'))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='INNODB'
partition by list(strcmp(col1,'acb'))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='INNODB'
partition by hash(strcmp(col1,'acb'));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='INNODB'
partition by range(colint)
subpartition by hash(strcmp(col1,'acb')) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='INNODB'
partition by list(colint)
subpartition by hash(strcmp(col1,'acb')) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='INNODB'
partition by range(colint)
(partition p0 values less than (strcmp('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -1687,28 +2117,34 @@ alter table t11
partition by range(strcmp(col1,'acb'))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(strcmp(col1,'acb'))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(strcmp(col1,'acb'));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(strcmp(col1,'acb')) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(strcmp(col1,'acb')) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (strcmp('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1724,7 +2160,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- strcmp(col1,'acb') in partition with coltype char(30)
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1735,28 +2171,34 @@ create table t1 (col1 char(30)) engine='INNODB'
partition by range(strcmp(col1,'acb'))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 char(30)) engine='INNODB'
partition by list(strcmp(col1,'acb'))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 char(30)) engine='INNODB'
partition by hash(strcmp(col1,'acb'));
+Got one of the listed errors
create table t4 (colint int, col1 char(30)) engine='INNODB'
partition by range(colint)
subpartition by hash(strcmp(col1,'acb')) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 char(30)) engine='INNODB'
partition by list(colint)
subpartition by hash(strcmp(col1,'acb')) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 char(30)) engine='INNODB'
partition by range(colint)
(partition p0 values less than (strcmp('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -1773,28 +2215,34 @@ alter table t11
partition by range(strcmp(col1,'acb'))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(strcmp(col1,'acb'))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(strcmp(col1,'acb'));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(strcmp(col1,'acb')) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(strcmp(col1,'acb')) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (strcmp('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1810,7 +2258,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- crc32(col1) in partition with coltype char(30)
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1821,28 +2269,34 @@ create table t1 (col1 char(30)) engine='INNODB'
partition by range(crc32(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 char(30)) engine='INNODB'
partition by list(crc32(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 char(30)) engine='INNODB'
partition by hash(crc32(col1));
+Got one of the listed errors
create table t4 (colint int, col1 char(30)) engine='INNODB'
partition by range(colint)
subpartition by hash(crc32(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 char(30)) engine='INNODB'
partition by list(colint)
subpartition by hash(crc32(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 char(30)) engine='INNODB'
partition by range(colint)
(partition p0 values less than (crc32('a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -1859,28 +2313,34 @@ alter table t11
partition by range(crc32(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(crc32(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(crc32(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(crc32(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(crc32(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (crc32('a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1896,7 +2356,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- round(col1) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1907,28 +2367,34 @@ create table t1 (col1 int) engine='INNODB'
partition by range(round(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='INNODB'
partition by list(round(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='INNODB'
partition by hash(round(col1));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='INNODB'
partition by range(colint)
subpartition by hash(round(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='INNODB'
partition by list(colint)
subpartition by hash(round(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='INNODB'
partition by range(colint)
(partition p0 values less than (round(15)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -1945,28 +2411,34 @@ alter table t11
partition by range(round(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(round(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(round(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(round(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(round(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (round(15)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1982,7 +2454,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- sign(col1) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1993,28 +2465,34 @@ create table t1 (col1 int) engine='INNODB'
partition by range(sign(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='INNODB'
partition by list(sign(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='INNODB'
partition by hash(sign(col1));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='INNODB'
partition by range(colint)
subpartition by hash(sign(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='INNODB'
partition by list(colint)
subpartition by hash(sign(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='INNODB'
partition by range(colint)
(partition p0 values less than (sign(123)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -2031,114 +2509,34 @@ alter table t11
partition by range(sign(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(sign(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(sign(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(sign(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(sign(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (sign(123)),
partition p1 values less than maxvalue);
-drop table if exists t1 ;
-drop table if exists t2 ;
-drop table if exists t3 ;
-drop table if exists t4 ;
-drop table if exists t5 ;
-drop table if exists t6 ;
-drop table if exists t11 ;
-drop table if exists t22 ;
-drop table if exists t33 ;
-drop table if exists t44 ;
-drop table if exists t55 ;
-drop table if exists t66 ;
--------------------------------------------------------------------------
---- datediff(col1,col1) in partition with coltype datetime
--------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
-drop table if exists t1 ;
-drop table if exists t2 ;
-drop table if exists t3 ;
-drop table if exists t4 ;
-drop table if exists t5 ;
-drop table if exists t6 ;
-create table t1 (col1 datetime) engine='INNODB'
-partition by range(datediff(col1,col1))
-(partition p0 values less than (15),
-partition p1 values less than (31));
-create table t2 (col1 datetime) engine='INNODB'
-partition by list(datediff(col1,col1))
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30));
-create table t3 (col1 datetime) engine='INNODB'
-partition by hash(datediff(col1,col1));
-create table t4 (colint int, col1 datetime) engine='INNODB'
-partition by range(colint)
-subpartition by hash(datediff(col1,col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than (31));
-create table t5 (colint int, col1 datetime) engine='INNODB'
-partition by list(colint)
-subpartition by hash(datediff(col1,col1)) subpartitions 2
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30));
-create table t6 (colint int, col1 datetime) engine='INNODB'
-partition by range(colint)
-(partition p0 values less than (datediff('1997-11-30 23:59:59','1997-12-31')),
-partition p1 values less than maxvalue);
-drop table if exists t11 ;
-drop table if exists t22 ;
-drop table if exists t33 ;
-drop table if exists t44 ;
-drop table if exists t55 ;
-drop table if exists t66 ;
-create table t11 (col1 datetime) engine='INNODB' ;
-create table t22 (col1 datetime) engine='INNODB' ;
-create table t33 (col1 datetime) engine='INNODB' ;
-create table t44 (colint int, col1 datetime) engine='INNODB' ;
-create table t55 (colint int, col1 datetime) engine='INNODB' ;
-create table t66 (colint int, col1 datetime) engine='INNODB' ;
-alter table t11
-partition by range(datediff(col1,col1))
-(partition p0 values less than (15),
-partition p1 values less than (31));
-alter table t22
-partition by list(datediff(col1,col1))
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30));
-alter table t33
-partition by hash(datediff(col1,col1));
-alter table t44
-partition by range(colint)
-subpartition by hash(datediff(col1,col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than (31));
-alter table t55
-partition by list(colint)
-subpartition by hash(datediff(col1,col1)) subpartitions 2
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30));
-alter table t66
-partition by range(colint)
-(partition p0 values less than (datediff('1997-11-30 23:59:59','1997-12-31')),
-partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2154,7 +2552,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- period_add(col1,5) in partition with coltype datetime
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2165,28 +2563,34 @@ create table t1 (col1 datetime) engine='INNODB'
partition by range(period_add(col1,5))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 datetime) engine='INNODB'
partition by list(period_add(col1,5))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 datetime) engine='INNODB'
partition by hash(period_add(col1,5));
+Got one of the listed errors
create table t4 (colint int, col1 datetime) engine='INNODB'
partition by range(colint)
subpartition by hash(period_add(col1,5)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 datetime) engine='INNODB'
partition by list(colint)
subpartition by hash(period_add(col1,5)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 datetime) engine='INNODB'
partition by range(colint)
(partition p0 values less than (period_add(9804,5)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -2203,28 +2607,34 @@ alter table t11
partition by range(period_add(col1,5))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(period_add(col1,5))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(period_add(col1,5));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(period_add(col1,5)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(period_add(col1,5)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (period_add(9804,5)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2240,7 +2650,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- period_diff(col1,col2) in partition with coltype datetime,col2 datetime
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2251,28 +2661,34 @@ create table t1 (col1 datetime,col2 datetime) engine='INNODB'
partition by range(period_diff(col1,col2))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 datetime,col2 datetime) engine='INNODB'
partition by list(period_diff(col1,col2))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 datetime,col2 datetime) engine='INNODB'
partition by hash(period_diff(col1,col2));
+Got one of the listed errors
create table t4 (colint int, col1 datetime,col2 datetime) engine='INNODB'
partition by range(colint)
subpartition by hash(period_diff(col1,col2)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 datetime,col2 datetime) engine='INNODB'
partition by list(colint)
subpartition by hash(period_diff(col1,col2)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 datetime,col2 datetime) engine='INNODB'
partition by range(colint)
(partition p0 values less than (period_diff(9809,199907)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -2289,28 +2705,34 @@ alter table t11
partition by range(period_diff(col1,col2))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(period_diff(col1,col2))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(period_diff(col1,col2));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(period_diff(col1,col2)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(period_diff(col1,col2)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (period_diff(9809,199907)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2326,7 +2748,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- period_diff(col1,col2) in partition with coltype int,col2 int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2337,28 +2759,34 @@ create table t1 (col1 int,col2 int) engine='INNODB'
partition by range(period_diff(col1,col2))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int,col2 int) engine='INNODB'
partition by list(period_diff(col1,col2))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int,col2 int) engine='INNODB'
partition by hash(period_diff(col1,col2));
+Got one of the listed errors
create table t4 (colint int, col1 int,col2 int) engine='INNODB'
partition by range(colint)
subpartition by hash(period_diff(col1,col2)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int,col2 int) engine='INNODB'
partition by list(colint)
subpartition by hash(period_diff(col1,col2)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int,col2 int) engine='INNODB'
partition by range(colint)
(partition p0 values less than (period_diff(9809,199907)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -2375,28 +2803,34 @@ alter table t11
partition by range(period_diff(col1,col2))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(period_diff(col1,col2))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(period_diff(col1,col2));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(period_diff(col1,col2)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(period_diff(col1,col2)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (period_diff(9809,199907)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2412,7 +2846,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- timestampdiff(day,5,col1) in partition with coltype datetime
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2423,28 +2857,34 @@ create table t1 (col1 datetime) engine='INNODB'
partition by range(timestampdiff(day,5,col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 datetime) engine='INNODB'
partition by list(timestampdiff(day,5,col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 datetime) engine='INNODB'
partition by hash(timestampdiff(day,5,col1));
+Got one of the listed errors
create table t4 (colint int, col1 datetime) engine='INNODB'
partition by range(colint)
subpartition by hash(timestampdiff(day,5,col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 datetime) engine='INNODB'
partition by list(colint)
subpartition by hash(timestampdiff(day,5,col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 datetime) engine='INNODB'
partition by range(colint)
(partition p0 values less than (timestampdiff(YEAR,'2002-05-01','2001-01-01')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -2461,28 +2901,34 @@ alter table t11
partition by range(timestampdiff(day,5,col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(timestampdiff(day,5,col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(timestampdiff(day,5,col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(timestampdiff(day,5,col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(timestampdiff(day,5,col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (timestampdiff(YEAR,'2002-05-01','2001-01-01')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2498,7 +2944,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- unix_timestamp(col1) in partition with coltype date
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2509,28 +2955,34 @@ create table t1 (col1 date) engine='INNODB'
partition by range(unix_timestamp(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 date) engine='INNODB'
partition by list(unix_timestamp(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 date) engine='INNODB'
partition by hash(unix_timestamp(col1));
+Got one of the listed errors
create table t4 (colint int, col1 date) engine='INNODB'
partition by range(colint)
subpartition by hash(unix_timestamp(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 date) engine='INNODB'
partition by list(colint)
subpartition by hash(unix_timestamp(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 date) engine='INNODB'
partition by range(colint)
(partition p0 values less than (unix_timestamp ('2002-05-01')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -2547,28 +2999,34 @@ alter table t11
partition by range(unix_timestamp(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(unix_timestamp(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(unix_timestamp(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(unix_timestamp(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(unix_timestamp(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (unix_timestamp ('2002-05-01')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2584,7 +3042,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- week(col1) in partition with coltype datetime
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2595,28 +3053,34 @@ create table t1 (col1 datetime) engine='INNODB'
partition by range(week(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 datetime) engine='INNODB'
partition by list(week(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 datetime) engine='INNODB'
partition by hash(week(col1));
+Got one of the listed errors
create table t4 (colint int, col1 datetime) engine='INNODB'
partition by range(colint)
subpartition by hash(week(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 datetime) engine='INNODB'
partition by list(colint)
subpartition by hash(week(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 datetime) engine='INNODB'
partition by range(colint)
(partition p0 values less than (week('2002-05-01')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -2633,28 +3097,132 @@ alter table t11
partition by range(week(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(week(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(week(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(week(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(week(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (week('2002-05-01')),
partition p1 values less than maxvalue);
+Got one of the listed errors
+drop table if exists t1 ;
+drop table if exists t2 ;
+drop table if exists t3 ;
+drop table if exists t4 ;
+drop table if exists t5 ;
+drop table if exists t6 ;
+drop table if exists t11 ;
+drop table if exists t22 ;
+drop table if exists t33 ;
+drop table if exists t44 ;
+drop table if exists t55 ;
+drop table if exists t66 ;
+-------------------------------------------------------------------------
+--- weekofyear(col1) in partition with coltype datetime
+-------------------------------------------------------------------------
+must all fail!
+drop table if exists t1 ;
+drop table if exists t2 ;
+drop table if exists t3 ;
+drop table if exists t4 ;
+drop table if exists t5 ;
+drop table if exists t6 ;
+create table t1 (col1 datetime) engine='INNODB'
+partition by range(weekofyear(col1))
+(partition p0 values less than (15),
+partition p1 values less than (31));
+Got one of the listed errors
+create table t2 (col1 datetime) engine='INNODB'
+partition by list(weekofyear(col1))
+(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
+partition p1 values in (11,12,13,14,15,16,17,18,19,20),
+partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
+create table t3 (col1 datetime) engine='INNODB'
+partition by hash(weekofyear(col1));
+Got one of the listed errors
+create table t4 (colint int, col1 datetime) engine='INNODB'
+partition by range(colint)
+subpartition by hash(weekofyear(col1)) subpartitions 2
+(partition p0 values less than (15),
+partition p1 values less than (31));
+Got one of the listed errors
+create table t5 (colint int, col1 datetime) engine='INNODB'
+partition by list(colint)
+subpartition by hash(weekofyear(col1)) subpartitions 2
+(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
+partition p1 values in (11,12,13,14,15,16,17,18,19,20),
+partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
+create table t6 (colint int, col1 datetime) engine='INNODB'
+partition by range(colint)
+(partition p0 values less than (weekofyear('2002-05-01')),
+partition p1 values less than maxvalue);
+Got one of the listed errors
+drop table if exists t11 ;
+drop table if exists t22 ;
+drop table if exists t33 ;
+drop table if exists t44 ;
+drop table if exists t55 ;
+drop table if exists t66 ;
+create table t11 (col1 datetime) engine='INNODB' ;
+create table t22 (col1 datetime) engine='INNODB' ;
+create table t33 (col1 datetime) engine='INNODB' ;
+create table t44 (colint int, col1 datetime) engine='INNODB' ;
+create table t55 (colint int, col1 datetime) engine='INNODB' ;
+create table t66 (colint int, col1 datetime) engine='INNODB' ;
+alter table t11
+partition by range(weekofyear(col1))
+(partition p0 values less than (15),
+partition p1 values less than (31));
+Got one of the listed errors
+alter table t22
+partition by list(weekofyear(col1))
+(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
+partition p1 values in (11,12,13,14,15,16,17,18,19,20),
+partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
+alter table t33
+partition by hash(weekofyear(col1));
+Got one of the listed errors
+alter table t44
+partition by range(colint)
+subpartition by hash(weekofyear(col1)) subpartitions 2
+(partition p0 values less than (15),
+partition p1 values less than (31));
+Got one of the listed errors
+alter table t55
+partition by list(colint)
+subpartition by hash(weekofyear(col1)) subpartitions 2
+(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
+partition p1 values in (11,12,13,14,15,16,17,18,19,20),
+partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
+alter table t66
+partition by range(colint)
+(partition p0 values less than (weekofyear('2002-05-01')),
+partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2670,7 +3238,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- cast(col1 as signed) in partition with coltype varchar(30)
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2681,28 +3249,34 @@ create table t1 (col1 varchar(30)) engine='INNODB'
partition by range(cast(col1 as signed))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 varchar(30)) engine='INNODB'
partition by list(cast(col1 as signed))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 varchar(30)) engine='INNODB'
partition by hash(cast(col1 as signed));
+Got one of the listed errors
create table t4 (colint int, col1 varchar(30)) engine='INNODB'
partition by range(colint)
subpartition by hash(cast(col1 as signed)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 varchar(30)) engine='INNODB'
partition by list(colint)
subpartition by hash(cast(col1 as signed)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 varchar(30)) engine='INNODB'
partition by range(colint)
(partition p0 values less than (cast(123 as signed)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -2719,28 +3293,34 @@ alter table t11
partition by range(cast(col1 as signed))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(cast(col1 as signed))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(cast(col1 as signed));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(cast(col1 as signed)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(cast(col1 as signed)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (cast(123 as signed)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2756,7 +3336,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- convert(col1,unsigned) in partition with coltype varchar(30)
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2767,28 +3347,34 @@ create table t1 (col1 varchar(30)) engine='INNODB'
partition by range(convert(col1,unsigned))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 varchar(30)) engine='INNODB'
partition by list(convert(col1,unsigned))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 varchar(30)) engine='INNODB'
partition by hash(convert(col1,unsigned));
+Got one of the listed errors
create table t4 (colint int, col1 varchar(30)) engine='INNODB'
partition by range(colint)
subpartition by hash(convert(col1,unsigned)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 varchar(30)) engine='INNODB'
partition by list(colint)
subpartition by hash(convert(col1,unsigned)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 varchar(30)) engine='INNODB'
partition by range(colint)
(partition p0 values less than (convert(123,unsigned)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -2805,28 +3391,34 @@ alter table t11
partition by range(convert(col1,unsigned))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(convert(col1,unsigned))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(convert(col1,unsigned));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(convert(col1,unsigned)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(convert(col1,unsigned)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (convert(123,unsigned)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2842,7 +3434,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- col1 | 20 in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2853,28 +3445,34 @@ create table t1 (col1 int) engine='INNODB'
partition by range(col1 | 20)
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='INNODB'
partition by list(col1 | 20)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='INNODB'
partition by hash(col1 | 20);
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='INNODB'
partition by range(colint)
subpartition by hash(col1 | 20) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='INNODB'
partition by list(colint)
subpartition by hash(col1 | 20) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='INNODB'
partition by range(colint)
(partition p0 values less than (10 | 20),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -2891,28 +3489,34 @@ alter table t11
partition by range(col1 | 20)
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(col1 | 20)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(col1 | 20);
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(col1 | 20) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(col1 | 20) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (10 | 20),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2928,7 +3532,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- col1 & 20 in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2939,28 +3543,34 @@ create table t1 (col1 int) engine='INNODB'
partition by range(col1 & 20)
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='INNODB'
partition by list(col1 & 20)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='INNODB'
partition by hash(col1 & 20);
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='INNODB'
partition by range(colint)
subpartition by hash(col1 & 20) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='INNODB'
partition by list(colint)
subpartition by hash(col1 & 20) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='INNODB'
partition by range(colint)
(partition p0 values less than (10 & 20),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -2977,28 +3587,34 @@ alter table t11
partition by range(col1 & 20)
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(col1 & 20)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(col1 & 20);
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(col1 & 20) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(col1 & 20) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (10 & 20),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3014,7 +3630,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- col1 ^ 20 in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3025,28 +3641,34 @@ create table t1 (col1 int) engine='INNODB'
partition by range(col1 ^ 20)
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='INNODB'
partition by list(col1 ^ 20)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='INNODB'
partition by hash(col1 ^ 20);
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='INNODB'
partition by range(colint)
subpartition by hash(col1 ^ 20) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='INNODB'
partition by list(colint)
subpartition by hash(col1 ^ 20) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='INNODB'
partition by range(colint)
(partition p0 values less than (10 ^ 20),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -3063,28 +3685,34 @@ alter table t11
partition by range(col1 ^ 20)
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(col1 ^ 20)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(col1 ^ 20);
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(col1 ^ 20) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(col1 ^ 20) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (10 ^ 20),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3100,7 +3728,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- col1 << 20 in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3111,28 +3739,34 @@ create table t1 (col1 int) engine='INNODB'
partition by range(col1 << 20)
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='INNODB'
partition by list(col1 << 20)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='INNODB'
partition by hash(col1 << 20);
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='INNODB'
partition by range(colint)
subpartition by hash(col1 << 20) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='INNODB'
partition by list(colint)
subpartition by hash(col1 << 20) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='INNODB'
partition by range(colint)
(partition p0 values less than (10 << 20),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -3149,28 +3783,34 @@ alter table t11
partition by range(col1 << 20)
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(col1 << 20)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(col1 << 20);
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(col1 << 20) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(col1 << 20) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (10 << 20),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3186,7 +3826,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- col1 >> 20 in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3197,28 +3837,34 @@ create table t1 (col1 int) engine='INNODB'
partition by range(col1 >> 20)
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='INNODB'
partition by list(col1 >> 20)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='INNODB'
partition by hash(col1 >> 20);
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='INNODB'
partition by range(colint)
subpartition by hash(col1 >> 20) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='INNODB'
partition by list(colint)
subpartition by hash(col1 >> 20) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='INNODB'
partition by range(colint)
(partition p0 values less than (10 >> 20),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -3235,28 +3881,34 @@ alter table t11
partition by range(col1 >> 20)
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(col1 >> 20)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(col1 >> 20);
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(col1 >> 20) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(col1 >> 20) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (10 >> 20),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3272,7 +3924,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- ~col1 in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3283,28 +3935,34 @@ create table t1 (col1 int) engine='INNODB'
partition by range(~col1)
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='INNODB'
partition by list(~col1)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='INNODB'
partition by hash(~col1);
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='INNODB'
partition by range(colint)
subpartition by hash(~col1) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='INNODB'
partition by list(colint)
subpartition by hash(~col1) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='INNODB'
partition by range(colint)
(partition p0 values less than (~20),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -3321,28 +3979,34 @@ alter table t11
partition by range(~col1)
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(~col1)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(~col1);
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(~col1) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(~col1) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (~20),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3358,7 +4022,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- bit_count(col1) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3369,28 +4033,34 @@ create table t1 (col1 int) engine='INNODB'
partition by range(bit_count(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='INNODB'
partition by list(bit_count(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='INNODB'
partition by hash(bit_count(col1));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='INNODB'
partition by range(colint)
subpartition by hash(bit_count(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='INNODB'
partition by list(colint)
subpartition by hash(bit_count(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='INNODB'
partition by range(colint)
(partition p0 values less than (bit_count(20)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -3407,28 +4077,34 @@ alter table t11
partition by range(bit_count(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(bit_count(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(bit_count(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(bit_count(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(bit_count(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (bit_count(20)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3444,7 +4120,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- inet_aton(col1) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3455,28 +4131,34 @@ create table t1 (col1 int) engine='INNODB'
partition by range(inet_aton(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='INNODB'
partition by list(inet_aton(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='INNODB'
partition by hash(inet_aton(col1));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='INNODB'
partition by range(colint)
subpartition by hash(inet_aton(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='INNODB'
partition by list(colint)
subpartition by hash(inet_aton(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='INNODB'
partition by range(colint)
(partition p0 values less than (inet_aton('192.168.1.1')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -3493,28 +4175,34 @@ alter table t11
partition by range(inet_aton(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(inet_aton(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(inet_aton(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(inet_aton(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(inet_aton(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (inet_aton('192.168.1.1')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3531,7 +4219,7 @@ set @var =20;
-------------------------------------------------------------------------
--- bit_length(col1)+@var-@var in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3542,35 +4230,34 @@ create table t1 (col1 int) engine='INNODB'
partition by range(bit_length(col1)+@var-@var)
(partition p0 values less than (15),
partition p1 values less than (31));
-ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')
-(partition p0 values less than (15),
-partition p1 values less than (31))' at line 2
+Got one of the listed errors
create table t2 (col1 int) engine='INNODB'
partition by list(bit_length(col1)+@var-@var)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
-ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12' at line 2
+Got one of the listed errors
create table t3 (col1 int) engine='INNODB'
partition by hash(bit_length(col1)+@var-@var);
-ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='INNODB'
partition by range(colint)
subpartition by hash(bit_length(col1)+@var-@var) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='INNODB'
partition by list(colint)
subpartition by hash(bit_length(col1)+@var-@var) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='INNODB'
partition by range(colint)
(partition p0 values less than (bit_length(20)+@var-@var),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -3587,35 +4274,34 @@ alter table t11
partition by range(bit_length(col1)+@var-@var)
(partition p0 values less than (15),
partition p1 values less than (31));
-ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')
-(partition p0 values less than (15),
-partition p1 values less than (31))' at line 2
+Got one of the listed errors
alter table t22
partition by list(bit_length(col1)+@var-@var)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
-ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12' at line 2
+Got one of the listed errors
alter table t33
partition by hash(bit_length(col1)+@var-@var);
-ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(bit_length(col1)+@var-@var) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(bit_length(col1)+@var-@var) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (bit_length(20)+@var-@var),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3652,7 +4338,7 @@ end//
-------------------------------------------------------------------------
--- getmaxsigned_t1(col1) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3663,35 +4349,34 @@ create table t1 (col1 int) engine='INNODB'
partition by range(getmaxsigned_t1(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
-ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')
-(partition p0 values less than (15),
-partition p1 values less than (31))' at line 2
+Got one of the listed errors
create table t2 (col1 int) engine='INNODB'
partition by list(getmaxsigned_t1(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
-ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12' at line 2
+Got one of the listed errors
create table t3 (col1 int) engine='INNODB'
partition by hash(getmaxsigned_t1(col1));
-ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='INNODB'
partition by range(colint)
subpartition by hash(getmaxsigned_t1(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='INNODB'
partition by list(colint)
subpartition by hash(getmaxsigned_t1(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='INNODB'
partition by range(colint)
(partition p0 values less than (getmaxsigned(10)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -3708,35 +4393,34 @@ alter table t11
partition by range(getmaxsigned_t1(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
-ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')
-(partition p0 values less than (15),
-partition p1 values less than (31))' at line 2
+Got one of the listed errors
alter table t22
partition by list(getmaxsigned_t1(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
-ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12' at line 2
+Got one of the listed errors
alter table t33
partition by hash(getmaxsigned_t1(col1));
-ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(getmaxsigned_t1(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(getmaxsigned_t1(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (getmaxsigned(10)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
diff --git a/mysql-test/suite/parts/r/part_blocked_sql_func_myisam.result b/mysql-test/suite/parts/r/part_blocked_sql_func_myisam.result
index 8b0ea1d3d49..4a67054e82a 100644
--- a/mysql-test/suite/parts/r/part_blocked_sql_func_myisam.result
+++ b/mysql-test/suite/parts/r/part_blocked_sql_func_myisam.result
@@ -2,9 +2,205 @@
--- All SQL functions should be rejected, otherwise BUG (see 18198)
-------------------------------------------------------------------------
-------------------------------------------------------------------------
+--- ascii(col1) in partition with coltype char(30)
+-------------------------------------------------------------------------
+must all fail!
+drop table if exists t1 ;
+drop table if exists t2 ;
+drop table if exists t3 ;
+drop table if exists t4 ;
+drop table if exists t5 ;
+drop table if exists t6 ;
+create table t1 (col1 char(30)) engine='MYISAM'
+partition by range(ascii(col1))
+(partition p0 values less than (15),
+partition p1 values less than (31));
+Got one of the listed errors
+create table t2 (col1 char(30)) engine='MYISAM'
+partition by list(ascii(col1))
+(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
+partition p1 values in (11,12,13,14,15,16,17,18,19,20),
+partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
+create table t3 (col1 char(30)) engine='MYISAM'
+partition by hash(ascii(col1));
+Got one of the listed errors
+create table t4 (colint int, col1 char(30)) engine='MYISAM'
+partition by range(colint)
+subpartition by hash(ascii(col1)) subpartitions 2
+(partition p0 values less than (15),
+partition p1 values less than (31));
+Got one of the listed errors
+create table t5 (colint int, col1 char(30)) engine='MYISAM'
+partition by list(colint)
+subpartition by hash(ascii(col1)) subpartitions 2
+(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
+partition p1 values in (11,12,13,14,15,16,17,18,19,20),
+partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
+create table t6 (colint int, col1 char(30)) engine='MYISAM'
+partition by range(colint)
+(partition p0 values less than (ascii('a')),
+partition p1 values less than maxvalue);
+Got one of the listed errors
+drop table if exists t11 ;
+drop table if exists t22 ;
+drop table if exists t33 ;
+drop table if exists t44 ;
+drop table if exists t55 ;
+drop table if exists t66 ;
+create table t11 (col1 char(30)) engine='MYISAM' ;
+create table t22 (col1 char(30)) engine='MYISAM' ;
+create table t33 (col1 char(30)) engine='MYISAM' ;
+create table t44 (colint int, col1 char(30)) engine='MYISAM' ;
+create table t55 (colint int, col1 char(30)) engine='MYISAM' ;
+create table t66 (colint int, col1 char(30)) engine='MYISAM' ;
+alter table t11
+partition by range(ascii(col1))
+(partition p0 values less than (15),
+partition p1 values less than (31));
+Got one of the listed errors
+alter table t22
+partition by list(ascii(col1))
+(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
+partition p1 values in (11,12,13,14,15,16,17,18,19,20),
+partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
+alter table t33
+partition by hash(ascii(col1));
+Got one of the listed errors
+alter table t44
+partition by range(colint)
+subpartition by hash(ascii(col1)) subpartitions 2
+(partition p0 values less than (15),
+partition p1 values less than (31));
+Got one of the listed errors
+alter table t55
+partition by list(colint)
+subpartition by hash(ascii(col1)) subpartitions 2
+(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
+partition p1 values in (11,12,13,14,15,16,17,18,19,20),
+partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
+alter table t66
+partition by range(colint)
+(partition p0 values less than (ascii('a')),
+partition p1 values less than maxvalue);
+Got one of the listed errors
+drop table if exists t1 ;
+drop table if exists t2 ;
+drop table if exists t3 ;
+drop table if exists t4 ;
+drop table if exists t5 ;
+drop table if exists t6 ;
+drop table if exists t11 ;
+drop table if exists t22 ;
+drop table if exists t33 ;
+drop table if exists t44 ;
+drop table if exists t55 ;
+drop table if exists t66 ;
+-------------------------------------------------------------------------
+--- ord(col1) in partition with coltype char(30)
+-------------------------------------------------------------------------
+must all fail!
+drop table if exists t1 ;
+drop table if exists t2 ;
+drop table if exists t3 ;
+drop table if exists t4 ;
+drop table if exists t5 ;
+drop table if exists t6 ;
+create table t1 (col1 char(30)) engine='MYISAM'
+partition by range(ord(col1))
+(partition p0 values less than (15),
+partition p1 values less than (31));
+Got one of the listed errors
+create table t2 (col1 char(30)) engine='MYISAM'
+partition by list(ord(col1))
+(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
+partition p1 values in (11,12,13,14,15,16,17,18,19,20),
+partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
+create table t3 (col1 char(30)) engine='MYISAM'
+partition by hash(ord(col1));
+Got one of the listed errors
+create table t4 (colint int, col1 char(30)) engine='MYISAM'
+partition by range(colint)
+subpartition by hash(ord(col1)) subpartitions 2
+(partition p0 values less than (15),
+partition p1 values less than (31));
+Got one of the listed errors
+create table t5 (colint int, col1 char(30)) engine='MYISAM'
+partition by list(colint)
+subpartition by hash(ord(col1)) subpartitions 2
+(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
+partition p1 values in (11,12,13,14,15,16,17,18,19,20),
+partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
+create table t6 (colint int, col1 char(30)) engine='MYISAM'
+partition by range(colint)
+(partition p0 values less than (ord('a')),
+partition p1 values less than maxvalue);
+Got one of the listed errors
+drop table if exists t11 ;
+drop table if exists t22 ;
+drop table if exists t33 ;
+drop table if exists t44 ;
+drop table if exists t55 ;
+drop table if exists t66 ;
+create table t11 (col1 char(30)) engine='MYISAM' ;
+create table t22 (col1 char(30)) engine='MYISAM' ;
+create table t33 (col1 char(30)) engine='MYISAM' ;
+create table t44 (colint int, col1 char(30)) engine='MYISAM' ;
+create table t55 (colint int, col1 char(30)) engine='MYISAM' ;
+create table t66 (colint int, col1 char(30)) engine='MYISAM' ;
+alter table t11
+partition by range(ord(col1))
+(partition p0 values less than (15),
+partition p1 values less than (31));
+Got one of the listed errors
+alter table t22
+partition by list(ord(col1))
+(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
+partition p1 values in (11,12,13,14,15,16,17,18,19,20),
+partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
+alter table t33
+partition by hash(ord(col1));
+Got one of the listed errors
+alter table t44
+partition by range(colint)
+subpartition by hash(ord(col1)) subpartitions 2
+(partition p0 values less than (15),
+partition p1 values less than (31));
+Got one of the listed errors
+alter table t55
+partition by list(colint)
+subpartition by hash(ord(col1)) subpartitions 2
+(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
+partition p1 values in (11,12,13,14,15,16,17,18,19,20),
+partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
+alter table t66
+partition by range(colint)
+(partition p0 values less than (ord('a')),
+partition p1 values less than maxvalue);
+Got one of the listed errors
+drop table if exists t1 ;
+drop table if exists t2 ;
+drop table if exists t3 ;
+drop table if exists t4 ;
+drop table if exists t5 ;
+drop table if exists t6 ;
+drop table if exists t11 ;
+drop table if exists t22 ;
+drop table if exists t33 ;
+drop table if exists t44 ;
+drop table if exists t55 ;
+drop table if exists t66 ;
+-------------------------------------------------------------------------
--- greatest(col1,15) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -15,28 +211,34 @@ create table t1 (col1 int) engine='MYISAM'
partition by range(greatest(col1,15))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='MYISAM'
partition by list(greatest(col1,15))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='MYISAM'
partition by hash(greatest(col1,15));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
subpartition by hash(greatest(col1,15)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='MYISAM'
partition by list(colint)
subpartition by hash(greatest(col1,15)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (greatest(1,15)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -53,28 +255,34 @@ alter table t11
partition by range(greatest(col1,15))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(greatest(col1,15))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(greatest(col1,15));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(greatest(col1,15)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(greatest(col1,15)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (greatest(1,15)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -90,7 +298,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- isnull(col1) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -101,28 +309,34 @@ create table t1 (col1 int) engine='MYISAM'
partition by range(isnull(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='MYISAM'
partition by list(isnull(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='MYISAM'
partition by hash(isnull(col1));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
subpartition by hash(isnull(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='MYISAM'
partition by list(colint)
subpartition by hash(isnull(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (isnull(15)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -139,28 +353,34 @@ alter table t11
partition by range(isnull(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(isnull(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(isnull(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(isnull(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(isnull(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (isnull(15)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -176,7 +396,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- least(col1,15) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -187,28 +407,34 @@ create table t1 (col1 int) engine='MYISAM'
partition by range(least(col1,15))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='MYISAM'
partition by list(least(col1,15))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='MYISAM'
partition by hash(least(col1,15));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
subpartition by hash(least(col1,15)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='MYISAM'
partition by list(colint)
subpartition by hash(least(col1,15)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (least(15,30)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -225,28 +451,34 @@ alter table t11
partition by range(least(col1,15))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(least(col1,15))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(least(col1,15));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(least(col1,15)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(least(col1,15)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (least(15,30)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -262,7 +494,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- case when col1>15 then 20 else 10 end in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -273,28 +505,34 @@ create table t1 (col1 int) engine='MYISAM'
partition by range(case when col1>15 then 20 else 10 end)
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='MYISAM'
partition by list(case when col1>15 then 20 else 10 end)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='MYISAM'
partition by hash(case when col1>15 then 20 else 10 end);
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
subpartition by hash(case when col1>15 then 20 else 10 end) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='MYISAM'
partition by list(colint)
subpartition by hash(case when col1>15 then 20 else 10 end) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (case when 1>30 then 20 else 15 end),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -311,28 +549,34 @@ alter table t11
partition by range(case when col1>15 then 20 else 10 end)
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(case when col1>15 then 20 else 10 end)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(case when col1>15 then 20 else 10 end);
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(case when col1>15 then 20 else 10 end) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(case when col1>15 then 20 else 10 end) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (case when 1>30 then 20 else 15 end),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -348,7 +592,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- ifnull(col1,30) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -359,28 +603,34 @@ create table t1 (col1 int) engine='MYISAM'
partition by range(ifnull(col1,30))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='MYISAM'
partition by list(ifnull(col1,30))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='MYISAM'
partition by hash(ifnull(col1,30));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
subpartition by hash(ifnull(col1,30)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='MYISAM'
partition by list(colint)
subpartition by hash(ifnull(col1,30)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (ifnull(1,30)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -397,28 +647,34 @@ alter table t11
partition by range(ifnull(col1,30))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(ifnull(col1,30))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(ifnull(col1,30));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(ifnull(col1,30)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(ifnull(col1,30)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (ifnull(1,30)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -434,7 +690,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- nullif(col1,30) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -445,28 +701,34 @@ create table t1 (col1 int) engine='MYISAM'
partition by range(nullif(col1,30))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='MYISAM'
partition by list(nullif(col1,30))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='MYISAM'
partition by hash(nullif(col1,30));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
subpartition by hash(nullif(col1,30)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='MYISAM'
partition by list(colint)
subpartition by hash(nullif(col1,30)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (nullif(1,30)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -483,28 +745,34 @@ alter table t11
partition by range(nullif(col1,30))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(nullif(col1,30))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(nullif(col1,30));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(nullif(col1,30)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(nullif(col1,30)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (nullif(1,30)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -520,7 +788,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- bit_length(col1) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -531,28 +799,34 @@ create table t1 (col1 int) engine='MYISAM'
partition by range(bit_length(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='MYISAM'
partition by list(bit_length(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='MYISAM'
partition by hash(bit_length(col1));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
subpartition by hash(bit_length(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='MYISAM'
partition by list(colint)
subpartition by hash(bit_length(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (bit_length(255)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -569,28 +843,34 @@ alter table t11
partition by range(bit_length(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(bit_length(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(bit_length(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(bit_length(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(bit_length(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (bit_length(255)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -606,7 +886,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- bit_length(col1) in partition with coltype char(30)
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -617,28 +897,34 @@ create table t1 (col1 char(30)) engine='MYISAM'
partition by range(bit_length(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 char(30)) engine='MYISAM'
partition by list(bit_length(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 char(30)) engine='MYISAM'
partition by hash(bit_length(col1));
+Got one of the listed errors
create table t4 (colint int, col1 char(30)) engine='MYISAM'
partition by range(colint)
subpartition by hash(bit_length(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 char(30)) engine='MYISAM'
partition by list(colint)
subpartition by hash(bit_length(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 char(30)) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (bit_length(255)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -655,28 +941,34 @@ alter table t11
partition by range(bit_length(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(bit_length(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(bit_length(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(bit_length(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(bit_length(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (bit_length(255)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -692,7 +984,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- char_length(col1) in partition with coltype char(30)
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -703,28 +995,34 @@ create table t1 (col1 char(30)) engine='MYISAM'
partition by range(char_length(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 char(30)) engine='MYISAM'
partition by list(char_length(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 char(30)) engine='MYISAM'
partition by hash(char_length(col1));
+Got one of the listed errors
create table t4 (colint int, col1 char(30)) engine='MYISAM'
partition by range(colint)
subpartition by hash(char_length(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 char(30)) engine='MYISAM'
partition by list(colint)
subpartition by hash(char_length(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 char(30)) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (char_length('a')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -741,28 +1039,34 @@ alter table t11
partition by range(char_length(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(char_length(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(char_length(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(char_length(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(char_length(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (char_length('a')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -778,7 +1082,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- character_length(col1) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -789,28 +1093,34 @@ create table t1 (col1 int) engine='MYISAM'
partition by range(character_length(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='MYISAM'
partition by list(character_length(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='MYISAM'
partition by hash(character_length(col1));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
subpartition by hash(character_length(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='MYISAM'
partition by list(colint)
subpartition by hash(character_length(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (find_in_set('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -827,28 +1137,34 @@ alter table t11
partition by range(character_length(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(character_length(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(character_length(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(character_length(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(character_length(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (find_in_set('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -864,7 +1180,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- character_length(col1) in partition with coltype char(30)
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -875,28 +1191,34 @@ create table t1 (col1 char(30)) engine='MYISAM'
partition by range(character_length(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 char(30)) engine='MYISAM'
partition by list(character_length(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 char(30)) engine='MYISAM'
partition by hash(character_length(col1));
+Got one of the listed errors
create table t4 (colint int, col1 char(30)) engine='MYISAM'
partition by range(colint)
subpartition by hash(character_length(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 char(30)) engine='MYISAM'
partition by list(colint)
subpartition by hash(character_length(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 char(30)) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (find_in_set('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -913,28 +1235,34 @@ alter table t11
partition by range(character_length(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(character_length(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(character_length(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(character_length(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(character_length(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (find_in_set('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -950,7 +1278,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- instr(col1,'acb') in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -961,28 +1289,34 @@ create table t1 (col1 int) engine='MYISAM'
partition by range(instr(col1,'acb'))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='MYISAM'
partition by list(instr(col1,'acb'))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='MYISAM'
partition by hash(instr(col1,'acb'));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
subpartition by hash(instr(col1,'acb')) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='MYISAM'
partition by list(colint)
subpartition by hash(instr(col1,'acb')) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (instr('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -999,28 +1333,34 @@ alter table t11
partition by range(instr(col1,'acb'))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(instr(col1,'acb'))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(instr(col1,'acb'));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(instr(col1,'acb')) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(instr(col1,'acb')) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (instr('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1036,7 +1376,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- instr(col1,'acb') in partition with coltype char(30)
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1047,28 +1387,34 @@ create table t1 (col1 char(30)) engine='MYISAM'
partition by range(instr(col1,'acb'))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 char(30)) engine='MYISAM'
partition by list(instr(col1,'acb'))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 char(30)) engine='MYISAM'
partition by hash(instr(col1,'acb'));
+Got one of the listed errors
create table t4 (colint int, col1 char(30)) engine='MYISAM'
partition by range(colint)
subpartition by hash(instr(col1,'acb')) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 char(30)) engine='MYISAM'
partition by list(colint)
subpartition by hash(instr(col1,'acb')) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 char(30)) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (instr('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -1085,28 +1431,34 @@ alter table t11
partition by range(instr(col1,'acb'))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(instr(col1,'acb'))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(instr(col1,'acb'));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(instr(col1,'acb')) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(instr(col1,'acb')) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (instr('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1122,7 +1474,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- length(col1) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1133,28 +1485,34 @@ create table t1 (col1 int) engine='MYISAM'
partition by range(length(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='MYISAM'
partition by list(length(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='MYISAM'
partition by hash(length(col1));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
subpartition by hash(length(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='MYISAM'
partition by list(colint)
subpartition by hash(length(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (length('a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -1171,28 +1529,34 @@ alter table t11
partition by range(length(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(length(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(length(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(length(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(length(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (length('a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1208,7 +1572,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- locate('a',col1) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1219,28 +1583,34 @@ create table t1 (col1 int) engine='MYISAM'
partition by range(locate('a',col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='MYISAM'
partition by list(locate('a',col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='MYISAM'
partition by hash(locate('a',col1));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
subpartition by hash(locate('a',col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='MYISAM'
partition by list(colint)
subpartition by hash(locate('a',col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (locate('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -1257,28 +1627,34 @@ alter table t11
partition by range(locate('a',col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(locate('a',col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(locate('a',col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(locate('a',col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(locate('a',col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (locate('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1294,7 +1670,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- locate('a',col1) in partition with coltype char(30)
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1305,28 +1681,34 @@ create table t1 (col1 char(30)) engine='MYISAM'
partition by range(locate('a',col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 char(30)) engine='MYISAM'
partition by list(locate('a',col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 char(30)) engine='MYISAM'
partition by hash(locate('a',col1));
+Got one of the listed errors
create table t4 (colint int, col1 char(30)) engine='MYISAM'
partition by range(colint)
subpartition by hash(locate('a',col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 char(30)) engine='MYISAM'
partition by list(colint)
subpartition by hash(locate('a',col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 char(30)) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (locate('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -1343,28 +1725,34 @@ alter table t11
partition by range(locate('a',col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(locate('a',col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(locate('a',col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(locate('a',col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(locate('a',col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (locate('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1380,7 +1768,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- octet_length(col1) in partition with coltype char(30)
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1391,28 +1779,34 @@ create table t1 (col1 char(30)) engine='MYISAM'
partition by range(octet_length(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 char(30)) engine='MYISAM'
partition by list(octet_length(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 char(30)) engine='MYISAM'
partition by hash(octet_length(col1));
+Got one of the listed errors
create table t4 (colint int, col1 char(30)) engine='MYISAM'
partition by range(colint)
subpartition by hash(octet_length(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 char(30)) engine='MYISAM'
partition by list(colint)
subpartition by hash(octet_length(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 char(30)) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (octet_length('a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -1429,28 +1823,34 @@ alter table t11
partition by range(octet_length(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(octet_length(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(octet_length(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(octet_length(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(octet_length(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (octet_length('a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1466,7 +1866,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- position('a' in col1) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1477,28 +1877,34 @@ create table t1 (col1 int) engine='MYISAM'
partition by range(position('a' in col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='MYISAM'
partition by list(position('a' in col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='MYISAM'
partition by hash(position('a' in col1));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
subpartition by hash(position('a' in col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='MYISAM'
partition by list(colint)
subpartition by hash(position('a' in col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (position('i' in 'a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -1515,28 +1921,34 @@ alter table t11
partition by range(position('a' in col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(position('a' in col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(position('a' in col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(position('a' in col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(position('a' in col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (position('i' in 'a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1552,7 +1964,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- position('a' in col1) in partition with coltype char(30)
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1563,28 +1975,34 @@ create table t1 (col1 char(30)) engine='MYISAM'
partition by range(position('a' in col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 char(30)) engine='MYISAM'
partition by list(position('a' in col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 char(30)) engine='MYISAM'
partition by hash(position('a' in col1));
+Got one of the listed errors
create table t4 (colint int, col1 char(30)) engine='MYISAM'
partition by range(colint)
subpartition by hash(position('a' in col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 char(30)) engine='MYISAM'
partition by list(colint)
subpartition by hash(position('a' in col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 char(30)) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (position('i' in 'a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -1601,28 +2019,34 @@ alter table t11
partition by range(position('a' in col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(position('a' in col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(position('a' in col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(position('a' in col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(position('a' in col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (position('i' in 'a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1638,7 +2062,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- strcmp(col1,'acb') in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1649,28 +2073,34 @@ create table t1 (col1 int) engine='MYISAM'
partition by range(strcmp(col1,'acb'))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='MYISAM'
partition by list(strcmp(col1,'acb'))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='MYISAM'
partition by hash(strcmp(col1,'acb'));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
subpartition by hash(strcmp(col1,'acb')) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='MYISAM'
partition by list(colint)
subpartition by hash(strcmp(col1,'acb')) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (strcmp('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -1687,28 +2117,34 @@ alter table t11
partition by range(strcmp(col1,'acb'))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(strcmp(col1,'acb'))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(strcmp(col1,'acb'));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(strcmp(col1,'acb')) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(strcmp(col1,'acb')) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (strcmp('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1724,7 +2160,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- strcmp(col1,'acb') in partition with coltype char(30)
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1735,28 +2171,34 @@ create table t1 (col1 char(30)) engine='MYISAM'
partition by range(strcmp(col1,'acb'))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 char(30)) engine='MYISAM'
partition by list(strcmp(col1,'acb'))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 char(30)) engine='MYISAM'
partition by hash(strcmp(col1,'acb'));
+Got one of the listed errors
create table t4 (colint int, col1 char(30)) engine='MYISAM'
partition by range(colint)
subpartition by hash(strcmp(col1,'acb')) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 char(30)) engine='MYISAM'
partition by list(colint)
subpartition by hash(strcmp(col1,'acb')) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 char(30)) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (strcmp('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -1773,28 +2215,34 @@ alter table t11
partition by range(strcmp(col1,'acb'))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(strcmp(col1,'acb'))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(strcmp(col1,'acb'));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(strcmp(col1,'acb')) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(strcmp(col1,'acb')) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (strcmp('i','a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1810,7 +2258,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- crc32(col1) in partition with coltype char(30)
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1821,28 +2269,34 @@ create table t1 (col1 char(30)) engine='MYISAM'
partition by range(crc32(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 char(30)) engine='MYISAM'
partition by list(crc32(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 char(30)) engine='MYISAM'
partition by hash(crc32(col1));
+Got one of the listed errors
create table t4 (colint int, col1 char(30)) engine='MYISAM'
partition by range(colint)
subpartition by hash(crc32(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 char(30)) engine='MYISAM'
partition by list(colint)
subpartition by hash(crc32(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 char(30)) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (crc32('a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -1859,28 +2313,34 @@ alter table t11
partition by range(crc32(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(crc32(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(crc32(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(crc32(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(crc32(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (crc32('a,b,c,d,e,f,g,h,i')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1896,7 +2356,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- round(col1) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1907,28 +2367,34 @@ create table t1 (col1 int) engine='MYISAM'
partition by range(round(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='MYISAM'
partition by list(round(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='MYISAM'
partition by hash(round(col1));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
subpartition by hash(round(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='MYISAM'
partition by list(colint)
subpartition by hash(round(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (round(15)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -1945,28 +2411,34 @@ alter table t11
partition by range(round(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(round(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(round(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(round(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(round(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (round(15)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1982,7 +2454,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- sign(col1) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -1993,28 +2465,34 @@ create table t1 (col1 int) engine='MYISAM'
partition by range(sign(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='MYISAM'
partition by list(sign(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='MYISAM'
partition by hash(sign(col1));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
subpartition by hash(sign(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='MYISAM'
partition by list(colint)
subpartition by hash(sign(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (sign(123)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -2031,114 +2509,34 @@ alter table t11
partition by range(sign(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(sign(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(sign(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(sign(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(sign(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (sign(123)),
partition p1 values less than maxvalue);
-drop table if exists t1 ;
-drop table if exists t2 ;
-drop table if exists t3 ;
-drop table if exists t4 ;
-drop table if exists t5 ;
-drop table if exists t6 ;
-drop table if exists t11 ;
-drop table if exists t22 ;
-drop table if exists t33 ;
-drop table if exists t44 ;
-drop table if exists t55 ;
-drop table if exists t66 ;
--------------------------------------------------------------------------
---- datediff(col1,col1) in partition with coltype datetime
--------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
-drop table if exists t1 ;
-drop table if exists t2 ;
-drop table if exists t3 ;
-drop table if exists t4 ;
-drop table if exists t5 ;
-drop table if exists t6 ;
-create table t1 (col1 datetime) engine='MYISAM'
-partition by range(datediff(col1,col1))
-(partition p0 values less than (15),
-partition p1 values less than (31));
-create table t2 (col1 datetime) engine='MYISAM'
-partition by list(datediff(col1,col1))
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30));
-create table t3 (col1 datetime) engine='MYISAM'
-partition by hash(datediff(col1,col1));
-create table t4 (colint int, col1 datetime) engine='MYISAM'
-partition by range(colint)
-subpartition by hash(datediff(col1,col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than (31));
-create table t5 (colint int, col1 datetime) engine='MYISAM'
-partition by list(colint)
-subpartition by hash(datediff(col1,col1)) subpartitions 2
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30));
-create table t6 (colint int, col1 datetime) engine='MYISAM'
-partition by range(colint)
-(partition p0 values less than (datediff('1997-11-30 23:59:59','1997-12-31')),
-partition p1 values less than maxvalue);
-drop table if exists t11 ;
-drop table if exists t22 ;
-drop table if exists t33 ;
-drop table if exists t44 ;
-drop table if exists t55 ;
-drop table if exists t66 ;
-create table t11 (col1 datetime) engine='MYISAM' ;
-create table t22 (col1 datetime) engine='MYISAM' ;
-create table t33 (col1 datetime) engine='MYISAM' ;
-create table t44 (colint int, col1 datetime) engine='MYISAM' ;
-create table t55 (colint int, col1 datetime) engine='MYISAM' ;
-create table t66 (colint int, col1 datetime) engine='MYISAM' ;
-alter table t11
-partition by range(datediff(col1,col1))
-(partition p0 values less than (15),
-partition p1 values less than (31));
-alter table t22
-partition by list(datediff(col1,col1))
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30));
-alter table t33
-partition by hash(datediff(col1,col1));
-alter table t44
-partition by range(colint)
-subpartition by hash(datediff(col1,col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than (31));
-alter table t55
-partition by list(colint)
-subpartition by hash(datediff(col1,col1)) subpartitions 2
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30));
-alter table t66
-partition by range(colint)
-(partition p0 values less than (datediff('1997-11-30 23:59:59','1997-12-31')),
-partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2154,7 +2552,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- period_add(col1,5) in partition with coltype datetime
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2165,28 +2563,34 @@ create table t1 (col1 datetime) engine='MYISAM'
partition by range(period_add(col1,5))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 datetime) engine='MYISAM'
partition by list(period_add(col1,5))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 datetime) engine='MYISAM'
partition by hash(period_add(col1,5));
+Got one of the listed errors
create table t4 (colint int, col1 datetime) engine='MYISAM'
partition by range(colint)
subpartition by hash(period_add(col1,5)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 datetime) engine='MYISAM'
partition by list(colint)
subpartition by hash(period_add(col1,5)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 datetime) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (period_add(9804,5)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -2203,28 +2607,34 @@ alter table t11
partition by range(period_add(col1,5))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(period_add(col1,5))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(period_add(col1,5));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(period_add(col1,5)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(period_add(col1,5)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (period_add(9804,5)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2240,7 +2650,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- period_diff(col1,col2) in partition with coltype datetime,col2 datetime
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2251,28 +2661,34 @@ create table t1 (col1 datetime,col2 datetime) engine='MYISAM'
partition by range(period_diff(col1,col2))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 datetime,col2 datetime) engine='MYISAM'
partition by list(period_diff(col1,col2))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 datetime,col2 datetime) engine='MYISAM'
partition by hash(period_diff(col1,col2));
+Got one of the listed errors
create table t4 (colint int, col1 datetime,col2 datetime) engine='MYISAM'
partition by range(colint)
subpartition by hash(period_diff(col1,col2)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 datetime,col2 datetime) engine='MYISAM'
partition by list(colint)
subpartition by hash(period_diff(col1,col2)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 datetime,col2 datetime) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (period_diff(9809,199907)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -2289,28 +2705,34 @@ alter table t11
partition by range(period_diff(col1,col2))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(period_diff(col1,col2))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(period_diff(col1,col2));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(period_diff(col1,col2)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(period_diff(col1,col2)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (period_diff(9809,199907)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2326,7 +2748,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- period_diff(col1,col2) in partition with coltype int,col2 int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2337,28 +2759,34 @@ create table t1 (col1 int,col2 int) engine='MYISAM'
partition by range(period_diff(col1,col2))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int,col2 int) engine='MYISAM'
partition by list(period_diff(col1,col2))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int,col2 int) engine='MYISAM'
partition by hash(period_diff(col1,col2));
+Got one of the listed errors
create table t4 (colint int, col1 int,col2 int) engine='MYISAM'
partition by range(colint)
subpartition by hash(period_diff(col1,col2)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int,col2 int) engine='MYISAM'
partition by list(colint)
subpartition by hash(period_diff(col1,col2)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int,col2 int) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (period_diff(9809,199907)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -2375,28 +2803,34 @@ alter table t11
partition by range(period_diff(col1,col2))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(period_diff(col1,col2))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(period_diff(col1,col2));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(period_diff(col1,col2)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(period_diff(col1,col2)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (period_diff(9809,199907)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2412,7 +2846,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- timestampdiff(day,5,col1) in partition with coltype datetime
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2423,28 +2857,34 @@ create table t1 (col1 datetime) engine='MYISAM'
partition by range(timestampdiff(day,5,col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 datetime) engine='MYISAM'
partition by list(timestampdiff(day,5,col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 datetime) engine='MYISAM'
partition by hash(timestampdiff(day,5,col1));
+Got one of the listed errors
create table t4 (colint int, col1 datetime) engine='MYISAM'
partition by range(colint)
subpartition by hash(timestampdiff(day,5,col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 datetime) engine='MYISAM'
partition by list(colint)
subpartition by hash(timestampdiff(day,5,col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 datetime) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (timestampdiff(YEAR,'2002-05-01','2001-01-01')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -2461,28 +2901,34 @@ alter table t11
partition by range(timestampdiff(day,5,col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(timestampdiff(day,5,col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(timestampdiff(day,5,col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(timestampdiff(day,5,col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(timestampdiff(day,5,col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (timestampdiff(YEAR,'2002-05-01','2001-01-01')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2498,7 +2944,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- unix_timestamp(col1) in partition with coltype date
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2509,28 +2955,34 @@ create table t1 (col1 date) engine='MYISAM'
partition by range(unix_timestamp(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 date) engine='MYISAM'
partition by list(unix_timestamp(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 date) engine='MYISAM'
partition by hash(unix_timestamp(col1));
+Got one of the listed errors
create table t4 (colint int, col1 date) engine='MYISAM'
partition by range(colint)
subpartition by hash(unix_timestamp(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 date) engine='MYISAM'
partition by list(colint)
subpartition by hash(unix_timestamp(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 date) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (unix_timestamp ('2002-05-01')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -2547,28 +2999,34 @@ alter table t11
partition by range(unix_timestamp(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(unix_timestamp(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(unix_timestamp(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(unix_timestamp(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(unix_timestamp(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (unix_timestamp ('2002-05-01')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2584,7 +3042,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- week(col1) in partition with coltype datetime
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2595,28 +3053,34 @@ create table t1 (col1 datetime) engine='MYISAM'
partition by range(week(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 datetime) engine='MYISAM'
partition by list(week(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 datetime) engine='MYISAM'
partition by hash(week(col1));
+Got one of the listed errors
create table t4 (colint int, col1 datetime) engine='MYISAM'
partition by range(colint)
subpartition by hash(week(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 datetime) engine='MYISAM'
partition by list(colint)
subpartition by hash(week(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 datetime) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (week('2002-05-01')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -2633,28 +3097,132 @@ alter table t11
partition by range(week(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(week(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(week(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(week(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(week(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (week('2002-05-01')),
partition p1 values less than maxvalue);
+Got one of the listed errors
+drop table if exists t1 ;
+drop table if exists t2 ;
+drop table if exists t3 ;
+drop table if exists t4 ;
+drop table if exists t5 ;
+drop table if exists t6 ;
+drop table if exists t11 ;
+drop table if exists t22 ;
+drop table if exists t33 ;
+drop table if exists t44 ;
+drop table if exists t55 ;
+drop table if exists t66 ;
+-------------------------------------------------------------------------
+--- weekofyear(col1) in partition with coltype datetime
+-------------------------------------------------------------------------
+must all fail!
+drop table if exists t1 ;
+drop table if exists t2 ;
+drop table if exists t3 ;
+drop table if exists t4 ;
+drop table if exists t5 ;
+drop table if exists t6 ;
+create table t1 (col1 datetime) engine='MYISAM'
+partition by range(weekofyear(col1))
+(partition p0 values less than (15),
+partition p1 values less than (31));
+Got one of the listed errors
+create table t2 (col1 datetime) engine='MYISAM'
+partition by list(weekofyear(col1))
+(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
+partition p1 values in (11,12,13,14,15,16,17,18,19,20),
+partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
+create table t3 (col1 datetime) engine='MYISAM'
+partition by hash(weekofyear(col1));
+Got one of the listed errors
+create table t4 (colint int, col1 datetime) engine='MYISAM'
+partition by range(colint)
+subpartition by hash(weekofyear(col1)) subpartitions 2
+(partition p0 values less than (15),
+partition p1 values less than (31));
+Got one of the listed errors
+create table t5 (colint int, col1 datetime) engine='MYISAM'
+partition by list(colint)
+subpartition by hash(weekofyear(col1)) subpartitions 2
+(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
+partition p1 values in (11,12,13,14,15,16,17,18,19,20),
+partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
+create table t6 (colint int, col1 datetime) engine='MYISAM'
+partition by range(colint)
+(partition p0 values less than (weekofyear('2002-05-01')),
+partition p1 values less than maxvalue);
+Got one of the listed errors
+drop table if exists t11 ;
+drop table if exists t22 ;
+drop table if exists t33 ;
+drop table if exists t44 ;
+drop table if exists t55 ;
+drop table if exists t66 ;
+create table t11 (col1 datetime) engine='MYISAM' ;
+create table t22 (col1 datetime) engine='MYISAM' ;
+create table t33 (col1 datetime) engine='MYISAM' ;
+create table t44 (colint int, col1 datetime) engine='MYISAM' ;
+create table t55 (colint int, col1 datetime) engine='MYISAM' ;
+create table t66 (colint int, col1 datetime) engine='MYISAM' ;
+alter table t11
+partition by range(weekofyear(col1))
+(partition p0 values less than (15),
+partition p1 values less than (31));
+Got one of the listed errors
+alter table t22
+partition by list(weekofyear(col1))
+(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
+partition p1 values in (11,12,13,14,15,16,17,18,19,20),
+partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
+alter table t33
+partition by hash(weekofyear(col1));
+Got one of the listed errors
+alter table t44
+partition by range(colint)
+subpartition by hash(weekofyear(col1)) subpartitions 2
+(partition p0 values less than (15),
+partition p1 values less than (31));
+Got one of the listed errors
+alter table t55
+partition by list(colint)
+subpartition by hash(weekofyear(col1)) subpartitions 2
+(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
+partition p1 values in (11,12,13,14,15,16,17,18,19,20),
+partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
+alter table t66
+partition by range(colint)
+(partition p0 values less than (weekofyear('2002-05-01')),
+partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2670,7 +3238,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- cast(col1 as signed) in partition with coltype varchar(30)
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2681,28 +3249,34 @@ create table t1 (col1 varchar(30)) engine='MYISAM'
partition by range(cast(col1 as signed))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 varchar(30)) engine='MYISAM'
partition by list(cast(col1 as signed))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 varchar(30)) engine='MYISAM'
partition by hash(cast(col1 as signed));
+Got one of the listed errors
create table t4 (colint int, col1 varchar(30)) engine='MYISAM'
partition by range(colint)
subpartition by hash(cast(col1 as signed)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 varchar(30)) engine='MYISAM'
partition by list(colint)
subpartition by hash(cast(col1 as signed)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 varchar(30)) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (cast(123 as signed)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -2719,28 +3293,34 @@ alter table t11
partition by range(cast(col1 as signed))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(cast(col1 as signed))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(cast(col1 as signed));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(cast(col1 as signed)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(cast(col1 as signed)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (cast(123 as signed)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2756,7 +3336,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- convert(col1,unsigned) in partition with coltype varchar(30)
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2767,28 +3347,34 @@ create table t1 (col1 varchar(30)) engine='MYISAM'
partition by range(convert(col1,unsigned))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 varchar(30)) engine='MYISAM'
partition by list(convert(col1,unsigned))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 varchar(30)) engine='MYISAM'
partition by hash(convert(col1,unsigned));
+Got one of the listed errors
create table t4 (colint int, col1 varchar(30)) engine='MYISAM'
partition by range(colint)
subpartition by hash(convert(col1,unsigned)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 varchar(30)) engine='MYISAM'
partition by list(colint)
subpartition by hash(convert(col1,unsigned)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 varchar(30)) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (convert(123,unsigned)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -2805,28 +3391,34 @@ alter table t11
partition by range(convert(col1,unsigned))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(convert(col1,unsigned))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(convert(col1,unsigned));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(convert(col1,unsigned)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(convert(col1,unsigned)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (convert(123,unsigned)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2842,7 +3434,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- col1 | 20 in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2853,28 +3445,34 @@ create table t1 (col1 int) engine='MYISAM'
partition by range(col1 | 20)
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='MYISAM'
partition by list(col1 | 20)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='MYISAM'
partition by hash(col1 | 20);
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
subpartition by hash(col1 | 20) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='MYISAM'
partition by list(colint)
subpartition by hash(col1 | 20) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (10 | 20),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -2891,28 +3489,34 @@ alter table t11
partition by range(col1 | 20)
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(col1 | 20)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(col1 | 20);
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(col1 | 20) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(col1 | 20) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (10 | 20),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2928,7 +3532,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- col1 & 20 in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -2939,28 +3543,34 @@ create table t1 (col1 int) engine='MYISAM'
partition by range(col1 & 20)
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='MYISAM'
partition by list(col1 & 20)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='MYISAM'
partition by hash(col1 & 20);
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
subpartition by hash(col1 & 20) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='MYISAM'
partition by list(colint)
subpartition by hash(col1 & 20) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (10 & 20),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -2977,28 +3587,34 @@ alter table t11
partition by range(col1 & 20)
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(col1 & 20)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(col1 & 20);
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(col1 & 20) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(col1 & 20) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (10 & 20),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3014,7 +3630,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- col1 ^ 20 in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3025,28 +3641,34 @@ create table t1 (col1 int) engine='MYISAM'
partition by range(col1 ^ 20)
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='MYISAM'
partition by list(col1 ^ 20)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='MYISAM'
partition by hash(col1 ^ 20);
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
subpartition by hash(col1 ^ 20) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='MYISAM'
partition by list(colint)
subpartition by hash(col1 ^ 20) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (10 ^ 20),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -3063,28 +3685,34 @@ alter table t11
partition by range(col1 ^ 20)
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(col1 ^ 20)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(col1 ^ 20);
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(col1 ^ 20) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(col1 ^ 20) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (10 ^ 20),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3100,7 +3728,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- col1 << 20 in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3111,28 +3739,34 @@ create table t1 (col1 int) engine='MYISAM'
partition by range(col1 << 20)
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='MYISAM'
partition by list(col1 << 20)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='MYISAM'
partition by hash(col1 << 20);
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
subpartition by hash(col1 << 20) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='MYISAM'
partition by list(colint)
subpartition by hash(col1 << 20) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (10 << 20),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -3149,28 +3783,34 @@ alter table t11
partition by range(col1 << 20)
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(col1 << 20)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(col1 << 20);
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(col1 << 20) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(col1 << 20) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (10 << 20),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3186,7 +3826,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- col1 >> 20 in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3197,28 +3837,34 @@ create table t1 (col1 int) engine='MYISAM'
partition by range(col1 >> 20)
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='MYISAM'
partition by list(col1 >> 20)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='MYISAM'
partition by hash(col1 >> 20);
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
subpartition by hash(col1 >> 20) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='MYISAM'
partition by list(colint)
subpartition by hash(col1 >> 20) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (10 >> 20),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -3235,28 +3881,34 @@ alter table t11
partition by range(col1 >> 20)
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(col1 >> 20)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(col1 >> 20);
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(col1 >> 20) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(col1 >> 20) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (10 >> 20),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3272,7 +3924,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- ~col1 in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3283,28 +3935,34 @@ create table t1 (col1 int) engine='MYISAM'
partition by range(~col1)
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='MYISAM'
partition by list(~col1)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='MYISAM'
partition by hash(~col1);
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
subpartition by hash(~col1) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='MYISAM'
partition by list(colint)
subpartition by hash(~col1) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (~20),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -3321,28 +3979,34 @@ alter table t11
partition by range(~col1)
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(~col1)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(~col1);
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(~col1) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(~col1) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (~20),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3358,7 +4022,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- bit_count(col1) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3369,28 +4033,34 @@ create table t1 (col1 int) engine='MYISAM'
partition by range(bit_count(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='MYISAM'
partition by list(bit_count(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='MYISAM'
partition by hash(bit_count(col1));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
subpartition by hash(bit_count(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='MYISAM'
partition by list(colint)
subpartition by hash(bit_count(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (bit_count(20)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -3407,28 +4077,34 @@ alter table t11
partition by range(bit_count(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(bit_count(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(bit_count(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(bit_count(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(bit_count(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (bit_count(20)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3444,7 +4120,7 @@ drop table if exists t66 ;
-------------------------------------------------------------------------
--- inet_aton(col1) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3455,28 +4131,34 @@ create table t1 (col1 int) engine='MYISAM'
partition by range(inet_aton(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t2 (col1 int) engine='MYISAM'
partition by list(inet_aton(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t3 (col1 int) engine='MYISAM'
partition by hash(inet_aton(col1));
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
subpartition by hash(inet_aton(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='MYISAM'
partition by list(colint)
subpartition by hash(inet_aton(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (inet_aton('192.168.1.1')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -3493,28 +4175,34 @@ alter table t11
partition by range(inet_aton(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t22
partition by list(inet_aton(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t33
partition by hash(inet_aton(col1));
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(inet_aton(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(inet_aton(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (inet_aton('192.168.1.1')),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3531,7 +4219,7 @@ set @var =20;
-------------------------------------------------------------------------
--- bit_length(col1)+@var-@var in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3542,35 +4230,34 @@ create table t1 (col1 int) engine='MYISAM'
partition by range(bit_length(col1)+@var-@var)
(partition p0 values less than (15),
partition p1 values less than (31));
-ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')
-(partition p0 values less than (15),
-partition p1 values less than (31))' at line 2
+Got one of the listed errors
create table t2 (col1 int) engine='MYISAM'
partition by list(bit_length(col1)+@var-@var)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
-ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12' at line 2
+Got one of the listed errors
create table t3 (col1 int) engine='MYISAM'
partition by hash(bit_length(col1)+@var-@var);
-ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
subpartition by hash(bit_length(col1)+@var-@var) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='MYISAM'
partition by list(colint)
subpartition by hash(bit_length(col1)+@var-@var) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (bit_length(20)+@var-@var),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -3587,35 +4274,34 @@ alter table t11
partition by range(bit_length(col1)+@var-@var)
(partition p0 values less than (15),
partition p1 values less than (31));
-ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')
-(partition p0 values less than (15),
-partition p1 values less than (31))' at line 2
+Got one of the listed errors
alter table t22
partition by list(bit_length(col1)+@var-@var)
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
-ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12' at line 2
+Got one of the listed errors
alter table t33
partition by hash(bit_length(col1)+@var-@var);
-ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(bit_length(col1)+@var-@var) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(bit_length(col1)+@var-@var) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (bit_length(20)+@var-@var),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3652,7 +4338,7 @@ end//
-------------------------------------------------------------------------
--- getmaxsigned_t1(col1) in partition with coltype int
-------------------------------------------------------------------------
-must all fail! (delete 0 and comment char, if bug fixed)
+must all fail!
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
@@ -3663,35 +4349,34 @@ create table t1 (col1 int) engine='MYISAM'
partition by range(getmaxsigned_t1(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
-ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')
-(partition p0 values less than (15),
-partition p1 values less than (31))' at line 2
+Got one of the listed errors
create table t2 (col1 int) engine='MYISAM'
partition by list(getmaxsigned_t1(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
-ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12' at line 2
+Got one of the listed errors
create table t3 (col1 int) engine='MYISAM'
partition by hash(getmaxsigned_t1(col1));
-ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2
+Got one of the listed errors
create table t4 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
subpartition by hash(getmaxsigned_t1(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
create table t5 (colint int, col1 int) engine='MYISAM'
partition by list(colint)
subpartition by hash(getmaxsigned_t1(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
create table t6 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
(partition p0 values less than (getmaxsigned(10)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t11 ;
drop table if exists t22 ;
drop table if exists t33 ;
@@ -3708,35 +4393,34 @@ alter table t11
partition by range(getmaxsigned_t1(col1))
(partition p0 values less than (15),
partition p1 values less than (31));
-ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')
-(partition p0 values less than (15),
-partition p1 values less than (31))' at line 2
+Got one of the listed errors
alter table t22
partition by list(getmaxsigned_t1(col1))
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
-ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12' at line 2
+Got one of the listed errors
alter table t33
partition by hash(getmaxsigned_t1(col1));
-ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2
+Got one of the listed errors
alter table t44
partition by range(colint)
subpartition by hash(getmaxsigned_t1(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than (31));
+Got one of the listed errors
alter table t55
partition by list(colint)
subpartition by hash(getmaxsigned_t1(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
+Got one of the listed errors
alter table t66
partition by range(colint)
(partition p0 values less than (getmaxsigned(10)),
partition p1 values less than maxvalue);
+Got one of the listed errors
drop table if exists t1 ;
drop table if exists t2 ;
drop table if exists t3 ;
diff --git a/mysql-test/suite/parts/r/part_supported_sql_func_innodb.result b/mysql-test/suite/parts/r/part_supported_sql_func_innodb.result
index 1e158e0a787..c47c22ed363 100644
--- a/mysql-test/suite/parts/r/part_supported_sql_func_innodb.result
+++ b/mysql-test/suite/parts/r/part_supported_sql_func_innodb.result
@@ -55,9 +55,9 @@ insert into t2 values (17 );
insert into t3 values (5 );
insert into t3 values (13 );
insert into t3 values (17 );
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_int.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_int.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_int.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t6;
select abs(col1) from t1 order by col1;
abs(col1)
5
@@ -1675,7 +1675,7 @@ drop table if exists t44 ;
drop table if exists t55 ;
drop table if exists t66 ;
-------------------------------------------------------------------------
---- ascii(col1) in partition with coltype char(1)
+--- mod(col1,10) in partition with coltype int
-------------------------------------------------------------------------
drop table if exists t1 ;
drop table if exists t2 ;
@@ -1684,1510 +1684,14 @@ drop table if exists t4 ;
drop table if exists t5 ;
drop table if exists t6 ;
-------------------------------------------------------------------------
---- Create tables with ascii(col1)
+--- Create tables with mod(col1,10)
-------------------------------------------------------------------------
-create table t1 (col1 char(1)) engine='INNODB'
-partition by range(ascii(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 char(1)) engine='INNODB'
-partition by list(ascii(col1))
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-create table t3 (col1 char(1)) engine='INNODB'
-partition by hash(ascii(col1));
-create table t4 (colint int, col1 char(1)) engine='INNODB'
-partition by range(colint)
-subpartition by hash(ascii(col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t5 (colint int, col1 char(1)) engine='INNODB'
-partition by list(colint)
-subpartition by hash(ascii(col1)) subpartitions 2
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-create table t6 (colint int, col1 char(1)) engine='INNODB'
-partition by range(colint)
-(partition p0 values less than (ascii('5')),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with ascii(col1)
--------------------------------------------------------------------------
-insert into t1 values ('1');
-insert into t1 values ('9');
-insert into t2 values ('1');
-insert into t2 values ('9');
-insert into t2 values ('3');
-insert into t3 values ('1');
-insert into t3 values ('9');
-insert into t3 values ('3');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc' into table t6;
-select ascii(col1) from t1 order by col1;
-ascii(col1)
-49
-57
-select * from t1 order by col1;
-col1
-1
-9
-select * from t2 order by col1;
-col1
-1
-3
-9
-select * from t3 order by col1;
-col1
-1
-3
-9
-select * from t4 order by colint;
-colint col1
-1 1
-2 9
-3 3
-4 8
-select * from t5 order by colint;
-colint col1
-1 1
-2 9
-3 3
-4 8
-select * from t6 order by colint;
-colint col1
-1 1
-2 9
-3 3
-4 8
-update t1 set col1='8' where col1='1';
-update t2 set col1='8' where col1='1';
-update t3 set col1='8' where col1='1';
-update t4 set col1='8' where col1='1';
-update t5 set col1='8' where col1='1';
-update t6 set col1='8' where col1='1';
-select * from t1 order by col1;
-col1
-8
-9
-select * from t2 order by col1;
-col1
-3
-8
-9
-select * from t3 order by col1;
-col1
-3
-8
-9
-select * from t4 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-select * from t5 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-select * from t6 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
--------------------------------------------------------------------------
---- Alter tables with ascii(col1)
--------------------------------------------------------------------------
-drop table if exists t11 ;
-drop table if exists t22 ;
-drop table if exists t33 ;
-drop table if exists t44 ;
-drop table if exists t55 ;
-drop table if exists t66 ;
-create table t11 engine='INNODB' as select * from t1;
-create table t22 engine='INNODB' as select * from t2;
-create table t33 engine='INNODB' as select * from t3;
-create table t44 engine='INNODB' as select * from t4;
-create table t55 engine='INNODB' as select * from t5;
-create table t66 engine='INNODB' as select * from t6;
-alter table t11
-partition by range(ascii(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(ascii(col1))
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-alter table t33
-partition by hash(ascii(col1));
-alter table t44
-partition by range(colint)
-subpartition by hash(ascii(col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t55
-partition by list(colint)
-subpartition by hash(ascii(col1)) subpartitions 2
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-alter table t66
-partition by range(colint)
-(partition p0 values less than (ascii('5')),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-8
-9
-select * from t22 order by col1;
-col1
-3
-8
-9
-select * from t33 order by col1;
-col1
-3
-8
-9
-select * from t44 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-select * from t55 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-select * from t66 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
----------------------------
----- some alter table begin
----------------------------
-alter table t11
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-8
-9
-alter table t11
-reorganize partition s1 into
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-8
-9
-alter table t55
-partition by list(colint)
-subpartition by hash(ascii(col1)) subpartitions 5
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-show create table t55;
-Table Create Table
-t55 CREATE TABLE `t55` (
- `colint` int(11) DEFAULT NULL,
- `col1` char(1) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (ascii(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
-select * from t55 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-alter table t66
-reorganize partition s1 into
-(partition p0 values less than (ascii('5')),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-alter table t66
-reorganize partition s1 into
-(partition p0 values less than (ascii('5')),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with ascii(col1)
--------------------------------------------------------------------------
-delete from t1 where col1='9';
-delete from t2 where col1='9';
-delete from t3 where col1='9';
-delete from t4 where col1='9';
-delete from t5 where col1='9';
-delete from t6 where col1='9';
-select * from t1 order by col1;
-col1
-8
-select * from t2 order by col1;
-col1
-3
-8
-select * from t3 order by col1;
-col1
-3
-8
-select * from t4 order by colint;
-colint col1
-1 8
-3 3
-4 8
-select * from t5 order by colint;
-colint col1
-1 8
-3 3
-4 8
-insert into t1 values ('9');
-insert into t2 values ('9');
-insert into t3 values ('9');
-insert into t4 values (60,'9');
-insert into t5 values (60,'9');
-insert into t6 values (60,'9');
-select * from t1 order by col1;
-col1
-8
-9
-select * from t2 order by col1;
-col1
-3
-8
-9
-select * from t3 order by col1;
-col1
-3
-8
-9
-select * from t4 order by colint;
-colint col1
-1 8
-3 3
-4 8
-60 9
-select * from t5 order by colint;
-colint col1
-1 8
-3 3
-4 8
-60 9
-select * from t6 order by colint;
-colint col1
-1 8
-3 3
-4 8
-60 9
-alter table t1 drop partition p0;
-alter table t2 drop partition p0;
-alter table t4 drop partition p0;
-alter table t5 drop partition p0;
-alter table t6 drop partition p0;
-select * from t1 order by col1;
-col1
-8
-9
-select * from t2 order by col1;
-col1
-3
-8
-9
-select * from t3 order by col1;
-col1
-3
-8
-9
-select * from t4 order by colint;
-colint col1
-60 9
-select * from t5 order by colint;
-colint col1
-60 9
-select * from t6 order by colint;
-colint col1
-60 9
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with ascii(col1)
--------------------------------------------------------------------------
-delete from t11 where col1='9';
-delete from t22 where col1='9';
-delete from t33 where col1='9';
-delete from t44 where col1='9';
-delete from t55 where col1='9';
-delete from t66 where col1='9';
-select * from t11 order by col1;
-col1
-8
-select * from t22 order by col1;
-col1
-3
-8
-select * from t33 order by col1;
-col1
-3
-8
-select * from t44 order by colint;
-colint col1
-1 8
-3 3
-4 8
-select * from t55 order by colint;
-colint col1
-1 8
-3 3
-4 8
-insert into t11 values ('9');
-insert into t22 values ('9');
-insert into t33 values ('9');
-insert into t44 values (60,'9');
-insert into t55 values (60,'9');
-insert into t66 values (60,'9');
-select * from t11 order by col1;
-col1
-8
-9
-select * from t22 order by col1;
-col1
-3
-8
-9
-select * from t33 order by col1;
-col1
-3
-8
-9
-select * from t44 order by colint;
-colint col1
-1 8
-3 3
-4 8
-60 9
-select * from t55 order by colint;
-colint col1
-1 8
-3 3
-4 8
-60 9
-select * from t66 order by colint;
-colint col1
-1 8
-3 3
-4 8
-60 9
-alter table t11 drop partition p0;
-alter table t22 drop partition p0;
-alter table t44 drop partition p0;
-alter table t55 drop partition p0;
-alter table t66 drop partition p0;
-select * from t11 order by col1;
-col1
-8
-9
-select * from t22 order by col1;
-col1
-3
-8
-9
-select * from t33 order by col1;
-col1
-3
-8
-9
-select * from t44 order by colint;
-colint col1
-60 9
-select * from t55 order by colint;
-colint col1
-60 9
-select * from t66 order by colint;
-colint col1
-60 9
--------------------------
----- some alter table end
--------------------------
-drop table if exists t1 ;
-drop table if exists t2 ;
-drop table if exists t3 ;
-drop table if exists t4 ;
-drop table if exists t5 ;
-drop table if exists t6 ;
-drop table if exists t11 ;
-drop table if exists t22 ;
-drop table if exists t33 ;
-drop table if exists t44 ;
-drop table if exists t55 ;
-drop table if exists t66 ;
--------------------------------------------------------------------------
---- cast(ceiling(col1) as signed integer) in partition with coltype float(7,4)
--------------------------------------------------------------------------
-drop table if exists t1 ;
-drop table if exists t2 ;
-drop table if exists t3 ;
-drop table if exists t4 ;
-drop table if exists t5 ;
-drop table if exists t6 ;
--------------------------------------------------------------------------
---- Create tables with cast(ceiling(col1) as signed integer)
--------------------------------------------------------------------------
-create table t1 (col1 float(7,4)) engine='INNODB'
-partition by range(cast(ceiling(col1) as signed integer))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 float(7,4)) engine='INNODB'
-partition by list(cast(ceiling(col1) as signed integer))
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-create table t3 (col1 float(7,4)) engine='INNODB'
-partition by hash(cast(ceiling(col1) as signed integer));
-create table t4 (colint int, col1 float(7,4)) engine='INNODB'
-partition by range(colint)
-subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t5 (colint int, col1 float(7,4)) engine='INNODB'
-partition by list(colint)
-subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-create table t6 (colint int, col1 float(7,4)) engine='INNODB'
-partition by range(colint)
-(partition p0 values less than (cast(ceiling(15) as signed integer)),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with cast(ceiling(col1) as signed integer)
--------------------------------------------------------------------------
-insert into t1 values (5.1230);
-insert into t1 values (13.345);
-insert into t2 values (5.1230);
-insert into t2 values (13.345);
-insert into t2 values (17.987);
-insert into t3 values (5.1230);
-insert into t3 values (13.345);
-insert into t3 values (17.987);
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t6;
-select cast(ceiling(col1) as signed integer) from t1 order by col1;
-cast(ceiling(col1) as signed integer)
-6
-14
-select * from t1 order by col1;
-col1
-5.1230
-13.3450
-select * from t2 order by col1;
-col1
-5.1230
-13.3450
-17.9870
-select * from t3 order by col1;
-col1
-5.1230
-13.3450
-17.9870
-select * from t4 order by colint;
-colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
-select * from t5 order by colint;
-colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
-select * from t6 order by colint;
-colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
-update t1 set col1=15.654 where col1=5.1230;
-update t2 set col1=15.654 where col1=5.1230;
-update t3 set col1=15.654 where col1=5.1230;
-update t4 set col1=15.654 where col1=5.1230;
-update t5 set col1=15.654 where col1=5.1230;
-update t6 set col1=15.654 where col1=5.1230;
-select * from t1 order by col1;
-col1
-13.3450
-15.6540
-select * from t2 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t3 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t4 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-select * from t5 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-select * from t6 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
--------------------------------------------------------------------------
---- Alter tables with cast(ceiling(col1) as signed integer)
--------------------------------------------------------------------------
-drop table if exists t11 ;
-drop table if exists t22 ;
-drop table if exists t33 ;
-drop table if exists t44 ;
-drop table if exists t55 ;
-drop table if exists t66 ;
-create table t11 engine='INNODB' as select * from t1;
-create table t22 engine='INNODB' as select * from t2;
-create table t33 engine='INNODB' as select * from t3;
-create table t44 engine='INNODB' as select * from t4;
-create table t55 engine='INNODB' as select * from t5;
-create table t66 engine='INNODB' as select * from t6;
-alter table t11
-partition by range(cast(ceiling(col1) as signed integer))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(cast(ceiling(col1) as signed integer))
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-alter table t33
-partition by hash(cast(ceiling(col1) as signed integer));
-alter table t44
-partition by range(colint)
-subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t55
-partition by list(colint)
-subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-alter table t66
-partition by range(colint)
-(partition p0 values less than (cast(ceiling(15) as signed integer)),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-13.3450
-15.6540
-select * from t22 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t33 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t44 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-select * from t55 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-select * from t66 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
----------------------------
----- some alter table begin
----------------------------
-alter table t11
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-13.3450
-15.6540
-alter table t11
-reorganize partition s1 into
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-13.3450
-15.6540
-alter table t55
-partition by list(colint)
-subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 5
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-show create table t55;
-Table Create Table
-t55 CREATE TABLE `t55` (
- `colint` int(11) DEFAULT NULL,
- `col1` float(7,4) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(ceiling(col1) as signed integer)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
-select * from t55 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-alter table t66
-reorganize partition s1 into
-(partition p0 values less than (cast(ceiling(15) as signed integer)),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-alter table t66
-reorganize partition s1 into
-(partition p0 values less than (cast(ceiling(15) as signed integer)),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with cast(ceiling(col1) as signed integer)
--------------------------------------------------------------------------
-delete from t1 where col1=13.345;
-delete from t2 where col1=13.345;
-delete from t3 where col1=13.345;
-delete from t4 where col1=13.345;
-delete from t5 where col1=13.345;
-delete from t6 where col1=13.345;
-select * from t1 order by col1;
-col1
-15.6540
-select * from t2 order by col1;
-col1
-15.6540
-17.9870
-select * from t3 order by col1;
-col1
-15.6540
-17.9870
-select * from t4 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-select * from t5 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-insert into t1 values (13.345);
-insert into t2 values (13.345);
-insert into t3 values (13.345);
-insert into t4 values (60,13.345);
-insert into t5 values (60,13.345);
-insert into t6 values (60,13.345);
-select * from t1 order by col1;
-col1
-13.3450
-15.6540
-select * from t2 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t3 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t4 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-60 13.3450
-select * from t5 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-60 13.3450
-select * from t6 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-60 13.3450
-alter table t1 drop partition p0;
-alter table t2 drop partition p0;
-alter table t4 drop partition p0;
-alter table t5 drop partition p0;
-alter table t6 drop partition p0;
-select * from t1 order by col1;
-col1
-15.6540
-select * from t2 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t3 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t4 order by colint;
-colint col1
-60 13.3450
-select * from t5 order by colint;
-colint col1
-60 13.3450
-select * from t6 order by colint;
-colint col1
-60 13.3450
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with cast(ceiling(col1) as signed integer)
--------------------------------------------------------------------------
-delete from t11 where col1=13.345;
-delete from t22 where col1=13.345;
-delete from t33 where col1=13.345;
-delete from t44 where col1=13.345;
-delete from t55 where col1=13.345;
-delete from t66 where col1=13.345;
-select * from t11 order by col1;
-col1
-15.6540
-select * from t22 order by col1;
-col1
-15.6540
-17.9870
-select * from t33 order by col1;
-col1
-15.6540
-17.9870
-select * from t44 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-select * from t55 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-insert into t11 values (13.345);
-insert into t22 values (13.345);
-insert into t33 values (13.345);
-insert into t44 values (60,13.345);
-insert into t55 values (60,13.345);
-insert into t66 values (60,13.345);
-select * from t11 order by col1;
-col1
-13.3450
-15.6540
-select * from t22 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t33 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t44 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-60 13.3450
-select * from t55 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-60 13.3450
-select * from t66 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-60 13.3450
-alter table t11 drop partition p0;
-alter table t22 drop partition p0;
-alter table t44 drop partition p0;
-alter table t55 drop partition p0;
-alter table t66 drop partition p0;
-select * from t11 order by col1;
-col1
-15.6540
-select * from t22 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t33 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t44 order by colint;
-colint col1
-60 13.3450
-select * from t55 order by colint;
-colint col1
-60 13.3450
-select * from t66 order by colint;
-colint col1
-60 13.3450
--------------------------
----- some alter table end
--------------------------
-drop table if exists t1 ;
-drop table if exists t2 ;
-drop table if exists t3 ;
-drop table if exists t4 ;
-drop table if exists t5 ;
-drop table if exists t6 ;
-drop table if exists t11 ;
-drop table if exists t22 ;
-drop table if exists t33 ;
-drop table if exists t44 ;
-drop table if exists t55 ;
-drop table if exists t66 ;
--------------------------------------------------------------------------
---- cast(floor(col1) as signed) in partition with coltype float(7,4)
--------------------------------------------------------------------------
-drop table if exists t1 ;
-drop table if exists t2 ;
-drop table if exists t3 ;
-drop table if exists t4 ;
-drop table if exists t5 ;
-drop table if exists t6 ;
--------------------------------------------------------------------------
---- Create tables with cast(floor(col1) as signed)
--------------------------------------------------------------------------
-create table t1 (col1 float(7,4)) engine='INNODB'
-partition by range(cast(floor(col1) as signed))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 float(7,4)) engine='INNODB'
-partition by list(cast(floor(col1) as signed))
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-create table t3 (col1 float(7,4)) engine='INNODB'
-partition by hash(cast(floor(col1) as signed));
-create table t4 (colint int, col1 float(7,4)) engine='INNODB'
-partition by range(colint)
-subpartition by hash(cast(floor(col1) as signed)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t5 (colint int, col1 float(7,4)) engine='INNODB'
-partition by list(colint)
-subpartition by hash(cast(floor(col1) as signed)) subpartitions 2
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-create table t6 (colint int, col1 float(7,4)) engine='INNODB'
-partition by range(colint)
-(partition p0 values less than (cast(floor(15.123) as signed)),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with cast(floor(col1) as signed)
--------------------------------------------------------------------------
-insert into t1 values (5.1230);
-insert into t1 values (13.345);
-insert into t2 values (5.1230);
-insert into t2 values (13.345);
-insert into t2 values (17.987);
-insert into t3 values (5.1230);
-insert into t3 values (13.345);
-insert into t3 values (17.987);
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t6;
-select cast(floor(col1) as signed) from t1 order by col1;
-cast(floor(col1) as signed)
-5
-13
-select * from t1 order by col1;
-col1
-5.1230
-13.3450
-select * from t2 order by col1;
-col1
-5.1230
-13.3450
-17.9870
-select * from t3 order by col1;
-col1
-5.1230
-13.3450
-17.9870
-select * from t4 order by colint;
-colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
-select * from t5 order by colint;
-colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
-select * from t6 order by colint;
-colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
-update t1 set col1=15.654 where col1=5.1230;
-update t2 set col1=15.654 where col1=5.1230;
-update t3 set col1=15.654 where col1=5.1230;
-update t4 set col1=15.654 where col1=5.1230;
-update t5 set col1=15.654 where col1=5.1230;
-update t6 set col1=15.654 where col1=5.1230;
-select * from t1 order by col1;
-col1
-13.3450
-15.6540
-select * from t2 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t3 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t4 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-select * from t5 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-select * from t6 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
--------------------------------------------------------------------------
---- Alter tables with cast(floor(col1) as signed)
--------------------------------------------------------------------------
-drop table if exists t11 ;
-drop table if exists t22 ;
-drop table if exists t33 ;
-drop table if exists t44 ;
-drop table if exists t55 ;
-drop table if exists t66 ;
-create table t11 engine='INNODB' as select * from t1;
-create table t22 engine='INNODB' as select * from t2;
-create table t33 engine='INNODB' as select * from t3;
-create table t44 engine='INNODB' as select * from t4;
-create table t55 engine='INNODB' as select * from t5;
-create table t66 engine='INNODB' as select * from t6;
-alter table t11
-partition by range(cast(floor(col1) as signed))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(cast(floor(col1) as signed))
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-alter table t33
-partition by hash(cast(floor(col1) as signed));
-alter table t44
-partition by range(colint)
-subpartition by hash(cast(floor(col1) as signed)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t55
-partition by list(colint)
-subpartition by hash(cast(floor(col1) as signed)) subpartitions 2
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-alter table t66
-partition by range(colint)
-(partition p0 values less than (cast(floor(15.123) as signed)),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-13.3450
-15.6540
-select * from t22 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t33 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t44 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-select * from t55 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-select * from t66 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
----------------------------
----- some alter table begin
----------------------------
-alter table t11
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-13.3450
-15.6540
-alter table t11
-reorganize partition s1 into
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-13.3450
-15.6540
-alter table t55
-partition by list(colint)
-subpartition by hash(cast(floor(col1) as signed)) subpartitions 5
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-show create table t55;
-Table Create Table
-t55 CREATE TABLE `t55` (
- `colint` int(11) DEFAULT NULL,
- `col1` float(7,4) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(floor(col1) as signed)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
-select * from t55 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-alter table t66
-reorganize partition s1 into
-(partition p0 values less than (cast(floor(15.123) as signed)),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-alter table t66
-reorganize partition s1 into
-(partition p0 values less than (cast(floor(15.123) as signed)),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with cast(floor(col1) as signed)
--------------------------------------------------------------------------
-delete from t1 where col1=13.345;
-delete from t2 where col1=13.345;
-delete from t3 where col1=13.345;
-delete from t4 where col1=13.345;
-delete from t5 where col1=13.345;
-delete from t6 where col1=13.345;
-select * from t1 order by col1;
-col1
-15.6540
-select * from t2 order by col1;
-col1
-15.6540
-17.9870
-select * from t3 order by col1;
-col1
-15.6540
-17.9870
-select * from t4 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-select * from t5 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-insert into t1 values (13.345);
-insert into t2 values (13.345);
-insert into t3 values (13.345);
-insert into t4 values (60,13.345);
-insert into t5 values (60,13.345);
-insert into t6 values (60,13.345);
-select * from t1 order by col1;
-col1
-13.3450
-15.6540
-select * from t2 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t3 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t4 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-60 13.3450
-select * from t5 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-60 13.3450
-select * from t6 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-60 13.3450
-alter table t1 drop partition p0;
-alter table t2 drop partition p0;
-alter table t4 drop partition p0;
-alter table t5 drop partition p0;
-alter table t6 drop partition p0;
-select * from t1 order by col1;
-col1
-15.6540
-select * from t2 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t3 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t4 order by colint;
-colint col1
-60 13.3450
-select * from t5 order by colint;
-colint col1
-60 13.3450
-select * from t6 order by colint;
-colint col1
-60 13.3450
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with cast(floor(col1) as signed)
--------------------------------------------------------------------------
-delete from t11 where col1=13.345;
-delete from t22 where col1=13.345;
-delete from t33 where col1=13.345;
-delete from t44 where col1=13.345;
-delete from t55 where col1=13.345;
-delete from t66 where col1=13.345;
-select * from t11 order by col1;
-col1
-15.6540
-select * from t22 order by col1;
-col1
-15.6540
-17.9870
-select * from t33 order by col1;
-col1
-15.6540
-17.9870
-select * from t44 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-select * from t55 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-insert into t11 values (13.345);
-insert into t22 values (13.345);
-insert into t33 values (13.345);
-insert into t44 values (60,13.345);
-insert into t55 values (60,13.345);
-insert into t66 values (60,13.345);
-select * from t11 order by col1;
-col1
-13.3450
-15.6540
-select * from t22 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t33 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t44 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-60 13.3450
-select * from t55 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-60 13.3450
-select * from t66 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-60 13.3450
-alter table t11 drop partition p0;
-alter table t22 drop partition p0;
-alter table t44 drop partition p0;
-alter table t55 drop partition p0;
-alter table t66 drop partition p0;
-select * from t11 order by col1;
-col1
-15.6540
-select * from t22 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t33 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t44 order by colint;
-colint col1
-60 13.3450
-select * from t55 order by colint;
-colint col1
-60 13.3450
-select * from t66 order by colint;
-colint col1
-60 13.3450
--------------------------
----- some alter table end
--------------------------
-drop table if exists t1 ;
-drop table if exists t2 ;
-drop table if exists t3 ;
-drop table if exists t4 ;
-drop table if exists t5 ;
-drop table if exists t6 ;
-drop table if exists t11 ;
-drop table if exists t22 ;
-drop table if exists t33 ;
-drop table if exists t44 ;
-drop table if exists t55 ;
-drop table if exists t66 ;
--------------------------------------------------------------------------
---- cast(mod(col1,10) as signed) in partition with coltype float(7,4)
--------------------------------------------------------------------------
-drop table if exists t1 ;
-drop table if exists t2 ;
-drop table if exists t3 ;
-drop table if exists t4 ;
-drop table if exists t5 ;
-drop table if exists t6 ;
--------------------------------------------------------------------------
---- Create tables with cast(mod(col1,10) as signed)
--------------------------------------------------------------------------
-create table t1 (col1 float(7,4)) engine='INNODB'
-partition by range(cast(mod(col1,10) as signed))
+create table t1 (col1 int) engine='INNODB'
+partition by range(mod(col1,10))
(partition p0 values less than (15),
partition p1 values less than maxvalue);
-create table t2 (col1 float(7,4)) engine='INNODB'
-partition by list(cast(mod(col1,10) as signed))
+create table t2 (col1 int) engine='INNODB'
+partition by list(mod(col1,10))
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -3195,16 +1699,16 @@ partition p3 values in (31,32,33,34,35,36,37,38,39,40),
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
);
-create table t3 (col1 float(7,4)) engine='INNODB'
-partition by hash(cast(mod(col1,10) as signed));
-create table t4 (colint int, col1 float(7,4)) engine='INNODB'
+create table t3 (col1 int) engine='INNODB'
+partition by hash(mod(col1,10));
+create table t4 (colint int, col1 int) engine='INNODB'
partition by range(colint)
-subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2
+subpartition by hash(mod(col1,10)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than maxvalue);
-create table t5 (colint int, col1 float(7,4)) engine='INNODB'
+create table t5 (colint int, col1 int) engine='INNODB'
partition by list(colint)
-subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2
+subpartition by hash(mod(col1,10)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -3212,100 +1716,346 @@ partition p3 values in (31,32,33,34,35,36,37,38,39,40),
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
);
-create table t6 (colint int, col1 float(7,4)) engine='INNODB'
+create table t6 (colint int, col1 int) engine='INNODB'
partition by range(colint)
-(partition p0 values less than (cast(mod(15,10) as signed)),
+(partition p0 values less than (mod(15,10)),
partition p1 values less than maxvalue);
-------------------------------------------------------------------------
---- Access tables with cast(mod(col1,10) as signed)
+--- Access tables with mod(col1,10)
-------------------------------------------------------------------------
-insert into t1 values (5.0000);
+insert into t1 values (5);
insert into t1 values (19);
-insert into t2 values (5.0000);
+insert into t2 values (5);
insert into t2 values (19);
insert into t2 values (17);
-insert into t3 values (5.0000);
+insert into t3 values (5);
insert into t3 values (19);
insert into t3 values (17);
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t6;
-select cast(mod(col1,10) as signed) from t1 order by col1;
-cast(mod(col1,10) as signed)
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t6;
+select mod(col1,10) from t1 order by col1;
+mod(col1,10)
5
9
select * from t1 order by col1;
col1
-5.0000
-19.0000
+5
+19
select * from t2 order by col1;
col1
-5.0000
-17.0000
-19.0000
+5
+17
+19
select * from t3 order by col1;
col1
-5.0000
-17.0000
-19.0000
+5
+17
+19
select * from t4 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 5
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 5
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
select * from t5 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 5
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 5
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
select * from t6 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
-update t1 set col1=15 where col1=5.0000;
-update t2 set col1=15 where col1=5.0000;
-update t3 set col1=15 where col1=5.0000;
-update t4 set col1=15 where col1=5.0000;
-update t5 set col1=15 where col1=5.0000;
-update t6 set col1=15 where col1=5.0000;
+1 5
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 5
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
+update t1 set col1=15 where col1=5;
+update t2 set col1=15 where col1=5;
+update t3 set col1=15 where col1=5;
+update t4 set col1=15 where col1=5;
+update t5 set col1=15 where col1=5;
+update t6 set col1=15 where col1=5;
select * from t1 order by col1;
col1
-15.0000
-19.0000
+15
+19
select * from t2 order by col1;
col1
-15.0000
-17.0000
-19.0000
+15
+17
+19
select * from t3 order by col1;
col1
-15.0000
-17.0000
-19.0000
+15
+17
+19
select * from t4 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
select * from t5 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
select * from t6 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
-------------------------------------------------------------------------
---- Alter tables with cast(mod(col1,10) as signed)
+--- Alter tables with mod(col1,10)
-------------------------------------------------------------------------
drop table if exists t11 ;
drop table if exists t22 ;
@@ -3320,11 +2070,11 @@ create table t44 engine='INNODB' as select * from t4;
create table t55 engine='INNODB' as select * from t5;
create table t66 engine='INNODB' as select * from t6;
alter table t11
-partition by range(cast(mod(col1,10) as signed))
+partition by range(mod(col1,10))
(partition p0 values less than (15),
partition p1 values less than maxvalue);
alter table t22
-partition by list(cast(mod(col1,10) as signed))
+partition by list(mod(col1,10))
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -3333,15 +2083,15 @@ partition p4 values in (41,42,43,44,45,46,47,48,49,50),
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
);
alter table t33
-partition by hash(cast(mod(col1,10) as signed));
+partition by hash(mod(col1,10));
alter table t44
partition by range(colint)
-subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2
+subpartition by hash(mod(col1,10)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than maxvalue);
alter table t55
partition by list(colint)
-subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2
+subpartition by hash(mod(col1,10)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -3351,40 +2101,163 @@ partition p5 values in (51,52,53,54,55,56,57,58,59,60)
);
alter table t66
partition by range(colint)
-(partition p0 values less than (cast(mod(15,10) as signed)),
+(partition p0 values less than (mod(15,10)),
partition p1 values less than maxvalue);
select * from t11 order by col1;
col1
-15.0000
-19.0000
+15
+19
select * from t22 order by col1;
col1
-15.0000
-17.0000
-19.0000
+15
+17
+19
select * from t33 order by col1;
col1
-15.0000
-17.0000
-19.0000
+15
+17
+19
select * from t44 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
select * from t55 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
select * from t66 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
---------------------------
---- some alter table begin
---------------------------
@@ -3393,19 +2266,19 @@ reorganize partition p0,p1 into
(partition s1 values less than maxvalue);
select * from t11 order by col1;
col1
-15.0000
-19.0000
+15
+19
alter table t11
reorganize partition s1 into
(partition p0 values less than (15),
partition p1 values less than maxvalue);
select * from t11 order by col1;
col1
-15.0000
-19.0000
+15
+19
alter table t55
partition by list(colint)
-subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 5
+subpartition by hash(mod(col1,10)) subpartitions 5
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -3417,54 +2290,259 @@ show create table t55;
Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
- `col1` float(7,4) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(mod(col1,10) as signed)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
+ `col1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (mod(col1,10)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
select * from t55 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
alter table t66
reorganize partition p0,p1 into
(partition s1 values less than maxvalue);
select * from t66 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
alter table t66
reorganize partition s1 into
-(partition p0 values less than (cast(mod(15,10) as signed)),
+(partition p0 values less than (mod(15,10)),
partition p1 values less than maxvalue);
select * from t66 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
alter table t66
reorganize partition p0,p1 into
(partition s1 values less than maxvalue);
select * from t66 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
alter table t66
reorganize partition s1 into
-(partition p0 values less than (cast(mod(15,10) as signed)),
+(partition p0 values less than (mod(15,10)),
partition p1 values less than maxvalue);
select * from t66 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
-------------------------------------------------------------------------
---- Delete rows and partitions of tables with cast(mod(col1,10) as signed)
+--- Delete rows and partitions of tables with mod(col1,10)
-------------------------------------------------------------------------
delete from t1 where col1=19;
delete from t2 where col1=19;
@@ -3474,27 +2552,109 @@ delete from t5 where col1=19;
delete from t6 where col1=19;
select * from t1 order by col1;
col1
-15.0000
+15
select * from t2 order by col1;
col1
-15.0000
-17.0000
+15
+17
select * from t3 order by col1;
col1
-15.0000
-17.0000
+15
+17
select * from t4 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
select * from t5 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
insert into t1 values (19);
insert into t2 values (19);
insert into t3 values (19);
@@ -3503,39 +2663,162 @@ insert into t5 values (60,19);
insert into t6 values (60,19);
select * from t1 order by col1;
col1
-15.0000
-19.0000
+15
+19
select * from t2 order by col1;
col1
-15.0000
-17.0000
-19.0000
+15
+17
+19
select * from t3 order by col1;
col1
-15.0000
-17.0000
-19.0000
+15
+17
+19
select * from t4 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
-60 19.0000
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
+60 19
select * from t5 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
-60 19.0000
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
+60 19
select * from t6 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
-60 19.0000
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
+60 19
alter table t1 drop partition p0;
alter table t2 drop partition p0;
alter table t4 drop partition p0;
@@ -3547,20 +2830,127 @@ select * from t2 order by col1;
col1
select * from t3 order by col1;
col1
-15.0000
-17.0000
-19.0000
+15
+17
+19
select * from t4 order by colint;
colint col1
-60 19.0000
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
+60 19
select * from t5 order by colint;
colint col1
-60 19.0000
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
+60 19
select * from t6 order by colint;
colint col1
-60 19.0000
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
+60 19
-------------------------------------------------------------------------
---- Delete rows and partitions of tables with cast(mod(col1,10) as signed)
+--- Delete rows and partitions of tables with mod(col1,10)
-------------------------------------------------------------------------
delete from t11 where col1=19;
delete from t22 where col1=19;
@@ -3570,27 +2960,109 @@ delete from t55 where col1=19;
delete from t66 where col1=19;
select * from t11 order by col1;
col1
-15.0000
+15
select * from t22 order by col1;
col1
-15.0000
-17.0000
+15
+17
select * from t33 order by col1;
col1
-15.0000
-17.0000
+15
+17
select * from t44 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
select * from t55 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
insert into t11 values (19);
insert into t22 values (19);
insert into t33 values (19);
@@ -3599,533 +3071,162 @@ insert into t55 values (60,19);
insert into t66 values (60,19);
select * from t11 order by col1;
col1
-15.0000
-19.0000
-select * from t22 order by col1;
-col1
-15.0000
-17.0000
-19.0000
-select * from t33 order by col1;
-col1
-15.0000
-17.0000
-19.0000
-select * from t44 order by colint;
-colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
-60 19.0000
-select * from t55 order by colint;
-colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
-60 19.0000
-select * from t66 order by colint;
-colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
-60 19.0000
-alter table t11 drop partition p0;
-alter table t22 drop partition p0;
-alter table t44 drop partition p0;
-alter table t55 drop partition p0;
-alter table t66 drop partition p0;
-select * from t11 order by col1;
-col1
-select * from t22 order by col1;
-col1
-select * from t33 order by col1;
-col1
-15.0000
-17.0000
-19.0000
-select * from t44 order by colint;
-colint col1
-60 19.0000
-select * from t55 order by colint;
-colint col1
-60 19.0000
-select * from t66 order by colint;
-colint col1
-60 19.0000
--------------------------
----- some alter table end
--------------------------
-drop table if exists t1 ;
-drop table if exists t2 ;
-drop table if exists t3 ;
-drop table if exists t4 ;
-drop table if exists t5 ;
-drop table if exists t6 ;
-drop table if exists t11 ;
-drop table if exists t22 ;
-drop table if exists t33 ;
-drop table if exists t44 ;
-drop table if exists t55 ;
-drop table if exists t66 ;
--------------------------------------------------------------------------
---- ord(col1) in partition with coltype char(3)
--------------------------------------------------------------------------
-drop table if exists t1 ;
-drop table if exists t2 ;
-drop table if exists t3 ;
-drop table if exists t4 ;
-drop table if exists t5 ;
-drop table if exists t6 ;
--------------------------------------------------------------------------
---- Create tables with ord(col1)
--------------------------------------------------------------------------
-create table t1 (col1 char(3)) engine='INNODB'
-partition by range(ord(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 char(3)) engine='INNODB'
-partition by list(ord(col1))
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-create table t3 (col1 char(3)) engine='INNODB'
-partition by hash(ord(col1));
-create table t4 (colint int, col1 char(3)) engine='INNODB'
-partition by range(colint)
-subpartition by hash(ord(col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t5 (colint int, col1 char(3)) engine='INNODB'
-partition by list(colint)
-subpartition by hash(ord(col1)) subpartitions 2
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-create table t6 (colint int, col1 char(3)) engine='INNODB'
-partition by range(colint)
-(partition p0 values less than (ord('a')),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with ord(col1)
--------------------------------------------------------------------------
-insert into t1 values ('1');
-insert into t1 values ('9');
-insert into t2 values ('1');
-insert into t2 values ('9');
-insert into t2 values ('3');
-insert into t3 values ('1');
-insert into t3 values ('9');
-insert into t3 values ('3');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc' into table t6;
-select ord(col1) from t1 order by col1;
-ord(col1)
-49
-57
-select * from t1 order by col1;
-col1
-1
-9
-select * from t2 order by col1;
-col1
-1
-3
-9
-select * from t3 order by col1;
-col1
-1
-3
-9
-select * from t4 order by colint;
-colint col1
-1 1
-2 9
-3 3
-4 8
-select * from t5 order by colint;
-colint col1
-1 1
-2 9
-3 3
-4 8
-select * from t6 order by colint;
-colint col1
-1 1
-2 9
-3 3
-4 8
-update t1 set col1='8' where col1='1';
-update t2 set col1='8' where col1='1';
-update t3 set col1='8' where col1='1';
-update t4 set col1='8' where col1='1';
-update t5 set col1='8' where col1='1';
-update t6 set col1='8' where col1='1';
-select * from t1 order by col1;
-col1
-8
-9
-select * from t2 order by col1;
-col1
-3
-8
-9
-select * from t3 order by col1;
-col1
-3
-8
-9
-select * from t4 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-select * from t5 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-select * from t6 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
--------------------------------------------------------------------------
---- Alter tables with ord(col1)
--------------------------------------------------------------------------
-drop table if exists t11 ;
-drop table if exists t22 ;
-drop table if exists t33 ;
-drop table if exists t44 ;
-drop table if exists t55 ;
-drop table if exists t66 ;
-create table t11 engine='INNODB' as select * from t1;
-create table t22 engine='INNODB' as select * from t2;
-create table t33 engine='INNODB' as select * from t3;
-create table t44 engine='INNODB' as select * from t4;
-create table t55 engine='INNODB' as select * from t5;
-create table t66 engine='INNODB' as select * from t6;
-alter table t11
-partition by range(ord(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(ord(col1))
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-alter table t33
-partition by hash(ord(col1));
-alter table t44
-partition by range(colint)
-subpartition by hash(ord(col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t55
-partition by list(colint)
-subpartition by hash(ord(col1)) subpartitions 2
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-alter table t66
-partition by range(colint)
-(partition p0 values less than (ord('a')),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-8
-9
-select * from t22 order by col1;
-col1
-3
-8
-9
-select * from t33 order by col1;
-col1
-3
-8
-9
-select * from t44 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-select * from t55 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-select * from t66 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
----------------------------
----- some alter table begin
----------------------------
-alter table t11
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-8
-9
-alter table t11
-reorganize partition s1 into
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-8
-9
-alter table t55
-partition by list(colint)
-subpartition by hash(ord(col1)) subpartitions 5
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-show create table t55;
-Table Create Table
-t55 CREATE TABLE `t55` (
- `colint` int(11) DEFAULT NULL,
- `col1` char(3) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (ord(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
-select * from t55 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-alter table t66
-reorganize partition s1 into
-(partition p0 values less than (ord('a')),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-alter table t66
-reorganize partition s1 into
-(partition p0 values less than (ord('a')),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with ord(col1)
--------------------------------------------------------------------------
-delete from t1 where col1='9';
-delete from t2 where col1='9';
-delete from t3 where col1='9';
-delete from t4 where col1='9';
-delete from t5 where col1='9';
-delete from t6 where col1='9';
-select * from t1 order by col1;
-col1
-8
-select * from t2 order by col1;
-col1
-3
-8
-select * from t3 order by col1;
-col1
-3
-8
-select * from t4 order by colint;
-colint col1
-1 8
-3 3
-4 8
-select * from t5 order by colint;
-colint col1
-1 8
-3 3
-4 8
-insert into t1 values ('9');
-insert into t2 values ('9');
-insert into t3 values ('9');
-insert into t4 values (60,'9');
-insert into t5 values (60,'9');
-insert into t6 values (60,'9');
-select * from t1 order by col1;
-col1
-8
-9
-select * from t2 order by col1;
-col1
-3
-8
-9
-select * from t3 order by col1;
-col1
-3
-8
-9
-select * from t4 order by colint;
-colint col1
-1 8
-3 3
-4 8
-60 9
-select * from t5 order by colint;
-colint col1
-1 8
-3 3
-4 8
-60 9
-select * from t6 order by colint;
-colint col1
-1 8
-3 3
-4 8
-60 9
-alter table t1 drop partition p0;
-alter table t2 drop partition p0;
-alter table t4 drop partition p0;
-alter table t5 drop partition p0;
-alter table t6 drop partition p0;
-select * from t1 order by col1;
-col1
-8
-9
-select * from t2 order by col1;
-col1
-3
-8
-9
-select * from t3 order by col1;
-col1
-3
-8
-9
-select * from t4 order by colint;
-colint col1
-60 9
-select * from t5 order by colint;
-colint col1
-60 9
-select * from t6 order by colint;
-colint col1
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with ord(col1)
--------------------------------------------------------------------------
-delete from t11 where col1='9';
-delete from t22 where col1='9';
-delete from t33 where col1='9';
-delete from t44 where col1='9';
-delete from t55 where col1='9';
-delete from t66 where col1='9';
-select * from t11 order by col1;
-col1
-8
-select * from t22 order by col1;
-col1
-3
-8
-select * from t33 order by col1;
-col1
-3
-8
-select * from t44 order by colint;
-colint col1
-1 8
-3 3
-4 8
-select * from t55 order by colint;
-colint col1
-1 8
-3 3
-4 8
-insert into t11 values ('9');
-insert into t22 values ('9');
-insert into t33 values ('9');
-insert into t44 values (60,'9');
-insert into t55 values (60,'9');
-insert into t66 values (60,'9');
-select * from t11 order by col1;
-col1
-8
-9
+15
+19
select * from t22 order by col1;
col1
-3
-8
-9
+15
+17
+19
select * from t33 order by col1;
col1
-3
-8
-9
+15
+17
+19
select * from t44 order by colint;
colint col1
-1 8
-3 3
-4 8
-60 9
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
+60 19
select * from t55 order by colint;
colint col1
-1 8
-3 3
-4 8
-60 9
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
+60 19
select * from t66 order by colint;
colint col1
-1 8
-3 3
-4 8
-60 9
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
+60 19
alter table t11 drop partition p0;
alter table t22 drop partition p0;
alter table t44 drop partition p0;
@@ -4133,26 +3234,129 @@ alter table t55 drop partition p0;
alter table t66 drop partition p0;
select * from t11 order by col1;
col1
-8
-9
select * from t22 order by col1;
col1
-3
-8
-9
select * from t33 order by col1;
col1
-3
-8
-9
+15
+17
+19
select * from t44 order by colint;
colint col1
-60 9
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
+60 19
select * from t55 order by colint;
colint col1
-60 9
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
+60 19
select * from t66 order by colint;
colint col1
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
+60 19
-------------------------
---- some alter table end
-------------------------
@@ -4225,9 +3429,9 @@ insert into t2 values ('2006-01-25');
insert into t3 values ('2006-02-03');
insert into t3 values ('2006-01-17');
insert into t3 values ('2006-01-25');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select day(col1) from t1 order by col1;
day(col1)
17
@@ -4721,9 +3925,9 @@ insert into t2 values ('2006-01-25');
insert into t3 values ('2006-02-03');
insert into t3 values ('2006-01-17');
insert into t3 values ('2006-01-25');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select dayofmonth(col1) from t1 order by col1;
dayofmonth(col1)
17
@@ -5217,9 +4421,9 @@ insert into t2 values ('2006-01-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-02-17');
insert into t3 values ('2006-01-25');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select dayofweek(col1) from t1 order by col1;
dayofweek(col1)
3
@@ -5725,9 +4929,9 @@ insert into t2 values ('2006-02-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-01-17');
insert into t3 values ('2006-02-25');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select dayofyear(col1) from t1 order by col1;
dayofyear(col1)
3
@@ -6223,9 +5427,9 @@ insert into t2 values ('2006-02-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-01-17');
insert into t3 values ('2006-02-25');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select dayofyear(col1) from t1 order by col1;
dayofyear(col1)
3
@@ -6721,9 +5925,9 @@ insert into t2 values ('2006-01-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-02-17');
insert into t3 values ('2006-01-25');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select extract(month from col1) from t1 order by col1;
extract(month from col1)
1
@@ -7219,9 +6423,9 @@ insert into t2 values ('21:59');
insert into t3 values ('09:09');
insert into t3 values ('14:30');
insert into t3 values ('21:59');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select hour(col1) from t1 order by col1;
hour(col1)
9
@@ -7723,9 +6927,9 @@ insert into t2 values ('00:59:22.000024');
insert into t3 values ('09:09:15.000002');
insert into t3 values ('04:30:01.000018');
insert into t3 values ('00:59:22.000024');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select microsecond(col1) from t1 order by col1;
microsecond(col1)
0
@@ -8213,9 +7417,9 @@ insert into t2 values ('21:59:22');
insert into t3 values ('09:09:15');
insert into t3 values ('14:30:45');
insert into t3 values ('21:59:22');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select minute(col1) from t1 order by col1;
minute(col1)
9
@@ -8723,9 +7927,9 @@ insert into t2 values ('21:59:22');
insert into t3 values ('09:09:09');
insert into t3 values ('14:30:20');
insert into t3 values ('21:59:22');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select second(col1) from t1 order by col1;
second(col1)
9
@@ -9233,9 +8437,9 @@ insert into t2 values ('21:59:22');
insert into t3 values ('09:09:09');
insert into t3 values ('14:30:20');
insert into t3 values ('21:59:22');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select second(col1) from t1 order by col1;
second(col1)
9
@@ -9743,9 +8947,9 @@ insert into t2 values ('2006-05-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-12-17');
insert into t3 values ('2006-05-25');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select month(col1) from t1 order by col1;
month(col1)
1
@@ -10247,9 +9451,9 @@ insert into t2 values ('2006-09-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-12-17');
insert into t3 values ('2006-09-25');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select quarter(col1) from t1 order by col1;
quarter(col1)
1
@@ -10749,9 +9953,9 @@ insert into t2 values ('21:59:22');
insert into t3 values ('09:09:15');
insert into t3 values ('14:30:45');
insert into t3 values ('21:59:22');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select time_to_sec(col1)-(time_to_sec(col1)-20) from t1 order by col1;
time_to_sec(col1)-(time_to_sec(col1)-20)
20
@@ -11257,9 +10461,9 @@ insert into t2 values ('2006-01-25');
insert into t3 values ('2006-02-03');
insert into t3 values ('2006-01-17');
insert into t3 values ('2006-01-25');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select to_days(col1)-to_days('2006-01-01') from t1 order by col1;
to_days(col1)-to_days('2006-01-01')
16
@@ -11701,7 +10905,7 @@ drop table if exists t44 ;
drop table if exists t55 ;
drop table if exists t66 ;
-------------------------------------------------------------------------
---- weekday(col1) in partition with coltype date
+--- datediff(col1, '2006-01-01') in partition with coltype date
-------------------------------------------------------------------------
drop table if exists t1 ;
drop table if exists t2 ;
@@ -11710,14 +10914,14 @@ drop table if exists t4 ;
drop table if exists t5 ;
drop table if exists t6 ;
-------------------------------------------------------------------------
---- Create tables with weekday(col1)
+--- Create tables with datediff(col1, '2006-01-01')
-------------------------------------------------------------------------
create table t1 (col1 date) engine='INNODB'
-partition by range(weekday(col1))
+partition by range(datediff(col1, '2006-01-01'))
(partition p0 values less than (15),
partition p1 values less than maxvalue);
create table t2 (col1 date) engine='INNODB'
-partition by list(weekday(col1))
+partition by list(datediff(col1, '2006-01-01'))
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -11726,15 +10930,15 @@ partition p4 values in (41,42,43,44,45,46,47,48,49,50),
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
);
create table t3 (col1 date) engine='INNODB'
-partition by hash(weekday(col1));
+partition by hash(datediff(col1, '2006-01-01'));
create table t4 (colint int, col1 date) engine='INNODB'
partition by range(colint)
-subpartition by hash(weekday(col1)) subpartitions 2
+subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than maxvalue);
create table t5 (colint int, col1 date) engine='INNODB'
partition by list(colint)
-subpartition by hash(weekday(col1)) subpartitions 2
+subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -11744,40 +10948,40 @@ partition p5 values in (51,52,53,54,55,56,57,58,59,60)
);
create table t6 (colint int, col1 date) engine='INNODB'
partition by range(colint)
-(partition p0 values less than (weekday('2006-10-14')),
+(partition p0 values less than (datediff('2006-02-02', '2006-01-01')),
partition p1 values less than maxvalue);
-------------------------------------------------------------------------
---- Access tables with weekday(col1)
+--- Access tables with datediff(col1, '2006-01-01')
-------------------------------------------------------------------------
-insert into t1 values ('2006-12-03');
-insert into t1 values ('2006-11-17');
-insert into t2 values ('2006-12-03');
-insert into t2 values ('2006-11-17');
-insert into t2 values ('2006-05-25');
-insert into t3 values ('2006-12-03');
-insert into t3 values ('2006-11-17');
-insert into t3 values ('2006-05-25');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6;
-select weekday(col1) from t1 order by col1;
-weekday(col1)
-4
-6
+insert into t1 values ('2006-02-03');
+insert into t1 values ('2006-01-17');
+insert into t2 values ('2006-02-03');
+insert into t2 values ('2006-01-17');
+insert into t2 values ('2006-01-25');
+insert into t3 values ('2006-02-03');
+insert into t3 values ('2006-01-17');
+insert into t3 values ('2006-01-25');
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+select datediff(col1, '2006-01-01') from t1 order by col1;
+datediff(col1, '2006-01-01')
+16
+33
select * from t1 order by col1;
col1
-2006-11-17
-2006-12-03
+2006-01-17
+2006-02-03
select * from t2 order by col1;
col1
-2006-05-25
-2006-11-17
-2006-12-03
+2006-01-17
+2006-01-25
+2006-02-03
select * from t3 order by col1;
col1
-2006-05-25
-2006-11-17
-2006-12-03
+2006-01-17
+2006-01-25
+2006-02-03
select * from t4 order by colint;
colint col1
1 2006-02-03
@@ -11796,46 +11000,46 @@ colint col1
2 2006-01-17
3 2006-01-25
4 2006-02-05
-update t1 set col1='2006-02-06' where col1='2006-12-03';
-update t2 set col1='2006-02-06' where col1='2006-12-03';
-update t3 set col1='2006-02-06' where col1='2006-12-03';
-update t4 set col1='2006-02-06' where col1='2006-12-03';
-update t5 set col1='2006-02-06' where col1='2006-12-03';
-update t6 set col1='2006-02-06' where col1='2006-12-03';
+update t1 set col1='2006-02-06' where col1='2006-02-03';
+update t2 set col1='2006-02-06' where col1='2006-02-03';
+update t3 set col1='2006-02-06' where col1='2006-02-03';
+update t4 set col1='2006-02-06' where col1='2006-02-03';
+update t5 set col1='2006-02-06' where col1='2006-02-03';
+update t6 set col1='2006-02-06' where col1='2006-02-03';
select * from t1 order by col1;
col1
+2006-01-17
2006-02-06
-2006-11-17
select * from t2 order by col1;
col1
+2006-01-17
+2006-01-25
2006-02-06
-2006-05-25
-2006-11-17
select * from t3 order by col1;
col1
+2006-01-17
+2006-01-25
2006-02-06
-2006-05-25
-2006-11-17
select * from t4 order by colint;
colint col1
-1 2006-02-03
+1 2006-02-06
2 2006-01-17
3 2006-01-25
4 2006-02-05
select * from t5 order by colint;
colint col1
-1 2006-02-03
+1 2006-02-06
2 2006-01-17
3 2006-01-25
4 2006-02-05
select * from t6 order by colint;
colint col1
-1 2006-02-03
+1 2006-02-06
2 2006-01-17
3 2006-01-25
4 2006-02-05
-------------------------------------------------------------------------
---- Alter tables with weekday(col1)
+--- Alter tables with datediff(col1, '2006-01-01')
-------------------------------------------------------------------------
drop table if exists t11 ;
drop table if exists t22 ;
@@ -11850,11 +11054,11 @@ create table t44 engine='INNODB' as select * from t4;
create table t55 engine='INNODB' as select * from t5;
create table t66 engine='INNODB' as select * from t6;
alter table t11
-partition by range(weekday(col1))
+partition by range(datediff(col1, '2006-01-01'))
(partition p0 values less than (15),
partition p1 values less than maxvalue);
alter table t22
-partition by list(weekday(col1))
+partition by list(datediff(col1, '2006-01-01'))
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -11863,15 +11067,15 @@ partition p4 values in (41,42,43,44,45,46,47,48,49,50),
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
);
alter table t33
-partition by hash(weekday(col1));
+partition by hash(datediff(col1, '2006-01-01'));
alter table t44
partition by range(colint)
-subpartition by hash(weekday(col1)) subpartitions 2
+subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than maxvalue);
alter table t55
partition by list(colint)
-subpartition by hash(weekday(col1)) subpartitions 2
+subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -11881,37 +11085,37 @@ partition p5 values in (51,52,53,54,55,56,57,58,59,60)
);
alter table t66
partition by range(colint)
-(partition p0 values less than (weekday('2006-10-14')),
+(partition p0 values less than (datediff('2006-02-02', '2006-01-01')),
partition p1 values less than maxvalue);
select * from t11 order by col1;
col1
+2006-01-17
2006-02-06
-2006-11-17
select * from t22 order by col1;
col1
+2006-01-17
+2006-01-25
2006-02-06
-2006-05-25
-2006-11-17
select * from t33 order by col1;
col1
+2006-01-17
+2006-01-25
2006-02-06
-2006-05-25
-2006-11-17
select * from t44 order by colint;
colint col1
-1 2006-02-03
+1 2006-02-06
2 2006-01-17
3 2006-01-25
4 2006-02-05
select * from t55 order by colint;
colint col1
-1 2006-02-03
+1 2006-02-06
2 2006-01-17
3 2006-01-25
4 2006-02-05
select * from t66 order by colint;
colint col1
-1 2006-02-03
+1 2006-02-06
2 2006-01-17
3 2006-01-25
4 2006-02-05
@@ -11923,19 +11127,19 @@ reorganize partition p0,p1 into
(partition s1 values less than maxvalue);
select * from t11 order by col1;
col1
+2006-01-17
2006-02-06
-2006-11-17
alter table t11
reorganize partition s1 into
(partition p0 values less than (15),
partition p1 values less than maxvalue);
select * from t11 order by col1;
col1
+2006-01-17
2006-02-06
-2006-11-17
alter table t55
partition by list(colint)
-subpartition by hash(weekday(col1)) subpartitions 5
+subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 5
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -11948,10 +11152,10 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (weekday(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (datediff(col1, '2006-01-01')) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
select * from t55 order by colint;
colint col1
-1 2006-02-03
+1 2006-02-06
2 2006-01-17
3 2006-01-25
4 2006-02-05
@@ -11960,17 +11164,17 @@ reorganize partition p0,p1 into
(partition s1 values less than maxvalue);
select * from t66 order by colint;
colint col1
-1 2006-02-03
+1 2006-02-06
2 2006-01-17
3 2006-01-25
4 2006-02-05
alter table t66
reorganize partition s1 into
-(partition p0 values less than (weekday('2006-10-14')),
+(partition p0 values less than (datediff('2006-02-02', '2006-01-01')),
partition p1 values less than maxvalue);
select * from t66 order by colint;
colint col1
-1 2006-02-03
+1 2006-02-06
2 2006-01-17
3 2006-01-25
4 2006-02-05
@@ -11979,93 +11183,88 @@ reorganize partition p0,p1 into
(partition s1 values less than maxvalue);
select * from t66 order by colint;
colint col1
-1 2006-02-03
+1 2006-02-06
2 2006-01-17
3 2006-01-25
4 2006-02-05
alter table t66
reorganize partition s1 into
-(partition p0 values less than (weekday('2006-10-14')),
+(partition p0 values less than (datediff('2006-02-02', '2006-01-01')),
partition p1 values less than maxvalue);
select * from t66 order by colint;
colint col1
-1 2006-02-03
+1 2006-02-06
2 2006-01-17
3 2006-01-25
4 2006-02-05
-------------------------------------------------------------------------
---- Delete rows and partitions of tables with weekday(col1)
+--- Delete rows and partitions of tables with datediff(col1, '2006-01-01')
-------------------------------------------------------------------------
-delete from t1 where col1='2006-11-17';
-delete from t2 where col1='2006-11-17';
-delete from t3 where col1='2006-11-17';
-delete from t4 where col1='2006-11-17';
-delete from t5 where col1='2006-11-17';
-delete from t6 where col1='2006-11-17';
+delete from t1 where col1='2006-01-17';
+delete from t2 where col1='2006-01-17';
+delete from t3 where col1='2006-01-17';
+delete from t4 where col1='2006-01-17';
+delete from t5 where col1='2006-01-17';
+delete from t6 where col1='2006-01-17';
select * from t1 order by col1;
col1
2006-02-06
select * from t2 order by col1;
col1
+2006-01-25
2006-02-06
-2006-05-25
select * from t3 order by col1;
col1
+2006-01-25
2006-02-06
-2006-05-25
select * from t4 order by colint;
colint col1
-1 2006-02-03
-2 2006-01-17
+1 2006-02-06
3 2006-01-25
4 2006-02-05
select * from t5 order by colint;
colint col1
-1 2006-02-03
-2 2006-01-17
+1 2006-02-06
3 2006-01-25
4 2006-02-05
-insert into t1 values ('2006-11-17');
-insert into t2 values ('2006-11-17');
-insert into t3 values ('2006-11-17');
-insert into t4 values (60,'2006-11-17');
-insert into t5 values (60,'2006-11-17');
-insert into t6 values (60,'2006-11-17');
+insert into t1 values ('2006-01-17');
+insert into t2 values ('2006-01-17');
+insert into t3 values ('2006-01-17');
+insert into t4 values (60,'2006-01-17');
+insert into t5 values (60,'2006-01-17');
+insert into t6 values (60,'2006-01-17');
select * from t1 order by col1;
col1
+2006-01-17
2006-02-06
-2006-11-17
select * from t2 order by col1;
col1
+2006-01-17
+2006-01-25
2006-02-06
-2006-05-25
-2006-11-17
select * from t3 order by col1;
col1
+2006-01-17
+2006-01-25
2006-02-06
-2006-05-25
-2006-11-17
select * from t4 order by colint;
colint col1
-1 2006-02-03
-2 2006-01-17
+1 2006-02-06
3 2006-01-25
4 2006-02-05
-60 2006-11-17
+60 2006-01-17
select * from t5 order by colint;
colint col1
-1 2006-02-03
-2 2006-01-17
+1 2006-02-06
3 2006-01-25
4 2006-02-05
-60 2006-11-17
+60 2006-01-17
select * from t6 order by colint;
colint col1
-1 2006-02-03
-2 2006-01-17
+1 2006-02-06
3 2006-01-25
4 2006-02-05
-60 2006-11-17
+60 2006-01-17
alter table t1 drop partition p0;
alter table t2 drop partition p0;
alter table t4 drop partition p0;
@@ -12073,95 +11272,95 @@ alter table t5 drop partition p0;
alter table t6 drop partition p0;
select * from t1 order by col1;
col1
+2006-01-17
+2006-02-06
select * from t2 order by col1;
col1
+2006-01-17
+2006-01-25
+2006-02-06
select * from t3 order by col1;
col1
+2006-01-17
+2006-01-25
2006-02-06
-2006-05-25
-2006-11-17
select * from t4 order by colint;
colint col1
-60 2006-11-17
+60 2006-01-17
select * from t5 order by colint;
colint col1
-60 2006-11-17
+60 2006-01-17
select * from t6 order by colint;
colint col1
-60 2006-11-17
+60 2006-01-17
-------------------------------------------------------------------------
---- Delete rows and partitions of tables with weekday(col1)
+--- Delete rows and partitions of tables with datediff(col1, '2006-01-01')
-------------------------------------------------------------------------
-delete from t11 where col1='2006-11-17';
-delete from t22 where col1='2006-11-17';
-delete from t33 where col1='2006-11-17';
-delete from t44 where col1='2006-11-17';
-delete from t55 where col1='2006-11-17';
-delete from t66 where col1='2006-11-17';
+delete from t11 where col1='2006-01-17';
+delete from t22 where col1='2006-01-17';
+delete from t33 where col1='2006-01-17';
+delete from t44 where col1='2006-01-17';
+delete from t55 where col1='2006-01-17';
+delete from t66 where col1='2006-01-17';
select * from t11 order by col1;
col1
2006-02-06
select * from t22 order by col1;
col1
+2006-01-25
2006-02-06
-2006-05-25
select * from t33 order by col1;
col1
+2006-01-25
2006-02-06
-2006-05-25
select * from t44 order by colint;
colint col1
-1 2006-02-03
-2 2006-01-17
+1 2006-02-06
3 2006-01-25
4 2006-02-05
select * from t55 order by colint;
colint col1
-1 2006-02-03
-2 2006-01-17
+1 2006-02-06
3 2006-01-25
4 2006-02-05
-insert into t11 values ('2006-11-17');
-insert into t22 values ('2006-11-17');
-insert into t33 values ('2006-11-17');
-insert into t44 values (60,'2006-11-17');
-insert into t55 values (60,'2006-11-17');
-insert into t66 values (60,'2006-11-17');
+insert into t11 values ('2006-01-17');
+insert into t22 values ('2006-01-17');
+insert into t33 values ('2006-01-17');
+insert into t44 values (60,'2006-01-17');
+insert into t55 values (60,'2006-01-17');
+insert into t66 values (60,'2006-01-17');
select * from t11 order by col1;
col1
+2006-01-17
2006-02-06
-2006-11-17
select * from t22 order by col1;
col1
+2006-01-17
+2006-01-25
2006-02-06
-2006-05-25
-2006-11-17
select * from t33 order by col1;
col1
+2006-01-17
+2006-01-25
2006-02-06
-2006-05-25
-2006-11-17
select * from t44 order by colint;
colint col1
-1 2006-02-03
-2 2006-01-17
+1 2006-02-06
3 2006-01-25
4 2006-02-05
-60 2006-11-17
+60 2006-01-17
select * from t55 order by colint;
colint col1
-1 2006-02-03
-2 2006-01-17
+1 2006-02-06
3 2006-01-25
4 2006-02-05
-60 2006-11-17
+60 2006-01-17
select * from t66 order by colint;
colint col1
-1 2006-02-03
-2 2006-01-17
+1 2006-02-06
3 2006-01-25
4 2006-02-05
-60 2006-11-17
+60 2006-01-17
alter table t11 drop partition p0;
alter table t22 drop partition p0;
alter table t44 drop partition p0;
@@ -12169,22 +11368,27 @@ alter table t55 drop partition p0;
alter table t66 drop partition p0;
select * from t11 order by col1;
col1
+2006-01-17
+2006-02-06
select * from t22 order by col1;
col1
+2006-01-17
+2006-01-25
+2006-02-06
select * from t33 order by col1;
col1
+2006-01-17
+2006-01-25
2006-02-06
-2006-05-25
-2006-11-17
select * from t44 order by colint;
colint col1
-60 2006-11-17
+60 2006-01-17
select * from t55 order by colint;
colint col1
-60 2006-11-17
+60 2006-01-17
select * from t66 order by colint;
colint col1
-60 2006-11-17
+60 2006-01-17
-------------------------
---- some alter table end
-------------------------
@@ -12201,7 +11405,7 @@ drop table if exists t44 ;
drop table if exists t55 ;
drop table if exists t66 ;
-------------------------------------------------------------------------
---- weekofyear(col1) in partition with coltype date
+--- weekday(col1) in partition with coltype date
-------------------------------------------------------------------------
drop table if exists t1 ;
drop table if exists t2 ;
@@ -12210,14 +11414,14 @@ drop table if exists t4 ;
drop table if exists t5 ;
drop table if exists t6 ;
-------------------------------------------------------------------------
---- Create tables with weekofyear(col1)
+--- Create tables with weekday(col1)
-------------------------------------------------------------------------
create table t1 (col1 date) engine='INNODB'
-partition by range(weekofyear(col1))
+partition by range(weekday(col1))
(partition p0 values less than (15),
partition p1 values less than maxvalue);
create table t2 (col1 date) engine='INNODB'
-partition by list(weekofyear(col1))
+partition by list(weekday(col1))
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -12226,15 +11430,15 @@ partition p4 values in (41,42,43,44,45,46,47,48,49,50),
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
);
create table t3 (col1 date) engine='INNODB'
-partition by hash(weekofyear(col1));
+partition by hash(weekday(col1));
create table t4 (colint int, col1 date) engine='INNODB'
partition by range(colint)
-subpartition by hash(weekofyear(col1)) subpartitions 2
+subpartition by hash(weekday(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than maxvalue);
create table t5 (colint int, col1 date) engine='INNODB'
partition by list(colint)
-subpartition by hash(weekofyear(col1)) subpartitions 2
+subpartition by hash(weekday(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -12244,40 +11448,40 @@ partition p5 values in (51,52,53,54,55,56,57,58,59,60)
);
create table t6 (colint int, col1 date) engine='INNODB'
partition by range(colint)
-(partition p0 values less than (weekofyear('2006-02-14')),
+(partition p0 values less than (weekday('2006-10-14')),
partition p1 values less than maxvalue);
-------------------------------------------------------------------------
---- Access tables with weekofyear(col1)
+--- Access tables with weekday(col1)
-------------------------------------------------------------------------
-insert into t1 values ('2006-01-03');
-insert into t1 values ('2006-03-17');
-insert into t2 values ('2006-01-03');
-insert into t2 values ('2006-03-17');
+insert into t1 values ('2006-12-03');
+insert into t1 values ('2006-11-17');
+insert into t2 values ('2006-12-03');
+insert into t2 values ('2006-11-17');
insert into t2 values ('2006-05-25');
-insert into t3 values ('2006-01-03');
-insert into t3 values ('2006-03-17');
+insert into t3 values ('2006-12-03');
+insert into t3 values ('2006-11-17');
insert into t3 values ('2006-05-25');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6;
-select weekofyear(col1) from t1 order by col1;
-weekofyear(col1)
-1
-11
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+select weekday(col1) from t1 order by col1;
+weekday(col1)
+4
+6
select * from t1 order by col1;
col1
-2006-01-03
-2006-03-17
+2006-11-17
+2006-12-03
select * from t2 order by col1;
col1
-2006-01-03
-2006-03-17
2006-05-25
+2006-11-17
+2006-12-03
select * from t3 order by col1;
col1
-2006-01-03
-2006-03-17
2006-05-25
+2006-11-17
+2006-12-03
select * from t4 order by colint;
colint col1
1 2006-02-03
@@ -12296,26 +11500,26 @@ colint col1
2 2006-01-17
3 2006-01-25
4 2006-02-05
-update t1 set col1='2006-09-06' where col1='2006-01-03';
-update t2 set col1='2006-09-06' where col1='2006-01-03';
-update t3 set col1='2006-09-06' where col1='2006-01-03';
-update t4 set col1='2006-09-06' where col1='2006-01-03';
-update t5 set col1='2006-09-06' where col1='2006-01-03';
-update t6 set col1='2006-09-06' where col1='2006-01-03';
+update t1 set col1='2006-02-06' where col1='2006-12-03';
+update t2 set col1='2006-02-06' where col1='2006-12-03';
+update t3 set col1='2006-02-06' where col1='2006-12-03';
+update t4 set col1='2006-02-06' where col1='2006-12-03';
+update t5 set col1='2006-02-06' where col1='2006-12-03';
+update t6 set col1='2006-02-06' where col1='2006-12-03';
select * from t1 order by col1;
col1
-2006-03-17
-2006-09-06
+2006-02-06
+2006-11-17
select * from t2 order by col1;
col1
-2006-03-17
+2006-02-06
2006-05-25
-2006-09-06
+2006-11-17
select * from t3 order by col1;
col1
-2006-03-17
+2006-02-06
2006-05-25
-2006-09-06
+2006-11-17
select * from t4 order by colint;
colint col1
1 2006-02-03
@@ -12335,7 +11539,7 @@ colint col1
3 2006-01-25
4 2006-02-05
-------------------------------------------------------------------------
---- Alter tables with weekofyear(col1)
+--- Alter tables with weekday(col1)
-------------------------------------------------------------------------
drop table if exists t11 ;
drop table if exists t22 ;
@@ -12350,11 +11554,11 @@ create table t44 engine='INNODB' as select * from t4;
create table t55 engine='INNODB' as select * from t5;
create table t66 engine='INNODB' as select * from t6;
alter table t11
-partition by range(weekofyear(col1))
+partition by range(weekday(col1))
(partition p0 values less than (15),
partition p1 values less than maxvalue);
alter table t22
-partition by list(weekofyear(col1))
+partition by list(weekday(col1))
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -12363,15 +11567,15 @@ partition p4 values in (41,42,43,44,45,46,47,48,49,50),
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
);
alter table t33
-partition by hash(weekofyear(col1));
+partition by hash(weekday(col1));
alter table t44
partition by range(colint)
-subpartition by hash(weekofyear(col1)) subpartitions 2
+subpartition by hash(weekday(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than maxvalue);
alter table t55
partition by list(colint)
-subpartition by hash(weekofyear(col1)) subpartitions 2
+subpartition by hash(weekday(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -12381,22 +11585,22 @@ partition p5 values in (51,52,53,54,55,56,57,58,59,60)
);
alter table t66
partition by range(colint)
-(partition p0 values less than (weekofyear('2006-02-14')),
+(partition p0 values less than (weekday('2006-10-14')),
partition p1 values less than maxvalue);
select * from t11 order by col1;
col1
-2006-03-17
-2006-09-06
+2006-02-06
+2006-11-17
select * from t22 order by col1;
col1
-2006-03-17
+2006-02-06
2006-05-25
-2006-09-06
+2006-11-17
select * from t33 order by col1;
col1
-2006-03-17
+2006-02-06
2006-05-25
-2006-09-06
+2006-11-17
select * from t44 order by colint;
colint col1
1 2006-02-03
@@ -12423,19 +11627,19 @@ reorganize partition p0,p1 into
(partition s1 values less than maxvalue);
select * from t11 order by col1;
col1
-2006-03-17
-2006-09-06
+2006-02-06
+2006-11-17
alter table t11
reorganize partition s1 into
(partition p0 values less than (15),
partition p1 values less than maxvalue);
select * from t11 order by col1;
col1
-2006-03-17
-2006-09-06
+2006-02-06
+2006-11-17
alter table t55
partition by list(colint)
-subpartition by hash(weekofyear(col1)) subpartitions 5
+subpartition by hash(weekday(col1)) subpartitions 5
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -12448,7 +11652,7 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (weekofyear(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (weekday(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
select * from t55 order by colint;
colint col1
1 2006-02-03
@@ -12466,7 +11670,7 @@ colint col1
4 2006-02-05
alter table t66
reorganize partition s1 into
-(partition p0 values less than (weekofyear('2006-02-14')),
+(partition p0 values less than (weekday('2006-10-14')),
partition p1 values less than maxvalue);
select * from t66 order by colint;
colint col1
@@ -12485,7 +11689,7 @@ colint col1
4 2006-02-05
alter table t66
reorganize partition s1 into
-(partition p0 values less than (weekofyear('2006-02-14')),
+(partition p0 values less than (weekday('2006-10-14')),
partition p1 values less than maxvalue);
select * from t66 order by colint;
colint col1
@@ -12494,25 +11698,25 @@ colint col1
3 2006-01-25
4 2006-02-05
-------------------------------------------------------------------------
---- Delete rows and partitions of tables with weekofyear(col1)
+--- Delete rows and partitions of tables with weekday(col1)
-------------------------------------------------------------------------
-delete from t1 where col1='2006-03-17';
-delete from t2 where col1='2006-03-17';
-delete from t3 where col1='2006-03-17';
-delete from t4 where col1='2006-03-17';
-delete from t5 where col1='2006-03-17';
-delete from t6 where col1='2006-03-17';
+delete from t1 where col1='2006-11-17';
+delete from t2 where col1='2006-11-17';
+delete from t3 where col1='2006-11-17';
+delete from t4 where col1='2006-11-17';
+delete from t5 where col1='2006-11-17';
+delete from t6 where col1='2006-11-17';
select * from t1 order by col1;
col1
-2006-09-06
+2006-02-06
select * from t2 order by col1;
col1
+2006-02-06
2006-05-25
-2006-09-06
select * from t3 order by col1;
col1
+2006-02-06
2006-05-25
-2006-09-06
select * from t4 order by colint;
colint col1
1 2006-02-03
@@ -12525,47 +11729,47 @@ colint col1
2 2006-01-17
3 2006-01-25
4 2006-02-05
-insert into t1 values ('2006-03-17');
-insert into t2 values ('2006-03-17');
-insert into t3 values ('2006-03-17');
-insert into t4 values (60,'2006-03-17');
-insert into t5 values (60,'2006-03-17');
-insert into t6 values (60,'2006-03-17');
+insert into t1 values ('2006-11-17');
+insert into t2 values ('2006-11-17');
+insert into t3 values ('2006-11-17');
+insert into t4 values (60,'2006-11-17');
+insert into t5 values (60,'2006-11-17');
+insert into t6 values (60,'2006-11-17');
select * from t1 order by col1;
col1
-2006-03-17
-2006-09-06
+2006-02-06
+2006-11-17
select * from t2 order by col1;
col1
-2006-03-17
+2006-02-06
2006-05-25
-2006-09-06
+2006-11-17
select * from t3 order by col1;
col1
-2006-03-17
+2006-02-06
2006-05-25
-2006-09-06
+2006-11-17
select * from t4 order by colint;
colint col1
1 2006-02-03
2 2006-01-17
3 2006-01-25
4 2006-02-05
-60 2006-03-17
+60 2006-11-17
select * from t5 order by colint;
colint col1
1 2006-02-03
2 2006-01-17
3 2006-01-25
4 2006-02-05
-60 2006-03-17
+60 2006-11-17
select * from t6 order by colint;
colint col1
1 2006-02-03
2 2006-01-17
3 2006-01-25
4 2006-02-05
-60 2006-03-17
+60 2006-11-17
alter table t1 drop partition p0;
alter table t2 drop partition p0;
alter table t4 drop partition p0;
@@ -12573,46 +11777,42 @@ alter table t5 drop partition p0;
alter table t6 drop partition p0;
select * from t1 order by col1;
col1
-2006-09-06
select * from t2 order by col1;
col1
-2006-03-17
-2006-05-25
-2006-09-06
select * from t3 order by col1;
col1
-2006-03-17
+2006-02-06
2006-05-25
-2006-09-06
+2006-11-17
select * from t4 order by colint;
colint col1
-60 2006-03-17
+60 2006-11-17
select * from t5 order by colint;
colint col1
-60 2006-03-17
+60 2006-11-17
select * from t6 order by colint;
colint col1
-60 2006-03-17
+60 2006-11-17
-------------------------------------------------------------------------
---- Delete rows and partitions of tables with weekofyear(col1)
+--- Delete rows and partitions of tables with weekday(col1)
-------------------------------------------------------------------------
-delete from t11 where col1='2006-03-17';
-delete from t22 where col1='2006-03-17';
-delete from t33 where col1='2006-03-17';
-delete from t44 where col1='2006-03-17';
-delete from t55 where col1='2006-03-17';
-delete from t66 where col1='2006-03-17';
+delete from t11 where col1='2006-11-17';
+delete from t22 where col1='2006-11-17';
+delete from t33 where col1='2006-11-17';
+delete from t44 where col1='2006-11-17';
+delete from t55 where col1='2006-11-17';
+delete from t66 where col1='2006-11-17';
select * from t11 order by col1;
col1
-2006-09-06
+2006-02-06
select * from t22 order by col1;
col1
+2006-02-06
2006-05-25
-2006-09-06
select * from t33 order by col1;
col1
+2006-02-06
2006-05-25
-2006-09-06
select * from t44 order by colint;
colint col1
1 2006-02-03
@@ -12625,47 +11825,47 @@ colint col1
2 2006-01-17
3 2006-01-25
4 2006-02-05
-insert into t11 values ('2006-03-17');
-insert into t22 values ('2006-03-17');
-insert into t33 values ('2006-03-17');
-insert into t44 values (60,'2006-03-17');
-insert into t55 values (60,'2006-03-17');
-insert into t66 values (60,'2006-03-17');
+insert into t11 values ('2006-11-17');
+insert into t22 values ('2006-11-17');
+insert into t33 values ('2006-11-17');
+insert into t44 values (60,'2006-11-17');
+insert into t55 values (60,'2006-11-17');
+insert into t66 values (60,'2006-11-17');
select * from t11 order by col1;
col1
-2006-03-17
-2006-09-06
+2006-02-06
+2006-11-17
select * from t22 order by col1;
col1
-2006-03-17
+2006-02-06
2006-05-25
-2006-09-06
+2006-11-17
select * from t33 order by col1;
col1
-2006-03-17
+2006-02-06
2006-05-25
-2006-09-06
+2006-11-17
select * from t44 order by colint;
colint col1
1 2006-02-03
2 2006-01-17
3 2006-01-25
4 2006-02-05
-60 2006-03-17
+60 2006-11-17
select * from t55 order by colint;
colint col1
1 2006-02-03
2 2006-01-17
3 2006-01-25
4 2006-02-05
-60 2006-03-17
+60 2006-11-17
select * from t66 order by colint;
colint col1
1 2006-02-03
2 2006-01-17
3 2006-01-25
4 2006-02-05
-60 2006-03-17
+60 2006-11-17
alter table t11 drop partition p0;
alter table t22 drop partition p0;
alter table t44 drop partition p0;
@@ -12673,26 +11873,22 @@ alter table t55 drop partition p0;
alter table t66 drop partition p0;
select * from t11 order by col1;
col1
-2006-09-06
select * from t22 order by col1;
col1
-2006-03-17
-2006-05-25
-2006-09-06
select * from t33 order by col1;
col1
-2006-03-17
+2006-02-06
2006-05-25
-2006-09-06
+2006-11-17
select * from t44 order by colint;
colint col1
-60 2006-03-17
+60 2006-11-17
select * from t55 order by colint;
colint col1
-60 2006-03-17
+60 2006-11-17
select * from t66 order by colint;
colint col1
-60 2006-03-17
+60 2006-11-17
-------------------------
---- some alter table end
-------------------------
@@ -12765,9 +11961,9 @@ insert into t2 values ('2004-05-25');
insert into t3 values ('1996-01-03');
insert into t3 values ('2000-02-17');
insert into t3 values ('2004-05-25');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select year(col1)-1990 from t1 order by col1;
year(col1)-1990
6
@@ -13269,9 +12465,9 @@ insert into t2 values ('2006-03-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-08-17');
insert into t3 values ('2006-03-25');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select yearweek(col1)-200600 from t1 order by col1;
yearweek(col1)-200600
1
diff --git a/mysql-test/suite/parts/r/part_supported_sql_func_myisam.result b/mysql-test/suite/parts/r/part_supported_sql_func_myisam.result
index 3e668139c7d..f14f9517646 100644
--- a/mysql-test/suite/parts/r/part_supported_sql_func_myisam.result
+++ b/mysql-test/suite/parts/r/part_supported_sql_func_myisam.result
@@ -55,9 +55,9 @@ insert into t2 values (17 );
insert into t3 values (5 );
insert into t3 values (13 );
insert into t3 values (17 );
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_int.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_int.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_int.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t6;
select abs(col1) from t1 order by col1;
abs(col1)
5
@@ -1675,7 +1675,7 @@ drop table if exists t44 ;
drop table if exists t55 ;
drop table if exists t66 ;
-------------------------------------------------------------------------
---- ascii(col1) in partition with coltype char(1)
+--- mod(col1,10) in partition with coltype int
-------------------------------------------------------------------------
drop table if exists t1 ;
drop table if exists t2 ;
@@ -1684,1510 +1684,14 @@ drop table if exists t4 ;
drop table if exists t5 ;
drop table if exists t6 ;
-------------------------------------------------------------------------
---- Create tables with ascii(col1)
+--- Create tables with mod(col1,10)
-------------------------------------------------------------------------
-create table t1 (col1 char(1)) engine='MYISAM'
-partition by range(ascii(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 char(1)) engine='MYISAM'
-partition by list(ascii(col1))
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-create table t3 (col1 char(1)) engine='MYISAM'
-partition by hash(ascii(col1));
-create table t4 (colint int, col1 char(1)) engine='MYISAM'
-partition by range(colint)
-subpartition by hash(ascii(col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t5 (colint int, col1 char(1)) engine='MYISAM'
-partition by list(colint)
-subpartition by hash(ascii(col1)) subpartitions 2
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-create table t6 (colint int, col1 char(1)) engine='MYISAM'
-partition by range(colint)
-(partition p0 values less than (ascii('5')),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with ascii(col1)
--------------------------------------------------------------------------
-insert into t1 values ('1');
-insert into t1 values ('9');
-insert into t2 values ('1');
-insert into t2 values ('9');
-insert into t2 values ('3');
-insert into t3 values ('1');
-insert into t3 values ('9');
-insert into t3 values ('3');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc' into table t6;
-select ascii(col1) from t1 order by col1;
-ascii(col1)
-49
-57
-select * from t1 order by col1;
-col1
-1
-9
-select * from t2 order by col1;
-col1
-1
-3
-9
-select * from t3 order by col1;
-col1
-1
-3
-9
-select * from t4 order by colint;
-colint col1
-1 1
-2 9
-3 3
-4 8
-select * from t5 order by colint;
-colint col1
-1 1
-2 9
-3 3
-4 8
-select * from t6 order by colint;
-colint col1
-1 1
-2 9
-3 3
-4 8
-update t1 set col1='8' where col1='1';
-update t2 set col1='8' where col1='1';
-update t3 set col1='8' where col1='1';
-update t4 set col1='8' where col1='1';
-update t5 set col1='8' where col1='1';
-update t6 set col1='8' where col1='1';
-select * from t1 order by col1;
-col1
-8
-9
-select * from t2 order by col1;
-col1
-3
-8
-9
-select * from t3 order by col1;
-col1
-3
-8
-9
-select * from t4 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-select * from t5 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-select * from t6 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
--------------------------------------------------------------------------
---- Alter tables with ascii(col1)
--------------------------------------------------------------------------
-drop table if exists t11 ;
-drop table if exists t22 ;
-drop table if exists t33 ;
-drop table if exists t44 ;
-drop table if exists t55 ;
-drop table if exists t66 ;
-create table t11 engine='MYISAM' as select * from t1;
-create table t22 engine='MYISAM' as select * from t2;
-create table t33 engine='MYISAM' as select * from t3;
-create table t44 engine='MYISAM' as select * from t4;
-create table t55 engine='MYISAM' as select * from t5;
-create table t66 engine='MYISAM' as select * from t6;
-alter table t11
-partition by range(ascii(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(ascii(col1))
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-alter table t33
-partition by hash(ascii(col1));
-alter table t44
-partition by range(colint)
-subpartition by hash(ascii(col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t55
-partition by list(colint)
-subpartition by hash(ascii(col1)) subpartitions 2
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-alter table t66
-partition by range(colint)
-(partition p0 values less than (ascii('5')),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-8
-9
-select * from t22 order by col1;
-col1
-3
-8
-9
-select * from t33 order by col1;
-col1
-3
-8
-9
-select * from t44 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-select * from t55 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-select * from t66 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
----------------------------
----- some alter table begin
----------------------------
-alter table t11
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-8
-9
-alter table t11
-reorganize partition s1 into
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-8
-9
-alter table t55
-partition by list(colint)
-subpartition by hash(ascii(col1)) subpartitions 5
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-show create table t55;
-Table Create Table
-t55 CREATE TABLE `t55` (
- `colint` int(11) DEFAULT NULL,
- `col1` char(1) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (ascii(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
-select * from t55 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-alter table t66
-reorganize partition s1 into
-(partition p0 values less than (ascii('5')),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-alter table t66
-reorganize partition s1 into
-(partition p0 values less than (ascii('5')),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with ascii(col1)
--------------------------------------------------------------------------
-delete from t1 where col1='9';
-delete from t2 where col1='9';
-delete from t3 where col1='9';
-delete from t4 where col1='9';
-delete from t5 where col1='9';
-delete from t6 where col1='9';
-select * from t1 order by col1;
-col1
-8
-select * from t2 order by col1;
-col1
-3
-8
-select * from t3 order by col1;
-col1
-3
-8
-select * from t4 order by colint;
-colint col1
-1 8
-3 3
-4 8
-select * from t5 order by colint;
-colint col1
-1 8
-3 3
-4 8
-insert into t1 values ('9');
-insert into t2 values ('9');
-insert into t3 values ('9');
-insert into t4 values (60,'9');
-insert into t5 values (60,'9');
-insert into t6 values (60,'9');
-select * from t1 order by col1;
-col1
-8
-9
-select * from t2 order by col1;
-col1
-3
-8
-9
-select * from t3 order by col1;
-col1
-3
-8
-9
-select * from t4 order by colint;
-colint col1
-1 8
-3 3
-4 8
-60 9
-select * from t5 order by colint;
-colint col1
-1 8
-3 3
-4 8
-60 9
-select * from t6 order by colint;
-colint col1
-1 8
-3 3
-4 8
-60 9
-alter table t1 drop partition p0;
-alter table t2 drop partition p0;
-alter table t4 drop partition p0;
-alter table t5 drop partition p0;
-alter table t6 drop partition p0;
-select * from t1 order by col1;
-col1
-8
-9
-select * from t2 order by col1;
-col1
-3
-8
-9
-select * from t3 order by col1;
-col1
-3
-8
-9
-select * from t4 order by colint;
-colint col1
-60 9
-select * from t5 order by colint;
-colint col1
-60 9
-select * from t6 order by colint;
-colint col1
-60 9
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with ascii(col1)
--------------------------------------------------------------------------
-delete from t11 where col1='9';
-delete from t22 where col1='9';
-delete from t33 where col1='9';
-delete from t44 where col1='9';
-delete from t55 where col1='9';
-delete from t66 where col1='9';
-select * from t11 order by col1;
-col1
-8
-select * from t22 order by col1;
-col1
-3
-8
-select * from t33 order by col1;
-col1
-3
-8
-select * from t44 order by colint;
-colint col1
-1 8
-3 3
-4 8
-select * from t55 order by colint;
-colint col1
-1 8
-3 3
-4 8
-insert into t11 values ('9');
-insert into t22 values ('9');
-insert into t33 values ('9');
-insert into t44 values (60,'9');
-insert into t55 values (60,'9');
-insert into t66 values (60,'9');
-select * from t11 order by col1;
-col1
-8
-9
-select * from t22 order by col1;
-col1
-3
-8
-9
-select * from t33 order by col1;
-col1
-3
-8
-9
-select * from t44 order by colint;
-colint col1
-1 8
-3 3
-4 8
-60 9
-select * from t55 order by colint;
-colint col1
-1 8
-3 3
-4 8
-60 9
-select * from t66 order by colint;
-colint col1
-1 8
-3 3
-4 8
-60 9
-alter table t11 drop partition p0;
-alter table t22 drop partition p0;
-alter table t44 drop partition p0;
-alter table t55 drop partition p0;
-alter table t66 drop partition p0;
-select * from t11 order by col1;
-col1
-8
-9
-select * from t22 order by col1;
-col1
-3
-8
-9
-select * from t33 order by col1;
-col1
-3
-8
-9
-select * from t44 order by colint;
-colint col1
-60 9
-select * from t55 order by colint;
-colint col1
-60 9
-select * from t66 order by colint;
-colint col1
-60 9
--------------------------
----- some alter table end
--------------------------
-drop table if exists t1 ;
-drop table if exists t2 ;
-drop table if exists t3 ;
-drop table if exists t4 ;
-drop table if exists t5 ;
-drop table if exists t6 ;
-drop table if exists t11 ;
-drop table if exists t22 ;
-drop table if exists t33 ;
-drop table if exists t44 ;
-drop table if exists t55 ;
-drop table if exists t66 ;
--------------------------------------------------------------------------
---- cast(ceiling(col1) as signed integer) in partition with coltype float(7,4)
--------------------------------------------------------------------------
-drop table if exists t1 ;
-drop table if exists t2 ;
-drop table if exists t3 ;
-drop table if exists t4 ;
-drop table if exists t5 ;
-drop table if exists t6 ;
--------------------------------------------------------------------------
---- Create tables with cast(ceiling(col1) as signed integer)
--------------------------------------------------------------------------
-create table t1 (col1 float(7,4)) engine='MYISAM'
-partition by range(cast(ceiling(col1) as signed integer))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 float(7,4)) engine='MYISAM'
-partition by list(cast(ceiling(col1) as signed integer))
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-create table t3 (col1 float(7,4)) engine='MYISAM'
-partition by hash(cast(ceiling(col1) as signed integer));
-create table t4 (colint int, col1 float(7,4)) engine='MYISAM'
-partition by range(colint)
-subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t5 (colint int, col1 float(7,4)) engine='MYISAM'
-partition by list(colint)
-subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-create table t6 (colint int, col1 float(7,4)) engine='MYISAM'
-partition by range(colint)
-(partition p0 values less than (cast(ceiling(15) as signed integer)),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with cast(ceiling(col1) as signed integer)
--------------------------------------------------------------------------
-insert into t1 values (5.1230);
-insert into t1 values (13.345);
-insert into t2 values (5.1230);
-insert into t2 values (13.345);
-insert into t2 values (17.987);
-insert into t3 values (5.1230);
-insert into t3 values (13.345);
-insert into t3 values (17.987);
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t6;
-select cast(ceiling(col1) as signed integer) from t1 order by col1;
-cast(ceiling(col1) as signed integer)
-6
-14
-select * from t1 order by col1;
-col1
-5.1230
-13.3450
-select * from t2 order by col1;
-col1
-5.1230
-13.3450
-17.9870
-select * from t3 order by col1;
-col1
-5.1230
-13.3450
-17.9870
-select * from t4 order by colint;
-colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
-select * from t5 order by colint;
-colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
-select * from t6 order by colint;
-colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
-update t1 set col1=15.654 where col1=5.1230;
-update t2 set col1=15.654 where col1=5.1230;
-update t3 set col1=15.654 where col1=5.1230;
-update t4 set col1=15.654 where col1=5.1230;
-update t5 set col1=15.654 where col1=5.1230;
-update t6 set col1=15.654 where col1=5.1230;
-select * from t1 order by col1;
-col1
-13.3450
-15.6540
-select * from t2 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t3 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t4 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-select * from t5 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-select * from t6 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
--------------------------------------------------------------------------
---- Alter tables with cast(ceiling(col1) as signed integer)
--------------------------------------------------------------------------
-drop table if exists t11 ;
-drop table if exists t22 ;
-drop table if exists t33 ;
-drop table if exists t44 ;
-drop table if exists t55 ;
-drop table if exists t66 ;
-create table t11 engine='MYISAM' as select * from t1;
-create table t22 engine='MYISAM' as select * from t2;
-create table t33 engine='MYISAM' as select * from t3;
-create table t44 engine='MYISAM' as select * from t4;
-create table t55 engine='MYISAM' as select * from t5;
-create table t66 engine='MYISAM' as select * from t6;
-alter table t11
-partition by range(cast(ceiling(col1) as signed integer))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(cast(ceiling(col1) as signed integer))
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-alter table t33
-partition by hash(cast(ceiling(col1) as signed integer));
-alter table t44
-partition by range(colint)
-subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t55
-partition by list(colint)
-subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-alter table t66
-partition by range(colint)
-(partition p0 values less than (cast(ceiling(15) as signed integer)),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-13.3450
-15.6540
-select * from t22 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t33 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t44 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-select * from t55 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-select * from t66 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
----------------------------
----- some alter table begin
----------------------------
-alter table t11
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-13.3450
-15.6540
-alter table t11
-reorganize partition s1 into
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-13.3450
-15.6540
-alter table t55
-partition by list(colint)
-subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 5
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-show create table t55;
-Table Create Table
-t55 CREATE TABLE `t55` (
- `colint` int(11) DEFAULT NULL,
- `col1` float(7,4) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(ceiling(col1) as signed integer)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
-select * from t55 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-alter table t66
-reorganize partition s1 into
-(partition p0 values less than (cast(ceiling(15) as signed integer)),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-alter table t66
-reorganize partition s1 into
-(partition p0 values less than (cast(ceiling(15) as signed integer)),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with cast(ceiling(col1) as signed integer)
--------------------------------------------------------------------------
-delete from t1 where col1=13.345;
-delete from t2 where col1=13.345;
-delete from t3 where col1=13.345;
-delete from t4 where col1=13.345;
-delete from t5 where col1=13.345;
-delete from t6 where col1=13.345;
-select * from t1 order by col1;
-col1
-15.6540
-select * from t2 order by col1;
-col1
-15.6540
-17.9870
-select * from t3 order by col1;
-col1
-15.6540
-17.9870
-select * from t4 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-select * from t5 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-insert into t1 values (13.345);
-insert into t2 values (13.345);
-insert into t3 values (13.345);
-insert into t4 values (60,13.345);
-insert into t5 values (60,13.345);
-insert into t6 values (60,13.345);
-select * from t1 order by col1;
-col1
-13.3450
-15.6540
-select * from t2 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t3 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t4 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-60 13.3450
-select * from t5 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-60 13.3450
-select * from t6 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-60 13.3450
-alter table t1 drop partition p0;
-alter table t2 drop partition p0;
-alter table t4 drop partition p0;
-alter table t5 drop partition p0;
-alter table t6 drop partition p0;
-select * from t1 order by col1;
-col1
-15.6540
-select * from t2 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t3 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t4 order by colint;
-colint col1
-60 13.3450
-select * from t5 order by colint;
-colint col1
-60 13.3450
-select * from t6 order by colint;
-colint col1
-60 13.3450
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with cast(ceiling(col1) as signed integer)
--------------------------------------------------------------------------
-delete from t11 where col1=13.345;
-delete from t22 where col1=13.345;
-delete from t33 where col1=13.345;
-delete from t44 where col1=13.345;
-delete from t55 where col1=13.345;
-delete from t66 where col1=13.345;
-select * from t11 order by col1;
-col1
-15.6540
-select * from t22 order by col1;
-col1
-15.6540
-17.9870
-select * from t33 order by col1;
-col1
-15.6540
-17.9870
-select * from t44 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-select * from t55 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-insert into t11 values (13.345);
-insert into t22 values (13.345);
-insert into t33 values (13.345);
-insert into t44 values (60,13.345);
-insert into t55 values (60,13.345);
-insert into t66 values (60,13.345);
-select * from t11 order by col1;
-col1
-13.3450
-15.6540
-select * from t22 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t33 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t44 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-60 13.3450
-select * from t55 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-60 13.3450
-select * from t66 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-60 13.3450
-alter table t11 drop partition p0;
-alter table t22 drop partition p0;
-alter table t44 drop partition p0;
-alter table t55 drop partition p0;
-alter table t66 drop partition p0;
-select * from t11 order by col1;
-col1
-15.6540
-select * from t22 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t33 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t44 order by colint;
-colint col1
-60 13.3450
-select * from t55 order by colint;
-colint col1
-60 13.3450
-select * from t66 order by colint;
-colint col1
-60 13.3450
--------------------------
----- some alter table end
--------------------------
-drop table if exists t1 ;
-drop table if exists t2 ;
-drop table if exists t3 ;
-drop table if exists t4 ;
-drop table if exists t5 ;
-drop table if exists t6 ;
-drop table if exists t11 ;
-drop table if exists t22 ;
-drop table if exists t33 ;
-drop table if exists t44 ;
-drop table if exists t55 ;
-drop table if exists t66 ;
--------------------------------------------------------------------------
---- cast(floor(col1) as signed) in partition with coltype float(7,4)
--------------------------------------------------------------------------
-drop table if exists t1 ;
-drop table if exists t2 ;
-drop table if exists t3 ;
-drop table if exists t4 ;
-drop table if exists t5 ;
-drop table if exists t6 ;
--------------------------------------------------------------------------
---- Create tables with cast(floor(col1) as signed)
--------------------------------------------------------------------------
-create table t1 (col1 float(7,4)) engine='MYISAM'
-partition by range(cast(floor(col1) as signed))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 float(7,4)) engine='MYISAM'
-partition by list(cast(floor(col1) as signed))
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-create table t3 (col1 float(7,4)) engine='MYISAM'
-partition by hash(cast(floor(col1) as signed));
-create table t4 (colint int, col1 float(7,4)) engine='MYISAM'
-partition by range(colint)
-subpartition by hash(cast(floor(col1) as signed)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t5 (colint int, col1 float(7,4)) engine='MYISAM'
-partition by list(colint)
-subpartition by hash(cast(floor(col1) as signed)) subpartitions 2
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-create table t6 (colint int, col1 float(7,4)) engine='MYISAM'
-partition by range(colint)
-(partition p0 values less than (cast(floor(15.123) as signed)),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with cast(floor(col1) as signed)
--------------------------------------------------------------------------
-insert into t1 values (5.1230);
-insert into t1 values (13.345);
-insert into t2 values (5.1230);
-insert into t2 values (13.345);
-insert into t2 values (17.987);
-insert into t3 values (5.1230);
-insert into t3 values (13.345);
-insert into t3 values (17.987);
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t6;
-select cast(floor(col1) as signed) from t1 order by col1;
-cast(floor(col1) as signed)
-5
-13
-select * from t1 order by col1;
-col1
-5.1230
-13.3450
-select * from t2 order by col1;
-col1
-5.1230
-13.3450
-17.9870
-select * from t3 order by col1;
-col1
-5.1230
-13.3450
-17.9870
-select * from t4 order by colint;
-colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
-select * from t5 order by colint;
-colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
-select * from t6 order by colint;
-colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
-update t1 set col1=15.654 where col1=5.1230;
-update t2 set col1=15.654 where col1=5.1230;
-update t3 set col1=15.654 where col1=5.1230;
-update t4 set col1=15.654 where col1=5.1230;
-update t5 set col1=15.654 where col1=5.1230;
-update t6 set col1=15.654 where col1=5.1230;
-select * from t1 order by col1;
-col1
-13.3450
-15.6540
-select * from t2 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t3 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t4 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-select * from t5 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-select * from t6 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
--------------------------------------------------------------------------
---- Alter tables with cast(floor(col1) as signed)
--------------------------------------------------------------------------
-drop table if exists t11 ;
-drop table if exists t22 ;
-drop table if exists t33 ;
-drop table if exists t44 ;
-drop table if exists t55 ;
-drop table if exists t66 ;
-create table t11 engine='MYISAM' as select * from t1;
-create table t22 engine='MYISAM' as select * from t2;
-create table t33 engine='MYISAM' as select * from t3;
-create table t44 engine='MYISAM' as select * from t4;
-create table t55 engine='MYISAM' as select * from t5;
-create table t66 engine='MYISAM' as select * from t6;
-alter table t11
-partition by range(cast(floor(col1) as signed))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(cast(floor(col1) as signed))
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-alter table t33
-partition by hash(cast(floor(col1) as signed));
-alter table t44
-partition by range(colint)
-subpartition by hash(cast(floor(col1) as signed)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t55
-partition by list(colint)
-subpartition by hash(cast(floor(col1) as signed)) subpartitions 2
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-alter table t66
-partition by range(colint)
-(partition p0 values less than (cast(floor(15.123) as signed)),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-13.3450
-15.6540
-select * from t22 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t33 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t44 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-select * from t55 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-select * from t66 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
----------------------------
----- some alter table begin
----------------------------
-alter table t11
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-13.3450
-15.6540
-alter table t11
-reorganize partition s1 into
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-13.3450
-15.6540
-alter table t55
-partition by list(colint)
-subpartition by hash(cast(floor(col1) as signed)) subpartitions 5
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-show create table t55;
-Table Create Table
-t55 CREATE TABLE `t55` (
- `colint` int(11) DEFAULT NULL,
- `col1` float(7,4) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(floor(col1) as signed)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
-select * from t55 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-alter table t66
-reorganize partition s1 into
-(partition p0 values less than (cast(floor(15.123) as signed)),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
-alter table t66
-reorganize partition s1 into
-(partition p0 values less than (cast(floor(15.123) as signed)),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 15.6540
-2 13.3450
-3 17.9870
-4 15.6540
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with cast(floor(col1) as signed)
--------------------------------------------------------------------------
-delete from t1 where col1=13.345;
-delete from t2 where col1=13.345;
-delete from t3 where col1=13.345;
-delete from t4 where col1=13.345;
-delete from t5 where col1=13.345;
-delete from t6 where col1=13.345;
-select * from t1 order by col1;
-col1
-15.6540
-select * from t2 order by col1;
-col1
-15.6540
-17.9870
-select * from t3 order by col1;
-col1
-15.6540
-17.9870
-select * from t4 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-select * from t5 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-insert into t1 values (13.345);
-insert into t2 values (13.345);
-insert into t3 values (13.345);
-insert into t4 values (60,13.345);
-insert into t5 values (60,13.345);
-insert into t6 values (60,13.345);
-select * from t1 order by col1;
-col1
-13.3450
-15.6540
-select * from t2 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t3 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t4 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-60 13.3450
-select * from t5 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-60 13.3450
-select * from t6 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-60 13.3450
-alter table t1 drop partition p0;
-alter table t2 drop partition p0;
-alter table t4 drop partition p0;
-alter table t5 drop partition p0;
-alter table t6 drop partition p0;
-select * from t1 order by col1;
-col1
-15.6540
-select * from t2 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t3 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t4 order by colint;
-colint col1
-60 13.3450
-select * from t5 order by colint;
-colint col1
-60 13.3450
-select * from t6 order by colint;
-colint col1
-60 13.3450
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with cast(floor(col1) as signed)
--------------------------------------------------------------------------
-delete from t11 where col1=13.345;
-delete from t22 where col1=13.345;
-delete from t33 where col1=13.345;
-delete from t44 where col1=13.345;
-delete from t55 where col1=13.345;
-delete from t66 where col1=13.345;
-select * from t11 order by col1;
-col1
-15.6540
-select * from t22 order by col1;
-col1
-15.6540
-17.9870
-select * from t33 order by col1;
-col1
-15.6540
-17.9870
-select * from t44 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-select * from t55 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-insert into t11 values (13.345);
-insert into t22 values (13.345);
-insert into t33 values (13.345);
-insert into t44 values (60,13.345);
-insert into t55 values (60,13.345);
-insert into t66 values (60,13.345);
-select * from t11 order by col1;
-col1
-13.3450
-15.6540
-select * from t22 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t33 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t44 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-60 13.3450
-select * from t55 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-60 13.3450
-select * from t66 order by colint;
-colint col1
-1 15.6540
-3 17.9870
-4 15.6540
-60 13.3450
-alter table t11 drop partition p0;
-alter table t22 drop partition p0;
-alter table t44 drop partition p0;
-alter table t55 drop partition p0;
-alter table t66 drop partition p0;
-select * from t11 order by col1;
-col1
-15.6540
-select * from t22 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t33 order by col1;
-col1
-13.3450
-15.6540
-17.9870
-select * from t44 order by colint;
-colint col1
-60 13.3450
-select * from t55 order by colint;
-colint col1
-60 13.3450
-select * from t66 order by colint;
-colint col1
-60 13.3450
--------------------------
----- some alter table end
--------------------------
-drop table if exists t1 ;
-drop table if exists t2 ;
-drop table if exists t3 ;
-drop table if exists t4 ;
-drop table if exists t5 ;
-drop table if exists t6 ;
-drop table if exists t11 ;
-drop table if exists t22 ;
-drop table if exists t33 ;
-drop table if exists t44 ;
-drop table if exists t55 ;
-drop table if exists t66 ;
--------------------------------------------------------------------------
---- cast(mod(col1,10) as signed) in partition with coltype float(7,4)
--------------------------------------------------------------------------
-drop table if exists t1 ;
-drop table if exists t2 ;
-drop table if exists t3 ;
-drop table if exists t4 ;
-drop table if exists t5 ;
-drop table if exists t6 ;
--------------------------------------------------------------------------
---- Create tables with cast(mod(col1,10) as signed)
--------------------------------------------------------------------------
-create table t1 (col1 float(7,4)) engine='MYISAM'
-partition by range(cast(mod(col1,10) as signed))
+create table t1 (col1 int) engine='MYISAM'
+partition by range(mod(col1,10))
(partition p0 values less than (15),
partition p1 values less than maxvalue);
-create table t2 (col1 float(7,4)) engine='MYISAM'
-partition by list(cast(mod(col1,10) as signed))
+create table t2 (col1 int) engine='MYISAM'
+partition by list(mod(col1,10))
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -3195,16 +1699,16 @@ partition p3 values in (31,32,33,34,35,36,37,38,39,40),
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
);
-create table t3 (col1 float(7,4)) engine='MYISAM'
-partition by hash(cast(mod(col1,10) as signed));
-create table t4 (colint int, col1 float(7,4)) engine='MYISAM'
+create table t3 (col1 int) engine='MYISAM'
+partition by hash(mod(col1,10));
+create table t4 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
-subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2
+subpartition by hash(mod(col1,10)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than maxvalue);
-create table t5 (colint int, col1 float(7,4)) engine='MYISAM'
+create table t5 (colint int, col1 int) engine='MYISAM'
partition by list(colint)
-subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2
+subpartition by hash(mod(col1,10)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -3212,100 +1716,346 @@ partition p3 values in (31,32,33,34,35,36,37,38,39,40),
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
);
-create table t6 (colint int, col1 float(7,4)) engine='MYISAM'
+create table t6 (colint int, col1 int) engine='MYISAM'
partition by range(colint)
-(partition p0 values less than (cast(mod(15,10) as signed)),
+(partition p0 values less than (mod(15,10)),
partition p1 values less than maxvalue);
-------------------------------------------------------------------------
---- Access tables with cast(mod(col1,10) as signed)
+--- Access tables with mod(col1,10)
-------------------------------------------------------------------------
-insert into t1 values (5.0000);
+insert into t1 values (5);
insert into t1 values (19);
-insert into t2 values (5.0000);
+insert into t2 values (5);
insert into t2 values (19);
insert into t2 values (17);
-insert into t3 values (5.0000);
+insert into t3 values (5);
insert into t3 values (19);
insert into t3 values (17);
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t6;
-select cast(mod(col1,10) as signed) from t1 order by col1;
-cast(mod(col1,10) as signed)
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t6;
+select mod(col1,10) from t1 order by col1;
+mod(col1,10)
5
9
select * from t1 order by col1;
col1
-5.0000
-19.0000
+5
+19
select * from t2 order by col1;
col1
-5.0000
-17.0000
-19.0000
+5
+17
+19
select * from t3 order by col1;
col1
-5.0000
-17.0000
-19.0000
+5
+17
+19
select * from t4 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 5
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 5
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
select * from t5 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 5
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 5
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
select * from t6 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
-update t1 set col1=15 where col1=5.0000;
-update t2 set col1=15 where col1=5.0000;
-update t3 set col1=15 where col1=5.0000;
-update t4 set col1=15 where col1=5.0000;
-update t5 set col1=15 where col1=5.0000;
-update t6 set col1=15 where col1=5.0000;
+1 5
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 5
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
+update t1 set col1=15 where col1=5;
+update t2 set col1=15 where col1=5;
+update t3 set col1=15 where col1=5;
+update t4 set col1=15 where col1=5;
+update t5 set col1=15 where col1=5;
+update t6 set col1=15 where col1=5;
select * from t1 order by col1;
col1
-15.0000
-19.0000
+15
+19
select * from t2 order by col1;
col1
-15.0000
-17.0000
-19.0000
+15
+17
+19
select * from t3 order by col1;
col1
-15.0000
-17.0000
-19.0000
+15
+17
+19
select * from t4 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
select * from t5 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
select * from t6 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
-------------------------------------------------------------------------
---- Alter tables with cast(mod(col1,10) as signed)
+--- Alter tables with mod(col1,10)
-------------------------------------------------------------------------
drop table if exists t11 ;
drop table if exists t22 ;
@@ -3320,11 +2070,11 @@ create table t44 engine='MYISAM' as select * from t4;
create table t55 engine='MYISAM' as select * from t5;
create table t66 engine='MYISAM' as select * from t6;
alter table t11
-partition by range(cast(mod(col1,10) as signed))
+partition by range(mod(col1,10))
(partition p0 values less than (15),
partition p1 values less than maxvalue);
alter table t22
-partition by list(cast(mod(col1,10) as signed))
+partition by list(mod(col1,10))
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -3333,15 +2083,15 @@ partition p4 values in (41,42,43,44,45,46,47,48,49,50),
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
);
alter table t33
-partition by hash(cast(mod(col1,10) as signed));
+partition by hash(mod(col1,10));
alter table t44
partition by range(colint)
-subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2
+subpartition by hash(mod(col1,10)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than maxvalue);
alter table t55
partition by list(colint)
-subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2
+subpartition by hash(mod(col1,10)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -3351,40 +2101,163 @@ partition p5 values in (51,52,53,54,55,56,57,58,59,60)
);
alter table t66
partition by range(colint)
-(partition p0 values less than (cast(mod(15,10) as signed)),
+(partition p0 values less than (mod(15,10)),
partition p1 values less than maxvalue);
select * from t11 order by col1;
col1
-15.0000
-19.0000
+15
+19
select * from t22 order by col1;
col1
-15.0000
-17.0000
-19.0000
+15
+17
+19
select * from t33 order by col1;
col1
-15.0000
-17.0000
-19.0000
+15
+17
+19
select * from t44 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
select * from t55 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
select * from t66 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
---------------------------
---- some alter table begin
---------------------------
@@ -3393,19 +2266,19 @@ reorganize partition p0,p1 into
(partition s1 values less than maxvalue);
select * from t11 order by col1;
col1
-15.0000
-19.0000
+15
+19
alter table t11
reorganize partition s1 into
(partition p0 values less than (15),
partition p1 values less than maxvalue);
select * from t11 order by col1;
col1
-15.0000
-19.0000
+15
+19
alter table t55
partition by list(colint)
-subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 5
+subpartition by hash(mod(col1,10)) subpartitions 5
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -3417,54 +2290,259 @@ show create table t55;
Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
- `col1` float(7,4) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(mod(col1,10) as signed)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
+ `col1` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (mod(col1,10)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
select * from t55 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
alter table t66
reorganize partition p0,p1 into
(partition s1 values less than maxvalue);
select * from t66 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
alter table t66
reorganize partition s1 into
-(partition p0 values less than (cast(mod(15,10) as signed)),
+(partition p0 values less than (mod(15,10)),
partition p1 values less than maxvalue);
select * from t66 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
alter table t66
reorganize partition p0,p1 into
(partition s1 values less than maxvalue);
select * from t66 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
alter table t66
reorganize partition s1 into
-(partition p0 values less than (cast(mod(15,10) as signed)),
+(partition p0 values less than (mod(15,10)),
partition p1 values less than maxvalue);
select * from t66 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
-------------------------------------------------------------------------
---- Delete rows and partitions of tables with cast(mod(col1,10) as signed)
+--- Delete rows and partitions of tables with mod(col1,10)
-------------------------------------------------------------------------
delete from t1 where col1=19;
delete from t2 where col1=19;
@@ -3474,27 +2552,109 @@ delete from t5 where col1=19;
delete from t6 where col1=19;
select * from t1 order by col1;
col1
-15.0000
+15
select * from t2 order by col1;
col1
-15.0000
-17.0000
+15
+17
select * from t3 order by col1;
col1
-15.0000
-17.0000
+15
+17
select * from t4 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
select * from t5 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
insert into t1 values (19);
insert into t2 values (19);
insert into t3 values (19);
@@ -3503,39 +2663,162 @@ insert into t5 values (60,19);
insert into t6 values (60,19);
select * from t1 order by col1;
col1
-15.0000
-19.0000
+15
+19
select * from t2 order by col1;
col1
-15.0000
-17.0000
-19.0000
+15
+17
+19
select * from t3 order by col1;
col1
-15.0000
-17.0000
-19.0000
+15
+17
+19
select * from t4 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
-60 19.0000
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
+60 19
select * from t5 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
-60 19.0000
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
+60 19
select * from t6 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
-60 19.0000
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
+60 19
alter table t1 drop partition p0;
alter table t2 drop partition p0;
alter table t4 drop partition p0;
@@ -3547,20 +2830,127 @@ select * from t2 order by col1;
col1
select * from t3 order by col1;
col1
-15.0000
-17.0000
-19.0000
+15
+17
+19
select * from t4 order by colint;
colint col1
-60 19.0000
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
+60 19
select * from t5 order by colint;
colint col1
-60 19.0000
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
+60 19
select * from t6 order by colint;
colint col1
-60 19.0000
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
+60 19
-------------------------------------------------------------------------
---- Delete rows and partitions of tables with cast(mod(col1,10) as signed)
+--- Delete rows and partitions of tables with mod(col1,10)
-------------------------------------------------------------------------
delete from t11 where col1=19;
delete from t22 where col1=19;
@@ -3570,27 +2960,109 @@ delete from t55 where col1=19;
delete from t66 where col1=19;
select * from t11 order by col1;
col1
-15.0000
+15
select * from t22 order by col1;
col1
-15.0000
-17.0000
+15
+17
select * from t33 order by col1;
col1
-15.0000
-17.0000
+15
+17
select * from t44 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
select * from t55 order by colint;
colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
insert into t11 values (19);
insert into t22 values (19);
insert into t33 values (19);
@@ -3599,533 +3071,162 @@ insert into t55 values (60,19);
insert into t66 values (60,19);
select * from t11 order by col1;
col1
-15.0000
-19.0000
-select * from t22 order by col1;
-col1
-15.0000
-17.0000
-19.0000
-select * from t33 order by col1;
-col1
-15.0000
-17.0000
-19.0000
-select * from t44 order by colint;
-colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
-60 19.0000
-select * from t55 order by colint;
-colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
-60 19.0000
-select * from t66 order by colint;
-colint col1
-1 5.1230
-2 13.3450
-3 17.9870
-4 15.6540
-60 19.0000
-alter table t11 drop partition p0;
-alter table t22 drop partition p0;
-alter table t44 drop partition p0;
-alter table t55 drop partition p0;
-alter table t66 drop partition p0;
-select * from t11 order by col1;
-col1
-select * from t22 order by col1;
-col1
-select * from t33 order by col1;
-col1
-15.0000
-17.0000
-19.0000
-select * from t44 order by colint;
-colint col1
-60 19.0000
-select * from t55 order by colint;
-colint col1
-60 19.0000
-select * from t66 order by colint;
-colint col1
-60 19.0000
--------------------------
----- some alter table end
--------------------------
-drop table if exists t1 ;
-drop table if exists t2 ;
-drop table if exists t3 ;
-drop table if exists t4 ;
-drop table if exists t5 ;
-drop table if exists t6 ;
-drop table if exists t11 ;
-drop table if exists t22 ;
-drop table if exists t33 ;
-drop table if exists t44 ;
-drop table if exists t55 ;
-drop table if exists t66 ;
--------------------------------------------------------------------------
---- ord(col1) in partition with coltype char(3)
--------------------------------------------------------------------------
-drop table if exists t1 ;
-drop table if exists t2 ;
-drop table if exists t3 ;
-drop table if exists t4 ;
-drop table if exists t5 ;
-drop table if exists t6 ;
--------------------------------------------------------------------------
---- Create tables with ord(col1)
--------------------------------------------------------------------------
-create table t1 (col1 char(3)) engine='MYISAM'
-partition by range(ord(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 char(3)) engine='MYISAM'
-partition by list(ord(col1))
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-create table t3 (col1 char(3)) engine='MYISAM'
-partition by hash(ord(col1));
-create table t4 (colint int, col1 char(3)) engine='MYISAM'
-partition by range(colint)
-subpartition by hash(ord(col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t5 (colint int, col1 char(3)) engine='MYISAM'
-partition by list(colint)
-subpartition by hash(ord(col1)) subpartitions 2
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-create table t6 (colint int, col1 char(3)) engine='MYISAM'
-partition by range(colint)
-(partition p0 values less than (ord('a')),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with ord(col1)
--------------------------------------------------------------------------
-insert into t1 values ('1');
-insert into t1 values ('9');
-insert into t2 values ('1');
-insert into t2 values ('9');
-insert into t2 values ('3');
-insert into t3 values ('1');
-insert into t3 values ('9');
-insert into t3 values ('3');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc' into table t6;
-select ord(col1) from t1 order by col1;
-ord(col1)
-49
-57
-select * from t1 order by col1;
-col1
-1
-9
-select * from t2 order by col1;
-col1
-1
-3
-9
-select * from t3 order by col1;
-col1
-1
-3
-9
-select * from t4 order by colint;
-colint col1
-1 1
-2 9
-3 3
-4 8
-select * from t5 order by colint;
-colint col1
-1 1
-2 9
-3 3
-4 8
-select * from t6 order by colint;
-colint col1
-1 1
-2 9
-3 3
-4 8
-update t1 set col1='8' where col1='1';
-update t2 set col1='8' where col1='1';
-update t3 set col1='8' where col1='1';
-update t4 set col1='8' where col1='1';
-update t5 set col1='8' where col1='1';
-update t6 set col1='8' where col1='1';
-select * from t1 order by col1;
-col1
-8
-9
-select * from t2 order by col1;
-col1
-3
-8
-9
-select * from t3 order by col1;
-col1
-3
-8
-9
-select * from t4 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-select * from t5 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-select * from t6 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
--------------------------------------------------------------------------
---- Alter tables with ord(col1)
--------------------------------------------------------------------------
-drop table if exists t11 ;
-drop table if exists t22 ;
-drop table if exists t33 ;
-drop table if exists t44 ;
-drop table if exists t55 ;
-drop table if exists t66 ;
-create table t11 engine='MYISAM' as select * from t1;
-create table t22 engine='MYISAM' as select * from t2;
-create table t33 engine='MYISAM' as select * from t3;
-create table t44 engine='MYISAM' as select * from t4;
-create table t55 engine='MYISAM' as select * from t5;
-create table t66 engine='MYISAM' as select * from t6;
-alter table t11
-partition by range(ord(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(ord(col1))
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-alter table t33
-partition by hash(ord(col1));
-alter table t44
-partition by range(colint)
-subpartition by hash(ord(col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t55
-partition by list(colint)
-subpartition by hash(ord(col1)) subpartitions 2
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-alter table t66
-partition by range(colint)
-(partition p0 values less than (ord('a')),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-8
-9
-select * from t22 order by col1;
-col1
-3
-8
-9
-select * from t33 order by col1;
-col1
-3
-8
-9
-select * from t44 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-select * from t55 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-select * from t66 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
----------------------------
----- some alter table begin
----------------------------
-alter table t11
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-8
-9
-alter table t11
-reorganize partition s1 into
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-8
-9
-alter table t55
-partition by list(colint)
-subpartition by hash(ord(col1)) subpartitions 5
-(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
-partition p1 values in (11,12,13,14,15,16,17,18,19,20),
-partition p2 values in (21,22,23,24,25,26,27,28,29,30),
-partition p3 values in (31,32,33,34,35,36,37,38,39,40),
-partition p4 values in (41,42,43,44,45,46,47,48,49,50),
-partition p5 values in (51,52,53,54,55,56,57,58,59,60)
-);
-show create table t55;
-Table Create Table
-t55 CREATE TABLE `t55` (
- `colint` int(11) DEFAULT NULL,
- `col1` char(3) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (ord(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
-select * from t55 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-alter table t66
-reorganize partition s1 into
-(partition p0 values less than (ord('a')),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
-alter table t66
-reorganize partition s1 into
-(partition p0 values less than (ord('a')),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 8
-2 9
-3 3
-4 8
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with ord(col1)
--------------------------------------------------------------------------
-delete from t1 where col1='9';
-delete from t2 where col1='9';
-delete from t3 where col1='9';
-delete from t4 where col1='9';
-delete from t5 where col1='9';
-delete from t6 where col1='9';
-select * from t1 order by col1;
-col1
-8
-select * from t2 order by col1;
-col1
-3
-8
-select * from t3 order by col1;
-col1
-3
-8
-select * from t4 order by colint;
-colint col1
-1 8
-3 3
-4 8
-select * from t5 order by colint;
-colint col1
-1 8
-3 3
-4 8
-insert into t1 values ('9');
-insert into t2 values ('9');
-insert into t3 values ('9');
-insert into t4 values (60,'9');
-insert into t5 values (60,'9');
-insert into t6 values (60,'9');
-select * from t1 order by col1;
-col1
-8
-9
-select * from t2 order by col1;
-col1
-3
-8
-9
-select * from t3 order by col1;
-col1
-3
-8
-9
-select * from t4 order by colint;
-colint col1
-1 8
-3 3
-4 8
-60 9
-select * from t5 order by colint;
-colint col1
-1 8
-3 3
-4 8
-60 9
-select * from t6 order by colint;
-colint col1
-1 8
-3 3
-4 8
-60 9
-alter table t1 drop partition p0;
-alter table t2 drop partition p0;
-alter table t4 drop partition p0;
-alter table t5 drop partition p0;
-alter table t6 drop partition p0;
-select * from t1 order by col1;
-col1
-8
-9
-select * from t2 order by col1;
-col1
-3
-8
-9
-select * from t3 order by col1;
-col1
-3
-8
-9
-select * from t4 order by colint;
-colint col1
-60 9
-select * from t5 order by colint;
-colint col1
-60 9
-select * from t6 order by colint;
-colint col1
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with ord(col1)
--------------------------------------------------------------------------
-delete from t11 where col1='9';
-delete from t22 where col1='9';
-delete from t33 where col1='9';
-delete from t44 where col1='9';
-delete from t55 where col1='9';
-delete from t66 where col1='9';
-select * from t11 order by col1;
-col1
-8
-select * from t22 order by col1;
-col1
-3
-8
-select * from t33 order by col1;
-col1
-3
-8
-select * from t44 order by colint;
-colint col1
-1 8
-3 3
-4 8
-select * from t55 order by colint;
-colint col1
-1 8
-3 3
-4 8
-insert into t11 values ('9');
-insert into t22 values ('9');
-insert into t33 values ('9');
-insert into t44 values (60,'9');
-insert into t55 values (60,'9');
-insert into t66 values (60,'9');
-select * from t11 order by col1;
-col1
-8
-9
+15
+19
select * from t22 order by col1;
col1
-3
-8
-9
+15
+17
+19
select * from t33 order by col1;
col1
-3
-8
-9
+15
+17
+19
select * from t44 order by colint;
colint col1
-1 8
-3 3
-4 8
-60 9
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
+60 19
select * from t55 order by colint;
colint col1
-1 8
-3 3
-4 8
-60 9
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
+60 19
select * from t66 order by colint;
colint col1
-1 8
-3 3
-4 8
-60 9
+1 15
+2 13
+3 15
+4 17
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
+60 19
alter table t11 drop partition p0;
alter table t22 drop partition p0;
alter table t44 drop partition p0;
@@ -4133,26 +3234,129 @@ alter table t55 drop partition p0;
alter table t66 drop partition p0;
select * from t11 order by col1;
col1
-8
-9
select * from t22 order by col1;
col1
-3
-8
-9
select * from t33 order by col1;
col1
-3
-8
-9
+15
+17
+19
select * from t44 order by colint;
colint col1
-60 9
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
+60 19
select * from t55 order by colint;
colint col1
-60 9
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
+60 19
select * from t66 order by colint;
colint col1
+5 23
+6 34
+7 56
+8 56
+9 45
+10 34
+11 78
+12 89
+13 67
+14 46
+15 34
+16 324
+17 345
+18 34
+19 78
+20 567
+21 4
+22 435
+23 34
+24 45
+25 4565
+26 4
+27 3
+28 2
+29 3
+30 15
+31 6
+32 8
+33 9
+34 745
+35 34
+36 34
+37 324
+38 67
+39 78
+40 89
+41 90
+42 78967
+50 56
+51 34
+55 123
+60 19
-------------------------
---- some alter table end
-------------------------
@@ -4225,9 +3429,9 @@ insert into t2 values ('2006-01-25');
insert into t3 values ('2006-02-03');
insert into t3 values ('2006-01-17');
insert into t3 values ('2006-01-25');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select day(col1) from t1 order by col1;
day(col1)
17
@@ -4721,9 +3925,9 @@ insert into t2 values ('2006-01-25');
insert into t3 values ('2006-02-03');
insert into t3 values ('2006-01-17');
insert into t3 values ('2006-01-25');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select dayofmonth(col1) from t1 order by col1;
dayofmonth(col1)
17
@@ -5217,9 +4421,9 @@ insert into t2 values ('2006-01-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-02-17');
insert into t3 values ('2006-01-25');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select dayofweek(col1) from t1 order by col1;
dayofweek(col1)
3
@@ -5725,9 +4929,9 @@ insert into t2 values ('2006-02-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-01-17');
insert into t3 values ('2006-02-25');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select dayofyear(col1) from t1 order by col1;
dayofyear(col1)
3
@@ -6223,9 +5427,9 @@ insert into t2 values ('2006-02-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-01-17');
insert into t3 values ('2006-02-25');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select dayofyear(col1) from t1 order by col1;
dayofyear(col1)
3
@@ -6721,9 +5925,9 @@ insert into t2 values ('2006-01-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-02-17');
insert into t3 values ('2006-01-25');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select extract(month from col1) from t1 order by col1;
extract(month from col1)
1
@@ -7219,9 +6423,9 @@ insert into t2 values ('21:59');
insert into t3 values ('09:09');
insert into t3 values ('14:30');
insert into t3 values ('21:59');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select hour(col1) from t1 order by col1;
hour(col1)
9
@@ -7723,9 +6927,9 @@ insert into t2 values ('00:59:22.000024');
insert into t3 values ('09:09:15.000002');
insert into t3 values ('04:30:01.000018');
insert into t3 values ('00:59:22.000024');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select microsecond(col1) from t1 order by col1;
microsecond(col1)
0
@@ -8213,9 +7417,9 @@ insert into t2 values ('21:59:22');
insert into t3 values ('09:09:15');
insert into t3 values ('14:30:45');
insert into t3 values ('21:59:22');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select minute(col1) from t1 order by col1;
minute(col1)
9
@@ -8723,9 +7927,9 @@ insert into t2 values ('21:59:22');
insert into t3 values ('09:09:09');
insert into t3 values ('14:30:20');
insert into t3 values ('21:59:22');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select second(col1) from t1 order by col1;
second(col1)
9
@@ -9233,9 +8437,9 @@ insert into t2 values ('21:59:22');
insert into t3 values ('09:09:09');
insert into t3 values ('14:30:20');
insert into t3 values ('21:59:22');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select second(col1) from t1 order by col1;
second(col1)
9
@@ -9743,9 +8947,9 @@ insert into t2 values ('2006-05-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-12-17');
insert into t3 values ('2006-05-25');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select month(col1) from t1 order by col1;
month(col1)
1
@@ -10247,9 +9451,9 @@ insert into t2 values ('2006-09-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-12-17');
insert into t3 values ('2006-09-25');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select quarter(col1) from t1 order by col1;
quarter(col1)
1
@@ -10749,9 +9953,9 @@ insert into t2 values ('21:59:22');
insert into t3 values ('09:09:15');
insert into t3 values ('14:30:45');
insert into t3 values ('21:59:22');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
select time_to_sec(col1)-(time_to_sec(col1)-20) from t1 order by col1;
time_to_sec(col1)-(time_to_sec(col1)-20)
20
@@ -11257,9 +10461,9 @@ insert into t2 values ('2006-01-25');
insert into t3 values ('2006-02-03');
insert into t3 values ('2006-01-17');
insert into t3 values ('2006-01-25');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select to_days(col1)-to_days('2006-01-01') from t1 order by col1;
to_days(col1)-to_days('2006-01-01')
16
@@ -11701,7 +10905,7 @@ drop table if exists t44 ;
drop table if exists t55 ;
drop table if exists t66 ;
-------------------------------------------------------------------------
---- weekday(col1) in partition with coltype date
+--- datediff(col1, '2006-01-01') in partition with coltype date
-------------------------------------------------------------------------
drop table if exists t1 ;
drop table if exists t2 ;
@@ -11710,14 +10914,14 @@ drop table if exists t4 ;
drop table if exists t5 ;
drop table if exists t6 ;
-------------------------------------------------------------------------
---- Create tables with weekday(col1)
+--- Create tables with datediff(col1, '2006-01-01')
-------------------------------------------------------------------------
create table t1 (col1 date) engine='MYISAM'
-partition by range(weekday(col1))
+partition by range(datediff(col1, '2006-01-01'))
(partition p0 values less than (15),
partition p1 values less than maxvalue);
create table t2 (col1 date) engine='MYISAM'
-partition by list(weekday(col1))
+partition by list(datediff(col1, '2006-01-01'))
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -11726,15 +10930,15 @@ partition p4 values in (41,42,43,44,45,46,47,48,49,50),
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
);
create table t3 (col1 date) engine='MYISAM'
-partition by hash(weekday(col1));
+partition by hash(datediff(col1, '2006-01-01'));
create table t4 (colint int, col1 date) engine='MYISAM'
partition by range(colint)
-subpartition by hash(weekday(col1)) subpartitions 2
+subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than maxvalue);
create table t5 (colint int, col1 date) engine='MYISAM'
partition by list(colint)
-subpartition by hash(weekday(col1)) subpartitions 2
+subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -11744,40 +10948,40 @@ partition p5 values in (51,52,53,54,55,56,57,58,59,60)
);
create table t6 (colint int, col1 date) engine='MYISAM'
partition by range(colint)
-(partition p0 values less than (weekday('2006-10-14')),
+(partition p0 values less than (datediff('2006-02-02', '2006-01-01')),
partition p1 values less than maxvalue);
-------------------------------------------------------------------------
---- Access tables with weekday(col1)
+--- Access tables with datediff(col1, '2006-01-01')
-------------------------------------------------------------------------
-insert into t1 values ('2006-12-03');
-insert into t1 values ('2006-11-17');
-insert into t2 values ('2006-12-03');
-insert into t2 values ('2006-11-17');
-insert into t2 values ('2006-05-25');
-insert into t3 values ('2006-12-03');
-insert into t3 values ('2006-11-17');
-insert into t3 values ('2006-05-25');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6;
-select weekday(col1) from t1 order by col1;
-weekday(col1)
-4
-6
+insert into t1 values ('2006-02-03');
+insert into t1 values ('2006-01-17');
+insert into t2 values ('2006-02-03');
+insert into t2 values ('2006-01-17');
+insert into t2 values ('2006-01-25');
+insert into t3 values ('2006-02-03');
+insert into t3 values ('2006-01-17');
+insert into t3 values ('2006-01-25');
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+select datediff(col1, '2006-01-01') from t1 order by col1;
+datediff(col1, '2006-01-01')
+16
+33
select * from t1 order by col1;
col1
-2006-11-17
-2006-12-03
+2006-01-17
+2006-02-03
select * from t2 order by col1;
col1
-2006-05-25
-2006-11-17
-2006-12-03
+2006-01-17
+2006-01-25
+2006-02-03
select * from t3 order by col1;
col1
-2006-05-25
-2006-11-17
-2006-12-03
+2006-01-17
+2006-01-25
+2006-02-03
select * from t4 order by colint;
colint col1
1 2006-02-03
@@ -11796,46 +11000,46 @@ colint col1
2 2006-01-17
3 2006-01-25
4 2006-02-05
-update t1 set col1='2006-02-06' where col1='2006-12-03';
-update t2 set col1='2006-02-06' where col1='2006-12-03';
-update t3 set col1='2006-02-06' where col1='2006-12-03';
-update t4 set col1='2006-02-06' where col1='2006-12-03';
-update t5 set col1='2006-02-06' where col1='2006-12-03';
-update t6 set col1='2006-02-06' where col1='2006-12-03';
+update t1 set col1='2006-02-06' where col1='2006-02-03';
+update t2 set col1='2006-02-06' where col1='2006-02-03';
+update t3 set col1='2006-02-06' where col1='2006-02-03';
+update t4 set col1='2006-02-06' where col1='2006-02-03';
+update t5 set col1='2006-02-06' where col1='2006-02-03';
+update t6 set col1='2006-02-06' where col1='2006-02-03';
select * from t1 order by col1;
col1
+2006-01-17
2006-02-06
-2006-11-17
select * from t2 order by col1;
col1
+2006-01-17
+2006-01-25
2006-02-06
-2006-05-25
-2006-11-17
select * from t3 order by col1;
col1
+2006-01-17
+2006-01-25
2006-02-06
-2006-05-25
-2006-11-17
select * from t4 order by colint;
colint col1
-1 2006-02-03
+1 2006-02-06
2 2006-01-17
3 2006-01-25
4 2006-02-05
select * from t5 order by colint;
colint col1
-1 2006-02-03
+1 2006-02-06
2 2006-01-17
3 2006-01-25
4 2006-02-05
select * from t6 order by colint;
colint col1
-1 2006-02-03
+1 2006-02-06
2 2006-01-17
3 2006-01-25
4 2006-02-05
-------------------------------------------------------------------------
---- Alter tables with weekday(col1)
+--- Alter tables with datediff(col1, '2006-01-01')
-------------------------------------------------------------------------
drop table if exists t11 ;
drop table if exists t22 ;
@@ -11850,11 +11054,11 @@ create table t44 engine='MYISAM' as select * from t4;
create table t55 engine='MYISAM' as select * from t5;
create table t66 engine='MYISAM' as select * from t6;
alter table t11
-partition by range(weekday(col1))
+partition by range(datediff(col1, '2006-01-01'))
(partition p0 values less than (15),
partition p1 values less than maxvalue);
alter table t22
-partition by list(weekday(col1))
+partition by list(datediff(col1, '2006-01-01'))
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -11863,15 +11067,15 @@ partition p4 values in (41,42,43,44,45,46,47,48,49,50),
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
);
alter table t33
-partition by hash(weekday(col1));
+partition by hash(datediff(col1, '2006-01-01'));
alter table t44
partition by range(colint)
-subpartition by hash(weekday(col1)) subpartitions 2
+subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than maxvalue);
alter table t55
partition by list(colint)
-subpartition by hash(weekday(col1)) subpartitions 2
+subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -11881,37 +11085,37 @@ partition p5 values in (51,52,53,54,55,56,57,58,59,60)
);
alter table t66
partition by range(colint)
-(partition p0 values less than (weekday('2006-10-14')),
+(partition p0 values less than (datediff('2006-02-02', '2006-01-01')),
partition p1 values less than maxvalue);
select * from t11 order by col1;
col1
+2006-01-17
2006-02-06
-2006-11-17
select * from t22 order by col1;
col1
+2006-01-17
+2006-01-25
2006-02-06
-2006-05-25
-2006-11-17
select * from t33 order by col1;
col1
+2006-01-17
+2006-01-25
2006-02-06
-2006-05-25
-2006-11-17
select * from t44 order by colint;
colint col1
-1 2006-02-03
+1 2006-02-06
2 2006-01-17
3 2006-01-25
4 2006-02-05
select * from t55 order by colint;
colint col1
-1 2006-02-03
+1 2006-02-06
2 2006-01-17
3 2006-01-25
4 2006-02-05
select * from t66 order by colint;
colint col1
-1 2006-02-03
+1 2006-02-06
2 2006-01-17
3 2006-01-25
4 2006-02-05
@@ -11923,19 +11127,19 @@ reorganize partition p0,p1 into
(partition s1 values less than maxvalue);
select * from t11 order by col1;
col1
+2006-01-17
2006-02-06
-2006-11-17
alter table t11
reorganize partition s1 into
(partition p0 values less than (15),
partition p1 values less than maxvalue);
select * from t11 order by col1;
col1
+2006-01-17
2006-02-06
-2006-11-17
alter table t55
partition by list(colint)
-subpartition by hash(weekday(col1)) subpartitions 5
+subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 5
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -11948,10 +11152,10 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (weekday(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (datediff(col1, '2006-01-01')) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
select * from t55 order by colint;
colint col1
-1 2006-02-03
+1 2006-02-06
2 2006-01-17
3 2006-01-25
4 2006-02-05
@@ -11960,17 +11164,17 @@ reorganize partition p0,p1 into
(partition s1 values less than maxvalue);
select * from t66 order by colint;
colint col1
-1 2006-02-03
+1 2006-02-06
2 2006-01-17
3 2006-01-25
4 2006-02-05
alter table t66
reorganize partition s1 into
-(partition p0 values less than (weekday('2006-10-14')),
+(partition p0 values less than (datediff('2006-02-02', '2006-01-01')),
partition p1 values less than maxvalue);
select * from t66 order by colint;
colint col1
-1 2006-02-03
+1 2006-02-06
2 2006-01-17
3 2006-01-25
4 2006-02-05
@@ -11979,93 +11183,88 @@ reorganize partition p0,p1 into
(partition s1 values less than maxvalue);
select * from t66 order by colint;
colint col1
-1 2006-02-03
+1 2006-02-06
2 2006-01-17
3 2006-01-25
4 2006-02-05
alter table t66
reorganize partition s1 into
-(partition p0 values less than (weekday('2006-10-14')),
+(partition p0 values less than (datediff('2006-02-02', '2006-01-01')),
partition p1 values less than maxvalue);
select * from t66 order by colint;
colint col1
-1 2006-02-03
+1 2006-02-06
2 2006-01-17
3 2006-01-25
4 2006-02-05
-------------------------------------------------------------------------
---- Delete rows and partitions of tables with weekday(col1)
+--- Delete rows and partitions of tables with datediff(col1, '2006-01-01')
-------------------------------------------------------------------------
-delete from t1 where col1='2006-11-17';
-delete from t2 where col1='2006-11-17';
-delete from t3 where col1='2006-11-17';
-delete from t4 where col1='2006-11-17';
-delete from t5 where col1='2006-11-17';
-delete from t6 where col1='2006-11-17';
+delete from t1 where col1='2006-01-17';
+delete from t2 where col1='2006-01-17';
+delete from t3 where col1='2006-01-17';
+delete from t4 where col1='2006-01-17';
+delete from t5 where col1='2006-01-17';
+delete from t6 where col1='2006-01-17';
select * from t1 order by col1;
col1
2006-02-06
select * from t2 order by col1;
col1
+2006-01-25
2006-02-06
-2006-05-25
select * from t3 order by col1;
col1
+2006-01-25
2006-02-06
-2006-05-25
select * from t4 order by colint;
colint col1
-1 2006-02-03
-2 2006-01-17
+1 2006-02-06
3 2006-01-25
4 2006-02-05
select * from t5 order by colint;
colint col1
-1 2006-02-03
-2 2006-01-17
+1 2006-02-06
3 2006-01-25
4 2006-02-05
-insert into t1 values ('2006-11-17');
-insert into t2 values ('2006-11-17');
-insert into t3 values ('2006-11-17');
-insert into t4 values (60,'2006-11-17');
-insert into t5 values (60,'2006-11-17');
-insert into t6 values (60,'2006-11-17');
+insert into t1 values ('2006-01-17');
+insert into t2 values ('2006-01-17');
+insert into t3 values ('2006-01-17');
+insert into t4 values (60,'2006-01-17');
+insert into t5 values (60,'2006-01-17');
+insert into t6 values (60,'2006-01-17');
select * from t1 order by col1;
col1
+2006-01-17
2006-02-06
-2006-11-17
select * from t2 order by col1;
col1
+2006-01-17
+2006-01-25
2006-02-06
-2006-05-25
-2006-11-17
select * from t3 order by col1;
col1
+2006-01-17
+2006-01-25
2006-02-06
-2006-05-25
-2006-11-17
select * from t4 order by colint;
colint col1
-1 2006-02-03
-2 2006-01-17
+1 2006-02-06
3 2006-01-25
4 2006-02-05
-60 2006-11-17
+60 2006-01-17
select * from t5 order by colint;
colint col1
-1 2006-02-03
-2 2006-01-17
+1 2006-02-06
3 2006-01-25
4 2006-02-05
-60 2006-11-17
+60 2006-01-17
select * from t6 order by colint;
colint col1
-1 2006-02-03
-2 2006-01-17
+1 2006-02-06
3 2006-01-25
4 2006-02-05
-60 2006-11-17
+60 2006-01-17
alter table t1 drop partition p0;
alter table t2 drop partition p0;
alter table t4 drop partition p0;
@@ -12073,95 +11272,95 @@ alter table t5 drop partition p0;
alter table t6 drop partition p0;
select * from t1 order by col1;
col1
+2006-01-17
+2006-02-06
select * from t2 order by col1;
col1
+2006-01-17
+2006-01-25
+2006-02-06
select * from t3 order by col1;
col1
+2006-01-17
+2006-01-25
2006-02-06
-2006-05-25
-2006-11-17
select * from t4 order by colint;
colint col1
-60 2006-11-17
+60 2006-01-17
select * from t5 order by colint;
colint col1
-60 2006-11-17
+60 2006-01-17
select * from t6 order by colint;
colint col1
-60 2006-11-17
+60 2006-01-17
-------------------------------------------------------------------------
---- Delete rows and partitions of tables with weekday(col1)
+--- Delete rows and partitions of tables with datediff(col1, '2006-01-01')
-------------------------------------------------------------------------
-delete from t11 where col1='2006-11-17';
-delete from t22 where col1='2006-11-17';
-delete from t33 where col1='2006-11-17';
-delete from t44 where col1='2006-11-17';
-delete from t55 where col1='2006-11-17';
-delete from t66 where col1='2006-11-17';
+delete from t11 where col1='2006-01-17';
+delete from t22 where col1='2006-01-17';
+delete from t33 where col1='2006-01-17';
+delete from t44 where col1='2006-01-17';
+delete from t55 where col1='2006-01-17';
+delete from t66 where col1='2006-01-17';
select * from t11 order by col1;
col1
2006-02-06
select * from t22 order by col1;
col1
+2006-01-25
2006-02-06
-2006-05-25
select * from t33 order by col1;
col1
+2006-01-25
2006-02-06
-2006-05-25
select * from t44 order by colint;
colint col1
-1 2006-02-03
-2 2006-01-17
+1 2006-02-06
3 2006-01-25
4 2006-02-05
select * from t55 order by colint;
colint col1
-1 2006-02-03
-2 2006-01-17
+1 2006-02-06
3 2006-01-25
4 2006-02-05
-insert into t11 values ('2006-11-17');
-insert into t22 values ('2006-11-17');
-insert into t33 values ('2006-11-17');
-insert into t44 values (60,'2006-11-17');
-insert into t55 values (60,'2006-11-17');
-insert into t66 values (60,'2006-11-17');
+insert into t11 values ('2006-01-17');
+insert into t22 values ('2006-01-17');
+insert into t33 values ('2006-01-17');
+insert into t44 values (60,'2006-01-17');
+insert into t55 values (60,'2006-01-17');
+insert into t66 values (60,'2006-01-17');
select * from t11 order by col1;
col1
+2006-01-17
2006-02-06
-2006-11-17
select * from t22 order by col1;
col1
+2006-01-17
+2006-01-25
2006-02-06
-2006-05-25
-2006-11-17
select * from t33 order by col1;
col1
+2006-01-17
+2006-01-25
2006-02-06
-2006-05-25
-2006-11-17
select * from t44 order by colint;
colint col1
-1 2006-02-03
-2 2006-01-17
+1 2006-02-06
3 2006-01-25
4 2006-02-05
-60 2006-11-17
+60 2006-01-17
select * from t55 order by colint;
colint col1
-1 2006-02-03
-2 2006-01-17
+1 2006-02-06
3 2006-01-25
4 2006-02-05
-60 2006-11-17
+60 2006-01-17
select * from t66 order by colint;
colint col1
-1 2006-02-03
-2 2006-01-17
+1 2006-02-06
3 2006-01-25
4 2006-02-05
-60 2006-11-17
+60 2006-01-17
alter table t11 drop partition p0;
alter table t22 drop partition p0;
alter table t44 drop partition p0;
@@ -12169,22 +11368,27 @@ alter table t55 drop partition p0;
alter table t66 drop partition p0;
select * from t11 order by col1;
col1
+2006-01-17
+2006-02-06
select * from t22 order by col1;
col1
+2006-01-17
+2006-01-25
+2006-02-06
select * from t33 order by col1;
col1
+2006-01-17
+2006-01-25
2006-02-06
-2006-05-25
-2006-11-17
select * from t44 order by colint;
colint col1
-60 2006-11-17
+60 2006-01-17
select * from t55 order by colint;
colint col1
-60 2006-11-17
+60 2006-01-17
select * from t66 order by colint;
colint col1
-60 2006-11-17
+60 2006-01-17
-------------------------
---- some alter table end
-------------------------
@@ -12201,7 +11405,7 @@ drop table if exists t44 ;
drop table if exists t55 ;
drop table if exists t66 ;
-------------------------------------------------------------------------
---- weekofyear(col1) in partition with coltype date
+--- weekday(col1) in partition with coltype date
-------------------------------------------------------------------------
drop table if exists t1 ;
drop table if exists t2 ;
@@ -12210,14 +11414,14 @@ drop table if exists t4 ;
drop table if exists t5 ;
drop table if exists t6 ;
-------------------------------------------------------------------------
---- Create tables with weekofyear(col1)
+--- Create tables with weekday(col1)
-------------------------------------------------------------------------
create table t1 (col1 date) engine='MYISAM'
-partition by range(weekofyear(col1))
+partition by range(weekday(col1))
(partition p0 values less than (15),
partition p1 values less than maxvalue);
create table t2 (col1 date) engine='MYISAM'
-partition by list(weekofyear(col1))
+partition by list(weekday(col1))
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -12226,15 +11430,15 @@ partition p4 values in (41,42,43,44,45,46,47,48,49,50),
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
);
create table t3 (col1 date) engine='MYISAM'
-partition by hash(weekofyear(col1));
+partition by hash(weekday(col1));
create table t4 (colint int, col1 date) engine='MYISAM'
partition by range(colint)
-subpartition by hash(weekofyear(col1)) subpartitions 2
+subpartition by hash(weekday(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than maxvalue);
create table t5 (colint int, col1 date) engine='MYISAM'
partition by list(colint)
-subpartition by hash(weekofyear(col1)) subpartitions 2
+subpartition by hash(weekday(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -12244,40 +11448,40 @@ partition p5 values in (51,52,53,54,55,56,57,58,59,60)
);
create table t6 (colint int, col1 date) engine='MYISAM'
partition by range(colint)
-(partition p0 values less than (weekofyear('2006-02-14')),
+(partition p0 values less than (weekday('2006-10-14')),
partition p1 values less than maxvalue);
-------------------------------------------------------------------------
---- Access tables with weekofyear(col1)
+--- Access tables with weekday(col1)
-------------------------------------------------------------------------
-insert into t1 values ('2006-01-03');
-insert into t1 values ('2006-03-17');
-insert into t2 values ('2006-01-03');
-insert into t2 values ('2006-03-17');
+insert into t1 values ('2006-12-03');
+insert into t1 values ('2006-11-17');
+insert into t2 values ('2006-12-03');
+insert into t2 values ('2006-11-17');
insert into t2 values ('2006-05-25');
-insert into t3 values ('2006-01-03');
-insert into t3 values ('2006-03-17');
+insert into t3 values ('2006-12-03');
+insert into t3 values ('2006-11-17');
insert into t3 values ('2006-05-25');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6;
-select weekofyear(col1) from t1 order by col1;
-weekofyear(col1)
-1
-11
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
+select weekday(col1) from t1 order by col1;
+weekday(col1)
+4
+6
select * from t1 order by col1;
col1
-2006-01-03
-2006-03-17
+2006-11-17
+2006-12-03
select * from t2 order by col1;
col1
-2006-01-03
-2006-03-17
2006-05-25
+2006-11-17
+2006-12-03
select * from t3 order by col1;
col1
-2006-01-03
-2006-03-17
2006-05-25
+2006-11-17
+2006-12-03
select * from t4 order by colint;
colint col1
1 2006-02-03
@@ -12296,26 +11500,26 @@ colint col1
2 2006-01-17
3 2006-01-25
4 2006-02-05
-update t1 set col1='2006-09-06' where col1='2006-01-03';
-update t2 set col1='2006-09-06' where col1='2006-01-03';
-update t3 set col1='2006-09-06' where col1='2006-01-03';
-update t4 set col1='2006-09-06' where col1='2006-01-03';
-update t5 set col1='2006-09-06' where col1='2006-01-03';
-update t6 set col1='2006-09-06' where col1='2006-01-03';
+update t1 set col1='2006-02-06' where col1='2006-12-03';
+update t2 set col1='2006-02-06' where col1='2006-12-03';
+update t3 set col1='2006-02-06' where col1='2006-12-03';
+update t4 set col1='2006-02-06' where col1='2006-12-03';
+update t5 set col1='2006-02-06' where col1='2006-12-03';
+update t6 set col1='2006-02-06' where col1='2006-12-03';
select * from t1 order by col1;
col1
-2006-03-17
-2006-09-06
+2006-02-06
+2006-11-17
select * from t2 order by col1;
col1
-2006-03-17
+2006-02-06
2006-05-25
-2006-09-06
+2006-11-17
select * from t3 order by col1;
col1
-2006-03-17
+2006-02-06
2006-05-25
-2006-09-06
+2006-11-17
select * from t4 order by colint;
colint col1
1 2006-02-03
@@ -12335,7 +11539,7 @@ colint col1
3 2006-01-25
4 2006-02-05
-------------------------------------------------------------------------
---- Alter tables with weekofyear(col1)
+--- Alter tables with weekday(col1)
-------------------------------------------------------------------------
drop table if exists t11 ;
drop table if exists t22 ;
@@ -12350,11 +11554,11 @@ create table t44 engine='MYISAM' as select * from t4;
create table t55 engine='MYISAM' as select * from t5;
create table t66 engine='MYISAM' as select * from t6;
alter table t11
-partition by range(weekofyear(col1))
+partition by range(weekday(col1))
(partition p0 values less than (15),
partition p1 values less than maxvalue);
alter table t22
-partition by list(weekofyear(col1))
+partition by list(weekday(col1))
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -12363,15 +11567,15 @@ partition p4 values in (41,42,43,44,45,46,47,48,49,50),
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
);
alter table t33
-partition by hash(weekofyear(col1));
+partition by hash(weekday(col1));
alter table t44
partition by range(colint)
-subpartition by hash(weekofyear(col1)) subpartitions 2
+subpartition by hash(weekday(col1)) subpartitions 2
(partition p0 values less than (15),
partition p1 values less than maxvalue);
alter table t55
partition by list(colint)
-subpartition by hash(weekofyear(col1)) subpartitions 2
+subpartition by hash(weekday(col1)) subpartitions 2
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -12381,22 +11585,22 @@ partition p5 values in (51,52,53,54,55,56,57,58,59,60)
);
alter table t66
partition by range(colint)
-(partition p0 values less than (weekofyear('2006-02-14')),
+(partition p0 values less than (weekday('2006-10-14')),
partition p1 values less than maxvalue);
select * from t11 order by col1;
col1
-2006-03-17
-2006-09-06
+2006-02-06
+2006-11-17
select * from t22 order by col1;
col1
-2006-03-17
+2006-02-06
2006-05-25
-2006-09-06
+2006-11-17
select * from t33 order by col1;
col1
-2006-03-17
+2006-02-06
2006-05-25
-2006-09-06
+2006-11-17
select * from t44 order by colint;
colint col1
1 2006-02-03
@@ -12423,19 +11627,19 @@ reorganize partition p0,p1 into
(partition s1 values less than maxvalue);
select * from t11 order by col1;
col1
-2006-03-17
-2006-09-06
+2006-02-06
+2006-11-17
alter table t11
reorganize partition s1 into
(partition p0 values less than (15),
partition p1 values less than maxvalue);
select * from t11 order by col1;
col1
-2006-03-17
-2006-09-06
+2006-02-06
+2006-11-17
alter table t55
partition by list(colint)
-subpartition by hash(weekofyear(col1)) subpartitions 5
+subpartition by hash(weekday(col1)) subpartitions 5
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
@@ -12448,7 +11652,7 @@ Table Create Table
t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (weekofyear(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (weekday(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
select * from t55 order by colint;
colint col1
1 2006-02-03
@@ -12466,7 +11670,7 @@ colint col1
4 2006-02-05
alter table t66
reorganize partition s1 into
-(partition p0 values less than (weekofyear('2006-02-14')),
+(partition p0 values less than (weekday('2006-10-14')),
partition p1 values less than maxvalue);
select * from t66 order by colint;
colint col1
@@ -12485,7 +11689,7 @@ colint col1
4 2006-02-05
alter table t66
reorganize partition s1 into
-(partition p0 values less than (weekofyear('2006-02-14')),
+(partition p0 values less than (weekday('2006-10-14')),
partition p1 values less than maxvalue);
select * from t66 order by colint;
colint col1
@@ -12494,25 +11698,25 @@ colint col1
3 2006-01-25
4 2006-02-05
-------------------------------------------------------------------------
---- Delete rows and partitions of tables with weekofyear(col1)
+--- Delete rows and partitions of tables with weekday(col1)
-------------------------------------------------------------------------
-delete from t1 where col1='2006-03-17';
-delete from t2 where col1='2006-03-17';
-delete from t3 where col1='2006-03-17';
-delete from t4 where col1='2006-03-17';
-delete from t5 where col1='2006-03-17';
-delete from t6 where col1='2006-03-17';
+delete from t1 where col1='2006-11-17';
+delete from t2 where col1='2006-11-17';
+delete from t3 where col1='2006-11-17';
+delete from t4 where col1='2006-11-17';
+delete from t5 where col1='2006-11-17';
+delete from t6 where col1='2006-11-17';
select * from t1 order by col1;
col1
-2006-09-06
+2006-02-06
select * from t2 order by col1;
col1
+2006-02-06
2006-05-25
-2006-09-06
select * from t3 order by col1;
col1
+2006-02-06
2006-05-25
-2006-09-06
select * from t4 order by colint;
colint col1
1 2006-02-03
@@ -12525,47 +11729,47 @@ colint col1
2 2006-01-17
3 2006-01-25
4 2006-02-05
-insert into t1 values ('2006-03-17');
-insert into t2 values ('2006-03-17');
-insert into t3 values ('2006-03-17');
-insert into t4 values (60,'2006-03-17');
-insert into t5 values (60,'2006-03-17');
-insert into t6 values (60,'2006-03-17');
+insert into t1 values ('2006-11-17');
+insert into t2 values ('2006-11-17');
+insert into t3 values ('2006-11-17');
+insert into t4 values (60,'2006-11-17');
+insert into t5 values (60,'2006-11-17');
+insert into t6 values (60,'2006-11-17');
select * from t1 order by col1;
col1
-2006-03-17
-2006-09-06
+2006-02-06
+2006-11-17
select * from t2 order by col1;
col1
-2006-03-17
+2006-02-06
2006-05-25
-2006-09-06
+2006-11-17
select * from t3 order by col1;
col1
-2006-03-17
+2006-02-06
2006-05-25
-2006-09-06
+2006-11-17
select * from t4 order by colint;
colint col1
1 2006-02-03
2 2006-01-17
3 2006-01-25
4 2006-02-05
-60 2006-03-17
+60 2006-11-17
select * from t5 order by colint;
colint col1
1 2006-02-03
2 2006-01-17
3 2006-01-25
4 2006-02-05
-60 2006-03-17
+60 2006-11-17
select * from t6 order by colint;
colint col1
1 2006-02-03
2 2006-01-17
3 2006-01-25
4 2006-02-05
-60 2006-03-17
+60 2006-11-17
alter table t1 drop partition p0;
alter table t2 drop partition p0;
alter table t4 drop partition p0;
@@ -12573,46 +11777,42 @@ alter table t5 drop partition p0;
alter table t6 drop partition p0;
select * from t1 order by col1;
col1
-2006-09-06
select * from t2 order by col1;
col1
-2006-03-17
-2006-05-25
-2006-09-06
select * from t3 order by col1;
col1
-2006-03-17
+2006-02-06
2006-05-25
-2006-09-06
+2006-11-17
select * from t4 order by colint;
colint col1
-60 2006-03-17
+60 2006-11-17
select * from t5 order by colint;
colint col1
-60 2006-03-17
+60 2006-11-17
select * from t6 order by colint;
colint col1
-60 2006-03-17
+60 2006-11-17
-------------------------------------------------------------------------
---- Delete rows and partitions of tables with weekofyear(col1)
+--- Delete rows and partitions of tables with weekday(col1)
-------------------------------------------------------------------------
-delete from t11 where col1='2006-03-17';
-delete from t22 where col1='2006-03-17';
-delete from t33 where col1='2006-03-17';
-delete from t44 where col1='2006-03-17';
-delete from t55 where col1='2006-03-17';
-delete from t66 where col1='2006-03-17';
+delete from t11 where col1='2006-11-17';
+delete from t22 where col1='2006-11-17';
+delete from t33 where col1='2006-11-17';
+delete from t44 where col1='2006-11-17';
+delete from t55 where col1='2006-11-17';
+delete from t66 where col1='2006-11-17';
select * from t11 order by col1;
col1
-2006-09-06
+2006-02-06
select * from t22 order by col1;
col1
+2006-02-06
2006-05-25
-2006-09-06
select * from t33 order by col1;
col1
+2006-02-06
2006-05-25
-2006-09-06
select * from t44 order by colint;
colint col1
1 2006-02-03
@@ -12625,47 +11825,47 @@ colint col1
2 2006-01-17
3 2006-01-25
4 2006-02-05
-insert into t11 values ('2006-03-17');
-insert into t22 values ('2006-03-17');
-insert into t33 values ('2006-03-17');
-insert into t44 values (60,'2006-03-17');
-insert into t55 values (60,'2006-03-17');
-insert into t66 values (60,'2006-03-17');
+insert into t11 values ('2006-11-17');
+insert into t22 values ('2006-11-17');
+insert into t33 values ('2006-11-17');
+insert into t44 values (60,'2006-11-17');
+insert into t55 values (60,'2006-11-17');
+insert into t66 values (60,'2006-11-17');
select * from t11 order by col1;
col1
-2006-03-17
-2006-09-06
+2006-02-06
+2006-11-17
select * from t22 order by col1;
col1
-2006-03-17
+2006-02-06
2006-05-25
-2006-09-06
+2006-11-17
select * from t33 order by col1;
col1
-2006-03-17
+2006-02-06
2006-05-25
-2006-09-06
+2006-11-17
select * from t44 order by colint;
colint col1
1 2006-02-03
2 2006-01-17
3 2006-01-25
4 2006-02-05
-60 2006-03-17
+60 2006-11-17
select * from t55 order by colint;
colint col1
1 2006-02-03
2 2006-01-17
3 2006-01-25
4 2006-02-05
-60 2006-03-17
+60 2006-11-17
select * from t66 order by colint;
colint col1
1 2006-02-03
2 2006-01-17
3 2006-01-25
4 2006-02-05
-60 2006-03-17
+60 2006-11-17
alter table t11 drop partition p0;
alter table t22 drop partition p0;
alter table t44 drop partition p0;
@@ -12673,26 +11873,22 @@ alter table t55 drop partition p0;
alter table t66 drop partition p0;
select * from t11 order by col1;
col1
-2006-09-06
select * from t22 order by col1;
col1
-2006-03-17
-2006-05-25
-2006-09-06
select * from t33 order by col1;
col1
-2006-03-17
+2006-02-06
2006-05-25
-2006-09-06
+2006-11-17
select * from t44 order by colint;
colint col1
-60 2006-03-17
+60 2006-11-17
select * from t55 order by colint;
colint col1
-60 2006-03-17
+60 2006-11-17
select * from t66 order by colint;
colint col1
-60 2006-03-17
+60 2006-11-17
-------------------------
---- some alter table end
-------------------------
@@ -12765,9 +11961,9 @@ insert into t2 values ('2004-05-25');
insert into t3 values ('1996-01-03');
insert into t3 values ('2000-02-17');
insert into t3 values ('2004-05-25');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select year(col1)-1990 from t1 order by col1;
year(col1)-1990
6
@@ -13269,9 +12465,9 @@ insert into t2 values ('2006-03-25');
insert into t3 values ('2006-01-03');
insert into t3 values ('2006-08-17');
insert into t3 values ('2006-03-25');
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
+load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
select yearweek(col1)-200600 from t1 order by col1;
yearweek(col1)-200600
1
diff --git a/mysql-test/suite/parts/r/partition_alter3_innodb.result b/mysql-test/suite/parts/r/partition_alter3_innodb.result
index 25387301cdb..7228462c61d 100644
--- a/mysql-test/suite/parts/r/partition_alter3_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter3_innodb.result
@@ -64,7 +64,7 @@ t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.frm
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where
@@ -78,15 +78,15 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
ALTER TABLE t1 ADD PARTITION (PARTITION part2);
ERROR HY000: Partition management on a not partitioned table is not possible
# 1.1.2 Assign HASH partitioning
-ALTER TABLE t1 PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER));
+ALTER TABLE t1 PARTITION BY HASH(YEAR(f_date));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) */
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
@@ -95,51 +95,30 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
# check read row by row success: 1
# 1.1.3 Assign other HASH partitioning to already partitioned table
# + test and switch back + test
-ALTER TABLE t1 PARTITION BY HASH(CAST(f_varchar AS SIGNED INTEGER));
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '20 '
-Warning 1292 Truncated incorrect INTEGER value: '19 '
-Warning 1292 Truncated incorrect INTEGER value: '18 '
-Warning 1292 Truncated incorrect INTEGER value: '17 '
-Warning 1292 Truncated incorrect INTEGER value: '16 '
-Warning 1292 Truncated incorrect INTEGER value: '15 '
-Warning 1292 Truncated incorrect INTEGER value: '14 '
-Warning 1292 Truncated incorrect INTEGER value: '13 '
-Warning 1292 Truncated incorrect INTEGER value: '12 '
-Warning 1292 Truncated incorrect INTEGER value: '11 '
-Warning 1292 Truncated incorrect INTEGER value: '10 '
-Warning 1292 Truncated incorrect INTEGER value: '9 '
-Warning 1292 Truncated incorrect INTEGER value: '8 '
-Warning 1292 Truncated incorrect INTEGER value: '7 '
-Warning 1292 Truncated incorrect INTEGER value: '6 '
-Warning 1292 Truncated incorrect INTEGER value: '5 '
-Warning 1292 Truncated incorrect INTEGER value: '4 '
-Warning 1292 Truncated incorrect INTEGER value: '3 '
-Warning 1292 Truncated incorrect INTEGER value: '2 '
-Warning 1292 Truncated incorrect INTEGER value: '1 '
+ALTER TABLE t1 PARTITION BY HASH(DAYOFYEAR(f_date));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(f_varchar AS SIGNED INTEGER)) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (DAYOFYEAR(f_date)) */
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
-ALTER TABLE t1 PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER));
+ALTER TABLE t1 PARTITION BY HASH(YEAR(f_date));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) */
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
@@ -158,9 +137,9 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB) */
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 7 Using where
@@ -177,9 +156,9 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where
@@ -193,9 +172,9 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, PARTITION p6 ENGINE = InnoDB, PARTITION p7 ENGINE = InnoDB) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, PARTITION p6 ENGINE = InnoDB, PARTITION p7 ENGINE = InnoDB) */
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 3 Using where
@@ -221,9 +200,9 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, PARTITION p6 ENGINE = InnoDB) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, PARTITION p6 ENGINE = InnoDB) */
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 3 Using where
@@ -236,9 +215,9 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB) */
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 4 Using where
@@ -251,9 +230,9 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB) */
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
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
@@ -266,9 +245,9 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where
@@ -281,9 +260,9 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB) */
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 7 Using where
@@ -296,9 +275,9 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB) */
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 10 Using where
@@ -311,9 +290,9 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB) */
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
@@ -331,7 +310,7 @@ t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.frm
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where
@@ -370,7 +349,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.frm
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where
@@ -392,8 +371,8 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
@@ -416,8 +395,8 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 7 Using where
@@ -435,8 +414,8 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 5 Using where
@@ -454,8 +433,8 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, PARTITION p6 ENGINE = InnoDB, PARTITION p7 ENGINE = InnoDB) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 3 Using where
@@ -480,8 +459,8 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, PARTITION p6 ENGINE = InnoDB) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
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
@@ -498,8 +477,8 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 3 Using where
@@ -516,8 +495,8 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 10 Using where
@@ -534,8 +513,8 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 5 Using where
@@ -552,8 +531,8 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 7 Using where
@@ -570,8 +549,8 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 10 Using where
@@ -588,8 +567,8 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
@@ -610,7 +589,7 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.frm
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where
diff --git a/mysql-test/suite/parts/r/partition_alter3_myisam.result b/mysql-test/suite/parts/r/partition_alter3_myisam.result
index f320dd69dd7..c24858aa2ca 100644
--- a/mysql-test/suite/parts/r/partition_alter3_myisam.result
+++ b/mysql-test/suite/parts/r/partition_alter3_myisam.result
@@ -64,9 +64,9 @@ t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.MYD
+MYSQLTEST_VARDIR/master-data/test/t1.MYI
+MYSQLTEST_VARDIR/master-data/test/t1.frm
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where
@@ -80,17 +80,17 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
ALTER TABLE t1 ADD PARTITION (PARTITION part2);
ERROR HY000: Partition management on a not partitioned table is not possible
# 1.1.2 Assign HASH partitioning
-ALTER TABLE t1 PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER));
+ALTER TABLE t1 PARTITION BY HASH(YEAR(f_date));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) */
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
@@ -99,55 +99,34 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
# check read row by row success: 1
# 1.1.3 Assign other HASH partitioning to already partitioned table
# + test and switch back + test
-ALTER TABLE t1 PARTITION BY HASH(CAST(f_varchar AS SIGNED INTEGER));
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '20'
-Warning 1292 Truncated incorrect INTEGER value: '19'
-Warning 1292 Truncated incorrect INTEGER value: '18'
-Warning 1292 Truncated incorrect INTEGER value: '17'
-Warning 1292 Truncated incorrect INTEGER value: '16'
-Warning 1292 Truncated incorrect INTEGER value: '15'
-Warning 1292 Truncated incorrect INTEGER value: '14'
-Warning 1292 Truncated incorrect INTEGER value: '13'
-Warning 1292 Truncated incorrect INTEGER value: '12'
-Warning 1292 Truncated incorrect INTEGER value: '11'
-Warning 1292 Truncated incorrect INTEGER value: '10'
-Warning 1292 Truncated incorrect INTEGER value: '90'
-Warning 1292 Truncated incorrect INTEGER value: '80'
-Warning 1292 Truncated incorrect INTEGER value: '70'
-Warning 1292 Truncated incorrect INTEGER value: '60'
-Warning 1292 Truncated incorrect INTEGER value: '50'
-Warning 1292 Truncated incorrect INTEGER value: '40'
-Warning 1292 Truncated incorrect INTEGER value: '30'
-Warning 1292 Truncated incorrect INTEGER value: '20'
-Warning 1292 Truncated incorrect INTEGER value: '10'
+ALTER TABLE t1 PARTITION BY HASH(DAYOFYEAR(f_date));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(f_varchar AS SIGNED INTEGER)) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (DAYOFYEAR(f_date)) */
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
-ALTER TABLE t1 PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER));
+ALTER TABLE t1 PARTITION BY HASH(YEAR(f_date));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) */
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
@@ -166,15 +145,15 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM) */
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 7 Using where
@@ -191,17 +170,17 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where
@@ -215,25 +194,25 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, PARTITION p6 ENGINE = MyISAM, PARTITION p7 ENGINE = MyISAM) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p6.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p6.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p7.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p7.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, PARTITION p6 ENGINE = MyISAM, PARTITION p7 ENGINE = MyISAM) */
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#p6.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p6.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#p7.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p7.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 3 Using where
@@ -259,23 +238,23 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, PARTITION p6 ENGINE = MyISAM) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p6.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p6.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, PARTITION p6 ENGINE = MyISAM) */
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#p6.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p6.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 3 Using where
@@ -288,21 +267,21 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM) */
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 4 Using where
@@ -315,19 +294,19 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM) */
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
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
@@ -340,17 +319,17 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where
@@ -363,15 +342,15 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM) */
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 7 Using where
@@ -384,13 +363,13 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM) */
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 10 Using where
@@ -403,11 +382,11 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM) */
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
@@ -425,9 +404,9 @@ t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.MYD
+MYSQLTEST_VARDIR/master-data/test/t1.MYI
+MYSQLTEST_VARDIR/master-data/test/t1.frm
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where
@@ -460,9 +439,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.MYD
+MYSQLTEST_VARDIR/master-data/test/t1.MYI
+MYSQLTEST_VARDIR/master-data/test/t1.frm
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where
@@ -484,10 +463,10 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
@@ -510,14 +489,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 7 Using where
@@ -535,16 +514,16 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 5 Using where
@@ -562,24 +541,24 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, PARTITION p6 ENGINE = MyISAM, PARTITION p7 ENGINE = MyISAM) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p6.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p6.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p7.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p7.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#p6.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p6.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#p7.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p7.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 3 Using where
@@ -604,22 +583,22 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, PARTITION p6 ENGINE = MyISAM) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p6.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p6.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#p6.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p6.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
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
@@ -636,20 +615,20 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 3 Using where
@@ -666,18 +645,18 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 10 Using where
@@ -694,16 +673,16 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 5 Using where
@@ -720,14 +699,14 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 7 Using where
@@ -744,12 +723,12 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 10 Using where
@@ -766,10 +745,10 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM) */
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
+MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
+MYSQLTEST_VARDIR/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
@@ -790,9 +769,9 @@ t1 CREATE TABLE `t1` (
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.MYD
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.MYI
-/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm
+MYSQLTEST_VARDIR/master-data/test/t1.MYD
+MYSQLTEST_VARDIR/master-data/test/t1.MYI
+MYSQLTEST_VARDIR/master-data/test/t1.frm
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where
diff --git a/mysql-test/suite/parts/r/partition_basic_innodb.result b/mysql-test/suite/parts/r/partition_basic_innodb.result
index f9ae10caf18..dc875980678 100644
--- a/mysql-test/suite/parts/r/partition_basic_innodb.result
+++ b/mysql-test/suite/parts/r/partition_basic_innodb.result
@@ -59,15 +59,6 @@ SET @@session.sql_mode= '';
#------------------------------------------------------------------------
# 1.1 The partitioning function contains one column.
DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY HASH(f_int1) PARTITIONS 2;
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -513,6 +504,8 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
create_command
SHOW CREATE TABLE t1;
@@ -956,6 +949,8 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
create_command
SHOW CREATE TABLE t1;
@@ -1399,52 +1394,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-SET @aux = 'PARTITION BY RANGE(f_int1)
-(PARTITION parta VALUES LESS THAN (0)
-
-,
-PARTITION partb VALUES LESS THAN (5)
-
-,
-PARTITION partc VALUES LESS THAN (10)
-
-,
-PARTITION partd VALUES LESS THAN (10 + 5)
-
-,
-PARTITION parte VALUES LESS THAN (20)
-
-,
-PARTITION partf VALUES LESS THAN (2147483646)
-
-)';
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY RANGE(f_int1)
-(PARTITION parta VALUES LESS THAN (0)
-
-,
-PARTITION partb VALUES LESS THAN (5)
-
-,
-PARTITION partc VALUES LESS THAN (10)
-
-,
-PARTITION partd VALUES LESS THAN (10 + 5)
-
-,
-PARTITION parte VALUES LESS THAN (20)
-
-,
-PARTITION partf VALUES LESS THAN (2147483646)
-
-);
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -1888,27 +1837,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
-(PARTITION parta VALUES LESS THAN (0)
-
-,
-PARTITION partb VALUES LESS THAN (5)
-
-,
-PARTITION partc VALUES LESS THAN (10)
-
-,
-PARTITION partd VALUES LESS THAN (2147483646)
-
-);
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -2354,31 +2282,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(PARTITION part1 VALUES LESS THAN (0)
-
-
-(SUBPARTITION subpart11, SUBPARTITION subpart12),
-PARTITION part2 VALUES LESS THAN (5)
-
-
-(SUBPARTITION subpart21, SUBPARTITION subpart22),
-PARTITION part3 VALUES LESS THAN (10)
-
-
-(SUBPARTITION subpart31, SUBPARTITION subpart32),
-PARTITION part4 VALUES LESS THAN (2147483646)
-
-
-(SUBPARTITION subpart41, SUBPARTITION subpart42));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -2822,47 +2725,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1)
-(PARTITION part1 VALUES IN (0)
-
-
- (SUBPARTITION sp11
-
- ,
- SUBPARTITION sp12
-
- ),
- PARTITION part2 VALUES IN (1)
-
-
- (SUBPARTITION sp21
-
- ,
- SUBPARTITION sp22
-
- ),
- PARTITION part3 VALUES IN (2)
-
-
- (SUBPARTITION sp31,
- SUBPARTITION sp32),
- PARTITION part4 VALUES IN (NULL)
-
-
- (SUBPARTITION sp41
-
- ,
- SUBPARTITION sp42
-
- ));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -3308,25 +3170,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3
-(PARTITION part1 VALUES IN (0)
-
- ,
- PARTITION part2 VALUES IN (1)
-
- ,
- PARTITION part3 VALUES IN (NULL)
-
- );
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -3773,25 +3616,6 @@ DROP TABLE t1;
unified filelist
--- not determined ---
# 1.1.1 with DATA DIECTORY/INDEX DIRECTORY
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY HASH(f_int1) PARTITIONS 2
-(PARTITION p1
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION p2
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index');
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -3804,7 +3628,7 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -4237,40 +4061,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY HASH(f_int1) PARTITIONS 5
-(PARTITION p1
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION p2
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION p3
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION p4
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION p5
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index');
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -4283,7 +4073,7 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION p3 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION p4 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION p5 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -4716,6 +4506,8 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
create_command
SHOW CREATE TABLE t1;
@@ -4726,7 +4518,7 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -5159,76 +4951,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-SET @aux = 'PARTITION BY RANGE(f_int1)
-(PARTITION parta VALUES LESS THAN (0)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION partb VALUES LESS THAN (5)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION partc VALUES LESS THAN (10)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION partd VALUES LESS THAN (10 + 5)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION parte VALUES LESS THAN (20)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION partf VALUES LESS THAN (2147483646)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'')';
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY RANGE(f_int1)
-(PARTITION parta VALUES LESS THAN (0)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partb VALUES LESS THAN (5)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partc VALUES LESS THAN (10)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partd VALUES LESS THAN (10 + 5)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION parte VALUES LESS THAN (20)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partf VALUES LESS THAN (2147483646)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index');
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -5241,7 +4963,7 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -5672,35 +5394,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
-(PARTITION parta VALUES LESS THAN (0)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partb VALUES LESS THAN (5)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partc VALUES LESS THAN (10)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partd VALUES LESS THAN (2147483646)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index');
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -5713,7 +5406,7 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -6146,39 +5839,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(PARTITION part1 VALUES LESS THAN (0)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
-(SUBPARTITION subpart11, SUBPARTITION subpart12),
-PARTITION part2 VALUES LESS THAN (5)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
-(SUBPARTITION subpart21, SUBPARTITION subpart22),
-PARTITION part3 VALUES LESS THAN (10)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
-(SUBPARTITION subpart31, SUBPARTITION subpart32),
-PARTITION part4 VALUES LESS THAN (2147483646)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
-(SUBPARTITION subpart41, SUBPARTITION subpart42));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -6191,7 +5851,7 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -6622,67 +6282,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1)
-(PARTITION part1 VALUES IN (0)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
- (SUBPARTITION sp11
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- SUBPARTITION sp12
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'),
- PARTITION part2 VALUES IN (1)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
- (SUBPARTITION sp21
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- SUBPARTITION sp22
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'),
- PARTITION part3 VALUES IN (2)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
- (SUBPARTITION sp31,
- SUBPARTITION sp32),
- PARTITION part4 VALUES IN (NULL)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
- (SUBPARTITION sp41
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- SUBPARTITION sp42
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -6695,7 +6294,7 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -7128,31 +6727,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3
-(PARTITION part1 VALUES IN (0)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- PARTITION part2 VALUES IN (1)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- PARTITION part3 VALUES IN (NULL)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index');
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -7165,7 +6739,7 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -7599,15 +7173,6 @@ DROP TABLE t1;
unified filelist
--- not determined ---
DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY HASH(f_int1) PARTITIONS 2;
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -8053,6 +7618,8 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
create_command
SHOW CREATE TABLE t1;
@@ -8496,6 +8063,8 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
create_command
SHOW CREATE TABLE t1;
@@ -8506,7 +8075,7 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -8939,52 +8508,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-SET @aux = 'PARTITION BY RANGE(f_int1)
-(PARTITION parta VALUES LESS THAN (0)
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION partb VALUES LESS THAN (5)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'',
-PARTITION partc VALUES LESS THAN (10)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION partd VALUES LESS THAN (10 + 5),
-PARTITION parte VALUES LESS THAN (20)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'',
-PARTITION partf VALUES LESS THAN (2147483646)
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'')';
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY RANGE(f_int1)
-(PARTITION parta VALUES LESS THAN (0)
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partb VALUES LESS THAN (5)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data',
-PARTITION partc VALUES LESS THAN (10)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partd VALUES LESS THAN (10 + 5),
-PARTITION parte VALUES LESS THAN (20)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data',
-PARTITION partf VALUES LESS THAN (2147483646)
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index');
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -8997,7 +8520,7 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -9428,27 +8951,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
-(PARTITION parta VALUES LESS THAN (0)
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partb VALUES LESS THAN (5)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data',
-PARTITION partc VALUES LESS THAN (10),
-PARTITION partd VALUES LESS THAN (2147483646)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index');
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -9461,7 +8963,7 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -9894,31 +9396,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(PARTITION part1 VALUES LESS THAN (0)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-(SUBPARTITION subpart11, SUBPARTITION subpart12),
-PARTITION part2 VALUES LESS THAN (5)
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
-(SUBPARTITION subpart21, SUBPARTITION subpart22),
-PARTITION part3 VALUES LESS THAN (10)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
-(SUBPARTITION subpart31, SUBPARTITION subpart32),
-PARTITION part4 VALUES LESS THAN (2147483646)
-(SUBPARTITION subpart41, SUBPARTITION subpart42));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -9931,7 +9408,7 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart22 INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart22 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -10362,51 +9839,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1)
-(PARTITION part1 VALUES IN (0)
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
- (SUBPARTITION sp11
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data',
- SUBPARTITION sp12
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'),
- PARTITION part2 VALUES IN (1)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- (SUBPARTITION sp21
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data',
- SUBPARTITION sp22
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'),
- PARTITION part3 VALUES IN (2)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
- (SUBPARTITION sp31,
- SUBPARTITION sp32),
- PARTITION part4 VALUES IN (NULL)
- (SUBPARTITION sp41
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- SUBPARTITION sp42
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -10419,7 +9851,7 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp12 INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp12 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -14476,15 +13908,6 @@ DROP TABLE t1;
#------------------------------------------------------------------------
# 2.5 PRIMARY KEY + UNIQUE INDEX consisting of two columns
DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2), PRIMARY KEY(f_int2,f_int1)
-)
-PARTITION BY HASH(f_int1) PARTITIONS 2;
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -14967,6 +14390,8 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
create_command
SHOW CREATE TABLE t1;
@@ -15447,6 +14872,8 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
create_command
SHOW CREATE TABLE t1;
@@ -15459,7 +14886,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -15927,76 +15354,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-SET @aux = 'PARTITION BY RANGE(f_int1)
-(PARTITION parta VALUES LESS THAN (0)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION partb VALUES LESS THAN (5)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION partc VALUES LESS THAN (10)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION partd VALUES LESS THAN (10 + 5)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION parte VALUES LESS THAN (20)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION partf VALUES LESS THAN (2147483646)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'')';
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2), PRIMARY KEY(f_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1)
-(PARTITION parta VALUES LESS THAN (0)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partb VALUES LESS THAN (5)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partc VALUES LESS THAN (10)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partd VALUES LESS THAN (10 + 5)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION parte VALUES LESS THAN (20)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partf VALUES LESS THAN (2147483646)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index');
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -16011,7 +15368,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -16477,35 +15834,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2), PRIMARY KEY(f_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
-(PARTITION parta VALUES LESS THAN (0)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partb VALUES LESS THAN (5)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partc VALUES LESS THAN (10)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partd VALUES LESS THAN (2147483646)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index');
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -16520,7 +15848,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -16988,39 +16316,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2), PRIMARY KEY(f_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(PARTITION part1 VALUES LESS THAN (0)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
-(SUBPARTITION subpart11, SUBPARTITION subpart12),
-PARTITION part2 VALUES LESS THAN (5)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
-(SUBPARTITION subpart21, SUBPARTITION subpart22),
-PARTITION part3 VALUES LESS THAN (10)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
-(SUBPARTITION subpart31, SUBPARTITION subpart32),
-PARTITION part4 VALUES LESS THAN (2147483646)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
-(SUBPARTITION subpart41, SUBPARTITION subpart42));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -17035,7 +16330,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -17501,67 +16796,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2), PRIMARY KEY(f_int2,f_int1)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1)
-(PARTITION part1 VALUES IN (0)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
- (SUBPARTITION sp11
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- SUBPARTITION sp12
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'),
- PARTITION part2 VALUES IN (1)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
- (SUBPARTITION sp21
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- SUBPARTITION sp22
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'),
- PARTITION part3 VALUES IN (2)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
- (SUBPARTITION sp31,
- SUBPARTITION sp32),
- PARTITION part4 VALUES IN (NULL)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
- (SUBPARTITION sp41
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- SUBPARTITION sp42
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -17576,7 +16810,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -18044,31 +17278,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2), PRIMARY KEY(f_int2,f_int1)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3
-(PARTITION part1 VALUES IN (0)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- PARTITION part2 VALUES IN (1)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- PARTITION part3 VALUES IN (NULL)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index');
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -18083,7 +17292,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int2`,`f_int1`),
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -18552,15 +17761,6 @@ DROP TABLE t1;
unified filelist
--- not determined ---
DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int2,f_int1), PRIMARY KEY(f_int1,f_int2)
-)
-PARTITION BY HASH(f_int1) PARTITIONS 2;
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -19043,6 +18243,8 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
create_command
SHOW CREATE TABLE t1;
@@ -19523,6 +18725,8 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
create_command
SHOW CREATE TABLE t1;
@@ -19535,7 +18739,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -20003,76 +19207,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-SET @aux = 'PARTITION BY RANGE(f_int1)
-(PARTITION parta VALUES LESS THAN (0)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION partb VALUES LESS THAN (5)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION partc VALUES LESS THAN (10)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION partd VALUES LESS THAN (10 + 5)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION parte VALUES LESS THAN (20)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION partf VALUES LESS THAN (2147483646)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'')';
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int2,f_int1), PRIMARY KEY(f_int1,f_int2)
-)
-PARTITION BY RANGE(f_int1)
-(PARTITION parta VALUES LESS THAN (0)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partb VALUES LESS THAN (5)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partc VALUES LESS THAN (10)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partd VALUES LESS THAN (10 + 5)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION parte VALUES LESS THAN (20)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partf VALUES LESS THAN (2147483646)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index');
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -20087,7 +19221,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -20553,35 +19687,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int2,f_int1), PRIMARY KEY(f_int1,f_int2)
-)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
-(PARTITION parta VALUES LESS THAN (0)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partb VALUES LESS THAN (5)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partc VALUES LESS THAN (10)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partd VALUES LESS THAN (2147483646)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index');
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -20596,7 +19701,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -21064,39 +20169,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int2,f_int1), PRIMARY KEY(f_int1,f_int2)
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(PARTITION part1 VALUES LESS THAN (0)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
-(SUBPARTITION subpart11, SUBPARTITION subpart12),
-PARTITION part2 VALUES LESS THAN (5)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
-(SUBPARTITION subpart21, SUBPARTITION subpart22),
-PARTITION part3 VALUES LESS THAN (10)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
-(SUBPARTITION subpart31, SUBPARTITION subpart32),
-PARTITION part4 VALUES LESS THAN (2147483646)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
-(SUBPARTITION subpart41, SUBPARTITION subpart42));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -21111,7 +20183,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -21577,67 +20649,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int2,f_int1), PRIMARY KEY(f_int1,f_int2)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1)
-(PARTITION part1 VALUES IN (0)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
- (SUBPARTITION sp11
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- SUBPARTITION sp12
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'),
- PARTITION part2 VALUES IN (1)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
- (SUBPARTITION sp21
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- SUBPARTITION sp22
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'),
- PARTITION part3 VALUES IN (2)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
- (SUBPARTITION sp31,
- SUBPARTITION sp32),
- PARTITION part4 VALUES IN (NULL)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
- (SUBPARTITION sp41
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- SUBPARTITION sp42
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -21652,7 +20663,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -22120,31 +21131,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int2,f_int1), PRIMARY KEY(f_int1,f_int2)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3
-(PARTITION part1 VALUES IN (0)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- PARTITION part2 VALUES IN (1)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- PARTITION part3 VALUES IN (NULL)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index');
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -22159,7 +21145,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`f_int1`,`f_int2`),
UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -22628,15 +21614,6 @@ DROP TABLE t1;
unified filelist
--- not determined ---
DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1)
-)
-PARTITION BY HASH(f_int1) PARTITIONS 2;
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -23135,6 +22112,8 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
create_command
SHOW CREATE TABLE t1;
@@ -23631,6 +22610,8 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
create_command
SHOW CREATE TABLE t1;
@@ -23643,7 +22624,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -24127,76 +23108,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-SET @aux = 'PARTITION BY RANGE(f_int1)
-(PARTITION parta VALUES LESS THAN (0)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION partb VALUES LESS THAN (5)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION partc VALUES LESS THAN (10)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION partd VALUES LESS THAN (10 + 5)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION parte VALUES LESS THAN (20)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION partf VALUES LESS THAN (2147483646)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'')';
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1)
-(PARTITION parta VALUES LESS THAN (0)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partb VALUES LESS THAN (5)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partc VALUES LESS THAN (10)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partd VALUES LESS THAN (10 + 5)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION parte VALUES LESS THAN (20)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partf VALUES LESS THAN (2147483646)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index');
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -24211,7 +23122,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -24693,35 +23604,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
-(PARTITION parta VALUES LESS THAN (0)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partb VALUES LESS THAN (5)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partc VALUES LESS THAN (10)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partd VALUES LESS THAN (2147483646)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index');
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -24736,7 +23618,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -25220,39 +24102,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(PARTITION part1 VALUES LESS THAN (0)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
-(SUBPARTITION subpart11, SUBPARTITION subpart12),
-PARTITION part2 VALUES LESS THAN (5)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
-(SUBPARTITION subpart21, SUBPARTITION subpart22),
-PARTITION part3 VALUES LESS THAN (10)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
-(SUBPARTITION subpart31, SUBPARTITION subpart32),
-PARTITION part4 VALUES LESS THAN (2147483646)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
-(SUBPARTITION subpart41, SUBPARTITION subpart42));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -25267,7 +24116,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -25749,67 +24598,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1)
-(PARTITION part1 VALUES IN (0)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
- (SUBPARTITION sp11
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- SUBPARTITION sp12
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'),
- PARTITION part2 VALUES IN (1)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
- (SUBPARTITION sp21
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- SUBPARTITION sp22
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'),
- PARTITION part3 VALUES IN (2)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
- (SUBPARTITION sp31,
- SUBPARTITION sp32),
- PARTITION part4 VALUES IN (NULL)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
- (SUBPARTITION sp41
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- SUBPARTITION sp42
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -25824,7 +24612,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB)) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB)) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
@@ -26308,31 +25096,6 @@ DROP TABLE t1;
# We found:
unified filelist
--- not determined ---
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3
-(PARTITION part1 VALUES IN (0)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- PARTITION part2 VALUES IN (1)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- PARTITION part3 VALUES IN (NULL)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index');
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -26347,7 +25110,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */
# check prerequisites-1 success: 1
# check COUNT(*) success: 1
diff --git a/mysql-test/suite/parts/r/partition_basic_myisam.result b/mysql-test/suite/parts/r/partition_basic_myisam.result
index 3a4a1c0d571..471eb4973f6 100644
--- a/mysql-test/suite/parts/r/partition_basic_myisam.result
+++ b/mysql-test/suite/parts/r/partition_basic_myisam.result
@@ -59,15 +59,6 @@ SET @@session.sql_mode= '';
#------------------------------------------------------------------------
# 1.1 The partitioning function contains one column.
DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY HASH(f_int1) PARTITIONS 2;
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -517,6 +508,8 @@ TRUNCATE t1;
# check layout success: 1
# End usability test (include/partition_check.inc)
DROP TABLE t1;
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
create_command
SHOW CREATE TABLE t1;
@@ -970,6 +963,8 @@ TRUNCATE t1;
# check layout success: 1
# End usability test (include/partition_check.inc)
DROP TABLE t1;
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
create_command
SHOW CREATE TABLE t1;
@@ -1429,52 +1424,6 @@ TRUNCATE t1;
# check layout success: 1
# End usability test (include/partition_check.inc)
DROP TABLE t1;
-SET @aux = 'PARTITION BY RANGE(f_int1)
-(PARTITION parta VALUES LESS THAN (0)
-
-,
-PARTITION partb VALUES LESS THAN (5)
-
-,
-PARTITION partc VALUES LESS THAN (10)
-
-,
-PARTITION partd VALUES LESS THAN (10 + 5)
-
-,
-PARTITION parte VALUES LESS THAN (20)
-
-,
-PARTITION partf VALUES LESS THAN (2147483646)
-
-)';
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY RANGE(f_int1)
-(PARTITION parta VALUES LESS THAN (0)
-
-,
-PARTITION partb VALUES LESS THAN (5)
-
-,
-PARTITION partc VALUES LESS THAN (10)
-
-,
-PARTITION partd VALUES LESS THAN (10 + 5)
-
-,
-PARTITION parte VALUES LESS THAN (20)
-
-,
-PARTITION partf VALUES LESS THAN (2147483646)
-
-);
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -1930,27 +1879,6 @@ TRUNCATE t1;
# check layout success: 1
# End usability test (include/partition_check.inc)
DROP TABLE t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
-(PARTITION parta VALUES LESS THAN (0)
-
-,
-PARTITION partb VALUES LESS THAN (5)
-
-,
-PARTITION partc VALUES LESS THAN (10)
-
-,
-PARTITION partd VALUES LESS THAN (2147483646)
-
-);
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -2412,31 +2340,6 @@ TRUNCATE t1;
# check layout success: 1
# End usability test (include/partition_check.inc)
DROP TABLE t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(PARTITION part1 VALUES LESS THAN (0)
-
-
-(SUBPARTITION subpart11, SUBPARTITION subpart12),
-PARTITION part2 VALUES LESS THAN (5)
-
-
-(SUBPARTITION subpart21, SUBPARTITION subpart22),
-PARTITION part3 VALUES LESS THAN (10)
-
-
-(SUBPARTITION subpart31, SUBPARTITION subpart32),
-PARTITION part4 VALUES LESS THAN (2147483646)
-
-
-(SUBPARTITION subpart41, SUBPARTITION subpart42));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -2896,47 +2799,6 @@ TRUNCATE t1;
# check layout success: 1
# End usability test (include/partition_check.inc)
DROP TABLE t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1)
-(PARTITION part1 VALUES IN (0)
-
-
- (SUBPARTITION sp11
-
- ,
- SUBPARTITION sp12
-
- ),
- PARTITION part2 VALUES IN (1)
-
-
- (SUBPARTITION sp21
-
- ,
- SUBPARTITION sp22
-
- ),
- PARTITION part3 VALUES IN (2)
-
-
- (SUBPARTITION sp31,
- SUBPARTITION sp32),
- PARTITION part4 VALUES IN (NULL)
-
-
- (SUBPARTITION sp41
-
- ,
- SUBPARTITION sp42
-
- ));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -3398,25 +3260,6 @@ TRUNCATE t1;
# check layout success: 1
# End usability test (include/partition_check.inc)
DROP TABLE t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3
-(PARTITION part1 VALUES IN (0)
-
- ,
- PARTITION part2 VALUES IN (1)
-
- ,
- PARTITION part3 VALUES IN (NULL)
-
- );
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -3881,25 +3724,6 @@ TRUNCATE t1;
# End usability test (include/partition_check.inc)
DROP TABLE t1;
# 1.1.1 with DATA DIECTORY/INDEX DIRECTORY
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY HASH(f_int1) PARTITIONS 2
-(PARTITION p1
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION p2
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index');
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -3912,7 +3736,7 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
unified filelist
$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD
@@ -4343,68 +4167,34 @@ OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
state new
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par
state old
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p2.MYI
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p2.MYI
# check layout success: 0
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 repair status OK
state new
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par
state old
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p2.MYI
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p2.MYI
# check layout success: 0
TRUNCATE t1;
# check TRUNCATE success: 1
state new
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par
state old
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p2.MYI
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p2.MYI
# check layout success: 0
# End usability test (include/partition_check.inc)
DROP TABLE t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY HASH(f_int1) PARTITIONS 5
-(PARTITION p1
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION p2
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION p3
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION p4
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION p5
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index');
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -4417,7 +4207,7 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
unified filelist
$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD
@@ -4860,34 +4650,36 @@ OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
state new
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par
state old
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p4.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p5.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p4.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p5.MYI
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p4.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p5.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p4.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p5.MYI
# check layout success: 0
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 repair status OK
state new
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par
state old
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p4.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p5.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p4.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p5.MYI
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p4.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p5.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p4.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p5.MYI
# check layout success: 0
TRUNCATE t1;
# check TRUNCATE success: 1
state new
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par
state old
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p4.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p5.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p4.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p5.MYI
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p4.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p5.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p4.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p5.MYI
# check layout success: 0
# End usability test (include/partition_check.inc)
DROP TABLE t1;
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
create_command
SHOW CREATE TABLE t1;
@@ -4898,7 +4690,7 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
unified filelist
$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD
@@ -5353,104 +5145,34 @@ OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
state new
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_N.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_N.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par
state old
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_N.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_N.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part_1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part_2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part_3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part_N.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part_1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part_2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part_3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part_N.MYI
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#part0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_N.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_N.MYI
# check layout success: 0
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 repair status OK
state new
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_N.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_N.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par
state old
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_N.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_N.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part_1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part_2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part_3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part_N.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part_1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part_2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part_3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part_N.MYI
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#part0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_N.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_N.MYI
# check layout success: 0
TRUNCATE t1;
# check TRUNCATE success: 1
state new
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_N.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_N.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par
state old
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_N.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_N.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part_1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part_2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part_3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part_N.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part_1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part_2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part_3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part_N.MYI
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#part0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_N.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_N.MYI
# check layout success: 0
# End usability test (include/partition_check.inc)
DROP TABLE t1;
-SET @aux = 'PARTITION BY RANGE(f_int1)
-(PARTITION parta VALUES LESS THAN (0)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION partb VALUES LESS THAN (5)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION partc VALUES LESS THAN (10)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION partd VALUES LESS THAN (10 + 5)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION parte VALUES LESS THAN (20)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION partf VALUES LESS THAN (2147483646)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'')';
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY RANGE(f_int1)
-(PARTITION parta VALUES LESS THAN (0)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partb VALUES LESS THAN (5)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partc VALUES LESS THAN (10)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partd VALUES LESS THAN (10 + 5)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION parte VALUES LESS THAN (20)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partf VALUES LESS THAN (2147483646)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index');
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -5463,7 +5185,7 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
unified filelist
$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD
@@ -5908,63 +5630,34 @@ OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
state new
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parte.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parte.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partf.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partf.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par
state old
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parte.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parte.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partf.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partf.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#parta.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partb.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partc.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partd.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#parte.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partf.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#parta.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partb.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partc.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partd.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#parte.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partf.MYI
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#parta.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#parte.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partf.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#parte.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partf.MYI
# check layout success: 0
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 repair status OK
state new
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parte.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parte.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partf.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partf.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par
state old
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parte.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parte.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partf.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partf.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#parta.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partb.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partc.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partd.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#parte.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partf.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#parta.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partb.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partc.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partd.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#parte.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partf.MYI
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#parta.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#parte.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partf.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#parte.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partf.MYI
# check layout success: 0
TRUNCATE t1;
# check TRUNCATE success: 1
state new
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parte.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parte.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partf.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partf.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par
state old
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parte.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parte.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partf.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partf.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#parta.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partb.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partc.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partd.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#parte.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partf.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#parta.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partb.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partc.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partd.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#parte.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partf.MYI
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#parta.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#parte.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partf.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#parte.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partf.MYI
# check layout success: 0
# End usability test (include/partition_check.inc)
DROP TABLE t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
-(PARTITION parta VALUES LESS THAN (0)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partb VALUES LESS THAN (5)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partc VALUES LESS THAN (10)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partd VALUES LESS THAN (2147483646)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index');
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -5977,7 +5670,7 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
unified filelist
$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD
@@ -6432,67 +6125,34 @@ OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
state new
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par
state old
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#parta#SP#partasp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#parta#SP#partasp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partb#SP#partbsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partb#SP#partbsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partc#SP#partcsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partc#SP#partcsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partd#SP#partdsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partd#SP#partdsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#parta#SP#partasp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#parta#SP#partasp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partb#SP#partbsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partb#SP#partbsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partc#SP#partcsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partc#SP#partcsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partd#SP#partdsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partd#SP#partdsp1.MYI
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#parta#SP#partasp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#parta#SP#partasp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb#SP#partbsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb#SP#partbsp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc#SP#partcsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc#SP#partcsp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd#SP#partdsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd#SP#partdsp1.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta#SP#partasp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta#SP#partasp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb#SP#partbsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb#SP#partbsp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc#SP#partcsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc#SP#partcsp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd#SP#partdsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd#SP#partdsp1.MYI
# check layout success: 0
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 repair status OK
state new
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par
state old
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#parta#SP#partasp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#parta#SP#partasp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partb#SP#partbsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partb#SP#partbsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partc#SP#partcsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partc#SP#partcsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partd#SP#partdsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partd#SP#partdsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#parta#SP#partasp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#parta#SP#partasp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partb#SP#partbsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partb#SP#partbsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partc#SP#partcsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partc#SP#partcsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partd#SP#partdsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partd#SP#partdsp1.MYI
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#parta#SP#partasp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#parta#SP#partasp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb#SP#partbsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb#SP#partbsp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc#SP#partcsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc#SP#partcsp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd#SP#partdsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd#SP#partdsp1.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta#SP#partasp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta#SP#partasp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb#SP#partbsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb#SP#partbsp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc#SP#partcsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc#SP#partcsp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd#SP#partdsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd#SP#partdsp1.MYI
# check layout success: 0
TRUNCATE t1;
# check TRUNCATE success: 1
state new
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par
state old
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#parta#SP#partasp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#parta#SP#partasp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partb#SP#partbsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partb#SP#partbsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partc#SP#partcsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partc#SP#partcsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partd#SP#partdsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partd#SP#partdsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#parta#SP#partasp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#parta#SP#partasp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partb#SP#partbsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partb#SP#partbsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partc#SP#partcsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partc#SP#partcsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partd#SP#partdsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partd#SP#partdsp1.MYI
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#parta#SP#partasp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#parta#SP#partasp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb#SP#partbsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb#SP#partbsp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc#SP#partcsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc#SP#partcsp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd#SP#partdsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd#SP#partdsp1.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta#SP#partasp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta#SP#partasp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb#SP#partbsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb#SP#partbsp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc#SP#partcsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc#SP#partcsp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd#SP#partdsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd#SP#partdsp1.MYI
# check layout success: 0
# End usability test (include/partition_check.inc)
DROP TABLE t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(PARTITION part1 VALUES LESS THAN (0)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
-(SUBPARTITION subpart11, SUBPARTITION subpart12),
-PARTITION part2 VALUES LESS THAN (5)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
-(SUBPARTITION subpart21, SUBPARTITION subpart22),
-PARTITION part3 VALUES LESS THAN (10)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
-(SUBPARTITION subpart31, SUBPARTITION subpart32),
-PARTITION part4 VALUES LESS THAN (2147483646)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
-(SUBPARTITION subpart41, SUBPARTITION subpart42));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -6505,7 +6165,7 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */
unified filelist
$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD
@@ -6958,95 +6618,34 @@ OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
state new
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart42.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par
state old
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart42.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#subpart11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#subpart12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#subpart21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#subpart22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#subpart31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#subpart32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part4#SP#subpart41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part4#SP#subpart42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#subpart11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#subpart12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#subpart21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#subpart22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#subpart31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#subpart32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part4#SP#subpart41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part4#SP#subpart42.MYI
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#subpart11.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#subpart12.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#subpart21.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#subpart22.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#subpart31.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#subpart32.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#subpart41.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#subpart42.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#subpart11.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#subpart12.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#subpart21.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#subpart22.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#subpart31.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#subpart32.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#subpart41.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#subpart42.MYI
# check layout success: 0
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 repair status OK
state new
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart42.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par
state old
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart42.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#subpart11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#subpart12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#subpart21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#subpart22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#subpart31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#subpart32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part4#SP#subpart41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part4#SP#subpart42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#subpart11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#subpart12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#subpart21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#subpart22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#subpart31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#subpart32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part4#SP#subpart41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part4#SP#subpart42.MYI
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#subpart11.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#subpart12.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#subpart21.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#subpart22.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#subpart31.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#subpart32.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#subpart41.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#subpart42.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#subpart11.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#subpart12.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#subpart21.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#subpart22.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#subpart31.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#subpart32.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#subpart41.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#subpart42.MYI
# check layout success: 0
TRUNCATE t1;
# check TRUNCATE success: 1
state new
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart42.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par
state old
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart42.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#subpart11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#subpart12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#subpart21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#subpart22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#subpart31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#subpart32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part4#SP#subpart41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part4#SP#subpart42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#subpart11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#subpart12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#subpart21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#subpart22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#subpart31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#subpart32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part4#SP#subpart41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part4#SP#subpart42.MYI
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#subpart11.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#subpart12.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#subpart21.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#subpart22.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#subpart31.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#subpart32.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#subpart41.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#subpart42.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#subpart11.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#subpart12.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#subpart21.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#subpart22.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#subpart31.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#subpart32.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#subpart41.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#subpart42.MYI
# check layout success: 0
# End usability test (include/partition_check.inc)
DROP TABLE t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1)
-(PARTITION part1 VALUES IN (0)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
- (SUBPARTITION sp11
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- SUBPARTITION sp12
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'),
- PARTITION part2 VALUES IN (1)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
- (SUBPARTITION sp21
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- SUBPARTITION sp22
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'),
- PARTITION part3 VALUES IN (2)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
- (SUBPARTITION sp31,
- SUBPARTITION sp32),
- PARTITION part4 VALUES IN (NULL)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
- (SUBPARTITION sp41
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- SUBPARTITION sp42
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -7059,7 +6658,7 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */
unified filelist
$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD
@@ -7514,59 +7113,34 @@ OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
state new
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp42.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par
state old
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp42.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#sp11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#sp12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#sp21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#sp22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#sp31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#sp32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part4#SP#sp41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part4#SP#sp42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#sp11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#sp12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#sp21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#sp22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#sp31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#sp32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part4#SP#sp41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part4#SP#sp42.MYI
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#sp11.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#sp12.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#sp21.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#sp22.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#sp31.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#sp32.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#sp41.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#sp42.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#sp11.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#sp12.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#sp21.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#sp22.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#sp31.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#sp32.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#sp41.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#sp42.MYI
# check layout success: 0
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 repair status OK
state new
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp42.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par
state old
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp42.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#sp11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#sp12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#sp21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#sp22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#sp31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#sp32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part4#SP#sp41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part4#SP#sp42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#sp11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#sp12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#sp21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#sp22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#sp31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#sp32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part4#SP#sp41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part4#SP#sp42.MYI
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#sp11.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#sp12.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#sp21.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#sp22.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#sp31.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#sp32.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#sp41.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#sp42.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#sp11.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#sp12.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#sp21.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#sp22.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#sp31.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#sp32.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#sp41.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#sp42.MYI
# check layout success: 0
TRUNCATE t1;
# check TRUNCATE success: 1
state new
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp42.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par
state old
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp42.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#sp11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#sp12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#sp21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#sp22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#sp31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#sp32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part4#SP#sp41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part4#SP#sp42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#sp11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#sp12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#sp21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#sp22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#sp31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#sp32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part4#SP#sp41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part4#SP#sp42.MYI
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#sp11.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#sp12.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#sp21.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#sp22.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#sp31.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#sp32.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#sp41.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#sp42.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#sp11.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#sp12.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#sp21.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#sp22.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#sp31.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#sp32.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#sp41.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#sp42.MYI
# check layout success: 0
# End usability test (include/partition_check.inc)
DROP TABLE t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3
-(PARTITION part1 VALUES IN (0)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- PARTITION part2 VALUES IN (1)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- PARTITION part3 VALUES IN (NULL)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index');
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -7579,7 +7153,7 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
unified filelist
$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD
@@ -8038,44 +7612,35 @@ OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
state new
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par
state old
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#part1sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#part1sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#part1sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#part2sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#part2sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#part2sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#part3sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#part3sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#part3sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#part1sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#part1sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#part1sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#part2sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#part2sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#part2sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#part3sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#part3sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#part3sp2.MYI
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp2.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp2.MYI
# check layout success: 0
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 repair status OK
state new
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par
state old
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#part1sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#part1sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#part1sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#part2sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#part2sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#part2sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#part3sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#part3sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#part3sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#part1sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#part1sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#part1sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#part2sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#part2sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#part2sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#part3sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#part3sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#part3sp2.MYI
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp2.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp2.MYI
# check layout success: 0
TRUNCATE t1;
# check TRUNCATE success: 1
state new
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par
state old
-Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
-File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#part1sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#part1sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#part1sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#part2sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#part2sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#part2sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#part3sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#part3sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#part3sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#part1sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#part1sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#part1sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#part2sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#part2sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#part2sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#part3sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#part3sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#part3sp2.MYI
+Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
+File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp2.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp2.MYI
# check layout success: 0
# End usability test (include/partition_check.inc)
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY HASH(f_int1) PARTITIONS 2;
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -8525,6 +8090,8 @@ TRUNCATE t1;
# check layout success: 1
# End usability test (include/partition_check.inc)
DROP TABLE t1;
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
create_command
SHOW CREATE TABLE t1;
@@ -8978,6 +8545,8 @@ TRUNCATE t1;
# check layout success: 1
# End usability test (include/partition_check.inc)
DROP TABLE t1;
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
create_command
SHOW CREATE TABLE t1;
@@ -8988,7 +8557,7 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
unified filelist
$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD
@@ -9437,52 +9006,6 @@ TRUNCATE t1;
# check layout success: 1
# End usability test (include/partition_check.inc)
DROP TABLE t1;
-SET @aux = 'PARTITION BY RANGE(f_int1)
-(PARTITION parta VALUES LESS THAN (0)
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION partb VALUES LESS THAN (5)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'',
-PARTITION partc VALUES LESS THAN (10)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION partd VALUES LESS THAN (10 + 5),
-PARTITION parte VALUES LESS THAN (20)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'',
-PARTITION partf VALUES LESS THAN (2147483646)
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'')';
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY RANGE(f_int1)
-(PARTITION parta VALUES LESS THAN (0)
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partb VALUES LESS THAN (5)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data',
-PARTITION partc VALUES LESS THAN (10)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partd VALUES LESS THAN (10 + 5),
-PARTITION parte VALUES LESS THAN (20)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data',
-PARTITION partf VALUES LESS THAN (2147483646)
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index');
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -9495,7 +9018,7 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
unified filelist
$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD
@@ -9938,27 +9461,6 @@ TRUNCATE t1;
# check layout success: 1
# End usability test (include/partition_check.inc)
DROP TABLE t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
-(PARTITION parta VALUES LESS THAN (0)
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partb VALUES LESS THAN (5)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data',
-PARTITION partc VALUES LESS THAN (10),
-PARTITION partd VALUES LESS THAN (2147483646)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index');
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -9971,7 +9473,7 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
unified filelist
$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD
@@ -10420,31 +9922,6 @@ TRUNCATE t1;
# check layout success: 1
# End usability test (include/partition_check.inc)
DROP TABLE t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(PARTITION part1 VALUES LESS THAN (0)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-(SUBPARTITION subpart11, SUBPARTITION subpart12),
-PARTITION part2 VALUES LESS THAN (5)
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
-(SUBPARTITION subpart21, SUBPARTITION subpart22),
-PARTITION part3 VALUES LESS THAN (10)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
-(SUBPARTITION subpart31, SUBPARTITION subpart32),
-PARTITION part4 VALUES LESS THAN (2147483646)
-(SUBPARTITION subpart41, SUBPARTITION subpart42));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -10457,7 +9934,7 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
unified filelist
$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD
@@ -10904,51 +10381,6 @@ TRUNCATE t1;
# check layout success: 1
# End usability test (include/partition_check.inc)
DROP TABLE t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-
-)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1)
-(PARTITION part1 VALUES IN (0)
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
- (SUBPARTITION sp11
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data',
- SUBPARTITION sp12
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'),
- PARTITION part2 VALUES IN (1)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- (SUBPARTITION sp21
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data',
- SUBPARTITION sp22
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'),
- PARTITION part3 VALUES IN (2)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
- (SUBPARTITION sp31,
- SUBPARTITION sp32),
- PARTITION part4 VALUES IN (NULL)
- (SUBPARTITION sp41
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- SUBPARTITION sp42
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -10961,7 +10393,7 @@ t1 CREATE TABLE `t1` (
`f_char1` char(20) DEFAULT NULL,
`f_char2` char(20) DEFAULT NULL,
`f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */
unified filelist
$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD
@@ -15190,15 +14622,6 @@ DROP TABLE t1;
#------------------------------------------------------------------------
# 2.5 PRIMARY KEY + UNIQUE INDEX consisting of two columns
DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1)
-)
-PARTITION BY HASH(f_int1) PARTITIONS 2;
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -15701,6 +15124,8 @@ TRUNCATE t1;
# check layout success: 1
# End usability test (include/partition_check.inc)
DROP TABLE t1;
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
create_command
SHOW CREATE TABLE t1;
@@ -16207,6 +15632,8 @@ TRUNCATE t1;
# check layout success: 1
# End usability test (include/partition_check.inc)
DROP TABLE t1;
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
create_command
SHOW CREATE TABLE t1;
@@ -16219,7 +15646,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
unified filelist
$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD
@@ -16719,76 +16146,6 @@ TRUNCATE t1;
# check layout success: 1
# End usability test (include/partition_check.inc)
DROP TABLE t1;
-SET @aux = 'PARTITION BY RANGE(f_int1)
-(PARTITION parta VALUES LESS THAN (0)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION partb VALUES LESS THAN (5)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION partc VALUES LESS THAN (10)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION partd VALUES LESS THAN (10 + 5)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION parte VALUES LESS THAN (20)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'',
-PARTITION partf VALUES LESS THAN (2147483646)
-DATA DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data''
-INDEX DIRECTORY =
- ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'')';
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1)
-(PARTITION parta VALUES LESS THAN (0)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partb VALUES LESS THAN (5)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partc VALUES LESS THAN (10)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partd VALUES LESS THAN (10 + 5)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION parte VALUES LESS THAN (20)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partf VALUES LESS THAN (2147483646)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index');
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -16803,7 +16160,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
unified filelist
$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD
@@ -17297,35 +16654,6 @@ TRUNCATE t1;
# check layout success: 1
# End usability test (include/partition_check.inc)
DROP TABLE t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
-(PARTITION parta VALUES LESS THAN (0)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partb VALUES LESS THAN (5)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partc VALUES LESS THAN (10)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
-PARTITION partd VALUES LESS THAN (2147483646)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index');
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -17340,7 +16668,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
unified filelist
$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD
@@ -17840,39 +17168,6 @@ TRUNCATE t1;
# check layout success: 1
# End usability test (include/partition_check.inc)
DROP TABLE t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1)
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(PARTITION part1 VALUES LESS THAN (0)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
-(SUBPARTITION subpart11, SUBPARTITION subpart12),
-PARTITION part2 VALUES LESS THAN (5)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
-(SUBPARTITION subpart21, SUBPARTITION subpart22),
-PARTITION part3 VALUES LESS THAN (10)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
-(SUBPARTITION subpart31, SUBPARTITION subpart32),
-PARTITION part4 VALUES LESS THAN (2147483646)
-DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
-INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
-(SUBPARTITION subpart41, SUBPARTITION subpart42));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -17887,7 +17182,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */
unified filelist
$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD
@@ -18385,67 +17680,6 @@ TRUNCATE t1;
# check layout success: 1
# End usability test (include/partition_check.inc)
DROP TABLE t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1)
-(PARTITION part1 VALUES IN (0)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
- (SUBPARTITION sp11
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- SUBPARTITION sp12
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'),
- PARTITION part2 VALUES IN (1)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
- (SUBPARTITION sp21
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- SUBPARTITION sp22
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'),
- PARTITION part3 VALUES IN (2)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
- (SUBPARTITION sp31,
- SUBPARTITION sp32),
- PARTITION part4 VALUES IN (NULL)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'
- (SUBPARTITION sp41
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- SUBPARTITION sp42
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -18460,7 +17694,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */
unified filelist
$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD
@@ -18960,31 +18194,6 @@ TRUNCATE t1;
# check layout success: 1
# End usability test (include/partition_check.inc)
DROP TABLE t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1)
-)
-PARTITION BY LIST(ABS(MOD(f_int1,2)))
-SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3
-(PARTITION part1 VALUES IN (0)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- PARTITION part2 VALUES IN (1)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index',
- PARTITION part3 VALUES IN (NULL)
- DATA DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'
- INDEX DIRECTORY =
- '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index');
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template;
# Start usability test (include/partition_check.inc)
@@ -18999,7 +18208,7 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL,
UNIQUE KEY `uidx1` (`f_int1`,`f_int2`),
UNIQUE KEY `uidx2` (`f_int2`,`f_int1`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */
unified filelist
$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD
diff --git a/mysql-test/suite/parts/r/partition_datetime_innodb.result b/mysql-test/suite/parts/r/partition_datetime_innodb.result
index f8cf390ebbb..4ced059ba9e 100644
--- a/mysql-test/suite/parts/r/partition_datetime_innodb.result
+++ b/mysql-test/suite/parts/r/partition_datetime_innodb.result
@@ -186,7 +186,7 @@ a
1971-01-01 00:00:59
drop table t2;
create table t3 (a timestamp not null, primary key(a)) engine='InnoDB'
-partition by range (cast(month(a) as unsigned)) subpartition by key (a)
+partition by range (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values less than (4),
partition quarter2 values less than (7),
@@ -198,7 +198,7 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = InnoDB) */
12 inserts;
insert into t3 values (date_add('1970-01-01 00:00:00',interval 12-1 month));
insert into t3 values (date_add('1970-01-01 00:00:00',interval 11-1 month));
@@ -233,7 +233,7 @@ a
1970-12-01 00:00:00
drop table t3;
create table t4 (a timestamp not null, primary key(a)) engine='InnoDB'
-partition by list (cast(month(a) as unsigned)) subpartition by key (a)
+partition by list (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values in (0,1,2,3),
partition quarter2 values in (4,5,6),
@@ -245,7 +245,7 @@ Table Create Table
t4 CREATE TABLE `t4` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (0,1,2,3) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = InnoDB, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (0,1,2,3) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = InnoDB, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = InnoDB) */
12 inserts;
insert into t4 values (date_add('1970-01-01 00:00:00',interval 12-1 month));
insert into t4 values (date_add('1970-01-01 00:00:00',interval 11-1 month));
@@ -517,7 +517,7 @@ a
1970-03-28
drop table t2;
create table t3 (a date not null, primary key(a)) engine='InnoDB'
-partition by range (cast(month(a) as unsigned)) subpartition by key (a)
+partition by range (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values less than (4),
partition quarter2 values less than (7),
@@ -529,7 +529,7 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` date NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = InnoDB) */
12 inserts;
insert into t3 values (adddate(19700101,interval 12-1 month));
insert into t3 values (adddate(19700101,interval 11-1 month));
@@ -562,7 +562,7 @@ a
1970-12-01
drop table t3;
create table t4 (a date not null, primary key(a)) engine='InnoDB'
-partition by list (cast(month(a) as unsigned)) subpartition by key (a)
+partition by list (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values in (1,2,3),
partition quarter2 values in (4,5,6),
@@ -574,7 +574,7 @@ Table Create Table
t4 CREATE TABLE `t4` (
`a` date NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = InnoDB, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = InnoDB, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = InnoDB) */
12 inserts;
insert into t4 values (adddate(19700101,interval 12-1 month));
insert into t4 values (adddate(19700101,interval 11-1 month));
@@ -794,7 +794,7 @@ a
00:01:59
drop table t2;
create table t3 (a time not null, primary key(a)) engine='InnoDB'
-partition by range (cast(second(a) as unsigned)) subpartition by key (a)
+partition by range (second(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values less than (16),
partition quarter2 values less than (31),
@@ -806,7 +806,7 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` time NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(second(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (16) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (31) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (46) ENGINE = InnoDB, PARTITION quarter4 VALUES LESS THAN (61) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (second(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (16) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (31) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (46) ENGINE = InnoDB, PARTITION quarter4 VALUES LESS THAN (61) ENGINE = InnoDB) */
59 inserts;
insert into t3 values (100000+59);
insert into t3 values (100000+58);
@@ -933,7 +933,7 @@ a
10:00:59
drop table t3;
create table t4 (a time not null, primary key(a)) engine='InnoDB'
-partition by list (cast(second(a) as unsigned)) subpartition by key (a)
+partition by list (second(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
partition quarter2 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
@@ -945,7 +945,7 @@ Table Create Table
t4 CREATE TABLE `t4` (
`a` time NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(second(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45) ENGINE = InnoDB, PARTITION quarter4 VALUES IN (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (second(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45) ENGINE = InnoDB, PARTITION quarter4 VALUES IN (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */
59 inserts;
insert into t4 values (100000+59);
insert into t4 values (100000+58);
@@ -1259,7 +1259,7 @@ a
1970-01-01 00:00:59
drop table t2;
create table t3 (a datetime not null, primary key(a)) engine='InnoDB'
-partition by range (cast(month(a) as unsigned)) subpartition by key (a)
+partition by range (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values less than (4),
partition quarter2 values less than (7),
@@ -1271,7 +1271,7 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` datetime NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = InnoDB) */
12 inserts;
insert into t3 values (adddate(19700101000000,interval 12-1 month));
insert into t3 values (adddate(19700101000000,interval 11-1 month));
@@ -1304,7 +1304,7 @@ a
1970-12-01 00:00:00
drop table t3;
create table t4 (a datetime not null, primary key(a)) engine='InnoDB'
-partition by list (cast(month(a) as unsigned)) subpartition by key (a)
+partition by list (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values in (1,2,3),
partition quarter2 values in (4,5,6),
@@ -1316,7 +1316,7 @@ Table Create Table
t4 CREATE TABLE `t4` (
`a` datetime NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = InnoDB, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = InnoDB) */
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = InnoDB, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = InnoDB) */
12 inserts;
insert into t4 values (adddate(19700101000000,interval 12-1 month));
insert into t4 values (adddate(19700101000000,interval 11-1 month));
diff --git a/mysql-test/suite/parts/r/partition_datetime_myisam.result b/mysql-test/suite/parts/r/partition_datetime_myisam.result
index 2c0091322e1..1ef281f2766 100644
--- a/mysql-test/suite/parts/r/partition_datetime_myisam.result
+++ b/mysql-test/suite/parts/r/partition_datetime_myisam.result
@@ -186,7 +186,7 @@ a
1971-01-01 00:00:59
drop table t2;
create table t3 (a timestamp not null, primary key(a)) engine='MyISAM'
-partition by range (cast(month(a) as unsigned)) subpartition by key (a)
+partition by range (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values less than (4),
partition quarter2 values less than (7),
@@ -198,7 +198,7 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = MyISAM) */
12 inserts;
insert into t3 values (date_add('1970-01-01 00:00:00',interval 12-1 month));
insert into t3 values (date_add('1970-01-01 00:00:00',interval 11-1 month));
@@ -233,7 +233,7 @@ a
1970-12-01 00:00:00
drop table t3;
create table t4 (a timestamp not null, primary key(a)) engine='MyISAM'
-partition by list (cast(month(a) as unsigned)) subpartition by key (a)
+partition by list (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values in (0,1,2,3),
partition quarter2 values in (4,5,6),
@@ -245,7 +245,7 @@ Table Create Table
t4 CREATE TABLE `t4` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (0,1,2,3) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = MyISAM, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (0,1,2,3) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = MyISAM, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = MyISAM) */
12 inserts;
insert into t4 values (date_add('1970-01-01 00:00:00',interval 12-1 month));
insert into t4 values (date_add('1970-01-01 00:00:00',interval 11-1 month));
@@ -517,7 +517,7 @@ a
1970-03-28
drop table t2;
create table t3 (a date not null, primary key(a)) engine='MyISAM'
-partition by range (cast(month(a) as unsigned)) subpartition by key (a)
+partition by range (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values less than (4),
partition quarter2 values less than (7),
@@ -529,7 +529,7 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` date NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = MyISAM) */
12 inserts;
insert into t3 values (adddate(19700101,interval 12-1 month));
insert into t3 values (adddate(19700101,interval 11-1 month));
@@ -562,7 +562,7 @@ a
1970-12-01
drop table t3;
create table t4 (a date not null, primary key(a)) engine='MyISAM'
-partition by list (cast(month(a) as unsigned)) subpartition by key (a)
+partition by list (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values in (1,2,3),
partition quarter2 values in (4,5,6),
@@ -574,7 +574,7 @@ Table Create Table
t4 CREATE TABLE `t4` (
`a` date NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = MyISAM, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = MyISAM, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = MyISAM) */
12 inserts;
insert into t4 values (adddate(19700101,interval 12-1 month));
insert into t4 values (adddate(19700101,interval 11-1 month));
@@ -794,7 +794,7 @@ a
00:01:59
drop table t2;
create table t3 (a time not null, primary key(a)) engine='MyISAM'
-partition by range (cast(second(a) as unsigned)) subpartition by key (a)
+partition by range (second(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values less than (16),
partition quarter2 values less than (31),
@@ -806,7 +806,7 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` time NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(second(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (16) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (31) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (46) ENGINE = MyISAM, PARTITION quarter4 VALUES LESS THAN (61) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (second(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (16) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (31) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (46) ENGINE = MyISAM, PARTITION quarter4 VALUES LESS THAN (61) ENGINE = MyISAM) */
59 inserts;
insert into t3 values (100000+59);
insert into t3 values (100000+58);
@@ -933,7 +933,7 @@ a
10:00:59
drop table t3;
create table t4 (a time not null, primary key(a)) engine='MyISAM'
-partition by list (cast(second(a) as unsigned)) subpartition by key (a)
+partition by list (second(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
partition quarter2 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
@@ -945,7 +945,7 @@ Table Create Table
t4 CREATE TABLE `t4` (
`a` time NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(second(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45) ENGINE = MyISAM, PARTITION quarter4 VALUES IN (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (second(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45) ENGINE = MyISAM, PARTITION quarter4 VALUES IN (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
59 inserts;
insert into t4 values (100000+59);
insert into t4 values (100000+58);
@@ -1259,7 +1259,7 @@ a
1970-01-01 00:00:59
drop table t2;
create table t3 (a datetime not null, primary key(a)) engine='MyISAM'
-partition by range (cast(month(a) as unsigned)) subpartition by key (a)
+partition by range (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values less than (4),
partition quarter2 values less than (7),
@@ -1271,7 +1271,7 @@ Table Create Table
t3 CREATE TABLE `t3` (
`a` datetime NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = MyISAM) */
12 inserts;
insert into t3 values (adddate(19700101000000,interval 12-1 month));
insert into t3 values (adddate(19700101000000,interval 11-1 month));
@@ -1304,7 +1304,7 @@ a
1970-12-01 00:00:00
drop table t3;
create table t4 (a datetime not null, primary key(a)) engine='MyISAM'
-partition by list (cast(month(a) as unsigned)) subpartition by key (a)
+partition by list (month(a)) subpartition by key (a)
subpartitions 3 (
partition quarter1 values in (1,2,3),
partition quarter2 values in (4,5,6),
@@ -1316,7 +1316,7 @@ Table Create Table
t4 CREATE TABLE `t4` (
`a` datetime NOT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = MyISAM, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = MyISAM) */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = MyISAM, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = MyISAM) */
12 inserts;
insert into t4 values (adddate(19700101000000,interval 12-1 month));
insert into t4 values (adddate(19700101000000,interval 11-1 month));
diff --git a/mysql-test/suite/parts/r/partition_decimal_innodb.result b/mysql-test/suite/parts/r/partition_decimal_innodb.result
index 584ce91724e..c0a165cf189 100644
--- a/mysql-test/suite/parts/r/partition_decimal_innodb.result
+++ b/mysql-test/suite/parts/r/partition_decimal_innodb.result
@@ -87,95 +87,3 @@ select count(*) from t2;
count(*)
3072
drop table t2;
-create table t3 (a decimal(18,9) not null, primary key(a)) engine='InnoDB'
-partition by range (cast(floor(a) as signed)) subpartition by key (a) subpartitions 2 (
-partition pa2 values less than (2),
-partition pa4 values less than (4),
-partition pa6 values less than (6),
-partition pa8 values less than (8),
-partition pa10 values less than (10)
-);
-show create table t3;
-Table Create Table
-t3 CREATE TABLE `t3` (
- `a` decimal(18,9) NOT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(floor(a) as signed)) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa2 VALUES LESS THAN (2) ENGINE = InnoDB, PARTITION pa4 VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION pa6 VALUES LESS THAN (6) ENGINE = InnoDB, PARTITION pa8 VALUES LESS THAN (8) ENGINE = InnoDB, PARTITION pa10 VALUES LESS THAN (10) ENGINE = InnoDB) */
-9*3 inserts;
-insert into t3 values (9);
-insert into t3 values (9+0.333333333);
-insert into t3 values (9+0.755555555);
-insert into t3 values (8);
-insert into t3 values (8+0.333333333);
-insert into t3 values (8+0.755555555);
-insert into t3 values (7);
-insert into t3 values (7+0.333333333);
-insert into t3 values (7+0.755555555);
-insert into t3 values (6);
-insert into t3 values (6+0.333333333);
-insert into t3 values (6+0.755555555);
-insert into t3 values (5);
-insert into t3 values (5+0.333333333);
-insert into t3 values (5+0.755555555);
-insert into t3 values (4);
-insert into t3 values (4+0.333333333);
-insert into t3 values (4+0.755555555);
-insert into t3 values (3);
-insert into t3 values (3+0.333333333);
-insert into t3 values (3+0.755555555);
-insert into t3 values (2);
-insert into t3 values (2+0.333333333);
-insert into t3 values (2+0.755555555);
-insert into t3 values (1);
-insert into t3 values (1+0.333333333);
-insert into t3 values (1+0.755555555);
-select count(*) from t3;
-count(*)
-27
-drop table t3;
-create table t4 (a decimal(18,9) not null, primary key(a)) engine='InnoDB'
-partition by list (cast(floor(a) as signed)) subpartition by key (a) subpartitions 2 (
-partition pa2 values in (1,2),
-partition pa4 values in (3,4),
-partition pa6 values in (5,6),
-partition pa8 values in (7,8),
-partition pa10 values in (9,10)
-);
-show create table t4;
-Table Create Table
-t4 CREATE TABLE `t4` (
- `a` decimal(18,9) NOT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(floor(a) as signed)) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa2 VALUES IN (1,2) ENGINE = InnoDB, PARTITION pa4 VALUES IN (3,4) ENGINE = InnoDB, PARTITION pa6 VALUES IN (5,6) ENGINE = InnoDB, PARTITION pa8 VALUES IN (7,8) ENGINE = InnoDB, PARTITION pa10 VALUES IN (9,10) ENGINE = InnoDB) */
-9*3 inserts;
-insert into t4 values (9);
-insert into t4 values (9+0.333333333);
-insert into t4 values (9+0.755555555);
-insert into t4 values (8);
-insert into t4 values (8+0.333333333);
-insert into t4 values (8+0.755555555);
-insert into t4 values (7);
-insert into t4 values (7+0.333333333);
-insert into t4 values (7+0.755555555);
-insert into t4 values (6);
-insert into t4 values (6+0.333333333);
-insert into t4 values (6+0.755555555);
-insert into t4 values (5);
-insert into t4 values (5+0.333333333);
-insert into t4 values (5+0.755555555);
-insert into t4 values (4);
-insert into t4 values (4+0.333333333);
-insert into t4 values (4+0.755555555);
-insert into t4 values (3);
-insert into t4 values (3+0.333333333);
-insert into t4 values (3+0.755555555);
-insert into t4 values (2);
-insert into t4 values (2+0.333333333);
-insert into t4 values (2+0.755555555);
-insert into t4 values (1);
-insert into t4 values (1+0.333333333);
-insert into t4 values (1+0.755555555);
-select count(*) from t4;
-count(*)
-27
-drop table t4;
diff --git a/mysql-test/suite/parts/r/partition_decimal_myisam.result b/mysql-test/suite/parts/r/partition_decimal_myisam.result
index 008c249165d..464ac4ddaf5 100644
--- a/mysql-test/suite/parts/r/partition_decimal_myisam.result
+++ b/mysql-test/suite/parts/r/partition_decimal_myisam.result
@@ -87,95 +87,3 @@ select count(*) from t2;
count(*)
196605
drop table t2;
-create table t3 (a decimal(18,9) not null, primary key(a)) engine='MYISAM'
-partition by range (cast(floor(a) as signed)) subpartition by key (a) subpartitions 2 (
-partition pa2 values less than (2),
-partition pa4 values less than (4),
-partition pa6 values less than (6),
-partition pa8 values less than (8),
-partition pa10 values less than (10)
-);
-show create table t3;
-Table Create Table
-t3 CREATE TABLE `t3` (
- `a` decimal(18,9) NOT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(floor(a) as signed)) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa2 VALUES LESS THAN (2) ENGINE = MyISAM, PARTITION pa4 VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION pa6 VALUES LESS THAN (6) ENGINE = MyISAM, PARTITION pa8 VALUES LESS THAN (8) ENGINE = MyISAM, PARTITION pa10 VALUES LESS THAN (10) ENGINE = MyISAM) */
-9*3 inserts;
-insert into t3 values (9);
-insert into t3 values (9+0.333333333);
-insert into t3 values (9+0.755555555);
-insert into t3 values (8);
-insert into t3 values (8+0.333333333);
-insert into t3 values (8+0.755555555);
-insert into t3 values (7);
-insert into t3 values (7+0.333333333);
-insert into t3 values (7+0.755555555);
-insert into t3 values (6);
-insert into t3 values (6+0.333333333);
-insert into t3 values (6+0.755555555);
-insert into t3 values (5);
-insert into t3 values (5+0.333333333);
-insert into t3 values (5+0.755555555);
-insert into t3 values (4);
-insert into t3 values (4+0.333333333);
-insert into t3 values (4+0.755555555);
-insert into t3 values (3);
-insert into t3 values (3+0.333333333);
-insert into t3 values (3+0.755555555);
-insert into t3 values (2);
-insert into t3 values (2+0.333333333);
-insert into t3 values (2+0.755555555);
-insert into t3 values (1);
-insert into t3 values (1+0.333333333);
-insert into t3 values (1+0.755555555);
-select count(*) from t3;
-count(*)
-27
-drop table t3;
-create table t4 (a decimal(18,9) not null, primary key(a)) engine='MYISAM'
-partition by list (cast(floor(a) as signed)) subpartition by key (a) subpartitions 2 (
-partition pa2 values in (1,2),
-partition pa4 values in (3,4),
-partition pa6 values in (5,6),
-partition pa8 values in (7,8),
-partition pa10 values in (9,10)
-);
-show create table t4;
-Table Create Table
-t4 CREATE TABLE `t4` (
- `a` decimal(18,9) NOT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(floor(a) as signed)) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa2 VALUES IN (1,2) ENGINE = MyISAM, PARTITION pa4 VALUES IN (3,4) ENGINE = MyISAM, PARTITION pa6 VALUES IN (5,6) ENGINE = MyISAM, PARTITION pa8 VALUES IN (7,8) ENGINE = MyISAM, PARTITION pa10 VALUES IN (9,10) ENGINE = MyISAM) */
-9*3 inserts;
-insert into t4 values (9);
-insert into t4 values (9+0.333333333);
-insert into t4 values (9+0.755555555);
-insert into t4 values (8);
-insert into t4 values (8+0.333333333);
-insert into t4 values (8+0.755555555);
-insert into t4 values (7);
-insert into t4 values (7+0.333333333);
-insert into t4 values (7+0.755555555);
-insert into t4 values (6);
-insert into t4 values (6+0.333333333);
-insert into t4 values (6+0.755555555);
-insert into t4 values (5);
-insert into t4 values (5+0.333333333);
-insert into t4 values (5+0.755555555);
-insert into t4 values (4);
-insert into t4 values (4+0.333333333);
-insert into t4 values (4+0.755555555);
-insert into t4 values (3);
-insert into t4 values (3+0.333333333);
-insert into t4 values (3+0.755555555);
-insert into t4 values (2);
-insert into t4 values (2+0.333333333);
-insert into t4 values (2+0.755555555);
-insert into t4 values (1);
-insert into t4 values (1+0.333333333);
-insert into t4 values (1+0.755555555);
-select count(*) from t4;
-count(*)
-27
-drop table t4;
diff --git a/mysql-test/suite/parts/r/partition_float_myisam.result b/mysql-test/suite/parts/r/partition_float_myisam.result
index 08a1c20d224..aba62b8ba70 100644
--- a/mysql-test/suite/parts/r/partition_float_myisam.result
+++ b/mysql-test/suite/parts/r/partition_float_myisam.result
@@ -89,152 +89,6 @@ select count(*) from t2;
count(*)
49152
drop table t2;
-create table t3 (a float not null, primary key(a)) engine='MYISAM'
-partition by range (cast(floor(a) as signed)) subpartition by key (a) subpartitions 3 (
-partition pa1 values less than (3),
-partition pa3 values less than (6),
-partition pa10 values less than (10)
-);
-show create table t3;
-Table Create Table
-t3 CREATE TABLE `t3` (
- `a` float NOT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(floor(a) as signed)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION pa1 VALUES LESS THAN (3) ENGINE = MyISAM, PARTITION pa3 VALUES LESS THAN (6) ENGINE = MyISAM, PARTITION pa10 VALUES LESS THAN (10) ENGINE = MyISAM) */
-9*3 inserts;
-insert into t3 values (9);
-insert into t3 values (9+0.33);
-insert into t3 values (9+0.75);
-insert into t3 values (8);
-insert into t3 values (8+0.33);
-insert into t3 values (8+0.75);
-insert into t3 values (7);
-insert into t3 values (7+0.33);
-insert into t3 values (7+0.75);
-insert into t3 values (6);
-insert into t3 values (6+0.33);
-insert into t3 values (6+0.75);
-insert into t3 values (5);
-insert into t3 values (5+0.33);
-insert into t3 values (5+0.75);
-insert into t3 values (4);
-insert into t3 values (4+0.33);
-insert into t3 values (4+0.75);
-insert into t3 values (3);
-insert into t3 values (3+0.33);
-insert into t3 values (3+0.75);
-insert into t3 values (2);
-insert into t3 values (2+0.33);
-insert into t3 values (2+0.75);
-insert into t3 values (1);
-insert into t3 values (1+0.33);
-insert into t3 values (1+0.75);
-select count(*) from t3;
-count(*)
-27
-select * from t3;
-a
-1
-1.33
-1.75
-2
-2.33
-2.75
-3
-3.33
-3.75
-4
-4.33
-4.75
-5
-5.33
-5.75
-6
-6.33
-6.75
-7
-7.33
-7.75
-8
-8.33
-8.75
-9
-9.33
-9.75
-drop table t3;
-create table t4 (a float not null, primary key(a)) engine='MYISAM'
-partition by list (cast(floor(a) as signed)) subpartition by key (a) subpartitions 3 (
-partition pa1 values in (1,2,3),
-partition pa3 values in (4,5,6),
-partition pa10 values in (7,8,9,10)
-);
-show create table t4;
-Table Create Table
-t4 CREATE TABLE `t4` (
- `a` float NOT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(floor(a) as signed)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION pa1 VALUES IN (1,2,3) ENGINE = MyISAM, PARTITION pa3 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION pa10 VALUES IN (7,8,9,10) ENGINE = MyISAM) */
-9*3 inserts;
-insert into t4 values (9);
-insert into t4 values (9+0.33);
-insert into t4 values (9+0.75);
-insert into t4 values (8);
-insert into t4 values (8+0.33);
-insert into t4 values (8+0.75);
-insert into t4 values (7);
-insert into t4 values (7+0.33);
-insert into t4 values (7+0.75);
-insert into t4 values (6);
-insert into t4 values (6+0.33);
-insert into t4 values (6+0.75);
-insert into t4 values (5);
-insert into t4 values (5+0.33);
-insert into t4 values (5+0.75);
-insert into t4 values (4);
-insert into t4 values (4+0.33);
-insert into t4 values (4+0.75);
-insert into t4 values (3);
-insert into t4 values (3+0.33);
-insert into t4 values (3+0.75);
-insert into t4 values (2);
-insert into t4 values (2+0.33);
-insert into t4 values (2+0.75);
-insert into t4 values (1);
-insert into t4 values (1+0.33);
-insert into t4 values (1+0.75);
-select count(*) from t4;
-count(*)
-27
-select * from t4;
-a
-1
-1.33
-1.75
-2
-2.33
-2.75
-3
-3.33
-3.75
-4
-4.33
-4.75
-5
-5.33
-5.75
-6
-6.33
-6.75
-7
-7.33
-7.75
-8
-8.33
-8.75
-9
-9.33
-9.75
-drop table t4;
create table t1 (a double not null, primary key(a)) engine='MYISAM'
partition by key (a) (
partition pa1 DATA DIRECTORY =
@@ -318,149 +172,3 @@ select count(*) from t2;
count(*)
49152
drop table t2;
-create table t3 (a double not null, primary key(a)) engine='MYISAM'
-partition by range (cast(floor(a) as signed)) subpartition by key (a) subpartitions 3 (
-partition pa1 values less than (3),
-partition pa3 values less than (6),
-partition pa10 values less than (10)
-);
-show create table t3;
-Table Create Table
-t3 CREATE TABLE `t3` (
- `a` double NOT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(floor(a) as signed)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION pa1 VALUES LESS THAN (3) ENGINE = MyISAM, PARTITION pa3 VALUES LESS THAN (6) ENGINE = MyISAM, PARTITION pa10 VALUES LESS THAN (10) ENGINE = MyISAM) */
-9*3 inserts;
-insert into t3 values (9);
-insert into t3 values (9+0.33);
-insert into t3 values (9+0.75);
-insert into t3 values (8);
-insert into t3 values (8+0.33);
-insert into t3 values (8+0.75);
-insert into t3 values (7);
-insert into t3 values (7+0.33);
-insert into t3 values (7+0.75);
-insert into t3 values (6);
-insert into t3 values (6+0.33);
-insert into t3 values (6+0.75);
-insert into t3 values (5);
-insert into t3 values (5+0.33);
-insert into t3 values (5+0.75);
-insert into t3 values (4);
-insert into t3 values (4+0.33);
-insert into t3 values (4+0.75);
-insert into t3 values (3);
-insert into t3 values (3+0.33);
-insert into t3 values (3+0.75);
-insert into t3 values (2);
-insert into t3 values (2+0.33);
-insert into t3 values (2+0.75);
-insert into t3 values (1);
-insert into t3 values (1+0.33);
-insert into t3 values (1+0.75);
-select count(*) from t3;
-count(*)
-27
-select * from t3;
-a
-1
-1.33
-1.75
-2
-2.33
-2.75
-3
-3.33
-3.75
-4
-4.33
-4.75
-5
-5.33
-5.75
-6
-6.33
-6.75
-7
-7.33
-7.75
-8
-8.33
-8.75
-9
-9.33
-9.75
-drop table t3;
-create table t4 (a double not null, primary key(a)) engine='MYISAM'
-partition by list (cast(floor(a) as signed)) subpartition by key (a) subpartitions 3 (
-partition pa1 values in (1,2,3),
-partition pa3 values in (4,5,6),
-partition pa10 values in (7,8,9,10)
-);
-show create table t4;
-Table Create Table
-t4 CREATE TABLE `t4` (
- `a` double NOT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(floor(a) as signed)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION pa1 VALUES IN (1,2,3) ENGINE = MyISAM, PARTITION pa3 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION pa10 VALUES IN (7,8,9,10) ENGINE = MyISAM) */
-9*3 inserts;
-insert into t4 values (9);
-insert into t4 values (9+0.33);
-insert into t4 values (9+0.75);
-insert into t4 values (8);
-insert into t4 values (8+0.33);
-insert into t4 values (8+0.75);
-insert into t4 values (7);
-insert into t4 values (7+0.33);
-insert into t4 values (7+0.75);
-insert into t4 values (6);
-insert into t4 values (6+0.33);
-insert into t4 values (6+0.75);
-insert into t4 values (5);
-insert into t4 values (5+0.33);
-insert into t4 values (5+0.75);
-insert into t4 values (4);
-insert into t4 values (4+0.33);
-insert into t4 values (4+0.75);
-insert into t4 values (3);
-insert into t4 values (3+0.33);
-insert into t4 values (3+0.75);
-insert into t4 values (2);
-insert into t4 values (2+0.33);
-insert into t4 values (2+0.75);
-insert into t4 values (1);
-insert into t4 values (1+0.33);
-insert into t4 values (1+0.75);
-select count(*) from t4;
-count(*)
-27
-select * from t4;
-a
-1
-1.33
-1.75
-2
-2.33
-2.75
-3
-3.33
-3.75
-4
-4.33
-4.75
-5
-5.33
-5.75
-6
-6.33
-6.75
-7
-7.33
-7.75
-8
-8.33
-8.75
-9
-9.33
-9.75
-drop table t4;
diff --git a/mysql-test/suite/parts/r/partition_syntax_innodb.result b/mysql-test/suite/parts/r/partition_syntax_innodb.result
index d64bfdde239..c6fb2d38e4c 100644
--- a/mysql-test/suite/parts/r/partition_syntax_innodb.result
+++ b/mysql-test/suite/parts/r/partition_syntax_innodb.result
@@ -620,7 +620,7 @@ PARTITION BY RANGE(f_int1)
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
-# 3.5.1.2 VALUE LESS THAN (CAST(NULL AS SIGNED INTEGER)) is not allowed
+# 3.5.1.2 VALUE LESS THAN (NULL) is not allowed
CREATE TABLE t1 (
f_int1 INTEGER,
f_int2 INTEGER,
@@ -629,7 +629,7 @@ f_char2 CHAR(20),
f_charbig VARCHAR(1000)
)
PARTITION BY RANGE(f_int1)
-( PARTITION part1 VALUES LESS THAN (CAST(NULL AS SIGNED INTEGER)),
+( 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
@@ -647,7 +647,7 @@ PARTITION BY LIST(MOD(f_int1,2))
PARTITION part2 VALUES IN (0),
PARTITION part3 VALUES IN (1));
DROP TABLE t1;
-# 3.5.2.2 VALUE IN (CAST(NULL AS SIGNED INTEGER))
+# 3.5.2.2 VALUE IN (NULL)
CREATE TABLE t1 (
f_int1 INTEGER,
f_int2 INTEGER,
@@ -656,7 +656,7 @@ f_char2 CHAR(20),
f_charbig VARCHAR(1000)
)
PARTITION BY LIST(MOD(f_int1,2))
-( PARTITION part1 VALUES IN (CAST(NULL AS SIGNED INTEGER)),
+( PARTITION part1 VALUES IN (NULL),
PARTITION part3 VALUES IN (1));
create_command
SHOW CREATE TABLE t1;
@@ -679,7 +679,7 @@ f_char2 CHAR(20),
f_charbig VARCHAR(1000)
)
PARTITION BY LIST(MOD(f_int1,2))
-( PARTITION part1 VALUES IN (CAST(NULL AS SIGNED INTEGER)),
+( PARTITION part1 VALUES IN (NULL),
PARTITION part2 VALUES IN (0),
PARTITION part3 VALUES IN (1));
create_command
diff --git a/mysql-test/suite/parts/r/partition_syntax_myisam.result b/mysql-test/suite/parts/r/partition_syntax_myisam.result
index 34f771ba51d..49a7b155a58 100644
--- a/mysql-test/suite/parts/r/partition_syntax_myisam.result
+++ b/mysql-test/suite/parts/r/partition_syntax_myisam.result
@@ -620,7 +620,7 @@ PARTITION BY RANGE(f_int1)
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
-# 3.5.1.2 VALUE LESS THAN (CAST(NULL AS SIGNED INTEGER)) is not allowed
+# 3.5.1.2 VALUE LESS THAN (NULL) is not allowed
CREATE TABLE t1 (
f_int1 INTEGER,
f_int2 INTEGER,
@@ -629,7 +629,7 @@ f_char2 CHAR(20),
f_charbig VARCHAR(1000)
)
PARTITION BY RANGE(f_int1)
-( PARTITION part1 VALUES LESS THAN (CAST(NULL AS SIGNED INTEGER)),
+( 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
@@ -647,7 +647,7 @@ PARTITION BY LIST(MOD(f_int1,2))
PARTITION part2 VALUES IN (0),
PARTITION part3 VALUES IN (1));
DROP TABLE t1;
-# 3.5.2.2 VALUE IN (CAST(NULL AS SIGNED INTEGER))
+# 3.5.2.2 VALUE IN (NULL)
CREATE TABLE t1 (
f_int1 INTEGER,
f_int2 INTEGER,
@@ -656,7 +656,7 @@ f_char2 CHAR(20),
f_charbig VARCHAR(1000)
)
PARTITION BY LIST(MOD(f_int1,2))
-( PARTITION part1 VALUES IN (CAST(NULL AS SIGNED INTEGER)),
+( PARTITION part1 VALUES IN (NULL),
PARTITION part3 VALUES IN (1));
create_command
SHOW CREATE TABLE t1;
@@ -687,7 +687,7 @@ f_char2 CHAR(20),
f_charbig VARCHAR(1000)
)
PARTITION BY LIST(MOD(f_int1,2))
-( PARTITION part1 VALUES IN (CAST(NULL AS SIGNED INTEGER)),
+( PARTITION part1 VALUES IN (NULL),
PARTITION part2 VALUES IN (0),
PARTITION part3 VALUES IN (1));
create_command
diff --git a/mysql-test/suite/parts/r/rpl_partition.result b/mysql-test/suite/parts/r/rpl_partition.result
new file mode 100644
index 00000000000..79a95fd613b
--- /dev/null
+++ b/mysql-test/suite/parts/r/rpl_partition.result
@@ -0,0 +1,173 @@
+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;
+SET GLOBAL binlog_format = 'ROW';
+SET SESSION binlog_format = 'ROW';
+select @@global.binlog_format, @@session.binlog_format;
+@@global.binlog_format ROW
+@@session.binlog_format ROW
+DROP TABLE IF EXISTS t1, t2, t3;
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p2;
+DROP PROCEDURE IF EXISTS p3;
+CREATE TABLE t1(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+fkid MEDIUMINT, filler VARCHAR(255),
+PRIMARY KEY(id)) ENGINE='innodb';
+CREATE TABLE t2(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+fkid MEDIUMINT, filler VARCHAR(255),
+PRIMARY KEY(id)) ENGINE='innodb'
+PARTITION BY KEY(id) partitions 5;
+CREATE TABLE t3(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+fkid MEDIUMINT, filler VARCHAR(255),
+PRIMARY KEY(id)) ENGINE='innodb'
+PARTITION BY RANGE(id)
+SUBPARTITION BY hash(id) subpartitions 2
+(PARTITION pa1 values less than (10),
+PARTITION pa2 values less than (20),
+PARTITION pa3 values less than (30),
+PARTITION pa4 values less than (40),
+PARTITION pa5 values less than (50),
+PARTITION pa6 values less than (60),
+PARTITION pa7 values less than (70),
+PARTITION pa8 values less than (80),
+PARTITION pa9 values less than (90),
+PARTITION pa10 values less than (100),
+PARTITION pa11 values less than MAXVALUE);
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE ins_count INT DEFAULT 1000;
+DECLARE del_count INT;
+DECLARE cur_user VARCHAR(255);
+DECLARE local_uuid VARCHAR(255);
+DECLARE local_time TIMESTAMP;
+SET local_time= NOW();
+SET cur_user= CURRENT_USER();
+SET local_uuid= UUID();
+WHILE ins_count > 0 DO
+INSERT INTO t1 VALUES (NULL, NOW(), USER() , UUID(),
+ins_count,'Going to test MBR for MySQL');
+SET ins_count = ins_count - 1;
+END WHILE;
+SELECT MAX(id) FROM t1 INTO del_count;
+WHILE del_count > 0 DO
+DELETE FROM t1 WHERE id = del_count;
+SET del_count = del_count - 2;
+END WHILE;
+END|
+CREATE PROCEDURE p2()
+BEGIN
+DECLARE ins_count INT DEFAULT 1000;
+DECLARE del_count INT;
+DECLARE cur_user VARCHAR(255);
+DECLARE local_uuid VARCHAR(255);
+DECLARE local_time TIMESTAMP;
+SET local_time= NOW();
+SET cur_user= CURRENT_USER();
+SET local_uuid= UUID();
+WHILE ins_count > 0 DO
+INSERT INTO t2 VALUES (NULL, NOW(), USER() , UUID(),
+ins_count,'Going to test MBR for MySQL');
+SET ins_count = ins_count - 1;
+END WHILE;
+SELECT MAX(id) FROM t2 INTO del_count;
+WHILE del_count > 0 DO
+DELETE FROM t2 WHERE id = del_count;
+SET del_count = del_count - 2;
+END WHILE;
+END|
+CREATE PROCEDURE p3()
+BEGIN
+DECLARE ins_count INT DEFAULT 1000;
+DECLARE del_count INT;
+DECLARE cur_user VARCHAR(255);
+DECLARE local_uuid VARCHAR(255);
+DECLARE local_time TIMESTAMP;
+SET local_time= NOW();
+SET cur_user = CURRENT_USER();
+SET local_uuid=UUID();
+WHILE ins_count > 0 DO
+INSERT INTO t3 VALUES (NULL, NOW(), USER(), UUID(),
+ins_count,'Going to test MBR for MySQL');
+SET ins_count = ins_count - 1;
+END WHILE;
+SELECT MAX(id) FROM t3 INTO del_count;
+WHILE del_count > 0 DO
+DELETE FROM t3 WHERE id = del_count;
+SET del_count = del_count - 2;
+END WHILE;
+END|
+CALL p1();
+SELECT count(*) as "Master regular" FROM t1;
+Master regular 500
+CALL p2();
+SELECT count(*) as "Master bykey" FROM t2;
+Master bykey 500
+CALL p3();
+SELECT count(*) as "Master byrange" FROM t3;
+Master byrange 500
+show create table t3;
+Table t3
+Create Table CREATE TABLE `t3` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `user` char(255) DEFAULT NULL,
+ `uuidf` longblob,
+ `fkid` mediumint(9) DEFAULT NULL,
+ `filler` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (id) SUBPARTITION BY HASH (id) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION pa2 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION pa3 VALUES LESS THAN (30) ENGINE = MyISAM, PARTITION pa4 VALUES LESS THAN (40) ENGINE = MyISAM, PARTITION pa5 VALUES LESS THAN (50) ENGINE = MyISAM, PARTITION pa6 VALUES LESS THAN (60) ENGINE = MyISAM, PARTITION pa7 VALUES LESS THAN (70) ENGINE = MyISAM, PARTITION pa8 VALUES LESS THAN (80) ENGINE = MyISAM, PARTITION pa9 VALUES LESS THAN (90) ENGINE = MyISAM, PARTITION pa10 VALUES LESS THAN (100) ENGINE = MyISAM, PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+show slave status;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_MYPORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+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 #
+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
+SELECT count(*) "Slave norm" FROM t1;
+Slave norm 500
+SELECT count(*) "Slave bykey" FROM t2;
+Slave bykey 500
+SELECT count(*) "Slave byrange" FROM t3;
+Slave byrange 500
+DROP TABLE t1, t2, t3;
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p2;
+DROP PROCEDURE IF EXISTS p3;
diff --git a/mysql-test/suite/parts/t/disabled.def b/mysql-test/suite/parts/t/disabled.def
index 212ca0206e2..1b70519b72c 100644
--- a/mysql-test/suite/parts/t/disabled.def
+++ b/mysql-test/suite/parts/t/disabled.def
@@ -6,6 +6,8 @@ ndb_partition_range : cannot create t1
partition_bit_ndb : cannot create t1
partition_int_ndb : cannot create t1
partition_syntax_ndb : cannot create t1
+partition_value_myisam : Bug#30581 partition_value tests use disallowed CAST() function
+partition_value_innodb : Bug#30581 partition_value tests use disallowed CAST() function
partition_value_ndb : cannot create t1
partition_basic_ndb : cannot create t1
partition_alter1_ndb : timeout. Needs too much time.
@@ -13,4 +15,6 @@ partition_alter2_ndb : cannot create t1
partition_char_innodb : crash. Bug? More investigations
partition_sessions : needs system_3_init.inc
partition_engine_ndb : cannot create t1
-partition_supported_sql_func_ndb : cannot create t1
+part_supported_sql_func_ndb : cannot create t1
+rpl_ndb_dd_partitions : cannot create t1
+partition_float_innodb : Bug#30583 Partition on DOUBLE key + INNODB + count(*) == crash
diff --git a/mysql-test/suite/parts/t/partition_char_innodb.test b/mysql-test/suite/parts/t/partition_char_innodb.test
index d0389517927..27295084de4 100644
--- a/mysql-test/suite/parts/t/partition_char_innodb.test
+++ b/mysql-test/suite/parts/t/partition_char_innodb.test
@@ -36,6 +36,7 @@ let $debug= 0;
##### Storage engine to be tested
let $engine= 'InnoDB';
+--source include/have_innodb.inc
##### max rows to be inserted
let $maxrows=65535;
diff --git a/mysql-test/suite/parts/t/partition_datetime_innodb.test b/mysql-test/suite/parts/t/partition_datetime_innodb.test
index fe19e2803c5..eba0bc3e10b 100644
--- a/mysql-test/suite/parts/t/partition_datetime_innodb.test
+++ b/mysql-test/suite/parts/t/partition_datetime_innodb.test
@@ -36,6 +36,7 @@ let $debug= 0;
##### Storage engine to be tested
let $engine= 'InnoDB';
+--source include/have_innodb.inc
##### max rows to be inserted
let $maxrows=1024;
diff --git a/mysql-test/suite/parts/t/partition_decimal_innodb.test b/mysql-test/suite/parts/t/partition_decimal_innodb.test
index ec5948097c8..22e759ec5d9 100644
--- a/mysql-test/suite/parts/t/partition_decimal_innodb.test
+++ b/mysql-test/suite/parts/t/partition_decimal_innodb.test
@@ -36,6 +36,8 @@ let $debug= 0;
##### Storage engine to be tested
let $engine= 'InnoDB';
+--source include/have_innodb.inc
+
##### number of rows to be inserted
let $maxrows=1024;
diff --git a/mysql-test/suite/parts/t/partition_float_innodb.test b/mysql-test/suite/parts/t/partition_float_innodb.test
index b36dc0668a6..3395d1812d2 100644
--- a/mysql-test/suite/parts/t/partition_float_innodb.test
+++ b/mysql-test/suite/parts/t/partition_float_innodb.test
@@ -36,6 +36,8 @@ let $debug= 0;
##### Storage engine to be tested
let $engine= 'InnoDB';
+--source include/have_innodb.inc
+
##### Number of row to be inserted.
let $maxrows=1024;
diff --git a/mysql-test/suite/parts/t/partition_int_innodb.test b/mysql-test/suite/parts/t/partition_int_innodb.test
index fda7398565c..dc14b369654 100644
--- a/mysql-test/suite/parts/t/partition_int_innodb.test
+++ b/mysql-test/suite/parts/t/partition_int_innodb.test
@@ -36,6 +36,7 @@ let $debug= 0;
##### Storage engine to be tested
let $engine= 'InnoDB';
+--source include/have_innodb.inc
##### max rows to be inserted
let $maxrows=1024;
diff --git a/mysql-test/suite/parts/t/partition_special_innodb.test b/mysql-test/suite/parts/t/partition_special_innodb.test
index 5df518a3952..f552d64f4e4 100644
--- a/mysql-test/suite/parts/t/partition_special_innodb.test
+++ b/mysql-test/suite/parts/t/partition_special_innodb.test
@@ -36,6 +36,7 @@ let $debug= 0;
##### Storage engine to be tested
let $engine= 'InnoDB';
+--source include/have_innodb.inc
#------------------------------------------------------------------------------#
# Execute the tests to be applied to all storage engines
diff --git a/mysql-test/suite/parts/t/rpl_partition.test b/mysql-test/suite/parts/t/rpl_partition.test
new file mode 100644
index 00000000000..f1002ded81f
--- /dev/null
+++ b/mysql-test/suite/parts/t/rpl_partition.test
@@ -0,0 +1,161 @@
+--source include/have_partition.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+
+--vertical_results
+
+let $engine_type= 'innodb';
+
+SET GLOBAL binlog_format = 'ROW';
+SET SESSION binlog_format = 'ROW';
+select @@global.binlog_format, @@session.binlog_format;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2, t3;
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p2;
+DROP PROCEDURE IF EXISTS p3;
+--enable_warnings
+
+eval CREATE TABLE t1(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+ fkid MEDIUMINT, filler VARCHAR(255),
+ PRIMARY KEY(id)) ENGINE=$engine_type;
+
+eval CREATE TABLE t2(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+ fkid MEDIUMINT, filler VARCHAR(255),
+ PRIMARY KEY(id)) ENGINE=$engine_type
+ PARTITION BY KEY(id) partitions 5;
+
+eval CREATE TABLE t3(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+ fkid MEDIUMINT, filler VARCHAR(255),
+ PRIMARY KEY(id)) ENGINE=$engine_type
+ PARTITION BY RANGE(id)
+ SUBPARTITION BY hash(id) subpartitions 2
+ (PARTITION pa1 values less than (10),
+ PARTITION pa2 values less than (20),
+ PARTITION pa3 values less than (30),
+ PARTITION pa4 values less than (40),
+ PARTITION pa5 values less than (50),
+ PARTITION pa6 values less than (60),
+ PARTITION pa7 values less than (70),
+ PARTITION pa8 values less than (80),
+ PARTITION pa9 values less than (90),
+ PARTITION pa10 values less than (100),
+ PARTITION pa11 values less than MAXVALUE);
+
+######## Create SPs, Functions, Views and Triggers Section ##############
+
+delimiter |;
+CREATE PROCEDURE p1()
+BEGIN
+ DECLARE ins_count INT DEFAULT 1000;
+ DECLARE del_count INT;
+ DECLARE cur_user VARCHAR(255);
+ DECLARE local_uuid VARCHAR(255);
+ DECLARE local_time TIMESTAMP;
+
+ SET local_time= NOW();
+ SET cur_user= CURRENT_USER();
+ SET local_uuid= UUID();
+
+ WHILE ins_count > 0 DO
+ INSERT INTO t1 VALUES (NULL, NOW(), USER() , UUID(),
+ ins_count,'Going to test MBR for MySQL');
+ SET ins_count = ins_count - 1;
+ END WHILE;
+
+ SELECT MAX(id) FROM t1 INTO del_count;
+ WHILE del_count > 0 DO
+ DELETE FROM t1 WHERE id = del_count;
+ SET del_count = del_count - 2;
+ END WHILE;
+END|
+
+CREATE PROCEDURE p2()
+BEGIN
+ DECLARE ins_count INT DEFAULT 1000;
+ DECLARE del_count INT;
+ DECLARE cur_user VARCHAR(255);
+ DECLARE local_uuid VARCHAR(255);
+ DECLARE local_time TIMESTAMP;
+
+ SET local_time= NOW();
+ SET cur_user= CURRENT_USER();
+ SET local_uuid= UUID();
+
+ WHILE ins_count > 0 DO
+ INSERT INTO t2 VALUES (NULL, NOW(), USER() , UUID(),
+ ins_count,'Going to test MBR for MySQL');
+ SET ins_count = ins_count - 1;
+ END WHILE;
+
+ SELECT MAX(id) FROM t2 INTO del_count;
+ WHILE del_count > 0 DO
+ DELETE FROM t2 WHERE id = del_count;
+ SET del_count = del_count - 2;
+ END WHILE;
+END|
+
+CREATE PROCEDURE p3()
+BEGIN
+ DECLARE ins_count INT DEFAULT 1000;
+ DECLARE del_count INT;
+ DECLARE cur_user VARCHAR(255);
+ DECLARE local_uuid VARCHAR(255);
+ DECLARE local_time TIMESTAMP;
+
+ SET local_time= NOW();
+ SET cur_user = CURRENT_USER();
+ SET local_uuid=UUID();
+
+ WHILE ins_count > 0 DO
+ INSERT INTO t3 VALUES (NULL, NOW(), USER(), UUID(),
+ ins_count,'Going to test MBR for MySQL');
+ SET ins_count = ins_count - 1;
+ END WHILE;
+
+ SELECT MAX(id) FROM t3 INTO del_count;
+ WHILE del_count > 0 DO
+ DELETE FROM t3 WHERE id = del_count;
+ SET del_count = del_count - 2;
+ END WHILE;
+END|
+
+delimiter ;|
+
+############ Finish Setup Section ###################
+
+
+############ Test Section ###################
+
+CALL p1();
+SELECT count(*) as "Master regular" FROM t1;
+CALL p2();
+SELECT count(*) as "Master bykey" FROM t2;
+CALL p3();
+SELECT count(*) as "Master byrange" FROM t3;
+
+#--source include/master-slave-end.inc
+--sync_slave_with_master
+connection slave;
+show create table t3;
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
+--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
+show slave status;
+SELECT count(*) "Slave norm" FROM t1;
+SELECT count(*) "Slave bykey" FROM t2;
+SELECT count(*) "Slave byrange" FROM t3;
+
+connection master;
+DROP TABLE t1, t2, t3;
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p2;
+DROP PROCEDURE IF EXISTS p3;
+save_master_pos;
+connection slave;
+sync_with_master;
+
+# End of 5.1 tests
diff --git a/mysql-test/suite/row_lock/include/row_lock.inc b/mysql-test/suite/row_lock/include/row_lock.inc
deleted file mode 100644
index 8572bc0246e..00000000000
--- a/mysql-test/suite/row_lock/include/row_lock.inc
+++ /dev/null
@@ -1,83 +0,0 @@
---disable_warnings
-DROP TABLE IF EXISTS t1, t2;
---enable_warnings
-SET autocommit=0;
-# Create additional connections used through test
-CONNECT (root1, localhost, root,,);
-SET autocommit=0;
---echo connection default;
-CONNECTION default;
-eval CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-eval $indext1;
-eval CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-eval $indext2;
-COMMIT;
-SELECT @@global.tx_isolation;
-
-# Both transaction are able to update the tables
-eval EXPLAIN $select;
-eval $select;
-
---echo connection root1;
-CONNECTION root1;
-UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-
---echo connection default;
-CONNECTION default;
-UPDATE t1,t2 SET t1.i=223,t2.i=223 WHERE t1.i=123 AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-
---echo connection root1;
-CONNECTION root1;
-UPDATE t1,t2 SET t1.i=226,t2.i=226 WHERE t1.i=126 AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-
---echo connection default;
-CONNECTION default;
-UPDATE t1,t2 SET t1.i=224,t2.i=224 WHERE t1.i=124 AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-
---echo connection root1;
-CONNECTION root1;
-DELETE FROM t1 WHERE t1.i=226;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-
---echo connection default;
-CONNECTION default;
-DELETE FROM t1 WHERE t1.i=224;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-COMMIT;
-
---echo connection root1;
-CONNECTION root1;
-ROLLBACK;
-
---echo connection default;
-CONNECTION default;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-
---echo connection root1;
-CONNECTION root1;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-DISCONNECT root1;
---echo connection default;
-CONNECTION default;
-DROP TABLE t1, t2;
-
diff --git a/mysql-test/suite/row_lock/include/row_lock_big_tab.inc b/mysql-test/suite/row_lock/include/row_lock_big_tab.inc
deleted file mode 100644
index f0823067eac..00000000000
--- a/mysql-test/suite/row_lock/include/row_lock_big_tab.inc
+++ /dev/null
@@ -1,94 +0,0 @@
---disable_warnings
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
---enable_warnings
-SET autocommit=0;
-# Create additional connections used through test
-CONNECT (root1, localhost, root,,);
-SET autocommit=0;
---echo connection default;
-CONNECTION default;
-eval CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
-eval $indext1;
-eval CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
-eval $indext2;
-DELIMITER |;
-CREATE PROCEDURE fill_t1 (IN upb int)
-BEGIN
-DECLARE cnt int DEFAULT 0;
-WHILE cnt < upb DO
- INSERT INTO t1 VALUES (cnt, cnt+100, cnt, cnt+100);
- SET cnt= cnt+1;
-END WHILE;
-END;
-|
-CREATE FUNCTION half_t1() RETURNS int
-BEGIN
- DECLARE res int DEFAULT 0;
- SELECT count(*)/2 INTO res FROM t1;
- RETURN res;
-END;
-|
-CREATE PROCEDURE fill_t2 (IN upb int)
-BEGIN
-DECLARE cnt int DEFAULT 0;
-WHILE cnt < upb DO
- INSERT INTO t2 VALUES (cnt, cnt+100, cnt, cnt+100);
- SET cnt= cnt+1;
-END WHILE;
-END;
-|
-CREATE FUNCTION half_t2() RETURNS int
-BEGIN
- DECLARE res int DEFAULT 0;
- SELECT count(*)/2 INTO res FROM t2;
- RETURN res;
-END;
-|
-DELIMITER ;|
-CALL fill_t1 (10);
-CALL fill_t2 (10);
-COMMIT;
-SELECT @@global.tx_isolation;
-# With the two separate selects (without join) the differs from
-# that select with join.
-
-# Both transaction are able to update the tables
-eval EXPLAIN $select;
-eval $select;
-
---echo connection root1;
-CONNECTION root1;
-SELECT k from t1 WHERE k < half_t1();
-SELECT k from t1 WHERE k >= half_t1();
-UPDATE t1,t2 SET t1.i=1111,t2.i=2222 WHERE t1.k < half_t1() AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-
---echo connection default;
-CONNECTION default;
-UPDATE t1,t2 SET t1.i=3333,t2.i=4444 WHERE t1.k >= half_t1() AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-COMMIT;
-
---echo connection root1;
-CONNECTION root1;
-ROLLBACK;
-
---echo connection default;
-CONNECTION default;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-
---echo connection root1;
-CONNECTION root1;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-DISCONNECT root1;
---echo connection default;
-CONNECTION default;
-DROP VIEW IF EXISTS v1;
-DROP TABLE t1, t2;
-#DROP VIEW v1;
-
diff --git a/mysql-test/suite/row_lock/include/row_lock_big_tab_1.inc b/mysql-test/suite/row_lock/include/row_lock_big_tab_1.inc
deleted file mode 100644
index 8535c016819..00000000000
--- a/mysql-test/suite/row_lock/include/row_lock_big_tab_1.inc
+++ /dev/null
@@ -1,93 +0,0 @@
---disable_warnings
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
---enable_warnings
-SET autocommit=0;
-# Create additional connections used through test
-CONNECT (root1, localhost, root,,);
-SET autocommit=0;
---echo connection default;
-CONNECTION default;
-eval CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
-eval $indext1;
-eval CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
-eval $indext2;
-DELIMITER |;
-CREATE PROCEDURE fill_t1 (IN upb int)
-BEGIN
-DECLARE cnt int DEFAULT 0;
-WHILE cnt < upb DO
- INSERT INTO t1 VALUES (cnt, cnt+100, cnt, cnt+100);
- SET cnt= cnt+1;
-END WHILE;
-END;
-|
-CREATE FUNCTION half_t1() RETURNS int
-BEGIN
- DECLARE res int DEFAULT 0;
- SELECT MOD(k,2) INTO res FROM t1;
- RETURN res;
-END;
-|
-CREATE PROCEDURE fill_t2 (IN upb int)
-BEGIN
-DECLARE cnt int DEFAULT 0;
-WHILE cnt < upb DO
- INSERT INTO t2 VALUES (cnt, cnt+100, cnt, cnt+100);
- SET cnt= cnt+1;
-END WHILE;
-END;
-|
-CREATE FUNCTION half_t2() RETURNS int
-BEGIN
- DECLARE res int DEFAULT 0;
- SELECT MOD(k,2) INTO res FROM t2;
- RETURN res;
-END;
-|
-DELIMITER ;|
-eval CALL fill_t1 ($nbrows);
-eval CALL fill_t2 ($nbrows);
-COMMIT;
-SELECT @@global.tx_isolation;
-# With the two separate selects (without join) the differs from
-# that select with join.
-
-# Both transaction are able to update the tables
-eval EXPLAIN $select;
-eval $select;
-
---echo connection root1;
-CONNECTION root1;
-SELECT t1.i,t2.i FROM t1,t2 WHERE t1.k % 2= 1 AND t1.k = t2.k LOCK IN SHARE MODE;
-UPDATE t1,t2 SET t1.i=1111,t2.i=2222 WHERE t1.k % 2 = 1 AND t1.k = t2.k;
-SELECT * FROM t1 WHERE k < 20 ORDER BY t1.k;
-SELECT * FROM t2 WHERE k < 20 ORDER BY t2.k;
-
---echo connection default;
-CONNECTION default;
-UPDATE t1,t2 SET t1.i=3333,t2.i=4444 WHERE t1.k % 2 = 0 AND t1.k = t2.k;
-SELECT * FROM t1 WHERE k < 20 ORDER BY t1.k;
-SELECT * FROM t2 WHERE k < 20 ORDER BY t2.k;
-
-COMMIT;
-
---echo connection root1;
-CONNECTION root1;
-ROLLBACK;
-
---echo connection default;
-CONNECTION default;
-SELECT * FROM t1 WHERE k < 40 ORDER BY t1.k;
-SELECT * FROM t2 WHERE k < 40 ORDER BY t2.k;
-
---echo connection root1;
-CONNECTION root1;
-SELECT * FROM t1 WHERE k < 40 ORDER BY t1.k;
-SELECT * FROM t2 WHERE k < 40 ORDER BY t2.k;
-DISCONNECT root1;
---echo connection default;
-CONNECTION default;
-DROP TABLE t1, t2;
-
-
diff --git a/mysql-test/suite/row_lock/include/row_lock_big_tab_2.inc b/mysql-test/suite/row_lock/include/row_lock_big_tab_2.inc
deleted file mode 100644
index 050f2a54016..00000000000
--- a/mysql-test/suite/row_lock/include/row_lock_big_tab_2.inc
+++ /dev/null
@@ -1,93 +0,0 @@
---disable_warnings
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
---enable_warnings
-SET autocommit=0;
-# Create additional connections used through test
-CONNECT (root1, localhost, root,,);
-SET autocommit=0;
---echo connection default;
-CONNECTION default;
-eval CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
-eval $indext1;
-eval CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
-eval $indext2;
-DELIMITER |;
-CREATE PROCEDURE fill_t1 (IN upb int)
-BEGIN
-DECLARE cnt int DEFAULT 0;
-WHILE cnt < upb DO
- INSERT INTO t1 VALUES (cnt, cnt+100, cnt, cnt+100);
- SET cnt= cnt+1;
-END WHILE;
-END;
-|
-CREATE FUNCTION half_t1() RETURNS int
-BEGIN
- DECLARE res int DEFAULT 0;
- SELECT MOD(k,2) INTO res FROM t1;
- RETURN res;
-END;
-|
-CREATE PROCEDURE fill_t2 (IN upb int)
-BEGIN
-DECLARE cnt int DEFAULT 0;
-WHILE cnt < upb DO
- INSERT INTO t2 VALUES (cnt, cnt+100, cnt, cnt+100);
- SET cnt= cnt+1;
-END WHILE;
-END;
-|
-CREATE FUNCTION half_t2() RETURNS int
-BEGIN
- DECLARE res int DEFAULT 0;
- SELECT MOD(k,2) INTO res FROM t2;
- RETURN res;
-END;
-|
-DELIMITER ;|
-eval CALL fill_t1 ($nbrows);
-eval CALL fill_t2 ($nbrows);
-COMMIT;
-SELECT @@global.tx_isolation;
-# With the two separate selects (without join) the differs from
-# that select with join.
-
-# Both transaction are able to update the tables
-eval EXPLAIN $select;
-eval $select;
-
---echo connection root1;
-CONNECTION root1;
-#SELECT t1.i,t2.i FROM t1,t2 WHERE t1.k % 2= 1 AND t1.k = t2.k FOR UPDATE;
-DELETE FROM t1 WHERE t1.k % 2 = 1;
-SELECT * FROM t1 WHERE k < 20 ORDER BY t1.k;
-SELECT * FROM t2 WHERE k < 20 ORDER BY t2.k;
-
---echo connection default;
-CONNECTION default;
-UPDATE t1,t2 SET t1.i=3333,t2.i=4444 WHERE t1.k % 2 = 0 AND t1.k = t2.k;
-SELECT * FROM t1 WHERE k < 20 ORDER BY t1.k;
-SELECT * FROM t2 WHERE k < 20 ORDER BY t2.k;
-
-COMMIT;
-
---echo connection root1;
-CONNECTION root1;
-ROLLBACK;
-
---echo connection default;
-CONNECTION default;
-SELECT * FROM t1 WHERE k < 40 ORDER BY t1.k;
-SELECT * FROM t2 WHERE k < 40 ORDER BY t2.k;
-
---echo connection root1;
-CONNECTION root1;
-SELECT * FROM t1 WHERE k < 40 ORDER BY t1.k;
-SELECT * FROM t2 WHERE k < 40 ORDER BY t2.k;
-DISCONNECT root1;
---echo connection default;
-CONNECTION default;
-DROP TABLE t1, t2;
-
-
diff --git a/mysql-test/suite/row_lock/include/row_lock_trig.inc b/mysql-test/suite/row_lock/include/row_lock_trig.inc
deleted file mode 100644
index 384f00f243e..00000000000
--- a/mysql-test/suite/row_lock/include/row_lock_trig.inc
+++ /dev/null
@@ -1,96 +0,0 @@
---disable_warnings
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
---enable_warnings
-SET autocommit=0;
-# Create additional connections used through test
-CONNECT (root1, localhost, root,,);
-SET autocommit=0;
---echo connection default;
-CONNECTION default;
-eval CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-eval $indext1;
-eval CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-eval $indext2;
-DELIMITER |;
-
-CREATE TRIGGER trig_t2 AFTER UPDATE ON t2
- FOR EACH ROW BEGIN
- UPDATE t1 SET l = NEW.i WHERE i = OLD.i;
- END;
-|
-
-DELIMITER ;|
-
-COMMIT;
-SELECT @@global.tx_isolation;
-# With the two separate selects (without join) the differs from
-# that select with join.
-
-# Both transaction are able to update the tables
-eval EXPLAIN $select;
-eval $select;
---echo connection root1;
-CONNECTION root1;
-UPDATE t2 SET t2.i=225 WHERE t2.i=125;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-
---echo connection default;
-CONNECTION default;
-UPDATE t2 SET t2.i=223 WHERE t2.i=123;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-
---echo connection root1;
-CONNECTION root1;
-UPDATE t2 SET t2.i=226 WHERE t2.i=126;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-
---echo connection default;
-CONNECTION default;
-UPDATE t2 SET t2.i=224 WHERE t2.i=124;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-
---echo connection root1;
-CONNECTION root1;
-DELETE FROM t1 WHERE t1.i=226;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-
---echo connection default;
-CONNECTION default;
-DELETE FROM t1 WHERE t1.i=224;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-COMMIT;
-
---echo connection root1;
-CONNECTION root1;
-ROLLBACK;
-
---echo connection default;
-CONNECTION default;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-
---echo connection root1;
-CONNECTION root1;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-DISCONNECT root1;
---echo connection default;
-CONNECTION default;
-DROP TABLE t1, t2;
-#DROP VIEW v1;
-
diff --git a/mysql-test/suite/row_lock/include/row_lock_view.inc b/mysql-test/suite/row_lock/include/row_lock_view.inc
deleted file mode 100644
index fbed8f64d3a..00000000000
--- a/mysql-test/suite/row_lock/include/row_lock_view.inc
+++ /dev/null
@@ -1,89 +0,0 @@
---disable_warnings
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
---enable_warnings
-SET autocommit=0;
-# Create additional connections used through test
-CONNECT (root1, localhost, root,,);
-SET autocommit=0;
---echo connection default;
-CONNECTION default;
-eval CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-eval $indext1;
-eval CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-eval $indext2;
-CREATE VIEW v1 AS SELECT t1.i, t2.l from t1,t2;
-COMMIT;
-SELECT @@global.tx_isolation;
-# With the two separate selects (without join) the differs from
-# that select with join.
-
-# Both transaction are able to update the tables
-eval EXPLAIN $select;
-eval $select;
-
---echo connection root1;
-CONNECTION root1;
-UPDATE v1 SET i=325 where i=125;
-SELECT * FROM v1 ORDER BY i,l;
-SELECT * FROM t1 ORDER BY t1.k;
-
---echo connection default;
-CONNECTION default;
-UPDATE v1 SET i=323 where i=123;
-SELECT * FROM v1 ORDER BY i,l;
-SELECT * FROM t1 ORDER BY t1.k;
-
---echo connection root1;
-CONNECTION root1;
-UPDATE v1 SET i=326 where i=126;
-SELECT * FROM v1 ORDER BY i,l;
-SELECT * FROM t1 ORDER BY t1.k;
-
---echo connection default;
-CONNECTION default;
-UPDATE v1 SET i=324 where i=124;
-SELECT * FROM v1 ORDER BY i,l;
-SELECT * FROM t1 ORDER BY t1.k;
-
---echo connection root1;
-CONNECTION root1;
-DELETE FROM t1 WHERE t1.i=226;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-
---echo connection default;
-CONNECTION default;
-DELETE FROM t1 WHERE t1.i=224;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-COMMIT;
-
---echo connection root1;
-CONNECTION root1;
-ROLLBACK;
-
---echo connection default;
-CONNECTION default;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-
---echo connection root1;
-CONNECTION root1;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-DISCONNECT root1;
---echo connection default;
-CONNECTION default;
-DROP VIEW IF EXISTS v1;
-DROP TABLE t1, t2;
-#DROP VIEW v1;
-
diff --git a/mysql-test/suite/row_lock/include/row_lock_view_mix.inc b/mysql-test/suite/row_lock/include/row_lock_view_mix.inc
deleted file mode 100644
index 9e8cf3d34fc..00000000000
--- a/mysql-test/suite/row_lock/include/row_lock_view_mix.inc
+++ /dev/null
@@ -1,92 +0,0 @@
---disable_warnings
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
---enable_warnings
-SET autocommit=0;
-# Create additional connections used through test
-CONNECT (root1, localhost, root,,);
-SET autocommit=0;
---echo connection default;
-CONNECTION default;
-eval CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-eval $indext1;
-eval CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-eval $indext2;
-CREATE VIEW v1 AS SELECT t1.i, t2.l from t1,t2;
-COMMIT;
-SELECT @@global.tx_isolation;
-# With the two separate selects (without join) the differs from
-# that select with join.
-
-# Both transaction are able to update the tables
-eval EXPLAIN $select;
-eval $select;
-
---echo connection root1;
-CONNECTION root1;
-UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-#UPDATE v1 SET i=325 where i=125;
-#SELECT * FROM v1 ORDER BY i,l;
-#SELECT * FROM t1 ORDER BY t1.k;
-
---echo connection default;
-CONNECTION default;
-UPDATE v1 SET i=323 where i=123;
-SELECT * FROM v1 ORDER BY i,l;
-SELECT * FROM t1 ORDER BY t1.k;
-
---echo connection root1;
-CONNECTION root1;
-UPDATE t1,t2 SET t1.i=226,t2.i=226 WHERE t1.i=126 AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-
---echo connection default;
-CONNECTION default;
-UPDATE v1 SET i=324 where i=124;
-SELECT * FROM v1 ORDER BY i,l;
-SELECT * FROM t1 ORDER BY t1.k;
-
---echo connection root1;
-CONNECTION root1;
-DELETE FROM t1 WHERE t1.i=226;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-
---echo connection default;
-CONNECTION default;
-DELETE FROM t1 WHERE t1.i=224;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-COMMIT;
-
---echo connection root1;
-CONNECTION root1;
-ROLLBACK;
-
---echo connection default;
-CONNECTION default;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-
---echo connection root1;
-CONNECTION root1;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-DISCONNECT root1;
---echo connection default;
-CONNECTION default;
-DROP VIEW IF EXISTS v1;
-DROP TABLE t1, t2;
-#DROP VIEW v1;
-
diff --git a/mysql-test/suite/row_lock/include/row_lock_view_storedp.inc b/mysql-test/suite/row_lock/include/row_lock_view_storedp.inc
deleted file mode 100644
index 479392098be..00000000000
--- a/mysql-test/suite/row_lock/include/row_lock_view_storedp.inc
+++ /dev/null
@@ -1,126 +0,0 @@
---disable_warnings
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
-DROP PROCEDURE IF EXISTS stp_t;
---enable_warnings
-SET autocommit=0;
-# Create additional connections used through test
-CONNECT (root1, localhost, root,,);
-SET autocommit=0;
-CONNECT (root2, localhost, root,,);
-SET autocommit=0;
---echo connection default;
-CONNECTION default;
-eval CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-INSERT INTO t1 VALUES (5,127,5,127);
-INSERT INTO t1 VALUES (6,128,6,128);
-eval $indext1;
-eval CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-INSERT INTO t2 VALUES (5,127,5,127);
-INSERT INTO t2 VALUES (6,128,6,128);
-eval $indext2;
-CREATE VIEW v1 AS SELECT t1.i from t1;
-DELIMITER |;
-
-CREATE PROCEDURE stp_t (IN p1 int, IN p2 int) MODIFIES SQL DATA
- BEGIN
- UPDATE t2 SET i = p2 WHERE i = p1;
- UPDATE v1 SET i = p2 WHERE i = p1;
- SELECT * FROM v1 ORDER BY i;
- SELECT * FROM t1 ORDER BY t1.k;
- SELECT * FROM t2 ORDER BY t2.k;
- END;
-|
-
-DELIMITER ;|
-
-COMMIT;
-SELECT @@global.tx_isolation;
-eval EXPLAIN $select;
-eval $select;
---echo connection root1;
-CONNECTION root1;
-CALL stp_t (125, 225);
-
---echo connection root2;
-CONNECTION root2;
-CALL stp_t (127, 227);
-
---echo connection default;
-CONNECTION default;
-CALL stp_t (123, 223);
-
---echo connection root1;
-CONNECTION root1;
-CALL stp_t (126, 226);
-
---echo connection root2;
-CONNECTION root2;
-CALL stp_t (128, 228);
-
---echo connection default;
-CONNECTION default;
-CALL stp_t (124, 224);
-
---echo connection root1;
-CONNECTION root1;
-DELETE FROM t1 WHERE t1.i=226;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-
---echo connection root2;
-CONNECTION root2;
-DELETE FROM t1 WHERE t1.i=228;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-
---echo connection default;
-CONNECTION default;
-DELETE FROM t1 WHERE t1.i=224;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-COMMIT;
-
---echo connection root1;
-CONNECTION root1;
-ROLLBACK;
-
---echo connection root1;
-CONNECTION root1;
-COMMIT;
-
---echo connection default;
-CONNECTION default;
-SELECT * FROM v1 ORDER BY i;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-
---echo connection root1;
-CONNECTION root1;
-SELECT * FROM v1 ORDER BY i;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-DISCONNECT root1;
-
---echo connection root2;
-CONNECTION root2;
-SELECT * FROM v1 ORDER BY i;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-DISCONNECT root2;
-
---echo connection default;
-CONNECTION default;
---disable_warnings
-DROP VIEW v1;
-DROP PROCEDURE stp_t;
-DROP TABLE t1, t2;
---enable_warnings
diff --git a/mysql-test/suite/row_lock/include/row_lock_view_trig.inc b/mysql-test/suite/row_lock/include/row_lock_view_trig.inc
deleted file mode 100644
index 785eb1b66a9..00000000000
--- a/mysql-test/suite/row_lock/include/row_lock_view_trig.inc
+++ /dev/null
@@ -1,99 +0,0 @@
---disable_warnings
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
---enable_warnings
-SET autocommit=0;
-# Create additional connections used through test
-CONNECT (root1, localhost, root,,);
-SET autocommit=0;
---echo connection default;
-CONNECTION default;
-eval CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-eval $indext1;
-eval CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-eval $indext2;
-CREATE VIEW v1 AS SELECT t1.i from t1;
-DELIMITER |;
-
-CREATE TRIGGER trig_t2 AFTER UPDATE ON t2
- FOR EACH ROW BEGIN
- UPDATE v1 SET i = NEW.i WHERE i = OLD.i;
- END;
-|
-
-DELIMITER ;|
-
-COMMIT;
-SELECT @@global.tx_isolation;
-eval EXPLAIN $select;
-eval $select;
---echo connection root1;
-CONNECTION root1;
-UPDATE t2 SET t2.i=225 WHERE t2.i=125;
-SELECT * FROM v1 ORDER BY i;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-
---echo connection default;
-CONNECTION default;
-UPDATE t2 SET t2.i=223 WHERE t2.i=123;
-SELECT * FROM v1 ORDER BY i;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-
---echo connection root1;
-CONNECTION root1;
-UPDATE t2 SET t2.i=226 WHERE t2.i=126;
-SELECT * FROM v1 ORDER BY i;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-
---echo connection default;
-CONNECTION default;
-UPDATE t2 SET t2.i=224 WHERE t2.i=124;
-SELECT * FROM v1 ORDER BY i;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-
---echo connection root1;
-CONNECTION root1;
-DELETE FROM t1 WHERE t1.i=226;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-
---echo connection default;
-CONNECTION default;
-DELETE FROM t1 WHERE t1.i=224;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-COMMIT;
-
---echo connection root1;
-CONNECTION root1;
-ROLLBACK;
-
---echo connection default;
-CONNECTION default;
-SELECT * FROM v1 ORDER BY i;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-
---echo connection root1;
-CONNECTION root1;
-SELECT * FROM v1 ORDER BY i;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-DISCONNECT root1;
---echo connection default;
-CONNECTION default;
-DROP TABLE t1, t2;
-DROP VIEW v1;
-
diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_1.result b/mysql-test/suite/row_lock/r/innodb_row_lock_1.result
deleted file mode 100644
index 54ed4350ba9..00000000000
--- a/mysql-test/suite/row_lock/r/innodb_row_lock_1.result
+++ /dev/null
@@ -1,142 +0,0 @@
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-DROP TABLE IF EXISTS t1, t2;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t2 (i);
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index ixi ixi 5 NULL 4 Using where; Using index
-1 SIMPLE t2 ref ixi ixi 5 test.t1.i 2 Using where; Using index
-SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
-i i
-123 123
-124 124
-connection root1;
-UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 126 4 126
-connection default;
-UPDATE t1,t2 SET t1.i=223,t2.i=223 WHERE t1.i=123 AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-UPDATE t1,t2 SET t1.i=226,t2.i=226 WHERE t1.i=126 AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-connection default;
-UPDATE t1,t2 SET t1.i=224,t2.i=224 WHERE t1.i=124 AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-DELETE FROM t1 WHERE t1.i=226;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-connection default;
-DELETE FROM t1 WHERE t1.i=224;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-COMMIT;
-connection root1;
-ROLLBACK;
-connection default;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-connection default;
-DROP TABLE t1, t2;
-SET @@global.innodb_table_locks= @table_locks;
diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_2.result b/mysql-test/suite/row_lock/r/innodb_row_lock_2.result
deleted file mode 100644
index 56154e64489..00000000000
--- a/mysql-test/suite/row_lock/r/innodb_row_lock_2.result
+++ /dev/null
@@ -1,32 +0,0 @@
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-DROP TABLE IF EXISTS t1, t2;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-#CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-#CREATE INDEX ixi ON t2 (i);
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
-1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where
-SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
-i i
-123 123
-124 124
-connection root1;
-UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_3.result b/mysql-test/suite/row_lock/r/innodb_row_lock_3.result
deleted file mode 100644
index a89c55973d2..00000000000
--- a/mysql-test/suite/row_lock/r/innodb_row_lock_3.result
+++ /dev/null
@@ -1,32 +0,0 @@
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-DROP TABLE IF EXISTS t1, t2;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-#CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-#CREATE INDEX ixi ON t2 (i);
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
-1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where
-SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE;
-i i
-123 123
-124 124
-connection root1;
-UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_4.result b/mysql-test/suite/row_lock/r/innodb_row_lock_4.result
deleted file mode 100644
index 310d24a456a..00000000000
--- a/mysql-test/suite/row_lock/r/innodb_row_lock_4.result
+++ /dev/null
@@ -1,142 +0,0 @@
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-DROP TABLE IF EXISTS t1, t2;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t2 (i);
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index ixi ixi 5 NULL 4 Using where; Using index
-1 SIMPLE t2 ref ixi ixi 5 test.t1.i 2 Using where; Using index
-SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE;
-i i
-123 123
-124 124
-connection root1;
-UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 126 4 126
-connection default;
-UPDATE t1,t2 SET t1.i=223,t2.i=223 WHERE t1.i=123 AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-UPDATE t1,t2 SET t1.i=226,t2.i=226 WHERE t1.i=126 AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-connection default;
-UPDATE t1,t2 SET t1.i=224,t2.i=224 WHERE t1.i=124 AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-DELETE FROM t1 WHERE t1.i=226;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-connection default;
-DELETE FROM t1 WHERE t1.i=224;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-COMMIT;
-connection root1;
-ROLLBACK;
-connection default;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-connection default;
-DROP TABLE t1, t2;
-SET @@global.innodb_table_locks= @table_locks;
diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_5.result b/mysql-test/suite/row_lock/r/innodb_row_lock_5.result
deleted file mode 100644
index ace5fddfad5..00000000000
--- a/mysql-test/suite/row_lock/r/innodb_row_lock_5.result
+++ /dev/null
@@ -1,32 +0,0 @@
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-DROP TABLE IF EXISTS t1, t2;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t2 (i);
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i,t2.i FROM t1 ignore index (ixi),t2 IGNORE INDEX (ixi) WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
-1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where
-SELECT t1.i,t2.i FROM t1 ignore index (ixi),t2 IGNORE INDEX (ixi) WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE;
-i i
-123 123
-124 124
-connection root1;
-UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_big_tab.result b/mysql-test/suite/row_lock/r/innodb_row_lock_big_tab.result
deleted file mode 100644
index 8f00c3a0bb7..00000000000
--- a/mysql-test/suite/row_lock/r/innodb_row_lock_big_tab.result
+++ /dev/null
@@ -1,97 +0,0 @@
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-CREATE INDEX ixi ON t2 (i);
-CREATE PROCEDURE fill_t1 (IN upb int)
-BEGIN
-DECLARE cnt int DEFAULT 0;
-WHILE cnt < upb DO
-INSERT INTO t1 VALUES (cnt, cnt+100, cnt, cnt+100);
-SET cnt= cnt+1;
-END WHILE;
-END;
-|
-CREATE FUNCTION half_t1() RETURNS int
-BEGIN
-DECLARE res int DEFAULT 0;
-SELECT count(*)/2 INTO res FROM t1;
-RETURN res;
-END;
-|
-CREATE PROCEDURE fill_t2 (IN upb int)
-BEGIN
-DECLARE cnt int DEFAULT 0;
-WHILE cnt < upb DO
-INSERT INTO t2 VALUES (cnt, cnt+100, cnt, cnt+100);
-SET cnt= cnt+1;
-END WHILE;
-END;
-|
-CREATE FUNCTION half_t2() RETURNS int
-BEGIN
-DECLARE res int DEFAULT 0;
-SELECT count(*)/2 INTO res FROM t2;
-RETURN res;
-END;
-|
-CALL fill_t1 (10);
-CALL fill_t2 (10);
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i < half_t1() AND t2.i=t1.i LOCK IN SHARE MODE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index ixi ixi 5 NULL 10 Using where; Using index
-1 SIMPLE t2 ref ixi ixi 5 test.t1.i 1 Using where; Using index
-SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i < half_t1() AND t2.i=t1.i LOCK IN SHARE MODE;
-i i
-connection root1;
-SELECT k from t1 WHERE k < half_t1();
-k
-0
-1
-2
-3
-4
-SELECT k from t1 WHERE k >= half_t1();
-k
-5
-6
-7
-8
-9
-UPDATE t1,t2 SET t1.i=1111,t2.i=2222 WHERE t1.k < half_t1() AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-0 1111 0 100
-1 1111 1 101
-2 1111 2 102
-3 1111 3 103
-4 1111 4 104
-5 105 5 105
-6 106 6 106
-7 107 7 107
-8 108 8 108
-9 109 9 109
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-0 2222 0 100
-1 2222 1 101
-2 2222 2 102
-3 2222 3 103
-4 2222 4 104
-5 105 5 105
-6 106 6 106
-7 107 7 107
-8 108 8 108
-9 109 9 109
-connection default;
-UPDATE t1,t2 SET t1.i=3333,t2.i=4444 WHERE t1.k >= half_t1() AND t2.i=t1.i;
diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_big_tab_1.result b/mysql-test/suite/row_lock/r/innodb_row_lock_big_tab_1.result
deleted file mode 100644
index 0b12f149193..00000000000
--- a/mysql-test/suite/row_lock/r/innodb_row_lock_big_tab_1.result
+++ /dev/null
@@ -1,145 +0,0 @@
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-CREATE INDEX ixi ON t2 (i);
-CREATE PROCEDURE fill_t1 (IN upb int)
-BEGIN
-DECLARE cnt int DEFAULT 0;
-WHILE cnt < upb DO
-INSERT INTO t1 VALUES (cnt, cnt+100, cnt, cnt+100);
-SET cnt= cnt+1;
-END WHILE;
-END;
-|
-CREATE FUNCTION half_t1() RETURNS int
-BEGIN
-DECLARE res int DEFAULT 0;
-SELECT MOD(k,2) INTO res FROM t1;
-RETURN res;
-END;
-|
-CREATE PROCEDURE fill_t2 (IN upb int)
-BEGIN
-DECLARE cnt int DEFAULT 0;
-WHILE cnt < upb DO
-INSERT INTO t2 VALUES (cnt, cnt+100, cnt, cnt+100);
-SET cnt= cnt+1;
-END WHILE;
-END;
-|
-CREATE FUNCTION half_t2() RETURNS int
-BEGIN
-DECLARE res int DEFAULT 0;
-SELECT MOD(k,2) INTO res FROM t2;
-RETURN res;
-END;
-|
-CALL fill_t1 (40);
-CALL fill_t2 (40);
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.k % 2= 0 AND t1.k = t2.k LOCK IN SHARE MODE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index PRIMARY ixi 5 NULL 40 Using where; Using index
-1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.k 1
-SELECT t1.i,t2.i FROM t1,t2 WHERE t1.k % 2= 0 AND t1.k = t2.k LOCK IN SHARE MODE;
-i i
-100 100
-102 102
-104 104
-106 106
-108 108
-110 110
-112 112
-114 114
-116 116
-118 118
-120 120
-122 122
-124 124
-126 126
-128 128
-130 130
-132 132
-134 134
-136 136
-138 138
-connection root1;
-SELECT t1.i,t2.i FROM t1,t2 WHERE t1.k % 2= 1 AND t1.k = t2.k LOCK IN SHARE MODE;
-i i
-101 101
-103 103
-105 105
-107 107
-109 109
-111 111
-113 113
-115 115
-117 117
-119 119
-121 121
-123 123
-125 125
-127 127
-129 129
-131 131
-133 133
-135 135
-137 137
-139 139
-UPDATE t1,t2 SET t1.i=1111,t2.i=2222 WHERE t1.k % 2 = 1 AND t1.k = t2.k;
-SELECT * FROM t1 WHERE k < 20 ORDER BY t1.k;
-k i j l
-0 100 0 100
-1 1111 1 101
-2 102 2 102
-3 1111 3 103
-4 104 4 104
-5 1111 5 105
-6 106 6 106
-7 1111 7 107
-8 108 8 108
-9 1111 9 109
-10 110 10 110
-11 1111 11 111
-12 112 12 112
-13 1111 13 113
-14 114 14 114
-15 1111 15 115
-16 116 16 116
-17 1111 17 117
-18 118 18 118
-19 1111 19 119
-SELECT * FROM t2 WHERE k < 20 ORDER BY t2.k;
-k i j l
-0 100 0 100
-1 2222 1 101
-2 102 2 102
-3 2222 3 103
-4 104 4 104
-5 2222 5 105
-6 106 6 106
-7 2222 7 107
-8 108 8 108
-9 2222 9 109
-10 110 10 110
-11 2222 11 111
-12 112 12 112
-13 2222 13 113
-14 114 14 114
-15 2222 15 115
-16 116 16 116
-17 2222 17 117
-18 118 18 118
-19 2222 19 119
-connection default;
-UPDATE t1,t2 SET t1.i=3333,t2.i=4444 WHERE t1.k % 2 = 0 AND t1.k = t2.k;
diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_big_tab_2.result b/mysql-test/suite/row_lock/r/innodb_row_lock_big_tab_2.result
deleted file mode 100644
index cc9f297f9fb..00000000000
--- a/mysql-test/suite/row_lock/r/innodb_row_lock_big_tab_2.result
+++ /dev/null
@@ -1,113 +0,0 @@
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-CREATE INDEX ixi ON t2 (i);
-CREATE PROCEDURE fill_t1 (IN upb int)
-BEGIN
-DECLARE cnt int DEFAULT 0;
-WHILE cnt < upb DO
-INSERT INTO t1 VALUES (cnt, cnt+100, cnt, cnt+100);
-SET cnt= cnt+1;
-END WHILE;
-END;
-|
-CREATE FUNCTION half_t1() RETURNS int
-BEGIN
-DECLARE res int DEFAULT 0;
-SELECT MOD(k,2) INTO res FROM t1;
-RETURN res;
-END;
-|
-CREATE PROCEDURE fill_t2 (IN upb int)
-BEGIN
-DECLARE cnt int DEFAULT 0;
-WHILE cnt < upb DO
-INSERT INTO t2 VALUES (cnt, cnt+100, cnt, cnt+100);
-SET cnt= cnt+1;
-END WHILE;
-END;
-|
-CREATE FUNCTION half_t2() RETURNS int
-BEGIN
-DECLARE res int DEFAULT 0;
-SELECT MOD(k,2) INTO res FROM t2;
-RETURN res;
-END;
-|
-CALL fill_t1 (40);
-CALL fill_t2 (40);
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.k % 2= 0 AND t1.k = t2.k LOCK IN SHARE MODE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index PRIMARY ixi 5 NULL 40 Using where; Using index
-1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.k 1
-SELECT t1.i,t2.i FROM t1,t2 WHERE t1.k % 2= 0 AND t1.k = t2.k LOCK IN SHARE MODE;
-i i
-100 100
-102 102
-104 104
-106 106
-108 108
-110 110
-112 112
-114 114
-116 116
-118 118
-120 120
-122 122
-124 124
-126 126
-128 128
-130 130
-132 132
-134 134
-136 136
-138 138
-connection root1;
-DELETE FROM t1 WHERE t1.k % 2 = 1;
-SELECT * FROM t1 WHERE k < 20 ORDER BY t1.k;
-k i j l
-0 100 0 100
-2 102 2 102
-4 104 4 104
-6 106 6 106
-8 108 8 108
-10 110 10 110
-12 112 12 112
-14 114 14 114
-16 116 16 116
-18 118 18 118
-SELECT * FROM t2 WHERE k < 20 ORDER BY t2.k;
-k i j l
-0 100 0 100
-1 101 1 101
-2 102 2 102
-3 103 3 103
-4 104 4 104
-5 105 5 105
-6 106 6 106
-7 107 7 107
-8 108 8 108
-9 109 9 109
-10 110 10 110
-11 111 11 111
-12 112 12 112
-13 113 13 113
-14 114 14 114
-15 115 15 115
-16 116 16 116
-17 117 17 117
-18 118 18 118
-19 119 19 119
-connection default;
-UPDATE t1,t2 SET t1.i=3333,t2.i=4444 WHERE t1.k % 2 = 0 AND t1.k = t2.k;
diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_trig_1.result b/mysql-test/suite/row_lock/r/innodb_row_lock_trig_1.result
deleted file mode 100644
index dd43e5752e5..00000000000
--- a/mysql-test/suite/row_lock/r/innodb_row_lock_trig_1.result
+++ /dev/null
@@ -1,151 +0,0 @@
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t2 (i);
-CREATE TRIGGER trig_t2 AFTER UPDATE ON t2
-FOR EACH ROW BEGIN
-UPDATE t1 SET l = NEW.i WHERE i = OLD.i;
-END;
-|
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index ixi ixi 5 NULL 4 Using where; Using index
-SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-i
-123
-124
-connection root1;
-UPDATE t2 SET t2.i=225 WHERE t2.i=125;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 225
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 126 4 126
-connection default;
-UPDATE t2 SET t2.i=223 WHERE t2.i=123;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 223
-2 124 2 124
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-UPDATE t2 SET t2.i=226 WHERE t2.i=126;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 225
-4 126 4 226
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-connection default;
-UPDATE t2 SET t2.i=224 WHERE t2.i=124;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 223
-2 124 2 224
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-DELETE FROM t1 WHERE t1.i=226;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 225
-4 126 4 226
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-connection default;
-DELETE FROM t1 WHERE t1.i=224;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 223
-2 124 2 224
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-COMMIT;
-connection root1;
-ROLLBACK;
-connection default;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 223
-2 124 2 224
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 223
-2 124 2 224
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-connection default;
-DROP TABLE t1, t2;
-SET @@global.innodb_table_locks= @table_locks;
diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_trig_2.result b/mysql-test/suite/row_lock/r/innodb_row_lock_trig_2.result
deleted file mode 100644
index cb3a5c692e9..00000000000
--- a/mysql-test/suite/row_lock/r/innodb_row_lock_trig_2.result
+++ /dev/null
@@ -1,37 +0,0 @@
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-#CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-#CREATE INDEX ixi ON t2 (i);
-CREATE TRIGGER trig_t2 AFTER UPDATE ON t2
-FOR EACH ROW BEGIN
-UPDATE t1 SET l = NEW.i WHERE i = OLD.i;
-END;
-|
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
-SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-i
-123
-124
-connection root1;
-UPDATE t2 SET t2.i=225 WHERE t2.i=125;
diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_view_1.result b/mysql-test/suite/row_lock/r/innodb_row_lock_view_1.result
deleted file mode 100644
index 834cb669833..00000000000
--- a/mysql-test/suite/row_lock/r/innodb_row_lock_view_1.result
+++ /dev/null
@@ -1,34 +0,0 @@
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t2 (i);
-CREATE VIEW v1 AS SELECT t1.i, t2.l from t1,t2;
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index ixi ixi 5 NULL 4 Using where; Using index
-1 SIMPLE t2 ref ixi ixi 5 test.t1.i 2 Using where; Using index
-SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
-i i
-123 123
-124 124
-connection root1;
-UPDATE v1 SET i=325 where i=125;
diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_view_2.result b/mysql-test/suite/row_lock/r/innodb_row_lock_view_2.result
deleted file mode 100644
index 440138d4cd1..00000000000
--- a/mysql-test/suite/row_lock/r/innodb_row_lock_view_2.result
+++ /dev/null
@@ -1,40 +0,0 @@
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t2 (i);
-CREATE VIEW v1 AS SELECT t1.i, t2.l from t1,t2;
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT v1.i FROM v1 WHERE v1.i<125 FOR UPDATE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index ixi ixi 5 NULL 4 Using where; Using index
-1 SIMPLE t2 index NULL PRIMARY 4 NULL 4 Using index
-SELECT v1.i FROM v1 WHERE v1.i<125 FOR UPDATE;
-i
-123
-124
-123
-124
-123
-124
-123
-124
-connection root1;
-UPDATE v1 SET i=325 where i=125;
diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_view_mix_1.result b/mysql-test/suite/row_lock/r/innodb_row_lock_view_mix_1.result
deleted file mode 100644
index 230873b67a0..00000000000
--- a/mysql-test/suite/row_lock/r/innodb_row_lock_view_mix_1.result
+++ /dev/null
@@ -1,48 +0,0 @@
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t2 (i);
-CREATE VIEW v1 AS SELECT t1.i, t2.l from t1,t2;
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index ixi ixi 5 NULL 4 Using where; Using index
-1 SIMPLE t2 ref ixi ixi 5 test.t1.i 2 Using where; Using index
-SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
-i i
-123 123
-124 124
-connection root1;
-UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 126 4 126
-connection default;
-UPDATE v1 SET i=323 where i=123;
diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_view_mix_2.result b/mysql-test/suite/row_lock/r/innodb_row_lock_view_mix_2.result
deleted file mode 100644
index d792d573f8e..00000000000
--- a/mysql-test/suite/row_lock/r/innodb_row_lock_view_mix_2.result
+++ /dev/null
@@ -1,40 +0,0 @@
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t2 (i);
-CREATE VIEW v1 AS SELECT t1.i, t2.l from t1,t2;
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT v1.i FROM v1 WHERE v1.i<125 FOR UPDATE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index ixi ixi 5 NULL 4 Using where; Using index
-1 SIMPLE t2 index NULL PRIMARY 4 NULL 4 Using index
-SELECT v1.i FROM v1 WHERE v1.i<125 FOR UPDATE;
-i
-123
-124
-123
-124
-123
-124
-123
-124
-connection root1;
-UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_view_storedp_1.result b/mysql-test/suite/row_lock/r/innodb_row_lock_view_storedp_1.result
deleted file mode 100644
index 77b9a4dd964..00000000000
--- a/mysql-test/suite/row_lock/r/innodb_row_lock_view_storedp_1.result
+++ /dev/null
@@ -1,312 +0,0 @@
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
-SET autocommit=0;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-INSERT INTO t1 VALUES (5,127,5,127);
-INSERT INTO t1 VALUES (6,128,6,128);
-CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-INSERT INTO t2 VALUES (5,127,5,127);
-INSERT INTO t2 VALUES (6,128,6,128);
-CREATE INDEX ixi ON t2 (i);
-CREATE VIEW v1 AS SELECT t1.i from t1;
-CREATE PROCEDURE stp_t (IN p1 int, IN p2 int) MODIFIES SQL DATA
-BEGIN
-UPDATE t2 SET i = p2 WHERE i = p1;
-UPDATE v1 SET i = p2 WHERE i = p1;
-SELECT * FROM v1 ORDER BY i;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-END;
-|
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index ixi ixi 5 NULL 6 Using where; Using index
-SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-i
-123
-124
-connection root1;
-CALL stp_t (125, 225);
-i
-123
-124
-126
-127
-128
-225
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 126 4 126
-5 127 5 127
-6 128 6 128
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 126 4 126
-5 127 5 127
-6 128 6 128
-connection root2;
-CALL stp_t (127, 227);
-i
-123
-124
-125
-126
-128
-227
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-5 227 5 127
-6 128 6 128
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-5 227 5 127
-6 128 6 128
-connection default;
-CALL stp_t (123, 223);
-i
-124
-125
-126
-127
-128
-223
-k i j l
-1 223 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-5 127 5 127
-6 128 6 128
-k i j l
-1 223 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-5 127 5 127
-6 128 6 128
-connection root1;
-CALL stp_t (126, 226);
-i
-123
-124
-127
-128
-225
-226
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-5 127 5 127
-6 128 6 128
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-5 127 5 127
-6 128 6 128
-connection root2;
-CALL stp_t (128, 228);
-i
-123
-124
-125
-126
-227
-228
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-5 227 5 127
-6 228 6 128
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-5 227 5 127
-6 228 6 128
-connection default;
-CALL stp_t (124, 224);
-i
-125
-126
-127
-128
-223
-224
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-5 127 5 127
-6 128 6 128
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-5 127 5 127
-6 128 6 128
-connection root1;
-DELETE FROM t1 WHERE t1.i=226;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-5 127 5 127
-6 128 6 128
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-5 127 5 127
-6 128 6 128
-connection root2;
-DELETE FROM t1 WHERE t1.i=228;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-5 227 5 127
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-5 227 5 127
-6 228 6 128
-connection default;
-DELETE FROM t1 WHERE t1.i=224;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-3 125 3 125
-4 126 4 126
-5 127 5 127
-6 128 6 128
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-5 127 5 127
-6 128 6 128
-COMMIT;
-connection root1;
-ROLLBACK;
-connection root1;
-COMMIT;
-connection default;
-SELECT * FROM v1 ORDER BY i;
-i
-125
-126
-127
-128
-223
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-3 125 3 125
-4 126 4 126
-5 127 5 127
-6 128 6 128
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-5 127 5 127
-6 128 6 128
-connection root1;
-SELECT * FROM v1 ORDER BY i;
-i
-125
-126
-127
-128
-223
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-3 125 3 125
-4 126 4 126
-5 127 5 127
-6 128 6 128
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-5 127 5 127
-6 128 6 128
-connection root2;
-SELECT * FROM v1 ORDER BY i;
-i
-123
-124
-125
-126
-227
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-5 227 5 127
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-5 227 5 127
-6 228 6 128
-connection default;
-DROP TABLE t1, t2;
-DROP VIEW v1;
-SET @@global.innodb_table_locks= @table_locks;
diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_view_storedp_2.result b/mysql-test/suite/row_lock/r/innodb_row_lock_view_storedp_2.result
deleted file mode 100644
index 73d8a3f4bea..00000000000
--- a/mysql-test/suite/row_lock/r/innodb_row_lock_view_storedp_2.result
+++ /dev/null
@@ -1,47 +0,0 @@
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
-SET autocommit=0;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-INSERT INTO t1 VALUES (5,127,5,127);
-INSERT INTO t1 VALUES (6,128,6,128);
-#CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-INSERT INTO t2 VALUES (5,127,5,127);
-INSERT INTO t2 VALUES (6,128,6,128);
-#CREATE INDEX ixi ON t2 (i);
-CREATE VIEW v1 AS SELECT t1.i from t1;
-CREATE PROCEDURE stp_t (IN p1 int, IN p2 int) MODIFIES SQL DATA
-BEGIN
-UPDATE t2 SET i = p2 WHERE i = p1;
-UPDATE v1 SET i = p2 WHERE i = p1;
-SELECT * FROM v1 ORDER BY i;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-END;
-|
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using where
-SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-i
-123
-124
-connection root1;
-CALL stp_t (125, 225);
diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_view_trig_1.result b/mysql-test/suite/row_lock/r/innodb_row_lock_view_trig_1.result
deleted file mode 100644
index 90383a9489f..00000000000
--- a/mysql-test/suite/row_lock/r/innodb_row_lock_view_trig_1.result
+++ /dev/null
@@ -1,183 +0,0 @@
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t2 (i);
-CREATE VIEW v1 AS SELECT t1.i from t1;
-CREATE TRIGGER trig_t2 AFTER UPDATE ON t2
-FOR EACH ROW BEGIN
-UPDATE v1 SET i = NEW.i WHERE i = OLD.i;
-END;
-|
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index ixi ixi 5 NULL 4 Using where; Using index
-SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-i
-123
-124
-connection root1;
-UPDATE t2 SET t2.i=225 WHERE t2.i=125;
-SELECT * FROM v1 ORDER BY i;
-i
-123
-124
-126
-225
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 126 4 126
-connection default;
-UPDATE t2 SET t2.i=223 WHERE t2.i=123;
-SELECT * FROM v1 ORDER BY i;
-i
-124
-125
-126
-223
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-UPDATE t2 SET t2.i=226 WHERE t2.i=126;
-SELECT * FROM v1 ORDER BY i;
-i
-123
-124
-225
-226
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-connection default;
-UPDATE t2 SET t2.i=224 WHERE t2.i=124;
-SELECT * FROM v1 ORDER BY i;
-i
-125
-126
-223
-224
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-DELETE FROM t1 WHERE t1.i=226;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-connection default;
-DELETE FROM t1 WHERE t1.i=224;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-COMMIT;
-connection root1;
-ROLLBACK;
-connection default;
-SELECT * FROM v1 ORDER BY i;
-i
-125
-126
-223
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-SELECT * FROM v1 ORDER BY i;
-i
-125
-126
-223
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-connection default;
-DROP TABLE t1, t2;
-DROP VIEW v1;
-SET @@global.innodb_table_locks= @table_locks;
diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_view_trig_2.result b/mysql-test/suite/row_lock/r/innodb_row_lock_view_trig_2.result
deleted file mode 100644
index 55793558b21..00000000000
--- a/mysql-test/suite/row_lock/r/innodb_row_lock_view_trig_2.result
+++ /dev/null
@@ -1,38 +0,0 @@
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-#CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-#CREATE INDEX ixi ON t2 (i);
-CREATE VIEW v1 AS SELECT t1.i from t1;
-CREATE TRIGGER trig_t2 AFTER UPDATE ON t2
-FOR EACH ROW BEGIN
-UPDATE v1 SET i = NEW.i WHERE i = OLD.i;
-END;
-|
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
-SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-i
-123
-124
-connection root1;
-UPDATE t2 SET t2.i=225 WHERE t2.i=125;
diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_1.result b/mysql-test/suite/row_lock/r/ndb_row_lock_1.result
deleted file mode 100644
index 248c7d5ea1f..00000000000
--- a/mysql-test/suite/row_lock/r/ndb_row_lock_1.result
+++ /dev/null
@@ -1,139 +0,0 @@
-DROP TABLE IF EXISTS t1, t2;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t2 (i);
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range ixi ixi 5 NULL 10 Using where
-1 SIMPLE t2 ref ixi ixi 5 test.t1.i 1 Using where
-SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
-i i
-123 123
-124 124
-connection root1;
-UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 126 4 126
-connection default;
-UPDATE t1,t2 SET t1.i=223,t2.i=223 WHERE t1.i=123 AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-UPDATE t1,t2 SET t1.i=226,t2.i=226 WHERE t1.i=126 AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-connection default;
-UPDATE t1,t2 SET t1.i=224,t2.i=224 WHERE t1.i=124 AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-DELETE FROM t1 WHERE t1.i=226;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-connection default;
-DELETE FROM t1 WHERE t1.i=224;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-COMMIT;
-connection root1;
-ROLLBACK;
-connection default;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-connection default;
-DROP TABLE t1, t2;
diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_2.result b/mysql-test/suite/row_lock/r/ndb_row_lock_2.result
deleted file mode 100644
index 109d99dd036..00000000000
--- a/mysql-test/suite/row_lock/r/ndb_row_lock_2.result
+++ /dev/null
@@ -1,31 +0,0 @@
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-#CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-#CREATE INDEX ixi ON t2 (i);
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
-1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where
-SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
-i i
-123 123
-124 124
-connection root1;
-UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_3.result b/mysql-test/suite/row_lock/r/ndb_row_lock_3.result
deleted file mode 100644
index c936ea209ff..00000000000
--- a/mysql-test/suite/row_lock/r/ndb_row_lock_3.result
+++ /dev/null
@@ -1,30 +0,0 @@
-DROP TABLE IF EXISTS t1, t2;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-#CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-#CREATE INDEX ixi ON t2 (i);
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
-1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where
-SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE;
-i i
-123 123
-124 124
-connection root1;
-UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_4.result b/mysql-test/suite/row_lock/r/ndb_row_lock_4.result
deleted file mode 100644
index 875c783bd81..00000000000
--- a/mysql-test/suite/row_lock/r/ndb_row_lock_4.result
+++ /dev/null
@@ -1,139 +0,0 @@
-DROP TABLE IF EXISTS t1, t2;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t2 (i);
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range ixi ixi 5 NULL 10 Using where
-1 SIMPLE t2 ref ixi ixi 5 test.t1.i 1 Using where
-SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE;
-i i
-123 123
-124 124
-connection root1;
-UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 126 4 126
-connection default;
-UPDATE t1,t2 SET t1.i=223,t2.i=223 WHERE t1.i=123 AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-UPDATE t1,t2 SET t1.i=226,t2.i=226 WHERE t1.i=126 AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-connection default;
-UPDATE t1,t2 SET t1.i=224,t2.i=224 WHERE t1.i=124 AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-DELETE FROM t1 WHERE t1.i=226;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-connection default;
-DELETE FROM t1 WHERE t1.i=224;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-COMMIT;
-connection root1;
-ROLLBACK;
-connection default;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-connection default;
-DROP TABLE t1, t2;
diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_5.result b/mysql-test/suite/row_lock/r/ndb_row_lock_5.result
deleted file mode 100644
index 0d94f8abf72..00000000000
--- a/mysql-test/suite/row_lock/r/ndb_row_lock_5.result
+++ /dev/null
@@ -1,30 +0,0 @@
-DROP TABLE IF EXISTS t1, t2;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t2 (i);
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i,t2.i FROM t1 ignore index (ixi),t2 IGNORE INDEX (ixi) WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
-1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where
-SELECT t1.i,t2.i FROM t1 ignore index (ixi),t2 IGNORE INDEX (ixi) WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE;
-i i
-123 123
-124 124
-connection root1;
-UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_big_tab.result b/mysql-test/suite/row_lock/r/ndb_row_lock_big_tab.result
deleted file mode 100644
index 94b67c63d94..00000000000
--- a/mysql-test/suite/row_lock/r/ndb_row_lock_big_tab.result
+++ /dev/null
@@ -1,177 +0,0 @@
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-CREATE INDEX ixi ON t2 (i);
-CREATE PROCEDURE fill_t1 (IN upb int)
-BEGIN
-DECLARE cnt int DEFAULT 0;
-WHILE cnt < upb DO
-INSERT INTO t1 VALUES (cnt, cnt+100, cnt, cnt+100);
-SET cnt= cnt+1;
-END WHILE;
-END;
-|
-CREATE FUNCTION half_t1() RETURNS int
-BEGIN
-DECLARE res int DEFAULT 0;
-SELECT count(*)/2 INTO res FROM t1;
-RETURN res;
-END;
-|
-CREATE PROCEDURE fill_t2 (IN upb int)
-BEGIN
-DECLARE cnt int DEFAULT 0;
-WHILE cnt < upb DO
-INSERT INTO t2 VALUES (cnt, cnt+100, cnt, cnt+100);
-SET cnt= cnt+1;
-END WHILE;
-END;
-|
-CREATE FUNCTION half_t2() RETURNS int
-BEGIN
-DECLARE res int DEFAULT 0;
-SELECT count(*)/2 INTO res FROM t2;
-RETURN res;
-END;
-|
-CALL fill_t1 (10);
-CALL fill_t2 (10);
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i < half_t1() AND t2.i=t1.i LOCK IN SHARE MODE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range ixi ixi 5 NULL 10 Using where
-1 SIMPLE t2 ref ixi ixi 5 test.t1.i 1 Using where
-SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i < half_t1() AND t2.i=t1.i LOCK IN SHARE MODE;
-i i
-connection root1;
-SELECT k from t1 WHERE k < half_t1();
-k
-0
-3
-1
-2
-4
-SELECT k from t1 WHERE k >= half_t1();
-k
-6
-7
-9
-5
-8
-UPDATE t1,t2 SET t1.i=1111,t2.i=2222 WHERE t1.k < half_t1() AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-0 1111 0 100
-1 1111 1 101
-2 1111 2 102
-3 1111 3 103
-4 1111 4 104
-5 105 5 105
-6 106 6 106
-7 107 7 107
-8 108 8 108
-9 109 9 109
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-0 2222 0 100
-1 2222 1 101
-2 2222 2 102
-3 2222 3 103
-4 2222 4 104
-5 105 5 105
-6 106 6 106
-7 107 7 107
-8 108 8 108
-9 109 9 109
-connection default;
-UPDATE t1,t2 SET t1.i=3333,t2.i=4444 WHERE t1.k >= half_t1() AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-0 100 0 100
-1 101 1 101
-2 102 2 102
-3 103 3 103
-4 104 4 104
-5 3333 5 105
-6 3333 6 106
-7 3333 7 107
-8 3333 8 108
-9 3333 9 109
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-0 100 0 100
-1 101 1 101
-2 102 2 102
-3 103 3 103
-4 104 4 104
-5 4444 5 105
-6 4444 6 106
-7 4444 7 107
-8 4444 8 108
-9 4444 9 109
-COMMIT;
-connection root1;
-ROLLBACK;
-connection default;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-0 100 0 100
-1 101 1 101
-2 102 2 102
-3 103 3 103
-4 104 4 104
-5 3333 5 105
-6 3333 6 106
-7 3333 7 107
-8 3333 8 108
-9 3333 9 109
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-0 100 0 100
-1 101 1 101
-2 102 2 102
-3 103 3 103
-4 104 4 104
-5 4444 5 105
-6 4444 6 106
-7 4444 7 107
-8 4444 8 108
-9 4444 9 109
-connection root1;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-0 100 0 100
-1 101 1 101
-2 102 2 102
-3 103 3 103
-4 104 4 104
-5 3333 5 105
-6 3333 6 106
-7 3333 7 107
-8 3333 8 108
-9 3333 9 109
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-0 100 0 100
-1 101 1 101
-2 102 2 102
-3 103 3 103
-4 104 4 104
-5 4444 5 105
-6 4444 6 106
-7 4444 7 107
-8 4444 8 108
-9 4444 9 109
-connection default;
-DROP VIEW IF EXISTS v1;
-Warnings:
-Note 1051 Unknown table 'test.v1'
-DROP TABLE t1, t2;
diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_big_tab_1.result b/mysql-test/suite/row_lock/r/ndb_row_lock_big_tab_1.result
deleted file mode 100644
index 9803895e1a7..00000000000
--- a/mysql-test/suite/row_lock/r/ndb_row_lock_big_tab_1.result
+++ /dev/null
@@ -1,357 +0,0 @@
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-CREATE INDEX ixi ON t2 (i);
-CREATE PROCEDURE fill_t1 (IN upb int)
-BEGIN
-DECLARE cnt int DEFAULT 0;
-WHILE cnt < upb DO
-INSERT INTO t1 VALUES (cnt, cnt+100, cnt, cnt+100);
-SET cnt= cnt+1;
-END WHILE;
-END;
-|
-CREATE FUNCTION half_t1() RETURNS int
-BEGIN
-DECLARE res int DEFAULT 0;
-SELECT MOD(k,2) INTO res FROM t1;
-RETURN res;
-END;
-|
-CREATE PROCEDURE fill_t2 (IN upb int)
-BEGIN
-DECLARE cnt int DEFAULT 0;
-WHILE cnt < upb DO
-INSERT INTO t2 VALUES (cnt, cnt+100, cnt, cnt+100);
-SET cnt= cnt+1;
-END WHILE;
-END;
-|
-CREATE FUNCTION half_t2() RETURNS int
-BEGIN
-DECLARE res int DEFAULT 0;
-SELECT MOD(k,2) INTO res FROM t2;
-RETURN res;
-END;
-|
-CALL fill_t1 (200);
-CALL fill_t2 (200);
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i < t1.k % 2 = 0 AND t2.k=t1.k LOCK IN SHARE MODE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 200 Using where
-1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.k 1
-SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i < t1.k % 2 = 0 AND t2.k=t1.k LOCK IN SHARE MODE;
-i i
-135 135
-119 119
-211 211
-184 184
-232 232
-105 105
-188 188
-216 216
-255 255
-154 154
-197 197
-279 279
-218 218
-127 127
-203 203
-281 281
-194 194
-161 161
-276 276
-122 122
-139 139
-183 183
-114 114
-247 247
-144 144
-148 148
-174 174
-267 267
-142 142
-168 168
-226 226
-258 258
-231 231
-146 146
-253 253
-189 189
-230 230
-290 290
-178 178
-158 158
-130 130
-214 214
-133 133
-229 229
-294 294
-295 295
-108 108
-112 112
-297 297
-151 151
-251 251
-270 270
-291 291
-159 159
-132 132
-121 121
-244 244
-272 272
-293 293
-186 186
-111 111
-166 166
-201 201
-175 175
-180 180
-209 209
-192 192
-246 246
-195 195
-107 107
-233 233
-239 239
-103 103
-109 109
-128 128
-266 266
-143 143
-160 160
-187 187
-243 243
-273 273
-259 259
-110 110
-176 176
-141 141
-170 170
-215 215
-191 191
-200 200
-271 271
-162 162
-260 260
-106 106
-150 150
-126 126
-147 147
-155 155
-193 193
-207 207
-287 287
-235 235
-252 252
-129 129
-205 205
-268 268
-278 278
-116 116
-137 137
-199 199
-217 217
-234 234
-190 190
-236 236
-257 257
-100 100
-210 210
-212 212
-264 264
-221 221
-241 241
-256 256
-262 262
-265 265
-269 269
-277 277
-173 173
-177 177
-208 208
-219 219
-285 285
-101 101
-164 164
-113 113
-125 125
-202 202
-140 140
-156 156
-282 282
-181 181
-206 206
-299 299
-102 102
-145 145
-227 227
-196 196
-138 138
-198 198
-204 204
-237 237
-171 171
-284 284
-263 263
-292 292
-104 104
-149 149
-250 250
-296 296
-228 228
-280 280
-242 242
-248 248
-185 185
-220 220
-245 245
-275 275
-118 118
-120 120
-152 152
-153 153
-157 157
-182 182
-179 179
-254 254
-288 288
-172 172
-283 283
-286 286
-115 115
-238 238
-289 289
-131 131
-223 223
-134 134
-136 136
-222 222
-225 225
-261 261
-274 274
-123 123
-163 163
-224 224
-117 117
-298 298
-169 169
-124 124
-167 167
-240 240
-249 249
-165 165
-213 213
-connection root1;
-SELECT t1.i,t2.i FROM t1,t2 WHERE t1.k % 2= 1 AND t1.k = t2.k LOCK IN SHARE MODE;
-i i
-209 209
-195 195
-107 107
-233 233
-239 239
-103 103
-109 109
-143 143
-187 187
-243 243
-273 273
-259 259
-141 141
-215 215
-191 191
-271 271
-147 147
-155 155
-193 193
-207 207
-287 287
-235 235
-129 129
-205 205
-137 137
-199 199
-217 217
-257 257
-221 221
-241 241
-265 265
-269 269
-277 277
-173 173
-177 177
-135 135
-119 119
-211 211
-105 105
-255 255
-197 197
-279 279
-127 127
-203 203
-281 281
-161 161
-139 139
-183 183
-247 247
-267 267
-231 231
-253 253
-189 189
-133 133
-229 229
-295 295
-297 297
-151 151
-251 251
-291 291
-159 159
-121 121
-293 293
-111 111
-201 201
-175 175
-185 185
-245 245
-275 275
-153 153
-157 157
-179 179
-283 283
-115 115
-289 289
-131 131
-223 223
-225 225
-261 261
-123 123
-163 163
-117 117
-169 169
-167 167
-249 249
-165 165
-213 213
-219 219
-285 285
-101 101
-113 113
-125 125
-181 181
-299 299
-145 145
-227 227
-237 237
-171 171
-263 263
-149 149
-UPDATE t1,t2 SET t1.i=1111,t2.i=2222 WHERE t1.k % 2 = 1 AND t1.k = t2.k;
diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_big_tab_2.result b/mysql-test/suite/row_lock/r/ndb_row_lock_big_tab_2.result
deleted file mode 100644
index adb89b03480..00000000000
--- a/mysql-test/suite/row_lock/r/ndb_row_lock_big_tab_2.result
+++ /dev/null
@@ -1,255 +0,0 @@
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-CREATE INDEX ixi ON t2 (i);
-CREATE PROCEDURE fill_t1 (IN upb int)
-BEGIN
-DECLARE cnt int DEFAULT 0;
-WHILE cnt < upb DO
-INSERT INTO t1 VALUES (cnt, cnt+100, cnt, cnt+100);
-SET cnt= cnt+1;
-END WHILE;
-END;
-|
-CREATE FUNCTION half_t1() RETURNS int
-BEGIN
-DECLARE res int DEFAULT 0;
-SELECT MOD(k,2) INTO res FROM t1;
-RETURN res;
-END;
-|
-CREATE PROCEDURE fill_t2 (IN upb int)
-BEGIN
-DECLARE cnt int DEFAULT 0;
-WHILE cnt < upb DO
-INSERT INTO t2 VALUES (cnt, cnt+100, cnt, cnt+100);
-SET cnt= cnt+1;
-END WHILE;
-END;
-|
-CREATE FUNCTION half_t2() RETURNS int
-BEGIN
-DECLARE res int DEFAULT 0;
-SELECT MOD(k,2) INTO res FROM t2;
-RETURN res;
-END;
-|
-CALL fill_t1 (200);
-CALL fill_t2 (200);
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i < t1.k % 2 = 0 AND t2.k=t1.k LOCK IN SHARE MODE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 200 Using where
-1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.k 1
-SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i < t1.k % 2 = 0 AND t2.k=t1.k LOCK IN SHARE MODE;
-i i
-135 135
-119 119
-211 211
-184 184
-232 232
-105 105
-188 188
-216 216
-255 255
-154 154
-197 197
-279 279
-218 218
-127 127
-203 203
-281 281
-194 194
-161 161
-276 276
-122 122
-139 139
-183 183
-114 114
-247 247
-144 144
-148 148
-174 174
-267 267
-142 142
-168 168
-226 226
-258 258
-231 231
-146 146
-253 253
-189 189
-230 230
-290 290
-178 178
-158 158
-130 130
-214 214
-133 133
-229 229
-294 294
-295 295
-108 108
-112 112
-297 297
-151 151
-251 251
-270 270
-291 291
-159 159
-132 132
-121 121
-244 244
-272 272
-293 293
-186 186
-111 111
-166 166
-201 201
-175 175
-180 180
-209 209
-192 192
-246 246
-195 195
-107 107
-233 233
-239 239
-103 103
-109 109
-128 128
-266 266
-143 143
-160 160
-187 187
-243 243
-273 273
-259 259
-110 110
-176 176
-141 141
-170 170
-215 215
-191 191
-200 200
-271 271
-162 162
-260 260
-106 106
-150 150
-126 126
-147 147
-155 155
-193 193
-207 207
-287 287
-235 235
-252 252
-129 129
-205 205
-268 268
-278 278
-116 116
-137 137
-199 199
-217 217
-234 234
-190 190
-236 236
-257 257
-100 100
-210 210
-212 212
-264 264
-221 221
-241 241
-256 256
-262 262
-265 265
-269 269
-277 277
-173 173
-177 177
-208 208
-219 219
-285 285
-101 101
-164 164
-113 113
-125 125
-202 202
-140 140
-156 156
-282 282
-181 181
-206 206
-299 299
-102 102
-145 145
-227 227
-196 196
-138 138
-198 198
-204 204
-237 237
-171 171
-284 284
-263 263
-292 292
-104 104
-149 149
-250 250
-296 296
-228 228
-280 280
-242 242
-248 248
-185 185
-220 220
-245 245
-275 275
-118 118
-120 120
-152 152
-153 153
-157 157
-182 182
-179 179
-254 254
-288 288
-172 172
-283 283
-286 286
-115 115
-238 238
-289 289
-131 131
-223 223
-134 134
-136 136
-222 222
-225 225
-261 261
-274 274
-123 123
-163 163
-224 224
-117 117
-298 298
-169 169
-124 124
-167 167
-240 240
-249 249
-165 165
-213 213
-connection root1;
-DELETE FROM t1 WHERE t1.k % 2 = 1;
diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_trig_1.result b/mysql-test/suite/row_lock/r/ndb_row_lock_trig_1.result
deleted file mode 100644
index eb69fd2e306..00000000000
--- a/mysql-test/suite/row_lock/r/ndb_row_lock_trig_1.result
+++ /dev/null
@@ -1,148 +0,0 @@
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t2 (i);
-CREATE TRIGGER trig_t2 AFTER UPDATE ON t2
-FOR EACH ROW BEGIN
-UPDATE t1 SET l = NEW.i WHERE i = OLD.i;
-END;
-|
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range ixi ixi 5 NULL 10 Using where
-SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-i
-123
-124
-connection root1;
-UPDATE t2 SET t2.i=225 WHERE t2.i=125;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 225
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 126 4 126
-connection default;
-UPDATE t2 SET t2.i=223 WHERE t2.i=123;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 223
-2 124 2 124
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-UPDATE t2 SET t2.i=226 WHERE t2.i=126;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 225
-4 126 4 226
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-connection default;
-UPDATE t2 SET t2.i=224 WHERE t2.i=124;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 223
-2 124 2 224
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-DELETE FROM t1 WHERE t1.i=226;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 225
-4 126 4 226
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-connection default;
-DELETE FROM t1 WHERE t1.i=224;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 223
-2 124 2 224
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-COMMIT;
-connection root1;
-ROLLBACK;
-connection default;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 223
-2 124 2 224
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 223
-2 124 2 224
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-connection default;
-DROP TABLE t1, t2;
diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_trig_2.result b/mysql-test/suite/row_lock/r/ndb_row_lock_trig_2.result
deleted file mode 100644
index bedb75da93a..00000000000
--- a/mysql-test/suite/row_lock/r/ndb_row_lock_trig_2.result
+++ /dev/null
@@ -1,35 +0,0 @@
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-#CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-#CREATE INDEX ixi ON t2 (i);
-CREATE TRIGGER trig_t2 AFTER UPDATE ON t2
-FOR EACH ROW BEGIN
-UPDATE t1 SET l = NEW.i WHERE i = OLD.i;
-END;
-|
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
-SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-i
-123
-124
-connection root1;
-UPDATE t2 SET t2.i=225 WHERE t2.i=125;
diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_view_1.result b/mysql-test/suite/row_lock/r/ndb_row_lock_view_1.result
deleted file mode 100644
index 279f2626c73..00000000000
--- a/mysql-test/suite/row_lock/r/ndb_row_lock_view_1.result
+++ /dev/null
@@ -1,194 +0,0 @@
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t2 (i);
-CREATE VIEW v1 AS SELECT t1.i, t2.l from t1,t2;
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range ixi ixi 5 NULL 10 Using where
-1 SIMPLE t2 ref ixi ixi 5 test.t1.i 1 Using where
-SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
-i i
-123 123
-124 124
-connection root1;
-UPDATE v1 SET i=325 where i=125;
-SELECT * FROM v1 ORDER BY i,l;
-i l
-123 123
-123 124
-123 125
-123 126
-124 123
-124 124
-124 125
-124 126
-126 123
-126 124
-126 125
-126 126
-325 123
-325 124
-325 125
-325 126
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 325 3 125
-4 126 4 126
-connection default;
-UPDATE v1 SET i=323 where i=123;
-SELECT * FROM v1 ORDER BY i,l;
-i l
-124 123
-124 124
-124 125
-124 126
-125 123
-125 124
-125 125
-125 126
-126 123
-126 124
-126 125
-126 126
-323 123
-323 124
-323 125
-323 126
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 323 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-UPDATE v1 SET i=326 where i=126;
-SELECT * FROM v1 ORDER BY i,l;
-i l
-123 123
-123 124
-123 125
-123 126
-124 123
-124 124
-124 125
-124 126
-325 123
-325 124
-325 125
-325 126
-326 123
-326 124
-326 125
-326 126
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 325 3 125
-4 326 4 126
-connection default;
-UPDATE v1 SET i=324 where i=124;
-SELECT * FROM v1 ORDER BY i,l;
-i l
-125 123
-125 124
-125 125
-125 126
-126 123
-126 124
-126 125
-126 126
-323 123
-323 124
-323 125
-323 126
-324 123
-324 124
-324 125
-324 126
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 323 1 123
-2 324 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-DELETE FROM t1 WHERE t1.i=226;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 325 3 125
-4 326 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-connection default;
-DELETE FROM t1 WHERE t1.i=224;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 323 1 123
-2 324 2 124
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-COMMIT;
-connection root1;
-ROLLBACK;
-connection default;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 323 1 123
-2 324 2 124
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 323 1 123
-2 324 2 124
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-connection default;
-DROP VIEW IF EXISTS v1;
-DROP TABLE t1, t2;
diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_view_2.result b/mysql-test/suite/row_lock/r/ndb_row_lock_view_2.result
deleted file mode 100644
index 9e74e93b0cc..00000000000
--- a/mysql-test/suite/row_lock/r/ndb_row_lock_view_2.result
+++ /dev/null
@@ -1,200 +0,0 @@
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t2 (i);
-CREATE VIEW v1 AS SELECT t1.i, t2.l from t1,t2;
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT v1.i FROM v1 WHERE v1.i<125 FOR UPDATE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range ixi ixi 5 NULL 10 Using where
-1 SIMPLE t2 ALL NULL NULL NULL NULL 4
-SELECT v1.i FROM v1 WHERE v1.i<125 FOR UPDATE;
-i
-123
-124
-123
-124
-123
-124
-123
-124
-connection root1;
-UPDATE v1 SET i=325 where i=125;
-SELECT * FROM v1 ORDER BY i,l;
-i l
-123 123
-123 124
-123 125
-123 126
-124 123
-124 124
-124 125
-124 126
-126 123
-126 124
-126 125
-126 126
-325 123
-325 124
-325 125
-325 126
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 325 3 125
-4 126 4 126
-connection default;
-UPDATE v1 SET i=323 where i=123;
-SELECT * FROM v1 ORDER BY i,l;
-i l
-124 123
-124 124
-124 125
-124 126
-125 123
-125 124
-125 125
-125 126
-126 123
-126 124
-126 125
-126 126
-323 123
-323 124
-323 125
-323 126
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 323 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-UPDATE v1 SET i=326 where i=126;
-SELECT * FROM v1 ORDER BY i,l;
-i l
-123 123
-123 124
-123 125
-123 126
-124 123
-124 124
-124 125
-124 126
-325 123
-325 124
-325 125
-325 126
-326 123
-326 124
-326 125
-326 126
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 325 3 125
-4 326 4 126
-connection default;
-UPDATE v1 SET i=324 where i=124;
-SELECT * FROM v1 ORDER BY i,l;
-i l
-125 123
-125 124
-125 125
-125 126
-126 123
-126 124
-126 125
-126 126
-323 123
-323 124
-323 125
-323 126
-324 123
-324 124
-324 125
-324 126
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 323 1 123
-2 324 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-DELETE FROM t1 WHERE t1.i=226;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 325 3 125
-4 326 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-connection default;
-DELETE FROM t1 WHERE t1.i=224;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 323 1 123
-2 324 2 124
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-COMMIT;
-connection root1;
-ROLLBACK;
-connection default;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 323 1 123
-2 324 2 124
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 323 1 123
-2 324 2 124
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-connection default;
-DROP VIEW IF EXISTS v1;
-DROP TABLE t1, t2;
diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_view_mix_1.result b/mysql-test/suite/row_lock/r/ndb_row_lock_view_mix_1.result
deleted file mode 100644
index b5b1c519702..00000000000
--- a/mysql-test/suite/row_lock/r/ndb_row_lock_view_mix_1.result
+++ /dev/null
@@ -1,169 +0,0 @@
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t2 (i);
-CREATE VIEW v1 AS SELECT t1.i, t2.l from t1,t2;
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range ixi ixi 5 NULL 10 Using where
-1 SIMPLE t2 ref ixi ixi 5 test.t1.i 1 Using where
-SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
-i i
-123 123
-124 124
-connection root1;
-UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 126 4 126
-connection default;
-UPDATE v1 SET i=323 where i=123;
-SELECT * FROM v1 ORDER BY i,l;
-i l
-124 123
-124 124
-124 125
-124 126
-125 123
-125 124
-125 125
-125 126
-126 123
-126 124
-126 125
-126 126
-323 123
-323 124
-323 125
-323 126
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 323 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-UPDATE t1,t2 SET t1.i=226,t2.i=226 WHERE t1.i=126 AND t2.i=t1.i;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-connection default;
-UPDATE v1 SET i=324 where i=124;
-SELECT * FROM v1 ORDER BY i,l;
-i l
-125 123
-125 124
-125 125
-125 126
-126 123
-126 124
-126 125
-126 126
-323 123
-323 124
-323 125
-323 126
-324 123
-324 124
-324 125
-324 126
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 323 1 123
-2 324 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-DELETE FROM t1 WHERE t1.i=226;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-connection default;
-DELETE FROM t1 WHERE t1.i=224;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 323 1 123
-2 324 2 124
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-COMMIT;
-connection root1;
-ROLLBACK;
-connection default;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 323 1 123
-2 324 2 124
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 323 1 123
-2 324 2 124
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-connection default;
-DROP VIEW IF EXISTS v1;
-DROP TABLE t1, t2;
diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_view_mix_2.result b/mysql-test/suite/row_lock/r/ndb_row_lock_view_mix_2.result
deleted file mode 100644
index d92f9ad9664..00000000000
--- a/mysql-test/suite/row_lock/r/ndb_row_lock_view_mix_2.result
+++ /dev/null
@@ -1,38 +0,0 @@
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t2 (i);
-CREATE VIEW v1 AS SELECT t1.i, t2.l from t1,t2;
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT v1.i FROM v1 WHERE v1.i<125 FOR UPDATE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range ixi ixi 5 NULL 10 Using where
-1 SIMPLE t2 ALL NULL NULL NULL NULL 4
-SELECT v1.i FROM v1 WHERE v1.i<125 FOR UPDATE;
-i
-123
-124
-123
-124
-123
-124
-123
-124
-connection root1;
-UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_view_storedp_1.result b/mysql-test/suite/row_lock/r/ndb_row_lock_view_storedp_1.result
deleted file mode 100644
index e2a2a6e7deb..00000000000
--- a/mysql-test/suite/row_lock/r/ndb_row_lock_view_storedp_1.result
+++ /dev/null
@@ -1,309 +0,0 @@
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
-DROP PROCEDURE IF EXISTS stp_t;
-SET autocommit=0;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-INSERT INTO t1 VALUES (5,127,5,127);
-INSERT INTO t1 VALUES (6,128,6,128);
-CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-INSERT INTO t2 VALUES (5,127,5,127);
-INSERT INTO t2 VALUES (6,128,6,128);
-CREATE INDEX ixi ON t2 (i);
-CREATE VIEW v1 AS SELECT t1.i from t1;
-CREATE PROCEDURE stp_t (IN p1 int, IN p2 int) MODIFIES SQL DATA
-BEGIN
-UPDATE t2 SET i = p2 WHERE i = p1;
-UPDATE v1 SET i = p2 WHERE i = p1;
-SELECT * FROM v1 ORDER BY i;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-END;
-|
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range ixi ixi 5 NULL 10 Using where
-SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-i
-123
-124
-connection root1;
-CALL stp_t (125, 225);
-i
-123
-124
-126
-127
-128
-225
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 126 4 126
-5 127 5 127
-6 128 6 128
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 126 4 126
-5 127 5 127
-6 128 6 128
-connection root2;
-CALL stp_t (127, 227);
-i
-123
-124
-125
-126
-128
-227
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-5 227 5 127
-6 128 6 128
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-5 227 5 127
-6 128 6 128
-connection default;
-CALL stp_t (123, 223);
-i
-124
-125
-126
-127
-128
-223
-k i j l
-1 223 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-5 127 5 127
-6 128 6 128
-k i j l
-1 223 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-5 127 5 127
-6 128 6 128
-connection root1;
-CALL stp_t (126, 226);
-i
-123
-124
-127
-128
-225
-226
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-5 127 5 127
-6 128 6 128
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-5 127 5 127
-6 128 6 128
-connection root2;
-CALL stp_t (128, 228);
-i
-123
-124
-125
-126
-227
-228
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-5 227 5 127
-6 228 6 128
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-5 227 5 127
-6 228 6 128
-connection default;
-CALL stp_t (124, 224);
-i
-125
-126
-127
-128
-223
-224
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-5 127 5 127
-6 128 6 128
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-5 127 5 127
-6 128 6 128
-connection root1;
-DELETE FROM t1 WHERE t1.i=226;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-5 127 5 127
-6 128 6 128
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-5 127 5 127
-6 128 6 128
-connection root2;
-DELETE FROM t1 WHERE t1.i=228;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-5 227 5 127
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-5 227 5 127
-6 228 6 128
-connection default;
-DELETE FROM t1 WHERE t1.i=224;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-3 125 3 125
-4 126 4 126
-5 127 5 127
-6 128 6 128
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-5 127 5 127
-6 128 6 128
-COMMIT;
-connection root1;
-ROLLBACK;
-connection root1;
-COMMIT;
-connection default;
-SELECT * FROM v1 ORDER BY i;
-i
-125
-126
-127
-128
-223
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-3 125 3 125
-4 126 4 126
-5 127 5 127
-6 128 6 128
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-5 127 5 127
-6 128 6 128
-connection root1;
-SELECT * FROM v1 ORDER BY i;
-i
-125
-126
-127
-128
-223
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-3 125 3 125
-4 126 4 126
-5 127 5 127
-6 128 6 128
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-5 127 5 127
-6 128 6 128
-connection root2;
-SELECT * FROM v1 ORDER BY i;
-i
-125
-126
-223
-227
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-3 125 3 125
-4 126 4 126
-5 227 5 127
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-5 227 5 127
-6 228 6 128
-connection default;
-DROP VIEW v1;
-DROP PROCEDURE stp_t;
-DROP TABLE t1, t2;
diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_view_storedp_2.result b/mysql-test/suite/row_lock/r/ndb_row_lock_view_storedp_2.result
deleted file mode 100644
index 6dbd5f834ed..00000000000
--- a/mysql-test/suite/row_lock/r/ndb_row_lock_view_storedp_2.result
+++ /dev/null
@@ -1,46 +0,0 @@
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
-DROP PROCEDURE IF EXISTS stp_t;
-SET autocommit=0;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-INSERT INTO t1 VALUES (5,127,5,127);
-INSERT INTO t1 VALUES (6,128,6,128);
-#CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-INSERT INTO t2 VALUES (5,127,5,127);
-INSERT INTO t2 VALUES (6,128,6,128);
-#CREATE INDEX ixi ON t2 (i);
-CREATE VIEW v1 AS SELECT t1.i from t1;
-CREATE PROCEDURE stp_t (IN p1 int, IN p2 int) MODIFIES SQL DATA
-BEGIN
-UPDATE t2 SET i = p2 WHERE i = p1;
-UPDATE v1 SET i = p2 WHERE i = p1;
-SELECT * FROM v1 ORDER BY i;
-SELECT * FROM t1 ORDER BY t1.k;
-SELECT * FROM t2 ORDER BY t2.k;
-END;
-|
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using where
-SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-i
-123
-124
-connection root1;
-CALL stp_t (125, 225);
diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_view_trig_1.result b/mysql-test/suite/row_lock/r/ndb_row_lock_view_trig_1.result
deleted file mode 100644
index f5c745ca41c..00000000000
--- a/mysql-test/suite/row_lock/r/ndb_row_lock_view_trig_1.result
+++ /dev/null
@@ -1,180 +0,0 @@
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-CREATE INDEX ixi ON t2 (i);
-CREATE VIEW v1 AS SELECT t1.i from t1;
-CREATE TRIGGER trig_t2 AFTER UPDATE ON t2
-FOR EACH ROW BEGIN
-UPDATE v1 SET i = NEW.i WHERE i = OLD.i;
-END;
-|
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range ixi ixi 5 NULL 10 Using where
-SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-i
-123
-124
-connection root1;
-UPDATE t2 SET t2.i=225 WHERE t2.i=125;
-SELECT * FROM v1 ORDER BY i;
-i
-123
-124
-126
-225
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 126 4 126
-connection default;
-UPDATE t2 SET t2.i=223 WHERE t2.i=123;
-SELECT * FROM v1 ORDER BY i;
-i
-124
-125
-126
-223
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 124 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-UPDATE t2 SET t2.i=226 WHERE t2.i=126;
-SELECT * FROM v1 ORDER BY i;
-i
-123
-124
-225
-226
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-connection default;
-UPDATE t2 SET t2.i=224 WHERE t2.i=124;
-SELECT * FROM v1 ORDER BY i;
-i
-125
-126
-223
-224
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-DELETE FROM t1 WHERE t1.i=226;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 123 1 123
-2 124 2 124
-3 225 3 125
-4 226 4 126
-connection default;
-DELETE FROM t1 WHERE t1.i=224;
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-COMMIT;
-connection root1;
-ROLLBACK;
-connection default;
-SELECT * FROM v1 ORDER BY i;
-i
-125
-126
-223
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-connection root1;
-SELECT * FROM v1 ORDER BY i;
-i
-125
-126
-223
-SELECT * FROM t1 ORDER BY t1.k;
-k i j l
-1 223 1 123
-3 125 3 125
-4 126 4 126
-SELECT * FROM t2 ORDER BY t2.k;
-k i j l
-1 223 1 123
-2 224 2 124
-3 125 3 125
-4 126 4 126
-connection default;
-DROP TABLE t1, t2;
-DROP VIEW v1;
diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_view_trig_2.result b/mysql-test/suite/row_lock/r/ndb_row_lock_view_trig_2.result
deleted file mode 100644
index d6a38753c1d..00000000000
--- a/mysql-test/suite/row_lock/r/ndb_row_lock_view_trig_2.result
+++ /dev/null
@@ -1,36 +0,0 @@
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
-SET autocommit=0;
-SET autocommit=0;
-connection default;
-CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t1 VALUES (1,123,1,123);
-INSERT INTO t1 VALUES (2,124,2,124);
-INSERT INTO t1 VALUES (3,125,3,125);
-INSERT INTO t1 VALUES (4,126,4,126);
-#CREATE INDEX ixi ON t1 (i);
-CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB;
-INSERT INTO t2 VALUES (1,123,1,123);
-INSERT INTO t2 VALUES (2,124,2,124);
-INSERT INTO t2 VALUES (3,125,3,125);
-INSERT INTO t2 VALUES (4,126,4,126);
-#CREATE INDEX ixi ON t2 (i);
-CREATE VIEW v1 AS SELECT t1.i from t1;
-CREATE TRIGGER trig_t2 AFTER UPDATE ON t2
-FOR EACH ROW BEGIN
-UPDATE v1 SET i = NEW.i WHERE i = OLD.i;
-END;
-|
-COMMIT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
-SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-i
-123
-124
-connection root1;
-UPDATE t2 SET t2.i=225 WHERE t2.i=125;
diff --git a/mysql-test/suite/row_lock/readme.txt b/mysql-test/suite/row_lock/readme.txt
deleted file mode 100644
index b43f04ecda4..00000000000
--- a/mysql-test/suite/row_lock/readme.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-All row lock test with InnoDB have to be executed with the options
-
---innodb_lock_wait_timeout=1
---innodb_locks_unsafe_for_binlog
-
-for example
-
-perl mysql-test-run.pl --mysqld=--innodb_lock_wait_timeout=2 --mysqld=--innodb_locks_unsafe_for_binlog --suite=row_lock innodb_row_lock_2
-
diff --git a/mysql-test/suite/row_lock/summary_of_sel_test.txt b/mysql-test/suite/row_lock/summary_of_sel_test.txt
deleted file mode 100644
index 0fa332e957a..00000000000
--- a/mysql-test/suite/row_lock/summary_of_sel_test.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-Test plan:
-Create 2 tables with a primary key and 3 integer columns. Both get the same rows (1,123,1,123),(2,124,2,124),(3,125,3,125),(4,126,4,126). The second and third column may get an index to have cases with, without and mutilple index. Create views on the tables. Create an update trigger. Create a stored procedure updating the table. Create a stored function updating the table and deliver the key as result.
-
-The test isself consists of 2 sessions (transactions) running in "parallel" (same user "root") accessing and locking the same tables on basis of a row lock. Expected is that both sessions(transactions) can update the table successfully.
-
-First session
-execute an explain to every select and one of the following selects on the first half of table t1:
-- select <non index columns> ... where ... for update;
-- select <non index columns> ... where ... lock in share mode;
-- select <indexed columns> ... where ... for update;
-- select <indexed columns> ... where ... lock in share mode;
-- select <indexed columns> ... ignore index ... where ... for update;
-- select <indexed columns> ... ignore index ... where ... lock in share mode;
-- select ... where (select...) ... for update;
-- select ... where (select...) ... lock in share mode;
-- (select ... where) union (select ... where) for update;
-- (select ... where) union (select ... where) lock in...;
-- select <view> ... where ... for update;
-- select <view> ... where ... lock in ...;
-- select <join> ... where ... for update;
-- select <join> ... where ... lock in ...;
-Then executes
-- update
-- delete
-- trigger accessing table t1
-- stored procedure accessing table t1
-- stored function accessing table t1
-
-Second session
-executes the same on the last half of table t1
-
-call of mysqld with option
---innodb_locks_unsafe_for_binlog
-
-As the tests above work with small tables (<10 rows) there must be at least one test with a big table (>1000 rows) doing a table scan.
-
diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_1.test b/mysql-test/suite/row_lock/t/innodb_row_lock_1.test
deleted file mode 100644
index e0440fe2669..00000000000
--- a/mysql-test/suite/row_lock/t/innodb_row_lock_1.test
+++ /dev/null
@@ -1,9 +0,0 @@
---source include/have_innodb.inc
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-let $engine= InnoDB;
-let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
-let $indext1= CREATE INDEX ixi ON t1 (i);
-let $indext2= CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock.inc
-SET @@global.innodb_table_locks= @table_locks;
diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_2.test b/mysql-test/suite/row_lock/t/innodb_row_lock_2.test
deleted file mode 100644
index 5cb3ea9f2d9..00000000000
--- a/mysql-test/suite/row_lock/t/innodb_row_lock_2.test
+++ /dev/null
@@ -1,9 +0,0 @@
---source include/have_innodb.inc
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-let $engine= InnoDB;
-let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
-let $indext1= #CREATE INDEX ixi ON t1 (i);
-let $indext2= #CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock.inc
-SET @@global.innodb_table_locks= @table_locks;
diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_3.test b/mysql-test/suite/row_lock/t/innodb_row_lock_3.test
deleted file mode 100644
index 11f4dc423d6..00000000000
--- a/mysql-test/suite/row_lock/t/innodb_row_lock_3.test
+++ /dev/null
@@ -1,9 +0,0 @@
---source include/have_innodb.inc
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-let $engine= InnoDB;
-let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE;
-let $indext1= #CREATE INDEX ixi ON t1 (i);
-let $indext2= #CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock.inc
-SET @@global.innodb_table_locks= @table_locks;
diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_4.test b/mysql-test/suite/row_lock/t/innodb_row_lock_4.test
deleted file mode 100644
index 0a8ca9c13a0..00000000000
--- a/mysql-test/suite/row_lock/t/innodb_row_lock_4.test
+++ /dev/null
@@ -1,9 +0,0 @@
---source include/have_innodb.inc
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-let $engine= InnoDB;
-let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE;
-let $indext1= CREATE INDEX ixi ON t1 (i);
-let $indext2= CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock.inc
-SET @@global.innodb_table_locks= @table_locks;
diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_5.test b/mysql-test/suite/row_lock/t/innodb_row_lock_5.test
deleted file mode 100644
index 7e411d31649..00000000000
--- a/mysql-test/suite/row_lock/t/innodb_row_lock_5.test
+++ /dev/null
@@ -1,9 +0,0 @@
---source include/have_innodb.inc
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-let $engine= InnoDB;
-let $select= SELECT t1.i,t2.i FROM t1 ignore index (ixi),t2 IGNORE INDEX (ixi) WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE;
-let $indext1= CREATE INDEX ixi ON t1 (i);
-let $indext2= CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock.inc
-SET @@global.innodb_table_locks= @table_locks;
diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_big_tab.test b/mysql-test/suite/row_lock/t/innodb_row_lock_big_tab.test
deleted file mode 100644
index 0c5b8b41bd5..00000000000
--- a/mysql-test/suite/row_lock/t/innodb_row_lock_big_tab.test
+++ /dev/null
@@ -1,9 +0,0 @@
---source include/have_innodb.inc
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-let $engine= InnoDB;
-let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i < half_t1() AND t2.i=t1.i LOCK IN SHARE MODE;
-let $indext1= CREATE INDEX ixi ON t1 (i);
-let $indext2= CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock_big_tab.inc
-SET @@global.innodb_table_locks= @table_locks;
diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_big_tab_1.test b/mysql-test/suite/row_lock/t/innodb_row_lock_big_tab_1.test
deleted file mode 100644
index a12a07d82a9..00000000000
--- a/mysql-test/suite/row_lock/t/innodb_row_lock_big_tab_1.test
+++ /dev/null
@@ -1,10 +0,0 @@
---source include/have_innodb.inc
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-let $engine= InnoDB;
-let $nbrows= 40;
-let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.k % 2= 0 AND t1.k = t2.k LOCK IN SHARE MODE;
-let $indext1= CREATE INDEX ixi ON t1 (i);
-let $indext2= CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock_big_tab_1.inc
-SET @@global.innodb_table_locks= @table_locks;
diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_big_tab_2.test b/mysql-test/suite/row_lock/t/innodb_row_lock_big_tab_2.test
deleted file mode 100644
index 49e834eb2ce..00000000000
--- a/mysql-test/suite/row_lock/t/innodb_row_lock_big_tab_2.test
+++ /dev/null
@@ -1,10 +0,0 @@
---source include/have_innodb.inc
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-let $engine= InnoDB;
-let $nbrows= 40;
-let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.k % 2= 0 AND t1.k = t2.k LOCK IN SHARE MODE;
-let $indext1= CREATE INDEX ixi ON t1 (i);
-let $indext2= CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock_big_tab_2.inc
-SET @@global.innodb_table_locks= @table_locks;
diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_trig_1.test b/mysql-test/suite/row_lock/t/innodb_row_lock_trig_1.test
deleted file mode 100644
index 225513d3f87..00000000000
--- a/mysql-test/suite/row_lock/t/innodb_row_lock_trig_1.test
+++ /dev/null
@@ -1,9 +0,0 @@
---source include/have_innodb.inc
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-let $engine= InnoDB;
-let $select= SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-let $indext1= CREATE INDEX ixi ON t1 (i);
-let $indext2= CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock_trig.inc
-SET @@global.innodb_table_locks= @table_locks;
diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_trig_2.test b/mysql-test/suite/row_lock/t/innodb_row_lock_trig_2.test
deleted file mode 100644
index 88dee5f23f8..00000000000
--- a/mysql-test/suite/row_lock/t/innodb_row_lock_trig_2.test
+++ /dev/null
@@ -1,9 +0,0 @@
---source include/have_innodb.inc
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-let $engine= InnoDB;
-let $select= SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-let $indext1= #CREATE INDEX ixi ON t1 (i);
-let $indext2= #CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock_trig.inc
-SET @@global.innodb_table_locks= @table_locks;
diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_view_1.test b/mysql-test/suite/row_lock/t/innodb_row_lock_view_1.test
deleted file mode 100644
index d6381e1da5b..00000000000
--- a/mysql-test/suite/row_lock/t/innodb_row_lock_view_1.test
+++ /dev/null
@@ -1,9 +0,0 @@
---source include/have_innodb.inc
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-let $engine= InnoDB;
-let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
-let $indext1= CREATE INDEX ixi ON t1 (i);
-let $indext2= CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock_view.inc
-SET @@global.innodb_table_locks= @table_locks;
diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_view_2.test b/mysql-test/suite/row_lock/t/innodb_row_lock_view_2.test
deleted file mode 100644
index ee45e683669..00000000000
--- a/mysql-test/suite/row_lock/t/innodb_row_lock_view_2.test
+++ /dev/null
@@ -1,9 +0,0 @@
---source include/have_innodb.inc
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-let $engine= InnoDB;
-let $select= SELECT v1.i FROM v1 WHERE v1.i<125 FOR UPDATE;
-let $indext1= CREATE INDEX ixi ON t1 (i);
-let $indext2= CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock_view.inc
-SET @@global.innodb_table_locks= @table_locks;
diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_view_mix_1.test b/mysql-test/suite/row_lock/t/innodb_row_lock_view_mix_1.test
deleted file mode 100644
index 49cba88dd23..00000000000
--- a/mysql-test/suite/row_lock/t/innodb_row_lock_view_mix_1.test
+++ /dev/null
@@ -1,9 +0,0 @@
---source include/have_innodb.inc
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-let $engine= InnoDB;
-let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
-let $indext1= CREATE INDEX ixi ON t1 (i);
-let $indext2= CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock_view_mix.inc
-SET @@global.innodb_table_locks= @table_locks;
diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_view_mix_2.test b/mysql-test/suite/row_lock/t/innodb_row_lock_view_mix_2.test
deleted file mode 100644
index b07f3a3378a..00000000000
--- a/mysql-test/suite/row_lock/t/innodb_row_lock_view_mix_2.test
+++ /dev/null
@@ -1,10 +0,0 @@
---source include/have_innodb.inc
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-let $engine= InnoDB;
-#let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
-let $select= SELECT v1.i FROM v1 WHERE v1.i<125 FOR UPDATE;
-let $indext1= CREATE INDEX ixi ON t1 (i);
-let $indext2= CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock_view_mix.inc
-SET @@global.innodb_table_locks= @table_locks;
diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_view_storedp_1.test b/mysql-test/suite/row_lock/t/innodb_row_lock_view_storedp_1.test
deleted file mode 100644
index d507ff3296f..00000000000
--- a/mysql-test/suite/row_lock/t/innodb_row_lock_view_storedp_1.test
+++ /dev/null
@@ -1,9 +0,0 @@
---source include/have_innodb.inc
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-let $engine= InnoDB;
-let $select= SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-let $indext1= CREATE INDEX ixi ON t1 (i);
-let $indext2= CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock_view_storedp.inc
-SET @@global.innodb_table_locks= @table_locks;
diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_view_storedp_2.test b/mysql-test/suite/row_lock/t/innodb_row_lock_view_storedp_2.test
deleted file mode 100644
index a1bfb16055e..00000000000
--- a/mysql-test/suite/row_lock/t/innodb_row_lock_view_storedp_2.test
+++ /dev/null
@@ -1,9 +0,0 @@
---source include/have_innodb.inc
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-let $engine= InnoDB;
-let $select= SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-let $indext1= #CREATE INDEX ixi ON t1 (i);
-let $indext2= #CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock_view_storedp.inc
-SET @@global.innodb_table_locks= @table_locks;
diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_view_trig_1.test b/mysql-test/suite/row_lock/t/innodb_row_lock_view_trig_1.test
deleted file mode 100644
index 24c76532d17..00000000000
--- a/mysql-test/suite/row_lock/t/innodb_row_lock_view_trig_1.test
+++ /dev/null
@@ -1,9 +0,0 @@
---source include/have_innodb.inc
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-let $engine= InnoDB;
-let $select= SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-let $indext1= CREATE INDEX ixi ON t1 (i);
-let $indext2= CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock_view_trig.inc
-SET @@global.innodb_table_locks= @table_locks;
diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_view_trig_2.test b/mysql-test/suite/row_lock/t/innodb_row_lock_view_trig_2.test
deleted file mode 100644
index a8a67d77979..00000000000
--- a/mysql-test/suite/row_lock/t/innodb_row_lock_view_trig_2.test
+++ /dev/null
@@ -1,9 +0,0 @@
---source include/have_innodb.inc
-SELECT @@global.innodb_table_locks into @table_locks;
-SET @@global.innodb_table_locks= OFF;
-let $engine= InnoDB;
-let $select= SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-let $indext1= #CREATE INDEX ixi ON t1 (i);
-let $indext2= #CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock_view_trig.inc
-SET @@global.innodb_table_locks= @table_locks;
diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_1.test b/mysql-test/suite/row_lock/t/ndb_row_lock_1.test
deleted file mode 100644
index 6ac2e829008..00000000000
--- a/mysql-test/suite/row_lock/t/ndb_row_lock_1.test
+++ /dev/null
@@ -1,6 +0,0 @@
---source include/have_ndb.inc
-let $engine= NDB;
-let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
-let $indext1= CREATE INDEX ixi ON t1 (i);
-let $indext2= CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock.inc
diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_2.test b/mysql-test/suite/row_lock/t/ndb_row_lock_2.test
deleted file mode 100644
index 994ecba96b0..00000000000
--- a/mysql-test/suite/row_lock/t/ndb_row_lock_2.test
+++ /dev/null
@@ -1,6 +0,0 @@
---source include/have_ndb.inc
-let $engine= NDB;
-let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
-let $indext1= #CREATE INDEX ixi ON t1 (i);
-let $indext2= #CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock.inc
diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_3.test b/mysql-test/suite/row_lock/t/ndb_row_lock_3.test
deleted file mode 100644
index 2de43c61c2a..00000000000
--- a/mysql-test/suite/row_lock/t/ndb_row_lock_3.test
+++ /dev/null
@@ -1,6 +0,0 @@
---source include/have_ndb.inc
-let $engine= NDB;
-let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE;
-let $indext1= #CREATE INDEX ixi ON t1 (i);
-let $indext2= #CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock.inc
diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_4.test b/mysql-test/suite/row_lock/t/ndb_row_lock_4.test
deleted file mode 100644
index 72b20488c74..00000000000
--- a/mysql-test/suite/row_lock/t/ndb_row_lock_4.test
+++ /dev/null
@@ -1,6 +0,0 @@
---source include/have_ndb.inc
-let $engine= NDB;
-let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE;
-let $indext1= CREATE INDEX ixi ON t1 (i);
-let $indext2= CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock.inc
diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_5.test b/mysql-test/suite/row_lock/t/ndb_row_lock_5.test
deleted file mode 100644
index 045f127a4ef..00000000000
--- a/mysql-test/suite/row_lock/t/ndb_row_lock_5.test
+++ /dev/null
@@ -1,6 +0,0 @@
---source include/have_ndb.inc
-let $engine= NDB;
-let $select= SELECT t1.i,t2.i FROM t1 ignore index (ixi),t2 IGNORE INDEX (ixi) WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE;
-let $indext1= CREATE INDEX ixi ON t1 (i);
-let $indext2= CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock.inc
diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_big_tab.test b/mysql-test/suite/row_lock/t/ndb_row_lock_big_tab.test
deleted file mode 100644
index bf2df104e03..00000000000
--- a/mysql-test/suite/row_lock/t/ndb_row_lock_big_tab.test
+++ /dev/null
@@ -1,6 +0,0 @@
---source include/have_ndb.inc
-let $engine= NDB;
-let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i < half_t1() AND t2.i=t1.i LOCK IN SHARE MODE;
-let $indext1= CREATE INDEX ixi ON t1 (i);
-let $indext2= CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock_big_tab.inc
diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_big_tab_1.test b/mysql-test/suite/row_lock/t/ndb_row_lock_big_tab_1.test
deleted file mode 100644
index 4d32991d379..00000000000
--- a/mysql-test/suite/row_lock/t/ndb_row_lock_big_tab_1.test
+++ /dev/null
@@ -1,7 +0,0 @@
---source include/have_ndb.inc
-let $engine= NDB;
-let $nbrows= 200;
-let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i < t1.k % 2 = 0 AND t2.k=t1.k LOCK IN SHARE MODE;
-let $indext1= CREATE INDEX ixi ON t1 (i);
-let $indext2= CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock_big_tab_1.inc
diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_big_tab_2.test b/mysql-test/suite/row_lock/t/ndb_row_lock_big_tab_2.test
deleted file mode 100644
index 894a83fc1b0..00000000000
--- a/mysql-test/suite/row_lock/t/ndb_row_lock_big_tab_2.test
+++ /dev/null
@@ -1,7 +0,0 @@
---source include/have_ndb.inc
-let $engine= NDB;
-let $nbrows= 200;
-let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i < t1.k % 2 = 0 AND t2.k=t1.k LOCK IN SHARE MODE;
-let $indext1= CREATE INDEX ixi ON t1 (i);
-let $indext2= CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock_big_tab_2.inc
diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_trig_1.test b/mysql-test/suite/row_lock/t/ndb_row_lock_trig_1.test
deleted file mode 100644
index a5586a6101e..00000000000
--- a/mysql-test/suite/row_lock/t/ndb_row_lock_trig_1.test
+++ /dev/null
@@ -1,6 +0,0 @@
---source include/have_ndb.inc
-let $engine= NDB;
-let $select= SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-let $indext1= CREATE INDEX ixi ON t1 (i);
-let $indext2= CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock_trig.inc
diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_trig_2.test b/mysql-test/suite/row_lock/t/ndb_row_lock_trig_2.test
deleted file mode 100644
index 7af13697ccc..00000000000
--- a/mysql-test/suite/row_lock/t/ndb_row_lock_trig_2.test
+++ /dev/null
@@ -1,6 +0,0 @@
---source include/have_ndb.inc
-let $engine= NDB;
-let $select= SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-let $indext1= #CREATE INDEX ixi ON t1 (i);
-let $indext2= #CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock_trig.inc
diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_view_1.test b/mysql-test/suite/row_lock/t/ndb_row_lock_view_1.test
deleted file mode 100644
index a1aaf5ab441..00000000000
--- a/mysql-test/suite/row_lock/t/ndb_row_lock_view_1.test
+++ /dev/null
@@ -1,7 +0,0 @@
---source include/have_ndb.inc
-let $engine= NDB;
-let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
-let $indext1= CREATE INDEX ixi ON t1 (i);
-let $indext2= CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock_view.inc
-
diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_view_2.test b/mysql-test/suite/row_lock/t/ndb_row_lock_view_2.test
deleted file mode 100644
index b8feef693e7..00000000000
--- a/mysql-test/suite/row_lock/t/ndb_row_lock_view_2.test
+++ /dev/null
@@ -1,6 +0,0 @@
---source include/have_ndb.inc
-let $engine= NDB;
-let $select= SELECT v1.i FROM v1 WHERE v1.i<125 FOR UPDATE;
-let $indext1= CREATE INDEX ixi ON t1 (i);
-let $indext2= CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock_view.inc
diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_view_mix_1.test b/mysql-test/suite/row_lock/t/ndb_row_lock_view_mix_1.test
deleted file mode 100644
index a97626048d3..00000000000
--- a/mysql-test/suite/row_lock/t/ndb_row_lock_view_mix_1.test
+++ /dev/null
@@ -1,6 +0,0 @@
---source include/have_ndb.inc
-let $engine= NDB;
-let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
-let $indext1= CREATE INDEX ixi ON t1 (i);
-let $indext2= CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock_view_mix.inc
diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_view_mix_2.test b/mysql-test/suite/row_lock/t/ndb_row_lock_view_mix_2.test
deleted file mode 100644
index e7a9a715785..00000000000
--- a/mysql-test/suite/row_lock/t/ndb_row_lock_view_mix_2.test
+++ /dev/null
@@ -1,6 +0,0 @@
---source include/have_ndb.inc
-let $engine= NDB;
-let $select= SELECT v1.i FROM v1 WHERE v1.i<125 FOR UPDATE;
-let $indext1= CREATE INDEX ixi ON t1 (i);
-let $indext2= CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock_view_mix.inc
diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_view_storedp_1.test b/mysql-test/suite/row_lock/t/ndb_row_lock_view_storedp_1.test
deleted file mode 100644
index f57bcb3dd1b..00000000000
--- a/mysql-test/suite/row_lock/t/ndb_row_lock_view_storedp_1.test
+++ /dev/null
@@ -1,6 +0,0 @@
---source include/have_ndb.inc
-let $engine= NDB;
-let $select= SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-let $indext1= CREATE INDEX ixi ON t1 (i);
-let $indext2= CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock_view_storedp.inc
diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_view_storedp_2.test b/mysql-test/suite/row_lock/t/ndb_row_lock_view_storedp_2.test
deleted file mode 100644
index b0aaa38fb93..00000000000
--- a/mysql-test/suite/row_lock/t/ndb_row_lock_view_storedp_2.test
+++ /dev/null
@@ -1,6 +0,0 @@
---source include/have_ndb.inc
-let $engine= NDB;
-let $select= SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-let $indext1= #CREATE INDEX ixi ON t1 (i);
-let $indext2= #CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock_view_storedp.inc
diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_view_trig_1.test b/mysql-test/suite/row_lock/t/ndb_row_lock_view_trig_1.test
deleted file mode 100644
index 9c4128d78bf..00000000000
--- a/mysql-test/suite/row_lock/t/ndb_row_lock_view_trig_1.test
+++ /dev/null
@@ -1,6 +0,0 @@
---source include/have_ndb.inc
-let $engine= NDB;
-let $select= SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-let $indext1= CREATE INDEX ixi ON t1 (i);
-let $indext2= CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock_view_trig.inc
diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_view_trig_2.test b/mysql-test/suite/row_lock/t/ndb_row_lock_view_trig_2.test
deleted file mode 100644
index 38c9472fb3d..00000000000
--- a/mysql-test/suite/row_lock/t/ndb_row_lock_view_trig_2.test
+++ /dev/null
@@ -1,6 +0,0 @@
---source include/have_ndb.inc
-let $engine= NDB;
-let $select= SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE;
-let $indext1= #CREATE INDEX ixi ON t1 (i);
-let $indext2= #CREATE INDEX ixi ON t2 (i);
---source suite/row_lock/include/row_lock_view_trig.inc
diff --git a/mysql-test/suite/rpl/include/rpl_mixed_ddl.inc b/mysql-test/suite/rpl/include/rpl_mixed_ddl.inc
index 7ea92a5cc1e..6a00dcc6e50 100644
--- a/mysql-test/suite/rpl/include/rpl_mixed_ddl.inc
+++ b/mysql-test/suite/rpl/include/rpl_mixed_ddl.inc
@@ -67,7 +67,7 @@ ALTER TABLE t2 DROP COLUMN d;
--echo
--echo ******************** SHOW BINLOG EVENTS ********************
--replace_column 2 # 5 #
---replace_regex /table_id: [0-9]+/table_id: #/
+--replace_regex /Server ver: .+/Server ver: #/ /table_id: [0-9]+/table_id: #/
show binlog events from 1;
sync_slave_with_master;
# as we're using UUID we don't SELECT but use "diff" like in rpl_row_UUID
@@ -83,4 +83,4 @@ sync_slave_with_master;
# will be created. You will need to go to the mysql-test dir and diff
# the files your self to see what is not matching
---exec diff $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql;
+--exec diff $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql
diff --git a/mysql-test/suite/rpl/include/rpl_mixed_dml.inc b/mysql-test/suite/rpl/include/rpl_mixed_dml.inc
index c79eb756c7f..96dfdbed541 100644
--- a/mysql-test/suite/rpl/include/rpl_mixed_dml.inc
+++ b/mysql-test/suite/rpl/include/rpl_mixed_dml.inc
@@ -51,7 +51,9 @@ DELETE FROM t2 WHERE a = 2;
--echo
--echo ******************** LOAD DATA INFILE ********************
-LOAD DATA INFILE '../../suite/rpl/data/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ;
+--exec cp ./suite/rpl/data/rpl_mixed.dat $MYSQLTEST_VARDIR/tmp/
+LOAD DATA INFILE '../tmp/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ;
+--exec rm $MYSQLTEST_VARDIR/tmp/rpl_mixed.dat
SELECT * FROM t1;
--source suite/rpl/include/rpl_mixed_check_select.inc
--source suite/rpl/include/rpl_mixed_clear_tables.inc
@@ -326,8 +328,8 @@ DROP VIEW v2;
--echo
--echo ******************** SHOW BINLOG EVENTS ********************
--replace_column 2 # 5 #
---replace_regex /table_id: [0-9]+/table_id: #/ /COMMIT.+xid=[0-9]+.+/#/
-show binlog events from 102;
+--replace_regex /Server ver: .+/Server ver: #/ /table_id: [0-9]+/table_id: #/ /COMMIT.+xid=[0-9]+.+/#/ /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/
+show binlog events from 1;
sync_slave_with_master;
# as we're using UUID we don't SELECT but use "diff" like in rpl_row_UUID
--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test_rpl > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql
@@ -342,4 +344,4 @@ sync_slave_with_master;
# will be created. You will need to go to the mysql-test dir and diff
# the files your self to see what is not matching
---exec diff $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql;
+--exec diff $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql
diff --git a/mysql-test/r/rpl000001.a.result b/mysql-test/suite/rpl/r/rpl000001.a.result
index c52b83d729a..c52b83d729a 100644
--- a/mysql-test/r/rpl000001.a.result
+++ b/mysql-test/suite/rpl/r/rpl000001.a.result
diff --git a/mysql-test/r/rpl000001.b.result b/mysql-test/suite/rpl/r/rpl000001.b.result
index 5108cfdaf26..5108cfdaf26 100644
--- a/mysql-test/r/rpl000001.b.result
+++ b/mysql-test/suite/rpl/r/rpl000001.b.result
diff --git a/mysql-test/r/rpl000010.result b/mysql-test/suite/rpl/r/rpl000010.result
index 65191ea411f..65191ea411f 100644
--- a/mysql-test/r/rpl000010.result
+++ b/mysql-test/suite/rpl/r/rpl000010.result
diff --git a/mysql-test/r/rpl000011.result b/mysql-test/suite/rpl/r/rpl000011.result
index dd0fa2fbe74..dd0fa2fbe74 100644
--- a/mysql-test/r/rpl000011.result
+++ b/mysql-test/suite/rpl/r/rpl000011.result
diff --git a/mysql-test/r/rpl000013.result b/mysql-test/suite/rpl/r/rpl000013.result
index 37838bb88e0..37838bb88e0 100644
--- a/mysql-test/r/rpl000013.result
+++ b/mysql-test/suite/rpl/r/rpl000013.result
diff --git a/mysql-test/r/rpl000017.result b/mysql-test/suite/rpl/r/rpl000017.result
index 1c611357e64..1c611357e64 100644
--- a/mysql-test/r/rpl000017.result
+++ b/mysql-test/suite/rpl/r/rpl000017.result
diff --git a/mysql-test/suite/rpl/r/rpl_000015.result b/mysql-test/suite/rpl/r/rpl_000015.result
new file mode 100644
index 00000000000..79d87354cb2
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_000015.result
@@ -0,0 +1,141 @@
+reset master;
+show master status;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000001 106
+reset slave;
+SHOW SLAVE STATUS;
+change master to master_host='127.0.0.1';
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User test
+Master_Port 3306
+Connect_Retry 7
+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 #
+Last_IO_Error #
+Last_SQL_Errno 0
+Last_SQL_Error
+change master to master_host='127.0.0.1',master_user='root',
+master_password='',master_port=MASTER_PORT;
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 7
+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 #
+Last_IO_Error #
+Last_SQL_Errno 0
+Last_SQL_Error
+start slave;
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 7
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos 106
+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 106
+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
+drop table if exists t1;
+create table t1 (n int, PRIMARY KEY(n));
+insert into t1 values (10),(45),(90);
+SELECT * FROM t1 ORDER BY n;
+n
+10
+45
+90
+SELECT * FROM t1 ORDER BY n;
+n
+10
+45
+90
+drop table t1;
diff --git a/mysql-test/r/rpl_EE_err.result b/mysql-test/suite/rpl/r/rpl_EE_err.result
index 16fa931e303..16fa931e303 100644
--- a/mysql-test/r/rpl_EE_err.result
+++ b/mysql-test/suite/rpl/r/rpl_EE_err.result
diff --git a/mysql-test/r/rpl_LD_INFILE.result b/mysql-test/suite/rpl/r/rpl_LD_INFILE.result
index 70013f95d85..70013f95d85 100644
--- a/mysql-test/r/rpl_LD_INFILE.result
+++ b/mysql-test/suite/rpl/r/rpl_LD_INFILE.result
diff --git a/mysql-test/r/rpl_alter.result b/mysql-test/suite/rpl/r/rpl_alter.result
index 6ef5ce3462a..6ef5ce3462a 100644
--- a/mysql-test/r/rpl_alter.result
+++ b/mysql-test/suite/rpl/r/rpl_alter.result
diff --git a/mysql-test/r/rpl_alter_db.result b/mysql-test/suite/rpl/r/rpl_alter_db.result
index 6edbe5d427f..6edbe5d427f 100644
--- a/mysql-test/r/rpl_alter_db.result
+++ b/mysql-test/suite/rpl/r/rpl_alter_db.result
diff --git a/mysql-test/r/rpl_auto_increment.result b/mysql-test/suite/rpl/r/rpl_auto_increment.result
index 083f3a4e901..083f3a4e901 100644
--- a/mysql-test/r/rpl_auto_increment.result
+++ b/mysql-test/suite/rpl/r/rpl_auto_increment.result
diff --git a/mysql-test/r/rpl_auto_increment_11932.result b/mysql-test/suite/rpl/r/rpl_auto_increment_11932.result
index 25eda6ee454..25eda6ee454 100644
--- a/mysql-test/r/rpl_auto_increment_11932.result
+++ b/mysql-test/suite/rpl/r/rpl_auto_increment_11932.result
diff --git a/mysql-test/suite/rpl/r/rpl_binlog_grant.result b/mysql-test/suite/rpl/r/rpl_binlog_grant.result
new file mode 100644
index 00000000000..43a21913cf6
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_binlog_grant.result
@@ -0,0 +1,50 @@
+drop database if exists d1;
+create database d1;
+use d1;
+create table t (s1 int) engine=innodb;
+set @@autocommit=0;
+start transaction;
+insert into t values (1);
+grant select on t to x@y;
+rollback;
+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;
+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 use `d1`; 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
+start transaction;
+insert into t values (2);
+revoke select on t from x@y;
+commit;
+select * from t;
+s1
+1
+2
+show grants for x@y;
+Grants for x@y
+GRANT USAGE ON *.* TO 'x'@'y'
+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 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 use `d1`; 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 use `d1`; 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
+drop user x@y;
+drop database d1;
diff --git a/mysql-test/r/rpl_bit.result b/mysql-test/suite/rpl/r/rpl_bit.result
index 924de8a65f8..924de8a65f8 100644
--- a/mysql-test/r/rpl_bit.result
+++ b/mysql-test/suite/rpl/r/rpl_bit.result
diff --git a/mysql-test/r/rpl_bit_npk.result b/mysql-test/suite/rpl/r/rpl_bit_npk.result
index 9599660f18f..9599660f18f 100644
--- a/mysql-test/r/rpl_bit_npk.result
+++ b/mysql-test/suite/rpl/r/rpl_bit_npk.result
diff --git a/mysql-test/suite/rpl/r/rpl_bug31076.result b/mysql-test/suite/rpl/r/rpl_bug31076.result
new file mode 100644
index 00000000000..fb819b03ad3
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_bug31076.result
@@ -0,0 +1,65 @@
+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 DATABASE track;
+USE track;
+CREATE TABLE `visits` (
+`visits_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+`myid` varchar(32) NOT NULL DEFAULT '',
+`src` varchar(64) NOT NULL DEFAULT '',
+`ip` int(10) unsigned NOT NULL DEFAULT '0',
+`cc` char(2) NOT NULL DEFAULT '',
+`org` varchar(80) DEFAULT NULL,
+`ref` varchar(255) NOT NULL DEFAULT '',
+`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+`host` varchar(30) NOT NULL DEFAULT '',
+`entry` varchar(255) NOT NULL DEFAULT '',
+`visit_exit` varchar(255) NOT NULL DEFAULT '',
+`user_id` int(11) unsigned NOT NULL DEFAULT '0',
+`visit_start` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+PRIMARY KEY (`visits_id`),
+KEY `ip` (`ip`),
+KEY `time` (`time`),
+KEY `user_id` (`user_id`)
+) ENGINE=MyISAM AUTO_INCREMENT=21293381 DEFAULT CHARSET=latin1;
+CREATE TABLE `visits_events` (
+`event_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
+`visit_id` int(11) unsigned NOT NULL DEFAULT '0',
+`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+`src` varchar(64) NOT NULL DEFAULT '',
+`data` varchar(255) NOT NULL DEFAULT '',
+`visits_events_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (`visits_events_id`),
+KEY `event_id` (`event_id`),
+KEY `visit_id` (`visit_id`),
+KEY `data` (`data`)
+) ENGINE=MyISAM AUTO_INCREMENT=33900731 DEFAULT CHARSET=latin1;
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+BINLOG '
+Bk3vRhO0AQAAOAAAALcLyQkAAJlXFwIAAAAABXRyYWNrAA12aXNpdHNfZXZlbnRzAAYJAwcPDwM=
+Bk3vRhe0AQAAWgAAABEMyQkQAJlXFwIAAAEABv/AIE4AvvVDAQZN70YAK0Rvd25sb2Fkcy9NeVNR
+TC00LjEvbXlzcWwtNC4xLjEyYS13aW4zMi56aXBPaAIC
+'/*!*/;
+SET INSERT_ID=21231039/*!*/;
+use track/*!*/;
+SET TIMESTAMP=1190087942/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.sql_mode=0/*!*/;
+SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
+SET @@session.time_zone='UTC'/*!*/;
+INSERT INTO visits (myid, user_id, src, ip, cc, org, ref, time, host, entry, visit_exit, visit_start)
+VALUES ('3m3l4rhs6do0sf5p1i9lr94g928a272v', '', '', INET_ATON('71.118.124.98'), '', '', 'http://dev.mysql.com/downloads/connector/j/3.0.html', NULL, 'dev.mysql.com', '/get/Downloads/Connector-J/mysql-connector-java-3.0.17-ga.zip/from/pick', '/get/Downloads/Connector-J/mysql-connector-java-3.0.17-ga.zip/from/pick', NOW())/*!*/;
+Warnings:
+Warning 1366 Incorrect integer value: '' for column 'user_id' at row 1
+SELECT * FROM visits;
+visits_id myid src ip cc org ref time host entry visit_exit user_id visit_start
+21231039 3m3l4rhs6do0sf5p1i9lr94g928a272v 1198947426 http://dev.mysql.com/downloads/connector/j/3.0.html 2007-09-18 03:59:02 dev.mysql.com /get/Downloads/Connector-J/mysql-connector-java-3.0.17-ga.zip/from/pick /get/Downloads/Connector-J/mysql-connector-java-3.0.17-ga.zip/from/pick 0 2007-09-18 03:59:02
+SELECT * FROM visits_events;
+event_id visit_id timestamp src data visits_events_id
+20000 21231038 2007-09-18 03:59:02 Downloads/MySQL-4.1/mysql-4.1.12a-win32.zip 33712207
+DROP DATABASE track;
+End of 5.1 tests
diff --git a/mysql-test/suite/rpl/r/rpl_change_master.result b/mysql-test/suite/rpl/r/rpl_change_master.result
new file mode 100644
index 00000000000..7707ca2cf9b
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_change_master.result
@@ -0,0 +1,98 @@
+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(n int);
+select * from t1;
+n
+stop slave sql_thread;
+insert into t1 values(1);
+insert into t1 values(2);
+stop slave;
+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 #
+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 191
+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
+change master to master_user='root';
+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 #
+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 191
+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
+start slave;
+select * from t1;
+n
+1
+2
+drop table t1;
diff --git a/mysql-test/r/rpl_charset_sjis.result b/mysql-test/suite/rpl/r/rpl_charset_sjis.result
index 770ad0588d1..770ad0588d1 100644
--- a/mysql-test/r/rpl_charset_sjis.result
+++ b/mysql-test/suite/rpl/r/rpl_charset_sjis.result
diff --git a/mysql-test/suite/rpl/r/rpl_colSize.result b/mysql-test/suite/rpl/r/rpl_colSize.result
new file mode 100644
index 00000000000..91456742833
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_colSize.result
@@ -0,0 +1,179 @@
+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;
+DROP TABLE IF EXISTS t1;
+**** Testing WL#3228 changes. ****
+*** Create "wider" table on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t1 (
+a float (47),
+b double (143,9),
+c decimal (65,30),
+d numeric (4,0),
+e bit (32),
+f char (21),
+g varchar (1300),
+h binary (33),
+j varbinary (200),
+k enum ('5','6','7', '8','9','0'),
+l set ('1','2','3','4','5','6','7','8','9','0','11','12','13','14','15','16','17','18','19','21','22','23','24','25','26','27','28','29'),
+m TINYBLOB,
+n BLOB,
+o MEDIUMBLOB,
+p LONGBLOB,
+q TINYTEXT,
+r TEXT,
+s MEDIUMTEXT,
+t LONGTEXT
+);
+*** Create same table on master but with narrow columns ***
+CREATE TABLE t1 (
+a float (44),
+b double (10,3),
+c decimal (10,2),
+d numeric (3,0),
+e bit (16),
+f char (10),
+g varchar (100),
+h binary (20),
+j varbinary (20),
+k enum ('5','6','7'),
+l set ('1','2','3','4','5','6','7','8','9','0'),
+m TINYBLOB,
+n BLOB,
+o MEDIUMBLOB,
+p LONGBLOB,
+q TINYTEXT,
+r TEXT,
+s MEDIUMTEXT,
+t LONGTEXT
+);
+RESET MASTER;
+*** Start replication ***
+START SLAVE;
+*** Insert data on master and display it. ***
+INSERT INTO t1 () VALUES (
+17.567,
+2.123,
+10.20,
+125,
+hex(64),
+'TEST',
+'This is a test',
+'binary data',
+'more binary data',
+'6',
+'7',
+"blob 1",
+"blob 2",
+"blob 3",
+"blob 4",
+"text 1",
+"text 2",
+"text 3",
+"text 4");
+SELECT * FROM t1 ORDER BY a;
+a b c d e f g h j k l m n o p q r s t
+17.567 2.123 10.20 125 # TEST This is a test # more binary data 6 7 blob 1 blob 2 blob 3 blob 4 text 1 text 2 text 3 text 4
+*** Select data from slave to compare ***
+SELECT * FROM t1 ORDER BY a;
+a b c d e f g h j k l m n o p q r s t
+17.567 2.123000000 10.200000000000000000000000000000 125 # TEST This is a test # more binary data 6 7 blob 1 blob 2 blob 3 blob 4 text 1 text 2 text 3 text 4
+DROP TABLE t1;
+Create varchar table on master
+CREATE TABLE t1 (
+a VARCHAR(50),
+b VARCHAR(100),
+c VARCHAR(300),
+d CHAR(5)
+);
+Alter varchar table on slave
+ALTER TABLE t1 CHANGE COLUMN a a VARCHAR(100);
+ALTER TABLE t1 CHANGE COLUMN b b VARCHAR(400);
+ALTER TABLE t1 CHANGE COLUMN c c VARCHAR(500);
+ALTER TABLE t1 CHANGE COLUMN d d CHAR(100);
+Insert some values and select them on master
+INSERT INTO t1 VALUES ("This is a test of col a.",
+"This is another test of col b.",
+"This is a test of the large col c.",
+"Col d");
+SELECT * FROM t1;
+a b c d
+This is a test of col a. This is another test of col b. This is a test of the large col c. Col d
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(50) DEFAULT NULL,
+ `b` varchar(100) DEFAULT NULL,
+ `c` varchar(300) DEFAULT NULL,
+ `d` char(5) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+Insert some values and select them on slave
+SELECT * FROM t1;
+a b c d
+This is a test of col a. This is another test of col b. This is a test of the large col c. Col d
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(100) DEFAULT NULL,
+ `b` varchar(400) DEFAULT NULL,
+ `c` varchar(500) DEFAULT NULL,
+ `d` char(100) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+Create bit table on master
+CREATE TABLE t1 (
+a BIT(7),
+b BIT(8),
+c BIT(21),
+d BIT(11),
+e BIT(11)
+);
+Create bit table on slave
+DROP TABLE t1;
+CREATE TABLE t1 (
+a BIT(16),
+b BIT(22),
+c BIT(54),
+d BIT(25),
+e BIT(13)
+);
+Insert some values and select them on master
+INSERT INTO t1 VALUES (
+b'1010101',
+b'10101011',
+b'101010110101010101111',
+b'10101010101',
+b'10101011111'
+ );
+SELECT BIN(a), BIN(b), BIN(c), BIN(d), BIN(e) FROM t1;
+BIN(a) BIN(b) BIN(c) BIN(d) BIN(e)
+1010101 10101011 101010110101010101111 10101010101 10101011111
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` bit(7) DEFAULT NULL,
+ `b` bit(8) DEFAULT NULL,
+ `c` bit(21) DEFAULT NULL,
+ `d` bit(11) DEFAULT NULL,
+ `e` bit(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+Insert some values and select them on master
+SELECT BIN(a), BIN(b), BIN(c), BIN(d), BIN(e) FROM t1;
+BIN(a) BIN(b) BIN(c) BIN(d) BIN(e)
+1010101 10101011 101010110101010101111 10101010101 10101011111
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` bit(16) DEFAULT NULL,
+ `b` bit(22) DEFAULT NULL,
+ `c` bit(54) DEFAULT NULL,
+ `d` bit(25) DEFAULT NULL,
+ `e` bit(13) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+*** Cleanup ***
+DROP TABLE t1;
diff --git a/mysql-test/r/rpl_commit_after_flush.result b/mysql-test/suite/rpl/r/rpl_commit_after_flush.result
index eaddda63b6a..eaddda63b6a 100644
--- a/mysql-test/r/rpl_commit_after_flush.result
+++ b/mysql-test/suite/rpl/r/rpl_commit_after_flush.result
diff --git a/mysql-test/r/rpl_create_database.result b/mysql-test/suite/rpl/r/rpl_create_database.result
index 0cfd44bc58c..0cfd44bc58c 100644
--- a/mysql-test/r/rpl_create_database.result
+++ b/mysql-test/suite/rpl/r/rpl_create_database.result
diff --git a/mysql-test/r/rpl_critical_errors.result b/mysql-test/suite/rpl/r/rpl_critical_errors.result
index bcc53565084..bcc53565084 100644
--- a/mysql-test/r/rpl_critical_errors.result
+++ b/mysql-test/suite/rpl/r/rpl_critical_errors.result
diff --git a/mysql-test/r/rpl_critical_errors.result.txt b/mysql-test/suite/rpl/r/rpl_critical_errors.result.txt
index 0df2e1ef369..0df2e1ef369 100644
--- a/mysql-test/r/rpl_critical_errors.result.txt
+++ b/mysql-test/suite/rpl/r/rpl_critical_errors.result.txt
diff --git a/mysql-test/r/rpl_ddl.result b/mysql-test/suite/rpl/r/rpl_ddl.result
index d41462de621..d41462de621 100644
--- a/mysql-test/r/rpl_ddl.result
+++ b/mysql-test/suite/rpl/r/rpl_ddl.result
diff --git a/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result b/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result
new file mode 100644
index 00000000000..1753fc0cb2d
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result
@@ -0,0 +1,211 @@
+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 NOT NULL, KEY(a)) ENGINE=innodb;
+CREATE TABLE t2 (a INT NOT NULL, KEY(a)) ENGINE=innodb;
+CREATE TABLE t3 (a INT UNIQUE) ENGINE=innodb;
+CREATE TABLE t4 (a INT) ENGINE=innodb;
+show variables like 'slave_transaction_retries';
+Variable_name Value
+slave_transaction_retries 10
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ KEY `a` (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) NOT NULL,
+ KEY `a` (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+show variables like 'slave_transaction_retries';
+Variable_name Value
+slave_transaction_retries 2
+stop slave;
+begin;
+insert into t2 values (0);
+insert into t1 values(1);
+commit;
+begin;
+select * from t1 for update;
+a
+start slave;
+select * from t2 for update /* dl */;
+a
+commit;
+select * from t1;
+a
+1
+select * from t2 /* must be 1 */;
+a
+0
+show slave status;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_MYPORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+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 #
+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
+stop slave;
+delete from t3;
+change master to master_log_pos=548;
+begin;
+select * from t2 for update;
+a
+0
+start slave;
+select count(*) from t3 /* must be zero */;
+count(*)
+0
+commit;
+select * from t1;
+a
+1
+1
+select * from t2;
+a
+0
+0
+show slave status;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_MYPORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running #
+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 #
+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
+set @my_max_relay_log_size= @@global.max_relay_log_size;
+set global max_relay_log_size=0;
+stop slave;
+delete from t3;
+change master to master_log_pos=548;
+begin;
+select * from t2 for update;
+a
+0
+0
+start slave;
+select count(*) from t3 /* must be zero */;
+count(*)
+0
+commit;
+select * from t1;
+a
+1
+1
+1
+select * from t2;
+a
+0
+0
+0
+show slave status;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_MYPORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running #
+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 #
+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
+drop table t1,t2,t3,t4;
+set global max_relay_log_size= @my_max_relay_log_size;
+End of 5.1 tests
diff --git a/mysql-test/r/rpl_delete_no_where.result b/mysql-test/suite/rpl/r/rpl_delete_no_where.result
index 78edf4bf3fa..78edf4bf3fa 100644
--- a/mysql-test/r/rpl_delete_no_where.result
+++ b/mysql-test/suite/rpl/r/rpl_delete_no_where.result
diff --git a/mysql-test/r/rpl_do_grant.result b/mysql-test/suite/rpl/r/rpl_do_grant.result
index f7f1ce66656..f7f1ce66656 100644
--- a/mysql-test/r/rpl_do_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_do_grant.result
diff --git a/mysql-test/r/rpl_drop.result b/mysql-test/suite/rpl/r/rpl_drop.result
index b83594c9bb1..b83594c9bb1 100644
--- a/mysql-test/r/rpl_drop.result
+++ b/mysql-test/suite/rpl/r/rpl_drop.result
diff --git a/mysql-test/r/rpl_drop_db.result b/mysql-test/suite/rpl/r/rpl_drop_db.result
index c0efdf5290d..c0efdf5290d 100644
--- a/mysql-test/r/rpl_drop_db.result
+++ b/mysql-test/suite/rpl/r/rpl_drop_db.result
diff --git a/mysql-test/r/rpl_drop_temp.result b/mysql-test/suite/rpl/r/rpl_drop_temp.result
index 40d578dd13e..40d578dd13e 100644
--- a/mysql-test/r/rpl_drop_temp.result
+++ b/mysql-test/suite/rpl/r/rpl_drop_temp.result
diff --git a/mysql-test/r/rpl_dual_pos_advance.result b/mysql-test/suite/rpl/r/rpl_dual_pos_advance.result
index 257baa81b74..257baa81b74 100644
--- a/mysql-test/r/rpl_dual_pos_advance.result
+++ b/mysql-test/suite/rpl/r/rpl_dual_pos_advance.result
diff --git a/mysql-test/suite/rpl/r/rpl_empty_master_crash.result b/mysql-test/suite/rpl/r/rpl_empty_master_crash.result
new file mode 100644
index 00000000000..f0d84f85069
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_empty_master_crash.result
@@ -0,0 +1,11 @@
+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;
+SHOW SLAVE STATUS;
+load table t1 from master;
+ERROR 08S01: Error connecting to master: Master is not configured
+load table t1 from master;
+ERROR HY000: Error from master: 'Table 'test.t1' doesn't exist'
diff --git a/mysql-test/r/rpl_err_ignoredtable.result b/mysql-test/suite/rpl/r/rpl_err_ignoredtable.result
index f211d5d9a2f..f211d5d9a2f 100644
--- a/mysql-test/r/rpl_err_ignoredtable.result
+++ b/mysql-test/suite/rpl/r/rpl_err_ignoredtable.result
diff --git a/mysql-test/suite/rpl/r/rpl_events.result b/mysql-test/suite/rpl/r/rpl_events.result
new file mode 100644
index 00000000000..18fe72a9879
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_events.result
@@ -0,0 +1,203 @@
+set global event_scheduler=1;
+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;
+set binlog_format=row;
+DROP EVENT IF EXISTS test.justonce;
+drop table if exists t1,t2;
+CREATE TABLE `t1` (
+`id` INT(10) UNSIGNED NOT NULL,
+`c` VARCHAR(50) NOT NULL,
+`ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+INSERT INTO t1 (id, c) VALUES (1, 'manually');
+"Creating event test.justonce on the master"
+CREATE EVENT test.justonce ON SCHEDULE EVERY 2 SECOND DO
+INSERT IGNORE INTO t1 (id, c) VALUES (2, 'from justonce');
+"Checking event is active on master"
+SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce';
+db name status originator
+test justonce ENABLED 1
+"Checking event data on the master"
+SELECT * FROM t1 ORDER BY id;
+id c ts
+1 manually TIMESTAMP
+2 from justonce TIMESTAMP
+affected rows: 2
+"Checking event data on the slave"
+SELECT * FROM t1 ORDER BY id;
+id c ts
+1 manually TIMESTAMP
+2 from justonce TIMESTAMP
+affected rows: 2
+"Checking event is inactive on slave"
+SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce';
+db name status originator
+test justonce SLAVESIDE_DISABLED 1
+"Dropping event test.slave_once on the slave"
+DROP EVENT IF EXISTS test.slave_once;
+CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE DO
+INSERT IGNORE INTO t1(id, c) VALUES (3, 'from slave_once');
+"Checking event status on the slave for originator value = slave's server_id"
+SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_once';
+db name status originator
+test slave_once ENABLED 2
+"Dropping event test.slave_once on the slave"
+DROP EVENT IF EXISTS test.slave_once;
+"Dropping event test.justonce on the master"
+DROP EVENT IF EXISTS test.justonce;
+"Creating event test.er on the master"
+CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND DO
+INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er');
+"Checking event status on the master"
+SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
+db name status originator body
+test er ENABLED 1 INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er')
+"Checking event status on the slave"
+SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
+db name status originator body
+test er SLAVESIDE_DISABLED 1 INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er')
+"Altering event test.er on the master"
+ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND DO
+INSERT IGNORE INTO t1(id, c) VALUES (5, 'from alter er');
+"Checking event status on the master"
+SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
+db name status originator body
+test er ENABLED 1 INSERT IGNORE INTO t1(id, c) VALUES (5, 'from alter er')
+"Checking event status on the slave"
+SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
+db name status originator body
+test er SLAVESIDE_DISABLED 1 INSERT IGNORE INTO t1(id, c) VALUES (5, 'from alter er')
+"Dropping event test.er on the master"
+DROP EVENT test.er;
+"Checking event status on the master"
+SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
+db name status originator
+"Checking event status on the slave"
+SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
+db name status originator
+"Creating event test.slave_terminate on the slave"
+CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND DO
+INSERT IGNORE INTO t1(id, c) VALUES (6, 'from slave_terminate');
+"Checking event status on the slave"
+SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate';
+db name status originator
+test slave_terminate ENABLED 2
+"Dropping event test.slave_terminate on the slave"
+DROP EVENT test.slave_terminate;
+"Creating event test.slave_terminate with DISABLE ON SLAVE on the slave"
+CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND DISABLE ON SLAVE DO
+INSERT IGNORE INTO t1(c) VALUES (7, 'from slave_terminate');
+"Checking event status on the slave"
+SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate';
+db name status originator
+test slave_terminate SLAVESIDE_DISABLED 2
+"Dropping event test.slave_terminate on the slave"
+DROP EVENT test.slave_terminate;
+"Cleanup"
+DROP TABLE t1;
+set binlog_format=statement;
+DROP EVENT IF EXISTS test.justonce;
+drop table if exists t1,t2;
+CREATE TABLE `t1` (
+`id` INT(10) UNSIGNED NOT NULL,
+`c` VARCHAR(50) NOT NULL,
+`ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+INSERT INTO t1 (id, c) VALUES (1, 'manually');
+"Creating event test.justonce on the master"
+CREATE EVENT test.justonce ON SCHEDULE EVERY 2 SECOND DO
+INSERT IGNORE INTO t1 (id, c) VALUES (2, 'from justonce');
+"Checking event is active on master"
+SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce';
+db name status originator
+test justonce ENABLED 1
+"Checking event data on the master"
+SELECT * FROM t1 ORDER BY id;
+id c ts
+1 manually TIMESTAMP
+2 from justonce TIMESTAMP
+affected rows: 2
+"Checking event data on the slave"
+SELECT * FROM t1 ORDER BY id;
+id c ts
+1 manually TIMESTAMP
+2 from justonce TIMESTAMP
+affected rows: 2
+"Checking event is inactive on slave"
+SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce';
+db name status originator
+test justonce SLAVESIDE_DISABLED 1
+"Dropping event test.slave_once on the slave"
+DROP EVENT IF EXISTS test.slave_once;
+CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE DO
+INSERT IGNORE INTO t1(id, c) VALUES (3, 'from slave_once');
+"Checking event status on the slave for originator value = slave's server_id"
+SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_once';
+db name status originator
+test slave_once ENABLED 2
+"Dropping event test.slave_once on the slave"
+DROP EVENT IF EXISTS test.slave_once;
+"Dropping event test.justonce on the master"
+DROP EVENT IF EXISTS test.justonce;
+"Creating event test.er on the master"
+CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND DO
+INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er');
+"Checking event status on the master"
+SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
+db name status originator body
+test er ENABLED 1 INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er')
+"Checking event status on the slave"
+SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
+db name status originator body
+test er SLAVESIDE_DISABLED 1 INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er')
+"Altering event test.er on the master"
+ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND DO
+INSERT IGNORE INTO t1(id, c) VALUES (5, 'from alter er');
+"Checking event status on the master"
+SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
+db name status originator body
+test er ENABLED 1 INSERT IGNORE INTO t1(id, c) VALUES (5, 'from alter er')
+"Checking event status on the slave"
+SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
+db name status originator body
+test er SLAVESIDE_DISABLED 1 INSERT IGNORE INTO t1(id, c) VALUES (5, 'from alter er')
+"Dropping event test.er on the master"
+DROP EVENT test.er;
+"Checking event status on the master"
+SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
+db name status originator
+"Checking event status on the slave"
+SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
+db name status originator
+"Creating event test.slave_terminate on the slave"
+CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND DO
+INSERT IGNORE INTO t1(id, c) VALUES (6, 'from slave_terminate');
+"Checking event status on the slave"
+SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate';
+db name status originator
+test slave_terminate ENABLED 2
+"Dropping event test.slave_terminate on the slave"
+DROP EVENT test.slave_terminate;
+"Creating event test.slave_terminate with DISABLE ON SLAVE on the slave"
+CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND DISABLE ON SLAVE DO
+INSERT IGNORE INTO t1(c) VALUES (7, 'from slave_terminate');
+"Checking event status on the slave"
+SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate';
+db name status originator
+test slave_terminate SLAVESIDE_DISABLED 2
+"Dropping event test.slave_terminate on the slave"
+DROP EVENT test.slave_terminate;
+"Cleanup"
+DROP TABLE t1;
+CREATE EVENT event1 ON SCHEDULE EVERY 1 YEAR
+DO BEGIN
+select * from t1;
+END;|
+ALTER EVENT event1 RENAME TO event2;
+DROP EVENT event2;
diff --git a/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result b/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result
new file mode 100644
index 00000000000..fe5a5b28682
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result
@@ -0,0 +1,848 @@
+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;
+**** Diff Table Def Start ****
+*** On Slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t1 (a INT, b INT PRIMARY KEY, c CHAR(20),
+d FLOAT DEFAULT '2.00',
+e CHAR(4) DEFAULT 'TEST')
+ENGINE='InnoDB';
+*** Create t1 on Master ***
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c CHAR(10)
+) ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t1 () VALUES(1,2,'TEXAS'),(2,1,'AUSTIN'),(3,4,'QA');
+SELECT * FROM t1 ORDER BY a;
+a b c
+1 2 TEXAS
+2 1 AUSTIN
+3 4 QA
+*** Select from slave ***
+SELECT * FROM t1 ORDER BY a;
+a b c d e
+1 2 TEXAS 2 TEST
+2 1 AUSTIN 2 TEST
+3 4 QA 2 TEST
+*** Drop t1 ***
+DROP TABLE t1;
+*** Create t2 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t2 (a INT, b INT PRIMARY KEY, c CHAR(5),
+d FLOAT DEFAULT '2.00',
+e CHAR(5) DEFAULT 'TEST2')
+ENGINE='InnoDB';
+*** Create t2 on Master ***
+CREATE TABLE t2 (a INT PRIMARY KEY, b INT, c CHAR(10)
+) ENGINE='InnoDB';
+RESET MASTER;
+*** Master Data Insert ***
+INSERT INTO t2 () VALUES(1,2,'Kyle, TEX'),(2,1,'JOE AUSTIN'),(3,4,'QA TESTING');
+SELECT * FROM t2 ORDER BY a;
+a b c
+1 2 Kyle, TEX
+2 1 JOE AUSTIN
+3 4 QA TESTING
+*** Start Slave ***
+START SLAVE;
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_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.
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+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.
+STOP SLAVE;
+RESET SLAVE;
+SELECT * FROM t2 ORDER BY a;
+a b c d e
+RESET MASTER;
+START SLAVE;
+*** Drop t2 ***
+DROP TABLE t2;
+*** Create t3 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t3 (a INT, b INT PRIMARY KEY, c CHAR(20),
+d FLOAT DEFAULT '2.00',
+e CHAR(5) DEFAULT 'TEST2')
+ENGINE='InnoDB';
+*** Create t3 on Master ***
+CREATE TABLE t3 (a BLOB, b INT PRIMARY KEY, c CHAR(20)
+) ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TESTING');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t3 ***
+DROP TABLE t3;
+*** Create t4 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t4 (a INT, b INT PRIMARY KEY, c CHAR(20),
+d FLOAT DEFAULT '2.00',
+e CHAR(5) DEFAULT 'TEST2')
+ENGINE='InnoDB';
+*** Create t4 on Master ***
+CREATE TABLE t4 (a DECIMAL(8,2), b INT PRIMARY KEY, c CHAR(20)
+) ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'),
+(30000.22,4,'QA TESTING');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t4 ***
+DROP TABLE t4;
+*** Create t5 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t5 (a INT PRIMARY KEY, b CHAR(5),
+c FLOAT, d INT, e DOUBLE,
+f DECIMAL(8,2))ENGINE='InnoDB';
+*** Create t5 on Master ***
+CREATE TABLE t5 (a INT PRIMARY KEY, b VARCHAR(6),
+c DECIMAL(8,2), d BIT, e BLOB,
+f FLOAT) ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
+(2,'JOE',300.01,0,'b2b2',1.0000009);
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+Last_SQL_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t5 ***
+DROP TABLE t5;
+*** Create t6 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t6 (a INT PRIMARY KEY, b CHAR(5),
+c FLOAT, d INT)ENGINE='InnoDB';
+*** Create t6 on Master ***
+CREATE TABLE t6 (a INT PRIMARY KEY, b VARCHAR(6),
+c DECIMAL(8,2), d BIT
+) ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
+(2,'JOE',300.01,0);
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+Last_SQL_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
+*** Drop t6 ***
+DROP TABLE t6;
+DROP TABLE t6;
+START SLAVE;
+**** Diff Table Def End ****
+**** Extra Colums Start ****
+*** Create t7 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t7 (a INT KEY, b BLOB, c CHAR(5),
+d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
+e CHAR(20) DEFAULT 'Extra Column Testing')
+ENGINE='InnoDB';
+*** Create t7 on Master ***
+CREATE TABLE t7 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t7 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+SELECT * FROM t7 ORDER BY a;
+a b c
+1 b1b1 Kyle
+2 b1b1 JOE
+3 b1b1 QA
+*** Select from slave ***
+SELECT * FROM t7 ORDER BY a;
+a b c d e
+1 b1b1 Kyle 0000-00-00 00:00:00 Extra Column Testing
+2 b1b1 JOE 0000-00-00 00:00:00 Extra Column Testing
+3 b1b1 QA 0000-00-00 00:00:00 Extra Column Testing
+*** Drop t7 ***
+DROP TABLE t7;
+*** Create t8 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t8 (a INT KEY, b BLOB, c CHAR(5),
+d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
+e INT)ENGINE='InnoDB';
+*** Create t8 on Master ***
+CREATE TABLE t8 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t8 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+*** Drop t8 ***
+DROP TABLE t8;
+*** Create t10 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
+c CHAR(5), e INT DEFAULT '1')ENGINE='InnoDB';
+*** Create t10 on Master ***
+CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t10 ***
+DROP TABLE t10;
+*** Create t11 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
+c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB';
+*** Create t11 on Master ***
+CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
+) ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t11 ***
+DROP TABLE t11;
+*** Create t12 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
+c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB';
+*** Create t12 on Master ***
+CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
+) ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t12 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+SELECT * FROM t12 ORDER BY a;
+a b c
+1 b1b1b1b1b1b1b1b1 Kyle
+2 b1b1b1b1b1b1b1b1 JOE
+3 b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ***
+SELECT * FROM t12 ORDER BY a;
+a b f c e
+1 b1b1b1b1b1b1b1b1 Kyle test 1
+2 b1b1b1b1b1b1b1b1 JOE test 1
+3 b1b1b1b1b1b1b1b1 QA test 1
+*** Drop t12 ***
+DROP TABLE t12;
+**** Extra Colums End ****
+*** BUG 22177 Start ***
+*** Create t13 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t13 (a INT KEY, b BLOB, c CHAR(5),
+d INT DEFAULT '1',
+e TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='InnoDB';
+*** Create t13 on Master ***
+CREATE TABLE t13 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t13 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+SELECT * FROM t13 ORDER BY a;
+a b c
+1 b1b1b1b1b1b1b1b1 Kyle
+2 b1b1b1b1b1b1b1b1 JOE
+3 b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t13 ORDER BY a;
+a b c d e
+1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+*** Drop t13 ***
+DROP TABLE t13;
+*** 22117 END ***
+*** Alter Master Table Testing Start ***
+*** Create t14 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='InnoDB';
+*** Create t14 on Master ***
+CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+) ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
+ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
+(2,2.00,'This Test Should work',@b1,'JOE'),
+(3,3.00,'If is does not, I will open a bug',@b1,'QA');
+SELECT * FROM t14 ORDER BY c1;
+c1 c2 c3 c4 c5
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t14 ORDER BY c1;
+c1 c2 c3 c4 c5 c6 c7
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+*** connect to master and drop columns ***
+ALTER TABLE t14 DROP COLUMN c2;
+ALTER TABLE t14 DROP COLUMN c4;
+*** Select from Master ***
+SELECT * FROM t14 ORDER BY c1;
+c1 c3 c5
+1 Replication Testing Extra Col Kyle
+2 This Test Should work JOE
+3 If is does not, I will open a bug QA
+*** Select from Slave ***
+SELECT * FROM t14 ORDER BY c1;
+c1 c3 c5 c6 c7
+1 Replication Testing Extra Col Kyle 1 CURRENT_TIMESTAMP
+2 This Test Should work JOE 1 CURRENT_TIMESTAMP
+3 If is does not, I will open a bug QA 1 CURRENT_TIMESTAMP
+*** Drop t14 ***
+DROP TABLE t14;
+*** Create t15 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t15 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
+c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='InnoDB';
+*** Create t15 on Master ***
+CREATE TABLE t15 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
+c4 BLOB, c5 CHAR(5)) ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t15 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
+(2,2.00,'This Test Should work',@b1,'JOE'),
+(3,3.00,'If is does not, I will open a bug',@b1,'QA');
+SELECT * FROM t15 ORDER BY c1;
+c1 c2 c3 c4 c5
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t15 ORDER BY c1;
+c1 c2 c3 c4 c5 c6 c7
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+*** Add column on master that is a Extra on Slave ***
+ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
+********************************************
+*** Expect slave to fail with Error 1060 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1060
+Last_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5'
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1060
+Last_SQL_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5'
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Try to insert in master ****
+INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2);
+SELECT * FROM t15 ORDER BY c1;
+c1 c2 c3 c4 c5 c6
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL
+5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2
+*** Try to select from slave ****
+SELECT * FROM t15 ORDER BY c1;
+c1 c2 c3 c4 c5 c6 c7
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+*** DROP TABLE t15 ***
+DROP TABLE t15;
+*** Create t16 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t16 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
+c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='InnoDB';
+*** Create t16 on Master ***
+CREATE TABLE t16 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
+c4 BLOB, c5 CHAR(5))ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t16 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
+(2,2.00,'This Test Should work',@b1,'JOE'),
+(3,3.00,'If is does not, I will open a bug',@b1,'QA');
+SELECT * FROM t16 ORDER BY c1;
+c1 c2 c3 c4 c5
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t16 ORDER BY c1;
+c1 c2 c3 c4 c5 c6 c7
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+*** Add Partition on master ***
+ALTER TABLE t16 PARTITION BY KEY(c1) PARTITIONS 4;
+INSERT INTO t16 () VALUES(4,1.00,'Replication Rocks',@b1,'Omer');
+SHOW CREATE TABLE t16;
+Table Create Table
+t16 CREATE TABLE `t16` (
+ `c1` int(11) NOT NULL,
+ `c2` decimal(8,2) DEFAULT NULL,
+ `c3` text,
+ `c4` blob,
+ `c5` char(5) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
+*** Show table on Slave ****
+SHOW CREATE TABLE t16;
+Table Create Table
+t16 CREATE TABLE `t16` (
+ `c1` int(11) NOT NULL,
+ `c2` decimal(8,2) DEFAULT NULL,
+ `c3` text,
+ `c4` blob,
+ `c5` char(5) DEFAULT NULL,
+ `c6` int(11) DEFAULT '1',
+ `c7` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
+*** DROP TABLE t16 ***
+DROP TABLE t16;
+*** Alter Master End ***
+*** Create t17 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t17 (a SMALLINT, b INT PRIMARY KEY, c CHAR(5),
+d FLOAT DEFAULT '2.00',
+e CHAR(5) DEFAULT 'TEST2')
+ENGINE='InnoDB';
+*** Create t17 on Master ***
+CREATE TABLE t17 (a BIGINT PRIMARY KEY, b INT, c CHAR(10)
+) ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+** DROP table t17 ***
+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
new file mode 100644
index 00000000000..e70a2efaf29
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result
@@ -0,0 +1,848 @@
+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;
+**** Diff Table Def Start ****
+*** On Slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t1 (a INT, b INT PRIMARY KEY, c CHAR(20),
+d FLOAT DEFAULT '2.00',
+e CHAR(4) DEFAULT 'TEST')
+ENGINE='MyISAM';
+*** Create t1 on Master ***
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c CHAR(10)
+) ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t1 () VALUES(1,2,'TEXAS'),(2,1,'AUSTIN'),(3,4,'QA');
+SELECT * FROM t1 ORDER BY a;
+a b c
+1 2 TEXAS
+2 1 AUSTIN
+3 4 QA
+*** Select from slave ***
+SELECT * FROM t1 ORDER BY a;
+a b c d e
+1 2 TEXAS 2 TEST
+2 1 AUSTIN 2 TEST
+3 4 QA 2 TEST
+*** Drop t1 ***
+DROP TABLE t1;
+*** Create t2 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t2 (a INT, b INT PRIMARY KEY, c CHAR(5),
+d FLOAT DEFAULT '2.00',
+e CHAR(5) DEFAULT 'TEST2')
+ENGINE='MyISAM';
+*** Create t2 on Master ***
+CREATE TABLE t2 (a INT PRIMARY KEY, b INT, c CHAR(10)
+) ENGINE='MyISAM';
+RESET MASTER;
+*** Master Data Insert ***
+INSERT INTO t2 () VALUES(1,2,'Kyle, TEX'),(2,1,'JOE AUSTIN'),(3,4,'QA TESTING');
+SELECT * FROM t2 ORDER BY a;
+a b c
+1 2 Kyle, TEX
+2 1 JOE AUSTIN
+3 4 QA TESTING
+*** Start Slave ***
+START SLAVE;
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_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.
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+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.
+STOP SLAVE;
+RESET SLAVE;
+SELECT * FROM t2 ORDER BY a;
+a b c d e
+RESET MASTER;
+START SLAVE;
+*** Drop t2 ***
+DROP TABLE t2;
+*** Create t3 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t3 (a INT, b INT PRIMARY KEY, c CHAR(20),
+d FLOAT DEFAULT '2.00',
+e CHAR(5) DEFAULT 'TEST2')
+ENGINE='MyISAM';
+*** Create t3 on Master ***
+CREATE TABLE t3 (a BLOB, b INT PRIMARY KEY, c CHAR(20)
+) ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TESTING');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t3 ***
+DROP TABLE t3;
+*** Create t4 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t4 (a INT, b INT PRIMARY KEY, c CHAR(20),
+d FLOAT DEFAULT '2.00',
+e CHAR(5) DEFAULT 'TEST2')
+ENGINE='MyISAM';
+*** Create t4 on Master ***
+CREATE TABLE t4 (a DECIMAL(8,2), b INT PRIMARY KEY, c CHAR(20)
+) ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'),
+(30000.22,4,'QA TESTING');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t4 ***
+DROP TABLE t4;
+*** Create t5 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t5 (a INT PRIMARY KEY, b CHAR(5),
+c FLOAT, d INT, e DOUBLE,
+f DECIMAL(8,2))ENGINE='MyISAM';
+*** Create t5 on Master ***
+CREATE TABLE t5 (a INT PRIMARY KEY, b VARCHAR(6),
+c DECIMAL(8,2), d BIT, e BLOB,
+f FLOAT) ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
+(2,'JOE',300.01,0,'b2b2',1.0000009);
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+Last_SQL_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t5 ***
+DROP TABLE t5;
+*** Create t6 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t6 (a INT PRIMARY KEY, b CHAR(5),
+c FLOAT, d INT)ENGINE='MyISAM';
+*** Create t6 on Master ***
+CREATE TABLE t6 (a INT PRIMARY KEY, b VARCHAR(6),
+c DECIMAL(8,2), d BIT
+) ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
+(2,'JOE',300.01,0);
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+Last_SQL_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
+*** Drop t6 ***
+DROP TABLE t6;
+DROP TABLE t6;
+START SLAVE;
+**** Diff Table Def End ****
+**** Extra Colums Start ****
+*** Create t7 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t7 (a INT KEY, b BLOB, c CHAR(5),
+d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
+e CHAR(20) DEFAULT 'Extra Column Testing')
+ENGINE='MyISAM';
+*** Create t7 on Master ***
+CREATE TABLE t7 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t7 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+SELECT * FROM t7 ORDER BY a;
+a b c
+1 b1b1 Kyle
+2 b1b1 JOE
+3 b1b1 QA
+*** Select from slave ***
+SELECT * FROM t7 ORDER BY a;
+a b c d e
+1 b1b1 Kyle 0000-00-00 00:00:00 Extra Column Testing
+2 b1b1 JOE 0000-00-00 00:00:00 Extra Column Testing
+3 b1b1 QA 0000-00-00 00:00:00 Extra Column Testing
+*** Drop t7 ***
+DROP TABLE t7;
+*** Create t8 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t8 (a INT KEY, b BLOB, c CHAR(5),
+d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
+e INT)ENGINE='MyISAM';
+*** Create t8 on Master ***
+CREATE TABLE t8 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t8 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+*** Drop t8 ***
+DROP TABLE t8;
+*** Create t10 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
+c CHAR(5), e INT DEFAULT '1')ENGINE='MyISAM';
+*** Create t10 on Master ***
+CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t10 ***
+DROP TABLE t10;
+*** Create t11 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
+c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM';
+*** Create t11 on Master ***
+CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
+) ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t11 ***
+DROP TABLE t11;
+*** Create t12 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
+c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM';
+*** Create t12 on Master ***
+CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
+) ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t12 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+SELECT * FROM t12 ORDER BY a;
+a b c
+1 b1b1b1b1b1b1b1b1 Kyle
+2 b1b1b1b1b1b1b1b1 JOE
+3 b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ***
+SELECT * FROM t12 ORDER BY a;
+a b f c e
+1 b1b1b1b1b1b1b1b1 Kyle test 1
+2 b1b1b1b1b1b1b1b1 JOE test 1
+3 b1b1b1b1b1b1b1b1 QA test 1
+*** Drop t12 ***
+DROP TABLE t12;
+**** Extra Colums End ****
+*** BUG 22177 Start ***
+*** Create t13 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t13 (a INT KEY, b BLOB, c CHAR(5),
+d INT DEFAULT '1',
+e TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='MyISAM';
+*** Create t13 on Master ***
+CREATE TABLE t13 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t13 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+SELECT * FROM t13 ORDER BY a;
+a b c
+1 b1b1b1b1b1b1b1b1 Kyle
+2 b1b1b1b1b1b1b1b1 JOE
+3 b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t13 ORDER BY a;
+a b c d e
+1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+*** Drop t13 ***
+DROP TABLE t13;
+*** 22117 END ***
+*** Alter Master Table Testing Start ***
+*** Create t14 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='MyISAM';
+*** Create t14 on Master ***
+CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+) ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
+ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
+(2,2.00,'This Test Should work',@b1,'JOE'),
+(3,3.00,'If is does not, I will open a bug',@b1,'QA');
+SELECT * FROM t14 ORDER BY c1;
+c1 c2 c3 c4 c5
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t14 ORDER BY c1;
+c1 c2 c3 c4 c5 c6 c7
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+*** connect to master and drop columns ***
+ALTER TABLE t14 DROP COLUMN c2;
+ALTER TABLE t14 DROP COLUMN c4;
+*** Select from Master ***
+SELECT * FROM t14 ORDER BY c1;
+c1 c3 c5
+1 Replication Testing Extra Col Kyle
+2 This Test Should work JOE
+3 If is does not, I will open a bug QA
+*** Select from Slave ***
+SELECT * FROM t14 ORDER BY c1;
+c1 c3 c5 c6 c7
+1 Replication Testing Extra Col Kyle 1 CURRENT_TIMESTAMP
+2 This Test Should work JOE 1 CURRENT_TIMESTAMP
+3 If is does not, I will open a bug QA 1 CURRENT_TIMESTAMP
+*** Drop t14 ***
+DROP TABLE t14;
+*** Create t15 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t15 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
+c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='MyISAM';
+*** Create t15 on Master ***
+CREATE TABLE t15 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
+c4 BLOB, c5 CHAR(5)) ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t15 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
+(2,2.00,'This Test Should work',@b1,'JOE'),
+(3,3.00,'If is does not, I will open a bug',@b1,'QA');
+SELECT * FROM t15 ORDER BY c1;
+c1 c2 c3 c4 c5
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t15 ORDER BY c1;
+c1 c2 c3 c4 c5 c6 c7
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+*** Add column on master that is a Extra on Slave ***
+ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
+********************************************
+*** Expect slave to fail with Error 1060 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1060
+Last_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5'
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1060
+Last_SQL_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5'
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Try to insert in master ****
+INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2);
+SELECT * FROM t15 ORDER BY c1;
+c1 c2 c3 c4 c5 c6
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL
+5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2
+*** Try to select from slave ****
+SELECT * FROM t15 ORDER BY c1;
+c1 c2 c3 c4 c5 c6 c7
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+*** DROP TABLE t15 ***
+DROP TABLE t15;
+*** Create t16 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t16 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
+c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='MyISAM';
+*** Create t16 on Master ***
+CREATE TABLE t16 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
+c4 BLOB, c5 CHAR(5))ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t16 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
+(2,2.00,'This Test Should work',@b1,'JOE'),
+(3,3.00,'If is does not, I will open a bug',@b1,'QA');
+SELECT * FROM t16 ORDER BY c1;
+c1 c2 c3 c4 c5
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t16 ORDER BY c1;
+c1 c2 c3 c4 c5 c6 c7
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+*** Add Partition on master ***
+ALTER TABLE t16 PARTITION BY KEY(c1) PARTITIONS 4;
+INSERT INTO t16 () VALUES(4,1.00,'Replication Rocks',@b1,'Omer');
+SHOW CREATE TABLE t16;
+Table Create Table
+t16 CREATE TABLE `t16` (
+ `c1` int(11) NOT NULL,
+ `c2` decimal(8,2) DEFAULT NULL,
+ `c3` text,
+ `c4` blob,
+ `c5` char(5) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
+*** Show table on Slave ****
+SHOW CREATE TABLE t16;
+Table Create Table
+t16 CREATE TABLE `t16` (
+ `c1` int(11) NOT NULL,
+ `c2` decimal(8,2) DEFAULT NULL,
+ `c3` text,
+ `c4` blob,
+ `c5` char(5) DEFAULT NULL,
+ `c6` int(11) DEFAULT '1',
+ `c7` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
+*** DROP TABLE t16 ***
+DROP TABLE t16;
+*** Alter Master End ***
+*** Create t17 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t17 (a SMALLINT, b INT PRIMARY KEY, c CHAR(5),
+d FLOAT DEFAULT '2.00',
+e CHAR(5) DEFAULT 'TEST2')
+ENGINE='MyISAM';
+*** Create t17 on Master ***
+CREATE TABLE t17 (a BIGINT PRIMARY KEY, b INT, c CHAR(10)
+) ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+** DROP table t17 ***
+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
new file mode 100644
index 00000000000..18906617925
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result
Binary files differ
diff --git a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result
new file mode 100644
index 00000000000..5bc1a13b107
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result
Binary files differ
diff --git a/mysql-test/suite/rpl/r/rpl_failed_optimize.result b/mysql-test/suite/rpl/r/rpl_failed_optimize.result
new file mode 100644
index 00000000000..7e397550331
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_failed_optimize.result
@@ -0,0 +1,24 @@
+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 ) ENGINE=InnoDB;
+BEGIN;
+INSERT INTO t1 VALUES (1);
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize error Lock wait timeout exceeded; try restarting transaction
+test.t1 optimize status Operation failed
+Warnings:
+Error 1205 Lock wait timeout exceeded; try restarting transaction
+OPTIMIZE TABLE non_existing;
+Table Op Msg_type Msg_text
+test.non_existing optimize Error Table 'test.non_existing' doesn't exist
+test.non_existing optimize error Corrupt
+select * from t1;
+a
+1
+commit;
+drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_flushlog_loop.result b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
new file mode 100644
index 00000000000..b47c262eb66
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
@@ -0,0 +1,58 @@
+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;
+change master to master_host='127.0.0.1',master_user='root',
+master_password='',master_port=MASTER_PORT;
+start slave;
+stop slave;
+change master to master_host='127.0.0.1',master_user='root',
+master_password='',master_port=SLAVE_PORT;
+start slave;
+
+let $result_pattern= '%127.0.0.1%root%slave-bin.000001%slave-bin.000001%Yes%Yes%0%0%None%' ;
+
+--source include/wait_slave_status.inc
+flush logs;
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port SLAVE_PORT
+Connect_Retry 60
+Master_Log_File slave-bin.000001
+Read_Master_Log_Pos 216
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File slave-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 216
+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 #
+Last_IO_Errno #
+Last_IO_Error
+Last_SQL_Errno 0
+Last_SQL_Error
diff --git a/mysql-test/r/rpl_foreign_key_innodb.result b/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result
index 2239c32eea3..2239c32eea3 100644
--- a/mysql-test/r/rpl_foreign_key_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result
diff --git a/mysql-test/r/rpl_free_items.result b/mysql-test/suite/rpl/r/rpl_free_items.result
index 91c1e2aa6e5..91c1e2aa6e5 100644
--- a/mysql-test/r/rpl_free_items.result
+++ b/mysql-test/suite/rpl/r/rpl_free_items.result
diff --git a/mysql-test/r/rpl_get_lock.result b/mysql-test/suite/rpl/r/rpl_get_lock.result
index 235640acad0..235640acad0 100644
--- a/mysql-test/r/rpl_get_lock.result
+++ b/mysql-test/suite/rpl/r/rpl_get_lock.result
diff --git a/mysql-test/suite/rpl/r/rpl_grant.result b/mysql-test/suite/rpl/r/rpl_grant.result
new file mode 100644
index 00000000000..935d1ca67c7
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_grant.result
@@ -0,0 +1,82 @@
+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;
+**** On Master ****
+CREATE USER dummy@localhost;
+CREATE USER dummy1@localhost, dummy2@localhost;
+SELECT user, host FROM mysql.user WHERE user != 'root';
+user host
+dummy localhost
+dummy1 localhost
+dummy2 localhost
+SELECT COUNT(*) FROM mysql.user;
+COUNT(*)
+6
+**** On Slave ****
+SELECT user,host FROM mysql.user WHERE user != 'root';
+user host
+dummy localhost
+dummy1 localhost
+dummy2 localhost
+SELECT COUNT(*) FROM mysql.user;
+COUNT(*)
+6
+**** On Master ****
+DROP USER nonexisting@localhost;
+ERROR HY000: Operation DROP USER failed for 'nonexisting'@'localhost'
+DROP USER nonexisting@localhost, dummy@localhost;
+ERROR HY000: Operation DROP USER failed for 'nonexisting'@'localhost'
+DROP USER dummy1@localhost, dummy2@localhost;
+SELECT user, host FROM mysql.user WHERE user != 'root';
+user host
+SELECT COUNT(*) FROM mysql.user;
+COUNT(*)
+3
+**** On Slave ****
+SELECT user,host FROM mysql.user WHERE user != 'root';
+user host
+SELECT COUNT(*) FROM mysql.user;
+COUNT(*)
+3
+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 617
+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 617
+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
diff --git a/mysql-test/r/rpl_ignore_grant.result b/mysql-test/suite/rpl/r/rpl_ignore_grant.result
index 5169cc8e888..5169cc8e888 100644
--- a/mysql-test/r/rpl_ignore_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_ignore_grant.result
diff --git a/mysql-test/r/rpl_ignore_revoke.result b/mysql-test/suite/rpl/r/rpl_ignore_revoke.result
index b1ccd2f0442..b1ccd2f0442 100644
--- a/mysql-test/r/rpl_ignore_revoke.result
+++ b/mysql-test/suite/rpl/r/rpl_ignore_revoke.result
diff --git a/mysql-test/r/rpl_ignore_table.result b/mysql-test/suite/rpl/r/rpl_ignore_table.result
index e7200b31212..e7200b31212 100644
--- a/mysql-test/r/rpl_ignore_table.result
+++ b/mysql-test/suite/rpl/r/rpl_ignore_table.result
diff --git a/mysql-test/r/rpl_ignore_table_update.result b/mysql-test/suite/rpl/r/rpl_ignore_table_update.result
index a88a3c690ed..a88a3c690ed 100644
--- a/mysql-test/r/rpl_ignore_table_update.result
+++ b/mysql-test/suite/rpl/r/rpl_ignore_table_update.result
diff --git a/mysql-test/suite/rpl/r/rpl_incident.result b/mysql-test/suite/rpl/r/rpl_incident.result
new file mode 100644
index 00000000000..568078cc276
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_incident.result
@@ -0,0 +1,114 @@
+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;
+**** On Master ****
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+SELECT * FROM t1;
+a
+1
+2
+3
+REPLACE INTO t1 VALUES (4);
+SELECT * FROM t1;
+a
+1
+2
+3
+4
+**** On Slave ****
+SELECT * FROM t1;
+a
+1
+2
+3
+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 #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1589
+Last_Error The incident LOST_EVENTS occured on the master. Message: <none>
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1589
+Last_SQL_Error The incident LOST_EVENTS occured on the master. Message: <none>
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
+START SLAVE;
+SELECT * FROM t1;
+a
+1
+2
+3
+4
+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 #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000002
+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 #
+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
+DROP TABLE t1;
diff --git a/mysql-test/r/rpl_init_slave.result b/mysql-test/suite/rpl/r/rpl_init_slave.result
index 740c918976c..740c918976c 100644
--- a/mysql-test/r/rpl_init_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_init_slave.result
diff --git a/mysql-test/suite/rpl/r/rpl_innodb.result b/mysql-test/suite/rpl/r/rpl_innodb.result
new file mode 100644
index 00000000000..658f92f4d75
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_innodb.result
@@ -0,0 +1,83 @@
+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 t4 (
+id INT(5) unsigned NOT NULL auto_increment,
+name varchar(15) NOT NULL default '',
+number varchar(35) NOT NULL default 'default',
+PRIMARY KEY (id),
+UNIQUE KEY unique_rec (name,number)
+) ENGINE=InnoDB;
+LOAD DATA
+INFILE '../std_data_ln/loaddata_pair.dat'
+REPLACE INTO TABLE t4
+(name,number);
+SELECT * FROM t4;
+id name number
+1 XXX 12345
+2 XXY 12345
+SELECT * FROM t4;
+id name number
+1 XXX 12345
+2 XXY 12345
+LOAD DATA
+INFILE '../std_data_ln/loaddata_pair.dat'
+REPLACE INTO TABLE t4
+(name,number);
+SELECT * FROM t4;
+id name number
+3 XXX 12345
+4 XXY 12345
+SELECT * FROM t4;
+id name number
+3 XXX 12345
+4 XXY 12345
+FLUSH LOGS;
+FLUSH LOGS;
+DROP DATABASE IF EXISTS mysqltest1;
+CREATE DATABASE mysqltest1;
+CREATE TEMPORARY TABLE mysqltest1.tmp (f1 BIGINT);
+CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE="InnoDB";
+SET AUTOCOMMIT = 0;
+-------- switch to slave --------
+SHOW CREATE TABLE mysqltest1.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` bigint(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+-------- switch to master --------
+INSERT INTO mysqltest1.t1 SET f1= 1;
+DROP TEMPORARY TABLE mysqltest1.tmp;
+ROLLBACK;
+SHOW CREATE TABLE mysqltest1.tmp;
+ERROR 42S02: Table 'mysqltest1.tmp' doesn't exist
+SELECT COUNT(*) FROM mysqltest1.t1;
+COUNT(*)
+0
+INSERT INTO mysqltest1.t1 SET f1= 2;
+CREATE TEMPORARY TABLE mysqltest1.tmp2(a INT);
+ROLLBACK;
+SHOW CREATE TABLE mysqltest1.tmp2;
+Table Create Table
+tmp2 CREATE TEMPORARY TABLE `tmp2` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT COUNT(*) FROM mysqltest1.t1;
+COUNT(*)
+0
+-------- switch to slave --------
+SHOW CREATE TABLE mysqltest1.tmp;
+ERROR 42S02: Table 'mysqltest1.tmp' doesn't exist
+SHOW CREATE TABLE mysqltest1.tmp2;
+ERROR 42S02: Table 'mysqltest1.tmp2' doesn't exist
+SELECT COUNT(*) FROM mysqltest1.t1;
+COUNT(*)
+2
+FLUSH LOGS;
+-------- switch to master --------
+FLUSH LOGS;
+DROP DATABASE mysqltest1;
+End of 5.1 tests
diff --git a/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result b/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result
new file mode 100644
index 00000000000..fb2782ed9f4
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result
@@ -0,0 +1,167 @@
+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;
+use test;
+CREATE TABLE test.regular_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+fkid MEDIUMINT, filler VARCHAR(255),
+PRIMARY KEY(id)) ENGINE='innodb';
+CREATE TABLE test.bykey_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+fkid MEDIUMINT, filler VARCHAR(255),
+PRIMARY KEY(id)) ENGINE='innodb'
+PARTITION BY KEY(id) partitions 5;
+CREATE TABLE test.byrange_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+fkid MEDIUMINT, filler VARCHAR(255),
+PRIMARY KEY(id)) ENGINE='innodb'
+PARTITION BY RANGE(id)
+SUBPARTITION BY hash(id) subpartitions 2
+(PARTITION pa1 values less than (10),
+PARTITION pa2 values less than (20),
+PARTITION pa3 values less than (30),
+PARTITION pa4 values less than (40),
+PARTITION pa5 values less than (50),
+PARTITION pa6 values less than (60),
+PARTITION pa7 values less than (70),
+PARTITION pa8 values less than (80),
+PARTITION pa9 values less than (90),
+PARTITION pa10 values less than (100),
+PARTITION pa11 values less than MAXVALUE);
+CREATE PROCEDURE test.proc_norm()
+BEGIN
+DECLARE ins_count INT DEFAULT 1000;
+DECLARE del_count INT;
+DECLARE cur_user VARCHAR(255);
+DECLARE local_uuid VARCHAR(255);
+DECLARE local_time TIMESTAMP;
+SET local_time= NOW();
+SET cur_user= CURRENT_USER();
+SET local_uuid= UUID();
+WHILE ins_count > 0 DO
+INSERT INTO test.regular_tbl VALUES (NULL, NOW(), USER() , UUID(),
+ins_count,'Going to test MBR for MySQL');
+SET ins_count = ins_count - 1;
+END WHILE;
+SELECT MAX(id) FROM test.regular_tbl INTO del_count;
+WHILE del_count > 0 DO
+DELETE FROM test.regular_tbl WHERE id = del_count;
+SET del_count = del_count - 2;
+END WHILE;
+END|
+CREATE PROCEDURE test.proc_bykey()
+BEGIN
+DECLARE ins_count INT DEFAULT 1000;
+DECLARE del_count INT;
+DECLARE cur_user VARCHAR(255);
+DECLARE local_uuid VARCHAR(255);
+DECLARE local_time TIMESTAMP;
+SET local_time= NOW();
+SET cur_user= CURRENT_USER();
+SET local_uuid= UUID();
+WHILE ins_count > 0 DO
+INSERT INTO test.bykey_tbl VALUES (NULL, NOW(), USER() , UUID(),
+ins_count,'Going to test MBR for MySQL');
+SET ins_count = ins_count - 1;
+END WHILE;
+SELECT MAX(id) FROM test.bykey_tbl INTO del_count;
+WHILE del_count > 0 DO
+DELETE FROM test.bykey_tbl WHERE id = del_count;
+SET del_count = del_count - 2;
+END WHILE;
+END|
+CREATE PROCEDURE test.proc_byrange()
+BEGIN
+DECLARE ins_count INT DEFAULT 1000;
+DECLARE del_count INT;
+DECLARE cur_user VARCHAR(255);
+DECLARE local_uuid VARCHAR(255);
+DECLARE local_time TIMESTAMP;
+SET local_time= NOW();
+SET cur_user = CURRENT_USER();
+SET local_uuid=UUID();
+WHILE ins_count > 0 DO
+INSERT INTO test.byrange_tbl VALUES (NULL, NOW(), USER(), UUID(),
+ins_count,'Going to test MBR for MySQL');
+SET ins_count = ins_count - 1;
+END WHILE;
+SELECT MAX(id) FROM test.byrange_tbl INTO del_count;
+WHILE del_count > 0 DO
+DELETE FROM test.byrange_tbl WHERE id = del_count;
+SET del_count = del_count - 2;
+END WHILE;
+END|
+CALL test.proc_norm();
+SELECT count(*) as "Master regular" FROM test.regular_tbl;
+Master regular 500
+CALL test.proc_bykey();
+SELECT count(*) as "Master bykey" FROM test.bykey_tbl;
+Master bykey 500
+CALL test.proc_byrange();
+SELECT count(*) as "Master byrange" FROM test.byrange_tbl;
+Master byrange 500
+show create table test.byrange_tbl;
+Table byrange_tbl
+Create Table CREATE TABLE `byrange_tbl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `user` char(255) DEFAULT NULL,
+ `uuidf` longblob,
+ `fkid` mediumint(9) DEFAULT NULL,
+ `filler` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (id) SUBPARTITION BY HASH (id) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION pa2 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION pa3 VALUES LESS THAN (30) ENGINE = InnoDB, PARTITION pa4 VALUES LESS THAN (40) ENGINE = InnoDB, PARTITION pa5 VALUES LESS THAN (50) ENGINE = InnoDB, PARTITION pa6 VALUES LESS THAN (60) ENGINE = InnoDB, PARTITION pa7 VALUES LESS THAN (70) ENGINE = InnoDB, PARTITION pa8 VALUES LESS THAN (80) ENGINE = InnoDB, PARTITION pa9 VALUES LESS THAN (90) ENGINE = InnoDB, PARTITION pa10 VALUES LESS THAN (100) ENGINE = InnoDB, PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
+show slave status;
+Slave_IO_State Waiting for master to send event
+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 945470
+Relay_Log_File slave-relay-bin.000003
+Relay_Log_Pos 945616
+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 945470
+Relay_Log_Space 945771
+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
+SELECT count(*) "Slave norm" FROM test.regular_tbl;
+Slave norm 500
+SELECT count(*) "Slave bykey" FROM test.bykey_tbl;
+Slave bykey 500
+SELECT count(*) "Slave byrange" FROM test.byrange_tbl;
+Slave byrange 500
+DROP PROCEDURE test.proc_norm;
+DROP PROCEDURE test.proc_bykey;
+DROP PROCEDURE test.proc_byrange;
+DROP TABLE test.regular_tbl;
+DROP TABLE test.bykey_tbl;
+DROP TABLE test.byrange_tbl;
diff --git a/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result b/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result
new file mode 100644
index 00000000000..abff02b4b07
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result
@@ -0,0 +1,35 @@
+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;
+use test;
+CREATE TABLE test.regular_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+fkid MEDIUMINT, filler VARCHAR(255),
+PRIMARY KEY(id)) ENGINE='innodb';
+CREATE PROCEDURE test.proc_norm()
+BEGIN
+DECLARE ins_count INT DEFAULT 1000;
+DECLARE del_count INT;
+DECLARE cur_user VARCHAR(255);
+DECLARE local_uuid VARCHAR(255);
+DECLARE local_time TIMESTAMP;
+SET local_time= NOW();
+SET cur_user= CURRENT_USER();
+SET local_uuid= UUID();
+WHILE ins_count > 0 DO
+INSERT INTO test.regular_tbl VALUES (NULL, NOW(), USER() , UUID(),
+ins_count,'Going to test MBR for MySQL');
+SET ins_count = ins_count - 1;
+END WHILE;
+SELECT MAX(id) FROM test.regular_tbl INTO del_count;
+WHILE del_count > 0 DO
+DELETE FROM test.regular_tbl WHERE id = del_count;
+SET del_count = del_count - 2;
+END WHILE;
+END|
+CALL test.proc_norm();
+DROP PROCEDURE test.proc_norm;
+DROP TABLE test.regular_tbl;
diff --git a/mysql-test/suite/rpl/r/rpl_innodb_bug30919.result b/mysql-test/suite/rpl/r/rpl_innodb_bug30919.result
new file mode 100644
index 00000000000..42aa4ff302b
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_innodb_bug30919.result
@@ -0,0 +1,1043 @@
+use test;
+CREATE TABLE test.part_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+fkid MEDIUMINT, filler VARCHAR(255),
+PRIMARY KEY(id)) ENGINE='innodb'
+PARTITION BY RANGE(id)
+SUBPARTITION BY hash(id) subpartitions 2
+(PARTITION pa3 values less than (42),
+PARTITION pa6 values less than (60),
+PARTITION pa7 values less than (70),
+PARTITION pa8 values less than (80),
+PARTITION pa9 values less than (90),
+PARTITION pa10 values less than (100),
+PARTITION pa11 values less than MAXVALUE);
+CREATE PROCEDURE test.proc_part()
+BEGIN
+DECLARE ins_count INT DEFAULT 1000;
+DECLARE del_count INT;
+DECLARE cur_user VARCHAR(255);
+DECLARE local_uuid VARCHAR(255);
+DECLARE local_time TIMESTAMP;
+SET local_time= NOW();
+SET cur_user= CURRENT_USER();
+SET local_uuid= UUID();
+WHILE ins_count > 0 DO
+INSERT INTO test.part_tbl VALUES (NULL, NOW(), USER() , UUID(),
+ins_count,'Going to test MBR for MySQL');
+SET ins_count = ins_count - 1;
+END WHILE;
+SELECT MAX(id) FROM test.part_tbl INTO del_count;
+WHILE del_count > 0 DO
+DELETE FROM test.part_tbl WHERE id = del_count;
+select count(*) as internal_count, del_count -- these two lines are for
+FROM test.part_tbl; -- debug to show the problem
+SET del_count = del_count - 2;
+END WHILE;
+END|
+CALL test.proc_part();
+internal_count del_count
+999 1000
+internal_count del_count
+998 998
+internal_count del_count
+997 996
+internal_count del_count
+996 994
+internal_count del_count
+995 992
+internal_count del_count
+994 990
+internal_count del_count
+993 988
+internal_count del_count
+992 986
+internal_count del_count
+991 984
+internal_count del_count
+990 982
+internal_count del_count
+989 980
+internal_count del_count
+988 978
+internal_count del_count
+987 976
+internal_count del_count
+986 974
+internal_count del_count
+985 972
+internal_count del_count
+984 970
+internal_count del_count
+983 968
+internal_count del_count
+982 966
+internal_count del_count
+981 964
+internal_count del_count
+980 962
+internal_count del_count
+979 960
+internal_count del_count
+978 958
+internal_count del_count
+977 956
+internal_count del_count
+976 954
+internal_count del_count
+975 952
+internal_count del_count
+974 950
+internal_count del_count
+973 948
+internal_count del_count
+972 946
+internal_count del_count
+971 944
+internal_count del_count
+970 942
+internal_count del_count
+969 940
+internal_count del_count
+968 938
+internal_count del_count
+967 936
+internal_count del_count
+966 934
+internal_count del_count
+965 932
+internal_count del_count
+964 930
+internal_count del_count
+963 928
+internal_count del_count
+962 926
+internal_count del_count
+961 924
+internal_count del_count
+960 922
+internal_count del_count
+959 920
+internal_count del_count
+958 918
+internal_count del_count
+957 916
+internal_count del_count
+956 914
+internal_count del_count
+955 912
+internal_count del_count
+954 910
+internal_count del_count
+953 908
+internal_count del_count
+952 906
+internal_count del_count
+951 904
+internal_count del_count
+950 902
+internal_count del_count
+949 900
+internal_count del_count
+948 898
+internal_count del_count
+947 896
+internal_count del_count
+946 894
+internal_count del_count
+945 892
+internal_count del_count
+944 890
+internal_count del_count
+943 888
+internal_count del_count
+942 886
+internal_count del_count
+941 884
+internal_count del_count
+940 882
+internal_count del_count
+939 880
+internal_count del_count
+938 878
+internal_count del_count
+937 876
+internal_count del_count
+936 874
+internal_count del_count
+935 872
+internal_count del_count
+934 870
+internal_count del_count
+933 868
+internal_count del_count
+932 866
+internal_count del_count
+931 864
+internal_count del_count
+930 862
+internal_count del_count
+929 860
+internal_count del_count
+928 858
+internal_count del_count
+927 856
+internal_count del_count
+926 854
+internal_count del_count
+925 852
+internal_count del_count
+924 850
+internal_count del_count
+923 848
+internal_count del_count
+922 846
+internal_count del_count
+921 844
+internal_count del_count
+920 842
+internal_count del_count
+919 840
+internal_count del_count
+918 838
+internal_count del_count
+917 836
+internal_count del_count
+916 834
+internal_count del_count
+915 832
+internal_count del_count
+914 830
+internal_count del_count
+913 828
+internal_count del_count
+912 826
+internal_count del_count
+911 824
+internal_count del_count
+910 822
+internal_count del_count
+909 820
+internal_count del_count
+908 818
+internal_count del_count
+907 816
+internal_count del_count
+906 814
+internal_count del_count
+905 812
+internal_count del_count
+904 810
+internal_count del_count
+903 808
+internal_count del_count
+902 806
+internal_count del_count
+901 804
+internal_count del_count
+900 802
+internal_count del_count
+899 800
+internal_count del_count
+898 798
+internal_count del_count
+897 796
+internal_count del_count
+896 794
+internal_count del_count
+895 792
+internal_count del_count
+894 790
+internal_count del_count
+893 788
+internal_count del_count
+892 786
+internal_count del_count
+891 784
+internal_count del_count
+890 782
+internal_count del_count
+889 780
+internal_count del_count
+888 778
+internal_count del_count
+887 776
+internal_count del_count
+886 774
+internal_count del_count
+885 772
+internal_count del_count
+884 770
+internal_count del_count
+883 768
+internal_count del_count
+882 766
+internal_count del_count
+881 764
+internal_count del_count
+880 762
+internal_count del_count
+879 760
+internal_count del_count
+878 758
+internal_count del_count
+877 756
+internal_count del_count
+876 754
+internal_count del_count
+875 752
+internal_count del_count
+874 750
+internal_count del_count
+873 748
+internal_count del_count
+872 746
+internal_count del_count
+871 744
+internal_count del_count
+870 742
+internal_count del_count
+869 740
+internal_count del_count
+868 738
+internal_count del_count
+867 736
+internal_count del_count
+866 734
+internal_count del_count
+865 732
+internal_count del_count
+864 730
+internal_count del_count
+863 728
+internal_count del_count
+862 726
+internal_count del_count
+861 724
+internal_count del_count
+860 722
+internal_count del_count
+859 720
+internal_count del_count
+858 718
+internal_count del_count
+857 716
+internal_count del_count
+856 714
+internal_count del_count
+855 712
+internal_count del_count
+854 710
+internal_count del_count
+853 708
+internal_count del_count
+852 706
+internal_count del_count
+851 704
+internal_count del_count
+850 702
+internal_count del_count
+849 700
+internal_count del_count
+848 698
+internal_count del_count
+847 696
+internal_count del_count
+846 694
+internal_count del_count
+845 692
+internal_count del_count
+844 690
+internal_count del_count
+843 688
+internal_count del_count
+842 686
+internal_count del_count
+841 684
+internal_count del_count
+840 682
+internal_count del_count
+839 680
+internal_count del_count
+838 678
+internal_count del_count
+837 676
+internal_count del_count
+836 674
+internal_count del_count
+835 672
+internal_count del_count
+834 670
+internal_count del_count
+833 668
+internal_count del_count
+832 666
+internal_count del_count
+831 664
+internal_count del_count
+830 662
+internal_count del_count
+829 660
+internal_count del_count
+828 658
+internal_count del_count
+827 656
+internal_count del_count
+826 654
+internal_count del_count
+825 652
+internal_count del_count
+824 650
+internal_count del_count
+823 648
+internal_count del_count
+822 646
+internal_count del_count
+821 644
+internal_count del_count
+820 642
+internal_count del_count
+819 640
+internal_count del_count
+818 638
+internal_count del_count
+817 636
+internal_count del_count
+816 634
+internal_count del_count
+815 632
+internal_count del_count
+814 630
+internal_count del_count
+813 628
+internal_count del_count
+812 626
+internal_count del_count
+811 624
+internal_count del_count
+810 622
+internal_count del_count
+809 620
+internal_count del_count
+808 618
+internal_count del_count
+807 616
+internal_count del_count
+806 614
+internal_count del_count
+805 612
+internal_count del_count
+804 610
+internal_count del_count
+803 608
+internal_count del_count
+802 606
+internal_count del_count
+801 604
+internal_count del_count
+800 602
+internal_count del_count
+799 600
+internal_count del_count
+798 598
+internal_count del_count
+797 596
+internal_count del_count
+796 594
+internal_count del_count
+795 592
+internal_count del_count
+794 590
+internal_count del_count
+793 588
+internal_count del_count
+792 586
+internal_count del_count
+791 584
+internal_count del_count
+790 582
+internal_count del_count
+789 580
+internal_count del_count
+788 578
+internal_count del_count
+787 576
+internal_count del_count
+786 574
+internal_count del_count
+785 572
+internal_count del_count
+784 570
+internal_count del_count
+783 568
+internal_count del_count
+782 566
+internal_count del_count
+781 564
+internal_count del_count
+780 562
+internal_count del_count
+779 560
+internal_count del_count
+778 558
+internal_count del_count
+777 556
+internal_count del_count
+776 554
+internal_count del_count
+775 552
+internal_count del_count
+774 550
+internal_count del_count
+773 548
+internal_count del_count
+772 546
+internal_count del_count
+771 544
+internal_count del_count
+770 542
+internal_count del_count
+769 540
+internal_count del_count
+768 538
+internal_count del_count
+767 536
+internal_count del_count
+766 534
+internal_count del_count
+765 532
+internal_count del_count
+764 530
+internal_count del_count
+763 528
+internal_count del_count
+762 526
+internal_count del_count
+761 524
+internal_count del_count
+760 522
+internal_count del_count
+759 520
+internal_count del_count
+758 518
+internal_count del_count
+757 516
+internal_count del_count
+756 514
+internal_count del_count
+755 512
+internal_count del_count
+754 510
+internal_count del_count
+753 508
+internal_count del_count
+752 506
+internal_count del_count
+751 504
+internal_count del_count
+750 502
+internal_count del_count
+749 500
+internal_count del_count
+748 498
+internal_count del_count
+747 496
+internal_count del_count
+746 494
+internal_count del_count
+745 492
+internal_count del_count
+744 490
+internal_count del_count
+743 488
+internal_count del_count
+742 486
+internal_count del_count
+741 484
+internal_count del_count
+740 482
+internal_count del_count
+739 480
+internal_count del_count
+738 478
+internal_count del_count
+737 476
+internal_count del_count
+736 474
+internal_count del_count
+735 472
+internal_count del_count
+734 470
+internal_count del_count
+733 468
+internal_count del_count
+732 466
+internal_count del_count
+731 464
+internal_count del_count
+730 462
+internal_count del_count
+729 460
+internal_count del_count
+728 458
+internal_count del_count
+727 456
+internal_count del_count
+726 454
+internal_count del_count
+725 452
+internal_count del_count
+724 450
+internal_count del_count
+723 448
+internal_count del_count
+722 446
+internal_count del_count
+721 444
+internal_count del_count
+720 442
+internal_count del_count
+719 440
+internal_count del_count
+718 438
+internal_count del_count
+717 436
+internal_count del_count
+716 434
+internal_count del_count
+715 432
+internal_count del_count
+714 430
+internal_count del_count
+713 428
+internal_count del_count
+712 426
+internal_count del_count
+711 424
+internal_count del_count
+710 422
+internal_count del_count
+709 420
+internal_count del_count
+708 418
+internal_count del_count
+707 416
+internal_count del_count
+706 414
+internal_count del_count
+705 412
+internal_count del_count
+704 410
+internal_count del_count
+703 408
+internal_count del_count
+702 406
+internal_count del_count
+701 404
+internal_count del_count
+700 402
+internal_count del_count
+699 400
+internal_count del_count
+698 398
+internal_count del_count
+697 396
+internal_count del_count
+696 394
+internal_count del_count
+695 392
+internal_count del_count
+694 390
+internal_count del_count
+693 388
+internal_count del_count
+692 386
+internal_count del_count
+691 384
+internal_count del_count
+690 382
+internal_count del_count
+689 380
+internal_count del_count
+688 378
+internal_count del_count
+687 376
+internal_count del_count
+686 374
+internal_count del_count
+685 372
+internal_count del_count
+684 370
+internal_count del_count
+683 368
+internal_count del_count
+682 366
+internal_count del_count
+681 364
+internal_count del_count
+680 362
+internal_count del_count
+679 360
+internal_count del_count
+678 358
+internal_count del_count
+677 356
+internal_count del_count
+676 354
+internal_count del_count
+675 352
+internal_count del_count
+674 350
+internal_count del_count
+673 348
+internal_count del_count
+672 346
+internal_count del_count
+671 344
+internal_count del_count
+670 342
+internal_count del_count
+669 340
+internal_count del_count
+668 338
+internal_count del_count
+667 336
+internal_count del_count
+666 334
+internal_count del_count
+665 332
+internal_count del_count
+664 330
+internal_count del_count
+663 328
+internal_count del_count
+662 326
+internal_count del_count
+661 324
+internal_count del_count
+660 322
+internal_count del_count
+659 320
+internal_count del_count
+658 318
+internal_count del_count
+657 316
+internal_count del_count
+656 314
+internal_count del_count
+655 312
+internal_count del_count
+654 310
+internal_count del_count
+653 308
+internal_count del_count
+652 306
+internal_count del_count
+651 304
+internal_count del_count
+650 302
+internal_count del_count
+649 300
+internal_count del_count
+648 298
+internal_count del_count
+647 296
+internal_count del_count
+646 294
+internal_count del_count
+645 292
+internal_count del_count
+644 290
+internal_count del_count
+643 288
+internal_count del_count
+642 286
+internal_count del_count
+641 284
+internal_count del_count
+640 282
+internal_count del_count
+639 280
+internal_count del_count
+638 278
+internal_count del_count
+637 276
+internal_count del_count
+636 274
+internal_count del_count
+635 272
+internal_count del_count
+634 270
+internal_count del_count
+633 268
+internal_count del_count
+632 266
+internal_count del_count
+631 264
+internal_count del_count
+630 262
+internal_count del_count
+629 260
+internal_count del_count
+628 258
+internal_count del_count
+627 256
+internal_count del_count
+626 254
+internal_count del_count
+625 252
+internal_count del_count
+624 250
+internal_count del_count
+623 248
+internal_count del_count
+622 246
+internal_count del_count
+621 244
+internal_count del_count
+620 242
+internal_count del_count
+619 240
+internal_count del_count
+618 238
+internal_count del_count
+617 236
+internal_count del_count
+616 234
+internal_count del_count
+615 232
+internal_count del_count
+614 230
+internal_count del_count
+613 228
+internal_count del_count
+612 226
+internal_count del_count
+611 224
+internal_count del_count
+610 222
+internal_count del_count
+609 220
+internal_count del_count
+608 218
+internal_count del_count
+607 216
+internal_count del_count
+606 214
+internal_count del_count
+605 212
+internal_count del_count
+604 210
+internal_count del_count
+603 208
+internal_count del_count
+602 206
+internal_count del_count
+601 204
+internal_count del_count
+600 202
+internal_count del_count
+599 200
+internal_count del_count
+598 198
+internal_count del_count
+597 196
+internal_count del_count
+596 194
+internal_count del_count
+595 192
+internal_count del_count
+594 190
+internal_count del_count
+593 188
+internal_count del_count
+592 186
+internal_count del_count
+591 184
+internal_count del_count
+590 182
+internal_count del_count
+589 180
+internal_count del_count
+588 178
+internal_count del_count
+587 176
+internal_count del_count
+586 174
+internal_count del_count
+585 172
+internal_count del_count
+584 170
+internal_count del_count
+583 168
+internal_count del_count
+582 166
+internal_count del_count
+581 164
+internal_count del_count
+580 162
+internal_count del_count
+579 160
+internal_count del_count
+578 158
+internal_count del_count
+577 156
+internal_count del_count
+576 154
+internal_count del_count
+575 152
+internal_count del_count
+574 150
+internal_count del_count
+573 148
+internal_count del_count
+572 146
+internal_count del_count
+571 144
+internal_count del_count
+570 142
+internal_count del_count
+569 140
+internal_count del_count
+568 138
+internal_count del_count
+567 136
+internal_count del_count
+566 134
+internal_count del_count
+565 132
+internal_count del_count
+564 130
+internal_count del_count
+563 128
+internal_count del_count
+562 126
+internal_count del_count
+561 124
+internal_count del_count
+560 122
+internal_count del_count
+559 120
+internal_count del_count
+558 118
+internal_count del_count
+557 116
+internal_count del_count
+556 114
+internal_count del_count
+555 112
+internal_count del_count
+554 110
+internal_count del_count
+553 108
+internal_count del_count
+552 106
+internal_count del_count
+551 104
+internal_count del_count
+550 102
+internal_count del_count
+549 100
+internal_count del_count
+548 98
+internal_count del_count
+547 96
+internal_count del_count
+546 94
+internal_count del_count
+545 92
+internal_count del_count
+544 90
+internal_count del_count
+543 88
+internal_count del_count
+542 86
+internal_count del_count
+541 84
+internal_count del_count
+540 82
+internal_count del_count
+539 80
+internal_count del_count
+538 78
+internal_count del_count
+537 76
+internal_count del_count
+536 74
+internal_count del_count
+535 72
+internal_count del_count
+534 70
+internal_count del_count
+533 68
+internal_count del_count
+532 66
+internal_count del_count
+531 64
+internal_count del_count
+530 62
+internal_count del_count
+529 60
+internal_count del_count
+528 58
+internal_count del_count
+527 56
+internal_count del_count
+526 54
+internal_count del_count
+525 52
+internal_count del_count
+524 50
+internal_count del_count
+523 48
+internal_count del_count
+522 46
+internal_count del_count
+521 44
+internal_count del_count
+520 42
+internal_count del_count
+519 40
+internal_count del_count
+518 38
+internal_count del_count
+517 36
+internal_count del_count
+516 34
+internal_count del_count
+515 32
+internal_count del_count
+514 30
+internal_count del_count
+513 28
+internal_count del_count
+512 26
+internal_count del_count
+511 24
+internal_count del_count
+510 22
+internal_count del_count
+509 20
+internal_count del_count
+508 18
+internal_count del_count
+507 16
+internal_count del_count
+506 14
+internal_count del_count
+505 12
+internal_count del_count
+504 10
+internal_count del_count
+503 8
+internal_count del_count
+502 6
+internal_count del_count
+501 4
+internal_count del_count
+500 2
+select count(*) as Part from test.part_tbl;
+Part
+500
+DROP PROCEDURE test.proc_part;
+DROP TABLE test.part_tbl;
diff --git a/mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result b/mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result
index db75a2c5b4d..85308442fd8 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result
@@ -138,7 +138,7 @@ ALTER TABLE t2 DROP COLUMN d;
******************** SHOW BINLOG EVENTS ********************
show binlog events from 1;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Format_desc 1 # Server ver: 5.1.16-beta-debug-log, Binlog ver: 4
+master-bin.000001 # Format_desc 1 # Server ver: #
master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS test_rpl
master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS test_rpl_1
master-bin.000001 # Query 1 # CREATE DATABASE test_rpl_1 CHARACTER SET utf8 COLLATE utf8_general_ci
diff --git a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
index 8c625dc70a4..19c5299df25 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
@@ -103,7 +103,7 @@ DELETE FROM t1;
DELETE FROM t2;
******************** LOAD DATA INFILE ********************
-LOAD DATA INFILE '../../suite/rpl/data/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ;
+LOAD DATA INFILE '../tmp/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ;
SELECT * FROM t1;
a b
10 line A
@@ -683,12 +683,13 @@ INSERT INTO t1 VALUES(1, 'test1');
CREATE EVENT e1 ON SCHEDULE EVERY '1' SECOND COMMENT 'e_second_comment' DO DELETE FROM t1;
==========MASTER==========
SHOW EVENTS;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
-test_rpl e1 root@localhost RECURRING NULL 1 SECOND # # ENABLED
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+test_rpl e1 root@localhost SYSTEM RECURRING NULL 1 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
==========SLAVE===========
USE test_rpl;
SHOW EVENTS;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+test_rpl e1 @ SYSTEM RECURRING NULL 1 # # NULL SLAVESIDE_DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -742,12 +743,13 @@ a b
ALTER EVENT e1 RENAME TO e2;
==========MASTER==========
SHOW EVENTS;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
-test_rpl e2 root@localhost RECURRING NULL 1 SECOND # # ENABLED
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+test_rpl e2 root@localhost SYSTEM RECURRING NULL 1 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
==========SLAVE===========
USE test_rpl;
SHOW EVENTS;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+test_rpl e2 @ SYSTEM RECURRING NULL 1 # # NULL SLAVESIDE_DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -776,11 +778,11 @@ a b
DROP EVENT e2;
==========MASTER==========
SHOW EVENTS;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
==========SLAVE===========
USE test_rpl;
SHOW EVENTS;
-Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
DELETE FROM t1;
DELETE FROM t2;
@@ -791,32 +793,32 @@ CREATE VIEW v1 AS SELECT * FROM t1 WHERE a = 1;
CREATE VIEW v2 AS SELECT * FROM t1 WHERE b <> UUID();
==========MASTER==========
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 1)
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 1) latin1 latin1_swedish_ci
SELECT * FROM v1;
a b
1 test1
==========SLAVE===========
USE test_rpl;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 1)
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 1) latin1 latin1_swedish_ci
SELECT * FROM v1;
a b
1 test1
ALTER VIEW v1 AS SELECT * FROM t1 WHERE a = 2;
==========MASTER==========
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 2)
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 2) latin1 latin1_swedish_ci
SELECT * FROM v1;
a b
2 test2
==========SLAVE===========
USE test_rpl;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 2)
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 2) latin1 latin1_swedish_ci
SELECT * FROM v1;
a b
2 test2
@@ -827,8 +829,9 @@ DELETE FROM t2;
******************** SHOW BINLOG EVENTS ********************
-show binlog events from 102;
+show binlog events from 1;
Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Format_desc 1 # Server ver: #
master-bin.000001 # Query 1 # CREATE DATABASE test_rpl
master-bin.000001 # Query 1 # use `test_rpl`; CREATE TABLE t1 (a int auto_increment not null, b char(254), PRIMARY KEY(a)) ENGINE=innodb
master-bin.000001 # Query 1 # use `test_rpl`; CREATE TABLE t2 (a int auto_increment not null, b char(254), PRIMARY KEY(a)) ENGINE=innodb
@@ -864,8 +867,8 @@ master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1
master-bin.000001 # Xid 1 # #
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2
master-bin.000001 # Xid 1 # #
-master-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=30
-master-bin.000001 # Execute_load_query 1 # use `test_rpl`; LOAD DATA INFILE '../../suite/rpl/data/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ;file_id=1
+master-bin.000001 # Begin_load_query 1 # ;file_id=#;block_len=#
+master-bin.000001 # Execute_load_query 1 # use `test_rpl`; LOAD DATA INFILE '../tmp/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ;file_id=#
master-bin.000001 # Xid 1 # #
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1
master-bin.000001 # Xid 1 # #
@@ -1001,9 +1004,7 @@ master-bin.000001 # Table_map 1 # table_id: # (test_rpl.t2)
master-bin.000001 # Write_rows 1 # table_id: #
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Xid 1 # #
-master-bin.000001 # Table_map 1 # table_id: # (test_rpl.t1)
-master-bin.000001 # Table_map 1 # table_id: # (test_rpl.t2)
-master-bin.000001 # Delete_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1
master-bin.000001 # Xid 1 # #
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2
master-bin.000001 # Xid 1 # #
@@ -1011,6 +1012,9 @@ master-bin.000001 # Query 1 # use `test_rpl`; DROP TRIGGER tr1
master-bin.000001 # Query 1 # use `test_rpl`; GRANT EVENT ON *.* TO 'root'@'localhost'
master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(1, 'test1')
master-bin.000001 # Xid 1 # #
+master-bin.000001 # Query 1 # use `test_rpl`; CREATE EVENT e1 ON SCHEDULE EVERY '1' SECOND COMMENT 'e_second_comment' DO DELETE FROM t1
+master-bin.000001 # Query 1 # use `test_rpl`; ALTER EVENT e1 RENAME TO e2
+master-bin.000001 # Query 1 # use `test_rpl`; DROP EVENT e2
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1
master-bin.000001 # Xid 1 # #
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2
diff --git a/mysql-test/r/rpl_insert.result b/mysql-test/suite/rpl/r/rpl_insert.result
index b6a97926f73..b6a97926f73 100644
--- a/mysql-test/r/rpl_insert.result
+++ b/mysql-test/suite/rpl/r/rpl_insert.result
diff --git a/mysql-test/r/rpl_insert_id.result b/mysql-test/suite/rpl/r/rpl_insert_id.result
index b0c1b6cfd73..b0c1b6cfd73 100644
--- a/mysql-test/r/rpl_insert_id.result
+++ b/mysql-test/suite/rpl/r/rpl_insert_id.result
diff --git a/mysql-test/r/rpl_insert_id_pk.result b/mysql-test/suite/rpl/r/rpl_insert_id_pk.result
index 79815355332..79815355332 100644
--- a/mysql-test/r/rpl_insert_id_pk.result
+++ b/mysql-test/suite/rpl/r/rpl_insert_id_pk.result
diff --git a/mysql-test/r/rpl_insert_ignore.result b/mysql-test/suite/rpl/r/rpl_insert_ignore.result
index da24c86627c..da24c86627c 100644
--- a/mysql-test/r/rpl_insert_ignore.result
+++ b/mysql-test/suite/rpl/r/rpl_insert_ignore.result
diff --git a/mysql-test/r/rpl_insert_select.result b/mysql-test/suite/rpl/r/rpl_insert_select.result
index 1aff39e0026..1aff39e0026 100644
--- a/mysql-test/r/rpl_insert_select.result
+++ b/mysql-test/suite/rpl/r/rpl_insert_select.result
diff --git a/mysql-test/suite/rpl/r/rpl_invoked_features.result b/mysql-test/suite/rpl/r/rpl_invoked_features.result
new file mode 100644
index 00000000000..3bcef762497
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_invoked_features.result
@@ -0,0 +1,451 @@
+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;
+USE test;
+DROP VIEW IF EXISTS v1,v11;
+DROP TABLE IF EXISTS t1,t2,t3,t11,t12,t13;
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p11;
+DROP FUNCTION IF EXISTS f1;
+DROP FUNCTION IF EXISTS f2;
+DROP EVENT IF EXISTS e1;
+DROP EVENT IF EXISTS e11;
+
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b INT, c VARCHAR(64)) ENGINE=myisam;
+INSERT INTO t1 VALUES (1,1,'1');
+INSERT INTO t1 VALUES (2,2,UUID());
+CREATE TABLE t2 (a INT, b INT, c VARCHAR(64)) ENGINE=myisam;
+INSERT INTO t2 VALUES (1,1,'1');
+INSERT INTO t2 VALUES (2,2,UUID());
+CREATE TABLE t11 (a INT NOT NULL PRIMARY KEY, b INT, c VARCHAR(64)) ENGINE=innodb;
+INSERT INTO t11 VALUES (1,1,'1');
+INSERT INTO t11 VALUES (2,2,UUID());
+CREATE TABLE t12 (a INT, b INT, c VARCHAR(64)) ENGINE=innodb;
+INSERT INTO t12 VALUES (1,1,'1');
+INSERT INTO t12 VALUES (2,2,UUID());
+
+CREATE VIEW v1 AS SELECT * FROM t1;
+CREATE VIEW v11 AS SELECT * FROM t11;
+CREATE TRIGGER t1_tr1 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+INSERT INTO t2 VALUES (NEW.a, NEW.b, NEW.c);
+INSERT INTO t3 VALUES (NEW.a, NEW.b, NEW.c);
+END|
+CREATE TRIGGER t1_tr2 BEFORE UPDATE ON t1 FOR EACH ROW
+BEGIN
+UPDATE t2 SET c = '';
+UPDATE t3 SET c = '';
+END|
+CREATE TRIGGER t11_tr1 BEFORE INSERT ON t11 FOR EACH ROW
+BEGIN
+INSERT INTO t12 VALUES (NEW.a, NEW.b, NEW.c);
+INSERT INTO t13 VALUES (NEW.a, NEW.b, NEW.c);
+END|
+CREATE TRIGGER t11_tr2 BEFORE UPDATE ON t11 FOR EACH ROW
+BEGIN
+UPDATE t12 SET c = '';
+UPDATE t13 SET c = '';
+END|
+CREATE EVENT e1 ON SCHEDULE EVERY 1 SECOND ENABLE DO
+BEGIN
+DECLARE c INT;
+SELECT a INTO c FROM t1 WHERE a < 11 ORDER BY a DESC LIMIT 1;
+IF c = 7 THEN
+CALL p1(10, '');
+END IF;
+END|
+CREATE EVENT e11 ON SCHEDULE EVERY 1 SECOND ENABLE DO
+BEGIN
+DECLARE c INT;
+SELECT a INTO c FROM t11 WHERE a < 11 ORDER BY a DESC LIMIT 1;
+IF c = 7 THEN
+CALL p11(10, '');
+END IF;
+END|
+CREATE FUNCTION f1 (x INT) RETURNS VARCHAR(64)
+BEGIN
+IF x > 5 THEN
+RETURN UUID();
+END IF;
+RETURN '';
+END|
+CREATE FUNCTION f2 (x INT) RETURNS VARCHAR(64)
+BEGIN
+RETURN f1(x);
+END|
+CREATE PROCEDURE p1 (IN x INT, IN y VARCHAR(64))
+BEGIN
+INSERT INTO t1 VALUES (x,x,y);
+END|
+CREATE PROCEDURE p11 (IN x INT, IN y VARCHAR(64))
+BEGIN
+INSERT INTO t11 VALUES (x,x,y);
+END|
+
+CREATE TABLE t3 SELECT * FROM v1;
+INSERT INTO t1 VALUES (3,3,'');
+UPDATE t1 SET c='2' WHERE a = 1;
+INSERT INTO t1 VALUES(4,4,f1(4));
+INSERT INTO t1 VALUES (100,100,'');
+CALL p1(5, UUID());
+INSERT INTO t1 VALUES (101,101,'');
+INSERT INTO t1 VALUES(6,6,f1(6));
+INSERT INTO t1 VALUES (102,102,'');
+INSERT INTO t1 VALUES(7,7,f2(7));
+INSERT INTO t1 VALUES (103,103,'');
+
+CREATE TABLE t13 SELECT * FROM v11;
+INSERT INTO t11 VALUES (3,3,'');
+UPDATE t11 SET c='2' WHERE a = 1;
+INSERT INTO t11 VALUES(4,4,f1(4));
+INSERT INTO t11 VALUES (100,100,'');
+CALL p11(5, UUID());
+INSERT INTO t11 VALUES (101,101,'');
+INSERT INTO t11 VALUES(6,6,f1(6));
+INSERT INTO t11 VALUES (102,102,'');
+INSERT INTO t11 VALUES(7,7,f2(7));
+INSERT INTO t11 VALUES (103,103,'');
+
+SET GLOBAL EVENT_SCHEDULER = on;
+SET GLOBAL EVENT_SCHEDULER = off;
+
+SHOW TABLES LIKE 't%';
+Tables_in_test (t%)
+t1
+t11
+t12
+t13
+t2
+t3
+SELECT table_name FROM information_schema.views WHERE table_schema='test';
+table_name
+v1
+v11
+SELECT trigger_name, event_manipulation, event_object_table FROM information_schema.triggers WHERE trigger_schema='test';
+trigger_name event_manipulation event_object_table
+t1_tr1 INSERT t1
+t1_tr2 UPDATE t1
+t11_tr1 INSERT t11
+t11_tr2 UPDATE t11
+SELECT routine_type, routine_name FROM information_schema.routines WHERE routine_schema='test';
+routine_type routine_name
+FUNCTION f1
+FUNCTION f2
+PROCEDURE p1
+PROCEDURE p11
+SELECT event_name, status FROM information_schema.events WHERE event_schema='test';
+event_name status
+e1 ENABLED
+e11 ENABLED
+
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+12
+SELECT a,b FROM t1 ORDER BY a;
+a b
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+7 7
+10 10
+100 100
+101 101
+102 102
+103 103
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+12
+SELECT a,b FROM t2 ORDER BY a;
+a b
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+7 7
+10 10
+100 100
+101 101
+102 102
+103 103
+SELECT COUNT(*) FROM t3;
+COUNT(*)
+12
+SELECT a,b FROM t3 ORDER BY a;
+a b
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+7 7
+10 10
+100 100
+101 101
+102 102
+103 103
+SELECT a,b FROM v1 ORDER BY a;
+a b
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+7 7
+10 10
+100 100
+101 101
+102 102
+103 103
+SELECT COUNT(*) FROM t11;
+COUNT(*)
+12
+SELECT a,b FROM t11 ORDER BY a;
+a b
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+7 7
+10 10
+100 100
+101 101
+102 102
+103 103
+SELECT COUNT(*) FROM t12;
+COUNT(*)
+12
+SELECT a,b FROM t12 ORDER BY a;
+a b
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+7 7
+10 10
+100 100
+101 101
+102 102
+103 103
+SELECT COUNT(*) FROM t13;
+COUNT(*)
+12
+SELECT a,b FROM t13 ORDER BY a;
+a b
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+7 7
+10 10
+100 100
+101 101
+102 102
+103 103
+SELECT a,b FROM v11 ORDER BY a;
+a b
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+7 7
+10 10
+100 100
+101 101
+102 102
+103 103
+
+SHOW TABLES LIKE 't%';
+Tables_in_test (t%)
+t1
+t11
+t12
+t13
+t2
+t3
+SELECT table_name FROM information_schema.views WHERE table_schema='test';
+table_name
+v1
+v11
+SELECT trigger_name, event_manipulation, event_object_table FROM information_schema.triggers WHERE trigger_schema='test';
+trigger_name event_manipulation event_object_table
+t1_tr1 INSERT t1
+t1_tr2 UPDATE t1
+t11_tr1 INSERT t11
+t11_tr2 UPDATE t11
+SELECT routine_type, routine_name FROM information_schema.routines WHERE routine_schema='test';
+routine_type routine_name
+FUNCTION f1
+FUNCTION f2
+PROCEDURE p1
+PROCEDURE p11
+SELECT event_name, status FROM information_schema.events WHERE event_schema='test';
+event_name status
+e1 SLAVESIDE_DISABLED
+e11 SLAVESIDE_DISABLED
+
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+12
+SELECT a,b FROM t1 ORDER BY a;
+a b
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+7 7
+10 10
+100 100
+101 101
+102 102
+103 103
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+12
+SELECT a,b FROM t2 ORDER BY a;
+a b
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+7 7
+10 10
+100 100
+101 101
+102 102
+103 103
+SELECT COUNT(*) FROM t3;
+COUNT(*)
+12
+SELECT a,b FROM t3 ORDER BY a;
+a b
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+7 7
+10 10
+100 100
+101 101
+102 102
+103 103
+SELECT a,b FROM v1 ORDER BY a;
+a b
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+7 7
+10 10
+100 100
+101 101
+102 102
+103 103
+SELECT COUNT(*) FROM t11;
+COUNT(*)
+12
+SELECT a,b FROM t11 ORDER BY a;
+a b
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+7 7
+10 10
+100 100
+101 101
+102 102
+103 103
+SELECT COUNT(*) FROM t12;
+COUNT(*)
+12
+SELECT a,b FROM t12 ORDER BY a;
+a b
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+7 7
+10 10
+100 100
+101 101
+102 102
+103 103
+SELECT COUNT(*) FROM t13;
+COUNT(*)
+12
+SELECT a,b FROM t13 ORDER BY a;
+a b
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+7 7
+10 10
+100 100
+101 101
+102 102
+103 103
+SELECT a,b FROM v11 ORDER BY a;
+a b
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+7 7
+10 10
+100 100
+101 101
+102 102
+103 103
+
+UPDATE t1 SET c='';
+UPDATE t2 SET c='';
+UPDATE t3 SET c='';
+UPDATE t11 SET c='';
+UPDATE t12 SET c='';
+UPDATE t13 SET c='';
+
+
+
+DROP VIEW IF EXISTS v1,v11;
+DROP TABLE IF EXISTS t1,t2,t3,t11,t12,t13;
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p11;
+DROP FUNCTION IF EXISTS f1;
+DROP FUNCTION IF EXISTS f2;
+DROP EVENT IF EXISTS e1;
+DROP EVENT IF EXISTS e11;
diff --git a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
new file mode 100644
index 00000000000..75180334c28
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
@@ -0,0 +1,147 @@
+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 NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT,
+UNIQUE(b));
+INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10;
+SELECT * FROM t1;
+a b
+1 10
+2 2
+show slave status;;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 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
+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 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'
+SELECT * FROM t1;
+a b
+stop slave;
+reset slave;
+reset master;
+drop table t1;
+start slave;
+CREATE TABLE t1 (
+id bigint(20) unsigned NOT NULL auto_increment,
+field_1 int(10) unsigned NOT NULL,
+field_2 varchar(255) NOT NULL,
+field_3 varchar(255) NOT NULL,
+PRIMARY KEY (id),
+UNIQUE KEY field_1 (field_1, field_2)
+);
+CREATE TABLE t2 (
+field_a int(10) unsigned NOT NULL,
+field_b varchar(255) NOT NULL,
+field_c varchar(255) NOT NULL
+);
+INSERT INTO t2 (field_a, field_b, field_c) VALUES (1, 'a', '1a');
+INSERT INTO t2 (field_a, field_b, field_c) VALUES (2, 'b', '2b');
+INSERT INTO t2 (field_a, field_b, field_c) VALUES (3, 'c', '3c');
+INSERT INTO t2 (field_a, field_b, field_c) VALUES (4, 'd', '4d');
+INSERT INTO t2 (field_a, field_b, field_c) VALUES (5, 'e', '5e');
+INSERT INTO t1 (field_1, field_2, field_3)
+SELECT t2.field_a, t2.field_b, t2.field_c
+FROM t2
+ON DUPLICATE KEY UPDATE
+t1.field_3 = t2.field_c;
+INSERT INTO t2 (field_a, field_b, field_c) VALUES (6, 'f', '6f');
+INSERT INTO t1 (field_1, field_2, field_3)
+SELECT t2.field_a, t2.field_b, t2.field_c
+FROM t2
+ON DUPLICATE KEY UPDATE
+t1.field_3 = t2.field_c;
+SELECT * FROM t1;
+id field_1 field_2 field_3
+1 1 a 1a
+2 2 b 2b
+3 3 c 3c
+4 4 d 4d
+5 5 e 5e
+6 6 f 6f
+show slave status;;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 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 (field_1, field_2, field_3)
+SELECT t2.field_a, t2.field_b, t2.field_c
+FROM t2
+ON DUPLICATE KEY UPDATE
+t1.field_3 = t2.field_c'
+Skip_Counter 0
+Exec_Master_Log_Pos 1278
+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 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 (field_1, field_2, field_3)
+SELECT t2.field_a, t2.field_b, t2.field_c
+FROM t2
+ON DUPLICATE KEY UPDATE
+t1.field_3 = t2.field_c'
+SELECT * FROM t1;
+id field_1 field_2 field_3
+drop table t1, t2;
+drop table t1, t2;
diff --git a/mysql-test/r/rpl_load_from_master.result b/mysql-test/suite/rpl/r/rpl_load_from_master.result
index 08b45ec1db0..08b45ec1db0 100644
--- a/mysql-test/r/rpl_load_from_master.result
+++ b/mysql-test/suite/rpl/r/rpl_load_from_master.result
diff --git a/mysql-test/r/rpl_load_table_from_master.result b/mysql-test/suite/rpl/r/rpl_load_table_from_master.result
index c24f857d829..c24f857d829 100644
--- a/mysql-test/r/rpl_load_table_from_master.result
+++ b/mysql-test/suite/rpl/r/rpl_load_table_from_master.result
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata.result b/mysql-test/suite/rpl/r/rpl_loaddata.result
new file mode 100644
index 00000000000..b9bd2a22fd0
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_loaddata.result
@@ -0,0 +1,92 @@
+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;
+reset master;
+select last_insert_id();
+last_insert_id()
+0
+create table t1(a int not null auto_increment, b int, primary key(a) );
+load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
+select last_insert_id();
+last_insert_id()
+1
+create temporary table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60));
+load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines;
+create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60));
+insert into t3 select * from t2;
+select * from t1;
+a b
+1 10
+2 15
+select * from t3;
+day id category name
+2003-02-22 2461 b a a a @ %  ' " a
+2003-03-22 2161 c asdf
+2003-03-22 2416 a bbbbb
+show master status;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+slave-bin.000001 1280
+drop table t1;
+drop table t2;
+drop table t3;
+create table t1(a int, b int, unique(b));
+insert into t1 values(1,10);
+load data infile '../std_data_ln/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 1797 # # master-bin.000001 Yes Yes # 0 0 1797 # None 0 No # No 0 0
+set sql_log_bin=0;
+delete from t1;
+set sql_log_bin=1;
+load data infile '../std_data_ln/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 1832 # # master-bin.000001 No No # 0 0 1832 # None 0 No # No 0 0
+set global sql_slave_skip_counter=1;
+start slave;
+set sql_log_bin=0;
+delete from t1;
+set sql_log_bin=1;
+load data infile '../std_data_ln/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
+reset master;
+create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
+unique(day)) engine=MyISAM;
+load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields
+terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
+'\n##\n' starting by '>' ignore 1 lines;
+ERROR 23000: Duplicate entry '2003-03-22' for key 'day'
+select * from t2;
+day id category name
+2003-02-22 2461 b a a a @ %  ' " a
+2003-03-22 2161 c asdf
+start slave;
+select * from t2;
+day id category name
+2003-02-22 2461 b a a a @ %  ' " a
+2003-03-22 2161 c asdf
+alter table t2 drop key day;
+delete from t2;
+load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields
+terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
+'\n##\n' starting by '>' ignore 1 lines;
+ERROR 23000: Duplicate entry '2003-03-22' for key 'day'
+drop table t2;
+drop table t2;
+drop table t1;
+CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
+LOAD DATA INFILE "../std_data_ln/words.dat" INTO TABLE t1;
+ERROR 23000: Duplicate entry 'Aarhus' for key 'PRIMARY'
+DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/r/rpl_loaddata_charset.result b/mysql-test/suite/rpl/r/rpl_loaddata_charset.result
index 929d06e74cf..929d06e74cf 100644
--- a/mysql-test/r/rpl_loaddata_charset.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_charset.result
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
new file mode 100644
index 00000000000..d30110f85e9
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
@@ -0,0 +1,90 @@
+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, b INT);
+INSERT INTO t1 VALUES (1,10);
+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 290
+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 290
+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
+LOAD DATA INFILE '../std_data_ln/rpl_loaddata.dat' INTO TABLE t1;
+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 465
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1592
+Last_Error Fatal error: Not enough memory
+Skip_Counter 0
+Exec_Master_Log_Pos 325
+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 1592
+Last_SQL_Error Fatal error: Not enough memory
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
+START SLAVE;
+DROP TABLE t1;
diff --git a/mysql-test/r/rpl_loaddata_m.result b/mysql-test/suite/rpl/r/rpl_loaddata_m.result
index 9dbae6d38c4..9dbae6d38c4 100644
--- a/mysql-test/r/rpl_loaddata_m.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_m.result
diff --git a/mysql-test/r/rpl_loaddata_s.result b/mysql-test/suite/rpl/r/rpl_loaddata_s.result
index 4fc33eee20d..4fc33eee20d 100644
--- a/mysql-test/r/rpl_loaddata_s.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_s.result
diff --git a/mysql-test/r/rpl_loaddata_simple.result b/mysql-test/suite/rpl/r/rpl_loaddata_simple.result
index 196093211b6..196093211b6 100644
--- a/mysql-test/r/rpl_loaddata_simple.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_simple.result
diff --git a/mysql-test/r/rpl_loaddatalocal.result b/mysql-test/suite/rpl/r/rpl_loaddatalocal.result
index bb1b0610aa8..bb1b0610aa8 100644
--- a/mysql-test/r/rpl_loaddatalocal.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddatalocal.result
diff --git a/mysql-test/r/rpl_loadfile.result b/mysql-test/suite/rpl/r/rpl_loadfile.result
index 7487693a9f7..7487693a9f7 100644
--- a/mysql-test/r/rpl_loadfile.result
+++ b/mysql-test/suite/rpl/r/rpl_loadfile.result
diff --git a/mysql-test/r/rpl_locale.result b/mysql-test/suite/rpl/r/rpl_locale.result
index b7396084663..b7396084663 100644
--- a/mysql-test/r/rpl_locale.result
+++ b/mysql-test/suite/rpl/r/rpl_locale.result
diff --git a/mysql-test/suite/rpl/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result
new file mode 100644
index 00000000000..0f3552af5bc
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_log_pos.result
@@ -0,0 +1,107 @@
+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;
+show master status;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000001 106 <Binlog_Ignore_DB>
+stop slave;
+change master to master_log_pos=75;
+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 75
+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 75
+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
+start slave;
+stop slave;
+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 75
+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 75
+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
+show master status;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000001 106 <Binlog_Ignore_DB>
+create table if not exists t1 (n int);
+drop table if exists t1;
+create table t1 (n int);
+insert into t1 values (1),(2),(3);
+change master to master_log_pos=106;
+start slave;
+select * from t1 ORDER BY n;
+n
+1
+2
+3
+drop table t1;
+End of 5.0 tests
diff --git a/mysql-test/r/rpl_many_optimize.result b/mysql-test/suite/rpl/r/rpl_many_optimize.result
index b2148892591..b2148892591 100644
--- a/mysql-test/r/rpl_many_optimize.result
+++ b/mysql-test/suite/rpl/r/rpl_many_optimize.result
diff --git a/mysql-test/r/rpl_master_pos_wait.result b/mysql-test/suite/rpl/r/rpl_master_pos_wait.result
index 951e944fddc..951e944fddc 100644
--- a/mysql-test/r/rpl_master_pos_wait.result
+++ b/mysql-test/suite/rpl/r/rpl_master_pos_wait.result
diff --git a/mysql-test/suite/rpl/r/rpl_misc_functions.result b/mysql-test/suite/rpl/r/rpl_misc_functions.result
new file mode 100644
index 00000000000..a8e5520ca8f
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_misc_functions.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;
+create table t1(id int, i int, r1 int, r2 int, p varchar(100));
+insert into t1 values(1, connection_id(), 0, 0, "");
+insert into t1 values(2, 0, rand()*1000, rand()*1000, "");
+set sql_log_bin=0;
+insert into t1 values(6, 0, rand(), rand(), "");
+delete from t1 where id=6;
+set sql_log_bin=1;
+insert into t1 values(3, 0, 0, 0, password('does_this_work?'));
+insert into t1 values(4, connection_id(), rand()*1000, rand()*1000, password('does_this_still_work?'));
+select * into outfile 'rpl_misc_functions.outfile' from t1;
+create table t2 like t1;
+load data local infile 'MYSQLTEST_VARDIR/master-data/test/rpl_misc_functions.outfile' into table t2;
+select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p);
+id i r1 r2 p id i r1 r2 p
+drop table t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+col_a DOUBLE DEFAULT NULL);
+CREATE PROCEDURE test_replication_sp1()
+BEGIN
+INSERT INTO t1 (col_a) VALUES (rand()), (rand());
+INSERT INTO t1 (col_a) VALUES (rand());
+END|
+CREATE PROCEDURE test_replication_sp2()
+BEGIN
+CALL test_replication_sp1();
+CALL test_replication_sp1();
+END|
+CREATE FUNCTION test_replication_sf() RETURNS DOUBLE DETERMINISTIC
+BEGIN
+RETURN (rand() + rand());
+END|
+CALL test_replication_sp1();
+CALL test_replication_sp2();
+INSERT INTO t1 (col_a) VALUES (test_replication_sf());
+INSERT INTO t1 (col_a) VALUES (test_replication_sf());
+INSERT INTO t1 (col_a) VALUES (test_replication_sf());
+select * from t1 into outfile "../tmp/t1_slave.txt";
+create temporary table t1_slave select * from t1 where 1=0;
+load data infile '../tmp/t1_slave.txt' into table t1_slave;
+select count(*) into @aux from t1 join t1_slave using (id)
+where ABS(t1.col_a - t1_slave.col_a) < 0.0000001 ;
+SELECT @aux;
+@aux
+12
+DROP TABLE t1, t1_slave;
+DROP PROCEDURE test_replication_sp1;
+DROP PROCEDURE test_replication_sp2;
+DROP FUNCTION test_replication_sf;
diff --git a/mysql-test/r/rpl_mixed_ddl_dml.result b/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result
index 38972a4f571..38972a4f571 100644
--- a/mysql-test/r/rpl_mixed_ddl_dml.result
+++ b/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result
diff --git a/mysql-test/r/rpl_multi_delete.result b/mysql-test/suite/rpl/r/rpl_multi_delete.result
index 4831502eb88..4831502eb88 100644
--- a/mysql-test/r/rpl_multi_delete.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_delete.result
diff --git a/mysql-test/r/rpl_multi_delete2.result b/mysql-test/suite/rpl/r/rpl_multi_delete2.result
index 87abe60b268..87abe60b268 100644
--- a/mysql-test/r/rpl_multi_delete2.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_delete2.result
diff --git a/mysql-test/r/rpl_multi_engine.result b/mysql-test/suite/rpl/r/rpl_multi_engine.result
index 7cb7d873415..7cb7d873415 100644
--- a/mysql-test/r/rpl_multi_engine.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_engine.result
diff --git a/mysql-test/r/rpl_multi_update.result b/mysql-test/suite/rpl/r/rpl_multi_update.result
index 524278be042..524278be042 100644
--- a/mysql-test/r/rpl_multi_update.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_update.result
diff --git a/mysql-test/r/rpl_multi_update2.result b/mysql-test/suite/rpl/r/rpl_multi_update2.result
index 5bb262764fa..5bb262764fa 100644
--- a/mysql-test/r/rpl_multi_update2.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_update2.result
diff --git a/mysql-test/r/rpl_multi_update3.result b/mysql-test/suite/rpl/r/rpl_multi_update3.result
index dba7f770ba2..dba7f770ba2 100644
--- a/mysql-test/r/rpl_multi_update3.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_update3.result
diff --git a/mysql-test/r/rpl_multi_update4.result b/mysql-test/suite/rpl/r/rpl_multi_update4.result
index f6dde65a35d..f6dde65a35d 100644
--- a/mysql-test/r/rpl_multi_update4.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_update4.result
diff --git a/mysql-test/r/rpl_optimize.result b/mysql-test/suite/rpl/r/rpl_optimize.result
index 79891169fbc..79891169fbc 100644
--- a/mysql-test/r/rpl_optimize.result
+++ b/mysql-test/suite/rpl/r/rpl_optimize.result
diff --git a/mysql-test/suite/rpl/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result
new file mode 100644
index 00000000000..981c234d380
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_packet.result
@@ -0,0 +1,32 @@
+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;
+drop database if exists DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
+create database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
+select @@net_buffer_length, @@max_allowed_packet;
+@@net_buffer_length @@max_allowed_packet
+1024 1024
+create table `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
+INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1023');
+select count(*) from `DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________`.`t1` /* must be 1 */;
+count(*)
+1
+SHOW STATUS LIKE 'Slave_running';
+Variable_name Value
+Slave_running ON
+select * from information_schema.session_status where variable_name= 'SLAVE_RUNNING';
+VARIABLE_NAME VARIABLE_VALUE
+SLAVE_RUNNING ON
+drop database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
+SET @@global.max_allowed_packet=4096;
+SET @@global.net_buffer_length=4096;
+STOP SLAVE;
+START SLAVE;
+CREATE TABLe `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
+INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
+SHOW STATUS LIKE 'Slave_running';
+Variable_name Value
+Slave_running OFF
diff --git a/mysql-test/suite/rpl/r/rpl_ps.result b/mysql-test/suite/rpl/r/rpl_ps.result
new file mode 100644
index 00000000000..faba43ae934
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_ps.result
@@ -0,0 +1,80 @@
+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;
+drop table if exists t1;
+create table t1(n char(30));
+prepare stmt1 from 'insert into t1 values (?)';
+set @var1= "from-master-1";
+execute stmt1 using @var1;
+set @var1= "from-master-2-'',";
+execute stmt1 using @var1;
+SELECT * FROM t1 ORDER BY n;
+n
+from-master-1
+from-master-2-'',
+set @var2= 'insert into t1 values (concat("from-var-", ?))';
+prepare stmt2 from @var2;
+set @var1='from-master-3';
+execute stmt2 using @var1;
+SELECT * FROM t1 ORDER BY n;
+n
+from-master-1
+from-master-2-'',
+from-var-from-master-3
+drop table t1;
+stop slave;
+
+########################################################################
+#
+# BUG#25843: Changing default database between PREPARE and EXECUTE of
+# statement breaks binlog.
+#
+########################################################################
+
+# Connection: slave
+
+
+START SLAVE;
+
+# Connection: master
+
+
+CREATE DATABASE mysqltest1;
+CREATE TABLE t1(db_name CHAR(32), db_col_name CHAR(32));
+
+PREPARE stmt_d_1 FROM 'INSERT INTO t1 VALUES(DATABASE(), @@collation_database)';
+
+EXECUTE stmt_d_1;
+
+use mysqltest1;
+
+EXECUTE stmt_d_1;
+
+
+# Connection: slave
+
+
+SELECT * FROM t1;
+db_name db_col_name
+test latin1_swedish_ci
+test latin1_swedish_ci
+
+# Connection: master
+
+
+DROP DATABASE mysqltest1;
+
+use test;
+
+
+# Connection: slave
+
+
+STOP SLAVE;
+
+########################################################################
+reset master;
+reset slave;
diff --git a/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result b/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result
new file mode 100644
index 00000000000..1c9d8701232
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result
@@ -0,0 +1,71 @@
+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;
+SET BINLOG_FORMAT=MIXED;
+SET GLOBAL BINLOG_FORMAT=MIXED;
+SELECT @@GLOBAL.BINLOG_FORMAT, @@SESSION.BINLOG_FORMAT;
+@@GLOBAL.BINLOG_FORMAT @@SESSION.BINLOG_FORMAT
+MIXED MIXED
+**** On Master ****
+CREATE TABLE t1 (a INT, b LONG);
+INSERT INTO t1 VALUES (1,1), (2,2);
+INSERT INTO t1 VALUES (3,UUID()), (4,UUID());
+SHOW BINLOG EVENTS;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
+master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1 (a INT, b LONG)
+master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES (1,1), (2,2)
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+**** On Slave ****
+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 457
+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 457
+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 #
+Last_IO_Errno #
+Last_IO_Error
+Last_SQL_Errno 0
+Last_SQL_Error
+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
+slave-bin.000001 # Query 2 # use `test`; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9
+slave-bin.000001 # Query 1 # use `test`; CREATE TABLE t1 (a INT, b LONG)
+slave-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES (1,1), (2,2)
+slave-bin.000001 # Table_map 1 # table_id: # (test.t1)
+slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/r/rpl_read_only.result b/mysql-test/suite/rpl/r/rpl_read_only.result
index 6b1404b4f68..6b1404b4f68 100644
--- a/mysql-test/r/rpl_read_only.result
+++ b/mysql-test/suite/rpl/r/rpl_read_only.result
diff --git a/mysql-test/suite/rpl/r/rpl_redirect.result b/mysql-test/suite/rpl/r/rpl_redirect.result
new file mode 100644
index 00000000000..39a7cb3ac3b
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_redirect.result
@@ -0,0 +1,40 @@
+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;
+SHOW SLAVE STATUS;
+SHOW SLAVE HOSTS;
+Server_id Host Port Rpl_recovery_rank Master_id
+2 127.0.0.1 SLAVE_PORT 2 1
+create table t1 ( n int);
+insert into t1 values (1),(2),(3),(4);
+insert into t1 values(5);
+SELECT * FROM t1 ORDER BY n;
+n
+1
+2
+3
+4
+5
+SELECT * FROM t1 ORDER BY n;
+n
+1
+2
+3
+4
+SELECT * FROM t1 ORDER BY n;
+n
+1
+2
+3
+4
+SELECT * FROM t1 ORDER BY n;
+n
+1
+2
+3
+4
+5
+drop table t1;
diff --git a/mysql-test/r/rpl_relay_space_innodb.result b/mysql-test/suite/rpl/r/rpl_relay_space_innodb.result
index 54aac2eca35..54aac2eca35 100644
--- a/mysql-test/r/rpl_relay_space_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_relay_space_innodb.result
diff --git a/mysql-test/r/rpl_relay_space_myisam.result b/mysql-test/suite/rpl/r/rpl_relay_space_myisam.result
index e8d2d63e46e..e8d2d63e46e 100644
--- a/mysql-test/r/rpl_relay_space_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_relay_space_myisam.result
diff --git a/mysql-test/r/rpl_relayrotate.result b/mysql-test/suite/rpl/r/rpl_relayrotate.result
index 20f19973d83..20f19973d83 100644
--- a/mysql-test/r/rpl_relayrotate.result
+++ b/mysql-test/suite/rpl/r/rpl_relayrotate.result
diff --git a/mysql-test/r/rpl_relayspace.result b/mysql-test/suite/rpl/r/rpl_relayspace.result
index 1f2a739d3e3..1f2a739d3e3 100644
--- a/mysql-test/r/rpl_relayspace.result
+++ b/mysql-test/suite/rpl/r/rpl_relayspace.result
diff --git a/mysql-test/suite/rpl/r/rpl_replicate_do.result b/mysql-test/suite/rpl/r/rpl_replicate_do.result
new file mode 100644
index 00000000000..d854a2d0f8d
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_replicate_do.result
@@ -0,0 +1,113 @@
+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;
+drop table if exists t11;
+drop table if exists t11;
+create table t2 (n int);
+insert into t2 values(4);
+create table t2 (s char(20));
+load data infile '../std_data_ln/words.dat' into table t2;
+insert into t2 values('five');
+create table t1 (m int);
+insert into t1 values(15),(16),(17);
+update t1 set m=20 where m=16;
+delete from t1 where m=17;
+create table t11 select * from t1;
+select * from t1 ORDER BY m;
+m
+15
+20
+select * from t2;
+n
+4
+select * from t11;
+ERROR 42S02: Table 'test.t11' doesn't exist
+drop table if exists t1,t2,t11;
+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 #
+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 test.t1
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 0
+Last_Error
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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
+create table t1 (ts timestamp);
+set one_shot time_zone='met';
+insert into t1 values('2005-08-12 00:00:00');
+set one_shot time_zone='met';
+select * from t1;
+ts
+2005-08-12 00:00:00
+set one_shot time_zone='met';
+select * from t1;
+ts
+2005-08-12 00:00:00
+drop table t1;
+*** master ***
+create table t1 (a int, b int);
+create trigger trg1 before insert on t1 for each row set new.b=2;
+create table t2 (a int, b int);
+create trigger trg2 before insert on t2 for each row set new.b=2;
+show tables;
+Tables_in_test
+t1
+t2
+show triggers;
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+trg1 INSERT t1 set new.b=2 BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+trg2 INSERT t2 set new.b=2 BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+*** slave ***
+show tables;
+Tables_in_test
+t1
+show triggers;
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+trg1 INSERT t1 set new.b=2 BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+*** master ***
+drop trigger trg1;
+drop trigger trg2;
+show triggers;
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+*** slave ***
+show tables;
+Tables_in_test
+t1
+show triggers;
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+*** master ***
+drop table t1;
+drop table t2;
diff --git a/mysql-test/r/rpl_replicate_ignore_db.result b/mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result
index 0135804c02d..0135804c02d 100644
--- a/mysql-test/r/rpl_replicate_ignore_db.result
+++ b/mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result
diff --git a/mysql-test/r/rpl_rewrt_db.result b/mysql-test/suite/rpl/r/rpl_rewrt_db.result
index 1b843bffdca..1b843bffdca 100644
--- a/mysql-test/r/rpl_rewrt_db.result
+++ b/mysql-test/suite/rpl/r/rpl_rewrt_db.result
diff --git a/mysql-test/suite/rpl/r/rpl_rotate_logs.result b/mysql-test/suite/rpl/r/rpl_rotate_logs.result
new file mode 100644
index 00000000000..2282067ddfd
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_rotate_logs.result
@@ -0,0 +1,213 @@
+drop table if exists t1, t2, t3, t4;
+drop table if exists t1, t2, t3, t4;
+start slave;
+Got one of the listed errors
+start slave;
+ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log
+change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
+ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log
+reset slave;
+change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
+reset master;
+start slave;
+create temporary table temp_table (a char(80) not null);
+insert into temp_table values ("testing temporary tables");
+create table t1 (s text);
+insert into t1 values('Could not break slave'),('Tried hard');
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 60
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos 556
+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 556
+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
+select * from t1;
+s
+Could not break slave
+Tried hard
+flush logs;
+create table t2(m int not null auto_increment primary key);
+insert into t2 values (34),(67),(123);
+flush logs;
+show binary logs;
+Log_name File_size
+master-bin.000001 600
+master-bin.000002 371
+master-bin.000003 106
+create table t3 select * from temp_table;
+select * from t3;
+a
+testing temporary tables
+drop table temp_table, t3;
+insert into t2 values(1234);
+set insert_id=1234;
+insert into t2 values(NULL);
+set global sql_slave_skip_counter=1;
+start slave;
+purge master logs to 'master-bin.000002';
+show master logs;
+Log_name File_size
+master-bin.000002 371
+master-bin.000003 415
+purge binary logs to 'master-bin.000002';
+show binary logs;
+Log_name File_size
+master-bin.000002 371
+master-bin.000003 415
+select @time_for_purge:=DATE_ADD(UPDATE_TIME, INTERVAL 1 SECOND)
+from information_schema.tables
+where TABLE_SCHEMA="test" and TABLE_NAME="t2";
+purge master logs before (@time_for_purge);
+show binary logs;
+Log_name File_size
+master-bin.000003 415
+insert into t2 values (65);
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 60
+Master_Log_File master-bin.000003
+Read_Master_Log_Pos 504
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000003
+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 504
+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
+select * from t2;
+m
+34
+65
+67
+123
+1234
+create temporary table temp_table (a char(80) not null);
+insert into temp_table values ("testing temporary tables part 2");
+create table t3 (n int);
+select count(*) from t3 where n >= 4;
+count(*)
+100
+create table t4 select * from temp_table;
+show binary logs;
+Log_name File_size
+master-bin.000003 4193
+master-bin.000004 4198
+master-bin.000005 2040
+show master status;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000005 2040
+select * from t4;
+a
+testing temporary tables part 2
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 60
+Master_Log_File master-bin.000005
+Read_Master_Log_Pos 2040
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000005
+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 2040
+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
+lock tables t3 read;
+select count(*) from t3 where n >= 4;
+count(*)
+100
+unlock tables;
+drop table if exists t1,t2,t3,t4;
+End of 4.1 tests
+show binlog events in 'non existing_binlog_file';
+ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
+purge master logs before now();
+show binlog events in '';
+ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
+purge master logs before now();
+End of 5.0 tests
diff --git a/mysql-test/r/rpl_row_001.result b/mysql-test/suite/rpl/r/rpl_row_001.result
index fad60af664f..fad60af664f 100644
--- a/mysql-test/r/rpl_row_001.result
+++ b/mysql-test/suite/rpl/r/rpl_row_001.result
diff --git a/mysql-test/r/rpl_row_4_bytes.result b/mysql-test/suite/rpl/r/rpl_row_4_bytes.result
index e2431364ed3..e2431364ed3 100644
--- a/mysql-test/r/rpl_row_4_bytes.result
+++ b/mysql-test/suite/rpl/r/rpl_row_4_bytes.result
diff --git a/mysql-test/r/rpl_row_NOW.result b/mysql-test/suite/rpl/r/rpl_row_NOW.result
index 23f95878608..23f95878608 100644
--- a/mysql-test/r/rpl_row_NOW.result
+++ b/mysql-test/suite/rpl/r/rpl_row_NOW.result
diff --git a/mysql-test/r/rpl_row_USER.result b/mysql-test/suite/rpl/r/rpl_row_USER.result
index 98755fb4653..98755fb4653 100644
--- a/mysql-test/r/rpl_row_USER.result
+++ b/mysql-test/suite/rpl/r/rpl_row_USER.result
diff --git a/mysql-test/suite/rpl/r/rpl_row_UUID.result b/mysql-test/suite/rpl/r/rpl_row_UUID.result
new file mode 100644
index 00000000000..02174a7ecae
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_UUID.result
@@ -0,0 +1,40 @@
+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;
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE IF EXISTS test.t1;
+CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, vchar_column VARCHAR(100), PRIMARY KEY(a)) engine=myisam;
+INSERT INTO test.t1 VALUES(1,UUID(),UUID());
+create procedure test.p1()
+begin
+INSERT INTO test.t1 VALUES(2,UUID(),UUID());
+INSERT INTO test.t1 VALUES(3,UUID(),UUID());
+end|
+CALL test.p1();
+create function test.fn1(x int)
+returns int
+begin
+insert into t1 values (4+x,UUID(),UUID());
+insert into t1 values (5+x,UUID(),UUID());
+return 0;
+end|
+select fn1(0);
+fn1(0)
+0
+create table t2 (a int) engine=myisam;
+insert into t2 values(fn1(2));
+SHOW CREATE TABLE test.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL DEFAULT '0',
+ `blob_column` longblob,
+ `vchar_column` varchar(100) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP PROCEDURE test.p1;
+DROP FUNCTION test.fn1;
+DROP TABLE test.t1;
+DROP TABLE test.t2;
diff --git a/mysql-test/r/rpl_row_basic_11bugs-master.opt b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs-master.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/r/rpl_row_basic_11bugs-master.opt
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs-master.opt
diff --git a/mysql-test/r/rpl_row_basic_11bugs-slave.opt b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/r/rpl_row_basic_11bugs-slave.opt
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs-slave.opt
diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result
new file mode 100644
index 00000000000..7dc9926522b
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result
@@ -0,0 +1,244 @@
+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 DATABASE test_ignore;
+**** On Master ****
+SHOW DATABASES;
+Database
+information_schema
+mysql
+test
+test_ignore
+USE test;
+CREATE TABLE t1 (a INT, b INT);
+SHOW TABLES;
+Tables_in_test
+t1
+INSERT INTO t1 VALUES (1,1), (2,2);
+USE test_ignore;
+CREATE TABLE t2 (a INT, b INT);
+SHOW TABLES;
+Tables_in_test_ignore
+t2
+INSERT INTO t2 VALUES (3,3), (4,4);
+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, b INT)
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+**** On Slave ****
+SHOW DATABASES;
+Database
+information_schema
+mysql
+test
+USE test;
+SHOW TABLES;
+Tables_in_test
+t1
+USE test_ignore;
+ERROR 42000: Unknown database 'test_ignore'
+DROP DATABASE test_ignore;
+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);
+DELETE FROM t1;
+INSERT INTO t1 VALUES (1),(2);
+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 Table_map 1 233 table_id: # (test.t1)
+master-bin.000001 233 Write_rows 1 272 table_id: # flags: STMT_END_F
+DROP TABLE t1;
+================ Test for BUG#17620 ================
+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;
+**** On Slave ****
+SET GLOBAL QUERY_CACHE_SIZE=0;
+**** On Master ****
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+**** On Slave ****
+SET GLOBAL QUERY_CACHE_SIZE=16*1024*1024;
+**** On Master ****
+INSERT INTO t1 VALUES (4),(5),(6);
+**** On Slave ****
+SELECT * FROM t1;
+a
+1
+2
+3
+4
+5
+6
+**** On Master ****
+INSERT INTO t1 VALUES (7),(8),(9);
+**** On Slave ****
+SELECT * FROM t1;
+a
+1
+2
+3
+4
+5
+6
+7
+8
+9
+SET GLOBAL QUERY_CACHE_SIZE=0;
+================ Test for BUG#22550 ================
+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 BIT(1), b INT) ENGINE=MYISAM;
+INSERT INTO t1 VALUES(1,2);
+SELECT HEX(a),b FROM t1;
+HEX(a) b
+1 2
+SELECT HEX(a),b FROM t1;
+HEX(a) b
+1 2
+UPDATE t1 SET a=0 WHERE b=2;
+SELECT HEX(a),b FROM t1;
+HEX(a) b
+0 2
+SELECT HEX(a),b FROM t1;
+HEX(a) b
+0 2
+DROP TABLE IF EXISTS t1;
+================ Test for BUG#22583 ================
+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;
+**** On Master ****
+CREATE TABLE t1_myisam (k INT, a BIT(1), b BIT(9)) ENGINE=MYISAM;
+CREATE TABLE t1_innodb (k INT, a BIT(1), b BIT(9)) ENGINE=INNODB;
+CREATE TABLE t2_myisam (k INT, a BIT(1) NOT NULL, b BIT(4) NOT NULL) ENGINE=MYISAM;
+CREATE TABLE t2_innodb (k INT, a BIT(1) NOT NULL, b BIT(4) NOT NULL) ENGINE=INNODB;
+**** On Slave ****
+ALTER TABLE t1_myisam ENGINE=INNODB;
+ALTER TABLE t1_innodb ENGINE=MYISAM;
+ALTER TABLE t2_myisam ENGINE=INNODB;
+ALTER TABLE t2_innodb ENGINE=MYISAM;
+**** On Master ****
+INSERT INTO t1_myisam VALUES(1, b'0', 257);
+INSERT INTO t1_myisam VALUES(2, b'1', 256);
+INSERT INTO t1_innodb VALUES(1, b'0', 257);
+INSERT INTO t1_innodb VALUES(2, b'1', 256);
+SELECT k, HEX(a),HEX(b) FROM t1_myisam;
+k HEX(a) HEX(b)
+1 0 101
+2 1 100
+SELECT k, HEX(a),HEX(b) FROM t1_innodb;
+k HEX(a) HEX(b)
+1 0 101
+2 1 100
+INSERT INTO t2_myisam VALUES(1, b'0', 9);
+INSERT INTO t2_myisam VALUES(2, b'1', 8);
+INSERT INTO t2_innodb VALUES(1, b'0', 9);
+INSERT INTO t2_innodb VALUES(2, b'1', 8);
+SELECT k, HEX(a),HEX(b) FROM t2_myisam;
+k HEX(a) HEX(b)
+1 0 9
+2 1 8
+SELECT k, HEX(a),HEX(b) FROM t2_innodb;
+k HEX(a) HEX(b)
+1 0 9
+2 1 8
+**** On Slave ****
+SELECT k, HEX(a),HEX(b) FROM t1_myisam;
+k HEX(a) HEX(b)
+1 0 101
+2 1 100
+SELECT k, HEX(a),HEX(b) FROM t1_innodb;
+k HEX(a) HEX(b)
+1 0 101
+2 1 100
+SELECT k, HEX(a),HEX(b) FROM t2_myisam;
+k HEX(a) HEX(b)
+1 0 9
+2 1 8
+SELECT k, HEX(a),HEX(b) FROM t2_innodb;
+k HEX(a) HEX(b)
+1 0 9
+2 1 8
+**** On Master ****
+UPDATE t1_myisam SET a=0 WHERE k=2;
+SELECT k, HEX(a),HEX(b) FROM t1_myisam;
+k HEX(a) HEX(b)
+1 0 101
+2 0 100
+UPDATE t1_innodb SET a=0 WHERE k=2;
+SELECT k, HEX(a),HEX(b) FROM t1_innodb;
+k HEX(a) HEX(b)
+1 0 101
+2 0 100
+UPDATE t2_myisam SET a=0 WHERE k=2;
+SELECT k, HEX(a),HEX(b) FROM t2_myisam;
+k HEX(a) HEX(b)
+1 0 9
+2 0 8
+UPDATE t2_innodb SET a=0 WHERE k=2;
+SELECT k, HEX(a),HEX(b) FROM t2_innodb;
+k HEX(a) HEX(b)
+1 0 9
+2 0 8
+**** On Slave ****
+SELECT k, HEX(a),HEX(b) FROM t1_myisam;
+k HEX(a) HEX(b)
+1 0 101
+2 0 100
+SELECT k, HEX(a),HEX(b) FROM t1_innodb;
+k HEX(a) HEX(b)
+1 0 101
+2 0 100
+SELECT k, HEX(a),HEX(b) FROM t2_myisam;
+k HEX(a) HEX(b)
+1 0 9
+2 0 8
+SELECT k, HEX(a),HEX(b) FROM t2_innodb;
+k HEX(a) HEX(b)
+1 0 9
+2 0 8
+**** On Master ****
+DROP TABLE IF EXISTS t1_myisam, t1_innodb, t2_myisam, t2_innodb;
+drop table if exists t1, t2;
+CREATE TABLE `t1` (
+`a` int(11) NOT NULL auto_increment,
+`b` int(11) default NULL,
+PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
+CREATE TABLE `t2` (
+`a` int(11) NOT NULL auto_increment,
+`b` int(11) default NULL,
+PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
+insert into t1 values (1,1),(2,2);
+insert into t2 values (1,1),(4,4);
+UPDATE t2,t1 SET t2.a=t1.a+2;
+ERROR 23000: Duplicate entry '3' for key 'PRIMARY'
+select * from t2 /* must be (3,1), (4,4) */;
+a b
+3 1
+4 4
+select * from t2 /* must be (3,1), (4,4) */;
+a b
+3 1
+4 4
+drop table t1,t2;
diff --git a/mysql-test/r/rpl_row_basic_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
index a6877b27b95..a6877b27b95 100644
--- a/mysql-test/r/rpl_row_basic_2myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
diff --git a/mysql-test/r/rpl_row_basic_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
index 4c6ec627db5..4c6ec627db5 100644
--- a/mysql-test/r/rpl_row_basic_3innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
diff --git a/mysql-test/r/rpl_row_basic_8partition.result b/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result
index dedd5d044e0..dedd5d044e0 100644
--- a/mysql-test/r/rpl_row_basic_8partition.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result
diff --git a/mysql-test/r/rpl_row_blob_innodb.result b/mysql-test/suite/rpl/r/rpl_row_blob_innodb.result
index 055efffbd6a..055efffbd6a 100644
--- a/mysql-test/r/rpl_row_blob_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_blob_innodb.result
diff --git a/mysql-test/r/rpl_row_blob_myisam.result b/mysql-test/suite/rpl/r/rpl_row_blob_myisam.result
index 055efffbd6a..055efffbd6a 100644
--- a/mysql-test/r/rpl_row_blob_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_row_blob_myisam.result
diff --git a/mysql-test/r/rpl_row_charset.result b/mysql-test/suite/rpl/r/rpl_row_charset.result
index e51f3e57d1f..e51f3e57d1f 100644
--- a/mysql-test/r/rpl_row_charset.result
+++ b/mysql-test/suite/rpl/r/rpl_row_charset.result
diff --git a/mysql-test/suite/rpl/r/rpl_row_colSize.result b/mysql-test/suite/rpl/r/rpl_row_colSize.result
new file mode 100644
index 00000000000..9358e36cac6
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_colSize.result
@@ -0,0 +1,754 @@
+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;
+DROP TABLE IF EXISTS t1;
+**** Testing WL#3228 changes. ****
+*** Create "wider" table on slave ***
+Checking MYSQL_TYPE_NEWDECIMAL fields
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t1 (a DECIMAL(5,2));
+CREATE TABLE t1 (a DECIMAL(20, 10));
+RESET MASTER;
+INSERT INTO t1 VALUES (901251.90125);
+START SLAVE;
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_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.
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+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.
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+0
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
+DROP TABLE IF EXISTS t1;
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t1 (a DECIMAL(27, 9));
+CREATE TABLE t1 (a DECIMAL(27, 18));
+RESET MASTER;
+INSERT INTO t1 VALUES (901251.90125);
+START SLAVE;
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_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.
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+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.
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+0
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
+DROP TABLE IF EXISTS t1;
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t1 (a NUMERIC(5,2));
+CREATE TABLE t1 (a NUMERIC(20, 10));
+RESET MASTER;
+INSERT INTO t1 VALUES (901251.90125);
+START SLAVE;
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_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.
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+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.
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+0
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
+Checking MYSQL_TYPE_FLOAT fields
+DROP TABLE IF EXISTS t1;
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t1 (a FLOAT(20));
+CREATE TABLE t1 (a FLOAT(47));
+RESET MASTER;
+INSERT INTO t1 VALUES (901251.90125);
+START SLAVE;
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 5, test.t1 has type 4
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 5, test.t1 has type 4
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+0
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
+Checking MYSQL_TYPE_BIT fields
+DROP TABLE IF EXISTS t1;
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t1 (a BIT(5));
+CREATE TABLE t1 (a BIT(64));
+RESET MASTER;
+INSERT INTO t1 VALUES (B'10101');
+START SLAVE;
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_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.
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+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.
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+0
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
+DROP TABLE IF EXISTS t1;
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t1 (a BIT(11));
+CREATE TABLE t1 (a BIT(12));
+RESET MASTER;
+INSERT INTO t1 VALUES (B'10101');
+START SLAVE;
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_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.
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+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.
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+0
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
+Checking MYSQL_TYPE_SET fields
+DROP TABLE IF EXISTS t1;
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t1 (a SET('4'));
+CREATE TABLE t1 (a SET('1','2','3','4','5','6','7','8','9'));
+RESET MASTER;
+INSERT INTO t1 VALUES ('4');
+START SLAVE;
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_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.
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+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.
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+0
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
+Checking MYSQL_TYPE_STRING fields
+DROP TABLE IF EXISTS t1;
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t1 (a CHAR(10));
+CREATE TABLE t1 (a CHAR(20));
+RESET MASTER;
+INSERT INTO t1 VALUES ('This is a test.');
+START SLAVE;
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_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.
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+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.
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+0
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
+Checking MYSQL_TYPE_ENUM fields
+DROP TABLE IF EXISTS t1;
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t1 (a ENUM('44','54'));
+CREATE TABLE t1 (a ENUM(
+'01','02','03','04','05','06','07','08','09',
+'11','12','13','14','15','16','17','18','19',
+'21','22','23','24','25','26','27','28','29',
+'31','32','33','34','35','36','37','38','39',
+'41','42','43','44','45','46','47','48','49',
+'51','52','53','54','55','56','57','58','59',
+'61','62','63','64','65','66','67','68','69',
+'71','72','73','74','75','76','77','78','79',
+'81','82','83','84','85','86','87','88','89',
+'91','92','93','94','95','96','97','98','99',
+'101','102','103','104','105','106','107','108','109',
+'111','112','113','114','115','116','117','118','119',
+'121','122','123','124','125','126','127','128','129',
+'131','132','133','134','135','136','137','138','139',
+'141','142','143','144','145','146','147','148','149',
+'151','152','153','154','155','156','157','158','159',
+'161','162','163','164','165','166','167','168','169',
+'171','172','173','174','175','176','177','178','179',
+'181','182','183','184','185','186','187','188','189',
+'191','192','193','194','195','196','197','198','199',
+'201','202','203','204','205','206','207','208','209',
+'211','212','213','214','215','216','217','218','219',
+'221','222','223','224','225','226','227','228','229',
+'231','232','233','234','235','236','237','238','239',
+'241','242','243','244','245','246','247','248','249',
+'251','252','253','254','255','256','257','258','259',
+'261','262','263','264','265','266','267','268','269',
+'271','272','273','274','275','276','277','278','279',
+'281','282','283','284','285','286','287','288','289',
+'291','292','293','294','295','296','297','298','299'
+ ));
+RESET MASTER;
+INSERT INTO t1 VALUES ('44');
+START SLAVE;
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_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.
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+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.
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+0
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
+Checking MYSQL_TYPE_VARCHAR fields
+DROP TABLE IF EXISTS t1;
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t1 (a VARCHAR(100));
+CREATE TABLE t1 (a VARCHAR(2000));
+RESET MASTER;
+INSERT INTO t1 VALUES ('This is a test.');
+START SLAVE;
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_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.
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+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.
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+0
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
+DROP TABLE IF EXISTS t1;
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t1 (a VARCHAR(10));
+CREATE TABLE t1 (a VARCHAR(200));
+RESET MASTER;
+INSERT INTO t1 VALUES ('This is a test.');
+START SLAVE;
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_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.
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+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.
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+0
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
+DROP TABLE IF EXISTS t1;
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t1 (a VARCHAR(1000));
+CREATE TABLE t1 (a VARCHAR(2000));
+RESET MASTER;
+INSERT INTO t1 VALUES ('This is a test.');
+START SLAVE;
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_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.
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+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.
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+0
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
+Checking MYSQL_TYPE_BLOB fields
+DROP TABLE IF EXISTS t1;
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t1 (a TINYBLOB);
+CREATE TABLE t1 (a LONGBLOB);
+RESET MASTER;
+INSERT INTO t1 VALUES ('This is a test.');
+START SLAVE;
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_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.
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+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.
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+0
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
+*** Cleanup ***
+DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/suite/rpl/r/rpl_row_create_table.result b/mysql-test/suite/rpl/r/rpl_row_create_table.result
new file mode 100644
index 00000000000..84c36278e1d
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_create_table.result
@@ -0,0 +1,411 @@
+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, 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 216;
+Log_name #
+Pos 216
+Event_type Query
+Server_id #
+End_log_pos 309
+Info use `test`; CREATE TABLE t1 (a INT, b INT)
+Log_name #
+Pos 309
+Event_type Query
+Server_id #
+End_log_pos 415
+Info use `test`; CREATE TABLE t2 (a INT, b INT) ENGINE=Merge
+Log_name #
+Pos 415
+Event_type Query
+Server_id #
+End_log_pos 521
+Info use `test`; CREATE TABLE t3 (a INT, b INT) CHARSET=utf8
+Log_name #
+Pos 521
+Event_type Query
+Server_id #
+End_log_pos 640
+Info use `test`; CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8
+**** On Master ****
+SHOW CREATE TABLE t1;
+Table t1
+Create Table CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=()
+SHOW CREATE TABLE t3;
+Table t3
+Create Table CREATE TABLE `t3` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8
+**** On Slave ****
+SHOW CREATE TABLE t1;
+Table t1
+Create Table CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=()
+SHOW CREATE TABLE t3;
+Table t3
+Create Table CREATE TABLE `t3` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=MEMORY DEFAULT CHARSET=utf8
+CREATE TABLE t5 (b INT, c INT) SELECT * FROM t3;
+CREATE TEMPORARY TABLE tt3 (a INT, b INT);
+INSERT INTO tt3 VALUES (1,2), (2,4), (3,6), (4,2), (5,10), (6,12);
+CREATE TABLE t6 (b INT, c INT) SELECT * FROM tt3;
+**** On Master ****
+SHOW CREATE TABLE t5;
+Table t5
+Create Table CREATE TABLE `t5` (
+ `c` int(11) DEFAULT NULL,
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t5 ORDER BY a,b,c;
+c a b
+SHOW CREATE TABLE t6;
+Table t6
+Create Table CREATE TABLE `t6` (
+ `c` int(11) DEFAULT NULL,
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t6 ORDER BY a,b,c;
+c a b
+NULL 1 2
+NULL 2 4
+NULL 3 6
+NULL 4 2
+NULL 5 10
+NULL 6 12
+**** On Slave ****
+SHOW CREATE TABLE t5;
+Table t5
+Create Table CREATE TABLE `t5` (
+ `c` int(11) DEFAULT NULL,
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+SELECT * FROM t5 ORDER BY a,b,c;
+c a b
+SHOW CREATE TABLE t6;
+Table t6
+Create Table CREATE TABLE `t6` (
+ `c` int(11) DEFAULT NULL,
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+SELECT * FROM t6 ORDER BY a,b,c;
+c a b
+NULL 1 2
+NULL 2 4
+NULL 3 6
+NULL 4 2
+NULL 5 10
+NULL 6 12
+CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3;
+ERROR 23000: Duplicate entry '2' for key 'b'
+SHOW BINLOG EVENTS FROM 1100;
+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;
+ERROR 23000: Duplicate entry '2' for key 'b'
+SELECT * FROM t7 ORDER BY a,b;
+a b
+1 2
+2 4
+3 6
+SHOW BINLOG EVENTS FROM 1100;
+Log_name Pos Event_type Server_id End_log_pos Info
+# 1100 Query # 1200 use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE)
+# 1200 Table_map # 1242 table_id: # (test.t7)
+# 1242 Write_rows # 1298 table_id: # flags: STMT_END_F
+SELECT * FROM t7 ORDER BY a,b;
+a b
+1 2
+2 4
+3 6
+CREATE TEMPORARY TABLE tt4 (a INT, b INT);
+INSERT INTO tt4 VALUES (4,8), (5,10), (6,12);
+BEGIN;
+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 1298;
+Log_name Pos Event_type Server_id End_log_pos Info
+# 1298 Table_map # 1340 table_id: # (test.t7)
+# 1340 Write_rows # 1396 table_id: # flags: STMT_END_F
+SELECT * FROM t7 ORDER BY a,b;
+a b
+1 2
+2 4
+3 6
+4 8
+5 10
+6 12
+SELECT * FROM t7 ORDER BY a,b;
+a b
+1 2
+2 4
+3 6
+4 8
+5 10
+6 12
+CREATE TABLE t8 LIKE t4;
+CREATE TABLE t9 LIKE tt4;
+CREATE TEMPORARY TABLE tt5 LIKE t4;
+CREATE TEMPORARY TABLE tt6 LIKE tt4;
+CREATE TEMPORARY TABLE tt7 SELECT 1;
+**** On Master ****
+SHOW CREATE TABLE t8;
+Table t8
+Create Table CREATE TABLE `t8` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=MRG_MyISAM DEFAULT CHARSET=utf8 UNION=()
+SHOW CREATE TABLE t9;
+Table t9
+Create Table CREATE TABLE `t9` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SHOW BINLOG EVENTS FROM 1396;
+Log_name Pos Event_type Server_id End_log_pos Info
+# 1396 Query # 1482 use `test`; CREATE TABLE t8 LIKE t4
+# 1482 Query # 1621 use `test`; CREATE TABLE `t9` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+)
+**** On Slave ****
+SHOW CREATE TABLE t8;
+Table t8
+Create Table CREATE TABLE `t8` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=MRG_MyISAM DEFAULT CHARSET=utf8 UNION=()
+SHOW CREATE TABLE t9;
+Table t9
+Create Table CREATE TABLE `t9` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
+STOP SLAVE;
+SET GLOBAL storage_engine=@storage_engine;
+START SLAVE;
+================ BUG#22864 ================
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
+SET AUTOCOMMIT=0;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+CREATE TABLE t2 ENGINE=INNODB SELECT * FROM t1;
+ROLLBACK;
+CREATE TABLE t3 ENGINE=INNODB SELECT * FROM t1;
+INSERT INTO t3 VALUES (4),(5),(6);
+ROLLBACK;
+CREATE TABLE t4 ENGINE=INNODB SELECT * FROM t1;
+INSERT INTO t1 VALUES (4),(5),(6);
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+SHOW TABLES;
+Tables_in_test
+t1
+t2
+t3
+t4
+SELECT TABLE_NAME,ENGINE
+FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME LIKE 't_'
+ORDER BY TABLE_NAME;
+TABLE_NAME ENGINE
+t1 MyISAM
+t2 InnoDB
+t3 InnoDB
+t4 InnoDB
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+5
+6
+SELECT * FROM t2 ORDER BY a;
+a
+1
+2
+3
+SELECT * FROM t3 ORDER BY a;
+a
+1
+2
+3
+SELECT * FROM t4 ORDER BY a;
+a
+1
+2
+3
+SHOW BINLOG EVENTS;
+Log_name Pos Event_type Server_id End_log_pos Info
+# 4 Format_desc # 106 Server ver: #, Binlog ver: #
+# 106 Query # 192 use `test`; CREATE TABLE t1 (a INT)
+# 192 Table_map # 233 table_id: # (test.t1)
+# 233 Write_rows # 277 table_id: # flags: STMT_END_F
+# 277 Query # 345 use `test`; BEGIN
+# 345 Query # 470 use `test`; CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB
+# 470 Table_map # 511 table_id: # (test.t2)
+# 511 Write_rows # 555 table_id: # flags: STMT_END_F
+# 555 Xid # 582 COMMIT /* XID */
+# 582 Query # 650 use `test`; BEGIN
+# 650 Query # 775 use `test`; CREATE TABLE `t3` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB
+# 775 Table_map # 816 table_id: # (test.t3)
+# 816 Write_rows # 860 table_id: # flags: STMT_END_F
+# 860 Xid # 887 COMMIT /* XID */
+# 887 Query # 955 use `test`; BEGIN
+# 955 Query # 1080 use `test`; CREATE TABLE `t4` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB
+# 1080 Table_map # 1121 table_id: # (test.t4)
+# 1121 Write_rows # 1165 table_id: # flags: STMT_END_F
+# 1165 Xid # 1192 COMMIT /* XID */
+# 1192 Table_map # 1233 table_id: # (test.t1)
+# 1233 Write_rows # 1277 table_id: # flags: STMT_END_F
+SHOW TABLES;
+Tables_in_test
+t1
+t2
+t3
+t4
+SELECT TABLE_NAME,ENGINE
+FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME LIKE 't_'
+ORDER BY TABLE_NAME;
+TABLE_NAME ENGINE
+t1 MyISAM
+t2 InnoDB
+t3 InnoDB
+t4 InnoDB
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+4
+5
+6
+SELECT * FROM t2 ORDER BY a;
+a
+1
+2
+3
+SELECT * FROM t3 ORDER BY a;
+a
+1
+2
+3
+SELECT * FROM t4 ORDER BY a;
+a
+1
+2
+3
+DROP TABLE IF EXISTS t1,t2,t3,t4;
+SET AUTOCOMMIT=1;
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+CREATE TABLE t2 (a INT) ENGINE=INNODB;
+BEGIN;
+INSERT INTO t2 SELECT a*a FROM t1;
+CREATE TEMPORARY TABLE tt1
+SELECT a+1 AS a
+FROM t1
+WHERE a MOD 2 = 1;
+INSERT INTO t2 SELECT a+2 FROM tt1;
+COMMIT;
+SELECT * FROM t2 ORDER BY a;
+a
+1
+4
+4
+6
+9
+SHOW BINLOG EVENTS;
+Log_name Pos Event_type Server_id End_log_pos Info
+# 4 Format_desc # 106 Server ver: #, Binlog ver: #
+# 106 Query # 192 use `test`; CREATE TABLE t1 (a INT)
+# 192 Table_map # 233 table_id: # (test.t1)
+# 233 Write_rows # 277 table_id: # flags: STMT_END_F
+# 277 Query # 377 use `test`; CREATE TABLE t2 (a INT) ENGINE=INNODB
+# 377 Query # 445 use `test`; BEGIN
+# 445 Table_map # 486 table_id: # (test.t2)
+# 486 Write_rows # 530 table_id: # flags: STMT_END_F
+# 530 Table_map # 571 table_id: # (test.t2)
+# 571 Write_rows # 610 table_id: # flags: STMT_END_F
+# 610 Xid # 637 COMMIT /* XID */
+SELECT * FROM t2 ORDER BY a;
+a
+1
+4
+4
+6
+9
+TRUNCATE TABLE t2;
+BEGIN;
+INSERT INTO t2 SELECT a*a FROM t1;
+CREATE TEMPORARY TABLE tt2
+SELECT a+1 AS a
+FROM t1
+WHERE a MOD 2 = 1;
+INSERT INTO t2 SELECT a+2 FROM tt2;
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+SELECT * FROM t2 ORDER BY a;
+a
+SHOW BINLOG EVENTS FROM 637;
+Log_name Pos Event_type Server_id End_log_pos Info
+# 637 Query # 717 use `test`; TRUNCATE TABLE t2
+# 717 Xid # 744 COMMIT /* XID */
+# 744 Query # 812 use `test`; BEGIN
+# 812 Table_map # 853 table_id: # (test.t2)
+# 853 Write_rows # 897 table_id: # flags: STMT_END_F
+# 897 Table_map # 938 table_id: # (test.t2)
+# 938 Write_rows # 977 table_id: # flags: STMT_END_F
+# 977 Query # 1048 use `test`; ROLLBACK
+SELECT * FROM t2 ORDER BY a;
+a
+DROP TABLE t1,t2;
diff --git a/mysql-test/r/rpl_row_delayed_ins.result b/mysql-test/suite/rpl/r/rpl_row_delayed_ins.result
index 800a39bd567..800a39bd567 100644
--- a/mysql-test/r/rpl_row_delayed_ins.result
+++ b/mysql-test/suite/rpl/r/rpl_row_delayed_ins.result
diff --git a/mysql-test/r/rpl_row_drop.result b/mysql-test/suite/rpl/r/rpl_row_drop.result
index 89654ebf165..89654ebf165 100644
--- a/mysql-test/r/rpl_row_drop.result
+++ b/mysql-test/suite/rpl/r/rpl_row_drop.result
diff --git a/mysql-test/r/rpl_row_err_ignoredtable.result b/mysql-test/suite/rpl/r/rpl_row_err_ignoredtable.result
index b696baa57db..b696baa57db 100644
--- a/mysql-test/r/rpl_row_err_ignoredtable.result
+++ b/mysql-test/suite/rpl/r/rpl_row_err_ignoredtable.result
diff --git a/mysql-test/suite/rpl/r/rpl_row_extraColmaster_ndb.result b/mysql-test/suite/rpl/r/rpl_row_extraColmaster_ndb.result
new file mode 100644
index 00000000000..0b1f2e6c8bf
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_extraColmaster_ndb.result
Binary files differ
diff --git a/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result b/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result
new file mode 100644
index 00000000000..072f15cbbd3
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result
@@ -0,0 +1,33 @@
+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 (10);
+create table t2 (a int);
+create table t3 (a int) engine=merge union(t1);
+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 623 ;
+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 623 ;
+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
+select * from t3;
+a
+stop slave;
+drop table t1;
+flush tables with read lock;
+start slave;
+stop slave;
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
+drop table t3, t4, t5;
diff --git a/mysql-test/r/rpl_row_func001.result b/mysql-test/suite/rpl/r/rpl_row_func001.result
index b20f3f724d0..b20f3f724d0 100644
--- a/mysql-test/r/rpl_row_func001.result
+++ b/mysql-test/suite/rpl/r/rpl_row_func001.result
diff --git a/mysql-test/r/rpl_row_func002.result b/mysql-test/suite/rpl/r/rpl_row_func002.result
index 03f5b3115c3..03f5b3115c3 100644
--- a/mysql-test/r/rpl_row_func002.result
+++ b/mysql-test/suite/rpl/r/rpl_row_func002.result
diff --git a/mysql-test/r/rpl_row_func003.result b/mysql-test/suite/rpl/r/rpl_row_func003.result
index a5fd46a2ce3..a5fd46a2ce3 100644
--- a/mysql-test/r/rpl_row_func003.result
+++ b/mysql-test/suite/rpl/r/rpl_row_func003.result
diff --git a/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result b/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result
new file mode 100644
index 00000000000..70e923bc4f4
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result
@@ -0,0 +1,59 @@
+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 not null primary key);
+insert into t1 values (1);
+create table t2 (a int);
+insert into t2 values (1);
+update t1, t2 set t1.a = 0 where t1.a = t2.a;
+show tables;
+Tables_in_test
+t1
+select * from t1;
+a
+0
+drop table t1;
+insert into t1 values (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 605
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1146
+Last_Error Error 'Table 'test.t1' doesn't exist' on opening table `test`.`t1`
+Skip_Counter 0
+Exec_Master_Log_Pos 530
+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 1146
+Last_SQL_Error Error 'Table 'test.t1' doesn't exist' on opening table `test`.`t1`
+drop table t1, t2;
diff --git a/mysql-test/suite/rpl/r/rpl_row_insert_delayed.result b/mysql-test/suite/rpl/r/rpl_row_insert_delayed.result
new file mode 100644
index 00000000000..1551d83266d
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_insert_delayed.result
@@ -0,0 +1,62 @@
+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;
+set @old_global_binlog_format = @@global.binlog_format;
+set @@global.binlog_format = row;
+CREATE SCHEMA IF NOT EXISTS mysqlslap;
+USE mysqlslap;
+select @@global.binlog_format;
+@@global.binlog_format
+ROW
+CREATE TABLE t1 (id INT primary key auto_increment, name VARCHAR(64));
+FLUSH TABLE t1;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+5000
+use mysqlslap;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+5000
+truncate table t1;
+insert delayed into t1 values(10, "my name");
+insert delayed into t1 values(10, "is Bond"), (20, "James Bond");
+flush table t1;
+select * from t1;
+id name
+10 my name
+20 James Bond
+select * from t1;
+id name
+10 my name
+20 James Bond
+delete from t1 where id!=10;
+insert delayed into t1 values(20, "is Bond"), (10, "James Bond");
+flush table t1;
+select * from t1;
+id name
+10 my name
+20 is Bond
+select * from t1;
+id name
+10 my name
+20 is Bond
+USE test;
+DROP SCHEMA mysqlslap;
+use test;
+CREATE TABLE t1(a int, UNIQUE(a));
+INSERT DELAYED IGNORE INTO t1 VALUES(1);
+INSERT DELAYED IGNORE INTO t1 VALUES(1);
+flush table t1;
+select * from t1;
+a
+1
+On slave
+select * from t1;
+a
+1
+drop table t1;
+End of 5.0 tests
+set @@global.binlog_format = @old_global_binlog_format;
diff --git a/mysql-test/r/rpl_row_loaddata_m.result b/mysql-test/suite/rpl/r/rpl_row_loaddata_m.result
index 149efddaf8d..149efddaf8d 100644
--- a/mysql-test/r/rpl_row_loaddata_m.result
+++ b/mysql-test/suite/rpl/r/rpl_row_loaddata_m.result
diff --git a/mysql-test/suite/rpl/r/rpl_row_log.result b/mysql-test/suite/rpl/r/rpl_row_log.result
new file mode 100644
index 00000000000..33a6c3b9781
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_log.result
@@ -0,0 +1,294 @@
+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;
+reset master;
+reset slave;
+reset master;
+create table t1(n int not null auto_increment primary key)ENGINE=MyISAM;
+insert into t1 values (NULL);
+drop table t1;
+create table t1 (word char(20) not null)ENGINE=MyISAM;
+load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines;
+select count(*) from t1;
+count(*)
+69
+show binlog events;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
+master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM
+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 # 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 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+show binlog events from 106 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;
+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 # Table_map 1 # table_id: # (test.t1)
+show binlog events from 106 limit 2,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+flush logs;
+create table t3 (a int)ENGINE=MyISAM;
+select * from t1 order by 1 asc;
+word
+Aarhus
+Aaron
+Aaron
+Ababa
+Ababa
+aback
+aback
+abaft
+abaft
+abandon
+abandon
+abandoned
+abandoned
+abandoning
+abandoning
+abandonment
+abandonment
+abandons
+abandons
+abase
+abased
+abasement
+abasements
+abases
+abash
+abashed
+abashes
+abashing
+abasing
+abate
+abated
+abatement
+abatements
+abater
+abates
+abating
+Abba
+abbe
+abbey
+abbeys
+abbot
+abbots
+Abbott
+abbreviate
+abbreviated
+abbreviates
+abbreviating
+abbreviation
+abbreviations
+Abby
+abdomen
+abdomens
+abdominal
+abduct
+abducted
+abduction
+abductions
+abductor
+abductors
+abducts
+Abe
+abed
+Abel
+Abelian
+Abelson
+Aberdeen
+Abernathy
+aberrant
+aberration
+start slave;
+
+let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%' ;
+
+--source include/wait_slave_status.inc
+select * from t1 order by 1 asc;
+word
+Aarhus
+Aaron
+Aaron
+Ababa
+Ababa
+aback
+aback
+abaft
+abaft
+abandon
+abandon
+abandoned
+abandoned
+abandoning
+abandoning
+abandonment
+abandonment
+abandons
+abandons
+abase
+abased
+abasement
+abasements
+abases
+abash
+abashed
+abashes
+abashing
+abasing
+abate
+abated
+abatement
+abatements
+abater
+abates
+abating
+Abba
+abbe
+abbey
+abbeys
+abbot
+abbots
+Abbott
+abbreviate
+abbreviated
+abbreviates
+abbreviating
+abbreviation
+abbreviations
+Abby
+abdomen
+abdomens
+abdominal
+abduct
+abducted
+abduction
+abductions
+abductor
+abductors
+abducts
+Abe
+abed
+Abel
+Abelian
+Abelson
+Aberdeen
+Abernathy
+aberrant
+aberration
+flush logs;
+stop slave;
+create table t2 (n int)ENGINE=MyISAM;
+insert into t2 values (1);
+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(n int not null auto_increment primary key)ENGINE=MyISAM
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `test`; drop table t1
+master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Rotate # # master-bin.000002;pos=4
+show binlog events in 'master-bin.000002';
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
+master-bin.000002 # Query 1 # use `test`; create table t3 (a int)ENGINE=MyISAM
+master-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM
+master-bin.000002 # Table_map 1 # table_id: # (test.t2)
+master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
+show binary logs;
+Log_name File_size
+master-bin.000001 1266
+master-bin.000002 379
+start slave;
+show binary logs;
+Log_name File_size
+slave-bin.000001 1364
+slave-bin.000002 280
+show binlog events in 'slave-bin.000001' from 4;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
+slave-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM
+slave-bin.000001 # Table_map 1 # table_id: # (test.t1)
+slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query 1 # use `test`; drop table t1
+slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
+slave-bin.000001 # Table_map 1 # table_id: # (test.t1)
+slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query 1 # use `test`; create table t3 (a int)ENGINE=MyISAM
+slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4
+show binlog events in 'slave-bin.000002' from 4;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
+slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM
+slave-bin.000002 # Table_map 1 # table_id: # (test.t2)
+slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
+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.000002
+Read_Master_Log_Pos 379
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000002
+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 379
+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
+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;
+DROP TABLE t2;
+DROP TABLE t3;
+create table t1(a int auto_increment primary key, b int);
+insert into t1 values (NULL, 1);
+reset master;
+set insert_id=5;
+insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+select * from t1;
+a b
+1 1
+5 1
+6 1
+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
new file mode 100644
index 00000000000..9ed35f34dc5
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result
@@ -0,0 +1,302 @@
+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;
+reset master;
+reset slave;
+reset master;
+create table t1(n int not null auto_increment primary key)ENGINE=InnoDB;
+insert into t1 values (NULL);
+drop table t1;
+create table t1 (word char(20) not null)ENGINE=InnoDB;
+load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines;
+select count(*) from t1;
+count(*)
+69
+show binlog events;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
+master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB
+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 # Query 1 # use `test`; drop table t1
+master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=InnoDB
+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;
+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;
+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 # Table_map 1 # table_id: # (test.t1)
+show binlog events from 106 limit 2,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+flush logs;
+create table t3 (a int)ENGINE=InnoDB;
+select * from t1 order by 1 asc;
+word
+Aarhus
+Aaron
+Aaron
+Ababa
+Ababa
+aback
+aback
+abaft
+abaft
+abandon
+abandon
+abandoned
+abandoned
+abandoning
+abandoning
+abandonment
+abandonment
+abandons
+abandons
+abase
+abased
+abasement
+abasements
+abases
+abash
+abashed
+abashes
+abashing
+abasing
+abate
+abated
+abatement
+abatements
+abater
+abates
+abating
+Abba
+abbe
+abbey
+abbeys
+abbot
+abbots
+Abbott
+abbreviate
+abbreviated
+abbreviates
+abbreviating
+abbreviation
+abbreviations
+Abby
+abdomen
+abdomens
+abdominal
+abduct
+abducted
+abduction
+abductions
+abductor
+abductors
+abducts
+Abe
+abed
+Abel
+Abelian
+Abelson
+Aberdeen
+Abernathy
+aberrant
+aberration
+start slave;
+
+let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%' ;
+
+--source include/wait_slave_status.inc
+select * from t1 order by 1 asc;
+word
+Aarhus
+Aaron
+Aaron
+Ababa
+Ababa
+aback
+aback
+abaft
+abaft
+abandon
+abandon
+abandoned
+abandoned
+abandoning
+abandoning
+abandonment
+abandonment
+abandons
+abandons
+abase
+abased
+abasement
+abasements
+abases
+abash
+abashed
+abashes
+abashing
+abasing
+abate
+abated
+abatement
+abatements
+abater
+abates
+abating
+Abba
+abbe
+abbey
+abbeys
+abbot
+abbots
+Abbott
+abbreviate
+abbreviated
+abbreviates
+abbreviating
+abbreviation
+abbreviations
+Abby
+abdomen
+abdomens
+abdominal
+abduct
+abducted
+abduction
+abductions
+abductor
+abductors
+abducts
+Abe
+abed
+Abel
+Abelian
+Abelson
+Aberdeen
+Abernathy
+aberrant
+aberration
+flush logs;
+stop slave;
+create table t2 (n int)ENGINE=InnoDB;
+insert into t2 values (1);
+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(n int not null auto_increment primary key)ENGINE=InnoDB
+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 # # use `test`; drop table t1
+master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=InnoDB
+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 # Rotate # # master-bin.000002;pos=4
+show binlog events in 'master-bin.000002';
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
+master-bin.000002 # Query 1 # use `test`; create table t3 (a int)ENGINE=InnoDB
+master-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=InnoDB
+master-bin.000002 # Table_map 1 # table_id: # (test.t2)
+master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000002 # Xid 1 # COMMIT /* XID */
+show binary logs;
+Log_name File_size
+master-bin.000001 1320
+master-bin.000002 406
+start slave;
+show binary logs;
+Log_name File_size
+slave-bin.000001 1418
+slave-bin.000002 307
+show binlog events in 'slave-bin.000001' from 4;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
+slave-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB
+slave-bin.000001 # Table_map 1 # table_id: # (test.t1)
+slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+slave-bin.000001 # Xid 1 # COMMIT /* XID */
+slave-bin.000001 # Query 1 # use `test`; drop table t1
+slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=InnoDB
+slave-bin.000001 # Table_map 1 # table_id: # (test.t1)
+slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+slave-bin.000001 # Xid 1 # COMMIT /* XID */
+slave-bin.000001 # Query 1 # use `test`; create table t3 (a int)ENGINE=InnoDB
+slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4
+show binlog events in 'slave-bin.000002' from 4;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
+slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=InnoDB
+slave-bin.000002 # Table_map 1 # table_id: # (test.t2)
+slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
+slave-bin.000002 # Xid 1 # COMMIT /* XID */
+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.000002
+Read_Master_Log_Pos 406
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000002
+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 406
+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
+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;
+DROP TABLE t2;
+DROP TABLE t3;
+create table t1(a int auto_increment primary key, b int);
+insert into t1 values (NULL, 1);
+reset master;
+set insert_id=5;
+insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+select * from t1;
+a b
+1 1
+5 1
+6 1
+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
new file mode 100644
index 00000000000..06266f1de82
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result
@@ -0,0 +1,305 @@
+SET SESSION BINLOG_FORMAT=ROW;
+SET GLOBAL BINLOG_FORMAT=ROW;
+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;
+#
+# Generate a big enough master's binlog to cause relay log rotations
+#
+create table t1 (a int);
+drop table t1;
+reset slave;
+#
+# Test 1
+#
+set @my_max_binlog_size= @@global.max_binlog_size;
+set global max_binlog_size=8192;
+set global max_relay_log_size=8192-1;
+select @@global.max_relay_log_size;
+@@global.max_relay_log_size
+4096
+start slave;
+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 60268
+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 60268
+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
+#
+# Test 2
+#
+stop slave;
+reset slave;
+set global max_relay_log_size=(5*4096);
+select @@global.max_relay_log_size;
+@@global.max_relay_log_size 20480
+start slave;
+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 60268
+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 60268
+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
+#
+# Test 3: max_relay_log_size = 0
+#
+stop slave;
+reset slave;
+set global max_relay_log_size=0;
+select @@global.max_relay_log_size;
+@@global.max_relay_log_size 0
+start slave;
+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 60268
+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 60268
+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
+#
+# Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
+#
+stop slave;
+reset slave;
+flush logs;
+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 #
+Last_IO_Error #
+Last_SQL_Errno 0
+Last_SQL_Error
+#
+# Test 5
+#
+reset slave;
+start slave;
+flush logs;
+create table t1 (a 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 60354
+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 60354
+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
+#
+# Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
+#
+flush logs;
+drop table t1;
+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 60430
+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 60430
+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
+flush logs;
+show master status;
+File master-bin.000002
+Position 106
+Binlog_Do_DB <Binlog_Ignore_DB>
+Binlog_Ignore_DB
+set global max_binlog_size= @my_max_binlog_size;
+#
+# End of 4.1 tests
+#
diff --git a/mysql-test/r/rpl_row_multi_query.result b/mysql-test/suite/rpl/r/rpl_row_multi_query.result
index 8cb1aec522b..8cb1aec522b 100644
--- a/mysql-test/r/rpl_row_multi_query.result
+++ b/mysql-test/suite/rpl/r/rpl_row_multi_query.result
diff --git a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
new file mode 100644
index 00000000000..e2df1459ac0
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
@@ -0,0 +1,352 @@
+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 Section --
+set timestamp=1000000000;
+DROP TABLE IF EXISTS t1,t2,t3;
+CREATE TABLE t1(word VARCHAR(20));
+CREATE TABLE t2(id INT AUTO_INCREMENT NOT NULL PRIMARY KEY);
+CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT);
+
+---Test1 check table load --
+SELECT COUNT(*) from t1;
+COUNT(*)
+351
+SELECT COUNT(*) from t2;
+COUNT(*)
+500
+SELECT COUNT(*) from t3;
+COUNT(*)
+500
+SELECT * FROM t1 ORDER BY word LIMIT 5;
+word
+Aarhus
+Aarhus
+Aarhus
+Aarhus
+Aarhus
+SELECT * FROM t2 ORDER BY id LIMIT 5;
+id
+1
+2
+3
+4
+5
+SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5;
+c1 c3 c4 c5
+1 2006-02-22 00:00:00 Tested in Texas 2.2
+2 2006-02-22 00:00:00 Tested in Texas 4.4
+3 2006-02-22 00:00:00 Tested in Texas 6.6
+4 2006-02-22 00:00:00 Tested in Texas 8.8
+5 2006-02-22 00:00:00 Tested in Texas 11
+SELECT COUNT(*) from t1;
+COUNT(*)
+351
+SELECT COUNT(*) from t2;
+COUNT(*)
+500
+SELECT COUNT(*) from t3;
+COUNT(*)
+500
+SELECT * FROM t1 ORDER BY word LIMIT 5;
+word
+Aarhus
+Aarhus
+Aarhus
+Aarhus
+Aarhus
+SELECT * FROM t2 ORDER BY id LIMIT 5;
+id
+1
+2
+3
+4
+5
+SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5;
+c1 c3 c4 c5
+1 2006-02-22 00:00:00 Tested in Texas 2.2
+2 2006-02-22 00:00:00 Tested in Texas 4.4
+3 2006-02-22 00:00:00 Tested in Texas 6.6
+4 2006-02-22 00:00:00 Tested in Texas 8.8
+5 2006-02-22 00:00:00 Tested in Texas 11
+insert into t1 values ("Alas");
+flush logs;
+
+--- Test 1 Dump binlog to file --
+
+--- Test 1 delete tables, clean master and slave --
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+stop slave;
+reset master;
+reset slave;
+start slave;
+
+--- Test 1 Load from Dump binlog file --
+
+--- Test 1 Check Load Results --
+SELECT COUNT(*) from t1;
+COUNT(*)
+352
+SELECT COUNT(*) from t2;
+COUNT(*)
+500
+SELECT COUNT(*) from t3;
+COUNT(*)
+500
+SELECT * FROM t1 ORDER BY word LIMIT 5;
+word
+Aarhus
+Aarhus
+Aarhus
+Aarhus
+Aarhus
+SELECT * FROM t2 ORDER BY id LIMIT 5;
+id
+1
+2
+3
+4
+5
+SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5;
+c1 c3 c4 c5
+1 2006-02-22 00:00:00 Tested in Texas 2.2
+2 2006-02-22 00:00:00 Tested in Texas 4.4
+3 2006-02-22 00:00:00 Tested in Texas 6.6
+4 2006-02-22 00:00:00 Tested in Texas 8.8
+5 2006-02-22 00:00:00 Tested in Texas 11
+SELECT COUNT(*) from t1;
+COUNT(*)
+352
+SELECT COUNT(*) from t2;
+COUNT(*)
+500
+SELECT COUNT(*) from t3;
+COUNT(*)
+500
+SELECT * FROM t1 ORDER BY word LIMIT 5;
+word
+Aarhus
+Aarhus
+Aarhus
+Aarhus
+Aarhus
+SELECT * FROM t2 ORDER BY id LIMIT 5;
+id
+1
+2
+3
+4
+5
+SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5;
+c1 c3 c4 c5
+1 2006-02-22 00:00:00 Tested in Texas 2.2
+2 2006-02-22 00:00:00 Tested in Texas 4.4
+3 2006-02-22 00:00:00 Tested in Texas 6.6
+4 2006-02-22 00:00:00 Tested in Texas 8.8
+5 2006-02-22 00:00:00 Tested in Texas 11
+
+--- Test 2 position test --
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+use test/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.sql_mode=0/*!*/;
+/*!\C latin1 *//*!*/;
+SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
+CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT)/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+
+--- Test 3 First Remote test --
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+ROLLBACK/*!*/;
+use test/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.sql_mode=0/*!*/;
+/*!\C latin1 *//*!*/;
+SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
+DROP TABLE IF EXISTS t1,t2,t3/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+CREATE TABLE t1(word VARCHAR(20))/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+CREATE TABLE t2(id INT AUTO_INCREMENT NOT NULL PRIMARY KEY)/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT)/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+
+--- Test 4 Second Remote test --
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+stop slave;
+reset master;
+reset slave;
+start slave;
+SELECT COUNT(*) from t1;
+COUNT(*)
+352
+SELECT COUNT(*) from t2;
+COUNT(*)
+500
+SELECT COUNT(*) from t3;
+COUNT(*)
+500
+SELECT * FROM t1 ORDER BY word LIMIT 5;
+word
+Aarhus
+Aarhus
+Aarhus
+Aarhus
+Aarhus
+SELECT * FROM t2 ORDER BY id LIMIT 5;
+id
+1
+2
+3
+4
+5
+SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5;
+c1 c3 c4 c5
+1 2006-02-22 00:00:00 Tested in Texas 2.2
+2 2006-02-22 00:00:00 Tested in Texas 4.4
+3 2006-02-22 00:00:00 Tested in Texas 6.6
+4 2006-02-22 00:00:00 Tested in Texas 8.8
+5 2006-02-22 00:00:00 Tested in Texas 11
+SELECT COUNT(*) from t1;
+COUNT(*)
+352
+SELECT COUNT(*) from t2;
+COUNT(*)
+500
+SELECT COUNT(*) from t3;
+COUNT(*)
+500
+SELECT * FROM t1 ORDER BY word LIMIT 5;
+word
+Aarhus
+Aarhus
+Aarhus
+Aarhus
+Aarhus
+SELECT * FROM t2 ORDER BY id LIMIT 5;
+id
+1
+2
+3
+4
+5
+SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5;
+c1 c3 c4 c5
+1 2006-02-22 00:00:00 Tested in Texas 2.2
+2 2006-02-22 00:00:00 Tested in Texas 4.4
+3 2006-02-22 00:00:00 Tested in Texas 6.6
+4 2006-02-22 00:00:00 Tested in Texas 8.8
+5 2006-02-22 00:00:00 Tested in Texas 11
+
+--- Test 5 LOAD DATA --
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+
+--- Test 6 reading stdin --
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+ROLLBACK/*!*/;
+use test/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.sql_mode=0/*!*/;
+/*!\C latin1 *//*!*/;
+SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
+DROP TABLE IF EXISTS t1,t2,t3/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+CREATE TABLE t1(word VARCHAR(20))/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+CREATE TABLE t2(id INT AUTO_INCREMENT NOT NULL PRIMARY KEY)/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT)/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+
+--- Test 7 reading stdin w/position --
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+use test/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.sql_mode=0/*!*/;
+/*!\C latin1 *//*!*/;
+SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
+CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT)/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+
+--- Test 8 switch internal charset --
+stop slave;
+reset master;
+reset slave;
+start slave;
+create table t4 (f text character set utf8);
+create table t5 (f text character set cp932);
+flush logs;
+rename table t4 to t04, t5 to t05;
+select HEX(f) from t04;
+HEX(f)
+E382BD
+select HEX(f) from t4;
+HEX(f)
+E382BD
+select HEX(f) from t05;
+HEX(f)
+835C
+select HEX(f) from t5;
+HEX(f)
+835C
+select HEX(f) from t04;
+HEX(f)
+E382BD
+select HEX(f) from t4;
+HEX(f)
+E382BD
+select HEX(f) from t05;
+HEX(f)
+835C
+select HEX(f) from t5;
+HEX(f)
+835C
+
+--- Test cleanup --
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT NOT NULL KEY, b INT);
+INSERT INTO t1 VALUES(1,1);
+SELECT * FROM t1;
+a b
+1 1
+FLUSH LOGS;
+DROP TABLE IF EXISTS t1, t2, t3, t04, t05, t4, t5;
diff --git a/mysql-test/r/rpl_row_mystery22.result b/mysql-test/suite/rpl/r/rpl_row_mystery22.result
index bcf65e4ede3..bcf65e4ede3 100644
--- a/mysql-test/r/rpl_row_mystery22.result
+++ b/mysql-test/suite/rpl/r/rpl_row_mystery22.result
diff --git a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result
new file mode 100644
index 00000000000..fd23e254072
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result
@@ -0,0 +1,176 @@
+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;
+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 106
+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 106
+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
+stop slave;
+change master to master_user='test';
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User test
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos 106
+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 106
+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
+reset slave;
+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 #
+Last_IO_Error #
+Last_SQL_Errno 0
+Last_SQL_Error
+start slave;
+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 106
+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 106
+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
+stop slave;
+reset slave;
+start slave;
+create temporary table t1 (a int);
+stop slave;
+reset slave;
+start slave;
+show status like 'slave_open_temp_tables';
+Variable_name Value
+Slave_open_temp_tables 0
diff --git a/mysql-test/r/rpl_row_sp001.result b/mysql-test/suite/rpl/r/rpl_row_sp001.result
index 8c26c061376..8c26c061376 100644
--- a/mysql-test/r/rpl_row_sp001.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp001.result
diff --git a/mysql-test/r/rpl_row_sp002_innodb.result b/mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result
index a42c9af988c..a42c9af988c 100644
--- a/mysql-test/r/rpl_row_sp002_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result
diff --git a/mysql-test/r/rpl_row_sp003.result b/mysql-test/suite/rpl/r/rpl_row_sp003.result
index df3e2a7ceed..df3e2a7ceed 100644
--- a/mysql-test/r/rpl_row_sp003.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp003.result
diff --git a/mysql-test/r/rpl_row_sp005.result b/mysql-test/suite/rpl/r/rpl_row_sp005.result
index 01e1970e0df..01e1970e0df 100644
--- a/mysql-test/r/rpl_row_sp005.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp005.result
diff --git a/mysql-test/r/rpl_row_sp006_InnoDB.result b/mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result
index 8339e77d3a0..8339e77d3a0 100644
--- a/mysql-test/r/rpl_row_sp006_InnoDB.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result
diff --git a/mysql-test/r/rpl_row_sp007_innodb.result b/mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result
index 9a2822835f8..9a2822835f8 100644
--- a/mysql-test/r/rpl_row_sp007_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result
diff --git a/mysql-test/r/rpl_row_sp008.result b/mysql-test/suite/rpl/r/rpl_row_sp008.result
index 23197964a24..23197964a24 100644
--- a/mysql-test/r/rpl_row_sp008.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp008.result
diff --git a/mysql-test/r/rpl_row_sp009.result b/mysql-test/suite/rpl/r/rpl_row_sp009.result
index 35ce0d7b420..35ce0d7b420 100644
--- a/mysql-test/r/rpl_row_sp009.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp009.result
diff --git a/mysql-test/r/rpl_row_sp010.result b/mysql-test/suite/rpl/r/rpl_row_sp010.result
index 02567465428..02567465428 100644
--- a/mysql-test/r/rpl_row_sp010.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp010.result
diff --git a/mysql-test/r/rpl_row_sp011.result b/mysql-test/suite/rpl/r/rpl_row_sp011.result
index e35c9f21adb..e35c9f21adb 100644
--- a/mysql-test/r/rpl_row_sp011.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp011.result
diff --git a/mysql-test/r/rpl_row_sp012.result b/mysql-test/suite/rpl/r/rpl_row_sp012.result
index b9c818bad9a..b9c818bad9a 100644
--- a/mysql-test/r/rpl_row_sp012.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp012.result
diff --git a/mysql-test/r/rpl_row_stop_middle.result b/mysql-test/suite/rpl/r/rpl_row_stop_middle.result
index 46ca5748174..46ca5748174 100644
--- a/mysql-test/r/rpl_row_stop_middle.result
+++ b/mysql-test/suite/rpl/r/rpl_row_stop_middle.result
diff --git a/mysql-test/r/rpl_row_stop_middle_update.result b/mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result
index 0fd4ff86893..0fd4ff86893 100644
--- a/mysql-test/r/rpl_row_stop_middle_update.result
+++ b/mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result
diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
new file mode 100644
index 00000000000..566537ab745
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
@@ -0,0 +1,419 @@
+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;
+SET @my_sql_mode= @@global.sql_mode;
+SET GLOBAL SQL_MODE='STRICT_ALL_TABLES';
+START SLAVE;
+CREATE TABLE t1_int (a INT PRIMARY KEY, b INT) ENGINE='MyISAM';
+CREATE TABLE t1_bit (a INT PRIMARY KEY, b INT) ENGINE='MyISAM';
+CREATE TABLE t1_char (a INT PRIMARY KEY, b INT) ENGINE='MyISAM';
+CREATE TABLE t1_nodef (a INT PRIMARY KEY, b INT) ENGINE='MyISAM';
+CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE='MyISAM';
+CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE='MyISAM';
+CREATE TABLE t4 (a INT) ENGINE='MyISAM';
+CREATE TABLE t5 (a INT, b INT, c INT) ENGINE='MyISAM';
+CREATE TABLE t6 (a INT, b INT, c INT) ENGINE='MyISAM';
+CREATE TABLE t7 (a INT NOT NULL) ENGINE='MyISAM';
+CREATE TABLE t8 (a INT NOT NULL) ENGINE='MyISAM';
+CREATE TABLE t9 (a INT) ENGINE='MyISAM';
+ALTER TABLE t1_int ADD x INT DEFAULT 42;
+ALTER TABLE t1_bit
+ADD x BIT(3) DEFAULT b'011',
+ADD y BIT(5) DEFAULT b'10101',
+ADD z BIT(2) DEFAULT b'10';
+ALTER TABLE t1_char ADD x CHAR(20) DEFAULT 'Just a test';
+ALTER TABLE t1_nodef ADD x INT NOT NULL;
+ALTER TABLE t2 DROP b;
+ALTER TABLE t4 MODIFY a FLOAT;
+ALTER TABLE t5 MODIFY b FLOAT;
+ALTER TABLE t6 MODIFY c FLOAT;
+ALTER TABLE t7 ADD e1 INT, ADD e2 INT, ADD e3 INT, ADD e4 INT,
+ADD e5 INT, ADD e6 INT, ADD e7 INT, ADD e8 INT;
+ALTER TABLE t8 ADD e1 INT NOT NULL DEFAULT 0, ADD e2 INT NOT NULL DEFAULT 0,
+ADD e3 INT NOT NULL DEFAULT 0, ADD e4 INT NOT NULL DEFAULT 0,
+ADD e5 INT NOT NULL DEFAULT 0, ADD e6 INT NOT NULL DEFAULT 0,
+ADD e7 INT NOT NULL DEFAULT 0, ADD e8 INT NOT NULL DEFAULT 0;
+INSERT INTO t1_int VALUES (2, 4, 4711);
+INSERT INTO t1_char VALUES (2, 4, 'Foo is a bar');
+INSERT INTO t1_bit VALUES (2, 4, b'101', b'11100', b'01');
+**** On Master ****
+INSERT INTO t1_int VALUES (1,2);
+INSERT INTO t1_int VALUES (2,5);
+INSERT INTO t1_bit VALUES (1,2);
+INSERT INTO t1_bit VALUES (2,5);
+INSERT INTO t1_char VALUES (1,2);
+INSERT INTO t1_char VALUES (2,5);
+SELECT * FROM t1_int ORDER BY a;
+a b
+1 2
+2 5
+SELECT * FROM t1_bit ORDER BY a;
+a b
+1 2
+2 5
+SELECT * FROM t1_char ORDER BY a;
+a b
+1 2
+2 5
+**** On Slave ****
+SELECT a,b,x FROM t1_int ORDER BY a;
+a b x
+1 2 42
+2 5 4711
+SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a;
+a b HEX(x) HEX(y) HEX(z)
+1 2 3 15 2
+2 5 5 1C 1
+SELECT a,b,x FROM t1_char ORDER BY a;
+a b x
+1 2 Just a test
+2 5 Foo is a bar
+**** On Master ****
+UPDATE t1_int SET b=2*b WHERE a=2;
+UPDATE t1_char SET b=2*b WHERE a=2;
+UPDATE t1_bit SET b=2*b WHERE a=2;
+SELECT * FROM t1_int ORDER BY a;
+a b
+1 2
+2 10
+SELECT * FROM t1_bit ORDER BY a;
+a b
+1 2
+2 10
+SELECT * FROM t1_char ORDER BY a;
+a b
+1 2
+2 10
+**** On Slave ****
+SELECT a,b,x FROM t1_int ORDER BY a;
+a b x
+1 2 42
+2 10 4711
+SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a;
+a b HEX(x) HEX(y) HEX(z)
+1 2 3 15 2
+2 10 5 1C 1
+SELECT a,b,x FROM t1_char ORDER BY a;
+a b x
+1 2 Just a test
+2 10 Foo is a bar
+INSERT INTO t9 VALUES (2);
+INSERT INTO t1_nodef VALUES (1,2);
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1364
+Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef.
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1364
+Last_SQL_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef.
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+INSERT INTO t9 VALUES (2);
+**** On Master ****
+INSERT INTO t2 VALUES (2,4);
+SELECT * FROM t2;
+a b
+2 4
+**** On Slave ****
+SELECT * FROM t2;
+a
+2
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+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 #
+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
+INSERT INTO t9 VALUES (4);
+INSERT INTO t4 VALUES (4);
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 3, test.t4 has type 4
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 3, test.t4 has type 4
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+INSERT INTO t9 VALUES (5);
+INSERT INTO t5 VALUES (5,10,25);
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_Error Table definition on master and slave does not match: Column 1 type mismatch - received type 3, test.t5 has type 4
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+Last_SQL_Error Table definition on master and slave does not match: Column 1 type mismatch - received type 3, test.t5 has type 4
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+INSERT INTO t9 VALUES (6);
+INSERT INTO t6 VALUES (6,12,36);
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 3, test.t6 has type 4
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 3, test.t6 has type 4
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+INSERT INTO t9 VALUES (6);
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+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 #
+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
+INSERT INTO t7 VALUES (1),(2),(3);
+INSERT INTO t8 VALUES (1),(2),(3);
+SELECT * FROM t7 ORDER BY a;
+a
+1
+2
+3
+SELECT * FROM t8 ORDER BY a;
+a
+1
+2
+3
+SELECT * FROM t7 ORDER BY a;
+a e1 e2 e3 e4 e5 e6 e7 e8
+1 NULL NULL NULL NULL NULL NULL NULL NULL
+2 NULL NULL NULL NULL NULL NULL NULL NULL
+3 NULL NULL NULL NULL NULL NULL NULL NULL
+SELECT * FROM t8 ORDER BY a;
+a e1 e2 e3 e4 e5 e6 e7 e8
+1 0 0 0 0 0 0 0 0
+2 0 0 0 0 0 0 0 0
+3 0 0 0 0 0 0 0 0
+**** On Master ****
+TRUNCATE t1_nodef;
+SET SQL_LOG_BIN=0;
+INSERT INTO t1_nodef VALUES (1,2);
+INSERT INTO t1_nodef VALUES (2,4);
+SET SQL_LOG_BIN=1;
+**** On Slave ****
+INSERT INTO t1_nodef VALUES (1,2,3);
+INSERT INTO t1_nodef VALUES (2,4,6);
+**** On Master ****
+UPDATE t1_nodef SET b=2*b WHERE a=1;
+SELECT * FROM t1_nodef ORDER BY a;
+a b
+1 4
+2 4
+**** On Slave ****
+SELECT * FROM t1_nodef ORDER BY a;
+a b x
+1 4 3
+2 4 6
+**** On Master ****
+DELETE FROM t1_nodef WHERE a=2;
+SELECT * FROM t1_nodef ORDER BY a;
+a b
+1 4
+**** On Slave ****
+SELECT * FROM t1_nodef ORDER BY a;
+a b x
+1 4 3
+**** Cleanup ****
+DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
+DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9;
+SET @@global.sql_mode= @my_sql_mode;
diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
new file mode 100644
index 00000000000..83df75b81e9
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
@@ -0,0 +1,419 @@
+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;
+SET @my_sql_mode= @@global.sql_mode;
+SET GLOBAL SQL_MODE='STRICT_ALL_TABLES';
+START SLAVE;
+CREATE TABLE t1_int (a INT PRIMARY KEY, b INT) ENGINE='InnoDB';
+CREATE TABLE t1_bit (a INT PRIMARY KEY, b INT) ENGINE='InnoDB';
+CREATE TABLE t1_char (a INT PRIMARY KEY, b INT) ENGINE='InnoDB';
+CREATE TABLE t1_nodef (a INT PRIMARY KEY, b INT) ENGINE='InnoDB';
+CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE='InnoDB';
+CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE='InnoDB';
+CREATE TABLE t4 (a INT) ENGINE='InnoDB';
+CREATE TABLE t5 (a INT, b INT, c INT) ENGINE='InnoDB';
+CREATE TABLE t6 (a INT, b INT, c INT) ENGINE='InnoDB';
+CREATE TABLE t7 (a INT NOT NULL) ENGINE='InnoDB';
+CREATE TABLE t8 (a INT NOT NULL) ENGINE='InnoDB';
+CREATE TABLE t9 (a INT) ENGINE='InnoDB';
+ALTER TABLE t1_int ADD x INT DEFAULT 42;
+ALTER TABLE t1_bit
+ADD x BIT(3) DEFAULT b'011',
+ADD y BIT(5) DEFAULT b'10101',
+ADD z BIT(2) DEFAULT b'10';
+ALTER TABLE t1_char ADD x CHAR(20) DEFAULT 'Just a test';
+ALTER TABLE t1_nodef ADD x INT NOT NULL;
+ALTER TABLE t2 DROP b;
+ALTER TABLE t4 MODIFY a FLOAT;
+ALTER TABLE t5 MODIFY b FLOAT;
+ALTER TABLE t6 MODIFY c FLOAT;
+ALTER TABLE t7 ADD e1 INT, ADD e2 INT, ADD e3 INT, ADD e4 INT,
+ADD e5 INT, ADD e6 INT, ADD e7 INT, ADD e8 INT;
+ALTER TABLE t8 ADD e1 INT NOT NULL DEFAULT 0, ADD e2 INT NOT NULL DEFAULT 0,
+ADD e3 INT NOT NULL DEFAULT 0, ADD e4 INT NOT NULL DEFAULT 0,
+ADD e5 INT NOT NULL DEFAULT 0, ADD e6 INT NOT NULL DEFAULT 0,
+ADD e7 INT NOT NULL DEFAULT 0, ADD e8 INT NOT NULL DEFAULT 0;
+INSERT INTO t1_int VALUES (2, 4, 4711);
+INSERT INTO t1_char VALUES (2, 4, 'Foo is a bar');
+INSERT INTO t1_bit VALUES (2, 4, b'101', b'11100', b'01');
+**** On Master ****
+INSERT INTO t1_int VALUES (1,2);
+INSERT INTO t1_int VALUES (2,5);
+INSERT INTO t1_bit VALUES (1,2);
+INSERT INTO t1_bit VALUES (2,5);
+INSERT INTO t1_char VALUES (1,2);
+INSERT INTO t1_char VALUES (2,5);
+SELECT * FROM t1_int ORDER BY a;
+a b
+1 2
+2 5
+SELECT * FROM t1_bit ORDER BY a;
+a b
+1 2
+2 5
+SELECT * FROM t1_char ORDER BY a;
+a b
+1 2
+2 5
+**** On Slave ****
+SELECT a,b,x FROM t1_int ORDER BY a;
+a b x
+1 2 42
+2 5 4711
+SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a;
+a b HEX(x) HEX(y) HEX(z)
+1 2 3 15 2
+2 5 5 1C 1
+SELECT a,b,x FROM t1_char ORDER BY a;
+a b x
+1 2 Just a test
+2 5 Foo is a bar
+**** On Master ****
+UPDATE t1_int SET b=2*b WHERE a=2;
+UPDATE t1_char SET b=2*b WHERE a=2;
+UPDATE t1_bit SET b=2*b WHERE a=2;
+SELECT * FROM t1_int ORDER BY a;
+a b
+1 2
+2 10
+SELECT * FROM t1_bit ORDER BY a;
+a b
+1 2
+2 10
+SELECT * FROM t1_char ORDER BY a;
+a b
+1 2
+2 10
+**** On Slave ****
+SELECT a,b,x FROM t1_int ORDER BY a;
+a b x
+1 2 42
+2 10 4711
+SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a;
+a b HEX(x) HEX(y) HEX(z)
+1 2 3 15 2
+2 10 5 1C 1
+SELECT a,b,x FROM t1_char ORDER BY a;
+a b x
+1 2 Just a test
+2 10 Foo is a bar
+INSERT INTO t9 VALUES (2);
+INSERT INTO t1_nodef VALUES (1,2);
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1364
+Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef.
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1364
+Last_SQL_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef.
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+INSERT INTO t9 VALUES (2);
+**** On Master ****
+INSERT INTO t2 VALUES (2,4);
+SELECT * FROM t2;
+a b
+2 4
+**** On Slave ****
+SELECT * FROM t2;
+a
+2
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+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 #
+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
+INSERT INTO t9 VALUES (4);
+INSERT INTO t4 VALUES (4);
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 3, test.t4 has type 4
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 3, test.t4 has type 4
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+INSERT INTO t9 VALUES (5);
+INSERT INTO t5 VALUES (5,10,25);
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_Error Table definition on master and slave does not match: Column 1 type mismatch - received type 3, test.t5 has type 4
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+Last_SQL_Error Table definition on master and slave does not match: Column 1 type mismatch - received type 3, test.t5 has type 4
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+INSERT INTO t9 VALUES (6);
+INSERT INTO t6 VALUES (6,12,36);
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 3, test.t6 has type 4
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 3, test.t6 has type 4
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+INSERT INTO t9 VALUES (6);
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+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 #
+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
+INSERT INTO t7 VALUES (1),(2),(3);
+INSERT INTO t8 VALUES (1),(2),(3);
+SELECT * FROM t7 ORDER BY a;
+a
+1
+2
+3
+SELECT * FROM t8 ORDER BY a;
+a
+1
+2
+3
+SELECT * FROM t7 ORDER BY a;
+a e1 e2 e3 e4 e5 e6 e7 e8
+1 NULL NULL NULL NULL NULL NULL NULL NULL
+2 NULL NULL NULL NULL NULL NULL NULL NULL
+3 NULL NULL NULL NULL NULL NULL NULL NULL
+SELECT * FROM t8 ORDER BY a;
+a e1 e2 e3 e4 e5 e6 e7 e8
+1 0 0 0 0 0 0 0 0
+2 0 0 0 0 0 0 0 0
+3 0 0 0 0 0 0 0 0
+**** On Master ****
+TRUNCATE t1_nodef;
+SET SQL_LOG_BIN=0;
+INSERT INTO t1_nodef VALUES (1,2);
+INSERT INTO t1_nodef VALUES (2,4);
+SET SQL_LOG_BIN=1;
+**** On Slave ****
+INSERT INTO t1_nodef VALUES (1,2,3);
+INSERT INTO t1_nodef VALUES (2,4,6);
+**** On Master ****
+UPDATE t1_nodef SET b=2*b WHERE a=1;
+SELECT * FROM t1_nodef ORDER BY a;
+a b
+1 4
+2 4
+**** On Slave ****
+SELECT * FROM t1_nodef ORDER BY a;
+a b x
+1 4 3
+2 4 6
+**** On Master ****
+DELETE FROM t1_nodef WHERE a=2;
+SELECT * FROM t1_nodef ORDER BY a;
+a b
+1 4
+**** On Slave ****
+SELECT * FROM t1_nodef ORDER BY a;
+a b x
+1 4 3
+**** Cleanup ****
+DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
+DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9;
+SET @@global.sql_mode= @my_sql_mode;
diff --git a/mysql-test/r/rpl_row_tabledefs_7ndb.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_7ndb.result
index 5876a0e1b65..5876a0e1b65 100644
--- a/mysql-test/r/rpl_row_tabledefs_7ndb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_7ndb.result
diff --git a/mysql-test/r/rpl_row_trig001.result b/mysql-test/suite/rpl/r/rpl_row_trig001.result
index 6665dc6d555..6665dc6d555 100644
--- a/mysql-test/r/rpl_row_trig001.result
+++ b/mysql-test/suite/rpl/r/rpl_row_trig001.result
diff --git a/mysql-test/r/rpl_row_trig002.result b/mysql-test/suite/rpl/r/rpl_row_trig002.result
index 794104db750..794104db750 100644
--- a/mysql-test/r/rpl_row_trig002.result
+++ b/mysql-test/suite/rpl/r/rpl_row_trig002.result
diff --git a/mysql-test/r/rpl_row_trig003.result b/mysql-test/suite/rpl/r/rpl_row_trig003.result
index 43c2ecde2b4..43c2ecde2b4 100644
--- a/mysql-test/r/rpl_row_trig003.result
+++ b/mysql-test/suite/rpl/r/rpl_row_trig003.result
diff --git a/mysql-test/r/rpl_row_trig004.result b/mysql-test/suite/rpl/r/rpl_row_trig004.result
index d0d0657f875..d0d0657f875 100644
--- a/mysql-test/r/rpl_row_trig004.result
+++ b/mysql-test/suite/rpl/r/rpl_row_trig004.result
diff --git a/mysql-test/suite/rpl/r/rpl_row_unsafe_funcs.result b/mysql-test/suite/rpl/r/rpl_row_unsafe_funcs.result
new file mode 100644
index 00000000000..800670b78ae
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_unsafe_funcs.result
@@ -0,0 +1,22 @@
+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);
+CREATE TABLE t2 (a INT, b INT);
+INSERT INTO t1 SELECT 1;
+INSERT INTO t1 VALUES (2),(3),(4),(5),(6);
+INSERT INTO t2 SELECT 1, ROW_COUNT();
+INSERT INTO t1 VALUES (2),(3),(4);
+INSERT INTO t2 SELECT 2, ROW_COUNT();
+SELECT b FROM t2 ORDER BY a;
+b
+1
+3
+SELECT b FROM t2 ORDER BY a;
+b
+1
+3
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/rpl/r/rpl_row_until.result b/mysql-test/suite/rpl/r/rpl_row_until.result
new file mode 100644
index 00000000000..383d1a03a22
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_until.result
@@ -0,0 +1,206 @@
+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;
+create table t1(n int not null auto_increment primary key);
+insert into t1 values (1),(2),(3),(4);
+drop table t1;
+create table t2(n int not null auto_increment primary key);
+insert into t2 values (1),(2);
+insert into t2 values (3),(4);
+drop table t2;
+start slave until master_log_file='master-bin.000001', master_log_pos=311;
+select * from t1;
+n
+1
+2
+3
+4
+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 750
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 317
+Relay_Log_Space #
+Until_Condition Master
+Until_Log_File master-bin.000001
+Until_Log_Pos 311
+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
+start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
+select * from t1;
+n
+1
+2
+3
+4
+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 750
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 317
+Relay_Log_Space #
+Until_Condition Master
+Until_Log_File master-no-such-bin.000001
+Until_Log_Pos 291
+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
+start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=728;
+select * from t2;
+n
+1
+2
+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 750
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 594
+Relay_Log_Space #
+Until_Condition Relay
+Until_Log_File slave-relay-bin.000004
+Until_Log_Pos 728
+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
+start slave;
+stop slave;
+start slave until master_log_file='master-bin.000001', master_log_pos=740;
+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 750
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 750
+Relay_Log_Space #
+Until_Condition Master
+Until_Log_File master-bin.000001
+Until_Log_Pos 740
+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
+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;
+ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
+start slave until master_log_file='master-bin.000001';
+ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
+start slave until relay_log_file='slave-relay-bin.000002';
+ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
+start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
+ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
+start slave sql_thread;
+start slave until master_log_file='master-bin.000001', master_log_pos=740;
+Warnings:
+Note 1254 Slave is already running
diff --git a/mysql-test/r/rpl_row_view01.result b/mysql-test/suite/rpl/r/rpl_row_view01.result
index a4b8d0a05e3..a4b8d0a05e3 100644
--- a/mysql-test/r/rpl_row_view01.result
+++ b/mysql-test/suite/rpl/r/rpl_row_view01.result
diff --git a/mysql-test/suite/rpl/r/rpl_server_id1.result b/mysql-test/suite/rpl/r/rpl_server_id1.result
new file mode 100644
index 00000000000..9894910aaf6
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_server_id1.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;
+create table t1 (n int);
+reset master;
+stop slave;
+change master to master_port=SLAVE_PORT;
+show slave status;
+Slave_IO_State
+Master_Host 127.0.0.1
+Master_User root
+Master_Port SLAVE_PORT
+Connect_Retry 1
+Master_Log_File
+Read_Master_Log_Pos 4
+Relay_Log_File slave-relay-bin.000001
+Relay_Log_Pos 4
+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 106
+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 NULL
+Master_SSL_Verify_Server_Cert No
+Last_IO_Errno #
+Last_IO_Error #
+Last_SQL_Errno 0
+Last_SQL_Error
+start slave;
+insert into t1 values (1);
+show status like "slave_running";
+Variable_name Value
+Slave_running OFF
+drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_server_id2.result b/mysql-test/suite/rpl/r/rpl_server_id2.result
new file mode 100644
index 00000000000..f68f9ff829d
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_server_id2.result
@@ -0,0 +1,57 @@
+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 (n int);
+reset master;
+stop slave;
+change master to master_port=SLAVE_PORT;
+show slave status;
+Slave_IO_State
+Master_Host 127.0.0.1
+Master_User root
+Master_Port SLAVE_PORT
+Connect_Retry 1
+Master_Log_File
+Read_Master_Log_Pos 4
+Relay_Log_File slave-relay-bin.000001
+Relay_Log_Pos 4
+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 106
+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 NULL
+Master_SSL_Verify_Server_Cert No
+Last_IO_Errno #
+Last_IO_Error #
+Last_SQL_Errno 0
+Last_SQL_Error
+start slave;
+insert into t1 values (1);
+select * from t1;
+n
+1
+1
+stop slave;
+drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_session_var.result b/mysql-test/suite/rpl/r/rpl_session_var.result
new file mode 100644
index 00000000000..297a18a5931
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_session_var.result
@@ -0,0 +1,53 @@
+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;
+drop table if exists t1;
+Warnings:
+Note 1051 Unknown table 't1'
+create table t1(a varchar(100),b int);
+set @@session.sql_mode=pipes_as_concat;
+insert into t1 values('My'||'SQL', 1);
+set @@session.sql_mode=default;
+insert into t1 values('1'||'2', 2);
+select * from t1 where b<3 order by a;
+a b
+1 2
+MySQL 1
+select * from t1 where b<3 order by a;
+a b
+1 2
+MySQL 1
+set @@session.sql_mode=ignore_space;
+insert into t1 values(password ('MySQL'), 3);
+set @@session.sql_mode=ansi_quotes;
+create table "t2" ("a" int);
+drop table t1, t2;
+set @@session.sql_mode=default;
+create table t1(a int auto_increment primary key);
+create table t2(b int, a int);
+set @@session.sql_auto_is_null=1;
+insert into t1 values(null);
+insert into t2 select 1,a from t1 where a is null;
+set @@session.sql_auto_is_null=0;
+insert into t1 values(null);
+insert into t2 select 2,a from t1 where a is null;
+select * from t2 order by b;
+b a
+1 1
+select * from t2 order by b;
+b a
+1 1
+drop table t1,t2;
+CREATE TABLE t1 (
+`id` int(11) NOT NULL auto_increment,
+`data` varchar(100),
+PRIMARY KEY (`id`)
+) ENGINE=MyISAM;
+INSERT INTO t1(data) VALUES(SESSION_USER());
+SELECT length(data) < 100 FROM t1;
+length(data) < 100
+1
+drop table t1;
diff --git a/mysql-test/r/rpl_set_charset.result b/mysql-test/suite/rpl/r/rpl_set_charset.result
index 480d926fbba..480d926fbba 100644
--- a/mysql-test/r/rpl_set_charset.result
+++ b/mysql-test/suite/rpl/r/rpl_set_charset.result
diff --git a/mysql-test/r/rpl_sf.result b/mysql-test/suite/rpl/r/rpl_sf.result
index 46defc6908a..46defc6908a 100644
--- a/mysql-test/r/rpl_sf.result
+++ b/mysql-test/suite/rpl/r/rpl_sf.result
diff --git a/mysql-test/suite/rpl/r/rpl_skip_error.result b/mysql-test/suite/rpl/r/rpl_skip_error.result
new file mode 100644
index 00000000000..525909387b3
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_skip_error.result
@@ -0,0 +1,36 @@
+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 (n int not null primary key);
+insert into t1 values (1);
+insert into t1 values (1);
+insert into t1 values (2),(3);
+select * from t1 ORDER BY n;
+n
+1
+2
+3
+drop table t1;
+create table t1(a int primary key);
+insert into t1 values (1),(2);
+delete from t1 where @@server_id=1;
+set sql_mode=strict_trans_tables;
+select @@server_id;
+@@server_id
+1
+insert into t1 values (1),(2),(3);
+select @@server_id;
+@@server_id
+2
+select * from t1;
+a
+1
+2
+3
+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 786 # # master-bin.000001 Yes Yes 0 0 786 # None 0 No # No 0 0
+drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_slave_skip.result b/mysql-test/suite/rpl/r/rpl_slave_skip.result
new file mode 100644
index 00000000000..8e492fe4732
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_slave_skip.result
@@ -0,0 +1,144 @@
+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;
+**** On Slave ****
+STOP SLAVE;
+**** On Master ****
+SET SESSION BINLOG_FORMAT=ROW;
+CREATE TABLE t1 (a INT, b INT);
+CREATE TABLE t2 (c INT, d INT);
+INSERT INTO t1 VALUES (1,1),(2,4),(3,9);
+INSERT INTO t2 VALUES (1,1),(2,8),(3,27);
+UPDATE t1,t2 SET b = d, d = b * 2 WHERE a = c;
+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, b INT)
+master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (c INT, d INT)
+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.t2)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Table_map # # table_id: # (test.t2)
+master-bin.000001 # Update_rows # # table_id: #
+master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
+SELECT * FROM t1;
+a b
+1 1
+2 8
+3 27
+SELECT * FROM t2;
+c d
+1 2
+2 16
+3 54
+**** On Slave ****
+START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=484;
+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 722
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 488
+Relay_Log_Space #
+Until_Condition Master
+Until_Log_File master-bin.000001
+Until_Log_Pos 484
+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
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
+START SLAVE;
+SELECT * FROM t1;
+a b
+1 1
+2 4
+3 9
+SELECT * FROM t2;
+c d
+1 1
+2 8
+3 27
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+SET SESSION BINLOG_FORMAT=STATEMENT;
+SET @foo = 12;
+INSERT INTO t1 VALUES(@foo, 2*@foo);
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # User var # # @`foo`=12
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(@foo, 2*@foo)
+START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=106;
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
+START SLAVE;
+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 248
+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 248
+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
+**** On Master ****
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/rpl/r/rpl_slave_status.result b/mysql-test/suite/rpl/r/rpl_slave_status.result
new file mode 100644
index 00000000000..08f79d01e7a
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_slave_status.result
@@ -0,0 +1,62 @@
+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;
+grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl';
+stop slave;
+change master to master_user='rpl',master_password='rpl';
+start slave;
+drop table if exists t1;
+create table t1 (n int);
+insert into t1 values (1);
+select * from t1;
+n
+1
+delete from mysql.user where user='rpl';
+flush privileges;
+stop slave;
+start slave;
+show slave status;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User rpl
+Master_Port MASTER_MYPORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running No
+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 #
+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 NULL
+Master_SSL_Verify_Server_Cert No
+Last_IO_Errno #
+Last_IO_Error #
+Last_SQL_Errno 0
+Last_SQL_Error
+drop table t1;
+delete from mysql.user where user='rpl';
+drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result
new file mode 100644
index 00000000000..bf02a627e08
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_sp.result
@@ -0,0 +1,560 @@
+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;
+drop database if exists mysqltest1;
+create database mysqltest1;
+use mysqltest1;
+create table t1 (a varchar(100));
+use mysqltest1;
+create procedure foo()
+begin
+declare b int;
+set b = 8;
+insert into t1 values (b);
+insert into t1 values (unix_timestamp());
+end|
+select * from mysql.proc where name='foo' and db='mysqltest1';
+db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
+mysqltest1 foo PROCEDURE foo SQL CONTAINS_SQL NO DEFINER begin
+declare b int;
+set b = 8;
+insert into t1 values (b);
+insert into t1 values (unix_timestamp());
+end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
+declare b int;
+set b = 8;
+insert into t1 values (b);
+insert into t1 values (unix_timestamp());
+end
+select * from mysql.proc where name='foo' and db='mysqltest1';
+db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
+mysqltest1 foo PROCEDURE foo SQL CONTAINS_SQL NO DEFINER begin
+declare b int;
+set b = 8;
+insert into t1 values (b);
+insert into t1 values (unix_timestamp());
+end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
+declare b int;
+set b = 8;
+insert into t1 values (b);
+insert into t1 values (unix_timestamp());
+end
+set timestamp=1000000000;
+call foo();
+select * from t1;
+a
+8
+1000000000
+select * from t1;
+a
+8
+1000000000
+delete from t1;
+create procedure foo2()
+select * from mysqltest1.t1;
+call foo2();
+a
+alter procedure foo2 contains sql;
+drop table t1;
+create table t1 (a int);
+create table t2 like t1;
+create procedure foo3()
+deterministic
+insert into t1 values (15);
+grant CREATE ROUTINE, EXECUTE on mysqltest1.* to "zedjzlcsjhd"@127.0.0.1;
+grant SELECT on mysqltest1.t1 to "zedjzlcsjhd"@127.0.0.1;
+grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1;
+SELECT 1;
+1
+1
+create procedure foo4()
+deterministic
+begin
+insert into t2 values(3);
+insert into t1 values (5);
+end|
+call foo4();
+Got one of the listed errors
+call foo3();
+show warnings;
+Level Code Message
+call foo4();
+Got one of the listed errors
+alter procedure foo4 sql security invoker;
+call foo4();
+show warnings;
+Level Code Message
+select * from t1;
+a
+15
+5
+select * from t2;
+a
+3
+3
+3
+select * from t1;
+a
+15
+5
+select * from t2;
+a
+3
+3
+3
+delete from t2;
+alter table t2 add unique (a);
+drop procedure foo4;
+create procedure foo4()
+deterministic
+begin
+insert into t2 values(20),(20);
+end|
+call foo4();
+ERROR 23000: Duplicate entry '20' for key 'a'
+show warnings;
+Level Code Message
+Error 1062 Duplicate entry '20' for key 'a'
+select * from t2;
+a
+20
+select * from t2;
+a
+20
+select * from mysql.proc where name="foo4" and db='mysqltest1';
+db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
+mysqltest1 foo4 PROCEDURE foo4 SQL CONTAINS_SQL YES DEFINER begin
+insert into t2 values(20),(20);
+end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
+insert into t2 values(20),(20);
+end
+drop procedure foo4;
+select * from mysql.proc where name="foo4" and db='mysqltest1';
+db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
+select * from mysql.proc where name="foo4" and db='mysqltest1';
+db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
+drop procedure foo;
+drop procedure foo2;
+drop procedure foo3;
+create function fn1(x int)
+returns int
+begin
+insert into t1 values (x);
+return x+2;
+end|
+ERROR HY000: 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)
+create function fn1(x int)
+returns int
+deterministic
+begin
+insert into t1 values (x);
+return x+2;
+end|
+delete t1,t2 from t1,t2;
+select fn1(20);
+fn1(20)
+22
+insert into t2 values(fn1(21));
+select * from t1;
+a
+21
+20
+select * from t2;
+a
+23
+select * from t1;
+a
+21
+20
+select * from t2;
+a
+23
+drop function fn1;
+create function fn1()
+returns int
+no sql
+begin
+return unix_timestamp();
+end|
+alter function fn1 contains sql;
+ERROR HY000: 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)
+delete from t1;
+set timestamp=1000000000;
+insert into t1 values(fn1());
+create function fn2()
+returns int
+no sql
+begin
+return unix_timestamp();
+end|
+ERROR HY000: 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)
+set global log_bin_trust_routine_creators=1;
+Warnings:
+Warning 1287 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead
+set global log_bin_trust_function_creators=0;
+set global log_bin_trust_function_creators=1;
+set global log_bin_trust_function_creators=1;
+create function fn2()
+returns int
+no sql
+begin
+return unix_timestamp();
+end|
+create function fn3()
+returns int
+not deterministic
+reads sql data
+begin
+return 0;
+end|
+select fn3();
+fn3()
+0
+select * from mysql.proc where db='mysqltest1';
+db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
+mysqltest1 fn1 FUNCTION fn1 SQL NO_SQL NO DEFINER int(11) begin
+return unix_timestamp();
+end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
+return unix_timestamp();
+end
+mysqltest1 fn2 FUNCTION fn2 SQL NO_SQL NO DEFINER int(11) begin
+return unix_timestamp();
+end zedjzlcsjhd@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
+return unix_timestamp();
+end
+mysqltest1 fn3 FUNCTION fn3 SQL READS_SQL_DATA NO DEFINER int(11) begin
+return 0;
+end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
+return 0;
+end
+select * from t1;
+a
+1000000000
+use mysqltest1;
+select * from t1;
+a
+1000000000
+select * from mysql.proc where db='mysqltest1';
+db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
+mysqltest1 fn1 FUNCTION fn1 SQL NO_SQL NO DEFINER int(11) begin
+return unix_timestamp();
+end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
+return unix_timestamp();
+end
+mysqltest1 fn2 FUNCTION fn2 SQL NO_SQL NO DEFINER int(11) begin
+return unix_timestamp();
+end zedjzlcsjhd@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
+return unix_timestamp();
+end
+mysqltest1 fn3 FUNCTION fn3 SQL READS_SQL_DATA NO DEFINER int(11) begin
+return 0;
+end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
+return 0;
+end
+delete from t2;
+alter table t2 add unique (a);
+drop function fn1;
+create function fn1(x int)
+returns int
+begin
+insert into t2 values(x),(x);
+return 10;
+end|
+do fn1(100);
+Warnings:
+Error 1062 Duplicate entry '100' for key 'a'
+select fn1(20);
+ERROR 23000: Duplicate entry '20' for key 'a'
+select * from t2;
+a
+20
+100
+select * from t2;
+a
+20
+100
+create trigger trg before insert on t1 for each row set new.a= 10;
+ERROR 42000: TRIGGER command denied to user 'zedjzlcsjhd'@'localhost' for table 't1'
+delete from t1;
+create trigger trg before insert on t1 for each row set new.a= 10;
+insert into t1 values (1);
+select * from t1;
+a
+10
+select * from t1;
+a
+10
+delete from t1;
+drop trigger trg;
+insert into t1 values (1);
+select * from t1;
+a
+1
+select * from t1;
+a
+1
+create procedure foo()
+not deterministic
+reads sql data
+select * from t1;
+call foo();
+a
+1
+drop procedure foo;
+drop function fn1;
+drop database mysqltest1;
+drop user "zedjzlcsjhd"@127.0.0.1;
+use test;
+use test;
+drop function if exists f1;
+create function f1() returns int reads sql data
+begin
+declare var integer;
+declare c cursor for select a from v1;
+open c;
+fetch c into var;
+close c;
+return var;
+end|
+create view v1 as select 1 as a;
+create table t1 (a int);
+insert into t1 (a) values (f1());
+select * from t1;
+a
+1
+drop view v1;
+drop function f1;
+select * from t1;
+a
+1
+DROP PROCEDURE IF EXISTS p1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(col VARCHAR(10));
+CREATE PROCEDURE p1(arg VARCHAR(10))
+INSERT INTO t1 VALUES(arg);
+CALL p1('test');
+SELECT * FROM t1;
+col
+test
+SELECT * FROM t1;
+col
+test
+DROP PROCEDURE p1;
+
+---> Test for BUG#20438
+
+---> Preparing environment...
+---> connection: master
+DROP PROCEDURE IF EXISTS p1;
+DROP FUNCTION IF EXISTS f1;
+
+---> Synchronizing slave with master...
+
+---> connection: master
+
+---> Creating procedure...
+/*!50003 CREATE PROCEDURE p1() SET @a = 1 */;
+/*!50003 CREATE FUNCTION f1() RETURNS INT RETURN 0 */;
+
+---> Checking on master...
+SHOW CREATE PROCEDURE p1;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
+SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW CREATE FUNCTION f1;
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
+RETURN 0 latin1 latin1_swedish_ci latin1_swedish_ci
+
+---> Synchronizing slave with master...
+---> connection: master
+
+---> Checking on slave...
+SHOW CREATE PROCEDURE p1;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
+SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW CREATE FUNCTION f1;
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
+RETURN 0 latin1 latin1_swedish_ci latin1_swedish_ci
+
+---> connection: master
+
+---> Cleaning up...
+DROP PROCEDURE p1;
+DROP FUNCTION f1;
+drop table t1;
+drop database if exists mysqltest;
+drop database if exists mysqltest2;
+create database mysqltest;
+create database mysqltest2;
+use mysqltest2;
+create table t ( t integer );
+create procedure mysqltest.test() begin end;
+insert into t values ( 1 );
+create procedure `\\`.test() begin end;
+ERROR 42000: Unknown database '\\'
+create function f1 () returns int
+begin
+insert into t values (1);
+return 0;
+end|
+use mysqltest;
+set @a:= mysqltest2.f1();
+show binlog events in 'master-bin.000001' from 106;
+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()
+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()
+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()
+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()
+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()
+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
+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
+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
+no sql
+begin
+return unix_timestamp();
+end
+master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function fn3()
+returns int
+not deterministic
+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
+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()
+not deterministic
+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`; CREATE DEFINER=`root`@`localhost` function f1() returns int reads sql data
+begin
+declare var integer;
+declare c cursor for select a from v1;
+open c;
+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 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))
+INSERT INTO t1 VALUES(arg)
+master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES( NAME_CONST('arg',_latin1'test'))
+master-bin.000001 # Query 1 # use `test`; DROP PROCEDURE p1
+master-bin.000001 # Query 1 # 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 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() 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
+begin
+insert into t values (1);
+return 0;
+end
+master-bin.000001 # Query 1 # use `mysqltest`; SELECT `mysqltest2`.`f1`()
+set global log_bin_trust_function_creators=0;
+set global log_bin_trust_function_creators=0;
+drop database mysqltest;
+drop database mysqltest2;
+End of 5.0 tests
+End of 5.1 tests
diff --git a/mysql-test/r/rpl_sp004.result b/mysql-test/suite/rpl/r/rpl_sp004.result
index 1c0ed3cc50a..1c0ed3cc50a 100644
--- a/mysql-test/r/rpl_sp004.result
+++ b/mysql-test/suite/rpl/r/rpl_sp004.result
diff --git a/mysql-test/r/rpl_sp_effects.result b/mysql-test/suite/rpl/r/rpl_sp_effects.result
index c2c44b06972..c2c44b06972 100644
--- a/mysql-test/r/rpl_sp_effects.result
+++ b/mysql-test/suite/rpl/r/rpl_sp_effects.result
diff --git a/mysql-test/r/rpl_sporadic_master.result b/mysql-test/suite/rpl/r/rpl_sporadic_master.result
index 14fb673a081..14fb673a081 100644
--- a/mysql-test/r/rpl_sporadic_master.result
+++ b/mysql-test/suite/rpl/r/rpl_sporadic_master.result
diff --git a/mysql-test/suite/rpl/r/rpl_ssl.result b/mysql-test/suite/rpl/r/rpl_ssl.result
new file mode 100644
index 00000000000..d188dd353ce
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_ssl.result
@@ -0,0 +1,107 @@
+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;
+grant replication slave on *.* to replssl@localhost require ssl;
+create table t1 (t int auto_increment, KEY(t));
+stop slave;
+change master to
+master_user='replssl',
+master_password='',
+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';
+start slave;
+insert into t1 values(1);
+select * from t1;
+t
+1
+show slave status;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User replssl
+Master_Port MASTER_MYPORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+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 #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed Yes
+Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem
+Master_SSL_CA_Path
+Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem
+Master_SSL_Cipher
+Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem
+Seconds_Behind_Master #
+Master_SSL_Verify_Server_Cert No
+Last_IO_Errno #
+Last_IO_Error #
+Last_SQL_Errno 0
+Last_SQL_Error
+STOP SLAVE;
+select * from t1;
+t
+1
+insert into t1 values (NULL);
+show slave status;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User replssl
+Master_Port MASTER_MYPORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+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 #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed Yes
+Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem
+Master_SSL_CA_Path
+Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem
+Master_SSL_Cipher
+Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem
+Seconds_Behind_Master #
+Master_SSL_Verify_Server_Cert No
+Last_IO_Errno #
+Last_IO_Error #
+Last_SQL_Errno 0
+Last_SQL_Error
+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
new file mode 100644
index 00000000000..74d2550cdaf
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_ssl1.result
@@ -0,0 +1,158 @@
+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;
+grant replication slave on *.* to replssl@localhost require ssl;
+create table t1 (t int);
+stop slave;
+change master to master_user='replssl',master_password='';
+start slave;
+insert into t1 values (1);
+select * from t1;
+t
+stop slave;
+change master to 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';
+start slave;
+select * from t1;
+t
+1
+show slave status;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User replssl
+Master_Port MASTER_MYPORT
+Connect_Retry 1
+Master_Log_File #
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File #
+Slave_IO_Running #
+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 #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed Yes
+Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem
+Master_SSL_CA_Path
+Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem
+Master_SSL_Cipher
+Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem
+Seconds_Behind_Master #
+Master_SSL_Verify_Server_Cert No
+Last_IO_Errno #
+Last_IO_Error #
+Last_SQL_Errno 0
+Last_SQL_Error
+stop slave;
+change master to master_user='root',master_password='', master_ssl=0;
+start slave;
+drop user replssl@localhost;
+drop table t1;
+show slave status;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_MYPORT
+Connect_Retry 1
+Master_Log_File #
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File #
+Slave_IO_Running #
+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 #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem
+Master_SSL_CA_Path
+Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem
+Master_SSL_Cipher
+Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem
+Seconds_Behind_Master #
+Master_SSL_Verify_Server_Cert No
+Last_IO_Errno #
+Last_IO_Error #
+Last_SQL_Errno 0
+Last_SQL_Error
+stop slave;
+change master to
+master_host="localhost",
+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',
+master_ssl_verify_server_cert=1;
+start slave;
+create table t1 (t int);
+insert into t1 values (1);
+on slave
+select * from t1;
+t
+1
+show slave status;
+Slave_IO_State #
+Master_Host localhost
+Master_User root
+Master_Port MASTER_MYPORT
+Connect_Retry 1
+Master_Log_File #
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File #
+Slave_IO_Running #
+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 #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed Yes
+Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem
+Master_SSL_CA_Path
+Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem
+Master_SSL_Cipher
+Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem
+Seconds_Behind_Master #
+Master_SSL_Verify_Server_Cert Yes
+Last_IO_Errno #
+Last_IO_Error #
+Last_SQL_Errno 0
+Last_SQL_Error
+drop table t1;
diff --git a/mysql-test/r/rpl_start_stop_slave.result b/mysql-test/suite/rpl/r/rpl_start_stop_slave.result
index 1fcb586d1fb..1fcb586d1fb 100644
--- a/mysql-test/r/rpl_start_stop_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_start_stop_slave.result
diff --git a/mysql-test/r/rpl_stm_000001.result b/mysql-test/suite/rpl/r/rpl_stm_000001.result
index 3b4cd05f640..3b4cd05f640 100644
--- a/mysql-test/r/rpl_stm_000001.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_000001.result
diff --git a/mysql-test/r/rpl_stm_EE_err2.result b/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result
index 13aa45d8ced..13aa45d8ced 100644
--- a/mysql-test/r/rpl_stm_EE_err2.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result
diff --git a/mysql-test/r/rpl_stm_charset.result b/mysql-test/suite/rpl/r/rpl_stm_charset.result
index fd9c40843d5..fd9c40843d5 100644
--- a/mysql-test/r/rpl_stm_charset.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_charset.result
diff --git a/mysql-test/r/rpl_stm_flsh_tbls.result b/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result
index 1c6b5615b6e..1c6b5615b6e 100644
--- a/mysql-test/r/rpl_stm_flsh_tbls.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result
diff --git a/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result b/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result
new file mode 100644
index 00000000000..5ca0ea2b780
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result
@@ -0,0 +1,140 @@
+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;
+set @old_global_binlog_format = @@global.binlog_format;
+set @@global.binlog_format = statement;
+CREATE SCHEMA IF NOT EXISTS mysqlslap;
+USE mysqlslap;
+select @@global.binlog_format;
+@@global.binlog_format
+STATEMENT
+CREATE TABLE t1 (id INT primary key auto_increment, name VARCHAR(64));
+FLUSH TABLE t1;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+5000
+use mysqlslap;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+5000
+truncate table t1;
+insert delayed into t1 values(10, "my name");
+insert delayed into t1 values(10, "is Bond"), (20, "James Bond");
+ERROR 23000: Duplicate entry '10' for key 'PRIMARY'
+flush table t1;
+select * from t1;
+id name
+10 my name
+select * from t1;
+id name
+10 my name
+delete from t1 where id!=10;
+insert delayed into t1 values(20, "is Bond"), (10, "James Bond");
+ERROR 23000: Duplicate entry '10' for key 'PRIMARY'
+flush table t1;
+select * from t1;
+id name
+10 my name
+20 is Bond
+select * from t1;
+id name
+10 my name
+20 is Bond
+USE test;
+DROP SCHEMA mysqlslap;
+use test;
+FLUSH LOGS;
+FLUSH LOGS;
+CREATE TABLE t1(a int, UNIQUE(a));
+INSERT DELAYED IGNORE INTO t1 VALUES(1);
+INSERT DELAYED IGNORE INTO t1 VALUES(1);
+flush table t1;
+show binlog events in 'master-bin.000002' LIMIT 2,2;
+Log_name Pos Event_type Server_id End_log_pos Info
+x x x x x use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1)
+x x x x x use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1)
+select * from t1;
+a
+1
+On slave
+show binlog events in 'slave-bin.000002' LIMIT 2,2;
+Log_name Pos Event_type Server_id End_log_pos Info
+x x x x x use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1)
+x x x x x use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1)
+select * from t1;
+a
+1
+drop table t1;
+FLUSH LOGS;
+FLUSH LOGS;
+End of 5.0 tests
+set @@global.binlog_format = mixed;
+CREATE SCHEMA IF NOT EXISTS mysqlslap;
+USE mysqlslap;
+select @@global.binlog_format;
+@@global.binlog_format
+MIXED
+CREATE TABLE t1 (id INT primary key auto_increment, name VARCHAR(64));
+FLUSH TABLE t1;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+5000
+use mysqlslap;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+5000
+truncate table t1;
+insert delayed into t1 values(10, "my name");
+insert delayed into t1 values(10, "is Bond"), (20, "James Bond");
+flush table t1;
+select * from t1;
+id name
+10 my name
+20 James Bond
+select * from t1;
+id name
+10 my name
+20 James Bond
+delete from t1 where id!=10;
+insert delayed into t1 values(20, "is Bond"), (10, "James Bond");
+flush table t1;
+select * from t1;
+id name
+10 my name
+20 is Bond
+select * from t1;
+id name
+10 my name
+20 is Bond
+USE test;
+DROP SCHEMA mysqlslap;
+use test;
+FLUSH LOGS;
+FLUSH LOGS;
+CREATE TABLE t1(a int, UNIQUE(a));
+INSERT DELAYED IGNORE INTO t1 VALUES(1);
+INSERT DELAYED IGNORE INTO t1 VALUES(1);
+flush table t1;
+show binlog events in 'master-bin.000002' LIMIT 2,2;
+Log_name Pos Event_type Server_id End_log_pos Info
+x x x x x use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1)
+x x x x x use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1)
+select * from t1;
+a
+1
+On slave
+show binlog events in 'slave-bin.000002' LIMIT 2,2;
+Log_name Pos Event_type Server_id End_log_pos Info
+x x x x x use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1)
+x x x x x use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1)
+select * from t1;
+a
+1
+drop table t1;
+FLUSH LOGS;
+FLUSH LOGS;
+End of 5.0 tests
+set @@global.binlog_format = @old_global_binlog_format;
diff --git a/mysql-test/suite/rpl/r/rpl_stm_log.result b/mysql-test/suite/rpl/r/rpl_stm_log.result
new file mode 100644
index 00000000000..02f3dc9044a
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_stm_log.result
@@ -0,0 +1,293 @@
+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;
+reset master;
+reset slave;
+reset master;
+create table t1(n int not null auto_increment primary key)ENGINE=MyISAM;
+insert into t1 values (NULL);
+drop table t1;
+create table t1 (word char(20) not null)ENGINE=MyISAM;
+load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines;
+select count(*) from t1;
+count(*)
+69
+show binlog events;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
+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
+master-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL)
+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_ln/words.dat' into table t1 ignore 1 lines ;file_id=1
+show binlog events from 106 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;
+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;
+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;
+create table t3 (a int)ENGINE=MyISAM;
+select * from t1 order by 1 asc;
+word
+Aarhus
+Aaron
+Aaron
+Ababa
+Ababa
+aback
+aback
+abaft
+abaft
+abandon
+abandon
+abandoned
+abandoned
+abandoning
+abandoning
+abandonment
+abandonment
+abandons
+abandons
+abase
+abased
+abasement
+abasements
+abases
+abash
+abashed
+abashes
+abashing
+abasing
+abate
+abated
+abatement
+abatements
+abater
+abates
+abating
+Abba
+abbe
+abbey
+abbeys
+abbot
+abbots
+Abbott
+abbreviate
+abbreviated
+abbreviates
+abbreviating
+abbreviation
+abbreviations
+Abby
+abdomen
+abdomens
+abdominal
+abduct
+abducted
+abduction
+abductions
+abductor
+abductors
+abducts
+Abe
+abed
+Abel
+Abelian
+Abelson
+Aberdeen
+Abernathy
+aberrant
+aberration
+start slave;
+
+let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%' ;
+
+--source include/wait_slave_status.inc
+select * from t1 order by 1 asc;
+word
+Aarhus
+Aaron
+Aaron
+Ababa
+Ababa
+aback
+aback
+abaft
+abaft
+abandon
+abandon
+abandoned
+abandoned
+abandoning
+abandoning
+abandonment
+abandonment
+abandons
+abandons
+abase
+abased
+abasement
+abasements
+abases
+abash
+abashed
+abashes
+abashing
+abasing
+abate
+abated
+abatement
+abatements
+abater
+abates
+abating
+Abba
+abbe
+abbey
+abbeys
+abbot
+abbots
+Abbott
+abbreviate
+abbreviated
+abbreviates
+abbreviating
+abbreviation
+abbreviations
+Abby
+abdomen
+abdomens
+abdominal
+abduct
+abducted
+abduction
+abductions
+abductor
+abductors
+abducts
+Abe
+abed
+Abel
+Abelian
+Abelson
+Aberdeen
+Abernathy
+aberrant
+aberration
+flush logs;
+stop slave;
+create table t2 (n int)ENGINE=MyISAM;
+insert into t2 values (1);
+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(n int not null auto_increment primary key)ENGINE=MyISAM
+master-bin.000001 # Intvar # # INSERT_ID=1
+master-bin.000001 # Query # # use `test`; insert into t1 values (NULL)
+master-bin.000001 # Query # # use `test`; drop table t1
+master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
+master-bin.000001 # Begin_load_query # # ;file_id=1;block_len=581
+master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=1
+master-bin.000001 # Rotate # # master-bin.000002;pos=4
+show binlog events in 'master-bin.000002';
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
+master-bin.000002 # Query 1 # use `test`; create table t3 (a int)ENGINE=MyISAM
+master-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM
+master-bin.000002 # Query 1 # use `test`; insert into t2 values (1)
+show binary logs;
+Log_name File_size
+master-bin.000001 1347
+master-bin.000002 392
+start slave;
+show binary logs;
+Log_name File_size
+slave-bin.000001 1447
+slave-bin.000002 293
+show binlog events in 'slave-bin.000001' from 4;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
+slave-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM
+slave-bin.000001 # Intvar 1 # INSERT_ID=1
+slave-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL)
+slave-bin.000001 # Query 1 # use `test`; drop table t1
+slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
+slave-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581
+slave-bin.000001 # Execute_load_query 1 # use `test`; load data INFILE '../tmp/SQL_LOAD-2-1-1.data' INTO table t1 ignore 1 lines ;file_id=1
+slave-bin.000001 # Query 1 # use `test`; create table t3 (a int)ENGINE=MyISAM
+slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4
+show binlog events in 'slave-bin.000002' from 4;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
+slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM
+slave-bin.000002 # Query 1 # use `test`; insert into t2 values (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.000002
+Read_Master_Log_Pos 392
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000002
+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 392
+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
+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;
+DROP TABLE t2;
+DROP TABLE t3;
+create table t1(a int auto_increment primary key, b int);
+insert into t1 values (NULL, 1);
+reset master;
+set insert_id=5;
+insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Intvar # # LAST_INSERT_ID=1
+master-bin.000001 # Intvar # # INSERT_ID=5
+master-bin.000001 # Query # # use `test`; insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id())
+select * from t1;
+a b
+1 1
+5 1
+6 1
+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
new file mode 100644
index 00000000000..947b5686a18
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result
@@ -0,0 +1,303 @@
+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;
+#
+# Generate a big enough master's binlog to cause relay log rotations
+#
+create table t1 (a int);
+drop table t1;
+reset slave;
+#
+# Test 1
+#
+set @my_max_binlog_size= @@global.max_binlog_size;
+set global max_binlog_size=8192;
+set global max_relay_log_size=8192-1;
+select @@global.max_relay_log_size;
+@@global.max_relay_log_size
+4096
+start slave;
+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 72960
+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 72960
+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
+#
+# Test 2
+#
+stop slave;
+reset slave;
+set global max_relay_log_size=(5*4096);
+select @@global.max_relay_log_size;
+@@global.max_relay_log_size 20480
+start slave;
+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 72960
+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 72960
+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
+#
+# Test 3: max_relay_log_size = 0
+#
+stop slave;
+reset slave;
+set global max_relay_log_size=0;
+select @@global.max_relay_log_size;
+@@global.max_relay_log_size 0
+start slave;
+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 72960
+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 72960
+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
+#
+# Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
+#
+stop slave;
+reset slave;
+flush logs;
+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 #
+Last_IO_Error #
+Last_SQL_Errno 0
+Last_SQL_Error
+#
+# Test 5
+#
+reset slave;
+start slave;
+flush logs;
+create table t1 (a 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 73046
+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 73046
+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
+#
+# Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
+#
+flush logs;
+drop table t1;
+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 73122
+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 73122
+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
+flush logs;
+show master status;
+File master-bin.000002
+Position 106
+Binlog_Do_DB <Binlog_Ignore_DB>
+Binlog_Ignore_DB
+set global max_binlog_size= @my_max_binlog_size;
+#
+# End of 4.1 tests
+#
diff --git a/mysql-test/r/rpl_stm_multi_query.result b/mysql-test/suite/rpl/r/rpl_stm_multi_query.result
index 625c686f383..625c686f383 100644
--- a/mysql-test/r/rpl_stm_multi_query.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_multi_query.result
diff --git a/mysql-test/r/rpl_stm_mystery22.result b/mysql-test/suite/rpl/r/rpl_stm_mystery22.result
index ea34b308ec2..ea34b308ec2 100644
--- a/mysql-test/r/rpl_stm_mystery22.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_mystery22.result
diff --git a/mysql-test/r/rpl_stm_no_op.result b/mysql-test/suite/rpl/r/rpl_stm_no_op.result
index 5a253d61fcb..5a253d61fcb 100644
--- a/mysql-test/r/rpl_stm_no_op.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_no_op.result
diff --git a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
new file mode 100644
index 00000000000..d08e8646c73
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
@@ -0,0 +1,176 @@
+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;
+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 106
+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 106
+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
+stop slave;
+change master to master_user='test';
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User test
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos 106
+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 106
+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
+reset slave;
+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 #
+Last_IO_Error #
+Last_SQL_Errno 0
+Last_SQL_Error
+start slave;
+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 106
+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 106
+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
+stop slave;
+reset slave;
+start slave;
+create temporary table t1 (a int);
+stop slave;
+reset slave;
+start slave;
+show status like 'slave_open_temp_tables';
+Variable_name Value
+Slave_open_temp_tables 1
diff --git a/mysql-test/suite/rpl/r/rpl_stm_until.result b/mysql-test/suite/rpl/r/rpl_stm_until.result
new file mode 100644
index 00000000000..947ce0153b1
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_stm_until.result
@@ -0,0 +1,206 @@
+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;
+create table t1(n int not null auto_increment primary key);
+insert into t1 values (1),(2),(3),(4);
+drop table t1;
+create table t2(n int not null auto_increment primary key);
+insert into t2 values (1),(2);
+insert into t2 values (3),(4);
+drop table t2;
+start slave until master_log_file='master-bin.000001', master_log_pos=323;
+select * from t1;
+n
+1
+2
+3
+4
+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 784
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 327
+Relay_Log_Space #
+Until_Condition Master
+Until_Log_File master-bin.000001
+Until_Log_Pos 323
+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
+start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
+select * from t1;
+n
+1
+2
+3
+4
+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 784
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 327
+Relay_Log_Space #
+Until_Condition Master
+Until_Log_File master-no-such-bin.000001
+Until_Log_Pos 291
+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
+start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746;
+select * from t2;
+n
+1
+2
+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 784
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 616
+Relay_Log_Space #
+Until_Condition Relay
+Until_Log_File slave-relay-bin.000004
+Until_Log_Pos 746
+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
+start slave;
+stop slave;
+start slave until master_log_file='master-bin.000001', master_log_pos=776;
+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 784
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 784
+Relay_Log_Space #
+Until_Condition Master
+Until_Log_File master-bin.000001
+Until_Log_Pos 776
+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
+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;
+ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
+start slave until master_log_file='master-bin.000001';
+ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
+start slave until relay_log_file='slave-relay-bin.000002';
+ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
+start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
+ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
+start slave sql_thread;
+start slave until master_log_file='master-bin.000001', master_log_pos=776;
+Warnings:
+Note 1254 Slave is already running
diff --git a/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result b/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result
new file mode 100644
index 00000000000..c3f0c07b92c
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result
@@ -0,0 +1,1017 @@
+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;
+drop database if exists mysqltest1;
+create database mysqltest1;
+use mysqltest1;
+set @my_binlog_format= @@global.binlog_format;
+set session binlog_format=mixed;
+show session variables like "binlog_format%";
+Variable_name Value
+binlog_format MIXED
+set session binlog_format=statement;
+show session variables like "binlog_format%";
+Variable_name Value
+binlog_format STATEMENT
+set session binlog_format=row;
+show session variables like "binlog_format%";
+Variable_name Value
+binlog_format ROW
+set global binlog_format=DEFAULT;
+show global variables like "binlog_format%";
+Variable_name Value
+binlog_format MIXED
+set global binlog_format=MIXED;
+show global variables like "binlog_format%";
+Variable_name Value
+binlog_format MIXED
+set global binlog_format=STATEMENT;
+show global variables like "binlog_format%";
+Variable_name Value
+binlog_format STATEMENT
+set global binlog_format=ROW;
+show global variables like "binlog_format%";
+Variable_name Value
+binlog_format ROW
+show session variables like "binlog_format%";
+Variable_name Value
+binlog_format ROW
+select @@global.binlog_format, @@session.binlog_format;
+@@global.binlog_format @@session.binlog_format
+ROW ROW
+CREATE TABLE t1 (a varchar(100));
+prepare stmt1 from 'insert into t1 select concat(UUID(),?)';
+set @string="emergency_1_";
+insert into t1 values("work_2_");
+execute stmt1 using @string;
+deallocate prepare stmt1;
+prepare stmt1 from 'insert into t1 select ?';
+insert into t1 values(concat(UUID(),"work_3_"));
+execute stmt1 using @string;
+deallocate prepare stmt1;
+insert into t1 values(concat("for_4_",UUID()));
+insert into t1 select "yesterday_5_";
+create temporary table tmp(a char(100));
+insert into tmp values("see_6_");
+set binlog_format=statement;
+ERROR HY000: Cannot switch out of the row-based binary log format when the session has open temporary tables
+insert into t1 select * from tmp;
+drop temporary table tmp;
+set binlog_format=statement;
+show global variables like "binlog_format%";
+Variable_name Value
+binlog_format ROW
+show session variables like "binlog_format%";
+Variable_name Value
+binlog_format STATEMENT
+select @@global.binlog_format, @@session.binlog_format;
+@@global.binlog_format @@session.binlog_format
+ROW STATEMENT
+set global binlog_format=statement;
+show global variables like "binlog_format%";
+Variable_name Value
+binlog_format STATEMENT
+show session variables like "binlog_format%";
+Variable_name Value
+binlog_format STATEMENT
+select @@global.binlog_format, @@session.binlog_format;
+@@global.binlog_format @@session.binlog_format
+STATEMENT STATEMENT
+prepare stmt1 from 'insert into t1 select ?';
+set @string="emergency_7_";
+insert into t1 values("work_8_");
+execute stmt1 using @string;
+deallocate prepare stmt1;
+prepare stmt1 from 'insert into t1 select ?';
+insert into t1 values("work_9_");
+execute stmt1 using @string;
+deallocate prepare stmt1;
+insert into t1 values("for_10_");
+insert into t1 select "yesterday_11_";
+set binlog_format=statement;
+select @@global.binlog_format, @@session.binlog_format;
+@@global.binlog_format @@session.binlog_format
+STATEMENT STATEMENT
+set global binlog_format=statement;
+select @@global.binlog_format, @@session.binlog_format;
+@@global.binlog_format @@session.binlog_format
+STATEMENT STATEMENT
+prepare stmt1 from 'insert into t1 select ?';
+set @string="emergency_12_";
+insert into t1 values("work_13_");
+execute stmt1 using @string;
+deallocate prepare stmt1;
+prepare stmt1 from 'insert into t1 select ?';
+insert into t1 values("work_14_");
+execute stmt1 using @string;
+deallocate prepare stmt1;
+insert into t1 values("for_15_");
+insert into t1 select "yesterday_16_";
+set global binlog_format=mixed;
+select @@global.binlog_format, @@session.binlog_format;
+@@global.binlog_format @@session.binlog_format
+MIXED STATEMENT
+set binlog_format=default;
+select @@global.binlog_format, @@session.binlog_format;
+@@global.binlog_format @@session.binlog_format
+MIXED MIXED
+prepare stmt1 from 'insert into t1 select concat(UUID(),?)';
+set @string="emergency_17_";
+insert into t1 values("work_18_");
+execute stmt1 using @string;
+deallocate prepare stmt1;
+prepare stmt1 from 'insert into t1 select ?';
+insert into t1 values(concat(UUID(),"work_19_"));
+execute stmt1 using @string;
+deallocate prepare stmt1;
+insert into t1 values(concat("for_20_",UUID()));
+insert into t1 select "yesterday_21_";
+prepare stmt1 from 'insert into t1 select ?';
+insert into t1 values(concat(UUID(),"work_22_"));
+execute stmt1 using @string;
+deallocate prepare stmt1;
+insert into t1 values(concat("for_23_",UUID()));
+insert into t1 select "yesterday_24_";
+create table t2 select rpad(UUID(),100,' ');
+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);
+insert into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
+create procedure foo()
+begin
+insert into t1 values("work_25_");
+insert into t1 values(concat("for_26_",UUID()));
+insert into t1 select "yesterday_27_";
+end|
+create procedure foo2()
+begin
+insert into t1 values(concat("emergency_28_",UUID()));
+insert into t1 values("work_29_");
+insert into t1 values(concat("for_30_",UUID()));
+set session binlog_format=row; # accepted for stored procs
+insert into t1 values("more work_31_");
+set session binlog_format=mixed;
+end|
+create function foo3() returns bigint unsigned
+begin
+set session binlog_format=row; # rejected for stored funcs
+insert into t1 values("alarm");
+return 100;
+end|
+create procedure foo4(x varchar(100))
+begin
+insert into t1 values(concat("work_250_",x));
+insert into t1 select "yesterday_270_";
+end|
+call foo();
+call foo2();
+call foo4("hello");
+call foo4(UUID());
+call foo4("world");
+select foo3();
+ERROR HY000: Cannot change the binary logging format inside a stored function or trigger
+select * from t1 where a="alarm";
+a
+drop function foo3;
+create function foo3() returns bigint unsigned
+begin
+insert into t1 values("foo3_32_");
+call foo();
+return 100;
+end|
+insert into t2 select foo3();
+prepare stmt1 from 'insert into t2 select foo3()';
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+create function foo4() returns bigint unsigned
+begin
+insert into t2 select foo3();
+return 100;
+end|
+select foo4();
+foo4()
+100
+prepare stmt1 from 'select foo4()';
+execute stmt1;
+foo4()
+100
+execute stmt1;
+foo4()
+100
+deallocate prepare stmt1;
+create function foo5() returns bigint unsigned
+begin
+insert into t2 select UUID();
+return 100;
+end|
+select foo5();
+foo5()
+100
+prepare stmt1 from 'select foo5()';
+execute stmt1;
+foo5()
+100
+execute stmt1;
+foo5()
+100
+deallocate prepare stmt1;
+create function foo6(x varchar(100)) returns bigint unsigned
+begin
+insert into t2 select x;
+return 100;
+end|
+select foo6("foo6_1_");
+foo6("foo6_1_")
+100
+select foo6(concat("foo6_2_",UUID()));
+foo6(concat("foo6_2_",UUID()))
+100
+prepare stmt1 from 'select foo6(concat("foo6_3_",UUID()))';
+execute stmt1;
+foo6(concat("foo6_3_",UUID()))
+100
+execute stmt1;
+foo6(concat("foo6_3_",UUID()))
+100
+deallocate prepare stmt1;
+create view v1 as select uuid();
+create table t11 (data varchar(255));
+insert into t11 select * from v1;
+insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11');
+prepare stmt1 from "insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11')";
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+create trigger t11_bi before insert on t11 for each row
+begin
+set NEW.data = concat(NEW.data,UUID());
+end|
+insert into t11 values("try_560_");
+insert delayed into t2 values("delay_1_");
+insert delayed into t2 values(concat("delay_2_",UUID()));
+insert delayed into t2 values("delay_6_");
+insert delayed into t2 values(rand());
+set @a=2.345;
+insert delayed into t2 values(@a);
+create table t20 select * from t1;
+create table t21 select * from t2;
+create table t22 select * from t3;
+drop table t1,t2,t3;
+create table t1 (a int primary key auto_increment, b varchar(100));
+create table t2 (a int primary key auto_increment, b varchar(100));
+create table t3 (b varchar(100));
+create function f (x varchar(100)) returns int deterministic
+begin
+insert into t1 values(null,x);
+insert into t2 values(null,x);
+return 1;
+end|
+select f("try_41_");
+f("try_41_")
+1
+use mysqltest1;
+insert into t2 values(2,null),(3,null),(4,null);
+delete from t2 where a>=2;
+select f("try_42_");
+f("try_42_")
+1
+insert into t2 values(3,null),(4,null);
+delete from t2 where a>=3;
+prepare stmt1 from 'select f(?)';
+set @string="try_43_";
+insert into t1 values(null,"try_44_");
+execute stmt1 using @string;
+f(?)
+1
+deallocate prepare stmt1;
+create table t12 select * from t1;
+drop table t1;
+create table t1 (a int, b varchar(100), key(a));
+select f("try_45_");
+f("try_45_")
+1
+create table t13 select * from t1;
+drop table t1;
+create table t1 (a int primary key auto_increment, b varchar(100));
+drop function f;
+create table t14 (unique (a)) select * from t2;
+truncate table t2;
+create function f1 (x varchar(100)) returns int deterministic
+begin
+insert into t1 values(null,x);
+return 1;
+end|
+create function f2 (x varchar(100)) returns int deterministic
+begin
+insert into t2 values(null,x);
+return 1;
+end|
+select f1("try_46_"),f2("try_47_");
+f1("try_46_") f2("try_47_")
+1 1
+insert into t2 values(2,null),(3,null),(4,null);
+delete from t2 where a>=2;
+select f1("try_48_"),f2("try_49_");
+f1("try_48_") f2("try_49_")
+1 1
+insert into t3 values(concat("try_50_",f1("try_51_"),f2("try_52_")));
+drop function f2;
+create function f2 (x varchar(100)) returns int deterministic
+begin
+declare y int;
+insert into t1 values(null,x);
+set y = (select count(*) from t2);
+return y;
+end|
+select f1("try_53_"),f2("try_54_");
+f1("try_53_") f2("try_54_")
+1 3
+drop function f2;
+create trigger t1_bi before insert on t1 for each row
+begin
+insert into t2 values(null,"try_55_");
+end|
+insert into t1 values(null,"try_56_");
+alter table t1 modify a int, drop primary key;
+insert into t1 values(null,"try_57_");
+CREATE TEMPORARY TABLE t15 SELECT UUID();
+create table t16 like t15;
+INSERT INTO t16 SELECT * FROM t15;
+insert into t16 values("try_65_");
+drop table t15;
+insert into t16 values("try_66_");
+select count(*) from t1;
+count(*)
+7
+select count(*) from t2;
+count(*)
+5
+select count(*) from t3;
+count(*)
+1
+select count(*) from t4;
+count(*)
+29
+select count(*) from t5;
+count(*)
+58
+select count(*) from t11;
+count(*)
+8
+select count(*) from t20;
+count(*)
+66
+select count(*) from t21;
+count(*)
+19
+select count(*) from t22;
+count(*)
+2
+select count(*) from t12;
+count(*)
+4
+select count(*) from t13;
+count(*)
+1
+select count(*) from t14;
+count(*)
+4
+select count(*) from t16;
+count(*)
+3
+DROP TABLE IF EXISTS t11;
+SET SESSION BINLOG_FORMAT=STATEMENT;
+CREATE TABLE t11 (song VARCHAR(255));
+LOCK TABLES t11 WRITE;
+SET SESSION BINLOG_FORMAT=ROW;
+INSERT INTO t11 VALUES('Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict');
+SET SESSION BINLOG_FORMAT=STATEMENT;
+INSERT INTO t11 VALUES('Careful With That Axe, Eugene');
+UNLOCK TABLES;
+SELECT * FROM t11;
+song Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict
+song Careful With That Axe, Eugene
+USE mysqltest1;
+SELECT * FROM t11;
+song Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict
+song Careful With That Axe, Eugene
+DROP TABLE IF EXISTS t12;
+SET SESSION BINLOG_FORMAT=MIXED;
+CREATE TABLE t12 (data LONG);
+LOCK TABLES t12 WRITE;
+INSERT INTO t12 VALUES(UUID());
+UNLOCK TABLES;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+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 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_8_")
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select 'emergency_7_'
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_9_")
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select 'emergency_7_'
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("for_10_")
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_11_"
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_13_")
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select 'emergency_12_'
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_14_")
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select 'emergency_12_'
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("for_15_")
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_16_"
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_18_")
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select 'emergency_17_'
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_21_"
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select 'emergency_17_'
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_24_"
+master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t2` (
+ `rpad(UUID(),100,' ')` varchar(100) CHARACTER SET utf8 NOT NULL DEFAULT ''
+)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t3` (
+ `1` varbinary(108) NOT NULL DEFAULT ''
+)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t3)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t4` (
+ `a` varchar(100) DEFAULT NULL
+)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t4)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t5)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo()
+begin
+insert into t1 values("work_25_");
+insert into t1 values(concat("for_26_",UUID()));
+insert into t1 select "yesterday_27_";
+end
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo2()
+begin
+insert into t1 values(concat("emergency_28_",UUID()));
+insert into t1 values("work_29_");
+insert into t1 values(concat("for_30_",UUID()));
+set session binlog_format=row; # accepted for stored procs
+insert into t1 values("more work_31_");
+set session binlog_format=mixed;
+end
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo3() returns bigint unsigned
+begin
+set session binlog_format=row; # rejected for stored funcs
+insert into t1 values("alarm");
+return 100;
+end
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo4(x varchar(100))
+begin
+insert into t1 values(concat("work_250_",x));
+insert into t1 select "yesterday_270_";
+end
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(concat("work_250_", NAME_CONST('x',_latin1'hello')))
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_270_"
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(concat("work_250_", NAME_CONST('x',_latin1'world')))
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_270_"
+master-bin.000001 # Query # # use `mysqltest1`; drop function foo3
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo3() returns bigint unsigned
+begin
+insert into t1 values("foo3_32_");
+call foo();
+return 100;
+end
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo4() returns bigint unsigned
+begin
+insert into t2 select foo3();
+return 100;
+end
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo5() returns bigint unsigned
+begin
+insert into t2 select UUID();
+return 100;
+end
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo6(x varchar(100)) returns bigint unsigned
+begin
+insert into t2 select x;
+return 100;
+end
+master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`foo6`(_latin1'foo6_1_')
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select uuid()
+master-bin.000001 # Query # # use `mysqltest1`; create table t11 (data varchar(255))
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t11)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11')
+master-bin.000001 # Query # # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11')
+master-bin.000001 # Query # # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11')
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t11_bi before insert on t11 for each row
+begin
+set NEW.data = concat(NEW.data,UUID());
+end
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t11)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; create table t20 select * from t1
+master-bin.000001 # Query # # use `mysqltest1`; create table t21 select * from t2
+master-bin.000001 # Query # # use `mysqltest1`; create table t22 select * from t3
+master-bin.000001 # Query # # use `mysqltest1`; drop table t1,t2,t3
+master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100))
+master-bin.000001 # Query # # use `mysqltest1`; create table t2 (a int primary key auto_increment, b varchar(100))
+master-bin.000001 # Query # # use `mysqltest1`; create table t3 (b varchar(100))
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f (x varchar(100)) returns int deterministic
+begin
+insert into t1 values(null,x);
+insert into t2 values(null,x);
+return 1;
+end
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Intvar # # INSERT_ID=3
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(null,"try_44_")
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; create table t12 select * from t1
+master-bin.000001 # Query # # use `mysqltest1`; drop table t1
+master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a int, b varchar(100), key(a))
+master-bin.000001 # Intvar # # INSERT_ID=4
+master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`f`(_latin1'try_45_')
+master-bin.000001 # Query # # use `mysqltest1`; create table t13 select * from t1
+master-bin.000001 # Query # # use `mysqltest1`; drop table t1
+master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100))
+master-bin.000001 # Query # # use `mysqltest1`; drop function f
+master-bin.000001 # Query # # use `mysqltest1`; create table t14 (unique (a)) select * from t2
+master-bin.000001 # Query # # use `mysqltest1`; truncate table t2
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f1 (x varchar(100)) returns int deterministic
+begin
+insert into t1 values(null,x);
+return 1;
+end
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f2 (x varchar(100)) returns int deterministic
+begin
+insert into t2 values(null,x);
+return 1;
+end
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t3)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; drop function f2
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f2 (x varchar(100)) returns int deterministic
+begin
+declare y int;
+insert into t1 values(null,x);
+set y = (select count(*) from t2);
+return y;
+end
+master-bin.000001 # Intvar # # INSERT_ID=4
+master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`f1`(_latin1'try_53_')
+master-bin.000001 # Intvar # # INSERT_ID=5
+master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`f2`(_latin1'try_54_')
+master-bin.000001 # Query # # use `mysqltest1`; drop function f2
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t1_bi before insert on t1 for each row
+begin
+insert into t2 values(null,"try_55_");
+end
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; alter table t1 modify a int, drop primary key
+master-bin.000001 # Intvar # # INSERT_ID=5
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(null,"try_57_")
+master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t16` (
+ `UUID()` varchar(36) CHARACTER SET utf8 NOT NULL DEFAULT ''
+)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t16)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t16)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; insert into t16 values("try_66_")
+master-bin.000001 # Query # # use `mysqltest1`; DROP TABLE IF EXISTS t11
+master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE t11 (song VARCHAR(255))
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t11)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; INSERT INTO t11 VALUES('Careful With That Axe, Eugene')
+master-bin.000001 # Query # # use `mysqltest1`; DROP TABLE IF EXISTS t12
+master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE t12 (data LONG)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t12)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+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 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_8_")
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select 'emergency_7_'
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_9_")
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select 'emergency_7_'
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("for_10_")
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_11_"
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_13_")
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select 'emergency_12_'
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_14_")
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select 'emergency_12_'
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("for_15_")
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_16_"
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_18_")
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select 'emergency_17_'
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_21_"
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select 'emergency_17_'
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_24_"
+master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t2` (
+ `rpad(UUID(),100,' ')` varchar(100) CHARACTER SET utf8 NOT NULL DEFAULT ''
+)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t3` (
+ `1` varbinary(108) NOT NULL DEFAULT ''
+)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t3)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t4` (
+ `a` varchar(100) DEFAULT NULL
+)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t4)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t5)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo()
+begin
+insert into t1 values("work_25_");
+insert into t1 values(concat("for_26_",UUID()));
+insert into t1 select "yesterday_27_";
+end
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo2()
+begin
+insert into t1 values(concat("emergency_28_",UUID()));
+insert into t1 values("work_29_");
+insert into t1 values(concat("for_30_",UUID()));
+set session binlog_format=row; # accepted for stored procs
+insert into t1 values("more work_31_");
+set session binlog_format=mixed;
+end
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo3() returns bigint unsigned
+begin
+set session binlog_format=row; # rejected for stored funcs
+insert into t1 values("alarm");
+return 100;
+end
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo4(x varchar(100))
+begin
+insert into t1 values(concat("work_250_",x));
+insert into t1 select "yesterday_270_";
+end
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(concat("work_250_", NAME_CONST('x',_latin1'hello')))
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_270_"
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(concat("work_250_", NAME_CONST('x',_latin1'world')))
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_270_"
+master-bin.000001 # Query # # use `mysqltest1`; drop function foo3
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo3() returns bigint unsigned
+begin
+insert into t1 values("foo3_32_");
+call foo();
+return 100;
+end
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo4() returns bigint unsigned
+begin
+insert into t2 select foo3();
+return 100;
+end
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo5() returns bigint unsigned
+begin
+insert into t2 select UUID();
+return 100;
+end
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo6(x varchar(100)) returns bigint unsigned
+begin
+insert into t2 select x;
+return 100;
+end
+master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`foo6`(_latin1'foo6_1_')
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select uuid()
+master-bin.000001 # Query # # use `mysqltest1`; create table t11 (data varchar(255))
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t11)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11')
+master-bin.000001 # Query # # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11')
+master-bin.000001 # Query # # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11')
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t11_bi before insert on t11 for each row
+begin
+set NEW.data = concat(NEW.data,UUID());
+end
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t11)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; create table t20 select * from t1
+master-bin.000001 # Query # # use `mysqltest1`; create table t21 select * from t2
+master-bin.000001 # Query # # use `mysqltest1`; create table t22 select * from t3
+master-bin.000001 # Query # # use `mysqltest1`; drop table t1,t2,t3
+master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100))
+master-bin.000001 # Query # # use `mysqltest1`; create table t2 (a int primary key auto_increment, b varchar(100))
+master-bin.000001 # Query # # use `mysqltest1`; create table t3 (b varchar(100))
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f (x varchar(100)) returns int deterministic
+begin
+insert into t1 values(null,x);
+insert into t2 values(null,x);
+return 1;
+end
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Intvar # # INSERT_ID=3
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(null,"try_44_")
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; create table t12 select * from t1
+master-bin.000001 # Query # # use `mysqltest1`; drop table t1
+master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a int, b varchar(100), key(a))
+master-bin.000001 # Intvar # # INSERT_ID=4
+master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`f`(_latin1'try_45_')
+master-bin.000001 # Query # # use `mysqltest1`; create table t13 select * from t1
+master-bin.000001 # Query # # use `mysqltest1`; drop table t1
+master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100))
+master-bin.000001 # Query # # use `mysqltest1`; drop function f
+master-bin.000001 # Query # # use `mysqltest1`; create table t14 (unique (a)) select * from t2
+master-bin.000001 # Query # # use `mysqltest1`; truncate table t2
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f1 (x varchar(100)) returns int deterministic
+begin
+insert into t1 values(null,x);
+return 1;
+end
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f2 (x varchar(100)) returns int deterministic
+begin
+insert into t2 values(null,x);
+return 1;
+end
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t3)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; drop function f2
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f2 (x varchar(100)) returns int deterministic
+begin
+declare y int;
+insert into t1 values(null,x);
+set y = (select count(*) from t2);
+return y;
+end
+master-bin.000001 # Intvar # # INSERT_ID=4
+master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`f1`(_latin1'try_53_')
+master-bin.000001 # Intvar # # INSERT_ID=5
+master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`f2`(_latin1'try_54_')
+master-bin.000001 # Query # # use `mysqltest1`; drop function f2
+master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t1_bi before insert on t1 for each row
+begin
+insert into t2 values(null,"try_55_");
+end
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; alter table t1 modify a int, drop primary key
+master-bin.000001 # Intvar # # INSERT_ID=5
+master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(null,"try_57_")
+master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t16` (
+ `UUID()` varchar(36) CHARACTER SET utf8 NOT NULL DEFAULT ''
+)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t16)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t16)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; insert into t16 values("try_66_")
+master-bin.000001 # Query # # use `mysqltest1`; DROP TABLE IF EXISTS t11
+master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE t11 (song VARCHAR(255))
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t11)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `mysqltest1`; INSERT INTO t11 VALUES('Careful With That Axe, Eugene')
+master-bin.000001 # Query # # use `mysqltest1`; DROP TABLE IF EXISTS t12
+master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE t12 (data LONG)
+master-bin.000001 # Table_map # # table_id: # (mysqltest1.t12)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+drop database mysqltest1;
+set global binlog_format =@my_binlog_format;
diff --git a/mysql-test/r/rpl_temp_table.result b/mysql-test/suite/rpl/r/rpl_temp_table.result
index e4ca31d8908..e4ca31d8908 100644
--- a/mysql-test/r/rpl_temp_table.result
+++ b/mysql-test/suite/rpl/r/rpl_temp_table.result
diff --git a/mysql-test/r/rpl_temporary.result b/mysql-test/suite/rpl/r/rpl_temporary.result
index 7e7d0cebe1d..7e7d0cebe1d 100644
--- a/mysql-test/r/rpl_temporary.result
+++ b/mysql-test/suite/rpl/r/rpl_temporary.result
diff --git a/mysql-test/suite/rpl/r/rpl_timezone.result b/mysql-test/suite/rpl/r/rpl_timezone.result
new file mode 100644
index 00000000000..cd71dbe628e
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_timezone.result
@@ -0,0 +1,125 @@
+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;
+set @my_time_zone= @@global.time_zone;
+set timestamp=100000000;
+create table t1 (t timestamp, n int not null auto_increment, PRIMARY KEY(n));
+create table t2 (t char(32), n int not null auto_increment, PRIMARY KEY(n));
+select @@time_zone;
+@@time_zone
+Japan
+select @@time_zone;
+@@time_zone
+Europe/Moscow
+insert into t1 values ('20050101000000', NULL), ('20050611093902',NULL);
+insert into t1 values ('20040101000000',NULL), ('20040611093902',NULL);
+SELECT * FROM t1 ORDER BY n;
+t n
+2005-01-01 00:00:00 1
+2005-06-11 09:39:02 2
+2004-01-01 00:00:00 3
+2004-06-11 09:39:02 4
+SELECT * FROM t1 ORDER BY n;
+t n
+2005-01-01 06:00:00 1
+2005-06-11 14:39:02 2
+2004-01-01 06:00:00 3
+2004-06-11 14:39:02 4
+delete from t1;
+set time_zone='Europe/Moscow';
+insert into t1 values ('20040101000000',NULL), ('20040611093902',NULL);
+SELECT * FROM t1 ORDER BY n;
+t n
+2004-01-01 00:00:00 5
+2004-06-11 09:39:02 6
+set time_zone='Europe/Moscow';
+SELECT * FROM t1 ORDER BY n;
+t n
+2004-01-01 00:00:00 5
+2004-06-11 09:39:02 6
+delete from t1;
+set time_zone='UTC';
+load data infile '../std_data_ln/rpl_timezone2.dat' into table t1;
+Warnings:
+Warning 1265 Data truncated for column 't' at row 1
+Warning 1261 Row 1 doesn't contain data for all columns
+Warning 1265 Data truncated for column 't' at row 2
+Warning 1261 Row 2 doesn't contain data for all columns
+SELECT * FROM t1 ORDER BY n;
+t n
+0000-00-00 00:00:00 7
+0000-00-00 00:00:00 8
+set time_zone='UTC';
+SELECT * FROM t1 ORDER BY n;
+t n
+0000-00-00 00:00:00 7
+0000-00-00 00:00:00 8
+set time_zone='Europe/Moscow';
+set time_zone='Europe/Moscow';
+delete from t1;
+insert into t1 values ('20040101000000',NULL), ('20040611093902',NULL);
+set time_zone='MET';
+insert into t2 (select * from t1);
+SELECT * FROM t1 ORDER BY n;
+t n
+2003-12-31 22:00:00 9
+2004-06-11 07:39:02 10
+SELECT * FROM t2 ORDER BY n;
+t n
+2003-12-31 22:00:00 9
+2004-06-11 07:39:02 10
+delete from t2;
+set timestamp=1000072000;
+insert into t2 values (current_timestamp,NULL), (current_date,NULL), (current_time,NULL);
+SELECT * FROM t2 ORDER BY n;
+t n
+2001-09-09 23:46:40 11
+2001-09-09 12
+23:46:40 13
+delete from t2;
+insert into t2 values (from_unixtime(1000000000),NULL),
+(unix_timestamp('2001-09-09 03:46:40'),NULL);
+SELECT * FROM t2 ORDER BY n;
+t n
+2001-09-09 03:46:40 14
+1000000000 15
+SELECT * FROM t2 ORDER BY n;
+t n
+2001-09-09 03:46:40 14
+1000000000 15
+set global time_zone='MET';
+delete from t2;
+set time_zone='UTC';
+insert into t2 values(convert_tz('2004-01-01 00:00:00','MET',@@time_zone),NULL);
+insert into t2 values(convert_tz('2005-01-01 00:00:00','MET','Japan'),NULL);
+SELECT * FROM t2 ORDER BY n;
+t n
+2003-12-31 23:00:00 16
+2005-01-01 08:00:00 17
+SELECT * FROM t2 ORDER BY n;
+t n
+2003-12-31 23:00:00 16
+2005-01-01 08:00:00 17
+drop table t1, t2;
+set global time_zone= @my_time_zone;
+End of 4.1 tests
+CREATE TABLE t1 (a INT, b TIMESTAMP);
+INSERT INTO t1 VALUES (1, NOW());
+SET @@session.time_zone='Japan';
+UPDATE t1 SET b= '1970-01-01 08:59:59' WHERE a= 1;
+Warnings:
+Warning 1264 Out of range value for column 'b' at row 1
+SELECT * FROM t1 ORDER BY a;
+a b
+1 0000-00-00 00:00:00
+SET @@session.time_zone='Japan';
+SELECT * FROM t1 ORDER BY a;
+a b
+1 0000-00-00 00:00:00
+SET @@session.time_zone = default;
+DROP TABLE t1;
+SET @@session.time_zone = default;
+End of 5.0 tests
diff --git a/mysql-test/suite/rpl/r/rpl_trigger.result b/mysql-test/suite/rpl/r/rpl_trigger.result
new file mode 100644
index 00000000000..b4ce3ee1d36
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_trigger.result
@@ -0,0 +1,973 @@
+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;
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+create table t1 (a int auto_increment, primary key (a), b int, rand_value double not null);
+create table t2 (a int auto_increment, primary key (a), b int);
+create table t3 (a int auto_increment, primary key (a), name varchar(64) not null, old_a int, old_b int, rand_value double not null);
+create trigger t1 before insert on t1 for each row
+begin
+insert into t3 values (NULL, "t1", new.a, new.b, rand());
+end|
+create trigger t2 after insert on t2 for each row
+begin
+insert into t3 values (NULL, "t2", new.a, new.b, rand());
+end|
+insert into t3 values(100,"log",0,0,0);
+SET @@RAND_SEED1=658490765, @@RAND_SEED2=635893186;
+insert into t1 values(1,1,rand()),(NULL,2,rand());
+insert into t2 (b) values(last_insert_id());
+insert into t2 values(3,0),(NULL,0);
+insert into t2 values(NULL,0),(500,0);
+select a,b, truncate(rand_value,4) from t1;
+a b truncate(rand_value,4)
+1 1 0.4320
+2 2 0.3055
+select * from t2;
+a b
+1 2
+3 0
+4 0
+5 0
+500 0
+select a,name, old_a, old_b, truncate(rand_value,4) from t3;
+a name old_a old_b truncate(rand_value,4)
+100 log 0 0 0.0000
+101 t1 1 1 0.3203
+102 t1 0 2 0.5666
+103 t2 1 2 0.9164
+104 t2 3 0 0.8826
+105 t2 4 0 0.6635
+106 t2 5 0 0.6699
+107 t2 500 0 0.3593
+
+--- On slave --
+select a,b, truncate(rand_value,4) from t1;
+a b truncate(rand_value,4)
+1 1 0.4320
+2 2 0.3055
+select * from t2;
+a b
+1 2
+3 0
+4 0
+5 0
+500 0
+select a,name, old_a, old_b, truncate(rand_value,4) from t3;
+a name old_a old_b truncate(rand_value,4)
+100 log 0 0 0.0000
+101 t1 1 1 0.3203
+102 t1 0 2 0.5666
+103 t2 1 2 0.9164
+104 t2 3 0 0.8826
+105 t2 4 0 0.6635
+106 t2 5 0 0.6699
+107 t2 500 0 0.3593
+drop table t1,t2,t3;
+select get_lock("bug12480",2);
+get_lock("bug12480",2)
+1
+create table t1 (a datetime,b datetime, c datetime);
+drop function if exists bug12480;
+create function bug12480() returns datetime
+begin
+set @a=get_lock("bug12480",2);
+return now();
+end|
+create trigger t1_first before insert on t1
+for each row begin
+set @a=get_lock("bug12480",2);
+set new.b= now();
+set new.c= bug12480();
+end
+|
+insert into t1 set a = now();
+select a=b && a=c from t1;
+a=b && a=c
+1
+SELECT routine_name, definer
+FROM information_schema.routines;
+routine_name definer
+bug12480 root@localhost
+SELECT trigger_name, definer
+FROM information_schema.triggers;
+trigger_name definer
+t1_first root@localhost
+
+--- On slave --
+SELECT routine_name, definer
+FROM information_schema.routines;
+routine_name definer
+bug12480 root@localhost
+SELECT trigger_name, definer
+FROM information_schema.triggers;
+trigger_name definer
+t1_first root@localhost
+select a=b && a=c from t1;
+a=b && a=c
+1
+test
+1
+truncate table t1;
+drop trigger t1_first;
+insert into t1 values ("2003-03-03","2003-03-03","2003-03-03"),(bug12480(),bug12480(),bug12480()),(now(),now(),now());
+select a=b && a=c from t1;
+a=b && a=c
+1
+1
+1
+drop function bug12480;
+drop table t1;
+create table t1 (i int);
+create table t2 (i int);
+create trigger tr1 before insert on t1 for each row
+begin
+insert into t2 values (1);
+end|
+create database other;
+use other;
+insert into test.t1 values (1);
+use test;
+drop table t1,t2;
+drop database other;
+test case for BUG#13227
+-------------------
+10
+-------------------
+drop table if exists t110;
+drop table if exists t210,t310;
+create table t110 (f1 int) /* 2 replicate */;
+insert into t110 values (-5);
+insert into t110 values (-4);
+insert into t110 values (-3);
+insert into t110 values (-2);
+insert into t110 values (-1);
+select * from t110;
+f1
+-5
+-4
+-3
+-2
+-1
+create trigger trg110 before update on t110 /* slave local */
+for each row
+begin
+DECLARE r integer;
+SELECT f2 INTO r FROM t210 where f1=NEW.f1;
+INSERT INTO t310 values (r);
+end|
+create table t210 (f1 int, f2 int) /* slave local */;
+create table t310 (f3 int) /* slave local */;
+insert into t210 values (5, 5*100);
+insert into t210 values (4, 4*100);
+insert into t210 values (3, 3*100);
+insert into t210 values (2, 2*100);
+insert into t210 values (1, 1*100);
+select * from t210;
+f1 f2
+5 500
+4 400
+3 300
+2 200
+1 100
+UPDATE t110 SET f1=5 where f1=-5;
+SELECT * from t110 /* must be f1 5, 1 - 5 2 - 5 ... -1 */;
+f1
+5
+-4
+-3
+-2
+-1
+SELECT * from t310 /* must be f3 5*100 */;
+f3
+500
+UPDATE t110 SET f1=5 where f1=-5;
+UPDATE t110 SET f1=4 where f1=-4;
+UPDATE t110 SET f1=3 where f1=-3;
+UPDATE t110 SET f1=2 where f1=-2;
+UPDATE t110 SET f1=1 where f1=-1;
+SELECT * from t110 /* must be f1 5 ... 1 */;
+f1
+5
+4
+3
+2
+1
+SELECT * from t310 /* must be f3 5 * 100 ... 100 */;
+f3
+500
+400
+300
+200
+100
+drop trigger trg110;
+drop table t210,t310;
+drop table t110;
+-------------------
+9
+-------------------
+drop table if exists t19;
+drop table if exists t29,t39;
+create table t19 (f1 int) /* 2 replicate */;
+insert into t19 values (-5);
+insert into t19 values (-4);
+insert into t19 values (-3);
+insert into t19 values (-2);
+insert into t19 values (-1);
+select * from t19;
+f1
+-5
+-4
+-3
+-2
+-1
+create trigger trg19 before update on t19 /* slave local */
+for each row
+begin
+DECLARE r integer;
+SELECT f2 INTO r FROM t29 where f1=NEW.f1;
+INSERT INTO t39 values (r);
+end|
+create table t29 (f1 int, f2 int) /* slave local */;
+create table t39 (f3 int) /* slave local */;
+insert into t29 values (5, 5*100);
+insert into t29 values (4, 4*100);
+insert into t29 values (3, 3*100);
+insert into t29 values (2, 2*100);
+insert into t29 values (1, 1*100);
+select * from t29;
+f1 f2
+5 500
+4 400
+3 300
+2 200
+1 100
+UPDATE t19 SET f1=5 where f1=-5;
+SELECT * from t19 /* must be f1 5, 1 - 5 2 - 5 ... -1 */;
+f1
+5
+-4
+-3
+-2
+-1
+SELECT * from t39 /* must be f3 5*100 */;
+f3
+500
+UPDATE t19 SET f1=5 where f1=-5;
+UPDATE t19 SET f1=4 where f1=-4;
+UPDATE t19 SET f1=3 where f1=-3;
+UPDATE t19 SET f1=2 where f1=-2;
+UPDATE t19 SET f1=1 where f1=-1;
+SELECT * from t19 /* must be f1 5 ... 1 */;
+f1
+5
+4
+3
+2
+1
+SELECT * from t39 /* must be f3 5 * 100 ... 100 */;
+f3
+500
+400
+300
+200
+100
+drop trigger trg19;
+drop table t29,t39;
+drop table t19;
+-------------------
+8
+-------------------
+drop table if exists t18;
+drop table if exists t28,t38;
+create table t18 (f1 int) /* 2 replicate */;
+insert into t18 values (-5);
+insert into t18 values (-4);
+insert into t18 values (-3);
+insert into t18 values (-2);
+insert into t18 values (-1);
+select * from t18;
+f1
+-5
+-4
+-3
+-2
+-1
+create trigger trg18 before update on t18 /* slave local */
+for each row
+begin
+DECLARE r integer;
+SELECT f2 INTO r FROM t28 where f1=NEW.f1;
+INSERT INTO t38 values (r);
+end|
+create table t28 (f1 int, f2 int) /* slave local */;
+create table t38 (f3 int) /* slave local */;
+insert into t28 values (5, 5*100);
+insert into t28 values (4, 4*100);
+insert into t28 values (3, 3*100);
+insert into t28 values (2, 2*100);
+insert into t28 values (1, 1*100);
+select * from t28;
+f1 f2
+5 500
+4 400
+3 300
+2 200
+1 100
+UPDATE t18 SET f1=5 where f1=-5;
+SELECT * from t18 /* must be f1 5, 1 - 5 2 - 5 ... -1 */;
+f1
+5
+-4
+-3
+-2
+-1
+SELECT * from t38 /* must be f3 5*100 */;
+f3
+500
+UPDATE t18 SET f1=5 where f1=-5;
+UPDATE t18 SET f1=4 where f1=-4;
+UPDATE t18 SET f1=3 where f1=-3;
+UPDATE t18 SET f1=2 where f1=-2;
+UPDATE t18 SET f1=1 where f1=-1;
+SELECT * from t18 /* must be f1 5 ... 1 */;
+f1
+5
+4
+3
+2
+1
+SELECT * from t38 /* must be f3 5 * 100 ... 100 */;
+f3
+500
+400
+300
+200
+100
+drop trigger trg18;
+drop table t28,t38;
+drop table t18;
+-------------------
+7
+-------------------
+drop table if exists t17;
+drop table if exists t27,t37;
+create table t17 (f1 int) /* 2 replicate */;
+insert into t17 values (-5);
+insert into t17 values (-4);
+insert into t17 values (-3);
+insert into t17 values (-2);
+insert into t17 values (-1);
+select * from t17;
+f1
+-5
+-4
+-3
+-2
+-1
+create trigger trg17 before update on t17 /* slave local */
+for each row
+begin
+DECLARE r integer;
+SELECT f2 INTO r FROM t27 where f1=NEW.f1;
+INSERT INTO t37 values (r);
+end|
+create table t27 (f1 int, f2 int) /* slave local */;
+create table t37 (f3 int) /* slave local */;
+insert into t27 values (5, 5*100);
+insert into t27 values (4, 4*100);
+insert into t27 values (3, 3*100);
+insert into t27 values (2, 2*100);
+insert into t27 values (1, 1*100);
+select * from t27;
+f1 f2
+5 500
+4 400
+3 300
+2 200
+1 100
+UPDATE t17 SET f1=5 where f1=-5;
+SELECT * from t17 /* must be f1 5, 1 - 5 2 - 5 ... -1 */;
+f1
+5
+-4
+-3
+-2
+-1
+SELECT * from t37 /* must be f3 5*100 */;
+f3
+500
+UPDATE t17 SET f1=5 where f1=-5;
+UPDATE t17 SET f1=4 where f1=-4;
+UPDATE t17 SET f1=3 where f1=-3;
+UPDATE t17 SET f1=2 where f1=-2;
+UPDATE t17 SET f1=1 where f1=-1;
+SELECT * from t17 /* must be f1 5 ... 1 */;
+f1
+5
+4
+3
+2
+1
+SELECT * from t37 /* must be f3 5 * 100 ... 100 */;
+f3
+500
+400
+300
+200
+100
+drop trigger trg17;
+drop table t27,t37;
+drop table t17;
+-------------------
+6
+-------------------
+drop table if exists t16;
+drop table if exists t26,t36;
+create table t16 (f1 int) /* 2 replicate */;
+insert into t16 values (-5);
+insert into t16 values (-4);
+insert into t16 values (-3);
+insert into t16 values (-2);
+insert into t16 values (-1);
+select * from t16;
+f1
+-5
+-4
+-3
+-2
+-1
+create trigger trg16 before update on t16 /* slave local */
+for each row
+begin
+DECLARE r integer;
+SELECT f2 INTO r FROM t26 where f1=NEW.f1;
+INSERT INTO t36 values (r);
+end|
+create table t26 (f1 int, f2 int) /* slave local */;
+create table t36 (f3 int) /* slave local */;
+insert into t26 values (5, 5*100);
+insert into t26 values (4, 4*100);
+insert into t26 values (3, 3*100);
+insert into t26 values (2, 2*100);
+insert into t26 values (1, 1*100);
+select * from t26;
+f1 f2
+5 500
+4 400
+3 300
+2 200
+1 100
+UPDATE t16 SET f1=5 where f1=-5;
+SELECT * from t16 /* must be f1 5, 1 - 5 2 - 5 ... -1 */;
+f1
+5
+-4
+-3
+-2
+-1
+SELECT * from t36 /* must be f3 5*100 */;
+f3
+500
+UPDATE t16 SET f1=5 where f1=-5;
+UPDATE t16 SET f1=4 where f1=-4;
+UPDATE t16 SET f1=3 where f1=-3;
+UPDATE t16 SET f1=2 where f1=-2;
+UPDATE t16 SET f1=1 where f1=-1;
+SELECT * from t16 /* must be f1 5 ... 1 */;
+f1
+5
+4
+3
+2
+1
+SELECT * from t36 /* must be f3 5 * 100 ... 100 */;
+f3
+500
+400
+300
+200
+100
+drop trigger trg16;
+drop table t26,t36;
+drop table t16;
+-------------------
+5
+-------------------
+drop table if exists t15;
+drop table if exists t25,t35;
+create table t15 (f1 int) /* 2 replicate */;
+insert into t15 values (-5);
+insert into t15 values (-4);
+insert into t15 values (-3);
+insert into t15 values (-2);
+insert into t15 values (-1);
+select * from t15;
+f1
+-5
+-4
+-3
+-2
+-1
+create trigger trg15 before update on t15 /* slave local */
+for each row
+begin
+DECLARE r integer;
+SELECT f2 INTO r FROM t25 where f1=NEW.f1;
+INSERT INTO t35 values (r);
+end|
+create table t25 (f1 int, f2 int) /* slave local */;
+create table t35 (f3 int) /* slave local */;
+insert into t25 values (5, 5*100);
+insert into t25 values (4, 4*100);
+insert into t25 values (3, 3*100);
+insert into t25 values (2, 2*100);
+insert into t25 values (1, 1*100);
+select * from t25;
+f1 f2
+5 500
+4 400
+3 300
+2 200
+1 100
+UPDATE t15 SET f1=5 where f1=-5;
+SELECT * from t15 /* must be f1 5, 1 - 5 2 - 5 ... -1 */;
+f1
+5
+-4
+-3
+-2
+-1
+SELECT * from t35 /* must be f3 5*100 */;
+f3
+500
+UPDATE t15 SET f1=5 where f1=-5;
+UPDATE t15 SET f1=4 where f1=-4;
+UPDATE t15 SET f1=3 where f1=-3;
+UPDATE t15 SET f1=2 where f1=-2;
+UPDATE t15 SET f1=1 where f1=-1;
+SELECT * from t15 /* must be f1 5 ... 1 */;
+f1
+5
+4
+3
+2
+1
+SELECT * from t35 /* must be f3 5 * 100 ... 100 */;
+f3
+500
+400
+300
+200
+100
+drop trigger trg15;
+drop table t25,t35;
+drop table t15;
+-------------------
+4
+-------------------
+drop table if exists t14;
+drop table if exists t24,t34;
+create table t14 (f1 int) /* 2 replicate */;
+insert into t14 values (-5);
+insert into t14 values (-4);
+insert into t14 values (-3);
+insert into t14 values (-2);
+insert into t14 values (-1);
+select * from t14;
+f1
+-5
+-4
+-3
+-2
+-1
+create trigger trg14 before update on t14 /* slave local */
+for each row
+begin
+DECLARE r integer;
+SELECT f2 INTO r FROM t24 where f1=NEW.f1;
+INSERT INTO t34 values (r);
+end|
+create table t24 (f1 int, f2 int) /* slave local */;
+create table t34 (f3 int) /* slave local */;
+insert into t24 values (5, 5*100);
+insert into t24 values (4, 4*100);
+insert into t24 values (3, 3*100);
+insert into t24 values (2, 2*100);
+insert into t24 values (1, 1*100);
+select * from t24;
+f1 f2
+5 500
+4 400
+3 300
+2 200
+1 100
+UPDATE t14 SET f1=5 where f1=-5;
+SELECT * from t14 /* must be f1 5, 1 - 5 2 - 5 ... -1 */;
+f1
+5
+-4
+-3
+-2
+-1
+SELECT * from t34 /* must be f3 5*100 */;
+f3
+500
+UPDATE t14 SET f1=5 where f1=-5;
+UPDATE t14 SET f1=4 where f1=-4;
+UPDATE t14 SET f1=3 where f1=-3;
+UPDATE t14 SET f1=2 where f1=-2;
+UPDATE t14 SET f1=1 where f1=-1;
+SELECT * from t14 /* must be f1 5 ... 1 */;
+f1
+5
+4
+3
+2
+1
+SELECT * from t34 /* must be f3 5 * 100 ... 100 */;
+f3
+500
+400
+300
+200
+100
+drop trigger trg14;
+drop table t24,t34;
+drop table t14;
+-------------------
+3
+-------------------
+drop table if exists t13;
+drop table if exists t23,t33;
+create table t13 (f1 int) /* 2 replicate */;
+insert into t13 values (-5);
+insert into t13 values (-4);
+insert into t13 values (-3);
+insert into t13 values (-2);
+insert into t13 values (-1);
+select * from t13;
+f1
+-5
+-4
+-3
+-2
+-1
+create trigger trg13 before update on t13 /* slave local */
+for each row
+begin
+DECLARE r integer;
+SELECT f2 INTO r FROM t23 where f1=NEW.f1;
+INSERT INTO t33 values (r);
+end|
+create table t23 (f1 int, f2 int) /* slave local */;
+create table t33 (f3 int) /* slave local */;
+insert into t23 values (5, 5*100);
+insert into t23 values (4, 4*100);
+insert into t23 values (3, 3*100);
+insert into t23 values (2, 2*100);
+insert into t23 values (1, 1*100);
+select * from t23;
+f1 f2
+5 500
+4 400
+3 300
+2 200
+1 100
+UPDATE t13 SET f1=5 where f1=-5;
+SELECT * from t13 /* must be f1 5, 1 - 5 2 - 5 ... -1 */;
+f1
+5
+-4
+-3
+-2
+-1
+SELECT * from t33 /* must be f3 5*100 */;
+f3
+500
+UPDATE t13 SET f1=5 where f1=-5;
+UPDATE t13 SET f1=4 where f1=-4;
+UPDATE t13 SET f1=3 where f1=-3;
+UPDATE t13 SET f1=2 where f1=-2;
+UPDATE t13 SET f1=1 where f1=-1;
+SELECT * from t13 /* must be f1 5 ... 1 */;
+f1
+5
+4
+3
+2
+1
+SELECT * from t33 /* must be f3 5 * 100 ... 100 */;
+f3
+500
+400
+300
+200
+100
+drop trigger trg13;
+drop table t23,t33;
+drop table t13;
+-------------------
+2
+-------------------
+drop table if exists t12;
+drop table if exists t22,t32;
+create table t12 (f1 int) /* 2 replicate */;
+insert into t12 values (-5);
+insert into t12 values (-4);
+insert into t12 values (-3);
+insert into t12 values (-2);
+insert into t12 values (-1);
+select * from t12;
+f1
+-5
+-4
+-3
+-2
+-1
+create trigger trg12 before update on t12 /* slave local */
+for each row
+begin
+DECLARE r integer;
+SELECT f2 INTO r FROM t22 where f1=NEW.f1;
+INSERT INTO t32 values (r);
+end|
+create table t22 (f1 int, f2 int) /* slave local */;
+create table t32 (f3 int) /* slave local */;
+insert into t22 values (5, 5*100);
+insert into t22 values (4, 4*100);
+insert into t22 values (3, 3*100);
+insert into t22 values (2, 2*100);
+insert into t22 values (1, 1*100);
+select * from t22;
+f1 f2
+5 500
+4 400
+3 300
+2 200
+1 100
+UPDATE t12 SET f1=5 where f1=-5;
+SELECT * from t12 /* must be f1 5, 1 - 5 2 - 5 ... -1 */;
+f1
+5
+-4
+-3
+-2
+-1
+SELECT * from t32 /* must be f3 5*100 */;
+f3
+500
+UPDATE t12 SET f1=5 where f1=-5;
+UPDATE t12 SET f1=4 where f1=-4;
+UPDATE t12 SET f1=3 where f1=-3;
+UPDATE t12 SET f1=2 where f1=-2;
+UPDATE t12 SET f1=1 where f1=-1;
+SELECT * from t12 /* must be f1 5 ... 1 */;
+f1
+5
+4
+3
+2
+1
+SELECT * from t32 /* must be f3 5 * 100 ... 100 */;
+f3
+500
+400
+300
+200
+100
+drop trigger trg12;
+drop table t22,t32;
+drop table t12;
+-------------------
+1
+-------------------
+drop table if exists t11;
+drop table if exists t21,t31;
+create table t11 (f1 int) /* 2 replicate */;
+insert into t11 values (-5);
+insert into t11 values (-4);
+insert into t11 values (-3);
+insert into t11 values (-2);
+insert into t11 values (-1);
+select * from t11;
+f1
+-5
+-4
+-3
+-2
+-1
+create trigger trg11 before update on t11 /* slave local */
+for each row
+begin
+DECLARE r integer;
+SELECT f2 INTO r FROM t21 where f1=NEW.f1;
+INSERT INTO t31 values (r);
+end|
+create table t21 (f1 int, f2 int) /* slave local */;
+create table t31 (f3 int) /* slave local */;
+insert into t21 values (5, 5*100);
+insert into t21 values (4, 4*100);
+insert into t21 values (3, 3*100);
+insert into t21 values (2, 2*100);
+insert into t21 values (1, 1*100);
+select * from t21;
+f1 f2
+5 500
+4 400
+3 300
+2 200
+1 100
+UPDATE t11 SET f1=5 where f1=-5;
+SELECT * from t11 /* must be f1 5, 1 - 5 2 - 5 ... -1 */;
+f1
+5
+-4
+-3
+-2
+-1
+SELECT * from t31 /* must be f3 5*100 */;
+f3
+500
+UPDATE t11 SET f1=5 where f1=-5;
+UPDATE t11 SET f1=4 where f1=-4;
+UPDATE t11 SET f1=3 where f1=-3;
+UPDATE t11 SET f1=2 where f1=-2;
+UPDATE t11 SET f1=1 where f1=-1;
+SELECT * from t11 /* must be f1 5 ... 1 */;
+f1
+5
+4
+3
+2
+1
+SELECT * from t31 /* must be f3 5 * 100 ... 100 */;
+f3
+500
+400
+300
+200
+100
+drop trigger trg11;
+drop table t21,t31;
+drop table t11;
+STOP SLAVE;
+FLUSH LOGS;
+RESET SLAVE;
+START SLAVE;
+SELECT MASTER_POS_WAIT('master-bin.000001', 513) >= 0;
+MASTER_POS_WAIT('master-bin.000001', 513) >= 0
+1
+SHOW TABLES LIKE 't_';
+Tables_in_test (t_)
+t1
+t2
+SHOW TRIGGERS;
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+trg1 INSERT t1 INSERT INTO t2 VALUES(CURRENT_USER()) AFTER NULL latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT * FROM t1;
+c
+1
+SELECT * FROM t2;
+s
+@
+INSERT INTO t1 VALUES(2);
+SELECT * FROM t1;
+c
+1
+2
+SELECT * FROM t2;
+s
+@
+root@localhost
+DROP TRIGGER trg1;
+Warnings:
+Warning 1454 No definer attribute for trigger 'test'.'trg1'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger.
+DROP TABLE t1;
+DROP TABLE t2;
+STOP SLAVE;
+RESET SLAVE;
+SHOW TABLES LIKE 't_';
+Tables_in_test (t_)
+SHOW TRIGGERS;
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+RESET MASTER;
+START SLAVE;
+
+---> Test for BUG#20438
+
+---> Preparing environment...
+---> connection: master
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+
+---> Synchronizing slave with master...
+
+---> connection: master
+
+---> Creating objects...
+CREATE TABLE t1(c INT);
+CREATE TABLE t2(c INT);
+/*!50003 CREATE TRIGGER t1_bi BEFORE INSERT ON t1
+FOR EACH ROW
+INSERT INTO t2 VALUES(NEW.c * 10) */;
+
+---> Inserting value...
+INSERT INTO t1 VALUES(1);
+
+---> Checking on master...
+SELECT * FROM t1;
+c
+1
+SELECT * FROM t2;
+c
+10
+
+---> Synchronizing slave with master...
+---> connection: master
+
+---> Checking on slave...
+SELECT * FROM t1;
+c
+1
+SELECT * FROM t2;
+c
+10
+
+---> connection: master
+
+---> Cleaning up...
+DROP TABLE t1;
+DROP TABLE t2;
+drop table if exists t1;
+create table t1(a int, b varchar(50));
+drop trigger not_a_trigger;
+ERROR HY000: Trigger does not exist
+drop trigger if exists not_a_trigger;
+Warnings:
+Note 1360 Trigger does not exist
+create trigger t1_bi before insert on t1
+for each row set NEW.b := "In trigger t1_bi";
+insert into t1 values (1, "a");
+drop trigger if exists t1_bi;
+insert into t1 values (2, "b");
+drop trigger if exists t1_bi;
+Warnings:
+Note 1360 Trigger does not exist
+insert into t1 values (3, "c");
+select * from t1;
+a b
+1 In trigger t1_bi
+2 b
+3 c
+select * from t1;
+a b
+1 In trigger t1_bi
+2 b
+3 c
+drop table t1;
diff --git a/mysql-test/r/rpl_trunc_temp.result b/mysql-test/suite/rpl/r/rpl_trunc_temp.result
index 44624a38875..44624a38875 100644
--- a/mysql-test/r/rpl_trunc_temp.result
+++ b/mysql-test/suite/rpl/r/rpl_trunc_temp.result
diff --git a/mysql-test/r/rpl_truncate_2myisam.result b/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result
index c7ef28ba56b..c7ef28ba56b 100644
--- a/mysql-test/r/rpl_truncate_2myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result
diff --git a/mysql-test/r/rpl_truncate_3innodb.result b/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result
index 7ce48c2e983..7ce48c2e983 100644
--- a/mysql-test/r/rpl_truncate_3innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result
diff --git a/mysql-test/suite/rpl/r/rpl_truncate_7ndb_2.result b/mysql-test/suite/rpl/r/rpl_truncate_7ndb_2.result
new file mode 100644
index 00000000000..d43704c2ba7
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_truncate_7ndb_2.result
@@ -0,0 +1,91 @@
+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;
+**** On Master ****
+CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
+INSERT INTO t1 VALUES (1,1), (2,2);
+SELECT * FROM t1 ORDER BY a,b;
+a b
+1 1
+2 2
+**** On Slave ****
+INSERT INTO t1 VALUE (3,3);
+SELECT * FROM t1 ORDER BY a,b;
+a b
+1 1
+2 2
+3 3
+**** On Master ****
+TRUNCATE TABLE t1;
+SELECT * FROM t1 ORDER BY a,b;
+a b
+**** On Slave ****
+SELECT * FROM t1 ORDER BY a,b;
+a b
+**** On Master ****
+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 40 table_id: # (test.t1)
+master-bin.000001 327 Table_map 1 98 table_id: # (mysql.ndb_apply_status)
+master-bin.000001 385 Write_rows 1 157 table_id: #
+master-bin.000001 444 Write_rows 1 204 table_id: # flags: STMT_END_F
+master-bin.000001 491 Query 1 556 COMMIT
+master-bin.000001 556 Query 1 636 use `test`; TRUNCATE TABLE t1
+master-bin.000001 636 Query 1 712 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);
+SELECT * FROM t1 ORDER BY a,b;
+a b
+1 1
+2 2
+**** On Slave ****
+INSERT INTO t1 VALUE (3,3);
+SELECT * FROM t1 ORDER BY a,b;
+a b
+1 1
+2 2
+3 3
+**** On Master ****
+DELETE FROM t1;
+SELECT * FROM t1 ORDER BY a,b;
+a b
+**** On Slave ****
+SELECT * FROM t1 ORDER BY a,b;
+a b
+3 3
+**** On Master ****
+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 40 table_id: # (test.t1)
+master-bin.000001 327 Table_map 1 98 table_id: # (mysql.ndb_apply_status)
+master-bin.000001 385 Write_rows 1 157 table_id: #
+master-bin.000001 444 Write_rows 1 204 table_id: # flags: STMT_END_F
+master-bin.000001 491 Query 1 556 COMMIT
+master-bin.000001 556 Query 1 636 use `test`; TRUNCATE TABLE t1
+master-bin.000001 636 Query 1 712 use `test`; DROP TABLE t1
+master-bin.000001 712 Query 1 829 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
+master-bin.000001 829 Query 1 893 BEGIN
+master-bin.000001 893 Table_map 1 40 table_id: # (test.t1)
+master-bin.000001 933 Table_map 1 98 table_id: # (mysql.ndb_apply_status)
+master-bin.000001 991 Write_rows 1 157 table_id: #
+master-bin.000001 1050 Write_rows 1 204 table_id: # flags: STMT_END_F
+master-bin.000001 1097 Query 1 1162 COMMIT
+master-bin.000001 1162 Query 1 1226 BEGIN
+master-bin.000001 1226 Table_map 1 40 table_id: # (test.t1)
+master-bin.000001 1266 Table_map 1 98 table_id: # (mysql.ndb_apply_status)
+master-bin.000001 1324 Write_rows 1 157 table_id: #
+master-bin.000001 1383 Delete_rows 1 196 table_id: # flags: STMT_END_F
+master-bin.000001 1422 Query 1 1487 COMMIT
+master-bin.000001 1487 Query 1 1563 use `test`; DROP TABLE t1
diff --git a/mysql-test/suite/rpl/r/rpl_udf.result b/mysql-test/suite/rpl/r/rpl_udf.result
new file mode 100644
index 00000000000..fcd2f4743ba
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_udf.result
@@ -0,0 +1,318 @@
+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;
+set binlog_format=row;
+drop table if exists t1;
+"*** Test 1) Test UDFs via loadable libraries ***
+"Running on the master"
+CREATE FUNCTION myfunc_double RETURNS REAL SONAME "UDF_EXAMPLE_LIB";
+affected rows: 0
+CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB";
+affected rows: 0
+CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB";
+ERROR HY000: Can't find symbol 'myfunc_nonexist' in library
+SELECT * FROM mysql.func ORDER BY name;
+name ret dl type
+myfunc_double 1 UDF_LIB function
+myfunc_int 2 UDF_LIB function
+affected rows: 2
+"Running on the slave"
+SELECT * FROM mysql.func ORDER BY name;
+name ret dl type
+myfunc_double 1 UDF_LIB function
+myfunc_int 2 UDF_LIB function
+affected rows: 2
+"Running on the master"
+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
+INSERT INTO t1 VALUES(myfunc_int(10), myfunc_double(5.00));
+affected rows: 1
+INSERT INTO t1 VALUES(myfunc_int(200), myfunc_double(25.00));
+affected rows: 1
+INSERT INTO t1 VALUES(myfunc_int(1), myfunc_double(500.00));
+affected rows: 1
+SELECT * FROM t1 ORDER BY sum;
+sum price
+1 48.5
+10 48.75
+100 48.6
+200 49
+affected rows: 4
+"Running on the slave"
+SELECT * FROM t1 ORDER BY sum;
+sum price
+1 48.5
+10 48.75
+100 48.6
+200 49
+affected rows: 4
+SELECT myfunc_int(25);
+myfunc_int(25)
+25
+affected rows: 1
+SELECT myfunc_double(75.00);
+myfunc_double(75.00)
+50.00
+affected rows: 1
+"Running on the master"
+DROP FUNCTION myfunc_double;
+affected rows: 0
+DROP FUNCTION myfunc_int;
+affected rows: 0
+SELECT * FROM mysql.func ORDER BY name;
+name ret dl type
+affected rows: 0
+"Running on the slave"
+SELECT * FROM mysql.func ORDER BY name;
+name ret dl type
+affected rows: 0
+"Running on the master"
+DROP TABLE t1;
+affected rows: 0
+"*** Test 2) Test UDFs with SQL body ***
+"Running on the master"
+CREATE FUNCTION myfuncsql_int(i INT) RETURNS INTEGER DETERMINISTIC RETURN i;
+affected rows: 0
+CREATE FUNCTION myfuncsql_double(d DOUBLE) RETURNS INTEGER DETERMINISTIC RETURN d * 2.00;
+affected rows: 0
+SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
+db name type param_list body comment
+test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00
+test myfuncsql_int FUNCTION i INT RETURN i
+affected rows: 2
+"Running on the slave"
+SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
+db name type param_list body comment
+test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00
+test myfuncsql_int FUNCTION i INT RETURN i
+affected rows: 2
+"Running on the master"
+CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=MyISAM;
+affected rows: 0
+INSERT INTO t1 VALUES(myfuncsql_int(100), myfuncsql_double(50.00));
+affected rows: 1
+INSERT INTO t1 VALUES(myfuncsql_int(10), myfuncsql_double(5.00));
+affected rows: 1
+INSERT INTO t1 VALUES(myfuncsql_int(200), myfuncsql_double(25.00));
+affected rows: 1
+INSERT INTO t1 VALUES(myfuncsql_int(1), myfuncsql_double(500.00));
+affected rows: 1
+SELECT * FROM t1 ORDER BY sum;
+sum price
+1 1000
+10 10
+100 100
+200 50
+affected rows: 4
+"Running on the slave"
+SELECT * FROM t1 ORDER BY sum;
+sum price
+1 1000
+10 10
+100 100
+200 50
+affected rows: 4
+"Running on the master"
+ALTER FUNCTION myfuncsql_int COMMENT "This was altered.";
+affected rows: 0
+ALTER FUNCTION myfuncsql_double COMMENT "This was altered.";
+affected rows: 0
+SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
+db name type param_list body comment
+test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00 This was altered.
+test myfuncsql_int FUNCTION i INT RETURN i This was altered.
+affected rows: 2
+"Running on the slave"
+SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
+db name type param_list body comment
+test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00 This was altered.
+test myfuncsql_int FUNCTION i INT RETURN i This was altered.
+affected rows: 2
+SELECT myfuncsql_int(25);
+myfuncsql_int(25)
+25
+affected rows: 1
+SELECT myfuncsql_double(75.00);
+myfuncsql_double(75.00)
+150
+affected rows: 1
+"Running on the master"
+DROP FUNCTION myfuncsql_double;
+affected rows: 0
+DROP FUNCTION myfuncsql_int;
+affected rows: 0
+SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
+db name type param_list body comment
+affected rows: 0
+"Running on the slave"
+SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
+db name type param_list body comment
+affected rows: 0
+"Running on the master"
+DROP TABLE t1;
+affected rows: 0
+set binlog_format=statement;
+drop table if exists t1;
+"*** Test 1) Test UDFs via loadable libraries ***
+"Running on the master"
+CREATE FUNCTION myfunc_double RETURNS REAL SONAME "UDF_EXAMPLE_LIB";
+affected rows: 0
+CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB";
+affected rows: 0
+CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB";
+ERROR HY000: Can't find symbol 'myfunc_nonexist' in library
+SELECT * FROM mysql.func ORDER BY name;
+name ret dl type
+myfunc_double 1 UDF_LIB function
+myfunc_int 2 UDF_LIB function
+affected rows: 2
+"Running on the slave"
+SELECT * FROM mysql.func ORDER BY name;
+name ret dl type
+myfunc_double 1 UDF_LIB function
+myfunc_int 2 UDF_LIB function
+affected rows: 2
+"Running on the master"
+CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=MyISAM;
+affected rows: 0
+INSERT INTO t1 VALUES(myfunc_int(100), myfunc_double(50.00));
+Warnings:
+Warning 1591 Statement is not safe to log in statement format.
+affected rows: 1
+INSERT INTO t1 VALUES(myfunc_int(10), myfunc_double(5.00));
+Warnings:
+Warning 1591 Statement is not safe to log in statement format.
+affected rows: 1
+INSERT INTO t1 VALUES(myfunc_int(200), myfunc_double(25.00));
+Warnings:
+Warning 1591 Statement is not safe to log in statement format.
+affected rows: 1
+INSERT INTO t1 VALUES(myfunc_int(1), myfunc_double(500.00));
+Warnings:
+Warning 1591 Statement is not safe to log in statement format.
+affected rows: 1
+SELECT * FROM t1 ORDER BY sum;
+sum price
+1 48.5
+10 48.75
+100 48.6
+200 49
+affected rows: 4
+"Running on the slave"
+SELECT * FROM t1 ORDER BY sum;
+sum price
+1 48.5
+10 48.75
+100 48.6
+200 49
+affected rows: 4
+SELECT myfunc_int(25);
+myfunc_int(25)
+25
+affected rows: 1
+SELECT myfunc_double(75.00);
+myfunc_double(75.00)
+50.00
+affected rows: 1
+"Running on the master"
+DROP FUNCTION myfunc_double;
+affected rows: 0
+DROP FUNCTION myfunc_int;
+affected rows: 0
+SELECT * FROM mysql.func ORDER BY name;
+name ret dl type
+affected rows: 0
+"Running on the slave"
+SELECT * FROM mysql.func ORDER BY name;
+name ret dl type
+affected rows: 0
+"Running on the master"
+DROP TABLE t1;
+affected rows: 0
+"*** Test 2) Test UDFs with SQL body ***
+"Running on the master"
+CREATE FUNCTION myfuncsql_int(i INT) RETURNS INTEGER DETERMINISTIC RETURN i;
+affected rows: 0
+CREATE FUNCTION myfuncsql_double(d DOUBLE) RETURNS INTEGER DETERMINISTIC RETURN d * 2.00;
+affected rows: 0
+SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
+db name type param_list body comment
+test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00
+test myfuncsql_int FUNCTION i INT RETURN i
+affected rows: 2
+"Running on the slave"
+SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
+db name type param_list body comment
+test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00
+test myfuncsql_int FUNCTION i INT RETURN i
+affected rows: 2
+"Running on the master"
+CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=MyISAM;
+affected rows: 0
+INSERT INTO t1 VALUES(myfuncsql_int(100), myfuncsql_double(50.00));
+affected rows: 1
+INSERT INTO t1 VALUES(myfuncsql_int(10), myfuncsql_double(5.00));
+affected rows: 1
+INSERT INTO t1 VALUES(myfuncsql_int(200), myfuncsql_double(25.00));
+affected rows: 1
+INSERT INTO t1 VALUES(myfuncsql_int(1), myfuncsql_double(500.00));
+affected rows: 1
+SELECT * FROM t1 ORDER BY sum;
+sum price
+1 1000
+10 10
+100 100
+200 50
+affected rows: 4
+"Running on the slave"
+SELECT * FROM t1 ORDER BY sum;
+sum price
+1 1000
+10 10
+100 100
+200 50
+affected rows: 4
+"Running on the master"
+ALTER FUNCTION myfuncsql_int COMMENT "This was altered.";
+affected rows: 0
+ALTER FUNCTION myfuncsql_double COMMENT "This was altered.";
+affected rows: 0
+SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
+db name type param_list body comment
+test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00 This was altered.
+test myfuncsql_int FUNCTION i INT RETURN i This was altered.
+affected rows: 2
+"Running on the slave"
+SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
+db name type param_list body comment
+test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00 This was altered.
+test myfuncsql_int FUNCTION i INT RETURN i This was altered.
+affected rows: 2
+SELECT myfuncsql_int(25);
+myfuncsql_int(25)
+25
+affected rows: 1
+SELECT myfuncsql_double(75.00);
+myfuncsql_double(75.00)
+150
+affected rows: 1
+"Running on the master"
+DROP FUNCTION myfuncsql_double;
+affected rows: 0
+DROP FUNCTION myfuncsql_int;
+affected rows: 0
+SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
+db name type param_list body comment
+affected rows: 0
+"Running on the slave"
+SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
+db name type param_list body comment
+affected rows: 0
+"Running on the master"
+DROP TABLE t1;
+affected rows: 0
diff --git a/mysql-test/suite/rpl/r/rpl_user_variables.result b/mysql-test/suite/rpl/r/rpl_user_variables.result
new file mode 100644
index 00000000000..d3363df3b58
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_user_variables.result
@@ -0,0 +1,266 @@
+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;
+reset master;
+create table t1(n char(30));
+set @i1:=12345678901234, @i2:=-12345678901234, @i3:=0, @i4:=-1;
+set @s1:='This is a test', @r1:=12.5, @r2:=-12.5;
+set @n1:=null;
+set @s2:='', @s3:='abc\'def', @s4:= 'abc\\def', @s5:= 'abc''def';
+insert into t1 values (@i1), (@i2), (@i3), (@i4);
+insert into t1 values (@r1), (@r2);
+insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5);
+insert into t1 values (@n1);
+insert into t1 values (@n2);
+insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1);
+insert into t1 values (@a+(@b:=@a+1));
+set @q:='abc';
+insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2'));
+set @a:=5;
+insert into t1 values (@a),(@a);
+select * from t1 where n = '<nonexistant>';
+n
+insert into t1 values (@a),(@a),(@a*5);
+SELECT * FROM t1 ORDER BY n;
+n
+NULL
+NULL
+NULL
+NULL
+NULL
+
+-1
+-12.5
+-12345678901234
+0
+0
+1
+12.5
+12345678901234
+2
+5
+5
+5
+abc
+abc'def
+abc'def
+abcn1
+abcn1n2
+abc\def
+This is a test
+SELECT * FROM t1 ORDER BY n;
+n
+NULL
+NULL
+NULL
+NULL
+NULL
+
+-1
+-12.5
+-12345678901234
+0
+0
+1
+12.5
+12345678901234
+2
+5
+5
+5
+abc
+abc'def
+abc'def
+abcn1
+abcn1n2
+abc\def
+This is a test
+insert into t1 select * FROM (select @var1 union select @var2) AS t2;
+drop table t1;
+End of 4.1 tests.
+DROP TABLE IF EXISTS t20;
+DROP TABLE IF EXISTS t21;
+DROP PROCEDURE IF EXISTS test.insert;
+CREATE TABLE t20 (a VARCHAR(20));
+CREATE TABLE t21 (a VARCHAR(20));
+CREATE PROCEDURE test.insert()
+BEGIN
+IF (@VAR)
+THEN
+INSERT INTO test.t20 VALUES ('SP_TRUE');
+ELSE
+INSERT INTO test.t20 VALUES ('SP_FALSE');
+END IF;
+END|
+CREATE TRIGGER test.insert_bi BEFORE INSERT
+ON test.t20 FOR EACH ROW
+BEGIN
+IF (@VAR)
+THEN
+INSERT INTO test.t21 VALUES ('TRIG_TRUE');
+ELSE
+INSERT INTO test.t21 VALUES ('TRIG_FALSE');
+END IF;
+END|
+SET @VAR=0;
+CALL test.insert();
+SET @VAR=1;
+CALL test.insert();
+On master: Check the tables for correct data
+SELECT * FROM t20;
+a
+SP_FALSE
+SP_TRUE
+SELECT * FROM t21;
+a
+TRIG_FALSE
+TRIG_TRUE
+On slave: Check the tables for correct data and it matches master
+SELECT * FROM t20;
+a
+SP_FALSE
+SP_TRUE
+SELECT * FROM t21;
+a
+TRIG_FALSE
+TRIG_TRUE
+DROP TABLE t20;
+DROP TABLE t21;
+DROP PROCEDURE test.insert;
+DROP TABLE IF EXISTS t1;
+DROP FUNCTION IF EXISTS test.square;
+CREATE TABLE t1 (i INT);
+CREATE FUNCTION test.square() RETURNS INTEGER DETERMINISTIC RETURN
+(@var * @var);
+SET @var = 1;
+INSERT INTO t1 VALUES (square());
+SET @var = 2;
+INSERT INTO t1 VALUES (square());
+SET @var = 3;
+INSERT INTO t1 VALUES (square());
+SET @var = 4;
+INSERT INTO t1 VALUES (square());
+SET @var = 5;
+INSERT INTO t1 VALUES (square());
+On master: Retrieve the values from the table
+SELECT * FROM t1;
+i
+1
+4
+9
+16
+25
+On slave: Retrieve the values from the table and verify they are the same as on master
+SELECT * FROM t1;
+i
+1
+4
+9
+16
+25
+DROP TABLE t1;
+DROP FUNCTION test.square;
+DROP TABLE IF EXISTS t1;
+DROP FUNCTION IF EXISTS f1;
+DROP FUNCTION IF EXISTS f2;
+CREATE TABLE t1(a int);
+CREATE FUNCTION f1() returns int deterministic BEGIN
+return @a;
+END |
+CREATE FUNCTION f2() returns int deterministic BEGIN
+IF (@b > 0) then
+SET @c = (@a + @b);
+else
+SET @c = (@a - 1);
+END if;
+return @c;
+END |
+SET @a=500;
+INSERT INTO t1 values(f1());
+SET @b = 125;
+SET @c = 1;
+INSERT INTO t1 values(f2());
+On master: Retrieve the values from the table
+SELECT * from t1;
+a
+500
+625
+On slave: Check the tables for correct data and it matches master
+SELECT * from t1;
+a
+500
+625
+DROP TABLE t1;
+DROP FUNCTION f1;
+DROP FUNCTION f2;
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+CREATE TABLE t1 (i int);
+CREATE TABLE t2 (k int);
+CREATE trigger t1_bi before INSERT on t1 for each row BEGIN
+INSERT INTO t2 values (@a);
+SET @a:=42;
+INSERT INTO t2 values (@a);
+END |
+SET @a:=100;
+INSERT INTO t1 values (5);
+On master: Check to see that data was inserted correctly in both tables
+SELECT * from t1;
+i
+5
+SELECT * from t2;
+k
+100
+42
+On slave: Check the tables for correct data and it matches master
+SELECT * from t1;
+i
+5
+SELECT * from t2;
+k
+100
+42
+drop table t1, t2;
+create table t1(a int, b int);
+prepare s1 from 'insert into t1 values (@x:=@x+1, ?)';
+set @x=1;
+execute s1 using @x;
+select * from t1;
+a b
+2 1
+select * from t1;
+a b
+2 1
+drop table t1;
+End of 5.0 tests.
+DROP FUNCTION IF EXISTS f1;
+DROP FUNCTION IF EXISTS f2;
+CREATE TABLE t1 (i INT);
+CREATE FUNCTION f1() RETURNS INT RETURN @a;
+CREATE
+FUNCTION f2() RETURNS INT BEGIN
+INSERT INTO t1 VALUES (10 + @a);
+RETURN 0;
+END|
+SET @a:=123;
+SELECT f1(), f2();
+f1() f2()
+123 0
+On master: Check to see that data was inserted correctly
+INSERT INTO t1 VALUES(f1());
+SELECT * FROM t1;
+i
+133
+123
+On slave: Check the table for correct data and it matches master
+SELECT * FROM t1;
+i
+133
+123
+DROP FUNCTION f1;
+DROP FUNCTION f2;
+DROP TABLE t1;
+stop slave;
diff --git a/mysql-test/r/rpl_variables.result b/mysql-test/suite/rpl/r/rpl_variables.result
index 605a48859a0..605a48859a0 100644
--- a/mysql-test/r/rpl_variables.result
+++ b/mysql-test/suite/rpl/r/rpl_variables.result
diff --git a/mysql-test/suite/rpl/r/rpl_view.result b/mysql-test/suite/rpl/r/rpl_view.result
new file mode 100644
index 00000000000..12b7b46ffed
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_view.result
@@ -0,0 +1,104 @@
+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;
+drop table if exists t1,v1;
+drop view if exists t1,v1;
+reset master;
+create table t1 (a int);
+insert into t1 values (1);
+create view v1 as select a from t1;
+insert into v1 values (2);
+select * from v1 order by a;
+a
+1
+2
+select * from v1 order by a;
+a
+1
+2
+update v1 set a=3 where a=1;
+select * from v1 order by a;
+a
+2
+3
+select * from v1 order by a;
+a
+2
+3
+delete from v1 where a=2;
+select * from v1 order by a;
+a
+3
+select * from v1 order by a;
+a
+3
+alter view v1 as select a as b from t1;
+select * from v1 order by 1;
+b
+3
+drop view v1;
+select * from v1 order by a;
+ERROR 42S02: Table 'test.v1' doesn't exist
+drop table t1;
+
+---> Test for BUG#20438
+
+---> Preparing environment...
+---> connection: master
+DROP TABLE IF EXISTS t1;
+DROP VIEW IF EXISTS v1;
+
+---> Synchronizing slave with master...
+
+---> connection: master
+
+---> Creating objects...
+CREATE TABLE t1(c INT);
+/*!50003 CREATE VIEW v1 AS SELECT * FROM t1 */;
+
+---> Inserting value...
+INSERT INTO t1 VALUES(1);
+
+---> Checking on master...
+SELECT * FROM t1;
+c
+1
+
+---> Synchronizing slave with master...
+---> connection: master
+
+---> Checking on slave...
+SELECT * FROM t1;
+c
+1
+
+---> connection: master
+
+---> Cleaning up...
+DROP VIEW v1;
+DROP TABLE t1;
+create table t1(a int, b int);
+insert into t1 values (1, 1), (1, 2), (1, 3);
+create view v1(a, b) as select a, sum(b) from t1 group by a;
+explain v1;
+Field Type Null Key Default Extra
+a int(11) YES NULL
+b decimal(32,0) YES NULL
+show create table v1;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,sum(`t1`.`b`) AS `b` from `t1` group by `t1`.`a` latin1 latin1_swedish_ci
+select * from v1;
+a b
+1 6
+drop table t1;
+drop view v1;
+CREATE TABLE t1(a INT);
+CREATE VIEW v1 AS SELECT * FROM t1;
+CREATE VIEW v1 AS SELECT * FROM t1;
+ERROR 42S01: Table 'v1' already exists
+DROP VIEW v1;
+DROP TABLE t1;
+End of 5.0 tests
diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def
new file mode 100644
index 00000000000..0c90eaa4378
--- /dev/null
+++ b/mysql-test/suite/rpl/t/disabled.def
@@ -0,0 +1,17 @@
+##############################################################################
+#
+# 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.
+#
+##############################################################################
+
+rpl_ddl : BUG#26418 2007-03-01 mleich Slave out of sync after CREATE/DROP TEMPORARY TABLE + ROLLBACK on master
+rpl_invoked_features : BUG#29020 2007-06-21 Lars Non-deterministic test case
+rpl_auto_increment_11932 : Bug#29809 2007-07-16 ingo Slave SQL errors in warnings file
+rpl_stm_extraColmaster_ndb : WL#3915 : Statement-based replication not supported in ndb. Enable test when supported.
+rpl_row_extraColmaster_ndb : BUG#29549 : Replication of BLOBs fail for NDB
diff --git a/mysql-test/t/rpl000010-slave.opt b/mysql-test/suite/rpl/t/rpl000010-slave.opt
index 0dbfb311e33..0dbfb311e33 100644
--- a/mysql-test/t/rpl000010-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl000010-slave.opt
diff --git a/mysql-test/t/rpl000010.test b/mysql-test/suite/rpl/t/rpl000010.test
index 261b9148774..261b9148774 100644
--- a/mysql-test/t/rpl000010.test
+++ b/mysql-test/suite/rpl/t/rpl000010.test
diff --git a/mysql-test/t/rpl000011.test b/mysql-test/suite/rpl/t/rpl000011.test
index 32f6227f7c5..32f6227f7c5 100644
--- a/mysql-test/t/rpl000011.test
+++ b/mysql-test/suite/rpl/t/rpl000011.test
diff --git a/mysql-test/t/rpl000013.test b/mysql-test/suite/rpl/t/rpl000013.test
index 69a102e84ce..69a102e84ce 100644
--- a/mysql-test/t/rpl000013.test
+++ b/mysql-test/suite/rpl/t/rpl000013.test
diff --git a/mysql-test/t/rpl000017-slave.opt b/mysql-test/suite/rpl/t/rpl000017-slave.opt
index 58a964c90d0..58a964c90d0 100644
--- a/mysql-test/t/rpl000017-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl000017-slave.opt
diff --git a/mysql-test/t/rpl000017-slave.sh b/mysql-test/suite/rpl/t/rpl000017-slave.sh
index 17188aba0db..17188aba0db 100755
--- a/mysql-test/t/rpl000017-slave.sh
+++ b/mysql-test/suite/rpl/t/rpl000017-slave.sh
diff --git a/mysql-test/t/rpl000017.test b/mysql-test/suite/rpl/t/rpl000017.test
index 2ba321cd8c3..2ba321cd8c3 100644
--- a/mysql-test/t/rpl000017.test
+++ b/mysql-test/suite/rpl/t/rpl000017.test
diff --git a/mysql-test/t/rpl000018-master.opt b/mysql-test/suite/rpl/t/rpl000018-master.opt
index ad2c6a647b5..ad2c6a647b5 100644
--- a/mysql-test/t/rpl000018-master.opt
+++ b/mysql-test/suite/rpl/t/rpl000018-master.opt
diff --git a/mysql-test/t/rpl000018-slave.opt b/mysql-test/suite/rpl/t/rpl000018-slave.opt
index e854f0d0bb2..e854f0d0bb2 100644
--- a/mysql-test/t/rpl000018-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl000018-slave.opt
diff --git a/mysql-test/t/rpl_000015-slave.sh b/mysql-test/suite/rpl/t/rpl_000015-slave.sh
index 7deeca3d2d6..7deeca3d2d6 100755
--- a/mysql-test/t/rpl_000015-slave.sh
+++ b/mysql-test/suite/rpl/t/rpl_000015-slave.sh
diff --git a/mysql-test/t/rpl_000015.slave-mi b/mysql-test/suite/rpl/t/rpl_000015.slave-mi
index 28bc753dd56..28bc753dd56 100644
--- a/mysql-test/t/rpl_000015.slave-mi
+++ b/mysql-test/suite/rpl/t/rpl_000015.slave-mi
diff --git a/mysql-test/suite/rpl/t/rpl_000015.test b/mysql-test/suite/rpl/t/rpl_000015.test
new file mode 100644
index 00000000000..80db596244b
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_000015.test
@@ -0,0 +1,40 @@
+-- source include/have_log_bin.inc
+#####################
+# Change Author: JBM
+# Change Date: 2006-01-17
+# Change: added order by in select
+#####################
+
+connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
+connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK);
+connection master;
+reset master;
+show master status;
+save_master_pos;
+connection slave;
+reset slave;
+source include/show_slave_status.inc;
+
+change master to master_host='127.0.0.1';
+# The following needs to be cleaned up when change master is fixed
+source include/show_slave_status.inc;
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval change master to master_host='127.0.0.1',master_user='root',
+ master_password='',master_port=$MASTER_MYPORT;
+source include/show_slave_status.inc;
+start slave;
+sync_with_master;
+source include/show_slave_status.inc;
+connection master;
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (n int, PRIMARY KEY(n));
+insert into t1 values (10),(45),(90);
+sync_slave_with_master;
+connection slave;
+SELECT * FROM t1 ORDER BY n;
+connection master;
+SELECT * FROM t1 ORDER BY n;
+drop table t1;
+sync_slave_with_master;
diff --git a/mysql-test/t/rpl_EE_err.test b/mysql-test/suite/rpl/t/rpl_EE_err.test
index 6d064ae3197..6d064ae3197 100644
--- a/mysql-test/t/rpl_EE_err.test
+++ b/mysql-test/suite/rpl/t/rpl_EE_err.test
diff --git a/mysql-test/t/rpl_LD_INFILE.test b/mysql-test/suite/rpl/t/rpl_LD_INFILE.test
index bace5d4c1f5..bace5d4c1f5 100644
--- a/mysql-test/t/rpl_LD_INFILE.test
+++ b/mysql-test/suite/rpl/t/rpl_LD_INFILE.test
diff --git a/mysql-test/t/rpl_alter.test b/mysql-test/suite/rpl/t/rpl_alter.test
index 576376a0264..576376a0264 100644
--- a/mysql-test/t/rpl_alter.test
+++ b/mysql-test/suite/rpl/t/rpl_alter.test
diff --git a/mysql-test/t/rpl_alter_db.test b/mysql-test/suite/rpl/t/rpl_alter_db.test
index 5ac8a2f4018..5ac8a2f4018 100644
--- a/mysql-test/t/rpl_alter_db.test
+++ b/mysql-test/suite/rpl/t/rpl_alter_db.test
diff --git a/mysql-test/t/rpl_auto_increment-master.opt b/mysql-test/suite/rpl/t/rpl_auto_increment-master.opt
index a8a6af19da9..a8a6af19da9 100644
--- a/mysql-test/t/rpl_auto_increment-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_auto_increment-master.opt
diff --git a/mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt b/mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt
new file mode 100644
index 00000000000..48457b17309
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt
@@ -0,0 +1 @@
+--loose-innodb
diff --git a/mysql-test/t/rpl_auto_increment.test b/mysql-test/suite/rpl/t/rpl_auto_increment.test
index 19770ffbdc0..19770ffbdc0 100644
--- a/mysql-test/t/rpl_auto_increment.test
+++ b/mysql-test/suite/rpl/t/rpl_auto_increment.test
diff --git a/mysql-test/t/rpl_auto_increment_11932.test b/mysql-test/suite/rpl/t/rpl_auto_increment_11932.test
index d4b7872fb2b..d4b7872fb2b 100644
--- a/mysql-test/t/rpl_auto_increment_11932.test
+++ b/mysql-test/suite/rpl/t/rpl_auto_increment_11932.test
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_grant.test b/mysql-test/suite/rpl/t/rpl_binlog_grant.test
new file mode 100644
index 00000000000..42af33c2e05
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_binlog_grant.test
@@ -0,0 +1,43 @@
+-- source include/have_innodb.inc
+-- source include/not_embedded.inc
+-- source include/have_binlog_format_mixed_or_statement.inc
+
+let $VERSION=`select version()`;
+
+# Bug #21975: grant/revoke statements in transaction
+# used to disappear from binlog upon rallback.
+# Now GRANT/REVOKE do implicitly commit
+# transaction
+
+--disable_warnings
+drop database if exists d1;
+--enable_warnings
+create database d1;
+use d1;
+create table t (s1 int) engine=innodb;
+set @@autocommit=0;
+start transaction;
+insert into t values (1);
+grant select on t to x@y;
+#
+# There is no active transaction here
+#
+rollback;
+show grants for x@y;
+--replace_result $VERSION VERSION
+--replace_regex /\/\* xid=.* \*\//\/* XID *\//
+show binlog events;
+start transaction;
+insert into t values (2);
+revoke select on t from x@y;
+#
+# There is no active transaction here
+#
+commit;
+select * from t;
+show grants for x@y;
+--replace_result $VERSION VERSION
+--replace_regex /\/\* xid=.* \*\//\/* XID *\//
+show binlog events;
+drop user x@y;
+drop database d1;
diff --git a/mysql-test/t/rpl_bit.test b/mysql-test/suite/rpl/t/rpl_bit.test
index 07b0778296c..07b0778296c 100644
--- a/mysql-test/t/rpl_bit.test
+++ b/mysql-test/suite/rpl/t/rpl_bit.test
diff --git a/mysql-test/t/rpl_bit_npk.test b/mysql-test/suite/rpl/t/rpl_bit_npk.test
index 12b587919f9..12b587919f9 100644
--- a/mysql-test/t/rpl_bit_npk.test
+++ b/mysql-test/suite/rpl/t/rpl_bit_npk.test
diff --git a/mysql-test/suite/rpl/t/rpl_bug31076.test b/mysql-test/suite/rpl/t/rpl_bug31076.test
new file mode 100644
index 00000000000..cc8b26ac8f4
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_bug31076.test
@@ -0,0 +1,117 @@
+source include/master-slave.inc;
+
+CREATE DATABASE track;
+USE track;
+
+CREATE TABLE `visits` (
+ `visits_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+ `myid` varchar(32) NOT NULL DEFAULT '',
+ `src` varchar(64) NOT NULL DEFAULT '',
+ `ip` int(10) unsigned NOT NULL DEFAULT '0',
+ `cc` char(2) NOT NULL DEFAULT '',
+ `org` varchar(80) DEFAULT NULL,
+ `ref` varchar(255) NOT NULL DEFAULT '',
+ `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `host` varchar(30) NOT NULL DEFAULT '',
+ `entry` varchar(255) NOT NULL DEFAULT '',
+ `visit_exit` varchar(255) NOT NULL DEFAULT '',
+ `user_id` int(11) unsigned NOT NULL DEFAULT '0',
+ `visit_start` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ PRIMARY KEY (`visits_id`),
+ KEY `ip` (`ip`),
+ KEY `time` (`time`),
+ KEY `user_id` (`user_id`)
+) ENGINE=MyISAM AUTO_INCREMENT=21293381 DEFAULT CHARSET=latin1;
+
+CREATE TABLE `visits_events` (
+ `event_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
+ `visit_id` int(11) unsigned NOT NULL DEFAULT '0',
+ `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ `src` varchar(64) NOT NULL DEFAULT '',
+ `data` varchar(255) NOT NULL DEFAULT '',
+ `visits_events_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`visits_events_id`),
+ KEY `event_id` (`event_id`),
+ KEY `visit_id` (`visit_id`),
+ KEY `data` (`data`)
+) ENGINE=MyISAM AUTO_INCREMENT=33900731 DEFAULT CHARSET=latin1;
+
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+--delimiter /*!*/;
+# at 164170623
+# at 164170679
+#7918 3:59:2 server id 436 end_log_pos 164170679
+# 9c90b7f 06 4d ef 46 13 b4 01 00 00 38 00 00 00 b7 0b c9 |.M.F.....8......|
+# 9c90b8f 09 00 00 99 57 17 02 00 00 00 00 05 74 72 61 63 |....W.......trac|
+# 9c90b9f 6b 00 0d 76 69 |k..vi|
+# Table_map: `track`.`visits_events` mapped to number 35084185
+#7918 3:59:2 server id 436 end_log_pos 164170769
+# 9c90bb7 06 4d ef 46 17 b4 01 00 00 5a 00 00 00 11 0c c9 |.M.F.....Z......|
+# 9c90bc7 09 10 00 99 57 17 02 00 00 01 00 06 ff c0 20 4e |....W..........N|
+# 9c90bd7 00 be f5 43 01 06 4d ef 46 00 2b 44 6f 77 6e 6c |...C..M.F..Downl|
+# 9c90be7 6f 61 64 73 2f 4d 79 53 51 4c 2d 34 2e 31 2f 6d |oads.MySQL.4.1.m|
+# 9c90bf7 79 73 71 6c 2d 34 2e |ysql.4.|
+# Write_rows: table id 35084185 flags: STMT_END_F
+
+BINLOG '
+Bk3vRhO0AQAAOAAAALcLyQkAAJlXFwIAAAAABXRyYWNrAA12aXNpdHNfZXZlbnRzAAYJAwcPDwM=
+Bk3vRhe0AQAAWgAAABEMyQkQAJlXFwIAAAEABv/AIE4AvvVDAQZN70YAK0Rvd25sb2Fkcy9NeVNR
+TC00LjEvbXlzcWwtNC4xLjEyYS13aW4zMi56aXBPaAIC
+'/*!*/;
+# at 164170769
+#7918 3:59:2 server id 436 end_log_pos 164170797
+# 9c90c11 06 4d ef 46 05 b4 01 00 00 |.M.F.....|
+# Intvar
+SET INSERT_ID=21231039/*!*/;
+# at 164170797
+#7918 3:59:2 server id 436 end_log_pos 164171293
+# 9c90c2d 06 4d ef 46 02 b4 01 00 00 f0 01 00 00 1d 0e c9 |.M.F............|
+# 9c90c3d 09 10 00 28 80 af 01 00 00 00 00 05 00 00 1f 00 |................|
+# 9c90c4d 00 00 40 00 00 01 00 00 00 00 00 00 00 00 06 03 |................|
+# 9c90c5d 73 74 64 04 08 00 08 00 08 00 05 03 55 54 43 74 |std.........UTCt|
+# 9c90c6d 72 61 63 6b 00 49 4e 53 45 52 54 20 49 4e 54 4f |rack.INSERT.INTO|
+# 9c90c7d 20 76 69 73 69 74 73 20 28 6d 79 69 64 2c 20 75 |.visits..myid..u|
+# 9c90c8d 73 65 72 5f 69 64 2c 20 73 72 63 2c 20 69 70 2c |ser.id..src..ip.|
+# 9c90c9d 20 63 63 2c 20 6f 72 67 2c 20 72 65 66 2c 20 74 |.cc..org..ref..t|
+# 9c90cad 69 6d 65 2c 20 68 6f 73 74 2c 20 65 6e 74 72 79 |ime..host..entry|
+# 9c90cbd 2c 20 76 69 73 69 74 5f 65 78 69 74 2c 20 76 69 |..visit.exit..vi|
+# 9c90ccd 73 69 74 5f 73 74 61 72 74 29 0a 09 09 09 56 41 |sit.start.....VA|
+# 9c90cdd 4c 55 45 53 20 28 27 33 6d 33 6c 34 72 68 73 36 |LUES...3m3l4rhs6|
+# 9c90ced 64 6f 30 73 66 35 70 31 69 39 6c 72 39 34 67 39 |do0sf5p1i9lr94g9|
+# 9c90cfd 32 38 61 32 37 32 76 27 2c 20 27 27 2c 20 27 27 |28a272v.........|
+# 9c90d0d 2c 20 49 4e 45 54 5f 41 54 4f 4e 28 27 37 31 2e |..INET.ATON..71.|
+# 9c90d1d 31 31 38 2e 31 32 34 2e 39 38 27 29 2c 20 27 27 |118.124.98......|
+# 9c90d2d 2c 20 27 27 2c 20 27 68 74 74 70 3a 2f 2f 64 65 |.......http...de|
+# 9c90d3d 76 2e 6d 79 73 71 6c 2e 63 6f 6d 2f 64 6f 77 6e |v.mysql.com.down|
+# 9c90d4d 6c 6f 61 64 73 2f 63 6f 6e 6e 65 63 74 6f 72 2f |loads.connector.|
+# 9c90d5d 6a 2f 33 2e 30 2e 68 74 6d 6c 27 2c 20 4e 55 4c |j.3.0.html...NUL|
+# 9c90d6d 4c 2c 20 27 64 65 76 2e 6d 79 73 71 6c 2e 63 6f |L...dev.mysql.co|
+# 9c90d7d 6d 27 2c 20 27 2f 67 65 74 2f 44 6f 77 6e 6c 6f |m.....get.Downlo|
+# 9c90d8d 61 64 73 2f 43 6f 6e 6e 65 63 74 6f 72 2d 4a 2f |ads.Connector.J.|
+# 9c90d9d 6d 79 73 71 6c 2d 63 6f 6e 6e 65 63 74 6f 72 2d |mysql.connector.|
+# 9c90dad 6a 61 76 61 2d 33 2e 30 2e 31 37 2d 67 61 2e 7a |java.3.0.17.ga.z|
+# 9c90dbd 69 70 2f 66 72 6f 6d 2f 70 69 63 6b 27 2c 20 27 |ip.from.pick....|
+# 9c90dcd 2f 67 65 74 2f 44 6f 77 6e 6c 6f 61 64 73 2f 43 |.get.Downloads.C|
+# 9c90ddd 6f 6e 6e 65 63 74 6f 72 2d 4a 2f 6d 79 73 71 6c |onnector.J.mysql|
+# 9c90ded 2d 63 6f 6e 6e 65 63 74 6f 72 2d 6a 61 76 61 2d |.connector.java.|
+# 9c90dfd 33 2e 30 2e 31 37 2d 67 61 2e 7a 69 70 |3.0.17.ga.zip|
+# Query thread_id=28278824 exec_time=0 error_code=0
+use track/*!*/;
+SET TIMESTAMP=1190087942/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.sql_mode=0/*!*/;
+SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
+SET @@session.time_zone='UTC'/*!*/;
+INSERT INTO visits (myid, user_id, src, ip, cc, org, ref, time, host, entry, visit_exit, visit_start)
+VALUES ('3m3l4rhs6do0sf5p1i9lr94g928a272v', '', '', INET_ATON('71.118.124.98'), '', '', 'http://dev.mysql.com/downloads/connector/j/3.0.html', NULL, 'dev.mysql.com', '/get/Downloads/Connector-J/mysql-connector-java-3.0.17-ga.zip/from/pick', '/get/Downloads/Connector-J/mysql-connector-java-3.0.17-ga.zip/from/pick', NOW())/*!*/;
+# at 164171293
+
+--delimiter ;
+
+SELECT * FROM visits;
+SELECT * FROM visits_events;
+
+# Cleanup
+DROP DATABASE track;
+--echo End of 5.1 tests
diff --git a/mysql-test/suite/rpl/t/rpl_change_master.test b/mysql-test/suite/rpl/t/rpl_change_master.test
new file mode 100644
index 00000000000..7256fed656f
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_change_master.test
@@ -0,0 +1,37 @@
+# Verify that after CHANGE MASTER, replication (I/O thread and SQL
+# thread) restart from where SQL thread left, not from where
+# I/O thread left (some old bug fixed in 4.0.17)
+
+source include/master-slave.inc;
+
+connection master;
+# Make SQL slave thread advance a bit
+create table t1(n int);
+sync_slave_with_master;
+select * from t1;
+# Now stop it and make I/O slave thread be ahead
+stop slave sql_thread;
+connection master;
+insert into t1 values(1);
+insert into t1 values(2);
+save_master_pos;
+connection slave;
+--real_sleep 3 # wait for I/O thread to have read updates
+stop slave;
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 #
+query_vertical SHOW SLAVE STATUS;
+change master to master_user='root';
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 #
+query_vertical SHOW SLAVE STATUS;
+start slave;
+sync_with_master;
+select * from t1;
+connection master;
+drop table t1;
+save_master_pos;
+connection slave;
+sync_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_charset_sjis.test b/mysql-test/suite/rpl/t/rpl_charset_sjis.test
index 2469b0db8a2..2469b0db8a2 100644
--- a/mysql-test/t/rpl_charset_sjis.test
+++ b/mysql-test/suite/rpl/t/rpl_charset_sjis.test
diff --git a/mysql-test/suite/rpl/t/rpl_colSize.test b/mysql-test/suite/rpl/t/rpl_colSize.test
new file mode 100644
index 00000000000..44fb878d4d2
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_colSize.test
@@ -0,0 +1,216 @@
+##################################################################
+# rpl_colSize #
+# #
+# This test is designed to test the changes included in WL#3228. #
+# The changes include the ability to replicate with the master #
+# having columns that are smaller (shorter) than the slave. #
+##################################################################
+
+-- source include/master-slave.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+--echo **** Testing WL#3228 changes. ****
+--echo *** Create "wider" table on slave ***
+sync_slave_with_master;
+STOP SLAVE;
+RESET SLAVE;
+
+eval CREATE TABLE t1 (
+ a float (47),
+ b double (143,9),
+ c decimal (65,30),
+ d numeric (4,0),
+ e bit (32),
+ f char (21),
+ g varchar (1300),
+ h binary (33),
+ j varbinary (200),
+ k enum ('5','6','7', '8','9','0'),
+ l set ('1','2','3','4','5','6','7','8','9','0','11','12','13','14','15','16','17','18','19','21','22','23','24','25','26','27','28','29'),
+ m TINYBLOB,
+ n BLOB,
+ o MEDIUMBLOB,
+ p LONGBLOB,
+ q TINYTEXT,
+ r TEXT,
+ s MEDIUMTEXT,
+ t LONGTEXT
+);
+
+--echo *** Create same table on master but with narrow columns ***
+connection master;
+eval CREATE TABLE t1 (
+ a float (44),
+ b double (10,3),
+ c decimal (10,2),
+ d numeric (3,0),
+ e bit (16),
+ f char (10),
+ g varchar (100),
+ h binary (20),
+ j varbinary (20),
+ k enum ('5','6','7'),
+ l set ('1','2','3','4','5','6','7','8','9','0'),
+ m TINYBLOB,
+ n BLOB,
+ o MEDIUMBLOB,
+ p LONGBLOB,
+ q TINYTEXT,
+ r TEXT,
+ s MEDIUMTEXT,
+ t LONGTEXT
+);
+
+RESET MASTER;
+
+--echo *** Start replication ***
+connection slave;
+START SLAVE;
+
+--echo *** Insert data on master and display it. ***
+connection master;
+
+INSERT INTO t1 () VALUES (
+ 17.567,
+ 2.123,
+ 10.20,
+ 125,
+ hex(64),
+ 'TEST',
+ 'This is a test',
+ 'binary data',
+ 'more binary data',
+ '6',
+ '7',
+ "blob 1",
+ "blob 2",
+ "blob 3",
+ "blob 4",
+ "text 1",
+ "text 2",
+ "text 3",
+ "text 4");
+
+# Replace values in columns that display differently between SBR & RBR
+--replace_column 5 # 8 #
+SELECT * FROM t1 ORDER BY a;
+
+--echo *** Select data from slave to compare ***
+sync_slave_with_master;
+connection slave;
+
+# Replace values in columns that display differently between SBR & RBR
+--replace_column 5 # 8 #
+SELECT * FROM t1 ORDER BY a;
+
+# Test boundary limits of varchar and char fields
+# Master/Slave
+# <256/<256 with m < s, m > s, and m == s <-- col a
+# >255/<256 with m < s, m > s, and m == s <-- error will be caught in BUG#22086
+# <256/>255 with m < s, m > s, and m == s <-- col b
+# >255/>255 with m < s, m > s, and m == s <-- col c
+#
+# Test boundary limits of CHAR fields
+# Master/Slave
+# <256/<256 with m < s, m > s, and m == s <-- col d
+# >255/<256 with m < s, m > s, and m == s <-- error char limited to 255 chars
+# <256/>255 with m < s, m > s, and m == s <-- error char limited to 255 chars
+# >255/>255 with m < s, m > s, and m == s <-- error char limited to 255 chars
+
+connection master;
+DROP TABLE t1;
+
+--echo Create varchar table on master
+CREATE TABLE t1 (
+ a VARCHAR(50),
+ b VARCHAR(100),
+ c VARCHAR(300),
+ d CHAR(5)
+);
+
+sync_slave_with_master slave;
+
+--echo Alter varchar table on slave
+ALTER TABLE t1 CHANGE COLUMN a a VARCHAR(100);
+ALTER TABLE t1 CHANGE COLUMN b b VARCHAR(400);
+ALTER TABLE t1 CHANGE COLUMN c c VARCHAR(500);
+ALTER TABLE t1 CHANGE COLUMN d d CHAR(100);
+
+connection master;
+
+--echo Insert some values and select them on master
+INSERT INTO t1 VALUES ("This is a test of col a.",
+ "This is another test of col b.",
+ "This is a test of the large col c.",
+ "Col d");
+SELECT * FROM t1;
+SHOW CREATE TABLE t1;
+
+sync_slave_with_master slave;
+
+--echo Insert some values and select them on slave
+SELECT * FROM t1;
+SHOW CREATE TABLE t1;
+
+
+# Test boundary limits of bit fields
+# m < s, m % 8 != 0, and s % 8 == 0 col a
+# m < s, m % 8 == 0, and s % 8 != 0 col b
+# m < s, m % 8 != 0, and s % 8 != 0 col c
+# m > s, m % 8 != 0, and s % 8 == 0 <-- error will be caught in BUG#22086
+# m > s, m % 8 == 0, and s % 8 != 0 <-- error will be caught in BUG#22086
+# m > s, m % 8 != 0, and s % 8 != 0 <-- error will be caught in BUG#22086
+
+connection master;
+DROP TABLE t1;
+
+--echo Create bit table on master
+CREATE TABLE t1 (
+ a BIT(7),
+ b BIT(8),
+ c BIT(21),
+ d BIT(11),
+ e BIT(11)
+);
+
+sync_slave_with_master slave;
+
+--echo Create bit table on slave
+DROP TABLE t1;
+CREATE TABLE t1 (
+ a BIT(16),
+ b BIT(22),
+ c BIT(54),
+ d BIT(25),
+ e BIT(13)
+);
+
+connection master;
+
+--echo Insert some values and select them on master
+INSERT INTO t1 VALUES (
+ b'1010101',
+ b'10101011',
+ b'101010110101010101111',
+ b'10101010101',
+ b'10101011111'
+ );
+
+SELECT BIN(a), BIN(b), BIN(c), BIN(d), BIN(e) FROM t1;
+SHOW CREATE TABLE t1;
+
+sync_slave_with_master slave;
+
+--echo Insert some values and select them on master
+SELECT BIN(a), BIN(b), BIN(c), BIN(d), BIN(e) FROM t1;
+SHOW CREATE TABLE t1;
+
+--echo *** Cleanup ***
+connection master;
+DROP TABLE t1;
+sync_slave_with_master;
+
+# END 5.1 Test Case
diff --git a/mysql-test/suite/rpl/t/rpl_commit_after_flush.test b/mysql-test/suite/rpl/t/rpl_commit_after_flush.test
new file mode 100644
index 00000000000..47df391d6be
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_commit_after_flush.test
@@ -0,0 +1,12 @@
+#####################################
+# Wrapper for rpl_commit_after_flush#
+#####################################
+########################################################
+# By JBM 2005-02-15 Wrapped to allow reuse of test code#
+# Added to skip if ndb is default #
+########################################################
+-- source include/not_ndb_default.inc
+-- source include/have_innodb.inc
+-- source include/master-slave.inc
+let $engine_type=innodb;
+-- source extra/rpl_tests/rpl_commit_after_flush.test
diff --git a/mysql-test/t/rpl_create_database-master.opt b/mysql-test/suite/rpl/t/rpl_create_database-master.opt
index 85660a17140..85660a17140 100644
--- a/mysql-test/t/rpl_create_database-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_create_database-master.opt
diff --git a/mysql-test/t/rpl_create_database-slave.opt b/mysql-test/suite/rpl/t/rpl_create_database-slave.opt
index 96d630c9229..96d630c9229 100644
--- a/mysql-test/t/rpl_create_database-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_create_database-slave.opt
diff --git a/mysql-test/t/rpl_create_database.test b/mysql-test/suite/rpl/t/rpl_create_database.test
index 70cff8daca2..70cff8daca2 100644
--- a/mysql-test/t/rpl_create_database.test
+++ b/mysql-test/suite/rpl/t/rpl_create_database.test
diff --git a/mysql-test/suite/rpl/t/rpl_critical_errors.test b/mysql-test/suite/rpl/t/rpl_critical_errors.test
new file mode 100644
index 00000000000..abf827c8d1f
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_critical_errors.test
@@ -0,0 +1,66 @@
+# Test for BUG#26551
+#
+
+# This test is unfortunately very fragile and very dependent on the
+# load of the computer. The test is therefore disabled normally. It is
+# entered here to demonstrate how to check that the bug is actually
+# solved.
+
+--echo Turn on parsing to run this test
+
+disable_parsing;
+
+source include/master-slave.inc;
+
+connection master;
+CREATE TABLE t1 (data LONGBLOB) ENGINE=MYISAM;
+CREATE TABLE t2 (data LONGBLOB) ENGINE=MYISAM;
+
+INSERT INTO t1 (data) VALUES (repeat('a',1024*1024));
+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;
+sync_slave_with_master;
+
+connection master;
+send INSERT INTO t2 SELECT * FROM t1;
+
+connection master1;
+
+# This sleep is picked so that the query above has started to insert
+# some rows into t2. If it hasn't the slave will not stop below.
+sleep 4;
+
+# SHOW PROCESSLIST;
+
+# Code for the 5.1 server to get the thread id of the thread executing
+# the query above.
+#
+#SET @id = 0;
+#SELECT id INTO @id
+# FROM information_schema.processlist
+# WHERE info LIKE 'INSERT INTO t2%';
+
+# This is the connection that is executing the INSERT INTO t2...
+KILL QUERY 2;
+
+connection slave;
+
+# Here the slave will only stop if the query above actually started
+# inserting some rows into t2. Otherwise, it will hang forever.
+--source include/wait_for_slave_to_stop.inc
+
+# The following should be 0
+SELECT COUNT(*) FROM t2;
+
+# ... and there the error code should be 1317 (ER_QUERY_INTERRUPTED)
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 7 # 8 # 9 # 20 # 22 # 23 # 33 #
+query_vertical SHOW SLAVE STATUS;
+
+enable_parsing;
diff --git a/mysql-test/t/rpl_ddl.test b/mysql-test/suite/rpl/t/rpl_ddl.test
index 80df16a7a00..80df16a7a00 100644
--- a/mysql-test/t/rpl_ddl.test
+++ b/mysql-test/suite/rpl/t/rpl_ddl.test
diff --git a/mysql-test/suite/rpl/t/rpl_deadlock_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_deadlock_innodb-slave.opt
new file mode 100644
index 00000000000..c52c239a1a1
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_deadlock_innodb-slave.opt
@@ -0,0 +1 @@
+--innodb --innodb_lock_wait_timeout=4 --slave-transaction-retries=2 --max-relay-log-size=4096
diff --git a/mysql-test/t/rpl_deadlock_innodb.test b/mysql-test/suite/rpl/t/rpl_deadlock_innodb.test
index ee907f81b22..ee907f81b22 100644
--- a/mysql-test/t/rpl_deadlock_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_deadlock_innodb.test
diff --git a/mysql-test/suite/rpl/t/rpl_delete_no_where.test b/mysql-test/suite/rpl/t/rpl_delete_no_where.test
new file mode 100644
index 00000000000..64a293b4058
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_delete_no_where.test
@@ -0,0 +1,7 @@
+###################################################
+# By JBM 2006-02-14 added to skip test when NDB #
+##################################################
+-- source include/not_ndb_default.inc
+-- source include/master-slave.inc
+let $engine_type=myisam;
+-- source extra/rpl_tests/rpl_delete_no_where.test
diff --git a/mysql-test/t/rpl_do_grant.test b/mysql-test/suite/rpl/t/rpl_do_grant.test
index 5615900c2dd..5615900c2dd 100644
--- a/mysql-test/t/rpl_do_grant.test
+++ b/mysql-test/suite/rpl/t/rpl_do_grant.test
diff --git a/mysql-test/t/rpl_drop.test b/mysql-test/suite/rpl/t/rpl_drop.test
index b38007a755f..b38007a755f 100644
--- a/mysql-test/t/rpl_drop.test
+++ b/mysql-test/suite/rpl/t/rpl_drop.test
diff --git a/mysql-test/t/rpl_drop_db.test b/mysql-test/suite/rpl/t/rpl_drop_db.test
index 7f4a7843c4a..7f4a7843c4a 100644
--- a/mysql-test/t/rpl_drop_db.test
+++ b/mysql-test/suite/rpl/t/rpl_drop_db.test
diff --git a/mysql-test/t/rpl_drop_temp-slave.opt b/mysql-test/suite/rpl/t/rpl_drop_temp-slave.opt
index 2f9244c65ff..2f9244c65ff 100644
--- a/mysql-test/t/rpl_drop_temp-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_drop_temp-slave.opt
diff --git a/mysql-test/t/rpl_drop_temp.test b/mysql-test/suite/rpl/t/rpl_drop_temp.test
index 305c78d3f06..305c78d3f06 100644
--- a/mysql-test/t/rpl_drop_temp.test
+++ b/mysql-test/suite/rpl/t/rpl_drop_temp.test
diff --git a/mysql-test/t/rpl_dual_pos_advance-master.opt b/mysql-test/suite/rpl/t/rpl_dual_pos_advance-master.opt
index cef79bc8585..cef79bc8585 100644
--- a/mysql-test/t/rpl_dual_pos_advance-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_dual_pos_advance-master.opt
diff --git a/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test b/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test
new file mode 100644
index 00000000000..27c920a3186
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test
@@ -0,0 +1,114 @@
+# This test checks that in a dual-head setup
+# A->B->A, where A has --log-slave-updates (why would it?
+# assume that there is a C as slave of A),
+# then the Exec_master_log_pos of SHOW SLAVE STATUS does
+# not stay too low on B(BUG#13023 due to events ignored because
+# of their server id).
+# It also will test BUG#13861.
+
+source include/master-slave.inc;
+
+
+# set up "dual head"
+
+connection slave;
+reset master;
+
+connection master;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval change master to master_host="127.0.0.1",master_port=$SLAVE_MYPORT,master_user="root";
+
+start slave;
+
+# now we test it
+
+connection slave;
+
+create table t1 (n int);
+
+save_master_pos;
+connection master;
+sync_with_master;
+
+# Now test BUG#13861. This will be enabled when Guilhem fixes this
+# bug.
+
+# stop slave
+
+# create table t2 (n int); # create one ignored event
+
+# save_master_pos;
+# connection slave;
+# sync_with_master;
+
+# connection slave;
+
+# show tables;
+
+# save_master_pos;
+
+# create table t3 (n int);
+
+# connection master;
+
+# bug is that START SLAVE UNTIL may stop too late, we test that by
+# asking it to stop before creation of t3.
+
+# start slave until master_log_file="slave-bin.000001",master_log_pos=195;
+
+# wait until it's started (the position below is the start of "CREATE
+# TABLE t2") (otherwise wait_for_slave_to_stop may return at once)
+
+# select master_pos_wait("slave-bin.000001",137);
+
+# --source include/wait_for_slave_to_stop.inc
+
+# then BUG#13861 causes t3 to show up below (because stopped too
+# late).
+
+# show tables;
+
+# start slave;
+
+# BUG#13023 is that Exec_master_log_pos may stay too low "forever":
+
+connection master;
+
+create table t4 (n int); # create 3 ignored events
+create table t5 (n int);
+create table t6 (n int);
+
+save_master_pos;
+connection slave;
+sync_with_master;
+
+connection slave;
+
+save_master_pos;
+
+connection master;
+
+# then BUG#13023 caused hang below ("master" looks behind, while it's
+# not in terms of updates done).
+
+sync_with_master;
+
+show tables;
+
+# cleanup
+
+stop slave;
+reset slave;
+drop table t1,t4,t5,t6; # add t2 and t3 later
+
+save_master_pos;
+connection slave;
+sync_with_master;
+
+# End of 4.1 tests
+
+# Cleanup
+# The A->B->A replication causes the master to start writing relay logs
+# in var/run, remove them
+remove_file $MYSQLTEST_VARDIR/run/master-relay-bin.000001;
+remove_file $MYSQLTEST_VARDIR/run/master-relay-bin.index;
diff --git a/mysql-test/t/rpl_empty_master_crash-master.opt b/mysql-test/suite/rpl/t/rpl_empty_master_crash-master.opt
index cef79bc8585..cef79bc8585 100644
--- a/mysql-test/t/rpl_empty_master_crash-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_empty_master_crash-master.opt
diff --git a/mysql-test/suite/rpl/t/rpl_empty_master_crash.test b/mysql-test/suite/rpl/t/rpl_empty_master_crash.test
new file mode 100644
index 00000000000..f8e7870ae3c
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_empty_master_crash.test
@@ -0,0 +1,14 @@
+source include/master-slave.inc;
+
+source include/show_slave_status.inc;
+
+#
+# Load table should not succeed on the master as this is not a slave
+#
+--error 1218
+load table t1 from master;
+connection slave;
+--error 1188
+load table t1 from master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_err_ignoredtable-slave.opt b/mysql-test/suite/rpl/t/rpl_err_ignoredtable-slave.opt
index cb49119bfcb..cb49119bfcb 100644
--- a/mysql-test/t/rpl_err_ignoredtable-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_err_ignoredtable-slave.opt
diff --git a/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test b/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test
new file mode 100644
index 00000000000..4e06a6a7096
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test
@@ -0,0 +1,66 @@
+# Test for
+# Bug #797: If a query is ignored on slave (replicate-ignore-table) the slave
+# still checks that it has the same error as on the master.
+##########################################################################
+# 2006-02-07 JBM Added error code 1022 for NDB Engine + ORDER BY
+##########################################################################
+
+-- source include/master-slave.inc
+
+connection master;
+create table t1 (a int primary key);
+create table t4 (a int primary key);
+# generate an error that goes to the binlog
+--error 1022, ER_DUP_ENTRY
+insert into t1 values (1),(1);
+insert into t4 values (1),(2);
+save_master_pos;
+connection slave;
+# as the t1 table is ignored on the slave, the slave should be able to sync
+sync_with_master;
+# check that the table has been ignored, because otherwise the test is nonsense
+show tables like 't1';
+show tables like 't4';
+SELECT * FROM test.t4 ORDER BY a;
+connection master;
+drop table t1;
+save_master_pos;
+connection slave;
+sync_with_master;
+
+# Now test that even critical errors (connection killed)
+# are ignored if rules allow it.
+# The "kill" idea was copied from rpl000001.test.
+
+connection master1;
+select get_lock('crash_lock%20C', 10);
+
+connection master;
+create table t2 (a int primary key);
+insert into t2 values(1);
+create table t3 (id int);
+insert into t3 values(connection_id());
+send update t2 set a = a + 1 + get_lock('crash_lock%20C', 10);
+
+connection master1;
+real_sleep 2;
+select (@id := id) - id from t3;
+kill @id;
+drop table t2,t3;
+insert into t4 values (3),(4);
+connection master;
+--error 0,1053,2013
+reap;
+connection master1;
+save_master_pos;
+connection slave;
+sync_with_master;
+SELECT * FROM test.t4 ORDER BY a;
+
+connection master1;
+DROP TABLE test.t4;
+save_master_pos;
+connection slave;
+sync_with_master;
+# End of 4.1 tests
+# Adding comment for force manual merge 5.0 -> wl1012. delete me if needed
diff --git a/mysql-test/suite/rpl/t/rpl_events.test b/mysql-test/suite/rpl/t/rpl_events.test
new file mode 100644
index 00000000000..62ffead7dcb
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_events.test
@@ -0,0 +1,47 @@
+##################################################################
+# Author: Giuseppe #
+# Date: 2006-12-20 #
+# Purpose: To test that event effects are replicated #
+# in both row based and statement based format #
+##################################################################
+
+set global event_scheduler=1;
+
+--source include/not_embedded.inc
+--source include/master-slave.inc
+
+let $engine_type= MyISAM;
+
+set binlog_format=row;
+
+# Embedded server doesn't support binlogging
+--source include/rpl_events.inc
+
+set binlog_format=statement;
+
+# Embedded server doesn't support binlogging
+--source include/rpl_events.inc
+
+#
+# Bug #28953 Using events in a replication let the slave crash.
+#
+
+connection master;
+
+DELIMITER |;
+CREATE EVENT event1 ON SCHEDULE EVERY 1 YEAR
+DO BEGIN
+ select * from t1;
+END;|
+DELIMITER ;|
+
+ALTER EVENT event1 RENAME TO event2;
+
+sync_slave_with_master;
+
+connection master;
+
+DROP EVENT event2;
+
+sync_slave_with_master;
+
diff --git a/mysql-test/t/rpl_extraCol_innodb-master.opt b/mysql-test/suite/rpl/t/rpl_extraCol_innodb-master.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_extraCol_innodb-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_extraCol_innodb-master.opt
diff --git a/mysql-test/t/rpl_extraCol_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_extraCol_innodb-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_extraCol_innodb-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_extraCol_innodb-slave.opt
diff --git a/mysql-test/t/rpl_extraCol_innodb.test b/mysql-test/suite/rpl/t/rpl_extraCol_innodb.test
index e9685baf01b..e9685baf01b 100644
--- a/mysql-test/t/rpl_extraCol_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_extraCol_innodb.test
diff --git a/mysql-test/t/rpl_extraCol_myisam.test b/mysql-test/suite/rpl/t/rpl_extraCol_myisam.test
index d56df394ccf..d56df394ccf 100644
--- a/mysql-test/t/rpl_extraCol_myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_extraCol_myisam.test
diff --git a/mysql-test/t/rpl_auto_increment-slave.opt b/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb-master.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_auto_increment-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb-master.opt
diff --git a/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb-slave.opt
new file mode 100644
index 00000000000..1338b6eba04
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb-slave.opt
@@ -0,0 +1 @@
+ --innodb
diff --git a/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb.test b/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb.test
new file mode 100644
index 00000000000..082c22329fa
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb.test
@@ -0,0 +1,15 @@
+#############################################################
+# Purpose: To test having extra columns on the master WL#3915
+#############################################################
+-- source include/master-slave.inc
+-- source include/have_innodb.inc
+
+let $engine_type = 'InnoDB';
+
+set binlog_format=row;
+-- source extra/rpl_tests/rpl_extraMaster_Col.test
+
+set binlog_format=statement;
+-- source extra/rpl_tests/rpl_extraMaster_Col.test
+
+
diff --git a/mysql-test/suite/rpl/t/rpl_extraColmaster_myisam.test b/mysql-test/suite/rpl/t/rpl_extraColmaster_myisam.test
new file mode 100644
index 00000000000..5bbd7953294
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_extraColmaster_myisam.test
@@ -0,0 +1,13 @@
+#############################################################
+# Purpose: To test having extra columns on the master WL#3915
+#############################################################
+-- source include/master-slave.inc
+
+let $engine_type = 'MyISAM';
+
+set binlog_format=row;
+-- source extra/rpl_tests/rpl_extraMaster_Col.test
+
+set binlog_format=statement;
+-- source extra/rpl_tests/rpl_extraMaster_Col.test
+
diff --git a/mysql-test/t/rpl_failed_optimize-master.opt b/mysql-test/suite/rpl/t/rpl_failed_optimize-master.opt
index 3f82baff598..3f82baff598 100644
--- a/mysql-test/t/rpl_failed_optimize-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_failed_optimize-master.opt
diff --git a/mysql-test/t/rpl_failed_optimize.test b/mysql-test/suite/rpl/t/rpl_failed_optimize.test
index 81e8342b5c0..81e8342b5c0 100644
--- a/mysql-test/t/rpl_failed_optimize.test
+++ b/mysql-test/suite/rpl/t/rpl_failed_optimize.test
diff --git a/mysql-test/t/rpl_flushlog_loop-master.opt b/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt
index a4d1d403dc9..a4d1d403dc9 100644
--- a/mysql-test/t/rpl_flushlog_loop-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt
diff --git a/mysql-test/t/rpl_flushlog_loop-master.sh b/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.sh
index a321dd690cd..a321dd690cd 100755
--- a/mysql-test/t/rpl_flushlog_loop-master.sh
+++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.sh
diff --git a/mysql-test/t/rpl_flushlog_loop-slave.opt b/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt
index 95839c831c9..95839c831c9 100644
--- a/mysql-test/t/rpl_flushlog_loop-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt
diff --git a/mysql-test/t/rpl_flushlog_loop-slave.sh b/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.sh
index e46ea6d400b..e46ea6d400b 100755
--- a/mysql-test/t/rpl_flushlog_loop-slave.sh
+++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.sh
diff --git a/mysql-test/suite/rpl/t/rpl_flushlog_loop.test b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test
new file mode 100644
index 00000000000..7d92ba9c2f4
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test
@@ -0,0 +1,49 @@
+# Testing if "flush logs" command bouncing resulting in logs created in a loop
+# in case of bi-directional replication
+-- source include/master-slave.inc
+
+#
+# Start replication master -> slave
+#
+# We have to sync with master, to ensure slave had time to start properly
+# before we stop it. If not, we get errors about UNIX_TIMESTAMP() in the log.
+sync_slave_with_master;
+connection slave;
+--disable_warnings
+stop slave;
+--enable_warnings
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval change master to master_host='127.0.0.1',master_user='root',
+ master_password='',master_port=$MASTER_MYPORT;
+start slave;
+
+#
+# Start replication slave -> master
+#
+connection master;
+--disable_warnings
+stop slave;
+--enable_warnings
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval change master to master_host='127.0.0.1',master_user='root',
+ master_password='',master_port=$SLAVE_MYPORT;
+start slave;
+
+#
+# Wait for start of slave IO and SQL threads
+#
+let $result_pattern= '%127.0.0.1%root%slave-bin.000001%slave-bin.000001%Yes%Yes%0%0%None%';
+--source include/wait_slave_status.inc
+
+#
+# Flush logs of slave
+#
+flush logs;
+sleep 5;
+
+#
+# Show status of slave
+#
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 # 34 # 35 #
+--query_vertical SHOW SLAVE STATUS
diff --git a/mysql-test/t/rpl_foreign_key_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_foreign_key_innodb-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_foreign_key_innodb-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_foreign_key_innodb-slave.opt
diff --git a/mysql-test/t/rpl_foreign_key_innodb.test b/mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test
index d085bff2012..d085bff2012 100644
--- a/mysql-test/t/rpl_foreign_key_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test
diff --git a/mysql-test/t/rpl_free_items-slave.opt b/mysql-test/suite/rpl/t/rpl_free_items-slave.opt
index b828d03fafb..b828d03fafb 100644
--- a/mysql-test/t/rpl_free_items-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_free_items-slave.opt
diff --git a/mysql-test/t/rpl_free_items.test b/mysql-test/suite/rpl/t/rpl_free_items.test
index 043e84160b8..043e84160b8 100644
--- a/mysql-test/t/rpl_free_items.test
+++ b/mysql-test/suite/rpl/t/rpl_free_items.test
diff --git a/mysql-test/t/rpl_get_lock.test b/mysql-test/suite/rpl/t/rpl_get_lock.test
index 945bd98c993..945bd98c993 100644
--- a/mysql-test/t/rpl_get_lock.test
+++ b/mysql-test/suite/rpl/t/rpl_get_lock.test
diff --git a/mysql-test/suite/rpl/t/rpl_grant.test b/mysql-test/suite/rpl/t/rpl_grant.test
new file mode 100644
index 00000000000..71e36342584
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_grant.test
@@ -0,0 +1,42 @@
+# Tests of grants and users
+
+source include/master-slave.inc;
+source include/not_embedded.inc;
+
+--echo **** On Master ****
+connection master;
+
+CREATE USER dummy@localhost;
+CREATE USER dummy1@localhost, dummy2@localhost;
+
+SELECT user, host FROM mysql.user WHERE user != 'root'; # root host non-determ
+SELECT COUNT(*) FROM mysql.user;
+sync_slave_with_master;
+--echo **** On Slave ****
+SELECT user,host FROM mysql.user WHERE user != 'root'; # root host non-determ
+SELECT COUNT(*) FROM mysql.user;
+
+--echo **** On Master ****
+connection master;
+
+# No user exists
+error ER_CANNOT_USER;
+DROP USER nonexisting@localhost;
+
+# At least one user exists, but not all
+error ER_CANNOT_USER;
+DROP USER nonexisting@localhost, dummy@localhost;
+
+# All users exist
+DROP USER dummy1@localhost, dummy2@localhost;
+
+SELECT user, host FROM mysql.user WHERE user != 'root'; # root host non-determ
+SELECT COUNT(*) FROM mysql.user;
+sync_slave_with_master;
+--echo **** On Slave ****
+SELECT user,host FROM mysql.user WHERE user != 'root'; # root host non-determ
+SELECT COUNT(*) FROM mysql.user;
+
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 8 # 9 # 23 # 33 #
+query_vertical SHOW SLAVE STATUS;
diff --git a/mysql-test/t/rpl_ignore_grant-slave.opt b/mysql-test/suite/rpl/t/rpl_ignore_grant-slave.opt
index e931bfbd37e..e931bfbd37e 100644
--- a/mysql-test/t/rpl_ignore_grant-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_ignore_grant-slave.opt
diff --git a/mysql-test/t/rpl_ignore_grant.test b/mysql-test/suite/rpl/t/rpl_ignore_grant.test
index 2e6e2ce9a31..2e6e2ce9a31 100644
--- a/mysql-test/t/rpl_ignore_grant.test
+++ b/mysql-test/suite/rpl/t/rpl_ignore_grant.test
diff --git a/mysql-test/t/rpl_ignore_revoke-slave.opt b/mysql-test/suite/rpl/t/rpl_ignore_revoke-slave.opt
index e931bfbd37e..e931bfbd37e 100644
--- a/mysql-test/t/rpl_ignore_revoke-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_ignore_revoke-slave.opt
diff --git a/mysql-test/t/rpl_ignore_revoke.test b/mysql-test/suite/rpl/t/rpl_ignore_revoke.test
index 00171605a92..00171605a92 100644
--- a/mysql-test/t/rpl_ignore_revoke.test
+++ b/mysql-test/suite/rpl/t/rpl_ignore_revoke.test
diff --git a/mysql-test/t/rpl_ignore_table-slave.opt b/mysql-test/suite/rpl/t/rpl_ignore_table-slave.opt
index 3aabbb2e0f5..3aabbb2e0f5 100644
--- a/mysql-test/t/rpl_ignore_table-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_ignore_table-slave.opt
diff --git a/mysql-test/t/rpl_ignore_table.test b/mysql-test/suite/rpl/t/rpl_ignore_table.test
index fd4ae64165a..fd4ae64165a 100644
--- a/mysql-test/t/rpl_ignore_table.test
+++ b/mysql-test/suite/rpl/t/rpl_ignore_table.test
diff --git a/mysql-test/t/rpl_ignore_table_update-slave.opt b/mysql-test/suite/rpl/t/rpl_ignore_table_update-slave.opt
index 177f89e0910..177f89e0910 100644
--- a/mysql-test/t/rpl_ignore_table_update-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_ignore_table_update-slave.opt
diff --git a/mysql-test/t/rpl_ignore_table_update.test b/mysql-test/suite/rpl/t/rpl_ignore_table_update.test
index fe030f90411..fe030f90411 100644
--- a/mysql-test/t/rpl_ignore_table_update.test
+++ b/mysql-test/suite/rpl/t/rpl_ignore_table_update.test
diff --git a/mysql-test/t/rpl_incident-master.opt b/mysql-test/suite/rpl/t/rpl_incident-master.opt
index 912801debc4..912801debc4 100644
--- a/mysql-test/t/rpl_incident-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_incident-master.opt
diff --git a/mysql-test/suite/rpl/t/rpl_incident.test b/mysql-test/suite/rpl/t/rpl_incident.test
new file mode 100644
index 00000000000..507cd0e0798
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_incident.test
@@ -0,0 +1,42 @@
+--source include/master-slave.inc
+--source include/have_debug.inc
+
+--echo **** On Master ****
+CREATE TABLE t1 (a INT);
+
+INSERT INTO t1 VALUES (1),(2),(3);
+SELECT * FROM t1;
+
+# This will generate an incident log event and store it in the binary
+# log before the replace statement.
+REPLACE INTO t1 VALUES (4);
+--save_master_pos
+SELECT * FROM t1;
+
+connection slave;
+--wait_for_slave_to_stop
+
+# The 4 should not be inserted into the table, since the incident log
+# event should have stop the slave.
+--echo **** On Slave ****
+SELECT * FROM t1;
+
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 6 # 7 # 8 # 9 # 22 # 23 # 33 #
+--query_vertical SHOW SLAVE STATUS
+
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
+START SLAVE;
+--sync_with_master
+
+# Now, we should have inserted the row into the table and the slave
+# should be running. We should also have rotated to a new binary log.
+
+SELECT * FROM t1;
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 6 # 7 # 8 # 9 # 22 # 23 # 33 #
+--query_vertical SHOW SLAVE STATUS
+
+connection master;
+DROP TABLE t1;
+--sync_slave_with_master
diff --git a/mysql-test/t/rpl_init_slave-slave.opt b/mysql-test/suite/rpl/t/rpl_init_slave-slave.opt
index 337e8a60d97..337e8a60d97 100644
--- a/mysql-test/t/rpl_init_slave-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_init_slave-slave.opt
diff --git a/mysql-test/t/rpl_init_slave.test b/mysql-test/suite/rpl/t/rpl_init_slave.test
index 139b4902e12..139b4902e12 100644
--- a/mysql-test/t/rpl_init_slave.test
+++ b/mysql-test/suite/rpl/t/rpl_init_slave.test
diff --git a/mysql-test/suite/rpl/t/rpl_innodb-master.opt b/mysql-test/suite/rpl/t/rpl_innodb-master.opt
new file mode 100644
index 00000000000..8636d2d8734
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_innodb-master.opt
@@ -0,0 +1 @@
+--innodb --innodb_autoinc_lock_mode=0
diff --git a/mysql-test/suite/rpl/t/rpl_innodb.test b/mysql-test/suite/rpl/t/rpl_innodb.test
new file mode 100644
index 00000000000..30d40e19614
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_innodb.test
@@ -0,0 +1,115 @@
+# File for specialities regarding replication from or to InnoDB
+# tables.
+
+source include/master-slave.inc;
+source include/have_innodb.inc;
+
+#
+# Bug#11401: Load data infile 'REPLACE INTO' fails on slave.
+#
+connection master;
+CREATE TABLE t4 (
+ id INT(5) unsigned NOT NULL auto_increment,
+ name varchar(15) NOT NULL default '',
+ number varchar(35) NOT NULL default 'default',
+ PRIMARY KEY (id),
+ UNIQUE KEY unique_rec (name,number)
+) ENGINE=InnoDB;
+
+--disable_warnings
+LOAD DATA
+ INFILE '../std_data_ln/loaddata_pair.dat'
+ REPLACE INTO TABLE t4
+ (name,number);
+--enable_warnings
+SELECT * FROM t4;
+
+sync_slave_with_master;
+SELECT * FROM t4;
+
+connection master;
+--disable_warnings
+LOAD DATA
+ INFILE '../std_data_ln/loaddata_pair.dat'
+ REPLACE INTO TABLE t4
+ (name,number);
+--enable_warnings
+SELECT * FROM t4;
+
+sync_slave_with_master;
+SELECT * FROM t4;
+
+connection master;
+--disable_query_log
+DROP TABLE t4;
+--enable_query_log
+sync_slave_with_master;
+connection master;
+
+# End of 4.1 tests
+
+#
+# Bug #26418: Slave out of sync after CREATE/DROP TEMPORARY TABLE + ROLLBACK
+# on master
+#
+#Note Matthias: to be merged to rpl_ddl.test
+
+--source include/not_ndb_default.inc
+
+FLUSH LOGS;
+sync_slave_with_master;
+FLUSH LOGS;
+connection master;
+let $engine_type= "InnoDB";
+
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest1;
+--enable_warnings
+
+CREATE DATABASE mysqltest1;
+CREATE TEMPORARY TABLE mysqltest1.tmp (f1 BIGINT);
+eval CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE=$engine_type;
+SET AUTOCOMMIT = 0;
+
+sync_slave_with_master;
+--echo -------- switch to slave --------
+connection slave;
+SHOW CREATE TABLE mysqltest1.t1;
+
+--echo -------- switch to master --------
+connection master;
+INSERT INTO mysqltest1.t1 SET f1= 1;
+DROP TEMPORARY TABLE mysqltest1.tmp;
+ROLLBACK;
+--error ER_NO_SUCH_TABLE
+SHOW CREATE TABLE mysqltest1.tmp;
+# Must return no rows here
+SELECT COUNT(*) FROM mysqltest1.t1;
+
+INSERT INTO mysqltest1.t1 SET f1= 2;
+CREATE TEMPORARY TABLE mysqltest1.tmp2(a INT);
+ROLLBACK;
+SHOW CREATE TABLE mysqltest1.tmp2;
+# Must return no rows here
+SELECT COUNT(*) FROM mysqltest1.t1;
+
+sync_slave_with_master;
+--echo -------- switch to slave --------
+connection slave;
+--error ER_NO_SUCH_TABLE
+SHOW CREATE TABLE mysqltest1.tmp;
+--error ER_NO_SUCH_TABLE
+SHOW CREATE TABLE mysqltest1.tmp2;
+# has two rows here : as the default is MyISAM and
+# it can't be rolled back by the master's ROLLBACK.
+SELECT COUNT(*) FROM mysqltest1.t1;
+FLUSH LOGS;
+
+--echo -------- switch to master --------
+connection master;
+FLUSH LOGS;
+
+DROP DATABASE mysqltest1;
+-- source include/master-slave-end.inc
+
+--echo End of 5.1 tests
diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug28430-master.opt b/mysql-test/suite/rpl/t/rpl_innodb_bug28430-master.opt
new file mode 100644
index 00000000000..8636d2d8734
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_innodb_bug28430-master.opt
@@ -0,0 +1 @@
+--innodb --innodb_autoinc_lock_mode=0
diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug28430-slave.opt b/mysql-test/suite/rpl/t/rpl_innodb_bug28430-slave.opt
new file mode 100644
index 00000000000..8636d2d8734
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_innodb_bug28430-slave.opt
@@ -0,0 +1 @@
+--innodb --innodb_autoinc_lock_mode=0
diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test b/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test
new file mode 100644
index 00000000000..fe3881ab08f
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test
@@ -0,0 +1,154 @@
+--source include/have_innodb.inc
+--source include/have_binlog_format_mixed_or_row.inc
+--source include/master-slave.inc
+
+# Set the default connection to 'master'
+
+--vertical_results
+
+let $engine_type= 'innodb';
+
+######## Creat Table Section #########
+use test;
+
+eval CREATE TABLE test.regular_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+ fkid MEDIUMINT, filler VARCHAR(255),
+ PRIMARY KEY(id)) ENGINE=$engine_type;
+
+eval CREATE TABLE test.bykey_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+ fkid MEDIUMINT, filler VARCHAR(255),
+ PRIMARY KEY(id)) ENGINE=$engine_type
+ PARTITION BY KEY(id) partitions 5;
+
+eval CREATE TABLE test.byrange_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+ fkid MEDIUMINT, filler VARCHAR(255),
+ PRIMARY KEY(id)) ENGINE=$engine_type
+ PARTITION BY RANGE(id)
+ SUBPARTITION BY hash(id) subpartitions 2
+ (PARTITION pa1 values less than (10),
+ PARTITION pa2 values less than (20),
+ PARTITION pa3 values less than (30),
+ PARTITION pa4 values less than (40),
+ PARTITION pa5 values less than (50),
+ PARTITION pa6 values less than (60),
+ PARTITION pa7 values less than (70),
+ PARTITION pa8 values less than (80),
+ PARTITION pa9 values less than (90),
+ PARTITION pa10 values less than (100),
+ PARTITION pa11 values less than MAXVALUE);
+
+######## Create SPs, Functions, Views and Triggers Section ##############
+
+delimiter |;
+CREATE PROCEDURE test.proc_norm()
+BEGIN
+ DECLARE ins_count INT DEFAULT 1000;
+ DECLARE del_count INT;
+ DECLARE cur_user VARCHAR(255);
+ DECLARE local_uuid VARCHAR(255);
+ DECLARE local_time TIMESTAMP;
+
+ SET local_time= NOW();
+ SET cur_user= CURRENT_USER();
+ SET local_uuid= UUID();
+
+ WHILE ins_count > 0 DO
+ INSERT INTO test.regular_tbl VALUES (NULL, NOW(), USER() , UUID(),
+ ins_count,'Going to test MBR for MySQL');
+ SET ins_count = ins_count - 1;
+ END WHILE;
+
+ SELECT MAX(id) FROM test.regular_tbl INTO del_count;
+ WHILE del_count > 0 DO
+ DELETE FROM test.regular_tbl WHERE id = del_count;
+ SET del_count = del_count - 2;
+ END WHILE;
+END|
+
+CREATE PROCEDURE test.proc_bykey()
+BEGIN
+ DECLARE ins_count INT DEFAULT 1000;
+ DECLARE del_count INT;
+ DECLARE cur_user VARCHAR(255);
+ DECLARE local_uuid VARCHAR(255);
+ DECLARE local_time TIMESTAMP;
+
+ SET local_time= NOW();
+ SET cur_user= CURRENT_USER();
+ SET local_uuid= UUID();
+
+ WHILE ins_count > 0 DO
+ INSERT INTO test.bykey_tbl VALUES (NULL, NOW(), USER() , UUID(),
+ ins_count,'Going to test MBR for MySQL');
+ SET ins_count = ins_count - 1;
+ END WHILE;
+
+ SELECT MAX(id) FROM test.bykey_tbl INTO del_count;
+ WHILE del_count > 0 DO
+ DELETE FROM test.bykey_tbl WHERE id = del_count;
+ SET del_count = del_count - 2;
+ END WHILE;
+END|
+
+CREATE PROCEDURE test.proc_byrange()
+BEGIN
+ DECLARE ins_count INT DEFAULT 1000;
+ DECLARE del_count INT;
+ DECLARE cur_user VARCHAR(255);
+ DECLARE local_uuid VARCHAR(255);
+ DECLARE local_time TIMESTAMP;
+
+ SET local_time= NOW();
+ SET cur_user = CURRENT_USER();
+ SET local_uuid=UUID();
+
+ WHILE ins_count > 0 DO
+ INSERT INTO test.byrange_tbl VALUES (NULL, NOW(), USER(), UUID(),
+ ins_count,'Going to test MBR for MySQL');
+ SET ins_count = ins_count - 1;
+ END WHILE;
+
+ SELECT MAX(id) FROM test.byrange_tbl INTO del_count;
+ WHILE del_count > 0 DO
+ DELETE FROM test.byrange_tbl WHERE id = del_count;
+ SET del_count = del_count - 2;
+ END WHILE;
+END|
+
+delimiter ;|
+
+############ Finish Setup Section ###################
+
+
+############ Test Section ###################
+
+CALL test.proc_norm();
+SELECT count(*) as "Master regular" FROM test.regular_tbl;
+CALL test.proc_bykey();
+SELECT count(*) as "Master bykey" FROM test.bykey_tbl;
+CALL test.proc_byrange();
+SELECT count(*) as "Master byrange" FROM test.byrange_tbl;
+
+--sync_slave_with_master
+connection slave;
+show create table test.byrange_tbl;
+--replace_column 4 MASTER_PORT 33 #
+show slave status;
+SELECT count(*) "Slave norm" FROM test.regular_tbl;
+SELECT count(*) "Slave bykey" FROM test.bykey_tbl;
+SELECT count(*) "Slave byrange" FROM test.byrange_tbl;
+
+###### CLEAN UP SECTION ##############
+
+connection master;
+DROP PROCEDURE test.proc_norm;
+DROP PROCEDURE test.proc_bykey;
+DROP PROCEDURE test.proc_byrange;
+DROP TABLE test.regular_tbl;
+DROP TABLE test.bykey_tbl;
+DROP TABLE test.byrange_tbl;
+
+--source include/master-slave-end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug30888.test b/mysql-test/suite/rpl/t/rpl_innodb_bug30888.test
new file mode 100644
index 00000000000..4311328b064
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_innodb_bug30888.test
@@ -0,0 +1,66 @@
+--source include/have_innodb.inc
+--source include/have_binlog_format_mixed_or_row.inc
+--source include/master-slave.inc
+
+# Set the default connection to 'master'
+
+--vertical_results
+
+#let $engine_type= 'myisam';
+let $engine_type= 'innodb';
+
+######## Creat Table Section #########
+use test;
+
+eval CREATE TABLE test.regular_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+ fkid MEDIUMINT, filler VARCHAR(255),
+ PRIMARY KEY(id)) ENGINE=$engine_type;
+
+######## Create SPs, Functions, Views and Triggers Section ##############
+
+delimiter |;
+CREATE PROCEDURE test.proc_norm()
+BEGIN
+ DECLARE ins_count INT DEFAULT 1000;
+ DECLARE del_count INT;
+ DECLARE cur_user VARCHAR(255);
+ DECLARE local_uuid VARCHAR(255);
+ DECLARE local_time TIMESTAMP;
+
+ SET local_time= NOW();
+ SET cur_user= CURRENT_USER();
+ SET local_uuid= UUID();
+
+ WHILE ins_count > 0 DO
+ INSERT INTO test.regular_tbl VALUES (NULL, NOW(), USER() , UUID(),
+ ins_count,'Going to test MBR for MySQL');
+ SET ins_count = ins_count - 1;
+ END WHILE;
+
+ SELECT MAX(id) FROM test.regular_tbl INTO del_count;
+ WHILE del_count > 0 DO
+ DELETE FROM test.regular_tbl WHERE id = del_count;
+ SET del_count = del_count - 2;
+ END WHILE;
+END|
+
+delimiter ;|
+
+############ Finish Setup Section ###################
+
+
+############ Test Section ###################
+
+CALL test.proc_norm();
+
+--sync_slave_with_master
+
+###### CLEAN UP SECTION ##############
+
+connection master;
+DROP PROCEDURE test.proc_norm;
+DROP TABLE test.regular_tbl;
+
+--source include/master-slave-end.inc
+
diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug30919-master.opt b/mysql-test/suite/rpl/t/rpl_innodb_bug30919-master.opt
new file mode 100644
index 00000000000..8636d2d8734
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_innodb_bug30919-master.opt
@@ -0,0 +1 @@
+--innodb --innodb_autoinc_lock_mode=0
diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug30919.test b/mysql-test/suite/rpl/t/rpl_innodb_bug30919.test
new file mode 100644
index 00000000000..a3779c68021
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_innodb_bug30919.test
@@ -0,0 +1,67 @@
+--source include/have_innodb.inc
+--vertical_results
+let $engine_type= 'innodb';
+
+######## Creat Table Section #########
+use test;
+
+eval CREATE TABLE test.part_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+ fkid MEDIUMINT, filler VARCHAR(255),
+ PRIMARY KEY(id)) ENGINE=$engine_type
+ PARTITION BY RANGE(id)
+ SUBPARTITION BY hash(id) subpartitions 2
+ (PARTITION pa3 values less than (42),
+ PARTITION pa6 values less than (60),
+ PARTITION pa7 values less than (70),
+ PARTITION pa8 values less than (80),
+ PARTITION pa9 values less than (90),
+ PARTITION pa10 values less than (100),
+ PARTITION pa11 values less than MAXVALUE);
+
+######## Create SPs, Functions, Views and Triggers Section ##############
+
+delimiter |;
+
+CREATE PROCEDURE test.proc_part()
+BEGIN
+ DECLARE ins_count INT DEFAULT 1000;
+ DECLARE del_count INT;
+ DECLARE cur_user VARCHAR(255);
+ DECLARE local_uuid VARCHAR(255);
+ DECLARE local_time TIMESTAMP;
+
+ SET local_time= NOW();
+ SET cur_user= CURRENT_USER();
+ SET local_uuid= UUID();
+
+ WHILE ins_count > 0 DO
+ INSERT INTO test.part_tbl VALUES (NULL, NOW(), USER() , UUID(),
+ ins_count,'Going to test MBR for MySQL');
+ SET ins_count = ins_count - 1;
+ END WHILE;
+ SELECT MAX(id) FROM test.part_tbl INTO del_count;
+ WHILE del_count > 0 DO
+ DELETE FROM test.part_tbl WHERE id = del_count;
+ select count(*) as internal_count, del_count -- these two lines are for
+ FROM test.part_tbl; -- debug to show the problem
+ SET del_count = del_count - 2;
+ END WHILE;
+END|
+
+delimiter ;|
+
+############ Finish Setup Section ###################
+
+############ Test Section ###################
+--horizontal_results
+
+CALL test.proc_part();
+
+select count(*) as Part from test.part_tbl;
+
+###### CLEAN UP SECTION ##############
+
+DROP PROCEDURE test.proc_part;
+DROP TABLE test.part_tbl;
+
diff --git a/mysql-test/suite/rpl/t/rpl_innodb_mixed_ddl.test b/mysql-test/suite/rpl/t/rpl_innodb_mixed_ddl.test
index 1d4709bb548..6eb9c7075e4 100644
--- a/mysql-test/suite/rpl/t/rpl_innodb_mixed_ddl.test
+++ b/mysql-test/suite/rpl/t/rpl_innodb_mixed_ddl.test
@@ -5,9 +5,10 @@
# Requirements: define binlog format for mysqld as in example below:
# ./mysql-test-run.pl --mysqld=--binlog-format=mixed
#########################################
-
+--source include/have_binlog_format_mixed.inc
--source include/have_innodb.inc
let $engine_type= innodb;
--source suite/rpl/include/rpl_mixed_ddl.inc
+# End 5.1 Test Case
diff --git a/mysql-test/suite/rpl/t/rpl_innodb_mixed_dml.test b/mysql-test/suite/rpl/t/rpl_innodb_mixed_dml.test
index f6b21c4af1c..d48e847a6c8 100644
--- a/mysql-test/suite/rpl/t/rpl_innodb_mixed_dml.test
+++ b/mysql-test/suite/rpl/t/rpl_innodb_mixed_dml.test
@@ -5,9 +5,10 @@
# Requirements: define binlog format for mysqld as in example below:
# ./mysql-test-run.pl --mysqld=--binlog-format=mixed
#########################################
-
+--source include/have_binlog_format_mixed.inc
--source include/have_innodb.inc
let $engine_type= innodb;
--source suite/rpl/include/rpl_mixed_dml.inc
+# End 5.1 Test Case
diff --git a/mysql-test/t/rpl_insert.test b/mysql-test/suite/rpl/t/rpl_insert.test
index 0d471a0e0a9..0d471a0e0a9 100644
--- a/mysql-test/t/rpl_insert.test
+++ b/mysql-test/suite/rpl/t/rpl_insert.test
diff --git a/mysql-test/suite/rpl/t/rpl_insert_id-slave.opt b/mysql-test/suite/rpl/t/rpl_insert_id-slave.opt
new file mode 100644
index 00000000000..48457b17309
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_insert_id-slave.opt
@@ -0,0 +1 @@
+--loose-innodb
diff --git a/mysql-test/t/rpl_insert_id.test b/mysql-test/suite/rpl/t/rpl_insert_id.test
index bfd66431d3c..bfd66431d3c 100644
--- a/mysql-test/t/rpl_insert_id.test
+++ b/mysql-test/suite/rpl/t/rpl_insert_id.test
diff --git a/mysql-test/suite/rpl/t/rpl_insert_id_pk-slave.opt b/mysql-test/suite/rpl/t/rpl_insert_id_pk-slave.opt
new file mode 100644
index 00000000000..48457b17309
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_insert_id_pk-slave.opt
@@ -0,0 +1 @@
+--loose-innodb
diff --git a/mysql-test/t/rpl_insert_id_pk.test b/mysql-test/suite/rpl/t/rpl_insert_id_pk.test
index 01f30b78ac5..01f30b78ac5 100644
--- a/mysql-test/t/rpl_insert_id_pk.test
+++ b/mysql-test/suite/rpl/t/rpl_insert_id_pk.test
diff --git a/mysql-test/suite/rpl/t/rpl_insert_ignore-slave.opt b/mysql-test/suite/rpl/t/rpl_insert_ignore-slave.opt
new file mode 100644
index 00000000000..48457b17309
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_insert_ignore-slave.opt
@@ -0,0 +1 @@
+--loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_insert_ignore.test b/mysql-test/suite/rpl/t/rpl_insert_ignore.test
new file mode 100644
index 00000000000..2709430f85d
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_insert_ignore.test
@@ -0,0 +1,9 @@
+#####################################
+# Wrapper for rpl_insert_ignore.test#
+#####################################
+-- source include/not_ndb_default.inc
+-- source include/have_innodb.inc
+-- source include/master-slave.inc
+let $engine_type=innodb;
+let $engine_type2=myisam;
+-- source extra/rpl_tests/rpl_insert_ignore.test
diff --git a/mysql-test/t/rpl_insert_select.test b/mysql-test/suite/rpl/t/rpl_insert_select.test
index 677be526982..677be526982 100644
--- a/mysql-test/t/rpl_insert_select.test
+++ b/mysql-test/suite/rpl/t/rpl_insert_select.test
diff --git a/mysql-test/t/rpl_insert_id-slave.opt b/mysql-test/suite/rpl/t/rpl_invoked_features-master.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_insert_id-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_invoked_features-master.opt
diff --git a/mysql-test/t/rpl_insert_id_pk-slave.opt b/mysql-test/suite/rpl/t/rpl_invoked_features-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_insert_id_pk-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_invoked_features-slave.opt
diff --git a/mysql-test/suite/rpl/t/rpl_invoked_features.test b/mysql-test/suite/rpl/t/rpl_invoked_features.test
new file mode 100644
index 00000000000..e797e0552ef
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_invoked_features.test
@@ -0,0 +1,282 @@
+#########################################
+# Author: Serge Kozlov skozlov@mysql.com
+# Date: 04/25/2007
+# Purpose: Testing Invocation and Invoked
+# Features for Replication.
+#########################################
+
+--source include/master-slave.inc
+--source include/have_innodb.inc
+
+
+#
+# Define variables used by test case
+#
+
+# Non-transactional engine
+--let $engine_type= myisam
+
+# Transactional engine
+--let $engine_type2= innodb
+
+
+#
+# Clean up
+#
+
+USE test;
+--disable_warnings
+DROP VIEW IF EXISTS v1,v11;
+DROP TABLE IF EXISTS t1,t2,t3,t11,t12,t13;
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p11;
+DROP FUNCTION IF EXISTS f1;
+DROP FUNCTION IF EXISTS f2;
+DROP EVENT IF EXISTS e1;
+DROP EVENT IF EXISTS e11;
+--enable_warnings
+
+
+#
+# Prepare objects (tables etc)
+#
+
+# Create tables
+
+--echo
+eval CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b INT, c VARCHAR(64)) ENGINE=$engine_type;
+--disable_warnings
+INSERT INTO t1 VALUES (1,1,'1');
+INSERT INTO t1 VALUES (2,2,UUID());
+eval CREATE TABLE t2 (a INT, b INT, c VARCHAR(64)) ENGINE=$engine_type;
+INSERT INTO t2 VALUES (1,1,'1');
+INSERT INTO t2 VALUES (2,2,UUID());
+--enable_warnings
+
+eval CREATE TABLE t11 (a INT NOT NULL PRIMARY KEY, b INT, c VARCHAR(64)) ENGINE=$engine_type2;
+--disable_warnings
+INSERT INTO t11 VALUES (1,1,'1');
+INSERT INTO t11 VALUES (2,2,UUID());
+eval CREATE TABLE t12 (a INT, b INT, c VARCHAR(64)) ENGINE=$engine_type2;
+INSERT INTO t12 VALUES (1,1,'1');
+INSERT INTO t12 VALUES (2,2,UUID());
+--enable_warnings
+
+# Create invoked features
+--echo
+# Create view for tables t1,t11
+CREATE VIEW v1 AS SELECT * FROM t1;
+CREATE VIEW v11 AS SELECT * FROM t11;
+
+# Create triggers for t1,t11
+DELIMITER |;
+
+CREATE TRIGGER t1_tr1 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+ INSERT INTO t2 VALUES (NEW.a, NEW.b, NEW.c);
+ INSERT INTO t3 VALUES (NEW.a, NEW.b, NEW.c);
+END|
+
+CREATE TRIGGER t1_tr2 BEFORE UPDATE ON t1 FOR EACH ROW
+BEGIN
+ UPDATE t2 SET c = '';
+ UPDATE t3 SET c = '';
+END|
+
+CREATE TRIGGER t11_tr1 BEFORE INSERT ON t11 FOR EACH ROW
+BEGIN
+ INSERT INTO t12 VALUES (NEW.a, NEW.b, NEW.c);
+ INSERT INTO t13 VALUES (NEW.a, NEW.b, NEW.c);
+END|
+
+CREATE TRIGGER t11_tr2 BEFORE UPDATE ON t11 FOR EACH ROW
+BEGIN
+ UPDATE t12 SET c = '';
+ UPDATE t13 SET c = '';
+END|
+
+# Create events which will run every 1 sec
+CREATE EVENT e1 ON SCHEDULE EVERY 1 SECOND ENABLE DO
+BEGIN
+ DECLARE c INT;
+ SELECT a INTO c FROM t1 WHERE a < 11 ORDER BY a DESC LIMIT 1;
+ IF c = 7 THEN
+ CALL p1(10, '');
+ END IF;
+END|
+
+CREATE EVENT e11 ON SCHEDULE EVERY 1 SECOND ENABLE DO
+BEGIN
+ DECLARE c INT;
+ SELECT a INTO c FROM t11 WHERE a < 11 ORDER BY a DESC LIMIT 1;
+ IF c = 7 THEN
+ CALL p11(10, '');
+ END IF;
+END|
+
+# Create functions and procedures used for events
+CREATE FUNCTION f1 (x INT) RETURNS VARCHAR(64)
+BEGIN
+ IF x > 5 THEN
+ RETURN UUID();
+ END IF;
+ RETURN '';
+END|
+
+CREATE FUNCTION f2 (x INT) RETURNS VARCHAR(64)
+BEGIN
+ RETURN f1(x);
+END|
+
+CREATE PROCEDURE p1 (IN x INT, IN y VARCHAR(64))
+BEGIN
+ INSERT INTO t1 VALUES (x,x,y);
+END|
+
+CREATE PROCEDURE p11 (IN x INT, IN y VARCHAR(64))
+BEGIN
+ INSERT INTO t11 VALUES (x,x,y);
+END|
+
+DELIMITER ;|
+
+
+#
+# Start test case
+#
+
+# Do some actions for non-transactional tables
+--echo
+--disable_warnings
+CREATE TABLE t3 SELECT * FROM v1;
+INSERT INTO t1 VALUES (3,3,'');
+UPDATE t1 SET c='2' WHERE a = 1;
+INSERT INTO t1 VALUES(4,4,f1(4));
+INSERT INTO t1 VALUES (100,100,'');
+CALL p1(5, UUID());
+INSERT INTO t1 VALUES (101,101,'');
+INSERT INTO t1 VALUES(6,6,f1(6));
+INSERT INTO t1 VALUES (102,102,'');
+INSERT INTO t1 VALUES(7,7,f2(7));
+INSERT INTO t1 VALUES (103,103,'');
+
+# Do some actions for transactional tables
+--echo
+CREATE TABLE t13 SELECT * FROM v11;
+INSERT INTO t11 VALUES (3,3,'');
+UPDATE t11 SET c='2' WHERE a = 1;
+INSERT INTO t11 VALUES(4,4,f1(4));
+INSERT INTO t11 VALUES (100,100,'');
+CALL p11(5, UUID());
+INSERT INTO t11 VALUES (101,101,'');
+INSERT INTO t11 VALUES(6,6,f1(6));
+INSERT INTO t11 VALUES (102,102,'');
+INSERT INTO t11 VALUES(7,7,f2(7));
+INSERT INTO t11 VALUES (103,103,'');
+--enable_warnings
+
+# Scheduler is on
+--echo
+SET GLOBAL EVENT_SCHEDULER = on;
+# Wait 2 sec while events will executed
+--sleep 2
+SET GLOBAL EVENT_SCHEDULER = off;
+
+# Check original objects
+--echo
+SHOW TABLES LIKE 't%';
+SELECT table_name FROM information_schema.views WHERE table_schema='test';
+SELECT trigger_name, event_manipulation, event_object_table FROM information_schema.triggers WHERE trigger_schema='test';
+SELECT routine_type, routine_name FROM information_schema.routines WHERE routine_schema='test';
+SELECT event_name, status FROM information_schema.events WHERE event_schema='test';
+
+# Check original data
+--echo
+SELECT COUNT(*) FROM t1;
+SELECT a,b FROM t1 ORDER BY a;
+SELECT COUNT(*) FROM t2;
+SELECT a,b FROM t2 ORDER BY a;
+SELECT COUNT(*) FROM t3;
+SELECT a,b FROM t3 ORDER BY a;
+SELECT a,b FROM v1 ORDER BY a;
+SELECT COUNT(*) FROM t11;
+SELECT a,b FROM t11 ORDER BY a;
+SELECT COUNT(*) FROM t12;
+SELECT a,b FROM t12 ORDER BY a;
+SELECT COUNT(*) FROM t13;
+SELECT a,b FROM t13 ORDER BY a;
+SELECT a,b FROM v11 ORDER BY a;
+
+--sync_slave_with_master slave
+
+# Check replicated objects
+--echo
+SHOW TABLES LIKE 't%';
+SELECT table_name FROM information_schema.views WHERE table_schema='test';
+SELECT trigger_name, event_manipulation, event_object_table FROM information_schema.triggers WHERE trigger_schema='test';
+SELECT routine_type, routine_name FROM information_schema.routines WHERE routine_schema='test';
+SELECT event_name, status FROM information_schema.events WHERE event_schema='test';
+
+# Check replicated data
+--echo
+SELECT COUNT(*) FROM t1;
+SELECT a,b FROM t1 ORDER BY a;
+SELECT COUNT(*) FROM t2;
+SELECT a,b FROM t2 ORDER BY a;
+SELECT COUNT(*) FROM t3;
+SELECT a,b FROM t3 ORDER BY a;
+SELECT a,b FROM v1 ORDER BY a;
+SELECT COUNT(*) FROM t11;
+SELECT a,b FROM t11 ORDER BY a;
+SELECT COUNT(*) FROM t12;
+SELECT a,b FROM t12 ORDER BY a;
+SELECT COUNT(*) FROM t13;
+SELECT a,b FROM t13 ORDER BY a;
+SELECT a,b FROM v11 ORDER BY a;
+
+# Remove UUID() before comparing
+
+--connection master
+--echo
+UPDATE t1 SET c='';
+UPDATE t2 SET c='';
+UPDATE t3 SET c='';
+UPDATE t11 SET c='';
+UPDATE t12 SET c='';
+UPDATE t13 SET c='';
+
+--sync_slave_with_master slave
+
+# Compare a data from master and slave
+--echo
+--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_invoked_features_master.sql
+--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_invoked_features_slave.sql
+--diff_files $MYSQLTEST_VARDIR/tmp/rpl_invoked_features_master.sql $MYSQLTEST_VARDIR/tmp/rpl_invoked_features_slave.sql
+
+
+#
+# Clean up
+#
+
+# Remove dumps
+--echo
+--exec rm $MYSQLTEST_VARDIR/tmp/rpl_invoked_features_master.sql
+--exec rm $MYSQLTEST_VARDIR/tmp/rpl_invoked_features_slave.sql
+
+# Remove tables,views,procedures,functions
+--connection master
+--echo
+--disable_warnings
+DROP VIEW IF EXISTS v1,v11;
+DROP TABLE IF EXISTS t1,t2,t3,t11,t12,t13;
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p11;
+DROP FUNCTION IF EXISTS f1;
+DROP FUNCTION IF EXISTS f2;
+DROP EVENT IF EXISTS e1;
+DROP EVENT IF EXISTS e11;
+--enable_warnings
+
+--sync_slave_with_master slave
+
+# End 5.1 test case
diff --git a/mysql-test/t/rpl_known_bugs_detection-master.opt b/mysql-test/suite/rpl/t/rpl_known_bugs_detection-master.opt
index d4ba386a1a0..d4ba386a1a0 100644
--- a/mysql-test/t/rpl_known_bugs_detection-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_known_bugs_detection-master.opt
diff --git a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test
new file mode 100644
index 00000000000..b300603f454
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test
@@ -0,0 +1,93 @@
+# Test to see if slave can detect certain known bugs present
+# on the master, and appropriately decides to stop
+# (assuming the bug is fixed in the slave, slave cannot of course
+# imitate the bug, so it has to stop).
+
+source include/have_debug.inc;
+source include/master-slave.inc;
+
+# Currently only statement-based-specific bugs are here
+-- source include/have_binlog_format_mixed_or_statement.inc
+
+#
+# This is to test that slave properly detects if
+# master may suffer from:
+# BUG#24432 "INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values"
+# (i.e. on master, INSERT ON DUPLICATE KEY UPDATE is used and manipulates
+# an auto_increment column, and is binlogged statement-based).
+#
+
+# testcase with INSERT VALUES
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT,
+UNIQUE(b));
+sync_slave_with_master;
+connection master;
+INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10;
+SELECT * FROM t1;
+connection slave;
+--source include/wait_for_slave_sql_to_stop.inc
+# show the error message
+--replace_column 1 # 4 # 7 # 8 # 9 # 23 # 33 #
+--query_vertical show slave status;
+# show that it was not replicated
+SELECT * FROM t1;
+
+# restart replication for the next testcase
+stop slave;
+reset slave;
+connection master;
+reset master;
+drop table t1;
+connection slave;
+start slave;
+
+# testcase with INSERT SELECT
+connection master;
+CREATE TABLE t1 (
+ id bigint(20) unsigned NOT NULL auto_increment,
+ field_1 int(10) unsigned NOT NULL,
+ field_2 varchar(255) NOT NULL,
+ field_3 varchar(255) NOT NULL,
+ PRIMARY KEY (id),
+ UNIQUE KEY field_1 (field_1, field_2)
+);
+CREATE TABLE t2 (
+ field_a int(10) unsigned NOT NULL,
+ field_b varchar(255) NOT NULL,
+ field_c varchar(255) NOT NULL
+);
+INSERT INTO t2 (field_a, field_b, field_c) VALUES (1, 'a', '1a');
+INSERT INTO t2 (field_a, field_b, field_c) VALUES (2, 'b', '2b');
+INSERT INTO t2 (field_a, field_b, field_c) VALUES (3, 'c', '3c');
+INSERT INTO t2 (field_a, field_b, field_c) VALUES (4, 'd', '4d');
+INSERT INTO t2 (field_a, field_b, field_c) VALUES (5, 'e', '5e');
+sync_slave_with_master;
+connection master;
+# Updating table t1 based on values from table t2
+INSERT INTO t1 (field_1, field_2, field_3)
+SELECT t2.field_a, t2.field_b, t2.field_c
+FROM t2
+ON DUPLICATE KEY UPDATE
+t1.field_3 = t2.field_c;
+# Inserting new record into t2
+INSERT INTO t2 (field_a, field_b, field_c) VALUES (6, 'f', '6f');
+# Updating t1 again
+INSERT INTO t1 (field_1, field_2, field_3)
+SELECT t2.field_a, t2.field_b, t2.field_c
+FROM t2
+ON DUPLICATE KEY UPDATE
+t1.field_3 = t2.field_c;
+SELECT * FROM t1;
+connection slave;
+--source include/wait_for_slave_sql_to_stop.inc
+# show the error message
+--replace_column 1 # 4 # 7 # 8 # 9 # 23 # 33 #
+--query_vertical show slave status;
+# show that it was not replicated
+SELECT * FROM t1;
+connection master;
+drop table t1, t2;
+connection slave;
+drop table t1, t2;
+
+# End of 5.0 tests
diff --git a/mysql-test/t/rpl_load_from_master-slave.opt b/mysql-test/suite/rpl/t/rpl_load_from_master-slave.opt
index c015c02ba78..c015c02ba78 100644
--- a/mysql-test/t/rpl_load_from_master-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_load_from_master-slave.opt
diff --git a/mysql-test/t/rpl_load_from_master.test b/mysql-test/suite/rpl/t/rpl_load_from_master.test
index 9bab7d5696e..9bab7d5696e 100644
--- a/mysql-test/t/rpl_load_from_master.test
+++ b/mysql-test/suite/rpl/t/rpl_load_from_master.test
diff --git a/mysql-test/t/rpl_load_table_from_master.test b/mysql-test/suite/rpl/t/rpl_load_table_from_master.test
index b9cec3858a9..b9cec3858a9 100644
--- a/mysql-test/t/rpl_load_table_from_master.test
+++ b/mysql-test/suite/rpl/t/rpl_load_table_from_master.test
diff --git a/mysql-test/t/rpl_loaddata.test b/mysql-test/suite/rpl/t/rpl_loaddata.test
index 6f9ee4ef80a..6f9ee4ef80a 100644
--- a/mysql-test/t/rpl_loaddata.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata.test
diff --git a/mysql-test/t/rpl_loaddata_charset.test b/mysql-test/suite/rpl/t/rpl_loaddata_charset.test
index 7f2389cb9f6..7f2389cb9f6 100644
--- a/mysql-test/t/rpl_loaddata_charset.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_charset.test
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_fatal-slave.opt b/mysql-test/suite/rpl/t/rpl_loaddata_fatal-slave.opt
new file mode 100644
index 00000000000..9c846c799f3
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_fatal-slave.opt
@@ -0,0 +1 @@
+--loose-debug=+d,LOAD_DATA_INFILE_has_fatal_error
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test b/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test
new file mode 100644
index 00000000000..dceee7a65af
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test
@@ -0,0 +1,29 @@
+source include/have_binlog_format_mixed_or_statement.inc;
+source include/have_debug.inc;
+source include/master-slave.inc;
+
+# We do this little stunt to make sure that the slave has started
+# before we stop it again.
+connection master;
+CREATE TABLE t1 (a INT, b INT);
+INSERT INTO t1 VALUES (1,10);
+sync_slave_with_master;
+source include/show_slave_status.inc;
+
+# Now we feed it a load data infile, which should make it stop with a
+# fatal error.
+connection master;
+LOAD DATA INFILE '../std_data_ln/rpl_loaddata.dat' INTO TABLE t1;
+
+connection slave;
+wait_for_slave_to_stop;
+source include/show_slave_status.inc;
+
+connection slave;
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
+START SLAVE;
+
+connection master;
+DROP TABLE t1;
+sync_slave_with_master;
+
diff --git a/mysql-test/t/rpl_loaddata_m-master.opt b/mysql-test/suite/rpl/t/rpl_loaddata_m-master.opt
index 9d4a8f0b95e..9d4a8f0b95e 100644
--- a/mysql-test/t/rpl_loaddata_m-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_m-master.opt
diff --git a/mysql-test/t/rpl_loaddata_m.test b/mysql-test/suite/rpl/t/rpl_loaddata_m.test
index 537d4c163ef..537d4c163ef 100644
--- a/mysql-test/t/rpl_loaddata_m.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_m.test
diff --git a/mysql-test/t/rpl_loaddata_s-slave.opt b/mysql-test/suite/rpl/t/rpl_loaddata_s-slave.opt
index 9d4a8f0b95e..9d4a8f0b95e 100644
--- a/mysql-test/t/rpl_loaddata_s-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_s-slave.opt
diff --git a/mysql-test/t/rpl_loaddata_s.test b/mysql-test/suite/rpl/t/rpl_loaddata_s.test
index f397d741310..f397d741310 100644
--- a/mysql-test/t/rpl_loaddata_s.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_s.test
diff --git a/mysql-test/t/rpl_loaddata_simple.test b/mysql-test/suite/rpl/t/rpl_loaddata_simple.test
index 9e908cac677..9e908cac677 100644
--- a/mysql-test/t/rpl_loaddata_simple.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_simple.test
diff --git a/mysql-test/t/rpl_loaddatalocal.test b/mysql-test/suite/rpl/t/rpl_loaddatalocal.test
index b10603e7195..b10603e7195 100644
--- a/mysql-test/t/rpl_loaddatalocal.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddatalocal.test
diff --git a/mysql-test/t/rpl_loadfile.test b/mysql-test/suite/rpl/t/rpl_loadfile.test
index a671bab15bb..a671bab15bb 100644
--- a/mysql-test/t/rpl_loadfile.test
+++ b/mysql-test/suite/rpl/t/rpl_loadfile.test
diff --git a/mysql-test/t/rpl_locale.test b/mysql-test/suite/rpl/t/rpl_locale.test
index 2f2d637e1b4..2f2d637e1b4 100644
--- a/mysql-test/t/rpl_locale.test
+++ b/mysql-test/suite/rpl/t/rpl_locale.test
diff --git a/mysql-test/suite/rpl/t/rpl_log_pos.test b/mysql-test/suite/rpl/t/rpl_log_pos.test
new file mode 100644
index 00000000000..e5ad6f39ed2
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_log_pos.test
@@ -0,0 +1,50 @@
+##########
+# Change Author: JBM
+# Change Date: 2006-01-16
+# Change: Added Order by for NDB
+##########
+
+#
+# Testing of setting slave to wrong log position with master_log_pos
+#
+
+# Passes with rbr no problem, removed statement include [jbm]
+
+source include/master-slave.inc;
+--replace_column 3 <Binlog_Ignore_DB>
+show master status;
+sync_slave_with_master;
+stop slave;
+--source include/wait_for_slave_to_stop.inc
+
+change master to master_log_pos=75;
+source include/show_slave_status.inc;
+start slave;
+let $slave_param= Slave_SQL_Running;
+let $slave_param_value= Yes;
+--source include/wait_for_slave_param.inc
+let $slave_param= Slave_IO_Running;
+let $slave_param_value= No;
+--source include/wait_for_slave_param.inc
+stop slave;
+--source include/wait_for_slave_to_stop.inc
+
+source include/show_slave_status.inc;
+connection master;
+--replace_column 3 <Binlog_Ignore_DB>
+show master status;
+create table if not exists t1 (n int);
+drop table if exists t1;
+create table t1 (n int);
+insert into t1 values (1),(2),(3);
+save_master_pos;
+connection slave;
+change master to master_log_pos=106;
+start slave;
+sync_with_master;
+select * from t1 ORDER BY n;
+connection master;
+drop table t1;
+sync_slave_with_master;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/rpl_many_optimize.test b/mysql-test/suite/rpl/t/rpl_many_optimize.test
index 91fab0b27a8..91fab0b27a8 100644
--- a/mysql-test/t/rpl_many_optimize.test
+++ b/mysql-test/suite/rpl/t/rpl_many_optimize.test
diff --git a/mysql-test/t/rpl_master_pos_wait.test b/mysql-test/suite/rpl/t/rpl_master_pos_wait.test
index 893c8746efc..893c8746efc 100644
--- a/mysql-test/t/rpl_master_pos_wait.test
+++ b/mysql-test/suite/rpl/t/rpl_master_pos_wait.test
diff --git a/mysql-test/t/rpl_misc_functions-slave.sh b/mysql-test/suite/rpl/t/rpl_misc_functions-slave.sh
index 8ce79797822..8ce79797822 100755
--- a/mysql-test/t/rpl_misc_functions-slave.sh
+++ b/mysql-test/suite/rpl/t/rpl_misc_functions-slave.sh
diff --git a/mysql-test/suite/rpl/t/rpl_misc_functions.test b/mysql-test/suite/rpl/t/rpl_misc_functions.test
new file mode 100644
index 00000000000..1c94471c975
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_misc_functions.test
@@ -0,0 +1,114 @@
+#
+# Test of replicating some difficult functions
+#
+source include/master-slave.inc;
+
+create table t1(id int, i int, r1 int, r2 int, p varchar(100));
+insert into t1 values(1, connection_id(), 0, 0, "");
+# don't put rand and password in the same query, to see if they replicate
+# independently
+# Pure rand test
+insert into t1 values(2, 0, rand()*1000, rand()*1000, "");
+# change the rand suite on the master (we do this because otherwise password()
+# benefits from the fact that the above rand() is well replicated :
+# it picks the same sequence element, which hides a possible bug in password() replication.
+set sql_log_bin=0;
+insert into t1 values(6, 0, rand(), rand(), "");
+delete from t1 where id=6;
+set sql_log_bin=1;
+# Pure password test
+insert into t1 values(3, 0, 0, 0, password('does_this_work?'));
+# "altogether now"
+insert into t1 values(4, connection_id(), rand()*1000, rand()*1000, password('does_this_still_work?'));
+select * into outfile 'rpl_misc_functions.outfile' from t1;
+sync_slave_with_master;
+create table t2 like t1;
+# read the values from the master table
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval load data local infile '$MYSQLTEST_VARDIR/master-data/test/rpl_misc_functions.outfile' into table t2;
+# compare them with the replica; the SELECT below should return no row
+select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p);
+
+connection master;
+drop table t1;
+
+# End of 4.1 tests
+
+#
+# BUG#25543 test calling rand() multiple times on the master in
+# a stored procedure.
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ col_a DOUBLE DEFAULT NULL);
+
+DELIMITER |;
+
+# Use a SP that calls rand() multiple times
+CREATE PROCEDURE test_replication_sp1()
+BEGIN
+ INSERT INTO t1 (col_a) VALUES (rand()), (rand());
+ INSERT INTO t1 (col_a) VALUES (rand());
+END|
+
+# Use a SP that calls another SP to call rand() multiple times
+CREATE PROCEDURE test_replication_sp2()
+BEGIN
+ CALL test_replication_sp1();
+ CALL test_replication_sp1();
+END|
+
+# Use a SF that calls rand() multiple times
+CREATE FUNCTION test_replication_sf() RETURNS DOUBLE DETERMINISTIC
+BEGIN
+ RETURN (rand() + rand());
+END|
+
+DELIMITER ;|
+
+# Exercise the functions and procedures then compare the results on
+# the master to those on the slave.
+CALL test_replication_sp1();
+CALL test_replication_sp2();
+INSERT INTO t1 (col_a) VALUES (test_replication_sf());
+INSERT INTO t1 (col_a) VALUES (test_replication_sf());
+INSERT INTO t1 (col_a) VALUES (test_replication_sf());
+
+--sync_slave_with_master
+
+# Dump table on slave
+select * from t1 into outfile "../tmp/t1_slave.txt";
+
+# Load data from slave into temp table on master
+connection master;
+create temporary table t1_slave select * from t1 where 1=0;
+load data infile '../tmp/t1_slave.txt' into table t1_slave;
+--remove_file $MYSQLTEST_VARDIR/tmp/t1_slave.txt
+
+# Compare master and slave temp table, use subtraction
+# for floating point comparison of "double"
+select count(*) into @aux from t1 join t1_slave using (id)
+where ABS(t1.col_a - t1_slave.col_a) < 0.0000001 ;
+SELECT @aux;
+if (`SELECT @aux <> 12 OR @aux IS NULL`)
+{
+ --echo # ERROR: We expected to get count(*) = 12.
+ SELECT id, col_a FROM t1;
+ SELECT id, col_a FROM t1_slave;
+ --echo # abort
+ exit;
+}
+
+# Cleanup
+connection master;
+DROP TABLE t1, t1_slave;
+DROP PROCEDURE test_replication_sp1;
+DROP PROCEDURE test_replication_sp2;
+DROP FUNCTION test_replication_sf;
+--sync_slave_with_master
+
+
diff --git a/mysql-test/t/rpl_mixed_ddl_dml.test b/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test
index 6a1f81abed3..6a1f81abed3 100644
--- a/mysql-test/t/rpl_mixed_ddl_dml.test
+++ b/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test
diff --git a/mysql-test/t/rpl_multi_delete-slave.opt b/mysql-test/suite/rpl/t/rpl_multi_delete-slave.opt
index c98fe0b0a46..c98fe0b0a46 100644
--- a/mysql-test/t/rpl_multi_delete-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_multi_delete-slave.opt
diff --git a/mysql-test/t/rpl_multi_delete.test b/mysql-test/suite/rpl/t/rpl_multi_delete.test
index a251cbf8833..a251cbf8833 100644
--- a/mysql-test/t/rpl_multi_delete.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_delete.test
diff --git a/mysql-test/t/rpl_multi_delete2-slave.opt b/mysql-test/suite/rpl/t/rpl_multi_delete2-slave.opt
index 0febb2891b1..0febb2891b1 100644
--- a/mysql-test/t/rpl_multi_delete2-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_multi_delete2-slave.opt
diff --git a/mysql-test/t/rpl_multi_delete2.test b/mysql-test/suite/rpl/t/rpl_multi_delete2.test
index 81379d4056b..81379d4056b 100644
--- a/mysql-test/t/rpl_multi_delete2.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_delete2.test
diff --git a/mysql-test/suite/rpl/t/rpl_multi_engine-slave.opt b/mysql-test/suite/rpl/t/rpl_multi_engine-slave.opt
new file mode 100644
index 00000000000..48457b17309
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_multi_engine-slave.opt
@@ -0,0 +1 @@
+--loose-innodb
diff --git a/mysql-test/t/rpl_multi_engine.test b/mysql-test/suite/rpl/t/rpl_multi_engine.test
index 10780c765f7..10780c765f7 100644
--- a/mysql-test/t/rpl_multi_engine.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_engine.test
diff --git a/mysql-test/t/rpl_multi_update.test b/mysql-test/suite/rpl/t/rpl_multi_update.test
index a6111455d16..a6111455d16 100644
--- a/mysql-test/t/rpl_multi_update.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_update.test
diff --git a/mysql-test/t/rpl_multi_update2-slave.opt b/mysql-test/suite/rpl/t/rpl_multi_update2-slave.opt
index 17d4171af0e..17d4171af0e 100644
--- a/mysql-test/t/rpl_multi_update2-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_multi_update2-slave.opt
diff --git a/mysql-test/suite/rpl/t/rpl_multi_update2.test b/mysql-test/suite/rpl/t/rpl_multi_update2.test
new file mode 100644
index 00000000000..812a486ad69
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_multi_update2.test
@@ -0,0 +1,10 @@
+#######################################################
+# Wrapper for rpl_multi_update2.test to allow multi #
+# Engines to reuse test code. By JBM 2006-02-15 #
+# Added comments section and to skip when ndb is #
+# Default engine. #
+#######################################################
+--source include/not_ndb_default.inc
+--source include/master-slave.inc
+let $engine_type=MyISAM;
+--source extra/rpl_tests/rpl_multi_update2.test
diff --git a/mysql-test/suite/rpl/t/rpl_multi_update3.test b/mysql-test/suite/rpl/t/rpl_multi_update3.test
new file mode 100644
index 00000000000..5da91c26b04
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_multi_update3.test
@@ -0,0 +1,10 @@
+#######################################################
+# Wrapper for rpl_multi_update3.test to allow multi #
+# Engines to reuse test code. By JBM 2006-02-15 #
+# Added comments section and to skip when ndb is #
+# Default engine. #
+#######################################################
+--source include/not_ndb_default.inc
+--source include/master-slave.inc
+let $engine_type=MyISAM;
+-- source extra/rpl_tests/rpl_multi_update3.test
diff --git a/mysql-test/t/rpl_multi_update4-slave.opt b/mysql-test/suite/rpl/t/rpl_multi_update4-slave.opt
index fea27db43ee..fea27db43ee 100644
--- a/mysql-test/t/rpl_multi_update4-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_multi_update4-slave.opt
diff --git a/mysql-test/t/rpl_multi_update4.test b/mysql-test/suite/rpl/t/rpl_multi_update4.test
index 4991a385f6f..4991a385f6f 100644
--- a/mysql-test/t/rpl_multi_update4.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_update4.test
diff --git a/mysql-test/t/rpl_optimize.test b/mysql-test/suite/rpl/t/rpl_optimize.test
index 80f0c052fc8..80f0c052fc8 100644
--- a/mysql-test/t/rpl_optimize.test
+++ b/mysql-test/suite/rpl/t/rpl_optimize.test
diff --git a/mysql-test/t/rpl_packet-master.opt b/mysql-test/suite/rpl/t/rpl_packet-master.opt
index 42d4f94c999..42d4f94c999 100644
--- a/mysql-test/t/rpl_packet-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_packet-master.opt
diff --git a/mysql-test/t/rpl_packet-slave.opt b/mysql-test/suite/rpl/t/rpl_packet-slave.opt
index 42d4f94c999..42d4f94c999 100644
--- a/mysql-test/t/rpl_packet-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_packet-slave.opt
diff --git a/mysql-test/suite/rpl/t/rpl_packet.test b/mysql-test/suite/rpl/t/rpl_packet.test
new file mode 100644
index 00000000000..316278cb75d
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_packet.test
@@ -0,0 +1,81 @@
+#
+# Check replication protocol packet size handling
+# Bug#19402 SQL close to the size of the max_allowed_packet fails on slave
+#
+
+# max-out size db name
+source include/master-slave.inc;
+
+let $db= DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
+disable_warnings;
+eval drop database if exists $db;
+enable_warnings;
+eval create database $db;
+
+connection master;
+select @@net_buffer_length, @@max_allowed_packet;
+disconnect master;
+
+# alas, can't use eval here; if db name changed apply the change here
+connect (master,localhost,root,,DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________);
+
+connection master;
+create table `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
+
+INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1023');
+save_master_pos;
+
+connection slave;
+sync_with_master;
+eval select count(*) from `$db`.`t1` /* must be 1 */;
+
+SHOW STATUS LIKE 'Slave_running';
+select * from information_schema.session_status where variable_name= 'SLAVE_RUNNING';
+connection master;
+eval drop database $db;
+save_master_pos;
+
+connection slave;
+sync_with_master;
+
+#
+# Bug #23755: Replicated event larger that max_allowed_packet infinitely re-transmits
+#
+# Check that a situation when the size of event on the master is greater than
+# max_allowed_packet on the slave does not lead to infinite re-transmits.
+
+connection master;
+
+# Change the max packet size on master
+
+SET @@global.max_allowed_packet=4096;
+SET @@global.net_buffer_length=4096;
+
+# Restart slave for new setting to take effect
+connection slave;
+STOP SLAVE;
+START SLAVE;
+
+# Reconnect to master for new setting to take effect
+disconnect master;
+connect (master, localhost, root);
+connection master;
+
+CREATE TABLe `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
+
+INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
+
+# The slave I/O thread must stop after trying to read the above event
+connection slave;
+sleep 2;
+--source include/wait_for_slave_io_to_stop.inc
+SHOW STATUS LIKE 'Slave_running';
+
+# cleanup
+#connection master;
+#drop table t1;
+#connection slave;
+#drop table t1;
+
+
+# End of tests
diff --git a/mysql-test/suite/rpl/t/rpl_ps.test b/mysql-test/suite/rpl/t/rpl_ps.test
new file mode 100644
index 00000000000..27f1ac3348d
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_ps.test
@@ -0,0 +1,146 @@
+#
+# Test of replicating user variables
+#
+###########################################################
+# 2006-02-08 By JBM added order by for use w/ NDB engine
+###########################################################
+source include/master-slave.inc;
+
+#save_master_pos;
+#connection slave;
+#sync_with_master;
+#reset master;
+#connection master;
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+create table t1(n char(30));
+
+prepare stmt1 from 'insert into t1 values (?)';
+set @var1= "from-master-1";
+execute stmt1 using @var1;
+set @var1= "from-master-2-'',";
+execute stmt1 using @var1;
+SELECT * FROM t1 ORDER BY n;
+
+set @var2= 'insert into t1 values (concat("from-var-", ?))';
+prepare stmt2 from @var2;
+set @var1='from-master-3';
+execute stmt2 using @var1;
+
+save_master_pos;
+connection slave;
+sync_with_master;
+SELECT * FROM t1 ORDER BY n;
+
+connection master;
+
+drop table t1;
+
+save_master_pos;
+connection slave;
+sync_with_master;
+stop slave;
+
+# End of 4.1 tests
+
+#
+# Bug #25843 Changing default database between PREPARE and EXECUTE of statement
+# breaks binlog.
+#
+# There were actually two problems discovered by this bug:
+#
+# 1. Default (current) database is not fixed at the creation time.
+# That leads to wrong output of DATABASE() function.
+#
+# 2. Database attributes (@@collation_database) are not fixed at the creation
+# time. That leads to wrong resultset.
+#
+# Binlog breakage and Query Cache wrong output happened because of the first
+# problem.
+#
+
+--echo
+--echo ########################################################################
+--echo #
+--echo # BUG#25843: Changing default database between PREPARE and EXECUTE of
+--echo # statement breaks binlog.
+--echo #
+--echo ########################################################################
+
+###############################################################################
+
+--echo
+--echo # Connection: slave
+--echo
+--connection slave
+
+--echo
+START SLAVE;
+
+--echo
+--echo # Connection: master
+--echo
+--connection master
+
+--echo
+CREATE DATABASE mysqltest1;
+CREATE TABLE t1(db_name CHAR(32), db_col_name CHAR(32));
+
+--echo
+PREPARE stmt_d_1 FROM 'INSERT INTO t1 VALUES(DATABASE(), @@collation_database)';
+
+--echo
+EXECUTE stmt_d_1;
+
+--echo
+use mysqltest1;
+
+--echo
+EXECUTE stmt_d_1;
+
+--echo
+--save_master_pos
+
+--echo
+--echo # Connection: slave
+--echo
+--connection slave
+--sync_with_master
+
+--echo
+SELECT * FROM t1;
+
+--echo
+--echo # Connection: master
+--echo
+--connection master
+
+--echo
+DROP DATABASE mysqltest1;
+
+--echo
+use test;
+
+--echo
+--save_master_pos
+
+--echo
+--echo # Connection: slave
+--echo
+--connection slave
+--sync_with_master
+
+--echo
+STOP SLAVE;
+
+--echo
+--echo ########################################################################
+
+###############################################################################
+
+reset master;
+reset slave;
+disconnect master;
diff --git a/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test b/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test
new file mode 100644
index 00000000000..72ae6a99c44
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test
@@ -0,0 +1,47 @@
+-- source include/have_binlog_format_mixed_or_statement.inc
+-- source include/not_ndb_default.inc
+-- source include/master-slave.inc
+
+# Test that the slave temporarily switches to ROW when seeing binrow
+# events when it is in STATEMENT or MIXED mode
+
+SET BINLOG_FORMAT=MIXED;
+SET GLOBAL BINLOG_FORMAT=MIXED;
+SELECT @@GLOBAL.BINLOG_FORMAT, @@SESSION.BINLOG_FORMAT;
+
+--echo **** On Master ****
+CREATE TABLE t1 (a INT, b LONG);
+INSERT INTO t1 VALUES (1,1), (2,2);
+INSERT INTO t1 VALUES (3,UUID()), (4,UUID());
+let $VERSION=`select version()`;
+--replace_result $VERSION VERSION
+--replace_column 2 # 5 #
+--replace_regex /table_id: [0-9]+/table_id: #/
+SHOW BINLOG EVENTS;
+sync_slave_with_master;
+--echo **** On Slave ****
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 8 # 9 # 23 # 33 # 34 # 35 #
+--query_vertical SHOW SLAVE STATUS
+--replace_result $VERSION VERSION
+--replace_column 2 # 5 #
+--replace_regex /table_id: [0-9]+/table_id: #/
+SHOW BINLOG EVENTS;
+
+--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql
+--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_slave.sql
+
+connection master;
+DROP TABLE IF EXISTS t1;
+
+# Let's compare. Note: If they match test will pass, if they do not match
+# the test will show that the diff statement failed and not reject file
+# will be created. You will need to go to the mysql-test dir and diff
+# the files your self to see what is not matching
+
+diff_files $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_slave.sql;
+
+# If all is good, we can remove the files
+
+--remove_file $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql
+--remove_file $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_slave.sql
diff --git a/mysql-test/suite/rpl/t/rpl_read_only-slave.opt b/mysql-test/suite/rpl/t/rpl_read_only-slave.opt
new file mode 100644
index 00000000000..48457b17309
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_read_only-slave.opt
@@ -0,0 +1 @@
+--loose-innodb
diff --git a/mysql-test/t/rpl_read_only.test b/mysql-test/suite/rpl/t/rpl_read_only.test
index 62864b62a28..62864b62a28 100644
--- a/mysql-test/t/rpl_read_only.test
+++ b/mysql-test/suite/rpl/t/rpl_read_only.test
diff --git a/mysql-test/suite/rpl/t/rpl_redirect.test b/mysql-test/suite/rpl/t/rpl_redirect.test
new file mode 100644
index 00000000000..1c6f31a030e
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_redirect.test
@@ -0,0 +1,45 @@
+#
+# Test of automatic redirection of queries to master/slave.
+#
+
+source include/master-slave.inc;
+# We disable this for now as PS doesn't handle redirection
+--disable_ps_protocol
+
+#first, make sure the slave has had enough time to register
+save_master_pos;
+connection slave;
+sync_with_master;
+
+#discover slaves
+connection master;
+source include/show_slave_status.inc;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+SHOW SLAVE HOSTS;
+rpl_probe;
+
+#turn on master/slave query direction auto-magic
+enable_rpl_parse;
+create table t1 ( n int);
+insert into t1 values (1),(2),(3),(4);
+disable_rpl_parse;
+save_master_pos;
+connection slave;
+sync_with_master;
+insert into t1 values(5);
+connection master;
+enable_rpl_parse;
+# The first of the queries will be sent to the slave, the second to the master.
+SELECT * FROM t1 ORDER BY n;
+SELECT * FROM t1 ORDER BY n;
+disable_rpl_parse;
+SELECT * FROM t1 ORDER BY n;
+connection slave;
+SELECT * FROM t1 ORDER BY n;
+
+# Cleanup
+connection master;
+drop table t1;
+sync_slave_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_relay_space_innodb-master.opt b/mysql-test/suite/rpl/t/rpl_relay_space_innodb-master.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_relay_space_innodb-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_relay_space_innodb-master.opt
diff --git a/mysql-test/t/rpl_relay_space_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_relay_space_innodb-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_relay_space_innodb-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_relay_space_innodb-slave.opt
diff --git a/mysql-test/t/rpl_relay_space_innodb.test b/mysql-test/suite/rpl/t/rpl_relay_space_innodb.test
index 156d53ef856..156d53ef856 100644
--- a/mysql-test/t/rpl_relay_space_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_relay_space_innodb.test
diff --git a/mysql-test/t/rpl_relay_space_myisam.test b/mysql-test/suite/rpl/t/rpl_relay_space_myisam.test
index 1d8563e7fd9..1d8563e7fd9 100644
--- a/mysql-test/t/rpl_relay_space_myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_relay_space_myisam.test
diff --git a/mysql-test/suite/rpl/t/rpl_relayrotate-slave.opt b/mysql-test/suite/rpl/t/rpl_relayrotate-slave.opt
new file mode 100644
index 00000000000..cf4319f2b40
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_relayrotate-slave.opt
@@ -0,0 +1,3 @@
+-O max_relay_log_size=16384
+--loose-innodb
+--log-warnings
diff --git a/mysql-test/suite/rpl/t/rpl_relayrotate.test b/mysql-test/suite/rpl/t/rpl_relayrotate.test
new file mode 100644
index 00000000000..ec3e6be4bea
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_relayrotate.test
@@ -0,0 +1,11 @@
+#######################################################
+# Wrapper for rpl_relayrotate.test to allow multi #
+# Engines to reuse test code. By JBM 2006-02-15 #
+# Added comments section and to skip when ndb is #
+# Default engine. #
+#######################################################
+-- source include/not_ndb_default.inc
+-- source include/have_innodb.inc
+-- source include/master-slave.inc
+let $engine_type=innodb;
+-- source extra/rpl_tests/rpl_relayrotate.test
diff --git a/mysql-test/t/rpl_relayspace-slave.opt b/mysql-test/suite/rpl/t/rpl_relayspace-slave.opt
index 06d96aa3b9a..06d96aa3b9a 100644
--- a/mysql-test/t/rpl_relayspace-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_relayspace-slave.opt
diff --git a/mysql-test/suite/rpl/t/rpl_relayspace.test b/mysql-test/suite/rpl/t/rpl_relayspace.test
new file mode 100644
index 00000000000..d4ef2fe59bd
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_relayspace.test
@@ -0,0 +1,50 @@
+# The slave is started with relay_log_space_limit=10 bytes,
+# to force the deadlock after one event.
+
+source include/master-slave.inc;
+connection slave;
+stop slave;
+connection master;
+# This will generate a master's binlog > 10 bytes
+create table t1 (a int);
+drop table t1;
+create table t1 (a int);
+drop table t1;
+connection slave;
+reset slave;
+start slave io_thread;
+# Give the I/O thread time to block.
+let $run= 1;
+let $counter= 300;
+while ($run)
+{
+ let $io_state= query_get_value("SHOW SLAVE STATUS", Slave_IO_State, 1);
+ if (`SELECT '$io_state' = 'Waiting for the slave SQL thread to free enough relay log space'`){
+ let $run= 0;
+ }
+ sleep 0.1;
+ if (!$counter){
+ --echo "Failed while waiting for slave IO thread block"
+ SHOW SLAVE STATUS;
+ exit;
+ }
+ dec $counter;
+}
+sleep 2;
+# A bug caused the I/O thread to refuse stopping.
+stop slave io_thread;
+reset slave;
+start slave;
+# The I/O thread stops filling the relay log when
+# it's >10b. And the SQL thread cannot purge this relay log
+# as purge is done only when the SQL thread switches to another
+# relay log, which does not exist here.
+# So we should have a deadlock.
+# if it is not resolved automatically we'll detect
+# it with master_pos_wait that waits for farther than 1Ob;
+# it will timeout after 10 seconds;
+# also the slave will probably not cooperate to shutdown
+# (as 2 threads are locked)
+select master_pos_wait('master-bin.001',200,6)=-1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_replicate_do-slave.opt b/mysql-test/suite/rpl/t/rpl_replicate_do-slave.opt
index da345474216..da345474216 100644
--- a/mysql-test/t/rpl_replicate_do-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_replicate_do-slave.opt
diff --git a/mysql-test/suite/rpl/t/rpl_replicate_do.test b/mysql-test/suite/rpl/t/rpl_replicate_do.test
new file mode 100644
index 00000000000..90f00764691
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_replicate_do.test
@@ -0,0 +1,92 @@
+# This test assumes we are ignoring updates on table t2, but doing
+# updates on t1
+source include/master-slave.inc;
+--disable_warnings
+drop table if exists t11;
+connection slave;
+drop table if exists t11;
+--enable_warnings
+
+create table t2 (n int);
+insert into t2 values(4);
+connection master;
+create table t2 (s char(20));
+load data infile '../std_data_ln/words.dat' into table t2;
+insert into t2 values('five');
+create table t1 (m int);
+insert into t1 values(15),(16),(17);
+update t1 set m=20 where m=16;
+delete from t1 where m=17;
+create table t11 select * from t1;
+save_master_pos;
+connection slave;
+sync_with_master;
+select * from t1 ORDER BY m;
+select * from t2;
+--error 1146
+select * from t11;
+connection master;
+drop table if exists t1,t2,t11;
+save_master_pos;
+connection slave;
+sync_with_master;
+# show slave status, just to see of it prints replicate-do-table
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
+query_vertical SHOW SLAVE STATUS;
+
+#
+# BUG#12542
+# TEST: "SET ONE_SHOT should always be executed on slave"
+#
+# We could use any timezone different than server default in this test
+#
+connection master;
+create table t1 (ts timestamp);
+set one_shot time_zone='met';
+insert into t1 values('2005-08-12 00:00:00');
+set one_shot time_zone='met';
+select * from t1;
+sync_slave_with_master;
+
+connection slave;
+set one_shot time_zone='met';
+select * from t1;
+
+connection master;
+drop table t1;
+sync_slave_with_master;
+
+# End of 4.1 tests
+
+#
+# Bug#24478 DROP TRIGGER is not caught by replicate-*-table filters
+#
+--echo *** master ***
+connection master;
+create table t1 (a int, b int);
+create trigger trg1 before insert on t1 for each row set new.b=2;
+create table t2 (a int, b int);
+create trigger trg2 before insert on t2 for each row set new.b=2;
+show tables;
+show triggers;
+sync_slave_with_master;
+--echo *** slave ***
+connection slave;
+show tables;
+show triggers;
+--echo *** master ***
+connection master;
+drop trigger trg1;
+drop trigger trg2;
+show triggers;
+sync_slave_with_master;
+--echo *** slave ***
+connection slave;
+show tables;
+show triggers;
+--echo *** master ***
+connection master;
+drop table t1;
+drop table t2;
+sync_slave_with_master;
diff --git a/mysql-test/t/rpl_replicate_ignore_db-slave.opt b/mysql-test/suite/rpl/t/rpl_replicate_ignore_db-slave.opt
index 6e3aed44f78..6e3aed44f78 100644
--- a/mysql-test/t/rpl_replicate_ignore_db-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_replicate_ignore_db-slave.opt
diff --git a/mysql-test/t/rpl_replicate_ignore_db.test b/mysql-test/suite/rpl/t/rpl_replicate_ignore_db.test
index bcfef919fad..bcfef919fad 100644
--- a/mysql-test/t/rpl_replicate_ignore_db.test
+++ b/mysql-test/suite/rpl/t/rpl_replicate_ignore_db.test
diff --git a/mysql-test/t/rpl_rewrt_db-slave.opt b/mysql-test/suite/rpl/t/rpl_rewrt_db-slave.opt
index a462ad19ba0..a462ad19ba0 100644
--- a/mysql-test/t/rpl_rewrt_db-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_rewrt_db-slave.opt
diff --git a/mysql-test/t/rpl_rewrt_db.test b/mysql-test/suite/rpl/t/rpl_rewrt_db.test
index 52f04e073dd..52f04e073dd 100644
--- a/mysql-test/t/rpl_rewrt_db.test
+++ b/mysql-test/suite/rpl/t/rpl_rewrt_db.test
diff --git a/mysql-test/t/rpl_rotate_logs-master.opt b/mysql-test/suite/rpl/t/rpl_rotate_logs-master.opt
index ad2c6a647b5..ad2c6a647b5 100644
--- a/mysql-test/t/rpl_rotate_logs-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_rotate_logs-master.opt
diff --git a/mysql-test/t/rpl_rotate_logs-slave.sh b/mysql-test/suite/rpl/t/rpl_rotate_logs-slave.sh
index 81490a54b4b..81490a54b4b 100755
--- a/mysql-test/t/rpl_rotate_logs-slave.sh
+++ b/mysql-test/suite/rpl/t/rpl_rotate_logs-slave.sh
diff --git a/mysql-test/t/rpl_rotate_logs.slave-mi b/mysql-test/suite/rpl/t/rpl_rotate_logs.slave-mi
index 80190bf6d29..80190bf6d29 100644
--- a/mysql-test/t/rpl_rotate_logs.slave-mi
+++ b/mysql-test/suite/rpl/t/rpl_rotate_logs.slave-mi
diff --git a/mysql-test/suite/rpl/t/rpl_rotate_logs.test b/mysql-test/suite/rpl/t/rpl_rotate_logs.test
new file mode 100644
index 00000000000..998bce33e8f
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_rotate_logs.test
@@ -0,0 +1,181 @@
+# This test uses chmod, can't be run with root permissions
+-- source include/not_as_root.inc
+
+-- source include/have_log_bin.inc
+
+#
+# Test is run with max_binlog_size=2048 to force automatic rotation of the
+# binary log
+# Tests done:
+# - Check that slaves reports correct failures if master.info has strange
+# modes/information
+# - Automatic binary log rotation
+# - Ensure that temporary tables works over flush logs and binary log
+# changes
+# - Test creating a duplicate key error and recover from it
+
+# Requires statement logging
+-- source include/have_binlog_format_mixed_or_statement.inc
+
+connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
+--disable_warnings
+drop table if exists t1, t2, t3, t4;
+--enable_warnings
+connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK);
+# Create empty file
+write_file $MYSQLTEST_VARDIR/slave-data/master.info;
+EOF
+chmod 0000 $MYSQLTEST_VARDIR/slave-data/master.info;
+connection slave;
+--disable_warnings
+drop table if exists t1, t2, t3, t4;
+--enable_warnings
+
+# START SLAVE will fail because it can't read the file (mode 000)
+# (system error 13)
+--replace_result $MYSQL_TEST_DIR TESTDIR
+--error 1105,1105,29
+start slave;
+chmod 0600 $MYSQLTEST_VARDIR/slave-data/master.info;
+# It will fail again because the file is empty so the slave cannot get valuable
+# info about how to connect to the master from it (failure in
+# init_strvar_from_file() in init_master_info()).
+--error 1201
+start slave;
+--replace_result $MASTER_MYPORT MASTER_PORT
+
+# CHANGE MASTER will fail because it first parses master.info before changing
+# it (so when master.info is bad, people have to use RESET SLAVE first).
+--error 1201
+eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root';
+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';
+connection master;
+reset master;
+connection slave;
+start slave;
+connection master;
+
+#
+# Test FLUSH LOGS
+#
+create temporary table temp_table (a char(80) not null);
+insert into temp_table values ("testing temporary tables");
+create table t1 (s text);
+insert into t1 values('Could not break slave'),('Tried hard');
+sync_slave_with_master;
+source include/show_slave_status.inc;
+select * from t1;
+connection master;
+flush logs;
+create table t2(m int not null auto_increment primary key);
+insert into t2 values (34),(67),(123);
+flush logs;
+show binary logs;
+create table t3 select * from temp_table;
+
+sync_slave_with_master;
+
+select * from t3;
+connection master;
+drop table temp_table, t3;
+
+#
+# Now lets make some duplicate key mess and see if we can recover from it
+#
+
+# First insert a value on the slave
+connection slave;
+insert into t2 values(1234);
+
+#same value on the master
+connection master;
+set insert_id=1234;
+insert into t2 values(NULL);
+connection slave;
+--source include/wait_for_slave_sql_to_stop.inc
+
+#restart slave skipping one event
+set global sql_slave_skip_counter=1;
+start slave;
+
+connection master;
+
+#let slave catch up
+sync_slave_with_master;
+connection master;
+purge master logs to 'master-bin.000002';
+show master logs;
+# we just tests if synonyms are accepted
+purge binary logs to 'master-bin.000002';
+show binary logs;
+
+# Calculate time to use in "purge master logs before" by taking
+# last modification time of t2 and adding 1 second
+# This is donw in order to handle the case where file system
+# time differs from mysqld's time
+--disable_result_log
+select @time_for_purge:=DATE_ADD(UPDATE_TIME, INTERVAL 1 SECOND)
+ from information_schema.tables
+ where TABLE_SCHEMA="test" and TABLE_NAME="t2";
+--enable_result_log
+
+purge master logs before (@time_for_purge);
+show binary logs;
+insert into t2 values (65);
+sync_slave_with_master;
+source include/show_slave_status.inc;
+select * from t2;
+
+#
+# Test forcing the replication log to rotate
+#
+
+connection master;
+create temporary table temp_table (a char(80) not null);
+insert into temp_table values ("testing temporary tables part 2");
+let $1=100;
+
+create table t3 (n int);
+disable_query_log;
+while ($1)
+{
+#eval means expand $ expressions
+ eval insert into t3 values($1 + 4);
+ dec $1;
+}
+enable_query_log;
+select count(*) from t3 where n >= 4;
+create table t4 select * from temp_table;
+show binary logs;
+show master status;
+save_master_pos;
+connection slave;
+sync_with_master;
+select * from t4;
+
+source include/show_slave_status.inc;
+# because of concurrent insert, the table may not be up to date
+# if we do not lock
+lock tables t3 read;
+select count(*) from t3 where n >= 4;
+unlock tables;
+#clean up
+connection master;
+drop table if exists t1,t2,t3,t4;
+sync_slave_with_master;
+
+--echo End of 4.1 tests
+
+#
+# Bug #29420: crash with show and purge binlogs
+#
+--error 1220
+show binlog events in 'non existing_binlog_file';
+purge master logs before now();
+--error 1220
+show binlog events in '';
+purge master logs before now();
+
+--echo End of 5.0 tests
diff --git a/mysql-test/suite/rpl/t/rpl_row_001.test b/mysql-test/suite/rpl/t/rpl_row_001.test
new file mode 100644
index 00000000000..99eaebcdcaf
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_001.test
@@ -0,0 +1,9 @@
+########################################################
+# By JBM 2005-02-15 Wrapped to allow reuse of test code#
+# Added to skip if ndb is default #
+########################################################
+-- source include/not_ndb_default.inc
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+let $engine_type=MYISAM;
+-- source extra/rpl_tests/rpl_row_001.test
diff --git a/mysql-test/t/rpl_row_4_bytes-master.opt b/mysql-test/suite/rpl/t/rpl_row_4_bytes-master.opt
index 0e1929507f7..0e1929507f7 100644
--- a/mysql-test/t/rpl_row_4_bytes-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_4_bytes-master.opt
diff --git a/mysql-test/t/rpl_row_4_bytes.test b/mysql-test/suite/rpl/t/rpl_row_4_bytes.test
index 73ef6dd2345..73ef6dd2345 100644
--- a/mysql-test/t/rpl_row_4_bytes.test
+++ b/mysql-test/suite/rpl/t/rpl_row_4_bytes.test
diff --git a/mysql-test/t/rpl_row_NOW.test b/mysql-test/suite/rpl/t/rpl_row_NOW.test
index c28b714277e..c28b714277e 100644
--- a/mysql-test/t/rpl_row_NOW.test
+++ b/mysql-test/suite/rpl/t/rpl_row_NOW.test
diff --git a/mysql-test/t/rpl_row_USER.test b/mysql-test/suite/rpl/t/rpl_row_USER.test
index 7b13ebc50ee..7b13ebc50ee 100644
--- a/mysql-test/t/rpl_row_USER.test
+++ b/mysql-test/suite/rpl/t/rpl_row_USER.test
diff --git a/mysql-test/suite/rpl/t/rpl_row_UUID.test b/mysql-test/suite/rpl/t/rpl_row_UUID.test
new file mode 100644
index 00000000000..b0ef96463d0
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_UUID.test
@@ -0,0 +1,9 @@
+########################################################
+# By JBM 2005-02-15 Wrapped to allow reuse of test code#
+# Added to skip if ndb is default #
+########################################################
+-- source include/not_ndb_default.inc
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+let $engine_type=myisam;
+--source extra/rpl_tests/rpl_row_UUID.test
diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs-master.opt b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs-master.opt
new file mode 100644
index 00000000000..ed7656c1f99
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs-master.opt
@@ -0,0 +1,2 @@
+--binlog_ignore_db=test_ignore --loose-innodb
+
diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs-slave.opt b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs-slave.opt
new file mode 100644
index 00000000000..48457b17309
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs-slave.opt
@@ -0,0 +1 @@
+--loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test
new file mode 100644
index 00000000000..fb43664f121
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test
@@ -0,0 +1,225 @@
+--source include/have_binlog_format_row.inc
+
+let $SERVER_VERSION=`select version()`;
+
+#This test case is not written for NDB, the result files
+#will not match when NDB is the default engine
+-- source include/not_ndb_default.inc
+
+--source include/master-slave.inc
+
+# Bug#15942 (RBR ignores --binlog_ignore_db and tries to map to table
+# on slave for writes)
+
+CREATE DATABASE test_ignore; # --binlog_ignore_db=mysqltest_ignore
+
+--echo **** On Master ****
+SHOW DATABASES;
+USE test;
+CREATE TABLE t1 (a INT, b INT);
+SHOW TABLES;
+INSERT INTO t1 VALUES (1,1), (2,2);
+USE test_ignore;
+CREATE TABLE t2 (a INT, b INT);
+SHOW TABLES;
+INSERT INTO t2 VALUES (3,3), (4,4);
+source include/show_binlog_events.inc;
+sync_slave_with_master;
+--echo **** On Slave ****
+SHOW DATABASES;
+USE test;
+SHOW TABLES;
+--error 1049
+USE test_ignore;
+
+connection master;
+DROP DATABASE test_ignore;
+sync_slave_with_master;
+
+# Bug#19995: Extreneous table maps generated for statements that does
+# not generate rows
+--disable_query_log
+--source include/master-slave-reset.inc
+--enable_query_log
+
+connection master;
+CREATE TABLE t1 (a INT);
+DELETE FROM t1;
+INSERT INTO t1 VALUES (1),(2);
+DELETE FROM t1 WHERE a = 0;
+UPDATE t1 SET a=99 WHERE a = 0;
+--replace_result $SERVER_VERSION SERVER_VERSION
+--replace_regex /table_id: [0-9]+/table_id: #/
+SHOW BINLOG EVENTS;
+
+DROP TABLE t1;
+
+# BUG#17620: Replicate (Row Based) Fails when Query Cache enabled on
+# slave
+--echo ================ Test for BUG#17620 ================
+--disable_query_log
+--source include/master-slave-reset.inc
+--enable_query_log
+
+--echo **** On Slave ****
+connection slave;
+SET GLOBAL QUERY_CACHE_SIZE=0;
+
+--echo **** On Master ****
+connection master;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+
+--echo **** On Slave ****
+sync_slave_with_master;
+SET GLOBAL QUERY_CACHE_SIZE=16*1024*1024;
+
+--echo **** On Master ****
+connection master;
+INSERT INTO t1 VALUES (4),(5),(6);
+
+--echo **** On Slave ****
+sync_slave_with_master;
+SELECT * FROM t1;
+
+--echo **** On Master ****
+connection master;
+INSERT INTO t1 VALUES (7),(8),(9);
+
+--echo **** On Slave ****
+sync_slave_with_master;
+SELECT * FROM t1;
+
+SET GLOBAL QUERY_CACHE_SIZE=0;
+
+# Bug#22550: Replication of BIT columns failing
+--echo ================ Test for BUG#22550 ================
+--disable_query_log
+--source include/master-slave-reset.inc
+--enable_query_log
+
+connection master;
+CREATE TABLE t1 (a BIT(1), b INT) ENGINE=MYISAM;
+sync_slave_with_master;
+
+connection master;
+INSERT INTO t1 VALUES(1,2);
+SELECT HEX(a),b FROM t1;
+sync_slave_with_master;
+SELECT HEX(a),b FROM t1;
+
+connection master;
+UPDATE t1 SET a=0 WHERE b=2;
+SELECT HEX(a),b FROM t1;
+sync_slave_with_master;
+SELECT HEX(a),b FROM t1;
+
+connection master;
+DROP TABLE IF EXISTS t1;
+sync_slave_with_master;
+
+# BUG#22583: RBR between MyISAM and non-MyISAM tables containing a BIT
+# field does not work
+
+--echo ================ Test for BUG#22583 ================
+--disable_query_log
+--source include/master-slave-reset.inc
+--enable_query_log
+
+# disabling warnings temporarily for ENGINE=INNODB to work without InnoDB
+--disable_warnings
+--echo **** On Master ****
+connection master;
+CREATE TABLE t1_myisam (k INT, a BIT(1), b BIT(9)) ENGINE=MYISAM;
+CREATE TABLE t1_innodb (k INT, a BIT(1), b BIT(9)) ENGINE=INNODB;
+CREATE TABLE t2_myisam (k INT, a BIT(1) NOT NULL, b BIT(4) NOT NULL) ENGINE=MYISAM;
+CREATE TABLE t2_innodb (k INT, a BIT(1) NOT NULL, b BIT(4) NOT NULL) ENGINE=INNODB;
+--echo **** On Slave ****
+sync_slave_with_master;
+ALTER TABLE t1_myisam ENGINE=INNODB;
+ALTER TABLE t1_innodb ENGINE=MYISAM;
+ALTER TABLE t2_myisam ENGINE=INNODB;
+ALTER TABLE t2_innodb ENGINE=MYISAM;
+--enable_warnings
+
+--echo **** On Master ****
+connection master;
+INSERT INTO t1_myisam VALUES(1, b'0', 257);
+INSERT INTO t1_myisam VALUES(2, b'1', 256);
+INSERT INTO t1_innodb VALUES(1, b'0', 257);
+INSERT INTO t1_innodb VALUES(2, b'1', 256);
+SELECT k, HEX(a),HEX(b) FROM t1_myisam;
+SELECT k, HEX(a),HEX(b) FROM t1_innodb;
+INSERT INTO t2_myisam VALUES(1, b'0', 9);
+INSERT INTO t2_myisam VALUES(2, b'1', 8);
+INSERT INTO t2_innodb VALUES(1, b'0', 9);
+INSERT INTO t2_innodb VALUES(2, b'1', 8);
+SELECT k, HEX(a),HEX(b) FROM t2_myisam;
+SELECT k, HEX(a),HEX(b) FROM t2_innodb;
+--echo **** On Slave ****
+sync_slave_with_master;
+SELECT k, HEX(a),HEX(b) FROM t1_myisam;
+SELECT k, HEX(a),HEX(b) FROM t1_innodb;
+SELECT k, HEX(a),HEX(b) FROM t2_myisam;
+SELECT k, HEX(a),HEX(b) FROM t2_innodb;
+
+--echo **** On Master ****
+connection master;
+UPDATE t1_myisam SET a=0 WHERE k=2;
+SELECT k, HEX(a),HEX(b) FROM t1_myisam;
+UPDATE t1_innodb SET a=0 WHERE k=2;
+SELECT k, HEX(a),HEX(b) FROM t1_innodb;
+UPDATE t2_myisam SET a=0 WHERE k=2;
+SELECT k, HEX(a),HEX(b) FROM t2_myisam;
+UPDATE t2_innodb SET a=0 WHERE k=2;
+SELECT k, HEX(a),HEX(b) FROM t2_innodb;
+--echo **** On Slave ****
+sync_slave_with_master;
+SELECT k, HEX(a),HEX(b) FROM t1_myisam;
+SELECT k, HEX(a),HEX(b) FROM t1_innodb;
+SELECT k, HEX(a),HEX(b) FROM t2_myisam;
+SELECT k, HEX(a),HEX(b) FROM t2_innodb;
+
+--echo **** On Master ****
+connection master;
+DROP TABLE IF EXISTS t1_myisam, t1_innodb, t2_myisam, t2_innodb;
+sync_slave_with_master;
+
+#
+# Bug#27716 multi-update did partially and has not binlogged
+#
+
+connection master;
+
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+CREATE TABLE `t1` (
+ `a` int(11) NOT NULL auto_increment,
+ `b` int(11) default NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
+
+CREATE TABLE `t2` (
+ `a` int(11) NOT NULL auto_increment,
+ `b` int(11) default NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
+
+# testing multi_update::send_error() effective update
+insert into t1 values (1,1),(2,2);
+insert into t2 values (1,1),(4,4);
+
+connection master;
+error ER_DUP_ENTRY;
+UPDATE t2,t1 SET t2.a=t1.a+2;
+select * from t2 /* must be (3,1), (4,4) */;
+sync_slave_with_master;
+
+connection slave;
+select * from t2 /* must be (3,1), (4,4) */;
+
+connection master;
+drop table t1,t2;
+
+sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_2myisam.test b/mysql-test/suite/rpl/t/rpl_row_basic_2myisam.test
new file mode 100644
index 00000000000..c5648fa1d77
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_2myisam.test
@@ -0,0 +1,6 @@
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+let $type= 'MYISAM' ;
+let $extra_index= ;
+-- source extra/rpl_tests/rpl_row_basic.test
diff --git a/mysql-test/t/rpl_row_basic_3innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_basic_3innodb-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_row_basic_3innodb-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_3innodb-slave.opt
diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test b/mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test
new file mode 100644
index 00000000000..3786a697e3f
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test
@@ -0,0 +1,8 @@
+-- source include/have_innodb.inc
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+let $type= 'INNODB' ;
+let $extra_index= ;
+-- source extra/rpl_tests/rpl_row_basic.test
+
diff --git a/mysql-test/t/rpl_row_basic_8partition.test b/mysql-test/suite/rpl/t/rpl_row_basic_8partition.test
index 687b3bc785d..687b3bc785d 100644
--- a/mysql-test/t/rpl_row_basic_8partition.test
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_8partition.test
diff --git a/mysql-test/t/rpl_row_blob_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_blob_innodb-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_row_blob_innodb-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_blob_innodb-slave.opt
diff --git a/mysql-test/suite/rpl/t/rpl_row_blob_innodb.test b/mysql-test/suite/rpl/t/rpl_row_blob_innodb.test
new file mode 100644
index 00000000000..6aa6c2a31b9
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_blob_innodb.test
@@ -0,0 +1,14 @@
+#################################
+# Wrapper for rpl_row_blob.test#
+#################################
+########################################################
+# By JBM 2005-02-15 Wrapped to allow reuse of test code#
+# Added to skip if ndb is default #
+########################################################
+-- source include/not_ndb_default.inc
+-- source include/have_innodb.inc
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+let $engine_type=InnoDB;
+-- source extra/rpl_tests/rpl_row_blob.test
+
diff --git a/mysql-test/suite/rpl/t/rpl_row_blob_myisam.test b/mysql-test/suite/rpl/t/rpl_row_blob_myisam.test
new file mode 100644
index 00000000000..11f5336502a
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_blob_myisam.test
@@ -0,0 +1,13 @@
+#################################
+# Wrapper for rpl_row_blob.test#
+#################################
+########################################################
+# By JBM 2005-02-15 Wrapped to allow reuse of test code#
+# Added to skip if ndb is default #
+########################################################
+-- source include/not_ndb_default.inc
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+let $engine_type=myisam;
+-- source extra/rpl_tests/rpl_row_blob.test
+
diff --git a/mysql-test/suite/rpl/t/rpl_row_charset.test b/mysql-test/suite/rpl/t/rpl_row_charset.test
new file mode 100644
index 00000000000..c83ccc586ba
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_charset.test
@@ -0,0 +1,9 @@
+########################################################
+# By JBM 2005-02-15 Wrapped to allow reuse of test code#
+# Added to skip if ndb is default #
+########################################################
+-- source include/not_ndb_default.inc
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+let $engine_type=myisam;
+-- source extra/rpl_tests/rpl_row_charset.test
diff --git a/mysql-test/suite/rpl/t/rpl_row_colSize.test b/mysql-test/suite/rpl/t/rpl_row_colSize.test
new file mode 100644
index 00000000000..078e6886ec7
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_colSize.test
@@ -0,0 +1,168 @@
+##################################################################
+# rpl_colSize #
+# #
+# This test is designed to test the changes included in WL#3228. #
+# The changes include the ability to replicate with the master #
+# having columns that are smaller (shorter) than the slave. #
+##################################################################
+
+-- source include/master-slave.inc
+-- source include/have_binlog_format_row.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+
+--echo **** Testing WL#3228 changes. ****
+--echo *** Create "wider" table on slave ***
+sync_slave_with_master;
+
+#
+# Check each column type to verify error 1532 fires (BUG#22086)
+# This check covers only those fields that require additional
+# metadata from the master to be replicated to the slave. These
+# field types are:
+# MYSQL_TYPE_NEWDECIMAL:
+# MYSQL_TYPE_FLOAT:
+# MYSQL_TYPE_BIT:
+# MYSQL_TYPE_SET:
+# MYSQL_TYPE_STRING:
+# MYSQL_TYPE_ENUM:
+# MYSQL_TYPE_VARCHAR:
+# MYSQL_TYPE_BLOB:
+
+#
+# Test: Checking MYSQL_TYPE_NEWDECIMAL fields
+#
+--echo Checking MYSQL_TYPE_NEWDECIMAL fields
+let $test_table_master = CREATE TABLE t1 (a DECIMAL(20, 10));
+let $test_table_slave = CREATE TABLE t1 (a DECIMAL(5,2));
+let $test_insert = INSERT INTO t1 VALUES (901251.90125);
+source include/test_fieldsize.inc;
+
+let $test_table_master = CREATE TABLE t1 (a DECIMAL(27, 18));
+let $test_table_slave = CREATE TABLE t1 (a DECIMAL(27, 9));
+let $test_insert = INSERT INTO t1 VALUES (901251.90125);
+source include/test_fieldsize.inc;
+
+let $test_table_master = CREATE TABLE t1 (a NUMERIC(20, 10));
+let $test_table_slave = CREATE TABLE t1 (a NUMERIC(5,2));
+let $test_insert = INSERT INTO t1 VALUES (901251.90125);
+source include/test_fieldsize.inc;
+
+#
+# Test: Checking MYSQL_TYPE_FLOAT fields
+#
+--echo Checking MYSQL_TYPE_FLOAT fields
+let $test_table_master = CREATE TABLE t1 (a FLOAT(47));
+let $test_table_slave = CREATE TABLE t1 (a FLOAT(20));
+let $test_insert = INSERT INTO t1 VALUES (901251.90125);
+source include/test_fieldsize.inc;
+
+#
+# Test: Checking MYSQL_TYPE_BIT fields
+#
+--echo Checking MYSQL_TYPE_BIT fields
+let $test_table_master = CREATE TABLE t1 (a BIT(64));
+let $test_table_slave = CREATE TABLE t1 (a BIT(5));
+let $test_insert = INSERT INTO t1 VALUES (B'10101');
+source include/test_fieldsize.inc;
+
+let $test_table_master = CREATE TABLE t1 (a BIT(12));
+let $test_table_slave = CREATE TABLE t1 (a BIT(11));
+let $test_insert = INSERT INTO t1 VALUES (B'10101');
+source include/test_fieldsize.inc;
+
+#
+# Test: Checking MYSQL_TYPE_SET fields
+#
+--echo Checking MYSQL_TYPE_SET fields
+let $test_table_master = CREATE TABLE t1 (a SET('1','2','3','4','5','6','7','8','9'));
+let $test_table_slave = CREATE TABLE t1 (a SET('4'));
+let $test_insert = INSERT INTO t1 VALUES ('4');
+source include/test_fieldsize.inc;
+
+#
+# Test: Checking MYSQL_TYPE_STRING fields
+#
+--echo Checking MYSQL_TYPE_STRING fields
+let $test_table_master = CREATE TABLE t1 (a CHAR(20));
+let $test_table_slave = CREATE TABLE t1 (a CHAR(10));
+let $test_insert = INSERT INTO t1 VALUES ('This is a test.');
+source include/test_fieldsize.inc;
+
+#
+# Test: Checking MYSQL_TYPE_ENUM fields
+#
+--echo Checking MYSQL_TYPE_ENUM fields
+let $test_table_master = CREATE TABLE t1 (a ENUM(
+ '01','02','03','04','05','06','07','08','09',
+ '11','12','13','14','15','16','17','18','19',
+ '21','22','23','24','25','26','27','28','29',
+ '31','32','33','34','35','36','37','38','39',
+ '41','42','43','44','45','46','47','48','49',
+ '51','52','53','54','55','56','57','58','59',
+ '61','62','63','64','65','66','67','68','69',
+ '71','72','73','74','75','76','77','78','79',
+ '81','82','83','84','85','86','87','88','89',
+ '91','92','93','94','95','96','97','98','99',
+ '101','102','103','104','105','106','107','108','109',
+ '111','112','113','114','115','116','117','118','119',
+ '121','122','123','124','125','126','127','128','129',
+ '131','132','133','134','135','136','137','138','139',
+ '141','142','143','144','145','146','147','148','149',
+ '151','152','153','154','155','156','157','158','159',
+ '161','162','163','164','165','166','167','168','169',
+ '171','172','173','174','175','176','177','178','179',
+ '181','182','183','184','185','186','187','188','189',
+ '191','192','193','194','195','196','197','198','199',
+ '201','202','203','204','205','206','207','208','209',
+ '211','212','213','214','215','216','217','218','219',
+ '221','222','223','224','225','226','227','228','229',
+ '231','232','233','234','235','236','237','238','239',
+ '241','242','243','244','245','246','247','248','249',
+ '251','252','253','254','255','256','257','258','259',
+ '261','262','263','264','265','266','267','268','269',
+ '271','272','273','274','275','276','277','278','279',
+ '281','282','283','284','285','286','287','288','289',
+ '291','292','293','294','295','296','297','298','299'
+ ));
+let $test_table_slave = CREATE TABLE t1 (a ENUM('44','54'));
+let $test_insert = INSERT INTO t1 VALUES ('44');
+source include/test_fieldsize.inc;
+
+#
+# Test: Checking MYSQL_TYPE_VARCHAR fields
+#
+--echo Checking MYSQL_TYPE_VARCHAR fields
+let $test_table_master = CREATE TABLE t1 (a VARCHAR(2000));
+let $test_table_slave = CREATE TABLE t1 (a VARCHAR(100));
+let $test_insert = INSERT INTO t1 VALUES ('This is a test.');
+source include/test_fieldsize.inc;
+
+let $test_table_master = CREATE TABLE t1 (a VARCHAR(200));
+let $test_table_slave = CREATE TABLE t1 (a VARCHAR(10));
+let $test_insert = INSERT INTO t1 VALUES ('This is a test.');
+source include/test_fieldsize.inc;
+
+let $test_table_master = CREATE TABLE t1 (a VARCHAR(2000));
+let $test_table_slave = CREATE TABLE t1 (a VARCHAR(1000));
+let $test_insert = INSERT INTO t1 VALUES ('This is a test.');
+source include/test_fieldsize.inc;
+
+#
+# Test: Checking MYSQL_TYPE_BLOB fields
+#
+--echo Checking MYSQL_TYPE_BLOB fields
+let $test_table_master = CREATE TABLE t1 (a LONGBLOB);
+let $test_table_slave = CREATE TABLE t1 (a TINYBLOB);
+let $test_insert = INSERT INTO t1 VALUES ('This is a test.');
+source include/test_fieldsize.inc;
+
+--echo *** Cleanup ***
+connection master;
+DROP TABLE IF EXISTS t1;
+sync_slave_with_master;
+# END 5.1 Test Case
+
diff --git a/mysql-test/suite/rpl/t/rpl_row_create_table-slave.opt b/mysql-test/suite/rpl/t/rpl_row_create_table-slave.opt
new file mode 100644
index 00000000000..48457b17309
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_create_table-slave.opt
@@ -0,0 +1 @@
+--loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_create_table.test b/mysql-test/suite/rpl/t/rpl_row_create_table.test
new file mode 100644
index 00000000000..32a6299f28b
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_create_table.test
@@ -0,0 +1,236 @@
+# Testing table creations for row-based replication.
+
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+--source include/have_innodb.inc
+connection slave;
+--source include/have_innodb.inc
+connection master;
+
+# 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
+# we disable the ps-protocol for this statement.
+--disable_ps_protocol
+
+--disable_query_log
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
+--enable_warnings
+--enable_query_log
+
+# Set the default storage engine to different values on master and
+# slave. We need to stop the slave for the server variable to take
+# effect, since the variable is only read on start-up.
+sync_slave_with_master;
+--disable_query_log
+set @storage_engine = @@global.storage_engine;
+STOP SLAVE;
+SET GLOBAL storage_engine=memory;
+START SLAVE;
+--enable_query_log
+
+connection master;
+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;
+--replace_column 1 # 4 #
+--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
+--query_vertical SHOW BINLOG EVENTS FROM 216
+--echo **** On Master ****
+--query_vertical SHOW CREATE TABLE t1
+--query_vertical SHOW CREATE TABLE t2
+--query_vertical SHOW CREATE TABLE t3
+sync_slave_with_master;
+--echo **** On Slave ****
+--query_vertical SHOW CREATE TABLE t1
+--query_vertical SHOW CREATE TABLE t2
+--query_vertical SHOW CREATE TABLE t3
+
+connection master;
+CREATE TABLE t5 (b INT, c INT) SELECT * FROM t3;
+
+CREATE TEMPORARY TABLE tt3 (a INT, b INT);
+INSERT INTO tt3 VALUES (1,2), (2,4), (3,6), (4,2), (5,10), (6,12);
+CREATE TABLE t6 (b INT, c INT) SELECT * FROM tt3;
+--echo **** On Master ****
+--query_vertical SHOW CREATE TABLE t5
+SELECT * FROM t5 ORDER BY a,b,c;
+--query_vertical SHOW CREATE TABLE t6
+SELECT * FROM t6 ORDER BY a,b,c;
+sync_slave_with_master;
+--echo **** On Slave ****
+--query_vertical SHOW CREATE TABLE t5
+SELECT * FROM t5 ORDER BY a,b,c;
+--query_vertical SHOW CREATE TABLE t6
+SELECT * FROM t6 ORDER BY a,b,c;
+
+connection master;
+# Test for erroneous constructions
+--error ER_DUP_ENTRY
+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 1100;
+
+# Test that INSERT-SELECT works the same way as for SBR.
+CREATE TABLE t7 (a INT, b INT UNIQUE);
+--error ER_DUP_ENTRY
+INSERT INTO t7 SELECT a,b FROM tt3;
+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 1100;
+sync_slave_with_master;
+SELECT * FROM t7 ORDER BY a,b;
+
+connection master;
+CREATE TEMPORARY TABLE tt4 (a INT, b INT);
+INSERT INTO tt4 VALUES (4,8), (5,10), (6,12);
+BEGIN;
+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 1298;
+SELECT * FROM t7 ORDER BY a,b;
+sync_slave_with_master;
+SELECT * FROM t7 ORDER BY a,b;
+
+connection master;
+CREATE TABLE t8 LIKE t4;
+CREATE TABLE t9 LIKE tt4;
+CREATE TEMPORARY TABLE tt5 LIKE t4;
+CREATE TEMPORARY TABLE tt6 LIKE tt4;
+CREATE TEMPORARY TABLE tt7 SELECT 1;
+--echo **** On Master ****
+--query_vertical SHOW CREATE TABLE t8
+--query_vertical SHOW CREATE TABLE t9
+--replace_column 1 # 4 #
+--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
+SHOW BINLOG EVENTS FROM 1396;
+sync_slave_with_master;
+--echo **** On Slave ****
+--query_vertical SHOW CREATE TABLE t8
+--query_vertical SHOW CREATE TABLE t9
+
+connection master;
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
+sync_slave_with_master;
+# Here we reset the value of the default storage engine
+STOP SLAVE;
+SET GLOBAL storage_engine=@storage_engine;
+START SLAVE;
+--enable_ps_protocol
+
+# BUG#22864 (Rollback following CREATE ... SELECT discards 'CREATE
+# table' from log):
+--echo ================ BUG#22864 ================
+connection slave;
+STOP SLAVE;
+RESET SLAVE;
+connection master;
+RESET MASTER;
+connection slave;
+START SLAVE;
+connection master;
+SET AUTOCOMMIT=0;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+
+CREATE TABLE t2 ENGINE=INNODB SELECT * FROM t1;
+ROLLBACK;
+
+CREATE TABLE t3 ENGINE=INNODB SELECT * FROM t1;
+INSERT INTO t3 VALUES (4),(5),(6);
+ROLLBACK;
+
+CREATE TABLE t4 ENGINE=INNODB SELECT * FROM t1;
+INSERT INTO t1 VALUES (4),(5),(6);
+ROLLBACK;
+
+SHOW TABLES;
+SELECT TABLE_NAME,ENGINE
+ FROM INFORMATION_SCHEMA.TABLES
+ WHERE TABLE_NAME LIKE 't_'
+ORDER BY TABLE_NAME;
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+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;
+sync_slave_with_master;
+SHOW TABLES;
+SELECT TABLE_NAME,ENGINE
+ FROM INFORMATION_SCHEMA.TABLES
+ WHERE TABLE_NAME LIKE 't_'
+ORDER BY TABLE_NAME;
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+SELECT * FROM t3 ORDER BY a;
+SELECT * FROM t4 ORDER BY a;
+
+connection master;
+DROP TABLE IF EXISTS t1,t2,t3,t4;
+SET AUTOCOMMIT=1;
+sync_slave_with_master;
+
+# Some tests with temporary tables
+connection slave;
+STOP SLAVE;
+RESET SLAVE;
+
+connection master;
+RESET MASTER;
+
+connection slave;
+START SLAVE;
+
+connection master;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+
+CREATE TABLE t2 (a INT) ENGINE=INNODB;
+
+BEGIN;
+INSERT INTO t2 SELECT a*a FROM t1;
+CREATE TEMPORARY TABLE tt1
+SELECT a+1 AS a
+ FROM t1
+ WHERE a MOD 2 = 1;
+INSERT INTO t2 SELECT a+2 FROM tt1;
+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;
+sync_slave_with_master;
+SELECT * FROM t2 ORDER BY a;
+
+connection master;
+TRUNCATE TABLE t2;
+
+BEGIN;
+INSERT INTO t2 SELECT a*a FROM t1;
+CREATE TEMPORARY TABLE tt2
+SELECT a+1 AS a
+ FROM t1
+ WHERE a MOD 2 = 1;
+INSERT INTO t2 SELECT a+2 FROM tt2;
+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 637;
+sync_slave_with_master;
+SELECT * FROM t2 ORDER BY a;
+
+connection master;
+DROP TABLE t1,t2;
+sync_slave_with_master;
diff --git a/mysql-test/t/rpl_row_delayed_ins.test b/mysql-test/suite/rpl/t/rpl_row_delayed_ins.test
index a0e74567349..a0e74567349 100644
--- a/mysql-test/t/rpl_row_delayed_ins.test
+++ b/mysql-test/suite/rpl/t/rpl_row_delayed_ins.test
diff --git a/mysql-test/t/rpl_row_drop.test b/mysql-test/suite/rpl/t/rpl_row_drop.test
index 20c217a7c3a..20c217a7c3a 100644
--- a/mysql-test/t/rpl_row_drop.test
+++ b/mysql-test/suite/rpl/t/rpl_row_drop.test
diff --git a/mysql-test/t/rpl_row_err_daisychain-master.opt b/mysql-test/suite/rpl/t/rpl_row_err_daisychain-master.opt
index 83ed8522e72..83ed8522e72 100644
--- a/mysql-test/t/rpl_row_err_daisychain-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_err_daisychain-master.opt
diff --git a/mysql-test/t/rpl_row_err_daisychain-slave.opt b/mysql-test/suite/rpl/t/rpl_row_err_daisychain-slave.opt
index 4cb7a31da81..4cb7a31da81 100644
--- a/mysql-test/t/rpl_row_err_daisychain-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_err_daisychain-slave.opt
diff --git a/mysql-test/suite/rpl/t/rpl_row_extraColmaster_ndb.test b/mysql-test/suite/rpl/t/rpl_row_extraColmaster_ndb.test
new file mode 100644
index 00000000000..b91947e52e2
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_extraColmaster_ndb.test
@@ -0,0 +1,12 @@
+###########################################
+# Purpose: Wrapper for rpl_extraMaster_Col.test
+# Using NDB
+###########################################
+-- source include/have_ndb.inc
+-- source include/ndb_master-slave.inc
+-- source include/have_binlog_format_row.inc
+
+let $engine_type = 'NDB';
+
+-- source extra/rpl_tests/rpl_extraMaster_Col.test
+
diff --git a/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test b/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test
new file mode 100644
index 00000000000..bfa356fbfb4
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test
@@ -0,0 +1,17 @@
+# depends on the binlog output
+-- source include/have_binlog_format_row.inc
+
+let $rename_event_pos= 623;
+
+# 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
+# we disable the ps-protocol for this statement.
+
+# Merge tables are not supported in NDB
+-- source include/not_ndb_default.inc
+
+
+--disable_ps_protocol
+-- source extra/rpl_tests/rpl_flsh_tbls.test
+--enable_ps_protocol
+
diff --git a/mysql-test/t/rpl_row_func001.test b/mysql-test/suite/rpl/t/rpl_row_func001.test
index 53fb55118e6..53fb55118e6 100644
--- a/mysql-test/t/rpl_row_func001.test
+++ b/mysql-test/suite/rpl/t/rpl_row_func001.test
diff --git a/mysql-test/t/rpl_row_func002.test b/mysql-test/suite/rpl/t/rpl_row_func002.test
index 44a704bfbc5..44a704bfbc5 100644
--- a/mysql-test/t/rpl_row_func002.test
+++ b/mysql-test/suite/rpl/t/rpl_row_func002.test
diff --git a/mysql-test/suite/rpl/t/rpl_row_func003-slave.opt b/mysql-test/suite/rpl/t/rpl_row_func003-slave.opt
new file mode 100644
index 00000000000..48457b17309
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_func003-slave.opt
@@ -0,0 +1 @@
+--loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_func003.test b/mysql-test/suite/rpl/t/rpl_row_func003.test
new file mode 100644
index 00000000000..30b24cf4174
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_func003.test
@@ -0,0 +1,13 @@
+###################################
+# Wrapper for rpl_row_func003.test#
+###################################
+########################################################
+# By JBM 2005-02-15 Wrapped to allow reuse of test code#
+# Added to skip if ndb is default #
+########################################################
+-- source include/not_ndb_default.inc
+-- source include/have_innodb.inc
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+let $engine_type=INNODB;
+-- source extra/rpl_tests/rpl_row_func003.test
diff --git a/mysql-test/t/rpl_row_inexist_tbl-slave.opt b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl-slave.opt
index abd717f8222..abd717f8222 100644
--- a/mysql-test/t/rpl_row_inexist_tbl-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl-slave.opt
diff --git a/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test
new file mode 100644
index 00000000000..25a8c0e744e
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test
@@ -0,0 +1,33 @@
+# Test to see what slave says when master is updating a table it does
+# not have
+--source include/have_binlog_format_row.inc
+
+source include/master-slave.inc;
+
+connection master;
+create table t1 (a int not null primary key);
+insert into t1 values (1);
+create table t2 (a int);
+insert into t2 values (1);
+update t1, t2 set t1.a = 0 where t1.a = t2.a;
+
+sync_slave_with_master;
+# t2 should not have been replicated
+# t1 should have been properly updated
+show tables;
+select * from t1;
+drop table t1;
+
+connection master;
+insert into t1 values (1);
+
+connection slave;
+# slave should have stopped because can't find table t1
+--source include/wait_for_slave_sql_to_stop.inc
+# see if we have a good error message:
+--replace_column 7 #
+source include/show_slave_status.inc;
+
+# cleanup
+connection master;
+drop table t1, t2;
diff --git a/mysql-test/t/rpl_row_insert_delayed.test b/mysql-test/suite/rpl/t/rpl_row_insert_delayed.test
index 9aeb57c4fa2..9aeb57c4fa2 100644
--- a/mysql-test/t/rpl_row_insert_delayed.test
+++ b/mysql-test/suite/rpl/t/rpl_row_insert_delayed.test
diff --git a/mysql-test/t/rpl_row_log-master.opt b/mysql-test/suite/rpl/t/rpl_row_log-master.opt
index e0d075c3fbd..e0d075c3fbd 100644
--- a/mysql-test/t/rpl_row_log-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_log-master.opt
diff --git a/mysql-test/t/rpl_row_log-slave.opt b/mysql-test/suite/rpl/t/rpl_row_log-slave.opt
index 8b137891791..8b137891791 100644
--- a/mysql-test/t/rpl_row_log-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_log-slave.opt
diff --git a/mysql-test/suite/rpl/t/rpl_row_log.test b/mysql-test/suite/rpl/t/rpl_row_log.test
new file mode 100644
index 00000000000..197f83c85af
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_log.test
@@ -0,0 +1,17 @@
+###################################
+# Wrapper for rpl_row_log.test #
+# Added wrapper so that MyISAM & #
+# Innodb and NDB could all use the#
+# Same test. NDB produced a diff #
+# bin-log #
+###################################
+########################################################
+# By JBM 2005-02-15 Wrapped to allow reuse of test code#
+# Added to skip if ndb is default #
+########################################################
+-- source include/not_ndb_default.inc
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+let $engine_type=MyISAM;
+-- source extra/rpl_tests/rpl_log.test
+
diff --git a/mysql-test/t/rpl_row_log_innodb-master.opt b/mysql-test/suite/rpl/t/rpl_row_log_innodb-master.opt
index e0d075c3fbd..e0d075c3fbd 100644
--- a/mysql-test/t/rpl_row_log_innodb-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_log_innodb-master.opt
diff --git a/mysql-test/t/rpl_row_log_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_log_innodb-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_row_log_innodb-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_log_innodb-slave.opt
diff --git a/mysql-test/suite/rpl/t/rpl_row_log_innodb.test b/mysql-test/suite/rpl/t/rpl_row_log_innodb.test
new file mode 100644
index 00000000000..16e775287b3
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_log_innodb.test
@@ -0,0 +1,14 @@
+###################################
+# Wrapper for rpl_row_log.test #
+# Added wrapper so that MyISAM & #
+# Innodb and NDB could all use the#
+# Same test. NDB produced a diff #
+# bin-log #
+###################################
+-- source include/not_ndb_default.inc
+-- source include/have_binlog_format_row.inc
+-- source include/have_innodb.inc
+-- source include/master-slave.inc
+let $engine_type=InnoDB;
+-- source extra/rpl_tests/rpl_log.test
+
diff --git a/mysql-test/t/rpl_row_max_relay_size.test b/mysql-test/suite/rpl/t/rpl_row_max_relay_size.test
index a0be59e44a7..a0be59e44a7 100644
--- a/mysql-test/t/rpl_row_max_relay_size.test
+++ b/mysql-test/suite/rpl/t/rpl_row_max_relay_size.test
diff --git a/mysql-test/t/rpl_row_mysqlbinlog-master.opt b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog-master.opt
index 07d12817f5f..07d12817f5f 100644
--- a/mysql-test/t/rpl_row_mysqlbinlog-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog-master.opt
diff --git a/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
new file mode 100644
index 00000000000..dd46d64f684
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
@@ -0,0 +1,348 @@
+##################################################################
+# Author: JBM #
+# Date: 2006-02-22 #
+# Purpose: To test changes to mysqlbinlog for row based bin logs #
+# We are using .opt file since we need small binlog size #
+##################################################################
+# Include Section
+# Make sure that we have row based bin log
+-- source include/have_binlog_format_row.inc
+# Embedded server doesn't support binlogging
+-- source include/not_embedded.inc
+-- source include/master-slave.inc
+# This test requires the cp932 charset compiled in
+-- source include/have_cp932.inc
+
+# Setup Section
+# we need this for getting fixed timestamps inside of this test
+
+--disable_query_log
+select "---Setup Section --" as "";
+--enable_query_log
+
+set timestamp=1000000000;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2,t3;
+--enable_warnings
+
+connection master;
+CREATE TABLE t1(word VARCHAR(20));
+CREATE TABLE t2(id INT AUTO_INCREMENT NOT NULL PRIMARY KEY);
+CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT);
+
+
+# Test Section
+# Lets start by putting some data into the tables.
+
+--disable_query_log
+INSERT INTO t1 VALUES ("abirvalg");
+LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
+LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
+LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
+LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
+LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
+
+# d1 length 3000
+set @d1 = 'dd1';
+set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
+set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
+set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
+
+let $count=500;
+while ($count)
+{
+ INSERT INTO t2 VALUES (NULL);
+ eval INSERT INTO t3 VALUES ($count,@d1,'20060222000000','Tested in Texas',$count*2.2);
+ dec $count;
+}
+--enable_query_log
+
+
+--disable_query_log
+select "---Test1 check table load --" as "";
+--enable_query_log
+
+# Lets Check the tables on the Master
+SELECT COUNT(*) from t1;
+SELECT COUNT(*) from t2;
+SELECT COUNT(*) from t3;
+SELECT * FROM t1 ORDER BY word LIMIT 5;
+SELECT * FROM t2 ORDER BY id LIMIT 5;
+SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5;
+
+# Should have the same on the slave;
+
+sync_slave_with_master;
+SELECT COUNT(*) from t1;
+SELECT COUNT(*) from t2;
+SELECT COUNT(*) from t3;
+SELECT * FROM t1 ORDER BY word LIMIT 5;
+SELECT * FROM t2 ORDER BY id LIMIT 5;
+SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5;
+
+# Okay time to get busy, back to master
+
+connection master;
+
+# simple query to show more in second binlog
+insert into t1 values ("Alas");
+flush logs;
+
+# delimiters are for easier debugging in future
+--disable_query_log
+select "--- Test 1 Dump binlog to file --" as "";
+--enable_query_log
+
+#
+# Prepare local temporary file to recreate what we have currently.
+
+--exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/master.sql
+
+--exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000002 >> $MYSQLTEST_VARDIR/tmp/master.sql
+
+# Now that we have our file, lets get rid of the current database.
+# Cleanup the master and the slave and try to recreate.
+--disable_query_log
+select "--- Test 1 delete tables, clean master and slave --" as "";
+--enable_query_log
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+
+sync_slave_with_master;
+#we expect STOP SLAVE to produce a warning as the slave is stopped
+#(the server was started with skip-slave-start)
+--disable_warnings
+stop slave;
+--enable_warnings
+--require r/slave-stopped.result
+show status like 'Slave_running';
+connection master;
+reset master;
+connection slave;
+reset slave;
+start slave;
+--require r/slave-running.result
+show status like 'Slave_running';
+connection master;
+
+# We should be clean at this point, now we will run in the file from above.
+--disable_query_log
+select "--- Test 1 Load from Dump binlog file --" as "";
+--enable_query_log
+
+--exec $MYSQL -e "source $MYSQLTEST_VARDIR/tmp/master.sql"
+
+--disable_query_log
+select "--- Test 1 Check Load Results --" as "";
+--enable_query_log
+
+# Lets Check the tables on the Master
+SELECT COUNT(*) from t1;
+SELECT COUNT(*) from t2;
+SELECT COUNT(*) from t3;
+SELECT * FROM t1 ORDER BY word LIMIT 5;
+SELECT * FROM t2 ORDER BY id LIMIT 5;
+SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5;
+
+# Should have the same on the slave;
+
+sync_slave_with_master;
+SELECT COUNT(*) from t1;
+SELECT COUNT(*) from t2;
+SELECT COUNT(*) from t3;
+SELECT * FROM t1 ORDER BY word LIMIT 5;
+SELECT * FROM t2 ORDER BY id LIMIT 5;
+SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5;
+connection master;
+
+# We should be gold by the time, so I will get rid of our file.
+
+--exec rm $MYSQLTEST_VARDIR/tmp/master.sql
+
+
+# this test for position option
+# By setting this position to 413, we should only get the create of t3
+--disable_query_log
+select "--- Test 2 position test --" as "";
+--enable_query_log
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=416 $MYSQLTEST_VARDIR/log/master-bin.000001
+
+# These are tests for remote binlog.
+# They should return the same as previous test.
+
+--disable_query_log
+select "--- Test 3 First Remote test --" as "";
+--enable_query_log
+
+# This is broken now
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --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
+
+--disable_query_log
+select "--- Test 4 Second Remote test --" as "";
+--enable_query_log
+--exec $MYSQL_BINLOG --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 > $MYSQLTEST_VARDIR/tmp/remote.sql
+
+--exec $MYSQL_BINLOG --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002 >> $MYSQLTEST_VARDIR/tmp/remote.sql
+
+# Now that we have our file, lets get rid of the current database.
+# Cleanup the master and the slave and try to recreate.
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+
+sync_slave_with_master;
+
+#we expect STOP SLAVE to produce a warning as the slave is stopped
+#(the server was started with skip-slave-start)
+
+--disable_warnings
+stop slave;
+--enable_warnings
+--require r/slave-stopped.result
+show status like 'Slave_running';
+connection master;
+reset master;
+connection slave;
+reset slave;
+start slave;
+--require r/slave-running.result
+show status like 'Slave_running';
+connection master;
+
+# We should be clean at this point, now we will run in the file from above.
+
+--exec $MYSQL -e "source $MYSQLTEST_VARDIR/tmp/remote.sql"
+
+# Lets Check the tables on the Master
+
+SELECT COUNT(*) from t1;
+SELECT COUNT(*) from t2;
+SELECT COUNT(*) from t3;
+SELECT * FROM t1 ORDER BY word LIMIT 5;
+SELECT * FROM t2 ORDER BY id LIMIT 5;
+SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5;
+
+# Should have the same on the slave;
+
+sync_slave_with_master;
+SELECT COUNT(*) from t1;
+SELECT COUNT(*) from t2;
+SELECT COUNT(*) from t3;
+SELECT * FROM t1 ORDER BY word LIMIT 5;
+SELECT * FROM t2 ORDER BY id LIMIT 5;
+SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5;
+connection master;
+
+# We should be gold by the time, so I will get rid of our file.
+
+--exec rm $MYSQLTEST_VARDIR/tmp/remote.sql
+################### End Bug 17654 ######################
+
+# LOAD DATA
+--disable_query_log
+select "--- Test 5 LOAD DATA --" as "";
+--enable_query_log
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --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
+select "--- Test 6 reading stdin --" as "";
+--enable_query_log
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--exec $MYSQL_BINLOG --short-form - < $MYSQLTEST_VARDIR/log/master-bin.000001
+
+--disable_query_log
+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 - < $MYSQLTEST_VARDIR/log/master-bin.000001
+
+# Bug#16217 (mysql client did not know how not switch its internal charset)
+--disable_query_log
+select "--- Test 8 switch internal charset --" as "";
+--enable_query_log
+sync_slave_with_master;
+
+#we expect STOP SLAVE to produce a warning as the slave is stopped
+#(the server was started with skip-slave-start)
+
+--disable_warnings
+stop slave;
+--enable_warnings
+--require r/slave-stopped.result
+show status like 'Slave_running';
+connection master;
+reset master;
+connection slave;
+reset slave;
+start slave;
+--require r/slave-running.result
+show status like 'Slave_running';
+connection master;
+
+create table t4 (f text character set utf8);
+create table t5 (f text character set cp932);
+--exec $MYSQL --default-character-set=utf8 test -e "insert into t4 values(_utf8'ソ')"
+--exec $MYSQL --default-character-set=cp932 test -e "insert into t5 values(_cp932'ƒ\');"
+flush logs;
+rename table t4 to t04, t5 to t05;
+--exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000001 | $MYSQL --default-character-set=utf8
+# original and recovered data must be equal
+select HEX(f) from t04;
+select HEX(f) from t4;
+select HEX(f) from t05;
+select HEX(f) from t5;
+
+# slave should have same
+sync_slave_with_master;
+select HEX(f) from t04;
+select HEX(f) from t4;
+select HEX(f) from t05;
+select HEX(f) from t5;
+
+--disable_query_log
+select "--- Test cleanup --" as "";
+--enable_query_log
+# clean up
+connection master;
+sync_slave_with_master;
+
+connection master;
+
+# BUG#17654 also test mysqlbinlog to ensure it can read the binlog from a remote server
+# and ensure that the results are the same as if read from a file (the same file).
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT NOT NULL KEY, b INT);
+
+INSERT INTO t1 VALUES(1,1);
+
+SELECT * FROM t1;
+
+FLUSH LOGS;
+
+--exec $MYSQL_BINLOG --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 > $MYSQLTEST_VARDIR/tmp/remote.sql
+--exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/local.sql
+
+--diff_files $MYSQLTEST_VARDIR/tmp/local.sql $MYSQLTEST_VARDIR/tmp/remote.sql
+
+--exec rm $MYSQLTEST_VARDIR/tmp/remote.sql
+
+--exec rm $MYSQLTEST_VARDIR/tmp/local.sql
+
+DROP TABLE IF EXISTS t1, t2, t3, t04, t05, t4, t5;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_row_mystery22.test b/mysql-test/suite/rpl/t/rpl_row_mystery22.test
index 9933fec22fc..9933fec22fc 100644
--- a/mysql-test/t/rpl_row_mystery22.test
+++ b/mysql-test/suite/rpl/t/rpl_row_mystery22.test
diff --git a/mysql-test/t/rpl_row_reset_slave.test b/mysql-test/suite/rpl/t/rpl_row_reset_slave.test
index a970c161153..a970c161153 100644
--- a/mysql-test/t/rpl_row_reset_slave.test
+++ b/mysql-test/suite/rpl/t/rpl_row_reset_slave.test
diff --git a/mysql-test/t/rpl_row_sp001.test b/mysql-test/suite/rpl/t/rpl_row_sp001.test
index c12e73b6861..c12e73b6861 100644
--- a/mysql-test/t/rpl_row_sp001.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp001.test
diff --git a/mysql-test/t/rpl_row_sp002_innodb-master.opt b/mysql-test/suite/rpl/t/rpl_row_sp002_innodb-master.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_row_sp002_innodb-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_sp002_innodb-master.opt
diff --git a/mysql-test/t/rpl_row_sp002_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_sp002_innodb-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_row_sp002_innodb-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_sp002_innodb-slave.opt
diff --git a/mysql-test/t/rpl_row_sp002_innodb.test b/mysql-test/suite/rpl/t/rpl_row_sp002_innodb.test
index e272e34e715..e272e34e715 100644
--- a/mysql-test/t/rpl_row_sp002_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp002_innodb.test
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp003-master.opt b/mysql-test/suite/rpl/t/rpl_row_sp003-master.opt
new file mode 100644
index 00000000000..48457b17309
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_sp003-master.opt
@@ -0,0 +1 @@
+--loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp003-slave.opt b/mysql-test/suite/rpl/t/rpl_row_sp003-slave.opt
new file mode 100644
index 00000000000..48457b17309
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_sp003-slave.opt
@@ -0,0 +1 @@
+--loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp003.test b/mysql-test/suite/rpl/t/rpl_row_sp003.test
new file mode 100644
index 00000000000..391ecd59b22
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_sp003.test
@@ -0,0 +1,13 @@
+#################################
+# Wrapper for rpl_row_sp003.test#
+#################################
+########################################################
+# By JBM 2005-02-15 Wrapped to allow reuse of test code#
+# Added to skip if ndb is default #
+########################################################
+-- source include/not_ndb_default.inc
+-- source include/have_innodb.inc
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+let $engine_type=INNODB;
+-- source extra/rpl_tests/rpl_row_sp003.test
diff --git a/mysql-test/t/rpl_row_sp005.test b/mysql-test/suite/rpl/t/rpl_row_sp005.test
index 054fa02f514..054fa02f514 100644
--- a/mysql-test/t/rpl_row_sp005.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp005.test
diff --git a/mysql-test/t/rpl_row_sp006_InnoDB-slave.opt b/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_row_sp006_InnoDB-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB-slave.opt
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test b/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test
new file mode 100644
index 00000000000..e5be4e6dc28
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test
@@ -0,0 +1,13 @@
+#################################
+# Wrapper for rpl_row_sp006.test#
+#################################
+########################################################
+# By JBM 2005-02-15 Wrapped to allow reuse of test code#
+# Added to skip if ndb is default #
+########################################################
+-- source include/not_ndb_default.inc
+-- source include/have_innodb.inc
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+let $engine_type=InnoDB;
+-- source extra/rpl_tests/rpl_row_sp006.test
diff --git a/mysql-test/t/rpl_row_sp007_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_sp007_innodb-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_row_sp007_innodb-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_sp007_innodb-slave.opt
diff --git a/mysql-test/t/rpl_row_sp007_innodb.test b/mysql-test/suite/rpl/t/rpl_row_sp007_innodb.test
index 41af5a5f997..41af5a5f997 100644
--- a/mysql-test/t/rpl_row_sp007_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp007_innodb.test
diff --git a/mysql-test/t/rpl_row_sp008.test b/mysql-test/suite/rpl/t/rpl_row_sp008.test
index b1295820c99..b1295820c99 100644
--- a/mysql-test/t/rpl_row_sp008.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp008.test
diff --git a/mysql-test/t/rpl_row_sp009.test b/mysql-test/suite/rpl/t/rpl_row_sp009.test
index 92d47c6f50f..92d47c6f50f 100644
--- a/mysql-test/t/rpl_row_sp009.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp009.test
diff --git a/mysql-test/t/rpl_row_sp010.test b/mysql-test/suite/rpl/t/rpl_row_sp010.test
index 28b82217517..28b82217517 100644
--- a/mysql-test/t/rpl_row_sp010.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp010.test
diff --git a/mysql-test/t/rpl_row_sp011.test b/mysql-test/suite/rpl/t/rpl_row_sp011.test
index 25c2fc9ad26..25c2fc9ad26 100644
--- a/mysql-test/t/rpl_row_sp011.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp011.test
diff --git a/mysql-test/t/rpl_row_sp012.test b/mysql-test/suite/rpl/t/rpl_row_sp012.test
index 3a8d295121c..3a8d295121c 100644
--- a/mysql-test/t/rpl_row_sp012.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp012.test
diff --git a/mysql-test/t/rpl_row_stop_middle.test b/mysql-test/suite/rpl/t/rpl_row_stop_middle.test
index da363736100..da363736100 100644
--- a/mysql-test/t/rpl_row_stop_middle.test
+++ b/mysql-test/suite/rpl/t/rpl_row_stop_middle.test
diff --git a/mysql-test/t/rpl_row_stop_middle_update-master.opt b/mysql-test/suite/rpl/t/rpl_row_stop_middle_update-master.opt
index b7db8f97bdd..b7db8f97bdd 100644
--- a/mysql-test/t/rpl_row_stop_middle_update-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_stop_middle_update-master.opt
diff --git a/mysql-test/t/rpl_row_stop_middle_update-slave.opt b/mysql-test/suite/rpl/t/rpl_row_stop_middle_update-slave.opt
index ea49a27adf4..ea49a27adf4 100644
--- a/mysql-test/t/rpl_row_stop_middle_update-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_stop_middle_update-slave.opt
diff --git a/mysql-test/t/rpl_row_stop_middle_update.test b/mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test
index 29b3008e822..29b3008e822 100644
--- a/mysql-test/t/rpl_row_stop_middle_update.test
+++ b/mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test
diff --git a/mysql-test/t/rpl_row_tabledefs_2myisam.test b/mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test
index ab4914e15fa..ab4914e15fa 100644
--- a/mysql-test/t/rpl_row_tabledefs_2myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test
diff --git a/mysql-test/t/rpl_row_tabledefs_3innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_row_tabledefs_3innodb-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb-slave.opt
diff --git a/mysql-test/t/rpl_row_tabledefs_3innodb.test b/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test
index 7824fbfb663..7824fbfb663 100644
--- a/mysql-test/t/rpl_row_tabledefs_3innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test
diff --git a/mysql-test/t/rpl_row_trig001.test b/mysql-test/suite/rpl/t/rpl_row_trig001.test
index 7b1fca2d6a1..7b1fca2d6a1 100644
--- a/mysql-test/t/rpl_row_trig001.test
+++ b/mysql-test/suite/rpl/t/rpl_row_trig001.test
diff --git a/mysql-test/t/rpl_row_trig002.test b/mysql-test/suite/rpl/t/rpl_row_trig002.test
index 7ca8a68f060..7ca8a68f060 100644
--- a/mysql-test/t/rpl_row_trig002.test
+++ b/mysql-test/suite/rpl/t/rpl_row_trig002.test
diff --git a/mysql-test/t/rpl_row_trig003.test b/mysql-test/suite/rpl/t/rpl_row_trig003.test
index 4a1bbc5ca89..4a1bbc5ca89 100644
--- a/mysql-test/t/rpl_row_trig003.test
+++ b/mysql-test/suite/rpl/t/rpl_row_trig003.test
diff --git a/mysql-test/t/rpl_row_trig004.test b/mysql-test/suite/rpl/t/rpl_row_trig004.test
index a918c602d56..a918c602d56 100644
--- a/mysql-test/t/rpl_row_trig004.test
+++ b/mysql-test/suite/rpl/t/rpl_row_trig004.test
diff --git a/mysql-test/suite/rpl/t/rpl_row_unsafe_funcs.test b/mysql-test/suite/rpl/t/rpl_row_unsafe_funcs.test
new file mode 100644
index 00000000000..069700546ce
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_unsafe_funcs.test
@@ -0,0 +1,35 @@
+source include/master-slave.inc;
+source include/have_binlog_format_mixed.inc;
+
+#
+# Bug #30244: row_count/found_rows does not replicate well
+#
+
+connection master;
+
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a INT, b INT);
+
+INSERT INTO t1 SELECT 1;
+
+connection master1;
+INSERT INTO t1 VALUES (2),(3),(4),(5),(6);
+
+connection master;
+INSERT INTO t2 SELECT 1, ROW_COUNT();
+
+INSERT INTO t1 VALUES (2),(3),(4);
+INSERT INTO t2 SELECT 2, ROW_COUNT();
+
+#must return 1 and 3
+SELECT b FROM t2 ORDER BY a;
+
+sync_slave_with_master;
+
+#must return 1 and 3
+SELECT b FROM t2 ORDER BY a;
+
+connection master;
+DROP TABLE t1, t2;
+sync_slave_with_master;
+connection master;
diff --git a/mysql-test/suite/rpl/t/rpl_row_until.test b/mysql-test/suite/rpl/t/rpl_row_until.test
new file mode 100644
index 00000000000..9464e5cfadd
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_until.test
@@ -0,0 +1,76 @@
+-- source include/not_ndb_default.inc
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+# Test is dependent on binlog positions
+
+# prepare version for substitutions
+let $VERSION=`select version()`;
+
+# stop slave before he will start replication also sync with master
+# for avoiding undetermenistic behaviour
+save_master_pos;
+connection slave;
+sync_with_master;
+stop slave;
+
+connection master;
+# create some events on master
+create table t1(n int not null auto_increment primary key);
+insert into t1 values (1),(2),(3),(4);
+drop table t1;
+create table t2(n int not null auto_increment primary key);
+insert into t2 values (1),(2);
+insert into t2 values (3),(4);
+drop table t2;
+
+# try to replicate all queries until drop of t1
+connection slave;
+start slave until master_log_file='master-bin.000001', master_log_pos=311;
+--source include/wait_for_slave_sql_to_stop.inc
+# here table should be still not deleted
+select * from t1;
+source include/show_slave_status.inc;
+
+# this should fail right after start
+start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
+--source include/wait_for_slave_sql_to_stop.inc
+# again this table should be still not deleted
+select * from t1;
+source include/show_slave_status.inc;
+
+# try replicate all up to and not including the second insert to t2;
+start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=728;
+--source include/wait_for_slave_sql_to_stop.inc
+select * from t2;
+source include/show_slave_status.inc;
+
+# clean up
+start slave;
+connection master;
+save_master_pos;
+connection slave;
+sync_with_master;
+stop slave;
+
+# this should stop immediately as we are already there
+start slave until master_log_file='master-bin.000001', master_log_pos=740;
+--source include/wait_for_slave_sql_to_stop.inc
+# here the sql slave thread should be stopped
+--replace_result bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004
+source include/show_slave_status.inc;
+
+#testing various error conditions
+--error 1277
+start slave until master_log_file='master-bin', master_log_pos=561;
+--error 1277
+start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
+--error 1277
+start slave until master_log_file='master-bin.000001';
+--error 1277
+start slave until relay_log_file='slave-relay-bin.000002';
+--error 1277
+start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
+# Warning should be given for second command
+start slave sql_thread;
+start slave until master_log_file='master-bin.000001', master_log_pos=740;
diff --git a/mysql-test/t/rpl_row_view01.test b/mysql-test/suite/rpl/t/rpl_row_view01.test
index 634e3c30cc6..634e3c30cc6 100644
--- a/mysql-test/t/rpl_row_view01.test
+++ b/mysql-test/suite/rpl/t/rpl_row_view01.test
diff --git a/mysql-test/suite/rpl/t/rpl_server_id1.test b/mysql-test/suite/rpl/t/rpl_server_id1.test
new file mode 100644
index 00000000000..2db1f6e364d
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_server_id1.test
@@ -0,0 +1,26 @@
+# This test checks that the slave I/O thread refuses to start if slave
+# and master have the same server id (because this is a useless setup,
+# and otherwise SHOW SLAVE STATUS shows progress but all queries are
+# ignored, which has caught our customers), unless
+# --replicate-same-server-id.
+
+source include/master-slave.inc;
+connection slave;
+create table t1 (n int);
+reset master;
+# replicate ourselves
+stop slave;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval change master to master_port=$SLAVE_MYPORT;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+--replace_column 16 # 18 # 35 # 36 #
+query_vertical show slave status;
+start slave;
+insert into t1 values (1);
+# can't MASTER_POS_WAIT(), it does not work in this weird setup
+# (when slave is its own master without --replicate-same-server-id)
+sleep 2; # enough time for the event to be replicated (it should not)
+show status like "slave_running";
+drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_server_id2-slave.opt b/mysql-test/suite/rpl/t/rpl_server_id2-slave.opt
index 302889525dd..302889525dd 100644
--- a/mysql-test/t/rpl_server_id2-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_server_id2-slave.opt
diff --git a/mysql-test/suite/rpl/t/rpl_server_id2.test b/mysql-test/suite/rpl/t/rpl_server_id2.test
new file mode 100644
index 00000000000..7e67fb42b4f
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_server_id2.test
@@ -0,0 +1,26 @@
+# This test checks that a slave DOES execute queries originating
+# from itself, if running with --replicate-same-server-id.
+
+source include/master-slave.inc;
+connection slave;
+create table t1 (n int);
+reset master;
+# replicate ourselves
+stop slave;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval change master to master_port=$SLAVE_MYPORT;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+--replace_column 18 # 35 # 36 #
+query_vertical show slave status;
+start slave;
+insert into t1 values (1);
+save_master_pos;
+sync_with_master;
+select * from t1; # check that indeed 2 were inserted
+# We stop the slave before cleaning up otherwise we'll get
+# 'drop table t1' executed twice, so an error in the slave.err
+# (not critical).
+stop slave;
+drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/suite/rpl/t/rpl_session_var.test b/mysql-test/suite/rpl/t/rpl_session_var.test
new file mode 100644
index 00000000000..2491611e23d
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_session_var.test
@@ -0,0 +1,64 @@
+# Replication of session variables.
+# FOREIGN_KEY_CHECKS is tested in rpl_insert_id.test
+
+source include/master-slave.inc;
+drop table if exists t1;
+create table t1(a varchar(100),b int);
+set @@session.sql_mode=pipes_as_concat;
+insert into t1 values('My'||'SQL', 1);
+set @@session.sql_mode=default;
+insert into t1 values('1'||'2', 2);
+select * from t1 where b<3 order by a;
+save_master_pos;
+connection slave;
+sync_with_master;
+select * from t1 where b<3 order by a;
+connection master;
+# if the slave does the next sync_with_master fine, then it means it accepts the
+# two lines of ANSI syntax below, which is what we want to check.
+set @@session.sql_mode=ignore_space;
+insert into t1 values(password ('MySQL'), 3);
+set @@session.sql_mode=ansi_quotes;
+create table "t2" ("a" int);
+drop table t1, t2;
+set @@session.sql_mode=default;
+create table t1(a int auto_increment primary key);
+create table t2(b int, a int);
+set @@session.sql_auto_is_null=1;
+insert into t1 values(null);
+insert into t2 select 1,a from t1 where a is null;
+set @@session.sql_auto_is_null=0;
+insert into t1 values(null);
+insert into t2 select 2,a from t1 where a is null;
+select * from t2 order by b;
+save_master_pos;
+connection slave;
+sync_with_master;
+select * from t2 order by b;
+connection master;
+drop table t1,t2;
+save_master_pos;
+connection slave;
+sync_with_master;
+
+#
+# Bug #29878 Garbage data generation when executing SESSION_USER() on a slave.
+#
+
+connection master;
+CREATE TABLE t1 (
+ `id` int(11) NOT NULL auto_increment,
+ `data` varchar(100),
+ PRIMARY KEY (`id`)
+ ) ENGINE=MyISAM;
+
+INSERT INTO t1(data) VALUES(SESSION_USER());
+save_master_pos;
+connection slave;
+sync_with_master;
+SELECT length(data) < 100 FROM t1;
+connection master;
+drop table t1;
+save_master_pos;
+connection slave;
+sync_with_master;
diff --git a/mysql-test/t/rpl_set_charset.test b/mysql-test/suite/rpl/t/rpl_set_charset.test
index c70eb2681f5..c70eb2681f5 100644
--- a/mysql-test/t/rpl_set_charset.test
+++ b/mysql-test/suite/rpl/t/rpl_set_charset.test
diff --git a/mysql-test/suite/rpl/t/rpl_sf.test b/mysql-test/suite/rpl/t/rpl_sf.test
new file mode 100644
index 00000000000..ecf91a723fa
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_sf.test
@@ -0,0 +1,70 @@
+-- source include/have_log_bin.inc
+
+# Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
+
+# save status
+
+let $oblf=`select @@SESSION.BINLOG_FORMAT`;
+let $otfc=`select @@log_bin_trust_function_creators`;
+
+set global log_bin_trust_function_creators=0;
+
+
+
+# fail *on definition*
+
+set binlog_format=STATEMENT;
+
+delimiter |;
+--error ER_BINLOG_UNSAFE_ROUTINE
+create function fn16456()
+ returns int
+begin
+ return unix_timestamp();
+end|
+delimiter ;|
+
+
+
+# force in definition, so we can see whether we fail on call
+
+set global log_bin_trust_function_creators=1;
+
+delimiter |;
+create function fn16456()
+ returns int
+begin
+ return unix_timestamp();
+end|
+delimiter ;|
+
+set global log_bin_trust_function_creators=0;
+
+
+
+# allow funcall in RBR
+
+set binlog_format=ROW;
+
+--replace_column 1 timestamp
+select fn16456();
+
+
+
+# fail funcall in SBR
+
+set binlog_format=STATEMENT;
+
+--error ER_BINLOG_ROW_RBR_TO_SBR
+select fn16456();
+
+
+
+# restore status
+
+drop function fn16456;
+
+--disable_query_log
+eval set binlog_format=$oblf;
+eval set global log_bin_trust_function_creators=$otfc;
+--enable_query_log
diff --git a/mysql-test/suite/rpl/t/rpl_skip_error-slave.opt b/mysql-test/suite/rpl/t/rpl_skip_error-slave.opt
new file mode 100644
index 00000000000..c84171976a1
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_skip_error-slave.opt
@@ -0,0 +1 @@
+--slave-skip-error=1062,1582
diff --git a/mysql-test/suite/rpl/t/rpl_skip_error.test b/mysql-test/suite/rpl/t/rpl_skip_error.test
new file mode 100644
index 00000000000..b68b637b3b0
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_skip_error.test
@@ -0,0 +1,51 @@
+##########################################
+# 2006-02-07 By JBM: Added order by
+#########################################
+# Note that errors are ignored by opt file.
+source include/master-slave.inc;
+
+create table t1 (n int not null primary key);
+save_master_pos;
+connection slave;
+sync_with_master;
+insert into t1 values (1);
+connection master;
+# Here we expect (ignored) error, since 1 is already in slave table
+insert into t1 values (1);
+
+# These should work fine
+insert into t1 values (2),(3);
+
+save_master_pos;
+connection slave;
+sync_with_master;
+select * from t1 ORDER BY n;
+
+# Cleanup
+connection master;
+drop table t1;
+sync_slave_with_master;
+
+# End of 4.1 tests
+
+#
+# #28839 Errors in strict mode silently stop SQL thread if --slave-skip-errors exists
+#
+connection master;
+create table t1(a int primary key);
+insert into t1 values (1),(2);
+delete from t1 where @@server_id=1;
+set sql_mode=strict_trans_tables;
+select @@server_id;
+insert into t1 values (1),(2),(3);
+sync_slave_with_master;
+connection slave;
+select @@server_id;
+select * from t1;
+--replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_result $MASTER_MYPORT MASTER_PORT
+show slave status;
+connection master;
+drop table t1;
+sync_with_master;
+# End of 5.0 tests
diff --git a/mysql-test/suite/rpl/t/rpl_slave_skip.test b/mysql-test/suite/rpl/t/rpl_slave_skip.test
new file mode 100644
index 00000000000..b19d6a2730b
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_slave_skip.test
@@ -0,0 +1,71 @@
+source include/master-slave.inc;
+
+--echo **** On Slave ****
+connection slave;
+STOP SLAVE;
+
+--echo **** On Master ****
+connection master;
+SET SESSION BINLOG_FORMAT=ROW;
+
+CREATE TABLE t1 (a INT, b INT);
+CREATE TABLE t2 (c INT, d INT);
+INSERT INTO t1 VALUES (1,1),(2,4),(3,9);
+INSERT INTO t2 VALUES (1,1),(2,8),(3,27);
+UPDATE t1,t2 SET b = d, d = b * 2 WHERE a = c;
+source include/show_binlog_events.inc;
+
+# These tables should be changed
+SELECT * FROM t1;
+SELECT * FROM t2;
+save_master_pos;
+
+--echo **** On Slave ****
+connection slave;
+
+# Stop when reaching the the first table map event.
+START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=484;
+wait_for_slave_to_stop;
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 8 # 9 # 23 # 33 # 35 # 36 #
+query_vertical SHOW SLAVE STATUS;
+
+# Now we skip *one* table map event. If the execution starts right
+# after that table map event, *one* of the involved tables will be
+# changed.
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
+START SLAVE;
+sync_with_master;
+
+# These values should be what was inserted, not what was
+# updated. Since we are skipping the first table map of the group
+# representing the UPDATE statement above, we should skip the entire
+# group and not start executing at the first table map.
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+STOP SLAVE;
+RESET SLAVE;
+connection master;
+RESET MASTER;
+
+SET SESSION BINLOG_FORMAT=STATEMENT;
+SET @foo = 12;
+INSERT INTO t1 VALUES(@foo, 2*@foo);
+save_master_pos;
+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;
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
+START SLAVE;
+sync_with_master;
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 8 # 9 # 23 # 33 # 35 # 36 #
+query_vertical SHOW SLAVE STATUS;
+
+--echo **** On Master ****
+connection master;
+DROP TABLE t1, t2;
+sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/t/rpl_slave_status.test b/mysql-test/suite/rpl/t/rpl_slave_status.test
new file mode 100644
index 00000000000..d07cf13dcf4
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_slave_status.test
@@ -0,0 +1,58 @@
+--source include/master-slave.inc
+
+############################################################################
+# Test case for BUG#10780
+#
+# REQUIREMENT
+# A slave without replication privileges should have Slave_IO_Running = No
+
+# 1. Create new replication user
+connection master;
+grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl';
+
+connection slave;
+stop slave;
+change master to master_user='rpl',master_password='rpl';
+start slave;
+
+# 2. Do replication as new user
+connection master;
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (n int);
+insert into t1 values (1);
+save_master_pos;
+connection slave;
+sync_with_master;
+select * from t1;
+
+# 3. Delete new replication user
+connection master;
+delete from mysql.user where user='rpl';
+flush privileges;
+connection slave;
+
+# 4. Restart slave without privileges
+# (slave.err will contain access denied error for this START SLAVE command)
+stop slave;
+start slave;
+
+# 5. Make sure Slave_IO_Running = No
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+# Column 1 is replaced, since the output can be either
+# "Connecting to master" or "Waiting for master update"
+--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 35 # 36 #
+--vertical_results
+show slave status;
+
+# Cleanup (Note that slave IO thread is not running)
+connection slave;
+drop table t1;
+delete from mysql.user where user='rpl';
+connection master;
+drop table t1;
+
+# end of test case for BUG#10780
+
+# end of 4.1 tests
diff --git a/mysql-test/t/rpl_sp-master.opt b/mysql-test/suite/rpl/t/rpl_sp-master.opt
index 709a224fd92..709a224fd92 100644
--- a/mysql-test/t/rpl_sp-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_sp-master.opt
diff --git a/mysql-test/t/rpl_sp-slave.opt b/mysql-test/suite/rpl/t/rpl_sp-slave.opt
index 709a224fd92..709a224fd92 100644
--- a/mysql-test/t/rpl_sp-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_sp-slave.opt
diff --git a/mysql-test/suite/rpl/t/rpl_sp.test b/mysql-test/suite/rpl/t/rpl_sp.test
new file mode 100644
index 00000000000..f363b64558a
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_sp.test
@@ -0,0 +1,585 @@
+# row-based and statement have expected binlog difference in result files
+
+# Test of replication of stored procedures (WL#2146 for MySQL 5.0)
+# Modified by WL#2971.
+
+# Note that in the .opt files we still use the old variable name
+# log-bin-trust-routine-creators so that this test checks that it's
+# still accepted (this test also checks that the new name is
+# accepted). The old name could be removed in 5.1 or 6.0.
+
+source include/have_binlog_format_mixed.inc;
+source include/master-slave.inc;
+
+# we need a db != test, where we don't have automatic grants
+--disable_warnings
+drop database if exists mysqltest1;
+--enable_warnings
+create database mysqltest1;
+use mysqltest1;
+create table t1 (a varchar(100));
+sync_slave_with_master;
+use mysqltest1;
+
+# ********************** PART 1 : STORED PROCEDURES ***************
+
+# Does the same proc as on master get inserted into mysql.proc ?
+# (same definer, same properties...)
+
+connection master;
+
+delimiter |;
+
+# Stored procedures don't have the limitations that functions have
+# regarding binlogging: it's ok to create a procedure as not
+# deterministic and updating data, while it's not ok to create such a
+# function. We test this.
+
+create procedure foo()
+begin
+ declare b int;
+ set b = 8;
+ insert into t1 values (b);
+ insert into t1 values (unix_timestamp());
+end|
+delimiter ;|
+
+# we replace columns having times
+# (even with fixed timestamp displayed time may changed based on TZ)
+--replace_result localhost.localdomain localhost 127.0.0.1 localhost
+--replace_column 13 # 14 #
+select * from mysql.proc where name='foo' and db='mysqltest1';
+sync_slave_with_master;
+# You will notice in the result that the definer does not match what
+# it is on master, it is a known bug on which Alik is working
+--replace_result localhost.localdomain localhost 127.0.0.1 localhost
+--replace_column 13 # 14 #
+select * from mysql.proc where name='foo' and db='mysqltest1';
+
+connection master;
+# see if timestamp used in SP on slave is same as on master
+set timestamp=1000000000;
+call foo();
+select * from t1;
+sync_slave_with_master;
+select * from t1;
+
+# Now a SP which is not updating tables
+
+connection master;
+delete from t1;
+create procedure foo2()
+ select * from mysqltest1.t1;
+call foo2();
+
+# check that this is allowed (it's not for functions):
+alter procedure foo2 contains sql;
+
+# SP with definer's right
+
+drop table t1;
+create table t1 (a int);
+create table t2 like t1;
+
+create procedure foo3()
+ deterministic
+ insert into t1 values (15);
+
+# let's create a non-privileged user
+grant CREATE ROUTINE, EXECUTE on mysqltest1.* to "zedjzlcsjhd"@127.0.0.1;
+grant SELECT on mysqltest1.t1 to "zedjzlcsjhd"@127.0.0.1;
+grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1;
+
+# ToDo: BUG#14931: There is a race between the last grant binlogging, and
+# the binlogging in the new connection made below, causing sporadic test
+# failures due to switched statement order in binlog. To fix this we do
+# SELECT 1 in the first connection before starting the second, ensuring
+# that binlogging is done in the expected order.
+# Please remove this SELECT 1 when BUG#14931 is fixed.
+SELECT 1;
+
+connect (con1,127.0.0.1,zedjzlcsjhd,,mysqltest1,$MASTER_MYPORT,);
+connection con1;
+
+# this routine will fail in the second INSERT because of privileges
+delimiter |;
+create procedure foo4()
+ deterministic
+ begin
+ insert into t2 values(3);
+ insert into t1 values (5);
+ end|
+
+delimiter ;|
+
+# I add ,0 so that it does not print the error in the test output,
+# because this error is hostname-dependent
+--error 1142,0
+call foo4(); # invoker has no INSERT grant on table t1 => failure
+
+connection master;
+call foo3(); # success (definer == root)
+show warnings;
+
+--error 1142,0
+call foo4(); # definer's rights => failure
+
+# we test replication of ALTER PROCEDURE
+alter procedure foo4 sql security invoker;
+call foo4(); # invoker's rights => success
+show warnings;
+
+# Note that half-failed procedure calls are ok with binlogging;
+# if we compare t2 on master and slave we see they are identical:
+
+select * from t1;
+select * from t2;
+sync_slave_with_master;
+select * from t1;
+select * from t2;
+
+# Let's check another failing-in-the-middle procedure
+connection master;
+delete from t2;
+alter table t2 add unique (a);
+
+drop procedure foo4;
+delimiter |;
+create procedure foo4()
+ deterministic
+ begin
+ insert into t2 values(20),(20);
+ end|
+
+delimiter ;|
+
+--error ER_DUP_ENTRY
+call foo4();
+show warnings;
+
+select * from t2;
+sync_slave_with_master;
+# check that this failed-in-the-middle replicated right:
+select * from t2;
+
+# Test of DROP PROCEDURE
+
+--replace_result localhost.localdomain localhost 127.0.0.1 localhost
+--replace_column 13 # 14 #
+select * from mysql.proc where name="foo4" and db='mysqltest1';
+connection master;
+drop procedure foo4;
+select * from mysql.proc where name="foo4" and db='mysqltest1';
+sync_slave_with_master;
+select * from mysql.proc where name="foo4" and db='mysqltest1';
+
+# ********************** PART 2 : FUNCTIONS ***************
+
+connection master;
+drop procedure foo;
+drop procedure foo2;
+drop procedure foo3;
+
+delimiter |;
+# check that needs "deterministic"
+--error 1418
+create function fn1(x int)
+ returns int
+begin
+ insert into t1 values (x);
+ return x+2;
+end|
+create function fn1(x int)
+ returns int
+ deterministic
+begin
+ insert into t1 values (x);
+ return x+2;
+end|
+
+delimiter ;|
+delete t1,t2 from t1,t2;
+select fn1(20);
+insert into t2 values(fn1(21));
+select * from t1;
+select * from t2;
+sync_slave_with_master;
+select * from t1;
+select * from t2;
+
+connection master;
+delimiter |;
+
+drop function fn1;
+
+create function fn1()
+ returns int
+ no sql
+begin
+ return unix_timestamp();
+end|
+
+delimiter ;|
+# check that needs "deterministic"
+--error 1418
+alter function fn1 contains sql;
+
+delete from t1;
+set timestamp=1000000000;
+insert into t1 values(fn1());
+
+connection con1;
+
+delimiter |;
+--error 1419 # only full-global-privs user can create a function
+create function fn2()
+ returns int
+ no sql
+begin
+ return unix_timestamp();
+end|
+delimiter ;|
+connection master;
+# test old variable name:
+set global log_bin_trust_routine_creators=1;
+# now use new name:
+set global log_bin_trust_function_creators=0;
+set global log_bin_trust_function_creators=1;
+# slave needs it too otherwise will not execute what master allowed:
+connection slave;
+set global log_bin_trust_function_creators=1;
+
+connection con1;
+
+delimiter |;
+create function fn2()
+ returns int
+ no sql
+begin
+ return unix_timestamp();
+end|
+delimiter ;|
+
+connection master;
+
+# Now a function which is supposed to not update tables
+# as it's "reads sql data", so should not give error even if
+# non-deterministic.
+
+delimiter |;
+create function fn3()
+ returns int
+ not deterministic
+ reads sql data
+begin
+ return 0;
+end|
+delimiter ;|
+
+select fn3();
+--replace_result localhost.localdomain localhost 127.0.0.1 localhost
+--replace_column 13 # 14 #
+select * from mysql.proc where db='mysqltest1';
+select * from t1;
+
+sync_slave_with_master;
+use mysqltest1;
+select * from t1;
+--replace_result localhost.localdomain localhost 127.0.0.1 localhost
+--replace_column 13 # 14 #
+select * from mysql.proc where db='mysqltest1';
+
+# Let's check a failing-in-the-middle function
+connection master;
+delete from t2;
+alter table t2 add unique (a);
+
+drop function fn1;
+
+delimiter |;
+create function fn1(x int)
+ returns int
+begin
+ insert into t2 values(x),(x);
+ return 10;
+end|
+
+delimiter ;|
+
+do fn1(100);
+
+--error ER_DUP_ENTRY
+select fn1(20);
+
+select * from t2;
+sync_slave_with_master;
+
+# check that this failed-in-the-middle replicated right:
+select * from t2;
+
+# ********************** PART 3 : TRIGGERS ***************
+
+connection con1;
+# now fails due to missing trigger grant (err 1142 i/o 1227) due to new
+# check in sql_trigger.cc (v1.44) by anozdrin on 2006/02/01 --azundris
+--error ER_TABLEACCESS_DENIED_ERROR
+create trigger trg before insert on t1 for each row set new.a= 10;
+
+connection master;
+delete from t1;
+# TODO: when triggers can contain an update, test that this update
+# does not go into binlog.
+# I'm not setting user vars in the trigger, because replication of user vars
+# would take care of propagating the user var's value to slave, so even if
+# the trigger was not executed on slave it would not be discovered.
+create trigger trg before insert on t1 for each row set new.a= 10;
+insert into t1 values (1);
+select * from t1;
+sync_slave_with_master;
+select * from t1;
+
+connection master;
+delete from t1;
+drop trigger trg;
+insert into t1 values (1);
+select * from t1;
+sync_slave_with_master;
+select * from t1;
+
+
+# ********************** PART 4 : RELATED FIXED BUGS ***************
+
+
+#
+# Test for bug #13969 "Routines which are replicated from master can't be
+# executed on slave".
+#
+connection master;
+create procedure foo()
+ not deterministic
+ reads sql data
+ select * from t1;
+sync_slave_with_master;
+# This should not fail
+call foo();
+connection master;
+drop procedure foo;
+sync_slave_with_master;
+
+
+# Clean up
+connection master;
+drop function fn1;
+drop database mysqltest1;
+drop user "zedjzlcsjhd"@127.0.0.1;
+use test;
+sync_slave_with_master;
+use test;
+
+#
+# Bug#14077 "Failure to replicate a stored function with a cursor":
+# verify that stored routines with cursors work on slave.
+#
+connection master;
+--disable_warnings
+drop function if exists f1;
+--enable_warnings
+delimiter |;
+create function f1() returns int reads sql data
+begin
+ declare var integer;
+ declare c cursor for select a from v1;
+ open c;
+ fetch c into var;
+ close c;
+ return var;
+end|
+delimiter ;|
+create view v1 as select 1 as a;
+create table t1 (a int);
+insert into t1 (a) values (f1());
+select * from t1;
+drop view v1;
+drop function f1;
+sync_slave_with_master;
+connection slave;
+select * from t1;
+
+#
+# Bug#16621 "INSERTs in Stored Procedures causes data corruption in the Binary
+# Log for 5.0.18"
+#
+
+# Prepare environment.
+
+connection master;
+
+--disable_warnings
+DROP PROCEDURE IF EXISTS p1;
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# Test case.
+
+CREATE TABLE t1(col VARCHAR(10));
+
+CREATE PROCEDURE p1(arg VARCHAR(10))
+ INSERT INTO t1 VALUES(arg);
+
+CALL p1('test');
+
+SELECT * FROM t1;
+
+sync_slave_with_master;
+SELECT * FROM t1;
+
+# Cleanup
+connection master;
+DROP PROCEDURE p1;
+
+
+#
+# BUG#20438: CREATE statements for views, stored routines and triggers can be
+# not replicable.
+#
+
+--echo
+--echo ---> Test for BUG#20438
+
+# Prepare environment.
+
+--echo
+--echo ---> Preparing environment...
+--echo ---> connection: master
+--connection master
+
+--disable_warnings
+DROP PROCEDURE IF EXISTS p1;
+DROP FUNCTION IF EXISTS f1;
+--enable_warnings
+
+--echo
+--echo ---> Synchronizing slave with master...
+
+--save_master_pos
+--connection slave
+--sync_with_master
+
+--echo
+--echo ---> connection: master
+--connection master
+
+# Test.
+
+--echo
+--echo ---> Creating procedure...
+
+/*!50003 CREATE PROCEDURE p1() SET @a = 1 */;
+
+/*!50003 CREATE FUNCTION f1() RETURNS INT RETURN 0 */;
+
+--echo
+--echo ---> Checking on master...
+
+SHOW CREATE PROCEDURE p1;
+SHOW CREATE FUNCTION f1;
+
+--echo
+--echo ---> Synchronizing slave with master...
+
+--save_master_pos
+--connection slave
+--sync_with_master
+
+--echo ---> connection: master
+
+--echo
+--echo ---> Checking on slave...
+
+SHOW CREATE PROCEDURE p1;
+SHOW CREATE FUNCTION f1;
+
+# Cleanup.
+
+--echo
+--echo ---> connection: master
+--connection master
+
+--echo
+--echo ---> Cleaning up...
+
+DROP PROCEDURE p1;
+DROP FUNCTION f1;
+
+--save_master_pos
+--connection slave
+--sync_with_master
+--connection master
+
+
+# cleanup
+connection master;
+drop table t1;
+sync_slave_with_master;
+
+#
+# Bug22043: MySQL don't add "USE <DATABASE>" before "DROP PROCEDURE IF EXISTS"
+#
+
+connection master;
+--disable_warnings
+drop database if exists mysqltest;
+drop database if exists mysqltest2;
+--enable_warnings
+create database mysqltest;
+create database mysqltest2;
+use mysqltest2;
+create table t ( t integer );
+create procedure mysqltest.test() begin end;
+insert into t values ( 1 );
+--error ER_BAD_DB_ERROR
+create procedure `\\`.test() begin end;
+
+#
+# BUG#19725: Calls to stored function in other database are not
+# replicated correctly in some cases
+#
+
+connection master;
+delimiter |;
+create function f1 () returns int
+begin
+ insert into t values (1);
+ return 0;
+end|
+delimiter ;|
+sync_slave_with_master;
+# Let us test if we don't forget to binlog the function's database
+connection master;
+use mysqltest;
+set @a:= mysqltest2.f1();
+sync_slave_with_master;
+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;
+
+
+# Restore log_bin_trust_function_creators to its original value.
+# This is a cleanup for all parts above where we tested stored
+# functions and triggers.
+set global log_bin_trust_function_creators=0;
+connection master;
+set global log_bin_trust_function_creators=0;
+
+# Clean up
+drop database mysqltest;
+drop database mysqltest2;
+
+--echo End of 5.0 tests
+--echo End of 5.1 tests
+
diff --git a/mysql-test/t/rpl_sp004.test b/mysql-test/suite/rpl/t/rpl_sp004.test
index 967e7007c15..967e7007c15 100644
--- a/mysql-test/t/rpl_sp004.test
+++ b/mysql-test/suite/rpl/t/rpl_sp004.test
diff --git a/mysql-test/t/rpl_sp_effects-master.opt b/mysql-test/suite/rpl/t/rpl_sp_effects-master.opt
index 61dd7a6ad0e..61dd7a6ad0e 100644
--- a/mysql-test/t/rpl_sp_effects-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_sp_effects-master.opt
diff --git a/mysql-test/t/rpl_sp_effects-slave.opt b/mysql-test/suite/rpl/t/rpl_sp_effects-slave.opt
index 61dd7a6ad0e..61dd7a6ad0e 100644
--- a/mysql-test/t/rpl_sp_effects-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_sp_effects-slave.opt
diff --git a/mysql-test/t/rpl_sp_effects.test b/mysql-test/suite/rpl/t/rpl_sp_effects.test
index 027bfd69f36..027bfd69f36 100644
--- a/mysql-test/t/rpl_sp_effects.test
+++ b/mysql-test/suite/rpl/t/rpl_sp_effects.test
diff --git a/mysql-test/t/rpl_sporadic_master-master.opt b/mysql-test/suite/rpl/t/rpl_sporadic_master-master.opt
index 6d5b66bed61..6d5b66bed61 100644
--- a/mysql-test/t/rpl_sporadic_master-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_sporadic_master-master.opt
diff --git a/mysql-test/t/rpl_sporadic_master.test b/mysql-test/suite/rpl/t/rpl_sporadic_master.test
index 824f7abc9f5..824f7abc9f5 100644
--- a/mysql-test/t/rpl_sporadic_master.test
+++ b/mysql-test/suite/rpl/t/rpl_sporadic_master.test
diff --git a/mysql-test/suite/rpl/t/rpl_ssl.test b/mysql-test/suite/rpl/t/rpl_ssl.test
new file mode 100644
index 00000000000..c1b7bc2097b
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_ssl.test
@@ -0,0 +1,86 @@
+source include/have_ssl.inc;
+source include/master-slave.inc;
+
+# create a user for replication that requires ssl encryption
+connection master;
+grant replication slave on *.* to replssl@localhost require ssl;
+create table t1 (t int auto_increment, KEY(t));
+
+sync_slave_with_master;
+
+# Set slave to use SSL for connection to master
+stop slave;
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+eval change master to
+ master_user='replssl',
+ master_password='',
+ 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';
+start slave;
+
+# Switch to master and insert one record, then sync it to slave
+connection master;
+insert into t1 values(1);
+sync_slave_with_master;
+
+# The record should now be on slave
+select * from t1;
+
+# The slave is synced and waiting/reading from master
+# SHOW SLAVE STATUS will show "Waiting for master to send event"
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
+--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
+query_vertical show slave status;
+
+# Stop the slave, as reported in bug#21871 it would hang
+STOP SLAVE;
+
+select * from t1;
+
+# Do the same thing a number of times
+disable_query_log;
+disable_result_log;
+let $i= 100;
+while ($i)
+{
+ start slave;
+ connection master;
+ insert into t1 values (NULL);
+ select * from t1; # Some variance
+ connection slave;
+ select * from t1; # Some variance
+ stop slave;
+ dec $i;
+}
+start slave;
+enable_query_log;
+enable_result_log;
+connection master;
+# INSERT one more record to make sure
+# the sync has something to do
+insert into t1 values (NULL);
+let $master_count= `select count(*) from t1`;
+
+sync_slave_with_master;
+--source include/wait_for_slave_to_start.inc
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
+--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
+query_vertical show slave status;
+
+let $slave_count= `select count(*) from t1`;
+
+if (`select $slave_count != $master_count`)
+{
+ echo master and slave differed in number of rows;
+ echo master: $master_count;
+ echo slave: $slave_count;
+}
+
+connection master;
+drop user replssl@localhost;
+drop table t1;
+sync_slave_with_master;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/suite/rpl/t/rpl_ssl1.test b/mysql-test/suite/rpl/t/rpl_ssl1.test
new file mode 100644
index 00000000000..b660c3991dd
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_ssl1.test
@@ -0,0 +1,97 @@
+source include/have_ssl.inc;
+source include/master-slave.inc;
+
+# We don't test all types of ssl auth params here since it's a bit hard
+# until problems with OpenSSL 0.9.7 are unresolved
+
+# creating replication user for whom ssl auth is required
+# preparing playground
+connection master;
+grant replication slave on *.* to replssl@localhost require ssl;
+create table t1 (t int);
+save_master_pos;
+
+#syncing with master
+connection slave;
+sync_with_master;
+
+#trying to use this user without ssl
+stop slave;
+change master to master_user='replssl',master_password='';
+start slave;
+
+#showing that replication don't work
+connection master;
+insert into t1 values (1);
+#reasonable timeout for changes to propagate to slave
+sleep 3;
+connection slave;
+select * from t1;
+
+#showing that replication could work with ssl params
+stop slave;
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+eval change master to 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';
+start slave;
+
+#avoiding unneeded sleeps
+connection master;
+save_master_pos;
+connection slave;
+sync_with_master;
+
+#checking that replication is ok
+select * from t1;
+
+#checking show slave status
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
+--replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # 35 # 36 #
+query_vertical show slave status;
+
+#checking if replication works without ssl also performing clean up
+stop slave;
+change master to master_user='root',master_password='', master_ssl=0;
+start slave;
+connection master;
+drop user replssl@localhost;
+drop table t1;
+save_master_pos;
+connection slave;
+sync_with_master;
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
+--replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # 35 # 36 #
+query_vertical show slave status;
+
+# End of 4.1 tests
+
+# Start replication with ssl_verify_server_cert turned on
+connection slave;
+stop slave;
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+eval change master to
+ master_host="localhost",
+ 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',
+ master_ssl_verify_server_cert=1;
+start slave;
+
+connection master;
+create table t1 (t int);
+insert into t1 values (1);
+
+sync_slave_with_master;
+
+echo on slave;
+#checking that replication is ok
+select * from t1;
+
+#checking show slave status
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
+--replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # 35 # 36 #
+query_vertical show slave status;
+
+connection master;
+drop table t1;
+sync_slave_with_master;
diff --git a/mysql-test/t/rpl_start_stop_slave.test b/mysql-test/suite/rpl/t/rpl_start_stop_slave.test
index 19988cf902a..19988cf902a 100644
--- a/mysql-test/t/rpl_start_stop_slave.test
+++ b/mysql-test/suite/rpl/t/rpl_start_stop_slave.test
diff --git a/mysql-test/suite/rpl/t/rpl_stm_000001-slave.opt b/mysql-test/suite/rpl/t/rpl_stm_000001-slave.opt
new file mode 100644
index 00000000000..48457b17309
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_stm_000001-slave.opt
@@ -0,0 +1 @@
+--loose-innodb
diff --git a/mysql-test/t/rpl_stm_000001.test b/mysql-test/suite/rpl/t/rpl_stm_000001.test
index aee067b2d4a..aee067b2d4a 100644
--- a/mysql-test/t/rpl_stm_000001.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_000001.test
diff --git a/mysql-test/t/rpl_stm_EE_err2.test b/mysql-test/suite/rpl/t/rpl_stm_EE_err2.test
index face651b9a1..face651b9a1 100644
--- a/mysql-test/t/rpl_stm_EE_err2.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_EE_err2.test
diff --git a/mysql-test/t/rpl_stm_charset.test b/mysql-test/suite/rpl/t/rpl_stm_charset.test
index b103a47d78c..b103a47d78c 100644
--- a/mysql-test/t/rpl_stm_charset.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_charset.test
diff --git a/mysql-test/suite/rpl/t/rpl_stm_extraColmaster_ndb.test b/mysql-test/suite/rpl/t/rpl_stm_extraColmaster_ndb.test
new file mode 100644
index 00000000000..84734204439
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_stm_extraColmaster_ndb.test
@@ -0,0 +1,13 @@
+###########################################
+# Purpose: Wrapper for rpl_extraMaster_Col.test
+# Using NDB
+###########################################
+-- source include/have_ndb.inc
+-- source include/ndb_master-slave.inc
+-- source include/have_binlog_format_statement.inc
+
+let $engine_type = 'NDB';
+
+-- source extra/rpl_tests/rpl_extraMaster_Col.test
+
+
diff --git a/mysql-test/t/rpl_stm_flsh_tbls.test b/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test
index a8a33d05e8b..a8a33d05e8b 100644
--- a/mysql-test/t/rpl_stm_flsh_tbls.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test
diff --git a/mysql-test/t/rpl_stm_insert_delayed.test b/mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test
index d55e3a4da2c..d55e3a4da2c 100644
--- a/mysql-test/t/rpl_stm_insert_delayed.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test
diff --git a/mysql-test/t/rpl_stm_log-master.opt b/mysql-test/suite/rpl/t/rpl_stm_log-master.opt
index cef79bc8585..cef79bc8585 100644
--- a/mysql-test/t/rpl_stm_log-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_stm_log-master.opt
diff --git a/mysql-test/t/rpl_stm_log-slave.opt b/mysql-test/suite/rpl/t/rpl_stm_log-slave.opt
index 8b137891791..8b137891791 100644
--- a/mysql-test/t/rpl_stm_log-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_stm_log-slave.opt
diff --git a/mysql-test/suite/rpl/t/rpl_stm_log.test b/mysql-test/suite/rpl/t/rpl_stm_log.test
new file mode 100644
index 00000000000..2af9d7f85bc
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_stm_log.test
@@ -0,0 +1,9 @@
+# Requires statement logging
+-- source include/have_binlog_format_mixed_or_statement.inc
+-- source include/master-slave.inc
+let $engine_type=MyISAM;
+-- source extra/rpl_tests/rpl_log.test
+
+
+# End of 4.1 tests
+# Adding comment for force manual merge 5.0 -> wl1012: Delete me
diff --git a/mysql-test/t/rpl_stm_max_relay_size.test b/mysql-test/suite/rpl/t/rpl_stm_max_relay_size.test
index 950aa8b322a..950aa8b322a 100644
--- a/mysql-test/t/rpl_stm_max_relay_size.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_max_relay_size.test
diff --git a/mysql-test/t/rpl_stm_multi_query.test b/mysql-test/suite/rpl/t/rpl_stm_multi_query.test
index c39d1fad015..c39d1fad015 100644
--- a/mysql-test/t/rpl_stm_multi_query.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_multi_query.test
diff --git a/mysql-test/t/rpl_stm_mystery22.test b/mysql-test/suite/rpl/t/rpl_stm_mystery22.test
index 017593fdfba..017593fdfba 100644
--- a/mysql-test/t/rpl_stm_mystery22.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_mystery22.test
diff --git a/mysql-test/t/rpl_stm_no_op.test b/mysql-test/suite/rpl/t/rpl_stm_no_op.test
index 66dc89bd712..66dc89bd712 100644
--- a/mysql-test/t/rpl_stm_no_op.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_no_op.test
diff --git a/mysql-test/t/rpl_stm_reset_slave.test b/mysql-test/suite/rpl/t/rpl_stm_reset_slave.test
index 6a99d4e1613..6a99d4e1613 100644
--- a/mysql-test/t/rpl_stm_reset_slave.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_reset_slave.test
diff --git a/mysql-test/suite/rpl/t/rpl_stm_until.test b/mysql-test/suite/rpl/t/rpl_stm_until.test
new file mode 100644
index 00000000000..98e7e0e5eac
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_stm_until.test
@@ -0,0 +1,77 @@
+-- source include/have_binlog_format_mixed_or_statement.inc
+-- source include/master-slave.inc
+
+# Test is dependent on binlog positions
+
+# prepare version for substitutions
+let $VERSION=`select version()`;
+
+# stop slave before he will start replication also sync with master
+# for avoiding undetermenistic behaviour
+save_master_pos;
+connection slave;
+sync_with_master;
+stop slave;
+
+connection master;
+# create some events on master
+create table t1(n int not null auto_increment primary key);
+insert into t1 values (1),(2),(3),(4);
+drop table t1;
+create table t2(n int not null auto_increment primary key);
+insert into t2 values (1),(2);
+insert into t2 values (3),(4);
+drop table t2;
+
+# try to replicate all queries until drop of t1
+connection slave;
+start slave until master_log_file='master-bin.000001', master_log_pos=323;
+--source include/wait_for_slave_sql_to_stop.inc
+# here table should be still not deleted
+select * from t1;
+source include/show_slave_status.inc;
+
+# this should fail right after start
+start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
+--source include/wait_for_slave_sql_to_stop.inc
+# again this table should be still not deleted
+select * from t1;
+source include/show_slave_status.inc;
+
+# try replicate all up to and not including the second insert to t2;
+start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746;
+--source include/wait_for_slave_sql_to_stop.inc
+select * from t2;
+source include/show_slave_status.inc;
+
+# clean up
+start slave;
+connection master;
+save_master_pos;
+connection slave;
+sync_with_master;
+stop slave;
+
+# this should stop immediately as we are already there
+start slave until master_log_file='master-bin.000001', master_log_pos=776;
+--source include/wait_for_slave_sql_to_stop.inc
+# here the sql slave thread should be stopped
+--replace_result bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004
+source include/show_slave_status.inc;
+
+#testing various error conditions
+--error 1277
+start slave until master_log_file='master-bin', master_log_pos=561;
+--error 1277
+start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
+--error 1277
+start slave until master_log_file='master-bin.000001';
+--error 1277
+start slave until relay_log_file='slave-relay-bin.000002';
+--error 1277
+start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
+# Warning should be given for second command
+start slave sql_thread;
+start slave until master_log_file='master-bin.000001', master_log_pos=776;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_switch_stm_row_mixed.test b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test
index b0012827db8..b0012827db8 100644
--- a/mysql-test/t/rpl_switch_stm_row_mixed.test
+++ b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test
diff --git a/mysql-test/t/rpl_temp_table.test b/mysql-test/suite/rpl/t/rpl_temp_table.test
index 9b73961aeea..9b73961aeea 100644
--- a/mysql-test/t/rpl_temp_table.test
+++ b/mysql-test/suite/rpl/t/rpl_temp_table.test
diff --git a/mysql-test/t/rpl_temporary.test b/mysql-test/suite/rpl/t/rpl_temporary.test
index 09b8b83f25f..09b8b83f25f 100644
--- a/mysql-test/t/rpl_temporary.test
+++ b/mysql-test/suite/rpl/t/rpl_temporary.test
diff --git a/mysql-test/t/rpl_timezone-master.opt b/mysql-test/suite/rpl/t/rpl_timezone-master.opt
index 8e43bfbbb7e..8e43bfbbb7e 100644
--- a/mysql-test/t/rpl_timezone-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_timezone-master.opt
diff --git a/mysql-test/t/rpl_timezone-slave.opt b/mysql-test/suite/rpl/t/rpl_timezone-slave.opt
index 191182c329c..191182c329c 100644
--- a/mysql-test/t/rpl_timezone-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_timezone-slave.opt
diff --git a/mysql-test/suite/rpl/t/rpl_timezone.test b/mysql-test/suite/rpl/t/rpl_timezone.test
new file mode 100644
index 00000000000..dac21000a62
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_timezone.test
@@ -0,0 +1,169 @@
+#######################################
+# Change Author: JBM
+# Change Date: 2006-01-17
+# Change: Added order by
+#######################################
+# Test of replication of time zones.
+######################################
+# There is currently some bug possibly in prepared statements (this
+# test fails with --ps-protocol): sys_var_thd_time_zone::value_ptr()
+# is called only at prepare time, not at execution time. So,
+# thd->time_zone_used is not equal to 1 (it is back to 0, because of
+# reset_thd_for_next_command called at execution time), so the
+# timezone used in CONVERT_TZ is not binlogged. To debug (by Guilhem
+# and possibly Konstantin).
+
+--disable_ps_protocol
+
+source include/master-slave.inc;
+
+# Save original timezone
+set @my_time_zone= @@global.time_zone;
+
+# Some preparations
+let $VERSION=`select version()`;
+set timestamp=100000000; # for fixed output of mysqlbinlog
+create table t1 (t timestamp, n int not null auto_increment, PRIMARY KEY(n));
+create table t2 (t char(32), n int not null auto_increment, PRIMARY KEY(n));
+
+connection slave;
+select @@time_zone;
+#set time_zone='UTC';
+#select @@time_zone;
+#
+# Let us check how well replication works when we are saving datetime
+# value in TIMESTAMP field.
+#
+connection master;
+select @@time_zone;
+#set time_zone='UTC';
+#select @@time_zone;
+insert into t1 values ('20050101000000', NULL), ('20050611093902',NULL);
+insert into t1 values ('20040101000000',NULL), ('20040611093902',NULL);
+SELECT * FROM t1 ORDER BY n;
+sync_slave_with_master;
+#set time_zone='UTC';
+SELECT * FROM t1 ORDER BY n;
+
+# Let us check also that setting of time_zone back to default also works
+# well
+connection master;
+delete from t1;
+set time_zone='Europe/Moscow';
+insert into t1 values ('20040101000000',NULL), ('20040611093902',NULL);
+SELECT * FROM t1 ORDER BY n;
+sync_slave_with_master;
+set time_zone='Europe/Moscow';
+SELECT * FROM t1 ORDER BY n;
+connection master;
+# Change Author: JBM
+# Change Date: 2005-12-22
+# Change: Comment out the exec of the binlog so test works for both SBR and RBR
+#--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+#--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001
+
+# Let us check with LOAD DATA INFILE
+# (we do it after mysqlbinlog because the temp files names are not constant)
+connection master;
+delete from t1;
+set time_zone='UTC';
+load data infile '../std_data_ln/rpl_timezone2.dat' into table t1;
+SELECT * FROM t1 ORDER BY n;
+sync_slave_with_master;
+set time_zone='UTC';
+SELECT * FROM t1 ORDER BY n;
+set time_zone='Europe/Moscow';
+
+# Put back values of before the LOAD
+connection master;
+set time_zone='Europe/Moscow';
+delete from t1;
+insert into t1 values ('20040101000000',NULL), ('20040611093902',NULL);
+
+#
+# Now let us check how well we replicate statments reading TIMESTAMP fields
+# (We should see the same data on master and on slave but it should differ
+# from originally inserted)
+#
+set time_zone='MET';
+insert into t2 (select * from t1);
+SELECT * FROM t1 ORDER BY n;
+sync_slave_with_master;
+SELECT * FROM t2 ORDER BY n;
+
+#
+# Now let us check how well we replicate various CURRENT_* functions
+#
+connection master;
+delete from t2;
+set timestamp=1000072000;
+insert into t2 values (current_timestamp,NULL), (current_date,NULL), (current_time,NULL);
+sync_slave_with_master;
+SELECT * FROM t2 ORDER BY n;
+
+#
+# At last let us check replication of FROM_UNIXTIME/UNIX_TIMESTAMP functions.
+#
+connection master;
+delete from t2;
+insert into t2 values (from_unixtime(1000000000),NULL),
+ (unix_timestamp('2001-09-09 03:46:40'),NULL);
+SELECT * FROM t2 ORDER BY n;
+sync_slave_with_master;
+# We should get same result on slave as on master
+SELECT * FROM t2 ORDER BY n;
+
+#
+# Let us check that we are allowing to set global time_zone with
+# replication
+#
+connection master;
+set global time_zone='MET';
+
+#
+# Let us see if CONVERT_TZ(@@time_zone) replicates
+#
+delete from t2;
+set time_zone='UTC';
+insert into t2 values(convert_tz('2004-01-01 00:00:00','MET',@@time_zone),NULL);
+insert into t2 values(convert_tz('2005-01-01 00:00:00','MET','Japan'),NULL);
+SELECT * FROM t2 ORDER BY n;
+sync_slave_with_master;
+SELECT * FROM t2 ORDER BY n;
+
+# Clean up
+connection master;
+drop table t1, t2;
+sync_slave_with_master;
+
+
+# Restore original timezone
+connection master;
+set global time_zone= @my_time_zone;
+
+--echo End of 4.1 tests
+
+#
+# Bug #29536: timestamp inconsistent in replication around 1970
+#
+connection master;
+
+CREATE TABLE t1 (a INT, b TIMESTAMP);
+INSERT INTO t1 VALUES (1, NOW());
+
+SET @@session.time_zone='Japan';
+UPDATE t1 SET b= '1970-01-01 08:59:59' WHERE a= 1;
+SELECT * FROM t1 ORDER BY a;
+
+sync_slave_with_master;
+SET @@session.time_zone='Japan';
+# must procdure the same result as the SELECT on the master
+SELECT * FROM t1 ORDER BY a;
+
+SET @@session.time_zone = default;
+connection master;
+DROP TABLE t1;
+SET @@session.time_zone = default;
+
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/rpl_trigger.test b/mysql-test/suite/rpl/t/rpl_trigger.test
index 9f5f6fc9b4c..9f5f6fc9b4c 100644
--- a/mysql-test/t/rpl_trigger.test
+++ b/mysql-test/suite/rpl/t/rpl_trigger.test
diff --git a/mysql-test/t/rpl_trunc_temp.test b/mysql-test/suite/rpl/t/rpl_trunc_temp.test
index 28bcb0c06c3..28bcb0c06c3 100644
--- a/mysql-test/t/rpl_trunc_temp.test
+++ b/mysql-test/suite/rpl/t/rpl_trunc_temp.test
diff --git a/mysql-test/t/rpl_truncate_2myisam.test b/mysql-test/suite/rpl/t/rpl_truncate_2myisam.test
index a0f0ea04f44..a0f0ea04f44 100644
--- a/mysql-test/t/rpl_truncate_2myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_truncate_2myisam.test
diff --git a/mysql-test/t/rpl_truncate_3innodb.test b/mysql-test/suite/rpl/t/rpl_truncate_3innodb.test
index a31fd62a29a..a31fd62a29a 100644
--- a/mysql-test/t/rpl_truncate_3innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_truncate_3innodb.test
diff --git a/mysql-test/t/rpl_truncate_7ndb_2-master.opt b/mysql-test/suite/rpl/t/rpl_truncate_7ndb_2-master.opt
index 01cf3e0520f..01cf3e0520f 100644
--- a/mysql-test/t/rpl_truncate_7ndb_2-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_truncate_7ndb_2-master.opt
diff --git a/mysql-test/t/rpl_truncate_7ndb_2.test b/mysql-test/suite/rpl/t/rpl_truncate_7ndb_2.test
index 4ee6c98d463..4ee6c98d463 100644
--- a/mysql-test/t/rpl_truncate_7ndb_2.test
+++ b/mysql-test/suite/rpl/t/rpl_truncate_7ndb_2.test
diff --git a/mysql-test/suite/rpl/t/rpl_udf-master.opt b/mysql-test/suite/rpl/t/rpl_udf-master.opt
new file mode 100644
index 00000000000..7d8786c156a
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_udf-master.opt
@@ -0,0 +1 @@
+$UDF_EXAMPLE_LIB_OPT
diff --git a/mysql-test/suite/rpl/t/rpl_udf-slave.opt b/mysql-test/suite/rpl/t/rpl_udf-slave.opt
new file mode 100644
index 00000000000..7d8786c156a
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_udf-slave.opt
@@ -0,0 +1 @@
+$UDF_EXAMPLE_LIB_OPT
diff --git a/mysql-test/t/rpl_udf.test b/mysql-test/suite/rpl/t/rpl_udf.test
index 262ad04630c..262ad04630c 100644
--- a/mysql-test/t/rpl_udf.test
+++ b/mysql-test/suite/rpl/t/rpl_udf.test
diff --git a/mysql-test/suite/rpl/t/rpl_user_variables.test b/mysql-test/suite/rpl/t/rpl_user_variables.test
new file mode 100644
index 00000000000..539f9c88e0d
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_user_variables.test
@@ -0,0 +1,362 @@
+###################################
+#
+# Test of replicating user variables
+#
+###################################
+
+-- source include/master-slave.inc
+# Disable PS as the log positions differs
+--disable_ps_protocol
+
+
+# Clean up old slave's binlogs.
+# The slave is started with --log-slave-updates
+# and this test does SHOW BINLOG EVENTS on the slave's
+# binlog. But previous tests can influence the current test's
+# binlog (e.g. a temporary table in the previous test has not
+# been explicitly deleted, or it has but the slave hasn't had
+# enough time to catch it before STOP SLAVE,
+# and at the beginning of the current
+# test the slave immediately writes DROP TEMPORARY TABLE this_old_table).
+# We wait for the slave to have written all he wants to the binlog
+# (otherwise RESET MASTER may come too early).
+save_master_pos;
+connection slave;
+sync_with_master;
+reset master;
+connection master;
+
+create table t1(n char(30));
+set @i1:=12345678901234, @i2:=-12345678901234, @i3:=0, @i4:=-1;
+set @s1:='This is a test', @r1:=12.5, @r2:=-12.5;
+set @n1:=null;
+set @s2:='', @s3:='abc\'def', @s4:= 'abc\\def', @s5:= 'abc''def';
+insert into t1 values (@i1), (@i2), (@i3), (@i4);
+insert into t1 values (@r1), (@r2);
+insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5);
+insert into t1 values (@n1);
+insert into t1 values (@n2); # not explicitely set before
+insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1);
+insert into t1 values (@a+(@b:=@a+1));
+set @q:='abc';
+insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2'));
+set @a:=5;
+insert into t1 values (@a),(@a);
+# To flush the pending event, we add the following statement. RBR can
+# concatenate the result of several statements, which SBR cannot.
+select * from t1 where n = '<nonexistant>';
+connection master1; # see if variable is reset in binlog when thread changes
+insert into t1 values (@a),(@a),(@a*5);
+SELECT * FROM t1 ORDER BY n;
+sync_slave_with_master;
+SELECT * FROM t1 ORDER BY n;
+connection master;
+insert into t1 select * FROM (select @var1 union select @var2) AS t2;
+drop table t1;
+--echo End of 4.1 tests.
+
+# BUG#20141
+# The following tests ensure that if user-defined variables are used in SF/Triggers
+# that they are replicated correctly. These tests should be run in both SBR and RBR
+# modes.
+
+# This test uses a procedure that inserts data values based on the value of a
+# user-defined variable. It also has a trigger that inserts data based on the
+# same variable. Successful test runs show that the @var is replicated
+# properly and that the procedure and trigger insert the correct data on the
+# slave.
+#
+# The test of stored procedure was included for completeness. Replication of stored
+# procedures was not directly affected by BUG#20141.
+#
+# This test was constructed for BUG#20141
+
+--disable_warnings
+DROP TABLE IF EXISTS t20;
+DROP TABLE IF EXISTS t21;
+DROP PROCEDURE IF EXISTS test.insert;
+--enable_warnings
+
+CREATE TABLE t20 (a VARCHAR(20));
+CREATE TABLE t21 (a VARCHAR(20));
+DELIMITER |;
+
+# Create a procedure that uses the @var for flow control
+
+CREATE PROCEDURE test.insert()
+BEGIN
+ IF (@VAR)
+ THEN
+ INSERT INTO test.t20 VALUES ('SP_TRUE');
+ ELSE
+ INSERT INTO test.t20 VALUES ('SP_FALSE');
+ END IF;
+END|
+
+# Create a trigger that uses the @var for flow control
+
+CREATE TRIGGER test.insert_bi BEFORE INSERT
+ ON test.t20 FOR EACH ROW
+ BEGIN
+ IF (@VAR)
+ THEN
+ INSERT INTO test.t21 VALUES ('TRIG_TRUE');
+ ELSE
+ INSERT INTO test.t21 VALUES ('TRIG_FALSE');
+ END IF;
+ END|
+DELIMITER ;|
+
+sync_slave_with_master;
+connection master;
+
+# Set @var and call the procedure, repeat with different values
+
+SET @VAR=0;
+CALL test.insert();
+SET @VAR=1;
+CALL test.insert();
+
+--echo On master: Check the tables for correct data
+
+SELECT * FROM t20;
+SELECT * FROM t21;
+
+sync_slave_with_master;
+
+--echo On slave: Check the tables for correct data and it matches master
+
+SELECT * FROM t20;
+SELECT * FROM t21;
+connection master;
+
+# Cleanup
+
+DROP TABLE t20;
+DROP TABLE t21;
+DROP PROCEDURE test.insert;
+
+# This test uses a stored function that uses user-defined variables to return data
+# This test was constructed for BUG#20141
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP FUNCTION IF EXISTS test.square;
+--enable_warnings
+
+CREATE TABLE t1 (i INT);
+
+# Create function that returns a value from @var. In this case, the square function
+
+CREATE FUNCTION test.square() RETURNS INTEGER DETERMINISTIC RETURN
+(@var * @var);
+
+# Set the @var to different values and insert them into a table
+
+SET @var = 1;
+INSERT INTO t1 VALUES (square());
+SET @var = 2;
+INSERT INTO t1 VALUES (square());
+SET @var = 3;
+INSERT INTO t1 VALUES (square());
+SET @var = 4;
+INSERT INTO t1 VALUES (square());
+SET @var = 5;
+INSERT INTO t1 VALUES (square());
+
+--echo On master: Retrieve the values from the table
+
+SELECT * FROM t1;
+
+sync_slave_with_master;
+
+--echo On slave: Retrieve the values from the table and verify they are the same as on master
+
+SELECT * FROM t1;
+
+connection master;
+
+# Cleanup
+
+DROP TABLE t1;
+DROP FUNCTION test.square;
+
+# This test uses stored functions that uses user-defined variables to return data
+# based on the use of @vars inside a function body.
+# This test was constructed for BUG#14914
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP FUNCTION IF EXISTS f1;
+DROP FUNCTION IF EXISTS f2;
+--enable_warnings
+
+CREATE TABLE t1(a int);
+DELIMITER |;
+
+# Create a function that simply returns the value of an @var.
+# Create a function that uses an @var for flow control, creates and uses another
+# @var and sets its value to a value based on another @var.
+
+CREATE FUNCTION f1() returns int deterministic BEGIN
+ return @a;
+END |
+
+CREATE FUNCTION f2() returns int deterministic BEGIN
+ IF (@b > 0) then
+ SET @c = (@a + @b);
+ else
+ SET @c = (@a - 1);
+ END if;
+ return @c;
+END |
+DELIMITER ;|
+
+sync_slave_with_master;
+connection master;
+
+# Set an @var to a value and insert data into a table using the first function.
+# Set two more @vars to some values and insert data into a table using the second function.
+
+SET @a=500;
+INSERT INTO t1 values(f1());
+SET @b = 125;
+SET @c = 1;
+INSERT INTO t1 values(f2());
+
+--echo On master: Retrieve the values from the table
+
+sync_slave_with_master;
+connection master;
+
+SELECT * from t1;
+
+connection slave;
+
+--echo On slave: Check the tables for correct data and it matches master
+
+SELECT * from t1;
+
+connection master;
+
+# Cleanup
+
+DROP TABLE t1;
+DROP FUNCTION f1;
+DROP FUNCTION f2;
+
+# This test uses a function that changes a user-defined variable in its body. This test
+# will ensure the @vars are replicated when needed and not interrupt the normal execution
+# of the function on the slave. This also applies to procedures and triggers.
+
+# This test was constructed for BUG#25167
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+--enable_warnings
+CREATE TABLE t1 (i int);
+CREATE TABLE t2 (k int);
+DELIMITER |;
+
+# Create a trigger that inserts data into another table, changes the @var then inserts
+# another row with the modified value.
+
+CREATE trigger t1_bi before INSERT on t1 for each row BEGIN
+ INSERT INTO t2 values (@a);
+ SET @a:=42;
+ INSERT INTO t2 values (@a);
+END |
+DELIMITER ;|
+
+sync_slave_with_master;
+connection master;
+
+# Set the @var to a value then insert data into first table.
+
+SET @a:=100;
+INSERT INTO t1 values (5);
+
+--echo On master: Check to see that data was inserted correctly in both tables
+
+SELECT * from t1;
+SELECT * from t2;
+
+sync_slave_with_master;
+
+--echo On slave: Check the tables for correct data and it matches master
+
+SELECT * from t1;
+SELECT * from t2;
+
+connection master;
+drop table t1, t2;
+
+#
+# Bug #12826: Possible to get inconsistent slave using SQL syntax Prepared Statements
+#
+connection master;
+create table t1(a int, b int);
+prepare s1 from 'insert into t1 values (@x:=@x+1, ?)';
+set @x=1; execute s1 using @x;
+select * from t1;
+sync_slave_with_master;
+connection slave;
+select * from t1;
+connection master;
+drop table t1;
+
+--echo End of 5.0 tests.
+
+# This test uses a stored function that uses user-defined variables to return data
+# The test ensures the value of the user-defined variable is replicated correctly
+# and in the correct order of assignment.
+
+# This test was constructed for BUG#20141
+
+--disable_warnings
+DROP FUNCTION IF EXISTS f1;
+DROP FUNCTION IF EXISTS f2;
+--enable_warnings
+
+CREATE TABLE t1 (i INT);
+
+# Create two functions. One simply returns the user-defined variable. The other
+# returns a value based on the user-defined variable.
+
+CREATE FUNCTION f1() RETURNS INT RETURN @a; DELIMITER |; CREATE
+FUNCTION f2() RETURNS INT BEGIN
+ INSERT INTO t1 VALUES (10 + @a);
+ RETURN 0;
+END|
+DELIMITER ;|
+
+sync_slave_with_master;
+connection master;
+
+# Set the variable and execute the functions.
+
+SET @a:=123;
+SELECT f1(), f2();
+
+--echo On master: Check to see that data was inserted correctly
+
+INSERT INTO t1 VALUES(f1());
+SELECT * FROM t1;
+
+sync_slave_with_master;
+
+--echo On slave: Check the table for correct data and it matches master
+
+SELECT * FROM t1;
+
+connection master;
+
+# Cleanup
+
+DROP FUNCTION f1;
+DROP FUNCTION f2;
+DROP TABLE t1;
+
+sync_slave_with_master;
+stop slave;
diff --git a/mysql-test/t/rpl_variables-master.opt b/mysql-test/suite/rpl/t/rpl_variables-master.opt
index a668c6bfbe8..a668c6bfbe8 100644
--- a/mysql-test/t/rpl_variables-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_variables-master.opt
diff --git a/mysql-test/t/rpl_variables.test b/mysql-test/suite/rpl/t/rpl_variables.test
index 84dc3acfe6e..84dc3acfe6e 100644
--- a/mysql-test/t/rpl_variables.test
+++ b/mysql-test/suite/rpl/t/rpl_variables.test
diff --git a/mysql-test/t/rpl_view-slave.opt b/mysql-test/suite/rpl/t/rpl_view-slave.opt
index 79b3bf6174b..79b3bf6174b 100644
--- a/mysql-test/t/rpl_view-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_view-slave.opt
diff --git a/mysql-test/suite/rpl/t/rpl_view.test b/mysql-test/suite/rpl/t/rpl_view.test
new file mode 100644
index 00000000000..51ad319b212
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_view.test
@@ -0,0 +1,167 @@
+# NYI - row-based cannot use CREATE ... SELECT
+
+source include/master-slave.inc;
+--disable_warnings
+drop table if exists t1,v1;
+drop view if exists t1,v1;
+sync_slave_with_master;
+reset master;
+--enable_warnings
+
+#
+# Check that creation drop of view is replicated, also check replication of
+# updating of view
+#
+connection master;
+create table t1 (a int);
+insert into t1 values (1);
+create view v1 as select a from t1;
+insert into v1 values (2);
+select * from v1 order by a;
+sync_slave_with_master;
+# view already have to be on slave
+select * from v1 order by a;
+connection master;
+update v1 set a=3 where a=1;
+select * from v1 order by a;
+sync_slave_with_master;
+select * from v1 order by a;
+connection master;
+delete from v1 where a=2;
+select * from v1 order by a;
+sync_slave_with_master;
+select * from v1 order by a;
+connection master;
+# 'alter view' internally maped to creation, but still check that it works
+alter view v1 as select a as b from t1;
+sync_slave_with_master;
+select * from v1 order by 1;
+connection master;
+drop view v1;
+sync_slave_with_master;
+#error, because view have to be removed from slave
+-- error 1146
+select * from v1 order by a;
+connection master;
+drop table t1;
+sync_slave_with_master;
+# Change Author: JBM
+# Change Date: 2005-12-22
+# Change: Commented out binlog events to work with SBR and RBR
+#--replace_column 2 # 5 #
+# show binlog events limit 1,100;
+
+#
+# BUG#20438: CREATE statements for views, stored routines and triggers can be
+# not replicable.
+#
+
+--echo
+--echo ---> Test for BUG#20438
+
+# Prepare environment.
+
+--echo
+--echo ---> Preparing environment...
+--echo ---> connection: master
+--connection master
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP VIEW IF EXISTS v1;
+--enable_warnings
+
+--echo
+--echo ---> Synchronizing slave with master...
+
+--save_master_pos
+--connection slave
+--sync_with_master
+
+--echo
+--echo ---> connection: master
+--connection master
+
+# Test.
+
+--echo
+--echo ---> Creating objects...
+
+CREATE TABLE t1(c INT);
+
+/*!50003 CREATE VIEW v1 AS SELECT * FROM t1 */;
+
+--echo
+--echo ---> Inserting value...
+
+INSERT INTO t1 VALUES(1);
+
+--echo
+--echo ---> Checking on master...
+
+SELECT * FROM t1;
+
+--echo
+--echo ---> Synchronizing slave with master...
+
+--save_master_pos
+--connection slave
+--sync_with_master
+
+--echo ---> connection: master
+
+--echo
+--echo ---> Checking on slave...
+
+SELECT * FROM t1;
+
+# Cleanup.
+
+--echo
+--echo ---> connection: master
+--connection master
+
+--echo
+--echo ---> Cleaning up...
+
+DROP VIEW v1;
+DROP TABLE t1;
+
+--save_master_pos
+--connection slave
+--sync_with_master
+--connection master
+
+#
+# BUG#19419: "VIEW: View that the column name is different
+# by master and slave is made".
+#
+connection master;
+create table t1(a int, b int);
+insert into t1 values (1, 1), (1, 2), (1, 3);
+create view v1(a, b) as select a, sum(b) from t1 group by a;
+
+sync_slave_with_master;
+explain v1;
+show create table v1;
+select * from v1;
+
+connection master;
+drop table t1;
+drop view v1;
+
+sync_slave_with_master;
+
+#
+# BUG#28244 CREATE VIEW breaks replication when view exists
+#
+connection master;
+CREATE TABLE t1(a INT);
+CREATE VIEW v1 AS SELECT * FROM t1;
+--error ER_TABLE_EXISTS_ERROR
+CREATE VIEW v1 AS SELECT * FROM t1;
+DROP VIEW v1;
+DROP TABLE t1;
+sync_slave_with_master;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/r/rpl_ndb_2innodb.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result
index f8ec4624062..f8ec4624062 100644
--- a/mysql-test/r/rpl_ndb_2innodb.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result
diff --git a/mysql-test/r/rpl_ndb_2myisam.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result
index 8611d83f3f3..8611d83f3f3 100644
--- a/mysql-test/r/rpl_ndb_2myisam.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result
new file mode 100644
index 00000000000..56b997028e9
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result
@@ -0,0 +1,1189 @@
+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;
+SET storage_engine=ndb;
+
+=== NDB -> MYISAM ===
+
+SET storage_engine=myisam;
+--- Doing pre test cleanup ---
+DROP TABLE IF EXISTS t1;
+--- Create Table Section ---
+CREATE TABLE t1 (id MEDIUMINT NOT NULL,
+b1 INT,
+vc VARCHAR(255),
+bc CHAR(255),
+d DECIMAL(10,4) DEFAULT 0,
+f FLOAT DEFAULT 0,
+total BIGINT UNSIGNED,
+y YEAR,
+t DATE,
+PRIMARY KEY(id));
+--- Show table on master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` int(11) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+--- Show table on slave ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` int(11) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
+--- Populate t1 with data ---
+--- Select from t1 on master ---
+select *
+from t1
+order by id;
+id b1 vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select *
+from t1
+order by id;
+id b1 vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22"
+WHERE id < 100
+ORDER BY id;
+--- Check the update on master ---
+SELECT *
+FROM t1
+WHERE id < 100
+ORDER BY id;
+id b1 vc bc d f total y t
+2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT *
+FROM t1
+WHERE id < 100
+ORDER BY id;
+id b1 vc bc d f total y t
+2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 412;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+TRUNCATE TABLE t1;
+--- Check that simple Alter statements are replicated correctly --
+ALTER TABLE t1 DROP PRIMARY KEY;
+ALTER TABLE t1 MODIFY vc char(32);
+--- Show the new improved table on the master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` int(11) DEFAULT NULL,
+ `vc` char(32) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+--- Make sure that our tables on slave are still same engine ---
+--- and that the alter statements replicated correctly ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` int(11) DEFAULT NULL,
+ `vc` char(32) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
+--- Populate t1 with data ---
+--- Select from t1 on master ---
+select *
+from t1
+order by id;
+id b1 vc bc d f total y t
+2 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select *
+from t1
+order by id;
+id b1 vc bc d f total y t
+2 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22"
+WHERE id < 100
+ORDER BY id;
+--- Check the update on master ---
+SELECT *
+FROM t1
+WHERE id < 100
+ORDER BY id;
+id b1 vc bc d f total y t
+2 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
+4 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
+42 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT *
+FROM t1
+WHERE id < 100
+ORDER BY id;
+id b1 vc bc d f total y t
+2 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
+4 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
+42 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 412;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+TRUNCATE TABLE t1;
+--- Check that replication works when slave has more columns than master
+ALTER TABLE t1 ADD PRIMARY KEY(id,total);
+ALTER TABLE t1 MODIFY vc TEXT;
+INSERT INTO t1 VALUES(3,1,'Testing MySQL databases is a cool ',
+'Must make it bug free for the customer',
+654321.4321,15.21,0,1965,"1905-11-14");
+INSERT INTO t1 VALUES(20,1,'Testing MySQL databases is a cool ',
+'Must make it bug free for the customer',
+654321.4321,15.21,0,1965,"1965-11-14");
+INSERT INTO t1 VALUES(50,1,'Testing MySQL databases is a cool ',
+'Must make it bug free for the customer',
+654321.4321,15.21,0,1965,"1985-11-14");
+--- Add columns on slave ---
+ALTER TABLE t1 ADD (u int, v char(16) default 'default');
+UPDATE t1 SET u=7 WHERE id < 50;
+UPDATE t1 SET v='explicit' WHERE id >10;
+--- Show changed table on slave ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` int(11) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ `u` int(11) DEFAULT NULL,
+ `v` char(16) DEFAULT 'default',
+ PRIMARY KEY (`id`,`total`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT *
+FROM t1
+ORDER BY id;
+id b1 vc bc d f total y t u v
+3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 7 default
+20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 7 explicit
+50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 NULL explicit
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
+--- Populate t1 with data ---
+--- Select from t1 on master ---
+select *
+from t1
+order by id;
+id b1 vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select *
+from t1
+order by id;
+id b1 vc bc d f total y t u v
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 NULL default
+3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 7 default
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 NULL default
+20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 7 explicit
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 NULL default
+50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 NULL explicit
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 NULL default
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 NULL default
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22"
+WHERE id < 100
+ORDER BY id;
+--- Check the update on master ---
+SELECT *
+FROM t1
+WHERE id < 100
+ORDER BY id;
+id b1 vc bc d f total y t
+2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+3 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+20 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+50 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT *
+FROM t1
+WHERE id < 100
+ORDER BY id;
+id b1 vc bc d f total y t u v
+2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL default
+3 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 7 default
+4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL default
+20 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 7 explicit
+42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL default
+50 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL explicit
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 412;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+7
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+7
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t1;
+--- Check that replication works when master has more columns than slave
+--- Remove columns on slave ---
+ALTER TABLE t1 DROP COLUMN v;
+ALTER TABLE t1 DROP COLUMN u;
+ALTER TABLE t1 DROP COLUMN t;
+ALTER TABLE t1 DROP COLUMN y;
+--- Show changed table on slave ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` int(11) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ PRIMARY KEY (`id`,`total`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
+--- Populate t1 with data ---
+--- Select from t1 on master ---
+select *
+from t1
+order by id;
+id b1 vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select *
+from t1
+order by id;
+id b1 vc bc d f total
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22"
+WHERE id < 100
+ORDER BY id;
+--- Check the update on master ---
+SELECT *
+FROM t1
+WHERE id < 100
+ORDER BY id;
+id b1 vc bc d f total y t
+2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT *
+FROM t1
+WHERE id < 100
+ORDER BY id;
+id b1 vc bc d f total
+2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0
+4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0
+42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 412;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t1;
+--- Do Cleanup --
+DROP TABLE IF EXISTS t1;
+
+=== NDB -> INNODB ===
+
+SET storage_engine=innodb;
+--- Doing pre test cleanup ---
+DROP TABLE IF EXISTS t1;
+--- Create Table Section ---
+CREATE TABLE t1 (id MEDIUMINT NOT NULL,
+b1 INT,
+vc VARCHAR(255),
+bc CHAR(255),
+d DECIMAL(10,4) DEFAULT 0,
+f FLOAT DEFAULT 0,
+total BIGINT UNSIGNED,
+y YEAR,
+t DATE,
+PRIMARY KEY(id));
+--- Show table on master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` int(11) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+--- Show table on slave ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` int(11) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
+--- Populate t1 with data ---
+--- Select from t1 on master ---
+select *
+from t1
+order by id;
+id b1 vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select *
+from t1
+order by id;
+id b1 vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22"
+WHERE id < 100
+ORDER BY id;
+--- Check the update on master ---
+SELECT *
+FROM t1
+WHERE id < 100
+ORDER BY id;
+id b1 vc bc d f total y t
+2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT *
+FROM t1
+WHERE id < 100
+ORDER BY id;
+id b1 vc bc d f total y t
+2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 412;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+TRUNCATE TABLE t1;
+--- Check that simple Alter statements are replicated correctly --
+ALTER TABLE t1 DROP PRIMARY KEY;
+ALTER TABLE t1 MODIFY vc char(32);
+--- Show the new improved table on the master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` int(11) DEFAULT NULL,
+ `vc` char(32) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+--- Make sure that our tables on slave are still same engine ---
+--- and that the alter statements replicated correctly ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` int(11) DEFAULT NULL,
+ `vc` char(32) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
+--- Populate t1 with data ---
+--- Select from t1 on master ---
+select *
+from t1
+order by id;
+id b1 vc bc d f total y t
+2 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select *
+from t1
+order by id;
+id b1 vc bc d f total y t
+2 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22"
+WHERE id < 100
+ORDER BY id;
+--- Check the update on master ---
+SELECT *
+FROM t1
+WHERE id < 100
+ORDER BY id;
+id b1 vc bc d f total y t
+2 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
+4 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
+42 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT *
+FROM t1
+WHERE id < 100
+ORDER BY id;
+id b1 vc bc d f total y t
+2 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
+4 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
+42 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 412;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+TRUNCATE TABLE t1;
+--- Check that replication works when slave has more columns than master
+ALTER TABLE t1 ADD PRIMARY KEY(id,total);
+ALTER TABLE t1 MODIFY vc TEXT;
+INSERT INTO t1 VALUES(3,1,'Testing MySQL databases is a cool ',
+'Must make it bug free for the customer',
+654321.4321,15.21,0,1965,"1905-11-14");
+INSERT INTO t1 VALUES(20,1,'Testing MySQL databases is a cool ',
+'Must make it bug free for the customer',
+654321.4321,15.21,0,1965,"1965-11-14");
+INSERT INTO t1 VALUES(50,1,'Testing MySQL databases is a cool ',
+'Must make it bug free for the customer',
+654321.4321,15.21,0,1965,"1985-11-14");
+--- Add columns on slave ---
+ALTER TABLE t1 ADD (u int, v char(16) default 'default');
+UPDATE t1 SET u=7 WHERE id < 50;
+UPDATE t1 SET v='explicit' WHERE id >10;
+--- Show changed table on slave ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` int(11) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ `u` int(11) DEFAULT NULL,
+ `v` char(16) DEFAULT 'default',
+ PRIMARY KEY (`id`,`total`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT *
+FROM t1
+ORDER BY id;
+id b1 vc bc d f total y t u v
+3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 7 default
+20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 7 explicit
+50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 NULL explicit
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
+--- Populate t1 with data ---
+--- Select from t1 on master ---
+select *
+from t1
+order by id;
+id b1 vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select *
+from t1
+order by id;
+id b1 vc bc d f total y t u v
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 NULL default
+3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 7 default
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 NULL default
+20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 7 explicit
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 NULL default
+50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 NULL explicit
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 NULL default
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 NULL default
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22"
+WHERE id < 100
+ORDER BY id;
+--- Check the update on master ---
+SELECT *
+FROM t1
+WHERE id < 100
+ORDER BY id;
+id b1 vc bc d f total y t
+2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+3 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+20 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+50 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT *
+FROM t1
+WHERE id < 100
+ORDER BY id;
+id b1 vc bc d f total y t u v
+2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL default
+3 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 7 default
+4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL default
+20 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 7 explicit
+42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL default
+50 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL explicit
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 412;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+7
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+7
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t1;
+--- Check that replication works when master has more columns than slave
+--- Remove columns on slave ---
+ALTER TABLE t1 DROP COLUMN v;
+ALTER TABLE t1 DROP COLUMN u;
+ALTER TABLE t1 DROP COLUMN t;
+ALTER TABLE t1 DROP COLUMN y;
+--- Show changed table on slave ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` int(11) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ PRIMARY KEY (`id`,`total`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
+--- Populate t1 with data ---
+--- Select from t1 on master ---
+select *
+from t1
+order by id;
+id b1 vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select *
+from t1
+order by id;
+id b1 vc bc d f total
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22"
+WHERE id < 100
+ORDER BY id;
+--- Check the update on master ---
+SELECT *
+FROM t1
+WHERE id < 100
+ORDER BY id;
+id b1 vc bc d f total y t
+2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT *
+FROM t1
+WHERE id < 100
+ORDER BY id;
+id b1 vc bc d f total
+2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0
+4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0
+42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 412;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t1;
+--- Do Cleanup --
+DROP TABLE IF EXISTS t1;
+
+=== NDB -> NDB ===
+
+SET storage_engine=ndb;
+--- Doing pre test cleanup ---
+DROP TABLE IF EXISTS t1;
+--- Create Table Section ---
+CREATE TABLE t1 (id MEDIUMINT NOT NULL,
+b1 INT,
+vc VARCHAR(255),
+bc CHAR(255),
+d DECIMAL(10,4) DEFAULT 0,
+f FLOAT DEFAULT 0,
+total BIGINT UNSIGNED,
+y YEAR,
+t DATE,
+PRIMARY KEY(id));
+--- Show table on master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` int(11) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+--- Show table on slave ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` int(11) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
+--- Populate t1 with data ---
+--- Select from t1 on master ---
+select *
+from t1
+order by id;
+id b1 vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select *
+from t1
+order by id;
+id b1 vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22"
+WHERE id < 100
+ORDER BY id;
+--- Check the update on master ---
+SELECT *
+FROM t1
+WHERE id < 100
+ORDER BY id;
+id b1 vc bc d f total y t
+2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT *
+FROM t1
+WHERE id < 100
+ORDER BY id;
+id b1 vc bc d f total y t
+2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 412;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+TRUNCATE TABLE t1;
+--- Check that simple Alter statements are replicated correctly --
+ALTER TABLE t1 DROP PRIMARY KEY;
+ALTER TABLE t1 MODIFY vc char(32);
+--- Show the new improved table on the master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` int(11) DEFAULT NULL,
+ `vc` char(32) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+--- Make sure that our tables on slave are still same engine ---
+--- and that the alter statements replicated correctly ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` int(11) DEFAULT NULL,
+ `vc` char(32) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
+--- Populate t1 with data ---
+--- Select from t1 on master ---
+select *
+from t1
+order by id;
+id b1 vc bc d f total y t
+2 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select *
+from t1
+order by id;
+id b1 vc bc d f total y t
+2 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22"
+WHERE id < 100
+ORDER BY id;
+--- Check the update on master ---
+SELECT *
+FROM t1
+WHERE id < 100
+ORDER BY id;
+id b1 vc bc d f total y t
+2 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
+4 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
+42 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT *
+FROM t1
+WHERE id < 100
+ORDER BY id;
+id b1 vc bc d f total y t
+2 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
+4 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
+42 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 412;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+TRUNCATE TABLE t1;
+--- Check that replication works when slave has more columns than master
+ALTER TABLE t1 ADD PRIMARY KEY(id,total);
+ALTER TABLE t1 MODIFY vc TEXT;
+INSERT INTO t1 VALUES(3,1,'Testing MySQL databases is a cool ',
+'Must make it bug free for the customer',
+654321.4321,15.21,0,1965,"1905-11-14");
+INSERT INTO t1 VALUES(20,1,'Testing MySQL databases is a cool ',
+'Must make it bug free for the customer',
+654321.4321,15.21,0,1965,"1965-11-14");
+INSERT INTO t1 VALUES(50,1,'Testing MySQL databases is a cool ',
+'Must make it bug free for the customer',
+654321.4321,15.21,0,1965,"1985-11-14");
+--- Add columns on slave ---
+ALTER TABLE t1 ADD (u int, v char(16) default 'default');
+UPDATE t1 SET u=7 WHERE id < 50;
+UPDATE t1 SET v='explicit' WHERE id >10;
+--- Show changed table on slave ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` int(11) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ `u` int(11) DEFAULT NULL,
+ `v` char(16) DEFAULT 'default',
+ PRIMARY KEY (`id`,`total`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT *
+FROM t1
+ORDER BY id;
+id b1 vc bc d f total y t u v
+3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 7 default
+20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 7 explicit
+50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 NULL explicit
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
+--- Populate t1 with data ---
+--- Select from t1 on master ---
+select *
+from t1
+order by id;
+id b1 vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select *
+from t1
+order by id;
+id b1 vc bc d f total y t u v
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 NULL default
+3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 7 default
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 NULL default
+20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 7 explicit
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 NULL default
+50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 NULL explicit
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 NULL default
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 NULL default
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22"
+WHERE id < 100
+ORDER BY id;
+--- Check the update on master ---
+SELECT *
+FROM t1
+WHERE id < 100
+ORDER BY id;
+id b1 vc bc d f total y t
+2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+3 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+20 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+50 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT *
+FROM t1
+WHERE id < 100
+ORDER BY id;
+id b1 vc bc d f total y t u v
+2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL default
+3 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 7 default
+4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL default
+20 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 7 explicit
+42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL default
+50 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL explicit
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 412;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+7
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+7
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t1;
+--- Check that replication works when master has more columns than slave
+--- Remove columns on slave ---
+ALTER TABLE t1 DROP COLUMN v;
+ALTER TABLE t1 DROP COLUMN u;
+ALTER TABLE t1 DROP COLUMN t;
+ALTER TABLE t1 DROP COLUMN y;
+--- Show changed table on slave ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` int(11) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ PRIMARY KEY (`id`,`total`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
+--- Populate t1 with data ---
+--- Select from t1 on master ---
+select *
+from t1
+order by id;
+id b1 vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select *
+from t1
+order by id;
+id b1 vc bc d f total
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22"
+WHERE id < 100
+ORDER BY id;
+--- Check the update on master ---
+SELECT *
+FROM t1
+WHERE id < 100
+ORDER BY id;
+id b1 vc bc d f total y t
+2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT *
+FROM t1
+WHERE id < 100
+ORDER BY id;
+id b1 vc bc d f total
+2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0
+4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0
+42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 412;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t1;
+--- Do Cleanup --
+DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_UUID.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_UUID.result
new file mode 100644
index 00000000000..6babf49dcaa
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_UUID.result
@@ -0,0 +1,40 @@
+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;
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE IF EXISTS test.t1;
+CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, vchar_column VARCHAR(100), PRIMARY KEY(a)) engine=NDB;
+INSERT INTO test.t1 VALUES(1,UUID(),UUID());
+create procedure test.p1()
+begin
+INSERT INTO test.t1 VALUES(2,UUID(),UUID());
+INSERT INTO test.t1 VALUES(3,UUID(),UUID());
+end|
+CALL test.p1();
+create function test.fn1(x int)
+returns int
+begin
+insert into t1 values (4+x,UUID(),UUID());
+insert into t1 values (5+x,UUID(),UUID());
+return 0;
+end|
+select fn1(0);
+fn1(0)
+0
+create table t2 (a int) engine=NDB;
+insert into t2 values(fn1(2));
+SHOW CREATE TABLE test.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL DEFAULT '0',
+ `blob_column` longblob,
+ `vchar_column` varchar(100) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+DROP PROCEDURE test.p1;
+DROP FUNCTION test.fn1;
+DROP TABLE test.t1;
+DROP TABLE test.t2;
diff --git a/mysql-test/r/rpl_ndb_auto_inc.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_auto_inc.result
index dd4cc90a75f..dd4cc90a75f 100644
--- a/mysql-test/r/rpl_ndb_auto_inc.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_auto_inc.result
diff --git a/mysql-test/r/rpl_ndb_bank.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_bank.result
index 06c005427d1..06c005427d1 100644
--- a/mysql-test/r/rpl_ndb_bank.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_bank.result
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result
new file mode 100644
index 00000000000..b5b3dc6b66c
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result
@@ -0,0 +1,231 @@
+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` ( `nid` int(11) NOT NULL default '0',
+`nom` char(4) default NULL,
+`prenom` char(4) default NULL,
+PRIMARY KEY (`nid`))
+ENGINE=ndbcluster DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES(1,"XYZ1","ABC1");
+select * from t1 order by nid;
+nid nom prenom
+1 XYZ1 ABC1
+select * from t1 order by nid;
+nid nom prenom
+1 XYZ1 ABC1
+delete from t1;
+INSERT INTO t1 VALUES(1,"XYZ2","ABC2");
+select * from t1 order by nid;
+nid nom prenom
+1 XYZ2 ABC2
+select * from t1 order by nid;
+nid nom prenom
+1 XYZ2 ABC2
+delete from t1;
+insert into t1 values(1,"AA", "AA");
+insert into t1 values(2,"BB", "BB");
+insert into t1 values(3,"CC", "CC");
+insert into t1 values(4,"DD", "DD");
+begin;
+delete from t1 where nid = 1;
+insert into t1 values (1,"A2", "A2");
+update t1 set nom="B2" where nid = 2;
+delete from t1 where nid = 2;
+update t1 set nom = "D2" where nid = 4;
+delete from t1 where nid = 4;
+insert into t1 values (4, "D3", "D3");
+update t1 set nom = "D4" where nid = 4;
+insert into t1 values (5, "EE", "EE");
+delete from t1 where nid = 5;
+commit;
+select * from t1 order by 1;
+nid nom prenom
+1 A2 A2
+3 CC CC
+4 D4 D3
+select * from t1 order by 1;
+nid nom prenom
+1 A2 A2
+3 CC CC
+4 D4 D3
+DROP table t1;
+CREATE TABLE `t1` ( `nid` int(11) NOT NULL default '0',
+`nom` char(4) default NULL,
+`prenom` char(4) default NULL)
+ENGINE=ndbcluster DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES(1,"XYZ1","ABC1"),(2,"AAA","BBB"),(3,"CCC","DDD");
+select * from t1 order by nid;
+nid nom prenom
+1 XYZ1 ABC1
+2 AAA BBB
+3 CCC DDD
+select * from t1 order by nid;
+nid nom prenom
+1 XYZ1 ABC1
+2 AAA BBB
+3 CCC DDD
+delete from t1 where nid = 2;
+INSERT INTO t1 VALUES(4,"EEE","FFF");
+select * from t1 order by nid;
+nid nom prenom
+1 XYZ1 ABC1
+3 CCC DDD
+4 EEE FFF
+select * from t1 order by nid;
+nid nom prenom
+1 XYZ1 ABC1
+3 CCC DDD
+4 EEE FFF
+UPDATE t1 set nid=nid+1;
+UPDATE t1 set nom="CCP" where nid = 4;
+select * from t1 order by nid;
+nid nom prenom
+2 XYZ1 ABC1
+4 CCP DDD
+5 EEE FFF
+select * from t1 order by nid;
+nid nom prenom
+2 XYZ1 ABC1
+4 CCP DDD
+5 EEE FFF
+DROP table t1;
+CREATE TABLE `t1` (
+`prid` int(10) unsigned NOT NULL,
+`id_type` enum('IMSI','SIP') NOT NULL,
+`fkimssub` varchar(50) NOT NULL,
+`user_id` varchar(20) DEFAULT NULL,
+`password` varchar(20) DEFAULT NULL,
+`ptg_nbr` varchar(20) DEFAULT NULL,
+`old_tmsi` int(10) unsigned DEFAULT NULL,
+`new_tmsi` int(10) unsigned DEFAULT NULL,
+`dev_capability` int(10) unsigned DEFAULT NULL,
+`dev_oid` bigint(20) unsigned DEFAULT NULL,
+`lac_cell_id` bigint(20) unsigned DEFAULT NULL,
+`ms_classmark1` int(10) unsigned DEFAULT NULL,
+`cipher_key` int(10) unsigned DEFAULT NULL,
+`priid_master` int(10) unsigned DEFAULT NULL,
+PRIMARY KEY (`prid`),
+UNIQUE KEY `fkimssub` (`fkimssub`,`ptg_nbr`) USING HASH
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
+Warnings:
+Warning 1121 Ndb does not support unique index on NULL valued attributes, index access with NULL value will become full table scan
+INSERT INTO `t1` VALUES (183342,'IMSI','config3_sub_2Privates_3Publics_imssub_36668','user_id_73336','user_id_73336','73336',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(47617,'IMSI','config3_sub_2Privates_3Publics_imssub_9523','user_id_19046','user_id_19046','19046',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(200332,'IMSI','config3_sub_2Privates_3Publics_imssub_40066','user_id_80132','user_id_80132','80132',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(478882,'IMSI','config3_sub_2Privates_3Publics_imssub_95776','user_id_191552','user_id_191552','191552',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(490146,'IMSI','config3_sub_2Privates_3Publics_imssub_98029','user_id_196057','user_id_196057','196057',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(499301,'IMSI','config3_sub_2Privates_3Publics_imssub_99860','user_id_199719','user_id_199719','199719',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(506101,'IMSI','config3_sub_2Privates_3Publics_imssub_101220','user_id_202439','user_id_202439','202439',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(510142,'IMSI','config3_sub_2Privates_3Publics_imssub_102028','user_id_204056','user_id_204056','204056',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(515871,'IMSI','config3_sub_2Privates_3Publics_imssub_103174','user_id_206347','user_id_206347','206347',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(209842,'IMSI','config3_sub_2Privates_3Publics_imssub_41968','user_id_83936','user_id_83936','83936',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(365902,'IMSI','config3_sub_2Privates_3Publics_imssub_73180','user_id_146360','user_id_146360','146360',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(11892,'IMSI','config3_sub_2Privates_3Publics_imssub_2378','user_id_4756','user_id_4756','4756',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL);
+select count(*) from t1;
+count(*)
+12
+select count(*) from t1;
+count(*)
+12
+update t1 set dev_oid=dev_oid+1;
+select count(*) from t1;
+count(*)
+12
+select count(*) from t1;
+count(*)
+12
+DROP table t1;
+CREATE TABLE `t1` ( `nid` int(11) NOT NULL default '0',
+`nom` char(4) default NULL,
+`prenom` char(4) default NULL,
+PRIMARY KEY USING HASH (`nid`))
+ENGINE=ndbcluster DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES(1,"XYZ1","ABC1");
+**** On Slave ****
+BEGIN;
+UPDATE t1 SET `nom`="LOCK" WHERE `nid`=1;
+set GLOBAL slave_transaction_retries=1;
+**** On Master ****
+UPDATE t1 SET `nom`="DEAD" WHERE `nid`=1;
+**** On Slave ****
+SHOW SLAVE STATUS;;
+Slave_IO_State <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 <Read_Master_Log_Pos>
+Relay_Log_File <Relay_Log_File>
+Relay_Log_Pos <Relay_Log_Pos>
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table <Replicate_Ignore_Table>
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno <Last_Errno>
+Last_Error <Last_Error>
+Skip_Counter 0
+Exec_Master_Log_Pos <Exec_Master_Log_Pos>
+Relay_Log_Space <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 <Seconds_Behind_Master>
+Master_SSL_Verify_Server_Cert No
+Last_IO_Errno <Last_IO_Errno>
+Last_IO_Error <Last_IO_Error>
+Last_SQL_Errno <Last_SQL_Errno>
+Last_SQL_Error <Last_SQL_Error>
+set GLOBAL slave_transaction_retries=10;
+START SLAVE;
+select * from t1 order by nid;
+nid nom prenom
+1 LOCK ABC1
+COMMIT;
+select * from t1 order by nid;
+nid nom prenom
+1 DEAD ABC1
+DROP TABLE t1;
+CREATE TABLE t1 (c1 INT KEY) ENGINE=NDB;
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+ALTER TABLE t1 ADD c2 INT;
+SELECT * FROM t1 ORDER BY c1;
+c1 c2
+1 NULL
+2 NULL
+3 NULL
+4 NULL
+5 NULL
+6 NULL
+7 NULL
+8 NULL
+9 NULL
+10 NULL
+ALTER TABLE t1 CHANGE c2 c2 TEXT CHARACTER SET utf8;
+ALTER TABLE t1 CHANGE c2 c2 BLOB;
+SELECT * FROM t1 ORDER BY c1 LIMIT 5;
+c1 c2
+1 NULL
+2 NULL
+3 NULL
+4 NULL
+5 NULL
+TRUNCATE t1;
+SELECT count(*) FROM t1;
+count(*)
+0
+INSERT INTO t1 VALUES (101,NULL),(102,NULL),(103,NULL),(104,NULL),(105,NULL),(106,NULL),(107,NULL),(108,NULL),(109,NULL),(1010,NULL);
+SELECT count(*) FROM t1;
+count(*)
+10
+SELECT c1 FROM t1 ORDER BY c1 LIMIT 5;
+c1
+101
+102
+103
+104
+105
+DROP TABLE t1;
diff --git a/mysql-test/r/rpl_ndb_blob.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob.result
index c11de8c27e3..c11de8c27e3 100644
--- a/mysql-test/r/rpl_ndb_blob.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob.result
diff --git a/mysql-test/r/rpl_ndb_blob2.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob2.result
index 055efffbd6a..055efffbd6a 100644
--- a/mysql-test/r/rpl_ndb_blob2.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob2.result
diff --git a/mysql-test/r/rpl_ndb_charset.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_charset.result
index ed9b3cfbfa8..ed9b3cfbfa8 100644
--- a/mysql-test/r/rpl_ndb_charset.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_charset.result
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result
new file mode 100644
index 00000000000..e4b5e9b9216
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result
@@ -0,0 +1,103 @@
+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;
+RESET MASTER;
+CHANGE MASTER TO master_host="127.0.0.1",master_port=SLAVE_PORT,master_user="root";
+START SLAVE;
+CREATE TABLE t1 (a int key, b int) ENGINE=ndb;
+SHOW TABLES;
+Tables_in_test
+t1
+INSERT INTO t1 VALUES (1,2);
+INSERT INTO t1 VALUES (2,3);
+SELECT * FROM t1 ORDER BY a;
+a b
+1 2
+2 3
+show slave status;;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+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 #
+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
+SELECT * FROM t1 ORDER BY a;
+a b
+1 2
+2 3
+show slave status;;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 60
+Master_Log_File slave-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File slave-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 #
+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
+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
new file mode 100644
index 00000000000..18c00583df1
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result
@@ -0,0 +1,104 @@
+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 key, b int) ENGINE=NDB;
+SHOW TABLES;
+Tables_in_test
+t1
+RESET MASTER;
+INSERT INTO t1 VALUES (1,2);
+INSERT INTO t1 VALUES (2,3);
+STOP SLAVE;
+CHANGE MASTER TO MASTER_HOST="127.0.0.1",MASTER_PORT=SLAVE_PORT,MASTER_USER="root";
+START SLAVE;
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port SLAVE_PORT
+Connect_Retry 60
+Master_Log_File slave-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File slave-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 #
+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
+SELECT * FROM t1 ORDER BY a;
+a b
+1 2
+2 3
+STOP SLAVE;
+START SLAVE;
+SELECT * FROM t1 ORDER BY a;
+a b
+1 2
+2 3
+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 #
+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 #
+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
diff --git a/mysql-test/r/rpl_ndb_commit_afterflush.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_commit_afterflush.result
index 3fc4ca26967..3fc4ca26967 100644
--- a/mysql-test/r/rpl_ndb_commit_afterflush.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_commit_afterflush.result
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result
new file mode 100644
index 00000000000..2f9dc4ae616
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result
@@ -0,0 +1,9 @@
+show variables like 'collation_server';
+Variable_name Value
+collation_server ucs2_unicode_ci
+show variables like "%character_set_ser%";
+Variable_name Value
+character_set_server ucs2
+DROP TABLE IF EXISTS t1;
+create table t1 (a int);
+drop table t1;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_advance.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_advance.result
new file mode 100644
index 00000000000..7f26313894c
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_advance.result
@@ -0,0 +1,327 @@
+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;
+DROP TABLE IF EXISTS t1, t2, t3;
+***** Test 1 RPL of CDD and Alter *****
+***** Test 1 setup *****
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+INITIAL_SIZE 16M
+UNDO_BUFFER_SIZE = 1M
+ENGINE=NDB;
+ALTER LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile02.dat'
+INITIAL_SIZE 4M
+ENGINE=NDB;
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 12M
+ENGINE=NDB;
+ALTER TABLESPACE ts1
+ADD DATAFILE 'datafile02.dat'
+INITIAL_SIZE 4M
+ENGINE=NDB;
+CREATE TABLE t1
+(c1 INT NOT NULL PRIMARY KEY,
+c2 INT NOT NULL,
+c3 INT NOT NULL)
+TABLESPACE ts1 STORAGE DISK
+ENGINE=NDB;
+***** insert some data *****
+***** Select from Master *****
+SELECT * FROM t1 ORDER BY c1 LIMIT 5;
+c1 c2 c3
+1 2 4
+2 4 5
+3 6 6
+4 8 7
+5 10 8
+***** Select from Slave *****
+SELECT * FROM t1 ORDER BY c1 LIMIT 5;
+c1 c2 c3
+1 2 4
+2 4 5
+3 6 6
+4 8 7
+5 10 8
+FILE_NAME FILE_TYPE TABLESPACE_NAME LOGFILE_GROUP_NAME
+NULL UNDO LOG NULL lg1
+datafile.dat DATAFILE ts1 lg1
+datafile02.dat DATAFILE ts1 lg1
+undofile.dat UNDO LOG NULL lg1
+undofile02.dat UNDO LOG NULL lg1
+**** Do First Set of ALTERs in the master table ****
+CREATE INDEX t1_i ON t1(c2, c3);
+CREATE UNIQUE INDEX t1_i2 ON t1(c2);
+ALTER TABLE t1 ADD c4 TIMESTAMP;
+ALTER TABLE t1 ADD c5 DOUBLE;
+ALTER TABLE t1 ADD INDEX (c5);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL,
+ `c2` int(11) NOT NULL,
+ `c3` int(11) NOT NULL,
+ `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `c5` double DEFAULT NULL,
+ PRIMARY KEY (`c1`),
+ UNIQUE KEY `t1_i2` (`c2`),
+ KEY `t1_i` (`c2`,`c3`),
+ KEY `c5` (`c5`)
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+**** Show first set of ALTERs on SLAVE ****
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL,
+ `c2` int(11) NOT NULL,
+ `c3` int(11) NOT NULL,
+ `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `c5` double DEFAULT NULL,
+ PRIMARY KEY (`c1`),
+ UNIQUE KEY `t1_i2` (`c2`),
+ KEY `t1_i` (`c2`,`c3`),
+ KEY `c5` (`c5`)
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+**** Second set of alters test 1 ****
+ALTER TABLE t1 RENAME t2;
+ALTER TABLE t2 DROP INDEX c5;
+CREATE TABLE t1(c1 INT)ENGINE=NDB;
+INSERT INTO t1 VALUES(1);
+DROP TABLE t1;
+ALTER TABLE t2 RENAME t1;
+**** Show second set of ALTERs on MASTER ****
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL,
+ `c2` int(11) NOT NULL,
+ `c3` int(11) NOT NULL,
+ `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `c5` double DEFAULT NULL,
+ PRIMARY KEY (`c1`),
+ UNIQUE KEY `t1_i2` (`c2`),
+ KEY `t1_i` (`c2`,`c3`)
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+**** Show second set of ALTERs on SLAVE ****
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL,
+ `c2` int(11) NOT NULL,
+ `c3` int(11) NOT NULL,
+ `c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `c5` double DEFAULT NULL,
+ PRIMARY KEY (`c1`),
+ UNIQUE KEY `t1_i2` (`c2`),
+ KEY `t1_i` (`c2`,`c3`)
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+**** Third and last set of alters for test1 ****
+ALTER TABLE t1 CHANGE c1 c1 DOUBLE;
+ALTER TABLE t1 CHANGE c2 c2 DECIMAL(10,2);
+ALTER TABLE t1 DROP COLUMN c3;
+ALTER TABLE t1 CHANGE c4 c4 TEXT CHARACTER SET utf8;
+ALTER TABLE t1 CHANGE c4 c4 BLOB;
+ALTER TABLE t1 CHANGE c4 c3 BLOB;
+set @b1 = 'b1';
+set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
+UPDATE t1 SET c3=@b1 where c1 = 1;
+UPDATE t1 SET c3=@b1 where c1 = 2;
+**** Show last set of ALTERs on MASTER ****
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` double NOT NULL DEFAULT '0',
+ `c2` decimal(10,2) DEFAULT NULL,
+ `c3` blob,
+ `c5` double DEFAULT NULL,
+ PRIMARY KEY (`c1`),
+ UNIQUE KEY `t1_i2` (`c2`),
+ KEY `t1_i` (`c2`)
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+SELECT * FROM t1 ORDER BY c1 LIMIT 5;
+c1 c2 c3 c5
+1 2.00 b1b1b1b1b1b1b1b1b1b1 NULL
+2 4.00 b1b1b1b1b1b1b1b1b1b1 NULL
+3 6.00 0000-00-00 00:00:00 NULL
+4 8.00 0000-00-00 00:00:00 NULL
+5 10.00 0000-00-00 00:00:00 NULL
+**** Show last set of ALTERs on SLAVE ****
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` double NOT NULL DEFAULT '0',
+ `c2` decimal(10,2) DEFAULT NULL,
+ `c3` blob,
+ `c5` double DEFAULT NULL,
+ PRIMARY KEY (`c1`),
+ UNIQUE KEY `t1_i2` (`c2`),
+ KEY `t1_i` (`c2`)
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+SELECT * FROM t1 ORDER BY c1 LIMIT 5;
+c1 c2 c3 c5
+1 2.00 b1b1b1b1b1b1b1b1b1b1 NULL
+2 4.00 b1b1b1b1b1b1b1b1b1b1 NULL
+3 6.00 0000-00-00 00:00:00 NULL
+4 8.00 0000-00-00 00:00:00 NULL
+5 10.00 0000-00-00 00:00:00 NULL
+SELECT * FROM t1 where c1 = 1;
+c1 c2 c3 c5
+1 2.00 b1b1b1b1b1b1b1b1b1b1 NULL
+DROP TABLE t1;
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
+******** Create additional TABLESPACE test 2 **************
+CREATE TABLESPACE ts2
+ADD DATAFILE 'datafile03.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 10M
+ENGINE=NDB;
+ALTER TABLESPACE ts2
+ADD DATAFILE 'datafile04.dat'
+INITIAL_SIZE 5M
+ENGINE=NDB;
+DROP DATABASE IF EXISTS tpcb;
+CREATE DATABASE tpcb;
+
+CREATE TABLE tpcb.account
+(id INT, bid INT, balance DECIMAL(10,2),
+filler CHAR(255), PRIMARY KEY(id))
+TABLESPACE ts2 STORAGE DISK
+ENGINE=NDBCLUSTER;
+
+CREATE TABLE tpcb.branch
+(bid INT, balance DECIMAL(10,2), filler VARCHAR(255),
+PRIMARY KEY(bid))TABLESPACE ts2 STORAGE DISK
+ENGINE=NDBCLUSTER;
+
+CREATE TABLE tpcb.teller
+(tid INT, balance DECIMAL(10,2), filler VARCHAR(255),
+PRIMARY KEY(tid)) TABLESPACE ts2 STORAGE DISK
+ENGINE=NDBCLUSTER;
+
+CREATE TABLE tpcb.history
+(id MEDIUMINT NOT NULL AUTO_INCREMENT,aid INT,
+tid INT, bid INT, amount DECIMAL(10,2),
+tdate DATETIME, teller CHAR(20), uuidf LONGBLOB,
+filler CHAR(80),PRIMARY KEY (id))
+TABLESPACE ts2 STORAGE DISK
+ENGINE=NDBCLUSTER;
+
+--- Create stored procedures & functions ---
+
+
+*** Stored Procedures Created ***
+
+****** TEST 2 test time *********************************
+USE tpcb;
+*********** Load up the database ******************
+CALL tpcb.load();
+********** Check load master and slave **************
+SELECT COUNT(*) FROM account;
+COUNT(*)
+1000
+USE tpcb;
+SELECT COUNT(*) FROM account;
+COUNT(*)
+1000
+******** Run in some transactions ***************
+***** Time to try slave sync ***********
+**** Must make sure slave is clean *****
+STOP SLAVE;
+RESET SLAVE;
+DROP PROCEDURE IF EXISTS tpcb.load;
+DROP PROCEDURE IF EXISTS tpcb.trans;
+DROP TABLE IF EXISTS tpcb.account;
+DROP TABLE IF EXISTS tpcb.teller;
+DROP TABLE IF EXISTS tpcb.branch;
+DROP TABLE IF EXISTS tpcb.history;
+DROP DATABASE tpcb;
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile.dat'
+ENGINE=NDB;
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile02.dat'
+ENGINE=NDB;
+DROP TABLESPACE ts1 ENGINE=NDB;
+ALTER TABLESPACE ts2
+DROP DATAFILE 'datafile03.dat'
+ENGINE=NDB;
+ALTER TABLESPACE ts2
+DROP DATAFILE 'datafile04.dat'
+ENGINE=NDB;
+DROP TABLESPACE ts2 ENGINE=NDB;
+DROP LOGFILE GROUP lg1 ENGINE=NDB;
+********** Take a backup of the Master *************
+SELECT COUNT(*) FROM history;
+COUNT(*)
+100
+SELECT COUNT(*) FROM history;
+COUNT(*)
+200
+CREATE TEMPORARY TABLE IF NOT EXISTS mysql.backup_info (id INT, backup_id INT) ENGINE = HEAP;
+DELETE FROM mysql.backup_info;
+LOAD DATA INFILE '../tmp.dat' INTO TABLE mysql.backup_info FIELDS TERMINATED BY ',';
+SELECT @the_backup_id:=backup_id FROM mysql.backup_info;
+@the_backup_id:=backup_id
+<the_backup_id>
+DROP TABLE IF EXISTS mysql.backup_info;
+************ Restore the slave ************************
+CREATE DATABASE tpcb;
+***** Check a few slave restore values ***************
+USE tpcb;
+SELECT COUNT(*) FROM account;
+COUNT(*)
+1000
+***** Add some more records to master *********
+***** Finsh the slave sync process *******
+@the_epoch:=MAX(epoch)
+<the_epoch>
+@the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1)
+<the_pos> master-bin.000001
+* 4. *
+* 5. *
+START SLAVE;
+**** We should be ready to continue on *************
+****** Let's make sure we match *******
+***** MASTER *******
+USE tpcb;
+SELECT COUNT(*) FROM history;
+COUNT(*)
+400
+****** SLAVE ********
+USE tpcb;
+SELECT COUNT(*) FROM history;
+COUNT(*)
+400
+*** DUMP MASTER & SLAVE FOR COMPARE ********
+*************** TEST 2 CLEANUP SECTION ********************
+DROP PROCEDURE IF EXISTS tpcb.load;
+DROP PROCEDURE IF EXISTS tpcb.trans;
+DROP TABLE tpcb.account;
+DROP TABLE tpcb.teller;
+DROP TABLE tpcb.branch;
+DROP TABLE tpcb.history;
+DROP DATABASE tpcb;
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile.dat'
+ENGINE=NDB;
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile02.dat'
+ENGINE=NDB;
+DROP TABLESPACE ts1 ENGINE=NDB;
+ALTER TABLESPACE ts2
+DROP DATAFILE 'datafile03.dat'
+ENGINE=NDB;
+ALTER TABLESPACE ts2
+DROP DATAFILE 'datafile04.dat'
+ENGINE=NDB;
+DROP TABLESPACE ts2 ENGINE=NDB;
+DROP LOGFILE GROUP lg1 ENGINE=NDB;
+****** Do dumps compare ************
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_basic.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_basic.result
new file mode 100644
index 00000000000..6a0c863440e
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_basic.result
@@ -0,0 +1,72 @@
+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;
+DROP TABLE IF EXISTS t1;
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+INITIAL_SIZE 16M
+UNDO_BUFFER_SIZE = 1M
+ENGINE=NDB;
+alter logfile group lg1
+add undofile 'undofile02.dat'
+initial_size 4M engine=ndb;
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 12M
+ENGINE NDB;
+alter tablespace ts1
+add datafile 'datafile02.dat'
+initial_size 4M engine=ndb;
+CREATE TABLE t1
+(pk1 int not null primary key, b int not null, c int not null)
+tablespace ts1 storage disk
+engine ndb;
+insert into t1 values (1,2,3);
+select * from t1 order by pk1;
+pk1 b c
+1 2 3
+select * from t1 order by pk1;
+pk1 b c
+1 2 3
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # use `test`; DROP TABLE IF EXISTS t1
+master-bin.000001 # Query 1 # use `test`; CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+INITIAL_SIZE 16M
+UNDO_BUFFER_SIZE = 1M
+ENGINE=NDB
+master-bin.000001 # Query 1 # use `test`; alter logfile group lg1
+add undofile 'undofile02.dat'
+initial_size 4M engine=ndb
+master-bin.000001 # Query 1 # use `test`; CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 12M
+ENGINE NDB
+master-bin.000001 # Query 1 # use `test`; alter tablespace ts1
+add datafile 'datafile02.dat'
+initial_size 4M engine=ndb
+master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1
+(pk1 int not null primary key, b int not null, c int not null)
+tablespace ts1 storage disk
+engine ndb
+master-bin.000001 # Query 1 # BEGIN
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+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
+drop table t1;
+alter tablespace ts1
+drop datafile 'datafile.dat'
+engine=ndb;
+alter tablespace ts1
+drop datafile 'datafile02.dat'
+engine=ndb;
+DROP TABLESPACE ts1 ENGINE=NDB;
+DROP LOGFILE GROUP lg1 ENGINE=NDB;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result
new file mode 100644
index 00000000000..298f45b5cee
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result
@@ -0,0 +1,726 @@
+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;
+--- Doing pre test cleanup ---
+DROP TABLE IF EXISTS t1;
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+INITIAL_SIZE 16M
+UNDO_BUFFER_SIZE = 1M
+ENGINE=NDB;
+ALTER LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile02.dat'
+INITIAL_SIZE = 4M
+ENGINE=NDB;
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 12M
+ENGINE NDB;
+ALTER TABLESPACE ts1
+ADD DATAFILE 'datafile02.dat'
+INITIAL_SIZE = 4M
+ENGINE=NDB;
+--- Start test 2 partition RANGE testing --
+--- Do setup --
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63),
+bc CHAR(63), d DECIMAL(10,4) DEFAULT 0,
+f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+y YEAR, t DATE)
+TABLESPACE ts1 STORAGE DISK
+ENGINE=NDB
+PARTITION BY RANGE (YEAR(t))
+(PARTITION p0 VALUES LESS THAN (1901),
+PARTITION p1 VALUES LESS THAN (1946),
+PARTITION p2 VALUES LESS THAN (1966),
+PARTITION p3 VALUES LESS THAN (1986),
+PARTITION p4 VALUES LESS THAN (2005),
+PARTITION p5 VALUES LESS THAN MAXVALUE);
+--- Show table on master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(63) DEFAULT NULL,
+ `bc` char(63) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
+--- Show table on slave --
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(63) DEFAULT NULL,
+ `bc` char(63) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- Check that simple Alter statements are replicated correctly ---
+ALTER TABLE t1 MODIFY vc VARCHAR(255);
+--- Show the new improved table on the master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(63) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
+--- Make sure that our tables on slave are still same engine ---
+--- and that the alter statements replicated correctly ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(63) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- End test 2 partition RANGE testing ---
+--- Do Cleanup ---
+DROP TABLE IF EXISTS t1;
+--- Start test 3 partition LIST testing ---
+--- Do setup ---
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63),
+bc CHAR(63), d DECIMAL(10,4) DEFAULT 0,
+f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+y YEAR, t DATE)
+TABLESPACE ts1 STORAGE DISK
+ENGINE=NDB
+PARTITION BY LIST(id)
+(PARTITION p0 VALUES IN (2, 4),
+PARTITION p1 VALUES IN (42, 142));
+--- Test 3 Alter to add partition ---
+ALTER TABLE t1 ADD PARTITION (PARTITION p2 VALUES IN (412));
+--- Show table on master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(63) DEFAULT NULL,
+ `bc` char(63) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
+--- Show table on slave ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(63) DEFAULT NULL,
+ `bc` char(63) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- Check that simple Alter statements are replicated correctly ---
+ALTER TABLE t1 MODIFY vc VARCHAR(255);
+--- Show the new improved table on the master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(63) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
+--- Make sure that our tables on slave are still same engine ---
+--- and that the alter statements replicated correctly ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(63) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- End test 3 partition LIST testing ---
+--- Do Cleanup --
+DROP TABLE IF EXISTS t1;
+--- Start test 4 partition HASH testing ---
+--- Do setup ---
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63),
+bc CHAR(63), d DECIMAL(10,4) DEFAULT 0,
+f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+y YEAR, t DATE)
+TABLESPACE ts1 STORAGE DISK
+ENGINE=NDB
+PARTITION BY HASH( YEAR(t) )
+PARTITIONS 4;
+--- show that tables have been created correctly ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(63) DEFAULT NULL,
+ `bc` char(63) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(63) DEFAULT NULL,
+ `bc` char(63) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- Check that simple Alter statements are replicated correctly ---
+ALTER TABLE t1 MODIFY vc VARCHAR(255);
+--- Show the new improved table on the master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(63) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+--- Make sure that our tables on slave are still same engine ---
+--- and that the alter statements replicated correctly ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(63) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- End test 4 partition HASH testing ---
+--- Do Cleanup --
+DROP TABLE IF EXISTS t1;
+--- Start test 5 partition by key testing ---
+--- Create Table Section ---
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63),
+bc CHAR(63), d DECIMAL(10,4) DEFAULT 0,
+f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+y YEAR, t DATE,PRIMARY KEY(id))
+TABLESPACE ts1 STORAGE DISK
+ENGINE=NDB
+PARTITION BY KEY()
+PARTITIONS 4;
+--- Show that tables on master are ndbcluster tables ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(63) DEFAULT NULL,
+ `bc` char(63) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+--- Show that tables on slave ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(63) DEFAULT NULL,
+ `bc` char(63) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- Check that simple Alter statements are replicated correctly ---
+ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total);
+--- Show the new improved table on the master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(63) DEFAULT NULL,
+ `bc` char(63) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`,`total`)
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+--- Make sure that our tables on slave are still right type ---
+--- and that the alter statements replicated correctly ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(63) DEFAULT NULL,
+ `bc` char(63) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`,`total`)
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- Check that simple Alter statements are replicated correctly ---
+ALTER TABLE t1 MODIFY vc VARCHAR(255);
+--- Show the new improved table on the master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(63) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`,`total`)
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+--- Make sure that our tables on slave are still same engine ---
+--- and that the alter statements replicated correctly ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(63) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`,`total`)
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- End test 5 key partition testing ---
+--- Do Cleanup ---
+DROP TABLE IF EXISTS t1;
+alter tablespace ts1
+drop datafile 'datafile.dat'
+engine=ndb;
+alter tablespace ts1
+drop datafile 'datafile02.dat'
+engine=ndb;
+DROP TABLESPACE ts1 ENGINE=NDB;
+DROP LOGFILE GROUP lg1 ENGINE=NDB;
diff --git a/mysql-test/r/rpl_ndb_ddl.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_ddl.result
index aeaca1e7de0..aeaca1e7de0 100644
--- a/mysql-test/r/rpl_ndb_ddl.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_ddl.result
diff --git a/mysql-test/r/rpl_ndb_delete_nowhere.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_delete_nowhere.result
index 1cecb030181..1cecb030181 100644
--- a/mysql-test/r/rpl_ndb_delete_nowhere.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_delete_nowhere.result
diff --git a/mysql-test/r/rpl_ndb_do_db.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_do_db.result
index 316f5fc7e31..316f5fc7e31 100644
--- a/mysql-test/r/rpl_ndb_do_db.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_do_db.result
diff --git a/mysql-test/r/rpl_ndb_do_table.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_do_table.result
index dda2844f6d0..dda2844f6d0 100644
--- a/mysql-test/r/rpl_ndb_do_table.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_do_table.result
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result
new file mode 100644
index 00000000000..41e888827b1
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result
@@ -0,0 +1,849 @@
+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;
+**** Diff Table Def Start ****
+*** On Slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t1 (a INT, b INT PRIMARY KEY, c CHAR(20),
+d FLOAT DEFAULT '2.00',
+e CHAR(4) DEFAULT 'TEST')
+ENGINE='NDB';
+*** Create t1 on Master ***
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c CHAR(10)
+) ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t1 () VALUES(1,2,'TEXAS'),(2,1,'AUSTIN'),(3,4,'QA');
+SELECT * FROM t1 ORDER BY a;
+a b c
+1 2 TEXAS
+2 1 AUSTIN
+3 4 QA
+*** Select from slave ***
+SELECT * FROM t1 ORDER BY a;
+a b c d e
+1 2 TEXAS NULL NULL
+2 1 AUSTIN NULL NULL
+3 4 QA NULL NULL
+*** Drop t1 ***
+DROP TABLE t1;
+*** Create t2 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t2 (a INT, b INT PRIMARY KEY, c CHAR(5),
+d FLOAT DEFAULT '2.00',
+e CHAR(5) DEFAULT 'TEST2')
+ENGINE='NDB';
+*** Create t2 on Master ***
+CREATE TABLE t2 (a INT PRIMARY KEY, b INT, c CHAR(10)
+) ENGINE='NDB';
+RESET MASTER;
+*** Master Data Insert ***
+INSERT INTO t2 () VALUES(1,2,'Kyle, TEX'),(2,1,'JOE AUSTIN'),(3,4,'QA TESTING');
+SELECT * FROM t2 ORDER BY a;
+a b c
+1 2 Kyle, TEX
+2 1 JOE AUSTIN
+3 4 QA TESTING
+*** Start Slave ***
+START SLAVE;
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_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.
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+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.
+STOP SLAVE;
+RESET SLAVE;
+SELECT * FROM t2 ORDER BY a;
+a b c d e
+RESET MASTER;
+START SLAVE;
+*** Drop t2 ***
+DROP TABLE t2;
+*** Create t3 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t3 (a INT, b INT PRIMARY KEY, c CHAR(20),
+d FLOAT DEFAULT '2.00',
+e CHAR(5) DEFAULT 'TEST2')
+ENGINE='NDB';
+*** Create t3 on Master ***
+CREATE TABLE t3 (a BLOB, b INT PRIMARY KEY, c CHAR(20)
+) ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TESTING');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t3 ***
+DROP TABLE t3;
+*** Create t4 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t4 (a INT, b INT PRIMARY KEY, c CHAR(20),
+d FLOAT DEFAULT '2.00',
+e CHAR(5) DEFAULT 'TEST2')
+ENGINE='NDB';
+*** Create t4 on Master ***
+CREATE TABLE t4 (a DECIMAL(8,2), b INT PRIMARY KEY, c CHAR(20)
+) ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'),
+(30000.22,4,'QA TESTING');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t4 ***
+DROP TABLE t4;
+*** Create t5 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t5 (a INT PRIMARY KEY, b CHAR(5),
+c FLOAT, d INT, e DOUBLE,
+f DECIMAL(8,2))ENGINE='NDB';
+*** Create t5 on Master ***
+CREATE TABLE t5 (a INT PRIMARY KEY, b VARCHAR(6),
+c DECIMAL(8,2), d BIT, e BLOB,
+f FLOAT) ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
+(2,'JOE',300.01,0,'b2b2',1.0000009);
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+Last_SQL_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t5 ***
+DROP TABLE t5;
+*** Create t6 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t6 (a INT PRIMARY KEY, b CHAR(5),
+c FLOAT, d INT)ENGINE='NDB';
+*** Create t6 on Master ***
+CREATE TABLE t6 (a INT PRIMARY KEY, b VARCHAR(6),
+c DECIMAL(8,2), d BIT
+) ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
+(2,'JOE',300.01,0);
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+Last_SQL_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
+*** Drop t6 ***
+DROP TABLE t6;
+DROP TABLE t6;
+START SLAVE;
+**** Diff Table Def End ****
+**** Extra Colums Start ****
+*** Create t7 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t7 (a INT KEY, b BLOB, c CHAR(5),
+d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
+e CHAR(20) DEFAULT 'Extra Column Testing')
+ENGINE='NDB';
+*** Create t7 on Master ***
+CREATE TABLE t7 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t7 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+SELECT * FROM t7 ORDER BY a;
+a b c
+1 b1b1 Kyle
+2 b1b1 JOE
+3 b1b1 QA
+*** Select from slave ***
+SELECT * FROM t7 ORDER BY a;
+a b c d e
+1 b1b1 Kyle NULL NULL
+2 b1b1 JOE NULL NULL
+3 b1b1 QA NULL NULL
+*** Drop t7 ***
+DROP TABLE t7;
+*** Create t8 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t8 (a INT KEY, b BLOB, c CHAR(5),
+d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
+e INT)ENGINE='NDB';
+*** Create t8 on Master ***
+CREATE TABLE t8 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t8 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+*** Drop t8 ***
+DROP TABLE t8;
+*** Create t10 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
+c CHAR(5), e INT DEFAULT '1')ENGINE='NDB';
+*** Create t10 on Master ***
+CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t10 ***
+DROP TABLE t10;
+*** Create t11 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
+c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='NDB';
+*** Create t11 on Master ***
+CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
+) ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t11 ***
+DROP TABLE t11;
+*** Create t12 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
+c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='NDB';
+*** Create t12 on Master ***
+CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
+) ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t12 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+SELECT * FROM t12 ORDER BY a;
+a b c
+1 b1b1b1b1b1b1b1b1 Kyle
+2 b1b1b1b1b1b1b1b1 JOE
+3 b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ***
+SELECT * FROM t12 ORDER BY a;
+a b f c e
+1 b1b1b1b1b1b1b1b1 Kyle NULL NULL
+2 b1b1b1b1b1b1b1b1 JOE NULL NULL
+3 b1b1b1b1b1b1b1b1 QA NULL NULL
+*** Drop t12 ***
+DROP TABLE t12;
+**** Extra Colums End ****
+*** BUG 22177 Start ***
+*** Create t13 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t13 (a INT KEY, b BLOB, c CHAR(5),
+d INT DEFAULT '1',
+e TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='NDB';
+*** Create t13 on Master ***
+CREATE TABLE t13 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t13 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+SELECT * FROM t13 ORDER BY a;
+a b c
+1 b1b1b1b1b1b1b1b1 Kyle
+2 b1b1b1b1b1b1b1b1 JOE
+3 b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t13 ORDER BY a;
+a b c d e
+1 b1b1b1b1b1b1b1b1 Kyle NULL CURRENT_TIMESTAMP
+2 b1b1b1b1b1b1b1b1 JOE NULL CURRENT_TIMESTAMP
+3 b1b1b1b1b1b1b1b1 QA NULL CURRENT_TIMESTAMP
+*** Drop t13 ***
+DROP TABLE t13;
+*** 22117 END ***
+*** Alter Master Table Testing Start ***
+*** Create t14 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='NDB';
+*** Create t14 on Master ***
+CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+) ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
+ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
+(2,2.00,'This Test Should work',@b1,'JOE'),
+(3,3.00,'If is does not, I will open a bug',@b1,'QA');
+SELECT * FROM t14 ORDER BY c1;
+c1 c2 c3 c4 c5
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t14 ORDER BY c1;
+c1 c2 c3 c4 c5 c6 c7
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL CURRENT_TIMESTAMP
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL CURRENT_TIMESTAMP
+*** connect to master and drop columns ***
+ALTER TABLE t14 DROP COLUMN c2;
+ALTER TABLE t14 DROP COLUMN c4;
+*** Select from Master ***
+SELECT * FROM t14 ORDER BY c1;
+c1 c3 c5
+1 Replication Testing Extra Col Kyle
+2 This Test Should work JOE
+3 If is does not, I will open a bug QA
+*** Select from Slave ***
+SELECT * FROM t14 ORDER BY c1;
+c1 c3 c5 c6 c7
+1 Replication Testing Extra Col Kyle NULL CURRENT_TIMESTAMP
+2 This Test Should work JOE NULL CURRENT_TIMESTAMP
+3 If is does not, I will open a bug QA NULL CURRENT_TIMESTAMP
+*** Drop t14 ***
+DROP TABLE t14;
+*** Create t15 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t15 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
+c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='NDB';
+*** Create t15 on Master ***
+CREATE TABLE t15 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
+c4 BLOB, c5 CHAR(5)) ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t15 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
+(2,2.00,'This Test Should work',@b1,'JOE'),
+(3,3.00,'If is does not, I will open a bug',@b1,'QA');
+SELECT * FROM t15 ORDER BY c1;
+c1 c2 c3 c4 c5
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t15 ORDER BY c1;
+c1 c2 c3 c4 c5 c6 c7
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL CURRENT_TIMESTAMP
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL CURRENT_TIMESTAMP
+*** Add column on master that is a Extra on Slave ***
+ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
+********************************************
+*** Expect slave to fail with Error 1060 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1060
+Last_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5'
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1060
+Last_SQL_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5'
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Try to insert in master ****
+INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2);
+SELECT * FROM t15 ORDER BY c1;
+c1 c2 c3 c4 c5 c6
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL
+5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2
+*** Try to select from slave ****
+SELECT * FROM t15 ORDER BY c1;
+c1 c2 c3 c4 c5 c6 c7
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL CURRENT_TIMESTAMP
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL CURRENT_TIMESTAMP
+5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2 CURRENT_TIMESTAMP
+*** DROP TABLE t15 ***
+DROP TABLE t15;
+*** Create t16 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t16 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
+c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='NDB';
+*** Create t16 on Master ***
+CREATE TABLE t16 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
+c4 BLOB, c5 CHAR(5))ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t16 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
+(2,2.00,'This Test Should work',@b1,'JOE'),
+(3,3.00,'If is does not, I will open a bug',@b1,'QA');
+SELECT * FROM t16 ORDER BY c1;
+c1 c2 c3 c4 c5
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t16 ORDER BY c1;
+c1 c2 c3 c4 c5 c6 c7
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL CURRENT_TIMESTAMP
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL CURRENT_TIMESTAMP
+*** Add Partition on master ***
+ALTER TABLE t16 PARTITION BY KEY(c1) PARTITIONS 4;
+INSERT INTO t16 () VALUES(4,1.00,'Replication Rocks',@b1,'Omer');
+SHOW CREATE TABLE t16;
+Table Create Table
+t16 CREATE TABLE `t16` (
+ `c1` int(11) NOT NULL,
+ `c2` decimal(8,2) DEFAULT NULL,
+ `c3` text,
+ `c4` blob,
+ `c5` char(5) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
+*** Show table on Slave ****
+SHOW CREATE TABLE t16;
+Table Create Table
+t16 CREATE TABLE `t16` (
+ `c1` int(11) NOT NULL,
+ `c2` decimal(8,2) DEFAULT NULL,
+ `c3` text,
+ `c4` blob,
+ `c5` char(5) DEFAULT NULL,
+ `c6` int(11) DEFAULT '1',
+ `c7` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
+*** DROP TABLE t16 ***
+DROP TABLE t16;
+*** Alter Master End ***
+*** Create t17 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t17 (a SMALLINT, b INT PRIMARY KEY, c CHAR(5),
+d FLOAT DEFAULT '2.00',
+e CHAR(5) DEFAULT 'TEST2')
+ENGINE='NDB';
+*** Create t17 on Master ***
+CREATE TABLE t17 (a BIGINT PRIMARY KEY, b INT, c CHAR(10)
+) ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port #
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+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 1534
+Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2
+Skip_Counter 0
+Exec_Master_Log_Pos #
+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 1534
+Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+** DROP table t17 ***
+DROP TABLE t17;
diff --git a/mysql-test/r/rpl_ndb_func003.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_func003.result
index ad72a3fb244..ad72a3fb244 100644
--- a/mysql-test/r/rpl_ndb_func003.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_func003.result
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result
new file mode 100644
index 00000000000..e2fee391bab
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result
@@ -0,0 +1,73 @@
+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 (c1 CHAR(15), c2 CHAR(15), c3 INT, PRIMARY KEY (c3)) ENGINE = NDB ;
+INSERT INTO t1 VALUES ("row1","will go away",1);
+SELECT * FROM t1 ORDER BY c3;
+c1 c2 c3
+row1 will go away 1
+SELECT @the_epoch:=MAX(epoch) FROM mysql.ndb_apply_status;
+@the_epoch:=MAX(epoch)
+<the_epoch>
+SELECT * FROM t1 ORDER BY c3;
+c1 c2 c3
+row1 will go away 1
+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)
+<the_pos> master-bin.000001
+INSERT INTO t1 VALUES ("row2","will go away",2),("row3","will change",3),("row4","D",4);
+DELETE FROM t1 WHERE c3 = 1;
+UPDATE t1 SET c2="should go away" WHERE c3 = 2;
+UPDATE t1 SET c2="C" WHERE c3 = 3;
+DELETE FROM t1 WHERE c3 = 2;
+SELECT * FROM t1 ORDER BY c3;
+c1 c2 c3
+row3 C 3
+row4 D 4
+SELECT * FROM t1 ORDER BY c3;
+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
+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
+START SLAVE;
+SELECT * FROM t1 ORDER BY c3;
+c1 c2 c3
+row3 C 3
+row4 D 4
+SELECT * FROM t1 ORDER BY c3;
+c1 c2 c3
+row3 C 3
+row4 D 4
+STOP SLAVE;
+DROP TABLE t1;
+RESET master;
+DROP TABLE t1;
+RESET slave;
+START SLAVE;
+CREATE TABLE t1 (c1 CHAR(15) NOT NULL, c2 CHAR(15) NOT NULL, c3 INT NOT NULL, PRIMARY KEY (c3)) ENGINE = NDB ;
+INSERT INTO t1 VALUES ("row1","remove on slave",1);
+DELETE FROM t1;
+BEGIN;
+UPDATE t1 SET c2="does not exist" WHERE c3=1;
+INSERT INTO t1 VALUES ("row2","new on slave",2);
+COMMIT;
+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
+DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result
new file mode 100644
index 00000000000..cf4c67f063b
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result
@@ -0,0 +1,855 @@
+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;
+SET storage_engine=innodb;
+--- Doing pre test cleanup ---
+DROP TABLE IF EXISTS t1;
+--- Start test 1 Basic testing ---
+--- Create Table Section ---
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
+bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
+f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+y YEAR, t DATE,PRIMARY KEY(id));
+--- Show table on master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+--- Show table on slave ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- Check that simple Alter statements are replicated correctly --
+ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total);
+ALTER TABLE t1 MODIFY vc TEXT;
+--- Show the new improved table on the master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`,`total`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+--- Make sure that our tables on slave are still same engine ---
+--- and that the alter statements replicated correctly ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`,`total`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- End test 1 Basic testing ---
+--- Do Cleanup --
+DROP TABLE IF EXISTS t1;
+--- Start test 2 partition RANGE testing --
+--- Do setup --
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
+bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
+f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+y YEAR, t DATE)
+PARTITION BY RANGE (YEAR(t))
+(PARTITION p0 VALUES LESS THAN (1901),
+PARTITION p1 VALUES LESS THAN (1946),
+PARTITION p2 VALUES LESS THAN (1966),
+PARTITION p3 VALUES LESS THAN (1986),
+PARTITION p4 VALUES LESS THAN (2005),
+PARTITION p5 VALUES LESS THAN MAXVALUE);
+--- Show table on master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = InnoDB, PARTITION p1 VALUES LESS THAN (1946) ENGINE = InnoDB, PARTITION p2 VALUES LESS THAN (1966) ENGINE = InnoDB, PARTITION p3 VALUES LESS THAN (1986) ENGINE = InnoDB, PARTITION p4 VALUES LESS THAN (2005) ENGINE = InnoDB, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
+--- Show table on slave --
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- Check that simple Alter statements are replicated correctly ---
+ALTER TABLE t1 ADD PRIMARY KEY(t,id);
+ALTER TABLE t1 MODIFY vc TEXT;
+--- Show the new improved table on the master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date NOT NULL DEFAULT '0000-00-00',
+ PRIMARY KEY (`t`,`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = InnoDB, PARTITION p1 VALUES LESS THAN (1946) ENGINE = InnoDB, PARTITION p2 VALUES LESS THAN (1966) ENGINE = InnoDB, PARTITION p3 VALUES LESS THAN (1986) ENGINE = InnoDB, PARTITION p4 VALUES LESS THAN (2005) ENGINE = InnoDB, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
+--- Make sure that our tables on slave are still same engine ---
+--- and that the alter statements replicated correctly ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date NOT NULL DEFAULT '0000-00-00',
+ PRIMARY KEY (`t`,`id`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- End test 2 partition RANGE testing ---
+--- Do Cleanup ---
+DROP TABLE IF EXISTS t1;
+--- Start test 3 partition LIST testing ---
+--- Do setup ---
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
+bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
+f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+y YEAR, t DATE)
+PARTITION BY LIST(id)
+(PARTITION p0 VALUES IN (2, 4),
+PARTITION p1 VALUES IN (42, 142));
+--- Test 3 Alter to add partition ---
+ALTER TABLE t1 ADD PARTITION (PARTITION p2 VALUES IN (412));
+--- Show table on master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = InnoDB, PARTITION p1 VALUES IN (42,142) ENGINE = InnoDB, PARTITION p2 VALUES IN (412) ENGINE = InnoDB) */
+--- Show table on slave ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- Check that simple Alter statements are replicated correctly ---
+ALTER TABLE t1 ADD PRIMARY KEY(id);
+ALTER TABLE t1 MODIFY vc TEXT;
+--- Show the new improved table on the master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = InnoDB, PARTITION p1 VALUES IN (42,142) ENGINE = InnoDB, PARTITION p2 VALUES IN (412) ENGINE = InnoDB) */
+--- Make sure that our tables on slave are still same engine ---
+--- and that the alter statements replicated correctly ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- End test 3 partition LIST testing ---
+--- Do Cleanup --
+DROP TABLE IF EXISTS t1;
+--- Start test 4 partition HASH testing ---
+--- Do setup ---
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
+bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
+f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+y YEAR, t DATE)
+PARTITION BY HASH( YEAR(t) )
+PARTITIONS 4;
+--- show that tables have been created correctly ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- Check that simple Alter statements are replicated correctly ---
+ALTER TABLE t1 ADD PRIMARY KEY(t,id);
+ALTER TABLE t1 MODIFY vc TEXT;
+--- Show the new improved table on the master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date NOT NULL DEFAULT '0000-00-00',
+ PRIMARY KEY (`t`,`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+--- Make sure that our tables on slave are still same engine ---
+--- and that the alter statements replicated correctly ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date NOT NULL DEFAULT '0000-00-00',
+ PRIMARY KEY (`t`,`id`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- End test 4 partition HASH testing ---
+--- Do Cleanup --
+DROP TABLE IF EXISTS t1;
+--- Start test 5 partition by key testing ---
+--- Create Table Section ---
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
+bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
+f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+y YEAR, t DATE,PRIMARY KEY(id))
+PARTITION BY KEY()
+PARTITIONS 4;
+--- Show that tables on master are ndbcluster tables ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+--- Show that tables on slave ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- Check that simple Alter statements are replicated correctly ---
+ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total);
+--- Show the new improved table on the master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`,`total`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+--- Make sure that our tables on slave are still right type ---
+--- and that the alter statements replicated correctly ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`,`total`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- Check that simple Alter statements are replicated correctly ---
+ALTER TABLE t1 MODIFY vc TEXT;
+--- Show the new improved table on the master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`,`total`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+--- Make sure that our tables on slave are still same engine ---
+--- and that the alter statements replicated correctly ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`,`total`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- End test 5 key partition testing ---
+--- Do Cleanup ---
+DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/r/rpl_ndb_innodb_trans.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb_trans.result
index 148e6247b03..148e6247b03 100644
--- a/mysql-test/r/rpl_ndb_innodb_trans.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb_trans.result
diff --git a/mysql-test/r/rpl_ndb_insert_ignore.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_insert_ignore.result
index 030845e89e2..030845e89e2 100644
--- a/mysql-test/r/rpl_ndb_insert_ignore.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_insert_ignore.result
diff --git a/mysql-test/r/rpl_ndb_load.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_load.result
index e51f0096557..e51f0096557 100644
--- a/mysql-test/r/rpl_ndb_load.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_load.result
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result
new file mode 100644
index 00000000000..326506b0396
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result
@@ -0,0 +1,326 @@
+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;
+reset master;
+reset slave;
+reset master;
+create table t1(n int not null auto_increment primary key)ENGINE=NDB;
+insert into t1 values (NULL);
+drop table t1;
+create table t1 (word char(20) not null)ENGINE=NDB;
+load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines;
+select count(*) from t1;
+count(*)
+69
+show binlog events;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
+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
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+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
+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=NDB
+master-bin.000001 # Query 1 # BEGIN
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+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;
+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;
+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;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+flush logs;
+create table t3 (a int)ENGINE=NDB;
+select * from t1 order by 1 asc;
+word
+Aarhus
+Aaron
+Aaron
+Ababa
+Ababa
+aback
+aback
+abaft
+abaft
+abandon
+abandon
+abandoned
+abandoned
+abandoning
+abandoning
+abandonment
+abandonment
+abandons
+abandons
+abase
+abased
+abasement
+abasements
+abases
+abash
+abashed
+abashes
+abashing
+abasing
+abate
+abated
+abatement
+abatements
+abater
+abates
+abating
+Abba
+abbe
+abbey
+abbeys
+abbot
+abbots
+Abbott
+abbreviate
+abbreviated
+abbreviates
+abbreviating
+abbreviation
+abbreviations
+Abby
+abdomen
+abdomens
+abdominal
+abduct
+abducted
+abduction
+abductions
+abductor
+abductors
+abducts
+Abe
+abed
+Abel
+Abelian
+Abelson
+Aberdeen
+Abernathy
+aberrant
+aberration
+start slave;
+
+let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%' ;
+
+--source include/wait_slave_status.inc
+select * from t1 order by 1 asc;
+word
+Aarhus
+Aaron
+Aaron
+Ababa
+Ababa
+aback
+aback
+abaft
+abaft
+abandon
+abandon
+abandoned
+abandoned
+abandoning
+abandoning
+abandonment
+abandonment
+abandons
+abandons
+abase
+abased
+abasement
+abasements
+abases
+abash
+abashed
+abashes
+abashing
+abasing
+abate
+abated
+abatement
+abatements
+abater
+abates
+abating
+Abba
+abbe
+abbey
+abbeys
+abbot
+abbots
+Abbott
+abbreviate
+abbreviated
+abbreviates
+abbreviating
+abbreviation
+abbreviations
+Abby
+abdomen
+abdomens
+abdominal
+abduct
+abducted
+abduction
+abductions
+abductor
+abductors
+abducts
+Abe
+abed
+Abel
+Abelian
+Abelson
+Aberdeen
+Abernathy
+aberrant
+aberration
+flush logs;
+stop slave;
+create table t2 (n int)ENGINE=NDB;
+insert into t2 values (1);
+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(n int not null auto_increment primary key)ENGINE=NDB
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Query # # use `test`; drop table t1
+master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=NDB
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
+master-bin.000001 # Write_rows # # table_id: #
+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
+show binlog events in 'master-bin.000002';
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
+master-bin.000002 # Query 1 # use `test`; create table t3 (a int)ENGINE=NDB
+master-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=NDB
+master-bin.000002 # Query 1 # BEGIN
+master-bin.000002 # Table_map 1 # table_id: # (test.t2)
+master-bin.000002 # Table_map 1 # table_id: # (mysql.ndb_apply_status)
+master-bin.000002 # Write_rows 1 # table_id: #
+master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000002 # Query 1 # COMMIT
+show binary logs;
+Log_name File_size
+master-bin.000001 1760
+master-bin.000002 623
+start slave;
+show binary logs;
+Log_name File_size
+slave-bin.000001 1855
+slave-bin.000002 202
+show binlog events in 'slave-bin.000001' from 4;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
+slave-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB
+slave-bin.000001 # Query 2 # BEGIN
+slave-bin.000001 # Table_map 2 # table_id: # (test.t1)
+slave-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status)
+slave-bin.000001 # Write_rows 2 # table_id: #
+slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query 2 # COMMIT
+slave-bin.000001 # Query 1 # use `test`; drop table t1
+slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=NDB
+slave-bin.000001 # Query 2 # BEGIN
+slave-bin.000001 # Table_map 2 # table_id: # (test.t1)
+slave-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status)
+slave-bin.000001 # Write_rows 2 # table_id: #
+slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+slave-bin.000001 # Query 2 # COMMIT
+slave-bin.000001 # Query 1 # use `test`; create table t3 (a int)ENGINE=NDB
+slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4
+show binlog events in 'slave-bin.000002' from 4;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
+slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=NDB
+slave-bin.000002 # Query 2 # BEGIN
+slave-bin.000002 # Table_map 2 # table_id: # (test.t2)
+slave-bin.000002 # Table_map 2 # table_id: # (mysql.ndb_apply_status)
+slave-bin.000002 # Write_rows 2 # table_id: #
+slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
+slave-bin.000002 # Query 2 # COMMIT
+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.000002
+Read_Master_Log_Pos 623
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000002
+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 623
+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
+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;
+DROP TABLE t2;
+DROP TABLE t3;
+create table t1(a int auto_increment primary key, b int);
+insert into t1 values (NULL, 1);
+reset master;
+set insert_id=5;
+insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+select * from t1;
+a b
+1 1
+5 1
+6 1
+drop table t1;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_mix_innodb.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_mix_innodb.result
new file mode 100644
index 00000000000..625d06de44b
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_mix_innodb.result
@@ -0,0 +1,129 @@
+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;
+
+*** Test 1 ***
+
+create table t1 (a int key, b int) engine innodb;
+create table t2 (a int key, b int) engine innodb;
+
+alter table t1 engine ndb;
+alter table t2 engine ndb;
+
+insert into t1 values (1,2);
+
+select @log_name:=log_name, @start_pos:=start_pos, @end_pos:=end_pos
+from mysql.ndb_apply_status;
+@log_name:=log_name @start_pos:=start_pos @end_pos:=end_pos
+<log_name> <start_pos> <end_pos>
+
+show binlog events from <start_pos> limit 1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 <start_pos> Query 1 # use `test`; insert into t1 values (1,2)
+
+show binlog events from <start_pos> limit 1,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Xid 1 445 COMMIT /* XID */
+
+begin;
+insert into t1 values (2,3);
+insert into t2 values (3,4);
+commit;
+
+select @log_name:=log_name, @start_pos:=start_pos, @end_pos:=end_pos
+from mysql.ndb_apply_status;
+@log_name:=log_name @start_pos:=start_pos @end_pos:=end_pos
+<log_name> <start_pos> <end_pos>
+show binlog events from <start_pos> limit 1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 <start_pos> Query 1 # use `test`; BEGIN
+
+show binlog events from <start_pos> limit 1,2;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; insert into t1 values (2,3)
+master-bin.000001 # Query # # use `test`; insert into t2 values (3,4)
+
+show binlog events from <start_pos> limit 3,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Xid 1 <end_pos> COMMIT /* XID */
+
+DROP TABLE test.t1, test.t2;
+SHOW TABLES;
+Tables_in_test
+
+*** Test 2 ***
+
+DROP DATABASE IF EXISTS tpcb;
+CREATE DATABASE tpcb;
+
+CREATE TABLE tpcb.account (id INT, bid INT, balance DECIMAL(10,2),
+filler CHAR(255), PRIMARY KEY(id));
+
+CREATE TABLE tpcb.branch (bid INT, balance DECIMAL(10,2), filler VARCHAR(255),
+PRIMARY KEY(bid));
+
+CREATE TABLE tpcb.teller (tid INT, balance DECIMAL(10,2), filler VARCHAR(255),
+PRIMARY KEY(tid));
+
+CREATE TABLE tpcb.history (id MEDIUMINT NOT NULL AUTO_INCREMENT,aid INT,
+tid INT, bid INT, amount DECIMAL(10,2),
+tdate DATETIME, teller CHAR(20), uuidf LONGBLOB,
+filler CHAR(80),PRIMARY KEY (id));
+
+--- Create stored procedures & functions ---
+
+
+*** Stored Procedures Created ***
+
+USE tpcb;
+ALTER TABLE account ENGINE NDB;
+ALTER TABLE branch ENGINE NDB;
+ALTER TABLE teller ENGINE NDB;
+ALTER TABLE history ENGINE NDB;
+
+select @log_name:=log_name, @start_pos:=start_pos, @end_pos:=end_pos
+from mysql.ndb_apply_status;
+@log_name:=log_name @start_pos:=start_pos @end_pos:=end_pos
+<log_name> <start_pos> <end_pos>
+
+show binlog events in 'master-bin.000001' from <start_pos> limit 9,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Xid 1 <end_pos> COMMIT /* XID */
+
+** Test 3 **
+
+FLUSH LOGS;
+
+select @log_name:=log_name, @start_pos:=start_pos, @end_pos:=end_pos
+from mysql.ndb_apply_status;
+@log_name:=log_name @start_pos:=start_pos @end_pos:=end_pos
+<log_name> <start_pos> <end_pos>
+
+show binlog events in 'master-bin.000002' from <start_pos> limit 9,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Xid 1 <end_pos> COMMIT /* XID */
+
+** Test 4 **
+
+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;
+
+select @log_name:=log_name, @start_pos:=start_pos, @end_pos:=end_pos
+from mysql.ndb_apply_status;
+@log_name:=log_name @start_pos:=start_pos @end_pos:=end_pos
+<log_name> <start_pos> <end_pos>
+
+show binlog events in 'master-bin.000001' from <start_pos> limit 9,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Xid 1 <end_pos> COMMIT /* XID */
+
+*** DUMP MASTER & SLAVE FOR COMPARE ********
+DROP DATABASE tpcb;
+****** Do dumps compare ************
diff --git a/mysql-test/r/rpl_ndb_multi.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result
index 760114f3639..760114f3639 100644
--- a/mysql-test/r/rpl_ndb_multi.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result
diff --git a/mysql-test/r/rpl_ndb_multi_update2.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update2.result
index 5d00ae6598c..5d00ae6598c 100644
--- a/mysql-test/r/rpl_ndb_multi_update2.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update2.result
diff --git a/mysql-test/r/rpl_ndb_multi_update3.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update3.result
index dc4e11c9c9e..dc4e11c9c9e 100644
--- a/mysql-test/r/rpl_ndb_multi_update3.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update3.result
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result
new file mode 100644
index 00000000000..35fc778a693
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result
@@ -0,0 +1,855 @@
+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;
+SET storage_engine=myisam;
+--- Doing pre test cleanup ---
+DROP TABLE IF EXISTS t1;
+--- Start test 1 Basic testing ---
+--- Create Table Section ---
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
+bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
+f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+y YEAR, t DATE,PRIMARY KEY(id));
+--- Show table on master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+--- Show table on slave ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- Check that simple Alter statements are replicated correctly --
+ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total);
+ALTER TABLE t1 MODIFY vc TEXT;
+--- Show the new improved table on the master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`,`total`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+--- Make sure that our tables on slave are still same engine ---
+--- and that the alter statements replicated correctly ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`,`total`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- End test 1 Basic testing ---
+--- Do Cleanup --
+DROP TABLE IF EXISTS t1;
+--- Start test 2 partition RANGE testing --
+--- Do setup --
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
+bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
+f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+y YEAR, t DATE)
+PARTITION BY RANGE (YEAR(t))
+(PARTITION p0 VALUES LESS THAN (1901),
+PARTITION p1 VALUES LESS THAN (1946),
+PARTITION p2 VALUES LESS THAN (1966),
+PARTITION p3 VALUES LESS THAN (1986),
+PARTITION p4 VALUES LESS THAN (2005),
+PARTITION p5 VALUES LESS THAN MAXVALUE);
+--- Show table on master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+--- Show table on slave --
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- Check that simple Alter statements are replicated correctly ---
+ALTER TABLE t1 ADD PRIMARY KEY(t,id);
+ALTER TABLE t1 MODIFY vc TEXT;
+--- Show the new improved table on the master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date NOT NULL DEFAULT '0000-00-00',
+ PRIMARY KEY (`t`,`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+--- Make sure that our tables on slave are still same engine ---
+--- and that the alter statements replicated correctly ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date NOT NULL DEFAULT '0000-00-00',
+ PRIMARY KEY (`t`,`id`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- End test 2 partition RANGE testing ---
+--- Do Cleanup ---
+DROP TABLE IF EXISTS t1;
+--- Start test 3 partition LIST testing ---
+--- Do setup ---
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
+bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
+f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+y YEAR, t DATE)
+PARTITION BY LIST(id)
+(PARTITION p0 VALUES IN (2, 4),
+PARTITION p1 VALUES IN (42, 142));
+--- Test 3 Alter to add partition ---
+ALTER TABLE t1 ADD PARTITION (PARTITION p2 VALUES IN (412));
+--- Show table on master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
+--- Show table on slave ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- Check that simple Alter statements are replicated correctly ---
+ALTER TABLE t1 ADD PRIMARY KEY(id);
+ALTER TABLE t1 MODIFY vc TEXT;
+--- Show the new improved table on the master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
+--- Make sure that our tables on slave are still same engine ---
+--- and that the alter statements replicated correctly ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- End test 3 partition LIST testing ---
+--- Do Cleanup --
+DROP TABLE IF EXISTS t1;
+--- Start test 4 partition HASH testing ---
+--- Do setup ---
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
+bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
+f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+y YEAR, t DATE)
+PARTITION BY HASH( YEAR(t) )
+PARTITIONS 4;
+--- show that tables have been created correctly ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- Check that simple Alter statements are replicated correctly ---
+ALTER TABLE t1 ADD PRIMARY KEY(t,id);
+ALTER TABLE t1 MODIFY vc TEXT;
+--- Show the new improved table on the master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date NOT NULL DEFAULT '0000-00-00',
+ PRIMARY KEY (`t`,`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+--- Make sure that our tables on slave are still same engine ---
+--- and that the alter statements replicated correctly ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date NOT NULL DEFAULT '0000-00-00',
+ PRIMARY KEY (`t`,`id`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- End test 4 partition HASH testing ---
+--- Do Cleanup --
+DROP TABLE IF EXISTS t1;
+--- Start test 5 partition by key testing ---
+--- Create Table Section ---
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
+bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
+f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+y YEAR, t DATE,PRIMARY KEY(id))
+PARTITION BY KEY()
+PARTITIONS 4;
+--- Show that tables on master are ndbcluster tables ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+--- Show that tables on slave ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- Check that simple Alter statements are replicated correctly ---
+ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total);
+--- Show the new improved table on the master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`,`total`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+--- Make sure that our tables on slave are still right type ---
+--- and that the alter statements replicated correctly ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`,`total`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- Check that simple Alter statements are replicated correctly ---
+ALTER TABLE t1 MODIFY vc TEXT;
+--- Show the new improved table on the master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`,`total`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+--- Make sure that our tables on slave are still same engine ---
+--- and that the alter statements replicated correctly ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`,`total`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */
+--- Perform basic operation on master ---
+--- and ensure replicated correctly ---
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+--- End test 5 key partition testing ---
+--- Do Cleanup ---
+DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/r/rpl_ndb_relayrotate.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_relayrotate.result
index 6aa64973611..6aa64973611 100644
--- a/mysql-test/r/rpl_ndb_relayrotate.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_relayrotate.result
diff --git a/mysql-test/r/rpl_ndb_rep_ignore.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_rep_ignore.result
index 4e28a7e5865..4e28a7e5865 100644
--- a/mysql-test/r/rpl_ndb_rep_ignore.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_rep_ignore.result
diff --git a/mysql-test/r/rpl_ndb_row_001.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result
index 56bb31e329d..56bb31e329d 100644
--- a/mysql-test/r/rpl_ndb_row_001.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result
diff --git a/mysql-test/r/rpl_ndb_sp003.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp003.result
index d7922c61b52..d7922c61b52 100644
--- a/mysql-test/r/rpl_ndb_sp003.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp003.result
diff --git a/mysql-test/r/rpl_ndb_sp006.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result
index 482d43c8f10..482d43c8f10 100644
--- a/mysql-test/r/rpl_ndb_sp006.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result
new file mode 100644
index 00000000000..426a09f945c
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result
@@ -0,0 +1,129 @@
+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;
+
+*** Test 1 ***
+
+create table t1 (a int key, b int) engine innodb;
+create table t2 (a int key, b int) engine innodb;
+
+alter table t1 engine ndb;
+alter table t2 engine ndb;
+
+insert into t1 values (1,2);
+
+select @log_name:=log_name, @start_pos:=start_pos, @end_pos:=end_pos
+from mysql.ndb_apply_status;
+@log_name:=log_name @start_pos:=start_pos @end_pos:=end_pos
+<log_name> <start_pos> <end_pos>
+
+show binlog events from <start_pos> limit 1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 <start_pos> Query 1 # use `test`; insert into t1 values (1,2)
+
+show binlog events from <start_pos> limit 1,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Xid 1 445 COMMIT /* XID */
+
+begin;
+insert into t1 values (2,3);
+insert into t2 values (3,4);
+commit;
+
+select @log_name:=log_name, @start_pos:=start_pos, @end_pos:=end_pos
+from mysql.ndb_apply_status;
+@log_name:=log_name @start_pos:=start_pos @end_pos:=end_pos
+<log_name> <start_pos> <end_pos>
+show binlog events from <start_pos> limit 1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 <start_pos> Query 1 # use `test`; BEGIN
+
+show binlog events from <start_pos> limit 1,2;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; insert into t1 values (2,3)
+master-bin.000001 # Query # # use `test`; insert into t2 values (3,4)
+
+show binlog events from <start_pos> limit 3,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Xid 1 <end_pos> COMMIT /* XID */
+
+DROP TABLE test.t1, test.t2;
+SHOW TABLES;
+Tables_in_test
+
+*** Test 2 ***
+
+DROP DATABASE IF EXISTS tpcb;
+CREATE DATABASE tpcb;
+
+CREATE TABLE tpcb.account (id INT, bid INT, balance DECIMAL(10,2),
+filler CHAR(255), PRIMARY KEY(id));
+
+CREATE TABLE tpcb.branch (bid INT, balance DECIMAL(10,2), filler VARCHAR(255),
+PRIMARY KEY(bid));
+
+CREATE TABLE tpcb.teller (tid INT, balance DECIMAL(10,2), filler VARCHAR(255),
+PRIMARY KEY(tid));
+
+CREATE TABLE tpcb.history (id MEDIUMINT NOT NULL AUTO_INCREMENT,aid INT,
+tid INT, bid INT, amount DECIMAL(10,2),
+tdate DATETIME, teller CHAR(20), uuidf LONGBLOB,
+filler CHAR(80),PRIMARY KEY (id));
+
+--- Create stored procedures & functions ---
+
+
+*** Stored Procedures Created ***
+
+USE tpcb;
+ALTER TABLE account ENGINE NDB;
+ALTER TABLE branch ENGINE NDB;
+ALTER TABLE teller ENGINE NDB;
+ALTER TABLE history ENGINE NDB;
+
+select @log_name:=log_name, @start_pos:=start_pos, @end_pos:=end_pos
+from mysql.ndb_apply_status;
+@log_name:=log_name @start_pos:=start_pos @end_pos:=end_pos
+<log_name> <start_pos> <end_pos>
+
+show binlog events in 'master-bin.000001' from <start_pos> limit 6,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Xid 1 <end_pos> COMMIT /* XID */
+
+** Test 3 **
+
+FLUSH LOGS;
+
+select @log_name:=log_name, @start_pos:=start_pos, @end_pos:=end_pos
+from mysql.ndb_apply_status;
+@log_name:=log_name @start_pos:=start_pos @end_pos:=end_pos
+<log_name> <start_pos> <end_pos>
+
+show binlog events in 'master-bin.000002' from <start_pos> limit 6,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Xid 1 <end_pos> COMMIT /* XID */
+
+** Test 4 **
+
+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;
+
+select @log_name:=log_name, @start_pos:=start_pos, @end_pos:=end_pos
+from mysql.ndb_apply_status;
+@log_name:=log_name @start_pos:=start_pos @end_pos:=end_pos
+<log_name> <start_pos> <end_pos>
+
+show binlog events in 'master-bin.000001' from <start_pos> limit 6,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Xid 1 <end_pos> COMMIT /* XID */
+
+*** DUMP MASTER & SLAVE FOR COMPARE ********
+DROP DATABASE tpcb;
+****** Do dumps compare ************
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result
new file mode 100644
index 00000000000..f2a1ba410b9
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result
@@ -0,0 +1,132 @@
+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;
+CREATE DATABASE ndbsynctest;
+USE ndbsynctest;
+CREATE DATABASE ndbsynctest;
+USE ndbsynctest;
+CREATE TABLE t1 (c1 BIT(1) NOT NULL, c2 BIT(1) NOT NULL, c3 CHAR(15), PRIMARY KEY(c3)) ENGINE = NDB ;
+INSERT INTO t1 VALUES (1,1,"row1"),(0,1,"row2"),(1,0,"row3"),(0,0,"row4");
+CREATE TABLE t2 (c1 CHAR(15), c2 BIT(1) NOT NULL, c3 BIT(1) NOT NULL, PRIMARY KEY(c1)) ENGINE = NDB ;
+INSERT INTO t2 VALUES ("ABC",1,1),("BCDEF",0,1),("CD",1,0),("DEFGHIJKL",0,0);
+SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
+hex(c1) hex(c2) c3
+1 1 row1
+0 1 row2
+1 0 row3
+0 0 row4
+SELECT hex(c2),hex(c3),c1 FROM t2 ORDER BY c1;
+hex(c2) hex(c3) c1
+1 1 ABC
+0 1 BCDEF
+1 0 CD
+0 0 DEFGHIJKL
+CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
+DELETE FROM test.backup_info;
+LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
+SELECT @the_backup_id:=backup_id FROM test.backup_info;
+@the_backup_id:=backup_id
+<the_backup_id>
+DROP TABLE test.backup_info;
+UPDATE t1 SET c2=0 WHERE c3="row2";
+SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
+hex(c1) hex(c2) c3
+1 1 row1
+0 0 row2
+1 0 row3
+0 0 row4
+SHOW TABLES;
+Tables_in_ndbsynctest
+DROP DATABASE ndbsynctest;
+CREATE DATABASE ndbsynctest;
+USE ndbsynctest;
+SHOW TABLES;
+Tables_in_ndbsynctest
+t1
+t2
+SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
+hex(c1) hex(c2) c3
+1 1 row1
+0 1 row2
+1 0 row3
+0 0 row4
+SELECT hex(c2),hex(c3),c1 FROM t2 ORDER BY c1;
+hex(c2) hex(c3) c1
+1 1 ABC
+0 1 BCDEF
+1 0 CD
+0 0 DEFGHIJKL
+SELECT @the_epoch:=MAX(epoch) FROM mysql.ndb_apply_status;
+@the_epoch:=MAX(epoch)
+<the_epoch>
+SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
+FROM mysql.ndb_binlog_index WHERE epoch > <the_epoch> ORDER BY epoch ASC LIMIT 1;
+@the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1)
+<the_pos> master-bin.000001
+CHANGE MASTER TO
+master_log_file = 'master-bin.000001',
+master_log_pos = <the_pos> ;
+START SLAVE;
+SHOW SLAVE STATUS;
+Slave_IO_State <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 <Read_Master_Log_Pos>
+Relay_Log_File <Relay_Log_File>
+Relay_Log_Pos <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_Ignore_Table>
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 0
+Last_Error
+Skip_Counter 0
+Exec_Master_Log_Pos <Exec_Master_Log_Pos>
+Relay_Log_Space <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 <Seconds_Behind_Master>
+Master_SSL_Verify_Server_Cert No
+Last_IO_Errno <Last_IO_Errno>
+Last_IO_Error <Last_IO_Error>
+Last_SQL_Errno 0
+Last_SQL_Error
+SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
+hex(c1) hex(c2) c3
+1 1 row1
+0 0 row2
+1 0 row3
+0 0 row4
+SELECT hex(c2),hex(c3),c1 FROM t2 ORDER BY c1;
+hex(c2) hex(c3) c1
+1 1 ABC
+0 1 BCDEF
+1 0 CD
+0 0 DEFGHIJKL
+DROP DATABASE ndbsynctest;
+STOP SLAVE;
+reset master;
+select * from mysql.ndb_binlog_index;
+Position File epoch inserts updates deletes schemaops
+reset slave;
+select * from mysql.ndb_apply_status;
+server_id epoch log_name start_pos end_pos
diff --git a/mysql-test/r/rpl_ndb_trig004.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_trig004.result
index ba5f0dea91c..ba5f0dea91c 100644
--- a/mysql-test/r/rpl_ndb_trig004.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_trig004.result
diff --git a/mysql-test/r/rpl_ndbapi_multi.result b/mysql-test/suite/rpl_ndb/r/rpl_ndbapi_multi.result
index 5de6914882d..5de6914882d 100644
--- a/mysql-test/r/rpl_ndbapi_multi.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndbapi_multi.result
diff --git a/mysql-test/r/rpl_row_basic_7ndb.result b/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result
index 5519e0dcd0c..5519e0dcd0c 100644
--- a/mysql-test/r/rpl_row_basic_7ndb.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result b/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result
new file mode 100644
index 00000000000..d6c57aed41b
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result
@@ -0,0 +1,91 @@
+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;
+**** On Master ****
+CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
+INSERT INTO t1 VALUES (1,1), (2,2);
+SELECT * FROM t1 ORDER BY a,b;
+a b
+1 1
+2 2
+**** On Slave ****
+INSERT INTO t1 VALUE (3,3);
+SELECT * FROM t1 ORDER BY a,b;
+a b
+1 1
+2 2
+3 3
+**** On Master ****
+TRUNCATE TABLE t1;
+SELECT * FROM t1 ORDER BY a,b;
+a b
+**** On Slave ****
+SELECT * FROM t1 ORDER BY a,b;
+a b
+**** On Master ****
+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
+**** On Master ****
+CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
+INSERT INTO t1 VALUES (1,1), (2,2);
+SELECT * FROM t1 ORDER BY a,b;
+a b
+1 1
+2 2
+**** On Slave ****
+INSERT INTO t1 VALUE (3,3);
+SELECT * FROM t1 ORDER BY a,b;
+a b
+1 1
+2 2
+3 3
+**** On Master ****
+DELETE FROM t1;
+SELECT * FROM t1 ORDER BY a,b;
+a b
+**** On Slave ****
+SELECT * FROM t1 ORDER BY a,b;
+a b
+3 3
+**** On Master ****
+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
diff --git a/mysql-test/suite/rpl_ndb/t/disabled.def b/mysql-test/suite/rpl_ndb/t/disabled.def
new file mode 100644
index 00000000000..f372d44cb90
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/disabled.def
@@ -0,0 +1,27 @@
+##############################################################################
+#
+# 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.
+#
+##############################################################################
+
+
+rpl_ndb_2innodb : BUG#19227 2006-04-20 pekka pk delete apparently not replicated
+rpl_ndb_2myisam : BUG#19227 Seems to pass currently
+rpl_ndb_2other : BUG#21842 2007-08-30 tsmith test has never worked on bigendian (sol10-sparc-a, powermacg5
+rpl_ndb_dd_partitions : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on s/AMD
+rpl_ndb_innodb2ndb : Bug#29549 rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb failed on Solaris for pack_length issue
+rpl_ndb_myisam2ndb : Bug#29549 rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb failed on Solaris for pack_length issue
+rpl_ndb_ddl : BUG#28798 2007-05-31 lars Valgrind failure in NDB
+rpl_ndb_mix_innodb : BUG#28123 rpl_ndb_mix_innodb.test casue slave to core on sol10-sparc-a
+rpl_ndb_ctype_ucs2_def : BUG#27404 util thd mysql_parse sig11 when mysqld default multibyte charset
+
+
+# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
+
+#rpl_ndb_dd_advance : Bug#25913 rpl_ndb_dd_advance fails randomly
diff --git a/mysql-test/t/rpl_ndb_2innodb-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-master.opt
index 701dddb075b..701dddb075b 100644
--- a/mysql-test/t/rpl_ndb_2innodb-master.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-master.opt
diff --git a/mysql-test/t/rpl_ndb_2innodb-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-slave.opt
index d8857e54be2..d8857e54be2 100644
--- a/mysql-test/t/rpl_ndb_2innodb-slave.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-slave.opt
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test
new file mode 100644
index 00000000000..30e4e49eb7a
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test
@@ -0,0 +1,16 @@
+#############################################################
+# Author: JBM
+# Date: 2006-02-24
+# Purpose: Trying to test ability to replicate from cluster
+# to innodb, or myisam, or replicate from innodb/myisam to
+# cluster slave. Due to limitations I have created wrappers
+# to be able to use the same code for all these different
+# test and to have control over the tests.
+##############################################################
+-- source include/have_ndb.inc
+-- source include/ndb_master-slave.inc
+connection slave;
+-- source include/have_innodb.inc
+connection master;
+SET storage_engine=ndb;
+--source extra/rpl_tests/rpl_ndb_2multi_eng.test
diff --git a/mysql-test/t/rpl_ndb_2myisam-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-master.opt
index 701dddb075b..701dddb075b 100644
--- a/mysql-test/t/rpl_ndb_2myisam-master.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-master.opt
diff --git a/mysql-test/t/rpl_ndb_2myisam-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-slave.opt
index 6035ce27c46..6035ce27c46 100644
--- a/mysql-test/t/rpl_ndb_2myisam-slave.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-slave.opt
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test
new file mode 100644
index 00000000000..182d4c72d87
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test
@@ -0,0 +1,13 @@
+#############################################################
+# Author: JBM
+# Date: 2006-02-24
+# Purpose: Trying to test ability to replicate from cluster
+# to innodb, or myisam, or replicate from innodb/myisam to
+# cluster slave. Due to limitations I have created wrappers
+# to be able to use the same code for all these different
+# test and to have control over the tests.
+##############################################################
+-- source include/have_ndb.inc
+-- source include/ndb_master-slave.inc
+SET storage_engine=ndb;
+--source extra/rpl_tests/rpl_ndb_2multi_eng.test
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other-slave.opt
new file mode 100644
index 00000000000..a6c65034e68
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other-slave.opt
@@ -0,0 +1 @@
+--innodb --log-slave-updates=0
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other.test
new file mode 100644
index 00000000000..b7e393ca3cc
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other.test
@@ -0,0 +1,35 @@
+#############################################################
+# Author: Rafal Somla
+# Date: 2006-08-20
+# Purpose: Trying to test ability to replicate from cluster
+# to other engines (innodb, myisam).
+##############################################################
+--source include/have_ndb.inc
+--source include/have_innodb.inc
+--source include/have_binlog_format_mixed_or_row.inc
+--source include/ndb_master-slave.inc
+
+# On master use NDB as storage engine.
+connection master;
+SET storage_engine=ndb;
+
+--echo
+--echo === NDB -> MYISAM ===
+--echo
+connection slave;
+SET storage_engine=myisam;
+--source extra/rpl_tests/rpl_ndb_2multi_basic.test
+
+--echo
+--echo === NDB -> INNODB ===
+--echo
+connection slave;
+SET storage_engine=innodb;
+--source extra/rpl_tests/rpl_ndb_2multi_basic.test
+
+--echo
+--echo === NDB -> NDB ===
+--echo
+connection slave;
+SET storage_engine=ndb;
+--source extra/rpl_tests/rpl_ndb_2multi_basic.test
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_UUID.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_UUID.test
new file mode 100644
index 00000000000..ea623a06fd1
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_UUID.test
@@ -0,0 +1,8 @@
+########################################################
+# By JBM 2005-02-15 Wrapped to allow reuse of test code#
+########################################################
+--source include/have_ndb.inc
+--source include/have_binlog_format_mixed_or_row.inc
+--source include/ndb_master-slave.inc
+let $engine_type=NDB;
+--source extra/rpl_tests/rpl_row_UUID.test
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_auto_inc.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_auto_inc.test
new file mode 100644
index 00000000000..5e0584e332a
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_auto_inc.test
@@ -0,0 +1,118 @@
+#
+# Test of auto_increment in CRBR
+#
+#####################################
+# By: JBM
+# Date: 2006-02-10
+# Change: Augmented test to use with cluster
+#####################################
+--source include/have_ndb.inc
+--source include/have_binlog_format_mixed_or_row.inc
+--source include/ndb_master-slave.inc
+
+--echo ***************** Test 1 ************************
+--echo
+CREATE TABLE t1 (a INT NOT NULL auto_increment,b INT, PRIMARY KEY (a)) ENGINE=NDB auto_increment=3;
+insert into t1 values (NULL,1),(NULL,2),(NULL,3);
+--echo ******* Select from Master *************
+--echo
+select * from t1 ORDER BY a;
+
+
+sync_slave_with_master;
+--echo ******* Select from Slave *************
+--echo
+select * from t1 ORDER BY a;
+connection master;
+drop table t1;
+
+create table t1 (a int not null auto_increment,b int, primary key (a)) engine=NDB;
+insert into t1 values (1,1),(NULL,2),(3,3),(NULL,4);
+delete from t1 where b=4;
+insert into t1 values (NULL,5),(NULL,6);
+--echo ******* Select from Master *************
+--echo
+select * from t1 ORDER BY a;
+
+sync_slave_with_master;
+--echo ******* Select from Slave *************
+--echo
+select * from t1 ORDER BY a;
+connection master;
+
+drop table t1;
+
+create table t1 (a int not null auto_increment, primary key (a)) engine=NDB;
+# Insert with 2 insert statements to get better testing of logging
+insert into t1 values (NULL),(5),(NULL);
+insert into t1 values (250),(NULL);
+--echo ******* Select from Master *************
+--echo
+select * from t1 ORDER BY a;
+insert into t1 values (1000);
+set @@insert_id=400;
+insert into t1 values(NULL),(NULL);
+--echo ******* Select from Master *************
+--echo
+select * from t1 ORDER BY a;
+
+sync_slave_with_master;
+--echo ******* Select from Slave *************
+--echo
+select * from t1 ORDER BY a;
+connection master;
+drop table t1;
+
+create table t1 (a int not null auto_increment, primary key (a)) engine=NDB;
+# Insert with 2 insert statements to get better testing of logging
+insert into t1 values (NULL),(5),(NULL),(NULL);
+insert into t1 values (500),(NULL),(502),(NULL),(600);
+--echo ******* Select from Master *************
+--echo
+select * from t1 ORDER BY a;
+set @@insert_id=600;
+# We expect a duplicate key error that we will ignore below
+--error 1022
+insert into t1 values(600),(NULL),(NULL);
+set @@insert_id=600;
+insert ignore into t1 values(600),(NULL),(NULL),(610),(NULL);
+--echo ******* Select from Master *************
+--echo
+select * from t1 ORDER BY a;
+
+sync_slave_with_master;
+--echo ******* Select from Slave *************
+--echo
+select * from t1 ORDER BY a;
+connection master;
+drop table t1;
+
+#
+# Test that auto-increment works when slave has rows in the table
+#
+
+create table t1 (a int not null auto_increment, primary key (a)) engine=NDB;
+
+sync_slave_with_master;
+insert into t1 values(2),(12),(22),(32),(42);
+connection master;
+
+insert into t1 values (NULL),(NULL);
+insert into t1 values (3),(NULL),(NULL);
+--echo ******* Select from Master *************
+--echo
+select * from t1 ORDER BY a;
+
+sync_slave_with_master;
+--echo ******* Select from Slave *************
+--echo
+--echo ** Slave should have 2, 12, 22, 32, 42 **
+--echo ** Master will have 2 but not 12, 22, 32, 42 **
+--echo
+select * from t1 ORDER BY a;
+connection master;
+
+drop table t1;
+
+# End cleanup
+sync_slave_with_master;
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_bank.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_bank.test
new file mode 100644
index 00000000000..ce951f01212
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_bank.test
@@ -0,0 +1,181 @@
+#
+# Currently this test only runs in the source tree with the
+# ndb/test programs compiled.
+# invoke with: ./mysql-test-run --ndb-extra-test --do-test=rpl_ndb_bank
+#
+# 1. start a "bank" application running on the master cluster
+# 2. perform online sync of slave
+# 3. periodically check consistency of slave
+# 4. stop the bank application
+# 5. check that the slave and master BANK databases are the same
+#
+
+--source include/have_ndb.inc
+--source include/have_ndb_extra.inc
+--source include/have_binlog_format_mixed_or_row.inc
+--source include/ndb_master-slave.inc
+
+# kill any trailing processes
+--system killall lt-bankTransactionMaker lt-bankTimer lt-bankMakeGL || true
+
+--disable_warnings
+# initialize master
+--connection master
+CREATE DATABASE IF NOT EXISTS BANK;
+DROP DATABASE BANK;
+CREATE DATABASE BANK default charset=latin1 default collate=latin1_bin;
+--enable_warnings
+
+#
+# These tables should correspond to the table definitions in
+# storage/ndb/test/src/NDBT_Tables.cpp
+#
+--connection master
+USE BANK;
+CREATE TABLE GL ( TIME BIGINT UNSIGNED NOT NULL,
+ ACCOUNT_TYPE INT UNSIGNED NOT NULL,
+ BALANCE INT UNSIGNED NOT NULL,
+ DEPOSIT_COUNT INT UNSIGNED NOT NULL,
+ DEPOSIT_SUM INT UNSIGNED NOT NULL,
+ WITHDRAWAL_COUNT INT UNSIGNED NOT NULL,
+ WITHDRAWAL_SUM INT UNSIGNED NOT NULL,
+ PURGED INT UNSIGNED NOT NULL,
+ PRIMARY KEY USING HASH (TIME,ACCOUNT_TYPE))
+ ENGINE = NDB;
+
+CREATE TABLE ACCOUNT ( ACCOUNT_ID INT UNSIGNED NOT NULL,
+ OWNER INT UNSIGNED NOT NULL,
+ BALANCE INT UNSIGNED NOT NULL,
+ ACCOUNT_TYPE INT UNSIGNED NOT NULL,
+ PRIMARY KEY USING HASH (ACCOUNT_ID))
+ ENGINE = NDB;
+
+CREATE TABLE TRANSACTION ( TRANSACTION_ID BIGINT UNSIGNED NOT NULL,
+ ACCOUNT INT UNSIGNED NOT NULL,
+ ACCOUNT_TYPE INT UNSIGNED NOT NULL,
+ OTHER_ACCOUNT INT UNSIGNED NOT NULL,
+ TRANSACTION_TYPE INT UNSIGNED NOT NULL,
+ TIME BIGINT UNSIGNED NOT NULL,
+ AMOUNT INT UNSIGNED NOT NULL,
+ PRIMARY KEY USING HASH (TRANSACTION_ID,ACCOUNT))
+ ENGINE = NDB;
+
+CREATE TABLE SYSTEM_VALUES ( SYSTEM_VALUES_ID INT UNSIGNED NOT NULL,
+ VALUE BIGINT UNSIGNED NOT NULL,
+ PRIMARY KEY USING HASH (SYSTEM_VALUES_ID))
+ ENGINE = NDB;
+
+CREATE TABLE ACCOUNT_TYPE ( ACCOUNT_TYPE_ID INT UNSIGNED NOT NULL,
+ DESCRIPTION CHAR(64) NOT NULL,
+ PRIMARY KEY USING HASH (ACCOUNT_TYPE_ID))
+ ENGINE = NDB;
+
+#
+# create "BANK" application
+#
+--exec NDB_CONNECTSTRING=localhost:$NDBCLUSTER_PORT ../storage/ndb/test/ndbapi/bank/bankCreator >> $NDB_TOOLS_OUTPUT
+
+#
+# start main loop
+# repeat backup-restore-check
+#
+
+# set this high if testing to run many syncs in loop
+--let $2=1
+while ($2)
+{
+
+#
+# start "BANK" application
+#
+--exec NDB_CONNECTSTRING=localhost:$NDBCLUSTER_PORT ../storage/ndb/test/ndbapi/bank/bankTimer -w 5 >> $NDB_TOOLS_OUTPUT &
+--exec NDB_CONNECTSTRING=localhost:$NDBCLUSTER_PORT ../storage/ndb/test/ndbapi/bank/bankMakeGL >> $NDB_TOOLS_OUTPUT &
+--exec NDB_CONNECTSTRING=localhost:$NDBCLUSTER_PORT ../storage/ndb/test/ndbapi/bank/bankTransactionMaker >> $NDB_TOOLS_OUTPUT &
+
+#
+# let the "BANK" run for a while
+#
+--sleep 5
+
+--disable_warnings
+# initialize slave for sync
+--connection slave
+STOP SLAVE;
+RESET SLAVE;
+# to make sure we drop any ndbcluster tables
+CREATE DATABASE IF NOT EXISTS BANK;
+DROP DATABASE BANK;
+# create database
+CREATE DATABASE BANK;
+--enable_warnings
+
+#
+# Time to sync the slave:
+# start by taking a backup on master
+--connection master
+RESET MASTER;
+--exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "start backup" >> $NDB_TOOLS_OUTPUT
+
+# there is no neat way to find the backupid, this is a hack to find it...
+--exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > $MYSQLTEST_VARDIR/tmp.dat
+CREATE TABLE IF NOT EXISTS mysql.backup_info (id INT, backup_id INT) ENGINE = HEAP;
+DELETE FROM mysql.backup_info;
+LOAD DATA INFILE '../tmp.dat' INTO TABLE mysql.backup_info FIELDS TERMINATED BY ',';
+--exec rm $MYSQLTEST_VARDIR/tmp.dat || true
+--replace_column 1 <the_backup_id>
+SELECT @the_backup_id:=backup_id FROM mysql.backup_info;
+let the_backup_id=`select @the_backup_id`;
+
+# restore on slave, first check that nothing is there
+--connection slave
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT_SLAVE" -p 8 -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT_SLAVE" -p 8 -b $the_backup_id -n 2 -r -e --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+
+#
+# now setup replication to continue from last epoch
+--source include/ndb_setup_slave.inc
+--connection slave
+START SLAVE;
+
+
+#
+# Now loop and check consistency every 2 seconds on slave
+#
+--connection slave
+--let $1=10
+while ($1)
+{
+ --sleep 2
+ --replace_result $MASTER_MYPORT MASTER_PORT
+ --replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 34 <Last_IO_Errno> 35 <Last_IO_Error>
+ SHOW SLAVE STATUS;
+ STOP SLAVE;
+ --exec NDB_CONNECTSTRING=localhost:$NDBCLUSTER_PORT_SLAVE ../storage/ndb/test/ndbapi/bank/bankValidateAllGLs >> $NDB_TOOLS_OUTPUT
+ START SLAVE;
+ --dec $1
+}
+
+#
+# Stop transactions
+#
+--exec killall lt-bankTransactionMaker lt-bankTimer lt-bankMakeGL
+
+#
+# Check that the databases are the same on slave and master
+# 1. dump database BANK on both master and slave
+# 2. compare, there should be no difference
+#
+--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info BANK ACCOUNT_TYPE ACCOUNT GL TRANSACTION > $MYSQLTEST_VARDIR/tmp/master_BANK.sql
+--connection master
+use test;
+create table t1 (a int primary key) engine=ndb;
+insert into t1 values (1);
+--sync_slave_with_master
+--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info BANK ACCOUNT_TYPE ACCOUNT GL TRANSACTION > $MYSQLTEST_VARDIR/tmp/slave_BANK.sql
+--connection master
+drop table t1;
+
+diff_files $MYSQLTEST_VARDIR/tmp/master_BANK.sql $MYSQLTEST_VARDIR/tmp/slave_BANK.sql;
+
+ --dec $2
+}
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test
new file mode 100644
index 00000000000..08f7e12b1fb
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test
@@ -0,0 +1,260 @@
+--source include/have_ndb.inc
+--source include/ndb_master-slave.inc
+
+
+
+#
+# Bug #11087
+#
+# connect to the master and create tabe t1 in gotoslave database
+--connection master
+CREATE TABLE `t1` ( `nid` int(11) NOT NULL default '0',
+ `nom` char(4) default NULL,
+ `prenom` char(4) default NULL,
+ PRIMARY KEY (`nid`))
+ ENGINE=ndbcluster DEFAULT CHARSET=latin1;
+
+INSERT INTO t1 VALUES(1,"XYZ1","ABC1");
+select * from t1 order by nid;
+
+--sync_slave_with_master
+# connect to slave and ensure data it there.
+--connection slave
+select * from t1 order by nid;
+
+--connection master
+delete from t1;
+INSERT INTO t1 VALUES(1,"XYZ2","ABC2");
+# Make sure all rows are on the master
+select * from t1 order by nid;
+
+# make sure all rows are on the slave.
+--sync_slave_with_master
+--connection slave
+# Bug #11087 would have row with nid 2 missing
+select * from t1 order by nid;
+
+--connection master
+delete from t1;
+insert into t1 values(1,"AA", "AA");
+insert into t1 values(2,"BB", "BB");
+insert into t1 values(3,"CC", "CC");
+insert into t1 values(4,"DD", "DD");
+
+begin;
+# delete+insert = update
+delete from t1 where nid = 1;
+insert into t1 values (1,"A2", "A2");
+
+# update+delete = delete
+update t1 set nom="B2" where nid = 2;
+delete from t1 where nid = 2;
+
+# multi-update
+update t1 set nom = "D2" where nid = 4;
+delete from t1 where nid = 4;
+insert into t1 values (4, "D3", "D3");
+update t1 set nom = "D4" where nid = 4;
+
+# insert+delete = nothing
+insert into t1 values (5, "EE", "EE");
+delete from t1 where nid = 5;
+
+commit;
+select * from t1 order by 1;
+--sync_slave_with_master
+--connection slave
+select * from t1 order by 1;
+--connection master
+DROP table t1;
+
+#
+# Test replication of table with no primary key
+#
+--connection master
+CREATE TABLE `t1` ( `nid` int(11) NOT NULL default '0',
+ `nom` char(4) default NULL,
+ `prenom` char(4) default NULL)
+ ENGINE=ndbcluster DEFAULT CHARSET=latin1;
+
+INSERT INTO t1 VALUES(1,"XYZ1","ABC1"),(2,"AAA","BBB"),(3,"CCC","DDD");
+select * from t1 order by nid;
+
+--sync_slave_with_master
+# connect to slave and ensure data it there.
+--connection slave
+select * from t1 order by nid;
+
+--connection master
+delete from t1 where nid = 2;
+INSERT INTO t1 VALUES(4,"EEE","FFF");
+# Make sure all rows are on the master
+select * from t1 order by nid;
+
+# make sure all rows are on the slave.
+--sync_slave_with_master
+--connection slave
+select * from t1 order by nid;
+
+--connection master
+UPDATE t1 set nid=nid+1;
+UPDATE t1 set nom="CCP" where nid = 4;
+select * from t1 order by nid;
+
+# make sure all rows are on the slave.
+--sync_slave_with_master
+--connection slave
+select * from t1 order by nid;
+
+--connection master
+DROP table t1;
+
+#
+# Bug #27378 update becomes delete on slave
+#
+
+--connection master
+CREATE TABLE `t1` (
+ `prid` int(10) unsigned NOT NULL,
+ `id_type` enum('IMSI','SIP') NOT NULL,
+ `fkimssub` varchar(50) NOT NULL,
+ `user_id` varchar(20) DEFAULT NULL,
+ `password` varchar(20) DEFAULT NULL,
+ `ptg_nbr` varchar(20) DEFAULT NULL,
+ `old_tmsi` int(10) unsigned DEFAULT NULL,
+ `new_tmsi` int(10) unsigned DEFAULT NULL,
+ `dev_capability` int(10) unsigned DEFAULT NULL,
+ `dev_oid` bigint(20) unsigned DEFAULT NULL,
+ `lac_cell_id` bigint(20) unsigned DEFAULT NULL,
+ `ms_classmark1` int(10) unsigned DEFAULT NULL,
+ `cipher_key` int(10) unsigned DEFAULT NULL,
+ `priid_master` int(10) unsigned DEFAULT NULL,
+ PRIMARY KEY (`prid`),
+ UNIQUE KEY `fkimssub` (`fkimssub`,`ptg_nbr`) USING HASH
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
+
+INSERT INTO `t1` VALUES (183342,'IMSI','config3_sub_2Privates_3Publics_imssub_36668','user_id_73336','user_id_73336','73336',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(47617,'IMSI','config3_sub_2Privates_3Publics_imssub_9523','user_id_19046','user_id_19046','19046',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(200332,'IMSI','config3_sub_2Privates_3Publics_imssub_40066','user_id_80132','user_id_80132','80132',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(478882,'IMSI','config3_sub_2Privates_3Publics_imssub_95776','user_id_191552','user_id_191552','191552',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(490146,'IMSI','config3_sub_2Privates_3Publics_imssub_98029','user_id_196057','user_id_196057','196057',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(499301,'IMSI','config3_sub_2Privates_3Publics_imssub_99860','user_id_199719','user_id_199719','199719',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(506101,'IMSI','config3_sub_2Privates_3Publics_imssub_101220','user_id_202439','user_id_202439','202439',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(510142,'IMSI','config3_sub_2Privates_3Publics_imssub_102028','user_id_204056','user_id_204056','204056',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(515871,'IMSI','config3_sub_2Privates_3Publics_imssub_103174','user_id_206347','user_id_206347','206347',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(209842,'IMSI','config3_sub_2Privates_3Publics_imssub_41968','user_id_83936','user_id_83936','83936',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(365902,'IMSI','config3_sub_2Privates_3Publics_imssub_73180','user_id_146360','user_id_146360','146360',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(11892,'IMSI','config3_sub_2Privates_3Publics_imssub_2378','user_id_4756','user_id_4756','4756',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL);
+
+select count(*) from t1;
+
+--sync_slave_with_master
+--connection slave
+select count(*) from t1;
+
+--connection master
+update t1 set dev_oid=dev_oid+1;
+select count(*) from t1;
+
+--sync_slave_with_master
+--connection slave
+select count(*) from t1;
+
+--connection master
+DROP table t1;
+
+##################################################################
+#
+# Check that retries are made on the slave on some temporary errors
+#
+
+#
+# 1. Deadlock
+#
+--connection master
+CREATE TABLE `t1` ( `nid` int(11) NOT NULL default '0',
+ `nom` char(4) default NULL,
+ `prenom` char(4) default NULL,
+ PRIMARY KEY USING HASH (`nid`))
+ ENGINE=ndbcluster DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES(1,"XYZ1","ABC1");
+
+# cause a lock on that row on the slave
+--sync_slave_with_master
+--connection slave
+--echo **** On Slave ****
+BEGIN;
+UPDATE t1 SET `nom`="LOCK" WHERE `nid`=1;
+
+# set number of retries low so we fail the retries
+set GLOBAL slave_transaction_retries=1;
+
+# now do a change to this row on the master
+# will deadlock on the slave because of lock above
+--connection master
+--echo **** On Master ****
+UPDATE t1 SET `nom`="DEAD" WHERE `nid`=1;
+
+# wait for deadlock to be detected
+# sleep longer than dead lock detection timeout in config
+# we do this 2 times, once with few retries to verify that we
+# get a failure with the set sleep, and once with the _same_
+# sleep, but with more retries to get it to succeed
+--sleep 5
+
+# replication should have stopped, since max retries where not enough
+# verify with show slave status
+--connection slave
+--echo **** On Slave ****
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 19 <Last_Errno> 20 <Last_Error> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 35 <Last_IO_Errno> 36 <Last_IO_Error> 37 <Last_SQL_Errno> 38 <Last_SQL_Error>
+--query_vertical SHOW SLAVE STATUS;
+
+# now set max retries high enough to succeed, and start slave again
+set GLOBAL slave_transaction_retries=10;
+START SLAVE;
+# wait for deadlock to be detected and retried
+# should be the same sleep as above for test to be valid
+--sleep 5
+
+# commit transaction to release lock on row and let replication succeed
+select * from t1 order by nid;
+COMMIT;
+
+# verify that the row succeded to be applied on the slave
+--connection master
+--sync_slave_with_master
+--connection slave
+select * from t1 order by nid;
+
+# cleanup
+--connection master
+DROP TABLE t1;
+
+
+#
+# BUG#18094
+# Slave caches invalid table definition after atlters causes select failure
+#
+--connection master
+CREATE TABLE t1 (c1 INT KEY) ENGINE=NDB;
+
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+ALTER TABLE t1 ADD c2 INT;
+
+--sync_slave_with_master
+connection slave;
+SELECT * FROM t1 ORDER BY c1;
+
+connection master;
+ALTER TABLE t1 CHANGE c2 c2 TEXT CHARACTER SET utf8;
+ALTER TABLE t1 CHANGE c2 c2 BLOB;
+
+--sync_slave_with_master
+connection slave;
+# here we would get error 1412 prior to bug
+SELECT * FROM t1 ORDER BY c1 LIMIT 5;
+
+--connection master
+TRUNCATE t1;
+SELECT count(*) FROM t1;
+INSERT INTO t1 VALUES (101,NULL),(102,NULL),(103,NULL),(104,NULL),(105,NULL),(106,NULL),(107,NULL),(108,NULL),(109,NULL),(1010,NULL);
+--sync_slave_with_master
+connection slave;
+SELECT count(*) FROM t1;
+SELECT c1 FROM t1 ORDER BY c1 LIMIT 5;
+
+# cleanup
+--connection master
+DROP TABLE t1;
+-- source include/master-slave-end.inc
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test
new file mode 100644
index 00000000000..822f1f224cd
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test
@@ -0,0 +1,141 @@
+--source include/have_ndb.inc
+--source include/ndb_master-slave.inc
+
+#
+# basic test of blob replication for NDB
+#
+
+# easy test
+
+--connection master
+create table t1 (
+ a int not null primary key,
+ b text not null
+) engine=ndb;
+
+insert into t1 values(1, repeat('abc',10));
+insert into t1 values(2, repeat('def',200));
+insert into t1 values(3, repeat('ghi',3000));
+
+select 'M', a, sha1(b) from t1
+order by a;
+
+--sync_slave_with_master
+--sleep 5
+--connection slave
+select 'S', a, sha1(b) from t1
+order by a;
+
+--connection master
+drop table t1;
+--sync_slave_with_master
+
+# hard test
+
+--connection master
+create table t1 (
+ a int not null primary key,
+ b text not null,
+ c int,
+ d longblob,
+ e tinyblob
+) engine=ndbcluster;
+
+--disable_query_log
+# length 61
+set @s0 = 'rggurloniukyehuxdbfkkyzlceixzrehqhvxvxbpwizzvjzpucqmzrhzxzfau';
+set @s1 = 'ykyymbzqgqlcjhlhmyqelfoaaohvtbekvifukdtnvcrrjveevfakxarxexomz';
+set @s2 = 'dbnfqyzgtqxalcrwtfsqabknvtfcbpoonxsjiqvmhnfikxxhcgoexlkoezvah';
+--enable_query_log
+
+insert into t1 values (
+ 0, repeat(@s2,454), 100, repeat(@s2,345), NULL);
+insert into t1 values (
+ 1, repeat(@s0,504), NULL, repeat(@s1,732), repeat(@s1,1));
+insert into t1 values (
+ 2, '', 102, '', repeat(@s2,1));
+insert into t1 values (
+ 3, repeat(@s0,545), 103, repeat(@s2,788), repeat(@s0,1));
+insert into t1 values (
+ 4, repeat(@s1,38), 104, repeat(@s0,260), repeat(@s0,1));
+insert into t1 values (
+ 5, repeat(@s2,12), 105, repeat(@s2,40), repeat(@s1,1));
+insert into t1 values (
+ 6, repeat(@s1,242), 106, NULL, repeat(@s1,1));
+insert into t1 values (
+ 7, repeat(@s1,30), 107, repeat(@s0,161), '');
+insert into t1 values (
+ 8, repeat(@s1,719), 108, repeat(@s2,104), NULL);
+insert into t1 values (
+ 9, repeat(@s2,427), NULL, NULL, NULL);
+
+select 'M', a, sha1(b), c, sha1(d), sha1(e)
+from t1 order by a;
+
+--sync_slave_with_master
+--sleep 5
+--connection slave
+select 'S', a, sha1(b), c, sha1(d), sha1(e)
+from t1 order by a;
+
+--connection master
+drop table t1;
+--sync_slave_with_master
+
+# table with varsize key (future cluster/schema)
+
+# sql/ha_ndbcluster_binlog.cc
+--connection master
+CREATE TABLE IF NOT EXISTS t1 (
+ db VARBINARY(63) NOT NULL,
+ name VARBINARY(63) NOT NULL,
+ slock BINARY(32) NOT NULL,
+ query BLOB NOT NULL,
+ node_id INT UNSIGNED NOT NULL,
+ epoch BIGINT UNSIGNED NOT NULL,
+ id INT UNSIGNED NOT NULL,
+ version INT UNSIGNED NOT NULL,
+ type INT UNSIGNED NOT NULL,
+ PRIMARY KEY USING HASH (db,name))
+ENGINE=NDB;
+
+insert into t1 values ('test','t1',
+ 'abc',repeat(@s0,10), 11,12,13,14,15);
+insert into t1 values ('test','t2',
+ 'def',repeat(@s1,100), 21,22,23,24,25);
+insert into t1 values ('test','t3',
+ 'ghi',repeat(@s2,1000),31,32,33,34,35);
+insert into t1 values ('testtttttttttt','t1',
+ 'abc',repeat(@s0,10), 11,12,13,14,15);
+insert into t1 values ('testttttttttttt','t1',
+ 'def',repeat(@s1,100), 21,22,23,24,25);
+insert into t1 values ('testtttttttttttt','t1',
+ 'ghi',repeat(@s2,1000),31,32,33,34,35);
+insert into t1 values ('t','t11111111111',
+ 'abc',repeat(@s0,10), 11,12,13,14,15);
+insert into t1 values ('t','t111111111111',
+ 'def',repeat(@s1,100), 21,22,23,24,25);
+insert into t1 values ('t','t1111111111111',
+ 'ghi',repeat(@s2,1000),31,32,33,34,35);
+
+select 'M', db, name, sha1(query), node_id, epoch, id, version, type
+from t1 order by db, name;
+
+--sync_slave_with_master
+--sleep 5
+--connection slave
+select 'S', db, name, sha1(query), node_id, epoch, id, version, type
+from t1 order by db, name;
+
+--connection master
+drop table t1;
+--sync_slave_with_master
+
+#
+# view the binlog - not deterministic (mats)
+#
+
+#--connection master
+#let $VERSION=`select version()`;
+#--replace_result $VERSION VERSION
+#show binlog events;
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test
new file mode 100644
index 00000000000..e29f24998fe
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test
@@ -0,0 +1,10 @@
+#################################
+# Wrapper for rpl_row_blob.test #
+# Using wrapper to share test #
+# code between engine tests #
+#################################
+-- source include/have_ndb.inc
+-- source include/ndb_master-slave.inc
+let $engine_type=NDBCLUSTER;
+-- source extra/rpl_tests/rpl_row_blob.test
+
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_charset.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_charset.test
new file mode 100644
index 00000000000..4bac267443e
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_charset.test
@@ -0,0 +1,8 @@
+########################################################
+# By JBM 2005-02-15 Wrapped to allow reuse of test code#
+########################################################
+--source include/have_ndb.inc
+-- source include/have_binlog_format_row.inc
+-- source include/ndb_master-slave.inc
+let $engine_type=NDB;
+-- source extra/rpl_tests/rpl_row_charset.test
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test
new file mode 100644
index 00000000000..c1a48d08c53
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test
@@ -0,0 +1,56 @@
+--source include/have_ndb.inc
+--source include/ndb_master-slave.inc
+
+# set up circular replication
+
+--connection slave
+RESET MASTER;
+--connection master
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+--eval CHANGE MASTER TO master_host="127.0.0.1",master_port=$SLAVE_MYPORT,master_user="root"
+START SLAVE;
+
+# create the table on the "slave"
+--connection slave
+CREATE TABLE t1 (a int key, b int) ENGINE=ndb;
+#CREATE TABLE t2 (a int key, b int) ENGINE=ndb;
+--save_master_pos
+--connection master
+--sync_with_master
+# now we should have a table on the master as well
+SHOW TABLES;
+
+# insert some values on the slave and master
+--connection master
+INSERT INTO t1 VALUES (1,2);
+--connection slave
+INSERT INTO t1 VALUES (2,3);
+
+# ensure data has propagated both ways
+--connection slave
+--save_master_pos
+--connection master
+--sync_with_master
+--sync_slave_with_master
+
+# connect to slave and ensure data it there.
+--connection slave
+SELECT * FROM t1 ORDER BY a;
+#SELECT * FROM t2 ORDER BY a;
+--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
+--query_vertical show slave status;
+# connect to master and ensure data it there.
+--connection master
+SELECT * FROM t1 ORDER BY a;
+#SELECT * FROM t2 ORDER BY a;
+--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
+--query_vertical show slave status;
+
+# stop replication on "master" as not to replicate
+# shutdown circularly, eg drop table
+--connection master
+STOP SLAVE;
+
+# cleanup
+--connection master
+DROP TABLE t1;
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test
new file mode 100644
index 00000000000..fcbff1392f4
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test
@@ -0,0 +1,80 @@
+--source include/have_ndb.inc
+--source include/ndb_master-slave.inc
+
+connection master;
+CREATE TABLE t1 (a int key, b int) ENGINE=NDB;
+sync_slave_with_master;
+SHOW TABLES;
+
+# Lose the events from the slave binary log: there is no
+# need to re-create the table on the master.
+connection slave;
+RESET MASTER;
+
+# Insert some values on the slave and master
+connection master;
+INSERT INTO t1 VALUES (1,2);
+# Switch to slave once event is applied and insert a row
+sync_slave_with_master;
+connection slave;
+INSERT INTO t1 VALUES (2,3);
+
+# ... it is now very probable that we have a mixed event in the binary
+# log. If we don't, the test should still pass, but will not test the
+# mixed event situation.
+
+# The statement is disabled since it cannot reliably show the same
+# info all the time. Use it for debug purposes.
+
+#SHOW BINLOG EVENTS;
+
+# Replicate back to the master to test this mixed event on the master
+STOP SLAVE;
+
+connection master;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval CHANGE MASTER TO MASTER_HOST="127.0.0.1",MASTER_PORT=$SLAVE_MYPORT,MASTER_USER="root";
+
+START SLAVE;
+
+connection slave;
+save_master_pos;
+connection master;
+sync_with_master;
+
+# The statement is disabled since it cannot reliably show the same
+# info all the time. Use it for debug purposes.
+
+#SHOW BINLOG EVENTS;
+
+# Check that there is no error in replication
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+query_vertical SHOW SLAVE STATUS;
+
+# Check that we have the data on the master
+SELECT * FROM t1 ORDER BY a;
+
+# We should now have another mixed event, likely with "slave" server
+# id last, and with the STMT_END_F flag set.
+
+# The statement is disabled since it cannot reliably show the same
+# info all the time. Use it for debug purposes.
+
+#SHOW BINLOG EVENTS;
+
+# now lets see that this data is applied correctly on the slave
+STOP SLAVE;
+save_master_pos;
+
+connection slave;
+START SLAVE;
+
+# check that we have the data on the slave
+sync_with_master;
+SELECT * FROM t1 ORDER BY a;
+
+# Check that there is no error in replication
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+query_vertical SHOW SLAVE STATUS;
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test
new file mode 100644
index 00000000000..8c45ac5dbdd
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test
@@ -0,0 +1,10 @@
+#####################################
+# Wrapper for rpl_commit_after_flush#
+# Wrapped to reuse test code on #
+# Different engines #
+# By JBM 2004-02-15 #
+#####################################
+-- source include/have_ndb.inc
+-- source include/ndb_master-slave.inc
+let $engine_type=NDB;
+-- source extra/rpl_tests/rpl_commit_after_flush.test
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def-master.opt
new file mode 100644
index 00000000000..84d2a52b639
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def-master.opt
@@ -0,0 +1 @@
+--default-collation=ucs2_unicode_ci --default-character-set=ucs2,latin1
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test
new file mode 100644
index 00000000000..be7fd1acd2e
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test
@@ -0,0 +1,42 @@
+--source include/have_ucs2.inc
+--source include/have_ndb.inc
+--source include/ndb_master-slave.inc
+
+#
+# MySQL Bug#15276: MySQL ignores collation-server
+#
+show variables like 'collation_server';
+
+#
+# Check that NDB replication doesn't explode with default charset
+# being multibyte.
+#
+# Theorised that this could be a problem when dealing with:
+# Bug #27404 util thd mysql_parse sig11 when mysqld default multibyte charset
+#
+# Sort of related to:
+# Bug#18004 Connecting crashes server when default charset is UCS2
+#
+#
+show variables like "%character_set_ser%";
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+create table t1 (a int) ENGINE=NDB;
+drop table t1;
+
+--connection master
+CREATE TABLE `t1` ( `nid` int(11) NOT NULL default '0',
+ `nom` char(4) default NULL,
+ `prenom` char(4) default NULL,
+ PRIMARY KEY (`nid`))
+ ENGINE=ndbcluster;
+
+INSERT INTO t1 VALUES(1,"XYZ1","ABC1");
+select * from t1 order by nid;
+
+--sync_slave_with_master
+# connect to slave and ensure data it there.
+--connection slave
+select * from t1 order by nid;
+
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_advance.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_advance.test
new file mode 100644
index 00000000000..a7e00262f5c
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_advance.test
@@ -0,0 +1,430 @@
+###############################################
+# Author: JBM #
+# Date: 2006-03-07 #
+# Purpose: To test advance DD and replication #
+###############################################
+
+#### Include Section ####
+--source include/have_ndb.inc
+--source include/have_binlog_format_mixed_or_row.inc
+--source include/ndb_default_cluster.inc
+--source include/not_embedded.inc
+#--source include/big_test.inc
+#--source include/have_ndb_extra.inc
+--source include/ndb_master-slave.inc
+
+#### Test start cleanup section #####
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2, t3;
+--enable_warnings
+
+######################################################
+# Requirment: Cluster DD and replication must be able#
+# to handle ALTER tables and indexes and must rpl #
+# to the slave correctly #
+######################################################
+
+## Test #1 replication of CDD and Alter Tables #####
+--echo ***** Test 1 RPL of CDD and Alter *****
+--echo ***** Test 1 setup *****
+
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+INITIAL_SIZE 16M
+UNDO_BUFFER_SIZE = 1M
+ENGINE=NDB;
+
+ALTER LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile02.dat'
+INITIAL_SIZE 4M
+ENGINE=NDB;
+
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 12M
+ENGINE=NDB;
+
+ALTER TABLESPACE ts1
+ADD DATAFILE 'datafile02.dat'
+INITIAL_SIZE 4M
+ENGINE=NDB;
+
+CREATE TABLE t1
+ (c1 INT NOT NULL PRIMARY KEY,
+ c2 INT NOT NULL,
+ c3 INT NOT NULL)
+ TABLESPACE ts1 STORAGE DISK
+ ENGINE=NDB;
+
+--echo ***** insert some data *****
+
+let $j= 900;
+--disable_query_log
+while ($j)
+{
+ eval INSERT INTO t1 VALUES($j,$j*2,$j+3);
+ dec $j;
+}
+--enable_query_log
+
+--echo ***** Select from Master *****
+
+SELECT * FROM t1 ORDER BY c1 LIMIT 5;
+
+--echo ***** Select from Slave *****
+--sync_slave_with_master
+connection slave;
+SELECT * FROM t1 ORDER BY c1 LIMIT 5;
+
+###################################
+# Just to some File Schema check #
+###################################
+
+--disable_query_log
+SELECT DISTINCT FILE_NAME, FILE_TYPE, TABLESPACE_NAME, LOGFILE_GROUP_NAME
+ FROM INFORMATION_SCHEMA.FILES
+ WHERE ENGINE="ndbcluster" ORDER BY FILE_NAME;
+--enable_query_log
+
+--echo **** Do First Set of ALTERs in the master table ****
+###################################################
+# On this first set of alters I expect:
+# 1. To be able to create and index on 2 columns
+# 2. To be able to create a unique index
+# 3. To be able to add two columns and have
+# it all replicated correctly to the slave cluster.
+###################################################
+connection master;
+CREATE INDEX t1_i ON t1(c2, c3);
+#Bug 18039
+CREATE UNIQUE INDEX t1_i2 ON t1(c2);
+ALTER TABLE t1 ADD c4 TIMESTAMP;
+ALTER TABLE t1 ADD c5 DOUBLE;
+ALTER TABLE t1 ADD INDEX (c5);
+SHOW CREATE TABLE t1;
+
+--echo **** Show first set of ALTERs on SLAVE ****
+--sync_slave_with_master
+connection slave;
+SHOW CREATE TABLE t1;
+
+--echo **** Second set of alters test 1 ****
+############################################
+# With this next set of alters we have had
+# Some issues with renames of tables. So this
+# test renames our main table, drop and index off
+# of it, creates another table with then name
+# of the orginal table, inserts a row, drops
+# the table and renames the orginal table back.
+# I want to make sure that 1) the cluster does
+# okay with this and 2) that it is replicated
+# correctly.
+#############################################
+connection master;
+ALTER TABLE t1 RENAME t2;
+ALTER TABLE t2 DROP INDEX c5;
+CREATE TABLE t1(c1 INT)ENGINE=NDB;
+INSERT INTO t1 VALUES(1);
+DROP TABLE t1;
+ALTER TABLE t2 RENAME t1;
+
+--echo **** Show second set of ALTERs on MASTER ****
+
+SHOW CREATE TABLE t1;
+
+--echo **** Show second set of ALTERs on SLAVE ****
+--sync_slave_with_master
+connection slave;
+SHOW CREATE TABLE t1;
+
+--echo **** Third and last set of alters for test1 ****
+#########################################################
+# In this last set of alters, we are messing with the
+# cluster ability to rebuild indexes, drop a column that make up
+# an index with another column and change types several times in
+# a row. I have choosen the BLOB as it seems to have had many
+# issues in this release. I want to make sure that the cluster
+# deals with these radical changes and that the replication to
+# the slave cluster is dones correctly.
+###########################################################
+connection master;
+ALTER TABLE t1 CHANGE c1 c1 DOUBLE;
+ALTER TABLE t1 CHANGE c2 c2 DECIMAL(10,2);
+ALTER TABLE t1 DROP COLUMN c3;
+ALTER TABLE t1 CHANGE c4 c4 TEXT CHARACTER SET utf8;
+ALTER TABLE t1 CHANGE c4 c4 BLOB;
+ALTER TABLE t1 CHANGE c4 c3 BLOB;
+set @b1 = 'b1';
+set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
+UPDATE t1 SET c3=@b1 where c1 = 1;
+UPDATE t1 SET c3=@b1 where c1 = 2;
+
+--echo **** Show last set of ALTERs on MASTER ****
+
+SHOW CREATE TABLE t1;
+SELECT * FROM t1 ORDER BY c1 LIMIT 5;
+
+--echo **** Show last set of ALTERs on SLAVE ****
+--sync_slave_with_master
+connection slave;
+SHOW CREATE TABLE t1;
+# Bug 18094
+SELECT * FROM t1 ORDER BY c1 LIMIT 5;
+SELECT * FROM t1 where c1 = 1;
+
+connection master;
+DROP TABLE t1;
+--sync_slave_with_master
+connection slave;
+STOP SLAVE;
+RESET SLAVE;
+connection master;
+RESET MASTER;
+connection slave;
+START SLAVE;
+
+################### TEST 2 TPCB for disk data ###########################
+# Requirement: To have Stored Procedures and Functions that are used to #
+# populate and post transactions to the data base using CDD that span #
+# 2 tables spaces and also use a memory only cluster tables. In addition#
+# The slave is to be stopped, cleaned and restored and synced with the #
+# Master cluster #
+#########################################################################
+
+--echo ******** Create additional TABLESPACE test 2 **************
+
+connection master;
+CREATE TABLESPACE ts2
+ADD DATAFILE 'datafile03.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 10M
+ENGINE=NDB;
+
+ALTER TABLESPACE ts2
+ADD DATAFILE 'datafile04.dat'
+INITIAL_SIZE 5M
+ENGINE=NDB;
+
+let engine_type=NDBCLUSTER;
+let table_space=ts2;
+let format='RBR';
+
+--source include/tpcb_disk_data.inc
+
+--echo ****** TEST 2 test time *********************************
+USE tpcb;
+
+--echo *********** Load up the database ******************
+CALL tpcb.load();
+
+--echo ********** Check load master and slave **************
+SELECT COUNT(*) FROM account;
+--sync_slave_with_master
+connection slave;
+USE tpcb;
+SELECT COUNT(*) FROM account;
+
+--echo ******** Run in some transactions ***************
+
+connection master;
+let $j= 100;
+--disable_query_log
+while ($j)
+{
+ eval CALL tpcb.trans($format);
+ dec $j;
+}
+--enable_query_log
+
+
+--echo ***** Time to try slave sync ***********
+--echo **** Must make sure slave is clean *****
+--connection slave
+STOP SLAVE;
+RESET SLAVE;
+DROP PROCEDURE IF EXISTS tpcb.load;
+DROP PROCEDURE IF EXISTS tpcb.trans;
+DROP TABLE IF EXISTS tpcb.account;
+DROP TABLE IF EXISTS tpcb.teller;
+DROP TABLE IF EXISTS tpcb.branch;
+DROP TABLE IF EXISTS tpcb.history;
+DROP DATABASE tpcb;
+
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile.dat'
+ENGINE=NDB;
+
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile02.dat'
+ENGINE=NDB;
+
+DROP TABLESPACE ts1 ENGINE=NDB;
+
+ALTER TABLESPACE ts2
+DROP DATAFILE 'datafile03.dat'
+ENGINE=NDB;
+
+ALTER TABLESPACE ts2
+DROP DATAFILE 'datafile04.dat'
+ENGINE=NDB;
+
+DROP TABLESPACE ts2 ENGINE=NDB;
+
+DROP LOGFILE GROUP lg1 ENGINE=NDB;
+
+--echo ********** Take a backup of the Master *************
+connection master;
+
+SELECT COUNT(*) FROM history;
+
+let $j= 100;
+--disable_query_log
+while ($j)
+{
+ eval CALL tpcb.trans($format);
+ dec $j;
+}
+--enable_query_log
+
+SELECT COUNT(*) FROM history;
+
+#RESET MASTER;
+--exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "start backup" >> $NDB_TOOLS_OUTPUT
+
+--exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > $MYSQLTEST_VARDIR/tmp.dat
+
+CREATE TEMPORARY TABLE IF NOT EXISTS mysql.backup_info (id INT, backup_id INT) ENGINE = HEAP;
+
+DELETE FROM mysql.backup_info;
+
+LOAD DATA INFILE '../tmp.dat' INTO TABLE mysql.backup_info FIELDS TERMINATED BY ',';
+--exec rm $MYSQLTEST_VARDIR/tmp.dat || true
+--replace_column 1 <the_backup_id>
+
+SELECT @the_backup_id:=backup_id FROM mysql.backup_info;
+
+let the_backup_id=`select @the_backup_id`;
+
+DROP TABLE IF EXISTS mysql.backup_info;
+#RESET MASTER;
+
+--echo ************ Restore the slave ************************
+connection slave;
+CREATE DATABASE tpcb;
+--source include/ndb_restore_slave_eoption.inc
+
+--echo ***** Check a few slave restore values ***************
+connection slave;
+USE tpcb;
+SELECT COUNT(*) FROM account;
+
+--echo ***** Add some more records to master *********
+connection master;
+let $j= 100;
+--disable_query_log
+while ($j)
+{
+ eval CALL tpcb.trans($format);
+ dec $j;
+}
+--enable_query_log
+
+#
+# now setup replication to continue from last epoch
+# 1. get apply_status epoch from slave
+# 2. get corresponding _next_ binlog postition from master
+# 3. change master on slave
+# 4. add some transaction for slave to process
+# 5. start the replication
+
+--echo ***** Finsh the slave sync process *******
+--disable_query_log
+# 1. 2. 3.
+--sync_slave_with_master
+--source include/ndb_setup_slave.inc
+--enable_query_log
+
+# 4.
+--echo * 4. *
+connection master;
+let $j= 100;
+--disable_query_log
+while ($j)
+{
+ eval CALL tpcb.trans($format);
+ dec $j;
+}
+--enable_query_log
+
+# 5.
+--echo * 5. *
+connection slave;
+START SLAVE;
+
+--echo **** We should be ready to continue on *************
+
+connection master;
+--echo ****** Let's make sure we match *******
+--echo ***** MASTER *******
+USE tpcb;
+SELECT COUNT(*) FROM history;
+
+--echo ****** SLAVE ********
+--sync_slave_with_master
+connection slave;
+USE tpcb;
+SELECT COUNT(*) FROM history;
+
+--echo *** DUMP MASTER & SLAVE FOR COMPARE ********
+
+--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert tpcb account teller branch history > $MYSQLTEST_VARDIR/tmp/RPL_DD_ADV_M.sql
+
+--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert tpcb account teller branch history > $MYSQLTEST_VARDIR/tmp/RPL_DD_ADV_S.sql
+
+--echo *************** TEST 2 CLEANUP SECTION ********************
+connection master;
+DROP PROCEDURE IF EXISTS tpcb.load;
+DROP PROCEDURE IF EXISTS tpcb.trans;
+DROP TABLE tpcb.account;
+DROP TABLE tpcb.teller;
+DROP TABLE tpcb.branch;
+DROP TABLE tpcb.history;
+DROP DATABASE tpcb;
+
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile.dat'
+ENGINE=NDB;
+
+ALTER TABLESPACE ts1
+DROP DATAFILE 'datafile02.dat'
+ENGINE=NDB;
+
+DROP TABLESPACE ts1 ENGINE=NDB;
+
+ALTER TABLESPACE ts2
+DROP DATAFILE 'datafile03.dat'
+ENGINE=NDB;
+
+ALTER TABLESPACE ts2
+DROP DATAFILE 'datafile04.dat'
+ENGINE=NDB;
+
+DROP TABLESPACE ts2 ENGINE=NDB;
+
+DROP LOGFILE GROUP lg1 ENGINE=NDB;
+
+--sync_slave_with_master
+
+connection master;
+
+--echo ****** Do dumps compare ************
+
+diff_files $MYSQLTEST_VARDIR/tmp/RPL_DD_ADV_M.sql $MYSQLTEST_VARDIR/tmp/RPL_DD_ADV_S.sql;
+
+## Note: Ths files should only get removed, if the above diff succeeds.
+
+--exec rm $MYSQLTEST_VARDIR/tmp/RPL_DD_ADV_M.sql
+--exec rm $MYSQLTEST_VARDIR/tmp/RPL_DD_ADV_S.sql
+
+# End 5.1 test case
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_basic.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_basic.test
new file mode 100644
index 00000000000..ac0ab01f8dd
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_basic.test
@@ -0,0 +1,85 @@
+--source include/have_ndb.inc
+--source include/have_binlog_format_mixed_or_row.inc
+--source include/ndb_master-slave.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+#
+# Basic test of disk tables for NDB
+#
+
+#
+# Start by creating a logfile group
+#
+
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+INITIAL_SIZE 16M
+UNDO_BUFFER_SIZE = 1M
+ENGINE=NDB;
+
+alter logfile group lg1
+add undofile 'undofile02.dat'
+initial_size 4M engine=ndb;
+
+#
+# Create a tablespace connected to the logfile group
+#
+
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 12M
+ENGINE NDB;
+
+alter tablespace ts1
+add datafile 'datafile02.dat'
+initial_size 4M engine=ndb;
+
+#
+# Create a table using this tablespace
+#
+
+CREATE TABLE t1
+(pk1 int not null primary key, b int not null, c int not null)
+tablespace ts1 storage disk
+engine ndb;
+
+#
+# insert some data
+#
+
+insert into t1 values (1,2,3);
+select * from t1 order by pk1;
+
+#
+# check that the data is also on the slave
+#
+
+--sync_slave_with_master
+--connection slave
+select * from t1 order by pk1;
+
+#
+# view the binlog
+#
+
+--connection master
+-- source include/show_binlog_events2.inc
+
+#
+# cleanup
+#
+
+drop table t1;
+alter tablespace ts1
+drop datafile 'datafile.dat'
+engine=ndb;
+alter tablespace ts1
+drop datafile 'datafile02.dat'
+engine=ndb;
+DROP TABLESPACE ts1 ENGINE=NDB;
+DROP LOGFILE GROUP lg1 ENGINE=NDB;
+-- source include/master-slave-end.inc
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions-master.opt
new file mode 100644
index 00000000000..dc4f5360927
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions-master.opt
@@ -0,0 +1 @@
+--new=true
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions-slave.opt
new file mode 100644
index 00000000000..dc4f5360927
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions-slave.opt
@@ -0,0 +1 @@
+--new=true
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions.test
new file mode 100644
index 00000000000..c84854e89e8
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions.test
@@ -0,0 +1,310 @@
+#######################################
+# Author: JBM #
+# Date: 2006-03-09 #
+# Purpose: To test the replication of #
+# Cluster Disk Data using partitions #
+#######################################
+
+--source include/have_ndb.inc
+--source include/have_binlog_format_mixed_or_row.inc
+--source include/ndb_master-slave.inc
+
+--echo --- Doing pre test cleanup ---
+
+connection master;
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_query_log
+
+
+# Start by creating a logfile group
+##################################
+
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+INITIAL_SIZE 16M
+UNDO_BUFFER_SIZE = 1M
+ENGINE=NDB;
+
+ALTER LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile02.dat'
+INITIAL_SIZE = 4M
+ENGINE=NDB;
+
+###################################################
+# Create a tablespace connected to the logfile group
+###################################################
+
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 12M
+ENGINE NDB;
+
+ALTER TABLESPACE ts1
+ADD DATAFILE 'datafile02.dat'
+INITIAL_SIZE = 4M
+ENGINE=NDB;
+
+#################################################################
+
+--echo --- Start test 2 partition RANGE testing --
+--echo --- Do setup --
+
+
+#################################################
+# Requirment: Create table that is partitioned #
+# by range on year i.e. year(t) and replicate #
+# basice operations such at insert, update #
+# delete between 2 different storage engines #
+# Alter table and ensure table is handled #
+# Correctly on the slave #
+#################################################
+
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63),
+ bc CHAR(63), d DECIMAL(10,4) DEFAULT 0,
+ f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+ y YEAR, t DATE)
+ TABLESPACE ts1 STORAGE DISK
+ ENGINE=NDB
+ PARTITION BY RANGE (YEAR(t))
+ (PARTITION p0 VALUES LESS THAN (1901),
+ PARTITION p1 VALUES LESS THAN (1946),
+ PARTITION p2 VALUES LESS THAN (1966),
+ PARTITION p3 VALUES LESS THAN (1986),
+ PARTITION p4 VALUES LESS THAN (2005),
+ PARTITION p5 VALUES LESS THAN MAXVALUE);
+
+--echo --- Show table on master ---
+
+SHOW CREATE TABLE t1;
+
+--echo --- Show table on slave --
+
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+--echo --- Perform basic operation on master ---
+--echo --- and ensure replicated correctly ---
+
+--source include/rpl_multi_engine3.inc
+
+--echo --- Check that simple Alter statements are replicated correctly ---
+
+ALTER TABLE t1 MODIFY vc VARCHAR(255);
+
+--echo --- Show the new improved table on the master ---
+
+SHOW CREATE TABLE t1;
+
+--echo --- Make sure that our tables on slave are still same engine ---
+--echo --- and that the alter statements replicated correctly ---
+
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+--echo --- Perform basic operation on master ---
+--echo --- and ensure replicated correctly ---
+--enable_query_log
+
+--source include/rpl_multi_engine3.inc
+
+--echo --- End test 2 partition RANGE testing ---
+--echo --- Do Cleanup ---
+
+DROP TABLE IF EXISTS t1;
+
+########################################################
+
+--echo --- Start test 3 partition LIST testing ---
+--echo --- Do setup ---
+#################################################
+
+
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63),
+ bc CHAR(63), d DECIMAL(10,4) DEFAULT 0,
+ f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+ y YEAR, t DATE)
+ TABLESPACE ts1 STORAGE DISK
+ ENGINE=NDB
+ PARTITION BY LIST(id)
+ (PARTITION p0 VALUES IN (2, 4),
+ PARTITION p1 VALUES IN (42, 142));
+
+--echo --- Test 3 Alter to add partition ---
+
+ALTER TABLE t1 ADD PARTITION (PARTITION p2 VALUES IN (412));
+
+--echo --- Show table on master ---
+
+SHOW CREATE TABLE t1;
+
+--echo --- Show table on slave ---
+
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+--echo --- Perform basic operation on master ---
+--echo --- and ensure replicated correctly ---
+
+--source include/rpl_multi_engine3.inc
+
+--echo --- Check that simple Alter statements are replicated correctly ---
+
+ALTER TABLE t1 MODIFY vc VARCHAR(255);
+
+--echo --- Show the new improved table on the master ---
+
+SHOW CREATE TABLE t1;
+
+--echo --- Make sure that our tables on slave are still same engine ---
+--echo --- and that the alter statements replicated correctly ---
+
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+--echo --- Perform basic operation on master ---
+--echo --- and ensure replicated correctly ---
+
+--source include/rpl_multi_engine3.inc
+
+--echo --- End test 3 partition LIST testing ---
+--echo --- Do Cleanup --
+
+DROP TABLE IF EXISTS t1;
+
+########################################################
+
+--echo --- Start test 4 partition HASH testing ---
+--echo --- Do setup ---
+#################################################
+
+
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63),
+ bc CHAR(63), d DECIMAL(10,4) DEFAULT 0,
+ f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+ y YEAR, t DATE)
+ TABLESPACE ts1 STORAGE DISK
+ ENGINE=NDB
+ PARTITION BY HASH( YEAR(t) )
+ PARTITIONS 4;
+
+--echo --- show that tables have been created correctly ---
+
+SHOW CREATE TABLE t1;
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+--echo --- Perform basic operation on master ---
+--echo --- and ensure replicated correctly ---
+
+--source include/rpl_multi_engine3.inc
+
+--echo --- Check that simple Alter statements are replicated correctly ---
+
+ALTER TABLE t1 MODIFY vc VARCHAR(255);
+
+--echo --- Show the new improved table on the master ---
+
+SHOW CREATE TABLE t1;
+
+--echo --- Make sure that our tables on slave are still same engine ---
+--echo --- and that the alter statements replicated correctly ---
+
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+--echo --- Perform basic operation on master ---
+--echo --- and ensure replicated correctly ---
+
+--source include/rpl_multi_engine3.inc
+
+--echo --- End test 4 partition HASH testing ---
+--echo --- Do Cleanup --
+
+DROP TABLE IF EXISTS t1;
+
+########################################################
+
+--echo --- Start test 5 partition by key testing ---
+--echo --- Create Table Section ---
+
+#################################################
+
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63),
+ bc CHAR(63), d DECIMAL(10,4) DEFAULT 0,
+ f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+ y YEAR, t DATE,PRIMARY KEY(id))
+ TABLESPACE ts1 STORAGE DISK
+ ENGINE=NDB
+ PARTITION BY KEY()
+ PARTITIONS 4;
+
+--echo --- Show that tables on master are ndbcluster tables ---
+
+SHOW CREATE TABLE t1;
+
+--echo --- Show that tables on slave ---
+
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+--echo --- Perform basic operation on master ---
+--echo --- and ensure replicated correctly ---
+
+--source include/rpl_multi_engine3.inc
+
+# Okay lets see how it holds up to table changes
+--echo --- Check that simple Alter statements are replicated correctly ---
+
+ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total);
+
+--echo --- Show the new improved table on the master ---
+
+SHOW CREATE TABLE t1;
+
+--echo --- Make sure that our tables on slave are still right type ---
+--echo --- and that the alter statements replicated correctly ---
+
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+--echo --- Perform basic operation on master ---
+--echo --- and ensure replicated correctly ---
+
+--source include/rpl_multi_engine3.inc
+
+--echo --- Check that simple Alter statements are replicated correctly ---
+
+ALTER TABLE t1 MODIFY vc VARCHAR(255);
+
+--echo --- Show the new improved table on the master ---
+
+SHOW CREATE TABLE t1;
+
+--echo --- Make sure that our tables on slave are still same engine ---
+--echo --- and that the alter statements replicated correctly ---
+
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+--echo --- Perform basic operation on master ---
+--echo --- and ensure replicated correctly ---
+
+--source include/rpl_multi_engine3.inc
+
+--echo --- End test 5 key partition testing ---
+--echo --- Do Cleanup ---
+
+DROP TABLE IF EXISTS t1;
+alter tablespace ts1
+drop datafile 'datafile.dat'
+engine=ndb;
+alter tablespace ts1
+drop datafile 'datafile02.dat'
+engine=ndb;
+DROP TABLESPACE ts1 ENGINE=NDB;
+DROP LOGFILE GROUP lg1 ENGINE=NDB;
+--sync_slave_with_master
+
+# End of 5.1 test case
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_ddl.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_ddl.test
new file mode 100644
index 00000000000..654d1c08944
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_ddl.test
@@ -0,0 +1,33 @@
+#################### rpl_ndb_ddl.test ########################
+# #
+# DDL statements (sometimes with implicit COMMIT) executed #
+# by the master and it's propagation into the slave #
+# #
+##############################################################
+
+#
+# NOTE, PLEASE BE CAREFUL, WHEN MODIFYING THE TESTS !!
+#
+# 1. !All! objects to be dropped, renamed, altered ... must be created
+# in AUTOCOMMIT= 1 mode before AUTOCOMMIT is set to 0 and the test
+# sequences start.
+#
+# 2. Never use a test object, which was direct or indirect affected by a
+# preceeding test sequence again.
+# Except table d1.t1 where ONLY DML is allowed.
+#
+# If one preceeding test sequence hits a (sometimes not good visible,
+# because the sql error code of the statement might be 0) bug
+# and these rules are ignored, a following test sequence might earn ugly
+# effects like failing 'sync_slave_with_master', crashes of the slave or
+# abort of the test case etc..
+#
+
+--source include/have_ndb.inc
+--source include/have_binlog_format_mixed_or_row.inc
+--source include/ndb_master-slave.inc
+let $engine_type= NDB;
+let $temp_engine_type= MEMORY;
+let $show_binlog = 0;
+let $manipulate = 0;
+-- source extra/rpl_tests/rpl_ddl.test
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test
new file mode 100644
index 00000000000..6b1d932f9a6
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test
@@ -0,0 +1,8 @@
+#########################################
+# By JBM 2006-02-14 Test wrapping to #
+# Share test code between engine tests #
+#########################################
+--source include/have_ndb.inc
+-- source include/ndb_master-slave.inc
+let $engine_type=NDB;
+-- source extra/rpl_tests/rpl_delete_no_where.test
diff --git a/mysql-test/t/rpl_ndb_do_db-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db-slave.opt
index fb5e378b65f..fb5e378b65f 100644
--- a/mysql-test/t/rpl_ndb_do_db-slave.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db-slave.opt
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test
new file mode 100644
index 00000000000..ffe8551d00f
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test
@@ -0,0 +1,56 @@
+###########################################################
+# Author: Jeb
+# Date: 14-12-2006
+# Purpose: To test --replicate-do-database=db_name
+# using cluster. Only replica should replicate.
+##########################################################
+
+--source include/have_ndb.inc
+--source include/ndb_master-slave.inc
+
+--disable_warnings
+DROP DATABASE IF EXISTS replica;
+--enable_warnings
+
+# Create database and tables for the test.
+CREATE DATABASE replica;
+CREATE TABLE t1 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB;
+CREATE TABLE t2 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB;
+USE replica;
+CREATE TABLE replica.t1 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB;
+CREATE TABLE replica.t2 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB;
+
+# Insert data into db that should not be picked up by slave
+USE test;
+INSERT INTO t1 VALUES(1, repeat('abc',10));
+INSERT INTO t2 VALUES(1, repeat('abc',10));
+SHOW TABLES;
+SELECT COUNT(*) FROM t1;
+SELECT COUNT(*) FROM t2;
+
+# Insert data into db that should be replicated
+USE replica;
+INSERT INTO replica.t1 VALUES(2, repeat('def',200));
+INSERT INTO replica.t2 VALUES(2, repeat('def',200));
+SHOW TABLES;
+SELECT COUNT(*) FROM t1;
+SELECT COUNT(*) FROM t2;
+
+# Check results on slave
+--sync_slave_with_master
+SHOW TABLES;
+USE replica;
+SHOW TABLES;
+SELECT COUNT(*) FROM t1;
+SELECT COUNT(*) FROM t2;
+USE test;
+SHOW TABLES;
+
+# Cleanup from testing
+connection master;
+USE test;
+DROP TABLE t1, t2;
+DROP DATABASE IF EXISTS replica;
+--sync_slave_with_master
+
+# End 5.1 test case
diff --git a/mysql-test/t/rpl_ndb_do_table-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table-slave.opt
index da345474216..da345474216 100644
--- a/mysql-test/t/rpl_ndb_do_table-slave.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table-slave.opt
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test
new file mode 100644
index 00000000000..ee6abd580f5
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test
@@ -0,0 +1,45 @@
+###########################################################
+# Author: Jeb
+# Date: 14-12-2006
+# Purpose: To test --replicate-do-table=db_name.tbl_name
+# using cluster. Only t1 should replicate.
+##########################################################
+
+--source include/have_ndb.inc
+--source include/ndb_master-slave.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+
+CREATE TABLE t1 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB;
+CREATE TABLE t2 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB;
+
+INSERT INTO t1 VALUES(1, repeat('abc',10));
+INSERT INTO t1 VALUES(2, repeat('def',200));
+INSERT INTO t1 VALUES(3, repeat('ghi',3000));
+INSERT INTO t2 VALUES(1, repeat('abc',10));
+INSERT INTO t2 VALUES(2, repeat('def',200));
+INSERT INTO t2 VALUES(3, repeat('ghi',3000));
+
+--sync_slave_with_master
+SHOW TABLES;
+SELECT COUNT(*) FROM t1;
+
+#
+# Bug #27044 replicated with unique field ndb table allows dup key inserts
+#
+connection master;
+
+--error ER_DUP_ENTRY
+INSERT INTO t1 VALUES (3, repeat('bad',1));
+
+connection slave;
+--error ER_DUP_ENTRY
+INSERT INTO t1 VALUES (3, repeat('bad too',1));
+
+# cleanup
+
+connection master;
+DROP TABLE IF EXISTS t1, t2;
+--sync_slave_with_master
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_extraCol.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_extraCol.test
new file mode 100644
index 00000000000..9cf4f8dba0b
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_extraCol.test
@@ -0,0 +1,13 @@
+###########################################
+# Author: Jeb
+# Date: 2006-09-08
+# Purpose: Wapper for rpl_extraSlave_Col.test
+# Using NDB
+###########################################
+-- source include/have_binlog_format_mixed_or_row.inc
+-- source include/have_ndb.inc
+-- source include/ndb_master-slave.inc
+let $engine_type = 'NDB';
+-- source extra/rpl_tests/rpl_extraSlave_Col.test
+
+
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test
new file mode 100644
index 00000000000..c02d82e2dc9
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test
@@ -0,0 +1,13 @@
+###################################
+# Wrapper for rpl_row_func003.test#
+# This test was orginally designed#
+# To test InnoDB using RBR, but #
+# It can also be used to test NDB #
+# So this wrapper is being used to#
+# reduce test case code #
+###################################
+-- source include/have_ndb.inc
+-- source include/ndb_master-slave.inc
+let $engine_type=NDB;
+-- source extra/rpl_tests/rpl_row_func003.test
+-- source include/master-slave-end.inc
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test
new file mode 100644
index 00000000000..3133ad34f0c
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test
@@ -0,0 +1,117 @@
+--source include/have_ndb.inc
+--source include/have_binlog_format_mixed_or_row.inc
+--source include/ndb_master-slave.inc
+
+#
+# Currently test only works with ndb since it retrieves "old"
+# binlog positions with mysql.ndb_binlog_index and ndb_apply_status;
+#
+
+# create a table with one row
+CREATE TABLE t1 (c1 CHAR(15), c2 CHAR(15), c3 INT, PRIMARY KEY (c3)) ENGINE = NDB ;
+INSERT INTO t1 VALUES ("row1","will go away",1);
+SELECT * FROM t1 ORDER BY c3;
+
+# sync slave and retrieve epoch
+sync_slave_with_master;
+--replace_column 1 <the_epoch>
+SELECT @the_epoch:=MAX(epoch) FROM mysql.ndb_apply_status;
+let $the_epoch= `select @the_epoch` ;
+SELECT * FROM t1 ORDER BY c3;
+
+# get the master binlog pos from the epoch
+connection master;
+--replace_result $the_epoch <the_epoch>
+--replace_column 1 <the_pos>
+eval SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
+ FROM mysql.ndb_binlog_index WHERE epoch = $the_epoch ;
+let $the_pos= `SELECT @the_pos` ;
+let $the_file= `SELECT @the_file` ;
+
+# insert some more values
+INSERT INTO t1 VALUES ("row2","will go away",2),("row3","will change",3),("row4","D",4);
+DELETE FROM t1 WHERE c3 = 1;
+UPDATE t1 SET c2="should go away" WHERE c3 = 2;
+UPDATE t1 SET c2="C" WHERE c3 = 3;
+DELETE FROM t1 WHERE c3 = 2;
+
+SELECT * FROM t1 ORDER BY c3;
+
+# check that we have it on the slave
+--sync_slave_with_master
+--connection slave
+SELECT * FROM t1 ORDER BY c3;
+
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 35 <Last_IO_Errno> 36 <Last_IO_Error>
+SHOW SLAVE STATUS;
+
+# stop slave and reset position to before the last changes
+STOP SLAVE;
+--replace_result $the_pos <the_pos>
+eval CHANGE MASTER TO
+ master_log_file = '$the_file',
+ master_log_pos = $the_pos ;
+
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 35 <Last_IO_Errno> 36 <Last_IO_Error>
+SHOW SLAVE STATUS;
+
+# start the slave again
+# -> same events should have been applied again
+# e.g. inserting rows that already there
+# deleting a row which is not there
+# updating a row which is not there
+START SLAVE;
+
+--connection master
+SELECT * FROM t1 ORDER BY c3;
+--sync_slave_with_master
+--connection slave
+SELECT * FROM t1 ORDER BY c3;
+
+STOP SLAVE;
+
+#
+# cleanup
+#
+--connection master
+DROP TABLE t1;
+RESET master;
+--connection slave
+DROP TABLE t1;
+RESET slave;
+
+START SLAVE;
+
+#
+# Test that we can handle update of a row that does not exist on the slave
+# will trigger usage of AO_IgnoreError on slave side so that the INSERT
+# still succeeds even if the replication of the UPDATE generates an error.
+#
+--connection master
+CREATE TABLE t1 (c1 CHAR(15) NOT NULL, c2 CHAR(15) NOT NULL, c3 INT NOT NULL, PRIMARY KEY (c3)) ENGINE = NDB ;
+INSERT INTO t1 VALUES ("row1","remove on slave",1);
+
+--sync_slave_with_master
+--connection slave
+DELETE FROM t1;
+
+--connection master
+BEGIN;
+UPDATE t1 SET c2="does not exist" WHERE c3=1;
+INSERT INTO t1 VALUES ("row2","new on slave",2);
+COMMIT;
+
+--sync_slave_with_master
+--connection slave
+SELECT * FROM t1;
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 34 <Last_IO_Errno> 35 <Last_IO_Error>
+SHOW SLAVE STATUS;
+
+connection master;
+DROP TABLE IF EXISTS t1;
+
+# End of 5.1 Test
+-- source include/master-slave-end.inc
diff --git a/mysql-test/t/rpl_ndb_innodb2ndb-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-master.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_ndb_innodb2ndb-master.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-master.opt
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-slave.opt
new file mode 100644
index 00000000000..b63ef44e8fc
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-slave.opt
@@ -0,0 +1 @@
+--new --default-storage-engine=ndbcluster
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test
new file mode 100644
index 00000000000..92374c26742
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test
@@ -0,0 +1,15 @@
+#############################################################
+# Author: JBM
+# Date: 2006-02-24
+# Purpose: Trying to test ability to replicate from cluster
+# to innodb, or myisam, or replicate from innodb/myisam to
+# cluster slave. Due to limitations I have created wrappers
+# to be able to use the same code for all these different
+# test and to have control over the tests.
+##############################################################
+-- source include/have_innodb.inc
+-- source include/have_ndb.inc
+-- source include/have_binlog_format_mixed_or_row.inc
+-- source include/ndb_master-slave.inc
+SET storage_engine=innodb;
+--source extra/rpl_tests/rpl_ndb_2multi_eng.test
diff --git a/mysql-test/t/rpl_ndb_innodb_trans-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_ndb_innodb_trans-slave.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans-slave.opt
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test
new file mode 100644
index 00000000000..2f2414ba578
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test
@@ -0,0 +1,66 @@
+# Test of a transaction mixing the two engines
+
+-- source include/have_ndb.inc
+-- source include/have_innodb.inc
+-- source include/ndb_master-slave.inc
+
+create table t1 (a int, unique(a)) engine=ndbcluster;
+create table t2 (a int, unique(a)) engine=innodb;
+
+
+begin;
+insert into t1 values(1);
+insert into t2 values(1);
+rollback;
+
+select count(*) from t1;
+select count(*) from t2;
+sync_slave_with_master;
+select count(*) from t1;
+select count(*) from t2;
+connection master;
+
+begin;
+load data infile '../std_data_ln/rpl_loaddata.dat' into table t2;
+load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
+rollback;
+
+select count(*) from t1;
+select count(*) from t2;
+sync_slave_with_master;
+select count(*) from t1;
+select count(*) from t2;
+connection master;
+
+delete from t1;
+delete from t2;
+begin;
+load data infile '../std_data_ln/rpl_loaddata.dat' into table t2;
+load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
+rollback;
+
+select count(*) from t1;
+select count(*) from t2;
+sync_slave_with_master;
+select count(*) from t1;
+select count(*) from t2;
+connection master;
+
+delete from t1;
+delete from t2;
+begin;
+insert into t2 values(3),(4);
+insert into t1 values(3),(4);
+load data infile '../std_data_ln/rpl_loaddata.dat' into table t2;
+load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
+rollback;
+
+select count(*) from t1;
+select count(*) from t2;
+sync_slave_with_master;
+select count(*) from t1;
+select count(*) from t2;
+connection master;
+
+drop table t1,t2;
+sync_slave_with_master;
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test
new file mode 100644
index 00000000000..e6c66011fb7
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test
@@ -0,0 +1,8 @@
+#####################################
+# Wrapper for rpl_insert_ignore.test#
+#####################################
+-- source include/have_ndb.inc
+-- source include/ndb_master-slave.inc
+let $engine_type=NDB;
+let $engine_type2=myisam;
+-- source extra/rpl_tests/rpl_insert_ignore.test
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_load.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_load.test
new file mode 100644
index 00000000000..a695eee3221
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_load.test
@@ -0,0 +1,66 @@
+#
+# Currently this test only runs in the source tree with the
+# ndb/test programs compiled.
+# invoke with: ./mysql-test-run --ndb-extra-test --do-test=rpl_ndb_load
+#
+
+--source include/have_ndb.inc
+--source include/have_ndb_extra.inc
+--source include/have_binlog_format_row.inc
+--source include/ndb_master-slave.inc
+
+--disable_warnings
+# reset master
+connection master;
+DROP DATABASE IF EXISTS TEST_DB;
+CREATE DATABASE TEST_DB;
+--enable_warnings
+
+#
+# These tables should correspond to the table definitions in
+# storage/ndb/test/ndbapi/bench/
+#
+connection master;
+USE TEST_DB;
+CREATE TABLE SUBSCRIBER
+ ( NUMBER CHAR(12) BINARY NOT NULL,
+ NAME CHAR(32) BINARY NOT NULL,
+ GROUP_ID INT UNSIGNED NOT NULL,
+ LOCATION INT UNSIGNED NOT NULL,
+ SESSIONS INT UNSIGNED NOT NULL,
+ CHANGED_BY CHAR(32) BINARY NOT NULL,
+ CHANGED_TIME CHAR(32) BINARY NOT NULL,
+ PRIMARY KEY USING HASH (NUMBER))
+ ENGINE = NDB;
+
+CREATE TABLE GROUP_T
+ ( GROUP_ID INT UNSIGNED NOT NULL,
+ GROUP_NAME CHAR(32) BINARY NOT NULL,
+ ALLOW_READ CHAR(1) BINARY NOT NULL,
+ ALLOW_INSERT INT UNSIGNED NOT NULL,
+ ALLOW_DELETE INT UNSIGNED NOT NULL,
+ PRIMARY KEY USING HASH (GROUP_ID))
+ ENGINE = NDB;
+
+CREATE TABLE SESSION
+ ( NUMBER CHAR(12) BINARY NOT NULL,
+ SERVER_ID INT UNSIGNED NOT NULL,
+ DATA VARBINARY(1998) NOT NULL,
+ PRIMARY KEY USING HASH (NUMBER,SERVER_ID))
+ ENGINE = NDB;
+
+CREATE TABLE SERVER
+ ( SUFFIX CHAR(2) BINARY NOT NULL,
+ SERVER_ID INT UNSIGNED NOT NULL,
+ NAME CHAR(32) BINARY NOT NULL,
+ NO_OF_READ INT UNSIGNED NOT NULL,
+ NO_OF_INSERT INT UNSIGNED NOT NULL,
+ NO_OF_DELETE INT UNSIGNED NOT NULL,
+ PRIMARY KEY USING HASH (SUFFIX, SERVER_ID))
+ ENGINE = NDB;
+
+#
+# start "load" application
+#
+--exec NDB_CONNECTSTRING=localhost:$NDBCLUSTER_PORT ../storage/ndb/test/ndbapi/DbCreate >> $NDB_TOOLS_OUTPUT
+--exec NDB_CONNECTSTRING=localhost:$NDBCLUSTER_PORT ../storage/ndb/test/ndbapi/DbAsyncGenerator >> $NDB_TOOLS_OUTPUT
diff --git a/mysql-test/t/rpl_ndb_log-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_log-master.opt
index e0d075c3fbd..e0d075c3fbd 100644
--- a/mysql-test/t/rpl_ndb_log-master.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_log-master.opt
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_log.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_log.test
new file mode 100644
index 00000000000..d32a05bf92a
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_log.test
@@ -0,0 +1,13 @@
+###################################
+# Wrapper for rpl_row_log.test #
+# Added wrapper so that MyISAM & #
+# Innodb and NDB could all use the#
+# Same test. NDB produced a diff #
+# bin-log #
+###################################
+-- source include/have_binlog_format_row.inc
+-- source include/have_ndb.inc
+-- source include/ndb_master-slave.inc
+let $engine_type=NDB;
+-- source extra/rpl_tests/rpl_log.test
+
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb-master.opt
new file mode 100644
index 00000000000..3596fc4d3bd
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb-master.opt
@@ -0,0 +1 @@
+--innodb --default-storage-engine=innodb
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb.test
new file mode 100644
index 00000000000..b730bcc08e0
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb.test
@@ -0,0 +1,36 @@
+#############################################
+#Authors: TU and Jeb
+#Date: 2007/04
+#Purpose: Generic replication to cluster
+# and ensuring that the ndb_apply_status
+# table is updated.
+#############################################
+# Notes:
+# include/select_ndb_apply_status.inc
+# Selects out the log name, start & end pos
+# from the ndb_apply_status table
+#
+# include/show_binlog_using_logname.inc
+# To select out 1 row from offset 1
+# from the start position in the binlog whose
+# name is = log_name
+#
+# include/tpcb.inc
+# Creates DATABASE tpcb, the tables and
+# stored procedures for loading the DB
+# and for running transactions against DB.
+##############################################
+
+
+## Includes ##
+
+--disable_query_log
+--source include/have_ndb.inc
+--source include/have_innodb.inc
+--source include/have_binlog_format_mixed.inc
+--source include/ndb_master-slave.inc
+--enable_query_log
+let $off_set = 9;
+let $rpl_format = 'MIX';
+--source extra/rpl_tests/rpl_ndb_apply_status.test
+
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test
new file mode 100644
index 00000000000..dacb1307a7b
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test
@@ -0,0 +1,70 @@
+--source include/have_multi_ndb.inc
+--source include/have_binlog_format_mixed_or_row.inc
+--source include/ndb_master-slave.inc
+
+# note: server2 is another "master" connected to the master cluster
+
+#
+# Currently test only works with ndb since it retrieves "old"
+# binlog positions with mysql.ndb_binlog_index and ndb_apply_status;
+#
+
+# create a table with one row, and make sure the other "master" gets it
+CREATE TABLE t1 (c1 CHAR(15), c2 CHAR(15), c3 INT, PRIMARY KEY (c3)) ENGINE = NDB ;
+connection server2;
+reset master;
+SHOW TABLES;
+connection master;
+INSERT INTO t1 VALUES ("row1","will go away",1);
+SELECT * FROM t1 ORDER BY c3;
+connection server2;
+SELECT * FROM t1 ORDER BY c3;
+
+# sync slave and retrieve epoch and stop the slave
+connection master;
+sync_slave_with_master;
+--replace_column 1 <the_epoch>
+SELECT @the_epoch:=MAX(epoch) FROM mysql.ndb_apply_status;
+let $the_epoch= `select @the_epoch` ;
+SELECT * FROM t1 ORDER BY c3;
+stop slave;
+
+# get the master binlog pos from the epoch, from the _other_ "master", server2
+connection server2;
+--replace_result $the_epoch <the_epoch>
+eval SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
+ FROM mysql.ndb_binlog_index WHERE epoch = $the_epoch ;
+let $the_pos= `SELECT @the_pos` ;
+let $the_file= `SELECT @the_file` ;
+
+# now connect the slave to the _other_ "master"
+connection slave;
+--replace_result $MASTER_MYPORT1 <MASTER_PORT1>
+eval CHANGE MASTER TO
+ master_port=$MASTER_MYPORT1,
+ master_log_file = '$the_file',
+ master_log_pos = $the_pos ;
+start slave;
+
+# insert some more values on the first master
+connection master;
+INSERT INTO t1 VALUES ("row2","will go away",2),("row3","will change",3),("row4","D",4);
+DELETE FROM t1 WHERE c3 = 1;
+UPDATE t1 SET c2="should go away" WHERE c3 = 2;
+UPDATE t1 SET c2="C" WHERE c3 = 3;
+DELETE FROM t1 WHERE c3 = 2;
+
+SELECT * FROM t1 ORDER BY c3;
+
+save_master_pos;
+
+# insert another row, and check that we have it on the slave
+connection server2;
+INSERT INTO t1 VALUES ("row5","E",5);
+SELECT * FROM t1 ORDER BY c3;
+#sync_slave_with_master;
+connection slave;
+--sleep 2
+SELECT * FROM t1 ORDER BY c3;
+
+STOP SLAVE;
diff --git a/mysql-test/t/rpl_ndb_multi_update2-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2-slave.opt
index 17d4171af0e..17d4171af0e 100644
--- a/mysql-test/t/rpl_ndb_multi_update2-slave.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2-slave.opt
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2.test
new file mode 100644
index 00000000000..6b86f8146f8
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2.test
@@ -0,0 +1,13 @@
+############################################################
+# By JBM 2006-02-15 Wrapper for rpl_multi_update2.test #
+# to reuse test code between engine runs #
+############################################################
+-- source include/have_ndb.inc
+
+# Run this only for row based replication, as replication of
+# auto_increment values are not supported with NDB as storage engine
+-- source include/have_binlog_format_mixed_or_row.inc
+-- source include/ndb_master-slave.inc
+
+let $engine_type=NDB;
+--source extra/rpl_tests/rpl_multi_update2.test
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test
new file mode 100644
index 00000000000..f144965e9b0
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test
@@ -0,0 +1,8 @@
+############################################################
+# By JBM 2006-02-15 Wrapper for rpl_multi_update3.test #
+# to reuse test code between engine runs #
+############################################################
+-- source include/have_ndb.inc
+-- source include/ndb_master-slave.inc
+let $engine_type=NDB;
+-- source extra/rpl_tests/rpl_multi_update3.test
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-slave.opt
new file mode 100644
index 00000000000..b63ef44e8fc
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-slave.opt
@@ -0,0 +1 @@
+--new --default-storage-engine=ndbcluster
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test
new file mode 100644
index 00000000000..a9e56d17139
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test
@@ -0,0 +1,14 @@
+#############################################################
+# Author: JBM
+# Date: 2006-02-24
+# Purpose: Trying to test ability to replicate from cluster
+# to innodb, or myisam, or replicate from innodb/myisam to
+# cluster slave. Due to limitations I have created wrappers
+# to be able to use the same code for all these different
+# test and to have control over the tests.
+##############################################################
+-- source include/have_ndb.inc
+-- source include/have_binlog_format_mixed_or_row.inc
+-- source include/ndb_master-slave.inc
+SET storage_engine=myisam;
+--source extra/rpl_tests/rpl_ndb_2multi_eng.test
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate-slave.opt
new file mode 100644
index 00000000000..cf4319f2b40
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate-slave.opt
@@ -0,0 +1,3 @@
+-O max_relay_log_size=16384
+--loose-innodb
+--log-warnings
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate.test
new file mode 100644
index 00000000000..b0b9dd9e7da
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate.test
@@ -0,0 +1,9 @@
+############################################################
+# By JBM 2006-02-15 Wrapper for rpl_relayrotate.test #
+# to reuse test code between engine runs #
+############################################################
+-- source include/have_ndb.inc
+-- source include/have_ndb_extra.inc
+-- source include/ndb_master-slave.inc
+let $engine_type=NDB;
+-- source extra/rpl_tests/rpl_relayrotate.test
diff --git a/mysql-test/t/rpl_ndb_rep_ignore-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore-slave.opt
index 6262cf451a6..6262cf451a6 100644
--- a/mysql-test/t/rpl_ndb_rep_ignore-slave.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore-slave.opt
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test
new file mode 100644
index 00000000000..1f305d20c92
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test
@@ -0,0 +1,57 @@
+###########################################################
+# Author: Jeb
+# Date: 15-12-2006
+# Purpose: To test --replicate-ignore-table=db_name.tbl_name
+# and --replicate-ignore-db=db_name
+# using cluster. Only replica should replicate.
+##########################################################
+
+--source include/have_ndb.inc
+--source include/ndb_master-slave.inc
+
+--disable_warnings
+DROP DATABASE IF EXISTS replica;
+--enable_warnings
+
+# Create database and tables for the test.
+CREATE DATABASE replica;
+CREATE TABLE t1 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB;
+CREATE TABLE t2 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB;
+USE replica;
+CREATE TABLE replica.t1 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB;
+CREATE TABLE replica.t2 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB;
+
+# Insert data into db that should not be picked up by slave
+USE test;
+INSERT INTO t1 VALUES(1, repeat('abc',10));
+INSERT INTO t2 VALUES(1, repeat('abc',10));
+SHOW TABLES;
+SELECT COUNT(*) FROM t1;
+SELECT COUNT(*) FROM t2;
+
+# Insert data into db that should be replicated
+USE replica;
+INSERT INTO replica.t1 VALUES(2, repeat('def',200));
+INSERT INTO replica.t2 VALUES(2, repeat('def',200));
+SHOW TABLES;
+SELECT COUNT(*) FROM t1;
+SELECT COUNT(*) FROM t2;
+
+# Check results on slave
+--sync_slave_with_master
+SHOW TABLES;
+USE replica;
+SHOW TABLES;
+#SELECT COUNT(*) FROM t1;
+SELECT COUNT(*) FROM t2;
+USE test;
+SHOW TABLES;
+
+# Cleanup from testing
+connection master;
+USE test;
+DROP TABLE t1, t2;
+DROP DATABASE IF EXISTS replica;
+--sync_slave_with_master
+
+# End 5.1 test case
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test
new file mode 100644
index 00000000000..f5b05080131
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test
@@ -0,0 +1,7 @@
+########################################################
+# By JBM 2005-02-15 Wrapped to allow reuse of test code#
+########################################################
+--source include/have_ndb.inc
+-- source include/ndb_master-slave.inc
+let $engine_type=NDB;
+-- source extra/rpl_tests/rpl_row_001.test
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test
new file mode 100644
index 00000000000..6453f45aa75
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test
@@ -0,0 +1,10 @@
+#################################
+# Wrapper for rpl_row_sp003.test#
+# These tests have been wrapped #
+# so the same code can be used #
+# For different engines #
+#################################
+-- source include/have_ndb.inc
+-- source include/ndb_master-slave.inc
+let $engine_type=NDBCLUSTER;
+-- source extra/rpl_tests/rpl_row_sp003.test
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test
new file mode 100644
index 00000000000..c2c7be6112c
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test
@@ -0,0 +1,10 @@
+#################################
+# Wrapper for rpl_row_sp006.test#
+# These tests have been wrapped #
+# so the same code can be used #
+# For different engines #
+#################################
+-- source include/have_ndb.inc
+-- source include/ndb_master-slave.inc
+let $engine_type=NDBCLUSTER;
+-- source extra/rpl_tests/rpl_row_sp006.test
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb-master.opt
new file mode 100644
index 00000000000..3596fc4d3bd
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb-master.opt
@@ -0,0 +1 @@
+--innodb --default-storage-engine=innodb
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test
new file mode 100644
index 00000000000..bf7f1eed7b2
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test
@@ -0,0 +1,35 @@
+#############################################
+#Authors: TU and Jeb
+#Date: 2007/04
+#Purpose: Generic replication to cluster
+# and ensuring that the ndb_apply_status
+# table is updated.
+#############################################
+# Notes:
+# include/select_ndb_apply_status.inc
+# Selects out the log name, start & end pos
+# from the ndb_apply_status table
+#
+# include/show_binlog_using_logname.inc
+# To select out 1 row from offset 1
+# from the start position in the binlog whose
+# name is = log_name
+#
+# include/tpcb.inc
+# Creates DATABASE tpcb, the tables and
+# stored procedures for loading the DB
+# and for running transactions against DB.
+##############################################
+
+
+## Includes ##
+
+--disable_query_log
+--source include/have_ndb.inc
+--source include/have_innodb.inc
+--source include/have_binlog_format_statement.inc
+--source include/ndb_master-slave.inc
+--enable_query_log
+let $off_set = 6;
+let $rpl_format = 'SBR';
+--source extra/rpl_tests/rpl_ndb_apply_status.test
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test
new file mode 100644
index 00000000000..116f0879ca0
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test
@@ -0,0 +1,104 @@
+--source include/have_ndb.inc
+--source include/ndb_default_cluster.inc
+--source include/not_embedded.inc
+--source include/have_binlog_format_mixed_or_row.inc
+--source include/ndb_master-slave.inc
+
+#
+# Currently test only works with ndb since it retrieves "old"
+# binlog positions with mysql.ndb_binlog_index and ndb_apply_status;
+#
+
+# stop the save
+--connection slave
+STOP SLAVE;
+CREATE DATABASE ndbsynctest;
+USE ndbsynctest;
+
+# get some data on the master
+--connection master
+CREATE DATABASE ndbsynctest;
+USE ndbsynctest;
+CREATE TABLE t1 (c1 BIT(1) NOT NULL, c2 BIT(1) NOT NULL, c3 CHAR(15), PRIMARY KEY(c3)) ENGINE = NDB ;
+INSERT INTO t1 VALUES (1,1,"row1"),(0,1,"row2"),(1,0,"row3"),(0,0,"row4");
+CREATE TABLE t2 (c1 CHAR(15), c2 BIT(1) NOT NULL, c3 BIT(1) NOT NULL, PRIMARY KEY(c1)) ENGINE = NDB ;
+INSERT INTO t2 VALUES ("ABC",1,1),("BCDEF",0,1),("CD",1,0),("DEFGHIJKL",0,0);
+SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
+SELECT hex(c2),hex(c3),c1 FROM t2 ORDER BY c1;
+
+# take a backup on master
+--source include/ndb_backup.inc
+
+# update a row
+UPDATE t1 SET c2=0 WHERE c3="row2";
+SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
+
+# restore on slave, first check that nothing is there
+--connection slave
+
+# we should have no tables
+SHOW TABLES;
+
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT_SLAVE" -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT_SLAVE" -b $the_backup_id -n 2 -r -e --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+
+#
+# BUG#11960
+# prior to bugfix "DROP DATABASE" would give a warning since
+# the events were not created by ndb_restore
+#
+DROP DATABASE ndbsynctest;
+CREATE DATABASE ndbsynctest;
+USE ndbsynctest;
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT_SLAVE" -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT_SLAVE" -b $the_backup_id -n 2 -r -e --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+
+# continue test
+SHOW TABLES;
+
+SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
+SELECT hex(c2),hex(c3),c1 FROM t2 ORDER BY c1;
+
+#
+# now setup replication to continue from last epoch
+--source include/ndb_setup_slave.inc
+--connection slave
+START SLAVE;
+
+#
+#
+#
+--connection master
+--sync_slave_with_master
+--connection slave
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 35 <Last_IO_Errno> 36 <Last_IO_Error>
+query_vertical SHOW SLAVE STATUS;
+
+SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
+SELECT hex(c2),hex(c3),c1 FROM t2 ORDER BY c1;
+
+#
+# Cleanup
+#
+
+--connection master
+DROP DATABASE ndbsynctest;
+--sync_slave_with_master
+--connection slave
+STOP SLAVE;
+
+#
+# Test some replication commands
+#
+--connection master
+reset master;
+# should now contain nothing
+select * from mysql.ndb_binlog_index;
+
+--connection slave
+reset slave;
+# should now contain nothing
+select * from mysql.ndb_apply_status;
+
+# End 5.1 Test
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test
new file mode 100644
index 00000000000..7f7e08685bf
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test
@@ -0,0 +1,14 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: 2006-02-14 #
+#############################################################################
+# TEST: Use before insert triggers and has the second insert fail #
+# Test is wrapped to save code and share between engines #
+#############################################################################
+
+# Includes
+-- source include/have_ndb.inc
+-- source include/ndb_master-slave.inc
+let $engine_type=NDB;
+-- source extra/rpl_tests/rpl_trig004.test
+
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndbapi_multi.test b/mysql-test/suite/rpl_ndb/t/rpl_ndbapi_multi.test
new file mode 100644
index 00000000000..5067722bb79
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndbapi_multi.test
@@ -0,0 +1,11 @@
+-- source include/have_ndb.inc
+-- source include/have_binlog_format_mixed_or_row.inc
+-- source include/have_ndbapi_examples.inc
+-- source include/ndb_master-slave.inc
+
+--exec echo Running ndbapi_simple_dual
+--exec $NDB_EXAMPLES_DIR/ndbapi_simple_dual/ndbapi_simple_dual $MASTER_MYSOCK "localhost:$NDBCLUSTER_PORT" $SLAVE_MYSOCK "localhost:$NDBCLUSTER_PORT_SLAVE" >> $NDB_EXAMPLES_OUTPUT
+
+--exec echo Running mgmapi_logevent
+--exec $NDB_EXAMPLES_DIR/mgmapi_logevent/mgmapi_logevent "localhost:$NDBCLUSTER_PORT" "localhost:$NDBCLUSTER_PORT_SLAVE" 1 >> $NDB_EXAMPLES_OUTPUT
+
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_row_basic_7ndb.test b/mysql-test/suite/rpl_ndb/t/rpl_row_basic_7ndb.test
new file mode 100644
index 00000000000..3a17de1bc9e
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_row_basic_7ndb.test
@@ -0,0 +1,8 @@
+-- source include/have_ndb.inc
+-- source include/have_binlog_format_mixed_or_row.inc
+-- source include/ndb_master-slave.inc
+
+let $type= 'NDB' ;
+let $extra_index= ;
+-- source extra/rpl_tests/rpl_row_basic.test
+-- source include/master-slave-end.inc
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test b/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test
new file mode 100644
index 00000000000..f8933b3744d
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test
@@ -0,0 +1,71 @@
+
+--source include/have_ndb.inc
+--source include/ndb_master-slave.inc
+--source include/have_binlog_format_mixed_or_row.inc
+
+--disable_query_log
+--disable_warnings
+connection slave;
+STOP SLAVE;
+connection master;
+DROP TABLE IF EXISTS t1;
+RESET MASTER;
+connection slave;
+DROP TABLE IF EXISTS t1;
+RESET SLAVE;
+START SLAVE;
+--enable_warnings
+--enable_query_log
+
+--echo **** On Master ****
+connection master;
+CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
+INSERT INTO t1 VALUES (1,1), (2,2);
+SELECT * FROM t1 ORDER BY a,b;
+--echo **** On Slave ****
+# This is silly, but NDB doesn't add to the binlog fast enough
+--real_sleep 10
+sync_slave_with_master;
+INSERT INTO t1 VALUE (3,3);
+SELECT * FROM t1 ORDER BY a,b;
+--echo **** On Master ****
+connection master;
+TRUNCATE TABLE t1;
+SELECT * FROM t1 ORDER BY a,b;
+--echo **** On Slave ****
+sync_slave_with_master;
+# Should be empty
+SELECT * FROM t1 ORDER BY a,b;
+--echo **** On Master ****
+connection master;
+DROP TABLE t1;
+let SERVER_VERSION=`select version()`;
+--replace_regex /\/\* xid=[0-9]+ \*\//\/* xid= *\// /table_id: [0-9]+/table_id: #/
+--replace_result $SERVER_VERSION SERVER_VERSION
+SHOW BINLOG EVENTS;
+
+--echo **** On Master ****
+connection master;
+CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
+INSERT INTO t1 VALUES (1,1), (2,2);
+SELECT * FROM t1 ORDER BY a,b;
+--echo **** On Slave ****
+sync_slave_with_master;
+INSERT INTO t1 VALUE (3,3);
+SELECT * FROM t1 ORDER BY a,b;
+--echo **** On Master ****
+connection master;
+DELETE FROM t1;
+SELECT * FROM t1 ORDER BY a,b;
+--echo **** On Slave ****
+sync_slave_with_master;
+# Should be empty
+SELECT * FROM t1 ORDER BY a,b;
+--echo **** On Master ****
+connection master;
+DROP TABLE t1;
+--replace_regex /table_id: [0-9]+/table_id: #/
+--replace_result $SERVER_VERSION SERVER_VERSION
+SHOW BINLOG EVENTS;
+
+-- source include/master-slave-end.inc
diff --git a/mysql-test/suite/stress/include/ddl.cln b/mysql-test/suite/stress/include/ddl.cln
new file mode 100644
index 00000000000..7d021a8c912
--- /dev/null
+++ b/mysql-test/suite/stress/include/ddl.cln
@@ -0,0 +1,4 @@
+######## include/ddl.cln ########
+disconnect con2;
+DEALLOCATE PREPARE stmt_start;
+DEALLOCATE PREPARE stmt_break;
diff --git a/mysql-test/suite/stress/include/ddl.pre b/mysql-test/suite/stress/include/ddl.pre
new file mode 100644
index 00000000000..52de4a3665b
--- /dev/null
+++ b/mysql-test/suite/stress/include/ddl.pre
@@ -0,0 +1,21 @@
+######## include/ddl.pre ########
+# The variable
+# $runtime -- rough intended runtime per subtest variant
+# must be set within the routine sourcing this script.
+#
+# Please look for more details within include/ddl1.inc.
+#
+# Creation of this test:
+# 2007-07-11 mleich
+#
+SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
+PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start";
+--replace_result $runtime <intended_runtime>
+eval SET @runtime = $runtime;
+eval PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1";
+connect (con2,localhost,root,,);
+connection default;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
diff --git a/mysql-test/suite/stress/include/ddl1.inc b/mysql-test/suite/stress/include/ddl1.inc
new file mode 100644
index 00000000000..96adadc5af5
--- /dev/null
+++ b/mysql-test/suite/stress/include/ddl1.inc
@@ -0,0 +1,277 @@
+######## include/ddl1.inc ######
+#
+# Purpose of include/ddl1.inc - include/ddl8.inc:
+#
+# Stress storage engines with rapid CREATE/DROP TABLE/INDEX
+# and following SELECT/INSERT/SHOW etc.
+#
+# The variables
+# $loop_size -- number of rounds till we look at the clock again
+# $runtime -- rough intended runtime per subtest variant
+# Real runtime without server restarts and comparison is:
+# - >= $runtime
+# - > runtime needed for $loop_size execution loops
+# $engine_type -- storage engine to be used in CREATE TABLE
+# must be set within the routine sourcing this script.
+#
+# Other stuff which must already exist:
+# - connection con2
+# - stmt_start and stmt_break prepared by the default connection
+#
+# Attention:
+# The test does suppress the writing of most statements, server error
+# messages and result sets.
+# This is needed because their number is usual not deterministic.
+# The test is partially self checking. That means is prints some
+# helpful hints into the protocol and aborts if something is wrong.
+#
+# Creation of this test:
+# 2007-07-04 mleich
+#
+############################################################################
+#
+# Some details:
+#
+# 1. Base question of the test:
+# There was just a create or drop of some object (TABLE/INDEX).
+#
+# Could it happen that the next statement referring to this
+# object gets a somehow wrong server response (result set,
+# error message, warning) because the creation or removal of
+# the object is in an incomplete state?
+#
+# Thinkable reasons for incomplete state of creation or removal:
+# The server performs the creation or removal
+# - all time incomplete.
+# Example:
+# Bug#28309 First insert violates unique constraint
+# - was "memory" table empty ?
+# - asynchronous
+# In that case the next statement has probably to wait till
+# completion.
+#
+# 2. Why do we use in some scripts "--error 0,<expected error>" followed
+# a check of $mysql_errno?
+#
+# System reactions when running with "--error 0,<expected error>":
+# - RC=0 --> no error message
+# - RC=<expected error> --> no error message
+# - RC not in (0,<expected error>) --> error message + abort of script
+# execution
+#
+# Requirements and tricky solution for statements which are expected
+# to fail:
+# 1. RC=<expected error>
+# - no abort of script execution
+# --> add "--error <expected error>"
+# - no error message into the protocol, because the number of
+# executions is NOT deterministic
+# --> use "--error 0,<expected error>"
+# 2. RC=0 = failure
+# - abort of script execution
+# "--error 0,<expected error>" prevents the automatic abort of
+# execution. Therefore we do not need to code the abort.
+# --> Check $mysql_errno and do an explicit abort if $mysql_errno = 0.
+# 3. RC not in (0,<expected error>)
+# - abort of script execution
+# "--error 0,<expected error>" causes an automatic abort.
+#
+# 3. We do not check the correctness of the SHOW CREATE TABLE output
+# in detail. This must be done within other tests.
+# We only check here that
+# - same CREATE TABLE/INDEX statements lead to the same
+# - different CREATE TABLE/INDEX statements lead to different
+# SHOW CREATE TABLE output
+# (Applies to ddl4.inc. and ddl8.inc.)
+#
+# 4. It could be assumed that running this test with
+# - PS-PROTOCOL
+# There are already subtests using prepared statements contained.
+# - SP/CURSOR/VIEW-PROTOCOL
+# These protocol variants transform SELECTs to hopefully much
+# stressing statement sequencies using SP/CURSOR/VIEW.
+# The SELECTs within include/ddl*.inc are very simple.
+# does not increase the coverage.
+# Therefore we skip runs with these protocols.
+#
+# 5. The test consumes significant runtime when running on a non RAM
+# based filesystem (run without "--mem").
+# Therefore we adjust $runtime and $loop_size depending on "--big-test"
+# option.
+# $runtime and $loop_size do not influence the expected results.
+# Rough runtime in seconds reported by mysql-test-run.pl:
+# (engine_type = MEMORY)
+# option set -> $runtime $loop_size real runtime in seconds
+# 1 20 68
+# --mem 1 20 32
+# --big-test 5 100 200
+# --mem --big-test 5 100 400
+# I assume that runs with slow filesystems are as much valuable
+# as runs with extreme fast filesystems.
+#
+# 6. Hints for analysis of test failures:
+# 1. Look into the protocol and check in which ddl*.inc
+# script the difference to the expected result occured.
+# 2. Comment the sourcing of all other ddl*.inc scripts
+# out.
+# 3. Edit the ddl*.inc script where the error occured and
+# remove all
+# - "--disable_query_log", "--disable_result_log"
+# - successful passed subtests.
+# 4. Alternative:
+# Have a look into VARDIR/master-data/mysql/general_log.CSV
+# and construct a new testcase from that.
+# 5. If the problem is not deterministic, please try the following
+# - increase $runtime (important), $loop_size (most probably
+# less important) within the "t/ddl_<engine>.test" and
+# maybe the "--testcase-timeout" assigned to mysqltest-run.pl
+# - vary the I/O performance of the testing machine by using
+# a RAM or disk based filesystem for VARDIR
+#
+
+
+#----------------------------------------------------------------------
+# Settings for Subtest 1 variants
+# Scenario: CREATE with UNIQUE KEY/INSERT/DROP TABLE like in Bug#28309
+let $create_table= CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = $engine_type;
+let $insert_into= INSERT INTO t1 VALUES (1,1), (2,2), (3,3);
+let $drop_table= DROP TABLE t1;
+#----------------------------------------------------------------------
+
+#
+--echo # Subtest 1A (one connection, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # default: $insert_into
+--echo # default: $drop_table
+--disable_query_log
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_table;
+ eval $insert_into;
+ eval $drop_table;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_query_log
+#
+--echo # Subtest 1B (one connection, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # default: $insert_into
+--echo # default: $drop_table
+--disable_query_log
+connection default;
+eval PREPARE create_table FROM "$create_table";
+EXECUTE create_table;
+eval PREPARE insert_into FROM "$insert_into";
+eval PREPARE drop_table FROM "$drop_table";
+EXECUTE drop_table;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_table;
+ EXECUTE insert_into;
+ EXECUTE drop_table;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_table;
+DEALLOCATE PREPARE insert_into;
+DEALLOCATE PREPARE drop_table;
+--enable_query_log
+#
+--echo # Subtest 1C (two connections, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # con2: $insert_into
+--echo # con2: $drop_table
+--disable_query_log
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_table;
+ connection con2;
+ eval $insert_into;
+ eval $drop_table;
+ connection default;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_query_log
+#
+--echo # Subtest 1D (two connections, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # con2: $insert_into
+--echo # con2: $drop_table
+--disable_query_log
+connection default;
+eval PREPARE create_table FROM "$create_table";
+EXECUTE create_table;
+connection con2;
+eval PREPARE insert_into FROM "$insert_into";
+eval PREPARE drop_table FROM "$drop_table";
+EXECUTE drop_table;
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_table;
+ connection con2;
+ EXECUTE insert_into;
+ EXECUTE drop_table;
+ connection default;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_table;
+connection con2;
+DEALLOCATE PREPARE insert_into;
+DEALLOCATE PREPARE drop_table;
+connection default;
+--enable_query_log
diff --git a/mysql-test/suite/stress/include/ddl2.inc b/mysql-test/suite/stress/include/ddl2.inc
new file mode 100644
index 00000000000..dd2ec0fd804
--- /dev/null
+++ b/mysql-test/suite/stress/include/ddl2.inc
@@ -0,0 +1,259 @@
+######## include/ddl2.inc ######
+#
+# Stress the storage engine with rapid CREATE/DROP TABLE/INDEX
+# and following SELECT/INSERT/SHOW etc.
+# Subtest 2 variants (2A - 2D)
+#
+# The variables
+# $loop_size -- number of rounds till we look at the clock again
+# $runtime -- rough intended runtime per subtest variant
+# $engine_type -- storage engine to be used in CREATE TABLE
+# must be set within the routine sourcing this script.
+#
+# Other stuff which must already exist:
+# - connection con2
+# - stmt_start and stmt_break prepared by the default connection
+#
+# Please look for more details within include/ddl1.inc.
+#
+# Creation of this test:
+# 2007-07-04 mleich
+#
+
+
+#----------------------------------------------------------------------
+# Settings for Subtest 2 variants
+# Scenario: CREATE TABLE AS SELECT/SELECT/DROP/SELECT(F)
+let $create_table= CREATE TABLE t1 ENGINE = $engine_type AS SELECT 1 AS f1;
+let $select_record= SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1;
+let $drop_table= DROP TABLE t1;
+#----------------------------------------------------------------------
+
+#
+--echo # Subtest 2A (one connection, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # default: $select_record
+--echo # default: $drop_table
+--echo # default: $select_record (expect to get ER_NO_SUCH_TABLE)
+--disable_query_log
+--disable_result_log
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_table;
+ if (`$select_record`)
+ {
+ --enable_result_log
+ --enable_query_log
+ --echo # Error: Unexpected content within t1.
+ --echo # Expected: 0
+ --echo # Got:
+ eval $select_record;
+ SELECT * FROM t1;
+ --echo # abort
+ exit;
+ }
+ eval $drop_table;
+ --error 0,ER_NO_SUCH_TABLE
+ eval $select_record;
+ if (!$mysql_errno)
+ {
+ --echo # Error: SELECT was successful though we expected ER_NO_SUCH_TABLE
+ --echo # abort
+ exit;
+ }
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 2B (one connection, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # default: $select_record
+--echo # default: $drop_table
+--echo # default: $select_record (expect to get ER_NO_SUCH_TABLE)
+--disable_query_log
+--disable_result_log
+connection default;
+eval PREPARE create_table FROM "$create_table";
+EXECUTE create_table;
+eval PREPARE select_record FROM "$select_record";
+eval PREPARE drop_table FROM "$drop_table";
+EXECUTE drop_table;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_table;
+ if (`EXECUTE select_record`)
+ {
+ --enable_result_log
+ --enable_query_log
+ --echo # Error: Unexpected content within t1.
+ --echo # Expected: 0
+ --echo # Got:
+ EXECUTE select_record;
+ SELECT * FROM t1;
+ --echo # abort
+ exit;
+ }
+ EXECUTE drop_table;
+ --error 0,ER_NO_SUCH_TABLE
+ EXECUTE select_record;
+ if (!$mysql_errno)
+ {
+ --echo # Error: SELECT was successful though we expected ER_NO_SUCH_TABLE
+ --echo # abort
+ exit;
+ }
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_table;
+DEALLOCATE PREPARE select_record;
+DEALLOCATE PREPARE drop_table;
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 2C (two connections, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # con2: $select_record
+--echo # default: $drop_table
+--echo # con2: $select_record (expect to get ER_NO_SUCH_TABLE)
+--disable_query_log
+--disable_result_log
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_table;
+ connection con2;
+ if (`$select_record`)
+ {
+ --enable_result_log
+ --enable_query_log
+ --echo # Error: Unexpected content within t1.
+ --echo # Expected: 0
+ --echo # Got:
+ eval $select_record;
+ SELECT * FROM t1;
+ --echo # abort
+ exit;
+ }
+ connection default;
+ eval $drop_table;
+ connection con2;
+ --error 0,ER_NO_SUCH_TABLE
+ eval $select_record;
+ if (!$mysql_errno)
+ {
+ --echo # Error: SELECT was successful though we expected ER_NO_SUCH_TABLE
+ --echo # abort
+ exit;
+ }
+ connection default;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 2D (two connections, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # con2: $select_record
+--echo # default: $drop_table
+--echo # con2: $select_record (expect to get ER_NO_SUCH_TABLE)
+--disable_query_log
+--disable_result_log
+connection default;
+eval PREPARE create_table FROM "$create_table";
+eval PREPARE drop_table FROM "$drop_table";
+EXECUTE create_table;
+connection con2;
+eval PREPARE select_record FROM "$select_record";
+connection default;
+EXECUTE drop_table;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_table;
+ connection con2;
+ if (`EXECUTE select_record`)
+ {
+ --enable_result_log
+ --enable_query_log
+ --echo # Error: Unexpected content within t1.
+ --echo # Expected: 0
+ --echo # Got:
+ EXECUTE select_record;
+ SELECT * FROM t1;
+ --echo # abort
+ exit;
+ }
+ connection default;
+ EXECUTE drop_table;
+ connection con2;
+ --error 0,ER_NO_SUCH_TABLE
+ EXECUTE select_record;
+ if (!$mysql_errno)
+ {
+ --echo # Error: SELECT was successful though we expected ER_NO_SUCH_TABLE
+ --echo # abort
+ exit;
+ }
+ connection default;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_table;
+DEALLOCATE PREPARE drop_table;
+connection con2;
+DEALLOCATE PREPARE select_record;
+connection default;
+--enable_result_log
+--enable_query_log
diff --git a/mysql-test/suite/stress/include/ddl3.inc b/mysql-test/suite/stress/include/ddl3.inc
new file mode 100644
index 00000000000..aacf09f9428
--- /dev/null
+++ b/mysql-test/suite/stress/include/ddl3.inc
@@ -0,0 +1,242 @@
+######## include/ddl3.inc ######
+#
+# Stress the storage engine with rapid CREATE/DROP TABLE/INDEX
+# and following SELECT/INSERT/SHOW etc.
+# Subtest 3 variants (3A - 3D)
+#
+# The variables
+# $loop_size -- number of rounds till we look at the clock again
+# $runtime -- rough intended runtime per subtest variant
+# $engine_type -- storage engine to be used in CREATE TABLE
+# must be set within the routine sourcing this script.
+#
+# Other stuff which must already exist:
+# - connection con2
+# - stmt_start and stmt_break prepared by the default connection
+#
+# Please look for more details within include/ddl2.inc.
+#
+# Creation of this test:
+# 2007-07-04 mleich
+#
+
+
+#----------------------------------------------------------------------
+# Settings for Subtest 3 variants
+# Scenario: CREATE TABLE/CREATE TABLE(F)/DROP TABLE/DROP TABLE(F)
+let $create_table= CREATE TABLE t1 (f1 BIGINT) ENGINE=$engine_type;
+let $drop_table= DROP TABLE t1;
+#----------------------------------------------------------------------
+
+#
+--echo # Subtest 3A (one connection, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # default: $create_table (expect to get ER_TABLE_EXISTS_ERROR)
+--echo # default: $drop_table
+--echo # default: $drop_table (expect to get ER_BAD_TABLE_ERROR)
+--disable_query_log
+--disable_result_log
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_table;
+ --error 0,ER_TABLE_EXISTS_ERROR
+ eval $create_table;
+ if (!$mysql_errno)
+ {
+ --echo # Error: CREATE TABLE was successful though we expected ER_TABLE_EXISTS_ERROR
+ --echo # abort
+ exit;
+ }
+ eval $drop_table;
+ --error 0,ER_BAD_TABLE_ERROR
+ eval $drop_table;
+ if (!$mysql_errno)
+ {
+ --echo # Error: DROP TABLE was successful though we expected ER_BAD_TABLE_ERROR)
+ --echo # abort
+ exit;
+ }
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 3B (one connection, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # default: $create_table (expect to get ER_TABLE_EXISTS_ERROR)
+--echo # default: $drop_table
+--echo # default: $drop_table (expect to get ER_BAD_TABLE_ERROR)
+--disable_query_log
+--disable_result_log
+connection default;
+eval PREPARE create_table FROM "$create_table";
+EXECUTE create_table;
+eval PREPARE drop_table FROM "$drop_table";
+EXECUTE drop_table;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_table;
+ --error 0,ER_TABLE_EXISTS_ERROR
+ EXECUTE create_table;
+ if (!$mysql_errno)
+ {
+ --echo # Error: CREATE TABLE was successful though we expected ER_TABLE_EXISTS_ERROR
+ --echo # abort
+ exit;
+ }
+ EXECUTE drop_table;
+ --error 0,ER_BAD_TABLE_ERROR
+ EXECUTE drop_table;
+ if (!$mysql_errno)
+ {
+ --echo # Error: DROP TABLE was successful though we expected ER_BAD_TABLE_ERROR)
+ --echo # abort
+ exit;
+ }
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_table;
+DEALLOCATE PREPARE drop_table;
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 3C (two connections, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # con2: $create_table (expect to get ER_TABLE_EXISTS_ERROR)
+--echo # default: $drop_table
+--echo # con2: $drop_table (expect to get ER_BAD_TABLE_ERROR)
+--disable_query_log
+--disable_result_log
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_table;
+ connection con2;
+ --error 0,ER_TABLE_EXISTS_ERROR
+ eval $create_table;
+ if (!$mysql_errno)
+ {
+ --echo # Error: CREATE TABLE was successful though we expected ER_TABLE_EXISTS_ERROR
+ --echo # abort
+ exit;
+ }
+ connection default;
+ eval $drop_table;
+ connection con2;
+ --error 0,ER_BAD_TABLE_ERROR
+ eval $drop_table;
+ if (!$mysql_errno)
+ {
+ --echo # Error: DROP TABLE was successful though we expected ER_BAD_TABLE_ERROR)
+ --echo # abort
+ exit;
+ }
+ connection default;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 3D (two connections, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # con2: $create_table (expect to get ER_TABLE_EXISTS_ERROR)
+--echo # default: $drop_table
+--echo # con2: $drop_table (expect to get ER_BAD_TABLE_ERROR)
+--disable_query_log
+--disable_result_log
+connection default;
+eval PREPARE create_table FROM "$create_table";
+eval PREPARE drop_table FROM "$drop_table";
+EXECUTE create_table;
+connection con2;
+eval PREPARE create_table FROM "$create_table";
+eval PREPARE drop_table FROM "$drop_table";
+EXECUTE drop_table;
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_table;
+ connection con2;
+ --error 0,ER_TABLE_EXISTS_ERROR
+ EXECUTE create_table;
+ if (!$mysql_errno)
+ {
+ --echo # Error: CREATE TABLE was successful though we expected ER_TABLE_EXISTS_ERROR
+ --echo # abort
+ exit;
+ }
+ connection default;
+ EXECUTE drop_table;
+ connection con2;
+ --error 0,ER_BAD_TABLE_ERROR
+ EXECUTE drop_table;
+ if (!$mysql_errno)
+ {
+ --echo # Error: DROP TABLE was successful though we expected ER_BAD_TABLE_ERROR)
+ --echo # abort
+ exit;
+ }
+ connection default;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_table;
+DEALLOCATE PREPARE drop_table;
+connection con2;
+DEALLOCATE PREPARE create_table;
+DEALLOCATE PREPARE drop_table;
+connection default;
+--enable_result_log
+--enable_query_log
diff --git a/mysql-test/suite/stress/include/ddl4.inc b/mysql-test/suite/stress/include/ddl4.inc
new file mode 100644
index 00000000000..10452a453a5
--- /dev/null
+++ b/mysql-test/suite/stress/include/ddl4.inc
@@ -0,0 +1,339 @@
+######## include/ddl4.inc ######
+#
+# Stress the storage engine with rapid CREATE/DROP TABLE/INDEX
+# and following SELECT/INSERT/SHOW etc.
+# Subtest 4 variants (4A - 4D)
+#
+# The variables
+# $loop_size -- number of rounds till we look at the clock again
+# $runtime -- rough intended runtime per subtest variant
+# $engine_type -- storage engine to be used in CREATE TABLE
+# must be set within the routine sourcing this script.
+#
+# Other stuff which must already exist:
+# - connection con2
+# - stmt_start and stmt_break prepared by the default connection
+#
+# Please look for more details within include/ddl1.inc.
+#
+# Creation of this test:
+# 2007-07-04 mleich
+#
+
+
+#----------------------------------------------------------------------
+# Settings for Subtest 4 variants
+# Scenario: CREATE TABLE variant1/SHOW/DROP TABLE/SHOW(F)/
+# CREATE TABLE variant2/SHOW/DROP TABLE
+let $create_table1= CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=$engine_type;
+let $create_table2= CREATE TABLE t1 (f1 BIGINT) ENGINE=$engine_type;
+let $show_table= SHOW CREATE TABLE t1;
+let $drop_table= DROP TABLE t1;
+#
+eval $create_table1;
+let $cr_value1= INITIALIZED;
+let $cr_value1= query_get_value($show_table, Create Table, 1);
+eval $drop_table;
+eval $create_table2;
+let $cr_value2= INITIALIZED;
+let $cr_value2= query_get_value($show_table, Create Table, 1);
+eval $drop_table;
+if (`SELECT '$cr_value1' = '$cr_value2'`)
+{
+ --echo # Error during generation of prerequisites.
+ --echo # cr_value1 equals cr_value2
+ --echo # cr_value1: $cr_value1
+ --echo # cr_value2: $cr_value2
+ --echo # abort
+ exit;
+}
+#----------------------------------------------------------------------
+
+#
+--echo # Subtest 4A (one connection, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table1
+--echo # default: $show_table
+--echo # default: $drop_table
+--echo # default: $show_table (expect to get ER_NO_SUCH_TABLE)
+--echo # default: $create_table2
+--echo # default: $show_table
+--echo # default: $drop_table
+--disable_query_log
+--disable_result_log
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_table1;
+ let $value= INITIALIZED;
+ let $value= query_get_value($show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value1'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value1
+ --echo # abort
+ exit;
+ }
+ eval $drop_table;
+ --error 0,ER_NO_SUCH_TABLE
+ eval $show_table;
+ if (!$mysql_errno)
+ {
+ --echo # Error: SHOW CREATE TABLE was successful though we expected ER_NO_SUCH_TABLE)
+ --echo # abort
+ exit;
+ }
+ eval $create_table2;
+ let $value= INITIALIZED;
+ let $value= query_get_value($show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value2'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value2
+ --echo # abort
+ exit;
+ }
+ eval $drop_table;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 4B (one connection, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table1
+--echo # default: $show_table
+--echo # default: $drop_table
+--echo # default: $show_table (expect to get ER_NO_SUCH_TABLE)
+--echo # default: $create_table2
+--echo # default: $show_table
+--echo # default: $drop_table
+--disable_query_log
+--disable_result_log
+connection default;
+eval PREPARE create_table1 FROM "$create_table1";
+eval PREPARE create_table2 FROM "$create_table2";
+EXECUTE create_table1;
+eval PREPARE show_table FROM "$show_table";
+eval PREPARE drop_table FROM "$drop_table";
+EXECUTE drop_table;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_table1;
+ let $value= INITIALIZED;
+ let $value= query_get_value(EXECUTE show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value1'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value1
+ --echo # abort
+ exit;
+ }
+ EXECUTE drop_table;
+ --error 0,ER_NO_SUCH_TABLE
+ EXECUTE show_table;
+ if (!$mysql_errno)
+ {
+ --echo # Error: SHOW CREATE TABLE was successful though we expected ER_NO_SUCH_TABLE)
+ --echo # abort
+ exit;
+ }
+ EXECUTE create_table2;
+ let $value= INITIALIZED;
+ let $value= query_get_value(EXECUTE show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value2'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value2
+ --echo # abort
+ exit;
+ }
+ EXECUTE drop_table;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_table1;
+DEALLOCATE PREPARE create_table2;
+DEALLOCATE PREPARE show_table;
+DEALLOCATE PREPARE drop_table;
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 4C (two connections, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table1
+--echo # con2: $show_table
+--echo # default: $drop_table
+--echo # con2: $show_table (expect to get ER_NO_SUCH_TABLE)
+--echo # default: $create_table2
+--echo # con2: $show_table
+--echo # default: $drop_table
+--disable_query_log
+--disable_result_log
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_table1;
+ connection con2;
+ let $value= INITIALIZED;
+ let $value= query_get_value($show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value1'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value1
+ --echo # abort
+ exit;
+ }
+ connection default;
+ eval $drop_table;
+ connection con2;
+ --error 0,ER_NO_SUCH_TABLE
+ eval $show_table;
+ if (!$mysql_errno)
+ {
+ --echo # Error: SHOW CREATE TABLE was successful though we expected ER_NO_SUCH_TABLE)
+ --echo # abort
+ exit;
+ }
+ connection default;
+ eval $create_table2;
+ connection con2;
+ let $value= INITIALIZED;
+ let $value= query_get_value($show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value2'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value2
+ --echo # abort
+ exit;
+ }
+ connection default;
+ eval $drop_table;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 4D (two connections, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table1
+--echo # con2: $show_table
+--echo # default: $drop_table
+--echo # con2: $show_table (expect to get ER_NO_SUCH_TABLE)
+--echo # default: $create_table2
+--echo # con2: $show_table
+--echo # default: $drop_table
+--disable_query_log
+--disable_result_log
+connection default;
+eval PREPARE create_table1 FROM "$create_table1";
+eval PREPARE create_table2 FROM "$create_table2";
+eval PREPARE drop_table FROM "$drop_table";
+EXECUTE create_table1;
+connection con2;
+eval PREPARE show_table FROM "$show_table";
+connection default;
+EXECUTE drop_table;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_table1;
+ connection con2;
+ let $value= INITIALIZED;
+ let $value= query_get_value(EXECUTE show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value1'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value1
+ --echo # abort
+ exit;
+ }
+ connection default;
+ EXECUTE drop_table;
+ connection con2;
+ --error 0,ER_NO_SUCH_TABLE
+ EXECUTE show_table;
+ if (!$mysql_errno)
+ {
+ --echo # Error: SHOW CREATE TABLE was successful though we expected ER_NO_SUCH_TABLE)
+ --echo # abort
+ exit;
+ }
+ connection default;
+ EXECUTE create_table2;
+ connection con2;
+ let $value= INITIALIZED;
+ let $value= query_get_value(EXECUTE show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value2'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value2
+ --echo # abort
+ exit;
+ }
+ connection default;
+ EXECUTE drop_table;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_table1;
+DEALLOCATE PREPARE create_table2;
+DEALLOCATE PREPARE drop_table;
+connection con2;
+DEALLOCATE PREPARE show_table;
+connection default;
+--enable_result_log
+--enable_query_log
diff --git a/mysql-test/suite/stress/include/ddl5.inc b/mysql-test/suite/stress/include/ddl5.inc
new file mode 100644
index 00000000000..5a6c2fa0e96
--- /dev/null
+++ b/mysql-test/suite/stress/include/ddl5.inc
@@ -0,0 +1,227 @@
+######## include/ddl5.inc ######
+#
+# Stress the storage engine with rapid CREATE/DROP TABLE/INDEX
+# and following SELECT/INSERT/SHOW etc.
+# Subtest 5 variants (5A - 5D)
+#
+# The variables
+# $loop_size -- number of rounds till we look at the clock again
+# $runtime -- rough intended runtime per subtest variant
+# $engine_type -- storage engine to be used in CREATE TABLE
+# must be set within the routine sourcing this script.
+#
+# Other stuff which must already exist:
+# - connection con2
+# - stmt_start and stmt_break prepared by the default connection
+#
+# Please look for more details within include/ddl1.inc.
+#
+# Creation of this test:
+# 2007-07-04 mleich
+#
+
+#----------------------------------------------------------------------
+# Settings for Subtest 5 variants
+# Scenario: CREATE TABLE with AUTOINC/INSERT/SELECT/DROP TABLE
+let $create_table= CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = $engine_type;
+let $insert_into= INSERT INTO t1 SET f2 = 9;
+let $select_record= SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9;
+let $drop_table= DROP TABLE t1;
+#----------------------------------------------------------------------
+
+#
+--echo # Subtest 5A (one connection, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # default: $insert_into
+--echo # default: $select_record
+--echo # default: $drop_table
+--disable_query_log
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_table;
+ eval $insert_into;
+ if (`$select_record`)
+ {
+ --enable_result_log
+ --enable_query_log
+ --echo # Error: Unexpected content within t1.
+ --echo # Expected: 0
+ --echo # Got:
+ eval $select_record;
+ SELECT * FROM t1;
+ --echo # abort
+ exit;
+ }
+ eval $drop_table;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_query_log
+#
+--echo # Subtest 5B (one connection, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # default: $insert_into
+--echo # default: $select_record
+--echo # default: $drop_table
+--disable_query_log
+connection default;
+eval PREPARE create_table FROM "$create_table";
+EXECUTE create_table;
+eval PREPARE insert_into FROM "$insert_into";
+eval PREPARE select_record FROM "$select_record";
+eval PREPARE drop_table FROM "$drop_table";
+EXECUTE drop_table;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_table;
+ EXECUTE insert_into;
+ if (`EXECUTE select_record`)
+ {
+ --enable_result_log
+ --enable_query_log
+ --echo # Error: Unexpected content within t1.
+ --echo # Expected: 0
+ --echo # Got:
+ EXECUTE select_record;
+ SELECT * FROM t1;
+ --echo # abort
+ exit;
+ }
+ EXECUTE drop_table;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_table;
+DEALLOCATE PREPARE insert_into;
+DEALLOCATE PREPARE select_record;
+DEALLOCATE PREPARE drop_table;
+--enable_query_log
+#
+--echo # Subtest 5C (two connections, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # con2: $insert_into
+--echo # default: $select_record
+--echo # con2: $drop_table
+--disable_query_log
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_table;
+ connection con2;
+ eval $insert_into;
+ connection default;
+ if (`$select_record`)
+ {
+ --enable_result_log
+ --enable_query_log
+ --echo # Error: Unexpected content within t1.
+ --echo # Expected: 0
+ --echo # Got:
+ eval $select_record;
+ SELECT * FROM t1;
+ --echo # abort
+ exit;
+ }
+ connection con2;
+ eval $drop_table;
+ connection default;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_query_log
+#
+--echo # Subtest 5D (two connections, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # con2: $insert_into
+--echo # default: $select_record
+--echo # con2: $drop_table
+--disable_query_log
+connection default;
+eval PREPARE create_table FROM "$create_table";
+EXECUTE create_table;
+eval PREPARE select_record FROM "$select_record";
+connection con2;
+eval PREPARE insert_into FROM "$insert_into";
+eval PREPARE drop_table FROM "$drop_table";
+EXECUTE drop_table;
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_table;
+ connection con2;
+ EXECUTE insert_into;
+ connection default;
+ if (`EXECUTE select_record`)
+ {
+ --enable_result_log
+ --enable_query_log
+ --echo # Error: Unexpected content within t1.
+ --echo # Expected: 0
+ --echo # Got:
+ EXECUTE select_record;
+ SELECT * FROM t1;
+ --echo # abort
+ exit;
+ }
+ connection con2;
+ EXECUTE drop_table;
+ connection default;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_table;
+DEALLOCATE PREPARE select_record;
+connection con2;
+DEALLOCATE PREPARE insert_into;
+DEALLOCATE PREPARE drop_table;
+connection default;
+--enable_query_log
diff --git a/mysql-test/suite/stress/include/ddl6.inc b/mysql-test/suite/stress/include/ddl6.inc
new file mode 100644
index 00000000000..7bbfe300eaa
--- /dev/null
+++ b/mysql-test/suite/stress/include/ddl6.inc
@@ -0,0 +1,266 @@
+######## include/ddl6.inc ######
+#
+# Stress the storage engine with rapid CREATE/DROP TABLE/INDEX
+# and following SELECT/INSERT/SHOW etc.
+# Subtest 6 variants (6A - 6D)
+#
+# The variables
+# $loop_size -- number of rounds till we look at the clock again
+# $runtime -- rough intended runtime per subtest variant
+# $engine_type -- storage engine to be used in CREATE TABLE
+# must be set within the routine sourcing this script.
+#
+# Other stuff which must already exist:
+# - connection con2
+# - stmt_start and stmt_break prepared by the default connection
+#
+# Please look for more details within include/ddl1.inc.
+#
+# Creation of this test:
+# 2007-07-04 mleich
+#
+
+
+#----------------------------------------------------------------------
+# Settings for Subtest 6 variants
+# Scenario: CREATE INDEX/CREATE INDEX(F)/DROP INDEX/DROP INDEX(F)
+let $create_index= CREATE INDEX IDX1 ON t1 (f2);
+let $drop_index= DROP INDEX IDX1 ON t1;
+eval CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=$engine_type;
+#----------------------------------------------------------------------
+
+
+#
+--echo # Subtest 6A (one connection, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_index
+--echo # default: $create_index (expect to get ER_DUP_KEYNAME)
+--echo # default: $drop_index
+--echo # default: $drop_index (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+--echo # default: $create_index
+--echo # default: $drop_index
+--disable_query_log
+--disable_result_log
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_index;
+ --error 0,ER_DUP_KEYNAME
+ eval $create_index;
+ if (!$mysql_errno)
+ {
+ --echo # Error: CREATE INDEX was successful though we expected ER_DUP_KEYNAME
+ --echo # abort
+ exit;
+ }
+ eval $drop_index;
+ --error 0,ER_CANT_DROP_FIELD_OR_KEY
+ eval $drop_index;
+ if (!$mysql_errno)
+ {
+ --echo # Error: DROP INDEX was successful though we expected ER_CANT_DROP_FIELD_OR_KEY
+ --echo # abort
+ exit;
+ }
+ eval $create_index;
+ eval $drop_index;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 6B (one connection, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_index
+--echo # default: $create_index (expect to get ER_DUP_KEYNAME)
+--echo # default: $drop_index
+--echo # default: $drop_index (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+--echo # default: $create_index
+--echo # default: $drop_index
+--disable_query_log
+--disable_result_log
+connection default;
+eval PREPARE create_index FROM "$create_index";
+EXECUTE create_index;
+eval PREPARE drop_index FROM "$drop_index";
+EXECUTE drop_index;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_index;
+ --error 0,ER_DUP_KEYNAME
+ EXECUTE create_index;
+ if (!$mysql_errno)
+ {
+ --echo # Error: CREATE INDEX was successful though we expected ER_DUP_KEYNAME
+ --echo # abort
+ exit;
+ }
+ EXECUTE drop_index;
+ --error 0,ER_CANT_DROP_FIELD_OR_KEY
+ EXECUTE drop_index;
+ if (!$mysql_errno)
+ {
+ --echo # Error: DROP INDEX was successful though we expected ER_CANT_DROP_FIELD_OR_KEY
+ --echo # abort
+ exit;
+ }
+ EXECUTE create_index;
+ EXECUTE drop_index;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_index;
+DEALLOCATE PREPARE drop_index;
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 6C (two connections, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_index
+--echo # con2: $create_index (expect to get ER_DUP_KEYNAME)
+--echo # default: $drop_index
+--echo # con2: $drop_index (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+--echo # default: $create_index
+--echo # con2: $drop_index
+--disable_query_log
+--disable_result_log
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_index;
+ connection con2;
+ --error 0,ER_DUP_KEYNAME
+ eval $create_index;
+ if (!$mysql_errno)
+ {
+ --echo # Error: CREATE INDEX was successful though we expected ER_DUP_KEYNAME
+ --echo # abort
+ exit;
+ }
+ connection default;
+ eval $drop_index;
+ connection con2;
+ --error 0,ER_CANT_DROP_FIELD_OR_KEY
+ eval $drop_index;
+ if (!$mysql_errno)
+ {
+ --echo # Error: DROP INDEX was successful though we expected ER_CANT_DROP_FIELD_OR_KEY
+ --echo # abort
+ exit;
+ }
+ connection default;
+ eval $create_index;
+ connection con2;
+ eval $drop_index;
+ connection default;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 6D (two connections, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_index
+--echo # con2: $create_index (expect to get ER_DUP_KEYNAME)
+--echo # default: $drop_index
+--echo # con2: $drop_index (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+--echo # default: $create_index
+--echo # con2: $drop_index
+--disable_query_log
+--disable_result_log
+connection default;
+eval PREPARE create_index FROM "$create_index";
+eval PREPARE drop_index FROM "$drop_index";
+EXECUTE create_index;
+connection con2;
+eval PREPARE create_index FROM "$create_index";
+eval PREPARE drop_index FROM "$drop_index";
+EXECUTE drop_index;
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_index;
+ connection con2;
+ --error 0,ER_DUP_KEYNAME
+ EXECUTE create_index;
+ if (!$mysql_errno)
+ {
+ --echo # Error: CREATE INDEX was successful though we expected ER_DUP_KEYNAME
+ --echo # abort
+ exit;
+ }
+ connection default;
+ EXECUTE drop_index;
+ connection con2;
+ --error 0,ER_CANT_DROP_FIELD_OR_KEY
+ EXECUTE drop_index;
+ if (!$mysql_errno)
+ {
+ --echo # Error: DROP INDEX was successful though we expected ER_CANT_DROP_FIELD_OR_KEY
+ --echo # abort
+ exit;
+ }
+ connection default;
+ EXECUTE create_index;
+ connection con2;
+ EXECUTE drop_index;
+ connection default;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_index;
+DEALLOCATE PREPARE drop_index;
+connection con2;
+DEALLOCATE PREPARE create_index;
+DEALLOCATE PREPARE drop_index;
+connection default;
+--enable_result_log
+--enable_query_log
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/stress/include/ddl7.inc b/mysql-test/suite/stress/include/ddl7.inc
new file mode 100644
index 00000000000..76ba8066c66
--- /dev/null
+++ b/mysql-test/suite/stress/include/ddl7.inc
@@ -0,0 +1,274 @@
+######## include/ddl7.inc ######
+#
+# Stress the storage engine with rapid CREATE/DROP TABLE/INDEX
+# and following SELECT/INSERT/SHOW etc.
+# Subtest 7 variants (7A - 7D)
+#
+# The variables
+# $loop_size -- number of rounds till we look at the clock again
+# $runtime -- rough intended runtime per subtest variant
+# $engine_type -- storage engine to be used in CREATE TABLE
+# must be set within the routine sourcing this script.
+#
+# Other stuff which must already exist:
+# - connection con2
+# - stmt_start and stmt_break prepared by the default connection
+#
+# Please look for more details within include/ddl1.inc.
+#
+# Creation of this test:
+# 2007-07-04 mleich
+#
+
+
+#----------------------------------------------------------------------
+# Settings for Subtest 7 variants
+# Scenario: CREATE INDEX/INSERT(F)/DROP INDEX/INSERT/CREATE INDEX(F)/DELETE
+let $create_index= CREATE UNIQUE INDEX IDX1 ON t1 (f2);
+let $insert_record= INSERT INTO t1 VALUES(1,1);
+let $drop_index= DROP INDEX IDX1 ON t1;
+let $delete_record= DELETE FROM t1 WHERE f1 = 1;
+eval CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, PRIMARY KEY(f1)) ENGINE=$engine_type;
+INSERT INTO t1 VALUES(0,1);
+#----------------------------------------------------------------------
+
+#
+--echo # Subtest 7A (one connection, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_index
+--echo # default: $insert_record (expect to get ER_DUP_ENTRY)
+--echo # default: $drop_index
+--echo # default: $insert_record
+--echo # default: $create_index (expect to get ER_DUP_ENTRY)
+--echo # default: $delete_record
+--disable_query_log
+--disable_result_log
+connection default;
+let $run= 1;
+let $counter= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_index;
+ --error 0,ER_DUP_ENTRY
+ eval $insert_record;
+ if (!$mysql_errno)
+ {
+ --echo # Error: INSERT was successful though we expected ER_DUP_ENTRY
+ --echo # abort
+ exit;
+ }
+ eval $drop_index;
+ eval $insert_record;
+ # NDB: ER_DUP_UNIQUE, others: ER_DUP_ENTRY
+ --error 0,ER_DUP_ENTRY,ER_DUP_UNIQUE
+ eval $create_index;
+ if (!$mysql_errno)
+ {
+ --echo # Error: CREATE INDEX was successful though we expected ER_DUP_ENTRY
+ --echo # Error: or ER_DUP_UNIQUE (NDB only)
+ --echo # abort
+ exit;
+ }
+ eval $delete_record;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 7B (one connection, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_index
+--echo # default: $insert_record (expect to get ER_DUP_ENTRY)
+--echo # default: $drop_index
+--echo # default: $insert_record
+--echo # default: $create_index (expect to get ER_DUP_ENTRY)
+--echo # default: $delete_record
+--disable_query_log
+--disable_result_log
+connection default;
+eval PREPARE create_index FROM "$create_index";
+eval PREPARE insert_record FROM "$insert_record";
+eval PREPARE delete_record FROM "$delete_record";
+eval PREPARE drop_index FROM "$drop_index";
+let $run= 1;
+let $counter= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_index;
+ --error 0,ER_DUP_ENTRY
+ EXECUTE insert_record;
+ if (!$mysql_errno)
+ {
+ --echo # Error: INSERT was successful though we expected ER_DUP_ENTRY
+ --echo # abort
+ exit;
+ }
+ EXECUTE drop_index;
+ EXECUTE insert_record;
+ --error 0,ER_DUP_ENTRY
+ EXECUTE create_index;
+ if (!$mysql_errno)
+ {
+ --echo # Error: CREATE INDEX was successful though we expected ER_DUP_ENTRY
+ --echo # abort
+ exit;
+ }
+ EXECUTE delete_record;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_index;
+DEALLOCATE PREPARE insert_record;
+DEALLOCATE PREPARE delete_record;
+DEALLOCATE PREPARE drop_index;
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 7C (two connections, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_index
+--echo # default: $insert_record (expect to get ER_DUP_ENTRY)
+--echo # con2: $drop_index
+--echo # default: $insert_record
+--echo # con2: $create_index (expect to get ER_DUP_ENTRY)
+--echo # con2: $delete_record
+--disable_query_log
+--disable_result_log
+connection default;
+let $run= 1;
+let $counter= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_index;
+ --error 0,ER_DUP_ENTRY
+ eval $insert_record;
+ if (!$mysql_errno)
+ {
+ --echo # Error: INSERT was successful though we expected ER_DUP_ENTRY
+ --echo # abort
+ exit;
+ }
+ connection con2;
+ eval $drop_index;
+ connection default;
+ eval $insert_record;
+ connection con2;
+ --error 0,ER_DUP_ENTRY
+ eval $create_index;
+ if (!$mysql_errno)
+ {
+ --echo # Error: CREATE INDEX was successful though we expected ER_DUP_ENTRY
+ --echo # abort
+ exit;
+ }
+ eval $delete_record;
+ connection default;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 7D (two connections, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_index
+--echo # default: $insert_record (expect to get ER_DUP_ENTRY)
+--echo # con2: $drop_index
+--echo # default: $insert_record
+--echo # con2: $create_index (expect to get ER_DUP_ENTRY)
+--echo # con2: $delete_record
+--disable_query_log
+--disable_result_log
+connection default;
+eval PREPARE create_index FROM "$create_index";
+eval PREPARE insert_record FROM "$insert_record";
+EXECUTE create_index;
+connection con2;
+eval PREPARE create_index FROM "$create_index";
+eval PREPARE drop_index FROM "$drop_index";
+eval PREPARE delete_record FROM "$delete_record";
+EXECUTE drop_index;
+connection default;
+let $run= 1;
+let $counter= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_index;
+ --error 0,ER_DUP_ENTRY
+ EXECUTE insert_record;
+ if (!$mysql_errno)
+ {
+ --echo # Error: INSERT was successful though we expected ER_DUP_ENTRY
+ --echo # abort
+ exit;
+ }
+ connection con2;
+ EXECUTE drop_index;
+ connection default;
+ EXECUTE insert_record;
+ connection con2;
+ --error 0,ER_DUP_ENTRY
+ EXECUTE create_index;
+ if (!$mysql_errno)
+ {
+ --echo # Error: CREATE INDEX was successful though we expected ER_DUP_ENTRY
+ --echo # abort
+ exit;
+ }
+ EXECUTE delete_record;
+ connection default;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_index;
+DEALLOCATE PREPARE insert_record;
+connection con2;
+DEALLOCATE PREPARE create_index;
+DEALLOCATE PREPARE drop_index;
+DEALLOCATE PREPARE delete_record;
+connection default;
+--enable_result_log
+--enable_query_log
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/stress/include/ddl8.inc b/mysql-test/suite/stress/include/ddl8.inc
new file mode 100644
index 00000000000..85a70770a56
--- /dev/null
+++ b/mysql-test/suite/stress/include/ddl8.inc
@@ -0,0 +1,302 @@
+######## include/ddl8.inc ######
+#
+# Stress the storage engine with rapid CREATE/DROP TABLE/INDEX
+# and following SELECT/INSERT/SHOW etc.
+# Subtest 8 variants (8A - 8D)
+#
+# The variables
+# $loop_size -- number of rounds till we look at the clock again
+# $runtime -- rough intended runtime per subtest variant
+# $engine_type -- storage engine to be used in CREATE TABLE
+# must be set within the routine sourcing this script.
+#
+# Other stuff which must already exist:
+# - connection con2
+# - stmt_start and stmt_break prepared by the default connection
+#
+# Please look for more details within include/ddl1.inc.
+#
+# Creation of this test:
+# 2007-07-04 mleich
+#
+
+
+#----------------------------------------------------------------------
+# Settings for Subtest 8 variants
+# Scenario: CREATE INDEX variant1/SHOW/DROP INDEX/
+# CREATE INDEX variant2/SHOW/DROP INDEX
+let $create_index1= CREATE INDEX IDX ON t1 (f2);
+let $create_index2= CREATE UNIQUE INDEX IDX ON t1 (f2);
+let $show_table= SHOW CREATE TABLE t1;
+let $drop_index= DROP INDEX IDX ON t1;
+eval CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=$engine_type;
+INSERT INTO t1 VALUES(1,1);
+eval $create_index1;
+let $cr_value1= INITIALIZED;
+let $cr_value1= query_get_value($show_table, Create Table, 1);
+eval $drop_index;
+eval $create_index2;
+let $cr_value2= INITIALIZED;
+let $cr_value2= query_get_value($show_table, Create Table, 1);
+eval $drop_index;
+if (`SELECT '$cr_value1' = '$cr_value2'`)
+{
+ --echo # Error during generation of prerequisites.
+ --echo # cr_value1 equals cr_value2
+ --echo # cr_value1: $cr_value1
+ --echo # cr_value2: $cr_value2
+ --echo # abort
+ exit;
+}
+#----------------------------------------------------------------------
+
+#
+--echo # Subtest 8A (one connection, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_index1
+--echo # default: $show_table
+--echo # default: $drop_index
+--echo # default: $create_index2
+--echo # default: $show_table
+--echo # default: $drop_index
+--disable_query_log
+--disable_result_log
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_index1;
+ let $value= INITIALIZED;
+ let $value= query_get_value($show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value1'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value1
+ --echo # abort
+ exit;
+ }
+ eval $drop_index;
+ eval $create_index2;
+ let $value= INITIALIZED;
+ let $value= query_get_value($show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value2'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value2
+ --echo # abort
+ exit;
+ }
+ eval $drop_index;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 8B (one connection, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_index1
+--echo # default: $show_table
+--echo # default: $drop_index
+--echo # default: $create_index2
+--echo # default: $show_table
+--echo # default: $drop_index
+--disable_query_log
+--disable_result_log
+connection default;
+eval PREPARE create_index1 FROM "$create_index1";
+eval PREPARE create_index2 FROM "$create_index2";
+EXECUTE create_index1;
+eval PREPARE show_table FROM "$show_table";
+eval PREPARE drop_index FROM "$drop_index";
+EXECUTE drop_index;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_index1;
+ let $value= INITIALIZED;
+ let $value= query_get_value(EXECUTE show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value1'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value1
+ --echo # abort
+ exit;
+ }
+ EXECUTE drop_index;
+ EXECUTE create_index2;
+ let $value= INITIALIZED;
+ let $value= query_get_value(EXECUTE show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value2'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value2
+ --echo # abort
+ exit;
+ }
+ EXECUTE drop_index;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_index1;
+DEALLOCATE PREPARE create_index2;
+DEALLOCATE PREPARE show_table;
+DEALLOCATE PREPARE drop_index;
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 8C (two connections, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_index1
+--echo # con2: $show_table
+--echo # default: $drop_index
+--echo # default: $create_index2
+--echo # con2: $show_table
+--echo # default: $drop_index
+--disable_query_log
+--disable_result_log
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_index1;
+ connection con2;
+ let $value= INITIALIZED;
+ let $value= query_get_value($show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value1'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value1
+ --echo # abort
+ exit;
+ }
+ connection default;
+ eval $drop_index;
+ eval $create_index2;
+ connection con2;
+ let $value= INITIALIZED;
+ let $value= query_get_value($show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value2'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value2
+ --echo # abort
+ exit;
+ }
+ connection default;
+ eval $drop_index;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 8D (two connections, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_index1
+--echo # con2: $show_table
+--echo # default: $drop_index
+--echo # default: $create_index2
+--echo # con2: $show_table
+--echo # default: $drop_index
+--disable_query_log
+--disable_result_log
+connection default;
+eval PREPARE create_index1 FROM "$create_index1";
+eval PREPARE create_index2 FROM "$create_index2";
+eval PREPARE drop_index FROM "$drop_index";
+EXECUTE create_index1;
+connection con2;
+eval PREPARE show_table FROM "$show_table";
+connection default;
+EXECUTE drop_index;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_index1;
+ connection con2;
+ let $value= INITIALIZED;
+ let $value= query_get_value(EXECUTE show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value1'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value1
+ --echo # abort
+ exit;
+ }
+ connection default;
+ EXECUTE drop_index;
+ EXECUTE create_index2;
+ connection con2;
+ let $value= INITIALIZED;
+ let $value= query_get_value(EXECUTE show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value2'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value2
+ --echo # abort
+ exit;
+ }
+ connection default;
+ EXECUTE drop_index;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_index1;
+DEALLOCATE PREPARE create_index2;
+DEALLOCATE PREPARE drop_index;
+connection con2;
+DEALLOCATE PREPARE show_table;
+connection default;
+--enable_result_log
+--enable_query_log
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/stress/r/ddl_archive.result b/mysql-test/suite/stress/r/ddl_archive.result
new file mode 100644
index 00000000000..47c64a6af94
--- /dev/null
+++ b/mysql-test/suite/stress/r/ddl_archive.result
@@ -0,0 +1,79 @@
+SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
+PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start";
+SET @runtime = <intended_runtime>;
+PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1";
+DROP TABLE IF EXISTS t1;
+# Subtest 2A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = ARCHIVE AS SELECT 1 AS f1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = ARCHIVE AS SELECT 1 AS f1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = ARCHIVE AS SELECT 1 AS f1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = ARCHIVE AS SELECT 1 AS f1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 3A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE
+# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE
+# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 5A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = ARCHIVE
+# default: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# default: DROP TABLE t1
+# Subtest 5B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = ARCHIVE
+# default: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# default: DROP TABLE t1
+# Subtest 5C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = ARCHIVE
+# con2: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# con2: DROP TABLE t1
+# Subtest 5D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = ARCHIVE
+# con2: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# con2: DROP TABLE t1
+DEALLOCATE PREPARE stmt_start;
+DEALLOCATE PREPARE stmt_break;
diff --git a/mysql-test/suite/stress/r/ddl_csv.result b/mysql-test/suite/stress/r/ddl_csv.result
new file mode 100644
index 00000000000..3dfa0c8fd15
--- /dev/null
+++ b/mysql-test/suite/stress/r/ddl_csv.result
@@ -0,0 +1,55 @@
+SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
+PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start";
+SET @runtime = <intended_runtime>;
+PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1";
+DROP TABLE IF EXISTS t1;
+# Subtest 2A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = CSV AS SELECT 1 AS f1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = CSV AS SELECT 1 AS f1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = CSV AS SELECT 1 AS f1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = CSV AS SELECT 1 AS f1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 3A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV
+# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV
+# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+DEALLOCATE PREPARE stmt_start;
+DEALLOCATE PREPARE stmt_break;
diff --git a/mysql-test/suite/stress/r/ddl_innodb.result b/mysql-test/suite/stress/r/ddl_innodb.result
new file mode 100644
index 00000000000..6417d3e1c5c
--- /dev/null
+++ b/mysql-test/suite/stress/r/ddl_innodb.result
@@ -0,0 +1,251 @@
+SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
+PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start";
+SET @runtime = <intended_runtime>;
+PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1";
+DROP TABLE IF EXISTS t1;
+# Subtest 1A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = InnoDB
+# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# default: DROP TABLE t1
+# Subtest 1B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = InnoDB
+# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# default: DROP TABLE t1
+# Subtest 1C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = InnoDB
+# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# con2: DROP TABLE t1
+# Subtest 1D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = InnoDB
+# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# con2: DROP TABLE t1
+# Subtest 2A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = InnoDB AS SELECT 1 AS f1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = InnoDB AS SELECT 1 AS f1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = InnoDB AS SELECT 1 AS f1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = InnoDB AS SELECT 1 AS f1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 3A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB
+# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB
+# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=InnoDB;
+DROP TABLE t1;
+CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB;
+DROP TABLE t1;
+# Subtest 4A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=InnoDB
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 4B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=InnoDB
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 4C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=InnoDB
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 4D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=InnoDB
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 5A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = InnoDB
+# default: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# default: DROP TABLE t1
+# Subtest 5B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = InnoDB
+# default: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# default: DROP TABLE t1
+# Subtest 5C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = InnoDB
+# con2: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# con2: DROP TABLE t1
+# Subtest 5D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = InnoDB
+# con2: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# con2: DROP TABLE t1
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=InnoDB;
+# Subtest 6A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: DROP INDEX IDX1 ON t1
+# Subtest 6B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: DROP INDEX IDX1 ON t1
+# Subtest 6C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: DROP INDEX IDX1 ON t1
+# Subtest 6D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: DROP INDEX IDX1 ON t1
+DROP TABLE t1;
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, PRIMARY KEY(f1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(0,1);
+# Subtest 7A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2)
+# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY)
+# default: DROP INDEX IDX1 ON t1
+# default: INSERT INTO t1 VALUES(1,1)
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY)
+# default: DELETE FROM t1 WHERE f1 = 1
+# Subtest 7B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2)
+# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY)
+# default: DROP INDEX IDX1 ON t1
+# default: INSERT INTO t1 VALUES(1,1)
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY)
+# default: DELETE FROM t1 WHERE f1 = 1
+# Subtest 7C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2)
+# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY)
+# con2: DROP INDEX IDX1 ON t1
+# default: INSERT INTO t1 VALUES(1,1)
+# con2: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY)
+# con2: DELETE FROM t1 WHERE f1 = 1
+# Subtest 7D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2)
+# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY)
+# con2: DROP INDEX IDX1 ON t1
+# default: INSERT INTO t1 VALUES(1,1)
+# con2: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY)
+# con2: DELETE FROM t1 WHERE f1 = 1
+DROP TABLE t1;
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1,1);
+CREATE INDEX IDX ON t1 (f2);
+DROP INDEX IDX ON t1;
+CREATE UNIQUE INDEX IDX ON t1 (f2);
+DROP INDEX IDX ON t1;
+# Subtest 8A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# Subtest 8B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# Subtest 8C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# Subtest 8D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+DROP TABLE t1;
+DEALLOCATE PREPARE stmt_start;
+DEALLOCATE PREPARE stmt_break;
diff --git a/mysql-test/suite/stress/r/ddl_memory.result b/mysql-test/suite/stress/r/ddl_memory.result
new file mode 100644
index 00000000000..1700fbc2745
--- /dev/null
+++ b/mysql-test/suite/stress/r/ddl_memory.result
@@ -0,0 +1,251 @@
+SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
+PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start";
+SET @runtime = <intended_runtime>;
+PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1";
+DROP TABLE IF EXISTS t1;
+# Subtest 1A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = MEMORY
+# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# default: DROP TABLE t1
+# Subtest 1B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = MEMORY
+# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# default: DROP TABLE t1
+# Subtest 1C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = MEMORY
+# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# con2: DROP TABLE t1
+# Subtest 1D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = MEMORY
+# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# con2: DROP TABLE t1
+# Subtest 2A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = MEMORY AS SELECT 1 AS f1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = MEMORY AS SELECT 1 AS f1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = MEMORY AS SELECT 1 AS f1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = MEMORY AS SELECT 1 AS f1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 3A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY
+# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY
+# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MEMORY;
+DROP TABLE t1;
+CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY;
+DROP TABLE t1;
+# Subtest 4A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MEMORY
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 4B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MEMORY
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 4C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MEMORY
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 4D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MEMORY
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 5A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MEMORY
+# default: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# default: DROP TABLE t1
+# Subtest 5B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MEMORY
+# default: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# default: DROP TABLE t1
+# Subtest 5C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MEMORY
+# con2: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# con2: DROP TABLE t1
+# Subtest 5D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MEMORY
+# con2: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# con2: DROP TABLE t1
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=MEMORY;
+# Subtest 6A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: DROP INDEX IDX1 ON t1
+# Subtest 6B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: DROP INDEX IDX1 ON t1
+# Subtest 6C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: DROP INDEX IDX1 ON t1
+# Subtest 6D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: DROP INDEX IDX1 ON t1
+DROP TABLE t1;
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, PRIMARY KEY(f1)) ENGINE=MEMORY;
+INSERT INTO t1 VALUES(0,1);
+# Subtest 7A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2)
+# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY)
+# default: DROP INDEX IDX1 ON t1
+# default: INSERT INTO t1 VALUES(1,1)
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY)
+# default: DELETE FROM t1 WHERE f1 = 1
+# Subtest 7B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2)
+# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY)
+# default: DROP INDEX IDX1 ON t1
+# default: INSERT INTO t1 VALUES(1,1)
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY)
+# default: DELETE FROM t1 WHERE f1 = 1
+# Subtest 7C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2)
+# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY)
+# con2: DROP INDEX IDX1 ON t1
+# default: INSERT INTO t1 VALUES(1,1)
+# con2: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY)
+# con2: DELETE FROM t1 WHERE f1 = 1
+# Subtest 7D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2)
+# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY)
+# con2: DROP INDEX IDX1 ON t1
+# default: INSERT INTO t1 VALUES(1,1)
+# con2: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY)
+# con2: DELETE FROM t1 WHERE f1 = 1
+DROP TABLE t1;
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=MEMORY;
+INSERT INTO t1 VALUES(1,1);
+CREATE INDEX IDX ON t1 (f2);
+DROP INDEX IDX ON t1;
+CREATE UNIQUE INDEX IDX ON t1 (f2);
+DROP INDEX IDX ON t1;
+# Subtest 8A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# Subtest 8B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# Subtest 8C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# Subtest 8D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+DROP TABLE t1;
+DEALLOCATE PREPARE stmt_start;
+DEALLOCATE PREPARE stmt_break;
diff --git a/mysql-test/suite/stress/r/ddl_myisam.result b/mysql-test/suite/stress/r/ddl_myisam.result
new file mode 100644
index 00000000000..82be55b8371
--- /dev/null
+++ b/mysql-test/suite/stress/r/ddl_myisam.result
@@ -0,0 +1,251 @@
+SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
+PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start";
+SET @runtime = <intended_runtime>;
+PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1";
+DROP TABLE IF EXISTS t1;
+# Subtest 1A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = MyISAM
+# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# default: DROP TABLE t1
+# Subtest 1B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = MyISAM
+# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# default: DROP TABLE t1
+# Subtest 1C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = MyISAM
+# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# con2: DROP TABLE t1
+# Subtest 1D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = MyISAM
+# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# con2: DROP TABLE t1
+# Subtest 2A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = MyISAM AS SELECT 1 AS f1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = MyISAM AS SELECT 1 AS f1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = MyISAM AS SELECT 1 AS f1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = MyISAM AS SELECT 1 AS f1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 3A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM
+# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM
+# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MyISAM;
+DROP TABLE t1;
+CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM;
+DROP TABLE t1;
+# Subtest 4A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MyISAM
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 4B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MyISAM
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 4C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MyISAM
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 4D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MyISAM
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 5A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MyISAM
+# default: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# default: DROP TABLE t1
+# Subtest 5B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MyISAM
+# default: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# default: DROP TABLE t1
+# Subtest 5C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MyISAM
+# con2: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# con2: DROP TABLE t1
+# Subtest 5D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MyISAM
+# con2: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# con2: DROP TABLE t1
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=MyISAM;
+# Subtest 6A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: DROP INDEX IDX1 ON t1
+# Subtest 6B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: DROP INDEX IDX1 ON t1
+# Subtest 6C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: DROP INDEX IDX1 ON t1
+# Subtest 6D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: DROP INDEX IDX1 ON t1
+DROP TABLE t1;
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, PRIMARY KEY(f1)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES(0,1);
+# Subtest 7A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2)
+# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY)
+# default: DROP INDEX IDX1 ON t1
+# default: INSERT INTO t1 VALUES(1,1)
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY)
+# default: DELETE FROM t1 WHERE f1 = 1
+# Subtest 7B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2)
+# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY)
+# default: DROP INDEX IDX1 ON t1
+# default: INSERT INTO t1 VALUES(1,1)
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY)
+# default: DELETE FROM t1 WHERE f1 = 1
+# Subtest 7C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2)
+# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY)
+# con2: DROP INDEX IDX1 ON t1
+# default: INSERT INTO t1 VALUES(1,1)
+# con2: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY)
+# con2: DELETE FROM t1 WHERE f1 = 1
+# Subtest 7D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2)
+# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY)
+# con2: DROP INDEX IDX1 ON t1
+# default: INSERT INTO t1 VALUES(1,1)
+# con2: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY)
+# con2: DELETE FROM t1 WHERE f1 = 1
+DROP TABLE t1;
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES(1,1);
+CREATE INDEX IDX ON t1 (f2);
+DROP INDEX IDX ON t1;
+CREATE UNIQUE INDEX IDX ON t1 (f2);
+DROP INDEX IDX ON t1;
+# Subtest 8A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# Subtest 8B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# Subtest 8C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# Subtest 8D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+DROP TABLE t1;
+DEALLOCATE PREPARE stmt_start;
+DEALLOCATE PREPARE stmt_break;
diff --git a/mysql-test/suite/stress/r/ddl_ndb.result b/mysql-test/suite/stress/r/ddl_ndb.result
new file mode 100644
index 00000000000..39146e65fb0
--- /dev/null
+++ b/mysql-test/suite/stress/r/ddl_ndb.result
@@ -0,0 +1,216 @@
+SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
+PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start";
+SET @runtime = <intended_runtime>;
+PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1";
+DROP TABLE IF EXISTS t1;
+# Subtest 1A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = NDB
+# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# default: DROP TABLE t1
+# Subtest 1B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = NDB
+# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# default: DROP TABLE t1
+# Subtest 1C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = NDB
+# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# con2: DROP TABLE t1
+# Subtest 1D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = NDB
+# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# con2: DROP TABLE t1
+# Subtest 2A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = NDB AS SELECT 1 AS f1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = NDB AS SELECT 1 AS f1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = NDB AS SELECT 1 AS f1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = NDB AS SELECT 1 AS f1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 3A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB
+# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB
+# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=NDB;
+DROP TABLE t1;
+CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB;
+DROP TABLE t1;
+# Subtest 4A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=NDB
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 4B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=NDB
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 4C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=NDB
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 4D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=NDB
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 5A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = NDB
+# default: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# default: DROP TABLE t1
+# Subtest 5B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = NDB
+# default: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# default: DROP TABLE t1
+# Subtest 5C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = NDB
+# con2: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# con2: DROP TABLE t1
+# Subtest 5D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = NDB
+# con2: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# con2: DROP TABLE t1
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=NDB;
+# Subtest 6A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: DROP INDEX IDX1 ON t1
+# Subtest 6B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: DROP INDEX IDX1 ON t1
+# Subtest 6C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: DROP INDEX IDX1 ON t1
+# Subtest 6D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: DROP INDEX IDX1 ON t1
+DROP TABLE t1;
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=NDB;
+INSERT INTO t1 VALUES(1,1);
+CREATE INDEX IDX ON t1 (f2);
+DROP INDEX IDX ON t1;
+CREATE UNIQUE INDEX IDX ON t1 (f2);
+DROP INDEX IDX ON t1;
+# Subtest 8A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# Subtest 8B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# Subtest 8C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# Subtest 8D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+DROP TABLE t1;
+DEALLOCATE PREPARE stmt_start;
+DEALLOCATE PREPARE stmt_break;
diff --git a/mysql-test/suite/stress/t/ddl_archive.test b/mysql-test/suite/stress/t/ddl_archive.test
new file mode 100644
index 00000000000..0c47b5fcdd5
--- /dev/null
+++ b/mysql-test/suite/stress/t/ddl_archive.test
@@ -0,0 +1,51 @@
+######## t/ddl_archive.test ######
+#
+# Stress the storage engine ARCHIVE with CREATE/DROP TABLE/INDEX
+#
+# Please look for details within include/ddl1.inc.
+#
+# Creation of this test:
+# 2007-07-04 mleich
+#
+
+# Storage engine to be used in CREATE TABLE
+--source include/have_archive.inc
+let $engine_type= ARCHIVE;
+
+
+if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`)
+{
+ --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
+}
+let $run= `SELECT '$BIG_TEST' = '1'`;
+if ($run)
+{
+ # A run started with "--big-test" should be allowed to consume more time.
+ # Rough intended runtime per subtest variant in seconds
+ let $runtime = 5;
+ # number of rounds till we look at the clock again
+ let $loop_size= 100;
+}
+if (!$run)
+{
+ let $runtime = 1;
+ let $loop_size= 20;
+}
+
+
+##### Some preparations needed for the ddl*.inc scripts
+--source suite/stress/include/ddl.pre
+
+# Tests set to comment fail because of CSV limitations
+# (limited number of keys, NULL within index not supported)
+# --source suite/stress/include/ddl1.inc
+--source suite/stress/include/ddl2.inc
+--source suite/stress/include/ddl3.inc
+# --source suite/stress/include/ddl4.inc
+--source suite/stress/include/ddl5.inc
+# --source suite/stress/include/ddl6.inc
+# --source suite/stress/include/ddl7.inc
+# --source suite/stress/include/ddl8.inc
+
+##### Cleanup
+--source suite/stress/include/ddl.cln
diff --git a/mysql-test/suite/stress/t/ddl_csv.test b/mysql-test/suite/stress/t/ddl_csv.test
new file mode 100644
index 00000000000..9f6185c76be
--- /dev/null
+++ b/mysql-test/suite/stress/t/ddl_csv.test
@@ -0,0 +1,51 @@
+######## t/ddl_csv.test ######
+#
+# Stress the storage engine CSV with CREATE/DROP TABLE/INDEX
+#
+# Please look for details within include/ddl1.inc.
+#
+# Creation of this test:
+# 2007-07-04 mleich
+#
+
+# Storage engine to be used in CREATE TABLE
+--source include/have_csv.inc
+let $engine_type= CSV;
+
+
+if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`)
+{
+ --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
+}
+let $run= `SELECT '$BIG_TEST' = '1'`;
+if ($run)
+{
+ # A run started with "--big-test" should be allowed to consume more time.
+ # Rough intended runtime per subtest variant in seconds
+ let $runtime = 5;
+ # number of rounds till we look at the clock again
+ let $loop_size= 100;
+}
+if (!$run)
+{
+ let $runtime = 1;
+ let $loop_size= 20;
+}
+
+
+##### Some preparations needed for the ddl*.inc scripts
+--source suite/stress/include/ddl.pre
+
+# Tests set to comment fail because of CSV limitations
+# (limited number of keys, AUTOINC not supported)
+# --source suite/stress/include/ddl1.inc
+--source suite/stress/include/ddl2.inc
+--source suite/stress/include/ddl3.inc
+# --source suite/stress/include/ddl4.inc
+# --source suite/stress/include/ddl5.inc
+# --source suite/stress/include/ddl6.inc
+# --source suite/stress/include/ddl7.inc
+# --source suite/stress/include/ddl8.inc
+
+##### Cleanup
+--source suite/stress/include/ddl.cln
diff --git a/mysql-test/suite/stress/t/ddl_innodb.test b/mysql-test/suite/stress/t/ddl_innodb.test
new file mode 100644
index 00000000000..784ba8ff003
--- /dev/null
+++ b/mysql-test/suite/stress/t/ddl_innodb.test
@@ -0,0 +1,49 @@
+######## t/ddl_innodb.test ######
+#
+# Stress the storage engine InnoDB with CREATE/DROP TABLE/INDEX
+#
+# Please look for details within include/ddl1.inc.
+#
+# Creation of this test:
+# 2007-07-04 mleich
+#
+
+# Storage engine to be used in CREATE TABLE
+--source include/have_innodb.inc
+let $engine_type= InnoDB;
+
+
+if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`)
+{
+ --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
+}
+let $run= `SELECT '$BIG_TEST' = '1'`;
+if ($run)
+{
+ # A run started with "--big-test" should be allowed to consume more time.
+ # Rough intended runtime per subtest variant in seconds
+ let $runtime = 5;
+ # number of rounds till we look at the clock again
+ let $loop_size= 100;
+}
+if (!$run)
+{
+ let $runtime = 1;
+ let $loop_size= 20;
+}
+
+
+##### Some preparations needed for the ddl*.inc scripts
+--source suite/stress/include/ddl.pre
+
+--source suite/stress/include/ddl1.inc
+--source suite/stress/include/ddl2.inc
+--source suite/stress/include/ddl3.inc
+--source suite/stress/include/ddl4.inc
+--source suite/stress/include/ddl5.inc
+--source suite/stress/include/ddl6.inc
+--source suite/stress/include/ddl7.inc
+--source suite/stress/include/ddl8.inc
+
+##### Cleanup
+--source suite/stress/include/ddl.cln
diff --git a/mysql-test/suite/stress/t/ddl_memory.test b/mysql-test/suite/stress/t/ddl_memory.test
new file mode 100644
index 00000000000..5178439bff1
--- /dev/null
+++ b/mysql-test/suite/stress/t/ddl_memory.test
@@ -0,0 +1,48 @@
+######## t/ddl_memory.test ######
+#
+# Stress the storage engine MEMORY with CREATE/DROP TABLE/INDEX
+#
+# Please look for details within include/ddl1.inc.
+#
+# Creation of this test:
+# 2007-07-04 mleich
+#
+
+# Storage engine to be used in CREATE TABLE
+let $engine_type= MEMORY;
+
+
+if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`)
+{
+ --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
+}
+let $run= `SELECT '$BIG_TEST' = '1'`;
+if ($run)
+{
+ # A run started with "--big-test" should be allowed to consume more time.
+ # Rough intended runtime per subtest variant in seconds
+ let $runtime = 5;
+ # number of rounds till we look at the clock again
+ let $loop_size= 100;
+}
+if (!$run)
+{
+ let $runtime = 1;
+ let $loop_size= 20;
+}
+
+
+##### Some preparations needed for the ddl*.inc scripts
+--source suite/stress/include/ddl.pre
+
+--source suite/stress/include/ddl1.inc
+--source suite/stress/include/ddl2.inc
+--source suite/stress/include/ddl3.inc
+--source suite/stress/include/ddl4.inc
+--source suite/stress/include/ddl5.inc
+--source suite/stress/include/ddl6.inc
+--source suite/stress/include/ddl7.inc
+--source suite/stress/include/ddl8.inc
+
+##### Cleanup
+--source suite/stress/include/ddl.cln
diff --git a/mysql-test/suite/stress/t/ddl_myisam.test b/mysql-test/suite/stress/t/ddl_myisam.test
new file mode 100644
index 00000000000..8d6226e573b
--- /dev/null
+++ b/mysql-test/suite/stress/t/ddl_myisam.test
@@ -0,0 +1,48 @@
+######## t/ddl_myisam.test ######
+#
+# Stress the storage engine MyISAM with CREATE/DROP TABLE/INDEX
+#
+# Please look for details within include/ddl1.inc.
+#
+# Creation of this test:
+# 2007-07-04 mleich
+#
+
+# Storage engine to be used in CREATE TABLE
+let $engine_type= MyISAM;
+
+
+if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`)
+{
+ --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
+}
+let $run= `SELECT '$BIG_TEST' = '1'`;
+if ($run)
+{
+ # A run started with "--big-test" should be allowed to consume more time.
+ # Rough intended runtime per subtest variant in seconds
+ let $runtime = 5;
+ # number of rounds till we look at the clock again
+ let $loop_size= 100;
+}
+if (!$run)
+{
+ let $runtime = 1;
+ let $loop_size= 20;
+}
+
+
+##### Some preparations needed for the ddl*.inc scripts
+--source suite/stress/include/ddl.pre
+
+--source suite/stress/include/ddl1.inc
+--source suite/stress/include/ddl2.inc
+--source suite/stress/include/ddl3.inc
+--source suite/stress/include/ddl4.inc
+--source suite/stress/include/ddl5.inc
+--source suite/stress/include/ddl6.inc
+--source suite/stress/include/ddl7.inc
+--source suite/stress/include/ddl8.inc
+
+##### Cleanup
+--source suite/stress/include/ddl.cln
diff --git a/mysql-test/suite/stress/t/ddl_ndb.test b/mysql-test/suite/stress/t/ddl_ndb.test
new file mode 100644
index 00000000000..7eb45da8739
--- /dev/null
+++ b/mysql-test/suite/stress/t/ddl_ndb.test
@@ -0,0 +1,56 @@
+######## t/ddl_ndb.test ######
+#
+# Stress the storage engine NDB with CREATE/DROP TABLE/INDEX
+#
+# Please look for details within include/ddl1.inc.
+#
+# Creation of this test:
+# 2007-07-04 mleich
+#
+
+# Storage engine to be used in CREATE TABLE
+--source include/have_ndb.inc
+let $engine_type= NDB;
+
+
+if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`)
+{
+ --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
+}
+# Attention: We set here much smaller values for $runtime and $loop_size compared
+# to the other storage engines.
+# The reason is that NDB is extreme slow and should not exceed
+# the "testcase-timeout".
+let $run= `SELECT '$BIG_TEST' = '1'`;
+if ($run)
+{
+ # A run started with "--big-test" should be allowed to consume more time.
+ # Rough intended runtime per subtest variant in seconds
+ let $runtime = 5;
+ # number of rounds till we look at the clock again
+ let $loop_size= 3;
+}
+if (!$run)
+{
+ let $runtime = 1;
+ let $loop_size= 1;
+}
+
+
+##### Some preparations needed for the ddl*.inc scripts
+--source suite/stress/include/ddl.pre
+
+--source suite/stress/include/ddl1.inc
+--source suite/stress/include/ddl2.inc
+--source suite/stress/include/ddl3.inc
+--source suite/stress/include/ddl4.inc
+--source suite/stress/include/ddl5.inc
+--source suite/stress/include/ddl6.inc
+# The following test suffers from
+# Bug#26043 UNIQUE INDEX create always fails after constraint violation
+# and is therefore set to comment.
+# --source suite/stress/include/ddl7.inc
+--source suite/stress/include/ddl8.inc
+
+##### Cleanup
+--source suite/stress/include/ddl.cln
diff --git a/mysql-test/t/alter_table-big.test b/mysql-test/t/alter_table-big.test
index befe6e14977..5d2c0ba0bb6 100644
--- a/mysql-test/t/alter_table-big.test
+++ b/mysql-test/t/alter_table-big.test
@@ -1,7 +1,12 @@
-# In order to be more or less robust test for bug#25044 has to take
-# significant time (e.g. about 9 seconds on my (Dmitri's) computer)
-# so we probably want execute it only in --big-test mode.
+#
+# Tests for various concurrency-related aspects of ALTER TABLE implemetation
+#
+# This test takes rather long time so let us run it only in --big-test mode
--source include/big_test.inc
+# We are using some debug-only features in this test
+--source include/have_debug.inc
+# Also we are using SBR to check that statements are executed
+# in proper order.
--source include/have_binlog_format_mixed_or_statement.inc
@@ -22,27 +27,20 @@ create table t1 (n1 int, n2 int, n3 int,
key (n3, n1, n2));
create table t2 (i int);
-# Populating 't1' table with keys disabled, so ALTER TABLE .. ENABLE KEYS
-# will run for some time
+# Starting from 5.1 we have runtime settable @@debug variable,
+# which can be used for introducing delays at certain points of
+# statement execution, so we don't need many rows in 't1' to make
+# this test repeatable.
alter table t1 disable keys;
---disable_query_log
-insert into t1 values (RAND()*1000,RAND()*1000,RAND()*1000);
-let $1=19;
-while ($1)
-{
- eval insert into t1 select RAND()*1000,RAND()*1000,RAND()*1000 from t1;
- dec $1;
-}
---enable_query_log
+insert into t1 values (RAND()*1000, RAND()*1000, RAND()*1000);
# Later we use binlog to check the order in which statements are
# executed so let us reset it first.
reset master;
+set session debug="+d,sleep_alter_enable_indexes";
--send alter table t1 enable keys;
connection addconroot;
-let $show_type= PROCESSLIST;
-let $show_pattern= '%Repair by sorting%alter table t1 enable keys%';
---source include/wait_show_pattern.inc
+--sleep 2
# This statement should not be blocked by in-flight ALTER and therefore
# should be executed and written to binlog before ALTER TABLE ... ENABLE KEYS
# finishes.
@@ -51,12 +49,68 @@ insert into t2 values (1);
insert into t1 values (1, 1, 1);
connection default;
--reap
+set session debug="-d,sleep_alter_enable_indexes";
# Check that statements were executed/binlogged in correct order.
--replace_column 2 # 5 #
-show binlog events in 'master-bin.000001' from 102;
+show binlog events in 'master-bin.000001' from 106;
# Clean up
drop tables t1, t2;
--echo End of 5.0 tests
+
+#
+# Additional coverage for the main ALTER TABLE case
+#
+# We should be sure that table being altered is properly
+# locked during statement execution and in particular that
+# no DDL or DML statement can sneak in and get access to
+# the table when real operation has already taken place
+# but this fact has not been noted in binary log yet.
+--disable_warnings
+drop table if exists t1, t2, t3;
+--enable_warnings
+create table t1 (i int);
+# We are going to check that statements are logged in correct order
+reset master;
+set session debug="+d,sleep_alter_before_main_binlog";
+--send alter table t1 change i c char(10) default 'Test1';
+connection addconroot;
+--sleep 2
+insert into t1 values ();
+select * from t1;
+connection default;
+--reap
+--send alter table t1 change c vc varchar(100) default 'Test2';
+connection addconroot;
+--sleep 2
+rename table t1 to t2;
+connection default;
+--reap
+drop table t2;
+# And now tests for ALTER TABLE with RENAME clause. In this
+# case target table name should be properly locked as well.
+create table t1 (i int);
+--send alter table t1 change i c char(10) default 'Test3', rename to t2;
+connection addconroot;
+--sleep 2
+insert into t2 values ();
+select * from t2;
+connection default;
+--reap
+--send alter table t2 change c vc varchar(100) default 'Test2', rename to t1;
+connection addconroot;
+--sleep 2
+rename table t1 to t3;
+connection default;
+--reap
+drop table t3;
+set session debug="-d,sleep_alter_before_main_binlog";
+
+# Check that all statements were logged in correct order
+--replace_column 2 # 5 #
+show binlog events in 'master-bin.000001' from 106;
+
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index 965528642bf..99c9ae23801 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -631,6 +631,30 @@ insert into t1 values (null);
select * from t1;
drop table t1;
+
+#
+# Bug#27507: Wrong DATETIME value was allowed by ALTER TABLE in the
+# NO_ZERO_DATE mode.
+#
+set @orig_sql_mode = @@sql_mode;
+set sql_mode="no_zero_date";
+create table t1(f1 int);
+alter table t1 add column f2 datetime not null, add column f21 date not null;
+insert into t1 values(1,'2000-01-01','2000-01-01');
+--error 1292
+alter table t1 add column f3 datetime not null;
+--error 1292
+alter table t1 add column f3 date not null;
+--error 1292
+alter table t1 add column f4 datetime not null default '2002-02-02',
+ add column f41 date not null;
+alter table t1 add column f4 datetime not null default '2002-02-02',
+ add column f41 date not null default '2002-02-02';
+select * from t1;
+drop table t1;
+set sql_mode= @orig_sql_mode;
+
+#
# Some additional tests for new, faster alter table. Note that most of the
# whole alter table code is being tested all around the test suite already.
#
@@ -727,7 +751,58 @@ ALTER TABLE t1 MODIFY COLUMN v VARCHAR(4);
SELECT * FROM t1;
DROP TABLE t1;
-# End of 5.0 tests
+--echo End of 5.0 tests
+
+#
+# Extended test coverage for ALTER TABLE behaviour under LOCK TABLES
+# It should be consistent across all platforms and for all engines
+# (Before 5.1 this was not true as behavior was different between
+# Unix/Windows and transactional/non-transactional tables).
+# See also innodb_mysql.test
+#
+--disable_warnings
+drop table if exists t1, t2, t3;
+--enable_warnings
+create table t1 (i int);
+create table t3 (j int);
+insert into t1 values ();
+insert into t3 values ();
+# Table which is altered under LOCK TABLES it should stay in list of locked
+# tables and be available after alter takes place unless ALTER contains RENAME
+# clause. We should see the new definition of table, of course.
+lock table t1 write, t3 read;
+# Example of so-called 'fast' ALTER TABLE
+alter table t1 modify i int default 1;
+insert into t1 values ();
+select * from t1;
+# And now full-blown ALTER TABLE
+alter table t1 change i c char(10) default "Two";
+insert into t1 values ();
+select * from t1;
+# If table is renamed then it should be removed from the list
+# of locked tables. 'Fast' ALTER TABLE with RENAME clause:
+alter table t1 modify c char(10) default "Three", rename to t2;
+--error ER_TABLE_NOT_LOCKED
+select * from t1;
+--error ER_TABLE_NOT_LOCKED
+select * from t2;
+select * from t3;
+unlock tables;
+insert into t2 values ();
+select * from t2;
+lock table t2 write, t3 read;
+# Full ALTER TABLE with RENAME
+alter table t2 change c vc varchar(100) default "Four", rename to t1;
+--error ER_TABLE_NOT_LOCKED
+select * from t1;
+--error ER_TABLE_NOT_LOCKED
+select * from t2;
+select * from t3;
+unlock tables;
+insert into t1 values ();
+select * from t1;
+drop tables t1, t3;
+
#
# Bug#18775 - Temporary table from alter table visible to other threads
@@ -815,3 +890,27 @@ ALTER TABLE t2 MODIFY unsigned_int_field BIGINT UNSIGNED NOT NULL;
DESCRIBE t2;
DROP TABLE t2;
+
+#
+# Bug#28427: Columns were renamed instead of moving by ALTER TABLE.
+#
+CREATE TABLE t1 (f1 INT, f2 INT, f3 INT);
+INSERT INTO t1 VALUES (1, 2, NULL);
+SELECT * FROM t1;
+ALTER TABLE t1 MODIFY COLUMN f3 INT AFTER f1;
+SELECT * FROM t1;
+ALTER TABLE t1 MODIFY COLUMN f3 INT AFTER f2;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+#
+# BUG#29957 - alter_table.test fails
+#
+create table t1 (c char(10) default "Two");
+lock table t1 write;
+insert into t1 values ();
+alter table t1 modify c char(10) default "Three";
+unlock tables;
+select * from t1;
+check table t1;
+drop table t1;
diff --git a/mysql-test/t/archive-big.test b/mysql-test/t/archive-big.test
new file mode 100644
index 00000000000..414b689b180
--- /dev/null
+++ b/mysql-test/t/archive-big.test
@@ -0,0 +1,25 @@
+--source include/big_test.inc
+--source include/have_archive.inc
+CREATE TABLE t1(a BLOB) ENGINE=ARCHIVE;
+--disable_query_log
+INSERT INTO t1 VALUES('<W*a8,mnd-Kt35R&Z\"-ZgzY-iUPm^o:j5\\W\'PFM6_bRV:Z@ixJCQOw8GANFVahj^wcjnm^k(wOa\"uX9LXZ@hv>gt:Y;V(Wh/DM;z\'@Scyb^2u*b:8GBTan./A;D(7x(PB98IL%ipw0x=^H,>8=i%m\'heEdN:pR*o%Ywtf&x]H2[]Ex\\Bn1>\'EhfGmw56OpkO(n$VpXE2d.M#Z*XevKM$`Er;euB&2e3d-HdFlw;RobzhxMQ3EFn&aCf`5y79V/\"UmMt-t36S(aAY&Ekt.w@m4Q!G,@@]?\\<Pazh\"\\79X7D3m[\\@gnt\'RPzBq@&6y5.)z`POzG+>:D.R;j1Kj[j*&\"n8cq6Me>@fgW_Wx$821=#0fAM@75D7\'Wi2T8W32B96C2kQ5MiO2C>NP-(!fms!;I?Biu7F?G*6o[Z54D?LCJ/H\\#+M,-;$?Rd\'-Ii`+GfW_\\5-zRc\'.M%dV`dYpOv2,\"`L;\"3u(Xk9pU8Ry79Z?fo\"K=-b7#FxX0!OS6Oma\"uZ@m1C?Q]c\\*P=z\")Hq/(xSsrd\"j&n(m{J9x#4y:KM%cSV7LZft=gzUtse$tM`#zsV35Oqsrf,=0u-q#H-@=Qc(1\\ddM6`gke>>^F{fmt(Zuey[9G=;O_tRx1zH2[Z9E5rjDL8j<)RIVX<\\Bq@\'<<X-nqmT:`_@Y*Yl<yz#/a*@I1S9[G/S9``Chja*E]-]va`Eq8V34J]wg\"c[{&=CuT!?[4+u@uX;U$H),@@bRS11DGt@wfvJF`7-u7KSFBVmMostran-)\'(0YW/x@m3Kd<;Pc-ImokLw>cbFq2;qS+q*lprp_gnv/t0$`Ep4HP>$4w-iWW35Lc7{8<bcK0GWbl\"R_l(r:_Y$:<^NH]&;:Pe7trbsD5v%Fr<es:]MIgRD=E\',EZxtcp3D=F-Ii\\pFHvH@DrA(@I5h:z,]u]Sh9vvs_`I.CK4[Uy.iUMb-N)uH?Bl)tA#$*Ea@UmO#WscxX0zH4d,AEvRo`tOf;/r&Ve{c^1po]da=G1[_LA@\\629duIFa?Sd&\'1^p>zxpK`+KyLKs.{Si>3#PR.,.@>Uqd%zj(wRpe,@Cm)q4D<>caAZ+[qQy9HCT_e_3sy0qw,b6#Fz`QT7Qv+a4v\'N;xxudtC+FcJ%p9``Cjt0)vJKt7JO5T10<\"-\\qK_#&2iIke<7?tY@m4Os$H((0TC/[did@K<)TU0)vJJq(eO;uj6aq>u_Z*Yi+1S6Pqo`qA*Fg\\u`_ChmkXU&SU8Pod.M{Q[[:LR=rR&\\)L.;\"1l\\i\"Z0u1)s;a_>Q^k&js+lkYY7B*FbEkr&U`hljR9cp01GUYAtRw/qz8>m:k=)M3Oy>`OMr\"Bju6A\'<:LUKWV.yJ>9Axft@va`Be\\#,RC5#EwV)]&<@gr-zQavV-ox56L_!wh&uM\\k,0Ia7\'YrYI?>W&N<{)L*).JmlZ]H0S9[I9!5)i`,N.7d\"m/:r\\UutlDH#hp!F#rIO4Q&\\*TNiO-0GWeyY/v59``ChiYbf]#,O6W<ccK/A?W\"73:g%tIIs5C3pg9y*TPv-lf><QhAEtHCXq[SjG_/_\"ym<wpP{F%ygwI@EvPg>8Ayk1EN;xwpQ$Vi9unNu-q#I1Q/1HZoHRGL+,<-gL\'p1;pQ\"MERQ#OO{J<-fFh^%2kP08h2T:\\LDQNpty*V\\NO(lu1(o+xMS=qMhL\"Y\'K-9tlDJ,8q`it4:g%q=sW8KWU,mng:)Yl=#3sz3\"MFWexSpauQod-G_4z;KL{Sg4c$xb`B`Dp6OpnZU$Er;er8T(^.`(:/u33ECbL5`hq%S[TsmLmkUGARYNXV*b>I:#<I;,c>G.Ii\\rPs\"<KJp\"G)1XNa#xi\'vRn[\\AjzQ]efVZD%&/Y[An5Orx-fGkme6qd&%&0\\fny=[<TtupU8T(^0fAL>0omXQkN&gb8+i[n@.`\'5qjERPy<W\'RPx:O`zm7^\\79X9LUL[gwKLwBw]LFVbn+yUx\'I\"bUcvN_tT%QS/++2[\\@ebAZ)QEFlt-p\"G(.Jmnc+?BjxG1XQn\\bYxvj6d$sJQ;oIZj1HYl;xvl?.b3mVHGfV\\NR6NjS@&7&QOw7@yn?-]sU-t7JO4Q$Td{fkmd0Z\\E\"o;mB;Bv\\E(.P2A2t#?Vw$:<[?bZz#0f>>Y.oty.iSD;:M[ccM6`kyI8z.gIq,vAv[Cx`Y!-\\oEDeV`dXk:uj8lFTX@qGJzW#;D(7x)UX?m2FM6][4.*%tJR@+O5T0.5_e`81./?4%Ywtcp6NjUIK\"\\512I[qOrw\'N9oOyAk%gb;:PiF]*M-3XJJp&Yxvl=&B\\0qtx(K)&#tU*hX`]4(eRHTQv,fK%l$]6/*!bYwqU5A.[j++4d*:\'OA7.yMMyI8x%>LG]\'ASczfo!G*8x&CcRPw44D>J=0s\'Wh0H`2n`uSz8@v^Sd%{n<ueyX-ka(:-mjS=qPv.pw/r$L<\'I!_G%ydfYh($tQsvx!+SGK\'vN]m7\\UqbuPiIliQ8]TmQ-%l%cN=&AVsf,=1y@flmb\'1azk.9r_d[{%8/zMMv:Rsqd%{n:j8i:wy\"+Q@-X]MIcBY#6,r,u:Y8E7$Fy[<Uz2x9JL%dYoIZm>\'AWupW@v`\\/jWRv)WexSrjCK1LosuwvpS-zRf3^hu:X309h1O#WrcxX0yG0S:bf\\zyucn(jmiKs1/4YLP/4W@wcheFid=Ak&hiZft?qIRD=Cxa[*SJ[k3S.&n+zVz1t)]\'ATe(.Kq$QQ)n#PS5GJzW$Be[vi2R-$ggUS$NFPGO<yxrV7KWX6A(<8E7{89W32>(Eg]#)BVmKfK#cUajs+kfBRZO[aZ$95?yqPu)\\#/`%)@G*7rh6h7oU;`]611A71-/CGwQjIj`)=>\\=X-j^tW4:euD-O1A6*h[m<z#0e9)ZrV7KUNf=<Pd-GcFlv33C=F-GcDcM8lDK-9wy$4y7;`Z\'I{^Cn1;r[Qd*:)Xg&wW/v;W.u34IXabL3WE1_uV0%bN?/hL{ToWF7\">UsmKjZdmw9KQ9aggO7_`G!fjfFcGtAzoD>I9z0ne5mR3A2og<0v6=pIVX=_QU<fuB%)@I2WJL{Sh;\'M4WB\"yn>\'D`A^=P`rGEdO>(HvE1_sL]pD?OR3?)IvC&.R>xm?.c4n]c_5\'[%81)t@ym<vl@3y=V\"<KJnt\"?Wz0nf<1zF*8w%AX#:?l.4YMUIKzQc\'-Hi_&2g>9C(9)[woJ_%1e5mT=m;rZJCPMornXKP3IXdp.(wTv#:?l.4\\Z2&cL0I_+N.8k@738`cRP{G+<0t+i\\oB7,r+mt&M=)N4V<cg\\xqOrw(PEFm\"OO&bI($tOjN\'kr&UcvM[baCf`1hHi_&5srf/Kmm`w\\G0T<l6_d]\'C[-_)?G,AEuKQ:exTttmJb:308g,;\'L/CH\"fjc7$FxW)[yxpNpn^hu=b`?TnR2<tahiYcg`1e:-k_\"yl6_d[\",UNhGeQC96@#(=>^H+:&J)\'\'-N&inm\\dfV]Re+>7;`Y#7-xH:(RPu.q\"DsC1f;-j[j-5`m-+/JlfAJ6h6kESR(fUU23FJ%m)tA#%.VMa*@F&#w_Xxz$5z9C+E\\*REB\\.fGjhM(vMWQpjCL9r`ggVW7GCXsctG@I2ZW)[uez]Cn1?*M1EL1I`.Zdls%PJb7&QOx:Oa$%*D\\)L.;{,YfvG<3*s8S\"Co4HTNjR<oJ\\rS\'^3x69Z@k\'r=k1HXfyZ3)o(eUZF-Kt5?zubjq\"Ey]DyaXsdy[;O`w`WrcvRpc%%(7!:D)<68S%RXE0[`VlCGwPb%(5rnS3?%91*xRkLs-s10=#4x3,zUvwwr]W#<H9%FuH@F\'\',HgW\\NO\'kqx0u2+#gi]xi+0Mv7D3oax`XxxtdvN[ceTR$R[RjF[xrU5C5y4-%jr)bAX{/fANGWeyX+dDbGxUx)QHSK]t[I:\'N:scsB*Gg[pLb3jKs/%f`3pjFXk<$:;V(ZwmDCdU[MO,$l%dTYE/R8]TkDOB;Bw_Tg1T;es9Y>eh_)CWqZP_rGFjiVPna{l2HXdr8U-w@m5S,vAtS#I-BG$o8_\\63;mA6)dK+,>4)lptvwxwoLgIq-zP^hvAw^Q[Y0zH4c&&,Jt6GCZ#3w1#Ui;&Em{J;&I&vSv&GyY0xAm.5]\\<Qe0VHD[%<Ap=t]Wy)QDBZ&Em#Sd$w\\E&(6rkERR&Z$7,r+mry3$Ug0Mv7F?G*5jFXl>-]wh)%xb_;D&*?CrB,N-1Kka*@F#o;j6am)uB&0[fo&^5&XpU7Nd6w\'I%r?zu^Y\'M6`jwAp?&8*b@R`l+\"da;=_NG[vh+3\\_I3YRmVE7#Ciq&Xr]Z0u1(lx=^I1S9^TkGXi0I`2lYW,i[j-7h7oV>n=yyueyW(Xi2R-#dYqW?n8cr>pHSK[l7cuLUHK\"\\9B#{u]Q^gnv1$[*SNkY[BsIO2EJ*)1XRpd+;.nlYU$FzbYvoNqw,a5w*]{{{\"$-WT%RS/-0JhTMb/XT#Fy[;QiEVez`OKiVRx1{I8vulDFs>qK^{vbgb<<Y2*uC\'5tsi8q_d_3v*_-VQt\"9=ceUYD(7v\"6*khM(s>qJX^Sg3_j!Vsh3[Y0w;Sv&GxQiBJ3WF7z63;nFN7csC-SC5x1x<Y3-)%tM`#!vbf^)FfZl:pU5GFha2jKt36V5C2kQ6Qy9H?Co7V39blyF+@Cl$^=NTA(=?aVg,:\"4%WnNt+fQ?)Gmv58X;W/xCx`Yz)N3Ov2-\'xZ6=j.<\'Gr5IQ={$2kTB+K\"]9Ayl5YIAI.DM=(L.<&DeXj6an-,3[X,fK$d\\$3pkLs.xF/P1<ws]W\"6-xH9&J+1R4EC`A_Bhj`\'5sqbuOf:(TYF/TD4tuvr][4-#cU^];IBL;\"2rw(QGN7cvN]n9f$p8^Y&H\"cZxwoJ`,O0>)L-7kA@Z-gM++3]edK,4^edJ$jyH7rh8raq:clw9M\\i&o.-5c!izRe0S<j0FSPy;RmWKO.3U<fvD.R<m@1oiCOFRMjUIM*\'{i#`I-=0pstq^bT_aNB>QavV*eK%n+{]@aQR*q,xH<2#Te)2\\aUd#o:h,4`p<oIXdo+u?qIRFGmy?c]0iO-0GZoHSOqpd)3d+<4-\"`H((1YW+fN5WAv]NN\"Sd$uU*dGr3=wl>(J%m)q4D=E&*<3-#d[z\")Hp+r13LhN+($uT%OH\\vf\"bXoP#QXICUf((2`vW0#Z+[rT*mqssj>/l`{qISJWY@l-2Q+u>l4S.%hi\\pHQA2pkMx@m3J`,O2DCeYoIZk6_cYqU7M_{rQu)[uduHBQT4C:47W7HFeUV6F@LCJ.?60/7g.BH&x]F*7rj=/mc/TC2kQ4K_#(==Y1\"R_k\"X$?Q_n2B::Su#>P\\_NGXg\'!i\"[0t,nsw\'J*,=4*q,wF1^o:j3R01EI%o4IXbgc@NKj^yk3Ow7B*GgYg#hp#L?5+q,vC\"wdks([z#/_yl6][64@*L*\'$yen\"MFTXC%\'6uz,^\"{yoHRHQC95;h\'zaWq[TqbwX1&eXg%sHGkjY^QYNZ_QWF8$FuKO/6_d_1kVL[guAxeo)knkS=qNl^rIRB5#G&#v\\J=0qx0s&T\\TnVC.UJQ;pPv2)r6KZg{Z1\"OQ,#aPMnjLv<]I7mO\"QYN[dg]ysYC\"tS%S[Qd-HfO:oMnkQ1<woNomXPiG_4x55FFifGlpqkIfM/;z*N4T4@(BUi8oT7NgDWlA<H7tp\\W\'OB=I:(PEI#hmpnZX/w:Sw)Wbhi[k2KfGkmg>=TrkFWcq8V2/7ctG@J7oWF8\">Vx\'Fp/.9oS/-2Q,ySlO&fZnDB_?X(O@3u*`1jO,)(*:*]$1gBL:y(Gp,wIAI0KorsnP)lu/xArFBVmKgM,/GYm@3w0yF*8y-d>DwW-r(^/gDZy\"*L+*0P+yUw%AY%Cf]%6\"Bjt38\\NR6R!Co3FJ%o2@.^zqMfBRZO[aYz%:7D4qlMt/\"Wwy\".`&3jIke=<Tv$=KDSYH;0v46R\"H-ABfeK(zb\\(Gp-\"[5.)z^G*4d,AG$sKWW32>(Go(g]\"$-TJRD;<[<Tw\'L/CDku46T*lmb\'/WQm\\b\\,[k5XE1_tOkR;i-;\"2rw(N8j8pV?qHN2KgJyP]eia1b*@G(+>:E2b(4kN{OS6Pt#AaOCDks(^/e<7>n@-Ydkr\"Bir+ox6:]PYQh?=TpasE;8D0`yh{[50/;z\'DaGwQg<0v3/2KhP6ZKF]+P<uf%rB.WV/\"TkDN?.a.UKVQu&K1Kkb-O,+2YRlR6Onf6qe+;-fHo\"MGYnDB`Dn*vF3iDPKgJwG7w\'H!_I0Mw=_PS18bn,#eb?NMu47W:V-nrv!2t%L7i:wvpQ#QYKN(r8W5<nA4!Bl\'lw;Tz75GFifIt:X7A\'9,kc2d.O,\'y_MEROu.s-t37W:U)^/b-Q6S+q,s5A.X]J</mg><RlN!OU?tZE)6rh6lJgQ@*N0>.fBR[Trh8rcwU%L7j>0olVGAONw;V(YnEK+.DPI]{yt\\P[Z7>oC:8IL\'o,$gja*FbCbL3XG:+eGp(ha0a(7x,a0c-Jt39cp16]X%GwQiDT]X&H!aTal%`AaM<&@UmMr$J3YO_sMa(9+dFhc<;SrlLoqpbzdh`-R@)Ho$VlCFtD0_sOjQ5Nnf8z2zCsGD^3x56OkXV+fO7aip\"Ex\\Bm-.>1t(Wg(%zl1FN9oNrz:E0[aWr`hkhIoz?`NFSPw56PplQ05WB!sU-u8Og?@d^0iM\'n&cL2P$Wsf\'&\'1^n6XByk/>/iP3IZk3T4C91*zW&M9oQ)jhQ;l?-^zsU.#]8;]KAAcWh.@;G6ri;%@UpZRjHa80&f\\z{\"(BTd\"j&m$[,_(<8F:-ortrd\"l+(\'\'0Z[=Z67R!Bit6C2iJnsy0t)_/b-N+%rB-R@*K#aK6d#qC7&SXB\"wclv6?vbhfM/;z)K&p4HSIVW48[I=4+u?m6[Qax^ONw;V(Zvj6`l\'ku0%dU^Z.jY`Z&B^;F2c\'0ZZ;Ttwy#0f@EzaZ{*N6ZJCRT5EAR\\]@bUcuIGh]xj2Nu/{OS9[H4e.Lv<]I6jBFvMWQqlN#UnP\'eTT/\'o,#cXmEL1Jb9.s/%bN@4\"G)0T>u_\\3&\\*RFJ#bUbn-)&\"p?\'@OP)q/,/FV`dZt`f_1jR:fyUy0omZY406ZNWOb*?@d_3v+b;:PiEXmEJ(\"k(uJIq(dL.=-b5v&GuG=;MXU\'Xk=\'Ejmg@F$rFATe(,DVdz^H-BH\'&&+CUf)/N%cOC?R`q?yu__?Z/prqbwW.t22A3u\'RQ$R[W\'PDEm#R_k$^=Rd,@Biq%UcuJL\"[0t+gSIRFFkoqnVB(;42?\'@PWF8&OB;C\"v\\LFWg+5d)1\\bZ#5&Vg.CI+5e.HdEf\\xqPu-nof6nU>qJX`[,`,O2EGuE1^qD9/\"Vq_gljR;l=$7,nt%I)*8z2v.t1+$m*wNXRstnO!LETW?n8bl$[-c9,liM&kt0&hgN3LgKzRe.Kpy;LS>ucn(knlWN^tU+i^\"\"!!!\"$/^rMd8%L5]_F$rGFjgM)z^I.H`3u$BbRP\"J8sh6g4`q?!#)EbGwO`w\\G0R8W9PlTA&5u#=NQ2?,X_Wsh2T9]NN{NMu5=qMgJt8Ne7x*Xcm\"OS4D<BsIP8bkw>caA\\3#NH\\yvexTtvtg+5g6lKmiM$_Cinqqg3_m0;xwnIYh))/Q4HP>$5z:F4lR4GN3Q\'cK.<\'J%p7U0+&uM^qFDaCdYmDFo*u?n<tajq%SYLM!TjDL7i6g1R4ECaEp04U6IQ?\'@MH_/`&/XX44GJ&q9`^=MP..:z)N4T4@\'>DzhzRh;)TV5A+O3LhM*%rC3mZZ8E3lS8ZCygt>k.8nP\"PVA\"zqNma#zn>&>I9z.gGh_\':1%bK/CI*,ACl#Xz+UU0(r7Rz=Tri=-eD].d:.r(]+TNjQ8[MN$\\1t\'U_`H&{k,/CJ,7oWE4kO)q3@*K#`I,:#:?j\'tD2hDT^^Bgjc6w(PEGt=j*\'&\'1^p?$2lVJO2GRKa,KzSh;)SNng?>X+`0c1^l0?1ohADsD5u\"6-yNS9_[0omYU#Bgi]u]OUA\'6x.k`{rMe;2*vE1_sL^wes8T\'Zyxtaipx2&aCe[xrW<b]3!E#o<pOu*b;9LWU*dIzVx)P?-\\oA0hKu8OiImppc#uX6?xm=$6\'YrZKJox7<er5FFjk\\k-6d!ixI?>W%I&vV(Zvj5^bWk<%>MKnrrmLpy529h/EQMk\\i$hmne4i@>Usj@9>j(xTy0ptw$;BvY9LWU)b>K@>W%Fs?u]OT<i(#p=t^Y&I#is22DCcQLfHkmd0ZZ:LS?\"&8(\\&;9M[dg\\ubkv8IIr.#^>W#<I>8=h$hkf@I3]da@Ti<*XclzG.JnqrmNw;Sw\'N:r^_DsC/\\hxLLwAuT#G\'%$#!xj/BCdYpOt)\\\"+O4S+q,wC\'/XSy3&`?TkGZrV6HJyOXOe5nVE5soZRjF\\&:8GAOLorrh8tmJc>Dx`Tf,;*Zm=%<@n5QzAjzOVF:.q\"Ey`QU<gwLN&gc?K@<LKr,t6GD^5\'^2rtsh5d%ygxOYTz9>n9i1Lnof4d,CMA9<`VmH\\zyubhi[i&sC0]n:j4[V#=P\\bYws]Y*ZoIYg{]@cZxvi/CI(%yfq-#aNA98L\\k0A:=b_;C#yl4R)ls#FxY1$\\0qtx%?PWG?DxZ9KM)vIGeQD>LG^)JyQazi$feK&r=pHRGJ$ip#K7nP$Xx{)Ht=h\"`L9pYLP/7bsB*GjhN/8lDH\"da=H4g5kESV:V.u5?zvf\"d_4{?aPKgL(xUz613J_(=@eeO9l?1rv%En*s9U+h[k4WAwbbL6`l%dV_^>TqatKR?$0e9)Yl?.c3mWKQ7[NR4IVX9PjKr,p%Vi7kCH#j!Up\\Z54D;=]E\"o<s\\OZV\'U\\UslFSS*mrx,dAS`m,)(*:*]$1iHhZj/@74?#*Ir11A9:U$J1NzH2]ddJ)$tPn`sJRC8,ox7>n=!(EeUZF.N%dU]W!3{DwW/xAqB0c/TD7&PKeAR[V#?X&J(&$\"wep/+,:\"4\"I3ZV%K3XG=9E1c*;0v46S&WlDGuE5pd)4g7rf,?=Qe0S<j2Lj\\k.8nNv5:bhfL(y\\Ais1-,6h6kEST1/;uk>.b4pd,AEtHFfUW;W/{NO(kqy3*s6JTJVW34Lc5sq`m,\'y`Tap9]Q_j\"Y)SNl^sOiM$`G\"glnhCPLjX\\H2\\_K;%BaI*/Mw?i\"[2#R]aPNu1(n%]1s\"=Qb%\"wchc=An5Pw2*vD.S=sYC\"sOl\\fmw43D=G.Jnsy/l_yi&o2?+RFFjmg@Cn1<wrXAv_Ti;\'I%o3EEjld6uy(HwKL!UnR17]Z/on`vV.u8IM+))1[]E\"o;oIXdn(ieBWq]Z2&aDjr&T\\X\'O@3z=V\";H<0x<Y54FEheC\\,[pGN6^_EvN_sPnc(3g:%Fq6NjR9cm#Xvtf%vU&SW>j*\'$yh$eb<BrGEeUX>hyOYU%L8mH\\wi.@89S{>V{4)g\\t\\OXMZ_Tf,=4*p\'cJ*+7tmLnm[aZ!+UPqrjA@]:D*AK:xz&=F,BK4_iv?l1B>LJkd7#AaM>.e@K;%AZ-c8+hVX9Of:*^*K\"\\8;`Xy\'DdTT/)wO`xceUX?k,.?76E?J:$=KEXoNqtx&CaFvMWQph=2#S^edJ#d\\&;=\\Ahr,u:W1*xO[_ONx@j!Vvxz&:8JM)wN]k,+5e-DQOw9IGh\\rR#NEPGRGP=z\")EbFs>qK[m8h.AChlhKxF/Q4Ka/XY9JL$e[yxrV8Nb,Js0*{`NDH$n0;vl?1okN#Z*UY@n7[LMzLHcAWrcvRn\\aWmGWcm$Y$=H8x(K-7kAA^>W#=LKs0(r:_Xx$833HQD@R`n0;uk;x{\'ATe)2[^K:!1ppc%{pB7(_2pmT;g\"bUais-v=caA]:D*=;NZ^K>3#PT7NiLzOU@!xm?,Ydo(jiSE?LCI+5h9y)O:oLiVQrtp[Sqd%!qGJ\"`H*0R6R$NFSQz@fi`*EbDe[xqT-yNT>rS%Vg.CI((-HgW\\NN\"R`m.2Nu/zMIiZg\"`J3ZSqh9wz&?OP+zW$A_BggSHP<ueyY2)mx>`QS28bl\"RasHEcHyW(TZH<2$Y\"3x7<h$jv=`Uf+7p]_L<(K)\'%$#$*DZ$7*i^\"\"\"#\'<9KO0:pU6IQ@-VU-s.{TlJhWV2.2Nt*fP>\",UOl[`Td{ejiQ8afa6&RV=fs7L\\pEATi:z,Ydq15W>l1EL/DH#l&jqz;NWNb*><Sqe,>:F4lR3EBZ&En$Y!/e>@c\\)IzVy,_)BVi:wwtctD2f:)Yk6an/3Q(fZnA7/%bOCCbM9oT2:i/CH$o5Q!F\'(3e/R7U.\"Y(QFL,3ZRnZX.s)cDeV_]89W34GL.;#6)fUS&WoNs(Zvh/DK1Mt.t4<oEHvF5o]eeRGO9g-<+]!#\'<:MYY9LSC6{<MQ6U1-0FSQ{E{hu>j)z_K9uqZP^m/:r\\W%H\"glmb(7x,a2kQ3D@R_k$`Er;fxNZ]G-BJ/Ib931:nJb8+gTMc6uw\"1ne4h<.lc1_rHJyP_p<qPu+eK%n*ySmR2?)Hs7OiL!Ti?8:X5;fz[79Z@m3IYh)(-F[\"-ZchfHnzCtLY_R_k#Z)SQy9IDYul?/jTD9.w=b]/hJu;Z>_K;$>MLt0)tB%-R>xnB:=_PQ+wKHgW]Q[X.s)a<ArFARZTsp]^DsB,O2GSOojIi_\"ypJ]u^Up[Ux)RJ[oC>K@?\\:D,KxF1YX2+xNWOc.R8]Sf2ZV$FwQkP+!^Co4IUU,r-xF1[aVlBBdXl=\'Eg`2kS>sW;Y6<h\'wSw\'N=$7-v<\\E\"p@\'>D{k*&ycbFr7Pruy(J#d^0iM$`Do1;pR(fXdr9[G1ZW-ot{5.#_Dn-)%vX6=m:qU5FBWr^bVdwQjLu7E9/w?j$dXlA7/&jr(^0jP1=%<?i{Vuq]\\;JImpnZX0zI9\"85C2jLxG3aw]LAAbOHW`aK0KiY_Xwxui4[Uvz-_$-Q9co,#fcAWvr\\W\"8:V,kfCTbq:cm\"NLs+i`(==X+a8-t20;tg*/MzMKpz:JJq\'_70*yY.pu\'N>+TQu\'SR)kk[emx:N^o?&8,mpmT?wetB%,N--<*V[I;+b6#EvQmXPe7tsf*3_m/8kA;D*;1zH2ZW)^+N3Mlc-Jr-xF/TA*GjfHlrz8;a\\.d;417bn*wLQ5NkYZ>aTcvOb)9\'ST.$e](ATf+;*Xg&vT\"?X)Xi-:z*SK]sU.\"Y%Elw;Su{2u+dC[-_\':0zK@=Rg7re)0WKQ;mA5%T`jt4<m=$6\'XoMprqarC3oc&\'0Y[>_MA=MQ07`hov+cAS`l(o,#dZxrZJDUakyE)5o]aTam*xPb%$$)?Ezfp(dO?*P=!&:6?vbild6trd$vX44JYgzX(SR%YvqW?pD;=\\@dbC`BcU__Dn.-9r`ju7GCZ#4z;O`w\\F*:\'O?0jTE=An3FL/A>P\\`PNx>aXr]Z.nlWN_wbaFtE3hCNCCfa90%bN<\"-]tV34K`+Jv?o>z{#+K$cWf\'\"o:i1KhSHO4S.%fb?LCL5`n/3P#Saq<nD@Tg4c#rGGkptv{,[m9l@4&Xs_d[{%4v(UZKEYs]X%Fq6L`)?F%ydifFha1f=7<dks%PMnkQ5OojHfQA2og:&K0H^\';7D1a%*@I3ZW)]$1iHjb2iGa949`aH&x^MDM;xz%92,&uKP8^Y)UX<aZ\"3u)[xqPx9IGg[n?-\\oD?NP)n%]2v.q#H*2]gq*lnf:)ZrU23GQC;?izP^j#`G{c\\+SIRD=F+=7;_VpXF7!8:Y9M\\j&o/3Ov2*vIAL=,_(?E#sKXZBsKVRv)Xh,8tk@711A70*yV{60,-=0omWM\\k-4[Uv\"4$PNt.v<^MEPHXdq3?(BY{-[n@-ZgzW%H$m.1I_,Q=vh+1T<h&tF=<Uz5+t9V,mne1\\egYi,6g0R2=zz#+O6W<a]3y>[:JJp&[\'CaGwRlP,$ir(bC`Be])Hr4B2m[`Uf,<,b6z8>k0B@X%B`Ckw<[?bZy{&8.xD%\'0\\hvC&-M%dVco17cq:_[.iUKVRx1zG-EVdyZ9D2d.N\'m$Y\"3x7>oD=D#tS!AgliQ8]TjEQKb3n_m2CAZ,_)D\\*SLc4nZW*_.\\n=\")FjiSFD^85@%1gBNCCgc@Q[W*]&8+gRFGr3?&;7D3lVF<7@xi*)0Q3D@Sd$vZ?gp&Z\"-]sT*je>?bYtg)-DSYI?Ae`81*z\\>Y.pty,^#)AQVA$&4n]flojKt23HUU.yLHdHuC*?Cp:fyW&L6e$uT%OGV_\\4)ieAOP%[*UV4:euE3jIi[j0A<I>;IDVg,9{0nhBL:y%95;h\'yaWpV>j+*2YSqh:$>P\\aVh4^efQB7,nt%H\'!k){aRXIAI/Ha945Le==X,gO7^\\513LjVPm^j\'p3A3v*\\yt]Up]`PLk^sRz>[67OjQ7X@qFDbHz^Cr?yrR#MEM:th0Ib<@j!Wy+Xclx@k(r8V33HSK^xl6^aNDH!bVg+7re\'\'-Jp%Vi7j=-b3n^i!Vx#70(s;dm{I7rd\"k(tC-R>xnB<C!o?%7([yxqQ\"H0Q-)&{l.8nLjZep+s5D90%aI*.Hb?K@=OYV*a91,\'xX0{LG](C\\-b3lS=oDB]4)ib4qlKnnc)8\"9>j(xW(YnEK**3_l.1Nu0&eWcp03P!J9wxz&<=^J5e*8w\"3v-j_yn>\'@R_it5>wh*-AEr=m>&>H3_l*$m--;\"3x8B%.UL[gvG:*^)D_9;X44GM0A=LIhYdo*q-zSjDQNpro[W(TYG5o[Y0w=^I3[Z53?(BXx\"-\\pFFkqw,d?J;\'L0EN;wtajv8HHnzBp8^Y\'I&vStw!/gGeQFGq/.5`m*{]>Z1zI5g4d*:\'M6cvQjMyG3ayfp(g\\vfz[8@wep/-2Q,zX&H$n/5][53=yvi0FTW>gu=gu>m6YF3f4f2[^G+8x(M2Mprqf,@?Z3&aCdVbn+!]?[7<ep+s6IN/=(K)\'\'+BM?3\"K:!0mb)9\'RNqu{3zBo7YAtS\"Bir)eN5ZMQ4IVV5=qQy>\\<RjJjb/XU(ZwpNry0u/w?iyMO+zZ1zH4d)2ayfq0.7h1S6Mc3jIgTLa*DZ\"0jQ4MjTGFha3mZ[>\\=Uy.jXZ<[;Ob%&0Z_PR18csA$*CYy$5#H)0T@zu]UmP\'g\\zvg&uOf=65HN4Q#RYO]i#^@`H*3]egXabM:tg+4d(0VIIs5C5{=RiBFxV%J,:#97JP7]UtoS14S-zTnWG<8@zpJXa`AaK4ZSnZW*a90%aGyZ7<eo*p+s7L\\m6]Z.mf>:JJq*mrx/oph;)V_\\4)ha2hDWk<&CbL6cwT{:F5o_k&jr\'XpR)jhO2HVZE,CPNs(Ztcq7R{@ecDf[t`bN@6.{SjAAcVbo/1FRKb3lR7U/#_?Z0u/xBtPoe/P-+-BFwTy/oph</opg9y)QFHwJE[%::PjKt5>u`aK1NzG/O(m#Tg0O&dTV8OiJr+p\']/gFbEilf@F$sL]pEB[-`,M*$m.1JeFifFh_\'<:O`xbbH#jzLKow/s(^0iN+\'y^J8rbuOd3f7usd#m.4WA!u[I<0v32={\'?MGZucp18g)+:(RNqroZUz2\"J:z+VZE)6rh:z.c6z63<pOs%L7h6f0Q..:x!+P<t`cVbm(lt+hZg\"aOGUYD&.Q5Px8B(<:KO0;wqU4?\"\'>DzhwG7x(N7e\"ixG7trbsE7#EsD2f9#>Sh=1u-pz<Qe1YTx-gL$fb>J=0s&RS.\'sA#&6y2\"K>4)h_)D\\-_%-TGGls#Fz_MCI&ya[&AWwwuh.BDl\"Sc\"n5S*mt\'U`ghURx52=wl?0jR<m@1pkMxArHL(wStvvqZNTB,P8__Er=oEDeV__Cjr+kjSC2jM\"TmMt.yG1ZZ7@xk4T28bn)p,xKJp$QR/+)*7utj=+XbheHp*p(fUV4;j1JfK$fcBXy\'B[+Zl:pR(fXbjqz:ICRU;^PT:a_=OWM[fo&]/iQ:h)(,BJ3XLTD5w+_*Hp(fUW9PjN\'n%^84>zvg%sF>DwZ;SrlLot#@[4)lr\"Bgi[k0CCe[yxoIYh&vPiHeL+/GZs^Y)SR$RXG9)[xrX>gu?pC946T*jd;7>oB7-s.{TkG[wnDB_AaM=)PA1m`vY:Rn^k)xRmUA#(<:MWQqkIfO6YG9&K0Ic?K>4)kk]m6\\SkJhUQw.orrh9vuj:xyz\"*JwI>=V\":@qGJyRiABe^.\\oB6%SYKKv<^NKj]qJYer4B3qnYRnYSsp[V%FxTttnQ\'bFs?tW8LY\\F)5kIdDcK0EPGSLb1e3f4d)7uwwr[Qc&*?@d^1m^m2FM6][79X8IIq*lrx-iTIRA0f@DvSuy,^#)ANH^+M,-?612EGt@yk3Q\'bGuD/Y[Al*zZ53>$2n^n7\\Rd)6p_j!UpZRjG`3sw%CcODGuF8%J/GXg(\'*:+c?H2YTw\'J*.EVdxV#AcTZKGa:9MZbaEm%`@Y(QHRIW]OR4GJ\"_FxZ8D2e6p_iwBw`Y$98M^sOlZ^J:$>MN$\\0qw*Yl:q[P^j&js-u8M\\i&o2@-[m9i1P)o\'aDgb<=]G)1[^K<*Xet@xg\"`MA<J@Bjv<]I3_k\'p/-7h3[W)Zt`dXmC?Rbw[Bo9adXj4[Ux(O=%92-,3[X.px2&bI%q?{yrT-v@pA.]sS&Udy[<Uz3%WnNv32?+SJVW6A*Gh_*E`>LIgTLb.SA+N.6dzefW`]:AuY;V&PKd?G*8z/jXX6<l7cwRo`tLZa]5*nv0zH5kG^)Hq.%ju5=rS)eN8h2S3>%7)a;<Z8F9,iX_WuoR,zSjCK3WF6u{0ojIgTMgCWlB>QawZ>_L@;D\'1_rIO5U6GGkniGcDdSPy=Y1#Sd&#v^Tf/IhX^Ti=.gIs6IM-2T8V/#\\2yAixE-HgXadRQ{F%{n:j7g.DPJb5v(PC@UnR.)#k%gc@PVB(:-pw.mjN\'kv6>uadVcp4GK(xZ7<j,2T8V33GL0CCdWeyY1$[,\\sV5?\"\'9/xBuSy52:mA7/&imjQ7YBw`[)P>(Gq0/<$834JZl7dxY54GJ\"`K4_iu8Nc/VKTGGlqv\'OA6,p$RYMR9af`3rtpZO]hu>j(xW*^,SEAUkDL5^aRT27__BghZh%m*yW$BdZt`dYqT26U25R\'^2v,gO8aipw2%^6,u=dhc90!PXLTE;9HD\\+SMc5uw#4z>Y.ot{4)h^$-VOjP2A6(`82/3T4@,UMd8%K4ZSmU?t[KCL9q]Z1!K?:D)9*a5x1\"PT9\\I:&Hz\\=Uy0omYU$FwQkO\'iiWV/#[,b3oc&);2%^5,s39blyCxb_;C$\"xj-7i;#86B.[guAw`\\.iR=t]Wx$:=^NH_/^u[H6p^efQA3w.opkLr&Vi5_gmrw\'K-;%>NO\'ij]pC8/!Sg4bycaA[.gL\'q6Pt\"<LJp$NEPCA[0r!=SmR2={&:44IW\\J?:F3g=2\"OO%^9;Z;Uz629g&y_NKle:+b<@ht5B0d6ttj>1t)_0e9(V`e^*K#`K4\\\\<RjFZueyY2(kprqe(/O+#ea>J>63:k:ulB=I>8=i%l&dU[OYStuulBB`FyZ7?sS\'[#1lYY8F<9F7\"@[5/.5an/3P\"LBFvKQ9adYpNon_o:g%sF>DwX46OoiF]*L)$sGBWr^^Bhow1$Y\"3w2)myBo9cp16[Qaxa\\.d=>^H-CL:umFQFJ\'y^I3^gnv1$Y%?PXN^qFBY{,Zh#fdJ$jv:RrmS8U.zP[\\?bUe#l-/DI))0S=oDB[-b6!=P^n4Ou-nnb\'1[b_98M\\l3LiVPog8w#5%RV=gvG:+`2lXSuz.d;56Prv#9:W-r)eM4S00>*SMgFa@UpYLP3GO<xtaipy:IBQS01DFq5HN3Ns$H),@Ck\"Ti;$?Sh:{/jTGC\\.d:/w>eh\\wg\"d]+SJVU.!Sg3]dbDeXg)(-Jp!DvStw\"3v,fK$hnruy(K(y^K9x#5&Ubo3EDcM9mI^&7%NCBaJ/GYnFN7csB)?F&%\'4n[]Ezfmu-py:G<67PplQ04U6GHq/)!d_5$OI_+L)y\\@bXoOx=Y2)p+u?o=wmA70+&tJN/9mH\\yqS(aAZ(N9lA<H8!5-xI<3(igL\'o04T4A/`$%/Y[CtOe8#@Z.la):.q\"ExZ7>pHQA2qo^iu<^OP%_=KF\\\'@R_jyH9!5)jfD\\,Yckqy4-$ggRC947U1/6bsD5v$?Ww\"3u\'SV9U(\\$4w.oqlNzLFWg((.Kt22C?PYQh@Cm)r7Qv+c?K@?X\'L3S01FM7dy^H,>63>!&90$[-b3lVJM\'p4EC]3!G,?<LM$aH$o4MkYZ<W+c>I7rf-BFwU!:E.Q8\\OXPe4iDOEJ*,>5/+*.HcDbI\'\"k)xUx,_+L%iow.noe0S:dq3?\'@QZUy.gK#^@_EwSu\"5+o#PP%\\/hM\'q6Oog;+^&8+gUS%RWAzqJYfuE0[b]/iO.4[SlO&bK1Nw8G@H/MxBw\\E$ygyRg7sj@;D+BMBA`EuJL#^>Vy*VX>fp(ePC;>c_:;[@jzNT>qMfCUg/H_.]rNgGfSLa+JwD\'1`yi$e`7*fRHQ@-[j-7i8q\\Z3*s5GFhb7(Ys^Z0u/xBvW/\"WvulCEn(jk_yi*),@Bhmm^pA,TISHM-5_hp\"H,<.iVRw/qy67OiM%eZs]UtmLle9&K0JeFh`0b+BOJeEdQGP>&<BrD9-s+ox9E4lT<l7csD3mYV%M;x!*L*&x`VlFST-{Urd%w^PU<gxO]hxH<2%Z\'FmzG-DQP!H2[Z9E4mVGAOKhTK[l5W?pE@OQ,$fgRFIwJGa?NP*t?sQv,fL\'r>qNjTD91&f\\zxqR$QU<er3<rX@sQtz2y?`QR,xNT@%1e5nVE6w(QGQEEhfJyRg6lLq{>Y-jZchdAQVB(8(YqT0-.>4\'_71-/B@[0r$H)/N#Wwy$7*dJ$is,t4<nEI!^Fzb\\*P?*L(xY2*r5D:58\\LIgTL`(;404S0.5^bWi5_jxF/P1<z#0f=8@wfvICQT3>!&;8G?E\"o<sYF0WLY]LDOB?Se.G`5#I/G]\'AR\\\\;O]j&lzK?<KIlma!rOkWOg?AgkfDZz\'B[+W^Wwy$6\'ZwoJ`,N.5`jyI9$BbPHYg%rB.XY;Tw)U[KG^-ZfwLM$^<LMzKDPJ`/^tU-s1.1I_-TKYbcPC@Vrd%w\\G,BI.DN>*SLc4n]c^1ne5jG^-WX7F>Am,+0P+ySnVE7!;I>=TsoVA{tY>dh_)BUe).Lt5<oGN6_aNDFq4GIvD.Q7[I=65GHq.%ggTNiN,(\"m0<\".a-N,))2]eh`*D\\-^ztY@m5U38`bOEJ\'y`Tbr@$,M+(\'+@ExZ:LQ9ahgQ?)GnzDx\\F&(2b%&.TF@NLpv*^)EbI#jxG1ZX2)q/-1Mt,moh@Ad^,VV0)vH?Bm)wMTD7&RQ&^4$RYMUE9-nsx*XfxRlO&dUYF0YX1\'hc<>`PR-\"^BffP=!\'?K>2\"NJfM/:wtcs@ypJZk5YIBOH[t]TlLr&Ubq:aaGy[8B&3iEYqV:Z=[>]Cq>wi,5c{izTnWF8$EuHCUf)0S;fwMVM[gvE0YZ<V%H\'!l/<\"0hHlmc,HhZj/@712EI$iu9Od2b$#zqMfCWpT15V9Ru\":@qEBXwxxs[P^l-/A?X\'K-<\'J(!hvB\"tW6C2hCOJb8)_1m]gu<a\\-_&6z5.\'q7U-xD(5n[Y0yF*9#@[1w6?vclw;Sv%Dikc1a!rKZg{Z3\'fXexSpbzfmw44GL-6e\'(4iCN?3zAit5>wh*.Hb?KACiq#H+9y(K*)0T>t\\MN\"Tj@<I??^BjxC\"qISFGn#R[W%FwSqh;\'I$l(r9X9LVRu#<JDSZMR:do+vG6v{/fCTdzaYvoMnkR6Qw1&aEn(n\"LAChmkVJQ<qS)jeBS`k$]74?\"(ARZSo_m.3U:[CvY:QjIkfCUe&yejiUM`%-O0;xwpPy>`PMpw,eEaDjoqo[X.r$M>0ojJlkWSy2%Z%@Th8qap8YC#xgyRjG^+RD=D#uY<Z8B(<6<i*+7p]`NEPC=I9\":@o>\"*Is5E@NMv7C.WT&RV<digO2I[oFK+,=2zBqA*Is4A+O6XAxfuAyl6^_G\"k%gfM-5^edGr7NhGgVX<^MEQKeCXscvOc-Ill^o>zxrV5C3roZV$Eq6Om_rGGn#S^aRU8Sz=Vy.fGic:0!OT:^Vq^cYs`gfN3P#OO\"NMw<\\@gozBn09j<#7.xF/S>sYBzk.:wsakyF+@BkzMMzJ>9@rMe=:KM\'o-%kyH8vy&?MHa:6?zubij^u\\J?<LP/3R+s5C5y7:ZAn7[OVE9,hVW36Qx8@zrR\"F&\"pD<>bZ!+RFDbGxTv$>P[Z69ZD\"qHM/=\'Df^(?J:$>P\\`S[SlO&dSPw6:`^:@pB2n`tRtz2w42=z$2nb\"rMc2d-Ks1,,4^fi^\"\"%2hCPKfKzUslGXj4WD/WQoaxa]3{Cq?{xoGP@-\\qIVU.xG4iCK4\\[:G<3-&p6Rz=X,iVU,nv.ou&L6bsD4pg6mR05U6GIu?qHP;nI\\vco+vC)=<RjHdFkon_p=s\\Rd(2]i\"Z,c;7A$+KzRe,BJ3XLR;i0EPEGuD/WRtz2x9G?Bn2B835Qx7>pFIxP_o:h+4_m-.=-c8\'Vbm\'jmf?Bl\'ks*gVV0)t?tV37YC$!uZD%%\'6x.jWV/!RarE<<U!:E/UHFfW_\\5+t;Z@iwC#{rPs\";E/TB/]o@-X]PU@wg$iu9Og@F\"j%geGp+u?n<uf#ht39co,$fdGr5E>G0S;fxP`vZ?egZm;ug((.M$]8;\\G,@AcZxrZKF_1m_tPod/O)t@v_Y&Df`2lVLVRw,dATf-@@_FxZ9F7#BfdDcPCAY\'K+.DQNr{:G7w\'L1Lk]pEAUj>1t)[{$/`%,L#^=Qaxb_<I;*^%4ty+XbhgN1CCf`2lWNa$#%,N.3S29g*1T=l7bq;fxPc*=8>m8bq6Rz@c[$4y9D-N)vKL#^=NVIK{VuumFRKa0a$#\"ztZH5mQ/2KgN/:sdxY2)q14Nr\">X&I\'\"o<rXAw_Wti7j=+ZnB821=#3rsp[V#>Rg5jESS-yMQ08g+5i<*Yi+2WHBQS3@*M.9oS3;pOv1$[-a1c.O.1H\\wk8h4]aSZPb#uZ@m2DDf^)EeTT/&kv9MZccM8h0Lq\"Cn1;r[Rh;+\\vewN]hxKJnrttoS/-4[W\'OB>MMxCzh![4,yRf1YV\'U]W\"6/\'p18dwSpf1T?xm<y{%6%NEK,8oV?tY=aXtg.A@[4*n{G,?=To]c[$6\'[#/c1`vZ>c`=G1\\b\\*P>\'?NMu6?xnB821?-\\qK_#\'7%NA86C1g@DtJM*%rB,O4Ml^sOjO/7ctGAPQ,zTp]bYtdwTy/prqc!k(uF;2(lt-p{Aiv;Y6;fvH>>Y1#R^fgW\\KEU^[4,wI>=TrjBDn,\"_G$sKVQt#=NT>rR%S[RkJkc2c.LzMN%aEr:^RbwZ<V&PJ_(?H.F\\%6%OGUX?n8bl\"R`o4JZl7ak{OT;cika(8&OC@X\"4%Uf+6lJhUOjR;j3U8T&S[Qc(0YX2)q03KfEbEn&aFt@zsV36U11?-]u^TlH_-X[E\'.O--7lH]%6\"@_H+7qbvStuumHZoHRIVV1-/A=MP/5YKJp$QQ*r3:i/DN=&@Se,?=Qc&(6v!1rw(PB<Cyeo%Xti3[Uz4\'_99Oe7x,^#*Hp\'`<G1[^K<+Yj3Q)n\"K=-fHo\"I5d(/S=oDAWvuj7i7nR,\"\\:G9%I\'$w`WulDI%p8\\NP+ySo^fi_$,M(vJL\"Z+[t]Vsi:{-]wes<fwIAJ5atIM)yY3-&p5K\\sT(cEijZft>l2Jb7$J/FV`cU_`H\'$xdlu/zLHa:6A)BR[Uv#84=t\\NS9[J?<P^m/:tg*0S8W7E;9G@J8sh2U?v`]87M_xgxQd.Lw>elr!=Qe/N&e[t`dXj7i6i<(L1GXi.?4&[(K\'vN`zo@,TMd6tusbsA\'8(Zt`bPIZnC@RbyaXtg+4d\'+AK6i;$>LHdGq.(vMXX5:``Cjt1,\'y^I4bzgs4?$0b*AL?5,u=dg^$-THM,0JfM-5`m,(\"l+(%yenzDydg[sYBw^R_k#\\5+s6E=BrD5y64D931:oOt,i]u\\LFXnHUX<\\F(-Jq%T_ggWZCxcdO@3v/r\'[z%5y8<gwKKu9PlXQmXOe5o\\`NHZoHUU/&kv6?zwi-:y\'DdRNprmP*r5GJySmQ,$iq%S]\\8=j*)-F\\%:5:dp16ZKIll[eknkR9^Wwxz%90\'lx?ddK+1P*uB#$)BS\\X+c=@ht8PjP1<z$1jM&hhSGJ#aOHXg&sHE`=J?=SmS7T*gYdn\'fZnEFo*s8S!@_H+8tmIb7\'Wk:umHWaeYoJ^\"$+K\"[1x;Sqh9z,\\tX>dh^$,O2FL1KiUOkUGD\\+VX:Sv\'M7cxX/x@n3LeBTd#qC3od-Ij`(==Z3-\'tF:/w>c_71-0EM9nMopf6nV@yl6_e^-Zg{Z2&_<I;.mgBNEM9pS.%kv:Stx\'HxRkLu47X=a[\'DdU]VtmKj[gzVy+[qPt$H%sFAOP(kqz77PqmU@yoC<Ap?%2mYV(XmB>MMyG1ZY6;er4D:7C/[gt:Y;Ty1x=[;Qg;+a3ob\"rMb-O1?-\\rOoh??[7:ZBrHIt:Y9MY[@k&ku48[I<1zE&(6uvwtcr=nA4y69X7D6{;H??^EwSuz1pqh=/niIi^ypHRFI{[50/<#2sz2!H.JljS>vf#hq&Z\".a)=;N\\gv@tS%PLld6uuq\\Y+_-VQt{4(dN9j;\"2sy/lb*?Cq=rU0+$l&geFieBVkA>SjDNA:?izUuse\'&)9\'RPx7B\'7#CkzMKov)[wmA5$POyCx_QYMWQpe1ZW)])Fhb5w-iUPm_p>yvg\'zfms#EvPe6qbyb^6+p$S\\X+`/_wchdC\\-a.WSz8=i)\"k&inplQ05XC&-O-0I_-UPn_sMa);402I^&5x1w8G?F$w\\F*:(UYB{pD;>aVkA:@o>\"\'=An5Pw3..7kBA_Er<i+.DPGSNng>:G:,fJ!Z.k_zoC948ZF-Ks.\"X\"722B;@n7[LLw@n7[NS;h(#qB/^tU,p%T_ffN7_bQPzF&$###%/]m5W?m5T0-1NyBrE=@j!Vvxy!(C]4&[\'C`A_Dq8ZBvX7E8&RR)kl^sPqpbw[>^J5f-CL7i:z,Zg#ea=F.Ks0(r7Qt!76IP;oKd;6>pGK*\'#w^PWIE_4\"Ezb\\+TPqsp]aRV<eq0.6d%vX6<l8e%wX44HP?*O7_`K3VB(9*b:6A%2iIjc7$Gz]F\"n4Nqu\"73:evLTB-TGHr15S,u;]I7oYPb$#zsU.\"X#;AsMc4mU@ypIXckq{=Vy-eBRYLR9bikc1`xbaFq7Qt$Dl$Z\'GvG:+c?LESS.$dWi2P(hb8)`4y66KZeo*r3:j4XH?Bn/5[To[[;N[cdN8i4[W\'RNrz63=vh-9vsbp4FIxO\\ekl_xdlu1*uE1_tQtz3\"J7oU=j,1R/.7j=,]xk4W@v]Q[Z6:_Y$=JAEwSrmQ+wH<65IRFDaFtC,L#];IAH+9x&B_@[3%[)O;qV:Z@j$aJ/FTYG8y.fEbCeYpMjUJSEAUlH[vh)(+@Dq=pKa-R<qQ#L@;D(5rlJhVRy7;a`Be[wl=\'DcPFN:oOv1&dTV9U\'Vdy]DtJP5T/)wPf7uvsctHCUh1P)r4?\'=Ao8^[/niJp#MDI\'zccJ&tHGg[pIW\\NQ/0BA^?Z1zDx`TcwX/yE(4iADn,&sD3lR8[H8x(L1H[rS+q+p(dN8i4]aQQ(id>E$yh{X)V__@^Ae^._zrNl]k)\"fib1c,E\\&<Am3IYevH@ExZ;Sqg7oWF8%J-;(O?,X^UkFV`bPI]\"#(ANLorrjAAbOFQGP>$5{=V#?X\'M9mFO@1ma!rL`\'7#BgfO7^^AcXmFN;tez`RV?tU,q\'_4#I2VE4n\\_LA=MP-*,;*Yi0EPEJ(\"m/9mH[t_]:B#!vadWco//@5*kjUJQ?&<<Z6<fwKInu*a7)a;=`R\\X*^*JzSlLq#H)0UC0^rIQ?)FihP9g%uN`{qL_#$,O1@1ojIhX^R_j!Vrf.DQMooayceTS(eN9k=+V[I9#=LKq&WmI\\wh)*5lLpx2\'eSQz@d`;=^K>3%Yws^^BghW[F-Jns\">Rh;*[rU0*!bWlDHz\\=V!87KYa`BaL7g0O%_?UqasF@J7mP(knkS:dr6Me=<Qg=3&_<E-Hi`)?G+:%FuHAK9unLk\\m8bn-(!fkl]n;qT.#aI,:#<E+BM@86GC\\/gGgXbf]#+N2HV]Q`p<m?-^xi+/G^*L)\"hs38__Dn+!]@`K6h8q]\\<RlP)q01B>NO*uB##%/Y]LCK4YNZ]F\')8{5.#`I-=/ngAI.CL7g.FWe!c^1nc,GcC_>TmQ,$iox54B5#H*3`rD9-s,ox7>qL`(9+eJ\"^Cm*yUx+\\sZE)8#?X%ChgP<s]Usi:y(Ht@wbf\\zxoIV[I:(SS(dL0EN=&=G1XPiEYqW@qHO6ZKHgUS$NEOA70(s>oD=D\"tQu&M;xvmB?Se+<0u1)tA{sU/#[0ry4-\"];JGbAX\"2sz5,xLKr)dJ%l(n&aCfb:6?wj/@:@pA0e;1#Scyb[\'Gp/-2P)mw9HCXr^aM?4\'].d:-lhHjfDYxwnI[pLd:.s,p{Bl&josw$>OVD1d/TB.XZ>c_97F?I5e-DT\\Uvy$81*yV\";H9#@Y*Yl9oOy@gp&\\)L,1R05U6GHs7KX\\G1XOd2b#xcga4stram,\'vQlUD2g><RiAFwSrmQ-(xV$H&y`VmH\\wj2Nt,mpkN\"Sf.F\\#.ZfvF7x*VZH9$ChhWW5<m?,VW5=rR&Ywuf%sFAPR.++4auPlWN`!sS&XoNr#Cn,#hnrw&En(ihSE>I5f3`p<nB837X<`Td$sJUNe;0w=\\CtLVSy4.\'tC/[bbFr9X:Tz9@uX;V\'TZMR9`aGz]DtIK{Urg3\\]Afja0]l0?.e>?_L?3\"L@;F1[`R\\X+b;;Sv#99T#Dp7U0)xRlP+zW%Fs?sV21?+VW8IJvD\'3f9\"9=elt+hYdo(jk^sOnb&*@H-AEtHCVj;!/d:-osv\"5(dJ%n09mGV\\OUC.UM_xh\"bRV=i%m)s:]LFWg*1S:beWeyW(Wf#k%cPI]yrS*ic7\"AbU^^AfdGq/-1NyD#w`Xy%:9Pg@Cn-)(*:*]$.X\\H4d+</r#Fy\\@da?Q\\`OI`1f>=Vz2x;QkN%bM7e\'&*>;NXSw+]$0c0\\ddPB;>dgZl:nMniJq%Vh0Ls)bBZ(L.=,]xn@/f@H-DQLiVPlYX1$]4(fUU23IYer7Rw0x>bXuj7g2YPd.N(n(lt+iZi)&!m4R)id=@eeM5WB#$)ANFU\\Rg6kFXj6cxZ:LQ8^Y(QHVW9Nb,HkiO1A70\'n(koob%%(8$G{c],ZfxNZ\\Dx^OLqz:IDWnKeCXvr\\W{2x8E6y1w7@!xl;tdxUz75C5y52:k:r_d]\'BXwxxug(\'+@Cn-,4^gmpn]c`97GCZ%>LEWf&zdg[rU36S*lme5lP,\"bVcuKR>yt^Wx&AXy\'Gq16W@rJTNf?ExY7@xl8h/ETYE-Kt38_]8:X7D2iIkhKv?m5T0.6ao3C;@l,,8tmJdAPR.*&{k*$o5Qz>^F#n6U4>wj4WC(:0x@k\'p19i1O\"OS6L`&0`yj-3ZSo]dbCcQKb6y4*o$Ui9uoR,yQd+<2$Yy$5$NEO@2sy/la\'1_rIP8dwQkM{PVE7!:E-N\'n\'hc;9JKzRc&);-lgBOIa5z7;`[+[oDCaEr;fuE0Z_QU>oD?LDNA;AsNgDYte!eeP?*O9j6d{fo{E#rFD`?Re.HdEf\\xoHVYBvX47V6B0b+F_4y;MXSu$A_Ciou&K3U<gzV!739bkv6@$,N0>*Q@/d5soYO`xdhd>E%\"tS#J3[W)Xl;y{&:45OohAH\'\'+CPMr{=SlP*vH><Qh>9AzoA0hGcGt@va_?UtnP&bGvKN*yY0w<X.t1,&tIIs4>ys[MO)q3@,UNf>=W(SV7JTL^wbf^\'<;Rpb\"o>ywj5^aPMprrf/Ls.yKCOFPEGq15XAv_UlH[uexSpc&%(6w%DhiZgzX*[wj2P%[+Xdp//;z&@PUA\"zrQx6;bdU\\Q^l)yW)Xj3U<eo(fXcn\'hb8,ja-O0:r\\V{3zBn08h2U?rQv.r$J3YQg:\'O>,XaaEr<fxNYY6;fwKN&jpy517]Y+]\"&7(ZvmA6-wBxeo\'bI#hp\"F#rIP7_`I+7p\\Z2$Z%=F.M#Y(M4YH@DuOb(6tsg1R2>&=CxaZ$95=sX=aYxyz$0e:-j^uZAo=s\\Si=0ry5/,.BDkxBw[Ap;m@0jSA,R>\"(APT:]NP)p-#cWh,9wz)M0B=LIhYes<dijY`[+[oD?PZStsi7mKhSHN3LjWV.xE\'1\\ekk^rK[j,1R03Nqu\"61/7f()6qd\'(3e2_n7ZI<1!LBEq9]OT<j0BA^>Vw#95A)BUh2XJL!UoXJHia.WU&T[RiBG\"iyMMyF,BNDK-;%CbK2Q+wG8z2!H.G`5{?\\<O_qB3qkJiZep+vE/S>vevLP4J[oEEjnlYY42>$4w-j\\m7_cXj8nNt-p!Cp8[J@Ae`6\'Ys__G\"ixH;-hQ=xpLfDZ\".`\'4oavX59^VunOw9JL\"Z-gL\'q7U/%eZqR%VmHYj5[UuupV<chd@K>60.6ap7U1-/CFuHCT`ir)dM1GWblxBrF?I7qbsF?I2WJIr.$bQKc;45K]tY?izUre+8utlB>P\\bZ#1na{n;pQ$S_hov.r(],X_Y%@WvvpT4B0d6v\"4\"I0O&eU[NR4HREC^;D&.P3IW\\OS7S&Vi6f.G\\{%7&T]X(ROt\'SU5C3ro[Z69[G0VGANI`1hGeM2KgKzUrf/Mv;U$H((/S<m>(Eg^\'=An3GQEEf^%6\"@`J0Nx@l.5]\\9E1a#xgxMS=qPv.q!Ahpz@ea>I:%FtB(:/v7D3n_qA+N.4\\[9D.Q9``H$q@%2hEZyyuez_I0Mv8HFdL2MoqnXMWQpg9y(K+/JgRB5\"Bl&f]#.Y_WrcuKP7[MQ1:qV9S\"Co09lCDgeHq12FN9k?2t\'V`e`4u&N;y#/d7x,b7\'T[NVKQ:h*-BJ2R04S.%ggSHO7__EvOb\'2d-IlkZ_R^bT^`L;z)L*)/O)r8S$NFSS(aA[0psslH[uduG<55IQC7,ov.r$M@85B0a\'4nZX0\"QZRn\\`OLlb,KxI=5/.7i7mKkb,Jq+nv/u48\\MN$]738af`4w-ka\'2g>:E3f6p^gox56La+GfTQv/u1+{^Dq=oEGq01DGtB(;2)p+vE-LxH9\"8:V*fO9i3U;dkr$J3[W(TV;Z?dbB_AaL8oS2;pOrz500@4\"H/IdGn{G.G`7,nv,iZgwKJr+q(dK-7mKk_yl8ez`QS02Ja3mXQn]gp$S\\W\'PEHzY.oqo\\`OIa6#G\"j#^?Z1w:Pf8y,`,Q;k7h1O\'eWdq5K]u[G1[\\Bn0:pU9T&T]X)U[LKr+mrx.iSB2oc\'-Kv?l/;xxs^\\9@uX:T{9A{rPt#@[2\"LABdXmEJ($sM_{sS\'Zz$5y8?qL^{t[H6rf-BH\'$v[E%$$&1a%(7\"?Z-gO3Mk[ft9W31<yyxoKb4srf/Kmm_tRx3+t=en$WoS28cp1:mFM5[RjDRQ%WoR,wI?@cWk;z*P=yvk8k?3y>\\?_G\'&\'0Z_PT9X9MZb_;C%&-P4Kc7$FvPd1]hu>h![50/9pWAxh&q:adTX?n9f&wX305XC(7y/mg?@aPKgM-1KmiJp#L=-c7%K4[V$Cjt/%cROs&PKeE`<G1[^LBCghVV22A3v+dBXy$6\'Yvk;{*Q?*L)$o8]Sf3^iwByi&q:dn&_;Av[BuU&SZMR9]Sh8re)2\\bYwr\\Uurao4GM0DGvJKyJ??\\<NXRroZUx*Yh\'x]E$vY:Pe7ux!+SK\\pGL-7i:x{*N5XC&0Z^MESS-!X#;Aw]OO&dRMjVOgAL;!0jTGCZ$81+\"c\\%:7D3kP/1KgK$fa8-q\'^2qpc\"n:i2S2;nHTT-wD\'/UJO4Nry0v2-)$uQqjG_0f@G)0T?xk5\\W%Eo03P\"K>2y=Z7=m:nHZk7cvQkQ2?*P;qT0/7g/JiZgzY,gM-1Mt,p\"G\'*9%Er<g!^DsE9-ot$FuF;43A/c4nYU{9>l2I\\ubkt.v=aXsctHCXuj:uk?2v/u5;g\"cYs^]:F3h>77OkUGCYz)J{Z1x>aVj<&A[.hM)yY3+yP_rHK#aK6f-CN@4%TcuM[djk[gvE1\\fp)kmc0XU$I.ABe])Fkoph=1x=\\=Y.pv(ST/\'q6Mc4mVD5ssj?4(eRIW^Wvuj9q]\\8?tU,ox8C*CUf,;)TT,t6GFg[tZH:&I%sE:2-)#o8``Gy\\AgkjTE;7B)?F%zl4Px;Pe4g7tmKka&1`xdmw7@#\'8*dFigO2HV\\NP,&tHDZ#3w/s([#0f@F\"k(vMYZ<U#@_EuJKxJAH*4e/MyH5lN{MJi\\n=z#,RA-WZ?flon[^K9wws`ghWZBw]I8sk@:?l/9sbp7U1-,4^hq\'`;@o;nFL1Jc<<W)\\!%7&T[O[^I1VG>?`MCFr:a_=OYV(YnGRJYes<dlw9IGia1b,E]-]tW8JO2FM2Nw6?vadU[LLwBuV.v:Ty5/*#l*\"d_2sw(QEFlx<X1&bK0FU\\P]daAX\"4#MDM9mI`0b,Ilnf9#=NS9_[.hO1CAY\'K.<&DhhSHO5XC%*BRYLM&gdD`>Q^hr-zP^hs1/7g/IeGo%[(J#fgSK\\oC948]Q`o7X>gvC%*BS[Vz0qv%Em%_<JBJ4\\\\<Qf8x&DhfL(wRo]gnw56PqrjCG\"hp%Vi6f.FZtbku7D3lVIK{Ure)0UB,M){`NGXf\"d_3t$Eq6Pt#?X(SOs%I,:\"4%WoOzDx]I3`qA)CZ$81-+/Lq#G\'%\"wabI&wY6>pGO7cr=l7dy\\@ecEheGmw7@ynA4z<Pa\"uX8IJxJCNDHz\\>Y-iYbbI%rC1c/VM[emv2*vH=8B%-Q7ZH8x*UW8Nb+E^1plR4ISL`&4n^izP\\aTbtHFfUV4=sW;Z>^H/Lt1+\"d^/d9*^)EdO=$4y9B&2f8{5*kjVOiLwC#wa^9=dieCWq\\Y+b92*ySpasGCZ%=F.Ks.\"Z*ZmA3w2)mv46Prv$>OUD1b(6v!1rx-eEbDgeGls&RQ\'cJ(%yceTR\'].b3iFZyvk7f+7q`m,(\"l/8j=)P?,VU.wAsL]rPpmWKR>wl9nKeEa@Wy)M1HZpNomVG@K:\"6,s23GQDB[+Yh\'xZ8C,L$dXi2S18e{aSZPaxaZ\'Fp-%m\'jopjFZug\'#rGGknkR9acSR)ia1f;.oro]da=F,DSYH;1zH2]efVYBuV/!Sd(0UC2gAF!hv?n:i1Lpu%G{`NEO?0l\\fp\'`=I:(QKb2iHeN6ZNXPf<4,xMP07ctGBRXIDXr\\TnWG?DuM^rNf>>\\=W$Dku5>sW;[?c^0iN*z\\<RkKq#L:z*P>%:5:et?qK^wfvIDVi7i;#6+ox9F9(YpMme5p`p:g$n1<xug)*7rf-BJ1Nx?efW]Sg7nU<eo(jk\\l1EL1Ib8,ljR=sZH;+^\';8F9,hURw1!LCK1O$Y\"2u(Wf#l+#hnt&OFM3T6JUOm^n7]Uq`m,*,;(QJ[nA3v,gN2I]{zwj1LnlXRph;\'M5[Tp`q>xoIW_Y$<E)9%FuIE\\*RGJ#bT]X&I\'zfo#QV>n=\")EfYi.=-c9+fO9i0Kle;2\'dQIYg#feN7am\'jmf?Bjw@p?#+M*$n4K`)?G,ADp4IVY?hxJBL:y$820:r\\Uvwxvl>-_%/\\h\"\\:D.R=rU38^Y&I&wX/yH3aycdQFI\"`K7j>2x8D1a\"uX:QmYW+eK$iq$QQ(g\\xl:r]X&L3T7OlXRrqbwV*b;=`RYNYW-ow0yAp<qQ\"I1VC.TF@LAAbQNr\"?\\7<bdQHSMhM&ilgBOJeGjk^sOm_qD;9JM\'p1:mC@X#:<]J:#:<_QU>oC95>sYAuX5:es;bfZqPw303P#PQ)o(ha1c0XSy2!K>600=%;=_QXG;2)o&]2t&M<$:9Of;.mjM%dVahke<7?rPqrmO{KADo..;z)N5ZKImpo^hr0,,4bwW-q&XoNr\"@aPKhR>\"\'<<Y3,\"_G&ydha3ph;)UYAuW46T+ms\"=Re0S9^VuoS16YE,Ins!;G8!8:Y;Ty1y?c],Yep//;y$5$OGTV6FAQZPc*<3*q0/;xxvl=\'DeWco,{Z2$Uj=-b3lTA&3mYV&N@710<z%6\'Yuf\'{i$dXmC?Sh9wy&=CydigN.5]]>X+`2m]hvAuX8GAOOzG,BI-AAbTYJCRS16XBzn={&:59_X!2w1$[*TQw418csB\'7$I-=/la&/XT!>X)YnEHyW$Er;bg`1f<52;qS,u>hyQax`Wr_gi\\pGM/?1s#Ckw?i!X$>OVF:0\"Q[[9E4o`q?#+KzSjCJ.BEs@\"zt[I:)Wcn(lw7B*CWnLla&/VNa&1`xbbK-8sf+6lLpx2$Z$;@n7ZI?@cXpQ%WqZP_rGHo$Te(+><Pazi&q8Y=caB^>SjERR\'cH{^Co3DBZ)TPv-oqqd\'(5pby`WpV<fs7OkUE:2)s:]LET[NWKSA.[fu?oB4x2\'f[t]Sf0Q07akyI9!4$QU<eo)n{H/Lv9Oc.R9_^<LM\"UoVB\'5rlKnna{m8aiq$L<&Elw9LUIP8bl{NLs,q(bAX#723GQC=D$xgxOYY44HP;r[MP-**2]fje@MCGxW(V`cU^^Ad])Hq14Q#MEOA7.zRc$yi&q:cild3jG`7,mpo]fjd<9IE^1qpd)5mR19i1P%]3!F$uSx2&`>QauSy4,xJF_2pkMxBsMa(9(Xi1Mu0%dU[LIja-P3Ka0^tS\"Bl(o)o(fYg%sD3oc%$%,Js1/6bq=oGP=#1hHjc6z4,vB\"u\\I;,b7([{%7)^0e>>Y2$Z(L0DK.=-eBRZPazj+*2[[;NZ^NIb9/\"Vsg/G^+P<s]UtpWA\"yl6^_F!fkiQ8af`4w,fJyQb\"rKY`Z\'GuC)?F$tOgCS[Rh<0t)_0gCS[Tp^gox8A$*FfUU0(s@wdp,\"_Dp5K`(:.r)dJ&p7V36U4:g\'{gr/)wPc*=9C)=9HCT_cYqXB#zpGN6^^AfcAXwvpS-#_Ck!R^iu9Ru!5-xKEZug+2YSsp]aS[Qd,DRV=guB##$)?F%zj++4c\"pB4u$ChhW[D\"tT&UcsB)?H0O(n&bGwPa\"rNiL{Sf0R4EFlt.t21>*N2KgN/;y#0gBNDK0FUZH9&L3S3>{#.Zeo%Z%>KDRQ$Td{flon^j#_Dm\'igO7[Q`uRt{4(dL.=*VX>gq.%fcAWr`hnrv!2v1#Wsg.FYnGQEDdSQ\"I1UC+Jt8PlWOf:,c?I4b{k*#l,\'{gp\'a@VtnMqx1zH0P-)%yen\"LBEr;chfIwH<3+uB{sS#K9tj<%AZ)QDB[.hN.4[SnWIE`:<^L@=OYTz64@*IwH;-j^tV34IW^TkGXk9nKeFha1gAH,=0t)`7*hYfuE2e5kHc?MIfM/<&C`Cjq%PMqx2#QYO`xa[)RGM1HYj1KhQ;pQzDvSv%Dku49_\\2zBn2D@WuqZLP1?-]sT,q\'^2t%K1NzF*7w%@Wur`is0\'lx>dcHzY.oqnWJJu;\\Dzgt<aZ\'I!^FzbZ\".^xi)&#w_WuoQ%Yxz#.\\m8dxW+cBVpZPaxa]2v1#VpYMUF<<X,fN3MnkS:do*q12I\\t[I<1zG-G_3sy/k\\k/:tg,=.k]pC6(\\%80$_A`I+5h9y)M3Ov58Y>ejgJv@rL]qJYdn$Z$96D7\'Ve#k&iorqe+9$CgeGp*ny>^F$w\\F)3f4c(/S>vds?rOojKox3*s6HM+,;&I\"d`7/#[.gL\'r;fxNZ\\CvSy2$XuoNt+fN2Lk\\k/<$7.xG5kIdC_=KF\\&<=_L?75D:6<k4U7Pnaxdg_*GkolWKTE<<V\'RR(cK+.G[xt_^<NXPhCQNu0$[,]xoEHwJF`7/$_BcU_aM<%>LFXmC@Wy&B_>P^k\'q7R{@aQP{I4c#rIP8dtD0_tRx4.(y\\@ecFlw;Tz4)mt)](Fhc;5;clx?eh]zwg\"d]*Q?&=BtOg?BjwAtRu%Eq5HQC:6A&5x/nkQ3GL.;$96A+M*\"goy=Z4.+-=.k\\k-3WC,LzRc&&+CVi4^fgX_Z(L1KhRA-XZ@l.3WB$&1d0VLXZ>_NJc?J<+]zveuD/Z]I6lMr&Wi5bwU$I+7nU>pEEg^%5z78Rw0x@iyLLw@n6V7JRC7*gVW6C3n]gq+r/)yZ52;pPw7B\'7$GzbWpS/+),=63<rYF0WNa&0Y[?fh^#)ANIdAScxZ9JIq)jeBRXIE]._\"!yrT-wE*?Aea=F.Lv;Y6>sT-u9PjO,)).Ks-u:U(Zuh/CFvNZ`Uh4^fgXclw9KP6T0,-9wxz#-X[F+?@cXmDHyV!9?l1FN:r\\SmR19h0Lnm^l,,8tlGWae](D`@Z,a0c1]i\"[2{G-F\\$2lWPkO)s:]NMv;U\"?Y-gM++3_n3FK($rD8*dHt;`Y{-_$,M)yX-j\\n={&8-s.zOT>sU.\"Y%ElzG1VIGjeAQWC)@G\'(4iDRS.&n*t=h!\\;JE]+SISKZi)#m0:scr>t\\LF\\$5z:F6tvtg,:#;D\'/WRro\\_I1Q.**1UB)@J7mMt.w>dg]{yrU37YD&+DWoOv59[F0T>uadWg))1YV(ZueyX+dEdPC@Vsi8q\\Y-hSEBVpYLN(q6KZh&rA%/Z`XvpT3=wnFL1I^(@K>5+t:Y:QlR6Pt&PFM3S16XB{pEBY%?Rby`Ui8q\\Z4-%ju7GD\\*RFGr7M`&1b(3g:(SQ\"J7oWD/VM_v_X!1ng=529exV$G\"hq)h^!ztZG3b!n8`fa:5;h)(,AI.DOEL1Llc1_qB2kS<l;voMme9$Bfa80&g`1iImpo]flniHfQD<ArE>G+>8?sQw/t0$]9<b^86FAPS5GHt;a^6-wD)8%I),@?Y-hRC6$L<&Eikb,Inv.r%SXD,Hjc9+eIvD.P3GO<y!&8+jb/Y[Am1>*P=z#,UM`%.ULZb`@W!4$RXG:,gP<t_^=Qe/P,%m+\"bWj:wtdz^F$tNd4kO&eWduHDWnMqv\'N:sdwRpf0Q/4V;a\\1s$H$sGD]/gHkl_wa_>P]dbDe[tae[vi2O\"PS4FFkqw-iWW1,\'xZ;Ob\'/TA*FgZm@0hIp%XsdwRmWJN,+3[[9D0^p?&:6@!ypHTQw0w;Tx/njO*zZ4-#cWj7h3ZSrjCI)-EU`fdEeV]Vur_cWk:wui3XHBNGXg&wX3/0A<F2_p@\'>Dydg]ypKa.XY8E6y2\"MFXh-:\"4\"F$uV-r)cGr4C90\'ij^u\\LDRR\'cL0FQJ\\rS&Z!+RC;:Pf:)ZoI[pK^\"zvdq5GHs:[D{k.6cy`TcwW,kb.R<qPu+eHq12FL/BCfb>H1VF>?cZy\"*JyO\\b\\*REB[*W^UmNzI7sj?5-xH9$Ciml[aYxz&;9KSB1f?AffQC;<[>\\@cZz$2lYU&QNqx/nmZZ:LUHIt;\\H4d*:)V]TnT7Ry7;dkorri=-eD\\+XbeYk8h4\\^H+7rf,=3(h_\':1&f[vg&vRqlKnog8z.eBQXF7y2x;Sqg4e+;*]\")CY!.`(;69ZBw]MG]%4suwy{\'@PS5KZgzX)Xf#j{Q`o9co-%kzLEVbl$]727YD&.S@\':3..8pZNVLXX6@#(>CuPkR6T*jfE_70(s<h&r?xk5\\V\"88PlYX1\'g_*K#_EvMZa[(K*(*9\":B{qJX`]76FAR^bVf&!l1C@Wy(I\"cWk;{,Ydn$UlFQLe?F%\"qJUOnc*>:JHh]wi+/IdFiiTHM/:ti7j>1t)\\%5z:H@EzdeRK`+Jv?m3Noo`sHK#bRT01@4{Cq;i,3[Z53>$3rrjBEo..:unLjWX5:cjq\"Co2>\'C_;E.O-.=-a.VPn`uU*dFjnm\\cbElzF+>9C*@F$vZ=]CsHIq+s4?#,P7\\Si>4,vC%*CVh2T<es9Y=`QU<er5EAVoU<cheFg^%2kP07e#l,))0VF<:LTD6{<Pb\"tS\"Dq<l;s`fdGo&]1ry3&\\-_\'6{9?pC935Ld:0{LFYqU4@(AR[X-j\\l3Nptx(L-8q[Uv!0m_uU,moh?>V!74>xoHUU.{Sg6lIb:48ZE+AI/H`3rqd)1XRpg6kGZucq5HO9j7i8p[TtrbtIHmu-ml\\dg[rR%WoOzCsJQ;l>+US%S\\Y/pt{4(fVZF/P1<xvj4[W&M7h2T<fxNXQobzi#`I.A?Z0t+fP;s^]<O]flokO)s;`Y#96C0c1\\eib6y4-\"Z1w9IGfVY@n9g&x\\CuOd5pbvV*eK)!fmqtvxyyz!$1g@DrB,P5S,v?k.6bvPjKq(`;@k*%sFAONyE%%\'3iDU`fb>J<,c9/xC!o?%5z<NYY56MgGgYh%q<k5[Qc(1[`TbsD5w(RMk\\j&p4ISISJYdm{I6mO\"SasHEa@Wvuk<%>LH`6(\\&<Ao9cp2<vj6aq<k6^`J1Q.)%uQod+@Aea:8HFdN8f(*8w$=H6qbvSx1w7A%-TIM,-<)QGM3P\"K?9@sPqpd&$\"u\\KCK3WF7y/opf3avW2*xQg;)V\\Rb\"o;l>)L.;!.c4pe/N&eZoIZk6^bQQ&]0kWT#H\'&(3g=4,yRg6lMu33DAY%@WvvqW>k/>-^\"!ysV7IO2EJ&rB.WV+ja.UL[fs9W2/5XF6tuoR+u?n:l>*SLa*Ea?Q\\^H+:\'N;vlA86B1e8#>TmQ.-5_hp\"H,>8<difIr00<z\'@R]bUf\'$zk.8mKiXZ@m.6am,%n..>.gK!W{2v-nrsnP\'eV\\P[]E!k(vLUHGjhQ;oJ^#\':3-*\'&(3g9#?TmNzH4g5f3`p;j1Kj\\k/;!.a*E].c4pd*8y+Zj2Nt,mm^pA/`$\'7!;JDUdxX/t/$]77M_zrMgHkiR>yt^Z,b5v&H#hp$PQ*s7OhHh[pGL-7j>1v1%`BdZrZJBNB?TmNyE(/R;h*-ACm&dRPv1\'jk]rK]rOnc)9$Es>rPu\'SR*knhBK7i9wxwoLhN,,8re%w[Cx]J:\"5\'^1nc,GdIzV{5*nzCrE:2*uD/WOf;0x>`PP$VoS3@)It9V.u8JO2FK-9sh2U@zrOqqg4d(1ZY6=n?+SHO8bp3A4w-le;0xAn4Ld==Y2&bHz^Ezca@UnS5HO7__Fzb[&>I:&GwQg=63=xoK`-Q:h),<0s(\\$4x0w8E9*cATf,<.mhEYuf&y`Ui:x\"-[m:oNs%N@4$QR/-5_it24LfE_6,r/(s@yl8e!fkhL&kw;X/w>b]0l[ccK,3\\^F#n8^X$>QawY6>pK^yoC<Czj+)+;-iTK[h#fcC^86F@MGYoJ^$*Ho!H0Q07`e`7*eM/?4#ONt.xE(3h=2\"LBDl\"UlIb8+i_!ym>(Ht?oA/b/Y[@j{TmP&`BbNA:>hxIAH+9z.d<8E6u{0nhCPJa4suupS0/<!,VV0(p18cq6OojHcAVran./B?Urf+8vvsbn-\'x[;N\\hvD(8\"<JBNDH#jzMLt0&ika\'7z4(fV\\NP+zY/qy79W5=nC=G1ZY3-(y]Ezfn{F&\'/S?zwh+1R3@+TJX]NLu47W;W1&dUYE.Q5Qx55JYckq!@_EwTx-fIu=ft:Z?eic:2,#cZvmC@X$=I<2$Uj=+[qOpmWLVM_zn?*O9h-<(PB80(o+yTp`p8^W{0k[dg[sZH6qf-AFxZ69ZArIN2HV[MLs/&gb91(n%]2x8B\'7$G{da=F.M#\\3#NJfM-4[W&M:uj9pYIAK:y$7+mpmVE7$H%sJR?#+O4R)h`,P8`cU`e^+O8bl$\\/k\\j*$p=t[MMzJ?=SkIeJ{Z.ooe/P/4V=h!\\:G:+a7\'Zvj5^d\\&<@l*$o3HSK^zu]Se*7usf+6mQ.)#o7W<aYz\'DbI($vZ@j$bQKeAPQ,#cXlA86D90!Q\\]Bk!TkH_-WV1)s:_Xy(Ht>l2KgM*&yaYy\",UOjQ4LeAPP&`A\\63:k8i6e\'+>:H>?`L<%@Vrcy`QV=l3Ox9KR=rU4;i0I`2m]fmu+fN4T0/8kA:BxbbJ+2XMVOiHi^zrR!E{hwC\'0\\emt)`4x3(koqjEU^^AaQNqy4*p(eTQ{Cp7X?k)\"iu:T$I+8tnO{I4d*6rf.HcC`?Uqczb[\'EijZdkqv(TW;\\Cw[Aj$`FvLS@%4stq_fgUS#J6j?5+s6FC]0l]n7^\\514Nqty+Zi,5czejfGid>Ak$_A_F{ddJ(zc^2rw&Eo-%k{NQ/2Moph=0r\"AcVe$o7X>fq,vB#zpFFks\'Vf$rD8)`7)dI{[528ahiZep/,->5-yOYTy2zCvU\'Wg(*6nUA\"#\':1\'jmf>;N[`S]_I0N\"Sc!j$dYqS,wD)9\'SS+o$Uf)/Q1<xvh.?8;]I5g6nQ-&r>t[I:%GwNYZ<U\">Vy-a.Y]LCH\'#sKX^PVD/WSx2#SbtLVQrpatJO4Orz63>zyucn(iiVS{=Uv!1nf;+`/]n=xs[OVIIq-zQbzhxLLyJ@?Z0s*cDdRMl`zn;s\\Rd*8\"86HK$fcC_;C#!u[F,EZuj6br@%2hF[#2m^m3IYfzY.mjO.0FRNmc,HfTOpmWKO.4WB$(;3-(zaXpV=fr5FEeSPx9H@I1S6Psx+]\"$+N-2P$Y\"1oiDRT13I[pIX`_A^AaOFQIYevG;3,\"_DsC1b*><TrjBDo/2KfIu?o@,SGGo&^722DB\\2y@fh^zrT+mqrmNzJ:&HyX,eIt;^NN\"QXNZ_OP&`?Vutg/Ha5\"Co1;sal{OQ/1FO?+UU,p#J7oWC)=;N\\hyP_n3IXdr8U-u:T\"?Z/s(Zuh+4bzdha3mXRqg9x&A[-d?H.FZwpQ{E{hxLLxF/S;h&vQlS<k2OyBq>zveuF8%I*/MxCzi$fc@Sc!k)xTx*Xcm%^:>fr27[MN\'ij]sS$NDK0H]#,R@,RA/a\'6x-gK!Y*Yj2Q*s7OhFa<D%%*@J5c!l,.A?X&I(#rIM.7j;$:<\\DycaCcQMk]m4R)jfGh`,O1B=G3b$zo@,VT&Wk=)O;r[OXPg><Qe2`qC2lVKUJTJTMb.TF?J;&En&cOA4#J5czejhM*#k#\\4\'cI%r?ypKa-Q9aikd7!9@qGIwIAI0Mw;W+eHq01A;?l.6d\"m1C?Q_j#]9>j*\'%#zoC<BtQpg9\"87JSE>E\'*>=Uux#6\'Z{(BY$::Sv\'L2R-%js+lmb(6soWF7x,b8(YpQ%Z\"-^xh(zdcGuE3iF]\'?LBH$q>vewN[b^7.#_@_Fy^I4_l+%p8[KCOFPDB^:C#yn?(D`@W!3y<U!8:Y8HE^4#MCH$o5Qz>^Ex[?aRU;a]6-yMN&dUZJCOFPEI\"bT][4+t<`Z%@UoXICS][4-$geL-4[W%J,9y(IyTrh7pZSo\\^H+:\'O?-^xk1KfJxKIll^pB3str`l(q3>$2m]hwH8#=MQ1=#1jQ6V4:h+0MxC!n8dtF9,kb0[cdO<!)IyRh=0s&PKd?I5e*8y,\\t[JBH*2ZX.s*fP?+Q>!&;7D3jKp#L<)O=#2oh?;JDUcvN`xcfZpMkY]LCJ/ERNqw*\\vg%o6R%UcvRrlNyE\'-LxE+??_H,;*[rS(a@Vsf,<-eEcI%q<m>\'C`A\\76GGlrz9C(:-nm^o=ubjr%SZLM$_Be]\'@OO%\\0qssj?3$Tao5MfDXui3ZPd-Kr*jgGic:2,$is-v>fnx<W+b;;Su\"5)fUU1-,6g4c$uW1(o)mv2.,3WH?CsF?G+=4+u>i\'r=n>(Hs:[F)6smKkb-M%dXi1NxAl.1Ms&Ucs@#%0^tT)b@R^fh^ztYAuU*dHt<dmzE%{n<vh-:#98Nd1`uW2-,3YN[`WpV=j*(+;*]!\"(?H2XOb\'3e3b$xdkr{<P`vW0#Xy\'CbL4ZRkMw?hxI>:F6v#725Q\"J5d(/Q5MiO2C?OUA$)AOLqy529g)+:&J)(,BNCFq6NiN,(\"n5S*ny<W(U^]9@rOjSA)CYz\'AUmKj^uZCzl0>,[oFHvF8!9?pC934J\\pGO8f((1YU&OGRMgJs4@%5y64D:48X=ca@VrczdfTT*lmd3d+=7<dkpv(RNqsp^fi_%/Y]I8tlDJ-9vvqV<a^6.#_Ckx@o9dtC,M\'p2<vmA85@\':45La+Hnu.r\'Zws]Vusf).Lt36U23J]xm?-]sS\'^1ma#yk2I]\"&6\"AcUbq8[G0VHFcI$k{R`p;j4V>n>%8,ll]l0A7/%geIt>j+*3]b[&?MIcC]2x:LR=sZH;*]$0`%*AK;&Fq3?(AUlEM9pS26ZH:)YnDB`CgdGmzF)2]iyMR4IUS%RU9Y:Su\"88Ne7v#723HRISMd8\'SW<`Yz*P>#0d6w%B_AbSU6JSHK%l$]611C>OU?u^VtlFQHSMiN-0EQLeCVj>-d:2,$jv=`WnOzG,AH\'$zm6YH<4//<$95>u``G{aVj8pWC(7#BgfM.8mLmiKt24Lc7$I,;\'K/A<JAG%vX2./?5(dL1Ja5w-j[gyQc&(4kLt0\'n\'dSR&[\'Ega6\"AfeM0A<F1\\dcJ)(*9%G{aQT6KX^Q]`POx<X-ot\":D\'3iEWi5_fi]vaaH%sIK{Wy,\\sU23GM4W?pEBXy\'C_>SjDM;z(Flr%M?2w419i5^bVf\'$yfs6IQ>!\'=CtM_ym8dyZ9E6v$?Si>3&[(J#d^/e>>\\<Qd/Q4J\\pHP?*L,.BDm&dRNolS;g$jv<]G-BK3XKM&kv8HD\\-_$)BUg1P+ySlMu6@#)CXsdxW*b=CwZ<X-kd7z614Pz@gp#K9x!-ZfvIAL;$;?i\"]=Rh=3\'dQFHxPc\'.P2B:<]H1S8W6@\':1\'jle;1#UkDJ,8p[V{739co/1GSOqux\'Gr6Ne<68W5;i-7lGZpLfD\\*SIUQx3-\'tG>CrB+L&o.-4[Y2%^9:X45JZi(y_NGZrW<b]4#NFTV8OgCRU:Y<Z7>rR\"F$tNc1_rHK#cU`e]\'@Q[W\'SS,wE-Jp%WlEM7cwStvxz%6\'[\"*M.8lFQIZm;tf%sIN-1Nv6@\"!zveuE3jHfO9g+6jBEs?vclv6=oEGq2;pNpssi<)RHSJZi*()3e0UE7#EsC.XX32>\'AUlGWds>pISITNjR9co,#d[\"+N3Ml_xdkr$K5asGBUg/Hc@R]aS[SmT=m=!(C\\,^zvdo-(xW,hWY=`R\\Y/q{=SlP+zVy-eAPQ*q00?/gIq)g\\sW:T\"Ad]*L(z_NEPCB]9=eo$Tf+7rh4^fkjTF@ONyD{l0A99Rsurcy\\Aj\"Vsg1T;dlx@iyKEYqV9T$I.ESU3:i0FU^X&Fr9[H6nU=j-4_jxD(4lO(n&aBbNA71-,7nS3?(EeTU25Py;Pf8y-c8)^*J\"^@aPKd@NJgRA0d4lQ1:nI^%3m[^I3\\_MBA_Cl#Wvuk?2v0\"Q]`NGV_];G7w&Dga6#EvPhBM>0ng=4-&o/0CFs<fuC);3+yQe/O(q3=woJ_\'8+eJ$feJ\"`M=*VX>gq-\"Z,b6\"Ae^/e;1#Te*7uth2T:_Xx\"1l\\dg\\veuC-O.3U;baFuF;2\'eXh))2]gp%Vi8oV>m7bo/1FO?+UT)bB\\1r{;H>;KM$`FwRmVD4ob#tT%OGUYC%(9\'TZLJnqsq_jwByfq.&o19i2R2:l=\'Eij]qJWY>b^4$OJc<?c^1ne2^l,*-CL;y$5\"Co3D?OS8W5@$/[gwJDVg,8vwtdxU{8<cdQJ[n?-[i+->3&\\,]u^Vsh4aq=sX=a\\.b4n]ca?Q^fkjWT$I,<,b7\'XlA71.2Q*s6HM.7g2VB\'5v&FtD/XX45JZi+/H`3qnVF:0yF-HdFmx?ddL-7kEN<\"/c4n\\_NFTW;\\F(.P0;tdxTy0ptvz(Ht<ep-\"]<OYX2+yQg7tpYJHjc8%K3WD.R:f\"fjb2hCPKhP9f#k$bPFPB;=_NH_,UMd6ttnNv6?xm>%:8KP7[OXQjJpy;Pb#zm;qW?m5U6F@OO%\\/k\\j(wPg</s\'XpPzAm-,5f.IfN5V9T$M>0mc/R:cm#WrcvPe7uumKfJzTqasHIp*lomXPiF[z%5y4-&o1:nHV^X\"6.zP]efTR{Cp8[I>9@v^Q]d_7,q&\\\'DeXh*.Hb>I7rf-ADq9]Q\\_MBA^@`G&zfp*p)kl^qGIvC);3,{Z1{J9z,\\rPu+fK&n..:wvoKfGlrx0u/zMKot{5.$dZtafb>F+=3+t=ep)ifHo%Ywtey\\Aiu:W.v:RsskEPEI$l(o,ySlMxAo<oJ_)@I5f0R3C<Cw^OQ+yTrh7mLnn_sKVT&T^_G%vU%NBA^=P]hwC#ym9j7h5bwX1%bK0GWez[9D/WQn^n4Nppg7qbuOf;,fK\"^@_H((/Q5Pw1\"R]_L=*V\\OWHDZz%;:Od1]i#_Ad\\%:47V5>xnB:;V+gTLb/XU\'VctD2hCNA=NS8X<_ONx@k)wPb\'/TC1f:,fK$ggTOnd-ImokO(n&bGwQg:\'M8lCDlyF-F](Go(fYh*,<,d?I5g4e*9!5)jgIp(bGr9[F,EWj:umHXf#gkfD[%;?izSjDN@7/\'p18bn,&sB,N,+4`p=pNl]k-3XJInw43C8.v>gs6HJzUrg0Q19k:uk>0md2azj*\'\"qD<=]G(/O)s=j*(*:&K1JfL&o1<wqS+s3:i.?4)jgJv?m6ZKHfQB7-u7HGklb(7z2zE#rJTL^wes9Z@l,-9wy#2plR2>$2pkJiZh#ea<Cx_Ui8rcvRobzhxLO)vH?@da;=_PR.\'vN]m3Mmd4iAEvM[b_:>fq/(uG=:KO0:sbq:acQKa2hCQS.&m\'ijZfr6HL+*2[]Cp;h)\'&(5pbx]F*7skCFwPd.M$`DkxBvY;Tw\'N:pS12GRIX_[0ppe0Q3C:9M^qIQ>\"+O6ZKIhYfuD.R=qPt(Wi0Kk`&/Z]J:$>PZV%I,7oYLR;i/DJ*.HdEf[uae\\{#*JyP\\b].a+Io\"J9uq\\Y+_,THL+*1VF;42<woI\\u`aH#k&kt-u7GBTcxY6<j,4]_I/Lpz>Y-iVRx3*s5FBXxxyvj5]`J3\\[8?rMe;42;r[OYW+dEg^\'=@gmt&ODDks)a97D5w*ZoGO;saiq&UcuLVNd4mU?wh(#n4LhN,+2XMXW.w>caAZ,b5w,eC[&CaH\"glmb):+b90&e[tagdBZ(L.:y$6\'\\(DdTU4>xqOqtuulCEp02Kd>E#tPlXRpg6nU>qMf@J5e,ACk!R_k$`Dm&cN<#3t{60/;ws^]=Pb\"rMa,Jt5A*Ho$S]^Bl(n(h`0a%(:/t/\"X\"4$PP%]2u+fK&p3EEf]\"(@LAA`H%w\\E$w_VoT7Pnc\'1\\ca?Si<*V\\Q^jzQ^j\"Y\'M7ctIJt7KXZ>aXsdwRpb!l1DGuF8&L8kA<G5kMu6@\"$,N/8k?3y?_L>1u-ov,eEdQHTQz=W&N=\'C`BdWg+2ZW*b:59^X\"5)eQDAXy\'Fm\"NLpx4-$hjb1b)9\'PEJ&vRpg5h;)TU37YD&+F_6,p&Yws^[2!J:%@Y\'L/CEo/2I^$-THJzVy.d=?aUd!fid;419i2U<er4A-ZdmzD{k+*0R5Md8(Vbl!PU?tZE)7x)QEHuC(7\"=Rg9!4&\\+US&WnJb7%OEL1JeD]3y<Uz4)h^#+It:W2..:vsctF<7?wdn\'g]zxpNl]n:l>*P>$3rpbx]G.G])Gn\"ONw=^I1T<g{]@`NA>P\\_L?88PkT@%/^uW35MiR>vg&uOe9%H\"fi_%/\\k,->2\"L@=P_m2FN8e#o7X@n;mA6,r/\'n*r4B3sw$<D\'0[_OO#SbuPiIke@G)2\\ddL/?5,t7HK#bPKeD^4$QS2:k8j=*V[J>9C&1c);.px3(ha1e9&M:r_bQPzF(.M#\\5+q-yOZW*`3pkKpz<Pb%&-P4K_(<9JKyMO*wMUHEaCdTZH<2&bGwPc(4iCL9q[TsnQ*s8Rw/t.t23FIzZ2\'eU[JBI,9y(M1I_)CZ$7.yJ?>Y+_,Q<qS)ic:0\"Tf/KnpmVF<8A#%/\\hyRh=2\"LCH&yccI\"cZz#-WW34J]u^Up[Ux+\\wh*,?9@sOkUIJwG6snQ,\"^AcZue\"hs38\\Q_n3GN9mDH\"edHt>oA0e=9G<69Y<[<W+b92/3S0.7h3[W*^+M,/H\\\"\'<<V%L6cwW+hUQv*`1gCT_cYpR\'bFr9Y=^LBBcWg\'$w\\I9w\"3w3*r5D91(q2;oJ`.VPnb#wbdTW=ceUV8LY_VoS16XC$$)?EzdgYi.?4&\\+TOog:\'PDDheIt<djiWU(])Hr3=vi.>0omWM[dkmd4kKq#H,=2\"LA@];IBL:x\"/b.TFAS`l(o*s8Qsw#838^Z,b6!>UsnP&bJ*+9#:>hyO[\\CuOe9%FwQiEUaip\"DtJM(wO_rHM/=(HvH@G&$\"wabJ+1U@{u``EtB*FcHxP`w\\H3bx`Wsbq:bf_-UPog:\'M8kA:AtS#I.FXk8j=,`*D]1ppb!m5S*nw6=oC<@l-1Lnm[^J:{0kYY9LVNb,Jq(a>KCL9se&zhwH;0x>c_6*jfBS_hov,hUQt\"<LM#[-b6z9@uY>deSOpn[[<Uw(N9oMpsslFV`dYoLfEa?Sg3]c[\'B\\/k\\j)\"ixH:&L4ZO]k*#iwArKY`Z(K)\'&)9\'RQ#NH]%4v\'M6btGBTap7W8M_zm8f&ydg]yrS*ic6{9@rNhHh]xj0DI(\')6spYMTA(>CsHGkk\\l3Mmg>;MS?!\"&7\'Xk<\"1kXV)]*M/;y&<ArE=Bq?$-UMc2e3c(1^m3HW^X\"4&Xsajv<Z9HDXtg)/Ls.!TjCH&x_QV@wchdD^6.$`FwRmXQkN&dUZG8x*W`_AbSV9U\'XnJ_*Hms%M>.e@I1UA$)APP&');
+--enable_query_log
+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;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+--error 0,1114
+INSERT INTO t1 SELECT * FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test
index b5ace75dbc4..23c591856a7 100644
--- a/mysql-test/t/archive.test
+++ b/mysql-test/t/archive.test
@@ -1550,3 +1550,12 @@ insert into t1 values (1);
repair table t1 use_frm;
select * from t1;
drop table t1;
+
+#
+# BUG#29207 - archive table reported as corrupt by check table
+#
+create table t1(a longblob) engine=archive;
+insert into t1 set a='';
+insert into t1 set a='a';
+check table t1 extended;
+drop table t1;
diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test
index f9a4a49d447..99e9b783d55 100644
--- a/mysql-test/t/auto_increment.test
+++ b/mysql-test/t/auto_increment.test
@@ -101,10 +101,10 @@ insert into t1 set i = 254;
insert into t1 set i = null;
select last_insert_id();
explain extended select last_insert_id();
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 set i = 254;
select last_insert_id();
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 set i = null;
select last_insert_id();
drop table t1;
@@ -122,7 +122,7 @@ insert into t1 values (NULL, 10);
select last_insert_id();
insert into t1 values (NULL, 15);
select last_insert_id();
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values (NULL, 10);
select last_insert_id();
@@ -277,7 +277,7 @@ create table t1 (rowid int not null auto_increment, val int not null,primary
key (rowid), unique(val));
replace into t1 (val) values ('1'),('2');
replace into t1 (val) values ('1'),('2');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 (val) values ('1'),('2');
select * from t1;
drop table t1;
@@ -300,7 +300,7 @@ drop table t1;
CREATE TABLE t1 (t1 INT(10) PRIMARY KEY, t2 INT(10));
INSERT INTO t1 VALUES(0, 0);
INSERT INTO t1 VALUES(1, 1);
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
ALTER TABLE t1 CHANGE t1 t1 INT(10) auto_increment;
DROP TABLE t1;
diff --git a/mysql-test/t/backup.test b/mysql-test/t/backup.test
index d737e292bb1..cdbf7b69615 100644
--- a/mysql-test/t/backup.test
+++ b/mysql-test/t/backup.test
@@ -1,3 +1,8 @@
+
+# The server need to be started in $MYSQLTEST_VARDIR since it
+# uses ../std_data_ln/
+-- source include/uses_vardir.inc
+
#
# This test is a bit tricky as we can't use backup table to overwrite an old
# table
@@ -52,7 +57,16 @@ unlock tables;
connection con1;
reap;
drop table t5;
---system rm $MYSQLTEST_VARDIR/tmp/t?.*
+remove_file $MYSQLTEST_VARDIR/tmp/t1.MYD;
+remove_file $MYSQLTEST_VARDIR/tmp/t2.MYD;
+remove_file $MYSQLTEST_VARDIR/tmp/t3.MYD;
+remove_file $MYSQLTEST_VARDIR/tmp/t4.MYD;
+remove_file $MYSQLTEST_VARDIR/tmp/t5.MYD;
+remove_file $MYSQLTEST_VARDIR/tmp/t1.frm;
+remove_file $MYSQLTEST_VARDIR/tmp/t2.frm;
+remove_file $MYSQLTEST_VARDIR/tmp/t3.frm;
+remove_file $MYSQLTEST_VARDIR/tmp/t4.frm;
+remove_file $MYSQLTEST_VARDIR/tmp/t5.frm;
# End of 4.1 tests
# End of 5.0 tests
diff --git a/mysql-test/t/bigint.test b/mysql-test/t/bigint.test
index 6c1229db83f..da10f4efa61 100644
--- a/mysql-test/t/bigint.test
+++ b/mysql-test/t/bigint.test
@@ -288,3 +288,33 @@ insert into t1 values (10000002383263201056);
select c1 mod 50 as result from t1;
drop table t1;
+#
+# Bug #8663 cant use bgint unsigned as input to cast
+#
+
+select cast(19999999999999999999 as signed);
+select cast(-19999999999999999999 as signed);
+
+#
+# Bug #28625: -9223372036854775808 doesn't fit in BIGINT.
+#
+
+# PS protocol gives different metadata for `Max length' column
+--disable_ps_protocol
+--enable_metadata
+select -9223372036854775808;
+select -(9223372036854775808);
+select -((9223372036854775808));
+select -(-(9223372036854775808));
+--disable_metadata
+--enable_ps_protocol
+select --9223372036854775808, ---9223372036854775808, ----9223372036854775808;
+select -(-9223372036854775808), -(-(-9223372036854775808));
+
+# Bug #28005 Partitions: can't use -9223372036854775808
+create table t1 select -9223372036854775808 bi;
+describe t1;
+drop table t1;
+create table t1 select -9223372036854775809 bi;
+describe t1;
+drop table t1;
diff --git a/mysql-test/t/binary.test b/mysql-test/t/binary.test
index 4ab6ee9eaf1..1cc6ae07675 100644
--- a/mysql-test/t/binary.test
+++ b/mysql-test/t/binary.test
@@ -101,3 +101,41 @@ select hex(col1) from t1;
insert into t1 values ('b'),('b ');
select hex(col1) from t1;
drop table t1;
+
+#
+# Bug #29087: assertion abort for a search in a BINARY non-nullable index
+# by a key with trailing spaces
+#
+
+CREATE TABLE t1 (
+ a binary(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
+ index idx(a)
+);
+INSERT INTO t1 SET a=unhex('1F9480179366F2BF567E1C4B964C1EF029087575');
+INSERT INTO t1 SET a=unhex('1F9480179366F2BF567E1C4B964C1EF029082020');
+INSERT INTO t1 SET a=unhex('1F9480179366F2BF567E1C4B964C1EF029080707');
+
+SELECT hex(a) FROM t1 order by a;
+EXPLAIN SELECT hex(a) FROM t1 order by a;
+
+SELECT hex(a) from t1 WHERE a=unhex('1F9480179366F2BF567E1C4B964C1EF029082020');
+EXPLAIN
+SELECT hex(a) from t1 WHERE a=unhex('1F9480179366F2BF567E1C4B964C1EF029082020');
+
+SELECT hex(a) from t1 WHERE a=unhex('1F9480179366F2BF567E1C4B964C1EF02908');
+
+DROP TABLE t1;
+
+CREATE TABLE t1 (
+ id numeric(20) NOT NULL,
+ lang varchar(8) NOT NULL,
+ msg varchar(32) NOT NULL,
+ PRIMARY KEY (id,lang)
+);
+INSERT INTO t1 VALUES (33, 'en', 'zzzzzzz');
+INSERT INTO t1 VALUES (31, 'en', 'xxxxxxx');
+INSERT INTO t1 VALUES (32, 'en', 'yyyyyyy');
+SELECT * FROM t1 WHERE id=32;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/t/binlog_row_blackhole.test b/mysql-test/t/binlog_row_blackhole.test
deleted file mode 100644
index d5355ad1ff0..00000000000
--- a/mysql-test/t/binlog_row_blackhole.test
+++ /dev/null
@@ -1,11 +0,0 @@
-# This is a wrapper for binlog.test so that the same test case can be used
-# For both statement and row based bin logs 9/19/2005 [jbm]
-
--- source include/have_binlog_format_row.inc
-
-# 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
-# we disable the ps-protocol for this statement.
---disable_ps_protocol
--- source extra/binlog_tests/blackhole.test
---enable_ps_protocol
diff --git a/mysql-test/t/binlog_row_mix_innodb_myisam-master.opt b/mysql-test/t/binlog_row_mix_innodb_myisam-master.opt
deleted file mode 100644
index cb48f1aaf60..00000000000
--- a/mysql-test/t/binlog_row_mix_innodb_myisam-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb_lock_wait_timeout=2
diff --git a/mysql-test/t/binlog_row_mix_innodb_myisam.test b/mysql-test/t/binlog_row_mix_innodb_myisam.test
deleted file mode 100644
index 335a05be146..00000000000
--- a/mysql-test/t/binlog_row_mix_innodb_myisam.test
+++ /dev/null
@@ -1,32 +0,0 @@
-# This is a wrapper for binlog.test so that the same test case can be used
-# For both statement and row based bin logs 9/19/2005 [jbm]
-
--- source include/have_binlog_format_row.inc
-
-# 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
-# we disable the ps-protocol for this statement.
---disable_ps_protocol
-
--- source extra/binlog_tests/mix_innodb_myisam_binlog.test
-
---enable_ps_protocol
-
-# This piece below cannot be put into
-# extra/binlog_tests/mix_innodb_myisam_binlog.test
-# because the argument of --start-position differs between statement-
-# and row-based (and "eval --exec" doesn't work).
-# we check that the error code of the "ROLLBACK" event is 0 and not
-# ER_SERVER_SHUTDOWN (i.e. disconnection just rolls back transaction
-# and does not make slave to stop)
-flush logs;
---exec $MYSQL_BINLOG --start-position=520 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval select
-(@a:=load_file("$MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output"))
-is not null;
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
-eval select
-@a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%",
-@a not like "%#%error_code=%error_code=%";
-drop table t1, t2;
diff --git a/mysql-test/t/binlog_stm_mix_innodb_myisam-master.opt b/mysql-test/t/binlog_stm_mix_innodb_myisam-master.opt
deleted file mode 100644
index cb48f1aaf60..00000000000
--- a/mysql-test/t/binlog_stm_mix_innodb_myisam-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb_lock_wait_timeout=2
diff --git a/mysql-test/t/binlog_stm_mix_innodb_myisam.test b/mysql-test/t/binlog_stm_mix_innodb_myisam.test
deleted file mode 100644
index 72651c13be7..00000000000
--- a/mysql-test/t/binlog_stm_mix_innodb_myisam.test
+++ /dev/null
@@ -1,24 +0,0 @@
-# This is a wrapper for binlog.test so that the same test case can be used
-# For both statement and row based bin logs 9/19/2005 [jbm]
-
--- source include/have_binlog_format_mixed_or_statement.inc
--- source extra/binlog_tests/mix_innodb_myisam_binlog.test
-
-# This piece below cannot be put into
-# extra/binlog_tests/mix_innodb_myisam_binlog.test
-# because the argument of --start-position differs between statement-
-# and row-based (and "eval --exec" doesn't work).
-# we check that the error code of the "ROLLBACK" event is 0 and not
-# ER_SERVER_SHUTDOWN (i.e. disconnection just rolls back transaction
-# and does not make slave to stop)
-flush logs;
---exec $MYSQL_BINLOG --start-position=555 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval select
-(@a:=load_file("$MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output"))
-is not null;
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
-eval select
-@a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%",
-@a not like "%#%error_code=%error_code=%";
-drop table t1, t2;
diff --git a/mysql-test/t/binlog_unsafe.test b/mysql-test/t/binlog_unsafe.test
new file mode 100644
index 00000000000..f34c22dc5f7
--- /dev/null
+++ b/mysql-test/t/binlog_unsafe.test
@@ -0,0 +1,18 @@
+# Test to check that a warning is generated for unsafe statements
+# executed under statement mode logging.
+
+source include/have_log_bin.inc;
+
+SET BINLOG_FORMAT=STATEMENT;
+
+CREATE TABLE t1 (a CHAR(40));
+CREATE TABLE t2 (a INT AUTO_INCREMENT PRIMARY KEY);
+CREATE TABLE t3 (b INT AUTO_INCREMENT PRIMARY KEY);
+CREATE VIEW v1(a,b) AS SELECT a,b FROM t2,t3;
+
+INSERT INTO t1 SELECT UUID();
+query_vertical SHOW WARNINGS;
+
+DROP TABLE t1,t2,t3;
+
+
diff --git a/mysql-test/t/bootstrap.test b/mysql-test/t/bootstrap.test
index 1c2952e93d0..203ba9b2914 100644
--- a/mysql-test/t/bootstrap.test
+++ b/mysql-test/t/bootstrap.test
@@ -9,12 +9,13 @@ drop table if exists t1;
#
# Check that --bootstrap reads from stdin
#
---write_file $MYSQLTEST_VARDIR/tmp/bootstrap.sql
+--write_file $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql
use test;
CREATE TABLE t1(a int);
EOF
---exec $MYSQLD_BOOTSTRAP_CMD < $MYSQLTEST_VARDIR/tmp/bootstrap.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
+--exec $MYSQLD_BOOTSTRAP_CMD < $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
drop table t1;
+remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql;
#
# Check that --bootstrap of file with SQL error returns error
@@ -28,6 +29,7 @@ EOF
# Table t1 should not exists
--error 1051
drop table t1;
+remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_error.sql;
#
# Bootstrap with a query larger than 2*thd->net.max_packet
@@ -40,6 +42,7 @@ eval select * into outfile '$MYSQLTEST_VARDIR/tmp/long_query.sql' from t1;
--enable_query_log
--error 1
--exec $MYSQLD_BOOTSTRAP_CMD < $MYSQLTEST_VARDIR/tmp/long_query.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/long_query.sql;
set global max_allowed_packet=@my_max_allowed_packet;
drop table t1;
diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test
index 7217d00a1bb..5563e260a06 100644
--- a/mysql-test/t/cast.test
+++ b/mysql-test/t/cast.test
@@ -10,7 +10,13 @@ select cast(-5 as unsigned) -1, cast(-5 as unsigned) + 1;
select ~5, cast(~5 as signed);
explain extended select ~5, cast(~5 as signed);
select cast(5 as unsigned) -6.0;
-select cast(NULL as signed), cast(1/0 as signed);
+select cast(NULL as signed), cast(1/0 as signed);
+#
+# Bug #28250: Run-Time Check Failure #3 - The variable 'value' is being used
+# without being def
+#
+# The following line causes Run-Time Check Failure on
+# binaries built with Visual C++ 2005
select cast(NULL as unsigned), cast(1/0 as unsigned);
select cast("A" as binary) = "a", cast(BINARY "a" as CHAR) = "A";
select cast("2001-1-1" as DATE), cast("2001-1-1" as DATETIME);
@@ -231,4 +237,13 @@ select hex(cast('a' as char(2) binary));
select hex(cast('a' as binary(2)));
select hex(cast('a' as char(2) binary));
+#
+# Bug#29898: Item_date_typecast::val_int doesn't reset the null_value flag.
+#
+CREATE TABLE t1 (d1 datetime);
+INSERT INTO t1(d1) VALUES ('2007-07-19 08:30:00'), (NULL),
+ ('2007-07-19 08:34:00'), (NULL), ('2007-07-19 08:36:00');
+SELECT cast(date(d1) as signed) FROM t1;
+drop table t1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/check.test b/mysql-test/t/check.test
index 8d9d70bd29a..363f9d419d6 100644
--- a/mysql-test/t/check.test
+++ b/mysql-test/t/check.test
@@ -2,7 +2,8 @@ connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
connection con1;
--disable_warnings
-drop table if exists t1;
+drop table if exists t1,t2;
+drop view if exists v1;
--enable_warnings
# Add a lot of keys to slow down check
@@ -36,3 +37,12 @@ Create view v1 as Select * from t1;
Check Table v1,t2;
drop view v1;
drop table t1, t2;
+
+#
+# BUG#26325 - TEMPORARY TABLE "corrupt" after first read, according to CHECK
+# TABLE
+#
+CREATE TEMPORARY TABLE t1(a INT);
+CHECK TABLE t1;
+REPAIR TABLE t1;
+DROP TABLE t1;
diff --git a/mysql-test/t/comments.test b/mysql-test/t/comments.test
index 52273ec9523..3a18a8bd483 100644
--- a/mysql-test/t/comments.test
+++ b/mysql-test/t/comments.test
@@ -19,3 +19,49 @@ select 1 # The rest of the row will be ignored
/* line with only comment */;
# End of 4.1 tests
+
+#
+# Bug#25411 (trigger code truncated)
+#
+
+--error ER_PARSE_ERROR
+select 1/*!2*/;
+
+--error ER_PARSE_ERROR
+select 1/*!000002*/;
+
+select 1/*!999992*/;
+
+select 1 + /*!00000 2 */ + 3 /*!99999 noise*/ + 4;
+
+#
+# Bug#28779 (mysql_query() allows execution of statements with unbalanced
+# comments)
+#
+
+--disable_warnings
+drop table if exists table_28779;
+--enable_warnings
+
+create table table_28779 (a int);
+
+--error 1064
+prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*' AND b = 'bar';";
+
+--error 1064
+prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*' AND b = 'bar';*";
+
+--error 1064
+prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*! AND 2=2;";
+
+--error 1064
+prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*! AND 2=2;*";
+
+--error 1064
+prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*!98765' AND b = 'bar';";
+
+--error 1064
+prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*!98765' AND b = 'bar';*";
+
+drop table table_28779;
+
diff --git a/mysql-test/t/create-big.test b/mysql-test/t/create-big.test
new file mode 100644
index 00000000000..6cd6326cdb8
--- /dev/null
+++ b/mysql-test/t/create-big.test
@@ -0,0 +1,392 @@
+# Tests for various concurrency-related aspects of CREATE TABLE ... SELECT
+# and CREATE TABLE like implementation.
+#
+# Note that we don't test general CREATE TABLE ... SELECT/LIKE functionality
+# here as it is already covered by create.test. We are more interested in
+# extreme cases.
+#
+# This test takes rather long time so let us run it only in --big-test mode
+--source include/big_test.inc
+# We are using some debug-only features in this test
+--source include/have_debug.inc
+# Some of tests below also use binlog to check that statements are
+# executed and logged in correct order
+--source include/have_binlog_format_mixed_or_statement.inc
+
+# Create auxilliary connections
+connect (addconroot1, localhost, root,,);
+connect (addconroot2, localhost, root,,);
+connect (addconroot3, localhost, root,,);
+connection default;
+
+--disable_warnings
+drop table if exists t1,t2,t3,t4,t5;
+--enable_warnings
+
+
+#
+# Tests for concurrency problems in CREATE TABLE ... SELECT
+#
+# We introduce delays between various stages of table creation
+# and check that other statements dealing with this table cannot
+# interfere during those delays.
+#
+# What happens in situation when other statement messes with
+# table to be created before it is created ?
+# Concurrent CREATE TABLE
+set session debug="+d,sleep_create_select_before_create";
+--send create table t1 select 1 as i;
+connection addconroot1;
+--sleep 2
+--error ER_TABLE_EXISTS_ERROR
+create table t1 (j char(5));
+connection default;
+--reap
+show create table t1;
+drop table t1;
+# Concurrent CREATE TABLE ... SELECT
+--send create table t1 select 1 as i;
+connection addconroot1;
+--sleep 2
+--error ER_TABLE_EXISTS_ERROR
+create table t1 select "Test" as j;
+connection default;
+--reap
+show create table t1;
+drop table t1;
+# Concurrent CREATE TABLE LIKE
+create table t3 (j char(5));
+--send create table t1 select 1 as i;
+connection addconroot1;
+--sleep 2
+--error ER_TABLE_EXISTS_ERROR
+create table t1 like t3;
+connection default;
+--reap
+show create table t1;
+drop table t1;
+# Concurrent RENAME TABLE
+--send create table t1 select 1 as i;
+connection addconroot1;
+--sleep 2
+--error ER_TABLE_EXISTS_ERROR
+rename table t3 to t1;
+connection default;
+--reap
+show create table t1;
+drop table t1;
+# Concurrent ALTER TABLE RENAME
+--send create table t1 select 1 as i;
+connection addconroot1;
+--sleep 2
+--error ER_TABLE_EXISTS_ERROR
+alter table t3 rename to t1;
+connection default;
+--reap
+show create table t1;
+drop table t1;
+# Concurrent ALTER TABLE RENAME which also adds column
+--send create table t1 select 1 as i;
+connection addconroot1;
+--sleep 2
+--error ER_TABLE_EXISTS_ERROR
+alter table t3 rename to t1, add k int;
+connection default;
+--reap
+show create table t1;
+drop table t1, t3;
+# What happens if other statement sneaks in after the table
+# creation but before its opening ?
+set session debug="-d,sleep_create_select_before_create:+d,sleep_create_select_before_open";
+# Concurrent DROP TABLE
+--send create table t1 select 1 as i;
+connection addconroot1;
+--sleep 2
+drop table t1;
+connection default;
+--reap
+# Concurrent RENAME TABLE
+--send create table t1 select 1 as i;
+connection addconroot1;
+--sleep 2
+rename table t1 to t2;
+connection default;
+--reap
+drop table t2;
+# Concurrent SELECT
+--send create table t1 select 1 as i;
+connection addconroot1;
+--sleep 2
+select * from t1;
+connection default;
+--reap
+drop table t1;
+# Concurrent INSERT
+--send create table t1 select 1 as i;
+connection addconroot1;
+--sleep 2
+insert into t1 values (2);
+connection default;
+--reap
+select * from t1;
+drop table t1;
+# Concurrent CREATE TRIGGER
+set @a:=0;
+--send create table t1 select 1 as i;
+connection addconroot1;
+--sleep 2
+create trigger t1_bi before insert on t1 for each row set @a:=1;
+connection default;
+--reap
+select @a;
+drop table t1;
+# Okay, now the same tests for the potential gap between open and lock
+set session debug="-d,sleep_create_select_before_open:+d,sleep_create_select_before_lock";
+# Concurrent DROP TABLE
+--send create table t1 select 1 as i;
+connection addconroot1;
+--sleep 2
+drop table t1;
+connection default;
+--reap
+# Concurrent RENAME TABLE
+--send create table t1 select 1 as i;
+connection addconroot1;
+--sleep 2
+rename table t1 to t2;
+connection default;
+--reap
+drop table t2;
+# Concurrent SELECT
+--send create table t1 select 1 as i;
+connection addconroot1;
+--sleep 2
+select * from t1;
+connection default;
+--reap
+drop table t1;
+# Concurrent INSERT
+--send create table t1 select 1 as i;
+connection addconroot1;
+--sleep 2
+insert into t1 values (2);
+connection default;
+--reap
+select * from t1;
+drop table t1;
+# Concurrent CREATE TRIGGER
+set @a:=0;
+--send create table t1 select 1 as i;
+connection addconroot1;
+--sleep 2
+create trigger t1_bi before insert on t1 for each row set @a:=1;
+connection default;
+--reap
+select @a;
+drop table t1;
+# Some tests for case with existing table
+set session debug="-d,sleep_create_select_before_lock:+d,sleep_create_select_before_check_if_exists";
+create table t1 (i int);
+# Concurrent DROP TABLE
+--send create table if not exists t1 select 1 as i;
+connection addconroot1;
+--sleep 2
+drop table t1;
+connection default;
+--reap
+# Concurrent CREATE TRIGGER
+create table t1 (i int);
+set @a:=0;
+--send create table if not exists t1 select 1 as i;
+connection addconroot1;
+--sleep 2
+create trigger t1_bi before insert on t1 for each row set @a:=1;
+connection default;
+--reap
+select @a;
+select * from t1;
+drop table t1;
+set session debug="-d,sleep_create_select_before_check_if_exists";
+
+
+# Test for some details of CREATE TABLE ... SELECT implementation.
+#
+# We check that create placeholder is handled properly if we have
+# to reopen tables in open_tables().
+# This test heavily relies on current implementation of name-locking/
+# table cache so it may stop working if it changes. OTOH it such problem
+# will serve as warning that such changes should not be done lightly.
+create table t2 (a int);
+create table t4 (b int);
+connection addconroot2;
+lock table t4 write;
+select 1;
+connection addconroot1;
+# Create placeholder/name-lock for t3
+--send create table t3 as select * from t4;
+--sleep 2
+connection default;
+# This statement creates placeholder for t1, then opens t2,
+# then meets name-lock for t3 and then reopens all tables
+--send create table t1 select * from t2, t3;
+--sleep 2
+connection addconroot2;
+unlock tables;
+connection addconroot1;
+--reap
+connection default;
+--reap
+select * from t1;
+show create table t1;
+drop table t1, t3;
+# Now similar test which proves that we really temporarily
+# remove placeholder when we reopen tables.
+connection addconroot2;
+lock table t4 read;
+select 1;
+connection addconroot1;
+# Create name-lock for t3
+--send rename table t4 to t3;
+--sleep 2
+connection default;
+# This statement creates placeholder for t1, then opens t2,
+# then meets name-lock for t3 and then reopens all tables
+--send create table if not exists t1 select 1 as i from t2, t3;
+--sleep 2
+connection addconroot3;
+# We should be able to take name-lock on table t1 as we should not have
+# open placeholder for it at this point (otherwise it is possible to
+# come-up with situation which will lead to deadlock, e.g. think of
+# concurrent CREATE TABLE t1 SELECT * FROM t2 and RENAME TABLE t2 TO t1)
+create table t5 (j int);
+# This statement takes name-lock on t1 and therefore proves
+# that there is no active open placeholder for it.
+rename table t5 to t1;
+connection addconroot2;
+unlock tables;
+connection addconroot1;
+--reap
+connection default;
+--reap
+select * from t1;
+show create table t1;
+drop table t1, t2, t3;
+
+
+# Tests for possible concurrency issues with CREATE TABLE ... LIKE
+#
+# Bug #18950 "create table like does not obtain LOCK_open"
+# Bug #23667 "CREATE TABLE LIKE is not isolated from alteration by other
+# connections"
+#
+# Again the idea of this test is that we introduce artificial delays on
+# various stages of table creation and check that concurrent statements
+# for tables from CREATE TABLE ... LIKE are not interfering.
+
+--disable_warnings
+drop table if exists t1,t2;
+--enable_warnings
+
+# What happens if some statements sneak in right after we have
+# opened source table ?
+create table t1 (i int);
+set session debug="+d,sleep_create_like_before_check_if_exists";
+# Reset binlog to have clear start
+reset master;
+--send create table t2 like t1;
+connection addconroot1;
+--sleep 2
+# DML on source table should be allowed to run concurrently
+insert into t1 values (1);
+# And DDL should wait
+drop table t1;
+connection default;
+--reap
+show create table t2;
+drop table t2;
+# Let us check that statements were executed/binlogged in correct order
+--replace_column 2 # 5 #
+show binlog events in 'master-bin.000001' from 106;
+
+# Now let us check the gap between check for target table
+# existance and copying of .frm file.
+create table t1 (i int);
+set session debug="-d,sleep_create_like_before_check_if_exists:+d,sleep_create_like_before_copy";
+# It should be impossible to create target table concurrently
+--send create table t2 like t1;
+connection addconroot1;
+--sleep 2
+create table if not exists t2 (j int);
+connection default;
+--reap
+show create table t2;
+drop table t2;
+# And concurrent DDL on the source table should be still disallowed
+reset master;
+--send create table t2 like t1;
+connection addconroot1;
+--sleep 2
+drop table t1;
+connection default;
+--reap
+drop table t2;
+--replace_column 2 # 5 #
+show binlog events in 'master-bin.000001' from 106;
+
+# And now he gap between copying of .frm file and ha_create_table() call.
+create table t1 (i int);
+set session debug="-d,sleep_create_like_before_copy:+d,sleep_create_like_before_ha_create";
+# Both DML and DDL on target table should wait till operation completes
+reset master;
+--send create table t2 like t1;
+connection addconroot1;
+--sleep 2
+insert into t2 values (1);
+connection default;
+--reap
+drop table t2;
+--send create table t2 like t1;
+connection addconroot1;
+--sleep 2
+drop table t2;
+connection default;
+--reap
+# Concurrent DDL on the source table still waits
+--send create table t2 like t1;
+connection addconroot1;
+--sleep 2
+drop table t1;
+connection default;
+--reap
+drop table t2;
+--replace_column 2 # 5 #
+show binlog events in 'master-bin.000001' from 106;
+
+# Finally we check the gap between ha_create_table() and binlogging
+create table t1 (i int);
+set session debug="-d,sleep_create_like_before_ha_create:+d,sleep_create_like_before_binlogging";
+reset master;
+--send create table t2 like t1;
+connection addconroot1;
+--sleep 2
+insert into t2 values (1);
+connection default;
+--reap
+drop table t2;
+--send create table t2 like t1;
+connection addconroot1;
+--sleep 2
+drop table t2;
+connection default;
+--reap
+--send create table t2 like t1;
+connection addconroot1;
+--sleep 2
+drop table t1;
+connection default;
+--reap
+drop table t2;
+--replace_column 2 # 5 #
+show binlog events in 'master-bin.000001' from 106;
+
+set session debug="-d,sleep_create_like_before_binlogging";
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index 5fca63a295c..341c019af6e 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -153,7 +153,7 @@ drop table if exists t1,t2;
CREATE TABLE t1 (a int not null);
INSERT INTO t1 values (1),(2),(1);
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
CREATE TABLE t2 (primary key(a)) SELECT * FROM t1;
--error 1146
SELECT * from t2;
@@ -232,7 +232,7 @@ insert into t1 values (1,1);
create table if not exists t1 select 2;
select * from t1;
create table if not exists t1 select 3 as 'a',4 as 'b';
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
create table if not exists t1 select 3 as 'a',3 as 'b';
show warnings;
show status like "Opened_tables";
@@ -306,7 +306,7 @@ create table t3 like t1;
create table t3 like mysqltest.t3;
--error 1049
create table non_existing_database.t1 like t1;
---error 1051
+--error ER_NO_SUCH_TABLE
create table t3 like non_existing_table;
--error 1050
create temporary table t3 like t1;
@@ -673,12 +673,485 @@ alter table t1 max_rows=100000000000;
show create table t1;
drop table t1;
+
+#
+# Tests for errors happening at various stages of CREATE TABLES ... SELECT
+#
+# (Also checks that it behaves atomically in the sense that in case
+# of error it is automatically dropped if it has not existed before.)
+#
+# Error during open_and_lock_tables() of tables
+--error ER_NO_SUCH_TABLE
+create table t1 select * from t2;
+# Rather special error which also caught during open tables pahse
+--error ER_UPDATE_TABLE_USED
+create table t1 select * from t1;
+# Error which happens before select_create::prepare()
+--error ER_CANT_AGGREGATE_2COLLATIONS
+create table t1 select coalesce('a' collate latin1_swedish_ci,'b' collate latin1_bin);
+# Error during table creation
+--error ER_KEY_COLUMN_DOES_NOT_EXITS
+create table t1 (primary key(a)) select "b" as b;
+# Error in select_create::prepare() which is not related to table creation
+create table t1 (a int);
+--error ER_WRONG_VALUE_COUNT_ON_ROW
+create table if not exists t1 select 1 as a, 2 as b;
+drop table t1;
+# Finally error which happens during insert
+--error ER_DUP_ENTRY
+create table t1 (primary key (a)) (select 1 as a) union all (select 1 as a);
+# What happens if table already exists ?
+create table t1 (i int);
+--error ER_TABLE_EXISTS_ERROR
+create table t1 select 1 as i;
+create table if not exists t1 select 1 as i;
+select * from t1;
+# Error before select_create::prepare()
+--error ER_CANT_AGGREGATE_2COLLATIONS
+create table t1 select coalesce('a' collate latin1_swedish_ci,'b' collate latin1_bin);
+select * from t1;
+# Error which happens during insertion of rows
+alter table t1 add primary key (i);
+--error ER_DUP_ENTRY
+create table if not exists t1 (select 2 as i) union all (select 2 as i);
+select * from t1;
+drop table t1;
+
+
+# Base vs temporary tables dillema (a.k.a. bug#24508 "Inconsistent
+# results of CREATE TABLE ... SELECT when temporary table exists").
+# In this situation we either have to create non-temporary table and
+# insert data in it or insert data in temporary table without creation
+# of permanent table. Since currently temporary tables always shadow
+# permanent tables we adopt second approach.
+create temporary table t1 (j int);
+create table if not exists t1 select 1;
+select * from t1;
+drop temporary table t1;
+--error ER_NO_SUCH_TABLE
+select * from t1;
+--error ER_BAD_TABLE_ERROR
+drop table t1;
+
+
+#
+# CREATE TABLE ... SELECT and LOCK TABLES
+#
+# There is little sense in using CREATE TABLE ... SELECT under
+# LOCK TABLES as it mostly does not work. At least we check that
+# the server doesn't crash, hang and produces sensible errors.
+# Includes test for bug #20662 "Infinite loop in CREATE TABLE
+# IF NOT EXISTS ... SELECT with locked tables".
+create table t1 (i int);
+insert into t1 values (1), (2);
+lock tables t1 read;
+--error ER_TABLE_NOT_LOCKED
+create table t2 select * from t1;
+--error ER_TABLE_NOT_LOCKED
+create table if not exists t2 select * from t1;
+unlock tables;
+create table t2 (j int);
+lock tables t1 read;
+--error ER_TABLE_NOT_LOCKED
+create table t2 select * from t1;
+# This should not be ever allowed as it will undermine
+# lock-all-at-once approach
+--error ER_TABLE_NOT_LOCKED
+create table if not exists t2 select * from t1;
+unlock tables;
+lock table t1 read, t2 read;
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+create table t2 select * from t1;
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+create table if not exists t2 select * from t1;
+unlock tables;
+lock table t1 read, t2 write;
+--error ER_TABLE_EXISTS_ERROR
+create table t2 select * from t1;
+# This is the only case which really works.
+create table if not exists t2 select * from t1;
+select * from t1;
+unlock tables;
+drop table t2;
+
+# OTOH CREATE TEMPORARY TABLE ... SELECT should work
+# well under LOCK TABLES.
+lock tables t1 read;
+create temporary table t2 select * from t1;
+create temporary table if not exists t2 select * from t1;
+select * from t2;
+unlock tables;
+drop table t1, t2;
+
+
#
# Bug#21772: can not name a column 'upgrade' when create a table
#
create table t1 (upgrade int);
drop table t1;
+
+#
+# Bug #26642: create index corrupts table definition in .frm
+#
+# Problem with creating keys with maximum key-parts and maximum name length
+# This test is made for a mysql server supporting names up to 64 bytes
+# and a maximum of 16 key segements per Key
+#
+
+create table t1 (
+ c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int, c8 int,
+ c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int, c16 int,
+
+ key a001_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a002_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a003_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a004_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a005_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a006_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a007_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a008_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a009_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ key a010_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a011_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a012_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a013_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a014_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a015_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a016_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a017_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a018_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a019_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ key a020_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a021_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a022_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a023_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a024_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a025_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a026_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a027_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a028_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a029_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ key a030_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a031_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a032_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a033_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a034_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a035_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a036_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a037_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a038_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a039_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ key a040_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a041_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a042_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a043_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a044_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a045_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a046_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a047_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a048_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a049_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ key a050_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a051_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a052_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a053_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a054_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a055_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a056_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a057_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a058_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a059_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ key a060_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a061_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a062_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a063_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16)
+);
+
+# Check that the table is not corrupted
+show create table t1;
+flush tables;
+show create table t1;
+
+# Repeat test using ALTER to add indexes
+
+drop table t1;
+create table t1 (c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int,
+c8 int, c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int, c16 int);
+
+alter table t1
+
+ add key a001_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a002_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a003_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a004_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a005_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a006_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a007_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a008_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a009_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ add key a010_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a011_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a012_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a013_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a014_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a015_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a016_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a017_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a018_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a019_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ add key a020_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a021_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a022_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a023_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a024_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a025_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a026_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a027_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a028_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a029_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ add key a030_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a031_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a032_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a033_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a034_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a035_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a036_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a037_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a038_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a039_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ add key a040_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a041_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a042_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a043_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a044_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a045_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a046_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a047_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a048_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a049_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ add key a050_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a051_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a052_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a053_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a054_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a055_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a056_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a057_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a058_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a059_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+
+ add key a060_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a061_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a062_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a063_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
+ add key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
+
+show create table t1;
+flush tables;
+show create table t1;
+
+# Test the server limits; if any of these pass, all above tests need
+# to be rewritten to hit the limit
+#
+# Ensure limit is really 64 keys
+--error 1069
+alter table t1 add key
+ a065_long_123456789_123456789_123456789_123456789_123456789_1234 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
+
+drop table t1;
+
+# Ensure limit is really 16 key parts per key
+
+create table t1 (c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int,
+c8 int, c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int,
+c16 int, c17 int);
+
+# Get error for max key parts
+--error 1070
+alter table t1 add key i1 (
+ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16, c17);
+
+# Get error for max key-name length
+--error 1059
+alter table t1 add key
+ a001_long_123456789_123456789_123456789_123456789_123456789_12345 (c1);
+
+show create table t1;
+
+drop table t1;
+
+--echo
+--echo Bug #26104 Bug on foreign key class constructor
+--echo
+--echo Check that ref_columns is initalized correctly in the constructor
+--echo and semantic checks in mysql_prepare_table work.
+--echo
+--echo We do not need a storage engine that supports foreign keys
+--echo for this test, as the checks are purely syntax-based, and the
+--echo syntax is supported for all engines.
+--echo
+--disable_warnings
+drop table if exists t1,t2;
+--enable_warnings
+
+create table t1(a int not null, b int not null, primary key (a, b));
+--error ER_WRONG_FK_DEF
+create table t2(a int not null, b int not null, c int not null, primary key (a),
+foreign key fk_bug26104 (b,c) references t1(a));
+drop table t1;
+
+#
+# Bug#15130:CREATE .. SELECT was denied to use advantages of the SQL_BIG_RESULT.
+#
+create table t1(f1 int,f2 int);
+insert into t1 value(1,1),(1,2),(1,3),(2,1),(2,2),(2,3);
+flush status;
+create table t2 select sql_big_result f1,count(f2) from t1 group by f1;
+show status like 'handler_read%';
+drop table t1,t2;
+
--echo End of 5.0 tests
#
@@ -687,34 +1160,35 @@ drop table t1;
CREATE TABLE t1 (a int, b int);
insert into t1 values (1,1),(1,2);
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
CREATE TABLE t2 (primary key (a)) select * from t1;
# This should give warning
drop table if exists t2;
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
CREATE TEMPORARY TABLE t2 (primary key (a)) select * from t1;
# This should give warning
drop table if exists t2;
CREATE TABLE t2 (a int, b int, primary key (a));
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
CREATE TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
SELECT * from t2;
TRUNCATE table t2;
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
INSERT INTO t2 select * from t1;
SELECT * from t2;
drop table t2;
CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a));
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
SELECT * from t2;
TRUNCATE table t2;
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
INSERT INTO t2 select * from t1;
SELECT * from t2;
drop table t1,t2;
+
#
# Test incorrect database names
#
diff --git a/mysql-test/t/create_not_windows.test b/mysql-test/t/create_not_windows.test
index 2c1700d9e49..56b4002106d 100644
--- a/mysql-test/t/create_not_windows.test
+++ b/mysql-test/t/create_not_windows.test
@@ -17,6 +17,7 @@ primary key (_id)
show create table `about:text`;
drop table `about:text`;
+
# End of 5.0 tests
#
diff --git a/mysql-test/t/create_select_tmp.test b/mysql-test/t/create_select_tmp.test
index eacea1ac376..a61f9f2466c 100644
--- a/mysql-test/t/create_select_tmp.test
+++ b/mysql-test/t/create_select_tmp.test
@@ -14,19 +14,19 @@ drop table if exists t1, t2;
--enable_warnings
CREATE TABLE t1 ( a int );
INSERT INTO t1 VALUES (1),(2),(1);
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1;
--error 1146
select * from t2;
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1;
--error 1146
select * from t2;
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1;
--error 1146
select * from t2;
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1;
--error 1146
select * from t2;
diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test
index 62482d576b2..5c877557dfc 100644
--- a/mysql-test/t/csv.test
+++ b/mysql-test/t/csv.test
@@ -1424,6 +1424,7 @@ DROP TABLE test_repair_table2;
# Corrupt csv file and see if we can repair it
CREATE TABLE test_repair_table3 ( val integer ) ENGINE = CSV;
+--remove_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table3.CSV
--write_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table3.CSV
"1"
"4"
@@ -1476,6 +1477,7 @@ CREATE TABLE test_repair_table5 (
) ENGINE = CSV;
# Corrupt a table -- put a file with wrong # of columns
+--remove_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table5.CSV
--write_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table5.CSV
"1","101","IBM"
EOF
@@ -1596,6 +1598,27 @@ select * from bug15205;
drop table bug15205;
drop table bug15205_2;
+
+#
+# Bug#28862 "Extended Latin1 characters get lost in CVS engine"
+#
+set names latin1;
+create table t1 (
+ c varchar(1),
+ name varchar(64)
+) character set latin1 engine=csv;
+insert into t1 values (0xC0,'LATIN CAPITAL LETTER A WITH GRAVE');
+insert into t1 values (0xE0,'LATIN SMALL LETTER A WITH GRAVE');
+insert into t1 values (0xEE,'LATIN SMALL LETTER I WITH CIRCUMFLEX');
+insert into t1 values (0xFE,'LATIN SMALL LETTER THORN');
+insert into t1 values (0xF7,'DIVISION SIGN');
+insert into t1 values (0xFF,'LATIN SMALL LETTER Y WITH DIAERESIS');
+select hex(c), c, name from t1 order by 1;
+drop table t1;
+
+--echo End of 5.0 tests
+
+
#
# Bug#22080 "CHECK fails to identify some corruption"
#
@@ -1608,6 +1631,7 @@ insert into bug22080_1 values(2,'string');
insert into bug22080_1 values(3,'string');
# Create first corrupt file as described in bug report
+--remove_file $MYSQLTEST_VARDIR/master-data/test/bug22080_2.CSV
--write_file $MYSQLTEST_VARDIR/master-data/test/bug22080_2.CSV
1,"string"
2","string"
@@ -1615,6 +1639,7 @@ insert into bug22080_1 values(3,'string');
EOF
# Create second corrupt file as described in bug report
+--remove_file $MYSQLTEST_VARDIR/master-data/test/bug22080_3.CSV
--write_file $MYSQLTEST_VARDIR/master-data/test/bug22080_3.CSV
1,"string"
"2",string"
@@ -1653,3 +1678,53 @@ CREATE TABLE `bug21328` (
insert into bug21328 values (1,NULL,NULL);
alter table bug21328 engine=myisam;
drop table bug21328;
+
+#
+# BUG#28971 - ALTER TABLE followed by UPDATE for a CSV table make server
+# crash
+#
+create table t1(a blob, b int) engine=csv;
+insert into t1 values('a', 1);
+flush tables;
+update t1 set b=2;
+select * from t1;
+drop table t1;
+
+#
+# Bug #29353: negative values
+#
+create table t1(a int) engine=csv;
+insert into t1 values(-1), (-123.34), (2), (-23);
+select * from t1;
+check table t1;
+drop table t1;
+
+create table t1(a int, b int) engine=csv;
+--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.CSV
+--write_file $MYSQLTEST_VARDIR/master-data/test/t1.CSV
+1, 1E-2
+-2E2, .9
+-10E-1, -.9
+-1, -100.1
+1a, -2b
+EOF
+repair table t1;
+check table t1;
+select * from t1;
+check table t1;
+drop table t1;
+
+#
+# Bug #29411: deleting from a csv table leads to the table corruption
+#
+create table t1(a int) engine=csv;
+insert into t1 values (0), (1), (2);
+delete from t1 limit 2;
+check table t1;
+select * from t1;
+delete from t1;
+check table t1;
+select * from t1;
+drop table t1;
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/ctype_ascii.test b/mysql-test/t/ctype_ascii.test
new file mode 100644
index 00000000000..2a5118c7d34
--- /dev/null
+++ b/mysql-test/t/ctype_ascii.test
@@ -0,0 +1,13 @@
+#
+# Bug #27562: ascii.xml invalid?
+#
+set names ascii;
+select 'e'='`';
+select 'y'='~';
+create table t1 (a char(1) character set ascii);
+insert into t1 (a) values (' '), ('a'), ('b'), ('c'), ('d'), ('e'), ('f'), ('g'), ('h'), ('i'), ('j'), ('k'), ('l'), ('m'), ('n'), ('o'), ('p'), ('q'), ('r'), ('s'), ('t'), ('u'), ('v'), ('w'), ('x'), ('y'), ('z'), ('A'), ('B'), ('C'), ('D'), ('E'), ('F'), ('G'), ('H'), ('I'), ('J'), ('K'), ('L'), ('M'), ('N'), ('O'), ('P'), ('Q'), ('R'), ('S'), ('T'), ('U'), ('V'), ('W'), ('X'), ('Y'), ('Z'), ('!'), ('@'), ('#'), ('$'), ('%'), ('^'), ('&'), ('*'), ('('), (')'), ('_'), ('+'), ('`'), ('~'), ('1'), ('2'), ('3'), ('4'), ('5'), ('6'), ('7'), ('8'), ('9'), ('0'), ('['), (']'), ('\\'), ('|'), ('}'), ('{'), ('"'), (':'), (''''), (';'), ('/'), ('.'), (','), ('?'), ('>'), ('<'), ('\n'), ('\t'), ('\a'), ('\f'), ('\v');
+select t1a.a, t1b.a from t1 as t1a, t1 as t1b where t1a.a=t1b.a order by binary t1a.a, binary t1b.a;
+drop table t1;
+
+#
+--echo End of 5.0 tests.
diff --git a/mysql-test/t/ctype_big5.test b/mysql-test/t/ctype_big5.test
index 200002cd235..5f3357e0406 100644
--- a/mysql-test/t/ctype_big5.test
+++ b/mysql-test/t/ctype_big5.test
@@ -63,4 +63,21 @@ drop table t1;
#
select hex(convert(_big5 0xC84041 using ucs2));
-# End of 4.1 tests
+--echo End of 4.1 tests
+
+#
+# Bug#26711 "binary content 0x00 sometimes becomes 0x5C 0x00 after dump/load"
+#
+set names big5;
+create table t1 (a blob);
+insert into t1 values (0xEE00);
+select * into outfile 'test/t1.txt' from t1;
+delete from t1;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval select hex(load_file('$MYSQLTEST_VARDIR/master-data/test/t1.txt'));
+load data infile 't1.txt' into table t1;
+select hex(a) from t1;
+--exec rm $MYSQLTEST_VARDIR/master-data/test/t1.txt
+drop table t1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/ctype_collate.test b/mysql-test/t/ctype_collate.test
index aca240b46bc..cfef8dfe81a 100644
--- a/mysql-test/t/ctype_collate.test
+++ b/mysql-test/t/ctype_collate.test
@@ -207,3 +207,25 @@ EXPLAIN SELECT * FROM t1 WHERE s2 LIKE 'a' COLLATE latin1_german1_ci;
DROP TABLE t1;
# End of 4.1 tests
+
+#
+# Bug#29261: Sort order of the collation wasn't used when comparing trailing
+# spaces.
+#
+create table t1(f1 varchar(10) character set latin2 collate latin2_hungarian_ci, key(f1));
+insert into t1 set f1=0x3F3F9DC73F;
+insert into t1 set f1=0x3F3F1E563F;
+insert into t1 set f1=0x3F3F;
+check table t1 extended;
+drop table t1;
+
+#
+# Bug#29461: Sort order of the collation wasn't used when comparing characters
+# with the space character.
+#
+create table t1 (a varchar(2) character set latin7 collate latin7_general_ci,key(a));
+insert into t1 set a=0x4c20;
+insert into t1 set a=0x6c;
+insert into t1 set a=0x4c98;
+check table t1 extended;
+drop table t1;
diff --git a/mysql-test/t/ctype_cp932_binlog_stm.test b/mysql-test/t/ctype_cp932_binlog_stm.test
index 3e20e123258..383009ae7c3 100644
--- a/mysql-test/t/ctype_cp932_binlog_stm.test
+++ b/mysql-test/t/ctype_cp932_binlog_stm.test
@@ -22,8 +22,16 @@ 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 410|
+SHOW BINLOG EVENTS FROM 369|
delimiter ;|
-# End of 5.0 tests
+--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
+# the log's contents) that caused the server crash.
+--error 1220
+SHOW BINLOG EVENTS FROM 364;
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/ctype_latin1.test b/mysql-test/t/ctype_latin1.test
index 0a112233ffb..b12436f77ba 100644
--- a/mysql-test/t/ctype_latin1.test
+++ b/mysql-test/t/ctype_latin1.test
@@ -121,3 +121,9 @@ INSERT INTO abcÿdef VALUES (2);
SELECT * FROM `abcÿdef`;
SELECT * FROM abcÿdef;
DROP TABLE `abcÿdef`;
+#
+# Bug#29499 Converting 'del' from ascii to Unicode results in 'question mark'
+#
+select hex(cast(_ascii 0x7f as char(1) character set latin1));
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/ctype_ldml-master.opt b/mysql-test/t/ctype_ldml-master.opt
new file mode 100644
index 00000000000..a2532d4cfd9
--- /dev/null
+++ b/mysql-test/t/ctype_ldml-master.opt
@@ -0,0 +1,2 @@
+--character-sets-dir=$MYSQL_TEST_DIR/std_data/
+
diff --git a/mysql-test/t/ctype_ldml.test b/mysql-test/t/ctype_ldml.test
new file mode 100644
index 00000000000..fc6ed0f2579
--- /dev/null
+++ b/mysql-test/t/ctype_ldml.test
@@ -0,0 +1,63 @@
+--source include/have_ucs2.inc
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+set names utf8;
+
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+show variables like 'character_sets_dir%';
+
+show collation like 'utf8_test_ci';
+create table t1 (c1 char(1) character set utf8 collate utf8_test_ci);
+insert into t1 values ('a');
+select * from t1 where c1='b';
+drop table t1;
+
+show collation like 'ucs2_test_ci';
+create table t1 (c1 char(1) character set ucs2 collate ucs2_test_ci);
+insert into t1 values ('a');
+select * from t1 where c1='b';
+drop table t1;
+
+#
+# Vietnamese experimental collation
+#
+
+show collation like 'ucs2_vn_ci';
+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);
+insert into t1 values (0x0103),(0x0102),(0x1EB1),(0x1EB0),(0x1EB3),(0x1EB2),
+ (0x1EB5),(0x1EB4),(0x1EAF),(0x1EAE),(0x1EB7),(0x1EB6);
+insert into t1 values (0x00E2),(0x00C2),(0x1EA7),(0x1EA6),(0x1EA9),(0x1EA8),
+ (0x1EAB),(0x1EAA),(0x1EA5),(0x1EA4),(0x1EAD),(0x1EAC);
+insert into t1 values ('b'),('B'),('c'),('C');
+insert into t1 values ('d'),('D'),(0x0111),(0x0110);
+insert into t1 values (0x0065),(0x0045),(0x00E8),(0x00C8),(0x1EBB),(0x1EBA),
+ (0x1EBD),(0x1EBC),(0x00E9),(0x00C9),(0x1EB9),(0x1EB8);
+insert into t1 values (0x00EA),(0x00CA),(0x1EC1),(0x1EC0),(0x1EC3),(0x1EC2),
+ (0x1EC5),(0x1EC4),(0x1EBF),(0x1EBE),(0x1EC7),(0x1EC6);
+insert into t1 values ('g'),('G'),('h'),('H');
+insert into t1 values (0x0069),(0x0049),(0x00EC),(0x00CC),(0x1EC9),(0x1EC8),
+ (0x0129),(0x0128),(0x00ED),(0x00CD),(0x1ECB),(0x1ECA);
+insert into t1 values ('k'),('K'),('l'),('L'),('m'),('M');
+insert into t1 values (0x006F),(0x004F),(0x00F2),(0x00D2),(0x1ECF),(0x1ECE),
+ (0x00F5),(0x00D5),(0x00F3),(0x00D3),(0x1ECD),(0x1ECC);
+insert into t1 values (0x00F4),(0x00D4),(0x1ED3),(0x1ED2),(0x1ED5),(0x1ED4),
+ (0x1ED7),(0x1ED6),(0x1ED1),(0x1ED0),(0x1ED9),(0x1ED8);
+insert into t1 values (0x01A1),(0x01A0),(0x1EDD),(0x1EDC),(0x1EDF),(0x1EDE),
+ (0x1EE1),(0x1EE0),(0x1EDB),(0x1EDA),(0x1EE3),(0x1EE2);
+insert into t1 values ('p'),('P'),('q'),('Q'),('r'),('R'),('s'),('S'),('t'),('T');
+insert into t1 values (0x0075),(0x0055),(0x00F9),(0x00D9),(0x1EE7),(0x1EE6),
+ (0x0169),(0x0168),(0x00FA),(0x00DA),(0x1EE5),(0x1EE4);
+insert into t1 values (0x01B0),(0x01AF),(0x1EEB),(0x1EEA),(0x1EED),(0x1EEC),
+ (0x1EEF),(0x1EEE),(0x1EE9),(0x1EE8),(0x1EF1),(0x1EF0);
+insert into t1 values ('v'),('V'),('x'),('X');
+insert into t1 values (0x0079),(0x0059),(0x1EF3),(0x1EF2),(0x1EF7),(0x1EF6),
+ (0x1EF9),(0x1EF8),(0x00FD),(0x00DD),(0x1EF5),(0x1EF4);
+select hex(c1) as h, c1 from t1 order by c1, h;
+select group_concat(hex(c1) order by hex(c1)) from t1 group by c1;
+select group_concat(c1 order by hex(c1) SEPARATOR '') from t1 group by c1;
+drop table t1;
diff --git a/mysql-test/t/ctype_recoding.test b/mysql-test/t/ctype_recoding.test
index c18c46b6b08..1f55aea414a 100644
--- a/mysql-test/t/ctype_recoding.test
+++ b/mysql-test/t/ctype_recoding.test
@@ -153,6 +153,16 @@ drop table t1;
set names latin1;
#
+# Test the same with ascii
+#
+set names ascii;
+create table t1 (a char(1) character set latin1);
+insert into t1 values ('a');
+select * from t1 where a='a';
+drop table t1;
+set names latin1;
+
+#
# Bug#10446 Illegal mix of collations
#
create table t1 (a char(10) character set utf8 collate utf8_bin);
diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test
index 64349bc40a6..695a21adbf5 100644
--- a/mysql-test/t/ctype_uca.test
+++ b/mysql-test/t/ctype_uca.test
@@ -485,3 +485,57 @@ CREATE TABLE t1 (
insert into t1 values (''),('a');
SELECT COUNT(*), c1 FROM t1 GROUP BY c1;
DROP TABLE IF EXISTS t1;
+
+#
+# Bug#27345 Incorrect data returned when range-read from utf8_danish_ci indexes
+#
+set names utf8;
+create table t1 (
+ a varchar(255),
+ key a(a)
+) character set utf8 collate utf8_danish_ci;
+insert into t1 values ('åaaaa'),('ååaaa'),('aaaaa');
+select a as like_a from t1 where a like 'a%';
+select a as like_aa from t1 where a like 'aa%';
+select a as like_aaa from t1 where a like 'aaa%';
+select a as like_aaaa from t1 where a like 'aaaa%';
+select a as like_aaaaa from t1 where a like 'aaaaa%';
+alter table t1 convert to character set ucs2 collate ucs2_danish_ci;
+select a as like_a from t1 where a like 'a%';
+select a as like_aa from t1 where a like 'aa%';
+select a as like_aaa from t1 where a like 'aaa%';
+select a as like_aaaa from t1 where a like 'aaaa%';
+select a as like_aaaaa from t1 where a like 'aaaaa%';
+drop table t1;
+
+create table t1 (
+ a varchar(255),
+ key(a)
+) character set utf8 collate utf8_spanish2_ci;
+insert into t1 values ('aaaaa'),('lllll'),('zzzzz');
+select a as like_l from t1 where a like 'l%';
+select a as like_ll from t1 where a like 'll%';
+select a as like_lll from t1 where a like 'lll%';
+select a as like_llll from t1 where a like 'llll%';
+select a as like_lllll from t1 where a like 'lllll%';
+alter table t1 convert to character set ucs2 collate ucs2_spanish2_ci;
+select a as like_l from t1 where a like 'l%';
+select a as like_ll from t1 where a like 'll%';
+select a as like_lll from t1 where a like 'lll%';
+select a as like_llll from t1 where a like 'llll%';
+select a as like_lllll from t1 where a like 'lllll%';
+drop table t1;
+
+create table t1 (
+ a varchar(255),
+ key a(a)
+) character set utf8 collate utf8_czech_ci;
+# In Czech 'ch' is a single letter between 'h' and 'i'
+insert into t1 values
+('b'),('c'),('d'),('e'),('f'),('g'),('h'),('ch'),('i'),('j');
+select * from t1 where a like 'c%';
+alter table t1 convert to character set ucs2 collate ucs2_czech_ci;
+select * from t1 where a like 'c%';
+drop table t1;
+
+-- echo End for 5.0 tests
diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test
index c3320159c41..bca3a9c3a96 100644
--- a/mysql-test/t/ctype_ucs.test
+++ b/mysql-test/t/ctype_ucs.test
@@ -594,4 +594,61 @@ select data_type, character_octet_length, character_maximum_length
from information_schema.columns where table_name='t1';
drop table t1;
+#
+# Bug#28925 GROUP_CONCAT inserts wrong separators for a ucs2 column
+#
+create table t1 (a char(1) character set ucs2);
+insert into t1 values ('a'),('b'),('c');
+select hex(group_concat(a)) from t1;
+select collation(group_concat(a)) from t1;
+drop table t1;
+
+set names latin1;
+create table t1 (a char(1) character set latin1);
+insert into t1 values ('a'),('b'),('c');
+set character_set_connection=ucs2;
+select hex(group_concat(a separator ',')) from t1;
+select collation(group_concat(a separator ',')) from t1;
+drop table t1;
+set names latin1;
+
+#
+# Bug#29499 Converting 'del' from ascii to Unicode results in 'question mark'
+#
+create table t1 (s1 char(1) character set ascii, s2 char(1) character set ucs2);
+insert into t1 (s1) values (0x7f);
+update t1 set s2 = s1;
+select hex(s2) from t1;
+select hex(convert(s1 using latin1)) from t1;
+drop table t1;
+
+#
+# Conversion from UCS2 to ASCII is possible
+# if the UCS2 string consists of only ASCII characters
+#
+create table t1 (a varchar(15) character set ascii not null, b int);
+insert into t1 values ('a',1);
+select concat(a,if(b<10,_ucs2 0x0061,_ucs2 0x0062)) from t1;
+select concat(a,if(b>10,_ucs2 0x0061,_ucs2 0x0062)) from t1;
+select * from t1 where a=if(b<10,_ucs2 0x0061,_ucs2 0x0062);
+select * from t1 where a=if(b>10,_ucs2 0x0061,_ucs2 0x0062);
+
+#
+# Conversion from UCS2 to ASCII is not possible if
+# the UCS2 string has non-ASCII characters
+#
+--error 1267
+select concat(a,if(b<10,_ucs2 0x00C0,_ucs2 0x0062)) from t1;
+--error 1267
+select concat(a,if(b>10,_ucs2 0x00C0,_ucs2 0x0062)) from t1;
+--error 1267
+select concat(a,if(b<10,_ucs2 0x0062,_ucs2 0x00C0)) from t1;
+--error 1267
+select concat(a,if(b>10,_ucs2 0x0062,_ucs2 0x00C0)) from t1;
+--error 1267
+select * from t1 where a=if(b<10,_ucs2 0x00C0,_ucs2 0x0062);
+--error 1267
+select * from t1 where a=if(b<10,_ucs2 0x0062,_ucs2 0x00C0);
+drop table t1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/ctype_ucs2_def.test b/mysql-test/t/ctype_ucs2_def.test
index e435d1fb07d..c80444daddd 100644
--- a/mysql-test/t/ctype_ucs2_def.test
+++ b/mysql-test/t/ctype_ucs2_def.test
@@ -14,3 +14,29 @@ DROP TABLE IF EXISTS t1;
--enable_warnings
create table t1 (a int);
drop table t1;
+
+--echo End of 4.1 tests
+
+#
+# Bug #28925 GROUP_CONCAT inserts wrong separators for a ucs2 column
+# Check that GROUP_CONCAT works fine with --default-character-set=ucs2
+#
+create table t1 (a char(1) character set latin1);
+insert into t1 values ('a'),('b'),('c');
+select hex(group_concat(a)) from t1;
+drop table t1;
+#
+# Bug #27643: query failed : 1114 (The table '' is full)
+#
+# Check that HASH indexes ignore trailing spaces when comparing
+# strings with the ucs2_bin collation
+
+CREATE TABLE t1(col1 VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL,
+ 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');
+--error ER_DUP_ENTRY
+INSERT INTO t1 VALUES('A ', 'A ');
+DROP TABLE t1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/ctype_ujis_ucs2.test b/mysql-test/t/ctype_ujis_ucs2.test
new file mode 100644
index 00000000000..1a8702b2aa9
--- /dev/null
+++ b/mysql-test/t/ctype_ujis_ucs2.test
@@ -0,0 +1,1306 @@
+-- source include/have_ujis.inc
+-- source include/have_ucs2.inc
+
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+
+#
+# Tests for UJIS-to-Unicode and Unicode-to-UJIS mapping
+#
+# MySQL's "ujis" is x-eucjp-unicode-0.9.
+#
+
+#
+# A helper table, with codes 0xA1..0xFE
+#
+create table t2 (code binary(1));
+insert into t2 values (0xA1),(0xA2),(0xA3),(0xA4),(0xA5),(0xA6),(0xA7);
+insert into t2 values (0xA8),(0xA9),(0xAA),(0xAB),(0xAC),(0xAD),(0xAE),(0xAF);
+insert into t2 values (0xB0),(0xB1),(0xB2),(0xB3),(0xB4),(0xB5),(0xB6),(0xB7);
+insert into t2 values (0xB8),(0xB9),(0xBA),(0xBB),(0xBC),(0xBD),(0xBE),(0xBF);
+insert into t2 values (0xC0),(0xC1),(0xC2),(0xC3),(0xC4),(0xC5),(0xC6),(0xC7);
+insert into t2 values (0xC8),(0xC9),(0xCA),(0xCB),(0xCC),(0xCD),(0xCE),(0xCF);
+insert into t2 values (0xD0),(0xD1),(0xD2),(0xD3),(0xD4),(0xD5),(0xD6),(0xD7);
+insert into t2 values (0xD8),(0xD9),(0xDA),(0xDB),(0xDC),(0xDD),(0xDE),(0xDF);
+insert into t2 values (0xE0),(0xE1),(0xE2),(0xE3),(0xE4),(0xE5),(0xE6),(0xE7);
+insert into t2 values (0xE8),(0xE9),(0xEA),(0xEB),(0xEC),(0xED),(0xEE),(0xEF);
+insert into t2 values (0xF0),(0xF1),(0xF2),(0xF3),(0xF4),(0xF5),(0xF6),(0xF7);
+insert into t2 values (0xF8),(0xF9),(0xFA),(0xFB),(0xFC),(0xFD),(0xFE);
+
+create table t1
+(
+ ujis varchar(1) character set ujis collate ujis_bin primary key,
+ ucs2 varchar(1) character set ucs2 not null default '',
+ ujis2 varchar(1) character set ujis not null default '',
+ name varchar(64) character set ujis not null default ''
+);
+
+#
+# A character from the ASCII (code set 0)
+# is represented by one byte, in the range 0x00 - 0x7E.
+#
+
+insert into t1 set ujis=0x00, name='U+0000 NULL';
+insert into t1 set ujis=0x01, name='U+0001 START OF HEADING';
+insert into t1 set ujis=0x02, name='U+0002 START OF TEXT';
+insert into t1 set ujis=0x03, name='U+0003 END OF TEXT';
+insert into t1 set ujis=0x04, name='U+0004 END OF TRANSMISSION';
+insert into t1 set ujis=0x05, name='U+0005 ENQUIRY';
+insert into t1 set ujis=0x06, name='U+0006 ACKNOWLEDGE';
+insert into t1 set ujis=0x07, name='U+0007 BELL';
+insert into t1 set ujis=0x08, name='U+0008 BACKSPACE';
+insert into t1 set ujis=0x09, name='U+0009 HORIZONTAL TABULATION';
+insert into t1 set ujis=0x0A, name='U+000A LINE FEED';
+insert into t1 set ujis=0x0B, name='U+000B VERTICAL TABULATION';
+insert into t1 set ujis=0x0C, name='U+000C FORM FEED';
+insert into t1 set ujis=0x0D, name='U+000D CARRIAGE RETURN';
+insert into t1 set ujis=0x0E, name='U+000E SHIFT OUT';
+insert into t1 set ujis=0x0F, name='U+000F SHIFT IN';
+insert into t1 set ujis=0x10, name='U+0010 DATA LINK ESCAPE';
+insert into t1 set ujis=0x11, name='U+0011 DEVICE CONTROL ONE';
+insert into t1 set ujis=0x12, name='U+0012 DEVICE CONTROL TWO';
+insert into t1 set ujis=0x13, name='U+0013 DEVICE CONTROL THREE';
+insert into t1 set ujis=0x14, name='U+0014 DEVICE CONTROL FOUR';
+insert into t1 set ujis=0x15, name='U+0015 NEGATIVE ACKNOWLEDGE';
+insert into t1 set ujis=0x16, name='U+0016 SYNCHRONOUS IDLE';
+insert into t1 set ujis=0x17, name='U+0017 END OF TRANSMISSION BLOCK';
+insert into t1 set ujis=0x18, name='U+0018 CANCEL';
+insert into t1 set ujis=0x19, name='U+0019 END OF MEDIUM';
+insert into t1 set ujis=0x1A, name='U+001A SUBSTITUTE';
+insert into t1 set ujis=0x1B, name='U+001B ESCAPE';
+insert into t1 set ujis=0x1C, name='U+001C FILE SEPARATOR';
+insert into t1 set ujis=0x1D, name='U+001D GROUP SEPARATOR';
+insert into t1 set ujis=0x1E, name='U+001E RECORD SEPARATOR';
+insert into t1 set ujis=0x1F, name='U+001F UNIT SEPARATOR';
+insert into t1 set ujis=0x20, name='U+0020 SPACE';
+insert into t1 set ujis=0x21, name='U+0021 EXCLAMATION MARK';
+insert into t1 set ujis=0x22, name='U+0022 QUOTATION MARK';
+insert into t1 set ujis=0x23, name='U+0023 NUMBER SIGN';
+insert into t1 set ujis=0x24, name='U+0024 DOLLAR SIGN';
+insert into t1 set ujis=0x25, name='U+0025 PERCENT SIGN';
+insert into t1 set ujis=0x26, name='U+0026 AMPERSAND';
+insert into t1 set ujis=0x27, name='U+0027 APOSTROPHE';
+insert into t1 set ujis=0x28, name='U+0028 LEFT PARENTHESIS';
+insert into t1 set ujis=0x29, name='U+0029 RIGHT PARENTHESIS';
+insert into t1 set ujis=0x2A, name='U+002A ASTERISK';
+insert into t1 set ujis=0x2B, name='U+002B PLUS SIGN';
+insert into t1 set ujis=0x2C, name='U+002C COMMA';
+insert into t1 set ujis=0x2D, name='U+002D HYPHEN-MINUS';
+insert into t1 set ujis=0x2E, name='U+002E FULL STOP';
+insert into t1 set ujis=0x2F, name='U+002F SOLIDUS';
+insert into t1 set ujis=0x30, name='U+0030 DIGIT ZERO';
+insert into t1 set ujis=0x31, name='U+0031 DIGIT ONE';
+insert into t1 set ujis=0x32, name='U+0032 DIGIT TWO';
+insert into t1 set ujis=0x33, name='U+0033 DIGIT THREE';
+insert into t1 set ujis=0x34, name='U+0034 DIGIT FOUR';
+insert into t1 set ujis=0x35, name='U+0035 DIGIT FIVE';
+insert into t1 set ujis=0x36, name='U+0036 DIGIT SIX';
+insert into t1 set ujis=0x37, name='U+0037 DIGIT SEVEN';
+insert into t1 set ujis=0x38, name='U+0038 DIGIT EIGHT';
+insert into t1 set ujis=0x39, name='U+0039 DIGIT NINE';
+insert into t1 set ujis=0x3A, name='U+003A COLON';
+insert into t1 set ujis=0x3B, name='U+003B SEMICOLON';
+insert into t1 set ujis=0x3C, name='U+003C LESS-THAN SIGN';
+insert into t1 set ujis=0x3D, name='U+003D EQUALS SIGN';
+insert into t1 set ujis=0x3E, name='U+003E GREATER-THAN SIGN';
+insert into t1 set ujis=0x3F, name='U+003F QUESTION MARK';
+insert into t1 set ujis=0x40, name='U+0040 COMMERCIAL AT';
+insert into t1 set ujis=0x41, name='U+0041 LATIN CAPITAL LETTER A';
+insert into t1 set ujis=0x42, name='U+0042 LATIN CAPITAL LETTER B';
+insert into t1 set ujis=0x43, name='U+0043 LATIN CAPITAL LETTER C';
+insert into t1 set ujis=0x44, name='U+0044 LATIN CAPITAL LETTER D';
+insert into t1 set ujis=0x45, name='U+0045 LATIN CAPITAL LETTER E';
+insert into t1 set ujis=0x46, name='U+0046 LATIN CAPITAL LETTER F';
+insert into t1 set ujis=0x47, name='U+0047 LATIN CAPITAL LETTER G';
+insert into t1 set ujis=0x48, name='U+0048 LATIN CAPITAL LETTER H';
+insert into t1 set ujis=0x49, name='U+0049 LATIN CAPITAL LETTER I';
+insert into t1 set ujis=0x4A, name='U+004A LATIN CAPITAL LETTER J';
+insert into t1 set ujis=0x4B, name='U+004B LATIN CAPITAL LETTER K';
+insert into t1 set ujis=0x4C, name='U+004C LATIN CAPITAL LETTER L';
+insert into t1 set ujis=0x4D, name='U+004D LATIN CAPITAL LETTER M';
+insert into t1 set ujis=0x4E, name='U+004E LATIN CAPITAL LETTER N';
+insert into t1 set ujis=0x4F, name='U+004F LATIN CAPITAL LETTER O';
+insert into t1 set ujis=0x50, name='U+0050 LATIN CAPITAL LETTER P';
+insert into t1 set ujis=0x51, name='U+0051 LATIN CAPITAL LETTER Q';
+insert into t1 set ujis=0x52, name='U+0052 LATIN CAPITAL LETTER R';
+insert into t1 set ujis=0x53, name='U+0053 LATIN CAPITAL LETTER S';
+insert into t1 set ujis=0x54, name='U+0054 LATIN CAPITAL LETTER T';
+insert into t1 set ujis=0x55, name='U+0055 LATIN CAPITAL LETTER U';
+insert into t1 set ujis=0x56, name='U+0056 LATIN CAPITAL LETTER V';
+insert into t1 set ujis=0x57, name='U+0057 LATIN CAPITAL LETTER W';
+insert into t1 set ujis=0x58, name='U+0058 LATIN CAPITAL LETTER X';
+insert into t1 set ujis=0x59, name='U+0059 LATIN CAPITAL LETTER Y';
+insert into t1 set ujis=0x5A, name='U+005A LATIN CAPITAL LETTER Z';
+insert into t1 set ujis=0x5B, name='U+005B LEFT SQUARE BRACKET';
+insert into t1 set ujis=0x5C, name='U+005C REVERSE SOLIDUS';
+insert into t1 set ujis=0x5D, name='U+005D RIGHT SQUARE BRACKET';
+insert into t1 set ujis=0x5E, name='U+005E CIRCUMFLEX ACCENT';
+insert into t1 set ujis=0x5F, name='U+005F LOW LINE';
+insert into t1 set ujis=0x60, name='U+0060 GRAVE ACCENT';
+insert into t1 set ujis=0x61, name='U+0061 LATIN SMALL LETTER A';
+insert into t1 set ujis=0x62, name='U+0062 LATIN SMALL LETTER B';
+insert into t1 set ujis=0x63, name='U+0063 LATIN SMALL LETTER C';
+insert into t1 set ujis=0x64, name='U+0064 LATIN SMALL LETTER D';
+insert into t1 set ujis=0x65, name='U+0065 LATIN SMALL LETTER E';
+insert into t1 set ujis=0x66, name='U+0066 LATIN SMALL LETTER F';
+insert into t1 set ujis=0x67, name='U+0067 LATIN SMALL LETTER G';
+insert into t1 set ujis=0x68, name='U+0068 LATIN SMALL LETTER H';
+insert into t1 set ujis=0x69, name='U+0069 LATIN SMALL LETTER I';
+insert into t1 set ujis=0x6A, name='U+006A LATIN SMALL LETTER J';
+insert into t1 set ujis=0x6B, name='U+006B LATIN SMALL LETTER K';
+insert into t1 set ujis=0x6C, name='U+006C LATIN SMALL LETTER L';
+insert into t1 set ujis=0x6D, name='U+006D LATIN SMALL LETTER M';
+insert into t1 set ujis=0x6E, name='U+006E LATIN SMALL LETTER N';
+insert into t1 set ujis=0x6F, name='U+006F LATIN SMALL LETTER O';
+insert into t1 set ujis=0x70, name='U+0070 LATIN SMALL LETTER P';
+insert into t1 set ujis=0x71, name='U+0071 LATIN SMALL LETTER Q';
+insert into t1 set ujis=0x72, name='U+0072 LATIN SMALL LETTER R';
+insert into t1 set ujis=0x73, name='U+0073 LATIN SMALL LETTER S';
+insert into t1 set ujis=0x74, name='U+0074 LATIN SMALL LETTER T';
+insert into t1 set ujis=0x75, name='U+0075 LATIN SMALL LETTER U';
+insert into t1 set ujis=0x76, name='U+0076 LATIN SMALL LETTER V';
+insert into t1 set ujis=0x77, name='U+0077 LATIN SMALL LETTER W';
+insert into t1 set ujis=0x78, name='U+0078 LATIN SMALL LETTER X';
+insert into t1 set ujis=0x79, name='U+0079 LATIN SMALL LETTER Y';
+insert into t1 set ujis=0x7A, name='U+007A LATIN SMALL LETTER Z';
+insert into t1 set ujis=0x7B, name='U+007B LEFT CURLY BRACKET';
+insert into t1 set ujis=0x7C, name='U+007C VERTICAL LINE';
+insert into t1 set ujis=0x7D, name='U+007D RIGHT CURLY BRACKET';
+insert into t1 set ujis=0x7E, name='U+007E TILDE';
+insert into t1 set ujis=0x7F, name='U+007F DELETE';
+
+
+#
+# A character from JIS-X-0208 (code set 1)
+# is represented by two bytes,
+# both in the range 0xA1 - 0xFE.
+# Codes according to:
+# ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/JIS0208.TXT
+#
+# Fill table t1 with codes "[A1..FE][A1..FE]" using helper table t2.
+# 8836 codes total:
+#
+insert into t1 (ujis) select concat(t21.code,t22.code) from t2 t21, t2 t22 order by 1;
+
+update t1 set name='U+3000 IDEOGRAPHIC SPACE' where ujis=0xA1A1;
+update t1 set name='U+3001 IDEOGRAPHIC COMMA' where ujis=0xA1A2;
+update t1 set name='U+3002 IDEOGRAPHIC FULL STOP' where ujis=0xA1A3;
+update t1 set name='U+FF0C FULLWIDTH COMMA' where ujis=0xA1A4;
+update t1 set name='U+FF0E FULLWIDTH FULL STOP' where ujis=0xA1A5;
+update t1 set name='U+30FB KATAKANA MIDDLE DOT' where ujis=0xA1A6;
+update t1 set name='U+FF1A FULLWIDTH COLON' where ujis=0xA1A7;
+update t1 set name='U+FF1B FULLWIDTH SEMICOLON' where ujis=0xA1A8;
+update t1 set name='U+FF1F FULLWIDTH QUESTION MARK' where ujis=0xA1A9;
+update t1 set name='U+FF01 FULLWIDTH EXCLAMATION MARK' where ujis=0xA1AA;
+update t1 set name='U+309B KATAKANA-HIRAGANA VOICED SOUND MARK' where ujis=0xA1AB;
+update t1 set name='U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK' where ujis=0xA1AC;
+update t1 set name='U+00B4 ACUTE ACCENT' where ujis=0xA1AD;
+update t1 set name='U+FF40 FULLWIDTH GRAVE ACCENT' where ujis=0xA1AE;
+update t1 set name='U+00A8 DIAERESIS' where ujis=0xA1AF;
+update t1 set name='U+FF3E FULLWIDTH CIRCUMFLEX ACCENT' where ujis=0xA1B0;
+update t1 set name='U+FFE3 FULLWIDTH MACRON' where ujis=0xA1B1;
+update t1 set name='U+FF3F FULLWIDTH LOW LINE' where ujis=0xA1B2;
+update t1 set name='U+30FD KATAKANA ITERATION MARK' where ujis=0xA1B3;
+update t1 set name='U+30FE KATAKANA VOICED ITERATION MARK' where ujis=0xA1B4;
+update t1 set name='U+309D HIRAGANA ITERATION MARK' where ujis=0xA1B5;
+update t1 set name='U+309E HIRAGANA VOICED ITERATION MARK' where ujis=0xA1B6;
+update t1 set name='U+3003 DITTO MARK' where ujis=0xA1B7;
+update t1 set name='U+4EDD <CJK>' where ujis=0xA1B8;
+update t1 set name='U+3005 IDEOGRAPHIC ITERATION MARK' where ujis=0xA1B9;
+update t1 set name='U+3006 IDEOGRAPHIC CLOSING MARK' where ujis=0xA1BA;
+update t1 set name='U+3007 IDEOGRAPHIC NUMBER ZERO' where ujis=0xA1BB;
+update t1 set name='U+30FC KATAKANA-HIRAGANA PROLONGED SOUND MARK' where ujis=0xA1BC;
+update t1 set name='U+2015 HORIZONTAL BAR' where ujis=0xA1BD;
+update t1 set name='U+2010 HYPHEN' where ujis=0xA1BE;
+update t1 set name='U+FF0F FULLWIDTH SOLIDUS' where ujis=0xA1BF;
+update t1 set name='U+005C REVERSE SOLIDUS' where ujis=0xA1C0;
+update t1 set name='U+301C WAVE DASH' where ujis=0xA1C1;
+update t1 set name='U+2016 DOUBLE VERTICAL LINE' where ujis=0xA1C2;
+update t1 set name='U+FF5C FULLWIDTH VERTICAL LINE' where ujis=0xA1C3;
+update t1 set name='U+2026 HORIZONTAL ELLIPSIS' where ujis=0xA1C4;
+update t1 set name='U+2025 TWO DOT LEADER' where ujis=0xA1C5;
+update t1 set name='U+2018 LEFT SINGLE QUOTATION MARK' where ujis=0xA1C6;
+update t1 set name='U+2019 RIGHT SINGLE QUOTATION MARK' where ujis=0xA1C7;
+update t1 set name='U+201C LEFT DOUBLE QUOTATION MARK' where ujis=0xA1C8;
+update t1 set name='U+201D RIGHT DOUBLE QUOTATION MARK' where ujis=0xA1C9;
+update t1 set name='U+FF08 FULLWIDTH LEFT PARENTHESIS' where ujis=0xA1CA;
+update t1 set name='U+FF09 FULLWIDTH RIGHT PARENTHESIS' where ujis=0xA1CB;
+update t1 set name='U+3014 LEFT TORTOISE SHELL BRACKET' where ujis=0xA1CC;
+update t1 set name='U+3015 RIGHT TORTOISE SHELL BRACKET' where ujis=0xA1CD;
+update t1 set name='U+FF3B FULLWIDTH LEFT SQUARE BRACKET' where ujis=0xA1CE;
+update t1 set name='U+FF3D FULLWIDTH RIGHT SQUARE BRACKET' where ujis=0xA1CF;
+update t1 set name='U+FF5B FULLWIDTH LEFT CURLY BRACKET' where ujis=0xA1D0;
+update t1 set name='U+FF5D FULLWIDTH RIGHT CURLY BRACKET' where ujis=0xA1D1;
+update t1 set name='U+3008 LEFT ANGLE BRACKET' where ujis=0xA1D2;
+update t1 set name='U+3009 RIGHT ANGLE BRACKET' where ujis=0xA1D3;
+update t1 set name='U+300A LEFT DOUBLE ANGLE BRACKET' where ujis=0xA1D4;
+update t1 set name='U+300B RIGHT DOUBLE ANGLE BRACKET' where ujis=0xA1D5;
+update t1 set name='U+300C LEFT CORNER BRACKET' where ujis=0xA1D6;
+update t1 set name='U+300D RIGHT CORNER BRACKET' where ujis=0xA1D7;
+update t1 set name='U+300E LEFT WHITE CORNER BRACKET' where ujis=0xA1D8;
+update t1 set name='U+300F RIGHT WHITE CORNER BRACKET' where ujis=0xA1D9;
+update t1 set name='U+3010 LEFT BLACK LENTICULAR BRACKET' where ujis=0xA1DA;
+update t1 set name='U+3011 RIGHT BLACK LENTICULAR BRACKET' where ujis=0xA1DB;
+update t1 set name='U+FF0B FULLWIDTH PLUS SIGN' where ujis=0xA1DC;
+update t1 set name='U+2212 MINUS SIGN' where ujis=0xA1DD;
+update t1 set name='U+00B1 PLUS-MINUS SIGN' where ujis=0xA1DE;
+update t1 set name='U+00D7 MULTIPLICATION SIGN' where ujis=0xA1DF;
+update t1 set name='U+00F7 DIVISION SIGN' where ujis=0xA1E0;
+update t1 set name='U+FF1D FULLWIDTH EQUALS SIGN' where ujis=0xA1E1;
+update t1 set name='U+2260 NOT EQUAL TO' where ujis=0xA1E2;
+update t1 set name='U+FF1C FULLWIDTH LESS-THAN SIGN' where ujis=0xA1E3;
+update t1 set name='U+FF1E FULLWIDTH GREATER-THAN SIGN' where ujis=0xA1E4;
+update t1 set name='U+2266 LESS-THAN OVER EQUAL TO' where ujis=0xA1E5;
+update t1 set name='U+2267 GREATER-THAN OVER EQUAL TO' where ujis=0xA1E6;
+update t1 set name='U+221E INFINITY' where ujis=0xA1E7;
+update t1 set name='U+2234 THEREFORE' where ujis=0xA1E8;
+update t1 set name='U+2642 MALE SIGN' where ujis=0xA1E9;
+update t1 set name='U+2640 FEMALE SIGN' where ujis=0xA1EA;
+update t1 set name='U+00B0 DEGREE SIGN' where ujis=0xA1EB;
+update t1 set name='U+2032 PRIME' where ujis=0xA1EC;
+update t1 set name='U+2033 DOUBLE PRIME' where ujis=0xA1ED;
+update t1 set name='U+2103 DEGREE CELSIUS' where ujis=0xA1EE;
+update t1 set name='U+FFE5 FULLWIDTH YEN SIGN' where ujis=0xA1EF;
+update t1 set name='U+FF04 FULLWIDTH DOLLAR SIGN' where ujis=0xA1F0;
+update t1 set name='U+00A2 CENT SIGN' where ujis=0xA1F1;
+update t1 set name='U+00A3 POUND SIGN' where ujis=0xA1F2;
+update t1 set name='U+FF05 FULLWIDTH PERCENT SIGN' where ujis=0xA1F3;
+update t1 set name='U+FF03 FULLWIDTH NUMBER SIGN' where ujis=0xA1F4;
+update t1 set name='U+FF06 FULLWIDTH AMPERSAND' where ujis=0xA1F5;
+update t1 set name='U+FF0A FULLWIDTH ASTERISK' where ujis=0xA1F6;
+update t1 set name='U+FF20 FULLWIDTH COMMERCIAL AT' where ujis=0xA1F7;
+update t1 set name='U+00A7 SECTION SIGN' where ujis=0xA1F8;
+update t1 set name='U+2606 WHITE STAR' where ujis=0xA1F9;
+update t1 set name='U+2605 BLACK STAR' where ujis=0xA1FA;
+update t1 set name='U+25CB WHITE CIRCLE' where ujis=0xA1FB;
+update t1 set name='U+25CF BLACK CIRCLE' where ujis=0xA1FC;
+update t1 set name='U+25CE BULLSEYE' where ujis=0xA1FD;
+update t1 set name='U+25C7 WHITE DIAMOND' where ujis=0xA1FE;
+update t1 set name='U+25C6 BLACK DIAMOND' where ujis=0xA2A1;
+update t1 set name='U+25A1 WHITE SQUARE' where ujis=0xA2A2;
+update t1 set name='U+25A0 BLACK SQUARE' where ujis=0xA2A3;
+update t1 set name='U+25B3 WHITE UP-POINTING TRIANGLE' where ujis=0xA2A4;
+update t1 set name='U+25B2 BLACK UP-POINTING TRIANGLE' where ujis=0xA2A5;
+update t1 set name='U+25BD WHITE DOWN-POINTING TRIANGLE' where ujis=0xA2A6;
+update t1 set name='U+25BC BLACK DOWN-POINTING TRIANGLE' where ujis=0xA2A7;
+update t1 set name='U+203B REFERENCE MARK' where ujis=0xA2A8;
+update t1 set name='U+3012 POSTAL MARK' where ujis=0xA2A9;
+update t1 set name='U+2192 RIGHTWARDS ARROW' where ujis=0xA2AA;
+update t1 set name='U+2190 LEFTWARDS ARROW' where ujis=0xA2AB;
+update t1 set name='U+2191 UPWARDS ARROW' where ujis=0xA2AC;
+update t1 set name='U+2193 DOWNWARDS ARROW' where ujis=0xA2AD;
+update t1 set name='U+3013 GETA MARK' where ujis=0xA2AE;
+update t1 set name='U+2208 ELEMENT OF' where ujis=0xA2BA;
+update t1 set name='U+220B CONTAINS AS MEMBER' where ujis=0xA2BB;
+update t1 set name='U+2286 SUBset OF OR EQUAL TO' where ujis=0xA2BC;
+update t1 set name='U+2287 SUPERset OF OR EQUAL TO' where ujis=0xA2BD;
+update t1 set name='U+2282 SUBset OF' where ujis=0xA2BE;
+update t1 set name='U+2283 SUPERset OF' where ujis=0xA2BF;
+update t1 set name='U+222A UNION' where ujis=0xA2C0;
+update t1 set name='U+2229 INTERSECTION' where ujis=0xA2C1;
+update t1 set name='U+2227 LOGICAL AND' where ujis=0xA2CA;
+update t1 set name='U+2228 LOGICAL OR' where ujis=0xA2CB;
+update t1 set name='U+00AC NOT SIGN' where ujis=0xA2CC;
+update t1 set name='U+21D2 RIGHTWARDS DOUBLE ARROW' where ujis=0xA2CD;
+update t1 set name='U+21D4 LEFT RIGHT DOUBLE ARROW' where ujis=0xA2CE;
+update t1 set name='U+2200 FOR ALL' where ujis=0xA2CF;
+update t1 set name='U+2203 THERE EXISTS' where ujis=0xA2D0;
+update t1 set name='U+2220 ANGLE' where ujis=0xA2DC;
+update t1 set name='U+22A5 UP TACK' where ujis=0xA2DD;
+update t1 set name='U+2312 ARC' where ujis=0xA2DE;
+update t1 set name='U+2202 PARTIAL DIFFERENTIAL' where ujis=0xA2DF;
+update t1 set name='U+2207 NABLA' where ujis=0xA2E0;
+update t1 set name='U+2261 IDENTICAL TO' where ujis=0xA2E1;
+update t1 set name='U+2252 APPROXIMATELY EQUAL TO OR THE IMAGE OF' where ujis=0xA2E2;
+update t1 set name='U+226A MUCH LESS-THAN' where ujis=0xA2E3;
+update t1 set name='U+226B MUCH GREATER-THAN' where ujis=0xA2E4;
+update t1 set name='U+221A SQUARE ROOT' where ujis=0xA2E5;
+update t1 set name='U+223D REVERSED TILDE' where ujis=0xA2E6;
+update t1 set name='U+221D PROPORTIONAL TO' where ujis=0xA2E7;
+update t1 set name='U+2235 BECAUSE' where ujis=0xA2E8;
+update t1 set name='U+222B INTEGRAL' where ujis=0xA2E9;
+update t1 set name='U+222C DOUBLE INTEGRAL' where ujis=0xA2EA;
+update t1 set name='U+212B ANGSTROM SIGN' where ujis=0xA2F2;
+update t1 set name='U+2030 PER MILLE SIGN' where ujis=0xA2F3;
+update t1 set name='U+266F MUSIC SHARP SIGN' where ujis=0xA2F4;
+update t1 set name='U+266D MUSIC FLAT SIGN' where ujis=0xA2F5;
+update t1 set name='U+266A EIGHTH NOTE' where ujis=0xA2F6;
+update t1 set name='U+2020 DAGGER' where ujis=0xA2F7;
+update t1 set name='U+2021 DOUBLE DAGGER' where ujis=0xA2F8;
+update t1 set name='U+00B6 PILCROW SIGN' where ujis=0xA2F9;
+update t1 set name='U+25EF LARGE CIRCLE' where ujis=0xA2FE;
+update t1 set name='U+FF10 FULLWIDTH DIGIT ZERO' where ujis=0xA3B0;
+update t1 set name='U+FF11 FULLWIDTH DIGIT ONE' where ujis=0xA3B1;
+update t1 set name='U+FF12 FULLWIDTH DIGIT TWO' where ujis=0xA3B2;
+update t1 set name='U+FF13 FULLWIDTH DIGIT THREE' where ujis=0xA3B3;
+update t1 set name='U+FF14 FULLWIDTH DIGIT FOUR' where ujis=0xA3B4;
+update t1 set name='U+FF15 FULLWIDTH DIGIT FIVE' where ujis=0xA3B5;
+update t1 set name='U+FF16 FULLWIDTH DIGIT SIX' where ujis=0xA3B6;
+update t1 set name='U+FF17 FULLWIDTH DIGIT SEVEN' where ujis=0xA3B7;
+update t1 set name='U+FF18 FULLWIDTH DIGIT EIGHT' where ujis=0xA3B8;
+update t1 set name='U+FF19 FULLWIDTH DIGIT NINE' where ujis=0xA3B9;
+update t1 set name='U+FF21 FULLWIDTH LATIN CAPITAL LETTER A' where ujis=0xA3C1;
+update t1 set name='U+FF22 FULLWIDTH LATIN CAPITAL LETTER B' where ujis=0xA3C2;
+update t1 set name='U+FF23 FULLWIDTH LATIN CAPITAL LETTER C' where ujis=0xA3C3;
+update t1 set name='U+FF24 FULLWIDTH LATIN CAPITAL LETTER D' where ujis=0xA3C4;
+update t1 set name='U+FF25 FULLWIDTH LATIN CAPITAL LETTER E' where ujis=0xA3C5;
+update t1 set name='U+FF26 FULLWIDTH LATIN CAPITAL LETTER F' where ujis=0xA3C6;
+update t1 set name='U+FF27 FULLWIDTH LATIN CAPITAL LETTER G' where ujis=0xA3C7;
+update t1 set name='U+FF28 FULLWIDTH LATIN CAPITAL LETTER H' where ujis=0xA3C8;
+update t1 set name='U+FF29 FULLWIDTH LATIN CAPITAL LETTER I' where ujis=0xA3C9;
+update t1 set name='U+FF2A FULLWIDTH LATIN CAPITAL LETTER J' where ujis=0xA3CA;
+update t1 set name='U+FF2B FULLWIDTH LATIN CAPITAL LETTER K' where ujis=0xA3CB;
+update t1 set name='U+FF2C FULLWIDTH LATIN CAPITAL LETTER L' where ujis=0xA3CC;
+update t1 set name='U+FF2D FULLWIDTH LATIN CAPITAL LETTER M' where ujis=0xA3CD;
+update t1 set name='U+FF2E FULLWIDTH LATIN CAPITAL LETTER N' where ujis=0xA3CE;
+update t1 set name='U+FF2F FULLWIDTH LATIN CAPITAL LETTER O' where ujis=0xA3CF;
+update t1 set name='U+FF30 FULLWIDTH LATIN CAPITAL LETTER P' where ujis=0xA3D0;
+update t1 set name='U+FF31 FULLWIDTH LATIN CAPITAL LETTER Q' where ujis=0xA3D1;
+update t1 set name='U+FF32 FULLWIDTH LATIN CAPITAL LETTER R' where ujis=0xA3D2;
+update t1 set name='U+FF33 FULLWIDTH LATIN CAPITAL LETTER S' where ujis=0xA3D3;
+update t1 set name='U+FF34 FULLWIDTH LATIN CAPITAL LETTER T' where ujis=0xA3D4;
+update t1 set name='U+FF35 FULLWIDTH LATIN CAPITAL LETTER U' where ujis=0xA3D5;
+update t1 set name='U+FF36 FULLWIDTH LATIN CAPITAL LETTER V' where ujis=0xA3D6;
+update t1 set name='U+FF37 FULLWIDTH LATIN CAPITAL LETTER W' where ujis=0xA3D7;
+update t1 set name='U+FF38 FULLWIDTH LATIN CAPITAL LETTER X' where ujis=0xA3D8;
+update t1 set name='U+FF39 FULLWIDTH LATIN CAPITAL LETTER Y' where ujis=0xA3D9;
+update t1 set name='U+FF3A FULLWIDTH LATIN CAPITAL LETTER Z' where ujis=0xA3DA;
+update t1 set name='U+FF41 FULLWIDTH LATIN SMALL LETTER A' where ujis=0xA3E1;
+update t1 set name='U+FF42 FULLWIDTH LATIN SMALL LETTER B' where ujis=0xA3E2;
+update t1 set name='U+FF43 FULLWIDTH LATIN SMALL LETTER C' where ujis=0xA3E3;
+update t1 set name='U+FF44 FULLWIDTH LATIN SMALL LETTER D' where ujis=0xA3E4;
+update t1 set name='U+FF45 FULLWIDTH LATIN SMALL LETTER E' where ujis=0xA3E5;
+update t1 set name='U+FF46 FULLWIDTH LATIN SMALL LETTER F' where ujis=0xA3E6;
+update t1 set name='U+FF47 FULLWIDTH LATIN SMALL LETTER G' where ujis=0xA3E7;
+update t1 set name='U+FF48 FULLWIDTH LATIN SMALL LETTER H' where ujis=0xA3E8;
+update t1 set name='U+FF49 FULLWIDTH LATIN SMALL LETTER I' where ujis=0xA3E9;
+update t1 set name='U+FF4A FULLWIDTH LATIN SMALL LETTER J' where ujis=0xA3EA;
+update t1 set name='U+FF4B FULLWIDTH LATIN SMALL LETTER K' where ujis=0xA3EB;
+update t1 set name='U+FF4C FULLWIDTH LATIN SMALL LETTER L' where ujis=0xA3EC;
+update t1 set name='U+FF4D FULLWIDTH LATIN SMALL LETTER M' where ujis=0xA3ED;
+update t1 set name='U+FF4E FULLWIDTH LATIN SMALL LETTER N' where ujis=0xA3EE;
+update t1 set name='U+FF4F FULLWIDTH LATIN SMALL LETTER O' where ujis=0xA3EF;
+update t1 set name='U+FF50 FULLWIDTH LATIN SMALL LETTER P' where ujis=0xA3F0;
+update t1 set name='U+FF51 FULLWIDTH LATIN SMALL LETTER Q' where ujis=0xA3F1;
+update t1 set name='U+FF52 FULLWIDTH LATIN SMALL LETTER R' where ujis=0xA3F2;
+update t1 set name='U+FF53 FULLWIDTH LATIN SMALL LETTER S' where ujis=0xA3F3;
+update t1 set name='U+FF54 FULLWIDTH LATIN SMALL LETTER T' where ujis=0xA3F4;
+update t1 set name='U+FF55 FULLWIDTH LATIN SMALL LETTER U' where ujis=0xA3F5;
+update t1 set name='U+FF56 FULLWIDTH LATIN SMALL LETTER V' where ujis=0xA3F6;
+update t1 set name='U+FF57 FULLWIDTH LATIN SMALL LETTER W' where ujis=0xA3F7;
+update t1 set name='U+FF58 FULLWIDTH LATIN SMALL LETTER X' where ujis=0xA3F8;
+update t1 set name='U+FF59 FULLWIDTH LATIN SMALL LETTER Y' where ujis=0xA3F9;
+update t1 set name='U+FF5A FULLWIDTH LATIN SMALL LETTER Z' where ujis=0xA3FA;
+update t1 set name='U+3041 HIRAGANA LETTER SMALL A' where ujis=0xA4A1;
+update t1 set name='U+3042 HIRAGANA LETTER A' where ujis=0xA4A2;
+update t1 set name='U+3043 HIRAGANA LETTER SMALL I' where ujis=0xA4A3;
+update t1 set name='U+3044 HIRAGANA LETTER I' where ujis=0xA4A4;
+update t1 set name='U+3045 HIRAGANA LETTER SMALL U' where ujis=0xA4A5;
+update t1 set name='U+3046 HIRAGANA LETTER U' where ujis=0xA4A6;
+update t1 set name='U+3047 HIRAGANA LETTER SMALL E' where ujis=0xA4A7;
+update t1 set name='U+3048 HIRAGANA LETTER E' where ujis=0xA4A8;
+update t1 set name='U+3049 HIRAGANA LETTER SMALL O' where ujis=0xA4A9;
+update t1 set name='U+304A HIRAGANA LETTER O' where ujis=0xA4AA;
+update t1 set name='U+304B HIRAGANA LETTER KA' where ujis=0xA4AB;
+update t1 set name='U+304C HIRAGANA LETTER GA' where ujis=0xA4AC;
+update t1 set name='U+304D HIRAGANA LETTER KI' where ujis=0xA4AD;
+update t1 set name='U+304E HIRAGANA LETTER GI' where ujis=0xA4AE;
+update t1 set name='U+304F HIRAGANA LETTER KU' where ujis=0xA4AF;
+update t1 set name='U+3050 HIRAGANA LETTER GU' where ujis=0xA4B0;
+update t1 set name='U+3051 HIRAGANA LETTER KE' where ujis=0xA4B1;
+update t1 set name='U+3052 HIRAGANA LETTER GE' where ujis=0xA4B2;
+update t1 set name='U+3053 HIRAGANA LETTER KO' where ujis=0xA4B3;
+update t1 set name='U+3054 HIRAGANA LETTER GO' where ujis=0xA4B4;
+update t1 set name='U+3055 HIRAGANA LETTER SA' where ujis=0xA4B5;
+update t1 set name='U+3056 HIRAGANA LETTER ZA' where ujis=0xA4B6;
+update t1 set name='U+3057 HIRAGANA LETTER SI' where ujis=0xA4B7;
+update t1 set name='U+3058 HIRAGANA LETTER ZI' where ujis=0xA4B8;
+update t1 set name='U+3059 HIRAGANA LETTER SU' where ujis=0xA4B9;
+update t1 set name='U+305A HIRAGANA LETTER ZU' where ujis=0xA4BA;
+update t1 set name='U+305B HIRAGANA LETTER SE' where ujis=0xA4BB;
+update t1 set name='U+305C HIRAGANA LETTER ZE' where ujis=0xA4BC;
+update t1 set name='U+305D HIRAGANA LETTER SO' where ujis=0xA4BD;
+update t1 set name='U+305E HIRAGANA LETTER ZO' where ujis=0xA4BE;
+update t1 set name='U+305F HIRAGANA LETTER TA' where ujis=0xA4BF;
+update t1 set name='U+3060 HIRAGANA LETTER DA' where ujis=0xA4C0;
+update t1 set name='U+3061 HIRAGANA LETTER TI' where ujis=0xA4C1;
+update t1 set name='U+3062 HIRAGANA LETTER DI' where ujis=0xA4C2;
+update t1 set name='U+3063 HIRAGANA LETTER SMALL TU' where ujis=0xA4C3;
+update t1 set name='U+3064 HIRAGANA LETTER TU' where ujis=0xA4C4;
+update t1 set name='U+3065 HIRAGANA LETTER DU' where ujis=0xA4C5;
+update t1 set name='U+3066 HIRAGANA LETTER TE' where ujis=0xA4C6;
+update t1 set name='U+3067 HIRAGANA LETTER DE' where ujis=0xA4C7;
+update t1 set name='U+3068 HIRAGANA LETTER TO' where ujis=0xA4C8;
+update t1 set name='U+3069 HIRAGANA LETTER DO' where ujis=0xA4C9;
+update t1 set name='U+306A HIRAGANA LETTER NA' where ujis=0xA4CA;
+update t1 set name='U+306B HIRAGANA LETTER NI' where ujis=0xA4CB;
+update t1 set name='U+306C HIRAGANA LETTER NU' where ujis=0xA4CC;
+update t1 set name='U+306D HIRAGANA LETTER NE' where ujis=0xA4CD;
+update t1 set name='U+306E HIRAGANA LETTER NO' where ujis=0xA4CE;
+update t1 set name='U+306F HIRAGANA LETTER HA' where ujis=0xA4CF;
+update t1 set name='U+3070 HIRAGANA LETTER BA' where ujis=0xA4D0;
+update t1 set name='U+3071 HIRAGANA LETTER PA' where ujis=0xA4D1;
+update t1 set name='U+3072 HIRAGANA LETTER HI' where ujis=0xA4D2;
+update t1 set name='U+3073 HIRAGANA LETTER BI' where ujis=0xA4D3;
+update t1 set name='U+3074 HIRAGANA LETTER PI' where ujis=0xA4D4;
+update t1 set name='U+3075 HIRAGANA LETTER HU' where ujis=0xA4D5;
+update t1 set name='U+3076 HIRAGANA LETTER BU' where ujis=0xA4D6;
+update t1 set name='U+3077 HIRAGANA LETTER PU' where ujis=0xA4D7;
+update t1 set name='U+3078 HIRAGANA LETTER HE' where ujis=0xA4D8;
+update t1 set name='U+3079 HIRAGANA LETTER BE' where ujis=0xA4D9;
+update t1 set name='U+307A HIRAGANA LETTER PE' where ujis=0xA4DA;
+update t1 set name='U+307B HIRAGANA LETTER HO' where ujis=0xA4DB;
+update t1 set name='U+307C HIRAGANA LETTER BO' where ujis=0xA4DC;
+update t1 set name='U+307D HIRAGANA LETTER PO' where ujis=0xA4DD;
+update t1 set name='U+307E HIRAGANA LETTER MA' where ujis=0xA4DE;
+update t1 set name='U+307F HIRAGANA LETTER MI' where ujis=0xA4DF;
+update t1 set name='U+3080 HIRAGANA LETTER MU' where ujis=0xA4E0;
+update t1 set name='U+3081 HIRAGANA LETTER ME' where ujis=0xA4E1;
+update t1 set name='U+3082 HIRAGANA LETTER MO' where ujis=0xA4E2;
+update t1 set name='U+3083 HIRAGANA LETTER SMALL YA' where ujis=0xA4E3;
+update t1 set name='U+3084 HIRAGANA LETTER YA' where ujis=0xA4E4;
+update t1 set name='U+3085 HIRAGANA LETTER SMALL YU' where ujis=0xA4E5;
+update t1 set name='U+3086 HIRAGANA LETTER YU' where ujis=0xA4E6;
+update t1 set name='U+3087 HIRAGANA LETTER SMALL YO' where ujis=0xA4E7;
+update t1 set name='U+3088 HIRAGANA LETTER YO' where ujis=0xA4E8;
+update t1 set name='U+3089 HIRAGANA LETTER RA' where ujis=0xA4E9;
+update t1 set name='U+308A HIRAGANA LETTER RI' where ujis=0xA4EA;
+update t1 set name='U+308B HIRAGANA LETTER RU' where ujis=0xA4EB;
+update t1 set name='U+308C HIRAGANA LETTER RE' where ujis=0xA4EC;
+update t1 set name='U+308D HIRAGANA LETTER RO' where ujis=0xA4ED;
+update t1 set name='U+308E HIRAGANA LETTER SMALL WA' where ujis=0xA4EE;
+update t1 set name='U+308F HIRAGANA LETTER WA' where ujis=0xA4EF;
+update t1 set name='U+3090 HIRAGANA LETTER WI' where ujis=0xA4F0;
+update t1 set name='U+3091 HIRAGANA LETTER WE' where ujis=0xA4F1;
+update t1 set name='U+3092 HIRAGANA LETTER WO' where ujis=0xA4F2;
+update t1 set name='U+3093 HIRAGANA LETTER N' where ujis=0xA4F3;
+update t1 set name='U+30A1 KATAKANA LETTER SMALL A' where ujis=0xA5A1;
+update t1 set name='U+30A2 KATAKANA LETTER A' where ujis=0xA5A2;
+update t1 set name='U+30A3 KATAKANA LETTER SMALL I' where ujis=0xA5A3;
+update t1 set name='U+30A4 KATAKANA LETTER I' where ujis=0xA5A4;
+update t1 set name='U+30A5 KATAKANA LETTER SMALL U' where ujis=0xA5A5;
+update t1 set name='U+30A6 KATAKANA LETTER U' where ujis=0xA5A6;
+update t1 set name='U+30A7 KATAKANA LETTER SMALL E' where ujis=0xA5A7;
+update t1 set name='U+30A8 KATAKANA LETTER E' where ujis=0xA5A8;
+update t1 set name='U+30A9 KATAKANA LETTER SMALL O' where ujis=0xA5A9;
+update t1 set name='U+30AA KATAKANA LETTER O' where ujis=0xA5AA;
+update t1 set name='U+30AB KATAKANA LETTER KA' where ujis=0xA5AB;
+update t1 set name='U+30AC KATAKANA LETTER GA' where ujis=0xA5AC;
+update t1 set name='U+30AD KATAKANA LETTER KI' where ujis=0xA5AD;
+update t1 set name='U+30AE KATAKANA LETTER GI' where ujis=0xA5AE;
+update t1 set name='U+30AF KATAKANA LETTER KU' where ujis=0xA5AF;
+update t1 set name='U+30B0 KATAKANA LETTER GU' where ujis=0xA5B0;
+update t1 set name='U+30B1 KATAKANA LETTER KE' where ujis=0xA5B1;
+update t1 set name='U+30B2 KATAKANA LETTER GE' where ujis=0xA5B2;
+update t1 set name='U+30B3 KATAKANA LETTER KO' where ujis=0xA5B3;
+update t1 set name='U+30B4 KATAKANA LETTER GO' where ujis=0xA5B4;
+update t1 set name='U+30B5 KATAKANA LETTER SA' where ujis=0xA5B5;
+update t1 set name='U+30B6 KATAKANA LETTER ZA' where ujis=0xA5B6;
+update t1 set name='U+30B7 KATAKANA LETTER SI' where ujis=0xA5B7;
+update t1 set name='U+30B8 KATAKANA LETTER ZI' where ujis=0xA5B8;
+update t1 set name='U+30B9 KATAKANA LETTER SU' where ujis=0xA5B9;
+update t1 set name='U+30BA KATAKANA LETTER ZU' where ujis=0xA5BA;
+update t1 set name='U+30BB KATAKANA LETTER SE' where ujis=0xA5BB;
+update t1 set name='U+30BC KATAKANA LETTER ZE' where ujis=0xA5BC;
+update t1 set name='U+30BD KATAKANA LETTER SO' where ujis=0xA5BD;
+update t1 set name='U+30BE KATAKANA LETTER ZO' where ujis=0xA5BE;
+update t1 set name='U+30BF KATAKANA LETTER TA' where ujis=0xA5BF;
+update t1 set name='U+30C0 KATAKANA LETTER DA' where ujis=0xA5C0;
+update t1 set name='U+30C1 KATAKANA LETTER TI' where ujis=0xA5C1;
+update t1 set name='U+30C2 KATAKANA LETTER DI' where ujis=0xA5C2;
+update t1 set name='U+30C3 KATAKANA LETTER SMALL TU' where ujis=0xA5C3;
+update t1 set name='U+30C4 KATAKANA LETTER TU' where ujis=0xA5C4;
+update t1 set name='U+30C5 KATAKANA LETTER DU' where ujis=0xA5C5;
+update t1 set name='U+30C6 KATAKANA LETTER TE' where ujis=0xA5C6;
+update t1 set name='U+30C7 KATAKANA LETTER DE' where ujis=0xA5C7;
+update t1 set name='U+30C8 KATAKANA LETTER TO' where ujis=0xA5C8;
+update t1 set name='U+30C9 KATAKANA LETTER DO' where ujis=0xA5C9;
+update t1 set name='U+30CA KATAKANA LETTER NA' where ujis=0xA5CA;
+update t1 set name='U+30CB KATAKANA LETTER NI' where ujis=0xA5CB;
+update t1 set name='U+30CC KATAKANA LETTER NU' where ujis=0xA5CC;
+update t1 set name='U+30CD KATAKANA LETTER NE' where ujis=0xA5CD;
+update t1 set name='U+30CE KATAKANA LETTER NO' where ujis=0xA5CE;
+update t1 set name='U+30CF KATAKANA LETTER HA' where ujis=0xA5CF;
+update t1 set name='U+30D0 KATAKANA LETTER BA' where ujis=0xA5D0;
+update t1 set name='U+30D1 KATAKANA LETTER PA' where ujis=0xA5D1;
+update t1 set name='U+30D2 KATAKANA LETTER HI' where ujis=0xA5D2;
+update t1 set name='U+30D3 KATAKANA LETTER BI' where ujis=0xA5D3;
+update t1 set name='U+30D4 KATAKANA LETTER PI' where ujis=0xA5D4;
+update t1 set name='U+30D5 KATAKANA LETTER HU' where ujis=0xA5D5;
+update t1 set name='U+30D6 KATAKANA LETTER BU' where ujis=0xA5D6;
+update t1 set name='U+30D7 KATAKANA LETTER PU' where ujis=0xA5D7;
+update t1 set name='U+30D8 KATAKANA LETTER HE' where ujis=0xA5D8;
+update t1 set name='U+30D9 KATAKANA LETTER BE' where ujis=0xA5D9;
+update t1 set name='U+30DA KATAKANA LETTER PE' where ujis=0xA5DA;
+update t1 set name='U+30DB KATAKANA LETTER HO' where ujis=0xA5DB;
+update t1 set name='U+30DC KATAKANA LETTER BO' where ujis=0xA5DC;
+update t1 set name='U+30DD KATAKANA LETTER PO' where ujis=0xA5DD;
+update t1 set name='U+30DE KATAKANA LETTER MA' where ujis=0xA5DE;
+update t1 set name='U+30DF KATAKANA LETTER MI' where ujis=0xA5DF;
+update t1 set name='U+30E0 KATAKANA LETTER MU' where ujis=0xA5E0;
+update t1 set name='U+30E1 KATAKANA LETTER ME' where ujis=0xA5E1;
+update t1 set name='U+30E2 KATAKANA LETTER MO' where ujis=0xA5E2;
+update t1 set name='U+30E3 KATAKANA LETTER SMALL YA' where ujis=0xA5E3;
+update t1 set name='U+30E4 KATAKANA LETTER YA' where ujis=0xA5E4;
+update t1 set name='U+30E5 KATAKANA LETTER SMALL YU' where ujis=0xA5E5;
+update t1 set name='U+30E6 KATAKANA LETTER YU' where ujis=0xA5E6;
+update t1 set name='U+30E7 KATAKANA LETTER SMALL YO' where ujis=0xA5E7;
+update t1 set name='U+30E8 KATAKANA LETTER YO' where ujis=0xA5E8;
+update t1 set name='U+30E9 KATAKANA LETTER RA' where ujis=0xA5E9;
+update t1 set name='U+30EA KATAKANA LETTER RI' where ujis=0xA5EA;
+update t1 set name='U+30EB KATAKANA LETTER RU' where ujis=0xA5EB;
+update t1 set name='U+30EC KATAKANA LETTER RE' where ujis=0xA5EC;
+update t1 set name='U+30ED KATAKANA LETTER RO' where ujis=0xA5ED;
+update t1 set name='U+30EE KATAKANA LETTER SMALL WA' where ujis=0xA5EE;
+update t1 set name='U+30EF KATAKANA LETTER WA' where ujis=0xA5EF;
+update t1 set name='U+30F0 KATAKANA LETTER WI' where ujis=0xA5F0;
+update t1 set name='U+30F1 KATAKANA LETTER WE' where ujis=0xA5F1;
+update t1 set name='U+30F2 KATAKANA LETTER WO' where ujis=0xA5F2;
+update t1 set name='U+30F3 KATAKANA LETTER N' where ujis=0xA5F3;
+update t1 set name='U+30F4 KATAKANA LETTER VU' where ujis=0xA5F4;
+update t1 set name='U+30F5 KATAKANA LETTER SMALL KA' where ujis=0xA5F5;
+update t1 set name='U+30F6 KATAKANA LETTER SMALL KE' where ujis=0xA5F6;
+update t1 set name='U+0391 GREEK CAPITAL LETTER ALPHA' where ujis=0xA6A1;
+update t1 set name='U+0392 GREEK CAPITAL LETTER BETA' where ujis=0xA6A2;
+update t1 set name='U+0393 GREEK CAPITAL LETTER GAMMA' where ujis=0xA6A3;
+update t1 set name='U+0394 GREEK CAPITAL LETTER DELTA' where ujis=0xA6A4;
+update t1 set name='U+0395 GREEK CAPITAL LETTER EPSILON' where ujis=0xA6A5;
+update t1 set name='U+0396 GREEK CAPITAL LETTER ZETA' where ujis=0xA6A6;
+update t1 set name='U+0397 GREEK CAPITAL LETTER ETA' where ujis=0xA6A7;
+update t1 set name='U+0398 GREEK CAPITAL LETTER THETA' where ujis=0xA6A8;
+update t1 set name='U+0399 GREEK CAPITAL LETTER IOTA' where ujis=0xA6A9;
+update t1 set name='U+039A GREEK CAPITAL LETTER KAPPA' where ujis=0xA6AA;
+update t1 set name='U+039B GREEK CAPITAL LETTER LAMDA' where ujis=0xA6AB;
+update t1 set name='U+039C GREEK CAPITAL LETTER MU' where ujis=0xA6AC;
+update t1 set name='U+039D GREEK CAPITAL LETTER NU' where ujis=0xA6AD;
+update t1 set name='U+039E GREEK CAPITAL LETTER XI' where ujis=0xA6AE;
+update t1 set name='U+039F GREEK CAPITAL LETTER OMICRON' where ujis=0xA6AF;
+update t1 set name='U+03A0 GREEK CAPITAL LETTER PI' where ujis=0xA6B0;
+update t1 set name='U+03A1 GREEK CAPITAL LETTER RHO' where ujis=0xA6B1;
+update t1 set name='U+03A3 GREEK CAPITAL LETTER SIGMA' where ujis=0xA6B2;
+update t1 set name='U+03A4 GREEK CAPITAL LETTER TAU' where ujis=0xA6B3;
+update t1 set name='U+03A5 GREEK CAPITAL LETTER UPSILON' where ujis=0xA6B4;
+update t1 set name='U+03A6 GREEK CAPITAL LETTER PHI' where ujis=0xA6B5;
+update t1 set name='U+03A7 GREEK CAPITAL LETTER CHI' where ujis=0xA6B6;
+update t1 set name='U+03A8 GREEK CAPITAL LETTER PSI' where ujis=0xA6B7;
+update t1 set name='U+03A9 GREEK CAPITAL LETTER OMEGA' where ujis=0xA6B8;
+update t1 set name='U+03B1 GREEK SMALL LETTER ALPHA' where ujis=0xA6C1;
+update t1 set name='U+03B2 GREEK SMALL LETTER BETA' where ujis=0xA6C2;
+update t1 set name='U+03B3 GREEK SMALL LETTER GAMMA' where ujis=0xA6C3;
+update t1 set name='U+03B4 GREEK SMALL LETTER DELTA' where ujis=0xA6C4;
+update t1 set name='U+03B5 GREEK SMALL LETTER EPSILON' where ujis=0xA6C5;
+update t1 set name='U+03B6 GREEK SMALL LETTER ZETA' where ujis=0xA6C6;
+update t1 set name='U+03B7 GREEK SMALL LETTER ETA' where ujis=0xA6C7;
+update t1 set name='U+03B8 GREEK SMALL LETTER THETA' where ujis=0xA6C8;
+update t1 set name='U+03B9 GREEK SMALL LETTER IOTA' where ujis=0xA6C9;
+update t1 set name='U+03BA GREEK SMALL LETTER KAPPA' where ujis=0xA6CA;
+update t1 set name='U+03BB GREEK SMALL LETTER LAMDA' where ujis=0xA6CB;
+update t1 set name='U+03BC GREEK SMALL LETTER MU' where ujis=0xA6CC;
+update t1 set name='U+03BD GREEK SMALL LETTER NU' where ujis=0xA6CD;
+update t1 set name='U+03BE GREEK SMALL LETTER XI' where ujis=0xA6CE;
+update t1 set name='U+03BF GREEK SMALL LETTER OMICRON' where ujis=0xA6CF;
+update t1 set name='U+03C0 GREEK SMALL LETTER PI' where ujis=0xA6D0;
+update t1 set name='U+03C1 GREEK SMALL LETTER RHO' where ujis=0xA6D1;
+update t1 set name='U+03C3 GREEK SMALL LETTER SIGMA' where ujis=0xA6D2;
+update t1 set name='U+03C4 GREEK SMALL LETTER TAU' where ujis=0xA6D3;
+update t1 set name='U+03C5 GREEK SMALL LETTER UPSILON' where ujis=0xA6D4;
+update t1 set name='U+03C6 GREEK SMALL LETTER PHI' where ujis=0xA6D5;
+update t1 set name='U+03C7 GREEK SMALL LETTER CHI' where ujis=0xA6D6;
+update t1 set name='U+03C8 GREEK SMALL LETTER PSI' where ujis=0xA6D7;
+update t1 set name='U+03C9 GREEK SMALL LETTER OMEGA' where ujis=0xA6D8;
+update t1 set name='U+0410 CYRILLIC CAPITAL LETTER A' where ujis=0xA7A1;
+update t1 set name='U+0411 CYRILLIC CAPITAL LETTER BE' where ujis=0xA7A2;
+update t1 set name='U+0412 CYRILLIC CAPITAL LETTER VE' where ujis=0xA7A3;
+update t1 set name='U+0413 CYRILLIC CAPITAL LETTER GHE' where ujis=0xA7A4;
+update t1 set name='U+0414 CYRILLIC CAPITAL LETTER DE' where ujis=0xA7A5;
+update t1 set name='U+0415 CYRILLIC CAPITAL LETTER IE' where ujis=0xA7A6;
+update t1 set name='U+0401 CYRILLIC CAPITAL LETTER IO' where ujis=0xA7A7;
+update t1 set name='U+0416 CYRILLIC CAPITAL LETTER ZHE' where ujis=0xA7A8;
+update t1 set name='U+0417 CYRILLIC CAPITAL LETTER ZE' where ujis=0xA7A9;
+update t1 set name='U+0418 CYRILLIC CAPITAL LETTER I' where ujis=0xA7AA;
+update t1 set name='U+0419 CYRILLIC CAPITAL LETTER SHORT I' where ujis=0xA7AB;
+update t1 set name='U+041A CYRILLIC CAPITAL LETTER KA' where ujis=0xA7AC;
+update t1 set name='U+041B CYRILLIC CAPITAL LETTER EL' where ujis=0xA7AD;
+update t1 set name='U+041C CYRILLIC CAPITAL LETTER EM' where ujis=0xA7AE;
+update t1 set name='U+041D CYRILLIC CAPITAL LETTER EN' where ujis=0xA7AF;
+update t1 set name='U+041E CYRILLIC CAPITAL LETTER O' where ujis=0xA7B0;
+update t1 set name='U+041F CYRILLIC CAPITAL LETTER PE' where ujis=0xA7B1;
+update t1 set name='U+0420 CYRILLIC CAPITAL LETTER ER' where ujis=0xA7B2;
+update t1 set name='U+0421 CYRILLIC CAPITAL LETTER ES' where ujis=0xA7B3;
+update t1 set name='U+0422 CYRILLIC CAPITAL LETTER TE' where ujis=0xA7B4;
+update t1 set name='U+0423 CYRILLIC CAPITAL LETTER U' where ujis=0xA7B5;
+update t1 set name='U+0424 CYRILLIC CAPITAL LETTER EF' where ujis=0xA7B6;
+update t1 set name='U+0425 CYRILLIC CAPITAL LETTER HA' where ujis=0xA7B7;
+update t1 set name='U+0426 CYRILLIC CAPITAL LETTER TSE' where ujis=0xA7B8;
+update t1 set name='U+0427 CYRILLIC CAPITAL LETTER CHE' where ujis=0xA7B9;
+update t1 set name='U+0428 CYRILLIC CAPITAL LETTER SHA' where ujis=0xA7BA;
+update t1 set name='U+0429 CYRILLIC CAPITAL LETTER SHCHA' where ujis=0xA7BB;
+update t1 set name='U+042A CYRILLIC CAPITAL LETTER HARD SIGN' where ujis=0xA7BC;
+update t1 set name='U+042B CYRILLIC CAPITAL LETTER YERU' where ujis=0xA7BD;
+update t1 set name='U+042C CYRILLIC CAPITAL LETTER SOFT SIGN' where ujis=0xA7BE;
+update t1 set name='U+042D CYRILLIC CAPITAL LETTER E' where ujis=0xA7BF;
+update t1 set name='U+042E CYRILLIC CAPITAL LETTER YU' where ujis=0xA7C0;
+update t1 set name='U+042F CYRILLIC CAPITAL LETTER YA' where ujis=0xA7C1;
+update t1 set name='U+0430 CYRILLIC SMALL LETTER A' where ujis=0xA7D1;
+update t1 set name='U+0431 CYRILLIC SMALL LETTER BE' where ujis=0xA7D2;
+update t1 set name='U+0432 CYRILLIC SMALL LETTER VE' where ujis=0xA7D3;
+update t1 set name='U+0433 CYRILLIC SMALL LETTER GHE' where ujis=0xA7D4;
+update t1 set name='U+0434 CYRILLIC SMALL LETTER DE' where ujis=0xA7D5;
+update t1 set name='U+0435 CYRILLIC SMALL LETTER IE' where ujis=0xA7D6;
+update t1 set name='U+0451 CYRILLIC SMALL LETTER IO' where ujis=0xA7D7;
+update t1 set name='U+0436 CYRILLIC SMALL LETTER ZHE' where ujis=0xA7D8;
+update t1 set name='U+0437 CYRILLIC SMALL LETTER ZE' where ujis=0xA7D9;
+update t1 set name='U+0438 CYRILLIC SMALL LETTER I' where ujis=0xA7DA;
+update t1 set name='U+0439 CYRILLIC SMALL LETTER SHORT I' where ujis=0xA7DB;
+update t1 set name='U+043A CYRILLIC SMALL LETTER KA' where ujis=0xA7DC;
+update t1 set name='U+043B CYRILLIC SMALL LETTER EL' where ujis=0xA7DD;
+update t1 set name='U+043C CYRILLIC SMALL LETTER EM' where ujis=0xA7DE;
+update t1 set name='U+043D CYRILLIC SMALL LETTER EN' where ujis=0xA7DF;
+update t1 set name='U+043E CYRILLIC SMALL LETTER O' where ujis=0xA7E0;
+update t1 set name='U+043F CYRILLIC SMALL LETTER PE' where ujis=0xA7E1;
+update t1 set name='U+0440 CYRILLIC SMALL LETTER ER' where ujis=0xA7E2;
+update t1 set name='U+0441 CYRILLIC SMALL LETTER ES' where ujis=0xA7E3;
+update t1 set name='U+0442 CYRILLIC SMALL LETTER TE' where ujis=0xA7E4;
+update t1 set name='U+0443 CYRILLIC SMALL LETTER U' where ujis=0xA7E5;
+update t1 set name='U+0444 CYRILLIC SMALL LETTER EF' where ujis=0xA7E6;
+update t1 set name='U+0445 CYRILLIC SMALL LETTER HA' where ujis=0xA7E7;
+update t1 set name='U+0446 CYRILLIC SMALL LETTER TSE' where ujis=0xA7E8;
+update t1 set name='U+0447 CYRILLIC SMALL LETTER CHE' where ujis=0xA7E9;
+update t1 set name='U+0448 CYRILLIC SMALL LETTER SHA' where ujis=0xA7EA;
+update t1 set name='U+0449 CYRILLIC SMALL LETTER SHCHA' where ujis=0xA7EB;
+update t1 set name='U+044A CYRILLIC SMALL LETTER HARD SIGN' where ujis=0xA7EC;
+update t1 set name='U+044B CYRILLIC SMALL LETTER YERU' where ujis=0xA7ED;
+update t1 set name='U+044C CYRILLIC SMALL LETTER SOFT SIGN' where ujis=0xA7EE;
+update t1 set name='U+044D CYRILLIC SMALL LETTER E' where ujis=0xA7EF;
+update t1 set name='U+044E CYRILLIC SMALL LETTER YU' where ujis=0xA7F0;
+update t1 set name='U+044F CYRILLIC SMALL LETTER YA' where ujis=0xA7F1;
+update t1 set name='U+2500 BOX DRAWINGS LIGHT HORIZONTAL' where ujis=0xA8A1;
+update t1 set name='U+2502 BOX DRAWINGS LIGHT VERTICAL' where ujis=0xA8A2;
+update t1 set name='U+250C BOX DRAWINGS LIGHT DOWN AND RIGHT' where ujis=0xA8A3;
+update t1 set name='U+2510 BOX DRAWINGS LIGHT DOWN AND LEFT' where ujis=0xA8A4;
+update t1 set name='U+2518 BOX DRAWINGS LIGHT UP AND LEFT' where ujis=0xA8A5;
+update t1 set name='U+2514 BOX DRAWINGS LIGHT UP AND RIGHT' where ujis=0xA8A6;
+update t1 set name='U+251C BOX DRAWINGS LIGHT VERTICAL AND RIGHT' where ujis=0xA8A7;
+update t1 set name='U+252C BOX DRAWINGS LIGHT DOWN AND HORIZONTAL' where ujis=0xA8A8;
+update t1 set name='U+2524 BOX DRAWINGS LIGHT VERTICAL AND LEFT' where ujis=0xA8A9;
+update t1 set name='U+2534 BOX DRAWINGS LIGHT UP AND HORIZONTAL' where ujis=0xA8AA;
+update t1 set name='U+253C BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL' where ujis=0xA8AB;
+update t1 set name='U+2501 BOX DRAWINGS HEAVY HORIZONTAL' where ujis=0xA8AC;
+update t1 set name='U+2503 BOX DRAWINGS HEAVY VERTICAL' where ujis=0xA8AD;
+update t1 set name='U+250F BOX DRAWINGS HEAVY DOWN AND RIGHT' where ujis=0xA8AE;
+update t1 set name='U+2513 BOX DRAWINGS HEAVY DOWN AND LEFT' where ujis=0xA8AF;
+update t1 set name='U+251B BOX DRAWINGS HEAVY UP AND LEFT' where ujis=0xA8B0;
+update t1 set name='U+2517 BOX DRAWINGS HEAVY UP AND RIGHT' where ujis=0xA8B1;
+update t1 set name='U+2523 BOX DRAWINGS HEAVY VERTICAL AND RIGHT' where ujis=0xA8B2;
+update t1 set name='U+2533 BOX DRAWINGS HEAVY DOWN AND HORIZONTAL' where ujis=0xA8B3;
+update t1 set name='U+252B BOX DRAWINGS HEAVY VERTICAL AND LEFT' where ujis=0xA8B4;
+update t1 set name='U+253B BOX DRAWINGS HEAVY UP AND HORIZONTAL' where ujis=0xA8B5;
+update t1 set name='U+254B BOX DRAWINGS HEAVY VERTICAL AND HORIZONTAL' where ujis=0xA8B6;
+update t1 set name='U+2520 BOX DRAWINGS VERTICAL HEAVY AND RIGHT LIGHT' where ujis=0xA8B7;
+update t1 set name='U+252F BOX DRAWINGS DOWN LIGHT AND HORIZONTAL HEAVY' where ujis=0xA8B8;
+update t1 set name='U+2528 BOX DRAWINGS VERTICAL HEAVY AND LEFT LIGHT' where ujis=0xA8B9;
+update t1 set name='U+2537 BOX DRAWINGS UP LIGHT AND HORIZONTAL HEAVY' where ujis=0xA8BA;
+update t1 set name='U+253F BOX DRAWINGS VERTICAL LIGHT AND HORIZONTAL HEAVY' where ujis=0xA8BB;
+update t1 set name='U+251D BOX DRAWINGS VERTICAL LIGHT AND RIGHT HEAVY' where ujis=0xA8BC;
+update t1 set name='U+2530 BOX DRAWINGS DOWN HEAVY AND HORIZONTAL LIGHT' where ujis=0xA8BD;
+update t1 set name='U+2525 BOX DRAWINGS VERTICAL LIGHT AND LEFT HEAVY' where ujis=0xA8BE;
+update t1 set name='U+2538 BOX DRAWINGS UP HEAVY AND HORIZONTAL LIGHT' where ujis=0xA8BF;
+update t1 set name='U+2542 BOX DRAWINGS VERTICAL HEAVY AND HORIZONTAL LIGHT' where ujis=0xA8C0;
+
+#
+# [B0..BF][A1..FE] - 16*94=1504 codes assigned
+#
+update t1 set name='<CJK>' where ujis >= 0xB0A1 AND ujis <= 0xBFFE;
+
+#
+# [C0..CE][A1..FE] = 15*94=1410 codes assigned
+#
+update t1 set name='<CJK>' where ujis >= 0xC0A1 AND ujis <= 0xCEFE;
+
+#
+# 0xCFxx - 51 codes assigned
+#
+update t1 set name='U+84EE <CJK>' where ujis=0xCFA1;
+update t1 set name='U+9023 <CJK>' where ujis=0xCFA2;
+update t1 set name='U+932C <CJK>' where ujis=0xCFA3;
+update t1 set name='U+5442 <CJK>' where ujis=0xCFA4;
+update t1 set name='U+9B6F <CJK>' where ujis=0xCFA5;
+update t1 set name='U+6AD3 <CJK>' where ujis=0xCFA6;
+update t1 set name='U+7089 <CJK>' where ujis=0xCFA7;
+update t1 set name='U+8CC2 <CJK>' where ujis=0xCFA8;
+update t1 set name='U+8DEF <CJK>' where ujis=0xCFA9;
+update t1 set name='U+9732 <CJK>' where ujis=0xCFAA;
+update t1 set name='U+52B4 <CJK>' where ujis=0xCFAB;
+update t1 set name='U+5A41 <CJK>' where ujis=0xCFAC;
+update t1 set name='U+5ECA <CJK>' where ujis=0xCFAD;
+update t1 set name='U+5F04 <CJK>' where ujis=0xCFAE;
+update t1 set name='U+6717 <CJK>' where ujis=0xCFAF;
+update t1 set name='U+697C <CJK>' where ujis=0xCFB0;
+update t1 set name='U+6994 <CJK>' where ujis=0xCFB1;
+update t1 set name='U+6D6A <CJK>' where ujis=0xCFB2;
+update t1 set name='U+6F0F <CJK>' where ujis=0xCFB3;
+update t1 set name='U+7262 <CJK>' where ujis=0xCFB4;
+update t1 set name='U+72FC <CJK>' where ujis=0xCFB5;
+update t1 set name='U+7BED <CJK>' where ujis=0xCFB6;
+update t1 set name='U+8001 <CJK>' where ujis=0xCFB7;
+update t1 set name='U+807E <CJK>' where ujis=0xCFB8;
+update t1 set name='U+874B <CJK>' where ujis=0xCFB9;
+update t1 set name='U+90CE <CJK>' where ujis=0xCFBA;
+update t1 set name='U+516D <CJK>' where ujis=0xCFBB;
+update t1 set name='U+9E93 <CJK>' where ujis=0xCFBC;
+update t1 set name='U+7984 <CJK>' where ujis=0xCFBD;
+update t1 set name='U+808B <CJK>' where ujis=0xCFBE;
+update t1 set name='U+9332 <CJK>' where ujis=0xCFBF;
+update t1 set name='U+8AD6 <CJK>' where ujis=0xCFC0;
+update t1 set name='U+502D <CJK>' where ujis=0xCFC1;
+update t1 set name='U+548C <CJK>' where ujis=0xCFC2;
+update t1 set name='U+8A71 <CJK>' where ujis=0xCFC3;
+update t1 set name='U+6B6A <CJK>' where ujis=0xCFC4;
+update t1 set name='U+8CC4 <CJK>' where ujis=0xCFC5;
+update t1 set name='U+8107 <CJK>' where ujis=0xCFC6;
+update t1 set name='U+60D1 <CJK>' where ujis=0xCFC7;
+update t1 set name='U+67A0 <CJK>' where ujis=0xCFC8;
+update t1 set name='U+9DF2 <CJK>' where ujis=0xCFC9;
+update t1 set name='U+4E99 <CJK>' where ujis=0xCFCA;
+update t1 set name='U+4E98 <CJK>' where ujis=0xCFCB;
+update t1 set name='U+9C10 <CJK>' where ujis=0xCFCC;
+update t1 set name='U+8A6B <CJK>' where ujis=0xCFCD;
+update t1 set name='U+85C1 <CJK>' where ujis=0xCFCE;
+update t1 set name='U+8568 <CJK>' where ujis=0xCFCF;
+update t1 set name='U+6900 <CJK>' where ujis=0xCFD0;
+update t1 set name='U+6E7E <CJK>' where ujis=0xCFD1;
+update t1 set name='U+7897 <CJK>' where ujis=0xCFD2;
+update t1 set name='U+8155 <CJK>' where ujis=0xCFD3;
+
+#
+# [D0..DF][A1..FE] - all 16*94=1504 codes assigned
+#
+update t1 set name='<CJK>' where ujis >= 0xD0A1 AND ujis <= 0xDFFE;
+
+#
+# [E0..EF][A1..FE] - all codes assigned, 16*94=1504 total
+#
+update t1 set name='<CJK>' where ujis >= 0xE0A1 AND ujis <= 0xEFFE;
+
+#
+# [F0..F3][A1..FE] - all codes assigned, 4*94=376 total
+#
+update t1 set name='<CJK>' where ujis >= 0xF0A1 AND ujis <= 0xF3FE;
+
+# 0xF4xx - six codes assigned
+update t1 set name='U+582F <CJK>' where ujis=0xF4A1;
+update t1 set name='U+69C7 <CJK>' where ujis=0xF4A2;
+update t1 set name='U+9059 <CJK>' where ujis=0xF4A3;
+update t1 set name='U+7464 <CJK>' where ujis=0xF4A4;
+update t1 set name='U+51DC <CJK>' where ujis=0xF4A5;
+update t1 set name='U+7199 <CJK>' where ujis=0xF4A6;
+
+# [F5..FE][A1..FE] - User defined range
+update t1 set name='User defined range #1' where ujis >= 0xF5A1 AND ujis <= 0xFEFE;
+
+
+# A character from the upper half of JIS-X-0201
+# (half-width kana, code set 2)
+# is represented by two bytes:
+# the first being 0x8E,
+# the second in the range 0xA1 - 0xDF.
+# Codes according to:
+# ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/JIS0201.TXT
+
+insert into t1 (ujis,name) values (0x8EA1,'U+FF61 HALFWIDTH IDEOGRAPHIC FULL STOP');
+insert into t1 (ujis,name) values (0x8EA2,'U+FF62 HALFWIDTH LEFT CORNER BRACKET');
+insert into t1 (ujis,name) values (0x8EA3,'U+FF63 HALFWIDTH RIGHT CORNER BRACKET');
+insert into t1 (ujis,name) values (0x8EA4,'U+FF64 HALFWIDTH IDEOGRAPHIC COMMA');
+insert into t1 (ujis,name) values (0x8EA5,'U+FF65 HALFWIDTH KATAKANA MIDDLE DOT');
+insert into t1 (ujis,name) values (0x8EA6,'U+FF66 HALFWIDTH KATAKANA LETTER WO');
+insert into t1 (ujis,name) values (0x8EA7,'U+FF67 HALFWIDTH KATAKANA LETTER SMALL A');
+insert into t1 (ujis,name) values (0x8EA8,'U+FF68 HALFWIDTH KATAKANA LETTER SMALL I');
+insert into t1 (ujis,name) values (0x8EA9,'U+FF69 HALFWIDTH KATAKANA LETTER SMALL U');
+insert into t1 (ujis,name) values (0x8EAA,'U+FF6A HALFWIDTH KATAKANA LETTER SMALL E');
+insert into t1 (ujis,name) values (0x8EAB,'U+FF6B HALFWIDTH KATAKANA LETTER SMALL O');
+insert into t1 (ujis,name) values (0x8EAC,'U+FF6C HALFWIDTH KATAKANA LETTER SMALL YA');
+insert into t1 (ujis,name) values (0x8EAD,'U+FF6D HALFWIDTH KATAKANA LETTER SMALL YU');
+insert into t1 (ujis,name) values (0x8EAE,'U+FF6E HALFWIDTH KATAKANA LETTER SMALL YO');
+insert into t1 (ujis,name) values (0x8EAF,'U+FF6F HALFWIDTH KATAKANA LETTER SMALL TU');
+insert into t1 (ujis,name) values (0x8EB0,'U+FF70 HALFWIDTH KATAKANA-HIRAGANA PROLONGED SOUND MARK');
+insert into t1 (ujis,name) values (0x8EB1,'U+FF71 HALFWIDTH KATAKANA LETTER A');
+insert into t1 (ujis,name) values (0x8EB2,'U+FF72 HALFWIDTH KATAKANA LETTER I');
+insert into t1 (ujis,name) values (0x8EB3,'U+FF73 HALFWIDTH KATAKANA LETTER U');
+insert into t1 (ujis,name) values (0x8EB4,'U+FF74 HALFWIDTH KATAKANA LETTER E');
+insert into t1 (ujis,name) values (0x8EB5,'U+FF75 HALFWIDTH KATAKANA LETTER O');
+insert into t1 (ujis,name) values (0x8EB6,'U+FF76 HALFWIDTH KATAKANA LETTER KA');
+insert into t1 (ujis,name) values (0x8EB7,'U+FF77 HALFWIDTH KATAKANA LETTER KI');
+insert into t1 (ujis,name) values (0x8EB8,'U+FF78 HALFWIDTH KATAKANA LETTER KU');
+insert into t1 (ujis,name) values (0x8EB9,'U+FF79 HALFWIDTH KATAKANA LETTER KE');
+insert into t1 (ujis,name) values (0x8EBA,'U+FF7A HALFWIDTH KATAKANA LETTER KO');
+insert into t1 (ujis,name) values (0x8EBB,'U+FF7B HALFWIDTH KATAKANA LETTER SA');
+insert into t1 (ujis,name) values (0x8EBC,'U+FF7C HALFWIDTH KATAKANA LETTER SI');
+insert into t1 (ujis,name) values (0x8EBD,'U+FF7D HALFWIDTH KATAKANA LETTER SU');
+insert into t1 (ujis,name) values (0x8EBE,'U+FF7E HALFWIDTH KATAKANA LETTER SE');
+insert into t1 (ujis,name) values (0x8EBF,'U+FF7F HALFWIDTH KATAKANA LETTER SO');
+insert into t1 (ujis,name) values (0x8EC0,'U+FF80 HALFWIDTH KATAKANA LETTER TA');
+insert into t1 (ujis,name) values (0x8EC1,'U+FF81 HALFWIDTH KATAKANA LETTER TI');
+insert into t1 (ujis,name) values (0x8EC2,'U+FF82 HALFWIDTH KATAKANA LETTER TU');
+insert into t1 (ujis,name) values (0x8EC3,'U+FF83 HALFWIDTH KATAKANA LETTER TE');
+insert into t1 (ujis,name) values (0x8EC4,'U+FF84 HALFWIDTH KATAKANA LETTER TO');
+insert into t1 (ujis,name) values (0x8EC5,'U+FF85 HALFWIDTH KATAKANA LETTER NA');
+insert into t1 (ujis,name) values (0x8EC6,'U+FF86 HALFWIDTH KATAKANA LETTER NI');
+insert into t1 (ujis,name) values (0x8EC7,'U+FF87 HALFWIDTH KATAKANA LETTER NU');
+insert into t1 (ujis,name) values (0x8EC8,'U+FF88 HALFWIDTH KATAKANA LETTER NE');
+insert into t1 (ujis,name) values (0x8EC9,'U+FF89 HALFWIDTH KATAKANA LETTER NO');
+insert into t1 (ujis,name) values (0x8ECA,'U+FF8A HALFWIDTH KATAKANA LETTER HA');
+insert into t1 (ujis,name) values (0x8ECB,'U+FF8B HALFWIDTH KATAKANA LETTER HI');
+insert into t1 (ujis,name) values (0x8ECC,'U+FF8C HALFWIDTH KATAKANA LETTER HU');
+insert into t1 (ujis,name) values (0x8ECD,'U+FF8D HALFWIDTH KATAKANA LETTER HE');
+insert into t1 (ujis,name) values (0x8ECE,'U+FF8E HALFWIDTH KATAKANA LETTER HO');
+insert into t1 (ujis,name) values (0x8ECF,'U+FF8F HALFWIDTH KATAKANA LETTER MA');
+insert into t1 (ujis,name) values (0x8ED0,'U+FF90 HALFWIDTH KATAKANA LETTER MI');
+insert into t1 (ujis,name) values (0x8ED1,'U+FF91 HALFWIDTH KATAKANA LETTER MU');
+insert into t1 (ujis,name) values (0x8ED2,'U+FF92 HALFWIDTH KATAKANA LETTER ME');
+insert into t1 (ujis,name) values (0x8ED3,'U+FF93 HALFWIDTH KATAKANA LETTER MO');
+insert into t1 (ujis,name) values (0x8ED4,'U+FF94 HALFWIDTH KATAKANA LETTER YA');
+insert into t1 (ujis,name) values (0x8ED5,'U+FF95 HALFWIDTH KATAKANA LETTER YU');
+insert into t1 (ujis,name) values (0x8ED6,'U+FF96 HALFWIDTH KATAKANA LETTER YO');
+insert into t1 (ujis,name) values (0x8ED7,'U+FF97 HALFWIDTH KATAKANA LETTER RA');
+insert into t1 (ujis,name) values (0x8ED8,'U+FF98 HALFWIDTH KATAKANA LETTER RI');
+insert into t1 (ujis,name) values (0x8ED9,'U+FF99 HALFWIDTH KATAKANA LETTER RU');
+insert into t1 (ujis,name) values (0x8EDA,'U+FF9A HALFWIDTH KATAKANA LETTER RE');
+insert into t1 (ujis,name) values (0x8EDB,'U+FF9B HALFWIDTH KATAKANA LETTER RO');
+insert into t1 (ujis,name) values (0x8EDC,'U+FF9C HALFWIDTH KATAKANA LETTER WA');
+insert into t1 (ujis,name) values (0x8EDD,'U+FF9D HALFWIDTH KATAKANA LETTER N');
+insert into t1 (ujis,name) values (0x8EDE,'U+FF9E HALFWIDTH KATAKANA VOICED SOUND MARK');
+insert into t1 (ujis,name) values (0x8EDF,'U+FF9F HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK');
+
+
+#
+# A character from JIS-X-0212 (code set 3)
+# is represented by three bytes,
+# the first being 0x8F,
+# the following two in the range 0xA1 - 0xFE.
+# ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/JIS0212.TXT
+#
+# Fill table t1 with codes [8F][A1..FE][A1..FE] using helper table t2,
+# 8836 codes total
+#
+insert into t1 (ujis) select concat(0x8F,t21.code,t22.code) from t2 t21, t2 t22 order by 1;
+
+update t1 set name='U+02D8 BREVE' where ujis=0x8FA2AF;
+update t1 set name='U+02C7 CARON (Mandarin Chinese third tone)' where ujis=0x8FA2B0;
+update t1 set name='U+00B8 CEDILLA' where ujis=0x8FA2B1;
+update t1 set name='U+02D9 DOT ABOVE (Mandarin Chinese light tone)' where ujis=0x8FA2B2;
+update t1 set name='U+02DD DOUBLE ACUTE ACCENT' where ujis=0x8FA2B3;
+update t1 set name='U+00AF MACRON' where ujis=0x8FA2B4;
+update t1 set name='U+02DB OGONEK' where ujis=0x8FA2B5;
+update t1 set name='U+02DA RING ABOVE' where ujis=0x8FA2B6;
+update t1 set name='U+007E TILDE' where ujis=0x8FA2B7;
+update t1 set name='U+0384 GREEK TONOS' where ujis=0x8FA2B8;
+update t1 set name='U+0385 GREEK DIALYTIKA TONOS' where ujis=0x8FA2B9;
+update t1 set name='U+00A1 INVERTED EXCLAMATION MARK' where ujis=0x8FA2C2;
+update t1 set name='U+00A6 BROKEN BAR' where ujis=0x8FA2C3;
+update t1 set name='U+00BF INVERTED QUESTION MARK' where ujis=0x8FA2C4;
+update t1 set name='U+00BA MASCULINE ORDINAL INDICATOR' where ujis=0x8FA2EB;
+update t1 set name='U+00AA FEMININE ORDINAL INDICATOR' where ujis=0x8FA2EC;
+update t1 set name='U+00A9 COPYRIGHT SIGN' where ujis=0x8FA2ED;
+update t1 set name='U+00AE REGISTERED SIGN' where ujis=0x8FA2EE;
+update t1 set name='U+2122 TRADE MARK SIGN' where ujis=0x8FA2EF;
+update t1 set name='U+00A4 CURRENCY SIGN' where ujis=0x8FA2F0;
+update t1 set name='U+2116 NUMERO SIGN' where ujis=0x8FA2F1;
+update t1 set name='U+0386 GREEK CAPITAL LETTER ALPHA WITH TONOS' where ujis=0x8FA6E1;
+update t1 set name='U+0388 GREEK CAPITAL LETTER EPSILON WITH TONOS' where ujis=0x8FA6E2;
+update t1 set name='U+0389 GREEK CAPITAL LETTER ETA WITH TONOS' where ujis=0x8FA6E3;
+update t1 set name='U+038A GREEK CAPITAL LETTER IOTA WITH TONOS' where ujis=0x8FA6E4;
+update t1 set name='U+03AA GREEK CAPITAL LETTER IOTA WITH DIALYTIKA' where ujis=0x8FA6E5;
+update t1 set name='U+038C GREEK CAPITAL LETTER OMICRON WITH TONOS' where ujis=0x8FA6E7;
+update t1 set name='U+038E GREEK CAPITAL LETTER UPSILON WITH TONOS' where ujis=0x8FA6E9;
+update t1 set name='U+03AB GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA' where ujis=0x8FA6EA;
+update t1 set name='U+038F GREEK CAPITAL LETTER OMEGA WITH TONOS' where ujis=0x8FA6EC;
+update t1 set name='U+03AC GREEK SMALL LETTER ALPHA WITH TONOS' where ujis=0x8FA6F1;
+update t1 set name='U+03AD GREEK SMALL LETTER EPSILON WITH TONOS' where ujis=0x8FA6F2;
+update t1 set name='U+03AE GREEK SMALL LETTER ETA WITH TONOS' where ujis=0x8FA6F3;
+update t1 set name='U+03AF GREEK SMALL LETTER IOTA WITH TONOS' where ujis=0x8FA6F4;
+update t1 set name='U+03CA GREEK SMALL LETTER IOTA WITH DIALYTIKA' where ujis=0x8FA6F5;
+update t1 set name='U+0390 GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS' where ujis=0x8FA6F6;
+update t1 set name='U+03CC GREEK SMALL LETTER OMICRON WITH TONOS' where ujis=0x8FA6F7;
+update t1 set name='U+03C2 GREEK SMALL LETTER FINAL SIGMA' where ujis=0x8FA6F8;
+update t1 set name='U+03CD GREEK SMALL LETTER UPSILON WITH TONOS' where ujis=0x8FA6F9;
+update t1 set name='U+03CB GREEK SMALL LETTER UPSILON WITH DIALYTIKA' where ujis=0x8FA6FA;
+update t1 set name='U+03B0 GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS' where ujis=0x8FA6FB;
+update t1 set name='U+03CE GREEK SMALL LETTER OMEGA WITH TONOS' where ujis=0x8FA6FC;
+update t1 set name='U+0402 CYRILLIC CAPITAL LETTER DJE' where ujis=0x8FA7C2;
+update t1 set name='U+0403 CYRILLIC CAPITAL LETTER GJE' where ujis=0x8FA7C3;
+update t1 set name='U+0404 CYRILLIC CAPITAL LETTER UKRAINIAN IE' where ujis=0x8FA7C4;
+update t1 set name='U+0405 CYRILLIC CAPITAL LETTER DZE' where ujis=0x8FA7C5;
+update t1 set name='U+0406 CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I' where ujis=0x8FA7C6;
+update t1 set name='U+0407 CYRILLIC CAPITAL LETTER YI' where ujis=0x8FA7C7;
+update t1 set name='U+0408 CYRILLIC CAPITAL LETTER JE' where ujis=0x8FA7C8;
+update t1 set name='U+0409 CYRILLIC CAPITAL LETTER LJE' where ujis=0x8FA7C9;
+update t1 set name='U+040A CYRILLIC CAPITAL LETTER NJE' where ujis=0x8FA7CA;
+update t1 set name='U+040B CYRILLIC CAPITAL LETTER TSHE' where ujis=0x8FA7CB;
+update t1 set name='U+040C CYRILLIC CAPITAL LETTER KJE' where ujis=0x8FA7CC;
+update t1 set name='U+040E CYRILLIC CAPITAL LETTER SHORT U' where ujis=0x8FA7CD;
+update t1 set name='U+040F CYRILLIC CAPITAL LETTER DZHE' where ujis=0x8FA7CE;
+update t1 set name='U+0452 CYRILLIC SMALL LETTER DJE' where ujis=0x8FA7F2;
+update t1 set name='U+0453 CYRILLIC SMALL LETTER GJE' where ujis=0x8FA7F3;
+update t1 set name='U+0454 CYRILLIC SMALL LETTER UKRAINIAN IE' where ujis=0x8FA7F4;
+update t1 set name='U+0455 CYRILLIC SMALL LETTER DZE' where ujis=0x8FA7F5;
+update t1 set name='U+0456 CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I' where ujis=0x8FA7F6;
+update t1 set name='U+0457 CYRILLIC SMALL LETTER YI' where ujis=0x8FA7F7;
+update t1 set name='U+0458 CYRILLIC SMALL LETTER JE' where ujis=0x8FA7F8;
+update t1 set name='U+0459 CYRILLIC SMALL LETTER LJE' where ujis=0x8FA7F9;
+update t1 set name='U+045A CYRILLIC SMALL LETTER NJE' where ujis=0x8FA7FA;
+update t1 set name='U+045B CYRILLIC SMALL LETTER TSHE' where ujis=0x8FA7FB;
+update t1 set name='U+045C CYRILLIC SMALL LETTER KJE' where ujis=0x8FA7FC;
+update t1 set name='U+045E CYRILLIC SMALL LETTER SHORT U' where ujis=0x8FA7FD;
+update t1 set name='U+045F CYRILLIC SMALL LETTER DZHE' where ujis=0x8FA7FE;
+update t1 set name='U+00C6 LATIN CAPITAL LIGATURE AE' where ujis=0x8FA9A1;
+update t1 set name='U+0110 LATIN CAPITAL LETTER D WITH STROKE' where ujis=0x8FA9A2;
+update t1 set name='U+0126 LATIN CAPITAL LETTER H WITH STROKE' where ujis=0x8FA9A4;
+update t1 set name='U+0132 LATIN CAPITAL LIGATURE IJ' where ujis=0x8FA9A6;
+update t1 set name='U+0141 LATIN CAPITAL LETTER L WITH STROKE' where ujis=0x8FA9A8;
+update t1 set name='U+013F LATIN CAPITAL LETTER L WITH MIDDLE DOT' where ujis=0x8FA9A9;
+update t1 set name='U+014A LATIN CAPITAL LETTER ENG' where ujis=0x8FA9AB;
+update t1 set name='U+00D8 LATIN CAPITAL LETTER O WITH STROKE' where ujis=0x8FA9AC;
+update t1 set name='U+0152 LATIN CAPITAL LIGATURE OE' where ujis=0x8FA9AD;
+update t1 set name='U+0166 LATIN CAPITAL LETTER T WITH STROKE' where ujis=0x8FA9AF;
+update t1 set name='U+00DE LATIN CAPITAL LETTER THORN' where ujis=0x8FA9B0;
+update t1 set name='U+00E6 LATIN SMALL LIGATURE AE' where ujis=0x8FA9C1;
+update t1 set name='U+0111 LATIN SMALL LETTER D WITH STROKE' where ujis=0x8FA9C2;
+update t1 set name='U+00F0 LATIN SMALL LETTER ETH' where ujis=0x8FA9C3;
+update t1 set name='U+0127 LATIN SMALL LETTER H WITH STROKE' where ujis=0x8FA9C4;
+update t1 set name='U+0131 LATIN SMALL LETTER DOTLESS I' where ujis=0x8FA9C5;
+update t1 set name='U+0133 LATIN SMALL LIGATURE IJ' where ujis=0x8FA9C6;
+update t1 set name='U+0138 LATIN SMALL LETTER KRA' where ujis=0x8FA9C7;
+update t1 set name='U+0142 LATIN SMALL LETTER L WITH STROKE' where ujis=0x8FA9C8;
+update t1 set name='U+0140 LATIN SMALL LETTER L WITH MIDDLE DOT' where ujis=0x8FA9C9;
+update t1 set name='U+0149 LATIN SMALL LETTER N PRECEDED BY APOSTROPHE' where ujis=0x8FA9CA;
+update t1 set name='U+014B LATIN SMALL LETTER ENG' where ujis=0x8FA9CB;
+update t1 set name='U+00F8 LATIN SMALL LETTER O WITH STROKE' where ujis=0x8FA9CC;
+update t1 set name='U+0153 LATIN SMALL LIGATURE OE' where ujis=0x8FA9CD;
+update t1 set name='U+00DF LATIN SMALL LETTER SHARP S' where ujis=0x8FA9CE;
+update t1 set name='U+0167 LATIN SMALL LETTER T WITH STROKE' where ujis=0x8FA9CF;
+update t1 set name='U+00FE LATIN SMALL LETTER THORN' where ujis=0x8FA9D0;
+update t1 set name='U+00C1 LATIN CAPITAL LETTER A WITH ACUTE' where ujis=0x8FAAA1;
+update t1 set name='U+00C0 LATIN CAPITAL LETTER A WITH GRAVE' where ujis=0x8FAAA2;
+update t1 set name='U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS' where ujis=0x8FAAA3;
+update t1 set name='U+00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX' where ujis=0x8FAAA4;
+update t1 set name='U+0102 LATIN CAPITAL LETTER A WITH BREVE' where ujis=0x8FAAA5;
+update t1 set name='U+01CD LATIN CAPITAL LETTER A WITH CARON' where ujis=0x8FAAA6;
+update t1 set name='U+0100 LATIN CAPITAL LETTER A WITH MACRON' where ujis=0x8FAAA7;
+update t1 set name='U+0104 LATIN CAPITAL LETTER A WITH OGONEK' where ujis=0x8FAAA8;
+update t1 set name='U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE' where ujis=0x8FAAA9;
+update t1 set name='U+00C3 LATIN CAPITAL LETTER A WITH TILDE' where ujis=0x8FAAAA;
+update t1 set name='U+0106 LATIN CAPITAL LETTER C WITH ACUTE' where ujis=0x8FAAAB;
+update t1 set name='U+0108 LATIN CAPITAL LETTER C WITH CIRCUMFLEX' where ujis=0x8FAAAC;
+update t1 set name='U+010C LATIN CAPITAL LETTER C WITH CARON' where ujis=0x8FAAAD;
+update t1 set name='U+00C7 LATIN CAPITAL LETTER C WITH CEDILLA' where ujis=0x8FAAAE;
+update t1 set name='U+010A LATIN CAPITAL LETTER C WITH DOT ABOVE' where ujis=0x8FAAAF;
+update t1 set name='U+010E LATIN CAPITAL LETTER D WITH CARON' where ujis=0x8FAAB0;
+update t1 set name='U+00C9 LATIN CAPITAL LETTER E WITH ACUTE' where ujis=0x8FAAB1;
+update t1 set name='U+00C8 LATIN CAPITAL LETTER E WITH GRAVE' where ujis=0x8FAAB2;
+update t1 set name='U+00CB LATIN CAPITAL LETTER E WITH DIAERESIS' where ujis=0x8FAAB3;
+update t1 set name='U+00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX' where ujis=0x8FAAB4;
+update t1 set name='U+011A LATIN CAPITAL LETTER E WITH CARON' where ujis=0x8FAAB5;
+update t1 set name='U+0116 LATIN CAPITAL LETTER E WITH DOT ABOVE' where ujis=0x8FAAB6;
+update t1 set name='U+0112 LATIN CAPITAL LETTER E WITH MACRON' where ujis=0x8FAAB7;
+update t1 set name='U+0118 LATIN CAPITAL LETTER E WITH OGONEK' where ujis=0x8FAAB8;
+update t1 set name='U+011C LATIN CAPITAL LETTER G WITH CIRCUMFLEX' where ujis=0x8FAABA;
+update t1 set name='U+011E LATIN CAPITAL LETTER G WITH BREVE' where ujis=0x8FAABB;
+update t1 set name='U+0122 LATIN CAPITAL LETTER G WITH CEDILLA' where ujis=0x8FAABC;
+update t1 set name='U+0120 LATIN CAPITAL LETTER G WITH DOT ABOVE' where ujis=0x8FAABD;
+update t1 set name='U+0124 LATIN CAPITAL LETTER H WITH CIRCUMFLEX' where ujis=0x8FAABE;
+update t1 set name='U+00CD LATIN CAPITAL LETTER I WITH ACUTE' where ujis=0x8FAABF;
+update t1 set name='U+00CC LATIN CAPITAL LETTER I WITH GRAVE' where ujis=0x8FAAC0;
+update t1 set name='U+00CF LATIN CAPITAL LETTER I WITH DIAERESIS' where ujis=0x8FAAC1;
+update t1 set name='U+00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX' where ujis=0x8FAAC2;
+update t1 set name='U+01CF LATIN CAPITAL LETTER I WITH CARON' where ujis=0x8FAAC3;
+update t1 set name='U+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE' where ujis=0x8FAAC4;
+update t1 set name='U+012A LATIN CAPITAL LETTER I WITH MACRON' where ujis=0x8FAAC5;
+update t1 set name='U+012E LATIN CAPITAL LETTER I WITH OGONEK' where ujis=0x8FAAC6;
+update t1 set name='U+0128 LATIN CAPITAL LETTER I WITH TILDE' where ujis=0x8FAAC7;
+update t1 set name='U+0134 LATIN CAPITAL LETTER J WITH CIRCUMFLEX' where ujis=0x8FAAC8;
+update t1 set name='U+0136 LATIN CAPITAL LETTER K WITH CEDILLA' where ujis=0x8FAAC9;
+update t1 set name='U+0139 LATIN CAPITAL LETTER L WITH ACUTE' where ujis=0x8FAACA;
+update t1 set name='U+013D LATIN CAPITAL LETTER L WITH CARON' where ujis=0x8FAACB;
+update t1 set name='U+013B LATIN CAPITAL LETTER L WITH CEDILLA' where ujis=0x8FAACC;
+update t1 set name='U+0143 LATIN CAPITAL LETTER N WITH ACUTE' where ujis=0x8FAACD;
+update t1 set name='U+0147 LATIN CAPITAL LETTER N WITH CARON' where ujis=0x8FAACE;
+update t1 set name='U+0145 LATIN CAPITAL LETTER N WITH CEDILLA' where ujis=0x8FAACF;
+update t1 set name='U+00D1 LATIN CAPITAL LETTER N WITH TILDE' where ujis=0x8FAAD0;
+update t1 set name='U+00D3 LATIN CAPITAL LETTER O WITH ACUTE' where ujis=0x8FAAD1;
+update t1 set name='U+00D2 LATIN CAPITAL LETTER O WITH GRAVE' where ujis=0x8FAAD2;
+update t1 set name='U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS' where ujis=0x8FAAD3;
+update t1 set name='U+00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX' where ujis=0x8FAAD4;
+update t1 set name='U+01D1 LATIN CAPITAL LETTER O WITH CARON' where ujis=0x8FAAD5;
+update t1 set name='U+0150 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE' where ujis=0x8FAAD6;
+update t1 set name='U+014C LATIN CAPITAL LETTER O WITH MACRON' where ujis=0x8FAAD7;
+update t1 set name='U+00D5 LATIN CAPITAL LETTER O WITH TILDE' where ujis=0x8FAAD8;
+update t1 set name='U+0154 LATIN CAPITAL LETTER R WITH ACUTE' where ujis=0x8FAAD9;
+update t1 set name='U+0158 LATIN CAPITAL LETTER R WITH CARON' where ujis=0x8FAADA;
+update t1 set name='U+0156 LATIN CAPITAL LETTER R WITH CEDILLA' where ujis=0x8FAADB;
+update t1 set name='U+015A LATIN CAPITAL LETTER S WITH ACUTE' where ujis=0x8FAADC;
+update t1 set name='U+015C LATIN CAPITAL LETTER S WITH CIRCUMFLEX' where ujis=0x8FAADD;
+update t1 set name='U+0160 LATIN CAPITAL LETTER S WITH CARON' where ujis=0x8FAADE;
+update t1 set name='U+015E LATIN CAPITAL LETTER S WITH CEDILLA' where ujis=0x8FAADF;
+update t1 set name='U+0164 LATIN CAPITAL LETTER T WITH CARON' where ujis=0x8FAAE0;
+update t1 set name='U+0162 LATIN CAPITAL LETTER T WITH CEDILLA' where ujis=0x8FAAE1;
+update t1 set name='U+00DA LATIN CAPITAL LETTER U WITH ACUTE' where ujis=0x8FAAE2;
+update t1 set name='U+00D9 LATIN CAPITAL LETTER U WITH GRAVE' where ujis=0x8FAAE3;
+update t1 set name='U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS' where ujis=0x8FAAE4;
+update t1 set name='U+00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX' where ujis=0x8FAAE5;
+update t1 set name='U+016C LATIN CAPITAL LETTER U WITH BREVE' where ujis=0x8FAAE6;
+update t1 set name='U+01D3 LATIN CAPITAL LETTER U WITH CARON' where ujis=0x8FAAE7;
+update t1 set name='U+0170 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE' where ujis=0x8FAAE8;
+update t1 set name='U+016A LATIN CAPITAL LETTER U WITH MACRON' where ujis=0x8FAAE9;
+update t1 set name='U+0172 LATIN CAPITAL LETTER U WITH OGONEK' where ujis=0x8FAAEA;
+update t1 set name='U+016E LATIN CAPITAL LETTER U WITH RING ABOVE' where ujis=0x8FAAEB;
+update t1 set name='U+0168 LATIN CAPITAL LETTER U WITH TILDE' where ujis=0x8FAAEC;
+update t1 set name='U+01D7 LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE' where ujis=0x8FAAED;
+update t1 set name='U+01DB LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE' where ujis=0x8FAAEE;
+update t1 set name='U+01D9 LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON' where ujis=0x8FAAEF;
+update t1 set name='U+01D5 LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON' where ujis=0x8FAAF0;
+update t1 set name='U+0174 LATIN CAPITAL LETTER W WITH CIRCUMFLEX' where ujis=0x8FAAF1;
+update t1 set name='U+00DD LATIN CAPITAL LETTER Y WITH ACUTE' where ujis=0x8FAAF2;
+update t1 set name='U+0178 LATIN CAPITAL LETTER Y WITH DIAERESIS' where ujis=0x8FAAF3;
+update t1 set name='U+0176 LATIN CAPITAL LETTER Y WITH CIRCUMFLEX' where ujis=0x8FAAF4;
+update t1 set name='U+0179 LATIN CAPITAL LETTER Z WITH ACUTE' where ujis=0x8FAAF5;
+update t1 set name='U+017D LATIN CAPITAL LETTER Z WITH CARON' where ujis=0x8FAAF6;
+update t1 set name='U+017B LATIN CAPITAL LETTER Z WITH DOT ABOVE' where ujis=0x8FAAF7;
+update t1 set name='U+00E1 LATIN SMALL LETTER A WITH ACUTE' where ujis=0x8FABA1;
+update t1 set name='U+00E0 LATIN SMALL LETTER A WITH GRAVE' where ujis=0x8FABA2;
+update t1 set name='U+00E4 LATIN SMALL LETTER A WITH DIAERESIS' where ujis=0x8FABA3;
+update t1 set name='U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX' where ujis=0x8FABA4;
+update t1 set name='U+0103 LATIN SMALL LETTER A WITH BREVE' where ujis=0x8FABA5;
+update t1 set name='U+01CE LATIN SMALL LETTER A WITH CARON' where ujis=0x8FABA6;
+update t1 set name='U+0101 LATIN SMALL LETTER A WITH MACRON' where ujis=0x8FABA7;
+update t1 set name='U+0105 LATIN SMALL LETTER A WITH OGONEK' where ujis=0x8FABA8;
+update t1 set name='U+00E5 LATIN SMALL LETTER A WITH RING ABOVE' where ujis=0x8FABA9;
+update t1 set name='U+00E3 LATIN SMALL LETTER A WITH TILDE' where ujis=0x8FABAA;
+update t1 set name='U+0107 LATIN SMALL LETTER C WITH ACUTE' where ujis=0x8FABAB;
+update t1 set name='U+0109 LATIN SMALL LETTER C WITH CIRCUMFLEX' where ujis=0x8FABAC;
+update t1 set name='U+010D LATIN SMALL LETTER C WITH CARON' where ujis=0x8FABAD;
+update t1 set name='U+00E7 LATIN SMALL LETTER C WITH CEDILLA' where ujis=0x8FABAE;
+update t1 set name='U+010B LATIN SMALL LETTER C WITH DOT ABOVE' where ujis=0x8FABAF;
+update t1 set name='U+010F LATIN SMALL LETTER D WITH CARON' where ujis=0x8FABB0;
+update t1 set name='U+00E9 LATIN SMALL LETTER E WITH ACUTE' where ujis=0x8FABB1;
+update t1 set name='U+00E8 LATIN SMALL LETTER E WITH GRAVE' where ujis=0x8FABB2;
+update t1 set name='U+00EB LATIN SMALL LETTER E WITH DIAERESIS' where ujis=0x8FABB3;
+update t1 set name='U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX' where ujis=0x8FABB4;
+update t1 set name='U+011B LATIN SMALL LETTER E WITH CARON' where ujis=0x8FABB5;
+update t1 set name='U+0117 LATIN SMALL LETTER E WITH DOT ABOVE' where ujis=0x8FABB6;
+update t1 set name='U+0113 LATIN SMALL LETTER E WITH MACRON' where ujis=0x8FABB7;
+update t1 set name='U+0119 LATIN SMALL LETTER E WITH OGONEK' where ujis=0x8FABB8;
+update t1 set name='U+01F5 LATIN SMALL LETTER G WITH ACUTE' where ujis=0x8FABB9;
+update t1 set name='U+011D LATIN SMALL LETTER G WITH CIRCUMFLEX' where ujis=0x8FABBA;
+update t1 set name='U+011F LATIN SMALL LETTER G WITH BREVE' where ujis=0x8FABBB;
+update t1 set name='U+0121 LATIN SMALL LETTER G WITH DOT ABOVE' where ujis=0x8FABBD;
+update t1 set name='U+0125 LATIN SMALL LETTER H WITH CIRCUMFLEX' where ujis=0x8FABBE;
+update t1 set name='U+00ED LATIN SMALL LETTER I WITH ACUTE' where ujis=0x8FABBF;
+update t1 set name='U+00EC LATIN SMALL LETTER I WITH GRAVE' where ujis=0x8FABC0;
+update t1 set name='U+00EF LATIN SMALL LETTER I WITH DIAERESIS' where ujis=0x8FABC1;
+update t1 set name='U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX' where ujis=0x8FABC2;
+update t1 set name='U+01D0 LATIN SMALL LETTER I WITH CARON' where ujis=0x8FABC3;
+update t1 set name='U+012B LATIN SMALL LETTER I WITH MACRON' where ujis=0x8FABC5;
+update t1 set name='U+012F LATIN SMALL LETTER I WITH OGONEK' where ujis=0x8FABC6;
+update t1 set name='U+0129 LATIN SMALL LETTER I WITH TILDE' where ujis=0x8FABC7;
+update t1 set name='U+0135 LATIN SMALL LETTER J WITH CIRCUMFLEX' where ujis=0x8FABC8;
+update t1 set name='U+0137 LATIN SMALL LETTER K WITH CEDILLA' where ujis=0x8FABC9;
+update t1 set name='U+013A LATIN SMALL LETTER L WITH ACUTE' where ujis=0x8FABCA;
+update t1 set name='U+013E LATIN SMALL LETTER L WITH CARON' where ujis=0x8FABCB;
+update t1 set name='U+013C LATIN SMALL LETTER L WITH CEDILLA' where ujis=0x8FABCC;
+update t1 set name='U+0144 LATIN SMALL LETTER N WITH ACUTE' where ujis=0x8FABCD;
+update t1 set name='U+0148 LATIN SMALL LETTER N WITH CARON' where ujis=0x8FABCE;
+update t1 set name='U+0146 LATIN SMALL LETTER N WITH CEDILLA' where ujis=0x8FABCF;
+update t1 set name='U+00F1 LATIN SMALL LETTER N WITH TILDE' where ujis=0x8FABD0;
+update t1 set name='U+00F3 LATIN SMALL LETTER O WITH ACUTE' where ujis=0x8FABD1;
+update t1 set name='U+00F2 LATIN SMALL LETTER O WITH GRAVE' where ujis=0x8FABD2;
+update t1 set name='U+00F6 LATIN SMALL LETTER O WITH DIAERESIS' where ujis=0x8FABD3;
+update t1 set name='U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX' where ujis=0x8FABD4;
+update t1 set name='U+01D2 LATIN SMALL LETTER O WITH CARON' where ujis=0x8FABD5;
+update t1 set name='U+0151 LATIN SMALL LETTER O WITH DOUBLE ACUTE' where ujis=0x8FABD6;
+update t1 set name='U+014D LATIN SMALL LETTER O WITH MACRON' where ujis=0x8FABD7;
+update t1 set name='U+00F5 LATIN SMALL LETTER O WITH TILDE' where ujis=0x8FABD8;
+update t1 set name='U+0155 LATIN SMALL LETTER R WITH ACUTE' where ujis=0x8FABD9;
+update t1 set name='U+0159 LATIN SMALL LETTER R WITH CARON' where ujis=0x8FABDA;
+update t1 set name='U+0157 LATIN SMALL LETTER R WITH CEDILLA' where ujis=0x8FABDB;
+update t1 set name='U+015B LATIN SMALL LETTER S WITH ACUTE' where ujis=0x8FABDC;
+update t1 set name='U+015D LATIN SMALL LETTER S WITH CIRCUMFLEX' where ujis=0x8FABDD;
+update t1 set name='U+0161 LATIN SMALL LETTER S WITH CARON' where ujis=0x8FABDE;
+update t1 set name='U+015F LATIN SMALL LETTER S WITH CEDILLA' where ujis=0x8FABDF;
+update t1 set name='U+0165 LATIN SMALL LETTER T WITH CARON' where ujis=0x8FABE0;
+update t1 set name='U+0163 LATIN SMALL LETTER T WITH CEDILLA' where ujis=0x8FABE1;
+update t1 set name='U+00FA LATIN SMALL LETTER U WITH ACUTE' where ujis=0x8FABE2;
+update t1 set name='U+00F9 LATIN SMALL LETTER U WITH GRAVE' where ujis=0x8FABE3;
+update t1 set name='U+00FC LATIN SMALL LETTER U WITH DIAERESIS' where ujis=0x8FABE4;
+update t1 set name='U+00FB LATIN SMALL LETTER U WITH CIRCUMFLEX' where ujis=0x8FABE5;
+update t1 set name='U+016D LATIN SMALL LETTER U WITH BREVE' where ujis=0x8FABE6;
+update t1 set name='U+01D4 LATIN SMALL LETTER U WITH CARON' where ujis=0x8FABE7;
+update t1 set name='U+0171 LATIN SMALL LETTER U WITH DOUBLE ACUTE' where ujis=0x8FABE8;
+update t1 set name='U+016B LATIN SMALL LETTER U WITH MACRON' where ujis=0x8FABE9;
+update t1 set name='U+0173 LATIN SMALL LETTER U WITH OGONEK' where ujis=0x8FABEA;
+update t1 set name='U+016F LATIN SMALL LETTER U WITH RING ABOVE' where ujis=0x8FABEB;
+update t1 set name='U+0169 LATIN SMALL LETTER U WITH TILDE' where ujis=0x8FABEC;
+update t1 set name='U+01D8 LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE' where ujis=0x8FABED;
+update t1 set name='U+01DC LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE' where ujis=0x8FABEE;
+update t1 set name='U+01DA LATIN SMALL LETTER U WITH DIAERESIS AND CARON' where ujis=0x8FABEF;
+update t1 set name='U+01D6 LATIN SMALL LETTER U WITH DIAERESIS AND MACRON' where ujis=0x8FABF0;
+update t1 set name='U+0175 LATIN SMALL LETTER W WITH CIRCUMFLEX' where ujis=0x8FABF1;
+update t1 set name='U+00FD LATIN SMALL LETTER Y WITH ACUTE' where ujis=0x8FABF2;
+update t1 set name='U+00FF LATIN SMALL LETTER Y WITH DIAERESIS' where ujis=0x8FABF3;
+update t1 set name='U+0177 LATIN SMALL LETTER Y WITH CIRCUMFLEX' where ujis=0x8FABF4;
+update t1 set name='U+017A LATIN SMALL LETTER Z WITH ACUTE' where ujis=0x8FABF5;
+update t1 set name='U+017E LATIN SMALL LETTER Z WITH CARON' where ujis=0x8FABF6;
+update t1 set name='U+017C LATIN SMALL LETTER Z WITH DOT ABOVE' where ujis=0x8FABF7;
+
+# [8F][B0..BF][A1..FE] - all 16*94=1504 codes assigned
+update t1 set name='<CJK>' where ujis >= 0x8FB0A1 AND ujis <= 0x8FBFFE;
+
+# [8F][C0..CF][A1..FE] - all 16*94=1504 codes assigned
+update t1 set name='<CJK>' where ujis >= 0x8FC0A1 AND ujis <= 0x8FCFFE;
+
+# [8F][D0..DF][A1..FE] - all 16*94=1504 codes assigned
+update t1 set name='<CJK>' where ujis >= 0x8FD0A1 AND ujis <= 0x8FDFFE;
+
+# [8F][E0..EC][A1..FE] - all 13*94=1222 codes assigned
+update t1 set name='<CJK>' where ujis >= 0x8FE0A1 AND ujis <= 0x8FECFE;
+
+#
+update t1 set name='U+9EF8 <CJK>' where ujis=0x8FEDA1;
+update t1 set name='U+9EFF <CJK>' where ujis=0x8FEDA2;
+update t1 set name='U+9F02 <CJK>' where ujis=0x8FEDA3;
+update t1 set name='U+9F03 <CJK>' where ujis=0x8FEDA4;
+update t1 set name='U+9F09 <CJK>' where ujis=0x8FEDA5;
+update t1 set name='U+9F0F <CJK>' where ujis=0x8FEDA6;
+update t1 set name='U+9F10 <CJK>' where ujis=0x8FEDA7;
+update t1 set name='U+9F11 <CJK>' where ujis=0x8FEDA8;
+update t1 set name='U+9F12 <CJK>' where ujis=0x8FEDA9;
+update t1 set name='U+9F14 <CJK>' where ujis=0x8FEDAA;
+update t1 set name='U+9F16 <CJK>' where ujis=0x8FEDAB;
+update t1 set name='U+9F17 <CJK>' where ujis=0x8FEDAC;
+update t1 set name='U+9F19 <CJK>' where ujis=0x8FEDAD;
+update t1 set name='U+9F1A <CJK>' where ujis=0x8FEDAE;
+update t1 set name='U+9F1B <CJK>' where ujis=0x8FEDAF;
+
+update t1 set name='U+9F1F <CJK>' where ujis=0x8FEDB0;
+update t1 set name='U+9F22 <CJK>' where ujis=0x8FEDB1;
+update t1 set name='U+9F26 <CJK>' where ujis=0x8FEDB2;
+update t1 set name='U+9F2A <CJK>' where ujis=0x8FEDB3;
+update t1 set name='U+9F2B <CJK>' where ujis=0x8FEDB4;
+update t1 set name='U+9F2F <CJK>' where ujis=0x8FEDB5;
+update t1 set name='U+9F31 <CJK>' where ujis=0x8FEDB6;
+update t1 set name='U+9F32 <CJK>' where ujis=0x8FEDB7;
+update t1 set name='U+9F34 <CJK>' where ujis=0x8FEDB8;
+update t1 set name='U+9F37 <CJK>' where ujis=0x8FEDB9;
+update t1 set name='U+9F39 <CJK>' where ujis=0x8FEDBA;
+update t1 set name='U+9F3A <CJK>' where ujis=0x8FEDBB;
+update t1 set name='U+9F3C <CJK>' where ujis=0x8FEDBC;
+update t1 set name='U+9F3D <CJK>' where ujis=0x8FEDBD;
+update t1 set name='U+9F3F <CJK>' where ujis=0x8FEDBE;
+update t1 set name='U+9F41 <CJK>' where ujis=0x8FEDBF;
+
+update t1 set name='U+9F43 <CJK>' where ujis=0x8FEDC0;
+update t1 set name='U+9F44 <CJK>' where ujis=0x8FEDC1;
+update t1 set name='U+9F45 <CJK>' where ujis=0x8FEDC2;
+update t1 set name='U+9F46 <CJK>' where ujis=0x8FEDC3;
+update t1 set name='U+9F47 <CJK>' where ujis=0x8FEDC4;
+update t1 set name='U+9F53 <CJK>' where ujis=0x8FEDC5;
+update t1 set name='U+9F55 <CJK>' where ujis=0x8FEDC6;
+update t1 set name='U+9F56 <CJK>' where ujis=0x8FEDC7;
+update t1 set name='U+9F57 <CJK>' where ujis=0x8FEDC8;
+update t1 set name='U+9F58 <CJK>' where ujis=0x8FEDC9;
+update t1 set name='U+9F5A <CJK>' where ujis=0x8FEDCA;
+update t1 set name='U+9F5D <CJK>' where ujis=0x8FEDCB;
+update t1 set name='U+9F5E <CJK>' where ujis=0x8FEDCC;
+update t1 set name='U+9F68 <CJK>' where ujis=0x8FEDCD;
+update t1 set name='U+9F69 <CJK>' where ujis=0x8FEDCE;
+update t1 set name='U+9F6D <CJK>' where ujis=0x8FEDCF;
+
+update t1 set name='U+9F6E <CJK>' where ujis=0x8FEDD0;
+update t1 set name='U+9F6F <CJK>' where ujis=0x8FEDD1;
+update t1 set name='U+9F70 <CJK>' where ujis=0x8FEDD2;
+update t1 set name='U+9F71 <CJK>' where ujis=0x8FEDD3;
+update t1 set name='U+9F73 <CJK>' where ujis=0x8FEDD4;
+update t1 set name='U+9F75 <CJK>' where ujis=0x8FEDD5;
+update t1 set name='U+9F7A <CJK>' where ujis=0x8FEDD6;
+update t1 set name='U+9F7D <CJK>' where ujis=0x8FEDD7;
+update t1 set name='U+9F8F <CJK>' where ujis=0x8FEDD8;
+update t1 set name='U+9F90 <CJK>' where ujis=0x8FEDD9;
+update t1 set name='U+9F91 <CJK>' where ujis=0x8FEDDA;
+update t1 set name='U+9F92 <CJK>' where ujis=0x8FEDDB;
+update t1 set name='U+9F94 <CJK>' where ujis=0x8FEDDC;
+update t1 set name='U+9F96 <CJK>' where ujis=0x8FEDDD;
+update t1 set name='U+9F97 <CJK>' where ujis=0x8FEDDE;
+update t1 set name='U+9F9E <CJK>' where ujis=0x8FEDDF;
+
+update t1 set name='U+9FA1 <CJK>' where ujis=0x8FEDE0;
+update t1 set name='U+9FA2 <CJK>' where ujis=0x8FEDE1;
+update t1 set name='U+9FA3 <CJK>' where ujis=0x8FEDE2;
+update t1 set name='U+9FA5 <CJK>' where ujis=0x8FEDE3;
+
+# [8F][F5..FE][A1..FE] - User defined range
+update t1 set name='User defined range #2' where ujis >= 0x8FF5A1 and ujis <= 0x8FFEFE;
+
+# Other characters are not assigned
+update t1 set name='UNASSIGNED' where name='';
+
+update t1 set ucs2=ujis, ujis2=ucs2;
+--echo Characters with safe Unicode round trip
+select hex(ujis), hex(ucs2), hex(ujis2), name from t1 where ujis=ujis2 order by ujis;
+--echo Characters with unsafe Unicode round trip
+select hex(ujis), hex(ucs2), hex(ujis2), name from t1 where ujis<>ujis2 order by ujis;
+drop table t1;
+
+drop table t2;
+
+#
+# Tricky characters, which have different mapping
+# in various euc-jp versions. See WL#1820 for details.
+#
+create table t1 (
+ ujis varchar(1) character set ujis,
+ name varchar(64),
+ ucs2 varchar(1) character set ucs2,
+ ujis2 varchar(1) character set ujis
+);
+insert into t1 (ujis,name) values (0x5C, 'U+005C REVERSE SOLIDUS');
+insert into t1 (ujis,name) values (0x7E, 'U+007E TILDE');
+insert into t1 (ujis,name) values (0xA1B1, 'U+FFE3 FULLWIDTH MACRON');
+insert into t1 (ujis,name) values (0xA1BD, 'U+2015 HORIZONTAL BAR');
+insert into t1 (ujis,name) values (0xA1C0, 'U+005C REVERSE SOLIDUS');
+insert into t1 (ujis,name) values (0xA1C1, 'U+301C WAVE DASH');
+insert into t1 (ujis,name) values (0xA1C2, 'U+2016 DOUBLE VERTICAL LINE');
+insert into t1 (ujis,name) values (0xA1DD, 'U+2212 MINUS SIGN');
+insert into t1 (ujis,name) values (0xA1F1, 'U+00A2 CENT SIGN');
+insert into t1 (ujis,name) values (0xA1F2, 'U+00A3 POUND SIGN');
+insert into t1 (ujis,name) values (0xA1EF, 'U+FFE5 FULLWIDTH YEN SIGN');
+insert into t1 (ujis,name) values (0xA2CC, 'U+00AC NOT SIGN');
+insert into t1 (ujis,name) values (0x8FA2B7, 'U+007E TILDE');
+insert into t1 (ujis,name) values (0x8FA2C3, 'U+00A6 BROKEN BAR');
+update t1 set ucs2=ujis, ujis2=ucs2;
+select hex(ujis), hex(ucs2), hex(ujis2), name from t1;
+drop table t1;
+
+#
+# Unicode characters which are not in x-eucjp-unicode-0.9
+#
+create table t1 (
+ ujis char(1) character set ujis,
+ ucs2 char(1) character set ucs2,
+ name char(64)
+);
+insert into t1 (ucs2,name) values (0x00A5,'U+00A5 YEN SIGN');
+insert into t1 (ucs2,name) values (0x2014,'U+2014 EM DASH');
+insert into t1 (ucs2,name) values (0x203E,'U+203E OVERLINE');
+insert into t1 (ucs2,name) values (0x2225,'U+2225 PARALLEL TO');
+insert into t1 (ucs2,name) values (0xFF0D,'U+FF0D FULLWIDTH HYPHEN-MINUS');
+insert into t1 (ucs2,name) values (0xFF3C,'U+FF3C FULLWIDTH REVERSE SOLIDUS');
+insert into t1 (ucs2,name) values (0xFF5E,'U+FF5E FULLWIDTH TILDE');
+insert into t1 (ucs2,name) values (0xFFE0,'U+FFE0 FULLWIDTH CENT SIGN');
+insert into t1 (ucs2,name) values (0xFFE1,'U+FFE1 FULLWIDTH POUND SIGN');
+insert into t1 (ucs2,name) values (0xFFE2,'U+FFE2 FULLWIDTH NOT SIGN');
+insert into t1 (ucs2,name) values (0xFFE4,'U+FFE4 FULLWIDTH BROKEN BAR');
+update t1 set ujis=ucs2;
+select hex(ucs2),hex(ujis),name from t1 order by name;
+drop table t1;
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index 7db651a2a24..b61bb1d53bf 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -230,9 +230,9 @@ drop table t2;
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');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('aaaaaaaaaaa');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('aaaaaaaaaaaa');
insert into t1 values (repeat('b',20));
select c c1 from t1 where c='1';
@@ -254,9 +254,9 @@ 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_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('aaaaaaaaaaa');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('aaaaaaaaaaaa');
insert into t1 values (repeat('b',20));
select c c1 from t1 where c='1';
@@ -276,23 +276,23 @@ create table t1 (c char(3) character set utf8, unique (c(2)));
insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z');
insert into t1 values ('a');
insert into t1 values ('aa');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('aaa');
insert into t1 values ('b');
insert into t1 values ('bb');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('bbb');
insert into t1 values ('а');
insert into t1 values ('аа');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('ааа');
insert into t1 values ('б');
insert into t1 values ('бб');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('ббб');
insert into t1 values ('ꪪ');
insert into t1 values ('ꪪꪪ');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('ꪪꪪꪪ');
drop table t1;
#
@@ -305,23 +305,23 @@ create table t1 (c char(3) character set utf8, unique (c(2))) engine=innodb;
insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z');
insert into t1 values ('a');
insert into t1 values ('aa');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('aaa');
insert into t1 values ('b');
insert into t1 values ('bb');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('bbb');
insert into t1 values ('а');
insert into t1 values ('аа');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('ааа');
insert into t1 values ('б');
insert into t1 values ('бб');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('ббб');
insert into t1 values ('ꪪ');
insert into t1 values ('ꪪꪪ');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('ꪪꪪꪪ');
drop table t1;
#
@@ -334,14 +334,14 @@ unique key a using hash (c(1))
) engine=heap;
show create table t1;
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('aa');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('aaa');
insert into t1 values ('б');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('бб');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('ббб');
select c as c_all from t1 order by c;
select c as c_a from t1 where c='a';
@@ -358,14 +358,14 @@ unique key a using btree (c(1))
) engine=heap;
show create table t1;
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('aa');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('aaa');
insert into t1 values ('б');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('бб');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('ббб');
select c as c_all from t1 order by c;
select c as c_a from t1 where c='a';
@@ -383,14 +383,14 @@ unique key a (c(1))
) engine=innodb;
--enable_warnings
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('aa');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('aaa');
insert into t1 values ('б');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('бб');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('ббб');
select c as c_all from t1 order by c;
select c as c_a from t1 where c='a';
@@ -404,9 +404,9 @@ drop table t1;
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');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('aaaaaaaaaaa');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('aaaaaaaaaaaa');
insert into t1 values (repeat('b',20));
select c c1 from t1 where c='1';
@@ -427,23 +427,23 @@ create table t1 (c char(3) character set utf8 collate utf8_bin, unique (c(2)));
insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z');
insert into t1 values ('a');
insert into t1 values ('aa');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('aaa');
insert into t1 values ('b');
insert into t1 values ('bb');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('bbb');
insert into t1 values ('а');
insert into t1 values ('аа');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('ааа');
insert into t1 values ('б');
insert into t1 values ('бб');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('ббб');
insert into t1 values ('ꪪ');
insert into t1 values ('ꪪꪪ');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('ꪪꪪꪪ');
drop table t1;
@@ -457,14 +457,14 @@ unique key a using hash (c(1))
) engine=heap;
show create table t1;
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('aa');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('aaa');
insert into t1 values ('б');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('бб');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('ббб');
select c as c_all from t1 order by c;
select c as c_a from t1 where c='a';
@@ -481,14 +481,14 @@ unique key a using btree (c(1))
) engine=heap;
show create table t1;
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('aa');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('aaa');
insert into t1 values ('б');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('бб');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('ббб');
select c as c_all from t1 order by c;
select c as c_a from t1 where c='a';
@@ -506,14 +506,14 @@ unique key a (c(1))
) engine=innodb;
--enable_warnings
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('aa');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('aaa');
insert into t1 values ('б');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('бб');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('ббб');
select c as c_all from t1 order by c;
select c as c_a from t1 where c='a';
@@ -1315,6 +1315,46 @@ select coercibility(col1), collation(col1) from v2;
drop view v1, v2;
drop table t1;
+#
+# Check conversion of NCHAR strings to subset (e.g. latin1).
+# Conversion is possible if string repertoire is ASCII.
+# Conversion is not possible if the string have extended characters
+#
+set names utf8;
+create table t1 (a varchar(10) character set latin1, b int);
+insert into t1 values ('a',1);
+select concat(a, if(b>10, N'x', N'y')) from t1;
+--error 1267
+select concat(a, if(b>10, N'æ', N'ß')) from t1;
+drop table t1;
+
+# Conversion tests for character set introducers
+set names utf8;
+create table t1 (a varchar(10) character set latin1, b int);
+insert into t1 values ('a',1);
+select concat(a, if(b>10, _utf8'x', _utf8'y')) from t1;
+--error 1267
+select concat(a, if(b>10, _utf8'æ', _utf8'ß')) from t1;
+drop table t1;
+
+# Conversion tests for introducer + HEX string
+set names utf8;
+create table t1 (a varchar(10) character set latin1, b int);
+insert into t1 values ('a',1);
+select concat(a, if(b>10, _utf8 0x78, _utf8 0x79)) from t1;
+--error 1267
+select concat(a, if(b>10, _utf8 0xC3A6, _utf8 0xC3AF)) from t1;
+drop table t1;
+
+# Conversion tests for "text_literal TEXT_STRING_literal" syntax structure
+set names utf8;
+create table t1 (a varchar(10) character set latin1, b int);
+insert into t1 values ('a',1);
+select concat(a, if(b>10, 'x' 'x', 'y' 'y')) from t1;
+--error 1267
+select concat(a, if(b>10, 'x' 'æ', 'y' 'ß')) from t1;
+drop table t1;
+
#
# Bug#19960: Inconsistent results when joining
@@ -1339,3 +1379,28 @@ 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;
DROP TABLE t1, t2;
+
+#
+# Bug#29205: truncation of UTF8 values when the UNION statement
+# forces collation to the binary charset
+#
+
+SELECT 'н1234567890' UNION SELECT _binary '1';
+SELECT 'н1234567890' UNION SELECT 1;
+
+SELECT '1' UNION SELECT 'н1234567890';
+SELECT 1 UNION SELECT 'н1234567890';
+
+CREATE TABLE t1 (c VARCHAR(11)) CHARACTER SET utf8;
+CREATE TABLE t2 (b CHAR(1) CHARACTER SET binary, i INT);
+
+INSERT INTO t1 (c) VALUES ('н1234567890');
+INSERT INTO t2 (b, i) VALUES ('1', 1);
+
+SELECT c FROM t1 UNION SELECT b FROM t2;
+SELECT c FROM t1 UNION SELECT i FROM t2;
+
+SELECT b FROM t2 UNION SELECT c FROM t1;
+SELECT i FROM t2 UNION SELECT c FROM t1;
+
+DROP TABLE t1, t2;
diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test
index fe39cd95753..abf09942d1c 100644
--- a/mysql-test/t/date_formats.test
+++ b/mysql-test/t/date_formats.test
@@ -7,9 +7,9 @@ drop table if exists t1;
--enable_warnings
--replace_result ROW <format> STATEMENT <format> MIXED <format>
-SHOW GLOBAL VARIABLES LIKE "%_format%";
+SHOW GLOBAL VARIABLES LIKE "%e_format";
--replace_result ROW <format> STATEMENT <format> MIXED <format>
-SHOW SESSION VARIABLES LIKE "%_format%";
+SHOW SESSION VARIABLES LIKE "%e_format";
#
# Test setting a lot of different formats to see which formats are accepted and
@@ -37,7 +37,7 @@ set datetime_format= '%h:%i:%s %p %Y-%m-%d';
set datetime_format= '%h:%i:%s.%f %p %Y-%m-%d';
--replace_result ROW <format> STATEMENT <format> MIXED <format>
-SHOW SESSION VARIABLES LIKE "%format";
+SHOW SESSION VARIABLES LIKE "%e_format";
--error 1231
SET time_format='%h:%i:%s';
diff --git a/mysql-test/t/ddl_i18n_koi8r.test b/mysql-test/t/ddl_i18n_koi8r.test
new file mode 100644
index 00000000000..1d16adbad55
--- /dev/null
+++ b/mysql-test/t/ddl_i18n_koi8r.test
@@ -0,0 +1,1114 @@
+# Objects to test:
+# - stored procedures/functions;
+# - triggers;
+# - events;
+# - views;
+#
+# For stored routines:
+# - create a database with collation utf8_unicode_ci;
+# - create an object, which
+# - contains SP-var with explicit CHARSET-clause;
+# - contains SP-var without CHARSET-clause;
+# - contains text constant;
+# - has localized routine/parameter names;
+# - check:
+# - execute;
+# - SHOW CREATE output;
+# - SHOW output;
+# - SELECT FROM INFORMATION_SCHEMA output;
+# - alter database character set;
+# - change connection collation;
+# - check again;
+# - dump definition using mysqldump;
+# - drop object;
+# - restore object;
+#
+
+###########################################################################
+#
+# NOTE: this file contains text in UTF8 and KOI8-R encodings.
+#
+###########################################################################
+
+# Test requires server to accept client connections (for mysqldump portions)
+--source include/not_embedded.inc
+--source include/have_utf8.inc
+--source include/have_cp866.inc
+--source include/have_cp1251.inc
+--source include/have_koi8r.inc
+
+###########################################################################
+
+set names koi8r;
+delimiter |;
+
+###########################################################################
+#
+# * Views.
+#
+###########################################################################
+
+--echo
+--echo -------------------------------------------------------------------
+--echo Views
+--echo -------------------------------------------------------------------
+--echo
+
+#
+# Preparation:
+#
+
+# - Create database with fixed, pre-defined character set.
+
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest1|
+--enable_warnings
+
+CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+
+use mysqltest1|
+
+CREATE TABLE t1(ËÏÌ INT)|
+INSERT INTO t1 VALUES(1)|
+
+# - Create views;
+
+--echo
+
+CREATE VIEW v1 AS
+ SELECT 'ÔÅÓÔ' AS c1, ËÏÌ AS c2
+ FROM t1|
+
+--echo
+
+CREATE VIEW v2 AS SELECT _utf8'теÑÑ‚' as c1|
+
+--echo
+
+#
+# First-round checks.
+#
+
+--source include/ddl_i18n.check_views.inc
+
+#
+# Change running environment (alter database character set, change session
+# variables).
+#
+
+--echo
+--echo
+
+ALTER DATABASE mysqltest1 COLLATE cp866_general_ci|
+
+#
+# Second-round checks:
+#
+
+# - Change connection to flush cache;
+
+--connect (con2,localhost,root,,)
+--echo
+--echo ---> connection: con2
+
+# - Switch environment variables and trigger loading views;
+
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+
+--disable_result_log
+SELECT * FROM mysqltest1.v1|
+SELECT * FROM mysqltest1.v2|
+--enable_result_log
+
+use mysqltest1|
+
+# - Restore environment;
+
+set names koi8r|
+
+# - Check!
+
+--source include/ddl_i18n.check_views.inc
+
+#
+# Check mysqldump.
+#
+
+# - Dump mysqltest1;
+
+--echo
+--echo ---> Dumping mysqltest1 to ddl_i18n_koi8r.views.mysqltest1.sql
+
+--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --databases mysqltest1 > $MYSQLTEST_VARDIR/tmp/ddl_i18n_koi8r.views.mysqltest1.sql
+
+# - Clean mysqltest1;
+
+--echo
+--echo
+
+DROP DATABASE mysqltest1|
+
+# - Restore mysqltest1;
+
+--echo
+--echo
+
+--echo ---> Restoring mysqltest1...
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ddl_i18n_koi8r.views.mysqltest1.sql
+
+#
+# Third-round checks.
+#
+
+# - Change connection to flush cache;
+
+--connect (con3,localhost,root,,)
+--echo
+--echo ---> connection: con3
+
+# - Switch environment variables and trigger loading stored procedures;
+
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+
+--disable_result_log
+SELECT * FROM mysqltest1.v1|
+SELECT * FROM mysqltest1.v2|
+--enable_result_log
+
+use mysqltest1|
+
+# - Restore environment;
+
+set names koi8r|
+
+# - Check!
+
+--source include/ddl_i18n.check_views.inc
+
+#
+# Cleanup.
+#
+
+--connection default
+--echo
+--echo ---> connection: default
+
+--disconnect con2
+--disconnect con3
+
+use test|
+
+DROP DATABASE mysqltest1|
+
+###########################################################################
+#
+# * Stored procedures/functions.
+#
+###########################################################################
+
+--echo
+--echo -------------------------------------------------------------------
+--echo Stored procedures/functions
+--echo -------------------------------------------------------------------
+--echo
+
+#
+# Preparation:
+#
+
+# - Create database with fixed, pre-defined character set.
+
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest1|
+DROP DATABASE IF EXISTS mysqltest2|
+--enable_warnings
+
+CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+
+use mysqltest1|
+
+# - Create two stored routines -- with and without explicit
+# CHARSET-clause for SP-variable;
+#
+
+--echo
+
+# - Procedure p1
+
+CREATE PROCEDURE p1(
+ INOUT ÐÁÒÁÍ1 CHAR(10),
+ OUT ÐÁÒÁÍ2 CHAR(10))
+BEGIN
+ DECLARE ÐÅÒÅÍ1 CHAR(10);
+
+ SELECT
+ COLLATION(ÐÅÒÅÍ1) AS c1,
+ COLLATION(ÐÁÒÁÍ1) AS c2,
+ COLLATION(ÐÁÒÁÍ2) AS c3;
+
+ SELECT
+ COLLATION('ÔÅËÓÔ') AS c4,
+ COLLATION(_koi8r 'ÔÅËÓÔ') AS c5,
+ COLLATION(_utf8 'текÑÑ‚') AS c6,
+ @@collation_connection AS c7,
+ @@character_set_client AS c8;
+
+ SET ÐÁÒÁÍ1 = 'a';
+ SET ÐÁÒÁÍ2 = 'b';
+END|
+
+--echo
+
+# - Procedure p2
+
+CREATE PROCEDURE p2(
+ INOUT ÐÁÒÁÍ1 CHAR(10) CHARACTER SET utf8,
+ OUT ÐÁÒÁÍ2 CHAR(10) CHARACTER SET utf8)
+BEGIN
+ DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+
+ SELECT
+ COLLATION(ÐÅÒÅÍ1) AS c1,
+ COLLATION(ÐÁÒÁÍ1) AS c2,
+ COLLATION(ÐÁÒÁÍ2) AS c3;
+
+ SELECT
+ COLLATION('ÔÅËÓÔ') AS c4,
+ COLLATION(_koi8r 'ÔÅËÓÔ') AS c5,
+ COLLATION(_utf8 'текÑÑ‚') AS c6,
+ @@collation_connection AS c7,
+ @@character_set_client AS c8;
+
+ SET ÐÁÒÁÍ1 = 'a';
+ SET ÐÁÒÁÍ2 = 'b';
+END|
+
+--echo
+
+# - Procedure p3
+
+CREATE PROCEDURE mysqltest2.p3(
+ INOUT ÐÁÒÁÍ1 CHAR(10),
+ OUT ÐÁÒÁÍ2 CHAR(10))
+BEGIN
+ DECLARE ÐÅÒÅÍ1 CHAR(10);
+
+ SELECT
+ COLLATION(ÐÅÒÅÍ1) AS c1,
+ COLLATION(ÐÁÒÁÍ1) AS c2,
+ COLLATION(ÐÁÒÁÍ2) AS c3;
+
+ SELECT
+ COLLATION('ÔÅËÓÔ') AS c4,
+ COLLATION(_koi8r 'ÔÅËÓÔ') AS c5,
+ COLLATION(_utf8 'текÑÑ‚') AS c6,
+ @@collation_connection AS c7,
+ @@character_set_client AS c8;
+
+ SET ÐÁÒÁÍ1 = 'a';
+ SET ÐÁÒÁÍ2 = 'b';
+END|
+
+--echo
+
+# - Procedure p4
+
+CREATE PROCEDURE mysqltest2.p4(
+ INOUT ÐÁÒÁÍ1 CHAR(10) CHARACTER SET utf8,
+ OUT ÐÁÒÁÍ2 CHAR(10) CHARACTER SET utf8)
+BEGIN
+ DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+
+ SELECT
+ COLLATION(ÐÅÒÅÍ1) AS c1,
+ COLLATION(ÐÁÒÁÍ1) AS c2,
+ COLLATION(ÐÁÒÁÍ2) AS c3;
+
+ SELECT
+ COLLATION('ÔÅËÓÔ') AS c4,
+ COLLATION(_koi8r 'ÔÅËÓÔ') AS c5,
+ COLLATION(_utf8 'текÑÑ‚') AS c6,
+ @@collation_connection AS c7,
+ @@character_set_client AS c8;
+
+ SET ÐÁÒÁÍ1 = 'a';
+ SET ÐÁÒÁÍ2 = 'b';
+END|
+
+#
+# First-round checks.
+#
+
+--source include/ddl_i18n.check_sp.inc
+
+#
+# Change running environment (alter database character set, change session
+# variables).
+#
+
+--echo
+--echo
+
+ALTER DATABASE mysqltest1 COLLATE cp866_general_ci|
+ALTER DATABASE mysqltest2 COLLATE cp866_general_ci|
+
+#
+# Second-round checks:
+#
+
+# - Change connection to flush SP-cache;
+
+--connect (con2,localhost,root,,mysqltest1)
+--echo
+--echo ---> connection: con2
+
+# - Switch environment variables and trigger loading stored procedures;
+
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+
+CALL p1(@a, @b)|
+CALL p2(@a, @b)|
+CALL mysqltest2.p3(@a, @b)|
+CALL mysqltest2.p4(@a, @b)|
+
+# - Restore environment;
+
+set names koi8r|
+
+# - Check!
+
+--source include/ddl_i18n.check_sp.inc
+
+#
+# Check mysqldump.
+#
+
+# - Dump mysqltest1, mysqltest2;
+
+--echo
+--echo ---> Dump of mysqltest1
+
+--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest1
+
+--echo
+--echo ---> Dumping mysqltest1 to ddl_i18n_koi8r.sp.mysqltest1.sql
+
+--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest1 > $MYSQLTEST_VARDIR/tmp/ddl_i18n_koi8r.sp.mysqltest1.sql
+
+--echo
+--echo ---> Dump of mysqltest2
+
+--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest2
+
+--echo
+--echo ---> Dumping mysqltest2 to ddl_i18n_koi8r.sp.mysqltest2.sql
+
+--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest2 > $MYSQLTEST_VARDIR/tmp/ddl_i18n_koi8r.sp.mysqltest2.sql
+
+# - Clean mysqltest1, mysqltest2;
+
+--echo
+--echo
+
+DROP DATABASE mysqltest1|
+DROP DATABASE mysqltest2|
+
+# - Restore mysqltest1;
+
+--echo
+--echo
+
+--echo ---> Restoring mysqltest1...
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ddl_i18n_koi8r.sp.mysqltest1.sql
+
+--echo ---> Restoring mysqltest2...
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ddl_i18n_koi8r.sp.mysqltest2.sql
+
+#
+# Third-round checks.
+#
+
+# - Change connection to flush SP-cache;
+
+--connect (con3,localhost,root,,mysqltest1)
+--echo
+--echo ---> connection: con3
+
+# - Switch environment variables and trigger loading stored procedures;
+
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+
+CALL p1(@a, @b)|
+CALL p2(@a, @b)|
+CALL mysqltest2.p3(@a, @b)|
+CALL mysqltest2.p4(@a, @b)|
+
+# - Restore environment;
+
+set names koi8r|
+
+# - Check!
+
+--source include/ddl_i18n.check_sp.inc
+
+#
+# Cleanup.
+#
+
+--connection default
+--echo
+--echo ---> connection: default
+
+--disconnect con2
+--disconnect con3
+
+use test|
+
+DROP DATABASE mysqltest1|
+DROP DATABASE mysqltest2|
+
+###########################################################################
+#
+# * Triggers.
+#
+###########################################################################
+
+--echo
+--echo -------------------------------------------------------------------
+--echo Triggers
+--echo -------------------------------------------------------------------
+--echo
+
+#
+# Preparation:
+#
+
+# - Create database with fixed, pre-defined character set;
+
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest1|
+DROP DATABASE IF EXISTS mysqltest2|
+--enable_warnings
+
+CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+
+use mysqltest1|
+
+# - Create tables for triggers;
+
+CREATE TABLE t1(c INT)|
+CREATE TABLE mysqltest2.t1(c INT)|
+
+# - Create log tables;
+
+CREATE TABLE log(msg VARCHAR(255))|
+CREATE TABLE mysqltest2.log(msg VARCHAR(255))|
+
+
+# - Create triggers -- with and without explicit CHARSET-clause for
+# SP-variable;
+#
+
+--echo
+
+# - Trigger trg1
+
+CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+ DECLARE ÐÅÒÅÍ1 CHAR(10);
+
+ INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+ INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+ INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+ INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+ INSERT INTO log VALUES(@@collation_connection);
+ INSERT INTO log VALUES(@@character_set_client);
+
+ SET @a1 = 'ÔÅËÓÔ';
+ SET @a1 = _koi8r 'ÔÅËÓÔ';
+ SET @a2 = _utf8 'текÑÑ‚';
+END|
+
+--echo
+
+# - Trigger trg2
+
+CREATE TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW
+BEGIN
+ DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+
+ INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+ INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+ INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+ INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+ INSERT INTO log VALUES(@@collation_connection);
+ INSERT INTO log VALUES(@@character_set_client);
+
+ SET @b1 = 'ÔÅËÓÔ';
+ SET @b1 = _koi8r 'ÔÅËÓÔ';
+ SET @b2 = _utf8 'текÑÑ‚';
+END|
+
+--echo
+
+# - Trigger trg3
+
+CREATE TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW
+BEGIN
+ DECLARE ÐÅÒÅÍ1 CHAR(10);
+
+ INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+ INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+ INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+ INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+ INSERT INTO log VALUES(@@collation_connection);
+ INSERT INTO log VALUES(@@character_set_client);
+
+ SET @a1 = 'ÔÅËÓÔ';
+ SET @a1 = _koi8r 'ÔÅËÓÔ';
+ SET @a2 = _utf8 'текÑÑ‚';
+END|
+
+--echo
+
+# - Trigger trg4
+
+CREATE TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW
+BEGIN
+ DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+
+ INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
+ INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
+ INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+ INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+ INSERT INTO log VALUES(@@collation_connection);
+ INSERT INTO log VALUES(@@character_set_client);
+
+ SET @b1 = 'ÔÅËÓÔ';
+ SET @b1 = _koi8r 'ÔÅËÓÔ';
+ SET @b2 = _utf8 'текÑÑ‚';
+END|
+
+--echo
+
+#
+# First-round checks.
+#
+
+--source include/ddl_i18n.check_triggers.inc
+
+#
+# Change running environment (alter database character set, change session
+# variables).
+#
+
+--echo
+--echo
+
+ALTER DATABASE mysqltest1 COLLATE cp866_general_ci|
+ALTER DATABASE mysqltest2 COLLATE cp866_general_ci|
+
+#
+# Second-round checks:
+#
+
+# - Flush table cache;
+
+ALTER TABLE t1 ADD COLUMN fake INT|
+ALTER TABLE t1 DROP COLUMN fake|
+
+ALTER TABLE mysqltest2.t1 ADD COLUMN fake INT|
+ALTER TABLE mysqltest2.t1 DROP COLUMN fake|
+
+# - Switch environment variables and initiate loading of triggers
+# (connect using NULL database);
+
+--connect (con2,localhost,root,,)
+--echo
+--echo ---> connection: con2
+
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+
+INSERT INTO mysqltest1.t1 VALUES(0)|
+INSERT INTO mysqltest2.t1 VALUES(0)|
+
+DELETE FROM mysqltest1.log|
+DELETE FROM mysqltest2.log|
+
+# - Restore environment;
+
+set names koi8r|
+
+use mysqltest1|
+
+# - Check!
+
+--source include/ddl_i18n.check_triggers.inc
+
+#
+# Check mysqldump.
+#
+
+# - Dump mysqltest1, mysqltest2;
+
+--echo
+--echo ---> Dump of mysqltest1
+
+--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest1
+
+--echo
+--echo ---> Dumping mysqltest1 to ddl_i18n_koi8r.triggers.mysqltest1.sql
+
+--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest1 > $MYSQLTEST_VARDIR/tmp/ddl_i18n_koi8r.triggers.mysqltest1.sql
+
+--echo
+--echo ---> Dump of mysqltest2
+
+--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest2
+
+--echo
+--echo ---> Dumping mysqltest2 to ddl_i18n_koi8r.triggers.mysqltest2.sql
+
+--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest2 > $MYSQLTEST_VARDIR/tmp/ddl_i18n_koi8r.triggers.mysqltest2.sql
+
+# - Clean mysqltest1, mysqltest2;
+
+--echo
+--echo
+
+DROP DATABASE mysqltest1|
+DROP DATABASE mysqltest2|
+
+# - Restore mysqltest1;
+
+--echo
+--echo
+
+--echo ---> Restoring mysqltest1...
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ddl_i18n_koi8r.triggers.mysqltest1.sql
+
+--echo ---> Restoring mysqltest2...
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ddl_i18n_koi8r.triggers.mysqltest2.sql
+
+#
+# Third-round checks.
+#
+
+# - Flush table cache;
+
+ALTER TABLE mysqltest1.t1 ADD COLUMN fake INT|
+ALTER TABLE mysqltest1.t1 DROP COLUMN fake|
+
+ALTER TABLE mysqltest2.t1 ADD COLUMN fake INT|
+ALTER TABLE mysqltest2.t1 DROP COLUMN fake|
+
+# - Switch environment variables and initiate loading of triggers
+# (connect using NULL database);
+
+--connect (con3,localhost,root,,)
+--echo
+--echo ---> connection: con3
+
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+
+INSERT INTO mysqltest1.t1 VALUES(0)|
+INSERT INTO mysqltest2.t1 VALUES(0)|
+
+DELETE FROM mysqltest1.log|
+DELETE FROM mysqltest2.log|
+
+# - Restore environment;
+
+set names koi8r|
+
+use mysqltest1|
+
+# - Check!
+
+--source include/ddl_i18n.check_triggers.inc
+
+#
+# Cleanup.
+#
+
+--connection default
+--echo
+--echo ---> connection: default
+
+--disconnect con2
+--disconnect con3
+
+use test|
+
+DROP DATABASE mysqltest1|
+DROP DATABASE mysqltest2|
+
+###########################################################################
+#
+# * Events
+#
+# We don't have EXECUTE EVENT so far, so this test is limited. It checks that
+# event with non-latin1 symbols can be created, dumped, restored and SHOW
+# statements work properly.
+#
+###########################################################################
+
+--echo
+--echo -------------------------------------------------------------------
+--echo Events
+--echo -------------------------------------------------------------------
+--echo
+
+#
+# Preparation:
+#
+
+# - Create database with fixed, pre-defined character set.
+
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest1|
+DROP DATABASE IF EXISTS mysqltest2|
+--enable_warnings
+
+CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+
+use mysqltest1|
+
+# - Create two stored routines -- with and without explicit
+# CHARSET-clause for SP-variable;
+#
+
+--echo
+
+# - Event ev1
+
+CREATE EVENT ev1 ON SCHEDULE AT '2030-01-01 00:00:00' DO
+BEGIN
+ DECLARE ÐÅÒÅÍ1 CHAR(10);
+
+ SELECT
+ COLLATION(ÐÅÒÅÍ1) AS c1,
+ COLLATION('ÔÅËÓÔ') AS c2,
+ COLLATION(_koi8r 'ÔÅËÓÔ') AS c3,
+ COLLATION(_utf8 'текÑÑ‚') AS c4,
+ @@collation_connection AS c5,
+ @@character_set_client AS c6;
+END|
+
+--echo
+
+# - Event ev2
+
+CREATE EVENT ev2 ON SCHEDULE AT '2030-01-01 00:00:00' DO
+BEGIN
+ DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+
+ SELECT
+ COLLATION(ÐÅÒÅÍ1) AS c1,
+ COLLATION('ÔÅËÓÔ') AS c2,
+ COLLATION(_koi8r 'ÔÅËÓÔ') AS c3,
+ COLLATION(_utf8 'текÑÑ‚') AS c4,
+ @@collation_connection AS c5,
+ @@character_set_client AS c6;
+END|
+
+--echo
+
+# - Event ev3
+
+CREATE EVENT mysqltest2.ev3 ON SCHEDULE AT '2030-01-01 00:00:00' DO
+BEGIN
+ DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+
+ SELECT
+ COLLATION(ÐÅÒÅÍ1) AS c1,
+ COLLATION('ÔÅËÓÔ') AS c2,
+ COLLATION(_koi8r 'ÔÅËÓÔ') AS c3,
+ COLLATION(_utf8 'текÑÑ‚') AS c4,
+ @@collation_connection AS c5,
+ @@character_set_client AS c6;
+END|
+
+--echo
+
+# - Event ev4
+
+CREATE EVENT mysqltest2.ev4 ON SCHEDULE AT '2030-01-01 00:00:00' DO
+BEGIN
+ DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
+
+ SELECT
+ COLLATION(ÐÅÒÅÍ1) AS c1,
+ COLLATION('ÔÅËÓÔ') AS c2,
+ COLLATION(_koi8r 'ÔÅËÓÔ') AS c3,
+ COLLATION(_utf8 'текÑÑ‚') AS c4,
+ @@collation_connection AS c5,
+ @@character_set_client AS c6;
+END|
+
+--echo
+
+
+#
+# First-round checks.
+#
+
+--source include/ddl_i18n.check_events.inc
+
+#
+# Change running environment (alter database character set, change session
+# variables).
+#
+
+--echo
+--echo
+
+ALTER DATABASE mysqltest1 COLLATE cp866_general_ci|
+ALTER DATABASE mysqltest2 COLLATE cp866_general_ci|
+
+#
+# Second-round checks:
+#
+
+# - Change connection to flush cache;
+
+--connect (con2,localhost,root,,mysqltest1)
+--echo
+--echo ---> connection: con2
+
+# - Switch environment variables and trigger loading stored procedures;
+
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+
+--disable_result_log
+SHOW CREATE EVENT ev1|
+SHOW CREATE EVENT ev2|
+SHOW CREATE EVENT mysqltest2.ev3|
+SHOW CREATE EVENT mysqltest2.ev4|
+--enable_result_log
+
+# - Restore environment;
+
+set names koi8r|
+
+# - Check!
+
+--source include/ddl_i18n.check_events.inc
+
+#
+# Check mysqldump.
+#
+
+# - Dump mysqltest1, mysqltest2;
+
+--echo
+--echo ---> Dump of mysqltest1
+
+--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest1
+
+--echo
+--echo ---> Dumping mysqltest1 to ddl_i18n_koi8r.events.mysqltest1.sql
+
+--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest1 > $MYSQLTEST_VARDIR/tmp/ddl_i18n_koi8r.events.mysqltest1.sql
+
+--echo
+--echo ---> Dump of mysqltest2
+
+--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest2
+
+--echo
+--echo ---> Dumping mysqltest2 to ddl_i18n_koi8r.events.mysqltest2.sql
+
+--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest2 > $MYSQLTEST_VARDIR/tmp/ddl_i18n_koi8r.events.mysqltest2.sql
+
+# - Clean mysqltest1, mysqltest2;
+
+--echo
+--echo
+
+DROP DATABASE mysqltest1|
+DROP DATABASE mysqltest2|
+
+# - Restore mysqltest1;
+
+--echo
+--echo
+
+--echo ---> Restoring mysqltest1...
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ddl_i18n_koi8r.events.mysqltest1.sql
+
+--echo ---> Restoring mysqltest2...
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ddl_i18n_koi8r.events.mysqltest2.sql
+
+#
+# Third-round checks.
+#
+
+# - Change connection to flush cache;
+
+--connect (con3,localhost,root,,mysqltest1)
+--echo
+--echo ---> connection: con3
+
+# - Switch environment variables and trigger loading stored procedures;
+
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+
+--disable_result_log
+SHOW CREATE EVENT ev1|
+SHOW CREATE EVENT ev2|
+SHOW CREATE EVENT mysqltest2.ev3|
+SHOW CREATE EVENT mysqltest2.ev4|
+--enable_result_log
+
+# - Restore environment;
+
+set names koi8r|
+
+# - Check!
+
+--source include/ddl_i18n.check_events.inc
+
+###########################################################################
+#
+# * DDL statements inside stored routine.
+#
+# Here we check that DDL statements use actual database collation even if they
+# are called from stored routine.
+#
+###########################################################################
+
+--echo
+--echo -------------------------------------------------------------------
+--echo DDL statements within stored routine.
+--echo -------------------------------------------------------------------
+--echo
+
+#
+# Preparation:
+#
+
+# - Create database with fixed, pre-defined character set.
+
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest1|
+DROP DATABASE IF EXISTS mysqltest2|
+--enable_warnings
+
+CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+
+use mysqltest1|
+
+# - Create procedures;
+
+--echo
+
+CREATE PROCEDURE p1()
+BEGIN
+ CREATE TABLE t1(col1 VARCHAR(10));
+ SHOW CREATE TABLE t1;
+END|
+
+--echo
+
+CREATE PROCEDURE mysqltest2.p2()
+BEGIN
+ CREATE TABLE t2(col1 VARCHAR(10));
+ SHOW CREATE TABLE t2;
+END|
+
+--echo
+
+#
+# First-round checks.
+#
+
+CALL p1()|
+
+--echo
+
+SHOW CREATE TABLE t1|
+
+--echo
+--echo
+
+CALL mysqltest2.p2()|
+
+--echo
+
+SHOW CREATE TABLE mysqltest2.t2|
+
+#
+# Alter database.
+#
+
+--echo
+
+ALTER DATABASE mysqltest1 COLLATE cp1251_general_cs|
+ALTER DATABASE mysqltest2 COLLATE cp1251_general_cs|
+
+DROP TABLE t1|
+DROP TABLE mysqltest2.t2|
+
+--echo
+
+#
+# Second-round checks.
+#
+
+CALL p1()|
+
+--echo
+
+SHOW CREATE TABLE t1|
+
+--echo
+--echo
+
+CALL mysqltest2.p2()|
+
+--echo
+
+SHOW CREATE TABLE mysqltest2.t2|
+
+###########################################################################
+#
+# That's it.
+#
+###########################################################################
+
+#
+# Cleanup.
+#
+
+--connection default
+--echo
+--echo ---> connection: default
+
+--disconnect con2
+--disconnect con3
+
+use test|
+
+DROP DATABASE mysqltest1|
+DROP DATABASE mysqltest2|
diff --git a/mysql-test/t/ddl_i18n_utf8.test b/mysql-test/t/ddl_i18n_utf8.test
new file mode 100644
index 00000000000..c80137a58b5
--- /dev/null
+++ b/mysql-test/t/ddl_i18n_utf8.test
@@ -0,0 +1,1114 @@
+# Objects to test:
+# - stored procedures/functions;
+# - triggers;
+# - events;
+# - views;
+#
+# For stored routines:
+# - create a database with collation utf8_unicode_ci;
+# - create an object, which
+# - contains SP-var with explicit CHARSET-clause;
+# - contains SP-var without CHARSET-clause;
+# - contains text constant;
+# - has localized routine/parameter names;
+# - check:
+# - execute;
+# - SHOW CREATE output;
+# - SHOW output;
+# - SELECT FROM INFORMATION_SCHEMA output;
+# - alter database character set;
+# - change connection collation;
+# - check again;
+# - dump definition using mysqldump;
+# - drop object;
+# - restore object;
+#
+
+###########################################################################
+#
+# NOTE: this file contains text in UTF8 and KOI8-R encodings.
+#
+###########################################################################
+
+# Test requires server to accept client connections (for mysqldump portions)
+--source include/not_embedded.inc
+--source include/have_utf8.inc
+--source include/have_cp866.inc
+--source include/have_cp1251.inc
+--source include/have_koi8r.inc
+
+###########################################################################
+
+set names utf8;
+delimiter |;
+
+###########################################################################
+#
+# * Views.
+#
+###########################################################################
+
+--echo
+--echo -------------------------------------------------------------------
+--echo Views
+--echo -------------------------------------------------------------------
+--echo
+
+#
+# Preparation:
+#
+
+# - Create database with fixed, pre-defined character set.
+
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest1|
+--enable_warnings
+
+CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+
+use mysqltest1|
+
+CREATE TABLE t1(кол INT)|
+INSERT INTO t1 VALUES(1)|
+
+# - Create views;
+
+--echo
+
+CREATE VIEW v1 AS
+ SELECT 'теÑÑ‚' AS c1, кол AS c2
+ FROM t1|
+
+--echo
+
+CREATE VIEW v2 AS SELECT _koi8r'ÔÅÓÔ' as c1|
+
+--echo
+
+#
+# First-round checks.
+#
+
+--source include/ddl_i18n.check_views.inc
+
+#
+# Change running environment (alter database character set, change session
+# variables).
+#
+
+--echo
+--echo
+
+ALTER DATABASE mysqltest1 COLLATE cp866_general_ci|
+
+#
+# Second-round checks:
+#
+
+# - Change connection to flush cache;
+
+--connect (con2,localhost,root,,)
+--echo
+--echo ---> connection: con2
+
+# - Switch environment variables and trigger loading views;
+
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+
+--disable_result_log
+SELECT * FROM mysqltest1.v1|
+SELECT * FROM mysqltest1.v2|
+--enable_result_log
+
+use mysqltest1|
+
+# - Restore environment;
+
+set names utf8|
+
+# - Check!
+
+--source include/ddl_i18n.check_views.inc
+
+#
+# Check mysqldump.
+#
+
+# - Dump mysqltest1;
+
+--echo
+--echo ---> Dumping mysqltest1 to ddl_i18n_utf8views.mysqltest1.sql
+
+--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --databases mysqltest1 > $MYSQLTEST_VARDIR/tmp/ddl_i18n_utf8views.mysqltest1.sql
+
+# - Clean mysqltest1;
+
+--echo
+--echo
+
+DROP DATABASE mysqltest1|
+
+# - Restore mysqltest1;
+
+--echo
+--echo
+
+--echo ---> Restoring mysqltest1...
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ddl_i18n_utf8views.mysqltest1.sql
+
+#
+# Third-round checks.
+#
+
+# - Change connection to flush cache;
+
+--connect (con3,localhost,root,,)
+--echo
+--echo ---> connection: con3
+
+# - Switch environment variables and trigger loading stored procedures;
+
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+
+--disable_result_log
+SELECT * FROM mysqltest1.v1|
+SELECT * FROM mysqltest1.v2|
+--enable_result_log
+
+use mysqltest1|
+
+# - Restore environment;
+
+set names utf8|
+
+# - Check!
+
+--source include/ddl_i18n.check_views.inc
+
+#
+# Cleanup.
+#
+
+--connection default
+--echo
+--echo ---> connection: default
+
+--disconnect con2
+--disconnect con3
+
+use test|
+
+DROP DATABASE mysqltest1|
+
+###########################################################################
+#
+# * Stored procedures/functions.
+#
+###########################################################################
+
+--echo
+--echo -------------------------------------------------------------------
+--echo Stored procedures/functions
+--echo -------------------------------------------------------------------
+--echo
+
+#
+# Preparation:
+#
+
+# - Create database with fixed, pre-defined character set.
+
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest1|
+DROP DATABASE IF EXISTS mysqltest2|
+--enable_warnings
+
+CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+
+use mysqltest1|
+
+# - Create two stored routines -- with and without explicit
+# CHARSET-clause for SP-variable;
+#
+
+--echo
+
+# - Procedure p1
+
+CREATE PROCEDURE p1(
+ INOUT парам1 CHAR(10),
+ OUT парам2 CHAR(10))
+BEGIN
+ DECLARE перем1 CHAR(10);
+
+ SELECT
+ COLLATION(перем1) AS c1,
+ COLLATION(парам1) AS c2,
+ COLLATION(парам2) AS c3;
+
+ SELECT
+ COLLATION('текÑÑ‚') AS c4,
+ COLLATION(_utf8 'текÑÑ‚') AS c5,
+ COLLATION(_koi8r 'ÔÅËÓÔ') AS c6,
+ @@collation_connection AS c7,
+ @@character_set_client AS c8;
+
+ SET парам1 = 'a';
+ SET парам2 = 'b';
+END|
+
+--echo
+
+# - Procedure p2
+
+CREATE PROCEDURE p2(
+ INOUT парам1 CHAR(10) CHARACTER SET utf8,
+ OUT парам2 CHAR(10) CHARACTER SET utf8)
+BEGIN
+ DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+
+ SELECT
+ COLLATION(перем1) AS c1,
+ COLLATION(парам1) AS c2,
+ COLLATION(парам2) AS c3;
+
+ SELECT
+ COLLATION('текÑÑ‚') AS c4,
+ COLLATION(_utf8 'текÑÑ‚') AS c5,
+ COLLATION(_koi8r 'ÔÅËÓÔ') AS c6,
+ @@collation_connection AS c7,
+ @@character_set_client AS c8;
+
+ SET парам1 = 'a';
+ SET парам2 = 'b';
+END|
+
+--echo
+
+# - Procedure p3
+
+CREATE PROCEDURE mysqltest2.p3(
+ INOUT парам1 CHAR(10),
+ OUT парам2 CHAR(10))
+BEGIN
+ DECLARE перем1 CHAR(10);
+
+ SELECT
+ COLLATION(перем1) AS c1,
+ COLLATION(парам1) AS c2,
+ COLLATION(парам2) AS c3;
+
+ SELECT
+ COLLATION('текÑÑ‚') AS c4,
+ COLLATION(_utf8 'текÑÑ‚') AS c5,
+ COLLATION(_koi8r 'ÔÅËÓÔ') AS c6,
+ @@collation_connection AS c7,
+ @@character_set_client AS c8;
+
+ SET парам1 = 'a';
+ SET парам2 = 'b';
+END|
+
+--echo
+
+# - Procedure p4
+
+CREATE PROCEDURE mysqltest2.p4(
+ INOUT парам1 CHAR(10) CHARACTER SET utf8,
+ OUT парам2 CHAR(10) CHARACTER SET utf8)
+BEGIN
+ DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+
+ SELECT
+ COLLATION(перем1) AS c1,
+ COLLATION(парам1) AS c2,
+ COLLATION(парам2) AS c3;
+
+ SELECT
+ COLLATION('текÑÑ‚') AS c4,
+ COLLATION(_utf8 'текÑÑ‚') AS c5,
+ COLLATION(_koi8r 'ÔÅËÓÔ') AS c6,
+ @@collation_connection AS c7,
+ @@character_set_client AS c8;
+
+ SET парам1 = 'a';
+ SET парам2 = 'b';
+END|
+
+#
+# First-round checks.
+#
+
+--source include/ddl_i18n.check_sp.inc
+
+#
+# Change running environment (alter database character set, change session
+# variables).
+#
+
+--echo
+--echo
+
+ALTER DATABASE mysqltest1 COLLATE cp866_general_ci|
+ALTER DATABASE mysqltest2 COLLATE cp866_general_ci|
+
+#
+# Second-round checks:
+#
+
+# - Change connection to flush SP-cache;
+
+--connect (con2,localhost,root,,mysqltest1)
+--echo
+--echo ---> connection: con2
+
+# - Switch environment variables and trigger loading stored procedures;
+
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+
+CALL p1(@a, @b)|
+CALL p2(@a, @b)|
+CALL mysqltest2.p3(@a, @b)|
+CALL mysqltest2.p4(@a, @b)|
+
+# - Restore environment;
+
+set names utf8|
+
+# - Check!
+
+--source include/ddl_i18n.check_sp.inc
+
+#
+# Check mysqldump.
+#
+
+# - Dump mysqltest1, mysqltest2;
+
+--echo
+--echo ---> Dump of mysqltest1
+
+--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest1
+
+--echo
+--echo ---> Dumping mysqltest1 to ddl_i18n_utf8sp.mysqltest1.sql
+
+--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest1 > $MYSQLTEST_VARDIR/tmp/ddl_i18n_utf8sp.mysqltest1.sql
+
+--echo
+--echo ---> Dump of mysqltest2
+
+--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest2
+
+--echo
+--echo ---> Dumping mysqltest2 to ddl_i18n_utf8sp.mysqltest2.sql
+
+--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --routines --databases mysqltest2 > $MYSQLTEST_VARDIR/tmp/ddl_i18n_utf8sp.mysqltest2.sql
+
+# - Clean mysqltest1, mysqltest2;
+
+--echo
+--echo
+
+DROP DATABASE mysqltest1|
+DROP DATABASE mysqltest2|
+
+# - Restore mysqltest1;
+
+--echo
+--echo
+
+--echo ---> Restoring mysqltest1...
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ddl_i18n_utf8sp.mysqltest1.sql
+
+--echo ---> Restoring mysqltest2...
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ddl_i18n_utf8sp.mysqltest2.sql
+
+#
+# Third-round checks.
+#
+
+# - Change connection to flush SP-cache;
+
+--connect (con3,localhost,root,,mysqltest1)
+--echo
+--echo ---> connection: con3
+
+# - Switch environment variables and trigger loading stored procedures;
+
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+
+CALL p1(@a, @b)|
+CALL p2(@a, @b)|
+CALL mysqltest2.p3(@a, @b)|
+CALL mysqltest2.p4(@a, @b)|
+
+# - Restore environment;
+
+set names utf8|
+
+# - Check!
+
+--source include/ddl_i18n.check_sp.inc
+
+#
+# Cleanup.
+#
+
+--connection default
+--echo
+--echo ---> connection: default
+
+--disconnect con2
+--disconnect con3
+
+use test|
+
+DROP DATABASE mysqltest1|
+DROP DATABASE mysqltest2|
+
+###########################################################################
+#
+# * Triggers.
+#
+###########################################################################
+
+--echo
+--echo -------------------------------------------------------------------
+--echo Triggers
+--echo -------------------------------------------------------------------
+--echo
+
+#
+# Preparation:
+#
+
+# - Create database with fixed, pre-defined character set;
+
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest1|
+DROP DATABASE IF EXISTS mysqltest2|
+--enable_warnings
+
+CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+
+use mysqltest1|
+
+# - Create tables for triggers;
+
+CREATE TABLE t1(c INT)|
+CREATE TABLE mysqltest2.t1(c INT)|
+
+# - Create log tables;
+
+CREATE TABLE log(msg VARCHAR(255))|
+CREATE TABLE mysqltest2.log(msg VARCHAR(255))|
+
+
+# - Create triggers -- with and without explicit CHARSET-clause for
+# SP-variable;
+#
+
+--echo
+
+# - Trigger trg1
+
+CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+ DECLARE перем1 CHAR(10);
+
+ INSERT INTO log VALUES(COLLATION(перем1));
+ INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+ INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+ INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+ INSERT INTO log VALUES(@@collation_connection);
+ INSERT INTO log VALUES(@@character_set_client);
+
+ SET @a1 = 'текÑÑ‚';
+ SET @a2 = _utf8 'текÑÑ‚';
+ SET @a3 = _koi8r 'ÔÅËÓÔ';
+END|
+
+--echo
+
+# - Trigger trg2
+
+CREATE TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW
+BEGIN
+ DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+
+ INSERT INTO log VALUES(COLLATION(перем1));
+ INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+ INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+ INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+ INSERT INTO log VALUES(@@collation_connection);
+ INSERT INTO log VALUES(@@character_set_client);
+
+ SET @b1 = 'текÑÑ‚';
+ SET @b2 = _utf8 'текÑÑ‚';
+ SET @b3 = _koi8r 'ÔÅËÓÔ';
+END|
+
+--echo
+
+# - Trigger trg3
+
+CREATE TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW
+BEGIN
+ DECLARE перем1 CHAR(10);
+
+ INSERT INTO log VALUES(COLLATION(перем1));
+ INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+ INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+ INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+ INSERT INTO log VALUES(@@collation_connection);
+ INSERT INTO log VALUES(@@character_set_client);
+
+ SET @a1 = 'текÑÑ‚';
+ SET @a2 = _utf8 'текÑÑ‚';
+ SET @a3 = _koi8r 'ÔÅËÓÔ';
+END|
+
+--echo
+
+# - Trigger trg4
+
+CREATE TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW
+BEGIN
+ DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+
+ INSERT INTO log VALUES(COLLATION(перем1));
+ INSERT INTO log VALUES(COLLATION('текÑÑ‚'));
+ INSERT INTO log VALUES(COLLATION(_utf8 'текÑÑ‚'));
+ INSERT INTO log VALUES(COLLATION(_koi8r 'ÔÅËÓÔ'));
+ INSERT INTO log VALUES(@@collation_connection);
+ INSERT INTO log VALUES(@@character_set_client);
+
+ SET @b1 = 'текÑÑ‚';
+ SET @b2 = _utf8 'текÑÑ‚';
+ SET @b3 = _koi8r 'ÔÅËÓÔ';
+END|
+
+--echo
+
+#
+# First-round checks.
+#
+
+--source include/ddl_i18n.check_triggers.inc
+
+#
+# Change running environment (alter database character set, change session
+# variables).
+#
+
+--echo
+--echo
+
+ALTER DATABASE mysqltest1 COLLATE cp866_general_ci|
+ALTER DATABASE mysqltest2 COLLATE cp866_general_ci|
+
+#
+# Second-round checks:
+#
+
+# - Flush table cache;
+
+ALTER TABLE t1 ADD COLUMN fake INT|
+ALTER TABLE t1 DROP COLUMN fake|
+
+ALTER TABLE mysqltest2.t1 ADD COLUMN fake INT|
+ALTER TABLE mysqltest2.t1 DROP COLUMN fake|
+
+# - Switch environment variables and initiate loading of triggers
+# (connect using NULL database);
+
+--connect (con2,localhost,root,,)
+--echo
+--echo ---> connection: con2
+
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+
+INSERT INTO mysqltest1.t1 VALUES(0)|
+INSERT INTO mysqltest2.t1 VALUES(0)|
+
+DELETE FROM mysqltest1.log|
+DELETE FROM mysqltest2.log|
+
+# - Restore environment;
+
+set names utf8|
+
+use mysqltest1|
+
+# - Check!
+
+--source include/ddl_i18n.check_triggers.inc
+
+#
+# Check mysqldump.
+#
+
+# - Dump mysqltest1, mysqltest2;
+
+--echo
+--echo ---> Dump of mysqltest1
+
+--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest1
+
+--echo
+--echo ---> Dumping mysqltest1 to ddl_i18n_utf8triggers.mysqltest1.sql
+
+--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest1 > $MYSQLTEST_VARDIR/tmp/ddl_i18n_utf8triggers.mysqltest1.sql
+
+--echo
+--echo ---> Dump of mysqltest2
+
+--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest2
+
+--echo
+--echo ---> Dumping mysqltest2 to ddl_i18n_utf8triggers.mysqltest2.sql
+
+--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --triggers --databases mysqltest2 > $MYSQLTEST_VARDIR/tmp/ddl_i18n_utf8triggers.mysqltest2.sql
+
+# - Clean mysqltest1, mysqltest2;
+
+--echo
+--echo
+
+DROP DATABASE mysqltest1|
+DROP DATABASE mysqltest2|
+
+# - Restore mysqltest1;
+
+--echo
+--echo
+
+--echo ---> Restoring mysqltest1...
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ddl_i18n_utf8triggers.mysqltest1.sql
+
+--echo ---> Restoring mysqltest2...
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ddl_i18n_utf8triggers.mysqltest2.sql
+
+#
+# Third-round checks.
+#
+
+# - Flush table cache;
+
+ALTER TABLE mysqltest1.t1 ADD COLUMN fake INT|
+ALTER TABLE mysqltest1.t1 DROP COLUMN fake|
+
+ALTER TABLE mysqltest2.t1 ADD COLUMN fake INT|
+ALTER TABLE mysqltest2.t1 DROP COLUMN fake|
+
+# - Switch environment variables and initiate loading of triggers
+# (connect using NULL database);
+
+--connect (con3,localhost,root,,)
+--echo
+--echo ---> connection: con3
+
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+
+INSERT INTO mysqltest1.t1 VALUES(0)|
+INSERT INTO mysqltest2.t1 VALUES(0)|
+
+DELETE FROM mysqltest1.log|
+DELETE FROM mysqltest2.log|
+
+# - Restore environment;
+
+set names utf8|
+
+use mysqltest1|
+
+# - Check!
+
+--source include/ddl_i18n.check_triggers.inc
+
+#
+# Cleanup.
+#
+
+--connection default
+--echo
+--echo ---> connection: default
+
+--disconnect con2
+--disconnect con3
+
+use test|
+
+DROP DATABASE mysqltest1|
+DROP DATABASE mysqltest2|
+
+###########################################################################
+#
+# * Events
+#
+# We don't have EXECUTE EVENT so far, so this test is limited. It checks that
+# event with non-latin1 symbols can be created, dumped, restored and SHOW
+# statements work properly.
+#
+###########################################################################
+
+--echo
+--echo -------------------------------------------------------------------
+--echo Events
+--echo -------------------------------------------------------------------
+--echo
+
+#
+# Preparation:
+#
+
+# - Create database with fixed, pre-defined character set.
+
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest1|
+DROP DATABASE IF EXISTS mysqltest2|
+--enable_warnings
+
+CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+
+use mysqltest1|
+
+# - Create two stored routines -- with and without explicit
+# CHARSET-clause for SP-variable;
+#
+
+--echo
+
+# - Event ev1
+
+CREATE EVENT ev1 ON SCHEDULE AT '2030-01-01 00:00:00' DO
+BEGIN
+ DECLARE перем1 CHAR(10);
+
+ SELECT
+ COLLATION(перем1) AS c1,
+ COLLATION('текÑÑ‚') AS c2,
+ COLLATION(_utf8 'текÑÑ‚') AS c3,
+ COLLATION(_koi8r 'ÔÅËÓÔ') AS c4,
+ @@collation_connection AS c5,
+ @@character_set_client AS c6;
+END|
+
+--echo
+
+# - Event ev2
+
+CREATE EVENT ev2 ON SCHEDULE AT '2030-01-01 00:00:00' DO
+BEGIN
+ DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+
+ SELECT
+ COLLATION(перем1) AS c1,
+ COLLATION('текÑÑ‚') AS c2,
+ COLLATION(_utf8 'текÑÑ‚') AS c3,
+ COLLATION(_koi8r 'ÔÅËÓÔ') AS c4,
+ @@collation_connection AS c5,
+ @@character_set_client AS c6;
+END|
+
+--echo
+
+# - Event ev3
+
+CREATE EVENT mysqltest2.ev3 ON SCHEDULE AT '2030-01-01 00:00:00' DO
+BEGIN
+ DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+
+ SELECT
+ COLLATION(перем1) AS c1,
+ COLLATION('текÑÑ‚') AS c2,
+ COLLATION(_utf8 'текÑÑ‚') AS c3,
+ COLLATION(_koi8r 'ÔÅËÓÔ') AS c4,
+ @@collation_connection AS c5,
+ @@character_set_client AS c6;
+END|
+
+--echo
+
+# - Event ev4
+
+CREATE EVENT mysqltest2.ev4 ON SCHEDULE AT '2030-01-01 00:00:00' DO
+BEGIN
+ DECLARE перем1 CHAR(10) CHARACTER SET utf8;
+
+ SELECT
+ COLLATION(перем1) AS c1,
+ COLLATION('текÑÑ‚') AS c2,
+ COLLATION(_utf8 'текÑÑ‚') AS c3,
+ COLLATION(_koi8r 'ÔÅËÓÔ') AS c4,
+ @@collation_connection AS c5,
+ @@character_set_client AS c6;
+END|
+
+--echo
+
+
+#
+# First-round checks.
+#
+
+--source include/ddl_i18n.check_events.inc
+
+#
+# Change running environment (alter database character set, change session
+# variables).
+#
+
+--echo
+--echo
+
+ALTER DATABASE mysqltest1 COLLATE cp866_general_ci|
+ALTER DATABASE mysqltest2 COLLATE cp866_general_ci|
+
+#
+# Second-round checks:
+#
+
+# - Change connection to flush cache;
+
+--connect (con2,localhost,root,,mysqltest1)
+--echo
+--echo ---> connection: con2
+
+# - Switch environment variables and trigger loading stored procedures;
+
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+
+--disable_result_log
+SHOW CREATE EVENT ev1|
+SHOW CREATE EVENT ev2|
+SHOW CREATE EVENT mysqltest2.ev3|
+SHOW CREATE EVENT mysqltest2.ev4|
+--enable_result_log
+
+# - Restore environment;
+
+set names utf8|
+
+# - Check!
+
+--source include/ddl_i18n.check_events.inc
+
+#
+# Check mysqldump.
+#
+
+# - Dump mysqltest1, mysqltest2;
+
+--echo
+--echo ---> Dump of mysqltest1
+
+--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest1
+
+--echo
+--echo ---> Dumping mysqltest1 to ddl_i18n_utf8events.mysqltest1.sql
+
+--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest1 > $MYSQLTEST_VARDIR/tmp/ddl_i18n_utf8events.mysqltest1.sql
+
+--echo
+--echo ---> Dump of mysqltest2
+
+--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest2
+
+--echo
+--echo ---> Dumping mysqltest2 to ddl_i18n_utf8events.mysqltest2.sql
+
+--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --compact --events --databases mysqltest2 > $MYSQLTEST_VARDIR/tmp/ddl_i18n_utf8events.mysqltest2.sql
+
+# - Clean mysqltest1, mysqltest2;
+
+--echo
+--echo
+
+DROP DATABASE mysqltest1|
+DROP DATABASE mysqltest2|
+
+# - Restore mysqltest1;
+
+--echo
+--echo
+
+--echo ---> Restoring mysqltest1...
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ddl_i18n_utf8events.mysqltest1.sql
+
+--echo ---> Restoring mysqltest2...
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ddl_i18n_utf8events.mysqltest2.sql
+
+#
+# Third-round checks.
+#
+
+# - Change connection to flush cache;
+
+--connect (con3,localhost,root,,mysqltest1)
+--echo
+--echo ---> connection: con3
+
+# - Switch environment variables and trigger loading stored procedures;
+
+SET @@character_set_client= cp1251|
+SET @@character_set_results= cp1251|
+SET @@collation_connection= cp1251_general_ci|
+
+--disable_result_log
+SHOW CREATE EVENT ev1|
+SHOW CREATE EVENT ev2|
+SHOW CREATE EVENT mysqltest2.ev3|
+SHOW CREATE EVENT mysqltest2.ev4|
+--enable_result_log
+
+# - Restore environment;
+
+set names utf8|
+
+# - Check!
+
+--source include/ddl_i18n.check_events.inc
+
+###########################################################################
+#
+# * DDL statements inside stored routine.
+#
+# Here we check that DDL statements use actual database collation even if they
+# are called from stored routine.
+#
+###########################################################################
+
+--echo
+--echo -------------------------------------------------------------------
+--echo DDL statements within stored routine.
+--echo -------------------------------------------------------------------
+--echo
+
+#
+# Preparation:
+#
+
+# - Create database with fixed, pre-defined character set.
+
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest1|
+DROP DATABASE IF EXISTS mysqltest2|
+--enable_warnings
+
+CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci|
+
+use mysqltest1|
+
+# - Create procedures;
+
+--echo
+
+CREATE PROCEDURE p1()
+BEGIN
+ CREATE TABLE t1(col1 VARCHAR(10));
+ SHOW CREATE TABLE t1;
+END|
+
+--echo
+
+CREATE PROCEDURE mysqltest2.p2()
+BEGIN
+ CREATE TABLE t2(col1 VARCHAR(10));
+ SHOW CREATE TABLE t2;
+END|
+
+--echo
+
+#
+# First-round checks.
+#
+
+CALL p1()|
+
+--echo
+
+SHOW CREATE TABLE t1|
+
+--echo
+--echo
+
+CALL mysqltest2.p2()|
+
+--echo
+
+SHOW CREATE TABLE mysqltest2.t2|
+
+#
+# Alter database.
+#
+
+--echo
+
+ALTER DATABASE mysqltest1 COLLATE cp1251_general_cs|
+ALTER DATABASE mysqltest2 COLLATE cp1251_general_cs|
+
+DROP TABLE t1|
+DROP TABLE mysqltest2.t2|
+
+--echo
+
+#
+# Second-round checks.
+#
+
+CALL p1()|
+
+--echo
+
+SHOW CREATE TABLE t1|
+
+--echo
+--echo
+
+CALL mysqltest2.p2()|
+
+--echo
+
+SHOW CREATE TABLE mysqltest2.t2|
+
+###########################################################################
+#
+# That's it.
+#
+###########################################################################
+
+#
+# Cleanup.
+#
+
+--connection default
+--echo
+--echo ---> connection: default
+
+--disconnect con2
+--disconnect con3
+
+use test|
+
+DROP DATABASE mysqltest1|
+DROP DATABASE mysqltest2|
diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test
index a44288da9ec..396c06f43e7 100644
--- a/mysql-test/t/delayed.test
+++ b/mysql-test/t/delayed.test
@@ -184,7 +184,7 @@ INSERT INTO t1 VALUES( 49, 71), (NULL, 72), (NULL, 73);
INSERT INTO t1 VALUES(NULL, 81), (NULL, 82), (NULL, 83);
# Create a duplicate value.
SET insert_id= 114;
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
INSERT INTO t1 VALUES(NULL, 91);
INSERT INTO t1 VALUES (NULL, 92), (NULL, 93);
# Check what we have now
diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test
index 36d627209db..8a03cb6c715 100644
--- a/mysql-test/t/delete.test
+++ b/mysql-test/t/delete.test
@@ -173,8 +173,20 @@ delete from t1 where (@a:= f1) order by f1 limit 1;
select @a;
drop table t1;
+# BUG#30385 "Server crash when deleting with order by and limit"
+CREATE TABLE t1 (
+ `date` date ,
+ `time` time ,
+ `seq` int(10) unsigned NOT NULL auto_increment,
+ PRIMARY KEY (`seq`),
+ KEY `seq` (`seq`),
+ KEY `time` (`time`),
+ KEY `date` (`date`)
+);
+DELETE FROM t1 ORDER BY date ASC, time ASC LIMIT 1;
+drop table t1;
+
--echo End of 4.1 tests
-# End of 4.1 tests
#
# Test of multi-delete where we are not scanning the first table
@@ -221,3 +233,47 @@ DELETE FROM t1 ORDER BY t2.x;
DELETE FROM t1 ORDER BY (SELECT x);
DROP TABLE t1;
+
+#
+# Bug #30234: Unexpected behavior using DELETE with AS and USING
+# '
+CREATE TABLE t1 (
+ a INT
+);
+
+CREATE TABLE t2 (
+ a INT
+);
+
+CREATE DATABASE db1;
+CREATE TABLE db1.t1 (
+ a INT
+);
+INSERT INTO db1.t1 (a) SELECT * FROM t1;
+
+CREATE DATABASE db2;
+CREATE TABLE db2.t1 (
+ a INT
+);
+INSERT INTO db2.t1 (a) SELECT * FROM t2;
+
+--error ER_PARSE_ERROR
+DELETE FROM t1 alias USING t1, t2 alias WHERE t1.a = alias.a;
+DELETE FROM alias USING t1, t2 alias WHERE t1.a = alias.a;
+DELETE FROM t1, alias USING t1, t2 alias WHERE t1.a = alias.a;
+--error ER_UNKNOWN_TABLE
+DELETE FROM t1, t2 USING t1, t2 alias WHERE t1.a = alias.a;
+--error ER_PARSE_ERROR
+DELETE FROM db1.t1 alias USING db1.t1, db2.t1 alias WHERE db1.t1.a = alias.a;
+--error ER_UNKNOWN_TABLE
+DELETE FROM alias USING db1.t1, db2.t1 alias WHERE db1.t1.a = alias.a;
+DELETE FROM db2.alias USING db1.t1, db2.t1 alias WHERE db1.t1.a = alias.a;
+DELETE FROM t1 USING t1 WHERE a = 1;
+SELECT * FROM t1;
+--error ER_PARSE_ERROR
+DELETE FROM t1 alias USING t1 alias WHERE a = 2;
+SELECT * FROM t1;
+
+DROP TABLE t1, t2;
+DROP DATABASE db1;
+DROP DATABASE db2;
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index f054cf26813..a39de913659 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -11,32 +11,7 @@
##############################################################################
user_limits : Bug#23921 random failure of user_limits.test
-im_options : Bug#20294 2006-07-24 stewart Instance manager test im_options fails randomly
-im_life_cycle : BUG#27851 Instance manager dies on ASSERT in ~Thread_registry() or from not being able to close a mysqld instance.
concurrent_innodb : BUG#21579 2006-08-11 mleich innodb_concurrent random failures with varying differences
-ndb_autodiscover : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
-ndb_autodiscover2 : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
-ndb_load : BUG#17233 2006-05-04 tomas failed load data from infile causes mysqld dbug_assert, binlog not flushed
+ctype_big5 : BUG#26711 2007-06-21 Lars Test has never worked on Double Whopper
-partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table
-rpl_ndb_circular_simplex : BUG#27972 2007-04-20 mats Slave cannot start where it stopped
-rpl_ndb_2innodb : BUG#19227 2006-04-20 pekka pk delete apparently not replicated
-rpl_ndb_2myisam : BUG#19227 Seems to pass currently
-rpl_ndb_dd_partitions : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on s/AMD
-rpl_ndb_ddl : BUG#18946 result file needs update + test needs to checked
-rpl_ddl : BUG#26418 2007-03-01 mleich Slave out of sync after CREATE/DROP TEMPORARY TABLE + ROLLBACK on master
-rpl_ndb_innodb2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement
-rpl_ndb_myisam2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement
-rpl_row_blob_innodb : BUG#18980 2006-04-10 kent Test fails randomly
-synchronization : Bug#24529 Test 'synchronization' fails on Mac pushbuild; Also on Linux 64 bit.
-
-# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
-#ndb_binlog_ddl_multi : BUG#18976 2006-04-10 kent CRBR: multiple binlog, second binlog may miss schema log events
-#ndb_binlog_discover : bug#21806 2006-08-24
-#ndb_autodiscover3 : bug#21806
-
-plugin : Bug#25659 memory leak via "plugins" test
-#rpl_ndb_dd_advance : Bug#25913 rpl_ndb_dd_advance fails randomly
-
-rpl_ndb_stm_innodb : Bug#26783
-ndb_partition_error2 : HF is not sure if the test can work as internded on all the platforms
+federated_transactions : Bug#29523 Transactions do not work
diff --git a/mysql-test/t/distinct.test b/mysql-test/t/distinct.test
index 7310f98cd16..bfdb5f8b9f8 100644
--- a/mysql-test/t/distinct.test
+++ b/mysql-test/t/distinct.test
@@ -97,7 +97,7 @@ explain SELECT t1.a from t1 group by a order by a desc;
explain SELECT distinct t1.a from t1 order by a desc limit 1;
explain SELECT distinct a from t3 order by a desc limit 2;
explain SELECT distinct a,b from t3 order by a+1;
-explain SELECT distinct a,b from t3 order by a limit 10;
+explain SELECT distinct a,b from t3 order by a limit 2;
explain SELECT a,b from t3 group by a,b order by a+1;
drop table t1,t2,t3,t4;
diff --git a/mysql-test/t/error_simulation-master.opt b/mysql-test/t/error_simulation-master.opt
new file mode 100644
index 00000000000..edb77cfa85e
--- /dev/null
+++ b/mysql-test/t/error_simulation-master.opt
@@ -0,0 +1 @@
+--loose-debug=d,raise_error
diff --git a/mysql-test/t/error_simulation.test b/mysql-test/t/error_simulation.test
new file mode 100644
index 00000000000..2f6ea5eac87
--- /dev/null
+++ b/mysql-test/t/error_simulation.test
@@ -0,0 +1,30 @@
+-- source include/have_debug.inc
+
+#
+# Bug #28499: crash for grouping query when tmp_table_size is too small
+#
+
+DROP TABLE IF EXISTS t1;
+
+CREATE TABLE t1 (
+ a varchar(32) character set utf8 collate utf8_bin NOT NULL,
+ b varchar(32) character set utf8 collate utf8_bin NOT NULL )
+ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+INSERT INTO t1 VALUES
+ ('AAAAAAAAAA','AAAAAAAAAA'), ('AAAAAAAAAB','AAAAAAAAAB '),
+ ('AAAAAAAAAB','AAAAAAAAAB'), ('AAAAAAAAAC','AAAAAAAAAC'),
+ ('AAAAAAAAAD','AAAAAAAAAD'), ('AAAAAAAAAE','AAAAAAAAAE'),
+ ('AAAAAAAAAF','AAAAAAAAAF'), ('AAAAAAAAAG','AAAAAAAAAG'),
+ ('AAAAAAAAAH','AAAAAAAAAH'), ('AAAAAAAAAI','AAAAAAAAAI'),
+ ('AAAAAAAAAJ','AAAAAAAAAJ'), ('AAAAAAAAAK','AAAAAAAAAK');
+
+set tmp_table_size=1024;
+
+--replace_regex /in table '[^']+'/in table 'tmp_table'/
+--error ER_DUP_KEY
+SELECT MAX(a) FROM t1 GROUP BY a,b;
+
+set tmp_table_size=default;
+
+DROP TABLE t1;
diff --git a/mysql-test/t/errors.test b/mysql-test/t/errors.test
index 4fbdcba635f..89579ec1739 100644
--- a/mysql-test/t/errors.test
+++ b/mysql-test/t/errors.test
@@ -53,4 +53,17 @@ INSERT INTO t1 VALUES(2),(3);
SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0)));
DROP TABLE t1;
+#
+# Bug #28677: SELECT on missing column gives extra error
+#
+CREATE TABLE t1( a INT );
+--error ER_BAD_FIELD_ERROR
+SELECT b FROM t1;
+SHOW ERRORS;
+--error ER_BAD_FIELD_ERROR
+CREATE TABLE t2 SELECT b FROM t1;
+SHOW ERRORS;
+--error ER_BAD_FIELD_ERROR
+INSERT INTO t1 SELECT b FROM t1;
+DROP TABLE t1;
# End of 5.0 tests
diff --git a/mysql-test/t/events.test b/mysql-test/t/events.test
index 575f9984a79..d1ca5f1b609 100644
--- a/mysql-test/t/events.test
+++ b/mysql-test/t/events.test
@@ -185,7 +185,30 @@ set names cp1251;
create event ðóóò21 on schedule every '50:23:59:95' day_second COMMENT 'òîâà å 1251 êîìåíòàð' do select 1;
--replace_regex /STARTS '[^']+'/STARTS '#'/
SHOW CREATE EVENT ðóóò21;
-insert into mysql.event (db, name, body, definer, interval_value, interval_field, originator) values (database(), "root22", "select 1", user(), 100, "SECOND_MICROSECOND", 1);
+insert into mysql.event (
+ db,
+ name,
+ body,
+ definer,
+ interval_value,
+ interval_field,
+ originator,
+ character_set_client,
+ collation_connection,
+ db_collation,
+ body_utf8)
+values (
+ database(),
+ "root22",
+ "select 1",
+ user(),
+ 100,
+ "SECOND_MICROSECOND",
+ 1,
+ 'utf8',
+ 'utf8_general_ci',
+ 'utf8_general_ci',
+ 'select 1');
--error ER_NOT_SUPPORTED_YET
show create event root22;
--error ER_NOT_SUPPORTED_YET
@@ -409,8 +432,11 @@ create event закачка on schedule every 10 hour do select get_lock("test_l
--echo "Should return 1 row"
select definer, name, db from mysql.event;
---echo "Should be only 1 process"
-select /*1*/ user, host, db, command, state, info from information_schema.processlist where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info;
+--echo "Should be only 0 process"
+select /*1*/ user, host, db, command, state, info
+ from information_schema.processlist
+ where (user='event_scheduler')
+ order by info;
select release_lock("test_lock1");
drop event закачка;
--echo "Should have 0 events"
@@ -424,14 +450,28 @@ set global event_scheduler=on;
select get_lock("test_lock2", 20);
--echo "Create an event which tries to acquire a mutex. The event locks on the mutex"
create event закачка on schedule every 10 hour do select get_lock("test_lock2", 20);
---echo "Let some time pass to the event starts"
---sleep 1
+
--echo "Should have only 2 processes: the scheduler and the locked event"
-select /*2*/ user, host, db, command, state, info from information_schema.processlist where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info;--echo "Release the mutex, the event worker should finish."
+let $wait_condition= select count(*) = 2 from information_schema.processlist
+ where ( (state like 'User lock%' AND info like 'select get_lock%')
+ OR (command='Daemon' AND user='event_scheduler'));
+--source include/wait_condition.inc
+
+select /*2*/ user, host, db, command, state, info
+ from information_schema.processlist
+ where (info like "select get_lock%" OR user='event_scheduler')
+ order by info;
--echo "Release the mutex, the event worker should finish."
select release_lock("test_lock2");
drop event закачка;
+# Wait for release_lock("test_lock2") to complete,
+# to avoid polluting the next test information_schema.processlist
+let $wait_condition= select count(*) = 0 from information_schema.processlist
+ where (state like 'User lock%' AND info like 'select get_lock%');
+--source include/wait_condition.inc
+
+
##
## 1. get a lock
## 2. create an event
@@ -443,14 +483,36 @@ drop event закачка;
set global event_scheduler=1;
select get_lock("test_lock2_1", 20);
create event закачка21 on schedule every 10 hour do select get_lock("test_lock2_1", 20);
---sleep 1
---echo "Should have only 3 processes: the scheduler, our conn and the locked event"
-select /*3*/ user, host, db, command, state, info from information_schema.processlist where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info;
+
+--echo "Should have only 2 processes: the scheduler and the locked event"
+let $wait_condition= select count(*) = 2 from information_schema.processlist
+ where ( (state like 'User lock%' AND info like 'select get_lock%')
+ OR (command='Daemon' AND user='event_scheduler' AND
+ state = 'Waiting for next activation'));
+--source include/wait_condition.inc
+
+select /*3*/ user, host, db, command, state, info
+ from information_schema.processlist
+ where (info like "select get_lock%" OR user='event_scheduler')
+ order by info;
+
set global event_scheduler=off;
---sleep 0.8
+
+let $wait_condition= select count(*) =1 from information_schema.processlist
+ where (info like "select get_lock%" OR user='event_scheduler');
+--source include/wait_condition.inc
+
--echo "Should have only our process now:"
-select /*4*/ user, host, db, command, state, info from information_schema.processlist where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info;
+select /*4*/ user, host, db, command, state, info
+ from information_schema.processlist
+ where (info like "select get_lock%" OR user='event_scheduler')
+ order by info;
+select release_lock("test_lock2_1");
drop event закачка21;
+let $wait_condition=
+ select count(*) = 0 from information_schema.processlist
+ where db='events_test' and command = 'Connect' and user=current_user();
+--source include/wait_condition.inc
####
# Bug #16410 Events: CREATE EVENT is legal in a CREATE TRIGGER statement
@@ -725,4 +787,14 @@ drop table t1|
drop event e1|
delimiter ;|
+
+#
+# End of tests
+#
+
+let $wait_condition=
+ select count(*) = 0 from information_schema.processlist
+ where db='events_test' and command = 'Connect' and user=current_user();
+--source include/wait_condition.inc
+
drop database events_test;
diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test
index 8343c6b4bc6..36052fdb9af 100644
--- a/mysql-test/t/events_bugs.test
+++ b/mysql-test/t/events_bugs.test
@@ -87,7 +87,6 @@ delimiter |;
create event e_16407 on schedule every 60 second do
begin
select get_lock('test_bug16407', 60);
- drop table "hashed_num";
end|
delimiter ;|
@@ -611,7 +610,130 @@ DROP EVENT e1;
SET TIME_ZONE=@save_time_zone;
+#
+# START - BUG#28666 CREATE EVENT ... EVERY 0 SECOND let server crash
+#
+--disable_warnings
+drop event if exists new_event;
+--enable_warnings
+--error ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG
+CREATE EVENT new_event ON SCHEDULE EVERY 0 SECOND DO SELECT 1;
+--error ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG
+CREATE EVENT new_event ON SCHEDULE EVERY (SELECT 0) SECOND DO SELECT 1;
+--error ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG
+CREATE EVENT new_event ON SCHEDULE EVERY "abcdef" SECOND DO SELECT 1;
+--error ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG
+CREATE EVENT new_event ON SCHEDULE EVERY "0abcdef" SECOND DO SELECT 1;
+--error ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG
+CREATE EVENT new_event ON SCHEDULE EVERY "a1bcdef" SECOND DO SELECT 1;
+
+--error ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG
+CREATE EVENT new_event ON SCHEDULE EVERY (SELECT "abcdef" UNION SELECT "abcdef") SECOND DO SELECT 1;
+--error ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG
+CREATE EVENT new_event ON SCHEDULE EVERY (SELECT "0abcdef") SECOND DO SELECT 1;
+--error ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG
+CREATE EVENT new_event ON SCHEDULE EVERY (SELECT "a1bcdef") SECOND DO SELECT 1;
+
+--error ER_WRONG_VALUE
+CREATE EVENT new_event ON SCHEDULE AT "every day" DO SELECT 1;
+--error ER_WRONG_VALUE
+CREATE EVENT new_event ON SCHEDULE AT "0every day" DO SELECT 1;
+--error ER_WRONG_VALUE
+CREATE EVENT new_event ON SCHEDULE AT (SELECT "every day") DO SELECT 1;
+
+--error ER_PARSE_ERROR
+CREATE EVENT new_event ON SCHEDULE AT NOW() STARTS NOW() DO SELECT 1;
+--error ER_PARSE_ERROR
+CREATE EVENT new_event ON SCHEDULE AT NOW() ENDS NOW() DO SELECT 1;
+--error ER_PARSE_ERROR
+CREATE EVENT new_event ON SCHEDULE AT NOW() STARTS NOW() ENDS NOW() DO SELECT 1;
+
+#
+# START - BUG#28924 If I drop the user who is the definer of an active event then server cores
+#
+let $engine=MyISAM;
+USE test;
+SHOW GRANTS FOR CURRENT_USER;
+SET GLOBAL event_scheduler = ON;
+eval CREATE TABLE event_log (id int KEY AUTO_INCREMENT,
+ ev_nm char(40), ev_cnt int,
+ ev_tm timestamp) ENGINE=$engine;
+SET @ev_base_date = 20281224180000;
+--disable_warnings
+SET autocommit=0;
+#DROP DATABASE IF EXISTS ev_db_1;
+#CREATE DATABASE ev_db_1;
+--enable_warnings
+CREATE USER evtest1@localhost;
+SET PASSWORD FOR evtest1@localhost = password('ev1');
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM evtest1@localhost;
+GRANT create, insert, select, event ON events_test.* TO evtest1@localhost;
+GRANT select,insert ON test.* TO evtest1@localhost;
+SHOW GRANTS FOR evtest1@localhost;
+
+--echo connection e1;
+--replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
+connect (e1,localhost,evtest1,ev1,events_test,$MASTER_MYPORT,$MASTER_MYSOCK);
+USE events_test;
+
+DELIMITER |;
+CREATE EVENT ev_sched_1823 ON SCHEDULE EVERY 2 SECOND
+DO BEGIN
+ SET AUTOCOMMIT = 0;
+ SET @evname = 'ev_sched_1823';
+ SET @cnt = 0;
+ SELECT COUNT(*) INTO @cnt FROM test.event_log WHERE ev_nm = @evname;
+ IF @cnt < 6 THEN
+ INSERT INTO test.event_log VALUES (NULL,@evname,@cnt+1,current_timestamp());
+ COMMIT;
+ END IF;
+ SELECT COUNT(*) INTO @cnt FROM test.event_log WHERE ev_nm = @evname;
+ IF @cnt < 6 THEN
+ INSERT INTO test.event_log VALUES (NULL,@evname,@cnt+1,current_timestamp());
+ ROLLBACK;
+ END IF;
+END;|
+DELIMITER ;|
+
+--sleep 6
+--echo connection default;
+DROP EVENT ev_sched_1823;
+connection default;
+DROP USER evtest1@localhost;
+
+--sleep 6
+USE test;
+--echo =====================================================================================
+--sleep 5
+#--disable_result_log
+select id,ev_nm,ev_cnt from event_log order by id;
+#--enable_result_log
+DROP TABLE event_log;
+#DROP DATABASE ev_db_1;
+SET GLOBAL event_scheduler = OFF;
+
#
# End of tests
#
-drop database events_test;
+
+let $wait_condition=
+ select count(*) = 0 from information_schema.processlist
+ where db='events_test' and command = 'Connect' and user=current_user();
+--source include/wait_condition.inc
+
+DROP DATABASE events_test;
+
+
+#
+# Bug#28641 CREATE EVENT with '2038.01.18 03:00:00' let server crash.
+#
+SET GLOBAL event_scheduler= ON;
+DELIMITER |;
+CREATE EVENT bug28641 ON SCHEDULE AT '2038.01.18 03:00:00'
+ DO BEGIN
+ SELECT 1;
+ END;|
+
+DELIMITER ;|
+SET GLOBAL event_scheduler= OFF;
+DROP EVENT bug28641;
diff --git a/mysql-test/t/events_grant.test b/mysql-test/t/events_grant.test
index 44288fc1ac6..cff2475c5aa 100644
--- a/mysql-test/t/events_grant.test
+++ b/mysql-test/t/events_grant.test
@@ -101,8 +101,14 @@ disconnect ev_con1;
connection default;
DROP USER ev_test@localhost;
DROP DATABASE events_test2;
+
+#
+# End of tests
#
-## EVENTS grants test end
-#
+
+let $wait_condition=
+ select count(*) = 0 from information_schema.processlist
+ where db='events_test' and command = 'Connect' and user=current_user();
+--source include/wait_condition.inc
DROP DATABASE events_test;
diff --git a/mysql-test/t/events_logs_tests.test b/mysql-test/t/events_logs_tests.test
index 25b75f13f01..3240dccbc76 100644
--- a/mysql-test/t/events_logs_tests.test
+++ b/mysql-test/t/events_logs_tests.test
@@ -1,110 +1,90 @@
# Can't test with embedded server that doesn't support grants
-- source include/not_embedded.inc
-CREATE DATABASE IF NOT EXISTS events_test;
-USE events_test;
---echo "We use procedure here because its statements won't be logged into the general log"
---echo "If we had used normal select that are logged in different ways depending on whether"
---echo "the test suite is run in normal mode or with --ps-protocol"
+--disable_warnings
+drop database if exists events_test;
+--enable_warnings
+create database if not exists events_test;
+use events_test;
+--echo
+--echo We use procedure here because its statements won't be
+--echo logged into the general log. If we had used normal select
+--echo that are logged in different ways depending on whether the
+--echo test suite is run in normal mode or with --ps-protocol
+--echo
delimiter |;
-CREATE procedure select_general_log()
-BEGIN
- SELECT user_host, argument FROM mysql.general_log WHERE argument LIKE '%alabala%';
-END|
+create procedure select_general_log()
+begin
+ select user_host, argument from mysql.general_log
+ where argument like '%events_logs_test%';
+end|
delimiter ;|
---echo "Check General Query Log"
+--echo
+--echo Check that general query log works, but sub-statements
+--echo of the stored procedure do not leave traces in it.
+--echo
+truncate mysql.general_log;
+# Logging format in ps protocol is slightly different
+--disable_ps_protocol
+select 'events_logs_tests' as outside_event;
+--enable_ps_protocol
--replace_column 1 USER_HOST
-CALL select_general_log();
-SET GLOBAL event_scheduler=on;
-TRUNCATE mysql.general_log;
-CREATE EVENT log_general ON SCHEDULE EVERY 1 MINUTE DO SELECT 'alabala', SLEEP(1) FROM DUAL;
---echo "Wait the scheduler to start"
---sleep 1.5
---echo "Should see 2 rows - the 'SELECT' is in the middle. The other two are selects from general_log"
+call select_general_log();
+--echo
+--echo Check that unlike sub-statements of stored procedures,
+--echo sub-statements of events are present in the general log.
+--echo
+set global event_scheduler=on;
+truncate mysql.general_log;
+create event ev_log_general on schedule at now() on completion not preserve do select 'events_logs_test' as inside_event;
+--let $wait_condition=select count(*)=0 from information_schema.events where event_name='ev_log_general'
+--source include/wait_condition.inc
--replace_column 1 USER_HOST
-CALL select_general_log();
-DROP PROCEDURE select_general_log;
-DROP EVENT log_general;
-SET GLOBAL event_scheduler=off;
+call select_general_log();
---echo "Check slow query log"
---disable_query_log
-DELIMITER |;
-CREATE FUNCTION get_value()
- returns INT
- deterministic
-BEGIN
- DECLARE var_name CHAR(255);
- DECLARE var_val INT;
- DECLARE done INT DEFAULT 0;
- DECLARE cur1 CURSOR FOR SHOW GLOBAL VARIABLES LIKE 'long_query_time';
- DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
- OPEN cur1;
- FETCH cur1 INTO var_name, var_val;
- CLOSE cur1;
- RETURN var_val;
-end|
-DELIMITER ;|
---enable_query_log
---echo "Save the values"
-SET @old_global_long_query_time:=(select get_value());
-SET @old_session_long_query_time:=@@long_query_time;
-SHOW VARIABLES LIKE 'log_slow_queries';
-DROP FUNCTION get_value;
---echo "Make it quite long"
-SET SESSION long_query_time=300;
-TRUNCATE mysql.slow_log;
+--echo
+--echo Check slow query log
+--echo
+--echo Ensure that slow logging is on
+show variables like 'log_slow_queries';
+--echo
+--echo Demonstrate that session value has no effect
+--echo
+set @@session.long_query_time=1;
+set @@global.long_query_time=300;
+truncate mysql.slow_log;
+create event ev_log_general on schedule at now() on completion not preserve
+ do select 'events_logs_test' as inside_event, sleep(1.5);
+--let $wait_condition=select count(*)=0 from information_schema.events where event_name='ev_log_general'
+--source include/wait_condition.inc
+--echo
+--echo Nothing should be logged
+--echo
--replace_column 1 USER_HOST
-SELECT user_host, query_time, db, sql_text FROM mysql.slow_log;
---echo "Set new values"
-SET GLOBAL long_query_time=4;
-SET SESSION long_query_time=1;
---echo "Check that logging is working"
-SELECT SLEEP(2);
---replace_column 1 USER_HOST 2 SLEEPVAL
-SELECT user_host, query_time, db, sql_text FROM mysql.slow_log;
-SET SESSION long_query_time=300;
---echo "Make it quite long"
-TRUNCATE mysql.slow_log;
-CREATE TABLE slow_event_test (slo_val tinyint, val tinyint);
-SET SESSION long_query_time=1;
---echo "This won't go to the slow log"
-SELECT * FROM slow_event_test;
-SET SESSION long_query_time=1;
-SET GLOBAL event_scheduler=on;
-SET GLOBAL long_query_time=20;
-CREATE EVENT long_event ON SCHEDULE EVERY 1 MINUTE DO INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(1.5);
---echo "Sleep some more time than the actual event run will take"
---sleep 2
-SHOW VARIABLES LIKE 'event_scheduler';
---echo "Check our table. Should see 1 row"
-SELECT * FROM slow_event_test;
---echo "Check slow log. Should not see anything because 1.5 is under the threshold of 20 for GLOBAL, though over SESSION which is 1"
---echo "This should show that the GLOBAL value is regarded and not the SESSION one of the current connection"
-SELECT user_host, query_time, db, sql_text FROM mysql.slow_log;
---echo "Another test to show that GLOBAL is regarded and not SESSION."
---echo "This should go to the slow log"
-SET SESSION long_query_time=10;
-DROP EVENT long_event;
-SET GLOBAL long_query_time=1;
-CREATE EVENT long_event2 ON SCHEDULE EVERY 1 MINUTE DO INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(2);
---echo "Sleep some more time than the actual event run will take"
-let $wait_timeout= 30;
-let $wait_condition= SELECT COUNT(*) = 1 FROM mysql.slow_log;
+select user_host, db, sql_text from mysql.slow_log
+ where sql_text like 'select \'events_logs_test\'%';
+set @@global.long_query_time=1;
+truncate mysql.slow_log;
+create event ev_log_general on schedule at now() on completion not preserve
+ do select 'events_logs_test' as inside_event, sleep(1.5);
+--let $wait_condition=select count(*)=0 from information_schema.events where event_name='ev_log_general'
--source include/wait_condition.inc
---echo "Check our table. Should see 2 rows"
-SELECT * FROM slow_event_test;
---echo "Check slow log. Should see 1 row because 2 is over the threshold of 1 for GLOBAL, though under SESSION which is 10"
---replace_column 1 USER_HOST 2 SLEEPVAL
-SELECT user_host, query_time, db, sql_text FROM mysql.slow_log;
-DROP EVENT long_event2;
---echo "Make it quite long"
-SET SESSION long_query_time=300;
-TRUNCATE mysql.slow_log;
-DROP TABLE slow_event_test;
-SET GLOBAL long_query_time =@old_global_long_query_time;
-SET SESSION long_query_time =@old_session_long_query_time;
+--echo
+--echo Event sub-statement should be logged.
+--echo
+--replace_column 1 USER_HOST
+select user_host, db, sql_text from mysql.slow_log
+ where sql_text like 'select \'events_logs_test\'%';
-DROP DATABASE events_test;
+drop database events_test;
+set global event_scheduler=off;
+set @@global.long_query_time=default;
+set @@session.long_query_time=default;
-SET GLOBAL event_scheduler=off;
+#
+# Safety
+#
+let $wait_condition=
+ select count(*) = 0 from information_schema.processlist
+ where db='events_test' and command = 'Connect' and user=current_user();
+--source include/wait_condition.inc
diff --git a/mysql-test/t/events_restart_phase3.test b/mysql-test/t/events_restart_phase3.test
index 1be40c72717..04d879e50ec 100644
--- a/mysql-test/t/events_restart_phase3.test
+++ b/mysql-test/t/events_restart_phase3.test
@@ -11,8 +11,11 @@ use events_test;
select @@event_scheduler;
let $wait_condition=select count(distinct name)=3 from execution_log;
--source include/wait_condition.inc
---echo "Should get 3 rows : abc1, abc2, abc3
-select distinct name from execution_log order by name;
drop table execution_log;
# Will drop all events
drop database events_test;
+
+let $wait_condition=
+ select count(*) = 0 from information_schema.processlist
+ where db='events_test' and command = 'Connect' and user=current_user();
+--source include/wait_condition.inc
diff --git a/mysql-test/t/events_scheduling.test b/mysql-test/t/events_scheduling.test
index 31c09a3d561..b1eeae1e020 100644
--- a/mysql-test/t/events_scheduling.test
+++ b/mysql-test/t/events_scheduling.test
@@ -106,3 +106,13 @@ DROP TABLE table_3;
DROP TABLE table_4;
DROP DATABASE events_test;
SET GLOBAL event_scheduler=OFF;
+
+#
+# End of tests
+#
+
+let $wait_condition=
+ select count(*) = 0 from information_schema.processlist
+ where db='events_test' and command = 'Connect' and user=current_user();
+--source include/wait_condition.inc
+
diff --git a/mysql-test/t/events_stress.test b/mysql-test/t/events_stress.test
index fd1ae34ac3c..22959898b43 100644
--- a/mysql-test/t/events_stress.test
+++ b/mysql-test/t/events_stress.test
@@ -133,4 +133,5 @@ DROP USER event_user3@localhost;
#
# DROP DATABASE test end (bug #16406)
#
+
DROP DATABASE events_test;
diff --git a/mysql-test/t/events_time_zone.test b/mysql-test/t/events_time_zone.test
index 5f929e0b07a..af3466a339c 100644
--- a/mysql-test/t/events_time_zone.test
+++ b/mysql-test/t/events_time_zone.test
@@ -288,7 +288,11 @@ DROP TABLE t_step;
DROP DATABASE mysqltest_db1;
--disable_query_log
eval USE $old_db;
---enable_query_log
+--enable_query_log
+let $wait_condition=
+ select count(*) = 0 from information_schema.processlist
+ where db='mysqltest_db1' and command = 'Connect' and user=current_user();
+--source include/wait_condition.inc
--echo End of 5.1 tests.
diff --git a/mysql-test/t/events_trans.test b/mysql-test/t/events_trans.test
index 77427070cbb..562b5a9625f 100644
--- a/mysql-test/t/events_trans.test
+++ b/mysql-test/t/events_trans.test
@@ -111,5 +111,11 @@ commit work;
#
# Cleanup
#
+
+let $wait_condition=
+ select count(*) = 0 from information_schema.processlist
+ where db='events_test' and command = 'Connect' and user=current_user();
+--source include/wait_condition.inc
+
drop database events_test;
diff --git a/mysql-test/t/events_trans_notembedded.test b/mysql-test/t/events_trans_notembedded.test
index adc293d7e79..3c151dd18b1 100644
--- a/mysql-test/t/events_trans_notembedded.test
+++ b/mysql-test/t/events_trans_notembedded.test
@@ -57,5 +57,10 @@ drop database mysqltest_db2;
#
# Cleanup
#
+let $wait_condition=
+ select count(*) = 0 from information_schema.processlist
+ where db='events_test' and command = 'Connect' and user=current_user();
+--source include/wait_condition.inc
+
drop database events_test;
diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test
index 0eaead8011e..90f1fa36bb4 100644
--- a/mysql-test/t/federated.test
+++ b/mysql-test/t/federated.test
@@ -32,25 +32,28 @@ CREATE TABLE federated.t1 (
# test non-existant table
--replace_result $SLAVE_MYPORT SLAVE_PORT
---error 1434
eval CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
`name` varchar(32) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t3';
+--error 1431
+SELECT * FROM federated.t1;
+DROP TABLE federated.t1;
# test bad user/password
--replace_result $SLAVE_MYPORT SLAVE_PORT
---error 1429
eval CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
`name` varchar(32) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='mysql://user:pass@127.0.0.1:$SLAVE_MYPORT/federated/t1';
+--error 1429
+SELECT * FROM federated.t1;
+DROP TABLE federated.t1;
-DROP TABLE IF EXISTS federated.t1;
# # correct connection, same named tables
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval CREATE TABLE federated.t1 (
@@ -1629,5 +1632,138 @@ drop table federated.t1;
connection slave;
drop table federated.t1;
+#
+# Bug#26909: Specified key was too long; max key length is 255 bytes
+# when creating a table
+#
+connection slave;
+CREATE TABLE federated.t1 (
+ categoryId int(11) NOT NULL AUTO_INCREMENT,
+ domainId varchar(745) NOT NULL DEFAULT '',
+ categoryName varchar(255) NOT NULL DEFAULT '',
+ PRIMARY KEY (categoryId),
+ UNIQUE KEY idx_unique_category_categoryName (domainId, categoryName),
+ KEY idx_category_domainId (domainId)
+ ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+connection master;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval CREATE TABLE federated.t1 (
+ categoryId int(11) NOT NULL AUTO_INCREMENT,
+ domainId varchar(745) NOT NULL DEFAULT '',
+ categoryName varchar(255) NOT NULL DEFAULT '',
+ PRIMARY KEY (categoryId),
+ UNIQUE KEY idx_unique_category_categoryName (domainId, categoryName),
+ KEY idx_category_domainId (domainId)
+ ) ENGINE=FEDERATED DEFAULT CHARSET=latin1
+ CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
+
+
+insert into federated.t1 (domainId, categoryName) values ( '1231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231 300', '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345 250');
+insert into federated.t1 (domainId, categoryName) values ( '12312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312 301', '12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456 250');
+insert into federated.t1 (domainId, categoryName) values ('a', 'b');
+
+select categoryId from federated.t1 order by domainId, categoryName;
+select categoryId from federated.t1 where domainId='a' and categoryName='b' order by categoryId;
+select categoryId from federated.t1 where domainId='a' and categoryName='b' order by categoryId;
+select categoryId from federated.t1 where domainId<>'a' and categoryName<>'b' order by categoryId;
+
+drop table federated.t1;
+
+connection slave;
+drop table federated.t1;
+
+#
+# BUG#21019 Federated Engine does not support REPLACE/INSERT IGNORE/UPDATE IGNORE
+#
+connection slave;
+create table federated.t1 (a int primary key, b varchar(64))
+ DEFAULT CHARSET=utf8;
+connection master;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval create table federated.t1 (a int primary key, b varchar(64))
+ ENGINE=FEDERATED
+ connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'
+ DEFAULT CHARSET=utf8;
+
+insert ignore into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe");
+select * from federated.t1;
+
+truncate federated.t1;
+replace into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe");
+select * from federated.t1;
+
+update ignore federated.t1 set a=a+1;
+select * from federated.t1;
+
+drop table federated.t1;
+connection slave;
+drop table federated.t1;
+
+#
+# BUG#25511 Federated Insert failures.
+#
+# When the user performs a INSERT...ON DUPLICATE KEY UPDATE, we want
+# it to fail if a duplicate key exists instead of ignoring it.
+#
+connection slave;
+create table federated.t1 (a int primary key, b varchar(64))
+ DEFAULT CHARSET=utf8;
+connection master;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval create table federated.t1 (a int primary key, b varchar(64))
+ ENGINE=FEDERATED
+ connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'
+ DEFAULT CHARSET=utf8;
+
+--error ER_DUP_KEY
+insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe")
+on duplicate key update a=a+100;
+select * from federated.t1;
+
+drop table federated.t1;
+connection slave;
+drop table federated.t1;
+
+--echo
+--echo Bug#18287 create federated table always times out, error 1159 ' '
+--echo
+--echo Test that self-references work
+--echo
+connection slave;
+create table federated.t1 (a int primary key);
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval create table federated.t2 (a int primary key)
+ ENGINE=FEDERATED
+ connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
+insert into federated.t1 (a) values (1);
+select * from federated.t2;
+drop table federated.t1, federated.t2;
+
+#
+# BUG#29875 Disable support for transactions
+#
+connection slave;
+CREATE TABLE federated.t1 (a INT PRIMARY KEY) DEFAULT CHARSET=utf8;
+connection master;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval CREATE TABLE federated.t1 (a INT PRIMARY KEY)
+ ENGINE=FEDERATED
+ CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'
+ DEFAULT CHARSET=utf8;
+
+SELECT transactions FROM information_schema.engines WHERE engine="FEDERATED";
+INSERT INTO federated.t1 VALUES (1);
+SET autocommit=0;
+INSERT INTO federated.t1 VALUES (2);
+ROLLBACK;
+SET autocommit=1;
+SELECT * FROM federated.t1;
+
+DROP TABLE federated.t1;
+connection slave;
+DROP TABLE federated.t1;
+
+--echo End of 5.1 tests
source include/federated_cleanup.inc;
diff --git a/mysql-test/t/federated_bug_25714.test b/mysql-test/t/federated_bug_25714.test
new file mode 100644
index 00000000000..9c185181511
--- /dev/null
+++ b/mysql-test/t/federated_bug_25714.test
@@ -0,0 +1,47 @@
+--source include/have_bug25714.inc
+source include/federated.inc;
+
+
+connection slave;
+--disable_warnings
+DROP TABLE IF EXISTS federated.bug_13118_table;
+--enable_warnings
+
+CREATE TABLE federated.t1 (
+ `id` int auto_increment primary key,
+ `value` int
+ ) ENGINE=MyISAM;
+INSERT INTO federated.t1 SET value=1;
+INSERT INTO federated.t1 SET value=2;
+INSERT INTO federated.t1 SET value=2;
+
+connection master;
+--disable_warnings
+DROP TABLE IF EXISTS federated.t1;
+--enable_warnings
+
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval CREATE TABLE federated.t1 (
+ `id` int auto_increment primary key,
+ `value` int
+ ) ENGINE=FEDERATED
+ CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
+
+SELECT * from federated.t1;
+
+INSERT INTO federated.t1 SET value=4;
+
+SELECT LAST_INSERT_ID();
+
+--exec $MYSQL_BUG25714 $SLAVE_MYPORT
+--exec $MYSQL_BUG25714 $MASTER_MYPORT
+
+SELECT * from federated.t1;
+
+DROP TABLE federated.t1;
+connection slave;
+DROP TABLE federated.t1;
+
+
+source include/federated_cleanup.inc;
+
diff --git a/mysql-test/t/rpl_insert_ignore-slave.opt b/mysql-test/t/federated_innodb-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_insert_ignore-slave.opt
+++ b/mysql-test/t/federated_innodb-slave.opt
diff --git a/mysql-test/t/federated_innodb.test b/mysql-test/t/federated_innodb.test
new file mode 100644
index 00000000000..772e37a2929
--- /dev/null
+++ b/mysql-test/t/federated_innodb.test
@@ -0,0 +1,34 @@
+source include/federated.inc;
+source include/have_innodb.inc;
+
+#
+# Bug#25513 Federated transaction failures
+#
+connection slave;
+create table federated.t1 (a int primary key, b varchar(64))
+ engine=myisam;
+connection master;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval create table federated.t1 (a int primary key, b varchar(64))
+ engine=federated
+ connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
+
+--error ER_DUP_KEY
+insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe");
+select * from federated.t1;
+
+connection slave;
+truncate federated.t1;
+alter table federated.t1 engine=innodb;
+connection master;
+
+--error ER_DUP_KEY
+insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe");
+select * from federated.t1;
+
+drop table federated.t1;
+connection slave;
+drop table federated.t1;
+
+
+source include/federated_cleanup.inc;
diff --git a/mysql-test/t/federated_transactions-slave.opt b/mysql-test/t/federated_transactions-slave.opt
index 627becdbfb5..48457b17309 100644
--- a/mysql-test/t/federated_transactions-slave.opt
+++ b/mysql-test/t/federated_transactions-slave.opt
@@ -1 +1 @@
---innodb
+--loose-innodb
diff --git a/mysql-test/t/flush.test b/mysql-test/t/flush.test
index 3a4f2f2f5f2..d58d038c3ea 100644
--- a/mysql-test/t/flush.test
+++ b/mysql-test/t/flush.test
@@ -133,4 +133,28 @@ disconnect con3;
connection default;
drop table t1, t2;
-# End of 5.0 tests
+--echo End of 5.0 tests
+
+#
+# Bug #26380: LOCK TABLES + FLUSH LOGS causes deadlock
+#
+set @old_general_log= @@general_log;
+set @old_read_only= @@read_only;
+set global general_log= on;
+
+flush tables with read lock;
+flush logs;
+unlock tables;
+
+set global read_only=1;
+flush logs;
+unlock tables;
+
+flush tables with read lock;
+flush logs;
+unlock tables;
+
+set global general_log= @old_general_log;
+set global read_only= @old_read_only;
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/flush_block_commit_notembedded.test b/mysql-test/t/flush_block_commit_notembedded.test
index 4650a5a15a8..4a0300acf78 100644
--- a/mysql-test/t/flush_block_commit_notembedded.test
+++ b/mysql-test/t/flush_block_commit_notembedded.test
@@ -3,8 +3,10 @@
# We verify that we did not introduce a deadlock.
# This is intended to mimick how mysqldump and innobackup work.
+-- source include/have_log_bin.inc
+
# And it requires InnoDB
--- source include/not_embedded.inc
+-- source include/have_log_bin.inc
-- source include/have_innodb.inc
connect (con1,localhost,root,,);
diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test
index 537ab5888bd..1f8a3b82cfd 100644
--- a/mysql-test/t/fulltext.test
+++ b/mysql-test/t/fulltext.test
@@ -399,4 +399,14 @@ ALTER TABLE t1 DISABLE KEYS;
SELECT * FROM t1 WHERE MATCH(a) AGAINST('test');
DROP TABLE t1;
+#
+# BUG#29445 - match ... against () never returns
+#
+CREATE TABLE t1(a VARCHAR(20), FULLTEXT(a));
+INSERT INTO t1 VALUES('Offside'),('City Of God');
+SELECT a FROM t1 WHERE MATCH a AGAINST ('+city of*' IN BOOLEAN MODE);
+SELECT a FROM t1 WHERE MATCH a AGAINST ('+city (of*)' IN BOOLEAN MODE);
+SELECT a FROM t1 WHERE MATCH a AGAINST ('+city* of*' IN BOOLEAN MODE);
+DROP TABLE t1;
+
# End of 4.1 tests
diff --git a/mysql-test/t/fulltext3.test b/mysql-test/t/fulltext3.test
new file mode 100644
index 00000000000..1b6a07c540f
--- /dev/null
+++ b/mysql-test/t/fulltext3.test
@@ -0,0 +1,34 @@
+--source include/have_gbk.inc
+#
+# test of new fulltext search features
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+
+#
+# BUG#29299 - repeatable myisam fulltext index corruption
+#
+CREATE TABLE t1(a VARCHAR(255) CHARACTER SET gbk, FULLTEXT(a));
+SET NAMES utf8;
+INSERT INTO t1 VALUES(0xF043616161),(0xBEF361616197C22061616161);
+SELECT HEX(a) FROM t1 WHERE MATCH(a) AGAINST(0x97C22061616161 IN BOOLEAN MODE);
+DELETE FROM t1 LIMIT 1;
+CHECK TABLE t1;
+SET NAMES latin1;
+DROP TABLE t1;
+
+# End of 5.0 tests
+
+#
+# BUG#29464 - load data infile into table with big5 chinese fulltext index
+# hangs 100% cpu
+#
+CREATE TABLE t1(a VARCHAR(2) CHARACTER SET big5 COLLATE big5_chinese_ci,
+FULLTEXT(a));
+INSERT INTO t1 VALUES(0xA3C2);
+DROP TABLE t1;
+
+# End of 5.1 tests
diff --git a/mysql-test/t/func_date_add.test b/mysql-test/t/func_date_add.test
index b575eeececa..fc5a5cb2823 100644
--- a/mysql-test/t/func_date_add.test
+++ b/mysql-test/t/func_date_add.test
@@ -77,4 +77,14 @@ SELECT CAST('2006-09-26' AS DATE) + INTERVAL 1 MONTH;
SELECT CAST('2006-09-26' AS DATE) + INTERVAL 1 YEAR;
SELECT CAST('2006-09-26' AS DATE) + INTERVAL 1 WEEK;
+#
+# Bug#28450: The Item_date_add_interval in select list may fail the field
+# type assertion.
+#
+create table t1 (a int, b varchar(10));
+insert into t1 values (1, '2001-01-01'),(2, '2002-02-02');
+select '2007-01-01' + interval a day from t1;
+select b + interval a day from t1;
+drop table t1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test
index 431d582be50..6f9b5399b7b 100644
--- a/mysql-test/t/func_gconcat.test
+++ b/mysql-test/t/func_gconcat.test
@@ -507,4 +507,59 @@ SELECT GROUP_CONCAT(DISTINCT UCASE(a)) FROM t1;
SELECT GROUP_CONCAT(DISTINCT UCASE(b)) FROM t1;
DROP TABLE t1;
+#
+# Bug #28273: GROUP_CONCAT and ORDER BY: No warning when result gets truncated.
+#
+CREATE TABLE t1( a VARCHAR( 10 ), b INT );
+INSERT INTO t1 VALUES ( repeat( 'a', 10 ), 1),
+ ( repeat( 'b', 10 ), 2);
+SET group_concat_max_len = 20;
+SELECT GROUP_CONCAT( a ) FROM t1;
+SELECT GROUP_CONCAT( DISTINCT a ) FROM t1;
+SELECT GROUP_CONCAT( a ORDER BY b ) FROM t1;
+SELECT GROUP_CONCAT( DISTINCT a ORDER BY b ) FROM t1;
+SET group_concat_max_len = DEFAULT;
+DROP TABLE t1;
+# Bug #23856:GROUP_CONCAT and ORDER BY: junk from previous rows for query on I_S
+#
+SET group_concat_max_len= 65535;
+CREATE TABLE t1( a TEXT, b INTEGER );
+INSERT INTO t1 VALUES ( 'a', 0 ), ( 'b', 1 );
+SELECT GROUP_CONCAT( a ORDER BY b ) FROM t1;
+SELECT GROUP_CONCAT(DISTINCT a ORDER BY b) FROM t1;
+SELECT GROUP_CONCAT(DISTINCT a) FROM t1;
+SET group_concat_max_len= 10;
+SELECT GROUP_CONCAT(a ORDER BY b) FROM t1;
+SELECT GROUP_CONCAT(DISTINCT a ORDER BY b) FROM t1;
+SELECT GROUP_CONCAT(DISTINCT a) FROM t1;
+
+SET group_concat_max_len= 65535;
+CREATE TABLE t2( a TEXT );
+INSERT INTO t2 VALUES( REPEAT( 'a', 5000 ) );
+INSERT INTO t2 VALUES( REPEAT( 'b', 5000 ) );
+INSERT INTO t2 VALUES( REPEAT( 'a', 5000 ) );
+SELECT LENGTH( GROUP_CONCAT( DISTINCT a ) ) FROM t2;
+
+CREATE TABLE t3( a TEXT, b INT );
+INSERT INTO t3 VALUES( REPEAT( 'a', 65534 ), 1 );
+INSERT INTO t3 VALUES( REPEAT( 'a', 65535 ), 2 );
+INSERT INTO t3 VALUES( REPEAT( 'a', 65536 ), 3 );
+SELECT LENGTH( GROUP_CONCAT( a ) ) FROM t3 WHERE b = 1;
+SELECT LENGTH( GROUP_CONCAT( a ) ) FROM t3 WHERE b = 2;
+SELECT LENGTH( GROUP_CONCAT( a ) ) FROM t3 WHERE b = 3;
+
+SET group_concat_max_len= DEFAULT;
+DROP TABLE t1, t2, t3;
+
+#
+# Bug#29850: Wrong charset of the GROUP_CONCAT result when the select employs
+# a temporary table.
+#
+set names latin1;
+create table t1 (id int, name varchar(20)) DEFAULT CHARSET=utf8;
+insert into t1 (id, name) values (1, "óra");
+insert into t1 (id, name) values (2, "óra");
+select b.id, group_concat(b.name) from t1 a, t1 b group by b.id;
+drop table t1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test
index 778bfc9528f..d1b4919c83e 100644
--- a/mysql-test/t/func_group.test
+++ b/mysql-test/t/func_group.test
@@ -834,4 +834,38 @@ SELECT a,AVG(DISTINCT b) AS average FROM t1 GROUP BY a HAVING average > 50;
DROP TABLE t1;
+#
+# Bug #27573: MIN() on an indexed column which is always NULL sets _other_
+# results to NULL
+#
+CREATE TABLE t1 ( a INT, b INT, KEY(a) );
+INSERT INTO t1 VALUES (NULL, 1), (NULL, 2);
+EXPLAIN SELECT MIN(a), MIN(b) FROM t1;
+SELECT MIN(a), MIN(b) FROM t1;
+
+CREATE TABLE t2( a INT, b INT, c INT, KEY(a, b) );
+INSERT INTO t2 ( a, b, c ) VALUES ( 1, NULL, 2 ), ( 1, 3, 4 ), ( 1, 4, 4 );
+EXPLAIN SELECT MIN(b), MIN(c) FROM t2 WHERE a = 1;
+SELECT MIN(b), MIN(c) FROM t2 WHERE a = 1;
+
+CREATE TABLE t3 (a INT, b INT, c int, KEY(a, b));
+INSERT INTO t3 VALUES (1, NULL, 1), (2, NULL, 2), (2, NULL, 2), (3, NULL, 3);
+EXPLAIN SELECT MIN(a), MIN(b) FROM t3 where a = 2;
+SELECT MIN(a), MIN(b) FROM t3 where a = 2;
+
+CREATE TABLE t4 (a INT, b INT, c int, KEY(a, b));
+INSERT INTO t4 VALUES (1, 1, 1), (2, NULL, 2), (2, NULL, 2), (3, 1, 3);
+EXPLAIN SELECT MIN(a), MIN(b) FROM t4 where a = 2;
+SELECT MIN(a), MIN(b) FROM t4 where a = 2;
+SELECT MIN(b), min(c) FROM t4 where a = 2;
+
+CREATE TABLE t5( a INT, b INT, KEY( a, b) );
+INSERT INTO t5 VALUES( 1, 1 ), ( 1, 2 );
+EXPLAIN SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1;
+SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1;
+SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1 and b > 1;
+
+DROP TABLE t1, t2, t3, t4, t5;
+
+###
--echo End of 5.0 tests
diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test
index e9583f982ff..2c5ed6a22d3 100644
--- a/mysql-test/t/func_in.test
+++ b/mysql-test/t/func_in.test
@@ -336,19 +336,28 @@ insert into t2 values(13491727406643098568),
(0x8000004000000001),
(0x8000040000000001);
-SELECT HEX(a) FROM t2 WHERE a IN (0xBB3C3E98175D33C8, 42);
+SELECT HEX(a) FROM t2 WHERE a IN
+ (CAST(0xBB3C3E98175D33C8 AS UNSIGNED),
+ 42);
SELECT HEX(a) FROM t2 WHERE a IN
-(0xBB3C3E98175D33C8,
- 0x7fffffffffffffff,
- 0x8000000000000000,
- 0x8000000000000400,
- 0x8000000000000401,
- 42);
-
-SELECT HEX(a) FROM t2 WHERE a IN (0x7fffffffffffffff,0x8000000000000001);
-SELECT HEX(a) FROM t2 WHERE a IN (0x7ffffffffffffffe,0x7fffffffffffffff);
-SELECT HEX(a) FROM t2 WHERE a IN (0x7ffffffffffffffe,0x7fffffffffffffff,'abc');
+ (CAST(0xBB3C3E98175D33C8 AS UNSIGNED),
+ CAST(0x7fffffffffffffff AS UNSIGNED),
+ CAST(0x8000000000000000 AS UNSIGNED),
+ CAST(0x8000000000000400 AS UNSIGNED),
+ CAST(0x8000000000000401 AS UNSIGNED),
+ 42);
+
+SELECT HEX(a) FROM t2 WHERE a IN
+ (CAST(0x7fffffffffffffff AS UNSIGNED),
+ CAST(0x8000000000000001 AS UNSIGNED));
+SELECT HEX(a) FROM t2 WHERE a IN
+ (CAST(0x7ffffffffffffffe AS UNSIGNED),
+ CAST(0x7fffffffffffffff AS UNSIGNED));
+SELECT HEX(a) FROM t2 WHERE a IN
+ (0x7ffffffffffffffe,
+ 0x7fffffffffffffff,
+ 'abc');
CREATE TABLE t3 (a BIGINT UNSIGNED);
INSERT INTO t3 VALUES (9223372036854775551);
diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test
index 8ff62f68e45..01eff55d1f6 100644
--- a/mysql-test/t/func_misc.test
+++ b/mysql-test/t/func_misc.test
@@ -2,6 +2,10 @@
# Testing of misc functions
#
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
select format(1.5555,0),format(123.5555,1),format(1234.5555,2),format(12345.55555,3),format(123456.5555,4),format(1234567.5555,5),format("12345.2399",2);
select inet_ntoa(inet_aton("255.255.255.255.255.255.255.255"));
@@ -14,6 +18,12 @@ select hex(inet_aton('127.1.1'));
select length(uuid()), charset(uuid()), length(unhex(replace(uuid(),_utf8'-',_utf8'')));
+# As we can assume we are the only user for the mysqld server, the difference
+# between two calls should be -1
+set @a= uuid_short();
+set @b= uuid_short();
+select cast(@a - @b as signed);
+
#
# Test for core dump with nan
#
@@ -42,9 +52,6 @@ drop table t1;
#
# Bug#16501: IS_USED_LOCK does not appear to work
#
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
CREATE TABLE t1 (conn CHAR(7), connection_id INT);
INSERT INTO t1 VALUES ('default', CONNECTION_ID());
@@ -89,7 +96,9 @@ select export_set(3, _latin1'foo', _utf8'bar', ',', 4);
#
# Test for BUG#9535
#
+--disable_warnings
create table t1 as select uuid(), length(uuid());
+--enable_warnings
show create table t1;
drop table t1;
@@ -190,3 +199,11 @@ drop function func_26093_a;
drop function func_26093_b;
--echo End of 5.0 tests
+
+#
+# Bug #30389: connection_id() always return 0 in embedded server
+#
+
+select connection_id() > 0;
+
+--echo End of tests
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index ddb3d2baf7f..945f5a050f4 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -1183,4 +1183,52 @@ SELECT * FROM (SELECT * FROM v1) x;
DROP TABLE t1, t2;
DROP VIEW v1;
+#
+# Bug #27932: LOCATE with argument evaluated to NULL
+#
+
+SELECT LOCATE('foo', NULL) FROM DUAL;
+SELECT LOCATE(NULL, 'o') FROM DUAL;
+SELECT LOCATE(NULL, NULL) FROM DUAL;
+SELECT LOCATE('foo', NULL) IS NULL FROM DUAL;
+SELECT LOCATE(NULL, 'o') IS NULL FROM DUAL;
+SELECT LOCATE(NULL, NULL) IS NULL FROM DUAL;
+SELECT ISNULL(LOCATE('foo', NULL)) FROM DUAL;
+SELECT ISNULL(LOCATE(NULL, 'o')) FROM DUAL;
+SELECT ISNULL(LOCATE(NULL, NULL)) FROM DUAL;
+SELECT LOCATE('foo', NULL) <=> NULL FROM DUAL;
+SELECT LOCATE(NULL, 'o') <=> NULL FROM DUAL;
+SELECT LOCATE(NULL, NULL) <=> NULL FROM DUAL;
+
+CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, a varchar(10), p varchar(10));
+
+INSERT INTO t1 VALUES (1, 'foo', 'o');
+INSERT INTO t1 VALUES (2, 'foo', NULL);
+INSERT INTO t1 VALUES (3, NULL, 'o');
+INSERT INTO t1 VALUES (4, NULL, NULL);
+
+SELECT id, LOCATE(a,p) FROM t1;
+SELECT id, LOCATE(a,p) IS NULL FROM t1;
+SELECT id, ISNULL(LOCATE(a,p)) FROM t1;
+SELECT id, LOCATE(a,p) <=> NULL FROM t1;
+SELECT id FROM t1 WHERE LOCATE(a,p) IS NULL;
+SELECT id FROM t1 WHERE LOCATE(a,p) <=> NULL;
+
+DROP TABLE t1;
+
+#
+# Bug #27130: SUBSTR with UNSIGNED 0 as the last argument
+#
+
+SELECT SUBSTR('foo',1,0) FROM DUAL;
+SELECT SUBSTR('foo',1,CAST(0 AS SIGNED)) FROM DUAL;
+SELECT SUBSTR('foo',1,CAST(0 AS UNSIGNED)) FROM DUAL;
+
+CREATE TABLE t1 (a varchar(10), len int unsigned);
+INSERT INTO t1 VALUES ('bar', 2), ('foo', 0);
+
+SELECT SUBSTR(a,1,len) FROM t1;
+
+DROP TABLE t1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index 4b952b66ff3..d3346bbb880 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -423,11 +423,11 @@ select strcmp(concat(utc_date(),' ',utc_time()),utc_timestamp())=0;
explain extended select period_add("9602",-12),period_diff(199505,"9404"),from_days(to_days("960101")),dayofmonth("1997-01-02"), month("1997-01-02"), monthname("1972-03-04"),dayofyear("0000-00-00"),HOUR("1997-03-03 23:03:22"),MINUTE("23:03:22"),SECOND(230322),QUARTER(980303),WEEK("1998-03-03"),yearweek("2000-01-01",1),week(19950101,1),year("98-02-03"),weekday(curdate())-weekday(now()),dayname("1962-03-03"),unix_timestamp(),sec_to_time(time_to_sec("0:30:47")/6.21),curtime(),utc_time(),curdate(),utc_date(),utc_timestamp(),date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w"),from_unixtime(unix_timestamp("1994-03-02 10:11:12")),"1997-12-31 23:59:59" + INTERVAL 1 SECOND,"1998-01-01 00:00:00" - INTERVAL 1 SECOND,INTERVAL 1 DAY + "1997-12-31", extract(YEAR FROM "1999-01-02 10:11:12"),date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND);
-SET @TMP=NOW();
+SET @TMP='2007-08-01 12:22:49';
CREATE TABLE t1 (d DATETIME);
-INSERT INTO t1 VALUES (NOW());
-INSERT INTO t1 VALUES (NOW());
-INSERT INTO t1 VALUES (NOW());
+INSERT INTO t1 VALUES ('2007-08-01 12:22:59');
+INSERT INTO t1 VALUES ('2007-08-01 12:23:01');
+INSERT INTO t1 VALUES ('2007-08-01 12:23:20');
SELECT count(*) FROM t1 WHERE d>FROM_DAYS(TO_DAYS(@TMP)) AND d<=FROM_DAYS(TO_DAYS(@TMP)+1);
DROP TABLE t1;
@@ -731,6 +731,31 @@ DROP TABLE t1;
# Check if using GROUP BY with TIME_FORMAT() produces correct results
SELECT TIME_FORMAT(SEC_TO_TIME(a),"%H:%i:%s") FROM (SELECT 3020399 AS a UNION SELECT 3020398 ) x GROUP BY 1;
+
+#
+# Bug#28875 Conversion between ASCII and LATIN1 charsets does not function
+#
+set names latin1;
+create table t1 (a varchar(15) character set ascii not null);
+insert into t1 values ('070514-000000');
+# Conversion of date_format() result to ASCII
+# is safe with the default locale en_US
+--replace_column 1 #
+select concat(a,ifnull(min(date_format(now(), '%Y-%m-%d')),' ull')) from t1;
+# Error for swe7: it is not ASCII compatible
+set names swe7;
+--error 1267
+select concat(a,ifnull(min(date_format(now(), '%Y-%m-%d')),' ull')) from t1;
+set names latin1;
+# Conversion of date_format() result to ASCII
+# is not safe with the non-default locale fr_FR
+# because month and day names can have accented characters
+set lc_time_names=fr_FR;
+--error 1267
+select concat(a,ifnull(min(date_format(now(), '%Y-%m-%d')),' ull')) from t1;
+set lc_time_names=en_US;
+drop table t1;
+
--echo End of 5.0 tests
#
diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test
index 579ec65f149..88f31143d93 100644
--- a/mysql-test/t/gis-rtree.test
+++ b/mysql-test/t/gis-rtree.test
@@ -827,3 +827,22 @@ INSERT INTO t1 (b) SELECT b FROM t1;
OPTIMIZE TABLE t1;
DROP TABLE t1;
+
+
+#
+# Bug #29070: Error in spatial index
+#
+
+CREATE TABLE t1 (a INT, b GEOMETRY NOT NULL, SPATIAL KEY b(b));
+INSERT INTO t1 VALUES (1, GEOMFROMTEXT('LINESTRING(1102218.456 1,2000000 2)'));
+INSERT INTO t1 VALUES (2, GEOMFROMTEXT('LINESTRING(1102218.456 1,2000000 2)'));
+
+# must return the same number as the next select
+SELECT COUNT(*) FROM t1 WHERE
+ MBRINTERSECTS(b, GEOMFROMTEXT('LINESTRING(1 1,1102219 2)') );
+SELECT COUNT(*) FROM t1 IGNORE INDEX (b) WHERE
+ MBRINTERSECTS(b, GEOMFROMTEXT('LINESTRING(1 1,1102219 2)') );
+
+DROP TABLE t1;
+
+--echo End of 5.0 tests.
diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test
index 3845bdcb983..d7182e36e3a 100644
--- a/mysql-test/t/gis.test
+++ b/mysql-test/t/gis.test
@@ -558,6 +558,39 @@ SELECT Overlaps(@horiz1, @point2) FROM DUAL;
DROP TABLE t1;
+#
+# Bug#28763: Selecting geometry fields in UNION caused server crash.
+#
+create table t1(f1 geometry, f2 point, f3 linestring);
+select f1 from t1 union select f1 from t1;
+insert into t1 (f2,f3) values (GeomFromText('POINT(1 1)'),
+ GeomFromText('LINESTRING(0 0,1 1,2 2)'));
+select AsText(f2),AsText(f3) from t1;
+select AsText(a) from (select f2 as a from t1 union select f3 from t1) t;
+create table t2 as select f2 as a from t1 union select f3 from t1;
+desc t2;
+select AsText(a) from t2;
+drop table t1, t2;
+
+#
+# Bug #29166: MYsql crash when query is run
+#
+
+# The test query itself is not logged : too large output.
+# The real test is the second query : see if the first hasn't crashed the
+# server
+--disable_query_log
+--disable_result_log
+SELECT AsText(GeometryFromText(CONCAT(
+ 'MULTIPOLYGON(((',
+ REPEAT ('-0.00000000001234567890123456789012 -0.123456789012345678,', 1000),
+ '-0.00000000001234567890123456789012 -0.123456789012345678',
+ ')))'
+))) AS a;
+--enable_result_log
+--enable_query_log
+SELECT 1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index d2b384b6559..e33712e1ebf 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -415,6 +415,7 @@ connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user1;
-- error 1142
alter table t1 rename t2;
+disconnect user1;
connection root;
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
delete from mysql.user where user=_binary'mysqltest_1';
@@ -861,7 +862,7 @@ CREATE TABLE mysqltest1.t2 (int_field INT);
CREATE USER mysqltest_1@localhost;
GRANT SELECT ON mysqltest1.t1 TO mysqltest_1@localhost;
---connect (conn42,localhost,mysqltest_1,,mysqltest1);
+connect (conn42,localhost,mysqltest_1,,mysqltest1);
SELECT USER();
SHOW GRANTS;
--error ER_TABLEACCESS_DENIED_ERROR
@@ -872,7 +873,7 @@ ALTER TABLE t1 RENAME TO t2;
--connection default
GRANT DROP ON mysqltest1.t1 TO mysqltest_1@localhost;
---connect (conn42,localhost,mysqltest_1,,mysqltest1);
+connect (conn42,localhost,mysqltest_1,,mysqltest1);
--error ER_TABLEACCESS_DENIED_ERROR
RENAME TABLE t1 TO t2;
--error ER_TABLEACCESS_DENIED_ERROR
@@ -881,7 +882,7 @@ ALTER TABLE t1 RENAME TO t2;
--connection default
GRANT ALTER ON mysqltest1.t1 TO mysqltest_1@localhost;
---connect (conn42,localhost,mysqltest_1,,mysqltest1);
+connect (conn42,localhost,mysqltest_1,,mysqltest1);
SHOW GRANTS;
--error ER_TABLEACCESS_DENIED_ERROR
RENAME TABLE t1 TO t2;
@@ -890,7 +891,7 @@ ALTER TABLE t1 RENAME TO t2;
--disconnect conn42
--connection default
GRANT INSERT, CREATE ON mysqltest1.t1 TO mysqltest_1@localhost;
---connect (conn42,localhost,mysqltest_1,,mysqltest1);
+connect (conn42,localhost,mysqltest_1,,mysqltest1);
SHOW GRANTS;
--error ER_TABLEACCESS_DENIED_ERROR
--disconnect conn42
@@ -898,7 +899,7 @@ SHOW GRANTS;
GRANT INSERT, SELECT, CREATE, ALTER, DROP ON mysqltest1.t2 TO mysqltest_1@localhost;
DROP TABLE mysqltest1.t2;
---connect (conn42,localhost,mysqltest_1,,mysqltest1);
+connect (conn42,localhost,mysqltest_1,,mysqltest1);
SHOW GRANTS;
RENAME TABLE t1 TO t2;
RENAME TABLE t2 TO t1;
@@ -909,7 +910,7 @@ ALTER TABLE t2 RENAME TO t1;
REVOKE DROP, INSERT ON mysqltest1.t1 FROM mysqltest_1@localhost;
REVOKE DROP, INSERT ON mysqltest1.t2 FROM mysqltest_1@localhost;
---connect (conn42,localhost,mysqltest_1,,mysqltest1);
+connect (conn42,localhost,mysqltest_1,,mysqltest1);
SHOW GRANTS;
--error ER_TABLEACCESS_DENIED_ERROR
RENAME TABLE t1 TO t2;
@@ -1002,7 +1003,7 @@ DROP USER bug23556@localhost;
# Bug #6774: Replication fails with Wrong usage of DB GRANT and GLOBAL PRIVILEGES
#
# Check if GRANT ... ON * ... fails when no database is selected
-connect (con1, localhost, root,,*NO-ONE*)
+connect (con1, localhost, root,,*NO-ONE*);
connection con1;
--error ER_NO_DB_ERROR
GRANT PROCESS ON * TO user@localhost;
@@ -1235,6 +1236,30 @@ DROP DATABASE mysqltest2;
DROP USER mysqltest_1@localhost;
+#
+# Bug#27878: Unchecked privileges on a view referring to a table from another
+# database.
+#
+use test;
+CREATE TABLE t1 (f1 int, f2 int);
+INSERT INTO t1 VALUES(1,1), (2,2);
+CREATE DATABASE db27878;
+GRANT UPDATE(f1) ON t1 TO 'mysqltest_1'@'localhost';
+GRANT SELECT ON `test`.* TO 'mysqltest_1'@'localhost';
+GRANT ALL ON db27878.* TO 'mysqltest_1'@'localhost';
+use db27878;
+CREATE SQL SECURITY INVOKER VIEW db27878.v1 AS SELECT * FROM test.t1;
+connect (user1,localhost,mysqltest_1,,test);
+connection user1;
+use db27878;
+--error 1356
+UPDATE v1 SET f2 = 4;
+SELECT * FROM test.t1;
+disconnect user1;
+connection default;
+DROP DATABASE db27878;
+use test;
+DROP TABLE t1;
--echo End of 5.0 tests
@@ -1246,6 +1271,6 @@ grant select on test.* to юзер_юзер@localhost;
--exec $MYSQL --default-character-set=utf8 --user=юзер_юзер -e "select user()"
revoke all on test.* from юзер_юзер@localhost;
drop user юзер_юзер@localhost;
---error 1573
+--error ER_WRONG_STRING_LENGTH
grant select on test.* to очень_длинный_юзер@localhost;
set names default;
diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test
index 866c5a8a4b3..f6075ba2ee4 100644
--- a/mysql-test/t/grant2.test
+++ b/mysql-test/t/grant2.test
@@ -513,3 +513,77 @@ REVOKE ALL PRIVILEGES, GRANT OPTION FROM `a@`@localhost;
drop user `a@`@localhost;
SET GLOBAL log_bin_trust_function_creators = 0;
+
+
+#
+# Bug#25578 "CREATE TABLE LIKE does not require any privileges on source table"
+#
+--disable_warnings
+drop database if exists mysqltest_1;
+drop database if exists mysqltest_2;
+--enable_warnings
+--error 0,ER_CANNOT_USER
+drop user mysqltest_u1@localhost;
+
+create database mysqltest_1;
+create database mysqltest_2;
+grant all on mysqltest_1.* to mysqltest_u1@localhost;
+use mysqltest_2;
+create table t1 (i int);
+
+# Connect as user with all rights on mysqltest_1 but with no rights on mysqltest_2.
+connect (user1,localhost,mysqltest_u1,,mysqltest_1);
+connection user1;
+# As expected error is emitted
+--error ER_TABLEACCESS_DENIED_ERROR
+show create table mysqltest_2.t1;
+# This should emit error as well
+--error ER_TABLEACCESS_DENIED_ERROR
+create table t1 like mysqltest_2.t1;
+
+# Now let us check that SELECT privilege on the source is enough
+connection default;
+grant select on mysqltest_2.t1 to mysqltest_u1@localhost;
+connection user1;
+show create table mysqltest_2.t1;
+create table t1 like mysqltest_2.t1;
+
+# Clean-up
+connection default;
+use test;
+drop database mysqltest_1;
+drop database mysqltest_2;
+drop user mysqltest_u1@localhost;
+
+#
+# Bug#18660 Can't grant any privileges on single table in database
+# with underscore char
+#
+grant all on `mysqltest\_%`.* to mysqltest_1@localhost with grant option;
+grant usage on *.* to mysqltest_2@localhost;
+connect (con18600_1,localhost,mysqltest_1,,);
+
+create database mysqltest_1;
+use mysqltest_1;
+create table t1 (f1 int);
+
+grant create on `mysqltest\_1`.* to mysqltest_2@localhost;
+grant select on mysqltest_1.t1 to mysqltest_2@localhost;
+connect (con3,localhost,mysqltest_2,,);
+connection con3;
+--error 1044
+create database mysqltest_3;
+use mysqltest_1;
+create table t2(f1 int);
+select * from t1;
+connection default;
+drop database mysqltest_1;
+
+revoke all privileges, grant option from mysqltest_1@localhost;
+revoke all privileges, grant option from mysqltest_2@localhost;
+drop user mysqltest_1@localhost;
+drop user mysqltest_2@localhost;
+
+
+--echo End of 5.0 tests
+
diff --git a/mysql-test/t/grant_cache.test b/mysql-test/t/grant_cache.test
deleted file mode 100644
index 10e571fc5f5..00000000000
--- a/mysql-test/t/grant_cache.test
+++ /dev/null
@@ -1,185 +0,0 @@
-# Grant tests not performed with embedded server
--- source include/not_embedded.inc
--- source include/have_query_cache.inc
-# See at the end of the test why we disable the ps protocol (*)
--- disable_ps_protocol
-
---source include/add_anonymous_users.inc
-
-#
-# Test grants with query cache
-#
---disable_warnings
-drop table if exists test.t1,mysqltest.t1,mysqltest.t2;
-drop database if exists mysqltest;
---enable_warnings
-
-set GLOBAL query_cache_size=1355776;
-
-reset query cache;
-flush status;
-connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
-connection root;
-show grants for current_user;
-show grants;
---disable_warnings
-create database if not exists mysqltest;
---enable_warnings
-
-create table mysqltest.t1 (a int,b int,c int);
-create table mysqltest.t2 (a int,b int,c int);
-insert into mysqltest.t1 values (1,1,1),(2,2,2);
-insert into mysqltest.t2 values (3,3,3);
-create table test.t1 (a char (10));
-insert into test.t1 values ("test.t1");
-select * from t1;
-connect (root2,localhost,root,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
-connection root2;
-# put queries in cache
-select * from t1;
-select a from t1;
-select c from t1;
-select * from t2;
-select * from mysqltest.t1,test.t1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_hits%";
-
-# Create the test users
-grant SELECT on mysqltest.* to mysqltest_1@localhost;
-grant SELECT on mysqltest.t1 to mysqltest_2@localhost;
-grant SELECT on test.t1 to mysqltest_2@localhost;
-grant SELECT(a) on mysqltest.t1 to mysqltest_3@localhost;
-
-# The following queries should be fetched from cache
-connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
-connection user1;
-show grants for current_user();
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_hits";
-show status like "Qcache_not_cached";
-select "user1";
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_hits";
-show status like "Qcache_not_cached";
-select * from t1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_hits";
-show status like "Qcache_not_cached";
-# The pre and end space are intentional
- select a from t1 ;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_hits";
-show status like "Qcache_not_cached";
-select c from t1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_hits";
-show status like "Qcache_not_cached";
-
-
-# Don't use '' as user because it will pick Unix login
-connect (unkuser,localhost,unkuser,,,$MASTER_MYPORT,$MASTER_MYSOCK);
-connection unkuser;
-show grants for current_user();
-
-# The following queries should be fetched from cache
-connect (user2,localhost,mysqltest_2,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
-connection user2;
-select "user2";
-select * from t1;
-select a from t1;
-select c from t1;
-select * from mysqltest.t1,test.t1;
---replace_result 127.0.0.1 localhost
---error 1142
-select * from t2;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_hits";
-show status like "Qcache_not_cached";
-
-# The following queries should not be fetched from cache
-connect (user3,localhost,mysqltest_3,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
-connection user3;
-select "user3";
---replace_result 127.0.0.1 localhost
---error 1143
-select * from t1;
-select a from t1;
---replace_result 127.0.0.1 localhost
---error 1143
-select c from t1;
---replace_result 127.0.0.1 localhost
---error 1142
-select * from t2;
---replace_result 127.0.0.1 localhost
---error 1143
-select mysqltest.t1.c from test.t1,mysqltest.t1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_hits";
-show status like "Qcache_not_cached";
-
-# Connect without a database
-connect (user4,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,$MASTER_MYSOCK);
-connection user4;
-select "user4";
-show grants;
---error 1046
-select a from t1;
-# The following query is not cached before (different database)
-select * from mysqltest.t1,test.t1;
-# Cache a query with 'no database'
-select a from mysqltest.t1;
-select a from mysqltest.t1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_hits";
-show status like "Qcache_not_cached";
-
-# Cleanup
-
-connection root;
-#
-# A temporary 4.1 workaround to make this test pass if
-# mysql was compiled with other than latin1 --with-charset=XXX.
-# Without "set names binary" the below queries fail with
-# "Illegal mix of collations" error.
-# In 5.0 we will change grant tables to use NCHAR(N) instead
-# of "CHAR(N) BINARY", and use cast-to-nchar: N'mysqltest_1'.
-#
-set names binary;
-delete from mysql.user where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
-delete from mysql.db where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
-delete from mysql.tables_priv where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
-delete from mysql.columns_priv where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
-flush privileges;
-drop table test.t1,mysqltest.t1,mysqltest.t2;
-drop database mysqltest;
-
-set GLOBAL query_cache_size=default;
-
---source include/delete_anonymous_users.inc
-
-
-# End of 4.1 tests
-
-# (*) Why we disable the ps protocol: because in normal protocol,
-# a SELECT failing due to insufficient privileges increments
-# Qcache_not_cached, while in ps-protocol, no.
-# In detail: in normal protocol,
-# the "access denied" errors on SELECT are issued at (stack trace):
-# mysql_parse/mysql_execute_command/execute_sqlcom_select/handle_select/
-# mysql_select/JOIN::prepare/setup_wild/insert_fields/
-# check_grant_all_columns/my_error/my_message_sql, which then calls
-# push_warning/query_cache_abort: at this moment,
-# query_cache_store_query() has been called, so query exists in cache,
-# so thd->net.query_cache_query!=NULL, so query_cache_abort() removes
-# the query from cache, which causes a query_cache.refused++ (thus,
-# a Qcache_not_cached++).
-# While in ps-protocol, the error is issued at prepare time;
-# for this mysql_test_select() is called, not execute_sqlcom_select()
-# (and that also leads to JOIN::prepare/etc). Thus, as
-# query_cache_store_query() has not been called,
-# thd->net.query_cache_query==NULL, so query_cache_abort() does nothing:
-# Qcache_not_cached is not incremented.
-# As this test prints Qcache_not_cached after SELECT failures,
-# we cannot enable this test in ps-protocol.
-
---enable_ps_protocol
diff --git a/mysql-test/t/grant_cache_no_prot.test b/mysql-test/t/grant_cache_no_prot.test
new file mode 100644
index 00000000000..1f6a9aeb9ed
--- /dev/null
+++ b/mysql-test/t/grant_cache_no_prot.test
@@ -0,0 +1,25 @@
+#################### t/grant_cache_no_prot.test ###################
+#
+# Test grants with query cache to be run when mysqltest was started
+# without any "--<whatever>-protocol".
+#
+# Last update:
+# 2007-05-03 ML - Move t/grant_cache.test to include/grant_cache.inc
+# - Create this test as non "--<whatever>-protocol" variant.
+#
+
+# We cannot run on embedded server because we use multiple sessions.
+--source include/not_embedded.inc
+
+--source include/have_query_cache.inc
+
+# The file with expected results fits only to a run without
+# ps-protocol/sp-protocol/cursor-protocol/view-protocol.
+if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL
+ + $VIEW_PROTOCOL > 0`)
+{
+ --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
+}
+
+# The main testing script
+--source include/grant_cache.inc
diff --git a/mysql-test/t/grant_cache_ps_prot.test b/mysql-test/t/grant_cache_ps_prot.test
new file mode 100644
index 00000000000..7b579f869e9
--- /dev/null
+++ b/mysql-test/t/grant_cache_ps_prot.test
@@ -0,0 +1,24 @@
+#################### t/grant_cache_ps_prot.test ##################
+#
+# Test grants with query cache to be run when mysqltest was
+# started with the option "--ps-protocol".
+#
+# Last update:
+# 2007-05-03 ML - Move t/grant_cache.test to include/grant_cache.inc
+# - Create this test as "--ps-protocol" only variant.
+#
+
+# We cannot run on embedded server because we use multiple sessions.
+--source include/not_embedded.inc
+
+--source include/have_query_cache.inc
+
+# The file with expected results fits only to a run with "--ps-protocol".
+if (`SELECT $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0
+ OR $PS_PROTOCOL = 0`)
+{
+ --skip Test requires: ps-protocol enabled, other protocols disabled
+}
+
+# The main testing script
+--source include/grant_cache.inc
diff --git a/mysql-test/t/greedy_optimizer.test b/mysql-test/t/greedy_optimizer.test
index 4feca43ae1a..b73f70c6a3e 100644
--- a/mysql-test/t/greedy_optimizer.test
+++ b/mysql-test/t/greedy_optimizer.test
@@ -145,11 +145,11 @@ select @@optimizer_prune_level;
#
# These are the values for the parameters that control the greedy optimizer
# (total 6 combinations - 3 for optimizer_search_depth, 2 for optimizer_prune_level):
-#
+# 3:
# set optimizer_search_depth=0; - automatic
# set optimizer_search_depth=1; - min
# set optimizer_search_depth=62; - max (default)
-#
+# 2:
# set optimizer_prune_level=0 - exhaustive;
# set optimizer_prune_level=1 - heuristic; # default
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index 4e21568377f..ae616df0dfd 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -633,6 +633,28 @@ SELECT a FROM t1 ORDER BY "a" DESC;
SELECT a FROM t1 ORDER BY `a` DESC;
DROP TABLE t1;
+#
+# Bug #29717 INSERT INTO SELECT inserts values even if SELECT statement itself
+# returns empty
+#
+CREATE TABLE t1 (
+ f1 int(10) unsigned NOT NULL auto_increment primary key,
+ f2 varchar(100) NOT NULL default ''
+);
+CREATE TABLE t2 (
+ f1 varchar(10) NOT NULL default '',
+ f2 char(3) NOT NULL default '',
+ PRIMARY KEY (`f1`),
+ KEY `k1` (`f2`,`f1`)
+);
+
+INSERT INTO t1 values(NULL, '');
+INSERT INTO `t2` VALUES ('486878','WDT'),('486910','WDT');
+SELECT SQL_BUFFER_RESULT avg(t2.f1) FROM t1, t2 where t2.f2 = 'SIR' GROUP BY t1.f1;
+SELECT avg(t2.f1) FROM t1, t2 where t2.f2 = 'SIR' GROUP BY t1.f1;
+DROP TABLE t1, t2;
+
+
# End of 4.1 tests
#
@@ -780,7 +802,7 @@ INSERT INTO t1 SELECT a + 8,b FROM t1;
INSERT INTO t1 SELECT a + 16,b FROM t1;
INSERT INTO t1 SELECT a + 32,b FROM t1;
INSERT INTO t1 SELECT a + 64,b FROM t1;
-INSERT INTO t1 SELECT a + 128,b FROM t1;
+INSERT INTO t1 SELECT a + 128,b FROM t1 limit 16;
ANALYZE TABLE t1;
EXPLAIN SELECT a FROM t1 WHERE a < 2;
EXPLAIN SELECT a FROM t1 WHERE a < 2 ORDER BY a;
@@ -806,6 +828,11 @@ EXPLAIN SELECT a FROM t1 USE INDEX (i2) USE INDEX ();
EXPLAIN SELECT a FROM t1 FORCE INDEX ();
--error ER_PARSE_ERROR
EXPLAIN SELECT a FROM t1 IGNORE INDEX ();
+# disable the columns irrelevant to this test here. On some systems
+# without support for large files the rowid is shorter and its size affects
+# the cost calculations. This causes the optimizer to choose loose index
+# scan over normal index access.
+--replace_column 4 # 7 # 9 # 10 #
EXPLAIN SELECT a FROM t1 USE INDEX FOR JOIN (i2)
USE INDEX FOR GROUP BY (i2) GROUP BY a;
EXPLAIN SELECT a FROM t1 FORCE INDEX FOR JOIN (i2)
@@ -839,3 +866,47 @@ SHOW VARIABLES LIKE 'old';
SET @@old = off;
DROP TABLE t1, t2;
+
+#
+# Bug#30596: GROUP BY optimization gives wrong result order
+#
+CREATE TABLE t1(
+ a INT,
+ b INT NOT NULL,
+ c INT NOT NULL,
+ d INT,
+ UNIQUE KEY (c,b)
+);
+
+INSERT INTO t1 VALUES (1,1,1,50), (1,2,3,40), (2,1,3,4);
+
+CREATE TABLE t2(
+ a INT,
+ b INT,
+ UNIQUE KEY(a,b)
+);
+
+INSERT INTO t2 VALUES (NULL, NULL), (NULL, NULL), (NULL, 1), (1, NULL), (1, 1), (1,2);
+
+EXPLAIN SELECT c,b,d FROM t1 GROUP BY c,b,d;
+SELECT c,b,d FROM t1 GROUP BY c,b,d;
+EXPLAIN SELECT c,b,d FROM t1 GROUP BY c,b,d ORDER BY NULL;
+SELECT c,b,d FROM t1 GROUP BY c,b,d ORDER BY NULL;
+EXPLAIN SELECT c,b,d FROM t1 ORDER BY c,b,d;
+SELECT c,b,d FROM t1 ORDER BY c,b,d;
+
+EXPLAIN SELECT c,b,d FROM t1 GROUP BY c,b;
+SELECT c,b,d FROM t1 GROUP BY c,b;
+EXPLAIN SELECT c,b FROM t1 GROUP BY c,b;
+SELECT c,b FROM t1 GROUP BY c,b;
+
+EXPLAIN SELECT a,b from t2 ORDER BY a,b;
+SELECT a,b from t2 ORDER BY a,b;
+EXPLAIN SELECT a,b from t2 GROUP BY a,b;
+SELECT a,b from t2 GROUP BY a,b;
+EXPLAIN SELECT a from t2 GROUP BY a;
+SELECT a from t2 GROUP BY a;
+EXPLAIN SELECT b from t2 GROUP BY b;
+SELECT b from t2 GROUP BY b;
+
+DROP TABLE t1;
diff --git a/mysql-test/t/group_min_max.test b/mysql-test/t/group_min_max.test
index 7324e8582de..cf25b4c61be 100644
--- a/mysql-test/t/group_min_max.test
+++ b/mysql-test/t/group_min_max.test
@@ -895,3 +895,25 @@ DELETE FROM t3 WHERE (SELECT (SELECT MAX(b) FROM t1 GROUP BY a HAVING a < 2) x
SHOW STATUS LIKE 'handler_read__e%';
DROP TABLE t1,t2,t3;
+
+#
+# Bug#25602: queries with DISTINCT and SQL_BIG_RESULT hint
+# for which loose scan optimization is applied
+#
+
+CREATE TABLE t1 (a int, INDEX idx(a));
+INSERT INTO t1 VALUES
+ (4), (2), (1), (2), (4), (2), (1), (4),
+ (4), (2), (1), (2), (2), (4), (1), (4);
+
+EXPLAIN SELECT DISTINCT(a) FROM t1;
+SELECT DISTINCT(a) FROM t1;
+EXPLAIN SELECT SQL_BIG_RESULT DISTINCT(a) FROM t1;
+SELECT SQL_BIG_RESULT DISTINCT(a) FROM t1;
+
+DROP TABLE t1;
+
+
+
+
+
diff --git a/mysql-test/t/having.test b/mysql-test/t/having.test
index 41266cc6d32..683abfd3783 100644
--- a/mysql-test/t/having.test
+++ b/mysql-test/t/having.test
@@ -151,6 +151,32 @@ EXPLAIN SELECT 0 AS x, a FROM t1 GROUP BY x,a HAVING x=1 AND a > 1;
DROP table t1;
+#
+# Bug #29911: HAVING clause depending on constant table and evaluated to false
+#
+
+CREATE TABLE t1 (a int PRIMARY KEY);
+CREATE TABLE t2 (b int PRIMARY KEY, a int);
+CREATE TABLE t3 (b int, flag int);
+
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1,1), (2,1), (3,1);
+INSERT INTO t3(b,flag) VALUES (2, 1);
+
+SELECT t1.a
+ FROM t1 INNER JOIN t2 ON t1.a=t2.a LEFT JOIN t3 ON t2.b=t3.b
+ GROUP BY t1.a, t2.b HAVING MAX(t3.flag)=0;
+
+SELECT DISTINCT t1.a, MAX(t3.flag)
+ FROM t1 INNER JOIN t2 ON t1.a=t2.a LEFT JOIN t3 ON t2.b=t3.b
+ GROUP BY t1.a, t2.b HAVING MAX(t3.flag)=0;
+
+SELECT DISTINCT t1.a
+ FROM t1 INNER JOIN t2 ON t1.a=t2.a LEFT JOIN t3 ON t2.b=t3.b
+ GROUP BY t1.a, t2.b HAVING MAX(t3.flag)=0;
+
+DROP TABLE t1,t2,t3;
+
# End of 4.1 tests
#
diff --git a/mysql-test/t/heap.test b/mysql-test/t/heap.test
index b47a5fc2033..3f91b9966e7 100644
--- a/mysql-test/t/heap.test
+++ b/mysql-test/t/heap.test
@@ -128,7 +128,7 @@ SELECT * FROM t1 WHERE b=NULL;
explain SELECT * FROM t1 WHERE b IS NULL;
SELECT * FROM t1 WHERE b<=>NULL;
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
INSERT INTO t1 VALUES (1,3);
DROP TABLE t1;
@@ -270,7 +270,7 @@ explain select count(*) from t1 where v like 'a%';
explain select count(*) from t1 where v between 'a' and 'a ';
explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
alter table t1 add unique(v);
select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a' order by length(concat('*',v,'*',c,'*',t,'*'));
explain select * from t1 where v='a';
@@ -296,17 +296,17 @@ drop table t1;
create table t1 (a char(10), unique (a));
insert into t1 values ('a');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('a ');
alter table t1 modify a varchar(10);
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('a '),('a '),('a '),('a ');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('a ');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('a ');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('a ');
update t1 set a='a ' where a like 'a ';
update t1 set a='a ' where a like 'a ';
@@ -357,7 +357,7 @@ explain select count(*) from t1 where v between 'a' and 'a ';
--replace_column 9 #
explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
alter table t1 add unique(v);
select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a' order by length(concat('*',v,'*',c,'*',t,'*'));
# Number of rows is not constant for b-trees keys
@@ -372,17 +372,17 @@ drop table t1;
create table t1 (a char(10), unique using btree (a)) engine=heap;
insert into t1 values ('a');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('a ');
alter table t1 modify a varchar(10);
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('a '),('a '),('a '),('a ');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('a ');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('a ');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ('a ');
update t1 set a='a ' where a like 'a ';
update t1 set a='a ' where a like 'a ';
@@ -432,7 +432,7 @@ create table t1 (a int not null, b int not null auto_increment,
#
create table t1 (c char(255), primary key(c(90)));
insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
drop table t1;
diff --git a/mysql-test/t/heap_btree.test b/mysql-test/t/heap_btree.test
index 4e7102806d6..0e8cc71dab5 100644
--- a/mysql-test/t/heap_btree.test
+++ b/mysql-test/t/heap_btree.test
@@ -143,7 +143,7 @@ SELECT * FROM t1 WHERE b=NULL;
explain SELECT * FROM t1 WHERE b IS NULL;
SELECT * FROM t1 WHERE b<=>NULL;
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
INSERT INTO t1 VALUES (1,3);
DROP TABLE t1;
diff --git a/mysql-test/t/heap_hash.test b/mysql-test/t/heap_hash.test
index 774f83f43b0..1e3491f89a9 100644
--- a/mysql-test/t/heap_hash.test
+++ b/mysql-test/t/heap_hash.test
@@ -128,7 +128,7 @@ SELECT * FROM t1 WHERE b=NULL;
explain SELECT * FROM t1 WHERE b IS NULL;
SELECT * FROM t1 WHERE b<=>NULL;
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
INSERT INTO t1 VALUES (1,3);
DROP TABLE t1;
@@ -260,4 +260,27 @@ select a from t1 where a in (1,3);
explain select a from t1 where a in (1,3);
drop table t1;
-# End of 4.1 tests
+--echo End of 4.1 tests
+
+#
+# Bug #27643: query failed : 1114 (The table '' is full)
+#
+# Check that HASH indexes disregard trailing spaces when comparing
+# strings with binary collations
+
+CREATE TABLE t1(col1 VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
+ col2 VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
+ UNIQUE KEY key1 USING HASH (col1, col2)) ENGINE=MEMORY;
+INSERT INTO t1 VALUES('A', 'A');
+--error ER_DUP_ENTRY
+INSERT INTO t1 VALUES('A ', 'A ');
+DROP TABLE t1;
+CREATE TABLE t1(col1 VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
+ col2 VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
+ UNIQUE KEY key1 USING HASH (col1, col2)) ENGINE=MEMORY;
+INSERT INTO t1 VALUES('A', 'A');
+--error ER_DUP_ENTRY
+INSERT INTO t1 VALUES('A ', 'A ');
+DROP TABLE t1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/im_cmd_line.imtest b/mysql-test/t/im_cmd_line.imtest
deleted file mode 100644
index 1de43efe92b..00000000000
--- a/mysql-test/t/im_cmd_line.imtest
+++ /dev/null
@@ -1,68 +0,0 @@
-###########################################################################
-#
-# Tests for user-management command-line options.
-#
-###########################################################################
-
---source include/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/t/im_daemon_life_cycle.imtest b/mysql-test/t/im_daemon_life_cycle.imtest
deleted file mode 100644
index c2eac46c1e4..00000000000
--- a/mysql-test/t/im_daemon_life_cycle.imtest
+++ /dev/null
@@ -1,98 +0,0 @@
-###########################################################################
-#
-# This file contains test for (1.2) test suite.
-#
-# Consult WL#2789 for more information.
-#
-###########################################################################
-
---exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle im_daemon_life_cycle.imtest started.
-
-###########################################################################
-
---source include/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 $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle Main-test: starting...
-
---exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle Killing IM-main...
---exec $MYSQL_TEST_DIR/t/kill_n_check.sh $IM_PATH_PID restarted 55 im_daemon_life_cycle
-
---exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle Waiting for IM-main to start accepting connections...
---exec $MYSQL_TEST_DIR/t/wait_for_socket.sh $EXE_MYSQL $IM_PATH_SOCK $IM_USERNAME $IM_PASSWORD '' 55 im_daemon_life_cycle
-
---exec $MYSQL_TEST_DIR/t/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 $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle BUG12751: starting...
-
-# 1. Start mysqld;
-
---exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle mysqld2: starting...
-START INSTANCE mysqld2;
-
---exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle mysqld2: waiting to start...
---exec $MYSQL_TEST_DIR/t/wait_for_process.sh $IM_MYSQLD2_PATH_PID 55 started im_daemon_life_cycle
-
---exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle mysqld2: started.
-
-# 2. Restart IM-main;
-
---exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle Killing IM-main...
---exec $MYSQL_TEST_DIR/t/kill_n_check.sh $IM_PATH_PID restarted 55 im_daemon_life_cycle
-
---exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle Waiting for IM-main to start accepting connections...
---exec $MYSQL_TEST_DIR/t/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 $MYSQL_TEST_DIR/t/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 $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle mysqld2: stopping...
-STOP INSTANCE mysqld2;
-
---exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle mysqld2: waiting to stop...
---exec $MYSQL_TEST_DIR/t/wait_for_process.sh $IM_MYSQLD2_PATH_PID 55 stopped im_daemon_life_cycle
---exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle mysqld2: stopped.
-
-###########################################################################
-
---exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle BUG12751: done.
diff --git a/mysql-test/t/im_instance_conf.imtest b/mysql-test/t/im_instance_conf.imtest
deleted file mode 100644
index e7f1e511113..00000000000
--- a/mysql-test/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 include/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/t/im_life_cycle.imtest b/mysql-test/t/im_life_cycle.imtest
deleted file mode 100644
index 3721b92e2b7..00000000000
--- a/mysql-test/t/im_life_cycle.imtest
+++ /dev/null
@@ -1,203 +0,0 @@
-###########################################################################
-#
-# This file contains test for (1.1) test suite.
-#
-# Consult WL#2789 for more information.
-#
-###########################################################################
-
---source include/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 $MYSQL_TEST_DIR/t/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 $MYSQL_TEST_DIR/t/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 $MYSQL_TEST_DIR/t/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 $MYSQL_TEST_DIR/t/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 $MYSQL_TEST_DIR/t/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/t/im_options.imtest b/mysql-test/t/im_options.imtest
deleted file mode 100644
index 8f9bed16473..00000000000
--- a/mysql-test/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 include/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/t/im_utils.imtest b/mysql-test/t/im_utils.imtest
deleted file mode 100644
index 0866b87204a..00000000000
--- a/mysql-test/t/im_utils.imtest
+++ /dev/null
@@ -1,105 +0,0 @@
-###########################################################################
-#
-# This file contains test for (2) test suite.
-#
-# Consult WL#2789 for more information.
-#
-###########################################################################
-
---source include/im_check_env.inc
-
-###########################################################################
-
-#
-# 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 $MYSQL_TEST_DIR/t/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 started im_utils
-
-STOP INSTANCE mysqld2;
---exec $MYSQL_TEST_DIR/t/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/t/information_schema.test b/mysql-test/t/information_schema.test
index a49044e63c1..6bcc14d4e49 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -703,7 +703,7 @@ drop table t1;
#
# Bug #9846 Inappropriate error displayed while dropping table from 'INFORMATION_SCHEMA'
#
---error 1044
+--error ER_PARSE_ERROR
alter database information_schema;
--error 1044
drop database information_schema;
@@ -825,7 +825,7 @@ drop table t1;
use mysql;
INSERT INTO `proc` VALUES ('test','','PROCEDURE','','SQL','CONTAINS_SQL',
'NO','DEFINER','','','BEGIN\r\n \r\nEND','root@%','2006-03-02 18:40:03',
-'2006-03-02 18:40:03','','');
+'2006-03-02 18:40:03','','','utf8','utf8_general_ci','utf8_general_ci','n/a');
select routine_name from information_schema.routines;
delete from proc where name='';
use test;
@@ -1024,6 +1024,71 @@ where t.table_schema = 'information_schema' and
group by c2.column_type order by num limit 1)
group by t.table_name order by num1, t.table_name;
+#
+# Bug#28266 IS_UPDATABLE field on VIEWS table in I_S database is wrong
+#
+create table t1(f1 int);
+create view v1 as select f1+1 as a from t1;
+create table t2 (f1 int, f2 int);
+create view v2 as select f1+1 as a, f2 as b from t2;
+select table_name, is_updatable from information_schema.views;
+#
+# Note: we can perform 'delete' for non updatable view.
+#
+delete from v1;
+drop view v1,v2;
+drop table t1,t2;
+
+#
+# Bug#25859 ALTER DATABASE works w/o parameters
+#
+--error ER_PARSE_ERROR
+alter database;
+--error ER_PARSE_ERROR
+alter database test;
+
+#
+# Bug#27629 Possible security flaw in INFORMATION_SCHEMA and SHOW statements
+#
+
+create database mysqltest;
+create table mysqltest.t1(a int, b int, c int);
+create trigger mysqltest.t1_ai after insert on mysqltest.t1
+ for each row set @a = new.a + new.b + new.c;
+grant select(b) on mysqltest.t1 to mysqltest_1@localhost;
+
+select trigger_name from information_schema.triggers
+where event_object_table='t1';
+show triggers from mysqltest;
+
+connect (con27629,localhost,mysqltest_1,,mysqltest);
+show columns from t1;
+select column_name from information_schema.columns where table_name='t1';
+
+show triggers;
+select trigger_name from information_schema.triggers
+where event_object_table='t1';
+connection default;
+drop user mysqltest_1@localhost;
+drop database mysqltest;
+
+#
+# Bug#27747 database metadata doesn't return sufficient column default info
+#
+create table t1 (
+ f1 varchar(50),
+ f2 varchar(50) not null,
+ f3 varchar(50) default '',
+ f4 varchar(50) default NULL,
+ f5 bigint not null,
+ f6 bigint not null default 10,
+ f7 datetime not null,
+ f8 datetime default '2006-01-01'
+);
+select column_default from information_schema.columns where table_name= 't1';
+show columns from t1;
+drop table t1;
+
--echo End of 5.0 tests.
#
# Show engines
@@ -1077,4 +1142,40 @@ SELECT variable_name FROM server_status;
DROP TABLE server_status;
SET GLOBAL event_scheduler=0;
+
+#
+# WL#3732 Information schema optimization
+#
+
+explain select table_name from information_schema.views where
+table_schema='test' and table_name='v1';
+
+explain select * from information_schema.tables;
+explain select * from information_schema.collations;
+
+explain select * from information_schema.tables where
+table_schema='test' and table_name= 't1';
+explain select table_name, table_type from information_schema.tables
+where table_schema='test';
+
+explain select b.table_name
+from information_schema.tables a, information_schema.columns b
+where a.table_name='t1' and a.table_schema='test' and b.table_name=a.table_name;
+
+#
+# Bug#30310 wrong result on SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE ..
+#
+SELECT * FROM INFORMATION_SCHEMA.SCHEMATA
+WHERE SCHEMA_NAME = 'mysqltest';
+
+SELECT * FROM INFORMATION_SCHEMA.SCHEMATA
+WHERE SCHEMA_NAME = '';
+
+SELECT * FROM INFORMATION_SCHEMA.SCHEMATA
+WHERE SCHEMA_NAME = 'test';
+
+select count(*) from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysql' AND TABLE_NAME='nonexisting';
+select count(*) from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysql' AND TABLE_NAME='';
+select count(*) from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='' AND TABLE_NAME='';
+select count(*) from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='' AND TABLE_NAME='nonexisting';
--echo End of 5.1 tests.
diff --git a/mysql-test/t/information_schema_chmod.test b/mysql-test/t/information_schema_chmod.test
index 38586ab8b67..51e67a0c956 100644
--- a/mysql-test/t/information_schema_chmod.test
+++ b/mysql-test/t/information_schema_chmod.test
@@ -19,5 +19,5 @@ create database mysqltest;
create table mysqltest.t1(a int);
chmod 0000 $MYSQLTEST_VARDIR/master-data/mysqltest;
select table_schema from information_schema.tables where table_schema='mysqltest';
-exec chmod 0777 $MYSQLTEST_VARDIR/master-data/mysqltest;
+chmod 0777 $MYSQLTEST_VARDIR/master-data/mysqltest;
drop database mysqltest;
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index 439a7adc669..cc1ef6f9730 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -11,7 +11,6 @@
# #
#######################################################################
--- source include/not_embedded.inc
-- source include/have_innodb.inc
#
@@ -53,7 +52,7 @@ INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2),
update t1 set parent_id=parent_id+100;
select * from t1 where parent_id=102;
update t1 set id=id+1000;
--- error ER_DUP_ENTRY_WITH_KEY_NAME,1022
+-- error ER_DUP_ENTRY,1022
update t1 set id=1024 where id=1009;
select * from t1;
update ignore t1 set id=id+1; # This will change all rows
@@ -134,13 +133,13 @@ commit;
select n, "after commit" from t1;
commit;
insert into t1 values (5);
--- error ER_DUP_ENTRY_WITH_KEY_NAME
+-- error ER_DUP_ENTRY
insert into t1 values (4);
commit;
select n, "after commit" from t1;
set autocommit=1;
insert into t1 values (6);
--- error ER_DUP_ENTRY_WITH_KEY_NAME
+-- error ER_DUP_ENTRY
insert into t1 values (4);
select n from t1;
set autocommit=0;
@@ -214,7 +213,7 @@ drop table t1;
CREATE TABLE t1 (id char(8) not null primary key, val int not null) engine=innodb;
insert into t1 values ('pippo', 12);
--- error ER_DUP_ENTRY_WITH_KEY_NAME
+-- error ER_DUP_ENTRY
insert into t1 values ('pippo', 12); # Gives error
delete from t1;
delete from t1 where id = 'pippo';
@@ -342,9 +341,9 @@ CREATE TABLE t1 (
insert into t1 (ggid,passwd) values ('test1','xxx');
insert into t1 (ggid,passwd) values ('test2','yyy');
--- error ER_DUP_ENTRY_WITH_KEY_NAME
+-- error ER_DUP_ENTRY
insert into t1 (ggid,passwd) values ('test2','this will fail');
--- error ER_DUP_ENTRY_WITH_KEY_NAME
+-- error ER_DUP_ENTRY
insert into t1 (ggid,id) values ('this will fail',1);
select * from t1 where ggid='test1';
@@ -353,7 +352,7 @@ select * from t1 where id=2;
replace into t1 (ggid,id) values ('this will work',1);
replace into t1 (ggid,passwd) values ('test2','this will work');
--- error ER_DUP_ENTRY_WITH_KEY_NAME
+-- error ER_DUP_ENTRY
update t1 set id=100,ggid='test2' where id=1;
select * from t1;
select * from t1 where id=1;
@@ -524,7 +523,7 @@ drop table t1;
create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=innodb;
insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL');
LOCK TABLES t1 WRITE;
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values (99,1,2,'D'),(1,1,2,'D');
select id from t1;
select id from t1;
@@ -535,7 +534,7 @@ create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(3
insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL');
LOCK TABLES t1 WRITE;
begin;
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values (99,1,2,'D'),(1,1,2,'D');
select id from t1;
insert ignore into t1 values (100,1,2,'D'),(1,1,99,'D');
@@ -1131,10 +1130,9 @@ drop table t2;
# Test error handling
-# Clean up filename -- embedded server reports whole path without .frm,
-# regular server reports relative path with .frm (argh!)
---replace_result \\ / $MYSQL_TEST_DIR . /var/master-data/ / t2.frm t2
---error 1005
+# Embedded server doesn't chdir to data directory
+--replace_result $MYSQLTEST_VARDIR . master-data/ ''
+--error ER_WRONG_FK_DEF
create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb;
# bug#3749
@@ -1148,41 +1146,6 @@ drop table t2, t1;
#
-# Let us test binlog_cache_use and binlog_cache_disk_use status vars.
-# Actually this test has nothing to do with innodb per se, it just requires
-# transactional table.
-#
-flush status;
-show status like "binlog_cache_use";
-show status like "binlog_cache_disk_use";
-
-create table t1 (a int) engine=innodb;
-
-# Now we are going to create transaction which is long enough so its
-# transaction binlog will be flushed to disk...
-let $1=2000;
-disable_query_log;
-begin;
-while ($1)
-{
- eval insert into t1 values( $1 );
- dec $1;
-}
-commit;
-enable_query_log;
-show status like "binlog_cache_use";
-show status like "binlog_cache_disk_use";
-
-# Transaction which should not be flushed to disk and so should not
-# increase binlog_cache_disk_use.
-begin;
-delete from t1;
-commit;
-show status like "binlog_cache_use";
-show status like "binlog_cache_disk_use";
-drop table t1;
-
-#
# Bug #6126: Duplicate columns in keys gives misleading error message
#
--error 1060
@@ -1360,9 +1323,8 @@ source include/varchar.inc;
# Some errors/warnings on create
#
-# Clean up filename -- embedded server reports whole path without .frm,
-# regular server reports relative path with .frm (argh!)
---replace_result \\ / $MYSQL_TEST_DIR . /var/master-data/ / t1.frm t1
+# Embedded server doesn't chdir to data directory
+--replace_result $MYSQLTEST_VARDIR . master-data/ ''
create table t1 (v varchar(65530), key(v));
drop table t1;
create table t1 (v varchar(65536));
@@ -1408,7 +1370,7 @@ create table t1 (rowid int not null auto_increment, val int not null,primary
key (rowid), unique(val)) engine=innodb;
replace into t1 (val) values ('1'),('2');
replace into t1 (val) values ('1'),('2');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 (val) values ('1'),('2');
select * from t1;
drop table t1;
@@ -1421,7 +1383,7 @@ create table t1 (a int not null auto_increment primary key, val int) engine=Inno
insert into t1 (val) values (1);
update t1 set a=2 where a=1;
# We should get the following error because InnoDB does not update the counter
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 (val) values (1);
select * from t1;
drop table t1;
@@ -1636,6 +1598,7 @@ disconnect b;
set foreign_key_checks=0;
create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb;
+# Embedded server doesn't chdir to data directory
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
-- error 1005
create table t1(a char(10) primary key, b varchar(20)) engine = innodb;
@@ -1647,6 +1610,7 @@ drop table t2;
set foreign_key_checks=0;
create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1;
+# Embedded server doesn't chdir to data directory
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
-- error 1005
create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=utf8;
@@ -1677,6 +1641,7 @@ drop table t2,t1;
set foreign_key_checks=0;
create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1;
create table t3(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=utf8;
+# Embedded server doesn't chdir to data directory
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
-- error 1025
rename table t3 to t1;
@@ -1744,13 +1709,13 @@ 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);
--- error ER_DUP_ENTRY_WITH_KEY_NAME
+-- error ER_DUP_ENTRY
insert into t2 values (0x41),(0x4120),(0x4100);
insert into t2 values (0x41),(0x4120);
--- error ER_DUP_ENTRY_WITH_KEY_NAME
+-- error ER_DUP_ENTRY
insert into t3 values (0x41),(0x4120),(0x4100);
insert into t3 values (0x41),(0x4100);
--- error ER_DUP_ENTRY_WITH_KEY_NAME
+-- error ER_DUP_ENTRY
insert into t4 values (0x41),(0x4120),(0x4100);
insert into t4 values (0x41),(0x4100);
select hex(s1) from t1;
@@ -2302,7 +2267,10 @@ CREATE TABLE t2 (a INT, INDEX(a)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1 (a) ON DELETE SET NULL;
---replace_regex /'\.\/test\/#sql-[0-9a-f_]*'/'#sql-temporary'/
+# mysqltest first does replace_regex, then replace_result
+--replace_regex /'[^']*test\/#sql-[0-9a-f_]*'/'#sql-temporary'/
+# Embedded server doesn't chdir to data directory
+--replace_result $MYSQLTEST_VARDIR . master-data/ ''
--error 1025
ALTER TABLE t2 MODIFY a INT NOT NULL;
DELETE FROM t1;
@@ -2340,6 +2308,21 @@ SHOW CREATE TABLE t1;
DROP TABLE t1,t2;
+#
+# Bug #21101 (Prints wrong error message if max row size is too large)
+#
+--error 1118
+CREATE TABLE t1 (
+ c01 CHAR(255), c02 CHAR(255), c03 CHAR(255), c04 CHAR(255),
+ c05 CHAR(255), c06 CHAR(255), c07 CHAR(255), c08 CHAR(255),
+ c09 CHAR(255), c10 CHAR(255), c11 CHAR(255), c12 CHAR(255),
+ c13 CHAR(255), c14 CHAR(255), c15 CHAR(255), c16 CHAR(255),
+ c17 CHAR(255), c18 CHAR(255), c19 CHAR(255), c20 CHAR(255),
+ c21 CHAR(255), c22 CHAR(255), c23 CHAR(255), c24 CHAR(255),
+ c25 CHAR(255), c26 CHAR(255), c27 CHAR(255), c28 CHAR(255),
+ c29 CHAR(255), c30 CHAR(255), c31 CHAR(255), c32 CHAR(255)
+ ) ENGINE = InnoDB;
+
#######################################################################
# #
# Please, DO NOT TOUCH this file as well as the innodb.result file. #
diff --git a/mysql-test/t/innodb_trx_weight.test b/mysql-test/t/innodb_trx_weight.test
new file mode 100644
index 00000000000..b72eaad345f
--- /dev/null
+++ b/mysql-test/t/innodb_trx_weight.test
@@ -0,0 +1,108 @@
+#
+# Ensure that the number of locks (SELECT FOR UPDATE for example) is
+# added to the number of altered rows when choosing the smallest
+# transaction to kill as a victim when a deadlock is detected.
+# Also transactions what had edited non-transactional tables should
+# be heavier than ones that had not.
+#
+
+-- source include/have_innodb.inc
+
+SET storage_engine=InnoDB;
+
+# we do not really care about what gets printed, we are only
+# interested in getting the deadlock resolved according to our
+# expectations
+-- disable_query_log
+-- disable_result_log
+
+# we want to use "-- eval statement1; statement2" which does not work with
+# prepared statements. Because this test should not behave differently with
+# or without prepared statements we disable them so the test does not fail
+# if someone runs ./mysql-test-run.pl --ps-protocol
+-- disable_ps_protocol
+
+-- disable_warnings
+DROP TABLE IF EXISTS t1, t2, t3, t4, t5_nontrans;
+-- enable_warnings
+
+# we will create a simple deadlock with t1, t2 and two connections
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a INT);
+
+# auxiliary table with a bulk of rows which will be locked by a
+# transaction to increase its weight
+CREATE TABLE t3 (a INT);
+
+# auxiliary empty table which will be inserted by a
+# transaction to increase its weight
+CREATE TABLE t4 (a INT);
+
+# auxiliary non-transactional table which will be edited by a
+# transaction to tremendously increase its weight
+CREATE TABLE t5_nontrans (a INT) ENGINE=MyISAM;
+
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+# insert a lot of rows in t3
+INSERT INTO t3 VALUES (1);
+INSERT INTO t3 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t3;
+
+# test locking weight
+
+-- let $con1_extra_sql =
+-- let $con1_extra_sql_present = 0
+-- let $con2_extra_sql = SELECT * FROM t3 FOR UPDATE
+-- let $con2_extra_sql_present = 1
+-- let $con1_should_be_rolledback = 1
+-- source include/innodb_trx_weight.inc
+
+-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1)
+-- let $con1_extra_sql_present = 1
+-- let $con2_extra_sql = SELECT * FROM t3 FOR UPDATE
+-- let $con2_extra_sql_present = 1
+-- let $con1_should_be_rolledback = 1
+-- source include/innodb_trx_weight.inc
+
+-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1), (1), (1), (1), (1)
+-- let $con1_extra_sql_present = 1
+-- let $con2_extra_sql = SELECT * FROM t3 FOR UPDATE
+-- let $con2_extra_sql_present = 1
+-- let $con1_should_be_rolledback = 0
+-- source include/innodb_trx_weight.inc
+
+# test weight when non-transactional tables are edited
+
+-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1), (1)
+-- let $con1_extra_sql_present = 1
+-- let $con2_extra_sql =
+-- let $con2_extra_sql_present = 0
+-- let $con1_should_be_rolledback = 0
+-- source include/innodb_trx_weight.inc
+
+-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1), (1)
+-- let $con1_extra_sql_present = 1
+-- let $con2_extra_sql = INSERT INTO t5_nontrans VALUES (1)
+-- let $con2_extra_sql_present = 1
+-- let $con1_should_be_rolledback = 1
+-- source include/innodb_trx_weight.inc
+
+-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1), (1)
+-- let $con1_extra_sql = $con1_extra_sql; INSERT INTO t5_nontrans VALUES (1)
+-- let $con1_extra_sql_present = 1
+-- let $con2_extra_sql = INSERT INTO t5_nontrans VALUES (1)
+-- let $con2_extra_sql_present = 1
+-- let $con1_should_be_rolledback = 0
+-- source include/innodb_trx_weight.inc
+
+DROP TABLE t1, t2, t3, t4, t5_nontrans;
diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test
index 6c076fa6dc0..3d32da9c3b7 100644
--- a/mysql-test/t/insert.test
+++ b/mysql-test/t/insert.test
@@ -250,3 +250,142 @@ insert ignore into t1 values(NULL,130),(NULL,140),(500,110),(550,120),(450,100),
select * from t1 order by id;
drop table t1;
+
+#
+# BUG#21483: Server abort or deadlock on INSERT DELAYED with another
+# implicit insert
+#
+# The solution is to downgrade INSERT DELAYED to normal INSERT if the
+# statement uses functions and access tables or triggers, or is called
+# from a function or a trigger.
+#
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP FUNCTION IF EXISTS f1;
+DROP FUNCTION IF EXISTS f2;
+--enable_warnings
+
+CREATE TABLE t1 (i INT);
+delimiter |;
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+ INSERT INTO t1 VALUES (1);
+ RETURN 1;
+END |
+CREATE FUNCTION f2() RETURNS INT
+BEGIN
+ INSERT DELAYED INTO t1 VALUES (2);
+ RETURN 1;
+END |
+delimiter ;|
+
+SELECT f1();
+SELECT f2();
+INSERT INTO t1 VALUES (3);
+INSERT DELAYED INTO t1 VALUES (4);
+
+--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
+INSERT INTO t1 VALUES (f1());
+
+--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
+INSERT DELAYED INTO t1 VALUES (f1());
+
+--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
+INSERT INTO t1 VALUES (f2());
+
+--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
+INSERT DELAYED INTO t1 VALUES (f2());
+
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+ INSERT INTO t1 VALUES (NEW.i);
+
+--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
+INSERT INTO t1 VALUES (1);
+
+--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
+INSERT DELAYED INTO t1 VALUES (1);
+
+SELECT * FROM t1;
+
+DROP FUNCTION f2;
+DROP FUNCTION f1;
+DROP TABLE t1;
+
+#
+# BUG#20497: Trigger with INSERT DELAYED causes Error 1165
+#
+# Fixed by the patch for Bug#21483
+#
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+
+CREATE TABLE t1 (i INT);
+CREATE TABLE t2 (i INT);
+
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+ INSERT DELAYED INTO t2 VALUES (NEW.i);
+
+CREATE TRIGGER t1_bu BEFORE UPDATE ON t1 FOR EACH ROW
+ INSERT DELAYED INTO t2 VALUES (NEW.i);
+
+CREATE TRIGGER t1_bd BEFORE DELETE ON t1 FOR EACH ROW
+ INSERT DELAYED INTO t2 VALUES (OLD.i);
+
+INSERT INTO t1 VALUES (1);
+INSERT DELAYED INTO t1 VALUES (2);
+SELECT * FROM t1;
+UPDATE t1 SET i = 3 WHERE i = 1;
+SELECT * FROM t1;
+DELETE FROM t1 WHERE i = 3;
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+DROP TABLE t1, t2;
+
+#
+# BUG#21714: Wrong NEW.value and server abort on INSERT DELAYED to a
+# table with a trigger
+#
+# Fixed by the patch for Bug#21483
+#
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+
+CREATE TABLE t1 (i INT);
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+ SET @a= NEW.i;
+
+SET @a= 0;
+INSERT DELAYED INTO t1 VALUES (1);
+SELECT @a;
+INSERT DELAYED INTO t1 VALUES (2);
+SELECT @a;
+
+DROP TABLE t1;
+
+CREATE TABLE t1 (i INT);
+CREATE TABLE t2 (i INT);
+
+CREATE TRIGGER t1_ai AFTER INSERT ON t1 FOR EACH ROW
+ INSERT INTO t2 VALUES (NEW.i);
+
+CREATE TRIGGER t1_au AFTER UPDATE ON t1 FOR EACH ROW
+ INSERT DELAYED INTO t2 VALUES (NEW.i);
+
+CREATE TRIGGER t1_ad AFTER DELETE ON t1 FOR EACH ROW
+ INSERT DELAYED INTO t2 VALUES (OLD.i);
+
+INSERT DELAYED INTO t1 VALUES (1);
+SELECT * FROM t1;
+UPDATE t1 SET i = 2 WHERE i = 1;
+SELECT * FROM t1;
+DELETE FROM t1 WHERE i = 2;
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+DROP TABLE t1, t2;
+
+--echo End of 5.0 tests.
+
diff --git a/mysql-test/t/insert_notembedded.test b/mysql-test/t/insert_notembedded.test
index bdea72e9eca..24040f9c310 100644
--- a/mysql-test/t/insert_notembedded.test
+++ b/mysql-test/t/insert_notembedded.test
@@ -152,3 +152,38 @@ disconnect root;
connection default;
DROP DATABASE meow;
+
+#
+# Bug#28587 SELECT is blocked by INSERT waiting on read lock, even with low_priority_updates
+#
+--echo connection: default
+set low_priority_updates=1;
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int, b int, unique key t1$a (a));
+lock table t1 read;
+connect (update,localhost,root,,);
+connection update;
+--echo connection: update
+set low_priority_updates=1;
+show variables like 'low_priority_updates';
+let $ID= `select connection_id()`;
+--send insert into t1 values (1, 2) ON DUPLICATE KEY UPDATE b = 2;
+connection default;
+# we must wait till the insert opens and locks the table
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and id = $ID;
+--source include/wait_condition.inc
+connect (select,localhost,root,,);
+--echo connection: select
+select * from t1;
+connection default;
+--echo connection: default
+select * from t1;
+connection default;
+disconnect update;
+disconnect select;
+drop table t1;
+set low_priority_updates=default;
diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test
index 95a55b732c5..ace51ef61c7 100644
--- a/mysql-test/t/insert_select.test
+++ b/mysql-test/t/insert_select.test
@@ -10,7 +10,7 @@ create table t1 (bandID MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY, payoutID SMALLI
insert into t1 (bandID,payoutID) VALUES (1,6),(2,6),(3,4),(4,9),(5,10),(6,1),(7,12),(8,12);
create table t2 (payoutID SMALLINT UNSIGNED NOT NULL PRIMARY KEY);
insert into t2 (payoutID) SELECT DISTINCT payoutID FROM t1;
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t2 (payoutID) SELECT payoutID+10 FROM t1;
insert ignore into t2 (payoutID) SELECT payoutID+10 FROM t1;
select * from t2;
@@ -101,7 +101,7 @@ create table t1 (a int not null primary key, b char(10));
create table t2 (a int not null, b char(10));
insert into t1 values (1,"t1:1"),(3,"t1:3");
insert into t2 values (2,"t2:2"), (3,"t2:3");
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 select * from t2;
select * from t1;
# REPLACE .. SELECT is not yet supported by PS
@@ -233,10 +233,40 @@ drop table t1,t2;
CREATE TABLE t1 (a int PRIMARY KEY);
INSERT INTO t1 values (1), (2);
+flush status;
INSERT INTO t1 SELECT a + 2 FROM t1 LIMIT 1;
+show status like 'Handler_read%';
DROP TABLE t1;
+#
+# Bug #29717 INSERT INTO SELECT inserts values even if SELECT statement itself returns empty
+#
+
+CREATE TABLE t1 (
+ f1 int(10) unsigned NOT NULL auto_increment PRIMARY KEY,
+ f2 varchar(100) NOT NULL default ''
+);
+CREATE TABLE t2 (
+ f1 varchar(10) NOT NULL default '',
+ f2 char(3) NOT NULL default '',
+ PRIMARY KEY (`f1`),
+ KEY `k1` (`f2`, `f1`)
+);
+
+INSERT INTO t1 values(NULL, '');
+INSERT INTO `t2` VALUES ('486878','WDT'),('486910','WDT');
+SELECT COUNT(*) FROM t1;
+
+SELECT min(t2.f1) FROM t1, t2 where t2.f2 = 'SIR' GROUP BY t1.f1;
+
+INSERT INTO t1 (f2)
+ SELECT min(t2.f1) FROM t1, t2 where t2.f2 = 'SIR' GROUP BY t1.f1;
+
+SELECT COUNT(*) FROM t1;
+SELECT * FROM t1;
+DROP TABLE t1, t2;
+
# End of 4.1 tests
#
@@ -319,3 +349,26 @@ INSERT INTO t2 (d)
SELECT * FROM t2;
DROP TABLE t1,t2;
+
+#
+# Bug #29095: incorrect pushing of LIMIT into the temporary
+# table ignoring ORDER BY clause
+#
+
+CREATE TABLE t1 (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ prev_id INT,
+ join_id INT DEFAULT 0);
+
+INSERT INTO t1 (prev_id) VALUES (NULL), (1), (2);
+SELECT * FROM t1;
+
+CREATE TABLE t2 (join_id INT);
+INSERT INTO t2 (join_id) VALUES (0);
+
+INSERT INTO t1 (prev_id) SELECT id
+ FROM t2 LEFT JOIN t1 ON t1.join_id = t2.join_id
+ ORDER BY id DESC LIMIT 1;
+SELECT * FROM t1;
+
+DROP TABLE t1,t2;
diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test
index f0d87ea956d..67f21731afe 100644
--- a/mysql-test/t/insert_update.test
+++ b/mysql-test/t/insert_update.test
@@ -12,7 +12,7 @@ INSERT t1 VALUES (8,4,50) ON DUPLICATE KEY UPDATE c=c+1000;
SELECT * FROM t1;
INSERT t1 VALUES (1,4,60) ON DUPLICATE KEY UPDATE c=c+10000;
SELECT * FROM t1;
--- error ER_DUP_ENTRY_WITH_KEY_NAME
+-- error ER_DUP_ENTRY
INSERT t1 VALUES (1,9,70) ON DUPLICATE KEY UPDATE c=c+100000, b=4;
SELECT * FROM t1;
TRUNCATE TABLE t1;
@@ -63,7 +63,7 @@ INSERT t1 SELECT 8,4,50 FROM DUAL ON DUPLICATE KEY UPDATE c=c+1000;
SELECT * FROM t1;
INSERT t1 SELECT 1,4,60 FROM DUAL ON DUPLICATE KEY UPDATE c=c+10000;
SELECT * FROM t1;
--- error ER_DUP_ENTRY_WITH_KEY_NAME
+-- error ER_DUP_ENTRY
INSERT t1 SELECT 1,9,70 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100000, b=4;
SELECT * FROM t1;
TRUNCATE TABLE t1;
@@ -247,3 +247,62 @@ REPLACE INTO t1 VALUES (0,"test1",null);
SELECT id, f1 FROM t1;
DROP TABLE t1;
SET SQL_MODE='';
+
+#
+# Bug#27954: multi-row INSERT ... ON DUPLICATE with duplicated
+# row at the first place into table with AUTO_INCREMENT and
+# additional UNIQUE key.
+#
+CREATE TABLE t1 (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ c1 CHAR(1) UNIQUE KEY,
+ cnt INT DEFAULT 1
+);
+INSERT INTO t1 (c1) VALUES ('A'), ('B'), ('C');
+SELECT * FROM t1;
+INSERT INTO t1 (c1) VALUES ('A'), ('X'), ('Y'), ('Z')
+ ON DUPLICATE KEY UPDATE cnt=cnt+1;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+#
+# Bug#28000: INSERT IGNORE ... SELECT ... ON DUPLICATE
+# with erroneous UPDATE: NOT NULL field with NULL value.
+#
+CREATE TABLE t1 (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ c1 INT NOT NULL,
+ cnt INT DEFAULT 1
+);
+INSERT INTO t1 (id,c1) VALUES (1,10);
+SELECT * FROM t1;
+CREATE TABLE t2 (id INT, c1 INT);
+INSERT INTO t2 VALUES (1,NULL), (2,2);
+--error 1048
+INSERT INTO t1 (id,c1) SELECT 1,NULL
+ ON DUPLICATE KEY UPDATE c1=NULL;
+SELECT * FROM t1;
+INSERT IGNORE INTO t1 (id,c1) SELECT 1,NULL
+ ON DUPLICATE KEY UPDATE c1=NULL, cnt=cnt+1;
+SELECT * FROM t1;
+INSERT IGNORE INTO t1 (id,c1) SELECT * FROM t2
+ ON DUPLICATE KEY UPDATE c1=NULL, cnt=cnt+1;
+SELECT * FROM t1;
+
+DROP TABLE t1;
+
+#
+# Bug#28904: INSERT .. ON DUPLICATE was silently updating rows when it
+# shouldn't.
+#
+create table t1(f1 int primary key,
+ f2 timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP);
+insert into t1(f1) values(1);
+--replace_column 1 #
+select @stamp1:=f2 from t1;
+--sleep 2
+insert into t1(f1) values(1) on duplicate key update f1=1;
+--replace_column 1 #
+select @stamp2:=f2 from t1;
+select if( @stamp1 = @stamp2, "correct", "wrong");
+drop table t1;
diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test
index 4d35989aa9a..14c98431970 100644
--- a/mysql-test/t/join.test
+++ b/mysql-test/t/join.test
@@ -512,10 +512,12 @@ select * from v1a join (t3 natural join t4) on a = y;
#--------------------------------------------------------------------
# Negative tests (tests for errors)
#--------------------------------------------------------------------
+# works in Oracle - bug
-- error 1052
-select * from t1 natural join (t3 cross join t4); # works in Oracle - bug
+select * from t1 natural join (t3 cross join t4);
+# works in Oracle - bug
-- error 1052
-select * from (t3 cross join t4) natural join t1; # works in Oracle - bug
+select * from (t3 cross join t4) natural join t1;
-- error 1052
select * from t1 join (t2, t3) using (b);
-- error 1052
diff --git a/mysql-test/t/join_nested.test b/mysql-test/t/join_nested.test
index f29366797f6..5b07d8966f1 100644
--- a/mysql-test/t/join_nested.test
+++ b/mysql-test/t/join_nested.test
@@ -1083,4 +1083,118 @@ SELECT * FROM t1 JOIN (t2 JOIN t3 USING (b)) USING (a);
DROP TABLE t1,t2,t3;
+#
+# BUG#29604: inner nest of left join interleaves with outer tables
+#
+
+CREATE TABLE t1 (
+ carrier char(2) default NULL,
+ id int NOT NULL auto_increment PRIMARY KEY
+);
+INSERT INTO t1 VALUES
+ ('CO',235371754),('CO',235376554),('CO',235376884),('CO',235377874),
+ ('CO',231060394),('CO',231059224),('CO',231059314),('CO',231060484),
+ ('CO',231060274),('CO',231060124),('CO',231060244),('CO',231058594),
+ ('CO',231058924),('CO',231058504),('CO',231059344),('CO',231060424),
+ ('CO',231059554),('CO',231060304),('CO',231059644),('CO',231059464),
+ ('CO',231059764),('CO',231058294),('CO',231058624),('CO',231058864),
+ ('CO',231059374),('CO',231059584),('CO',231059734),('CO',231059014),
+ ('CO',231059854),('CO',231059494),('CO',231059794),('CO',231058534),
+ ('CO',231058324),('CO',231058684),('CO',231059524),('CO',231059974);
+
+CREATE TABLE t2 (
+ scan_date date default NULL,
+ package_id int default NULL,
+ INDEX scan_date(scan_date),
+ INDEX package_id(package_id)
+);
+INSERT INTO t2 VALUES
+ ('2008-12-29',231062944),('2008-12-29',231065764),('2008-12-29',231066124),
+ ('2008-12-29',231060094),('2008-12-29',231061054),('2008-12-29',231065644),
+ ('2008-12-29',231064384),('2008-12-29',231064444),('2008-12-29',231073774),
+ ('2008-12-29',231058594),('2008-12-29',231059374),('2008-12-29',231066004),
+ ('2008-12-29',231068494),('2008-12-29',231070174),('2008-12-29',231071884),
+ ('2008-12-29',231063274),('2008-12-29',231063754),('2008-12-29',231064144),
+ ('2008-12-29',231069424),('2008-12-29',231073714),('2008-12-29',231058414),
+ ('2008-12-29',231060994),('2008-12-29',231069154),('2008-12-29',231068614),
+ ('2008-12-29',231071464),('2008-12-29',231074014),('2008-12-29',231059614),
+ ('2008-12-29',231059074),('2008-12-29',231059464),('2008-12-29',231069094),
+ ('2008-12-29',231067294),('2008-12-29',231070144),('2008-12-29',231073804),
+ ('2008-12-29',231072634),('2008-12-29',231058294),('2008-12-29',231065344),
+ ('2008-12-29',231066094),('2008-12-29',231069034),('2008-12-29',231058594),
+ ('2008-12-29',231059854),('2008-12-29',231059884),('2008-12-29',231059914),
+ ('2008-12-29',231063664),('2008-12-29',231063814),('2008-12-29',231063904);
+
+CREATE TABLE t3 (
+ package_id int default NULL,
+ INDEX package_id(package_id)
+);
+INSERT INTO t3 VALUES
+ (231058294),(231058324),(231058354),(231058384),(231058414),(231058444),
+ (231058474),(231058504),(231058534),(231058564),(231058594),(231058624),
+ (231058684),(231058744),(231058804),(231058864),(231058924),(231058954),
+ (231059014),(231059074),(231059104),(231059134),(231059164),(231059194),
+ (231059224),(231059254),(231059284),(231059314),(231059344),(231059374),
+ (231059404),(231059434),(231059464),(231059494),(231059524),(231059554),
+ (231059584),(231059614),(231059644),(231059674),(231059704),(231059734),
+ (231059764),(231059794),(231059824),(231059854),(231059884),(231059914),
+ (231059944),(231059974),(231060004),(231060034),(231060064),(231060094),
+ (231060124),(231060154),(231060184),(231060214),(231060244),(231060274),
+ (231060304),(231060334),(231060364),(231060394),(231060424),(231060454),
+ (231060484),(231060514),(231060544),(231060574),(231060604),(231060634),
+ (231060664),(231060694),(231060724),(231060754),(231060784),(231060814),
+ (231060844),(231060874),(231060904),(231060934),(231060964),(231060994),
+ (231061024),(231061054),(231061084),(231061144),(231061174),(231061204),
+ (231061234),(231061294),(231061354),(231061384),(231061414),(231061474),
+ (231061564),(231061594),(231061624),(231061684),(231061714),(231061774),
+ (231061804),(231061894),(231061984),(231062074),(231062134),(231062224),
+ (231062254),(231062314),(231062374),(231062434),(231062494),(231062554),
+ (231062584),(231062614),(231062644),(231062704),(231062734),(231062794),
+ (231062854),(231062884),(231062944),(231063004),(231063034),(231063064),
+ (231063124),(231063154),(231063184),(231063214),(231063274),(231063334),
+ (231063394),(231063424),(231063454),(231063514),(231063574),(231063664);
+
+CREATE TABLE t4 (
+ carrier char(2) NOT NULL default '' PRIMARY KEY,
+ id int(11) default NULL,
+ INDEX id(id)
+);
+INSERT INTO t4 VALUES
+ ('99',6),('SK',456),('UA',486),('AI',1081),('OS',1111),('VS',1510);
+
+CREATE TABLE t5 (
+ carrier_id int default NULL,
+ INDEX carrier_id(carrier_id)
+);
+INSERT INTO t5 VALUES
+ (6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),
+ (6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),
+ (6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),
+ (6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),
+ (6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),
+ (6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(456),(456),(456),
+ (456),(456),(456),(456),(456),(456),(456),(456),(456),(456),(456),(456),
+ (456),(486),(1081),(1111),(1111),(1111),(1111),(1510);
+
+SELECT COUNT(*)
+ FROM((t2 JOIN t1 ON t2.package_id = t1.id)
+ JOIN t3 ON t3.package_id = t1.id);
+
+EXPLAIN
+SELECT COUNT(*)
+ FROM ((t2 JOIN t1 ON t2.package_id = t1.id)
+ JOIN t3 ON t3.package_id = t1.id)
+ LEFT JOIN
+ (t5 JOIN t4 ON t5.carrier_id = t4.id)
+ ON t4.carrier = t1.carrier;
+SELECT COUNT(*)
+ FROM ((t2 JOIN t1 ON t2.package_id = t1.id)
+ JOIN t3 ON t3.package_id = t1.id)
+ LEFT JOIN
+ (t5 JOIN t4 ON t5.carrier_id = t4.id)
+ ON t4.carrier = t1.carrier;
+
+DROP TABLE t1,t2,t3,t4,t5;
+
--echo End of 5.0 tests
+
diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test
index 0a29b4cb325..35aec71ebb8 100644
--- a/mysql-test/t/join_outer.test
+++ b/mysql-test/t/join_outer.test
@@ -97,7 +97,7 @@ WHERE t1.uniq_id = 4
ORDER BY t2.c_amount;
INSERT INTO t2 VALUES (2,3,3000,6000,0,0,746584,837484,'yes');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
INSERT INTO t2 VALUES (2,3,3000,6000,0,0,746584,837484,'yes');
INSERT INTO t2 VALUES (7,3,1000,2000,0,0,746294,937484,'yes');
@@ -851,3 +851,19 @@ SELECT t1.id, a FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE t2.b IS NULL;
show status like 'Handler_read%';
DROP TABLE t1,t2;
+
+#
+# Bug 28571: outer join with false on condition over constant tables
+#
+
+CREATE TABLE t1 (c int PRIMARY KEY, e int NOT NULL);
+INSERT INTO t1 VALUES (1,0), (2,1);
+CREATE TABLE t2 (d int PRIMARY KEY);
+INSERT INTO t2 VALUES (1), (2), (3);
+
+EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON e<>0 WHERE c=1 AND d IS NULL;
+SELECT * FROM t1 LEFT JOIN t2 ON e<>0 WHERE c=1 AND d IS NULL;
+SELECT * FROM t1 LEFT JOIN t2 ON e<>0 WHERE c=1 AND d<=>NULL;
+
+DROP TABLE t1,t2;
+
diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test
index 99736e0f11f..f1eb8e68b49 100644
--- a/mysql-test/t/key.test
+++ b/mysql-test/t/key.test
@@ -150,7 +150,7 @@ create table t1
);
INSERT INTO t1 VALUES (1, 1, 1, 1, 'a');
INSERT INTO t1 VALUES (1, 1, 1, 1, 'b');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
INSERT INTO t1 VALUES (1, 1, 1, 1, 'a');
drop table t1;
@@ -243,13 +243,13 @@ show create table t1;
insert t1 values ('cccc', 'tttt'),
(0xD0B1212223D0B1D0B1D0B1D0B1D0B1, 0xD0B1D0B1212223D0B1D0B1D0B1D0B1),
(0xD0B1222123D0B1D0B1D0B1D0B1D0B1, 0xD0B1D0B1222123D0B1D0B1D0B1D0B1);
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert t1 (c) values ('cc22');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert t1 (t) values ('ttt22');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert t1 (c) values (0xD0B1212322D0B1D0B1D0B1D0B1D0B1);
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert t1 (t) values (0xD0B1D0B1212322D0B1D0B1D0B1D0B1);
select c from t1 where c='cccc';
select t from t1 where t='tttt';
@@ -438,7 +438,7 @@ insert into t1 values(1, 'b', 'b', NULL);
# Drop some indexes for new adds.
alter table t1 drop index i3, drop index i2, drop index i1;
# Add indexes, one is unique on non-unique values.
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
alter table t1 add index i3 (c3), add index i2 (c2), add unique index i1 (c1);
drop table t1;
diff --git a/mysql-test/t/key_cache.test b/mysql-test/t/key_cache.test
index 3044964ebc3..4c14dc96aaa 100644
--- a/mysql-test/t/key_cache.test
+++ b/mysql-test/t/key_cache.test
@@ -219,4 +219,31 @@ set global key_cache_block_size= @my_key_cache_block_size;
set @@global.key_buffer_size=0;
select @@global.key_buffer_size;
+#
+# Bug#28478 - Improper key_cache_block_size corrupts MyISAM tables
+#
+SET @bug28478_key_cache_block_size= @@global.key_cache_block_size;
+SET GLOBAL key_cache_block_size= 1536;
+CREATE TABLE t1 (
+ id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ c1 CHAR(150),
+ c2 CHAR(150),
+ c3 CHAR(150),
+ KEY(c1, c2, c3)
+ ) ENGINE= MyISAM;
+INSERT INTO t1 (c1, c2, c3) VALUES
+ ('a', 'b', 'c'), ('b', 'c', 'd'), ('c', 'd', 'e'), ('d', 'e', 'f'),
+ ('e', 'f', 'g'), ('f', 'g', 'h'), ('g', 'h', 'i'), ('h', 'i', 'j'),
+ ('i', 'j', 'k'), ('j', 'k', 'l'), ('k', 'l', 'm'), ('l', 'm', 'n'),
+ ('m', 'n', 'o'), ('n', 'o', 'p'), ('o', 'p', 'q'), ('p', 'q', 'r'),
+ ('q', 'r', 's'), ('r', 's', 't'), ('s', 't', 'u'), ('t', 'u', 'v'),
+ ('u', 'v', 'w'), ('v', 'w', 'x'), ('w', 'x', 'y'), ('x', 'y', 'z');
+INSERT INTO t1 (c1, c2, c3) SELECT c1, c2, c3 from t1;
+INSERT INTO t1 (c1, c2, c3) SELECT c1, c2, c3 from t1;
+INSERT INTO t1 (c1, c2, c3) SELECT c1, c2, c3 from t1;
+CHECK TABLE t1;
+SHOW VARIABLES LIKE 'key_cache_block_size';
+SET GLOBAL key_cache_block_size= @bug28478_key_cache_block_size;
+DROP TABLE t1;
+
# End of 4.1 tests
diff --git a/mysql-test/t/kill.test b/mysql-test/t/kill.test
index cf0895f63c4..5d5095f7d61 100644
--- a/mysql-test/t/kill.test
+++ b/mysql-test/t/kill.test
@@ -81,7 +81,9 @@ connection conn2;
connection conn1;
-- disable_result_log
-send select id from t1 where id in (select distinct id from t2);
+# This is a very long running query. If this test start failing, it may
+# be necessary to change to an even longer query.
+send select id from t1 where id in (select distinct a.id from t2 a, t2 b, t2 c, t2 d group by a.id, b.id, c.id, d.id having a.id between 10 and 20);
-- enable_result_log
connection conn2;
@@ -117,3 +119,188 @@ reap;
select 1;
connection con1;
select RELEASE_LOCK("a");
+
+#
+# Bug#27563: Stored functions and triggers wasn't throwing an error when killed.
+#
+create table t1(f1 int);
+delimiter |;
+create function bug27563() returns int(11)
+deterministic
+begin
+ declare continue handler for sqlstate '70100' set @a:= 'killed';
+ declare continue handler for sqlexception set @a:= 'exception';
+ set @a= get_lock("lock27563", 10);
+ return 1;
+end|
+delimiter ;|
+# Test stored functions
+# Test INSERT
+connection con1;
+select get_lock("lock27563",10);
+connection con2;
+let $ID= `select connection_id()`;
+send insert into t1 values (bug27563());
+real_sleep 2;
+connection con1;
+disable_query_log;
+eval kill query $ID;
+enable_query_log;
+connection con2;
+--error 1317
+reap;
+select @a;
+connection con1;
+select * from t1;
+
+# Test UPDATE
+insert into t1 values(0);
+connection con2;
+send update t1 set f1= bug27563();
+real_sleep 2;
+connection con1;
+disable_query_log;
+eval kill query $ID;
+enable_query_log;
+connection con2;
+--error 1317
+reap;
+select @a;
+connection con1;
+select * from t1;
+
+# Test DELETE
+insert into t1 values(1);
+connection con2;
+send delete from t1 where bug27563() is null;
+real_sleep 2;
+connection con1;
+disable_query_log;
+eval kill query $ID;
+enable_query_log;
+connection con2;
+--error 1317
+reap;
+select @a;
+connection con1;
+select * from t1;
+
+# Test SELECT
+connection con2;
+send select * from t1 where f1= bug27563();
+real_sleep 2;
+connection con1;
+disable_query_log;
+eval kill query $ID;
+enable_query_log;
+connection con2;
+--error 1317
+reap;
+select @a;
+
+# Test PROCEDURE
+connection con2;
+delimiter |;
+create procedure proc27563()
+begin
+ declare continue handler for sqlstate '70100' set @a:= 'killed';
+ declare continue handler for sqlexception set @a:= 'exception';
+ select get_lock("lock27563",10);
+ select "shouldn't be selected";
+end|
+delimiter ;|
+send call proc27563();
+real_sleep 2;
+connection con1;
+disable_query_log;
+eval kill query $ID;
+enable_query_log;
+connection con2;
+--error 1317
+reap;
+select @a;
+
+# Test TRIGGERS
+connection con2;
+create table t2 (f2 int);
+delimiter |;
+create trigger trg27563 before insert on t1 for each row
+begin
+ declare continue handler for sqlstate '70100' set @a:= 'killed';
+ declare continue handler for sqlexception set @a:= 'exception';
+ set @a:= get_lock("lock27563",10);
+ insert into t2 values(1);
+end|
+delimiter ;|
+send insert into t1 values(2),(3);
+real_sleep 2;
+connection con1;
+disable_query_log;
+eval kill query $ID;
+enable_query_log;
+connection con2;
+--error 1317
+reap;
+select @a;
+connection con1;
+select * from t1;
+select * from t2;
+
+# Cleanup
+select release_lock("lock27563");
+drop table t1, t2;
+drop function bug27563;
+drop procedure proc27563;
+
+#
+# Bug#28598: mysqld crash when killing a long-running explain query.
+#
+--disable_query_log
+connection con1;
+let $ID= `select connection_id()`;
+let $tab_count= 40;
+
+let $i= $tab_count;
+while ($i)
+{
+ eval CREATE TABLE t$i (a$i int, KEY(a$i));
+ eval INSERT INTO t$i VALUES (1),(2),(3),(4),(5),(6),(7);
+ dec $i ;
+}
+set session optimizer_search_depth=0;
+
+let $i=$tab_count;
+while ($i)
+{
+ let $a= a$i;
+ let $t= t$i;
+ dec $i;
+ if ($i)
+ {
+ let $comma=,;
+ let $from=$comma$t$from;
+ let $where=a$i=$a $and $where;
+ }
+ if (!$i)
+ {
+ let $from=FROM $t$from;
+ let $where=WHERE $where;
+ }
+ let $and=AND;
+}
+
+--enable_query_log
+eval PREPARE stmt FROM 'EXPLAIN SELECT * $from $where';
+send EXECUTE stmt;
+--disable_query_log
+
+connection con2;
+real_sleep 2;
+eval kill query $ID;
+let $i= $tab_count;
+while ($i)
+{
+ eval DROP TABLE t$i;
+ dec $i ;
+}
+--enable_query_log
diff --git a/mysql-test/t/limit.test b/mysql-test/t/limit.test
index bc599b20d36..286c04785ff 100644
--- a/mysql-test/t/limit.test
+++ b/mysql-test/t/limit.test
@@ -71,3 +71,20 @@ explain select sum(a) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3;
select sum(a) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3;
drop table t1;
# End of 4.1 tests
+
+#
+# Bug #28464: a string argument to 'limit ?' PS
+#
+
+prepare s from "select 1 limit ?";
+set @a='qwe';
+--error 1210
+execute s using @a;
+prepare s from "select 1 limit 1, ?";
+--error 1210
+execute s using @a;
+prepare s from "select 1 limit ?, ?";
+--error 1210
+execute s using @a, @a;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test
index 6a6e59f6173..5433d787c14 100644
--- a/mysql-test/t/loaddata.test
+++ b/mysql-test/t/loaddata.test
@@ -43,7 +43,7 @@ delete from t1;
eval load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t1;
enable_query_log;
select * from t1;
---exec rm $MYSQLTEST_VARDIR/tmp/t1
+remove_file $MYSQLTEST_VARDIR/tmp/t1;
disable_query_log;
eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1'
@@ -54,7 +54,7 @@ eval load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t1
FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n';
enable_query_log;
select * from t1;
---exec rm $MYSQLTEST_VARDIR/tmp/t1
+remove_file $MYSQLTEST_VARDIR/tmp/t1;
SET @@SQL_MODE=@OLD_SQL_MODE;
drop table t1;
@@ -67,6 +67,40 @@ load data infile '../std_data_ln/loaddata_dq.dat' into table t1 fields terminate
select * from t1;
drop table t1;
+#
+# Bug #29294 SELECT INTO OUTFILE/LOAD DATA INFILE with special
+# characters in the FIELDS ENCLOSED BY clause
+#
+
+CREATE TABLE t1 (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ c1 VARCHAR(255)
+);
+
+CREATE TABLE t2 (
+ id INT,
+ c2 VARCHAR(255)
+);
+
+INSERT INTO t1 (c1) VALUES
+ ('r'), ('rr'), ('rrr'), ('rrrr'),
+ ('.r'), ('.rr'), ('.rrr'), ('.rrrr'),
+ ('r.'), ('rr.'), ('rrr.'), ('rrrr.'),
+ ('.r.'), ('.rr.'), ('.rrr.'), ('.rrrr.');
+SELECT * FROM t1;
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' FIELDS ENCLOSED BY 'r' FROM t1;
+cat_file $MYSQLTEST_VARDIR/tmp/t1;
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/t1' INTO TABLE t2 FIELDS ENCLOSED BY 'r';
+SELECT t1.id, c1, c2 FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE c1 != c2;
+SELECT t1.id, c1, c2 FROM t1 RIGHT JOIN t2 ON t1.id=t2.id WHERE c1 != c2;
+
+remove_file $MYSQLTEST_VARDIR/tmp/t1;
+DROP TABLE t1,t2;
+
# End of 4.1 tests
#
@@ -153,9 +187,59 @@ SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
eval load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t2;
enable_query_log;
select * from t2;
---exec rm $MYSQLTEST_VARDIR/tmp/t1
+remove_file $MYSQLTEST_VARDIR/tmp/t1;
SET @@SQL_MODE=@OLD_SQL_MODE;
drop table t1,t2;
+
+#
+# Bug#27670: LOAD DATA does not set CURRENT_TIMESTAMP default value for a
+# TIMESTAMP field when no value has been provided.
+#
+create table t1(f1 int, f2 timestamp not null default current_timestamp);
+create table t2(f1 int);
+insert into t2 values(1),(2);
+disable_query_log;
+eval select * into outfile '$MYSQLTEST_VARDIR/tmp/t2' from t2;
+eval load data infile '$MYSQLTEST_VARDIR/tmp/t2' into table t1;
+enable_query_log;
+select f1 from t1 where f2 <> '0000-00-00 00:00:00' order by f1;
+remove_file $MYSQLTEST_VARDIR/tmp/t2;
+delete from t1;
+disable_query_log;
+eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t2'
+FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n'
+FROM t2;
+eval load data infile '$MYSQLTEST_VARDIR/tmp/t2' into table t1
+FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n';
+enable_query_log;
+select f1 from t1 where f2 <> '0000-00-00 00:00:00' order by f1;
+remove_file $MYSQLTEST_VARDIR/tmp/t2;
+drop table t1,t2;
+
+#
+# Bug#29442: SELECT INTO OUTFILE FIELDS ENCLOSED BY digit, minus sign etc
+# corrupts non-string fields containing this character.
+#
+
+CREATE TABLE t1 (c1 INT, c2 TIMESTAMP, c3 REAL, c4 DOUBLE);
+
+INSERT INTO t1 (c1, c2, c3, c4) VALUES (10, '1970-02-01 01:02:03', 1.1E-100, 1.1E+100);
+SELECT * FROM t1;
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' FIELDS ENCLOSED BY '-' FROM t1;
+cat_file $MYSQLTEST_VARDIR/tmp/t1;
+echo EOF;
+
+TRUNCATE t1;
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/t1' INTO TABLE t1 FIELDS ENCLOSED BY '-';
+SELECT * FROM t1;
+
+remove_file $MYSQLTEST_VARDIR/tmp/t1;
+DROP TABLE t1;
+
# End of 5.0 tests
@@ -178,6 +262,6 @@ select @@character_set_filesystem;
LOAD DATA INFILE 't@002d1' INTO TABLE t1;
SELECT * FROM t1;
DROP TABLE t1;
---exec rm $MYSQLTEST_VARDIR/master-data/test/t@002d1
+remove_file $MYSQLTEST_VARDIR/master-data/test/t@002d1;
SET character_set_filesystem=default;
select @@character_set_filesystem;
diff --git a/mysql-test/t/lock.test b/mysql-test/t/lock.test
index 2b8b430f096..6069bbf7018 100644
--- a/mysql-test/t/lock.test
+++ b/mysql-test/t/lock.test
@@ -148,5 +148,70 @@ LOCK TABLES mysql.time_zone READ, mysql.proc WRITE;
DROP TABLE t1;
+--echo
+--echo Bug#5719 impossible to lock VIEW
+--echo
+--echo Just covering existing behaviour with tests.
+--echo Consistency has not been found here.
+--echo
+--disable_warnings
+drop view if exists v_bug5719;
+drop table if exists t1, t2, t3;
+--enable_warnings
+create table t1 (a int);
+create temporary table t2 (a int);
+create table t3 (a int);
+create view v_bug5719 as select 1;
+lock table v_bug5719 write;
+--error ER_TABLE_NOT_LOCKED
+select * from t1;
+--echo
+--echo Allowed to select from a temporary talbe under LOCK TABLES
+--echo
+select * from t2;
+--error ER_TABLE_NOT_LOCKED
+select * from t3;
+select * from v_bug5719;
+drop view v_bug5719;
+--echo
+--echo sic: did not left LOCK TABLES mode automatically
+--echo
+--error ER_TABLE_NOT_LOCKED
+select * from t1;
+unlock tables;
+create view v_bug5719 as select * from t1;
+lock tables v_bug5719 write;
+select * from v_bug5719;
+--echo
+--echo Allowed to use an underlying table under LOCK TABLES <view>
+--echo
+select * from t1;
+--echo
+--echo Allowed to select from a temporary table under LOCK TABLES
+--echo
+select * from t2;
+--error ER_TABLE_NOT_LOCKED
+select * from t3;
+drop table t1;
+--echo
+--echo sic: left LOCK TABLES mode
+--echo
+select * from t3;
+--error ER_VIEW_INVALID
+select * from v_bug5719;
+unlock tables;
+drop view v_bug5719;
+--echo
+--echo When limitation to use temporary tables in views is removed, please
+--echo add a test that shows what happens under LOCK TABLES when a view
+--echo references a temporary table, is locked, and the underlying table
+--echo is dropped.
+--echo
+--error ER_VIEW_SELECT_TMPTABLE
+create view v_bug5719 as select * from t2;
+--echo
+--echo Cleanup.
+--echo
+drop table t2, t3;
--echo End of 5.1 tests.
diff --git a/mysql-test/t/lock_multi.test b/mysql-test/t/lock_multi.test
index 4a6b4ff5e56..b2266c9bff1 100644
--- a/mysql-test/t/lock_multi.test
+++ b/mysql-test/t/lock_multi.test
@@ -16,10 +16,16 @@ lock tables t1 write;
connection writer;
send update low_priority t1 set n = 4;
connection reader;
---sleep 2
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and info = "update low_priority t1 set n = 4";
+--source include/wait_condition.inc
send select n from t1;
connection locker;
---sleep 2
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and info = "select n from t1";
+--source include/wait_condition.inc
unlock tables;
connection writer;
reap;
@@ -34,15 +40,15 @@ lock tables t1 read;
connection writer;
send update low_priority t1 set n = 4;
connection reader;
---sleep 2
-send select n from t1;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and info = "update low_priority t1 set n = 4";
+--source include/wait_condition.inc
+select n from t1;
connection locker;
---sleep 2
unlock tables;
connection writer;
reap;
-connection reader;
-reap;
drop table t1;
#
@@ -58,13 +64,9 @@ insert into t1 values(2,2);
insert into t2 values(1,2);
lock table t1 read;
connection writer;
---sleep 2
-send update t1,t2 set c=a where b=d;
+update t1,t2 set c=a where b=d;
connection reader;
---sleep 2
select c from t2;
-connection writer;
-reap;
connection locker;
drop table t1;
drop table t2;
@@ -73,7 +75,7 @@ drop table t2;
# Test problem when using locks on many tables and droping a table that
# is to-be-locked by another thread
#
-
+#
connection locker;
create table t1 (a int);
create table t2 (a int);
@@ -81,6 +83,10 @@ lock table t1 write, t2 write;
connection reader;
send insert t1 select * from t2;
connection locker;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and info = "insert t1 select * from t2";
+--source include/wait_condition.inc
drop table t2;
connection reader;
--error 1146
@@ -99,6 +105,10 @@ lock table t1 write, t2 write, t1 as t1_2 write, t2 as t2_2 write;
connection reader;
send insert t1 select * from t2;
connection locker;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and info = "insert t1 select * from t2";
+--source include/wait_condition.inc
drop table t2;
connection reader;
--error 1146
@@ -107,7 +117,7 @@ connection locker;
drop table t1;
-# End of 4.1 tests
+--echo End of 4.1 tests
#
# BUG#9998 - MySQL client hangs on USE "database"
@@ -131,15 +141,18 @@ connection locker;
use mysql;
LOCK TABLES columns_priv WRITE, db WRITE, host WRITE, user WRITE;
FLUSH TABLES;
---sleep 1
#
connection reader;
use mysql;
#NOTE: This must be a multi-table select, otherwise the deadlock will not occur
send SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1;
---sleep 1
#
connection locker;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and info =
+ "SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1";
+--source include/wait_condition.inc
# Make test case independent from earlier grants.
--replace_result "Table is already up to date" "OK"
OPTIMIZE TABLES columns_priv, db, host, user;
@@ -163,10 +176,13 @@ LOCK TABLE t1 WRITE;
# This waits until t1 is unlocked.
connection locker;
send FLUSH TABLES WITH READ LOCK;
---sleep 1
#
-# This must not block.
connection writer;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Flushing tables" and info = "FLUSH TABLES WITH READ LOCK";
+--source include/wait_condition.inc
+# This must not block.
CREATE TABLE t2 (c1 int);
UNLOCK TABLES;
#
@@ -187,10 +203,13 @@ LOCK TABLE t1 WRITE;
# This waits until t1 is unlocked.
connection locker;
send FLUSH TABLES WITH READ LOCK;
---sleep 1
#
# This must not block.
connection writer;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Flushing tables" and info = "FLUSH TABLES WITH READ LOCK";
+--source include/wait_condition.inc
--error 1100
CREATE TABLE t2 AS SELECT * FROM t1;
UNLOCK TABLES;
@@ -219,11 +238,15 @@ FLUSH TABLES WITH READ LOCK;
# wait in wait_if_global_read_lock().
connection con2;
send DROP DATABASE mysqltest_1;
---sleep 1
#
# With bug in place: try to acquire LOCK_mysql_create_table...
# When fixed: Reject dropping db because of the read lock.
connection con1;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for release of readlock"
+ and info = "DROP DATABASE mysqltest_1";
+--source include/wait_condition.inc
--error ER_CANT_UPDATE_WITH_READLOCK
DROP DATABASE mysqltest_1;
UNLOCK TABLES;
@@ -249,17 +272,18 @@ create table t1 (f1 int(12) unsigned not null auto_increment, primary key(f1)) e
--enable_warnings
lock tables t1 write;
connection writer;
---sleep 2
-delimiter //;
-send alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; //
-delimiter ;//
+send alter table t1 auto_increment=0;
connection reader;
---sleep 2
-delimiter //;
-send alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; //
-delimiter ;//
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and info = "alter table t1 auto_increment=0";
+--source include/wait_condition.inc
+send alter table t1 auto_increment=0;
connection locker;
---sleep 2
+let $wait_condition=
+ select count(*) = 2 from information_schema.processlist
+ where state = "Locked" and info = "alter table t1 auto_increment=0";
+--source include/wait_condition.inc
unlock tables;
connection writer;
reap;
@@ -267,6 +291,56 @@ connection reader;
reap;
connection locker;
drop table t1;
+#
+--echo End of 5.0 tests
+
+
+#
+# Bug #21281 "Pending write lock is incorrectly removed when its
+# statement being KILLed"
+#
+create table t1 (i int);
+connection locker;
+lock table t1 read;
+connection writer;
+--send update t1 set i= 10;
+connection reader;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and info = "update t1 set i= 10";
+--source include/wait_condition.inc
+--send select * from t1;
+connection default;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and info = "select * from t1";
+--source include/wait_condition.inc
+let $ID= `select id from information_schema.processlist where state = "Locked" and info = "update t1 set i= 10"`;
+--replace_result $ID ID
+eval kill query $ID;
+connection reader;
+--reap
+connection writer;
+--error ER_QUERY_INTERRUPTED
+--reap
+connection locker;
+unlock tables;
+connection default;
+drop table t1;
-# End of 5.0 tests
+#
+# Bug#25856 - HANDLER table OPEN in one connection lock DROP TABLE in another one
+#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int) ENGINE=MEMORY;
+--echo --> client 2
+connection locker;
+--error 1031
+handler t1 open;
+--echo --> client 1
+connection default;
+drop table t1;
+--echo End of 5.1 tests
diff --git a/mysql-test/t/log_state.test b/mysql-test/t/log_state.test
index 16f466e9b54..c67da261ef1 100644
--- a/mysql-test/t/log_state.test
+++ b/mysql-test/t/log_state.test
@@ -28,7 +28,7 @@ connection con1;
set session long_query_time=1;
select sleep(2);
--replace_column 1 TIMESTAMP 2 USER_HOST 3 QUERY_TIME
-select * from mysql.slow_log;
+select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
connection default;
set global slow_query_log= ON;
@@ -36,7 +36,7 @@ connection con1;
set session long_query_time=1;
select sleep(2);
--replace_column 1 TIMESTAMP 2 USER_HOST 3 QUERY_TIME
-select * from mysql.slow_log;
+select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
connection default;
show global variables
where Variable_name = 'log' or Variable_name = 'log_slow_queries' or
@@ -126,6 +126,59 @@ drop table t1;
--replace_column 1 TIMESTAMP 2 USER_HOST 3 #
select * from mysql.general_log;
+#
+# Bug#29129 (Resetting general_log while the GLOBAL READ LOCK is set causes
+# a deadlock)
+
+# save state
+
+SET @old_general_log_state = @@global.general_log;
+SET @old_slow_log_state = @@global.slow_query_log;
+
+# Test ON->OFF transition under a GLOBAL READ LOCK
+
+SET GLOBAL general_log = ON;
+SET GLOBAL slow_query_log = ON;
+
+FLUSH TABLES WITH READ LOCK;
+
+SET GLOBAL general_log = OFF;
+SET GLOBAL slow_query_log = OFF;
+
+UNLOCK TABLES;
+
+# Test OFF->ON transition under a GLOBAL READ LOCK
+
+FLUSH TABLES WITH READ LOCK;
+
+SET GLOBAL general_log = ON;
+SET GLOBAL slow_query_log = ON;
+
+UNLOCK TABLES;
+
+# Test ON->OFF transition under a GLOBAL READ_ONLY
+
+SET GLOBAL READ_ONLY = ON;
+
+SET GLOBAL general_log = OFF;
+SET GLOBAL slow_query_log = OFF;
+
+SET GLOBAL READ_ONLY = OFF;
+
+# Test OFF->ON transition under a GLOBAL READ_ONLY
+
+SET GLOBAL READ_ONLY = ON;
+
+SET GLOBAL general_log = ON;
+SET GLOBAL slow_query_log = ON;
+
+SET GLOBAL READ_ONLY = OFF;
+
+# Restore state
+
+SET GLOBAL general_log = @old_general_log_state;
+SET GLOBAL slow_query_log = @old_slow_log_state;
+
--enable_ps_protocol
#
diff --git a/mysql-test/t/log_tables.test b/mysql-test/t/log_tables.test
index f1ff91a6d1d..89c7c255554 100644
--- a/mysql-test/t/log_tables.test
+++ b/mysql-test/t/log_tables.test
@@ -64,10 +64,10 @@ flush logs;
# check locking of the log tables
#
---error ER_CANT_WRITE_LOCK_LOG_TABLE
+--error ER_CANT_LOCK_LOG_TABLE
lock tables mysql.general_log WRITE;
---error ER_CANT_WRITE_LOCK_LOG_TABLE
+--error ER_CANT_LOCK_LOG_TABLE
lock tables mysql.slow_log WRITE;
#
@@ -76,78 +76,59 @@ lock tables mysql.slow_log WRITE;
# tables are always opened and locked by the logger.
#
---error ER_CANT_READ_LOCK_LOG_TABLE
+--error ER_CANT_LOCK_LOG_TABLE
lock tables mysql.general_log READ;
---error ER_CANT_READ_LOCK_LOG_TABLE
+--error ER_CANT_LOCK_LOG_TABLE
lock tables mysql.slow_log READ;
#
-# This call should result in TL_READ lock on the log table. This is ok and
-# should pass.
+# This call should result in TL_READ lock on the log table.
+# This is not ok and should fail.
#
+--error ER_CANT_LOCK_LOG_TABLE
lock tables mysql.slow_log READ LOCAL, mysql.general_log READ LOCAL;
-unlock tables;
-
-#
-# check that FLUSH LOGS waits for all readers of the log table to vanish
-#
-
-connect (con1,localhost,root,,);
-connect (con2,localhost,root,,);
-
-connection con1;
-
-lock tables mysql.general_log READ LOCAL;
-
-connection con2;
-
-# this should wait for log tables to unlock
-send flush logs;
-
-connection con1;
+# Misc locking tests
-unlock tables;
-
-# this connection should be alive by the time
-connection con2;
-
-reap;
+show create table mysql.general_log;
+show fields from mysql.general_log;
-select "Mark that we woke up from flush logs in the test"
- as "test passed";
+show create table mysql.slow_log;
+show fields from mysql.slow_log;
#
-# perform the same check for TRUNCATE: it should also wait for readers
-# to disappear
+# check that FLUSH LOGS does not flush the log tables
#
-connection con1;
-
-lock tables mysql.general_log READ LOCAL;
-
-connection con2;
-
-# this should wait for log tables to unlock
-send truncate mysql.general_log;
+flush logs;
+flush tables;
-connection con1;
+SET GLOBAL GENERAL_LOG=ON;
+SET GLOBAL SLOW_QUERY_LOG=ON;
-unlock tables;
+show open tables;
+flush logs;
+show open tables;
-# this connection should be alive by the time
-connection con2;
+#
+# check that FLUSH TABLES does flush the log tables
+#
-reap;
+flush tables;
+# Since the flush is logged, mysql.general_log will be in the cache
+show open tables;
-select "Mark that we woke up from TRUNCATE in the test"
- as "test passed";
+SET GLOBAL GENERAL_LOG=OFF;
+SET GLOBAL SLOW_QUERY_LOG=OFF;
-connection con1;
+flush tables;
+# Here the table cache is empty
+show open tables;
-use test;
+SET GLOBAL GENERAL_LOG=ON;
+SET GLOBAL SLOW_QUERY_LOG=ON;
#
# Bug #16905 Log tables: unicode statements are logged incorrectly
@@ -220,10 +201,10 @@ flush logs;
# check locking of myisam-based log tables
---error ER_CANT_WRITE_LOCK_LOG_TABLE
+--error ER_CANT_LOCK_LOG_TABLE
lock tables mysql.general_log WRITE;
---error ER_CANT_WRITE_LOCK_LOG_TABLE
+--error ER_CANT_LOCK_LOG_TABLE
lock tables mysql.slow_log WRITE;
#
@@ -232,26 +213,19 @@ lock tables mysql.slow_log WRITE;
# tables are always opened and locked by the logger.
#
---error ER_CANT_READ_LOCK_LOG_TABLE
+--error ER_CANT_LOCK_LOG_TABLE
lock tables mysql.general_log READ;
---error ER_CANT_READ_LOCK_LOG_TABLE
+--error ER_CANT_LOCK_LOG_TABLE
lock tables mysql.slow_log READ;
-#
-# This call should result in TL_READ lock on the log table. This is ok and
-# should pass.
-#
-
-lock tables mysql.slow_log READ LOCAL, mysql.general_log READ LOCAL;
-
-unlock tables;
-
# check that we can drop them
set global general_log='OFF';
set global slow_query_log='OFF';
# check that alter table doesn't work for other engines
+set @save_storage_engine= @@session.storage_engine;
+set storage_engine= MEMORY;
--error ER_UNSUPORTED_LOG_ENGINE
alter table mysql.slow_log engine=ndb;
--error ER_UNSUPORTED_LOG_ENGINE
@@ -260,6 +234,7 @@ alter table mysql.slow_log engine=innodb;
alter table mysql.slow_log engine=archive;
--error ER_UNSUPORTED_LOG_ENGINE
alter table mysql.slow_log engine=blackhole;
+set storage_engine= @save_storage_engine;
drop table mysql.slow_log;
drop table mysql.general_log;
@@ -311,6 +286,7 @@ use test;
flush tables with read lock;
unlock tables;
use mysql;
+--error ER_CANT_LOCK_LOG_TABLE
lock tables general_log read local, help_category read local;
unlock tables;
@@ -365,9 +341,9 @@ set global slow_query_log='OFF';
RENAME TABLE slow_log TO slow_log2;
# this should fail
---error ER_CANT_ACTIVATE_LOG
+--error ER_NO_SUCH_TABLE
set global general_log='ON';
---error ER_CANT_ACTIVATE_LOG
+--error ER_NO_SUCH_TABLE
set global slow_query_log='ON';
RENAME TABLE general_log2 TO general_log;
@@ -397,8 +373,381 @@ show tables like "%log%";
drop table slow_log_new, general_log_new;
use test;
-# kill all connections
-disconnect con1;
-disconnect con2;
+#
+# Bug#27857 (Log tables supplies the wrong value for generating
+# AUTO_INCREMENT numbers)
+#
+
+SET GLOBAL LOG_OUTPUT = 'TABLE';
+
+## test the general log
+
+SET GLOBAL general_log = 0;
+FLUSH LOGS;
+
+TRUNCATE TABLE mysql.general_log;
+ALTER TABLE mysql.general_log ENGINE = MyISAM;
+ALTER TABLE mysql.general_log
+ ADD COLUMN seq BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY;
+
+SET GLOBAL general_log = 1;
+FLUSH LOGS;
+
+--replace_column 1 EVENT_TIME 2 USER_HOST 3 THREAD_ID 4 SERVER_ID
+SELECT * FROM mysql.general_log;
+--replace_column 1 EVENT_TIME 2 USER_HOST 3 THREAD_ID 4 SERVER_ID
+SELECT * FROM mysql.general_log;
+SELECT "My own query 1";
+SELECT "My own query 2";
+--replace_column 1 EVENT_TIME 2 USER_HOST 3 THREAD_ID 4 SERVER_ID
+SELECT * FROM mysql.general_log;
+
+SET GLOBAL general_log = 0;
+FLUSH LOGS;
+
+ALTER TABLE mysql.general_log DROP COLUMN seq;
+ALTER TABLE mysql.general_log ENGINE = CSV;
+
+## test the slow query log
+
+SET @old_long_query_time:=@@long_query_time;
+
+SET GLOBAL slow_query_log = 0;
+FLUSH LOGS;
+
+TRUNCATE TABLE mysql.slow_log;
+ALTER TABLE mysql.slow_log ENGINE = MyISAM;
+
+ALTER TABLE mysql.slow_log
+ ADD COLUMN seq BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY;
+
+SET SESSION long_query_time = 1;
+SET GLOBAL slow_query_log = 1;
+FLUSH LOGS;
+
+## FLUSH LOGS above might be slow, so the following is
+## logged as either seq 1-4 or seq 2-5
+SELECT "My own slow query", sleep(2);
+SELECT "My own slow query", sleep(2);
+SELECT "My own slow query", sleep(2);
+SELECT "My own slow query", sleep(2);
+
+## So we look for seq 2-4
+--replace_column 1 START_TIME 2 USER_HOST 3 QUERY_TIME
+SELECT * FROM mysql.slow_log WHERE seq >= 2 LIMIT 3;
+
+SET GLOBAL slow_query_log = 0;
+SET SESSION long_query_time =@old_long_query_time;
+FLUSH LOGS;
+
+ALTER TABLE mysql.slow_log DROP COLUMN seq;
+ALTER TABLE mysql.slow_log ENGINE = CSV;
+
+#
+# Bug#25422 (Hang with log tables)
+#
+
+--disable_warnings
+drop procedure if exists proc25422_truncate_slow;
+drop procedure if exists proc25422_truncate_general;
+drop procedure if exists proc25422_alter_slow;
+drop procedure if exists proc25422_alter_general;
+--enable_warnings
+
+delimiter //;
+
+use test//
+create procedure proc25422_truncate_slow (loops int)
+begin
+ declare v1 int default 0;
+ declare continue handler for sqlexception /* errors from truncate */
+ begin end;
+ while v1 < loops do
+ truncate mysql.slow_log;
+ set v1 = v1 + 1;
+ end while;
+end//
+
+create procedure proc25422_truncate_general (loops int)
+begin
+ declare v1 int default 0;
+ declare continue handler for sqlexception /* errors from truncate */
+ begin end;
+ while v1 < loops do
+ truncate mysql.general_log;
+ set v1 = v1 + 1;
+ end while;
+end//
+
+create procedure proc25422_alter_slow (loops int)
+begin
+ declare v1 int default 0;
+ declare ER_BAD_LOG_STATEMENT condition for 1575;
+ declare continue handler for ER_BAD_LOG_STATEMENT begin end;
+
+ while v1 < loops do
+ set @old_log_state = @@global.slow_query_log;
+ set global slow_query_log = 'OFF';
+ alter table mysql.slow_log engine = CSV;
+ set global slow_query_log = @old_log_state;
+ set v1 = v1 + 1;
+ end while;
+end//
+
+create procedure proc25422_alter_general (loops int)
+begin
+ declare v1 int default 0;
+ declare ER_BAD_LOG_STATEMENT condition for 1575;
+ declare continue handler for ER_BAD_LOG_STATEMENT begin end;
+
+ while v1 < loops do
+ set @old_log_state = @@global.general_log;
+ set global general_log = 'OFF';
+ alter table mysql.general_log engine = CSV;
+ set global general_log = @old_log_state;
+ set v1 = v1 + 1;
+ end while;
+end//
+
+delimiter ;//
+
+set @iterations=100;
+
+--echo "Serial test (proc25422_truncate_slow)"
+call proc25422_truncate_slow(@iterations);
+--echo "Serial test (proc25422_truncate_general)"
+call proc25422_truncate_general(@iterations);
+--echo "Serial test (proc25422_alter_slow)"
+call proc25422_alter_slow(@iterations);
+--echo "Serial test (proc25422_alter_general)"
+call proc25422_alter_general(@iterations);
+
+--echo "Parallel test"
+
+# ER_BAD_LOG_STATEMENT errors will occur,
+# since concurrent threads do SET GLOBAL general_log= ...
+# This is silenced by handlers and will not affect the test
+
+connect (addconroot1, localhost, root,,);
+connect (addconroot2, localhost, root,,);
+connect (addconroot3, localhost, root,,);
+connect (addconroot4, localhost, root,,);
+connect (addconroot5, localhost, root,,);
+connect (addconroot6, localhost, root,,);
+connect (addconroot7, localhost, root,,);
+connect (addconroot8, localhost, root,,);
+
+connection addconroot1;
+send call proc25422_truncate_slow(@iterations);
+connection addconroot2;
+send call proc25422_truncate_slow(@iterations);
+
+connection addconroot3;
+send call proc25422_truncate_general(@iterations);
+connection addconroot4;
+send call proc25422_truncate_general(@iterations);
+
+connection addconroot5;
+send call proc25422_alter_slow(@iterations);
+connection addconroot6;
+send call proc25422_alter_slow(@iterations);
+
+connection addconroot7;
+send call proc25422_alter_general(@iterations);
+connection addconroot8;
+send call proc25422_alter_general(@iterations);
+
+connection addconroot1;
+reap;
+connection addconroot2;
+reap;
+connection addconroot3;
+reap;
+connection addconroot4;
+reap;
+connection addconroot5;
+reap;
+connection addconroot6;
+reap;
+connection addconroot7;
+reap;
+connection addconroot8;
+reap;
+
+connection default;
+
+disconnect addconroot1;
+disconnect addconroot2;
+disconnect addconroot3;
+disconnect addconroot4;
+disconnect addconroot5;
+disconnect addconroot6;
+disconnect addconroot7;
+disconnect addconroot8;
+
+drop procedure proc25422_truncate_slow;
+drop procedure proc25422_truncate_general;
+drop procedure proc25422_alter_slow;
+drop procedure proc25422_alter_general;
+
--enable_ps_protocol
+
+#
+# Bug#23044 (Warnings on flush of a log table)
+#
+
+FLUSH TABLE mysql.general_log;
+show warnings;
+
+FLUSH TABLE mysql.slow_log;
+show warnings;
+
+#
+# Bug#17876 (Truncating mysql.slow_log in a SP after using cursor locks the
+# thread)
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS `db_17876.slow_log_data`;
+DROP TABLE IF EXISTS `db_17876.general_log_data`;
+DROP PROCEDURE IF EXISTS `db_17876.archiveSlowLog`;
+DROP PROCEDURE IF EXISTS `db_17876.archiveGeneralLog`;
+DROP DATABASE IF EXISTS `db_17876`;
+--enable_warnings
+
+CREATE DATABASE db_17876;
+
+CREATE TABLE `db_17876.slow_log_data` (
+ `start_time` timestamp default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ `user_host` mediumtext ,
+ `query_time` time ,
+ `lock_time` time ,
+ `rows_sent` int(11) ,
+ `rows_examined` int(11) ,
+ `db` varchar(512) default NULL,
+ `last_insert_id` int(11) default NULL,
+ `insert_id` int(11) default NULL,
+ `server_id` int(11) default NULL,
+ `sql_text` mediumtext
+);
+
+CREATE TABLE `db_17876.general_log_data` (
+ `event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `user_host` mediumtext,
+ `thread_id` int(11) DEFAULT NULL,
+ `server_id` int(11) DEFAULT NULL,
+ `command_type` varchar(64) DEFAULT NULL,
+ `argument` mediumtext
+);
+
+DELIMITER //;
+
+CREATE procedure `db_17876.archiveSlowLog`()
+BEGIN
+ DECLARE start_time, query_time, lock_time CHAR(20);
+ DECLARE user_host MEDIUMTEXT;
+ DECLARE rows_set, rows_examined, last_insert_id, insert_id, server_id INT;
+ DECLARE dbname MEDIUMTEXT;
+ DECLARE sql_text BLOB;
+ DECLARE done INT DEFAULT 0;
+ DECLARE ER_SP_FETCH_NO_DATA CONDITION for 1329;
+
+ DECLARE cur1 CURSOR FOR SELECT * FROM mysql.slow_log;
+
+ OPEN cur1;
+
+ REPEAT
+ BEGIN
+ BEGIN
+ DECLARE CONTINUE HANDLER FOR ER_SP_FETCH_NO_DATA SET done = 1;
+
+ FETCH cur1 INTO
+ start_time, user_host, query_time, lock_time,
+ rows_set, rows_examined, dbname, last_insert_id,
+ insert_id, server_id, sql_text;
+ END;
+
+ IF NOT done THEN
+ BEGIN
+ INSERT INTO
+ `db_17876.slow_log_data`
+ VALUES(start_time, user_host, query_time, lock_time, rows_set, rows_examined,
+ dbname, last_insert_id, insert_id, server_id, sql_text);
+ END;
+ END IF;
+ END;
+ UNTIL done END REPEAT;
+
+ CLOSE cur1;
+ TRUNCATE mysql.slow_log;
+END //
+
+CREATE procedure `db_17876.archiveGeneralLog`()
+BEGIN
+ DECLARE event_time CHAR(20);
+ DECLARE user_host, argument MEDIUMTEXT;
+ DECLARE thread_id, server_id INT;
+ DECLARE sql_text BLOB;
+ DECLARE done INT DEFAULT 0;
+ DECLARE command_type VARCHAR(64);
+ DECLARE ER_SP_FETCH_NO_DATA CONDITION for 1329;
+
+ DECLARE cur1 CURSOR FOR SELECT * FROM mysql.general_log;
+
+ OPEN cur1;
+
+ REPEAT
+ BEGIN
+ BEGIN
+ DECLARE CONTINUE HANDLER FOR ER_SP_FETCH_NO_DATA SET done = 1;
+
+ FETCH cur1 INTO
+ event_time, user_host, thread_id, server_id,
+ command_type, argument;
+ END;
+
+ IF NOT done THEN
+ BEGIN
+ INSERT INTO
+ `db_17876.general_log_data`
+ VALUES(event_time, user_host, thread_id, server_id,
+ command_type, argument);
+ END;
+ END IF;
+ END;
+ UNTIL done END REPEAT;
+
+ CLOSE cur1;
+ TRUNCATE mysql.general_log;
+END //
+
+DELIMITER ;//
+
+SET @old_general_log_state = @@global.general_log;
+SET @old_slow_log_state = @@global.slow_query_log;
+
+SET GLOBAL general_log = ON;
+SET GLOBAL slow_query_log = ON;
+
+select "put something into general_log";
+select "... and something more ...";
+
+call `db_17876.archiveSlowLog`();
+call `db_17876.archiveGeneralLog`();
+
+SET GLOBAL general_log = OFF;
+SET GLOBAL slow_query_log = OFF;
+
+call `db_17876.archiveSlowLog`();
+call `db_17876.archiveGeneralLog`();
+
+DROP TABLE `db_17876.slow_log_data`;
+DROP TABLE `db_17876.general_log_data`;
+DROP PROCEDURE IF EXISTS `db_17876.archiveSlowLog`;
+DROP PROCEDURE IF EXISTS `db_17876.archiveGeneralLog`;
+DROP DATABASE IF EXISTS `db_17876`;
+
+SET GLOBAL general_log = @old_general_log_state;
+SET GLOBAL slow_query_log = @old_slow_log_state;
+
diff --git a/mysql-test/t/long_tmpdir-master.opt b/mysql-test/t/long_tmpdir-master.opt
new file mode 100644
index 00000000000..398abfc4632
--- /dev/null
+++ b/mysql-test/t/long_tmpdir-master.opt
@@ -0,0 +1 @@
+--tmpdir=$MYSQLTEST_VARDIR/tmp/long_temporary_directory_path_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
diff --git a/mysql-test/t/long_tmpdir-master.sh b/mysql-test/t/long_tmpdir-master.sh
new file mode 100644
index 00000000000..318955fbcca
--- /dev/null
+++ b/mysql-test/t/long_tmpdir-master.sh
@@ -0,0 +1,3 @@
+d="$MYSQLTEST_VARDIR/tmp/long_temporary_directory_path_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789"
+test -d "$d" || mkdir "$d"
+rm -f "$d"/*
diff --git a/mysql-test/t/long_tmpdir.test b/mysql-test/t/long_tmpdir.test
new file mode 100644
index 00000000000..cf0bed29918
--- /dev/null
+++ b/mysql-test/t/long_tmpdir.test
@@ -0,0 +1,9 @@
+#
+# Bug #29015: Stack overflow in processing temporary table name when tmpdir path
+# is long
+#
+
+create view v1 as select table_name from information_schema.tables;
+drop view v1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/lowercase_table3.test b/mysql-test/t/lowercase_table3.test
index 75f6e5188c5..51385b4b178 100644
--- a/mysql-test/t/lowercase_table3.test
+++ b/mysql-test/t/lowercase_table3.test
@@ -27,9 +27,9 @@ flush tables;
# storing things in lower case.
#
-CREATE TABLE t1 (a int) ENGINE=INNODB;
+CREATE TABLE bug29839 (a int) ENGINE=INNODB;
--error 1146
-SELECT * from T1;
-drop table t1;
+SELECT * from BUG29839;
+drop table bug29839;
# End of 4.1 tests
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index 69e0b19ebf0..fd479276b3b 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -195,9 +195,9 @@ select * from t6 order by a,b;
insert into t1 values (99,NULL);
select * from t4 where a+0 > 90;
# bug#4008 - cannot determine a unique key that caused "dupl. key error"
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert t5 values (1,1);
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert t6 values (2,1);
insert t5 values (1,1) on duplicate key update b=b+10;
insert t6 values (2,1) on duplicate key update b=b+20;
@@ -490,4 +490,25 @@ insert into t1 values (1);
drop table t2;
drop table t1;
+#
+# BUG#26976 - Missing table in merge not noted in related error msg + SHOW
+# CREATE TABLE fails
+#
+CREATE TABLE tm1(a INT) ENGINE=MERGE UNION=(t1, t2);
+--error 1168
+SELECT * FROM tm1;
+CHECK TABLE tm1;
+CREATE TABLE t1(a INT);
+--error 1168
+SELECT * FROM tm1;
+CHECK TABLE tm1;
+CREATE TABLE t2(a BLOB);
+--error 1168
+SELECT * FROM tm1;
+CHECK TABLE tm1;
+ALTER TABLE t2 MODIFY a INT;
+SELECT * FROM tm1;
+CHECK TABLE tm1;
+DROP TABLE tm1, t1, t2;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/metadata.test b/mysql-test/t/metadata.test
index a6ebfdc14c1..65c062399b7 100644
--- a/mysql-test/t/metadata.test
+++ b/mysql-test/t/metadata.test
@@ -81,3 +81,35 @@ drop view v1,v2,v3;
--disable_metadata
# End of 4.1 tests
+
+#
+# Bug #28492: subselect returns LONG in >5.0.24a and LONGLONG in <=5.0.24a
+#
+--enable_metadata
+select a.* from (select 2147483648 as v_large) a;
+select a.* from (select 214748364 as v_small) a;
+--disable_metadata
+
+#
+# Bug #28898: table alias and database name of VIEW columns is empty in the
+# metadata of # SELECT statement where join is executed via temporary table.
+#
+
+CREATE TABLE t1 (c1 CHAR(1));
+CREATE TABLE t2 (c2 CHAR(1));
+CREATE VIEW v1 AS SELECT t1.c1 FROM t1;
+CREATE VIEW v2 AS SELECT t2.c2 FROM t2;
+INSERT INTO t1 VALUES ('1'), ('2'), ('3');
+INSERT INTO t2 VALUES ('1'), ('2'), ('3'), ('2');
+
+--enable_metadata
+SELECT v1.c1 FROM v1 JOIN t2 ON c1=c2 ORDER BY 1;
+SELECT v1.c1, v2.c2 FROM v1 JOIN v2 ON c1=c2;
+SELECT v1.c1, v2.c2 FROM v1 JOIN v2 ON c1=c2 GROUP BY v1.c1;
+SELECT v1.c1, v2.c2 FROM v1 JOIN v2 ON c1=c2 GROUP BY v1.c1 ORDER BY v2.c2;
+--disable_metadata
+
+DROP VIEW v1,v2;
+DROP TABLE t1,t2;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test
index 9cd93f2c7dd..6f5ac70a34b 100644
--- a/mysql-test/t/multi_update.test
+++ b/mysql-test/t/multi_update.test
@@ -3,7 +3,8 @@
#
# Requires grants, so won't work with embedded server test
--- source include/not_embedded.inc
+source include/not_embedded.inc;
+source include/have_log_bin.inc;
--disable_warnings
drop table if exists t1,t2,t3;
@@ -570,3 +571,48 @@ delete t1.*,t2.* from t1,t2 where t1.i2=t2.id;
select * from t1 order by i1;
select * from t2 order by id;
drop table t1, t2;
+
+#
+# Bug#27716 multi-update did partially and has not binlogged
+#
+CREATE TABLE `t1` (
+ `a` int(11) NOT NULL auto_increment,
+ `b` int(11) default NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
+
+CREATE TABLE `t2` (
+ `a` int(11) NOT NULL auto_increment,
+ `b` int(11) default NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
+
+# as the test is about to see erroed queries in binlog
+set @@session.binlog_format= mixed;
+
+
+# A. testing multi_update::send_error() effective update
+insert into t1 values (1,1),(2,2);
+insert into t2 values (1,1),(4,4);
+reset master;
+error ER_DUP_ENTRY;
+UPDATE t2,t1 SET t2.a=t1.a+2;
+# check
+select * from t2 /* must be (3,1), (4,4) */;
+show master status /* there must be the UPDATE query event */;
+
+# B. testing multi_update::send_error() ineffective update
+# (as there is a policy described at mysql_update() still go to binlog)
+delete from t1;
+delete from t2;
+insert into t1 values (1,2),(3,4),(4,4);
+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 the UPDATE query event */;
+
+# cleanup bug#27716
+drop table t1, t2;
+
+--echo end of tests
diff --git a/mysql-test/t/myisam-blob-master.opt b/mysql-test/t/myisam-blob-master.opt
index 1a1076c7bad..ededac33ec7 100644
--- a/mysql-test/t/myisam-blob-master.opt
+++ b/mysql-test/t/myisam-blob-master.opt
@@ -1 +1 @@
---max-allowed-packet=24M --skip-innodb --key-buffer-size=1M
+--max-allowed-packet=24M --loose-skip-innodb --key-buffer-size=1M
diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test
index 8f7357d1c98..b06fd536f45 100644
--- a/mysql-test/t/myisam.test
+++ b/mysql-test/t/myisam.test
@@ -453,9 +453,9 @@ create table t1 (a int not null auto_increment primary key, b text not null, uni
insert into t1 (b) values ('a'),('b'),('c');
select concat(b,'.') from t1;
update t1 set b='b ' where a=2;
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
update t1 set b='b ' where a > 1;
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 (b) values ('b');
select * from t1;
delete from t1 where b='b';
@@ -1129,8 +1129,26 @@ create table t3 (c1 int) engine=myisam pack_keys=default;
create table t4 (c1 int) engine=myisam pack_keys=2;
drop table t1, t2, t3;
+
+#
+# Bug#28476: force index on a disabled myisam index gives error 124
+#
+CREATE TABLE t1(a INT, b INT, KEY inx (a), UNIQUE KEY uinx (b)) ENGINE=MyISAM;
+INSERT INTO t1(a,b) VALUES (1,1),(2,2),(3,3),(4,4),(5,5);
+SELECT a FROM t1 FORCE INDEX (inx) WHERE a=1;
+ALTER TABLE t1 DISABLE KEYS;
+SELECT a FROM t1 FORCE INDEX (inx) WHERE a=1;
+SELECT a FROM t1 USE INDEX (inx) WHERE a=1;
+SELECT b FROM t1 FORCE INDEX (uinx) WHERE b=1;
+SELECT b FROM t1 USE INDEX (uinx) WHERE b=1;
+SELECT a FROM t1 FORCE INDEX (inx,uinx) WHERE a=1;
+ALTER TABLE t1 ENABLE KEYS;
+SELECT a FROM t1 FORCE INDEX (inx) WHERE a=1;
+DROP TABLE t1;
+
--echo End of 5.0 tests
+
#
# Test of key_block_size
#
diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test
index 08087f17e16..3ee04f32640 100644
--- a/mysql-test/t/mysql.test
+++ b/mysql-test/t/mysql.test
@@ -242,18 +242,21 @@ DELIMITER /
SELECT 1/
EOF
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug21412.sql 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/bug21412.sql;
# This should give an error...
--write_file $MYSQLTEST_VARDIR/tmp/bug21412.sql
DELIMITER \
EOF
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug21412.sql 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/bug21412.sql;
# As should this...
--write_file $MYSQLTEST_VARDIR/tmp/bug21412.sql
DELIMITER \\
EOF
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug21412.sql 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/bug21412.sql;
#
# Some coverage of not normally used parts
@@ -263,7 +266,7 @@ EOF
--exec $MYSQL test -e "show status" 2>&1 > /dev/null
--exec $MYSQL --help 2>&1 > /dev/null
--exec $MYSQL --version 2>&1 > /dev/null
---enable_quary_log
+--enable_query_log
#
# bug #26851: Mysql Client --pager Buffer Overflow
@@ -274,4 +277,16 @@ EOF
--exec $MYSQL --pager="540bytelengthstringxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -e "select 1" > /dev/null 2>&1
--exec $MYSQL --character-sets-dir="540bytelengthstringxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -e "select 1" 2>&1
+#
+# bug #30164: Using client side macro inside server side comments generates broken queries
+#
+--exec $MYSQL test -e "/*! \C latin1 */ select 1;"
+
--echo End of 5.0 tests
+
+#
+# Bug #29903: The CMake build method does not produce the embedded library.
+#
+--disable_query_log
+--exec $MYSQL --server-arg=no-defaults test -e "quit"
+--enable_query_log
diff --git a/mysql-test/t/mysql_upgrade.test b/mysql-test/t/mysql_upgrade.test
index 3f9626fcc42..233e8c7c256 100644
--- a/mysql-test/t/mysql_upgrade.test
+++ b/mysql-test/t/mysql_upgrade.test
@@ -55,3 +55,16 @@ DROP USER mysqltest1@'%';
--replace_regex /.*mysqlcheck.*: Got/mysqlcheck: Got/ /\([0-9]*\)/(errno)/
--error 1
--exec $MYSQL_UPGRADE --skip-verbose --force --host=not_existing_host 2>&1
+
+#
+# Bug #28401 mysql_upgrade Failed with STRICT_ALL_TABLES, ANSI_QUOTES and NO_ZERO_DATE
+#
+
+# The SQL commands used by mysql_upgrade are written to be run
+# with sql_mode set to '' - thus the scripts should change sql_mode
+# for the session to make sure the SQL is legal.
+
+# Test by setting sql_mode before running mysql_upgrade
+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;
diff --git a/mysql-test/t/mysqladmin.test b/mysql-test/t/mysqladmin.test
index 3fa03fa910e..839ecf00b60 100644
--- a/mysql-test/t/mysqladmin.test
+++ b/mysql-test/t/mysqladmin.test
@@ -20,7 +20,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
-
+remove_file $MYSQLTEST_VARDIR/tmp/bug10608.cnf;
# When mysqladmin finds "loose-database" in .cnf file it shall print
# a warning and continue
@@ -32,3 +32,4 @@ 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
+remove_file $MYSQLTEST_VARDIR/tmp/bug10608.cnf;
diff --git a/mysql-test/t/mysqlbinlog-cp932.test b/mysql-test/t/mysqlbinlog-cp932.test
index 5a5b7646cf4..4ca0eedaece 100644
--- a/mysql-test/t/mysqlbinlog-cp932.test
+++ b/mysql-test/t/mysqlbinlog-cp932.test
@@ -3,6 +3,7 @@
-- source include/have_binlog_format_mixed_or_statement.inc
-- source include/have_cp932.inc
+-- source include/have_log_bin.inc
# Bug#16217 (mysql client did not know how not switch its internal charset)
flush logs;
diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test
index e4cbd2938fb..25bd9a402ae 100644
--- a/mysql-test/t/mysqlbinlog.test
+++ b/mysql-test/t/mysqlbinlog.test
@@ -2,8 +2,7 @@
# TODO: Need to look at making a row based version once the new row based client is completed. [jbm]
-- source include/have_binlog_format_mixed_or_statement.inc
-# Embedded server doesn't support binlogging
--- source include/not_embedded.inc
+-- source include/have_log_bin.inc
# we need this for getting fixed timestamps inside of this test
set timestamp=1000000000;
@@ -207,6 +206,40 @@ flush logs;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000010
+#
+# Bug#28293 missed '#' sign in the hex dump when the dump length
+# is divisible by 16.
+#
+
+CREATE TABLE t1 (c1 CHAR(10));
+# we need this for getting fixed timestamps inside of this test
+flush logs;
+INSERT INTO t1 VALUES ('0123456789');
+flush logs;
+DROP TABLE t1;
+--exec $MYSQL_BINLOG --hexdump --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000012 | grep 'Query' | sed 's/[0-9]\{1,\}/REMOVED/g'
+
+#
+# Bug #29928: incorrect connection_id() restoring from mysqlbinlog out
+#
+flush logs;
+create table t1(a int);
+insert into t1 values(connection_id());
+let $a= `select a from t1`;
+flush logs;
+--exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000014 > $MYSQLTEST_VARDIR/tmp/bug29928.sql
+drop table t1;
+connect (con1, localhost, root, , test);
+connection con1;
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug29928.sql
+--remove_file $MYSQLTEST_VARDIR/tmp/bug29928.sql
+let $b= `select a from t1`;
+disconnect con1;
+connection default;
+let $c= `select $a=$b`;
+--echo $c
+drop table t1;
+
--echo End of 5.0 tests
#
@@ -214,7 +247,7 @@ flush logs;
#
flush logs;
--error 1
---exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000012 >/dev/null 2>/dev/null
---exec $MYSQL_BINLOG --force-if-open $MYSQLTEST_VARDIR/log/master-bin.000012 >/dev/null 2>/dev/null
+--exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000016 >/dev/null 2>/dev/null
+--exec $MYSQL_BINLOG --force-if-open $MYSQLTEST_VARDIR/log/master-bin.000016 >/dev/null 2>/dev/null
--echo End of 5.1 tests
diff --git a/mysql-test/t/mysqlbinlog2.test b/mysql-test/t/mysqlbinlog2.test
index ac647f772b1..be9397aafee 100644
--- a/mysql-test/t/mysqlbinlog2.test
+++ b/mysql-test/t/mysqlbinlog2.test
@@ -4,8 +4,6 @@
# TODO: Need to look at making row based version once new binlog client is complete.
-- source include/have_binlog_format_mixed_or_statement.inc
-# Embedded server doesn't support binlogging
--- source include/not_embedded.inc
--disable_warnings
drop table if exists t1;
@@ -43,7 +41,8 @@ select "--- Local --" as "";
# be time dependent (the Start events). Better than nothing.
#
---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001
+--replace_regex /[[:<:]][0-9]{6} [0-9 ][0-9]:[0-9]{2}:[0-9]{2}[[:>:]]/{yymmdd} {HH:MM:SS}/ /=[0-9]+ /={integer} / /# at [0-9]+/# at {pos}/ /(pos:?) [0-9]+/\1 {pos}/ /binlog v [0-9]+, server v [^ ]* created/binlog v #, server v ## created/
+--exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000001
--disable_query_log
select "--- offset --" as "";
diff --git a/mysql-test/t/mysqldump-compat.opt b/mysql-test/t/mysqldump-compat.opt
new file mode 100644
index 00000000000..40d4ac738a6
--- /dev/null
+++ b/mysql-test/t/mysqldump-compat.opt
@@ -0,0 +1 @@
+--loose-debug=d,4x_server_emul
diff --git a/mysql-test/t/mysqldump-compat.test b/mysql-test/t/mysqldump-compat.test
new file mode 100644
index 00000000000..848d66cc728
--- /dev/null
+++ b/mysql-test/t/mysqldump-compat.test
@@ -0,0 +1,13 @@
+# Embedded server doesn't support external clients
+--source include/not_embedded.inc
+
+#
+# Bug #30126: semicolon before closing */ in /*!... CREATE DATABASE ;*/
+#
+
+CREATE DATABASE mysqldump_30126;
+USE mysqldump_30126;
+CREATE TABLE t1 (c1 int);
+--exec $MYSQL_DUMP --add-drop-database mysqldump_30126 > $MYSQLTEST_VARDIR/tmp/bug30126.sql
+--exec $MYSQL mysqldump_30126 < $MYSQLTEST_VARDIR/tmp/bug30126.sql
+DROP DATABASE mysqldump_30126;
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index a6f93e759dc..0440b0fb63a 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -1,5 +1,9 @@
# Embedded server doesn't support external clients
--source include/not_embedded.inc
+--source include/have_log_bin.inc
+
+# Binlog is required
+--source include/have_log_bin.inc
--disable_warnings
DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa, t3;
@@ -1528,7 +1532,49 @@ drop user user2;
drop database mysqldump_test_db;
+--echo #
+--echo # Bug #28522: buffer overrun by '\0' byte using --hex-blob.
+--echo #
+
+CREATE TABLE t1 (c1 INT, c2 LONGBLOB);
+INSERT INTO t1 SET c1=11, c2=REPEAT('q',509);
+--exec $MYSQL_DUMP --skip-create --compact --hex-blob test t1
+DROP TABLE t1;
+
+--echo #
+--echo # Bug #28524: mysqldump --skip-add-drop-table is not
+--echo # compatible with views
+--echo #
+
+CREATE VIEW v1 AS SELECT 1;
+--exec $MYSQL_DUMP --skip-add-drop-table test > $MYSQLTEST_VARDIR/tmp/bug28524.sql
+DROP VIEW v1;
+
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug28524.sql
+SELECT * FROM v1;
+DROP VIEW v1;
+
+--echo #
+--echo # Bug #29788: mysqldump discards the NO_AUTO_VALUE_ON_ZERO value of
+--echo # the SQL_MODE variable after the dumping of triggers.
+--echo #
+
+CREATE TABLE t1 (c1 INT);
+CREATE TRIGGER t1bd BEFORE DELETE ON t1 FOR EACH ROW BEGIN END;
+
+CREATE TABLE t2 (c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
+
+SET @TMP_SQL_MODE = @@SQL_MODE;
+SET SQL_MODE = 'NO_AUTO_VALUE_ON_ZERO';
+INSERT INTO t2 VALUES (0), (1), (2);
+SET SQL_MODE = @TMP_SQL_MODE;
+SELECT * FROM t2;
+
+--exec $MYSQL_DUMP --routines test >$MYSQLTEST_VARDIR/tmp/bug29788.sql
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug29788.sql
+SELECT * FROM t2;
+DROP TABLE t1,t2;
--echo #
--echo # End of 5.0 tests
@@ -1652,6 +1698,79 @@ drop database mysqldump_test_db;
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug26121.sql
--remove_file $MYSQLTEST_VARDIR/tmp/bug26121.sql
+###########################################################################
+
+--echo #
+--echo # Bug #30027: mysqldump does not dump views properly.
+--echo #
+
+--echo
+--echo # Cleanup.
+
+--disable_warnings
+DROP DATABASE IF EXISTS mysqldump_test_db;
+--enable_warnings
+
+--echo
+--echo # Create objects.
+
+CREATE DATABASE mysqldump_test_db;
+
+set names koi8r;
+
+CREATE VIEW mysqldump_test_db.v2 AS SELECT 1 AS ËÏÌÏÎËÁ1;
+CREATE VIEW mysqldump_test_db.v1 AS SELECT ËÏÌÏÎËÁ1 FROM mysqldump_test_db.v2;
+
+set names latin1;
+
+--echo
+--echo # Dump mysqldump_test_db to bug30027.sql.
+
+--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --default-character-set=latin1 --databases mysqldump_test_db > $MYSQLTEST_VARDIR/tmp/bug30027.sql
+
+--echo
+--echo # Drop mysqldump_test_db.
+
+DROP DATABASE mysqldump_test_db;
+
+--echo
+--echo # Restore mysqldump_test_db from bug30027.sql.
+
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug30027.sql
+
+--echo
+--echo # Check the view.
+
+set names utf8;
+
+SHOW CREATE VIEW mysqldump_test_db.v1;
+SHOW CREATE VIEW mysqldump_test_db.v2;
+
+set names latin1;
+
+--echo
+--echo # Cleanup.
+
+DROP DATABASE mysqldump_test_db;
+
+###########################################################################
+
+--echo #
+--echo # BUG#29938: wrong behavior of mysqldump --skip-events
+--echo # with --all-databases
+--echo #
+
+TRUNCATE mysql.event;
+
+USE test;
+CREATE event e29938 ON SCHEDULE AT '2035-12-31 20:01:23' DO SET @bug29938=29938;
+SHOW EVENTS;
+--exec $MYSQL_DUMP --skip-events --all-databases > $MYSQLTEST_VARDIR/tmp/bug29938.sql
+
+TRUNCATE mysql.event;
+--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug29938.sql
+SHOW EVENTS;
+
--echo #
--echo # End of 5.1 tests
--echo #
diff --git a/mysql-test/t/mysqlslap.test b/mysql-test/t/mysqlslap.test
index 2a7bbfed932..dffa226d101 100644
--- a/mysql-test/t/mysqlslap.test
+++ b/mysql-test/t/mysqlslap.test
@@ -36,3 +36,7 @@
--exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-guid-primary --auto-generate-sql-load-type=key --auto-generate-sql-execute-number=5 --auto-generate-sql-secondary-indexes=3
--exec $MYSQL_SLAP --only-print --delimiter=";" --query="select * from t1;select * from t2" --create="CREATE TABLE t1 (id int, name varchar(64)); create table t2(foo1 varchar(32), foo2 varchar(32)); INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2')" --engine="heap,myisam" --post-query="SHOW TABLES" --pre-query="SHOW TABLES";
+
+ --exec $MYSQL_SLAP --only-print --delimiter=";" --query="select * from t1;select * from t2" --create="CREATE TABLE t1 (id int, name varchar(64)); create table t2(foo1 varchar(32), foo2 varchar(32)); INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2')" --engine="heap,myisam" --post-query="SHOW TABLES" --pre-query="SHOW TABLES" --number-of-queries=6 --commit=1;
+
+--exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=write --detach=2
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test
index 328206626df..8a38972c00f 100644
--- a/mysql-test/t/mysqltest.test
+++ b/mysql-test/t/mysqltest.test
@@ -1,3 +1,5 @@
+-- source include/have_log_bin.inc
+
# This test should work in embedded server after mysqltest is fixed
-- source include/not_embedded.inc
@@ -46,11 +48,6 @@ select otto from (select 1 as otto) as t1;
--error 0
select otto from (select 1 as otto) as t1;
-# expectation <> response
--- // --error 1054
--- // select otto from (select 1 as otto) as t1;
-
-
# ----------------------------------------------------------------------------
# Negative case(statement):
# The derived table t1 does not contain a column named 'friedrich' .
@@ -331,9 +328,9 @@ select 3 from t1 ;
# This is a comment
# This is a ; comment
# This is a -- comment
--- This is also a comment
--- # This is also a comment
--- This is also a ; comment
+# -- This is also a comment
+# -- # This is also a comment
+# -- This is also a ; comment
# ----------------------------------------------------------------------------
# Test comments with embedded command
@@ -369,6 +366,7 @@ show status;
EOF
--error 1
--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
#
# Missing delimiter until eof
@@ -380,6 +378,7 @@ sleep 7
EOF
--error 1
--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
#
# Missing delimiter until "disable_query_log"
@@ -394,6 +393,7 @@ disable_query_log;
EOF
--error 1
--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
#
# Missing delimiter until "disable_query_log"
@@ -409,6 +409,7 @@ disable_query_log;
EOF
--error 1
--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
#
# Missing delimiter until eof
@@ -425,6 +426,7 @@ disconnect default
EOF
--error 1
--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
#
# Missing delimiter until eof
@@ -439,6 +441,8 @@ EOF
--error 1
--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
+
#
# Extra delimiter
#
@@ -737,38 +741,40 @@ if (`select length("$var3") > 0`)
# Test to assign let from query
# let $<var_name>=`<query>`;
# ----------------------------------------------------------------------------
---disable_parsing
echo var1;
let $var1= `select "hi" as "Col", 1 as "Column1", "hi there" as Col3`;
echo $var1;
-echo $var1_Col;
-echo $var1_Column1;
-echo $var1_Col3;
echo var2;
let $var2= `select 2 as "Column num 2"`;
echo $var2;
-echo $var2_Column num 2;
-echo $var2_Column;
echo var2 again;
let $var2= `select 2 as "Column num 2"`;
echo $var2;
-echo $var2_Column num 2;
-echo $var2_Column_num_2;
-echo $var2_Column;
echo var3 two columns with same name;
let $var3= `select 1 as "Col", 2 as "Col", 3 as "var3"`;
echo $var3;
-echo $var3_Col;
-echo $var3_Col;
-echo $var3_var3;
-#echo failing query in let;
-#--error 1
-#--exec echo "let $var2= `failing query;`" | $MYSQL_TEST 2>&1
---enable_parsing
+echo var4 from query that returns NULL;
+let $var4= `select NULL`;
+
+echo var5 from query that returns no row;
+let $var5= `SHOW VARIABLES LIKE "nonexisting_variable"`;
+
+echo failing query in let;
+--write_file $MYSQLTEST_VARDIR/tmp/let.sql
+let $var2= `failing query`;
+echo $var2;
+EOF
+
+--error 1
+--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/let.sql 2>&1
+
+remove_file $MYSQLTEST_VARDIR/tmp/let.sql;
+
+
# ----------------------------------------------------------------------------
# Test source command
# ----------------------------------------------------------------------------
@@ -789,6 +795,7 @@ echo $var3_var3;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--error 1
--exec echo "source $MYSQLTEST_VARDIR/tmp/recursive.sql;" | $MYSQL_TEST 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/recursive.sql;
# Source a file with error
--exec echo "garbage ;" > $MYSQLTEST_VARDIR/tmp/error.sql
@@ -796,6 +803,7 @@ echo $var3_var3;
--error 1
--exec echo "source $MYSQLTEST_VARDIR/tmp/error.sql;" | $MYSQL_TEST 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/error.sql;
# Test execution of source in a while loop
--write_file $MYSQLTEST_VARDIR/tmp/sourced.inc
@@ -840,8 +848,25 @@ while ($num)
}
--enable_abort_on_error
--enable_query_log
+
+# Test source $variable/<filename>
+--source $MYSQLTEST_VARDIR/tmp/sourced.inc
+
+--remove_file $MYSQLTEST_VARDIR/tmp/sourced.inc
+
+--write_file $MYSQLTEST_VARDIR/tmp/sourced.inc
+echo "hello";
+EOF
+
+let $x= sourced;
+source $MYSQLTEST_VARDIR/tmp/$x.inc;
+
+let $x= $MYSQLTEST_VARDIR;
+source $x/tmp/sourced.inc;
+
--remove_file $MYSQLTEST_VARDIR/tmp/sourced.inc
+
# ----------------------------------------------------------------------------
# Test sleep command
# ----------------------------------------------------------------------------
@@ -962,7 +987,7 @@ if (!$counter)
echo Counter is not 0, (counter=10);
}
let $counter=0;
-if ($counter)
+if($counter)
{
echo Counter is greater than 0, (counter=0);
}
@@ -1155,6 +1180,7 @@ echo hej;
EOF
--error 1
--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
while (0)
@@ -1162,6 +1188,7 @@ while (0)
EOF
--error 1
--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
while (0){
@@ -1170,6 +1197,8 @@ EOF
--error 1
--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
+
# ----------------------------------------------------------------------------
# Test error messages returned from comments starting with a command
# ----------------------------------------------------------------------------
@@ -1227,11 +1256,9 @@ select "a" as col1, "c" as col2;
# Test sync_with_master
# ----------------------------------------------------------------------------
--error 1
---exec echo "save_master_pos; sync_with_master 10!;" | $MYSQL_TEST 2>&1
+--exec echo "sync_with_master 10!;" | $MYSQL_TEST 2>&1
--error 1
---exec echo "save_master_pos; sync_with_master 10 !;" | $MYSQL_TEST 2>&1
---error 1
---exec echo "save_master_pos; sync_with_master a;" | $MYSQL_TEST 2>&1
+--exec echo "sync_with_master a;" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
# Test connect
@@ -1263,8 +1290,9 @@ while ($i)
}
EOF
--exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql; echo OK;" | $MYSQL_TEST 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
-# Repeat connect/disconnect, exceed max number of connections
+# Repeat connect/disconnect
--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
let $i=200;
while ($i)
@@ -1277,6 +1305,7 @@ EOF
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--error 1
--exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql;" | $MYSQL_TEST 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
# Select disconnected connection
--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
@@ -1287,6 +1316,7 @@ EOF
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--error 1
--exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql;" | $MYSQL_TEST 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
# Connection name already used
--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
@@ -1297,6 +1327,8 @@ EOF
--error 1
--exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql;" | $MYSQL_TEST 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
+
# connect when "disable_abort_on_error" caused "connection not found"
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--disable_abort_on_error
@@ -1400,7 +1432,11 @@ select "this will be executed";
--exec touch $MYSQLTEST_VARDIR/tmp/zero_length_file.result
--exec echo "echo ok;" > $MYSQLTEST_VARDIR/tmp/query.sql
--error 1
---exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/query.sql -R $MYSQLTEST_VARDIR/tmp/zero_length_file.result 2>&1
+--exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/query.sql -R $MYSQLTEST_VARDIR/tmp/zero_length_file.result > /dev/null 2>&1
+
+remove_file $MYSQLTEST_VARDIR/tmp/zero_length_file.result;
+remove_file $MYSQLTEST_VARDIR/log/zero_length_file.reject;
+
#
# Test that a test file that does not generate any output fails.
#
@@ -1408,6 +1444,8 @@ select "this will be executed";
--error 1
--exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/query.sql 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/query.sql;
+
#
# Test that mysqltest fails when there are no queries executed
# but a result file exists
@@ -1437,6 +1475,7 @@ echo Failing multi statement query;
--exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/bug11731.sql 2>&1
drop table t1;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--error 1
--exec $MYSQL_TEST --record -x $MYSQLTEST_VARDIR/tmp/bug11731.sql -R $MYSQLTEST_VARDIR/tmp/bug11731.out 2>&1
# The .out file should be non existent
@@ -1463,6 +1502,9 @@ drop table t1;
# The .out file should exist
--exec test -s $MYSQLTEST_VARDIR/tmp/bug11731.out
drop table t1;
+remove_file $MYSQLTEST_VARDIR/tmp/bug11731.out;
+remove_file $MYSQLTEST_VARDIR/log/bug11731.log;
+remove_file $MYSQLTEST_VARDIR/tmp/bug11731.sql;
#
# Bug#19890 mysqltest: "query" command is broken
@@ -1545,12 +1587,19 @@ write_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
Content for test_file1
EOF
file_exists $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
+cat_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
remove_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
write_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp END_DELIMITER;
Content for test_file1 contains EOF
END_DELIMITER
file_exists $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
+
+# write to already exisiting file
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--error 1
+--exec echo "write_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;" | $MYSQL_TEST 2>&1
+
remove_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
# ----------------------------------------------------------------------------
@@ -1572,6 +1621,8 @@ append_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
Appended text on nonexisting file
EOF
+remove_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
+
# ----------------------------------------------------------------------------
# test for cat_file
# ----------------------------------------------------------------------------
@@ -1582,6 +1633,7 @@ for cat_file command
of mysqltest
EOF
cat_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
+remove_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
--error 1
--exec echo "cat_file non_existing_file;" | $MYSQL_TEST 2>&1
@@ -1608,19 +1660,48 @@ for diff_file command
of mysqltest
EOF
+--write_file $MYSQLTEST_VARDIR/tmp/diff4.tmp
+Some data
+for diff_file command
+of musqltest
+EOF
+
# Compare equal files
--diff_files $MYSQLTEST_VARDIR/tmp/diff1.tmp $MYSQLTEST_VARDIR/tmp/diff2.tmp
--diff_files $MYSQLTEST_VARDIR/tmp/diff2.tmp $MYSQLTEST_VARDIR/tmp/diff1.tmp
-# Compare files that differ
+# Write the below commands to a intermediary file and execute them with
+# mysqltest in --exec, since the output will vary depending on what "diff"
+# is available it is sent to /dev/null
+--write_file $MYSQLTEST_VARDIR/tmp/diff.test
+# Compare files that differ in size
+--error 2
+--diff_files $MYSQLTEST_VARDIR/tmp/diff1.tmp $MYSQLTEST_VARDIR/tmp/diff3.tmp
+--error 2
+--diff_files $MYSQLTEST_VARDIR/tmp/diff3.tmp $MYSQLTEST_VARDIR/tmp/diff1.tmp
+
+# Compare files that differ only in content
--error 1
---diff_files $MYSQLTEST_VARDIR/tmp/diff3.tmp $MYSQLTEST_VARDIR/tmp/diff2.tmp
+--diff_files $MYSQLTEST_VARDIR/tmp/diff1.tmp $MYSQLTEST_VARDIR/tmp/diff4.tmp
--error 1
---diff_files $MYSQLTEST_VARDIR/tmp/diff1.tmp $MYSQLTEST_VARDIR/tmp/diff3.tmp
+--diff_files $MYSQLTEST_VARDIR/tmp/diff4.tmp $MYSQLTEST_VARDIR/tmp/diff1.tmp
+EOF
+
+# Execute the above diffs, and send their output to /dev/null - only
+# interesting to see that it returns correct error codes
+--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/diff.test > /dev/null 2>&1
+
# Compare equal files, again...
--diff_files $MYSQLTEST_VARDIR/tmp/diff1.tmp $MYSQLTEST_VARDIR/tmp/diff2.tmp
+--remove_file $MYSQLTEST_VARDIR/tmp/diff1.tmp
+--remove_file $MYSQLTEST_VARDIR/tmp/diff2.tmp
+--remove_file $MYSQLTEST_VARDIR/tmp/diff3.tmp
+--remove_file $MYSQLTEST_VARDIR/tmp/diff4.tmp
+--remove_file $MYSQLTEST_VARDIR/tmp/diff.test
+
+
# ----------------------------------------------------------------------------
# test for file_exist
# ----------------------------------------------------------------------------
@@ -1673,6 +1754,7 @@ chmod 0000 $MYSQLTEST_VARDIR/tmp/file1.tmp;
#EOF
chmod 0777 $MYSQLTEST_VARDIR/tmp/file1.tmp;
+remove_file $MYSQLTEST_VARDIR/tmp/file1.tmp;
--write_file $MYSQLTEST_VARDIR/tmp/file1.tmp
test2
EOF
@@ -1740,23 +1822,130 @@ EOF
--exec echo "echo Some output; exit; echo Not this;" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
-# test for query_sorted
+# test for sorted_result
# ----------------------------------------------------------------------------
create table t1( a int, b char(255), c timestamp);
insert into t1 values(1, 'Line 1', '2007-04-05'), (2, "Part 2", '2007-04-05');
insert into t1 values(1, 'Line 1', '2007-04-05'), (2, "Part 3", '2007-04-05');
select * from t1;
-query_sorted select * from t1;
+--sorted_result
+select * from t1;
+# Should not be sorted
+select * from t1;
disable_result_log;
-query_sorted select * from t1;
+sorted_result;
+select * from t1;
enable_result_log;
-query_sorted select '';
-query_sorted select "h";
-query_sorted select "he";
-query_sorted select "hep";
-query_sorted select "hepp";
+--sorted_result
+select '';
+sorted_result;
+select "h";
+--sorted_result
+select "he";
+--sorted_result
+select "hep";
+--sorted_result
+select "hepp";
+
+drop table t1;
+# 1. Assignment of result set sorting
+sorted_result;
+ SELECT 2 as "my_col"
+UNION
+SELECT 1;
+#
+--sorted_result
+SELECT 2 as "my_col" UNION SELECT 1;
+--sorted_result
+SELECT 2 as "my_col"
+UNION
+SELECT 1;
+
+# 2. Ensure that the table header will be not sorted into the result
+--sorted_result
+SELECT '2' as "3"
+UNION
+SELECT '1';
+
+# 3. Ensure that an empty result set does not cause problems
+CREATE TABLE t1( a CHAR);
+--sorted_result
+SELECT * FROM t1;
+DROP TABLE t1;
+
+# 4. Ensure that NULL values within the result set do not cause problems
+SELECT NULL as "my_col1",2 AS "my_col2"
+UNION
+SELECT NULL,1;
+--sorted_result
+SELECT NULL as "my_col1",2 AS "my_col2"
+UNION
+SELECT NULL,1;
+#
+SELECT 2 as "my_col1",NULL AS "my_col2"
+UNION
+SELECT 1,NULL;
+--sorted_result
+SELECT 2 as "my_col1",NULL AS "my_col2"
+UNION
+SELECT 1,NULL;
+
+# 5. "sorted_result" changes nothing when applied to a non query statement.
+sorted_result;
+ SET @a = 17;
+#
+# 6. Show that "sorted_result;" before the "SET @a = 17;" above does not affect
+# the now following query.
+SELECT 2 as "my_col"
+UNION
+SELECT 1;
+
+# 7. Ensure that "sorted_result" in combination with $variables works
+let $my_stmt=SELECT 2 as "my_col"
+UNION
+SELECT 1;
+--sorted_result
+eval $my_stmt;
+
+# 8. Ensure that "sorted_result " does not change the semantics of
+# "--error ...." or the protocol output after such an expected failure
+--sorted_result
+--error 1146
+SELECT '2' as "my_col1",2 as "my_col2"
+UNION
+SELECT '1',1 from t2;
+
+# 9. Ensure that several result formatting options including "sorted_result"
+# - have all an effect
+# - "--sorted_result" does not need to be direct before the statement
+# - Row sorting is applied after modification of the column content
+--sorted_result
+--replace_column 1 #
+SELECT '1' as "my_col1",2 as "my_col2"
+UNION
+SELECT '2',1;
+
+# 10. Ensure that at least 1024 rows within a result set do not cause problems
+#
+CREATE TABLE t1 (f1 INT);
+INSERT INTO t1 SET f1 = 1024;
+INSERT INTO t1 SELECT f1 - 1 FROM t1;
+INSERT INTO t1 SELECT f1 - 2 FROM t1;
+INSERT INTO t1 SELECT f1 - 4 FROM t1;
+INSERT INTO t1 SELECT f1 - 8 FROM t1;
+INSERT INTO t1 SELECT f1 - 16 FROM t1;
+INSERT INTO t1 SELECT f1 - 32 FROM t1;
+INSERT INTO t1 SELECT f1 - 64 FROM t1;
+INSERT INTO t1 SELECT f1 - 128 FROM t1;
+INSERT INTO t1 SELECT f1 - 256 FROM t1;
+INSERT INTO t1 SELECT f1 - 512 FROM t1;
+--disable_result_log
+--sorted_result
+SELECT * FROM t1;
+--enable_result_log
+DROP TABLE t1;
# ----------------------------------------------------------------------------
# Some coverage tests
# ----------------------------------------------------------------------------
@@ -1764,10 +1953,132 @@ query_sorted select "hepp";
--disable_query_log
--exec $MYSQL_TEST --help 2>&1 > /dev/null
--exec $MYSQL_TEST --version 2>&1 > /dev/null
---enable_quary_log
+--enable_query_log
--disable_abort_on_error
--error 1
--exec $MYSQL_TEST a b c 2>&1 > /dev/null
--enable_abort_on_error
+--enable_query_log
+
+# ----------------------------------------------------------------------------
+# test for query_get_value
+# ----------------------------------------------------------------------------
+
+CREATE TABLE t1(
+ a int, b varchar(255), c datetime
+);
+SHOW COLUMNS FROM t1;
+
+#------------ Positive tests ------------
+# 1. constant parameters
+# value is simple string without spaces
+let $value= query_get_value(SHOW COLUMNS FROM t1, Type, 1);
+--echo statement=SHOW COLUMNS FROM t1 row_number=1, column_name="Type", Value=$value
+let $value= query_get_value("SHOW COLUMNS FROM t1", Type, 1);
+--echo statement="SHOW COLUMNS FROM t1" row_number=1, column_name="Type", Value=$value
+#
+# 2. $variables as parameters
+# value IS NULL
+let $my_show= SHOW COLUMNS FROM t1;
+let $column_name= Default;
+let $row_number= 1;
+let $value= query_get_value($my_show, $column_name, $row_number);
+--echo statement=$my_show row_number=$row_number, column_name=$column_name, Value=$value
+#
+# 3. result set of a SELECT (not recommended, because projection and
+# selection could be done much better by pure SELECT functionality)
+# value is string with space in the middle
+let $value= query_get_value(SELECT 'A B' AS "MyColumn", MyColumn, 1);
+--echo value= ->$value<-
+#
+# 4. column name with space
+let $value= query_get_value(SELECT 1 AS "My Column", My Column, 1);
+--echo value= $value
+#
+#------------ Negative tests ------------
+# 5. Incomplete statement including missing parameters
+# 5.1 incomplete statement
+--error 1
+--exec echo "let \$value= query_get_value(SHOW;" | $MYSQL_TEST 2>&1
+# 5.2 missing query
+--error 1
+--exec echo "let \$value= query_get_value;" | $MYSQL_TEST 2>&1
+# 5.3 missing column name
+--error 1
+--exec echo "let \$value= query_get_value(SHOW COLUMNS FROM t1);" | $MYSQL_TEST 2>&1
+# 5.4 missing row number
+--error 1
+--exec echo "let \$value= query_get_value(SHOW COLUMNS FROM t1, Field);" | $MYSQL_TEST 2>&1
+#
+# 6. Somehow "wrong" value of parameters
+# 6.1 row parameter
+# 6.1.1 non sense number 0
+let $value= initialized;
+let $value= query_get_value(SHOW COLUMNS FROM t1, Field, 0);
+--echo value= $value
+# 6.1.2 after the last row
+let $value= initialized;
+let $value= query_get_value(SHOW COLUMNS FROM t1, Field, 10);
+--echo value= $value
+# 6.1.3 invalid row number
+--error 1
+--exec echo "let \$value= query_get_value(SHOW COLUMNS FROM t1, Field, notnumber);" | $MYSQL_TEST 2>&1
+# 6.2 column name parameter, name of not existing column
+--error 1
+--exec echo "let \$value= query_get_value(SHOW COLUMNS FROM t1, column_not_exists, 1);" | $MYSQL_TEST 2>&1
+# 6.3. statement which never gives a result set
+--error 1
+--exec echo "let \$value= query_get_value(SET @A = 1, Field, 1);" | $MYSQL_TEST 2>&1
+# 6.4. statement contains a ","
+# Note: There is no need to improve this, because we need query_get_value
+# for SHOW commands only.
+--error 1
+--exec echo "let \$value= query_get_value(SELECT 1 AS "A", 1 AS "B", 1);" | $MYSQL_TEST 2>&1
+#
+# 7. empty result set
+let $value= initialized;
+let $value= query_get_value(SELECT a FROM t1, a, 1);
+--echo value= $value
+#
+# 9. failing statement
+--error 1
+--exec echo "let \$value= query_get_value(SHOW COLNS FROM t1, Field, 1);" | $MYSQL_TEST 2>&1
+#
+# 10. Artificial example how to process a complete SHOW result set:
+let $show_statement= SHOW COLUMNS FROM t1;
+let $rowno= 1;
+let $run=1;
+let $count= 0;
+--echo
+--echo Field Type Null Key Default Extra
+while ($run)
+{
+ let $Field= query_get_value($show_statement, Field, $rowno);
+ if (`SELECT '$Field' = 'No such row'`)
+ {
+ let $run= 0;
+ }
+ if (`SELECT '$Field' <> 'No such row'`)
+ {
+ let $Type= query_get_value($show_statement, Type, $rowno);
+ let $Null= query_get_value($show_statement, Null, $rowno);
+ if (`SELECT '$Null' = 'YES'`)
+ {
+ inc $count;
+ }
+ let $Key= query_get_value($show_statement, Key, $rowno);
+ let $Default= query_get_value($show_statement, Default, $rowno);
+ let $Extra= query_get_value($show_statement, Extra, $rowno);
+ --echo $Field $Type $Null ->$Key<- $Default $Extra
+ inc $rowno;
+ }
+}
+--echo
+--echo Number of columns with Default NULL: $count
+--echo
+eval $show_statement;
+
+drop table t1;
--echo End of tests
+
diff --git a/mysql-test/t/ndb_alter_table.test b/mysql-test/t/ndb_alter_table.test
deleted file mode 100644
index a7b52d54710..00000000000
--- a/mysql-test/t/ndb_alter_table.test
+++ /dev/null
@@ -1,439 +0,0 @@
--- source include/have_ndb.inc
--- source include/have_multi_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1, t2;
-drop database if exists mysqltest;
---enable_warnings
-
-connect (con1,localhost,root,,test);
-connect (con2,localhost,root,,test);
-
-connection con2;
--- sleep 2
-connection con1;
-
-#
-# Basic test to show that the ALTER TABLE
-# is working
-#
-CREATE TABLE t1 (
- a INT NOT NULL,
- b INT NOT NULL
-) ENGINE=ndbcluster;
-
-INSERT INTO t1 VALUES (9410,9412);
-
-ALTER TABLE t1 ADD COLUMN c int not null;
-SELECT * FROM t1;
-
-DROP TABLE t1;
-
-#
-# Verfify changing table names between databases
-#
-CREATE DATABASE mysqltest;
-USE mysqltest;
-CREATE TABLE t1 (
- a INT NOT NULL,
- b INT NOT NULL
-) ENGINE=ndbcluster;
-RENAME TABLE t1 TO test.t1;
-SHOW TABLES;
-DROP DATABASE mysqltest;
-USE test;
-SHOW TABLES;
-DROP TABLE t1;
-
-#
-# More advanced test
-#
-create table t1 (
-col1 int not null auto_increment primary key,
-col2 varchar(30) not null,
-col3 varchar (20) not null,
-col4 varchar(4) not null,
-col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null,
-col6 int not null, to_be_deleted int) ENGINE=ndbcluster;
---replace_column 6 # 7 # 8 # 10 # 12 # 13 # 14 # 18 #
-show table status;
-SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
-insert into t1 values
-(0,4,3,5,"PENDING",1,7),(NULL,4,3,5,"PENDING",1,7),(31,4,3,5,"PENDING",1,7), (7,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7), (100,4,3,5,"PENDING",1,7), (99,4,3,5,"PENDING",1,7), (8,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7);
---replace_column 6 # 7 # 8 # 10 # 12 # 13 # 14 # 18 #
-show table status;
-select * from t1 order by col1;
-alter table t1
-add column col4_5 varchar(20) not null after col4,
-add column col7 varchar(30) not null after col5,
-add column col8 datetime not null, drop column to_be_deleted,
-change column col2 fourth varchar(30) not null after col3,
-modify column col6 int not null first;
---replace_column 6 # 7 # 8 # 10 # 12 # 13 # 14 # 18 #
-show table status;
-select * from t1 order by col1;
-insert into t1 values (2, NULL,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00');
---replace_column 6 # 7 # 8 # 10 # 12 # 13 # 14 # 18 #
-show table status;
-select * from t1 order by col1;
-delete from t1;
-insert into t1 values (0,0,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00');
-SET SQL_MODE='';
-insert into t1 values (1,0,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00');
-select * from t1 order by col1;
-alter table t1 drop column col4_5;
-insert into t1 values (2,0,4,3,5,"PENDING","EXTRA",'2004-01-01 00:00:00');
-select * from t1 order by col1;
-drop table t1;
-
-
-#
-# Check that invalidating dictionary cache works
-#
-
-CREATE TABLE t1 (
- a INT NOT NULL,
- b INT NOT NULL
-) ENGINE=ndbcluster;
-
-INSERT INTO t1 VALUES (9410,9412);
-
-ALTER TABLE t1 ADD COLUMN c int not null;
-select * from t1 order by a;
-
-connection con2;
-select * from t1 order by a;
-alter table t1 drop c;
-
-connection con1;
-select * from t1 order by a;
-drop table t1;
-
-connection con2;
---error 1146
-select * from t1 order by a;
-
-CREATE TABLE t1 (
- a INT NOT NULL PRIMARY KEY,
- b INT NOT NULL
-) ENGINE=ndbcluster;
-
-INSERT INTO t1 VALUES (0,1),(17,18);
-select * from t1 order by a;
-SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
-alter table t1 modify column a int not null auto_increment;
-SET SQL_MODE='';
-select * from t1 order by a;
-INSERT INTO t1 VALUES (0,19),(20,21);
-select * from t1 order by a;
-drop table t1;
-
-CREATE TABLE t1 (
- a INT NOT NULL PRIMARY KEY,
- b INT NOT NULL
-) ENGINE=ndbcluster;
-
-INSERT INTO t1 VALUES (0,1),(17,18);
-select * from t1 order by a;
-alter table t1 add c int not null unique auto_increment;
-select c from t1 order by c;
-INSERT INTO t1 VALUES (1,2,0),(18,19,4),(20,21,0);
-select c from t1 order by c;
-drop table t1;
-
-## Test moved to ndb_alter_table_row|stmt respectively as behaviour differs
-#create table t1 ( a int primary key, b varchar(10), c varchar(10), index (b) )
-#engine=ndb;
-#insert into t1 values (1,'one','one'), (2,'two','two'), (3,'three','three');
-#create index c on t1(c);
-#connection server2;
-#select * from t1 where c = 'two';
-#connection server1;
-#alter table t1 drop index c;
-#connection server2;
-#select * from t1 where c = 'two';
-#connection server1;
-#drop table t1;
-
-#--disable_warnings
-#DROP TABLE IF EXISTS t2;
-#--enable_warnings
-
-#create table t2 (a int NOT NULL PRIMARY KEY) engine=myisam;
-#let $1=12001;
-#disable_query_log;
-#while ($1)
-#{
-# eval insert into t2 values($1);
-# dec $1;
-#}
-#enable_query_log;
-#alter table t2 engine=ndbcluster;
-#alter table t2 add c int;
-#--error 1297
-#delete from t2;
-#to make sure we do a full table scan
-#select count(*) from t2 where a+0 > 0;
-#truncate table t2;
-#select count(*) from t2;
-#drop table t2;
-
-## Test moved to ndb_alter_table_row|stmt respectively as behaviour differs
-#connection server1;
-#create table t3 (a int primary key) engine=ndbcluster;
-
-#connection server2;
-#begin;
-#insert into t3 values (1);
-
-#connection server1;
-#alter table t3 rename t4;
-
-#connection server2;
-## with rbr the below will not work as the "alter" event
-## explicitly invalidates the dictionary cache.
-### This should work as transaction is ongoing...
-##delete from t3;
-##insert into t3 values (1);
-#commit;
-
-## This should fail as its a new transaction
-#--error 1146
-#select * from t3;
-#select * from t4;
-#drop table t4;
-#show tables;
-#connection server1;
-
-create table t1 (
-ai bigint auto_increment,
-c001 int(11) not null,
-c002 int(11) not null,
-c003 int(11) not null,
-c004 int(11) not null,
-c005 int(11) not null,
-c006 int(11) not null,
-c007 int(11) not null,
-c008 int(11) not null,
-c009 int(11) not null,
-c010 int(11) not null,
-c011 int(11) not null,
-c012 int(11) not null,
-c013 int(11) not null,
-c014 int(11) not null,
-c015 int(11) not null,
-c016 int(11) not null,
-c017 int(11) not null,
-c018 int(11) not null,
-c019 int(11) not null,
-c020 int(11) not null,
-c021 int(11) not null,
-c022 int(11) not null,
-c023 int(11) not null,
-c024 int(11) not null,
-c025 int(11) not null,
-c026 int(11) not null,
-c027 int(11) not null,
-c028 int(11) not null,
-c029 int(11) not null,
-c030 int(11) not null,
-c031 int(11) not null,
-c032 int(11) not null,
-c033 int(11) not null,
-c034 int(11) not null,
-c035 int(11) not null,
-c036 int(11) not null,
-c037 int(11) not null,
-c038 int(11) not null,
-c039 int(11) not null,
-c040 int(11) not null,
-c041 int(11) not null,
-c042 int(11) not null,
-c043 int(11) not null,
-c044 int(11) not null,
-c045 int(11) not null,
-c046 int(11) not null,
-c047 int(11) not null,
-c048 int(11) not null,
-c049 int(11) not null,
-c050 int(11) not null,
-c051 int(11) not null,
-c052 int(11) not null,
-c053 int(11) not null,
-c054 int(11) not null,
-c055 int(11) not null,
-c056 int(11) not null,
-c057 int(11) not null,
-c058 int(11) not null,
-c059 int(11) not null,
-c060 int(11) not null,
-c061 int(11) not null,
-c062 int(11) not null,
-c063 int(11) not null,
-c064 int(11) not null,
-c065 int(11) not null,
-c066 int(11) not null,
-c067 int(11) not null,
-c068 int(11) not null,
-c069 int(11) not null,
-c070 int(11) not null,
-c071 int(11) not null,
-c072 int(11) not null,
-c073 int(11) not null,
-c074 int(11) not null,
-c075 int(11) not null,
-c076 int(11) not null,
-c077 int(11) not null,
-c078 int(11) not null,
-c079 int(11) not null,
-c080 int(11) not null,
-c081 int(11) not null,
-c082 int(11) not null,
-c083 int(11) not null,
-c084 int(11) not null,
-c085 int(11) not null,
-c086 int(11) not null,
-c087 int(11) not null,
-c088 int(11) not null,
-c089 int(11) not null,
-c090 int(11) not null,
-c091 int(11) not null,
-c092 int(11) not null,
-c093 int(11) not null,
-c094 int(11) not null,
-c095 int(11) not null,
-c096 int(11) not null,
-c097 int(11) not null,
-c098 int(11) not null,
-c099 int(11) not null,
-c100 int(11) not null,
-c101 int(11) not null,
-c102 int(11) not null,
-c103 int(11) not null,
-c104 int(11) not null,
-c105 int(11) not null,
-c106 int(11) not null,
-c107 int(11) not null,
-c108 int(11) not null,
-c109 int(11) not null,
-primary key (ai),
-unique key tx1 (c002, c003, c004, c005)) engine=ndb;
-
-create index tx2
-on t1 (c010, c011, c012, c013);
-
-drop table t1;
-
-# End of 4.1 tests
-
-# On-line alter table
-
-
-CREATE TABLE t1 (
- auto int(5) unsigned NOT NULL auto_increment,
- string char(10),
- vstring varchar(10),
- bin binary(2),
- vbin varbinary(7),
- tiny tinyint(4) DEFAULT '0' NOT NULL ,
- short smallint(6) DEFAULT '1' NOT NULL ,
- medium mediumint(8) DEFAULT '0' NOT NULL,
- long_int int(11) DEFAULT '0' NOT NULL,
- longlong bigint(13) DEFAULT '0' NOT NULL,
- real_float float(13,1) DEFAULT 0.0 NOT NULL,
- real_double double(16,4),
- real_decimal decimal(16,4),
- utiny tinyint(3) unsigned DEFAULT '0' NOT NULL,
- ushort smallint(5) unsigned zerofill DEFAULT '00000' NOT NULL,
- umedium mediumint(8) unsigned DEFAULT '0' NOT NULL,
- ulong int(11) unsigned DEFAULT '0' NOT NULL,
- ulonglong bigint(13) unsigned DEFAULT '0' NOT NULL,
- bits bit(3),
- options enum('zero','one','two','three','four') not null,
- flags set('zero','one','two','three','four') not null,
- date_field date,
- year_field year,
- time_field time,
- date_time datetime,
- time_stamp timestamp,
- PRIMARY KEY (auto)
-) engine=ndb;
-
-CREATE TEMPORARY TABLE ndb_show_tables (id INT, type VARCHAR(20), state VARCHAR(20), logging VARCHAR(20), _database VARCHAR(255), _schema VARCHAR(20), name VARCHAR(255));
-
---disable_warnings
---exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
-LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
---enable_warnings
-
-# Ndb doesn't support renaming attributes on-line
-set @t1_id = (select id from ndb_show_tables where name like '%t1%');
-truncate ndb_show_tables;
-
-alter table t1 change tiny new_tiny tinyint(4) DEFAULT '0' NOT NULL;
---disable_warnings
---exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
-LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
---enable_warnings
-
-select 'no_copy' from ndb_show_tables where id = @t1_id and name like '%t1%';
-
-set @t1_id = (select id from ndb_show_tables where name like '%t1%');
-truncate ndb_show_tables;
-
-create index i1 on t1(medium);
-alter table t1 add index i2(new_tiny);
-drop index i1 on t1;
-
---disable_warnings
---exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
-LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
---exec rm $MYSQLTEST_VARDIR/master-data/test/tmp.dat || true
---enable_warnings
-
-select 'no_copy' from ndb_show_tables where id = @t1_id and name like '%t1%';
-
-DROP TABLE t1, ndb_show_tables;
-
-# simple test that auto incr is not lost at rename or alter
-create table t1 (a int primary key auto_increment, b int) engine=ndb;
-insert into t1 (b) values (101),(102),(103);
-select * from t1 where a = 3;
-alter table t1 rename t2;
-insert into t2 (b) values (201),(202),(203);
-select * from t2 where a = 6;
-alter table t2 add c int;
-insert into t2 (b) values (301),(302),(303);
-select * from t2 where a = 9;
-alter table t2 rename t1;
-insert into t1 (b) values (401),(402),(403);
-select * from t1 where a = 12;
-drop table t1;
-
-# some other ALTER combinations
-# add/drop pk
-create table t1 (a int not null, b varchar(10)) engine=ndb;
-show index from t1;
-alter table t1 add primary key (a);
-show index from t1;
-alter table t1 drop primary key;
-show index from t1;
-drop table t1;
-
-# alter .. alter
-create table t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb;
-show create table t1;
-alter table t1 alter b set default 1;
-show create table t1;
-drop table t1;
-
-# alter .. order by
-create table t1 (a int not null, b int not null) engine=ndb;
-insert into t1 values (1, 300), (2, 200), (3, 100);
-select * from t1 order by a;
-alter table t1 order by b;
-select * from t1 order by b;
-drop table t1;
-
---echo End of 5.1 tests
diff --git a/mysql-test/t/ndb_alter_table2.test b/mysql-test/t/ndb_alter_table2.test
deleted file mode 100644
index afe6e44f698..00000000000
--- a/mysql-test/t/ndb_alter_table2.test
+++ /dev/null
@@ -1,85 +0,0 @@
--- source include/have_ndb.inc
--- source include/have_multi_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-connect (con1,localhost,root,,test);
-connect (con2,localhost,root,,test);
-connect (con3,localhost,root,,test);
-connect (con4,localhost,root,,test);
-connect (con5,localhost,root,,test);
-connect (con6,localhost,root,,test);
-
-CREATE TABLE t1 (
- a INT NOT NULL PRIMARY KEY,
- b INT NOT NULL
-) ENGINE=ndbcluster;
-
-connection con1;
-BEGIN;
-INSERT INTO t1 VALUES (9410,9412);
-connection con2;
-BEGIN;
---send
-INSERT INTO t1 VALUES (9411,9412);
-connection con3;
-BEGIN;
---send
-INSERT INTO t1 VALUES (9412,9412);
-connection con4;
-BEGIN;
---send
-INSERT INTO t1 VALUES (9413,9412);
-connection con5;
-BEGIN;
---send
-INSERT INTO t1 VALUES (9414,9412);
-connection con6;
-BEGIN;
---send
-INSERT INTO t1 VALUES (9415,9412);
-connection con1;
-sleep 1;
-
-ROLLBACK;
-connection con2;
-reap;
-ROLLBACK;
-connection con3;
-reap;
-ROLLBACK;
-connection con4;
-reap;
-ROLLBACK;
-connection con5;
-reap;
-ROLLBACK;
-connection con6;
-reap;
-ROLLBACK;
-
-connection server2;
-
-drop table t1;
-CREATE TABLE t1 (
- a INT NOT NULL PRIMARY KEY,
- b INT NOT NULL,
- c INT NOT NULL
-) ENGINE=ndbcluster;
-
-connection server1;
-
---disable_result_log
---error 0,1412
-select * from t1;
---enable_result_log
-select * from t1;
-select * from t1;
-select * from t1;
-select * from t1;
-select * from t1;
-
-drop table t1;
diff --git a/mysql-test/t/ndb_alter_table3.test b/mysql-test/t/ndb_alter_table3.test
deleted file mode 100644
index a5fe613adcf..00000000000
--- a/mysql-test/t/ndb_alter_table3.test
+++ /dev/null
@@ -1,49 +0,0 @@
--- source include/have_ndb.inc
--- source include/have_multi_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-connection server1;
-create table t1 ( a int primary key, b varchar(10), c varchar(10), index (b) )
-engine=ndb;
-insert into t1 values (1,'one','one'), (2,'two','two'), (3,'three','three');
-create index c on t1(c);
-connection server2;
-show indexes from t1;
-select * from t1 where c = 'two';
-connection server1;
-alter table t1 drop index c;
-connection server2;
-show indexes from t1;
-select * from t1 where c = 'two';
-connection server1;
-drop table t1;
-
-connection server1;
-create table t3 (a int primary key) engine=ndbcluster;
-
-connection server2;
-begin;
-insert into t3 values (1);
-
-connection server1;
-alter table t3 rename t4;
-
-connection server2;
-# with rbr the below will not work as the "alter" event
-# explicitly invalidates the dictionary cache.
-## This should work as transaction is ongoing...
-#delete from t3;
-#insert into t3 values (1);
-commit;
-
-# This should fail as its a new transaction
---error 1146
-select * from t3;
-select * from t4;
-drop table t4;
-show tables;
-connection server1;
diff --git a/mysql-test/t/ndb_autodiscover3.test b/mysql-test/t/ndb_autodiscover3.test
deleted file mode 100644
index d0b9d0983e9..00000000000
--- a/mysql-test/t/ndb_autodiscover3.test
+++ /dev/null
@@ -1,86 +0,0 @@
--- source include/have_ndb.inc
--- source include/have_multi_ndb.inc
--- source include/ndb_default_cluster.inc
--- source include/not_embedded.inc
-
-# see bug#21563
--- source include/have_binlog_format_row.inc
-
---disable_warnings
-drop table if exists t1, t2;
---enable_warnings
-
-# Workaround for Bug#27644
-# ndb: connecting api node/mysqld may "steal" node_id from running mysqld
-# - let ndb_waiter use a fixed node id so "steal" cannot happen
---let connect_str = "nodeid=6;$NDB_CONNECTSTRING"
-
-#
-# Transaction ongoing while cluster is restarted
-#
---connection server1
-create table t1 (a int key) engine=ndbcluster;
-
-begin;
-insert into t1 values (1);
-
---exec $NDB_MGM --no-defaults -e "all restart" >> $NDB_TOOLS_OUTPUT
---exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults -c $connect_str >> $NDB_TOOLS_OUTPUT
-# Wait for mysqld to reconnect and exit from readonly mode
-# Should preferrably be a "while (!"select ndb_readonly")" loop
-sleep 2;
---error 1297
-insert into t1 values (2);
---error 1296
-commit;
-
-drop table t1;
-
-#
-# Stale cache after restart -i
-#
---connection server1
-create table t2 (a int, b int, primary key(a,b)) engine=ndbcluster;
-insert into t2 values (1,1),(2,1),(3,1),(4,1),(5,1),(6,1),(7,1),(8,1),(9,1),(10,1);
-select * from t2 order by a limit 3;
-
---exec $NDB_MGM --no-defaults -e "all restart -i" >> $NDB_TOOLS_OUTPUT
---exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults -c $connect_str >> $NDB_TOOLS_OUTPUT
-# to ensure mysqld has connected again, and recreated system tables
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -r 30 -d cluster ndb_apply_status >> $NDB_TOOLS_OUTPUT
-sleep 2;
---connection server2
---error ER_NO_SUCH_TABLE
-select * from t2;
-show tables like 't2';
-reset master;
-create table t2 (a int key) engine=ndbcluster;
-insert into t2 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
-select * from t2 order by a limit 3;
-
-# server 1 should have a stale cache, and in this case wrong frm, transaction must be retried
---connection server1
-select * from t2 order by a limit 3;
-reset master;
-
---exec $NDB_MGM --no-defaults -e "all restart -i" >> $NDB_TOOLS_OUTPUT
---exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults -c $connect_str >> $NDB_TOOLS_OUTPUT
-# to ensure mysqld has connected again, and recreated system tables
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -r 30 -d cluster ndb_apply_status >> $NDB_TOOLS_OUTPUT
-sleep 2;
---connection server1
---error ER_NO_SUCH_TABLE
-select * from t2;
-show tables like 't2';
-reset master;
-create table t2 (a int key) engine=ndbcluster;
-insert into t2 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
-select * from t2 order by a limit 3;
-
-# server 2 should have a stale cache, but with right frm, transaction need not be retried
---connection server2
-select * from t2 order by a limit 3;
-reset master;
-
-drop table t2;
-# End of 4.1 tests
diff --git a/mysql-test/t/ndb_basic.test b/mysql-test/t/ndb_basic.test
deleted file mode 100644
index a20cfc500cf..00000000000
--- a/mysql-test/t/ndb_basic.test
+++ /dev/null
@@ -1,820 +0,0 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7;
-drop database if exists mysqltest;
---enable_warnings
-
-## workaround for bug#16445
-## remove to reproduce bug and run tests from ndb start
-## and with ndb_autodiscover disabled. Fails on Linux 50 % of the times
-#CREATE TABLE t1 (
-# pk1 INT NOT NULL PRIMARY KEY,
-# attr1 INT NOT NULL,
-# attr2 INT,
-# attr3 VARCHAR(10)
-#) ENGINE=ndbcluster;
-#drop table t1;
-
-#
-# Basic test to show that the NDB
-# table handler is working
-#
-
-#
-# Create a normal table with primary key
-#
-CREATE TABLE t1 (
- pk1 INT NOT NULL PRIMARY KEY,
- attr1 INT NOT NULL,
- attr2 INT,
- attr3 VARCHAR(10)
-) ENGINE=ndbcluster;
-
-SHOW INDEX FROM t1;
-INSERT INTO t1 VALUES (9410,9412, NULL, '9412'), (9411,9413, 17, '9413');
-SHOW INDEX FROM t1;
-SELECT pk1 FROM t1 ORDER BY pk1;
-SELECT * FROM t1 ORDER BY pk1;
-SELECT t1.* FROM t1 ORDER BY pk1;
-
-# Update on record by primary key
-UPDATE t1 SET attr1=1 WHERE pk1=9410;
-SELECT * FROM t1 ORDER BY pk1;
-
-# Update primary key
-UPDATE t1 SET pk1=2 WHERE attr1=1;
-SELECT * FROM t1 ORDER BY pk1;
-UPDATE t1 SET pk1=pk1 + 1;
-SELECT * FROM t1 ORDER BY pk1;
-UPDATE t1 SET pk1=4 WHERE pk1 = 3;
-SELECT * FROM t1 ORDER BY pk1;
-
-# Delete the record
-DELETE FROM t1;
-SELECT * FROM t1;
-
-# Insert more records and update them all at once
-INSERT INTO t1 VALUES (9410,9412, NULL, '9412'), (9408, 8765, NULL, '8765'),
-(7,8, NULL, NULL), (8,9, NULL, NULL), (9,10, NULL, NULL), (10,11, NULL, NULL), (11,12, NULL, NULL), (12,13, NULL, NULL), (13,14, NULL, NULL);
-UPDATE t1 SET attr1 = 9999;
-SELECT * FROM t1 ORDER BY pk1;
-
-UPDATE t1 SET attr1 = 9998 WHERE pk1 < 1000;
-SELECT * FROM t1 ORDER BY pk1;
-
-UPDATE t1 SET attr1 = 9997 WHERE attr1 = 9999;
-SELECT * FROM t1 ORDER BY pk1;
-
-# Delete one record by specifying pk
-DELETE FROM t1 WHERE pk1 = 9410;
-SELECT * FROM t1 ORDER BY pk1;
-
-# Delete all from table
-DELETE FROM t1;
-SELECT * FROM t1;
-
-# Insert three records with attr1=4 and two with attr1=5
-# Delete all with attr1=4
-INSERT INTO t1 values (1, 4, NULL, NULL), (2, 4, NULL, NULL), (3, 5, NULL, NULL), (4, 4, NULL, NULL), (5, 5, NULL, NULL);
-DELETE FROM t1 WHERE attr1=4;
-SELECT * FROM t1 order by pk1;
-DELETE FROM t1;
-
-# Insert two records and delete one
-INSERT INTO t1 VALUES (9410,9412, NULL, NULL), (9411, 9413, NULL, NULL);
-DELETE FROM t1 WHERE pk1 = 9410;
-SELECT * FROM t1;
-DROP TABLE t1;
-
-#
-# Create table without primary key
-# a hidden primary key column is created by handler
-#
-CREATE TABLE t1 (id INT, id2 int) engine=ndbcluster;
-INSERT INTO t1 values(3456, 7890);
-SELECT * FROM t1;
-UPDATE t1 SET id=2 WHERE id2=12;
-SELECT * FROM t1;
-UPDATE t1 SET id=1234 WHERE id2=7890;
-SELECT * FROM t1;
-DELETE FROM t1;
-
-INSERT INTO t1 values(3456, 7890), (3456, 7890), (3456, 7890), (3454, 7890);
-SELECT * FROM t1 ORDER BY id;
-DELETE FROM t1 WHERE id = 3456;
-SELECT * FROM t1 ORDER BY id;
-
-DROP TABLE t1;
-
-# test create with the keyword "engine=NDBCLUSTER"
-CREATE TABLE t1 (
- pk1 INT NOT NULL PRIMARY KEY,
- attr1 INT NOT NULL
-) ENGINE=NDBCLUSTER;
-
-INSERT INTO t1 values(1, 9999);
-
-DROP TABLE t1;
-
-# test create with the keyword "engine=NDB"
-CREATE TABLE t1 (
- pk1 INT NOT NULL PRIMARY KEY,
- attr1 INT NOT NULL
-) ENGINE=NDB;
-
-INSERT INTO t1 values(1, 9999);
-
-DROP TABLE t1;
-
-
-#
-# A more extensive test with a lot more records
-#
-
-CREATE TABLE t2 (
- a bigint unsigned NOT NULL PRIMARY KEY,
- b int unsigned not null,
- c int unsigned
-) engine=ndbcluster;
-
-CREATE TABLE t3 (
- a bigint unsigned NOT NULL,
- b bigint unsigned not null,
- c bigint unsigned,
- PRIMARY KEY(a)
-) engine=ndbcluster;
-
-CREATE TABLE t4 (
- a bigint unsigned NOT NULL,
- b bigint unsigned not null,
- c bigint unsigned NOT NULL,
- d int unsigned,
- PRIMARY KEY(a, b, c)
-) engine=ndbcluster;
-
-
-#
-# insert more records into tables
-#
-let $1=1000;
-disable_query_log;
-while ($1)
-{
- eval insert into t2 values($1, $1+9, 5);
- eval insert into t3 values($1, $1+9, 5);
- eval insert into t4 values($1, $1+9, 5, $1+26000);
- dec $1;
-}
-enable_query_log;
-
-
-#
-# delete every other record in the tables
-#
-let $1=1000;
-disable_query_log;
-while ($1)
-{
- eval delete from t2 where a=$1;
- eval delete from t3 where a=$1;
- eval delete from t4 where a=$1 and b=$1+9 and c=5;
- dec $1;
- dec $1;
-}
-enable_query_log;
-
-
-select * from t2 where a = 7 order by b;
-select * from t2 where a = 7 order by a;
-select * from t2 where a = 7 order by 2;
-select * from t2 where a = 7 order by c;
-
-select * from t2 where a = 7 and b = 16 order by b;
-select * from t2 where a = 7 and b = 16 order by a;
-select * from t2 where a = 7 and b = 17 order by a;
-select * from t2 where a = 7 and b != 16 order by b;
-
-select * from t2 where a = 7 and b = 16 and c = 5 order by b;
-select * from t2 where a = 7 and b = 16 and c = 5 order by a;
-select * from t2 where a = 7 and b = 16 and c = 6 order by a;
-select * from t2 where a = 7 and b != 16 and c = 5 order by b;
-
-select * from t3 where a = 7 order by b;
-select * from t3 where a = 7 order by a;
-select * from t3 where a = 7 order by 2;
-select * from t3 where a = 7 order by c;
-
-select * from t3 where a = 7 and b = 16 order by b;
-select * from t3 where a = 7 and b = 16 order by a;
-select * from t3 where a = 7 and b = 17 order by a;
-select * from t3 where a = 7 and b != 16 order by b;
-
-select * from t4 where a = 7 order by b;
-select * from t4 where a = 7 order by a;
-select * from t4 where a = 7 order by 2;
-select * from t4 where a = 7 order by c;
-
-select * from t4 where a = 7 and b = 16 order by b;
-select * from t4 where a = 7 and b = 16 order by a;
-select * from t4 where a = 7 and b = 17 order by a;
-select * from t4 where a = 7 and b != 16 order by b;
-
-#
-# update records
-#
-let $1=1000;
-disable_query_log;
-while ($1)
-{
- eval update t2 set c=$1 where a=$1;
- eval update t3 set c=7 where a=$1 and b=$1+9 and c=5;
- eval update t4 set d=$1+21987 where a=$1 and b=$1+9 and c=5;
- dec $1;
- dec $1;
-}
-enable_query_log;
-
-delete from t2 where a > 5;
-select x1.a, x1.b from t2 x1, t2 x2 where x1.b = x2.b order by x1.a;
-select a, b FROM t2 outer_table where
-a = (select a from t2 where b = outer_table.b ) order by a;
-
-
-delete from t2;
-delete from t3;
-delete from t4;
-
-drop table t2;
-drop table t3;
-drop table t4;
-
-#
-# Test delete and update from table with 3 keys
-#
-
-CREATE TABLE t5 (
- a bigint unsigned NOT NULL,
- b bigint unsigned not null,
- c bigint unsigned NOT NULL,
- d int unsigned,
- PRIMARY KEY(a, b, c)
-) engine=ndbcluster;
-
-insert into t5 values(10, 19, 5, 26010);
-
-delete from t5 where a=10 and b=19 and c=5;
-
-select * from t5;
-
-insert into t5 values(10, 19, 5, 26010);
-
-update t5 set d=21997 where a=10 and b=19 and c=5;
-
-select * from t5;
-
-delete from t5;
-
-drop table t5;
-
-#
-# Test using table with a char(255) column first in table
-#
-
-CREATE TABLE t6 (
- adress char(255),
- a int NOT NULL PRIMARY KEY,
- b int
-) engine = NDB;
-
-insert into t6 values
- ("Nice road 3456", 1, 23),
- ("Street Road 78", 3, 92),
- ("Road street 89C", 5, 71),
- (NULL, 7, NULL);
-select * from t6 order by a;
-select a, b from t6 order by a;
-
-update t6 set adress="End of road 09" where a=3;
-update t6 set b=181, adress="Street 76" where a=7;
-select * from t6 order by a;
-select * from t6 where a=1;
-delete from t6 where a=1;
-select * from t6 order by a;
-delete from t6 where b=71;
-select * from t6 order by a;
-
-drop table t6;
-
-#
-# Test using table with a char(255) column first in table and a
-# primary key consisting of two columns
-#
-
-CREATE TABLE t7 (
- adress char(255),
- a int NOT NULL,
- b int,
- c int NOT NULL,
- PRIMARY KEY(a, c)
-) engine = NDB;
-
-insert into t7 values
- ("Highway 3456", 1, 23, 2),
- ("Street Road 78", 3, 92, 3),
- ("Main street 89C", 5, 71, 4),
- (NULL, 8, NULL, 12);
-select * from t7 order by a;
-select a, b from t7 order by a;
-
-update t7 set adress="End of road 09" where a=3;
-update t7 set adress="Gatuvägen 90C" where a=5 and c=4;
-update t7 set adress="No adress" where adress is NULL;
-select * from t7 order by a;
-select * from t7 where a=1 and c=2;
-delete from t7 where a=1;
-delete from t7 where a=3 and c=3;
-delete from t7 where a=5 and c=4;
-select * from t7;
-delete from t7 where b=23;
-select * from t7;
-
-drop table t7;
-
-#
-# Test multiple databases in one statement
-#
-
-CREATE TABLE t1 (
- pk1 INT NOT NULL PRIMARY KEY,
- attr1 INT NOT NULL,
- attr2 INT,
- attr3 VARCHAR(10)
-) ENGINE=ndbcluster;
-
-INSERT INTO t1 VALUES (9410,9412, NULL, '9412'), (9411,9413, 17, '9413');
-
-create database mysqltest;
-use mysqltest;
-
-CREATE TABLE t2 (
- a bigint unsigned NOT NULL PRIMARY KEY,
- b int unsigned not null,
- c int unsigned
-) engine=ndbcluster;
-
-insert into t2 select pk1,attr1,attr2 from test.t1;
-select * from t2 order by a;
-select b from test.t1, t2 where c = test.t1.attr2;
-select b,test.t1.attr1 from test.t1, t2 where test.t1.pk1 < a;
-
-drop table test.t1, t2;
-drop database mysqltest;
-
-#
-# BUG#6031 - DROP DATABASE doesn't drop database on first try
-#
-
---disable_warnings
-drop database if exists ndbtest1;
---enable_warnings
-
-create database ndbtest1;
-use ndbtest1;
-create table t1(id int) engine=ndbcluster;
-drop database ndbtest1;
---error 1008
-drop database ndbtest1;
-
-#
-# test support of char(0)
-#
-
-use test;
-create table t1 (a int primary key, b char(0));
-insert into t1 values (1,"");
-insert into t1 values (2,NULL);
-select * from t1 order by a;
-select * from t1 order by b;
-select * from t1 where b IS NULL;
-select * from t1 where b IS NOT NULL;
-drop table t1;
-
-#
-# test the limit of no of attributes in one table
-#
-# also tests bug#17179, more than 31 attributes in
-# a partitioned table
-#
-create table t1 (
-c1 int,
-c2 int,
-c3 int,
-c4 int,
-c5 int,
-c6 int,
-c7 int,
-c8 int,
-c9 int,
-c10 int,
-c11 int,
-c12 int,
-c13 int,
-c14 int,
-c15 int,
-c16 int,
-c17 int,
-c18 int,
-c19 int,
-c20 int,
-c21 int,
-c22 int,
-c23 int,
-c24 int,
-c25 int,
-c26 int,
-c27 int,
-c28 int,
-c29 int,
-c30 int,
-c31 int,
-c32 int,
-c33 int,
-c34 int,
-c35 int,
-c36 int,
-c37 int,
-c38 int,
-c39 int,
-c40 int,
-c41 int,
-c42 int,
-c43 int,
-c44 int,
-c45 int,
-c46 int,
-c47 int,
-c48 int,
-c49 int,
-c50 int,
-c51 int,
-c52 int,
-c53 int,
-c54 int,
-c55 int,
-c56 int,
-c57 int,
-c58 int,
-c59 int,
-c60 int,
-c61 int,
-c62 int,
-c63 int,
-c64 int,
-c65 int,
-c66 int,
-c67 int,
-c68 int,
-c69 int,
-c70 int,
-c71 int,
-c72 int,
-c73 int,
-c74 int,
-c75 int,
-c76 int,
-c77 int,
-c78 int,
-c79 int,
-c80 int,
-c81 int,
-c82 int,
-c83 int,
-c84 int,
-c85 int,
-c86 int,
-c87 int,
-c88 int,
-c89 int,
-c90 int,
-c91 int,
-c92 int,
-c93 int,
-c94 int,
-c95 int,
-c96 int,
-c97 int,
-c98 int,
-c99 int,
-c100 int,
-c101 int,
-c102 int,
-c103 int,
-c104 int,
-c105 int,
-c106 int,
-c107 int,
-c108 int,
-c109 int,
-c110 int,
-c111 int,
-c112 int,
-c113 int,
-c114 int,
-c115 int,
-c116 int,
-c117 int,
-c118 int,
-c119 int,
-c120 int,
-c121 int,
-c122 int,
-c123 int,
-c124 int,
-c125 int,
-c126 int,
-c127 int,
-c128 int,
-primary key using hash(c1)) engine=ndb partition by key(c1);
-drop table t1;
-
-#
-# test max size of attribute name and truncation
-#
-
-create table t1 (
-a1234567890123456789012345678901234567890 int primary key,
-a12345678901234567890123456789a1234567890 int,
-index(a12345678901234567890123456789a1234567890)
-) engine=ndb;
-show tables;
-insert into t1 values (1,1),(2,1),(3,1),(4,1),(5,2),(6,1),(7,1);
---replace_column 9 #
-explain select * from t1 where a12345678901234567890123456789a1234567890=2;
-select * from t1 where a12345678901234567890123456789a1234567890=2;
-drop table t1;
-
-#
-# test fragment creation
-#
-# first a table with _many_ fragments per node group
-# then a table with just one fragment per node group
-#
-create table t1
- (a bigint, b bigint, c bigint, d bigint,
- primary key (a,b,c,d))
- engine=ndb
- max_rows=800000000;
-insert into t1 values
- (1,2,3,4),(2,3,4,5),(3,4,5,6),
- (3,2,3,4),(1,3,4,5),(2,4,5,6),
- (1,2,3,5),(2,3,4,8),(3,4,5,9),
- (3,2,3,5),(1,3,4,8),(2,4,5,9),
- (1,2,3,6),(2,3,4,6),(3,4,5,7),
- (3,2,3,6),(1,3,4,6),(2,4,5,7),
- (1,2,3,7),(2,3,4,7),(3,4,5,8),
- (3,2,3,7),(1,3,4,7),(2,4,5,8),
- (1,3,3,4),(2,4,4,5),(3,5,5,6),
- (3,3,3,4),(1,4,4,5),(2,5,5,6),
- (1,3,3,5),(2,4,4,8),(3,5,5,9),
- (3,3,3,5),(1,4,4,8),(2,5,5,9),
- (1,3,3,6),(2,4,4,6),(3,5,5,7),
- (3,3,3,6),(1,4,4,6),(2,5,5,7),
- (1,3,3,7),(2,4,4,7),(3,5,5,8),
- (3,3,3,7),(1,4,4,7),(2,5,5,8);
-select count(*) from t1;
-drop table t1;
-
-create table t1
- (a bigint, b bigint, c bigint, d bigint,
- primary key (a))
- engine=ndb
- max_rows=1;
-drop table t1;
-
-#
-# Test auto_increment
-#
-
-connect (con1,localhost,root,,test);
-connect (con2,localhost,root,,test);
-
-create table t1
- (counter int(64) NOT NULL auto_increment,
- datavalue char(40) default 'XXXX',
- primary key (counter)
- ) ENGINE=ndbcluster;
-
-connection con1;
-insert into t1 (datavalue) values ('newval');
-insert into t1 (datavalue) values ('newval');
-select * from t1 order by counter;
-insert into t1 (datavalue) select datavalue from t1 where counter < 100;
-insert into t1 (datavalue) select datavalue from t1 where counter < 100;
-select * from t1 order by counter;
-connection con2;
-insert into t1 (datavalue) select datavalue from t1 where counter < 100;
-insert into t1 (datavalue) select datavalue from t1 where counter < 100;
-select * from t1 order by counter;
-
-drop table t1;
-
-#
-# BUG#14514 Creating table with packed key fails silently
-#
-
-CREATE TABLE t1 ( b INT ) PACK_KEYS = 0 ENGINE = ndb;
-select * from t1;
-drop table t1;
-
-#
-# Bug #17249 delete statement with join where clause fails
-# when table do not have pk
- #
-
-create table t1 (a int) engine=ndb;
-create table t2 (a int) engine=ndb;
-insert into t1 values (1);
-insert into t2 values (1);
-delete t1.* from t1, t2 where t1.a = t2.a;
-select * from t1;
-select * from t2;
-drop table t1;
-drop table t2;
-
-#
-# Bug #17257 update fails for inner joins if tables
-# do not have Primary Key
-#
-
-CREATE TABLE t1 (
- i INT,
- j INT,
- x INT,
- y INT,
- z INT
-) engine=ndb;
-
-CREATE TABLE t2 (
- i INT,
- k INT,
- x INT,
- y INT,
- z INT
-) engine=ndb;
-
-CREATE TABLE t3 (
- j INT,
- k INT,
- x INT,
- y INT,
- z INT
-) engine=ndb;
-
-INSERT INTO t1 VALUES ( 1, 2,13,14,15);
-INSERT INTO t2 VALUES ( 1, 3,23,24,25);
-INSERT INTO t3 VALUES ( 2, 3, 1,34,35), ( 2, 3, 1,34,36);
-
-UPDATE t1 AS a
-INNER JOIN t2 AS b
- ON a.i = b.i
-INNER JOIN t3 AS c
- ON a.j = c.j AND b.k = c.k
-SET a.x = b.x,
- a.y = b.y,
- a.z = (
- SELECT sum(z)
- FROM t3
- WHERE y = 34
- )
-WHERE b.x = 23;
-select * from t1;
-drop table t1;
-drop table t2;
-drop table t3;
-
-# End of 4.1 tests
-
-#
-# Test long table name
-#
-create table atablewithareallylongandirritatingname (a int);
-insert into atablewithareallylongandirritatingname values (2);
-select * from atablewithareallylongandirritatingname;
-drop table atablewithareallylongandirritatingname;
-
-#
-# Bug#15682
-#
-create table t1 (f1 varchar(50), f2 text,f3 int, primary key(f1)) engine=NDB;
-insert into t1 (f1,f2,f3)VALUES("111111","aaaaaa",1);
-insert into t1 (f1,f2,f3)VALUES("222222","bbbbbb",2);
-select * from t1 order by f1;
-select * from t1 order by f2;
-select * from t1 order by f3;
-drop table t1;
-# Bug#16561 Unknown ERROR msg "ERROR 1186 (HY000): Binlog closed" by perror
-#
-
-# As long there is no error code 1186 defined by NDB
-# we should get a message "Illegal ndb error code: 1186"
---error 1
---exec $MY_PERROR --ndb 1186 2>&1
-
-#
-# Bug #25746 - VARCHAR UTF8 PK issue
-# - prior to bugfix 4209, illegal length parameter would be
-# returned in SELECT *
-
-CREATE TABLE t1 (
-a VARBINARY(40) NOT NULL,
-b VARCHAR (256) CHARACTER SET UTF8 NOT NULL,
-c VARCHAR(256) CHARACTER SET UTF8 NOT NULL,
-PRIMARY KEY (b,c)) ENGINE=ndbcluster;
-INSERT INTO t1 VALUES
-("a","ab","abc"),("b","abc","abcd"),("c","abc","ab"),("d","ab","ab"),("e","abc","abc");
-SELECT * FROM t1 ORDER BY a;
-DROP TABLE t1;
-
-# End of 5.0 tests
---echo End of 5.0 tests
-
-
-#
-# Bug #18483 Cannot create table with FK constraint
-# ndb does not support foreign key constraint, it is silently ignored
-# in line with other storage engines
-#
-CREATE TABLE t1 (a VARCHAR(255) NOT NULL,
- CONSTRAINT pk_a PRIMARY KEY (a))engine=ndb;
-CREATE TABLE t2(a VARCHAR(255) NOT NULL,
- b VARCHAR(255) NOT NULL,
- c VARCHAR(255) NOT NULL,
- CONSTRAINT pk_b_c_id PRIMARY KEY (b,c),
- CONSTRAINT fk_a FOREIGN KEY(a) REFERENCES t1(a))engine=ndb;
-drop table t1, t2;
-
-# bug#24301
-create table t1 (a int not null primary key, b int) engine=ndb;
-insert into t1 values(1,1),(2,2),(3,3);
-create table t2 like t1;
-insert into t2 select * from t1;
-select * from t1 order by a;
-select * from t2 order by a;
-drop table t1, t2;
-
-# create table if not exists
---disable_warnings
-create table t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb;
-create table if not exists t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb;
---enable_warnings
-
-# create like
-create table t2 like t1;
-
-# multi rename
-rename table t1 to t10, t2 to t20;
-drop table t10,t20;
-
-# delete
-create table t1 (a int not null primary key, b int not null) engine=ndb;
-create table t2 (a int not null primary key, b int not null) engine=ndb;
-insert into t1 values (1,10), (2,20), (3,30);
-insert into t2 values (1,10), (2,20), (3,30);
-select * from t1 order by a;
-delete from t1 where a > 0 order by a desc limit 1;
-select * from t1 order by a;
-delete from t1,t2 using t1,t2 where t1.a = t2.a;
-select * from t2 order by a;
-drop table t1,t2;
-
-# insert ignore
-create table t1 (a int not null primary key, b int not null) engine=ndb;
-insert into t1 values (1,10), (2,20), (3,30);
---error ER_DUP_ENTRY_WITH_KEY_NAME
-insert into t1 set a=1, b=100;
-insert ignore into t1 set a=1, b=100;
-select * from t1 order by a;
-insert into t1 set a=1, b=1000 on duplicate key update b=b+1;
-select * from t1 order by a;
-drop table t1;
-
-# update
-create table t1 (a int not null primary key, b int not null) engine=ndb;
-create table t2 (c int not null primary key, d int not null) engine=ndb;
-insert into t1 values (1,10), (2,10), (3,30), (4, 30);
-insert into t2 values (1,10), (2,10), (3,30), (4, 30);
---error ER_DUP_ENTRY_WITH_KEY_NAME
-update t1 set a = 1 where a = 3;
-select * from t1 order by a;
-update t1 set b = 1 where a > 1 order by a desc limit 1;
-select * from t1 order by a;
---error ER_DUP_ENTRY_WITH_KEY_NAME
-update t1,t2 set a = 1, c = 1 where a = 3 and c = 3;
-select * from t1 order by a;
-update ignore t1,t2 set a = 1, c = 1 where a = 3 and c = 3;
-select * from t1 order by a;
-drop table t1,t2;
-
---echo End of 5.1 tests
diff --git a/mysql-test/t/ndb_binlog_basic.test b/mysql-test/t/ndb_binlog_basic.test
deleted file mode 100644
index e4642dc3230..00000000000
--- a/mysql-test/t/ndb_binlog_basic.test
+++ /dev/null
@@ -1,72 +0,0 @@
--- source include/have_ndb.inc
--- source include/have_binlog_format_row.inc
-
---disable_warnings
-drop table if exists t1, t2;
-drop database if exists mysqltest;
-create database mysqltest;
-use mysqltest;
-drop database mysqltest;
-use test;
---enable_warnings
-
-#
-# basic insert, update, delete test, alter, rename, drop
-# check that ndb_binlog_index gets the right info
-#
-
-create table t1 (a int primary key) engine=ndb;
-insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-save_master_pos;
---replace_column 1 #
-select @max_epoch:=max(epoch)-1 from mysql.ndb_binlog_index;
-
-delete from t1;
-alter table t1 add (b int);
-insert into t1 values (3,3),(4,4);
-alter table t1 rename t2;
-
-# get all in one epoch
-begin;
-insert into t2 values (1,1),(2,2);
-update t2 set b=1 where a=3;
-delete from t2 where a=4;
-commit;
-drop table t2;
-
-# check that above is ok
-# (save_master_pos waits for last gcp to complete, ensuring that we have
-# the expected data in the binlog)
-save_master_pos;
-select inserts from mysql.ndb_binlog_index where epoch > @max_epoch and inserts > 5;
-select deletes from mysql.ndb_binlog_index where epoch > @max_epoch and deletes > 5;
-select inserts,updates,deletes from
- mysql.ndb_binlog_index where epoch > @max_epoch and updates > 0;
-
-#
-# check that purge clears the ndb_binlog_index
-#
-flush logs;
---sleep 1
-purge master logs before now();
-select count(*) from mysql.ndb_binlog_index;
-
-#
-# several tables in different databases
-# check that same table name in different databases don't mix up
-#
-create table t1 (a int primary key, b int) engine=ndb;
-create database mysqltest;
-use mysqltest;
-create table t1 (c int, d int primary key) engine=ndb;
-use test;
-
-insert into mysqltest.t1 values (2,1),(2,2);
-save_master_pos;
---replace_column 1 #
-select @max_epoch:=max(epoch)-1 from mysql.ndb_binlog_index;
-
-drop table t1;
-drop database mysqltest;
-select inserts,updates,deletes from
- mysql.ndb_binlog_index where epoch > @max_epoch and inserts > 0;
diff --git a/mysql-test/t/ndb_binlog_basic2.test b/mysql-test/t/ndb_binlog_basic2.test
deleted file mode 100644
index 9fa9f2f965a..00000000000
--- a/mysql-test/t/ndb_binlog_basic2.test
+++ /dev/null
@@ -1,14 +0,0 @@
--- source include/have_ndb.inc
-
---error ER_NDB_CANT_SWITCH_BINLOG_FORMAT
-set session binlog_format=row;
---error ER_NDB_CANT_SWITCH_BINLOG_FORMAT
-set session binlog_format=statement;
---error ER_NDB_CANT_SWITCH_BINLOG_FORMAT
-set global binlog_format=row;
---error ER_NDB_CANT_SWITCH_BINLOG_FORMAT
-set global binlog_format=statement;
---error ER_NDB_CANT_SWITCH_BINLOG_FORMAT
-set session binlog_format=default;
---error ER_NDB_CANT_SWITCH_BINLOG_FORMAT
-set global binlog_format=default;
diff --git a/mysql-test/t/ndb_binlog_ddl_multi.test b/mysql-test/t/ndb_binlog_ddl_multi.test
deleted file mode 100644
index 487dfbf16e5..00000000000
--- a/mysql-test/t/ndb_binlog_ddl_multi.test
+++ /dev/null
@@ -1,191 +0,0 @@
--- source include/have_ndb.inc
--- source include/have_multi_ndb.inc
--- source include/have_binlog_format_row.inc
-
---disable_warnings
-connection server2;
-drop database if exists mysqltest;
-drop table if exists t1,t2,t3;
-connection server1;
-drop database if exists mysqltest;
-drop table if exists t1,t2,t3;
---connection server1
-reset master;
---connection server2
-reset master;
---enable_warnings
-
-#
-# basic test to see if ddl distribution works across
-# multiple binlogs
-#
-
-# create database
---connection server1
-create database mysqltest;
-
-# create table
---connection server1
-use mysqltest;
-create table t1 (a int primary key) engine=ndb;
-
---connection server2
-create table t2 (a int primary key) engine=ndb;
---source include/show_binlog_events2.inc
-
---connection server1
---source include/show_binlog_events2.inc
-
-# alter table
---connection server1
-reset master;
---connection server2
-reset master;
-
---connection server2
-alter table t2 add column (b int);
-
---connection server1
---source include/show_binlog_events2.inc
-
-# alter database
---connection server1
-reset master;
---connection server2
-reset master;
-
---connection server2
-ALTER DATABASE mysqltest CHARACTER SET latin1;
-
-
-# having drop here instead of below sometimes triggers bug#18976
-## drop table and drop should come after data events
---connection server2
-drop table mysqltest.t1;
-
---connection server1
---source include/show_binlog_events2.inc
-# to track down bug#18976
---real_sleep 10
---source include/show_binlog_events2.inc
-
-#--connection server2
-#drop table mysqltest.t1;
-
-# drop database and drop should come after data events
---connection server1
-reset master;
---connection server2
-reset master;
-
---connection server1
-use test;
-insert into t2 values (1,2);
-drop database mysqltest;
-create table t1 (a int primary key) engine=ndb;
-
---connection server2
---source include/show_binlog_events2.inc
-
---connection server2
-drop table t2;
-
-# logfile groups and table spaces
---connection server1
-reset master;
---connection server2
-reset master;
-
---connection server1
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-INITIAL_SIZE 16M
-UNDO_BUFFER_SIZE = 1M
-ENGINE=NDB;
-
-ALTER LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile02.dat'
-INITIAL_SIZE = 4M
-ENGINE=NDB;
-
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 12M
-ENGINE NDB;
-
-ALTER TABLESPACE ts1
-ADD DATAFILE 'datafile02.dat'
-INITIAL_SIZE = 4M
-ENGINE=NDB;
-
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile.dat'
-ENGINE = NDB;
-
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile02.dat'
-ENGINE = NDB;
-
-DROP TABLESPACE ts1
-ENGINE = NDB;
-
-DROP LOGFILE GROUP lg1
-ENGINE =NDB;
-
-# having drop here instead of below sometimes triggers bug#18976
-#drop table t1;
-
---connection server2
---source include/show_binlog_events2.inc
-# to track down bug#18976
---real_sleep 10
---source include/show_binlog_events2.inc
-
-drop table t1;
-
-#
-# Bug #17827 cluster: rename of several tables in one statement,
-# gets multiply logged
-#
---connection server1
-reset master;
-show tables;
---connection server2
-reset master;
-show tables;
-
---connection server1
-create table t1 (a int key) engine=ndb;
-create table t2 (a int key) engine=ndb;
-create table t3 (a int key) engine=ndb;
-rename table t3 to t4, t2 to t3, t1 to t2, t4 to t1;
---connection server2
---source include/show_binlog_events2.inc
-
-drop table t1;
-drop table t2;
-drop table t3;
-
-#
-# Bug #17838 binlog not setup on seconday master after rename
-#
-#
---connection server1
-reset master;
-show tables;
---connection server2
-reset master;
-show tables;
-
---connection server1
-create table t1 (a int key) engine=ndb;
-insert into t1 values(1);
-rename table t1 to t2;
-insert into t2 values(2);
-
-# now we should see data in table t1 _and_ t2
-# prior to bug fix, data was missing for t2
---connection server2
-drop table t2;
---source include/show_binlog_events2.inc
diff --git a/mysql-test/t/ndb_binlog_discover.test b/mysql-test/t/ndb_binlog_discover.test
deleted file mode 100644
index 999079ad29c..00000000000
--- a/mysql-test/t/ndb_binlog_discover.test
+++ /dev/null
@@ -1,36 +0,0 @@
--- source include/have_ndb.inc
--- source include/have_binlog_format_row.inc
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-#
-# Bug #14516 Restart of cluster can cause NDB API replication failure
-#
-create table t1 (a int key) engine=ndb;
-reset master;
---exec $NDB_MGM --no-defaults -e "all restart -n" > /dev/null
---exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults --not-started > /dev/null
---exec $NDB_MGM --no-defaults -e "all start" > /dev/null
---exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults > /dev/null
-
---disable_query_log
-let $mysql_errno= 1;
-while ($mysql_errno)
-{
- # Table t1 is readonly until the mysqld has reconnected properly
- --error 0,1036,1296
- insert into t1 values(1);
- if ($mysql_errno)
- {
- --sleep 0.1
- }
-}
---enable_query_log
-
---source include/show_binlog_events2.inc
-PURGE MASTER LOGS TO 'master-bin.000002';
-
---source include/show_binlog_events2.inc
-drop table t1;
diff --git a/mysql-test/t/ndb_binlog_ignore_db.test b/mysql-test/t/ndb_binlog_ignore_db.test
deleted file mode 100644
index 8f80e53f2e4..00000000000
--- a/mysql-test/t/ndb_binlog_ignore_db.test
+++ /dev/null
@@ -1,16 +0,0 @@
--- source include/have_ndb.inc
--- source include/have_binlog_format_row.inc
-reset master;
-
---disable_warnings
-drop table if exists t1;
-drop database if exists mysqltest;
---enable_warnings
-
-create database mysqltest;
-use mysqltest;
-create table t1 (a int primary key, b int) engine=ndb;
-insert into t1 values (1, 1);
--- source include/show_binlog_events2.inc
-
-drop database mysqltest;
diff --git a/mysql-test/t/ndb_binlog_log_bin.test b/mysql-test/t/ndb_binlog_log_bin.test
deleted file mode 100644
index b2dbaa797b6..00000000000
--- a/mysql-test/t/ndb_binlog_log_bin.test
+++ /dev/null
@@ -1,50 +0,0 @@
--- source include/have_ndb.inc
--- source include/have_multi_ndb.inc
--- source include/have_binlog_format_row.inc
-
---disable_warnings
-connection server2;
-drop table if exists t1,t2,t3;
-reset master;
-connection server1;
-drop table if exists t1,t2,t3;
-reset master;
---enable_warnings
-
-# basic SQL_LOG_BIN functionality
-# see updates from one thread but not the other
-connect (con1,localhost,root,,);
-connect (con2,localhost,root,,);
-# do some stuff with SQL_LOG_BIN=0
-connection con2;
-set SQL_LOG_BIN=0;
-create database mysqltest;
-use mysqltest;
-create table t1 (a int key, b int) engine=ndb;
-create table t2 (a int key, b int) engine=ndb;
-insert into t1 values (1,1);
-alter table t1 add c int;
-# we should not see it in the local server
--- source include/show_binlog_events2.inc
-reset master;
-# we should not see it in another server
-connection server2;
-use mysqltest;
-insert into t2 values (1,1);
--- source include/show_binlog_events2.inc
-reset master;
-# but if you do stuff in "default" client setting
-connection con1;
-use mysqltest;
-drop table t1;
-drop table t2;
-create table t1 (d int key, e int) engine=ndb;
-create table t2 (d int key, e int) engine=ndb;
-insert into t1 values (1,1);
--- source include/show_binlog_events2.inc
-# and in another server
-connection server2;
-use mysqltest;
-insert into t2 values (1,1);
--- source include/show_binlog_events2.inc
-drop database mysqltest;
diff --git a/mysql-test/t/ndb_binlog_multi.test b/mysql-test/t/ndb_binlog_multi.test
deleted file mode 100644
index c227c7fec93..00000000000
--- a/mysql-test/t/ndb_binlog_multi.test
+++ /dev/null
@@ -1,83 +0,0 @@
--- source include/have_ndb.inc
--- source include/have_multi_ndb.inc
--- source include/have_binlog_format_row.inc
-
---disable_warnings
-connection server2;
-drop table if exists t1,t2,t3;
-connection server1;
-drop table if exists t1,t2,t3;
---enable_warnings
-
-# Dummy table create/drop to avoid a race where table is created
-# before event subscription is set up, causing test failure (BUG#20677).
-connection server2;
-CREATE TABLE t3 (dummy INT PRIMARY KEY) ENGINE = NDB;
-connection server1;
-DROP TABLE t3;
-
-# reset for test
-connection server1;
-reset master;
-connection server2;
-reset master;
-
-#
-# basic test to see if one server sees the table from the other
-# and sets up the replication correctly
-#
-
-# create table on the other server
-connection server2;
-CREATE TABLE t2 (a INT PRIMARY KEY, b int) ENGINE = NDB;
-
-# insert something on server2
-INSERT INTO t2 VALUES (1,1),(2,2);
-# verify that we get the data in the binlog
---source include/show_binlog_events2.inc
-select * from t2 order by a;
---replace_column 1 <the_epoch>
-SELECT @the_epoch:=epoch,inserts,updates,deletes,schemaops FROM
- mysql.ndb_binlog_index ORDER BY epoch DESC LIMIT 1;
-let $the_epoch= `SELECT @the_epoch`;
-
-# see if we got something on server1
-connection server1;
-SELECT * FROM t2 ORDER BY a;
-# doing drop table will ensure that all the events have been received
-DROP TABLE t2;
-# verify thar we have table and data in binlog
---source include/show_binlog_events2.inc
---replace_result $the_epoch <the_epoch>
-eval SELECT inserts,updates,deletes,schemaops FROM
- mysql.ndb_binlog_index WHERE epoch=$the_epoch;
-
-# reset for next test
-connection server1;
-reset master;
-connection server2;
-reset master;
-
-# single schema ops will not show
-connection server2;
-CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = NDB;
-INSERT INTO t1 VALUES (1),(2);
---source include/show_binlog_events2.inc
---replace_column 1 <the_epoch2>
-SELECT @the_epoch2:=epoch,inserts,updates,deletes,schemaops FROM
- mysql.ndb_binlog_index ORDER BY epoch DESC LIMIT 1;
-let $the_epoch2= `SELECT @the_epoch2`;
-
---replace_result $the_epoch <the_epoch> $the_epoch2 <the_epoch2>
-eval SELECT inserts,updates,deletes,schemaops FROM
- mysql.ndb_binlog_index WHERE epoch > $the_epoch AND epoch <= $the_epoch2;
-
-# now see that we have the events on the other server
-connection server2;
-# doing drop table will ensure that all the events have been received
-drop table t1;
-# verify thar we have table and data in binlog
---source include/show_binlog_events2.inc
---replace_result $the_epoch <the_epoch> $the_epoch2 <the_epoch2>
-eval SELECT inserts,updates,deletes,schemaops FROM
- mysql.ndb_binlog_index WHERE epoch > $the_epoch AND epoch <= $the_epoch2;
diff --git a/mysql-test/t/ndb_cache_multi.test b/mysql-test/t/ndb_cache_multi.test
deleted file mode 100644
index 404393c211e..00000000000
--- a/mysql-test/t/ndb_cache_multi.test
+++ /dev/null
@@ -1,72 +0,0 @@
--- source include/have_query_cache.inc
--- source include/have_ndb.inc
--- source include/have_multi_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-drop table if exists t1, t2;
---enable_warnings
-
-
-# Turn on and reset query cache on server1
-connection server1;
-set GLOBAL query_cache_type=on;
-set GLOBAL query_cache_size=1355776;
-reset query cache;
-flush status;
-
-# Turn on and reset query cache on server2
-connection server2;
-set GLOBAL query_cache_type=on;
-set GLOBAL query_cache_size=1355776;
-reset query cache;
-flush status;
-
-
-
-# Create test tables in NDB and load them into cache
-# on server1
-connection server1;
-create table t1 (a int) engine=ndbcluster;
-create table t2 (a int) engine=ndbcluster;
-insert into t1 value (2);
-insert into t2 value (3);
-select * from t1;
-select * from t2;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-
-# Connect server2, load table in to cache, then update the table
-connection server2;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-select * from t1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-update t1 set a=3 where a=2;
-
-# Connect to server1 and check that cache is invalidated
-# and correct data is returned
-connection server1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-select * from t1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-drop table t1, t2;
-
-
-# Turn off query cache on server1
-connection server1;
-set GLOBAL query_cache_size=0;
-
-# Turn off query cache on server2
-connection server2;
-set GLOBAL query_cache_size=0;
diff --git a/mysql-test/t/ndb_cache_multi2.test b/mysql-test/t/ndb_cache_multi2.test
deleted file mode 100644
index 2afcf0c18f7..00000000000
--- a/mysql-test/t/ndb_cache_multi2.test
+++ /dev/null
@@ -1,126 +0,0 @@
--- source include/have_query_cache.inc
--- source include/have_ndb.inc
--- source include/have_multi_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-drop table if exists t1, t2;
---enable_warnings
-
-
-# Turn on and reset query cache on server1
-connection server1;
-echo == Connected to server1 ==;
-set GLOBAL query_cache_type=on;
-set GLOBAL query_cache_size=1355776;
-set GLOBAL ndb_cache_check_time=1;
-reset query cache;
-flush status;
-
-# Turn on and reset query cache on server2
-connection server2;
-echo == Connected to server2 ==;
-set GLOBAL query_cache_type=on;
-set GLOBAL query_cache_size=1355776;
-set GLOBAL ndb_cache_check_time=1;
-reset query cache;
-flush status;
-
-# Create test tables in NDB and load them into cache
-# on server1
-connection server1;
-echo == Connected to server1 ==;
-create table t1 (a int) engine=ndbcluster;
-create table t2 (a int) engine=ndbcluster;
-insert into t1 value (2);
-insert into t2 value (3);
-select * from t1;
-# Run the check query once to load it into qc on server1
-# See at the end of this test why we need to disable ps-protocol for
-# this query (*)
---disable_ps_protocol
-select a != 3 from t1;
---enable_ps_protocol
-select * from t2;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-
-# Connect server2, load table in to cache, then update the table
-connection server2;
-echo == Connected to server2 ==;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-select * from t1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-update t1 set a=3 where a=2;
-
-# Connect to server1 and check that cache is invalidated
-# and correct data is returned
-connection server1;
-echo == Connected to server1 ==;
-
-# Loop and wait for max 10 seconds until query cache thread
-# has invalidated the cache and the column a in t1 is equal to 3
-let $retries=20;
-while (`select a != 3 from t1`)
-{
- dec $retries;
- if (!$retries)
- {
- The query_cache thread failed to invalidate query_cache in 10 seconds;
- }
- sleep 0.5;
-}
-
-# Select from t1 one last time for the result file
-# Column a should be 3
-select * from t1;
-
-# There should now be three queries in the cache
-show status like "Qcache_queries_in_cache";
-
-drop table t1, t2;
-
-# Turn off and reset query cache on server1 and server2
-connection server1;
-set GLOBAL query_cache_size=0;
-set GLOBAL ndb_cache_check_time=0;
-reset query cache;
-flush status;
-connection server2;
-set GLOBAL query_cache_size=0;
-set GLOBAL ndb_cache_check_time=0;
-reset query cache;
-flush status;
-
-# (*) Why we need to execute the query in non-ps mode.
-# The principle of this test is: two mysqlds connected to one cluster,
-# both using their query cache. Queries are cached in server1
-# ("select a!=3 from t1", "select * from t1"),
-# table t1 is modified in server2, we want to see that this invalidates
-# the query cache of server1. Invalidation with NDB works like this:
-# when a query is found in the query cache, NDB is asked if the tables
-# have changed. In this test, ha_ndbcluster calls NDB every millisecond
-# to collect change information about tables.
-# Due to this millisecond delay, there is need for a loop ("while...")
-# in this test, which waits until a query1 ("select a!=3 from t1") is
-# invalidated (which is equivalent to it returning
-# up-to-date results), and then expects query2 ("select * from t1")
-# to have been invalidated (see up-to-date results).
-# But when enabling --ps-protocol in this test, the logic breaks,
-# because query1 is still done via mysql_real_query() (see mysqltest.c:
-# eval_expr() always uses mysql_real_query()). So, query1 returning
-# up-to-date results is not a sign of it being invalidated in the cache,
-# because it was NOT in the cache ("select a!=3 from t1" on line 39
-# was done with prep stmts, while `select a!=3 from t1` is not,
-# thus the second does not see the first in the cache). Thus, we may run
-# query2 when cache still has not been invalidated.
-# The solution is to make the initial "select a!=3 from t1" run
-# as a normal query, this repairs the broken logic.
-# But note, "select * from t1" is still using prepared statements
-# which was the goal of this test with --ps-protocol.
diff --git a/mysql-test/t/ndb_charset.test b/mysql-test/t/ndb_charset.test
deleted file mode 100644
index 2cdb1972225..00000000000
--- a/mysql-test/t/ndb_charset.test
+++ /dev/null
@@ -1,257 +0,0 @@
---source include/have_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-#
-# Minimal NDB charset test.
-#
-
-# pk - binary
-
-create table t1 (
- a char(3) character set latin1 collate latin1_bin primary key
-) engine=ndb;
-# ok
-insert into t1 values('aAa');
-insert into t1 values('aaa');
-insert into t1 values('AAA');
-# 3
-select * from t1 order by a;
-# 1
-select * from t1 where a = 'aAa';
-# 1
-select * from t1 where a = 'aaa';
-# 0
-select * from t1 where a = 'AaA';
-# 1
-select * from t1 where a = 'AAA';
-drop table t1;
-
-# pk - case insensitive
-
-create table t1 (
- a char(3) character set latin1 collate latin1_swedish_ci primary key
-) engine=ndb;
-# ok
-insert into t1 values('aAa');
-# fail
---error ER_DUP_ENTRY_WITH_KEY_NAME
-insert into t1 values('aaa');
---error ER_DUP_ENTRY_WITH_KEY_NAME
-insert into t1 values('AAA');
-# 1
-select * from t1 order by a;
-# 1
-select * from t1 where a = 'aAa';
-# 1
-select * from t1 where a = 'aaa';
-# 1
-select * from t1 where a = 'AaA';
-# 1
-select * from t1 where a = 'AAA';
-drop table t1;
-
-# pk - varchar
-
-create table t1 (
- a varchar(20) character set latin1 collate latin1_swedish_ci primary key
-) engine=ndb;
-#
-insert into t1 values ('A'),('b '),('C '),('d '),('E'),('f');
--- error ER_DUP_ENTRY_WITH_KEY_NAME
-insert into t1 values('b');
--- error ER_DUP_ENTRY_WITH_KEY_NAME
-insert into t1 values('a ');
-#
-select a,length(a) from t1 order by a;
-select a,length(a) from t1 order by a desc;
-select * from t1 where a = 'a';
-select * from t1 where a = 'a ';
-select * from t1 where a = 'd';
-drop table t1;
-
-# unique hash index - binary
-
-create table t1 (
- p int primary key,
- a char(3) character set latin1 collate latin1_bin not null,
- unique key(a)
-) engine=ndb;
-# ok
-insert into t1 values(1, 'aAa');
-insert into t1 values(2, 'aaa');
-insert into t1 values(3, 'AAA');
-# 3
-select * from t1 order by p;
-# 1
-select * from t1 where a = 'aAa';
-# 1
-select * from t1 where a = 'aaa';
-# 0
-select * from t1 where a = 'AaA';
-# 1
-select * from t1 where a = 'AAA';
-drop table t1;
-
-# unique hash index - case insensitive
-
-create table t1 (
- p int primary key,
- a char(3) character set latin1 collate latin1_swedish_ci not null,
- unique key(a)
-) engine=ndb;
-# ok
-insert into t1 values(1, 'aAa');
-# fail
---error ER_DUP_ENTRY_WITH_KEY_NAME
-insert into t1 values(2, 'aaa');
---error ER_DUP_ENTRY_WITH_KEY_NAME
-insert into t1 values(3, 'AAA');
-# 1
-select * from t1 order by p;
-# 1
-select * from t1 where a = 'aAa';
-# 1
-select * from t1 where a = 'aaa';
-# 1
-select * from t1 where a = 'AaA';
-# 1
-select * from t1 where a = 'AAA';
-drop table t1;
-
-# unique hash index - varchar
-
-create table t1 (
- p int primary key,
- a varchar(20) character set latin1 collate latin1_swedish_ci not null,
- unique key(a)
-) engine=ndb;
-#
-insert into t1 values (1,'A'),(2,'b '),(3,'C '),(4,'d '),(5,'E'),(6,'f');
--- error ER_DUP_ENTRY_WITH_KEY_NAME
-insert into t1 values(99,'b');
--- error ER_DUP_ENTRY_WITH_KEY_NAME
-insert into t1 values(99,'a ');
-#
-select a,length(a) from t1 order by a;
-select a,length(a) from t1 order by a desc;
-select * from t1 where a = 'a';
-select * from t1 where a = 'a ';
-select * from t1 where a = 'd';
-drop table t1;
-
-# ordered index - binary
-
-create table t1 (
- p int primary key,
- a char(3) character set latin1 collate latin1_bin not null,
- index(a)
-) engine=ndb;
-# ok
-insert into t1 values(1, 'aAa');
-insert into t1 values(2, 'aaa');
-insert into t1 values(3, 'AAA');
-insert into t1 values(4, 'aAa');
-insert into t1 values(5, 'aaa');
-insert into t1 values(6, 'AAA');
-# 6
-select * from t1 order by p;
-# plan too flaky
-#--replace_column 9 #
-#explain select * from t1 where a = 'zZz' order by p;
-# 2
-select * from t1 where a = 'aAa' order by p;
-# 2
-select * from t1 where a = 'aaa' order by p;
-# 0
-select * from t1 where a = 'AaA' order by p;
-# 2
-select * from t1 where a = 'AAA' order by p;
-drop table t1;
-
-# ordered index - case insensitive
-
-create table t1 (
- p int primary key,
- a char(3) character set latin1 collate latin1_swedish_ci not null,
- index(a)
-) engine=ndb;
-# ok
-insert into t1 values(1, 'aAa');
-insert into t1 values(2, 'aaa');
-insert into t1 values(3, 'AAA');
-insert into t1 values(4, 'aAa');
-insert into t1 values(5, 'aaa');
-insert into t1 values(6, 'AAA');
-# 6
-select * from t1 order by p;
-# plan too flaky
-#--replace_column 9 #
-#explain select * from t1 where a = 'zZz' order by p;
-# 6
-select * from t1 where a = 'aAa' order by p;
-# 6
-select * from t1 where a = 'aaa' order by p;
-# 6
-select * from t1 where a = 'AaA' order by p;
-# 6
-select * from t1 where a = 'AAA' order by p;
-drop table t1;
-
-# ordered index - varchar
-
-create table t1 (
- p int primary key,
- a varchar(20) character set latin1 collate latin1_swedish_ci not null,
- index(a, p)
-) engine=ndb;
-#
-insert into t1 values (1,'A'),(2,'b '),(3,'C '),(4,'d '),(5,'E'),(6,'f');
-insert into t1 values (7,'a'),(8,'B '),(9,'c '),(10,'D'),(11,'e'),(12,'F ');
-select p,a,length(a) from t1 order by a, p;
-select * from t1 where a = 'a ' order by a desc, p desc;
-select * from t1 where a >= 'D' order by a, p;
-select * from t1 where a < 'D' order by a, p;
-#
-select count(*) from t1 x, t1 y, t1 z where x.a = y.a and y.a = z.a;
-drop table t1;
-
-# minimal multi-byte test
-# removed by jonas as this requires a configure --with-extra-charsets
-#create table t1 (
-# a char(5) character set ucs2,
-# b varchar(7) character set utf8,
-# primary key(a, b)
-#) engine=ndb;
-#
-#insert into t1 values
-# ('a','A '),('B ','b'),('c','C '),('D','d'),('e ','E'),('F','f '),
-# ('A','b '),('b ','C'),('C','d '),('d','E'),('E ','f'),
-# ('a','C '),('B ','d'),('c','E '),('D','f');
-#-- error ER_DUP_ENTRY_WITH_KEY_NAME
-#insert into t1 values('d','f');
-#
-#select a,b,length(a),length(b) from t1 order by a,b limit 3;
-#select a,b,length(a),length(b) from t1 order by a desc, b desc limit 3;
-#select a,b,length(a),length(b) from t1 where a='c' and b='c';
-#drop table t1;
-
-# bug#14007
-create table t1 (
- a char(10) primary key
-) engine=ndbcluster default charset=latin1;
-
-insert into t1 values ('aaabb');
-select * from t1;
-replace into t1 set a = 'AAABB';
-select * from t1;
-replace into t1 set a = 'aAaBb';
-select * from t1;
-replace into t1 set a = 'aaabb';
-select * from t1;
-drop table t1;
-
-# End of 4.1 tests
diff --git a/mysql-test/t/ndb_dd_basic.test b/mysql-test/t/ndb_dd_basic.test
deleted file mode 100644
index 3acf4669868..00000000000
--- a/mysql-test/t/ndb_dd_basic.test
+++ /dev/null
@@ -1,454 +0,0 @@
-#################################
-# Author: JO
-# Org Date: ?
-# Purpose: To test basic Cluster Disk Data
-#################################
-# Change Author: JBM
-# Change Date: 2006-01-11
-# Change: Cleanup and test rename
-#################################
-# Change Author: Guangbao Ni
-# Change Date: 2007-03-20
-# Change: Test insert data when no datafile in spacetable
-#################################
-
--- source include/have_ndb.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-# some negative tests
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-INITIAL_SIZE 16M
-UNDO_BUFFER_SIZE = 1M
-ENGINE=MYISAM;
-
-ALTER LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile02.dat'
-INITIAL_SIZE = 4M
-ENGINE=XYZ;
-
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 12M;
-
-##################################
-# Basic test of disk tables for NDB
-# Start by creating a logfile group
-##################################
-
-set storage_engine=ndb;
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-INITIAL_SIZE 16M
-UNDO_BUFFER_SIZE = 1M;
-
-ALTER LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile02.dat'
-INITIAL_SIZE = 4M
-ENGINE=NDB;
-
-###################################################
-# Create a tablespace connected to the logfile group
-###################################################
-
-set storage_engine=myisam;
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 12M
-ENGINE NDB;
-
-ALTER TABLESPACE ts1
-ADD DATAFILE 'datafile02.dat'
-INITIAL_SIZE = 4M
-ENGINE=NDB;
-
-########################################
-# Create a table using this tablespace
-########################################
-
-CREATE TABLE t1
-(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
-TABLESPACE ts1 STORAGE DISK
-ENGINE=NDB;
-
-SHOW CREATE TABLE t1;
-
-INSERT INTO t1 VALUES (0, 0, 0);
-SELECT * FROM t1;
-
-INSERT INTO t1 VALUES
-(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
-(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10),
-(11,11,11),(12,12,12),(13,13,13),(14,14,14),(15,15,15),
-(16,16,16),(17,17,17),(18,18,18),(19,19,19),(20,20,20),
-(21,21,21),(22,22,22),(23,23,23),(24,24,24),(25,25,25),
-(26,26,26),(27,27,27),(28,28,28),(29,29,29),(30,30,30),
-(31,31,31),(32,32,32),(33,33,33),(34,34,34),(35,35,35),
-(36,36,36),(37,37,37),(38,38,38),(39,39,39),(40,40,40),
-(41,41,41),(42,42,42),(43,43,43),(44,44,44),(45,45,45),
-(46,46,46),(47,47,47),(48,48,48),(49,49,49),(50,50,50),
-(51,51,51),(52,52,52),(53,53,53),(54,54,54),(55,55,55),
-(56,56,56),(57,57,57),(58,58,58),(59,59,59),(60,60,60),
-(61,61,61),(62,62,62),(63,63,63),(64,64,64),(65,65,65),
-(66,66,66),(67,67,67),(68,68,68),(69,69,69),(70,70,70),
-(71,71,71),(72,72,72),(73,73,73),(74,74,74),(75,75,75),
-(76,76,76),(77,77,77),(78,78,78),(79,79,79),(80,80,80),
-(81,81,81),(82,82,82),(83,83,83),(84,84,84),(85,85,85),
-(86,86,86),(87,87,87),(88,88,88),(89,89,89),(90,90,90),
-(91,91,91),(92,92,92),(93,93,93),(94,94,94),(95,95,95),
-(96,96,96),(97,97,97),(98,98,98),(99,99,99),(100,100,100),
-(101,101,101),(102,102,102),(103,103,103),(104,104,104),(105,105,105),
-(106,106,106),(107,107,107),(108,108,108),(109,109,109),(110,110,110),
-(111,111,111),(112,112,112),(113,113,113),(114,114,114),(115,115,115),
-(116,116,116),(117,117,117),(118,118,118),(119,119,119),(120,120,120),
-(121,121,121),(122,122,122),(123,123,123),(124,124,124),(125,125,125),
-(126,126,126),(127,127,127),(128,128,128),(129,129,129),(130,130,130),
-(131,131,131),(132,132,132),(133,133,133),(134,134,134),(135,135,135),
-(136,136,136),(137,137,137),(138,138,138),(139,139,139),(140,140,140),
-(141,141,141),(142,142,142),(143,143,143),(144,144,144),(145,145,145),
-(146,146,146),(147,147,147),(148,148,148),(149,149,149),(150,150,150),
-(151,151,151),(152,152,152),(153,153,153),(154,154,154),(155,155,155),
-(156,156,156),(157,157,157),(158,158,158),(159,159,159),(160,160,160),
-(161,161,161),(162,162,162),(163,163,163),(164,164,164),(165,165,165),
-(166,166,166),(167,167,167),(168,168,168),(169,169,169),(170,170,170),
-(171,171,171),(172,172,172),(173,173,173),(174,174,174),(175,175,175),
-(176,176,176),(177,177,177),(178,178,178),(179,179,179),(180,180,180),
-(181,181,181),(182,182,182),(183,183,183),(184,184,184),(185,185,185),
-(186,186,186),(187,187,187),(188,188,188),(189,189,189),(190,190,190),
-(191,191,191),(192,192,192),(193,193,193),(194,194,194),(195,195,195),
-(196,196,196),(197,197,197),(198,198,198),(199,199,199),(200,200,200),
-(201,201,201),(202,202,202),(203,203,203),(204,204,204),(205,205,205),
-(206,206,206),(207,207,207),(208,208,208),(209,209,209),(210,210,210),
-(211,211,211),(212,212,212),(213,213,213),(214,214,214),(215,215,215),
-(216,216,216),(217,217,217),(218,218,218),(219,219,219),(220,220,220),
-(221,221,221),(222,222,222),(223,223,223),(224,224,224),(225,225,225),
-(226,226,226),(227,227,227),(228,228,228),(229,229,229),(230,230,230),
-(231,231,231),(232,232,232),(233,233,233),(234,234,234),(235,235,235),
-(236,236,236),(237,237,237),(238,238,238),(239,239,239),(240,240,240),
-(241,241,241),(242,242,242),(243,243,243),(244,244,244),(245,245,245),
-(246,246,246),(247,247,247),(248,248,248),(249,249,249),(250,250,250),
-(251,251,251),(252,252,252),(253,253,253),(254,254,254),(255,255,255),
-(256,256,256),(257,257,257),(258,258,258),(259,259,259),(260,260,260),
-(261,261,261),(262,262,262),(263,263,263),(264,264,264),(265,265,265),
-(266,266,266),(267,267,267),(268,268,268),(269,269,269),(270,270,270),
-(271,271,271),(272,272,272),(273,273,273),(274,274,274),(275,275,275),
-(276,276,276),(277,277,277),(278,278,278),(279,279,279),(280,280,280),
-(281,281,281),(282,282,282),(283,283,283),(284,284,284),(285,285,285),
-(286,286,286),(287,287,287),(288,288,288),(289,289,289),(290,290,290),
-(291,291,291),(292,292,292),(293,293,293),(294,294,294),(295,295,295),
-(296,296,296),(297,297,297),(298,298,298),(299,299,299),(300,300,300),
-(301,301,301),(302,302,302),(303,303,303),(304,304,304),(305,305,305),
-(306,306,306),(307,307,307),(308,308,308),(309,309,309),(310,310,310),
-(311,311,311),(312,312,312),(313,313,313),(314,314,314),(315,315,315),
-(316,316,316),(317,317,317),(318,318,318),(319,319,319),(320,320,320),
-(321,321,321),(322,322,322),(323,323,323),(324,324,324),(325,325,325),
-(326,326,326),(327,327,327),(328,328,328),(329,329,329),(330,330,330),
-(331,331,331),(332,332,332),(333,333,333),(334,334,334),(335,335,335),
-(336,336,336),(337,337,337),(338,338,338),(339,339,339),(340,340,340),
-(341,341,341),(342,342,342),(343,343,343),(344,344,344),(345,345,345),
-(346,346,346),(347,347,347),(348,348,348),(349,349,349),(350,350,350),
-(351,351,351),(352,352,352),(353,353,353),(354,354,354),(355,355,355),
-(356,356,356),(357,357,357),(358,358,358),(359,359,359),(360,360,360),
-(361,361,361),(362,362,362),(363,363,363),(364,364,364),(365,365,365),
-(366,366,366),(367,367,367),(368,368,368),(369,369,369),(370,370,370),
-(371,371,371),(372,372,372),(373,373,373),(374,374,374),(375,375,375),
-(376,376,376),(377,377,377),(378,378,378),(379,379,379),(380,380,380),
-(381,381,381),(382,382,382),(383,383,383),(384,384,384),(385,385,385),
-(386,386,386),(387,387,387),(388,388,388),(389,389,389),(390,390,390),
-(391,391,391),(392,392,392),(393,393,393),(394,394,394),(395,395,395),
-(396,396,396),(397,397,397),(398,398,398),(399,399,399),(400,400,400),
-(401,401,401),(402,402,402),(403,403,403),(404,404,404),(405,405,405),
-(406,406,406),(407,407,407),(408,408,408),(409,409,409),(410,410,410),
-(411,411,411),(412,412,412),(413,413,413),(414,414,414),(415,415,415),
-(416,416,416),(417,417,417),(418,418,418),(419,419,419),(420,420,420),
-(421,421,421),(422,422,422),(423,423,423),(424,424,424),(425,425,425),
-(426,426,426),(427,427,427),(428,428,428),(429,429,429),(430,430,430),
-(431,431,431),(432,432,432),(433,433,433),(434,434,434),(435,435,435),
-(436,436,436),(437,437,437),(438,438,438),(439,439,439),(440,440,440),
-(441,441,441),(442,442,442),(443,443,443),(444,444,444),(445,445,445),
-(446,446,446),(447,447,447),(448,448,448),(449,449,449),(450,450,450),
-(451,451,451),(452,452,452),(453,453,453),(454,454,454),(455,455,455),
-(456,456,456),(457,457,457),(458,458,458),(459,459,459),(460,460,460),
-(461,461,461),(462,462,462),(463,463,463),(464,464,464),(465,465,465),
-(466,466,466),(467,467,467),(468,468,468),(469,469,469),(470,470,470),
-(471,471,471),(472,472,472),(473,473,473),(474,474,474),(475,475,475),
-(476,476,476),(477,477,477),(478,478,478),(479,479,479),(480,480,480),
-(481,481,481),(482,482,482),(483,483,483),(484,484,484),(485,485,485),
-(486,486,486),(487,487,487),(488,488,488),(489,489,489),(490,490,490),
-(491,491,491),(492,492,492),(493,493,493),(494,494,494),(495,495,495),
-(496,496,496),(497,497,497),(498,498,498),(499,499,499),(500, 500, 500);
-
-SELECT COUNT(*) FROM t1;
-
-####################################
-# Test error cases with size numbers
-####################################
---error ER_WRONG_SIZE_NUMBER
-CREATE LOGFILE GROUP lg2
-ADD UNDOFILE 'x.dat'
-INITIAL_SIZE 10y
-ENGINE = NDB;
-
---error ER_WRONG_SIZE_NUMBER
-CREATE LOGFILE GROUP lg2
-ADD UNDOFILE 'x.dat'
-INITIAL_SIZE 10MB
-ENGINE = NDB;
-
---error 1064
-CREATE LOGFILE GROUP lg2
-ADD UNDOFILE 'x.dat'
-INITIAL_SIZE 10 MB
-ENGINE = NDB;
-
---error 1064
-CREATE LOGFILE GROUP lg2
-ADD UNDOFILE 'x.dat'
-INITIAL_SIZE 10 M
-ENGINE = NDB;
-
---error ER_SIZE_OVERFLOW_ERROR
-CREATE LOGFILE GROUP lg2
-ADD UNDOFILE 'x.dat'
-INITIAL_SIZE 1000000000000K
-ENGINE = NDB;
-
-DROP TABLE t1;
-
-create tablespace ts2
-add datafile 'datafile2_1.dat'
-use logfile group lg1
-initial_size 12M
-engine ndb;
-
-CREATE TABLE City (
- ID int(11) NOT NULL AUTO_INCREMENT,
- Name char(35) NOT NULL,
- CountryCode char(3) NOT NULL,
- District char(20) NOT NULL,
- Population int(11) NOT NULL,
- PRIMARY KEY (ID)
-) ENGINE=ndbcluster
-tablespace ts2
-storage disk;
-
-alter tablespace ts2
-drop datafile 'datafile2_1.dat'
-engine ndb;
-
-#It will give error messages: NoDatafile in tablespace
---error ER_GET_ERRMSG
-insert
-into City (Name,CountryCode,District,Population)
-values ('BeiJing','CN','Beijing',2000);
-
---error ER_DROP_FILEGROUP_FAILED
-drop tablespace ts2
-engine ndb;
-
-drop table City;
-
-drop tablespace ts2
-engine ndb;
-
-############################
-# Test update of mm/dd part
-############################
-
-CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(4) NOT NULL, c CHAR(4) NOT NULL, KEY(b)) TABLESPACE ts1 STORAGE DISK ENGINE = NDB;
-INSERT INTO t1 VALUES (1,'1','1'), (2,'2','2'), (3,'3','3');
-BEGIN;
-UPDATE t1 SET b = '2' WHERE a = 1;
-SELECT b FROM t1 WHERE a = 1;
-SELECT * FROM t1 WHERE a = 1;
-UPDATE t1 SET c = '2' WHERE a = 1;
-SELECT b FROM t1 WHERE a = 1;
-SELECT * FROM t1 WHERE a = 1;
-UPDATE t1 SET b = '3' WHERE a = 1;
-SELECT b FROM t1 WHERE a = 1;
-SELECT * FROM t1 WHERE a = 1;
-COMMIT;
-SELECT * FROM t1 ORDER BY 1;
-BEGIN;
-UPDATE t1 SET c = '3' WHERE a = 1;
-SELECT b FROM t1 WHERE a = 1;
-SELECT * FROM t1 WHERE a = 1;
-UPDATE t1 SET b = '4' WHERE a = 1;
-SELECT b FROM t1 WHERE a = 1;
-SELECT * FROM t1 WHERE a = 1;
-UPDATE t1 SET c = '4' WHERE a = 1;
-SELECT b FROM t1 WHERE a = 1;
-SELECT * FROM t1 WHERE a = 1;
-COMMIT;
-SELECT * FROM t1 ORDER BY 1;
-UPDATE t1 SET b = '5' WHERE a = 1;
-SELECT * FROM t1 ORDER BY 1;
-UPDATE t1 SET b = '6' WHERE b = '5';
-SELECT * FROM t1 ORDER BY 1;
-UPDATE t1 SET b = '7'WHERE c = '4';
-SELECT * FROM t1 ORDER BY 1;
-UPDATE t1 SET c = '5' WHERE a = 1;
-SELECT * FROM t1 ORDER BY 1;
-UPDATE t1 SET c = '6' WHERE b = '7';
-SELECT * FROM t1 ORDER BY 1;
-UPDATE t1 SET c = '7' WHERE c = '6';
-SELECT * FROM t1 ORDER BY 1;
-DROP TABLE t1;
-
-#####
-
-CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(4) NOT NULL, c CHAR(4) NOT NULL, KEY(b)) TABLESPACE ts1 STORAGE DISK ENGINE NDB;
-INSERT INTO t1 VALUE (1,'1','1'), (2,'2','2'), (3,'3','3');
-BEGIN;
-UPDATE t1 SET b = '2' WHERE a = 1;
-SELECT b FROM t1 WHERE a = 1;
-SELECT * FROM t1 WHERE a = 1;
-UPDATE t1 SET c = '2' WHERE a = 1;
-SELECT b FROM t1 WHERE a = 1;
-SELECT * FROM t1 WHERE a = 1;
-UPDATE t1 SET b = '3' WHERE a = 1;
-SELECT b FROM t1 WHERE a = 1;
-SELECT * FROM t1 WHERE a = 1;
-COMMIT;
-SELECT * FROM t1 ORDER BY 1;
-BEGIN;
-UPDATE t1 SET c = '3' WHERE a = 1;
-SELECT b FROM t1 WHERE a = 1;
-SELECT * FROM t1 WHERE a = 1;
-UPDATE t1 SET b = '4' WHERE a = 1;
-SELECT b FROM t1 WHERE a = 1;
-SELECT * FROM t1 WHERE a = 1;
-UPDATE t1 SET c = '4' WHERE a = 1;
-SELECT b FROM t1 WHERE a = 1;
-SELECT * FROM t1 WHERE a = 1;
-COMMIT;
-SELECT * FROM t1 ORDER BY 1;
-UPDATE t1 SET b = '5' WHERE a = 1;
-SELECT * FROM t1 ORDER BY 1;
-UPDATE t1 SET b = '6' WHERE b = '5';
-SELECT * FROM t1 ORDER BY 1;
-UPDATE t1 SET b = '7' WHERE c = '4';
-SELECT * FROM t1 ORDER BY 1;
-UPDATE t1 SET c = '5' WHERE a = 1;
-SELECT * FROM t1 ORDER BY 1;
-UPDATE t1 SET c = '6' WHERE b = '7';
-SELECT * FROM t1 ORDER BY 1;
-UPDATE t1 SET c = '7' WHERE c = '6';
-SELECT * FROM t1 ORDER BY 1;
-DROP TABLE t1;
-
-########################
-# Test for blobs...
-########################
-
-CREATE TABLE t1 (
- a INT NOT NULL PRIMARY KEY,
- b TEXT NOT NULL
-) TABLESPACE ts1 STORAGE DISK ENGINE=NDBCLUSTER;
-
-# b1 length 2000+256 (blob part aligned)
-#########################################
-set @x0 = '01234567012345670123456701234567';
-set @x0 = concat(@x0,@x0,@x0,@x0,@x0,@x0,@x0,@x0);
-set @b1 = 'b1';
-set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
-set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
-set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
-set @b1 = concat(@b1,@x0);
-# b2 length 20000
-##########################################
-set @b2 = 'b2';
-set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
-set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
-set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
-set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
-
-INSERT INTO t1 VALUES(1,@b1);
-INSERT INTO t1 VALUES(2,@b2);
-SELECT a,length(b),substr(b,1+2*900,2) FROM t1 WHERE a=1;
-SELECT a,length(b),substr(b,1+2*9000,2) FROM t1 WHERE a=2;
-UPDATE t1 SET b=@b2 WHERE a=1;
-UPDATE t1 SET b=@b1 WHERE a=2;
-SELECT a,length(b),substr(b,1+2*9000,2) FROM t1 WHERE a=1;
-SELECT a,length(b),substr(b,1+2*900,2) FROM t1 WHERE a=2;
-UPDATE t1 SET b=concat(b,b) WHERE a=1;
-UPDATE t1 SET b=concat(b,b) WHERE a=2;
-SELECT a,length(b),substr(b,1+4*9000,2) FROM t1 WHERE a=1;
-SELECT a,length(b),substr(b,1+4*900,2) FROM t1 WHERE a=2;
-DELETE FROM t1 WHERE a=1;
-DELETE FROM t1 WHERE a=2;
-SELECT COUNT(*) FROM t1;
-DROP TABLE t1;
-
-# bug#20612 INS-DEL bug (not pgman bug)
-# found via disk data assert but is not pgman or disk data related
-
-CREATE TABLE t1 (
- a int NOT NULL,
- b varchar(4000), -- must use 2 pages undo
- PRIMARY KEY using hash (a)
-)
-TABLESPACE ts1 STORAGE DISK ENGINE=NDBCLUSTER;
-
-set autocommit = 0;
-insert into t1 values(0,'x');
-insert into t1 values(1,'x');
-insert into t1 values(2,'x');
-insert into t1 values(3,'x');
-insert into t1 values(4,'x');
-insert into t1 values(5,'x');
-insert into t1 values(6,'x');
-insert into t1 values(7,'x');
-insert into t1 values(8,'x');
-delete from t1 where a = 0;
-commit;
-
-delete from t1;
-begin;
-insert into t1 values (1, 'x');
-select * from t1;
-rollback;
-
-set autocommit = 1;
-
-
-drop table t1;
-#############################
-# Customer posted order by test case
-# Org in ndb_dd_advance.test
-#############################
-
-create table test.t1 (f1 varchar(50) primary key, f2 text,f3 int)
-TABLESPACE ts1 STORAGE DISK engine=NDB;
-insert into test.t1 (f1,f2,f3)VALUES("111111","aaaaaa",1);
-insert into test.t1 (f1,f2,f3)VALUES("222222","bbbbbb",2);
-select * from test.t1 order by f1;
-select f1,f2 from test.t1 order by f2;
-select f2 from test.t1 order by f2;
-select f1,f2 from test.t1 order by f1;
-drop table test.t1;
-
-###################
-# Test Cleanup
-###################
-
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile.dat'
-ENGINE = NDB;
-
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile02.dat'
-ENGINE = NDB;
-
-DROP TABLESPACE ts1
-ENGINE = NDB;
-
-DROP LOGFILE GROUP lg1
-ENGINE =NDB;
-
-#End 5.1 test case
diff --git a/mysql-test/t/ndb_dd_ddl.test b/mysql-test/t/ndb_dd_ddl.test
deleted file mode 100644
index aa692385b07..00000000000
--- a/mysql-test/t/ndb_dd_ddl.test
+++ /dev/null
@@ -1,363 +0,0 @@
-#########################################
-# Author: JBM
-# Date: 2006-01-03
-# Purpose: Test the NDB engine reaction to duplicate
-# Table spaces and log groups. Also to test
-# Statement mixed case.
-############################################
-# Change Author:JBM
-# Change Date 2006-01-19
-# Change: Adding to test cases feedback from OB
-# 1) The 'duplicate' tests.
-# a) The test is using the default (test) database and is not
-# attempting to create databases (only logs, table spaces and
-# tables). Is this intentional?
-# b) What about a duplication of table name when one exists on disk and
-# you are trying to create it again in memory?
-#
-#2) 'CaSE SensiTiVE' tests
-# a) Suggest you include a test case where the case difference is in
-# the file name. I know this is not an issue for *nix systems but
-# will be when we expand to Windows and Mac. Better put it in now.
-############################################
-#
-# Jonas 2006-03-10
-# Add verification that ndb currently is limited to 1 logfile group
-#
-
-
--- source include/have_ndb.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
-DROP DATABASE IF EXISTS mysqltest;
-CREATE DATABASE mysqltest;
---enable_warnings
-
-############## Duplcate Statement Testing #########
-
---echo **** Begin Duplicate Statement Testing ****
-
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-INITIAL_SIZE 1M
-UNDO_BUFFER_SIZE = 1M
-ENGINE=NDB;
-
-# Verify that one currently can create only 1 logfile group
---error ER_CREATE_FILEGROUP_FAILED
-CREATE LOGFILE GROUP lg2
-ADD UNDOFILE 'undofile2.dat'
-INITIAL_SIZE 1M
-UNDO_BUFFER_SIZE 1M
-ENGINE NDB;
-SHOW WARNINGS;
-
---error ER_CREATE_FILEGROUP_FAILED
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-INITIAL_SIZE 1M
-UNDO_BUFFER_SIZE = 1M
-ENGINE=NDB;
-
-ALTER LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile02.dat'
-INITIAL_SIZE 1M ENGINE NDB;
-
---error ER_ALTER_FILEGROUP_FAILED
-ALTER LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile02.dat'
-INITIAL_SIZE 1M ENGINE=NDB;
-
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 1M
-ENGINE NDB;
-
---error ER_CREATE_FILEGROUP_FAILED
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 1M
-ENGINE NDB;
-
-
-ALTER TABLESPACE ts1
-ADD DATAFILE 'datafile2.dat'
-INITIAL_SIZE 1M
-ENGINE=NDB;
-
---error ER_ALTER_FILEGROUP_FAILED
-ALTER TABLESPACE ts1
-ADD DATAFILE 'datafile2.dat'
-INITIAL_SIZE 1M
-ENGINE=NDB;
-
-CREATE TABLE mysqltest.t1
-(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
-TABLESPACE ts1 STORAGE DISK
-ENGINE=NDB;
-
---error ER_TABLE_EXISTS_ERROR
-CREATE TABLE mysqltest.t1
-(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
-TABLESPACE ts1 STORAGE DISK
-ENGINE=NDB;
-
---error ER_TABLE_EXISTS_ERROR
-CREATE TABLE mysqltest.t1
-(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
-ENGINE=NDB;
-
-
-DROP TABLE mysqltest.t1;
-
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile2.dat'
-ENGINE=NDB;
-
---error ER_ALTER_FILEGROUP_FAILED
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile2.dat'
-ENGINE=NDB;
-
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile.dat'
-ENGINE=NDB;
-
---error ER_ALTER_FILEGROUP_FAILED
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile.dat'
-ENGINE=NDB;
-
-DROP TABLESPACE ts1
-ENGINE=NDB;
-
---error ER_DROP_FILEGROUP_FAILED
-DROP TABLESPACE ts1
-ENGINE=NDB;
-
-DROP LOGFILE GROUP lg1
-ENGINE=NDB;
-
---error ER_DROP_FILEGROUP_FAILED
-DROP LOGFILE GROUP lg1
-ENGINE=NDB;
-
-DROP DATABASE IF EXISTS mysqltest;
-
---echo **** End Duplicate Statement Testing ****
-############# End Duplicate Statments ############
---echo
-############ Begin CaSe Testing ##################
---echo **** Begin Statment CaSe Testing ****
-
-creaTE LOgfilE GrOuP lg1
-adD undoFILE 'undofile.dat'
-initiAL_siZE 1M
-UnDo_BuFfEr_SiZe = 1M
-ENGInE=NDb;
-
-altER LOgFiLE GrOUp lg1
-AdD UnDOfILe 'uNdOfiLe02.daT'
-INItIAl_SIzE 1M ENgINE nDB;
-
-CrEAtE TABLEspaCE ts1
-ADD DATAfilE 'datafile.dat'
-UsE LoGFiLE GRoUP lg1
-INITiaL_SizE 1M
-ENGiNe NDb;
-
-AlTeR tAbLeSpAcE ts1
-AdD DaTaFiLe 'dAtAfiLe2.daT'
-InItIaL_SiZe 1M
-EnGiNe=NDB;
-
-CREATE TABLE t1
-(pk1 int not null primary key, b int not null, c int not null)
-TABLEspace ts1 storAGE dISk
-ENGine nDb;
-
-DROP TABLE t1;
-
-AlteR TAblespaCE ts1
-droP DATAfile 'dAtAfiLe2.daT'
-ENGINE=NDB;
-
-ALter tablesPACE ts1
-dROp dAtAfIlE 'datafile.dat'
-ENGine=Ndb;
-
-DrOp TaBleSpAcE ts1
-engINE=ndB;
-
-DrOp lOgFiLe GrOuP lg1
-EnGiNe=nDb;
-
---echo **** End Statment CaSe Testing ****
-############ End CaSe Testing ##################
---echo
-############ Begin = and no = Testing ##########
---echo **** Begin = And No = Testing ****
-
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-INITIAL_SIZE=1M
-UNDO_BUFFER_SIZE=1M
-ENGINE=NDB;
-
-ALTER LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile02.dat'
-INITIAL_SIZE=1M
-ENGINE=NDB;
-
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE=1M
-ENGINE=NDB;
-
-ALTER TABLESPACE ts1
-ADD DATAFILE 'datafile2.dat'
-INITIAL_SIZE=1M
-ENGINE=NDB;
-
-CREATE TABLE t1
-(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
-TABLESPACE ts1 STORAGE DISK
-ENGINE=NDB;
-
-DROP TABLE t1;
-
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile2.dat'
-ENGINE=NDB;
-
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile.dat'
-ENGINE=NDB;
-
-DROP TABLESPACE ts1
-ENGINE=NDB;
-
-DROP LOGFILE GROUP lg1
-ENGINE=NDB;
-
---echo
---echo **** End of = ****
---echo
-
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-INITIAL_SIZE 1M
-UNDO_BUFFER_SIZE 1M
-ENGINE NDB;
-
-ALTER LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile02.dat'
-INITIAL_SIZE 1M
-ENGINE NDB;
-
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 1M
-ENGINE NDB;
-
-ALTER TABLESPACE ts1
-ADD DATAFILE 'datafile2.dat'
-INITIAL_SIZE 1M
-ENGINE NDB;
-
---error 1005
-CREATE TABLE t1
-(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
-TABLESPACE ts1 STORAGE MEMORY
-ENGINE NDB;
-
-CREATE TABLE t1
-(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
-TABLESPACE ts1 STORAGE DISK
-ENGINE NDB;
-
-
-CREATE INDEX b_i on t1(b);
-CREATE INDEX bc_i on t1(b, c);
-
-DROP TABLE t1;
-
-# bug#20053
-
-CREATE TABLESPACE ts2
-ADD DATAFILE 'datafile3.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 1M
-ENGINE NDB;
-
---error ER_ALTER_FILEGROUP_FAILED
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile3.dat'
-ENGINE NDB;
-
---error ER_ALTER_FILEGROUP_FAILED
-ALTER TABLESPACE ts2
-DROP DATAFILE 'datafile2.dat'
-ENGINE NDB;
-# bug#20053
-
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile2.dat'
-ENGINE NDB;
-
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile.dat'
-ENGINE NDB;
-
-DROP TABLESPACE ts1
-ENGINE NDB;
-
-ALTER TABLESPACE ts2
-DROP DATAFILE 'datafile3.dat'
-ENGINE NDB;
-
-DROP TABLESPACE ts2
-ENGINE NDB;
-
-DROP LOGFILE GROUP lg1
-ENGINE NDB;
-
---echo **** End = And No = ****
-############ End = And No = ##################
-
-###
-#
-# bug#16341
-create table t1 (a int primary key) engine = myisam;
-
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---error ER_CREATE_FILEGROUP_FAILED
---eval create logfile group lg1 add undofile '$MYSQLTEST_VARDIR/master-data/test/t1.frm' initial_size 1M undo_buffer_size = 1M engine=ndb;
-
-create logfile group lg1
-add undofile 'undofile.dat'
-initial_size 1M
-undo_buffer_size = 1M
-engine=ndb;
-
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---error ER_CREATE_FILEGROUP_FAILED
---eval create tablespace ts1 add datafile '$MYSQLTEST_VARDIR/master-data/test/t1.frm' use logfile group lg1 initial_size 1M engine ndb;
-
---error ER_DROP_FILEGROUP_FAILED
-drop tablespace ts1
-engine ndb;
-
-drop logfile group lg1
-engine ndb;
-
-drop table t1;
-
-
-
-# End 5.1 test
diff --git a/mysql-test/t/ndb_dd_dump.test b/mysql-test/t/ndb_dd_dump.test
deleted file mode 100644
index 38ceafb7d80..00000000000
--- a/mysql-test/t/ndb_dd_dump.test
+++ /dev/null
@@ -1,288 +0,0 @@
--- source include/have_ndb.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1, t2, t3;
---enable_warnings
-
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile_lg1_01.dat'
-INITIAL_SIZE 2M
-UNDO_BUFFER_SIZE = 1M
-ENGINE NDB;
-
-ALTER LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile_lg1_02.dat'
-INITIAL_SIZE = 4M
-ENGINE NDB;
-
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile_ts1_01.dat'
-USE LOGFILE GROUP lg1
-EXTENT_SIZE 1M
-INITIAL_SIZE 2M
-ENGINE NDB;
-
-ALTER TABLESPACE ts1
-ADD DATAFILE 'datafile_ts1_02.dat'
-INITIAL_SIZE = 1M
-ENGINE=NDB;
-
-CREATE TABLESPACE ts2
-ADD DATAFILE 'datafile_ts2_01.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 2M
-ENGINE NDB;
-
-CREATE TABLESPACE ts3
-ADD DATAFILE 'datafile_ts3_01.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 4M
-ENGINE NDB;
-
-########################################
-# Create a table using this tablespace
-########################################
-
-CREATE TABLE t1
-(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
-TABLESPACE ts1 STORAGE DISK
-ENGINE=NDB;
-
-CREATE TABLE t2
-(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
-TABLESPACE ts2 STORAGE DISK
-ENGINE=NDB;
-
-CREATE TABLE t3
-(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
-TABLESPACE ts3 STORAGE DISK
-ENGINE=NDB;
-
-INSERT INTO t1 VALUES
-(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
-(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10),
-(11,11,11),(12,12,12),(13,13,13),(14,14,14),(15,15,15),
-(16,16,16),(17,17,17),(18,18,18),(19,19,19),(20,20,20),
-(21,21,21),(22,22,22),(23,23,23),(24,24,24),(25,25,25),
-(26,26,26),(27,27,27),(28,28,28),(29,29,29),(30,30,30),
-(31,31,31),(32,32,32),(33,33,33),(34,34,34),(35,35,35),
-(36,36,36),(37,37,37),(38,38,38),(39,39,39),(40,40,40),
-(41,41,41),(42,42,42),(43,43,43),(44,44,44),(45,45,45),
-(46,46,46),(47,47,47),(48,48,48),(49,49,49),(50,50,50),
-(51,51,51),(52,52,52),(53,53,53),(54,54,54),(55,55,55),
-(56,56,56),(57,57,57),(58,58,58),(59,59,59),(60,60,60),
-(61,61,61),(62,62,62),(63,63,63),(64,64,64),(65,65,65),
-(66,66,66),(67,67,67),(68,68,68),(69,69,69),(70,70,70),
-(71,71,71),(72,72,72),(73,73,73),(74,74,74),(75,75,75),
-(76,76,76),(77,77,77),(78,78,78),(79,79,79),(80,80,80),
-(81,81,81),(82,82,82),(83,83,83),(84,84,84),(85,85,85),
-(86,86,86),(87,87,87),(88,88,88),(89,89,89),(90,90,90),
-(91,91,91),(92,92,92),(93,93,93),(94,94,94),(95,95,95),
-(96,96,96),(97,97,97),(98,98,98),(99,99,99),(100,100,100),
-(101,101,101),(102,102,102),(103,103,103),(104,104,104),(105,105,105),
-(106,106,106),(107,107,107),(108,108,108),(109,109,109),(110,110,110),
-(111,111,111),(112,112,112),(113,113,113),(114,114,114),(115,115,115),
-(116,116,116),(117,117,117),(118,118,118),(119,119,119),(120,120,120),
-(121,121,121),(122,122,122),(123,123,123),(124,124,124),(125,125,125),
-(126,126,126),(127,127,127),(128,128,128),(129,129,129),(130,130,130),
-(131,131,131),(132,132,132),(133,133,133),(134,134,134),(135,135,135),
-(136,136,136),(137,137,137),(138,138,138),(139,139,139),(140,140,140),
-(141,141,141),(142,142,142),(143,143,143),(144,144,144),(145,145,145),
-(146,146,146),(147,147,147),(148,148,148),(149,149,149),(150,150,150),
-(151,151,151),(152,152,152),(153,153,153),(154,154,154),(155,155,155),
-(156,156,156),(157,157,157),(158,158,158),(159,159,159),(160,160,160),
-(161,161,161),(162,162,162),(163,163,163),(164,164,164),(165,165,165),
-(166,166,166),(167,167,167),(168,168,168),(169,169,169),(170,170,170),
-(171,171,171),(172,172,172),(173,173,173),(174,174,174),(175,175,175),
-(176,176,176),(177,177,177),(178,178,178),(179,179,179),(180,180,180),
-(181,181,181),(182,182,182),(183,183,183),(184,184,184),(185,185,185),
-(186,186,186),(187,187,187),(188,188,188),(189,189,189),(190,190,190),
-(191,191,191),(192,192,192),(193,193,193),(194,194,194),(195,195,195),
-(196,196,196),(197,197,197),(198,198,198),(199,199,199),(200,200,200),
-(201,201,201),(202,202,202),(203,203,203),(204,204,204),(205,205,205),
-(206,206,206),(207,207,207),(208,208,208),(209,209,209),(210,210,210),
-(211,211,211),(212,212,212),(213,213,213),(214,214,214),(215,215,215),
-(216,216,216),(217,217,217),(218,218,218),(219,219,219),(220,220,220),
-(221,221,221),(222,222,222),(223,223,223),(224,224,224),(225,225,225),
-(226,226,226),(227,227,227),(228,228,228),(229,229,229),(230,230,230),
-(231,231,231),(232,232,232),(233,233,233),(234,234,234),(235,235,235),
-(236,236,236),(237,237,237),(238,238,238),(239,239,239),(240,240,240),
-(241,241,241),(242,242,242),(243,243,243),(244,244,244),(245,245,245),
-(246,246,246),(247,247,247),(248,248,248),(249,249,249),(250,250,250),
-(251,251,251),(252,252,252),(253,253,253),(254,254,254),(255,255,255),
-(256,256,256),(257,257,257),(258,258,258),(259,259,259),(260,260,260),
-(261,261,261),(262,262,262),(263,263,263),(264,264,264),(265,265,265),
-(266,266,266),(267,267,267),(268,268,268),(269,269,269),(270,270,270),
-(271,271,271),(272,272,272),(273,273,273),(274,274,274),(275,275,275),
-(276,276,276),(277,277,277),(278,278,278),(279,279,279),(280,280,280),
-(281,281,281),(282,282,282),(283,283,283),(284,284,284),(285,285,285),
-(286,286,286),(287,287,287),(288,288,288),(289,289,289),(290,290,290),
-(291,291,291),(292,292,292),(293,293,293),(294,294,294),(295,295,295),
-(296,296,296),(297,297,297),(298,298,298),(299,299,299),(300,300,300),
-(301,301,301),(302,302,302),(303,303,303),(304,304,304),(305,305,305),
-(306,306,306),(307,307,307),(308,308,308),(309,309,309),(310,310,310),
-(311,311,311),(312,312,312),(313,313,313),(314,314,314),(315,315,315),
-(316,316,316),(317,317,317),(318,318,318),(319,319,319),(320,320,320),
-(321,321,321),(322,322,322),(323,323,323),(324,324,324),(325,325,325),
-(326,326,326),(327,327,327),(328,328,328),(329,329,329),(330,330,330),
-(331,331,331),(332,332,332),(333,333,333),(334,334,334),(335,335,335),
-(336,336,336),(337,337,337),(338,338,338),(339,339,339),(340,340,340),
-(341,341,341),(342,342,342),(343,343,343),(344,344,344),(345,345,345),
-(346,346,346),(347,347,347),(348,348,348),(349,349,349),(350,350,350),
-(351,351,351),(352,352,352),(353,353,353),(354,354,354),(355,355,355),
-(356,356,356),(357,357,357),(358,358,358),(359,359,359),(360,360,360),
-(361,361,361),(362,362,362),(363,363,363),(364,364,364),(365,365,365),
-(366,366,366),(367,367,367),(368,368,368),(369,369,369),(370,370,370),
-(371,371,371),(372,372,372),(373,373,373),(374,374,374),(375,375,375),
-(376,376,376),(377,377,377),(378,378,378),(379,379,379),(380,380,380),
-(381,381,381),(382,382,382),(383,383,383),(384,384,384),(385,385,385),
-(386,386,386),(387,387,387),(388,388,388),(389,389,389),(390,390,390),
-(391,391,391),(392,392,392),(393,393,393),(394,394,394),(395,395,395),
-(396,396,396),(397,397,397),(398,398,398),(399,399,399),(400,400,400),
-(401,401,401),(402,402,402),(403,403,403),(404,404,404),(405,405,405),
-(406,406,406),(407,407,407),(408,408,408),(409,409,409),(410,410,410),
-(411,411,411),(412,412,412),(413,413,413),(414,414,414),(415,415,415),
-(416,416,416),(417,417,417),(418,418,418),(419,419,419),(420,420,420),
-(421,421,421),(422,422,422),(423,423,423),(424,424,424),(425,425,425),
-(426,426,426),(427,427,427),(428,428,428),(429,429,429),(430,430,430),
-(431,431,431),(432,432,432),(433,433,433),(434,434,434),(435,435,435),
-(436,436,436),(437,437,437),(438,438,438),(439,439,439),(440,440,440),
-(441,441,441),(442,442,442),(443,443,443),(444,444,444),(445,445,445),
-(446,446,446),(447,447,447),(448,448,448),(449,449,449),(450,450,450),
-(451,451,451),(452,452,452),(453,453,453),(454,454,454),(455,455,455),
-(456,456,456),(457,457,457),(458,458,458),(459,459,459),(460,460,460),
-(461,461,461),(462,462,462),(463,463,463),(464,464,464),(465,465,465),
-(466,466,466),(467,467,467),(468,468,468),(469,469,469),(470,470,470),
-(471,471,471),(472,472,472),(473,473,473),(474,474,474),(475,475,475),
-(476,476,476),(477,477,477),(478,478,478),(479,479,479),(480,480,480),
-(481,481,481),(482,482,482),(483,483,483),(484,484,484),(485,485,485),
-(486,486,486),(487,487,487),(488,488,488),(489,489,489),(490,490,490),
-(491,491,491),(492,492,492),(493,493,493),(494,494,494),(495,495,495),
-(496,496,496),(497,497,497),(498,498,498),(499,499,499),(500, 500, 500);
-
-INSERT INTO t2 VALUES
-(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5);
-
-INSERT INTO t3 VALUES
-(1,1,1);
-
---exec $MYSQL_DUMP --skip-comments --compact -Y test > $MYSQLTEST_VARDIR/tmp/ndb_dd_dump.sql
-
-DROP TABLE t1;
-DROP TABLE t2;
-DROP TABLE t3;
-
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile_ts1_01.dat'
-ENGINE = NDB;
-
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile_ts1_02.dat'
-ENGINE = NDB;
-
-ALTER TABLESPACE ts2
-DROP DATAFILE 'datafile_ts2_01.dat'
-ENGINE = NDB;
-
-ALTER TABLESPACE ts3
-DROP DATAFILE 'datafile_ts3_01.dat'
-ENGINE = NDB;
-
-DROP TABLESPACE ts1 ENGINE = NDB;
-DROP TABLESPACE ts2 ENGINE = NDB;
-DROP TABLESPACE ts3 ENGINE = NDB;
-
-DROP LOGFILE GROUP lg1 ENGINE = NDB;
-
---exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ndb_dd_dump.sql
-
-SELECT DISTINCT
- LOGFILE_GROUP_NAME,
- FILE_NAME,
- TOTAL_EXTENTS,
- INITIAL_SIZE,
- ENGINE
-FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE="UNDO LOG" ORDER BY FILE_NAME;
-
-SELECT DISTINCT
- TABLESPACE_NAME,
- LOGFILE_GROUP_NAME,
- FILE_NAME,
- EXTENT_SIZE,
- INITIAL_SIZE,
- ENGINE
-FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE="DATAFILE" ORDER BY FILE_NAME;
-
-SELECT COUNT(*) FROM t1;
-SELECT COUNT(*) FROM t2;
-SELECT COUNT(*) FROM t3;
-
-DROP TABLE t1;
-DROP TABLE t2;
-DROP TABLE t3;
-
-#### BUG 18856 test case comented out
-##### Use "SELECT * INTO OUTFILE" to dump data and "LOAD DATA INFILE" to load ##### data back to the data file.
-
-#CREATE TABLE test.t (
-# a smallint NOT NULL,
-# b int NOT NULL,
-# c bigint NOT NULL,
-# d char(10),
-# e TEXT,
-# f VARCHAR(255),
-# PRIMARY KEY(a)
-#) TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
-
-# ALTER TABLE test.t ADD INDEX (d), ADD INDEX (f);
-# SHOW CREATE TABLE test.t;
-
-# insert records into tables
-
-# let $1=100;
-# disable_query_log;
-# while ($1)
-# {
-# eval insert into test.t values($1, $1+1, $1+2, "aaa$1", "bbb$1", "ccccc$1");
-# dec $1;
-# }
-# enable_query_log;
-
-# SELECT * FROM test.t order by a;
-
-# SELECT * INTO OUTFILE 't_backup' FROM test.t;
-# TRUNCATE test.t;
-
-#'TRUNCATE test.t' failed: 1205: Lock wait timeout exceeded; try restarting #transaction. TABLESPACE ts STORAGE DISK ENGINE=NDB;
-
-# SELECT count(*) FROM test.t;
-# LOAD DATA INFILE 't_backup' INTO TABLE test.t;
-
-# SELECT * FROM test.t order by a;
-
-# DROP TABLE test.t;
-
-
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile_ts1_01.dat'
-ENGINE = NDB;
-
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile_ts1_02.dat'
-ENGINE = NDB;
-
-ALTER TABLESPACE ts2
-DROP DATAFILE 'datafile_ts2_01.dat'
-ENGINE = NDB;
-
-ALTER TABLESPACE ts3
-DROP DATAFILE 'datafile_ts3_01.dat'
-ENGINE = NDB;
-
-DROP TABLESPACE ts1 ENGINE = NDB;
-DROP TABLESPACE ts2 ENGINE = NDB;
-DROP TABLESPACE ts3 ENGINE = NDB;
-
-DROP LOGFILE GROUP lg1 ENGINE = NDB;
-
-#End 5.1 test case
diff --git a/mysql-test/t/ndb_index_unique.test b/mysql-test/t/ndb_index_unique.test
deleted file mode 100644
index e6d3fbb87a0..00000000000
--- a/mysql-test/t/ndb_index_unique.test
+++ /dev/null
@@ -1,361 +0,0 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-drop table if exists t1, t2, t3, t4, t5, t6, t7, t8;
---enable_warnings
-
-#
-# Simple test to show use of UNIQUE indexes
-#
-
-CREATE TABLE t1 (
- a int NOT NULL PRIMARY KEY,
- b int not null,
- c int,
- UNIQUE ib(b)
-) engine=ndbcluster;
-
-insert t1 values(1, 2, 3), (2, 3, 5), (3, 4, 6), (4, 5, 8), (5,6, 2), (6,7, 2);
-select * from t1 order by b;
-select * from t1 where b = 4 order by b;
-insert into t1 values(7,8,3);
-select * from t1 where b = 4 order by a;
-
--- error ER_DUP_ENTRY_WITH_KEY_NAME
-insert into t1 values(8, 2, 3);
-select * from t1 order by a;
-delete from t1 where a = 1;
-insert into t1 values(8, 2, 3);
-select * from t1 order by a;
-
-alter table t1 drop index ib;
-insert into t1 values(1, 2, 3);
-# Bug# #18129
---error 1169
-create unique index ib on t1(b);
-
-drop table t1;
-
-#
-# Indexing NULL values
-#
-
-CREATE TABLE t1 (
- a int unsigned NOT NULL PRIMARY KEY,
- b int unsigned,
- c int unsigned,
- UNIQUE bc(b,c)
-) engine = ndb;
-
-insert into t1 values(1,1,1),(2,NULL,2),(3,NULL,NULL),(4,4,NULL);
-select * from t1 use index (bc) where b IS NULL order by a;
-
-select * from t1 use index (bc)order by a;
-select * from t1 use index (bc) order by a;
-select * from t1 use index (PRIMARY) where b IS NULL order by a;
-select * from t1 use index (bc) where b IS NULL order by a;
-select * from t1 use index (bc) where b IS NULL and c IS NULL order by a;
-select * from t1 use index (bc) where b IS NULL and c = 2 order by a;
-select * from t1 use index (bc) where b < 4 order by a;
-select * from t1 use index (bc) where b IS NOT NULL order by a;
--- error ER_DUP_ENTRY_WITH_KEY_NAME
-insert into t1 values(5,1,1);
-drop table t1;
-
-
-#
-# Show use of UNIQUE USING HASH indexes
-#
-
-CREATE TABLE t2 (
- a int unsigned NOT NULL PRIMARY KEY,
- b int unsigned not null,
- c int unsigned not null,
- UNIQUE (b, c) USING HASH
-) engine=ndbcluster;
-
-insert t2 values(1, 2, 3), (2, 3, 5), (3, 4, 6), (4, 5, 8), (5,6, 2), (6,7, 2);
-select * from t2 where a = 3;
-select * from t2 where b = 4;
-select * from t2 where c = 6;
-insert into t2 values(7,8,3);
-select * from t2 where b = 4 order by a;
-
--- error ER_DUP_ENTRY_WITH_KEY_NAME
-insert into t2 values(8, 2, 3);
-select * from t2 order by a;
-delete from t2 where a = 1;
-insert into t2 values(8, 2, 3);
-select * from t2 order by a;
-
-# Bug #24818 CREATE UNIQUE INDEX (...) USING HASH on a NDB table crashes mysqld
-create unique index bi using hash on t2(b);
--- error ER_DUP_ENTRY_WITH_KEY_NAME
-insert into t2 values(9, 3, 1);
-alter table t2 drop index bi;
-insert into t2 values(9, 3, 1);
-select * from t2 order by a;
-
-drop table t2;
-
-CREATE TABLE t2 (
- a int unsigned NOT NULL PRIMARY KEY,
- b int unsigned not null,
- c int unsigned,
- UNIQUE (b, c) USING HASH
-) engine=ndbcluster;
-
-
-insert t2 values(1,1,NULL),(2,2,2),(3,3,NULL),(4,4,4),(5,5,NULL),(6,6,6),(7,7,NULL),(8,3,NULL),(9,3,NULL);
-
-select * from t2 where c IS NULL order by a;
-select * from t2 where b = 3 AND c IS NULL order by a;
-select * from t2 where (b = 3 OR b = 5) AND c IS NULL order by a;
-set @old_ecpd = @@session.engine_condition_pushdown;
-set engine_condition_pushdown = true;
-explain select * from t2 where (b = 3 OR b = 5) AND c IS NULL AND a < 9 order by a;
-select * from t2 where (b = 3 OR b = 5) AND c IS NULL AND a < 9 order by a;
-set engine_condition_pushdown = @old_ecpd;
-
-drop table t2;
-
-#
-# Show use of PRIMARY KEY USING HASH indexes
-#
-
-CREATE TABLE t3 (
- a int unsigned NOT NULL,
- b int unsigned not null,
- c int unsigned,
- PRIMARY KEY (a, b) USING HASH
-) engine=ndbcluster;
-
-insert t3 values(1, 2, 3), (2, 3, 5), (3, 4, 6), (4, 5, 8), (5,6, 2), (6,7, 2);
-select * from t3 where a = 3;
-select * from t3 where b = 4;
-select * from t3 where c = 6;
-insert into t3 values(7,8,3);
-select * from t3 where b = 4 order by a;
-
-drop table t3;
-
-#
-# Indexes on NULL-able columns
-#
-
-CREATE TABLE t1 (
- pk int NOT NULL PRIMARY KEY,
- a int unsigned,
- UNIQUE KEY (a)
-) engine=ndbcluster;
-
-insert into t1 values (-1,NULL), (0,0), (1,NULL),(2,2),(3,NULL),(4,4);
-
-select * from t1 order by pk;
-
---error ER_DUP_ENTRY_WITH_KEY_NAME
-insert into t1 values (5,0);
-select * from t1 order by pk;
-delete from t1 where a = 0;
-insert into t1 values (5,0);
-select * from t1 order by pk;
-
-CREATE TABLE t2 (
- pk int NOT NULL PRIMARY KEY,
- a int unsigned,
- b tinyint NOT NULL,
- c VARCHAR(10),
- UNIQUE KEY si(a, c)
-) engine=ndbcluster;
-
-insert into t2 values (-1,1,17,NULL),(0,NULL,18,NULL),(1,3,19,'abc');
-
-select * from t2 order by pk;
-
---error ER_DUP_ENTRY_WITH_KEY_NAME
-insert into t2 values(2,3,19,'abc');
-select * from t2 order by pk;
-delete from t2 where c IS NOT NULL;
-insert into t2 values(2,3,19,'abc');
-select * from t2 order by pk;
-
-drop table t1, t2;
-
-#
-# More complex tables
-#
-
-CREATE TABLE t1 (
- cid smallint(5) unsigned NOT NULL default '0',
- cv varchar(250) NOT NULL default '',
- PRIMARY KEY (cid),
- UNIQUE KEY cv (cv)
-) engine=ndbcluster;
-INSERT INTO t1 VALUES (8,'dummy');
-CREATE TABLE t2 (
- cid bigint(20) unsigned NOT NULL auto_increment,
- cap varchar(255) NOT NULL default '',
- PRIMARY KEY (cid),
- UNIQUE KEY (cid, cap)
-) engine=ndbcluster;
-INSERT INTO t2 VALUES (NULL,'another dummy');
-CREATE TABLE t3 (
- gid bigint(20) unsigned NOT NULL auto_increment,
- gn varchar(255) NOT NULL default '',
- must tinyint(4) default NULL,
- PRIMARY KEY (gid)
-) engine=ndbcluster;
-INSERT INTO t3 VALUES (1,'V1',NULL);
-CREATE TABLE t4 (
- uid bigint(20) unsigned NOT NULL default '0',
- gid bigint(20) unsigned NOT NULL,
- rid bigint(20) unsigned NOT NULL,
- cid bigint(20) unsigned NOT NULL,
- UNIQUE KEY m (uid,gid,rid,cid)
-) engine=ndbcluster;
-INSERT INTO t4 VALUES (1,1,2,4);
-INSERT INTO t4 VALUES (1,1,2,3);
-INSERT INTO t4 VALUES (1,1,5,7);
-INSERT INTO t4 VALUES (1,1,10,8);
-CREATE TABLE t5 (
- rid bigint(20) unsigned NOT NULL auto_increment,
- rl varchar(255) NOT NULL default '',
- PRIMARY KEY (rid)
-) engine=ndbcluster;
-CREATE TABLE t6 (
- uid bigint(20) unsigned NOT NULL auto_increment,
- un varchar(250) NOT NULL default '',
- uc smallint(5) unsigned NOT NULL default '0',
- PRIMARY KEY (uid),
- UNIQUE KEY nc (un,uc)
-) engine=ndbcluster;
-INSERT INTO t6 VALUES (1,'test',8);
-INSERT INTO t6 VALUES (2,'test2',9);
-INSERT INTO t6 VALUES (3,'tre',3);
-CREATE TABLE t7 (
- mid bigint(20) unsigned NOT NULL PRIMARY KEY,
- uid bigint(20) unsigned NOT NULL default '0',
- gid bigint(20) unsigned NOT NULL,
- rid bigint(20) unsigned NOT NULL,
- cid bigint(20) unsigned NOT NULL,
- UNIQUE KEY m (uid,gid,rid,cid)
-) engine=ndbcluster;
-INSERT INTO t7 VALUES(1, 1, 1, 1, 1);
-INSERT INTO t7 VALUES(2, 2, 1, 1, 1);
-INSERT INTO t7 VALUES(3, 3, 1, 1, 1);
-INSERT INTO t7 VALUES(4, 4, 1, 1, 1);
-INSERT INTO t7 VALUES(5, 5, 1, 1, 1);
-INSERT INTO t7 VALUES(6, 1, 1, 1, 6);
-INSERT INTO t7 VALUES(7, 2, 1, 1, 7);
-INSERT INTO t7 VALUES(8, 3, 1, 1, 8);
-INSERT INTO t7 VALUES(9, 4, 1, 1, 9);
-INSERT INTO t7 VALUES(10, 5, 1, 1, 10);
-
-select * from t1 where cv = 'dummy';
-select * from t1 where cv = 'test';
-select * from t2 where cap = 'another dummy';
-select * from t4 where uid = 1 and gid=1 and rid=2 and cid=4;
-select * from t4 where uid = 1 and gid=1 and rid=1 and cid=4;
-select * from t4 where uid = 1 order by cid;
-select * from t4 where rid = 2 order by cid;
-select * from t6 where un='test' and uc=8;
-select * from t6 where un='test' and uc=7;
-select * from t6 where un='test';
-select * from t7 where mid = 8;
-select * from t7 where uid = 8;
-select * from t7 where uid = 1 order by mid;
-select * from t7 where uid = 4 order by mid;
-select * from t7 where gid = 4;
-select * from t7 where gid = 1 order by mid;
-select * from t7 where cid = 4;
-select * from t7 where cid = 8;
-
-#
-# insert more records into t4
-#
-let $1=100;
-disable_query_log;
-while ($1)
-{
- eval insert into t4 values(1, $1, 5, 12);
- eval insert into t4 values($1, 3, 9, 11);
- dec $1;
-}
-enable_query_log;
-
-select * from t4 where uid = 1 and gid=1 and rid=2 and cid=4;
-select * from t4 where uid = 1 and gid=1 and rid=1 and cid=4;
-select * from t4 where uid = 1 order by gid,cid;
-select * from t4 where uid = 1 order by gid,cid;
-select * from t4 where rid = 2 order by cid;
-
-
-drop table t1,t2,t3,t4,t5,t6,t7;
-
-# test null in indexes
-CREATE TABLE t1 (
- a int unsigned NOT NULL PRIMARY KEY,
- b int unsigned,
- c int unsigned,
- UNIQUE bc(b,c) ) engine = ndb;
-
-insert into t1 values(1,1,1),(2,NULL,2),(3,NULL,NULL),(4,4,NULL);
-select * from t1 where b=1 and c=1;
-select * from t1 where b is null and c is null;
-select * from t1 where b is null and c = 2;
-select * from t1 where b = 4 and c is null;
-create table t8 as
-select * from t1 where (b = 1 and c = 1)
- or (b is null and c is null)
- or (b is null and c = 2)
- or (b = 4 and c is null);
-select * from t8 order by a;
-select * from t1 order by a;
-drop table t1, t8;
-
-###############################
-# Bug 8101
-#
-# Unique index not specified in the same order as in table
-#
-
-create table t1(
- id integer not null auto_increment,
- month integer not null,
- year integer not null,
- code varchar( 2) not null,
- primary key ( id),
- unique idx_t1( month, code, year)
-) engine=ndb;
-
-INSERT INTO t1 (month, year, code) VALUES (4,2004,'12');
-INSERT INTO t1 (month, year, code) VALUES (5,2004,'12');
-
-select * from t1 where code = '12' and month = 4 and year = 2004 ;
-
-drop table t1;
-
-# bug#15918 Unique Key Limit in NDB Engine
-
-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));
---error ER_DUP_ENTRY_WITH_KEY_NAME
-insert into t1 values (2, repeat(_utf8 0xe288ab6474, 200));
-select a, sha1(b) from t1;
-
-# perl -e 'print pack("H2000","e288ab6474"x200)' | sha1sum
-
-drop table t1;
-
-# bug#21873 MySQLD Crash on ALTER...ADD..UNIQUE..USING HASH statement for NDB backed table
-
-create table t1(id int not null) engine = NDB;
-
-alter table t1 add constraint uk_test unique (id) using hash;
-
-drop table t1;
-
-# End of 4.1 tests
diff --git a/mysql-test/t/ndb_insert.test b/mysql-test/t/ndb_insert.test
deleted file mode 100644
index 092bebe2a37..00000000000
--- a/mysql-test/t/ndb_insert.test
+++ /dev/null
@@ -1,642 +0,0 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-#
-# Basic test of INSERT in NDB
-#
-
-#
-# Create a normal table with primary key
-#
-CREATE TABLE t1 (
- pk1 INT NOT NULL PRIMARY KEY,
- b INT NOT NULL,
- c INT NOT NULL
-) ENGINE=ndbcluster;
-
-INSERT INTO t1 VALUES (0, 0, 0);
-SELECT * FROM t1;
-
-INSERT INTO t1 VALUES
-(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
-(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10),
-(11,11,11),(12,12,12),(13,13,13),(14,14,14),(15,15,15),
-(16,16,16),(17,17,17),(18,18,18),(19,19,19),(20,20,20),
-(21,21,21),(22,22,22),(23,23,23),(24,24,24),(25,25,25),
-(26,26,26),(27,27,27),(28,28,28),(29,29,29),(30,30,30),
-(31,31,31),(32,32,32),(33,33,33),(34,34,34),(35,35,35),
-(36,36,36),(37,37,37),(38,38,38),(39,39,39),(40,40,40),
-(41,41,41),(42,42,42),(43,43,43),(44,44,44),(45,45,45),
-(46,46,46),(47,47,47),(48,48,48),(49,49,49),(50,50,50),
-(51,51,51),(52,52,52),(53,53,53),(54,54,54),(55,55,55),
-(56,56,56),(57,57,57),(58,58,58),(59,59,59),(60,60,60),
-(61,61,61),(62,62,62),(63,63,63),(64,64,64),(65,65,65),
-(66,66,66),(67,67,67),(68,68,68),(69,69,69),(70,70,70),
-(71,71,71),(72,72,72),(73,73,73),(74,74,74),(75,75,75),
-(76,76,76),(77,77,77),(78,78,78),(79,79,79),(80,80,80),
-(81,81,81),(82,82,82),(83,83,83),(84,84,84),(85,85,85),
-(86,86,86),(87,87,87),(88,88,88),(89,89,89),(90,90,90),
-(91,91,91),(92,92,92),(93,93,93),(94,94,94),(95,95,95),
-(96,96,96),(97,97,97),(98,98,98),(99,99,99),(100,100,100),
-(101,101,101),(102,102,102),(103,103,103),(104,104,104),(105,105,105),
-(106,106,106),(107,107,107),(108,108,108),(109,109,109),(110,110,110),
-(111,111,111),(112,112,112),(113,113,113),(114,114,114),(115,115,115),
-(116,116,116),(117,117,117),(118,118,118),(119,119,119),(120,120,120),
-(121,121,121),(122,122,122),(123,123,123),(124,124,124),(125,125,125),
-(126,126,126),(127,127,127),(128,128,128),(129,129,129),(130,130,130),
-(131,131,131),(132,132,132),(133,133,133),(134,134,134),(135,135,135),
-(136,136,136),(137,137,137),(138,138,138),(139,139,139),(140,140,140),
-(141,141,141),(142,142,142),(143,143,143),(144,144,144),(145,145,145),
-(146,146,146),(147,147,147),(148,148,148),(149,149,149),(150,150,150),
-(151,151,151),(152,152,152),(153,153,153),(154,154,154),(155,155,155),
-(156,156,156),(157,157,157),(158,158,158),(159,159,159),(160,160,160),
-(161,161,161),(162,162,162),(163,163,163),(164,164,164),(165,165,165),
-(166,166,166),(167,167,167),(168,168,168),(169,169,169),(170,170,170),
-(171,171,171),(172,172,172),(173,173,173),(174,174,174),(175,175,175),
-(176,176,176),(177,177,177),(178,178,178),(179,179,179),(180,180,180),
-(181,181,181),(182,182,182),(183,183,183),(184,184,184),(185,185,185),
-(186,186,186),(187,187,187),(188,188,188),(189,189,189),(190,190,190),
-(191,191,191),(192,192,192),(193,193,193),(194,194,194),(195,195,195),
-(196,196,196),(197,197,197),(198,198,198),(199,199,199),(200,200,200),
-(201,201,201),(202,202,202),(203,203,203),(204,204,204),(205,205,205),
-(206,206,206),(207,207,207),(208,208,208),(209,209,209),(210,210,210),
-(211,211,211),(212,212,212),(213,213,213),(214,214,214),(215,215,215),
-(216,216,216),(217,217,217),(218,218,218),(219,219,219),(220,220,220),
-(221,221,221),(222,222,222),(223,223,223),(224,224,224),(225,225,225),
-(226,226,226),(227,227,227),(228,228,228),(229,229,229),(230,230,230),
-(231,231,231),(232,232,232),(233,233,233),(234,234,234),(235,235,235),
-(236,236,236),(237,237,237),(238,238,238),(239,239,239),(240,240,240),
-(241,241,241),(242,242,242),(243,243,243),(244,244,244),(245,245,245),
-(246,246,246),(247,247,247),(248,248,248),(249,249,249),(250,250,250),
-(251,251,251),(252,252,252),(253,253,253),(254,254,254),(255,255,255),
-(256,256,256),(257,257,257),(258,258,258),(259,259,259),(260,260,260),
-(261,261,261),(262,262,262),(263,263,263),(264,264,264),(265,265,265),
-(266,266,266),(267,267,267),(268,268,268),(269,269,269),(270,270,270),
-(271,271,271),(272,272,272),(273,273,273),(274,274,274),(275,275,275),
-(276,276,276),(277,277,277),(278,278,278),(279,279,279),(280,280,280),
-(281,281,281),(282,282,282),(283,283,283),(284,284,284),(285,285,285),
-(286,286,286),(287,287,287),(288,288,288),(289,289,289),(290,290,290),
-(291,291,291),(292,292,292),(293,293,293),(294,294,294),(295,295,295),
-(296,296,296),(297,297,297),(298,298,298),(299,299,299),(300,300,300),
-(301,301,301),(302,302,302),(303,303,303),(304,304,304),(305,305,305),
-(306,306,306),(307,307,307),(308,308,308),(309,309,309),(310,310,310),
-(311,311,311),(312,312,312),(313,313,313),(314,314,314),(315,315,315),
-(316,316,316),(317,317,317),(318,318,318),(319,319,319),(320,320,320),
-(321,321,321),(322,322,322),(323,323,323),(324,324,324),(325,325,325),
-(326,326,326),(327,327,327),(328,328,328),(329,329,329),(330,330,330),
-(331,331,331),(332,332,332),(333,333,333),(334,334,334),(335,335,335),
-(336,336,336),(337,337,337),(338,338,338),(339,339,339),(340,340,340),
-(341,341,341),(342,342,342),(343,343,343),(344,344,344),(345,345,345),
-(346,346,346),(347,347,347),(348,348,348),(349,349,349),(350,350,350),
-(351,351,351),(352,352,352),(353,353,353),(354,354,354),(355,355,355),
-(356,356,356),(357,357,357),(358,358,358),(359,359,359),(360,360,360),
-(361,361,361),(362,362,362),(363,363,363),(364,364,364),(365,365,365),
-(366,366,366),(367,367,367),(368,368,368),(369,369,369),(370,370,370),
-(371,371,371),(372,372,372),(373,373,373),(374,374,374),(375,375,375),
-(376,376,376),(377,377,377),(378,378,378),(379,379,379),(380,380,380),
-(381,381,381),(382,382,382),(383,383,383),(384,384,384),(385,385,385),
-(386,386,386),(387,387,387),(388,388,388),(389,389,389),(390,390,390),
-(391,391,391),(392,392,392),(393,393,393),(394,394,394),(395,395,395),
-(396,396,396),(397,397,397),(398,398,398),(399,399,399),(400,400,400),
-(401,401,401),(402,402,402),(403,403,403),(404,404,404),(405,405,405),
-(406,406,406),(407,407,407),(408,408,408),(409,409,409),(410,410,410),
-(411,411,411),(412,412,412),(413,413,413),(414,414,414),(415,415,415),
-(416,416,416),(417,417,417),(418,418,418),(419,419,419),(420,420,420),
-(421,421,421),(422,422,422),(423,423,423),(424,424,424),(425,425,425),
-(426,426,426),(427,427,427),(428,428,428),(429,429,429),(430,430,430),
-(431,431,431),(432,432,432),(433,433,433),(434,434,434),(435,435,435),
-(436,436,436),(437,437,437),(438,438,438),(439,439,439),(440,440,440),
-(441,441,441),(442,442,442),(443,443,443),(444,444,444),(445,445,445),
-(446,446,446),(447,447,447),(448,448,448),(449,449,449),(450,450,450),
-(451,451,451),(452,452,452),(453,453,453),(454,454,454),(455,455,455),
-(456,456,456),(457,457,457),(458,458,458),(459,459,459),(460,460,460),
-(461,461,461),(462,462,462),(463,463,463),(464,464,464),(465,465,465),
-(466,466,466),(467,467,467),(468,468,468),(469,469,469),(470,470,470),
-(471,471,471),(472,472,472),(473,473,473),(474,474,474),(475,475,475),
-(476,476,476),(477,477,477),(478,478,478),(479,479,479),(480,480,480),
-(481,481,481),(482,482,482),(483,483,483),(484,484,484),(485,485,485),
-(486,486,486),(487,487,487),(488,488,488),(489,489,489),(490,490,490),
-(491,491,491),(492,492,492),(493,493,493),(494,494,494),(495,495,495),
-(496,496,496),(497,497,497),(498,498,498),(499,499,499),(500, 500, 500);
-
-SELECT COUNT(*) FROM t1;
-
-INSERT INTO t1 VALUES
-(501,501,501),(502,502,502),(503,503,503),(504,504,504),(505,505,505),
-(506,506,506),(507,507,507),(508,508,508),(509,509,509),(510,510,510),
-(511,511,511),(512,512,512),(513,513,513),(514,514,514),(515,515,515),
-(516,516,516),(517,517,517),(518,518,518),(519,519,519),(520,520,520),
-(521,521,521),(522,522,522),(523,523,523),(524,524,524),(525,525,525),
-(526,526,526),(527,527,527),(528,528,528),(529,529,529),(530,530,530),
-(531,531,531),(532,532,532),(533,533,533),(534,534,534),(535,535,535),
-(536,536,536),(537,537,537),(538,538,538),(539,539,539),(540,540,540),
-(541,541,541),(542,542,542),(543,543,543),(544,544,544),(545,545,545),
-(546,546,546),(547,547,547),(548,548,548),(549,549,549),(550,550,550),
-(551,551,551),(552,552,552),(553,553,553),(554,554,554),(555,555,555),
-(556,556,556),(557,557,557),(558,558,558),(559,559,559),(560,560,560),
-(561,561,561),(562,562,562),(563,563,563),(564,564,564),(565,565,565),
-(566,566,566),(567,567,567),(568,568,568),(569,569,569),(570,570,570),
-(571,571,571),(572,572,572),(573,573,573),(574,574,574),(575,575,575),
-(576,576,576),(577,577,577),(578,578,578),(579,579,579),(580,580,580),
-(581,581,581),(582,582,582),(583,583,583),(584,584,584),(585,585,585),
-(586,586,586),(587,587,587),(588,588,588),(589,589,589),(590,590,590),
-(591,591,591),(592,592,592),(593,593,593),(594,594,594),(595,595,595),
-(596,596,596),(597,597,597),(598,598,598),(599,599,599),(600,600,600),
-(601,601,601),(602,602,602),(603,603,603),(604,604,604),(605,605,605),
-(606,606,606),(607,607,607),(608,608,608),(609,609,609),(610,610,610),
-(611,611,611),(612,612,612),(613,613,613),(614,614,614),(615,615,615),
-(616,616,616),(617,617,617),(618,618,618),(619,619,619),(620,620,620),
-(621,621,621),(622,622,622),(623,623,623),(624,624,624),(625,625,625),
-(626,626,626),(627,627,627),(628,628,628),(629,629,629),(630,630,630),
-(631,631,631),(632,632,632),(633,633,633),(634,634,634),(635,635,635),
-(636,636,636),(637,637,637),(638,638,638),(639,639,639),(640,640,640),
-(641,641,641),(642,642,642),(643,643,643),(644,644,644),(645,645,645),
-(646,646,646),(647,647,647),(648,648,648),(649,649,649),(650,650,650),
-(651,651,651),(652,652,652),(653,653,653),(654,654,654),(655,655,655),
-(656,656,656),(657,657,657),(658,658,658),(659,659,659),(660,660,660),
-(661,661,661),(662,662,662),(663,663,663),(664,664,664),(665,665,665),
-(666,666,666),(667,667,667),(668,668,668),(669,669,669),(670,670,670),
-(671,671,671),(672,672,672),(673,673,673),(674,674,674),(675,675,675),
-(676,676,676),(677,677,677),(678,678,678),(679,679,679),(680,680,680),
-(681,681,681),(682,682,682),(683,683,683),(684,684,684),(685,685,685),
-(686,686,686),(687,687,687),(688,688,688),(689,689,689),(690,690,690),
-(691,691,691),(692,692,692),(693,693,693),(694,694,694),(695,695,695),
-(696,696,696),(697,697,697),(698,698,698),(699,699,699),(700,700,700),
-(701,701,701),(702,702,702),(703,703,703),(704,704,704),(705,705,705),
-(706,706,706),(707,707,707),(708,708,708),(709,709,709),(710,710,710),
-(711,711,711),(712,712,712),(713,713,713),(714,714,714),(715,715,715),
-(716,716,716),(717,717,717),(718,718,718),(719,719,719),(720,720,720),
-(721,721,721),(722,722,722),(723,723,723),(724,724,724),(725,725,725),
-(726,726,726),(727,727,727),(728,728,728),(729,729,729),(730,730,730),
-(731,731,731),(732,732,732),(733,733,733),(734,734,734),(735,735,735),
-(736,736,736),(737,737,737),(738,738,738),(739,739,739),(740,740,740),
-(741,741,741),(742,742,742),(743,743,743),(744,744,744),(745,745,745),
-(746,746,746),(747,747,747),(748,748,748),(749,749,749),(750,750,750),
-(751,751,751),(752,752,752),(753,753,753),(754,754,754),(755,755,755),
-(756,756,756),(757,757,757),(758,758,758),(759,759,759),(760,760,760),
-(761,761,761),(762,762,762),(763,763,763),(764,764,764),(765,765,765),
-(766,766,766),(767,767,767),(768,768,768),(769,769,769),(770,770,770),
-(771,771,771),(772,772,772),(773,773,773),(774,774,774),(775,775,775),
-(776,776,776),(777,777,777),(778,778,778),(779,779,779),(780,780,780),
-(781,781,781),(782,782,782),(783,783,783),(784,784,784),(785,785,785),
-(786,786,786),(787,787,787),(788,788,788),(789,789,789),(790,790,790),
-(791,791,791),(792,792,792),(793,793,793),(794,794,794),(795,795,795),
-(796,796,796),(797,797,797),(798,798,798),(799,799,799),(800,800,800),
-(801,801,801),(802,802,802),(803,803,803),(804,804,804),(805,805,805),
-(806,806,806),(807,807,807),(808,808,808),(809,809,809),(810,810,810),
-(811,811,811),(812,812,812),(813,813,813),(814,814,814),(815,815,815),
-(816,816,816),(817,817,817),(818,818,818),(819,819,819),(820,820,820),
-(821,821,821),(822,822,822),(823,823,823),(824,824,824),(825,825,825),
-(826,826,826),(827,827,827),(828,828,828),(829,829,829),(830,830,830),
-(831,831,831),(832,832,832),(833,833,833),(834,834,834),(835,835,835),
-(836,836,836),(837,837,837),(838,838,838),(839,839,839),(840,840,840),
-(841,841,841),(842,842,842),(843,843,843),(844,844,844),(845,845,845),
-(846,846,846),(847,847,847),(848,848,848),(849,849,849),(850,850,850),
-(851,851,851),(852,852,852),(853,853,853),(854,854,854),(855,855,855),
-(856,856,856),(857,857,857),(858,858,858),(859,859,859),(860,860,860),
-(861,861,861),(862,862,862),(863,863,863),(864,864,864),(865,865,865),
-(866,866,866),(867,867,867),(868,868,868),(869,869,869),(870,870,870),
-(871,871,871),(872,872,872),(873,873,873),(874,874,874),(875,875,875),
-(876,876,876),(877,877,877),(878,878,878),(879,879,879),(880,880,880),
-(881,881,881),(882,882,882),(883,883,883),(884,884,884),(885,885,885),
-(886,886,886),(887,887,887),(888,888,888),(889,889,889),(890,890,890),
-(891,891,891),(892,892,892),(893,893,893),(894,894,894),(895,895,895),
-(896,896,896),(897,897,897),(898,898,898),(899,899,899),(900,900,900),
-(901,901,901),(902,902,902),(903,903,903),(904,904,904),(905,905,905),
-(906,906,906),(907,907,907),(908,908,908),(909,909,909),(910,910,910),
-(911,911,911),(912,912,912),(913,913,913),(914,914,914),(915,915,915),
-(916,916,916),(917,917,917),(918,918,918),(919,919,919),(920,920,920),
-(921,921,921),(922,922,922),(923,923,923),(924,924,924),(925,925,925),
-(926,926,926),(927,927,927),(928,928,928),(929,929,929),(930,930,930),
-(931,931,931),(932,932,932),(933,933,933),(934,934,934),(935,935,935),
-(936,936,936),(937,937,937),(938,938,938),(939,939,939),(940,940,940),
-(941,941,941),(942,942,942),(943,943,943),(944,944,944),(945,945,945),
-(946,946,946),(947,947,947),(948,948,948),(949,949,949),(950,950,950),
-(951,951,951),(952,952,952),(953,953,953),(954,954,954),(955,955,955),
-(956,956,956),(957,957,957),(958,958,958),(959,959,959),(960,960,960),
-(961,961,961),(962,962,962),(963,963,963),(964,964,964),(965,965,965),
-(966,966,966),(967,967,967),(968,968,968),(969,969,969),(970,970,970),
-(971,971,971),(972,972,972),(973,973,973),(974,974,974),(975,975,975),
-(976,976,976),(977,977,977),(978,978,978),(979,979,979),(980,980,980),
-(981,981,981),(982,982,982),(983,983,983),(984,984,984),(985,985,985),
-(986,986,986),(987,987,987),(988,988,988),(989,989,989),(990,990,990),
-(991,991,991),(992,992,992),(993,993,993),(994,994,994),(995,995,995),
-(996,996,996),(997,997,997),(998,998,998),(999,999,999),(1000,1000,1000),
-(1001,1001,1001),(1002,1002,1002),(1003,1003,1003),(1004,1004,1004),(1005,1005,1005),
-(1006,1006,1006),(1007,1007,1007),(1008,1008,1008),(1009,1009,1009),(1010,1010,1010),
-(1011,1011,1011),(1012,1012,1012),(1013,1013,1013),(1014,1014,1014),(1015,1015,1015),
-(1016,1016,1016),(1017,1017,1017),(1018,1018,1018),(1019,1019,1019),(1020,1020,1020),
-(1021,1021,1021),(1022,1022,1022),(1023,1023,1023),(1024,1024,1024),(1025,1025,1025),
-(1026,1026,1026),(1027,1027,1027),(1028,1028,1028),(1029,1029,1029),(1030,1030,1030),
-(1031,1031,1031),(1032,1032,1032),(1033,1033,1033),(1034,1034,1034),(1035,1035,1035),
-(1036,1036,1036),(1037,1037,1037),(1038,1038,1038),(1039,1039,1039),(1040,1040,1040),
-(1041,1041,1041),(1042,1042,1042),(1043,1043,1043),(1044,1044,1044),(1045,1045,1045),
-(1046,1046,1046),(1047,1047,1047),(1048,1048,1048),(1049,1049,1049),(1050,1050,1050),
-(1051,1051,1051),(1052,1052,1052),(1053,1053,1053),(1054,1054,1054),(1055,1055,1055),
-(1056,1056,1056),(1057,1057,1057),(1058,1058,1058),(1059,1059,1059),(1060,1060,1060),
-(1061,1061,1061),(1062,1062,1062),(1063,1063,1063),(1064,1064,1064),(1065,1065,1065),
-(1066,1066,1066),(1067,1067,1067),(1068,1068,1068),(1069,1069,1069),(1070,1070,1070),
-(1071,1071,1071),(1072,1072,1072),(1073,1073,1073),(1074,1074,1074),(1075,1075,1075),
-(1076,1076,1076),(1077,1077,1077),(1078,1078,1078),(1079,1079,1079),(1080,1080,1080),
-(1081,1081,1081),(1082,1082,1082),(1083,1083,1083),(1084,1084,1084),(1085,1085,1085),
-(1086,1086,1086),(1087,1087,1087),(1088,1088,1088),(1089,1089,1089),(1090,1090,1090),
-(1091,1091,1091),(1092,1092,1092),(1093,1093,1093),(1094,1094,1094),(1095,1095,1095),
-(1096,1096,1096),(1097,1097,1097),(1098,1098,1098),(1099,1099,1099),(1100,1100,1100),
-(1101,1101,1101),(1102,1102,1102),(1103,1103,1103),(1104,1104,1104),(1105,1105,1105),
-(1106,1106,1106),(1107,1107,1107),(1108,1108,1108),(1109,1109,1109),(1110,1110,1110),
-(1111,1111,1111),(1112,1112,1112),(1113,1113,1113),(1114,1114,1114),(1115,1115,1115),
-(1116,1116,1116),(1117,1117,1117),(1118,1118,1118),(1119,1119,1119),(1120,1120,1120),
-(1121,1121,1121),(1122,1122,1122),(1123,1123,1123),(1124,1124,1124),(1125,1125,1125),
-(1126,1126,1126),(1127,1127,1127),(1128,1128,1128),(1129,1129,1129),(1130,1130,1130),
-(1131,1131,1131),(1132,1132,1132),(1133,1133,1133),(1134,1134,1134),(1135,1135,1135),
-(1136,1136,1136),(1137,1137,1137),(1138,1138,1138),(1139,1139,1139),(1140,1140,1140),
-(1141,1141,1141),(1142,1142,1142),(1143,1143,1143),(1144,1144,1144),(1145,1145,1145),
-(1146,1146,1146),(1147,1147,1147),(1148,1148,1148),(1149,1149,1149),(1150,1150,1150),
-(1151,1151,1151),(1152,1152,1152),(1153,1153,1153),(1154,1154,1154),(1155,1155,1155),
-(1156,1156,1156),(1157,1157,1157),(1158,1158,1158),(1159,1159,1159),(1160,1160,1160),
-(1161,1161,1161),(1162,1162,1162),(1163,1163,1163),(1164,1164,1164),(1165,1165,1165),
-(1166,1166,1166),(1167,1167,1167),(1168,1168,1168),(1169,1169,1169),(1170,1170,1170),
-(1171,1171,1171),(1172,1172,1172),(1173,1173,1173),(1174,1174,1174),(1175,1175,1175),
-(1176,1176,1176),(1177,1177,1177),(1178,1178,1178),(1179,1179,1179),(1180,1180,1180),
-(1181,1181,1181),(1182,1182,1182),(1183,1183,1183),(1184,1184,1184),(1185,1185,1185),
-(1186,1186,1186),(1187,1187,1187),(1188,1188,1188),(1189,1189,1189),(1190,1190,1190),
-(1191,1191,1191),(1192,1192,1192),(1193,1193,1193),(1194,1194,1194),(1195,1195,1195),
-(1196,1196,1196),(1197,1197,1197),(1198,1198,1198),(1199,1199,1199),(1200,1200,1200),
-(1201,1201,1201),(1202,1202,1202),(1203,1203,1203),(1204,1204,1204),(1205,1205,1205),
-(1206,1206,1206),(1207,1207,1207),(1208,1208,1208),(1209,1209,1209),(1210,1210,1210),
-(1211,1211,1211),(1212,1212,1212),(1213,1213,1213),(1214,1214,1214),(1215,1215,1215),
-(1216,1216,1216),(1217,1217,1217),(1218,1218,1218),(1219,1219,1219),(1220,1220,1220),
-(1221,1221,1221),(1222,1222,1222),(1223,1223,1223),(1224,1224,1224),(1225,1225,1225),
-(1226,1226,1226),(1227,1227,1227),(1228,1228,1228),(1229,1229,1229),(1230,1230,1230),
-(1231,1231,1231),(1232,1232,1232),(1233,1233,1233),(1234,1234,1234),(1235,1235,1235),
-(1236,1236,1236),(1237,1237,1237),(1238,1238,1238),(1239,1239,1239),(1240,1240,1240),
-(1241,1241,1241),(1242,1242,1242),(1243,1243,1243),(1244,1244,1244),(1245,1245,1245),
-(1246,1246,1246),(1247,1247,1247),(1248,1248,1248),(1249,1249,1249),(1250,1250,1250),
-(1251,1251,1251),(1252,1252,1252),(1253,1253,1253),(1254,1254,1254),(1255,1255,1255),
-(1256,1256,1256),(1257,1257,1257),(1258,1258,1258),(1259,1259,1259),(1260,1260,1260),
-(1261,1261,1261),(1262,1262,1262),(1263,1263,1263),(1264,1264,1264),(1265,1265,1265),
-(1266,1266,1266),(1267,1267,1267),(1268,1268,1268),(1269,1269,1269),(1270,1270,1270),
-(1271,1271,1271),(1272,1272,1272),(1273,1273,1273),(1274,1274,1274),(1275,1275,1275),
-(1276,1276,1276),(1277,1277,1277),(1278,1278,1278),(1279,1279,1279),(1280,1280,1280),
-(1281,1281,1281),(1282,1282,1282),(1283,1283,1283),(1284,1284,1284),(1285,1285,1285),
-(1286,1286,1286),(1287,1287,1287),(1288,1288,1288),(1289,1289,1289),(1290,1290,1290),
-(1291,1291,1291),(1292,1292,1292),(1293,1293,1293),(1294,1294,1294),(1295,1295,1295),
-(1296,1296,1296),(1297,1297,1297),(1298,1298,1298),(1299,1299,1299),(1300,1300,1300),
-(1301,1301,1301),(1302,1302,1302),(1303,1303,1303),(1304,1304,1304),(1305,1305,1305),
-(1306,1306,1306),(1307,1307,1307),(1308,1308,1308),(1309,1309,1309),(1310,1310,1310),
-(1311,1311,1311),(1312,1312,1312),(1313,1313,1313),(1314,1314,1314),(1315,1315,1315),
-(1316,1316,1316),(1317,1317,1317),(1318,1318,1318),(1319,1319,1319),(1320,1320,1320),
-(1321,1321,1321),(1322,1322,1322),(1323,1323,1323),(1324,1324,1324),(1325,1325,1325),
-(1326,1326,1326),(1327,1327,1327),(1328,1328,1328),(1329,1329,1329),(1330,1330,1330),
-(1331,1331,1331),(1332,1332,1332),(1333,1333,1333),(1334,1334,1334),(1335,1335,1335),
-(1336,1336,1336),(1337,1337,1337),(1338,1338,1338),(1339,1339,1339),(1340,1340,1340),
-(1341,1341,1341),(1342,1342,1342),(1343,1343,1343),(1344,1344,1344),(1345,1345,1345),
-(1346,1346,1346),(1347,1347,1347),(1348,1348,1348),(1349,1349,1349),(1350,1350,1350),
-(1351,1351,1351),(1352,1352,1352),(1353,1353,1353),(1354,1354,1354),(1355,1355,1355),
-(1356,1356,1356),(1357,1357,1357),(1358,1358,1358),(1359,1359,1359),(1360,1360,1360),
-(1361,1361,1361),(1362,1362,1362),(1363,1363,1363),(1364,1364,1364),(1365,1365,1365),
-(1366,1366,1366),(1367,1367,1367),(1368,1368,1368),(1369,1369,1369),(1370,1370,1370),
-(1371,1371,1371),(1372,1372,1372),(1373,1373,1373),(1374,1374,1374),(1375,1375,1375),
-(1376,1376,1376),(1377,1377,1377),(1378,1378,1378),(1379,1379,1379),(1380,1380,1380),
-(1381,1381,1381),(1382,1382,1382),(1383,1383,1383),(1384,1384,1384),(1385,1385,1385),
-(1386,1386,1386),(1387,1387,1387),(1388,1388,1388),(1389,1389,1389),(1390,1390,1390),
-(1391,1391,1391),(1392,1392,1392),(1393,1393,1393),(1394,1394,1394),(1395,1395,1395),
-(1396,1396,1396),(1397,1397,1397),(1398,1398,1398),(1399,1399,1399),(1400,1400,1400),
-(1401,1401,1401),(1402,1402,1402),(1403,1403,1403),(1404,1404,1404),(1405,1405,1405),
-(1406,1406,1406),(1407,1407,1407),(1408,1408,1408),(1409,1409,1409),(1410,1410,1410),
-(1411,1411,1411),(1412,1412,1412),(1413,1413,1413),(1414,1414,1414),(1415,1415,1415),
-(1416,1416,1416),(1417,1417,1417),(1418,1418,1418),(1419,1419,1419),(1420,1420,1420),
-(1421,1421,1421),(1422,1422,1422),(1423,1423,1423),(1424,1424,1424),(1425,1425,1425),
-(1426,1426,1426),(1427,1427,1427),(1428,1428,1428),(1429,1429,1429),(1430,1430,1430),
-(1431,1431,1431),(1432,1432,1432),(1433,1433,1433),(1434,1434,1434),(1435,1435,1435),
-(1436,1436,1436),(1437,1437,1437),(1438,1438,1438),(1439,1439,1439),(1440,1440,1440),
-(1441,1441,1441),(1442,1442,1442),(1443,1443,1443),(1444,1444,1444),(1445,1445,1445),
-(1446,1446,1446),(1447,1447,1447),(1448,1448,1448),(1449,1449,1449),(1450,1450,1450),
-(1451,1451,1451),(1452,1452,1452),(1453,1453,1453),(1454,1454,1454),(1455,1455,1455),
-(1456,1456,1456),(1457,1457,1457),(1458,1458,1458),(1459,1459,1459),(1460,1460,1460),
-(1461,1461,1461),(1462,1462,1462),(1463,1463,1463),(1464,1464,1464),(1465,1465,1465),
-(1466,1466,1466),(1467,1467,1467),(1468,1468,1468),(1469,1469,1469),(1470,1470,1470),
-(1471,1471,1471),(1472,1472,1472),(1473,1473,1473),(1474,1474,1474),(1475,1475,1475),
-(1476,1476,1476),(1477,1477,1477),(1478,1478,1478),(1479,1479,1479),(1480,1480,1480),
-(1481,1481,1481),(1482,1482,1482),(1483,1483,1483),(1484,1484,1484),(1485,1485,1485),
-(1486,1486,1486),(1487,1487,1487),(1488,1488,1488),(1489,1489,1489),(1490,1490,1490),
-(1491,1491,1491),(1492,1492,1492),(1493,1493,1493),(1494,1494,1494),(1495,1495,1495),
-(1496,1496,1496),(1497,1497,1497),(1498,1498,1498),(1499,1499,1499),(1500,1500,1500),
-(1501,1501,1501),(1502,1502,1502),(1503,1503,1503),(1504,1504,1504),(1505,1505,1505),
-(1506,1506,1506),(1507,1507,1507),(1508,1508,1508),(1509,1509,1509),(1510,1510,1510),
-(1511,1511,1511),(1512,1512,1512),(1513,1513,1513),(1514,1514,1514),(1515,1515,1515),
-(1516,1516,1516),(1517,1517,1517),(1518,1518,1518),(1519,1519,1519),(1520,1520,1520),
-(1521,1521,1521),(1522,1522,1522),(1523,1523,1523),(1524,1524,1524),(1525,1525,1525),
-(1526,1526,1526),(1527,1527,1527),(1528,1528,1528),(1529,1529,1529),(1530,1530,1530),
-(1531,1531,1531),(1532,1532,1532),(1533,1533,1533),(1534,1534,1534),(1535,1535,1535),
-(1536,1536,1536),(1537,1537,1537),(1538,1538,1538),(1539,1539,1539),(1540,1540,1540),
-(1541,1541,1541),(1542,1542,1542),(1543,1543,1543),(1544,1544,1544),(1545,1545,1545),
-(1546,1546,1546),(1547,1547,1547),(1548,1548,1548),(1549,1549,1549),(1550,1550,1550),
-(1551,1551,1551),(1552,1552,1552),(1553,1553,1553),(1554,1554,1554),(1555,1555,1555),
-(1556,1556,1556),(1557,1557,1557),(1558,1558,1558),(1559,1559,1559),(1560,1560,1560),
-(1561,1561,1561),(1562,1562,1562),(1563,1563,1563),(1564,1564,1564),(1565,1565,1565),
-(1566,1566,1566),(1567,1567,1567),(1568,1568,1568),(1569,1569,1569),(1570,1570,1570),
-(1571,1571,1571),(1572,1572,1572),(1573,1573,1573),(1574,1574,1574),(1575,1575,1575),
-(1576,1576,1576),(1577,1577,1577),(1578,1578,1578),(1579,1579,1579),(1580,1580,1580),
-(1581,1581,1581),(1582,1582,1582),(1583,1583,1583),(1584,1584,1584),(1585,1585,1585),
-(1586,1586,1586),(1587,1587,1587),(1588,1588,1588),(1589,1589,1589),(1590,1590,1590),
-(1591,1591,1591),(1592,1592,1592),(1593,1593,1593),(1594,1594,1594),(1595,1595,1595),
-(1596,1596,1596),(1597,1597,1597),(1598,1598,1598),(1599,1599,1599),(1600,1600,1600),
-(1601,1601,1601),(1602,1602,1602),(1603,1603,1603),(1604,1604,1604),(1605,1605,1605),
-(1606,1606,1606),(1607,1607,1607),(1608,1608,1608),(1609,1609,1609),(1610,1610,1610),
-(1611,1611,1611),(1612,1612,1612),(1613,1613,1613),(1614,1614,1614),(1615,1615,1615),
-(1616,1616,1616),(1617,1617,1617),(1618,1618,1618),(1619,1619,1619),(1620,1620,1620),
-(1621,1621,1621),(1622,1622,1622),(1623,1623,1623),(1624,1624,1624),(1625,1625,1625),
-(1626,1626,1626),(1627,1627,1627),(1628,1628,1628),(1629,1629,1629),(1630,1630,1630),
-(1631,1631,1631),(1632,1632,1632),(1633,1633,1633),(1634,1634,1634),(1635,1635,1635),
-(1636,1636,1636),(1637,1637,1637),(1638,1638,1638),(1639,1639,1639),(1640,1640,1640),
-(1641,1641,1641),(1642,1642,1642),(1643,1643,1643),(1644,1644,1644),(1645,1645,1645),
-(1646,1646,1646),(1647,1647,1647),(1648,1648,1648),(1649,1649,1649),(1650,1650,1650),
-(1651,1651,1651),(1652,1652,1652),(1653,1653,1653),(1654,1654,1654),(1655,1655,1655),
-(1656,1656,1656),(1657,1657,1657),(1658,1658,1658),(1659,1659,1659),(1660,1660,1660),
-(1661,1661,1661),(1662,1662,1662),(1663,1663,1663),(1664,1664,1664),(1665,1665,1665),
-(1666,1666,1666),(1667,1667,1667),(1668,1668,1668),(1669,1669,1669),(1670,1670,1670),
-(1671,1671,1671),(1672,1672,1672),(1673,1673,1673),(1674,1674,1674),(1675,1675,1675),
-(1676,1676,1676),(1677,1677,1677),(1678,1678,1678),(1679,1679,1679),(1680,1680,1680),
-(1681,1681,1681),(1682,1682,1682),(1683,1683,1683),(1684,1684,1684),(1685,1685,1685),
-(1686,1686,1686),(1687,1687,1687),(1688,1688,1688),(1689,1689,1689),(1690,1690,1690),
-(1691,1691,1691),(1692,1692,1692),(1693,1693,1693),(1694,1694,1694),(1695,1695,1695),
-(1696,1696,1696),(1697,1697,1697),(1698,1698,1698),(1699,1699,1699),(1700,1700,1700),
-(1701,1701,1701),(1702,1702,1702),(1703,1703,1703),(1704,1704,1704),(1705,1705,1705),
-(1706,1706,1706),(1707,1707,1707),(1708,1708,1708),(1709,1709,1709),(1710,1710,1710),
-(1711,1711,1711),(1712,1712,1712),(1713,1713,1713),(1714,1714,1714),(1715,1715,1715),
-(1716,1716,1716),(1717,1717,1717),(1718,1718,1718),(1719,1719,1719),(1720,1720,1720),
-(1721,1721,1721),(1722,1722,1722),(1723,1723,1723),(1724,1724,1724),(1725,1725,1725),
-(1726,1726,1726),(1727,1727,1727),(1728,1728,1728),(1729,1729,1729),(1730,1730,1730),
-(1731,1731,1731),(1732,1732,1732),(1733,1733,1733),(1734,1734,1734),(1735,1735,1735),
-(1736,1736,1736),(1737,1737,1737),(1738,1738,1738),(1739,1739,1739),(1740,1740,1740),
-(1741,1741,1741),(1742,1742,1742),(1743,1743,1743),(1744,1744,1744),(1745,1745,1745),
-(1746,1746,1746),(1747,1747,1747),(1748,1748,1748),(1749,1749,1749),(1750,1750,1750),
-(1751,1751,1751),(1752,1752,1752),(1753,1753,1753),(1754,1754,1754),(1755,1755,1755),
-(1756,1756,1756),(1757,1757,1757),(1758,1758,1758),(1759,1759,1759),(1760,1760,1760),
-(1761,1761,1761),(1762,1762,1762),(1763,1763,1763),(1764,1764,1764),(1765,1765,1765),
-(1766,1766,1766),(1767,1767,1767),(1768,1768,1768),(1769,1769,1769),(1770,1770,1770),
-(1771,1771,1771),(1772,1772,1772),(1773,1773,1773),(1774,1774,1774),(1775,1775,1775),
-(1776,1776,1776),(1777,1777,1777),(1778,1778,1778),(1779,1779,1779),(1780,1780,1780),
-(1781,1781,1781),(1782,1782,1782),(1783,1783,1783),(1784,1784,1784),(1785,1785,1785),
-(1786,1786,1786),(1787,1787,1787),(1788,1788,1788),(1789,1789,1789),(1790,1790,1790),
-(1791,1791,1791),(1792,1792,1792),(1793,1793,1793),(1794,1794,1794),(1795,1795,1795),
-(1796,1796,1796),(1797,1797,1797),(1798,1798,1798),(1799,1799,1799),(1800,1800,1800),
-(1801,1801,1801),(1802,1802,1802),(1803,1803,1803),(1804,1804,1804),(1805,1805,1805),
-(1806,1806,1806),(1807,1807,1807),(1808,1808,1808),(1809,1809,1809),(1810,1810,1810),
-(1811,1811,1811),(1812,1812,1812),(1813,1813,1813),(1814,1814,1814),(1815,1815,1815),
-(1816,1816,1816),(1817,1817,1817),(1818,1818,1818),(1819,1819,1819),(1820,1820,1820),
-(1821,1821,1821),(1822,1822,1822),(1823,1823,1823),(1824,1824,1824),(1825,1825,1825),
-(1826,1826,1826),(1827,1827,1827),(1828,1828,1828),(1829,1829,1829),(1830,1830,1830),
-(1831,1831,1831),(1832,1832,1832),(1833,1833,1833),(1834,1834,1834),(1835,1835,1835),
-(1836,1836,1836),(1837,1837,1837),(1838,1838,1838),(1839,1839,1839),(1840,1840,1840),
-(1841,1841,1841),(1842,1842,1842),(1843,1843,1843),(1844,1844,1844),(1845,1845,1845),
-(1846,1846,1846),(1847,1847,1847),(1848,1848,1848),(1849,1849,1849),(1850,1850,1850),
-(1851,1851,1851),(1852,1852,1852),(1853,1853,1853),(1854,1854,1854),(1855,1855,1855),
-(1856,1856,1856),(1857,1857,1857),(1858,1858,1858),(1859,1859,1859),(1860,1860,1860),
-(1861,1861,1861),(1862,1862,1862),(1863,1863,1863),(1864,1864,1864),(1865,1865,1865),
-(1866,1866,1866),(1867,1867,1867),(1868,1868,1868),(1869,1869,1869),(1870,1870,1870),
-(1871,1871,1871),(1872,1872,1872),(1873,1873,1873),(1874,1874,1874),(1875,1875,1875),
-(1876,1876,1876),(1877,1877,1877),(1878,1878,1878),(1879,1879,1879),(1880,1880,1880),
-(1881,1881,1881),(1882,1882,1882),(1883,1883,1883),(1884,1884,1884),(1885,1885,1885),
-(1886,1886,1886),(1887,1887,1887),(1888,1888,1888),(1889,1889,1889),(1890,1890,1890),
-(1891,1891,1891),(1892,1892,1892),(1893,1893,1893),(1894,1894,1894),(1895,1895,1895),
-(1896,1896,1896),(1897,1897,1897),(1898,1898,1898),(1899,1899,1899),(1900,1900,1900),
-(1901,1901,1901),(1902,1902,1902),(1903,1903,1903),(1904,1904,1904),(1905,1905,1905),
-(1906,1906,1906),(1907,1907,1907),(1908,1908,1908),(1909,1909,1909),(1910,1910,1910),
-(1911,1911,1911),(1912,1912,1912),(1913,1913,1913),(1914,1914,1914),(1915,1915,1915),
-(1916,1916,1916),(1917,1917,1917),(1918,1918,1918),(1919,1919,1919),(1920,1920,1920),
-(1921,1921,1921),(1922,1922,1922),(1923,1923,1923),(1924,1924,1924),(1925,1925,1925),
-(1926,1926,1926),(1927,1927,1927),(1928,1928,1928),(1929,1929,1929),(1930,1930,1930),
-(1931,1931,1931),(1932,1932,1932),(1933,1933,1933),(1934,1934,1934),(1935,1935,1935),
-(1936,1936,1936),(1937,1937,1937),(1938,1938,1938),(1939,1939,1939),(1940,1940,1940),
-(1941,1941,1941),(1942,1942,1942),(1943,1943,1943),(1944,1944,1944),(1945,1945,1945),
-(1946,1946,1946),(1947,1947,1947),(1948,1948,1948),(1949,1949,1949),(1950,1950,1950),
-(1951,1951,1951),(1952,1952,1952),(1953,1953,1953),(1954,1954,1954),(1955,1955,1955),
-(1956,1956,1956),(1957,1957,1957),(1958,1958,1958),(1959,1959,1959),(1960,1960,1960),
-(1961,1961,1961),(1962,1962,1962),(1963,1963,1963),(1964,1964,1964),(1965,1965,1965),
-(1966,1966,1966),(1967,1967,1967),(1968,1968,1968),(1969,1969,1969),(1970,1970,1970),
-(1971,1971,1971),(1972,1972,1972),(1973,1973,1973),(1974,1974,1974),(1975,1975,1975),
-(1976,1976,1976),(1977,1977,1977),(1978,1978,1978),(1979,1979,1979),(1980,1980,1980),
-(1981,1981,1981),(1982,1982,1982),(1983,1983,1983),(1984,1984,1984),(1985,1985,1985),
-(1986,1986,1986),(1987,1987,1987),(1988,1988,1988),(1989,1989,1989),(1990,1990,1990),
-(1991,1991,1991),(1992,1992,1992),(1993,1993,1993),(1994,1994,1994),(1995,1995,1995),
-(1996,1996,1996),(1997,1997,1997),(1998,1998,1998),(1999,1999,1999);
-
-SELECT COUNT(*) FROM t1;
-
-
-#
-# Insert duplicate rows
-#
---error ER_DUP_ENTRY_WITH_KEY_NAME
-INSERT INTO t1 VALUES (1,1,1);
-
---error 1022
-INSERT INTO t1 VALUES
-(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
-(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
-
-select count(*) from t1;
-
-
-#
-# Test that select count(*) can see inserts made in the same transaction
-#
-begin;
-SELECT COUNT(*) FROM t1;
-INSERT INTO t1 VALUES
-(2001,2001,2001),(2002,2002,2002),(2003,2003,2003),(2004,2004,2004),(2005,2005,2005);
-SELECT COUNT(*) FROM t1;
-rollback;
-
-#
-# Insert duplicate rows, inside transaction
-# try to commit
-#
-begin;
-
---error 1022
-INSERT INTO t1 VALUES
-(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
-(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
-
---error 1296
-commit;
-
-select * from t1 where pk1=1;
-select * from t1 where pk1=10;
-select count(*) from t1 where pk1 <= 10 order by pk1;
-select count(*) from t1;
-
-
-#
-# Insert duplicate rows, inside transaction
-# rollback
-#
-begin;
-
---error 1022
-INSERT INTO t1 VALUES
-(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
-(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
-
-rollback;
-
-select * from t1 where pk1=1;
-select * from t1 where pk1=10;
-select count(*) from t1 where pk1 <= 10 order by pk1;
-select count(*) from t1;
-
-
-#
-# Insert duplicate rows, inside transaction
-# then try to select, finally rollback
-#
-begin;
-
---error 1022
-INSERT INTO t1 VALUES
-(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
-(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
---error 1296
-SELECT * FROM t1 WHERE pk1=10;
-
-rollback;
-
-select * from t1 where pk1=1;
-select * from t1 where pk1=10;
-select count(*) from t1 where pk1 <= 10 order by pk1;
-select count(*) from t1;
-
-
-#
-# Insert duplicate rows, inside transaction
-# then try to select, finally commit
-#
-begin;
-
---error 1022
-INSERT INTO t1 VALUES
-(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
-(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
-
---error 1296
-SELECT * FROM t1 WHERE pk1=10;
-
---error 1296
-SELECT * FROM t1 WHERE pk1=10;
-
---error 1296
-commit;
-
-select * from t1 where pk1=1;
-select * from t1 where pk1=10;
-select count(*) from t1 where pk1 <= 10 order by pk1;
-select count(*) from t1;
-
-
-#
-# Insert duplicate rows, inside transaction
-# then try to do another insert
-#
-begin;
-
---error 1022
-INSERT INTO t1 VALUES
-(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
-(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
-
---error 1296
-INSERT INTO t1 values (4000, 40, 44);
-
-rollback;
-
-select * from t1 where pk1=1;
-select * from t1 where pk1=10;
-select count(*) from t1 where pk1 <= 10 order by pk1;
-select count(*) from t1;
-
-#
-# Insert duplicate rows using "insert .. select"
-
-#
---error 1022
-insert into t1 select * from t1 where b < 10 order by pk1;
-
-DELETE FROM t1 WHERE pk1=2;
-
-begin;
-INSERT IGNORE INTO t1 VALUES(1,2,3),(2,3,4);
-select * from t1 where pk1 < 3 order by pk1;
-rollback;
-
-INSERT IGNORE INTO t1 VALUES(1,2,3),(2,3,4);
-select * from t1 where pk1 < 3 order by pk1;
-
-REPLACE INTO t1 values(1, 78, 3);
-select * from t1 where pk1=1;
-
-INSERT INTO t1 VALUES(1,1,1),(3,4,5) ON DUPLICATE KEY UPDATE b=79;
-select * from t1 where pk1 < 4 order by pk1;
-
-INSERT INTO t1 VALUES(1,1,1),(3,4,5) ON DUPLICATE KEY UPDATE b=pk1+c;
-select * from t1 where pk1 < 4 order by pk1;
-
-DELETE FROM t1 WHERE pk1 = 2 OR pk1 = 4 OR pk1 = 6;
-INSERT INTO t1 VALUES(1,1,1),(2,2,17),(3,4,5) ON DUPLICATE KEY UPDATE pk1=b;
-select * from t1 where pk1 = b and b != c order by pk1;
-
-# Test handling of duplicate unique
-DELETE FROM t1;
-CREATE UNIQUE INDEX bi ON t1(b);
-INSERT INTO t1 VALUES
-(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
-(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
-INSERT INTO t1 VALUES(0,1,0),(21,21,21) ON DUPLICATE KEY UPDATE pk1=b+10,b=b+10;
-select * from t1 order by pk1;
-
-DROP TABLE t1;
-
-#
-# Bug #6331: problem with 'insert ignore'
-#
-
-CREATE TABLE t1(a INT) ENGINE=ndb;
-INSERT IGNORE INTO t1 VALUES (1);
-INSERT IGNORE INTO t1 VALUES (1);
-INSERT IGNORE INTO t1 SELECT a FROM t1;
-INSERT IGNORE INTO t1 SELECT a FROM t1;
-INSERT IGNORE INTO t1 SELECT a FROM t1;
-INSERT IGNORE INTO t1 VALUES (1);
-INSERT IGNORE INTO t1 VALUES (1);
-SELECT * FROM t1 ORDER BY a;
-DELETE FROM t1;
-CREATE UNIQUE INDEX ai ON t1(a);
-INSERT IGNORE INTO t1 VALUES (1);
-INSERT IGNORE INTO t1 VALUES (1);
-INSERT IGNORE INTO t1 VALUES (NULL),(2);
-SELECT * FROM t1 ORDER BY a;
-DROP TABLE t1;
-
-# Ignore and NULL values
-CREATE TABLE t1(pk INT NOT NULL PRIMARY KEY, a INT, UNIQUE (a)) ENGINE=ndb;
-INSERT IGNORE INTO t1 VALUES (1,1),(2,2),(3,3);
-INSERT IGNORE INTO t1 VALUES (4,NULL),(5,NULL),(6,NULL),(7,4);
-SELECT * FROM t1 ORDER BY pk;
-DROP TABLE t1;
-
-#
-# Bug #27980 INSERT IGNORE wrongly ignores NULLs in unique index
-#
-
-create table t1(a int primary key, b int, unique key(b)) engine=ndb;
-insert ignore into t1 values (1,0), (2,0), (2,null), (3,null);
-select * from t1 order by a;
-drop table t1;
-
-# End of 4.1 tests
diff --git a/mysql-test/t/ndb_multi.test b/mysql-test/t/ndb_multi.test
deleted file mode 100644
index 3482db1d1b2..00000000000
--- a/mysql-test/t/ndb_multi.test
+++ /dev/null
@@ -1,126 +0,0 @@
--- source include/have_ndb.inc
--- source include/have_multi_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-connection server2;
-drop table if exists t1, t2, t3, t4;
-connection server1;
-drop table if exists t1, t2, t3, t4;
---enable_warnings
-
-flush status;
-
-# Create test tables on server1
-create table t1 (a int) engine=ndbcluster;
-create table t2 (a int) engine=ndbcluster;
-insert into t1 value (2);
-insert into t2 value (3);
-select * from t1;
-select * from t2;
-show status like 'handler_discover%';
-
-# Check dropping and recreating table on same server
-connect (con1,localhost,root,,test);
-connect (con2,localhost,root,,test);
-connection con1;
-select * from t1;
-connection con2;
-drop table t1;
-create table t1 (a int) engine=ndbcluster;
-insert into t1 value (2);
-connection con1;
-select * from t1;
-
-# Check dropping and recreating table on different server
-connection server2;
-show status like 'handler_discover%';
-drop table t1;
-create table t1 (a int) engine=ndbcluster;
-insert into t1 value (2);
-connection server1;
-select * from t1;
-select * from t1;
-
-# Connect to server2 and use the tables from there
-connection server2;
-flush status;
-select * from t1;
-update t1 set a=3 where a=2;
-show status like 'handler_discover%';
-
-# Create a new table on server2
-create table t3 (a int not null primary key, b varchar(22),
-c int, last_col text) engine=ndb;
-insert into t3 values(1, 'Hi!', 89, 'Longtext column');
-create table t4 (pk int primary key, b int) engine=ndb;
-
-# Check that the tables are accessible from server1
-connection server1;
-select * from t1;
-select * from t3;
-show tables like 't4';
-show tables;
-
-drop table t1, t2, t3, t4;
-# bug#21378
-connection server1;
-create table t1(c1 int key)ENGINE=MyISAM;
-insert into t1 values(1),(3),(5);
-select * from t1 order by c1;
-
-connection server2;
-show tables;
-create table t1(c1 int key)ENGINE=MyISAM;
-insert into t1 values(100),(344),(533);
-select * from t1 order by c1;
-
-connection server1;
-alter table t1 engine=ndb;
-
-connection server2;
-show tables;
-select * from t1 order by c1;
-drop table t1;
-
-connection server1;
-select * from t1 order by c1;
-drop table t1;
-# End of 4.1 tests
-
-# Check distributed drop of database in 5.1
-create database db;
-use db;
-create table t1(x int) engine=ndb;
-
-connection server2;
-use db;
-show tables;
-
-connection server1;
-drop database db;
-
-connection server2;
---error 1049
-show tables;
-
-connection server1;
-
-# bug#21495
-create database db;
-use db;
-create table t1(x int) engine=ndb;
-
-connection server2;
-use db;
-create table t2(x int) engine=myisam;
-show tables;
-
-connection server1;
-drop database db;
-
-connection server2;
-show tables;
-drop database db;
-
-connection server1;
diff --git a/mysql-test/t/ndb_multi_row.test b/mysql-test/t/ndb_multi_row.test
deleted file mode 100644
index 632a9fda89a..00000000000
--- a/mysql-test/t/ndb_multi_row.test
+++ /dev/null
@@ -1,76 +0,0 @@
--- source include/have_ndb.inc
--- source include/have_multi_ndb.inc
--- source include/not_embedded.inc
--- source include/have_binlog_format_row.inc
-
-
---disable_warnings
-connection server2;
-drop table if exists t1, t2, t3, t4;
-connection server1;
-drop table if exists t1, t2, t3, t4;
---enable_warnings
-
-flush status;
-
-# Create test tables on server1
-create table t1 (a int) engine=ndbcluster;
-create table t2 (a int) engine=ndbcluster;
-insert into t1 value (2);
-insert into t2 value (3);
-select * from t1;
-select * from t2;
-show status like 'handler_discover%';
-
-# Check dropping and recreating table on same server
-connect (con1,localhost,root,,test);
-connect (con2,localhost,root,,test);
-connection con1;
-select * from t1;
-connection con2;
-drop table t1;
-create table t1 (a int) engine=ndbcluster;
-insert into t1 value (2);
-connection con1;
-select * from t1;
-
-# Check dropping and recreating table on different server
-connection server2;
-show status like 'handler_discover%';
-drop table t1;
-create table t1 (a int) engine=ndbcluster;
-insert into t1 value (2);
-connection server1;
-## Currently a retry is required remotely
-#--error 1412
-#select * from t1;
-#show warnings;
-#flush table t1;
-# Table definition change should be propagated automatically
-select * from t1;
-
-# Connect to server2 and use the tables from there
-connection server2;
-flush status;
-select * from t1;
-update t1 set a=3 where a=2;
-show status like 'handler_discover%';
-
-# Create a new table on server2
-create table t3 (a int not null primary key, b varchar(22),
-c int, last_col text) engine=ndb;
-insert into t3 values(1, 'Hi!', 89, 'Longtext column');
-create table t4 (pk int primary key, b int) engine=ndb;
-
-# Check that the tables are accessible from server1
-connection server1;
-select * from t1;
-select * from t3;
-show tables like 't4';
-show tables;
-
-drop table t1, t2, t3, t4;
-connection server2;
-drop table if exists t1, t3, t4;
-
-# End of 4.1 tests
diff --git a/mysql-test/t/ndb_read_multi_range.test b/mysql-test/t/ndb_read_multi_range.test
deleted file mode 100644
index b490eeb68a3..00000000000
--- a/mysql-test/t/ndb_read_multi_range.test
+++ /dev/null
@@ -1,319 +0,0 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1, t2, r1;
---enable_warnings
-
-#
-# Basic test to see that batching is working
-#
-
-create table t1 (
- a int primary key,
- b int not null,
- c int not null,
- index(b), unique index using hash(c)
-) engine = ndb;
-insert into t1 values
- (1,2,1),(2,3,2),(3,4,3),(4,5,4),
- (5,2,12),(6,3,11),(7,4,10),(8,5,9),
- (9,2,8),(10,3,7),(11,4,6),(12,5,5);
-
-# batch on primary key
-create table r1 as select * from t1 where a in (2,8,12);
-select * from r1 order by a;
-drop table r1;
-
-# batch on ordered index
-create table r1 as select * from t1 where b in (1,2,5);
-select * from r1 order by a;
-drop table r1;
-
-# batch on unique hash index
-create table r1 as select * from t1 where c in (2,8,12);
-select * from r1 order by a;
-drop table r1;
-
-# batch mixed
-create table r1 as select * from t1 where a in (2,8) or (a > 11) or (a <= 1);
-select * from r1 order by a;
-drop table r1;
-
-# batch on primary key, missing values
-create table r1 as select * from t1 where a in (33,8,12);
-select * from r1 order by a;
-drop table r1;
-create table r1 as select * from t1 where a in (2,33,8,12,34);
-select * from r1 order by a;
-drop table r1;
-
-# batch on ordered index, missing values
-create table r1 as select * from t1 where b in (1,33,5);
-select * from r1 order by a;
-drop table r1;
-select * from t1 where b in (1,33,5) order by a;
-create table r1 as select * from t1 where b in (45,1,33,5,44);
-select * from r1 order by a;
-drop table r1;
-select * from t1 where b in (45,22) order by a;
-
-# batch on unique hash index, missing values
-create table r1 as select * from t1 where c in (2,8,33);
-select * from r1 order by a;
-drop table r1;
-create table r1 as select * from t1 where c in (13,2,8,33,12);
-select * from r1 order by a;
-drop table r1;
-
-select * from t1 where a in (33,8,12) order by a;
-select * from t1 where a in (33,34,35) order by a;
-select * from t1 where a in (2,8) or (a > 11) or (a <= 1) order by a;
-select * from t1 where b in (6,7) or (b <= 5) or (b >= 10) order by b,a;
-select * from t1 where c in (13,2,8,33,12) order by c,a;
-drop table t1;
-
-#
-# Somewhat more complicated
-#
-
-create table t1 (
- a int not null,
- b int not null,
- c int not null,
- d int not null,
- e int not null,
- primary key (a,b,c,d), index (d)
-) engine = ndb;
-
-insert into t1 values
- (1,2,1,1,1),(2,3,2,3,1),(3,4,3,1,1),(4,5,4,7,1),
- (5,2,12,12,1),(6,3,11,1,1),(7,4,10,3,1),(8,5,9,5,1),
- (9,2,8,6,1),(10,3,7,5,1),(11,4,6,3,1),(12,5,5,2,1),
- (1,2,1,2,1),
- (1,2,1,3,1),
- (1,2,1,4,1),
- (1,2,1,5,1);
-
-# batch on primary key
-create table r1 as select * from t1
- where a=1 and b=2 and c=1 and d in (1,4,3,2);
-select * from r1 order by a,b,c,d;
-drop table r1;
-
-# batched update ordered index, one value for all
-update t1 set e = 100
- where d in (12,6,7);
-select * from t1 where d in (12,6,7) order by a,b,c,d;
-select * from t1 where d not in (12,6,7) and e = 100;
-
-# batched update primary key, one value for all
-update t1
- set e = 101
- where a=1 and
- b=2 and
- c=1 and
- d in (1,4,3,2);
-select *
- from t1
- where a=1 and b=2 and c=1 and d in (1,4,3,2)
- order by a,b,c,d;
-select *
- from t1
- where not (a=1 and b=2 and c=1 and d in (1,4,3,2))
- and e=101;
-
-
-# batched update ordered index, different values
-update t1
- set e =
- (case d
- when 12 then 112
- when 6 then 106
- when 7 then 107
- end)
- where d in (12,6,7);
-select * from t1 where d in (12,6,7) order by a,b,c,d;
-
-# batched update primary key, different values
-update t1
- set e =
- (case d
- when 1 then 111
- when 4 then 444
- when 3 then 333
- when 2 then 222
- end)
- where a=1 and
- b=2 and
- c=1 and
- d in (1,4,3,2);
-select *
- from t1
- where a=1 and b=2 and c=1 and d in (1,4,3,2)
- order by a,b,c,d;
-
-# batched delete
-delete from t1 where d in (12,6,7);
-select * from t1 where d in (12,6,7);
-
-drop table t1;
-
-# null handling
-create table t1 (
- a int not null primary key,
- b int,
- c int,
- d int,
- unique index (b),
- index(c)
-) engine = ndb;
-
-insert into t1 values
- (1,null,1,1),
- (2,2,2,2),
- (3,null,null,3),
- (4,4,null,4),
- (5,null,5,null),
- (6,6,6,null),
- (7,null,null,null),
- (8,8,null,null),
- (9,null,9,9),
- (10,10,10,10),
- (11,null,null,11),
- (12,12,null,12),
- (13,null,13,null),
- (14,14,14,null),
- (15,null,null,null),
- (16,16,null,null);
-
-create table t2 as select * from t1 where a in (5,6,7,8,9,10);
-select * from t2 order by a;
-drop table t2;
-
-create table t2 as select * from t1 where b in (5,6,7,8,9,10);
-select * from t2 order by a;
-drop table t2;
-
-create table t2 as select * from t1 where c in (5,6,7,8,9,10);
-select * from t2 order by a;
-drop table t2;
-
-drop table t1;
-
-# bug17729
-
-CREATE TABLE t1 (
- a int(11) NOT NULL,
- b int(11) NOT NULL,
- c datetime default NULL,
- PRIMARY KEY (a),
- KEY idx_bc (b,c)
-) ENGINE=ndbcluster;
-
-INSERT INTO t1 VALUES
-(406989,67,'2006-02-23 17:08:46'), (150078,67,'2005-10-26 11:17:45'),
-(406993,67,'2006-02-27 11:20:57'), (245655,67,'2005-12-08 15:59:08'),
-(406994,67,'2006-02-27 11:26:46'), (256,67,NULL),
-(398341,67,'2006-02-20 04:48:44'), (254,67,NULL),(1120,67,NULL),
-(406988,67,'2006-02-23 17:07:22'), (255,67,NULL),
-(398340,67,'2006-02-20 04:38:53'),(406631,67,'2006-02-23 10:49:42'),
-(245653,67,'2005-12-08 15:59:07'),(406992,67,'2006-02-24 16:47:18'),
-(245654,67,'2005-12-08 15:59:08'),(406995,67,'2006-02-28 11:55:00'),
-(127261,67,'2005-10-13 12:17:58'),(406991,67,'2006-02-24 16:42:32'),
-(245652,67,'2005-12-08 15:58:27'),(398545,67,'2006-02-20 04:53:13'),
-(154504,67,'2005-10-28 11:53:01'),(9199,67,NULL),(1,67,'2006-02-23 15:01:35'),
-(223456,67,NULL),(4101,67,NULL),(1133,67,NULL),
-(406990,67,'2006-02-23 18:01:45'),(148815,67,'2005-10-25 15:34:17'),
-(148812,67,'2005-10-25 15:30:01'),(245651,67,'2005-12-08 15:58:27'),
-(154503,67,'2005-10-28 11:52:38');
-
-create table t11 engine = ndbcluster select * from t1 where b = 67 AND (c IS NULL OR c > NOW()) order by 3 asc;
-create table t12 engine = ndbcluster select * from t1 where b = 67 AND (c IS NULL OR c > NOW()) order by 3 desc;
-create table t21 select * from t1 where b = 67 AND (c IS NULL OR c > '2005-12-08') order by 3 asc;
-create table t22 engine = ndbcluster select * from t1 where b = 67 AND (c IS NULL OR c > '2005-12-08') order by 3 desc;
-
-select * from t11 order by 1,2,3;
-select * from t12 order by 1,2,3;
-select * from t21 order by 1,2,3;
-select * from t22 order by 1,2,3;
-
-# join tests
-select t12.a from t11, t12 where t11.a in(255,256) and t11.a = t12.a and t11.c is null order by t12.a;
-
-update t22 set c = '2005-12-08 15:58:27' where a = 255;
-select * from t22 order by 1,2,3;
-select t21.* from t21,t22 where t21.a = t22.a and
-t22.a in (select t12.a from t11, t12 where t11.a in(255,256) and t11.a = t12.a and t11.c is null) and t22.c is null order by t21.a;
-
-delete from t22 where a > 245651;
-update t22 set b = a + 1;
-select * from t22 order by 1,2,3;
-select t21.c, count(*)
-from t21
-inner join t22 using (a)
-where t22.b in (2,256,257,1121,1134,4102,9200,223457,245652)
-group by t21.c
-order by t21.c;
-
-DROP TABLE t1, t11, t12, t21, t22;
-
-# bug#19956
-CREATE TABLE t1 (id varchar(255) NOT NULL,
- tag int(11) NOT NULL,
- doc text NOT NULL,
- type varchar(150) NOT NULL,
- modified timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (id)
- ) ENGINE=ndbcluster;
-
-INSERT INTO t1 VALUES ('sakila',1,'Some text goes here','text',CURRENT_TIMESTAMP);
-SELECT id, tag, doc, type FROM t1 WHERE id IN ('flipper','orka');
-SELECT id, tag, doc, type FROM t1 WHERE id IN ('flipper','sakila');
-
-DROP TABLE t1;
-
-#bug#25522
-CREATE TABLE t1 (
- var1 int(2) NOT NULL,
- var2 int(2) NOT NULL,
- PRIMARY KEY (var1)
- ) ENGINE=ndbcluster DEFAULT CHARSET=ascii CHECKSUM=1;
-
-
-CREATE TABLE t2 (
- var1 int(2) NOT NULL,
- var2 int(2) NOT NULL,
- PRIMARY KEY (var1)
- ) ENGINE=MyISAM DEFAULT CHARSET=ascii CHECKSUM=1;
-
-
-DELIMITER |;
-CREATE TRIGGER testtrigger
- AFTER UPDATE ON t1 FOR EACH ROW BEGIN
- REPLACE INTO t2 SELECT * FROM t1 WHERE t1.var1 = NEW.var1;END|
-DELIMITER ;|
-
-INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
-
-UPDATE t1 SET var2 = 9 WHERE var1 IN(1,2,3);
-
-DROP TRIGGER testtrigger;
-
-DROP TABLE t1, t2;
-
-#bug#25821
-create table t1 (a int, b int, primary key (a), key ab (a,b)) engine=ndbcluster;
-
-insert into t1 values (1,1), (10,10);
-
-select * from t1 use index (ab) where a in(1,10) order by a;
-
-create table t2 (a int, b int, primary key (a,b)) engine=ndbcluster
-partition by key(a);
-
-insert into t2 values (1,1), (10,10);
-
-select * from t2 where a in (1,10) order by a;
-
-drop table t1, t2;
diff --git a/mysql-test/t/ndb_replace.test b/mysql-test/t/ndb_replace.test
deleted file mode 100644
index fcbefe710ca..00000000000
--- a/mysql-test/t/ndb_replace.test
+++ /dev/null
@@ -1,104 +0,0 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
-#
-# Test of REPLACE with NDB
-#
-
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-
-CREATE TABLE t1 (
- gesuchnr int(11) DEFAULT '0' NOT NULL,
- benutzer_id int(11) DEFAULT '0' NOT NULL,
- PRIMARY KEY (gesuchnr,benutzer_id)
-) engine=ndbcluster;
-
-replace into t1 (gesuchnr,benutzer_id) values (2,1);
-replace into t1 (gesuchnr,benutzer_id) values (1,1);
-replace into t1 (gesuchnr,benutzer_id) values (1,1);
-insert into t1 (gesuchnr, benutzer_id) value (3,2);
-replace into t1 (gesuchnr,benutzer_id) values (1,1);
-replace into t1 (gesuchnr,benutzer_id) values (1,1);
---error ER_DUP_ENTRY_WITH_KEY_NAME
-insert into t1 (gesuchnr,benutzer_id) values (1,1);
-replace into t1 (gesuchnr,benutzer_id) values (1,1);
-select * from t1 order by gesuchnr;
-drop table t1;
-
-# End of 4.1 tests
-
-# bug#17431
-CREATE TABLE t1(i INT PRIMARY KEY AUTO_INCREMENT,
- j INT,
- k INT,
- UNIQUE INDEX(j)
- ) ENGINE = ndb;
-INSERT INTO t1 VALUES (1,1,23),(2,2,24);
-REPLACE INTO t1 (j,k) VALUES (1,42);
-REPLACE INTO t1 (i,j) VALUES (17,2);
-SELECT * from t1 ORDER BY i;
-DROP TABLE t1;
-
-# bug#19906
-CREATE TABLE t2 (a INT(11) NOT NULL,
- b INT(11) NOT NULL,
- c INT(11) NOT NULL,
- x TEXT,
- y TEXT,
- z TEXT,
- id INT(10) unsigned NOT NULL AUTO_INCREMENT,
- i INT(11) DEFAULT NULL,
- PRIMARY KEY (id),
- UNIQUE KEY a (a,b,c)
-) ENGINE=ndbcluster;
-
-REPLACE INTO t2 (a,b,c,x,y,z,i) VALUES (1,1,1,'a','a','a',1),(1,1,1,'b','b','b',2), (1,1,1,'c','c','c',3);
-
-SELECT * FROM t2 ORDER BY id;
-
-REPLACE INTO t2(a,b,c,x,y,z,i) values (1,1,1,'a','a','a',1);
-REPLACE INTO t2(a,b,c,x,y,z,i) values (1,1,1,'b','b','b',2);
-
-SELECT * FROM t2 ORDER BY id;
-
-DROP TABLE t2;
-
-#
-# Bug #20728 "REPLACE does not work correctly for NDB table with PK and
-# unique index"
-#
---disable_warnings
-drop table if exists t1;
---enable_warnings
-create table t1 (pk int primary key, apk int unique, data int) engine=ndbcluster;
-# Test for plain replace which updates pk
-insert into t1 values (1, 1, 1), (2, 2, 2), (3, 3, 3);
-replace into t1 (pk, apk) values (4, 1), (5, 2);
-select * from t1 order by pk;
-delete from t1;
-# Another test for plain replace which doesn't touch pk
-insert into t1 values (1, 1, 1), (2, 2, 2), (3, 3, 3);
-replace into t1 (pk, apk) values (1, 4), (2, 5);
-select * from t1 order by pk;
-delete from t1;
-# Test for load data replace which updates pk
-insert into t1 values (1, 1, 1), (4, 4, 4), (6, 6, 6);
-load data infile '../std_data_ln/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (pk, apk);
-select * from t1 order by pk;
-delete from t1;
-# Now test for load data replace which doesn't touch pk
-insert into t1 values (1, 1, 1), (3, 3, 3), (5, 5, 5);
-load data infile '../std_data_ln/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (pk, apk);
-select * from t1 order by pk;
-delete from t1;
-# Finally test for both types of replace ... select
-insert into t1 values (1, 1, 1), (2, 2, 2), (3, 3, 3);
-replace into t1 (pk, apk) select 4, 1;
-replace into t1 (pk, apk) select 2, 4;
-select * from t1 order by pk;
-# Clean-up
-drop table t1;
-
---echo End of 5.0 tests.
diff --git a/mysql-test/t/ndb_restore.test b/mysql-test/t/ndb_restore.test
deleted file mode 100644
index 61927a1f90a..00000000000
--- a/mysql-test/t/ndb_restore.test
+++ /dev/null
@@ -1,403 +0,0 @@
--- source include/have_ndb.inc
--- source include/ndb_default_cluster.inc
--- source include/not_embedded.inc
-
---disable_warnings
-use test;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
-drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
---enable_warnings
-
-# Bug #27775 - mediumint auto inc not restored correctly
-# - check mediumint
-CREATE TABLE `t1_c` (
- `capgoaledatta` mediumint(5) unsigned NOT NULL auto_increment,
- `goaledatta` char(2) NOT NULL default '',
- `maturegarbagefa` varchar(32) NOT NULL default '',
- PRIMARY KEY (`capgoaledatta`,`goaledatta`,`maturegarbagefa`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-INSERT INTO `t1_c` VALUES (2,'3','q3plus.qt'),(400,'4','q3plus.qt'),(1,'3','q3.net'),(3,'4','q3.net'),(3000,'20','threetrees.qt');
-#
-# Bug #27758 Restoring NDB backups makes table usable in SQL nodes
-# - space in key made table unusable after restore
-#
-# Bug #27775 - mediumint auto inc not restored correctly
-# - check smallint
-CREATE TABLE `t2_c` (
- `capgotod` smallint(5) unsigned NOT NULL auto_increment,
- `gotod` smallint(5) unsigned NOT NULL default '0',
- `goaledatta` char(2) default NULL,
- `maturegarbagefa` varchar(32) default NULL,
- `descrpooppo` varchar(64) default NULL,
- `svcutonsa` varchar(64) NOT NULL default '',
- PRIMARY KEY (`capgotod`),
- KEY `i quadaddsvr` (`gotod`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-INSERT INTO `t2_c` VALUES (500,4,'','q3.net','addavp:MK_CASELECTOR=1','postorod rattoaa'),(2,1,'4','','addavp:MK_BRANDTAD=345','REDS Brandtad'),(3,2,'4','q3.net','execorder','fixedRatediPO REDS'),(1,1,'3','','addavp:MK_BRANDTAD=123','TEST Brandtad'),(6,5,'','told.q3.net','addavp:MK_BRANDTAD=123','Brandtad Toldzone'),(4,3,'3','q3.net','addavp:MK_POOLHINT=2','ratedi PO TEST');
-
-# Added ROW_FORMAT=FIXED to use below to see that setting is preserved
-# by restore
-CREATE TABLE `t3_c` (
- `CapGoaledatta` smallint(5) unsigned NOT NULL default '0',
- `capgotod` smallint(5) unsigned NOT NULL default '0',
- PRIMARY KEY (`capgotod`,`CapGoaledatta`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED;
-INSERT INTO `t3_c` VALUES (5,3),(2,4),(5,4),(1,3);
-
-# Bug #27775 - mediumint auto inc not restored correctly
-# - check bigint
-CREATE TABLE `t4_c` (
- `capfa` bigint(20) unsigned NOT NULL auto_increment,
- `realm` varchar(32) NOT NULL default '',
- `authpwchap` varchar(32) default NULL,
- `fa` varchar(32) NOT NULL default '',
- `payyingatta` tinyint(4) NOT NULL default '0',
- `status` char(1) default NULL,
- PRIMARY KEY (`fa`,`realm`),
- KEY `capfa` (`capfa`),
- KEY `i_quadentity` (`fa`,`realm`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-INSERT INTO `t4_c` VALUES (18,'john.smith','q3.net','dessjohn.smith',0,NULL),(21,'quad_katt_with_brandtad','q3.net','acne',0,NULL),(2200,'quad_katt_carattoaa','q3.net','acne',0,NULL),(26,'436462612809','sqasdt.q3.net','N/A',0,'6'),(19,'john','smith.qt','dessjohn',0,NULL),(33,'436643196120','sqasdt.q3.net','N/A',1,'6'),(28,'436642900019','sqasdt.q3.net','N/A',0,'6'),(30,'436462900209','sqasdt.q3.net','N/A',0,'6'),(16,'436640006666','sqasdt.q3.net','',0,NULL),(19,'dette','el-redun.com','dessdette',0,NULL),(12,'quad_kattPP','q3.net','acne',2,NULL),(14,'436640008888','sqasdt.q3.net','',0,NULL),(29,'463624900028','sqasdt.q3.net','N/A',0,'6'),(15,'436640099099','sqasdt.q3.net','',0,NULL),(13,'pap','q3plus.qt','acne',1,NULL),(19,'436642612091','sqasdt.q3.net','N/A',0,'6'),(12,'quad_katt','q3.net','acne',0,NULL),(11,'quad_kattVK','q3.net','acne',1,NULL),(32000,'463641969502','sqasdt.q3.net','N/A',1,'6'),(20,'joe','q3.net','joedesswd',0,NULL),(290000000,'436642900034','sqasdt.q3.net','N/A',0,'6'),(25,'contind','armerde.qt','acne',1,NULL);
-
-CREATE TABLE `t5_c` (
- `capfa` bigint(20) unsigned NOT NULL default '0',
- `gotod` smallint(5) unsigned NOT NULL default '0',
- `orderutonsa` varchar(64) NOT NULL default '',
- PRIMARY KEY (`capfa`,`gotod`,`orderutonsa`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-INSERT INTO `t5_c` VALUES (21,2,''),(21,1,''),(22,4,'');
-
-CREATE TABLE `t6_c` (
- `capfa_parent` bigint(20) unsigned NOT NULL default '0',
- `capfa_child` bigint(20) unsigned NOT NULL default '0',
- `relatta` smallint(5) unsigned NOT NULL default '0',
- PRIMARY KEY (`capfa_child`,`capfa_parent`,`relatta`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-INSERT INTO `t6_c` VALUES (15,16,0),(19,20,0),(18326932092909551615,30,0),(26,29,0),(18326932092909551615,29,0),(19,18,0),(26,28,0),(12,14,0);
-
-# Bug #27775 - mediumint auto inc not restored correctly
-# - check tinyint
-CREATE TABLE `t7_c` (
- `dardpo` char(15) NOT NULL default '',
- `dardtestard` tinyint(3) unsigned NOT NULL auto_increment,
- `FastFA` char(5) NOT NULL default '',
- `FastCode` char(6) NOT NULL default '',
- `Fastca` char(1) NOT NULL default '',
- `Fastmag` char(1) NOT NULL default '',
- `Beareratta` char(2) NOT NULL default '',
- PRIMARY KEY (`dardpo`,`dardtestard`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-INSERT INTO `t7_c` VALUES ('2.6.2.4',24,'CECHP','54545','0','0','5'),('2.2.5.4',26,'CANFA','33223','1','1','4'),('4.3.2.4',28,'ITALD','54222','1','0','5'),('129..0.0.eins',28,'G','99999','1','1','5'),('1.1.1.1',24,'AUTPT','32323','0','1','3');
-
-CREATE TABLE `t8_c` (
- `kattjame` varchar(32) NOT NULL default '',
- `realm` varchar(32) NOT NULL default '',
- `realm_entered` varchar(32) NOT NULL default '',
- `maturegarbagefa` varchar(32) NOT NULL default '',
- `hunderaaarbagefa_parent` varchar(32) NOT NULL default '',
- `kattjame_entered` varchar(32) NOT NULL default '',
- `hunderaaarbagefa` varchar(32) NOT NULL default '',
- `gest` varchar(16) default NULL,
- `hassetino` varchar(16) NOT NULL default '',
- `aaaproxysessfa` varchar(255) default NULL,
- `autologonallowed` char(1) default NULL,
- `squardporoot` varchar(15) NOT NULL default '',
- `naspo` varchar(15) default NULL,
- `beareratta` char(2) default NULL,
- `fastCode` varchar(6) default NULL,
- `fastFA` varchar(5) default NULL,
- `fastca` char(1) default NULL,
- `fastmag` char(1) default NULL,
- `lastupdate` datetime default NULL,
- `hassetistart` datetime NOT NULL default '0000-00-00 00:00:00',
- `accthassetitime` int(10) unsigned default NULL,
- `acctoutputoctets` bigint(20) unsigned default NULL,
- `acctinputoctets` bigint(20) unsigned default NULL,
- PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`),
- KEY `squardporoot` (`squardporoot`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-INSERT INTO `t8_c` VALUES ('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643196120','436643196929','8956234534568968','5524595699','uxasmt21.net.acne.qt/481889229462692422','','1.1.1.1','2.2.4.6','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565),('4545435545','john','q3.net','q3.net','acne.li','436643196120','436643196929','45345234568968','995696699','uxasmt21.net.acne.qt/481889229462692423','','1.1.1.1','2.2.9.8','2','86989','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8821923,169,3565),('versteckter_q3net_katt','joe','q3.net','elredun.com','q3.net','436643196120','436643196939','91341234568968','695595699','uxasmt21.net.acne.qt/481889229462692421','','1.1.1.1','2.5.2.5','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',1923123,9569,6565);
-
-CREATE TABLE `t9_c` (
- `kattjame` varchar(32) NOT NULL default '',
- `kattjame_entered` varchar(32) NOT NULL default '',
- `realm` varchar(32) NOT NULL default '',
- `realm_entered` varchar(32) NOT NULL default '',
- `maturegarbagefa` varchar(32) NOT NULL default '',
- `hunderaaarbagefa` varchar(32) NOT NULL default '',
- `hunderaaarbagefa_parent` varchar(32) NOT NULL default '',
- `gest` varchar(16) default NULL,
- `hassetino` varchar(16) NOT NULL default '',
- `squardporoot` varchar(15) NOT NULL default '',
- `naspo` varchar(15) default NULL,
- `beareratta` char(2) default NULL,
- `fastCode` varchar(6) default NULL,
- `fastFA` varchar(5) default NULL,
- `fastca` char(1) default NULL,
- `fastmag` char(1) default NULL,
- `lastupdate` datetime default NULL,
- `hassetistart` datetime NOT NULL default '0000-00-00 00:00:00',
- `accthassetitime` int(10) unsigned default NULL,
- `actcoutpuocttets` bigint(20) unsigned default NULL,
- `actinputocctets` bigint(20) unsigned default NULL,
- `terminateraste` tinyint(3) unsigned default NULL,
- PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-INSERT INTO `t9_c` VALUES ('3g4jh8gar2t','joe','q3.net','elredun.com','q3.net','436643316120','436643316939','91341234568968','695595699','1.1.1.1','2.2.6.2','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',3123123,9569,6565,1),('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643316120','436643316939','8956234534568968','5254595969','1.1.1.1','8.6.2.2','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565,2),('4545435545','john','q3.net','q3.net','acne.li','436643316120','436643316939','45345234568968','995696699','1.1.1.1','2.9.9.2','2','86998','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8823123,169,3565,3);
-
-# Bug #20820
-# auto inc table not handled correctly when restored from cluster backup
-# - before fix ndb_restore would not set auto inc value correct,
-# seen by select below
-CREATE TABLE t10_c (a INT AUTO_INCREMENT KEY) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-INSERT INTO t10_c VALUES (1),(2),(3);
-# Bug #27775 - mediumint auto inc not restored correctly
-# - check int
-insert into t10_c values (10000),(2000),(3000);
-
-create table t1 engine=myisam as select * from t1_c;
-create table t2 engine=myisam as select * from t2_c;
-create table t3 engine=myisam as select * from t3_c;
-create table t4 engine=myisam as select * from t4_c;
-create table t5 engine=myisam as select * from t5_c;
-create table t6 engine=myisam as select * from t6_c;
-create table t7 engine=myisam as select * from t7_c;
-create table t8 engine=myisam as select * from t8_c;
-create table t9 engine=myisam as select * from t9_c;
-create table t10 engine=myisam as select * from t10_c;
-
-# check that force varpart is preserved by ndb_restore
-# t3_c has ROW_FORMAT=FIXED i.e. ForceVarPart=0
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t3_c | grep ForceVarPart
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t2_c | grep ForceVarPart
-
---source include/ndb_backup.inc
-drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b $the_backup_id -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
-# check that force varpart is preserved by ndb_restore
-# t3_c has ROW_FORMAT=FIXED i.e. ForceVarPart=0
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t3_c | grep ForceVarPart
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t2_c | grep ForceVarPart
-
-# random output order??
-#show tables;
-
-select count(*) from t1;
-select count(*) from t1_c;
-select count(*)
- from (select * from t1 union
- select * from t1_c) a;
-
-select count(*) from t2;
-select count(*) from t2_c;
-select count(*)
- from (select * from t2 union
- select * from t2_c) a;
-
-select count(*) from t3;
-select count(*) from t3_c;
-select count(*)
- from (select * from t3 union
- select * from t3_c) a;
-
-select count(*) from t4;
-select count(*) from t4_c;
-select count(*)
- from (select * from t4 union
- select * from t4_c) a;
-
-select count(*) from t5;
-select count(*) from t5_c;
-select count(*)
- from (select * from t5 union
- select * from t5_c) a;
-
-select count(*) from t6;
-select count(*) from t6_c;
-select count(*)
- from (select * from t6 union
- select * from t6_c) a;
-
-select count(*) from t7;
-select count(*) from t7_c;
-select count(*)
- from (select * from t7 union
- select * from t7_c) a;
-
-select count(*) from t8;
-select count(*) from t8_c;
-select count(*)
- from (select * from t8 union
- select * from t8_c) a;
-
-select count(*) from t9;
-select count(*) from t9_c;
-select count(*)
- from (select * from t9 union
- select * from t9_c) a;
-
-# Bug #20820 cont'd
-select * from t10_c order by a;
-# Bug #27775 cont'd
-# - auto inc info should be correct
---replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X
-show table status like 't1_c';
---replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X
-show table status like 't2_c';
---replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X
-show table status like 't4_c';
---replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X
-show table status like 't7_c';
---replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X
-show table status like 't10_c';
-
-#
-# Try Partitioned tables as well
-#
-ALTER TABLE t7_c
-PARTITION BY LINEAR KEY (`dardtestard`);
-
---source include/ndb_backup.inc
-drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b $the_backup_id -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
-
-select count(*) from t1;
-select count(*) from t1_c;
-select count(*)
- from (select * from t1 union
- select * from t1_c) a;
-
-select count(*) from t2;
-select count(*) from t2_c;
-select count(*)
- from (select * from t2 union
- select * from t2_c) a;
-
-select count(*) from t3;
-select count(*) from t3_c;
-select count(*)
- from (select * from t3 union
- select * from t3_c) a;
-
-select count(*) from t4;
-select count(*) from t4_c;
-select count(*)
- from (select * from t4 union
- select * from t4_c) a;
-
-select count(*) from t5;
-select count(*) from t5_c;
-select count(*)
- from (select * from t5 union
- select * from t5_c) a;
-
-select count(*) from t6;
-select count(*) from t6_c;
-select count(*)
- from (select * from t6 union
- select * from t6_c) a;
-
-select count(*) from t7;
-select count(*) from t7_c;
-select count(*)
- from (select * from t7 union
- select * from t7_c) a;
-
-select count(*) from t8;
-select count(*) from t8_c;
-select count(*)
- from (select * from t8 union
- select * from t8_c) a;
-
-select count(*) from t9;
-select count(*) from t9_c;
-select count(*)
- from (select * from t9 union
- select * from t9_c) a;
-
-drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b $the_backup_id -n 1 -m -r --ndb-nodegroup_map '(0,0)' --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b $the_backup_id -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
-
-select count(*) from t1;
-select count(*) from t1_c;
-select count(*)
- from (select * from t1 union
- select * from t1_c) a;
-
-select count(*) from t2;
-select count(*) from t2_c;
-select count(*)
- from (select * from t2 union
- select * from t2_c) a;
-
-select count(*) from t3;
-select count(*) from t3_c;
-select count(*)
- from (select * from t3 union
- select * from t3_c) a;
-
-select count(*) from t4;
-select count(*) from t4_c;
-select count(*)
- from (select * from t4 union
- select * from t4_c) a;
-
-select count(*) from t5;
-select count(*) from t5_c;
-select count(*)
- from (select * from t5 union
- select * from t5_c) a;
-
-select count(*) from t6;
-select count(*) from t6_c;
-select count(*)
- from (select * from t6 union
- select * from t6_c) a;
-
-select count(*) from t7;
-select count(*) from t7_c;
-select count(*)
- from (select * from t7 union
- select * from t7_c) a;
-
-select count(*) from t8;
-select count(*) from t8_c;
-select count(*)
- from (select * from t8 union
- select * from t8_c) a;
-
-select count(*) from t9;
-select count(*) from t9_c;
-select count(*)
- from (select * from t9 union
- select * from t9_c) a;
-
-#
-# Drop all table except t2_c
-# This to make sure that error returned from ndb_restore above is
-# guaranteed to be from t2_c, this since order of tables in backup
-# is none deterministic
-#
-drop table t1_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
---source include/ndb_backup.inc
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --core=0 -b $the_backup_id -n 1 -m -r --ndb-nodegroup_map '(0,1)' $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id 2>&1 | grep Translate || true
-
-#
-# Cleanup
-#
-
---disable_warnings
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
-drop table if exists t2_c;
---enable_warnings
-
-#
-# Test BUG#10287
-#
-
---exec $NDB_TOOLS_DIR/ndb_select_all --no-defaults -d sys -D , SYSTAB_0 | grep 520093696, | sed "s/,$the_backup_id/,<the_backup_id>/"
-
-# End of 5.0 tests (4.1 test intermixed to save test time)
diff --git a/mysql-test/t/ndb_restore_compat.test b/mysql-test/t/ndb_restore_compat.test
deleted file mode 100644
index 2622aec1d50..00000000000
--- a/mysql-test/t/ndb_restore_compat.test
+++ /dev/null
@@ -1,61 +0,0 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
--- source include/have_case_sensitive_file_system.inc
-
-# This test currently requires case sensitive file system as the tables
-# are originally stored with uppercase
-
-#
-# Bug #18594 ndb_restore log boken in 5.1
-#
-
---disable_warnings
-DROP DATABASE IF EXISTS BANK;
---enable_warnings
-CREATE DATABASE BANK default charset=latin1 default collate=latin1_bin;
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 1 -n 1 -p 1 -m -r $MYSQL_TEST_DIR/std_data/ndb_backup51 >> $NDB_TOOLS_OUTPUT
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -e -b 1 -n 2 -p 1 -r $MYSQL_TEST_DIR/std_data/ndb_backup51 >> $NDB_TOOLS_OUTPUT
-USE BANK;
-SHOW TABLES;
-SELECT * FROM GL ORDER BY TIME,ACCOUNT_TYPE;
-SELECT * FROM ACCOUNT ORDER BY ACCOUNT_ID;
-SELECT COUNT(*) FROM TRANSACTION;
-SELECT * FROM SYSTEM_VALUES ORDER BY SYSTEM_VALUES_ID;
-SELECT * FROM mysql.ndb_apply_status WHERE server_id=0;
-
-# Check that force varpart is set by ndb_restore
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK GL | grep ForceVarPart
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK ACCOUNT | grep ForceVarPart
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK TRANSACTION | grep ForceVarPart
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK SYSTEM_VALUES | grep ForceVarPart
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK ACCOUNT_TYPE | grep ForceVarPart
-
-#
-# verify restore of 5.0 backup
-# here we must use the already created tables as restoring the old
-# table definitions will not work
-#
-TRUNCATE GL;
-TRUNCATE ACCOUNT;
-TRUNCATE TRANSACTION;
-TRUNCATE SYSTEM_VALUES;
-TRUNCATE ACCOUNT_TYPE;
-
-# Check that force varpart is not changed by truncate
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK GL | grep ForceVarPart
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK ACCOUNT | grep ForceVarPart
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK TRANSACTION | grep ForceVarPart
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK SYSTEM_VALUES | grep ForceVarPart
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK ACCOUNT_TYPE | grep ForceVarPart
-
-# Restore data
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 1 -n 1 -p 1 -r $MYSQL_TEST_DIR/std_data/ndb_backup50 >> $NDB_TOOLS_OUTPUT
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -e -b 1 -n 2 -p 1 -r $MYSQL_TEST_DIR/std_data/ndb_backup50 >> $NDB_TOOLS_OUTPUT
-
-# Check data
-SELECT * FROM GL ORDER BY TIME,ACCOUNT_TYPE;
-SELECT * FROM ACCOUNT ORDER BY ACCOUNT_ID;
-SELECT COUNT(*) FROM TRANSACTION;
-SELECT * FROM SYSTEM_VALUES ORDER BY SYSTEM_VALUES_ID;
-SELECT * FROM mysql.ndb_apply_status WHERE server_id=0;
-DROP DATABASE BANK;
diff --git a/mysql-test/t/ndb_single_user.test b/mysql-test/t/ndb_single_user.test
deleted file mode 100644
index 3c6656be9f9..00000000000
--- a/mysql-test/t/ndb_single_user.test
+++ /dev/null
@@ -1,174 +0,0 @@
--- source include/have_ndb.inc
--- source include/have_multi_ndb.inc
--- source include/ndb_default_cluster.inc
--- source include/not_embedded.inc
-
---disable_warnings
-use test;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
---enable_warnings
-
-# operations allowed while cluster is in single user mode
-
---connection server1
---let $node_id= `SHOW STATUS LIKE 'Ndb_cluster_node_id'`
---disable_query_log
---eval set @node_id= SUBSTRING('$node_id', 20)+0
---enable_query_log
---let $node_id= `SELECT @node_id`
---exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "enter single user mode $node_id" >> $NDB_TOOLS_OUTPUT
---exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" --single-user >> $NDB_TOOLS_OUTPUT
-
-# verify that we are indeed in single user mode
-# and test that some operations give correct errors
---connection server2
---error 1005
-create table t1 (a int key, b int unique, c int) engine ndb;
-# Bug #27712 Single user mode. Creating logfile group and tablespace is allowed
-# - before bug fix these would succeed
---error 1516
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-INITIAL_SIZE 16M
-UNDO_BUFFER_SIZE = 1M
-ENGINE=NDB;
-show warnings;
-
-# test some sql on first mysqld
---connection server1
-create table t1 (a int key, b int unique, c int) engine ndb;
-# Check that we can create logfile group
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-INITIAL_SIZE 16M
-UNDO_BUFFER_SIZE = 1M
-ENGINE=NDB;
---connection server2
---error ER_CREATE_FILEGROUP_FAILED
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 12M
-ENGINE NDB;
-show warnings;
---error ER_DROP_FILEGROUP_FAILED
-DROP LOGFILE GROUP lg1
-ENGINE =NDB;
-show warnings;
---connection server1
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 12M
-ENGINE NDB;
---connection server2
---error ER_ALTER_FILEGROUP_FAILED
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile.dat'
-ENGINE NDB;
-show warnings;
---connection server1
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile.dat'
-ENGINE NDB;
---connection server2
---error ER_DROP_FILEGROUP_FAILED
-DROP TABLESPACE ts1
-ENGINE NDB;
-show warnings;
---connection server1
-DROP TABLESPACE ts1
-ENGINE NDB;
-DROP LOGFILE GROUP lg1
-ENGINE =NDB;
-insert into t1 values (1,1,0),(2,2,0),(3,3,0),(4,4,0),(5,5,0),(6,6,0),(7,7,0),(8,8,0),(9,9,0),(10,10,0);
-create table t2 as select * from t1;
-# read with pk
-select * from t1 where a = 1;
-# read with unique index
-select * from t1 where b = 4;
-# read with ordered index
-select * from t1 where a > 4 order by a;
-# update with pk
-update t1 set b=102 where a = 2;
-# update with unique index
-update t1 set b=103 where b = 3;
-# update with full table scan
-update t1 set b=b+100;
-# update with ordered insex scan
-update t1 set b=b+100 where a > 7;
-# delete with full table scan
-delete from t1;
-insert into t1 select * from t2;
-# Bug #27710 Creating unique index fails during single user mode
-# - prior to bugfix this would fail
-create unique index new_index on t1 (b,c);
-
-# test some sql on other mysqld
---connection server2
---error 1051
-drop table t1;
---error 1296
-create index new_index_fail on t1 (c);
---error 1296
-insert into t1 values (21,21,0),(22,22,0),(23,23,0),(24,24,0),(25,25,0),(26,26,0),(27,27,0),(28,28,0),(29,29,0),(210,210,0);
---error 1296
-select * from t1 where a = 1;
---error 1296
-select * from t1 where b = 4;
---error 1296
-update t1 set b=102 where a = 2;
---error 1296
-update t1 set b=103 where b = 3;
---error 1296
-update t1 set b=b+100;
---error 1296
-update t1 set b=b+100 where a > 7;
-
---exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "exit single user mode" >> $NDB_TOOLS_OUTPUT
---exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults >> $NDB_TOOLS_OUTPUT
-
-#
-# we should be able to run transaction while in single user mode
-#
---connection server1
-BEGIN;
-update t1 set b=b+100 where a=1;
-
---connection server2
-BEGIN;
-update t1 set b=b+100 where a=2;
-
-# enter single user mode
---exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "enter single user mode $node_id" >> $NDB_TOOLS_OUTPUT
---exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" --single-user >> $NDB_TOOLS_OUTPUT
-
---connection server1
-update t1 set b=b+100 where a=3;
-COMMIT;
-
-# while on other mysqld it should be aborted
---connection server2
---error 1296
-update t1 set b=b+100 where a=4;
---error 1296
-COMMIT;
-
-# Bug #25275 SINGLE USER MODE prevents ALTER on non-ndb
-# tables for other mysqld nodes
---connection server2
-create table t2 (a int) engine myisam;
-alter table t2 add column (b int);
-
-# exit single user mode
---exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "exit single user mode" >> $NDB_TOOLS_OUTPUT
---exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults >> $NDB_TOOLS_OUTPUT
-
-# cleanup
---connection server2
-drop table t2;
---connection server1
-drop table t1;
-
-# End of 5.0 tests
-
diff --git a/mysql-test/t/ndb_trigger.test b/mysql-test/t/ndb_trigger.test
deleted file mode 100644
index 586fdc0ac97..00000000000
--- a/mysql-test/t/ndb_trigger.test
+++ /dev/null
@@ -1,221 +0,0 @@
-# Tests which involve triggers and NDB storage engine
---source include/have_ndb.inc
---source include/not_embedded.inc
-
-#
-# Test for bug#18437 "Wrong values inserted with a before update
-# trigger on NDB table". SQL-layer didn't properly inform handler
-# about fields which were read and set in triggers. In some cases
-# this resulted in incorrect (garbage) values of OLD variables and
-# lost changes to NEW variables.
-# You can find similar tests for ON INSERT triggers in federated.test
-# since this engine so far is the only engine in MySQL which cares
-# about field mark-up during handler::write_row() operation.
-#
-
---disable_warnings
-drop table if exists t1, t2, t3, t4, t5;
---enable_warnings
-
-create table t1 (id int primary key, a int not null, b decimal (63,30) default 0) engine=ndb;
-create table t2 (op char(1), a int not null, b decimal (63,30));
-create table t3 select 1 as i;
-create table t4 (a int not null primary key, b int) engine=ndb;
-create table t5 (a int not null primary key, b int) engine=ndb;
-
-delimiter //;
-create trigger t1_bu before update on t1 for each row
-begin
- insert into t2 values ("u", old.a, old.b);
- set new.b = old.b + 10;
-end;//
-create trigger t1_bd before delete on t1 for each row
-begin
- insert into t2 values ("d", old.a, old.b);
-end;//
-create trigger t4_au after update on t4
- for each row begin
- update t5 set b = b+1;
- end;
-//
-create trigger t4_ad after delete on t4
- for each row begin
- update t5 set b = b+1;
- end;
-//
-delimiter ;//
-
-insert into t1 values (1, 1, 1.05), (2, 2, 2.05), (3, 3, 3.05), (4, 4, 4.05);
-insert into t4 values (1,1), (2,2), (3,3), (4, 4);
-insert into t5 values (1,0);
-
-# Check that usual update works as it should
-update t1 set a=5 where a != 3;
-select * from t1 order by id;
-select * from t2 order by op, a, b;
-delete from t2;
-# Check that everything works for multi-update
-update t1, t3 set a=6 where a = 5;
-select * from t1 order by id;
-select * from t2 order by op, a, b;
-delete from t2;
-# Check for delete
-delete from t1 where a != 3;
-select * from t1 order by id;
-select * from t2 order by op, a, b;
-delete from t2;
-# Check for multi-delete
-insert into t1 values (1, 1, 1.05), (2, 2, 2.05), (4, 4, 4.05);
-delete t1 from t1, t3 where a != 3;
-select * from t1 order by id;
-select * from t2 order by op, a, b;
-delete from t2;
-# Check for insert ... on duplicate key update
-insert into t1 values (4, 4, 4.05);
-insert into t1 (id, a) values (4, 1), (3, 1) on duplicate key update a= a + 1;
-select * from t1 order by id;
-select * from t2 order by op, a, b;
-delete from t2;
-# Check for insert ... select ... on duplicate key update
-delete from t3;
-insert into t3 values (4), (3);
-insert into t1 (id, a) (select i, 1 from t3) on duplicate key update a= a + 1;
-select * from t1 order by id;
-select * from t2 order by op, a, b;
-delete from t2;
-# Check for replace
-replace into t1 (id, a) values (4, 1), (3, 1);
-select * from t1 order by id;
-select * from t2 order by op, a, b;
-delete from t1;
-delete from t2;
-# Check for replace ... select ...
-insert into t1 values (3, 1, 1.05), (4, 1, 2.05);
-replace into t1 (id, a) (select i, 2 from t3);
-select * from t1 order by id;
-select * from t2 order by op, a, b;
-delete from t1;
-delete from t2;
-# Check for load data replace
-insert into t1 values (3, 1, 1.05), (5, 2, 2.05);
-load data infile '../std_data_ln/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (id, a);
-select * from t1 order by id;
-select * from t2 order by op, a, b;
-update t4 set b = 10 where a = 1;
-select * from t5 order by a;
-update t5 set b = 0;
-delete from t4 where a = 1;
-select * from t5 order by a;
-drop trigger t4_au;
-drop trigger t4_ad;
-
-drop table t1, t2, t3, t4, t5;
-# Test for bug#26242
-# Verify that AFTER UPDATE/DELETE triggers are executed
-# after the change has actually taken place
-
-CREATE TABLE t1 (
- id INT NOT NULL PRIMARY KEY,
- xy INT
-) ENGINE=ndbcluster;
-
-INSERT INTO t1 VALUES (1, 0);
-
-DELIMITER //;
-CREATE TRIGGER t1_update AFTER UPDATE ON t1 FOR EACH ROW BEGIN REPLACE INTO t2 SELECT * FROM t1 WHERE t1.id = NEW.id; END //
-DELIMITER ;//
-
-CREATE TABLE t2 (
- id INT NOT NULL PRIMARY KEY,
- xy INT
-) ENGINE=ndbcluster;
-
-INSERT INTO t2 VALUES (2, 0);
-
-CREATE TABLE t3 (id INT NOT NULL PRIMARY KEY) ENGINE=ndbcluster;
-
-INSERT INTO t3 VALUES (1);
-
-CREATE TABLE t4 LIKE t1;
-
-DELIMITER //;
-CREATE TRIGGER t4_update AFTER UPDATE ON t4 FOR EACH ROW BEGIN REPLACE INTO t5 SELECT * FROM t4 WHERE t4.id = NEW.id; END //
-DELIMITER ;//
-
-CREATE TABLE t5 LIKE t2;
-
-UPDATE t1 SET xy = 3 WHERE id = 1;
-SELECT xy FROM t1 where id = 1;
-SELECT xy FROM t2 where id = 1;
-
-UPDATE t1 SET xy = 4 WHERE id IN (SELECT id FROM t3 WHERE id = 1);
-SELECT xy FROM t1 where id = 1;
-SELECT xy FROM t2 where id = 1;
-
-INSERT INTO t4 SELECT * FROM t1;
-INSERT INTO t5 SELECT * FROM t2;
-UPDATE t1,t4 SET t1.xy = 3, t4.xy = 3 WHERE t1.id = 1 AND t4.id = 1;
-SELECT xy FROM t1 where id = 1;
-SELECT xy FROM t2 where id = 1;
-SELECT xy FROM t4 where id = 1;
-SELECT xy FROM t5 where id = 1;
-
-UPDATE t1,t4 SET t1.xy = 4, t4.xy = 4 WHERE t1.id IN (SELECT id FROM t3 WHERE id = 1) AND t4.id IN (SELECT id FROM t3 WHERE id = 1);
-SELECT xy FROM t1 where id = 1;
-SELECT xy FROM t2 where id = 1;
-SELECT xy FROM t4 where id = 1;
-SELECT xy FROM t5 where id = 1;
-
-INSERT INTO t1 VALUES (1,0) ON DUPLICATE KEY UPDATE xy = 5;
-SELECT xy FROM t1 where id = 1;
-SELECT xy FROM t2 where id = 1;
-
-DROP TRIGGER t1_update;
-DROP TRIGGER t4_update;
-
-DELIMITER //;
-CREATE TRIGGER t1_delete AFTER DELETE ON t1 FOR EACH ROW BEGIN REPLACE INTO t2 SELECT * FROM t1 WHERE t1.id > 4; END //
-DELIMITER ;//
-
-DELIMITER //;
-CREATE TRIGGER t4_delete AFTER DELETE ON t4 FOR EACH ROW BEGIN REPLACE INTO t5 SELECT * FROM t4 WHERE t4.id > 4; END //
-DELIMITER ;//
-
-INSERT INTO t1 VALUES (5, 0),(6,0);
-INSERT INTO t2 VALUES (5, 1),(6,1);
-INSERT INTO t3 VALUES (5);
-SELECT * FROM t1 order by id;
-SELECT * FROM t2 order by id;
-DELETE FROM t1 WHERE id IN (SELECT id FROM t3 WHERE id = 5);
-SELECT * FROM t1 order by id;
-SELECT * FROM t2 order by id;
-
-INSERT INTO t1 VALUES (5,0);
-UPDATE t2 SET xy = 1 WHERE id = 6;
-TRUNCATE t4;
-INSERT INTO t4 SELECT * FROM t1;
-TRUNCATE t5;
-INSERT INTO t5 SELECT * FROM t2;
-SELECT * FROM t1 order by id;
-SELECT * FROM t2 order by id;
-SELECT * FROM t4 order by id;
-SELECT * FROM t5 order by id;
-DELETE FROM t1,t4 USING t1,t3,t4 WHERE t1.id IN (SELECT id FROM t3 WHERE id = 5) AND t4.id IN (SELECT id FROM t3 WHERE id = 5);
-SELECT * FROM t1 order by id;
-SELECT * FROM t2 order by id;
-SELECT * FROM t4 order by id;
-SELECT * FROM t5 order by id;
-
-INSERT INTO t1 VALUES (5, 0);
-REPLACE INTO t2 VALUES (6,1);
-SELECT * FROM t1 order by id;
-SELECT * FROM t2 order by id;
-REPLACE INTO t1 VALUES (5, 1);
-SELECT * FROM t1 order by id;
-SELECT * FROM t2 order by id;
-
-DROP TRIGGER t1_delete;
-DROP TRIGGER t4_delete;
-DROP TABLE t1, t2, t3, t4, t5;
-
---echo End of 5.1 tests
diff --git a/mysql-test/t/ndb_update.test b/mysql-test/t/ndb_update.test
deleted file mode 100644
index 335c43bc796..00000000000
--- a/mysql-test/t/ndb_update.test
+++ /dev/null
@@ -1,41 +0,0 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-#
-# Basic test of INSERT in NDB
-#
-
-#
-# Create a normal table with primary key
-#
-CREATE TABLE t1 (
- pk1 INT NOT NULL PRIMARY KEY,
- b INT NOT NULL,
- c INT NOT NULL UNIQUE
-) ENGINE=ndbcluster;
-
-INSERT INTO t1 VALUES (0, 1, 0),(1,2,1),(2,3,2);
-UPDATE t1 set b = c;
-select * from t1 order by pk1;
-UPDATE t1 set pk1 = 4 where pk1 = 1;
-select * from t1 order by pk1;
---error ER_DUP_ENTRY_WITH_KEY_NAME
-UPDATE t1 set pk1 = 4 where pk1 = 2;
-UPDATE IGNORE t1 set pk1 = 4 where pk1 = 2;
-select * from t1 order by pk1;
---error ER_DUP_ENTRY_WITH_KEY_NAME
-UPDATE t1 set pk1 = 1, c = 2 where pk1 = 4;
-UPDATE IGNORE t1 set pk1 = 1, c = 2 where pk1 = 4;
-select * from t1 order by pk1;
-UPDATE t1 set pk1 = pk1 + 10;
-select * from t1 order by pk1;
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-# End of 4.1 tests
diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test
index c2669856bf4..37398616299 100644
--- a/mysql-test/t/order_by.test
+++ b/mysql-test/t/order_by.test
@@ -719,10 +719,10 @@ CREATE TABLE t1 (a INT UNSIGNED NOT NULL, b TIME);
INSERT INTO t1 (a) VALUES (100000), (0), (100), (1000000),(10000), (1000), (10);
UPDATE t1 SET b = SEC_TO_TIME(a);
--- Correct ORDER
+# Correct ORDER
SELECT a, b FROM t1 ORDER BY b DESC;
--- must be ordered as the above
+# must be ordered as the above
SELECT a, b FROM t1 ORDER BY SEC_TO_TIME(a) DESC;
DROP TABLE t1;
@@ -739,3 +739,43 @@ INSERT INTO t2 VALUES (1,1),(1,2),(2,1),(2,2);
EXPLAIN SELECT 1 FROM t1,t2 WHERE t1.b=2 AND t1.a=t2.a ORDER BY t2.b;
DROP TABLE t1,t2;
+
+# End of 5.0
+
+#
+# Bug #28404: query with ORDER BY and ref access
+#
+
+CREATE TABLE t1(
+ id int auto_increment PRIMARY KEY, c2 int, c3 int, INDEX k2(c2), INDEX k3(c3));
+
+INSERT INTO t1 (c2,c3) VALUES
+ (31,34),(35,38),(34,31),(32,35),(31,39),
+ (11,14),(15,18),(14,11),(12,15),(11,19);
+
+INSERT INTO t1 (c2,c3) SELECT c2,c3 FROM t1;
+INSERT INTO t1 (c2,c3) SELECT c2,c3 FROM t1;
+INSERT INTO t1 (c2,c3) SELECT c2,c3 FROM t1;
+INSERT INTO t1 (c2,c3) SELECT c2,c3 FROM t1;
+INSERT INTO t1 (c2,c3) SELECT c2,c3 FROM t1;
+INSERT INTO t1 (c2,c3) SELECT c2,c3 FROM t1;
+INSERT INTO t1 (c2,c3) SELECT c2,c3 FROM t1;
+INSERT INTO t1 (c2,c3) SELECT c2,c3 FROM t1;
+INSERT INTO t1 (c2,c3) SELECT c2,c3 FROM t1;
+INSERT INTO t1 (c2,c3) SELECT c2,c3 FROM t1;
+INSERT INTO t1 (c2,c3) SELECT c2,c3 FROM t1;
+INSERT INTO t1 (c2,c3) SELECT c2,c3 FROM t1;
+UPDATE t1 SET c2=20 WHERE id%100 = 0;
+SELECT COUNT(*) FROM t1;
+
+CREATE TABLE t2 LIKE t1;
+INSERT INTO t2 SELECT * FROM t1 ORDER BY id;
+
+EXPLAIN SELECT id,c3 FROM t2 WHERE c2=11 ORDER BY c3 LIMIT 20;
+EXPLAIN SELECT id,c3 FROM t2 WHERE c2=11 ORDER BY c3 LIMIT 4000;
+EXPLAIN SELECT id,c3 FROM t2 WHERE c2 BETWEEN 10 AND 12 ORDER BY c3 LIMIT 20;
+EXPLAIN SELECT id,c3 FROM t2 WHERE c2 BETWEEN 20 AND 30 ORDER BY c3 LIMIT 4000;
+
+SELECT id,c3 FROM t2 WHERE c2=11 ORDER BY c3 LIMIT 20;
+
+DROP TABLE t1,t2;
diff --git a/mysql-test/t/outfile.test b/mysql-test/t/outfile.test
index f285407efd4..2b80b0b9d93 100644
--- a/mysql-test/t/outfile.test
+++ b/mysql-test/t/outfile.test
@@ -41,9 +41,9 @@ eval select * into dumpfile "../tmp/outfile-test.2" from t1;
eval select * into dumpfile "../tmp/outfile-test.3" from t1;
enable_query_log;
select load_file(concat(@tmpdir,"/outfile-test.not-exist"));
---exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.1
---exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.2
---exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.3
+--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.1
+--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.2
+--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.3
drop table t1;
# Bug#8191
@@ -51,7 +51,7 @@ disable_query_log;
eval select 1 into outfile "../tmp/outfile-test.4";
enable_query_log;
select load_file(concat(@tmpdir,"/outfile-test.4"));
---exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.4
+--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
#
# Bug #5382: 'explain select into outfile' crashes the server
@@ -75,7 +75,7 @@ eval SELECT * INTO OUTFILE "../tmp/outfile-test.4"
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
FROM information_schema.schemata LIMIT 0, 5;
# enable_query_log;
---exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.4
+--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
use information_schema;
# disable_query_log;
@@ -83,7 +83,7 @@ eval SELECT * INTO OUTFILE "../tmp/outfile-test.4"
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
FROM schemata LIMIT 0, 5;
enable_query_log;
---exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.4
+--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
use test;
#
diff --git a/mysql-test/t/parser.test b/mysql-test/t/parser.test
index 65aa9dbb89b..79c9129bb74 100644
--- a/mysql-test/t/parser.test
+++ b/mysql-test/t/parser.test
@@ -363,6 +363,28 @@ create table VAR_SAMP(a int);
--error ER_PARSE_ERROR
create table VAR_SAMP (a int);
+#
+# Bug#25930 (CREATE TABLE x SELECT ... parses columns wrong when ran with
+# ANSI_QUOTES mode)
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS table_25930_a;
+DROP TABLE IF EXISTS table_25930_b;
+--enable_warnings
+
+SET SQL_MODE = 'ANSI_QUOTES';
+CREATE TABLE table_25930_a ( "blah" INT );
+CREATE TABLE table_25930_b SELECT "blah" - 1 FROM table_25930_a;
+
+# The lexer used to chop the first <">,
+# not marking the start of the token "blah" correctly.
+desc table_25930_b;
+
+DROP TABLE table_25930_a;
+DROP TABLE table_25930_b;
+
+
SET @@sql_mode=@save_sql_mode;
#=============================================================================
diff --git a/mysql-test/t/parser_precedence.test b/mysql-test/t/parser_precedence.test
new file mode 100644
index 00000000000..484c8759779
--- /dev/null
+++ b/mysql-test/t/parser_precedence.test
@@ -0,0 +1,333 @@
+
+--disable_warnings
+drop table if exists t1_30237_bool;
+--enable_warnings
+
+create table t1_30237_bool(A boolean, B boolean, C boolean);
+
+insert into t1_30237_bool values
+(FALSE, FALSE, FALSE),
+(FALSE, FALSE, NULL),
+(FALSE, FALSE, TRUE),
+(FALSE, NULL, FALSE),
+(FALSE, NULL, NULL),
+(FALSE, NULL, TRUE),
+(FALSE, TRUE, FALSE),
+(FALSE, TRUE, NULL),
+(FALSE, TRUE, TRUE),
+(NULL, FALSE, FALSE),
+(NULL, FALSE, NULL),
+(NULL, FALSE, TRUE),
+(NULL, NULL, FALSE),
+(NULL, NULL, NULL),
+(NULL, NULL, TRUE),
+(NULL, TRUE, FALSE),
+(NULL, TRUE, NULL),
+(NULL, TRUE, TRUE),
+(TRUE, FALSE, FALSE),
+(TRUE, FALSE, NULL),
+(TRUE, FALSE, TRUE),
+(TRUE, NULL, FALSE),
+(TRUE, NULL, NULL),
+(TRUE, NULL, TRUE),
+(TRUE, TRUE, FALSE),
+(TRUE, TRUE, NULL),
+(TRUE, TRUE, TRUE) ;
+
+--echo Testing OR, XOR, AND
+select A, B, A OR B, A XOR B, A AND B
+ from t1_30237_bool where C is null order by A, B;
+
+--echo Testing that OR is associative
+select A, B, C, (A OR B) OR C, A OR (B OR C), A OR B OR C
+ from t1_30237_bool order by A, B, C;
+
+select count(*) from t1_30237_bool
+ where ((A OR B) OR C) != (A OR (B OR C));
+
+--echo Testing that XOR is associative
+select A, B, C, (A XOR B) XOR C, A XOR (B XOR C), A XOR B XOR C
+ from t1_30237_bool order by A, B, C;
+
+select count(*) from t1_30237_bool
+ where ((A XOR B) XOR C) != (A XOR (B XOR C));
+
+--echo Testing that AND is associative
+select A, B, C, (A AND B) AND C, A AND (B AND C), A AND B AND C
+ from t1_30237_bool order by A, B, C;
+
+select count(*) from t1_30237_bool
+ where ((A AND B) AND C) != (A AND (B AND C));
+
+--echo Testing that AND has precedence over OR
+select A, B, C, (A OR B) AND C, A OR (B AND C), A OR B AND C
+ from t1_30237_bool order by A, B, C;
+select count(*) from t1_30237_bool
+ where (A OR (B AND C)) != (A OR B AND C);
+select A, B, C, (A AND B) OR C, A AND (B OR C), A AND B OR C
+ from t1_30237_bool order by A, B, C;
+select count(*) from t1_30237_bool
+ where ((A AND B) OR C) != (A AND B OR C);
+
+--echo Testing that AND has precedence over XOR
+select A, B, C, (A XOR B) AND C, A XOR (B AND C), A XOR B AND C
+ from t1_30237_bool order by A, B, C;
+select count(*) from t1_30237_bool
+ where (A XOR (B AND C)) != (A XOR B AND C);
+select A, B, C, (A AND B) XOR C, A AND (B XOR C), A AND B XOR C
+ from t1_30237_bool order by A, B, C;
+select count(*) from t1_30237_bool
+ where ((A AND B) XOR C) != (A AND B XOR C);
+
+--echo Testing that XOR has precedence over OR
+select A, B, C, (A XOR B) OR C, A XOR (B OR C), A XOR B OR C
+ from t1_30237_bool order by A, B, C;
+select count(*) from t1_30237_bool
+ where ((A XOR B) OR C) != (A XOR B OR C);
+select A, B, C, (A OR B) XOR C, A OR (B XOR C), A OR B XOR C
+ from t1_30237_bool order by A, B, C;
+select count(*) from t1_30237_bool
+ where (A OR (B XOR C)) != (A OR B XOR C);
+
+drop table t1_30237_bool;
+
+--echo Testing that NOT has precedence over OR
+select (NOT FALSE) OR TRUE, NOT (FALSE OR TRUE), NOT FALSE OR TRUE;
+
+--echo Testing that NOT has precedence over XOR
+select (NOT FALSE) XOR FALSE, NOT (FALSE XOR FALSE), NOT FALSE XOR FALSE;
+
+--echo Testing that NOT has precedence over AND
+select (NOT FALSE) AND FALSE, NOT (FALSE AND FALSE), NOT FALSE AND FALSE;
+
+--echo Testing that NOT is associative
+select NOT NOT TRUE, NOT NOT NOT FALSE;
+
+--echo Testing that IS has precedence over NOT
+select (NOT NULL) IS TRUE, NOT (NULL IS TRUE), NOT NULL IS TRUE;
+select (NOT NULL) IS NOT TRUE, NOT (NULL IS NOT TRUE), NOT NULL IS NOT TRUE;
+select (NOT NULL) IS FALSE, NOT (NULL IS FALSE), NOT NULL IS FALSE;
+select (NOT NULL) IS NOT FALSE, NOT (NULL IS NOT FALSE), NOT NULL IS NOT FALSE;
+select (NOT TRUE) IS UNKNOWN, NOT (TRUE IS UNKNOWN), NOT TRUE IS UNKNOWN;
+select (NOT TRUE) IS NOT UNKNOWN, NOT (TRUE IS NOT UNKNOWN), NOT TRUE IS NOT UNKNOWN;
+select (NOT TRUE) IS NULL, NOT (TRUE IS NULL), NOT TRUE IS NULL;
+select (NOT TRUE) IS NOT NULL, NOT (TRUE IS NOT NULL), NOT TRUE IS NOT NULL;
+
+--echo Testing that IS [NOT] TRUE/FALSE/UNKNOWN predicates are not associative
+# Documenting existing behavior in 5.0.48
+-- error ER_PARSE_ERROR
+select TRUE IS TRUE IS TRUE IS TRUE;
+-- error ER_PARSE_ERROR
+select FALSE IS NOT TRUE IS NOT TRUE IS NOT TRUE;
+-- error ER_PARSE_ERROR
+select NULL IS FALSE IS FALSE IS FALSE;
+-- error ER_PARSE_ERROR
+select TRUE IS NOT FALSE IS NOT FALSE IS NOT FALSE;
+-- error ER_PARSE_ERROR
+select FALSE IS UNKNOWN IS UNKNOWN IS UNKNOWN;
+-- error ER_PARSE_ERROR
+select TRUE IS NOT UNKNOWN IS NOT UNKNOWN IS NOT UNKNOWN;
+
+--echo Testing that IS [NOT] NULL predicates are associative
+# Documenting existing behavior in 5.0.48
+select FALSE IS NULL IS NULL IS NULL;
+select TRUE IS NOT NULL IS NOT NULL IS NOT NULL;
+
+--echo Testing that comparison operators are left associative
+select 1 <=> 2 <=> 2, (1 <=> 2) <=> 2, 1 <=> (2 <=> 2);
+select 1 = 2 = 2, (1 = 2) = 2, 1 = (2 = 2);
+select 1 != 2 != 3, (1 != 2) != 3, 1 != (2 != 3);
+select 1 <> 2 <> 3, (1 <> 2) <> 3, 1 <> (2 <> 3);
+select 1 < 2 < 3, (1 < 2) < 3, 1 < (2 < 3);
+select 3 <= 2 <= 1, (3 <= 2) <= 1, 3 <= (2 <= 1);
+select 1 > 2 > 3, (1 > 2) > 3, 1 > (2 > 3);
+select 1 >= 2 >= 3, (1 >= 2) >= 3, 1 >= (2 >= 3);
+
+-- echo Testing that | is associative
+select 0xF0 | 0x0F | 0x55, (0xF0 | 0x0F) | 0x55, 0xF0 | (0x0F | 0x55);
+
+-- echo Testing that & is associative
+select 0xF5 & 0x5F & 0x55, (0xF5 & 0x5F) & 0x55, 0xF5 & (0x5F & 0x55);
+
+-- echo Testing that << is left associative
+select 4 << 3 << 2, (4 << 3) << 2, 4 << (3 << 2);
+
+-- echo Testing that >> is left associative
+select 256 >> 3 >> 2, (256 >> 3) >> 2, 256 >> (3 >> 2);
+
+--echo Testing that & has precedence over |
+select 0xF0 & 0x0F | 0x55, (0xF0 & 0x0F) | 0x55, 0xF0 & (0x0F | 0x55);
+select 0x55 | 0xF0 & 0x0F, (0x55 | 0xF0) & 0x0F, 0x55 | (0xF0 & 0x0F);
+
+--echo Testing that << has precedence over |
+select 0x0F << 4 | 0x0F, (0x0F << 4) | 0x0F, 0x0F << (4 | 0x0F);
+select 0x0F | 0x0F << 4, (0x0F | 0x0F) << 4, 0x0F | (0x0F << 4);
+
+--echo Testing that >> has precedence over |
+select 0xF0 >> 4 | 0xFF, (0xF0 >> 4) | 0xFF, 0xF0 >> (4 | 0xFF);
+select 0xFF | 0xF0 >> 4, (0xFF | 0xF0) >> 4, 0xFF | (0xF0 >> 4);
+
+--echo Testing that << has precedence over &
+select 0x0F << 4 & 0xF0, (0x0F << 4) & 0xF0, 0x0F << (4 & 0xF0);
+select 0xF0 & 0x0F << 4, (0xF0 & 0x0F) << 4, 0xF0 & (0x0F << 4);
+
+--echo Testing that >> has precedence over &
+select 0xF0 >> 4 & 0x55, (0xF0 >> 4) & 0x55, 0xF0 >> (4 & 0x55);
+select 0x0F & 0xF0 >> 4, (0x0F & 0xF0) >> 4, 0x0F & (0xF0 >> 4);
+
+--echo Testing that >> and << have the same precedence
+select 0xFF >> 4 << 2, (0xFF >> 4) << 2, 0xFF >> (4 << 2);
+select 0x0F << 4 >> 2, (0x0F << 4) >> 2, 0x0F << (4 >> 2);
+
+--echo Testing that binary + is associative
+select 1 + 2 + 3, (1 + 2) + 3, 1 + (2 + 3);
+
+--echo Testing that binary - is left associative
+select 1 - 2 - 3, (1 - 2) - 3, 1 - (2 - 3);
+
+--echo Testing that binary + and binary - have the same precedence
+# evaluated left to right
+select 1 + 2 - 3, (1 + 2) - 3, 1 + (2 - 3);
+select 1 - 2 + 3, (1 - 2) + 3, 1 - (2 + 3);
+
+--echo Testing that binary + has precedence over |
+select 0xF0 + 0x0F | 0x55, (0xF0 + 0x0F) | 0x55, 0xF0 + (0x0F | 0x55);
+select 0x55 | 0xF0 + 0x0F, (0x55 | 0xF0) + 0x0F, 0x55 | (0xF0 + 0x0F);
+
+--echo Testing that binary + has precedence over &
+select 0xF0 + 0x0F & 0x55, (0xF0 + 0x0F) & 0x55, 0xF0 + (0x0F & 0x55);
+select 0x55 & 0xF0 + 0x0F, (0x55 & 0xF0) + 0x0F, 0x55 & (0xF0 + 0x0F);
+
+--echo Testing that binary + has precedence over <<
+select 2 + 3 << 4, (2 + 3) << 4, 2 + (3 << 4);
+select 3 << 4 + 2, (3 << 4) + 2, 3 << (4 + 2);
+
+--echo Testing that binary + has precedence over >>
+select 4 + 3 >> 2, (4 + 3) >> 2, 4 + (3 >> 2);
+select 3 >> 2 + 1, (3 >> 2) + 1, 3 >> (2 + 1);
+
+--echo Testing that binary - has precedence over |
+select 0xFF - 0x0F | 0x55, (0xFF - 0x0F) | 0x55, 0xFF - (0x0F | 0x55);
+select 0x55 | 0xFF - 0xF0, (0x55 | 0xFF) - 0xF0, 0x55 | (0xFF - 0xF0);
+
+--echo Testing that binary - has precedence over &
+select 0xFF - 0xF0 & 0x55, (0xFF - 0xF0) & 0x55, 0xFF - (0xF0 & 0x55);
+select 0x55 & 0xFF - 0xF0, (0x55 & 0xFF) - 0xF0, 0x55 & (0xFF - 0xF0);
+
+--echo Testing that binary - has precedence over <<
+select 16 - 3 << 2, (16 - 3) << 2, 16 - (3 << 2);
+select 4 << 3 - 2, (4 << 3) - 2, 4 << (3 - 2);
+
+--echo Testing that binary - has precedence over >>
+select 16 - 3 >> 2, (16 - 3) >> 2, 16 - (3 >> 2);
+select 16 >> 3 - 2, (16 >> 3) - 2, 16 >> (3 - 2);
+
+--echo Testing that * is associative
+select 2 * 3 * 4, (2 * 3) * 4, 2 * (3 * 4);
+
+--echo Testing that * has precedence over |
+select 2 * 0x40 | 0x0F, (2 * 0x40) | 0x0F, 2 * (0x40 | 0x0F);
+select 0x0F | 2 * 0x40, (0x0F | 2) * 0x40, 0x0F | (2 * 0x40);
+
+--echo Testing that * has precedence over &
+select 2 * 0x40 & 0x55, (2 * 0x40) & 0x55, 2 * (0x40 & 0x55);
+select 0xF0 & 2 * 0x40, (0xF0 & 2) * 0x40, 0xF0 & (2 * 0x40);
+
+--echo Testing that * has precedence over <<
+# Actually, can't prove it for the first case,
+# since << is a multiplication by a power of 2,
+# and * is associative
+select 5 * 3 << 4, (5 * 3) << 4, 5 * (3 << 4);
+select 2 << 3 * 4, (2 << 3) * 4, 2 << (3 * 4);
+
+--echo Testing that * has precedence over >>
+# >> is a multiplication by a (negative) power of 2,
+# see above.
+select 3 * 4 >> 2, (3 * 4) >> 2, 3 * (4 >> 2);
+select 4 >> 2 * 3, (4 >> 2) * 3, 4 >> (2 * 3);
+
+--echo Testing that * has precedence over binary +
+select 2 * 3 + 4, (2 * 3) + 4, 2 * (3 + 4);
+select 2 + 3 * 4, (2 + 3) * 4, 2 + (3 * 4);
+
+--echo Testing that * has precedence over binary -
+select 4 * 3 - 2, (4 * 3) - 2, 4 * (3 - 2);
+select 4 - 3 * 2, (4 - 3) * 2, 4 - (3 * 2);
+
+--echo Testing that / is left associative
+select 15 / 5 / 3, (15 / 5) / 3, 15 / (5 / 3);
+
+--echo Testing that / has precedence over |
+select 105 / 5 | 2, (105 / 5) | 2, 105 / (5 | 2);
+select 105 | 2 / 5, (105 | 2) / 5, 105 | (2 / 5);
+
+--echo Testing that / has precedence over &
+select 105 / 5 & 0x0F, (105 / 5) & 0x0F, 105 / (5 & 0x0F);
+select 0x0F & 105 / 5, (0x0F & 105) / 5, 0x0F & (105 / 5);
+
+--echo Testing that / has precedence over <<
+select 0x80 / 4 << 2, (0x80 / 4) << 2, 0x80 / (4 << 2);
+select 0x80 << 4 / 2, (0x80 << 4) / 2, 0x80 << (4 / 2);
+
+--echo Testing that / has precedence over >>
+select 0x80 / 4 >> 2, (0x80 / 4) >> 2, 0x80 / (4 >> 2);
+select 0x80 >> 4 / 2, (0x80 >> 4) / 2, 0x80 >> (4 / 2);
+
+--echo Testing that / has precedence over binary +
+select 0x80 / 2 + 2, (0x80 / 2) + 2, 0x80 / (2 + 2);
+select 0x80 + 2 / 2, (0x80 + 2) / 2, 0x80 + (2 / 2);
+
+--echo Testing that / has precedence over binary -
+select 0x80 / 4 - 2, (0x80 / 4) - 2, 0x80 / (4 - 2);
+select 0x80 - 4 / 2, (0x80 - 4) / 2, 0x80 - (4 / 2);
+
+# TODO: %, DIV, MOD
+
+--echo Testing that ^ is associative
+select 0xFF ^ 0xF0 ^ 0x0F, (0xFF ^ 0xF0) ^ 0x0F, 0xFF ^ (0xF0 ^ 0x0F);
+select 0xFF ^ 0xF0 ^ 0x55, (0xFF ^ 0xF0) ^ 0x55, 0xFF ^ (0xF0 ^ 0x55);
+
+--echo Testing that ^ has precedence over |
+select 0xFF ^ 0xF0 | 0x0F, (0xFF ^ 0xF0) | 0x0F, 0xFF ^ (0xF0 | 0x0F);
+select 0xF0 | 0xFF ^ 0xF0, (0xF0 | 0xFF) ^ 0xF0, 0xF0 | (0xFF ^ 0xF0);
+
+--echo Testing that ^ has precedence over &
+select 0xFF ^ 0xF0 & 0x0F, (0xFF ^ 0xF0) & 0x0F, 0xFF ^ (0xF0 & 0x0F);
+select 0x0F & 0xFF ^ 0xF0, (0x0F & 0xFF) ^ 0xF0, 0x0F & (0xFF ^ 0xF0);
+
+--echo Testing that ^ has precedence over <<
+select 0xFF ^ 0xF0 << 2, (0xFF ^ 0xF0) << 2, 0xFF ^ (0xF0 << 2);
+select 0x0F << 2 ^ 0xFF, (0x0F << 2) ^ 0xFF, 0x0F << (2 ^ 0xFF);
+
+--echo Testing that ^ has precedence over >>
+select 0xFF ^ 0xF0 >> 2, (0xFF ^ 0xF0) >> 2, 0xFF ^ (0xF0 >> 2);
+select 0xFF >> 2 ^ 0xF0, (0xFF >> 2) ^ 0xF0, 0xFF >> (2 ^ 0xF0);
+
+--echo Testing that ^ has precedence over binary +
+select 0xFF ^ 0xF0 + 0x0F, (0xFF ^ 0xF0) + 0x0F, 0xFF ^ (0xF0 + 0x0F);
+select 0x0F + 0xFF ^ 0xF0, (0x0F + 0xFF) ^ 0xF0, 0x0F + (0xFF ^ 0xF0);
+
+--echo Testing that ^ has precedence over binary -
+select 0xFF ^ 0xF0 - 1, (0xFF ^ 0xF0) - 1, 0xFF ^ (0xF0 - 1);
+select 0x55 - 0x0F ^ 0x55, (0x55 - 0x0F) ^ 0x55, 0x55 - (0x0F ^ 0x55);
+
+--echo Testing that ^ has precedence over *
+select 0xFF ^ 0xF0 * 2, (0xFF ^ 0xF0) * 2, 0xFF ^ (0xF0 * 2);
+select 2 * 0xFF ^ 0xF0, (2 * 0xFF) ^ 0xF0, 2 * (0xFF ^ 0xF0);
+
+--echo Testing that ^ has precedence over /
+select 0xFF ^ 0xF0 / 2, (0xFF ^ 0xF0) / 2, 0xFF ^ (0xF0 / 2);
+select 0xF2 / 2 ^ 0xF0, (0xF2 / 2) ^ 0xF0, 0xF2 / (2 ^ 0xF0);
+
+--echo Testing that ^ has precedence over %
+select 0xFF ^ 0xF0 % 0x20, (0xFF ^ 0xF0) % 0x20, 0xFF ^ (0xF0 % 0x20);
+select 0xFF % 0x20 ^ 0xF0, (0xFF % 0x20) ^ 0xF0, 0xFF % (0x20 ^ 0xF0);
+
+--echo Testing that ^ has precedence over DIV
+select 0xFF ^ 0xF0 DIV 2, (0xFF ^ 0xF0) DIV 2, 0xFF ^ (0xF0 DIV 2);
+select 0xF2 DIV 2 ^ 0xF0, (0xF2 DIV 2) ^ 0xF0, 0xF2 DIV (2 ^ 0xF0);
+
+--echo Testing that ^ has precedence over MOD
+select 0xFF ^ 0xF0 MOD 0x20, (0xFF ^ 0xF0) MOD 0x20, 0xFF ^ (0xF0 MOD 0x20);
+select 0xFF MOD 0x20 ^ 0xF0, (0xFF MOD 0x20) ^ 0xF0, 0xFF MOD (0x20 ^ 0xF0);
+
diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test
index 36f3a40503b..42db23dadef 100644
--- a/mysql-test/t/partition.test
+++ b/mysql-test/t/partition.test
@@ -1441,5 +1441,62 @@ insert into t1 values ('aaa','1') on duplicate key update c2 = c2 + 1;
select * from t1;
drop table t1;
+#
+# Bug #28005 Partitions: can't use -9223372036854775808
+#
+
+create table t1 (s1 bigint) partition by list (s1) (partition p1 values in (-9223372036854775808));
+drop table t1;
+
+#
+# Bug #28806: Running SHOW TABLE STATUS during high INSERT load crashes server
+#
+create table t1(a int auto_increment, b int, primary key (b, a))
+ partition by hash(b) partitions 2;
+insert into t1 values (null, 1);
+--replace_column 9 0 12 NULL 13 NULL 14 NULL
+show table status;
+drop table t1;
+
+create table t1(a int auto_increment primary key)
+ partition by key(a) partitions 2;
+insert into t1 values (null), (null), (null);
+--replace_column 9 0 12 NULL 13 NULL 14 NULL
+show table status;
+drop table t1;
+# Bug #28488: Incorrect information in file: './test/t1_test#.frm'
+#
+
+CREATE TABLE t1(a INT NOT NULL, b TINYBLOB, KEY(a))
+ PARTITION BY RANGE(a) ( PARTITION p0 VALUES LESS THAN (32));
+INSERT INTO t1 VALUES (1, REPEAT('a', 10));
+INSERT INTO t1 SELECT a + 1, b FROM t1;
+INSERT INTO t1 SELECT a + 2, b FROM t1;
+INSERT INTO t1 SELECT a + 4, b FROM t1;
+INSERT INTO t1 SELECT a + 8, b FROM t1;
+
+ALTER TABLE t1 ADD PARTITION (PARTITION p1 VALUES LESS THAN (64));
+ALTER TABLE t1 DROP PARTITION p1;
+
+DROP TABLE t1;
+
+#
+# Bug #27816: Log tables ran with partitions crashes the server when logging
+# is enabled.
+#
+
+USE mysql;
+SET GLOBAL general_log = 0;
+ALTER TABLE general_log ENGINE = MyISAM;
+--error ER_WRONG_USAGE
+ALTER TABLE general_log PARTITION BY RANGE (TO_DAYS(event_time))
+ (PARTITION p0 VALUES LESS THAN (733144), PARTITION p1 VALUES LESS THAN (3000000));
+ALTER TABLE general_log ENGINE = CSV;
+SET GLOBAL general_log = default;
+
+#
+# Bug #27084 partitioning by list seems failing when using case
+# BUG #18198: Case no longer supported, test case removed
+#
--echo End of 5.1 tests
diff --git a/mysql-test/t/partition_bug18198.test b/mysql-test/t/partition_bug18198.test
new file mode 100644
index 00000000000..7f071c6ec9e
--- /dev/null
+++ b/mysql-test/t/partition_bug18198.test
@@ -0,0 +1,219 @@
+-- source include/have_partition.inc
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+create table t1 (col1 datetime)
+partition by range(datediff(col1,col1))
+(partition p0 values less than (10), partition p1 values less than (30));
+drop table t1;
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(greatest(col1,10))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(isnull(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(least(col1,12))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(case when col1>0 then 10 else 20 end)
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(ifnull(col1,5))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(nullif(col1,5))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(bit_length(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 char(5))
+partition by range(bit_length(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(char_length(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 char(5))
+partition by range(char_length(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 char(5))
+partition by range(character_length(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(find_in_set(col1,1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 char(5))
+partition by range(find_in_set(col1,'1'))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(instr(col1,3))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 char(5))
+partition by range(instr(col1,'3'))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 char(5))
+partition by range(length(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 char(5))
+partition by range(locate(1,col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(locate(1,col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 char(5))
+partition by range(octet_length(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 char(5))
+partition by range(position(1 in col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(position(1 in col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 char(5))
+partition by range(strcmp(col1,2))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(strcmp(col1,2))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(crc32(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(round(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(sign(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 datetime)
+partition by range(period_add(col1,5))
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 datetime, col2 datetime)
+partition by range(period_diff(col1,col2))
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int, col2 int)
+partition by range(period_diff(col1,col2))
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 datetime)
+partition by range(timestampdiff(day,5,col1))
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 date)
+partition by range(unix_timestamp(col1))
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 datetime)
+partition by range(week(col1))
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 varchar(25))
+partition by range(cast(col1 as signed))
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 varchar(25))
+partition by range(convert(col1,unsigned))
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(col1 | 20)
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(col1 & 20)
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(col1 ^ 20)
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(col1 << 20)
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(col1 >> 20)
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(~col1)
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(bit_count(col1))
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(inet_aton(col1))
+(partition p0 values less than (10), partition p1 values less than (30));
diff --git a/mysql-test/t/partition_charset.test b/mysql-test/t/partition_charset.test
index 27d0dc87b89..6842e5268fa 100644
--- a/mysql-test/t/partition_charset.test
+++ b/mysql-test/t/partition_charset.test
@@ -19,3 +19,11 @@ flush tables;
set names latin1;
select * from t1;
drop table t1;
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (a varchar(1), primary key (a))
+partition by list (ascii(a))
+(partition p1 values in (65));
+#insert into t1 values ('A');
+#replace into t1 values ('A');
+#drop table t1;
diff --git a/mysql-test/t/partition_error.test b/mysql-test/t/partition_error.test
index 20703b979f1..5fc2097cc52 100644
--- a/mysql-test/t/partition_error.test
+++ b/mysql-test/t/partition_error.test
@@ -33,7 +33,7 @@ partitions 2;
#
# Partition by key list, wrong result type
#
---error ER_PARTITION_FUNC_NOT_ALLOWED_ERROR
+--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -109,7 +109,7 @@ partitions 3
#
# Partition by hash, invalid result type
#
---error ER_PARTITION_FUNC_NOT_ALLOWED_ERROR
+--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -533,7 +533,7 @@ partitions 2
#
# Partition by range, wrong result type of partition function
#
---error ER_PARTITION_FUNC_NOT_ALLOWED_ERROR
+--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -769,10 +769,11 @@ partition by range (a)
#
# Bug 18198 Partitions: Verify that erroneus partition functions doesn't work
#
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
create table t1 (v varchar(12))
partition by range (ascii(v))
(partition p0 values less than (10));
-drop table t1;
+#drop table t1;
-- error 1064
create table t1 (a int)
@@ -790,7 +791,7 @@ partition by hash (extract(hour from convert_tz(a, '+00:00', '+00:00')));
create table t1 (a int)
partition by range (a + (select count(*) from t1))
(partition p1 values less than (1));
--- error ER_PARTITION_FUNC_NOT_ALLOWED_ERROR
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
create table t1 (a char(10))
partition by hash (extractvalue(a,'a'));
diff --git a/mysql-test/t/partition_grant.test b/mysql-test/t/partition_grant.test
index 0d30ad01c7a..cf944e507fd 100644
--- a/mysql-test/t/partition_grant.test
+++ b/mysql-test/t/partition_grant.test
@@ -63,13 +63,13 @@ insert into t1 values (1);
grant alter on mysqltest_1.* to mysqltest_1@localhost;
connect (conn4,localhost,mysqltest_1,,mysqltest_1);
connection conn4;
---error 1514
+--error ER_NO_PARTITION_FOR_GIVEN_VALUE
alter table t1 partition by list (s1) (partition p1 values in (2));
connection default;
grant select, alter on mysqltest_1.* to mysqltest_1@localhost;
disconnect conn4;
connect (conn5,localhost,mysqltest_1,,mysqltest_1);
---error 1514
+--error ER_NO_PARTITION_FOR_GIVEN_VALUE
alter table t1 partition by list (s1) (partition p1 values in (2));
disconnect conn5;
connection default;
diff --git a/mysql-test/t/partition_hash.test b/mysql-test/t/partition_hash.test
index dc527cad2b7..98add060a76 100644
--- a/mysql-test/t/partition_hash.test
+++ b/mysql-test/t/partition_hash.test
@@ -10,18 +10,6 @@ drop table if exists t1;
--enable_warnings
#
-# BUG 18198: Partition functions handling
-#
-create table t1 (a varchar(10) charset latin1 collate latin1_bin)
-partition by hash(length(a))
-partitions 10;
-insert into t1 values (''),(' '),('a'),('a '),('a ');
-explain partitions select * from t1 where a='a ';
-explain partitions select * from t1 where a='a';
-explain partitions select * from t1 where a='a ' OR a='a';
-drop table t1;
-
-#
# More partition pruning tests, especially on interval walking
#
create table t1 (a int unsigned)
@@ -134,6 +122,7 @@ drop table t1;
--disable_warnings
CREATE TABLE t1 (s1 int) ENGINE=BLACKHOLE PARTITION BY HASH (s1);
--enable_warnings
+--error 0,ER_BINLOG_LOGGING_IMPOSSIBLE
INSERT INTO t1 VALUES (0);
DROP TABLE t1;
diff --git a/mysql-test/t/partition_list.test b/mysql-test/t/partition_list.test
index 1e420cfe6ed..1c76de9d55a 100644
--- a/mysql-test/t/partition_list.test
+++ b/mysql-test/t/partition_list.test
@@ -179,4 +179,8 @@ insert into t1 values (null);
select * from t1;
drop table t1;
+--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (a char(1))
+partition by list (ascii(ucase(a)))
+(partition p1 values in (2));
diff --git a/mysql-test/t/partition_mgm.test b/mysql-test/t/partition_mgm.test
index 8458d47d634..a06f8d1aee5 100644
--- a/mysql-test/t/partition_mgm.test
+++ b/mysql-test/t/partition_mgm.test
@@ -20,7 +20,7 @@ subpartition sp01, subpartition sp02));
drop table t1;
CREATE TABLE t1 (f_date DATE, f_varchar VARCHAR(30))
-PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER)) PARTITIONS 2;
+PARTITION BY HASH(YEAR(f_date)) PARTITIONS 2;
SHOW CREATE TABLE t1;
--replace_result $MYSQLTEST_VARDIR "hello"
diff --git a/mysql-test/t/partition_pruning.test b/mysql-test/t/partition_pruning.test
index a60846f18ff..31008d2b011 100644
--- a/mysql-test/t/partition_pruning.test
+++ b/mysql-test/t/partition_pruning.test
@@ -538,18 +538,17 @@ select * from t1 where f_int1 between 5 and 15 order by f_int1;
drop table t1;
# part2: bug in pruning code
-create table t1 (a char(10) binary)
-partition by list(length(a))
- (partition p1 values in (1),
- partition p2 values in (2),
- partition p3 values in (3),
- partition p4 values in (4),
- partition p5 values in (5)
-);
-insert into t1 values ('a'),('bb'),('ccc'),('dddd'),('eeEee');
-select * from t1 where a>='a' and a <= 'dddd';
-explain partitions select * from t1 where a>='a' and a <= 'dddd';
-drop table t1;
+#create table t1 (a char(10) binary)
+#partition by list(ascii(a))
+# (partition p1 values in (ascii('a')),
+# partition p2 values in (ascii('b')),
+# partition p3 values in (ascii('c')),
+# partition p4 values in (ascii('d')),
+# partition p5 values in (ascii('e')));
+#insert into t1 values ('a'),('bb'),('ccc'),('dddd'),('eeEee');
+#select * from t1 where a>='a' and a <= 'dddd';
+#explain partitions select * from t1 where a>='a' and a <= 'dddd';
+#drop table t1;
# BUG#18659: Assertion failure when subpartitioning is used and partition is
# "IS NULL"
@@ -692,20 +691,47 @@ explain partitions select * from t1 where a = 18446744073709551000;
explain partitions select * from t1 where a = 18446744073709551613;
explain partitions select * from t1 where a = 18446744073709551614;
drop table t1;
-
-create table t1 (a int)
- partition by range((a & 0xFF) << 56) (
- partition p0 values less than (0x40 << 56),
- partition p1 values less than (0x80 << 56),
- partition p2 values less than (0xFF << 56)
+#
+# Test all variants of usage for interval_via_mapping
+# and interval_via_walking
+#
+# t1 will use interval_via_mapping since it uses a
+# monotonic function, whereas t2 will use
+# interval_via_walking since the intervals are short
+# and the function isn't monotonic (it is, but it isn't
+# discovered in this version).
+#
+ create table t1 (a int)
+ partition by range(a) (
+ partition p0 values less than (64),
+ partition p1 values less than (128),
+ partition p2 values less than (255)
);
-insert into t1 values (0x20), (0x20), (0x41), (0x41), (0xFE), (0xFE);
+create table t2 (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 values (0x20), (0x20), (0x41), (0x41), (0xFE), (0xFE);
+insert into t2 values (0x20), (0x20), (0x41), (0x41), (0xFE), (0xFE);
explain partitions select * from t1 where a=0;
+explain partitions select * from t2 where a=0;
explain partitions select * from t1 where a=0xFE;
-explain partitions select * from t1 where a>0xFE and a<= 0xFF;
+explain partitions select * from t2 where a=0xFE;
+explain partitions select * from t1 where a > 0xFE AND a <= 0xFF;
+explain partitions select * from t2 where a > 0xFE AND a <= 0xFF;
+explain partitions select * from t1 where a >= 0xFE AND a <= 0xFF;
+explain partitions select * from t2 where a >= 0xFE AND a <= 0xFF;
+explain partitions select * from t1 where a < 64 AND a >= 63;
+explain partitions select * from t2 where a < 64 AND a >= 63;
+explain partitions select * from t1 where a <= 64 AND a >= 63;
+explain partitions select * from t2 where a <= 64 AND a >= 63;
drop table t1;
-
+drop table t2;
+
create table t1(a bigint unsigned not null) partition by range(a+0) (
partition p1 values less than (10),
partition p2 values less than (20),
@@ -735,3 +761,34 @@ insert into t1 values (-15),(-5),(5),(15),(-15),(-5),(5),(15);
explain partitions select * from t1 where a>-2 and a <=0;
drop table t1;
+
+#
+# BUG#27927 Partition pruning not optimal with TO_DAYS function
+#
+
+CREATE TABLE t1 ( recdate DATETIME NOT NULL )
+PARTITION BY RANGE( TO_DAYS(recdate) ) (
+ PARTITION p0 VALUES LESS THAN ( TO_DAYS('2007-03-08') ),
+ PARTITION p1 VALUES LESS THAN ( TO_DAYS('2007-04-01') )
+);
+INSERT INTO t1 VALUES ('2007-03-01 12:00:00');
+INSERT INTO t1 VALUES ('2007-03-07 12:00:00');
+INSERT INTO t1 VALUES ('2007-03-08 12:00:00');
+INSERT INTO t1 VALUES ('2007-03-15 12:00:00');
+-- echo must use p0 only:
+explain partitions select * from t1 where recdate < '2007-03-08 00:00:00';
+
+drop table t1;
+CREATE TABLE t1 ( recdate DATETIME NOT NULL )
+PARTITION BY RANGE( YEAR(recdate) ) (
+ PARTITION p0 VALUES LESS THAN (2006),
+ PARTITION p1 VALUES LESS THAN (2007)
+);
+INSERT INTO t1 VALUES ('2005-03-01 12:00:00');
+INSERT INTO t1 VALUES ('2005-03-01 12:00:00');
+INSERT INTO t1 VALUES ('2006-03-01 12:00:00');
+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;
diff --git a/mysql-test/t/partition_range.test b/mysql-test/t/partition_range.test
index 84f67febe8b..50d850913bc 100644
--- a/mysql-test/t/partition_range.test
+++ b/mysql-test/t/partition_range.test
@@ -12,45 +12,45 @@ drop table if exists t1;
#
# BUG 18198: Various tests for partition functions
#
-create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int)
-partition by range (length(a) * b)
-(partition p0 values less than (2), partition p1 values less than (400));
-insert into t1 values ('a ', 2),('a',3);
-drop table t1;
-
-create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int)
-partition by range (b* length(a) * b)
-(partition p0 values less than (2), partition p1 values less than (400));
-insert into t1 values ('a ', 2),('a',3);
-drop table t1;
-
-create table t1 (a varchar(10) charset latin1 collate latin1_bin,
- b varchar(10) charset latin1 collate latin1_bin)
-partition by range (length(b) * length(a))
-(partition p0 values less than (2), partition p1 values less than (400));
-insert into t1 values ('a ', 'b '),('a','b');
-drop table t1;
-
-create table t1 (a varchar(10) charset latin1 collate latin1_bin,
- b varchar(10) charset latin1 collate latin1_bin)
-partition by range (length(a) * length(b))
-(partition p0 values less than (2), partition p1 values less than (400));
-insert into t1 values ('a ', 'b '),('a','b');
-drop table t1;
-
-create table t1 (a varchar(10) charset latin1 collate latin1_bin,
- b varchar(10) charset latin1 collate latin1_bin, c int)
-partition by range (length(a) * c)
-(partition p0 values less than (2), partition p1 values less than (400));
-insert into t1 values ('a ', 'b ', 2),('a','b', 3);
-drop table t1;
-
-create table t1 (a varchar(10) charset latin1 collate latin1_bin,
- b varchar(10) charset latin1 collate latin1_bin, c int)
-partition by range (c * length(a))
-(partition p0 values less than (2), partition p1 values less than (400));
-insert into t1 values ('a ', 'b ', 2),('a','b', 3);
-drop table t1;
+#create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int)
+#partition by range (ascii(a) * b)
+#(partition p0 values less than (2), partition p1 values less than (4000));
+#insert into t1 values ('a ', 2),('a',3);
+#drop table t1;
+
+#create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int)
+#partition by range (b* ascii(a) * b)
+#(partition p0 values less than (2), partition p1 values less than (4000));
+#insert into t1 values ('a ', 2),('a',3);
+#drop table t1;
+
+#create table t1 (a varchar(10) charset latin1 collate latin1_bin,
+# b varchar(10) charset latin1 collate latin1_bin)
+#partition by range (ascii(b) * ascii(a))
+#(partition p0 values less than (2), partition p1 values less than (40000));
+#insert into t1 values ('a ', 'b '),('a','b');
+#drop table t1;
+
+#create table t1 (a varchar(10) charset latin1 collate latin1_bin,
+# b varchar(10) charset latin1 collate latin1_bin)
+#partition by range (ascii(a) * ascii(b))
+#(partition p0 values less than (2), partition p1 values less than (40000));
+#insert into t1 values ('a ', 'b '),('a','b');
+#drop table t1;
+
+#create table t1 (a varchar(10) charset latin1 collate latin1_bin,
+# b varchar(10) charset latin1 collate latin1_bin, c int)
+#partition by range (ascii(a) * c)
+#(partition p0 values less than (2), partition p1 values less than (4000));
+#insert into t1 values ('a ', 'b ', 2),('a','b', 3);
+#drop table t1;
+
+#create table t1 (a varchar(10) charset latin1 collate latin1_bin,
+# b varchar(10) charset latin1 collate latin1_bin, c int)
+#partition by range (c * ascii(a))
+#(partition p0 values less than (2), partition p1 values less than (4000));
+#insert into t1 values ('a ', 'b ', 2),('a','b', 3);
+#drop table t1;
#
# More checks for partition pruning
@@ -733,29 +733,27 @@ DROP TABLE t1;
#
# Bug 18198: Try with a couple of cases using VARCHAR fields in
# partition function.
-create table t1 (a varchar(20))
-partition by range (crc32(md5(a)))
-(partition p0 values less than (100),
- partition p1 values less than maxvalue);
-
-insert into t1 values ("12345678901234567890");
-insert into t1 values ("A2345678901234567890");
-insert into t1 values ("B2345678901234567890");
-insert into t1 values ("1234567890123456789");
-insert into t1 values ("1234567890123456");
-select * from t1;
-explain partitions select * from t1 where a = "12345678901234567890";
-explain partitions select * from t1 where a = "12345678901234567890" OR
- a = "A2345678901234567890" OR
- a = "B2345678901234567890" OR
- a = "C2345678901234567890";
-explain partitions select * from t1 where a = "01234567890123456";
-select * from t1 where a = "01234567890123456";
-select * from t1 where a = "12345678901234567890" OR
- a = "A2345678901234567890" OR
- a = "B2345678901234567890" OR
- a = "C2345678901234567890";
-select * from t1 where a = "12345678901234567890";
-
-
-drop table t1;
+#create table t1 (a varchar(20))
+#partition by range (ascii(a))
+#(partition p0 values less than (100),
+# partition p1 values less than maxvalue);
+
+#insert into t1 values ("12345678901234567890");
+#insert into t1 values ("A2345678901234567890");
+#insert into t1 values ("B2345678901234567890");
+#insert into t1 values ("1234567890123456789");
+#insert into t1 values ("1234567890123456");
+#select * from t1;
+#explain partitions select * from t1 where a = "12345678901234567890";
+#explain partitions select * from t1 where a = "12345678901234567890" OR
+# a = "A2345678901234567890" OR
+# a = "B2345678901234567890" OR
+# a = "C2345678901234567890";
+#explain partitions select * from t1 where a = "01234567890123456";
+#select * from t1 where a = "01234567890123456";
+#select * from t1 where a = "12345678901234567890" OR
+# a = "A2345678901234567890" OR
+# a = "B2345678901234567890" OR
+# a = "C2345678901234567890";
+#select * from t1 where a = "12345678901234567890";
+#drop table t1;
diff --git a/mysql-test/t/plugin-master.opt b/mysql-test/t/plugin-master.opt
new file mode 100644
index 00000000000..367d5233e0e
--- /dev/null
+++ b/mysql-test/t/plugin-master.opt
@@ -0,0 +1 @@
+$EXAMPLE_PLUGIN_OPT
diff --git a/mysql-test/t/plugin.test b/mysql-test/t/plugin.test
index 80c1de00b8e..fb6d5febe45 100644
--- a/mysql-test/t/plugin.test
+++ b/mysql-test/t/plugin.test
@@ -18,9 +18,9 @@ SELECT * FROM t1;
DROP TABLE t1;
-# Waiting for fix to BUG#22694
-#UNINSTALL PLUGIN example;
-#UNINSTALL PLUGIN EXAMPLE;
+UNINSTALL PLUGIN example;
+--error 1305
+UNINSTALL PLUGIN EXAMPLE;
--error 1305
UNINSTALL PLUGIN non_exist;
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index 44f9bf350b2..dea86bdd2fa 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -1,4 +1,5 @@
-- source include/not_embedded.inc
+-- source include/have_log_bin.inc
#
# SQL Syntax for Prepared Statements test
#
@@ -34,13 +35,13 @@ deallocate prepare no_such_statement;
execute stmt1;
# Nesting ps commands is not allowed:
---error 1064
+--error ER_UNSUPPORTED_PS
prepare stmt2 from 'prepare nested_stmt from "select 1"';
---error 1064
+--error ER_UNSUPPORTED_PS
prepare stmt2 from 'execute stmt1';
---error 1064
+--error ER_UNSUPPORTED_PS
prepare stmt2 from 'deallocate prepare z';
# PS insert
@@ -1118,8 +1119,111 @@ EXECUTE stmt USING @a;
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
---echo End of 4.1 tests.
+#
+# Bug#19182: CREATE TABLE bar (m INT) SELECT n FROM foo; doesn't work
+# from stored procedure.
+#
+# The cause of a bug was that cached LEX::create_list was modified,
+# and then together with LEX::key_list was reset.
+#
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+
+CREATE TABLE t1 (i INT);
+
+PREPARE st_19182
+FROM "CREATE TABLE t2 (i INT, j INT, KEY (i), KEY(j)) SELECT i FROM t1";
+
+EXECUTE st_19182;
+DESC t2;
+
+DROP TABLE t2;
+
+# Check that on second execution we don't loose 'j' column and the keys
+# on 'i' and 'j' columns.
+EXECUTE st_19182;
+DESC t2;
+
+DEALLOCATE PREPARE st_19182;
+DROP TABLE t2, t1;
+
+#
+# Bug #22060 "ALTER TABLE x AUTO_INCREMENT=y in SP crashes server"
+#
+# Code which implemented CREATE/ALTER TABLE and CREATE DATABASE
+# statement modified HA_CREATE_INFO structure in LEX, making these
+# statements PS/SP-unsafe (their re-execution might have resulted
+# in incorrect results).
+#
+--disable_warnings
+drop database if exists mysqltest;
+drop table if exists t1, t2;
+--enable_warnings
+# CREATE TABLE and CREATE TABLE ... SELECT
+create database mysqltest character set utf8;
+prepare stmt1 from "create table mysqltest.t1 (c char(10))";
+prepare stmt2 from "create table mysqltest.t2 select 'test'";
+execute stmt1;
+execute stmt2;
+show create table mysqltest.t1;
+show create table mysqltest.t2;
+drop table mysqltest.t1;
+drop table mysqltest.t2;
+alter database mysqltest character set latin1;
+execute stmt1;
+execute stmt2;
+show create table mysqltest.t1;
+show create table mysqltest.t2;
+drop database mysqltest;
+deallocate prepare stmt1;
+deallocate prepare stmt2;
+#
+# CREATE TABLE with DATA DIRECTORY option
+#
+--disable_warnings
+--disable_query_log
+eval prepare stmt from "create table t1 (c char(10)) data directory='$MYSQLTEST_VARDIR/tmp'";
+--enable_query_log
+execute stmt;
+#
+# DATA DIRECTORY option does not always work: if the operating
+# system does not support symlinks, have_symlinks option is automatically
+# disabled.
+# In this case DATA DIRECTORY is silently ignored when
+# creating a table, and is not output by SHOW CREATE TABLE.
+#
+--disable_result_log
+show create table t1;
+--enable_result_log
+drop table t1;
+execute stmt;
+--disable_result_log
+show create table t1;
+--enable_result_log
+--enable_warnings
+drop table t1;
+deallocate prepare stmt;
+#
+#
+# Bug #27937: crash on the second execution for prepared statement
+# from UNION with ORDER BY an expression containing RAND()
+#
+
+CREATE TABLE t1(a int);
+INSERT INTO t1 VALUES (2), (3), (1);
+
+PREPARE st1 FROM
+ '(SELECT a FROM t1) UNION (SELECT a+10 FROM t1) ORDER BY RAND()*0+a';
+
+EXECUTE st1;
+EXECUTE st1;
+
+DEALLOCATE PREPARE st1;
+DROP TABLE t1;
+
+--echo End of 4.1 tests.
############################# 5.0 tests start ################################
#
@@ -1597,6 +1701,77 @@ EXECUTE stmt USING @arg;
DEALLOCATE PREPARE stmt;
DROP TABLE t1,t2;
+#
+# Bug#4968 "Stored procedure crash if cursor opened on altered table"
+# The bug is not repeatable any more after the fix for
+# Bug#15217 "Bug #15217 Using a SP cursor on a table created with PREPARE
+# fails with weird error", however ALTER TABLE is not re-execution friendly
+# and that caused a valgrind warning. Check that the warning is gone.
+#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (s1 char(20));
+prepare stmt from "alter table t1 modify s1 int";
+execute stmt;
+execute stmt;
+drop table t1;
+deallocate prepare stmt;
+
+#
+# Bug#6895 "Prepared Statements: ALTER TABLE DROP COLUMN does nothing"
+#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int, b int);
+prepare s_6895 from "alter table t1 drop column b";
+execute s_6895;
+show columns from t1;
+drop table t1;
+create table t1 (a int, b int);
+execute s_6895;
+show columns from t1;
+drop table t1;
+create table t1 (a int, b int);
+execute s_6895;
+show columns from t1;
+deallocate prepare s_6895;
+drop table t1;
+
+#
+# Bug #22060 "ALTER TABLE x AUTO_INCREMENT=y in SP crashes server"
+#
+# 5.0 part of the test.
+#
+
+# ALTER TABLE
+create table t1 (i int primary key auto_increment) comment='comment for table t1';
+create table t2 (i int, j int, k int);
+prepare stmt from "alter table t1 auto_increment=100";
+execute stmt;
+show create table t1;
+# Let us trash table-cache's memory
+flush tables;
+select * from t2;
+execute stmt;
+show create table t1;
+deallocate prepare stmt;
+drop table t1, t2;
+# 5.1 part of the test.
+# CREATE DATABASE
+set @old_character_set_server= @@character_set_server;
+set @@character_set_server= latin1;
+prepare stmt from "create database mysqltest_1";
+execute stmt;
+show create database mysqltest_1;
+drop database mysqltest_1;
+set @@character_set_server= utf8;
+execute stmt;
+show create database mysqltest_1;
+drop database mysqltest_1;
+deallocate prepare stmt;
+set @@character_set_server= @old_character_set_server;
#
@@ -1627,6 +1802,14 @@ execute stmt;
deallocate prepare stmt;
drop tables t1;
+#
+# Bug #28509: strange behaviour: passing a decimal value to PS
+#
+prepare stmt from "create table t1 select ?";
+set @a=1.0;
+execute stmt using @a;
+show create table t1;
+drop table t1;
--echo End of 5.0 tests.
@@ -1832,10 +2015,17 @@ delimiter ;|
select func_1(), func_1(), func_1() from dual;
drop function func_1;
drop procedure proc_1;
+
+# make the output deterministic:
+# the order used in SHOW OPEN TABLES
+# is too much implementation dependent
+--disable_ps_protocol
flush tables;
select Host, User from mysql.user limit 0;
select Host, Db from mysql.host limit 0;
show open tables from mysql;
+--enable_ps_protocol
+
prepare abc from "flush tables";
execute abc;
show open tables from mysql;
@@ -2571,5 +2761,21 @@ connection default;
DROP TABLE t1, t2;
+#
+# Bug #24879 Prepared Statements: CREATE TABLE (UTF8 KEY) produces a growing
+# key length
+#
+# Test that parse information is not altered by subsequent executions of a
+# prepared statement
+#
+drop table if exists t1;
+prepare stmt
+from "create table t1 (c char(100) character set utf8, key (c(10)))";
+execute stmt;
+show create table t1;
+drop table t1;
+execute stmt;
+show create table t1;
+drop table t1;
--echo End of 5.1 tests.
diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test
index df3d1f0791c..42bf39890de 100644
--- a/mysql-test/t/ps_1general.test
+++ b/mysql-test/t/ps_1general.test
@@ -321,10 +321,8 @@ prepare stmt4 from ' show status like ''Threads_running'' ';
execute stmt4;
prepare stmt4 from ' show variables like ''sql_mode'' ';
execute stmt4;
---error ER_UNKNOWN_STORAGE_ENGINE
-prepare stmt4 from ' show engine bdb logs ';
---error ER_UNKNOWN_STORAGE_ENGINE
-prepare stmt4 from ' show engine foo logs ';
+prepare stmt4 from ' show engine myisam logs ';
+execute stmt4;
prepare stmt4 from ' show grants for user ';
prepare stmt4 from ' show create table t2 ';
prepare stmt4 from ' show master status ';
@@ -409,13 +407,17 @@ deallocate prepare stmt_do ;
deallocate prepare stmt_set ;
## nonsense like prepare of prepare,execute or deallocate
---error 1064
+--error ER_UNSUPPORTED_PS
prepare stmt1 from ' prepare stmt2 from '' select 1 '' ' ;
---error 1064
+--error ER_UNSUPPORTED_PS
prepare stmt1 from ' execute stmt2 ' ;
---error 1064
+--error ER_UNSUPPORTED_PS
prepare stmt1 from ' deallocate prepare never_prepared ' ;
+## We don't support alter view as prepared statements
+--error ER_UNSUPPORTED_PS
+prepare stmt1 from 'alter view v1 as select 2';
+
## switch the database connection
--error ER_UNSUPPORTED_PS
prepare stmt4 from ' use test ' ;
@@ -575,7 +577,7 @@ prepare stmt1 from ' rename table t5 to t6, t7 to t8 ' ;
create table t5 (a int) ;
# rename must fail, t7 does not exist
# Clean up the filename here because embedded server reports whole path
---replace_result \\ / $MYSQLTEST_VARDIR . /master-data/ "" t7.frm t7
+--replace_result $MYSQLTEST_VARDIR . master-data/ '' t7.frm t7
--error 1017
execute stmt1 ;
create table t7 (a int) ;
diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test
index 8920b424021..d06698cdb17 100644
--- a/mysql-test/t/query_cache.test
+++ b/mysql-test/t/query_cache.test
@@ -1,5 +1,10 @@
-- source include/have_query_cache.inc
+# Disabled on embedded due to bug #30710, "query_cache.test fails on
+# embedded w/ per-column privs test". Please re-enable when that bug
+# is resolved.
+-- source include/not_embedded.inc
+
#
# Tests with query cache
#
@@ -93,7 +98,11 @@ show status like "Qcache_queries_in_cache";
select sql_cache * from t1 union select * from t1;
set query_cache_type=2;
select sql_cache * from t1 union select * from t1;
+
+# all sql_cache statements, except for the first select, are ignored.
select * from t1 union select sql_cache * from t1;
+select * from t1 where a IN (select sql_cache a from t1);
+select * from t1 where a IN (select a from t1 union select sql_cache a from t1);
show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
set query_cache_type=on;
@@ -106,6 +115,15 @@ show status like "Qcache_queries_in_cache";
# SELECT SQL_NO_CACHE
#
select sql_no_cache * from t1;
+# sql_no_cache can occur in any nested select to turn on cacheing for the whole
+# expression and it will always override a sql_cache statement.
+select * from t1 union select sql_no_cache * from t1;
+select * from t1 where a IN (select sql_no_cache a from t1);
+select * from t1 where a IN (select a from t1 union select sql_no_cache a from t1);
+select sql_cache sql_no_cache * from t1;
+select sql_cache * from t1 union select sql_no_cache * from t1;
+select sql_cache * from t1 where a IN (select sql_no_cache a from t1);
+select sql_cache * from t1 where a IN (select a from t1 union select sql_no_cache a from t1);
show status like "Qcache_queries_in_cache";
drop table t1;
#
@@ -865,7 +883,7 @@ drop procedure f4;
drop table t1;
set GLOBAL query_cache_size=0;
-# End of 4.1 tests
+--echo End of 4.1 tests
#
# Bug #10303: problem with last_query_cost
@@ -928,3 +946,391 @@ select * from t1;
drop table t1;
set global query_cache_size=0;
+
+#
+# Query cache and changes to system variables
+#
+
+create table t1 (a int);
+insert into t1 values (1),(2),(3);
+set GLOBAL query_cache_type=1;
+set GLOBAL query_cache_limit=10000;
+set GLOBAL query_cache_min_res_unit=0;
+set GLOBAL query_cache_size= 100000;
+
+# default_week_format
+reset query cache;
+set LOCAL default_week_format = 0;
+select week('2007-01-04');
+select week('2007-01-04') from t1;
+select extract(WEEK FROM '2007-01-04') from t1;
+
+set LOCAL default_week_format = 2;
+select week('2007-01-04');
+select week('2007-01-04') from t1;
+select extract(WEEK FROM '2007-01-04') from t1;
+
+# div_precision_increment
+reset query cache;
+set LOCAL div_precision_increment=2;
+select 1/7;
+select 1/7 from t1;
+
+set LOCAL div_precision_increment=4;
+select 1/7;
+select 1/7 from t1;
+
+drop table t1;
+
+CREATE TABLE t1 (a VARCHAR(200), b TEXT, FULLTEXT (a,b));
+INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'),
+ ('Full-text indexes', 'are called collections'),
+ ('Only MyISAM tables','support collections'),
+ ('Function MATCH ... AGAINST()','is used to do a search'),
+ ('Full-text search in MySQL', 'implements vector space model');
+
+
+set GLOBAL ft_boolean_syntax='+ -><()~*:""&|';
+
+select *, MATCH(a,b) AGAINST("+called +collections" IN BOOLEAN MODE) as x from t1;
+
+# swap +/-
+set GLOBAL ft_boolean_syntax='- +><()~*:""&|';
+
+select *, MATCH(a,b) AGAINST("+called +collections" IN BOOLEAN MODE) as x from t1;
+
+# If in the future we need to cache queries with functions
+# be sure not to cause dead lock if the query cache is flushed
+# while inserting a query in the query cache.
+delimiter |;
+create function change_global() returns integer deterministic
+begin
+ set global ft_boolean_syntax='+ -><()~*:""&|';
+ return 1;
+end|
+delimiter ;|
+select *, change_global() from t1;
+drop function change_global;
+
+drop table t1;
+
+set GLOBAL query_cache_type=default;
+set GLOBAL query_cache_limit=default;
+set GLOBAL query_cache_min_res_unit=default;
+set GLOBAL query_cache_size= default;
+
+
+#
+# Bug #28897 UUID() returns non-unique values when query cache is enabled
+#
+
+set GLOBAL query_cache_size=1000000;
+
+create table t1 (a char);
+insert into t1 values ('c');
+
+let $q1= `select UUID(), a from t1`;
+let $q2= `select UUID(), a from t1`;
+
+# disabling the logging of the query because the UUIDs are different each run.
+--disable_query_log
+eval select a from t1 where "$q1" = "$q2";
+--enable_query_log
+
+drop table t1;
+
+set GLOBAL query_cache_size= default;
+
+#
+# Bug #29053 SQL_CACHE in UNION causes non-deterministic functions to be cached
+#
+
+set GLOBAL query_cache_size=1000000;
+
+create table t1 (a char);
+insert into t1 values ('c');
+
+let $q1= `select RAND() from t1 union select sql_cache 1 from t1;`;
+let $q2= `select RAND() from t1 union select sql_cache 1 from t1;`;
+
+# disabling the logging of the query because the times are different each run.
+--disable_query_log
+eval select a from t1 where "$q1" = "$q2";
+--enable_query_log
+
+drop table t1;
+
+set GLOBAL query_cache_size= default;
+
+#
+# Bug#29856: Insufficient buffer space led to a server crash.
+#
+SET GLOBAL query_cache_size=64*1024*1024;
+CREATE TABLE t1 (id INT);
+DELIMITER |;
+CREATE PROCEDURE proc29856(IN theUPC TEXT)
+BEGIN
+ SET @stmtStr := '';
+ SELECT CONCAT("SELECT id FROM t1 WHERE id IN (",theUPC,")") INTO @stmtStr;
+ PREPARE stmt FROM @stmtStr;
+ EXECUTE stmt;
+END |
+DELIMITER ;|
+CALL proc29856('1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,
+25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,
+51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,
+77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,
+102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,
+121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,
+140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,
+159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,
+178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,
+197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,
+216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,
+235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,
+254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,
+273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,
+292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,
+311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,
+330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,
+349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,
+368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,
+387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,
+406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,
+425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,
+444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,
+463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,
+482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500,
+501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,
+520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,
+539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,
+558,559,560,561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,
+577,578,579,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,
+596,597,598,599,600,601,602,603,604,605,606,607,608,609,610,611,612,613,614,
+615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,632,633,
+634,635,636,637,638,639,640,641,642,643,644,645,646,647,648,649,650,651,652,
+653,654,655,656,657,658,659,660,661,662,663,664,665,666,667,668,669,670,671,
+672,673,674,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,
+691,692,693,694,695,696,697,698,699,700,701,702,703,704,705,706,707,708,709,
+710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,
+729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,
+748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,
+767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,
+786,787,788,789,790,791,792,793,794,795,796,797,798,799,800,801,802,803,804,
+805,806,807,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,
+824,825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,
+843,844,845,846,847,848,849,850,851,852,853,854,855,856,857,858,859,860,861,
+862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879,880,
+881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,
+900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,
+919,920,921,922,923,924,925,926,927,928,929,930,931,932,933,934,935,936,937,
+938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,
+957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,
+976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,
+995,996,997,998,999,1000,1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,
+1011,1012,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023,1024,1025,
+1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,
+1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,
+1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,
+1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,
+1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,
+1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,
+1116,1117,1118,1119,1120,1121,1122,1123,1124,1125,1126,1127,1128,1129,1130,
+1131,1132,1133,1134,1135,1136,1137,1138,1139,1140,1141,1142,1143,1144,1145,
+1146,1147,1148,1149,1150,1151,1152,1153,1154,1155,1156,1157,1158,1159,1160,
+1161,1162,1163,1164,1165,1166,1167,1168,1169,1170,1171,1172,1173,1174,1175,
+1176,1177,1178,1179,1180,1181,1182,1183,1184,1185,1186,1187,1188,1189,1190,
+1191,1192,1193,1194,1195,1196,1197,1198,1199,1200,1201,1202,1203,1204,1205,
+1206,1207,1208,1209,1210,1211,1212,1213,1214,1215,1216,1217,1218,1219,1220,
+1221,1222,1223,1224,1225,1226,1227,1228,1229,1230,1231,1232,1233,1234,1235,
+1236,1237,1238,1239,1240,1241,1242,1243,1244,1245,1246,1247,1248,1249,1250,
+1251,1252,1253,1254,1255,1256,1257,1258,1259,1260,1261,1262,1263,1264,1265,
+1266,1267,1268,1269,1270,1271,1272,1273,1274,1275,1276,1277,1278,1279,1280,
+1281,1282,1283,1284,1285,1286,1287,1288,1289,1290,1291,1292,1293,1294,1295,
+1296,1297,1298,1299,1300,1301,1302,1303,1304,1305,1306,1307,1308,1309,1310,
+1311,1312,1313,1314,1315,1316,1317,1318,1319,1320,1321,1322,1323,1324,1325,
+1326,1327,1328,1329,1330,1331,1332,1333,1334,1335,1336,1337,1338,1339,1340,
+1341,1342,1343,1344,1345,1346,1347,1348,1349,1350,1351,1352,1353,1354,1355,
+1356,1357,1358,1359,1360,1361,1362,1363,1364,1365,1366,1367,1368,1369,1370,
+1371,1372,1373,1374,1375,1376,1377,1378,1379,1380,1381,1382,1383,1384,1385,
+1386,1387,1388,1389,1390,1391,1392,1393,1394,1395,1396,1397,1398,1399,1400,
+1401,1402,1403,1404,1405,1406,1407,1408,1409,1410,1411,1412,1413,1414,1415,
+1416,1417,1418,1419,1420,1421,1422,1423,1424,1425,1426,1427,1428,1429,1430,
+1431,1432,1433,1434,1435,1436,1437,1438,1439,1440,1441,1442,1443,1444,1445,
+1446,1447,1448,1449,1450,1451,1452,1453,1454,1455,1456,1457,1458,1459,1460,
+1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,
+1476,1477,1478,1479,1480,1481,1482,1483,1484,1485,1486,1487,1488,1489,1490,
+1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,
+1506,1507,1508,1509,1510,1511,1512,1513,1514,1515,1516,1517,1518,1519,1520,
+1521,1522,1523,1524,1525,1526,1527,1528,1529,1530,1531,1532,1533,1534,1535,
+1536,1537,1538,1539,1540,1541,1542,1543,1544,1545,1546,1547,1548,1549,1550,
+1551,1552,1553,1554,1555,1556,1557,1558,1559,1560,1561,1562,1563,1564,1565,
+1566,1567,1568,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,
+1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,1595,
+1596,1597,1598,1599,1600,1601,1602,1603,1604,1605,1606,1607,1608,1609,1610,
+1611,1612,1613,1614,1615,1616,1617,1618,1619,1620,1621,1622,1623,1624,1625,
+1626,1627,1628,1629,1630,1631,1632,1633,1634,1635,1636,1637,1638,1639,1640,
+1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,
+1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1669,1670,
+1671,1672,1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,
+1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,
+1701,1702,1703,1704,1705,1706,1707,1708,1709,1710,1711,1712,1713,1714,1715,
+1716,1717,1718,1719,1720,1721,1722,1723,1724,1725,1726,1727,1728,1729,1730,
+1731,1732,1733,1734,1735,1736,1737,1738,1739,1740,1741,1742,1743,1744,1745,
+1746,1747,1748,1749,1750,1751,1752,1753,1754,1755,1756,1757,1758,1759,1760,
+1761,1762,1763,1764,1765,1766,1767,1768,1769,1770,1771,1772,1773,1774,1775,
+1776,1777,1778,1779,1780,1781,1782,1783,1784,1785,1786,1787,1788,1789,1790,
+1791,1792,1793,1794,1795,1796,1797,1798,1799,1800,1801,1802,1803,1804,1805,
+1806,1807,1808,1809,1810,1811');
+DROP PROCEDURE proc29856;
+DROP TABLE t1;
+SET GLOBAL query_cache_size= default;
+
+#
+# Bug #28249 Query Cache returns wrong result with concurrent insert / certain lock
+#
+--echo Bug#28249 Query Cache returns wrong result with concurrent insert/ certain lock
+connect (user1,localhost,root,,test,,);
+connect (user2,localhost,root,,test,,);
+connect (user3,localhost,root,,test,,);
+
+connection user1;
+
+set GLOBAL query_cache_type=1;
+set GLOBAL query_cache_limit=10000;
+set GLOBAL query_cache_min_res_unit=0;
+set GLOBAL query_cache_size= 100000;
+
+flush tables;
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+create table t1 (a int);
+create table t2 (a int);
+insert into t1 values (1),(2),(3);
+connection user2;
+--echo Locking table T2 with a write lock.
+lock table t2 write;
+
+connection user1;
+--echo Select blocked by write lock.
+--send select *, (select count(*) from t2) from t1;
+--echo Sleeing is ok, because selecting should be done very fast.
+sleep 5;
+
+connection user3;
+--echo Inserting into table T1.
+insert into t1 values (4);
+
+connection user2;
+--echo Unlocking the tables.
+unlock tables;
+
+connection user1;
+--echo Collecting result from previously blocked select.
+#
+# Since the lock ordering rule in thr_multi_lock depends on
+# pointer values, from execution to execution we might have
+# different lock order, and therefore, sometimes lock t1 and block
+# on t2, and sometimes block on t2 right away. In the second case,
+# the following insert succeeds, and only then this select can
+# proceed, and we actually test nothing, as the very first select
+# returns 4 rows right away.
+# It's fine to have a test case that covers the problematic area
+# at least once in a while.
+# We, however, need to disable the result log here to make the
+# test repeatable.
+--disable_result_log
+--reap
+--enable_result_log
+--echo Next select should contain 4 rows, as the insert is long finished.
+select *, (select count(*) from t2) from t1;
+reset query cache;
+select *, (select count(*) from t2) from t1;
+
+drop table t1,t2;
+
+connection default;
+disconnect user1;
+disconnect user2;
+disconnect user3;
+
+#
+# Bug #30269 Query cache eats memory
+#
+--disable_warnings
+DROP DATABASE IF EXISTS bug30269;
+--enable_warnings
+FLUSH STATUS;
+CREATE DATABASE bug30269;
+USE bug30269;
+CREATE TABLE test1 (id int, name varchar(23));
+CREATE VIEW view1 AS SELECT * FROM test1;
+INSERT INTO test1 VALUES (5, 'testit');
+GRANT SELECT (id) ON TABLE bug30269.test1 TO 'bug30269'@'localhost';
+GRANT SELECT ON TABLE bug30269.view1 TO 'bug30269'@'localhost';
+set global query_cache_size= 81920;
+connect (bug30269, localhost, bug30269,,);
+connection bug30269;
+USE bug30269;
+show status like 'Qcache_queries_in_cache';
+--echo # Select statement not stored in query cache because of column privileges.
+SELECT id FROM test1 WHERE id>2;
+show status like 'Qcache_queries_in_cache';
+SELECT id FROM view1 WHERE id>2;
+show status like 'Qcache_queries_in_cache';
+
+connection default;
+DROP DATABASE bug30269;
+disconnect bug30269;
+DROP USER 'bug30269'@'localhost';
+
+set GLOBAL query_cache_type=default;
+set GLOBAL query_cache_limit=default;
+set GLOBAL query_cache_min_res_unit=default;
+set GLOBAL query_cache_size=default;
+--echo End of 5.0 tests
+
+#
+# Bug #28211 RENAME DATABASE and query cache don't play nicely together
+#
+--disable_warnings
+drop database if exists db1;
+drop database if exists db2;
+--enable_warnings
+set GLOBAL query_cache_size=15*1024*1024;
+create database db1;
+use db1;
+create table t1(c1 int)engine=myisam;
+insert into t1(c1) values (1);
+select * from db1.t1 f;
+show status like 'Qcache_queries_in_cache';
+rename schema db1 to db2;
+show status like 'Qcache_queries_in_cache';
+drop database db2;
+set global query_cache_size=default;
+
+--disable_warnings
+drop database if exists db1;
+drop database if exists db3;
+--enable_warnings
+set GLOBAL query_cache_size=15*1024*1024;
+create database db1;
+create database db3;
+use db1;
+create table t1(c1 int) engine=myisam;
+use db3;
+create table t1(c1 int) engine=myisam;
+use db1;
+insert into t1(c1) values (1);
+use mysql;
+select * from db1.t1;
+select c1+1 from db1.t1;
+select * from db3.t1;
+show status like 'Qcache_queries_in_cache';
+rename schema db1 to db2;
+show status like 'Qcache_queries_in_cache';
+drop database db2;
+drop database db3;
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/query_cache_ps_no_prot.test b/mysql-test/t/query_cache_ps_no_prot.test
new file mode 100644
index 00000000000..6f4263eeef9
--- /dev/null
+++ b/mysql-test/t/query_cache_ps_no_prot.test
@@ -0,0 +1,26 @@
+#################### t/query_cache_ps_no_prot.test #####################
+#
+# Test grants with query cache to be run when mysqltest was started
+# without any "--<whatever>-protocol".
+#
+# Last update:
+# 2007-05-03 ML - Move t/query_cache_sql_prepare.test to
+# include/query_cache_sql_prepare.inc
+# - Create this test as non "--<whatever>-protocol" variant.
+#
+
+# We cannot run on embedded server because we use multiple sessions.
+--source include/not_embedded.inc
+
+--source include/have_query_cache.inc
+
+# The file with expected results fits only to a run without
+# ps-protocol/sp-protocol/cursor-protocol/view-protocol.
+if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL
+ + $VIEW_PROTOCOL > 0`)
+{
+ --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
+}
+
+# The main testing script
+--source include/query_cache_sql_prepare.inc
diff --git a/mysql-test/t/query_cache_ps_ps_prot.test b/mysql-test/t/query_cache_ps_ps_prot.test
new file mode 100644
index 00000000000..dc49624788a
--- /dev/null
+++ b/mysql-test/t/query_cache_ps_ps_prot.test
@@ -0,0 +1,25 @@
+#################### t/query_cache_ps_ps_prot.test #####################
+#
+# Test grants with query cache to be run when mysqltest was started
+# without any "--<whatever>-protocol".
+#
+# Last update:
+# 2007-05-03 ML - Move t/query_cache_sql_prepare.test to
+# include/query_cache_sql_prepare.inc
+# - Create this test as "--ps-protocol" only variant.
+#
+
+# We cannot run on embedded server because we use multiple sessions.
+--source include/not_embedded.inc
+
+--source include/have_query_cache.inc
+
+# The file with expected results fits only to a run with "--ps-protocol".
+if (`SELECT $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0
+ OR $PS_PROTOCOL = 0`)
+{
+ --skip Test requires: ps-protocol enabled, other protocols disabled
+}
+
+# The main testing script
+--source include/query_cache_sql_prepare.inc
diff --git a/mysql-test/t/query_cache_sql_prepare.test b/mysql-test/t/query_cache_sql_prepare.test
deleted file mode 100644
index a02388b2ae5..00000000000
--- a/mysql-test/t/query_cache_sql_prepare.test
+++ /dev/null
@@ -1,146 +0,0 @@
-# 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.
-# Query cache is abbreviated as "QC"
-
--- source include/have_query_cache.inc
-# embedded can't make more than one connection, which this test needs
--- source include/not_embedded.inc
-
-connect (con1,localhost,root,,test,$MASTER_MYPORT,);
-connection default;
-
-set global query_cache_size=100000;
-flush status;
-create table t1(c1 int);
-insert into t1 values(1),(10),(100);
-
-# Prepared statements has no parameters, query caching should happen
-prepare stmt1 from "select * from t1 where c1=10";
-show status like 'Qcache_hits';
-execute stmt1;
-show status like 'Qcache_hits';
-execute stmt1;
-show status like 'Qcache_hits';
-execute stmt1;
-show status like 'Qcache_hits';
-# Another prepared statement (same text, same connection), should hit the QC
-prepare stmt2 from "select * from t1 where c1=10";
-execute stmt2;
-show status like 'Qcache_hits';
-execute stmt2;
-show status like 'Qcache_hits';
-execute stmt2;
-show status like 'Qcache_hits';
-# Another prepared statement (same text, other connection), should hit the QC
-connection con1;
-prepare stmt3 from "select * from t1 where c1=10";
-execute stmt3;
-show status like 'Qcache_hits';
-execute stmt3;
-show status like 'Qcache_hits';
-execute stmt3;
-show status like 'Qcache_hits';
-connection default;
-# A non-prepared statement (same text, same connection), should hit
-# the QC (as it uses the text protocol like SQL EXECUTE).
-# But if it uses the binary protocol, it will not hit. So we make sure
-# that it uses the text protocol:
--- disable_ps_protocol
-select * from t1 where c1=10;
-show status like 'Qcache_hits';
- # A non-prepared statement (same text, other connection), should hit
-# the QC. To test that it hits the result of SQL EXECUTE, we need to
-# empty/repopulate the QC (to remove the result from the non-prepared
-# SELECT just above).
-flush tables;
-execute stmt1;
-show status like 'Qcache_hits';
-connection con1;
-select * from t1 where c1=10;
-show status like 'Qcache_hits';
--- enable_ps_protocol
-connection default;
-
-# Prepared statement has parameters, query caching should not happen
-prepare stmt1 from "select * from t1 where c1=?";
-show status like 'Qcache_hits';
-set @a=1;
-execute stmt1 using @a;
-show status like 'Qcache_hits';
-set @a=100;
-execute stmt1 using @a;
-show status like 'Qcache_hits';
-set @a=10;
-execute stmt1 using @a;
-show status like 'Qcache_hits';
-
-# See if enabling/disabling the query cache between PREPARE and
-# EXECUTE is an issue; the expected result is that the query cache
-# will not be used.
-# Indeed, decision to read/write the query cache is taken at PREPARE
-# time, so if the query cache was disabled at PREPARE time then no
-# execution of the statement will read/write the query cache.
-# If the query cache was enabled at PREPARE time, but disabled at
-# EXECUTE time, at EXECUTE time the query cache internal functions do
-# nothing so again the query cache is not read/written. But if the
-# query cache is re-enabled before another execution then that
-# execution will read/write the query cache.
-
-# QC is enabled at PREPARE
-prepare stmt1 from "select * from t1 where c1=10";
-# then QC is disabled at EXECUTE
-set global query_cache_size=0;
-show status like 'Qcache_hits';
-execute stmt1;
-show status like 'Qcache_hits';
-execute stmt1;
-show status like 'Qcache_hits';
-execute stmt1;
-show status like 'Qcache_hits';
-# then QC is re-enabled for more EXECUTE.
-set global query_cache_size=100000;
-# Note that this execution will not hit results from the
-# beginning of the test (because QC has been emptied meanwhile by
-# setting its size to 0).
-execute stmt1;
-show status like 'Qcache_hits';
-execute stmt1;
-show status like 'Qcache_hits';
-execute stmt1;
-show status like 'Qcache_hits';
-
-# QC is disabled at PREPARE
-set global query_cache_size=0;
-prepare stmt1 from "select * from t1 where c1=10";
-# then QC is enabled at EXECUTE
-set global query_cache_size=100000;
-show status like 'Qcache_hits';
-execute stmt1;
-show status like 'Qcache_hits';
-execute stmt1;
-show status like 'Qcache_hits';
-execute stmt1;
-show status like 'Qcache_hits';
-
-# QC is disabled at PREPARE
-set global query_cache_size=0;
-prepare stmt1 from "select * from t1 where c1=?";
-# then QC is enabled at EXECUTE
-set global query_cache_size=100000;
-show status like 'Qcache_hits';
-set @a=1;
-execute stmt1 using @a;
-show status like 'Qcache_hits';
-set @a=100;
-execute stmt1 using @a;
-show status like 'Qcache_hits';
-set @a=10;
-execute stmt1 using @a;
-show status like 'Qcache_hits';
-
-
-drop table t1;
-
-set global query_cache_size=0;
-flush status; # reset Qcache status variables for next tests
diff --git a/mysql-test/t/view_query_cache.test b/mysql-test/t/query_cache_with_views.test
index d4ebe45b7ac..d4ebe45b7ac 100644
--- a/mysql-test/t/view_query_cache.test
+++ b/mysql-test/t/query_cache_with_views.test
diff --git a/mysql-test/t/replace.test b/mysql-test/t/replace.test
index 4e88379241c..ff910bdf5cf 100644
--- a/mysql-test/t/replace.test
+++ b/mysql-test/t/replace.test
@@ -25,9 +25,9 @@ drop table t1;
create table t1 (a tinyint not null auto_increment primary key, b char(20) default "default_value");
insert into t1 values (126,"first"),(63, "middle"),(0,"last");
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values (0,"error");
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
replace into t1 values (0,"error");
replace into t1 values (126,"first updated");
replace into t1 values (63,default);
diff --git a/mysql-test/t/row.test b/mysql-test/t/row.test
index d2750fecbac..20d044306a6 100644
--- a/mysql-test/t/row.test
+++ b/mysql-test/t/row.test
@@ -7,10 +7,8 @@ select (1,2,3) IN ((3,2,3), (1,2,3), (1,3,3));
select row(10,2,3) IN (row(3,2,3), row(1,2,3), row(1,3,3));
select row(1,2,3) IN (row(3,NULL,3), row(1,2,3), row(1,3,3));
select row(10,2,3) IN (row(3,NULL,3), row(1,2,3), row(1,3,3));
---disable_ps_warnings
select row('a',1.5,3) IN (row(1,2,3), row('a',1.5,3), row('a','a','a'));
select row('a',0,3) IN (row(3,2,3), row('a','a','3'), row(1,3,3));
---enable_ps_warnings
select row('a',0,3) IN (row(3,2,3), row('a','0','3'), row(1,3,3));
select row('a',1.5,3) IN (row(3,NULL,3), row('a',1.5,3), row(1,3,3));
select row('b',1.5,3) IN (row(3,NULL,3), row('a',1.5,3), row(1,3,3));
diff --git a/mysql-test/t/rpl_000015.test b/mysql-test/t/rpl_000015.test
deleted file mode 100644
index 4c557a7c713..00000000000
--- a/mysql-test/t/rpl_000015.test
+++ /dev/null
@@ -1,47 +0,0 @@
-#####################
-# Change Author: JBM
-# Change Date: 2006-01-17
-# Change: added order by in select
-#####################
-
-connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
-connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK);
-connection master;
-reset master;
-show master status;
-save_master_pos;
-connection slave;
-reset slave;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
-show slave status;
-
-change master to master_host='127.0.0.1';
-# The following needs to be cleaned up when change master is fixed
---replace_result $DEFAULT_MASTER_PORT DEFAULT_MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
-show slave status;
---replace_result $MASTER_MYPORT MASTER_PORT
-eval change master to master_host='127.0.0.1',master_user='root',
- master_password='',master_port=$MASTER_MYPORT;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
-show slave status;
-start slave;
-sync_with_master;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
-show slave status;
-connection master;
---disable_warnings
-drop table if exists t1;
---enable_warnings
-create table t1 (n int, PRIMARY KEY(n));
-insert into t1 values (10),(45),(90);
-sync_slave_with_master;
-connection slave;
-SELECT * FROM t1 ORDER BY n;
-connection master;
-SELECT * FROM t1 ORDER BY n;
-drop table t1;
-sync_slave_with_master;
diff --git a/mysql-test/t/rpl_change_master.test b/mysql-test/t/rpl_change_master.test
deleted file mode 100644
index c031464c95e..00000000000
--- a/mysql-test/t/rpl_change_master.test
+++ /dev/null
@@ -1,37 +0,0 @@
-# Verify that after CHANGE MASTER, replication (I/O thread and SQL
-# thread) restart from where SQL thread left, not from where
-# I/O thread left (some old bug fixed in 4.0.17)
-
-source include/master-slave.inc;
-
-connection master;
-# Make SQL slave thread advance a bit
-create table t1(n int);
-sync_slave_with_master;
-select * from t1;
-# Now stop it and make I/O slave thread be ahead
-stop slave sql_thread;
-connection master;
-insert into t1 values(1);
-insert into t1 values(2);
-save_master_pos;
-connection slave;
---real_sleep 3 # wait for I/O thread to have read updates
-stop slave;
---replace_result $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 7 # 8 # 9 # 23 # 33 #
-show slave status;
-change master to master_user='root';
---replace_result $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 7 # 8 # 9 # 23 # 33 #
-show slave status;
-start slave;
-sync_with_master;
-select * from t1;
-connection master;
-drop table t1;
-save_master_pos;
-connection slave;
-sync_with_master;
-
-# End of 4.1 tests
diff --git a/mysql-test/t/rpl_commit_after_flush.test b/mysql-test/t/rpl_commit_after_flush.test
deleted file mode 100644
index 7a924ddb11e..00000000000
--- a/mysql-test/t/rpl_commit_after_flush.test
+++ /dev/null
@@ -1,11 +0,0 @@
-#####################################
-# Wrapper for rpl_commit_after_flush#
-#####################################
-########################################################
-# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-# Added to skip if ndb is default #
-########################################################
--- source include/not_ndb_default.inc
--- source include/have_innodb.inc
-let $engine_type=innodb;
--- source extra/rpl_tests/rpl_commit_after_flush.test
diff --git a/mysql-test/t/rpl_critical_errors.test b/mysql-test/t/rpl_critical_errors.test
deleted file mode 100644
index ffe00050b01..00000000000
--- a/mysql-test/t/rpl_critical_errors.test
+++ /dev/null
@@ -1,66 +0,0 @@
-# Test for BUG#26551
-#
-
-# This test is unfortunately very fragile and very dependent on the
-# load of the computer. The test is therefore disabled normally. It is
-# entered here to demonstrate how to check that the bug is actually
-# solved.
-
---echo Turn on parsing to run this test
-
-disable_parsing;
-
-source include/master-slave.inc;
-
-connection master;
-CREATE TABLE t1 (data LONGBLOB) ENGINE=MYISAM;
-CREATE TABLE t2 (data LONGBLOB) ENGINE=MYISAM;
-
-INSERT INTO t1 (data) VALUES (repeat('a',1024*1024));
-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;
-sync_slave_with_master;
-
-connection master;
-send INSERT INTO t2 SELECT * FROM t1;
-
-connection master1;
-
-# This sleep is picked so that the query above has started to insert
-# some rows into t2. If it hasn't the slave will not stop below.
-sleep 4;
-
-# SHOW PROCESSLIST;
-
-# Code for the 5.1 server to get the thread id of the thread executing
-# the query above.
-#
-#SET @id = 0;
-#SELECT id INTO @id
-# FROM information_schema.processlist
-# WHERE info LIKE 'INSERT INTO t2%';
-
-# This is the connection that is executing the INSERT INTO t2...
-KILL QUERY 2;
-
-connection slave;
-
-# Here the slave will only stop if the query above actually started
-# inserting some rows into t2. Otherwise, it will hang forever.
-wait_for_slave_to_stop;
-
-# The following should be 0
-SELECT COUNT(*) FROM t2;
-
-# ... and there the error code should be 1317 (ER_QUERY_INTERRUPTED)
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 20 # 22 # 23 # 33 #
-query_vertical SHOW SLAVE STATUS;
-
-enable_parsing;
diff --git a/mysql-test/t/rpl_deadlock_innodb-slave.opt b/mysql-test/t/rpl_deadlock_innodb-slave.opt
deleted file mode 100644
index f4a8c640458..00000000000
--- a/mysql-test/t/rpl_deadlock_innodb-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb --loose-innodb_lock_wait_timeout=4 --slave-transaction-retries=2 --max-relay-log-size=4096
diff --git a/mysql-test/t/rpl_delete_no_where.test b/mysql-test/t/rpl_delete_no_where.test
deleted file mode 100644
index 11adb2e6dd5..00000000000
--- a/mysql-test/t/rpl_delete_no_where.test
+++ /dev/null
@@ -1,6 +0,0 @@
-###################################################
-# By JBM 2006-02-14 added to skip test when NDB #
-##################################################
--- source include/not_ndb_default.inc
-let $engine_type=myisam;
--- source extra/rpl_tests/rpl_delete_no_where.test
diff --git a/mysql-test/t/rpl_dual_pos_advance.test b/mysql-test/t/rpl_dual_pos_advance.test
deleted file mode 100644
index 074aeec63b1..00000000000
--- a/mysql-test/t/rpl_dual_pos_advance.test
+++ /dev/null
@@ -1,114 +0,0 @@
-# This test checks that in a dual-head setup
-# A->B->A, where A has --log-slave-updates (why would it?
-# assume that there is a C as slave of A),
-# then the Exec_master_log_pos of SHOW SLAVE STATUS does
-# not stay too low on B(BUG#13023 due to events ignored because
-# of their server id).
-# It also will test BUG#13861.
-
-source include/master-slave.inc;
-
-
-# set up "dual head"
-
-connection slave;
-reset master;
-
-connection master;
---replace_result $SLAVE_MYPORT SLAVE_PORT
-eval change master to master_host="127.0.0.1",master_port=$SLAVE_MYPORT,master_user="root";
-
-start slave;
-
-# now we test it
-
-connection slave;
-
-create table t1 (n int);
-
-save_master_pos;
-connection master;
-sync_with_master;
-
-# Now test BUG#13861. This will be enabled when Guilhem fixes this
-# bug.
-
-# stop slave
-
-# create table t2 (n int); # create one ignored event
-
-# save_master_pos;
-# connection slave;
-# sync_with_master;
-
-# connection slave;
-
-# show tables;
-
-# save_master_pos;
-
-# create table t3 (n int);
-
-# connection master;
-
-# bug is that START SLAVE UNTIL may stop too late, we test that by
-# asking it to stop before creation of t3.
-
-# start slave until master_log_file="slave-bin.000001",master_log_pos=195;
-
-# wait until it's started (the position below is the start of "CREATE
-# TABLE t2") (otherwise wait_for_slave_to_stop may return at once)
-
-# select master_pos_wait("slave-bin.000001",137);
-
-# wait_for_slave_to_stop;
-
-# then BUG#13861 causes t3 to show up below (because stopped too
-# late).
-
-# show tables;
-
-# start slave;
-
-# BUG#13023 is that Exec_master_log_pos may stay too low "forever":
-
-connection master;
-
-create table t4 (n int); # create 3 ignored events
-create table t5 (n int);
-create table t6 (n int);
-
-save_master_pos;
-connection slave;
-sync_with_master;
-
-connection slave;
-
-save_master_pos;
-
-connection master;
-
-# then BUG#13023 caused hang below ("master" looks behind, while it's
-# not in terms of updates done).
-
-sync_with_master;
-
-show tables;
-
-# cleanup
-
-stop slave;
-reset slave;
-drop table t1,t4,t5,t6; # add t2 and t3 later
-
-save_master_pos;
-connection slave;
-sync_with_master;
-
-# End of 4.1 tests
-
-# Cleanup
-# The A->B->A replication causes the master to start writing relay logs
-# in var/run, remove them
-remove_file $MYSQLTEST_VARDIR/run/master-relay-bin.000001;
-remove_file $MYSQLTEST_VARDIR/run/master-relay-bin.index;
diff --git a/mysql-test/t/rpl_empty_master_crash.test b/mysql-test/t/rpl_empty_master_crash.test
deleted file mode 100644
index 707d1eca8c2..00000000000
--- a/mysql-test/t/rpl_empty_master_crash.test
+++ /dev/null
@@ -1,15 +0,0 @@
-source include/master-slave.inc;
-
---replace_column 1 # 8 # 9 # 16 # 23 # 33 #
-show slave status;
-
-#
-# Load table should not succeed on the master as this is not a slave
-#
---error 1218
-load table t1 from master;
-connection slave;
---error 1188
-load table t1 from master;
-
-# End of 4.1 tests
diff --git a/mysql-test/t/rpl_err_ignoredtable.test b/mysql-test/t/rpl_err_ignoredtable.test
deleted file mode 100644
index 4d4be6ae786..00000000000
--- a/mysql-test/t/rpl_err_ignoredtable.test
+++ /dev/null
@@ -1,66 +0,0 @@
-# Test for
-# Bug #797: If a query is ignored on slave (replicate-ignore-table) the slave
-# still checks that it has the same error as on the master.
-##########################################################################
-# 2006-02-07 JBM Added error code 1022 for NDB Engine + ORDER BY
-##########################################################################
-
--- source include/master-slave.inc
-
-connection master;
-create table t1 (a int primary key);
-create table t4 (a int primary key);
-# generate an error that goes to the binlog
---error 1022, ER_DUP_ENTRY_WITH_KEY_NAME
-insert into t1 values (1),(1);
-insert into t4 values (1),(2);
-save_master_pos;
-connection slave;
-# as the t1 table is ignored on the slave, the slave should be able to sync
-sync_with_master;
-# check that the table has been ignored, because otherwise the test is nonsense
-show tables like 't1';
-show tables like 't4';
-SELECT * FROM test.t4 ORDER BY a;
-connection master;
-drop table t1;
-save_master_pos;
-connection slave;
-sync_with_master;
-
-# Now test that even critical errors (connection killed)
-# are ignored if rules allow it.
-# The "kill" idea was copied from rpl000001.test.
-
-connection master1;
-select get_lock('crash_lock%20C', 10);
-
-connection master;
-create table t2 (a int primary key);
-insert into t2 values(1);
-create table t3 (id int);
-insert into t3 values(connection_id());
-send update t2 set a = a + 1 + get_lock('crash_lock%20C', 10);
-
-connection master1;
-real_sleep 2;
-select (@id := id) - id from t3;
-kill @id;
-drop table t2,t3;
-insert into t4 values (3),(4);
-connection master;
---error 0,1053,2013
-reap;
-connection master1;
-save_master_pos;
-connection slave;
-sync_with_master;
-SELECT * FROM test.t4 ORDER BY a;
-
-connection master1;
-DROP TABLE test.t4;
-save_master_pos;
-connection slave;
-sync_with_master;
-# End of 4.1 tests
-# Adding comment for force manual merge 5.0 -> wl1012. delete me if needed
diff --git a/mysql-test/t/rpl_events.test b/mysql-test/t/rpl_events.test
deleted file mode 100644
index 895e94c438b..00000000000
--- a/mysql-test/t/rpl_events.test
+++ /dev/null
@@ -1,24 +0,0 @@
-##################################################################
-# Author: Giuseppe #
-# Date: 2006-12-20 #
-# Purpose: To test that event effects are replicated #
-# in both row based and statement based format #
-##################################################################
-
-set global event_scheduler=1;
-
---source include/not_embedded.inc
---source include/master-slave.inc
-
-let $engine_type= MyISAM;
-
-set binlog_format=row;
-
-# Embedded server doesn't support binlogging
---source include/rpl_events.inc
-
-set binlog_format=statement;
-
-# Embedded server doesn't support binlogging
---source include/rpl_events.inc
-
diff --git a/mysql-test/t/rpl_flushlog_loop.test b/mysql-test/t/rpl_flushlog_loop.test
deleted file mode 100644
index 471c45a1aa3..00000000000
--- a/mysql-test/t/rpl_flushlog_loop.test
+++ /dev/null
@@ -1,50 +0,0 @@
-# Testing if "flush logs" command bouncing resulting in logs created in a loop
-# in case of bi-directional replication
--- source include/master-slave.inc
-
-#
-# Start replication master -> slave
-#
-# We have to sync with master, to ensure slave had time to start properly
-# before we stop it. If not, we get errors about UNIX_TIMESTAMP() in the log.
-sync_slave_with_master;
-connection slave;
---disable_warnings
-stop slave;
---enable_warnings
---replace_result $MASTER_MYPORT MASTER_PORT
-eval change master to master_host='127.0.0.1',master_user='root',
- master_password='',master_port=$MASTER_MYPORT;
-start slave;
-
-#
-# Start replication slave -> master
-#
-connection master;
---disable_warnings
-stop slave;
---enable_warnings
---replace_result $SLAVE_MYPORT SLAVE_PORT
-eval change master to master_host='127.0.0.1',master_user='root',
- master_password='',master_port=$SLAVE_MYPORT;
-start slave;
-
-#
-# Wait for start of slave IO and SQL threads
-#
-let $result_pattern= '%127.0.0.1%root%slave-bin.000001%slave-bin.000001%Yes%Yes%0%0%None%';
---source include/wait_slave_status.inc
-
-#
-# Flush logs of slave
-#
-flush logs;
-sleep 5;
-
-#
-# Show status of slave
-#
---replace_result $SLAVE_MYPORT SLAVE_PORT
---replace_column 1 # 8 # 9 # 16 # 23 # 33 #
---vertical_results
-SHOW SLAVE STATUS;
diff --git a/mysql-test/t/rpl_incident.test b/mysql-test/t/rpl_incident.test
deleted file mode 100644
index c52f26317ad..00000000000
--- a/mysql-test/t/rpl_incident.test
+++ /dev/null
@@ -1,43 +0,0 @@
---source include/master-slave.inc
---source include/have_debug.inc
-
---echo **** On Master ****
-CREATE TABLE t1 (a INT);
-
-INSERT INTO t1 VALUES (1),(2),(3);
-SELECT * FROM t1;
-
-# This will generate an incident log event and store it in the binary
-# log before the replace statement.
-REPLACE INTO t1 VALUES (4);
---save_master_pos
-SELECT * FROM t1;
-
-connection slave;
---wait_for_slave_to_stop
-
-# The 4 should not be inserted into the table, since the incident log
-# event should have stop the slave.
---echo **** On Slave ****
-SELECT * FROM t1;
-
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
---query_vertical SHOW SLAVE STATUS
-
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
---sync_with_master
-
-# Now, we should have inserted the row into the table and the slave
-# should be running. We should also have rotated to a new binary log.
-
-SELECT * FROM t1;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
---query_vertical SHOW SLAVE STATUS
-
-DROP TABLE t1;
-connection master;
-DROP TABLE t1;
-
diff --git a/mysql-test/t/rpl_innodb.test b/mysql-test/t/rpl_innodb.test
deleted file mode 100644
index b88276e2107..00000000000
--- a/mysql-test/t/rpl_innodb.test
+++ /dev/null
@@ -1,48 +0,0 @@
-# File for specialities regarding replication from or to InnoDB
-# tables.
-
-source include/master-slave.inc;
-source include/have_innodb.inc;
-
-#
-# Bug#11401: Load data infile 'REPLACE INTO' fails on slave.
-#
-connection master;
-CREATE TABLE t4 (
- id INT(5) unsigned NOT NULL auto_increment,
- name varchar(15) NOT NULL default '',
- number varchar(35) NOT NULL default 'default',
- PRIMARY KEY (id),
- UNIQUE KEY unique_rec (name,number)
-) ENGINE=InnoDB;
-
---disable_warnings
-LOAD DATA
- INFILE '../std_data_ln/loaddata_pair.dat'
- REPLACE INTO TABLE t4
- (name,number);
---enable_warnings
-SELECT * FROM t4;
-
-sync_slave_with_master;
-SELECT * FROM t4;
-
-connection master;
---disable_warnings
-LOAD DATA
- INFILE '../std_data_ln/loaddata_pair.dat'
- REPLACE INTO TABLE t4
- (name,number);
---enable_warnings
-SELECT * FROM t4;
-
-sync_slave_with_master;
-SELECT * FROM t4;
-
-connection master;
---disable_query_log
-DROP TABLE t4;
---enable_query_log
-sync_slave_with_master;
-
-# End of 4.1 tests
diff --git a/mysql-test/t/rpl_insert_ignore.test b/mysql-test/t/rpl_insert_ignore.test
deleted file mode 100644
index dc8994b82f3..00000000000
--- a/mysql-test/t/rpl_insert_ignore.test
+++ /dev/null
@@ -1,8 +0,0 @@
-#####################################
-# Wrapper for rpl_insert_ignore.test#
-#####################################
--- source include/not_ndb_default.inc
--- source include/have_innodb.inc
-let $engine_type=innodb;
-let $engine_type2=myisam;
--- source extra/rpl_tests/rpl_insert_ignore.test
diff --git a/mysql-test/t/rpl_known_bugs_detection.test b/mysql-test/t/rpl_known_bugs_detection.test
deleted file mode 100644
index ce3debf3c5b..00000000000
--- a/mysql-test/t/rpl_known_bugs_detection.test
+++ /dev/null
@@ -1,93 +0,0 @@
-# Test to see if slave can detect certain known bugs present
-# on the master, and appropriately decides to stop
-# (assuming the bug is fixed in the slave, slave cannot of course
-# imitate the bug, so it has to stop).
-
-source include/have_debug.inc;
-source include/master-slave.inc;
-
-# Currently only statement-based-specific bugs are here
--- source include/have_binlog_format_mixed_or_statement.inc
-
-#
-# This is to test that slave properly detects if
-# master may suffer from:
-# BUG#24432 "INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values"
-# (i.e. on master, INSERT ON DUPLICATE KEY UPDATE is used and manipulates
-# an auto_increment column, and is binlogged statement-based).
-#
-
-# testcase with INSERT VALUES
-CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT,
-UNIQUE(b));
-sync_slave_with_master;
-connection master;
-INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10;
-SELECT * FROM t1;
-connection slave;
-wait_for_slave_to_stop;
-# show the error message
---replace_column 1 # 4 # 7 # 8 # 9 # 23 # 33 #
---query_vertical show slave status;
-# show that it was not replicated
-SELECT * FROM t1;
-
-# restart replication for the next testcase
-stop slave;
-reset slave;
-connection master;
-reset master;
-drop table t1;
-connection slave;
-start slave;
-
-# testcase with INSERT SELECT
-connection master;
-CREATE TABLE t1 (
- id bigint(20) unsigned NOT NULL auto_increment,
- field_1 int(10) unsigned NOT NULL,
- field_2 varchar(255) NOT NULL,
- field_3 varchar(255) NOT NULL,
- PRIMARY KEY (id),
- UNIQUE KEY field_1 (field_1, field_2)
-);
-CREATE TABLE t2 (
- field_a int(10) unsigned NOT NULL,
- field_b varchar(255) NOT NULL,
- field_c varchar(255) NOT NULL
-);
-INSERT INTO t2 (field_a, field_b, field_c) VALUES (1, 'a', '1a');
-INSERT INTO t2 (field_a, field_b, field_c) VALUES (2, 'b', '2b');
-INSERT INTO t2 (field_a, field_b, field_c) VALUES (3, 'c', '3c');
-INSERT INTO t2 (field_a, field_b, field_c) VALUES (4, 'd', '4d');
-INSERT INTO t2 (field_a, field_b, field_c) VALUES (5, 'e', '5e');
-sync_slave_with_master;
-connection master;
-# Updating table t1 based on values from table t2
-INSERT INTO t1 (field_1, field_2, field_3)
-SELECT t2.field_a, t2.field_b, t2.field_c
-FROM t2
-ON DUPLICATE KEY UPDATE
-t1.field_3 = t2.field_c;
-# Inserting new record into t2
-INSERT INTO t2 (field_a, field_b, field_c) VALUES (6, 'f', '6f');
-# Updating t1 again
-INSERT INTO t1 (field_1, field_2, field_3)
-SELECT t2.field_a, t2.field_b, t2.field_c
-FROM t2
-ON DUPLICATE KEY UPDATE
-t1.field_3 = t2.field_c;
-SELECT * FROM t1;
-connection slave;
-wait_for_slave_to_stop;
-# show the error message
---replace_column 1 # 4 # 7 # 8 # 9 # 23 # 33 #
---query_vertical show slave status;
-# show that it was not replicated
-SELECT * FROM t1;
-connection master;
-drop table t1, t2;
-connection slave;
-drop table t1, t2;
-
-# End of 5.0 tests
diff --git a/mysql-test/t/rpl_log_pos.test b/mysql-test/t/rpl_log_pos.test
deleted file mode 100644
index b98d89c1dc3..00000000000
--- a/mysql-test/t/rpl_log_pos.test
+++ /dev/null
@@ -1,60 +0,0 @@
-##########
-# Change Author: JBM
-# Change Date: 2006-01-16
-# Change: Added Order by for NDB
-##########
-
-#
-# Testing of setting slave to wrong log position with master_log_pos
-#
-
-# Passes with rbr no problem, removed statement include [jbm]
-
-source include/master-slave.inc;
---replace_column 3 <Binlog_Ignore_DB>
-show master status;
-sync_slave_with_master;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
-show slave status;
-stop slave;
-change master to master_log_pos=75;
-start slave;
-sleep 5;
-stop slave;
-
-change master to master_log_pos=75;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
-show slave status;
-start slave;
-sleep 5;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
-show slave status;
-stop slave;
-change master to master_log_pos=178;
-start slave;
-sleep 2;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 11 # 23 # 33 #
-show slave status;
-connection master;
---replace_column 3 <Binlog_Ignore_DB>
-show master status;
-create table if not exists t1 (n int);
-drop table if exists t1;
-create table t1 (n int);
-insert into t1 values (1),(2),(3);
-save_master_pos;
-connection slave;
-stop slave;
-change master to master_log_pos=106;
-start slave;
-sync_with_master;
-select * from t1 ORDER BY n;
-connection master;
-drop table t1;
-sync_slave_with_master;
-
-# End of 4.1 tests
diff --git a/mysql-test/t/rpl_misc_functions.test b/mysql-test/t/rpl_misc_functions.test
deleted file mode 100644
index db9b557baad..00000000000
--- a/mysql-test/t/rpl_misc_functions.test
+++ /dev/null
@@ -1,103 +0,0 @@
-#
-# Test of replicating some difficult functions
-#
-source include/master-slave.inc;
-
-create table t1(id int, i int, r1 int, r2 int, p varchar(100));
-insert into t1 values(1, connection_id(), 0, 0, "");
-# don't put rand and password in the same query, to see if they replicate
-# independently
-# Pure rand test
-insert into t1 values(2, 0, rand()*1000, rand()*1000, "");
-# change the rand suite on the master (we do this because otherwise password()
-# benefits from the fact that the above rand() is well replicated :
-# it picks the same sequence element, which hides a possible bug in password() replication.
-set sql_log_bin=0;
-insert into t1 values(6, 0, rand(), rand(), "");
-delete from t1 where id=6;
-set sql_log_bin=1;
-# Pure password test
-insert into t1 values(3, 0, 0, 0, password('does_this_work?'));
-# "altogether now"
-insert into t1 values(4, connection_id(), rand()*1000, rand()*1000, password('does_this_still_work?'));
-select * into outfile 'rpl_misc_functions.outfile' from t1;
-sync_slave_with_master;
-create table t2 like t1;
-# read the values from the master table
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval load data local infile '$MYSQLTEST_VARDIR/master-data/test/rpl_misc_functions.outfile' into table t2;
-# compare them with the replica; the SELECT below should return no row
-select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p);
-
-connection master;
-drop table t1;
-
-# End of 4.1 tests
-
-#
-# BUG#25543 test calling rand() multiple times on the master in
-# a stored procedure.
-#
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-CREATE TABLE t1 (col_a double default NULL);
-
-DELIMITER |;
-
-# Use a SP that calls rand() multiple times
-CREATE PROCEDURE test_replication_sp1()
-BEGIN
- INSERT INTO t1 VALUES (rand()), (rand());
- INSERT INTO t1 VALUES (rand());
-END|
-
-# Use a SP that calls another SP to call rand() multiple times
-CREATE PROCEDURE test_replication_sp2()
-BEGIN
- CALL test_replication_sp1();
- CALL test_replication_sp1();
-END|
-
-# Use a SF that calls rand() multiple times
-CREATE FUNCTION test_replication_sf() RETURNS DOUBLE DETERMINISTIC
-BEGIN
- RETURN (rand() + rand());
-END|
-
-DELIMITER ;|
-
-# Exercise the functions and procedures then compare the results on
-# the master to those on the slave.
-CALL test_replication_sp1();
-CALL test_replication_sp2();
-INSERT INTO t1 VALUES (test_replication_sf());
-INSERT INTO t1 VALUES (test_replication_sf());
-INSERT INTO t1 VALUES (test_replication_sf());
-
-# Record the results of the query on the master
---exec $MYSQL --port=$MASTER_MYPORT test -e "SELECT * FROM test.t1" > $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql
-
---sync_slave_with_master
-
-# Record the results of the query on the slave
---exec $MYSQL --port=$SLAVE_MYPORT test -e "SELECT * FROM test.t1" > $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql
-
-# Compare the results from the master to the slave.
---exec diff $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql
-
-# Cleanup
-connection master;
---disable_warnings
-DROP PROCEDURE IF EXISTS test_replication_sp1;
-DROP PROCEDURE IF EXISTS test_replication_sp2;
-DROP FUNCTION IF EXISTS test_replication_sf;
-DROP TABLE IF EXISTS t1;
---enable_warnings
---sync_slave_with_master
-
-# If all is good, when can cleanup our dump files.
---remove_file $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql
---remove_file $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql
diff --git a/mysql-test/t/rpl_multi_engine-slave.opt b/mysql-test/t/rpl_multi_engine-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/t/rpl_multi_engine-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/t/rpl_multi_update2.test b/mysql-test/t/rpl_multi_update2.test
deleted file mode 100644
index 7401786501e..00000000000
--- a/mysql-test/t/rpl_multi_update2.test
+++ /dev/null
@@ -1,9 +0,0 @@
-#######################################################
-# Wrapper for rpl_multi_update2.test to allow multi #
-# Engines to reuse test code. By JBM 2006-02-15 #
-# Added comments section and to skip when ndb is #
-# Default engine. #
-#######################################################
---source include/not_ndb_default.inc
-let $engine_type=MyISAM;
---source extra/rpl_tests/rpl_multi_update2.test
diff --git a/mysql-test/t/rpl_multi_update3.test b/mysql-test/t/rpl_multi_update3.test
deleted file mode 100644
index 438a644729c..00000000000
--- a/mysql-test/t/rpl_multi_update3.test
+++ /dev/null
@@ -1,9 +0,0 @@
-#######################################################
-# Wrapper for rpl_multi_update3.test to allow multi #
-# Engines to reuse test code. By JBM 2006-02-15 #
-# Added comments section and to skip when ndb is #
-# Default engine. #
-#######################################################
---source include/not_ndb_default.inc
-let $engine_type=MyISAM;
--- source extra/rpl_tests/rpl_multi_update3.test
diff --git a/mysql-test/t/rpl_ndb_2innodb.test b/mysql-test/t/rpl_ndb_2innodb.test
deleted file mode 100644
index e09d8b6685b..00000000000
--- a/mysql-test/t/rpl_ndb_2innodb.test
+++ /dev/null
@@ -1,16 +0,0 @@
-#############################################################
-# Author: JBM
-# Date: 2006-02-24
-# Purpose: Trying to test ability to replicate from cluster
-# to innodb, or myisam, or replicate from innodb/myisam to
-# cluster slave. Due to limitations I have created wrappers
-# to be able to use the same code for all these different
-# test and to have control over the tests.
-##############################################################
--- source include/have_ndb.inc
--- source include/master-slave.inc
-connection slave;
--- source include/have_innodb.inc
-connection master;
-SET storage_engine=ndb;
---source extra/rpl_tests/rpl_ndb_2multi_eng.test
diff --git a/mysql-test/t/rpl_ndb_2myisam.test b/mysql-test/t/rpl_ndb_2myisam.test
deleted file mode 100644
index abbe419bc02..00000000000
--- a/mysql-test/t/rpl_ndb_2myisam.test
+++ /dev/null
@@ -1,13 +0,0 @@
-#############################################################
-# Author: JBM
-# Date: 2006-02-24
-# Purpose: Trying to test ability to replicate from cluster
-# to innodb, or myisam, or replicate from innodb/myisam to
-# cluster slave. Due to limitations I have created wrappers
-# to be able to use the same code for all these different
-# test and to have control over the tests.
-##############################################################
--- source include/have_ndb.inc
--- source include/master-slave.inc
-SET storage_engine=ndb;
---source extra/rpl_tests/rpl_ndb_2multi_eng.test
diff --git a/mysql-test/t/rpl_ndb_UUID.test b/mysql-test/t/rpl_ndb_UUID.test
deleted file mode 100644
index c6fc218beed..00000000000
--- a/mysql-test/t/rpl_ndb_UUID.test
+++ /dev/null
@@ -1,6 +0,0 @@
-########################################################
-# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-########################################################
---source include/have_ndb.inc
-let $engine_type=NDB;
---source extra/rpl_tests/rpl_row_UUID.test
diff --git a/mysql-test/t/rpl_ndb_auto_inc.test b/mysql-test/t/rpl_ndb_auto_inc.test
deleted file mode 100644
index 53bb7e764f1..00000000000
--- a/mysql-test/t/rpl_ndb_auto_inc.test
+++ /dev/null
@@ -1,118 +0,0 @@
-#
-# Test of auto_increment in CRBR
-#
-#####################################
-# By: JBM
-# Date: 2006-02-10
-# Change: Augmented test to use with cluster
-#####################################
---source include/have_ndb.inc
---source include/master-slave.inc
---source include/have_binlog_format_mixed_or_row.inc
-
---echo ***************** Test 1 ************************
---echo
-CREATE TABLE t1 (a INT NOT NULL auto_increment,b INT, PRIMARY KEY (a)) ENGINE=NDB auto_increment=3;
-insert into t1 values (NULL,1),(NULL,2),(NULL,3);
---echo ******* Select from Master *************
---echo
-select * from t1 ORDER BY a;
-
-
-sync_slave_with_master;
---echo ******* Select from Slave *************
---echo
-select * from t1 ORDER BY a;
-connection master;
-drop table t1;
-
-create table t1 (a int not null auto_increment,b int, primary key (a)) engine=NDB;
-insert into t1 values (1,1),(NULL,2),(3,3),(NULL,4);
-delete from t1 where b=4;
-insert into t1 values (NULL,5),(NULL,6);
---echo ******* Select from Master *************
---echo
-select * from t1 ORDER BY a;
-
-sync_slave_with_master;
---echo ******* Select from Slave *************
---echo
-select * from t1 ORDER BY a;
-connection master;
-
-drop table t1;
-
-create table t1 (a int not null auto_increment, primary key (a)) engine=NDB;
-# Insert with 2 insert statements to get better testing of logging
-insert into t1 values (NULL),(5),(NULL);
-insert into t1 values (250),(NULL);
---echo ******* Select from Master *************
---echo
-select * from t1 ORDER BY a;
-insert into t1 values (1000);
-set @@insert_id=400;
-insert into t1 values(NULL),(NULL);
---echo ******* Select from Master *************
---echo
-select * from t1 ORDER BY a;
-
-sync_slave_with_master;
---echo ******* Select from Slave *************
---echo
-select * from t1 ORDER BY a;
-connection master;
-drop table t1;
-
-create table t1 (a int not null auto_increment, primary key (a)) engine=NDB;
-# Insert with 2 insert statements to get better testing of logging
-insert into t1 values (NULL),(5),(NULL),(NULL);
-insert into t1 values (500),(NULL),(502),(NULL),(600);
---echo ******* Select from Master *************
---echo
-select * from t1 ORDER BY a;
-set @@insert_id=600;
-# We expect a duplicate key error that we will ignore below
---error 1022
-insert into t1 values(600),(NULL),(NULL);
-set @@insert_id=600;
-insert ignore into t1 values(600),(NULL),(NULL),(610),(NULL);
---echo ******* Select from Master *************
---echo
-select * from t1 ORDER BY a;
-
-sync_slave_with_master;
---echo ******* Select from Slave *************
---echo
-select * from t1 ORDER BY a;
-connection master;
-drop table t1;
-
-#
-# Test that auto-increment works when slave has rows in the table
-#
-
-create table t1 (a int not null auto_increment, primary key (a)) engine=NDB;
-
-sync_slave_with_master;
-insert into t1 values(2),(12),(22),(32),(42);
-connection master;
-
-insert into t1 values (NULL),(NULL);
-insert into t1 values (3),(NULL),(NULL);
---echo ******* Select from Master *************
---echo
-select * from t1 ORDER BY a;
-
-sync_slave_with_master;
---echo ******* Select from Slave *************
---echo
---echo ** Slave should have 2, 12, 22, 32, 42 **
---echo ** Master will have 2 but not 12, 22, 32, 42 **
---echo
-select * from t1 ORDER BY a;
-connection master;
-
-drop table t1;
-
-# End cleanup
-sync_slave_with_master;
diff --git a/mysql-test/t/rpl_ndb_bank.test b/mysql-test/t/rpl_ndb_bank.test
deleted file mode 100644
index c1448573f5b..00000000000
--- a/mysql-test/t/rpl_ndb_bank.test
+++ /dev/null
@@ -1,181 +0,0 @@
-#
-# Currently this test only runs in the source tree with the
-# ndb/test programs compiled.
-# invoke with: ./mysql-test-run --ndb-extra-test --do-test=rpl_ndb_bank
-#
-# 1. start a "bank" application running on the master cluster
-# 2. perform online sync of slave
-# 3. periodically check consistency of slave
-# 4. stop the bank application
-# 5. check that the slave and master BANK databases are the same
-#
-
---source include/have_ndb.inc
---source include/have_ndb_extra.inc
---source include/have_binlog_format_row.inc
---source include/master-slave.inc
-
-# kill any trailing processes
---system killall lt-bankTransactionMaker lt-bankTimer lt-bankMakeGL || true
-
---disable_warnings
-# initialize master
---connection master
-CREATE DATABASE IF NOT EXISTS BANK;
-DROP DATABASE BANK;
-CREATE DATABASE BANK default charset=latin1 default collate=latin1_bin;
---enable_warnings
-
-#
-# These tables should correspond to the table definitions in
-# storage/ndb/test/src/NDBT_Tables.cpp
-#
---connection master
-USE BANK;
-CREATE TABLE GL ( TIME BIGINT UNSIGNED NOT NULL,
- ACCOUNT_TYPE INT UNSIGNED NOT NULL,
- BALANCE INT UNSIGNED NOT NULL,
- DEPOSIT_COUNT INT UNSIGNED NOT NULL,
- DEPOSIT_SUM INT UNSIGNED NOT NULL,
- WITHDRAWAL_COUNT INT UNSIGNED NOT NULL,
- WITHDRAWAL_SUM INT UNSIGNED NOT NULL,
- PURGED INT UNSIGNED NOT NULL,
- PRIMARY KEY USING HASH (TIME,ACCOUNT_TYPE))
- ENGINE = NDB;
-
-CREATE TABLE ACCOUNT ( ACCOUNT_ID INT UNSIGNED NOT NULL,
- OWNER INT UNSIGNED NOT NULL,
- BALANCE INT UNSIGNED NOT NULL,
- ACCOUNT_TYPE INT UNSIGNED NOT NULL,
- PRIMARY KEY USING HASH (ACCOUNT_ID))
- ENGINE = NDB;
-
-CREATE TABLE TRANSACTION ( TRANSACTION_ID BIGINT UNSIGNED NOT NULL,
- ACCOUNT INT UNSIGNED NOT NULL,
- ACCOUNT_TYPE INT UNSIGNED NOT NULL,
- OTHER_ACCOUNT INT UNSIGNED NOT NULL,
- TRANSACTION_TYPE INT UNSIGNED NOT NULL,
- TIME BIGINT UNSIGNED NOT NULL,
- AMOUNT INT UNSIGNED NOT NULL,
- PRIMARY KEY USING HASH (TRANSACTION_ID,ACCOUNT))
- ENGINE = NDB;
-
-CREATE TABLE SYSTEM_VALUES ( SYSTEM_VALUES_ID INT UNSIGNED NOT NULL,
- VALUE BIGINT UNSIGNED NOT NULL,
- PRIMARY KEY USING HASH (SYSTEM_VALUES_ID))
- ENGINE = NDB;
-
-CREATE TABLE ACCOUNT_TYPE ( ACCOUNT_TYPE_ID INT UNSIGNED NOT NULL,
- DESCRIPTION CHAR(64) NOT NULL,
- PRIMARY KEY USING HASH (ACCOUNT_TYPE_ID))
- ENGINE = NDB;
-
-#
-# create "BANK" application
-#
---exec NDB_CONNECTSTRING=localhost:$NDBCLUSTER_PORT ../storage/ndb/test/ndbapi/bank/bankCreator >> $NDB_TOOLS_OUTPUT
-
-#
-# start main loop
-# repeat backup-restore-check
-#
-
-# set this high if testing to run many syncs in loop
---let $2=1
-while ($2)
-{
-
-#
-# start "BANK" application
-#
---exec NDB_CONNECTSTRING=localhost:$NDBCLUSTER_PORT ../storage/ndb/test/ndbapi/bank/bankTimer -w 5 >> $NDB_TOOLS_OUTPUT &
---exec NDB_CONNECTSTRING=localhost:$NDBCLUSTER_PORT ../storage/ndb/test/ndbapi/bank/bankMakeGL >> $NDB_TOOLS_OUTPUT &
---exec NDB_CONNECTSTRING=localhost:$NDBCLUSTER_PORT ../storage/ndb/test/ndbapi/bank/bankTransactionMaker >> $NDB_TOOLS_OUTPUT &
-
-#
-# let the "BANK" run for a while
-#
---sleep 5
-
---disable_warnings
-# initialize slave for sync
---connection slave
-STOP SLAVE;
-RESET SLAVE;
-# to make sure we drop any ndbcluster tables
-CREATE DATABASE IF NOT EXISTS BANK;
-DROP DATABASE BANK;
-# create database
-CREATE DATABASE BANK;
---enable_warnings
-
-#
-# Time to sync the slave:
-# start by taking a backup on master
---connection master
-RESET MASTER;
---exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "start backup" >> $NDB_TOOLS_OUTPUT
-
-# there is no neat way to find the backupid, this is a hack to find it...
---exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > $MYSQLTEST_VARDIR/tmp.dat
-CREATE TABLE IF NOT EXISTS mysql.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-DELETE FROM mysql.backup_info;
-LOAD DATA INFILE '../tmp.dat' INTO TABLE mysql.backup_info FIELDS TERMINATED BY ',';
---exec rm $MYSQLTEST_VARDIR/tmp.dat || true
---replace_column 1 <the_backup_id>
-SELECT @the_backup_id:=backup_id FROM mysql.backup_info;
-let the_backup_id=`select @the_backup_id`;
-
-# restore on slave, first check that nothing is there
---connection slave
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT_SLAVE" -p 8 -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT_SLAVE" -p 8 -b $the_backup_id -n 2 -r -e --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
-
-#
-# now setup replication to continue from last epoch
---source include/ndb_setup_slave.inc
---connection slave
-START SLAVE;
-
-
-#
-# Now loop and check consistency every 2 seconds on slave
-#
---connection slave
---let $1=10
-while ($1)
-{
- --sleep 2
- --replace_result $MASTER_MYPORT MASTER_PORT
- --replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master>
- SHOW SLAVE STATUS;
- STOP SLAVE;
- --exec NDB_CONNECTSTRING=localhost:$NDBCLUSTER_PORT_SLAVE ../storage/ndb/test/ndbapi/bank/bankValidateAllGLs >> $NDB_TOOLS_OUTPUT
- START SLAVE;
- --dec $1
-}
-
-#
-# Stop transactions
-#
---exec killall lt-bankTransactionMaker lt-bankTimer lt-bankMakeGL
-
-#
-# Check that the databases are the same on slave and master
-# 1. dump database BANK on both master and slave
-# 2. compare, there should be no difference
-#
---exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info BANK ACCOUNT_TYPE ACCOUNT GL TRANSACTION > $MYSQLTEST_VARDIR/tmp/master_BANK.sql
---connection master
-use test;
-create table t1 (a int primary key) engine=ndb;
-insert into t1 values (1);
---sync_slave_with_master
---exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info BANK ACCOUNT_TYPE ACCOUNT GL TRANSACTION > $MYSQLTEST_VARDIR/tmp/slave_BANK.sql
---connection master
-drop table t1;
-
-diff_files $MYSQLTEST_VARDIR/tmp/master_BANK.sql $MYSQLTEST_VARDIR/tmp/slave_BANK.sql;
-
- --dec $2
-}
diff --git a/mysql-test/t/rpl_ndb_basic.test b/mysql-test/t/rpl_ndb_basic.test
deleted file mode 100644
index 04c855f8730..00000000000
--- a/mysql-test/t/rpl_ndb_basic.test
+++ /dev/null
@@ -1,261 +0,0 @@
---source include/have_ndb.inc
---source include/have_binlog_format_row.inc
---source include/master-slave.inc
-
-
-
-#
-# Bug #11087
-#
-# connect to the master and create tabe t1 in gotoslave database
---connection master
-CREATE TABLE `t1` ( `nid` int(11) NOT NULL default '0',
- `nom` char(4) default NULL,
- `prenom` char(4) default NULL,
- PRIMARY KEY (`nid`))
- ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-
-INSERT INTO t1 VALUES(1,"XYZ1","ABC1");
-select * from t1 order by nid;
-
---sync_slave_with_master
-# connect to slave and ensure data it there.
---connection slave
-select * from t1 order by nid;
-
---connection master
-delete from t1;
-INSERT INTO t1 VALUES(1,"XYZ2","ABC2");
-# Make sure all rows are on the master
-select * from t1 order by nid;
-
-# make sure all rows are on the slave.
---sync_slave_with_master
---connection slave
-# Bug #11087 would have row with nid 2 missing
-select * from t1 order by nid;
-
---connection master
-delete from t1;
-insert into t1 values(1,"AA", "AA");
-insert into t1 values(2,"BB", "BB");
-insert into t1 values(3,"CC", "CC");
-insert into t1 values(4,"DD", "DD");
-
-begin;
-# delete+insert = update
-delete from t1 where nid = 1;
-insert into t1 values (1,"A2", "A2");
-
-# update+delete = delete
-update t1 set nom="B2" where nid = 2;
-delete from t1 where nid = 2;
-
-# multi-update
-update t1 set nom = "D2" where nid = 4;
-delete from t1 where nid = 4;
-insert into t1 values (4, "D3", "D3");
-update t1 set nom = "D4" where nid = 4;
-
-# insert+delete = nothing
-insert into t1 values (5, "EE", "EE");
-delete from t1 where nid = 5;
-
-commit;
-select * from t1 order by 1;
---sync_slave_with_master
---connection slave
-select * from t1 order by 1;
---connection master
-DROP table t1;
-
-#
-# Test replication of table with no primary key
-#
---connection master
-CREATE TABLE `t1` ( `nid` int(11) NOT NULL default '0',
- `nom` char(4) default NULL,
- `prenom` char(4) default NULL)
- ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-
-INSERT INTO t1 VALUES(1,"XYZ1","ABC1"),(2,"AAA","BBB"),(3,"CCC","DDD");
-select * from t1 order by nid;
-
---sync_slave_with_master
-# connect to slave and ensure data it there.
---connection slave
-select * from t1 order by nid;
-
---connection master
-delete from t1 where nid = 2;
-INSERT INTO t1 VALUES(4,"EEE","FFF");
-# Make sure all rows are on the master
-select * from t1 order by nid;
-
-# make sure all rows are on the slave.
---sync_slave_with_master
---connection slave
-select * from t1 order by nid;
-
---connection master
-UPDATE t1 set nid=nid+1;
-UPDATE t1 set nom="CCP" where nid = 4;
-select * from t1 order by nid;
-
-# make sure all rows are on the slave.
---sync_slave_with_master
---connection slave
-select * from t1 order by nid;
-
---connection master
-DROP table t1;
-
-#
-# Bug #27378 update becomes delete on slave
-#
-
---connection master
-CREATE TABLE `t1` (
- `prid` int(10) unsigned NOT NULL,
- `id_type` enum('IMSI','SIP') NOT NULL,
- `fkimssub` varchar(50) NOT NULL,
- `user_id` varchar(20) DEFAULT NULL,
- `password` varchar(20) DEFAULT NULL,
- `ptg_nbr` varchar(20) DEFAULT NULL,
- `old_tmsi` int(10) unsigned DEFAULT NULL,
- `new_tmsi` int(10) unsigned DEFAULT NULL,
- `dev_capability` int(10) unsigned DEFAULT NULL,
- `dev_oid` bigint(20) unsigned DEFAULT NULL,
- `lac_cell_id` bigint(20) unsigned DEFAULT NULL,
- `ms_classmark1` int(10) unsigned DEFAULT NULL,
- `cipher_key` int(10) unsigned DEFAULT NULL,
- `priid_master` int(10) unsigned DEFAULT NULL,
- PRIMARY KEY (`prid`),
- UNIQUE KEY `fkimssub` (`fkimssub`,`ptg_nbr`) USING HASH
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-
-INSERT INTO `t1` VALUES (183342,'IMSI','config3_sub_2Privates_3Publics_imssub_36668','user_id_73336','user_id_73336','73336',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(47617,'IMSI','config3_sub_2Privates_3Publics_imssub_9523','user_id_19046','user_id_19046','19046',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(200332,'IMSI','config3_sub_2Privates_3Publics_imssub_40066','user_id_80132','user_id_80132','80132',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(478882,'IMSI','config3_sub_2Privates_3Publics_imssub_95776','user_id_191552','user_id_191552','191552',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(490146,'IMSI','config3_sub_2Privates_3Publics_imssub_98029','user_id_196057','user_id_196057','196057',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(499301,'IMSI','config3_sub_2Privates_3Publics_imssub_99860','user_id_199719','user_id_199719','199719',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(506101,'IMSI','config3_sub_2Privates_3Publics_imssub_101220','user_id_202439','user_id_202439','202439',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(510142,'IMSI','config3_sub_2Privates_3Publics_imssub_102028','user_id_204056','user_id_204056','204056',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(515871,'IMSI','config3_sub_2Privates_3Publics_imssub_103174','user_id_206347','user_id_206347','206347',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(209842,'IMSI','config3_sub_2Privates_3Publics_imssub_41968','user_id_83936','user_id_83936','83936',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(365902,'IMSI','config3_sub_2Privates_3Publics_imssub_73180','user_id_146360','user_id_146360','146360',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(11892,'IMSI','config3_sub_2Privates_3Publics_imssub_2378','user_id_4756','user_id_4756','4756',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL);
-
-select count(*) from t1;
-
---sync_slave_with_master
---connection slave
-select count(*) from t1;
-
---connection master
-update t1 set dev_oid=dev_oid+1;
-select count(*) from t1;
-
---sync_slave_with_master
---connection slave
-select count(*) from t1;
-
---connection master
-DROP table t1;
-
-##################################################################
-#
-# Check that retries are made on the slave on some temporary errors
-#
-
-#
-# 1. Deadlock
-#
---connection master
-CREATE TABLE `t1` ( `nid` int(11) NOT NULL default '0',
- `nom` char(4) default NULL,
- `prenom` char(4) default NULL,
- PRIMARY KEY USING HASH (`nid`))
- ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-INSERT INTO t1 VALUES(1,"XYZ1","ABC1");
-
-# cause a lock on that row on the slave
---sync_slave_with_master
---connection slave
---echo **** On Slave ****
-BEGIN;
-UPDATE t1 SET `nom`="LOCK" WHERE `nid`=1;
-
-# set number of retries low so we fail the retries
-set GLOBAL slave_transaction_retries=1;
-
-# now do a change to this row on the master
-# will deadlock on the slave because of lock above
---connection master
---echo **** On Master ****
-UPDATE t1 SET `nom`="DEAD" WHERE `nid`=1;
-
-# wait for deadlock to be detected
-# sleep longer than dead lock detection timeout in config
-# we do this 2 times, once with few retries to verify that we
-# get a failure with the set sleep, and once with the _same_
-# sleep, but with more retries to get it to succeed
---sleep 5
-
-# replication should have stopped, since max retries where not enough
-# verify with show slave status
---connection slave
---echo **** On Slave ****
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master>
---query_vertical SHOW SLAVE STATUS;
-
-# now set max retries high enough to succeed, and start slave again
-set GLOBAL slave_transaction_retries=10;
-START SLAVE;
-# wait for deadlock to be detected and retried
-# should be the same sleep as above for test to be valid
---sleep 5
-
-# commit transaction to release lock on row and let replication succeed
-select * from t1 order by nid;
-COMMIT;
-
-# verify that the row succeded to be applied on the slave
---connection master
---sync_slave_with_master
---connection slave
-select * from t1 order by nid;
-
-# cleanup
---connection master
-DROP TABLE t1;
-
-
-#
-# BUG#18094
-# Slave caches invalid table definition after atlters causes select failure
-#
---connection master
-CREATE TABLE t1 (c1 INT KEY) ENGINE=NDB;
-
-INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
-
-ALTER TABLE t1 ADD c2 INT;
-
---sync_slave_with_master
-connection slave;
-SELECT * FROM t1 ORDER BY c1;
-
-connection master;
-ALTER TABLE t1 CHANGE c2 c2 TEXT CHARACTER SET utf8;
-ALTER TABLE t1 CHANGE c2 c2 BLOB;
-
---sync_slave_with_master
-connection slave;
-# here we would get error 1412 prior to bug
-SELECT * FROM t1 ORDER BY c1 LIMIT 5;
-
---connection master
-TRUNCATE t1;
-SELECT count(*) FROM t1;
-INSERT INTO t1 VALUES (101,NULL),(102,NULL),(103,NULL),(104,NULL),(105,NULL),(106,NULL),(107,NULL),(108,NULL),(109,NULL),(1010,NULL);
---sync_slave_with_master
-connection slave;
-SELECT count(*) FROM t1;
-SELECT c1 FROM t1 ORDER BY c1 LIMIT 5;
-
-# cleanup
---connection master
-DROP TABLE t1;
--- source include/master-slave-end.inc
diff --git a/mysql-test/t/rpl_ndb_blob.test b/mysql-test/t/rpl_ndb_blob.test
deleted file mode 100644
index 94af986b222..00000000000
--- a/mysql-test/t/rpl_ndb_blob.test
+++ /dev/null
@@ -1,142 +0,0 @@
---source include/have_ndb.inc
---source include/have_binlog_format_row.inc
---source include/master-slave.inc
-
-#
-# basic test of blob replication for NDB
-#
-
-# easy test
-
---connection master
-create table t1 (
- a int not null primary key,
- b text not null
-) engine=ndb;
-
-insert into t1 values(1, repeat('abc',10));
-insert into t1 values(2, repeat('def',200));
-insert into t1 values(3, repeat('ghi',3000));
-
-select 'M', a, sha1(b) from t1
-order by a;
-
---sync_slave_with_master
---sleep 5
---connection slave
-select 'S', a, sha1(b) from t1
-order by a;
-
---connection master
-drop table t1;
---sync_slave_with_master
-
-# hard test
-
---connection master
-create table t1 (
- a int not null primary key,
- b text not null,
- c int,
- d longblob,
- e tinyblob
-) engine=ndbcluster;
-
---disable_query_log
-# length 61
-set @s0 = 'rggurloniukyehuxdbfkkyzlceixzrehqhvxvxbpwizzvjzpucqmzrhzxzfau';
-set @s1 = 'ykyymbzqgqlcjhlhmyqelfoaaohvtbekvifukdtnvcrrjveevfakxarxexomz';
-set @s2 = 'dbnfqyzgtqxalcrwtfsqabknvtfcbpoonxsjiqvmhnfikxxhcgoexlkoezvah';
---enable_query_log
-
-insert into t1 values (
- 0, repeat(@s2,454), 100, repeat(@s2,345), NULL);
-insert into t1 values (
- 1, repeat(@s0,504), NULL, repeat(@s1,732), repeat(@s1,1));
-insert into t1 values (
- 2, '', 102, '', repeat(@s2,1));
-insert into t1 values (
- 3, repeat(@s0,545), 103, repeat(@s2,788), repeat(@s0,1));
-insert into t1 values (
- 4, repeat(@s1,38), 104, repeat(@s0,260), repeat(@s0,1));
-insert into t1 values (
- 5, repeat(@s2,12), 105, repeat(@s2,40), repeat(@s1,1));
-insert into t1 values (
- 6, repeat(@s1,242), 106, NULL, repeat(@s1,1));
-insert into t1 values (
- 7, repeat(@s1,30), 107, repeat(@s0,161), '');
-insert into t1 values (
- 8, repeat(@s1,719), 108, repeat(@s2,104), NULL);
-insert into t1 values (
- 9, repeat(@s2,427), NULL, NULL, NULL);
-
-select 'M', a, sha1(b), c, sha1(d), sha1(e)
-from t1 order by a;
-
---sync_slave_with_master
---sleep 5
---connection slave
-select 'S', a, sha1(b), c, sha1(d), sha1(e)
-from t1 order by a;
-
---connection master
-drop table t1;
---sync_slave_with_master
-
-# table with varsize key (future cluster/schema)
-
-# sql/ha_ndbcluster_binlog.cc
---connection master
-CREATE TABLE IF NOT EXISTS t1 (
- db VARBINARY(63) NOT NULL,
- name VARBINARY(63) NOT NULL,
- slock BINARY(32) NOT NULL,
- query BLOB NOT NULL,
- node_id INT UNSIGNED NOT NULL,
- epoch BIGINT UNSIGNED NOT NULL,
- id INT UNSIGNED NOT NULL,
- version INT UNSIGNED NOT NULL,
- type INT UNSIGNED NOT NULL,
- PRIMARY KEY USING HASH (db,name))
-ENGINE=NDB;
-
-insert into t1 values ('test','t1',
- 'abc',repeat(@s0,10), 11,12,13,14,15);
-insert into t1 values ('test','t2',
- 'def',repeat(@s1,100), 21,22,23,24,25);
-insert into t1 values ('test','t3',
- 'ghi',repeat(@s2,1000),31,32,33,34,35);
-insert into t1 values ('testtttttttttt','t1',
- 'abc',repeat(@s0,10), 11,12,13,14,15);
-insert into t1 values ('testttttttttttt','t1',
- 'def',repeat(@s1,100), 21,22,23,24,25);
-insert into t1 values ('testtttttttttttt','t1',
- 'ghi',repeat(@s2,1000),31,32,33,34,35);
-insert into t1 values ('t','t11111111111',
- 'abc',repeat(@s0,10), 11,12,13,14,15);
-insert into t1 values ('t','t111111111111',
- 'def',repeat(@s1,100), 21,22,23,24,25);
-insert into t1 values ('t','t1111111111111',
- 'ghi',repeat(@s2,1000),31,32,33,34,35);
-
-select 'M', db, name, sha1(query), node_id, epoch, id, version, type
-from t1 order by db, name;
-
---sync_slave_with_master
---sleep 5
---connection slave
-select 'S', db, name, sha1(query), node_id, epoch, id, version, type
-from t1 order by db, name;
-
---connection master
-drop table t1;
---sync_slave_with_master
-
-#
-# view the binlog - not deterministic (mats)
-#
-
-#--connection master
-#let $VERSION=`select version()`;
-#--replace_result $VERSION VERSION
-#show binlog events;
diff --git a/mysql-test/t/rpl_ndb_blob2.test b/mysql-test/t/rpl_ndb_blob2.test
deleted file mode 100644
index 2e8f02eaf75..00000000000
--- a/mysql-test/t/rpl_ndb_blob2.test
+++ /dev/null
@@ -1,9 +0,0 @@
-#################################
-# Wrapper for rpl_row_blob.test #
-# Using wrapper to share test #
-# code between engine tests #
-#################################
--- source include/have_ndb.inc
-let $engine_type=NDBCLUSTER;
--- source extra/rpl_tests/rpl_row_blob.test
-
diff --git a/mysql-test/t/rpl_ndb_charset.test b/mysql-test/t/rpl_ndb_charset.test
deleted file mode 100644
index eb412a0349a..00000000000
--- a/mysql-test/t/rpl_ndb_charset.test
+++ /dev/null
@@ -1,6 +0,0 @@
-########################################################
-# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-########################################################
---source include/have_ndb.inc
-let $engine_type=NDB;
--- source extra/rpl_tests/rpl_row_charset.test
diff --git a/mysql-test/t/rpl_ndb_circular.test b/mysql-test/t/rpl_ndb_circular.test
deleted file mode 100644
index 88b5808160b..00000000000
--- a/mysql-test/t/rpl_ndb_circular.test
+++ /dev/null
@@ -1,57 +0,0 @@
---source include/have_ndb.inc
---source include/have_binlog_format_row.inc
---source include/master-slave.inc
-
-# set up circular replication
-
---connection slave
-RESET MASTER;
---connection master
---replace_result $SLAVE_MYPORT SLAVE_PORT
---eval CHANGE MASTER TO master_host="127.0.0.1",master_port=$SLAVE_MYPORT,master_user="root"
-START SLAVE;
-
-# create the table on the "slave"
---connection slave
-CREATE TABLE t1 (a int key, b int) ENGINE=ndb;
-#CREATE TABLE t2 (a int key, b int) ENGINE=ndb;
---save_master_pos
---connection master
---sync_with_master
-# now we should have a table on the master as well
-SHOW TABLES;
-
-# insert some values on the slave and master
---connection master
-INSERT INTO t1 VALUES (1,2);
---connection slave
-INSERT INTO t1 VALUES (2,3);
-
-# ensure data has propagated both ways
---connection slave
---save_master_pos
---connection master
---sync_with_master
---sync_slave_with_master
-
-# connect to slave and ensure data it there.
---connection slave
-SELECT * FROM t1 ORDER BY a;
-#SELECT * FROM t2 ORDER BY a;
---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
---query_vertical show slave status;
-# connect to master and ensure data it there.
---connection master
-SELECT * FROM t1 ORDER BY a;
-#SELECT * FROM t2 ORDER BY a;
---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
---query_vertical show slave status;
-
-# stop replication on "master" as not to replicate
-# shutdown circularly, eg drop table
---connection master
-STOP SLAVE;
-
-# cleanup
---connection master
-DROP TABLE t1;
diff --git a/mysql-test/t/rpl_ndb_circular_simplex.test b/mysql-test/t/rpl_ndb_circular_simplex.test
deleted file mode 100644
index 2ea60beaba2..00000000000
--- a/mysql-test/t/rpl_ndb_circular_simplex.test
+++ /dev/null
@@ -1,82 +0,0 @@
---source include/have_ndb.inc
---source include/have_binlog_format_row.inc
---source include/master-slave.inc
-
-connection master;
-CREATE TABLE t1 (a int key, b int) ENGINE=NDB;
-sync_slave_with_master;
-SHOW TABLES;
-
-# Lose the events from the slave binary log: there is no
-# need to re-create the table on the master.
-connection slave;
-RESET MASTER;
-
-# Insert some values on the slave and master
-connection master;
-INSERT INTO t1 VALUES (1,2);
-# Switch to slave once event is applied and insert a row
-sync_slave_with_master;
-connection slave;
-INSERT INTO t1 VALUES (2,3);
-
-# ... it is now very probable that we have a mixed event in the binary
-# log. If we don't, the test should still pass, but will not test the
-# mixed event situation.
-
-# The statement is disabled since it cannot reliably show the same
-# info all the time. Use it for debug purposes.
-
-#SHOW BINLOG EVENTS;
-
-# Replicate back to the master to test this mixed event on the master
-STOP SLAVE;
-
-connection master;
---replace_result $SLAVE_MYPORT SLAVE_PORT
-eval CHANGE MASTER TO MASTER_HOST="127.0.0.1",MASTER_PORT=$SLAVE_MYPORT,MASTER_USER="root";
-
-RESET MASTER;
-START SLAVE;
-
-connection slave;
-save_master_pos;
-connection master;
-sync_with_master;
-
-# The statement is disabled since it cannot reliably show the same
-# info all the time. Use it for debug purposes.
-
-#SHOW BINLOG EVENTS;
-
-# Check that there is no error in replication
---replace_result $SLAVE_MYPORT SLAVE_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
-query_vertical SHOW SLAVE STATUS;
-
-# Check that we have the data on the master
-SELECT * FROM t1 ORDER BY a;
-
-# We should now have another mixed event, likely with "slave" server
-# id last, and with the STMT_END_F flag set.
-
-# The statement is disabled since it cannot reliably show the same
-# info all the time. Use it for debug purposes.
-
-#SHOW BINLOG EVENTS;
-
-# now lets see that this data is applied correctly on the slave
-STOP SLAVE;
-save_master_pos;
-
-connection slave;
-START SLAVE;
-
-# check that we have the data on the slave
-sync_with_master;
-SELECT * FROM t1 ORDER BY a;
-
-# Check that there is no error in replication
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
-query_vertical SHOW SLAVE STATUS;
diff --git a/mysql-test/t/rpl_ndb_commit_afterflush.test b/mysql-test/t/rpl_ndb_commit_afterflush.test
deleted file mode 100644
index ce2a4d9506c..00000000000
--- a/mysql-test/t/rpl_ndb_commit_afterflush.test
+++ /dev/null
@@ -1,9 +0,0 @@
-#####################################
-# Wrapper for rpl_commit_after_flush#
-# Wrapped to reuse test code on #
-# Different engines #
-# By JBM 2004-02-15 #
-#####################################
--- source include/have_ndb.inc
-let $engine_type=NDB;
--- source extra/rpl_tests/rpl_commit_after_flush.test
diff --git a/mysql-test/t/rpl_ndb_dd_advance.test b/mysql-test/t/rpl_ndb_dd_advance.test
deleted file mode 100644
index 0a1ab37cdad..00000000000
--- a/mysql-test/t/rpl_ndb_dd_advance.test
+++ /dev/null
@@ -1,581 +0,0 @@
-###############################################
-# Author: JBM #
-# Date: 2006-03-07 #
-# Purpose: To test advance DD and replication #
-###############################################
-
-#### Include Section ####
---source include/have_ndb.inc
---source include/have_binlog_format_row.inc
---source include/ndb_default_cluster.inc
---source include/not_embedded.inc
---source include/big_test.inc
-#--source include/have_ndb_extra.inc
---source include/master-slave.inc
-
-#### Test start cleanup section #####
---disable_warnings
-DROP TABLE IF EXISTS t1, t2, t3;
---enable_warnings
-
-######################################################
-# Requirment: Cluster DD and replication must be able#
-# to handle ALTER tables and indexes and must rpl #
-# to the slave correctly #
-######################################################
-
-## Test #1 replication of CDD and Alter Tables #####
---echo ***** Test 1 RPL of CDD and Alter *****
---echo ***** Test 1 setup *****
-
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-INITIAL_SIZE 16M
-UNDO_BUFFER_SIZE = 1M
-ENGINE=NDB;
-
-ALTER LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile02.dat'
-INITIAL_SIZE 4M
-ENGINE=NDB;
-
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 12M
-ENGINE=NDB;
-
-ALTER TABLESPACE ts1
-ADD DATAFILE 'datafile02.dat'
-INITIAL_SIZE 4M
-ENGINE=NDB;
-
-CREATE TABLE t1
- (c1 INT NOT NULL PRIMARY KEY,
- c2 INT NOT NULL,
- c3 INT NOT NULL)
- TABLESPACE ts1 STORAGE DISK
- ENGINE=NDB;
-
---echo ***** insert some data *****
-
-let $j= 900;
---disable_query_log
-while ($j)
-{
- eval INSERT INTO t1 VALUES($j,$j*2,$j+3);
- dec $j;
-}
---enable_query_log
-
---echo ***** Select from Master *****
-
-SELECT * FROM t1 ORDER BY c1 LIMIT 5;
-
---echo ***** Select from Slave *****
---sync_slave_with_master
-connection slave;
-SELECT * FROM t1 ORDER BY c1 LIMIT 5;
-
-###################################
-# Just to some File Schema check #
-###################################
-
---disable_query_log
-SELECT DISTINCT FILE_NAME, FILE_TYPE, TABLESPACE_NAME, LOGFILE_GROUP_NAME
- FROM INFORMATION_SCHEMA.FILES
- WHERE ENGINE="ndbcluster" ORDER BY FILE_NAME;
---enable_query_log
-
---echo **** Do First Set of ALTERs in the master table ****
-###################################################
-# On this first set of alters I expect:
-# 1. To be able to create and index on 2 columns
-# 2. To be able to create a unique index
-# 3. To be able to add two columns and have
-# it all replicated correctly to the slave cluster.
-###################################################
-connection master;
-CREATE INDEX t1_i ON t1(c2, c3);
-#Bug 18039
-#CREATE UNIQUE INDEX t1_i2 ON t1(c2);
-ALTER TABLE t1 ADD c4 TIMESTAMP;
-ALTER TABLE t1 ADD c5 DOUBLE;
-ALTER TABLE t1 ADD INDEX (c5);
-SHOW CREATE TABLE t1;
-
---echo **** Show first set of ALTERs on SLAVE ****
---sync_slave_with_master
-connection slave;
-SHOW CREATE TABLE t1;
-
---echo **** Second set of alters test 1 ****
-############################################
-# With this next set of alters we have had
-# Some issues with renames of tables. So this
-# test renames our main table, drop and index off
-# of it, creates another table with then name
-# of the orginal table, inserts a row, drops
-# the table and renames the orginal table back.
-# I want to make sure that 1) the cluster does
-# okay with this and 2) that it is replicated
-# correctly.
-#############################################
-connection master;
-ALTER TABLE t1 RENAME t2;
-ALTER TABLE t2 DROP INDEX c5;
-CREATE TABLE t1(c1 INT)ENGINE=NDB;
-INSERT INTO t1 VALUES(1);
-DROP TABLE t1;
-ALTER TABLE t2 RENAME t1;
-
---echo **** Show second set of ALTERs on MASTER ****
-
-SHOW CREATE TABLE t1;
-
---echo **** Show second set of ALTERs on SLAVE ****
---sync_slave_with_master
-connection slave;
-SHOW CREATE TABLE t1;
-
---echo **** Third and last set of alters for test1 ****
-#########################################################
-# In this last set of alters, we are messing with the
-# cluster ability to rebuild indexes, drop a column that make up
-# an index with another column and change types several times in
-# a row. I have choosen the BLOB as it seems to have had many
-# issues in this release. I want to make sure that the cluster
-# deals with these radical changes and that the replication to
-# the slave cluster is dones correctly.
-###########################################################
-connection master;
-ALTER TABLE t1 CHANGE c1 c1 DOUBLE;
-ALTER TABLE t1 CHANGE c2 c2 DECIMAL(10,2);
-ALTER TABLE t1 DROP COLUMN c3;
-ALTER TABLE t1 CHANGE c4 c4 TEXT CHARACTER SET utf8;
-ALTER TABLE t1 CHANGE c4 c4 BLOB;
-ALTER TABLE t1 CHANGE c4 c3 BLOB;
-set @b1 = 'b1';
-set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
-UPDATE t1 SET c3=@b1 where c1 = 1;
-UPDATE t1 SET c3=@b1 where c1 = 2;
-
---echo **** Show last set of ALTERs on MASTER ****
-
-SHOW CREATE TABLE t1;
-SELECT * FROM t1 ORDER BY c1 LIMIT 5;
-
---echo **** Show last set of ALTERs on SLAVE ****
---sync_slave_with_master
-connection slave;
-SHOW CREATE TABLE t1;
-# Bug 18094
-#SELECT * FROM t1 ORDER BY c1 LIMIT 5;
-SELECT * FROM t1 where c1 = 1;
-
-connection master;
-DROP TABLE t1;
---sync_slave_with_master
-connection slave;
-STOP SLAVE;
-RESET SLAVE;
-connection master;
-RESET MASTER;
-connection slave;
-START SLAVE;
-
-################### TEST 2 TPCB for disk data ###########################
-# Requirement: To have Stored Procedures and Functions that are used to #
-# populate and post transactions to the data base using CDD that span #
-# 2 tables spaces and also use a memory only cluster tables. In addition#
-# The slave is to be stopped, cleaned and restored and synced with the #
-# Master cluster #
-#########################################################################
-
---echo ******** Create additional TABLESPACE test 2 **************
-
-connection master;
-CREATE TABLESPACE ts2
-ADD DATAFILE 'datafile03.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 12M
-ENGINE=NDB;
-
-ALTER TABLESPACE ts2
-ADD DATAFILE 'datafile04.dat'
-INITIAL_SIZE 12M
-ENGINE=NDB;
-
-###### CLEAN UP SECTION ##############
-DROP DATABASE IF EXISTS tpcb;
-CREATE DATABASE tpcb;
-######## Creat Table Section #########
---echo *********** Create TPCB Tables *****************
-CREATE TABLE tpcb.account
- (id INT, bid INT, balance DECIMAL(10,2),
- filler CHAR(255), PRIMARY KEY(id))
- TABLESPACE ts1 STORAGE DISK
- ENGINE=NDB;
-
-CREATE TABLE tpcb.branch
- (bid INT, balance DECIMAL(10,2), filler VARCHAR(255),
- PRIMARY KEY(bid))
- ENGINE=NDB;
-
-CREATE TABLE tpcb.teller
- (tid INT, balance DECIMAL(10,2), filler VARCHAR(255),
- PRIMARY KEY(tid))
- TABLESPACE ts2 STORAGE DISK
- ENGINE=NDB;
-
-CREATE TABLE tpcb.history
- (id MEDIUMINT NOT NULL AUTO_INCREMENT,aid INT,
- tid INT, bid INT, amount DECIMAL(10,2),
- tdate DATETIME, teller CHAR(20), uuidf LONGBLOB,
- filler CHAR(80),PRIMARY KEY (id))
- TABLESPACE ts2 STORAGE DISK
- ENGINE=NDB;
-
---echo ********* Create Procedures and Functions ************
-delimiter |;
-CREATE PROCEDURE tpcb.load()
-BEGIN
- DECLARE acct INT DEFAULT 1000;
- DECLARE brch INT DEFAULT 100;
- DECLARE tell INT DEFAULT 1000;
- DECLARE tmp INT DEFAULT 100;
- WHILE brch > 0 DO
- SET tmp = 100;
- WHILE tmp > 0 DO
- INSERT INTO tpcb.account VALUES (acct, brch, 0.0, "FRESH ACCOUNT");
- SET acct = acct - 1;
- SET tmp = tmp -1;
- END WHILE;
- INSERT INTO tpcb.branch VALUES (brch, 0.0, "FRESH BRANCH");
- SET brch = brch - 1;
- END WHILE;
- WHILE tell > 0 DO
- INSERT INTO tpcb.teller VALUES (tell, 0.0, "FRESH TELLER");
- SET tell = tell - 1;
- END WHILE;
-END|
-
-CREATE FUNCTION tpcb.account_id () RETURNS INT
-BEGIN
- DECLARE num INT;
- DECLARE ran INT;
- SELECT RAND() * 10 INTO ran;
- IF (ran < 2)
- THEN
- SELECT RAND() * 10 INTO num;
- ELSEIF (ran < 4)
- THEN
- SELECT RAND() * 100 INTO num;
- ELSE
- SELECT RAND() * 1000 INTO num;
- END IF;
- IF (num < 1)
- THEN
- RETURN 1;
- END IF;
- RETURN num;
-END|
-
-CREATE FUNCTION tpcb.teller_id () RETURNS INT
-BEGIN
- DECLARE num INT;
- DECLARE ran INT;
- SELECT RAND() * 10 INTO ran;
- IF (ran < 2)
- THEN
- SELECT RAND() * 10 INTO num;
- ELSEIF (ran < 5)
- THEN
- SELECT RAND() * 100 INTO num;
- ELSE
- SELECT RAND() * 1000 INTO num;
- END IF;
- IF (num < 1)
- THEN
- RETURN 1;
- END IF;
- RETURN num;
-END|
-
-CREATE PROCEDURE tpcb.trans()
-BEGIN
- DECLARE acct INT DEFAULT 0;
- DECLARE brch INT DEFAULT 0;
- DECLARE tell INT DEFAULT 0;
- DECLARE bal DECIMAL(10,2) DEFAULT 0.0;
- DECLARE amount DECIMAL(10,2) DEFAULT 1.00;
- DECLARE test INT DEFAULT 0;
- DECLARE bbal DECIMAL(10,2) DEFAULT 0.0;
- DECLARE tbal DECIMAL(10,2) DEFAULT 0.0;
- DECLARE local_uuid VARCHAR(255);
- DECLARE local_user VARCHAR(255);
- DECLARE local_time TIMESTAMP;
-
- SELECT RAND() * 10 INTO test;
- SELECT tpcb.account_id() INTO acct;
- SELECT tpcb.teller_id() INTO tell;
-
- SELECT account.balance INTO bal FROM tpcb.account WHERE id = acct;
- SELECT account.bid INTO brch FROM tpcb.account WHERE id = acct;
- SELECT teller.balance INTO tbal FROM tpcb.teller WHERE tid = tell;
- SELECT branch.balance INTO bbal FROM tpcb.branch WHERE bid = brch;
-
- IF (test < 5)
- THEN
- SET bal = bal + amount;
- SET bbal = bbal + amount;
- SET tbal = tbal + amount;
- UPDATE tpcb.account SET balance = bal, filler = 'account updated'
- WHERE id = acct;
- UPDATE tpcb.branch SET balance = bbal, filler = 'branch updated'
- WHERE bid = brch;
- UPDATE tpcb.teller SET balance = tbal, filler = 'teller updated'
- WHERE tid = tell;
- ELSE
- SET bal = bal - amount;
- SET bbal = bbal - amount;
- SET tbal = tbal - amount;
- UPDATE tpcb.account SET balance = bal, filler = 'account updated'
- WHERE id = acct;
- UPDATE tpcb.branch SET balance = bbal, filler = 'branch updated'
- WHERE bid = brch;
- UPDATE tpcb.teller SET balance = tbal, filler = 'teller updated'
- WHERE tid = tell;
- END IF;
-
- SET local_uuid=UUID();
- SET local_user=USER();
- SET local_time= NOW();
- INSERT INTO tpcb.history VALUES(NULL,acct,tell,brch,amount, local_time,local_user,
- local_uuid,'completed trans');
-END|
-delimiter ;|
-
---echo ****** TEST 2 test time *********************************
-USE tpcb;
-
---echo *********** Load up the database ******************
-CALL tpcb.load();
-
---echo ********** Check load master and slave **************
-SELECT COUNT(*) FROM account;
---sync_slave_with_master
-connection slave;
-USE tpcb;
-SELECT COUNT(*) FROM account;
-
---echo ******** Run in some transactions ***************
-
-connection master;
-let $j= 1000;
---disable_query_log
-while ($j)
-{
- CALL tpcb.trans();
- dec $j;
-}
---enable_query_log
-
---echo ***** Time to try slave sync ***********
---echo **** Must make sure slave is clean *****
---connection slave
-STOP SLAVE;
-RESET SLAVE;
-DROP PROCEDURE IF EXISTS tpcb.load;
-DROP PROCEDURE IF EXISTS tpcb.trans;
-DROP TABLE IF EXISTS tpcb.account;
-DROP TABLE IF EXISTS tpcb.teller;
-DROP TABLE IF EXISTS tpcb.branch;
-DROP TABLE IF EXISTS tpcb.history;
-DROP DATABASE tpcb;
-
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile.dat'
-ENGINE=NDB;
-
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile02.dat'
-ENGINE=NDB;
-
-DROP TABLESPACE ts1 ENGINE=NDB;
-
-ALTER TABLESPACE ts2
-DROP DATAFILE 'datafile03.dat'
-ENGINE=NDB;
-
-ALTER TABLESPACE ts2
-DROP DATAFILE 'datafile04.dat'
-ENGINE=NDB;
-
-DROP TABLESPACE ts2 ENGINE=NDB;
-
-DROP LOGFILE GROUP lg1 ENGINE=NDB;
-
---echo ********** Take a backup of the Master *************
-connection master;
-
-SELECT COUNT(*) FROM history;
-
-let $j= 1000;
---disable_query_log
-while ($j)
-{
- CALL tpcb.trans();
- dec $j;
-}
---enable_query_log
-
-SELECT COUNT(*) FROM history;
-
-#RESET MASTER;
---exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "start backup" >> $NDB_TOOLS_OUTPUT
-
---exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > $MYSQLTEST_VARDIR/tmp.dat
-
-CREATE TEMPORARY TABLE IF NOT EXISTS mysql.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-
-DELETE FROM mysql.backup_info;
-
-LOAD DATA INFILE '../tmp.dat' INTO TABLE mysql.backup_info FIELDS TERMINATED BY ',';
---exec rm $MYSQLTEST_VARDIR/tmp.dat || true
---replace_column 1 <the_backup_id>
-
-SELECT @the_backup_id:=backup_id FROM mysql.backup_info;
-
-let the_backup_id=`select @the_backup_id`;
-
-DROP TABLE IF EXISTS mysql.backup_info;
-#RESET MASTER;
-
---echo ************ Restore the slave ************************
-connection slave;
-CREATE DATABASE tpcb;
---source include/ndb_restore_slave_eoption.inc
-
---echo ***** Check a few slave restore values ***************
-connection slave;
-USE tpcb;
-SELECT COUNT(*) FROM account;
-
---echo ***** Add some more records to master *********
-connection master;
-let $j= 1000;
---disable_query_log
-while ($j)
-{
- CALL tpcb.trans();
- dec $j;
-}
---enable_query_log
-
-#
-# now setup replication to continue from last epoch
-# 1. get apply_status epoch from slave
-# 2. get corresponding _next_ binlog postition from master
-# 3. change master on slave
-# 4. add some transaction for slave to process
-# 5. start the replication
-
---echo ***** Finsh the slave sync process *******
---disable_query_log
-# 1. 2. 3.
---source include/ndb_setup_slave.inc
---enable_query_log
-
-# 4.
---echo * 4. *
-connection master;
-let $j= 1000;
---disable_query_log
-while ($j)
-{
- CALL tpcb.trans();
- dec $j;
-}
---enable_query_log
-
-# 5.
---echo * 5. *
-connection slave;
-START SLAVE;
-
---echo **** We should be ready to continue on *************
-
-connection master;
-let $j= 50;
---disable_query_log
-while ($j)
-{
- CALL tpcb.trans();
- dec $j;
-}
---enable_query_log
-
---echo ****** Let's make sure we match *******
---echo ***** MASTER *******
-USE tpcb;
-SELECT COUNT(*) FROM history;
-
---echo ****** SLAVE ********
---sync_slave_with_master
-connection slave;
-USE tpcb;
-SELECT COUNT(*) FROM history;
-
---echo *** DUMP MASTER & SLAVE FOR COMPARE ********
-
---exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert tpcb account teller branch history > $MYSQLTEST_VARDIR/tmp/RPL_DD_ADV_M.sql
-
---exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert tpcb account teller branch history > $MYSQLTEST_VARDIR/tmp/RPL_DD_ADV_S.sql
-
---echo *************** TEST 2 CLEANUP SECTION ********************
-connection master;
-DROP PROCEDURE IF EXISTS tpcb.load;
-DROP PROCEDURE IF EXISTS tpcb.trans;
-DROP TABLE tpcb.account;
-DROP TABLE tpcb.teller;
-DROP TABLE tpcb.branch;
-DROP TABLE tpcb.history;
-DROP DATABASE tpcb;
-
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile.dat'
-ENGINE=NDB;
-
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile02.dat'
-ENGINE=NDB;
-
-DROP TABLESPACE ts1 ENGINE=NDB;
-
-ALTER TABLESPACE ts2
-DROP DATAFILE 'datafile03.dat'
-ENGINE=NDB;
-
-ALTER TABLESPACE ts2
-DROP DATAFILE 'datafile04.dat'
-ENGINE=NDB;
-
-DROP TABLESPACE ts2 ENGINE=NDB;
-
-DROP LOGFILE GROUP lg1 ENGINE=NDB;
-
---sync_slave_with_master
-
-connection master;
-
---echo ****** Do dumps compare ************
-
-diff_files $MYSQLTEST_VARDIR/tmp/RPL_DD_ADV_M.sql $MYSQLTEST_VARDIR/tmp/RPL_DD_ADV_S.sql;
-
-## Note: Ths files should only get removed, if the above diff succeeds.
-
---exec rm $MYSQLTEST_VARDIR/tmp/RPL_DD_ADV_M.sql
---exec rm $MYSQLTEST_VARDIR/tmp/RPL_DD_ADV_S.sql
-
-# End 5.1 test case
diff --git a/mysql-test/t/rpl_ndb_dd_basic.test b/mysql-test/t/rpl_ndb_dd_basic.test
deleted file mode 100644
index 7387d39db87..00000000000
--- a/mysql-test/t/rpl_ndb_dd_basic.test
+++ /dev/null
@@ -1,85 +0,0 @@
---source include/have_ndb.inc
---source include/have_binlog_format_row.inc
---source include/master-slave.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-#
-# Basic test of disk tables for NDB
-#
-
-#
-# Start by creating a logfile group
-#
-
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-INITIAL_SIZE 16M
-UNDO_BUFFER_SIZE = 1M
-ENGINE=NDB;
-
-alter logfile group lg1
-add undofile 'undofile02.dat'
-initial_size 4M engine=ndb;
-
-#
-# Create a tablespace connected to the logfile group
-#
-
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 12M
-ENGINE NDB;
-
-alter tablespace ts1
-add datafile 'datafile02.dat'
-initial_size 4M engine=ndb;
-
-#
-# Create a table using this tablespace
-#
-
-CREATE TABLE t1
-(pk1 int not null primary key, b int not null, c int not null)
-tablespace ts1 storage disk
-engine ndb;
-
-#
-# insert some data
-#
-
-insert into t1 values (1,2,3);
-select * from t1 order by pk1;
-
-#
-# check that the data is also on the slave
-#
-
---sync_slave_with_master
---connection slave
-select * from t1 order by pk1;
-
-#
-# view the binlog
-#
-
---connection master
--- source include/show_binlog_events2.inc
-
-#
-# cleanup
-#
-
-drop table t1;
-alter tablespace ts1
-drop datafile 'datafile.dat'
-engine=ndb;
-alter tablespace ts1
-drop datafile 'datafile02.dat'
-engine=ndb;
-DROP TABLESPACE ts1 ENGINE=NDB;
-DROP LOGFILE GROUP lg1 ENGINE=NDB;
--- source include/master-slave-end.inc
diff --git a/mysql-test/t/rpl_ndb_dd_partitions.test b/mysql-test/t/rpl_ndb_dd_partitions.test
deleted file mode 100644
index 9291f38e8db..00000000000
--- a/mysql-test/t/rpl_ndb_dd_partitions.test
+++ /dev/null
@@ -1,310 +0,0 @@
-#######################################
-# Author: JBM #
-# Date: 2006-03-09 #
-# Purpose: To test the replication of #
-# Cluster Disk Data using partitions #
-#######################################
-
---source include/have_ndb.inc
---source include/have_binlog_format_row.inc
---source include/master-slave.inc
-
---echo --- Doing pre test cleanup ---
-
-connection master;
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_query_log
-
-
-# Start by creating a logfile group
-##################################
-
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-INITIAL_SIZE 16M
-UNDO_BUFFER_SIZE = 1M
-ENGINE=NDB;
-
-ALTER LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile02.dat'
-INITIAL_SIZE = 4M
-ENGINE=NDB;
-
-###################################################
-# Create a tablespace connected to the logfile group
-###################################################
-
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 12M
-ENGINE NDB;
-
-ALTER TABLESPACE ts1
-ADD DATAFILE 'datafile02.dat'
-INITIAL_SIZE = 4M
-ENGINE=NDB;
-
-#################################################################
-
---echo --- Start test 2 partition RANGE testing --
---echo --- Do setup --
-
-
-#################################################
-# Requirment: Create table that is partitioned #
-# by range on year i.e. year(t) and replicate #
-# basice operations such at insert, update #
-# delete between 2 different storage engines #
-# Alter table and ensure table is handled #
-# Correctly on the slave #
-#################################################
-
-CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63),
- bc CHAR(63), d DECIMAL(10,4) DEFAULT 0,
- f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
- y YEAR, t DATE)
- TABLESPACE ts1 STORAGE DISK
- ENGINE=NDB
- PARTITION BY RANGE (YEAR(t))
- (PARTITION p0 VALUES LESS THAN (1901),
- PARTITION p1 VALUES LESS THAN (1946),
- PARTITION p2 VALUES LESS THAN (1966),
- PARTITION p3 VALUES LESS THAN (1986),
- PARTITION p4 VALUES LESS THAN (2005),
- PARTITION p5 VALUES LESS THAN MAXVALUE);
-
---echo --- Show table on master ---
-
-SHOW CREATE TABLE t1;
-
---echo --- Show table on slave --
-
-sync_slave_with_master;
-SHOW CREATE TABLE t1;
-
---echo --- Perform basic operation on master ---
---echo --- and ensure replicated correctly ---
-
---source include/rpl_multi_engine3.inc
-
---echo --- Check that simple Alter statements are replicated correctly ---
-
-ALTER TABLE t1 MODIFY vc VARCHAR(255);
-
---echo --- Show the new improved table on the master ---
-
-SHOW CREATE TABLE t1;
-
---echo --- Make sure that our tables on slave are still same engine ---
---echo --- and that the alter statements replicated correctly ---
-
-sync_slave_with_master;
-SHOW CREATE TABLE t1;
-
---echo --- Perform basic operation on master ---
---echo --- and ensure replicated correctly ---
---enable_query_log
-
---source include/rpl_multi_engine3.inc
-
---echo --- End test 2 partition RANGE testing ---
---echo --- Do Cleanup ---
-
-DROP TABLE IF EXISTS t1;
-
-########################################################
-
---echo --- Start test 3 partition LIST testing ---
---echo --- Do setup ---
-#################################################
-
-
-CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63),
- bc CHAR(63), d DECIMAL(10,4) DEFAULT 0,
- f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
- y YEAR, t DATE)
- TABLESPACE ts1 STORAGE DISK
- ENGINE=NDB
- PARTITION BY LIST(id)
- (PARTITION p0 VALUES IN (2, 4),
- PARTITION p1 VALUES IN (42, 142));
-
---echo --- Test 3 Alter to add partition ---
-
-ALTER TABLE t1 ADD PARTITION (PARTITION p2 VALUES IN (412));
-
---echo --- Show table on master ---
-
-SHOW CREATE TABLE t1;
-
---echo --- Show table on slave ---
-
-sync_slave_with_master;
-SHOW CREATE TABLE t1;
-
---echo --- Perform basic operation on master ---
---echo --- and ensure replicated correctly ---
-
---source include/rpl_multi_engine3.inc
-
---echo --- Check that simple Alter statements are replicated correctly ---
-
-ALTER TABLE t1 MODIFY vc VARCHAR(255);
-
---echo --- Show the new improved table on the master ---
-
-SHOW CREATE TABLE t1;
-
---echo --- Make sure that our tables on slave are still same engine ---
---echo --- and that the alter statements replicated correctly ---
-
-sync_slave_with_master;
-SHOW CREATE TABLE t1;
-
---echo --- Perform basic operation on master ---
---echo --- and ensure replicated correctly ---
-
---source include/rpl_multi_engine3.inc
-
---echo --- End test 3 partition LIST testing ---
---echo --- Do Cleanup --
-
-DROP TABLE IF EXISTS t1;
-
-########################################################
-
---echo --- Start test 4 partition HASH testing ---
---echo --- Do setup ---
-#################################################
-
-
-CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63),
- bc CHAR(63), d DECIMAL(10,4) DEFAULT 0,
- f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
- y YEAR, t DATE)
- TABLESPACE ts1 STORAGE DISK
- ENGINE=NDB
- PARTITION BY HASH( YEAR(t) )
- PARTITIONS 4;
-
---echo --- show that tables have been created correctly ---
-
-SHOW CREATE TABLE t1;
-sync_slave_with_master;
-SHOW CREATE TABLE t1;
-
---echo --- Perform basic operation on master ---
---echo --- and ensure replicated correctly ---
-
---source include/rpl_multi_engine3.inc
-
---echo --- Check that simple Alter statements are replicated correctly ---
-
-ALTER TABLE t1 MODIFY vc VARCHAR(255);
-
---echo --- Show the new improved table on the master ---
-
-SHOW CREATE TABLE t1;
-
---echo --- Make sure that our tables on slave are still same engine ---
---echo --- and that the alter statements replicated correctly ---
-
-sync_slave_with_master;
-SHOW CREATE TABLE t1;
-
---echo --- Perform basic operation on master ---
---echo --- and ensure replicated correctly ---
-
---source include/rpl_multi_engine3.inc
-
---echo --- End test 4 partition HASH testing ---
---echo --- Do Cleanup --
-
-DROP TABLE IF EXISTS t1;
-
-########################################################
-
---echo --- Start test 5 partition by key testing ---
---echo --- Create Table Section ---
-
-#################################################
-
-CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63),
- bc CHAR(63), d DECIMAL(10,4) DEFAULT 0,
- f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
- y YEAR, t DATE,PRIMARY KEY(id))
- TABLESPACE ts1 STORAGE DISK
- ENGINE=NDB
- PARTITION BY KEY()
- PARTITIONS 4;
-
---echo --- Show that tables on master are ndbcluster tables ---
-
-SHOW CREATE TABLE t1;
-
---echo --- Show that tables on slave ---
-
-sync_slave_with_master;
-SHOW CREATE TABLE t1;
-
---echo --- Perform basic operation on master ---
---echo --- and ensure replicated correctly ---
-
---source include/rpl_multi_engine3.inc
-
-# Okay lets see how it holds up to table changes
---echo --- Check that simple Alter statements are replicated correctly ---
-
-ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total);
-
---echo --- Show the new improved table on the master ---
-
-SHOW CREATE TABLE t1;
-
---echo --- Make sure that our tables on slave are still right type ---
---echo --- and that the alter statements replicated correctly ---
-
-sync_slave_with_master;
-SHOW CREATE TABLE t1;
-
---echo --- Perform basic operation on master ---
---echo --- and ensure replicated correctly ---
-
---source include/rpl_multi_engine3.inc
-
---echo --- Check that simple Alter statements are replicated correctly ---
-
-ALTER TABLE t1 MODIFY vc VARCHAR(255);
-
---echo --- Show the new improved table on the master ---
-
-SHOW CREATE TABLE t1;
-
---echo --- Make sure that our tables on slave are still same engine ---
---echo --- and that the alter statements replicated correctly ---
-
-sync_slave_with_master;
-SHOW CREATE TABLE t1;
-
---echo --- Perform basic operation on master ---
---echo --- and ensure replicated correctly ---
-
---source include/rpl_multi_engine3.inc
-
---echo --- End test 5 key partition testing ---
---echo --- Do Cleanup ---
-
-DROP TABLE IF EXISTS t1;
-alter tablespace ts1
-drop datafile 'datafile.dat'
-engine=ndb;
-alter tablespace ts1
-drop datafile 'datafile02.dat'
-engine=ndb;
-DROP TABLESPACE ts1 ENGINE=NDB;
-DROP LOGFILE GROUP lg1 ENGINE=NDB;
---sync_slave_with_master
-
-# End of 5.1 test case
diff --git a/mysql-test/t/rpl_ndb_ddl.test b/mysql-test/t/rpl_ndb_ddl.test
deleted file mode 100644
index ca7a4ce4968..00000000000
--- a/mysql-test/t/rpl_ndb_ddl.test
+++ /dev/null
@@ -1,32 +0,0 @@
-#################### rpl_ndb_ddl.test ########################
-# #
-# DDL statements (sometimes with implicit COMMIT) executed #
-# by the master and it's propagation into the slave #
-# #
-##############################################################
-
-#
-# NOTE, PLEASE BE CAREFUL, WHEN MODIFYING THE TESTS !!
-#
-# 1. !All! objects to be dropped, renamed, altered ... must be created
-# in AUTOCOMMIT= 1 mode before AUTOCOMMIT is set to 0 and the test
-# sequences start.
-#
-# 2. Never use a test object, which was direct or indirect affected by a
-# preceeding test sequence again.
-# Except table d1.t1 where ONLY DML is allowed.
-#
-# If one preceeding test sequence hits a (sometimes not good visible,
-# because the sql error code of the statement might be 0) bug
-# and these rules are ignored, a following test sequence might earn ugly
-# effects like failing 'sync_slave_with_master', crashes of the slave or
-# abort of the test case etc..
-#
-
---source include/master-slave.inc
---source include/have_ndb.inc
-let $engine_type= NDB;
-let $temp_engine_type= MEMORY;
-let $show_binlog = 0;
-let $manipulate = 0;
--- source extra/rpl_tests/rpl_ddl.test
diff --git a/mysql-test/t/rpl_ndb_delete_nowhere.test b/mysql-test/t/rpl_ndb_delete_nowhere.test
deleted file mode 100644
index 92ceddf7f5c..00000000000
--- a/mysql-test/t/rpl_ndb_delete_nowhere.test
+++ /dev/null
@@ -1,8 +0,0 @@
-#########################################
-# By JBM 2006-02-14 Test wrapping to #
-# Share test code between engine tests #
-#########################################
---source include/have_ndb.inc
--- source include/have_binlog_format_row.inc
-let $engine_type=NDB;
--- source extra/rpl_tests/rpl_delete_no_where.test
diff --git a/mysql-test/t/rpl_ndb_do_db.test b/mysql-test/t/rpl_ndb_do_db.test
deleted file mode 100644
index 9b65d43f244..00000000000
--- a/mysql-test/t/rpl_ndb_do_db.test
+++ /dev/null
@@ -1,57 +0,0 @@
-###########################################################
-# Author: Jeb
-# Date: 14-12-2006
-# Purpose: To test --replicate-do-database=db_name
-# using cluster. Only replica should replicate.
-##########################################################
-
---source include/have_ndb.inc
---source include/have_binlog_format_row.inc
---source include/master-slave.inc
-
---disable_warnings
-DROP DATABASE IF EXISTS replica;
---enable_warnings
-
-# Create database and tables for the test.
-CREATE DATABASE replica;
-CREATE TABLE t1 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB;
-CREATE TABLE t2 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB;
-USE replica;
-CREATE TABLE replica.t1 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB;
-CREATE TABLE replica.t2 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB;
-
-# Insert data into db that should not be picked up by slave
-USE test;
-INSERT INTO t1 VALUES(1, repeat('abc',10));
-INSERT INTO t2 VALUES(1, repeat('abc',10));
-SHOW TABLES;
-SELECT COUNT(*) FROM t1;
-SELECT COUNT(*) FROM t2;
-
-# Insert data into db that should be replicated
-USE replica;
-INSERT INTO replica.t1 VALUES(2, repeat('def',200));
-INSERT INTO replica.t2 VALUES(2, repeat('def',200));
-SHOW TABLES;
-SELECT COUNT(*) FROM t1;
-SELECT COUNT(*) FROM t2;
-
-# Check results on slave
---sync_slave_with_master
-SHOW TABLES;
-USE replica;
-SHOW TABLES;
-SELECT COUNT(*) FROM t1;
-SELECT COUNT(*) FROM t2;
-USE test;
-SHOW TABLES;
-
-# Cleanup from testing
-connection master;
-USE test;
-DROP TABLE t1, t2;
-DROP DATABASE IF EXISTS replica;
---sync_slave_with_master
-
-# End 5.1 test case
diff --git a/mysql-test/t/rpl_ndb_do_table.test b/mysql-test/t/rpl_ndb_do_table.test
deleted file mode 100644
index 700c79766e1..00000000000
--- a/mysql-test/t/rpl_ndb_do_table.test
+++ /dev/null
@@ -1,46 +0,0 @@
-###########################################################
-# Author: Jeb
-# Date: 14-12-2006
-# Purpose: To test --replicate-do-table=db_name.tbl_name
-# using cluster. Only t1 should replicate.
-##########################################################
-
---source include/have_ndb.inc
---source include/have_binlog_format_row.inc
---source include/master-slave.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1, t2;
---enable_warnings
-
-CREATE TABLE t1 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB;
-CREATE TABLE t2 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB;
-
-INSERT INTO t1 VALUES(1, repeat('abc',10));
-INSERT INTO t1 VALUES(2, repeat('def',200));
-INSERT INTO t1 VALUES(3, repeat('ghi',3000));
-INSERT INTO t2 VALUES(1, repeat('abc',10));
-INSERT INTO t2 VALUES(2, repeat('def',200));
-INSERT INTO t2 VALUES(3, repeat('ghi',3000));
-
---sync_slave_with_master
-SHOW TABLES;
-SELECT COUNT(*) FROM t1;
-
-#
-# Bug #27044 replicated with unique field ndb table allows dup key inserts
-#
-connection master;
-
---error ER_DUP_ENTRY_WITH_KEY_NAME
-INSERT INTO t1 VALUES (3, repeat('bad',1));
-
-connection slave;
---error ER_DUP_ENTRY_WITH_KEY_NAME
-INSERT INTO t1 VALUES (3, repeat('bad too',1));
-
-# cleanup
-
-connection master;
-DROP TABLE IF EXISTS t1, t2;
---sync_slave_with_master
diff --git a/mysql-test/t/rpl_ndb_extraCol.test b/mysql-test/t/rpl_ndb_extraCol.test
deleted file mode 100644
index cf0501c490a..00000000000
--- a/mysql-test/t/rpl_ndb_extraCol.test
+++ /dev/null
@@ -1,13 +0,0 @@
-###########################################
-# Author: Jeb
-# Date: 2006-09-08
-# Purpose: Wapper for rpl_extraSlave_Col.test
-# Using NDB
-###########################################
--- source include/have_binlog_format_row.inc
---source include/have_ndb.inc
--- source include/master-slave.inc
-let $engine_type = 'NDB';
--- source extra/rpl_tests/rpl_extraSlave_Col.test
-
-
diff --git a/mysql-test/t/rpl_ndb_func003.test b/mysql-test/t/rpl_ndb_func003.test
deleted file mode 100644
index a19de7d3d6b..00000000000
--- a/mysql-test/t/rpl_ndb_func003.test
+++ /dev/null
@@ -1,12 +0,0 @@
-###################################
-# Wrapper for rpl_row_func003.test#
-# This test was orginally designed#
-# To test InnoDB using RBR, but #
-# It can also be used to test NDB #
-# So this wrapper is being used to#
-# reduce test case code #
-###################################
--- source include/have_ndb.inc
-let $engine_type=NDB;
--- source extra/rpl_tests/rpl_row_func003.test
--- source include/master-slave-end.inc
diff --git a/mysql-test/t/rpl_ndb_idempotent.test b/mysql-test/t/rpl_ndb_idempotent.test
deleted file mode 100644
index f2bfe745523..00000000000
--- a/mysql-test/t/rpl_ndb_idempotent.test
+++ /dev/null
@@ -1,117 +0,0 @@
---source include/have_ndb.inc
---source include/have_binlog_format_row.inc
---source include/master-slave.inc
-
-#
-# Currently test only works with ndb since it retrieves "old"
-# binlog positions with mysql.ndb_binlog_index and ndb_apply_status;
-#
-
-# create a table with one row
-CREATE TABLE t1 (c1 CHAR(15), c2 CHAR(15), c3 INT, PRIMARY KEY (c3)) ENGINE = NDB ;
-INSERT INTO t1 VALUES ("row1","will go away",1);
-SELECT * FROM t1 ORDER BY c3;
-
-# sync slave and retrieve epoch
-sync_slave_with_master;
---replace_column 1 <the_epoch>
-SELECT @the_epoch:=MAX(epoch) FROM mysql.ndb_apply_status;
-let $the_epoch= `select @the_epoch` ;
-SELECT * FROM t1 ORDER BY c3;
-
-# get the master binlog pos from the epoch
-connection master;
---replace_result $the_epoch <the_epoch>
---replace_column 1 <the_pos>
-eval SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
- FROM mysql.ndb_binlog_index WHERE epoch = $the_epoch ;
-let $the_pos= `SELECT @the_pos` ;
-let $the_file= `SELECT @the_file` ;
-
-# insert some more values
-INSERT INTO t1 VALUES ("row2","will go away",2),("row3","will change",3),("row4","D",4);
-DELETE FROM t1 WHERE c3 = 1;
-UPDATE t1 SET c2="should go away" WHERE c3 = 2;
-UPDATE t1 SET c2="C" WHERE c3 = 3;
-DELETE FROM t1 WHERE c3 = 2;
-
-SELECT * FROM t1 ORDER BY c3;
-
-# check that we have it on the slave
---sync_slave_with_master
---connection slave
-SELECT * FROM t1 ORDER BY c3;
-
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master>
-SHOW SLAVE STATUS;
-
-# stop slave and reset position to before the last changes
-STOP SLAVE;
---replace_result $the_pos <the_pos>
-eval CHANGE MASTER TO
- master_log_file = '$the_file',
- master_log_pos = $the_pos ;
-
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master>
-SHOW SLAVE STATUS;
-
-# start the slave again
-# -> same events should have been applied again
-# e.g. inserting rows that already there
-# deleting a row which is not there
-# updating a row which is not there
-START SLAVE;
-
---connection master
-SELECT * FROM t1 ORDER BY c3;
---sync_slave_with_master
---connection slave
-SELECT * FROM t1 ORDER BY c3;
-
-STOP SLAVE;
-
-#
-# cleanup
-#
---connection master
-DROP TABLE t1;
-RESET master;
---connection slave
-DROP TABLE t1;
-RESET slave;
-
-START SLAVE;
-
-#
-# Test that we can handle update of a row that does not exist on the slave
-# will trigger usage of AO_IgnoreError on slave side so that the INSERT
-# still succeeds even if the replication of the UPDATE generates an error.
-#
---connection master
-CREATE TABLE t1 (c1 CHAR(15) NOT NULL, c2 CHAR(15) NOT NULL, c3 INT NOT NULL, PRIMARY KEY (c3)) ENGINE = NDB ;
-INSERT INTO t1 VALUES ("row1","remove on slave",1);
-
---sync_slave_with_master
---connection slave
-DELETE FROM t1;
-
---connection master
-BEGIN;
-UPDATE t1 SET c2="does not exist" WHERE c3=1;
-INSERT INTO t1 VALUES ("row2","new on slave",2);
-COMMIT;
-
---sync_slave_with_master
---connection slave
-SELECT * FROM t1;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master>
-SHOW SLAVE STATUS;
-
-connection master;
-DROP TABLE IF EXISTS t1;
-
-# End of 5.1 Test
--- source include/master-slave-end.inc
diff --git a/mysql-test/t/rpl_ndb_innodb2ndb-slave.opt b/mysql-test/t/rpl_ndb_innodb2ndb-slave.opt
deleted file mode 100644
index 7f9eb96dff1..00000000000
--- a/mysql-test/t/rpl_ndb_innodb2ndb-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---default-storage-engine=ndbcluster
diff --git a/mysql-test/t/rpl_ndb_innodb2ndb.test b/mysql-test/t/rpl_ndb_innodb2ndb.test
deleted file mode 100644
index 229ee11353b..00000000000
--- a/mysql-test/t/rpl_ndb_innodb2ndb.test
+++ /dev/null
@@ -1,16 +0,0 @@
-#############################################################
-# Author: JBM
-# Date: 2006-02-24
-# Purpose: Trying to test ability to replicate from cluster
-# to innodb, or myisam, or replicate from innodb/myisam to
-# cluster slave. Due to limitations I have created wrappers
-# to be able to use the same code for all these different
-# test and to have control over the tests.
-##############################################################
--- source include/have_innodb.inc
--- source include/master-slave.inc
-connection slave;
--- source include/have_ndb.inc
-connection master;
-SET storage_engine=innodb;
---source extra/rpl_tests/rpl_ndb_2multi_eng.test
diff --git a/mysql-test/t/rpl_ndb_innodb_trans.test b/mysql-test/t/rpl_ndb_innodb_trans.test
deleted file mode 100644
index 127c2464570..00000000000
--- a/mysql-test/t/rpl_ndb_innodb_trans.test
+++ /dev/null
@@ -1,66 +0,0 @@
-# Test of a transaction mixing the two engines
-
--- source include/have_ndb.inc
--- source include/have_innodb.inc
--- source include/master-slave.inc
-
-create table t1 (a int, unique(a)) engine=ndbcluster;
-create table t2 (a int, unique(a)) engine=innodb;
-
-
-begin;
-insert into t1 values(1);
-insert into t2 values(1);
-rollback;
-
-select count(*) from t1;
-select count(*) from t2;
-sync_slave_with_master;
-select count(*) from t1;
-select count(*) from t2;
-connection master;
-
-begin;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t2;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
-rollback;
-
-select count(*) from t1;
-select count(*) from t2;
-sync_slave_with_master;
-select count(*) from t1;
-select count(*) from t2;
-connection master;
-
-delete from t1;
-delete from t2;
-begin;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t2;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
-rollback;
-
-select count(*) from t1;
-select count(*) from t2;
-sync_slave_with_master;
-select count(*) from t1;
-select count(*) from t2;
-connection master;
-
-delete from t1;
-delete from t2;
-begin;
-insert into t2 values(3),(4);
-insert into t1 values(3),(4);
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t2;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
-rollback;
-
-select count(*) from t1;
-select count(*) from t2;
-sync_slave_with_master;
-select count(*) from t1;
-select count(*) from t2;
-connection master;
-
-drop table t1,t2;
-sync_slave_with_master;
diff --git a/mysql-test/t/rpl_ndb_insert_ignore.test b/mysql-test/t/rpl_ndb_insert_ignore.test
deleted file mode 100644
index 17acb5983f4..00000000000
--- a/mysql-test/t/rpl_ndb_insert_ignore.test
+++ /dev/null
@@ -1,8 +0,0 @@
-#####################################
-# Wrapper for rpl_insert_ignore.test#
-#####################################
--- source include/have_ndb.inc
--- source include/have_binlog_format_row.inc
-let $engine_type=NDB;
-let $engine_type2=myisam;
--- source extra/rpl_tests/rpl_insert_ignore.test
diff --git a/mysql-test/t/rpl_ndb_load.test b/mysql-test/t/rpl_ndb_load.test
deleted file mode 100644
index 2ee540afd18..00000000000
--- a/mysql-test/t/rpl_ndb_load.test
+++ /dev/null
@@ -1,66 +0,0 @@
-#
-# Currently this test only runs in the source tree with the
-# ndb/test programs compiled.
-# invoke with: ./mysql-test-run --ndb-extra-test --do-test=rpl_ndb_load
-#
-
---source include/have_ndb.inc
---source include/have_ndb_extra.inc
---source include/have_binlog_format_row.inc
---source include/master-slave.inc
-
---disable_warnings
-# reset master
-connection master;
-DROP DATABASE IF EXISTS TEST_DB;
-CREATE DATABASE TEST_DB;
---enable_warnings
-
-#
-# These tables should correspond to the table definitions in
-# storage/ndb/test/ndbapi/bench/
-#
-connection master;
-USE TEST_DB;
-CREATE TABLE SUBSCRIBER
- ( NUMBER CHAR(12) BINARY NOT NULL,
- NAME CHAR(32) BINARY NOT NULL,
- GROUP_ID INT UNSIGNED NOT NULL,
- LOCATION INT UNSIGNED NOT NULL,
- SESSIONS INT UNSIGNED NOT NULL,
- CHANGED_BY CHAR(32) BINARY NOT NULL,
- CHANGED_TIME CHAR(32) BINARY NOT NULL,
- PRIMARY KEY USING HASH (NUMBER))
- ENGINE = NDB;
-
-CREATE TABLE GROUP_T
- ( GROUP_ID INT UNSIGNED NOT NULL,
- GROUP_NAME CHAR(32) BINARY NOT NULL,
- ALLOW_READ CHAR(1) BINARY NOT NULL,
- ALLOW_INSERT INT UNSIGNED NOT NULL,
- ALLOW_DELETE INT UNSIGNED NOT NULL,
- PRIMARY KEY USING HASH (GROUP_ID))
- ENGINE = NDB;
-
-CREATE TABLE SESSION
- ( NUMBER CHAR(12) BINARY NOT NULL,
- SERVER_ID INT UNSIGNED NOT NULL,
- DATA VARBINARY(1998) NOT NULL,
- PRIMARY KEY USING HASH (NUMBER,SERVER_ID))
- ENGINE = NDB;
-
-CREATE TABLE SERVER
- ( SUFFIX CHAR(2) BINARY NOT NULL,
- SERVER_ID INT UNSIGNED NOT NULL,
- NAME CHAR(32) BINARY NOT NULL,
- NO_OF_READ INT UNSIGNED NOT NULL,
- NO_OF_INSERT INT UNSIGNED NOT NULL,
- NO_OF_DELETE INT UNSIGNED NOT NULL,
- PRIMARY KEY USING HASH (SUFFIX, SERVER_ID))
- ENGINE = NDB;
-
-#
-# start "load" application
-#
---exec NDB_CONNECTSTRING=localhost:$NDBCLUSTER_PORT ../storage/ndb/test/ndbapi/DbCreate >> $NDB_TOOLS_OUTPUT
---exec NDB_CONNECTSTRING=localhost:$NDBCLUSTER_PORT ../storage/ndb/test/ndbapi/DbAsyncGenerator >> $NDB_TOOLS_OUTPUT
diff --git a/mysql-test/t/rpl_ndb_log.test b/mysql-test/t/rpl_ndb_log.test
deleted file mode 100644
index e883d24b977..00000000000
--- a/mysql-test/t/rpl_ndb_log.test
+++ /dev/null
@@ -1,12 +0,0 @@
-###################################
-# Wrapper for rpl_row_log.test #
-# Added wrapper so that MyISAM & #
-# Innodb and NDB could all use the#
-# Same test. NDB produced a diff #
-# bin-log #
-###################################
--- source include/have_binlog_format_row.inc
--- source include/have_ndb.inc
-let $engine_type=NDB;
--- source extra/rpl_tests/rpl_log.test
-
diff --git a/mysql-test/t/rpl_ndb_multi.test b/mysql-test/t/rpl_ndb_multi.test
deleted file mode 100644
index 196d0a5ed6f..00000000000
--- a/mysql-test/t/rpl_ndb_multi.test
+++ /dev/null
@@ -1,71 +0,0 @@
---source include/have_ndb.inc
---source include/have_multi_ndb.inc
---source include/have_binlog_format_row.inc
---source include/master-slave.inc
-
-# note: server2 is another "master" connected to the master cluster
-
-#
-# Currently test only works with ndb since it retrieves "old"
-# binlog positions with mysql.ndb_binlog_index and ndb_apply_status;
-#
-
-# create a table with one row, and make sure the other "master" gets it
-CREATE TABLE t1 (c1 CHAR(15), c2 CHAR(15), c3 INT, PRIMARY KEY (c3)) ENGINE = NDB ;
-connection server2;
-reset master;
-SHOW TABLES;
-connection master;
-INSERT INTO t1 VALUES ("row1","will go away",1);
-SELECT * FROM t1 ORDER BY c3;
-connection server2;
-SELECT * FROM t1 ORDER BY c3;
-
-# sync slave and retrieve epoch and stop the slave
-connection master;
-sync_slave_with_master;
---replace_column 1 <the_epoch>
-SELECT @the_epoch:=MAX(epoch) FROM mysql.ndb_apply_status;
-let $the_epoch= `select @the_epoch` ;
-SELECT * FROM t1 ORDER BY c3;
-stop slave;
-
-# get the master binlog pos from the epoch, from the _other_ "master", server2
-connection server2;
---replace_result $the_epoch <the_epoch>
-eval SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
- FROM mysql.ndb_binlog_index WHERE epoch = $the_epoch ;
-let $the_pos= `SELECT @the_pos` ;
-let $the_file= `SELECT @the_file` ;
-
-# now connect the slave to the _other_ "master"
-connection slave;
---replace_result $MASTER_MYPORT1 <MASTER_PORT1>
-eval CHANGE MASTER TO
- master_port=$MASTER_MYPORT1,
- master_log_file = '$the_file',
- master_log_pos = $the_pos ;
-start slave;
-
-# insert some more values on the first master
-connection master;
-INSERT INTO t1 VALUES ("row2","will go away",2),("row3","will change",3),("row4","D",4);
-DELETE FROM t1 WHERE c3 = 1;
-UPDATE t1 SET c2="should go away" WHERE c3 = 2;
-UPDATE t1 SET c2="C" WHERE c3 = 3;
-DELETE FROM t1 WHERE c3 = 2;
-
-SELECT * FROM t1 ORDER BY c3;
-
-save_master_pos;
-
-# insert another row, and check that we have it on the slave
-connection server2;
-INSERT INTO t1 VALUES ("row5","E",5);
-SELECT * FROM t1 ORDER BY c3;
-#sync_slave_with_master;
-connection slave;
---sleep 2
-SELECT * FROM t1 ORDER BY c3;
-
-STOP SLAVE;
diff --git a/mysql-test/t/rpl_ndb_multi_update2.test b/mysql-test/t/rpl_ndb_multi_update2.test
deleted file mode 100644
index df4f0eec39d..00000000000
--- a/mysql-test/t/rpl_ndb_multi_update2.test
+++ /dev/null
@@ -1,12 +0,0 @@
-############################################################
-# By JBM 2006-02-15 Wrapper for rpl_multi_update2.test #
-# to reuse test code between engine runs #
-############################################################
--- source include/have_ndb.inc
-
-# Run this only for row based replication, as replication of
-# auto_increment values are not supported with NDB as storage engine
--- source include/have_binlog_format_row.inc
-
-let $engine_type=NDB;
---source extra/rpl_tests/rpl_multi_update2.test
diff --git a/mysql-test/t/rpl_ndb_multi_update3.test b/mysql-test/t/rpl_ndb_multi_update3.test
deleted file mode 100644
index 008e2143987..00000000000
--- a/mysql-test/t/rpl_ndb_multi_update3.test
+++ /dev/null
@@ -1,8 +0,0 @@
-############################################################
-# By JBM 2006-02-15 Wrapper for rpl_multi_update3.test #
-# to reuse test code between engine runs #
-############################################################
--- source include/have_ndb.inc
--- source include/have_binlog_format_row.inc
-let $engine_type=NDB;
--- source extra/rpl_tests/rpl_multi_update3.test
diff --git a/mysql-test/t/rpl_ndb_myisam2ndb-master.opt b/mysql-test/t/rpl_ndb_myisam2ndb-master.opt
deleted file mode 100644
index 83ed8522e72..00000000000
--- a/mysql-test/t/rpl_ndb_myisam2ndb-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---binlog-format=row
diff --git a/mysql-test/t/rpl_ndb_myisam2ndb-slave.opt b/mysql-test/t/rpl_ndb_myisam2ndb-slave.opt
deleted file mode 100644
index 701dddb075b..00000000000
--- a/mysql-test/t/rpl_ndb_myisam2ndb-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---default-storage-engine=ndbcluster
diff --git a/mysql-test/t/rpl_ndb_myisam2ndb.test b/mysql-test/t/rpl_ndb_myisam2ndb.test
deleted file mode 100644
index 0c2df6441cb..00000000000
--- a/mysql-test/t/rpl_ndb_myisam2ndb.test
+++ /dev/null
@@ -1,15 +0,0 @@
-#############################################################
-# Author: JBM
-# Date: 2006-02-24
-# Purpose: Trying to test ability to replicate from cluster
-# to innodb, or myisam, or replicate from innodb/myisam to
-# cluster slave. Due to limitations I have created wrappers
-# to be able to use the same code for all these different
-# test and to have control over the tests.
-##############################################################
--- source include/master-slave.inc
-connection slave;
---source include/have_ndb.inc
-connection master;
-SET storage_engine=myisam;
---source extra/rpl_tests/rpl_ndb_2multi_eng.test
diff --git a/mysql-test/t/rpl_ndb_relayrotate-slave.opt b/mysql-test/t/rpl_ndb_relayrotate-slave.opt
deleted file mode 100644
index 3a4abbf091e..00000000000
--- a/mysql-test/t/rpl_ndb_relayrotate-slave.opt
+++ /dev/null
@@ -1,3 +0,0 @@
--O max_relay_log_size=16384
---innodb
---log-warnings
diff --git a/mysql-test/t/rpl_ndb_relayrotate.test b/mysql-test/t/rpl_ndb_relayrotate.test
deleted file mode 100644
index c5ec0e1d21b..00000000000
--- a/mysql-test/t/rpl_ndb_relayrotate.test
+++ /dev/null
@@ -1,8 +0,0 @@
-############################################################
-# By JBM 2006-02-15 Wrapper for rpl_relayrotate.test #
-# to reuse test code between engine runs #
-############################################################
--- source include/have_ndb.inc
--- source include/have_ndb_extra.inc
-let $engine_type=NDB;
--- source extra/rpl_tests/rpl_relayrotate.test
diff --git a/mysql-test/t/rpl_ndb_rep_ignore.test b/mysql-test/t/rpl_ndb_rep_ignore.test
deleted file mode 100644
index 47f5bce5527..00000000000
--- a/mysql-test/t/rpl_ndb_rep_ignore.test
+++ /dev/null
@@ -1,58 +0,0 @@
-###########################################################
-# Author: Jeb
-# Date: 15-12-2006
-# Purpose: To test --replicate-ignore-table=db_name.tbl_name
-# and --replicate-ignore-db=db_name
-# using cluster. Only replica should replicate.
-##########################################################
-
---source include/have_ndb.inc
---source include/have_binlog_format_row.inc
---source include/master-slave.inc
-
---disable_warnings
-DROP DATABASE IF EXISTS replica;
---enable_warnings
-
-# Create database and tables for the test.
-CREATE DATABASE replica;
-CREATE TABLE t1 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB;
-CREATE TABLE t2 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB;
-USE replica;
-CREATE TABLE replica.t1 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB;
-CREATE TABLE replica.t2 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB;
-
-# Insert data into db that should not be picked up by slave
-USE test;
-INSERT INTO t1 VALUES(1, repeat('abc',10));
-INSERT INTO t2 VALUES(1, repeat('abc',10));
-SHOW TABLES;
-SELECT COUNT(*) FROM t1;
-SELECT COUNT(*) FROM t2;
-
-# Insert data into db that should be replicated
-USE replica;
-INSERT INTO replica.t1 VALUES(2, repeat('def',200));
-INSERT INTO replica.t2 VALUES(2, repeat('def',200));
-SHOW TABLES;
-SELECT COUNT(*) FROM t1;
-SELECT COUNT(*) FROM t2;
-
-# Check results on slave
---sync_slave_with_master
-SHOW TABLES;
-USE replica;
-SHOW TABLES;
-#SELECT COUNT(*) FROM t1;
-SELECT COUNT(*) FROM t2;
-USE test;
-SHOW TABLES;
-
-# Cleanup from testing
-connection master;
-USE test;
-DROP TABLE t1, t2;
-DROP DATABASE IF EXISTS replica;
---sync_slave_with_master
-
-# End 5.1 test case
diff --git a/mysql-test/t/rpl_ndb_row_001.test b/mysql-test/t/rpl_ndb_row_001.test
deleted file mode 100644
index 1e2a4ec02df..00000000000
--- a/mysql-test/t/rpl_ndb_row_001.test
+++ /dev/null
@@ -1,6 +0,0 @@
-########################################################
-# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-########################################################
---source include/have_ndb.inc
-let $engine_type=NDB;
--- source extra/rpl_tests/rpl_row_001.test
diff --git a/mysql-test/t/rpl_ndb_sp003.test b/mysql-test/t/rpl_ndb_sp003.test
deleted file mode 100644
index 75ad9f0a488..00000000000
--- a/mysql-test/t/rpl_ndb_sp003.test
+++ /dev/null
@@ -1,9 +0,0 @@
-#################################
-# Wrapper for rpl_row_sp003.test#
-# These tests have been wrapped #
-# so the same code can be used #
-# For different engines #
-#################################
--- source include/have_ndb.inc
-let $engine_type=NDBCLUSTER;
--- source extra/rpl_tests/rpl_row_sp003.test
diff --git a/mysql-test/t/rpl_ndb_sp006.test b/mysql-test/t/rpl_ndb_sp006.test
deleted file mode 100644
index 590facc3648..00000000000
--- a/mysql-test/t/rpl_ndb_sp006.test
+++ /dev/null
@@ -1,9 +0,0 @@
-#################################
-# Wrapper for rpl_row_sp006.test#
-# These tests have been wrapped #
-# so the same code can be used #
-# For different engines #
-#################################
--- source include/have_ndb.inc
-let $engine_type=NDBCLUSTER;
--- source extra/rpl_tests/rpl_row_sp006.test
diff --git a/mysql-test/t/rpl_ndb_stm_innodb-master.opt b/mysql-test/t/rpl_ndb_stm_innodb-master.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/t/rpl_ndb_stm_innodb-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/t/rpl_ndb_stm_innodb.test b/mysql-test/t/rpl_ndb_stm_innodb.test
deleted file mode 100644
index b92fbbcfce6..00000000000
--- a/mysql-test/t/rpl_ndb_stm_innodb.test
+++ /dev/null
@@ -1,62 +0,0 @@
---source include/have_ndb.inc
---source include/have_innodb.inc
---source include/have_binlog_format_mixed_or_statement.inc
---source include/master-slave.inc
-
---connection master
-create table t1 (a int key, b int) engine innodb;
-create table t2 (a int key, b int) engine innodb;
-
---sync_slave_with_master
---connection slave
-alter table t1 engine ndb;
-alter table t2 engine ndb;
-
-# check binlog position without begin
---connection master
-insert into t1 values (1,2);
-
---sync_slave_with_master
---connection slave
---replace_column 1 <start_pos> 2 <end_pos>
-select @start_pos:=start_pos, @end_pos:=end_pos from mysql.ndb_apply_status;
---let $start_pos = `select @start_pos`
---let $end_pos = `select @end_pos`
-
---connection master
-# here is actually a bug, since there is no begin statement, the
-# query is autocommitted, and end_pos shows end of the insert and not
-# end of the commit
---replace_result $start_pos <start_pos>
---replace_column 5 #
---eval show binlog events from $start_pos limit 1
---replace_result $start_pos <start_pos> $end_pos <end_pos>
---replace_column 2 #
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
---eval show binlog events from $start_pos limit 1,1
-
-# check binlog position with begin
---connection master
-begin;
-insert into t1 values (2,3);
-insert into t2 values (3,4);
-commit;
-
---sync_slave_with_master
---connection slave
---replace_column 1 <start_pos> 2 <end_pos>
-select @start_pos:=start_pos, @end_pos:=end_pos from mysql.ndb_apply_status;
---let $start_pos = `select @start_pos`
---let $end_pos = `select @end_pos`
-
---connection master
---replace_result $start_pos <start_pos>
---replace_column 5 #
---eval show binlog events from $start_pos limit 1
---replace_result $start_pos <start_pos>
---replace_column 2 # 4 # 5 #
---eval show binlog events from $start_pos limit 1,2
---replace_result $start_pos <start_pos> $end_pos <end_pos>
---replace_column 2 #
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
---eval show binlog events from $start_pos limit 3,1
diff --git a/mysql-test/t/rpl_ndb_sync.test b/mysql-test/t/rpl_ndb_sync.test
deleted file mode 100644
index 14e2b36b588..00000000000
--- a/mysql-test/t/rpl_ndb_sync.test
+++ /dev/null
@@ -1,104 +0,0 @@
---source include/have_ndb.inc
---source include/ndb_default_cluster.inc
---source include/not_embedded.inc
---source include/have_binlog_format_row.inc
---source include/master-slave.inc
-
-#
-# Currently test only works with ndb since it retrieves "old"
-# binlog positions with mysql.ndb_binlog_index and ndb_apply_status;
-#
-
-# stop the save
---connection slave
-STOP SLAVE;
-CREATE DATABASE ndbsynctest;
-USE ndbsynctest;
-
-# get some data on the master
---connection master
-CREATE DATABASE ndbsynctest;
-USE ndbsynctest;
-CREATE TABLE t1 (c1 BIT(1) NOT NULL, c2 BIT(1) NOT NULL, c3 CHAR(15), PRIMARY KEY(c3)) ENGINE = NDB ;
-INSERT INTO t1 VALUES (1,1,"row1"),(0,1,"row2"),(1,0,"row3"),(0,0,"row4");
-CREATE TABLE t2 (c1 CHAR(15), c2 BIT(1) NOT NULL, c3 BIT(1) NOT NULL, PRIMARY KEY(c1)) ENGINE = NDB ;
-INSERT INTO t2 VALUES ("ABC",1,1),("BCDEF",0,1),("CD",1,0),("DEFGHIJKL",0,0);
-SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
-SELECT hex(c2),hex(c3),c1 FROM t2 ORDER BY c1;
-
-# take a backup on master
---source include/ndb_backup.inc
-
-# update a row
-UPDATE t1 SET c2=0 WHERE c3="row2";
-SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
-
-# restore on slave, first check that nothing is there
---connection slave
-
-# we should have no tables
-SHOW TABLES;
-
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT_SLAVE" -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT_SLAVE" -b $the_backup_id -n 2 -r -e --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
-
-#
-# BUG#11960
-# prior to bugfix "DROP DATABASE" would give a warning since
-# the events were not created by ndb_restore
-#
-DROP DATABASE ndbsynctest;
-CREATE DATABASE ndbsynctest;
-USE ndbsynctest;
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT_SLAVE" -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT_SLAVE" -b $the_backup_id -n 2 -r -e --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
-
-# continue test
-SHOW TABLES;
-
-SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
-SELECT hex(c2),hex(c3),c1 FROM t2 ORDER BY c1;
-
-#
-# now setup replication to continue from last epoch
---source include/ndb_setup_slave.inc
---connection slave
-START SLAVE;
-
-#
-#
-#
---connection master
---sync_slave_with_master
---connection slave
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master>
-SHOW SLAVE STATUS;
-
-SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
-SELECT hex(c2),hex(c3),c1 FROM t2 ORDER BY c1;
-
-#
-# Cleanup
-#
-
---connection master
-DROP DATABASE ndbsynctest;
---sync_slave_with_master
---connection slave
-STOP SLAVE;
-
-#
-# Test some replication commands
-#
---connection master
-reset master;
-# should now contain nothing
-select * from mysql.ndb_binlog_index;
-
---connection slave
-reset slave;
-# should now contain nothing
-select * from mysql.ndb_apply_status;
-
-# End 5.1 Test
diff --git a/mysql-test/t/rpl_ndb_trig004.test b/mysql-test/t/rpl_ndb_trig004.test
deleted file mode 100644
index 7439da563a6..00000000000
--- a/mysql-test/t/rpl_ndb_trig004.test
+++ /dev/null
@@ -1,15 +0,0 @@
-#############################################################################
-# Original Author: JBM #
-# Original Date: 2006-02-14 #
-#############################################################################
-# TEST: Use before insert triggers and has the second insert fail #
-# Test is wrapped to save code and share between engines #
-#############################################################################
-
-# Includes
--- source include/have_binlog_format_row.inc
--- source include/have_ndb.inc
--- source include/master-slave.inc
-let $engine_type=NDB;
--- source extra/rpl_tests/rpl_trig004.test
-
diff --git a/mysql-test/t/rpl_ndbapi_multi.test b/mysql-test/t/rpl_ndbapi_multi.test
deleted file mode 100644
index 62b83f0557a..00000000000
--- a/mysql-test/t/rpl_ndbapi_multi.test
+++ /dev/null
@@ -1,11 +0,0 @@
--- source include/have_ndb.inc
--- source include/have_binlog_format_row.inc
--- source include/master-slave.inc
--- source include/have_ndbapi_examples.inc
-
---exec echo Running ndbapi_simple_dual
---exec $NDB_EXAMPLES_DIR/ndbapi_simple_dual/ndbapi_simple_dual $MASTER_MYSOCK "localhost:$NDBCLUSTER_PORT" $SLAVE_MYSOCK "localhost:$NDBCLUSTER_PORT_SLAVE" >> $NDB_EXAMPLES_OUTPUT
-
---exec echo Running mgmapi_logevent
---exec $NDB_EXAMPLES_DIR/mgmapi_logevent/mgmapi_logevent "localhost:$NDBCLUSTER_PORT" "localhost:$NDBCLUSTER_PORT_SLAVE" 1 >> $NDB_EXAMPLES_OUTPUT
-
diff --git a/mysql-test/t/rpl_packet.test b/mysql-test/t/rpl_packet.test
deleted file mode 100644
index 9bda014f0e3..00000000000
--- a/mysql-test/t/rpl_packet.test
+++ /dev/null
@@ -1,80 +0,0 @@
-#
-# Check replication protocol packet size handling
-# Bug#19402 SQL close to the size of the max_allowed_packet fails on slave
-#
-
-# max-out size db name
-source include/master-slave.inc;
-
-let $db= DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
-disable_warnings;
-eval drop database if exists $db;
-enable_warnings;
-eval create database $db;
-
-connection master;
-select @@net_buffer_length, @@max_allowed_packet;
-disconnect master;
-
-# alas, can't use eval here; if db name changed apply the change here
-connect (master,localhost,root,,DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________);
-
-connection master;
-create table `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
-
-INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1023');
-save_master_pos;
-
-connection slave;
-sync_with_master;
-eval select count(*) from `$db`.`t1` /* must be 1 */;
-
-SHOW STATUS LIKE 'Slave_running';
-select * from information_schema.session_status where variable_name= 'SLAVE_RUNNING';
-connection master;
-eval drop database $db;
-save_master_pos;
-
-connection slave;
-sync_with_master;
-
-#
-# Bug #23755: Replicated event larger that max_allowed_packet infinitely re-transmits
-#
-# Check that a situation when the size of event on the master is greater than
-# max_allowed_packet on the slave does not lead to infinite re-transmits.
-
-connection master;
-
-# Change the max packet size on master
-
-SET @@global.max_allowed_packet=4096;
-SET @@global.net_buffer_length=4096;
-
-# Restart slave for new setting to take effect
-connection slave;
-STOP SLAVE;
-START SLAVE;
-
-# Reconnect to master for new setting to take effect
-disconnect master;
-connect (master, localhost, root)
-connection master;
-
-CREATE TABLe `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
-
-INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
-
-# The slave I/O thread must stop after trying to read the above event
-connection slave;
-sleep 2;
-SHOW STATUS LIKE 'Slave_running';
-
-# cleanup
-#connection master;
-#drop table t1;
-#connection slave;
-#drop table t1;
-
-
-# End of tests
diff --git a/mysql-test/t/rpl_ps.test b/mysql-test/t/rpl_ps.test
deleted file mode 100644
index b8792722192..00000000000
--- a/mysql-test/t/rpl_ps.test
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# Test of replicating user variables
-#
-###########################################################
-# 2006-02-08 By JBM added order by for use w/ NDB engine
-###########################################################
-source include/master-slave.inc;
-
-#save_master_pos;
-#connection slave;
-#sync_with_master;
-#reset master;
-#connection master;
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1(n char(30));
-
-prepare stmt1 from 'insert into t1 values (?)';
-set @var1= "from-master-1";
-execute stmt1 using @var1;
-set @var1= "from-master-2-'',";
-execute stmt1 using @var1;
-SELECT * FROM t1 ORDER BY n;
-
-set @var2= 'insert into t1 values (concat("from-var-", ?))';
-prepare stmt2 from @var2;
-set @var1='from-master-3';
-execute stmt2 using @var1;
-
-save_master_pos;
-connection slave;
-sync_with_master;
-SELECT * FROM t1 ORDER BY n;
-
-connection master;
-
-drop table t1;
-
-save_master_pos;
-connection slave;
-sync_with_master;
-stop slave;
-
-# End of 4.1 tests
-
-reset master;
-reset slave;
-disconnect master;
diff --git a/mysql-test/t/rpl_rbr_to_sbr.test b/mysql-test/t/rpl_rbr_to_sbr.test
deleted file mode 100644
index 4f72996671d..00000000000
--- a/mysql-test/t/rpl_rbr_to_sbr.test
+++ /dev/null
@@ -1,47 +0,0 @@
--- source include/have_binlog_format_mixed_or_statement.inc
--- source include/not_ndb_default.inc
--- source include/master-slave.inc
-
-# Test that the slave temporarily switches to ROW when seeing binrow
-# events when it is in STATEMENT or MIXED mode
-
-SET BINLOG_FORMAT=MIXED;
-SET GLOBAL BINLOG_FORMAT=MIXED;
-SELECT @@GLOBAL.BINLOG_FORMAT, @@SESSION.BINLOG_FORMAT;
-
---echo **** On Master ****
-CREATE TABLE t1 (a INT, b LONG);
-INSERT INTO t1 VALUES (1,1), (2,2);
-INSERT INTO t1 VALUES (3,UUID()), (4,UUID());
-let $VERSION=`select version()`;
---replace_result $VERSION VERSION
---replace_column 2 # 5 #
---replace_regex /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS;
-sync_slave_with_master;
---echo **** On Slave ****
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
---query_vertical SHOW SLAVE STATUS
---replace_result $VERSION VERSION
---replace_column 2 # 5 #
---replace_regex /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS;
-
---exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql
---exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_slave.sql
-
-connection master;
-DROP TABLE IF EXISTS t1;
-
-# Let's compare. Note: If they match test will pass, if they do not match
-# the test will show that the diff statement failed and not reject file
-# will be created. You will need to go to the mysql-test dir and diff
-# the files your self to see what is not matching
-
-diff_files $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_slave.sql;
-
-# If all is good, we can remove the files
-
---remove_file $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql
---remove_file $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_slave.sql
diff --git a/mysql-test/t/rpl_read_only-slave.opt b/mysql-test/t/rpl_read_only-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/t/rpl_read_only-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/t/rpl_redirect.test b/mysql-test/t/rpl_redirect.test
deleted file mode 100644
index 078d1048794..00000000000
--- a/mysql-test/t/rpl_redirect.test
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# Test of automatic redirection of queries to master/slave.
-#
-
-source include/master-slave.inc;
-# We disable this for now as PS doesn't handle redirection
---disable_ps_protocol
-
-#first, make sure the slave has had enough time to register
-save_master_pos;
-connection slave;
-sync_with_master;
-
-#discover slaves
-connection master;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 16 # 23 # 33 #
-SHOW SLAVE STATUS;
---replace_result $SLAVE_MYPORT SLAVE_PORT
-SHOW SLAVE HOSTS;
-rpl_probe;
-
-#turn on master/slave query direction auto-magic
-enable_rpl_parse;
-create table t1 ( n int);
-insert into t1 values (1),(2),(3),(4);
-disable_rpl_parse;
-save_master_pos;
-connection slave;
-sync_with_master;
-insert into t1 values(5);
-connection master;
-enable_rpl_parse;
-# The first of the queries will be sent to the slave, the second to the master.
-SELECT * FROM t1 ORDER BY n;
-SELECT * FROM t1 ORDER BY n;
-disable_rpl_parse;
-SELECT * FROM t1 ORDER BY n;
-connection slave;
-SELECT * FROM t1 ORDER BY n;
-
-# Cleanup
-connection master;
-drop table t1;
-sync_slave_with_master;
-
-# End of 4.1 tests
diff --git a/mysql-test/t/rpl_relayrotate-slave.opt b/mysql-test/t/rpl_relayrotate-slave.opt
deleted file mode 100644
index 3a4abbf091e..00000000000
--- a/mysql-test/t/rpl_relayrotate-slave.opt
+++ /dev/null
@@ -1,3 +0,0 @@
--O max_relay_log_size=16384
---innodb
---log-warnings
diff --git a/mysql-test/t/rpl_relayrotate.test b/mysql-test/t/rpl_relayrotate.test
deleted file mode 100644
index 46d54aea1d2..00000000000
--- a/mysql-test/t/rpl_relayrotate.test
+++ /dev/null
@@ -1,10 +0,0 @@
-#######################################################
-# Wrapper for rpl_relayrotate.test to allow multi #
-# Engines to reuse test code. By JBM 2006-02-15 #
-# Added comments section and to skip when ndb is #
-# Default engine. #
-#######################################################
--- source include/not_ndb_default.inc
--- source include/have_innodb.inc
-let $engine_type=innodb;
--- source extra/rpl_tests/rpl_relayrotate.test
diff --git a/mysql-test/t/rpl_relayspace.test b/mysql-test/t/rpl_relayspace.test
deleted file mode 100644
index 70315c14f34..00000000000
--- a/mysql-test/t/rpl_relayspace.test
+++ /dev/null
@@ -1,34 +0,0 @@
-# The slave is started with relay_log_space_limit=10 bytes,
-# to force the deadlock after one event.
-
-source include/master-slave.inc;
-connection slave;
-stop slave;
-connection master;
-# This will generate a master's binlog > 10 bytes
-create table t1 (a int);
-drop table t1;
-create table t1 (a int);
-drop table t1;
-connection slave;
-reset slave;
-start slave io_thread;
-# Give the I/O thread time to block.
-sleep 2;
-# A bug caused the I/O thread to refuse stopping.
-stop slave io_thread;
-reset slave;
-start slave;
-# The I/O thread stops filling the relay log when
-# it's >10b. And the SQL thread cannot purge this relay log
-# as purge is done only when the SQL thread switches to another
-# relay log, which does not exist here.
-# So we should have a deadlock.
-# if it is not resolved automatically we'll detect
-# it with master_pos_wait that waits for farther than 1Ob;
-# it will timeout after 10 seconds;
-# also the slave will probably not cooperate to shutdown
-# (as 2 threads are locked)
-select master_pos_wait('master-bin.001',200,6)=-1;
-
-# End of 4.1 tests
diff --git a/mysql-test/t/rpl_replicate_do.test b/mysql-test/t/rpl_replicate_do.test
deleted file mode 100644
index 600840a2828..00000000000
--- a/mysql-test/t/rpl_replicate_do.test
+++ /dev/null
@@ -1,92 +0,0 @@
-# This test assumes we are ignoring updates on table t2, but doing
-# updates on t1
-source include/master-slave.inc;
---disable_warnings
-drop table if exists t11;
-connection slave;
-drop table if exists t11;
---enable_warnings
-
-create table t2 (n int);
-insert into t2 values(4);
-connection master;
-create table t2 (s char(20));
-load data infile '../std_data_ln/words.dat' into table t2;
-insert into t2 values('five');
-create table t1 (m int);
-insert into t1 values(15),(16),(17);
-update t1 set m=20 where m=16;
-delete from t1 where m=17;
-create table t11 select * from t1;
-save_master_pos;
-connection slave;
-sync_with_master;
-select * from t1 ORDER BY m;
-select * from t2;
---error 1146
-select * from t11;
-connection master;
-drop table if exists t1,t2,t11;
-save_master_pos;
-connection slave;
-sync_with_master;
-# show slave status, just to see of it prints replicate-do-table
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 #
-show slave status;
-
-#
-# BUG#12542
-# TEST: "SET ONE_SHOT should always be executed on slave"
-#
-# We could use any timezone different than server default in this test
-#
-connection master;
-create table t1 (ts timestamp);
-set one_shot time_zone='met';
-insert into t1 values('2005-08-12 00:00:00');
-set one_shot time_zone='met';
-select * from t1;
-sync_slave_with_master;
-
-connection slave;
-set one_shot time_zone='met';
-select * from t1;
-
-connection master;
-drop table t1;
-sync_slave_with_master;
-
-# End of 4.1 tests
-
-#
-# Bug#24478 DROP TRIGGER is not caught by replicate-*-table filters
-#
---echo *** master ***
-connection master;
-create table t1 (a int, b int);
-create trigger trg1 before insert on t1 for each row set new.b=2;
-create table t2 (a int, b int);
-create trigger trg2 before insert on t2 for each row set new.b=2;
-show tables;
-show triggers;
-sync_slave_with_master;
---echo *** slave ***
-connection slave;
-show tables;
-show triggers;
---echo *** master ***
-connection master;
-drop trigger trg1;
-drop trigger trg2;
-show triggers;
-sync_slave_with_master;
---echo *** slave ***
-connection slave;
-show tables;
-show triggers;
---echo *** master ***
-connection master;
-drop table t1;
-drop table t2;
-sync_slave_with_master;
diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/t/rpl_rotate_logs.test
deleted file mode 100644
index 027747665a3..00000000000
--- a/mysql-test/t/rpl_rotate_logs.test
+++ /dev/null
@@ -1,164 +0,0 @@
-# This test uses chmod, can't be run with root permissions
--- source include/not_as_root.inc
-
-#
-# Test is run with max_binlog_size=2048 to force automatic rotation of the
-# binary log
-# Tests done:
-# - Check that slaves reports correct failures if master.info has strange
-# modes/information
-# - Automatic binary log rotation
-# - Ensure that temporary tables works over flush logs and binary log
-# changes
-# - Test creating a duplicate key error and recover from it
-
-# Requires statement logging
--- source include/have_binlog_format_mixed_or_statement.inc
-
-connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
---disable_warnings
-drop table if exists t1, t2, t3, t4;
---enable_warnings
-connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK);
-# Create empty file
-write_file $MYSQLTEST_VARDIR/slave-data/master.info;
-EOF
-chmod 0000 $MYSQLTEST_VARDIR/slave-data/master.info;
-connection slave;
---disable_warnings
-drop table if exists t1, t2, t3, t4;
---enable_warnings
-
-# START SLAVE will fail because it can't read the file (mode 000)
-# (system error 13)
---replace_result $MYSQL_TEST_DIR TESTDIR
---error 1105,1105,29
-start slave;
-chmod 0600 $MYSQLTEST_VARDIR/slave-data/master.info;
-# It will fail again because the file is empty so the slave cannot get valuable
-# info about how to connect to the master from it (failure in
-# init_strvar_from_file() in init_master_info()).
---error 1201
-start slave;
---replace_result $MASTER_MYPORT MASTER_PORT
-
-# CHANGE MASTER will fail because it first parses master.info before changing
-# it (so when master.info is bad, people have to use RESET SLAVE first).
---error 1201
-eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root';
-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';
-connection master;
-reset master;
-connection slave;
-start slave;
-connection master;
-
-#
-# Test FLUSH LOGS
-#
-create temporary table temp_table (a char(80) not null);
-insert into temp_table values ("testing temporary tables");
-create table t1 (s text);
-insert into t1 values('Could not break slave'),('Tried hard');
-sync_slave_with_master;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 16 # 23 # 33 #
-show slave status;
-select * from t1;
-connection master;
-flush logs;
-create table t2(m int not null auto_increment primary key);
-insert into t2 values (34),(67),(123);
-flush logs;
-show binary logs;
-create table t3 select * from temp_table;
-
-sync_slave_with_master;
-
-select * from t3;
-connection master;
-drop table temp_table, t3;
-
-#
-# Now lets make some duplicate key mess and see if we can recover from it
-#
-
-# First insert a value on the slave
-connection slave;
-insert into t2 values(1234);
-
-#same value on the master
-connection master;
-set insert_id=1234;
-insert into t2 values(NULL);
-connection slave;
-wait_for_slave_to_stop;
-
-#restart slave skipping one event
-set global sql_slave_skip_counter=1;
-start slave;
-
-connection master;
-
-#let slave catch up
-sync_slave_with_master;
-connection master;
-purge master logs to 'master-bin.000002';
-show master logs;
-# we just tests if synonyms are accepted
-purge binary logs to 'master-bin.000002';
-show binary logs;
-# sleeping 10 seconds or more would make the slave believe connection is down
---real_sleep 1
-purge master logs before now();
-show binary logs;
-insert into t2 values (65);
-sync_slave_with_master;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 16 # 23 # 33 #
-show slave status;
-select * from t2;
-
-#
-# Test forcing the replication log to rotate
-#
-
-connection master;
-create temporary table temp_table (a char(80) not null);
-insert into temp_table values ("testing temporary tables part 2");
-let $1=100;
-
-create table t3 (n int);
-disable_query_log;
-while ($1)
-{
-#eval means expand $ expressions
- eval insert into t3 values($1 + 4);
- dec $1;
-}
-enable_query_log;
-select count(*) from t3 where n >= 4;
-create table t4 select * from temp_table;
-show binary logs;
-show master status;
-save_master_pos;
-connection slave;
-sync_with_master;
-select * from t4;
-
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 16 # 23 # 33 #
-show slave status;
-# because of concurrent insert, the table may not be up to date
-# if we do not lock
-lock tables t3 read;
-select count(*) from t3 where n >= 4;
-unlock tables;
-#clean up
-connection master;
-drop table if exists t1,t2,t3,t4;
-sync_slave_with_master;
-
-# End of 4.1 tests
diff --git a/mysql-test/t/rpl_row_001.test b/mysql-test/t/rpl_row_001.test
deleted file mode 100644
index 639c55362a5..00000000000
--- a/mysql-test/t/rpl_row_001.test
+++ /dev/null
@@ -1,7 +0,0 @@
-########################################################
-# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-# Added to skip if ndb is default #
-########################################################
--- source include/not_ndb_default.inc
-let $engine_type=MYISAM;
--- source extra/rpl_tests/rpl_row_001.test
diff --git a/mysql-test/t/rpl_row_UUID.test b/mysql-test/t/rpl_row_UUID.test
deleted file mode 100644
index 6ead7c2ee9b..00000000000
--- a/mysql-test/t/rpl_row_UUID.test
+++ /dev/null
@@ -1,7 +0,0 @@
-########################################################
-# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-# Added to skip if ndb is default #
-########################################################
--- source include/not_ndb_default.inc
-let $engine_type=myisam;
---source extra/rpl_tests/rpl_row_UUID.test
diff --git a/mysql-test/t/rpl_row_basic_11bugs-master.opt b/mysql-test/t/rpl_row_basic_11bugs-master.opt
deleted file mode 100644
index ceba85f40e5..00000000000
--- a/mysql-test/t/rpl_row_basic_11bugs-master.opt
+++ /dev/null
@@ -1,2 +0,0 @@
---binlog_ignore_db=test_ignore --innodb
-
diff --git a/mysql-test/t/rpl_row_basic_11bugs-slave.opt b/mysql-test/t/rpl_row_basic_11bugs-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/t/rpl_row_basic_11bugs-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/t/rpl_row_basic_11bugs.test b/mysql-test/t/rpl_row_basic_11bugs.test
deleted file mode 100644
index 0109edf4264..00000000000
--- a/mysql-test/t/rpl_row_basic_11bugs.test
+++ /dev/null
@@ -1,186 +0,0 @@
---source include/have_binlog_format_row.inc
-
-let $SERVER_VERSION=`select version()`;
-
-#This test case is not written for NDB, the result files
-#will not match when NDB is the default engine
--- source include/not_ndb_default.inc
-
---source include/master-slave.inc
-
-# Bug#15942 (RBR ignores --binlog_ignore_db and tries to map to table
-# on slave for writes)
-
-CREATE DATABASE test_ignore; # --binlog_ignore_db=mysqltest_ignore
-
---echo **** On Master ****
-SHOW DATABASES;
-USE test;
-CREATE TABLE t1 (a INT, b INT);
-SHOW TABLES;
-INSERT INTO t1 VALUES (1,1), (2,2);
-USE test_ignore;
-CREATE TABLE t2 (a INT, b INT);
-SHOW TABLES;
-INSERT INTO t2 VALUES (3,3), (4,4);
-source include/show_binlog_events.inc;
-sync_slave_with_master;
---echo **** On Slave ****
-SHOW DATABASES;
-USE test;
-SHOW TABLES;
---error 1049
-USE test_ignore;
-
-connection master;
-DROP DATABASE test_ignore;
-sync_slave_with_master;
-
-# Bug#19995: Extreneous table maps generated for statements that does
-# not generate rows
---disable_query_log
---source include/master-slave-reset.inc
---enable_query_log
-
-connection master;
-CREATE TABLE t1 (a INT);
-DELETE FROM t1;
-INSERT INTO t1 VALUES (1),(2);
-DELETE FROM t1 WHERE a = 0;
-UPDATE t1 SET a=99 WHERE a = 0;
---replace_result $SERVER_VERSION SERVER_VERSION
---replace_regex /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS;
-
-DROP TABLE t1;
-
-# BUG#17620: Replicate (Row Based) Fails when Query Cache enabled on
-# slave
---echo ================ Test for BUG#17620 ================
---disable_query_log
---source include/master-slave-reset.inc
---enable_query_log
-
---echo **** On Slave ****
-connection slave;
-SET GLOBAL QUERY_CACHE_SIZE=0;
-
---echo **** On Master ****
-connection master;
-CREATE TABLE t1 (a INT);
-INSERT INTO t1 VALUES (1),(2),(3);
-
---echo **** On Slave ****
-sync_slave_with_master;
-SET GLOBAL QUERY_CACHE_SIZE=16*1024*1024;
-
---echo **** On Master ****
-connection master;
-INSERT INTO t1 VALUES (4),(5),(6);
-
---echo **** On Slave ****
-sync_slave_with_master;
-SELECT * FROM t1;
-
---echo **** On Master ****
-connection master;
-INSERT INTO t1 VALUES (7),(8),(9);
-
---echo **** On Slave ****
-sync_slave_with_master;
-SELECT * FROM t1;
-
-SET GLOBAL QUERY_CACHE_SIZE=0;
-
-# Bug#22550: Replication of BIT columns failing
---echo ================ Test for BUG#22550 ================
---disable_query_log
---source include/master-slave-reset.inc
---enable_query_log
-
-connection master;
-CREATE TABLE t1 (a BIT(1), b INT) ENGINE=MYISAM;
-sync_slave_with_master;
-
-connection master;
-INSERT INTO t1 VALUES(1,2);
-SELECT HEX(a),b FROM t1;
-sync_slave_with_master;
-SELECT HEX(a),b FROM t1;
-
-connection master;
-UPDATE t1 SET a=0 WHERE b=2;
-SELECT HEX(a),b FROM t1;
-sync_slave_with_master;
-SELECT HEX(a),b FROM t1;
-
-connection master;
-DROP TABLE IF EXISTS t1;
-sync_slave_with_master;
-
-# BUG#22583: RBR between MyISAM and non-MyISAM tables containing a BIT
-# field does not work
-
---echo ================ Test for BUG#22583 ================
---disable_query_log
---source include/master-slave-reset.inc
---enable_query_log
-
-# disabling warnings temporarily for ENGINE=INNODB to work without InnoDB
---disable_warnings
---echo **** On Master ****
-connection master;
-CREATE TABLE t1_myisam (k INT, a BIT(1), b BIT(9)) ENGINE=MYISAM;
-CREATE TABLE t1_innodb (k INT, a BIT(1), b BIT(9)) ENGINE=INNODB;
-CREATE TABLE t2_myisam (k INT, a BIT(1) NOT NULL, b BIT(4) NOT NULL) ENGINE=MYISAM;
-CREATE TABLE t2_innodb (k INT, a BIT(1) NOT NULL, b BIT(4) NOT NULL) ENGINE=INNODB;
---echo **** On Slave ****
-sync_slave_with_master;
-ALTER TABLE t1_myisam ENGINE=INNODB;
-ALTER TABLE t1_innodb ENGINE=MYISAM;
-ALTER TABLE t2_myisam ENGINE=INNODB;
-ALTER TABLE t2_innodb ENGINE=MYISAM;
---enable_warnings
-
---echo **** On Master ****
-connection master;
-INSERT INTO t1_myisam VALUES(1, b'0', 257);
-INSERT INTO t1_myisam VALUES(2, b'1', 256);
-INSERT INTO t1_innodb VALUES(1, b'0', 257);
-INSERT INTO t1_innodb VALUES(2, b'1', 256);
-SELECT k, HEX(a),HEX(b) FROM t1_myisam;
-SELECT k, HEX(a),HEX(b) FROM t1_innodb;
-INSERT INTO t2_myisam VALUES(1, b'0', 9);
-INSERT INTO t2_myisam VALUES(2, b'1', 8);
-INSERT INTO t2_innodb VALUES(1, b'0', 9);
-INSERT INTO t2_innodb VALUES(2, b'1', 8);
-SELECT k, HEX(a),HEX(b) FROM t2_myisam;
-SELECT k, HEX(a),HEX(b) FROM t2_innodb;
---echo **** On Slave ****
-sync_slave_with_master;
-SELECT k, HEX(a),HEX(b) FROM t1_myisam;
-SELECT k, HEX(a),HEX(b) FROM t1_innodb;
-SELECT k, HEX(a),HEX(b) FROM t2_myisam;
-SELECT k, HEX(a),HEX(b) FROM t2_innodb;
-
---echo **** On Master ****
-connection master;
-UPDATE t1_myisam SET a=0 WHERE k=2;
-SELECT k, HEX(a),HEX(b) FROM t1_myisam;
-UPDATE t1_innodb SET a=0 WHERE k=2;
-SELECT k, HEX(a),HEX(b) FROM t1_innodb;
-UPDATE t2_myisam SET a=0 WHERE k=2;
-SELECT k, HEX(a),HEX(b) FROM t2_myisam;
-UPDATE t2_innodb SET a=0 WHERE k=2;
-SELECT k, HEX(a),HEX(b) FROM t2_innodb;
---echo **** On Slave ****
-sync_slave_with_master;
-SELECT k, HEX(a),HEX(b) FROM t1_myisam;
-SELECT k, HEX(a),HEX(b) FROM t1_innodb;
-SELECT k, HEX(a),HEX(b) FROM t2_myisam;
-SELECT k, HEX(a),HEX(b) FROM t2_innodb;
-
---echo **** On Master ****
-connection master;
-DROP TABLE IF EXISTS t1_myisam, t1_innodb, t2_myisam, t2_innodb;
-sync_slave_with_master;
diff --git a/mysql-test/t/rpl_row_basic_2myisam.test b/mysql-test/t/rpl_row_basic_2myisam.test
deleted file mode 100644
index c2cef800ec8..00000000000
--- a/mysql-test/t/rpl_row_basic_2myisam.test
+++ /dev/null
@@ -1,3 +0,0 @@
-let $type= 'MYISAM' ;
-let $extra_index= ;
--- source extra/rpl_tests/rpl_row_basic.test
diff --git a/mysql-test/t/rpl_row_basic_3innodb.test b/mysql-test/t/rpl_row_basic_3innodb.test
deleted file mode 100644
index 89effc4b3bb..00000000000
--- a/mysql-test/t/rpl_row_basic_3innodb.test
+++ /dev/null
@@ -1,6 +0,0 @@
--- source include/have_innodb.inc
-
-let $type= 'INNODB' ;
-let $extra_index= ;
--- source extra/rpl_tests/rpl_row_basic.test
-
diff --git a/mysql-test/t/rpl_row_basic_7ndb.test b/mysql-test/t/rpl_row_basic_7ndb.test
deleted file mode 100644
index 1ec2fb333ae..00000000000
--- a/mysql-test/t/rpl_row_basic_7ndb.test
+++ /dev/null
@@ -1,5 +0,0 @@
--- source include/have_ndb.inc
-let $type= 'NDB' ;
-let $extra_index= ;
--- source extra/rpl_tests/rpl_row_basic.test
--- source include/master-slave-end.inc
diff --git a/mysql-test/t/rpl_row_blob_innodb.test b/mysql-test/t/rpl_row_blob_innodb.test
deleted file mode 100644
index 0bce657f9f9..00000000000
--- a/mysql-test/t/rpl_row_blob_innodb.test
+++ /dev/null
@@ -1,12 +0,0 @@
-#################################
-# Wrapper for rpl_row_blob.test#
-#################################
-########################################################
-# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-# Added to skip if ndb is default #
-########################################################
--- source include/not_ndb_default.inc
--- source include/have_innodb.inc
-let $engine_type=InnoDB;
--- source extra/rpl_tests/rpl_row_blob.test
-
diff --git a/mysql-test/t/rpl_row_blob_myisam.test b/mysql-test/t/rpl_row_blob_myisam.test
deleted file mode 100644
index a470c36f9f8..00000000000
--- a/mysql-test/t/rpl_row_blob_myisam.test
+++ /dev/null
@@ -1,11 +0,0 @@
-#################################
-# Wrapper for rpl_row_blob.test#
-#################################
-########################################################
-# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-# Added to skip if ndb is default #
-########################################################
--- source include/not_ndb_default.inc
-let $engine_type=myisam;
--- source extra/rpl_tests/rpl_row_blob.test
-
diff --git a/mysql-test/t/rpl_row_charset.test b/mysql-test/t/rpl_row_charset.test
deleted file mode 100644
index 9737c52c70f..00000000000
--- a/mysql-test/t/rpl_row_charset.test
+++ /dev/null
@@ -1,7 +0,0 @@
-########################################################
-# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-# Added to skip if ndb is default #
-########################################################
--- source include/not_ndb_default.inc
-let $engine_type=myisam;
--- source extra/rpl_tests/rpl_row_charset.test
diff --git a/mysql-test/t/rpl_row_create_table-slave.opt b/mysql-test/t/rpl_row_create_table-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/t/rpl_row_create_table-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/t/rpl_row_create_table.test b/mysql-test/t/rpl_row_create_table.test
deleted file mode 100644
index d1b26f9e3f4..00000000000
--- a/mysql-test/t/rpl_row_create_table.test
+++ /dev/null
@@ -1,236 +0,0 @@
-# Testing table creations for row-based replication.
-
---source include/have_binlog_format_row.inc
---source include/master-slave.inc
---source include/have_innodb.inc
-connection slave;
---source include/have_innodb.inc
-connection master;
-
-# 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
-# we disable the ps-protocol for this statement.
---disable_ps_protocol
-
---disable_query_log
---disable_warnings
-DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
---enable_warnings
---enable_query_log
-
-# Set the default storage engine to different values on master and
-# slave. We need to stop the slave for the server variable to take
-# effect, since the variable is only read on start-up.
-sync_slave_with_master;
---disable_query_log
-set @storage_engine = @@global.storage_engine;
-STOP SLAVE;
-SET GLOBAL storage_engine=memory;
-START SLAVE;
---enable_query_log
-
-connection master;
-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;
---replace_column 1 # 4 #
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
---query_vertical SHOW BINLOG EVENTS FROM 216
---echo **** On Master ****
---query_vertical SHOW CREATE TABLE t1
---query_vertical SHOW CREATE TABLE t2
---query_vertical SHOW CREATE TABLE t3
-sync_slave_with_master;
---echo **** On Slave ****
---query_vertical SHOW CREATE TABLE t1
---query_vertical SHOW CREATE TABLE t2
---query_vertical SHOW CREATE TABLE t3
-
-connection master;
-CREATE TABLE t5 (b INT, c INT) SELECT * FROM t3;
-
-CREATE TEMPORARY TABLE tt3 (a INT, b INT);
-INSERT INTO tt3 VALUES (1,2), (2,4), (3,6), (4,2), (5,10), (6,12);
-CREATE TABLE t6 (b INT, c INT) SELECT * FROM tt3;
---echo **** On Master ****
---query_vertical SHOW CREATE TABLE t5
-SELECT * FROM t5 ORDER BY a,b,c;
---query_vertical SHOW CREATE TABLE t6
-SELECT * FROM t6 ORDER BY a,b,c;
-sync_slave_with_master;
---echo **** On Slave ****
---query_vertical SHOW CREATE TABLE t5
-SELECT * FROM t5 ORDER BY a,b,c;
---query_vertical SHOW CREATE TABLE t6
-SELECT * FROM t6 ORDER BY a,b,c;
-
-connection master;
-# Test for erroneous constructions
---error ER_DUP_ENTRY_WITH_KEY_NAME
-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 1098;
-
-# Test that INSERT-SELECT works the same way as for SBR.
-CREATE TABLE t7 (a INT, b INT UNIQUE);
---error ER_DUP_ENTRY_WITH_KEY_NAME
-INSERT INTO t7 SELECT a,b FROM tt3;
-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 1098;
-sync_slave_with_master;
-SELECT * FROM t7 ORDER BY a,b;
-
-connection master;
-CREATE TEMPORARY TABLE tt4 (a INT, b INT);
-INSERT INTO tt4 VALUES (4,8), (5,10), (6,12);
-BEGIN;
-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 1294;
-SELECT * FROM t7 ORDER BY a,b;
-sync_slave_with_master;
-SELECT * FROM t7 ORDER BY a,b;
-
-connection master;
-CREATE TABLE t8 LIKE t4;
-CREATE TABLE t9 LIKE tt4;
-CREATE TEMPORARY TABLE tt5 LIKE t4;
-CREATE TEMPORARY TABLE tt6 LIKE tt4;
-CREATE TEMPORARY TABLE tt7 SELECT 1;
---echo **** On Master ****
---query_vertical SHOW CREATE TABLE t8
---query_vertical SHOW CREATE TABLE t9
---replace_column 1 # 4 #
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS FROM 1390;
-sync_slave_with_master;
---echo **** On Slave ****
---query_vertical SHOW CREATE TABLE t8
---query_vertical SHOW CREATE TABLE t9
-
-connection master;
-DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
-sync_slave_with_master;
-# Here we reset the value of the default storage engine
-STOP SLAVE;
-SET GLOBAL storage_engine=@storage_engine;
-START SLAVE;
---enable_ps_protocol
-
-# BUG#22864 (Rollback following CREATE ... SELECT discards 'CREATE
-# table' from log):
---echo ================ BUG#22864 ================
-connection slave;
-STOP SLAVE;
-RESET SLAVE;
-connection master;
-RESET MASTER;
-connection slave;
-START SLAVE;
-connection master;
-SET AUTOCOMMIT=0;
-CREATE TABLE t1 (a INT);
-INSERT INTO t1 VALUES (1),(2),(3);
-
-CREATE TABLE t2 ENGINE=INNODB SELECT * FROM t1;
-ROLLBACK;
-
-CREATE TABLE t3 ENGINE=INNODB SELECT * FROM t1;
-INSERT INTO t3 VALUES (4),(5),(6);
-ROLLBACK;
-
-CREATE TABLE t4 ENGINE=INNODB SELECT * FROM t1;
-INSERT INTO t1 VALUES (4),(5),(6);
-ROLLBACK;
-
-SHOW TABLES;
-SELECT TABLE_NAME,ENGINE
- FROM INFORMATION_SCHEMA.TABLES
- WHERE TABLE_NAME LIKE 't_'
-ORDER BY TABLE_NAME;
-SELECT * FROM t1 ORDER BY a;
-SELECT * FROM t2 ORDER BY a;
-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;
-sync_slave_with_master;
-SHOW TABLES;
-SELECT TABLE_NAME,ENGINE
- FROM INFORMATION_SCHEMA.TABLES
- WHERE TABLE_NAME LIKE 't_'
-ORDER BY TABLE_NAME;
-SELECT * FROM t1 ORDER BY a;
-SELECT * FROM t2 ORDER BY a;
-SELECT * FROM t3 ORDER BY a;
-SELECT * FROM t4 ORDER BY a;
-
-connection master;
-DROP TABLE IF EXISTS t1,t2,t3,t4;
-SET AUTOCOMMIT=1;
-sync_slave_with_master;
-
-# Some tests with temporary tables
-connection slave;
-STOP SLAVE;
-RESET SLAVE;
-
-connection master;
-RESET MASTER;
-
-connection slave;
-START SLAVE;
-
-connection master;
-CREATE TABLE t1 (a INT);
-INSERT INTO t1 VALUES (1),(2),(3);
-
-CREATE TABLE t2 (a INT) ENGINE=INNODB;
-
-BEGIN;
-INSERT INTO t2 SELECT a*a FROM t1;
-CREATE TEMPORARY TABLE tt1
-SELECT a+1 AS a
- FROM t1
- WHERE a MOD 2 = 1;
-INSERT INTO t2 SELECT a+2 FROM tt1;
-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;
-sync_slave_with_master;
-SELECT * FROM t2 ORDER BY a;
-
-connection master;
-TRUNCATE TABLE t2;
-
-BEGIN;
-INSERT INTO t2 SELECT a*a FROM t1;
-CREATE TEMPORARY TABLE tt2
-SELECT a+1 AS a
- FROM t1
- WHERE a MOD 2 = 1;
-INSERT INTO t2 SELECT a+2 FROM tt2;
-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 631;
-sync_slave_with_master;
-SELECT * FROM t2 ORDER BY a;
-
-connection master;
-DROP TABLE t1,t2;
-sync_slave_with_master;
diff --git a/mysql-test/t/rpl_row_flsh_tbls.test b/mysql-test/t/rpl_row_flsh_tbls.test
deleted file mode 100644
index a2f9e31fc5d..00000000000
--- a/mysql-test/t/rpl_row_flsh_tbls.test
+++ /dev/null
@@ -1,17 +0,0 @@
-# depends on the binlog output
--- source include/have_binlog_format_row.inc
-
-let $rename_event_pos= 619;
-
-# 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
-# we disable the ps-protocol for this statement.
-
-# Merge tables are not supported in NDB
--- source include/not_ndb_default.inc
-
-
---disable_ps_protocol
--- source extra/rpl_tests/rpl_flsh_tbls.test
---enable_ps_protocol
-
diff --git a/mysql-test/t/rpl_row_func003-slave.opt b/mysql-test/t/rpl_row_func003-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/t/rpl_row_func003-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/t/rpl_row_func003.test b/mysql-test/t/rpl_row_func003.test
deleted file mode 100644
index abfadfe1a1a..00000000000
--- a/mysql-test/t/rpl_row_func003.test
+++ /dev/null
@@ -1,11 +0,0 @@
-###################################
-# Wrapper for rpl_row_func003.test#
-###################################
-########################################################
-# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-# Added to skip if ndb is default #
-########################################################
--- source include/not_ndb_default.inc
--- source include/have_innodb.inc
-let $engine_type=INNODB;
--- source extra/rpl_tests/rpl_row_func003.test
diff --git a/mysql-test/t/rpl_row_inexist_tbl.test b/mysql-test/t/rpl_row_inexist_tbl.test
deleted file mode 100644
index 741cc8b7ba3..00000000000
--- a/mysql-test/t/rpl_row_inexist_tbl.test
+++ /dev/null
@@ -1,35 +0,0 @@
-# Test to see what slave says when master is updating a table it does
-# not have
---source include/have_binlog_format_row.inc
-
-source include/master-slave.inc;
-
-connection master;
-create table t1 (a int not null primary key);
-insert into t1 values (1);
-create table t2 (a int);
-insert into t2 values (1);
-update t1, t2 set t1.a = 0 where t1.a = t2.a;
-
-sync_slave_with_master;
-# t2 should not have been replicated
-# t1 should have been properly updated
-show tables;
-select * from t1;
-drop table t1;
-
-connection master;
-insert into t1 values (1);
-
-connection slave;
-# slave should have stopped because can't find table t1
-wait_for_slave_to_stop;
-# see if we have a good error message:
---replace_result $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 7 # 8 # 9 # 23 # 33 #
---vertical_results
-show slave status;
-
-# cleanup
-connection master;
-drop table t1, t2;
diff --git a/mysql-test/t/rpl_row_log.test b/mysql-test/t/rpl_row_log.test
deleted file mode 100644
index 3253ae9ecba..00000000000
--- a/mysql-test/t/rpl_row_log.test
+++ /dev/null
@@ -1,16 +0,0 @@
-###################################
-# Wrapper for rpl_row_log.test #
-# Added wrapper so that MyISAM & #
-# Innodb and NDB could all use the#
-# Same test. NDB produced a diff #
-# bin-log #
-###################################
-########################################################
-# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-# Added to skip if ndb is default #
-########################################################
--- source include/not_ndb_default.inc
--- source include/have_binlog_format_row.inc
-let $engine_type=MyISAM;
--- source extra/rpl_tests/rpl_log.test
-
diff --git a/mysql-test/t/rpl_row_log_innodb.test b/mysql-test/t/rpl_row_log_innodb.test
deleted file mode 100644
index 5e5182e3519..00000000000
--- a/mysql-test/t/rpl_row_log_innodb.test
+++ /dev/null
@@ -1,13 +0,0 @@
-###################################
-# Wrapper for rpl_row_log.test #
-# Added wrapper so that MyISAM & #
-# Innodb and NDB could all use the#
-# Same test. NDB produced a diff #
-# bin-log #
-###################################
--- source include/not_ndb_default.inc
--- source include/have_binlog_format_row.inc
--- source include/have_innodb.inc
-let $engine_type=InnoDB;
--- source extra/rpl_tests/rpl_log.test
-
diff --git a/mysql-test/t/rpl_row_mysqlbinlog.test b/mysql-test/t/rpl_row_mysqlbinlog.test
deleted file mode 100644
index 1a5dd281ae1..00000000000
--- a/mysql-test/t/rpl_row_mysqlbinlog.test
+++ /dev/null
@@ -1,321 +0,0 @@
-##################################################################
-# Author: JBM #
-# Date: 2006-02-22 #
-# Purpose: To test changes to mysqlbinlog for row based bin logs #
-# We are using .opt file since we need small binlog size #
-##################################################################
-# Include Section
-# Make sure that we have row based bin log
--- source include/have_binlog_format_row.inc
-# Embedded server doesn't support binlogging
--- source include/not_embedded.inc
--- source include/master-slave.inc
-# This test requires the cp932 charset compiled in
--- source include/have_cp932.inc
-
-# Setup Section
-# we need this for getting fixed timestamps inside of this test
-
---disable_query_log
-select "---Setup Section --" as "";
---enable_query_log
-
-set timestamp=1000000000;
-
---disable_warnings
-DROP TABLE IF EXISTS t1,t2,t3;
---enable_warnings
-
-connection master;
-CREATE TABLE t1(word VARCHAR(20));
-CREATE TABLE t2(id INT AUTO_INCREMENT NOT NULL PRIMARY KEY);
-CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT);
-
-
-# Test Section
-# Lets start by putting some data into the tables.
-
---disable_query_log
-INSERT INTO t1 VALUES ("abirvalg");
-LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
-LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
-LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
-LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
-LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
-
-# d1 length 3000
-set @d1 = 'dd1';
-set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
-set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
-set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
-
-let $count=500;
-while ($count)
-{
- INSERT INTO t2 VALUES (NULL);
- eval INSERT INTO t3 VALUES ($count,@d1,'20060222000000','Tested in Texas',$count*2.2);
- dec $count;
-}
---enable_query_log
-
-
---disable_query_log
-select "---Test1 check table load --" as "";
---enable_query_log
-
-# Lets Check the tables on the Master
-SELECT COUNT(*) from t1;
-SELECT COUNT(*) from t2;
-SELECT COUNT(*) from t3;
-SELECT * FROM t1 ORDER BY word LIMIT 5;
-SELECT * FROM t2 ORDER BY id LIMIT 5;
-SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5;
-
-# Should have the same on the slave;
-
-sync_slave_with_master;
-SELECT COUNT(*) from t1;
-SELECT COUNT(*) from t2;
-SELECT COUNT(*) from t3;
-SELECT * FROM t1 ORDER BY word LIMIT 5;
-SELECT * FROM t2 ORDER BY id LIMIT 5;
-SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5;
-
-# Okay time to get busy, back to master
-
-connection master;
-
-# simple query to show more in second binlog
-insert into t1 values ("Alas");
-flush logs;
-
-# delimiters are for easier debugging in future
---disable_query_log
-select "--- Test 1 Dump binlog to file --" as "";
---enable_query_log
-
-#
-# Prepare local temporary file to recreate what we have currently.
-
---exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/master.sql
-
---exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000002 >> $MYSQLTEST_VARDIR/tmp/master.sql
-
-# Now that we have our file, lets get rid of the current database.
-# Cleanup the master and the slave and try to recreate.
---disable_query_log
-select "--- Test 1 delete tables, clean master and slave --" as "";
---enable_query_log
-
-DROP TABLE t1;
-DROP TABLE t2;
-DROP TABLE t3;
-
-sync_slave_with_master;
-#we expect STOP SLAVE to produce a warning as the slave is stopped
-#(the server was started with skip-slave-start)
---disable_warnings
-stop slave;
---enable_warnings
---require r/slave-stopped.result
-show status like 'Slave_running';
-connection master;
-reset master;
-connection slave;
-reset slave;
-start slave;
---require r/slave-running.result
-show status like 'Slave_running';
-connection master;
-
-# We should be clean at this point, now we will run in the file from above.
---disable_query_log
-select "--- Test 1 Load from Dump binlog file --" as "";
---enable_query_log
-
---exec $MYSQL -e "source $MYSQLTEST_VARDIR/tmp/master.sql"
-
---disable_query_log
-select "--- Test 1 Check Load Results --" as "";
---enable_query_log
-
-# Lets Check the tables on the Master
-SELECT COUNT(*) from t1;
-SELECT COUNT(*) from t2;
-SELECT COUNT(*) from t3;
-SELECT * FROM t1 ORDER BY word LIMIT 5;
-SELECT * FROM t2 ORDER BY id LIMIT 5;
-SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5;
-
-# Should have the same on the slave;
-
-sync_slave_with_master;
-SELECT COUNT(*) from t1;
-SELECT COUNT(*) from t2;
-SELECT COUNT(*) from t3;
-SELECT * FROM t1 ORDER BY word LIMIT 5;
-SELECT * FROM t2 ORDER BY id LIMIT 5;
-SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5;
-connection master;
-
-# We should be gold by the time, so I will get rid of our file.
-
---exec rm $MYSQLTEST_VARDIR/tmp/master.sql
-
-
-# this test for position option
-# By setting this position to 413, we should only get the create of t3
---disable_query_log
-select "--- Test 2 position test --" as "";
---enable_query_log
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=416 $MYSQLTEST_VARDIR/log/master-bin.000001
-
-# These are tests for remote binlog.
-# They should return the same as previous test.
-
---disable_query_log
-select "--- Test 3 First Remote test --" as "";
---enable_query_log
-
-# This is broken now
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --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
-################### Start Bug 17654 ######################
-#--disable_query_log
-#select "--- Test 4 Second Remote test --" as "";
-#--enable_query_log
-#--exec $MYSQL_BINLOG --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 > $MYSQLTEST_VARDIR/tmp/remote.sql
-
-#--exec $MYSQL_BINLOG --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002 >> $MYSQLTEST_VARDIR/tmp/remote.sql
-
-# Now that we have our file, lets get rid of the current database.
-# Cleanup the master and the slave and try to recreate.
-
-#DROP TABLE t1;
-#DROP TABLE t2;
-#DROP TABLE t3;
-
-#sync_slave_with_master;
-
-#we expect STOP SLAVE to produce a warning as the slave is stopped
-#(the server was started with skip-slave-start)
-
-#--disable_warnings
-#stop slave;
-#--enable_warnings
-#--require r/slave-stopped.result
-#show status like 'Slave_running';
-#connection master;
-#reset master;
-#connection slave;
-#reset slave;
-#start slave;
-#--require r/slave-running.result
-#show status like 'Slave_running';
-#connection master;
-
-# We should be clean at this point, now we will run in the file from above.
-
-#--exec $MYSQL -e "source $MYSQLTEST_VARDIR/tmp/remote.sql"
-
-# Lets Check the tables on the Master
-
-#SELECT COUNT(*) from t1;
-#SELECT COUNT(*) from t2;
-#SELECT COUNT(*) from t3;
-#SELECT * FROM t1 ORDER BY word LIMIT 5;
-#SELECT * FROM t2 ORDER BY id LIMIT 5;
-#SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5;
-
-# Should have the same on the slave;
-
-#sync_slave_with_master;
-#SELECT COUNT(*) from t1;
-#SELECT COUNT(*) from t2;
-#SELECT COUNT(*) from t3;
-#SELECT * FROM t1 ORDER BY word LIMIT 5;
-#SELECT * FROM t2 ORDER BY id LIMIT 5;
-#SELECT c1, c3, c4, c5 FROM t3 ORDER BY c1 LIMIT 5;
-#connection master;
-
-# We should be gold by the time, so I will get rid of our file.
-
-#--exec rm $MYSQLTEST_VARDIR/tmp/remote.sql
-################### End Bug 17654 ######################
-
-# LOAD DATA
---disable_query_log
-select "--- Test 5 LOAD DATA --" as "";
---enable_query_log
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --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
-select "--- Test 6 reading stdin --" as "";
---enable_query_log
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---exec $MYSQL_BINLOG --short-form - < $MYSQLTEST_VARDIR/log/master-bin.000001
-
---disable_query_log
-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 - < $MYSQLTEST_VARDIR/log/master-bin.000001
-
-# Bug#16217 (mysql client did not know how not switch its internal charset)
---disable_query_log
-select "--- Test 8 switch internal charset --" as "";
---enable_query_log
-sync_slave_with_master;
-
-#we expect STOP SLAVE to produce a warning as the slave is stopped
-#(the server was started with skip-slave-start)
-
---disable_warnings
-stop slave;
---enable_warnings
---require r/slave-stopped.result
-show status like 'Slave_running';
-connection master;
-reset master;
-connection slave;
-reset slave;
-start slave;
---require r/slave-running.result
-show status like 'Slave_running';
-connection master;
-
-create table t4 (f text character set utf8);
-create table t5 (f text character set cp932);
---exec $MYSQL --default-character-set=utf8 test -e "insert into t4 values(_utf8'ソ')"
---exec $MYSQL --default-character-set=cp932 test -e "insert into t5 values(_cp932'ƒ\');"
-flush logs;
-rename table t4 to t04, t5 to t05;
---exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000001 | $MYSQL --default-character-set=utf8
-# original and recovered data must be equal
-select HEX(f) from t04;
-select HEX(f) from t4;
-select HEX(f) from t05;
-select HEX(f) from t5;
-
-# slave should have same
-sync_slave_with_master;
-select HEX(f) from t04;
-select HEX(f) from t4;
-select HEX(f) from t05;
-select HEX(f) from t5;
-
---disable_query_log
-select "--- Test cleanup --" as "";
---enable_query_log
-# clean up
-connection master;
-DROP TABLE IF EXISTS t1, t2, t3, t04, t05, t4, t5;
-sync_slave_with_master;
-
-# End of 4.1 tests
diff --git a/mysql-test/t/rpl_row_sp003-master.opt b/mysql-test/t/rpl_row_sp003-master.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/t/rpl_row_sp003-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/t/rpl_row_sp003-slave.opt b/mysql-test/t/rpl_row_sp003-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/t/rpl_row_sp003-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/t/rpl_row_sp003.test b/mysql-test/t/rpl_row_sp003.test
deleted file mode 100644
index 99b30253c8a..00000000000
--- a/mysql-test/t/rpl_row_sp003.test
+++ /dev/null
@@ -1,11 +0,0 @@
-#################################
-# Wrapper for rpl_row_sp003.test#
-#################################
-########################################################
-# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-# Added to skip if ndb is default #
-########################################################
--- source include/not_ndb_default.inc
--- source include/have_innodb.inc
-let $engine_type=INNODB;
--- source extra/rpl_tests/rpl_row_sp003.test
diff --git a/mysql-test/t/rpl_row_sp006_InnoDB.test b/mysql-test/t/rpl_row_sp006_InnoDB.test
deleted file mode 100644
index f7e59440027..00000000000
--- a/mysql-test/t/rpl_row_sp006_InnoDB.test
+++ /dev/null
@@ -1,11 +0,0 @@
-#################################
-# Wrapper for rpl_row_sp006.test#
-#################################
-########################################################
-# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-# Added to skip if ndb is default #
-########################################################
--- source include/not_ndb_default.inc
--- source include/have_innodb.inc
-let $engine_type=InnoDB;
--- source extra/rpl_tests/rpl_row_sp006.test
diff --git a/mysql-test/t/rpl_row_until.test b/mysql-test/t/rpl_row_until.test
deleted file mode 100644
index f2a4229cdc4..00000000000
--- a/mysql-test/t/rpl_row_until.test
+++ /dev/null
@@ -1,87 +0,0 @@
--- source include/not_ndb_default.inc
--- source include/have_binlog_format_row.inc
--- source include/master-slave.inc
-
-# Test is dependent on binlog positions
-
-# prepare version for substitutions
-let $VERSION=`select version()`;
-
-# stop slave before he will start replication also sync with master
-# for avoiding undetermenistic behaviour
-save_master_pos;
-connection slave;
-sync_with_master;
-stop slave;
-
-connection master;
-# create some events on master
-create table t1(n int not null auto_increment primary key);
-insert into t1 values (1),(2),(3),(4);
-drop table t1;
-create table t2(n int not null auto_increment primary key);
-insert into t2 values (1),(2);
-insert into t2 values (3),(4);
-drop table t2;
-
-# try to replicate all queries until drop of t1
-connection slave;
-start slave until master_log_file='master-bin.000001', master_log_pos=311;
-sleep 2;
-wait_for_slave_to_stop;
-# here table should be still not deleted
-select * from t1;
---replace_result $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 9 # 11 # 23 # 33 #
-show slave status;
-
-# this should fail right after start
-start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
-# again this table should be still not deleted
-select * from t1;
-sleep 2;
-wait_for_slave_to_stop;
---replace_result $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 9 # 11 # 23 # 33 #
-show slave status;
-
-# try replicate all up to and not including the second insert to t2;
-start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=728;
-sleep 2;
-wait_for_slave_to_stop;
-select * from t2;
---replace_result $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 9 # 11 # 23 # 33 #
-show slave status;
-
-# clean up
-start slave;
-connection master;
-save_master_pos;
-connection slave;
-sync_with_master;
-stop slave;
-
-# this should stop immediately as we are already there
-start slave until master_log_file='master-bin.000001', master_log_pos=740;
-sleep 2;
-wait_for_slave_to_stop;
-# here the sql slave thread should be stopped
---replace_result $MASTER_MYPORT MASTER_MYPORT bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004
---replace_column 1 # 9 # 23 # 33 #
-show slave status;
-
-#testing various error conditions
---error 1277
-start slave until master_log_file='master-bin', master_log_pos=561;
---error 1277
-start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
---error 1277
-start slave until master_log_file='master-bin.000001';
---error 1277
-start slave until relay_log_file='slave-relay-bin.000002';
---error 1277
-start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
-# Warning should be given for second command
-start slave sql_thread;
-start slave until master_log_file='master-bin.000001', master_log_pos=740;
diff --git a/mysql-test/t/rpl_server_id1.test b/mysql-test/t/rpl_server_id1.test
deleted file mode 100644
index 71310750b60..00000000000
--- a/mysql-test/t/rpl_server_id1.test
+++ /dev/null
@@ -1,26 +0,0 @@
-# This test checks that the slave I/O thread refuses to start if slave
-# and master have the same server id (because this is a useless setup,
-# and otherwise SHOW SLAVE STATUS shows progress but all queries are
-# ignored, which has caught our customers), unless
-# --replicate-same-server-id.
-
-source include/master-slave.inc;
-connection slave;
-create table t1 (n int);
-reset master;
-# replicate ourselves
-stop slave;
---replace_result $SLAVE_MYPORT SLAVE_PORT
-eval change master to master_port=$SLAVE_MYPORT;
---replace_result $SLAVE_MYPORT SLAVE_PORT
---replace_column 16 # 18 #
-show slave status;
-start slave;
-insert into t1 values (1);
-# can't MASTER_POS_WAIT(), it does not work in this weird setup
-# (when slave is its own master without --replicate-same-server-id)
-sleep 2; # enough time for the event to be replicated (it should not)
-show status like "slave_running";
-drop table t1;
-
-# End of 4.1 tests
diff --git a/mysql-test/t/rpl_server_id2.test b/mysql-test/t/rpl_server_id2.test
deleted file mode 100644
index 0f2eb560d18..00000000000
--- a/mysql-test/t/rpl_server_id2.test
+++ /dev/null
@@ -1,26 +0,0 @@
-# This test checks that a slave DOES execute queries originating
-# from itself, if running with --replicate-same-server-id.
-
-source include/master-slave.inc;
-connection slave;
-create table t1 (n int);
-reset master;
-# replicate ourselves
-stop slave;
---replace_result $SLAVE_MYPORT SLAVE_PORT
-eval change master to master_port=$SLAVE_MYPORT;
---replace_result $SLAVE_MYPORT SLAVE_PORT
---replace_column 18 #
-show slave status;
-start slave;
-insert into t1 values (1);
-save_master_pos;
-sync_with_master;
-select * from t1; # check that indeed 2 were inserted
-# We stop the slave before cleaning up otherwise we'll get
-# 'drop table t1' executed twice, so an error in the slave.err
-# (not critical).
-stop slave;
-drop table t1;
-
-# End of 4.1 tests
diff --git a/mysql-test/t/rpl_session_var.test b/mysql-test/t/rpl_session_var.test
deleted file mode 100644
index a6f4b496a23..00000000000
--- a/mysql-test/t/rpl_session_var.test
+++ /dev/null
@@ -1,42 +0,0 @@
-# Replication of session variables.
-# FOREIGN_KEY_CHECKS is tested in rpl_insert_id.test
-
-source include/master-slave.inc;
-drop table if exists t1;
-create table t1(a varchar(100),b int);
-set @@session.sql_mode=pipes_as_concat;
-insert into t1 values('My'||'SQL', 1);
-set @@session.sql_mode=default;
-insert into t1 values('1'||'2', 2);
-select * from t1 where b<3 order by a;
-save_master_pos;
-connection slave;
-sync_with_master;
-select * from t1 where b<3 order by a;
-connection master;
-# if the slave does the next sync_with_master fine, then it means it accepts the
-# two lines of ANSI syntax below, which is what we want to check.
-set @@session.sql_mode=ignore_space;
-insert into t1 values(password ('MySQL'), 3);
-set @@session.sql_mode=ansi_quotes;
-create table "t2" ("a" int);
-drop table t1, t2;
-set @@session.sql_mode=default;
-create table t1(a int auto_increment primary key);
-create table t2(b int, a int);
-set @@session.sql_auto_is_null=1;
-insert into t1 values(null);
-insert into t2 select 1,a from t1 where a is null;
-set @@session.sql_auto_is_null=0;
-insert into t1 values(null);
-insert into t2 select 2,a from t1 where a is null;
-select * from t2 order by b;
-save_master_pos;
-connection slave;
-sync_with_master;
-select * from t2 order by b;
-connection master;
-drop table t1,t2;
-save_master_pos;
-connection slave;
-sync_with_master;
diff --git a/mysql-test/t/rpl_sf.test b/mysql-test/t/rpl_sf.test
deleted file mode 100644
index 2b1e0350f1b..00000000000
--- a/mysql-test/t/rpl_sf.test
+++ /dev/null
@@ -1,68 +0,0 @@
-# Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
-
-# save status
-
-let $oblf=`select @@SESSION.BINLOG_FORMAT`;
-let $otfc=`select @@log_bin_trust_function_creators`;
-
-set global log_bin_trust_function_creators=0;
-
-
-
-# fail *on definition*
-
-set binlog_format=STATEMENT;
-
-delimiter |;
---error ER_BINLOG_UNSAFE_ROUTINE
-create function fn16456()
- returns int
-begin
- return unix_timestamp();
-end|
-delimiter ;|
-
-
-
-# force in definition, so we can see whether we fail on call
-
-set global log_bin_trust_function_creators=1;
-
-delimiter |;
-create function fn16456()
- returns int
-begin
- return unix_timestamp();
-end|
-delimiter ;|
-
-set global log_bin_trust_function_creators=0;
-
-
-
-# allow funcall in RBR
-
-set binlog_format=ROW;
-
---replace_column 1 timestamp
-select fn16456();
-
-
-
-# fail funcall in SBR
-
-set binlog_format=STATEMENT;
-
---error ER_BINLOG_ROW_RBR_TO_SBR
-select fn16456();
-
-
-
-# restore status
-
-drop function fn16456;
-
---disable_query_log
-eval set binlog_format=$oblf;
-eval set global log_bin_trust_function_creators=$otfc;
---enable_query_log
diff --git a/mysql-test/t/rpl_skip_error-slave.opt b/mysql-test/t/rpl_skip_error-slave.opt
deleted file mode 100644
index 982362d93a5..00000000000
--- a/mysql-test/t/rpl_skip_error-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---slave-skip-error=1053,1582
diff --git a/mysql-test/t/rpl_skip_error.test b/mysql-test/t/rpl_skip_error.test
deleted file mode 100644
index ff81e2f010e..00000000000
--- a/mysql-test/t/rpl_skip_error.test
+++ /dev/null
@@ -1,29 +0,0 @@
-##########################################
-# 2006-02-07 By JBM: Added order by
-#########################################
-# Note that errors are ignored by opt file.
-source include/master-slave.inc;
-
-create table t1 (n int not null primary key);
-save_master_pos;
-connection slave;
-sync_with_master;
-insert into t1 values (1);
-connection master;
-# Here we expect (ignored) error, since 1 is already in slave table
-insert into t1 values (1);
-
-# These should work fine
-insert into t1 values (2),(3);
-
-save_master_pos;
-connection slave;
-sync_with_master;
-select * from t1 ORDER BY n;
-
-# Cleanup
-connection master;
-drop table t1;
-sync_slave_with_master;
-
-# End of 4.1 tests
diff --git a/mysql-test/t/rpl_slave_status.test b/mysql-test/t/rpl_slave_status.test
deleted file mode 100644
index 32320a50656..00000000000
--- a/mysql-test/t/rpl_slave_status.test
+++ /dev/null
@@ -1,58 +0,0 @@
---source include/master-slave.inc
-
-############################################################################
-# Test case for BUG#10780
-#
-# REQUIREMENT
-# A slave without replication privileges should have Slave_IO_Running = No
-
-# 1. Create new replication user
-connection master;
-grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl';
-
-connection slave;
-stop slave;
-change master to master_user='rpl',master_password='rpl';
-start slave;
-
-# 2. Do replication as new user
-connection master;
---disable_warnings
-drop table if exists t1;
---enable_warnings
-create table t1 (n int);
-insert into t1 values (1);
-save_master_pos;
-connection slave;
-sync_with_master;
-select * from t1;
-
-# 3. Delete new replication user
-connection master;
-delete from mysql.user where user='rpl';
-flush privileges;
-connection slave;
-
-# 4. Restart slave without privileges
-# (slave.err will contain access denied error for this START SLAVE command)
-stop slave;
-start slave;
-
-# 5. Make sure Slave_IO_Running = No
---replace_result $MASTER_MYPORT MASTER_MYPORT
-# Column 1 is replaced, since the output can be either
-# "Connecting to master" or "Waiting for master update"
---replace_column 1 # 7 # 8 # 9 # 22 # 23 #
---vertical_results
-show slave status;
-
-# Cleanup (Note that slave IO thread is not running)
-connection slave;
-drop table t1;
-delete from mysql.user where user='rpl';
-connection master;
-drop table t1;
-
-# end of test case for BUG#10780
-
-# end of 4.1 tests
diff --git a/mysql-test/t/rpl_sp.test b/mysql-test/t/rpl_sp.test
deleted file mode 100644
index 84154e549b8..00000000000
--- a/mysql-test/t/rpl_sp.test
+++ /dev/null
@@ -1,585 +0,0 @@
-# row-based and statement have expected binlog difference in result files
-
-# Test of replication of stored procedures (WL#2146 for MySQL 5.0)
-# Modified by WL#2971.
-
-# Note that in the .opt files we still use the old variable name
-# log-bin-trust-routine-creators so that this test checks that it's
-# still accepted (this test also checks that the new name is
-# accepted). The old name could be removed in 5.1 or 6.0.
-
-source include/have_binlog_format_mixed.inc;
-source include/master-slave.inc;
-
-# we need a db != test, where we don't have automatic grants
---disable_warnings
-drop database if exists mysqltest1;
---enable_warnings
-create database mysqltest1;
-use mysqltest1;
-create table t1 (a varchar(100));
-sync_slave_with_master;
-use mysqltest1;
-
-# ********************** PART 1 : STORED PROCEDURES ***************
-
-# Does the same proc as on master get inserted into mysql.proc ?
-# (same definer, same properties...)
-
-connection master;
-
-delimiter |;
-
-# Stored procedures don't have the limitations that functions have
-# regarding binlogging: it's ok to create a procedure as not
-# deterministic and updating data, while it's not ok to create such a
-# function. We test this.
-
-create procedure foo()
-begin
- declare b int;
- set b = 8;
- insert into t1 values (b);
- insert into t1 values (unix_timestamp());
-end|
-delimiter ;|
-
-# we replace columns having times
-# (even with fixed timestamp displayed time may changed based on TZ)
---replace_result localhost.localdomain localhost 127.0.0.1 localhost
---replace_column 13 # 14 #
-select * from mysql.proc where name='foo' and db='mysqltest1';
-sync_slave_with_master;
-# You will notice in the result that the definer does not match what
-# it is on master, it is a known bug on which Alik is working
---replace_result localhost.localdomain localhost 127.0.0.1 localhost
---replace_column 13 # 14 #
-select * from mysql.proc where name='foo' and db='mysqltest1';
-
-connection master;
-# see if timestamp used in SP on slave is same as on master
-set timestamp=1000000000;
-call foo();
-select * from t1;
-sync_slave_with_master;
-select * from t1;
-
-# Now a SP which is not updating tables
-
-connection master;
-delete from t1;
-create procedure foo2()
- select * from mysqltest1.t1;
-call foo2();
-
-# check that this is allowed (it's not for functions):
-alter procedure foo2 contains sql;
-
-# SP with definer's right
-
-drop table t1;
-create table t1 (a int);
-create table t2 like t1;
-
-create procedure foo3()
- deterministic
- insert into t1 values (15);
-
-# let's create a non-privileged user
-grant CREATE ROUTINE, EXECUTE on mysqltest1.* to "zedjzlcsjhd"@127.0.0.1;
-grant SELECT on mysqltest1.t1 to "zedjzlcsjhd"@127.0.0.1;
-grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1;
-
-# ToDo: BUG#14931: There is a race between the last grant binlogging, and
-# the binlogging in the new connection made below, causing sporadic test
-# failures due to switched statement order in binlog. To fix this we do
-# SELECT 1 in the first connection before starting the second, ensuring
-# that binlogging is done in the expected order.
-# Please remove this SELECT 1 when BUG#14931 is fixed.
-SELECT 1;
-
-connect (con1,127.0.0.1,zedjzlcsjhd,,mysqltest1,$MASTER_MYPORT,);
-connection con1;
-
-# this routine will fail in the second INSERT because of privileges
-delimiter |;
-create procedure foo4()
- deterministic
- begin
- insert into t2 values(3);
- insert into t1 values (5);
- end|
-
-delimiter ;|
-
-# I add ,0 so that it does not print the error in the test output,
-# because this error is hostname-dependent
---error 1142,0
-call foo4(); # invoker has no INSERT grant on table t1 => failure
-
-connection master;
-call foo3(); # success (definer == root)
-show warnings;
-
---error 1142,0
-call foo4(); # definer's rights => failure
-
-# we test replication of ALTER PROCEDURE
-alter procedure foo4 sql security invoker;
-call foo4(); # invoker's rights => success
-show warnings;
-
-# Note that half-failed procedure calls are ok with binlogging;
-# if we compare t2 on master and slave we see they are identical:
-
-select * from t1;
-select * from t2;
-sync_slave_with_master;
-select * from t1;
-select * from t2;
-
-# Let's check another failing-in-the-middle procedure
-connection master;
-delete from t2;
-alter table t2 add unique (a);
-
-drop procedure foo4;
-delimiter |;
-create procedure foo4()
- deterministic
- begin
- insert into t2 values(20),(20);
- end|
-
-delimiter ;|
-
---error ER_DUP_ENTRY_WITH_KEY_NAME
-call foo4();
-show warnings;
-
-select * from t2;
-sync_slave_with_master;
-# check that this failed-in-the-middle replicated right:
-select * from t2;
-
-# Test of DROP PROCEDURE
-
---replace_result localhost.localdomain localhost 127.0.0.1 localhost
---replace_column 13 # 14 #
-select * from mysql.proc where name="foo4" and db='mysqltest1';
-connection master;
-drop procedure foo4;
-select * from mysql.proc where name="foo4" and db='mysqltest1';
-sync_slave_with_master;
-select * from mysql.proc where name="foo4" and db='mysqltest1';
-
-# ********************** PART 2 : FUNCTIONS ***************
-
-connection master;
-drop procedure foo;
-drop procedure foo2;
-drop procedure foo3;
-
-delimiter |;
-# check that needs "deterministic"
---error 1418
-create function fn1(x int)
- returns int
-begin
- insert into t1 values (x);
- return x+2;
-end|
-create function fn1(x int)
- returns int
- deterministic
-begin
- insert into t1 values (x);
- return x+2;
-end|
-
-delimiter ;|
-delete t1,t2 from t1,t2;
-select fn1(20);
-insert into t2 values(fn1(21));
-select * from t1;
-select * from t2;
-sync_slave_with_master;
-select * from t1;
-select * from t2;
-
-connection master;
-delimiter |;
-
-drop function fn1;
-
-create function fn1()
- returns int
- no sql
-begin
- return unix_timestamp();
-end|
-
-delimiter ;|
-# check that needs "deterministic"
---error 1418
-alter function fn1 contains sql;
-
-delete from t1;
-set timestamp=1000000000;
-insert into t1 values(fn1());
-
-connection con1;
-
-delimiter |;
---error 1419 # only full-global-privs user can create a function
-create function fn2()
- returns int
- no sql
-begin
- return unix_timestamp();
-end|
-delimiter ;|
-connection master;
-# test old variable name:
-set global log_bin_trust_routine_creators=1;
-# now use new name:
-set global log_bin_trust_function_creators=0;
-set global log_bin_trust_function_creators=1;
-# slave needs it too otherwise will not execute what master allowed:
-connection slave;
-set global log_bin_trust_function_creators=1;
-
-connection con1;
-
-delimiter |;
-create function fn2()
- returns int
- no sql
-begin
- return unix_timestamp();
-end|
-delimiter ;|
-
-connection master;
-
-# Now a function which is supposed to not update tables
-# as it's "reads sql data", so should not give error even if
-# non-deterministic.
-
-delimiter |;
-create function fn3()
- returns int
- not deterministic
- reads sql data
-begin
- return 0;
-end|
-delimiter ;|
-
-select fn3();
---replace_result localhost.localdomain localhost 127.0.0.1 localhost
---replace_column 13 # 14 #
-select * from mysql.proc where db='mysqltest1';
-select * from t1;
-
-sync_slave_with_master;
-use mysqltest1;
-select * from t1;
---replace_result localhost.localdomain localhost 127.0.0.1 localhost
---replace_column 13 # 14 #
-select * from mysql.proc where db='mysqltest1';
-
-# Let's check a failing-in-the-middle function
-connection master;
-delete from t2;
-alter table t2 add unique (a);
-
-drop function fn1;
-
-delimiter |;
-create function fn1(x int)
- returns int
-begin
- insert into t2 values(x),(x);
- return 10;
-end|
-
-delimiter ;|
-
-do fn1(100);
-
---error ER_DUP_ENTRY_WITH_KEY_NAME
-select fn1(20);
-
-select * from t2;
-sync_slave_with_master;
-
-# check that this failed-in-the-middle replicated right:
-select * from t2;
-
-# ********************** PART 3 : TRIGGERS ***************
-
-connection con1;
-# now fails due to missing trigger grant (err 1142 i/o 1227) due to new
-# check in sql_trigger.cc (v1.44) by anozdrin on 2006/02/01 --azundris
---error ER_TABLEACCESS_DENIED_ERROR
-create trigger trg before insert on t1 for each row set new.a= 10;
-
-connection master;
-delete from t1;
-# TODO: when triggers can contain an update, test that this update
-# does not go into binlog.
-# I'm not setting user vars in the trigger, because replication of user vars
-# would take care of propagating the user var's value to slave, so even if
-# the trigger was not executed on slave it would not be discovered.
-create trigger trg before insert on t1 for each row set new.a= 10;
-insert into t1 values (1);
-select * from t1;
-sync_slave_with_master;
-select * from t1;
-
-connection master;
-delete from t1;
-drop trigger trg;
-insert into t1 values (1);
-select * from t1;
-sync_slave_with_master;
-select * from t1;
-
-
-# ********************** PART 4 : RELATED FIXED BUGS ***************
-
-
-#
-# Test for bug #13969 "Routines which are replicated from master can't be
-# executed on slave".
-#
-connection master;
-create procedure foo()
- not deterministic
- reads sql data
- select * from t1;
-sync_slave_with_master;
-# This should not fail
-call foo();
-connection master;
-drop procedure foo;
-sync_slave_with_master;
-
-
-# Clean up
-connection master;
-drop function fn1;
-drop database mysqltest1;
-drop user "zedjzlcsjhd"@127.0.0.1;
-use test;
-sync_slave_with_master;
-use test;
-
-#
-# Bug#14077 "Failure to replicate a stored function with a cursor":
-# verify that stored routines with cursors work on slave.
-#
-connection master;
---disable_warnings
-drop function if exists f1;
---enable_warnings
-delimiter |;
-create function f1() returns int reads sql data
-begin
- declare var integer;
- declare c cursor for select a from v1;
- open c;
- fetch c into var;
- close c;
- return var;
-end|
-delimiter ;|
-create view v1 as select 1 as a;
-create table t1 (a int);
-insert into t1 (a) values (f1());
-select * from t1;
-drop view v1;
-drop function f1;
-sync_slave_with_master;
-connection slave;
-select * from t1;
-
-#
-# Bug#16621 "INSERTs in Stored Procedures causes data corruption in the Binary
-# Log for 5.0.18"
-#
-
-# Prepare environment.
-
-connection master;
-
---disable_warnings
-DROP PROCEDURE IF EXISTS p1;
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-# Test case.
-
-CREATE TABLE t1(col VARCHAR(10));
-
-CREATE PROCEDURE p1(arg VARCHAR(10))
- INSERT INTO t1 VALUES(arg);
-
-CALL p1('test');
-
-SELECT * FROM t1;
-
-sync_slave_with_master;
-SELECT * FROM t1;
-
-# Cleanup
-connection master;
-DROP PROCEDURE p1;
-
-
-#
-# BUG#20438: CREATE statements for views, stored routines and triggers can be
-# not replicable.
-#
-
---echo
---echo ---> Test for BUG#20438
-
-# Prepare environment.
-
---echo
---echo ---> Preparing environment...
---echo ---> connection: master
---connection master
-
---disable_warnings
-DROP PROCEDURE IF EXISTS p1;
-DROP FUNCTION IF EXISTS f1;
---enable_warnings
-
---echo
---echo ---> Synchronizing slave with master...
-
---save_master_pos
---connection slave
---sync_with_master
-
---echo
---echo ---> connection: master
---connection master
-
-# Test.
-
---echo
---echo ---> Creating procedure...
-
-/*!50003 CREATE PROCEDURE p1() SET @a = 1 */;
-
-/*!50003 CREATE FUNCTION f1() RETURNS INT RETURN 0 */;
-
---echo
---echo ---> Checking on master...
-
-SHOW CREATE PROCEDURE p1;
-SHOW CREATE FUNCTION f1;
-
---echo
---echo ---> Synchronizing slave with master...
-
---save_master_pos
---connection slave
---sync_with_master
-
---echo ---> connection: master
-
---echo
---echo ---> Checking on slave...
-
-SHOW CREATE PROCEDURE p1;
-SHOW CREATE FUNCTION f1;
-
-# Cleanup.
-
---echo
---echo ---> connection: master
---connection master
-
---echo
---echo ---> Cleaning up...
-
-DROP PROCEDURE p1;
-DROP FUNCTION f1;
-
---save_master_pos
---connection slave
---sync_with_master
---connection master
-
-
-# cleanup
-connection master;
-drop table t1;
-sync_slave_with_master;
-
-#
-# Bug22043: MySQL don't add "USE <DATABASE>" before "DROP PROCEDURE IF EXISTS"
-#
-
-connection master;
---disable_warnings
-drop database if exists mysqltest;
-drop database if exists mysqltest2;
---enable_warnings
-create database mysqltest;
-create database mysqltest2;
-use mysqltest2;
-create table t ( t integer );
-create procedure mysqltest.test() begin end;
-insert into t values ( 1 );
---error ER_BAD_DB_ERROR
-create procedure `\\`.test() begin end;
-
-#
-# BUG#19725: Calls to stored function in other database are not
-# replicated correctly in some cases
-#
-
-connection master;
-delimiter |;
-create function f1 () returns int
-begin
- insert into t values (1);
- return 0;
-end|
-delimiter ;|
-sync_slave_with_master;
-# Let us test if we don't forget to binlog the function's database
-connection master;
-use mysqltest;
-set @a:= mysqltest2.f1();
-sync_slave_with_master;
-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;
-
-
-# Restore log_bin_trust_function_creators to its original value.
-# This is a cleanup for all parts above where we tested stored
-# functions and triggers.
-set global log_bin_trust_function_creators=0;
-connection master;
-set global log_bin_trust_function_creators=0;
-
-# Clean up
-drop database mysqltest;
-drop database mysqltest2;
-
---echo End of 5.0 tests
---echo End of 5.1 tests
-
diff --git a/mysql-test/t/rpl_ssl.test b/mysql-test/t/rpl_ssl.test
deleted file mode 100644
index dd03d5533b0..00000000000
--- a/mysql-test/t/rpl_ssl.test
+++ /dev/null
@@ -1,69 +0,0 @@
-source include/have_ssl.inc;
-source include/master-slave.inc;
-
-# create a user for replication that requires ssl encryption
-connection master;
-grant replication slave on *.* to replssl@localhost require ssl;
-create table t1 (t int auto_increment, KEY(t));
-
-sync_slave_with_master;
-
-# Set slave to use SSL for connection to master
-stop slave;
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
-eval change master to
- master_user='replssl',
- master_password='',
- 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';
-start slave;
-
-# Switch to master and insert one record, then sync it to slave
-connection master;
-insert into t1 values(1);
-sync_slave_with_master;
-
-# The record should now be on slave
-select * from t1;
-
-# The slave is synced and waiting/reading from master
-# SHOW SLAVE STATUS will show "Waiting for master to send event"
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
-query_vertical show slave status;
-
-# Stop the slave, as reported in bug#21871 it would hang
-STOP SLAVE;
-
-select * from t1;
-
-# Do the same thing a number of times
-disable_query_log;
-let $i= 100;
-while ($i)
-{
- start slave;
- connection master;
- insert into t1 values (NULL);
- connection slave;
- stop slave;
- dec $i;
-}
-start slave;
-enable_query_log;
-connection master;
-# INSERT one more record to make sure
-# the sync has something to do
-insert into t1 values (NULL);
-sync_slave_with_master;
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
-query_vertical show slave status;
-
-connection master;
-drop user replssl@localhost;
-drop table t1;
-sync_slave_with_master;
-
diff --git a/mysql-test/t/rpl_ssl1.test b/mysql-test/t/rpl_ssl1.test
deleted file mode 100644
index 6ca1484bb17..00000000000
--- a/mysql-test/t/rpl_ssl1.test
+++ /dev/null
@@ -1,97 +0,0 @@
-source include/have_ssl.inc;
-source include/master-slave.inc;
-
-# We don't test all types of ssl auth params here since it's a bit hard
-# until problems with OpenSSL 0.9.7 are unresolved
-
-# creating replication user for whom ssl auth is required
-# preparing playground
-connection master;
-grant replication slave on *.* to replssl@localhost require ssl;
-create table t1 (t int);
-save_master_pos;
-
-#syncing with master
-connection slave;
-sync_with_master;
-
-#trying to use this user without ssl
-stop slave;
-change master to master_user='replssl',master_password='';
-start slave;
-
-#showing that replication don't work
-connection master;
-insert into t1 values (1);
-#reasonable timeout for changes to propagate to slave
-sleep 3;
-connection slave;
-select * from t1;
-
-#showing that replication could work with ssl params
-stop slave;
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
-eval change master to 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';
-start slave;
-
-#avoiding unneeded sleeps
-connection master;
-save_master_pos;
-connection slave;
-sync_with_master;
-
-#checking that replication is ok
-select * from t1;
-
-#checking show slave status
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 #
-query_vertical show slave status;
-
-#checking if replication works without ssl also performing clean up
-stop slave;
-change master to master_user='root',master_password='', master_ssl=0;
-start slave;
-connection master;
-drop user replssl@localhost;
-drop table t1;
-save_master_pos;
-connection slave;
-sync_with_master;
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 #
-query_vertical show slave status;
-
-# End of 4.1 tests
-
-# Start replication with ssl_verify_server_cert turned on
-connection slave;
-stop slave;
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
-eval change master to
- master_host="localhost",
- 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',
- master_ssl_verify_server_cert=1;
-start slave;
-
-connection master;
-create table t1 (t int);
-insert into t1 values (1);
-
-sync_slave_with_master;
-
-echo on slave;
-#checking that replication is ok
-select * from t1;
-
-#checking show slave status
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 #
-query_vertical show slave status;
-
-connection master;
-drop table t1;
-sync_slave_with_master;
diff --git a/mysql-test/t/rpl_stm_000001-slave.opt b/mysql-test/t/rpl_stm_000001-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/t/rpl_stm_000001-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/t/rpl_stm_log.test b/mysql-test/t/rpl_stm_log.test
deleted file mode 100644
index 5a1e0facc83..00000000000
--- a/mysql-test/t/rpl_stm_log.test
+++ /dev/null
@@ -1,8 +0,0 @@
-# Requires statement logging
--- source include/have_binlog_format_mixed_or_statement.inc
-let $engine_type=MyISAM;
--- source extra/rpl_tests/rpl_log.test
-
-
-# End of 4.1 tests
-# Adding comment for force manual merge 5.0 -> wl1012: Delete me
diff --git a/mysql-test/t/rpl_stm_until.test b/mysql-test/t/rpl_stm_until.test
deleted file mode 100644
index f42965c0eb0..00000000000
--- a/mysql-test/t/rpl_stm_until.test
+++ /dev/null
@@ -1,88 +0,0 @@
--- source include/have_binlog_format_mixed_or_statement.inc
--- source include/master-slave.inc
-
-# Test is dependent on binlog positions
-
-# prepare version for substitutions
-let $VERSION=`select version()`;
-
-# stop slave before he will start replication also sync with master
-# for avoiding undetermenistic behaviour
-save_master_pos;
-connection slave;
-sync_with_master;
-stop slave;
-
-connection master;
-# create some events on master
-create table t1(n int not null auto_increment primary key);
-insert into t1 values (1),(2),(3),(4);
-drop table t1;
-create table t2(n int not null auto_increment primary key);
-insert into t2 values (1),(2);
-insert into t2 values (3),(4);
-drop table t2;
-
-# try to replicate all queries until drop of t1
-connection slave;
-start slave until master_log_file='master-bin.000001', master_log_pos=323;
-sleep 2;
-wait_for_slave_to_stop;
-# here table should be still not deleted
-select * from t1;
---replace_result $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 9 # 11 # 23 # 33 #
---query_vertical SHOW SLAVE STATUS
-
-# this should fail right after start
-start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
-# again this table should be still not deleted
-select * from t1;
-sleep 2;
-wait_for_slave_to_stop;
---replace_result $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 9 # 11 # 23 # 33 #
---query_vertical SHOW SLAVE STATUS
-
-# try replicate all up to and not including the second insert to t2;
-start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746;
-sleep 2;
-wait_for_slave_to_stop;
-select * from t2;
---replace_result $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 9 # 11 # 23 # 33 #
---query_vertical SHOW SLAVE STATUS
-
-# clean up
-start slave;
-connection master;
-save_master_pos;
-connection slave;
-sync_with_master;
-stop slave;
-
-# this should stop immediately as we are already there
-start slave until master_log_file='master-bin.000001', master_log_pos=776;
-sleep 2;
-wait_for_slave_to_stop;
-# here the sql slave thread should be stopped
---replace_result $MASTER_MYPORT MASTER_MYPORT bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004
---replace_column 1 # 9 # 23 # 33 #
---query_vertical SHOW SLAVE STATUS
-
-#testing various error conditions
---error 1277
-start slave until master_log_file='master-bin', master_log_pos=561;
---error 1277
-start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
---error 1277
-start slave until master_log_file='master-bin.000001';
---error 1277
-start slave until relay_log_file='slave-relay-bin.000002';
---error 1277
-start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
-# Warning should be given for second command
-start slave sql_thread;
-start slave until master_log_file='master-bin.000001', master_log_pos=776;
-
-# End of 4.1 tests
diff --git a/mysql-test/t/rpl_timezone.test b/mysql-test/t/rpl_timezone.test
deleted file mode 100644
index 4b8c8152c82..00000000000
--- a/mysql-test/t/rpl_timezone.test
+++ /dev/null
@@ -1,142 +0,0 @@
-#######################################
-# Change Author: JBM
-# Change Date: 2006-01-17
-# Change: Added order by
-#######################################
-# Test of replication of time zones.
-######################################
-# There is currently some bug possibly in prepared statements (this
-# test fails with --ps-protocol): sys_var_thd_time_zone::value_ptr()
-# is called only at prepare time, not at execution time. So,
-# thd->time_zone_used is not equal to 1 (it is back to 0, because of
-# reset_thd_for_next_command called at execution time), so the
-# timezone used in CONVERT_TZ is not binlogged. To debug (by Guilhem
-# and possibly Konstantin).
-
---disable_ps_protocol
-
-source include/master-slave.inc;
-
-# Save original timezone
-set @my_time_zone= @@global.time_zone;
-
-# Some preparations
-let $VERSION=`select version()`;
-set timestamp=100000000; # for fixed output of mysqlbinlog
-create table t1 (t timestamp, n int not null auto_increment, PRIMARY KEY(n));
-create table t2 (t char(32), n int not null auto_increment, PRIMARY KEY(n));
-
-connection slave;
-select @@time_zone;
-#set time_zone='UTC';
-#select @@time_zone;
-#
-# Let us check how well replication works when we are saving datetime
-# value in TIMESTAMP field.
-#
-connection master;
-select @@time_zone;
-#set time_zone='UTC';
-#select @@time_zone;
-insert into t1 values ('20050101000000', NULL), ('20050611093902',NULL);
-insert into t1 values ('20040101000000',NULL), ('20040611093902',NULL);
-SELECT * FROM t1 ORDER BY n;
-sync_slave_with_master;
-#set time_zone='UTC';
-SELECT * FROM t1 ORDER BY n;
-
-# Let us check also that setting of time_zone back to default also works
-# well
-connection master;
-delete from t1;
-set time_zone='Europe/Moscow';
-insert into t1 values ('20040101000000',NULL), ('20040611093902',NULL);
-SELECT * FROM t1 ORDER BY n;
-sync_slave_with_master;
-set time_zone='Europe/Moscow';
-SELECT * FROM t1 ORDER BY n;
-connection master;
-# Change Author: JBM
-# Change Date: 2005-12-22
-# Change: Comment out the exec of the binlog so test works for both SBR and RBR
-#--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-#--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001
-
-# Let us check with LOAD DATA INFILE
-# (we do it after mysqlbinlog because the temp files names are not constant)
-connection master;
-delete from t1;
-set time_zone='UTC';
-load data infile '../std_data_ln/rpl_timezone2.dat' into table t1;
-SELECT * FROM t1 ORDER BY n;
-sync_slave_with_master;
-set time_zone='UTC';
-SELECT * FROM t1 ORDER BY n;
-set time_zone='Europe/Moscow';
-
-# Put back values of before the LOAD
-connection master;
-set time_zone='Europe/Moscow';
-delete from t1;
-insert into t1 values ('20040101000000',NULL), ('20040611093902',NULL);
-
-#
-# Now let us check how well we replicate statments reading TIMESTAMP fields
-# (We should see the same data on master and on slave but it should differ
-# from originally inserted)
-#
-set time_zone='MET';
-insert into t2 (select * from t1);
-SELECT * FROM t1 ORDER BY n;
-sync_slave_with_master;
-SELECT * FROM t2 ORDER BY n;
-
-#
-# Now let us check how well we replicate various CURRENT_* functions
-#
-connection master;
-delete from t2;
-set timestamp=1000072000;
-insert into t2 values (current_timestamp,NULL), (current_date,NULL), (current_time,NULL);
-sync_slave_with_master;
-SELECT * FROM t2 ORDER BY n;
-
-#
-# At last let us check replication of FROM_UNIXTIME/UNIX_TIMESTAMP functions.
-#
-connection master;
-delete from t2;
-insert into t2 values (from_unixtime(1000000000),NULL),
- (unix_timestamp('2001-09-09 03:46:40'),NULL);
-SELECT * FROM t2 ORDER BY n;
-sync_slave_with_master;
-# We should get same result on slave as on master
-SELECT * FROM t2 ORDER BY n;
-
-#
-# Let us check that we are allowing to set global time_zone with
-# replication
-#
-connection master;
-set global time_zone='MET';
-
-#
-# Let us see if CONVERT_TZ(@@time_zone) replicates
-#
-delete from t2;
-set time_zone='UTC';
-insert into t2 values(convert_tz('2004-01-01 00:00:00','MET',@@time_zone),NULL);
-insert into t2 values(convert_tz('2005-01-01 00:00:00','MET','Japan'),NULL);
-SELECT * FROM t2 ORDER BY n;
-sync_slave_with_master;
-SELECT * FROM t2 ORDER BY n;
-
-# Clean up
-connection master;
-drop table t1, t2;
-sync_slave_with_master;
-
-
-# Restore original timezone
-connection master;
-set global time_zone= @my_time_zone;
diff --git a/mysql-test/t/rpl_truncate_7ndb.test b/mysql-test/t/rpl_truncate_7ndb.test
deleted file mode 100644
index 1d69eee5dd0..00000000000
--- a/mysql-test/t/rpl_truncate_7ndb.test
+++ /dev/null
@@ -1,71 +0,0 @@
-
---source include/have_ndb.inc
---source include/master-slave.inc
---source include/have_binlog_format_mixed_or_row.inc
-
---disable_query_log
---disable_warnings
-connection slave;
-STOP SLAVE;
-connection master;
-DROP TABLE IF EXISTS t1;
-RESET MASTER;
-connection slave;
-DROP TABLE IF EXISTS t1;
-RESET SLAVE;
-START SLAVE;
---enable_warnings
---enable_query_log
-
---echo **** On Master ****
-connection master;
-CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
-INSERT INTO t1 VALUES (1,1), (2,2);
-SELECT * FROM t1 ORDER BY a,b;
---echo **** On Slave ****
-# This is silly, but NDB doesn't add to the binlog fast enough
---real_sleep 10
-sync_slave_with_master;
-INSERT INTO t1 VALUE (3,3);
-SELECT * FROM t1 ORDER BY a,b;
---echo **** On Master ****
-connection master;
-TRUNCATE TABLE t1;
-SELECT * FROM t1 ORDER BY a,b;
---echo **** On Slave ****
-sync_slave_with_master;
-# Should be empty
-SELECT * FROM t1 ORDER BY a,b;
---echo **** On Master ****
-connection master;
-DROP TABLE t1;
-let SERVER_VERSION=`select version()`;
---replace_regex /\/\* xid=[0-9]+ \*\//\/* xid= *\// /table_id: [0-9]+/table_id: #/
---replace_result $SERVER_VERSION SERVER_VERSION
-SHOW BINLOG EVENTS;
-
---echo **** On Master ****
-connection master;
-CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
-INSERT INTO t1 VALUES (1,1), (2,2);
-SELECT * FROM t1 ORDER BY a,b;
---echo **** On Slave ****
-sync_slave_with_master;
-INSERT INTO t1 VALUE (3,3);
-SELECT * FROM t1 ORDER BY a,b;
---echo **** On Master ****
-connection master;
-DELETE FROM t1;
-SELECT * FROM t1 ORDER BY a,b;
---echo **** On Slave ****
-sync_slave_with_master;
-# Should be empty
-SELECT * FROM t1 ORDER BY a,b;
---echo **** On Master ****
-connection master;
-DROP TABLE t1;
---replace_regex /table_id: [0-9]+/table_id: #/
---replace_result $SERVER_VERSION SERVER_VERSION
-SHOW BINLOG EVENTS;
-
--- source include/master-slave-end.inc
diff --git a/mysql-test/t/rpl_user_variables.test b/mysql-test/t/rpl_user_variables.test
deleted file mode 100644
index 226591bd13f..00000000000
--- a/mysql-test/t/rpl_user_variables.test
+++ /dev/null
@@ -1,354 +0,0 @@
-###################################
-#
-# Test of replicating user variables
-#
-###################################
-
--- source include/master-slave.inc
-# Disable PS as the log positions differs
---disable_ps_protocol
-
-
-# Clean up old slave's binlogs.
-# The slave is started with --log-slave-updates
-# and this test does SHOW BINLOG EVENTS on the slave's
-# binlog. But previous tests can influence the current test's
-# binlog (e.g. a temporary table in the previous test has not
-# been explicitly deleted, or it has but the slave hasn't had
-# enough time to catch it before STOP SLAVE,
-# and at the beginning of the current
-# test the slave immediately writes DROP TEMPORARY TABLE this_old_table).
-# We wait for the slave to have written all he wants to the binlog
-# (otherwise RESET MASTER may come too early).
-save_master_pos;
-connection slave;
-sync_with_master;
-reset master;
-connection master;
-
-create table t1(n char(30));
-set @i1:=12345678901234, @i2:=-12345678901234, @i3:=0, @i4:=-1;
-set @s1:='This is a test', @r1:=12.5, @r2:=-12.5;
-set @n1:=null;
-set @s2:='', @s3:='abc\'def', @s4:= 'abc\\def', @s5:= 'abc''def';
-insert into t1 values (@i1), (@i2), (@i3), (@i4);
-insert into t1 values (@r1), (@r2);
-insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5);
-insert into t1 values (@n1);
-insert into t1 values (@n2); # not explicitely set before
-insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1);
-insert into t1 values (@a+(@b:=@a+1));
-set @q:='abc';
-insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2'));
-set @a:=5;
-insert into t1 values (@a),(@a);
-# To flush the pending event, we add the following statement. RBR can
-# concatenate the result of several statements, which SBR cannot.
-select * from t1 where n = '<nonexistant>';
-connection master1; # see if variable is reset in binlog when thread changes
-insert into t1 values (@a),(@a),(@a*5);
-SELECT * FROM t1 ORDER BY n;
-sync_slave_with_master;
-SELECT * FROM t1 ORDER BY n;
-connection master;
-insert into t1 select * FROM (select @var1 union select @var2) AS t2;
-drop table t1;
---echo End of 4.1 tests.
-
-# BUG#20141
-# The following tests ensure that if user-defined variables are used in SF/Triggers
-# that they are replicated correctly. These tests should be run in both SBR and RBR
-# modes.
-
-# This test uses a procedure that inserts data values based on the value of a
-# user-defined variable. It also has a trigger that inserts data based on the
-# same variable. Successful test runs show that the @var is replicated
-# properly and that the procedure and trigger insert the correct data on the
-# slave.
-#
-# The test of stored procedure was included for completeness. Replication of stored
-# procedures was not directly affected by BUG#20141.
-#
-# This test was constructed for BUG#20141
-
---disable_warnings
-DROP TABLE IF EXISTS t20;
-DROP TABLE IF EXISTS t21;
-DROP PROCEDURE IF EXISTS test.insert;
---enable_warnings
-
-CREATE TABLE t20 (a VARCHAR(20));
-CREATE TABLE t21 (a VARCHAR(20));
-DELIMITER |;
-
-# Create a procedure that uses the @var for flow control
-
-CREATE PROCEDURE test.insert()
-BEGIN
- IF (@VAR)
- THEN
- INSERT INTO test.t20 VALUES ('SP_TRUE');
- ELSE
- INSERT INTO test.t20 VALUES ('SP_FALSE');
- END IF;
-END|
-
-# Create a trigger that uses the @var for flow control
-
-CREATE TRIGGER test.insert_bi BEFORE INSERT
- ON test.t20 FOR EACH ROW
- BEGIN
- IF (@VAR)
- THEN
- INSERT INTO test.t21 VALUES ('TRIG_TRUE');
- ELSE
- INSERT INTO test.t21 VALUES ('TRIG_FALSE');
- END IF;
- END|
-DELIMITER ;|
-
-sync_slave_with_master;
-connection master;
-
-# Set @var and call the procedure, repeat with different values
-
-SET @VAR=0;
-CALL test.insert();
-SET @VAR=1;
-CALL test.insert();
-
---echo On master: Check the tables for correct data
-
-SELECT * FROM t20;
-SELECT * FROM t21;
-
-sync_slave_with_master;
-
---echo On slave: Check the tables for correct data and it matches master
-
-SELECT * FROM t20;
-SELECT * FROM t21;
-connection master;
-
-# Cleanup
-
-DROP TABLE t20;
-DROP TABLE t21;
-DROP PROCEDURE test.insert;
-
-# This test uses a stored function that uses user-defined variables to return data
-# This test was constructed for BUG#20141
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
-DROP FUNCTION IF EXISTS test.square;
---enable_warnings
-
-CREATE TABLE t1 (i INT);
-
-# Create function that returns a value from @var. In this case, the square function
-
-CREATE FUNCTION test.square() RETURNS INTEGER DETERMINISTIC RETURN
-(@var * @var);
-
-# Set the @var to different values and insert them into a table
-
-SET @var = 1;
-INSERT INTO t1 VALUES (square());
-SET @var = 2;
-INSERT INTO t1 VALUES (square());
-SET @var = 3;
-INSERT INTO t1 VALUES (square());
-SET @var = 4;
-INSERT INTO t1 VALUES (square());
-SET @var = 5;
-INSERT INTO t1 VALUES (square());
-
---echo On master: Retrieve the values from the table
-
-SELECT * FROM t1;
-
-sync_slave_with_master;
-
---echo On slave: Retrieve the values from the table and verify they are the same as on master
-
-SELECT * FROM t1;
-
-connection master;
-
-# Cleanup
-
-DROP TABLE t1;
-DROP FUNCTION test.square;
-
-# This test uses stored functions that uses user-defined variables to return data
-# based on the use of @vars inside a function body.
-# This test was constructed for BUG#14914
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
-DROP FUNCTION IF EXISTS f1;
-DROP FUNCTION IF EXISTS f2;
---enable_warnings
-
-CREATE TABLE t1(a int);
-DELIMITER |;
-
-# Create a function that simply returns the value of an @var.
-# Create a function that uses an @var for flow control, creates and uses another
-# @var and sets its value to a value based on another @var.
-
-CREATE FUNCTION f1() returns int deterministic BEGIN
- return @a;
-END |
-
-CREATE FUNCTION f2() returns int deterministic BEGIN
- IF (@b > 0) then
- SET @c = (@a + @b);
- else
- SET @c = (@a - 1);
- END if;
- return @c;
-END |
-DELIMITER ;|
-
-sync_slave_with_master;
-connection master;
-
-# Set an @var to a value and insert data into a table using the first function.
-# Set two more @vars to some values and insert data into a table using the second function.
-
-SET @a=500;
-INSERT INTO t1 values(f1());
-SET @b = 125;
-SET @c = 1;
-INSERT INTO t1 values(f2());
-
---echo On master: Retrieve the values from the table
-
-sync_slave_with_master;
-connection master;
-
-SELECT * from t1;
-
-connection slave;
-
---echo On slave: Check the tables for correct data and it matches master
-
-SELECT * from t1;
-
-connection master;
-
-# Cleanup
-
-DROP TABLE t1;
-DROP FUNCTION f1;
-DROP FUNCTION f2;
-
-# This test uses a function that changes a user-defined variable in its body. This test
-# will ensure the @vars are replicated when needed and not interrupt the normal execution
-# of the function on the slave. This also applies to procedures and triggers.
-
-# This test was constructed for BUG#25167
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t2;
---enable_warnings
-CREATE TABLE t1 (i int);
-CREATE TABLE t2 (k int);
-DELIMITER |;
-
-# Create a trigger that inserts data into another table, changes the @var then inserts
-# another row with the modified value.
-
-CREATE trigger t1_bi before INSERT on t1 for each row BEGIN
- INSERT INTO t2 values (@a);
- SET @a:=42;
- INSERT INTO t2 values (@a);
-END |
-DELIMITER ;|
-
-sync_slave_with_master;
-connection master;
-
-# Set the @var to a value then insert data into first table.
-
-SET @a:=100;
-INSERT INTO t1 values (5);
-
---echo On master: Check to see that data was inserted correctly in both tables
-
-SELECT * from t1;
-SELECT * from t2;
-
-sync_slave_with_master;
-
---echo On slave: Check the tables for correct data and it matches master
-
-SELECT * from t1;
-SELECT * from t2;
-
-connection master;
-
---echo End of 5.0 tests.
-
-# Cleanup
-
-DROP TABLE t1;
-DROP TABLE t2;
-
-# This test uses a stored function that uses user-defined variables to return data
-# The test ensures the value of the user-defined variable is replicated correctly
-# and in the correct order of assignment.
-
-# This test was constructed for BUG#20141
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
-DROP FUNCTION IF EXISTS f1;
-DROP FUNCTION IF EXISTS f2;
---enable_warnings
-
-CREATE TABLE t1 (i INT);
-
-# Create two functions. One simply returns the user-defined variable. The other
-# returns a value based on the user-defined variable.
-
-CREATE FUNCTION f1() RETURNS INT RETURN @a; DELIMITER |; CREATE
-FUNCTION f2() RETURNS INT BEGIN
- INSERT INTO t1 VALUES (10 + @a);
- RETURN 0;
-END|
-DELIMITER ;|
-
-sync_slave_with_master;
-connection master;
-
-# Set the variable and execute the functions.
-
-SET @a:=123;
-SELECT f1(), f2();
-
---echo On master: Check to see that data was inserted correctly
-
-INSERT INTO t1 VALUES(f1());
-SELECT * FROM t1;
-
-sync_slave_with_master;
-
---echo On slave: Check the table for correct data and it matches master
-
-SELECT * FROM t1;
-
-connection master;
-
-# Cleanup
-
-DROP FUNCTION f1;
-DROP FUNCTION f2;
-DROP TABLE t1;
-
-sync_slave_with_master;
-stop slave;
-
diff --git a/mysql-test/t/rpl_view.test b/mysql-test/t/rpl_view.test
deleted file mode 100644
index 3eff8f7550a..00000000000
--- a/mysql-test/t/rpl_view.test
+++ /dev/null
@@ -1,155 +0,0 @@
-# NYI - row-based cannot use CREATE ... SELECT
-
-source include/master-slave.inc;
---disable_warnings
-drop table if exists t1,v1;
-drop view if exists t1,v1;
-sync_slave_with_master;
-reset master;
---enable_warnings
-
-#
-# Check that creation drop of view is replicated, also check replication of
-# updating of view
-#
-connection master;
-create table t1 (a int);
-insert into t1 values (1);
-create view v1 as select a from t1;
-insert into v1 values (2);
-select * from v1 order by a;
-sync_slave_with_master;
-# view already have to be on slave
-select * from v1 order by a;
-connection master;
-update v1 set a=3 where a=1;
-select * from v1 order by a;
-sync_slave_with_master;
-select * from v1 order by a;
-connection master;
-delete from v1 where a=2;
-select * from v1 order by a;
-sync_slave_with_master;
-select * from v1 order by a;
-connection master;
-# 'alter view' internally maped to creation, but still check that it works
-alter view v1 as select a as b from t1;
-sync_slave_with_master;
-select * from v1 order by 1;
-connection master;
-drop view v1;
-sync_slave_with_master;
-#error, because view have to be removed from slave
--- error 1146
-select * from v1 order by a;
-connection master;
-drop table t1;
-sync_slave_with_master;
-# Change Author: JBM
-# Change Date: 2005-12-22
-# Change: Commented out binlog events to work with SBR and RBR
-#--replace_column 2 # 5 #
-# show binlog events limit 1,100;
-
-#
-# BUG#20438: CREATE statements for views, stored routines and triggers can be
-# not replicable.
-#
-
---echo
---echo ---> Test for BUG#20438
-
-# Prepare environment.
-
---echo
---echo ---> Preparing environment...
---echo ---> connection: master
---connection master
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
-DROP VIEW IF EXISTS v1;
---enable_warnings
-
---echo
---echo ---> Synchronizing slave with master...
-
---save_master_pos
---connection slave
---sync_with_master
-
---echo
---echo ---> connection: master
---connection master
-
-# Test.
-
---echo
---echo ---> Creating objects...
-
-CREATE TABLE t1(c INT);
-
-/*!50003 CREATE VIEW v1 AS SELECT * FROM t1 */;
-
---echo
---echo ---> Inserting value...
-
-INSERT INTO t1 VALUES(1);
-
---echo
---echo ---> Checking on master...
-
-SELECT * FROM t1;
-
---echo
---echo ---> Synchronizing slave with master...
-
---save_master_pos
---connection slave
---sync_with_master
-
---echo ---> connection: master
-
---echo
---echo ---> Checking on slave...
-
-SELECT * FROM t1;
-
-# Cleanup.
-
---echo
---echo ---> connection: master
---connection master
-
---echo
---echo ---> Cleaning up...
-
-DROP VIEW v1;
-DROP TABLE t1;
-
---save_master_pos
---connection slave
---sync_with_master
---connection master
-
-#
-# BUG#19419: "VIEW: View that the column name is different
-# by master and slave is made".
-#
-connection master;
-create table t1(a int, b int);
-insert into t1 values (1, 1), (1, 2), (1, 3);
-create view v1(a, b) as select a, sum(b) from t1 group by a;
-
-sync_slave_with_master;
-explain v1;
-show create table v1;
-select * from v1;
-
-connection master;
-drop table t1;
-drop view v1;
-
-sync_slave_with_master;
-
---echo End of 5.0 tests
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 1f8a00409e6..76a66cc4783 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -3359,4 +3359,128 @@ EXPLAIN SELECT COUNT(*) FROM t1 f1 INNER JOIN t1 f2
WHERE 1 AND f1.b NOT IN (100,2232,3343,51111);
DROP TABLE t1;
+#
+# Bug #27352: Incorrect result of nested selects instead of error reporting
+#
+
+CREATE TABLE t1 (c1 INT, c2 INT);
+INSERT INTO t1 VALUES (1,11), (2,22), (2,22);
+
+let $n= 31;
+let $q= COUNT(c2);
+while ($n)
+{
+ let $q= (SELECT $q);
+ dec $n;
+}
+--disable_warnings
+eval EXPLAIN SELECT c1 FROM t1 WHERE $q > 0;
+--enable_warnings
+
+let $n= 64;
+let $q= COUNT(c2);
+while ($n)
+{
+ let $q= (SELECT $q);
+ dec $n;
+}
+--error ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT
+eval EXPLAIN SELECT c1 FROM t1 WHERE $q > 0;
+
+DROP TABLE t1;
+
+#
+# Bug #30396: crash for a join with equalities and sargable predicates
+# in disjunctive parts of the WHERE condition
+#
+
+CREATE TABLE t1 (
+ c1 int(11) NOT NULL AUTO_INCREMENT,
+ c2 varchar(1000) DEFAULT NULL,
+ c3 bigint(20) DEFAULT NULL,
+ c4 bigint(20) DEFAULT NULL,
+ PRIMARY KEY (c1)
+);
+
+EXPLAIN EXTENDED
+SELECT join_2.c1
+FROM
+ t1 AS join_0,
+ t1 AS join_1,
+ t1 AS join_2,
+ t1 AS join_3,
+ t1 AS join_4,
+ t1 AS join_5,
+ t1 AS join_6,
+ t1 AS join_7
+WHERE
+ join_0.c1=join_1.c1 AND
+ join_1.c1=join_2.c1 AND
+ join_2.c1=join_3.c1 AND
+ join_3.c1=join_4.c1 AND
+ join_4.c1=join_5.c1 AND
+ join_5.c1=join_6.c1 AND
+ join_6.c1=join_7.c1
+ OR
+ join_0.c2 < '?' AND
+ join_1.c2 < '?' AND
+ join_2.c2 > '?' AND
+ join_2.c2 < '!' AND
+ join_3.c2 > '?' AND
+ join_4.c2 = '?' AND
+ join_5.c2 <> '?' AND
+ join_6.c2 <> '?' AND
+ join_7.c2 >= '?' AND
+ join_0.c1=join_1.c1 AND
+ join_1.c1=join_2.c1 AND
+ join_2.c1=join_3.c1 AND
+ join_3.c1=join_4.c1 AND
+ join_4.c1=join_5.c1 AND
+ join_5.c1=join_6.c1 AND
+ join_6.c1=join_7.c1
+GROUP BY
+ join_3.c1,
+ join_2.c1,
+ join_7.c1,
+ join_1.c1,
+ join_0.c1;
+
+SHOW WARNINGS;
+
+DROP TABLE t1;
+
+#
+# Bug #27695: Misleading warning when declaring all space column names and
+# truncation of one-space column names to zero length names.
+#
+
+--disable_ps_protocol
+
+SELECT 1 AS ` `;
+SELECT 1 AS ` `;
+SELECT 1 AS ` x`;
+
+CREATE VIEW v1 AS SELECT 1 AS ` `;
+SELECT `` FROM v1;
+
+CREATE VIEW v2 AS SELECT 1 AS ` `;
+SELECT `` FROM v2;
+
+CREATE VIEW v3 AS SELECT 1 AS ` x`;
+SELECT `x` FROM v3;
+
+DROP VIEW v1, v2, v3;
+
+--enable_ps_protocol
+
--echo End of 5.0 tests
+
+#
+# Bug #30639: limit offset,rowcount wraps when rowcount >= 2^32 in windows
+#
+create table t1(a INT, KEY (a));
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
+SELECT a FROM t1 ORDER BY a LIMIT 2;
+SELECT a FROM t1 ORDER BY a LIMIT 2,4294967296;
+SELECT a FROM t1 ORDER BY a LIMIT 2,4294967297;
+DROP TABLE t1;
diff --git a/mysql-test/t/show_check-master.opt b/mysql-test/t/show_check-master.opt
index 3eb98fc3d6b..7a438da06cc 100644
--- a/mysql-test/t/show_check-master.opt
+++ b/mysql-test/t/show_check-master.opt
@@ -1 +1 @@
---log-slow-queries --log-long-format --log-queries-not-using-indexes
+--log-slow-queries --log-long-format --log-queries-not-using-indexes --myisam-recover=""
diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
index 60e680c63f3..34e1941c9d7 100644
--- a/mysql-test/t/show_check.test
+++ b/mysql-test/t/show_check.test
@@ -22,6 +22,12 @@ flush privileges;
create table t1 (a int not null primary key, b int not null,c int not null, key(b,c));
insert into t1 values (1,2,2),(2,2,3),(3,2,4),(4,2,4);
+
+--echo -- Here we enable metadata just to check that the collation of the
+--echo -- resultset is non-binary for string type. This should be changed
+--echo -- after Bug#29394 is implemented.
+
+--enable_metadata
check table t1 fast;
check table t1 fast;
check table t1 changed;
@@ -30,28 +36,58 @@ check table t1 changed;
check table t1 medium;
check table t1 extended;
show index from t1;
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--disable_metadata
+--error ER_DUP_ENTRY
insert into t1 values (5,5,5);
+
+--echo -- Here we enable metadata just to check that the collation of the
+--echo -- resultset is non-binary for string type. This should be changed
+--echo -- after Bug#29394 is implemented.
+
+--enable_metadata
optimize table t1;
+--disable_metadata
optimize table t1;
drop table t1;
#show variables;
+
+--echo -- Here we enable metadata just to check that the collation of the
+--echo -- resultset is non-binary for string type. This should be changed
+--echo -- after Bug#29394 is implemented.
+
+--enable_metadata
show variables like "wait_timeout%";
show variables like "WAIT_timeout%";
show variables like "this_doesn't_exists%";
show table status from test like "this_doesn't_exists%";
show databases;
show databases like "test%";
+--disable_metadata
#
# Check of show index
#
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));
insert into t1 values (1,1,1,0),(1,1,2,0),(1,1,3,0),(1,2,1,0),(1,2,2,0),(1,2,3,0),(1,3,1,0),(1,3,2,0),(1,3,3,0),(1,1,1,1),(1,1,2,1),(1,1,3,1),(1,2,1,1),(1,2,2,1),(1,2,3,1),(1,3,1,1),(1,3,2,1),(1,3,3,1);
+
+--echo -- Here we enable metadata just to check that the collation of the
+--echo -- resultset is non-binary for string type. This should be changed
+--echo -- after Bug#29394 is implemented.
+
+--enable_metadata
analyze table t1;
+--disable_metadata
show index from t1;
+
+--echo -- Here we enable metadata just to check that the collation of the
+--echo -- resultset is non-binary for string type. This should be changed
+--echo -- after Bug#29394 is implemented.
+
+--enable_metadata
+
repair table t1;
+--disable_metadata
show index from t1;
drop table t1;
@@ -402,6 +438,11 @@ drop table if exists t1;
CREATE TABLE txt1(a int);
CREATE TABLE tyt2(a int);
CREATE TABLE urkunde(a int);
+
+# make the output deterministic:
+# the order used in SHOW OPEN TABLES
+# is too much implementation dependent
+--disable_ps_protocol
FLUSH TABLES;
SELECT 1 FROM mysql.db, mysql.proc, mysql.user, mysql.time_zone, mysql.time_zone_name, txt1, tyt2, urkunde LIMIT 0;
SHOW OPEN TABLES;
@@ -411,6 +452,8 @@ SHOW OPEN TABLES LIKE 't%';
SHOW OPEN TABLES LIKE '%o%';
FLUSH TABLES;
SHOW OPEN TABLES;
+--enable_ps_protocol
+
DROP TABLE txt1;
DROP TABLE tyt2;
DROP TABLE urkunde;
@@ -514,7 +557,358 @@ show status like 'slow_queries';
select 1 from information_schema.tables limit 1;
show status like 'slow_queries';
---echo End of 5.0 tests.
+create table t1 (a int);
+create trigger tr1 before insert on t1 for each row
+begin
+end;
+create view v1 as select a from t1;
+create procedure p1()
+begin
+end;
+create function f1()
+returns int
+return 0;
+create event e1 on schedule every 1 year starts now()
+ ends date_add(now(), interval 5 hour) do
+begin
+end;
+
+--disable_result_log
+flush status;
+show databases;
+show tables;
+show events;
+show table status;
+show open tables;
+show plugins;
+show columns in t1;
+show slave hosts;
+show keys in t1;
+show column types;
+show table types;
+show storage engines;
+show authors;
+show contributors;
+show privileges;
+show count(*) warnings;
+show count(*) errors;
+show warnings;
+show status;
+show processlist;
+show variables;
+show charset;
+show collation;
+show grants;
+show create database test;
+show create table t1;
+show create view v1;
+show master status;
+show slave status;
+show create procedure p1;
+show create function f1;
+show create trigger tr1;
+show procedure status;
+show create event e1;
+--enable_result_log
+
+show status like 'slow_queries';
+
+drop view v1;
+drop table t1;
+drop procedure p1;
+drop function f1;
+drop event e1;
+#
+# BUG#10491: Server returns data as charset binary SHOW CREATE TABLE or SELECT
+# FROM I_S.
+#
+
+#
+# Part 1: check that meta-data specifies not-binary character set.
+#
+
+# Ensure that all needed objects are dropped.
+
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest1;
+DROP TABLE IF EXISTS t1;
+DROP VIEW IF EXISTS v1;
+DROP PROCEDURE IF EXISTS p1;
+DROP FUNCTION IF EXISTS f1;
+--enable_warnings
+
+# Create objects.
+
+CREATE DATABASE mysqltest1;
+
+CREATE TABLE t1(c INT NOT NULL PRIMARY KEY);
+
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1;
+
+CREATE VIEW v1 AS SELECT 1;
+
+CREATE PROCEDURE p1() SELECT 1;
+
+CREATE FUNCTION f1() RETURNS INT RETURN 1;
+
+
+# Test.
+
+set names utf8;
+
+--echo -- Here we enable metadata just to check that the collation of the
+--echo -- resultset is non-binary for string type. This should be changed
+--echo -- after Bug#29394 is implemented.
+
+--enable_metadata
+
+--echo ----------------------------------------------------------------
+
+SHOW CHARACTER SET LIKE 'utf8';
+
+--echo ----------------------------------------------------------------
+
+SHOW COLLATION LIKE 'latin1_bin';
+
+--echo ----------------------------------------------------------------
+
+SHOW CREATE DATABASE mysqltest1;
+
+--echo ----------------------------------------------------------------
+
+SHOW DATABASES LIKE 'mysqltest1';
+
+--echo ----------------------------------------------------------------
+
+SHOW CREATE TABLE t1;
+
+--echo ----------------------------------------------------------------
+
+SHOW INDEX FROM t1;
+
+--echo ----------------------------------------------------------------
+
+SELECT
+ TABLE_CATALOG,
+ TABLE_SCHEMA,
+ TABLE_NAME,
+ TABLE_TYPE,
+ ENGINE,
+ ROW_FORMAT,
+ TABLE_COLLATION,
+ CREATE_OPTIONS,
+ TABLE_COMMENT
+FROM INFORMATION_SCHEMA.TABLES
+WHERE table_name = 't1';
+
+--echo ----------------------------------------------------------------
+
+SELECT
+ 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
+FROM INFORMATION_SCHEMA.COLUMNS
+WHERE table_name = 't1';
+
+--echo ----------------------------------------------------------------
+
+SHOW TABLES LIKE 't1';
+
+--echo ----------------------------------------------------------------
+
+SHOW COLUMNS FROM t1;
+
+--echo ----------------------------------------------------------------
+
+SHOW TRIGGERS LIKE 't1';
+
+--echo ----------------------------------------------------------------
+
+SELECT
+ 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
+FROM INFORMATION_SCHEMA.TRIGGERS
+WHERE trigger_name = 't1_bi';
+
+--echo ----------------------------------------------------------------
+
+SHOW CREATE VIEW v1;
+
+--echo ----------------------------------------------------------------
+
+SELECT *
+FROM INFORMATION_SCHEMA.VIEWS
+WHERE table_name = 'v1';
+
+--echo ----------------------------------------------------------------
+
+SHOW CREATE PROCEDURE p1;
+
+--echo ----------------------------------------------------------------
+
+SELECT
+ 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
+FROM INFORMATION_SCHEMA.ROUTINES
+WHERE routine_name = 'p1';
+
+--echo ----------------------------------------------------------------
+
+SHOW CREATE FUNCTION f1;
+
+--echo ----------------------------------------------------------------
+
+SELECT
+ 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
+FROM INFORMATION_SCHEMA.ROUTINES
+WHERE routine_name = 'f1';
+
+--echo ----------------------------------------------------------------
+
+--disable_metadata
+
+# Cleanup.
+
+DROP DATABASE mysqltest1;
+DROP TABLE t1;
+DROP VIEW v1;
+DROP PROCEDURE p1;
+DROP FUNCTION f1;
+
+#
+# Part 2: check that table with non-latin1 characters are dumped/restored
+# correctly.
+#
+
+# Ensure that all needed objects are dropped.
+
+set names koi8r;
+
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest1;
+--enable_warnings
+
+# Create objects.
+
+CREATE DATABASE mysqltest1;
+
+use mysqltest1;
+
+CREATE TABLE t1(ËÏÌÏÎËÁ1 INT);
+
+# Check:
+# - Dump mysqltest1;
+
+--echo
+--echo ---> Dumping mysqltest1 to show_check.mysqltest1.sql
+
+--exec $MYSQL_DUMP --default-character-set=latin1 --character-sets-dir=$CHARSETSDIR --databases mysqltest1 > $MYSQLTEST_VARDIR/tmp/show_check.mysqltest1.sql
+
+# - Clean mysqltest1;
+
+--echo
+--echo
+
+DROP DATABASE mysqltest1;
+
+# - Restore mysqltest1;
+
+--echo
+--echo
+
+--echo ---> Restoring mysqltest1...
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/show_check.mysqltest1.sql
+
+# - Check definition of the table.
+
+SHOW CREATE TABLE mysqltest1.t1;
+
+# Cleanup.
+
+DROP DATABASE mysqltest1;
+use test;
+
+#
+# Bug #28808: log_queries_not_using_indexes variable dynamic change is ignored
+#
+flush status;
+show variables like "log_queries_not_using_indexes";
+select 1 from information_schema.tables limit 1;
+show status like 'slow_queries';
+set global log_queries_not_using_indexes=OFF;
+show variables like "log_queries_not_using_indexes";
+select 1 from information_schema.tables limit 1;
+show status like 'slow_queries';
+set global log_queries_not_using_indexes=ON;
+show variables like "log_queries_not_using_indexes";
+select 1 from information_schema.tables limit 1;
+show status like 'slow_queries';
+
+#
+# Bug #30088: Can't disable myisam-recover by a value of ""
+#
+show variables like 'myisam_recover_options';
+
+--echo End of 5.0 tests
--disable_result_log
SHOW AUTHORS;
@@ -593,4 +987,133 @@ show full tables;
drop table `été`;
set names latin1;
+#
+# Bug#26402 Server crashes with old-style named table
+#
+--error ER_NO_SUCH_TABLE,ER_FILE_NOT_FOUND
+show columns from `#mysql50#????????`;
+
+#
+# SHOW CREATE TRIGGER test.
+#
+
+# Prepare.
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP PROCEDURE IF EXISTS p1;
+--enable_warnings
+
+CREATE TABLE t1(c1 INT);
+
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1;
+
+# Test.
+
+SHOW CREATE TRIGGER t1_bi;
+
+CREATE PROCEDURE p1() SHOW CREATE TRIGGER t1_bi;
+
+CALL p1();
+CALL p1();
+CALL p1();
+CALL p1();
+CALL p1();
+CALL p1();
+CALL p1();
+CALL p1();
+CALL p1();
+CALL p1();
+
+PREPARE stmt1 FROM 'SHOW CREATE TRIGGER t1_bi';
+
+EXECUTE stmt1;
+EXECUTE stmt1;
+EXECUTE stmt1;
+EXECUTE stmt1;
+EXECUTE stmt1;
+EXECUTE stmt1;
+EXECUTE stmt1;
+EXECUTE stmt1;
+EXECUTE stmt1;
+EXECUTE stmt1;
+
+# Cleanup.
+
+DROP TABLE t1;
+DROP PROCEDURE p1;
+DEALLOCATE PREPARE stmt1;
+
+#
+# BUG#10491: Server returns data as charset binary SHOW CREATE TABLE or SELECT
+# FROM INFORMATION_SCHEMA.
+#
+# Before the change performed to fix the bug, the metadata of the output of
+# SHOW CREATE statements would always describe the result as 'binary'. That
+# would ensure that the result is never converted to character_set_client
+# (which was essential to mysqldump). Now we return to the client the actual
+# character set of the object -- which is character_set_client of the
+# connection that issues the CREATE statement, and this triggers an automatic
+# conversion to character_set_results of the connection that issues SHOW CREATE
+# statement.
+#
+# This test demonstrates that this conversion indeed is taking place.
+#
+
+# Prepare: create objects in a one character set.
+
+set names koi8r;
+
+--disable_warnings
+DROP VIEW IF EXISTS v1;
+DROP PROCEDURE IF EXISTS p1;
+DROP FUNCTION IF EXISTS f1;
+DROP TABLE IF EXISTS t1;
+DROP EVENT IF EXISTS ev1;
+--enable_warnings
+
+CREATE VIEW v1 AS SELECT 'ÔÅÓÔ' AS test;
+
+CREATE PROCEDURE p1() SELECT 'ÔÅÓÔ' AS test;
+
+CREATE FUNCTION f1() RETURNS CHAR(10) RETURN 'ÔÅÓÔ';
+
+CREATE TABLE t1(c1 CHAR(10));
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1
+ FOR EACH ROW
+ SET NEW.c1 = 'ÔÅÓÔ';
+
+CREATE EVENT ev1 ON SCHEDULE AT '2030-01-01 00:00:00' DO SELECT 'ÔÅÓÔ' AS test;
+
+# Test: switch the character set and show that SHOW CREATE output is
+# automatically converted to the new character_set_client.
+
+set names utf8;
+
+SHOW CREATE VIEW v1;
+
+SHOW CREATE PROCEDURE p1;
+
+SHOW CREATE FUNCTION f1;
+
+SHOW CREATE TRIGGER t1_bi;
+
+SHOW CREATE EVENT ev1;
+
+# Cleanup.
+
+DROP VIEW v1;
+DROP PROCEDURE p1;
+DROP FUNCTION f1;
+DROP TABLE t1;
+DROP EVENT ev1;
+
+#
+# Bug #30036: SHOW TABLE TYPES causes the debug client to crash
+#
+--disable_result_log
+SHOW TABLE TYPES;
+--enable_result_log
+
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/sp-code.test b/mysql-test/t/sp-code.test
index 1b33680cfaf..66d5323d2e2 100644
--- a/mysql-test/t/sp-code.test
+++ b/mysql-test/t/sp-code.test
@@ -2,7 +2,7 @@
# Test the debugging feature "show procedure/function code <name>"
#
--- source include/is_debug_build.inc
+-- source include/have_debug.inc
--disable_warnings
drop procedure if exists empty;
@@ -446,6 +446,81 @@ SHOW PROCEDURE CODE p1;
DROP PROCEDURE p1;
+#
+# Bug#26977 exception handlers never hreturn
+#
+--disable_warnings
+drop table if exists t1;
+drop procedure if exists proc_26977_broken;
+drop procedure if exists proc_26977_works;
+--enable_warnings
+
+create table t1(a int unique);
+
+delimiter //;
+
+create procedure proc_26977_broken(v int)
+begin
+ declare i int default 5;
+
+ declare continue handler for sqlexception
+ begin
+ select 'caught something';
+ retry:
+ while i > 0 do
+ begin
+ set i = i - 1;
+ select 'looping', i;
+ end;
+ end while retry;
+ end;
+
+ select 'do something';
+ insert into t1 values (v);
+ select 'do something again';
+ insert into t1 values (v);
+end//
+
+create procedure proc_26977_works(v int)
+begin
+ declare i int default 5;
+
+ declare continue handler for sqlexception
+ begin
+ select 'caught something';
+ retry:
+ while i > 0 do
+ begin
+ set i = i - 1;
+ select 'looping', i;
+ end;
+ end while retry;
+ select 'optimizer: keep hreturn';
+ end;
+
+ select 'do something';
+ insert into t1 values (v);
+ select 'do something again';
+ insert into t1 values (v);
+end//
+delimiter ;//
+
+show procedure code proc_26977_broken;
+
+show procedure code proc_26977_works;
+
+## This caust an error because of jump short cut
+## optimization.
+call proc_26977_broken(1);
+
+## This works
+call proc_26977_works(2);
+
+drop table t1;
+drop procedure proc_26977_broken;
+drop procedure proc_26977_works;
+
+
--echo End of 5.0 tests.
#
diff --git a/mysql-test/t/sp-destruct.test b/mysql-test/t/sp-destruct.test
index df07091d2de..56d99c4435c 100644
--- a/mysql-test/t/sp-destruct.test
+++ b/mysql-test/t/sp-destruct.test
@@ -50,6 +50,7 @@ insert into t1 values (0);
flush table mysql.proc;
# Thrashing the .frm file
+--remove_file $MYSQLTEST_VARDIR/master-data/mysql/proc.frm
--write_file $MYSQLTEST_VARDIR/master-data/mysql/proc.frm
saljdfa
EOF
@@ -94,26 +95,33 @@ insert into mysql.proc
(
db, name, type, specific_name, language, sql_data_access, is_deterministic,
security_type, param_list, returns, body, definer, created, modified,
- sql_mode, comment
+ sql_mode, comment, character_set_client, collation_connection, db_collation,
+ body_utf8
)
values
(
'test', 'bug14233_1', 'FUNCTION', 'bug14233_1', 'SQL', 'READS_SQL_DATA', 'NO',
'DEFINER', '', 'int(10)',
'select count(*) from mysql.user',
- 'root@localhost', NOW() , '0000-00-00 00:00:00', '', ''
+ 'root@localhost', NOW() , '0000-00-00 00:00:00', '', '',
+ '', '', '',
+ 'select count(*) from mysql.user'
),
(
'test', 'bug14233_2', 'FUNCTION', 'bug14233_2', 'SQL', 'READS_SQL_DATA', 'NO',
'DEFINER', '', 'int(10)',
'begin declare x int; select count(*) into x from mysql.user; end',
- 'root@localhost', NOW() , '0000-00-00 00:00:00', '', ''
+ 'root@localhost', NOW() , '0000-00-00 00:00:00', '', '',
+ '', '', '',
+ 'begin declare x int; select count(*) into x from mysql.user; end'
),
(
'test', 'bug14233_3', 'PROCEDURE', 'bug14233_3', 'SQL', 'READS_SQL_DATA','NO',
'DEFINER', '', '',
'alksj wpsj sa ^#!@ ',
- 'root@localhost', NOW() , '0000-00-00 00:00:00', '', ''
+ 'root@localhost', NOW() , '0000-00-00 00:00:00', '', '',
+ '', '', '',
+ 'alksj wpsj sa ^#!@ '
);
--error ER_SP_PROC_TABLE_CORRUPT
diff --git a/mysql-test/t/sp-dynamic.test b/mysql-test/t/sp-dynamic.test
index 6546a5ab548..e6f4aae96ac 100644
--- a/mysql-test/t/sp-dynamic.test
+++ b/mysql-test/t/sp-dynamic.test
@@ -85,7 +85,7 @@ call p1()|
call p1()|
drop procedure p1|
#
-# D. Create/Drop a table (a DDL that issues a commit) in Dynamic SQL.
+# D. Create/Drop/Alter a table (a DDL that issues a commit) in Dynamic SQL.
# (should work ok).
#
create procedure p1()
@@ -96,6 +96,10 @@ begin
execute stmt;
insert into t1 (a) values (1);
select * from t1;
+ prepare stmt_alter from "alter table t1 add (b int)";
+ execute stmt_alter;
+ insert into t1 (a,b) values (2,1);
+ deallocate prepare stmt_alter;
deallocate prepare stmt;
deallocate prepare stmt_drop;
end|
@@ -239,6 +243,7 @@ drop procedure p1|
# K. Use of continue handlers with Dynamic SQL.
#
drop table if exists t1|
+drop table if exists t2|
create table t1 (id integer primary key auto_increment,
stmt_text char(35), status varchar(20))|
insert into t1 (stmt_text) values
@@ -249,7 +254,10 @@ insert into t1 (stmt_text) values
("help help"), ("show databases"), ("show tables"),
("show table status"), ("show open tables"), ("show storage engines"),
("insert into t1 (id) values (1)"), ("update t1 set status=''"),
- ("delete from t1"), ("truncate t1"), ("call p1()"), ("foo bar")|
+ ("delete from t1"), ("truncate t1"), ("call p1()"), ("foo bar"),
+ ("create view v1 as select 1"), ("alter view v1 as select 2"),
+ ("drop view v1"),("create table t2 (a int)"),("alter table t2 add (b int)"),
+ ("drop table t2")|
create procedure p1()
begin
declare v_stmt_text varchar(255);
diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test
index e5de4a570cb..012f2b33225 100644
--- a/mysql-test/t/sp-error.test
+++ b/mysql-test/t/sp-error.test
@@ -586,7 +586,7 @@ begin
end|
set @x = 0|
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
call bug3279(@x)|
select @x|
drop procedure bug3279|
@@ -1087,12 +1087,12 @@ delimiter ;|
#
# BUG 12490 (Packets out of order if calling HELP CONTENTS from Stored Procedure)
#
---error 1314
+--error ER_SP_BADSTATEMENT
CREATE PROCEDURE BUG_12490() HELP CONTENTS;
---error 1314
+--error ER_SP_BADSTATEMENT
CREATE FUNCTION BUG_12490() RETURNS INT HELP CONTENTS;
CREATE TABLE t_bug_12490(a int);
---error 1314
+--error ER_SP_BADSTATEMENT
CREATE TRIGGER BUG_12490 BEFORE UPDATE ON t_bug_12490 FOR EACH ROW HELP CONTENTS;
DROP TABLE t_bug_12490;
@@ -1387,6 +1387,21 @@ CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN create user 'mysqltest
CREATE FUNCTION bug_13627_f() returns int BEGIN create user 'mysqltest_1'; return 1; END |
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
+CREATE TRIGGER bug21975 BEFORE INSERT ON t1 FOR EACH ROW BEGIN grant select on t1 to 'mysqltest_1'; END |
+-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
+CREATE FUNCTION bug21975() returns int BEGIN grant select on t1 to 'mysqltest_1'; return 1; END |
+
+-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
+CREATE TRIGGER bug21975 BEFORE INSERT ON t1 FOR EACH ROW BEGIN revoke select on t1 from 'mysqltest_1'; END |
+-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
+CREATE FUNCTION bug21975() returns int BEGIN revoke select on t1 from 'mysqltest_1'; return 1; END |
+
+-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
+CREATE TRIGGER bug21975 BEFORE INSERT ON t1 FOR EACH ROW BEGIN revoke all privileges on *.* from 'mysqltest_1'; END |
+-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
+CREATE FUNCTION bug21975() returns int BEGIN revoke all privileges on *.* from 'mysqltest_1'; return 1; END |
+
+-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN drop user 'mysqltest_1'; END |
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
CREATE FUNCTION bug_13627_f() returns int BEGIN drop user 'mysqltest_1'; return 1; END |
@@ -1401,9 +1416,9 @@ CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN create view v1 as sele
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
CREATE FUNCTION bug_13627_f() returns int BEGIN create view v1 as select 1; return 1; END |
--- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
+-- error ER_SP_BADSTATEMENT
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN alter view v1 as select 1; END |
--- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
+-- error ER_SP_BADSTATEMENT
CREATE FUNCTION bug_13627_f() returns int BEGIN alter view v1 as select 1; return 1; END |
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
@@ -1458,7 +1473,7 @@ select bug12329();
# Until we implement proper mechanism for invalidation of PS/SP when table
# or SP's are changed the following statement will fail with 'Table ... was
# not locked' error (this mechanism should be based on the new TDC).
---error 1100
+--error ER_NO_SUCH_TABLE
execute stmt1;
deallocate prepare stmt1;
drop function bug12329;
@@ -1643,13 +1658,13 @@ create trigger t1_ai after insert on t1 for each row insert into t2 values (new.
create view v1 as select * from t1;
drop table t2;
# Limitation, the desired error is ER_VIEW_INVALID
---error ER_TABLE_NOT_LOCKED
+--error ER_NO_SUCH_TABLE
insert into v1 values (1);
drop trigger t1_ai;
create function bug11555_1() returns int return (select max(i) from t2);
create trigger t1_ai after insert on t1 for each row set @a:=bug11555_1();
# Limitation, the desired error is ER_VIEW_INVALID
---error ER_TABLE_NOT_LOCKED
+--error ER_NO_SUCH_TABLE
insert into v1 values (2);
drop function bug11555_1;
drop table t1;
diff --git a/mysql-test/t/sp-prelocking.test b/mysql-test/t/sp-prelocking.test
index cc3e3b93e06..966c59a5789 100644
--- a/mysql-test/t/sp-prelocking.test
+++ b/mysql-test/t/sp-prelocking.test
@@ -301,5 +301,90 @@ deallocate prepare stmt;
drop function bug19634;
drop table t1, t2, t3;
+#
+# Bug #27907 Misleading error message when opening/locking tables
+#
+
+--disable_warnings
+drop table if exists bug_27907_logs;
+drop table if exists bug_27907_t1;
+--enable_warnings
+
+create table bug_27907_logs (a int);
+create table bug_27907_t1 (a int);
+
+delimiter |;
+
+create trigger bug_27907_t1_ai after insert on bug_27907_t1
+for each row
+begin
+ insert into bug_27907_logs (a) values (1);
+end|
+
+delimiter ;|
+
+drop table bug_27907_logs;
+
+#
+# was failing before with error ER_NOT_LOCKED
+#
+--error ER_NO_SUCH_TABLE
+insert into bug_27907_t1(a) values (1);
+
+drop table bug_27907_t1;
+
+--echo
+--echo Bug#22427 create table if not exists + stored function results in
+--echo inconsistent behavior
+--echo
+--echo Add a test case, the bug itself was fixed by the patch for
+--echo Bug#20662
+--echo
+--disable_warnings
+drop table if exists t1;
+drop function if exists f_bug22427;
+--enable_warnings
+create table t1 (i int);
+insert into t1 values (1);
+create function f_bug22427() returns int return (select max(i) from t1);
+select f_bug22427();
+# Until this bug was fixed, the following emitted error
+# ERROR 1213: Deadlock found when trying to get lock
+create table if not exists t1 select f_bug22427() as i;
+--error ER_TABLE_EXISTS_ERROR
+create table t1 select f_bug22427() as i;
+drop table t1;
+drop function f_bug22427;
+
+--echo #
+--echo # Bug #29929 LOCK TABLES does not pre-lock tables used in triggers of the locked tables
+--echo #
+--disable_warnings
+DROP table IF EXISTS t1,t2;
+--enable_warnings
+CREATE TABLE t1 (c1 INT);
+CREATE TABLE t2 (c2 INT);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (2);
+DELIMITER //;
+CREATE TRIGGER t1_ai AFTER INSERT ON t1 FOR EACH ROW
+BEGIN
+UPDATE t2 SET c2= c2 + 1;
+END//
+DELIMITER ;//
+--echo # Take a table lock on t1.
+--echo # This should pre-lock t2 through the trigger.
+LOCK TABLE t1 WRITE;
+INSERT INTO t1 VALUES (3);
+UNLOCK TABLES;
+LOCK TABLE t1 READ;
+--error ER_TABLE_NOT_LOCKED
+INSERT INTO t2 values(4);
+UNLOCK TABLES;
+SELECT * FROM t1;
+SELECT * FROM t2;
+DROP TRIGGER t1_ai;
+DROP TABLE t1, t2;
--echo End of 5.0 tests
+
diff --git a/mysql-test/t/sp-vars.test b/mysql-test/t/sp-vars.test
index 0014dc1f6af..fe063889f81 100644
--- a/mysql-test/t/sp-vars.test
+++ b/mysql-test/t/sp-vars.test
@@ -1367,4 +1367,84 @@ CALL p1();
DROP PROCEDURE p1;
+#
+# Bug #27415 Text Variables in stored procedures
+# If the SP varible was also referenced on the right side
+# the result was corrupted.
+#
+DELIMITER |;
+
+--disable_warnings
+DROP PROCEDURE IF EXISTS bug27415_text_test|
+DROP PROCEDURE IF EXISTS bug27415_text_test2|
+--enable_warnings
+
+CREATE PROCEDURE bug27415_text_test(entity_id_str_in text)
+BEGIN
+ DECLARE str_remainder text;
+
+ SET str_remainder = entity_id_str_in;
+
+ select 'before substr', str_remainder;
+ SET str_remainder = SUBSTRING(str_remainder, 3);
+ select 'after substr', str_remainder;
+END|
+
+CREATE PROCEDURE bug27415_text_test2(entity_id_str_in text)
+BEGIN
+ DECLARE str_remainder text;
+ DECLARE str_remainder2 text;
+
+ SET str_remainder2 = entity_id_str_in;
+ select 'before substr', str_remainder2;
+ SET str_remainder = SUBSTRING(str_remainder2, 3);
+ select 'after substr', str_remainder;
+END|
+
+CALL bug27415_text_test('a,b,c')|
+CALL bug27415_text_test('a,b,c')|
+CALL bug27415_text_test2('a,b,c')|
+CALL bug27415_text_test('a,b,c')|
+
+DROP PROCEDURE bug27415_text_test|
+DROP PROCEDURE bug27415_text_test2|
+
+DELIMITER ;|
+
# End of 5.0 tests.
+
+#
+# Bug #26277 User variable returns one type in SELECT @v and other for CREATE as SELECT @v
+#
+--disable_warnings
+drop function if exists f1;
+drop table if exists t1;
+--enable_warnings
+
+delimiter |;
+create function f1() returns int
+begin
+ if @a=1 then set @b='abc';
+ else set @b=1;
+ end if;
+ set @a=1;
+ return 0;
+end|
+
+create table t1 (a int)|
+insert into t1 (a) values (1), (2)|
+
+set @b=1|
+set @a=0|
+select f1(), @b from t1|
+
+set @b:='test'|
+set @a=0|
+select f1(), @b from t1|
+
+delimiter ;|
+
+drop function f1;
+drop table t1;
+# End of 5.1 tests.
+
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index a9ef5ba8ea7..4e4102dd1ef 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -24,6 +24,11 @@ use test;
#
--disable_warnings
drop table if exists t1,t2,t3,t4;
+drop view if exists v1;
+drop procedure if exists p1;
+drop procedure if exists p2;
+drop function if exists f1;
+drop function if exists f2;
--enable_warnings
create table t1 (
id char(16) not null default '',
@@ -706,9 +711,9 @@ begin
insert into test.t1 values (concat(x, "2"), y+2);
end|
-# Remove spout file if it exists
---error 0,1
---remove_file $MYSQLTEST_VARDIR/tmp/spout
+# Check that file does not exists
+--error 1
+--file_exists $MYSQLTEST_VARDIR/tmp/spout
call into_outfile("ofile", 1)|
--remove_file $MYSQLTEST_VARDIR/tmp/spout
delete from t1|
@@ -725,9 +730,9 @@ begin
insert into test.t1 values (concat(x, "2"), y+2);
end|
-# Remove spdump file if it exists
---error 0,1
---remove_file $MYSQLTEST_VARDIR/tmp/spdump
+# Check that file does not exists
+--error 1
+--file_exists $MYSQLTEST_VARDIR/tmp/spdump
call into_dumpfile("dfile", 1)|
--remove_file $MYSQLTEST_VARDIR/tmp/spdump
delete from t1|
@@ -1767,11 +1772,11 @@ insert into t3 (a) values (1)|
create procedure h_ee()
deterministic
begin
- declare continue handler for 1582 -- ER_DUP_ENTRY_WITH_KEY_NAME
+ declare continue handler for 1062 -- ER_DUP_ENTRY
select 'Outer (bad)' as 'h_ee';
begin
- declare continue handler for 1582 -- ER_DUP_ENTRY_WITH_KEY_NAME
+ declare continue handler for 1062 -- ER_DUP_ENTRY
select 'Inner (good)' as 'h_ee';
insert into t3 values (1);
@@ -1781,7 +1786,7 @@ end|
create procedure h_es()
deterministic
begin
- declare continue handler for 1582 -- ER_DUP_ENTRY_WITH_KEY_NAME
+ declare continue handler for 1062 -- ER_DUP_ENTRY
select 'Outer (good)' as 'h_es';
begin
@@ -1827,7 +1832,7 @@ end|
create procedure h_ex()
deterministic
begin
- declare continue handler for 1582 -- ER_DUP_ENTRY_WITH_KEY_NAME
+ declare continue handler for 1062 -- ER_DUP_ENTRY
select 'Outer (good)' as 'h_ex';
begin
@@ -1846,7 +1851,7 @@ begin
select 'Outer (bad)' as 'h_se';
begin
- declare continue handler for 1582 -- ER_DUP_ENTRY_WITH_KEY_NAME
+ declare continue handler for 1062 -- ER_DUP_ENTRY
select 'Inner (good)' as 'h_se';
insert into t3 values (1);
@@ -2019,7 +2024,7 @@ begin
select 'Outer (bad)' as 'h_xe';
begin
- declare continue handler for 1582 -- ER_DUP_ENTRY_WITH_KEY_NAME
+ declare continue handler for 1062 -- ER_DUP_ENTRY
select 'Inner (good)' as 'h_xe';
insert into t3 values (1);
@@ -4511,7 +4516,7 @@ begin
select bug12379();
end|
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
select bug12379()|
select 1|
# statement-based binlogging will show warning which row-based won't;
@@ -4522,7 +4527,7 @@ select 2|
call bug12379_2()|
--enable_warnings
select 3|
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
call bug12379_3()|
select 4|
@@ -4604,7 +4609,7 @@ end|
call bug6127()|
select * from t3|
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
call bug6127()|
select * from t3|
set sql_mode=@sm|
@@ -5532,11 +5537,11 @@ insert into t3 values (1)|
create procedure bug15011()
deterministic
begin
- declare continue handler for 1582
+ declare continue handler for 1062
select 'Outer' as 'Handler';
begin
- declare continue handler for 1582
+ declare continue handler for 1062
select 'Inner' as 'Handler';
insert into t3 values (1);
@@ -6331,7 +6336,7 @@ set names utf8|
drop database if exists това_е_дълго_име_за_база_данни_нали|
--enable_warnings
create database това_е_дълго_име_за_база_данни_нали|
-INSERT INTO mysql.proc VALUES ('това_е_дълго_име_за_база_данни_нали','това_е_процедура_Ñ_доÑта_дълго_име_нали_и_още_по_дълго','PROCEDURE','това_е_процедура_Ñ_доÑта_дълго_име_нали_и_още_по_дълго','SQL','CONTAINS_SQL','NO','DEFINER','','','bad_body','root@localhost',now(), now(),'','')|
+INSERT INTO mysql.proc VALUES ('това_е_дълго_име_за_база_данни_нали','това_е_процедура_Ñ_доÑта_дълго_име_нали_и_още_по_дълго','PROCEDURE','това_е_процедура_Ñ_доÑта_дълго_име_нали_и_още_по_дълго','SQL','CONTAINS_SQL','NO','DEFINER','','','bad_body','root@localhost',now(), now(),'','', 'utf8', 'utf8_general_ci', 'utf8_general_ci', 'n/a')|
--error ER_SP_PROC_TABLE_CORRUPT
call това_е_дълго_име_за_база_данни_нали.това_е_процедура_Ñ_доÑта_дълго_име_нали_и_още_по_дълго()|
drop database това_е_дълго_име_за_база_данни_нали|
@@ -6570,6 +6575,34 @@ drop procedure proc_21462_b|
#
+# Bug#19733 "Repeated alter, or repeated create/drop, fails"
+# Check that CREATE/DROP INDEX is re-execution friendly.
+#
+--disable_warnings
+drop table if exists t3|
+drop procedure if exists proc_bug19733|
+--enable_warnings
+create table t3 (s1 int)|
+
+create procedure proc_bug19733()
+begin
+ declare v int default 0;
+ while v < 100 do
+ create index i on t3 (s1);
+ drop index i on t3;
+ set v = v + 1;
+ end while;
+end|
+
+call proc_bug19733()|
+call proc_bug19733()|
+call proc_bug19733()|
+
+drop procedure proc_bug19733|
+drop table t3|
+
+
+#
# BUG#20492: Subsequent calls to stored procedure yeild incorrect
# result if join is used
#
@@ -7067,7 +7100,7 @@ use test|
--disable_warnings
drop function if exists bug20777|
drop table if exists examplebug20777|
---enabled_warnings
+--enable_warnings
create function bug20777(f1 bigint unsigned) returns bigint unsigned
begin
set f1 = (f1 - 10); set f1 = (f1 + 10);
@@ -7146,6 +7179,17 @@ SELECT bug5274_f2()|
DROP FUNCTION bug5274_f1|
DROP FUNCTION bug5274_f2|
+#
+# Bug#21513 (SP having body starting with quoted label rendered unusable)
+#
+--disable_warnings
+drop procedure if exists proc_21513|
+--enable_warnings
+
+create procedure proc_21513()`my_label`:BEGIN END|
+show create procedure proc_21513|
+
+drop procedure proc_21513|
###
--echo End of 5.0 tests.
@@ -7175,7 +7219,7 @@ CREATE TABLE t2 (a int auto_increment primary key, b int) engine=innodb;
set @a=0;
delimiter |;
-CREATE function bug27354() RETURNS int deterministic
+CREATE function bug27354() RETURNS int not deterministic
begin
insert into t1 values (null);
set @a=@a+1;
@@ -7193,3 +7237,348 @@ select count(*) from t1 /* must be 3 */;
drop table t1,t2;
drop function bug27354;
+
+#
+# Bug #28605: SHOW CREATE VIEW with views using stored_procedures no longer
+# showing SP names.
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+
+CREATE FUNCTION metered(a INT) RETURNS INT RETURN 12;
+
+CREATE VIEW v1 AS SELECT test.metered(a) as metered FROM t1;
+
+SHOW CREATE VIEW v1;
+
+DROP VIEW v1;
+DROP FUNCTION metered;
+DROP TABLE t1;
+
+#
+# Bug#29834: Accessing a view column by name in SP/PS causes a memory leak.
+#
+# This is leak test. Run with large number assigned to $execute_cnt,
+# $p1_cnt, $p2_cnt, @p1_p2_cnt, $f1_normal_cnt or $f1_prep_cnt variables.
+#
+
+let $execute_cnt= 2;
+let $p1_cnt= 2;
+let $p2_cnt= 2;
+SET @p1_p2_cnt= 2;
+let $f1_normal_cnt= 2;
+let $f1_prep_cnt= 2;
+
+CREATE TABLE t1 (c1 INT);
+CREATE VIEW v1 AS SELECT * FROM t1;
+
+PREPARE s1 FROM 'SELECT c1 FROM v1';
+while ($execute_cnt)
+{
+ EXECUTE s1;
+ dec $execute_cnt;
+}
+
+DELIMITER |;
+
+CREATE PROCEDURE p1(IN loops BIGINT(19) UNSIGNED)
+BEGIN
+ WHILE loops > 0 DO
+ SELECT c1 FROM v1;
+ SET loops = loops - 1;
+ END WHILE;
+END|
+
+CREATE PROCEDURE p2(IN loops BIGINT(19) UNSIGNED)
+BEGIN
+ WHILE loops > 0 DO
+ SELECT c1 FROM v1;
+ CALL p1(@p1_p2_cnt);
+ SET loops = loops - 1;
+ END WHILE;
+END|
+
+CREATE FUNCTION f1(loops INT UNSIGNED)
+ RETURNS INT
+BEGIN
+ DECLARE tmp INT;
+ WHILE loops > 0 DO
+ SELECT c1 INTO tmp FROM v1;
+ SET loops = loops - 1;
+ END WHILE;
+ RETURN loops;
+END|
+
+DELIMITER ;|
+
+eval CALL p1($p1_cnt);
+eval CALL p2($p2_cnt);
+
+eval SELECT f1($f1_normal_cnt);
+
+eval PREPARE s1 FROM 'SELECT f1($f1_prep_cnt)';
+EXECUTE s1;
+EXECUTE s1;
+
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP FUNCTION f1;
+DROP VIEW v1;
+DROP TABLE t1;
+
+#
+# Bug#28551 "The warning 'No database selected' is reported when calling
+# stored procedures"
+#
+--disable_warnings
+drop database if exists mysqltest_db1;
+--enable_warnings
+create database mysqltest_db1;
+create procedure mysqltest_db1.sp_bug28551() begin end;
+call mysqltest_db1.sp_bug28551();
+show warnings;
+drop database mysqltest_db1;
+#
+# Bug#29050 Creation of a legal stored procedure fails if a database is not
+# selected prior
+#
+--disable_warnings
+drop database if exists mysqltest_db1;
+drop table if exists test.t1;
+--enable_warnings
+create database mysqltest_db1;
+use mysqltest_db1;
+# For the sake of its side effect
+drop database mysqltest_db1;
+# Now we have no current database selected.
+create table test.t1 (id int);
+insert into test.t1 (id) values (1);
+delimiter //;
+create procedure test.sp_bug29050() begin select * from t1; end//
+delimiter ;//
+show warnings;
+call test.sp_bug29050();
+show warnings;
+# Restore the old current database
+use test;
+drop procedure sp_bug29050;
+drop table t1;
+
+#
+# Bug #30120 SP with local variables with non-ASCII names crashes server.
+#
+
+SET NAMES latin1;
+
+DELIMITER |;
+
+CREATE PROCEDURE p1()
+BEGIN
+ DECLARE áâä INT;
+ SELECT áâä;
+END|
+
+DELIMITER ;|
+
+CALL p1();
+
+SET NAMES default;
+DROP PROCEDURE p1;
+
+#
+# Bug#25411 (trigger code truncated)
+#
+
+--disable_warnings
+drop procedure if exists proc_25411_a;
+drop procedure if exists proc_25411_b;
+drop procedure if exists proc_25411_c;
+--enable_warnings
+
+delimiter $$;
+
+create procedure proc_25411_a()
+begin
+ /* real comment */
+ select 1;
+ /*! select 2; */
+ select 3;
+ /*!00000 select 4; */
+ /*!99999 select 5; */
+end
+$$
+
+create procedure proc_25411_b(
+/* real comment */
+/*! p1 int, */
+/*!00000 p2 int */
+/*!99999 ,p3 int */
+)
+begin
+ select p1, p2;
+end
+$$
+
+create procedure proc_25411_c()
+begin
+ select 1/*!,2*//*!00000,3*//*!99999,4*/;
+ select 1/*! ,2*//*!00000 ,3*//*!99999 ,4*/;
+ select 1/*!,2 *//*!00000,3 *//*!99999,4 */;
+ select 1/*! ,2 *//*!00000 ,3 *//*!99999 ,4 */;
+ select 1 /*!,2*/ /*!00000,3*/ /*!99999,4*/ ;
+end
+$$
+
+delimiter ;$$
+
+show create procedure proc_25411_a;
+call proc_25411_a();
+
+show create procedure proc_25411_b;
+select name, param_list, body from mysql.proc where name like "%25411%";
+call proc_25411_b(10, 20);
+
+show create procedure proc_25411_c;
+call proc_25411_c();
+
+drop procedure proc_25411_a;
+drop procedure proc_25411_b;
+drop procedure proc_25411_c;
+
+
+#
+# Bug#26302 (MySQL server cuts off trailing "*/" from comments in SP/func)
+#
+
+--disable_warnings
+drop procedure if exists proc_26302;
+--enable_warnings
+
+create procedure proc_26302()
+select 1 /* testing */;
+
+show create procedure proc_26302;
+
+select ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES
+where ROUTINE_NAME = "proc_26302";
+
+drop procedure proc_26302;
+
+
+# Bug #29338: no optimization for stored functions with a trivial body
+# always returning constant.
+#
+
+CREATE FUNCTION f1() RETURNS INT DETERMINISTIC RETURN 2;
+CREATE FUNCTION f2(I INT) RETURNS INT DETERMINISTIC RETURN 3;
+
+CREATE TABLE t1 (c1 INT, INDEX(c1));
+
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
+
+CREATE VIEW v1 AS SELECT c1 FROM t1;
+
+EXPLAIN SELECT * FROM t1 WHERE c1=1;
+EXPLAIN SELECT * FROM t1 WHERE c1=f1();
+
+EXPLAIN SELECT * FROM v1 WHERE c1=1;
+EXPLAIN SELECT * FROM v1 WHERE c1=f1();
+
+EXPLAIN SELECT * FROM t1 WHERE c1=f2(10);
+EXPLAIN SELECT * FROM t1 WHERE c1=f2(c1);
+EXPLAIN SELECT * FROM t1 WHERE c1=f2(rand());
+
+
+DROP VIEW v1;
+DROP FUNCTION f1;
+DROP FUNCTION f2;
+DROP TABLE t1;
+
+#
+# Bug#29408 Cannot find view in columns table if the selection contains a function
+#
+delimiter |;
+
+create function f1()
+ returns int(11)
+not deterministic
+contains sql
+sql security definer
+comment ''
+begin
+ declare x int(11);
+ set x=-1;
+ return x;
+end|
+
+delimiter ;|
+
+create view v1 as select 1 as one, f1() as days;
+
+connect (bug29408, localhost, root,,*NO-ONE*);
+connection bug29408;
+
+show create view test.v1;
+select column_name from information_schema.columns
+where table_name='v1' and table_schema='test';
+
+connection default;
+disconnect bug29408;
+drop view v1;
+drop function f1;
+
+#
+# Bug#13675: DATETIME/DATE type in store proc param seems to be converted as
+# varbinary
+#
+
+--echo
+--echo # Bug#13675.
+--echo
+
+--disable_warnings
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p2;
+
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+--echo
+
+CREATE PROCEDURE p1(v DATETIME) CREATE TABLE t1 SELECT v;
+
+CREATE PROCEDURE p2(v INT) CREATE TABLE t1 SELECT v;
+
+--echo
+CALL p1(NOW());
+SHOW CREATE TABLE t1;
+
+--echo
+DROP TABLE t1;
+
+--echo
+CALL p1('text');
+SHOW CREATE TABLE t1;
+
+--echo
+DROP TABLE t1;
+
+--echo
+CALL p2(10);
+SHOW CREATE TABLE t1;
+
+--echo
+DROP TABLE t1;
+
+--echo
+CALL p2('text');
+SHOW CREATE TABLE t1;
+
+--echo
+DROP TABLE t1;
+
+--echo
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/sp_notembedded.test b/mysql-test/t/sp_notembedded.test
index 6335ad55606..b5037b469ae 100644
--- a/mysql-test/t/sp_notembedded.test
+++ b/mysql-test/t/sp_notembedded.test
@@ -287,3 +287,68 @@ connection default;
drop user mysqltest_1@localhost;
drop procedure 15298_1;
drop procedure 15298_2;
+
+#
+# Bug#29936 Stored Procedure DML ignores low_priority_updates setting
+#
+
+--disable_warnings
+drop table if exists t1;
+drop procedure if exists p1;
+--enable_warnings
+
+create table t1 (value varchar(15));
+create procedure p1() update t1 set value='updated' where value='old';
+
+# load the procedure into sp cache and execute once
+call p1();
+
+insert into t1 (value) values ("old");
+
+connect (rl_holder, localhost, root,,);
+connect (rl_acquirer, localhost, root,,);
+connect (rl_contender, localhost, root,,);
+connect (rl_wait, localhost, root,,);
+
+connection rl_holder;
+select get_lock('b26162',120);
+
+connection rl_acquirer;
+--send select 'rl_acquirer', value from t1 where get_lock('b26162',120);
+
+# we must wait till this select opens and locks the tables
+connection rl_wait;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "User lock" and
+ info = "select 'rl_acquirer', value from t1 where get_lock('b26162',120)";
+--source include/wait_condition.inc
+
+connection default;
+set session low_priority_updates=on;
+--send call p1();
+
+connection rl_wait;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and
+ info = "update t1 set value='updated' where value='old'";
+--source include/wait_condition.inc
+
+connection rl_contender;
+select 'rl_contender', value from t1;
+
+connection rl_holder;
+select release_lock('b26162');
+
+connection rl_acquirer;
+--reap
+connection default;
+--reap
+
+disconnect rl_holder;
+disconnect rl_acquirer;
+disconnect rl_wait;
+drop procedure p1;
+drop table t1;
+set session low_priority_updates=default;
diff --git a/mysql-test/t/sp_trans.test b/mysql-test/t/sp_trans.test
index a79f6c7e7e0..0b04b9d7668 100644
--- a/mysql-test/t/sp_trans.test
+++ b/mysql-test/t/sp_trans.test
@@ -2,6 +2,7 @@
# tests that require InnoDB...
#
+-- source include/have_log_bin.inc
-- source include/have_innodb.inc
--disable_warnings
@@ -89,7 +90,7 @@ create function bug10015_5(i int) returns int
end if;
return i;
end|
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values (bug10015_5(4)), (bug10015_5(5))|
select * from t1|
drop function bug10015_5|
diff --git a/mysql-test/t/sp_trans_log.test b/mysql-test/t/sp_trans_log.test
index 9b85981e2e1..447ec19b132 100644
--- a/mysql-test/t/sp_trans_log.test
+++ b/mysql-test/t/sp_trans_log.test
@@ -32,7 +32,7 @@ begin
end|
reset master|
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--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 */|
diff --git a/mysql-test/t/sql_mode.test b/mysql-test/t/sql_mode.test
index 8542c2b7927..7a9036c8621 100644
--- a/mysql-test/t/sql_mode.test
+++ b/mysql-test/t/sql_mode.test
@@ -264,7 +264,18 @@ select @@sql_mode;
set sql_mode=16384+(65536*4);
select @@sql_mode;
--error 1231
-set sql_mode=2147483648; # that mode does not exist
+set sql_mode=2147483648*2; # that mode does not exist
select @@sql_mode;
+#
+# Test WL921: Retain spaces when retrieving CHAR column values
+
+set sql_mode=PAD_CHAR_TO_FULL_LENGTH;
+create table t1 (a int auto_increment primary key, b char(5));
+insert into t1 (b) values('a'),('b\t'),('c ');
+select concat('x',b,'x') from t1;
+set sql_mode=0;
+select concat('x',b,'x') from t1;
+drop table t1;
+
SET @@SQL_MODE=@OLD_SQL_MODE;
diff --git a/mysql-test/t/ssl-big.test b/mysql-test/t/ssl-big.test
new file mode 100644
index 00000000000..099c64df08f
--- /dev/null
+++ b/mysql-test/t/ssl-big.test
@@ -0,0 +1,56 @@
+# Turn on ssl between the client and server
+# and run a number of tests
+
+-- source include/have_ssl.inc
+-- source include/big_test.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+
+#
+# Bug #29579 Clients using SSL can hang the server
+#
+
+connect (ssl_con,localhost,root,,,,,SSL);
+
+create table t1 (a int);
+
+disconnect ssl_con;
+
+
+--disable_query_log
+--disable_result_log
+
+let $count= 2000;
+while ($count)
+{
+ connect (ssl_con,localhost,root,,,,,SSL);
+
+ eval insert into t1 values ($count);
+ dec $count;
+
+ # This select causes the net buffer to fill as the server sends the results
+ # but the client doesn't reap the results. The results are larger each time
+ # through the loop, so that eventually the buffer is completely full
+ # at the exact moment the server attempts to the close the connection with
+ # the lock held.
+ send select * from t1;
+
+ # now send the quit the command so the server will initiate the shutdown.
+ send_quit ssl_con;
+
+ # if the server is hung, this will hang too:
+ connect (ssl_con2,localhost,root,,,,,SSL);
+
+ # no hang if we get here, close and retry
+ disconnect ssl_con2;
+ disconnect ssl_con;
+}
+--enable_query_log
+--enable_result_log
+
+connect (ssl_con,localhost,root,,,,,SSL);
+
+drop table t1;
+
diff --git a/mysql-test/t/ssl_8k_key.test b/mysql-test/t/ssl_8k_key.test
new file mode 100644
index 00000000000..b4203e68445
--- /dev/null
+++ b/mysql-test/t/ssl_8k_key.test
@@ -0,0 +1,6 @@
+-- source include/have_ssl.inc
+#
+# Bug#29784 YaSSL assertion failure when reading 8k key.
+#
+--exec $MYSQL --ssl --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1
+
diff --git a/mysql-test/t/status.test b/mysql-test/t/status.test
index 746d3a352a4..1cd5aa1726a 100644
--- a/mysql-test/t/status.test
+++ b/mysql-test/t/status.test
@@ -1,3 +1,6 @@
+# This test requires that --log-output includes 'table', and the general
+# log is on
+
# embedded server causes different stat
-- source include/not_embedded.inc
@@ -8,30 +11,54 @@ connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
flush status;
+
+# Logging to the general query log table (--log-output=table --log) increments
+# Table_locks_immediate with each query, so here Immediate becomes 1
show status like 'Table_lock%';
+# ++Immediate = 2
select * from information_schema.session_status where variable_name like 'Table_lock%';
+
connection con1;
+# ++Immediate = 3
SET SQL_LOG_BIN=0;
--disable_warnings
+# ++Immediate = 4
drop table if exists t1;
--enable_warnings
+# ++Immediate = 5
create table t1(n int) engine=myisam;
+# Immediate + 2 = 7
insert into t1 values(1);
+
connection con2;
+# Immediate + 2 = 9
lock tables t1 read;
+# ++Immediate = 10
unlock tables;
+# Immediate + 2 = 12
lock tables t1 read;
+
connection con1;
+# ++Immediate = 13
+let $ID= `select connection_id()`;
+# ++Immediate = 14 (Not +2, because this increments Table_locks_waited)
--send
update t1 set n = 3;
+
connection con2;
-sleep 0.5;
+# wait for the other query to start executing
+let $wait_condition= select 1 from INFORMATION_SCHEMA.PROCESSLIST where ID = $ID and STATE = "Locked";
+# Immediate = 14 + $wait_condition_reps ($wait_timeout is 0, so no extra select
+# is done inside wait_condition.inc)
+--source include/wait_condition.inc
+# ++Immediate = 15 + $wait_condition_reps
unlock tables;
+
connection con1;
reap;
-show status like 'Table_lock%';
-select * from information_schema.session_status where variable_name like 'Table_lock%';
+# ++Immediate = 16 + $wait_condition_reps
+show status like 'Table_locks_waited';
drop table t1;
disconnect con2;
@@ -159,6 +186,38 @@ disconnect con3;
disconnect con2;
disconnect con1;
+
+#
+# Bug #30377: EXPLAIN loses last_query_cost when used with UNION
+#
+
+CREATE TABLE t1 ( a INT );
+INSERT INTO t1 VALUES (1), (2);
+
+SELECT a FROM t1 LIMIT 1;
+SHOW SESSION STATUS LIKE 'Last_query_cost';
+
+EXPLAIN SELECT a FROM t1;
+SHOW SESSION STATUS LIKE 'Last_query_cost';
+
+SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY a;
+SHOW SESSION STATUS LIKE 'Last_query_cost';
+
+EXPLAIN SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY a;
+SHOW SESSION STATUS LIKE 'Last_query_cost';
+
+SELECT a IN (SELECT a FROM t1) FROM t1 LIMIT 1;
+SHOW SESSION STATUS LIKE 'Last_query_cost';
+
+SELECT (SELECT a FROM t1 LIMIT 1) x FROM t1 LIMIT 1;
+SHOW SESSION STATUS LIKE 'Last_query_cost';
+
+SELECT * FROM t1 a, t1 b LIMIT 1;
+SHOW SESSION STATUS LIKE 'Last_query_cost';
+
+DROP TABLE t1;
+
+
# End of 5.0 tests
#
diff --git a/mysql-test/t/strict.test b/mysql-test/t/strict.test
index 7dd38920b3d..2b71bf1093c 100644
--- a/mysql-test/t/strict.test
+++ b/mysql-test/t/strict.test
@@ -7,7 +7,7 @@ set @@sql_mode='ansi,traditional';
select @@sql_mode;
--disable_warnings
-DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t1, t2;
--enable_warnings
# Test INSERT with DATE
@@ -975,9 +975,7 @@ select * from t1;
# Check that select don't abort even in strict mode (for now)
set sql_mode='traditional';
---disable_ps_warnings
select count(*) from t1 where STR_TO_DATE('2004.12.12 10:22:61','%Y.%m.%d %T') IS NULL;
---enable_ps_warnings
drop table t1;
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index aaeb998d0c7..95514fd773e 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -1822,13 +1822,6 @@ SELECT * FROM t1
DROP TABLE t1,t2,t3;
#
-# BUG #10308: purge log with subselect
-#
-
-purge master logs before (select adddate(current_timestamp(), interval -4 day));
-
-
-#
# Bug#18503: Queries with a quantified subquery returning empty set may
# return a wrong result.
#
@@ -2882,6 +2875,118 @@ INSERT INTO t1 VALUES (1,1),(2,1);
EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT COUNT(*) FROM t1 GROUP BY b);
DROP TABLE t1;
+#
+# Bug #28377: grouping query with a correlated subquery in WHERE condition
+#
+
+CREATE TABLE t1 (id int NOT NULL, st CHAR(2), INDEX idx(id));
+INSERT INTO t1 VALUES
+ (3,'FL'), (2,'GA'), (4,'FL'), (1,'GA'), (5,'NY'), (7,'FL'), (6,'NY');
+CREATE TABLE t2 (id int NOT NULL, INDEX idx(id));
+INSERT INTO t2 VALUES (7), (5), (1), (3);
+
+SELECT id, st FROM t1
+ WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id);
+SELECT id, st FROM t1
+ WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id)
+ GROUP BY id;
+
+SELECT id, st FROM t1
+ WHERE st IN ('GA','FL') AND NOT EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id);
+SELECT id, st FROM t1
+ WHERE st IN ('GA','FL') AND NOT EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id)
+ GROUP BY id;
+
+DROP TABLE t1,t2;
+
+#
+# Bug #28728: crash with EXPLAIN EXTENDED for a query with a derived table
+# over a grouping subselect
+#
+
+CREATE TABLE t1 (a int);
+
+INSERT INTO t1 VALUES (1), (2);
+
+EXPLAIN EXTENDED
+SELECT * FROM (SELECT count(*) FROM t1 GROUP BY a) as res;
+
+DROP TABLE t1;
+
+#
+# Bug #28811: crash for query containing subquery with ORDER BY and LIMIT 1
+#
+
+CREATE TABLE t1 (
+ a varchar(255) default NULL,
+ b timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ INDEX idx(a,b)
+);
+CREATE TABLE t2 (
+ a varchar(255) default NULL
+);
+
+INSERT INTO t1 VALUES ('abcdefghijk','2007-05-07 06:00:24');
+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` VALUES ('asdf','2007-02-08 01:11:26');
+INSERT INTO `t2` VALUES ('abcdefghijk');
+INSERT INTO `t2` VALUES ('asdf');
+
+SET session sort_buffer_size=8192;
+
+SELECT (SELECT 1 FROM t1 WHERE t1.a=t2.a ORDER BY t1.b LIMIT 1) AS d1 FROM t2;
+
+DROP TABLE t1,t2;
+
+
+#
+# Bug #27333: subquery grouped for aggregate of outer query / no aggregate
+# of subquery
+#
+CREATE TABLE t1 (a INTEGER, b INTEGER);
+CREATE TABLE t2 (x INTEGER);
+INSERT INTO t1 VALUES (1,11), (2,22), (2,22);
+INSERT INTO t2 VALUES (1), (2);
+
+# wasn't failing, but should
+--error ER_SUBQUERY_NO_1_ROW
+SELECT a, COUNT(b), (SELECT COUNT(b) FROM t2) FROM t1 GROUP BY a;
+
+# fails as it should
+--error ER_SUBQUERY_NO_1_ROW
+SELECT a, COUNT(b), (SELECT COUNT(b)+0 FROM t2) FROM t1 GROUP BY a;
+
+SELECT (SELECT SUM(t1.a)/AVG(t2.x) FROM t2) FROM t1;
+DROP TABLE t1,t2;
+
+# second test case from 27333
+CREATE TABLE t1 (a INT, b INT);
+INSERT INTO t1 VALUES (1, 2), (1,3), (1,4), (2,1), (2,2);
+
+# returns no rows, when it should
+SELECT a1.a, COUNT(*) FROM t1 a1 WHERE a1.a = 1
+AND EXISTS( SELECT a2.a FROM t1 a2 WHERE a2.a = a1.a)
+GROUP BY a1.a;
+DROP TABLE t1;
+
+#test cases from 29297
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+INSERT INTO t2 VALUES (1),(2);
+SELECT (SELECT SUM(t1.a) FROM t2 WHERE a=0) FROM t1;
+--error ER_SUBQUERY_NO_1_ROW
+SELECT (SELECT SUM(t1.a) FROM t2 WHERE a!=0) FROM t1;
+SELECT (SELECT SUM(t1.a) FROM t2 WHERE a=1) FROM t1;
+DROP TABLE t1,t2;
+
--echo End of 5.0 tests.
#
diff --git a/mysql-test/t/subselect3.test b/mysql-test/t/subselect3.test
index dfe09968fa2..2f844c9cc21 100644
--- a/mysql-test/t/subselect3.test
+++ b/mysql-test/t/subselect3.test
@@ -260,11 +260,11 @@ insert into t2 values
('dd', 1, NULL);
alter table t1 add index idx(ie1,ie2);
---cc 3 NULL NULL
+# cc 3 NULL NULL
select oref, a, b, (a,b) in (select ie1,ie2 from t1 where oref=t2.oref) Z from t2 where a=3 and b is null ;
insert into t2 values ('new1', 10,10);
insert into t1 values ('new1', 1234, 10, NULL);
--- new1, 10, 10, NULL,
+# new1, 10, 10, NULL,
select oref, a, b, (a,b) in (select ie1,ie2 from t1 where oref=t2.oref) Z from t2 where a=10 and b=10;
explain extended
select oref, a, b, (a,b) in (select ie1,ie2 from t1 where oref=t2.oref) Z from t2 where a=10 and b=10;
@@ -546,3 +546,46 @@ SELECT a FROM t1, t2 WHERE a=b AND (b NOT IN (SELECT a FROM t1));
SELECT a FROM t1, t2 WHERE a=b AND (b NOT IN (SELECT a FROM t1 WHERE a > 4));
DROP TABLE t1,t2;
+
+#
+# Bug #28375: crash for NOT IN subquery predicate when left operand becomes NULL
+#
+
+CREATE TABLE t1 (id int);
+CREATE TABLE t2 (id int PRIMARY KEY);
+CREATE TABLE t3 (id int PRIMARY KEY, name varchar(10));
+INSERT INTO t1 VALUES (2), (NULL), (3), (1);
+INSERT INTO t2 VALUES (234), (345), (457);
+INSERT INTO t3 VALUES (222,'bbb'), (333,'ccc'), (111,'aaa');
+
+EXPLAIN
+SELECT * FROM t1
+ WHERE t1.id NOT IN (SELECT t2.id FROM t2,t3
+ WHERE t3.name='xxx' AND t2.id=t3.id);
+SELECT * FROM t1
+ WHERE t1.id NOT IN (SELECT t2.id FROM t2,t3
+ WHERE t3.name='xxx' AND t2.id=t3.id);
+
+SELECT (t1.id IN (SELECT t2.id FROM t2,t3
+ WHERE t3.name='xxx' AND t2.id=t3.id)) AS x
+ FROM t1;
+
+DROP TABLE t1,t2,t3;
+
+#
+# Bug #22855: Optimizer doesn't rewrite NOT IN subselects to a correlated
+# subquery
+#
+CREATE TABLE t1 (a INT NOT NULL);
+INSERT INTO t1 VALUES (1),(-1), (65),(66);
+
+CREATE TABLE t2 (a INT UNSIGNED NOT NULL PRIMARY KEY);
+INSERT INTO t2 VALUES (65),(66);
+
+SELECT a FROM t1 WHERE a NOT IN (65,66);
+SELECT a FROM t1 WHERE a NOT IN (SELECT a FROM t2);
+EXPLAIN SELECT a FROM t1 WHERE a NOT IN (SELECT a FROM t2);
+
+DROP TABLE t1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/subselect_notembedded.test b/mysql-test/t/subselect_notembedded.test
index c5b23f6dac8..c112272e8ad 100644
--- a/mysql-test/t/subselect_notembedded.test
+++ b/mysql-test/t/subselect_notembedded.test
@@ -1,8 +1,9 @@
-- source include/not_embedded.inc
#
-# BUG #10308: purge log with subselect
+# BUG#10308: purge log with subselect
+# Bug#28553: mysqld crash in "purge master log before(select time from information_schema)"
#
-
+--error 1064
purge master logs before (select adddate(current_timestamp(), interval -4 day));
-
+purge master logs before adddate(current_timestamp(), interval -4 day);
diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test
index 981206ca54c..15f50b11e73 100644
--- a/mysql-test/t/symlink.test
+++ b/mysql-test/t/symlink.test
@@ -174,4 +174,43 @@ drop table t1;
--echo End of 4.1 tests
+#
+# Bug #29325: create table overwrites .MYD file of other table (datadir)
+#
+
+CREATE DATABASE db1;
+CREATE DATABASE db2;
+
+USE db2;
+--disable_query_log
+eval CREATE TABLE t1 (b INT) ENGINE MYISAM
+DATA DIRECTORY = '$MYSQLTEST_VARDIR/master-data/db1/';
+--enable_query_log
+
+INSERT INTO db2.t1 VALUES (1);
+SELECT * FROM db2.t1;
+RESET QUERY CACHE;
+
+USE db1;
+
+#no warning from create table
+SET SESSION keep_files_on_create = TRUE;
+--disable_abort_on_error
+--error 1,1
+CREATE TABLE t1 (a INT) ENGINE MYISAM;
+--enable_abort_on_error
+
+CREATE TABLE t3 (a INT) Engine=MyISAM;
+INSERT INTO t3 VALUES (1),(2),(3);
+TRUNCATE TABLE t3;
+SELECT * from t3;
+
+SET SESSION keep_files_on_create = DEFAULT;
+
+DROP TABLE db2.t1, db1.t3;
+DROP DATABASE db1;
+DROP DATABASE db2;
+USE test;
+
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/system_mysql_db_fix50117-master.opt b/mysql-test/t/system_mysql_db_fix50117-master.opt
new file mode 100644
index 00000000000..7e4fa9a3ee8
--- /dev/null
+++ b/mysql-test/t/system_mysql_db_fix50117-master.opt
@@ -0,0 +1 @@
+--result-file=system_mysql_db
diff --git a/mysql-test/t/system_mysql_db_fix50117.test b/mysql-test/t/system_mysql_db_fix50117.test
new file mode 100644
index 00000000000..5f259ac6133
--- /dev/null
+++ b/mysql-test/t/system_mysql_db_fix50117.test
@@ -0,0 +1,104 @@
+# Embedded server doesn't support external clients
+--source include/not_embedded.inc
+
+#
+# This is the test for mysql_fix_privilege_tables
+# It checks that a system tables from mysql 5.1.17
+# can be upgraded to current system table format
+#
+# Note: If this test fails, don't be confused about the errors reported
+# by mysql-test-run This shows warnings generated by
+# mysql_fix_system_tables which should be ignored.
+# Instead, concentrate on the errors in r/system_mysql_db.reject
+
+--disable_warnings
+ drop table if exists t1,t1aa,t2aa;
+--enable_warnings
+
+-- disable_result_log
+-- disable_query_log
+
+use test;
+
+# create system tables as in mysql-5.1.17
+
+
+CREATE TABLE IF NOT EXISTS db ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) 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, 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, PRIMARY KEY Host (Host,Db,User), KEY User (User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges';
+
+
+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 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 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';
+
+
+CREATE TABLE IF NOT EXISTS tables_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges';
+
+CREATE TABLE IF NOT EXISTS columns_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges';
+
+
+CREATE TABLE IF NOT EXISTS help_topic ( help_topic_id int unsigned not null, name char(64) not null, help_category_id smallint unsigned not null, description text not null, example text not null, url char(128) not null, primary key (help_topic_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help topics';
+
+
+CREATE TABLE IF NOT EXISTS help_category ( help_category_id smallint unsigned not null, name char(64) not null, parent_category_id smallint unsigned null, url char(128) not null, primary key (help_category_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help categories';
+
+
+CREATE TABLE IF NOT EXISTS help_relation ( help_topic_id int unsigned not null references help_topic, help_keyword_id int unsigned not null references help_keyword, primary key (help_keyword_id, help_topic_id) ) engine=MyISAM CHARACTER SET utf8 comment='keyword-topic relation';
+
+
+CREATE TABLE IF NOT EXISTS help_keyword ( help_keyword_id int unsigned not null, name char(64) not null, primary key (help_keyword_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help keywords';
+
+
+CREATE TABLE IF NOT EXISTS time_zone_name ( Name char(64) NOT NULL, Time_zone_id int unsigned NOT NULL, PRIMARY KEY Name (Name) ) engine=MyISAM CHARACTER SET utf8 comment='Time zone names';
+
+
+CREATE TABLE IF NOT EXISTS time_zone ( Time_zone_id int unsigned NOT NULL auto_increment, Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY TzId (Time_zone_id) ) engine=MyISAM CHARACTER SET utf8 comment='Time zones';
+
+
+CREATE TABLE IF NOT EXISTS time_zone_transition ( Time_zone_id int unsigned NOT NULL, Transition_time bigint signed NOT NULL, Transition_type_id int unsigned NOT NULL, PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time) ) engine=MyISAM CHARACTER SET utf8 comment='Time zone transitions';
+
+
+CREATE TABLE IF NOT EXISTS time_zone_transition_type ( Time_zone_id int unsigned NOT NULL, Transition_type_id int unsigned NOT NULL, Offset int signed DEFAULT 0 NOT NULL, Is_DST tinyint unsigned DEFAULT 0 NOT NULL, Abbreviation char(8) DEFAULT '' NOT NULL, PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id) ) engine=MyISAM CHARACTER SET utf8 comment='Time zone transition types';
+
+
+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 char(64) 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' ) DEFAULT '' NOT NULL, comment char(64) collate utf8_bin DEFAULT '' NOT NULL, 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) binary 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';
+
+CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field 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') default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', 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') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events';
+
+CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM;
+
+# Run the mysql_fix_privilege_tables.sql using "mysql --force"
+--exec $MYSQL --force test < $MYSQL_FIX_PRIVILEGE_TABLES > $MYSQLTEST_VARDIR/log/system_mysql_db_fix50117.log 2>&1
+
+-- enable_query_log
+-- enable_result_log
+
+# Dump the tables that should be compared
+-- source include/system_db_struct.inc
+
+-- disable_query_log
+
+# Drop all tables created by this test
+DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index;
+
+-- enable_query_log
+
+# check that we dropped all system tables
+show tables;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/temp_table.test b/mysql-test/t/temp_table.test
index e10fd386bd3..d1ad7ab8ffa 100644
--- a/mysql-test/t/temp_table.test
+++ b/mysql-test/t/temp_table.test
@@ -73,7 +73,7 @@ drop table t1,t2;
#
create temporary table t1 (a int not null);
insert into t1 values (1),(1);
--- error ER_DUP_ENTRY_WITH_KEY_NAME
+-- error ER_DUP_ENTRY
alter table t1 add primary key (a);
drop table t1;
diff --git a/mysql-test/t/trigger-trans.test b/mysql-test/t/trigger-trans.test
index 5c135d98878..8103a1ba0b1 100644
--- a/mysql-test/t/trigger-trans.test
+++ b/mysql-test/t/trigger-trans.test
@@ -49,4 +49,84 @@ insert into t1 values ('The Pie', 50, 1, 1);
select * from t1;
drop table t1;
-# End of 5.0 tests
+--echo
+--echo Bug#26141 mixing table types in trigger causes full
+--echo table lock on innodb table
+--echo
+--echo Ensure we do not open and lock tables for the triggers we do not
+--echo fire.
+--echo
+--disable_warnings
+drop table if exists t1, t2, t3;
+drop trigger if exists trg_bug26141_au;
+drop trigger if exists trg_bug26141_ai;
+--enable_warnings
+# Note, for InnoDB to allow concurrent UPDATE and INSERT the
+# table must have a unique key.
+create table t1 (c int primary key) engine=innodb;
+create table t2 (c int) engine=myisam;
+create table t3 (c int) engine=myisam;
+insert into t1 (c) values (1);
+delimiter |;
+
+create trigger trg_bug26141_ai after insert on t1
+for each row
+begin
+ insert into t2 (c) values (1);
+# We need the 'sync' lock to synchronously wait in connection 2 till
+# the moment when the trigger acquired all the locks.
+ select release_lock("lock_bug26141_sync") into @a;
+# 1000 is time in seconds of lock wait timeout -- this is a way
+# to cause a manageable sleep up to 1000 seconds
+ select get_lock("lock_bug26141_wait", 1000) into @a;
+end|
+
+create trigger trg_bug26141_au after update on t1
+for each row
+begin
+ insert into t3 (c) values (1);
+end|
+delimiter ;|
+
+# Establish an alternative connection.
+--connect (connection_aux,localhost,root,,test,,)
+--connect (connection_update,localhost,root,,test,,)
+
+connection connection_aux;
+# Lock the wait lock, it must not be locked, so specify zero timeout.
+select get_lock("lock_bug26141_wait", 0);
+
+#
+connection default;
+#
+# Run the trigger synchronously
+#
+select get_lock("lock_bug26141_sync", /* must not be priorly locked */ 0);
+# Will acquire the table level locks, perform the insert into t2,
+# release the sync lock and block on the wait lock.
+send insert into t1 (c) values (2);
+
+connection connection_update;
+# Wait for the trigger to acquire its locks and unlock the sync lock.
+select get_lock("lock_bug26141_sync", 1000);
+#
+# This must continue: after the fix for the bug, we do not
+# open tables for t2, and with c=4 innobase allows the update
+# to run concurrently with insert.
+update t1 set c=3 where c=1;
+select release_lock("lock_bug26141_sync");
+connection connection_aux;
+select release_lock("lock_bug26141_wait");
+connection default;
+reap;
+select * from t1;
+select * from t2;
+select * from t3;
+
+# Drops the trigger as well.
+drop table t1, t2, t3;
+disconnect connection_update;
+disconnect connection_aux;
+
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test
index 55b67adf7c6..9f4634e1e17 100644
--- a/mysql-test/t/trigger.test
+++ b/mysql-test/t/trigger.test
@@ -406,7 +406,7 @@ create table mysqltest.t1 (i int);
--error ER_TRG_IN_WRONG_SCHEMA
create trigger trg1 before insert on mysqltest.t1 for each row set @a:= 1;
use mysqltest;
---error ER_TRG_IN_WRONG_SCHEMA
+--error ER_NO_SUCH_TABLE
create trigger test.trg1 before insert on t1 for each row set @a:= 1;
drop database mysqltest;
use test;
@@ -1000,9 +1000,9 @@ create trigger t1_bi after insert on t1 for each row insert into t3 values (new.
# Until we implement proper mechanism for invalidation of PS/SP when table
# or SP's are changed these two statements will fail with 'Table ... was
# not locked' error (this mechanism should be based on the new TDC).
---error 1100 #ER_TABLE_NOT_LOCKED
+--error ER_NO_SUCH_TABLE
execute stmt1;
---error 1100 #ER_TABLE_NOT_LOCKED
+--error ER_NO_SUCH_TABLE
call p1();
deallocate prepare stmt1;
drop procedure p1;
@@ -1040,7 +1040,7 @@ drop table t1;
connection addconwithoutdb;
--error ER_NO_DB_ERROR
create trigger t1_bi before insert on test.t1 for each row set @a:=0;
---error ER_NO_DB_ERROR
+--error ER_NO_SUCH_TABLE
create trigger test.t1_bi before insert on t1 for each row set @a:=0;
--error ER_NO_DB_ERROR
drop trigger t1_bi;
@@ -1146,7 +1146,8 @@ write_file $MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~;
dummy
EOF
chmod 0000 $MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~;
---replace_result $MYSQLTEST_VARDIR . master-data// ''
+# Normalize the datadir path; the embedded server doesn't chdir to datadir
+--replace_result $MYSQLTEST_VARDIR . master-data/ ''
--error 1
rename table t1 to t2;
# 't1' should be still there and triggers should work correctly
@@ -1737,4 +1738,511 @@ DROP TRIGGER trg27006_a_insert;
DROP TRIGGER trg27006_a_update;
drop table t1,t2;
+#
+# Bug #20903 "Crash when using CREATE TABLE .. SELECT and triggers"
+#
+
+--disable_warnings
+drop table if exists t1, t2, t3;
+--enable_warnings
+create table t1 (i int);
+create trigger t1_bi before insert on t1 for each row set new.i = 7;
+create trigger t1_ai after insert on t1 for each row set @a := 7;
+create table t2 (j int);
+insert into t2 values (1), (2);
+set @a:="";
+create table if not exists t1 select * from t2;
+select * from t1;
+select @a;
+# Let us check that trigger that involves table also works ok.
+drop trigger t1_bi;
+drop trigger t1_ai;
+create table t3 (isave int);
+create trigger t1_bi before insert on t1 for each row insert into t3 values (new.i);
+create table if not exists t1 select * from t2;
+select * from t1;
+select * from t3;
+drop table t1, t2, t3;
+
+disconnect addconroot1;
+disconnect addconroot2;
+disconnect addconwithoutdb;
+#
+# Bug #26162: Trigger DML ignores low_priority_updates setting
+#
+CREATE TABLE t1 (id INTEGER);
+CREATE TABLE t2 (id INTEGER);
+
+INSERT INTO t2 VALUES (1),(2);
+
+# trigger that produces the high priority insert, but should be low, adding
+# LOW_PRIORITY fixes this
+CREATE TRIGGER t1_test AFTER INSERT ON t1 FOR EACH ROW
+ INSERT INTO t2 VALUES (new.id);
+
+CONNECT (rl_holder, localhost, root,,);
+CONNECT (rl_acquirer, localhost, root,,);
+CONNECT (wl_acquirer, localhost, root,,);
+CONNECT (rl_contender, localhost, root,,);
+
+CONNECTION rl_holder;
+SELECT GET_LOCK('B26162',120);
+
+CONNECTION rl_acquirer;
+--send
+SELECT 'rl_acquirer', GET_LOCK('B26162',120), id FROM t2 WHERE id = 1;
+
+CONNECTION wl_acquirer;
+SET SESSION LOW_PRIORITY_UPDATES=1;
+SET GLOBAL LOW_PRIORITY_UPDATES=1;
+#need to wait for rl_acquirer to lock on the B26162 lock
+sleep 2;
+--send
+INSERT INTO t1 VALUES (5);
+
+CONNECTION rl_contender;
+# must not "see" the row inserted by the INSERT (as it must run before the
+# INSERT)
+--send
+SELECT 'rl_contender', id FROM t2 WHERE id > 1;
+
+CONNECTION rl_holder;
+#need to wait for wl_acquirer and rl_contender to lock on t2
+sleep 2;
+SELECT RELEASE_LOCK('B26162');
+
+CONNECTION rl_acquirer;
+--reap
+SELECT RELEASE_LOCK('B26162');
+CONNECTION wl_acquirer;
+--reap
+CONNECTION rl_contender;
+--reap
+
+CONNECTION default;
+DISCONNECT rl_acquirer;
+DISCONNECT wl_acquirer;
+DISCONNECT rl_contender;
+DISCONNECT rl_holder;
+
+DROP TRIGGER t1_test;
+DROP TABLE t1,t2;
+SET SESSION LOW_PRIORITY_UPDATES=DEFAULT;
+SET GLOBAL LOW_PRIORITY_UPDATES=DEFAULT;
+--echo
+--echo Bug#28502 Triggers that update another innodb table will block
+--echo on X lock unnecessarily
+--echo
+--echo Ensure we do not open and lock tables for triggers we do not fire.
+--echo
+--disable_warnings
+drop table if exists t1, t2;
+drop trigger if exists trg_bug28502_au;
+--enable_warnings
+
+create table t1 (id int, count int);
+create table t2 (id int);
+delimiter |;
+
+create trigger trg_bug28502_au before update on t2
+for each row
+begin
+ if (new.id is not null) then
+ update t1 set count= count + 1 where id = old.id;
+ end if;
+end|
+
+delimiter ;|
+insert into t1 (id, count) values (1, 0);
+
+lock table t1 write;
+
+--connect (connection_insert, localhost, root, , test, , )
+connection connection_insert;
+# Is expected to pass.
+insert into t2 set id=1;
+connection default;
+unlock tables;
+update t2 set id=1 where id=1;
+select * from t1;
+select * from t2;
+# Will drop the trigger
+drop table t1, t2;
+disconnect connection_insert;
+--echo
+--echo Additionally, provide test coverage for triggers and
+--echo all MySQL data changing commands.
+--echo
+--disable_warnings
+drop table if exists t1, t2, t1_op_log;
+drop view if exists v1;
+drop trigger if exists trg_bug28502_bi;
+drop trigger if exists trg_bug28502_ai;
+drop trigger if exists trg_bug28502_bu;
+drop trigger if exists trg_bug28502_au;
+drop trigger if exists trg_bug28502_bd;
+drop trigger if exists trg_bug28502_ad;
+--enable_warnings
+create table t1 (id int primary key auto_increment, operation varchar(255));
+create table t2 (id int primary key);
+create table t1_op_log(operation varchar(255));
+create view v1 as select * from t1;
+create trigger trg_bug28502_bi before insert on t1
+for each row
+ insert into t1_op_log (operation)
+ values (concat("Before INSERT, new=", new.operation));
+
+create trigger trg_bug28502_ai after insert on t1
+for each row
+ insert into t1_op_log (operation)
+ values (concat("After INSERT, new=", new.operation));
+
+create trigger trg_bug28502_bu before update on t1
+for each row
+ insert into t1_op_log (operation)
+ values (concat("Before UPDATE, new=", new.operation,
+ ", old=", old.operation));
+
+create trigger trg_bug28502_au after update on t1
+for each row
+ insert into t1_op_log (operation)
+ values (concat("After UPDATE, new=", new.operation,
+ ", old=", old.operation));
+
+create trigger trg_bug28502_bd before delete on t1
+for each row
+ insert into t1_op_log (operation)
+ values (concat("Before DELETE, old=", old.operation));
+
+create trigger trg_bug28502_ad after delete on t1
+for each row
+ insert into t1_op_log (operation)
+ values (concat("After DELETE, old=", old.operation));
+
+insert into t1 (operation) values ("INSERT");
+
+set @id=last_insert_id();
+
+select * from t1;
+select * from t1_op_log;
+truncate t1_op_log;
+
+update t1 set operation="UPDATE" where id=@id;
+
+select * from t1;
+select * from t1_op_log;
+truncate t1_op_log;
+
+delete from t1 where id=@id;
+
+select * from t1;
+select * from t1_op_log;
+truncate t1;
+truncate t1_op_log;
+
+insert into t1 (id, operation) values
+(NULL, "INSERT ON DUPLICATE KEY UPDATE, inserting a new key")
+on duplicate key update id=NULL, operation="Should never happen";
+
+set @id=last_insert_id();
+
+select * from t1;
+select * from t1_op_log;
+truncate t1_op_log;
+
+insert into t1 (id, operation) values
+(@id, "INSERT ON DUPLICATE KEY UPDATE, the key value is the same")
+on duplicate key update id=NULL,
+operation="INSERT ON DUPLICATE KEY UPDATE, updating the duplicate";
+
+select * from t1;
+select * from t1_op_log;
+truncate t1;
+truncate t1_op_log;
+
+replace into t1 values (NULL, "REPLACE, inserting a new key");
+
+set @id=last_insert_id();
+
+select * from t1;
+select * from t1_op_log;
+truncate t1_op_log;
+
+replace into t1 values (@id, "REPLACE, deleting the duplicate");
+
+select * from t1;
+select * from t1_op_log;
+truncate t1;
+truncate t1_op_log;
+
+create table if not exists t1
+select NULL, "CREATE TABLE ... SELECT, inserting a new key";
+
+set @id=last_insert_id();
+
+select * from t1;
+select * from t1_op_log;
+truncate t1_op_log;
+
+create table if not exists t1 replace
+select @id, "CREATE TABLE ... REPLACE SELECT, deleting a duplicate key";
+
+select * from t1;
+select * from t1_op_log;
+truncate t1;
+truncate t1_op_log;
+
+insert into t1 (id, operation)
+select NULL, "INSERT ... SELECT, inserting a new key";
+
+set @id=last_insert_id();
+
+select * from t1;
+select * from t1_op_log;
+truncate t1_op_log;
+
+insert into t1 (id, operation)
+select @id,
+"INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate"
+on duplicate key update id=NULL,
+operation="INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate";
+
+select * from t1;
+select * from t1_op_log;
+truncate t1;
+truncate t1_op_log;
+
+replace into t1 (id, operation)
+select NULL, "REPLACE ... SELECT, inserting a new key";
+
+set @id=last_insert_id();
+
+select * from t1;
+select * from t1_op_log;
+truncate t1_op_log;
+
+replace into t1 (id, operation)
+select @id, "REPLACE ... SELECT, deleting a duplicate";
+
+select * from t1;
+select * from t1_op_log;
+truncate t1;
+truncate t1_op_log;
+
+insert into t1 (id, operation) values (1, "INSERT for multi-DELETE");
+insert into t2 (id) values (1);
+
+delete t1.*, t2.* from t1, t2 where t1.id=1;
+
+select * from t1;
+select * from t2;
+select * from t1_op_log;
+truncate t1;
+truncate t2;
+truncate t1_op_log;
+
+insert into t1 (id, operation) values (1, "INSERT for multi-UPDATE");
+insert into t2 (id) values (1);
+update t1, t2 set t1.id=2, operation="multi-UPDATE" where t1.id=1;
+update t1, t2
+set t2.id=3, operation="multi-UPDATE, SET for t2, but the trigger is fired" where t1.id=2;
+
+select * from t1;
+select * from t2;
+select * from t1_op_log;
+truncate table t1;
+truncate table t2;
+truncate table t1_op_log;
+
+--echo
+--echo Now do the same but use a view instead of the base table.
+--echo
+
+insert into v1 (operation) values ("INSERT");
+
+set @id=last_insert_id();
+
+select * from t1;
+select * from t1_op_log;
+truncate t1_op_log;
+
+update v1 set operation="UPDATE" where id=@id;
+
+select * from t1;
+select * from t1_op_log;
+truncate t1_op_log;
+
+delete from v1 where id=@id;
+
+select * from t1;
+select * from t1_op_log;
+truncate t1;
+truncate t1_op_log;
+
+insert into v1 (id, operation) values
+(NULL, "INSERT ON DUPLICATE KEY UPDATE, inserting a new key")
+on duplicate key update id=NULL, operation="Should never happen";
+
+set @id=last_insert_id();
+
+select * from t1;
+select * from t1_op_log;
+truncate t1_op_log;
+
+insert into v1 (id, operation) values
+(@id, "INSERT ON DUPLICATE KEY UPDATE, the key value is the same")
+on duplicate key update id=NULL,
+operation="INSERT ON DUPLICATE KEY UPDATE, updating the duplicate";
+
+select * from t1;
+select * from t1_op_log;
+truncate t1;
+truncate t1_op_log;
+
+replace into v1 values (NULL, "REPLACE, inserting a new key");
+
+set @id=last_insert_id();
+
+select * from t1;
+select * from t1_op_log;
+truncate t1_op_log;
+
+replace into v1 values (@id, "REPLACE, deleting the duplicate");
+
+select * from t1;
+select * from t1_op_log;
+truncate t1;
+truncate t1_op_log;
+
+create table if not exists v1
+select NULL, "CREATE TABLE ... SELECT, inserting a new key";
+
+set @id=last_insert_id();
+
+select * from t1;
+select * from t1_op_log;
+truncate t1_op_log;
+
+create table if not exists v1 replace
+select @id, "CREATE TABLE ... REPLACE SELECT, deleting a duplicate key";
+
+select * from t1;
+select * from t1_op_log;
+truncate t1;
+truncate t1_op_log;
+
+insert into v1 (id, operation)
+select NULL, "INSERT ... SELECT, inserting a new key";
+
+set @id=last_insert_id();
+
+select * from t1;
+select * from t1_op_log;
+truncate t1_op_log;
+
+insert into v1 (id, operation)
+select @id,
+"INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate"
+on duplicate key update id=NULL,
+operation="INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate";
+
+select * from t1;
+select * from t1_op_log;
+truncate t1;
+truncate t1_op_log;
+
+replace into v1 (id, operation)
+select NULL, "REPLACE ... SELECT, inserting a new key";
+
+set @id=last_insert_id();
+
+select * from t1;
+select * from t1_op_log;
+truncate t1_op_log;
+
+replace into v1 (id, operation)
+select @id, "REPLACE ... SELECT, deleting a duplicate";
+
+select * from t1;
+select * from t1_op_log;
+truncate t1;
+truncate t1_op_log;
+
+insert into v1 (id, operation) values (1, "INSERT for multi-DELETE");
+insert into t2 (id) values (1);
+
+delete v1.*, t2.* from v1, t2 where v1.id=1;
+
+select * from t1;
+select * from t2;
+select * from t1_op_log;
+truncate t1;
+truncate t2;
+truncate t1_op_log;
+
+insert into v1 (id, operation) values (1, "INSERT for multi-UPDATE");
+insert into t2 (id) values (1);
+update v1, t2 set v1.id=2, operation="multi-UPDATE" where v1.id=1;
+update v1, t2
+set t2.id=3, operation="multi-UPDATE, SET for t2, but the trigger is fired" where v1.id=2;
+
+select * from t1;
+select * from t2;
+select * from t1_op_log;
+
+drop view v1;
+drop table t1, t2, t1_op_log;
+
+#
+# TODO: test LOAD DATA INFILE
+#
+--echo
+--echo Bug#27248 Triggers: error if insert affects temporary table
+--echo
+--echo The bug was fixed by the fix for Bug#26141
+--echo
+--disable_warnings
+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;
+delete from t1;
+select * from t1;
+select * from t2;
+drop table t1;
+drop temporary table t2;
--echo End of 5.0 tests
+
+#
+# Bug#25411 (trigger code truncated)
+#
+
+--disable_warnings
+drop table if exists table_25411_a;
+drop table if exists table_25411_b;
+--enable_warnings
+
+create table table_25411_a(a int);
+create table table_25411_b(b int);
+
+create trigger trg_25411a_ai after insert on table_25411_a
+for each row
+ insert into table_25411_b select new.*;
+
+select * from table_25411_a;
+
+--error ER_BAD_TABLE_ERROR
+insert into table_25411_a values (1);
+
+select * from table_25411_a;
+
+drop table table_25411_a;
+drop table table_25411_b;
+
diff --git a/mysql-test/t/type_binary.test b/mysql-test/t/type_binary.test
index a09e487f6cb..4d5a5312472 100644
--- a/mysql-test/t/type_binary.test
+++ b/mysql-test/t/type_binary.test
@@ -31,7 +31,7 @@ drop table t1;
create table t1 (s1 binary(2) primary key);
insert into t1 values (0x01);
insert into t1 values (0x0120);
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 values (0x0100);
select hex(s1) from t1 order by s1;
# check index search
diff --git a/mysql-test/t/type_bit.test b/mysql-test/t/type_bit.test
index 8141bdedd50..b9d93c28115 100644
--- a/mysql-test/t/type_bit.test
+++ b/mysql-test/t/type_bit.test
@@ -39,7 +39,7 @@ drop table t1;
create table t1 (a bit);
insert into t1 values (b'0'), (b'1'), (b'000'), (b'100'), (b'001');
select hex(a) from t1;
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
alter table t1 add unique (a);
drop table t1;
@@ -272,4 +272,67 @@ handler t1 read a=(1);
handler t1 close;
drop table t1;
+#
+# Bug #30219: GROUP BY a column of the BIT type
+#
+
+CREATE TABLE t1 (b BIT(2), a VARCHAR(5));
+INSERT INTO t1 (b, a) VALUES (1, "x"), (3, "zz"), (0, "y"), (3, "z");
+SELECT b+0, COUNT(DISTINCT a) FROM t1 GROUP BY b;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a CHAR(5), b BIT(2));
+INSERT INTO t1 (b, a) VALUES (1, "x"), (3, "zz"), (0, "y"), (3, "z");
+SELECT b+0, COUNT(DISTINCT a) FROM t1 GROUP BY b;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a INT, b BIT(2));
+INSERT INTO t1 (b, a) VALUES (1, 1), (3, 2), (0, 3), (3, 4);
+SELECT b+0, COUNT(DISTINCT a) FROM t1 GROUP BY b;
+DROP TABLE t1;
+
+#
+# Bug#30245: A wrong type of a BIT field is reported when grouped by it.
+#
+CREATE TABLE t1 (b BIT);
+INSERT INTO t1 (b) VALUES (1), (0);
+--enable_metadata
+--replace_column 1 #
+SELECT DISTINCT b FROM t1;
+--replace_column 1 #
+SELECT b FROM t1 GROUP BY b;
+--disable_metadata
+DROP TABLE t1;
+
+#
+# BUG#30324 Wrong query result for COUNT(DISTINCT(bit_column))
+#
+CREATE TABLE t1 (a int, b bit(2));
+INSERT INTO t1 VALUES (3, 2), (2, 3), (2, 0), (3, 2), (3, 1);
+SELECT COUNT(DISTINCT b) FROM t1 GROUP BY a;
+DROP TABLE t1;
+
+create table t2 (a int, b bit(2), c char(10));
+INSERT INTO t2 VALUES (3, 2, 'two'), (2, 3, 'three'), (2, 0, 'zero'),
+ (3, 2, 'two'), (3, 1, 'one');
+SELECT COUNT(DISTINCT b,c) FROM t2 GROUP BY a;
+DROP TABLE t2;
+
--echo End of 5.0 tests
+
+#
+# Bug #28631: problem after alter
+#
+create table t1(a bit(7));
+insert into t1 values(0x40);
+alter table t1 modify column a bit(8);
+select hex(a) from t1;
+insert into t1 values(0x80);
+select hex(a) from t1;
+create index a on t1(a);
+insert into t1 values(0x81);
+select hex(a) from t1;
+show create table t1;
+drop table t1;
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/type_bit_innodb.test b/mysql-test/t/type_bit_innodb.test
index 4ee97782452..85c9127b2f6 100644
--- a/mysql-test/t/type_bit_innodb.test
+++ b/mysql-test/t/type_bit_innodb.test
@@ -40,7 +40,7 @@ drop table t1;
create table t1 (a bit) engine=innodb;
insert into t1 values (b'0'), (b'1'), (b'000'), (b'100'), (b'001');
select hex(a) from t1;
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
alter table t1 add unique (a);
drop table t1;
diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test
index e08b2de0f85..b6febf8e76d 100644
--- a/mysql-test/t/type_blob.test
+++ b/mysql-test/t/type_blob.test
@@ -333,9 +333,9 @@ drop table t1;
#
create table t1 (id integer primary key auto_increment, txt text not null, unique index txt_index (txt (20)));
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 (txt) values ('Chevy'), ('Chevy ');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
insert into t1 (txt) values ('Chevy'), ('CHEVY');
alter table t1 drop index txt_index, add index txt_index (txt(20));
insert into t1 (txt) values ('Chevy ');
diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test
index 02cd07e3c16..dcee4fd2ffc 100644
--- a/mysql-test/t/type_date.test
+++ b/mysql-test/t/type_date.test
@@ -128,9 +128,12 @@ drop table t1;
# Bug #23093: Implicit conversion of 9912101 to date does not match
# cast(9912101 as date)
#
-select @d:=1111, year(@d), month(@d), day(@d), cast(@d as date);
-select @d:=011111, year(@d), month(@d), day(@d), cast(@d as date);
-select @d:=1311, year(@d), month(@d), day(@d), cast(@d as date);
+select @d:=1111;
+select year(@d), month(@d), day(@d), cast(@d as date);
+select @d:=011111;
+select year(@d), month(@d), day(@d), cast(@d as date);
+select @d:=1311;
+select year(@d), month(@d), day(@d), cast(@d as date);
create table t1 (d date , dt datetime , ts timestamp);
insert into t1 values (9912101,9912101,9912101);
insert into t1 values (11111,11111,11111);
diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test
index 7a728a09831..d8d137d81e6 100644
--- a/mysql-test/t/type_datetime.test
+++ b/mysql-test/t/type_datetime.test
@@ -141,6 +141,31 @@ SELECT CAST(CAST('2006-08-10 10:11:12' AS DATETIME) AS DECIMAL(20,6));
SELECT CAST(CAST('2006-08-10 10:11:12' AS DATETIME) + INTERVAL 14 MICROSECOND AS DECIMAL(20,6));
SELECT CAST(CAST('10:11:12.098700' AS TIME) AS DECIMAL(20,6));
+
+#
+# Test of storing datetime into date fields
+#
+
+set @org_mode=@@sql_mode;
+create table t1 (da date default '1962-03-03 23:33:34', dt datetime default '1962-03-03');
+show create table t1;
+insert into t1 values ();
+insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38');
+set @@sql_mode='ansi,traditional';
+insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38');
+insert into t1 set dt='2007-03-23 13:49:38',da=dt;
+# Test error handling
+--error 1292
+insert into t1 values ('2007-03-32','2007-03-23 13:49:38');
+select * from t1;
+drop table t1;
+--error 1067
+create table t1 (da date default '1962-03-32 23:33:34', dt datetime default '1962-03-03');
+--error 1067
+create table t1 (t time default '916:00:00 a');
+set @@sql_mode= @org_mode;
+
+
#
# Bug#27590: Wrong DATE/DATETIME comparison.
#
@@ -180,6 +205,25 @@ SELECT 1 from dual where NOW() BETWEEN CURRENT_DATE() - INTERVAL 1 DAY AND CURRE
drop table t1;
#
+# Bug#28133: Wrong DATE/DATETIME comparison in IN() function.
+#
+create table t1 (f1 date);
+insert into t1 values('01-01-01'),('01-01-02'),('01-01-03');
+select * from t1 where f1 in ('01-01-01','2001-01-02','2001-01-03 00:00:00');
+create table t2(f2 datetime);
+insert into t2 values('01-01-01 00:00:00'),('01-02-03 12:34:56'),('02-04-06 11:22:33');
+select * from t2 where f2 in ('01-01-01','01-02-03 12:34:56','01-02-03');
+select * from t1,t2 where '01-01-02' in (f1, cast(f2 as date));
+select * from t1,t2 where '01-01-01' in (f1, '01-02-03');
+select * from t1,t2 where if(1,'01-02-03 12:34:56','') in (f1, f2);
+create table t3(f3 varchar(20));
+insert into t3 select * from t2;
+select * from t2,t3 where f2 in (f3,'03-04-05');
+select f1,f2,f3 from t1,t2,t3 where (f1,'1') in ((f2,'1'),(f3,'1'));
+select f1 from t1 where ('1',f1) in (('1','01-01-01'),('1','2001-1-1 0:0:0'),('1','02-02-02'));
+drop table t1,t2,t3;
+
+#
# Bug#27759: Wrong DATE/DATETIME comparison in LEAST()/GREATEST() functions.
#
select least(cast('01-01-01' as date), '01-01-02');
@@ -187,6 +231,8 @@ select greatest(cast('01-01-01' as date), '01-01-02');
select least(cast('01-01-01' as date), '01-01-02') + 0;
select greatest(cast('01-01-01' as date), '01-01-02') + 0;
select least(cast('01-01-01' as datetime), '01-01-02') + 0;
+select cast(least(cast('01-01-01' as datetime), '01-01-02') as signed);
+select cast(least(cast('01-01-01' as datetime), '01-01-02') as decimal(16,2));
--disable_warnings
DROP PROCEDURE IF EXISTS test27759 ;
--enable_warnings
@@ -206,6 +252,38 @@ call test27759();
drop procedure test27759;
#
+# Bug#28208: Wrong result of a non-const STRING function with a const
+# DATETIME function.
+#
+create table t1 (f1 date);
+insert into t1 values (curdate());
+select left(f1,10) = curdate() from t1;
+drop table t1;
+
+#
+# Bug#28261: Wrong DATETIME comparison result when the GET_USER_VAR function
+# is involved.
+#
+create table t1(f1 date);
+insert into t1 values('01-01-01'),('02-02-02'),('01-01-01'),('02-02-02');
+set @bug28261='';
+select if(@bug28261 = f1, '', @bug28261:= f1) from t1;
+select if(@bug28261 = f1, '', @bug28261:= f1) from t1;
+select if(@bug28261 = f1, '', @bug28261:= f1) from t1;
+drop table t1;
+
+#
+# Bug#28778: Wrong result of BETWEEN when comparing a DATETIME field with an
+# integer constants.
+#
+create table t1(f1 datetime);
+insert into t1 values('2001-01-01'),('2002-02-02');
+select * from t1 where f1 between 20020101 and 20070101000000;
+select * from t1 where f1 between 2002010 and 20070101000000;
+select * from t1 where f1 between 20020101 and 2007010100000;
+drop table t1;
+
+#
# Test of storing datetime into date fields
#
diff --git a/mysql-test/t/type_decimal.test b/mysql-test/t/type_decimal.test
index 4fdb0c8458f..5538f19f5f9 100644
--- a/mysql-test/t/type_decimal.test
+++ b/mysql-test/t/type_decimal.test
@@ -394,3 +394,17 @@ create table t1 as
from (select 1 as s,'t' as t union select null, null ) as sub1;
select group_concat(t) from t1 group by week(date)/10;
drop table t1;
+
+#
+# Bug#28980: ROUND(<dec expr>, <int col>) returned double values
+#
+
+CREATE TABLE t1 (
+ qty decimal(16,6) default NULL,
+ dps tinyint(3) unsigned default NULL
+);
+INSERT INTO t1 VALUES (1.1325,3);
+
+SELECT ROUND(qty,3), dps, ROUND(qty,dps) FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-test/t/type_enum.test b/mysql-test/t/type_enum.test
index 9be1b7fa10f..2043342e2c8 100644
--- a/mysql-test/t/type_enum.test
+++ b/mysql-test/t/type_enum.test
@@ -136,8 +136,6 @@ alter table t1 add f2 enum(0xFFFF);
show create table t1;
drop table t1;
---echo End of 4.1 tests
-
#
# Bug#24660 "enum" field type definition problem
#
@@ -158,4 +156,68 @@ drop table t1;
create table t1(exhausting_charset enum('ABCDEFGHIJKLMNOPQRSTUVWXYZ','
 !"','#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~','xx\','yy\€','zz‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ'));
+#
+# Bug #29251: MySQL coerces special 0 enum values to normal '' value
+# when ALTERing the column
+#
+
+CREATE TABLE t1 (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ c1 ENUM('a', '', 'b')
+);
+INSERT INTO t1 (c1) VALUES (0), ('a'), (''), ('b');
+SELECT id, c1 + 0, c1 FROM t1;
+
+ALTER TABLE t1 CHANGE c1 c1 ENUM('a', '') NOT NULL;
+SELECT id, c1 + 0, c1 FROM t1;
+
+DROP TABLE t1;
+
+--echo End of 4.1 tests
+
+#
+# Bug#28729: Field_enum wrongly reported an error while storing an empty string.
+#
+create table t1(f1 set('a','b'), index(f1));
+insert into t1 values(''),(''),('a'),('b');
+select * from t1 where f1='';
+drop table t1;
+
+#
+# Bug#29360: Confluence of the special 0 enum value with the normal empty string
+# value during field to field copy.
+#
+
+CREATE TABLE t1 (c1 ENUM('a', '', 'b'));
+INSERT INTO t1 (c1) VALUES ('b');
+INSERT INTO t1 (c1) VALUES ('');
+INSERT INTO t1 (c1) VALUES (0);
+INSERT INTO t1 (c1) VALUES ('');
+
+SELECT c1 + 0, COUNT(c1) FROM t1 GROUP BY c1;
+
+CREATE TABLE t2 SELECT * FROM t1;
+SELECT c1 + 0 FROM t2;
+
+DROP TABLE t1,t2;
+
+#
+# Bug#29661: Lookup by 0 for a primary index over a enum type
+#
+
+CREATE TABLE t1(a enum('a','b','c','d'));
+INSERT INTO t1 VALUES (4),(1),(0),(3);
+
+SELECT a FROM t1;
+
+EXPLAIN SELECT a FROM t1 WHERE a=0;
+SELECT a FROM t1 WHERE a=0;
+
+ALTER TABLE t1 ADD PRIMARY KEY (a);
+
+EXPLAIN SELECT a FROM t1 WHERE a=0;
+SELECT a FROM t1 WHERE a=0;
+
+DROP TABLE t1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test
index f790bcf6daa..a55200c8853 100644
--- a/mysql-test/t/type_float.test
+++ b/mysql-test/t/type_float.test
@@ -222,3 +222,23 @@ drop table t1;
create table t1 (s1 float(0,2));
--error 1427
create table t1 (s1 float(1,2));
+
+#
+# Bug #28121 "INSERT or UPDATE into DOUBLE(200,0) field being truncated to 31 digits"
+#
+
+create table t1 (f1 double(200, 0));
+insert into t1 values (1e199), (-1e199);
+insert into t1 values (1e200), (-1e200);
+insert into t1 values (2e200), (-2e200);
+select f1 + 0e0 from t1;
+drop table t1;
+
+create table t1 (f1 float(30, 0));
+insert into t1 values (1e29), (-1e29);
+insert into t1 values (1e30), (-1e30);
+insert into t1 values (2e30), (-2e30);
+select f1 + 0e0 from t1;
+drop table t1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test
index b8c05d62720..b1776d09744 100644
--- a/mysql-test/t/type_newdecimal.test
+++ b/mysql-test/t/type_newdecimal.test
@@ -1140,6 +1140,71 @@ alter table t1 modify column a decimal(19);
select * from t1;
drop table t1;
+#
+# Bug #27957 cast as decimal does not check overflow, also inconsistent with group, subselect
+#
+
+select cast(11.1234 as DECIMAL(3,2));
+select * from (select cast(11.1234 as DECIMAL(3,2))) t;
+
+select cast(a as DECIMAL(3,2))
+ from (select 11.1233 as a
+ UNION select 11.1234
+ UNION select 12.1234
+ ) t;
+
+select cast(a as DECIMAL(3,2)), count(*)
+ from (select 11.1233 as a
+ UNION select 11.1234
+ UNION select 12.1234
+ ) t group by 1;
+
+#
+# Bug #28361 Buffer overflow in DECIMAL code on Windows
+#
+
+create table t1 (s varchar(100));
+insert into t1 values (0.00000000010000000000000000364321973154977415791655470655996396089904010295867919921875);
+drop table t1;
+
+#
+# Bug #27984 Long Decimal Maths produces truncated results
+#
+
+SELECT 1.000000000000 * 99.999999999998 / 100 a,1.000000000000 * (99.999999999998 / 100) b;
+
+#
+# Bug #29415: CAST AS DECIMAL(P,S) with too big precision/scale
+#
+
+SELECT CAST(1 AS decimal(65,10));
+--error ER_TOO_BIG_PRECISION
+SELECT CAST(1 AS decimal(66,10));
+
+SELECT CAST(1 AS decimal(65,30));
+--error ER_TOO_BIG_SCALE
+SELECT CAST(1 AS decimal(65,31));
+
+CREATE TABLE t1 (a int DEFAULT NULL, b int DEFAULT NULL);
+INSERT INTO t1 VALUES (3,30), (1,10), (2,10);
+SELECT a+CAST(1 AS decimal(65,30)) AS aa, SUM(b) FROM t1 GROUP BY aa;
+--error ER_TOO_BIG_SCALE
+SELECT a+CAST(1 AS decimal(65,31)) AS aa, SUM(b) FROM t1 GROUP BY aa;
+
+DROP TABLE t1;
+
+#
+# Bug #29417: assertion abort for a grouping query with decimal user variable
+#
+
+CREATE TABLE t1 (a int DEFAULT NULL, b int DEFAULT NULL);
+INSERT INTO t1 VALUES (3,30), (1,10), (2,10);
+
+SET @a= CAST(1 AS decimal);
+SELECT 1 FROM t1 GROUP BY @b := @a, @b;
+
+DROP TABLE t1;
+
--echo End of 5.0 tests
#
diff --git a/mysql-test/t/type_time.test b/mysql-test/t/type_time.test
index cb7e4f85ad1..5fc763be7fe 100644
--- a/mysql-test/t/type_time.test
+++ b/mysql-test/t/type_time.test
@@ -40,3 +40,40 @@ drop table t1;
# ##########################################################
# End of 4.1 tests
+
+#
+# Bug#29555: Comparing time values as strings may lead to a wrong result.
+#
+select cast('100:55:50' as time) < cast('24:00:00' as time);
+select cast('100:55:50' as time) < cast('024:00:00' as time);
+select cast('300:55:50' as time) < cast('240:00:00' as time);
+select cast('100:55:50' as time) > cast('24:00:00' as time);
+select cast('100:55:50' as time) > cast('024:00:00' as time);
+select cast('300:55:50' as time) > cast('240:00:00' as time);
+create table t1 (f1 time);
+insert into t1 values ('24:00:00');
+select cast('24:00:00' as time) = (select f1 from t1);
+drop table t1;
+
+#
+# Bug#29739: Incorrect time comparison in BETWEEN.
+#
+create table t1(f1 time, f2 time);
+insert into t1 values('20:00:00','150:00:00');
+select 1 from t1 where cast('100:00:00' as time) between f1 and f2;
+drop table t1;
+
+#
+# Bug#29729: Wrong conversion error led to an empty result set.
+#
+CREATE TABLE t1 (
+ f2 date NOT NULL,
+ f3 int(11) unsigned NOT NULL default '0',
+ PRIMARY KEY (f3, f2)
+);
+insert into t1 values('2007-07-01', 1);
+insert into t1 values('2007-07-01', 2);
+insert into t1 values('2007-07-02', 1);
+insert into t1 values('2007-07-02', 2);
+SELECT sum(f3) FROM t1 where f2='2007-07-01 00:00:00' group by f2;
+drop table t1;
diff --git a/mysql-test/t/type_varchar.test b/mysql-test/t/type_varchar.test
index 1b27a92e95c..1eb949a21e3 100644
--- a/mysql-test/t/type_varchar.test
+++ b/mysql-test/t/type_varchar.test
@@ -25,7 +25,7 @@ select v='a' from t1;
select binary v='a' from t1;
select binary v='a ' from t1;
insert into t1 values('a');
---error ER_DUP_ENTRY_WITH_KEY_NAME
+--error ER_DUP_ENTRY
alter table t1 add primary key (v);
drop table t1;
create table t1 (v varbinary(20));
diff --git a/mysql-test/t/udf-master.opt b/mysql-test/t/udf-master.opt
new file mode 100644
index 00000000000..7d8786c156a
--- /dev/null
+++ b/mysql-test/t/udf-master.opt
@@ -0,0 +1 @@
+$UDF_EXAMPLE_LIB_OPT
diff --git a/mysql-test/t/udf.test b/mysql-test/t/udf.test
index 7d870a86bc8..2f1d197cb9e 100644
--- a/mysql-test/t/udf.test
+++ b/mysql-test/t/udf.test
@@ -340,4 +340,64 @@ drop function metaphon;
drop function myfunc_double;
drop function myfunc_int;
+#
+# Bug #28921: Queries containing UDF functions are cached
+#
+
+--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
+eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
+create table t1 (a char);
+
+set GLOBAL query_cache_size=1355776;
+reset query cache;
+
+select metaphon('MySQL') from t1;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+
+select metaphon('MySQL') from t1;
+show status like "Qcache_hits";
+show status like "Qcache_queries_in_cache";
+
+drop table t1;
+drop function metaphon;
+set GLOBAL query_cache_size=default;
+
+
+#
+# Bug #29804 UDF parameters don't contain correct string length
+#
+
+CREATE TABLE const_len_bug (
+ str_const varchar(4000),
+ result1 varchar(4000),
+ result2 varchar(4000)
+);
+
+DELIMITER |;
+CREATE TRIGGER check_const_len_trigger BEFORE INSERT ON const_len_bug FOR EACH ROW BEGIN
+ set NEW.str_const = 'bar';
+ set NEW.result2 = check_const_len(NEW.str_const);
+END |
+
+CREATE PROCEDURE check_const_len_sp (IN str_const VARCHAR(4000))
+BEGIN
+DECLARE result VARCHAR(4000);
+SET result = check_const_len(str_const);
+insert into const_len_bug values(str_const, result, "");
+END |
+DELIMITER ;|
+
+--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
+eval CREATE FUNCTION check_const_len RETURNS string SONAME "$UDF_EXAMPLE_LIB";
+
+CALL check_const_len_sp("foo");
+
+SELECT * from const_len_bug;
+
+DROP FUNCTION check_const_len;
+DROP PROCEDURE check_const_len_sp;
+DROP TRIGGER check_const_len_trigger;
+DROP TABLE const_len_bug;
+
--echo End of 5.0 tests.
diff --git a/mysql-test/t/user_var-binlog.test b/mysql-test/t/user_var-binlog.test
index 3ce01a0927b..70f2f0fa7a6 100644
--- a/mysql-test/t/user_var-binlog.test
+++ b/mysql-test/t/user_var-binlog.test
@@ -1,8 +1,6 @@
# Requires statement logging
-- source include/have_binlog_format_mixed_or_statement.inc
# TODO: Create row based version once $MYSQL_BINLOG has new RB version
-# Embedded server does not support binlogging
---source include/not_embedded.inc
# Check that user variables are binlogged correctly (BUG#3875)
create table t1 (a varchar(50));
diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test
index 70f57fdf283..3a3e8f88f83 100644
--- a/mysql-test/t/user_var.test
+++ b/mysql-test/t/user_var.test
@@ -222,3 +222,18 @@ drop table t1,t2;
insert into city 'blah';
SHOW COUNT(*) WARNINGS;
SHOW COUNT(*) ERRORS;
+
+#
+# Bug#28494: Grouping by Item_func_set_user_var produces incorrect result.
+#
+create table t1(f1 int, f2 varchar(2), f3 float, f4 decimal(2,1));
+insert into t1 values
+ (1, "a", 1.5, 1.6), (1, "a", 1.5, 1.6), (2, "b", 2.5, 2.6),
+ (3, "c", 3.5, 3.6), (4, "d", 4.5, 4.6), (1, "a", 1.5, 1.6),
+ (3, "c", 3.5, 3.6), (1, "a", 1.5, 1.6);
+select @a:=f1, count(f1) from t1 group by 1 desc;
+select @a:=f1, count(f1) from t1 group by 1 asc;
+select @a:=f2, count(f2) from t1 group by 1 desc;
+select @a:=f3, count(f3) from t1 group by 1 desc;
+select @a:=f4, count(f4) from t1 group by 1 desc;
+drop table t1;
diff --git a/mysql-test/t/varbinary.test b/mysql-test/t/varbinary.test
index 2d055920c22..9ccbac7cdda 100644
--- a/mysql-test/t/varbinary.test
+++ b/mysql-test/t/varbinary.test
@@ -85,3 +85,22 @@ alter table t1 modify a varchar(255);
select length(a) from t1;
drop table t1;
+
+#
+# Bug#28127 (Some valid identifiers names are not parsed correctly)
+#
+
+--disable_warnings
+drop table if exists table_28127_a;
+drop table if exists table_28127_b;
+--enable_warnings
+
+create table table_28127_a(0b02 int);
+show create table table_28127_a;
+
+create table table_28127_b(0b2 int);
+show create table table_28127_b;
+
+drop table table_28127_a;
+drop table table_28127_b;
+
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index 12d8a89fd08..81db143b518 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -150,14 +150,14 @@ set global net_retry_count=10, session net_retry_count=10;
set global net_buffer_length=1024, net_write_timeout=200, net_read_timeout=300;
set session net_buffer_length=2048, net_write_timeout=500, net_read_timeout=600;
show global variables like 'net_%';
-select * from information_schema.global_variables where variable_name like 'net_%';
+select * from information_schema.global_variables where variable_name like 'net_%' order by 1;
show session variables like 'net_%';
-select * from information_schema.session_variables where variable_name like 'net_%';
+select * from information_schema.session_variables where variable_name like 'net_%' order by 1;
set session net_buffer_length=8000, global net_read_timeout=900, net_write_timeout=1000;
show global variables like 'net_%';
-select * from information_schema.global_variables where variable_name like 'net_%';
+select * from information_schema.global_variables where variable_name like 'net_%' order by 1;
show session variables like 'net_%';
-select * from information_schema.session_variables where variable_name like 'net_%';
+select * from information_schema.session_variables where variable_name like 'net_%' order by 1;
set net_buffer_length=1;
show variables like 'net_buffer_length';
select * from information_schema.session_variables where variable_name like 'net_buffer_length';
@@ -174,7 +174,7 @@ set @@rand_seed1=10000000,@@rand_seed2=1000000;
select ROUND(RAND(),5);
show variables like '%alloc%';
-select * from information_schema.session_variables where variable_name like '%alloc%';
+select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
set @@range_alloc_block_size=1024*16;
set @@query_alloc_block_size=1024*17+2;
set @@query_prealloc_size=1024*18;
@@ -182,12 +182,12 @@ set @@transaction_alloc_block_size=1024*20-1;
set @@transaction_prealloc_size=1024*21-1;
select @@query_alloc_block_size;
show variables like '%alloc%';
-select * from information_schema.session_variables where variable_name like '%alloc%';
+select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
set @@range_alloc_block_size=default;
set @@query_alloc_block_size=default, @@query_prealloc_size=default;
set transaction_alloc_block_size=default, @@transaction_prealloc_size=default;
show variables like '%alloc%';
-select * from information_schema.session_variables where variable_name like '%alloc%';
+select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
#
# Bug #10904 Illegal mix of collations between
@@ -268,7 +268,10 @@ set interactive_timeout=100;
set join_buffer_size=100;
set last_insert_id=1;
set global local_infile=1;
-set long_query_time=100;
+set long_query_time=0.000001;
+select @@long_query_time;
+set long_query_time=100.000001;
+select @@long_query_time;
set low_priority_updates=1;
set max_allowed_packet=100;
set global max_binlog_cache_size=100;
@@ -327,6 +330,7 @@ set tmp_table_size=100;
set tx_isolation="READ-COMMITTED";
set wait_timeout=100;
set log_warnings=1;
+set global log_warnings=1;
#
# Bugs: #20392: INSERT_ID session variable has weird value
@@ -692,7 +696,7 @@ select @@ssl_ca, @@ssl_capath, @@ssl_cert, @@ssl_cipher, @@ssl_key;
--replace_column 2 #
show variables like 'ssl%';
--replace_column 2 #
-select * from information_schema.session_variables where variable_name like 'ssl%';
+select * from information_schema.session_variables where variable_name like 'ssl%' order by 1;
#
# Bug #19616: make log_queries_not_using_indexes available in SHOW VARIABLES
@@ -760,3 +764,9 @@ set global slow_launch_time =@my_slow_launch_time;
set global storage_engine =@my_storage_engine;
set global thread_cache_size =@my_thread_cache_size;
+#
+# Bug#28580 Repeatation of status variables
+#
+--replace_column 2 #
+show global variables where Variable_name='table_definition_cache' or
+Variable_name='table_lock_wait_timeout';
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index a599f948c1e..67354c14cff 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -32,6 +32,7 @@ create view v1 (c,d) as select a,b from t1
# simple view
create view v1 (c) as select b+1 from t1;
select c from v1;
+select is_updatable from information_schema.views where table_name='v1';
# temporary table should not hide table of view
create temporary table t1 (a int, b int);
@@ -228,6 +229,8 @@ create table t1 (a int, b int, primary key(a));
insert into t1 values (10,2), (20,3), (30,4), (40,5), (50,10);
create view v1 (a,c) as select a, b+1 from t1;
create algorithm=temptable view v2 (a,c) as select a, b+1 from t1;
+select is_updatable from information_schema.views where table_name='v2';
+select is_updatable from information_schema.views where table_name='v1';
# try to update expression
-- error 1348
update v1 set c=a+c;
@@ -497,6 +500,7 @@ insert into t1 values(5,'Hello, world of views');
create view v1 as select * from t1;
create view v2 as select * from v1;
update v2 set col2='Hello, view world';
+select is_updatable from information_schema.views;
select * from t1;
drop view v2, v1;
drop table t1;
@@ -748,6 +752,11 @@ drop view v1;
#
# VIEWs with national characters
#
+
+SET @old_cs_client = @@character_set_client;
+SET @old_cs_results = @@character_set_results;
+SET @old_cs_connection = @@character_set_connection;
+
set names utf8;
create table tü (cü char);
create view vü as select cü from tü;
@@ -755,7 +764,10 @@ insert into vü values ('ü');
select * from vü;
drop view vü;
drop table tü;
-set names latin1;
+
+SET character_set_client = @old_cs_client;
+SET character_set_results = @old_cs_results;
+SET character_set_connection = @old_cs_connection;
#
# problem with used_tables() of outer reference resolved in VIEW
@@ -3213,6 +3225,196 @@ EXPLAIN SELECT * FROM t1 UNION SELECT * FROM v1 ORDER BY a;
DROP VIEW v1;
DROP TABLE t1;
+#
+# Bug #27921 View ignores precision for CAST()
+#
+CREATE VIEW v1 AS SELECT CAST( 1.23456789 AS DECIMAL( 7,5 ) ) AS col;
+SELECT * FROM v1;
+DESCRIBE v1;
+DROP VIEW v1;
+
+CREATE VIEW v1 AS SELECT CAST(1.23456789 AS DECIMAL(8,0)) AS col;
+SHOW CREATE VIEW v1;
+DROP VIEW v1;
+
+#
+# Bug #28716: CHECK OPTION expression is evaluated over expired record buffers
+# when VIEW is updated via temporary tables
+#
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (b INT, c INT DEFAULT 0);
+INSERT INTO t1 (a) VALUES (1), (2);
+INSERT INTO t2 (b) VALUES (1), (2);
+CREATE VIEW v1 AS SELECT t2.b,t2.c FROM t1, t2
+ WHERE t1.a=t2.b AND t2.b < 3 WITH CHECK OPTION;
+SELECT * FROM v1;
+UPDATE v1 SET c=1 WHERE b=1;
+SELECT * FROM v1;
+DROP VIEW v1;
+DROP TABLE t1,t2;
+
+#
+# Bug #28561: update on multi-table view with CHECK OPTION and
+# a subquery in WHERE condition
+#
+
+CREATE TABLE t1 (id int);
+CREATE TABLE t2 (id int, c int DEFAULT 0);
+INSERT INTO t1 (id) VALUES (1);
+INSERT INTO t2 (id) VALUES (1);
+
+CREATE VIEW v1 AS
+ SELECT t2.c FROM t1, t2
+ WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION;
+
+UPDATE v1 SET c=1;
+
+DROP VIEW v1;
+DROP TABLE t1,t2;
+
+#
+# Bug #27827: CHECK OPTION ignores ON conditions when updating
+# a multi-table view with CHECK OPTION.
+#
+
+CREATE TABLE t1 (a1 INT, c INT DEFAULT 0);
+CREATE TABLE t2 (a2 INT);
+CREATE TABLE t3 (a3 INT);
+CREATE TABLE t4 (a4 INT);
+INSERT INTO t1 (a1) VALUES (1),(2);
+INSERT INTO t2 (a2) VALUES (1),(2);
+INSERT INTO t3 (a3) VALUES (1),(2);
+INSERT INTO t4 (a4) VALUES (1),(2);
+
+CREATE VIEW v1 AS
+ SELECT t1.a1, t1.c FROM t1 JOIN t2 ON t1.a1=t2.a2 AND t1.c < 3
+ WITH CHECK OPTION;
+SELECT * FROM v1;
+--error 1369
+UPDATE v1 SET c=3;
+PREPARE t FROM 'UPDATE v1 SET c=3';
+--error 1369
+EXECUTE t;
+--error 1369
+EXECUTE t;
+--error 1369
+INSERT INTO v1(a1, c) VALUES (3, 3);
+UPDATE v1 SET c=1 WHERE a1=1;
+SELECT * FROM v1;
+SELECT * FROM t1;
+
+CREATE VIEW v2 AS SELECT t1.a1, t1.c
+ FROM (t1 JOIN t2 ON t1.a1=t2.a2 AND t1.c < 3)
+ JOIN (t3 JOIN t4 ON t3.a3=t4.a4)
+ ON t2.a2=t3.a3 WITH CHECK OPTION;
+SELECT * FROM v2;
+--error 1369
+UPDATE v2 SET c=3;
+PREPARE t FROM 'UPDATE v2 SET c=3';
+--error 1369
+EXECUTE t;
+--error 1369
+EXECUTE t;
+--error 1369
+INSERT INTO v2(a1, c) VALUES (3, 3);
+UPDATE v2 SET c=2 WHERE a1=1;
+SELECT * FROM v2;
+SELECT * FROM t1;
+
+DROP VIEW v1,v2;
+DROP TABLE t1,t2,t3,t4;
+
+#
+# Bug #29104: assertion abort for a query with a view column reference
+# in the GROUP BY list and a condition requiring the value
+# of another view column to be equal to a constant
+#
+
+CREATE TABLE t1 (a int, b int);
+INSERT INTO t1 VALUES (1,2), (2,2), (1,3), (1,2);
+
+CREATE VIEW v1 AS SELECT a, b+1 as b FROM t1;
+
+
+SELECT b, SUM(a) FROM v1 WHERE b=3 GROUP BY b;
+EXPLAIN SELECT b, SUM(a) FROM v1 WHERE b=3 GROUP BY b;
+
+SELECT a, SUM(b) FROM v1 WHERE b=3 GROUP BY a;
+EXPLAIN SELECT a, SUM(b) FROM v1 WHERE b=3 GROUP BY a;
+
+SELECT a, SUM(b) FROM v1 WHERE a=1 GROUP BY a;
+EXPLAIN SELECT a, SUM(b) FROM v1 WHERE a=1 GROUP BY a;
+
+DROP VIEW v1;
+DROP TABLE t1;
+
+#
+# Bug #29392: SELECT over a multi-table view with ORDER BY
+# selecting the same view column with two different aliases
+#
+
+CREATE TABLE t1 (
+ person_id int NOT NULL PRIMARY KEY,
+ username varchar(40) default NULL,
+ status_flg char(1) NOT NULL default 'A'
+);
+
+CREATE TABLE t2 (
+ person_role_id int NOT NULL auto_increment PRIMARY KEY,
+ role_id int NOT NULL,
+ person_id int NOT NULL,
+ INDEX idx_person_id (person_id),
+ INDEX idx_role_id (role_id)
+);
+
+CREATE TABLE t3 (
+ role_id int NOT NULL auto_increment PRIMARY KEY,
+ role_name varchar(100) default NULL,
+ app_name varchar(40) NOT NULL,
+ INDEX idx_app_name(app_name)
+);
+
+CREATE VIEW v1 AS
+SELECT profile.person_id AS person_id
+ FROM t1 profile, t2 userrole, t3 role
+ WHERE userrole.person_id = profile.person_id AND
+ role.role_id = userrole.role_id AND
+ profile.status_flg = 'A'
+ ORDER BY profile.person_id,role.app_name,role.role_name;
+
+INSERT INTO t1 VALUES
+ (6,'Sw','A'), (-1136332546,'ols','e'), (0,' *\n','0'),
+ (-717462680,'ENTS Ta','0'), (-904346964,'ndard SQL\n','0');
+
+INSERT INTO t2 VALUES
+ (1,3,6),(2,4,7),(3,5,8),(4,6,9),(5,1,6),(6,1,7),(7,1,8),(8,1,9),(9,1,10);
+
+INSERT INTO t3 VALUES
+ (1,'NUCANS_APP_USER','NUCANSAPP'),(2,'NUCANS_TRGAPP_USER','NUCANSAPP'),
+ (3,'IA_INTAKE_COORDINATOR','IACANS'),(4,'IA_SCREENER','IACANS'),
+ (5,'IA_SUPERVISOR','IACANS'),(6,'IA_READONLY','IACANS'),
+ (7,'SOC_USER','SOCCANS'),(8,'CAYIT_USER','CAYITCANS'),
+ (9,'RTOS_DCFSPOS_SUPERVISOR','RTOS');
+
+EXPLAIN SELECT t.person_id AS a, t.person_id AS b FROM v1 t WHERE t.person_id=6;
+SELECT t.person_id AS a, t.person_id AS b FROM v1 t WHERE t.person_id=6;
+
+DROP VIEW v1;
+DROP TABLE t1,t2,t3;
+
+#
+# Bug#30020: Insufficient check led to a wrong info provided by the
+# information schema table.
+#
+create table t1 (i int);
+insert into t1 values (1), (2), (1), (3), (2), (4);
+create view v1 as select distinct i from t1;
+select * from v1;
+select table_name, is_updatable from information_schema.views
+ where table_name = 'v1';
+drop view v1;
+drop table t1;
+
--echo End of 5.0 tests.
#
diff --git a/mysql-test/t/warnings-master.opt b/mysql-test/t/warnings-master.opt
index bea071a9c9b..21356507809 100644
--- a/mysql-test/t/warnings-master.opt
+++ b/mysql-test/t/warnings-master.opt
@@ -1 +1 @@
---skip-innodb
+--loose-skip-innodb
diff --git a/mysql-test/t/warnings_engine_disabled-master.opt b/mysql-test/t/warnings_engine_disabled-master.opt
index 99837e4a4cb..f51c1789a16 100644
--- a/mysql-test/t/warnings_engine_disabled-master.opt
+++ b/mysql-test/t/warnings_engine_disabled-master.opt
@@ -1 +1 @@
---loose-skip-ndb
+--loose-skip-plugin-ndbcluster
diff --git a/mysql-test/t/windows_shm-master.opt b/mysql-test/t/windows_shm-master.opt
new file mode 100644
index 00000000000..4476ea16360
--- /dev/null
+++ b/mysql-test/t/windows_shm-master.opt
@@ -0,0 +1 @@
+--skip-grant-tables --loose-shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --loose-shared-memory=1
diff --git a/mysql-test/t/windows_shm.test b/mysql-test/t/windows_shm.test
new file mode 100644
index 00000000000..1c6f05f2da0
--- /dev/null
+++ b/mysql-test/t/windows_shm.test
@@ -0,0 +1,9 @@
+# Windows-specific tests
+--source include/windows.inc
+
+#
+# Bug #24924: shared-memory-base-name that is too long causes buffer overflow
+#
+--exec $MYSQLADMIN --no-defaults --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ping
+
+--echo End of 5.0 tests.
diff --git a/mysql-test/t/xml.test b/mysql-test/t/xml.test
index 8517dce111f..1d16652ab1e 100644
--- a/mysql-test/t/xml.test
+++ b/mysql-test/t/xml.test
@@ -232,6 +232,13 @@ select UpdateXML(@xml, '/a/b/@bb2', '');
select UpdateXML(@xml, '/a/b/@bb2', 'bb3="bb3"');
#
+# Bug#27898 UPDATEXML Crashes the Server!
+#
+select updatexml('<div><div><span>1</span><span>2</span></div></div>',
+ '/','<tr><td>1</td><td>2</td></tr>') as upd1;
+select updatexml('', '/', '') as upd2;
+
+#
# Bug#16234 XML: Crash if ExtractValue()
#
SET @xml= '<order><clerk>lesser wombat</clerk></order>';
@@ -444,3 +451,85 @@ select ExtractValue('<a><parent>test</parent></a>', '/a/parent');
select ExtractValue('<a><preceding>test</preceding></a>', '/a/preceding');
select ExtractValue('<a><preceding-sibling>test</preceding-sibling></a>', '/a/preceding-sibling');
select ExtractValue('<a><self>test</self></a>', '/a/self');
+
+#
+# Bug#26518 XPath and variables problem
+# Check with user defined variables
+#
+set @i=1;
+select ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b[$@i]');
+set @i=2;
+select ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b[$@i]');
+set @i=NULL;
+select ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b[$@i]');
+
+#
+# Check variables in a stored procedure - both local and user variables
+# Make sure that SP and local variables with the same name work together.
+#
+DELIMITER |;
+CREATE PROCEDURE spxml(xml VARCHAR(128))
+BEGIN
+ DECLARE c INT;
+ DECLARE i INT DEFAULT 1;
+ SET c= ExtractValue(xml,'count(/a/b)');
+ SET @i= c;
+ WHILE i <= c DO
+ BEGIN
+ SELECT i, @i, ExtractValue(xml,'/a/b[$i]'), ExtractValue(xml,'/a/b[$@i]');
+ SET i= i + 1;
+ SET @i= @i - 1;
+ END;
+ END WHILE;
+END|
+DELIMITER ;|
+
+call spxml('<a><b>b1</b><b>b2</b><b>b3</b></a>');
+drop procedure spxml;
+
+#
+# Additional tests for bug#26518
+--echo Multiple matches, but no index specification
+SELECT ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b');
+--echo No matches
+SELECT ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/c');
+--echo Index out of range
+SELECT ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b[-1]');
+SELECT ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b[10]');
+--echo With string-to-number conversion
+SELECT ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b["1"]');
+SELECT ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b["1 and string"]');
+SELECT ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b["string and 1"]');
+SELECT ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b["string"]');
+--echo String-to-number conversion from a user variable
+SET @i='1';
+SELECT ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b[$@i]');
+SET @i='1 and string';
+SELECT ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b[$@i]');
+SET @i='string and 1';
+SELECT ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b[$@i]');
+SET @i='string';
+SELECT ExtractValue('<a><b>b1</b><b>b2</b></a>','/a/b[$@i]');
+
+--echo String-to-number conversion with a CHAR SP variable
+DELIMITER |;
+CREATE PROCEDURE spxml(xml VARCHAR(128), i CHAR(16))
+BEGIN
+ SELECT ExtractValue(xml,'/a/b[$i]');
+END|
+DELIMITER ;|
+CALL spxml('<a><b>b1</b><b>b2</b></a>', '1');
+CALL spxml('<a><b>b1</b><b>b2</b></a>', '1 and string');
+CALL spxml('<a><b>b1</b><b>b2</b></a>', 'string and 1');
+CALL spxml('<a><b>b1</b><b>b2</b></a>', 'string');
+DROP PROCEDURE spxml;
+
+#
+# Bug#28558 UpdateXML called with garbage crashes server
+#
+--error 1105
+select UpdateXML('<a>a</a>',repeat('a b ',1000),'');
+--error 1105
+select ExtractValue('<a>a</a>', '/a[@x=@y0123456789_0123456789_0123456789_0123456789]');
+--error 1105
+select ExtractValue('<a>a</a>', '/a[@x=$y0123456789_0123456789_0123456789_0123456789]');
diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp
index 17532d2345f..a4fb488a3d6 100644
--- a/mysql-test/valgrind.supp
+++ b/mysql-test/valgrind.supp
@@ -426,6 +426,23 @@
fun:_dl_map_object
}
+{
+ libc pthread_exit 6
+ Memcheck:Leak
+ fun:malloc
+ fun:_dl_map_object
+ fun:openaux
+ fun:_dl_catch_error
+}
+
+{
+ libc pthread_exit 7
+ Memcheck:Leak
+ fun:malloc
+ fun:dl_open_worker
+ fun:_dl_catch_error
+ fun:_dl_open
+}
#
# This is seen internally in the system libraries on 64-bit RHAS3.
diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt
index 1ae625c4c03..6b24165686a 100644..100755
--- a/mysys/CMakeLists.txt
+++ b/mysys/CMakeLists.txt
@@ -13,19 +13,19 @@
# 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 mysys is linked into libmysql.dll and
-# libmysqld.dll, and __declspec(thread) approach to thread local storage does
-# not work properly in DLLs.
-# Currently, USE_TLS crashes in Debug builds, so until that is fixed Debug
-# .dlls cannot be loaded at runtime.
-SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DUSE_TLS")
-SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DUSE_TLS")
+# 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"
+# Thread Local Storage model.
+#
+# Exception is the embedded server that needs this library compiled with
+# dynamic TLS, i.e. define USE_TLS
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/zlib ${CMAKE_SOURCE_DIR}/include)
-ADD_LIBRARY(mysys array.c charset-def.c charset.c checksum.c default.c default_modify.c
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/zlib ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mysys)
+
+SET(MYSYS_SOURCES array.c charset-def.c charset.c checksum.c default.c default_modify.c
errors.c hash.c list.c md5.c mf_brkhant.c mf_cache.c mf_dirname.c mf_fn_ext.c
mf_format.c mf_getdate.c mf_iocache.c mf_iocache2.c mf_keycache.c
mf_keycaches.c mf_loadpath.c mf_pack.c mf_path.c mf_qsort.c mf_qsort2.c
@@ -42,3 +42,7 @@ ADD_LIBRARY(mysys array.c charset-def.c charset.c checksum.c default.c default_m
my_windac.c my_winthread.c my_write.c ptr_cmp.c queues.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)
+
+IF(NOT SOURCE_SUBLIBS)
+ ADD_LIBRARY(mysys ${MYSYS_SOURCES})
+ENDIF(NOT SOURCE_SUBLIBS)
diff --git a/mysys/array.c b/mysys/array.c
index 60f5b255e18..8a539f18a20 100644
--- a/mysys/array.c
+++ b/mysys/array.c
@@ -22,9 +22,10 @@
Initiate dynamic array
SYNOPSIS
- init_dynamic_array()
+ init_dynamic_array2()
array Pointer to an array
element_size Size of element
+ init_buffer Initial buffer pointer
init_alloc Number of initial elements
alloc_increment Increment for adding new elements
@@ -32,15 +33,16 @@
init_dynamic_array() initiates array and allocate space for
init_alloc eilements.
Array is usable even if space allocation failed.
+ Static buffers must begin immediately after the array structure.
RETURN VALUE
TRUE my_malloc_ci() failed
FALSE Ok
*/
-my_bool init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size,
- uint init_alloc,
- uint alloc_increment CALLER_INFO_PROTO)
+my_bool init_dynamic_array2(DYNAMIC_ARRAY *array, uint element_size,
+ void *init_buffer, uint init_alloc,
+ uint alloc_increment CALLER_INFO_PROTO)
{
DBUG_ENTER("init_dynamic_array");
if (!alloc_increment)
@@ -51,12 +53,17 @@ my_bool init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size,
}
if (!init_alloc)
+ {
init_alloc=alloc_increment;
+ init_buffer= 0;
+ }
array->elements=0;
array->max_element=init_alloc;
array->alloc_increment=alloc_increment;
array->size_of_element=element_size;
- if (!(array->buffer=(char*) my_malloc_ci(element_size*init_alloc,MYF(MY_WME))))
+ if ((array->buffer= init_buffer))
+ DBUG_RETURN(FALSE);
+ if (!(array->buffer=(uchar*) my_malloc_ci(element_size*init_alloc,MYF(MY_WME))))
{
array->max_element=0;
DBUG_RETURN(TRUE);
@@ -64,6 +71,14 @@ my_bool init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size,
DBUG_RETURN(FALSE);
}
+my_bool init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size,
+ uint init_alloc,
+ uint alloc_increment CALLER_INFO_PROTO)
+{
+ /* placeholder to preserve ABI */
+ return my_init_dynamic_array_ci(array, element_size, init_alloc,
+ alloc_increment);
+}
/*
Insert element at the end of array. Allocate memory if needed.
@@ -77,9 +92,9 @@ my_bool init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size,
FALSE Ok
*/
-my_bool insert_dynamic(DYNAMIC_ARRAY *array, gptr element)
+my_bool insert_dynamic(DYNAMIC_ARRAY *array, uchar* element)
{
- gptr buffer;
+ uchar* buffer;
if (array->elements == array->max_element)
{ /* Call only when nessesary */
if (!(buffer=alloc_dynamic(array)))
@@ -112,17 +127,32 @@ my_bool insert_dynamic(DYNAMIC_ARRAY *array, gptr element)
0 Error
*/
-byte *alloc_dynamic(DYNAMIC_ARRAY *array)
+uchar *alloc_dynamic(DYNAMIC_ARRAY *array)
{
if (array->elements == array->max_element)
{
char *new_ptr;
+ if (array->buffer == (uchar *)(array + 1))
+ {
+ /*
+ In this senerio, the buffer is statically preallocated,
+ so we have to create an all-new malloc since we overflowed
+ */
+ if (!(new_ptr= (char *) my_malloc((array->max_element+
+ array->alloc_increment) *
+ array->size_of_element,
+ MYF(MY_WME))))
+ return 0;
+ memcpy(new_ptr, array->buffer,
+ array->elements * array->size_of_element);
+ }
+ else
if (!(new_ptr=(char*) my_realloc(array->buffer,(array->max_element+
- array->alloc_increment)*
- array->size_of_element,
- MYF(MY_WME | MY_ALLOW_ZERO_PTR))))
+ array->alloc_increment)*
+ array->size_of_element,
+ MYF(MY_WME | MY_ALLOW_ZERO_PTR))))
return 0;
- array->buffer=new_ptr;
+ array->buffer= (uchar*) new_ptr;
array->max_element+=array->alloc_increment;
}
return array->buffer+(array->elements++ * array->size_of_element);
@@ -141,7 +171,7 @@ byte *alloc_dynamic(DYNAMIC_ARRAY *array)
0 Array is empty
*/
-byte *pop_dynamic(DYNAMIC_ARRAY *array)
+uchar *pop_dynamic(DYNAMIC_ARRAY *array)
{
if (array->elements)
return array->buffer+(--array->elements * array->size_of_element);
@@ -166,7 +196,7 @@ byte *pop_dynamic(DYNAMIC_ARRAY *array)
FALSE Ok
*/
-my_bool set_dynamic(DYNAMIC_ARRAY *array, gptr element, uint idx)
+my_bool set_dynamic(DYNAMIC_ARRAY *array, uchar* element, uint idx)
{
if (idx >= array->elements)
{
@@ -176,19 +206,33 @@ my_bool set_dynamic(DYNAMIC_ARRAY *array, gptr element, uint idx)
char *new_ptr;
size=(idx+array->alloc_increment)/array->alloc_increment;
size*= array->alloc_increment;
+ if (array->buffer == (uchar *)(array + 1))
+ {
+ /*
+ In this senerio, the buffer is statically preallocated,
+ so we have to create an all-new malloc since we overflowed
+ */
+ if (!(new_ptr= (char *) my_malloc(size *
+ array->size_of_element,
+ MYF(MY_WME))))
+ return 0;
+ memcpy(new_ptr, array->buffer,
+ array->elements * array->size_of_element);
+ }
+ else
if (!(new_ptr=(char*) my_realloc(array->buffer,size*
- array->size_of_element,
- MYF(MY_WME | MY_ALLOW_ZERO_PTR))))
+ array->size_of_element,
+ MYF(MY_WME | MY_ALLOW_ZERO_PTR))))
return TRUE;
- array->buffer=new_ptr;
+ array->buffer= (uchar*) new_ptr;
array->max_element=size;
}
- bzero((gptr) (array->buffer+array->elements*array->size_of_element),
- (idx - array->elements)*array->size_of_element);
+ bzero((uchar*) (array->buffer+array->elements*array->size_of_element),
+ (idx - array->elements)*array->size_of_element);
array->elements=idx+1;
}
memcpy(array->buffer+(idx * array->size_of_element),element,
- (size_t) array->size_of_element);
+ (size_t) array->size_of_element);
return FALSE;
}
@@ -198,21 +242,21 @@ my_bool set_dynamic(DYNAMIC_ARRAY *array, gptr element, uint idx)
SYNOPSIS
get_dynamic()
array
- gptr Element to be returned. If idx > elements contain zeroes.
+ uchar* Element to be returned. If idx > elements contain zeroes.
idx Index of element wanted.
*/
-void get_dynamic(DYNAMIC_ARRAY *array, gptr element, uint idx)
+void get_dynamic(DYNAMIC_ARRAY *array, uchar* element, uint idx)
{
if (idx >= array->elements)
{
DBUG_PRINT("warning",("To big array idx: %d, array size is %d",
- idx,array->elements));
+ idx,array->elements));
bzero(element,array->size_of_element);
return;
}
memcpy(element,array->buffer+idx*array->size_of_element,
- (size_t) array->size_of_element);
+ (size_t) array->size_of_element);
}
@@ -226,6 +270,12 @@ void get_dynamic(DYNAMIC_ARRAY *array, gptr element, uint idx)
void delete_dynamic(DYNAMIC_ARRAY *array)
{
+ /*
+ Just mark as empty if we are using a static buffer
+ */
+ if (array->buffer == (uchar *)(array + 1))
+ array->elements= 0;
+ else
if (array->buffer)
{
my_free(array->buffer,MYF(MY_WME));
@@ -240,15 +290,15 @@ void delete_dynamic(DYNAMIC_ARRAY *array)
SYNOPSIS
delete_dynamic_element()
array
- idx Index of element to be deleted
+ idx Index of element to be deleted
*/
void delete_dynamic_element(DYNAMIC_ARRAY *array, uint idx)
{
- char *ptr=array->buffer+array->size_of_element*idx;
+ char *ptr= (char*) array->buffer+array->size_of_element*idx;
array->elements--;
memmove(ptr,ptr+array->size_of_element,
- (array->elements-idx)*array->size_of_element);
+ (array->elements-idx)*array->size_of_element);
}
@@ -265,11 +315,17 @@ void freeze_size(DYNAMIC_ARRAY *array)
{
uint elements=max(array->elements,1);
+ /*
+ Do nothing if we are using a static buffer
+ */
+ if (array->buffer == (uchar *)(array + 1))
+ return;
+
if (array->buffer && array->max_element != elements)
{
- array->buffer=(char*) my_realloc(array->buffer,
- elements*array->size_of_element,
- MYF(MY_WME));
+ array->buffer=(uchar*) my_realloc(array->buffer,
+ elements*array->size_of_element,
+ MYF(MY_WME));
array->max_element=elements;
}
}
@@ -285,7 +341,7 @@ void freeze_size(DYNAMIC_ARRAY *array)
*/
-int get_index_dynamic(DYNAMIC_ARRAY *array, gptr element)
+int get_index_dynamic(DYNAMIC_ARRAY *array, uchar* element)
{
uint ret;
if (array->buffer > element)
diff --git a/mysys/charset-def.c b/mysys/charset-def.c
index 71833550ff4..63bbceef29b 100644
--- a/mysys/charset-def.c
+++ b/mysys/charset-def.c
@@ -24,7 +24,6 @@
#ifdef HAVE_UCA_COLLATIONS
#ifdef HAVE_CHARSET_ucs2
-extern CHARSET_INFO my_charset_ucs2_general_uca;
extern CHARSET_INFO my_charset_ucs2_icelandic_uca_ci;
extern CHARSET_INFO my_charset_ucs2_latvian_uca_ci;
extern CHARSET_INFO my_charset_ucs2_romanian_uca_ci;
@@ -46,7 +45,6 @@ extern CHARSET_INFO my_charset_ucs2_hungarian_uca_ci;
#endif
#ifdef HAVE_CHARSET_utf8
-extern CHARSET_INFO my_charset_utf8_general_uca_ci;
extern CHARSET_INFO my_charset_utf8_icelandic_uca_ci;
extern CHARSET_INFO my_charset_utf8_latvian_uca_ci;
extern CHARSET_INFO my_charset_utf8_romanian_uca_ci;
@@ -135,7 +133,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
add_compiled_collation(&my_charset_ucs2_general_ci);
add_compiled_collation(&my_charset_ucs2_bin);
#ifdef HAVE_UCA_COLLATIONS
- add_compiled_collation(&my_charset_ucs2_general_uca);
+ add_compiled_collation(&my_charset_ucs2_unicode_ci);
add_compiled_collation(&my_charset_ucs2_icelandic_uca_ci);
add_compiled_collation(&my_charset_ucs2_latvian_uca_ci);
add_compiled_collation(&my_charset_ucs2_romanian_uca_ci);
@@ -169,7 +167,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
add_compiled_collation(&my_charset_utf8_general_cs);
#endif
#ifdef HAVE_UCA_COLLATIONS
- add_compiled_collation(&my_charset_utf8_general_uca_ci);
+ add_compiled_collation(&my_charset_utf8_unicode_ci);
add_compiled_collation(&my_charset_utf8_icelandic_uca_ci);
add_compiled_collation(&my_charset_utf8_latvian_uca_ci);
add_compiled_collation(&my_charset_utf8_romanian_uca_ci);
diff --git a/mysys/charset.c b/mysys/charset.c
index cce97677b14..692d7867fe0 100644
--- a/mysys/charset.c
+++ b/mysys/charset.c
@@ -202,6 +202,19 @@ static my_bool simple_cs_is_full(CHARSET_INFO *cs)
}
+static void
+copy_uca_collation(CHARSET_INFO *to, CHARSET_INFO *from)
+{
+ to->cset= from->cset;
+ to->coll= from->coll;
+ to->strxfrm_multiply= from->strxfrm_multiply;
+ to->min_sort_char= from->min_sort_char;
+ to->max_sort_char= from->max_sort_char;
+ to->mbminlen= from->mbminlen;
+ to->mbmaxlen= from->mbmaxlen;
+}
+
+
static int add_collation(CHARSET_INFO *cs)
{
if (cs->name && (cs->number ||
@@ -225,29 +238,30 @@ static int add_collation(CHARSET_INFO *cs)
if (!(all_charsets[cs->number]->state & MY_CS_COMPILED))
{
- CHARSET_INFO *new= all_charsets[cs->number];
+ CHARSET_INFO *newcs= all_charsets[cs->number];
if (cs_copy_data(all_charsets[cs->number],cs))
return MY_XML_ERROR;
if (!strcmp(cs->csname,"ucs2") )
{
#if defined(HAVE_CHARSET_ucs2) && defined(HAVE_UCA_COLLATIONS)
- new->cset= my_charset_ucs2_general_uca.cset;
- new->coll= my_charset_ucs2_general_uca.coll;
- new->strxfrm_multiply= my_charset_ucs2_general_uca.strxfrm_multiply;
- new->min_sort_char= my_charset_ucs2_general_uca.min_sort_char;
- new->max_sort_char= my_charset_ucs2_general_uca.max_sort_char;
- new->mbminlen= 2;
- new->mbmaxlen= 2;
- new->state |= MY_CS_AVAILABLE | MY_CS_LOADED;
+ copy_uca_collation(newcs, &my_charset_ucs2_unicode_ci);
+ newcs->state|= MY_CS_AVAILABLE | MY_CS_LOADED;
#endif
}
+ else if (!strcmp(cs->csname, "utf8"))
+ {
+#if defined (HAVE_CHARSET_utf8) && defined(HAVE_UCA_COLLATIONS)
+ copy_uca_collation(newcs, &my_charset_utf8_unicode_ci);
+ newcs->state|= MY_CS_AVAILABLE | MY_CS_LOADED;
+#endif
+ }
else
{
uchar *sort_order= all_charsets[cs->number]->sort_order;
simple_cs_init_functions(all_charsets[cs->number]);
- new->mbminlen= 1;
- new->mbmaxlen= 1;
+ newcs->mbminlen= 1;
+ newcs->mbmaxlen= 1;
if (simple_cs_is_full(all_charsets[cs->number]))
{
all_charsets[cs->number]->state |= MY_CS_LOADED;
@@ -263,6 +277,9 @@ static int add_collation(CHARSET_INFO *cs)
if (sort_order && sort_order['A'] < sort_order['a'] &&
sort_order['a'] < sort_order['B'])
all_charsets[cs->number]->state|= MY_CS_CSSORT;
+
+ if (my_charset_is_8bit_pure_ascii(all_charsets[cs->number]))
+ all_charsets[cs->number]->state|= MY_CS_PUREASCII;
}
}
else
@@ -309,14 +326,14 @@ static int charset_initialized=0;
static my_bool my_read_charset_file(const char *filename, myf myflags)
{
- char *buf;
+ uchar *buf;
int fd;
uint len, tmp_len;
MY_STAT stat_info;
if (!my_stat(filename, &stat_info, MYF(myflags)) ||
((len= (uint)stat_info.st_size) > MY_MAX_ALLOWED_BUF) ||
- !(buf= (char *)my_malloc(len,myflags)))
+ !(buf= (uchar*) my_malloc(len,myflags)))
return TRUE;
if ((fd=my_open(filename,O_RDONLY,myflags)) < 0)
@@ -326,7 +343,7 @@ static my_bool my_read_charset_file(const char *filename, myf myflags)
if (tmp_len != len)
goto error;
- if (my_parse_charset_xml(buf,len,add_collation))
+ if (my_parse_charset_xml((char*) buf,len,add_collation))
{
#ifdef NOT_YET
printf("ERROR at line %d pos %d '%s'\n",
@@ -336,7 +353,7 @@ static my_bool my_read_charset_file(const char *filename, myf myflags)
#endif
}
- my_free(buf, myflags);
+ my_free(buf, myflags);
return FALSE;
error:
@@ -376,7 +393,7 @@ void add_compiled_collation(CHARSET_INFO *cs)
cs->state|= MY_CS_AVAILABLE;
}
-static void *cs_alloc(uint size)
+static void *cs_alloc(size_t size)
{
return my_once_alloc(size, MYF(MY_WME));
}
@@ -573,6 +590,70 @@ CHARSET_INFO *get_charset_by_csname(const char *cs_name,
}
+/**
+ Resolve character set by the character set name (utf8, latin1, ...).
+
+ The function tries to resolve character set by the specified name. If
+ there is character set with the given name, it is assigned to the "cs"
+ parameter and FALSE is returned. If there is no such character set,
+ "default_cs" is assigned to the "cs" and TRUE is returned.
+
+ @param[in] cs_name Character set name.
+ @param[in] default_cs Default character set.
+ @param[out] cs Variable to store character set.
+
+ @return FALSE if character set was resolved successfully; TRUE if there
+ is no character set with given name.
+*/
+
+bool resolve_charset(const char *cs_name,
+ CHARSET_INFO *default_cs,
+ CHARSET_INFO **cs)
+{
+ *cs= get_charset_by_csname(cs_name, MY_CS_PRIMARY, MYF(0));
+
+ if (*cs == NULL)
+ {
+ *cs= default_cs;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+
+/**
+ Resolve collation by the collation name (utf8_general_ci, ...).
+
+ The function tries to resolve collation by the specified name. If there
+ is collation with the given name, it is assigned to the "cl" parameter
+ and FALSE is returned. If there is no such collation, "default_cl" is
+ assigned to the "cl" and TRUE is returned.
+
+ @param[out] cl Variable to store collation.
+ @param[in] cl_name Collation name.
+ @param[in] default_cl Default collation.
+
+ @return FALSE if collation was resolved successfully; TRUE if there is no
+ collation with given name.
+*/
+
+bool resolve_collation(const char *cl_name,
+ CHARSET_INFO *default_cl,
+ CHARSET_INFO **cl)
+{
+ *cl= get_charset_by_name(cl_name, MYF(0));
+
+ if (*cl == NULL)
+ {
+ *cl= default_cl;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+
/*
Escape string with backslashes (\)
@@ -594,13 +675,13 @@ CHARSET_INFO *get_charset_by_csname(const char *cs_name,
"big enough"
RETURN VALUES
- ~0 The escaped string did not fit in the to buffer
- >=0 The length of the escaped string
+ (size_t) -1 The escaped string did not fit in the to buffer
+ # The length of the escaped string
*/
-ulong escape_string_for_mysql(CHARSET_INFO *charset_info,
- char *to, ulong to_length,
- const char *from, ulong length)
+size_t escape_string_for_mysql(CHARSET_INFO *charset_info,
+ char *to, size_t to_length,
+ const char *from, size_t length)
{
const char *to_start= to;
const char *end, *to_end=to_start + (to_length ? to_length-1 : 2*length);
@@ -684,7 +765,7 @@ ulong escape_string_for_mysql(CHARSET_INFO *charset_info,
}
}
*to= 0;
- return overflow ? (ulong)~0 : (ulong) (to - to_start);
+ return overflow ? (size_t) -1 : (size_t) (to - to_start);
}
@@ -738,9 +819,9 @@ CHARSET_INFO *fs_character_set()
>=0 The length of the escaped string
*/
-ulong escape_quotes_for_mysql(CHARSET_INFO *charset_info,
- char *to, ulong to_length,
- const char *from, ulong length)
+size_t escape_quotes_for_mysql(CHARSET_INFO *charset_info,
+ char *to, size_t to_length,
+ const char *from, size_t length)
{
const char *to_start= to;
const char *end, *to_end=to_start + (to_length ? to_length-1 : 2*length);
diff --git a/mysys/checksum.c b/mysys/checksum.c
index 09e9c5b3730..4f86f6845f0 100644
--- a/mysys/checksum.c
+++ b/mysys/checksum.c
@@ -15,7 +15,8 @@
#include <my_global.h>
-#include "my_sys.h"
+#include <my_sys.h>
+#include <zlib.h>
/*
Calculate a long checksum for a memoryblock.
@@ -27,15 +28,15 @@
length length of the block
*/
-ha_checksum my_checksum(ha_checksum crc, const byte *pos, uint length)
+ha_checksum my_checksum(ha_checksum crc, const uchar *pos, size_t length)
{
#ifdef NOT_USED
- const byte *end=pos+length;
+ const uchar *end=pos+length;
for ( ; pos != end ; pos++)
crc=((crc << 8) + *((uchar*) pos)) + (crc >> (8*sizeof(ha_checksum)-8));
return crc;
#else
- return (ha_checksum)crc32((uint)crc, (const uchar *)pos, length);
+ return (ha_checksum)crc32((uint)crc, pos, length);
#endif
}
diff --git a/mysys/default.c b/mysys/default.c
index 926a8f530bf..3cc5b08e77c 100644
--- a/mysys/default.c
+++ b/mysys/default.c
@@ -268,9 +268,9 @@ static int handle_default_option(void *in_ctx, const char *group_name,
if (find_type((char *)group_name, ctx->group, 3))
{
- if (!(tmp= alloc_root(ctx->alloc, (uint) strlen(option) + 1)))
+ if (!(tmp= alloc_root(ctx->alloc, strlen(option) + 1)))
return 1;
- if (insert_dynamic(ctx->args, (gptr) &tmp))
+ if (insert_dynamic(ctx->args, (uchar*) &tmp))
return 1;
strmov(tmp, option);
}
@@ -426,7 +426,7 @@ int load_defaults(const char *conf_file, const char **groups,
/* copy name + found arguments + command line arguments to new array */
res[0]= argv[0][0]; /* Name MUST be set, even by embedded library */
- memcpy((gptr) (res+1), args.buffer, args.elements*sizeof(char*));
+ memcpy((uchar*) (res+1), args.buffer, args.elements*sizeof(char*));
/* Skip --defaults-xxx options */
(*argc)-= args_used;
(*argv)+= args_used;
@@ -442,7 +442,7 @@ int load_defaults(const char *conf_file, const char **groups,
}
if (*argc)
- memcpy((gptr) (res+1+args.elements), (char*) ((*argv)+1),
+ memcpy((uchar*) (res+1+args.elements), (char*) ((*argv)+1),
(*argc-1)*sizeof(char*));
res[args.elements+ *argc]=0; /* last null */
@@ -514,7 +514,7 @@ static int search_default_file(Process_option_func opt_handler,
# Returns pointer to the argument after the keyword.
*/
-static char *get_argument(const char *keyword, uint kwlen,
+static char *get_argument(const char *keyword, size_t kwlen,
char *ptr, char *name, uint line)
{
char *end;
@@ -718,10 +718,11 @@ static int search_default_file_with_ext(Process_option_func opt_handler,
name,line);
goto err;
}
- for ( ; my_isspace(&my_charset_latin1,end[-1]) ; end--) ;/* Remove end space */
+ /* Remove end space */
+ for ( ; my_isspace(&my_charset_latin1,end[-1]) ; end--) ;
end[0]=0;
- strnmov(curr_gr, ptr, min((uint) (end-ptr)+1, 4096));
+ strmake(curr_gr, ptr, min((size_t) (end-ptr)+1, sizeof(curr_gr)-1));
/* signal that a new group is found */
opt_handler(handler_ctx, curr_gr, NULL);
@@ -743,7 +744,7 @@ static int search_default_file_with_ext(Process_option_func opt_handler,
for ( ; my_isspace(&my_charset_latin1,end[-1]) ; end--) ;
if (!value)
{
- strmake(strmov(option,"--"),ptr,(uint) (end-ptr));
+ strmake(strmov(option,"--"),ptr, (size_t) (end-ptr));
if (opt_handler(handler_ctx, curr_gr, option))
goto err;
}
@@ -769,7 +770,7 @@ static int search_default_file_with_ext(Process_option_func opt_handler,
value++;
value_end--;
}
- ptr=strnmov(strmov(option,"--"),ptr,(uint) (end-ptr));
+ ptr=strnmov(strmov(option,"--"),ptr,(size_t) (end-ptr));
*ptr++= '=';
for ( ; value != value_end; value++)
@@ -931,9 +932,9 @@ void print_defaults(const char *conf_file, const char **groups)
typedef UINT (WINAPI *GET_SYSTEM_WINDOWS_DIRECTORY)(LPSTR, UINT);
-static uint my_get_system_windows_directory(char *buffer, uint size)
+static size_t my_get_system_windows_directory(char *buffer, size_t size)
{
- uint count;
+ size_t count;
GET_SYSTEM_WINDOWS_DIRECTORY
func_ptr= (GET_SYSTEM_WINDOWS_DIRECTORY)
GetProcAddress(GetModuleHandle("kernel32.dll"),
diff --git a/mysys/default_modify.c b/mysys/default_modify.c
index f58d3e0da86..78f6105b071 100644
--- a/mysys/default_modify.c
+++ b/mysys/default_modify.c
@@ -68,9 +68,8 @@ int modify_defaults_file(const char *file_location, const char *option,
FILE *cnf_file;
MY_STAT file_stat;
char linebuff[BUFF_SIZE], *src_ptr, *dst_ptr, *file_buffer;
- uint opt_len= 0;
- uint optval_len= 0;
- uint sect_len, nr_newlines= 0, buffer_size;
+ size_t opt_len= 0, optval_len= 0, sect_len;
+ uint nr_newlines= 0, buffer_size;
my_bool in_section= FALSE, opt_applied= 0;
uint reserve_extended;
uint new_opt_len;
@@ -86,8 +85,8 @@ int modify_defaults_file(const char *file_location, const char *option,
if (option && option_value)
{
- opt_len= (uint) strlen(option);
- optval_len= (uint) strlen(option_value);
+ opt_len= strlen(option);
+ optval_len= strlen(option_value);
}
new_opt_len= opt_len + 1 + optval_len + NEWLINE_LEN;
@@ -110,7 +109,7 @@ int modify_defaults_file(const char *file_location, const char *option,
MYF(MY_WME))))
goto malloc_err;
- sect_len= (uint) strlen(section_name);
+ sect_len= strlen(section_name);
for (dst_ptr= file_buffer; fgets(linebuff, BUFF_SIZE, cnf_file); )
{
@@ -219,7 +218,7 @@ int modify_defaults_file(const char *file_location, const char *option,
if (my_chsize(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, file_buffer, (uint) (dst_ptr - file_buffer),
+ my_fwrite(cnf_file, (uchar*) file_buffer, (size_t) (dst_ptr - file_buffer),
MYF(MY_NABP)))
goto err;
}
diff --git a/mysys/hash.c b/mysys/hash.c
index 60168e01e20..4532b06b533 100644
--- a/mysys/hash.c
+++ b/mysys/hash.c
@@ -30,15 +30,15 @@
typedef struct st_hash_info {
uint next; /* index to next key */
- byte *data; /* data for current entry */
+ uchar *data; /* data for current entry */
} HASH_LINK;
static uint hash_mask(uint hashnr,uint buffmax,uint maxlength);
static void movelink(HASH_LINK *array,uint pos,uint next_link,uint newlink);
-static int hashcmp(const HASH *hash, HASH_LINK *pos, const byte *key,
- uint length);
+static int hashcmp(const HASH *hash, HASH_LINK *pos, const uchar *key,
+ size_t length);
-static uint calc_hash(const HASH *hash, const byte *key, uint length)
+static uint calc_hash(const HASH *hash, const uchar *key, size_t length)
{
ulong nr1=1, nr2=4;
hash->charset->coll->hash_sort(hash->charset,(uchar*) key,length,&nr1,&nr2);
@@ -47,12 +47,12 @@ static uint calc_hash(const HASH *hash, const byte *key, uint length)
my_bool
_hash_init(HASH *hash,CHARSET_INFO *charset,
- uint size,uint key_offset,uint key_length,
+ ulong size, size_t key_offset, size_t key_length,
hash_get_key get_key,
void (*free_element)(void*),uint flags CALLER_INFO_PROTO)
{
DBUG_ENTER("hash_init");
- DBUG_PRINT("enter",("hash: 0x%lx size: %d", (long) hash, size));
+ DBUG_PRINT("enter",("hash: 0x%lx size: %u", (long) hash, (uint) size));
hash->records=0;
if (my_init_dynamic_array_ci(&hash->array,sizeof(HASH_LINK),size,0))
@@ -137,21 +137,21 @@ void my_hash_reset(HASH *hash)
DBUG_VOID_RETURN;
}
- /* some helper functions */
+/* some helper functions */
/*
- This function is char* instead of byte* as HPUX11 compiler can't
+ This function is char* instead of uchar* as HPUX11 compiler can't
handle inline functions that are not defined as native types
*/
static inline char*
-hash_key(const HASH *hash, const byte *record, uint *length,
+hash_key(const HASH *hash, const uchar *record, size_t *length,
my_bool first)
{
if (hash->get_key)
- return (*hash->get_key)(record,length,first);
+ return (char*) (*hash->get_key)(record,length,first);
*length=hash->key_length;
- return (byte*) record+hash->key_offset;
+ return (char*) record+hash->key_offset;
}
/* Calculate pos according to keys */
@@ -165,8 +165,8 @@ static uint hash_mask(uint hashnr,uint buffmax,uint maxlength)
static uint hash_rec_mask(const HASH *hash, HASH_LINK *pos,
uint buffmax, uint maxlength)
{
- uint length;
- byte *key= (byte*) hash_key(hash,pos->data,&length,0);
+ size_t length;
+ uchar *key= (uchar*) hash_key(hash,pos->data,&length,0);
return hash_mask(calc_hash(hash,key,length),buffmax,maxlength);
}
@@ -177,15 +177,15 @@ static
#if !defined(__USLC__) && !defined(__sgi)
inline
#endif
-unsigned int rec_hashnr(HASH *hash,const byte *record)
+unsigned int rec_hashnr(HASH *hash,const uchar *record)
{
- uint length;
- byte *key= (byte*) hash_key(hash,record,&length,0);
+ size_t length;
+ uchar *key= (uchar*) hash_key(hash,record,&length,0);
return calc_hash(hash,key,length);
}
-gptr hash_search(const HASH *hash, const byte *key, uint length)
+uchar* hash_search(const HASH *hash, const uchar *key, size_t length)
{
HASH_SEARCH_STATE state;
return hash_first(hash, key, length, &state);
@@ -198,7 +198,7 @@ gptr hash_search(const HASH *hash, const byte *key, uint length)
Assigns the number of the found record to HASH_SEARCH_STATE state
*/
-gptr hash_first(const HASH *hash, const byte *key, uint length,
+uchar* hash_first(const HASH *hash, const uchar *key, size_t length,
HASH_SEARCH_STATE *current_record)
{
HASH_LINK *pos;
@@ -235,7 +235,7 @@ gptr hash_first(const HASH *hash, const byte *key, uint length,
/* Get next record with identical key */
/* Can only be called if previous calls was hash_search */
-gptr hash_next(const HASH *hash, const byte *key, uint length,
+uchar* hash_next(const HASH *hash, const uchar *key, size_t length,
HASH_SEARCH_STATE *current_record)
{
HASH_LINK *pos;
@@ -292,11 +292,11 @@ static void movelink(HASH_LINK *array,uint find,uint next_link,uint newlink)
!= 0 key of record != key
*/
-static int hashcmp(const HASH *hash, HASH_LINK *pos, const byte *key,
- uint length)
+static int hashcmp(const HASH *hash, HASH_LINK *pos, const uchar *key,
+ size_t length)
{
- uint rec_keylength;
- byte *rec_key= (byte*) hash_key(hash,pos->data,&rec_keylength,1);
+ size_t rec_keylength;
+ uchar *rec_key= (uchar*) hash_key(hash,pos->data,&rec_keylength,1);
return ((length && length != rec_keylength) ||
my_strnncoll(hash->charset, (uchar*) rec_key, rec_keylength,
(uchar*) key, rec_keylength));
@@ -305,15 +305,25 @@ static int hashcmp(const HASH *hash, HASH_LINK *pos, const byte *key,
/* Write a hash-key to the hash-index */
-my_bool my_hash_insert(HASH *info,const byte *record)
+my_bool my_hash_insert(HASH *info,const uchar *record)
{
int flag;
- uint halfbuff,hash_nr,first_index,idx;
- byte *ptr_to_rec,*ptr_to_rec2;
+ size_t idx;
+ uint halfbuff,hash_nr,first_index;
+ uchar *ptr_to_rec,*ptr_to_rec2;
HASH_LINK *data,*empty,*gpos,*gpos2,*pos;
- LINT_INIT(gpos); LINT_INIT(gpos2);
- LINT_INIT(ptr_to_rec); LINT_INIT(ptr_to_rec2);
+ LINT_INIT(gpos);
+ LINT_INIT(gpos2);
+ LINT_INIT(ptr_to_rec);
+ LINT_INIT(ptr_to_rec2);
+
+ if (HASH_UNIQUE & info->flags)
+ {
+ uchar *key= (uchar*) hash_key(info, record, &idx, 1);
+ if (hash_search(info, key, idx))
+ return(TRUE); /* Duplicate entry */
+ }
flag=0;
if (!(empty=(HASH_LINK*) alloc_dynamic(&info->array)))
@@ -357,7 +367,7 @@ my_bool my_hash_insert(HASH *info,const byte *record)
{
/* Change link of previous LOW-key */
gpos->data=ptr_to_rec;
- gpos->next=(uint) (pos-data);
+ gpos->next= (uint) (pos-data);
flag= (flag & HIGHFIND) | (LOWFIND | LOWUSED);
}
gpos=pos;
@@ -406,7 +416,7 @@ my_bool my_hash_insert(HASH *info,const byte *record)
pos=data+idx;
if (pos == empty)
{
- pos->data=(byte*) record;
+ pos->data=(uchar*) record;
pos->next=NO_RECORD;
}
else
@@ -416,12 +426,12 @@ my_bool my_hash_insert(HASH *info,const byte *record)
gpos=data+hash_rec_mask(info,pos,info->blength,info->records+1);
if (pos == gpos)
{
- pos->data=(byte*) record;
+ pos->data=(uchar*) record;
pos->next=(uint) (empty - data);
}
else
{
- pos->data=(byte*) record;
+ pos->data=(uchar*) record;
pos->next=NO_RECORD;
movelink(data,(uint) (pos-data),(uint) (gpos-data),(uint) (empty-data));
}
@@ -438,7 +448,7 @@ my_bool my_hash_insert(HASH *info,const byte *record)
** if there is a free-function it's called for record if found
******************************************************************************/
-my_bool hash_delete(HASH *hash,byte *record)
+my_bool hash_delete(HASH *hash,uchar *record)
{
uint blength,pos2,pos_hashnr,lastpos_hashnr,idx,empty_index;
HASH_LINK *data,*lastpos,*gpos,*pos,*pos3,*empty;
@@ -516,7 +526,7 @@ my_bool hash_delete(HASH *hash,byte *record)
exit:
VOID(pop_dynamic(&hash->array));
if (hash->free)
- (*hash->free)((byte*) record);
+ (*hash->free)((uchar*) record);
DBUG_RETURN(0);
}
@@ -525,11 +535,28 @@ exit:
This is much more efficent than using a delete & insert.
*/
-my_bool hash_update(HASH *hash,byte *record,byte *old_key,uint old_key_length)
+my_bool hash_update(HASH *hash, uchar *record, uchar *old_key,
+ size_t old_key_length)
{
- uint idx,new_index,new_pos_index,blength,records,empty;
+ uint new_index,new_pos_index,blength,records,empty;
+ size_t idx;
HASH_LINK org_link,*data,*previous,*pos;
DBUG_ENTER("hash_update");
+
+ if (HASH_UNIQUE & hash->flags)
+ {
+ HASH_SEARCH_STATE state;
+ uchar *found, *new_key= (uchar*) hash_key(hash, record, &idx, 1);
+ if ((found= hash_first(hash, new_key, idx, &state)))
+ {
+ do
+ {
+ if (found != record)
+ DBUG_RETURN(1); /* Duplicate entry */
+ }
+ while ((found= hash_next(hash, new_key, idx, &state)));
+ }
+ }
data=dynamic_element(&hash->array,0,HASH_LINK*);
blength=hash->blength; records=hash->records;
@@ -570,6 +597,25 @@ my_bool hash_update(HASH *hash,byte *record,byte *old_key,uint old_key_length)
previous->next=pos->next; /* unlink pos */
/* Move data to correct position */
+ if (new_index == empty)
+ {
+ /*
+ At this point record is unlinked from the old chain, thus it holds
+ random position. By the chance this position is equal to position
+ for the first element in the new chain. That means updated record
+ is the only record in the new chain.
+ */
+ if (empty != idx)
+ {
+ /*
+ Record was moved while unlinking it from the old chain.
+ Copy data to a new position.
+ */
+ data[empty]= org_link;
+ }
+ data[empty].next= NO_RECORD;
+ DBUG_RETURN(0);
+ }
pos=data+new_index;
new_pos_index=hash_rec_mask(hash,pos,blength,records);
if (new_index != new_pos_index)
@@ -589,7 +635,7 @@ my_bool hash_update(HASH *hash,byte *record,byte *old_key,uint old_key_length)
}
-byte *hash_element(HASH *hash,uint idx)
+uchar *hash_element(HASH *hash,ulong idx)
{
if (idx < hash->records)
return dynamic_element(&hash->array,idx,HASH_LINK*)->data;
@@ -602,7 +648,7 @@ byte *hash_element(HASH *hash,uint idx)
isn't changed
*/
-void hash_replace(HASH *hash, HASH_SEARCH_STATE *current_record, byte *new_row)
+void hash_replace(HASH *hash, HASH_SEARCH_STATE *current_record, uchar *new_row)
{
if (*current_record != NO_RECORD) /* Safety */
dynamic_element(&hash->array, *current_record, HASH_LINK*)->data= new_row;
diff --git a/mysys/list.c b/mysys/list.c
index ccc3f495093..aaadd686365 100644
--- a/mysys/list.c
+++ b/mysys/list.c
@@ -61,8 +61,8 @@ void list_free(LIST *root, uint free_data)
{
next=root->next;
if (free_data)
- my_free((gptr) root->data,MYF(0));
- my_free((gptr) root,MYF(0));
+ my_free((uchar*) root->data,MYF(0));
+ my_free((uchar*) root,MYF(0));
root=next;
}
}
@@ -101,7 +101,7 @@ uint list_length(LIST *list)
}
-int list_walk(LIST *list, list_walk_action action, gptr argument)
+int list_walk(LIST *list, list_walk_action action, uchar* argument)
{
int error=0;
while (list)
diff --git a/mysys/md5.c b/mysys/md5.c
index a88fb279a0b..0945f9ce5f4 100644
--- a/mysys/md5.c
+++ b/mysys/md5.c
@@ -45,7 +45,7 @@ documentation and/or software.
#include <my_global.h>
#include <m_string.h>
-#include "md5.h"
+#include "my_md5.h"
/* Constants for MD5Transform routine. */
diff --git a/mysys/mf_cache.c b/mysys/mf_cache.c
index a3abb3bc974..f0df0f3fa77 100644
--- a/mysys/mf_cache.c
+++ b/mysys/mf_cache.c
@@ -58,7 +58,7 @@ static my_bool cache_remove_open_tmp(IO_CACHE *cache __attribute__((unused)),
*/
my_bool open_cached_file(IO_CACHE *cache, const char* dir, const char *prefix,
- uint cache_size, myf cache_myflags)
+ size_t cache_size, myf cache_myflags)
{
DBUG_ENTER("open_cached_file");
cache->dir= dir ? my_strdup(dir,MYF(cache_myflags & MY_WME)) : (char*) 0;
diff --git a/mysys/mf_dirname.c b/mysys/mf_dirname.c
index 87a4a453734..1b428ded751 100644
--- a/mysys/mf_dirname.c
+++ b/mysys/mf_dirname.c
@@ -18,9 +18,9 @@
/* Functions definied in this file */
-uint dirname_length(const char *name)
+size_t dirname_length(const char *name)
{
- register my_string pos,gpos;
+ register char *pos, *gpos;
#ifdef BASKSLASH_MBTAIL
CHARSET_INFO *fs= fs_character_set();
#endif
@@ -47,21 +47,31 @@ uint dirname_length(const char *name)
)
gpos=pos;
}
- return ((uint) (uint) (gpos+1-(char*) name));
+ return (size_t) (gpos+1-(char*) name);
}
- /* Gives directory part of filename. Directory ends with '/' */
- /* Returns length of directory part */
+/*
+ Gives directory part of filename. Directory ends with '/'
+
+ SYNOPSIS
+ dirname_part()
+ to Store directory name here
+ name Original name
+ to_length Store length of 'to' here
+
+ RETURN
+ # Length of directory part in 'name'
+*/
-uint dirname_part(my_string to, const char *name)
+size_t dirname_part(char *to, const char *name, size_t *to_res_length)
{
- uint length;
+ size_t length;
DBUG_ENTER("dirname_part");
DBUG_PRINT("enter",("'%s'",name));
length=dirname_length(name);
- convert_dirname(to, name, name+length);
+ *to_res_length= (size_t) (convert_dirname(to, name, name+length) - to);
DBUG_RETURN(length);
} /* dirname */
@@ -142,7 +152,7 @@ char *convert_dirname(char *to, const char *from, const char *from_end)
}
#else
/* This is ok even if to == from, becasue we need to cut the string */
- to= strmake(to, from, (uint) (from_end-from));
+ to= strmake(to, from, (size_t) (from_end-from));
#endif
/* Add FN_LIBCHAR to the end of directory path */
diff --git a/mysys/mf_fn_ext.c b/mysys/mf_fn_ext.c
index 20e835fe641..da7fac3de73 100644
--- a/mysys/mf_fn_ext.c
+++ b/mysys/mf_fn_ext.c
@@ -33,21 +33,22 @@
points at the end ASCII(0) of the filename.
*/
-my_string fn_ext(const char *name)
+char *fn_ext(const char *name)
{
- register my_string pos,gpos;
+ register const char *pos, *gpos;
DBUG_ENTER("fn_ext");
DBUG_PRINT("mfunkt",("name: '%s'",name));
#if defined(FN_DEVCHAR) || defined(FN_C_AFTER_DIR) || defined(BASKSLASH_MBTAIL)
{
char buff[FN_REFLEN];
- gpos=(my_string) name+dirname_part(buff,(char*) name);
+ size_t res_length;
+ gpos= name+ dirname_part(buff,(char*) name, &res_length);
}
#else
if (!(gpos= strrchr(name, FN_LIBCHAR)))
- gpos= (my_string) name;
+ gpos= name;
#endif
pos=strchr(gpos,FN_EXTCHAR);
- DBUG_RETURN (pos ? pos : strend(gpos));
+ DBUG_RETURN((char*) (pos ? pos : strend(gpos)));
} /* fn_ext */
diff --git a/mysys/mf_format.c b/mysys/mf_format.c
index 3e5eeef6420..f199132626b 100644
--- a/mysys/mf_format.c
+++ b/mysys/mf_format.c
@@ -23,18 +23,19 @@
The arguments should be in unix format.
*/
-my_string fn_format(my_string to, const char *name, const char *dir,
+char * fn_format(char * to, const char *name, const char *dir,
const char *extension, uint flag)
{
- reg1 uint length;
char dev[FN_REFLEN], buff[FN_REFLEN], *pos, *startpos;
const char *ext;
+ reg1 size_t length;
+ size_t dev_length;
DBUG_ENTER("fn_format");
DBUG_PRINT("enter",("name: %s dir: %s extension: %s flag: %d",
name,dir,extension,flag));
/* Copy and skip directory */
- name+=(length=dirname_part(dev,(startpos=(my_string) name)));
+ name+=(length=dirname_part(dev, (startpos=(char *) name), &dev_length));
if (length == 0 || (flag & MY_REPLACE_DIR))
{
/* Use given directory */
@@ -63,7 +64,7 @@ my_string fn_format(my_string to, const char *name, const char *dir,
}
else
{
- length=(uint) (pos-(char*) name); /* Change extension */
+ length= (size_t) (pos-(char*) name); /* Change extension */
ext= extension;
}
}
@@ -76,18 +77,19 @@ my_string fn_format(my_string to, const char *name, const char *dir,
if (strlen(dev)+length+strlen(ext) >= FN_REFLEN || length >= FN_LEN )
{
/* To long path, return original or NULL */
- uint tmp_length;
+ size_t tmp_length;
if (flag & MY_SAFE_PATH)
return NullS;
- tmp_length=strlength(startpos);
- DBUG_PRINT("error",("dev: '%s' ext: '%s' length: %d",dev,ext,length));
+ tmp_length= strlength(startpos);
+ DBUG_PRINT("error",("dev: '%s' ext: '%s' length: %u",dev,ext,
+ (uint) length));
(void) strmake(to,startpos,min(tmp_length,FN_REFLEN-1));
}
else
{
if (to == startpos)
{
- bmove(buff,(char*) name,length); /* Save name for last copy */
+ bmove(buff,(uchar*) name,length); /* Save name for last copy */
name=buff;
}
pos=strmake(strmov(to,dev),name,length);
@@ -109,18 +111,18 @@ my_string fn_format(my_string to, const char *name, const char *dir,
} /* fn_format */
- /*
- strlength(const string str)
- Return length of string with end-space:s not counted.
- */
+/*
+ strlength(const string str)
+ Return length of string with end-space:s not counted.
+*/
-size_s strlength(const char *str)
+size_t strlength(const char *str)
{
- reg1 my_string pos;
- reg2 my_string found;
+ reg1 const char * pos;
+ reg2 const char * found;
DBUG_ENTER("strlength");
- pos=found=(char*) str;
+ pos= found= str;
while (*pos)
{
@@ -136,5 +138,5 @@ size_s strlength(const char *str)
found=pos;
while (*++pos == ' ') {};
}
- DBUG_RETURN((size_s) (found-(char*) str));
+ DBUG_RETURN((size_t) (found - str));
} /* strlength */
diff --git a/mysys/mf_getdate.c b/mysys/mf_getdate.c
index 1ced312848e..3a8e1be6a0b 100644
--- a/mysys/mf_getdate.c
+++ b/mysys/mf_getdate.c
@@ -34,7 +34,7 @@
*/
-void get_date(register my_string to, int flag, time_t date)
+void get_date(register char * to, int flag, time_t date)
{
reg2 struct tm *start_time;
time_t skr;
@@ -42,7 +42,7 @@ void get_date(register my_string to, int flag, time_t date)
struct tm tm_tmp;
#endif
- skr=date ? (time_t) date : time((time_t*) 0);
+ skr=date ? (time_t) date : my_time(0);
#if defined(HAVE_LOCALTIME_R) && defined(_REENTRANT)
if (flag & GETDATE_GMT)
localtime_r(&skr,&tm_tmp);
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c
index d2ace12da4d..58650733490 100644
--- a/mysys/mf_iocache.c
+++ b/mysys/mf_iocache.c
@@ -152,11 +152,11 @@ init_functions(IO_CACHE* info)
# error
*/
-int init_io_cache(IO_CACHE *info, File file, uint cachesize,
+int init_io_cache(IO_CACHE *info, File file, size_t cachesize,
enum cache_type type, my_off_t seek_offset,
pbool use_async_io, myf cache_myflags)
{
- uint min_cache;
+ size_t min_cache;
my_off_t pos;
my_off_t end_of_file= ~(my_off_t) 0;
DBUG_ENTER("init_io_cache");
@@ -214,7 +214,7 @@ int init_io_cache(IO_CACHE *info, File file, uint cachesize,
/* Trim cache size if the file is very small */
if ((my_off_t) cachesize > end_of_file-seek_offset+IO_SIZE*2-1)
{
- cachesize=(uint) (end_of_file-seek_offset)+IO_SIZE*2-1;
+ cachesize= (size_t) (end_of_file-seek_offset)+IO_SIZE*2-1;
use_async_io=0; /* No need to use async */
}
}
@@ -223,18 +223,17 @@ int init_io_cache(IO_CACHE *info, File file, uint cachesize,
if (type != READ_NET && type != WRITE_NET)
{
/* Retry allocating memory in smaller blocks until we get one */
- cachesize=(uint) ((ulong) (cachesize + min_cache-1) &
- (ulong) ~(min_cache-1));
+ cachesize= ((cachesize + min_cache-1) & ~(min_cache-1));
for (;;)
{
- uint buffer_block;
+ size_t buffer_block;
if (cachesize < min_cache)
cachesize = min_cache;
- buffer_block = cachesize;
+ buffer_block= cachesize;
if (type == SEQ_READ_APPEND)
buffer_block *= 2;
if ((info->buffer=
- (byte*) my_malloc(buffer_block,
+ (uchar*) my_malloc(buffer_block,
MYF((cache_myflags & ~ MY_WME) |
(cachesize == min_cache ? MY_WME : 0)))) != 0)
{
@@ -247,11 +246,11 @@ int init_io_cache(IO_CACHE *info, File file, uint cachesize,
if (cachesize == min_cache)
DBUG_RETURN(2); /* Can't alloc cache */
/* Try with less memory */
- cachesize= (uint) ((ulong) cachesize*3/4 & (ulong)~(min_cache-1));
+ cachesize= (cachesize*3/4 & ~(min_cache-1));
}
}
- DBUG_PRINT("info",("init_io_cache: cachesize = %u",cachesize));
+ DBUG_PRINT("info",("init_io_cache: cachesize = %lu", (ulong) cachesize));
info->read_length=info->buffer_length=cachesize;
info->myflags=cache_myflags & ~(MY_NABP | MY_FNABP);
info->request_pos= info->read_pos= info->write_pos = info->buffer;
@@ -350,7 +349,7 @@ my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type,
seek_offset <= my_b_tell(info))
{
/* Reuse current buffer without flushing it to disk */
- byte *pos;
+ uchar *pos;
if (info->type == WRITE_CACHE && type == READ_CACHE)
{
info->read_end=info->write_pos;
@@ -452,22 +451,22 @@ my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type,
1 Error: can't read requested characters
*/
-int _my_b_read(register IO_CACHE *info, byte *Buffer, uint Count)
+int _my_b_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
{
- uint length,diff_length,left_length;
- my_off_t max_length, pos_in_file;
+ size_t length,diff_length,left_length, max_length;
+ my_off_t pos_in_file;
DBUG_ENTER("_my_b_read");
- if ((left_length=(uint) (info->read_end-info->read_pos)))
+ if ((left_length= (size_t) (info->read_end-info->read_pos)))
{
DBUG_ASSERT(Count >= left_length); /* User is not using my_b_read() */
- memcpy(Buffer,info->read_pos, (size_t) (left_length));
+ memcpy(Buffer,info->read_pos, left_length);
Buffer+=left_length;
Count-=left_length;
}
/* pos_in_file always point on where info->buffer was read */
- pos_in_file=info->pos_in_file+(uint) (info->read_end - info->buffer);
+ pos_in_file=info->pos_in_file+ (size_t) (info->read_end - info->buffer);
/*
Whenever a function which operates on IO_CACHE flushes/writes
@@ -496,20 +495,20 @@ int _my_b_read(register IO_CACHE *info, byte *Buffer, uint Count)
}
}
- diff_length=(uint) (pos_in_file & (IO_SIZE-1));
- if (Count >= (uint) (IO_SIZE+(IO_SIZE-diff_length)))
+ diff_length= (size_t) (pos_in_file & (IO_SIZE-1));
+ if (Count >= (size_t) (IO_SIZE+(IO_SIZE-diff_length)))
{ /* Fill first intern buffer */
- uint read_length;
+ size_t read_length;
if (info->end_of_file <= pos_in_file)
{ /* End of file */
- info->error=(int) left_length;
+ info->error= (int) left_length;
DBUG_RETURN(1);
}
- length=(Count & (uint) ~(IO_SIZE-1))-diff_length;
- if ((read_length=my_read(info->file,Buffer,(uint) length,info->myflags))
- != (uint) length)
+ length=(Count & (size_t) ~(IO_SIZE-1))-diff_length;
+ if ((read_length= my_read(info->file,Buffer, length, info->myflags))
+ != length)
{
- info->error= (read_length == (uint) -1 ? -1 :
+ info->error= (read_length == (size_t) -1 ? -1 :
(int) (read_length+left_length));
DBUG_RETURN(1);
}
@@ -520,10 +519,10 @@ int _my_b_read(register IO_CACHE *info, byte *Buffer, uint Count)
diff_length=0;
}
- max_length=info->read_length-diff_length;
+ max_length= info->read_length-diff_length;
if (info->type != READ_FIFO &&
max_length > (info->end_of_file - pos_in_file))
- max_length = info->end_of_file - pos_in_file;
+ max_length= (size_t) (info->end_of_file - pos_in_file);
if (!max_length)
{
if (Count)
@@ -533,21 +532,21 @@ int _my_b_read(register IO_CACHE *info, byte *Buffer, uint Count)
}
length=0; /* Didn't read any chars */
}
- else if ((length=my_read(info->file,info->buffer,(uint) max_length,
- info->myflags)) < Count ||
- length == (uint) -1)
+ else if ((length= my_read(info->file,info->buffer, max_length,
+ info->myflags)) < Count ||
+ length == (size_t) -1)
{
- if (length != (uint) -1)
- memcpy(Buffer,info->buffer,(size_t) length);
+ if (length != (size_t) -1)
+ memcpy(Buffer, info->buffer, length);
info->pos_in_file= pos_in_file;
- info->error= length == (uint) -1 ? -1 : (int) (length+left_length);
+ info->error= length == (size_t) -1 ? -1 : (int) (length+left_length);
info->read_pos=info->read_end=info->buffer;
DBUG_RETURN(1);
}
info->read_pos=info->buffer+Count;
info->read_end=info->buffer+length;
info->pos_in_file=pos_in_file;
- memcpy(Buffer,info->buffer,(size_t) Count);
+ memcpy(Buffer, info->buffer, Count);
DBUG_RETURN(0);
}
@@ -859,8 +858,9 @@ static int lock_io_cache(IO_CACHE *cache, my_off_t pos)
/* Another thread did read the block already. */
}
DBUG_PRINT("io_cache_share", ("reader awoke, going to process %u bytes",
- cshare->read_end ? (uint)
- (cshare->read_end - cshare->buffer) : 0));
+ (uint) (cshare->read_end ? (size_t)
+ (cshare->read_end - cshare->buffer) :
+ 0)));
/*
Leave the lock. Do not call unlock_io_cache() later. The thread that
@@ -952,33 +952,33 @@ static void unlock_io_cache(IO_CACHE *cache)
1 Error: can't read requested characters
*/
-int _my_b_read_r(register IO_CACHE *cache, byte *Buffer, uint Count)
+int _my_b_read_r(register IO_CACHE *cache, uchar *Buffer, size_t Count)
{
my_off_t pos_in_file;
- uint length, diff_length, left_length;
+ size_t length, diff_length, left_length;
IO_CACHE_SHARE *cshare= cache->share;
DBUG_ENTER("_my_b_read_r");
- if ((left_length= (uint) (cache->read_end - cache->read_pos)))
+ if ((left_length= (size_t) (cache->read_end - cache->read_pos)))
{
DBUG_ASSERT(Count >= left_length); /* User is not using my_b_read() */
- memcpy(Buffer, cache->read_pos, (size_t) (left_length));
+ memcpy(Buffer, cache->read_pos, left_length);
Buffer+= left_length;
Count-= left_length;
}
while (Count)
{
- int cnt, len;
+ size_t cnt, len;
pos_in_file= cache->pos_in_file + (cache->read_end - cache->buffer);
- diff_length= (uint) (pos_in_file & (IO_SIZE-1));
+ diff_length= (size_t) (pos_in_file & (IO_SIZE-1));
length=IO_ROUND_UP(Count+diff_length)-diff_length;
length= ((length <= cache->read_length) ?
length + IO_ROUND_DN(cache->read_length - length) :
length - IO_ROUND_UP(length - cache->read_length));
if (cache->type != READ_FIFO &&
(length > (cache->end_of_file - pos_in_file)))
- length= (uint) (cache->end_of_file - pos_in_file);
+ length= (size_t) (cache->end_of_file - pos_in_file);
if (length == 0)
{
cache->error= (int) left_length;
@@ -1013,12 +1013,12 @@ int _my_b_read_r(register IO_CACHE *cache, byte *Buffer, uint Count)
DBUG_RETURN(1);
}
}
- len= (int) my_read(cache->file, cache->buffer, length, cache->myflags);
+ len= my_read(cache->file, cache->buffer, length, cache->myflags);
}
- DBUG_PRINT("io_cache_share", ("read %d bytes", len));
+ DBUG_PRINT("io_cache_share", ("read %lu bytes", (ulong) len));
- cache->read_end= cache->buffer + (len == -1 ? 0 : len);
- cache->error= (len == (int)length ? 0 : len);
+ cache->read_end= cache->buffer + (len == (size_t) -1 ? 0 : len);
+ cache->error= (len == length ? 0 : (int) len);
cache->pos_in_file= pos_in_file;
/* Copy important values to the share. */
@@ -1039,19 +1039,20 @@ int _my_b_read_r(register IO_CACHE *cache, byte *Buffer, uint Count)
cache->read_end= cshare->read_end;
cache->pos_in_file= cshare->pos_in_file;
- len= (int) ((cache->error == -1) ? -1 : cache->read_end - cache->buffer);
+ len= ((cache->error == -1) ? (size_t) -1 :
+ (size_t) (cache->read_end - cache->buffer));
}
cache->read_pos= cache->buffer;
cache->seek_not_done= 0;
- if (len <= 0)
+ if (len == 0 || len == (size_t) -1)
{
- DBUG_PRINT("io_cache_share", ("reader error. len %d left %u",
- len, left_length));
+ DBUG_PRINT("io_cache_share", ("reader error. len %lu left %lu",
+ (ulong) len, (ulong) left_length));
cache->error= (int) left_length;
DBUG_RETURN(1);
}
- cnt= ((uint) len > Count) ? (int) Count : len;
- memcpy(Buffer, cache->read_pos, (size_t) cnt);
+ cnt= (len > Count) ? Count : len;
+ memcpy(Buffer, cache->read_pos, cnt);
Count -= cnt;
Buffer+= cnt;
left_length+= cnt;
@@ -1079,7 +1080,7 @@ int _my_b_read_r(register IO_CACHE *cache, byte *Buffer, uint Count)
*/
static void copy_to_read_buffer(IO_CACHE *write_cache,
- const byte *write_buffer, uint write_length)
+ const uchar *write_buffer, size_t write_length)
{
IO_CACHE_SHARE *cshare= write_cache->share;
@@ -1090,7 +1091,7 @@ static void copy_to_read_buffer(IO_CACHE *write_cache,
*/
while (write_length)
{
- uint copy_length= min(write_length, write_cache->buffer_length);
+ size_t copy_length= min(write_length, write_cache->buffer_length);
int __attribute__((unused)) rc;
rc= lock_io_cache(write_cache, write_cache->pos_in_file);
@@ -1126,33 +1127,32 @@ static void copy_to_read_buffer(IO_CACHE *write_cache,
1 Failed to read
*/
-int _my_b_seq_read(register IO_CACHE *info, byte *Buffer, uint Count)
+int _my_b_seq_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
{
- uint length,diff_length,left_length,save_count;
- my_off_t max_length, pos_in_file;
+ size_t length, diff_length, left_length, save_count, max_length;
+ my_off_t pos_in_file;
save_count=Count;
/* first, read the regular buffer */
- if ((left_length=(uint) (info->read_end-info->read_pos)))
+ if ((left_length=(size_t) (info->read_end-info->read_pos)))
{
DBUG_ASSERT(Count > left_length); /* User is not using my_b_read() */
- memcpy(Buffer,info->read_pos, (size_t) (left_length));
+ memcpy(Buffer,info->read_pos, left_length);
Buffer+=left_length;
Count-=left_length;
}
lock_append_buffer(info);
/* pos_in_file always point on where info->buffer was read */
- if ((pos_in_file=info->pos_in_file+(uint) (info->read_end - info->buffer)) >=
- info->end_of_file)
+ if ((pos_in_file=info->pos_in_file +
+ (size_t) (info->read_end - info->buffer)) >= info->end_of_file)
goto read_append_buffer;
/*
With read-append cache we must always do a seek before we read,
because the write could have moved the file pointer astray
*/
- if (my_seek(info->file,pos_in_file,MY_SEEK_SET,MYF(0))
- == MY_FILEPOS_ERROR)
+ if (my_seek(info->file,pos_in_file,MY_SEEK_SET,MYF(0)) == MY_FILEPOS_ERROR)
{
info->error= -1;
unlock_append_buffer(info);
@@ -1160,16 +1160,17 @@ int _my_b_seq_read(register IO_CACHE *info, byte *Buffer, uint Count)
}
info->seek_not_done=0;
- diff_length=(uint) (pos_in_file & (IO_SIZE-1));
+ diff_length= (size_t) (pos_in_file & (IO_SIZE-1));
/* now the second stage begins - read from file descriptor */
- if (Count >= (uint) (IO_SIZE+(IO_SIZE-diff_length)))
- { /* Fill first intern buffer */
- uint read_length;
+ if (Count >= (size_t) (IO_SIZE+(IO_SIZE-diff_length)))
+ {
+ /* Fill first intern buffer */
+ size_t read_length;
- length=(Count & (uint) ~(IO_SIZE-1))-diff_length;
- if ((read_length=my_read(info->file,Buffer,(uint) length,info->myflags)) ==
- (uint)-1)
+ length=(Count & (size_t) ~(IO_SIZE-1))-diff_length;
+ if ((read_length= my_read(info->file,Buffer, length,
+ info->myflags)) == (size_t) -1)
{
info->error= -1;
unlock_append_buffer(info);
@@ -1179,7 +1180,7 @@ int _my_b_seq_read(register IO_CACHE *info, byte *Buffer, uint Count)
Buffer+=read_length;
pos_in_file+=read_length;
- if (read_length != (uint) length)
+ if (read_length != length)
{
/*
We only got part of data; Read the rest of the data from the
@@ -1191,9 +1192,9 @@ int _my_b_seq_read(register IO_CACHE *info, byte *Buffer, uint Count)
diff_length=0;
}
- max_length=info->read_length-diff_length;
+ max_length= info->read_length-diff_length;
if (max_length > (info->end_of_file - pos_in_file))
- max_length = info->end_of_file - pos_in_file;
+ max_length= (size_t) (info->end_of_file - pos_in_file);
if (!max_length)
{
if (Count)
@@ -1202,9 +1203,8 @@ int _my_b_seq_read(register IO_CACHE *info, byte *Buffer, uint Count)
}
else
{
- length=my_read(info->file,info->buffer,(uint) max_length,
- info->myflags);
- if (length == (uint) -1)
+ length= my_read(info->file,info->buffer, max_length, info->myflags);
+ if (length == (size_t) -1)
{
info->error= -1;
unlock_append_buffer(info);
@@ -1212,7 +1212,7 @@ int _my_b_seq_read(register IO_CACHE *info, byte *Buffer, uint Count)
}
if (length < Count)
{
- memcpy(Buffer,info->buffer,(size_t) length);
+ memcpy(Buffer, info->buffer, length);
Count -= length;
Buffer += length;
@@ -1241,9 +1241,9 @@ read_append_buffer:
{
/* First copy the data to Count */
- uint len_in_buff = (uint) (info->write_pos - info->append_read_pos);
- uint copy_len;
- uint transfer_len;
+ size_t len_in_buff = (size_t) (info->write_pos - info->append_read_pos);
+ size_t copy_len;
+ size_t transfer_len;
DBUG_ASSERT(info->append_read_pos <= info->write_pos);
/*
@@ -1288,15 +1288,16 @@ read_append_buffer:
0 Success
1 An error has occurred; IO_CACHE to error state.
*/
-int _my_b_async_read(register IO_CACHE *info, byte *Buffer, uint Count)
+
+int _my_b_async_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
{
- uint length,read_length,diff_length,left_length,use_length,org_Count;
- my_off_t max_length;
+ size_t length,read_length,diff_length,left_length,use_length,org_Count;
+ size_t max_length;
my_off_t next_pos_in_file;
- byte *read_buffer;
+ uchar *read_buffer;
memcpy(Buffer,info->read_pos,
- (size_t) (left_length=(uint) (info->read_end-info->read_pos)));
+ (left_length= (size_t) (info->read_end-info->read_pos)));
Buffer+=left_length;
org_Count=Count;
Count-=left_length;
@@ -1315,15 +1316,15 @@ int _my_b_async_read(register IO_CACHE *info, byte *Buffer, uint Count)
info->error= -1;
return(1);
}
- if (! (read_length = (uint) info->aio_result.result.aio_return) ||
- read_length == (uint) -1)
+ if (! (read_length= (size_t) info->aio_result.result.aio_return) ||
+ read_length == (size_t) -1)
{
my_errno=0; /* For testing */
- info->error= (read_length == (uint) -1 ? -1 :
+ info->error= (read_length == (size_t) -1 ? -1 :
(int) (read_length+left_length));
return(1);
}
- info->pos_in_file+=(uint) (info->read_end - info->request_pos);
+ info->pos_in_file+= (size_t) (info->read_end - info->request_pos);
if (info->request_pos != info->buffer)
info->request_pos=info->buffer;
@@ -1354,7 +1355,7 @@ int _my_b_async_read(register IO_CACHE *info, byte *Buffer, uint Count)
if (info->aio_read_pos > info->pos_in_file)
{
my_errno=EINVAL;
- return(info->read_length= -1);
+ return(info->read_length= (size_t) -1);
}
#endif
/* Copy found bytes to buffer */
@@ -1367,7 +1368,7 @@ int _my_b_async_read(register IO_CACHE *info, byte *Buffer, uint Count)
info->read_pos+=length;
}
else
- next_pos_in_file=(info->pos_in_file+ (uint)
+ next_pos_in_file=(info->pos_in_file+ (size_t)
(info->read_end - info->request_pos));
/* If reading large blocks, or first read or read with skip */
@@ -1386,11 +1387,11 @@ int _my_b_async_read(register IO_CACHE *info, byte *Buffer, uint Count)
return (1);
}
- read_length=IO_SIZE*2- (uint) (next_pos_in_file & (IO_SIZE-1));
+ read_length=IO_SIZE*2- (size_t) (next_pos_in_file & (IO_SIZE-1));
if (Count < read_length)
{ /* Small block, read to cache */
if ((read_length=my_read(info->file,info->request_pos,
- read_length, info->myflags)) == (uint) -1)
+ read_length, info->myflags)) == (size_t) -1)
return info->error= -1;
use_length=min(Count,read_length);
memcpy(Buffer,info->request_pos,(size_t) use_length);
@@ -1410,10 +1411,10 @@ int _my_b_async_read(register IO_CACHE *info, byte *Buffer, uint Count)
}
else
{ /* Big block, don't cache it */
- if ((read_length=my_read(info->file,Buffer,(uint) Count,info->myflags))
+ if ((read_length= my_read(info->file,Buffer, Count,info->myflags))
!= Count)
{
- info->error= read_length == (uint) -1 ? -1 : read_length+left_length;
+ info->error= read_length == (size_t) -1 ? -1 : read_length+left_length;
return 1;
}
info->read_pos=info->read_end=info->request_pos;
@@ -1421,12 +1422,12 @@ int _my_b_async_read(register IO_CACHE *info, byte *Buffer, uint Count)
}
}
- /* Read next block with asyncronic io */
- max_length=info->end_of_file - next_pos_in_file;
+ /* Read next block with asyncronic io */
diff_length=(next_pos_in_file & (IO_SIZE-1));
+ max_length= info->read_length - diff_length;
+ if (max_length > info->end_of_file - next_pos_in_file)
+ max_length= (size_t) (info->end_of_file - next_pos_in_file);
- if (max_length > (my_off_t) info->read_length - diff_length)
- max_length= (my_off_t) info->read_length - diff_length;
if (info->request_pos != info->buffer)
read_buffer=info->buffer;
else
@@ -1435,9 +1436,9 @@ int _my_b_async_read(register IO_CACHE *info, byte *Buffer, uint Count)
if (max_length)
{
info->aio_result.result.aio_errno=AIO_INPROGRESS; /* Marker for test */
- DBUG_PRINT("aioread",("filepos: %ld length: %ld",
- (ulong) next_pos_in_file,(ulong) max_length));
- if (aioread(info->file,read_buffer,(int) max_length,
+ DBUG_PRINT("aioread",("filepos: %ld length: %lu",
+ (ulong) next_pos_in_file, (ulong) max_length));
+ if (aioread(info->file,read_buffer, max_length,
(my_off_t) next_pos_in_file,MY_SEEK_SET,
&info->aio_result.result))
{ /* Skip async io */
@@ -1447,7 +1448,7 @@ int _my_b_async_read(register IO_CACHE *info, byte *Buffer, uint Count)
if (info->request_pos != info->buffer)
{
bmove(info->buffer,info->request_pos,
- (uint) (info->read_end - info->read_pos));
+ (size_t) (info->read_end - info->read_pos));
info->request_pos=info->buffer;
info->read_pos-=info->read_length;
info->read_end-=info->read_length;
@@ -1467,7 +1468,7 @@ int _my_b_async_read(register IO_CACHE *info, byte *Buffer, uint Count)
int _my_b_get(IO_CACHE *info)
{
- byte buff;
+ uchar buff;
IO_CACHE_CALLBACK pre_read,post_read;
if ((pre_read = info->pre_read))
(*pre_read)(info);
@@ -1488,9 +1489,9 @@ int _my_b_get(IO_CACHE *info)
-1 On error; my_errno contains error code.
*/
-int _my_b_write(register IO_CACHE *info, const byte *Buffer, uint Count)
+int _my_b_write(register IO_CACHE *info, const uchar *Buffer, size_t Count)
{
- uint rest_length,length;
+ size_t rest_length,length;
if (info->pos_in_file+info->buffer_length > info->end_of_file)
{
@@ -1498,7 +1499,7 @@ int _my_b_write(register IO_CACHE *info, const byte *Buffer, uint Count)
return info->error = -1;
}
- rest_length=(uint) (info->write_end - info->write_pos);
+ rest_length= (size_t) (info->write_end - info->write_pos);
memcpy(info->write_pos,Buffer,(size_t) rest_length);
Buffer+=rest_length;
Count-=rest_length;
@@ -1508,7 +1509,7 @@ int _my_b_write(register IO_CACHE *info, const byte *Buffer, uint Count)
return 1;
if (Count >= IO_SIZE)
{ /* Fill first intern buffer */
- length=Count & (uint) ~(IO_SIZE-1);
+ length=Count & (size_t) ~(IO_SIZE-1);
if (info->seek_not_done)
{
/*
@@ -1524,7 +1525,7 @@ int _my_b_write(register IO_CACHE *info, const byte *Buffer, uint Count)
}
info->seek_not_done=0;
}
- if (my_write(info->file,Buffer,(uint) length,info->myflags | MY_NABP))
+ if (my_write(info->file, Buffer, length, info->myflags | MY_NABP))
return info->error= -1;
#ifdef THREAD
@@ -1559,9 +1560,9 @@ int _my_b_write(register IO_CACHE *info, const byte *Buffer, uint Count)
the write buffer before we are ready with it.
*/
-int my_b_append(register IO_CACHE *info, const byte *Buffer, uint Count)
+int my_b_append(register IO_CACHE *info, const uchar *Buffer, size_t Count)
{
- uint rest_length,length;
+ size_t rest_length,length;
#ifdef THREAD
/*
@@ -1572,10 +1573,10 @@ int my_b_append(register IO_CACHE *info, const byte *Buffer, uint Count)
#endif
lock_append_buffer(info);
- rest_length=(uint) (info->write_end - info->write_pos);
+ rest_length= (size_t) (info->write_end - info->write_pos);
if (Count <= rest_length)
goto end;
- memcpy(info->write_pos,Buffer,(size_t) rest_length);
+ memcpy(info->write_pos, Buffer, rest_length);
Buffer+=rest_length;
Count-=rest_length;
info->write_pos+=rest_length;
@@ -1586,8 +1587,8 @@ int my_b_append(register IO_CACHE *info, const byte *Buffer, uint Count)
}
if (Count >= IO_SIZE)
{ /* Fill first intern buffer */
- length=Count & (uint) ~(IO_SIZE-1);
- if (my_write(info->file,Buffer,(uint) length,info->myflags | MY_NABP))
+ length=Count & (size_t) ~(IO_SIZE-1);
+ if (my_write(info->file,Buffer, length, info->myflags | MY_NABP))
{
unlock_append_buffer(info);
return info->error= -1;
@@ -1605,7 +1606,7 @@ end:
}
-int my_b_safe_write(IO_CACHE *info, const byte *Buffer, uint Count)
+int my_b_safe_write(IO_CACHE *info, const uchar *Buffer, size_t Count)
{
/*
Sasha: We are not writing this with the ? operator to avoid hitting
@@ -1625,10 +1626,10 @@ int my_b_safe_write(IO_CACHE *info, const byte *Buffer, uint Count)
we will never get a seek over the end of the buffer
*/
-int my_block_write(register IO_CACHE *info, const byte *Buffer, uint Count,
+int my_block_write(register IO_CACHE *info, const uchar *Buffer, size_t Count,
my_off_t pos)
{
- uint length;
+ size_t length;
int error=0;
#ifdef THREAD
@@ -1648,7 +1649,7 @@ int my_block_write(register IO_CACHE *info, const byte *Buffer, uint Count,
/* Write the part of the block that is before buffer */
length= (uint) (info->pos_in_file - pos);
if (my_pwrite(info->file, Buffer, length, pos, info->myflags | MY_NABP))
- info->error=error=-1;
+ info->error= error= -1;
Buffer+=length;
pos+= length;
Count-= length;
@@ -1658,10 +1659,10 @@ int my_block_write(register IO_CACHE *info, const byte *Buffer, uint Count,
}
/* Check if we want to write inside the used part of the buffer.*/
- length= (uint) (info->write_end - info->buffer);
+ length= (size_t) (info->write_end - info->buffer);
if (pos < info->pos_in_file + length)
{
- uint offset= (uint) (pos - info->pos_in_file);
+ size_t offset= (size_t) (pos - info->pos_in_file);
length-=offset;
if (length > Count)
length=Count;
@@ -1696,7 +1697,7 @@ int my_block_write(register IO_CACHE *info, const byte *Buffer, uint Count,
int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock)
{
- uint length;
+ size_t length;
my_bool append_cache;
my_off_t pos_in_file;
DBUG_ENTER("my_b_flush_io_cache");
@@ -1713,7 +1714,7 @@ int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock)
}
LOCK_APPEND_BUFFER;
- if ((length=(uint) (info->write_pos - info->write_buffer)))
+ if ((length=(size_t) (info->write_pos - info->write_buffer)))
{
#ifdef THREAD
/*
@@ -1821,8 +1822,8 @@ int end_io_cache(IO_CACHE *info)
info->alloced_buffer=0;
if (info->file != -1) /* File doesn't exist */
error= my_b_flush_io_cache(info,1);
- my_free((gptr) info->buffer,MYF(MY_WME));
- info->buffer=info->read_pos=(byte*) 0;
+ my_free((uchar*) info->buffer,MYF(MY_WME));
+ info->buffer=info->read_pos=(uchar*) 0;
}
if (info->type == SEQ_READ_APPEND)
{
diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c
index bdb5d057a16..c54c7d13548 100644
--- a/mysys/mf_iocache2.c
+++ b/mysys/mf_iocache2.c
@@ -50,7 +50,7 @@
int
my_b_copy_to_file(IO_CACHE *cache, FILE *file)
{
- uint bytes_in_cache;
+ size_t bytes_in_cache;
DBUG_ENTER("my_b_copy_to_file");
/* Reinit the cache to read from the beginning of the cache */
@@ -60,7 +60,7 @@ my_b_copy_to_file(IO_CACHE *cache, FILE *file)
do
{
if (my_fwrite(file, cache->read_pos, bytes_in_cache,
- MYF(MY_WME | MY_NABP)) == (uint) -1)
+ MYF(MY_WME | MY_NABP)) == (size_t) -1)
DBUG_RETURN(1);
cache->read_pos= cache->read_end;
} while ((bytes_in_cache= my_b_fill(cache)));
@@ -175,18 +175,24 @@ void my_b_seek(IO_CACHE *info,my_off_t pos)
/*
- Fill buffer. Note that this assumes that you have already used
- all characters in the CACHE, independent of the read_pos value!
- return: 0 on error or EOF (info->error = -1 on error)
- number of characters
+ Fill buffer of the cache.
+
+ NOTES
+ This assumes that you have already used all characters in the CACHE,
+ independent of the read_pos value!
+
+ RETURN
+ 0 On error or EOF (info->error = -1 on error)
+ # Number of characters
*/
-uint my_b_fill(IO_CACHE *info)
+
+size_t my_b_fill(IO_CACHE *info)
{
my_off_t pos_in_file=(info->pos_in_file+
- (uint) (info->read_end - info->buffer));
- my_off_t max_length;
- uint diff_length,length;
+ (size_t) (info->read_end - info->buffer));
+ size_t diff_length, length, max_length;
+
if (info->seek_not_done)
{ /* File touched, do seek */
if (my_seek(info->file,pos_in_file,MY_SEEK_SET,MYF(0)) ==
@@ -197,17 +203,18 @@ uint my_b_fill(IO_CACHE *info)
}
info->seek_not_done=0;
}
- diff_length=(uint) (pos_in_file & (IO_SIZE-1));
- max_length= (my_off_t) (info->end_of_file - pos_in_file);
- if (max_length > (my_off_t) (info->read_length-diff_length))
- max_length=(my_off_t) (info->read_length-diff_length);
+ diff_length=(size_t) (pos_in_file & (IO_SIZE-1));
+ max_length=(info->read_length-diff_length);
+ if (max_length >= (info->end_of_file - pos_in_file))
+ max_length= (size_t) (info->end_of_file - pos_in_file);
+
if (!max_length)
{
info->error= 0;
return 0; /* EOF */
}
- else if ((length=my_read(info->file,info->buffer,(uint) max_length,
- info->myflags)) == (uint) -1)
+ if ((length= my_read(info->file,info->buffer,max_length,
+ info->myflags)) == (size_t) -1)
{
info->error= -1;
return 0;
@@ -226,18 +233,20 @@ uint my_b_fill(IO_CACHE *info)
If buffer is full then to[max_length-1] will be set to \0.
*/
-uint my_b_gets(IO_CACHE *info, char *to, uint max_length)
+size_t my_b_gets(IO_CACHE *info, char *to, size_t max_length)
{
char *start = to;
- uint length;
+ size_t length;
max_length--; /* Save place for end \0 */
+
/* Calculate number of characters in buffer */
if (!(length= my_b_bytes_in_cache(info)) &&
!(length= my_b_fill(info)))
return 0;
+
for (;;)
{
- char *pos,*end;
+ uchar *pos, *end;
if (length > max_length)
length=max_length;
for (pos=info->read_pos,end=pos+length ; pos < end ;)
@@ -246,7 +255,7 @@ uint my_b_gets(IO_CACHE *info, char *to, uint max_length)
{
info->read_pos=pos;
*to='\0';
- return (uint) (to-start);
+ return (size_t) (to-start);
}
}
if (!(max_length-=length))
@@ -254,7 +263,7 @@ uint my_b_gets(IO_CACHE *info, char *to, uint max_length)
/* Found enough charcters; Return found string */
info->read_pos=pos;
*to='\0';
- return (uint) (to-start);
+ return (size_t) (to-start);
}
if (!(length=my_b_fill(info)))
return 0;
@@ -265,26 +274,22 @@ uint my_b_gets(IO_CACHE *info, char *to, uint max_length)
my_off_t my_b_filelength(IO_CACHE *info)
{
if (info->type == WRITE_CACHE)
- {
return my_b_tell(info);
- }
- else
- {
- info->seek_not_done=1;
- return my_seek(info->file,0L,MY_SEEK_END,MYF(0));
- }
+
+ info->seek_not_done= 1;
+ return my_seek(info->file, 0L, MY_SEEK_END, MYF(0));
}
/*
Simple printf version. Supports '%s', '%d', '%u', "%ld" and "%lu"
Used for logging in MySQL
- returns number of written character, or (uint) -1 on error
+ returns number of written character, or (size_t) -1 on error
*/
-uint my_b_printf(IO_CACHE *info, const char* fmt, ...)
+size_t my_b_printf(IO_CACHE *info, const char* fmt, ...)
{
- int result;
+ size_t result;
va_list args;
va_start(args,fmt);
result=my_b_vprintf(info, fmt, args);
@@ -293,12 +298,13 @@ uint my_b_printf(IO_CACHE *info, const char* fmt, ...)
}
-uint my_b_vprintf(IO_CACHE *info, const char* fmt, va_list args)
+size_t my_b_vprintf(IO_CACHE *info, const char* fmt, va_list args)
{
- uint out_length=0;
+ size_t out_length= 0;
uint minimum_width; /* as yet unimplemented */
uint minimum_width_sign;
uint precision; /* as yet unimplemented for anything but %b */
+ my_bool is_zero_padded;
/*
Store the location of the beginning of a format directive, for the
@@ -312,19 +318,17 @@ uint my_b_vprintf(IO_CACHE *info, const char* fmt, va_list args)
{
/* Copy everything until '%' or end of string */
const char *start=fmt;
- uint length;
+ size_t length;
for (; (*fmt != '\0') && (*fmt != '%'); fmt++) ;
- length= (uint) (fmt - start);
+ length= (size_t) (fmt - start);
out_length+=length;
- if (my_b_write(info, start, length))
+ if (my_b_write(info, (const uchar*) start, length))
goto err;
if (*fmt == '\0') /* End of format */
- {
return out_length;
- }
/*
By this point, *fmt must be a percent; Keep track of this location and
@@ -334,15 +338,34 @@ uint my_b_vprintf(IO_CACHE *info, const char* fmt, va_list args)
backtrack= fmt;
fmt++;
+ is_zero_padded= FALSE;
+ minimum_width_sign= 1;
minimum_width= 0;
precision= 0;
- minimum_width_sign= 1;
/* Skip if max size is used (to be compatible with printf) */
- while (*fmt == '-') { fmt++; minimum_width_sign= -1; }
- if (*fmt == '*') {
+
+process_flags:
+ switch (*fmt)
+ {
+ case '-':
+ minimum_width_sign= -1; fmt++; goto process_flags;
+ case '0':
+ is_zero_padded= TRUE; fmt++; goto process_flags;
+ case '#':
+ /** @todo Implement "#" conversion flag. */ fmt++; goto process_flags;
+ case ' ':
+ /** @todo Implement " " conversion flag. */ fmt++; goto process_flags;
+ case '+':
+ /** @todo Implement "+" conversion flag. */ fmt++; goto process_flags;
+ }
+
+ if (*fmt == '*')
+ {
precision= (int) va_arg(args, int);
fmt++;
- } else {
+ }
+ else
+ {
while (my_isdigit(&my_charset_latin1, *fmt)) {
minimum_width=(minimum_width * 10) + (*fmt - '0');
fmt++;
@@ -350,12 +373,15 @@ uint my_b_vprintf(IO_CACHE *info, const char* fmt, va_list args)
}
minimum_width*= minimum_width_sign;
- if (*fmt == '.') {
+ if (*fmt == '.')
+ {
fmt++;
if (*fmt == '*') {
precision= (int) va_arg(args, int);
fmt++;
- } else {
+ }
+ else
+ {
while (my_isdigit(&my_charset_latin1, *fmt)) {
precision=(precision * 10) + (*fmt - '0');
fmt++;
@@ -366,54 +392,69 @@ uint my_b_vprintf(IO_CACHE *info, const char* fmt, va_list args)
if (*fmt == 's') /* String parameter */
{
reg2 char *par = va_arg(args, char *);
- uint length2 = (uint) strlen(par);
- /* TODO: implement minimum width and precision */
+ size_t length2 = strlen(par);
+ /* TODO: implement precision */
out_length+= length2;
- if (my_b_write(info, par, length2))
+ if (my_b_write(info, (uchar*) par, length2))
goto err;
}
else if (*fmt == 'b') /* Sized buffer parameter, only precision makes sense */
{
char *par = va_arg(args, char *);
out_length+= precision;
- if (my_b_write(info, par, precision))
+ if (my_b_write(info, (uchar*) par, precision))
goto err;
}
else if (*fmt == 'd' || *fmt == 'u') /* Integer parameter */
{
register int iarg;
- uint length2;
+ size_t length2;
char buff[17];
iarg = va_arg(args, int);
if (*fmt == 'd')
- length2= (uint) (int10_to_str((long) iarg,buff, -10) - buff);
+ length2= (size_t) (int10_to_str((long) iarg,buff, -10) - buff);
else
- length2= (uint) (int10_to_str((long) (uint) iarg,buff,10)- buff);
+ length2= (uint) (int10_to_str((long) (uint) iarg,buff,10)- buff);
+
+ /* minimum width padding */
+ if (minimum_width > length2)
+ {
+ char *buffz;
+
+ buffz= my_alloca(minimum_width - length2);
+ if (is_zero_padded)
+ memset(buffz, '0', minimum_width - length2);
+ else
+ memset(buffz, ' ', minimum_width - length2);
+ my_b_write(info, buffz, minimum_width - length2);
+ my_afree(buffz);
+ }
+
out_length+= length2;
- if (my_b_write(info, buff, length2))
+ if (my_b_write(info, (uchar*) buff, length2))
goto err;
}
else if ((*fmt == 'l' && fmt[1] == 'd') || fmt[1] == 'u')
/* long parameter */
{
register long iarg;
- uint length2;
+ size_t length2;
char buff[17];
iarg = va_arg(args, long);
if (*++fmt == 'd')
- length2= (uint) (int10_to_str(iarg,buff, -10) - buff);
+ length2= (size_t) (int10_to_str(iarg,buff, -10) - buff);
else
- length2= (uint) (int10_to_str(iarg,buff,10)- buff);
+ length2= (size_t) (int10_to_str(iarg,buff,10)- buff);
out_length+= length2;
- if (my_b_write(info, buff, length2))
+ if (my_b_write(info, (uchar*) buff, length2))
goto err;
}
else
{
/* %% or unknown code */
- if (my_b_write(info, backtrack, fmt-backtrack))
+ if (my_b_write(info, (uchar*) backtrack, (size_t) (fmt-backtrack)))
goto err;
out_length+= fmt-backtrack;
}
@@ -421,5 +462,5 @@ uint my_b_vprintf(IO_CACHE *info, const char* fmt, va_list args)
return out_length;
err:
- return (uint) -1;
+ return (size_t) -1;
}
diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c
index 86394fec239..c81da9a469a 100644
--- a/mysys/mf_keycache.c
+++ b/mysys/mf_keycache.c
@@ -36,6 +36,69 @@
blocks_unused is the sum of never used blocks in the pool and of currently
free blocks. blocks_used is the number of blocks fetched from the pool and
as such gives the maximum number of in-use blocks at any time.
+
+ Key Cache Locking
+ =================
+
+ All key cache locking is done with a single mutex per key cache:
+ keycache->cache_lock. This mutex is locked almost all the time
+ when executing code in this file (mf_keycache.c).
+ However it is released for I/O and some copy operations.
+
+ The cache_lock is also released when waiting for some event. Waiting
+ and signalling is done via condition variables. In most cases the
+ thread waits on its thread->suspend condition variable. Every thread
+ has a my_thread_var structure, which contains this variable and a
+ '*next' and '**prev' pointer. These pointers are used to insert the
+ thread into a wait queue.
+
+ A thread can wait for one block and thus be in one wait queue at a
+ time only.
+
+ Before starting to wait on its condition variable with
+ pthread_cond_wait(), the thread enters itself to a specific wait queue
+ with link_into_queue() (double linked with '*next' + '**prev') or
+ wait_on_queue() (single linked with '*next').
+
+ Another thread, when releasing a resource, looks up the waiting thread
+ in the related wait queue. It sends a signal with
+ pthread_cond_signal() to the waiting thread.
+
+ NOTE: Depending on the particular wait situation, either the sending
+ thread removes the waiting thread from the wait queue with
+ unlink_from_queue() or release_whole_queue() respectively, or the waiting
+ thread removes itself.
+
+ There is one exception from this locking scheme when one thread wants
+ to reuse a block for some other address. This works by first marking
+ the block reserved (status= BLOCK_IN_SWITCH) and then waiting for all
+ threads that are reading the block to finish. Each block has a
+ reference to a condition variable (condvar). It holds a reference to
+ the thread->suspend condition variable for the waiting thread (if such
+ a thread exists). When that thread is signaled, the reference is
+ cleared. The number of readers of a block is registered in
+ block->hash_link->requests. See wait_for_readers() / remove_reader()
+ for details. This is similar to the above, but it clearly means that
+ only one thread can wait for a particular block. There is no queue in
+ this case. Strangely enough block->convar is used for waiting for the
+ assigned hash_link only. More precisely it is used to wait for all
+ requests to be unregistered from the assigned hash_link.
+
+ The resize_queue serves two purposes:
+ 1. Threads that want to do a resize wait there if in_resize is set.
+ This is not used in the server. The server refuses a second resize
+ request if one is already active. keycache->in_init is used for the
+ synchronization. See set_var.cc.
+ 2. Threads that want to access blocks during resize wait here during
+ the re-initialization phase.
+ When the resize is done, all threads on the queue are signalled.
+ Hypothetical resizers can compete for resizing, and read/write
+ requests will restart to request blocks from the freshly resized
+ cache. If the cache has been resized too small, it is disabled and
+ 'can_be_used' is false. In this case read/write requests bypass the
+ cache. Since they increment and decrement 'cnt_for_resize_op', the
+ next resizer can wait on the queue 'waiting_for_resize_cnt' until all
+ I/O finished.
*/
#include "mysys_priv.h"
@@ -111,12 +174,16 @@ struct st_hash_link
};
/* simple states of a block */
-#define BLOCK_ERROR 1 /* an error occured when performing disk i/o */
-#define BLOCK_READ 2 /* the is page in the block buffer */
-#define BLOCK_IN_SWITCH 4 /* block is preparing to read new page */
-#define BLOCK_REASSIGNED 8 /* block does not accept requests for old page */
-#define BLOCK_IN_FLUSH 16 /* block is in flush operation */
-#define BLOCK_CHANGED 32 /* block buffer contains a dirty page */
+#define BLOCK_ERROR 1 /* an error occured when performing file i/o */
+#define BLOCK_READ 2 /* file block is in the block buffer */
+#define BLOCK_IN_SWITCH 4 /* block is preparing to read new page */
+#define BLOCK_REASSIGNED 8 /* blk does not accept requests for old page */
+#define BLOCK_IN_FLUSH 16 /* block is selected for flush */
+#define BLOCK_CHANGED 32 /* block buffer contains a dirty page */
+#define BLOCK_IN_USE 64 /* block is not free */
+#define BLOCK_IN_EVICTION 128 /* block is selected for eviction */
+#define BLOCK_IN_FLUSHWRITE 256 /* block is in write to file */
+#define BLOCK_FOR_UPDATE 512 /* block is selected for buffer modification */
/* page status, returned by find_key_block */
#define PAGE_READ 0
@@ -136,7 +203,7 @@ struct st_block_link
struct st_hash_link *hash_link; /* backward ptr to referring hash_link */
KEYCACHE_WQUEUE wqueue[2]; /* queues on waiting requests for new/old pages */
uint requests; /* number of requests for the block */
- byte *buffer; /* buffer for the block page */
+ uchar *buffer; /* buffer for the block page */
uint offset; /* beginning of modified data in the buffer */
uint length; /* end of data in the buffer */
uint status; /* state of the block */
@@ -153,19 +220,21 @@ KEY_CACHE *dflt_key_cache= &dflt_key_cache_var;
static int flush_all_key_blocks(KEY_CACHE *keycache);
#ifdef THREAD
-static void link_into_queue(KEYCACHE_WQUEUE *wqueue,
- struct st_my_thread_var *thread);
-static void unlink_from_queue(KEYCACHE_WQUEUE *wqueue,
- struct st_my_thread_var *thread);
+static void wait_on_queue(KEYCACHE_WQUEUE *wqueue,
+ pthread_mutex_t *mutex);
+static void release_whole_queue(KEYCACHE_WQUEUE *wqueue);
+#else
+#define wait_on_queue(wqueue, mutex) do {} while (0)
+#define release_whole_queue(wqueue) do {} while (0)
#endif
static void free_block(KEY_CACHE *keycache, BLOCK_LINK *block);
-#ifndef DBUG_OFF
+#if !defined(DBUG_OFF)
static void test_key_cache(KEY_CACHE *keycache,
const char *where, my_bool lock);
#endif
#define KEYCACHE_HASH(f, pos) \
-(((ulong) ((pos) >> keycache->key_cache_shift)+ \
+(((ulong) ((pos) / keycache->key_cache_block_size) + \
(ulong) (f)) & (keycache->hash_entries-1))
#define FILE_HASH(f) ((uint) (f) & (CHANGED_BLOCKS_HASH-1))
@@ -255,6 +324,16 @@ static int keycache_pthread_cond_signal(pthread_cond_t *cond);
#define keycache_pthread_cond_signal pthread_cond_signal
#endif /* defined(KEYCACHE_DEBUG) */
+#if !defined(DBUG_OFF)
+#if defined(inline)
+#undef inline
+#endif
+#define inline /* disabled inline for easier debugging */
+static int fail_block(BLOCK_LINK *block);
+static int fail_hlink(HASH_LINK *hlink);
+static int cache_empty(KEY_CACHE *keycache);
+#endif
+
static inline uint next_power(uint value)
{
return (uint) my_round_up_to_next_power((uint32) value) << 1;
@@ -287,10 +366,11 @@ static inline uint next_power(uint value)
*/
int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
- ulong use_mem, uint division_limit,
+ size_t use_mem, uint division_limit,
uint age_threshold)
{
- uint blocks, hash_links, length;
+ ulong blocks, hash_links;
+ size_t length;
int error;
DBUG_ENTER("init_key_cache");
DBUG_ASSERT(key_cache_block_size >= 512);
@@ -308,6 +388,14 @@ int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
if (! keycache->key_cache_inited)
{
keycache->key_cache_inited= 1;
+ /*
+ Initialize these variables once only.
+ Their value must survive re-initialization during resizing.
+ */
+ keycache->in_resize= 0;
+ keycache->resize_in_flush= 0;
+ keycache->cnt_for_resize_op= 0;
+ keycache->waiting_for_resize_cnt.last_thread= NULL;
keycache->in_init= 0;
pthread_mutex_init(&keycache->cache_lock, MY_MUTEX_INIT_FAST);
keycache->resize_queue.last_thread= NULL;
@@ -315,14 +403,13 @@ int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
keycache->key_cache_mem_size= use_mem;
keycache->key_cache_block_size= key_cache_block_size;
- keycache->key_cache_shift= my_bit_log2(key_cache_block_size);
DBUG_PRINT("info", ("key_cache_block_size: %u",
key_cache_block_size));
- blocks= (uint) (use_mem / (sizeof(BLOCK_LINK) + 2 * sizeof(HASH_LINK) +
- sizeof(HASH_LINK*) * 5/4 + key_cache_block_size));
+ blocks= (ulong) (use_mem / (sizeof(BLOCK_LINK) + 2 * sizeof(HASH_LINK) +
+ sizeof(HASH_LINK*) * 5/4 + key_cache_block_size));
/* It doesn't make sense to have too few blocks (less than 8) */
- if (blocks >= 8 && keycache->disk_blocks < 0)
+ if (blocks >= 8)
{
for ( ; ; )
{
@@ -338,18 +425,18 @@ int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
ALIGN_SIZE(hash_links * sizeof(HASH_LINK)) +
ALIGN_SIZE(sizeof(HASH_LINK*) *
keycache->hash_entries))) +
- ((ulong) blocks << keycache->key_cache_shift) > use_mem)
+ ((size_t) blocks * keycache->key_cache_block_size) > use_mem)
blocks--;
/* Allocate memory for cache page buffers */
if ((keycache->block_mem=
- my_large_malloc((ulong) blocks * keycache->key_cache_block_size,
+ my_large_malloc((size_t) blocks * keycache->key_cache_block_size,
MYF(MY_WME))))
{
/*
Allocate memory for blocks, hash_links and hash entries;
For each block 2 hash links are allocated
*/
- if ((keycache->block_root= (BLOCK_LINK*) my_malloc((uint) length,
+ if ((keycache->block_root= (BLOCK_LINK*) my_malloc(length,
MYF(0))))
break;
my_large_free(keycache->block_mem, MYF(0));
@@ -362,7 +449,7 @@ int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
}
blocks= blocks / 4*3;
}
- keycache->blocks_unused= (ulong) blocks;
+ keycache->blocks_unused= blocks;
keycache->disk_blocks= (int) blocks;
keycache->hash_links= hash_links;
keycache->hash_root= (HASH_LINK**) ((char*) keycache->block_root +
@@ -370,11 +457,11 @@ int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
keycache->hash_link_root= (HASH_LINK*) ((char*) keycache->hash_root +
ALIGN_SIZE((sizeof(HASH_LINK*) *
keycache->hash_entries)));
- bzero((byte*) keycache->block_root,
+ bzero((uchar*) keycache->block_root,
keycache->disk_blocks * sizeof(BLOCK_LINK));
- bzero((byte*) keycache->hash_root,
+ bzero((uchar*) keycache->hash_root,
keycache->hash_entries * sizeof(HASH_LINK*));
- bzero((byte*) keycache->hash_link_root,
+ bzero((uchar*) keycache->hash_link_root,
keycache->hash_links * sizeof(HASH_LINK));
keycache->hash_links_used= 0;
keycache->free_hash_list= NULL;
@@ -396,8 +483,6 @@ int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
blocks * age_threshold / 100 :
blocks);
- keycache->cnt_for_resize_op= 0;
- keycache->resize_in_flush= 0;
keycache->can_be_used= 1;
keycache->waiting_for_hash_link.last_thread= NULL;
@@ -408,11 +493,16 @@ int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
keycache->disk_blocks, (long) keycache->block_root,
keycache->hash_entries, (long) keycache->hash_root,
keycache->hash_links, (long) keycache->hash_link_root));
- bzero((gptr) keycache->changed_blocks,
+ bzero((uchar*) keycache->changed_blocks,
sizeof(keycache->changed_blocks[0]) * CHANGED_BLOCKS_HASH);
- bzero((gptr) keycache->file_blocks,
+ bzero((uchar*) keycache->file_blocks,
sizeof(keycache->file_blocks[0]) * CHANGED_BLOCKS_HASH);
}
+ else
+ {
+ /* key_buffer_size is specified too small. Disable the cache. */
+ keycache->can_be_used= 0;
+ }
keycache->blocks= keycache->disk_blocks > 0 ? keycache->disk_blocks : 0;
DBUG_RETURN((int) keycache->disk_blocks);
@@ -423,12 +513,12 @@ err:
keycache->blocks= 0;
if (keycache->block_mem)
{
- my_large_free((gptr) keycache->block_mem, MYF(0));
+ my_large_free((uchar*) keycache->block_mem, MYF(0));
keycache->block_mem= NULL;
}
if (keycache->block_root)
{
- my_free((gptr) keycache->block_root, MYF(0));
+ my_free((uchar*) keycache->block_root, MYF(0));
keycache->block_root= NULL;
}
my_errno= error;
@@ -467,14 +557,10 @@ err:
*/
int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
- ulong use_mem, uint division_limit,
+ size_t use_mem, uint division_limit,
uint age_threshold)
{
int blocks;
-#ifdef THREAD
- struct st_my_thread_var *thread;
- KEYCACHE_WQUEUE *wqueue;
-#endif
DBUG_ENTER("resize_key_cache");
if (!keycache->key_cache_inited)
@@ -490,54 +576,86 @@ int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
keycache_pthread_mutex_lock(&keycache->cache_lock);
#ifdef THREAD
- wqueue= &keycache->resize_queue;
- thread= my_thread_var;
- link_into_queue(wqueue, thread);
-
- while (wqueue->last_thread->next != thread)
+ /*
+ We may need to wait for another thread which is doing a resize
+ already. This cannot happen in the MySQL server though. It allows
+ one resizer only. In set_var.cc keycache->in_init is used to block
+ multiple attempts.
+ */
+ while (keycache->in_resize)
{
- keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock);
+ /* purecov: begin inspected */
+ wait_on_queue(&keycache->resize_queue, &keycache->cache_lock);
+ /* purecov: end */
}
#endif
- keycache->resize_in_flush= 1;
- if (flush_all_key_blocks(keycache))
+ /*
+ Mark the operation in progress. This blocks other threads from doing
+ a resize in parallel. It prohibits new blocks to enter the cache.
+ Read/write requests can bypass the cache during the flush phase.
+ */
+ keycache->in_resize= 1;
+
+ /* Need to flush only if keycache is enabled. */
+ if (keycache->can_be_used)
{
- /* TODO: if this happens, we should write a warning in the log file ! */
+ /* Start the flush phase. */
+ keycache->resize_in_flush= 1;
+
+ if (flush_all_key_blocks(keycache))
+ {
+ /* TODO: if this happens, we should write a warning in the log file ! */
+ keycache->resize_in_flush= 0;
+ blocks= 0;
+ keycache->can_be_used= 0;
+ goto finish;
+ }
+ DBUG_ASSERT(cache_empty(keycache));
+
+ /* End the flush phase. */
keycache->resize_in_flush= 0;
- blocks= 0;
- keycache->can_be_used= 0;
- goto finish;
}
- keycache->resize_in_flush= 0;
- keycache->can_be_used= 0;
+
#ifdef THREAD
+ /*
+ Some direct read/write operations (bypassing the cache) may still be
+ unfinished. Wait until they are done. If the key cache can be used,
+ direct I/O is done in increments of key_cache_block_size. That is,
+ every block is checked if it is in the cache. We need to wait for
+ pending I/O before re-initializing the cache, because we may change
+ the block size. Otherwise they could check for blocks at file
+ positions where the new block division has none. We do also want to
+ wait for I/O done when (if) the cache was disabled. It must not
+ run in parallel with normal cache operation.
+ */
while (keycache->cnt_for_resize_op)
- {
- KEYCACHE_DBUG_PRINT("resize_key_cache: wait",
- ("suspend thread %ld", thread->id));
- keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock);
- }
+ wait_on_queue(&keycache->waiting_for_resize_cnt, &keycache->cache_lock);
#else
KEYCACHE_DBUG_ASSERT(keycache->cnt_for_resize_op == 0);
#endif
+ /*
+ Free old cache structures, allocate new structures, and initialize
+ them. Note that the cache_lock mutex and the resize_queue are left
+ untouched. We do not lose the cache_lock and will release it only at
+ the end of this function.
+ */
end_key_cache(keycache, 0); /* Don't free mutex */
/* The following will work even if use_mem is 0 */
blocks= init_key_cache(keycache, key_cache_block_size, use_mem,
division_limit, age_threshold);
finish:
-#ifdef THREAD
- unlink_from_queue(wqueue, thread);
- /* Signal for the next resize request to proceeed if any */
- if (wqueue->last_thread)
- {
- KEYCACHE_DBUG_PRINT("resize_key_cache: signal",
- ("thread %ld", wqueue->last_thread->next->id));
- keycache_pthread_cond_signal(&wqueue->last_thread->next->suspend);
- }
-#endif
+ /*
+ Mark the resize finished. This allows other threads to start a
+ resize or to request new cache blocks.
+ */
+ keycache->in_resize= 0;
+
+ /* Signal waiting threads. */
+ release_whole_queue(&keycache->resize_queue);
+
keycache_pthread_mutex_unlock(&keycache->cache_lock);
DBUG_RETURN(blocks);
}
@@ -558,18 +676,8 @@ static inline void inc_counter_for_resize_op(KEY_CACHE *keycache)
*/
static inline void dec_counter_for_resize_op(KEY_CACHE *keycache)
{
-#ifdef THREAD
- struct st_my_thread_var *last_thread;
- if (!--keycache->cnt_for_resize_op &&
- (last_thread= keycache->resize_queue.last_thread))
- {
- KEYCACHE_DBUG_PRINT("dec_counter_for_resize_op: signal",
- ("thread %ld", last_thread->next->id));
- keycache_pthread_cond_signal(&last_thread->next->suspend);
- }
-#else
- keycache->cnt_for_resize_op--;
-#endif
+ if (!--keycache->cnt_for_resize_op)
+ release_whole_queue(&keycache->waiting_for_resize_cnt);
}
/*
@@ -631,9 +739,9 @@ void end_key_cache(KEY_CACHE *keycache, my_bool cleanup)
{
if (keycache->block_mem)
{
- my_large_free((gptr) keycache->block_mem, MYF(0));
+ my_large_free((uchar*) keycache->block_mem, MYF(0));
keycache->block_mem= NULL;
- my_free((gptr) keycache->block_root, MYF(0));
+ my_free((uchar*) keycache->block_root, MYF(0));
keycache->block_root= NULL;
}
keycache->disk_blocks= -1;
@@ -660,6 +768,7 @@ void end_key_cache(KEY_CACHE *keycache, my_bool cleanup)
#ifdef THREAD
+
/*
Link a thread into double-linked queue of waiting threads.
@@ -681,6 +790,8 @@ static void link_into_queue(KEYCACHE_WQUEUE *wqueue,
struct st_my_thread_var *thread)
{
struct st_my_thread_var *last;
+
+ DBUG_ASSERT(!thread->next && !thread->prev);
if (! (last= wqueue->last_thread))
{
/* Queue is empty */
@@ -716,6 +827,7 @@ static void unlink_from_queue(KEYCACHE_WQUEUE *wqueue,
struct st_my_thread_var *thread)
{
KEYCACHE_DBUG_PRINT("unlink_from_queue", ("thread %ld", thread->id));
+ DBUG_ASSERT(thread->next && thread->prev);
if (thread->next == thread)
/* The queue contains only one member */
wqueue->last_thread= NULL;
@@ -728,6 +840,13 @@ static void unlink_from_queue(KEYCACHE_WQUEUE *wqueue,
thread->prev);
}
thread->next= NULL;
+#if !defined(DBUG_OFF)
+ /*
+ This makes it easier to see it's not in a chain during debugging.
+ And some DBUG_ASSERT() rely on it.
+ */
+ thread->prev= NULL;
+#endif
}
@@ -735,9 +854,9 @@ static void unlink_from_queue(KEYCACHE_WQUEUE *wqueue,
Add a thread to single-linked queue of waiting threads
SYNOPSIS
- add_to_queue()
- wqueue pointer to the queue structure
- thread pointer to the thread to be added to the queue
+ wait_on_queue()
+ wqueue Pointer to the queue structure.
+ mutex Cache_lock to acquire after awake.
RETURN VALUE
none
@@ -746,12 +865,23 @@ static void unlink_from_queue(KEYCACHE_WQUEUE *wqueue,
Queue is represented by a circular list of the thread structures
The list is single-linked of the type (*next), accessed by a pointer
to the last element.
+
+ The function protects against stray signals by verifying that the
+ current thread is unlinked from the queue when awaking. However,
+ since several threads can wait for the same event, it might be
+ necessary for the caller of the function to check again if the
+ condition for awake is indeed matched.
*/
-static inline void add_to_queue(KEYCACHE_WQUEUE *wqueue,
- struct st_my_thread_var *thread)
+static void wait_on_queue(KEYCACHE_WQUEUE *wqueue,
+ pthread_mutex_t *mutex)
{
struct st_my_thread_var *last;
+ struct st_my_thread_var *thread= my_thread_var;
+
+ /* Add to queue. */
+ DBUG_ASSERT(!thread->next);
+ DBUG_ASSERT(!thread->prev); /* Not required, but must be true anyway. */
if (! (last= wqueue->last_thread))
thread->next= thread;
else
@@ -760,6 +890,17 @@ static inline void add_to_queue(KEYCACHE_WQUEUE *wqueue,
last->next= thread;
}
wqueue->last_thread= thread;
+
+ /*
+ Wait until thread is removed from queue by the signalling thread.
+ The loop protects against stray signals.
+ */
+ do
+ {
+ KEYCACHE_DBUG_PRINT("wait", ("suspend thread %ld", thread->id));
+ keycache_pthread_cond_wait(&thread->suspend, mutex);
+ }
+ while (thread->next);
}
@@ -767,36 +908,47 @@ static inline void add_to_queue(KEYCACHE_WQUEUE *wqueue,
Remove all threads from queue signaling them to proceed
SYNOPSIS
- realease_queue()
- wqueue pointer to the queue structure
- thread pointer to the thread to be added to the queue
+ release_whole_queue()
+ wqueue pointer to the queue structure
RETURN VALUE
none
NOTES.
- See notes for add_to_queue
+ See notes for wait_on_queue().
When removed from the queue each thread is signaled via condition
variable thread->suspend.
*/
-static void release_queue(KEYCACHE_WQUEUE *wqueue)
+static void release_whole_queue(KEYCACHE_WQUEUE *wqueue)
{
- struct st_my_thread_var *last= wqueue->last_thread;
- struct st_my_thread_var *next= last->next;
+ struct st_my_thread_var *last;
+ struct st_my_thread_var *next;
struct st_my_thread_var *thread;
+
+ /* Queue may be empty. */
+ if (!(last= wqueue->last_thread))
+ return;
+
+ next= last->next;
do
{
thread=next;
- KEYCACHE_DBUG_PRINT("release_queue: signal", ("thread %ld", thread->id));
+ KEYCACHE_DBUG_PRINT("release_whole_queue: signal",
+ ("thread %ld", thread->id));
+ /* Signal the thread. */
keycache_pthread_cond_signal(&thread->suspend);
+ /* Take thread from queue. */
next=thread->next;
thread->next= NULL;
}
while (thread != last);
+
+ /* Now queue is definitely empty. */
wqueue->last_thread= NULL;
}
-#endif
+
+#endif /* THREAD */
/*
@@ -805,9 +957,19 @@ static void release_queue(KEYCACHE_WQUEUE *wqueue)
static inline void unlink_changed(BLOCK_LINK *block)
{
+ DBUG_ASSERT(block->prev_changed && *block->prev_changed == block);
if (block->next_changed)
block->next_changed->prev_changed= block->prev_changed;
*block->prev_changed= block->next_changed;
+
+#if !defined(DBUG_OFF)
+ /*
+ This makes it easier to see it's not in a chain during debugging.
+ And some DBUG_ASSERT() rely on it.
+ */
+ block->next_changed= NULL;
+ block->prev_changed= NULL;
+#endif
}
@@ -817,6 +979,8 @@ static inline void unlink_changed(BLOCK_LINK *block)
static inline void link_changed(BLOCK_LINK *block, BLOCK_LINK **phead)
{
+ DBUG_ASSERT(!block->next_changed);
+ DBUG_ASSERT(!block->prev_changed);
block->prev_changed= phead;
if ((block->next_changed= *phead))
(*phead)->prev_changed= &block->next_changed;
@@ -825,14 +989,37 @@ static inline void link_changed(BLOCK_LINK *block, BLOCK_LINK **phead)
/*
- Unlink a block from the chain of dirty/clean blocks, if it's asked for,
- and link it to the chain of clean blocks for the specified file
+ Link a block in a chain of clean blocks of a file.
+
+ SYNOPSIS
+ link_to_file_list()
+ keycache Key cache handle
+ block Block to relink
+ file File to be linked to
+ unlink If to unlink first
+
+ DESCRIPTION
+ Unlink a block from whichever chain it is linked in, if it's
+ asked for, and link it to the chain of clean blocks of the
+ specified file.
+
+ NOTE
+ Please do never set/clear BLOCK_CHANGED outside of
+ link_to_file_list() or link_to_changed_list().
+ You would risk to damage correct counting of changed blocks
+ and to find blocks in the wrong hash.
+
+ RETURN
+ void
*/
static void link_to_file_list(KEY_CACHE *keycache,
BLOCK_LINK *block, int file,
my_bool unlink_block)
{
+ DBUG_ASSERT(block->status & BLOCK_IN_USE);
+ DBUG_ASSERT(block->hash_link && block->hash_link->block == block);
+ DBUG_ASSERT(block->hash_link->file == file);
if (unlink_block)
unlink_changed(block);
link_changed(block, &keycache->file_blocks[FILE_HASH(file)]);
@@ -846,13 +1033,34 @@ static void link_to_file_list(KEY_CACHE *keycache,
/*
- Unlink a block from the chain of clean blocks for the specified
- file and link it to the chain of dirty blocks for this file
+ Re-link a block from the clean chain to the dirty chain of a file.
+
+ SYNOPSIS
+ link_to_changed_list()
+ keycache key cache handle
+ block block to relink
+
+ DESCRIPTION
+ Unlink a block from the chain of clean blocks of a file
+ and link it to the chain of dirty blocks of the same file.
+
+ NOTE
+ Please do never set/clear BLOCK_CHANGED outside of
+ link_to_file_list() or link_to_changed_list().
+ You would risk to damage correct counting of changed blocks
+ and to find blocks in the wrong hash.
+
+ RETURN
+ void
*/
-static inline void link_to_changed_list(KEY_CACHE *keycache,
- BLOCK_LINK *block)
+static void link_to_changed_list(KEY_CACHE *keycache,
+ BLOCK_LINK *block)
{
+ DBUG_ASSERT(block->status & BLOCK_IN_USE);
+ DBUG_ASSERT(!(block->status & BLOCK_CHANGED));
+ DBUG_ASSERT(block->hash_link && block->hash_link->block == block);
+
unlink_changed(block);
link_changed(block,
&keycache->changed_blocks[FILE_HASH(block->hash_link->file)]);
@@ -877,13 +1085,13 @@ static inline void link_to_changed_list(KEY_CACHE *keycache,
none
NOTES.
- The LRU chain is represented by a curcular list of block structures.
+ The LRU ring is represented by a circular list of block structures.
The list is double-linked of the type (**prev,*next) type.
- The LRU chain is divided into two parts - hot and warm.
+ The LRU ring is divided into two parts - hot and warm.
There are two pointers to access the last blocks of these two
parts. The beginning of the warm part follows right after the
end of the hot part.
- Only blocks of the warm part can be used for replacement.
+ Only blocks of the warm part can be used for eviction.
The first block from the beginning of this subchain is always
taken for eviction (keycache->last_used->next)
@@ -896,6 +1104,9 @@ static inline void link_to_changed_list(KEY_CACHE *keycache,
+----| beg |---->...----| end |----+
+------+ +------+ins
first for eviction
+
+ It is also possible that the block is selected for eviction and thus
+ not linked in the LRU ring.
*/
static void link_block(KEY_CACHE *keycache, BLOCK_LINK *block, my_bool hot,
@@ -904,7 +1115,12 @@ static void link_block(KEY_CACHE *keycache, BLOCK_LINK *block, my_bool hot,
BLOCK_LINK *ins;
BLOCK_LINK **pins;
- KEYCACHE_DBUG_ASSERT(! (block->hash_link && block->hash_link->requests));
+ DBUG_ASSERT((block->status & ~BLOCK_CHANGED) == (BLOCK_READ | BLOCK_IN_USE));
+ DBUG_ASSERT(block->hash_link); /*backptr to block NULL from free_block()*/
+ DBUG_ASSERT(!block->requests);
+ DBUG_ASSERT(block->prev_changed && *block->prev_changed == block);
+ DBUG_ASSERT(!block->next_used);
+ DBUG_ASSERT(!block->prev_used);
#ifdef THREAD
if (!hot && keycache->waiting_for_block.last_thread)
{
@@ -933,6 +1149,29 @@ static void link_block(KEY_CACHE *keycache, BLOCK_LINK *block, my_bool hot,
}
while (thread != last_thread);
hash_link->block= block;
+ /*
+ NOTE: We assigned the block to the hash_link and signalled the
+ requesting thread(s). But it is possible that other threads runs
+ first. These threads see the hash_link assigned to a block which
+ is assigned to another hash_link and not marked BLOCK_IN_SWITCH.
+ This can be a problem for functions that do not select the block
+ via its hash_link: flush and free. They do only see a block which
+ is in a "normal" state and don't know that it will be evicted soon.
+
+ We cannot set BLOCK_IN_SWITCH here because only one of the
+ requesting threads must handle the eviction. All others must wait
+ for it to complete. If we set the flag here, the threads would not
+ know who is in charge of the eviction. Without the flag, the first
+ thread takes the stick and sets the flag.
+
+ But we need to note in the block that is has been selected for
+ eviction. It must not be freed. The evicting thread will not
+ expect the block in the free list. Before freeing we could also
+ check if block->requests > 1. But I think including another flag
+ in the check of block->status is slightly more efficient and
+ probably easier to read.
+ */
+ block->status|= BLOCK_IN_EVICTION;
KEYCACHE_THREAD_TRACE("link_block: after signaling");
#if defined(KEYCACHE_DEBUG)
KEYCACHE_DBUG_PRINT("link_block",
@@ -959,7 +1198,7 @@ static void link_block(KEY_CACHE *keycache, BLOCK_LINK *block, my_bool hot,
}
else
{
- /* The LRU chain is empty */
+ /* The LRU ring is empty. Let the block point to itself. */
keycache->used_last= keycache->used_ins= block->next_used= block;
block->prev_used= &block->next_used;
}
@@ -993,6 +1232,13 @@ static void link_block(KEY_CACHE *keycache, BLOCK_LINK *block, my_bool hot,
static void unlink_block(KEY_CACHE *keycache, BLOCK_LINK *block)
{
+ DBUG_ASSERT((block->status & ~BLOCK_CHANGED) == (BLOCK_READ | BLOCK_IN_USE));
+ DBUG_ASSERT(block->hash_link); /*backptr to block NULL from free_block()*/
+ DBUG_ASSERT(!block->requests);
+ DBUG_ASSERT(block->prev_changed && *block->prev_changed == block);
+ DBUG_ASSERT(block->next_used && block->prev_used &&
+ (block->next_used->prev_used == &block->next_used) &&
+ (*block->prev_used == block));
if (block->next_used == block)
/* The list contains only one member */
keycache->used_last= keycache->used_ins= NULL;
@@ -1006,6 +1252,13 @@ static void unlink_block(KEY_CACHE *keycache, BLOCK_LINK *block)
keycache->used_ins=STRUCT_PTR(BLOCK_LINK, next_used, block->prev_used);
}
block->next_used= NULL;
+#if !defined(DBUG_OFF)
+ /*
+ This makes it easier to see it's not in a chain during debugging.
+ And some DBUG_ASSERT() rely on it.
+ */
+ block->prev_used= NULL;
+#endif
KEYCACHE_THREAD_TRACE("unlink_block");
#if defined(KEYCACHE_DEBUG)
@@ -1020,12 +1273,27 @@ static void unlink_block(KEY_CACHE *keycache, BLOCK_LINK *block)
/*
- Register requests for a block
+ Register requests for a block.
+
+ SYNOPSIS
+ reg_requests()
+ keycache Pointer to a key cache data structure.
+ block Pointer to the block to register a request on.
+ count Number of requests. Always 1.
+
+ NOTE
+ The first request unlinks the block from the LRU ring. This means
+ that it is protected against eveiction.
+
+ RETURN
+ void
*/
static void reg_requests(KEY_CACHE *keycache, BLOCK_LINK *block, int count)
{
- if (! block->requests)
- /* First request for the block unlinks it */
+ DBUG_ASSERT(block->status & BLOCK_IN_USE);
+ DBUG_ASSERT(block->hash_link);
+
+ if (!block->requests)
unlink_block(keycache, block);
block->requests+=count;
}
@@ -1045,7 +1313,7 @@ static void reg_requests(KEY_CACHE *keycache, BLOCK_LINK *block, int count)
none
NOTES.
- Every linking to the LRU chain decrements by one a special block
+ Every linking to the LRU ring decrements by one a special block
counter (if it's positive). If the at_end parameter is TRUE the block is
added either at the end of warm sub-chain or at the end of hot sub-chain.
It is added to the hot subchain if its counter is zero and number of
@@ -1058,11 +1326,20 @@ static void reg_requests(KEY_CACHE *keycache, BLOCK_LINK *block, int count)
At the same time the block at the very beginning of the hot subchain
might be moved to the beginning of the warm subchain if it stays untouched
for a too long time (this time is determined by parameter age_threshold).
+
+ It is also possible that the block is selected for eviction and thus
+ not linked in the LRU ring.
*/
static void unreg_request(KEY_CACHE *keycache,
BLOCK_LINK *block, int at_end)
{
+ DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE));
+ DBUG_ASSERT(block->hash_link); /*backptr to block NULL from free_block()*/
+ DBUG_ASSERT(block->requests);
+ DBUG_ASSERT(block->prev_changed && *block->prev_changed == block);
+ DBUG_ASSERT(!block->next_used);
+ DBUG_ASSERT(!block->prev_used);
if (! --block->requests)
{
my_bool hot;
@@ -1081,9 +1358,22 @@ static void unreg_request(KEY_CACHE *keycache,
link_block(keycache, block, hot, (my_bool)at_end);
block->last_hit_time= keycache->keycache_time;
keycache->keycache_time++;
+ /*
+ At this place, the block might be in the LRU ring or not. If an
+ evicter was waiting for a block, it was selected for eviction and
+ not linked in the LRU ring.
+ */
+ /*
+ Check if we should link a hot block to the warm block sub-chain.
+ It is possible that we select the same block as above. But it can
+ also be another block. In any case a block from the LRU ring is
+ selected. In other words it works even if the above block was
+ selected for eviction and not linked in the LRU ring. Since this
+ happens only if the LRU ring is empty, the block selected below
+ would be NULL and the rest of the function skipped.
+ */
block= keycache->used_ins;
- /* Check if we should link a hot block to the warm block */
if (block && keycache->keycache_time - block->last_hit_time >
keycache->age_threshold)
{
@@ -1104,8 +1394,14 @@ static void unreg_request(KEY_CACHE *keycache,
Remove a reader of the page in block
*/
-static inline void remove_reader(BLOCK_LINK *block)
+static void remove_reader(BLOCK_LINK *block)
{
+ DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE));
+ DBUG_ASSERT(block->hash_link && block->hash_link->block == block);
+ DBUG_ASSERT(block->prev_changed && *block->prev_changed == block);
+ DBUG_ASSERT(!block->next_used);
+ DBUG_ASSERT(!block->prev_used);
+ DBUG_ASSERT(block->hash_link->requests);
#ifdef THREAD
if (! --block->hash_link->requests && block->condvar)
keycache_pthread_cond_signal(block->condvar);
@@ -1120,16 +1416,28 @@ static inline void remove_reader(BLOCK_LINK *block)
signals on its termination
*/
-static inline void wait_for_readers(KEY_CACHE *keycache __attribute__((unused)),
- BLOCK_LINK *block)
+static void wait_for_readers(KEY_CACHE *keycache,
+ BLOCK_LINK *block)
{
#ifdef THREAD
struct st_my_thread_var *thread= my_thread_var;
+ DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE));
+ DBUG_ASSERT(!(block->status & (BLOCK_ERROR | BLOCK_IN_FLUSH |
+ BLOCK_CHANGED)));
+ DBUG_ASSERT(block->hash_link);
+ DBUG_ASSERT(block->hash_link->block == block);
+ /* Linked in file_blocks or changed_blocks hash. */
+ DBUG_ASSERT(block->prev_changed && *block->prev_changed == block);
+ /* Not linked in LRU ring. */
+ DBUG_ASSERT(!block->next_used);
+ DBUG_ASSERT(!block->prev_used);
while (block->hash_link->requests)
{
KEYCACHE_DBUG_PRINT("wait_for_readers: wait",
("suspend thread %ld block %u",
thread->id, BLOCK_NUMBER(block)));
+ /* There must be no other waiter. We have no queue here. */
+ DBUG_ASSERT(!block->condvar);
block->condvar= &thread->suspend;
keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock);
block->condvar= NULL;
@@ -1358,77 +1666,308 @@ static BLOCK_LINK *find_key_block(KEY_CACHE *keycache,
#endif
restart:
- /* Find the hash link for the requested page (file, filepos) */
+ /*
+ If the flush phase of a resize operation fails, the cache is left
+ unusable. This will be detected only after "goto restart".
+ */
+ if (!keycache->can_be_used)
+ DBUG_RETURN(0);
+
+ /*
+ Find the hash_link for the requested file block (file, filepos). We
+ do always get a hash_link here. It has registered our request so
+ that no other thread can use it for another file block until we
+ release the request (which is done by remove_reader() usually). The
+ hash_link can have a block assigned to it or not. If there is a
+ block, it may be assigned to this hash_link or not. In cases where a
+ block is evicted from the cache, it is taken from the LRU ring and
+ referenced by the new hash_link. But the block can still be assigned
+ to its old hash_link for some time if it needs to be flushed first,
+ or if there are other threads still reading it.
+
+ Summary:
+ hash_link is always returned.
+ hash_link->block can be:
+ - NULL or
+ - not assigned to this hash_link or
+ - assigned to this hash_link. If assigned, the block can have
+ - invalid data (when freshly assigned) or
+ - valid data. Valid data can be
+ - changed over the file contents (dirty) or
+ - not changed (clean).
+ */
hash_link= get_hash_link(keycache, file, filepos);
+ DBUG_ASSERT((hash_link->file == file) && (hash_link->diskpos == filepos));
page_status= -1;
if ((block= hash_link->block) &&
block->hash_link == hash_link && (block->status & BLOCK_READ))
+ {
+ /* Assigned block with valid (changed or unchanged) contents. */
page_status= PAGE_READ;
+ }
+ /*
+ else (page_status == -1)
+ - block == NULL or
+ - block not assigned to this hash_link or
+ - block assigned but not yet read from file (invalid data).
+ */
- if (wrmode && keycache->resize_in_flush)
+ if (keycache->in_resize)
{
- /* This is a write request during the flush phase of a resize operation */
+ /* This is a request during a resize operation */
- if (page_status != PAGE_READ)
+ if (!block)
{
- /* We don't need the page in the cache: we are going to write on disk */
+ struct st_my_thread_var *thread;
+
+ /*
+ The file block is not in the cache. We don't need it in the
+ cache: we are going to read or write directly to file. Cancel
+ the request. We can simply decrement hash_link->requests because
+ we did not release cache_lock since increasing it. So no other
+ thread can wait for our request to become released.
+ */
+ if (hash_link->requests == 1)
+ {
+ /*
+ We are the only one to request this hash_link (this file/pos).
+ Free the hash_link.
+ */
+ hash_link->requests--;
+ unlink_hash(keycache, hash_link);
+ DBUG_RETURN(0);
+ }
+
+ /*
+ More requests on the hash_link. Someone tries to evict a block
+ for this hash_link (could have started before resizing started).
+ This means that the LRU ring is empty. Otherwise a block could
+ be assigned immediately. Behave like a thread that wants to
+ evict a block for this file/pos. Add to the queue of threads
+ waiting for a block. Wait until there is one assigned.
+
+ Refresh the request on the hash-link so that it cannot be reused
+ for another file/pos.
+ */
+ thread= my_thread_var;
+ thread->opt_info= (void *) hash_link;
+ link_into_queue(&keycache->waiting_for_block, thread);
+ do
+ {
+ KEYCACHE_DBUG_PRINT("find_key_block: wait",
+ ("suspend thread %ld", thread->id));
+ keycache_pthread_cond_wait(&thread->suspend,
+ &keycache->cache_lock);
+ } while (thread->next);
+ thread->opt_info= NULL;
+ /*
+ A block should now be assigned to the hash_link. But it may
+ still need to be evicted. Anyway, we should re-check the
+ situation. page_status must be set correctly.
+ */
hash_link->requests--;
- unlink_hash(keycache, hash_link);
- return 0;
+ goto restart;
+ } /* end of if (!block) */
+
+ /*
+ There is a block for this file/pos in the cache. Register a
+ request on it. This unlinks it from the LRU ring (if it is there)
+ and hence protects it against eviction (if not already in
+ eviction). We need this for returning the block to the caller, for
+ calling remove_reader() (for debugging purposes), and for calling
+ free_block(). The only case where we don't need the request is if
+ the block is in eviction. In that case we have to unregister the
+ request later.
+ */
+ reg_requests(keycache, block, 1);
+
+ if (page_status != PAGE_READ)
+ {
+ /*
+ - block not assigned to this hash_link or
+ - block assigned but not yet read from file (invalid data).
+
+ This must be a block in eviction. It will be read soon. We need
+ to wait here until this happened. Otherwise the caller could
+ access a wrong block or a block which is in read. While waiting
+ we cannot lose hash_link nor block. We have registered a request
+ on the hash_link. Everything can happen to the block but changes
+ in the hash_link -> block relationship. In other words:
+ everything can happen to the block but free or another completed
+ eviction.
+
+ Note that we bahave like a secondary requestor here. We just
+ cannot return with PAGE_WAIT_TO_BE_READ. This would work for
+ read requests and writes on dirty blocks that are not in flush
+ only. Waiting here on COND_FOR_REQUESTED works in all
+ situations.
+ */
+ DBUG_ASSERT(((block->hash_link != hash_link) &&
+ (block->status & (BLOCK_IN_EVICTION | BLOCK_IN_SWITCH))) ||
+ ((block->hash_link == hash_link) &&
+ !(block->status & BLOCK_READ)));
+ wait_on_queue(&block->wqueue[COND_FOR_REQUESTED], &keycache->cache_lock);
+ /*
+ Here we can trust that the block has been assigned to this
+ hash_link (block->hash_link == hash_link) and read into the
+ buffer (BLOCK_READ). The worst things possible here are that the
+ block is in free (BLOCK_REASSIGNED). But the block is still
+ assigned to the hash_link. The freeing thread waits until we
+ release our request on the hash_link. The block must not be
+ again in eviction because we registered an request on it before
+ starting to wait.
+ */
+ DBUG_ASSERT(block->hash_link == hash_link);
+ DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE));
+ DBUG_ASSERT(!(block->status & (BLOCK_IN_EVICTION | BLOCK_IN_SWITCH)));
}
- if (!(block->status & BLOCK_IN_FLUSH))
+ /*
+ The block is in the cache. Assigned to the hash_link. Valid data.
+ Note that in case of page_st == PAGE_READ, the block can be marked
+ for eviction. In any case it can be marked for freeing.
+ */
+
+ if (!wrmode)
+ {
+ /* A reader can just read the block. */
+ *page_st= PAGE_READ;
+ DBUG_ASSERT((hash_link->file == file) &&
+ (hash_link->diskpos == filepos) &&
+ (block->hash_link == hash_link));
+ DBUG_RETURN(block);
+ }
+
+ /*
+ This is a writer. No two writers for the same block can exist.
+ This must be assured by locks outside of the key cache.
+ */
+ DBUG_ASSERT(!(block->status & BLOCK_FOR_UPDATE) || fail_block(block));
+
+ while (block->status & BLOCK_IN_FLUSH)
+ {
+ /*
+ Wait until the block is flushed to file. Do not release the
+ request on the hash_link yet to prevent that the block is freed
+ or reassigned while we wait. While we wait, several things can
+ happen to the block, including another flush. But the block
+ cannot be reassigned to another hash_link until we release our
+ request on it. But it can be marked BLOCK_REASSIGNED from free
+ or eviction, while they wait for us to release the hash_link.
+ */
+ wait_on_queue(&block->wqueue[COND_FOR_SAVED], &keycache->cache_lock);
+ /*
+ If the flush phase failed, the resize could have finished while
+ we waited here.
+ */
+ if (!keycache->in_resize)
+ {
+ remove_reader(block);
+ unreg_request(keycache, block, 1);
+ goto restart;
+ }
+ DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE));
+ DBUG_ASSERT(!(block->status & BLOCK_FOR_UPDATE) || fail_block(block));
+ DBUG_ASSERT(block->hash_link == hash_link);
+ }
+
+ if (block->status & BLOCK_CHANGED)
+ {
+ /*
+ We want to write a block with changed contents. If the cache
+ block size is bigger than the callers block size (e.g. MyISAM),
+ the caller may replace part of the block only. Changes of the
+ other part of the block must be preserved. Since the block has
+ not yet been selected for flush, we can still add our changes.
+ */
+ *page_st= PAGE_READ;
+ DBUG_ASSERT((hash_link->file == file) &&
+ (hash_link->diskpos == filepos) &&
+ (block->hash_link == hash_link));
+ DBUG_RETURN(block);
+ }
+
+ /*
+ This is a write request for a clean block. We do not want to have
+ new dirty blocks in the cache while resizing. We will free the
+ block and write directly to file. If the block is in eviction or
+ in free, we just let it go.
+
+ Unregister from the hash_link. This must be done before freeing
+ the block. And it must be done if not freeing the block. Because
+ we could have waited above, we need to call remove_reader(). Other
+ threads could wait for us to release our request on the hash_link.
+ */
+ remove_reader(block);
+
+ /* If the block is not in eviction and not in free, we can free it. */
+ if (!(block->status & (BLOCK_IN_EVICTION | BLOCK_IN_SWITCH |
+ BLOCK_REASSIGNED)))
{
- hash_link->requests--;
/*
- Remove block to invalidate the page in the block buffer
- as we are going to write directly on disk.
- Although we have an exlusive lock for the updated key part
- the control can be yieded by the current thread as we might
+ Free block as we are going to write directly to file.
+ Although we have an exlusive lock for the updated key part,
+ the control can be yielded by the current thread as we might
have unfinished readers of other key parts in the block
buffer. Still we are guaranteed not to have any readers
of the key part we are writing into until the block is
- removed from the cache as we set the BLOCL_REASSIGNED
+ removed from the cache as we set the BLOCK_REASSIGNED
flag (see the code below that handles reading requests).
*/
free_block(keycache, block);
- return 0;
}
- /* Wait intil the page is flushed on disk */
- hash_link->requests--;
+ else
{
-#ifdef THREAD
- struct st_my_thread_var *thread= my_thread_var;
- add_to_queue(&block->wqueue[COND_FOR_SAVED], thread);
- do
- {
- KEYCACHE_DBUG_PRINT("find_key_block: wait",
- ("suspend thread %ld", thread->id));
- keycache_pthread_cond_wait(&thread->suspend,
- &keycache->cache_lock);
- }
- while(thread->next);
-#else
- KEYCACHE_DBUG_ASSERT(0);
/*
- Given the use of "resize_in_flush", it seems impossible
- that this whole branch is ever entered in single-threaded case
- because "(wrmode && keycache->resize_in_flush)" cannot be true.
- TODO: Check this, and then put the whole branch into the
- "#ifdef THREAD" guard.
+ The block will be evicted/freed soon. Don't touch it in any way.
+ Unregister the request that we registered above.
*/
-#endif
+ unreg_request(keycache, block, 1);
+
+ /*
+ The block is still assigned to the hash_link (the file/pos that
+ we are going to write to). Wait until the eviction/free is
+ complete. Otherwise the direct write could complete before all
+ readers are done with the block. So they could read outdated
+ data.
+
+ Since we released our request on the hash_link, it can be reused
+ for another file/pos. Hence we cannot just check for
+ block->hash_link == hash_link. As long as the resize is
+ proceeding the block cannot be reassigned to the same file/pos
+ again. So we can terminate the loop when the block is no longer
+ assigned to this file/pos.
+ */
+ do
+ {
+ wait_on_queue(&block->wqueue[COND_FOR_SAVED],
+ &keycache->cache_lock);
+ /*
+ If the flush phase failed, the resize could have finished
+ while we waited here.
+ */
+ if (!keycache->in_resize)
+ goto restart;
+ } while (block->hash_link &&
+ (block->hash_link->file == file) &&
+ (block->hash_link->diskpos == filepos));
}
- /* Invalidate page in the block if it has not been done yet */
- if (block->status)
- free_block(keycache, block);
- return 0;
+ DBUG_RETURN(0);
}
if (page_status == PAGE_READ &&
- (block->status & (BLOCK_IN_SWITCH | BLOCK_REASSIGNED)))
+ (block->status & (BLOCK_IN_EVICTION | BLOCK_IN_SWITCH |
+ BLOCK_REASSIGNED)))
{
- /* This is a request for a page to be removed from cache */
+ /*
+ This is a request for a block to be removed from cache. The block
+ is assigned to this hash_link and contains valid data, but is
+ marked for eviction or to be freed. Possible reasons why it has
+ not yet been evicted/freed can be a flush before reassignment
+ (BLOCK_IN_SWITCH), readers of the block have not finished yet
+ (BLOCK_REASSIGNED), or the evicting thread did not yet awake after
+ the block has been selected for it (BLOCK_IN_EVICTION).
+ */
KEYCACHE_DBUG_PRINT("find_key_block",
("request for old page in block %u "
@@ -1439,43 +1978,58 @@ restart:
all others are to be suspended, then resubmitted
*/
if (!wrmode && !(block->status & BLOCK_REASSIGNED))
+ {
+ /*
+ This is a read request and the block not yet reassigned. We can
+ register our request and proceed. This unlinks the block from
+ the LRU ring and protects it against eviction.
+ */
reg_requests(keycache, block, 1);
+ }
else
{
+ /*
+ Either this is a write request for a block that is in eviction
+ or in free. We must not use it any more. Instead we must evict
+ another block. But we cannot do this before the eviction/free is
+ done. Otherwise we would find the same hash_link + block again
+ and again.
+
+ Or this is a read request for a block in eviction/free that does
+ not require a flush, but waits for readers to finish with the
+ block. We do not read this block to let the eviction/free happen
+ as soon as possible. Again we must wait so that we don't find
+ the same hash_link + block again and again.
+ */
+ DBUG_ASSERT(hash_link->requests);
hash_link->requests--;
KEYCACHE_DBUG_PRINT("find_key_block",
("request waiting for old page to be saved"));
- {
-#ifdef THREAD
- struct st_my_thread_var *thread= my_thread_var;
- /* Put the request into the queue of those waiting for the old page */
- add_to_queue(&block->wqueue[COND_FOR_SAVED], thread);
- /* Wait until the request can be resubmitted */
- do
- {
- KEYCACHE_DBUG_PRINT("find_key_block: wait",
- ("suspend thread %ld", thread->id));
- keycache_pthread_cond_wait(&thread->suspend,
- &keycache->cache_lock);
- }
- while(thread->next);
-#else
- KEYCACHE_DBUG_ASSERT(0);
- /* No parallel requests in single-threaded case */
-#endif
- }
+ wait_on_queue(&block->wqueue[COND_FOR_SAVED], &keycache->cache_lock);
KEYCACHE_DBUG_PRINT("find_key_block",
("request for old page resubmitted"));
- /* Resubmit the request */
+ /*
+ The block is no longer assigned to this hash_link.
+ Get another one.
+ */
goto restart;
}
}
else
{
- /* This is a request for a new page or for a page not to be removed */
+ /*
+ This is a request for a new block or for a block not to be removed.
+ Either
+ - block == NULL or
+ - block not assigned to this hash_link or
+ - block assigned but not yet read from file,
+ or
+ - block assigned with valid (changed or unchanged) data and
+ - it will not be reassigned/freed.
+ */
if (! block)
{
- /* No block is assigned for the page yet */
+ /* No block is assigned to the hash_link yet. */
if (keycache->blocks_unused)
{
if (keycache->free_block_list)
@@ -1488,24 +2042,33 @@ restart:
else
{
/* There are some never used blocks, take first of them */
+ DBUG_ASSERT(keycache->blocks_used <
+ (ulong) keycache->disk_blocks);
block= &keycache->block_root[keycache->blocks_used];
block->buffer= ADD_TO_PTR(keycache->block_mem,
((ulong) keycache->blocks_used*
keycache->key_cache_block_size),
- byte*);
+ uchar*);
keycache->blocks_used++;
+ DBUG_ASSERT(!block->next_used);
}
+ DBUG_ASSERT(!block->prev_used);
+ DBUG_ASSERT(!block->next_changed);
+ DBUG_ASSERT(!block->prev_changed);
+ DBUG_ASSERT(!block->hash_link);
+ DBUG_ASSERT(!block->status);
+ DBUG_ASSERT(!block->requests);
keycache->blocks_unused--;
- block->status= 0;
+ block->status= BLOCK_IN_USE;
block->length= 0;
block->offset= keycache->key_cache_block_size;
block->requests= 1;
block->temperature= BLOCK_COLD;
block->hits_left= init_hits_left;
block->last_hit_time= 0;
- link_to_file_list(keycache, block, file, 0);
block->hash_link= hash_link;
hash_link->block= block;
+ link_to_file_list(keycache, block, file, 0);
page_status= PAGE_TO_BE_READ;
KEYCACHE_DBUG_PRINT("find_key_block",
("got free or never used block %u",
@@ -1513,17 +2076,26 @@ restart:
}
else
{
- /* There are no never used blocks, use a block from the LRU chain */
-
- /*
- Wait until a new block is added to the LRU chain;
- several threads might wait here for the same page,
- all of them must get the same block
+ /*
+ There are no free blocks and no never used blocks, use a block
+ from the LRU ring.
*/
#ifdef THREAD
if (! keycache->used_last)
{
+ /*
+ The LRU ring is empty. Wait until a new block is added to
+ it. Several threads might wait here for the same hash_link,
+ all of them must get the same block. While waiting for a
+ block, after a block is selected for this hash_link, other
+ threads can run first before this one awakes. During this
+ time interval other threads find this hash_link pointing to
+ the block, which is still assigned to another hash_link. In
+ this case the block is not marked BLOCK_IN_SWITCH yet, but
+ it is marked BLOCK_IN_EVICTION.
+ */
+
struct st_my_thread_var *thread= my_thread_var;
thread->opt_info= (void *) hash_link;
link_into_queue(&keycache->waiting_for_block, thread);
@@ -1536,24 +2108,50 @@ restart:
}
while (thread->next);
thread->opt_info= NULL;
+ /* Assert that block has a request registered. */
+ DBUG_ASSERT(hash_link->block->requests);
+ /* Assert that block is not in LRU ring. */
+ DBUG_ASSERT(!hash_link->block->next_used);
+ DBUG_ASSERT(!hash_link->block->prev_used);
}
#else
KEYCACHE_DBUG_ASSERT(keycache->used_last);
#endif
+ /*
+ If we waited above, hash_link->block has been assigned by
+ link_block(). Otherwise it is still NULL. In the latter case
+ we need to grab a block from the LRU ring ourselves.
+ */
block= hash_link->block;
if (! block)
{
- /*
- Take the first block from the LRU chain
- unlinking it from the chain
- */
+ /* Select the last block from the LRU ring. */
block= keycache->used_last->next_used;
block->hits_left= init_hits_left;
block->last_hit_time= 0;
- reg_requests(keycache, block,1);
hash_link->block= block;
+ /*
+ Register a request on the block. This unlinks it from the
+ LRU ring and protects it against eviction.
+ */
+ DBUG_ASSERT(!block->requests);
+ reg_requests(keycache, block,1);
+ /*
+ We do not need to set block->status|= BLOCK_IN_EVICTION here
+ because we will set block->status|= BLOCK_IN_SWITCH
+ immediately without releasing the lock in between. This does
+ also support debugging. When looking at the block, one can
+ see if the block has been selected by link_block() after the
+ LRU ring was empty, or if it was grabbed directly from the
+ LRU ring in this branch.
+ */
}
+ /*
+ If we had to wait above, there is a small chance that another
+ thread grabbed this block for the same file block already. But
+ in most cases the first condition is true.
+ */
if (block->hash_link != hash_link &&
! (block->status & BLOCK_IN_SWITCH) )
{
@@ -1568,46 +2166,117 @@ restart:
/* The block contains a dirty page - push it out of the cache */
KEYCACHE_DBUG_PRINT("find_key_block", ("block is dirty"));
+ if (block->status & BLOCK_IN_FLUSH)
+ {
+ /*
+ The block is marked for flush. If we do not wait here,
+ it could happen that we write the block, reassign it to
+ another file block, then, before the new owner can read
+ the new file block, the flusher writes the cache block
+ (which still has the old contents) to the new file block!
+ */
+ wait_on_queue(&block->wqueue[COND_FOR_SAVED],
+ &keycache->cache_lock);
+ /*
+ The block is marked BLOCK_IN_SWITCH. It should be left
+ alone except for reading. No free, no write.
+ */
+ DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE));
+ DBUG_ASSERT(!(block->status & (BLOCK_REASSIGNED |
+ BLOCK_CHANGED |
+ BLOCK_FOR_UPDATE)));
+ }
+ else
+ {
+ block->status|= BLOCK_IN_FLUSH | BLOCK_IN_FLUSHWRITE;
+ /*
+ BLOCK_IN_EVICTION may be true or not. Other flags must
+ have a fixed value.
+ */
+ DBUG_ASSERT((block->status & ~BLOCK_IN_EVICTION) ==
+ (BLOCK_READ | BLOCK_IN_SWITCH |
+ BLOCK_IN_FLUSH | BLOCK_IN_FLUSHWRITE |
+ BLOCK_CHANGED | BLOCK_IN_USE));
+ DBUG_ASSERT(block->hash_link);
- keycache_pthread_mutex_unlock(&keycache->cache_lock);
- /*
- The call is thread safe because only the current
- thread might change the block->hash_link value
- */
- error= my_pwrite(block->hash_link->file,
- block->buffer+block->offset,
- block->length - block->offset,
- block->hash_link->diskpos+ block->offset,
- MYF(MY_NABP | MY_WAIT_IF_FULL));
- keycache_pthread_mutex_lock(&keycache->cache_lock);
- keycache->global_cache_write++;
+ keycache_pthread_mutex_unlock(&keycache->cache_lock);
+ /*
+ The call is thread safe because only the current
+ thread might change the block->hash_link value
+ */
+ error= my_pwrite(block->hash_link->file,
+ block->buffer+block->offset,
+ block->length - block->offset,
+ block->hash_link->diskpos+ block->offset,
+ MYF(MY_NABP | MY_WAIT_IF_FULL));
+ keycache_pthread_mutex_lock(&keycache->cache_lock);
+
+ /* Block status must not have changed. */
+ DBUG_ASSERT((block->status & ~BLOCK_IN_EVICTION) ==
+ (BLOCK_READ | BLOCK_IN_SWITCH |
+ BLOCK_IN_FLUSH | BLOCK_IN_FLUSHWRITE |
+ BLOCK_CHANGED | BLOCK_IN_USE) || fail_block(block));
+ keycache->global_cache_write++;
+ }
}
block->status|= BLOCK_REASSIGNED;
+ /*
+ The block comes from the LRU ring. It must have a hash_link
+ assigned.
+ */
+ DBUG_ASSERT(block->hash_link);
if (block->hash_link)
{
/*
+ All pending requests for this page must be resubmitted.
+ This must be done before waiting for readers. They could
+ wait for the flush to complete. And we must also do it
+ after the wait. Flushers might try to free the block while
+ we wait. They would wait until the reassignment is
+ complete. Also the block status must reflect the correct
+ situation: The block is not changed nor in flush any more.
+ Note that we must not change the BLOCK_CHANGED flag
+ outside of link_to_file_list() so that it is always in the
+ correct queue and the *blocks_changed counters are
+ correct.
+ */
+ block->status&= ~(BLOCK_IN_FLUSH | BLOCK_IN_FLUSHWRITE);
+ link_to_file_list(keycache, block, block->hash_link->file, 1);
+ release_whole_queue(&block->wqueue[COND_FOR_SAVED]);
+ /*
+ The block is still assigned to its old hash_link.
Wait until all pending read requests
for this page are executed
(we could have avoided this waiting, if we had read
a page in the cache in a sweep, without yielding control)
*/
wait_for_readers(keycache, block);
+ DBUG_ASSERT(block->hash_link && block->hash_link->block == block &&
+ block->prev_changed);
+ /* The reader must not have been a writer. */
+ DBUG_ASSERT(!(block->status & BLOCK_CHANGED));
+
+ /* Wake flushers that might have found the block in between. */
+ release_whole_queue(&block->wqueue[COND_FOR_SAVED]);
- /* Remove the hash link for this page from the hash table */
+ /* Remove the hash link for the old file block from the hash. */
unlink_hash(keycache, block->hash_link);
- /* All pending requests for this page must be resubmitted */
-#ifdef THREAD
- if (block->wqueue[COND_FOR_SAVED].last_thread)
- release_queue(&block->wqueue[COND_FOR_SAVED]);
-#endif
+
+ /*
+ For sanity checks link_to_file_list() asserts that block
+ and hash_link refer to each other. Hence we need to assign
+ the hash_link first, but then we would not know if it was
+ linked before. Hence we would not know if to unlink it. So
+ unlink it here and call link_to_file_list(..., FALSE).
+ */
+ unlink_changed(block);
}
- link_to_file_list(keycache, block, file,
- (my_bool)(block->hash_link ? 1 : 0));
- block->status= error? BLOCK_ERROR : 0;
+ block->status= error ? BLOCK_ERROR : BLOCK_IN_USE ;
block->length= 0;
block->offset= keycache->key_cache_block_size;
block->hash_link= hash_link;
+ link_to_file_list(keycache, block, file, 0);
page_status= PAGE_TO_BE_READ;
KEYCACHE_DBUG_ASSERT(block->hash_link->block == block);
@@ -1615,7 +2284,20 @@ restart:
}
else
{
- /* This is for secondary requests for a new page only */
+ /*
+ Either (block->hash_link == hash_link),
+ or (block->status & BLOCK_IN_SWITCH).
+
+ This is for secondary requests for a new file block only.
+ Either it is already assigned to the new hash_link meanwhile
+ (if we had to wait due to empty LRU), or it is already in
+ eviction by another thread. Since this block has been
+ grabbed from the LRU ring and attached to this hash_link,
+ another thread cannot grab the same block from the LRU ring
+ anymore. If the block is in eviction already, it must become
+ attached to the same hash_link and as such destined for the
+ same file block.
+ */
KEYCACHE_DBUG_PRINT("find_key_block",
("block->hash_link: %p hash_link: %p "
"block->status: %u", block->hash_link,
@@ -1625,10 +2307,35 @@ restart:
PAGE_READ : PAGE_WAIT_TO_BE_READ);
}
}
- keycache->global_cache_read++;
}
else
{
+ /*
+ Block is not NULL. This hash_link points to a block.
+ Either
+ - block not assigned to this hash_link (yet) or
+ - block assigned but not yet read from file,
+ or
+ - block assigned with valid (changed or unchanged) data and
+ - it will not be reassigned/freed.
+
+ The first condition means hash_link points to a block in
+ eviction. This is not necessarily marked by BLOCK_IN_SWITCH yet.
+ But then it is marked BLOCK_IN_EVICTION. See the NOTE in
+ link_block(). In both cases it is destined for this hash_link
+ and its file block address. When this hash_link got its block
+ address, the block was removed from the LRU ring and cannot be
+ selected for eviction (for another hash_link) again.
+
+ Register a request on the block. This is another protection
+ against eviction.
+ */
+ DBUG_ASSERT(((block->hash_link != hash_link) &&
+ (block->status & (BLOCK_IN_EVICTION | BLOCK_IN_SWITCH))) ||
+ ((block->hash_link == hash_link) &&
+ !(block->status & BLOCK_READ)) ||
+ ((block->status & BLOCK_READ) &&
+ !(block->status & (BLOCK_IN_EVICTION | BLOCK_IN_SWITCH))));
reg_requests(keycache, block, 1);
KEYCACHE_DBUG_PRINT("find_key_block",
("block->hash_link: %p hash_link: %p "
@@ -1641,6 +2348,16 @@ restart:
}
KEYCACHE_DBUG_ASSERT(page_status != -1);
+ /* Same assert basically, but be very sure. */
+ KEYCACHE_DBUG_ASSERT(block);
+ /* Assert that block has a request and is not in LRU ring. */
+ DBUG_ASSERT(block->requests);
+ DBUG_ASSERT(!block->next_used);
+ DBUG_ASSERT(!block->prev_used);
+ /* Assert that we return the correct block. */
+ DBUG_ASSERT((page_status == PAGE_WAIT_TO_BE_READ) ||
+ ((block->hash_link->file == file) &&
+ (block->hash_link->diskpos == filepos)));
*page_st=page_status;
KEYCACHE_DBUG_PRINT("find_key_block",
("fd: %d pos: %lu block->status: %u page_status: %u",
@@ -1680,7 +2397,7 @@ restart:
portion is less than read_length, but not less than min_length.
*/
-static void read_block(KEY_CACHE *keycache __attribute__((unused)),
+static void read_block(KEY_CACHE *keycache,
BLOCK_LINK *block, uint read_length,
uint min_length, my_bool primary)
{
@@ -1692,13 +2409,22 @@ static void read_block(KEY_CACHE *keycache __attribute__((unused)),
if (primary)
{
/*
- This code is executed only by threads
- that submitted primary requests
+ This code is executed only by threads that submitted primary
+ requests. Until block->status contains BLOCK_READ, all other
+ request for the block become secondary requests. For a primary
+ request the block must be properly initialized.
*/
+ DBUG_ASSERT(((block->status & ~BLOCK_FOR_UPDATE) == BLOCK_IN_USE) ||
+ fail_block(block));
+ DBUG_ASSERT((block->length == 0) || fail_block(block));
+ DBUG_ASSERT((block->offset == keycache->key_cache_block_size) ||
+ fail_block(block));
+ DBUG_ASSERT((block->requests > 0) || fail_block(block));
KEYCACHE_DBUG_PRINT("read_block",
("page to be read by primary request"));
+ keycache->global_cache_read++;
/* Page is not in buffer yet, is to be read from disk */
keycache_pthread_mutex_unlock(&keycache->cache_lock);
/*
@@ -1708,47 +2434,50 @@ static void read_block(KEY_CACHE *keycache __attribute__((unused)),
got_length= my_pread(block->hash_link->file, block->buffer,
read_length, block->hash_link->diskpos, MYF(0));
keycache_pthread_mutex_lock(&keycache->cache_lock);
+ /*
+ The block can now have been marked for free (in case of
+ FLUSH_RELEASE). Otherwise the state must be unchanged.
+ */
+ DBUG_ASSERT(((block->status & ~(BLOCK_REASSIGNED |
+ BLOCK_FOR_UPDATE)) == BLOCK_IN_USE) ||
+ fail_block(block));
+ DBUG_ASSERT((block->length == 0) || fail_block(block));
+ DBUG_ASSERT((block->offset == keycache->key_cache_block_size) ||
+ fail_block(block));
+ DBUG_ASSERT((block->requests > 0) || fail_block(block));
+
if (got_length < min_length)
block->status|= BLOCK_ERROR;
else
{
- block->status= BLOCK_READ;
+ block->status|= BLOCK_READ;
block->length= got_length;
+ /*
+ Do not set block->offset here. If this block is marked
+ BLOCK_CHANGED later, we want to flush only the modified part. So
+ only a writer may set block->offset down from
+ keycache->key_cache_block_size.
+ */
}
KEYCACHE_DBUG_PRINT("read_block",
("primary request: new page in cache"));
/* Signal that all pending requests for this page now can be processed */
-#ifdef THREAD
- if (block->wqueue[COND_FOR_REQUESTED].last_thread)
- release_queue(&block->wqueue[COND_FOR_REQUESTED]);
-#endif
+ release_whole_queue(&block->wqueue[COND_FOR_REQUESTED]);
}
else
{
/*
- This code is executed only by threads
- that submitted secondary requests
+ This code is executed only by threads that submitted secondary
+ requests. At this point it could happen that the cache block is
+ not yet assigned to the hash_link for the requested file block.
+ But at awake from the wait this should be the case. Unfortunately
+ we cannot assert this here because we do not know the hash_link
+ for the requested file block nor the file and position. So we have
+ to assert this in the caller.
*/
KEYCACHE_DBUG_PRINT("read_block",
("secondary request waiting for new page to be read"));
- {
-#ifdef THREAD
- struct st_my_thread_var *thread= my_thread_var;
- /* Put the request into a queue and wait until it can be processed */
- add_to_queue(&block->wqueue[COND_FOR_REQUESTED], thread);
- do
- {
- KEYCACHE_DBUG_PRINT("read_block: wait",
- ("suspend thread %ld", thread->id));
- keycache_pthread_cond_wait(&thread->suspend,
- &keycache->cache_lock);
- }
- while (thread->next);
-#else
- KEYCACHE_DBUG_ASSERT(0);
- /* No parallel requests in single-threaded case */
-#endif
- }
+ wait_on_queue(&block->wqueue[COND_FOR_REQUESTED], &keycache->cache_lock);
KEYCACHE_DBUG_PRINT("read_block",
("secondary request: new page in cache"));
}
@@ -1783,38 +2512,66 @@ static void read_block(KEY_CACHE *keycache __attribute__((unused)),
have to be a multiple of key_cache_block_size;
*/
-byte *key_cache_read(KEY_CACHE *keycache,
+uchar *key_cache_read(KEY_CACHE *keycache,
File file, my_off_t filepos, int level,
- byte *buff, uint length,
+ uchar *buff, uint length,
uint block_length __attribute__((unused)),
int return_buffer __attribute__((unused)))
{
+ my_bool locked_and_incremented= FALSE;
int error=0;
- uint offset= 0;
- byte *start= buff;
+ uchar *start= buff;
DBUG_ENTER("key_cache_read");
DBUG_PRINT("enter", ("fd: %u pos: %lu length: %u",
(uint) file, (ulong) filepos, length));
- if (keycache->can_be_used)
+ if (keycache->key_cache_inited)
{
/* Key cache is used */
reg1 BLOCK_LINK *block;
uint read_length;
+ uint offset;
uint status;
int page_st;
- offset= (uint) (filepos & (keycache->key_cache_block_size-1));
+ /*
+ When the key cache is once initialized, we use the cache_lock to
+ reliably distinguish the cases of normal operation, resizing, and
+ disabled cache. We always increment and decrement
+ 'cnt_for_resize_op' so that a resizer can wait for pending I/O.
+ */
+ keycache_pthread_mutex_lock(&keycache->cache_lock);
+ /*
+ Cache resizing has two phases: Flushing and re-initializing. In
+ the flush phase read requests are allowed to bypass the cache for
+ blocks not in the cache. find_key_block() returns NULL in this
+ case.
+
+ After the flush phase new I/O requests must wait until the
+ re-initialization is done. The re-initialization can be done only
+ if no I/O request is in progress. The reason is that
+ key_cache_block_size can change. With enabled cache, I/O is done
+ in chunks of key_cache_block_size. Every chunk tries to use a
+ cache block first. If the block size changes in the middle, a
+ block could be missed and old data could be read.
+ */
+ while (keycache->in_resize && !keycache->resize_in_flush)
+ wait_on_queue(&keycache->resize_queue, &keycache->cache_lock);
+ /* Register the I/O for the next resize. */
+ inc_counter_for_resize_op(keycache);
+ locked_and_incremented= TRUE;
+ /* Requested data may not always be aligned to cache blocks. */
+ offset= (uint) (filepos % keycache->key_cache_block_size);
/* Read data in key_cache_block_size increments */
do
{
- keycache_pthread_mutex_lock(&keycache->cache_lock);
+ /* Cache could be disabled in a later iteration. */
+
if (!keycache->can_be_used)
- {
- keycache_pthread_mutex_unlock(&keycache->cache_lock);
goto no_key_cache;
- }
+ /* Start reading at the beginning of the cache block. */
filepos-= offset;
+ /* Do not read beyond the end of the cache block. */
read_length= length;
set_if_smaller(read_length, keycache->key_cache_block_size-offset);
KEYCACHE_DBUG_ASSERT(read_length > 0);
@@ -1824,34 +2581,61 @@ byte *key_cache_read(KEY_CACHE *keycache,
return_buffer=0;
#endif
- inc_counter_for_resize_op(keycache);
+ /* Request the cache block that matches file/pos. */
keycache->global_cache_r_requests++;
block=find_key_block(keycache, file, filepos, level, 0, &page_st);
- if (block->status != BLOCK_ERROR && page_st != PAGE_READ)
- {
- /* The requested page is to be read into the block buffer */
- read_block(keycache, block,
- keycache->key_cache_block_size, read_length+offset,
- (my_bool)(page_st == PAGE_TO_BE_READ));
- }
- else if (! (block->status & BLOCK_ERROR) &&
- block->length < read_length + offset)
+ if (!block)
{
/*
- Impossible if nothing goes wrong:
- this could only happen if we are using a file with
- small key blocks and are trying to read outside the file
+ This happens only for requests submitted during key cache
+ resize. The block is not in the cache and shall not go in.
+ Read directly from file.
*/
- my_errno= -1;
- block->status|= BLOCK_ERROR;
+ keycache->global_cache_read++;
+ keycache_pthread_mutex_unlock(&keycache->cache_lock);
+ error= (my_pread(file, (uchar*) buff, read_length,
+ filepos + offset, MYF(MY_NABP)) != 0);
+ keycache_pthread_mutex_lock(&keycache->cache_lock);
+ goto next_block;
+ }
+ if (!(block->status & BLOCK_ERROR))
+ {
+ if (page_st != PAGE_READ)
+ {
+ /* The requested page is to be read into the block buffer */
+ read_block(keycache, block,
+ keycache->key_cache_block_size, read_length+offset,
+ (my_bool)(page_st == PAGE_TO_BE_READ));
+ /*
+ A secondary request must now have the block assigned to the
+ requested file block. It does not hurt to check it for
+ primary requests too.
+ */
+ DBUG_ASSERT(keycache->can_be_used);
+ DBUG_ASSERT(block->hash_link->file == file);
+ DBUG_ASSERT(block->hash_link->diskpos == filepos);
+ DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE));
+ }
+ else if (block->length < read_length + offset)
+ {
+ /*
+ Impossible if nothing goes wrong:
+ this could only happen if we are using a file with
+ small key blocks and are trying to read outside the file
+ */
+ my_errno= -1;
+ block->status|= BLOCK_ERROR;
+ }
}
- if (! ((status= block->status) & BLOCK_ERROR))
+ /* block status may have added BLOCK_ERROR in the above 'if'. */
+ if (!((status= block->status) & BLOCK_ERROR))
{
#ifndef THREAD
if (! return_buffer)
#endif
{
+ DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE));
#if !defined(SERIALIZED_READ_FROM_CACHE)
keycache_pthread_mutex_unlock(&keycache->cache_lock);
#endif
@@ -1864,45 +2648,59 @@ byte *key_cache_read(KEY_CACHE *keycache,
#if !defined(SERIALIZED_READ_FROM_CACHE)
keycache_pthread_mutex_lock(&keycache->cache_lock);
+ DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE));
#endif
}
}
remove_reader(block);
+
/*
- Link the block into the LRU chain
- if it's the last submitted request for the block
- */
+ Link the block into the LRU ring if it's the last submitted
+ request for the block. This enables eviction for the block.
+ */
unreg_request(keycache, block, 1);
- dec_counter_for_resize_op(keycache);
-
- keycache_pthread_mutex_unlock(&keycache->cache_lock);
-
if (status & BLOCK_ERROR)
- DBUG_RETURN((byte *) 0);
+ {
+ error= 1;
+ break;
+ }
#ifndef THREAD
/* This is only true if we where able to read everything in one block */
if (return_buffer)
DBUG_RETURN(block->buffer);
#endif
+ next_block:
buff+= read_length;
filepos+= read_length+offset;
offset= 0;
} while ((length-= read_length));
- DBUG_RETURN(start);
+ goto end;
}
-no_key_cache: /* Key cache is not used */
+no_key_cache:
+ /* Key cache is not used */
- /* We can't use mutex here as the key cache may not be initialized */
keycache->global_cache_r_requests++;
keycache->global_cache_read++;
- if (my_pread(file, (byte*) buff, length, filepos+offset, MYF(MY_NABP)))
+
+ if (locked_and_incremented)
+ keycache_pthread_mutex_unlock(&keycache->cache_lock);
+ if (my_pread(file, (uchar*) buff, length, filepos, MYF(MY_NABP)))
error= 1;
- DBUG_RETURN(error ? (byte*) 0 : start);
+ if (locked_and_incremented)
+ keycache_pthread_mutex_lock(&keycache->cache_lock);
+
+end:
+ if (locked_and_incremented)
+ {
+ dec_counter_for_resize_op(keycache);
+ keycache_pthread_mutex_unlock(&keycache->cache_lock);
+ }
+ DBUG_RETURN(error ? (uchar*) 0 : start);
}
@@ -1928,94 +2726,214 @@ no_key_cache: /* Key cache is not used */
int key_cache_insert(KEY_CACHE *keycache,
File file, my_off_t filepos, int level,
- byte *buff, uint length)
+ uchar *buff, uint length)
{
+ int error= 0;
DBUG_ENTER("key_cache_insert");
DBUG_PRINT("enter", ("fd: %u pos: %lu length: %u",
(uint) file,(ulong) filepos, length));
- if (keycache->can_be_used)
+ if (keycache->key_cache_inited)
{
/* Key cache is used */
reg1 BLOCK_LINK *block;
uint read_length;
- int page_st;
- int error;
uint offset;
+ int page_st;
+ my_bool locked_and_incremented= FALSE;
- offset= (uint) (filepos & (keycache->key_cache_block_size-1));
+ /*
+ When the keycache is once initialized, we use the cache_lock to
+ reliably distinguish the cases of normal operation, resizing, and
+ disabled cache. We always increment and decrement
+ 'cnt_for_resize_op' so that a resizer can wait for pending I/O.
+ */
+ keycache_pthread_mutex_lock(&keycache->cache_lock);
+ /*
+ We do not load index data into a disabled cache nor into an
+ ongoing resize.
+ */
+ if (!keycache->can_be_used || keycache->in_resize)
+ goto no_key_cache;
+ /* Register the pseudo I/O for the next resize. */
+ inc_counter_for_resize_op(keycache);
+ locked_and_incremented= TRUE;
+ /* Loaded data may not always be aligned to cache blocks. */
+ offset= (uint) (filepos % keycache->key_cache_block_size);
+ /* Load data in key_cache_block_size increments. */
do
{
- keycache_pthread_mutex_lock(&keycache->cache_lock);
- if (!keycache->can_be_used)
- {
- keycache_pthread_mutex_unlock(&keycache->cache_lock);
- DBUG_RETURN(0);
- }
- /* Read data into key cache from buff in key_cache_block_size incr. */
+ /* Cache could be disabled or resizing in a later iteration. */
+ if (!keycache->can_be_used || keycache->in_resize)
+ goto no_key_cache;
+ /* Start loading at the beginning of the cache block. */
filepos-= offset;
+ /* Do not load beyond the end of the cache block. */
read_length= length;
set_if_smaller(read_length, keycache->key_cache_block_size-offset);
KEYCACHE_DBUG_ASSERT(read_length > 0);
- inc_counter_for_resize_op(keycache);
+ /* The block has been read by the caller already. */
+ keycache->global_cache_read++;
+ /* Request the cache block that matches file/pos. */
keycache->global_cache_r_requests++;
block= find_key_block(keycache, file, filepos, level, 0, &page_st);
- if (block->status != BLOCK_ERROR && page_st != PAGE_READ)
+ if (!block)
{
- /* The requested page is to be read into the block buffer */
-#if !defined(SERIALIZED_READ_FROM_CACHE)
- keycache_pthread_mutex_unlock(&keycache->cache_lock);
/*
- Here other threads may step in and register as secondary readers.
- They will register in block->wqueue[COND_FOR_REQUESTED].
+ This happens only for requests submitted during key cache
+ resize. The block is not in the cache and shall not go in.
+ Stop loading index data.
*/
+ goto no_key_cache;
+ }
+ if (!(block->status & BLOCK_ERROR))
+ {
+ if ((page_st == PAGE_WAIT_TO_BE_READ) ||
+ ((page_st == PAGE_TO_BE_READ) &&
+ (offset || (read_length < keycache->key_cache_block_size))))
+ {
+ /*
+ Either
+
+ this is a secondary request for a block to be read into the
+ cache. The block is in eviction. It is not yet assigned to
+ the requested file block (It does not point to the right
+ hash_link). So we cannot call remove_reader() on the block.
+ And we cannot access the hash_link directly here. We need to
+ wait until the assignment is complete. read_block() executes
+ the correct wait when called with primary == FALSE.
+
+ Or
+
+ this is a primary request for a block to be read into the
+ cache and the supplied data does not fill the whole block.
+
+ This function is called on behalf of a LOAD INDEX INTO CACHE
+ statement, which is a read-only task and allows other
+ readers. It is possible that a parallel running reader tries
+ to access this block. If it needs more data than has been
+ supplied here, it would report an error. To be sure that we
+ have all data in the block that is available in the file, we
+ read the block ourselves.
+
+ Though reading again what the caller did read already is an
+ expensive operation, we need to do this for correctness.
+ */
+ read_block(keycache, block, keycache->key_cache_block_size,
+ read_length + offset, (page_st == PAGE_TO_BE_READ));
+ /*
+ A secondary request must now have the block assigned to the
+ requested file block. It does not hurt to check it for
+ primary requests too.
+ */
+ DBUG_ASSERT(keycache->can_be_used);
+ DBUG_ASSERT(block->hash_link->file == file);
+ DBUG_ASSERT(block->hash_link->diskpos == filepos);
+ DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE));
+ }
+ else if (page_st == PAGE_TO_BE_READ)
+ {
+ /*
+ This is a new block in the cache. If we come here, we have
+ data for the whole block.
+ */
+ DBUG_ASSERT(block->hash_link->requests);
+ DBUG_ASSERT(block->status & BLOCK_IN_USE);
+ DBUG_ASSERT((page_st == PAGE_TO_BE_READ) ||
+ (block->status & BLOCK_READ));
+
+#if !defined(SERIALIZED_READ_FROM_CACHE)
+ keycache_pthread_mutex_unlock(&keycache->cache_lock);
+ /*
+ Here other threads may step in and register as secondary readers.
+ They will register in block->wqueue[COND_FOR_REQUESTED].
+ */
#endif
- /* Copy data from buff */
- if (!(read_length & 511))
- bmove512(block->buffer+offset, buff, read_length);
- else
- memcpy(block->buffer+offset, buff, (size_t) read_length);
+ /* Copy data from buff */
+ if (!(read_length & 511))
+ bmove512(block->buffer+offset, buff, read_length);
+ else
+ memcpy(block->buffer+offset, buff, (size_t) read_length);
#if !defined(SERIALIZED_READ_FROM_CACHE)
- keycache_pthread_mutex_lock(&keycache->cache_lock);
- /* Here we are alone again. */
-#endif
- block->status= BLOCK_READ;
- block->length= read_length+offset;
- KEYCACHE_DBUG_PRINT("key_cache_insert",
- ("primary request: new page in cache"));
-#ifdef THREAD
- /* Signal that all pending requests for this now can be processed. */
- if (block->wqueue[COND_FOR_REQUESTED].last_thread)
- release_queue(&block->wqueue[COND_FOR_REQUESTED]);
+ keycache_pthread_mutex_lock(&keycache->cache_lock);
+ DBUG_ASSERT(block->status & BLOCK_IN_USE);
+ DBUG_ASSERT((page_st == PAGE_TO_BE_READ) ||
+ (block->status & BLOCK_READ));
#endif
- }
+ /*
+ After the data is in the buffer, we can declare the block
+ valid. Now other threads do not need to register as
+ secondary readers any more. They can immediately access the
+ block.
+ */
+ block->status|= BLOCK_READ;
+ block->length= read_length+offset;
+ /*
+ Do not set block->offset here. If this block is marked
+ BLOCK_CHANGED later, we want to flush only the modified part. So
+ only a writer may set block->offset down from
+ keycache->key_cache_block_size.
+ */
+ KEYCACHE_DBUG_PRINT("key_cache_insert",
+ ("primary request: new page in cache"));
+ /* Signal all pending requests. */
+ release_whole_queue(&block->wqueue[COND_FOR_REQUESTED]);
+ }
+ else
+ {
+ /*
+ page_st == PAGE_READ. The block is in the buffer. All data
+ must already be present. Blocks are always read with all
+ data available on file. Assert that the block does not have
+ less contents than the preloader supplies. If the caller has
+ data beyond block->length, it means that a file write has
+ been done while this block was in cache and not extended
+ with the new data. If the condition is met, we can simply
+ ignore the block.
+ */
+ DBUG_ASSERT((page_st == PAGE_READ) &&
+ (read_length + offset <= block->length));
+ }
+
+ /*
+ A secondary request must now have the block assigned to the
+ requested file block. It does not hurt to check it for primary
+ requests too.
+ */
+ DBUG_ASSERT(block->hash_link->file == file);
+ DBUG_ASSERT(block->hash_link->diskpos == filepos);
+ DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE));
+ } /* end of if (!(block->status & BLOCK_ERROR)) */
+
remove_reader(block);
+
/*
- Link the block into the LRU chain
- if it's the last submitted request for the block
+ Link the block into the LRU ring if it's the last submitted
+ request for the block. This enables eviction for the block.
*/
unreg_request(keycache, block, 1);
error= (block->status & BLOCK_ERROR);
- dec_counter_for_resize_op(keycache);
-
- keycache_pthread_mutex_unlock(&keycache->cache_lock);
-
if (error)
- DBUG_RETURN(1);
+ break;
buff+= read_length;
filepos+= read_length+offset;
offset= 0;
} while ((length-= read_length));
+
+ no_key_cache:
+ if (locked_and_incremented)
+ dec_counter_for_resize_op(keycache);
+ keycache_pthread_mutex_unlock(&keycache->cache_lock);
}
- DBUG_RETURN(0);
+ DBUG_RETURN(error);
}
@@ -2044,15 +2962,17 @@ int key_cache_insert(KEY_CACHE *keycache,
It ensures that this data is flushed to the file if dont_write is FALSE.
Filepos must be a multiple of 'block_length', but it doesn't
have to be a multiple of key_cache_block_size;
+
+ dont_write is always TRUE in the server (info->lock_type is never F_UNLCK).
*/
int key_cache_write(KEY_CACHE *keycache,
File file, my_off_t filepos, int level,
- byte *buff, uint length,
+ uchar *buff, uint length,
uint block_length __attribute__((unused)),
int dont_write)
{
- reg1 BLOCK_LINK *block;
+ my_bool locked_and_incremented= FALSE;
int error=0;
DBUG_ENTER("key_cache_write");
DBUG_PRINT("enter",
@@ -2062,10 +2982,14 @@ int key_cache_write(KEY_CACHE *keycache,
if (!dont_write)
{
- /* Force writing from buff into disk */
+ /* purecov: begin inspected */
+ /* Not used in the server. */
+ /* Force writing from buff into disk. */
+ keycache->global_cache_w_requests++;
keycache->global_cache_write++;
if (my_pwrite(file, buff, length, filepos, MYF(MY_NABP | MY_WAIT_IF_FULL)))
DBUG_RETURN(1);
+ /* purecov: end */
}
#if !defined(DBUG_OFF) && defined(EXTRA_DEBUG)
@@ -2073,92 +2997,222 @@ int key_cache_write(KEY_CACHE *keycache,
test_key_cache(keycache, "start of key_cache_write", 1););
#endif
- if (keycache->can_be_used)
+ if (keycache->key_cache_inited)
{
/* Key cache is used */
+ reg1 BLOCK_LINK *block;
uint read_length;
- int page_st;
uint offset;
+ int page_st;
- offset= (uint) (filepos & (keycache->key_cache_block_size-1));
+ /*
+ When the key cache is once initialized, we use the cache_lock to
+ reliably distinguish the cases of normal operation, resizing, and
+ disabled cache. We always increment and decrement
+ 'cnt_for_resize_op' so that a resizer can wait for pending I/O.
+ */
+ keycache_pthread_mutex_lock(&keycache->cache_lock);
+ /*
+ Cache resizing has two phases: Flushing and re-initializing. In
+ the flush phase write requests can modify dirty blocks that are
+ not yet in flush. Otherwise they are allowed to bypass the cache.
+ find_key_block() returns NULL in both cases (clean blocks and
+ non-cached blocks).
+
+ After the flush phase new I/O requests must wait until the
+ re-initialization is done. The re-initialization can be done only
+ if no I/O request is in progress. The reason is that
+ key_cache_block_size can change. With enabled cache I/O is done in
+ chunks of key_cache_block_size. Every chunk tries to use a cache
+ block first. If the block size changes in the middle, a block
+ could be missed and data could be written below a cached block.
+ */
+ while (keycache->in_resize && !keycache->resize_in_flush)
+ wait_on_queue(&keycache->resize_queue, &keycache->cache_lock);
+ /* Register the I/O for the next resize. */
+ inc_counter_for_resize_op(keycache);
+ locked_and_incremented= TRUE;
+ /* Requested data may not always be aligned to cache blocks. */
+ offset= (uint) (filepos % keycache->key_cache_block_size);
+ /* Write data in key_cache_block_size increments. */
do
{
- keycache_pthread_mutex_lock(&keycache->cache_lock);
+ /* Cache could be disabled in a later iteration. */
if (!keycache->can_be_used)
- {
- keycache_pthread_mutex_unlock(&keycache->cache_lock);
goto no_key_cache;
- }
- /* Write data in key_cache_block_size increments */
+ /* Start writing at the beginning of the cache block. */
filepos-= offset;
+ /* Do not write beyond the end of the cache block. */
read_length= length;
set_if_smaller(read_length, keycache->key_cache_block_size-offset);
KEYCACHE_DBUG_ASSERT(read_length > 0);
- inc_counter_for_resize_op(keycache);
+ /* Request the cache block that matches file/pos. */
keycache->global_cache_w_requests++;
block= find_key_block(keycache, file, filepos, level, 1, &page_st);
if (!block)
{
- /* It happens only for requests submitted during resize operation */
- dec_counter_for_resize_op(keycache);
- keycache_pthread_mutex_unlock(&keycache->cache_lock);
- if (dont_write)
+ /*
+ This happens only for requests submitted during key cache
+ resize. The block is not in the cache and shall not go in.
+ Write directly to file.
+ */
+ if (dont_write)
{
- keycache->global_cache_w_requests++;
+ /* Used in the server. */
keycache->global_cache_write++;
- if (my_pwrite(file, (byte*) buff, length, filepos,
- MYF(MY_NABP | MY_WAIT_IF_FULL)))
+ keycache_pthread_mutex_unlock(&keycache->cache_lock);
+ if (my_pwrite(file, (uchar*) buff, read_length, filepos + offset,
+ MYF(MY_NABP | MY_WAIT_IF_FULL)))
error=1;
- }
+ keycache_pthread_mutex_lock(&keycache->cache_lock);
+ }
goto next_block;
}
-
- if (block->status != BLOCK_ERROR && page_st != PAGE_READ &&
- (offset || read_length < keycache->key_cache_block_size))
+ /*
+ Prevent block from flushing and from being selected for to be
+ freed. This must be set when we release the cache_lock.
+ However, we must not set the status of the block before it is
+ assigned to this file/pos.
+ */
+ if (page_st != PAGE_WAIT_TO_BE_READ)
+ block->status|= BLOCK_FOR_UPDATE;
+ /*
+ We must read the file block first if it is not yet in the cache
+ and we do not replace all of its contents.
+
+ In cases where the cache block is big enough to contain (parts
+ of) index blocks of different indexes, our request can be
+ secondary (PAGE_WAIT_TO_BE_READ). In this case another thread is
+ reading the file block. If the read completes after us, it
+ overwrites our new contents with the old contents. So we have to
+ wait for the other thread to complete the read of this block.
+ read_block() takes care for the wait.
+ */
+ if (!(block->status & BLOCK_ERROR) &&
+ ((page_st == PAGE_TO_BE_READ &&
+ (offset || read_length < keycache->key_cache_block_size)) ||
+ (page_st == PAGE_WAIT_TO_BE_READ)))
+ {
read_block(keycache, block,
offset + read_length >= keycache->key_cache_block_size?
offset : keycache->key_cache_block_size,
- offset,(my_bool)(page_st == PAGE_TO_BE_READ));
+ offset, (page_st == PAGE_TO_BE_READ));
+ DBUG_ASSERT(keycache->can_be_used);
+ DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE));
+ /*
+ Prevent block from flushing and from being selected for to be
+ freed. This must be set when we release the cache_lock.
+ Here we set it in case we could not set it above.
+ */
+ block->status|= BLOCK_FOR_UPDATE;
+ }
+ /*
+ The block should always be assigned to the requested file block
+ here. It need not be BLOCK_READ when overwriting the whole block.
+ */
+ DBUG_ASSERT(block->hash_link->file == file);
+ DBUG_ASSERT(block->hash_link->diskpos == filepos);
+ DBUG_ASSERT(block->status & BLOCK_IN_USE);
+ DBUG_ASSERT((page_st == PAGE_TO_BE_READ) || (block->status & BLOCK_READ));
+ /*
+ The block to be written must not be marked BLOCK_REASSIGNED.
+ Otherwise it could be freed in dirty state or reused without
+ another flush during eviction. It must also not be in flush.
+ Otherwise the old contens may have been flushed already and
+ the flusher could clear BLOCK_CHANGED without flushing the
+ new changes again.
+ */
+ DBUG_ASSERT(!(block->status & BLOCK_REASSIGNED));
+
+ while (block->status & BLOCK_IN_FLUSHWRITE)
+ {
+ /*
+ Another thread is flushing the block. It was dirty already.
+ Wait until the block is flushed to file. Otherwise we could
+ modify the buffer contents just while it is written to file.
+ An unpredictable file block contents would be the result.
+ While we wait, several things can happen to the block,
+ including another flush. But the block cannot be reassigned to
+ another hash_link until we release our request on it.
+ */
+ wait_on_queue(&block->wqueue[COND_FOR_SAVED], &keycache->cache_lock);
+ DBUG_ASSERT(keycache->can_be_used);
+ DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE));
+ /* Still must not be marked for free. */
+ DBUG_ASSERT(!(block->status & BLOCK_REASSIGNED));
+ DBUG_ASSERT(block->hash_link && (block->hash_link->block == block));
+ }
+
+ /*
+ We could perhaps release the cache_lock during access of the
+ data like in the other functions. Locks outside of the key cache
+ assure that readers and a writer do not access the same range of
+ data. Parallel accesses should happen only if the cache block
+ contains multiple index block(fragment)s. So different parts of
+ the buffer would be read/written. An attempt to flush during
+ memcpy() is prevented with BLOCK_FOR_UPDATE.
+ */
+ if (!(block->status & BLOCK_ERROR))
+ {
+#if !defined(SERIALIZED_READ_FROM_CACHE)
+ keycache_pthread_mutex_unlock(&keycache->cache_lock);
+#endif
+ if (!(read_length & 511))
+ bmove512(block->buffer+offset, buff, read_length);
+ else
+ memcpy(block->buffer+offset, buff, (size_t) read_length);
+
+#if !defined(SERIALIZED_READ_FROM_CACHE)
+ keycache_pthread_mutex_lock(&keycache->cache_lock);
+#endif
+ }
if (!dont_write)
{
- /* buff has been written to disk at start */
+ /* Not used in the server. buff has been written to disk at start. */
if ((block->status & BLOCK_CHANGED) &&
(!offset && read_length >= keycache->key_cache_block_size))
link_to_file_list(keycache, block, block->hash_link->file, 1);
}
else if (! (block->status & BLOCK_CHANGED))
link_to_changed_list(keycache, block);
+ block->status|=BLOCK_READ;
+ /*
+ Allow block to be selected for to be freed. Since it is marked
+ BLOCK_CHANGED too, it won't be selected for to be freed without
+ a flush.
+ */
+ block->status&= ~BLOCK_FOR_UPDATE;
set_if_smaller(block->offset, offset);
set_if_bigger(block->length, read_length+offset);
- if (! (block->status & BLOCK_ERROR))
- {
- if (!(read_length & 511))
- bmove512(block->buffer+offset, buff, read_length);
- else
- memcpy(block->buffer+offset, buff, (size_t) read_length);
- }
+ /* Threads may be waiting for the changes to be complete. */
+ release_whole_queue(&block->wqueue[COND_FOR_REQUESTED]);
- block->status|=BLOCK_READ;
+ /*
+ If only a part of the cache block is to be replaced, and the
+ rest has been read from file, then the cache lock has been
+ released for I/O and it could be possible that another thread
+ wants to evict or free the block and waits for it to be
+ released. So we must not just decrement hash_link->requests, but
+ also wake a waiting thread.
+ */
+ remove_reader(block);
- /* Unregister the request */
- block->hash_link->requests--;
+ /*
+ Link the block into the LRU ring if it's the last submitted
+ request for the block. This enables eviction for the block.
+ */
unreg_request(keycache, block, 1);
if (block->status & BLOCK_ERROR)
{
- keycache_pthread_mutex_unlock(&keycache->cache_lock);
error= 1;
break;
}
- dec_counter_for_resize_op(keycache);
-
- keycache_pthread_mutex_unlock(&keycache->cache_lock);
-
next_block:
buff+= read_length;
filepos+= read_length+offset;
@@ -2172,14 +3226,24 @@ no_key_cache:
/* Key cache is not used */
if (dont_write)
{
+ /* Used in the server. */
keycache->global_cache_w_requests++;
keycache->global_cache_write++;
- if (my_pwrite(file, (byte*) buff, length, filepos,
+ if (locked_and_incremented)
+ keycache_pthread_mutex_unlock(&keycache->cache_lock);
+ if (my_pwrite(file, (uchar*) buff, length, filepos,
MYF(MY_NABP | MY_WAIT_IF_FULL)))
error=1;
+ if (locked_and_incremented)
+ keycache_pthread_mutex_lock(&keycache->cache_lock);
}
end:
+ if (locked_and_incremented)
+ {
+ dec_counter_for_resize_op(keycache);
+ keycache_pthread_mutex_unlock(&keycache->cache_lock);
+ }
#if !defined(DBUG_OFF) && defined(EXTRA_DEBUG)
DBUG_EXECUTE("exec",
test_key_cache(keycache, "end of key_cache_write", 1););
@@ -2189,9 +3253,30 @@ end:
/*
- Free block: remove reference to it from hash table,
- remove it from the chain file of dirty/clean blocks
- and add it to the free list.
+ Free block.
+
+ SYNOPSIS
+ free_block()
+ keycache Pointer to a key cache data structure
+ block Pointer to the block to free
+
+ DESCRIPTION
+ Remove reference to block from hash table.
+ Remove block from the chain of clean blocks.
+ Add block to the free list.
+
+ NOTE
+ Block must not be free (status == 0).
+ Block must not be in free_block_list.
+ Block must not be in the LRU ring.
+ Block must not be in eviction (BLOCK_IN_EVICTION | BLOCK_IN_SWITCH).
+ Block must not be in free (BLOCK_REASSIGNED).
+ Block must not be in flush (BLOCK_IN_FLUSH).
+ Block must not be dirty (BLOCK_CHANGED).
+ Block must not be in changed_blocks (dirty) hash.
+ Block must be in file_blocks (clean) hash.
+ Block must refer to a hash_link.
+ Block must have a request registered on it.
*/
static void free_block(KEY_CACHE *keycache, BLOCK_LINK *block)
@@ -2200,6 +3285,31 @@ static void free_block(KEY_CACHE *keycache, BLOCK_LINK *block)
KEYCACHE_DBUG_PRINT("free_block",
("block %u to be freed, hash_link %p",
BLOCK_NUMBER(block), block->hash_link));
+ /*
+ Assert that the block is not free already. And that it is in a clean
+ state. Note that the block might just be assigned to a hash_link and
+ not yet read (BLOCK_READ may not be set here). In this case a reader
+ is registered in the hash_link and free_block() will wait for it
+ below.
+ */
+ DBUG_ASSERT((block->status & BLOCK_IN_USE) &&
+ !(block->status & (BLOCK_IN_EVICTION | BLOCK_IN_SWITCH |
+ BLOCK_REASSIGNED | BLOCK_IN_FLUSH |
+ BLOCK_CHANGED | BLOCK_FOR_UPDATE)));
+ /* Assert that the block is in a file_blocks chain. */
+ DBUG_ASSERT(block->prev_changed && *block->prev_changed == block);
+ /* Assert that the block is not in the LRU ring. */
+ DBUG_ASSERT(!block->next_used && !block->prev_used);
+ /*
+ IMHO the below condition (if()) makes no sense. I can't see how it
+ could be possible that free_block() is entered with a NULL hash_link
+ pointer. The only place where it can become NULL is in free_block()
+ (or before its first use ever, but for those blocks free_block() is
+ not called). I don't remove the conditional as it cannot harm, but
+ place an DBUG_ASSERT to confirm my hypothesis. Eventually the
+ condition (if()) can be removed.
+ */
+ DBUG_ASSERT(block->hash_link && block->hash_link->block == block);
if (block->hash_link)
{
/*
@@ -2210,35 +3320,85 @@ static void free_block(KEY_CACHE *keycache, BLOCK_LINK *block)
*/
block->status|= BLOCK_REASSIGNED;
wait_for_readers(keycache, block);
- unlink_hash(keycache, block->hash_link);
+ /*
+ The block must not have been freed by another thread. Repeat some
+ checks. An additional requirement is that it must be read now
+ (BLOCK_READ).
+ */
+ DBUG_ASSERT(block->hash_link && block->hash_link->block == block);
+ DBUG_ASSERT((block->status & (BLOCK_READ | BLOCK_IN_USE |
+ BLOCK_REASSIGNED)) &&
+ !(block->status & (BLOCK_IN_EVICTION | BLOCK_IN_SWITCH |
+ BLOCK_IN_FLUSH | BLOCK_CHANGED |
+ BLOCK_FOR_UPDATE)));
+ DBUG_ASSERT(block->prev_changed && *block->prev_changed == block);
+ DBUG_ASSERT(!block->prev_used);
+ /*
+ Unset BLOCK_REASSIGNED again. If we hand the block to an evicting
+ thread (through unreg_request() below), other threads must not see
+ this flag. They could become confused.
+ */
+ block->status&= ~BLOCK_REASSIGNED;
+ /*
+ Do not release the hash_link until the block is off all lists.
+ At least not if we hand it over for eviction in unreg_request().
+ */
}
- unlink_changed(block);
- block->status= 0;
- block->length= 0;
- block->offset= keycache->key_cache_block_size;
- KEYCACHE_THREAD_TRACE("free block");
- KEYCACHE_DBUG_PRINT("free_block",
- ("block is freed"));
+ /*
+ Unregister the block request and link the block into the LRU ring.
+ This enables eviction for the block. If the LRU ring was empty and
+ threads are waiting for a block, then the block wil be handed over
+ for eviction immediately. Otherwise we will unlink it from the LRU
+ ring again, without releasing the lock in between. So decrementing
+ the request counter and updating statistics are the only relevant
+ operation in this case. Assert that there are no other requests
+ registered.
+ */
+ DBUG_ASSERT(block->requests == 1);
unreg_request(keycache, block, 0);
- block->hash_link= NULL;
+ /*
+ Note that even without releasing the cache lock it is possible that
+ the block is immediately selected for eviction by link_block() and
+ thus not added to the LRU ring. In this case we must not touch the
+ block any more.
+ */
+ if (block->status & BLOCK_IN_EVICTION)
+ return;
- /* Remove the free block from the LRU ring. */
+ /* Here the block must be in the LRU ring. Unlink it again. */
+ DBUG_ASSERT(block->next_used && block->prev_used &&
+ *block->prev_used == block);
unlink_block(keycache, block);
if (block->temperature == BLOCK_WARM)
keycache->warm_blocks--;
block->temperature= BLOCK_COLD;
+
+ /* Remove from file_blocks hash. */
+ unlink_changed(block);
+
+ /* Remove reference to block from hash table. */
+ unlink_hash(keycache, block->hash_link);
+ block->hash_link= NULL;
+
+ block->status= 0;
+ block->length= 0;
+ block->offset= keycache->key_cache_block_size;
+ KEYCACHE_THREAD_TRACE("free block");
+ KEYCACHE_DBUG_PRINT("free_block", ("block is freed"));
+
+ /* Enforced by unlink_changed(), but just to be sure. */
+ DBUG_ASSERT(!block->next_changed && !block->prev_changed);
+ /* Enforced by unlink_block(): not in LRU ring nor in free_block_list. */
+ DBUG_ASSERT(!block->next_used && !block->prev_used);
/* Insert the free block in the free list. */
block->next_used= keycache->free_block_list;
keycache->free_block_list= block;
/* Keep track of the number of currently unused blocks. */
keycache->blocks_unused++;
-#ifdef THREAD
/* All pending requests for this page must be resubmitted. */
- if (block->wqueue[COND_FOR_SAVED].last_thread)
- release_queue(&block->wqueue[COND_FOR_SAVED]);
-#endif
+ release_whole_queue(&block->wqueue[COND_FOR_SAVED]);
}
@@ -2269,59 +3429,102 @@ static int flush_cached_blocks(KEY_CACHE *keycache,
As all blocks referred in 'cache' are marked by BLOCK_IN_FLUSH
we are guarunteed no thread will change them
*/
- qsort((byte*) cache, count, sizeof(*cache), (qsort_cmp) cmp_sec_link);
+ qsort((uchar*) cache, count, sizeof(*cache), (qsort_cmp) cmp_sec_link);
keycache_pthread_mutex_lock(&keycache->cache_lock);
+ /*
+ Note: Do not break the loop. We have registered a request on every
+ block in 'cache'. These must be unregistered by free_block() or
+ unreg_request().
+ */
for ( ; cache != end ; cache++)
{
BLOCK_LINK *block= *cache;
KEYCACHE_DBUG_PRINT("flush_cached_blocks",
("block %u to be flushed", BLOCK_NUMBER(block)));
- keycache_pthread_mutex_unlock(&keycache->cache_lock);
- error= my_pwrite(file,
- block->buffer+block->offset,
- block->length - block->offset,
- block->hash_link->diskpos+ block->offset,
- MYF(MY_NABP | MY_WAIT_IF_FULL));
- keycache_pthread_mutex_lock(&keycache->cache_lock);
- keycache->global_cache_write++;
- if (error)
+ /*
+ If the block contents is going to be changed, we abandon the flush
+ for this block. flush_key_blocks_int() will restart its search and
+ handle the block properly.
+ */
+ if (!(block->status & BLOCK_FOR_UPDATE))
{
- block->status|= BLOCK_ERROR;
- if (!last_errno)
- last_errno= errno ? errno : -1;
+ /* Blocks coming here must have a certain status. */
+ DBUG_ASSERT(block->hash_link);
+ DBUG_ASSERT(block->hash_link->block == block);
+ DBUG_ASSERT(block->hash_link->file == file);
+ DBUG_ASSERT((block->status & ~BLOCK_IN_EVICTION) ==
+ (BLOCK_READ | BLOCK_IN_FLUSH | BLOCK_CHANGED | BLOCK_IN_USE));
+ block->status|= BLOCK_IN_FLUSHWRITE;
+ keycache_pthread_mutex_unlock(&keycache->cache_lock);
+ error= my_pwrite(file,
+ block->buffer+block->offset,
+ block->length - block->offset,
+ block->hash_link->diskpos+ block->offset,
+ MYF(MY_NABP | MY_WAIT_IF_FULL));
+ keycache_pthread_mutex_lock(&keycache->cache_lock);
+ keycache->global_cache_write++;
+ if (error)
+ {
+ block->status|= BLOCK_ERROR;
+ if (!last_errno)
+ last_errno= errno ? errno : -1;
+ }
+ block->status&= ~BLOCK_IN_FLUSHWRITE;
+ /* Block must not have changed status except BLOCK_FOR_UPDATE. */
+ DBUG_ASSERT(block->hash_link);
+ DBUG_ASSERT(block->hash_link->block == block);
+ DBUG_ASSERT(block->hash_link->file == file);
+ DBUG_ASSERT((block->status & ~(BLOCK_FOR_UPDATE | BLOCK_IN_EVICTION)) ==
+ (BLOCK_READ | BLOCK_IN_FLUSH | BLOCK_CHANGED | BLOCK_IN_USE));
+ /*
+ Set correct status and link in right queue for free or later use.
+ free_block() must not see BLOCK_CHANGED and it may need to wait
+ for readers of the block. These should not see the block in the
+ wrong hash. If not freeing the block, we need to have it in the
+ right queue anyway.
+ */
+ link_to_file_list(keycache, block, file, 1);
+
}
- #ifdef THREAD
+ block->status&= ~BLOCK_IN_FLUSH;
/*
Let to proceed for possible waiting requests to write to the block page.
It might happen only during an operation to resize the key cache.
*/
- if (block->wqueue[COND_FOR_SAVED].last_thread)
- release_queue(&block->wqueue[COND_FOR_SAVED]);
-#endif
+ release_whole_queue(&block->wqueue[COND_FOR_SAVED]);
/* type will never be FLUSH_IGNORE_CHANGED here */
- if (! (type == FLUSH_KEEP || type == FLUSH_FORCE_WRITE))
+ if (!(type == FLUSH_KEEP || type == FLUSH_FORCE_WRITE) &&
+ !(block->status & (BLOCK_IN_EVICTION | BLOCK_IN_SWITCH |
+ BLOCK_FOR_UPDATE)))
{
- keycache->blocks_changed--;
- keycache->global_blocks_changed--;
+ /*
+ Note that a request has been registered against the block in
+ flush_key_blocks_int().
+ */
free_block(keycache, block);
}
else
{
- block->status&= ~BLOCK_IN_FLUSH;
- link_to_file_list(keycache, block, file, 1);
+ /*
+ Link the block into the LRU ring if it's the last submitted
+ request for the block. This enables eviction for the block.
+ Note that a request has been registered against the block in
+ flush_key_blocks_int().
+ */
unreg_request(keycache, block, 1);
}
- }
+ } /* end of for ( ; cache != end ; cache++) */
return last_errno;
}
/*
- flush all key blocks for a file to disk, but don't do any mutex locks
+ flush all key blocks for a file to disk, but don't do any mutex locks.
+ SYNOPSIS
flush_key_blocks_int()
keycache pointer to a key cache data structure
file handler for the file to flush to
@@ -2332,6 +3535,10 @@ static int flush_cached_blocks(KEY_CACHE *keycache,
from flush_key_blocks and flush_all_key_blocks (the later one does the
mutex lock in the resize_key_cache() function).
+ We do only care about changed blocks that exist when the function is
+ entered. We do not guarantee that all changed blocks of the file are
+ flushed if more blocks change while this function is running.
+
RETURN
0 ok
1 error
@@ -2342,6 +3549,7 @@ static int flush_key_blocks_int(KEY_CACHE *keycache,
{
BLOCK_LINK *cache_buff[FLUSH_CACHE],**cache;
int last_errno= 0;
+ int last_errcnt= 0;
DBUG_ENTER("flush_key_blocks_int");
DBUG_PRINT("enter",("file: %d blocks_used: %lu blocks_changed: %lu",
file, keycache->blocks_used, keycache->blocks_changed));
@@ -2357,9 +3565,11 @@ static int flush_key_blocks_int(KEY_CACHE *keycache,
{
/* Key cache exists and flush is not disabled */
int error= 0;
- uint count= 0;
+ uint count= FLUSH_CACHE;
BLOCK_LINK **pos,**end;
BLOCK_LINK *first_in_switch= NULL;
+ BLOCK_LINK *last_in_flush;
+ BLOCK_LINK *last_for_update;
BLOCK_LINK *block, *next;
#if defined(KEYCACHE_DEBUG)
uint cnt=0;
@@ -2371,28 +3581,39 @@ static int flush_key_blocks_int(KEY_CACHE *keycache,
Count how many key blocks we have to cache to be able
to flush all dirty pages with minimum seek moves
*/
+ count= 0;
for (block= keycache->changed_blocks[FILE_HASH(file)] ;
block ;
block= block->next_changed)
{
- if (block->hash_link->file == file)
+ if ((block->hash_link->file == file) &&
+ !(block->status & BLOCK_IN_FLUSH))
{
count++;
KEYCACHE_DBUG_ASSERT(count<= keycache->blocks_used);
}
}
- /* Allocate a new buffer only if its bigger than the one we have */
- if (count > FLUSH_CACHE &&
+ /*
+ Allocate a new buffer only if its bigger than the one we have.
+ Assure that we always have some entries for the case that new
+ changed blocks appear while we need to wait for something.
+ */
+ if ((count > FLUSH_CACHE) &&
!(cache= (BLOCK_LINK**) my_malloc(sizeof(BLOCK_LINK*)*count,
MYF(0))))
- {
cache= cache_buff;
+ /*
+ After a restart there could be more changed blocks than now.
+ So we should not let count become smaller than the fixed buffer.
+ */
+ if (cache == cache_buff)
count= FLUSH_CACHE;
- }
}
/* Retrieve the blocks and write them to a buffer to be flushed */
restart:
+ last_in_flush= NULL;
+ last_for_update= NULL;
end= (pos= cache)+count;
for (block= keycache->changed_blocks[FILE_HASH(file)] ;
block ;
@@ -2405,123 +3626,353 @@ restart:
next= block->next_changed;
if (block->hash_link->file == file)
{
- /*
- Mark the block with BLOCK_IN_FLUSH in order not to let
- other threads to use it for new pages and interfere with
- our sequence ot flushing dirty file pages
- */
- block->status|= BLOCK_IN_FLUSH;
-
- if (! (block->status & BLOCK_IN_SWITCH))
+ if (!(block->status & (BLOCK_IN_FLUSH | BLOCK_FOR_UPDATE)))
{
- /*
- We care only for the blocks for which flushing was not
- initiated by other threads as a result of page swapping
+ /*
+ Note: The special handling of BLOCK_IN_SWITCH is obsolete
+ since we set BLOCK_IN_FLUSH if the eviction includes a
+ flush. It can be removed in a later version.
*/
- reg_requests(keycache, block, 1);
- if (type != FLUSH_IGNORE_CHANGED)
+ if (!(block->status & BLOCK_IN_SWITCH))
{
- /* It's not a temporary file */
- if (pos == end)
+ /*
+ We care only for the blocks for which flushing was not
+ initiated by another thread and which are not in eviction.
+ Registering a request on the block unlinks it from the LRU
+ ring and protects against eviction.
+ */
+ reg_requests(keycache, block, 1);
+ if (type != FLUSH_IGNORE_CHANGED)
{
- /*
- This happens only if there is not enough
- memory for the big block
+ /* It's not a temporary file */
+ if (pos == end)
+ {
+ /*
+ This should happen relatively seldom. Remove the
+ request because we won't do anything with the block
+ but restart and pick it again in the next iteration.
+ */
+ unreg_request(keycache, block, 0);
+ /*
+ This happens only if there is not enough
+ memory for the big block
+ */
+ if ((error= flush_cached_blocks(keycache, file, cache,
+ end,type)))
+ {
+ /* Do not loop infinitely trying to flush in vain. */
+ if ((last_errno == error) && (++last_errcnt > 5))
+ goto err;
+ last_errno= error;
+ }
+ /*
+ Restart the scan as some other thread might have changed
+ the changed blocks chain: the blocks that were in switch
+ state before the flush started have to be excluded
+ */
+ goto restart;
+ }
+ /*
+ Mark the block with BLOCK_IN_FLUSH in order not to let
+ other threads to use it for new pages and interfere with
+ our sequence of flushing dirty file pages. We must not
+ set this flag before actually putting the block on the
+ write burst array called 'cache'.
*/
- if ((error= flush_cached_blocks(keycache, file, cache,
- end,type)))
- last_errno=error;
+ block->status|= BLOCK_IN_FLUSH;
+ /* Add block to the array for a write burst. */
+ *pos++= block;
+ }
+ else
+ {
+ /* It's a temporary file */
+ DBUG_ASSERT(!(block->status & BLOCK_REASSIGNED));
+
/*
- Restart the scan as some other thread might have changed
- the changed blocks chain: the blocks that were in switch
- state before the flush started have to be excluded
+ free_block() must not be called with BLOCK_CHANGED. Note
+ that we must not change the BLOCK_CHANGED flag outside of
+ link_to_file_list() so that it is always in the correct
+ queue and the *blocks_changed counters are correct.
*/
- goto restart;
+ link_to_file_list(keycache, block, file, 1);
+ if (!(block->status & (BLOCK_IN_EVICTION | BLOCK_IN_SWITCH)))
+ {
+ /* A request has been registered against the block above. */
+ free_block(keycache, block);
+ }
+ else
+ {
+ /*
+ Link the block into the LRU ring if it's the last
+ submitted request for the block. This enables eviction
+ for the block. A request has been registered against
+ the block above.
+ */
+ unreg_request(keycache, block, 1);
+ }
}
- *pos++= block;
}
else
{
- /* It's a temporary file */
- keycache->blocks_changed--;
- keycache->global_blocks_changed--;
- free_block(keycache, block);
+ /*
+ Link the block into a list of blocks 'in switch'.
+
+ WARNING: Here we introduce a place where a changed block
+ is not in the changed_blocks hash! This is acceptable for
+ a BLOCK_IN_SWITCH. Never try this for another situation.
+ Other parts of the key cache code rely on changed blocks
+ being in the changed_blocks hash.
+ */
+ unlink_changed(block);
+ link_changed(block, &first_in_switch);
}
}
- else
+ else if (type != FLUSH_KEEP)
{
- /* Link the block into a list of blocks 'in switch' */
- unlink_changed(block);
- link_changed(block, &first_in_switch);
+ /*
+ During the normal flush at end of statement (FLUSH_KEEP) we
+ do not need to ensure that blocks in flush or update by
+ other threads are flushed. They will be flushed by them
+ later. In all other cases we must assure that we do not have
+ any changed block of this file in the cache when this
+ function returns.
+ */
+ if (block->status & BLOCK_IN_FLUSH)
+ {
+ /* Remember the last block found to be in flush. */
+ last_in_flush= block;
+ }
+ else
+ {
+ /* Remember the last block found to be selected for update. */
+ last_for_update= block;
+ }
}
}
}
if (pos != cache)
{
if ((error= flush_cached_blocks(keycache, file, cache, pos, type)))
+ {
+ /* Do not loop inifnitely trying to flush in vain. */
+ if ((last_errno == error) && (++last_errcnt > 5))
+ goto err;
last_errno= error;
+ }
+ /*
+ Do not restart here during the normal flush at end of statement
+ (FLUSH_KEEP). We have now flushed at least all blocks that were
+ changed when entering this function. In all other cases we must
+ assure that we do not have any changed block of this file in the
+ cache when this function returns.
+ */
+ if (type != FLUSH_KEEP)
+ goto restart;
}
- /* Wait until list of blocks in switch is empty */
+ if (last_in_flush)
+ {
+ /*
+ There are no blocks to be flushed by this thread, but blocks in
+ flush by other threads. Wait until one of the blocks is flushed.
+ Re-check the condition for last_in_flush. We may have unlocked
+ the cache_lock in flush_cached_blocks(). The state of the block
+ could have changed.
+ */
+ if (last_in_flush->status & BLOCK_IN_FLUSH)
+ wait_on_queue(&last_in_flush->wqueue[COND_FOR_SAVED],
+ &keycache->cache_lock);
+ /* Be sure not to lose a block. They may be flushed in random order. */
+ goto restart;
+ }
+ if (last_for_update)
+ {
+ /*
+ There are no blocks to be flushed by this thread, but blocks for
+ update by other threads. Wait until one of the blocks is updated.
+ Re-check the condition for last_for_update. We may have unlocked
+ the cache_lock in flush_cached_blocks(). The state of the block
+ could have changed.
+ */
+ if (last_for_update->status & BLOCK_FOR_UPDATE)
+ wait_on_queue(&last_for_update->wqueue[COND_FOR_REQUESTED],
+ &keycache->cache_lock);
+ /* The block is now changed. Flush it. */
+ goto restart;
+ }
+
+ /*
+ Wait until the list of blocks in switch is empty. The threads that
+ are switching these blocks will relink them to clean file chains
+ while we wait and thus empty the 'first_in_switch' chain.
+ */
while (first_in_switch)
{
#if defined(KEYCACHE_DEBUG)
cnt= 0;
#endif
- block= first_in_switch;
- {
-#ifdef THREAD
- struct st_my_thread_var *thread= my_thread_var;
- add_to_queue(&block->wqueue[COND_FOR_SAVED], thread);
- do
- {
- KEYCACHE_DBUG_PRINT("flush_key_blocks_int: wait",
- ("suspend thread %ld", thread->id));
- keycache_pthread_cond_wait(&thread->suspend,
- &keycache->cache_lock);
- }
- while (thread->next);
-#else
- KEYCACHE_DBUG_ASSERT(0);
- /* No parallel requests in single-threaded case */
-#endif
- }
+ wait_on_queue(&first_in_switch->wqueue[COND_FOR_SAVED],
+ &keycache->cache_lock);
#if defined(KEYCACHE_DEBUG)
cnt++;
KEYCACHE_DBUG_ASSERT(cnt <= keycache->blocks_used);
#endif
+ /*
+ Do not restart here. We have flushed all blocks that were
+ changed when entering this function and were not marked for
+ eviction. Other threads have now flushed all remaining blocks in
+ the course of their eviction.
+ */
}
- /* The following happens very seldom */
+
if (! (type == FLUSH_KEEP || type == FLUSH_FORCE_WRITE))
{
-#if defined(KEYCACHE_DEBUG)
- cnt=0;
-#endif
- for (block= keycache->file_blocks[FILE_HASH(file)] ;
- block ;
- block= next)
+ BLOCK_LINK *last_for_update= NULL;
+ BLOCK_LINK *last_in_switch= NULL;
+ uint total_found= 0;
+ uint found;
+
+ /*
+ Finally free all clean blocks for this file.
+ During resize this may be run by two threads in parallel.
+ */
+ do
{
-#if defined(KEYCACHE_DEBUG)
- cnt++;
- KEYCACHE_DBUG_ASSERT(cnt <= keycache->blocks_used);
-#endif
- next= block->next_changed;
- if (block->hash_link->file == file &&
- (! (block->status & BLOCK_CHANGED)
- || type == FLUSH_IGNORE_CHANGED))
+ found= 0;
+ for (block= keycache->file_blocks[FILE_HASH(file)] ;
+ block ;
+ block= next)
{
- reg_requests(keycache, block, 1);
- free_block(keycache, block);
- }
+ /* Remember the next block. After freeing we cannot get at it. */
+ next= block->next_changed;
+
+ /* Changed blocks cannot appear in the file_blocks hash. */
+ DBUG_ASSERT(!(block->status & BLOCK_CHANGED));
+ if (block->hash_link->file == file)
+ {
+ /* We must skip blocks that will be changed. */
+ if (block->status & BLOCK_FOR_UPDATE)
+ {
+ last_for_update= block;
+ continue;
+ }
+
+ /*
+ We must not free blocks in eviction (BLOCK_IN_EVICTION |
+ BLOCK_IN_SWITCH) or blocks intended to be freed
+ (BLOCK_REASSIGNED).
+ */
+ if (!(block->status & (BLOCK_IN_EVICTION | BLOCK_IN_SWITCH |
+ BLOCK_REASSIGNED)))
+ {
+ struct st_hash_link *next_hash_link;
+ my_off_t next_diskpos;
+ File next_file;
+ uint next_status;
+ uint hash_requests;
+
+ total_found++;
+ found++;
+ KEYCACHE_DBUG_ASSERT(found <= keycache->blocks_used);
+
+ /*
+ Register a request. This unlinks the block from the LRU
+ ring and protects it against eviction. This is required
+ by free_block().
+ */
+ reg_requests(keycache, block, 1);
+
+ /*
+ free_block() may need to wait for readers of the block.
+ This is the moment where the other thread can move the
+ 'next' block from the chain. free_block() needs to wait
+ if there are requests for the block pending.
+ */
+ if (next && (hash_requests= block->hash_link->requests))
+ {
+ /* Copy values from the 'next' block and its hash_link. */
+ next_status= next->status;
+ next_hash_link= next->hash_link;
+ next_diskpos= next_hash_link->diskpos;
+ next_file= next_hash_link->file;
+ DBUG_ASSERT(next == next_hash_link->block);
+ }
+
+ free_block(keycache, block);
+ /*
+ If we had to wait and the state of the 'next' block
+ changed, break the inner loop. 'next' may no longer be
+ part of the current chain.
+
+ We do not want to break the loop after every free_block(),
+ not even only after waits. The chain might be quite long
+ and contain blocks for many files. Traversing it again and
+ again to find more blocks for this file could become quite
+ inefficient.
+ */
+ if (next && hash_requests &&
+ ((next_status != next->status) ||
+ (next_hash_link != next->hash_link) ||
+ (next_file != next_hash_link->file) ||
+ (next_diskpos != next_hash_link->diskpos) ||
+ (next != next_hash_link->block)))
+ break;
+ }
+ else
+ {
+ last_in_switch= block;
+ }
+ }
+ } /* end for block in file_blocks */
+ } while (found);
+
+ /*
+ If any clean block has been found, we may have waited for it to
+ become free. In this case it could be possible that another clean
+ block became dirty. This is possible if the write request existed
+ before the flush started (BLOCK_FOR_UPDATE). Re-check the hashes.
+ */
+ if (total_found)
+ goto restart;
+
+ /*
+ To avoid an infinite loop, wait until one of the blocks marked
+ for update is updated.
+ */
+ if (last_for_update)
+ {
+ /* We did not wait. Block must not have changed status. */
+ DBUG_ASSERT(last_for_update->status & BLOCK_FOR_UPDATE);
+ wait_on_queue(&last_for_update->wqueue[COND_FOR_REQUESTED],
+ &keycache->cache_lock);
+ goto restart;
+ }
+
+ /*
+ To avoid an infinite loop wait until one of the blocks marked
+ for eviction is switched.
+ */
+ if (last_in_switch)
+ {
+ /* We did not wait. Block must not have changed status. */
+ DBUG_ASSERT(last_in_switch->status & (BLOCK_IN_EVICTION |
+ BLOCK_IN_SWITCH |
+ BLOCK_REASSIGNED));
+ wait_on_queue(&last_in_switch->wqueue[COND_FOR_SAVED],
+ &keycache->cache_lock);
+ goto restart;
}
- }
- }
+
+ } /* if (! (type == FLUSH_KEEP || type == FLUSH_FORCE_WRITE)) */
+
+ } /* if (keycache->disk_blocks > 0 */
#ifndef DBUG_OFF
DBUG_EXECUTE("check_keycache",
test_key_cache(keycache, "end of flush_key_blocks", 0););
#endif
+err:
if (cache != cache_buff)
- my_free((gptr) cache, MYF(0));
+ my_free((uchar*) cache, MYF(0));
if (last_errno)
errno=last_errno; /* Return first error */
DBUG_RETURN(last_errno != 0);
@@ -2546,51 +3997,157 @@ restart:
int flush_key_blocks(KEY_CACHE *keycache,
File file, enum flush_type type)
{
- int res;
+ int res= 0;
DBUG_ENTER("flush_key_blocks");
DBUG_PRINT("enter", ("keycache: 0x%lx", (long) keycache));
- if (keycache->disk_blocks <= 0)
+ if (!keycache->key_cache_inited)
DBUG_RETURN(0);
+
keycache_pthread_mutex_lock(&keycache->cache_lock);
- inc_counter_for_resize_op(keycache);
- res= flush_key_blocks_int(keycache, file, type);
- dec_counter_for_resize_op(keycache);
+ /* While waiting for lock, keycache could have been ended. */
+ if (keycache->disk_blocks > 0)
+ {
+ inc_counter_for_resize_op(keycache);
+ res= flush_key_blocks_int(keycache, file, type);
+ dec_counter_for_resize_op(keycache);
+ }
keycache_pthread_mutex_unlock(&keycache->cache_lock);
DBUG_RETURN(res);
}
/*
- Flush all blocks in the key cache to disk
+ Flush all blocks in the key cache to disk.
+
+ SYNOPSIS
+ flush_all_key_blocks()
+ keycache pointer to key cache root structure
+
+ DESCRIPTION
+
+ Flushing of the whole key cache is done in two phases.
+
+ 1. Flush all changed blocks, waiting for them if necessary. Loop
+ until there is no changed block left in the cache.
+
+ 2. Free all clean blocks. Normally this means free all blocks. The
+ changed blocks were flushed in phase 1 and became clean. However we
+ may need to wait for blocks that are read by other threads. While we
+ wait, a clean block could become changed if that operation started
+ before the resize operation started. To be safe we must restart at
+ phase 1.
+
+ When we can run through the changed_blocks and file_blocks hashes
+ without finding a block any more, then we are done.
+
+ Note that we hold keycache->cache_lock all the time unless we need
+ to wait for something.
+
+ RETURN
+ 0 OK
+ != 0 Error
*/
static int flush_all_key_blocks(KEY_CACHE *keycache)
{
-#if defined(KEYCACHE_DEBUG)
- uint cnt=0;
-#endif
- while (keycache->blocks_changed > 0)
+ BLOCK_LINK *block;
+ uint total_found;
+ uint found;
+ uint idx;
+ DBUG_ENTER("flush_all_key_blocks");
+
+ do
{
- BLOCK_LINK *block;
- for (block= keycache->used_last->next_used ; ; block=block->next_used)
+ safe_mutex_assert_owner(&keycache->cache_lock);
+ total_found= 0;
+
+ /*
+ Phase1: Flush all changed blocks, waiting for them if necessary.
+ Loop until there is no changed block left in the cache.
+ */
+ do
{
- if (block->hash_link)
+ found= 0;
+ /* Step over the whole changed_blocks hash array. */
+ for (idx= 0; idx < CHANGED_BLOCKS_HASH; idx++)
{
-#if defined(KEYCACHE_DEBUG)
- cnt++;
- KEYCACHE_DBUG_ASSERT(cnt <= keycache->blocks_used);
-#endif
- if (flush_key_blocks_int(keycache, block->hash_link->file,
- FLUSH_RELEASE))
- return 1;
- break;
+ /*
+ If an array element is non-empty, use the first block from its
+ chain to find a file for flush. All changed blocks for this
+ file are flushed. So the same block will not appear at this
+ place again with the next iteration. New writes for blocks are
+ not accepted during the flush. If multiple files share the
+ same hash bucket, one of them will be flushed per iteration
+ of the outer loop of phase 1.
+ */
+ if ((block= keycache->changed_blocks[idx]))
+ {
+ found++;
+ /*
+ Flush dirty blocks but do not free them yet. They can be used
+ for reading until all other blocks are flushed too.
+ */
+ if (flush_key_blocks_int(keycache, block->hash_link->file,
+ FLUSH_FORCE_WRITE))
+ DBUG_RETURN(1);
+ }
}
- if (block == keycache->used_last)
- break;
- }
+
+ } while (found);
+
+ /*
+ Phase 2: Free all clean blocks. Normally this means free all
+ blocks. The changed blocks were flushed in phase 1 and became
+ clean. However we may need to wait for blocks that are read by
+ other threads. While we wait, a clean block could become changed
+ if that operation started before the resize operation started. To
+ be safe we must restart at phase 1.
+ */
+ do
+ {
+ found= 0;
+ /* Step over the whole file_blocks hash array. */
+ for (idx= 0; idx < CHANGED_BLOCKS_HASH; idx++)
+ {
+ /*
+ If an array element is non-empty, use the first block from its
+ chain to find a file for flush. All blocks for this file are
+ freed. So the same block will not appear at this place again
+ with the next iteration. If multiple files share the
+ same hash bucket, one of them will be flushed per iteration
+ of the outer loop of phase 2.
+ */
+ if ((block= keycache->file_blocks[idx]))
+ {
+ total_found++;
+ found++;
+ if (flush_key_blocks_int(keycache, block->hash_link->file,
+ FLUSH_RELEASE))
+ DBUG_RETURN(1);
+ }
+ }
+
+ } while (found);
+
+ /*
+ If any clean block has been found, we may have waited for it to
+ become free. In this case it could be possible that another clean
+ block became dirty. This is possible if the write request existed
+ before the resize started (BLOCK_FOR_UPDATE). Re-check the hashes.
+ */
+ } while (total_found);
+
+#ifndef DBUG_OFF
+ /* Now there should not exist any block any more. */
+ for (idx= 0; idx < CHANGED_BLOCKS_HASH; idx++)
+ {
+ DBUG_ASSERT(!keycache->changed_blocks[idx]);
+ DBUG_ASSERT(!keycache->file_blocks[idx]);
}
- return 0;
+#endif
+
+ DBUG_RETURN(0);
}
@@ -2859,3 +4416,70 @@ void keycache_debug_log_close(void)
#endif /* defined(KEYCACHE_DEBUG_LOG) */
#endif /* defined(KEYCACHE_DEBUG) */
+
+#if !defined(DBUG_OFF)
+#define F_B_PRT(_f_, _v_) DBUG_PRINT("assert_fail", (_f_, _v_))
+
+static int fail_block(BLOCK_LINK *block)
+{
+ F_B_PRT("block->next_used: %lx\n", (ulong) block->next_used);
+ F_B_PRT("block->prev_used: %lx\n", (ulong) block->prev_used);
+ F_B_PRT("block->next_changed: %lx\n", (ulong) block->next_changed);
+ F_B_PRT("block->prev_changed: %lx\n", (ulong) block->prev_changed);
+ F_B_PRT("block->hash_link: %lx\n", (ulong) block->hash_link);
+ F_B_PRT("block->status: %u\n", block->status);
+ F_B_PRT("block->length: %u\n", block->length);
+ F_B_PRT("block->offset: %u\n", block->offset);
+ F_B_PRT("block->requests: %u\n", block->requests);
+ F_B_PRT("block->temperature: %u\n", block->temperature);
+ return 0; /* Let the assert fail. */
+}
+
+static int fail_hlink(HASH_LINK *hlink)
+{
+ F_B_PRT("hlink->next: %lx\n", (ulong) hlink->next);
+ F_B_PRT("hlink->prev: %lx\n", (ulong) hlink->prev);
+ F_B_PRT("hlink->block: %lx\n", (ulong) hlink->block);
+ F_B_PRT("hlink->diskpos: %lu\n", (ulong) hlink->diskpos);
+ F_B_PRT("hlink->file: %d\n", hlink->file);
+ return 0; /* Let the assert fail. */
+}
+
+static int cache_empty(KEY_CACHE *keycache)
+{
+ int errcnt= 0;
+ int idx;
+ if (keycache->disk_blocks <= 0)
+ return 1;
+ for (idx= 0; idx < keycache->disk_blocks; idx++)
+ {
+ BLOCK_LINK *block= keycache->block_root + idx;
+ if (block->status || block->requests || block->hash_link)
+ {
+ fprintf(stderr, "block index: %u\n", idx);
+ fail_block(block);
+ errcnt++;
+ }
+ }
+ for (idx= 0; idx < keycache->hash_links; idx++)
+ {
+ HASH_LINK *hash_link= keycache->hash_link_root + idx;
+ if (hash_link->requests || hash_link->block)
+ {
+ fprintf(stderr, "hash_link index: %u\n", idx);
+ fail_hlink(hash_link);
+ errcnt++;
+ }
+ }
+ if (errcnt)
+ {
+ fprintf(stderr, "blocks: %d used: %lu\n",
+ keycache->disk_blocks, keycache->blocks_used);
+ fprintf(stderr, "hash_links: %d used: %d\n",
+ keycache->hash_links, keycache->hash_links_used);
+ fprintf(stderr, "\n");
+ }
+ return !errcnt;
+}
+#endif
+
diff --git a/mysys/mf_keycaches.c b/mysys/mf_keycaches.c
index 51ad54159e5..6227a05ce06 100644
--- a/mysys/mf_keycaches.c
+++ b/mysys/mf_keycaches.c
@@ -44,9 +44,9 @@
typedef struct st_safe_hash_entry
{
- byte *key;
+ uchar *key;
uint length;
- byte *data;
+ uchar *data;
struct st_safe_hash_entry *next, **prev;
} SAFE_HASH_ENTRY;
@@ -57,7 +57,7 @@ typedef struct st_safe_hash_with_default
rw_lock_t mutex;
#endif
HASH hash;
- byte *default_value;
+ uchar *default_value;
SAFE_HASH_ENTRY *root;
} SAFE_HASH;
@@ -71,18 +71,18 @@ typedef struct st_safe_hash_with_default
static void safe_hash_entry_free(SAFE_HASH_ENTRY *entry)
{
DBUG_ENTER("free_assign_entry");
- my_free((gptr) entry, MYF(0));
+ my_free((uchar*) entry, MYF(0));
DBUG_VOID_RETURN;
}
/* Get key and length for a SAFE_HASH_ENTRY */
-static byte *safe_hash_entry_get(SAFE_HASH_ENTRY *entry, uint *length,
- my_bool not_used __attribute__((unused)))
+static uchar *safe_hash_entry_get(SAFE_HASH_ENTRY *entry, size_t *length,
+ my_bool not_used __attribute__((unused)))
{
*length=entry->length;
- return (byte*) entry->key;
+ return (uchar*) entry->key;
}
@@ -105,7 +105,7 @@ static byte *safe_hash_entry_get(SAFE_HASH_ENTRY *entry, uint *length,
*/
static my_bool safe_hash_init(SAFE_HASH *hash, uint elements,
- byte *default_value)
+ uchar *default_value)
{
DBUG_ENTER("safe_hash");
if (hash_init(&hash->hash, &my_charset_bin, elements,
@@ -147,9 +147,9 @@ static void safe_hash_free(SAFE_HASH *hash)
Return the value stored for a key or default value if no key
*/
-static byte *safe_hash_search(SAFE_HASH *hash, const byte *key, uint length)
+static uchar *safe_hash_search(SAFE_HASH *hash, const uchar *key, uint length)
{
- byte *result;
+ uchar *result;
DBUG_ENTER("safe_hash_search");
rw_rdlock(&hash->mutex);
result= hash_search(&hash->hash, key, length);
@@ -183,8 +183,8 @@ static byte *safe_hash_search(SAFE_HASH *hash, const byte *key, uint length)
1 error (Can only be EOM). In this case my_message() is called.
*/
-static my_bool safe_hash_set(SAFE_HASH *hash, const byte *key, uint length,
- byte *data)
+static my_bool safe_hash_set(SAFE_HASH *hash, const uchar *key, uint length,
+ uchar *data)
{
SAFE_HASH_ENTRY *entry;
my_bool error= 0;
@@ -206,7 +206,7 @@ static my_bool safe_hash_set(SAFE_HASH *hash, const byte *key, uint length,
/* unlink entry from list */
if ((*entry->prev= entry->next))
entry->next->prev= entry->prev;
- hash_delete(&hash->hash, (byte*) entry);
+ hash_delete(&hash->hash, (uchar*) entry);
goto end;
}
if (entry)
@@ -222,7 +222,7 @@ static my_bool safe_hash_set(SAFE_HASH *hash, const byte *key, uint length,
error= 1;
goto end;
}
- entry->key= (byte*) (entry +1);
+ entry->key= (uchar*) (entry +1);
memcpy((char*) entry->key, (char*) key, length);
entry->length= length;
entry->data= data;
@@ -231,7 +231,7 @@ static my_bool safe_hash_set(SAFE_HASH *hash, const byte *key, uint length,
entry->next->prev= &entry->next;
entry->prev= &hash->root;
hash->root= entry;
- if (my_hash_insert(&hash->hash, (byte*) entry))
+ if (my_hash_insert(&hash->hash, (uchar*) entry))
{
/* This can only happen if hash got out of memory */
my_free((char*) entry, MYF(0));
@@ -261,7 +261,7 @@ end:
default value.
*/
-static void safe_hash_change(SAFE_HASH *hash, byte *old_data, byte *new_data)
+static void safe_hash_change(SAFE_HASH *hash, uchar *old_data, uchar *new_data)
{
SAFE_HASH_ENTRY *entry, *next;
DBUG_ENTER("safe_hash_set");
@@ -277,7 +277,7 @@ static void safe_hash_change(SAFE_HASH *hash, byte *old_data, byte *new_data)
{
if ((*entry->prev= entry->next))
entry->next->prev= entry->prev;
- hash_delete(&hash->hash, (byte*) entry);
+ hash_delete(&hash->hash, (uchar*) entry);
}
else
entry->data= new_data;
@@ -299,7 +299,7 @@ static SAFE_HASH key_cache_hash;
my_bool multi_keycache_init(void)
{
- return safe_hash_init(&key_cache_hash, 16, (byte*) dflt_key_cache);
+ return safe_hash_init(&key_cache_hash, 16, (uchar*) dflt_key_cache);
}
@@ -325,7 +325,7 @@ void multi_keycache_free(void)
key cache to use
*/
-KEY_CACHE *multi_key_cache_search(byte *key, uint length)
+KEY_CACHE *multi_key_cache_search(uchar *key, uint length)
{
if (!key_cache_hash.hash.records)
return dflt_key_cache;
@@ -349,15 +349,15 @@ KEY_CACHE *multi_key_cache_search(byte *key, uint length)
*/
-my_bool multi_key_cache_set(const byte *key, uint length,
+my_bool multi_key_cache_set(const uchar *key, uint length,
KEY_CACHE *key_cache)
{
- return safe_hash_set(&key_cache_hash, key, length, (byte*) key_cache);
+ return safe_hash_set(&key_cache_hash, key, length, (uchar*) key_cache);
}
void multi_key_cache_change(KEY_CACHE *old_data,
KEY_CACHE *new_data)
{
- safe_hash_change(&key_cache_hash, (byte*) old_data, (byte*) new_data);
+ safe_hash_change(&key_cache_hash, (uchar*) old_data, (uchar*) new_data);
}
diff --git a/mysys/mf_loadpath.c b/mysys/mf_loadpath.c
index ffa83cb20ec..48a69207839 100644
--- a/mysys/mf_loadpath.c
+++ b/mysys/mf_loadpath.c
@@ -23,7 +23,7 @@
/* if there is no path, prepend with own_path_prefix if given */
/* else unpack path according to current dir */
-my_string my_load_path(my_string to, const char *path,
+char * my_load_path(char * to, const char *path,
const char *own_path_prefix)
{
char buff[FN_REFLEN];
@@ -36,7 +36,7 @@ my_string my_load_path(my_string to, const char *path,
test_if_hard_path(path))
VOID(strmov(buff,path));
else if ((is_cur=(path[0] == FN_CURLIB && path[1] == FN_LIBCHAR)) ||
- (is_prefix((gptr) path,FN_PARENTDIR)) ||
+ (is_prefix(path,FN_PARENTDIR)) ||
! own_path_prefix)
{
if (is_cur)
diff --git a/mysys/mf_pack.c b/mysys/mf_pack.c
index 1b83c6fda10..a31b9595c85 100644
--- a/mysys/mf_pack.c
+++ b/mysys/mf_pack.c
@@ -24,17 +24,17 @@
#include <descrip.h>
#endif /* VMS */
-static my_string NEAR_F expand_tilde(my_string *path);
+static char * NEAR_F expand_tilde(char * *path);
/* Pack a dirname ; Changes HOME to ~/ and current dev to ./ */
/* from is a dirname (from dirname() ?) ending with FN_LIBCHAR */
/* to may be == from */
-void pack_dirname(my_string to, const char *from)
+void pack_dirname(char * to, const char *from)
{
int cwd_err;
- uint d_length,length,buff_length;
- my_string start;
+ size_t d_length,length,buff_length;
+ char * start;
char buff[FN_REFLEN];
DBUG_ENTER("pack_dirname");
@@ -50,13 +50,13 @@ void pack_dirname(my_string to, const char *from)
if (!(cwd_err= my_getwd(buff,FN_REFLEN,MYF(0))))
{
- buff_length= (uint) strlen(buff);
- d_length=(uint) (start-to);
+ buff_length= strlen(buff);
+ d_length= (size_t) (start-to);
if ((start == to ||
(buff_length == d_length && !bcmp(buff,start,d_length))) &&
*start != FN_LIBCHAR && *start)
{ /* Put current dir before */
- bchange(to,d_length,buff,buff_length,(uint) strlen(to)+1);
+ bchange((uchar*) to, d_length, (uchar*) buff, buff_length, strlen(to)+1);
}
}
@@ -65,7 +65,7 @@ void pack_dirname(my_string to, const char *from)
length=0;
if (home_dir)
{
- length= (uint) strlen(home_dir);
+ length= strlen(home_dir);
if (home_dir[length-1] == FN_LIBCHAR)
length--; /* Don't test last '/' */
}
@@ -89,7 +89,7 @@ void pack_dirname(my_string to, const char *from)
}
if (is_prefix(to,buff))
{
- length= (uint) strlen(buff);
+ length= strlen(buff);
if (to[length])
(void) strmov_overlapp(to,to+length); /* Remove everything before */
else
@@ -126,12 +126,12 @@ void pack_dirname(my_string to, const char *from)
# length of new name
*/
-uint cleanup_dirname(register my_string to, const char *from)
+size_t cleanup_dirname(register char *to, const char *from)
{
- reg5 uint length;
- reg2 my_string pos;
- reg3 my_string from_ptr;
- reg4 my_string start;
+ reg5 size_t length;
+ reg2 char * pos;
+ reg3 char * from_ptr;
+ reg4 char * start;
char parent[5], /* for "FN_PARENTDIR" */
buff[FN_REFLEN+1],*end_parentdir;
#ifdef BACKSLASH_MBTAIL
@@ -141,17 +141,17 @@ uint cleanup_dirname(register my_string to, const char *from)
DBUG_PRINT("enter",("from: '%s'",from));
start=buff;
- from_ptr=(my_string) from;
+ from_ptr=(char *) from;
#ifdef FN_DEVCHAR
if ((pos=strrchr(from_ptr,FN_DEVCHAR)) != 0)
{ /* Skip device part */
- length=(uint) (pos-from_ptr)+1;
+ length=(size_t) (pos-from_ptr)+1;
start=strnmov(buff,from_ptr,length); from_ptr+=length;
}
#endif
parent[0]=FN_LIBCHAR;
- length=(uint) (strmov(parent+1,FN_PARENTDIR)-parent);
+ length=(size_t) (strmov(parent+1,FN_PARENTDIR)-parent);
for (pos=start ; (*pos= *from_ptr++) != 0 ; pos++)
{
#ifdef BACKSLASH_MBTAIL
@@ -167,7 +167,7 @@ uint cleanup_dirname(register my_string to, const char *from)
*pos = FN_LIBCHAR;
if (*pos == FN_LIBCHAR)
{
- if ((uint) (pos-start) > length && bcmp(pos-length,parent,length) == 0)
+ if ((size_t) (pos-start) > length && bcmp(pos-length,parent,length) == 0)
{ /* If .../../; skip prev */
pos-=length;
if (pos != start)
@@ -206,7 +206,7 @@ uint cleanup_dirname(register my_string to, const char *from)
}
}
}
- else if ((uint) (pos-start) == length-1 &&
+ else if ((size_t) (pos-start) == length-1 &&
!bcmp(start,parent+1,length-1))
start=pos; /* Starts with "../" */
else if (pos-start > 0 && pos[-1] == FN_LIBCHAR)
@@ -228,7 +228,7 @@ uint cleanup_dirname(register my_string to, const char *from)
}
(void) strmov(to,buff);
DBUG_PRINT("exit",("to: '%s'",to));
- DBUG_RETURN((uint) (pos-buff));
+ DBUG_RETURN((size_t) (pos-buff));
} /* cleanup_dirname */
@@ -251,7 +251,7 @@ void symdirget(char *dir)
if (dir[0] && pos[-1] != FN_DEVCHAR && my_access(dir, F_OK))
{
File file;
- uint length;
+ size_t length;
char temp= *(--pos); /* May be "/" or "\" */
strmov(pos,".sym");
file= my_open(dir, O_RDONLY, MYF(0));
@@ -268,7 +268,7 @@ void symdirget(char *dir)
if (pos == buff || pos[-1] != FN_LIBCHAR)
*pos++=FN_LIBCHAR;
- strmake(dir,buff, (uint) (pos-buff));
+ strmake(dir,buff, (size_t) (pos-buff));
}
my_close(file, MYF(0));
}
@@ -296,14 +296,14 @@ void symdirget(char *dir)
Length of new directory name (= length of to)
*/
-uint unpack_dirname(my_string to, const char *from)
+size_t unpack_dirname(char * to, const char *from)
{
- uint length,h_length;
+ size_t length, h_length;
char buff[FN_REFLEN+1+4],*suffix,*tilde_expansion;
DBUG_ENTER("unpack_dirname");
- (void) intern_filename(buff,from); /* Change to intern name */
- length= (uint) strlen(buff); /* Fix that '/' is last */
+ (void) intern_filename(buff,from); /* Change to intern name */
+ length= strlen(buff); /* Fix that '/' is last */
if (length &&
#ifdef FN_DEVCHAR
buff[length-1] != FN_DEVCHAR &&
@@ -320,15 +320,15 @@ uint unpack_dirname(my_string to, const char *from)
suffix=buff+1; tilde_expansion=expand_tilde(&suffix);
if (tilde_expansion)
{
- length-=(uint) (suffix-buff)-1;
- if (length+(h_length= (uint) strlen(tilde_expansion)) <= FN_REFLEN)
+ length-= (size_t) (suffix-buff)-1;
+ if (length+(h_length= strlen(tilde_expansion)) <= FN_REFLEN)
{
if (tilde_expansion[h_length-1] == FN_LIBCHAR)
h_length--;
if (buff+h_length < suffix)
bmove(buff+h_length,suffix,length);
else
- bmove_upp(buff+h_length+length,suffix+length,length);
+ bmove_upp((uchar*) buff+h_length+length, (uchar*) suffix+length, length);
bmove(buff,tilde_expansion,h_length);
}
}
@@ -344,7 +344,7 @@ uint unpack_dirname(my_string to, const char *from)
/* Expand tilde to home or user-directory */
/* Path is reset to point at FN_LIBCHAR after ~xxx */
-static my_string NEAR_F expand_tilde(my_string *path)
+static char * NEAR_F expand_tilde(char * *path)
{
if (path[0][0] == FN_LIBCHAR)
return home_dir; /* ~/ expanded to home */
@@ -366,7 +366,7 @@ static my_string NEAR_F expand_tilde(my_string *path)
}
}
#endif
- return (my_string) 0;
+ return (char *) 0;
}
@@ -387,13 +387,13 @@ static my_string NEAR_F expand_tilde(my_string *path)
*/
-uint unpack_filename(my_string to, const char *from)
+size_t unpack_filename(char * to, const char *from)
{
- uint length,n_length;
+ size_t length, n_length, buff_length;
char buff[FN_REFLEN];
DBUG_ENTER("unpack_filename");
- length=dirname_part(buff,from); /* copy & convert dirname */
+ length=dirname_part(buff, from, &buff_length);/* copy & convert dirname */
n_length=unpack_dirname(buff,buff);
if (n_length+strlen(from+length) < FN_REFLEN)
{
@@ -410,10 +410,10 @@ uint unpack_filename(my_string to, const char *from)
/* Used before system command's like open(), create() .. */
/* Returns length of to */
-uint system_filename(my_string to, const char *from)
+size_t system_filename(char * to, const char *from)
{
#ifndef FN_C_BEFORE_DIR
- return (uint) (strmake(to,from,FN_REFLEN-1)-to);
+ return (size_t) (strmake(to,from,FN_REFLEN-1)-to);
#else /* VMS */
/* change 'dev:lib/xxx' to 'dev:[lib]xxx' */
@@ -423,8 +423,9 @@ uint system_filename(my_string to, const char *from)
/* change '/x/y/z to '[x.y]x' */
/* change 'dev:/x' to 'dev:[000000]x' */
- int libchar_found,length;
- my_string to_pos,from_pos,pos;
+ int libchar_found;
+ size_t length;
+ char * to_pos,from_pos,pos;
char buff[FN_REFLEN];
DBUG_ENTER("system_filename");
@@ -434,7 +435,7 @@ uint system_filename(my_string to, const char *from)
if ((pos=strrchr(from_pos,FN_DEVCHAR))) /* Skip device part */
{
pos++;
- to_pos=strnmov(to,from_pos,(size_s) (pos-from_pos));
+ to_pos=strnmov(to,from_pos,(size_t) (pos-from_pos));
from_pos=pos;
}
else
@@ -465,115 +466,30 @@ uint system_filename(my_string to, const char *from)
from_pos+strlen(FN_PARENTDIR) == pos)
to_pos=strmov(to_pos,FN_C_PARENT_DIR); /* Found '../' */
else
- to_pos=strnmov(to_pos,from_pos,(size_s) (pos-from_pos));
+ to_pos=strnmov(to_pos,from_pos,(size_t) (pos-from_pos));
from_pos=pos+1;
}
*(to_pos++)=FN_C_AFTER_DIR;
}
- length=(int) (strmov(to_pos,from_pos)-to);
+ length= (size_t) (strmov(to_pos,from_pos)-to);
DBUG_PRINT("exit",("name: '%s'",to));
- DBUG_RETURN((uint) length);
+ DBUG_RETURN(length);
#endif
} /* system_filename */
/* Fix a filename to intern (UNIX format) */
-my_string intern_filename(my_string to, const char *from)
+char *intern_filename(char *to, const char *from)
{
-#ifndef VMS
- {
- uint length;
- char buff[FN_REFLEN];
- if (from == to)
- { /* Dirname may destroy from */
- strmov(buff,from);
- from=buff;
- }
- length=dirname_part(to,from); /* Copy dirname & fix chars */
- (void) strcat(to,from+length);
- return (to);
- }
-#else /* VMS */
-
- /* change 'dev:[lib]xxx' to 'dev:lib/xxx' */
- /* change 'dev:xxx' to 'dev:xxx' */
- /* change 'dev:x/y/[.lib]' to 'dev:x/y/lib/ */
- /* change '[.lib]' to './lib/' */
- /* change '[x.y]' or '[x.][y]' or '[x][.y]' to '/x/y/' */
- /* change '[000000.x] or [x.000000]' to '/x/' */
-
- int par_length,root_length;
- my_string pos,from_pos,to_pos,end_pos;
+ size_t length, to_length;
char buff[FN_REFLEN];
-
- convert_dirname(buff,from,NullS); /* change '<>' to '[]' */
- from_pos=buff;
- if ((pos=strrchr(from_pos,FN_DEVCHAR))) /* Skip device part */
- {
- pos++;
- to_pos=strnmov(to,from_pos,(size_s) (pos-from_pos));
- from_pos=pos;
- }
- else
- to_pos=to;
-
- root_length=strlen(FN_C_ROOT_DIR);
- if ((pos = strchr(from_pos,FN_C_BEFORE_DIR)) &&
- (end_pos = strrchr(pos+1,FN_C_AFTER_DIR)))
- {
- to_pos=strnmov(to_pos,from_pos,(size_s) (pos-from_pos));
- /* Copy all between ':' and '[' */
- from_pos=pos+1;
- if (strinstr(from_pos,FN_C_ROOT_DIR) == 1 &&
- (from_pos[root_length] == FN_C_DIR_SEP ||
- from_pos[root_length] == FN_C_AFTER_DIR))
- {
- from_pos+=root_length+1;
- }
- else if (*from_pos == FN_C_DIR_SEP)
- *(to_pos++) = FN_CURLIB; /* Set ./ first */
- *(to_pos++) = FN_LIBCHAR;
-
- par_length=strlen(FN_C_PARENT_DIR);
- pos=to_pos;
- for (; from_pos <= end_pos ; from_pos++)
- {
- switch (*from_pos) {
- case FN_C_DIR_SEP:
- case FN_C_AFTER_DIR:
- if (pos != to_pos)
- {
- if ((int) (to_pos-pos) == root_length &&
- is_suffix(pos,FN_C_ROOT_DIR))
- to_pos=pos; /* remove root-pos */
- else
- {
- *(to_pos++)=FN_LIBCHAR; /* Find lib */
- pos=to_pos;
- }
- }
- break;
- case FN_C_BEFORE_DIR:
- break;
- case '-': /* *(FN_C_PARENT_DIR): */
- if (to_pos[-1] == FN_LIBCHAR &&
- strncmp(from_pos,FN_C_PARENT_DIR,par_length) == 0)
- { /* Change '-' to '..' */
- to_pos=strmov(to_pos,FN_PARENTDIR);
- *(to_pos++)=FN_LIBCHAR;
- pos=to_pos;
- from_pos+=par_length-1;
- break;
- }
- /* Fall through */
- default:
- *(to_pos++)= *from_pos;
- break;
- }
- }
+ if (from == to)
+ { /* Dirname may destroy from */
+ strmov(buff,from);
+ from=buff;
}
- (void) strmov(to_pos,from_pos);
+ length= dirname_part(to, from, &to_length); /* Copy dirname & fix chars */
+ (void) strmov(to + to_length,from+length);
return (to);
-#endif /* VMS */
} /* intern_filename */
diff --git a/mysys/mf_path.c b/mysys/mf_path.c
index 00e6b2046b9..73e73cb7f76 100644
--- a/mysys/mf_path.c
+++ b/mysys/mf_path.c
@@ -29,22 +29,24 @@ static char *find_file_in_path(char *to,const char *name);
own_path_name_part is concatinated to result.
my_path puts result in to and returns to */
-my_string my_path(my_string to, const char *progname,
- const char *own_pathname_part)
+char * my_path(char * to, const char *progname,
+ const char *own_pathname_part)
{
- my_string start,end,prog;
+ char *start, *end, *prog;
+ size_t to_length;
DBUG_ENTER("my_path");
start=to; /* Return this */
- if (progname && (dirname_part(to, progname) ||
+ if (progname && (dirname_part(to, progname, &to_length) ||
find_file_in_path(to,progname) ||
- ((prog=getenv("_")) != 0 && dirname_part(to,prog))))
+ ((prog=getenv("_")) != 0 &&
+ dirname_part(to, prog, &to_length))))
{
VOID(intern_filename(to,to));
if (!test_if_hard_path(to))
{
if (!my_getwd(curr_dir,FN_REFLEN,MYF(0)))
- bchange(to,0,curr_dir, (uint) strlen(curr_dir), (uint) strlen(to)+1);
+ bchange((uchar*) to, 0, (uchar*) curr_dir, strlen(curr_dir), strlen(to)+1);
}
}
else
diff --git a/mysys/mf_radix.c b/mysys/mf_radix.c
index 6b750181558..582ca76b8f8 100644
--- a/mysys/mf_radix.c
+++ b/mysys/mf_radix.c
@@ -25,7 +25,7 @@
/* Radixsort */
-void radixsort_for_str_ptr(uchar **base, uint number_of_elements, size_s size_of_element, uchar **buffer)
+void radixsort_for_str_ptr(uchar **base, uint number_of_elements, size_t size_of_element, uchar **buffer)
{
uchar **end,**ptr,**buffer_ptr;
uint32 *count_ptr,*count_end,count[256];
@@ -34,7 +34,7 @@ void radixsort_for_str_ptr(uchar **base, uint number_of_elements, size_s size_of
end=base+number_of_elements; count_end=count+256;
for (pass=(int) size_of_element-1 ; pass >= 0 ; pass--)
{
- bzero((gptr) count,sizeof(uint32)*256);
+ bzero((uchar*) count,sizeof(uint32)*256);
for (ptr= base ; ptr < end ; ptr++)
count[ptr[0][pass]]++;
if (count[0] == number_of_elements)
diff --git a/mysys/mf_same.c b/mysys/mf_same.c
index e7cdb012c9f..6738dc8051e 100644
--- a/mysys/mf_same.c
+++ b/mysys/mf_same.c
@@ -25,14 +25,15 @@
Returns 'to'.
*/
-my_string fn_same(char *to, const char *name, int flag)
+char * fn_same(char *to, const char *name, int flag)
{
char dev[FN_REFLEN];
const char *ext;
+ size_t dev_length;
DBUG_ENTER("fn_same");
DBUG_PRINT("enter",("to: %s name: %s flag: %d",to,name,flag));
- if ((ext=strrchr(name+dirname_part(dev,name),FN_EXTCHAR)) == 0)
+ if ((ext=strrchr(name+dirname_part(dev, name, &dev_length),FN_EXTCHAR)) == 0)
ext="";
DBUG_RETURN(fn_format(to,to,dev,ext,flag));
diff --git a/mysys/mf_sort.c b/mysys/mf_sort.c
index e7fd6873eee..741c8f42327 100644
--- a/mysys/mf_sort.c
+++ b/mysys/mf_sort.c
@@ -18,7 +18,7 @@
#include "mysys_priv.h"
#include <m_string.h>
-void my_string_ptr_sort(void *base, uint items, size_s size)
+void my_string_ptr_sort(uchar *base, uint items, size_t size)
{
#if INT_MAX > 65536L
uchar **ptr=0;
@@ -27,15 +27,15 @@ void my_string_ptr_sort(void *base, uint items, size_s size)
(ptr= (uchar**) my_malloc(items*sizeof(char*),MYF(0))))
{
radixsort_for_str_ptr((uchar**) base,items,size,ptr);
- my_free((gptr) ptr,MYF(0));
+ my_free((uchar*) ptr,MYF(0));
}
else
#endif
{
if (size && items)
{
- uint size_arg=size;
- qsort2(base,items,sizeof(byte*),get_ptr_compare(size),(void*) &size_arg);
+ qsort2(base,items, sizeof(uchar*), get_ptr_compare(size),
+ (void*) &size);
}
}
}
diff --git a/mysys/mf_soundex.c b/mysys/mf_soundex.c
index fa393d1a94a..fe30d8c81af 100644
--- a/mysys/mf_soundex.c
+++ b/mysys/mf_soundex.c
@@ -42,11 +42,11 @@ static char get_scode(CHARSET_INFO * cs, char **ptr,pbool remove_garbage);
/* outputed string is 4 byte long */
/* out_pntr can be == in_pntr */
-void soundex(CHARSET_INFO * cs,register my_string out_pntr, my_string in_pntr,
+void soundex(CHARSET_INFO * cs,register char * out_pntr, char * in_pntr,
pbool remove_garbage)
{
char ch,last_ch;
- reg3 my_string end;
+ reg3 char * end;
register uchar *map=cs->to_upper;
if (remove_garbage)
diff --git a/mysys/mf_strip.c b/mysys/mf_strip.c
index 712b0e1d28a..b33620b1b2d 100644
--- a/mysys/mf_strip.c
+++ b/mysys/mf_strip.c
@@ -18,14 +18,14 @@
#include "mysys_priv.h"
/*
- strip_sp(my_string str)
+ strip_sp(char * str)
Strips end-space from string and returns new length.
*/
-size_s strip_sp(register my_string str)
+size_t strip_sp(register char * str)
{
- reg2 my_string found;
- reg3 my_string start;
+ reg2 char * found;
+ reg3 char * start;
start=found=str;
@@ -35,11 +35,11 @@ size_s strip_sp(register my_string str)
{
while (*++str && *str != ' ') {};
if (!*str)
- return (size_s) (str-start); /* Return stringlength */
+ return (size_t) (str-start); /* Return stringlength */
}
found=str;
while (*++str == ' ') {};
}
*found= '\0'; /* Stripp at first space */
- return (size_s) (found-start);
+ return (size_t) (found-start);
} /* strip_sp */
diff --git a/mysys/mf_tempdir.c b/mysys/mf_tempdir.c
index 36eecbeac09..b2c18c74347 100644
--- a/mysys/mf_tempdir.c
+++ b/mysys/mf_tempdir.c
@@ -52,7 +52,7 @@ my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist)
strmake(buff, pathlist, (uint) (end-pathlist));
length= cleanup_dirname(buff, buff);
if (!(copy= my_strndup(buff, length, MYF(MY_WME))) ||
- insert_dynamic(&tmpdir->full_list, (gptr) &copy))
+ insert_dynamic(&tmpdir->full_list, (uchar*) &copy))
DBUG_RETURN(TRUE);
pathlist=end+1;
}
diff --git a/mysys/mf_tempfile.c b/mysys/mf_tempfile.c
index c1108f85054..9460f27b104 100644
--- a/mysys/mf_tempfile.c
+++ b/mysys/mf_tempfile.c
@@ -59,12 +59,26 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
myf MyFlags __attribute__((unused)))
{
File file= -1;
+#ifdef __WIN__
+ TCHAR path_buf[MAX_PATH-14];
+#endif
DBUG_ENTER("create_temp_file");
DBUG_PRINT("enter", ("dir: %s, prefix: %s", dir, prefix));
#if defined (__WIN__)
/*
+ Use GetTempPath to determine path for temporary files.
+ This is because the documentation for GetTempFileName
+ has the following to say about this parameter:
+ "If this parameter is NULL, the function fails."
+ */
+ if (!dir)
+ {
+ if(GetTempPath(sizeof(path_buf), path_buf) > 0)
+ dir = path_buf;
+ }
+ /*
Use GetTempFileName to generate a unique filename, create
the file and release it's handle
- uses up to the first three letters from prefix
diff --git a/mysys/mf_unixpath.c b/mysys/mf_unixpath.c
index 11292e231ba..75f8de14879 100644
--- a/mysys/mf_unixpath.c
+++ b/mysys/mf_unixpath.c
@@ -19,7 +19,7 @@
/* convert filename to unix style filename */
/* If MSDOS converts '\' to '/' */
-void to_unix_path(my_string to __attribute__((unused)))
+void to_unix_path(char * to __attribute__((unused)))
{
#if FN_LIBCHAR != '/'
{
diff --git a/mysys/mf_wfile.c b/mysys/mf_wfile.c
index b574d158b9e..f98d348994e 100644
--- a/mysys/mf_wfile.c
+++ b/mysys/mf_wfile.c
@@ -29,12 +29,12 @@
/* Store wildcard-string in a easyer format */
-WF_PACK *wf_comp(my_string str)
+WF_PACK *wf_comp(char * str)
{
uint ant;
int not_pos;
- register my_string pos;
- my_string buffer;
+ register char * pos;
+ char * buffer;
WF_PACK *ret;
DBUG_ENTER("wf_comp");
@@ -53,13 +53,13 @@ WF_PACK *wf_comp(my_string str)
for (pos=str ; *pos ; pos++)
ant+= test(*pos == ' ' || *pos == ',');
- if ((ret= (WF_PACK*) my_malloc((uint) ant*(sizeof(my_string*)+2)+
+ if ((ret= (WF_PACK*) my_malloc((uint) ant*(sizeof(char **)+2)+
sizeof(WF_PACK)+ (uint) strlen(str)+1,
MYF(MY_WME)))
== 0)
DBUG_RETURN((WF_PACK *) NULL);
- ret->wild= (my_string*) (ret+1);
- buffer= (my_string) (ret->wild+ant);
+ ret->wild= (char **) (ret+1);
+ buffer= (char *) (ret->wild+ant);
ant=0;
for (pos=str ; *pos ; str= pos)
@@ -119,6 +119,6 @@ void wf_end(WF_PACK *buffer)
{
DBUG_ENTER("wf_end");
if (buffer)
- my_free((gptr) buffer,MYF(0));
+ my_free((uchar*) buffer,MYF(0));
DBUG_VOID_RETURN;
} /* wf_end */
diff --git a/mysys/mulalloc.c b/mysys/mulalloc.c
index bada0a55a6a..f4ca3d9f9ab 100644
--- a/mysys/mulalloc.c
+++ b/mysys/mulalloc.c
@@ -31,11 +31,11 @@
NULL
*/
-gptr my_multi_malloc(myf myFlags, ...)
+void* my_multi_malloc(myf myFlags, ...)
{
va_list args;
char **ptr,*start,*res;
- uint tot_length,length;
+ size_t tot_length,length;
DBUG_ENTER("my_multi_malloc");
va_start(args,myFlags);
@@ -59,5 +59,5 @@ gptr my_multi_malloc(myf myFlags, ...)
res+=ALIGN_SIZE(length);
}
va_end(args);
- DBUG_RETURN((gptr) start);
+ DBUG_RETURN((void*) start);
}
diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c
index b4ebaeba647..9203ce9c34e 100644
--- a/mysys/my_alloc.c
+++ b/mysys/my_alloc.c
@@ -43,8 +43,8 @@
reported as error in first alloc_root() on this memory root.
*/
-void init_alloc_root(MEM_ROOT *mem_root, uint block_size,
- uint pre_alloc_size __attribute__((unused)))
+void init_alloc_root(MEM_ROOT *mem_root, size_t block_size,
+ size_t pre_alloc_size __attribute__((unused)))
{
DBUG_ENTER("init_alloc_root");
DBUG_PRINT("enter",("root: 0x%lx", (long) mem_root));
@@ -90,8 +90,8 @@ void init_alloc_root(MEM_ROOT *mem_root, uint block_size,
before allocation.
*/
-void reset_root_defaults(MEM_ROOT *mem_root, uint block_size,
- uint pre_alloc_size __attribute__((unused)))
+void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size,
+ size_t pre_alloc_size __attribute__((unused)))
{
DBUG_ASSERT(alloc_root_inited(mem_root));
@@ -99,7 +99,7 @@ void reset_root_defaults(MEM_ROOT *mem_root, uint block_size,
#if !(defined(HAVE_purify) && defined(EXTRA_DEBUG))
if (pre_alloc_size)
{
- uint size= pre_alloc_size + ALIGN_SIZE(sizeof(USED_MEM));
+ size_t size= pre_alloc_size + ALIGN_SIZE(sizeof(USED_MEM));
if (!mem_root->pre_alloc || mem_root->pre_alloc->size != size)
{
USED_MEM *mem, **prev= &mem_root->free;
@@ -120,7 +120,7 @@ void reset_root_defaults(MEM_ROOT *mem_root, uint block_size,
{
/* remove block from the list and free it */
*prev= mem->next;
- my_free((gptr) mem, MYF(0));
+ my_free(mem, MYF(0));
}
else
prev= &mem->next;
@@ -145,7 +145,7 @@ void reset_root_defaults(MEM_ROOT *mem_root, uint block_size,
}
-gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size)
+void *alloc_root(MEM_ROOT *mem_root, size_t length)
{
#if defined(HAVE_purify) && defined(EXTRA_DEBUG)
reg1 USED_MEM *next;
@@ -154,32 +154,32 @@ gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size)
DBUG_ASSERT(alloc_root_inited(mem_root));
- Size+=ALIGN_SIZE(sizeof(USED_MEM));
- if (!(next = (USED_MEM*) my_malloc(Size,MYF(MY_WME))))
+ length+=ALIGN_SIZE(sizeof(USED_MEM));
+ if (!(next = (USED_MEM*) my_malloc(length,MYF(MY_WME))))
{
if (mem_root->error_handler)
(*mem_root->error_handler)();
- DBUG_RETURN((gptr) 0); /* purecov: inspected */
+ DBUG_RETURN((uchar*) 0); /* purecov: inspected */
}
next->next= mem_root->used;
- next->size= Size;
+ next->size= length;
mem_root->used= next;
DBUG_PRINT("exit",("ptr: 0x%lx", (long) (((char*) next)+
ALIGN_SIZE(sizeof(USED_MEM)))));
- DBUG_RETURN((gptr) (((char*) next)+ALIGN_SIZE(sizeof(USED_MEM))));
+ DBUG_RETURN((uchar*) (((char*) next)+ALIGN_SIZE(sizeof(USED_MEM))));
#else
- uint get_size, block_size;
- gptr point;
+ size_t get_size, block_size;
+ uchar* point;
reg1 USED_MEM *next= 0;
reg2 USED_MEM **prev;
DBUG_ENTER("alloc_root");
DBUG_PRINT("enter",("root: 0x%lx", (long) mem_root));
DBUG_ASSERT(alloc_root_inited(mem_root));
- Size= ALIGN_SIZE(Size);
+ length= ALIGN_SIZE(length);
if ((*(prev= &mem_root->free)) != NULL)
{
- if ((*prev)->left < Size &&
+ if ((*prev)->left < length &&
mem_root->first_block_usage++ >= ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP &&
(*prev)->left < ALLOC_MAX_BLOCK_TO_DROP)
{
@@ -189,20 +189,20 @@ gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size)
mem_root->used= next;
mem_root->first_block_usage= 0;
}
- for (next= *prev ; next && next->left < Size ; next= next->next)
+ for (next= *prev ; next && next->left < length ; next= next->next)
prev= &next->next;
}
if (! next)
{ /* Time to alloc new block */
block_size= mem_root->block_size * (mem_root->block_num >> 2);
- get_size= Size+ALIGN_SIZE(sizeof(USED_MEM));
+ get_size= length+ALIGN_SIZE(sizeof(USED_MEM));
get_size= max(get_size, block_size);
if (!(next = (USED_MEM*) my_malloc(get_size,MYF(MY_WME))))
{
if (mem_root->error_handler)
(*mem_root->error_handler)();
- return((gptr) 0); /* purecov: inspected */
+ return((void*) 0); /* purecov: inspected */
}
mem_root->block_num++;
next->next= *prev;
@@ -211,9 +211,9 @@ gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size)
*prev=next;
}
- point= (gptr) ((char*) next+ (next->size-next->left));
+ point= (uchar*) ((char*) next+ (next->size-next->left));
/*TODO: next part may be unneded due to mem_root->first_block_usage counter*/
- if ((next->left-= Size) < mem_root->min_malloc)
+ if ((next->left-= length) < mem_root->min_malloc)
{ /* Full block */
*prev= next->next; /* Remove block from list */
next->next= mem_root->used;
@@ -221,7 +221,7 @@ gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size)
mem_root->first_block_usage= 0;
}
DBUG_PRINT("exit",("ptr: 0x%lx", (ulong) point));
- DBUG_RETURN(point);
+ DBUG_RETURN((void*) point);
#endif
}
@@ -245,11 +245,11 @@ gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size)
in case of success or NULL if out of memory.
*/
-gptr multi_alloc_root(MEM_ROOT *root, ...)
+void *multi_alloc_root(MEM_ROOT *root, ...)
{
va_list args;
char **ptr, *start, *res;
- uint tot_length, length;
+ size_t tot_length, length;
DBUG_ENTER("multi_alloc_root");
va_start(args, root);
@@ -273,7 +273,7 @@ gptr multi_alloc_root(MEM_ROOT *root, ...)
res+= ALIGN_SIZE(length);
}
va_end(args);
- DBUG_RETURN((gptr) start);
+ DBUG_RETURN((void*) start);
}
#define TRASH_MEM(X) TRASH(((char*)(X) + ((X)->size-(X)->left)), (X)->left)
@@ -346,13 +346,13 @@ void free_root(MEM_ROOT *root, myf MyFlags)
{
old=next; next= next->next ;
if (old != root->pre_alloc)
- my_free((gptr) old,MYF(0));
+ my_free(old,MYF(0));
}
for (next=root->free ; next ;)
{
old=next; next= next->next;
if (old != root->pre_alloc)
- my_free((gptr) old,MYF(0));
+ my_free(old,MYF(0));
}
root->used=root->free=0;
if (root->pre_alloc)
@@ -393,13 +393,13 @@ void set_prealloc_root(MEM_ROOT *root, char *ptr)
}
-char *strdup_root(MEM_ROOT *root,const char *str)
+char *strdup_root(MEM_ROOT *root, const char *str)
{
- return strmake_root(root, str, (uint) strlen(str));
+ return strmake_root(root, str, strlen(str));
}
-char *strmake_root(MEM_ROOT *root,const char *str, uint len)
+char *strmake_root(MEM_ROOT *root, const char *str, size_t len)
{
char *pos;
if ((pos=alloc_root(root,len+1)))
@@ -411,7 +411,7 @@ char *strmake_root(MEM_ROOT *root,const char *str, uint len)
}
-char *memdup_root(MEM_ROOT *root,const char *str,uint len)
+void *memdup_root(MEM_ROOT *root, const void *str, size_t len)
{
char *pos;
if ((pos=alloc_root(root,len)))
diff --git a/mysys/my_append.c b/mysys/my_append.c
index ddd3c91e832..35881a959d5 100644
--- a/mysys/my_append.c
+++ b/mysys/my_append.c
@@ -27,21 +27,22 @@ struct utimbuf {
};
#endif
- /* Append a file to another */
-
-int my_append(const char *from, const char *to, myf MyFlags)
+/*
+ Append a file to another
+ NOTES
+ Don't set MY_FNABP or MY_NABP bits on when calling this function
+*/
- /* Dont set MY_FNABP or MY_NABP bits on
- when calling this funktion */
+int my_append(const char *from, const char *to, myf MyFlags)
{
uint Count;
File from_file,to_file;
- char buff[IO_SIZE];
+ uchar buff[IO_SIZE];
DBUG_ENTER("my_append");
DBUG_PRINT("my",("from %s to %s MyFlags %d", from, to, MyFlags));
- from_file=to_file= -1;
+ from_file= to_file= -1;
if ((from_file=my_open(from,O_RDONLY,MyFlags)) >= 0)
{
diff --git a/mysys/my_chsize.c b/mysys/my_chsize.c
index a5dd1564692..b1dbb22c687 100644
--- a/mysys/my_chsize.c
+++ b/mysys/my_chsize.c
@@ -40,12 +40,12 @@
int my_chsize(File fd, my_off_t newlength, int filler, myf MyFlags)
{
my_off_t oldsize;
- char buff[IO_SIZE];
+ uchar buff[IO_SIZE];
DBUG_ENTER("my_chsize");
DBUG_PRINT("my",("fd: %d length: %lu MyFlags: %d",fd,(ulong) newlength,
MyFlags));
- if ((oldsize = my_seek(fd, 0L, MY_SEEK_END, MYF(MY_WME+MY_FAE))) == newlength)
+ if ((oldsize= my_seek(fd, 0L, MY_SEEK_END, MYF(MY_WME+MY_FAE))) == newlength)
DBUG_RETURN(0);
DBUG_PRINT("info",("old_size: %ld", (ulong) oldsize));
@@ -98,11 +98,11 @@ int my_chsize(File fd, my_off_t newlength, int filler, myf MyFlags)
bfill(buff, IO_SIZE, filler);
while (newlength-oldsize > IO_SIZE)
{
- if (my_write(fd,(byte*) buff,IO_SIZE,MYF(MY_NABP)))
+ if (my_write(fd, buff, IO_SIZE, MYF(MY_NABP)))
goto err;
oldsize+= IO_SIZE;
}
- if (my_write(fd,(byte*) buff,(uint) (newlength-oldsize),MYF(MY_NABP)))
+ if (my_write(fd,buff,(size_t) (newlength-oldsize), MYF(MY_NABP)))
goto err;
DBUG_RETURN(0);
diff --git a/mysys/my_compress.c b/mysys/my_compress.c
index 45e60552592..bc9f8317487 100644
--- a/mysys/my_compress.c
+++ b/mysys/my_compress.c
@@ -24,12 +24,20 @@
#include <zlib.h>
/*
-** This replaces the packet with a compressed packet
-** Returns 1 on error
-** *complen is 0 if the packet wasn't compressed
+ This replaces the packet with a compressed packet
+
+ SYNOPSIS
+ my_compress()
+ packet Data to compress. This is is replaced with the compressed data.
+ len Length of data to compress at 'packet'
+ complen out: 0 if packet was not compressed
+
+ RETURN
+ 1 error. 'len' is not changed'
+ 0 ok. In this case 'len' contains the size of the compressed packet
*/
-my_bool my_compress(byte *packet, ulong *len, ulong *complen)
+my_bool my_compress(uchar *packet, size_t *len, size_t *complen)
{
DBUG_ENTER("my_compress");
if (*len < MIN_COMPRESS_LENGTH)
@@ -39,27 +47,36 @@ my_bool my_compress(byte *packet, ulong *len, ulong *complen)
}
else
{
- byte *compbuf=my_compress_alloc(packet,len,complen);
+ uchar *compbuf=my_compress_alloc(packet,len,complen);
if (!compbuf)
DBUG_RETURN(*complen ? 0 : 1);
memcpy(packet,compbuf,*len);
- my_free(compbuf,MYF(MY_WME)); }
+ my_free(compbuf,MYF(MY_WME));
+ }
DBUG_RETURN(0);
}
-byte *my_compress_alloc(const byte *packet, ulong *len, ulong *complen)
+uchar *my_compress_alloc(const uchar *packet, size_t *len, size_t *complen)
{
- byte *compbuf;
+ uchar *compbuf;
+ uLongf tmp_complen;
+ int res;
*complen= *len * 120 / 100 + 12;
- if (!(compbuf= (byte *) my_malloc(*complen,MYF(MY_WME))))
+
+ if (!(compbuf= (uchar *) my_malloc(*complen, MYF(MY_WME))))
return 0; /* Not enough memory */
- if (compress((Bytef*) compbuf,(ulong *) complen, (Bytef*) packet,
- (uLong) *len ) != Z_OK)
+
+ tmp_complen= *complen;
+ res= compress((Bytef*) compbuf, &tmp_complen, (Bytef*) packet, (uLong) *len);
+ *complen= tmp_complen;
+
+ if (res != Z_OK)
{
- my_free(compbuf,MYF(MY_WME));
+ my_free(compbuf, MYF(MY_WME));
return 0;
}
+
if (*complen >= *len)
{
*complen= 0;
@@ -67,50 +84,68 @@ byte *my_compress_alloc(const byte *packet, ulong *len, ulong *complen)
DBUG_PRINT("note",("Packet got longer on compression; Not compressed"));
return 0;
}
- swap_variables(ulong, *len, *complen); /* *len is now packet length */
+ /* Store length of compressed packet in *len */
+ swap_variables(size_t, *len, *complen);
return compbuf;
}
-my_bool my_uncompress (byte *packet, ulong *len, ulong *complen)
+/*
+ Uncompress packet
+
+ SYNOPSIS
+ my_uncompress()
+ packet Compressed data. This is is replaced with the orignal data.
+ len Length of compressed data
+ complen Length of the packet buffer (must be enough for the original
+ data)
+
+ RETURN
+ 1 error
+ 0 ok. In this case 'complen' contains the updated size of the
+ real data.
+*/
+
+my_bool my_uncompress(uchar *packet, size_t len, size_t *complen)
{
+ uLongf tmp_complen;
DBUG_ENTER("my_uncompress");
+
if (*complen) /* If compressed */
{
- byte *compbuf= (byte *) my_malloc(*complen,MYF(MY_WME));
+ uchar *compbuf= (uchar *) my_malloc(*complen,MYF(MY_WME));
int error;
if (!compbuf)
DBUG_RETURN(1); /* Not enough memory */
- if ((error=uncompress((Bytef*) compbuf, complen, (Bytef*) packet, *len))
- != Z_OK)
+
+ tmp_complen= *complen;
+ error= uncompress((Bytef*) compbuf, &tmp_complen, (Bytef*) packet,
+ (uLong) len);
+ *complen= tmp_complen;
+ if (error != Z_OK)
{ /* Probably wrong packet */
DBUG_PRINT("error",("Can't uncompress packet, error: %d",error));
my_free(compbuf, MYF(MY_WME));
DBUG_RETURN(1);
}
- *len= *complen;
- memcpy(packet, compbuf, *len);
+ memcpy(packet, compbuf, *complen);
my_free(compbuf, MYF(MY_WME));
}
+ else
+ *complen= len;
DBUG_RETURN(0);
}
/*
- Internal representation of the frm blob
+ Internal representation of the frm blob is:
+
+ ver 4 bytes
+ orglen 4 bytes
+ complen 4 bytes
*/
-struct frm_blob_header
-{
- uint ver; /* Version of header */
- uint orglen; /* Original length of compressed data */
- uint complen; /* Compressed length of data, 0=uncompressed */
-};
+#define BLOB_HEADER 12
-struct frm_blob_struct
-{
- struct frm_blob_header head;
- char data[1];
-};
/*
packfrm is a method used to compress the frm file for storage in a
@@ -119,53 +154,55 @@ struct frm_blob_struct
SYNOPSIS
packfrm()
- data Data reference to frm file data
+ data Data reference to frm file data.
len Length of frm file data
out:pack_data Reference to the pointer to the packed frm data
out:pack_len Length of packed frm file data
+ NOTES
+ data is replaced with compressed content
+
RETURN VALUES
0 Success
>0 Failure
*/
-int packfrm(const void *data, uint len,
- const void **pack_data, uint *pack_len)
+int packfrm(uchar *data, size_t len,
+ uchar **pack_data, size_t *pack_len)
{
int error;
- ulong org_len, comp_len;
- uint blob_len;
- struct frm_blob_struct *blob;
+ size_t org_len, comp_len, blob_len;
+ uchar *blob;
DBUG_ENTER("packfrm");
- DBUG_PRINT("enter", ("data: 0x%lx, len: %d", (long) data, len));
+ DBUG_PRINT("enter", ("data: 0x%lx len: %lu", (long) data, (ulong) len));
error= 1;
org_len= len;
- if (my_compress((byte*)data, &org_len, &comp_len))
+ if (my_compress((uchar*)data, &org_len, &comp_len))
goto err;
- DBUG_PRINT("info", ("org_len: %lu comp_len: %lu", org_len, comp_len));
- DBUG_DUMP("compressed", (char*)data, org_len);
+ DBUG_PRINT("info", ("org_len: %lu comp_len: %lu", (ulong) org_len, (ulong) comp_len));
+ DBUG_DUMP("compressed", data, org_len);
error= 2;
- blob_len= sizeof(struct frm_blob_header)+org_len;
- if (!(blob= (struct frm_blob_struct*) my_malloc(blob_len,MYF(MY_WME))))
+ blob_len= BLOB_HEADER + org_len;
+ if (!(blob= (uchar*) my_malloc(blob_len,MYF(MY_WME))))
goto err;
/* Store compressed blob in machine independent format */
- int4store((char*)(&blob->head.ver), 1);
- int4store((char*)(&blob->head.orglen), comp_len);
- int4store((char*)(&blob->head.complen), org_len);
+ int4store(blob, 1);
+ int4store(blob+4, (uint32) len);
+ int4store(blob+8, (uint32) org_len); /* compressed length */
/* Copy frm data into blob, already in machine independent format */
- memcpy(blob->data, data, org_len);
+ memcpy(blob+BLOB_HEADER, data, org_len);
*pack_data= blob;
- *pack_len= blob_len;
+ *pack_len= blob_len;
error= 0;
- DBUG_PRINT("exit", ("pack_data: 0x%lx pack_len: %d",
- (long) *pack_data, *pack_len));
+ DBUG_PRINT("exit", ("pack_data: 0x%lx pack_len: %lu",
+ (long) *pack_data, (ulong) *pack_len));
err:
DBUG_RETURN(error);
@@ -187,40 +224,40 @@ err:
>0 Failure
*/
-int unpackfrm(const void **unpack_data, uint *unpack_len,
- const void *pack_data)
+int unpackfrm(uchar **unpack_data, size_t *unpack_len,
+ const uchar *pack_data)
{
- const struct frm_blob_struct *blob= (struct frm_blob_struct*)pack_data;
- byte *data;
- ulong complen, orglen, ver;
+ uchar *data;
+ size_t complen, orglen;
+ ulong ver;
DBUG_ENTER("unpackfrm");
DBUG_PRINT("enter", ("pack_data: 0x%lx", (long) pack_data));
- complen= uint4korr((char*)&blob->head.complen);
- orglen= uint4korr((char*)&blob->head.orglen);
- ver= uint4korr((char*)&blob->head.ver);
+ ver= uint4korr(pack_data);
+ orglen= uint4korr(pack_data+4);
+ complen= uint4korr(pack_data+8);
DBUG_PRINT("blob",("ver: %lu complen: %lu orglen: %lu",
- ver,complen,orglen));
- DBUG_DUMP("blob->data", (char*) blob->data, complen);
+ ver, (ulong) complen, (ulong) orglen));
+ DBUG_DUMP("blob->data", pack_data + BLOB_HEADER, complen);
if (ver != 1)
DBUG_RETURN(1);
if (!(data= my_malloc(max(orglen, complen), MYF(MY_WME))))
DBUG_RETURN(2);
- memcpy(data, blob->data, complen);
-
+ memcpy(data, pack_data + BLOB_HEADER, complen);
- if (my_uncompress(data, &complen, &orglen))
+ if (my_uncompress(data, complen, &orglen))
{
- my_free((char*)data, MYF(0));
+ my_free(data, MYF(0));
DBUG_RETURN(3);
}
*unpack_data= data;
- *unpack_len= complen;
+ *unpack_len= orglen;
- DBUG_PRINT("exit", ("frmdata: 0x%lx len: %d", (long) *unpack_data, *unpack_len));
+ DBUG_PRINT("exit", ("frmdata: 0x%lx len: %lu", (long) *unpack_data,
+ (ulong) *unpack_len));
DBUG_RETURN(0);
}
#endif /* HAVE_COMPRESS */
diff --git a/mysys/my_conio.c b/mysys/my_conio.c
index 23b0c55e7a9..b78966446ee 100644
--- a/mysys/my_conio.c
+++ b/mysys/my_conio.c
@@ -29,10 +29,10 @@ static HANDLE my_coninpfh= 0; /* console input */
if found useful they are to be exported in mysys
*/
+
/*
int my_pthread_auto_mutex_lock(HANDLE* ph, const char* name,
int id, int time)
-
NOTES
creates a mutex with given name and tries to lock it time msec.
mutex name is appended with id to allow system wide or process wide
@@ -41,8 +41,8 @@ static HANDLE my_coninpfh= 0; /* console input */
RETURN
0 thread owns mutex
<>0 error
-
*/
+
static
int my_pthread_auto_mutex_lock(HANDLE* ph, const char* name, int id, int time)
{
@@ -69,7 +69,6 @@ int my_pthread_auto_mutex_lock(HANDLE* ph, const char* name, int id, int time)
/*
int my_pthread_auto_mutex_free(HANDLE* ph)
-
NOTES
releases a mutex.
@@ -103,7 +102,7 @@ int my_pthread_auto_mutex_free(HANDLE* ph)
/*
- char* my_cgets(char *string, unsigned long clen, unsigned long* plen)
+ char* my_cgets()
NOTES
Replaces _cgets from libc to support input of more than 255 chars.
@@ -121,10 +120,12 @@ int my_pthread_auto_mutex_free(HANDLE* ph)
NULL Error
*/
-char* my_cgets(char *buffer, unsigned long clen, unsigned long* plen)
+
+char* my_cgets(char *buffer, size_t clen, size_t* plen)
{
ULONG state;
char *result;
+ DWORD plen_res;
CONSOLE_SCREEN_BUFFER_INFO csbi;
pthread_auto_mutex_decl(my_conio_cs);
@@ -170,8 +171,9 @@ char* my_cgets(char *buffer, unsigned long clen, unsigned long* plen)
clen= min(clen, 65535);
do
{
- clen= min(clen, (unsigned long)csbi.dwSize.X*csbi.dwSize.Y);
- if (!ReadConsole((HANDLE)my_coninpfh, (LPVOID)buffer, clen - 1, plen, NULL))
+ clen= min(clen, (size_t) csbi.dwSize.X*csbi.dwSize.Y);
+ if (!ReadConsole((HANDLE)my_coninpfh, (LPVOID)buffer, clen - 1, &plen_res,
+ NULL))
{
result= NULL;
clen>>= 1;
@@ -183,17 +185,21 @@ char* my_cgets(char *buffer, unsigned long clen, unsigned long* plen)
}
}
while (GetLastError() == ERROR_NOT_ENOUGH_MEMORY);
+ *plen= plen_res;
+ /* We go here on error reading the string (Ctrl-C for example) */
+ if (!*plen)
+ result= NULL; /* purecov: inspected */
if (result != NULL)
{
- if (buffer[*plen - 2] == '\r')
+ if (*plen > 1 && buffer[*plen - 2] == '\r')
{
*plen= *plen - 2;
}
else
{
- if (buffer[*plen - 1] == '\r')
+ if (*plen > 0 && buffer[*plen - 1] == '\r')
{
char tmp[3];
int tmplen= sizeof(tmp);
diff --git a/mysys/my_copy.c b/mysys/my_copy.c
index 3f8b0695a25..cd741b1eb52 100644
--- a/mysys/my_copy.c
+++ b/mysys/my_copy.c
@@ -54,7 +54,7 @@ int my_copy(const char *from, const char *to, myf MyFlags)
my_bool new_file_stat= 0; /* 1 if we could stat "to" */
int create_flag;
File from_file,to_file;
- char buff[IO_SIZE];
+ uchar buff[IO_SIZE];
MY_STAT stat_buff,new_stat_buff;
DBUG_ENTER("my_copy");
DBUG_PRINT("my",("from %s to %s MyFlags %d", from, to, MyFlags));
@@ -80,10 +80,12 @@ int my_copy(const char *from, const char *to, myf MyFlags)
MyFlags)) < 0)
goto err;
- while ((Count=my_read(from_file,buff,IO_SIZE,MyFlags)) != 0)
+ while ((Count=my_read(from_file, buff, sizeof(buff), MyFlags)) != 0)
+ {
if (Count == (uint) -1 ||
my_write(to_file,buff,Count,MYF(MyFlags | MY_NABP)))
goto err;
+ }
if (my_close(from_file,MyFlags) | my_close(to_file,MyFlags))
DBUG_RETURN(-1); /* Error on close */
diff --git a/mysys/my_create.c b/mysys/my_create.c
index 5639459f5a9..55878318ead 100644
--- a/mysys/my_create.c
+++ b/mysys/my_create.c
@@ -40,13 +40,13 @@ File my_create(const char *FileName, int CreateFlags, int access_flags,
FileName, CreateFlags, access_flags, MyFlags));
#if !defined(NO_OPEN_3)
- fd = open((my_string) FileName, access_flags | O_CREAT,
+ fd = open((char *) FileName, access_flags | O_CREAT,
CreateFlags ? CreateFlags : my_umask);
#elif defined(VMS)
- fd = open((my_string) FileName, access_flags | O_CREAT, 0,
+ fd = open((char *) FileName, access_flags | O_CREAT, 0,
"ctx=stm","ctx=bin");
#elif defined(__WIN__)
- fd= my_sopen((my_string) FileName, access_flags | O_CREAT | O_BINARY,
+ fd= my_sopen((char *) FileName, access_flags | O_CREAT | O_BINARY,
SH_DENYNO, MY_S_IREAD | MY_S_IWRITE);
#else
fd = open(FileName, access_flags);
diff --git a/mysys/my_div.c b/mysys/my_div.c
index 656c6cfde91..d29d3668852 100644
--- a/mysys/my_div.c
+++ b/mysys/my_div.c
@@ -23,7 +23,7 @@
fd File descriptor
*/
-my_string my_filename(File fd)
+char * my_filename(File fd)
{
DBUG_ENTER("my_filename");
if ((uint) fd >= (uint) my_file_limit)
diff --git a/mysys/my_error.c b/mysys/my_error.c
index 48392fe84c3..e8fd8b938ee 100644
--- a/mysys/my_error.c
+++ b/mysys/my_error.c
@@ -191,7 +191,7 @@ int my_error_register(const char **errmsgs, int first, int last)
/* Error numbers must be unique. No overlapping is allowed. */
if (*search_meh_pp && ((*search_meh_pp)->meh_first <= last))
{
- my_free((gptr)meh_p, MYF(0));
+ my_free((uchar*)meh_p, MYF(0));
return 1;
}
@@ -247,7 +247,7 @@ const char **my_error_unregister(int first, int last)
/* Save the return value and free the header. */
errmsgs= meh_p->meh_errmsgs;
- my_free((gptr) meh_p, MYF(0));
+ my_free((uchar*) meh_p, MYF(0));
return errmsgs;
}
@@ -259,7 +259,7 @@ void my_error_unregister_all(void)
for (list= my_errmsgs_globerrs.meh_next; list; list= next)
{
next= list->meh_next;
- my_free((gptr) list, MYF(0));
+ my_free((uchar*) list, MYF(0));
}
my_errmsgs_list= &my_errmsgs_globerrs;
}
diff --git a/mysys/my_fopen.c b/mysys/my_fopen.c
index b56be263ba4..44156da6ae3 100644
--- a/mysys/my_fopen.c
+++ b/mysys/my_fopen.c
@@ -18,7 +18,7 @@
#include <errno.h>
#include "mysys_err.h"
-static void make_ftype(my_string to,int flag);
+static void make_ftype(char * to,int flag);
/*
Open a file as stream
@@ -76,6 +76,7 @@ FILE *my_fopen(const char *filename, int flags, myf MyFlags)
my_strdup(filename,MyFlags)))
{
my_stream_opened++;
+ my_file_total_opened++;
my_file_info[fileno(fd)].type = STREAM_BY_FOPEN;
pthread_mutex_unlock(&THR_LOCK_open);
DBUG_PRINT("exit",("stream: 0x%lx", (long) fd));
@@ -192,7 +193,7 @@ FILE *my_fdopen(File Filedes, const char *name, int Flags, myf MyFlags)
a+ == O_RDWR|O_APPEND|O_CREAT
*/
-static void make_ftype(register my_string to, register int flag)
+static void make_ftype(register char * to, register int flag)
{
/* check some possible invalid combinations */
DBUG_ASSERT((flag & (O_TRUNC | O_APPEND)) != (O_TRUNC | O_APPEND));
diff --git a/mysys/my_fstream.c b/mysys/my_fstream.c
index ea30509ca8c..f5fe862937c 100644
--- a/mysys/my_fstream.c
+++ b/mysys/my_fstream.c
@@ -27,24 +27,31 @@
#define fseek(A,B,C) fseeko((A),(B),(C))
#endif
- /* Read a chunk of bytes from a file */
- /* Returns (uint) -1 if error as my_read() */
-
-uint my_fread(FILE *stream, byte *Buffer, uint Count, myf MyFlags)
- /* File descriptor */
- /* Buffer must be at least count bytes */
- /* Max number of bytes returnd */
- /* Flags on what to do on error */
+/*
+ Read a chunk of bytes from a FILE
+
+ SYNOPSIS
+ my_fread()
+ stream File descriptor
+ Buffer Buffer to read to
+ Count Number of bytes to read
+ MyFlags Flags on what to do on error
+
+ RETURN
+ (size_t) -1 Error
+ # Number of bytes read
+ */
+
+size_t my_fread(FILE *stream, uchar *Buffer, size_t Count, myf MyFlags)
{
- uint readbytes;
+ size_t readbytes;
DBUG_ENTER("my_fread");
DBUG_PRINT("my",("stream: 0x%lx Buffer: 0x%lx Count: %u MyFlags: %d",
- (long) stream, (long) Buffer, Count, MyFlags));
+ (long) stream, (long) Buffer, (uint) Count, MyFlags));
- if ((readbytes = (uint) fread(Buffer,sizeof(char),(size_t) Count,stream))
- != Count)
+ if ((readbytes= fread(Buffer, sizeof(char), Count, stream)) != Count)
{
- DBUG_PRINT("error",("Read only %d bytes",readbytes));
+ DBUG_PRINT("error",("Read only %d bytes", (int) readbytes));
if (MyFlags & (MY_WME | MY_FAE | MY_FNABP))
{
if (ferror(stream))
@@ -57,7 +64,7 @@ uint my_fread(FILE *stream, byte *Buffer, uint Count, myf MyFlags)
}
my_errno=errno ? errno : -1;
if (ferror(stream) || MyFlags & (MY_NABP | MY_FNABP))
- DBUG_RETURN((uint) -1); /* Return with error */
+ DBUG_RETURN((size_t) -1); /* Return with error */
}
if (MyFlags & (MY_NABP | MY_FNABP))
DBUG_RETURN(0); /* Read ok */
@@ -66,40 +73,48 @@ uint my_fread(FILE *stream, byte *Buffer, uint Count, myf MyFlags)
/*
-** Write a chunk of bytes to a stream
-** Returns (uint) -1 if error as my_write()
-** Does retries if interrupted
+ Write a chunk of bytes to a stream
+
+ my_fwrite()
+ stream File descriptor
+ Buffer Buffer to write from
+ Count Number of bytes to write
+ MyFlags Flags on what to do on error
+
+ RETURN
+ (size_t) -1 Error
+ # Number of bytes written
*/
-uint my_fwrite(FILE *stream, const byte *Buffer, uint Count, myf MyFlags)
+size_t my_fwrite(FILE *stream, const uchar *Buffer, size_t Count, myf MyFlags)
{
- uint writenbytes=0;
- off_t seekptr;
+ size_t writtenbytes =0;
+ my_off_t seekptr;
#if !defined(NO_BACKGROUND) && defined(USE_MY_STREAM)
uint errors;
#endif
DBUG_ENTER("my_fwrite");
DBUG_PRINT("my",("stream: 0x%lx Buffer: 0x%lx Count: %u MyFlags: %d",
- (long) stream, (long) Buffer, Count, MyFlags));
+ (long) stream, (long) Buffer, (uint) Count, MyFlags));
#if !defined(NO_BACKGROUND) && defined(USE_MY_STREAM)
errors=0;
#endif
- seekptr=ftell(stream);
+ seekptr= ftell(stream);
for (;;)
{
- uint writen;
- if ((writen = (uint) fwrite((char*) Buffer,sizeof(char),
- (size_t) Count, stream)) != Count)
+ size_t written;
+ if ((written = (size_t) fwrite((char*) Buffer,sizeof(char),
+ Count, stream)) != Count)
{
- DBUG_PRINT("error",("Write only %d bytes",writenbytes));
+ DBUG_PRINT("error",("Write only %d bytes", (int) writtenbytes));
my_errno=errno;
- if (writen != (uint) -1)
+ if (written != (size_t) -1)
{
- seekptr+=writen;
- Buffer+=writen;
- writenbytes+=writen;
- Count-=writen;
+ seekptr+=written;
+ Buffer+=written;
+ writtenbytes+=written;
+ Count-=written;
}
#ifdef EINTR
if (errno == EINTR)
@@ -131,21 +146,21 @@ uint my_fwrite(FILE *stream, const byte *Buffer, uint Count, myf MyFlags)
my_error(EE_WRITE, MYF(ME_BELL+ME_WAITTANG),
my_filename(fileno(stream)),errno);
}
- writenbytes=(uint) -1; /* Return that we got error */
+ writtenbytes= (size_t) -1; /* Return that we got error */
break;
}
}
if (MyFlags & (MY_NABP | MY_FNABP))
- writenbytes=0; /* Everything OK */
+ writtenbytes= 0; /* Everything OK */
else
- writenbytes+=writen;
+ writtenbytes+= written;
break;
}
- DBUG_RETURN(writenbytes);
+ DBUG_RETURN(writtenbytes);
} /* my_fwrite */
- /* Seek to position in file */
- /* ARGSUSED */
+
+/* Seek to position in file */
my_off_t my_fseek(FILE *stream, my_off_t pos, int whence,
myf MyFlags __attribute__((unused)))
@@ -158,8 +173,7 @@ my_off_t my_fseek(FILE *stream, my_off_t pos, int whence,
} /* my_seek */
- /* Tell current position of file */
- /* ARGSUSED */
+/* Tell current position of file */
my_off_t my_ftell(FILE *stream, myf MyFlags __attribute__((unused)))
{
diff --git a/mysys/my_gethwaddr.c b/mysys/my_gethwaddr.c
index 01abc02058b..c7f138c7337 100644
--- a/mysys/my_gethwaddr.c
+++ b/mysys/my_gethwaddr.c
@@ -20,6 +20,8 @@
#include <m_string.h>
#ifndef MAIN
+
+#if defined(__FreeBSD__) || defined(__linux__)
static my_bool memcpy_and_test(uchar *to, uchar *from, uint len)
{
uint i, res=1;
@@ -29,6 +31,7 @@ static my_bool memcpy_and_test(uchar *to, uchar *from, uint len)
res=0;
return res;
}
+#endif /* FreeBSD || linux */
#ifdef __FreeBSD__
@@ -98,7 +101,7 @@ err:
return res;
}
-#else
+#else /* FreeBSD elif linux */
/* just fail */
my_bool my_gethwaddr(uchar *to __attribute__((unused)))
{
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c
index aa470282aa4..3a5b130e067 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -32,8 +32,9 @@ my_bool getopt_compare_strings(const char *s,
static longlong getopt_ll(char *arg, const struct my_option *optp, int *err);
static ulonglong getopt_ull(char *arg, const struct my_option *optp,
int *err);
+static double getopt_double(char *arg, const struct my_option *optp, int *err);
static void init_variables(const struct my_option *options);
-static int setval(const struct my_option *opts, gptr *value, char *argument,
+static int setval(const struct my_option *opts, uchar* *value, char *argument,
my_bool set_maximum_value);
static char *check_struct_option(char *cur_arg, char *key_name);
@@ -58,6 +59,13 @@ char *disabled_my_option= (char*) "0";
my_bool my_getopt_print_errors= 1;
+/*
+ This is a flag that can be set in client programs. 1 means that
+ my_getopt will skip over options it does not know how to handle.
+*/
+
+my_bool my_getopt_skip_unknown= 0;
+
static void default_reporter(enum loglevel level,
const char *format, ...)
{
@@ -82,9 +90,9 @@ static void default_reporter(enum loglevel level,
one. Call function 'get_one_option()' once for each option.
*/
-static gptr* (*getopt_get_addr)(const char *, uint, const struct my_option *);
+static uchar** (*getopt_get_addr)(const char *, uint, const struct my_option *);
-void my_getopt_register_get_addr(gptr* (*func_addr)(const char *, uint,
+void my_getopt_register_get_addr(uchar** (*func_addr)(const char *, uint,
const struct my_option *))
{
getopt_get_addr= func_addr;
@@ -94,22 +102,26 @@ int handle_options(int *argc, char ***argv,
const struct my_option *longopts,
my_get_one_option get_one_option)
{
- uint opt_found, argvpos= 0, length, i;
+ uint opt_found, argvpos= 0, length;
my_bool end_of_options= 0, must_be_var, set_maximum_value,
option_is_loose;
char **pos, **pos_end, *optend, *prev_found,
*opt_str, key_name[FN_REFLEN];
const struct my_option *optp;
- gptr *value;
- int error;
+ uchar* *value;
+ int error, i;
LINT_INIT(opt_found);
+ /* handle_options() assumes arg0 (program name) always exists */
+ DBUG_ASSERT(argc && *argc >= 1);
+ DBUG_ASSERT(argv && *argv);
(*argc)--; /* Skip the program name */
(*argv)++; /* --- || ---- */
init_variables(longopts);
for (pos= *argv, pos_end=pos+ *argc; pos != pos_end ; pos++)
{
+ char **first= pos;
char *cur_arg= *pos;
if (cur_arg[0] == '-' && cur_arg[1] && !end_of_options) /* must be opt */
{
@@ -216,12 +228,11 @@ int handle_options(int *argc, char ***argv,
/*
We were called with a special prefix, we can reuse opt_found
*/
- opt_str+= (special_opt_prefix_lengths[i] + 1);
+ opt_str+= special_opt_prefix_lengths[i] + 1;
+ length-= special_opt_prefix_lengths[i] + 1;
if (i == OPT_LOOSE)
option_is_loose= 1;
- if ((opt_found= findopt(opt_str, length -
- (special_opt_prefix_lengths[i] + 1),
- &optp, &prev_found)))
+ if ((opt_found= findopt(opt_str, length, &optp, &prev_found)))
{
if (opt_found > 1)
{
@@ -245,7 +256,7 @@ int handle_options(int *argc, char ***argv,
break;
case OPT_ENABLE:
optend= (optend && *optend == '0' && !(*(optend + 1))) ?
- disabled_my_option : (char*) "1";
+ disabled_my_option : (char*) "1";
break;
case OPT_MAXIMUM:
set_maximum_value= 1;
@@ -254,11 +265,25 @@ int handle_options(int *argc, char ***argv,
}
break; /* break from the inner loop, main loop continues */
}
+ i= -1; /* restart the loop */
}
}
}
if (!opt_found)
{
+ if (my_getopt_skip_unknown)
+ {
+ /*
+ preserve all the components of this unknown option, this may
+ occurr when the user provides options like: "-O foo" or
+ "--set-variable foo" (note that theres a space in there)
+ Generally, these kind of options are to be avoided
+ */
+ do {
+ (*argv)[argvpos++]= *first++;
+ } while (first <= pos);
+ continue;
+ }
if (must_be_var)
{
if (my_getopt_print_errors)
@@ -556,14 +581,14 @@ static char *check_struct_option(char *cur_arg, char *key_name)
Will set the option value to given value
*/
-static int setval(const struct my_option *opts, gptr *value, char *argument,
+static int setval(const struct my_option *opts, uchar* *value, char *argument,
my_bool set_maximum_value)
{
int err= 0;
if (value && argument)
{
- gptr *result_pos= ((set_maximum_value) ?
+ uchar* *result_pos= ((set_maximum_value) ?
opts->u_max_value : value);
if (!result_pos)
@@ -587,6 +612,9 @@ static int setval(const struct my_option *opts, gptr *value, char *argument,
case GET_ULL:
*((ulonglong*) result_pos)= getopt_ull(argument, opts, &err);
break;
+ case GET_DOUBLE:
+ *((double*) result_pos)= getopt_double(argument, opts, &err);
+ break;
case GET_STR:
*((char**) result_pos)= argument;
break;
@@ -596,6 +624,15 @@ static int setval(const struct my_option *opts, gptr *value, char *argument,
if (!(*((char**) result_pos)= my_strdup(argument, MYF(MY_WME))))
return EXIT_OUT_OF_MEMORY;
break;
+ case GET_ENUM:
+ if (((*(int*)result_pos)= find_type(argument, opts->typelib, 2) - 1) < 0)
+ return EXIT_ARGUMENT_INVALID;
+ break;
+ case GET_SET:
+ *((ulonglong*)result_pos)= find_typeset(argument, opts->typelib, &err);
+ if (err)
+ return EXIT_ARGUMENT_INVALID;
+ break;
default: /* dummy default to avoid compiler warnings */
break;
}
@@ -687,7 +724,7 @@ my_bool getopt_compare_strings(register const char *s, register const char *t,
be k|K for kilo, m|M for mega or g|G for giga.
*/
-static longlong eval_num_suffix (char *argument, int *error, char *option_name)
+static longlong eval_num_suffix(char *argument, int *error, char *option_name)
{
char *endchar;
longlong num;
@@ -769,6 +806,37 @@ ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp)
/*
+ Get double value withing ranges
+
+ Evaluates and returns the value that user gave as an argument to a variable.
+
+ RETURN
+ decimal value of arg
+
+ In case of an error, prints an error message and sets *err to
+ EXIT_ARGUMENT_INVALID. Otherwise err is not touched
+*/
+
+static double getopt_double(char *arg, const struct my_option *optp, int *err)
+{
+ double num;
+ int error;
+ char *end= arg + 1000; /* Big enough as *arg is \0 terminated */
+ num= my_strtod(arg, &end, &error);
+ if (end[0] != 0 || error)
+ {
+ fprintf(stderr,
+ "%s: ERROR: Invalid decimal value for option '%s'\n",
+ my_progname, optp->name);
+ *err= EXIT_ARGUMENT_INVALID;
+ return 0.0;
+ }
+ if (optp->max_value && num > (double) optp->max_value)
+ num= (double) optp->max_value;
+ return max(num, (double) optp->min_value);
+}
+
+/*
Init one value to it's default values
SYNOPSIS
@@ -777,9 +845,10 @@ ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp)
value Pointer to variable
*/
-static void init_one_value(const struct my_option *option, gptr *variable,
+static void init_one_value(const struct my_option *option, uchar* *variable,
longlong value)
{
+ DBUG_ENTER("init_one_value");
switch ((option->var_type & GET_TYPE_MASK)) {
case GET_BOOL:
*((my_bool*) variable)= (my_bool) value;
@@ -788,6 +857,7 @@ static void init_one_value(const struct my_option *option, gptr *variable,
*((int*) variable)= (int) value;
break;
case GET_UINT:
+ case GET_ENUM:
*((uint*) variable)= (uint) value;
break;
case GET_LONG:
@@ -800,11 +870,39 @@ static void init_one_value(const struct my_option *option, gptr *variable,
*((longlong*) variable)= (longlong) value;
break;
case GET_ULL:
+ case GET_SET:
*((ulonglong*) variable)= (ulonglong) value;
break;
+ case GET_DOUBLE:
+ *((double*) variable)= (double) value;
+ break;
+ case GET_STR:
+ /*
+ Do not clear variable value if it has no default value.
+ The default value may already be set.
+ NOTE: To avoid compiler warnings, we first cast longlong to intptr,
+ so that the value has the same size as a pointer.
+ */
+ if ((char*) (intptr) value)
+ *((char**) variable)= (char*) (intptr) value;
+ break;
+ case GET_STR_ALLOC:
+ /*
+ Do not clear variable value if it has no default value.
+ The default value may already be set.
+ NOTE: To avoid compiler warnings, we first cast longlong to intptr,
+ so that the value has the same size as a pointer.
+ */
+ if ((char*) (intptr) value)
+ {
+ my_free((*(char**) variable), MYF(MY_ALLOW_ZERO_PTR));
+ *((char**) variable)= my_strdup((char*) (intptr) value, MYF(MY_WME));
+ }
+ break;
default: /* dummy default to avoid compiler warnings */
break;
}
+ DBUG_VOID_RETURN;
}
@@ -823,9 +921,11 @@ static void init_one_value(const struct my_option *option, gptr *variable,
static void init_variables(const struct my_option *options)
{
+ DBUG_ENTER("init_variables");
for (; options->name; options++)
{
- gptr *variable;
+ uchar* *variable;
+ DBUG_PRINT("options", ("name: '%s'", options->name));
/*
We must set u_max_value first as for some variables
options->u_max_value == options->value and in this case we want to
@@ -839,6 +939,7 @@ static void init_variables(const struct my_option *options)
(variable= (*getopt_get_addr)("", 0, options)))
init_one_value(options, variable, options->def_value);
}
+ DBUG_VOID_RETURN;
}
@@ -928,7 +1029,8 @@ void my_print_help(const struct my_option *options)
void my_print_variables(const struct my_option *options)
{
- uint name_space= 34, length;
+ uint name_space= 34, length, nr;
+ ulonglong bit, llvalue;
char buff[255];
const struct my_option *optp;
@@ -937,7 +1039,7 @@ void my_print_variables(const struct my_option *options)
printf("--------------------------------- -----------------------------\n");
for (optp= options; optp->id; optp++)
{
- gptr *value= (optp->var_type & GET_ASK_ADDR ?
+ uchar* *value= (optp->var_type & GET_ASK_ADDR ?
(*getopt_get_addr)("", 0, optp) : optp->value);
if (value)
{
@@ -946,6 +1048,21 @@ void my_print_variables(const struct my_option *options)
for (; length < name_space; length++)
putchar(' ');
switch ((optp->var_type & GET_TYPE_MASK)) {
+ case GET_SET:
+ if (!(llvalue= *(ulonglong*) value))
+ printf("%s\n", "(No default value)");
+ else
+ for (nr= 0, bit= 1; llvalue && nr < optp->typelib->count; nr++, bit<<=1)
+ {
+ if (!(bit & llvalue))
+ continue;
+ llvalue&= ~bit;
+ printf( llvalue ? "%s," : "%s\n", get_type(optp->typelib, nr));
+ }
+ break;
+ case GET_ENUM:
+ printf("%s\n", get_type(optp->typelib, *(uint*) value));
+ break;
case GET_STR:
case GET_STR_ALLOC: /* fall through */
printf("%s\n", *((char**) value) ? *((char**) value) :
@@ -973,6 +1090,9 @@ void my_print_variables(const struct my_option *options)
longlong2str(*((ulonglong*) value), buff, 10);
printf("%s\n", buff);
break;
+ case GET_DOUBLE:
+ printf("%g\n", *(double*) value);
+ break;
default:
printf("(Disabled)\n");
break;
diff --git a/mysys/my_getsystime.c b/mysys/my_getsystime.c
index 2fd7eed7778..43bb6c08af9 100644
--- a/mysys/my_getsystime.c
+++ b/mysys/my_getsystime.c
@@ -17,11 +17,13 @@
/* thus to get the current time we should use the system function
with the highest possible resolution */
+#include "mysys_priv.h"
+#include "my_static.h"
+
#ifdef __NETWARE__
#include <nks/time.h>
#endif
-#include "mysys_priv.h"
ulonglong my_getsystime()
{
#ifdef HAVE_CLOCK_GETTIME
@@ -29,28 +31,15 @@ ulonglong my_getsystime()
clock_gettime(CLOCK_REALTIME, &tp);
return (ulonglong)tp.tv_sec*10000000+(ulonglong)tp.tv_nsec/100;
#elif defined(__WIN__)
-#define OFFSET_TO_EPOC ((__int64) 134774 * 24 * 60 * 60 * 1000 * 1000 * 10)
- static __int64 offset=0, freq;
LARGE_INTEGER t_cnt;
- if (!offset)
+ if (query_performance_frequency)
{
- /* strictly speaking there should be a mutex to protect
- initialization section. But my_getsystime() is called from
- UUID() code, and UUID() calls are serialized with a mutex anyway
- */
- LARGE_INTEGER li;
- FILETIME ft;
- GetSystemTimeAsFileTime(&ft);
- li.LowPart=ft.dwLowDateTime;
- li.HighPart=ft.dwHighDateTime;
- offset=li.QuadPart-OFFSET_TO_EPOC;
- QueryPerformanceFrequency(&li);
- freq=li.QuadPart;
QueryPerformanceCounter(&t_cnt);
- offset-=t_cnt.QuadPart/freq*10000000+t_cnt.QuadPart%freq*10000000/freq;
+ return (t_cnt.QuadPart / query_performance_frequency * 10000000+
+ t_cnt.QuadPart % query_performance_frequency * 10000000/
+ query_performance_frequency+query_performance_offset);
}
- QueryPerformanceCounter(&t_cnt);
- return t_cnt.QuadPart/freq*10000000+t_cnt.QuadPart%freq*10000000/freq+offset;
+ return 0;
#elif defined(__NETWARE__)
NXTime_t tm;
NXGetTime(NX_SINCE_1970, NX_NSECONDS, &tm);
@@ -62,3 +51,176 @@ ulonglong my_getsystime()
return (ulonglong)tv.tv_sec*10000000+(ulonglong)tv.tv_usec*10;
#endif
}
+
+
+/*
+ Return current time
+
+ SYNOPSIS
+ my_time()
+ flags If MY_WME is set, write error if time call fails
+
+*/
+
+time_t my_time(myf flags __attribute__((unused)))
+{
+ time_t t;
+#ifdef HAVE_GETHRTIME
+ (void) my_micro_time_and_time(&t);
+ return t;
+#else
+ /* The following loop is here beacuse time() may fail on some systems */
+ while ((t= time(0)) == (time_t) -1)
+ {
+ if (flags & MY_WME)
+ fprintf(stderr, "%s: Warning: time() call failed\n", my_progname);
+ }
+ return t;
+#endif
+}
+
+
+/*
+ Return time in micro seconds
+
+ SYNOPSIS
+ my_micro_time()
+
+ NOTES
+ This function is to be used to measure performance in micro seconds.
+ As it's not defined whats the start time for the clock, this function
+ us only useful to measure time between two moments.
+
+ For windows platforms we need the frequency value of the CUP. This is
+ initalized in my_init.c through QueryPerformanceFrequency().
+
+ If Windows platform doesn't support QueryPerformanceFrequency() we will
+ obtain the time via GetClockCount, which only supports milliseconds.
+
+ RETURN
+ Value in microseconds from some undefined point in time
+*/
+
+ulonglong my_micro_time()
+{
+ ulonglong newtime;
+#if defined(__WIN__)
+ if (query_performance_frequency)
+ {
+ QueryPerformanceCounter((LARGE_INTEGER*) &newtime);
+ newtime/= (query_performance_frequency * 1000000);
+ }
+ else
+ newtime= (GetTickCount() * 1000); /* GetTickCount only returns milliseconds */
+ return newtime;
+#elif defined(HAVE_GETHRTIME)
+ return gethrtime()/1000;
+#else
+ struct timeval t;
+ /* The following loop is here because gettimeofday may fail on some systems */
+ while (gettimeofday(&t, NULL) != 0)
+ {}
+ newtime= (ulonglong)t.tv_sec * 1000000 + t.tv_usec;
+ return newtime;
+#endif /* defined(__WIN__) */
+}
+
+
+/*
+ Return time in seconds and timer in microseconds (not different start!)
+
+ SYNOPSIS
+ my_micro_time_and_time()
+ time_arg Will be set to seconds since epoch (00:00:00 UTC, January 1,
+ 1970)
+
+ NOTES
+ This function is to be useful when we need both the time and microtime.
+ For example in MySQL this is used to get the query time start of a query and
+ to measure the time of a query (for the slow query log)
+
+ IMPLEMENTATION
+ Value of time is as in time() call.
+ Value of microtime is same as my_micro_time(), which may be totally unrealated
+ to time()
+
+ RETURN
+ Value in microseconds from some undefined point in time
+*/
+
+#define DELTA_FOR_SECONDS LL(500000000) /* Half a second */
+
+ulonglong my_micro_time_and_time(time_t *time_arg)
+{
+ ulonglong newtime;
+#if defined(__WIN__)
+ if (query_performance_frequency)
+ {
+ QueryPerformanceCounter((LARGE_INTEGER*) &newtime);
+ newtime/= (query_performance_frequency * 1000000);
+ }
+ else
+ newtime= (GetTickCount() * 1000); /* GetTickCount only returns milliseconds */
+ (void) time(time_arg);
+ return newtime;
+#elif defined(HAVE_GETHRTIME)
+ /*
+ Solaris has a very slow time() call. We optimize this by using the very fast
+ gethrtime() call and only calling time() every 1/2 second
+ */
+ static hrtime_t prev_gethrtime= 0;
+ static time_t cur_time= 0;
+ hrtime_t cur_gethrtime;
+
+ pthread_mutex_lock(&THR_LOCK_time);
+ cur_gethrtime= gethrtime();
+ if ((cur_gethrtime - prev_gethrtime) > DELTA_FOR_SECONDS)
+ {
+ cur_time= time(0);
+ prev_gethrtime= cur_gethrtime;
+ }
+ *time_arg= cur_time;
+ pthread_mutex_unlock(&THR_LOCK_time);
+ return cur_gethrtime/1000;
+#else
+ struct timeval t;
+ /* The following loop is here because gettimeofday may fail on some systems */
+ while (gettimeofday(&t, NULL) != 0)
+ {}
+ *time_arg= t.tv_sec;
+ newtime= (ulonglong)t.tv_sec * 1000000 + t.tv_usec;
+ return newtime;
+#endif /* defined(__WIN__) */
+}
+
+
+/*
+ Returns current time
+
+ SYNOPSIS
+ my_time_possible_from_micro()
+ microtime Value from very recent my_micro_time()
+
+ NOTES
+ This function returns the current time. The microtime argument is only used
+ if my_micro_time() uses a function that can safely be converted to the current
+ time.
+
+ RETURN
+ current time
+*/
+
+time_t my_time_possible_from_micro(ulonglong microtime __attribute__((unused)))
+{
+#if defined(__WIN__)
+ time_t t;
+ while ((t= time(0)) == (time_t) -1)
+ {}
+ return t;
+#elif defined(HAVE_GETHRTIME)
+ return my_time(0); /* Cached time */
+#else
+ return (time_t) (microtime / 1000000);
+#endif /* defined(__WIN__) */
+}
+
diff --git a/mysys/my_getwd.c b/mysys/my_getwd.c
index c258db8b126..cbfebcf2374 100644
--- a/mysys/my_getwd.c
+++ b/mysys/my_getwd.c
@@ -27,16 +27,28 @@
#include <direct.h>
#endif
- /* Gets current working directory in buff. Directory is allways ended
- with FN_LIBCHAR */
- /* One must pass a buffer to my_getwd. One can allways use
- curr_dir[] */
+/* Gets current working directory in buff.
-int my_getwd(my_string buf, uint size, myf MyFlags)
+ SYNPOSIS
+ my_getwd()
+ buf Buffer to store result. Can be curr_dir[].
+ size Size of buffer
+ MyFlags Flags
+
+ NOTES
+ Directory is allways ended with FN_LIBCHAR
+
+ RESULT
+ 0 ok
+ # error
+*/
+
+int my_getwd(char * buf, size_t size, myf MyFlags)
{
- my_string pos;
+ char * pos;
DBUG_ENTER("my_getwd");
- DBUG_PRINT("my",("buf: 0x%lx size: %d MyFlags %d", (long) buf,size,MyFlags));
+ DBUG_PRINT("my",("buf: 0x%lx size: %u MyFlags %d",
+ (long) buf, (uint) size, MyFlags));
if (curr_dir[0]) /* Current pos is saved here */
VOID(strmake(buf,&curr_dir[0],size-1));
@@ -71,26 +83,26 @@ int my_getwd(my_string buf, uint size, myf MyFlags)
pos[0]= FN_LIBCHAR;
pos[1]=0;
}
- (void) strmake(&curr_dir[0],buf,(size_s) (FN_REFLEN-1));
+ (void) strmake(&curr_dir[0],buf, (size_t) (FN_REFLEN-1));
}
DBUG_RETURN(0);
} /* my_getwd */
- /* Set new working directory */
+/* Set new working directory */
int my_setwd(const char *dir, myf MyFlags)
{
int res;
- size_s length;
- my_string start,pos;
+ size_t length;
+ char *start, *pos;
#if defined(VMS)
char buff[FN_REFLEN];
#endif
DBUG_ENTER("my_setwd");
DBUG_PRINT("my",("dir: '%s' MyFlags %d", dir, MyFlags));
- start=(my_string) dir;
+ start=(char *) dir;
if (! dir[0] || (dir[0] == FN_LIBCHAR && dir[1] == 0))
dir=FN_ROOTDIR;
#ifdef VMS
@@ -115,7 +127,7 @@ int my_setwd(const char *dir, myf MyFlags)
{
if (test_if_hard_path(start))
{ /* Hard pathname */
- pos=strmake(&curr_dir[0],start,(size_s) FN_REFLEN-1);
+ pos= strmake(&curr_dir[0],start,(size_t) FN_REFLEN-1);
if (pos[-1] != FN_LIBCHAR)
{
length=(uint) (pos-(char*) curr_dir);
diff --git a/mysys/my_init.c b/mysys/my_init.c
index 7784c09d9d6..b2eefe97ee8 100644
--- a/mysys/my_init.c
+++ b/mysys/my_init.c
@@ -69,7 +69,7 @@ static ulong atoi_octal(const char *str)
my_bool my_init(void)
{
- my_string str;
+ char * str;
if (my_init_done)
return 0;
my_init_done=1;
@@ -79,6 +79,9 @@ my_bool my_init(void)
#if defined(THREAD) && defined(SAFE_MUTEX)
safe_mutex_global_init(); /* Must be called early */
#endif
+#if defined(THREAD) && defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX)
+ fastmutex_global_init(); /* Must be called early */
+#endif
netware_init();
#ifdef THREAD
#if defined(HAVE_PTHREAD_INIT)
@@ -130,17 +133,18 @@ void my_end(int infoflag)
*/
FILE *info_file= DBUG_FILE;
my_bool print_info= (info_file != stderr);
- /* We do not use DBUG_ENTER here, as after cleanup DBUG is no longer
- operational, so we cannot use DBUG_RETURN.
+ /*
+ We do not use DBUG_ENTER here, as after cleanup DBUG is no longer
+ operational, so we cannot use DBUG_RETURN.
*/
- DBUG_PRINT("info",("Shutting down"));
+ DBUG_PRINT("info",("Shutting down: infoflag: %d print_info: %d",
+ infoflag, print_info));
if (!info_file)
{
info_file= stderr;
print_info= 0;
}
- DBUG_PRINT("info",("Shutting down: print_info: %d", print_info));
if ((infoflag & MY_CHECK_ERROR) || print_info)
{ /* Test if some file is left open */
@@ -185,7 +189,7 @@ Voluntary context switches %ld, Involuntary context switches %ld\n",
fprintf(info_file,"\nRun time: %.1f\n",(double) clock()/CLOCKS_PER_SEC);
#endif
#if defined(SAFEMALLOC)
- TERMINATE(stderr); /* Give statistic on screen */
+ TERMINATE(stderr, (infoflag & MY_GIVE_INFO) != 0);
#elif defined(__WIN__) && defined(_MSC_VER)
_CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE );
_CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDERR );
@@ -197,6 +201,10 @@ Voluntary context switches %ld, Involuntary context switches %ld\n",
_CrtDumpMemoryLeaks();
#endif
}
+ else if (infoflag & MY_CHECK_ERROR)
+ {
+ TERMINATE(stderr, 0); /* Print memory leaks on screen */
+ }
if (!(infoflag & MY_DONT_FREE_DBUG))
{
@@ -267,6 +275,34 @@ void my_parameter_handler(const wchar_t * expression, const wchar_t * function,
}
+#ifdef __MSVC_RUNTIME_CHECKS
+#include <rtcapi.h>
+
+/* Turn off runtime checks for 'handle_rtc_failure' */
+#pragma runtime_checks("", off)
+
+/*
+ handle_rtc_failure
+ Catch the RTC error and dump it to stderr
+*/
+
+int handle_rtc_failure(int err_type, const char *file, int line,
+ const char* module, const char *format, ...)
+{
+ va_list args;
+ va_start(args, format);
+ fprintf(stderr, "Error:");
+ vfprintf(stderr, format, args);
+ fprintf(stderr, " At %s:%d\n", file, line);
+ va_end(args);
+ (void) fflush(stderr);
+
+ return 0; /* Error is handled */
+}
+#pragma runtime_checks("", on)
+#endif
+
+
static void my_win_init(void)
{
HKEY hSoftMysql ;
@@ -297,6 +333,14 @@ static void my_win_init(void)
_set_invalid_parameter_handler(my_parameter_handler);
#endif
#endif
+#ifdef __MSVC_RUNTIME_CHECKS
+ /*
+ Install handler to send RTC (Runtime Error Check) warnings
+ to log file
+ */
+ _RTC_SetErrorFunc(handle_rtc_failure);
+#endif
+
_tzset();
/* apre la chiave HKEY_LOCAL_MACHINES\software\MySQL */
@@ -335,6 +379,28 @@ static void my_win_init(void)
/* chiude la chiave */
RegCloseKey(hSoftMysql) ;
+
+ /* The following is used by time functions */
+#define OFFSET_TO_EPOC ((__int64) 134774 * 24 * 60 * 60 * 1000 * 1000 * 10)
+#define MS 10000000
+ {
+ FILETIME ft;
+ LARGE_INTEGER li, t_cnt;
+ DBUG_ASSERT(sizeof(LARGE_INTEGER) == sizeof(query_performance_frequency));
+ if (QueryPerformanceFrequency((LARGE_INTEGER *)&query_performance_frequency))
+ query_performance_frequency= 0;
+ else
+ {
+ GetSystemTimeAsFileTime(&ft);
+ li.LowPart= ft.dwLowDateTime;
+ li.HighPart= ft.dwHighDateTime;
+ query_performance_offset= li.QuadPart-OFFSET_TO_EPOC;
+ QueryPerformanceCounter(&t_cnt);
+ query_performance_offset-= (t_cnt.QuadPart / query_performance_frequency * MS +
+ t_cnt.QuadPart % query_performance_frequency * MS /
+ query_performance_frequency);
+ }
+ }
DBUG_VOID_RETURN ;
}
diff --git a/mysys/my_largepage.c b/mysys/my_largepage.c
index 9714c582acb..a20111396cb 100644
--- a/mysys/my_largepage.c
+++ b/mysys/my_largepage.c
@@ -26,8 +26,8 @@
#endif
static uint my_get_large_page_size_int(void);
-static gptr my_large_malloc_int(uint size, myf my_flags);
-static my_bool my_large_free_int(gptr ptr, myf my_flags);
+static uchar* my_large_malloc_int(size_t size, myf my_flags);
+static my_bool my_large_free_int(uchar* ptr, myf my_flags);
/* Gets the size of large pages from the OS */
@@ -48,9 +48,9 @@ uint my_get_large_page_size(void)
my_malloc_lock() in case of failure
*/
-gptr my_large_malloc(uint size, myf my_flags)
+uchar* my_large_malloc(size_t size, myf my_flags)
{
- gptr ptr;
+ uchar* ptr;
DBUG_ENTER("my_large_malloc");
if (my_use_large_pages && my_large_page_size)
@@ -70,7 +70,7 @@ gptr my_large_malloc(uint size, myf my_flags)
to my_free_lock() in case of failure
*/
-void my_large_free(gptr ptr, myf my_flags __attribute__((unused)))
+void my_large_free(uchar* ptr, myf my_flags __attribute__((unused)))
{
DBUG_ENTER("my_large_free");
@@ -113,29 +113,29 @@ finish:
#if HAVE_DECL_SHM_HUGETLB
/* Linux-specific large pages allocator */
-gptr my_large_malloc_int(uint size, myf my_flags)
+uchar* my_large_malloc_int(size_t size, myf my_flags)
{
int shmid;
- gptr ptr;
+ uchar* ptr;
struct shmid_ds buf;
DBUG_ENTER("my_large_malloc_int");
/* Align block size to my_large_page_size */
size = ((size - 1) & ~(my_large_page_size - 1)) + my_large_page_size;
- shmid = shmget(IPC_PRIVATE, (size_t)size, SHM_HUGETLB | SHM_R | SHM_W);
+ shmid = shmget(IPC_PRIVATE, size, SHM_HUGETLB | SHM_R | SHM_W);
if (shmid < 0)
{
if (my_flags & MY_WME)
fprintf(stderr,
- "Warning: Failed to allocate %d bytes from HugeTLB memory."
- " errno %d\n", size, errno);
+ "Warning: Failed to allocate %lu bytesx from HugeTLB memory."
+ " errno %d\n", (ulong) size, errno);
DBUG_RETURN(NULL);
}
- ptr = shmat(shmid, NULL, 0);
- if (ptr == (void *)-1)
+ ptr = (uchar*) shmat(shmid, NULL, 0);
+ if (ptr == (uchar *) -1)
{
if (my_flags& MY_WME)
fprintf(stderr, "Warning: Failed to attach shared memory segment,"
@@ -156,7 +156,7 @@ gptr my_large_malloc_int(uint size, myf my_flags)
/* Linux-specific large pages deallocator */
-my_bool my_large_free_int(byte *ptr, myf my_flags __attribute__((unused)))
+my_bool my_large_free_int(uchar *ptr, myf my_flags __attribute__((unused)))
{
DBUG_ENTER("my_large_free_int");
DBUG_RETURN(shmdt(ptr) == 0);
diff --git a/mysys/my_lib.c b/mysys/my_lib.c
index 783a0683731..c10b2e391b4 100644
--- a/mysys/my_lib.c
+++ b/mysys/my_lib.c
@@ -78,7 +78,7 @@ void my_dirend(MY_DIR *buffer)
ALIGN_SIZE(sizeof(MY_DIR))));
free_root((MEM_ROOT*)((char*)buffer + ALIGN_SIZE(sizeof(MY_DIR)) +
ALIGN_SIZE(sizeof(DYNAMIC_ARRAY))), MYF(0));
- my_free((gptr) buffer,MYF(0));
+ my_free((uchar*) buffer,MYF(0));
}
DBUG_VOID_RETURN;
} /* my_dirend */
@@ -114,7 +114,7 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
pthread_mutex_lock(&THR_LOCK_open);
#endif
- dirp = opendir(directory_file_name(tmp_path,(my_string) path));
+ dirp = opendir(directory_file_name(tmp_path,(char *) path));
#if defined(__amiga__)
if ((dirp->dd_fd) < 0) /* Directory doesn't exists */
goto error;
@@ -132,7 +132,7 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
if (my_init_dynamic_array(dir_entries_storage, sizeof(FILEINFO),
ENTRIES_START_SIZE, ENTRIES_INCREMENT))
{
- my_free((gptr) buffer,MYF(0));
+ my_free((uchar*) buffer,MYF(0));
goto error;
}
init_alloc_root(names_storage, NAMES_START_SIZE, NAMES_START_SIZE);
@@ -168,7 +168,7 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
else
finfo.mystat= NULL;
- if (push_dynamic(dir_entries_storage, (gptr)&finfo))
+ if (push_dynamic(dir_entries_storage, (uchar*)&finfo))
goto error;
}
@@ -208,13 +208,13 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
* Returns pointer to dst;
*/
-my_string directory_file_name (my_string dst, const char *src)
+char * directory_file_name (char * dst, const char *src)
{
#ifndef VMS
/* Process as Unix format: just remove test the final slash. */
- my_string end;
+ char * end;
if (src[0] == 0)
src= (char*) "."; /* Use empty as current */
@@ -230,7 +230,7 @@ my_string directory_file_name (my_string dst, const char *src)
long slen;
long rlen;
- my_string ptr, rptr;
+ char * ptr, rptr;
char bracket;
struct FAB fab = cc$rms_fab;
struct NAM nam = cc$rms_nam;
@@ -401,7 +401,7 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
if (my_init_dynamic_array(dir_entries_storage, sizeof(FILEINFO),
ENTRIES_START_SIZE, ENTRIES_INCREMENT))
{
- my_free((gptr) buffer,MYF(0));
+ my_free((uchar*) buffer,MYF(0));
goto error;
}
init_alloc_root(names_storage, NAMES_START_SIZE, NAMES_START_SIZE);
@@ -475,7 +475,7 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
else
finfo.mystat= NULL;
- if (push_dynamic(dir_entries_storage, (gptr)&finfo))
+ if (push_dynamic(dir_entries_storage, (uchar*)&finfo))
goto error;
}
#ifdef __BORLANDC__
@@ -533,13 +533,13 @@ MY_STAT *my_stat(const char *path, MY_STAT *stat_area, myf my_flags)
if ((m_used= (stat_area == NULL)))
if (!(stat_area = (MY_STAT *) my_malloc(sizeof(MY_STAT), my_flags)))
goto error;
- if (! stat((my_string) path, (struct stat *) stat_area) )
+ if (! stat((char *) path, (struct stat *) stat_area) )
DBUG_RETURN(stat_area);
DBUG_PRINT("error",("Got errno: %d from stat", errno));
my_errno= errno;
if (m_used) /* Free if new area */
- my_free((gptr) stat_area,MYF(0));
+ my_free((uchar*) stat_area,MYF(0));
error:
if (my_flags & (MY_FAE+MY_WME))
diff --git a/mysys/my_lockmem.c b/mysys/my_lockmem.c
index a58a5a340b1..b96331cd3cf 100644
--- a/mysys/my_lockmem.c
+++ b/mysys/my_lockmem.c
@@ -25,17 +25,17 @@
struct st_mem_list
{
LIST list;
- byte *page;
+ uchar *page;
uint size;
};
LIST *mem_list;
-byte *my_malloc_lock(uint size,myf MyFlags)
+uchar *my_malloc_lock(uint size,myf MyFlags)
{
int success;
uint pagesize=sysconf(_SC_PAGESIZE);
- byte *ptr;
+ uchar *ptr;
struct st_mem_list *element;
DBUG_ENTER("my_malloc_lock");
@@ -46,7 +46,7 @@ byte *my_malloc_lock(uint size,myf MyFlags)
my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG),size);
DBUG_RETURN(0);
}
- success = mlock((byte*) ptr,size);
+ success = mlock((uchar*) ptr,size);
if (success != 0 && geteuid() == 0)
{
DBUG_PRINT("warning",("Failed to lock memory. errno %d\n",
@@ -59,11 +59,11 @@ byte *my_malloc_lock(uint size,myf MyFlags)
/* Add block in a list for munlock */
if (!(element=(struct st_mem_list*) my_malloc(sizeof(*element),MyFlags)))
{
- VOID(munlock((byte*) ptr,size));
+ VOID(munlock((uchar*) ptr,size));
free(ptr);
DBUG_RETURN(0);
}
- element->list.data=(byte*) element;
+ element->list.data=(uchar*) element;
element->page=ptr;
element->size=size;
pthread_mutex_lock(&THR_LOCK_malloc);
@@ -74,7 +74,7 @@ byte *my_malloc_lock(uint size,myf MyFlags)
}
-void my_free_lock(byte *ptr,myf Myflags __attribute__((unused)))
+void my_free_lock(uchar *ptr,myf Myflags __attribute__((unused)))
{
LIST *list;
struct st_mem_list *element=0;
@@ -85,14 +85,14 @@ void my_free_lock(byte *ptr,myf Myflags __attribute__((unused)))
element=(struct st_mem_list*) list->data;
if (ptr == element->page)
{ /* Found locked mem */
- VOID(munlock((byte*) ptr,element->size));
+ VOID(munlock((uchar*) ptr,element->size));
mem_list=list_delete(mem_list,list);
break;
}
}
pthread_mutex_unlock(&THR_LOCK_malloc);
if (element)
- my_free((gptr) element,MYF(0));
+ my_free((uchar*) element,MYF(0));
free(ptr); /* Free even if not locked */
}
diff --git a/mysys/my_malloc.c b/mysys/my_malloc.c
index b0e775177a6..12793ad451b 100644
--- a/mysys/my_malloc.c
+++ b/mysys/my_malloc.c
@@ -23,11 +23,11 @@
/* My memory allocator */
-gptr my_malloc(unsigned int size, myf my_flags)
+void *my_malloc(size_t size, myf my_flags)
{
- gptr point;
+ void* point;
DBUG_ENTER("my_malloc");
- DBUG_PRINT("my",("size: %u my_flags: %d",size, my_flags));
+ DBUG_PRINT("my",("size: %lu my_flags: %d", (ulong) size, my_flags));
if (!size)
size=1; /* Safety */
@@ -44,14 +44,14 @@ gptr my_malloc(unsigned int size, myf my_flags)
else if (my_flags & MY_ZEROFILL)
bzero(point,size);
DBUG_PRINT("exit",("ptr: 0x%lx", (long) point));
- DBUG_RETURN(point);
+ DBUG_RETURN((void*) point);
} /* my_malloc */
/* Free memory allocated with my_malloc */
/*ARGSUSED*/
-void my_no_flags_free(gptr ptr)
+void my_no_flags_free(void* ptr)
{
DBUG_ENTER("my_free");
DBUG_PRINT("my",("ptr: 0x%lx", (long) ptr));
@@ -63,32 +63,32 @@ void my_no_flags_free(gptr ptr)
/* malloc and copy */
-gptr my_memdup(const byte *from, uint length, myf my_flags)
+void* my_memdup(const void *from, size_t length, myf my_flags)
{
- gptr ptr;
- if ((ptr=my_malloc(length,my_flags)) != 0)
- memcpy((byte*) ptr, (byte*) from,(size_t) length);
+ void *ptr;
+ if ((ptr= my_malloc(length,my_flags)) != 0)
+ memcpy(ptr, from, length);
return(ptr);
}
char *my_strdup(const char *from, myf my_flags)
{
- gptr ptr;
- uint length=(uint) strlen(from)+1;
- if ((ptr=my_malloc(length,my_flags)) != 0)
- memcpy((byte*) ptr, (byte*) from,(size_t) length);
- return((my_string) ptr);
+ char *ptr;
+ size_t length= strlen(from)+1;
+ if ((ptr= (char*) my_malloc(length, my_flags)))
+ memcpy((uchar*) ptr, (uchar*) from,(size_t) length);
+ return(ptr);
}
-char *my_strndup(const char *from, uint length, myf my_flags)
+char *my_strndup(const char *from, size_t length, myf my_flags)
{
- gptr ptr;
- if ((ptr=my_malloc(length+1,my_flags)) != 0)
+ char *ptr;
+ if ((ptr= (char*) my_malloc(length+1,my_flags)) != 0)
{
- memcpy((byte*) ptr, (byte*) from,(size_t) length);
- ((char*) ptr)[length]=0;
+ memcpy((uchar*) ptr, (uchar*) from, length);
+ ptr[length]=0;
}
return((char*) ptr);
}
diff --git a/mysys/my_memmem.c b/mysys/my_memmem.c
index 9230337409d..c000f14bc66 100644
--- a/mysys/my_memmem.c
+++ b/mysys/my_memmem.c
@@ -22,8 +22,9 @@
Returns a pointer to the beginning of the substring, needle, or NULL if the
substring is not found in haystack.
*/
+
void *my_memmem(const void *haystack, size_t haystacklen,
- const void *needle, size_t needlelen)
+ const void *needle, size_t needlelen)
{
const unsigned char *cursor;
const unsigned char *last_possible_needle_location =
diff --git a/mysys/my_once.c b/mysys/my_once.c
index fcb5af3ccbd..b6f6656fce2 100644
--- a/mysys/my_once.c
+++ b/mysys/my_once.c
@@ -36,10 +36,10 @@
No DBUG_ENTER... here to get smaller dbug-startup
*/
-gptr my_once_alloc(unsigned int Size, myf MyFlags)
+void* my_once_alloc(size_t Size, myf MyFlags)
{
- uint get_size,max_left;
- gptr point;
+ size_t get_size, max_left;
+ uchar* point;
reg1 USED_MEM *next;
reg2 USED_MEM **prev;
@@ -63,36 +63,36 @@ gptr my_once_alloc(unsigned int Size, myf MyFlags)
my_errno=errno;
if (MyFlags & (MY_FAE+MY_WME))
my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG),get_size);
- return((gptr) 0);
+ return((uchar*) 0);
}
- DBUG_PRINT("test",("my_once_malloc %u byte malloced",get_size));
+ DBUG_PRINT("test",("my_once_malloc %lu byte malloced", (ulong) get_size));
next->next= 0;
next->size= get_size;
next->left= get_size-ALIGN_SIZE(sizeof(USED_MEM));
*prev=next;
}
- point= (gptr) ((char*) next+ (next->size-next->left));
+ point= (uchar*) ((char*) next+ (next->size-next->left));
next->left-= Size;
if (MyFlags & MY_ZEROFILL)
bzero(point, Size);
- return(point);
+ return((void*) point);
} /* my_once_alloc */
char *my_once_strdup(const char *src,myf myflags)
{
- uint len= (uint) strlen(src)+1;
- char *dst=my_once_alloc(len, myflags);
+ size_t len= strlen(src)+1;
+ uchar *dst= my_once_alloc(len, myflags);
if (dst)
memcpy(dst, src, len);
- return dst;
+ return (char*) dst;
}
-char *my_once_memdup(const char *src, uint len, myf myflags)
+void *my_once_memdup(const void *src, size_t len, myf myflags)
{
- char *dst=my_once_alloc(len, myflags);
+ uchar *dst= my_once_alloc(len, myflags);
if (dst)
memcpy(dst, src, len);
return dst;
@@ -114,7 +114,7 @@ void my_once_free(void)
for (next=my_once_root_block ; next ; )
{
old=next; next= next->next ;
- free((gptr) old);
+ free((uchar*) old);
}
my_once_root_block=0;
diff --git a/mysys/my_open.c b/mysys/my_open.c
index 71e243c0173..938dbc5dde2 100644
--- a/mysys/my_open.c
+++ b/mysys/my_open.c
@@ -56,20 +56,20 @@ File my_open(const char *FileName, int Flags, myf MyFlags)
}
#ifndef __WIN__
if (Flags & O_SHARE)
- fd = sopen((my_string) FileName, (Flags & ~O_SHARE) | O_BINARY, SH_DENYNO,
+ fd = sopen((char *) FileName, (Flags & ~O_SHARE) | O_BINARY, SH_DENYNO,
MY_S_IREAD | MY_S_IWRITE);
else
- fd = open((my_string) FileName, Flags | O_BINARY,
+ fd = open((char *) FileName, Flags | O_BINARY,
MY_S_IREAD | MY_S_IWRITE);
#else
- fd= my_sopen((my_string) FileName, (Flags & ~O_SHARE) | O_BINARY, SH_DENYNO,
+ fd= my_sopen((char *) FileName, (Flags & ~O_SHARE) | O_BINARY, SH_DENYNO,
MY_S_IREAD | MY_S_IWRITE);
#endif
#elif !defined(NO_OPEN_3)
fd = open(FileName, Flags, my_umask); /* Normal unix */
#else
- fd = open((my_string) FileName, Flags);
+ fd = open((char *) FileName, Flags);
#endif
DBUG_RETURN(my_register_filename(fd, FileName, FILE_BY_OPEN,
EE_FILENOTFOUND, MyFlags));
@@ -151,6 +151,7 @@ File my_register_filename(File fd, const char *FileName, enum file_type
if ((my_file_info[fd].name = (char*) my_strdup(FileName,MyFlags)))
{
my_file_opened++;
+ my_file_total_opened++;
my_file_info[fd].type = type_of_file;
#if defined(THREAD) && !defined(HAVE_PREAD)
pthread_mutex_init(&my_file_info[fd].mutex,MY_MUTEX_INIT_FAST);
diff --git a/mysys/my_pread.c b/mysys/my_pread.c
index f8f0fa49c10..6e98132db73 100644
--- a/mysys/my_pread.c
+++ b/mysys/my_pread.c
@@ -20,61 +20,57 @@
#include <unistd.h>
#endif
- /* Read a chunk of bytes from a file */
-
-uint my_pread(File Filedes, byte *Buffer, uint Count, my_off_t offset,
- myf MyFlags)
+/*
+ Read a chunk of bytes from a file from a given position
+
+ SYNOPSIOS
+ my_pread()
+ Filedes File decsriptor
+ Buffer Buffer to read data into
+ Count Number of bytes to read
+ offset Position to read from
+ MyFlags Flags
+
+ NOTES
+ This differs from the normal pread() call in that we don't care
+ to set the position in the file back to the original position
+ if the system doesn't support pread().
+
+ RETURN
+ (size_t) -1 Error
+ # Number of bytes read
+*/
+
+size_t my_pread(File Filedes, uchar *Buffer, size_t Count, my_off_t offset,
+ myf MyFlags)
{
- uint readbytes;
+ size_t readbytes;
int error= 0;
DBUG_ENTER("my_pread");
DBUG_PRINT("my",("Fd: %d Seek: %lu Buffer: 0x%lx Count: %u MyFlags: %d",
- Filedes, (ulong) offset, (long) Buffer, Count, MyFlags));
-
+ Filedes, (ulong) offset, (long) Buffer, (uint) Count,
+ MyFlags));
for (;;)
{
#ifndef __WIN__
errno=0; /* Linux doesn't reset this */
#endif
#ifndef HAVE_PREAD
- os_off_t old_offset;
-
pthread_mutex_lock(&my_file_info[Filedes].mutex);
- /*
- As we cannot change the file pointer, we save the old position,
- before seeking to the given offset
- */
-
- error= (old_offset= lseek(Filedes, 0L, MY_SEEK_CUR)) == -1L ||
- lseek(Filedes, offset, MY_SEEK_SET) == -1L;
-
- if (!error) /* Seek was successful */
- {
- if ((readbytes = (uint) read(Filedes, Buffer, Count)) == -1L)
- my_errno= errno;
-
- /*
- We should seek back, even if read failed. If this fails,
- we will return an error. If read failed as well, we will
- save the errno from read, not from lseek().
- */
- if ((error= (lseek(Filedes, old_offset, MY_SEEK_SET) == -1L)) &&
- readbytes != -1L)
- my_errno= errno;
- }
-
+ readbytes= (uint) -1;
+ error= (lseek(Filedes, offset, MY_SEEK_SET) == (my_off_t) -1 ||
+ (readbytes= read(Filedes, Buffer, Count)) != Count);
pthread_mutex_unlock(&my_file_info[Filedes].mutex);
#else
- if ((error= ((readbytes =
- (uint) pread(Filedes, Buffer, Count, offset)) != Count)))
+ if ((error= ((readbytes= pread(Filedes, Buffer, Count, offset)) != Count)))
my_errno= errno;
#endif
if (error || readbytes != Count)
{
DBUG_PRINT("warning",("Read only %d bytes off %u from %d, errno: %d",
- (int) readbytes, Count,Filedes,my_errno));
+ (int) readbytes, (uint) Count,Filedes,my_errno));
#ifdef THREAD
- if ((readbytes == 0 || (int) readbytes == -1) && errno == EINTR)
+ if ((readbytes == 0 || readbytes == (size_t) -1) && errno == EINTR)
{
DBUG_PRINT("debug", ("my_pread() was interrupted and returned %d",
(int) readbytes));
@@ -83,14 +79,14 @@ uint my_pread(File Filedes, byte *Buffer, uint Count, my_off_t offset,
#endif
if (MyFlags & (MY_WME | MY_FAE | MY_FNABP))
{
- if ((int) readbytes == -1)
+ 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 ((int) readbytes == -1 || (MyFlags & (MY_FNABP | MY_NABP)))
+ if (readbytes == (size_t) -1 || (MyFlags & (MY_FNABP | MY_NABP)))
DBUG_RETURN(MY_FILE_ERROR); /* Return with error */
}
if (MyFlags & (MY_NABP | MY_FNABP))
@@ -100,65 +96,63 @@ uint my_pread(File Filedes, byte *Buffer, uint Count, my_off_t offset,
} /* my_pread */
- /* Write a chunk of bytes to a file */
+/*
+ Write a chunk of bytes to a file at a given position
+
+ SYNOPSIOS
+ my_pwrite()
+ Filedes File decsriptor
+ Buffer Buffer to write data from
+ Count Number of bytes to write
+ offset Position to write to
+ MyFlags Flags
+
+ NOTES
+ This differs from the normal pwrite() call in that we don't care
+ to set the position in the file back to the original position
+ if the system doesn't support pwrite()
-uint my_pwrite(int Filedes, const byte *Buffer, uint Count, my_off_t offset,
- myf MyFlags)
+ RETURN
+ (size_t) -1 Error
+ # Number of bytes read
+ */
+
+size_t my_pwrite(int Filedes, const uchar *Buffer, size_t Count,
+ my_off_t offset, myf MyFlags)
{
- uint writenbytes,errors;
- ulong written;
+ size_t writenbytes, written;
+ uint errors;
DBUG_ENTER("my_pwrite");
- DBUG_PRINT("my",("Fd: %d Seek: %lu Buffer: 0x%lx Count: %d MyFlags: %d",
- Filedes, (ulong) offset, (long) Buffer, Count, MyFlags));
- errors=0; written=0L;
+ DBUG_PRINT("my",("Fd: %d Seek: %lu Buffer: 0x%lx Count: %u MyFlags: %d",
+ Filedes, (ulong) offset, (long) Buffer, (uint) Count,
+ MyFlags));
+ errors= 0;
+ written= 0;
for (;;)
{
#ifndef HAVE_PREAD
- int error= 0;
- os_off_t old_offset;
- writenbytes= (uint) -1;
+ int error;
+ writenbytes= (size_t) -1;
pthread_mutex_lock(&my_file_info[Filedes].mutex);
-
- /*
- As we cannot change the file pointer, we save the old position,
- before seeking to the given offset
- */
- error= ((old_offset= lseek(Filedes, 0L, MY_SEEK_CUR)) == -1L ||
- lseek(Filedes, offset, MY_SEEK_SET) == -1L);
-
- if (!error) /* Seek was successful */
- {
- if ((writenbytes = (uint) write(Filedes, Buffer, Count)) == -1L)
- my_errno= errno;
-
- /*
- We should seek back, even if write failed. If this fails,
- we will return an error. If write failed as well, we will
- save the errno from write, not from lseek().
- */
- if ((error= (lseek(Filedes, old_offset, MY_SEEK_SET) == -1L)) &&
- writenbytes != -1L)
- my_errno= errno;
- }
+ error= (lseek(Filedes, offset, MY_SEEK_SET) != (my_off_t) -1 &&
+ (writenbytes = write(Filedes, Buffer, Count)) == Count);
pthread_mutex_unlock(&my_file_info[Filedes].mutex);
-
- if (!error && writenbytes == Count)
+ if (error)
break;
#else
- if ((writenbytes = (uint) pwrite(Filedes, Buffer, Count,offset)) == Count)
+ if ((writenbytes= pwrite(Filedes, Buffer, Count,offset)) == Count)
break;
- else
- my_errno= errno;
+ my_errno= errno;
#endif
- if ((int) writenbytes != -1)
+ if (writenbytes != (size_t) -1)
{ /* Safegueard */
written+=writenbytes;
Buffer+=writenbytes;
Count-=writenbytes;
offset+=writenbytes;
}
- DBUG_PRINT("error",("Write only %d bytes",writenbytes));
+ DBUG_PRINT("error",("Write only %u bytes", (uint) writenbytes));
#ifndef NO_BACKGROUND
#ifdef THREAD
if (my_thread_var->abort)
@@ -173,8 +167,7 @@ uint my_pwrite(int Filedes, const byte *Buffer, uint Count, my_off_t offset,
VOID(sleep(MY_WAIT_FOR_USER_TO_FIX_PANIC));
continue;
}
- if ((writenbytes > 0 && (uint) writenbytes != (uint) -1) ||
- my_errno == EINTR)
+ if ((writenbytes && writenbytes != (size_t) -1) || my_errno == EINTR)
continue; /* Retry */
#endif
if (MyFlags & (MY_NABP | MY_FNABP))
@@ -189,6 +182,7 @@ uint my_pwrite(int Filedes, const byte *Buffer, uint Count, my_off_t offset,
else
break; /* Return bytes written */
}
+ 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 */
diff --git a/mysys/my_quick.c b/mysys/my_quick.c
index 15549dfb751..c19fe08572d 100644
--- a/mysys/my_quick.c
+++ b/mysys/my_quick.c
@@ -19,14 +19,14 @@
#include "my_nosys.h"
-uint my_quick_read(File Filedes,byte *Buffer,uint Count,myf MyFlags)
+size_t my_quick_read(File Filedes,uchar *Buffer,size_t Count,myf MyFlags)
{
- uint readbytes;
+ size_t readbytes;
- if ((readbytes = (uint) read(Filedes, Buffer, Count)) != Count)
+ if ((readbytes = read(Filedes, Buffer, Count)) != Count)
{
#ifndef DBUG_OFF
- if ((readbytes == 0 || (int) readbytes == -1) && errno == EINTR)
+ if ((readbytes == 0 || readbytes == (size_t) -1) && errno == EINTR)
{
DBUG_PRINT("error", ("my_quick_read() was interrupted and returned %d"
". This function does not retry the read!",
@@ -40,20 +40,20 @@ uint my_quick_read(File Filedes,byte *Buffer,uint Count,myf MyFlags)
}
-uint my_quick_write(File Filedes,const byte *Buffer,uint Count)
+size_t my_quick_write(File Filedes,const uchar *Buffer,size_t Count)
{
#ifndef DBUG_OFF
- uint writtenbytes;
+ size_t writtenbytes;
#endif
if ((
#ifndef DBUG_OFF
writtenbytes =
#endif
- (uint) write(Filedes,Buffer,Count)) != Count)
+ (size_t) write(Filedes,Buffer,Count)) != Count)
{
#ifndef DBUG_OFF
- if ((writtenbytes == 0 || (int) writtenbytes == -1) && errno == EINTR)
+ if ((writtenbytes == 0 || writtenbytes == (size_t) -1) && errno == EINTR)
{
DBUG_PRINT("error", ("my_quick_write() was interrupted and returned %d"
". This function does not retry the write!",
@@ -61,7 +61,7 @@ uint my_quick_write(File Filedes,const byte *Buffer,uint Count)
}
#endif
my_errno=errno;
- return (uint) -1;
+ return (size_t) -1;
}
return 0;
}
diff --git a/mysys/my_read.c b/mysys/my_read.c
index a6c45340b0c..f3e8a4b300e 100644
--- a/mysys/my_read.c
+++ b/mysys/my_read.c
@@ -33,43 +33,44 @@
N number of bytes read.
*/
-uint my_read(File Filedes, byte *Buffer, uint Count, myf MyFlags)
+size_t my_read(File Filedes, uchar *Buffer, size_t Count, myf MyFlags)
{
- uint readbytes, save_count;
+ size_t readbytes, save_count;
DBUG_ENTER("my_read");
- DBUG_PRINT("my",("Fd: %d Buffer: 0x%lx Count: %u MyFlags: %d",
- Filedes, (long) Buffer, Count, MyFlags));
+ DBUG_PRINT("my",("Fd: %d Buffer: 0x%lx Count: %lu MyFlags: %d",
+ Filedes, (long) Buffer, (ulong) Count, MyFlags));
save_count= Count;
for (;;)
{
errno= 0; /* Linux doesn't reset this */
- if ((readbytes= (uint) read(Filedes, Buffer, Count)) != Count)
+ if ((readbytes= read(Filedes, Buffer, Count)) != Count)
{
my_errno= errno ? errno : -1;
- DBUG_PRINT("warning",("Read only %d bytes off %u from %d, errno: %d",
- (int) readbytes, Count, Filedes, my_errno));
+ DBUG_PRINT("warning",("Read only %d bytes off %lu from %d, errno: %d",
+ (int) readbytes, (ulong) Count, Filedes,
+ my_errno));
#ifdef THREAD
if ((readbytes == 0 || (int) readbytes == -1) && errno == EINTR)
{
- DBUG_PRINT("debug", ("my_read() was interrupted and returned %d",
- (int) readbytes));
+ DBUG_PRINT("debug", ("my_read() was interrupted and returned %ld",
+ (long) readbytes));
continue; /* Interrupted */
}
#endif
if (MyFlags & (MY_WME | MY_FAE | MY_FNABP))
{
- if ((int) readbytes == -1)
+ 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 ((int) readbytes == -1 ||
+ if (readbytes == (size_t) -1 ||
((MyFlags & (MY_FNABP | MY_NABP)) && !(MyFlags & MY_FULL_IO)))
DBUG_RETURN(MY_FILE_ERROR); /* Return with error */
- if (readbytes > 0 && (MyFlags & MY_FULL_IO))
+ if (readbytes != (size_t) -1 && (MyFlags & MY_FULL_IO))
{
Buffer+= readbytes;
Count-= readbytes;
diff --git a/mysys/my_realloc.c b/mysys/my_realloc.c
index 43fbb0c1eee..c7cf1323cd4 100644
--- a/mysys/my_realloc.c
+++ b/mysys/my_realloc.c
@@ -22,12 +22,12 @@
/* My memory re allocator */
-gptr my_realloc(gptr oldpoint, uint size, myf my_flags)
+void* my_realloc(void* oldpoint, size_t size, myf my_flags)
{
- gptr point;
+ void *point;
DBUG_ENTER("my_realloc");
- DBUG_PRINT("my",("ptr: 0x%lx size: %u my_flags: %d", (long) oldpoint, size,
- my_flags));
+ DBUG_PRINT("my",("ptr: 0x%lx size: %lu my_flags: %d", (long) oldpoint,
+ (ulong) size, my_flags));
if (!oldpoint && (my_flags & MY_ALLOW_ZERO_PTR))
DBUG_RETURN(my_malloc(size,my_flags));
@@ -48,7 +48,7 @@ gptr my_realloc(gptr oldpoint, uint size, myf my_flags)
free(oldpoint);
}
#else
- if ((point = (char*)realloc(oldpoint,size)) == NULL)
+ if ((point= (uchar*) realloc(oldpoint,size)) == NULL)
{
if (my_flags & MY_FREE_ON_ERROR)
my_free(oldpoint, my_flags);
diff --git a/mysys/my_seek.c b/mysys/my_seek.c
index 6f3c1349722..2c661baeff7 100644
--- a/mysys/my_seek.c
+++ b/mysys/my_seek.c
@@ -23,7 +23,9 @@
my_off_t pos The expected position (absolute or relative)
int whence A direction parameter and one of
{SEEK_SET, SEEK_CUR, SEEK_END}
- myf MyFlags Not used.
+ myf MyFlags MY_THREADSAFE must be set in case my_seek may be mixed
+ with my_pread/my_pwrite calls and fd is shared among
+ threads.
DESCRIPTION
The my_seek function is a wrapper around the system call lseek and
@@ -54,9 +56,16 @@ my_off_t my_seek(File fd, my_off_t pos, int whence,
Make sure we are using a valid file descriptor!
*/
DBUG_ASSERT(fd != -1);
-
- newpos= lseek(fd, pos, whence);
-
+#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
+#endif
+ newpos= lseek(fd, pos, whence);
if (newpos == (os_off_t) -1)
{
my_errno=errno;
@@ -79,6 +88,7 @@ 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_ASSERT(fd >= 0);
#ifdef HAVE_TELL
pos=tell(fd);
#else
diff --git a/mysys/my_static.c b/mysys/my_static.c
index 42dd9d71490..cb482b19b57 100644
--- a/mysys/my_static.c
+++ b/mysys/my_static.c
@@ -18,20 +18,19 @@
a shared library
*/
-#if !defined(stdin)
#include "mysys_priv.h"
#include "my_static.h"
#include "my_alarm.h"
-#endif
my_bool timed_mutexes= 0;
/* from my_init */
-my_string home_dir=0;
+char * home_dir=0;
const char *my_progname=0;
char NEAR curr_dir[FN_REFLEN]= {0},
NEAR home_dir_buff[FN_REFLEN]= {0};
ulong my_stream_opened=0,my_file_opened=0, my_tmp_file_created=0;
+ulong my_file_total_opened= 0;
int NEAR my_umask=0664, NEAR my_umask_dir=0777;
#ifndef THREAD
int NEAR my_errno=0;
@@ -48,9 +47,6 @@ struct st_remember _my_sig_remember[MAX_SIGNALS]={{0,0}};
sigset_t my_signals; /* signals blocked by mf_brkhant */
#endif
- /* from mf_keycache.c */
-my_bool key_cache_inited=0;
-
/* from mf_reccache.c */
ulong my_default_record_cache_size=RECORD_CACHE_SIZE;
@@ -77,8 +73,8 @@ uint sf_malloc_prehunc=0, /* If you have problem with core- */
ulong sf_malloc_cur_memory= 0L; /* Current memory usage */
ulong sf_malloc_max_memory= 0L; /* Maximum memory usage */
uint sf_malloc_count= 0; /* Number of times NEW() was called */
-byte *sf_min_adress= (byte*) ~(unsigned long) 0L,
- *sf_max_adress= (byte*) 0L;
+uchar *sf_min_adress= (uchar*) ~(unsigned long) 0L,
+ *sf_max_adress= (uchar*) 0L;
/* Root of the linked list of struct st_irem */
struct st_irem *sf_malloc_root = NULL;
@@ -96,6 +92,11 @@ int (*error_handler_hook)(uint error,const char *str,myf MyFlags)=
int (*fatal_error_handler_hook)(uint error,const char *str,myf MyFlags)=
my_message_no_curses;
+#ifdef __WIN__
+/* from my_getsystime.c */
+ulonglong query_performance_frequency, query_performance_offset;
+#endif
+
/* How to disable options */
my_bool NEAR my_disable_locking=0;
my_bool NEAR my_disable_async_io=0;
diff --git a/mysys/my_static.h b/mysys/my_static.h
index b438c936225..0eca196c1c9 100644
--- a/mysys/my_static.h
+++ b/mysys/my_static.h
@@ -60,12 +60,14 @@ extern const char *soundex_map;
extern USED_MEM* my_once_root_block;
extern uint my_once_extra;
-extern byte *sf_min_adress,*sf_max_adress;
+extern uchar *sf_min_adress,*sf_max_adress;
extern uint sf_malloc_count;
extern struct st_irem *sf_malloc_root;
extern struct st_my_file_info my_file_info_default[MY_NFILE];
+extern ulonglong query_performance_frequency, query_performance_offset;
+
#if defined(THREAD) && !defined(__WIN__)
extern sigset_t my_signals; /* signals blocked by mf_brkhant */
#endif
diff --git a/mysys/my_symlink2.c b/mysys/my_symlink2.c
index 6ea22790998..2a46fb3abea 100644
--- a/mysys/my_symlink2.c
+++ b/mysys/my_symlink2.c
@@ -56,11 +56,13 @@ File my_create_with_symlink(const char *linkname, const char *filename,
{
if (!access(filename,F_OK))
{
+ my_errno= errno= EEXIST;
my_error(EE_CANTCREATEFILE, MYF(0), filename, EEXIST);
DBUG_RETURN(-1);
}
if (create_link && !access(linkname,F_OK))
{
+ my_errno= errno= EEXIST;
my_error(EE_CANTCREATEFILE, MYF(0), linkname, EEXIST);
DBUG_RETURN(-1);
}
diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c
index 79a28ef04b0..1ba6e5ac92d 100644
--- a/mysys/my_thr_init.c
+++ b/mysys/my_thr_init.c
@@ -30,7 +30,7 @@ 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_net, THR_LOCK_charset, THR_LOCK_threads, THR_LOCK_time;
pthread_cond_t THR_COND_threads;
uint THR_thread_count= 0;
uint my_thread_end_wait_time= 5;
@@ -47,7 +47,7 @@ pthread_mutexattr_t my_fast_mutexattr;
pthread_mutexattr_t my_errorcheck_mutexattr;
#endif
-#ifdef NPTL_PTHREAD_EXIT_BUG /* see my_pthread.h */
+#ifdef TARGET_OS_LINUX
/*
Dummy thread spawned in my_thread_global_init() below to avoid
@@ -61,7 +61,8 @@ nptl_pthread_exit_hack_handler(void *arg __attribute((unused)))
pthread_exit(0);
return 0;
}
-#endif
+
+#endif /* TARGET_OS_LINUX */
static uint get_thread_lib(void);
@@ -87,20 +88,21 @@ my_bool my_thread_global_init(void)
fprintf(stderr,"Can't initialize threads: error %d\n", pth_ret);
return 1;
}
-
-#ifdef NPTL_PTHREAD_EXIT_BUG
+
+#ifdef TARGET_OS_LINUX
/*
- BUG#24507: Race conditions inside current NPTL pthread_exit()
+ BUG#24507: Race conditions inside current NPTL pthread_exit()
implementation.
To avoid a possible segmentation fault during concurrent
executions of pthread_exit(), a dummy thread is spawned which
initializes internal variables of pthread lib. See bug description
for a full explanation.
-
+
TODO: Remove this code when fixed versions of glibc6 are in common
use.
*/
+ if (thd_lib_detected == THD_LIB_NPTL)
{
pthread_t dummy_thread;
pthread_attr_t dummy_thread_attr;
@@ -111,7 +113,7 @@ my_bool my_thread_global_init(void)
pthread_create(&dummy_thread,&dummy_thread_attr,
nptl_pthread_exit_hack_handler, NULL);
}
-#endif
+#endif /* TARGET_OS_LINUX */
#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
/*
@@ -145,6 +147,7 @@ my_bool my_thread_global_init(void)
pthread_mutex_init(&THR_LOCK_net,MY_MUTEX_INIT_FAST);
pthread_mutex_init(&THR_LOCK_charset,MY_MUTEX_INIT_FAST);
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();
@@ -177,10 +180,17 @@ void my_thread_global_end(void)
&abstime);
if (error == ETIMEDOUT || error == ETIME)
{
+#ifdef HAVE_PTHREAD_KILL
+ /*
+ We shouldn't give an error here, because if we don't have
+ pthread_kill(), programs like mysqld can't ensure that all threads
+ are killed when we enter here.
+ */
if (THR_thread_count)
fprintf(stderr,
"Error in my_thread_global_end(): %d threads didn't exit\n",
THR_thread_count);
+#endif
all_threads_killed= 0;
break;
}
@@ -201,11 +211,12 @@ void my_thread_global_end(void)
pthread_mutex_destroy(&THR_LOCK_myisam);
pthread_mutex_destroy(&THR_LOCK_heap);
pthread_mutex_destroy(&THR_LOCK_net);
+ pthread_mutex_destroy(&THR_LOCK_time);
pthread_mutex_destroy(&THR_LOCK_charset);
if (all_threads_killed)
{
pthread_mutex_destroy(&THR_LOCK_threads);
- pthread_cond_destroy (&THR_COND_threads);
+ pthread_cond_destroy(&THR_COND_threads);
}
#if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R)
pthread_mutex_destroy(&LOCK_localtime_r);
diff --git a/mysys/my_vle.c b/mysys/my_vle.c
index 18339c877df..09f297eb553 100644
--- a/mysys/my_vle.c
+++ b/mysys/my_vle.c
@@ -39,16 +39,16 @@
bytes. On failure, the 'out' pointer is returned.
*/
-byte*
-my_vle_encode(byte* out, my_size_t max, ulong n)
+uchar*
+my_vle_encode(uchar* out, size_t max, ulong n)
{
- byte buf[my_vle_sizeof(n)];
- byte *ptr= buf;
- my_size_t len;
+ uchar buf[my_vle_sizeof(n)];
+ uchar *ptr= buf;
+ size_t len;
do
{
- *ptr++= (byte) (n & 0x7F);
+ *ptr++= (uchar) (n & 0x7F);
n>>= 7;
}
while (n > 0);
@@ -64,7 +64,7 @@ my_vle_encode(byte* out, my_size_t max, ulong n)
*/
while (ptr-- > buf)
{
- byte v= *ptr;
+ uchar v= *ptr;
if (ptr > buf)
v|= 0x80;
*out++= v;
@@ -89,11 +89,11 @@ my_vle_encode(byte* out, my_size_t max, ulong n)
more than sizeof(*result_ptr) + 1 bytes.
*/
-byte const*
-my_vle_decode(ulong *result_ptr, byte const *vle)
+uchar const*
+my_vle_decode(ulong *result_ptr, uchar const *vle)
{
ulong result= 0;
- my_size_t cnt= 1;
+ size_t cnt= 1;
do
{
diff --git a/mysys/my_wincond.c b/mysys/my_wincond.c
index 353b2fced4e..d1b07b61408 100644
--- a/mysys/my_wincond.c
+++ b/mysys/my_wincond.c
@@ -201,7 +201,7 @@ int pthread_attr_setprio(pthread_attr_t *connect_att,int priority)
int pthread_attr_destroy(pthread_attr_t *connect_att)
{
- bzero((gptr) connect_att,sizeof(*connect_att));
+ bzero((uchar*) connect_att,sizeof(*connect_att));
return 0;
}
diff --git a/mysys/my_windac.c b/mysys/my_windac.c
index c711093b48f..f846853f7be 100644
--- a/mysys/my_windac.c
+++ b/mysys/my_windac.c
@@ -194,8 +194,8 @@ error:
FreeSid(everyone_sid);
if (htoken)
CloseHandle(htoken);
- my_free((gptr) sa, MYF(MY_ALLOW_ZERO_PTR));
- my_free((gptr) dacl, MYF(MY_ALLOW_ZERO_PTR));
+ my_free((uchar*) sa, MYF(MY_ALLOW_ZERO_PTR));
+ my_free((uchar*) dacl, MYF(MY_ALLOW_ZERO_PTR));
*psa= 0;
return 1;
}
@@ -215,8 +215,8 @@ void my_security_attr_free(SECURITY_ATTRIBUTES *sa)
My_security_attr *attr= (My_security_attr*)
(((char*)sa) + ALIGN_SIZE(sizeof(*sa)));
FreeSid(attr->everyone_sid);
- my_free((gptr) attr->dacl, MYF(0));
- my_free((gptr) sa, MYF(0));
+ my_free((uchar*) attr->dacl, MYF(0));
+ my_free((uchar*) sa, MYF(0));
}
}
diff --git a/mysys/my_write.c b/mysys/my_write.c
index 4c3d187e4e8..056a84f1794 100644
--- a/mysys/my_write.c
+++ b/mysys/my_write.c
@@ -20,28 +20,28 @@
/* Write a chunk of bytes to a file */
-uint my_write(int Filedes, const byte *Buffer, uint Count, myf MyFlags)
+size_t my_write(int Filedes, const uchar *Buffer, size_t Count, myf MyFlags)
{
- uint writenbytes,errors;
- ulong written;
+ size_t writenbytes, written;
+ uint errors;
DBUG_ENTER("my_write");
- DBUG_PRINT("my",("Fd: %d Buffer: 0x%lx Count: %d MyFlags: %d",
- Filedes, (long) Buffer, Count, MyFlags));
- errors=0; written=0L;
+ DBUG_PRINT("my",("Fd: %d Buffer: 0x%lx Count: %lu MyFlags: %d",
+ Filedes, (long) Buffer, (ulong) Count, MyFlags));
+ errors=0; written=0;
for (;;)
{
- if ((writenbytes = (uint) write(Filedes, Buffer, Count)) == Count)
+ if ((writenbytes= write(Filedes, Buffer, Count)) == Count)
break;
- if ((int) writenbytes != -1)
+ if (writenbytes != (size_t) -1)
{ /* Safeguard */
written+=writenbytes;
Buffer+=writenbytes;
Count-=writenbytes;
}
my_errno=errno;
- DBUG_PRINT("error",("Write only %d bytes, error: %d",
- writenbytes,my_errno));
+ DBUG_PRINT("error",("Write only %ld bytes, error: %d",
+ (long) writenbytes, my_errno));
#ifndef NO_BACKGROUND
#ifdef THREAD
if (my_thread_var->abort)
@@ -57,12 +57,12 @@ uint my_write(int Filedes, const byte *Buffer, uint Count, myf MyFlags)
continue;
}
- if ((writenbytes == 0 || (int) writenbytes == -1))
+ if ((writenbytes == 0 || writenbytes == (size_t) -1))
{
if (my_errno == EINTR)
{
- DBUG_PRINT("debug", ("my_write() was interrupted and returned %d",
- (int) writenbytes));
+ DBUG_PRINT("debug", ("my_write() was interrupted and returned %ld",
+ (long) writenbytes));
continue; /* Interrupted */
}
diff --git a/mysys/mysys_priv.h b/mysys/mysys_priv.h
index 709cfed969a..6e0959ae08c 100644
--- a/mysys/mysys_priv.h
+++ b/mysys/mysys_priv.h
@@ -28,7 +28,7 @@
#include <my_pthread.h>
extern pthread_mutex_t THR_LOCK_malloc, THR_LOCK_open, THR_LOCK_keycache;
extern pthread_mutex_t THR_LOCK_lock, THR_LOCK_isam, THR_LOCK_net;
-extern pthread_mutex_t THR_LOCK_charset;
+extern pthread_mutex_t THR_LOCK_charset, THR_LOCK_time;
#else
#include <my_no_pthread.h>
#endif
diff --git a/mysys/ptr_cmp.c b/mysys/ptr_cmp.c
index 4fdbad58aaf..24ab6a1ea9c 100644
--- a/mysys/ptr_cmp.c
+++ b/mysys/ptr_cmp.c
@@ -22,15 +22,15 @@
#include "mysys_priv.h"
#include <myisampack.h>
-static int ptr_compare(uint *compare_length, uchar **a, uchar **b);
-static int ptr_compare_0(uint *compare_length, uchar **a, uchar **b);
-static int ptr_compare_1(uint *compare_length, uchar **a, uchar **b);
-static int ptr_compare_2(uint *compare_length, uchar **a, uchar **b);
-static int ptr_compare_3(uint *compare_length, uchar **a, uchar **b);
+static int ptr_compare(size_t *compare_length, uchar **a, uchar **b);
+static int ptr_compare_0(size_t *compare_length, uchar **a, uchar **b);
+static int ptr_compare_1(size_t *compare_length, uchar **a, uchar **b);
+static int ptr_compare_2(size_t *compare_length, uchar **a, uchar **b);
+static int ptr_compare_3(size_t *compare_length, uchar **a, uchar **b);
/* Get a pointer to a optimal byte-compare function for a given size */
-qsort2_cmp get_ptr_compare (uint size)
+qsort2_cmp get_ptr_compare (size_t size)
{
if (size < 4)
return (qsort2_cmp) ptr_compare;
@@ -51,7 +51,7 @@ qsort2_cmp get_ptr_compare (uint size)
#define cmp(N) if (first[N] != last[N]) return (int) first[N] - (int) last[N]
-static int ptr_compare(uint *compare_length, uchar **a, uchar **b)
+static int ptr_compare(size_t *compare_length, uchar **a, uchar **b)
{
reg3 int length= *compare_length;
reg1 uchar *first,*last;
@@ -66,7 +66,7 @@ static int ptr_compare(uint *compare_length, uchar **a, uchar **b)
}
-static int ptr_compare_0(uint *compare_length,uchar **a, uchar **b)
+static int ptr_compare_0(size_t *compare_length,uchar **a, uchar **b)
{
reg3 int length= *compare_length;
reg1 uchar *first,*last;
@@ -87,7 +87,7 @@ static int ptr_compare_0(uint *compare_length,uchar **a, uchar **b)
}
-static int ptr_compare_1(uint *compare_length,uchar **a, uchar **b)
+static int ptr_compare_1(size_t *compare_length,uchar **a, uchar **b)
{
reg3 int length= *compare_length-1;
reg1 uchar *first,*last;
@@ -108,7 +108,7 @@ static int ptr_compare_1(uint *compare_length,uchar **a, uchar **b)
return (0);
}
-static int ptr_compare_2(uint *compare_length,uchar **a, uchar **b)
+static int ptr_compare_2(size_t *compare_length,uchar **a, uchar **b)
{
reg3 int length= *compare_length-2;
reg1 uchar *first,*last;
@@ -130,7 +130,7 @@ static int ptr_compare_2(uint *compare_length,uchar **a, uchar **b)
return (0);
}
-static int ptr_compare_3(uint *compare_length,uchar **a, uchar **b)
+static int ptr_compare_3(size_t *compare_length,uchar **a, uchar **b)
{
reg3 int length= *compare_length-3;
reg1 uchar *first,*last;
@@ -153,7 +153,7 @@ static int ptr_compare_3(uint *compare_length,uchar **a, uchar **b)
return (0);
}
-void my_store_ptr(byte *buff, uint pack_length, my_off_t pos)
+void my_store_ptr(uchar *buff, size_t pack_length, my_off_t pos)
{
switch (pack_length) {
#if SIZEOF_OFF_T > 4
@@ -171,7 +171,7 @@ void my_store_ptr(byte *buff, uint pack_length, my_off_t pos)
return;
}
-my_off_t my_get_ptr(byte *ptr, uint pack_length)
+my_off_t my_get_ptr(uchar *ptr, size_t pack_length)
{
my_off_t pos;
switch (pack_length) {
diff --git a/mysys/queues.c b/mysys/queues.c
index 5970922284f..d8a7ca19bee 100644
--- a/mysys/queues.c
+++ b/mysys/queues.c
@@ -49,11 +49,11 @@
*/
int init_queue(QUEUE *queue, uint max_elements, uint offset_to_key,
- pbool max_at_top, int (*compare) (void *, byte *, byte *),
+ pbool max_at_top, int (*compare) (void *, uchar *, uchar *),
void *first_cmp_arg)
{
DBUG_ENTER("init_queue");
- if ((queue->root= (byte **) my_malloc((max_elements+1)*sizeof(void*),
+ if ((queue->root= (uchar **) my_malloc((max_elements+1)*sizeof(void*),
MYF(MY_WME))) == 0)
DBUG_RETURN(1);
queue->elements=0;
@@ -92,7 +92,7 @@ int init_queue(QUEUE *queue, uint max_elements, uint offset_to_key,
*/
int init_queue_ex(QUEUE *queue, uint max_elements, uint offset_to_key,
- pbool max_at_top, int (*compare) (void *, byte *, byte *),
+ pbool max_at_top, int (*compare) (void *, uchar *, uchar *),
void *first_cmp_arg, uint auto_extent)
{
int ret;
@@ -129,7 +129,7 @@ int init_queue_ex(QUEUE *queue, uint max_elements, uint offset_to_key,
*/
int reinit_queue(QUEUE *queue, uint max_elements, uint offset_to_key,
- pbool max_at_top, int (*compare) (void *, byte *, byte *),
+ pbool max_at_top, int (*compare) (void *, uchar *, uchar *),
void *first_cmp_arg)
{
DBUG_ENTER("reinit_queue");
@@ -162,11 +162,11 @@ int reinit_queue(QUEUE *queue, uint max_elements, uint offset_to_key,
int resize_queue(QUEUE *queue, uint max_elements)
{
- byte **new_root;
+ uchar **new_root;
DBUG_ENTER("resize_queue");
if (queue->max_elements == max_elements)
DBUG_RETURN(0);
- if ((new_root= (byte **) my_realloc((void *)queue->root,
+ if ((new_root= (uchar **) my_realloc((void *)queue->root,
(max_elements+1)*sizeof(void*),
MYF(MY_WME))) == 0)
DBUG_RETURN(1);
@@ -196,7 +196,7 @@ void delete_queue(QUEUE *queue)
DBUG_ENTER("delete_queue");
if (queue->root)
{
- my_free((gptr) queue->root,MYF(0));
+ my_free((uchar*) queue->root,MYF(0));
queue->root=0;
}
DBUG_VOID_RETURN;
@@ -205,7 +205,7 @@ void delete_queue(QUEUE *queue)
/* Code for insert, search and delete of elements */
-void queue_insert(register QUEUE *queue, byte *element)
+void queue_insert(register QUEUE *queue, uchar *element)
{
reg2 uint idx, next;
int cmp;
@@ -234,7 +234,7 @@ void queue_insert(register QUEUE *queue, byte *element)
*/
-int queue_insert_safe(register QUEUE *queue, byte *element)
+int queue_insert_safe(register QUEUE *queue, uchar *element)
{
if (queue->elements == queue->max_elements)
@@ -253,9 +253,9 @@ int queue_insert_safe(register QUEUE *queue, byte *element)
/* Remove item from queue */
/* Returns pointer to removed element */
-byte *queue_remove(register QUEUE *queue, uint idx)
+uchar *queue_remove(register QUEUE *queue, uint idx)
{
- byte *element;
+ uchar *element;
DBUG_ASSERT(idx < queue->max_elements);
element= queue->root[++idx]; /* Intern index starts from 1 */
queue->root[idx]= queue->root[queue->elements--];
@@ -276,7 +276,7 @@ void queue_replaced(QUEUE *queue)
void _downheap(register QUEUE *queue, uint idx)
{
- byte *element;
+ uchar *element;
uint elements,half_queue,offset_to_key, next_index;
bool first= TRUE;
uint start_idx= idx;
@@ -332,7 +332,7 @@ void _downheap(register QUEUE *queue, uint idx)
/* Fix heap when index have changed */
void _downheap(register QUEUE *queue, uint idx)
{
- byte *element;
+ uchar *element;
uint elements,half_queue,next_index,offset_to_key;
int cmp;
@@ -483,7 +483,7 @@ void calculate_end_next(uint part)
}
return;
}
-static int test_compare(void *null_arg, byte *a, byte *b)
+static int test_compare(void *null_arg, uchar *a, uchar *b)
{
uint a_num= (*(uint*)a) & 0x3FFFFF;
uint b_num= (*(uint*)b) & 0x3FFFFF;
@@ -541,9 +541,9 @@ void perform_insert(QUEUE *queue)
}
num_array[i]= num + (i << 22);
if (fix_used)
- queue_element(queue, i-1)= (byte*)&num_array[i];
+ queue_element(queue, i-1)= (uchar*)&num_array[i];
else
- queue_insert(queue, (byte*)&num_array[i]);
+ queue_insert(queue, (uchar*)&num_array[i]);
} while (++i <= no_parts);
if (fix_used)
{
@@ -573,7 +573,7 @@ bool perform_ins_del(QUEUE *queue, bool max_ind)
num_array[part]-= part;
else
num_array[part]+= part;
- queue_top(queue)= (byte*)&num_array[part];
+ queue_top(queue)= (uchar*)&num_array[part];
queue_replaced(queue);
}
} while (++i < no_loops);
@@ -665,7 +665,7 @@ static void benchmark_test()
num+= 16;
part= num >> 22;
num_array[part]= num;
- queue_top(queue)= (byte*)&num_array[part];
+ queue_top(queue)= (uchar*)&num_array[part];
queue_replaced(queue);
}
for (i= 0; i < 16; i++)
diff --git a/mysys/safemalloc.c b/mysys/safemalloc.c
index f2a4c280610..7a2f448b2dc 100644
--- a/mysys/safemalloc.c
+++ b/mysys/safemalloc.c
@@ -51,7 +51,7 @@
(equivalent to realloc())
FREE( pPtr ) Free memory allocated by NEW
(equivalent to free())
- TERMINATE(file) End system, report errors and stats on file
+ TERMINATE(file,flag) End system, report errors and stats on file
I personally use two more functions, but have not included them here:
char *STRSAVE( sPtr ) Save a copy of the string in dynamic memory
char *RENEW( pPtr, uSize )
@@ -82,7 +82,7 @@ static int sf_malloc_tampered= 0;
/* Static functions prototypes */
-static int check_ptr(const char *where, byte *ptr, const char *sFile,
+static int check_ptr(const char *where, uchar *ptr, const char *sFile,
uint uLine);
static int _checkchunk(struct st_irem *pRec, const char *sFile, uint uLine);
@@ -119,12 +119,12 @@ static int _checkchunk(struct st_irem *pRec, const char *sFile, uint uLine);
/* Allocate some memory. */
-gptr _mymalloc(uint size, const char *filename, uint lineno, myf MyFlags)
+void *_mymalloc(size_t size, const char *filename, uint lineno, myf MyFlags)
{
struct st_irem *irem;
- char *data;
+ uchar *data;
DBUG_ENTER("_mymalloc");
- DBUG_PRINT("enter",("Size: %u",size));
+ DBUG_PRINT("enter",("Size: %lu", (ulong) size));
if (!sf_malloc_quick)
(void) _sanity (filename, lineno);
@@ -151,8 +151,8 @@ gptr _mymalloc(uint size, const char *filename, uint lineno, myf MyFlags)
my_errno=errno;
sprintf(buff,"Out of memory at line %d, '%s'", lineno, filename);
my_message(EE_OUTOFMEMORY, buff, MYF(ME_BELL+ME_WAITTANG+ME_NOREFRESH));
- sprintf(buff,"needed %d byte (%ldk), memory in use: %ld bytes (%ldk)",
- size, (size + 1023L) / 1024L,
+ sprintf(buff,"needed %u byte (%ldk), memory in use: %ld bytes (%ldk)",
+ (uint) size, (uint) (size + 1023L) / 1024L,
sf_malloc_max_memory, (sf_malloc_max_memory + 1023L) / 1024L);
my_message(EE_OUTOFMEMORY, buff, MYF(ME_BELL+ME_WAITTANG+ME_NOREFRESH));
}
@@ -160,18 +160,18 @@ gptr _mymalloc(uint size, const char *filename, uint lineno, myf MyFlags)
sf_malloc_max_memory,lineno, filename));
if (MyFlags & MY_FAE)
exit(1);
- DBUG_RETURN ((gptr) 0);
+ DBUG_RETURN ((void*) 0);
}
/* Fill up the structure */
- data= (((char*) irem) + ALIGN_SIZE(sizeof(struct st_irem)) +
+ data= (((uchar*) irem) + ALIGN_SIZE(sizeof(struct st_irem)) +
sf_malloc_prehunc);
*((uint32*) (data-sizeof(uint32)))= MAGICKEY;
data[size + 0]= MAGICEND0;
data[size + 1]= MAGICEND1;
data[size + 2]= MAGICEND2;
data[size + 3]= MAGICEND3;
- irem->filename= (my_string) filename;
+ irem->filename= (char *) filename;
irem->linenum= lineno;
irem->datasize= size;
irem->prev= NULL;
@@ -198,7 +198,7 @@ gptr _mymalloc(uint size, const char *filename, uint lineno, myf MyFlags)
sf_min_adress= data;
if (sf_max_adress < data)
sf_max_adress= data;
- DBUG_RETURN ((gptr) data);
+ DBUG_RETURN((void*) data);
}
@@ -207,8 +207,8 @@ gptr _mymalloc(uint size, const char *filename, uint lineno, myf MyFlags)
Free then old memoryblock
*/
-gptr _myrealloc(register gptr ptr, register uint size,
- const char *filename, uint lineno, myf MyFlags)
+void *_myrealloc(register void *ptr, register size_t size,
+ const char *filename, uint lineno, myf MyFlags)
{
struct st_irem *irem;
char *data;
@@ -220,8 +220,8 @@ gptr _myrealloc(register gptr ptr, register uint size,
if (!sf_malloc_quick)
(void) _sanity (filename, lineno);
- if (check_ptr("Reallocating", (byte*) ptr, filename, lineno))
- DBUG_RETURN((gptr) NULL);
+ if (check_ptr("Reallocating", (uchar*) ptr, filename, lineno))
+ DBUG_RETURN((uchar*) NULL);
irem= (struct st_irem *) (((char*) ptr) - ALIGN_SIZE(sizeof(struct st_irem))-
sf_malloc_prehunc);
@@ -232,13 +232,13 @@ gptr _myrealloc(register gptr ptr, register uint size,
DBUG_PRINT("safe",("Reallocating unallocated data at line %d, '%s'",
lineno, filename));
(void) fflush(stderr);
- DBUG_RETURN((gptr) NULL);
+ DBUG_RETURN((uchar*) NULL);
}
if ((data= _mymalloc(size,filename,lineno,MyFlags))) /* Allocate new area */
{
size=min(size, irem->datasize); /* Move as much as possibly */
- memcpy((byte*) data, ptr, (size_t) size); /* Copy old data */
+ memcpy((uchar*) data, ptr, (size_t) size); /* Copy old data */
_myfree(ptr, filename, lineno, 0); /* Free not needed area */
}
else
@@ -254,7 +254,7 @@ gptr _myrealloc(register gptr ptr, register uint size,
/* Deallocate some memory. */
-void _myfree(gptr ptr, const char *filename, uint lineno, myf myflags)
+void _myfree(void *ptr, const char *filename, uint lineno, myf myflags)
{
struct st_irem *irem;
DBUG_ENTER("_myfree");
@@ -264,7 +264,7 @@ void _myfree(gptr ptr, const char *filename, uint lineno, myf myflags)
(void) _sanity (filename, lineno);
if ((!ptr && (myflags & MY_ALLOW_ZERO_PTR)) ||
- check_ptr("Freeing",(byte*) ptr,filename,lineno))
+ check_ptr("Freeing",(uchar*) ptr,filename,lineno))
DBUG_VOID_RETURN;
/* Calculate the address of the remember structure */
@@ -316,7 +316,7 @@ void _myfree(gptr ptr, const char *filename, uint lineno, myf myflags)
/* Check if we have a wrong pointer */
-static int check_ptr(const char *where, byte *ptr, const char *filename,
+static int check_ptr(const char *where, uchar *ptr, const char *filename,
uint lineno)
{
if (!ptr)
@@ -352,12 +352,15 @@ static int check_ptr(const char *where, byte *ptr, const char *filename,
/*
- TERMINATE(FILE *file)
- Report on all the memory pieces that have not been
- free'ed as well as the statistics.
+ Report on all the memory pieces that have not been free'ed
+
+ SYNOPSIS
+ TERMINATE()
+ file Write output to this file
+ flag If <> 0, also write statistics
*/
-void TERMINATE(FILE *file)
+void TERMINATE(FILE *file, uint flag)
{
struct st_irem *irem;
DBUG_ENTER("TERMINATE");
@@ -373,8 +376,7 @@ void TERMINATE(FILE *file)
{
if (file)
{
- fprintf(file, "Warning: Not freed memory segments: %u\n",
- sf_malloc_count);
+ fprintf(file, "Warning: Not freed memory segments: %u\n", sf_malloc_count);
(void) fflush(file);
}
DBUG_PRINT("safe",("sf_malloc_count: %u", sf_malloc_count));
@@ -414,7 +416,7 @@ void TERMINATE(FILE *file)
}
}
/* Report the memory usage statistics */
- if (file)
+ if (file && flag)
{
fprintf(file, "Maximum memory usage: %ld bytes (%ldk)\n",
sf_malloc_max_memory, (sf_malloc_max_memory + 1023L) / 1024L);
@@ -503,12 +505,12 @@ int _sanity(const char *filename, uint lineno)
/* malloc and copy */
-gptr _my_memdup(const byte *from, uint length, const char *filename,
- uint lineno, myf MyFlags)
+void *_my_memdup(const void *from, size_t length, const char *filename,
+ uint lineno, myf MyFlags)
{
- gptr ptr;
- if ((ptr=_mymalloc(length,filename,lineno,MyFlags)) != 0)
- memcpy((byte*) ptr, (byte*) from,(size_t) length);
+ void *ptr;
+ if ((ptr= _mymalloc(length,filename,lineno,MyFlags)) != 0)
+ memcpy(ptr, from, length);
return(ptr);
} /*_my_memdup */
@@ -516,23 +518,23 @@ gptr _my_memdup(const byte *from, uint length, const char *filename,
char *_my_strdup(const char *from, const char *filename, uint lineno,
myf MyFlags)
{
- gptr ptr;
- uint length=(uint) strlen(from)+1;
- if ((ptr=_mymalloc(length,filename,lineno,MyFlags)) != 0)
- memcpy((byte*) ptr, (byte*) from,(size_t) length);
- return((char*) ptr);
+ char *ptr;
+ size_t length= strlen(from)+1;
+ if ((ptr= (char*) _mymalloc(length,filename,lineno,MyFlags)) != 0)
+ memcpy((uchar*) ptr, (uchar*) from, (size_t) length);
+ return(ptr);
} /* _my_strdup */
-char *_my_strndup(const char *from, uint length,
- const char *filename, uint lineno,
- myf MyFlags)
+char *_my_strndup(const char *from, size_t length,
+ const char *filename, uint lineno,
+ myf MyFlags)
{
- gptr ptr;
- if ((ptr=_mymalloc(length+1,filename,lineno,MyFlags)) != 0)
+ char *ptr;
+ if ((ptr= (char*) _mymalloc(length+1,filename,lineno,MyFlags)) != 0)
{
- memcpy((byte*) ptr, (byte*) from,(size_t) length);
+ memcpy((uchar*) ptr, (uchar*) from, (size_t) length);
ptr[length]=0;
}
- return((char *) ptr);
+ return(ptr);
}
diff --git a/mysys/string.c b/mysys/string.c
index e1ff9ec8c26..b234a589406 100644
--- a/mysys/string.c
+++ b/mysys/string.c
@@ -23,7 +23,7 @@
#include <m_string.h>
my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str,
- uint init_alloc, uint alloc_increment)
+ size_t init_alloc, size_t alloc_increment)
{
uint length;
DBUG_ENTER("init_dynamic_string");
@@ -31,7 +31,7 @@ my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str,
if (!alloc_increment)
alloc_increment=128;
length=1;
- if (init_str && (length= (uint) strlen(init_str)+1) < init_alloc)
+ if (init_str && (length= strlen(init_str)+1) < init_alloc)
init_alloc=((length+alloc_increment-1)/alloc_increment)*alloc_increment;
if (!init_alloc)
init_alloc=alloc_increment;
@@ -72,7 +72,7 @@ my_bool dynstr_set(DYNAMIC_STRING *str, const char *init_str)
}
-my_bool dynstr_realloc(DYNAMIC_STRING *str, ulong additional_size)
+my_bool dynstr_realloc(DYNAMIC_STRING *str, size_t additional_size)
{
DBUG_ENTER("dynstr_realloc");
@@ -95,7 +95,7 @@ my_bool dynstr_append(DYNAMIC_STRING *str, const char *append)
my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append,
- uint length)
+ size_t length)
{
char *new_ptr;
if (str->length+length >= str->max_length)
@@ -114,26 +114,30 @@ my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append,
return FALSE;
}
-my_bool dynstr_trunc(DYNAMIC_STRING *str, int n)
+
+my_bool dynstr_trunc(DYNAMIC_STRING *str, size_t n)
{
str->length-=n;
str->str[str->length]= '\0';
return FALSE;
}
-/** Concatenates any number of strings, escapes any OS quote in the result then
- * surround the whole affair in another set of quotes which is finally appended
- * to specified DYNAMIC_STRING. This function is especially useful when
- * building strings to be executed with the system() function.
- * @param str Dynamic String which will have addtional strings appended.
- * @param append String to be appended.
- * @param ... Optional. Additional string(s) to be appended.
- *
- * @note The final argument in the list must be NullS even if no additional
- * options are passed.
- *
- * @return True = Success.
- */
+/*
+ Concatenates any number of strings, escapes any OS quote in the result then
+ surround the whole affair in another set of quotes which is finally appended
+ to specified DYNAMIC_STRING. This function is especially useful when
+ building strings to be executed with the system() function.
+
+ @param str Dynamic String which will have addtional strings appended.
+ @param append String to be appended.
+ @param ... Optional. Additional string(s) to be appended.
+
+ @note The final argument in the list must be NullS even if no additional
+ options are passed.
+
+ @return True = Success.
+*/
+
my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append, ...)
{
#ifdef __WIN__
diff --git a/mysys/test_charset.c b/mysys/test_charset.c
index 08154e67863..d867b49304e 100644
--- a/mysys/test_charset.c
+++ b/mysys/test_charset.c
@@ -77,7 +77,7 @@ int main(int argc, char **argv) {
_print_csinfo(cs);
fflush(stdout);
-#define NOT_USED_ANYMORE
+#ifdef NOT_USED_ANYMORE
cs_list = list_charsets(MYF(MY_CS_COMPILED | MY_CS_CONFIG));
printf("LIST OF CHARSETS (compiled + *.conf):\n%s\n", cs_list);
my_free(cs_list,MYF(0));
diff --git a/mysys/testhash.c b/mysys/testhash.c
index 0961558afd3..2add2ebd2d7 100644
--- a/mysys/testhash.c
+++ b/mysys/testhash.c
@@ -38,11 +38,11 @@ my_bool hash_check(HASH *hash);
void free_record(void *record);
-static byte *hash2_key(const byte *rec,uint *length,
+static uchar *hash2_key(const uchar *rec,uint *length,
my_bool not_used __attribute__((unused)))
{
*length=(uint) (uchar) rec[reclength-1];
- return (byte*) rec;
+ return (uchar*) rec;
}
/* main program */
@@ -196,7 +196,7 @@ static int do_test()
pos=0;
while ((recpos=hash_element(&hash,0)))
{
- record=(byte*) my_malloc(reclength,MYF(MY_FAE));
+ record=(uchar*) my_malloc(reclength,MYF(MY_FAE));
memcpy(record,recpos,reclength);
record[reclength-1]=rnd(5)+1;
if (my_hash_insert(&hash2,record))
diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c
index 471ec0ab10d..afa5aadece7 100644
--- a/mysys/thr_alarm.c
+++ b/mysys/thr_alarm.c
@@ -38,7 +38,7 @@ uint thr_client_alarm;
static int alarm_aborted=1; /* No alarm thread */
my_bool thr_alarm_inited= 0;
volatile my_bool alarm_thread_running= 0;
-
+time_t next_alarm_expire_time= ~ (time_t) 0;
static sig_handler process_alarm_part2(int sig);
#if !defined(__WIN__)
@@ -60,7 +60,7 @@ static void *alarm_handler(void *arg);
static sig_handler thread_alarm(int sig __attribute__((unused)));
static int compare_ulong(void *not_used __attribute__((unused)),
- byte *a_ptr,byte* b_ptr)
+ uchar *a_ptr,uchar* b_ptr)
{
ulong a=*((ulong*) a_ptr),b= *((ulong*) b_ptr);
return (a < b) ? -1 : (a == b) ? 0 : 1;
@@ -71,6 +71,7 @@ void init_thr_alarm(uint max_alarms)
sigset_t s;
DBUG_ENTER("init_thr_alarm");
alarm_aborted=0;
+ next_alarm_expire_time= ~ (time_t) 0;
init_queue(&alarm_queue,max_alarms+1,offsetof(ALARM,expire_time),0,
compare_ulong,NullS);
sigfillset(&full_signal_set); /* Neaded to block signals */
@@ -150,22 +151,28 @@ void resize_thr_alarm(uint max_alarms)
my_bool thr_alarm(thr_alarm_t *alrm, uint sec, ALARM *alarm_data)
{
- ulong now;
+ time_t now;
+#ifndef USE_ONE_SIGNAL_HAND
sigset_t old_mask;
+#endif
my_bool reschedule;
struct st_my_thread_var *current_my_thread_var= my_thread_var;
DBUG_ENTER("thr_alarm");
DBUG_PRINT("enter",("thread: %s sec: %d",my_thread_name(),sec));
- now=(ulong) time((time_t*) 0);
+ now= my_time(0);
+#ifndef USE_ONE_SIGNAL_HAND
pthread_sigmask(SIG_BLOCK,&full_signal_set,&old_mask);
+#endif
pthread_mutex_lock(&LOCK_alarm); /* Lock from threads & alarms */
if (alarm_aborted > 0)
{ /* No signal thread */
DBUG_PRINT("info", ("alarm aborted"));
*alrm= 0; /* No alarm */
pthread_mutex_unlock(&LOCK_alarm);
+#ifndef USE_ONE_SIGNAL_HAND
pthread_sigmask(SIG_SETMASK,&old_mask,NULL);
+#endif
DBUG_RETURN(1);
}
if (alarm_aborted < 0)
@@ -179,14 +186,14 @@ my_bool thr_alarm(thr_alarm_t *alrm, uint sec, ALARM *alarm_data)
fprintf(stderr,"Warning: thr_alarm queue is full\n");
*alrm= 0; /* No alarm */
pthread_mutex_unlock(&LOCK_alarm);
+#ifndef USE_ONE_SIGNAL_HAND
pthread_sigmask(SIG_SETMASK,&old_mask,NULL);
+#endif
DBUG_RETURN(1);
}
max_used_alarms=alarm_queue.elements+1;
}
- reschedule= (!alarm_queue.elements ||
- (int) (((ALARM*) queue_top(&alarm_queue))->expire_time - now) >
- (int) sec);
+ reschedule= (ulong) next_alarm_expire_time > (ulong) now + sec;
if (!alarm_data)
{
if (!(alarm_data=(ALARM*) my_malloc(sizeof(ALARM),MYF(MY_WME))))
@@ -194,7 +201,9 @@ my_bool thr_alarm(thr_alarm_t *alrm, uint sec, ALARM *alarm_data)
DBUG_PRINT("info", ("failed my_malloc()"));
*alrm= 0; /* No alarm */
pthread_mutex_unlock(&LOCK_alarm);
+#ifndef USE_ONE_SIGNAL_HAND
pthread_sigmask(SIG_SETMASK,&old_mask,NULL);
+#endif
DBUG_RETURN(1);
}
alarm_data->malloced=1;
@@ -205,19 +214,24 @@ my_bool thr_alarm(thr_alarm_t *alrm, uint sec, ALARM *alarm_data)
alarm_data->alarmed=0;
alarm_data->thread= current_my_thread_var->pthread_self;
alarm_data->thread_id= current_my_thread_var->id;
- queue_insert(&alarm_queue,(byte*) alarm_data);
+ queue_insert(&alarm_queue,(uchar*) alarm_data);
/* Reschedule alarm if the current one has more than sec left */
if (reschedule)
{
DBUG_PRINT("info", ("reschedule"));
if (pthread_equal(pthread_self(),alarm_thread))
+ {
alarm(sec); /* purecov: inspected */
+ next_alarm_expire_time= now + sec;
+ }
else
reschedule_alarms(); /* Reschedule alarms */
}
pthread_mutex_unlock(&LOCK_alarm);
+#ifndef USE_ONE_SIGNAL_HAND
pthread_sigmask(SIG_SETMASK,&old_mask,NULL);
+#endif
(*alrm)= &alarm_data->alarmed;
DBUG_RETURN(0);
}
@@ -230,21 +244,25 @@ my_bool thr_alarm(thr_alarm_t *alrm, uint sec, ALARM *alarm_data)
void thr_end_alarm(thr_alarm_t *alarmed)
{
ALARM *alarm_data;
+#ifndef USE_ONE_SIGNAL_HAND
sigset_t old_mask;
+#endif
uint i, found=0;
DBUG_ENTER("thr_end_alarm");
+#ifndef USE_ONE_SIGNAL_HAND
pthread_sigmask(SIG_BLOCK,&full_signal_set,&old_mask);
+#endif
pthread_mutex_lock(&LOCK_alarm);
- alarm_data= (ALARM*) ((byte*) *alarmed - offsetof(ALARM,alarmed));
+ alarm_data= (ALARM*) ((uchar*) *alarmed - offsetof(ALARM,alarmed));
for (i=0 ; i < alarm_queue.elements ; i++)
{
if ((ALARM*) queue_element(&alarm_queue,i) == alarm_data)
{
queue_remove(&alarm_queue,i),MYF(0);
if (alarm_data->malloced)
- my_free((gptr) alarm_data,MYF(0));
+ my_free((uchar*) alarm_data,MYF(0));
found++;
#ifdef DBUG_OFF
break;
@@ -261,7 +279,9 @@ void thr_end_alarm(thr_alarm_t *alarmed)
(long) *alarmed));
}
pthread_mutex_unlock(&LOCK_alarm);
+#ifndef USE_ONE_SIGNAL_HAND
pthread_sigmask(SIG_SETMASK,&old_mask,NULL);
+#endif
DBUG_VOID_RETURN;
}
@@ -351,7 +371,7 @@ static sig_handler process_alarm_part2(int sig __attribute__((unused)))
}
else
{
- ulong now=(ulong) time((time_t*) 0);
+ ulong now=(ulong) my_time(0);
ulong next=now+10-(now%10);
while ((alarm_data=(ALARM*) queue_top(&alarm_queue))->expire_time <= now)
{
@@ -380,10 +400,18 @@ static sig_handler process_alarm_part2(int sig __attribute__((unused)))
alarm(0); /* Remove old alarm */
#endif
alarm((uint) (alarm_data->expire_time-now));
+ next_alarm_expire_time= alarm_data->expire_time;
}
#endif
}
}
+ else
+ {
+ /*
+ Ensure that next time we call thr_alarm(), we will schedule a new alarm
+ */
+ next_alarm_expire_time= ~(time_t) 0;
+ }
DBUG_VOID_RETURN;
}
@@ -464,7 +492,7 @@ void thr_alarm_kill(my_thread_id thread_id)
{
ALARM *tmp=(ALARM*) queue_remove(&alarm_queue,i);
tmp->expire_time=0;
- queue_insert(&alarm_queue,(byte*) tmp);
+ queue_insert(&alarm_queue,(uchar*) tmp);
reschedule_alarms();
break;
}
@@ -480,7 +508,7 @@ void thr_alarm_info(ALARM_INFO *info)
info->max_used_alarms= max_used_alarms;
if ((info->active_alarms= alarm_queue.elements))
{
- ulong now=(ulong) time((time_t*) 0);
+ ulong now=(ulong) my_time(0);
long time_diff;
ALARM *alarm_data= (ALARM*) queue_top(&alarm_queue);
time_diff= (long) (alarm_data->expire_time - now);
@@ -528,7 +556,7 @@ static void *alarm_handler(void *arg __attribute__((unused)))
{
if (alarm_queue.elements)
{
- ulong sleep_time,now=time((time_t*) 0);
+ ulong sleep_time,now= my_time(0);
if (alarm_aborted)
sleep_time=now+1;
else
@@ -537,6 +565,7 @@ static void *alarm_handler(void *arg __attribute__((unused)))
{
abstime.tv_sec=sleep_time;
abstime.tv_nsec=0;
+ next_alarm_expire_time= sleep_time;
if ((error=pthread_cond_timedwait(&COND_alarm,&LOCK_alarm,&abstime)) &&
error != ETIME && error != ETIMEDOUT)
{
@@ -549,12 +578,16 @@ static void *alarm_handler(void *arg __attribute__((unused)))
}
else if (alarm_aborted == -1)
break;
- else if ((error=pthread_cond_wait(&COND_alarm,&LOCK_alarm)))
+ else
{
+ next_alarm_expire_time= ~ (time_t) 0;
+ if ((error=pthread_cond_wait(&COND_alarm,&LOCK_alarm)))
+ {
#ifdef MAIN
- printf("Got error: %d from ptread_cond_wait (errno: %d)\n",
- error,errno);
+ printf("Got error: %d from ptread_cond_wait (errno: %d)\n",
+ error,errno);
#endif
+ }
}
process_alarm(0);
}
@@ -685,7 +718,7 @@ static void *test_thread(void *arg)
for (i=1 ; i <= 10 ; i++)
{
wait_time=param ? 11-i : i;
- start_time=time((time_t*) 0);
+ start_time= my_time(0);
if (thr_alarm(&got_alarm,wait_time,0))
{
printf("Thread: %s Alarms aborted\n",my_thread_name());
@@ -747,7 +780,7 @@ static void *test_thread(void *arg)
}
}
printf("Thread: %s Slept for %d (%d) sec\n",my_thread_name(),
- (int) (time((time_t*) 0)-start_time), wait_time); fflush(stdout);
+ (int) (my_time(0)-start_time), wait_time); fflush(stdout);
thr_end_alarm(&got_alarm);
fflush(stdout);
}
@@ -755,7 +788,7 @@ static void *test_thread(void *arg)
thread_count--;
VOID(pthread_cond_signal(&COND_thread_count)); /* Tell main we are ready */
pthread_mutex_unlock(&LOCK_thread_count);
- free((gptr) arg);
+ free((uchar*) arg);
return 0;
}
diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c
index 94c34eef2fa..a81ed925562 100644
--- a/mysys/thr_lock.c
+++ b/mysys/thr_lock.c
@@ -384,6 +384,9 @@ static inline my_bool have_specific_lock(THR_LOCK_DATA *data,
}
+static void wake_up_waiters(THR_LOCK *lock);
+
+
static enum enum_thr_lock_result
wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data,
my_bool in_wait_list)
@@ -445,8 +448,13 @@ wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data,
else
wait->last=data->prev;
data->type= TL_UNLOCK; /* No lock */
+ check_locks(data->lock, "killed or timed out wait_for_lock", 1);
+ wake_up_waiters(data->lock);
+ }
+ else
+ {
+ check_locks(data->lock, "aborted wait_for_lock", 0);
}
- check_locks(data->lock,"failed wait_for_lock",0);
}
else
{
@@ -776,6 +784,26 @@ void thr_unlock(THR_LOCK_DATA *data)
lock->read_no_write_count--;
data->type=TL_UNLOCK; /* Mark unlocked */
check_locks(lock,"after releasing lock",1);
+ wake_up_waiters(lock);
+ pthread_mutex_unlock(&lock->mutex);
+ DBUG_VOID_RETURN;
+}
+
+
+/**
+ @brief Wake up all threads which pending requests for the lock
+ can be satisfied.
+
+ @param lock Lock for which threads should be woken up
+
+*/
+
+static void wake_up_waiters(THR_LOCK *lock)
+{
+ THR_LOCK_DATA *data;
+ enum thr_lock_type lock_type;
+
+ DBUG_ENTER("wake_up_waiters");
if (!lock->write.data) /* If no active write locks */
{
@@ -827,11 +855,7 @@ void thr_unlock(THR_LOCK_DATA *data)
data=lock->write_wait.data; /* Free this too */
}
if (data->type >= TL_WRITE_LOW_PRIORITY)
- {
- check_locks(lock,"giving write lock",0);
- pthread_mutex_unlock(&lock->mutex);
- DBUG_VOID_RETURN;
- }
+ goto end;
/* Release possible read locks together with the write lock */
}
if (lock->read_wait.data)
@@ -886,8 +910,7 @@ void thr_unlock(THR_LOCK_DATA *data)
free_all_read_locks(lock,0);
}
end:
- check_locks(lock,"thr_unlock",0);
- pthread_mutex_unlock(&lock->mutex);
+ check_locks(lock, "after waking up waiters", 0);
DBUG_VOID_RETURN;
}
@@ -899,7 +922,7 @@ end:
*/
-#define LOCK_CMP(A,B) ((byte*) (A->lock) - (uint) ((A)->type) < (byte*) (B->lock)- (uint) ((B)->type))
+#define LOCK_CMP(A,B) ((uchar*) (A->lock) - (uint) ((A)->type) < (uchar*) (B->lock)- (uint) ((B)->type))
static void sort_locks(THR_LOCK_DATA **data,uint count)
{
@@ -1101,6 +1124,7 @@ my_bool thr_abort_locks_for_thread(THR_LOCK *lock, my_thread_id thread_id)
lock->write_wait.last= data->prev;
}
}
+ wake_up_waiters(lock);
pthread_mutex_unlock(&lock->mutex);
DBUG_RETURN(found);
}
@@ -1600,7 +1624,7 @@ static void *test_thread(void *arg)
thread_count--;
VOID(pthread_cond_signal(&COND_thread_count)); /* Tell main we are ready */
pthread_mutex_unlock(&LOCK_thread_count);
- free((gptr) arg);
+ free((uchar*) arg);
return 0;
}
diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c
index 007bae2accf..e7a927e562a 100644
--- a/mysys/thr_mutex.c
+++ b/mysys/thr_mutex.c
@@ -394,15 +394,11 @@ ulong mutex_delay(ulong delayloops)
#define MY_PTHREAD_FASTMUTEX_SPINS 8
#define MY_PTHREAD_FASTMUTEX_DELAY 4
+static int cpu_count= 0;
+
int my_pthread_fastmutex_init(my_pthread_fastmutex_t *mp,
const pthread_mutexattr_t *attr)
{
- static int cpu_count= 0;
-#ifdef _SC_NPROCESSORS_CONF
- if (!cpu_count && (attr == MY_MUTEX_INIT_FAST))
- cpu_count= sysconf(_SC_NPROCESSORS_CONF);
-#endif
-
if ((cpu_count > 1) && (attr == MY_MUTEX_INIT_FAST))
mp->spins= MY_PTHREAD_FASTMUTEX_SPINS;
else
@@ -432,4 +428,13 @@ int my_pthread_fastmutex_lock(my_pthread_fastmutex_t *mp)
}
return pthread_mutex_lock(&mp->mutex);
}
+
+
+void fastmutex_global_init(void)
+{
+#ifdef _SC_NPROCESSORS_CONF
+ cpu_count= sysconf(_SC_NPROCESSORS_CONF);
+#endif
+}
+
#endif /* defined(THREAD) && defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX) */
diff --git a/mysys/tree.c b/mysys/tree.c
index 2e6868e0777..ef33f75b7c6 100644
--- a/mysys/tree.c
+++ b/mysys/tree.c
@@ -93,7 +93,7 @@ void init_tree(TREE *tree, ulong default_alloc_size, ulong memory_limit,
if (default_alloc_size < DEFAULT_ALLOC_SIZE)
default_alloc_size= DEFAULT_ALLOC_SIZE;
default_alloc_size= MY_ALIGN(default_alloc_size, DEFAULT_ALIGN_SIZE);
- bzero((gptr) &tree->null_element,sizeof(tree->null_element));
+ bzero((uchar*) &tree->null_element,sizeof(tree->null_element));
tree->root= &tree->null_element;
tree->compare=compare;
tree->size_of_element=size > 0 ? (uint) size : 0;
@@ -247,12 +247,12 @@ TREE_ELEMENT *tree_insert(TREE *tree, void *key, uint key_size,
else
{
*((void**) (element+1))= (void*) ((void **) (element+1)+1);
- memcpy((byte*) *((void **) (element+1)),key,
+ memcpy((uchar*) *((void **) (element+1)),key,
(size_t) (key_size-sizeof(void*)));
}
}
else
- memcpy((byte*) element+tree->offset_to_key,key,(size_t) key_size);
+ memcpy((uchar*) element+tree->offset_to_key,key,(size_t) key_size);
element->count=1; /* May give warning in purify */
tree->elements_in_tree++;
rb_insert(tree,parent,element); /* rebalance tree */
@@ -326,7 +326,7 @@ int tree_delete(TREE *tree, void *key, uint key_size, void *custom_arg)
if (tree->free)
(*tree->free)(ELEMENT_KEY(tree,element), free_free, tree->custom_arg);
tree->allocated-= sizeof(TREE_ELEMENT) + tree->size_of_element + key_size;
- my_free((gptr) element,MYF(0));
+ my_free((uchar*) element,MYF(0));
tree->elements_in_tree--;
return 0;
}
diff --git a/mysys/trie.c b/mysys/trie.c
index 8daa6f3e661..5738b9b866b 100644
--- a/mysys/trie.c
+++ b/mysys/trie.c
@@ -101,7 +101,7 @@ void trie_free (TRIE *trie)
/*
SYNOPSIS
- my_bool trie_insert (TRIE *trie, const byte *key, uint keylen);
+ my_bool trie_insert (TRIE *trie, const uchar *key, uint keylen);
trie - valid pointer to `TRIE'
key - valid pointer to key to insert
keylen - non-0 key length
@@ -118,11 +118,11 @@ void trie_free (TRIE *trie)
However it can be freed with trie_free().
*/
-my_bool trie_insert (TRIE *trie, const byte *key, uint keylen)
+my_bool trie_insert (TRIE *trie, const uchar *key, uint keylen)
{
TRIE_NODE *node;
TRIE_NODE *next;
- byte p;
+ uchar p;
uint k;
DBUG_ENTER("trie_insert");
DBUG_ASSERT(trie && key && keylen);
@@ -211,7 +211,7 @@ my_bool ac_trie_prepare (TRIE *trie)
fail= fail->fail;
}
}
- my_free((gptr)tmp_nodes, MYF(0));
+ my_free((uchar*)tmp_nodes, MYF(0));
DBUG_RETURN(FALSE);
}
diff --git a/mysys/typelib.c b/mysys/typelib.c
index a3b669d2e54..e745a9fb917 100644
--- a/mysys/typelib.c
+++ b/mysys/typelib.c
@@ -20,12 +20,14 @@
#include <m_ctype.h>
+static const char field_separator=',';
+
int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option)
{
int res;
const char **ptr;
- if ((res= find_type((my_string) x, typelib, 2)) <= 0)
+ if ((res= find_type((char *) x, typelib, 2)) <= 0)
{
ptr= typelib->type_names;
if (!*x)
@@ -53,6 +55,7 @@ int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option)
If & 1 accept only whole names
If & 2 don't expand if half field
If & 4 allow #number# as type
+ If & 8 use ',' as string terminator
NOTES
If part, uniq field is found and full_name == 0 then x is expanded
@@ -64,10 +67,11 @@ int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option)
>0 Offset+1 in typelib for matched string
*/
+
int find_type(char *x, const TYPELIB *typelib, uint full_name)
{
int find,pos,findpos;
- reg1 my_string i;
+ reg1 char * i;
reg2 const char *j;
DBUG_ENTER("find_type");
DBUG_PRINT("enter",("x: '%s' lib: 0x%lx", x, (long) typelib));
@@ -82,16 +86,18 @@ int find_type(char *x, const TYPELIB *typelib, uint full_name)
for (pos=0 ; (j=typelib->type_names[pos]) ; pos++)
{
for (i=x ;
- *i && my_toupper(&my_charset_latin1,*i) ==
+ *i && (!(full_name & 8) || *i != field_separator) &&
+ my_toupper(&my_charset_latin1,*i) ==
my_toupper(&my_charset_latin1,*j) ; i++, j++) ;
if (! *j)
{
while (*i == ' ')
i++; /* skip_end_space */
- if (! *i)
+ if (! *i || ((full_name & 8) && *i == field_separator))
DBUG_RETURN(pos+1);
}
- if (! *i && (!*j || !(full_name & 1)))
+ if ((!*i && (!(full_name & 8) || *i != field_separator)) &&
+ (!*j || !(full_name & 1)))
{
find++;
findpos=pos;
@@ -119,7 +125,7 @@ int find_type(char *x, const TYPELIB *typelib, uint full_name)
/* Get name of type nr 'nr' */
/* Warning first type is 1, 0 = empty field */
-void make_type(register my_string to, register uint nr,
+void make_type(register char * to, register uint nr,
register TYPELIB *typelib)
{
DBUG_ENTER("make_type");
@@ -143,6 +149,50 @@ const char *get_type(TYPELIB *typelib, uint nr)
/*
+ Create an integer value to represent the supplied comma-seperated
+ string where each string in the TYPELIB denotes a bit position.
+
+ SYNOPSIS
+ find_typeset()
+ x string to decompose
+ lib TYPELIB (struct of pointer to values + count)
+ err index (not char position) of string element which was not
+ found or 0 if there was no error
+
+ RETURN
+ a integer representation of the supplied string
+*/
+
+my_ulonglong find_typeset(char *x, TYPELIB *lib, int *err)
+{
+ my_ulonglong result;
+ int find;
+ char *i;
+ DBUG_ENTER("find_set");
+ DBUG_PRINT("enter",("x: '%s' lib: 0x%lx", x, (long) lib));
+
+ if (!lib->count)
+ {
+ DBUG_PRINT("exit",("no count"));
+ DBUG_RETURN(0);
+ }
+ result= 0;
+ *err= 0;
+ while (*x)
+ {
+ (*err)++;
+ i= x;
+ while (*x && *x != field_separator) x++;
+ if ((find= find_type(i, lib, 2 | 8) - 1) < 0)
+ DBUG_RETURN(0);
+ result|= (ULL(1) << find);
+ }
+ *err= 0;
+ DBUG_RETURN(result);
+} /* find_set */
+
+
+/*
Create a copy of a specified TYPELIB structure.
SYNOPSIS
diff --git a/netware/BUILD/compile-netware-END b/netware/BUILD/compile-netware-END
index 6c531ab5c7c..bf712f09162 100755
--- a/netware/BUILD/compile-netware-END
+++ b/netware/BUILD/compile-netware-END
@@ -29,8 +29,15 @@ fi
# configure
./configure $base_configs $extra_configs
-# make
-make clean bin-dist
+# Ensure a clean tree
+make clean
+
+# Link NetWare specific .def files into their proper locations
+# in the source tree
+( cd netware && make link_sources )
+
+# Now, do the real build
+make bin-dist
# mark the build
for file in *.tar.gz *.zip
diff --git a/netware/Makefile.am b/netware/Makefile.am
index df0072b3a2b..64467a41777 100644
--- a/netware/Makefile.am
+++ b/netware/Makefile.am
@@ -43,10 +43,15 @@ netware_build_files = client/mysql.def client/mysqladmin.def \
storage/myisam/myisampack.def \
storage/myisam/myisam_ftdump.def
+BUILT_SOURCES = link_sources init_db.sql test_db.sql
+CLEANFILES = $(BUILT_SOURCES)
+
+all: $(BUILT_SOURCES)
+
link_sources:
for f in $(netware_build_files); do \
rm -f ../$$f; \
- org=`echo $$f | sed -e 's/.*\/\(.*\)/\1/g'`; \
+ org=`basename $$f`; \
@LN_CP_F@ $(srcdir)/$$org ../$$f; \
done
echo timestamp > link_sources
@@ -83,7 +88,7 @@ EXTRA_DIST= $(BUILT_SOURCES) comp_err.def install_test_db.ncf \
perror.def \
mysql_client_test.def \
replace.def resolve_stack_dump.def resolveip.def \
- static_init_db.sql \
+ static_init_db.sql init_db.sql test_db.sql \
BUILD/apply-patch BUILD/compile-AUTOTOOLS \
BUILD/compile-linux-tools BUILD/compile-netware-END \
BUILD/compile-netware-START BUILD/compile-netware-all\
@@ -94,6 +99,8 @@ EXTRA_DIST= $(BUILT_SOURCES) comp_err.def install_test_db.ncf \
BUILD/mwasmnlm BUILD/mwccnlm BUILD/mwenv BUILD/mwldnlm \
BUILD/nwbootstrap BUILD/openssl.imp BUILD/save-patch
+endif
+
# Build init_db.sql from the files that contain
# the system tables for this version of MySQL plus any commands
@@ -111,9 +118,7 @@ init_db.sql: $(top_srcdir)/scripts/mysql_system_tables.sql \
test_db.sql: init_db.sql $(top_srcdir)/scripts/mysql_test_data_timezone.sql
@echo "Building $@";
@cat init_db.sql \
- $(top_srcdir)/scripts/mysql_test_data_timezone.sql >> $@;
-
-endif
+ $(top_srcdir)/scripts/mysql_test_data_timezone.sql > $@;
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/netware/isamchk.def b/netware/isamchk.def
deleted file mode 100644
index 8ae2c0ca96c..00000000000
--- a/netware/isamchk.def
+++ /dev/null
@@ -1,12 +0,0 @@
-#------------------------------------------------------------------------------
-# ISAM Check
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-SCREENNAME "MySQL ISAM Table Check Tool"
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL ISAM Table Check Tool"
-VERSION 4, 0
-STACKSIZE 131072
-XDCDATA ../netware/mysql.xdc
-#DEBUG
-
diff --git a/netware/isamlog.def b/netware/isamlog.def
deleted file mode 100644
index 777d73a7835..00000000000
--- a/netware/isamlog.def
+++ /dev/null
@@ -1,11 +0,0 @@
-#------------------------------------------------------------------------------
-# ISAM Log
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL ISAM Table Log Tool"
-VERSION 4, 0
-STACKSIZE 131072
-XDCDATA ../netware/mysql.xdc
-#DEBUG
-
diff --git a/netware/pack_isam.def b/netware/pack_isam.def
deleted file mode 100644
index 514b57b04bd..00000000000
--- a/netware/pack_isam.def
+++ /dev/null
@@ -1,13 +0,0 @@
-#------------------------------------------------------------------------------
-# Pack ISAM
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-SCREENNAME "MySQL ISAM Table Pack Tool"
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL ISAM Table Pack Tool"
-SCREENNAME "MySQL ISAM Table Pack Tool"
-VERSION 4, 0
-STACKSIZE 131072
-XDCDATA ../netware/mysql.xdc
-#DEBUG
-
diff --git a/plugin/Makefile.am b/plugin/Makefile.am
index b58f85f9777..22f6bfd88b2 100644
--- a/plugin/Makefile.am
+++ b/plugin/Makefile.am
@@ -22,6 +22,7 @@ AUTOMAKE_OPTIONS = foreign
EXTRA_DIST = fulltext/configure.in
SUBDIRS = @mysql_pg_dirs@
+DIST_SUBDIRS = daemon_example fulltext
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/plugin/daemon_example/Makefile.am b/plugin/daemon_example/Makefile.am
index 21a86f8973e..92b1ab040fb 100644
--- a/plugin/daemon_example/Makefile.am
+++ b/plugin/daemon_example/Makefile.am
@@ -36,3 +36,6 @@ noinst_LIBRARIES = @plugin_daemon_example_static_target@
libdaemon_example_a_CXXFLAGS = $(AM_CFLAGS)
libdaemon_example_a_CFLAGS = $(AM_CFLAGS)
libdaemon_example_a_SOURCES= daemon_example.cc
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/plugin/daemon_example/daemon_example.cc b/plugin/daemon_example/daemon_example.cc
index 994c385796e..af585bb4302 100644
--- a/plugin/daemon_example/daemon_example.cc
+++ b/plugin/daemon_example/daemon_example.cc
@@ -60,7 +60,7 @@ pthread_handler_t mysql_heartbeat(void *p)
tm_tmp.tm_hour,
tm_tmp.tm_min,
tm_tmp.tm_sec);
- my_write(con->heartbeat_file, buffer, strlen(buffer), MYF(0));
+ my_write(con->heartbeat_file, (uchar*) buffer, strlen(buffer), MYF(0));
x++;
}
@@ -114,7 +114,7 @@ static int daemon_example_plugin_init(void *p)
tm_tmp.tm_hour,
tm_tmp.tm_min,
tm_tmp.tm_sec);
- my_write(con->heartbeat_file, buffer, strlen(buffer), MYF(0));
+ my_write(con->heartbeat_file, (uchar*) buffer, strlen(buffer), MYF(0));
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr,
@@ -168,7 +168,7 @@ static int daemon_example_plugin_deinit(void *p)
tm_tmp.tm_hour,
tm_tmp.tm_min,
tm_tmp.tm_sec);
- my_write(con->heartbeat_file, buffer, strlen(buffer), MYF(0));
+ my_write(con->heartbeat_file, (uchar*) buffer, strlen(buffer), MYF(0));
my_close(con->heartbeat_file, MYF(0));
my_free((char *)con, MYF(0));
diff --git a/plugin/fulltext/Makefile.am b/plugin/fulltext/Makefile.am
index d4ec097efbd..ec033018a00 100644
--- a/plugin/fulltext/Makefile.am
+++ b/plugin/fulltext/Makefile.am
@@ -22,3 +22,6 @@ pkglib_LTLIBRARIES= mypluglib.la
mypluglib_la_SOURCES= plugin_example.c
mypluglib_la_LDFLAGS= -module -rpath $(pkglibdir)
mypluglib_la_CFLAGS= -DMYSQL_DYNAMIC_PLUGIN
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/plugin/fulltext/plugin_example.c b/plugin/fulltext/plugin_example.c
index c38498fb9e8..70022da2cc4 100644
--- a/plugin/fulltext/plugin_example.c
+++ b/plugin/fulltext/plugin_example.c
@@ -216,6 +216,41 @@ static struct st_mysql_show_var simple_status[]=
};
/*
+ Plugin system variables.
+*/
+
+static long sysvar_one_value;
+static char *sysvar_two_value;
+
+static MYSQL_SYSVAR_LONG(simple_sysvar_one, sysvar_one_value,
+ PLUGIN_VAR_RQCMDARG,
+ "Simple fulltext parser example system variable number one. Give a number.",
+ NULL, NULL, 77L, 7L, 777L, 0);
+
+static MYSQL_SYSVAR_STR(simple_sysvar_two, sysvar_two_value,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC,
+ "Simple fulltext parser example system variable number two. Give a string.",
+ NULL, NULL, "simple sysvar two default");
+
+static MYSQL_THDVAR_LONG(simple_thdvar_one,
+ PLUGIN_VAR_RQCMDARG,
+ "Simple fulltext parser example thread variable number one. Give a number.",
+ NULL, NULL, 88L, 8L, 888L, 0);
+
+static MYSQL_THDVAR_STR(simple_thdvar_two,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC,
+ "Simple fulltext parser example thread variable number two. Give a string.",
+ NULL, NULL, "simple thdvar two default");
+
+static struct st_mysql_sys_var* simple_system_variables[]= {
+ MYSQL_SYSVAR(simple_sysvar_one),
+ MYSQL_SYSVAR(simple_sysvar_two),
+ MYSQL_SYSVAR(simple_thdvar_one),
+ MYSQL_SYSVAR(simple_thdvar_two),
+ NULL
+};
+
+/*
Plugin library descriptor
*/
@@ -231,8 +266,8 @@ mysql_declare_plugin(ftexample)
simple_parser_plugin_deinit,/* deinit function (when unloaded) */
0x0001, /* version */
simple_status, /* status variables */
- NULL, /* system variables */
- NULL /* config options */
+ simple_system_variables, /* system variables */
+ NULL
}
mysql_declare_plugin_end;
diff --git a/pstack/Makefile.am b/pstack/Makefile.am
index 70973bd36b0..870fed6ceeb 100644
--- a/pstack/Makefile.am
+++ b/pstack/Makefile.am
@@ -19,17 +19,14 @@
#
SUBDIRS = aout
+
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include
-noinst_HEADERS = bucomm.h debug.h ieee.h budbg.h demangle.h \
- linuxthreads.h pstack.h pstacktrace.h
-SRC= bucomm.c filemode.c linuxthreads.c rddbg.c \
- debug.c ieee.c pstack.c stabs.c
-EXTRA_DIST= $(SRC)
-if COMPILE_PSTACK
pkglib_LIBRARIES = libpstack.a
-libpstack_a_SOURCES = bucomm.c filemode.c linuxthreads.c rddbg.c debug.c ieee.c pstack.c stabs.c
-endif
+libpstack_a_SOURCES = bucomm.c filemode.c linuxthreads.c rddbg.c \
+ debug.c ieee.c pstack.c stabs.c
+noinst_HEADERS = bucomm.h debug.h ieee.h budbg.h demangle.h \
+ linuxthreads.h pstack.h pstacktrace.h
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/regex/CMakeLists.txt b/regex/CMakeLists.txt
index 9b95c9d2bc6..a3088c00357 100644..100755
--- a/regex/CMakeLists.txt
+++ b/regex/CMakeLists.txt
@@ -17,4 +17,9 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
-ADD_LIBRARY(regex debug.c regcomp.c regerror.c regexec.c regfree.c reginit.c split.c)
+
+SET(REGEX_SOURCES debug.c regcomp.c regerror.c regexec.c regfree.c reginit.c split.c)
+
+IF(NOT SOURCE_SUBLIBS)
+ ADD_LIBRARY(regex ${REGEX_SOURCES})
+ENDIF(NOT SOURCE_SUBLIBS)
diff --git a/regex/regcomp.c b/regex/regcomp.c
index 9cba56a97dd..398e132d97d 100644
--- a/regex/regcomp.c
+++ b/regex/regcomp.c
@@ -1479,8 +1479,8 @@ sopno pos;
}
{
int length=(HERE()-pos-1)*sizeof(sop);
- bmove_upp((char *) &p->strip[pos+1]+length,
- (char *) &p->strip[pos]+length,
+ bmove_upp((uchar *) &p->strip[pos+1]+length,
+ (uchar *) &p->strip[pos]+length,
length);
}
#ifdef OLD_CODE
diff --git a/regex/reginit.c b/regex/reginit.c
index f0b53e64be3..8347c4f6895 100644
--- a/regex/reginit.c
+++ b/regex/reginit.c
@@ -16,7 +16,7 @@ void my_regex_init(CHARSET_INFO *cs)
if (!regex_inited)
{
regex_inited=1;
- bzero((gptr) &count,sizeof(count));
+ bzero((uchar*) &count,sizeof(count));
for (i=1 ; i<= 255; i++)
{
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
index e9113b098da..6fbfcab72d4 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 dbug mysys strings)
+TARGET_LINK_LIBRARIES(comp_sql debug 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/Makefile.am b/scripts/Makefile.am
index 0507385500e..fed96490397 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -90,6 +90,9 @@ CLEANFILES = @server_scripts@ \
mysql_tableinfo \
mysqld_multi
+# Default same as 'pkgdatadir', but we can override it
+pkgsuppdir = $(datadir)/@PACKAGE@
+
# mysqlbug should be distributed built so that people can report build
# failures with it.
DISTCLEANFILES = $(BUILT_SOURCES) mysqlbug
@@ -134,7 +137,10 @@ SUFFIXES = .sh
-e 's!@''pkglibdir''@!$(pkglibdir)!g' \
-e 's!@''pkgincludedir''@!$(pkgincludedir)!g' \
-e 's!@''pkgdatadir''@!$(pkgdatadir)!g' \
+ -e 's!@''pkgsuppdir''@!$(pkgsuppdir)!g' \
-e 's!@''sysconfdir''@!$(sysconfdir)!g' \
+ -e 's!@''mandir''@!$(mandir)!g' \
+ -e 's!@''infodir''@!$(infodir)!g' \
-e 's!@''CC''@!@CC@!'\
-e 's!@''CXX''@!@CXX@!'\
-e 's!@''GXX''@!@GXX@!'\
diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh
index 83d7e237a54..8d3e2133a45 100644
--- a/scripts/make_binary_distribution.sh
+++ b/scripts/make_binary_distribution.sh
@@ -14,36 +14,59 @@
# 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 a script to create a TAR or ZIP binary distribution out of a
-# built source tree. The output file will be put at the top level of
-# the source tree, as "mysql-<vsn>....{tar.gz,zip}"
+##############################################################################
#
-# The temporary directory path given to "--tmp=<path>" has to be
-# absolute and with no spaces.
+# This is a script to create a TAR or ZIP binary distribution out of a
+# built source tree. The output file will be put at the top level of
+# the source tree, as "mysql-<vsn>....{tar.gz,zip}"
+#
+# Note that the structure created by this script is slightly different from
+# what a normal "make install" would produce. No extra "mysql" sub directory
+# will be created, i.e. no "$prefix/include/mysql", "$prefix/lib/mysql" or
+# "$prefix/share/mysql".
+#
+# In GNU make/automake terms
+#
+# "pkglibdir" is set to the same as "libdir"
+# "pkgincludedir" is set to the same as "includedir"
+# "pkgdatadir" is set to the same as "datadir"
+# "pkgsuppdir" is set to "@prefix@/support-files",
+# normally the same as "datadir"
+#
+# The temporary directory path given to "--tmp=<path>" has to be
+# absolute and with no spaces.
+#
+# Note that for best result, the original "make" should be done with
+# the same arguments as used for "make install" below, especially the
+# 'pkglibdir', as the RPATH should to be set correctly.
+#
+##############################################################################
+
+##############################################################################
+#
+# Read the command line arguments that control this script
+#
+##############################################################################
machine=@MACHINE_TYPE@
system=@SYSTEM_TYPE@
-version=@VERSION@
SOURCE=`pwd`
CP="cp -p"
MV="mv"
-STRIP=1
-DEBUG=0
+STRIP=1 # Option ignored
SILENT=0
-MACHINE=""
PLATFORM=""
TMP=/tmp
SUFFIX=""
-NDBCLUSTER=""
+NDBCLUSTER="" # Option ignored
for arg do
case "$arg" in
- --debug) DEBUG=1;;
--tmp=*) TMP=`echo "$arg" | sed -e "s;--tmp=;;"` ;;
--suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;;
--no-strip) STRIP=0 ;;
- --machine=*) MACHINE=`echo "$arg" | sed -e "s;--machine=;;"` ;;
+ --machine=*) machine=`echo "$arg" | sed -e "s;--machine=;;"` ;;
--platform=*) PLATFORM=`echo "$arg" | sed -e "s;--platform=;;"` ;;
--silent) SILENT=1 ;;
--with-ndbcluster) NDBCLUSTER=1 ;;
@@ -54,88 +77,222 @@ for arg do
esac
done
-# Avoid too long command lines for cp (bug#27489)
-MCP() {
- for i
- do
- last=$i
- done
- for i
+# ----------------------------------------------------------------------
+# Adjust "system" output from "uname" to be more human readable
+# ----------------------------------------------------------------------
+
+if [ x"$PLATFORM" = x"" ] ; then
+ # FIXME move this to the build tools
+ # Remove vendor from $system
+ system=`echo $system | sed -e 's/[a-z]*-\(.*\)/\1/g'`
+
+ # Map OS names to "our" OS names (eg. darwin6.8 -> osx10.2)
+ system=`echo $system | sed -e 's/darwin6.*/osx10.2/g'`
+ system=`echo $system | sed -e 's/darwin7.*/osx10.3/g'`
+ system=`echo $system | sed -e 's/darwin8.*/osx10.4/g'`
+ system=`echo $system | sed -e 's/\(aix4.3\).*/\1/g'`
+ system=`echo $system | sed -e 's/\(aix5.1\).*/\1/g'`
+ system=`echo $system | sed -e 's/\(aix5.2\).*/\1/g'`
+ system=`echo $system | sed -e 's/\(aix5.3\).*/\1/g'`
+ system=`echo $system | sed -e 's/osf5.1b/tru64/g'`
+ system=`echo $system | sed -e 's/linux-gnu/linux/g'`
+ system=`echo $system | sed -e 's/solaris2.\([0-9]*\)/solaris\1/g'`
+ system=`echo $system | sed -e 's/sco3.2v\(.*\)/openserver\1/g'`
+
+ PLATFORM="$system-$machine"
+fi
+
+# Print the platform name for build logs
+echo "PLATFORM NAME: $PLATFORM"
+
+case $PLATFORM in
+ *netware*) BASE_SYSTEM="netware" ;;
+esac
+
+# Change the distribution to a long descriptive name
+NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-@VERSION@-$PLATFORM$SUFFIX
+
+# ----------------------------------------------------------------------
+# Define BASE, and remove the old BASE directory if any
+# ----------------------------------------------------------------------
+BASE=$TMP/my_dist$SUFFIX
+if [ -d $BASE ] ; then
+ rm -rf $BASE
+fi
+
+# ----------------------------------------------------------------------
+# Find the TAR to use
+# ----------------------------------------------------------------------
+
+# This is needed to prefer GNU tar over platform tar because that can't
+# always handle long filenames
+
+PATH_DIRS=`echo $PATH | \
+ sed -e 's/^:/. /' -e 's/:$/ ./' -e 's/::/ . /g' -e 's/:/ /g' `
+
+which_1 ()
+{
+ for cmd
do
- if test "x$i" != "x$last"
- then
- cp -p $i $last
- fi
+ for d in $PATH_DIRS
+ do
+ for file in $d/$cmd
+ do
+ if [ -x $file -a ! -d $file ] ; then
+ echo $file
+ exit 0
+ fi
+ done
+ done
done
+ exit 1
}
-# Remove vendor from $system
-system=`echo $system | sed -e 's/[a-z]*-\(.*\)/\1/g'`
-
-# Map OS names to "our" OS names (eg. darwin6.8 -> osx10.2)
-system=`echo $system | sed -e 's/darwin6.*/osx10.2/g'`
-system=`echo $system | sed -e 's/darwin7.*/osx10.3/g'`
-system=`echo $system | sed -e 's/darwin8.*/osx10.4/g'`
-system=`echo $system | sed -e 's/\(aix4.3\).*/\1/g'`
-system=`echo $system | sed -e 's/\(aix5.1\).*/\1/g'`
-system=`echo $system | sed -e 's/\(aix5.2\).*/\1/g'`
-system=`echo $system | sed -e 's/\(aix5.3\).*/\1/g'`
-system=`echo $system | sed -e 's/osf5.1b/tru64/g'`
-system=`echo $system | sed -e 's/linux-gnu/linux/g'`
-system=`echo $system | sed -e 's/solaris2.\([0-9]*\)/solaris\1/g'`
-system=`echo $system | sed -e 's/sco3.2v\(.*\)/openserver\1/g'`
-
-if [ x"$MACHINE" != x"" ] ; then
- machine=$MACHINE
+tar=`which_1 gnutar gtar`
+if [ $? -ne 0 -o x"$tar" = x"" ] ; then
+ tar=tar
fi
-if [ x"$PLATFORM" != x"" ] ; then
- platform="$PLATFORM"
-else
- platform="$system-$machine"
-fi
-# FIXME This should really be integrated with automake and not duplicate the
-# installation list.
+##############################################################################
+#
+# Handle the Unix/Linux packaging using "make install"
+#
+##############################################################################
+
+if [ x"$BASE_SYSTEM" != x"netware" ] ; then
+
+ # ----------------------------------------------------------------------
+ # Terminate on any base level error
+ # ----------------------------------------------------------------------
+ set -e
+
+ # ----------------------------------------------------------------------
+ # Really ugly, one script, "mysql_install_db", needs prefix set to ".",
+ # i.e. makes access relative the current directory. This matches
+ # the documentation, so better not change this. And for another script,
+ # "mysql.server", we make some relative, others not.
+ # ----------------------------------------------------------------------
+
+ cd scripts
+ rm -f mysql_install_db
+ @MAKE@ mysql_install_db \
+ prefix=. \
+ bindir=./bin \
+ sbindir=./bin \
+ scriptdir=./bin \
+ libexecdir=./bin \
+ pkgdatadir=./share \
+ localstatedir=./data
+ cd ..
+
+ cd support-files
+ rm -f mysql.server
+ @MAKE@ mysql.server \
+ bindir=./bin \
+ sbindir=./bin \
+ scriptdir=./bin \
+ libexecdir=./bin \
+ pkgdatadir=@pkgdatadir@
+ cd ..
+
+ # ----------------------------------------------------------------------
+ # Do a install that we later are to pack. Use the same paths as in
+ # the build for the relevant directories.
+ # ----------------------------------------------------------------------
+ @MAKE@ DESTDIR=$BASE install \
+ pkglibdir=@pkglibdir@ \
+ pkgincludedir=@pkgincludedir@ \
+ pkgdatadir=@pkgdatadir@ \
+ pkgsuppdir=@pkgsuppdir@ \
+ mandir=@mandir@ \
+ infodir=@infodir@
+
+ # ----------------------------------------------------------------------
+ # Rename top directory, and set DEST to the new directory
+ # ----------------------------------------------------------------------
+ mv $BASE@prefix@ $BASE/$NEW_NAME
+ DEST=$BASE/$NEW_NAME
+
+ # ----------------------------------------------------------------------
+ # If we compiled with gcc, copy libgcc.a to the dist as libmygcc.a
+ # ----------------------------------------------------------------------
+ if [ x"@GXX@" = x"yes" ] ; then
+ gcclib=`@CC@ @CFLAGS@ --print-libgcc-file`
+ if [ $? -ne 0 ] ; then
+ echo "Warning: Couldn't find libgcc.a!"
+ else
+ $CP $gcclib $DEST/lib/libmygcc.a
+ fi
+ fi
+
+ # FIXME let this script be in "bin/", where it is in the RPMs?
+ # http://dev.mysql.com/doc/refman/5.1/en/mysql-install-db-problems.html
+ mkdir $DEST/scripts
+ mv $DEST/bin/mysql_install_db $DEST/scripts/
-BASE=$TMP/my_dist$SUFFIX
+ # Note, no legacy "safe_mysqld" link to "mysqld_safe" in 5.1
-if [ -d $BASE ] ; then
- rm -rf $BASE
+ # Copy readme and license files
+ cp README Docs/INSTALL-BINARY $DEST/
+ if [ -f COPYING -a -f EXCEPTIONS-CLIENT ] ; then
+ cp COPYING EXCEPTIONS-CLIENT $DEST/
+ elif [ -f LICENSE.mysql ] ; then
+ cp LICENSE.mysql $DEST/
+ else
+ echo "ERROR: no license files found"
+ exit 1
+ fi
+
+ # FIXME should be handled by make file, and to other dir
+ mkdir -p $DEST/bin $DEST/support-files
+ cp scripts/mysqlaccess.conf $DEST/bin/
+ cp support-files/magic $DEST/support-files/
+
+ # Create empty data directories, set permission (FIXME why?)
+ mkdir $DEST/data $DEST/data/mysql $DEST/data/test
+ chmod o-rwx $DEST/data $DEST/data/mysql $DEST/data/test
+
+ # ----------------------------------------------------------------------
+ # Create the result tar file
+ # ----------------------------------------------------------------------
+
+ echo "Using $tar to create archive"
+ OPT=cvf
+ if [ x$SILENT = x1 ] ; then
+ OPT=cf
+ fi
+
+ echo "Creating and compressing archive"
+ rm -f $NEW_NAME.tar.gz
+ (cd $BASE ; $tar $OPT - $NEW_NAME) | gzip -9 > $NEW_NAME.tar.gz
+ echo "$NEW_NAME.tar.gz created"
+
+ echo "Removing temporary directory"
+ rm -rf $BASE
+ exit 0
fi
-BS=""
-BIN_FILES=""
-BASE_SYSTEM="any"
-MYSQL_SHARE=$BASE/share/mysql
-
-case $system in
- *netware*)
- BASE_SYSTEM="netware"
- BS=".nlm"
- MYSQL_SHARE=$BASE/share
- ;;
-esac
+##############################################################################
+#
+# Handle the Netware case, until integrated above
+#
+##############################################################################
+
+BS=".nlm"
+MYSQL_SHARE=$BASE/share
mkdir $BASE $BASE/bin $BASE/docs \
$BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/scripts \
$BASE/mysql-test $BASE/mysql-test/t $BASE/mysql-test/r \
$BASE/mysql-test/include $BASE/mysql-test/std_data $BASE/mysql-test/lib \
- $BASE/mysql-test/extra \
- $BASE/mysql-test/extra/binlog_tests $BASE/mysql-test/extra/rpl_tests
-
-if [ $BASE_SYSTEM != "netware" ] ; then
- mkdir $BASE/share/mysql $BASE/tests $BASE/sql-bench $BASE/man \
- $BASE/man/man1 $BASE/man/man8 $BASE/data $BASE/data/mysql $BASE/data/test
-
- chmod o-rwx $BASE/data $BASE/data/*
-fi
+ $BASE/mysql-test/suite
# Copy files if they exists, warn for those that don't.
# Note that when listing files to copy, we might list the file name
-# twice, once in the directory location where it is build, and a
-# second time in the ".libs" location. In the case the firs one
+# twice, once in the directory location where it is built, and a
+# second time in the ".libs" location. In the case the first one
# is a wrapper script, the second one will overwrite it with the
# binary file.
copyfileto()
@@ -179,41 +336,16 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \
";
# Platform-specific bin dir files:
-if [ $BASE_SYSTEM = "netware" ] ; then
- BIN_FILES="$BIN_FILES \
+BIN_FILES="$BIN_FILES \
netware/mysqld_safe$BS netware/mysql_install_db$BS \
- netware/init_db.sql netware/test_db.sql$BS \
+ netware/init_db.sql netware/test_db.sql \
netware/mysqlhotcopy$BS netware/libmysql$BS netware/init_secure_db.sql \
";
-# For all other platforms:
-else
- BIN_FILES="$BIN_FILES \
- server-tools/instance-manager/.libs/mysqlmanager \
- client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \
- client/.libs/mysqlslap \
- client/.libs/mysqldump client/.libs/mysqlimport \
- client/.libs/mysqltest client/.libs/mysqlcheck \
- client/.libs/mysqlbinlog \
- tests/.libs/mysql_client_test \
- libmysqld/examples/.libs/mysql_client_test_embedded \
- libmysqld/examples/.libs/mysqltest_embedded \
- ";
-fi
copyfileto $BASE/bin $BIN_FILES
-if [ x$STRIP = x1 ] ; then
- strip $BASE/bin/*
-fi
-
-# Obsolete, starting from 5.1.6-beta
-# # Copy not binary files
-# copyfileto $BASE/bin sql/mysqld.sym.gz
-
-if [ $BASE_SYSTEM = "netware" ] ; then
- $CP netware/*.pl $BASE/scripts
- $CP scripts/mysqlhotcopy $BASE/scripts/mysqlhotcopy.pl
-fi
+$CP netware/*.pl $BASE/scripts
+$CP scripts/mysqlhotcopy $BASE/scripts/mysqlhotcopy.pl
copyfileto $BASE/lib \
libmysql/.libs/libmysqlclient.a \
@@ -235,31 +367,17 @@ copyfileto $BASE/lib \
zlib/.libs/libz.a
# convert the .a to .lib for NetWare
-if [ $BASE_SYSTEM = "netware" ] ; then
- for i in $BASE/lib/*.a
- do
- libname=`basename $i .a`
- $MV $i $BASE/lib/$libname.lib
- done
- rm -f $BASE/lib/*.la
-fi
+for i in $BASE/lib/*.a
+do
+ libname=`basename $i .a`
+ $MV $i $BASE/lib/$libname.lib
+done
+rm -f $BASE/lib/*.la
+
copyfileto $BASE/include config.h include/*
rm -f $BASE/include/Makefile* $BASE/include/*.in $BASE/include/config-win.h
-if [ $BASE_SYSTEM != "netware" ] ; then
- rm -f $BASE/include/config-netware.h
-fi
-
-if [ $BASE_SYSTEM != "netware" ] ; then
- if [ -d tests ] ; then
- $CP tests/*.res tests/*.tst tests/*.pl $BASE/tests
- fi
- if [ -d man ] ; then
- $CP man/*.1 $BASE/man/man1
- $CP man/*.8 $BASE/man/man8
- fi
-fi
copyfileto $BASE/support-files support-files/*
@@ -271,48 +389,33 @@ rm -f $MYSQL_SHARE/Makefile* $MYSQL_SHARE/*/*.OLD
copyfileto $BASE/mysql-test \
mysql-test/mysql-test-run mysql-test/install_test_db \
mysql-test/mysql-test-run.pl mysql-test/README \
- mysql-test/valgrind.supp \
+ mysql-test/mysql-stress-test.pl \
+ mysql-test/valgrind.supp \
netware/mysql_test_run.nlm netware/install_test_db.ncf
-MCP mysql-test/lib/*.pl $BASE/mysql-test/lib
-MCP mysql-test/t/*.def $BASE/mysql-test/t
-MCP mysql-test/include/*.inc $BASE/mysql-test/include
-MCP mysql-test/include/*.test $BASE/mysql-test/include
-MCP mysql-test/t/*.def $BASE/mysql-test/t
-MCP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \
+$CP mysql-test/lib/*.pl $BASE/mysql-test/lib
+$CP mysql-test/t/*.def $BASE/mysql-test/t
+$CP mysql-test/include/*.inc $BASE/mysql-test/include
+$CP mysql-test/include/*.test $BASE/mysql-test/include
+$CP mysql-test/t/*.def $BASE/mysql-test/t
+$CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \
mysql-test/std_data/*.MYD mysql-test/std_data/*.MYI \
mysql-test/std_data/*.pem mysql-test/std_data/Moscow_leap \
+ mysql-test/std_data/Index.xml \
mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \
mysql-test/std_data/*.cnf mysql-test/std_data/*.MY* \
$BASE/mysql-test/std_data
-MCP mysql-test/t/*.test $BASE/mysql-test/t
-MCP mysql-test/t/*.imtest mysql-test/t/*.disabled $BASE/mysql-test/t
-MCP mysql-test/t/*.opt mysql-test/t/*.slave-mi $BASE/mysql-test/t
-MCP mysql-test/t/*.sh mysql-test/t/*.sql $BASE/mysql-test/t
-MCP mysql-test/r/*.result $BASE/mysql-test/r
-MCP mysql-test/r/*.require $BASE/mysql-test/r
-MCP mysql-test/extra/binlog_tests/*.test $BASE/mysql-test/extra/binlog_tests
-MCP mysql-test/extra/rpl_tests/*.test $BASE/mysql-test/extra/rpl_tests
-
-if [ $BASE_SYSTEM != "netware" ] ; then
- chmod a+x $BASE/bin/*
- copyfileto $BASE/bin scripts/*
- $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ \
- ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ \
- @HOSTNAME@ \@pkgdatadir\@ ./support-files \
- < scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db
- $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \
- \@sbindir\@ ./bin \@libexecdir\@ ./bin \
- \@MYSQLD_USER\@ @MYSQLD_USER@ \@localstatedir\@ /usr/local/mysql/data \
- \@HOSTNAME\@ @HOSTNAME@ \
- < support-files/mysql.server.sh > $BASE/support-files/mysql.server
- $BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe
- mv $BASE/support-files/binary-configure $BASE/configure
- chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* \
- $BASE/support-files/mysql.server $BASE/configure
- $CP -r sql-bench/* $BASE/sql-bench
- rm -f $BASE/sql-bench/*.sh $BASE/sql-bench/Makefile* $BASE/lib/*.la
- rm -f $BASE/bin/*.sql
+$CP mysql-test/t/*.test mysql-test/t/*.imtest \
+ mysql-test/t/*.disabled mysql-test/t/*.opt \
+ mysql-test/t/*.slave-mi mysql-test/t/*.sh mysql-test/t/*.sql $BASE/mysql-test/t
+$CP mysql-test/r/*.result mysql-test/r/*.require \
+ $BASE/mysql-test/r
+
+# Copy the additional suites "as is", they are in flux
+$tar cf - mysql-test/suite | ( cd $BASE ; $tar xf - )
+# Clean up if we did this from a bk tree
+if [ -d mysql-test/SCCS ] ; then
+ find $BASE/mysql-test -name SCCS -print | xargs rm -rf
fi
rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh \
@@ -323,138 +426,37 @@ rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh \
#
# Copy system dependent files
#
-if [ $BASE_SYSTEM = "netware" ] ; then
- ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql
-fi
+./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql
#
# Remove system dependent files
#
-if [ $BASE_SYSTEM = "netware" ] ; then
- rm -f $BASE/support-files/magic \
+rm -f $BASE/support-files/magic \
$BASE/support-files/mysql.server \
$BASE/support-files/mysql*.spec \
$BASE/support-files/mysql-log-rotate \
$BASE/support-files/binary-configure \
$BASE/support-files/build-tags \
$BASE/support-files/MySQL-shared-compat.spec \
- $BASE/support-files/ndb-config-2-node.ini \
$BASE/INSTALL-BINARY
-fi
-
-# Make safe_mysqld a symlink to mysqld_safe for backwards portability
-if [ $BASE_SYSTEM != "netware" ] ; then
- (cd $BASE/bin ; ln -s mysqld_safe safe_mysqld )
-fi
# Clean up if we did this from a bk tree
-if [ -d $BASE/share/SCCS ] ; then
+if [ -d $BASE/sql-bench/SCCS ] ; then
find $BASE/share -name SCCS -print | xargs rm -rf
find $BASE/sql-bench -name SCCS -print | xargs rm -rf
fi
-# NDB Cluster
-if [ x$NDBCLUSTER = x1 ]; then
- ( cd storage/ndb ; @MAKE@ DESTDIR=$BASE/ndb-stage install )
- ( cd mysql-test ; @MAKE@ DESTDIR=$BASE/ndb-stage install )
- $CP $BASE/ndb-stage@bindir@/* $BASE/bin/.
- $CP $BASE/ndb-stage@libexecdir@/* $BASE/bin/.
- $CP $BASE/ndb-stage@pkglibdir@/* $BASE/lib/.
- $CP $BASE/ndb-stage@pkgdatadir@/* $BASE/share/mysql/.
- test -d $BASE/include/storage || mkdir $BASE/include/storage
- $CP -r $BASE/ndb-stage@pkgincludedir@/storage/ndb $BASE/include/storage/
- $CP -r $BASE/ndb-stage@prefix@/mysql-test/ndb $BASE/mysql-test/. || exit 1
- $CP -r $BASE/ndb-stage@prefix@/mysql-test/std_data/ndb_backup50 $BASE/mysql-test/std_data/. || exit 1
- $CP -r $BASE/ndb-stage@prefix@/mysql-test/std_data/ndb_backup51 $BASE/mysql-test/std_data/. || exit 1
- rm -rf $BASE/ndb-stage
-fi
-
-# Change the distribution to a long descriptive name
-NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version-$platform$SUFFIX
-
-# Print the platform name for build logs
-echo "PLATFORM NAME: $platform"
-
BASE2=$TMP/$NEW_NAME
rm -rf $BASE2
mv $BASE $BASE2
BASE=$BASE2
+
#
-# If we are compiling with gcc, copy libgcc.a to the distribution as libmygcc.a
+# Create a zip file for NetWare users
#
-
-if [ x"@GXX@" = x"yes" ] ; then
- gcclib=`@CC@ @CFLAGS@ --print-libgcc-file`
- if [ $? -ne 0 ] ; then
- echo "Warning: Couldn't find libgcc.a!"
- else
- $CP $gcclib $BASE/lib/libmygcc.a
- fi
-fi
-
-#if we are debugging, do not do tar/gz
-if [ x$DEBUG = x1 ] ; then
- exit
-fi
-
-# This is needed to prefere gnu tar instead of tar because tar can't
-# always handle long filenames
-
-PATH_DIRS=`echo $PATH | \
- sed -e 's/^:/. /' -e 's/:$/ ./' -e 's/::/ . /g' -e 's/:/ /g' `
-
-which_1 ()
-{
- for cmd
- do
- for d in $PATH_DIRS
- do
- for file in $d/$cmd
- do
- if [ -x $file -a ! -d $file ] ; then
- echo $file
- exit 0
- fi
- done
- done
- done
- exit 1
-}
-
-if [ $BASE_SYSTEM != "netware" ] ; then
-
- #
- # Create the result tar file
- #
-
- tar=`which_1 gnutar gtar`
- if [ "$?" = "1" -o x"$tar" = x"" ] ; then
- tar=tar
- fi
-
- echo "Using $tar to create archive"
-
- OPT=cvf
- if [ x$SILENT = x1 ] ; then
- OPT=cf
- fi
-
- echo "Creating and compressing archive"
- rm -f $NEW_NAME.tar.gz
- (cd $TMP ; $tar $OPT - $NEW_NAME) | gzip -9 > $NEW_NAME.tar.gz
- echo "$NEW_NAME.tar.gz created"
-
-else
-
- #
- # Create a zip file for NetWare users
- #
-
- rm -f $NEW_NAME.zip
- (cd $TMP; zip -r "$SOURCE/$NEW_NAME.zip" $NEW_NAME)
- echo "$NEW_NAME.zip created"
-
-fi
+rm -f $NEW_NAME.zip
+(cd $TMP; zip -r "$SOURCE/$NEW_NAME.zip" $NEW_NAME)
+echo "$NEW_NAME.zip created"
echo "Removing temporary directory"
rm -rf $BASE
diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist
index 42fade7cbd2..957a5a6768d 100755
--- a/scripts/make_win_bin_dist
+++ b/scripts/make_win_bin_dist
@@ -39,7 +39,7 @@ The "package-base-name" argument should be something like
mysql-noinstall-5.0.25-win32 (or winx64)
-and will be the name of the directory of the unpacked ZIP (stripping
+and will become the name of the directory of the unpacked ZIP (stripping
away the "noinstall" part of the ZIP file name if any) and the base
for the resulting package name.
@@ -51,6 +51,7 @@ Options are
--no-embedded Don't pack the embedded server even if built
--debug Pack the debug binaries and give error if not built.
+ The default is to pack them if they are built.
--no-debug Don't pack the debug binaries even if built
@@ -58,10 +59,10 @@ Options are
want to replace the normal binaries with debug
versions, i.e. no separate "debug" directories.
- --exe-suffix=SUF Add a suffix to the "mysqld" binary.
+ --exe-suffix=SUF Add a suffix to the filename part of the "mysqld" binary.
As you might want to include files of directories from other builds
-(like a "mysqld-max.exe" server), you can instruct this script do copy
+(like a "mysqld-max.exe" server), you can instruct this script to copy
them in for you. This is the "copy-def" arguments, and they are of the
form
@@ -126,6 +127,8 @@ if [ -e $DESTDIR ] ; then
usage
fi
+trap 'echo "Clearning up and exiting..." ; rm -fr $DESTDIR; exit 1' ERR
+
# ----------------------------------------------------------------------
# Adjust target name if needed, release with debug info has another name
# ----------------------------------------------------------------------
@@ -136,19 +139,16 @@ then
fi
# ----------------------------------------------------------------------
-# Copy executables, and client DLL (FIXME why?)
+# Copy executables, and client DLL
# ----------------------------------------------------------------------
-trap 'echo "Clearning up and exiting..." ; rm -fr $DESTDIR; exit 1' ERR
-
mkdir $DESTDIR
mkdir $DESTDIR/bin
cp client/$TARGET/*.exe $DESTDIR/bin/
cp extra/$TARGET/*.exe $DESTDIR/bin/
cp storage/myisam/$TARGET/*.exe $DESTDIR/bin/
cp server-tools/instance-manager/$TARGET/*.{exe,map} $DESTDIR/bin/
-if [ x"$TARGET" != x"release" ]
-then
+if [ x"$TARGET" != x"release" ] ; then
cp server-tools/instance-manager/$TARGET/*.pdb $DESTDIR/bin/
fi
cp tests/$TARGET/*.exe $DESTDIR/bin/
@@ -160,13 +160,12 @@ mv $DESTDIR/bin/comp_err.exe $DESTDIR/bin/comp-err.exe
cp sql/$TARGET/mysqld.exe $DESTDIR/bin/mysqld$EXE_SUFFIX.exe
cp sql/$TARGET/mysqld.map $DESTDIR/bin/mysqld$EXE_SUFFIX.map
-if [ x"$TARGET" != x"release" ]
-then
+if [ x"$TARGET" != x"release" ] ; then
cp sql/$TARGET/mysqld.pdb $DESTDIR/bin/mysqld$EXE_SUFFIX.pdb
fi
-if [ x"$PACK_DEBUG" = "" -a -f "sql/debug/mysqld.exe" -o \
- x"$PACK_DEBUG" = "yes" ] ; then
+if [ x"$PACK_DEBUG" = x"" -a -f "sql/debug/mysqld.exe" -o \
+ x"$PACK_DEBUG" = x"yes" ] ; then
cp sql/debug/mysqld.exe $DESTDIR/bin/mysqld-debug.exe
cp sql/debug/mysqld.pdb $DESTDIR/bin/mysqld-debug.pdb
cp sql/debug/mysqld.map $DESTDIR/bin/mysqld-debug.map
@@ -176,9 +175,8 @@ fi
# Copy data directory, readme files etc
# ----------------------------------------------------------------------
-# FIXME is there ever a data directory to copy?
if [ -d win/data ] ; then
- cp -pR win/data $DESTDIR/data
+ cp -pR win/data $DESTDIR/
fi
# FIXME maybe a flag to define "release build", or do the
@@ -208,66 +206,74 @@ copy_embedded()
$DESTDIR/include
cp libmysqld/libmysqld.def $DESTDIR/include/
cp libmysqld/$TARGET/mysqlserver.lib $DESTDIR/Embedded/static/release/
+ cp libmysqld/$TARGET/mysqlserver.pdb $DESTDIR/Embedded/static/release/
cp libmysqld/$TARGET/libmysqld.dll $DESTDIR/Embedded/DLL/release/
cp libmysqld/$TARGET/libmysqld.exp $DESTDIR/Embedded/DLL/release/
cp libmysqld/$TARGET/libmysqld.lib $DESTDIR/Embedded/DLL/release/
-
- if [ x"$PACK_DEBUG" = "" -a -f "libmysqld/debug/libmysqld.lib" -o \
- x"$PACK_DEBUG" = "yes" ] ; then
- mkdir -p $DESTDIR/Embedded/DLL/debug
+ cp libmysqld/$TARGET/libmysqld.pdb $DESTDIR/Embedded/DLL/release/
+
+ if [ x"$PACK_DEBUG" = x"" -a -f "libmysqld/debug/libmysqld.lib" -o \
+ x"$PACK_DEBUG" = x"yes" ] ; then
+ mkdir -p $DESTDIR/Embedded/DLL/debug \
+ $DESTDIR/Embedded/static/debug
+ cp libmysqld/debug/mysqlserver.lib $DESTDIR/Embedded/static/debug/
+ cp libmysqld/debug/mysqlserver.pdb $DESTDIR/Embedded/static/debug/
cp libmysqld/debug/libmysqld.dll $DESTDIR/Embedded/DLL/debug/
cp libmysqld/debug/libmysqld.exp $DESTDIR/Embedded/DLL/debug/
cp libmysqld/debug/libmysqld.lib $DESTDIR/Embedded/DLL/debug/
+ cp libmysqld/debug/libmysqld.pdb $DESTDIR/Embedded/DLL/debug/
fi
}
-if [ x"$PACK_EMBEDDED" = "" -a \
+if [ x"$PACK_EMBEDDED" = x"" -a \
-f "libmysqld/$TARGET/mysqlserver.lib" -a \
-f "libmysqld/$TARGET/libmysqld.lib" -o \
- x"$PACK_EMBEDDED" = "yes" ] ; then
+ x"$PACK_EMBEDDED" = x"yes" ] ; then
copy_embedded
fi
# ----------------------------------------------------------------------
-# FIXME test stuff that is useless garbage?
-# ----------------------------------------------------------------------
-
-mkdir -p $DESTDIR/examples/libmysqltest/release
-cp libmysql/mytest.c libmysql/myTest.vcproj libmysql/$TARGET/myTest.exe \
- $DESTDIR/examples/libmysqltest/
-cp libmysql/$TARGET/myTest.exe $DESTDIR/examples/libmysqltest/release/
-
-if [ x"$PACK_DEBUG" = "" -a -f "libmysql/debug/myTest.exe" -o \
- x"$PACK_DEBUG" = "yes" ] ; then
- mkdir -p $DESTDIR/examples/libmysqltest/debug
- cp libmysql/debug/myTest.exe $DESTDIR/examples/libmysqltest/debug/
-fi
-
-mkdir -p $DESTDIR/examples/tests
-cp tests/*.res tests/*.tst tests/*.pl tests/*.c $DESTDIR/examples/tests/
-
-mkdir -p $DESTDIR/examples/udf_example
-cp sql/udf_example.def sql/udf_example.vcproj sql/udf_example.c $DESTDIR/examples/udf_example/
-
-# ----------------------------------------------------------------------
-# FIXME why not copy it all in "include"?!
+# Note: Make sure to sync with include/Makefile.am and WiX installer
+# XML specifications
# ----------------------------------------------------------------------
mkdir -p $DESTDIR/include
-cp include/conf*.h \
- include/mysql*.h \
- include/errmsg.h \
- include/my_alloc.h \
- include/my_getopt.h \
- include/my_sys.h \
+cp include/mysql.h \
+ include/mysql_com.h \
+ include/mysql_time.h \
include/my_list.h \
- include/my_pthread.h \
+ include/my_alloc.h \
+ include/typelib.h \
include/my_dbug.h \
include/m_string.h \
- include/m_ctype.h \
+ include/my_sys.h \
+ include/my_xml.h \
+ include/mysql_embed.h \
+ include/my_pthread.h \
+ include/my_no_pthread.h \
+ include/decimal.h \
+ include/errmsg.h \
include/my_global.h \
- include/typelib.h $DESTDIR/include/
-cp libmysql/libmysql.def $DESTDIR/include/
+ include/my_net.h \
+ include/my_getopt.h \
+ include/sslopt-longopts.h \
+ include/my_dir.h \
+ include/sslopt-vars.h \
+ include/sslopt-case.h \
+ include/sql_common.h \
+ include/keycache.h \
+ include/m_ctype.h \
+ include/my_attribute.h \
+ include/mysqld_error.h \
+ include/sql_state.h \
+ include/mysqld_ername.h \
+ include/mysql_version.h \
+ include/config-win.h \
+ libmysql/libmysql.def \
+ $DESTDIR/include/
+
+mkdir -p $DESTDIR/include/mysql
+cp include/mysql/plugin.h $DESTDIR/include/mysql/
# ----------------------------------------------------------------------
# Client libraries, and other libraries
@@ -277,71 +283,46 @@ cp libmysql/libmysql.def $DESTDIR/include/
mkdir -p $DESTDIR/lib/opt
cp libmysql/$TARGET/libmysql.dll \
libmysql/$TARGET/libmysql.lib \
- client/$TARGET/mysqlclient.lib \
+ libmysql/$TARGET/mysqlclient.lib \
+ mysys/$TARGET/mysys.lib \
regex/$TARGET/regex.lib \
strings/$TARGET/strings.lib \
zlib/$TARGET/zlib.lib $DESTDIR/lib/opt/
-if [ x"$PACK_DEBUG" = "" -a -f "libmysql/debug/libmysql.lib" -o \
- x"$PACK_DEBUG" = "yes" ] ; then
+if [ x"$PACK_DEBUG" = x"" -a -f "libmysql/debug/libmysql.lib" -o \
+ x"$PACK_DEBUG" = x"yes" ] ; then
mkdir -p $DESTDIR/lib/debug
cp libmysql/debug/libmysql.dll \
libmysql/debug/libmysql.lib \
- client/debug/mysqlclient.lib \
+ libmysql/debug/mysqlclient.lib \
mysys/debug/mysys.lib \
regex/debug/regex.lib \
strings/debug/strings.lib \
zlib/debug/zlib.lib $DESTDIR/lib/debug/
fi
-# FIXME sort this out...
-cp mysys/$TARGET/mysys.lib $DESTDIR/lib/opt/mysys_tls.lib
-
# ----------------------------------------------------------------------
# Copy the test directory
# ----------------------------------------------------------------------
-mkdir -p $DESTDIR/mysql-test/include $DESTDIR/mysql-test/lib \
- $DESTDIR/mysql-test/r $DESTDIR/mysql-test/std_data \
- $DESTDIR/mysql-test/t
+mkdir $DESTDIR/mysql-test
cp mysql-test/mysql-test-run.pl $DESTDIR/mysql-test/
cp mysql-test/README $DESTDIR/mysql-test/
-cp mysql-test/install_test_db.sh $DESTDIR/mysql-test/install_test_db
-cp mysql-test/include/*.inc $DESTDIR/mysql-test/include/
-cp mysql-test/lib/*.pl $DESTDIR/mysql-test/lib/
-cp mysql-test/r/*.require $DESTDIR/mysql-test/r/
-# Need this trick, or we get "argument list too long".
-ABS_DST=`pwd`/$DESTDIR
-(cd mysql-test/r/ && cp *.result $ABS_DST/mysql-test/r/)
-cp mysql-test/std_data/Moscow_leap $DESTDIR/mysql-test/std_data/
-cp mysql-test/std_data/des_key_file $DESTDIR/mysql-test/std_data/
-cp mysql-test/std_data/*.000001 $DESTDIR/mysql-test/std_data/
-cp mysql-test/std_data/*.cnf $DESTDIR/mysql-test/std_data/
-cp mysql-test/std_data/*.dat $DESTDIR/mysql-test/std_data/
-cp mysql-test/std_data/*.frm $DESTDIR/mysql-test/std_data/
-cp mysql-test/std_data/*.pem $DESTDIR/mysql-test/std_data/
-cp mysql-test/std_data/*.MY* $DESTDIR/mysql-test/std_data/
-cp mysql-test/t/*.opt $DESTDIR/mysql-test/t/
-cp mysql-test/t/*.sh $DESTDIR/mysql-test/t/
-cp mysql-test/t/*.slave-mi $DESTDIR/mysql-test/t/
-cp mysql-test/t/*.sql $DESTDIR/mysql-test/t/
-cp mysql-test/t/*.def $DESTDIR/mysql-test/t/
-(cd mysql-test/t/ && cp *.test $ABS_DST/mysql-test/t/)
+cp -R mysql-test/{t,r,include,suite,std_data,lib} $DESTDIR/mysql-test/
# Note that this will not copy "extra" if a soft link
if [ -d mysql-test/extra ] ; then
- mkdir -p $DESTDIR/mysql-test/extra
+ mkdir $DESTDIR/mysql-test/extra
cp -pR mysql-test/extra/* $DESTDIR/mysql-test/extra/
fi
# ----------------------------------------------------------------------
# Copy what could be usable in the "scripts" directory. Currently
-# only SQL files, others are bourne shell scripts or Perl scripts
+# only SQL files, others are Bourne shell scripts or Perl scripts
# not really usable on Windows.
#
# But to be nice to the few Cygwin users we might have in 5.0 we
-# continue to copy the stuff, but don't include it include it in
-# the WiX install.
+# continue to copy the stuff, but don't include it in the WiX install.
# ----------------------------------------------------------------------
mkdir -p $DESTDIR/scripts
@@ -360,11 +341,19 @@ for i in `cd scripts && ls`; do \
done
cp -pR sql/share $DESTDIR/
+cp -pR sql-bench $DESTDIR/
+rm -f $DESTDIR/sql-bench/*.sh $DESTDIR/sql-bench/Makefile*
-# The SQL initiation code is really expected to be in "share"
+# The SQL initialisation code is really expected to be in "share"
mv $DESTDIR/scripts/*.sql $DESTDIR/share/ || true
# ----------------------------------------------------------------------
+# Clean up from possibly copied SCCS directories
+# ----------------------------------------------------------------------
+
+rm -rf `find $DISTDIR -type d -name SCCS -print`
+
+# ----------------------------------------------------------------------
# Copy other files specified on command line DEST=SOURCE
# ----------------------------------------------------------------------
@@ -382,7 +371,7 @@ for arg do
done
# ----------------------------------------------------------------------
-# Finally creat the ZIP archive
+# Finally create the ZIP archive
# ----------------------------------------------------------------------
rm -f $NOINST_NAME.zip
diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh
index f094cb060b7..6b054e83720 100644
--- a/scripts/mysql_config.sh
+++ b/scripts/mysql_config.sh
@@ -121,7 +121,7 @@ done
cflags=`echo "$cflags"|sed -e 's/ *\$//'`
# Same for --libs(_r)
-for remove in lmtmalloc static-libcxa i-static
+for remove in lmtmalloc static-libcxa i-static static-intel
do
# We know the strings starts with a space
libs=`echo "$libs"|sed -e "s/ -$remove */ /g"`
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index e848c5e3c96..6f147c45f3b 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -18,26 +18,69 @@
#
# All unrecognized arguments to this script are passed to mysqld.
-in_rpm=0
-windows=0
+basedir=""
+ldata=""
+srcdir=""
+
+args=""
defaults=""
+mysqld_opt=""
user=""
-case "$1" in
- --no-defaults|--defaults-file=*|--defaults-extra-file=*)
- defaults="$1"; shift
- ;;
-esac
+force=0
+in_rpm=0
+ip_only=0
+windows=0
+source_install=0
+
+usage()
+{
+ cat <<EOF
+Usage: $0 [OPTIONS]
+ --basedir=path The path to the MySQL installation directory.
+ --datadir=path The path to the MySQL data directory.
+ --force Causes mysql_install_db to run even if DNS does not
+ work. In that case, grant table entries that normally
+ use hostnames will use IP addresses.
+ --ldata=path The path to the MySQL data directory. Same as --datadir.
+ --rpm For internal use. This option is used by RPM files
+ during the MySQL installation process.
+ --skip-name-resolve Use IP addresses rather than hostnames when creating
+ grant table entries. This option can be useful if
+ your DNS does not work.
+ --srcdir=path For internal use. The directory under which
+ mysql_install_db looks for support files such as the
+ error message file and the file for popoulating the
+ help tables.
+ --user=user_name The login username to use for running mysqld. Files
+ and directories created by mysqld will be owned by this
+ user. You must be root to use this option. By default
+ mysqld runs using your current login name and files and
+ directories that it creates will be owned by you.
+ --windows For internal use. This option is used for creating
+ Windows distributions.
+
+All other options are passed to the mysqld program
+
+EOF
+ exit 1
+}
s_echo()
{
if test "$in_rpm" -eq 0 -a "$windows" -eq 0
then
- echo $1
+ echo "$1"
fi
}
-parse_arguments() {
+parse_arg()
+{
+ echo "$1" | sed -e 's/^[^=]*=//'
+}
+
+parse_arguments()
+{
# We only need to pass arguments through to the server if we don't
# handle them here. So, we collect unrecognized options (passed on
# the command line) into the args variable.
@@ -48,20 +91,24 @@ parse_arguments() {
shift
fi
- for arg do
+ for arg
+ do
case "$arg" in
--force) force=1 ;;
- --basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
- --srcdir=*) srcdir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
- --ldata=*|--datadir=*) ldata=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
+ --basedir=*) basedir=`parse_arg "$arg"` ;;
+ --srcdir=*) srcdir=`parse_arg "$arg"` ;;
+ --ldata=*|--datadir=*) ldata=`parse_arg "$arg"` ;;
--user=*)
# Note that the user will be passed to mysqld so that it runs
# as 'user' (crucial e.g. if log-bin=/some_other_path/
# where a chown of datadir won't help)
- user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
+ user=`parse_arg "$arg"` ;;
--skip-name-resolve) ip_only=1 ;;
--verbose) verbose=1 ;; # Obsolete
--rpm) in_rpm=1 ;;
+ --help) usage ;;
+ --no-defaults|--defaults-file=*|--defaults-extra-file=*)
+ defaults="$arg" ;;
--windows)
# This is actually a "cross bootstrap" argument used when
@@ -74,6 +121,13 @@ parse_arguments() {
# package.
windows=1 ;;
+ --source-install)
+ # This is used when you want to run mysqld directly from the
+ # source tree (for example when you are developing MySQL and
+ # only want to create the default tables but don't want to
+ # install mysqld yet.
+ source_install=1 ;;
+
*)
if test -n "$pick_args"
then
@@ -89,146 +143,188 @@ parse_arguments() {
done
}
-# Get first arguments from the my.cfg file, groups [mysqld] and
-# [mysql_install_db], and then merge with the command line arguments
-if test -x ./bin/my_print_defaults
-then
- print_defaults="./bin/my_print_defaults"
-elif test -x ./extra/my_print_defaults
-then
- print_defaults="./extra/my_print_defaults"
-elif test -x @bindir@/my_print_defaults
-then
- print_defaults="@bindir@/my_print_defaults"
-elif test -x @bindir@/mysql_print_defaults
-then
- print_defaults="@bindir@/mysql_print_defaults"
-else
- print_defaults="my_print_defaults"
-fi
-
-args=
-ldata=
-execdir=
-bindir=
-basedir=
-srcdir=
-force=0
+# Try to find a specific file within --basedir which can either be a binary
+# release or installed source directory and return the path.
+find_in_basedir()
+{
+ case "$1" in
+ --dir)
+ return_dir=1; shift
+ ;;
+ esac
-parse_arguments `$print_defaults $defaults mysqld mysql_install_db`
-parse_arguments PICK-ARGS-FROM-ARGV "$@"
+ file=$1; shift
-test -z "$ldata" && ldata=@localstatedir@
-if test -z "$basedir"
-then
- basedir=@prefix@
- bindir=@bindir@
- execdir=@libexecdir@
- pkgdatadir=@pkgdatadir@
-else
- bindir="$basedir/bin"
- if test -x "$basedir/libexec/mysqld"
+ base="$basedir"
+ if test -z "$base"
then
- execdir="$basedir/libexec"
- elif test -x "$basedir/sbin/mysqld"
- then
- execdir="$basedir/sbin"
- else
- execdir="$basedir/bin"
+ # Assume source installation if basedir is not given
+ base="."
fi
-fi
-# Find SQL scripts needed for bootstrap
-fill_help_tables="fill_help_tables.sql"
-create_system_tables="mysql_system_tables.sql"
-fill_system_tables="mysql_system_tables_data.sql"
-if test -n "$srcdir"
-then
- fill_help_tables=$srcdir/scripts/$fill_help_tables
- create_system_tables=$srcdir/scripts/$create_system_tables
- fill_system_tables=$srcdir/scripts/$fill_system_tables
-else
- for i in $basedir/support-files $basedir/share $basedir/share/mysql \
- $basedir/scripts `pwd` `pwd`/scripts @pkgdatadir@
+ for dir in "$@"
do
- if test -f $i/$fill_help_tables
+ if test -f "$base/$dir/$file"
then
- pkgdatadir=$i
+ if test -n "$return_dir"
+ then
+ echo "$base/$dir"
+ else
+ echo "$base/$dir/$file"
+ fi
break
fi
done
+}
+
+missing_in_basedir()
+{
+ if test -z "$basedir"
+ then
+ echo "FATAL ERROR: Could not find $* inside --basedir"
+ echo
+ echo "When using --basedir you must point either into a MySQL binary"
+ echo "distribution directory or a compiled tree previously populated"
+ echo "by 'make install'"
+ else
+ echo "FATAL ERROR: Can't find $*. Please specify your installation"
+ echo "directory with the '--basedir=' option."
+ fi
+}
+
+# Ok, let's go. We first need to parse arguments which are required by
+# my_print_defaults so that we can execute it first, then later re-parse
+# the command line to add any extra bits that we need.
+parse_arguments PICK-ARGS-FROM-ARGV "$@"
- fill_help_tables=$pkgdatadir/$fill_help_tables
- create_system_tables=$pkgdatadir/$create_system_tables
- fill_system_tables=$pkgdatadir/$fill_system_tables
+# We can now find my_print_defaults, either in the supplied --basedir
+# location or in the installed area.
+
+print_defaults=`find_in_basedir my_print_defaults bin extra`
+if test -z "$print_defaults"
+then
+ print_defaults="@bindir@/my_print_defaults"
+ if ! test -x "$print_defaults"
+ then
+ echo "FATAL ERROR: Could not find $print_defaults"
+ echo
+ echo "If you are using a binary release, you must run this script from"
+ echo "within the directory the archive extracted into. If you compiled"
+ echo "MySQL yourself you must run 'make install' first or use"
+ echo "use --source-install --install-dir=xxx from the top source directory"
+ exit 1
+ fi
fi
-if test ! -f $create_system_tables
+# Now we can get arguments from the groups [mysqld] and [mysql_install_db]
+# in the my.cfg file, then re-run to merge with command line arguments.
+parse_arguments `$print_defaults $defaults mysqld mysql_install_db`
+parse_arguments PICK-ARGS-FROM-ARGV "$@"
+
+# Path to MySQL installation directory
+if test -z "$basedir" -a "$source_install" = 0
then
- echo "FATAL ERROR: Could not find SQL file '$create_system_tables' in"
- echo "@pkgdatadir@ or inside $basedir"
- exit 1;
+ basedir="@prefix@"
+ bindir="@bindir@"
+ extra_bindir="$bindir"
+ mysqld="@libexecdir@/mysqld"
+ pkgdatadir="@pkgdatadir@"
+else
+ bindir="$basedir/bin"
+ extra_bindir="$bindir"
+ # We set up bootstrap-specific paths later, so skip this for --windows
+ if test "$windows" -eq 0
+ then
+ mysqld=`find_in_basedir mysqld libexec sbin bin`
+ if test -z "$basedir"
+ then
+ # We come here when source-install is given
+ bindir="$basedir/bin"
+ extra_bindir="$bindir"
+ fi
+ if test -x "$mysqld"
+ then
+ pkgdatadir=`find_in_basedir --dir fill_help_tables.sql share share/mysql scripts`
+ if test -z "$pkgdatadir"
+ then
+ missing_in_basedir fill_help_tables.sql
+ exit 1
+ fi
+ else
+ if test -x "./sql/mysqld"
+ then
+ # Source installation
+ mysqld="./sql/mysqld"
+ bindir="./client"
+ extra_bindir="./extra"
+ pkgdatadir="./scripts"
+ mysqld_opt="--language=./sql/share/english"
+ else
+ missing_in_basedir mysqld
+ fi
+ fi
+ fi
fi
-if test ! -f $fill_help_tables
+# Path to data directory
+if test -z "$ldata"
then
- echo "FATAL ERROR: Could not find help file '$fill_help_tables' in"
- echo "@pkgdatadir@ or inside $basedir"
- exit 1;
+ ldata="@localstatedir@"
fi
-if test ! -f $fill_system_tables
+# Set up paths to SQL scripts required for bootstrap and ensure they exist.
+if test -n "$srcdir"
then
- echo "FATAL ERROR: Could not find help file '$fill_system_tables' in"
- echo "@pkgdatadir@ or inside $basedir"
- exit 1;
+ pkgdatadir="$srcdir/scripts"
fi
-# Find executables and paths
-mysqld=$execdir/mysqld
-mysqld_opt=""
-scriptdir=$bindir
+fill_help_tables="$pkgdatadir/fill_help_tables.sql"
+create_system_tables="$pkgdatadir/mysql_system_tables.sql"
+fill_system_tables="$pkgdatadir/mysql_system_tables_data.sql"
+
+for f in $fill_help_tables $create_system_tables $fill_system_tables
+do
+ if test ! -f "$f"
+ then
+ echo "FATAL ERROR: Could not find SQL file '$f'"
+ exit 1
+ fi
+done
-if test "$windows" = 1
+# Set up Windows-specific paths
+if test "$windows" -eq 1
then
mysqld="./sql/mysqld"
- if test -n "$srcdir" -a -f $srcdir/sql/share/english/errmsg.sys
+ if test -n "$srcdir" -a -f "$srcdir/sql/share/english/errmsg.sys"
then
- langdir=$srcdir/sql/share/english
+ mysqld_opt="--language=$srcdir/sql/share/english"
else
- langdir=./sql/share/english
+ mysqld_opt="--language=./sql/share/english"
fi
- mysqld_opt="--language=$langdir"
- scriptdir="./scripts"
fi
-if test ! -x $mysqld
+# Make sure mysqld is available in default location (--basedir option is
+# already tested above).
+if test ! -x "$mysqld"
then
- if test "$in_rpm" = 1
- then
- echo "FATAL ERROR $mysqld not found!"
- exit 1
- else
- echo "FATAL ERROR Didn't find $mysqld"
- echo "You should do a 'make install' before executing this script"
- exit 1
- fi
+ echo "FATAL ERROR: 'mysqld' executable not found!"
+ exit 1
fi
# Try to determine the hostname
hostname=`@HOSTNAME@`
# Check if hostname is valid
-if test "$windows" = 0 -a "$in_rpm" = 0 -a $force = 0
+if test "$windows" -eq 0 -a "$in_rpm" -eq 0 -a "$force" -eq 0
then
- resolved=`$bindir/resolveip $hostname 2>&1`
+ resolved=`$extra_bindir/resolveip $hostname 2>&1`
if [ $? -ne 0 ]
then
- resolved=`$bindir/resolveip localhost 2>&1`
+ resolved=`$extra_bindir/resolveip localhost 2>&1`
if [ $? -ne 0 ]
then
echo "Neither host '$hostname' nor 'localhost' could be looked up with"
- echo "$bindir/resolveip"
+ echo "$extra_bindir/resolveip"
echo "Please configure the 'hostname' command to return a correct"
echo "hostname."
echo "If you want to solve this at a later stage, restart this script"
@@ -244,39 +340,36 @@ then
fi
fi
-if test "$ip_only" = "1"
+if test "$ip_only" -eq 1
then
- ip=`echo "$resolved" | awk '/ /{print $6}'`
- hostname=$ip
+ hostname=`echo "$resolved" | awk '/ /{print $6}'`
fi
# Create database directories mysql & test
-if test ! -d $ldata; then
- mkdir $ldata;
- chmod 700 $ldata ;
-fi
-if test ! -d $ldata/mysql; then
- mkdir $ldata/mysql;
- chmod 700 $ldata/mysql ;
-fi
-if test ! -d $ldata/test; then
- mkdir $ldata/test;
- chmod 700 $ldata/test ;
-fi
-if test -w / -a ! -z "$user"; then
- chown $user $ldata $ldata/mysql $ldata/test;
-fi
+for dir in $ldata $ldata/mysql $ldata/test
+do
+ if test ! -d $dir
+ then
+ mkdir -p $dir
+ chmod 700 $dir
+ fi
+ if test -w / -a ! -z "$user"
+ then
+ chown $user $dir
+ fi
+done
-if test -n "$user"; then
+if test -n "$user"
+then
args="$args --user=$user"
fi
# Peform the install of system tables
mysqld_bootstrap="${MYSQLD_BOOTSTRAP-$mysqld}"
mysqld_install_cmd_line="$mysqld_bootstrap $defaults $mysqld_opt --bootstrap \
---basedir=$basedir --datadir=$ldata --skip-innodb \
---skip-ndbcluster $args --max_allowed_packet=8M \
---net_buffer_length=16K"
+ --basedir=$basedir --datadir=$ldata --log-warnings=0 --loose-skip-innodb \
+ --loose-skip-ndbcluster $args --max_allowed_packet=8M \
+ --net_buffer_length=16K"
# Pipe mysql_system_tables.sql to "mysqld --bootstrap"
s_echo "Installing MySQL system tables..."
@@ -284,23 +377,20 @@ if `(echo "use mysql;"; cat $create_system_tables $fill_system_tables) | $mysqld
then
s_echo "OK"
- if test -n "$fill_help_tables"
+ s_echo "Filling help tables..."
+ # Pipe fill_help_tables.sql to "mysqld --bootstrap"
+ if `(echo "use mysql;"; cat $fill_help_tables) | $mysqld_install_cmd_line`
then
- s_echo "Filling help tables..."
- # Pipe fill_help_tables.sql to "mysqld --bootstrap"
- if `(echo "use mysql;"; cat $fill_help_tables) | $mysqld_install_cmd_line`
- then
- # Fill suceeded
- s_echo "OK"
- else
- echo ""
- echo "WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!"
- echo "The \"HELP\" command might not work properly"
- echo ""
- fi
+ # Fill suceeded
+ s_echo "OK"
+ else
+ echo
+ echo "WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!"
+ echo "The \"HELP\" command might not work properly"
+ echo
fi
- s_echo ""
+ s_echo
s_echo "To start mysqld at boot time you have to copy"
s_echo "support-files/mysql.server to the right place for your system"
s_echo
@@ -317,9 +407,18 @@ then
echo "To do so, start the server, then issue the following commands:"
echo "$bindir/mysqladmin -u root password 'new-password'"
echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'"
+ echo
+ echo "Alternatively you can run:"
+ echo "$bindir/mysql_secure_installation"
+ echo
+ echo "which will also give you the option of removing the test"
+ echo "databases and anonymous user created by default. This is"
+ echo "strongly recommended for production servers."
+ echo
echo "See the manual for more instructions."
+ echo
- if test "$in_rpm" = "0"
+ if test "$in_rpm" -eq 0 -a "$source_install" -eq 0
then
echo "You can start the MySQL daemon with:"
echo "cd @prefix@ ; $bindir/mysqld_safe &"
diff --git a/scripts/mysql_setpermission.sh b/scripts/mysql_setpermission.sh
index 9699cd28047..1f5509f9955 100644
--- a/scripts/mysql_setpermission.sh
+++ b/scripts/mysql_setpermission.sh
@@ -19,13 +19,14 @@
## 1.3 Applied patch provided by Martin Mokrejs <mmokrejs@natur.cuni.cz>
## (General code cleanup, use the GRANT statement instead of updating
## the privilege tables directly, added option to revoke privileges)
+## 1.4 Remove option 6 which attempted to erroneously grant global privileges
#### TODO
#
# empty ... suggestions ... mail them to me ...
-$version="1.3";
+$version="1.4";
use DBI;
use Getopt::Long;
@@ -103,13 +104,9 @@ sub q1 { # first question ...
print " existing database and host combination (user can do\n";
print " SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,\n";
print " LOCK TABLES,CREATE TEMPORARY TABLES)\n";
- print " 6. Create/append database administrative privileges for an\n";
- print " existing database and host combination (user can do\n";
- print " SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,LOCK TABLES,\n";
- print " CREATE TEMPORARY TABLES,SHOW DATABASES,PROCESS)\n";
- print " 7. Create/append full privileges for an existing database\n";
+ print " 6. Create/append full privileges for an existing database\n";
print " and host combination (user has FULL privilege)\n";
- print " 8. Remove all privileges for for an existing database and\n";
+ print " 7. Remove all privileges for for an existing database and\n";
print " host combination.\n";
print " (user will have all permission fields set to N)\n";
print " 0. exit this program\n";
@@ -117,10 +114,10 @@ sub q1 { # first question ...
while (<STDIN>) {
$answer = $_;
chomp($answer);
- if ($answer =~ /^[12345678]$/) {
+ if ($answer =~ /^[1234567]$/) {
if ($answer == 1) {
setpwd();
- } elsif ($answer =~ /^[2345678]$/) {
+ } elsif ($answer =~ /^[234567]$/) {
addall($answer);
} else {
print "Sorry, something went wrong. With such option number you should not get here.\n\n";
@@ -233,7 +230,7 @@ sub addall {
}
}
- if ( ( !$todo ) or not ( $todo =~ m/^[2-8]$/ ) ) {
+ if ( ( !$todo ) or not ( $todo =~ m/^[2-7]$/ ) ) {
print STDERR "Sorry, select option $todo isn't known inside the program .. See ya\n";
quit();
}
@@ -256,12 +253,9 @@ sub addall {
# user privileges: SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,LOCK TABLES,CREATE TEMPORARY TABLES
$sth = $dbh->do("GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,LOCK TABLES,CREATE TEMPORARY TABLES ON $db.* TO $user@\"$host\" IDENTIFIED BY \'$pass\'") || die $dbh->errstr;
} elsif ($todo == 6) {
- # admin privileges: GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,LOCK TABLES,CREATE TEMPORARY TABLES,SHOW DATABASES,PROCESS
- $sth = $dbh->do("GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,LOCK TABLES,CREATE TEMPORARY TABLES,SHOW DATABASES,PROCESS ON $db.* TO $user@\"$host\" IDENTIFIED BY \'$pass\'") || die $dbh->errstr;
- } elsif ($todo == 7) {
# all privileges
$sth = $dbh->do("GRANT ALL ON $db.* TO \'$user\'\@\'$host\' IDENTIFIED BY \'$pass\'") || die $dbh->errstr;
- } elsif ($todo == 8) {
+ } elsif ($todo == 7) {
# all privileges set to N
$sth = $dbh->do("REVOKE ALL ON *.* FROM \'$user\'\@\'$host\'") || die $dbh->errstr;
}
diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql
index c779d174d12..f7b23e4e7ae 100644
--- a/scripts/mysql_system_tables.sql
+++ b/scripts/mysql_system_tables.sql
@@ -2,6 +2,7 @@
-- The system tables of MySQL Server
--
+set sql_mode='';
set storage_engine=myisam;
CREATE TABLE IF NOT EXISTS db ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) 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, 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, PRIMARY KEY Host (Host,Db,User), KEY User (User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges';
@@ -59,23 +60,27 @@ 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 char(64) 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' ) DEFAULT '' NOT NULL, comment char(64) collate utf8_bin DEFAULT '' NOT NULL, 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 char(64) 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') 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 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) binary 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';
+-- Create general_log if CSV is enabled.
+
+SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT, thread_id INTEGER, server_id INTEGER, command_type VARCHAR(64), argument MEDIUMTEXT) engine=CSV CHARACTER SET utf8 comment="General log"', 'SET @dummy = 0');
+
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+-- Create slow_log if CSV is enabled.
-delimiter ;;
-CREATE PROCEDURE create_general_log_table() BEGIN DECLARE is_csv_enabled int DEFAULT 0; SELECT @@have_csv = 'YES' INTO is_csv_enabled; IF (is_csv_enabled) THEN CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT, thread_id INTEGER, server_id INTEGER, command_type VARCHAR(64), argument MEDIUMTEXT) engine=CSV CHARACTER SET utf8 comment='General log'; END IF; END;;
-CALL create_general_log_table();;
-DROP PROCEDURE create_general_log_table;;
+SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS slow_log (start_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, query_time TIME NOT NULL, lock_time TIME NOT NULL, rows_sent INTEGER NOT NULL, rows_examined INTEGER NOT NULL, db VARCHAR(512), last_insert_id INTEGER, insert_id INTEGER, server_id INTEGER, sql_text MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment="Slow log"', 'SET @dummy = 0');
-CREATE PROCEDURE create_slow_log_table() BEGIN DECLARE is_csv_enabled int DEFAULT 0; SELECT @@have_csv = 'YES' INTO is_csv_enabled; IF (is_csv_enabled) THEN CREATE TABLE IF NOT EXISTS slow_log (start_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, query_time TIME NOT NULL, lock_time TIME NOT NULL, rows_sent INTEGER NOT NULL, rows_examined INTEGER NOT NULL, db VARCHAR(512), last_insert_id INTEGER, insert_id INTEGER, server_id INTEGER, sql_text MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment='Slow log'; END IF; END;;
-CALL create_slow_log_table();;
-DROP PROCEDURE create_slow_log_table;;
-delimiter ;
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
-CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field 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') default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', 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') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', originator int(10) NOT NULL, time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events';
+CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field 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') default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', 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') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', originator int(10) NOT NULL, time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', 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) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events';
CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM;
diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql
index 07aa932cda2..6af79f3b049 100644
--- a/scripts/mysql_system_tables_data.sql
+++ b/scripts/mysql_system_tables_data.sql
@@ -17,5 +17,7 @@ CREATE TEMPORARY TABLE tmp_user LIKE user;
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 VALUES (@@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);
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 (host,user) VALUES ('localhost','');
+INSERT INTO tmp_user (host,user) VALUES (@@hostname,'');
INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0;
DROP TABLE tmp_user;
diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql
index 6fbf20a2c9f..78e6a0ceb57 100644
--- a/scripts/mysql_system_tables_fix.sql
+++ b/scripts/mysql_system_tables_fix.sql
@@ -388,6 +388,29 @@ ALTER TABLE proc MODIFY db
MODIFY comment
char(64) collate utf8_bin DEFAULT '' NOT NULL;
+ALTER TABLE proc ADD character_set_client
+ char(32) collate utf8_bin DEFAULT NULL
+ AFTER comment;
+ALTER TABLE proc MODIFY character_set_client
+ char(32) collate utf8_bin DEFAULT NULL;
+
+ALTER TABLE proc ADD collation_connection
+ char(32) collate utf8_bin DEFAULT NULL
+ AFTER character_set_client;
+ALTER TABLE proc MODIFY collation_connection
+ char(32) collate utf8_bin DEFAULT NULL;
+
+ALTER TABLE proc ADD db_collation
+ char(32) collate utf8_bin DEFAULT NULL
+ AFTER collation_connection;
+ALTER TABLE proc MODIFY db_collation
+ char(32) collate utf8_bin DEFAULT NULL;
+
+ALTER TABLE proc ADD body_utf8 longblob DEFAULT NULL
+ AFTER db_collation;
+ALTER TABLE proc MODIFY body_utf8 longblob DEFAULT NULL;
+
+
#
# EVENT privilege
#
@@ -440,12 +463,35 @@ ALTER TABLE event ADD sql_mode
'HIGH_NOT_PRECEDENCE'
) DEFAULT '' NOT NULL AFTER on_completion;
ALTER TABLE event MODIFY name char(64) CHARACTER SET utf8 NOT NULL default '';
-ALTER TABLE event ADD COLUMN originator INT(10) NOT NULL;
+ALTER TABLE event ADD COLUMN originator INT(10) NOT NULL AFTER comment;
ALTER TABLE event MODIFY COLUMN status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED';
ALTER TABLE event ADD COLUMN time_zone char(64) CHARACTER SET latin1
NOT NULL DEFAULT 'SYSTEM' AFTER originator;
+ALTER TABLE event ADD character_set_client
+ char(32) collate utf8_bin DEFAULT NULL
+ AFTER time_zone;
+ALTER TABLE event MODIFY character_set_client
+ char(32) collate utf8_bin DEFAULT NULL;
+
+ALTER TABLE event ADD collation_connection
+ char(32) collate utf8_bin DEFAULT NULL
+ AFTER character_set_client;
+ALTER TABLE event MODIFY collation_connection
+ char(32) collate utf8_bin DEFAULT NULL;
+
+ALTER TABLE event ADD db_collation
+ char(32) collate utf8_bin DEFAULT NULL
+ AFTER collation_connection;
+ALTER TABLE event MODIFY db_collation
+ char(32) collate utf8_bin DEFAULT NULL;
+
+ALTER TABLE event ADD body_utf8 longblob DEFAULT NULL
+ AFTER db_collation;
+ALTER TABLE event MODIFY body_utf8 longblob DEFAULT NULL;
+
+
#
# TRIGGER privilege
#
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index bfaa1d57ed2..d9c1a16e21a 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -2,16 +2,28 @@
# Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB
# This file is public domain and comes with NO WARRANTY of any kind
#
-# scripts to start the MySQL daemon and restart it if it dies unexpectedly
+# Script to start the MySQL daemon and restart it if it dies unexpectedly
#
# This should be executed in the MySQL base directory if you are using a
-# binary installation that has other paths than you are using.
+# binary installation that is not installed in its compile-time default
+# location
#
# mysql.server works by first doing a cd to the base directory and from there
# executing mysqld_safe
KILL_MYSQLD=1;
MYSQLD=
+niceness=0
+# Initial logging status: error log is not open, and not using syslog
+logging=init
+want_syslog=0
+syslog_tag=
+user=@MYSQLD_USER@
+pid_file=
+err_log=
+
+syslog_tag_mysqld=mysqld
+syslog_tag_mysqld_safe=mysqld_safe
trap '' 1 2 3 15 # we shouldn't let anyone kill us
@@ -38,6 +50,9 @@ Usage: $0 [OPTIONS]
--mysqld-version=VERSION Use "mysqld-VERSION" as mysqld
--nice=NICE Set the scheduling priority of mysqld
--skip-kill-mysqld Don't try to kill stray mysqld processes
+ --syslog Log messages to syslog with 'logger'
+ --skip-syslog Log messages to error log (default)
+ --syslog-tag=TAG Pass -t "mysqld-TAG" to 'logger'
All other options are passed to the mysqld program.
@@ -45,6 +60,79 @@ EOF
exit 1
}
+my_which ()
+{
+ save_ifs="${IFS-UNSET}"
+ IFS=:
+ for file
+ do
+ for dir in $PATH
+ do
+ if [ -f "$dir/$file" ]
+ then
+ echo "$dir/$file"
+ continue 2
+ fi
+ done
+ return 1 # Failure, didn't find file in path
+ done
+ if [ "$save_ifs" = UNSET ]
+ then
+ unset IFS
+ else
+ IFS="$save_ifs"
+ fi
+ return 0 # Success
+}
+
+log_generic () {
+ priority="$1"
+ shift
+
+ msg="`date +'%y%m%d %H:%M:%S'` mysqld_safe $*"
+ echo "$msg"
+ case $logging in
+ init) ;; # Just echo the message, don't save it anywhere
+ file) echo "$msg" >> "$err_log" ;;
+ syslog) logger -t "$syslog_tag_mysqld_safe" -p "$priority" "$*" ;;
+ *)
+ echo "Internal program error (non-fatal):" \
+ " unknown logging method '$logging'" >&2
+ ;;
+ esac
+}
+
+log_error () {
+ log_generic daemon.error "$@" >&2
+}
+
+log_notice () {
+ log_generic daemon.notice "$@"
+}
+
+eval_log_error () {
+ cmd="$1"
+ case $logging in
+ file) cmd="$cmd >> "`shell_quote_string "$err_log"`" 2>&1" ;;
+ syslog)
+ # mysqld often prefixes its messages with a timestamp, which is
+ # redundant when logging to syslog (which adds its own timestamp)
+ # However, we don't strip the timestamp with sed here, because
+ # sed buffers output (only GNU sed supports a -u (unbuffered) option)
+ # which means that messages may not get sent to syslog until the
+ # mysqld process quits.
+ cmd="$cmd 2>&1 | logger -t '$syslog_tag_mysqld' -p daemon.error"
+ ;;
+ *)
+ echo "Internal program error (non-fatal):" \
+ " unknown logging method '$logging'" >&2
+ ;;
+ esac
+
+ #echo "Running mysqld: [$cmd]"
+ eval "$cmd"
+}
+
shell_quote_string() {
# This sed command makes sure that any special chars are quoted,
# so the arg gets passed exactly to the server.
@@ -63,41 +151,42 @@ parse_arguments() {
fi
for arg do
+ val=`echo "$arg" | sed -e "s;--[^=]*=;;"`
case "$arg" in
- --skip-kill-mysqld*)
- KILL_MYSQLD=0;
- ;;
# these get passed explicitly to mysqld
- --basedir=*) MY_BASEDIR_VERSION=`echo "$arg" | sed -e "s;--basedir=;;"` ;;
- --datadir=*) DATADIR=`echo "$arg" | sed -e "s;--datadir=;;"` ;;
- --pid-file=*) pid_file=`echo "$arg" | sed -e "s;--pid-file=;;"` ;;
- --user=*) user=`echo "$arg" | sed -e "s;--[^=]*=;;"` ; SET_USER=1 ;;
+ --basedir=*) MY_BASEDIR_VERSION="$val" ;;
+ --datadir=*) DATADIR="$val" ;;
+ --pid-file=*) pid_file="$val" ;;
+ --user=*) user="$val"; SET_USER=1 ;;
# these might have been set in a [mysqld_safe] section of my.cnf
# they are added to mysqld command line to override settings from my.cnf
- --log-error=*) err_log=`echo "$arg" | sed -e "s;--log-error=;;"` ;;
- --socket=*) mysql_unix_port=`echo "$arg" | sed -e "s;--socket=;;"` ;;
- --port=*) mysql_tcp_port=`echo "$arg" | sed -e "s;--port=;;"` ;;
+ --log-error=*) err_log="$val" ;;
+ --port=*) mysql_tcp_port="$val" ;;
+ --socket=*) mysql_unix_port="$val" ;;
# mysqld_safe-specific options - must be set in my.cnf ([mysqld_safe])!
- --ledir=*) ledir=`echo "$arg" | sed -e "s;--ledir=;;"` ;;
- --open-files-limit=*) open_files=`echo "$arg" | sed -e "s;--open-files-limit=;;"` ;;
- --core-file-size=*) core_file_size=`echo "$arg" | sed -e "s;--core-file-size=;;"` ;;
- --timezone=*) TZ=`echo "$arg" | sed -e "s;--timezone=;;"` ; export TZ; ;;
- --mysqld=*) MYSQLD=`echo "$arg" | sed -e "s;--mysqld=;;"` ;;
+ --core-file-size=*) core_file_size="$val" ;;
+ --ledir=*) ledir="$val" ;;
+ --mysqld=*) MYSQLD="$val" ;;
--mysqld-version=*)
- tmp=`echo "$arg" | sed -e "s;--mysqld-version=;;"`
- if test -n "$tmp"
- then
- MYSQLD="mysqld-$tmp"
- else
- MYSQLD="mysqld"
- fi
- ;;
- --nice=*) niceness=`echo "$arg" | sed -e "s;--nice=;;"` ;;
- --help)
- usage
+ if test -n "$val"
+ then
+ MYSQLD="mysqld-$val"
+ else
+ MYSQLD="mysqld"
+ fi
;;
+ --nice=*) niceness="$val" ;;
+ --open-files-limit=*) open_files="$val" ;;
+ --skip-kill-mysqld*) KILL_MYSQLD=0 ;;
+ --syslog) want_syslog=1 ;;
+ --skip-syslog) want_syslog=0 ;;
+ --syslog-tag=*) syslog_tag="$val" ;;
+ --timezone=*) TZ="$val"; export TZ; ;;
+
+ --help) usage ;;
+
*)
if test -n "$pick_args"
then
@@ -120,8 +209,7 @@ then
MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are
ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is
# Check for the directories we would expect from a source install
-elif test -f ./share/mysql/english/errmsg.sys -a \
- -x ./libexec/mysqld
+elif test -f ./share/mysql/english/errmsg.sys -a -x ./libexec/mysqld
then
MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are
ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld is
@@ -156,17 +244,17 @@ if test -z "$MYSQL_HOME"
then
if test -r "$MY_BASEDIR_VERSION/my.cnf" && test -r "$DATADIR/my.cnf"
then
- echo "WARNING: Found two instances of my.cnf -"
- echo "$MY_BASEDIR_VERSION/my.cnf and"
- echo "$DATADIR/my.cnf"
- echo "IGNORING $DATADIR/my.cnf"
- echo
+ log_error "WARNING: Found two instances of my.cnf -
+$MY_BASEDIR_VERSION/my.cnf and
+$DATADIR/my.cnf
+IGNORING $DATADIR/my.cnf"
+
MYSQL_HOME=$MY_BASEDIR_VERSION
elif test -r "$DATADIR/my.cnf"
then
- echo "WARNING: Found $DATADIR/my.cnf"
- echo "Datadir is deprecated place for my.cnf, please move it to $MY_BASEDIR_VERSION"
- echo
+ log_error "WARNING: Found $DATADIR/my.cnf
+The data directory is a deprecated location for my.cnf, please move it to
+$MY_BASEDIR_VERSION/my.cnf"
MYSQL_HOME=$DATADIR
else
MYSQL_HOME=$MY_BASEDIR_VERSION
@@ -174,12 +262,6 @@ then
fi
export MYSQL_HOME
-user=@MYSQLD_USER@
-niceness=0
-
-# these rely on $DATADIR by default, so we'll set them later on
-pid_file=
-err_log=
# Get first arguments from the my.cnf file, groups [mysqld] and [mysqld_safe]
# and then merge with the command line arguments
@@ -201,16 +283,98 @@ append_arg_to_args () {
}
args=
+
SET_USER=2
parse_arguments `$print_defaults $defaults --loose-verbose mysqld server`
if test $SET_USER -eq 2
then
SET_USER=0
fi
+
parse_arguments `$print_defaults $defaults --loose-verbose mysqld_safe safe_mysqld`
parse_arguments PICK-ARGS-FROM-ARGV "$@"
-safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}}
+# Determine what logging facility to use
+
+# Ensure that 'logger' exists, if it's requested
+if [ $want_syslog -eq 1 ]
+then
+ my_which logger > /dev/null 2>&1
+ if [ $? -ne 0 ]
+ then
+ log_error "--syslog requested, but no 'logger' program found. Please ensure that 'logger' is in your PATH, or do not specify the --syslog option to mysqld_safe."
+ exit 1
+ fi
+fi
+
+if [ -n "$err_log" -o $want_syslog -eq 0 ]
+then
+ if [ -n "$err_log" ]
+ then
+ # mysqld adds ".err" if there is no extension on the --log-error
+ # argument; must match that here, or mysqld_safe will write to a
+ # different log file than mysqld
+
+ # mysqld does not add ".err" to "--log-error=foo."; it considers a
+ # trailing "." as an extension
+ if expr "$err_log" : '.*\.[^/]*$' > /dev/null
+ then
+ :
+ else
+ err_log="$err_log".err
+ fi
+
+ case "$err_log" in
+ /* ) ;;
+ * ) err_log="$DATADIR/$err_log" ;;
+ esac
+ else
+ err_log=$DATADIR/`@HOSTNAME@`.err
+ fi
+
+ append_arg_to_args "--log-error=$err_log"
+
+ if [ $want_syslog -eq 1 ]
+ then
+ # User explicitly asked for syslog, so warn that it isn't used
+ log_error "Can't log to error log and syslog at the same time. Remove all --log-error configuration options for --syslog to take effect."
+ fi
+
+ # Log to err_log file
+ log_notice "Logging to '$err_log'."
+ logging=file
+else
+ if [ -n "$syslog_tag" ]
+ then
+ # Sanitize the syslog tag
+ syslog_tag=`echo "$syslog_tag" | sed -e 's/[^a-zA-Z0-9_-]/_/g'`
+ syslog_tag_mysqld_safe="${syslog_tag_mysqld_safe}-$syslog_tag"
+ syslog_tag_mysqld="${syslog_tag_mysqld}-$syslog_tag"
+ fi
+ log_notice "Logging to syslog."
+ logging=syslog
+fi
+
+USER_OPTION=""
+if test -w / -o "$USER" = "root"
+then
+ if test "$user" != "root" -o $SET_USER = 1
+ then
+ USER_OPTION="--user=$user"
+ fi
+ # Change the err log to the right user, if it is in use
+ if [ $want_syslog -eq 0 ]; then
+ touch $err_log
+ chown $user $err_log
+ fi
+ if test -n "$open_files"
+ then
+ ulimit -n $open_files
+ append_arg_to_args "--open-files-limit=$open_files"
+ fi
+fi
+
+safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}}
# Make sure that directory for $safe_mysql_unix_port exists
mysql_unix_port_dir=`dirname $safe_mysql_unix_port`
if [ ! -d $mysql_unix_port_dir ]
@@ -228,12 +392,11 @@ fi
if test ! -x $ledir/$MYSQLD
then
- echo "The file $ledir/$MYSQLD doesn't exist or is not executable"
- echo "Please do a cd to the mysql installation directory and restart"
- echo "this script from there as follows:"
- echo "./bin/mysqld_safe".
- echo "See http://dev.mysql.com/doc/mysql/en/mysqld_safe.html for more"
- echo "information"
+ log_error "The file $ledir/$MYSQLD
+does not exist or is not executable. Please cd to the mysql installation
+directory and restart this script from there as follows:
+./bin/mysqld_safe&
+See http://dev.mysql.com/doc/mysql/en/mysqld_safe.html for more information"
exit 1
fi
@@ -248,30 +411,6 @@ else
fi
append_arg_to_args "--pid-file=$pid_file"
-if [ -n "$err_log" ]
-then
- # mysqld adds ".err" if there is no extension on the --log-err
- # argument; must match that here, or mysqld_safe will write to a
- # different log file than mysqld
-
- # mysqld does not add ".err" to "--log-error=foo."; it considers a
- # trailing "." as an extension
- if expr "$err_log" : '.*\.[^/]*$' > /dev/null
- then
- :
- else
- err_log="$err_log".err
- fi
-
- case "$err_log" in
- /* ) ;;
- * ) err_log="$DATADIR/$err_log" ;;
- esac
-else
- err_log=$DATADIR/`@HOSTNAME@`.err
-fi
-append_arg_to_args "--log-error=$err_log"
-
if test -n "$mysql_unix_port"
then
append_arg_to_args "--socket=$mysql_unix_port"
@@ -296,7 +435,7 @@ fi
if nohup nice > /dev/null 2>&1
then
normal_niceness=`nice`
- nohup_niceness=`nohup nice`
+ nohup_niceness=`nohup nice 2>/dev/null`
numeric_nice_values=1
for val in $normal_niceness $nohup_niceness
@@ -333,22 +472,6 @@ else
fi
fi
-USER_OPTION=""
-if test -w / -o "$USER" = "root"
-then
- if test "$user" != "root" -o $SET_USER = 1
- then
- USER_OPTION="--user=$user"
- fi
- # If we are root, change the err log to the right user.
- touch $err_log; chown $user $err_log
- if test -n "$open_files"
- then
- ulimit -n $open_files
- append_arg_to_args "--open-files-limit=$open_files"
- fi
-fi
-
# Try to set the core file size (even if we aren't root) because many systems
# don't specify a hard limit on core file size.
if test -n "$core_file_size"
@@ -366,18 +489,17 @@ then
then
if @FIND_PROC@
then # The pid contains a mysqld process
- echo "A mysqld process already exists"
- echo "A mysqld process already exists at " `date` >> $err_log
+ log_error "A mysqld process already exists"
exit 1
fi
fi
rm -f $pid_file
if test -f $pid_file
then
- echo "Fatal error: Can't remove the pid file: $pid_file"
- echo "Fatal error: Can't remove the pid file: $pid_file at " `date` >> $err_log
- echo "Please remove it manually and start $0 again"
- echo "mysqld daemon not started"
+ log_error "Fatal error: Can't remove the pid file:
+$pid_file
+Please remove it manually and start $0 again;
+mysqld daemon not started"
exit 1
fi
fi
@@ -394,33 +516,32 @@ fi
# $MY_BASEDIR_VERSION/bin/myisamchk --silent --force --fast --medium-check $DATADIR/*/*.MYI
# $MY_BASEDIR_VERSION/bin/isamchk --silent --force $DATADIR/*/*.ISM
-echo "Starting $MYSQLD daemon with databases from $DATADIR"
-
# Does this work on all systems?
#if type ulimit | grep "shell builtin" > /dev/null
#then
# ulimit -n 256 > /dev/null 2>&1 # Fix for BSD and FreeBSD systems
#fi
-echo "`date +'%y%m%d %H:%M:%S mysqld started'`" >> $err_log
+cmd="$NOHUP_NICENESS"
+
+for i in "$ledir/$MYSQLD" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \
+ "--datadir=$DATADIR" "$USER_OPTION"
+do
+ cmd="$cmd "`shell_quote_string "$i"`
+done
+cmd="$cmd $args"
+# Avoid 'nohup: ignoring input' warning
+test -n "$NOHUP_NICENESS" && cmd="$cmd < /dev/null"
+
+log_notice "Starting $MYSQLD daemon with databases from $DATADIR"
while true
do
rm -f $safe_mysql_unix_port $pid_file # Some extra safety
- cmd="$NOHUP_NICENESS"
-
- for i in "$ledir/$MYSQLD" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \
- "--datadir=$DATADIR" "$USER_OPTION"
- do
- cmd="$cmd "`shell_quote_string "$i"`
- done
- cmd="$cmd $args >> "`shell_quote_string "$err_log"`" 2>&1"
- #echo "Running mysqld: [$cmd]"
- eval "$cmd"
+ eval_log_error "$cmd"
if test ! -f $pid_file # This is removed if normal shutdown
then
- echo "STOPPING server from pid file $pid_file"
break
fi
@@ -433,7 +554,7 @@ do
# kill -9 is used or the process won't react on the kill.
numofproces=`ps xaww | grep -v "grep" | grep "$ledir/$MYSQLD\>" | grep -c "pid-file=$pid_file"`
- echo -e "\nNumber of processes running now: $numofproces" | tee -a $err_log
+ log_notice "Number of processes running now: $numofproces"
I=1
while test "$I" -le "$numofproces"
do
@@ -446,16 +567,15 @@ do
# echo "TEST $I - $T **"
if kill -9 $T
then
- echo "$MYSQLD process hanging, pid $T - killed" | tee -a $err_log
- else
+ log_error "$MYSQLD process hanging, pid $T - killed"
+ else
break
fi
I=`expr $I + 1`
done
fi
- echo "`date +'%y%m%d %H:%M:%S'` mysqld restarted" | tee -a $err_log
+ log_notice "mysqld restarted"
done
-echo "`date +'%y%m%d %H:%M:%S'` mysqld ended" | tee -a $err_log
-echo "" | tee -a $err_log
+log_notice "mysqld from pid file $pid_file ended"
diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh
index 61cd59457d1..6ad5c77b954 100644
--- a/scripts/mysqlhotcopy.sh
+++ b/scripts/mysqlhotcopy.sh
@@ -821,30 +821,14 @@ sub get_raid_dirs {
sub get_list_of_tables {
my ( $db ) = @_;
- # "use database" cannot cope with database names containing spaces
- # so create a new connection
-
- my $dbh = DBI->connect("dbi:mysql:${db}${dsn};mysql_read_default_group=mysqlhotcopy",
- $opt{user}, $opt{password},
- {
- RaiseError => 1,
- PrintError => 0,
- AutoCommit => 1,
- });
-
- my @dbh_tables = eval { $dbh->tables() };
-
- ## Remove quotes around table names
- my $quote = $dbh->get_info(29); # SQL_IDENTIFIER_QUOTE_CHAR
- if ($quote) {
- foreach (@dbh_tables) {
- s/^$quote(.*)$quote$/$1/;
- s/$quote$quote/$quote/g;
- }
- }
-
- $dbh->disconnect();
- return @dbh_tables;
+ my $tables =
+ eval {
+ $dbh->selectall_arrayref('SHOW TABLES FROM ' .
+ $dbh->quote_identifier($db))
+ } || [];
+ warn "Unable to retrieve list of tables in $db: $@" if $@;
+
+ return (map { $_->[0] } @$tables);
}
sub quote_names {
diff --git a/server-tools/instance-manager/CMakeLists.txt b/server-tools/instance-manager/CMakeLists.txt
index f8a8a7e57d0..2b9bce56ff7 100644..100755
--- a/server-tools/instance-manager/CMakeLists.txt
+++ b/server-tools/instance-manager/CMakeLists.txt
@@ -24,14 +24,14 @@ INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/sql
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
+ 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)
+TARGET_LINK_LIBRARIES(mysqlmanager debug dbug mysys strings taocrypt vio yassl zlib wsock32)
IF(EMBED_MANIFESTS)
MYSQL_EMBED_MANIFEST("mysqlmanager" "asInvoker")
diff --git a/server-tools/instance-manager/angel.cc b/server-tools/instance-manager/angel.cc
index a1892112dc8..64515c8498c 100644
--- a/server-tools/instance-manager/angel.cc
+++ b/server-tools/instance-manager/angel.cc
@@ -176,6 +176,8 @@ static bool create_pid_file()
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(). */
@@ -197,6 +199,7 @@ void reap_child(int __attribute__((unused)) signo)
Set termination status and return.
*************************************************************************/
+extern "C" void terminate(int signo);
void terminate(int signo)
{
shutdown_request_signo= signo;
diff --git a/server-tools/instance-manager/buffer.cc b/server-tools/instance-manager/buffer.cc
index 67be2382523..1c50b11609e 100644
--- a/server-tools/instance-manager/buffer.cc
+++ b/server-tools/instance-manager/buffer.cc
@@ -44,12 +44,12 @@ const uint Buffer::MAX_BUFFER_SIZE= 16777216;
1 - got an error in reserve()
*/
-int Buffer::append(uint position, const char *string, uint len_arg)
+int Buffer::append(size_t position, const char *string, size_t len_arg)
{
if (reserve(position, len_arg))
return 1;
- strnmov(buffer + position, string, len_arg);
+ strnmov((char*) buffer + position, string, len_arg);
return 0;
}
@@ -75,20 +75,20 @@ int Buffer::append(uint position, const char *string, uint len_arg)
1 - realloc error or we have come to the 16Mb barrier
*/
-int Buffer::reserve(uint position, uint len_arg)
+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= (char*) my_realloc(buffer,
+ 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= (uint) (buffer_size*1.5);
+ buffer_size= (size_t) (buffer_size*1.5);
}
return 0;
diff --git a/server-tools/instance-manager/buffer.h b/server-tools/instance-manager/buffer.h
index a551dd98a25..3bd7a714437 100644
--- a/server-tools/instance-manager/buffer.h
+++ b/server-tools/instance-manager/buffer.h
@@ -45,7 +45,7 @@ public:
/*
As append() will invokes realloc() anyway, it's ok if malloc returns 0
*/
- if (!(buffer= (char*) my_malloc(buffer_size, MYF(0))))
+ if (!(buffer= (uchar*) my_malloc(buffer_size, MYF(0))))
buffer_size= 0;
}
@@ -55,11 +55,11 @@ public:
}
public:
- char *buffer;
+ uchar *buffer;
int get_size();
int is_error();
- int append(uint position, const char *string, uint len_arg);
- int reserve(uint position, uint len_arg);
+ 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/commands.cc b/server-tools/instance-manager/commands.cc
index 393aceadca9..56bd720b3e9 100644
--- a/server-tools/instance-manager/commands.cc
+++ b/server-tools/instance-manager/commands.cc
@@ -170,7 +170,7 @@ int Show_instances::write_data(st_net *net)
while ((instance= iterator.next()))
{
Buffer send_buf; /* buffer for packets */
- uint pos= 0;
+ size_t pos= 0;
instance->lock();
@@ -356,7 +356,7 @@ int Show_instance_status::write_data(st_net *net, Instance *instance)
{
Buffer send_buf; /* buffer for packets */
char version_num_buf[MAX_VERSION_LENGTH];
- uint pos= 0;
+ size_t pos= 0;
const char *state_name= instance->get_state_name();
const char *version_tag= "unknown";
@@ -379,7 +379,7 @@ int Show_instance_status::write_data(st_net *net, Instance *instance)
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, (uint) pos))
+ my_net_write(net, send_buf.buffer, pos))
{
return ER_OUT_OF_RESOURCES;
}
@@ -455,7 +455,7 @@ int Show_instance_options::write_header(st_net *net)
int Show_instance_options::write_data(st_net *net, Instance *instance)
{
Buffer send_buff; /* buffer for packets */
- uint pos= 0;
+ 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) ||
@@ -618,7 +618,7 @@ bool Create_instance::init(const char **text)
bool Create_instance::parse_args(const char **text)
{
- uint len;
+ size_t len;
/* Check if we have something (and trim leading spaces). */
@@ -991,13 +991,13 @@ int Show_instance_log::write_header(st_net *net)
int Show_instance_log::write_data(st_net *net, Instance *instance)
{
Buffer send_buff; /* buffer for packets */
- uint pos= 0;
+ size_t pos= 0;
const char *logpath= instance->options.logs[log_type];
File fd;
size_t buff_size;
- int read_len;
+ size_t read_len;
MY_STAT file_stat;
Buffer read_buff;
@@ -1020,8 +1020,8 @@ int Show_instance_log::write_data(st_net *net, Instance *instance)
/* 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, (byte*) read_buff.buffer,
- buff_size, MYF(0))) < 0)
+ if ((read_len= my_read(fd, read_buff.buffer, buff_size, MYF(0))) ==
+ MY_FILE_ERROR)
{
close(fd);
return ER_READ_FILE;
@@ -1029,7 +1029,8 @@ int Show_instance_log::write_data(st_net *net, Instance *instance)
close(fd);
- if (store_to_protocol_packet(&send_buff, read_buff.buffer, &pos, read_len) ||
+ 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;
@@ -1142,7 +1143,7 @@ int Show_instance_log_files::write_data(st_net *net, Instance *instance)
enum { LOG_NAME_BUFFER_SIZE= 20 };
char buff[LOG_NAME_BUFFER_SIZE];
- uint pos= 0;
+ size_t pos= 0;
const char *log_path= "";
const char *log_size= "0";
@@ -1227,12 +1228,12 @@ bool Instance_options_list::init()
C_MODE_START
-static byte* get_item_key(const byte* item, uint* len,
- my_bool __attribute__((unused)) t)
+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 (byte *) lst->get_instance_name()->str;
+ return (uchar *) lst->get_instance_name()->str;
}
static void delete_item(void *item)
@@ -1358,7 +1359,7 @@ Abstract_option_cmd::get_instance_options_list(const LEX_STRING *instance_name)
{
Instance_options_list *lst=
(Instance_options_list *) hash_search(&instance_options_map,
- (byte *) instance_name->str,
+ (uchar *) instance_name->str,
instance_name->length);
if (!lst)
@@ -1368,7 +1369,7 @@ Abstract_option_cmd::get_instance_options_list(const LEX_STRING *instance_name)
if (!lst)
return NULL;
- if (lst->init() || my_hash_insert(&instance_options_map, (byte *) lst))
+ if (lst->init() || my_hash_insert(&instance_options_map, (uchar *) lst))
{
delete lst;
return NULL;
@@ -1458,7 +1459,7 @@ int Abstract_option_cmd::execute_impl(st_net *net, ulong connection_id)
bool Set_option::parse_args(const char **text)
{
- uint len;
+ size_t len;
/* Check if we have something (and trim leading spaces). */
@@ -1632,7 +1633,7 @@ int Set_option::process_option(Instance *instance, Named_value *option)
bool Unset_option::parse_args(const char **text)
{
- uint len;
+ size_t len;
/* Check if we have something (and trim leading spaces). */
diff --git a/server-tools/instance-manager/guardian.cc b/server-tools/instance-manager/guardian.cc
index e114496248e..b49b0ec0a00 100644
--- a/server-tools/instance-manager/guardian.cc
+++ b/server-tools/instance-manager/guardian.cc
@@ -403,6 +403,8 @@ void Guardian::init()
void Guardian::stop_instances()
{
+ static const int NUM_STOP_ATTEMPTS = 100;
+
Instance_map::Iterator instances_it(instance_map);
Instance *instance;
@@ -438,7 +440,34 @@ void Guardian::stop_instances()
/* Request mysqld to stop. */
- instance->kill_mysqld(SIGTERM);
+ 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();
}
diff --git a/server-tools/instance-manager/instance.cc b/server-tools/instance-manager/instance.cc
index edc9c88fe9f..4a1b658737e 100644
--- a/server-tools/instance-manager/instance.cc
+++ b/server-tools/instance-manager/instance.cc
@@ -524,24 +524,17 @@ bool Instance::init(const LEX_STRING *name_arg)
/**
- Complete instance options initialization.
+ @brief Complete instance options initialization.
- SYNOPSIS
- complete_initialization()
-
- RETURN
- FALSE - ok
- TRUE - error
+ @return Error status.
+ @retval FALSE ok
+ @retval TRUE error
*/
bool Instance::complete_initialization()
{
configured= ! options.complete_initialization();
- return FALSE;
- /*
- TODO: return actual status (from
- Instance_options::complete_initialization()) here.
- */
+ return !configured;
}
/**************************************************************************
@@ -644,25 +637,24 @@ bool Instance::is_mysqld_running()
/**
- Start mysqld.
+ @brief Start mysqld.
- SYNOPSIS
- start_mysqld()
-
- DESCRIPTION
- Reset flags and start Instance Monitor thread, which will start mysqld.
+ Reset flags and start Instance Monitor thread, which will start mysqld.
- MT-NOTE: instance must be locked before calling the operation.
+ @note Instance must be locked before calling the operation.
- RETURN
- FALSE - ok
- TRUE - could not start instance
+ @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.
@@ -779,7 +771,7 @@ bool Instance::stop_mysqld()
These operations should also be used in Guardian to manage instances.
*/
-void Instance::kill_mysqld(int signum)
+bool Instance::kill_mysqld(int signum)
{
pid_t mysqld_pid= options.load_pid();
@@ -788,7 +780,7 @@ void Instance::kill_mysqld(int signum)
log_info("Instance '%s': no pid file to send a signal (%d).",
(const char *) get_name()->str,
(int) signum);
- return;
+ return TRUE;
}
log_info("Instance '%s': sending %d to %d...",
@@ -800,7 +792,7 @@ void Instance::kill_mysqld(int signum)
{
log_info("Instance '%s': kill() failed.",
(const char *) get_name()->str);
- return;
+ return TRUE;
}
/* Kill suceeded */
@@ -812,6 +804,8 @@ void Instance::kill_mysqld(int signum)
/* After sucessful hard kill the pidfile need to be removed */
options.unlink_pidfile();
}
+
+ return FALSE;
}
diff --git a/server-tools/instance-manager/instance.h b/server-tools/instance-manager/instance.h
index e87bb49b49c..aa9c923cba1 100644
--- a/server-tools/instance-manager/instance.h
+++ b/server-tools/instance-manager/instance.h
@@ -104,7 +104,7 @@ public:
bool start_mysqld();
bool stop_mysqld();
- void kill_mysqld(int signo);
+ bool kill_mysqld(int signo);
void lock();
void unlock();
diff --git a/server-tools/instance-manager/instance_map.cc b/server-tools/instance-manager/instance_map.cc
index 5d492fe5c11..d7328d51cfe 100644
--- a/server-tools/instance-manager/instance_map.cc
+++ b/server-tools/instance-manager/instance_map.cc
@@ -37,12 +37,12 @@ C_MODE_START
HASH-routines: get key of instance for storing in hash.
*/
-static byte* get_instance_key(const byte* u, uint* len,
- my_bool __attribute__((unused)) t)
+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 (byte *) instance->options.instance_name.str;
+ return (uchar *) instance->options.instance_name.str;
}
/**
@@ -165,7 +165,7 @@ int Instance_map::process_one_option(const LEX_STRING *group,
return 0;
}
- if (!(instance= (Instance *) hash_search(&hash, (byte *) group->str,
+ if (!(instance= (Instance *) hash_search(&hash, (uchar *) group->str,
group->length)))
{
if (!(instance= new Instance()))
@@ -332,7 +332,7 @@ bool Instance_map::is_there_active_instance()
int Instance_map::add_instance(Instance *instance)
{
- return my_hash_insert(&hash, (byte *) instance);
+ return my_hash_insert(&hash, (uchar *) instance);
}
@@ -344,7 +344,7 @@ int Instance_map::add_instance(Instance *instance)
int Instance_map::remove_instance(Instance *instance)
{
- return hash_delete(&hash, (byte *) instance);
+ return hash_delete(&hash, (uchar *) instance);
}
@@ -425,7 +425,7 @@ int Instance_map::create_instance(const LEX_STRING *instance_name,
Instance * Instance_map::find(const LEX_STRING *name)
{
- return (Instance *) hash_search(&hash, (byte *) name->str, name->length);
+ return (Instance *) hash_search(&hash, (uchar *) name->str, name->length);
}
@@ -603,12 +603,12 @@ int create_instance_in_file(const LEX_STRING *instance_name,
return ER_ACCESS_OPTION_FILE;
}
- if (my_write(cnf_file, (byte*)NEWLINE, NEWLINE_LEN, MYF(MY_NABP)) ||
- my_write(cnf_file, (byte*)"[", 1, MYF(MY_NABP)) ||
- my_write(cnf_file, (byte*)instance_name->str, instance_name->length,
+ 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, (byte*)"]", 1, MYF(MY_NABP)) ||
- my_write(cnf_file, (byte*)NEWLINE, NEWLINE_LEN, 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,
@@ -631,8 +631,8 @@ int create_instance_in_file(const LEX_STRING *instance_name,
option_str_len= ptr - option_str;
- if (my_write(cnf_file, (byte*)option_str, option_str_len, MYF(MY_NABP)) ||
- my_write(cnf_file, (byte*)NEWLINE, NEWLINE_LEN, MYF(MY_NABP)))
+ 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,
diff --git a/server-tools/instance-manager/instance_options.cc b/server-tools/instance-manager/instance_options.cc
index 6b23df97f7f..8b96d6f0f96 100644
--- a/server-tools/instance-manager/instance_options.cc
+++ b/server-tools/instance-manager/instance_options.cc
@@ -156,7 +156,8 @@ int Instance_options::get_default_option(char *result, size_t result_len,
goto err;
/* +2 eats first "--" from the option string (E.g. "--datadir") */
- rc= parse_output_and_get_value(cmd.buffer, option_name + 2,
+ rc= parse_output_and_get_value((char*) cmd.buffer,
+ option_name + 2, strlen(option_name + 2),
result, result_len, GET_VALUE);
err:
return rc;
@@ -194,8 +195,8 @@ bool Instance_options::fill_instance_version()
bzero(result, MAX_VERSION_LENGTH);
- if (parse_output_and_get_value(cmd.buffer, "Ver", result,
- MAX_VERSION_LENGTH, GET_LINE))
+ 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);
@@ -206,8 +207,7 @@ bool Instance_options::fill_instance_version()
{
char *start;
- /* chop the newline from the end of the version string */
- result[strlen(result) - NEWLINE_LEN]= '\0';
+
/* trim leading whitespaces */
start= result;
while (my_isspace(default_charset_info, *start))
@@ -255,7 +255,8 @@ bool Instance_options::fill_mysqld_real_path()
bzero(result, FN_REFLEN);
- if (parse_output_and_get_value(cmd.buffer, "Usage: ",
+ if (parse_output_and_get_value((char*) cmd.buffer,
+ STRING_WITH_LEN("Usage: "),
result, FN_REFLEN,
GET_LINE))
{
@@ -466,13 +467,9 @@ bool Instance_options::complete_initialization()
Need to copy the path to allocated memory, as convert_dirname() might
need to change it
*/
- mysqld_path.str=
- alloc_root(&alloc, strlen(Options::Main::default_mysqld_path) + 1);
-
+ mysqld_path.str= strdup_root(&alloc, Options::Main::default_mysqld_path);
if (!mysqld_path.str)
return TRUE;
-
- strcpy(mysqld_path.str, Options::Main::default_mysqld_path);
}
mysqld_path.length= strlen(mysqld_path.str);
diff --git a/server-tools/instance-manager/listener.cc b/server-tools/instance-manager/listener.cc
index e68ba2fe8ce..4d8a33e7db1 100644
--- a/server-tools/instance-manager/listener.cc
+++ b/server-tools/instance-manager/listener.cc
@@ -56,6 +56,7 @@ static void set_no_inherit(int socket)
#endif
}
+const int Listener::LISTEN_BACK_LOG_SIZE= 5; /* standard backlog size */
Listener::Listener(Thread_registry *thread_registry_arg,
User_map *user_map_arg)
diff --git a/server-tools/instance-manager/listener.h b/server-tools/instance-manager/listener.h
index 21427cfe185..964fb361fb5 100644
--- a/server-tools/instance-manager/listener.h
+++ b/server-tools/instance-manager/listener.h
@@ -39,7 +39,7 @@ protected:
virtual void run();
private:
- static const int LISTEN_BACK_LOG_SIZE= 5; /* standard backlog size */
+ static const int LISTEN_BACK_LOG_SIZE;
private:
Thread_info thread_info;
diff --git a/server-tools/instance-manager/mysql_connection.cc b/server-tools/instance-manager/mysql_connection.cc
index 293d90420b1..bf08f963aa3 100644
--- a/server-tools/instance-manager/mysql_connection.cc
+++ b/server-tools/instance-manager/mysql_connection.cc
@@ -62,8 +62,8 @@ C_MODE_START
void my_net_local_init(NET *net)
{
net->max_packet= net_buffer_length;
- net->read_timeout= net_read_timeout;
- net->write_timeout= net_write_timeout;
+ 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;
}
@@ -147,12 +147,12 @@ int Mysql_connection::check_connection()
ulong pkt_len=0; // to hold client reply length
/* buffer for the first packet */ /* packet contains: */
- char buff[MAX_VERSION_LENGTH + 1 + // server version, 0-ended
- 4 + // connection id
- SCRAMBLE_LENGTH + 2 + // scramble (in 2 pieces)
- 18]; // server variables: flags,
+ 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,
- char *pos= buff;
+ uchar *pos= buff;
ulong server_flags;
memcpy(pos, mysqlmanager_version.str, mysqlmanager_version.length + 1);
@@ -195,7 +195,8 @@ int Mysql_connection::check_connection()
/* write connection message and read reply */
enum { MIN_HANDSHAKE_SIZE= 2 };
- if (net_write_command(&net, protocol_version, "", 0, buff, pos - buff) ||
+ 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)
{
@@ -211,17 +212,17 @@ int Mysql_connection::check_connection()
}
client_capabilities|= ((ulong) uint2korr(net.read_pos + 2)) << 16;
- pos= (char*) net.read_pos + 32;
+ pos= net.read_pos + 32;
/* At least one byte for username and one byte for password */
- if (pos >= (char*) net.read_pos + pkt_len + 2)
+ 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= pos;
+ const char *user= (char*) pos;
const char *password= strend(user)+1;
ulong password_len= *password++;
LEX_STRING user_name= { (char *) user, password - user - 2 };
diff --git a/server-tools/instance-manager/options.cc b/server-tools/instance-manager/options.cc
index 74e7812ea72..7eba3187dd9 100644
--- a/server-tools/instance-manager/options.cc
+++ b/server-tools/instance-manager/options.cc
@@ -152,14 +152,14 @@ static struct my_option my_long_options[] =
#ifndef __WIN__
{ "angel-pid-file", OPT_ANGEL_PID_FILE, "Pid file for angel process.",
- (gptr *) &Options::Daemon::angel_pid_file_name,
- (gptr *) &Options::Daemon::angel_pid_file_name,
+ (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.",
- (gptr *) &Options::Main::bind_address,
- (gptr *) &Options::Main::bind_address,
+ (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,
@@ -172,15 +172,15 @@ static struct my_option my_long_options[] =
#ifndef DBUG_OFF
{"debug", '#', "Debug log.",
- (gptr *) &Options::Debug::config_str,
- (gptr *) &Options::Debug::config_str,
+ (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.",
- (gptr *) &Options::Main::default_mysqld_path,
- (gptr *) &Options::Main::default_mysqld_path,
+ (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,
@@ -193,8 +193,8 @@ static struct my_option my_long_options[] =
#ifdef __WIN__
{ "install", OPT_INSTALL_SERVICE, "Install as system service.",
- (gptr *) &Options::Service::install_as_service,
- (gptr *) &Options::Service::install_as_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
@@ -204,22 +204,22 @@ static struct my_option my_long_options[] =
#ifndef __WIN__
{ "log", OPT_LOG, "Path to log file. Used only with --run-as-service.",
- (gptr *) &Options::Daemon::log_file_name,
- (gptr *) &Options::Daemon::log_file_name,
+ (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.",
- (gptr *) &Options::Main::monitoring_interval,
- (gptr *) &Options::Main::monitoring_interval,
+ (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",
- (gptr *) &Options::Main::mysqld_safe_compatible,
- (gptr *) &Options::Main::mysqld_safe_compatible,
+ (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,
@@ -227,61 +227,61 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "password", OPT_PASSWORD, "Password to update the password file",
- (gptr *) &Options::User_management::password,
- (gptr *) &Options::User_management::password,
+ (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.",
- (gptr *) &Options::Main::password_file_name,
- (gptr *) &Options::Main::password_file_name,
+ (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.",
- (gptr *) &Options::Main::pid_file_name,
- (gptr *) &Options::Main::pid_file_name,
+ (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",
- (gptr *) &Options::Main::port_number,
- (gptr *) &Options::Main::port_number,
+ (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.",
- (gptr *) &Options::Service::remove_service,
- (gptr *) &Options::Service::remove_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.",
- (gptr *) &Options::Daemon::run_as_service,
+ (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.",
- (gptr *) &Options::Main::socket_file_name,
- (gptr *) &Options::Main::socket_file_name,
+ (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.",
- (gptr *) &Options::Service::stand_alone,
- (gptr *) &Options::Service::stand_alone,
+ (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",
- (gptr *) &Options::Daemon::user,
- (gptr *) &Options::Daemon::user,
+ (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",
- (gptr *) &Options::User_management::user_name,
- (gptr *) &Options::User_management::user_name,
+ (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,
@@ -289,8 +289,8 @@ static struct my_option my_long_options[] =
{ "wait-timeout", OPT_WAIT_TIMEOUT, "The number of seconds IM waits "
"for activity on a connection before closing it.",
- (gptr *) &net_read_timeout,
- (gptr *) &net_read_timeout,
+ (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 }
diff --git a/server-tools/instance-manager/parse.cc b/server-tools/instance-manager/parse.cc
index 3995a265e96..cd20e3bc7ab 100644
--- a/server-tools/instance-manager/parse.cc
+++ b/server-tools/instance-manager/parse.cc
@@ -105,7 +105,7 @@ Named_value_arr::~Named_value_arr()
TOK_NOT_FOUND
*/
-inline Token find_token(const char *word, uint word_len)
+inline Token find_token(const char *word, size_t word_len)
{
int i= 0;
do
@@ -119,7 +119,7 @@ inline Token find_token(const char *word, uint word_len)
}
-Token get_token(const char **text, uint *word_len)
+Token get_token(const char **text, size_t *word_len)
{
get_word(text, word_len);
if (*word_len)
@@ -128,7 +128,7 @@ Token get_token(const char **text, uint *word_len)
}
-Token shift_token(const char **text, uint *word_len)
+Token shift_token(const char **text, size_t *word_len)
{
Token save= get_token(text, word_len);
(*text)+= *word_len;
@@ -157,7 +157,7 @@ static bool parse_long(const LEX_STRING *token, long *value)
}
-bool parse_option_value(const char *text, uint *text_len, char **value)
+bool parse_option_value(const char *text, size_t *text_len, char **value)
{
char beginning_quote;
const char *text_start_ptr;
@@ -270,7 +270,7 @@ void skip_spaces(const char **text)
Command *parse_command(const char *text)
{
- uint word_len;
+ size_t word_len;
LEX_STRING instance_name;
Command *command= 0;
diff --git a/server-tools/instance-manager/parse.h b/server-tools/instance-manager/parse.h
index 02bb81749f0..00f7aa237b8 100644
--- a/server-tools/instance-manager/parse.h
+++ b/server-tools/instance-manager/parse.h
@@ -30,7 +30,7 @@ enum Log_type
Command *parse_command(const char *text);
-bool parse_option_value(const char *text, uint *text_len, char **value);
+bool parse_option_value(const char *text, size_t *text_len, char **value);
void skip_spaces(const char **text);
@@ -138,7 +138,7 @@ 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, (gptr) &option, idx);
+ get_dynamic((DYNAMIC_ARRAY *) &arr, (uchar*) &option, idx);
return option;
}
@@ -156,7 +156,7 @@ inline void Named_value_arr::remove_element(int idx)
inline bool Named_value_arr::add_element(Named_value *option)
{
- return insert_dynamic(&arr, (gptr) option);
+ return insert_dynamic(&arr, (uchar*) option);
}
@@ -166,7 +166,7 @@ inline bool Named_value_arr::replace_element(int idx, Named_value *option)
get_element(idx).free();
- return set_dynamic(&arr, (gptr) option, idx);
+ return set_dynamic(&arr, (uchar*) option, idx);
}
/************************************************************************/
@@ -177,7 +177,7 @@ inline bool Named_value_arr::replace_element(int idx, Named_value *option)
if not found returns pointer to first non-space or to '\0', word_len == 0
*/
-inline void get_word(const char **text, uint *word_len,
+inline void get_word(const char **text, size_t *word_len,
enum_seek_method seek_method= ALPHANUM)
{
const char *word_end;
diff --git a/server-tools/instance-manager/parse_output.cc b/server-tools/instance-manager/parse_output.cc
index 36eb5185f6b..3511589acd6 100644
--- a/server-tools/instance-manager/parse_output.cc
+++ b/server-tools/instance-manager/parse_output.cc
@@ -24,6 +24,13 @@
#include "parse.h"
#include "portability.h"
+/**************************************************************************
+ Private module implementation.
+**************************************************************************/
+
+namespace { /* no-indent */
+
+/*************************************************************************/
void trim_space(const char **text, uint *word_len)
{
@@ -39,90 +46,362 @@ void trim_space(const char **text, uint *word_len)
*word_len= (end - start)+1;
}
-/*
- Parse output of the given command
+/*************************************************************************/
- SYNOPSIS
- parse_output_and_get_value()
+/**
+ @brief A facade to the internal workings of optaining the output from an
+ executed system process.
+*/
- command the command to execue with popen.
- word the word to look for (usually an option name)
- result the buffer to store the next word (option value)
- input_buffer_len self-explanatory
- flag this equals to GET_LINE if we want to get all the line after
- the matched word and GET_VALUE otherwise.
+class Mysqld_output_parser
+{
+public:
+ Mysqld_output_parser()
+ { }
- DESCRIPTION
+ virtual ~Mysqld_output_parser()
+ { }
- Parse output of the "command". Find the "word" and return the next one
- if flag is GET_VALUE. Return the rest of the parsed string otherwise.
+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);
- RETURN
- 0 - ok, the word has been found
- 1 - error occured or the word is not found
-*/
+protected:
+ /**
+ @brief Run a process and attach stdout- and stdin-pipes to it.
-int parse_output_and_get_value(const char *command, const char *word,
- char *result, size_t input_buffer_len,
- uint flag)
-{
- FILE *output;
- uint wordlen;
- /* should be enough to store the string from the output */
- enum { MAX_LINE_LEN= 512 };
- char linebuf[MAX_LINE_LEN];
- int rc= 1;
+ @param command The path to the process to be executed
- wordlen= strlen(word);
+ @return Error status.
+ @retval TRUE An error occurred
+ @retval FALSE Operation was a success
+ */
- /*
- Successful return of popen does not tell us whether the command has been
- executed successfully: if the command was not found, we'll get EOF
- when reading the output buffer below.
+ 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
*/
- if (!(output= popen(command, "r")))
- goto err;
- /*
- We want fully buffered stream. We also want system to
- allocate appropriate buffer.
+ virtual bool read_line(char *line_buffer,
+ uint line_buffer_size)= 0;
+
+
+ /**
+ @brief Release any resources needed after a execution and parsing.
*/
- setvbuf(output, NULL, _IOFBF, 0);
- while (fgets(linebuf, sizeof(linebuf) - 1, output))
+ 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= linebuf;
+ char *linep= line_buffer;
+
+ line_buffer[sizeof(line_buffer) - 1]= '\0'; /* safety */
+
+ /* Find the word(s) we are looking for in the line. */
- linebuf[sizeof(linebuf) - 1]= '\0'; /* safety */
+ linep= strstr(linep, option_name_str);
- /*
- Find the word(s) we are looking for in the line
- */
- if ((linep= strstr(linep, word)))
+ if (!linep)
+ continue;
+
+ linep+= option_name_length;
+
+ switch (option_type)
{
- /*
- If we have found our word(s), then move linep past the word(s)
- */
- linep+= wordlen;
- if (flag & GET_VALUE)
+ case GET_VALUE:
+ trim_space((const char**) &linep, &found_word_len);
+
+ if (option_value_buf_size <= found_word_len)
{
- trim_space((const char**) &linep, &found_word_len);
- if (input_buffer_len <= found_word_len)
- goto err;
- strmake(result, linep, found_word_len);
+ cleanup();
+ return TRUE;
}
- else /* currently there are only two options */
- strmake(result, linep, input_buffer_len - 1);
- rc= 0;
+
+ 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 are not interested in the termination status */
- pclose(output);
+ /*
+ We want fully buffered stream. We also want system to allocate
+ appropriate buffer.
+ */
-err:
- return rc;
+ 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/parse_output.h b/server-tools/instance-manager/parse_output.h
index 8851934f230..41618f643a3 100644
--- a/server-tools/instance-manager/parse_output.h
+++ b/server-tools/instance-manager/parse_output.h
@@ -17,11 +17,17 @@
#include <my_global.h>
-#define GET_VALUE 1
-#define GET_LINE 2
+enum enum_option_type
+{
+ GET_VALUE = 1,
+ GET_LINE
+};
-int parse_output_and_get_value(const char *command, const char *word,
- char *result, size_t input_buffer_len,
- uint flag);
+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);
#endif /* INCLUDES_MYSQL_INSTANCE_MANAGER_PARSE_OUTPUT_H */
diff --git a/server-tools/instance-manager/portability.h b/server-tools/instance-manager/portability.h
index eb677a0135c..990e6140a9e 100644
--- a/server-tools/instance-manager/portability.h
+++ b/server-tools/instance-manager/portability.h
@@ -48,11 +48,16 @@ typedef int pid_t;
#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/protocol.cc b/server-tools/instance-manager/protocol.cc
index 05099b59064..8d71fcb8026 100644
--- a/server-tools/instance-manager/protocol.cc
+++ b/server-tools/instance-manager/protocol.cc
@@ -21,7 +21,7 @@
#include <m_string.h>
-static char eof_buff[1]= { (char) 254 }; /* Marker for end of fields */
+static uchar eof_buff[1]= { (char) 254 }; /* Marker for end of fields */
static const char ERROR_PACKET_CODE= (char) 255;
@@ -38,7 +38,7 @@ int net_send_ok(struct st_net *net, unsigned long connection_id,
1-9 + message length message to send (isn't stored if no message)
*/
Buffer buff;
- char *pos= buff.buffer;
+ uchar *pos= buff.buffer;
/* check that we have space to hold mandatory fields */
buff.reserve(0, 23);
@@ -53,7 +53,7 @@ int net_send_ok(struct st_net *net, unsigned long connection_id,
int2store(pos, 0);
pos+= 2;
- uint position= pos - buff.buffer; /* we might need it for message */
+ size_t position= pos - buff.buffer; /* we might need it for message */
if (message != NULL)
{
@@ -82,7 +82,8 @@ int net_send_error(struct st_net *net, uint sql_errno)
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, buff, pos - buff) || net_flush(net);
+ return (my_net_write(net, (uchar*) buff, (size_t) (pos - buff)) ||
+ net_flush(net));
}
@@ -98,7 +99,8 @@ int net_send_error_323(struct st_net *net, uint sql_errno)
int2store(pos, sql_errno);
pos+= 2;
pos= strmake(pos, err, MYSQL_ERRMSG_SIZE - 1) + 1;
- return my_net_write(net, buff, pos - buff) || net_flush(net);
+ return (my_net_write(net, (uchar*) buff, (size_t) (pos - buff)) ||
+ net_flush(net));
}
char *net_store_length(char *pkg, uint length)
@@ -115,8 +117,8 @@ char *net_store_length(char *pkg, uint length)
}
-int store_to_protocol_packet(Buffer *buf, const char *string, uint *position,
- uint string_len)
+int store_to_protocol_packet(Buffer *buf, const char *string, size_t *position,
+ size_t string_len)
{
uint currpos;
@@ -135,9 +137,10 @@ err:
}
-int store_to_protocol_packet(Buffer *buf, const char *string, uint *position)
+int store_to_protocol_packet(Buffer *buf, const char *string,
+ size_t *position)
{
- uint string_len;
+ size_t string_len;
string_len= strlen(string);
return store_to_protocol_packet(buf, string, position, string_len);
@@ -153,15 +156,16 @@ int send_eof(struct st_net *net)
buff[0]=254;
int2store(buff+1, 0);
int2store(buff+3, 0);
- return my_net_write(net, (char*) buff, sizeof buff);
+ return my_net_write(net, buff, sizeof(buff));
}
+
int send_fields(struct st_net *net, LIST *fields)
{
LIST *tmp= fields;
Buffer send_buff;
- char small_buff[4];
- uint position= 0;
+ uchar small_buff[4];
+ size_t position= 0;
LEX_STRING *field;
/* send the number of fileds */
diff --git a/server-tools/instance-manager/protocol.h b/server-tools/instance-manager/protocol.h
index 520b6d4c92c..b06ae4dfdb2 100644
--- a/server-tools/instance-manager/protocol.h
+++ b/server-tools/instance-manager/protocol.h
@@ -36,10 +36,11 @@ 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, uint *position);
+int store_to_protocol_packet(Buffer *buf, const char *string,
+ size_t *position);
-int store_to_protocol_packet(Buffer *buf, const char *string, uint *position,
- uint string_len);
+int store_to_protocol_packet(Buffer *buf, const char *string, size_t *position,
+ size_t string_len);
int send_eof(struct st_net *net);
diff --git a/server-tools/instance-manager/thread_registry.cc b/server-tools/instance-manager/thread_registry.cc
index b06c1240d92..489caa0aaa8 100644
--- a/server-tools/instance-manager/thread_registry.cc
+++ b/server-tools/instance-manager/thread_registry.cc
@@ -27,7 +27,9 @@
enum { THREAD_KICK_OFF_SIGNAL= SIGUSR2 };
-static void handle_signal(int __attribute__((unused)) sig_no)
+extern "C" void handle_signal(int);
+
+void handle_signal(int __attribute__((unused)) sig_no)
{
}
#endif
@@ -64,11 +66,14 @@ Thread_registry::~Thread_registry()
/* Check that no one uses the repository. */
pthread_mutex_lock(&LOCK_thread_registry);
- if (head.next != &head)
- log_error("Not all threads died properly\n");
+ 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 */
- // Disabled assert temporarily - BUG#28030
- // DBUG_ASSERT(head.next == &head);
+ DBUG_ASSERT(head.next == &head);
pthread_mutex_unlock(&LOCK_thread_registry);
pthread_cond_destroy(&COND_thread_registry_is_empty);
diff --git a/server-tools/instance-manager/user_map.cc b/server-tools/instance-manager/user_map.cc
index 832a8cee6b9..49c35c16ca9 100644
--- a/server-tools/instance-manager/user_map.cc
+++ b/server-tools/instance-manager/user_map.cc
@@ -97,12 +97,12 @@ int User::init(const char *line)
C_MODE_START
-static byte* get_user_key(const byte* u, uint* len,
- my_bool __attribute__((unused)) t)
+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 (byte *) user->user;
+ return (uchar *) user->user;
}
static void delete_user(void *u)
@@ -133,7 +133,7 @@ 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))
+ get_user_key, delete_user, 0))
return 1;
initialized= TRUE;
@@ -274,7 +274,7 @@ int User_map::load(const char *password_file_name, const char **err_msg)
return ERR_PASSWORD_FILE_CORRUPTED;
}
- if (my_hash_insert(&hash, (byte *) user))
+ if (my_hash_insert(&hash, (uchar *) user))
{
delete user;
my_fclose(file, MYF(0));
@@ -374,7 +374,7 @@ int User_map::authenticate(const LEX_STRING *user_name,
User *User_map::find_user(const LEX_STRING *user_name)
{
- return (User*) hash_search(&hash, (byte*) user_name->str, user_name->length);
+ return (User*) hash_search(&hash, (uchar*) user_name->str, user_name->length);
}
const User *User_map::find_user(const LEX_STRING *user_name) const
@@ -385,11 +385,11 @@ const User *User_map::find_user(const LEX_STRING *user_name) const
bool User_map::add_user(User *user)
{
- return my_hash_insert(&hash, (byte*) user) == 0 ? FALSE : TRUE;
+ return my_hash_insert(&hash, (uchar*) user) == 0 ? FALSE : TRUE;
}
bool User_map::remove_user(User *user)
{
- return hash_delete(&hash, (byte*) user) == 0 ? FALSE : TRUE;
+ return hash_delete(&hash, (uchar*) user) == 0 ? FALSE : TRUE;
}
diff --git a/sql-common/client.c b/sql-common/client.c
index 2c09498d8f4..baf154dcc43 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -50,7 +50,7 @@
#define MYSQL_CLIENT
#endif
-#define CLI_MYSQL_REAL_CONNECT cli_mysql_real_connect
+#define CLI_MYSQL_REAL_CONNECT STDCALL cli_mysql_real_connect
#undef net_flush
my_bool net_flush(NET *net);
@@ -232,7 +232,7 @@ static int wait_for_data(my_socket fd, uint timeout)
implementations of select that don't adjust tv upon
failure to reflect the time remaining
*/
- start_time = time(NULL);
+ start_time= my_time(0);
for (;;)
{
tv.tv_sec = (long) timeout;
@@ -246,7 +246,7 @@ static int wait_for_data(my_socket fd, uint timeout)
#endif
if (res == 0) /* timeout */
return -1;
- now_time=time(NULL);
+ now_time= my_time(0);
timeout-= (uint) (now_time - start_time);
if (errno != EINTR || (int) timeout <= 0)
return -1;
@@ -397,7 +397,7 @@ HANDLE create_shared_memory(MYSQL *mysql,NET *net, uint connect_timeout)
HANDLE handle_file_map = NULL;
ulong connect_number;
char connect_number_char[22], *p;
- char tmp[64];
+ char *tmp= NULL;
char *suffix_pos;
DWORD error_allow = 0;
DWORD error_code = 0;
@@ -405,13 +405,19 @@ HANDLE create_shared_memory(MYSQL *mysql,NET *net, uint connect_timeout)
char *shared_memory_base_name = mysql->options.shared_memory_base_name;
/*
+ get enough space base-name + '_' + longest suffix we might ever send
+ */
+ if (!(tmp= (char *)my_malloc(strlen(shared_memory_base_name) + 32L, MYF(MY_FAE))))
+ goto err;
+
+ /*
The name of event and file-mapping events create agree next rule:
shared_memory_base_name+unique_part
Where:
shared_memory_base_name is unique value for each server
unique_part is uniquel value for each object (events and file-mapping)
*/
- suffix_pos = strxmov(tmp,shared_memory_base_name,"_",NullS);
+ suffix_pos = strxmov(tmp, "Global\\", shared_memory_base_name, "_", NullS);
strmov(suffix_pos, "CONNECT_REQUEST");
if (!(event_connect_request= OpenEvent(event_access_rights, FALSE, tmp)))
{
@@ -465,8 +471,8 @@ HANDLE create_shared_memory(MYSQL *mysql,NET *net, uint connect_timeout)
unique_part is uniquel value for each object (events and file-mapping)
number_of_connection is number of connection between server and client
*/
- suffix_pos = strxmov(tmp,shared_memory_base_name,"_",connect_number_char,
- "_",NullS);
+ suffix_pos = strxmov(tmp, "Global\\", shared_memory_base_name, "_", connect_number_char,
+ "_", NullS);
strmov(suffix_pos, "DATA");
if ((handle_file_map = OpenFileMapping(FILE_MAP_WRITE,FALSE,tmp)) == NULL)
{
@@ -546,6 +552,8 @@ err2:
CloseHandle(handle_file_map);
}
err:
+ if (tmp)
+ my_free(tmp, MYF(0));
if (error_allow)
error_code = GetLastError();
if (event_connect_request)
@@ -644,14 +652,14 @@ void free_rows(MYSQL_DATA *cur)
if (cur)
{
free_root(&cur->alloc,MYF(0));
- my_free((gptr) cur,MYF(0));
+ my_free((uchar*) cur,MYF(0));
}
}
my_bool
cli_advanced_command(MYSQL *mysql, enum enum_server_command command,
- const char *header, ulong header_length,
- const char *arg, ulong arg_length, my_bool skip_check,
+ const uchar *header, ulong header_length,
+ const uchar *arg, ulong arg_length, my_bool skip_check,
MYSQL_STMT *stmt __attribute__((unused)))
{
NET *net= &mysql->net;
@@ -914,8 +922,8 @@ mysql_free_result(MYSQL_RES *result)
if (result->fields)
free_root(&result->field_alloc,MYF(0));
if (result->row)
- my_free((gptr) result->row,MYF(0));
- my_free((gptr) result,MYF(0));
+ my_free((uchar*) result->row,MYF(0));
+ my_free((uchar*) result,MYF(0));
}
DBUG_VOID_RETURN;
}
@@ -958,7 +966,7 @@ static int add_init_command(struct st_mysql_options *options, const char *cmd)
}
if (!(tmp= my_strdup(cmd,MYF(MY_WME))) ||
- insert_dynamic(options->init_commands, (gptr)&tmp))
+ insert_dynamic(options->init_commands, (uchar*)&tmp))
{
my_free(tmp, MYF(MY_ALLOW_ZERO_PTR));
return 1;
@@ -1170,7 +1178,7 @@ static void cli_fetch_lengths(ulong *to, MYSQL_ROW column,
unsigned int field_count)
{
ulong *prev_length;
- byte *start=0;
+ char *start=0;
MYSQL_ROW end;
prev_length=0; /* Keep gcc happy */
@@ -1218,12 +1226,12 @@ unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
/* fields count may be wrong */
DBUG_ASSERT((uint) (field - result) < fields);
cli_fetch_lengths(&lengths[0], row->data, default_value ? 8 : 7);
- field->catalog = strdup_root(alloc,(char*) row->data[0]);
- field->db = strdup_root(alloc,(char*) row->data[1]);
- field->table = strdup_root(alloc,(char*) row->data[2]);
- field->org_table= strdup_root(alloc,(char*) row->data[3]);
- field->name = strdup_root(alloc,(char*) row->data[4]);
- field->org_name = strdup_root(alloc,(char*) row->data[5]);
+ field->catalog= strmake_root(alloc,(char*) row->data[0], lengths[0]);
+ field->db= strmake_root(alloc,(char*) row->data[1], lengths[1]);
+ field->table= strmake_root(alloc,(char*) row->data[2], lengths[2]);
+ field->org_table= strmake_root(alloc,(char*) row->data[3], lengths[3]);
+ field->name= strmake_root(alloc,(char*) row->data[4], lengths[4]);
+ field->org_name= strmake_root(alloc,(char*) row->data[5], lengths[5]);
field->catalog_length= lengths[0];
field->db_length= lengths[1];
@@ -1244,7 +1252,7 @@ unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
field->flags|= NUM_FLAG;
if (default_value && row->data[7])
{
- field->def=strdup_root(alloc,(char*) row->data[7]);
+ field->def=strmake_root(alloc,(char*) row->data[7], lengths[7]);
field->def_length= lengths[7];
}
else
@@ -1589,7 +1597,7 @@ mysql_ssl_free(MYSQL *mysql __attribute__((unused)))
*/
const char * STDCALL
-mysql_get_ssl_cipher(MYSQL *mysql)
+mysql_get_ssl_cipher(MYSQL *mysql __attribute__((unused)))
{
DBUG_ENTER("mysql_get_ssl_cipher");
#ifdef HAVE_OPENSSL
@@ -2047,13 +2055,11 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
/* If user set read_timeout, let it override the default */
if (mysql->options.read_timeout)
- net->read_timeout= mysql->options.read_timeout;
- vio_timeout(net->vio, 0, net->read_timeout);
+ my_net_set_read_timeout(net, mysql->options.read_timeout);
/* If user set write_timeout, let it override the default */
if (mysql->options.write_timeout)
- net->write_timeout= mysql->options.write_timeout;
- vio_timeout(net->vio, 1, net->write_timeout);
+ my_net_set_write_timeout(net, mysql->options.write_timeout);
if (mysql->options.max_allowed_packet)
net->max_packet_size= mysql->options.max_allowed_packet;
@@ -2296,7 +2302,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
db= 0;
}
/* Write authentication package */
- if (my_net_write(net,buff,(ulong) (end-buff)) || net_flush(net))
+ if (my_net_write(net, (uchar*) buff, (size_t) (end-buff)) || net_flush(net))
{
set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate,
ER(CR_SERVER_LOST_EXTENDED),
@@ -2328,7 +2334,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
password in old format.
*/
scramble_323(buff, mysql->scramble, passwd);
- if (my_net_write(net, buff, SCRAMBLE_LENGTH_323 + 1) || net_flush(net))
+ if (my_net_write(net, (uchar*) buff, SCRAMBLE_LENGTH_323 + 1) ||
+ net_flush(net))
{
set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate,
ER(CR_SERVER_LOST_EXTENDED),
@@ -2453,6 +2460,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,
@@ -2524,7 +2532,8 @@ mysql_select_db(MYSQL *mysql, const char *db)
DBUG_ENTER("mysql_select_db");
DBUG_PRINT("enter",("db: '%s'",db));
- if ((error=simple_command(mysql,COM_INIT_DB,db,(ulong) strlen(db),0)))
+ if ((error=simple_command(mysql,COM_INIT_DB, (const uchar*) db,
+ (ulong) strlen(db),0)))
DBUG_RETURN(error);
my_free(mysql->db,MYF(MY_ALLOW_ZERO_PTR));
mysql->db=my_strdup(db,MYF(MY_WME));
@@ -2575,7 +2584,7 @@ static void mysql_close_free_options(MYSQL *mysql)
static void mysql_close_free(MYSQL *mysql)
{
- my_free((gptr) mysql->host_info,MYF(MY_ALLOW_ZERO_PTR));
+ my_free((uchar*) mysql->host_info,MYF(MY_ALLOW_ZERO_PTR));
my_free(mysql->user,MYF(MY_ALLOW_ZERO_PTR));
my_free(mysql->passwd,MYF(MY_ALLOW_ZERO_PTR));
my_free(mysql->db,MYF(MY_ALLOW_ZERO_PTR));
@@ -2637,7 +2646,7 @@ void STDCALL mysql_close(MYSQL *mysql)
free_old_query(mysql);
mysql->status=MYSQL_STATUS_READY; /* Force command */
mysql->reconnect=0;
- simple_command(mysql,COM_QUIT,NullS,0,1);
+ simple_command(mysql,COM_QUIT,(uchar*) 0,0,1);
end_server(mysql); /* Sets mysql->net.vio= 0 */
}
mysql_close_free_options(mysql);
@@ -2665,7 +2674,7 @@ void STDCALL mysql_close(MYSQL *mysql)
(*mysql->methods->free_embedded_thd)(mysql);
#endif
if (mysql->free_me)
- my_free((gptr) mysql,MYF(0));
+ my_free((uchar*) mysql,MYF(0));
}
DBUG_VOID_RETURN;
}
@@ -2768,7 +2777,7 @@ mysql_send_query(MYSQL* mysql, const char* query, ulong length)
mysql->last_used_con = mysql;
#endif
- DBUG_RETURN(simple_command(mysql, COM_QUERY, query, length, 1));
+ DBUG_RETURN(simple_command(mysql, COM_QUERY, (uchar*) query, length, 1));
}
@@ -2818,7 +2827,7 @@ MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql)
if (!(result->data=
(*mysql->methods->read_rows)(mysql,mysql->fields,mysql->field_count)))
{
- my_free((gptr) result,MYF(0));
+ my_free((uchar*) result,MYF(0));
DBUG_RETURN(0);
}
mysql->affected_rows= result->row_count= result->data->rows;
@@ -2868,7 +2877,7 @@ static MYSQL_RES * cli_use_result(MYSQL *mysql)
if (!(result->row=(MYSQL_ROW)
my_malloc(sizeof(result->row[0])*(mysql->field_count+1), MYF(MY_WME))))
{ /* Ptrs: to one row */
- my_free((gptr) result,MYF(0));
+ my_free((uchar*) result,MYF(0));
DBUG_RETURN(0);
}
result->fields= mysql->fields;
diff --git a/sql-common/my_time.c b/sql-common/my_time.c
index f08e2e00ef3..a1a3e0b6c77 100644
--- a/sql-common/my_time.c
+++ b/sql-common/my_time.c
@@ -301,9 +301,6 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time,
field_length= 6; /* 6 digits */
}
continue;
-
- /* No part seconds */
- date[++i]= 0;
}
while (str != end &&
(my_ispunct(&my_charset_latin1,*str) ||
@@ -569,12 +566,12 @@ my_bool str_to_time(const char *str, uint length, MYSQL_TIME *l_time,
/* Fix the date to assume that seconds was given */
if (!found_hours && !found_days)
{
- bmove_upp((char*) (date+4), (char*) (date+state),
+ bmove_upp((uchar*) (date+4), (uchar*) (date+state),
sizeof(long)*(state-1));
- bzero((char*) date, sizeof(long)*(4-state));
+ bzero((uchar*) date, sizeof(long)*(4-state));
}
else
- bzero((char*) (date+state), sizeof(long)*(4-state));
+ bzero((uchar*) (date+state), sizeof(long)*(4-state));
}
fractional:
@@ -1147,7 +1144,7 @@ longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res,
ok:
part1=(long) (nr/LL(1000000));
part2=(long) (nr - (longlong) part1*LL(1000000));
- time_res->neg= 0;
+ bzero((char*) time_res, sizeof(*time_res));
time_res->year= (int) (part1/10000L); part1%=10000L;
time_res->month= (int) part1 / 100;
time_res->day= (int) part1 % 100;
diff --git a/sql-common/my_user.c b/sql-common/my_user.c
index fa5b80413bf..16a544387ee 100644
--- a/sql-common/my_user.c
+++ b/sql-common/my_user.c
@@ -31,9 +31,9 @@
host_name_len [OUT] A place to store length of the host name part.
*/
-void parse_user(const char *user_id_str, uint user_id_len,
- char *user_name_str, uint *user_name_len,
- char *host_name_str, uint *host_name_len)
+void parse_user(const char *user_id_str, size_t user_id_len,
+ char *user_name_str, size_t *user_name_len,
+ char *host_name_str, size_t *host_name_len)
{
char *p= strrchr(user_id_str, '@');
diff --git a/sql-common/pack.c b/sql-common/pack.c
index 33c1103fb04..7ff89471b45 100644
--- a/sql-common/pack.c
+++ b/sql-common/pack.c
@@ -94,30 +94,28 @@ my_ulonglong net_field_length_ll(uchar **packet)
Position in 'pkg' after the packed length
*/
-char *
-net_store_length(char *pkg, ulonglong length)
+uchar *net_store_length(uchar *packet, ulonglong length)
{
- uchar *packet=(uchar*) pkg;
if (length < (ulonglong) LL(251))
{
*packet=(uchar) length;
- return (char*) packet+1;
+ return packet+1;
}
/* 251 is reserved for NULL */
if (length < (ulonglong) LL(65536))
{
*packet++=252;
int2store(packet,(uint) length);
- return (char*) packet+2;
+ return packet+2;
}
if (length < (ulonglong) LL(16777216))
{
*packet++=253;
int3store(packet,(ulong) length);
- return (char*) packet+3;
+ return packet+3;
}
*packet++=254;
int8store(packet,length);
- return (char*) packet+8;
+ return packet+8;
}
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index cd1a5527abc..e06846d29fe 100644..100755
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -15,9 +15,10 @@
INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
SET(CMAKE_CXX_FLAGS_DEBUG
- "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR")
+ "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR /Zi")
SET(CMAKE_C_FLAGS_DEBUG
- "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR")
+ "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR /Zi")
+SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /MAP /MAPINFO:EXPORTS")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/extra/yassl/include
@@ -27,9 +28,9 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
)
SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/sql/message.rc
- ${CMAKE_SOURCE_DIR}/sql/message.h
- ${CMAKE_SOURCE_DIR}/sql/sql_yacc.h
- ${CMAKE_SOURCE_DIR}/sql/sql_yacc.cc
+ ${CMAKE_SOURCE_DIR}/sql/message.h
+ ${CMAKE_SOURCE_DIR}/sql/sql_yacc.h
+ ${CMAKE_SOURCE_DIR}/sql/sql_yacc.cc
${CMAKE_SOURCE_DIR}/include/mysql_version.h
${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc
${CMAKE_SOURCE_DIR}/sql/lex_hash.h
@@ -40,7 +41,8 @@ SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/sql/message.rc
ADD_DEFINITIONS(-DMYSQL_SERVER -D_CONSOLE -DHAVE_DLOPEN)
-ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc
+ADD_EXECUTABLE(mysqld
+ ../sql-common/client.c derror.cc des_key_file.cc
discover.cc ../libmysql/errmsg.c field.cc field_conv.cc
filesort.cc gstream.cc
ha_partition.cc
@@ -49,7 +51,7 @@ ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.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
key.cc log.cc lock.cc message.rc
- log_event.cc rpl_record.cc
+ log_event.cc rpl_record.cc rpl_reporting.cc
log_event_old.cc rpl_record_old.cc
message.h mf_iocache.cc my_decimal.cc ../sql-common/my_time.c
mysqld.cc net_serv.cc
@@ -72,20 +74,32 @@ ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc
sql_tablespace.cc events.cc ../sql-common/my_user.c
partition_info.cc rpl_utility.cc rpl_injector.cc sql_locale.cc
rpl_rli.cc rpl_mi.cc sql_servers.cc
- sql_connect.cc scheduler.cc
+ sql_connect.cc scheduler.cc
+ sql_profile.cc
${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
- ${PROJECT_SOURCE_DIR}/sql/sql_yacc.h
- ${PROJECT_SOURCE_DIR}/include/mysqld_error.h
- ${PROJECT_SOURCE_DIR}/include/mysqld_ername.h
- ${PROJECT_SOURCE_DIR}/include/sql_state.h
- ${PROJECT_SOURCE_DIR}/include/mysql_version.h
- ${PROJECT_SOURCE_DIR}/sql/sql_builtin.cc
- ${PROJECT_SOURCE_DIR}/sql/lex_hash.h)
-TARGET_LINK_LIBRARIES(mysqld heap myisam myisammrg mysys yassl zlib dbug yassl
+ ${PROJECT_SOURCE_DIR}/sql/sql_yacc.h
+ ${PROJECT_SOURCE_DIR}/include/mysqld_error.h
+ ${PROJECT_SOURCE_DIR}/include/mysqld_ername.h
+ ${PROJECT_SOURCE_DIR}/include/sql_state.h
+ ${PROJECT_SOURCE_DIR}/include/mysql_version.h
+ ${PROJECT_SOURCE_DIR}/sql/sql_builtin.cc
+ ${PROJECT_SOURCE_DIR}/sql/lex_hash.h)
+
+TARGET_LINK_LIBRARIES(mysqld
+ heap myisam myisammrg mysys yassl zlib debug dbug yassl
taocrypt strings vio regex wsock32 ws2_32)
+SET_TARGET_PROPERTIES(mysqld PROPERTIES OUTPUT_NAME mysqld${MYSQLD_EXE_SUFFIX})
+
+# Work around for 2.4.6 bug, OUTPUT_NAME will not set the right .PDB
+# file name. Note that COMPILE_FLAGS set some temporary pdb during build,
+# LINK_FLAGS sets the real one.
+SET_TARGET_PROPERTIES(mysqld PROPERTIES
+ COMPILE_FLAGS "/Fd${CMAKE_CFG_INTDIR}/mysqld${MYSQLD_EXE_SUFFIX}.pdb"
+ LINK_FLAGS "/PDB:${CMAKE_CFG_INTDIR}/mysqld${MYSQLD_EXE_SUFFIX}.pdb")
+
IF(EMBED_MANIFESTS)
- MYSQL_EMBED_MANIFEST("mysqld" "requireAdministrator")
+ MYSQL_EMBED_MANIFEST("mysqld" "asInvoker")
ENDIF(EMBED_MANIFESTS)
IF(WITH_ARCHIVE_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(mysqld archive)
@@ -108,39 +122,49 @@ ENDIF(WITH_INNOBASE_STORAGE_ENGINE)
ADD_DEPENDENCIES(mysqld GenError)
+# NOTE CMake 2.4.6 creates strange dependencies between files in OUTPUT,
+# so for now we only list one if more than one
+
# Sql Parser custom command
ADD_CUSTOM_COMMAND(
- SOURCE ${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy
- OUTPUT ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
- COMMAND bison.exe ARGS -y -p MYSQL --defines=sql_yacc.h
- --output=sql_yacc.cc sql_yacc.yy
- DEPENDS ${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy)
+ OUTPUT ${PROJECT_SOURCE_DIR}/sql/sql_yacc.h
+# ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
+ COMMAND bison.exe ARGS -y -p MYSQL --defines=sql_yacc.h
+ --output=sql_yacc.cc sql_yacc.yy
+ DEPENDS ${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy)
-ADD_CUSTOM_COMMAND(
- OUTPUT ${PROJECT_SOURCE_DIR}/sql/sql_yacc.h
- COMMAND echo
- DEPENDS ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
-)
-
-# Windows message file
-ADD_CUSTOM_COMMAND(
- SOURCE message.mc
- OUTPUT message.rc message.h
- COMMAND mc ARGS message.mc
- DEPENDS message.mc)
+IF(WIN32)
+ # Windows message file
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${PROJECT_SOURCE_DIR}/sql/message.h
+# ${PROJECT_SOURCE_DIR}/sql/message.rc
+ COMMAND mc ARGS message.mc
+ DEPENDS ${PROJECT_SOURCE_DIR}/sql/message.mc)
+ENDIF(WIN32)
# Gen_lex_hash
ADD_EXECUTABLE(gen_lex_hash gen_lex_hash.cc)
-TARGET_LINK_LIBRARIES(gen_lex_hash dbug mysqlclient wsock32)
+TARGET_LINK_LIBRARIES(gen_lex_hash debug dbug mysqlclient wsock32)
GET_TARGET_PROPERTY(GEN_LEX_HASH_EXE gen_lex_hash LOCATION)
ADD_CUSTOM_COMMAND(
- OUTPUT ${PROJECT_SOURCE_DIR}/sql/lex_hash.h
- COMMAND ${GEN_LEX_HASH_EXE} ARGS > lex_hash.h
- DEPENDS ${GEN_LEX_HASH_EXE}
-)
+ OUTPUT ${PROJECT_SOURCE_DIR}/sql/lex_hash.h
+ COMMAND ${GEN_LEX_HASH_EXE} ARGS > lex_hash.h
+ DEPENDS ${GEN_LEX_HASH_EXE})
+
+ADD_CUSTOM_TARGET(
+ GenServerSource ALL
+ DEPENDS ${PROJECT_SOURCE_DIR}/sql/sql_yacc.h
+# ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
+ ${PROJECT_SOURCE_DIR}/sql/message.h
+# ${PROJECT_SOURCE_DIR}/sql/message.rc
+ ${PROJECT_SOURCE_DIR}/sql/lex_hash.h)
+
+ADD_DEPENDENCIES(mysqld GenServerSource)
-ADD_DEPENDENCIES(mysqld gen_lex_hash)
+# Remove the auto-generated files as part of 'Clean Solution'
+SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
+ "lex_hash.h;message.rc;message.h;sql_yacc.h;sql_yacc.cc")
ADD_LIBRARY(udf_example MODULE udf_example.c udf_example.def)
ADD_DEPENDENCIES(udf_example strings)
-TARGET_LINK_LIBRARIES(udf_example wsock32)
+TARGET_LINK_LIBRARIES(udf_example strings wsock32)
diff --git a/sql/Makefile.am b/sql/Makefile.am
index 87a57b799ee..1d7655fd639 100644
--- a/sql/Makefile.am
+++ b/sql/Makefile.am
@@ -27,18 +27,23 @@ SUBDIRS = share
libexec_PROGRAMS = mysqld
EXTRA_PROGRAMS = gen_lex_hash
bin_PROGRAMS = mysql_tzinfo_to_sql
+
+noinst_LTLIBRARIES= libndb.la \
+ udf_example.la
+
SUPPORTING_LIBS = $(top_builddir)/vio/libvio.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/regex/libregex.a \
$(top_builddir)/strings/libmystrings.a
-mysqld_DEPENDENCIES= @mysql_plugin_libs@ $(SUPPORTING_LIBS)
-LDADD = $(SUPPORTING_LIBS) @ZLIB_LIBS@
-mysqld_LDADD = @MYSQLD_EXTRA_LDFLAGS@ \
+mysqld_DEPENDENCIES= @mysql_plugin_libs@ $(SUPPORTING_LIBS) libndb.la
+LDADD = $(SUPPORTING_LIBS) @ZLIB_LIBS@ @NDB_SCI_LIBS@
+mysqld_LDADD = libndb.la \
+ @MYSQLD_EXTRA_LDFLAGS@ \
@pstack_libs@ \
@mysql_plugin_libs@ \
$(LDADD) $(CXXLDFLAGS) $(WRAPLIBS) @LIBDL@ \
- $(yassl_libs) $(openssl_libs)
+ $(yassl_libs) $(openssl_libs) @MYSQLD_EXTRA_LIBS@
noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
item_strfunc.h item_timefunc.h \
@@ -53,6 +58,7 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
ha_ndbcluster_binlog.h ha_ndbcluster_tables.h \
ha_partition.h rpl_constants.h \
opt_range.h protocol.h rpl_tblmap.h rpl_utility.h \
+ rpl_reporting.h \
log.h sql_show.h rpl_rli.h rpl_mi.h \
sql_select.h structs.h table.h sql_udf.h hash_filo.h \
lex.h lex_symbol.h sql_acl.h sql_crypt.h \
@@ -94,19 +100,19 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.cc \
log_event_old.cc rpl_record_old.cc \
discover.cc time.cc opt_range.cc opt_sum.cc \
records.cc filesort.cc handler.cc \
- ha_ndbcluster.cc ha_ndbcluster_cond.cc \
- ha_ndbcluster_binlog.cc ha_partition.cc \
+ ha_partition.cc \
sql_db.cc sql_table.cc sql_rename.cc sql_crypt.cc \
sql_load.cc mf_iocache.cc field_conv.cc sql_show.cc \
sql_udf.cc sql_analyse.cc sql_analyse.h sql_cache.cc \
slave.cc sql_repl.cc rpl_filter.cc rpl_tblmap.cc \
rpl_utility.cc rpl_injector.cc rpl_rli.cc rpl_mi.cc \
+ rpl_reporting.cc \
sql_union.cc sql_derived.cc \
- client.c sql_client.cc mini_client_errors.c pack.c\
+ sql_client.cc \
stacktrace.c repl_failsafe.h repl_failsafe.cc \
sql_olap.cc sql_view.cc \
gstream.cc spatial.cc sql_help.cc sql_cursor.cc \
- tztime.cc my_time.c my_user.c my_decimal.cc\
+ tztime.cc my_decimal.cc\
sp_head.cc sp_pcontext.cc sp_rcontext.cc sp.cc \
sp_cache.cc parse_file.cc sql_trigger.cc \
event_scheduler.cc event_data_objects.cc \
@@ -115,6 +121,13 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.cc \
sql_builtin.cc sql_tablespace.cc partition_info.cc \
sql_servers.cc
+nodist_mysqld_SOURCES = mini_client_errors.c pack.c client.c my_time.c my_user.c
+
+libndb_la_CPPFLAGS= @ndbcluster_includes@
+libndb_la_SOURCES= ha_ndbcluster.cc \
+ ha_ndbcluster_binlog.cc \
+ ha_ndbcluster_cond.cc
+
gen_lex_hash_SOURCES = gen_lex_hash.cc
gen_lex_hash_LDFLAGS = @NOINST_LDFLAGS@
@@ -138,6 +151,7 @@ DISTCLEANFILES = $(EXTRA_PROGRAMS)
MAINTAINERCLEANFILES = $(BUILT_MAINT_SRC)
AM_YFLAGS = -d --verbose
+# These are listed in 'nodist_mysqld_SOURCES'
link_sources:
rm -f mini_client_errors.c
@LN_CP_F@ $(top_srcdir)/libmysql/errmsg.c mini_client_errors.c
@@ -158,22 +172,7 @@ lex_hash.h: gen_lex_hash.cc lex.h
./gen_lex_hash$(EXEEXT) > $@-t
$(MV) $@-t $@
-# the following four should eventually be moved out of this directory
-ha_ndbcluster.o:ha_ndbcluster.cc ha_ndbcluster.h
- $(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
-
-ha_ndbcluster_cond.o:ha_ndbcluster_cond.cc ha_ndbcluster_cond.h
- $(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
-
-ha_ndbcluster_binlog.o:ha_ndbcluster_binlog.cc ha_ndbcluster_binlog.h
- $(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
-
-#Until we can get rid of dependencies on ha_ndbcluster.h
-handler.o: handler.cc ha_ndbcluster.h
- $(CXXCOMPILE) @ndbcluster_includes@ $(CXXFLAGS) -c $<
-
# For testing of udf_example.so
-noinst_LTLIBRARIES= udf_example.la
udf_example_la_SOURCES= udf_example.c
udf_example_la_LDFLAGS= -module -rpath $(pkglibdir)
diff --git a/sql/derror.cc b/sql/derror.cc
index 0e74d411b1f..3b67e0f5bf0 100644
--- a/sql/derror.cc
+++ b/sql/derror.cc
@@ -31,6 +31,9 @@ static void init_myfunc_errs(void);
DESCRIPTION
This function can be called multiple times to reload the messages.
+ If it fails to load the messages, it will fail softly by initializing
+ the errmesg pointer to an array of empty strings or by keeping the
+ old array if it exists.
RETURN
FALSE OK
@@ -39,7 +42,7 @@ static void init_myfunc_errs(void);
bool init_errmessage(void)
{
- const char **errmsgs;
+ const char **errmsgs, **ptr;
DBUG_ENTER("init_errmessage");
/*
@@ -49,13 +52,20 @@ 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))
- DBUG_RETURN(TRUE);
+ if (read_texts(ERRMSG_FILE, &errmsgs, ER_ERROR_LAST - ER_ERROR_FIRST + 1) &&
+ !errmsgs)
+ {
+ if (!(errmsgs= (const char**) my_malloc((ER_ERROR_LAST-ER_ERROR_FIRST+1)*
+ sizeof(char*), MYF(0))))
+ DBUG_RETURN(TRUE);
+ for (ptr= errmsgs; ptr < errmsgs + ER_ERROR_LAST - ER_ERROR_FIRST; ptr++)
+ *ptr= "";
+ }
/* Register messages for use with my_error(). */
if (my_error_register(errmsgs, ER_ERROR_FIRST, ER_ERROR_LAST))
{
- x_free((gptr) errmsgs);
+ x_free((uchar*) errmsgs);
DBUG_RETURN(TRUE);
}
@@ -66,20 +76,20 @@ 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 */
static bool read_texts(const char *file_name,const char ***point,
uint error_messages)
{
register uint i;
- uint count,funktpos,length,textcount;
+ uint count,funktpos,textcount;
+ size_t length;
File file;
char name[FN_REFLEN];
- const char *buff;
+ uchar *buff;
uchar head[32],*pos;
+ const char *errmsg;
DBUG_ENTER("read_texts");
- *point=0; // If something goes wrong
LINT_INIT(buff);
funktpos=0;
if ((file=my_open(fn_format(name,file_name,language,"",4),
@@ -88,7 +98,7 @@ static bool read_texts(const char *file_name,const char ***point,
goto err; /* purecov: inspected */
funktpos=1;
- if (my_read(file,(byte*) head,32,MYF(MY_NABP))) goto err;
+ if (my_read(file,(uchar*) head,32,MYF(MY_NABP))) goto err;
if (head[0] != (uchar) 254 || head[1] != (uchar) 254 ||
head[2] != 2 || head[3] != 1)
goto err; /* purecov: inspected */
@@ -119,25 +129,27 @@ but it should contain at least %d error messages.\n\
Check that the above file is the right version for this program!",
name,count,error_messages);
VOID(my_close(file,MYF(MY_WME)));
- unireg_abort(1);
+ DBUG_RETURN(1);
}
- x_free((gptr) *point); /* Free old language */
+ x_free((uchar*) *point); /* Free old language */
if (!(*point= (const char**)
- my_malloc((uint) (length+count*sizeof(char*)),MYF(0))))
+ my_malloc((size_t) (length+count*sizeof(char*)),MYF(0))))
{
funktpos=2; /* purecov: inspected */
goto err; /* purecov: inspected */
}
- buff= (char*) (*point + count);
+ buff= (uchar*) (*point + count);
- if (my_read(file,(byte*) buff,(uint) count*2,MYF(MY_NABP))) goto err;
- for (i=0, pos= (uchar*) buff ; i< count ; i++)
+ if (my_read(file, buff, (size_t) count*2,MYF(MY_NABP)))
+ goto err;
+ for (i=0, pos= buff ; i< count ; i++)
{
- (*point)[i]=buff+uint2korr(pos);
+ (*point)[i]= (char*) buff+uint2korr(pos);
pos+=2;
}
- if (my_read(file,(byte*) buff,(uint) length,MYF(MY_NABP))) goto err;
+ if (my_read(file, buff, length, MYF(MY_NABP)))
+ goto err;
for (i=1 ; i < textcount ; i++)
{
@@ -149,21 +161,20 @@ Check that the above file is the right version for this program!",
err:
switch (funktpos) {
case 2:
- buff="Not enough memory for messagefile '%s'";
+ errmsg= "Not enough memory for messagefile '%s'";
break;
case 1:
- buff="Can't read from messagefile '%s'";
+ errmsg= "Can't read from messagefile '%s'";
break;
default:
- buff="Can't find messagefile '%s'";
+ errmsg= "Can't find messagefile '%s'";
break;
}
- sql_print_error(buff,name);
+ sql_print_error(errmsg, name);
err1:
if (file != FERR)
VOID(my_close(file,MYF(MY_WME)));
- unireg_abort(1);
- DBUG_RETURN(1); // keep compiler happy
+ DBUG_RETURN(1);
} /* read_texts */
diff --git a/sql/discover.cc b/sql/discover.cc
index 395bfbfff45..a7af90c440f 100644
--- a/sql/discover.cc
+++ b/sql/discover.cc
@@ -39,14 +39,13 @@
frmdata and len are set to 0 on error
*/
-int readfrm(const char *name,
- const void **frmdata, uint *len)
+int readfrm(const char *name, uchar **frmdata, size_t *len)
{
int error;
char index_file[FN_REFLEN];
File file;
- ulong read_len;
- char *read_data;
+ size_t read_len;
+ uchar *read_data;
MY_STAT state;
DBUG_ENTER("readfrm");
DBUG_PRINT("enter",("name: '%s'",name));
@@ -68,12 +67,12 @@ int readfrm(const char *name,
// Read whole frm file
error= 3;
- read_data= 0;
+ read_data= 0; // Nothing to free
if (read_string(file, &read_data, read_len))
goto err;
// Setup return data
- *frmdata= (void*) read_data;
+ *frmdata= (uchar*) read_data;
*len= read_len;
error= 0;
@@ -102,21 +101,20 @@ int readfrm(const char *name,
2 Could not write file
*/
-int writefrm(const char *name, const void *frmdata, uint len)
+int writefrm(const char *name, const uchar *frmdata, size_t len)
{
File file;
char index_file[FN_REFLEN];
int error;
DBUG_ENTER("writefrm");
- DBUG_PRINT("enter",("name: '%s' len: %d ",name,len));
- //DBUG_DUMP("frmdata", (char*)frmdata, len);
+ DBUG_PRINT("enter",("name: '%s' len: %lu ",name, (ulong) len));
error= 0;
if ((file=my_create(fn_format(index_file,name,"",reg_ext,
MY_UNPACK_FILENAME|MY_APPEND_EXT),
CREATE_MODE,O_RDWR | O_TRUNC,MYF(MY_WME))) >= 0)
{
- if (my_write(file,(byte*)frmdata,len,MYF(MY_WME | MY_NABP)))
+ if (my_write(file, frmdata, len,MYF(MY_WME | MY_NABP)))
error= 2;
VOID(my_close(file,MYF(0)));
}
diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc
index f5847e603e8..787b04c12c6 100644
--- a/sql/event_data_objects.cc
+++ b/sql/event_data_objects.cc
@@ -20,9 +20,133 @@
#include "event_db_repository.h"
#include "sp_head.h"
+/**
+ @addtogroup Event_Scheduler
+ @{
+*/
#define EVEX_MAX_INTERVAL_VALUE 1000000000L
+/*************************************************************************/
+
+/**
+ Event_creation_ctx -- creation context of events.
+*/
+
+class Event_creation_ctx :public Stored_program_creation_ctx,
+ public Sql_alloc
+{
+public:
+ static bool load_from_db(THD *thd,
+ MEM_ROOT *event_mem_root,
+ const char *db_name,
+ const char *event_name,
+ TABLE *event_tbl,
+ Stored_program_creation_ctx **ctx);
+
+public:
+ virtual Stored_program_creation_ctx *clone(MEM_ROOT *mem_root)
+ {
+ return new (mem_root)
+ Event_creation_ctx(m_client_cs, m_connection_cl, m_db_cl);
+ }
+
+protected:
+ virtual Object_creation_ctx *create_backup_ctx(THD *thd) const
+ {
+ /*
+ We can avoid usual backup/restore employed in stored programs since we
+ know that this is a top level statement and the worker thread is
+ allocated exclusively to execute this event.
+ */
+
+ return NULL;
+ }
+
+private:
+ Event_creation_ctx(CHARSET_INFO *client_cs,
+ CHARSET_INFO *connection_cl,
+ CHARSET_INFO *db_cl)
+ : Stored_program_creation_ctx(client_cs, connection_cl, db_cl)
+ { }
+};
+
+/**************************************************************************
+ Event_creation_ctx implementation.
+**************************************************************************/
+
+bool
+Event_creation_ctx::load_from_db(THD *thd,
+ MEM_ROOT *event_mem_root,
+ const char *db_name,
+ const char *event_name,
+ TABLE *event_tbl,
+ Stored_program_creation_ctx **ctx)
+{
+ /* Load character set/collation attributes. */
+
+ CHARSET_INFO *client_cs;
+ CHARSET_INFO *connection_cl;
+ CHARSET_INFO *db_cl;
+
+ bool invalid_creation_ctx= FALSE;
+
+ if (load_charset(event_mem_root,
+ event_tbl->field[ET_FIELD_CHARACTER_SET_CLIENT],
+ thd->variables.character_set_client,
+ &client_cs))
+ {
+ sql_print_warning("Event '%s'.'%s': invalid value "
+ "in column mysql.event.character_set_client.",
+ (const char *) db_name,
+ (const char *) event_name);
+
+ invalid_creation_ctx= TRUE;
+ }
+
+ if (load_collation(event_mem_root,
+ event_tbl->field[ET_FIELD_COLLATION_CONNECTION],
+ thd->variables.collation_connection,
+ &connection_cl))
+ {
+ sql_print_warning("Event '%s'.'%s': invalid value "
+ "in column mysql.event.collation_connection.",
+ (const char *) db_name,
+ (const char *) event_name);
+
+ invalid_creation_ctx= TRUE;
+ }
+
+ if (load_collation(event_mem_root,
+ event_tbl->field[ET_FIELD_DB_COLLATION],
+ NULL,
+ &db_cl))
+ {
+ sql_print_warning("Event '%s'.'%s': invalid value "
+ "in column mysql.event.db_collation.",
+ (const char *) db_name,
+ (const char *) event_name);
+
+ invalid_creation_ctx= TRUE;
+ }
+
+ /*
+ If we failed to resolve the database collation, load the default one
+ from the disk.
+ */
+
+ if (!db_cl)
+ db_cl= get_default_db_collation(thd, db_name);
+
+ /* Create the context. */
+
+ *ctx= new Event_creation_ctx(client_cs, connection_cl, db_cl);
+
+ return invalid_creation_ctx;
+}
+
+/*************************************************************************/
+
/*
Initiliazes dbname and name of an Event_queue_element_for_exec
object
@@ -42,7 +166,7 @@ Event_queue_element_for_exec::init(LEX_STRING db, LEX_STRING n)
return TRUE;
if (!(name.str= my_strndup(n.str, name.length= n.length, MYF(MY_WME))))
{
- my_free((gptr) dbname.str, MYF(0));
+ my_free((uchar*) dbname.str, MYF(0));
return TRUE;
}
return FALSE;
@@ -58,8 +182,8 @@ Event_queue_element_for_exec::init(LEX_STRING db, LEX_STRING n)
Event_queue_element_for_exec::~Event_queue_element_for_exec()
{
- my_free((gptr) dbname.str, MYF(0));
- my_free((gptr) name.str, MYF(0));
+ my_free((uchar*) dbname.str, MYF(0));
+ my_free((uchar*) name.str, MYF(0));
}
@@ -94,17 +218,18 @@ Event_parse_data::Event_parse_data()
:on_completion(Event_basic::ON_COMPLETION_DROP),
status(Event_basic::ENABLED),
do_not_create(FALSE),
- item_starts(NULL), item_ends(NULL), item_execute_at(NULL),
- starts_null(TRUE), ends_null(TRUE), execute_at_null(TRUE),
- item_expression(NULL), expression(0)
+ body_changed(FALSE),
+ item_starts(NULL), item_ends(NULL), item_execute_at(NULL),
+ starts_null(TRUE), ends_null(TRUE), execute_at_null(TRUE),
+ item_expression(NULL), expression(0)
{
DBUG_ENTER("Event_parse_data::Event_parse_data");
/* Actually in the parser STARTS is always set */
starts= ends= execute_at= 0;
- body.str= comment.str= NULL;
- body.length= comment.length= 0;
+ comment.str= NULL;
+ comment.length= 0;
DBUG_VOID_RETURN;
}
@@ -138,82 +263,6 @@ Event_parse_data::init_name(THD *thd, sp_name *spn)
/*
- Set body of the event - what should be executed.
-
- SYNOPSIS
- Event_parse_data::init_body()
- thd THD
-
- NOTE
- The body is extracted by copying all data between the
- start of the body set by another method and the current pointer in Lex.
-
- Some questionable removal of characters is done in here, and that part
- should be refactored when the parser is smarter.
-*/
-
-void
-Event_parse_data::init_body(THD *thd)
-{
- DBUG_ENTER("Event_parse_data::init_body");
- DBUG_PRINT("info", ("body: '%s' body_begin: 0x%lx end: 0x%lx", body_begin,
- (long) body_begin, (long) thd->lex->ptr));
-
- body.length= thd->lex->ptr - body_begin;
- const char *body_end= body_begin + body.length - 1;
-
- /* Trim nuls or close-comments ('*'+'/') or spaces at the end */
- while (body_begin < body_end)
- {
-
- if ((*body_end == '\0') ||
- (my_isspace(thd->variables.character_set_client, *body_end)))
- { /* consume NULs and meaningless whitespace */
- --body.length;
- --body_end;
- continue;
- }
-
- /*
- consume closing comments
-
- This is arguably wrong, but it's the best we have until the parser is
- changed to be smarter. FIXME PARSER
-
- See also the sp_head code, where something like this is done also.
-
- One idea is to keep in the lexer structure the count of the number of
- open-comments we've entered, and scan left-to-right looking for a
- closing comment IFF the count is greater than zero.
-
- Another idea is to remove the closing comment-characters wholly in the
- parser, since that's where it "removes" the opening characters.
- */
- if ((*(body_end - 1) == '*') && (*body_end == '/'))
- {
- DBUG_PRINT("info", ("consumend one '*" "/' comment in the query '%s'",
- body_begin));
- body.length-= 2;
- body_end-= 2;
- continue;
- }
-
- break; /* none were found, so we have excised all we can. */
- }
-
- /* the first is always whitespace which I cannot skip in the parser */
- while (my_isspace(thd->variables.character_set_client, *body_begin))
- {
- ++body_begin;
- --body.length;
- }
- body.str= thd->strmake(body_begin, body.length);
-
- DBUG_VOID_RETURN;
-}
-
-
-/*
This function is called on CREATE EVENT or ALTER EVENT. When either
ENDS or AT is in the past, we are trying to create an event that
will never be executed. If it has ON COMPLETION NOT PRESERVE
@@ -409,7 +458,8 @@ Event_parse_data::init_interval(THD *thd)
default:
;/* these are the microsec stuff */
}
- if (interval_tmp.neg || expression > EVEX_MAX_INTERVAL_VALUE)
+ if (interval_tmp.neg || expression == 0 ||
+ expression > EVEX_MAX_INTERVAL_VALUE)
{
my_error(ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG, MYF(0));
DBUG_RETURN(EVEX_BAD_PARAMS);
@@ -615,7 +665,7 @@ Event_parse_data::init_definer(THD *thd)
/* + 1 for @ */
DBUG_PRINT("info",("init definer as whole"));
definer.length= definer_user_len + definer_host_len + 1;
- definer.str= thd->alloc(definer.length + 1);
+ definer.str= (char*) thd->alloc(definer.length + 1);
DBUG_PRINT("info",("copy the user"));
memcpy(definer.str, definer_user, definer_user_len);
@@ -833,36 +883,33 @@ Event_timed::init()
}
-/*
- Loads an event's body from a row from mysql.event
-
- SYNOPSIS
- Event_job_data::load_from_row(THD *thd, TABLE *table)
+/**
+ Load an event's body from a row from mysql.event.
- RETURN VALUE
- 0 OK
- EVEX_GET_FIELD_FAILED Error
+ @details This method is silent on errors and should behave like that.
+ Callers should handle throwing of error messages. The reason is that the
+ class should not know about how to deal with communication.
- NOTES
- This method is silent on errors and should behave like that. Callers
- should handle throwing of error messages. The reason is that the class
- should not know about how to deal with communication.
+ @return Operation status
+ @retval FALSE OK
+ @retval TRUE Error
*/
-int
+bool
Event_job_data::load_from_row(THD *thd, TABLE *table)
{
char *ptr;
uint len;
+ LEX_STRING tz_name;
+
DBUG_ENTER("Event_job_data::load_from_row");
if (!table)
- goto error;
+ DBUG_RETURN(TRUE);
if (table->s->fields < ET_FIELD_COUNT)
- goto error;
+ DBUG_RETURN(TRUE);
- LEX_STRING tz_name;
if (load_string_fields(table->field,
ET_FIELD_DB, &dbname,
ET_FIELD_NAME, &name,
@@ -870,10 +917,13 @@ Event_job_data::load_from_row(THD *thd, TABLE *table)
ET_FIELD_DEFINER, &definer,
ET_FIELD_TIME_ZONE, &tz_name,
ET_FIELD_COUNT))
- goto error;
+ DBUG_RETURN(TRUE);
if (load_time_zone(thd, tz_name))
- goto error;
+ DBUG_RETURN(TRUE);
+
+ Event_creation_ctx::load_from_db(thd, &mem_root, dbname.str, name.str, table,
+ &creation_ctx);
ptr= strchr(definer.str, '@');
@@ -890,29 +940,23 @@ Event_job_data::load_from_row(THD *thd, TABLE *table)
sql_mode= (ulong) table->field[ET_FIELD_SQL_MODE]->val_int();
- DBUG_RETURN(0);
-error:
- DBUG_RETURN(EVEX_GET_FIELD_FAILED);
+ DBUG_RETURN(FALSE);
}
-/*
- Loads an event from a row from mysql.event
-
- SYNOPSIS
- Event_queue_element::load_from_row(THD *thd, TABLE *table)
+/**
+ Load an event's body from a row from mysql.event.
- RETURN VALUE
- 0 OK
- EVEX_GET_FIELD_FAILED Error
+ @details This method is silent on errors and should behave like that.
+ Callers should handle throwing of error messages. The reason is that the
+ class should not know about how to deal with communication.
- NOTES
- This method is silent on errors and should behave like that. Callers
- should handle throwing of error messages. The reason is that the class
- should not know about how to deal with communication.
+ @return Operation status
+ @retval FALSE OK
+ @retval TRUE Error
*/
-int
+bool
Event_queue_element::load_from_row(THD *thd, TABLE *table)
{
char *ptr;
@@ -922,10 +966,10 @@ Event_queue_element::load_from_row(THD *thd, TABLE *table)
DBUG_ENTER("Event_queue_element::load_from_row");
if (!table)
- goto error;
+ DBUG_RETURN(TRUE);
if (table->s->fields < ET_FIELD_COUNT)
- goto error;
+ DBUG_RETURN(TRUE);
if (load_string_fields(table->field,
ET_FIELD_DB, &dbname,
@@ -933,23 +977,24 @@ Event_queue_element::load_from_row(THD *thd, TABLE *table)
ET_FIELD_DEFINER, &definer,
ET_FIELD_TIME_ZONE, &tz_name,
ET_FIELD_COUNT))
- goto error;
+ DBUG_RETURN(TRUE);
if (load_time_zone(thd, tz_name))
- goto error;
+ DBUG_RETURN(TRUE);
starts_null= table->field[ET_FIELD_STARTS]->is_null();
+ my_bool not_used= FALSE;
if (!starts_null)
{
table->field[ET_FIELD_STARTS]->get_date(&time, TIME_NO_ZERO_DATE);
- starts= sec_since_epoch_TIME(&time);
+ starts= my_tz_OFFSET0->TIME_to_gmt_sec(&time,&not_used);
}
ends_null= table->field[ET_FIELD_ENDS]->is_null();
if (!ends_null)
{
table->field[ET_FIELD_ENDS]->get_date(&time, TIME_NO_ZERO_DATE);
- ends= sec_since_epoch_TIME(&time);
+ ends= my_tz_OFFSET0->TIME_to_gmt_sec(&time,&not_used);
}
if (!table->field[ET_FIELD_INTERVAL_EXPR]->is_null())
@@ -966,8 +1011,8 @@ Event_queue_element::load_from_row(THD *thd, TABLE *table)
{
if (table->field[ET_FIELD_EXECUTE_AT]->get_date(&time,
TIME_NO_ZERO_DATE))
- goto error;
- execute_at= sec_since_epoch_TIME(&time);
+ DBUG_RETURN(TRUE);
+ execute_at= my_tz_OFFSET0->TIME_to_gmt_sec(&time,&not_used);
}
/*
@@ -985,13 +1030,13 @@ Event_queue_element::load_from_row(THD *thd, TABLE *table)
table->field[ET_FIELD_TRANSIENT_INTERVAL]->val_str(&str);
if (!(tmp.length= str.length()))
- goto error;
+ DBUG_RETURN(TRUE);
tmp.str= str.c_ptr_safe();
i= find_string_in_array(interval_type_to_name, &tmp, system_charset_info);
if (i < 0)
- goto error;
+ DBUG_RETURN(TRUE);
interval= (interval_type) i;
}
@@ -999,12 +1044,12 @@ Event_queue_element::load_from_row(THD *thd, TABLE *table)
{
table->field[ET_FIELD_LAST_EXECUTED]->get_date(&time,
TIME_NO_ZERO_DATE);
- last_executed= sec_since_epoch_TIME(&time);
+ last_executed= my_tz_OFFSET0->TIME_to_gmt_sec(&time,&not_used);
}
last_executed_changed= FALSE;
if ((ptr= get_field(&mem_root, table->field[ET_FIELD_STATUS])) == NullS)
- goto error;
+ DBUG_RETURN(TRUE);
DBUG_PRINT("load_from_row", ("Event [%s] is [%s]", name.str, ptr));
@@ -1023,40 +1068,34 @@ Event_queue_element::load_from_row(THD *thd, TABLE *table)
break;
}
if ((ptr= get_field(&mem_root, table->field[ET_FIELD_ORIGINATOR])) == NullS)
- goto error;
+ DBUG_RETURN(TRUE);
originator = table->field[ET_FIELD_ORIGINATOR]->val_int();
/* ToDo : Andrey . Find a way not to allocate ptr on event_mem_root */
if ((ptr= get_field(&mem_root,
table->field[ET_FIELD_ON_COMPLETION])) == NullS)
- goto error;
+ DBUG_RETURN(TRUE);
on_completion= (ptr[0]=='D'? Event_queue_element::ON_COMPLETION_DROP:
Event_queue_element::ON_COMPLETION_PRESERVE);
- DBUG_RETURN(0);
-error:
- DBUG_RETURN(EVEX_GET_FIELD_FAILED);
+ DBUG_RETURN(FALSE);
}
-/*
- Loads an event from a row from mysql.event
-
- SYNOPSIS
- Event_timed::load_from_row(THD *thd, TABLE *table)
+/**
+ Load an event's body from a row from mysql.event.
- RETURN VALUE
- 0 OK
- EVEX_GET_FIELD_FAILED Error
+ @details This method is silent on errors and should behave like that.
+ Callers should handle throwing of error messages. The reason is that the
+ class should not know about how to deal with communication.
- NOTES
- This method is silent on errors and should behave like that. Callers
- should handle throwing of error messages. The reason is that the class
- should not know about how to deal with communication.
+ @return Operation status
+ @retval FALSE OK
+ @retval TRUE Error
*/
-int
+bool
Event_timed::load_from_row(THD *thd, TABLE *table)
{
char *ptr;
@@ -1065,13 +1104,24 @@ Event_timed::load_from_row(THD *thd, TABLE *table)
DBUG_ENTER("Event_timed::load_from_row");
if (Event_queue_element::load_from_row(thd, table))
- goto error;
+ DBUG_RETURN(TRUE);
if (load_string_fields(table->field,
ET_FIELD_BODY, &body,
+ ET_FIELD_BODY_UTF8, &body_utf8,
ET_FIELD_COUNT))
- goto error;
+ DBUG_RETURN(TRUE);
+ if (Event_creation_ctx::load_from_db(thd, &mem_root, dbname.str, name.str,
+ table, &creation_ctx))
+ {
+ push_warning_printf(thd,
+ MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_EVENT_INVALID_CREATION_CTX,
+ ER(ER_EVENT_INVALID_CREATION_CTX),
+ (const char *) dbname.str,
+ (const char *) name.str);
+ }
ptr= strchr(definer.str, '@');
@@ -1097,9 +1147,7 @@ Event_timed::load_from_row(THD *thd, TABLE *table)
sql_mode= (ulong) table->field[ET_FIELD_SQL_MODE]->val_int();
- DBUG_RETURN(0);
-error:
- DBUG_RETURN(EVEX_GET_FIELD_FAILED);
+ DBUG_RETURN(FALSE);
}
@@ -1601,7 +1649,7 @@ err:
void
Event_queue_element::mark_last_executed(THD *thd)
{
- thd->end_time();
+ thd->set_current_time();
last_executed= (my_time_t) thd->query_start();
last_executed_changed= TRUE;
@@ -1631,7 +1679,7 @@ Event_queue_element::update_timing_fields(THD *thd)
DBUG_ENTER("Event_queue_element::update_timing_fields");
- DBUG_PRINT("enter", ("name: %*s", name.length, name.str));
+ DBUG_PRINT("enter", ("name: %*s", (int) name.length, name.str));
/* No need to update if nothing has changed */
if (!(status_changed || last_executed_changed))
@@ -1691,7 +1739,8 @@ Event_timed::get_create_event(THD *thd, String *buf)
expr_buf.length(0);
DBUG_ENTER("get_create_event");
- DBUG_PRINT("ret_info",("body_len=[%d]body=[%s]", body.length, body.str));
+ DBUG_PRINT("ret_info",("body_len=[%d]body=[%s]",
+ (int) body.length, body.str));
if (expression && Events::reconstruct_interval_expression(&expr_buf, interval,
expression))
@@ -1834,7 +1883,6 @@ Event_job_data::execute(THD *thd, bool drop)
#ifndef NO_EMBEDDED_ACCESS_CHECKS
Security_context event_sctx, *save_sctx= NULL;
#endif
- CHARSET_INFO *charset_connection;
List<Item> empty_item_list;
bool ret= TRUE;
@@ -1869,7 +1917,7 @@ Event_job_data::execute(THD *thd, bool drop)
"[%s].[%s.%s] execution failed, "
"failed to authenticate the user.",
definer.str, dbname.str, name.str);
- goto end;
+ goto end_no_lex_start;
}
#endif
@@ -1886,11 +1934,11 @@ Event_job_data::execute(THD *thd, bool drop)
"[%s].[%s.%s] execution failed, "
"user no longer has EVENT privilege.",
definer.str, dbname.str, name.str);
- goto end;
+ goto end_no_lex_start;
}
if (construct_sp_sql(thd, &sp_sql))
- goto end;
+ goto end_no_lex_start;
/*
Set up global thread attributes to reflect the properties of
@@ -1899,28 +1947,30 @@ Event_job_data::execute(THD *thd, bool drop)
this is a top level statement and the worker thread is
allocated exclusively to execute this event.
*/
- charset_connection= get_charset_by_csname("utf8",
- MY_CS_PRIMARY, MYF(MY_WME));
- thd->variables.character_set_client= charset_connection;
- thd->variables.character_set_results= charset_connection;
- thd->variables.collation_connection= charset_connection;
- thd->update_charset();
thd->variables.sql_mode= sql_mode;
thd->variables.time_zone= time_zone;
+ /*
+ Peculiar initialization order is a crutch to avoid races in SHOW
+ PROCESSLIST which reads thd->{query/query_length} without a mutex.
+ */
+ thd->query_length= 0;
thd->query= sp_sql.c_ptr_safe();
thd->query_length= sp_sql.length();
- lex_start(thd, thd->query, thd->query_length);
-
- if (MYSQLparse(thd) || thd->is_fatal_error)
{
- sql_print_error("Event Scheduler: "
- "%serror during compilation of %s.%s",
- thd->is_fatal_error ? "fatal " : "",
- (const char *) dbname.str, (const char *) name.str);
- goto end;
+ Lex_input_stream lip(thd, thd->query, thd->query_length);
+ lex_start(thd);
+
+ if (parse_sql(thd, &lip, creation_ctx))
+ {
+ sql_print_error("Event Scheduler: "
+ "%serror during compilation of %s.%s",
+ thd->is_fatal_error ? "fatal " : "",
+ (const char *) dbname.str, (const char *) name.str);
+ goto end;
+ }
}
{
@@ -1933,6 +1983,7 @@ Event_job_data::execute(THD *thd, bool drop)
sphead->m_flags|= sp_head::LOG_GENERAL_LOG;
sphead->set_info(0, 0, &thd->lex->sp_chistics, sql_mode);
+ sphead->set_creation_ctx(creation_ctx);
sphead->optimize();
ret= sphead->execute_procedure(thd, &empty_item_list);
@@ -1943,6 +1994,13 @@ Event_job_data::execute(THD *thd, bool drop)
}
end:
+ if (thd->lex->sphead) /* NULL only if a parse error */
+ {
+ delete thd->lex->sphead;
+ thd->lex->sphead= NULL;
+ }
+
+end_no_lex_start:
if (drop && !thd->is_fatal_error)
{
/*
@@ -1959,17 +2017,17 @@ end:
ret= 1;
else
{
+ /*
+ Peculiar initialization order is a crutch to avoid races in SHOW
+ PROCESSLIST which reads thd->{query/query_length} without a mutex.
+ */
+ thd->query_length= 0;
thd->query= sp_sql.c_ptr_safe();
thd->query_length= sp_sql.length();
if (Events::drop_event(thd, dbname, name, FALSE))
ret= 1;
}
}
- if (thd->lex->sphead) /* NULL only if a parse error */
- {
- delete thd->lex->sphead;
- thd->lex->sphead= NULL;
- }
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (save_sctx)
event_sctx.restore_security_context(thd, save_sctx);
@@ -1978,6 +2036,9 @@ end:
thd->lex->unit.cleanup();
thd->end_statement();
thd->cleanup_after_query();
+ /* Avoid races with SHOW PROCESSLIST */
+ thd->query_length= 0;
+ thd->query= NULL;
DBUG_PRINT("info", ("EXECUTED %s.%s ret: %d", dbname.str, name.str, ret));
@@ -2025,3 +2086,7 @@ event_basic_identifier_equal(LEX_STRING db, LEX_STRING name, Event_basic *b)
return !sortcmp_lex_string(name, b->name, system_charset_info) &&
!sortcmp_lex_string(db, b->dbname, system_charset_info);
}
+
+/**
+ @} (End of group Event_Scheduler)
+*/
diff --git a/sql/event_data_objects.h b/sql/event_data_objects.h
index 8e03ab19602..7a49d1597d6 100644
--- a/sql/event_data_objects.h
+++ b/sql/event_data_objects.h
@@ -15,13 +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 */
+/**
+ @addtogroup Event_Scheduler
+ @{
+
+ @file event_data_objects.h
+*/
#define EVEX_GET_FIELD_FAILED -2
#define EVEX_BAD_PARAMS -5
#define EVEX_MICROSECOND_UNSUP -6
-class sp_head;
-class Sql_alloc;
class Event_queue_element_for_exec
{
@@ -77,7 +81,7 @@ public:
Event_basic();
virtual ~Event_basic();
- virtual int
+ virtual bool
load_from_row(THD *thd, TABLE *table) = 0;
protected:
@@ -119,7 +123,7 @@ public:
Event_queue_element();
virtual ~Event_queue_element();
- virtual int
+ virtual bool
load_from_row(THD *thd, TABLE *table);
bool
@@ -151,13 +155,16 @@ public:
ulong sql_mode;
+ class Stored_program_creation_ctx *creation_ctx;
+ LEX_STRING body_utf8;
+
Event_timed();
virtual ~Event_timed();
void
init();
- virtual int
+ virtual bool
load_from_row(THD *thd, TABLE *table);
int
@@ -174,9 +181,11 @@ public:
ulong sql_mode;
+ class Stored_program_creation_ctx *creation_ctx;
+
Event_job_data();
- virtual int
+ virtual bool
load_from_row(THD *thd, TABLE *table);
bool
@@ -205,12 +214,11 @@ public:
*/
bool do_not_create;
- const char *body_begin;
+ bool body_changed;
LEX_STRING dbname;
LEX_STRING name;
LEX_STRING definer;// combination of user and host
- LEX_STRING body;
LEX_STRING comment;
Item* item_starts;
@@ -235,9 +243,6 @@ public:
bool
check_parse_data(THD *thd);
- void
- init_body(THD *thd);
-
private:
void
@@ -281,5 +286,8 @@ event_basic_db_equal(LEX_STRING db, Event_basic *et);
bool
event_basic_identifier_equal(LEX_STRING db, LEX_STRING name, Event_basic *b);
+/**
+ @} (End of group Event_Scheduler)
+*/
#endif /* _EVENT_DATA_OBJECTS_H_ */
diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc
index e49fd6791a0..705bd8b2704 100644
--- a/sql/event_db_repository.cc
+++ b/sql/event_db_repository.cc
@@ -15,10 +15,16 @@
#include "mysql_priv.h"
#include "event_db_repository.h"
+#include "sp_head.h"
#include "event_data_objects.h"
#include "events.h"
#include "sql_show.h"
+/**
+ @addtogroup Event_Scheduler
+ @{
+*/
+
static
const TABLE_FIELD_W_TYPE event_table_fields[ET_FIELD_COUNT] =
{
@@ -122,6 +128,26 @@ const TABLE_FIELD_W_TYPE event_table_fields[ET_FIELD_COUNT] =
{ C_STRING_WITH_LEN("time_zone") },
{ C_STRING_WITH_LEN("char(64)") },
{ C_STRING_WITH_LEN("latin1") }
+ },
+ {
+ { C_STRING_WITH_LEN("character_set_client") },
+ { C_STRING_WITH_LEN("char(32)") },
+ { C_STRING_WITH_LEN("utf8") }
+ },
+ {
+ { C_STRING_WITH_LEN("collation_connection") },
+ { C_STRING_WITH_LEN("char(32)") },
+ { C_STRING_WITH_LEN("utf8") }
+ },
+ {
+ { C_STRING_WITH_LEN("db_collation") },
+ { C_STRING_WITH_LEN("char(32)") },
+ { C_STRING_WITH_LEN("utf8") }
+ },
+ {
+ { C_STRING_WITH_LEN("body_utf8") },
+ { C_STRING_WITH_LEN("longblob") },
+ { NULL, 0 }
}
};
@@ -134,6 +160,7 @@ const TABLE_FIELD_W_TYPE event_table_fields[ET_FIELD_COUNT] =
@param thd THD
@param table The row to fill out
@param et Event's data
+ @param sp Event stored routine
@param is_update CREATE EVENT or ALTER EVENT
@retval FALSE success
@@ -141,7 +168,10 @@ const TABLE_FIELD_W_TYPE event_table_fields[ET_FIELD_COUNT] =
*/
static bool
-mysql_event_fill_row(THD *thd, TABLE *table, Event_parse_data *et,
+mysql_event_fill_row(THD *thd,
+ TABLE *table,
+ Event_parse_data *et,
+ sp_head *sp,
my_bool is_update)
{
CHARSET_INFO *scs= system_charset_info;
@@ -152,7 +182,6 @@ mysql_event_fill_row(THD *thd, TABLE *table, Event_parse_data *et,
DBUG_PRINT("info", ("dbname=[%s]", et->dbname.str));
DBUG_PRINT("info", ("name =[%s]", et->name.str));
- DBUG_PRINT("info", ("body =[%s]", et->body.str));
if (table->s->fields < ET_FIELD_COUNT)
{
@@ -187,11 +216,18 @@ mysql_event_fill_row(THD *thd, TABLE *table, Event_parse_data *et,
Change the SQL_MODE only if body was present in an ALTER EVENT and of course
always during CREATE EVENT.
*/
- if (et->body.str)
+ if (et->body_changed)
{
+ DBUG_ASSERT(sp->m_body.str);
+
fields[ET_FIELD_SQL_MODE]->store((longlong)thd->variables.sql_mode, TRUE);
- if (fields[f_num= ET_FIELD_BODY]->store(et->body.str, et->body.length, scs))
+
+ if (fields[f_num= ET_FIELD_BODY]->store(sp->m_body.str,
+ sp->m_body.length,
+ scs))
+ {
goto err_truncate;
+ }
}
if (et->expression)
@@ -219,7 +255,7 @@ mysql_event_fill_row(THD *thd, TABLE *table, Event_parse_data *et,
if (!et->starts_null)
{
MYSQL_TIME time;
- my_tz_UTC->gmt_sec_to_TIME(&time, et->starts);
+ my_tz_OFFSET0->gmt_sec_to_TIME(&time, et->starts);
fields[ET_FIELD_STARTS]->set_notnull();
fields[ET_FIELD_STARTS]->store_time(&time, MYSQL_TIMESTAMP_DATETIME);
@@ -228,7 +264,7 @@ mysql_event_fill_row(THD *thd, TABLE *table, Event_parse_data *et,
if (!et->ends_null)
{
MYSQL_TIME time;
- my_tz_UTC->gmt_sec_to_TIME(&time, et->ends);
+ my_tz_OFFSET0->gmt_sec_to_TIME(&time, et->ends);
fields[ET_FIELD_ENDS]->set_notnull();
fields[ET_FIELD_ENDS]->store_time(&time, MYSQL_TIMESTAMP_DATETIME);
@@ -247,7 +283,7 @@ mysql_event_fill_row(THD *thd, TABLE *table, Event_parse_data *et,
fields[ET_FIELD_ENDS]->set_null();
MYSQL_TIME time;
- my_tz_UTC->gmt_sec_to_TIME(&time, et->execute_at);
+ my_tz_OFFSET0->gmt_sec_to_TIME(&time, et->execute_at);
fields[ET_FIELD_EXECUTE_AT]->set_notnull();
fields[ET_FIELD_EXECUTE_AT]->
@@ -271,6 +307,33 @@ mysql_event_fill_row(THD *thd, TABLE *table, Event_parse_data *et,
goto err_truncate;
}
+ fields[ET_FIELD_CHARACTER_SET_CLIENT]->set_notnull();
+ fields[ET_FIELD_CHARACTER_SET_CLIENT]->store(
+ thd->variables.character_set_client->csname,
+ strlen(thd->variables.character_set_client->csname),
+ system_charset_info);
+
+ fields[ET_FIELD_COLLATION_CONNECTION]->set_notnull();
+ fields[ET_FIELD_COLLATION_CONNECTION]->store(
+ thd->variables.collation_connection->name,
+ strlen(thd->variables.collation_connection->name),
+ system_charset_info);
+
+ {
+ CHARSET_INFO *db_cl= get_default_db_collation(thd, et->dbname.str);
+
+ fields[ET_FIELD_DB_COLLATION]->set_notnull();
+ fields[ET_FIELD_DB_COLLATION]->store(
+ db_cl->name, strlen(db_cl->name), system_charset_info);
+ }
+
+ if (et->body_changed)
+ {
+ fields[ET_FIELD_BODY_UTF8]->set_notnull();
+ fields[ET_FIELD_BODY_UTF8]->store(
+ sp->m_body_utf8.str, sp->m_body_utf8.length, system_charset_info);
+ }
+
DBUG_RETURN(FALSE);
err_truncate:
@@ -303,7 +366,7 @@ Event_db_repository::index_read_for_db_for_i_s(THD *thd, TABLE *schema_table,
CHARSET_INFO *scs= system_charset_info;
KEY *key_info;
uint key_len;
- byte *key_buf= NULL;
+ uchar *key_buf= NULL;
LINT_INIT(key_buf);
DBUG_ENTER("Event_db_repository::index_read_for_db_for_i_s");
@@ -324,7 +387,7 @@ Event_db_repository::index_read_for_db_for_i_s(THD *thd, TABLE *schema_table,
event_table->field[ET_FIELD_DB]->store(db, strlen(db), scs);
key_len= key_info->key_part[0].store_length;
- if (!(key_buf= (byte *)alloc_root(thd->mem_root, key_len)))
+ if (!(key_buf= (uchar *)alloc_root(thd->mem_root, key_len)))
{
/* Don't send error, it would be done by sql_alloc_error_handler() */
ret= 1;
@@ -332,8 +395,9 @@ Event_db_repository::index_read_for_db_for_i_s(THD *thd, TABLE *schema_table,
}
key_copy(key_buf, event_table->record[0], key_info, key_len);
- if (!(ret= event_table->file->index_read(event_table->record[0], key_buf,
- (key_part_map)1, HA_READ_PREFIX)))
+ if (!(ret= event_table->file->index_read_map(event_table->record[0], key_buf,
+ (key_part_map)1,
+ HA_READ_PREFIX)))
{
DBUG_PRINT("info",("Found rows. Let's retrieve them. ret=%d", ret));
do
@@ -498,7 +562,7 @@ Event_db_repository::open_event_table(THD *thd, enum thr_lock_type lock_type,
only creates a record on disk.
@pre The thread handle has no open tables.
- @param[in,out] THD
+ @param[in,out] thd THD
@param[in] parse_data Parsed event definition
@param[in] create_if_not TRUE if IF NOT EXISTS clause was provided
to CREATE EVENT statement
@@ -513,15 +577,17 @@ Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data,
{
int ret= 1;
TABLE *table= NULL;
+ sp_head *sp= thd->lex->sphead;
DBUG_ENTER("Event_db_repository::create_event");
DBUG_PRINT("info", ("open mysql.event for update"));
+ DBUG_ASSERT(sp);
if (open_event_table(thd, TL_WRITE, &table))
goto end;
- DBUG_PRINT("info", ("name: %.*s", parse_data->name.length,
+ DBUG_PRINT("info", ("name: %.*s", (int) parse_data->name.length,
parse_data->name.str));
DBUG_PRINT("info", ("check existance of an event with the same name"));
@@ -561,7 +627,7 @@ Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data,
goto end;
}
- if (parse_data->body.length > table->field[ET_FIELD_BODY]->field_length)
+ if (sp->m_body.length > table->field[ET_FIELD_BODY]->field_length)
{
my_error(ER_TOO_LONG_BODY, MYF(0), parse_data->name.str);
goto end;
@@ -573,7 +639,7 @@ Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data,
mysql_event_fill_row() calls my_error() in case of error so no need to
handle it here
*/
- if (mysql_event_fill_row(thd, table, parse_data, FALSE))
+ if (mysql_event_fill_row(thd, table, parse_data, sp, FALSE))
goto end;
table->field[ET_FIELD_STATUS]->store((longlong)parse_data->status, TRUE);
@@ -597,7 +663,7 @@ end:
@param[in,out] thd thread handle
@param[in] parse_data parsed event definition
- @paran[in[ new_dbname not NULL if ALTER EVENT RENAME
+ @param[in] new_dbname not NULL if ALTER EVENT RENAME
points at a new database name
@param[in] new_name not NULL if ALTER EVENT RENAME
points at a new event name
@@ -617,7 +683,9 @@ Event_db_repository::update_event(THD *thd, Event_parse_data *parse_data,
{
CHARSET_INFO *scs= system_charset_info;
TABLE *table= NULL;
+ sp_head *sp= thd->lex->sphead;
int ret= 1;
+
DBUG_ENTER("Event_db_repository::update_event");
/* None or both must be set */
@@ -661,7 +729,7 @@ Event_db_repository::update_event(THD *thd, Event_parse_data *parse_data,
mysql_event_fill_row() calls my_error() in case of error so no need to
handle it here
*/
- if (mysql_event_fill_row(thd, table, parse_data, TRUE))
+ if (mysql_event_fill_row(thd, table, parse_data, sp, TRUE))
goto end;
if (new_dbname)
@@ -750,16 +818,16 @@ end:
@retval FALSE an event with such db/name key exists
- @reval TRUE no record found or an error occured.
+ @retval TRUE no record found or an error occured.
*/
bool
Event_db_repository::find_named_event(LEX_STRING db, LEX_STRING name,
TABLE *table)
{
- byte key[MAX_KEY_LENGTH];
+ uchar key[MAX_KEY_LENGTH];
DBUG_ENTER("Event_db_repository::find_named_event");
- DBUG_PRINT("enter", ("name: %.*s", name.length, name.str));
+ DBUG_PRINT("enter", ("name: %.*s", (int) name.length, name.str));
/*
Create key to find row. We have to use field->store() to be able to
@@ -777,8 +845,8 @@ Event_db_repository::find_named_event(LEX_STRING db, LEX_STRING name,
key_copy(key, table->record[0], table->key_info, table->key_info->key_length);
- if (table->file->index_read_idx(table->record[0], 0, key, HA_WHOLE_KEY,
- HA_READ_KEY_EXACT))
+ if (table->file->index_read_idx_map(table->record[0], 0, key, HA_WHOLE_KEY,
+ HA_READ_KEY_EXACT))
{
DBUG_PRINT("info", ("Row not found"));
DBUG_RETURN(TRUE);
@@ -879,7 +947,8 @@ Event_db_repository::load_named_event(THD *thd, LEX_STRING dbname,
bool ret;
DBUG_ENTER("Event_db_repository::load_named_event");
- DBUG_PRINT("enter",("thd: 0x%lx name: %*s", (long) thd, name.length, name.str));
+ DBUG_PRINT("enter",("thd: 0x%lx name: %*s", (long) thd,
+ (int) name.length, name.str));
if (!(ret= open_event_table(thd, TL_READ, &table)))
{
@@ -941,7 +1010,7 @@ update_timing_fields_for_event(THD *thd,
if (update_last_executed)
{
MYSQL_TIME time;
- my_tz_UTC->gmt_sec_to_TIME(&time, last_executed);
+ my_tz_OFFSET0->gmt_sec_to_TIME(&time, last_executed);
fields[ET_FIELD_LAST_EXECUTED]->set_notnull();
fields[ET_FIELD_LAST_EXECUTED]->store_time(&time,
@@ -1049,3 +1118,7 @@ Event_db_repository::check_system_tables(THD *thd)
DBUG_RETURN(test(ret));
}
+
+/**
+ @} (End of group Event_Scheduler)
+*/
diff --git a/sql/event_db_repository.h b/sql/event_db_repository.h
index 64e19854933..ef778407d1e 100644
--- a/sql/event_db_repository.h
+++ b/sql/event_db_repository.h
@@ -15,8 +15,14 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/*
- @file
+/**
+ @addtogroup Event_Scheduler
+ @{
+
+ @file event_db_repository.h
+
+ Data Dictionary related operations of Event Scheduler.
+
This is a private header file of Events module. Please do not include it
directly. All public declarations of Events module should be stored in
events.h and event_data_objects.h.
@@ -42,6 +48,10 @@ enum enum_events_table_field
ET_FIELD_COMMENT,
ET_FIELD_ORIGINATOR,
ET_FIELD_TIME_ZONE,
+ ET_FIELD_CHARACTER_SET_CLIENT,
+ ET_FIELD_COLLATION_CONNECTION,
+ ET_FIELD_DB_COLLATION,
+ ET_FIELD_BODY_UTF8,
ET_FIELD_COUNT /* a cool trick to count the number of fields :) */
};
@@ -53,6 +63,7 @@ events_table_index_read_for_db(THD *thd, TABLE *schema_table,
int
events_table_scan_all(THD *thd, TABLE *schema_table, TABLE *event_table);
+
class Event_basic;
class Event_parse_data;
@@ -114,4 +125,7 @@ private:
void operator=(Event_db_repository &);
};
+/**
+ @} (End of group Event_Scheduler)
+*/
#endif /* _EVENT_DB_REPOSITORY_H_ */
diff --git a/sql/event_queue.cc b/sql/event_queue.cc
index a7c31429cb3..898fc206c34 100644
--- a/sql/event_queue.cc
+++ b/sql/event_queue.cc
@@ -17,6 +17,10 @@
#include "event_queue.h"
#include "event_data_objects.h"
+/**
+ @addtogroup Event_Scheduler
+ @{
+*/
#define EVENT_QUEUE_INITIAL_SIZE 30
#define EVENT_QUEUE_EXTENT 30
@@ -52,8 +56,9 @@
execute_at.second_part is not considered during comparison
*/
-static int
-event_queue_element_compare_q(void *vptr, byte* a, byte *b)
+extern "C" int event_queue_element_compare_q(void *, uchar *, uchar *);
+
+int event_queue_element_compare_q(void *vptr, uchar* a, uchar *b)
{
my_time_t lhs = ((Event_queue_element *)a)->execute_at;
my_time_t rhs = ((Event_queue_element *)b)->execute_at;
@@ -70,15 +75,17 @@ event_queue_element_compare_q(void *vptr, byte* a, byte *b)
*/
Event_queue::Event_queue()
- :mutex_last_unlocked_at_line(0), mutex_last_locked_at_line(0),
+ :next_activation_at(0),
+ mutex_last_locked_at_line(0),
+ mutex_last_unlocked_at_line(0),
mutex_last_attempted_lock_at_line(0),
+ mutex_last_locked_in_func("n/a"),
+ mutex_last_unlocked_in_func("n/a"),
+ mutex_last_attempted_lock_in_func("n/a"),
mutex_queue_data_locked(FALSE),
mutex_queue_data_attempting_lock(FALSE),
- next_activation_at(0)
+ waiting_on_cond(FALSE)
{
- mutex_last_unlocked_in_func= mutex_last_locked_in_func=
- mutex_last_attempted_lock_in_func= "";
-
pthread_mutex_init(&LOCK_event_queue, MY_MUTEX_INIT_FAST);
pthread_cond_init(&COND_queue_state, NULL);
}
@@ -193,7 +200,7 @@ Event_queue::create_event(THD *thd, Event_queue_element *new_element,
DBUG_PRINT("info", ("new event in the queue: 0x%lx", (long) new_element));
LOCK_QUEUE_DATA();
- *created= (queue_insert_safe(&queue, (byte *) new_element) == FALSE);
+ *created= (queue_insert_safe(&queue, (uchar *) new_element) == FALSE);
dbug_dump_queue(thd->query_start());
pthread_cond_broadcast(&COND_queue_state);
UNLOCK_QUEUE_DATA();
@@ -242,7 +249,7 @@ Event_queue::update_event(THD *thd, LEX_STRING dbname, LEX_STRING name,
if (new_element)
{
DBUG_PRINT("info", ("new event in the queue: 0x%lx", (long) new_element));
- queue_insert_safe(&queue, (byte *) new_element);
+ queue_insert_safe(&queue, (uchar *) new_element);
pthread_cond_broadcast(&COND_queue_state);
}
@@ -548,7 +555,7 @@ Event_queue::get_top_for_execution_if_time(THD *thd,
top= ((Event_queue_element*) queue_element(&queue, 0));
- thd->end_time(); /* Get current time */
+ thd->set_current_time(); /* Get current time */
next_activation_at= top->execute_at;
if (next_activation_at > thd->query_start())
@@ -738,9 +745,16 @@ Event_queue::dump_internal_status()
printf("WOC : %s\n", waiting_on_cond? "YES":"NO");
MYSQL_TIME time;
- my_tz_UTC->gmt_sec_to_TIME(&time, next_activation_at);
- printf("Next activation : %04d-%02d-%02d %02d:%02d:%02d\n",
- time.year, time.month, time.day, time.hour, time.minute, time.second);
+ my_tz_OFFSET0->gmt_sec_to_TIME(&time, next_activation_at);
+ if (time.year != 1970)
+ printf("Next activation : %04d-%02d-%02d %02d:%02d:%02d\n",
+ time.year, time.month, time.day, time.hour, time.minute, time.second);
+ else
+ printf("Next activation : never");
DBUG_VOID_RETURN;
}
+
+/**
+ @} (End of group Event_Scheduler)
+*/
diff --git a/sql/event_queue.h b/sql/event_queue.h
index 04bb8b93b06..2870ecb4d0b 100644
--- a/sql/event_queue.h
+++ b/sql/event_queue.h
@@ -15,12 +15,26 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+/**
+
+ @addtogroup Event_Scheduler
+ @{
+
+ @file event_queue.h
+
+ Queue of events awaiting execution.
+*/
+
class Event_basic;
class Event_queue_element;
class Event_queue_element_for_exec;
class THD;
+/**
+ Queue of active events awaiting execution.
+*/
+
class Event_queue
{
public:
@@ -104,7 +118,9 @@ private:
bool mutex_queue_data_locked;
bool mutex_queue_data_attempting_lock;
bool waiting_on_cond;
-
};
+/**
+ @} (End of group Event_Scheduler)
+*/
#endif /* _EVENT_QUEUE_H_ */
diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc
index 5844fecc227..b03b51f1134 100644
--- a/sql/event_scheduler.cc
+++ b/sql/event_scheduler.cc
@@ -20,6 +20,11 @@
#include "event_queue.h"
#include "event_db_repository.h"
+/**
+ @addtogroup Event_Scheduler
+ @{
+*/
+
#ifdef __GNUC__
#if __GNUC__ >= 2
#define SCHED_FUNC __FUNCTION__
@@ -42,7 +47,6 @@ Event_db_repository *Event_worker_thread::db_repository;
static
const LEX_STRING scheduler_states_names[] =
{
- { C_STRING_WITH_LEN("UNINITIALIZED") },
{ C_STRING_WITH_LEN("INITIALIZED") },
{ C_STRING_WITH_LEN("RUNNING") },
{ C_STRING_WITH_LEN("STOPPING") }
@@ -284,8 +288,7 @@ Event_worker_thread::run(THD *thd, Event_queue_element_for_exec *event)
res= post_init_event_thread(thd);
DBUG_ENTER("Event_worker_thread::run");
- DBUG_PRINT("info", ("Time is %ld, THD: 0x%lx",
- (long) time(NULL), (long) thd));
+ DBUG_PRINT("info", ("Time is %ld, THD: 0x%lx", (long) my_time(0), (long) thd));
if (res)
goto end;
@@ -327,13 +330,21 @@ end:
delete event;
deinit_event_thread(thd);
+
+ DBUG_VOID_RETURN;
}
Event_scheduler::Event_scheduler(Event_queue *queue_arg)
- :state(UNINITIALIZED),
+ :state(INITIALIZED),
scheduler_thd(NULL),
queue(queue_arg),
+ mutex_last_locked_at_line(0),
+ mutex_last_unlocked_at_line(0),
+ mutex_last_locked_in_func("n/a"),
+ mutex_last_unlocked_in_func("n/a"),
+ mutex_scheduler_data_locked(FALSE),
+ waiting_on_cond(FALSE),
started_events(0)
{
pthread_mutex_init(&LOCK_scheduler_state, MY_MUTEX_INIT_FAST);
@@ -784,3 +795,7 @@ Event_scheduler::dump_internal_status()
DBUG_VOID_RETURN;
}
+
+/**
+ @} (End of group Event_Scheduler)
+*/
diff --git a/sql/event_scheduler.h b/sql/event_scheduler.h
index 70635196745..0be93a65d33 100644
--- a/sql/event_scheduler.h
+++ b/sql/event_scheduler.h
@@ -16,10 +16,18 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/**
+ @addtogroup Event_Scheduler
+ @{
+*/
+/**
@file
- This file is internal to Events module. Please do not include it directly.
- All public declarations of Events module are in events.h and
- event_data_objects.h.
+
+ Declarations of the scheduler thread class
+ and related functionality.
+
+ This file is internal to Event_Scheduler module. Please do not
+ include it directly. All public declarations of Event_Scheduler
+ module are in events.h and event_data_objects.h.
*/
@@ -111,8 +119,7 @@ private:
enum enum_state
{
- UNINITIALIZED = 0,
- INITIALIZED,
+ INITIALIZED = 0,
RUNNING,
STOPPING
};
@@ -141,4 +148,8 @@ private:
void operator=(Event_scheduler &);
};
+/**
+ @} (End of group Event_Scheduler)
+*/
+
#endif /* _EVENT_SCHEDULER_H_ */
diff --git a/sql/events.cc b/sql/events.cc
index 7838972a5d6..5246bccc388 100644
--- a/sql/events.cc
+++ b/sql/events.cc
@@ -19,6 +19,12 @@
#include "event_db_repository.h"
#include "event_queue.h"
#include "event_scheduler.h"
+#include "sp_head.h" // for Stored_program_creation_ctx
+
+/**
+ @addtogroup Event_Scheduler
+ @{
+*/
/*
TODO list :
@@ -425,12 +431,7 @@ Events::create_event(THD *thd, Event_parse_data *parse_data,
event_queue->create_event(thd, new_element, &created);
/* Binlog the create event. */
DBUG_ASSERT(thd->query && thd->query_length);
- if (mysql_bin_log.is_open())
- {
- thd->clear_error();
- thd->binlog_query(THD::MYSQL_QUERY_TYPE,
- thd->query, thd->query_length, FALSE, FALSE);
- }
+ write_bin_log(thd, TRUE, thd->query, thd->query_length);
}
}
pthread_mutex_unlock(&LOCK_event_metadata);
@@ -551,12 +552,7 @@ Events::update_event(THD *thd, Event_parse_data *parse_data,
new_element);
/* Binlog the alter event. */
DBUG_ASSERT(thd->query && thd->query_length);
- if (mysql_bin_log.is_open())
- {
- thd->clear_error();
- thd->binlog_query(THD::MYSQL_QUERY_TYPE,
- thd->query, thd->query_length, FALSE, FALSE);
- }
+ write_bin_log(thd, TRUE, thd->query, thd->query_length);
}
}
pthread_mutex_unlock(&LOCK_event_metadata);
@@ -631,12 +627,7 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists)
event_queue->drop_event(thd, dbname, name);
/* Binlog the drop event. */
DBUG_ASSERT(thd->query && thd->query_length);
- if (mysql_bin_log.is_open())
- {
- thd->clear_error();
- thd->binlog_query(THD::MYSQL_QUERY_TYPE,
- thd->query, thd->query_length, FALSE, FALSE);
- }
+ write_bin_log(thd, TRUE, thd->query, thd->query_length);
}
pthread_mutex_unlock(&LOCK_event_metadata);
DBUG_RETURN(ret);
@@ -713,6 +704,15 @@ send_show_create_event(THD *thd, Event_timed *et, Protocol *protocol)
field_list.push_back(new Item_empty_string("Create Event",
show_str.length()));
+ field_list.push_back(
+ new Item_empty_string("character_set_client", MY_CS_NAME_SIZE));
+
+ field_list.push_back(
+ new Item_empty_string("collation_connection", MY_CS_NAME_SIZE));
+
+ field_list.push_back(
+ new Item_empty_string("Database Collation", MY_CS_NAME_SIZE));
+
if (protocol->send_fields(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
DBUG_RETURN(TRUE);
@@ -722,7 +722,17 @@ send_show_create_event(THD *thd, Event_timed *et, Protocol *protocol)
protocol->store(et->name.str, et->name.length, system_charset_info);
protocol->store(sql_mode.str, sql_mode.length, system_charset_info);
protocol->store(tz_name->ptr(), tz_name->length(), system_charset_info);
- protocol->store(show_str.c_ptr(), show_str.length(), system_charset_info);
+ protocol->store(show_str.c_ptr(), show_str.length(),
+ et->creation_ctx->get_client_cs());
+ protocol->store(et->creation_ctx->get_client_cs()->csname,
+ strlen(et->creation_ctx->get_client_cs()->csname),
+ system_charset_info);
+ protocol->store(et->creation_ctx->get_connection_cl()->name,
+ strlen(et->creation_ctx->get_connection_cl()->name),
+ system_charset_info);
+ protocol->store(et->creation_ctx->get_db_cl()->name,
+ strlen(et->creation_ctx->get_db_cl()->name),
+ system_charset_info);
if (protocol->write())
DBUG_RETURN(TRUE);
@@ -785,8 +795,7 @@ Events::show_create_event(THD *thd, LEX_STRING dbname, LEX_STRING name)
Check access rights and fill INFORMATION_SCHEMA.events table.
@param[in,out] thd Thread context
- @param[in] table The temporary table to fill.
- cond Unused
+ @param[in] tables The temporary table to fill.
In MySQL INFORMATION_SCHEMA tables are temporary tables that are
created and filled on demand. In this function, we fill
@@ -1182,3 +1191,7 @@ end:
DBUG_RETURN(ret);
}
+
+/**
+ @} (End of group Event_Scheduler)
+*/
diff --git a/sql/events.h b/sql/events.h
index 1b99b072fd7..2bc87517748 100644
--- a/sql/events.h
+++ b/sql/events.h
@@ -15,9 +15,14 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/*
- @file
- A public interface of Events Scheduler module.
+/**
+ @defgroup Event_Scheduler Event Scheduler
+ @ingroup Runtime_Environment
+ @{
+
+ @file events.h
+
+ A public interface of Events_Scheduler module.
*/
class Event_parse_data;
@@ -42,7 +47,7 @@ int
sortcmp_lex_string(LEX_STRING s, LEX_STRING t, CHARSET_INFO *cs);
/**
- @class Events -- a facade to the functionality of the Event Scheduler.
+ @brief A facade to the functionality of the Event Scheduler.
Every public operation against the scheduler has to be executed via the
interface provided by a static method of this class. No instance of this
@@ -152,5 +157,8 @@ private:
void operator=(Events &);
};
+/**
+ @} (end of group Event Scheduler)
+*/
#endif /* _EVENT_H_ */
diff --git a/sql/field.cc b/sql/field.cc
index 3ae82fe6182..fa93454c757 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -38,8 +38,8 @@
*****************************************************************************/
#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
-template class List<create_field>;
-template class List_iterator<create_field>;
+template class List<Create_field>;
+template class List_iterator<Create_field>;
#endif
uchar Field_null::null[1]={1};
@@ -1051,7 +1051,7 @@ bool Field::type_can_have_key_part(enum enum_field_types type)
/*
Numeric fields base class constructor
*/
-Field_num::Field_num(char *ptr_arg,uint32 len_arg, uchar *null_ptr_arg,
+Field_num::Field_num(uchar *ptr_arg,uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg, utype unireg_check_arg,
const char *field_name_arg,
uint8 dec_arg, bool zero_arg, bool unsigned_arg)
@@ -1071,9 +1071,10 @@ void Field_num::prepend_zeros(String *value)
int diff;
if ((diff= (int) (field_length - value->length())) > 0)
{
- bmove_upp((char*) value->ptr()+field_length,value->ptr()+value->length(),
+ bmove_upp((uchar*) value->ptr()+field_length,
+ (uchar*) value->ptr()+value->length(),
value->length());
- bfill((char*) value->ptr(),diff,'0');
+ bfill((uchar*) value->ptr(),diff,'0');
value->length(field_length);
(void) value->c_ptr_quick(); // Avoid warnings in purify
}
@@ -1155,7 +1156,8 @@ bool Field_num::get_int(CHARSET_INFO *cs, const char *from, uint len,
char *end;
int error;
- *rnd= (longlong) cs->cset->strntoull10rnd(cs, from, len, unsigned_flag, &end,
+ *rnd= (longlong) cs->cset->strntoull10rnd(cs, from, len,
+ unsigned_flag, &end,
&error);
if (unsigned_flag)
{
@@ -1179,7 +1181,8 @@ bool Field_num::get_int(CHARSET_INFO *cs, const char *from, uint len,
goto out_of_range;
}
}
- if (table->in_use->count_cuted_fields && check_int(cs, from, len, end, error))
+ if (table->in_use->count_cuted_fields &&
+ check_int(cs, from, len, end, error))
return 1;
return 0;
@@ -1296,7 +1299,7 @@ String *Field::val_int_as_str(String *val_buffer, my_bool unsigned_val)
}
-Field::Field(char *ptr_arg,uint32 length_arg,uchar *null_ptr_arg,
+Field::Field(uchar *ptr_arg,uint32 length_arg,uchar *null_ptr_arg,
uchar null_bit_arg,
utype unireg_check_arg, const char *field_name_arg)
:ptr(ptr_arg), null_ptr(null_ptr_arg),
@@ -1323,18 +1326,17 @@ void Field::hash(ulong *nr, ulong *nr2)
{
uint len= pack_length();
CHARSET_INFO *cs= charset();
- cs->coll->hash_sort(cs, (uchar*) ptr, len, nr, nr2);
+ cs->coll->hash_sort(cs, ptr, len, nr, nr2);
}
}
-my_size_t
+size_t
Field::do_last_null_byte() const
{
- DBUG_ASSERT(null_ptr == NULL || (byte*) null_ptr >= table->record[0]);
+ DBUG_ASSERT(null_ptr == NULL || null_ptr >= table->record[0]);
if (null_ptr)
- return (byte*) null_ptr - table->record[0] + 1;
- else
- return LAST_NULL_BYTE_UNDEF;
+ return (size_t) (null_ptr - table->record[0]) + 1;
+ return LAST_NULL_BYTE_UNDEF;
}
@@ -1358,6 +1360,84 @@ bool Field::send_binary(Protocol *protocol)
}
+/**
+ Check to see if field size is compatible with destination.
+
+ This method is used in row-based replication to verify that the slave's
+ field size is less than or equal to the master's field size. The
+ encoded field metadata (from the master or source) is decoded and compared
+ to the size of this field (the slave or destination).
+
+ @param field_metadata Encoded size in field metadata
+
+ @retval 0 if this field's size is < the source field's size
+ @retval 1 if this field's size is >= the source field's size
+*/
+int Field::compatible_field_size(uint field_metadata)
+{
+ uint const source_size= pack_length_from_metadata(field_metadata);
+ uint const destination_size= row_pack_length();
+ return (source_size <= destination_size);
+}
+
+
+int Field::store(const char *to, uint length, CHARSET_INFO *cs,
+ enum_check_fields check_level)
+{
+ int res;
+ enum_check_fields old_check_level= table->in_use->count_cuted_fields;
+ table->in_use->count_cuted_fields= check_level;
+ res= store(to, length, cs);
+ table->in_use->count_cuted_fields= old_check_level;
+ return res;
+}
+
+
+/**
+ Unpack a field from row data.
+
+ This method is used to unpack a field from a master whose size
+ of the field is less than that of the slave.
+
+ @param to Destination of the data
+ @param from Source of the data
+ @param param_data Pack length of the field data
+
+ @return New pointer into memory based on from + length of the data
+*/
+const uchar *Field::unpack(uchar* to,
+ const uchar *from,
+ uint param_data)
+{
+ uint length=pack_length();
+ int from_type= 0;
+ /*
+ If from length is > 255, it has encoded data in the upper bits. Need
+ to mask it out.
+ */
+ if (param_data > 255)
+ {
+ from_type= (param_data & 0xff00) >> 8U; // real_type.
+ param_data= param_data & 0x00ff; // length.
+ }
+ uint len= (param_data && (param_data < length)) ?
+ param_data : length;
+ /*
+ If the length is the same, use old unpack method.
+ If the param_data is 0, use the old unpack method.
+ This is possible if the table map was generated from a down-level
+ master or if the data was not available on the master.
+ If the real_types are not the same, use the old unpack method.
+ */
+ if ((length == param_data) ||
+ (param_data == 0) ||
+ (from_type != real_type()))
+ return(unpack(to, from));
+ memcpy(to, from, param_data > length ? length : len);
+ return from+len;
+}
+
+
my_decimal *Field::val_decimal(my_decimal *decimal)
{
/* This never have to be called */
@@ -1488,7 +1568,7 @@ my_decimal* Field_num::val_decimal(my_decimal *decimal_value)
}
-Field_str::Field_str(char *ptr_arg,uint32 len_arg, uchar *null_ptr_arg,
+Field_str::Field_str(uchar *ptr_arg,uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg, utype unireg_check_arg,
const char *field_name_arg, CHARSET_INFO *charset_arg)
:Field(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
@@ -1639,7 +1719,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,
- char *new_ptr, uchar *new_null_ptr,
+ uchar *new_ptr, uchar *new_null_ptr,
uint new_null_bit)
{
Field *tmp;
@@ -1693,7 +1773,7 @@ Field_decimal::reset(void)
void Field_decimal::overflow(bool negative)
{
uint len=field_length;
- char *to=ptr, filler= '9';
+ uchar *to=ptr, filler= '9';
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
if (negative)
@@ -1729,36 +1809,37 @@ void Field_decimal::overflow(bool negative)
}
-int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs)
+int Field_decimal::store(const char *from_arg, uint len, CHARSET_INFO *cs)
{
ASSERT_COLUMN_MARKED_FOR_WRITE;
char buff[STRING_BUFFER_USUAL_SIZE];
String tmp(buff,sizeof(buff), &my_charset_bin);
+ const uchar *from= (uchar*) from_arg;
- /* Convert character set if the old one is multi byte */
+ /* Convert character set if the old one is multi uchar */
if (cs->mbmaxlen > 1)
{
uint dummy_errors;
- tmp.copy(from, len, cs, &my_charset_bin, &dummy_errors);
- from= tmp.ptr();
+ tmp.copy((char*) from, len, cs, &my_charset_bin, &dummy_errors);
+ from= (uchar*) tmp.ptr();
len= tmp.length();
}
- const char *end= from+len;
+ const uchar *end= from+len;
/* The pointer where the field value starts (i.e., "where to write") */
- char *to=ptr;
+ uchar *to= ptr;
uint tmp_dec, tmp_uint;
/*
The sign of the number : will be 0 (means positive but sign not
specified), '+' or '-'
*/
- char sign_char=0;
+ uchar sign_char=0;
/* The pointers where prezeros start and stop */
- const char *pre_zeros_from, *pre_zeros_end;
+ const uchar *pre_zeros_from, *pre_zeros_end;
/* The pointers where digits at the left of '.' start and stop */
- const char *int_digits_from, *int_digits_end;
+ const uchar *int_digits_from, *int_digits_end;
/* The pointers where digits at the right of '.' start and stop */
- const char *frac_digits_from, *frac_digits_end;
+ const uchar *frac_digits_from, *frac_digits_end;
/* The sign of the exponent : will be 0 (means no exponent), '+' or '-' */
char expo_sign_char=0;
uint exponent=0; // value of the exponent
@@ -1766,20 +1847,20 @@ int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs)
Pointers used when digits move from the left of the '.' to the
right of the '.' (explained below)
*/
- const char *int_digits_tail_from;
+ const uchar *int_digits_tail_from;
/* Number of 0 that need to be added at the left of the '.' (1E3: 3 zeros) */
uint int_digits_added_zeros;
/*
Pointer used when digits move from the right of the '.' to the left
of the '.'
*/
- const char *frac_digits_head_end;
+ const uchar *frac_digits_head_end;
/* Number of 0 that need to be added at the right of the '.' (for 1E-3) */
uint frac_digits_added_zeros;
- char *pos,*tmp_left_pos,*tmp_right_pos;
+ uchar *pos,*tmp_left_pos,*tmp_right_pos;
/* Pointers that are used as limits (begin and end of the field buffer) */
- char *left_wall,*right_wall;
- char tmp_char;
+ uchar *left_wall,*right_wall;
+ uchar tmp_char;
/*
To remember if table->in_use->cuted_fields has already been incremented,
to do that only once
@@ -2116,17 +2197,18 @@ int Field_decimal::store(double nr)
}
#endif
- reg4 uint i,length;
- char fyllchar,*to;
+ reg4 uint i;
+ size_t length;
+ uchar fyllchar,*to;
char buff[DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE];
fyllchar = zerofill ? (char) '0' : (char) ' ';
#ifdef HAVE_SNPRINTF
buff[sizeof(buff)-1]=0; // Safety
snprintf(buff,sizeof(buff)-1, "%.*f",(int) dec,nr);
- length=(uint) strlen(buff);
+ length= strlen(buff);
#else
- length=(uint) my_sprintf(buff,(buff,"%.*f",dec,nr));
+ length= my_sprintf(buff,(buff,"%.*f",dec,nr));
#endif
if (length > field_length)
@@ -2150,7 +2232,8 @@ int Field_decimal::store(longlong nr, bool unsigned_val)
ASSERT_COLUMN_MARKED_FOR_WRITE;
char buff[22];
uint length, int_part;
- char fyllchar, *to;
+ char fyllchar;
+ uchar *to;
if (nr < 0 && unsigned_flag && !unsigned_val)
{
@@ -2185,7 +2268,7 @@ double Field_decimal::val_real(void)
ASSERT_COLUMN_MARKED_FOR_READ;
int not_used;
char *end_not_used;
- return my_strntod(&my_charset_bin, ptr, field_length, &end_not_used,
+ return my_strntod(&my_charset_bin, (char*) ptr, field_length, &end_not_used,
&not_used);
}
@@ -2194,11 +2277,10 @@ longlong Field_decimal::val_int(void)
ASSERT_COLUMN_MARKED_FOR_READ;
int not_used;
if (unsigned_flag)
- return my_strntoull(&my_charset_bin, ptr, field_length, 10, NULL,
- &not_used);
- else
- return my_strntoll(&my_charset_bin, ptr, field_length, 10, NULL,
+ return my_strntoull(&my_charset_bin, (char*) ptr, field_length, 10, NULL,
&not_used);
+ return my_strntoll(&my_charset_bin, (char*) ptr, field_length, 10, NULL,
+ &not_used);
}
@@ -2206,10 +2288,12 @@ String *Field_decimal::val_str(String *val_buffer __attribute__((unused)),
String *val_ptr)
{
ASSERT_COLUMN_MARKED_FOR_READ;
- char *str;
+ uchar *str;
+ size_t tmp_length;
+
for (str=ptr ; *str == ' ' ; str++) ;
- uint tmp_length=(uint) (str-ptr);
val_ptr->set_charset(&my_charset_bin);
+ tmp_length= (size_t) (str-ptr);
if (field_length < tmp_length) // Error in data
val_ptr->length(0);
else
@@ -2222,9 +2306,9 @@ String *Field_decimal::val_str(String *val_buffer __attribute__((unused)),
** 5.00 , -1.0, 05, -05, +5 with optional pre/end space
*/
-int Field_decimal::cmp(const char *a_ptr,const char *b_ptr)
+int Field_decimal::cmp(const uchar *a_ptr,const uchar *b_ptr)
{
- const char *end;
+ const uchar *end;
int swap=0;
/* First remove prefixes '0', ' ', and '-' */
for (end=a_ptr+field_length;
@@ -2255,9 +2339,9 @@ int Field_decimal::cmp(const char *a_ptr,const char *b_ptr)
}
-void Field_decimal::sort_string(char *to,uint length)
+void Field_decimal::sort_string(uchar *to,uint length)
{
- char *str,*end;
+ uchar *str,*end;
for (str=ptr,end=ptr+length;
str != end &&
((my_isspace(&my_charset_bin,*str) || *str == '+' ||
@@ -2299,7 +2383,7 @@ void Field_decimal::sql_type(String &res) const
** Field_new_decimal
****************************************************************************/
-Field_new_decimal::Field_new_decimal(char *ptr_arg,
+Field_new_decimal::Field_new_decimal(uchar *ptr_arg,
uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg,
enum utype unireg_check_arg,
@@ -2310,6 +2394,7 @@ Field_new_decimal::Field_new_decimal(char *ptr_arg,
unireg_check_arg, field_name_arg, dec_arg, zero_arg, unsigned_arg)
{
precision= my_decimal_length_to_precision(len_arg, dec_arg, unsigned_arg);
+ set_if_smaller(precision, DECIMAL_MAX_PRECISION);
DBUG_ASSERT((precision <= DECIMAL_MAX_PRECISION) &&
(dec <= DECIMAL_MAX_SCALE));
bin_size= my_decimal_get_binary_size(precision, dec);
@@ -2321,11 +2406,12 @@ Field_new_decimal::Field_new_decimal(uint32 len_arg,
const char *name,
uint8 dec_arg,
bool unsigned_arg)
- :Field_num((char*) 0, len_arg,
+ :Field_num((uchar*) 0, len_arg,
maybe_null_arg ? (uchar*) "": 0, 0,
NONE, name, dec_arg, 0, unsigned_arg)
{
precision= my_decimal_length_to_precision(len_arg, dec_arg, unsigned_arg);
+ set_if_smaller(precision, DECIMAL_MAX_PRECISION);
DBUG_ASSERT((precision <= DECIMAL_MAX_PRECISION) &&
(dec <= DECIMAL_MAX_SCALE));
bin_size= my_decimal_get_binary_size(precision, dec);
@@ -2419,7 +2505,7 @@ bool Field_new_decimal::store_value(const my_decimal *decimal_value)
my_decimal2binary(E_DEC_FATAL_ERROR, &buff, ptr, precision, dec);
error= 1;
}
- DBUG_EXECUTE("info", print_decimal_buff(decimal_value, (byte *) ptr,
+ DBUG_EXECUTE("info", print_decimal_buff(decimal_value, (uchar *) ptr,
bin_size););
DBUG_RETURN(error);
}
@@ -2434,8 +2520,9 @@ int Field_new_decimal::store(const char *from, uint length,
DBUG_ENTER("Field_new_decimal::store(char*)");
if ((err= str2my_decimal(E_DEC_FATAL_ERROR &
- ~(E_DEC_OVERFLOW | E_DEC_BAD_NUM),
- from, length, charset_arg, &decimal_value)) &&
+ ~(E_DEC_OVERFLOW | E_DEC_BAD_NUM),
+ from, length, charset_arg,
+ &decimal_value)) &&
table->in_use->abort_on_warning)
{
/* Because "from" is not NUL-terminated and we use %s in the ER() */
@@ -2584,7 +2671,7 @@ my_decimal* Field_new_decimal::val_decimal(my_decimal *decimal_value)
DBUG_ENTER("Field_new_decimal::val_decimal");
binary2my_decimal(E_DEC_FATAL_ERROR, ptr, decimal_value,
precision, dec);
- DBUG_EXECUTE("info", print_decimal_buff(decimal_value, (byte *) ptr,
+ DBUG_EXECUTE("info", print_decimal_buff(decimal_value, (uchar *) ptr,
bin_size););
DBUG_RETURN(decimal_value);
}
@@ -2602,13 +2689,13 @@ String *Field_new_decimal::val_str(String *val_buffer,
}
-int Field_new_decimal::cmp(const char *a,const char*b)
+int Field_new_decimal::cmp(const uchar *a,const uchar*b)
{
return memcmp(a, b, bin_size);
}
-void Field_new_decimal::sort_string(char *buff,
+void Field_new_decimal::sort_string(uchar *buff,
uint length __attribute__((unused)))
{
memcpy(buff, ptr, bin_size);
@@ -2624,7 +2711,77 @@ void Field_new_decimal::sql_type(String &str) const
}
-uint Field_new_decimal::is_equal(create_field *new_field)
+/**
+ Save the field metadata for new decimal fields.
+
+ Saves the precision in the first byte and decimals() in the second
+ byte of the field metadata array at index of *metadata_ptr and
+ *(metadata_ptr + 1).
+
+ @param metadata_ptr First byte of field metadata
+
+ @returns number of bytes written to metadata_ptr
+*/
+int Field_new_decimal::do_save_field_metadata(uchar *metadata_ptr)
+{
+ *metadata_ptr= precision;
+ *(metadata_ptr + 1)= decimals();
+ return 2;
+}
+
+
+/**
+ Returns the number of bytes field uses in row-based replication
+ row packed size.
+
+ This method is used in row-based replication to determine the number
+ of bytes that the field consumes in the row record format. This is
+ used to skip fields in the master that do not exist on the slave.
+
+ @param field_metadata Encoded size in field metadata
+
+ @returns The size of the field based on the field metadata.
+*/
+uint Field_new_decimal::pack_length_from_metadata(uint field_metadata)
+{
+ uint const source_precision= (field_metadata >> 8U) & 0x00ff;
+ uint const source_decimal= field_metadata & 0x00ff;
+ uint const source_size= my_decimal_get_binary_size(source_precision,
+ source_decimal);
+ return (source_size);
+}
+
+
+/**
+ Check to see if field size is compatible with destination.
+
+ This method is used in row-based replication to verify that the slave's
+ field size is less than or equal to the master's field size. The
+ encoded field metadata (from the master or source) is decoded and compared
+ to the size of this field (the slave or destination).
+
+ @param field_metadata Encoded size in field metadata
+
+ @retval 0 if this field's size is < the source field's size
+ @retval 1 if this field's size is >= the source field's size
+*/
+int Field_new_decimal::compatible_field_size(uint field_metadata)
+{
+ int compatible= 0;
+ uint const source_precision= (field_metadata >> 8U) & 0x00ff;
+ uint const source_decimal= field_metadata & 0x00ff;
+ uint const source_size= my_decimal_get_binary_size(source_precision,
+ source_decimal);
+ uint const destination_size= row_pack_length();
+ compatible= (source_size <= destination_size);
+ if (compatible)
+ compatible= (source_precision <= precision) &&
+ (source_decimal <= decimals());
+ return (compatible);
+}
+
+
+uint Field_new_decimal::is_equal(Create_field *new_field)
{
return ((new_field->sql_type == real_type()) &&
((new_field->flags & UNSIGNED_FLAG) ==
@@ -2636,6 +2793,54 @@ uint Field_new_decimal::is_equal(create_field *new_field)
}
+/**
+ Unpack a decimal field from row data.
+
+ This method is used to unpack a decimal or numeric field from a master
+ whose size of the field is less than that of the slave.
+
+ @param to Destination of the data
+ @param from Source of the data
+ @param param_data Precision (upper) and decimal (lower) values
+
+ @return New pointer into memory based on from + length of the data
+*/
+const uchar *Field_new_decimal::unpack(uchar* to,
+ const uchar *from,
+ uint param_data)
+{
+ uint from_precision= (param_data & 0xff00) >> 8U;
+ uint from_decimal= param_data & 0x00ff;
+ uint length=pack_length();
+ uint from_pack_len= my_decimal_get_binary_size(from_precision, from_decimal);
+ uint len= (param_data && (from_pack_len < length)) ?
+ from_pack_len : length;
+ if ((from_pack_len && (from_pack_len < length)) ||
+ (from_precision < precision) ||
+ (from_decimal < decimals()))
+ {
+ /*
+ If the master's data is smaller than the slave, we need to convert
+ the binary to decimal then resize the decimal converting it back to
+ a decimal and write that to the raw data buffer.
+ */
+ decimal_digit_t dec_buf[DECIMAL_MAX_PRECISION];
+ decimal_t dec;
+ dec.len= from_precision;
+ dec.buf= dec_buf;
+ /*
+ Note: bin2decimal does not change the length of the field. So it is
+ just the first step the resizing operation. The second step does the
+ resizing using the precision and decimals from the slave.
+ */
+ bin2decimal((uchar *)from, &dec, from_precision, from_decimal);
+ decimal2bin(&dec, to, precision, decimals());
+ }
+ else
+ memcpy(to, from, len); // Sizes are the same, just copy the data.
+ return from+len;
+}
+
/****************************************************************************
** tiny int
****************************************************************************/
@@ -2743,7 +2948,7 @@ int Field_tiny::store(longlong nr, bool unsigned_val)
double Field_tiny::val_real(void)
{
ASSERT_COLUMN_MARKED_FOR_READ;
- int tmp= unsigned_flag ? (int) ((uchar*) ptr)[0] :
+ int tmp= unsigned_flag ? (int) ptr[0] :
(int) ((signed char*) ptr)[0];
return (double) tmp;
}
@@ -2752,7 +2957,7 @@ double Field_tiny::val_real(void)
longlong Field_tiny::val_int(void)
{
ASSERT_COLUMN_MARKED_FOR_READ;
- int tmp= unsigned_flag ? (int) ((uchar*) ptr)[0] :
+ int tmp= unsigned_flag ? (int) ptr[0] :
(int) ((signed char*) ptr)[0];
return (longlong) tmp;
}
@@ -2770,7 +2975,7 @@ String *Field_tiny::val_str(String *val_buffer,
if (unsigned_flag)
length= (uint) cs->cset->long10_to_str(cs,to,mlength, 10,
- (long) *((uchar*) ptr));
+ (long) *ptr);
else
length= (uint) cs->cset->long10_to_str(cs,to,mlength,-10,
(long) *((signed char*) ptr));
@@ -2786,7 +2991,7 @@ bool Field_tiny::send_binary(Protocol *protocol)
return protocol->store_tiny((longlong) (int8) ptr[0]);
}
-int Field_tiny::cmp(const char *a_ptr, const char *b_ptr)
+int Field_tiny::cmp(const uchar *a_ptr, const uchar *b_ptr)
{
signed char a,b;
a=(signed char) a_ptr[0]; b= (signed char) b_ptr[0];
@@ -2795,12 +3000,12 @@ int Field_tiny::cmp(const char *a_ptr, const char *b_ptr)
return (a < b) ? -1 : (a > b) ? 1 : 0;
}
-void Field_tiny::sort_string(char *to,uint length __attribute__((unused)))
+void Field_tiny::sort_string(uchar *to,uint length __attribute__((unused)))
{
if (unsigned_flag)
*to= *ptr;
else
- to[0] = (char) ((uchar) ptr[0] ^ (uchar) 128); /* Revers signbit */
+ to[0] = (char) (ptr[0] ^ (uchar) 128); /* Revers signbit */
}
void Field_tiny::sql_type(String &res) const
@@ -3005,7 +3210,7 @@ bool Field_short::send_binary(Protocol *protocol)
}
-int Field_short::cmp(const char *a_ptr, const char *b_ptr)
+int Field_short::cmp(const uchar *a_ptr, const uchar *b_ptr)
{
short a,b;
#ifdef WORDS_BIGENDIAN
@@ -3027,7 +3232,7 @@ int Field_short::cmp(const char *a_ptr, const char *b_ptr)
return (a < b) ? -1 : (a > b) ? 1 : 0;
}
-void Field_short::sort_string(char *to,uint length __attribute__((unused)))
+void Field_short::sort_string(uchar *to,uint length __attribute__((unused)))
{
#ifdef WORDS_BIGENDIAN
if (!table->s->db_low_byte_first)
@@ -3213,7 +3418,7 @@ bool Field_medium::send_binary(Protocol *protocol)
}
-int Field_medium::cmp(const char *a_ptr, const char *b_ptr)
+int Field_medium::cmp(const uchar *a_ptr, const uchar *b_ptr)
{
long a,b;
if (unsigned_flag)
@@ -3229,7 +3434,7 @@ int Field_medium::cmp(const char *a_ptr, const char *b_ptr)
return (a < b) ? -1 : (a > b) ? 1 : 0;
}
-void Field_medium::sort_string(char *to,uint length __attribute__((unused)))
+void Field_medium::sort_string(uchar *to,uint length __attribute__((unused)))
{
if (unsigned_flag)
to[0] = ptr[2];
@@ -3440,7 +3645,7 @@ bool Field_long::send_binary(Protocol *protocol)
return protocol->store_long(Field_long::val_int());
}
-int Field_long::cmp(const char *a_ptr, const char *b_ptr)
+int Field_long::cmp(const uchar *a_ptr, const uchar *b_ptr)
{
int32 a,b;
#ifdef WORDS_BIGENDIAN
@@ -3460,7 +3665,7 @@ int Field_long::cmp(const char *a_ptr, const char *b_ptr)
return (a < b) ? -1 : (a > b) ? 1 : 0;
}
-void Field_long::sort_string(char *to,uint length __attribute__((unused)))
+void Field_long::sort_string(uchar *to,uint length __attribute__((unused)))
{
#ifdef WORDS_BIGENDIAN
if (!table->s->db_low_byte_first)
@@ -3680,7 +3885,7 @@ bool Field_longlong::send_binary(Protocol *protocol)
}
-int Field_longlong::cmp(const char *a_ptr, const char *b_ptr)
+int Field_longlong::cmp(const uchar *a_ptr, const uchar *b_ptr)
{
longlong a,b;
#ifdef WORDS_BIGENDIAN
@@ -3701,7 +3906,7 @@ int Field_longlong::cmp(const char *a_ptr, const char *b_ptr)
return (a < b) ? -1 : (a > b) ? 1 : 0;
}
-void Field_longlong::sort_string(char *to,uint length __attribute__((unused)))
+void Field_longlong::sort_string(uchar *to,uint length __attribute__((unused)))
{
#ifdef WORDS_BIGENDIAN
if (!table->s->db_low_byte_first)
@@ -3769,56 +3974,9 @@ int Field_float::store(const char *from,uint len,CHARSET_INFO *cs)
int Field_float::store(double nr)
{
ASSERT_COLUMN_MARKED_FOR_WRITE;
- float j;
- int error= 0;
+ int error= truncate(&nr, FLT_MAX);
+ float j= (float)nr;
- if (isnan(nr))
- {
- j= 0;
- set_null();
- set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
- error= 1;
- }
- else if (unsigned_flag && nr < 0)
- {
- j= 0;
- set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
- error= 1;
- }
- else
- {
- double max_value;
- if (dec >= NOT_FIXED_DEC)
- {
- max_value= FLT_MAX;
- }
- else
- {
- uint tmp=min(field_length,array_elements(log_10)-1);
- max_value= (log_10[tmp]-1)/log_10[dec];
- /*
- The following comparison is needed to not get an overflow if nr
- is close to FLT_MAX
- */
- if (fabs(nr) < FLT_MAX/10.0e+32)
- nr= floor(nr*log_10[dec]+0.5)/log_10[dec];
- }
- if (nr < -max_value)
- {
- j= (float)-max_value;
- set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
- error= 1;
- }
- else if (nr > max_value)
- {
- j= (float)max_value;
- set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
- error= 1;
- }
- else
- j= (float) nr;
- }
-
#ifdef WORDS_BIGENDIAN
if (table->s->db_low_byte_first)
{
@@ -3826,7 +3984,7 @@ int Field_float::store(double nr)
}
else
#endif
- memcpy_fixed(ptr,(byte*) &j,sizeof(j));
+ memcpy_fixed(ptr,(uchar*) &j,sizeof(j));
return error;
}
@@ -3849,7 +4007,7 @@ double Field_float::val_real(void)
}
else
#endif
- memcpy_fixed((byte*) &j,ptr,sizeof(j));
+ memcpy_fixed((uchar*) &j,ptr,sizeof(j));
return ((double) j);
}
@@ -3863,7 +4021,7 @@ longlong Field_float::val_int(void)
}
else
#endif
- memcpy_fixed((byte*) &j,ptr,sizeof(j));
+ memcpy_fixed((uchar*) &j,ptr,sizeof(j));
return (longlong) rint(j);
}
@@ -3880,7 +4038,7 @@ String *Field_float::val_str(String *val_buffer,
}
else
#endif
- memcpy_fixed((byte*) &nr,ptr,sizeof(nr));
+ memcpy_fixed((uchar*) &nr,ptr,sizeof(nr));
uint to_length=max(field_length,70);
val_buffer->alloc(to_length);
@@ -3952,7 +4110,7 @@ String *Field_float::val_str(String *val_buffer,
}
-int Field_float::cmp(const char *a_ptr, const char *b_ptr)
+int Field_float::cmp(const uchar *a_ptr, const uchar *b_ptr)
{
float a,b;
#ifdef WORDS_BIGENDIAN
@@ -3972,7 +4130,7 @@ int Field_float::cmp(const char *a_ptr, const char *b_ptr)
#define FLT_EXP_DIG (sizeof(float)*8-FLT_MANT_DIG)
-void Field_float::sort_string(char *to,uint length __attribute__((unused)))
+void Field_float::sort_string(uchar *to,uint length __attribute__((unused)))
{
float nr;
#ifdef WORDS_BIGENDIAN
@@ -3984,7 +4142,7 @@ void Field_float::sort_string(char *to,uint length __attribute__((unused)))
#endif
memcpy_fixed(&nr,ptr,sizeof(float));
- uchar *tmp= (uchar*) to;
+ uchar *tmp= to;
if (nr == (float) 0.0)
{ /* Change to zero string */
tmp[0]=(uchar) 128;
@@ -4022,6 +4180,22 @@ bool Field_float::send_binary(Protocol *protocol)
}
+/**
+ Save the field metadata for float fields.
+
+ Saves the pack length in the first byte.
+
+ @param metadata_ptr First byte of field metadata
+
+ @returns number of bytes written to metadata_ptr
+*/
+int Field_float::do_save_field_metadata(uchar *metadata_ptr)
+{
+ *metadata_ptr= pack_length();
+ return 1;
+}
+
+
void Field_float::sql_type(String &res) const
{
if (dec == NOT_FIXED_DEC)
@@ -4062,48 +4236,7 @@ int Field_double::store(const char *from,uint len,CHARSET_INFO *cs)
int Field_double::store(double nr)
{
ASSERT_COLUMN_MARKED_FOR_WRITE;
- int error= 0;
-
- if (isnan(nr))
- {
- nr= 0;
- set_null();
- set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
- error= 1;
- }
- else if (unsigned_flag && nr < 0)
- {
- nr= 0;
- set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
- error= 1;
- }
- else
- {
- double max_value;
- if (not_fixed)
- {
- max_value= DBL_MAX;
- }
- else
- {
- uint tmp=min(field_length,array_elements(log_10)-1);
- max_value= (log_10[tmp]-1)/log_10[dec];
- if (fabs(nr) < DBL_MAX/10.0e+32)
- nr= floor(nr*log_10[dec]+0.5)/log_10[dec];
- }
- if (nr < -max_value)
- {
- nr= -max_value;
- set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
- error= 1;
- }
- else if (nr > max_value)
- {
- nr= max_value;
- set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
- error= 1;
- }
- }
+ int error= truncate(&nr, DBL_MAX);
#ifdef WORDS_BIGENDIAN
if (table->s->db_low_byte_first)
@@ -4123,6 +4256,63 @@ int Field_double::store(longlong nr, bool unsigned_val)
(double) nr);
}
+/*
+ If a field has fixed length, truncate the double argument pointed to by 'nr'
+ appropriately.
+ Also ensure that the argument is within [-max_value; max_value] range.
+*/
+
+int Field_real::truncate(double *nr, double max_value)
+{
+ int error= 1;
+ double res= *nr;
+
+ if (isnan(res))
+ {
+ res= 0;
+ set_null();
+ set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
+ goto end;
+ }
+ else if (unsigned_flag && res < 0)
+ {
+ res= 0;
+ set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
+ goto end;
+ }
+
+ if (!not_fixed)
+ {
+ uint order= field_length - dec;
+ uint step= array_elements(log_10) - 1;
+ max_value= 1.0;
+ for (; order > step; order-= step)
+ max_value*= log_10[step];
+ max_value*= log_10[order];
+ max_value-= 1.0 / log_10[dec];
+
+ double tmp= rint((res - floor(res)) * log_10[dec]) / log_10[dec];
+ res= floor(res) + tmp;
+ }
+
+ if (res < -max_value)
+ {
+ res= -max_value;
+ set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
+ }
+ else if (res > max_value)
+ {
+ res= max_value;
+ set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
+ }
+ else
+ error= 0;
+
+end:
+ *nr= res;
+ return error;
+}
+
int Field_real::store_decimal(const my_decimal *dm)
{
@@ -4284,7 +4474,7 @@ bool Field_double::send_binary(Protocol *protocol)
}
-int Field_double::cmp(const char *a_ptr, const char *b_ptr)
+int Field_double::cmp(const uchar *a_ptr, const uchar *b_ptr)
{
ASSERT_COLUMN_MARKED_FOR_READ;
double a,b;
@@ -4308,7 +4498,7 @@ int Field_double::cmp(const char *a_ptr, const char *b_ptr)
/* The following should work for IEEE */
-void Field_double::sort_string(char *to,uint length __attribute__((unused)))
+void Field_double::sort_string(uchar *to,uint length __attribute__((unused)))
{
double nr;
#ifdef WORDS_BIGENDIAN
@@ -4319,7 +4509,24 @@ void Field_double::sort_string(char *to,uint length __attribute__((unused)))
else
#endif
doubleget(nr,ptr);
- change_double_for_sort(nr, (byte*) to);
+ change_double_for_sort(nr, to);
+}
+
+
+/**
+ Save the field metadata for double fields.
+
+ Saves the pack length in the first byte of the field metadata array
+ at index of *metadata_ptr.
+
+ @param metadata_ptr First byte of field metadata
+
+ @returns number of bytes written to metadata_ptr
+*/
+int Field_double::do_save_field_metadata(uchar *metadata_ptr)
+{
+ *metadata_ptr= pack_length();
+ return 1;
}
@@ -4384,13 +4591,13 @@ void Field_double::sql_type(String &res) const
exception is different behavior of old/new timestamps during ALTER TABLE.
*/
-Field_timestamp::Field_timestamp(char *ptr_arg, uint32 len_arg,
+Field_timestamp::Field_timestamp(uchar *ptr_arg, uint32 len_arg,
uchar *null_ptr_arg, uchar null_bit_arg,
enum utype unireg_check_arg,
const char *field_name_arg,
TABLE_SHARE *share,
CHARSET_INFO *cs)
- :Field_str(ptr_arg, 19, null_ptr_arg, null_bit_arg,
+ :Field_str(ptr_arg, MAX_DATETIME_WIDTH, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg, cs)
{
/* For 4.0 MYD and 4.0 InnoDB compatibility */
@@ -4407,7 +4614,8 @@ Field_timestamp::Field_timestamp(char *ptr_arg, uint32 len_arg,
Field_timestamp::Field_timestamp(bool maybe_null_arg,
const char *field_name_arg,
CHARSET_INFO *cs)
- :Field_str((char*) 0, 19, maybe_null_arg ? (uchar*) "": 0, 0,
+ :Field_str((uchar*) 0, MAX_DATETIME_WIDTH,
+ maybe_null_arg ? (uchar*) "": 0, 0,
NONE, field_name_arg, cs)
{
/* For 4.0 MYD and 4.0 InnoDB compatibility */
@@ -4496,15 +4704,7 @@ int Field_timestamp::store(const char *from,uint len,CHARSET_INFO *cs)
error= 1;
}
}
-
-#ifdef WORDS_BIGENDIAN
- if (table && table->s->db_low_byte_first)
- {
- int4store(ptr,tmp);
- }
- else
-#endif
- longstore(ptr,tmp);
+ store_timestamp(tmp);
return error;
}
@@ -4564,19 +4764,10 @@ int Field_timestamp::store(longlong nr, bool unsigned_val)
WARN_DATA_TRUNCATED,
nr, MYSQL_TIMESTAMP_DATETIME, 1);
-#ifdef WORDS_BIGENDIAN
- if (table && table->s->db_low_byte_first)
- {
- int4store(ptr,timestamp);
- }
- else
-#endif
- longstore(ptr,(uint32) timestamp);
-
+ store_timestamp(timestamp);
return error;
}
-
double Field_timestamp::val_real(void)
{
ASSERT_COLUMN_MARKED_FOR_READ;
@@ -4590,6 +4781,7 @@ longlong Field_timestamp::val_int(void)
MYSQL_TIME time_tmp;
THD *thd= table ? table->in_use : current_thd;
+ thd->time_zone_used= 1;
#ifdef WORDS_BIGENDIAN
if (table && table->s->db_low_byte_first)
temp=uint4korr(ptr);
@@ -4601,7 +4793,6 @@ longlong Field_timestamp::val_int(void)
return(0); /* purecov: inspected */
thd->variables.time_zone->gmt_sec_to_TIME(&time_tmp, (my_time_t)temp);
- thd->time_zone_used= 1;
return time_tmp.year * LL(10000000000) + time_tmp.month * LL(100000000) +
time_tmp.day * 1000000L + time_tmp.hour * 10000L +
@@ -4621,6 +4812,7 @@ String *Field_timestamp::val_str(String *val_buffer, String *val_ptr)
to= (char*) val_buffer->ptr();
val_buffer->length(field_length);
+ thd->time_zone_used= 1;
#ifdef WORDS_BIGENDIAN
if (table && table->s->db_low_byte_first)
temp=uint4korr(ptr);
@@ -4636,7 +4828,6 @@ String *Field_timestamp::val_str(String *val_buffer, String *val_ptr)
val_buffer->set_charset(&my_charset_bin); // Safety
thd->variables.time_zone->gmt_sec_to_TIME(&time_tmp,(my_time_t)temp);
- thd->time_zone_used= 1;
temp= time_tmp.year % 100;
if (temp < YY_PART_YEAR - 1)
@@ -4686,6 +4877,7 @@ bool Field_timestamp::get_date(MYSQL_TIME *ltime, uint fuzzydate)
{
long temp;
THD *thd= table ? table->in_use : current_thd;
+ thd->time_zone_used= 1;
#ifdef WORDS_BIGENDIAN
if (table && table->s->db_low_byte_first)
temp=uint4korr(ptr);
@@ -4701,7 +4893,6 @@ bool Field_timestamp::get_date(MYSQL_TIME *ltime, uint fuzzydate)
else
{
thd->variables.time_zone->gmt_sec_to_TIME(ltime, (my_time_t)temp);
- thd->time_zone_used= 1;
}
return 0;
}
@@ -4720,7 +4911,7 @@ bool Field_timestamp::send_binary(Protocol *protocol)
}
-int Field_timestamp::cmp(const char *a_ptr, const char *b_ptr)
+int Field_timestamp::cmp(const uchar *a_ptr, const uchar *b_ptr)
{
int32 a,b;
#ifdef WORDS_BIGENDIAN
@@ -4739,7 +4930,7 @@ int Field_timestamp::cmp(const char *a_ptr, const char *b_ptr)
}
-void Field_timestamp::sort_string(char *to,uint length __attribute__((unused)))
+void Field_timestamp::sort_string(uchar *to,uint length __attribute__((unused)))
{
#ifdef WORDS_BIGENDIAN
if (!table || !table->s->db_low_byte_first)
@@ -4771,14 +4962,7 @@ void Field_timestamp::set_time()
THD *thd= table ? table->in_use : current_thd;
long tmp= (long) thd->query_start();
set_notnull();
-#ifdef WORDS_BIGENDIAN
- if (table && table->s->db_low_byte_first)
- {
- int4store(ptr,tmp);
- }
- else
-#endif
- longstore(ptr,tmp);
+ store_timestamp(tmp);
}
/****************************************************************************
@@ -4940,7 +5124,7 @@ String *Field_time::val_str(String *val_buffer,
{
ASSERT_COLUMN_MARKED_FOR_READ;
MYSQL_TIME ltime;
- val_buffer->alloc(19);
+ val_buffer->alloc(MAX_DATE_STRING_REP_LENGTH);
long tmp=(long) sint3korr(ptr);
ltime.neg= 0;
if (tmp < 0)
@@ -5021,7 +5205,7 @@ bool Field_time::send_binary(Protocol *protocol)
}
-int Field_time::cmp(const char *a_ptr, const char *b_ptr)
+int Field_time::cmp(const uchar *a_ptr, const uchar *b_ptr)
{
int32 a,b;
a=(int32) sint3korr(a_ptr);
@@ -5029,7 +5213,7 @@ int Field_time::cmp(const char *a_ptr, const char *b_ptr)
return (a < b) ? -1 : (a > b) ? 1 : 0;
}
-void Field_time::sort_string(char *to,uint length __attribute__((unused)))
+void Field_time::sort_string(uchar *to,uint length __attribute__((unused)))
{
to[0] = (uchar) (ptr[2] ^ 128);
to[1] = ptr[1];
@@ -5133,7 +5317,7 @@ double Field_year::val_real(void)
longlong Field_year::val_int(void)
{
ASSERT_COLUMN_MARKED_FOR_READ;
- int tmp= (int) ((uchar*) ptr)[0];
+ int tmp= (int) ptr[0];
if (field_length != 4)
tmp%=100; // Return last 2 char
else if (tmp)
@@ -5327,7 +5511,7 @@ String *Field_date::val_str(String *val_buffer,
}
-int Field_date::cmp(const char *a_ptr, const char *b_ptr)
+int Field_date::cmp(const uchar *a_ptr, const uchar *b_ptr)
{
int32 a,b;
#ifdef WORDS_BIGENDIAN
@@ -5346,7 +5530,7 @@ int Field_date::cmp(const char *a_ptr, const char *b_ptr)
}
-void Field_date::sort_string(char *to,uint length __attribute__((unused)))
+void Field_date::sort_string(uchar *to,uint length __attribute__((unused)))
{
#ifdef WORDS_BIGENDIAN
if (!table || !table->s->db_low_byte_first)
@@ -5415,7 +5599,8 @@ int Field_newdate::store(const char *from,uint len,CHARSET_INFO *cs)
else
{
tmp= l_time.day + l_time.month*32 + l_time.year*16*32;
- if (!error && (ret != MYSQL_TIMESTAMP_DATE))
+ if (!error && (ret != MYSQL_TIMESTAMP_DATE) &&
+ thd->count_cuted_fields != CHECK_FIELD_IGNORE)
error= 3; // Datetime was cut (note)
}
@@ -5488,7 +5673,7 @@ int Field_newdate::store_time(MYSQL_TIME *ltime,timestamp_type time_type)
(MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE |
MODE_INVALID_DATES))), &error))
{
- char buff[12];
+ char buff[MAX_DATE_STRING_REP_LENGTH];
String str(buff, sizeof(buff), &my_charset_latin1);
make_date((DATE_TIME_FORMAT *) 0, ltime, &str);
set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED,
@@ -5578,7 +5763,7 @@ bool Field_newdate::get_time(MYSQL_TIME *ltime)
}
-int Field_newdate::cmp(const char *a_ptr, const char *b_ptr)
+int Field_newdate::cmp(const uchar *a_ptr, const uchar *b_ptr)
{
uint32 a,b;
a=(uint32) uint3korr(a_ptr);
@@ -5587,7 +5772,7 @@ int Field_newdate::cmp(const char *a_ptr, const char *b_ptr)
}
-void Field_newdate::sort_string(char *to,uint length __attribute__((unused)))
+void Field_newdate::sort_string(uchar *to,uint length __attribute__((unused)))
{
to[0] = ptr[2];
to[1] = ptr[1];
@@ -5719,7 +5904,7 @@ int Field_datetime::store_time(MYSQL_TIME *ltime,timestamp_type time_type)
(MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE |
MODE_INVALID_DATES))), &error))
{
- char buff[19];
+ char buff[MAX_DATE_STRING_REP_LENGTH];
String str(buff, sizeof(buff), &my_charset_latin1);
make_datetime((DATE_TIME_FORMAT *) 0, ltime, &str);
set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED,
@@ -5795,7 +5980,7 @@ String *Field_datetime::val_str(String *val_buffer,
part1=(long) (tmp/LL(1000000));
part2=(long) (tmp - (ulonglong) part1*LL(1000000));
- pos=(char*) val_buffer->ptr()+19;
+ pos=(char*) val_buffer->ptr() + MAX_DATETIME_WIDTH;
*pos--=0;
*pos--= (char) ('0'+(char) (part2%10)); part2/=10;
*pos--= (char) ('0'+(char) (part2%10)); part3= (int) (part2 / 10);
@@ -5843,7 +6028,7 @@ bool Field_datetime::get_time(MYSQL_TIME *ltime)
return Field_datetime::get_date(ltime,0);
}
-int Field_datetime::cmp(const char *a_ptr, const char *b_ptr)
+int Field_datetime::cmp(const uchar *a_ptr, const uchar *b_ptr)
{
longlong a,b;
#ifdef WORDS_BIGENDIAN
@@ -5862,7 +6047,7 @@ int Field_datetime::cmp(const char *a_ptr, const char *b_ptr)
((ulonglong) a > (ulonglong) b) ? 1 : 0;
}
-void Field_datetime::sort_string(char *to,uint length __attribute__((unused)))
+void Field_datetime::sort_string(uchar *to,uint length __attribute__((unused)))
{
#ifdef WORDS_BIGENDIAN
if (!table || !table->s->db_low_byte_first)
@@ -5911,6 +6096,7 @@ void Field_datetime::sql_type(String &res) const
well_formed_error_pos - where not well formed data was first met
cannot_convert_error_pos - where a not-convertable character was first met
end - end of the string
+ cs - character set of the string
NOTES
As of version 5.0 both cases return the same error:
@@ -5930,7 +6116,8 @@ static bool
check_string_copy_error(Field_str *field,
const char *well_formed_error_pos,
const char *cannot_convert_error_pos,
- const char *end)
+ const char *end,
+ CHARSET_INFO *cs)
{
const char *pos, *end_orig;
char tmp[64], *t;
@@ -5944,8 +6131,18 @@ check_string_copy_error(Field_str *field,
for (t= tmp; pos < end; pos++)
{
+ /*
+ If the source string is ASCII compatible (mbminlen==1)
+ and the source character is in ASCII printable range (0x20..0x7F),
+ then display the character as is.
+
+ Otherwise, if the source string is not ASCII compatible (e.g. UCS2),
+ or the source character is not in the printable range,
+ then print the character using HEX notation.
+ */
if (((unsigned char) *pos) >= 0x20 &&
- ((unsigned char) *pos) <= 0x7F)
+ ((unsigned char) *pos) <= 0x7F &&
+ cs->mbminlen == 1)
{
*t++= *pos;
}
@@ -6013,7 +6210,7 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs)
DBUG_ASSERT(table->in_use == current_thd);
copy_length= well_formed_copy_nchars(field_charset,
- ptr, field_length,
+ (char*) ptr, field_length,
cs, from, length,
field_length / field_charset->mbmaxlen,
&well_formed_error_pos,
@@ -6022,12 +6219,12 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs)
/* Append spaces if the string was shorter than the field. */
if (copy_length < field_length)
- field_charset->cset->fill(field_charset,ptr+copy_length,
+ field_charset->cset->fill(field_charset,(char*) ptr+copy_length,
field_length-copy_length,
field_charset->pad_char);
if (check_string_copy_error(this, well_formed_error_pos,
- cannot_convert_error_pos, from + length))
+ cannot_convert_error_pos, from + length, cs))
return 2;
/*
@@ -6089,11 +6286,11 @@ int Field_str::store(double nr)
like inserting 500.0 in char(1)
*/
DBUG_ASSERT(local_char_length < 5 || length <= local_char_length+1);
- return store((const char *) buff, length, charset());
+ return store(buff, length, charset());
}
-uint Field::is_equal(create_field *new_field)
+uint Field::is_equal(Create_field *new_field)
{
return (new_field->sql_type == real_type());
}
@@ -6101,16 +6298,16 @@ uint Field::is_equal(create_field *new_field)
/* If one of the fields is binary and the other one isn't return 1 else 0 */
-bool Field_str::compare_str_field_flags(create_field *new_field, uint32 flags)
+bool Field_str::compare_str_field_flags(Create_field *new_field, uint32 flag_arg)
{
return (((new_field->flags & (BINCMP_FLAG | BINARY_FLAG)) &&
- !(flags & (BINCMP_FLAG | BINARY_FLAG))) ||
+ !(flag_arg & (BINCMP_FLAG | BINARY_FLAG))) ||
(!(new_field->flags & (BINCMP_FLAG | BINARY_FLAG)) &&
- (flags & (BINCMP_FLAG | BINARY_FLAG))));
+ (flag_arg & (BINCMP_FLAG | BINARY_FLAG))));
}
-uint Field_str::is_equal(create_field *new_field)
+uint Field_str::is_equal(Create_field *new_field)
{
if (compare_str_field_flags(new_field, flags))
return 0;
@@ -6149,14 +6346,15 @@ double Field_string::val_real(void)
CHARSET_INFO *cs= charset();
double result;
- result= my_strntod(cs,ptr,field_length,&end,&error);
+ result= my_strntod(cs,(char*) ptr,field_length,&end,&error);
if (!table->in_use->no_errors &&
- (error || (field_length != (uint32)(end - ptr) &&
- !check_if_only_end_space(cs, end, ptr + field_length))))
+ (error || (field_length != (uint32)(end - (char*) ptr) &&
+ !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(ptr, field_length, cs);
+ tmp.copy((char*) ptr, field_length, cs);
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE,
ER(ER_TRUNCATED_WRONG_VALUE),
@@ -6174,14 +6372,15 @@ longlong Field_string::val_int(void)
CHARSET_INFO *cs= charset();
longlong result;
- result= my_strntoll(cs,ptr,field_length,10,&end,&error);
+ result= my_strntoll(cs, (char*) ptr,field_length,10,&end,&error);
if (!table->in_use->no_errors &&
- (error || (field_length != (uint32)(end - ptr) &&
- !check_if_only_end_space(cs, end, ptr + field_length))))
+ (error || (field_length != (uint32)(end - (char*) ptr) &&
+ !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(ptr, field_length, cs);
+ tmp.copy((char*) ptr, field_length, cs);
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE,
ER(ER_TRUNCATED_WRONG_VALUE),
@@ -6195,9 +6394,15 @@ String *Field_string::val_str(String *val_buffer __attribute__((unused)),
String *val_ptr)
{
ASSERT_COLUMN_MARKED_FOR_READ;
- uint length= field_charset->cset->lengthsp(field_charset, ptr, field_length);
/* See the comment for Field_long::store(long long) */
DBUG_ASSERT(table->in_use == current_thd);
+ uint length;
+ if (table->in_use->variables.sql_mode &
+ MODE_PAD_CHAR_TO_FULL_LENGTH)
+ length= my_charpos(field_charset, ptr, ptr + field_length, field_length);
+ else
+ length= field_charset->cset->lengthsp(field_charset, (const char*) ptr,
+ field_length);
val_ptr->set((const char*) ptr, length, field_charset);
return val_ptr;
}
@@ -6206,14 +6411,14 @@ String *Field_string::val_str(String *val_buffer __attribute__((unused)),
my_decimal *Field_string::val_decimal(my_decimal *decimal_value)
{
ASSERT_COLUMN_MARKED_FOR_READ;
- int err= str2my_decimal(E_DEC_FATAL_ERROR, ptr, field_length, charset(),
- decimal_value);
+ int err= str2my_decimal(E_DEC_FATAL_ERROR, (char*) ptr, field_length,
+ 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(ptr, field_length, cs);
+ tmp.copy((char*) ptr, field_length, cs);
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE,
ER(ER_TRUNCATED_WRONG_VALUE),
@@ -6224,7 +6429,7 @@ my_decimal *Field_string::val_decimal(my_decimal *decimal_value)
}
-int Field_string::cmp(const char *a_ptr, const char *b_ptr)
+int Field_string::cmp(const uchar *a_ptr, const uchar *b_ptr)
{
uint a_len, b_len;
@@ -6241,17 +6446,17 @@ int Field_string::cmp(const char *a_ptr, const char *b_ptr)
like in latin_de 'ae' and 0xe4
*/
return field_charset->coll->strnncollsp(field_charset,
- (const uchar*) a_ptr, a_len,
- (const uchar*) b_ptr, b_len,
+ a_ptr, a_len,
+ b_ptr, b_len,
0);
}
-void Field_string::sort_string(char *to,uint length)
+void Field_string::sort_string(uchar *to,uint length)
{
IF_DBUG(uint tmp=) my_strnxfrm(field_charset,
- (uchar*) to, length,
- (uchar*) ptr, field_length);
+ to, length,
+ ptr, field_length);
DBUG_ASSERT(tmp == length);
}
@@ -6276,7 +6481,7 @@ void Field_string::sql_type(String &res) const
}
-char *Field_string::pack(char *to, const char *from, uint max_length)
+uchar *Field_string::pack(uchar *to, const uchar *from, uint max_length)
{
uint length= min(field_length,max_length);
uint local_char_length= max_length/field_charset->mbmaxlen;
@@ -6286,15 +6491,47 @@ char *Field_string::pack(char *to, const char *from, uint max_length)
set_if_smaller(length, local_char_length);
while (length && from[length-1] == ' ')
length--;
- *to++= (char) (uchar) length;
+ *to++= (uchar) length;
if (field_length > 255)
- *to++= (char) (uchar) (length >> 8);
+ *to++= (uchar) (length >> 8);
memcpy(to, from, length);
return to+length;
}
-const char *Field_string::unpack(char *to, const char *from)
+/**
+ Unpack a string field from row data.
+
+ This method is used to unpack a string field from a master whose size
+ of the field is less than that of the slave. Note that there can be a
+ variety of field types represented with this class. Certain types like
+ ENUM or SET are processed differently. Hence, the upper byte of the
+ @c param_data argument contains the result of field->real_type() from
+ the master.
+
+ @param to Destination of the data
+ @param from Source of the data
+ @param param_data Real type (upper) and length (lower) values
+
+ @return New pointer into memory based on from + length of the data
+*/
+const uchar *Field_string::unpack(uchar *to,
+ const uchar *from,
+ uint param_data)
+{
+ uint from_len= param_data & 0x00ff; // length.
+ uint length= 0;
+ uint f_length;
+ f_length= (from_len < field_length) ? from_len : field_length;
+ DBUG_ASSERT(f_length <= 255);
+ length= (uint) *from++;
+ bitmap_set_bit(table->write_set,field_index);
+ store((const char *)from, length, system_charset_info);
+ return from+length;
+}
+
+
+const uchar *Field_string::unpack(uchar *to, const uchar *from)
{
uint length;
if (field_length > 255)
@@ -6303,13 +6540,32 @@ const char *Field_string::unpack(char *to, const char *from)
from+= 2;
}
else
- length= (uint) (uchar) *from++;
+ length= (uint) *from++;
memcpy(to, from, (int) length);
bfill(to+length, field_length - length, ' ');
return from+length;
}
+/**
+ Save the field metadata for string fields.
+
+ Saves the real type in the first byte and the field length in the
+ second byte of the field metadata array at index of *metadata_ptr and
+ *(metadata_ptr + 1).
+
+ @param metadata_ptr First byte of field metadata
+
+ @returns number of bytes written to metadata_ptr
+*/
+int Field_string::do_save_field_metadata(uchar *metadata_ptr)
+{
+ *metadata_ptr= real_type();
+ *(metadata_ptr + 1)= field_length;
+ return 2;
+}
+
+
/*
Compare two packed keys
@@ -6326,7 +6582,7 @@ const char *Field_string::unpack(char *to, const char *from)
> 0 a > b
*/
-int Field_string::pack_cmp(const char *a, const char *b, uint length,
+int Field_string::pack_cmp(const uchar *a, const uchar *b, uint length,
my_bool insert_or_update)
{
uint a_length, b_length;
@@ -6339,12 +6595,12 @@ int Field_string::pack_cmp(const char *a, const char *b, uint length,
}
else
{
- a_length= (uint) (uchar) *a++;
- b_length= (uint) (uchar) *b++;
+ a_length= (uint) *a++;
+ b_length= (uint) *b++;
}
return field_charset->coll->strnncollsp(field_charset,
- (const uchar*) a, a_length,
- (const uchar*) b, b_length,
+ a, a_length,
+ b, b_length,
insert_or_update);
}
@@ -6364,18 +6620,18 @@ int Field_string::pack_cmp(const char *a, const char *b, uint length,
> 0 row > key
*/
-int Field_string::pack_cmp(const char *key, uint length,
+int Field_string::pack_cmp(const uchar *key, uint length,
my_bool insert_or_update)
{
uint row_length, local_key_length;
- char *end;
+ uchar *end;
if (length > 255)
{
local_key_length= uint2korr(key);
key+= 2;
}
else
- local_key_length= (uint) (uchar) *key++;
+ local_key_length= (uint) *key++;
/* Only use 'length' of key, not field_length */
end= ptr + length;
@@ -6384,17 +6640,17 @@ int Field_string::pack_cmp(const char *key, uint length,
row_length= (uint) (end - ptr);
return field_charset->coll->strnncollsp(field_charset,
- (const uchar*) ptr, row_length,
- (const uchar*) key, local_key_length,
+ ptr, row_length,
+ key, local_key_length,
insert_or_update);
}
-uint Field_string::packed_col_length(const char *data_ptr, uint length)
+uint Field_string::packed_col_length(const uchar *data_ptr, uint length)
{
if (length > 255)
return uint2korr(data_ptr)+2;
- return (uint) ((uchar) *data_ptr)+1;
+ return (uint) *data_ptr + 1;
}
@@ -6403,16 +6659,20 @@ uint Field_string::max_packed_col_length(uint max_length)
return (max_length > 255 ? 2 : 1)+max_length;
}
-uint Field_string::get_key_image(char *buff, uint length, imagetype type_arg)
+
+uint Field_string::get_key_image(uchar *buff, uint length, imagetype type_arg)
{
- uint bytes = my_charpos(field_charset, ptr, ptr + field_length,
+ uint bytes = my_charpos(field_charset, (char*) ptr,
+ (char*) ptr + field_length,
length / field_charset->mbmaxlen);
memcpy(buff, ptr, bytes);
if (bytes < length)
- bzero(buff + bytes, length - bytes);
+ field_charset->cset->fill(field_charset, (char*) buff + bytes,
+ length - bytes, field_charset->pad_char);
return bytes;
}
+
Field *Field_string::new_field(MEM_ROOT *root, struct st_table *new_table,
bool keep_type)
{
@@ -6456,6 +6716,25 @@ Field *Field_string::new_field(MEM_ROOT *root, struct st_table *new_table,
is 2.
****************************************************************************/
+const uint Field_varstring::MAX_SIZE= UINT_MAX16;
+
+/**
+ Save the field metadata for varstring fields.
+
+ Saves the field length in the first byte. Note: may consume
+ 2 bytes. Caller must ensure second byte is contiguous with
+ first byte (e.g. array index 0,1).
+
+ @param metadata_ptr First byte of field metadata
+
+ @returns number of bytes written to metadata_ptr
+*/
+int Field_varstring::do_save_field_metadata(uchar *metadata_ptr)
+{
+ char *ptr= (char *)metadata_ptr;
+ int2store(ptr, field_length);
+ return 2;
+}
int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs)
{
@@ -6466,7 +6745,8 @@ int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs)
const char *from_end_pos;
copy_length= well_formed_copy_nchars(field_charset,
- ptr + length_bytes, field_length,
+ (char*) ptr + length_bytes,
+ field_length,
cs, from, length,
field_length / field_charset->mbmaxlen,
&well_formed_error_pos,
@@ -6479,7 +6759,7 @@ int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs)
int2store(ptr, copy_length);
if (check_string_copy_error(this, well_formed_error_pos,
- cannot_convert_error_pos, from + length))
+ cannot_convert_error_pos, from + length, cs))
return 2;
// Check if we lost something other than just trailing spaces
@@ -6514,9 +6794,9 @@ double Field_varstring::val_real(void)
ASSERT_COLUMN_MARKED_FOR_READ;
int not_used;
char *end_not_used;
- uint length= length_bytes == 1 ? (uint) (uchar) *ptr : uint2korr(ptr);
- return my_strntod(field_charset, ptr+length_bytes, length, &end_not_used,
- &not_used);
+ uint length= length_bytes == 1 ? (uint) *ptr : uint2korr(ptr);
+ return my_strntod(field_charset, (char*) ptr+length_bytes, length,
+ &end_not_used, &not_used);
}
@@ -6525,8 +6805,8 @@ longlong Field_varstring::val_int(void)
ASSERT_COLUMN_MARKED_FOR_READ;
int not_used;
char *end_not_used;
- uint length= length_bytes == 1 ? (uint) (uchar) *ptr : uint2korr(ptr);
- return my_strntoll(field_charset, ptr+length_bytes, length, 10,
+ 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);
}
@@ -6534,7 +6814,7 @@ String *Field_varstring::val_str(String *val_buffer __attribute__((unused)),
String *val_ptr)
{
ASSERT_COLUMN_MARKED_FOR_READ;
- uint length= length_bytes == 1 ? (uint) (uchar) *ptr : uint2korr(ptr);
+ uint length= length_bytes == 1 ? (uint) *ptr : uint2korr(ptr);
val_ptr->set((const char*) ptr+length_bytes, length, field_charset);
return val_ptr;
}
@@ -6543,14 +6823,14 @@ 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;
- uint length= length_bytes == 1 ? (uint) (uchar) *ptr : uint2korr(ptr);
- str2my_decimal(E_DEC_FATAL_ERROR, ptr+length_bytes, length, charset(),
- decimal_value);
+ uint length= length_bytes == 1 ? (uint) *ptr : uint2korr(ptr);
+ str2my_decimal(E_DEC_FATAL_ERROR, (char*) ptr+length_bytes, length,
+ charset(), decimal_value);
return decimal_value;
}
-int Field_varstring::cmp_max(const char *a_ptr, const char *b_ptr,
+int Field_varstring::cmp_max(const uchar *a_ptr, const uchar *b_ptr,
uint max_len)
{
uint a_length, b_length;
@@ -6558,8 +6838,8 @@ int Field_varstring::cmp_max(const char *a_ptr, const char *b_ptr,
if (length_bytes == 1)
{
- a_length= (uint) (uchar) *a_ptr;
- b_length= (uint) (uchar) *b_ptr;
+ a_length= (uint) *a_ptr;
+ b_length= (uint) *b_ptr;
}
else
{
@@ -6569,10 +6849,10 @@ int Field_varstring::cmp_max(const char *a_ptr, const char *b_ptr,
set_if_smaller(a_length, max_len);
set_if_smaller(b_length, max_len);
diff= field_charset->coll->strnncollsp(field_charset,
- (const uchar*) a_ptr+
+ a_ptr+
length_bytes,
a_length,
- (const uchar*) b_ptr+
+ b_ptr+
length_bytes,
b_length,0);
return diff;
@@ -6583,18 +6863,18 @@ int Field_varstring::cmp_max(const char *a_ptr, const char *b_ptr,
NOTE: varstring and blob keys are ALWAYS stored with a 2 byte length prefix
*/
-int Field_varstring::key_cmp(const byte *key_ptr, uint max_key_length)
+int Field_varstring::key_cmp(const uchar *key_ptr, uint max_key_length)
{
- uint length= length_bytes == 1 ? (uint) (uchar) *ptr : uint2korr(ptr);
+ uint length= length_bytes == 1 ? (uint) *ptr : uint2korr(ptr);
uint local_char_length= max_key_length / field_charset->mbmaxlen;
local_char_length= my_charpos(field_charset, ptr + length_bytes,
ptr + length_bytes + length, local_char_length);
set_if_smaller(length, local_char_length);
return field_charset->coll->strnncollsp(field_charset,
- (const uchar*) ptr + length_bytes,
+ ptr + length_bytes,
length,
- (const uchar*) key_ptr+
+ key_ptr+
HA_KEY_BLOB_LENGTH,
uint2korr(key_ptr), 0);
}
@@ -6608,22 +6888,20 @@ int Field_varstring::key_cmp(const byte *key_ptr, uint max_key_length)
(keys are created and compared in key.cc)
*/
-int Field_varstring::key_cmp(const byte *a,const byte *b)
+int Field_varstring::key_cmp(const uchar *a,const uchar *b)
{
return field_charset->coll->strnncollsp(field_charset,
- (const uchar*) a +
- HA_KEY_BLOB_LENGTH,
+ a + HA_KEY_BLOB_LENGTH,
uint2korr(a),
- (const uchar*) b +
- HA_KEY_BLOB_LENGTH,
+ b + HA_KEY_BLOB_LENGTH,
uint2korr(b),
0);
}
-void Field_varstring::sort_string(char *to,uint length)
+void Field_varstring::sort_string(uchar *to,uint length)
{
- uint tot_length= length_bytes == 1 ? (uint) (uchar) *ptr : uint2korr(ptr);
+ uint tot_length= length_bytes == 1 ? (uint) *ptr : uint2korr(ptr);
if (field_charset == &my_charset_bin)
{
@@ -6636,8 +6914,7 @@ void Field_varstring::sort_string(char *to,uint length)
}
tot_length= my_strnxfrm(field_charset,
- (uchar*) to, length,
- (uchar*) ptr + length_bytes,
+ to, length, ptr + length_bytes,
tot_length);
DBUG_ASSERT(tot_length == length);
}
@@ -6674,7 +6951,7 @@ void Field_varstring::sql_type(String &res) const
uint32 Field_varstring::data_length()
{
- return length_bytes == 1 ? (uint32) (uchar) *ptr : uint2korr(ptr);
+ return length_bytes == 1 ? (uint32) *ptr : uint2korr(ptr);
}
/*
@@ -6682,9 +6959,9 @@ uint32 Field_varstring::data_length()
Here the number of length bytes are depending on the given max_length
*/
-char *Field_varstring::pack(char *to, const char *from, uint max_length)
+uchar *Field_varstring::pack(uchar *to, const uchar *from, uint max_length)
{
- uint length= length_bytes == 1 ? (uint) (uchar) *from : uint2korr(from);
+ uint length= length_bytes == 1 ? (uint) *from : uint2korr(from);
set_if_smaller(max_length, field_length);
if (length > max_length)
length=max_length;
@@ -6697,9 +6974,9 @@ char *Field_varstring::pack(char *to, const char *from, uint max_length)
}
-char *Field_varstring::pack_key(char *to, const char *key, uint max_length)
+uchar *Field_varstring::pack_key(uchar *to, const uchar *key, uint max_length)
{
- uint length= length_bytes == 1 ? (uint) (uchar) *key : uint2korr(key);
+ uint length= length_bytes == 1 ? (uint) *key : uint2korr(key);
uint local_char_length= ((field_charset->mbmaxlen > 1) ?
max_length/field_charset->mbmaxlen : max_length);
key+= length_bytes;
@@ -6736,13 +7013,13 @@ char *Field_varstring::pack_key(char *to, const char *key, uint max_length)
Pointer to end of 'key' (To the next key part if multi-segment key)
*/
-const char *Field_varstring::unpack_key(char *to, const char *key,
- uint max_length)
+const uchar *Field_varstring::unpack_key(uchar *to, const uchar *key,
+ uint max_length)
{
/* get length of the blob key */
- uint32 length= *((uchar*) key++);
+ uint32 length= *key++;
if (max_length > 255)
- length+= (*((uchar*) key++)) << 8;
+ length+= (*key++) << 8;
/* put the length into the record buffer */
if (length_bytes == 1)
@@ -6766,8 +7043,8 @@ const char *Field_varstring::unpack_key(char *to, const char *key,
end of key storage
*/
-char *Field_varstring::pack_key_from_key_image(char *to, const char *from,
- uint max_length)
+uchar *Field_varstring::pack_key_from_key_image(uchar *to, const uchar *from,
+ uint max_length)
{
/* Key length is always stored as 2 bytes */
uint length= uint2korr(from);
@@ -6782,15 +7059,53 @@ char *Field_varstring::pack_key_from_key_image(char *to, const char *from,
}
+/**
+ Unpack a varstring field from row data.
+
+ This method is used to unpack a varstring field from a master
+ whose size of the field is less than that of the slave.
+
+ @param to Destination of the data
+ @param from Source of the data
+ @param param_data Length bytes from the master's field data
+
+ @return New pointer into memory based on from + length of the data
+*/
+const uchar *Field_varstring::unpack(uchar *to,
+ const uchar *from,
+ uint param_data)
+{
+ uint length;
+ uint l_bytes= (param_data && (param_data < field_length)) ?
+ (param_data <= 255) ? 1 : 2 : length_bytes;
+ if (l_bytes == 1)
+ {
+ to[0]= *from++;
+ length= to[0];
+ if (length_bytes == 2)
+ to[1]= 0;
+ }
+ else
+ {
+ length= uint2korr(from);
+ to[0]= *from++;
+ to[1]= *from++;
+ }
+ if (length)
+ memcpy(to+ length_bytes, from, length);
+ return from+length;
+}
+
+
/*
unpack field packed with Field_varstring::pack()
*/
-const char *Field_varstring::unpack(char *to, const char *from)
+const uchar *Field_varstring::unpack(uchar *to, const uchar *from)
{
uint length;
if (length_bytes == 1)
- length= (uint) (uchar) (*to= *from++);
+ length= (uint) (*to= *from++);
else
{
length= uint2korr(from);
@@ -6803,7 +7118,7 @@ const char *Field_varstring::unpack(char *to, const char *from)
}
-int Field_varstring::pack_cmp(const char *a, const char *b,
+int Field_varstring::pack_cmp(const uchar *a, const uchar *b,
uint key_length_arg,
my_bool insert_or_update)
{
@@ -6815,21 +7130,21 @@ int Field_varstring::pack_cmp(const char *a, const char *b,
}
else
{
- a_length= (uint) (uchar) *a++;
- b_length= (uint) (uchar) *b++;
+ a_length= (uint) *a++;
+ b_length= (uint) *b++;
}
return field_charset->coll->strnncollsp(field_charset,
- (const uchar*) a, a_length,
- (const uchar*) b, b_length,
+ a, a_length,
+ b, b_length,
insert_or_update);
}
-int Field_varstring::pack_cmp(const char *b, uint key_length_arg,
+int Field_varstring::pack_cmp(const uchar *b, uint key_length_arg,
my_bool insert_or_update)
{
- char *a= ptr+ length_bytes;
- uint a_length= length_bytes == 1 ? (uint) (uchar) *ptr : uint2korr(ptr);
+ uchar *a= ptr+ length_bytes;
+ uint a_length= length_bytes == 1 ? (uint) *ptr : uint2korr(ptr);
uint b_length;
uint local_char_length= ((field_charset->mbmaxlen > 1) ?
key_length_arg / field_charset->mbmaxlen :
@@ -6840,7 +7155,7 @@ int Field_varstring::pack_cmp(const char *b, uint key_length_arg,
b_length=uint2korr(b); b+= HA_KEY_BLOB_LENGTH;
}
else
- b_length= (uint) (uchar) *b++;
+ b_length= (uint) *b++;
if (a_length > local_char_length)
{
@@ -6850,18 +7165,17 @@ int Field_varstring::pack_cmp(const char *b, uint key_length_arg,
}
return field_charset->coll->strnncollsp(field_charset,
- (const uchar*) a,
- a_length,
- (const uchar*) b, b_length,
+ a, a_length,
+ b, b_length,
insert_or_update);
}
-uint Field_varstring::packed_col_length(const char *data_ptr, uint length)
+uint Field_varstring::packed_col_length(const uchar *data_ptr, uint length)
{
if (length > 255)
return uint2korr(data_ptr)+2;
- return (uint) ((uchar) *data_ptr)+1;
+ return (uint) *data_ptr + 1;
}
@@ -6870,11 +7184,11 @@ uint Field_varstring::max_packed_col_length(uint max_length)
return (max_length > 255 ? 2 : 1)+max_length;
}
-uint Field_varstring::get_key_image(char *buff, uint length, imagetype type)
+uint Field_varstring::get_key_image(uchar *buff, uint length, imagetype type)
{
- uint f_length= length_bytes == 1 ? (uint) (uchar) *ptr : uint2korr(ptr);
+ uint f_length= length_bytes == 1 ? (uint) *ptr : uint2korr(ptr);
uint local_char_length= length / field_charset->mbmaxlen;
- char *pos= ptr+length_bytes;
+ uchar *pos= ptr+length_bytes;
local_char_length= my_charpos(field_charset, pos, pos + f_length,
local_char_length);
set_if_smaller(f_length, local_char_length);
@@ -6893,23 +7207,23 @@ uint Field_varstring::get_key_image(char *buff, uint length, imagetype type)
}
-void Field_varstring::set_key_image(char *buff,uint length)
+void Field_varstring::set_key_image(const uchar *buff,uint length)
{
length= uint2korr(buff); // Real length is here
- (void) Field_varstring::store(buff+HA_KEY_BLOB_LENGTH, length,
+ (void) Field_varstring::store((const char*) buff+HA_KEY_BLOB_LENGTH, length,
field_charset);
}
-int Field_varstring::cmp_binary(const char *a_ptr, const char *b_ptr,
+int Field_varstring::cmp_binary(const uchar *a_ptr, const uchar *b_ptr,
uint32 max_length)
{
uint32 a_length,b_length;
if (length_bytes == 1)
{
- a_length= (uint) (uchar) *a_ptr;
- b_length= (uint) (uchar) *b_ptr;
+ a_length= (uint) *a_ptr;
+ b_length= (uint) *b_ptr;
}
else
{
@@ -6937,7 +7251,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,
- char *new_ptr, uchar *new_null_ptr,
+ uchar *new_ptr, uchar *new_null_ptr,
uint new_null_bit)
{
Field_varstring *res;
@@ -6954,7 +7268,7 @@ Field *Field_varstring::new_key_field(MEM_ROOT *root,
}
-uint Field_varstring::is_equal(create_field *new_field)
+uint Field_varstring::is_equal(Create_field *new_field)
{
if (new_field->sql_type == real_type() &&
new_field->charset == field_charset)
@@ -6978,9 +7292,9 @@ void Field_varstring::hash(ulong *nr, ulong *nr2)
}
else
{
- uint len= length_bytes == 1 ? (uint) (uchar) *ptr : uint2korr(ptr);
+ uint len= length_bytes == 1 ? (uint) *ptr : uint2korr(ptr);
CHARSET_INFO *cs= charset();
- cs->coll->hash_sort(cs, (uchar*) ptr + length_bytes, len, nr, nr2);
+ cs->coll->hash_sort(cs, ptr + length_bytes, len, nr, nr2);
}
}
@@ -6991,7 +7305,7 @@ void Field_varstring::hash(ulong *nr, ulong *nr2)
** packlength slot and may be from 1-4.
****************************************************************************/
-Field_blob::Field_blob(char *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
+Field_blob::Field_blob(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
TABLE_SHARE *share, uint blob_pack_length,
CHARSET_INFO *cs)
@@ -7006,7 +7320,10 @@ Field_blob::Field_blob(char *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
}
-void Field_blob::store_length(char *i_ptr, uint i_packlength, uint32 i_number)
+void Field_blob::store_length(uchar *i_ptr,
+ uint i_packlength,
+ uint32 i_number,
+ bool low_byte_first)
{
switch (i_packlength) {
case 1:
@@ -7014,7 +7331,7 @@ void Field_blob::store_length(char *i_ptr, uint i_packlength, uint32 i_number)
break;
case 2:
#ifdef WORDS_BIGENDIAN
- if (table->s->db_low_byte_first)
+ if (low_byte_first)
{
int2store(i_ptr,(unsigned short) i_number);
}
@@ -7027,7 +7344,7 @@ void Field_blob::store_length(char *i_ptr, uint i_packlength, uint32 i_number)
break;
case 4:
#ifdef WORDS_BIGENDIAN
- if (table->s->db_low_byte_first)
+ if (low_byte_first)
{
int4store(i_ptr,i_number);
}
@@ -7038,16 +7355,16 @@ void Field_blob::store_length(char *i_ptr, uint i_packlength, uint32 i_number)
}
-uint32 Field_blob::get_length(const char *pos)
+uint32 Field_blob::get_length(const uchar *pos, bool low_byte_first)
{
switch (packlength) {
case 1:
- return (uint32) (uchar) pos[0];
+ return (uint32) pos[0];
case 2:
{
uint16 tmp;
#ifdef WORDS_BIGENDIAN
- if (table->s->db_low_byte_first)
+ if (low_byte_first)
tmp=sint2korr(pos);
else
#endif
@@ -7060,7 +7377,7 @@ uint32 Field_blob::get_length(const char *pos)
{
uint32 tmp;
#ifdef WORDS_BIGENDIAN
- if (table->s->db_low_byte_first)
+ if (low_byte_first)
tmp=uint4korr(pos);
else
#endif
@@ -7089,7 +7406,7 @@ uint32 Field_blob::get_length(const char *pos)
nothing
*/
-void Field_blob::put_length(char *pos, uint32 length)
+void Field_blob::put_length(uchar *pos, uint32 length)
{
switch (packlength) {
case 1:
@@ -7157,10 +7474,10 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs)
Field_blob::store_length(copy_length);
tmp= value.ptr();
- bmove(ptr+packlength,(char*) &tmp,sizeof(char*));
+ bmove(ptr+packlength,(uchar*) &tmp,sizeof(char*));
if (check_string_copy_error(this, well_formed_error_pos,
- cannot_convert_error_pos, from + length))
+ cannot_convert_error_pos, from + length, cs))
return 2;
if (from_end_pos < from + length)
@@ -7241,29 +7558,35 @@ my_decimal *Field_blob::val_decimal(my_decimal *decimal_value)
{
ASSERT_COLUMN_MARKED_FOR_READ;
const char *blob;
- memcpy_fixed(&blob, ptr+packlength, sizeof(const char*));
+ size_t length;
+ memcpy_fixed(&blob, ptr+packlength, sizeof(const uchar*));
if (!blob)
+ {
blob= "";
- str2my_decimal(E_DEC_FATAL_ERROR, blob, get_length(ptr), charset(),
+ length= 0;
+ }
+ else
+ length= get_length(ptr);
+
+ str2my_decimal(E_DEC_FATAL_ERROR, blob, length, charset(),
decimal_value);
return decimal_value;
}
-int Field_blob::cmp(const char *a,uint32 a_length, const char *b,
+int Field_blob::cmp(const uchar *a,uint32 a_length, const uchar *b,
uint32 b_length)
{
return field_charset->coll->strnncollsp(field_charset,
- (const uchar*)a, a_length,
- (const uchar*)b, b_length,
+ a, a_length, b, b_length,
0);
}
-int Field_blob::cmp_max(const char *a_ptr, const char *b_ptr,
+int Field_blob::cmp_max(const uchar *a_ptr, const uchar *b_ptr,
uint max_length)
{
- char *blob1,*blob2;
+ uchar *blob1,*blob2;
memcpy_fixed(&blob1,a_ptr+packlength,sizeof(char*));
memcpy_fixed(&blob2,b_ptr+packlength,sizeof(char*));
uint a_len= get_length(a_ptr), b_len= get_length(b_ptr);
@@ -7273,7 +7596,7 @@ int Field_blob::cmp_max(const char *a_ptr, const char *b_ptr,
}
-int Field_blob::cmp_binary(const char *a_ptr, const char *b_ptr,
+int Field_blob::cmp_binary(const uchar *a_ptr, const uchar *b_ptr,
uint32 max_length)
{
char *a,*b;
@@ -7294,10 +7617,10 @@ int Field_blob::cmp_binary(const char *a_ptr, const char *b_ptr,
/* The following is used only when comparing a key */
-uint Field_blob::get_key_image(char *buff,uint length, imagetype type_arg)
+uint Field_blob::get_key_image(uchar *buff,uint length, imagetype type_arg)
{
uint32 blob_length= get_length(ptr);
- char *blob;
+ uchar *blob;
#ifdef HAVE_SPATIAL
if (type_arg == itMBR)
@@ -7314,7 +7637,7 @@ uint Field_blob::get_key_image(char *buff,uint length, imagetype type_arg)
return image_length;
}
get_ptr(&blob);
- gobj= Geometry::construct(&buffer, blob, blob_length);
+ gobj= Geometry::construct(&buffer, (char*) blob, blob_length);
if (!gobj || gobj->get_mbr(&mbr, &dummy))
bzero(buff, image_length);
else
@@ -7349,16 +7672,17 @@ uint Field_blob::get_key_image(char *buff,uint length, imagetype type_arg)
}
-void Field_blob::set_key_image(char *buff,uint length)
+void Field_blob::set_key_image(const uchar *buff,uint length)
{
length= uint2korr(buff);
- (void) Field_blob::store(buff+HA_KEY_BLOB_LENGTH, length, field_charset);
+ (void) Field_blob::store((const char*) buff+HA_KEY_BLOB_LENGTH, length,
+ field_charset);
}
-int Field_blob::key_cmp(const byte *key_ptr, uint max_key_length)
+int Field_blob::key_cmp(const uchar *key_ptr, uint max_key_length)
{
- char *blob1;
+ uchar *blob1;
uint blob_length=get_length(ptr);
memcpy_fixed(&blob1,ptr+packlength,sizeof(char*));
CHARSET_INFO *cs= charset();
@@ -7367,14 +7691,31 @@ int Field_blob::key_cmp(const byte *key_ptr, uint max_key_length)
local_char_length);
set_if_smaller(blob_length, local_char_length);
return Field_blob::cmp(blob1, blob_length,
- (char*) key_ptr+HA_KEY_BLOB_LENGTH,
+ key_ptr+HA_KEY_BLOB_LENGTH,
uint2korr(key_ptr));
}
-int Field_blob::key_cmp(const byte *a,const byte *b)
+int Field_blob::key_cmp(const uchar *a,const uchar *b)
+{
+ return Field_blob::cmp(a+HA_KEY_BLOB_LENGTH, uint2korr(a),
+ b+HA_KEY_BLOB_LENGTH, uint2korr(b));
+}
+
+
+/**
+ Save the field metadata for blob fields.
+
+ Saves the pack length in the first byte of the field metadata array
+ at index of *metadata_ptr.
+
+ @param metadata_ptr First byte of field metadata
+
+ @returns number of bytes written to metadata_ptr
+*/
+int Field_blob::do_save_field_metadata(uchar *metadata_ptr)
{
- return Field_blob::cmp((char*) a+HA_KEY_BLOB_LENGTH, uint2korr(a),
- (char*) b+HA_KEY_BLOB_LENGTH, uint2korr(b));
+ *metadata_ptr= pack_length_no_ptr();
+ return 1;
}
@@ -7385,9 +7726,9 @@ uint32 Field_blob::sort_length() const
}
-void Field_blob::sort_string(char *to,uint length)
+void Field_blob::sort_string(uchar *to,uint length)
{
- char *blob;
+ uchar *blob;
uint blob_length=get_length();
if (!blob_length)
@@ -7396,7 +7737,7 @@ void Field_blob::sort_string(char *to,uint length)
{
if (field_charset == &my_charset_bin)
{
- char *pos;
+ uchar *pos;
/*
Store length of blob last in blob to shorter blobs before longer blobs
@@ -7422,8 +7763,7 @@ void Field_blob::sort_string(char *to,uint length)
memcpy_fixed(&blob,ptr+packlength,sizeof(char*));
blob_length=my_strnxfrm(field_charset,
- (uchar*) to, length,
- (uchar*) blob, blob_length);
+ to, length, blob, blob_length);
DBUG_ASSERT(blob_length == length);
}
}
@@ -7449,23 +7789,21 @@ void Field_blob::sql_type(String &res) const
}
-char *Field_blob::pack(char *to, const char *from, uint max_length)
+uchar *Field_blob::pack(uchar *to, const uchar *from, uint max_length)
{
- char *save=ptr;
- ptr=(char*) from;
+ uchar *save= ptr;
+ ptr= (uchar*) from;
uint32 length=get_length(); // Length of from string
if (length > max_length)
{
- ptr=to;
length=max_length;
- store_length(length); // Store max length
- ptr=(char*) from;
+ store_length(to,packlength,length,TRUE);
}
else
memcpy(to,from,packlength); // Copy length
if (length)
{
- get_ptr((char**) &from);
+ get_ptr((uchar**) &from);
memcpy(to+packlength, from,length);
}
ptr=save; // Restore org row pointer
@@ -7473,10 +7811,33 @@ char *Field_blob::pack(char *to, const char *from, uint max_length)
}
-const char *Field_blob::unpack(char *to, const char *from)
+/**
+ Unpack a blob field from row data.
+
+ This method is used to unpack a blob field from a master whose size of
+ the field is less than that of the slave. Note: This method is included
+ to satisfy inheritance rules, but is not needed for blob fields. It
+ simply is used as a pass-through to the original unpack() method for
+ blob fields.
+
+ @param to Destination of the data
+ @param from Source of the data
+ @param param_data not used
+
+ @return New pointer into memory based on from + length of the data
+*/
+const uchar *Field_blob::unpack(uchar *to,
+ const uchar *from,
+ uint param_data)
+{
+ return unpack(to, from);
+}
+
+
+const uchar *Field_blob::unpack(uchar *to, const uchar *from)
{
- memcpy(to,from,packlength);
uint32 length=get_length(from);
+ memcpy(to,from,packlength);
from+=packlength;
if (length)
memcpy_fixed(to+packlength, &from, sizeof(from));
@@ -7487,7 +7848,7 @@ const char *Field_blob::unpack(char *to, const char *from)
/* Keys for blobs are like keys on varchars */
-int Field_blob::pack_cmp(const char *a, const char *b, uint key_length_arg,
+int Field_blob::pack_cmp(const uchar *a, const uchar *b, uint key_length_arg,
my_bool insert_or_update)
{
uint a_length, b_length;
@@ -7498,20 +7859,20 @@ int Field_blob::pack_cmp(const char *a, const char *b, uint key_length_arg,
}
else
{
- a_length= (uint) (uchar) *a++;
- b_length= (uint) (uchar) *b++;
+ a_length= (uint) *a++;
+ b_length= (uint) *b++;
}
return field_charset->coll->strnncollsp(field_charset,
- (const uchar*) a, a_length,
- (const uchar*) b, b_length,
+ a, a_length,
+ b, b_length,
insert_or_update);
}
-int Field_blob::pack_cmp(const char *b, uint key_length_arg,
+int Field_blob::pack_cmp(const uchar *b, uint key_length_arg,
my_bool insert_or_update)
{
- char *a;
+ uchar *a;
uint a_length, b_length;
memcpy_fixed(&a,ptr+packlength,sizeof(char*));
if (!a)
@@ -7523,24 +7884,24 @@ int Field_blob::pack_cmp(const char *b, uint key_length_arg,
b_length= uint2korr(b); b+=2;
}
else
- b_length= (uint) (uchar) *b++;
+ b_length= (uint) *b++;
return field_charset->coll->strnncollsp(field_charset,
- (const uchar*) a, a_length,
- (const uchar*) b, b_length,
+ a, a_length,
+ b, b_length,
insert_or_update);
}
/* Create a packed key that will be used for storage from a MySQL row */
-char *Field_blob::pack_key(char *to, const char *from, uint max_length)
+uchar *Field_blob::pack_key(uchar *to, const uchar *from, uint max_length)
{
- char *save=ptr;
- ptr=(char*) from;
- uint32 length=get_length(); // Length of from string
+ uchar *save= ptr;
+ ptr= (uchar*) from;
+ uint32 length=get_length(); // Length of from string
uint local_char_length= ((field_charset->mbmaxlen > 1) ?
- max_length/field_charset->mbmaxlen : max_length);
+ max_length/field_charset->mbmaxlen : max_length);
if (length)
- get_ptr((char**) &from);
+ get_ptr((uchar**) &from);
if (length > local_char_length)
local_char_length= my_charpos(field_charset, from, from+length,
local_char_length);
@@ -7577,12 +7938,13 @@ char *Field_blob::pack_key(char *to, const char *from, uint max_length)
Pointer into 'from' past the last byte copied from packed key.
*/
-const char *Field_blob::unpack_key(char *to, const char *from, uint max_length)
+const uchar *Field_blob::unpack_key(uchar *to, const uchar *from,
+ uint max_length)
{
/* get length of the blob key */
- uint32 length= *((uchar*) from++);
+ uint32 length= *from++;
if (max_length > 255)
- length+= (*((uchar*) from++)) << 8;
+ length+= *from++ << 8;
/* put the length into the record buffer */
put_length(to, length);
@@ -7600,8 +7962,8 @@ const char *Field_blob::unpack_key(char *to, const char *from, uint max_length)
/* Create a packed key that will be used for storage from a MySQL key */
-char *Field_blob::pack_key_from_key_image(char *to, const char *from,
- uint max_length)
+uchar *Field_blob::pack_key_from_key_image(uchar *to, const uchar *from,
+ uint max_length)
{
uint length=uint2korr(from);
if (length > max_length)
@@ -7615,11 +7977,11 @@ char *Field_blob::pack_key_from_key_image(char *to, const char *from,
}
-uint Field_blob::packed_col_length(const char *data_ptr, uint length)
+uint Field_blob::packed_col_length(const uchar *data_ptr, uint length)
{
if (length > 255)
return uint2korr(data_ptr)+2;
- return (uint) ((uchar) *data_ptr)+1;
+ return (uint) *data_ptr + 1;
}
@@ -7629,7 +7991,7 @@ uint Field_blob::max_packed_col_length(uint max_length)
}
-uint Field_blob::is_equal(create_field *new_field)
+uint Field_blob::is_equal(Create_field *new_field)
{
if (compare_str_field_flags(new_field, flags))
return 0;
@@ -7643,9 +8005,9 @@ uint Field_blob::is_equal(create_field *new_field)
#ifdef HAVE_SPATIAL
-uint Field_geom::get_key_image(char *buff, uint length, imagetype type)
+uint Field_geom::get_key_image(uchar *buff, uint length, imagetype type)
{
- char *blob;
+ uchar *blob;
const char *dummy;
MBR mbr;
ulong blob_length= get_length(ptr);
@@ -7659,7 +8021,7 @@ uint Field_geom::get_key_image(char *buff, uint length, imagetype type)
return image_length;
}
get_ptr(&blob);
- gobj= Geometry::construct(&buffer, blob, blob_length);
+ gobj= Geometry::construct(&buffer, (char*) blob, blob_length);
if (!gobj || gobj->get_mbr(&mbr, &dummy))
bzero(buff, image_length);
else
@@ -7856,6 +8218,8 @@ int Field_enum::store(const char *from,uint length,CHARSET_INFO *cs)
tmp=0;
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
}
+ if (!table->in_use->count_cuted_fields)
+ err= 0;
}
else
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
@@ -7878,8 +8242,11 @@ int Field_enum::store(longlong nr, bool unsigned_val)
if ((ulonglong) nr > typelib->count || nr == 0)
{
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
- nr=0;
- error=1;
+ if (nr != 0 || table->in_use->count_cuted_fields)
+ {
+ nr= 0;
+ error= 1;
+ }
}
store_type((ulonglong) (uint) nr);
return error;
@@ -7897,7 +8264,7 @@ longlong Field_enum::val_int(void)
ASSERT_COLUMN_MARKED_FOR_READ;
switch (packlength) {
case 1:
- return (longlong) (uchar) ptr[0];
+ return (longlong) ptr[0];
case 2:
{
uint16 tmp;
@@ -7938,6 +8305,25 @@ longlong Field_enum::val_int(void)
}
+/**
+ Save the field metadata for enum fields.
+
+ Saves the real type in the first byte and the pack length in the
+ second byte of the field metadata array at index of *metadata_ptr and
+ *(metadata_ptr + 1).
+
+ @param metadata_ptr First byte of field metadata
+
+ @returns number of bytes written to metadata_ptr
+*/
+int Field_enum::do_save_field_metadata(uchar *metadata_ptr)
+{
+ *metadata_ptr= real_type();
+ *(metadata_ptr + 1)= pack_length();
+ return 2;
+}
+
+
String *Field_enum::val_str(String *val_buffer __attribute__((unused)),
String *val_ptr)
{
@@ -7951,18 +8337,18 @@ String *Field_enum::val_str(String *val_buffer __attribute__((unused)),
return val_ptr;
}
-int Field_enum::cmp(const char *a_ptr, const char *b_ptr)
+int Field_enum::cmp(const uchar *a_ptr, const uchar *b_ptr)
{
- char *old=ptr;
- ptr=(char*) a_ptr;
+ uchar *old= ptr;
+ ptr= (uchar*) a_ptr;
ulonglong a=Field_enum::val_int();
- ptr=(char*) b_ptr;
+ ptr= (uchar*) b_ptr;
ulonglong b=Field_enum::val_int();
- ptr=old;
+ ptr= old;
return (a < b) ? -1 : (a > b) ? 1 : 0;
}
-void Field_enum::sort_string(char *to,uint length __attribute__((unused)))
+void Field_enum::sort_string(uchar *to,uint length __attribute__((unused)))
{
ulonglong value=Field_enum::val_int();
to+=packlength-1;
@@ -8144,9 +8530,9 @@ bool Field_enum::eq_def(Field *field)
for (uint i=0 ; i < from_lib->count ; i++)
if (my_strnncoll(field_charset,
(const uchar*)typelib->type_names[i],
- (uint) strlen(typelib->type_names[i]),
+ strlen(typelib->type_names[i]),
(const uchar*)from_lib->type_names[i],
- (uint) strlen(from_lib->type_names[i])))
+ strlen(from_lib->type_names[i])))
return 0;
return 1;
}
@@ -8165,7 +8551,7 @@ bool Field_num::eq_def(Field *field)
}
-uint Field_num::is_equal(create_field *new_field)
+uint Field_num::is_equal(Create_field *new_field)
{
return ((new_field->sql_type == real_type()) &&
((new_field->flags & UNSIGNED_FLAG) == (uint) (flags &
@@ -8205,7 +8591,7 @@ uint Field_num::is_equal(create_field *new_field)
11 one byte for 'd'
*/
-Field_bit::Field_bit(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
+Field_bit::Field_bit(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg, uchar *bit_ptr_arg, uchar bit_ofs_arg,
enum utype unireg_check_arg, const char *field_name_arg)
: Field(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
@@ -8223,7 +8609,7 @@ Field_bit::Field_bit(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
}
-my_size_t
+size_t
Field_bit::do_last_null_byte() const
{
/*
@@ -8245,14 +8631,14 @@ Field_bit::do_last_null_byte() const
result= bit_ptr;
if (result)
- return (byte*) result - table->record[0] + 1;
- else
- return LAST_NULL_BYTE_UNDEF;
+ return (size_t) (result - table->record[0]) + 1;
+ return LAST_NULL_BYTE_UNDEF;
}
+
Field *Field_bit::new_key_field(MEM_ROOT *root,
struct st_table *new_table,
- char *new_ptr, uchar *new_null_ptr,
+ uchar *new_ptr, uchar *new_null_ptr,
uint new_null_bit)
{
Field_bit *res;
@@ -8261,7 +8647,7 @@ Field *Field_bit::new_key_field(MEM_ROOT *root,
new_null_bit)))
{
/* Move bits normally stored in null_pointer to new_ptr */
- res->bit_ptr= (uchar*) new_ptr;
+ res->bit_ptr= new_ptr;
res->bit_ofs= 0;
if (bit_len)
res->ptr++; // Store rest of data here
@@ -8270,6 +8656,13 @@ Field *Field_bit::new_key_field(MEM_ROOT *root,
}
+uint Field_bit::is_equal(Create_field *new_field)
+{
+ return (new_field->sql_type == real_type() &&
+ new_field->length == max_display_length());
+}
+
+
int Field_bit::store(const char *from, uint length, CHARSET_INFO *cs)
{
ASSERT_COLUMN_MARKED_FOR_WRITE;
@@ -8358,7 +8751,7 @@ longlong Field_bit::val_int(void)
switch (bytes_in_rec) {
case 0: return bits;
- case 1: return bits | (ulonglong) (uchar) ptr[0];
+ case 1: return bits | (ulonglong) ptr[0];
case 2: return bits | mi_uint2korr(ptr);
case 3: return bits | mi_uint3korr(ptr);
case 4: return bits | mi_uint4korr(ptr);
@@ -8408,7 +8801,7 @@ my_decimal *Field_bit::val_decimal(my_decimal *deciaml_value)
The a and b pointer must be pointers to the field in a record
(not the table->record[0] necessarily)
*/
-int Field_bit::cmp_max(const char *a, const char *b, uint max_len)
+int Field_bit::cmp_max(const uchar *a, const uchar *b, uint max_len)
{
my_ptrdiff_t a_diff= a - ptr;
my_ptrdiff_t b_diff= b - ptr;
@@ -8424,13 +8817,13 @@ int Field_bit::cmp_max(const char *a, const char *b, uint max_len)
}
-int Field_bit::key_cmp(const byte *str, uint length)
+int Field_bit::key_cmp(const uchar *str, uint length)
{
if (bit_len)
{
int flag;
uchar bits= get_rec_bits(bit_ptr, bit_ofs, bit_len);
- if ((flag= (int) (bits - *(uchar*) str)))
+ if ((flag= (int) (bits - *str)))
return flag;
str++;
length--;
@@ -8453,7 +8846,7 @@ int Field_bit::cmp_offset(uint row_offset)
}
-uint Field_bit::get_key_image(char *buff, uint length, imagetype type_arg)
+uint Field_bit::get_key_image(uchar *buff, uint length, imagetype type_arg)
{
if (bit_len)
{
@@ -8467,6 +8860,77 @@ uint Field_bit::get_key_image(char *buff, uint length, imagetype type_arg)
}
+/**
+ Save the field metadata for bit fields.
+
+ Saves the bit length in the first byte and bytes in record in the
+ second byte of the field metadata array at index of *metadata_ptr and
+ *(metadata_ptr + 1).
+
+ @param metadata_ptr First byte of field metadata
+
+ @returns number of bytes written to metadata_ptr
+*/
+int Field_bit::do_save_field_metadata(uchar *metadata_ptr)
+{
+ *metadata_ptr= bit_len;
+ *(metadata_ptr + 1)= bytes_in_rec;
+ return 2;
+}
+
+
+/**
+ Returns the number of bytes field uses in row-based replication
+ row packed size.
+
+ This method is used in row-based replication to determine the number
+ of bytes that the field consumes in the row record format. This is
+ used to skip fields in the master that do not exist on the slave.
+
+ @param field_metadata Encoded size in field metadata
+
+ @returns The size of the field based on the field metadata.
+*/
+uint Field_bit::pack_length_from_metadata(uint field_metadata)
+{
+ uint const from_len= (field_metadata >> 8U) & 0x00ff;
+ uint const from_bit_len= field_metadata & 0x00ff;
+ uint const source_size= from_len + ((from_bit_len > 0) ? 1 : 0);
+ return (source_size);
+}
+
+
+/**
+ Check to see if field size is compatible with destination.
+
+ This method is used in row-based replication to verify that the slave's
+ field size is less than or equal to the master's field size. The
+ encoded field metadata (from the master or source) is decoded and compared
+ to the size of this field (the slave or destination).
+
+ @param field_metadata Encoded size in field metadata
+
+ @retval 0 if this field's size is < the source field's size
+ @retval 1 if this field's size is >= the source field's size
+*/
+int Field_bit::compatible_field_size(uint field_metadata)
+{
+ int compatible= 0;
+ uint const source_size= pack_length_from_metadata(field_metadata);
+ uint const destination_size= row_pack_length();
+ uint const from_bit_len= field_metadata & 0x00ff;
+ uint const from_len= (field_metadata >> 8U) & 0x00ff;
+ if ((bit_len == 0) || (from_bit_len == 0))
+ compatible= (source_size <= destination_size);
+ else if (from_bit_len > bit_len)
+ compatible= (from_len < bytes_in_rec);
+ else
+ compatible= ((from_bit_len <= bit_len) && (from_len <= bytes_in_rec));
+ return (compatible);
+}
+
+
+
void Field_bit::sql_type(String &res) const
{
CHARSET_INFO *cs= res.charset();
@@ -8476,7 +8940,7 @@ void Field_bit::sql_type(String &res) const
}
-char *Field_bit::pack(char *to, const char *from, uint max_length)
+uchar *Field_bit::pack(uchar *to, const uchar *from, uint max_length)
{
DBUG_ASSERT(max_length);
uint length;
@@ -8510,7 +8974,59 @@ char *Field_bit::pack(char *to, const char *from, uint max_length)
}
-const char *Field_bit::unpack(char *to, const char *from)
+/**
+ Unpack a bit field from row data.
+
+ This method is used to unpack a bit field from a master whose size
+ of the field is less than that of the slave.
+
+ @param to Destination of the data
+ @param from Source of the data
+ @param param_data Bit length (upper) and length (lower) values
+
+ @return New pointer into memory based on from + length of the data
+*/
+const uchar *Field_bit::unpack(uchar *to,
+ const uchar *from,
+ uint param_data)
+{
+ uint const from_len= (param_data >> 8U) & 0x00ff;
+ uint const from_bit_len= param_data & 0x00ff;
+ /*
+ If the master and slave have the same sizes, then use the old
+ unpack() method.
+ */
+ if ((from_bit_len == bit_len) &&
+ (from_len == bytes_in_rec))
+ return(unpack(to, from));
+ /*
+ We are converting a smaller bit field to a larger one here.
+ To do that, we first need to construct a raw value for the original
+ bit value stored in the from buffer. Then that needs to be converted
+ to the larger field then sent to store() for writing to the field.
+ Lastly the odd bits need to be masked out if the bytes_in_rec > 0.
+ Otherwise stray bits can cause spurious values.
+ */
+ uint new_len= (field_length + 7) / 8;
+ char *value= (char *)my_alloca(new_len);
+ bzero(value, new_len);
+ uint len= from_len + ((from_bit_len > 0) ? 1 : 0);
+ memcpy(value + (new_len - len), from, len);
+ /*
+ Mask out the unused bits in the partial byte.
+ TODO: Add code to the master to always mask these bits and remove
+ the following.
+ */
+ if ((from_bit_len > 0) && (from_len > 0))
+ value[new_len - len]= value[new_len - len] & ((1U << from_bit_len) - 1);
+ bitmap_set_bit(table->write_set,field_index);
+ store(value, new_len, system_charset_info);
+ my_afree(value);
+ return from + len;
+}
+
+
+const uchar *Field_bit::unpack(uchar *to, const uchar *from)
{
if (bit_len > 0)
{
@@ -8544,7 +9060,7 @@ void Field_bit::set_default()
Bit field support for non-MyISAM tables.
*/
-Field_bit_as_char::Field_bit_as_char(char *ptr_arg, uint32 len_arg,
+Field_bit_as_char::Field_bit_as_char(uchar *ptr_arg, uint32 len_arg,
uchar *null_ptr_arg, uchar null_bit_arg,
enum utype unireg_check_arg,
const char *field_name_arg)
@@ -8571,7 +9087,7 @@ int Field_bit_as_char::store(const char *from, uint length, CHARSET_INFO *cs)
{
memset(ptr, 0xff, bytes_in_rec);
if (bits)
- *ptr&= ((1 << bits) - 1); /* set first byte */
+ *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);
else
@@ -8594,20 +9110,20 @@ void Field_bit_as_char::sql_type(String &res) const
/*****************************************************************************
- Handling of field and create_field
+ Handling of field and Create_field
*****************************************************************************/
/*
- Convert create_field::length from number of characters to number of bytes
+ Convert Create_field::length from number of characters to number of bytes
SYNOPSIS
- create_field::create_length_to_internal_length()
+ Create_field::create_length_to_internal_length()
DESCRIPTION
- Convert create_field::length from number of characters to number of bytes.
+ Convert Create_field::length from number of characters to number of bytes.
*/
-void create_field::create_length_to_internal_length(void)
+void Create_field::create_length_to_internal_length(void)
{
switch (sql_type) {
case MYSQL_TYPE_TINY_BLOB:
@@ -8654,7 +9170,7 @@ void create_field::create_length_to_internal_length(void)
}
-void create_field::init_for_tmp_table(enum_field_types sql_type_arg,
+void Create_field::init_for_tmp_table(enum_field_types sql_type_arg,
uint32 length_arg, uint32 decimals_arg,
bool maybe_null, bool is_unsigned)
{
@@ -8695,7 +9211,7 @@ void create_field::init_for_tmp_table(enum_field_types sql_type_arg,
TRUE on error
*/
-bool create_field::init(THD *thd, char *fld_name, enum_field_types fld_type,
+bool Create_field::init(THD *thd, char *fld_name, enum_field_types fld_type,
char *fld_length, char *fld_decimals,
uint fld_type_modifier, Item *fld_default_value,
Item *fld_on_update_value, LEX_STRING *fld_comment,
@@ -8705,7 +9221,7 @@ bool create_field::init(THD *thd, char *fld_name, enum_field_types fld_type,
uint sign_len, allowed_type_modifier= 0;
ulong max_field_charlength= MAX_FIELD_CHARLENGTH;
- DBUG_ENTER("create_field::init()");
+ DBUG_ENTER("Create_field::init()");
field= 0;
field_name= fld_name;
@@ -8772,8 +9288,7 @@ bool create_field::init(THD *thd, char *fld_name, enum_field_types fld_type,
case MYSQL_TYPE_NULL:
break;
case MYSQL_TYPE_NEWDECIMAL:
- if (!fld_length && !decimals)
- length= 10;
+ my_decimal_trim(&length, &decimals);
if (length > DECIMAL_MAX_PRECISION)
{
my_error(ER_TOO_BIG_PRECISION, MYF(0), length, fld_name,
@@ -8890,15 +9405,18 @@ bool create_field::init(THD *thd, char *fld_name, enum_field_types fld_type,
break;
case MYSQL_TYPE_TIMESTAMP:
if (!fld_length)
- length= 14; /* Full date YYYYMMDDHHMMSS */
- else if (length != 19)
+ {
+ /* Compressed date YYYYMMDDHHMMSS */
+ length= MAX_DATETIME_COMPRESSED_WIDTH;
+ }
+ else if (length != MAX_DATETIME_WIDTH)
{
/*
We support only even TIMESTAMP lengths less or equal than 14
and 19 as length of 4.1 compatible representation.
*/
length= ((length+1)/2)*2; /* purecov: inspected */
- length= min(length,14); /* purecov: inspected */
+ length= min(length, MAX_DATETIME_COMPRESSED_WIDTH); /* purecov: inspected */
}
flags|= ZEROFILL_FLAG | UNSIGNED_FLAG;
if (fld_default_value)
@@ -8951,7 +9469,7 @@ bool create_field::init(THD *thd, char *fld_name, enum_field_types fld_type,
length= 10;
break;
case MYSQL_TYPE_DATETIME:
- length= 19;
+ length= MAX_DATETIME_WIDTH;
break;
case MYSQL_TYPE_SET:
{
@@ -9099,7 +9617,7 @@ uint pack_length_to_packflag(uint type)
}
-Field *make_field(TABLE_SHARE *share, char *ptr, uint32 field_length,
+Field *make_field(TABLE_SHARE *share, uchar *ptr, uint32 field_length,
uchar *null_pos, uchar null_bit,
uint pack_flag,
enum_field_types field_type,
@@ -9279,7 +9797,7 @@ Field *make_field(TABLE_SHARE *share, char *ptr, uint32 field_length,
/* Create a field suitable for create of table */
-create_field::create_field(Field *old_field,Field *orig_field)
+Create_field::Create_field(Field *old_field,Field *orig_field)
{
field= old_field;
field_name=change=old_field->field_name;
@@ -9536,4 +10054,3 @@ Field::set_datetime_warning(MYSQL_ERROR::enum_warning_level level, uint code,
field_name);
}
}
-
diff --git a/sql/field.h b/sql/field.h
index 2c2640a8262..8aad6783291 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -28,7 +28,7 @@
class Send_field;
class Protocol;
-class create_field;
+class Create_field;
struct st_cache_field;
int field_conv(Field *to,Field *from);
@@ -48,10 +48,10 @@ class Field
Field(const Item &); /* Prevent use of these */
void operator=(Field &);
public:
- static void *operator new(size_t size) {return (void*) sql_alloc((uint) size); }
+ static void *operator new(size_t size) {return sql_alloc(size); }
static void operator delete(void *ptr_arg, size_t size) { TRASH(ptr_arg, size); }
- char *ptr; // Position to field in record
+ uchar *ptr; // Position to field in record
uchar *null_ptr; // Byte where null_bit is
/*
Note that you can use table->in_use as replacement for current_thd member
@@ -90,15 +90,18 @@ public:
uint16 field_index; // field number in fields array
uchar null_bit; // Bit used to test null bit
- Field(char *ptr_arg,uint32 length_arg,uchar *null_ptr_arg,uchar null_bit_arg,
- utype unireg_check_arg, const char *field_name_arg);
+ Field(uchar *ptr_arg,uint32 length_arg,uchar *null_ptr_arg,
+ uchar null_bit_arg, utype unireg_check_arg,
+ const char *field_name_arg);
virtual ~Field() {}
/* Store functions returns 1 on overflow and -1 on fatal error */
- virtual int store(const char *to,uint length,CHARSET_INFO *cs)=0;
+ virtual int store(const char *to, uint length,CHARSET_INFO *cs)=0;
virtual int store(double nr)=0;
virtual int store(longlong nr, bool unsigned_val)=0;
virtual int store_decimal(const my_decimal *d)=0;
virtual int store_time(MYSQL_TIME *ltime, timestamp_type t_type);
+ int store(const char *to, uint length, CHARSET_INFO *cs,
+ enum_check_fields check_level);
virtual double val_real(void)=0;
virtual longlong val_int(void)=0;
virtual my_decimal *val_decimal(my_decimal *);
@@ -148,6 +151,24 @@ public:
table, which is located on disk).
*/
virtual uint32 pack_length_in_rec() const { return pack_length(); }
+ virtual int compatible_field_size(uint field_metadata);
+ virtual uint pack_length_from_metadata(uint field_metadata)
+ { return field_metadata; }
+ /*
+ This method is used to return the size of the data in a row-based
+ replication row record. The default implementation of returning 0 is
+ designed to allow fields that do not use metadata to return TRUE (1)
+ from compatible_field_size() which uses this function in the comparison.
+ The default value for field metadata for fields that do not have
+ metadata is 0. Thus, 0 == 0 means the fields are compatible in size.
+
+ Note: While most classes that override this method return pack_length(),
+ the classes Field_string, Field_varstring, and Field_blob return
+ field_length + 1, field_length, and pack_length_no_ptr() respectfully.
+ */
+ virtual uint row_pack_length() { return 0; }
+ virtual int save_field_metadata(uchar *first_byte)
+ { return do_save_field_metadata(first_byte); }
/*
data_length() return the "real size" of the data in memory.
@@ -171,20 +192,20 @@ public:
virtual uint32 key_length() const { return pack_length(); }
virtual enum_field_types type() const =0;
virtual enum_field_types real_type() const { return type(); }
- inline int cmp(const char *str) { return cmp(ptr,str); }
- virtual int cmp_max(const char *a, const char *b, uint max_len)
+ inline int cmp(const uchar *str) { return cmp(ptr,str); }
+ virtual int cmp_max(const uchar *a, const uchar *b, uint max_len)
{ return cmp(a, b); }
- virtual int cmp(const char *,const char *)=0;
- virtual int cmp_binary(const char *a,const char *b, uint32 max_length=~0L)
+ virtual int cmp(const uchar *,const uchar *)=0;
+ virtual int cmp_binary(const uchar *a,const uchar *b, uint32 max_length=~0L)
{ return memcmp(a,b,pack_length()); }
virtual int cmp_offset(uint row_offset)
{ return cmp(ptr,ptr+row_offset); }
virtual int cmp_binary_offset(uint row_offset)
{ return cmp_binary(ptr, ptr+row_offset); };
- virtual int key_cmp(const byte *a,const byte *b)
- { return cmp((char*) a,(char*) b); }
- virtual int key_cmp(const byte *str, uint length)
- { return cmp(ptr,(char*) str); }
+ virtual int key_cmp(const uchar *a,const uchar *b)
+ { return cmp(a, b); }
+ virtual int key_cmp(const uchar *str, uint length)
+ { return cmp(ptr,str); }
virtual uint decimals() const { return 0; }
/*
Caller beware: sql_type can change str.Ptr, so check
@@ -201,7 +222,7 @@ public:
{
if (!null_ptr)
return 0;
- return test(record[(uint) (null_ptr - (uchar*) table->record[0])] &
+ return test(record[(uint) (null_ptr -table->record[0])] &
null_bit);
}
inline bool is_null_in_record_with_offset(my_ptrdiff_t offset)
@@ -236,15 +257,15 @@ public:
the record. If the field does not use any bits of the null
bytes, the value 0 (LAST_NULL_BYTE_UNDEF) is returned.
*/
- my_size_t last_null_byte() const {
- my_size_t bytes= do_last_null_byte();
+ size_t last_null_byte() const {
+ size_t bytes= do_last_null_byte();
DBUG_PRINT("debug", ("last_null_byte() ==> %ld", (long) bytes));
DBUG_ASSERT(bytes <= table->s->null_bytes);
return bytes;
}
virtual void make_field(Send_field *);
- virtual void sort_string(char *buff,uint length)=0;
+ virtual void sort_string(uchar *buff,uint length)=0;
virtual bool optimize_range(uint idx, uint part);
/*
This should be true for fields which, when compared with constant
@@ -258,23 +279,23 @@ public:
virtual Field *new_field(MEM_ROOT *root, struct st_table *new_table,
bool keep_type);
virtual Field *new_key_field(MEM_ROOT *root, struct st_table *new_table,
- char *new_ptr, uchar *new_null_ptr,
+ uchar *new_ptr, uchar *new_null_ptr,
uint new_null_bit);
Field *clone(MEM_ROOT *mem_root, struct st_table *new_table);
- inline void move_field(char *ptr_arg,uchar *null_ptr_arg,uchar null_bit_arg)
+ 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;
}
- inline void move_field(char *ptr_arg) { ptr=ptr_arg; }
+ inline void move_field(uchar *ptr_arg) { ptr=ptr_arg; }
virtual void move_field_offset(my_ptrdiff_t ptr_diff)
{
- ptr=ADD_TO_PTR(ptr,ptr_diff,char*);
+ ptr=ADD_TO_PTR(ptr,ptr_diff, uchar*);
if (null_ptr)
null_ptr=ADD_TO_PTR(null_ptr,ptr_diff,uchar*);
}
- inline void get_image(char *buff,uint length, CHARSET_INFO *cs)
+ virtual void get_image(uchar *buff, uint length, CHARSET_INFO *cs)
{ memcpy(buff,ptr,length); }
- inline void set_image(char *buff,uint length, CHARSET_INFO *cs)
+ virtual void set_image(const uchar *buff,uint length, CHARSET_INFO *cs)
{ memcpy(ptr,buff,length); }
@@ -304,12 +325,12 @@ public:
Number of copied bytes (excluding padded zero bytes -- see above).
*/
- virtual uint get_key_image(char *buff, uint length, imagetype type)
+ virtual uint get_key_image(uchar *buff, uint length, imagetype type)
{
get_image(buff, length, &my_charset_bin);
return length;
}
- virtual void set_key_image(char *buff,uint length)
+ virtual void set_key_image(const uchar *buff,uint length)
{ set_image(buff,length, &my_charset_bin); }
inline longlong val_int_offset(uint row_offset)
{
@@ -318,63 +339,65 @@ public:
ptr-=row_offset;
return tmp;
}
- inline longlong val_int(char *new_ptr)
+ inline longlong val_int(const uchar *new_ptr)
{
- char *old_ptr= ptr;
+ uchar *old_ptr= ptr;
longlong return_value;
- ptr= new_ptr;
+ ptr= (uchar*) new_ptr;
return_value= val_int();
ptr= old_ptr;
return return_value;
}
- inline String *val_str(String *str, char *new_ptr)
+ inline String *val_str(String *str, const uchar *new_ptr)
{
- char *old_ptr= ptr;
- ptr= new_ptr;
+ uchar *old_ptr= ptr;
+ ptr= (uchar*) new_ptr;
val_str(str);
ptr= old_ptr;
return str;
}
virtual bool send_binary(Protocol *protocol);
- virtual char *pack(char* to, const char *from, uint max_length=~(uint) 0)
+ virtual uchar *pack(uchar *to, const uchar *from, uint max_length=~(uint) 0)
{
uint32 length=pack_length();
memcpy(to,from,length);
return to+length;
}
- virtual const char *unpack(char* to, const char *from)
+ virtual const uchar *unpack(uchar* to, const uchar *from, uint param_data);
+ virtual const uchar *unpack(uchar* to, const uchar *from)
{
uint length=pack_length();
memcpy(to,from,length);
return from+length;
}
- virtual char *pack_key(char* to, const char *from, uint max_length)
+ virtual uchar *pack_key(uchar* to, const uchar *from, uint max_length)
{
return pack(to,from,max_length);
}
- virtual char *pack_key_from_key_image(char* to, const char *from,
+ virtual uchar *pack_key_from_key_image(uchar* to, const uchar *from,
uint max_length)
{
return pack(to,from,max_length);
}
- virtual const char *unpack_key(char* to, const char *from, uint max_length)
+ virtual const uchar *unpack_key(uchar* to, const uchar *from,
+ uint max_length)
{
return unpack(to,from);
}
- virtual uint packed_col_length(const char *to, uint length)
+ virtual uint packed_col_length(const uchar *to, uint length)
{ return length;}
virtual uint max_packed_col_length(uint max_length)
{ return max_length;}
- virtual int pack_cmp(const char *a,const char *b, uint key_length_arg,
+ virtual int pack_cmp(const uchar *a,const uchar *b, uint key_length_arg,
my_bool insert_or_update)
{ return cmp(a,b); }
- virtual int pack_cmp(const char *b, uint key_length_arg,
+ virtual int pack_cmp(const uchar *b, uint key_length_arg,
my_bool insert_or_update)
{ return cmp(ptr,b); }
- uint offset(byte *record)
+ uint offset(uchar *record)
{
- return (uint) (ptr - (char*) record);
+ return (uint) (ptr - record);
}
void copy_from_tmp(int offset);
uint fill_cache_field(struct st_cache_field *copy);
@@ -411,7 +434,7 @@ public:
/* maximum possible display length */
virtual uint32 max_display_length()= 0;
- virtual uint is_equal(create_field *new_field);
+ virtual uint is_equal(Create_field *new_field);
/* convert decimal to longlong with overflow check */
longlong convert_decimal2longlong(const my_decimal *val, bool unsigned_flag,
int *err);
@@ -421,10 +444,16 @@ public:
return field_length / charset()->mbmaxlen;
}
+ virtual geometry_type get_geometry_type()
+ {
+ /* shouldn't get here. */
+ DBUG_ASSERT(0);
+ return GEOM_GEOMETRY;
+ }
/* Hash value */
virtual void hash(ulong *nr, ulong *nr2);
friend bool reopen_table(THD *,struct st_table *,bool);
- friend int cre_myisam(my_string name, register TABLE *form, uint options,
+ friend int cre_myisam(char * name, register TABLE *form, uint options,
ulonglong auto_increment_value);
friend class Copy_field;
friend class Item_avg_field;
@@ -451,7 +480,20 @@ private:
function. This represents the inheritance interface and can be
overridden by subclasses.
*/
- virtual my_size_t do_last_null_byte() const;
+ virtual size_t do_last_null_byte() const;
+
+/**
+ Retrieve the field metadata for fields.
+
+ This default implementation returns 0 and saves 0 in the metadata_ptr
+ value.
+
+ @param metadata_ptr First byte of field metadata
+
+ @returns 0 no bytes written.
+*/
+ virtual int do_save_field_metadata(uchar *metadata_ptr)
+ { return 0; }
};
@@ -459,21 +501,21 @@ class Field_num :public Field {
public:
const uint8 dec;
bool zerofill,unsigned_flag; // Purify cannot handle bit fields
- Field_num(char *ptr_arg,uint32 len_arg, uchar *null_ptr_arg,
+ Field_num(uchar *ptr_arg,uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg, utype unireg_check_arg,
const char *field_name_arg,
uint8 dec_arg, bool zero_arg, bool unsigned_arg);
Item_result result_type () const { return REAL_RESULT; }
void prepend_zeros(String *value);
void add_zerofill_and_unsigned(String &res) const;
- friend class create_field;
+ friend class Create_field;
void make_field(Send_field *);
uint decimals() const { return (uint) dec; }
uint size_of() const { return sizeof(*this); }
bool eq_def(Field *field);
int store_decimal(const my_decimal *);
my_decimal *val_decimal(my_decimal *);
- uint is_equal(create_field *new_field);
+ uint is_equal(Create_field *new_field);
int check_int(CHARSET_INFO *cs, const char *str, int length,
const char *int_end, int error);
bool get_int(CHARSET_INFO *cs, const char *from, uint len,
@@ -487,7 +529,7 @@ protected:
CHARSET_INFO *field_charset;
enum Derivation field_derivation;
public:
- Field_str(char *ptr_arg,uint32 len_arg, uchar *null_ptr_arg,
+ Field_str(uchar *ptr_arg,uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg, utype unireg_check_arg,
const char *field_name_arg, CHARSET_INFO *charset);
Item_result result_type () const { return STRING_RESULT; }
@@ -504,11 +546,11 @@ public:
{ field_derivation= derivation_arg; }
bool binary() const { return field_charset == &my_charset_bin; }
uint32 max_display_length() { return field_length; }
- friend class create_field;
+ friend class Create_field;
my_decimal *val_decimal(my_decimal *);
virtual bool str_needs_quotes() { return TRUE; }
- bool compare_str_field_flags(create_field *new_field, uint32 flags);
- uint is_equal(create_field *new_field);
+ bool compare_str_field_flags(Create_field *new_field, uint32 flags);
+ uint is_equal(Create_field *new_field);
};
@@ -517,7 +559,7 @@ public:
class Field_longstr :public Field_str
{
public:
- Field_longstr(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
+ Field_longstr(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg, utype unireg_check_arg,
const char *field_name_arg, CHARSET_INFO *charset_arg)
:Field_str(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, unireg_check_arg,
@@ -530,22 +572,27 @@ public:
/* base class for float and double and decimal (old one) */
class Field_real :public Field_num {
public:
- Field_real(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
+ my_bool not_fixed;
+
+ Field_real(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg, utype unireg_check_arg,
const char *field_name_arg,
uint8 dec_arg, bool zero_arg, bool unsigned_arg)
:Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, unireg_check_arg,
- field_name_arg, dec_arg, zero_arg, unsigned_arg)
+ field_name_arg, dec_arg, zero_arg, unsigned_arg),
+ not_fixed(dec_arg >= NOT_FIXED_DEC)
{}
int store_decimal(const my_decimal *);
my_decimal *val_decimal(my_decimal *);
+ int truncate(double *nr, double max_length);
uint32 max_display_length() { return field_length; }
+ uint size_of() const { return sizeof(*this); }
};
class Field_decimal :public Field_real {
public:
- Field_decimal(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
+ Field_decimal(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
uint8 dec_arg,bool zero_arg,bool unsigned_arg)
@@ -563,8 +610,8 @@ public:
double val_real(void);
longlong val_int(void);
String *val_str(String*,String *);
- int cmp(const char *,const char*);
- void sort_string(char *buff,uint length);
+ int cmp(const uchar *,const uchar *);
+ void sort_string(uchar *buff,uint length);
void overflow(bool negative);
bool zero_pack() const { return 0; }
void sql_type(String &str) const;
@@ -573,6 +620,8 @@ public:
/* New decimal/numeric field which use fixed point arithmetic */
class Field_new_decimal :public Field_num {
+private:
+ int do_save_field_metadata(uchar *first_byte);
public:
/* The maximum number of decimal digits can be stored */
uint precision;
@@ -583,7 +632,7 @@ public:
So for example we need to count length from precision handling
CREATE TABLE ( DECIMAL(x,y))
*/
- Field_new_decimal(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
+ Field_new_decimal(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
uint8 dec_arg, bool zero_arg, bool unsigned_arg);
@@ -605,20 +654,24 @@ public:
longlong val_int(void);
my_decimal *val_decimal(my_decimal *);
String *val_str(String*, String *);
- int cmp(const char *, const char*);
- void sort_string(char *buff, uint length);
+ int cmp(const uchar *, const uchar *);
+ void sort_string(uchar *buff, uint length);
bool zero_pack() const { return 0; }
void sql_type(String &str) const;
uint32 max_display_length() { return field_length; }
uint size_of() const { return sizeof(*this); }
uint32 pack_length() const { return (uint32) bin_size; }
- uint is_equal(create_field *new_field);
+ uint pack_length_from_metadata(uint field_metadata);
+ uint row_pack_length() { return pack_length(); }
+ int compatible_field_size(uint field_metadata);
+ uint is_equal(Create_field *new_field);
+ virtual const uchar *unpack(uchar* to, const uchar *from, uint param_data);
};
class Field_tiny :public Field_num {
public:
- Field_tiny(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
+ Field_tiny(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
bool zero_arg, bool unsigned_arg)
@@ -638,8 +691,8 @@ public:
longlong val_int(void);
String *val_str(String*,String *);
bool send_binary(Protocol *protocol);
- int cmp(const char *,const char*);
- void sort_string(char *buff,uint length);
+ int cmp(const uchar *,const uchar *);
+ void sort_string(uchar *buff,uint length);
uint32 pack_length() const { return 1; }
void sql_type(String &str) const;
uint32 max_display_length() { return 4; }
@@ -648,7 +701,7 @@ public:
class Field_short :public Field_num {
public:
- Field_short(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
+ Field_short(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
bool zero_arg, bool unsigned_arg)
@@ -658,7 +711,7 @@ public:
{}
Field_short(uint32 len_arg,bool maybe_null_arg, const char *field_name_arg,
bool unsigned_arg)
- :Field_num((char*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0,0,
+ :Field_num((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0,0,
NONE, field_name_arg, 0, 0, unsigned_arg)
{}
enum Item_result result_type () const { return INT_RESULT; }
@@ -673,8 +726,8 @@ public:
longlong val_int(void);
String *val_str(String*,String *);
bool send_binary(Protocol *protocol);
- int cmp(const char *,const char*);
- void sort_string(char *buff,uint length);
+ int cmp(const uchar *,const uchar *);
+ void sort_string(uchar *buff,uint length);
uint32 pack_length() const { return 2; }
void sql_type(String &str) const;
uint32 max_display_length() { return 6; }
@@ -683,7 +736,7 @@ public:
class Field_medium :public Field_num {
public:
- Field_medium(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
+ Field_medium(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
bool zero_arg, bool unsigned_arg)
@@ -703,8 +756,8 @@ public:
longlong val_int(void);
String *val_str(String*,String *);
bool send_binary(Protocol *protocol);
- int cmp(const char *,const char*);
- void sort_string(char *buff,uint length);
+ int cmp(const uchar *,const uchar *);
+ void sort_string(uchar *buff,uint length);
uint32 pack_length() const { return 3; }
void sql_type(String &str) const;
uint32 max_display_length() { return 8; }
@@ -713,7 +766,7 @@ public:
class Field_long :public Field_num {
public:
- Field_long(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
+ Field_long(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
bool zero_arg, bool unsigned_arg)
@@ -723,7 +776,7 @@ public:
{}
Field_long(uint32 len_arg,bool maybe_null_arg, const char *field_name_arg,
bool unsigned_arg)
- :Field_num((char*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0,0,
+ :Field_num((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0,0,
NONE, field_name_arg,0,0,unsigned_arg)
{}
enum Item_result result_type () const { return INT_RESULT; }
@@ -738,18 +791,18 @@ public:
longlong val_int(void);
bool send_binary(Protocol *protocol);
String *val_str(String*,String *);
- int cmp(const char *,const char*);
- void sort_string(char *buff,uint length);
+ int cmp(const uchar *,const uchar *);
+ void sort_string(uchar *buff,uint length);
uint32 pack_length() const { return 4; }
void sql_type(String &str) const;
- uint32 max_display_length() { return 11; }
+ uint32 max_display_length() { return MY_INT32_NUM_DECIMAL_DIGITS; }
};
#ifdef HAVE_LONG_LONG
class Field_longlong :public Field_num {
public:
- Field_longlong(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
+ Field_longlong(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
bool zero_arg, bool unsigned_arg)
@@ -760,7 +813,7 @@ public:
Field_longlong(uint32 len_arg,bool maybe_null_arg,
const char *field_name_arg,
bool unsigned_arg)
- :Field_num((char*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0,0,
+ :Field_num((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0,0,
NONE, field_name_arg,0,0,unsigned_arg)
{}
enum Item_result result_type () const { return INT_RESULT; }
@@ -779,8 +832,8 @@ public:
longlong val_int(void);
String *val_str(String*,String *);
bool send_binary(Protocol *protocol);
- int cmp(const char *,const char*);
- void sort_string(char *buff,uint length);
+ int cmp(const uchar *,const uchar *);
+ void sort_string(uchar *buff,uint length);
uint32 pack_length() const { return 8; }
void sql_type(String &str) const;
bool can_be_compared_as_longlong() const { return TRUE; }
@@ -791,7 +844,7 @@ public:
class Field_float :public Field_real {
public:
- Field_float(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
+ Field_float(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
uint8 dec_arg,bool zero_arg,bool unsigned_arg)
@@ -801,7 +854,7 @@ public:
{}
Field_float(uint32 len_arg, bool maybe_null_arg, const char *field_name_arg,
uint8 dec_arg)
- :Field_real((char*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0, (uint) 0,
+ :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0, (uint) 0,
NONE, field_name_arg, dec_arg, 0, 0)
{}
enum_field_types type() const { return MYSQL_TYPE_FLOAT;}
@@ -814,37 +867,36 @@ public:
longlong val_int(void);
String *val_str(String*,String *);
bool send_binary(Protocol *protocol);
- int cmp(const char *,const char*);
- void sort_string(char *buff,uint length);
+ int cmp(const uchar *,const uchar *);
+ void sort_string(uchar *buff,uint length);
uint32 pack_length() const { return sizeof(float); }
+ uint row_pack_length() { return pack_length(); }
void sql_type(String &str) const;
+private:
+ int do_save_field_metadata(uchar *first_byte);
};
class Field_double :public Field_real {
public:
- my_bool not_fixed;
- Field_double(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
+ Field_double(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
uint8 dec_arg,bool zero_arg,bool unsigned_arg)
:Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg,
- dec_arg, zero_arg, unsigned_arg),
- not_fixed(dec_arg >= NOT_FIXED_DEC)
+ dec_arg, zero_arg, unsigned_arg)
{}
Field_double(uint32 len_arg, bool maybe_null_arg, const char *field_name_arg,
uint8 dec_arg)
- :Field_real((char*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0,
- NONE, field_name_arg, dec_arg, 0, 0),
- not_fixed(dec_arg >= NOT_FIXED_DEC)
+ :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0,
+ NONE, field_name_arg, dec_arg, 0, 0)
{}
Field_double(uint32 len_arg, bool maybe_null_arg, const char *field_name_arg,
- uint8 dec_arg, my_bool not_fixed_srg)
- :Field_real((char*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0,
- NONE, field_name_arg, dec_arg, 0, 0),
- not_fixed(not_fixed_srg)
- {}
+ uint8 dec_arg, my_bool not_fixed_arg)
+ :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0,
+ NONE, field_name_arg, dec_arg, 0, 0)
+ {not_fixed= not_fixed_arg; }
enum_field_types type() const { return MYSQL_TYPE_DOUBLE;}
enum ha_base_keytype key_type() const { return HA_KEYTYPE_DOUBLE; }
int store(const char *to,uint length,CHARSET_INFO *charset);
@@ -855,11 +907,13 @@ public:
longlong val_int(void);
String *val_str(String*,String *);
bool send_binary(Protocol *protocol);
- int cmp(const char *,const char*);
- void sort_string(char *buff,uint length);
+ int cmp(const uchar *,const uchar *);
+ void sort_string(uchar *buff,uint length);
uint32 pack_length() const { return sizeof(double); }
+ uint row_pack_length() { return pack_length(); }
void sql_type(String &str) const;
- uint size_of() const { return sizeof(*this); }
+private:
+ int do_save_field_metadata(uchar *first_byte);
};
@@ -868,7 +922,7 @@ public:
class Field_null :public Field_str {
static uchar null[1];
public:
- Field_null(char *ptr_arg, uint32 len_arg,
+ Field_null(uchar *ptr_arg, uint32 len_arg,
enum utype unireg_check_arg, const char *field_name_arg,
CHARSET_INFO *cs)
:Field_str(ptr_arg, len_arg, null, 1,
@@ -886,8 +940,8 @@ public:
my_decimal *val_decimal(my_decimal *) { return 0; }
String *val_str(String *value,String *value2)
{ value2->length(0); return value2;}
- int cmp(const char *a, const char *b) { return 0;}
- void sort_string(char *buff, uint length) {}
+ int cmp(const uchar *a, const uchar *b) { return 0;}
+ void sort_string(uchar *buff, uint length) {}
uint32 pack_length() const { return 0; }
void sql_type(String &str) const;
uint size_of() const { return sizeof(*this); }
@@ -897,7 +951,7 @@ public:
class Field_timestamp :public Field_str {
public:
- Field_timestamp(char *ptr_arg, uint32 len_arg,
+ Field_timestamp(uchar *ptr_arg, uint32 len_arg,
uchar *null_ptr_arg, uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
TABLE_SHARE *share, CHARSET_INFO *cs);
@@ -914,8 +968,8 @@ public:
longlong val_int(void);
String *val_str(String*,String *);
bool send_binary(Protocol *protocol);
- int cmp(const char *,const char*);
- void sort_string(char *buff,uint length);
+ int cmp(const uchar *,const uchar *);
+ void sort_string(uchar *buff,uint length);
uint32 pack_length() const { return 4; }
void sql_type(String &str) const;
bool can_be_compared_as_longlong() const { return TRUE; }
@@ -942,6 +996,17 @@ public:
longget(tmp,ptr);
return tmp;
}
+ inline void store_timestamp(my_time_t timestamp)
+ {
+#ifdef WORDS_BIGENDIAN
+ if (table && table->s->db_low_byte_first)
+ {
+ int4store(ptr,timestamp);
+ }
+ else
+#endif
+ longstore(ptr,(uint32) timestamp);
+ }
bool get_date(MYSQL_TIME *ltime,uint fuzzydate);
bool get_time(MYSQL_TIME *ltime);
timestamp_auto_set_type get_auto_set_type() const;
@@ -950,7 +1015,7 @@ public:
class Field_year :public Field_tiny {
public:
- Field_year(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
+ Field_year(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg)
:Field_tiny(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
@@ -971,7 +1036,7 @@ public:
class Field_date :public Field_str {
public:
- Field_date(char *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
+ Field_date(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
CHARSET_INFO *cs)
:Field_str(ptr_arg, 10, null_ptr_arg, null_bit_arg,
@@ -979,7 +1044,7 @@ public:
{}
Field_date(bool maybe_null_arg, const char *field_name_arg,
CHARSET_INFO *cs)
- :Field_str((char*) 0,10, maybe_null_arg ? (uchar*) "": 0,0,
+ :Field_str((uchar*) 0,10, maybe_null_arg ? (uchar*) "": 0,0,
NONE, field_name_arg, cs) {}
enum_field_types type() const { return MYSQL_TYPE_DATE;}
enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONG_INT; }
@@ -992,8 +1057,8 @@ public:
longlong val_int(void);
String *val_str(String*,String *);
bool send_binary(Protocol *protocol);
- int cmp(const char *,const char*);
- void sort_string(char *buff,uint length);
+ int cmp(const uchar *,const uchar *);
+ void sort_string(uchar *buff,uint length);
uint32 pack_length() const { return 4; }
void sql_type(String &str) const;
bool can_be_compared_as_longlong() const { return TRUE; }
@@ -1003,7 +1068,7 @@ public:
class Field_newdate :public Field_str {
public:
- Field_newdate(char *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
+ Field_newdate(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
CHARSET_INFO *cs)
:Field_str(ptr_arg, 10, null_ptr_arg, null_bit_arg,
@@ -1022,8 +1087,8 @@ public:
longlong val_int(void);
String *val_str(String*,String *);
bool send_binary(Protocol *protocol);
- int cmp(const char *,const char*);
- void sort_string(char *buff,uint length);
+ int cmp(const uchar *,const uchar *);
+ void sort_string(uchar *buff,uint length);
uint32 pack_length() const { return 3; }
void sql_type(String &str) const;
bool can_be_compared_as_longlong() const { return TRUE; }
@@ -1035,7 +1100,7 @@ public:
class Field_time :public Field_str {
public:
- Field_time(char *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
+ Field_time(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
CHARSET_INFO *cs)
:Field_str(ptr_arg, 8, null_ptr_arg, null_bit_arg,
@@ -1043,7 +1108,7 @@ public:
{}
Field_time(bool maybe_null_arg, const char *field_name_arg,
CHARSET_INFO *cs)
- :Field_str((char*) 0,8, maybe_null_arg ? (uchar*) "": 0,0,
+ :Field_str((uchar*) 0,8, maybe_null_arg ? (uchar*) "": 0,0,
NONE, field_name_arg, cs) {}
enum_field_types type() const { return MYSQL_TYPE_TIME;}
enum ha_base_keytype key_type() const { return HA_KEYTYPE_INT24; }
@@ -1059,8 +1124,8 @@ public:
bool get_date(MYSQL_TIME *ltime, uint fuzzydate);
bool send_binary(Protocol *protocol);
bool get_time(MYSQL_TIME *ltime);
- int cmp(const char *,const char*);
- void sort_string(char *buff,uint length);
+ int cmp(const uchar *,const uchar *);
+ void sort_string(uchar *buff,uint length);
uint32 pack_length() const { return 3; }
void sql_type(String &str) const;
bool can_be_compared_as_longlong() const { return TRUE; }
@@ -1070,7 +1135,7 @@ public:
class Field_datetime :public Field_str {
public:
- Field_datetime(char *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
+ Field_datetime(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
CHARSET_INFO *cs)
:Field_str(ptr_arg, 19, null_ptr_arg, null_bit_arg,
@@ -1078,7 +1143,7 @@ public:
{}
Field_datetime(bool maybe_null_arg, const char *field_name_arg,
CHARSET_INFO *cs)
- :Field_str((char*) 0,19, maybe_null_arg ? (uchar*) "": 0,0,
+ :Field_str((uchar*) 0,19, maybe_null_arg ? (uchar*) "": 0,0,
NONE, field_name_arg, cs) {}
enum_field_types type() const { return MYSQL_TYPE_DATETIME;}
#ifdef HAVE_LONG_LONG
@@ -1099,8 +1164,8 @@ public:
longlong val_int(void);
String *val_str(String*,String *);
bool send_binary(Protocol *protocol);
- int cmp(const char *,const char*);
- void sort_string(char *buff,uint length);
+ int cmp(const uchar *,const uchar *);
+ void sort_string(uchar *buff,uint length);
uint32 pack_length() const { return 8; }
void sql_type(String &str) const;
bool can_be_compared_as_longlong() const { return TRUE; }
@@ -1113,7 +1178,7 @@ public:
class Field_string :public Field_longstr {
public:
bool can_alter_field_type;
- Field_string(char *ptr_arg, uint32 len_arg,uchar *null_ptr_arg,
+ Field_string(uchar *ptr_arg, uint32 len_arg,uchar *null_ptr_arg,
uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
CHARSET_INFO *cs)
@@ -1122,7 +1187,7 @@ public:
can_alter_field_type(1) {};
Field_string(uint32 len_arg,bool maybe_null_arg, const char *field_name_arg,
CHARSET_INFO *cs)
- :Field_longstr((char*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0, 0,
+ :Field_longstr((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0, 0,
NONE, field_name_arg, cs),
can_alter_field_type(1) {};
@@ -1139,7 +1204,7 @@ public:
bool zero_pack() const { return 0; }
int reset(void)
{
- charset()->cset->fill(charset(),ptr,field_length,
+ charset()->cset->fill(charset(),(char*) ptr, field_length,
(has_charset() ? ' ' : 0));
return 0;
}
@@ -1150,30 +1215,41 @@ public:
longlong val_int(void);
String *val_str(String*,String *);
my_decimal *val_decimal(my_decimal *);
- int cmp(const char *,const char*);
- void sort_string(char *buff,uint length);
+ int cmp(const uchar *,const uchar *);
+ void sort_string(uchar *buff,uint length);
void sql_type(String &str) const;
- char *pack(char *to, const char *from, uint max_length=~(uint) 0);
- const char *unpack(char* to, const char *from);
- int pack_cmp(const char *a,const char *b,uint key_length,
+ uchar *pack(uchar *to, const uchar *from, uint max_length=~(uint) 0);
+ virtual const uchar *unpack(uchar* to, const uchar *from, uint param_data);
+ const uchar *unpack(uchar* to, const uchar *from);
+ uint pack_length_from_metadata(uint field_metadata)
+ { return (field_metadata & 0x00ff); }
+ uint row_pack_length() { return (field_length + 1); }
+ int pack_cmp(const uchar *a,const uchar *b,uint key_length,
my_bool insert_or_update);
- int pack_cmp(const char *b,uint key_length,my_bool insert_or_update);
- uint packed_col_length(const char *to, uint length);
+ int pack_cmp(const uchar *b,uint key_length,my_bool insert_or_update);
+ uint packed_col_length(const uchar *to, uint length);
uint max_packed_col_length(uint max_length);
uint size_of() const { return sizeof(*this); }
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);
- virtual uint get_key_image(char *buff,uint length, imagetype type);
+ virtual uint get_key_image(uchar *buff,uint length, imagetype type);
+private:
+ int do_save_field_metadata(uchar *first_byte);
};
class Field_varstring :public Field_longstr {
public:
+ /*
+ The maximum space available in a Field_varstring, in bytes. See
+ length_bytes.
+ */
+ static const uint MAX_SIZE;
/* Store number of bytes used to store length (1 or 2) */
uint32 length_bytes;
- Field_varstring(char *ptr_arg,
+ Field_varstring(uchar *ptr_arg,
uint32 len_arg, uint length_bytes_arg,
uchar *null_ptr_arg, uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
@@ -1187,7 +1263,7 @@ public:
Field_varstring(uint32 len_arg,bool maybe_null_arg,
const char *field_name_arg,
TABLE_SHARE *share, CHARSET_INFO *cs)
- :Field_longstr((char*) 0,len_arg, maybe_null_arg ? (uchar*) "": 0, 0,
+ :Field_longstr((uchar*) 0,len_arg, maybe_null_arg ? (uchar*) "": 0, 0,
NONE, field_name_arg, cs),
length_bytes(len_arg < 256 ? 1 :2)
{
@@ -1196,6 +1272,7 @@ public:
enum_field_types type() const { return MYSQL_TYPE_VARCHAR; }
enum ha_base_keytype key_type() const;
+ uint row_pack_length() { return field_length; }
bool zero_pack() const { return 0; }
int reset(void) { bzero(ptr,field_length+length_bytes); return 0; }
uint32 pack_length() const { return (uint32) field_length+length_bytes; }
@@ -1212,27 +1289,29 @@ public:
longlong val_int(void);
String *val_str(String*,String *);
my_decimal *val_decimal(my_decimal *);
- int cmp_max(const char *, const char *, uint max_length);
- int cmp(const char *a,const char*b)
+ int cmp_max(const uchar *, const uchar *, uint max_length);
+ int cmp(const uchar *a,const uchar *b)
{
return cmp_max(a, b, ~0L);
}
- void sort_string(char *buff,uint length);
- uint get_key_image(char *buff,uint length, imagetype type);
- void set_key_image(char *buff,uint length);
+ void sort_string(uchar *buff,uint length);
+ uint get_key_image(uchar *buff,uint length, imagetype type);
+ void set_key_image(const uchar *buff,uint length);
void sql_type(String &str) const;
- char *pack(char *to, const char *from, uint max_length=~(uint) 0);
- char *pack_key(char *to, const char *from, uint max_length);
- char *pack_key_from_key_image(char* to, const char *from, uint max_length);
- const char *unpack(char* to, const char *from);
- const char *unpack_key(char* to, const char *from, uint max_length);
- int pack_cmp(const char *a, const char *b, uint key_length,
+ uchar *pack(uchar *to, const uchar *from, uint max_length=~(uint) 0);
+ uchar *pack_key(uchar *to, const uchar *from, uint max_length);
+ uchar *pack_key_from_key_image(uchar* to, const uchar *from,
+ uint max_length);
+ virtual const uchar *unpack(uchar* to, const uchar *from, uint param_data);
+ const uchar *unpack(uchar* to, const uchar *from);
+ const uchar *unpack_key(uchar* to, const uchar *from, uint max_length);
+ int pack_cmp(const uchar *a, const uchar *b, uint key_length,
my_bool insert_or_update);
- int pack_cmp(const char *b, uint key_length,my_bool insert_or_update);
- int cmp_binary(const char *a,const char *b, uint32 max_length=~0L);
- int key_cmp(const byte *,const byte*);
- int key_cmp(const byte *str, uint length);
- uint packed_col_length(const char *to, uint length);
+ int pack_cmp(const uchar *b, uint key_length,my_bool insert_or_update);
+ int cmp_binary(const uchar *a,const uchar *b, uint32 max_length=~0L);
+ int key_cmp(const uchar *,const uchar*);
+ int key_cmp(const uchar *str, uint length);
+ uint packed_col_length(const uchar *to, uint length);
uint max_packed_col_length(uint max_length);
uint32 data_length();
uint size_of() const { return sizeof(*this); }
@@ -1241,10 +1320,12 @@ public:
{ 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,
- char *new_ptr, uchar *new_null_ptr,
+ uchar *new_ptr, uchar *new_null_ptr,
uint new_null_bit);
- uint is_equal(create_field *new_field);
+ uint is_equal(Create_field *new_field);
void hash(ulong *nr, ulong *nr2);
+private:
+ int do_save_field_metadata(uchar *first_byte);
};
@@ -1253,12 +1334,12 @@ protected:
uint packlength;
String value; // For temporaries
public:
- Field_blob(char *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
+ Field_blob(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
TABLE_SHARE *share, uint blob_pack_length, CHARSET_INFO *cs);
Field_blob(uint32 len_arg,bool maybe_null_arg, const char *field_name_arg,
CHARSET_INFO *cs)
- :Field_longstr((char*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0, 0,
+ :Field_longstr((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0, 0,
NONE, field_name_arg, cs),
packlength(4)
{
@@ -1266,7 +1347,7 @@ public:
}
Field_blob(uint32 len_arg,bool maybe_null_arg, const char *field_name_arg,
CHARSET_INFO *cs, bool set_packlength)
- :Field_longstr((char*) 0,len_arg, maybe_null_arg ? (uchar*) "": 0, 0,
+ :Field_longstr((uchar*) 0,len_arg, maybe_null_arg ? (uchar*) "": 0, 0,
NONE, field_name_arg, cs)
{
flags|= BLOB_FLAG;
@@ -1279,6 +1360,9 @@ public:
l_char_length <= 16777215 ? 3 : 4;
}
}
+ Field_blob(uint32 packlength_arg)
+ :Field_longstr((uchar*) 0, 0, (uchar*) "", 0, NONE, "temp", system_charset_info),
+ packlength(packlength_arg) {}
enum_field_types type() const { return MYSQL_TYPE_BLOB;}
enum ha_base_keytype key_type() const
{ return binary() ? HA_KEYTYPE_VARBINARY2 : HA_KEYTYPE_VARTEXT2; }
@@ -1289,92 +1373,129 @@ public:
longlong val_int(void);
String *val_str(String*,String *);
my_decimal *val_decimal(my_decimal *);
- int cmp_max(const char *, const char *, uint max_length);
- int cmp(const char *a,const char*b)
+ int cmp_max(const uchar *, const uchar *, uint max_length);
+ int cmp(const uchar *a,const uchar *b)
{ return cmp_max(a, b, ~0L); }
- int cmp(const char *a, uint32 a_length, const char *b, uint32 b_length);
- int cmp_binary(const char *a,const char *b, uint32 max_length=~0L);
- int key_cmp(const byte *,const byte*);
- int key_cmp(const byte *str, uint length);
+ int cmp(const uchar *a, uint32 a_length, const uchar *b, uint32 b_length);
+ int cmp_binary(const uchar *a,const uchar *b, uint32 max_length=~0L);
+ int key_cmp(const uchar *,const uchar*);
+ int key_cmp(const uchar *str, uint length);
uint32 key_length() const { return 0; }
- void sort_string(char *buff,uint length);
+ void sort_string(uchar *buff,uint length);
uint32 pack_length() const
{ return (uint32) (packlength+table->s->blob_ptr_size); }
+
+ /**
+ Return the packed length without the pointer size added.
+
+ This is used to determine the size of the actual data in the row
+ buffer.
+
+ @returns The length of the raw data itself without the pointer.
+ */
+ uint32 pack_length_no_ptr() const
+ { return (uint32) (packlength); }
+ uint row_pack_length() { return pack_length_no_ptr(); }
uint32 sort_length() const;
inline uint32 max_data_length() const
{
return (uint32) (((ulonglong) 1 << (packlength*8)) -1);
}
- int reset(void) { bzero(ptr, packlength+sizeof(char*)); return 0; }
- void reset_fields() { bzero((char*) &value,sizeof(value)); }
+ int reset(void) { bzero(ptr, packlength+sizeof(uchar*)); return 0; }
+ void reset_fields() { bzero((uchar*) &value,sizeof(value)); }
#ifndef WORDS_BIGENDIAN
static
#endif
- void store_length(char *i_ptr, uint i_packlength, uint32 i_number);
+ void store_length(uchar *i_ptr, uint i_packlength, uint32 i_number, bool low_byte_first);
+ void store_length(uchar *i_ptr, uint i_packlength, uint32 i_number)
+ {
+ store_length(i_ptr, i_packlength, i_number, table->s->db_low_byte_first);
+ }
inline void store_length(uint32 number)
{
store_length(ptr, packlength, number);
}
- inline uint32 get_length(uint row_offset=0)
- { return get_length(ptr+row_offset); }
- uint32 get_length(const char *ptr);
- void put_length(char *pos, uint32 length);
- inline void get_ptr(char **str)
+ /**
+ Return the packed length plus the length of the data.
+
+ This is used to determine the size of the data plus the
+ packed length portion in the row data.
+
+ @returns The length in the row plus the size of the data.
+ */
+ uint32 get_packed_size(const uchar *ptr_arg, bool low_byte_first)
+ {return packlength + get_length(ptr_arg, low_byte_first);}
+
+ inline uint32 get_length(uint row_offset= 0)
+ { return get_length(ptr+row_offset, table->s->db_low_byte_first); }
+ uint32 get_length(const uchar *ptr, bool low_byte_first);
+ uint32 get_length(const uchar *ptr_arg)
+ { return get_length(ptr_arg, table->s->db_low_byte_first); }
+ void put_length(uchar *pos, uint32 length);
+ inline void get_ptr(uchar **str)
{
- memcpy_fixed(str,ptr+packlength,sizeof(char*));
+ memcpy_fixed((uchar*) str,ptr+packlength,sizeof(uchar*));
}
- inline void get_ptr(char **str, uint row_offset)
+ inline void get_ptr(uchar **str, uint row_offset)
{
- memcpy_fixed(str,ptr+packlength+row_offset,sizeof(char*));
+ memcpy_fixed((uchar*) str,ptr+packlength+row_offset,sizeof(char*));
}
- inline void set_ptr(char *length,char *data)
+ inline void set_ptr(uchar *length, uchar *data)
{
memcpy(ptr,length,packlength);
memcpy_fixed(ptr+packlength,&data,sizeof(char*));
}
- void set_ptr_offset(my_ptrdiff_t ptr_diff, uint32 length,char *data)
+ void set_ptr_offset(my_ptrdiff_t ptr_diff, uint32 length, uchar *data)
{
- char *ptr_ofs= ADD_TO_PTR(ptr,ptr_diff,char*);
+ uchar *ptr_ofs= ADD_TO_PTR(ptr,ptr_diff,uchar*);
store_length(ptr_ofs, packlength, length);
memcpy_fixed(ptr_ofs+packlength,&data,sizeof(char*));
}
- inline void set_ptr(uint32 length,char *data)
+ inline void set_ptr(uint32 length, uchar *data)
{
set_ptr_offset(0, length, data);
}
- uint get_key_image(char *buff,uint length, imagetype type);
- void set_key_image(char *buff,uint length);
+ uint get_key_image(uchar *buff,uint length, imagetype type);
+ void set_key_image(const uchar *buff,uint length);
void sql_type(String &str) const;
inline bool copy()
- { char *tmp;
+ {
+ uchar *tmp;
get_ptr(&tmp);
- if (value.copy(tmp,get_length(),charset()))
+ if (value.copy((char*) tmp, get_length(), charset()))
{
Field_blob::reset();
return 1;
}
- tmp=(char*) value.ptr(); memcpy_fixed(ptr+packlength,&tmp,sizeof(char*));
+ tmp=(uchar*) value.ptr();
+ memcpy_fixed(ptr+packlength,&tmp,sizeof(char*));
return 0;
}
- char *pack(char *to, const char *from, uint max_length= ~(uint) 0);
- char *pack_key(char *to, const char *from, uint max_length);
- char *pack_key_from_key_image(char* to, const char *from, uint max_length);
- const char *unpack(char *to, const char *from);
- const char *unpack_key(char* to, const char *from, uint max_length);
- int pack_cmp(const char *a, const char *b, uint key_length,
+ uchar *pack(uchar *to, const uchar *from, uint max_length= ~(uint) 0);
+ uchar *pack_key(uchar *to, const uchar *from, uint max_length);
+ uchar *pack_key_from_key_image(uchar* to, const uchar *from,
+ uint max_length);
+ virtual const uchar *unpack(uchar *to, const uchar *from, uint param_data);
+ const uchar *unpack(uchar *to, const uchar *from);
+ const uchar *unpack_key(uchar* to, const uchar *from, uint max_length);
+ int pack_cmp(const uchar *a, const uchar *b, uint key_length,
my_bool insert_or_update);
- int pack_cmp(const char *b, uint key_length,my_bool insert_or_update);
- uint packed_col_length(const char *col_ptr, uint length);
+ int pack_cmp(const uchar *b, uint key_length,my_bool insert_or_update);
+ uint packed_col_length(const uchar *col_ptr, uint length);
uint max_packed_col_length(uint max_length);
void free() { value.free(); }
- inline void clear_temporary() { bzero((char*) &value,sizeof(value)); }
+ inline void clear_temporary() { bzero((uchar*) &value,sizeof(value)); }
friend int field_conv(Field *to,Field *from);
uint size_of() const { return sizeof(*this); }
bool has_charset(void) const
{ return charset() == &my_charset_bin ? FALSE : TRUE; }
uint32 max_display_length();
- uint is_equal(create_field *new_field);
+ uint is_equal(Create_field *new_field);
+ inline bool in_read_set() { return bitmap_is_set(table->read_set, field_index); }
+ inline bool in_write_set() { return bitmap_is_set(table->write_set, field_index); }
+private:
+ int do_save_field_metadata(uchar *first_byte);
};
@@ -1383,7 +1504,7 @@ class Field_geom :public Field_blob {
public:
enum geometry_type geom_type;
- Field_geom(char *ptr_arg, uchar *null_ptr_arg, uint null_bit_arg,
+ Field_geom(uchar *ptr_arg, uchar *null_ptr_arg, uint null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
TABLE_SHARE *share, uint blob_pack_length,
enum geometry_type geom_type_arg)
@@ -1401,9 +1522,10 @@ public:
int store(double nr);
int store(longlong nr, bool unsigned_val);
int store_decimal(const my_decimal *);
- uint get_key_image(char *buff,uint length,imagetype type);
+ uint get_key_image(uchar *buff,uint length,imagetype type);
uint size_of() const { return sizeof(*this); }
int reset(void) { return !maybe_null() || Field_blob::reset(); }
+ geometry_type get_geometry_type() { return geom_type; };
};
#endif /*HAVE_SPATIAL*/
@@ -1413,7 +1535,7 @@ protected:
uint packlength;
public:
TYPELIB *typelib;
- Field_enum(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
+ Field_enum(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
uint packlength_arg,
@@ -1436,25 +1558,30 @@ public:
double val_real(void);
longlong val_int(void);
String *val_str(String*,String *);
- int cmp(const char *,const char*);
- void sort_string(char *buff,uint length);
+ int cmp(const uchar *,const uchar *);
+ void sort_string(uchar *buff,uint length);
uint32 pack_length() const { return (uint32) packlength; }
void store_type(ulonglong value);
void sql_type(String &str) const;
uint size_of() const { return sizeof(*this); }
enum_field_types real_type() const { return MYSQL_TYPE_ENUM; }
+ uint pack_length_from_metadata(uint field_metadata)
+ { return (field_metadata & 0x00ff); }
+ uint row_pack_length() { return pack_length(); }
virtual bool zero_pack() const { return 0; }
bool optimize_range(uint idx, uint part) { return 0; }
bool eq_def(Field *field);
bool has_charset(void) const { return TRUE; }
/* enum and set are sorted as integers */
CHARSET_INFO *sort_charset(void) const { return &my_charset_bin; }
+private:
+ int do_save_field_metadata(uchar *first_byte);
};
class Field_set :public Field_enum {
public:
- Field_set(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
+ Field_set(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
uint32 packlength_arg,
@@ -1469,6 +1596,7 @@ public:
int store(const char *to,uint length,CHARSET_INFO *charset);
int store(double nr) { return Field_set::store((longlong) nr, FALSE); }
int store(longlong nr, bool unsigned_val);
+
virtual bool zero_pack() const { return 1; }
String *val_str(String*,String *);
void sql_type(String &str) const;
@@ -1497,7 +1625,7 @@ public:
uchar bit_ofs; // offset to 'uneven' high bits
uint bit_len; // number of 'uneven' high bits
uint bytes_in_rec;
- Field_bit(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
+ Field_bit(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg, uchar *bit_ptr_arg, uchar bit_ofs_arg,
enum utype unireg_check_arg, const char *field_name_arg);
enum_field_types type() const { return MYSQL_TYPE_BIT; }
@@ -1516,29 +1644,41 @@ public:
String *val_str(String*, String *);
virtual bool str_needs_quotes() { return TRUE; }
my_decimal *val_decimal(my_decimal *);
- int cmp(const char *a, const char *b)
- { return cmp_binary(a, b); }
+ int cmp(const uchar *a, const uchar *b)
+ {
+ DBUG_ASSERT(ptr == a);
+ return Field_bit::key_cmp(b, bytes_in_rec+test(bit_len));
+ }
int cmp_binary_offset(uint row_offset)
{ return cmp_offset(row_offset); }
- int cmp_max(const char *a, const char *b, uint max_length);
- int key_cmp(const byte *a, const byte *b)
- { return cmp_binary((char *) a, (char *) b); }
- int key_cmp(const byte *str, uint length);
+ int cmp_max(const uchar *a, const uchar *b, uint max_length);
+ int key_cmp(const uchar *a, const uchar *b)
+ { return cmp_binary((uchar *) a, (uchar *) b); }
+ int key_cmp(const uchar *str, uint length);
int cmp_offset(uint row_offset);
- uint get_key_image(char *buff, uint length, imagetype type);
- void set_key_image(char *buff, uint length)
- { Field_bit::store(buff, length, &my_charset_bin); }
- void sort_string(char *buff, uint length)
+ void get_image(uchar *buff, uint length, CHARSET_INFO *cs)
+ { get_key_image(buff, length, itRAW); }
+ void set_image(const uchar *buff,uint length, CHARSET_INFO *cs)
+ { Field_bit::store((char *) buff, length, cs); }
+ uint get_key_image(uchar *buff, uint length, imagetype type);
+ void set_key_image(const uchar *buff, uint length)
+ { Field_bit::store((char*) buff, length, &my_charset_bin); }
+ void sort_string(uchar *buff, uint length)
{ get_key_image(buff, length, itRAW); }
uint32 pack_length() const { return (uint32) (field_length + 7) / 8; }
uint32 pack_length_in_rec() const { return bytes_in_rec; }
+ uint pack_length_from_metadata(uint field_metadata);
+ uint row_pack_length()
+ { return (bytes_in_rec + ((bit_len > 0) ? 1 : 0)); }
+ int compatible_field_size(uint field_metadata);
void sql_type(String &str) const;
- char *pack(char *to, const char *from, uint max_length=~(uint) 0);
- const char *unpack(char* to, const char *from);
+ uchar *pack(uchar *to, const uchar *from, uint max_length=~(uint) 0);
+ virtual const uchar *unpack(uchar *to, const uchar *from, uint param_data);
+ const uchar *unpack(uchar* to, const uchar *from);
virtual void set_default();
Field *new_key_field(MEM_ROOT *root, struct st_table *new_table,
- char *new_ptr, uchar *new_null_ptr,
+ uchar *new_ptr, uchar *new_null_ptr,
uint new_null_bit);
void set_bit_ptr(uchar *bit_ptr_arg, uchar bit_ofs_arg)
{
@@ -1552,6 +1692,7 @@ public:
bit_ptr == ((Field_bit *)field)->bit_ptr &&
bit_ofs == ((Field_bit *)field)->bit_ofs);
}
+ uint is_equal(Create_field *new_field);
void move_field_offset(my_ptrdiff_t ptr_diff)
{
Field::move_field_offset(ptr_diff);
@@ -1559,7 +1700,8 @@ public:
}
private:
- virtual my_size_t do_last_null_byte() const;
+ virtual size_t do_last_null_byte() const;
+ int do_save_field_metadata(uchar *first_byte);
};
@@ -1572,7 +1714,7 @@ private:
*/
class Field_bit_as_char: public Field_bit {
public:
- Field_bit_as_char(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
+ Field_bit_as_char(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg);
enum ha_base_keytype key_type() const { return HA_KEYTYPE_BINARY; }
@@ -1589,7 +1731,7 @@ public:
Create field class for CREATE TABLE
*/
-class create_field :public Sql_alloc
+class Create_field :public Sql_alloc
{
public:
const char *field_name;
@@ -1620,8 +1762,11 @@ public:
uint8 row,col,sc_length,interval_id; // For rea_create_table
uint offset,pack_flag;
- create_field() :after(0) {}
- create_field(Field *field, Field *orig_field);
+ Create_field() :after(0) {}
+ Create_field(Field *field, Field *orig_field);
+ /* Used to make a clone of this object for ALTER/CREATE TABLE */
+ Create_field *clone(MEM_ROOT *mem_root) const
+ { return new (mem_root) Create_field(*this); }
void create_length_to_internal_length(void);
/* Init for a tmp table field. To be extended if need be. */
@@ -1658,9 +1803,14 @@ class Send_field {
*/
class Copy_field :public Sql_alloc {
- void (*get_copy_func(Field *to,Field *from))(Copy_field *);
+ /**
+ Convenience definition of a copy function returned by
+ get_copy_func.
+ */
+ typedef void Copy_func(Copy_field*);
+ Copy_func *get_copy_func(Field *to, Field *from);
public:
- char *from_ptr,*to_ptr;
+ uchar *from_ptr,*to_ptr;
uchar *from_null_ptr,*to_null_ptr;
my_bool *null_row;
uint from_bit,to_bit;
@@ -1671,13 +1821,13 @@ public:
Copy_field() {}
~Copy_field() {}
void set(Field *to,Field *from,bool save); // Field to field
- void set(char *to,Field *from); // Field to string
+ void set(uchar *to,Field *from); // Field to string
void (*do_copy)(Copy_field *);
void (*do_copy2)(Copy_field *); // Used to handle null values
};
-Field *make_field(TABLE_SHARE *share, char *ptr, uint32 field_length,
+Field *make_field(TABLE_SHARE *share, uchar *ptr, uint32 field_length,
uchar *null_pos, uchar null_bit,
uint pack_flag, enum_field_types field_type,
CHARSET_INFO *cs,
diff --git a/sql/field_conv.cc b/sql/field_conv.cc
index 9771cbc12b1..16e27bb6cab 100644
--- a/sql/field_conv.cc
+++ b/sql/field_conv.cc
@@ -307,6 +307,15 @@ static void do_field_string(Copy_field *copy)
}
+static void do_field_enum(Copy_field *copy)
+{
+ if (copy->from_field->val_int() == 0)
+ ((Field_enum *) copy->to_field)->store_type((ulonglong) 0);
+ else
+ do_field_string(copy);
+}
+
+
static void do_field_varbinary_pre50(Copy_field *copy)
{
char buff[MAX_FIELD_WIDTH];
@@ -355,8 +364,8 @@ static void do_cut_string(Copy_field *copy)
/* Check if we loosed any important characters */
if (cs->cset->scan(cs,
- copy->from_ptr + copy->to_length,
- copy->from_ptr + copy->from_length,
+ (char*) copy->from_ptr + copy->to_length,
+ (char*) copy->from_ptr + copy->from_length,
MY_SEQ_SPACES) < copy->from_length - copy->to_length)
{
copy->to_field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
@@ -374,8 +383,10 @@ static void do_cut_string_complex(Copy_field *copy)
{ // Shorter string field
int well_formed_error;
CHARSET_INFO *cs= copy->from_field->charset();
- const char *from_end= copy->from_ptr + copy->from_length;
- uint copy_length= cs->cset->well_formed_len(cs, copy->from_ptr, from_end,
+ const uchar *from_end= copy->from_ptr + copy->from_length;
+ uint copy_length= cs->cset->well_formed_len(cs,
+ (char*) copy->from_ptr,
+ (char*) from_end,
copy->to_length / cs->mbmaxlen,
&well_formed_error);
if (copy->to_length < copy_length)
@@ -384,7 +395,8 @@ static void do_cut_string_complex(Copy_field *copy)
/* Check if we lost any important characters */
if (well_formed_error ||
- cs->cset->scan(cs, copy->from_ptr + copy_length, from_end,
+ cs->cset->scan(cs, (char*) copy->from_ptr + copy_length,
+ (char*) from_end,
MY_SEQ_SPACES) < (copy->from_length - copy_length))
{
copy->to_field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
@@ -392,7 +404,7 @@ static void do_cut_string_complex(Copy_field *copy)
}
if (copy_length < copy->to_length)
- cs->cset->fill(cs, copy->to_ptr + copy_length,
+ cs->cset->fill(cs, (char*) copy->to_ptr + copy_length,
copy->to_length - copy_length, ' ');
}
@@ -403,7 +415,7 @@ static void do_expand_binary(Copy_field *copy)
{
CHARSET_INFO *cs= copy->from_field->charset();
memcpy(copy->to_ptr,copy->from_ptr,copy->from_length);
- cs->cset->fill(cs, copy->to_ptr+copy->from_length,
+ cs->cset->fill(cs, (char*) copy->to_ptr+copy->from_length,
copy->to_length-copy->from_length, '\0');
}
@@ -413,7 +425,7 @@ static void do_expand_string(Copy_field *copy)
{
CHARSET_INFO *cs= copy->from_field->charset();
memcpy(copy->to_ptr,copy->from_ptr,copy->from_length);
- cs->cset->fill(cs, copy->to_ptr+copy->from_length,
+ cs->cset->fill(cs, (char*) copy->to_ptr+copy->from_length,
copy->to_length-copy->from_length, ' ');
}
@@ -438,9 +450,10 @@ static void do_varstring1_mb(Copy_field *copy)
int well_formed_error;
CHARSET_INFO *cs= copy->from_field->charset();
uint from_length= (uint) *(uchar*) copy->from_ptr;
- const char *from_ptr= copy->from_ptr + 1;
+ const uchar *from_ptr= copy->from_ptr + 1;
uint to_char_length= (copy->to_length - 1) / cs->mbmaxlen;
- uint length= cs->cset->well_formed_len(cs, from_ptr, from_ptr + from_length,
+ uint length= cs->cset->well_formed_len(cs, (char*) from_ptr,
+ (char*) from_ptr + from_length,
to_char_length, &well_formed_error);
if (length < from_length)
{
@@ -448,7 +461,7 @@ static void do_varstring1_mb(Copy_field *copy)
copy->to_field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
WARN_DATA_TRUNCATED, 1);
}
- *(uchar*) copy->to_ptr= (uchar) length;
+ *copy->to_ptr= (uchar) length;
memcpy(copy->to_ptr + 1, from_ptr, length);
}
@@ -475,8 +488,9 @@ static void do_varstring2_mb(Copy_field *copy)
CHARSET_INFO *cs= copy->from_field->charset();
uint char_length= (copy->to_length - HA_KEY_BLOB_LENGTH) / cs->mbmaxlen;
uint from_length= uint2korr(copy->from_ptr);
- const char *from_beg= copy->from_ptr + HA_KEY_BLOB_LENGTH;
- uint length= cs->cset->well_formed_len(cs, from_beg, from_beg + from_length,
+ const uchar *from_beg= copy->from_ptr + HA_KEY_BLOB_LENGTH;
+ uint length= cs->cset->well_formed_len(cs, (char*) from_beg,
+ (char*) from_beg + from_length,
char_length, &well_formed_error);
if (length < from_length)
{
@@ -501,7 +515,7 @@ static void do_varstring2_mb(Copy_field *copy)
The 'to' buffer should have a size of field->pack_length()+1
*/
-void Copy_field::set(char *to,Field *from)
+void Copy_field::set(uchar *to,Field *from)
{
from_ptr=from->ptr;
to_ptr=to;
@@ -529,7 +543,21 @@ void Copy_field::set(char *to,Field *from)
}
+/*
+ To do:
+
+ If 'save\ is set to true and the 'from' is a blob field, do_copy is set to
+ do_save_blob rather than do_conv_blob. The only differences between them
+ appears to be:
+
+ - do_save_blob allocates and uses an intermediate buffer before calling
+ Field_blob::store. Is this in order to trigger the call to
+ well_formed_copy_nchars, by changing the pointer copy->tmp.ptr()?
+ That call will take place anyway in all known cases.
+ - The above causes a truncation to MAX_FIELD_WIDTH. Is this the intended
+ effect? Truncation is handled by well_formed_copy_nchars anyway.
+ */
void Copy_field::set(Field *to,Field *from,bool save)
{
if (to->type() == MYSQL_TYPE_NULL)
@@ -592,7 +620,8 @@ void Copy_field::set(Field *to,Field *from,bool save)
}
-void (*Copy_field::get_copy_func(Field *to,Field *from))(Copy_field*)
+Copy_field::Copy_func *
+Copy_field::get_copy_func(Field *to,Field *from)
{
bool compatible_db_low_byte_first= (to->table->s->db_low_byte_first ==
from->table->s->db_low_byte_first);
@@ -648,7 +677,13 @@ void (*Copy_field::get_copy_func(Field *to,Field *from))(Copy_field*)
to->real_type() == MYSQL_TYPE_SET)
{
if (!to->eq_def(from))
- return do_field_string;
+ {
+ if (from->real_type() == MYSQL_TYPE_ENUM &&
+ to->real_type() == MYSQL_TYPE_ENUM)
+ return do_field_enum;
+ else
+ return do_field_string;
+ }
}
else if (to->charset() != from->charset())
return do_field_string;
@@ -761,11 +796,18 @@ int field_conv(Field *to,Field *from)
blob->value.copy();
return blob->store(blob->value.ptr(),blob->value.length(),from->charset());
}
- if ((from->result_type() == STRING_RESULT &&
- (to->result_type() == STRING_RESULT ||
- (from->real_type() != MYSQL_TYPE_ENUM &&
- from->real_type() != MYSQL_TYPE_SET))) ||
- to->type() == MYSQL_TYPE_DECIMAL)
+ if (from->real_type() == MYSQL_TYPE_ENUM &&
+ to->real_type() == MYSQL_TYPE_ENUM &&
+ from->val_int() == 0)
+ {
+ ((Field_enum *)(to))->store_type(0);
+ return 0;
+ }
+ else if ((from->result_type() == STRING_RESULT &&
+ (to->result_type() == STRING_RESULT ||
+ (from->real_type() != MYSQL_TYPE_ENUM &&
+ from->real_type() != MYSQL_TYPE_SET))) ||
+ to->type() == MYSQL_TYPE_DECIMAL)
{
char buff[MAX_FIELD_WIDTH];
String result(buff,sizeof(buff),from->charset());
diff --git a/sql/filesort.cc b/sql/filesort.cc
index a80e4a0fa54..b6a5d844eac 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -30,19 +30,20 @@
/* How to write record_ref. */
#define WRITE_REF(file,from) \
-if (my_b_write((file),(byte*) (from),param->ref_length)) \
+if (my_b_write((file),(uchar*) (from),param->ref_length)) \
DBUG_RETURN(1);
/* functions defined in this file */
-static char **make_char_array(register uint fields, uint length, myf my_flag);
+static char **make_char_array(char **old_pos, register uint fields,
+ uint length, myf my_flag);
static BUFFPEK *read_buffpek_from_file(IO_CACHE *buffer_file, uint count);
static ha_rows find_all_keys(SORTPARAM *param,SQL_SELECT *select,
uchar * *sort_keys, IO_CACHE *buffer_file,
IO_CACHE *tempfile,IO_CACHE *indexfile);
static int write_keys(SORTPARAM *param,uchar * *sort_keys,
uint count, IO_CACHE *buffer_file, IO_CACHE *tempfile);
-static void make_sortkey(SORTPARAM *param,uchar *to, byte *ref_pos);
+static void make_sortkey(SORTPARAM *param,uchar *to, uchar *ref_pos);
static void register_used_fields(SORTPARAM *param);
static int merge_index(SORTPARAM *param,uchar *sort_buffer,
BUFFPEK *buffpek,
@@ -56,7 +57,7 @@ static uint sortlength(THD *thd, SORT_FIELD *sortorder, uint s_length,
static SORT_ADDON_FIELD *get_addon_fields(THD *thd, Field **ptabfield,
uint sortlength, uint *plength);
static void unpack_addon_fields(struct st_sort_addon_field *addon_field,
- byte *buff);
+ uchar *buff);
/*
Sort a table
@@ -153,7 +154,7 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
if (param.addon_field)
{
param.res_length= param.addon_length;
- if (!(table_sort.addon_buf= (byte *) my_malloc(param.addon_length,
+ if (!(table_sort.addon_buf= (uchar *) my_malloc(param.addon_length,
MYF(MY_WME))))
goto err;
}
@@ -171,11 +172,11 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
if (select && select->quick)
{
- statistic_increment(thd->status_var.filesort_range_count, &LOCK_status);
+ status_var_increment(thd->status_var.filesort_range_count);
}
else
{
- statistic_increment(thd->status_var.filesort_scan_count, &LOCK_status);
+ status_var_increment(thd->status_var.filesort_scan_count);
}
#ifdef CAN_TRUST_RANGE
if (select && select->quick && select->quick->records > 0L)
@@ -198,7 +199,7 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
}
if (multi_byte_charset &&
- !(param.tmp_buffer=my_malloc(param.sort_length,MYF(MY_WME))))
+ !(param.tmp_buffer= (char*) my_malloc(param.sort_length,MYF(MY_WME))))
goto err;
memavl= thd->variables.sortbuff_size;
@@ -208,9 +209,9 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
ulong old_memavl;
ulong keys= memavl/(param.rec_length+sizeof(char*));
param.keys=(uint) min(records+1, keys);
- if (table_sort.sort_keys ||
- (table_sort.sort_keys= (uchar **) make_char_array(param.keys, param.rec_length,
- MYF(0))))
+ if ((table_sort.sort_keys=
+ (uchar **) make_char_array((char **) table_sort.sort_keys,
+ param.keys, param.rec_length, MYF(0))))
break;
old_memavl=memavl;
if ((memavl=memavl/4*3) < min_sort_memory && old_memavl > min_sort_memory)
@@ -245,7 +246,7 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
{
if (!table_sort.buffpek && table_sort.buffpek_len < maxbuffer &&
!(table_sort.buffpek=
- (byte *) read_buffpek_from_file(&buffpek_pointers, maxbuffer)))
+ (uchar *) read_buffpek_from_file(&buffpek_pointers, maxbuffer)))
goto err;
buffpek= (BUFFPEK *) table_sort.buffpek;
table_sort.buffpek_len= maxbuffer;
@@ -255,7 +256,8 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
open_cached_file(outfile,mysql_tmpdir,TEMP_PREFIX,READ_RECORD_BUFFER,
MYF(MY_WME)))
goto err;
- reinit_io_cache(outfile,WRITE_CACHE,0L,0,0);
+ if (reinit_io_cache(outfile,WRITE_CACHE,0L,0,0))
+ goto err;
/*
Use also the space previously used by string pointers in sort_buffer
@@ -283,9 +285,9 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
x_free(param.tmp_buffer);
if (!subselect || !subselect->is_uncacheable())
{
- x_free((gptr) sort_keys);
+ x_free((uchar*) sort_keys);
table_sort.sort_keys= 0;
- x_free((gptr) buffpek);
+ x_free((uchar*) buffpek);
table_sort.buffpek= 0;
table_sort.buffpek_len= 0;
}
@@ -323,19 +325,19 @@ void filesort_free_buffers(TABLE *table, bool full)
{
if (table->sort.record_pointers)
{
- my_free((gptr) table->sort.record_pointers,MYF(0));
+ my_free((uchar*) table->sort.record_pointers,MYF(0));
table->sort.record_pointers=0;
}
if (full)
{
if (table->sort.sort_keys )
{
- x_free((gptr) table->sort.sort_keys);
+ x_free((uchar*) table->sort.sort_keys);
table->sort.sort_keys= 0;
}
if (table->sort.buffpek)
{
- x_free((gptr) table->sort.buffpek);
+ x_free((uchar*) table->sort.buffpek);
table->sort.buffpek= 0;
table->sort.buffpek_len= 0;
}
@@ -351,14 +353,16 @@ void filesort_free_buffers(TABLE *table, bool full)
/* Make a array of string pointers */
-static char **make_char_array(register uint fields, uint length, myf my_flag)
+static char **make_char_array(char **old_pos, register uint fields,
+ uint length, myf my_flag)
{
register char **pos;
- char **old_pos,*char_pos;
+ char *char_pos;
DBUG_ENTER("make_char_array");
- if ((old_pos= (char**) my_malloc((uint) fields*(length+sizeof(char*)),
- my_flag)))
+ if (old_pos ||
+ (old_pos= (char**) my_malloc((uint) fields*(length+sizeof(char*)),
+ my_flag)))
{
pos=old_pos; char_pos=((char*) (pos+fields)) -length;
while (fields--) *(pos++) = (char_pos+= length);
@@ -375,11 +379,13 @@ static BUFFPEK *read_buffpek_from_file(IO_CACHE *buffpek_pointers, uint count)
ulong length;
BUFFPEK *tmp;
DBUG_ENTER("read_buffpek_from_file");
+ if (count > UINT_MAX/sizeof(BUFFPEK))
+ return 0; /* sizeof(BUFFPEK)*count will overflow */
tmp=(BUFFPEK*) my_malloc(length=sizeof(BUFFPEK)*count, MYF(MY_WME));
if (tmp)
{
if (reinit_io_cache(buffpek_pointers,READ_CACHE,0L,0,0) ||
- my_b_read(buffpek_pointers, (byte*) tmp, length))
+ my_b_read(buffpek_pointers, (uchar*) tmp, length))
{
my_free((char*) tmp, MYF(0));
tmp=0;
@@ -431,7 +437,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
{
int error,flag,quick_select;
uint idx,indexpos,ref_length;
- byte *ref_pos,*next_pos,ref_buff[MAX_REFLENGTH];
+ uchar *ref_pos,*next_pos,ref_buff[MAX_REFLENGTH];
my_off_t record;
TABLE *sort_form;
THD *thd= current_thd;
@@ -458,7 +464,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
next_pos=ref_pos;
if (! indexfile && ! quick_select)
{
- next_pos=(byte*) 0; /* Find records in sequence */
+ next_pos=(uchar*) 0; /* Find records in sequence */
file->ha_rnd_init(1);
file->extra_opt(HA_EXTRA_CACHE,
current_thd->variables.read_buff_size);
@@ -483,7 +489,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
register_used_fields(param);
if (select && select->cond)
select->cond->walk(&Item::register_field_in_read_map, 1,
- (byte*) sort_form);
+ (uchar*) sort_form);
sort_form->column_bitmaps_set(&sort_form->tmp_set, &sort_form->tmp_set);
for (;;)
@@ -501,7 +507,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
{
if (indexfile)
{
- if (my_b_read(indexfile,(byte*) ref_pos,ref_length)) /* purecov: deadcode */
+ if (my_b_read(indexfile,(uchar*) ref_pos,ref_length)) /* purecov: deadcode */
{
error= my_errno ? my_errno : -1; /* Abort */
break;
@@ -609,7 +615,7 @@ static int
write_keys(SORTPARAM *param, register uchar **sort_keys, uint count,
IO_CACHE *buffpek_pointers, IO_CACHE *tempfile)
{
- uint sort_length, rec_length;
+ size_t sort_length, rec_length;
uchar **end;
BUFFPEK buffpek;
DBUG_ENTER("write_keys");
@@ -619,20 +625,23 @@ write_keys(SORTPARAM *param, register uchar **sort_keys, uint count,
#ifdef MC68000
quicksort(sort_keys,count,sort_length);
#else
- my_string_ptr_sort((gptr) sort_keys, (uint) count, sort_length);
+ my_string_ptr_sort((uchar*) sort_keys, (uint) count, sort_length);
#endif
if (!my_b_inited(tempfile) &&
open_cached_file(tempfile, mysql_tmpdir, TEMP_PREFIX, DISK_BUFFER_SIZE,
MYF(MY_WME)))
goto err; /* purecov: inspected */
+ /* check we won't have more buffpeks than we can possibly keep in memory */
+ if (my_b_tell(buffpek_pointers) + sizeof(BUFFPEK) > (ulonglong)UINT_MAX)
+ goto err;
buffpek.file_pos= my_b_tell(tempfile);
if ((ha_rows) count > param->max_rows)
count=(uint) param->max_rows; /* purecov: inspected */
buffpek.count=(ha_rows) count;
for (end=sort_keys+count ; sort_keys != end ; sort_keys++)
- if (my_b_write(tempfile, (byte*) *sort_keys, (uint) rec_length))
+ if (my_b_write(tempfile, (uchar*) *sort_keys, (uint) rec_length))
goto err;
- if (my_b_write(buffpek_pointers, (byte*) &buffpek, sizeof(buffpek)))
+ if (my_b_write(buffpek_pointers, (uchar*) &buffpek, sizeof(buffpek)))
goto err;
DBUG_RETURN(0);
@@ -667,7 +676,7 @@ static inline void store_length(uchar *to, uint length, uint pack_length)
/* makes a sort-key from record */
static void make_sortkey(register SORTPARAM *param,
- register uchar *to, byte *ref_pos)
+ register uchar *to, uchar *ref_pos)
{
reg3 Field *field;
reg1 SORT_FIELD *sort_field;
@@ -694,7 +703,7 @@ static void make_sortkey(register SORTPARAM *param,
else
*to++=1;
}
- field->sort_string((char*) to,sort_field->length);
+ field->sort_string(to, sort_field->length);
}
else
{ // Item
@@ -823,7 +832,7 @@ static void make_sortkey(register SORTPARAM *param,
}
*to++=1;
}
- my_decimal2binary(E_DEC_FATAL_ERROR, dec_val, (char*)to,
+ my_decimal2binary(E_DEC_FATAL_ERROR, dec_val, to,
item->max_length - (item->decimals ? 1:0),
item->decimals);
break;
@@ -841,7 +850,7 @@ static void make_sortkey(register SORTPARAM *param,
}
*to++=1;
}
- change_double_for_sort(value,(byte*) to);
+ change_double_for_sort(value,(uchar*) to);
break;
}
case ROW_RESULT:
@@ -891,13 +900,13 @@ static void make_sortkey(register SORTPARAM *param,
else
{
#ifdef HAVE_purify
- uchar *end= (uchar*) field->pack((char *) to, field->ptr);
+ uchar *end= field->pack(to, field->ptr);
uint length= (uint) ((to + addonf->length) - end);
DBUG_ASSERT((int) length >= 0);
if (length)
bzero(end, length);
#else
- (void) field->pack((char *) to, field->ptr);
+ (void) field->pack(to, field->ptr);
#endif
}
to+= addonf->length;
@@ -906,7 +915,7 @@ static void make_sortkey(register SORTPARAM *param,
else
{
/* Save filepos last */
- memcpy((byte*) to, ref_pos, (size_s) param->ref_length);
+ memcpy((uchar*) to, ref_pos, (size_t) param->ref_length);
}
return;
}
@@ -935,7 +944,7 @@ static void register_used_fields(SORTPARAM *param)
else
{ // Item
sort_field->item->walk(&Item::register_field_in_read_map, 1,
- (byte *) table);
+ (uchar *) table);
}
}
@@ -958,16 +967,16 @@ static bool save_index(SORTPARAM *param, uchar **sort_keys, uint count,
FILESORT_INFO *table_sort)
{
uint offset,res_length;
- byte *to;
+ uchar *to;
DBUG_ENTER("save_index");
- my_string_ptr_sort((gptr) sort_keys, (uint) count, param->sort_length);
+ my_string_ptr_sort((uchar*) sort_keys, (uint) count, param->sort_length);
res_length= param->res_length;
offset= param->rec_length-res_length;
if ((ha_rows) count > param->max_rows)
count=(uint) param->max_rows;
if (!(to= table_sort->record_pointers=
- (byte*) my_malloc(res_length*count, MYF(MY_WME))))
+ (uchar*) my_malloc(res_length*count, MYF(MY_WME))))
DBUG_RETURN(1); /* purecov: inspected */
for (uchar **end= sort_keys+count ; sort_keys != end ; sort_keys++)
{
@@ -983,7 +992,7 @@ static bool save_index(SORTPARAM *param, uchar **sort_keys, uint count,
int merge_many_buff(SORTPARAM *param, uchar *sort_buffer,
BUFFPEK *buffpek, uint *maxbuffer, IO_CACHE *t_file)
{
- register int i;
+ register uint i;
IO_CACHE t_file2,*from_file,*to_file,*temp;
BUFFPEK *lastbuff;
DBUG_ENTER("merge_many_buff");
@@ -998,14 +1007,16 @@ int merge_many_buff(SORTPARAM *param, uchar *sort_buffer,
from_file= t_file ; to_file= &t_file2;
while (*maxbuffer >= MERGEBUFF2)
{
- reinit_io_cache(from_file,READ_CACHE,0L,0,0);
- reinit_io_cache(to_file,WRITE_CACHE,0L,0,0);
+ if (reinit_io_cache(from_file,READ_CACHE,0L,0,0))
+ goto cleanup;
+ if (reinit_io_cache(to_file,WRITE_CACHE,0L,0,0))
+ goto cleanup;
lastbuff=buffpek;
- for (i=0 ; i <= (int) *maxbuffer-MERGEBUFF*3/2 ; i+=MERGEBUFF)
+ for (i=0 ; i <= *maxbuffer-MERGEBUFF*3/2 ; i+=MERGEBUFF)
{
if (merge_buffers(param,from_file,to_file,sort_buffer,lastbuff++,
buffpek+i,buffpek+i+MERGEBUFF-1,0))
- break; /* purecov: inspected */
+ goto cleanup;
}
if (merge_buffers(param,from_file,to_file,sort_buffer,lastbuff++,
buffpek+i,buffpek+ *maxbuffer,0))
@@ -1017,6 +1028,7 @@ int merge_many_buff(SORTPARAM *param, uchar *sort_buffer,
setup_io_cache(to_file);
*maxbuffer= (uint) (lastbuff-buffpek)-1;
}
+cleanup:
close_cached_file(to_file); // This holds old result
if (to_file == t_file)
{
@@ -1039,7 +1051,7 @@ uint read_to_buffer(IO_CACHE *fromfile, BUFFPEK *buffpek,
if ((count=(uint) min((ha_rows) buffpek->max_keys,buffpek->count)))
{
- if (my_pread(fromfile->file,(byte*) buffpek->base,
+ if (my_pread(fromfile->file,(uchar*) buffpek->base,
(length= rec_length*count),buffpek->file_pos,MYF_RW))
return((uint) -1); /* purecov: inspected */
buffpek->key=buffpek->base;
@@ -1108,7 +1120,8 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
int flag)
{
int error;
- uint rec_length,sort_length,res_length,offset;
+ uint rec_length,res_length,offset;
+ size_t sort_length;
ulong maxcount;
ha_rows max_rows,org_max_rows;
my_off_t to_start_filepos;
@@ -1116,12 +1129,12 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
BUFFPEK *buffpek;
QUEUE queue;
qsort2_cmp cmp;
+ void *first_cmp_arg;
volatile THD::killed_state *killed= &current_thd->killed;
THD::killed_state not_killable;
DBUG_ENTER("merge_buffers");
- statistic_increment(current_thd->status_var.filesort_merge_passes,
- &LOCK_status);
+ status_var_increment(current_thd->status_var.filesort_merge_passes);
if (param->not_killable)
{
killed= &not_killable;
@@ -1141,9 +1154,18 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
/* The following will fire if there is not enough space in sort_buffer */
DBUG_ASSERT(maxcount!=0);
+ if (param->unique_buff)
+ {
+ cmp= param->compare;
+ first_cmp_arg= (void *) &param->cmp_context;
+ }
+ else
+ {
+ cmp= get_ptr_compare(sort_length);
+ first_cmp_arg= (void*) &sort_length;
+ }
if (init_queue(&queue, (uint) (Tb-Fb)+1, offsetof(BUFFPEK,key), 0,
- (queue_compare) (cmp= get_ptr_compare(sort_length)),
- (void*) &sort_length))
+ (queue_compare) cmp, first_cmp_arg))
DBUG_RETURN(1); /* purecov: inspected */
for (buffpek= Fb ; buffpek <= Tb ; buffpek++)
{
@@ -1154,7 +1176,7 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
if (error == -1)
goto err; /* purecov: inspected */
buffpek->max_keys= buffpek->mem_count; // If less data in buffers than expected
- queue_insert(&queue, (byte*) buffpek);
+ queue_insert(&queue, (uchar*) buffpek);
}
if (param->unique_buff)
@@ -1169,7 +1191,7 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
*/
buffpek= (BUFFPEK*) queue_top(&queue);
memcpy(param->unique_buff, buffpek->key, rec_length);
- if (my_b_write(to_file, (byte*) buffpek->key, rec_length))
+ if (my_b_write(to_file, (uchar*) buffpek->key, rec_length))
{
error=1; goto err; /* purecov: inspected */
}
@@ -1196,21 +1218,21 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
buffpek= (BUFFPEK*) queue_top(&queue);
if (cmp) // Remove duplicates
{
- if (!(*cmp)(&sort_length, &(param->unique_buff),
+ if (!(*cmp)(first_cmp_arg, &(param->unique_buff),
(uchar**) &buffpek->key))
goto skip_duplicate;
memcpy(param->unique_buff, (uchar*) buffpek->key, rec_length);
}
if (flag == 0)
{
- if (my_b_write(to_file,(byte*) buffpek->key, rec_length))
+ if (my_b_write(to_file,(uchar*) buffpek->key, rec_length))
{
error=1; goto err; /* purecov: inspected */
}
}
else
{
- if (my_b_write(to_file, (byte*) buffpek->key+offset, res_length))
+ if (my_b_write(to_file, (uchar*) buffpek->key+offset, res_length))
{
error=1; goto err; /* purecov: inspected */
}
@@ -1248,7 +1270,7 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
*/
if (cmp)
{
- if (!(*cmp)(&sort_length, &(param->unique_buff), (uchar**) &buffpek->key))
+ if (!(*cmp)(first_cmp_arg, &(param->unique_buff), (uchar**) &buffpek->key))
{
buffpek->key+= rec_length; // Remove duplicate
--buffpek->mem_count;
@@ -1265,7 +1287,7 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
max_rows-= buffpek->mem_count;
if (flag == 0)
{
- if (my_b_write(to_file,(byte*) buffpek->key,
+ if (my_b_write(to_file,(uchar*) buffpek->key,
(rec_length*buffpek->mem_count)))
{
error= 1; goto err; /* purecov: inspected */
@@ -1279,7 +1301,7 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
strpos != end ;
strpos+= rec_length)
{
- if (my_b_write(to_file, (byte *) strpos, res_length))
+ if (my_b_write(to_file, (uchar *) strpos, res_length))
{
error=1; goto err;
}
@@ -1548,7 +1570,7 @@ get_addon_fields(THD *thd, Field **ptabfield, uint sortlength, uint *plength)
*/
static void
-unpack_addon_fields(struct st_sort_addon_field *addon_field, byte *buff)
+unpack_addon_fields(struct st_sort_addon_field *addon_field, uchar *buff)
{
Field *field;
SORT_ADDON_FIELD *addonf= addon_field;
@@ -1561,7 +1583,7 @@ unpack_addon_fields(struct st_sort_addon_field *addon_field, byte *buff)
continue;
}
field->set_notnull();
- field->unpack(field->ptr, (char *) buff+addonf->offset);
+ field->unpack(field->ptr, buff + addonf->offset);
}
}
@@ -1572,7 +1594,7 @@ unpack_addon_fields(struct st_sort_addon_field *addon_field, byte *buff)
#define DBL_EXP_DIG (sizeof(double)*8-DBL_MANT_DIG)
-void change_double_for_sort(double nr,byte *to)
+void change_double_for_sort(double nr,uchar *to)
{
uchar *tmp=(uchar*) to;
if (nr == 0.0)
diff --git a/sql/gen_lex_hash.cc b/sql/gen_lex_hash.cc
index 2d78999017a..36b7f30dc64 100644
--- a/sql/gen_lex_hash.cc
+++ b/sql/gen_lex_hash.cc
@@ -90,8 +90,8 @@ struct my_option my_long_options[] =
{"debug", '#', "This is a non-debug version. Catch this and exit",
0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
#else
- {"debug", '#', "Output debug log", (gptr*) &default_dbug_option,
- (gptr*) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug", '#', "Output debug log", (uchar**) &default_dbug_option,
+ (uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"help", '?', "Display help and exit",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
diff --git a/sql/gstream.h b/sql/gstream.h
index 10274635413..1ef90ad5bf0 100644
--- a/sql/gstream.h
+++ b/sql/gstream.h
@@ -35,7 +35,7 @@ public:
{}
~Gis_read_stream()
{
- my_free(m_err_msg, MYF(MY_ALLOW_ZERO_PTR));
+ my_free((uchar*) m_err_msg, MYF(MY_ALLOW_ZERO_PTR));
}
enum enum_tok_types get_next_toc_type();
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index b2a02c3b6d5..b2152fbb906 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -121,14 +121,14 @@ static uint ndbcluster_alter_table_flags(uint flags)
#define ERR_RETURN(err) \
{ \
const NdbError& tmp= err; \
- ERR_PRINT(tmp); \
+ set_ndb_err(current_thd, tmp); \
DBUG_RETURN(ndb_to_mysql_error(&tmp)); \
}
#define ERR_BREAK(err, code) \
{ \
const NdbError& tmp= err; \
- ERR_PRINT(tmp); \
+ set_ndb_err(current_thd, tmp); \
code= ndb_to_mysql_error(&tmp); \
break; \
}
@@ -146,7 +146,7 @@ pthread_mutex_t ndbcluster_mutex;
// Table lock handling
HASH ndbcluster_open_tables;
-static byte *ndbcluster_get_key(NDB_SHARE *share,uint *length,
+static uchar *ndbcluster_get_key(NDB_SHARE *share, size_t *length,
my_bool not_used __attribute__((unused)));
#ifdef HAVE_NDB_BINLOG
static int rename_share(NDB_SHARE *share, const char *new_key);
@@ -229,14 +229,12 @@ static int ndb_to_mysql_error(const NdbError *ndberr)
*/
case HA_ERR_NO_SUCH_TABLE:
case HA_ERR_KEY_NOT_FOUND:
- case HA_ERR_FOUND_DUPP_KEY:
return error;
/* Mapping missing, go with the ndb error code*/
case -1:
error= ndberr->code;
break;
-
/* Mapping exists, go with the mapped code */
default:
break;
@@ -278,11 +276,6 @@ inline
int execute_no_commit(ha_ndbcluster *h, NdbTransaction *trans,
bool force_release)
{
-#ifdef NOT_USED
- int m_batch_execute= 0;
- if (m_batch_execute)
- return 0;
-#endif
h->release_completed_operations(trans, force_release);
return h->m_ignore_no_key ?
execute_no_commit_ignore_no_key(h,trans) :
@@ -294,11 +287,6 @@ int execute_no_commit(ha_ndbcluster *h, NdbTransaction *trans,
inline
int execute_commit(ha_ndbcluster *h, NdbTransaction *trans)
{
-#ifdef NOT_USED
- int m_batch_execute= 0;
- if (m_batch_execute)
- return 0;
-#endif
return trans->execute(NdbTransaction::Commit,
NdbOperation::AbortOnError,
h->m_force_send);
@@ -307,11 +295,6 @@ int execute_commit(ha_ndbcluster *h, NdbTransaction *trans)
inline
int execute_commit(THD *thd, NdbTransaction *trans)
{
-#ifdef NOT_USED
- int m_batch_execute= 0;
- if (m_batch_execute)
- return 0;
-#endif
return trans->execute(NdbTransaction::Commit,
NdbOperation::AbortOnError,
thd->variables.ndb_force_send);
@@ -321,11 +304,6 @@ inline
int execute_no_commit_ie(ha_ndbcluster *h, NdbTransaction *trans,
bool force_release)
{
-#ifdef NOT_USED
- int m_batch_execute= 0;
- if (m_batch_execute)
- return 0;
-#endif
h->release_completed_operations(trans, force_release);
return trans->execute(NdbTransaction::NoCommit,
NdbOperation::AO_IgnoreError,
@@ -336,11 +314,11 @@ int execute_no_commit_ie(ha_ndbcluster *h, NdbTransaction *trans,
Place holder for ha_ndbcluster thread specific data
*/
static
-byte *thd_ndb_share_get_key(THD_NDB_SHARE *thd_ndb_share, uint *length,
+uchar *thd_ndb_share_get_key(THD_NDB_SHARE *thd_ndb_share, size_t *length,
my_bool not_used __attribute__((unused)))
{
*length= sizeof(thd_ndb_share->key);
- return (byte*) &thd_ndb_share->key;
+ return (uchar*) &thd_ndb_share->key;
}
Thd_ndb::Thd_ndb()
@@ -351,6 +329,7 @@ Thd_ndb::Thd_ndb()
all= NULL;
stmt= NULL;
m_error= FALSE;
+ m_error_code= 0;
query_state&= NDB_QUERY_NORMAL;
options= 0;
(void) hash_init(&open_tables, &my_charset_bin, 5, 0, 0,
@@ -386,6 +365,7 @@ Thd_ndb::init_open_tables()
{
count= 0;
m_error= FALSE;
+ m_error_code= 0;
my_hash_reset(&open_tables);
}
@@ -395,9 +375,9 @@ Thd_ndb::get_open_table(THD *thd, const void *key)
DBUG_ENTER("Thd_ndb::get_open_table");
HASH_SEARCH_STATE state;
THD_NDB_SHARE *thd_ndb_share=
- (THD_NDB_SHARE*)hash_first(&open_tables, (byte *)&key, sizeof(key), &state);
+ (THD_NDB_SHARE*)hash_first(&open_tables, (uchar *)&key, sizeof(key), &state);
while (thd_ndb_share && thd_ndb_share->key != key)
- thd_ndb_share= (THD_NDB_SHARE*)hash_next(&open_tables, (byte *)&key, sizeof(key), &state);
+ thd_ndb_share= (THD_NDB_SHARE*)hash_next(&open_tables, (uchar *)&key, sizeof(key), &state);
if (thd_ndb_share == 0)
{
thd_ndb_share= (THD_NDB_SHARE *) alloc_root(&thd->transaction.mem_root,
@@ -406,7 +386,7 @@ Thd_ndb::get_open_table(THD *thd, const void *key)
thd_ndb_share->stat.last_count= count;
thd_ndb_share->stat.no_uncommitted_rows_count= 0;
thd_ndb_share->stat.records= ~(ha_rows)0;
- my_hash_insert(&open_tables, (byte *)thd_ndb_share);
+ my_hash_insert(&open_tables, (uchar *)thd_ndb_share);
}
else if (thd_ndb_share->stat.last_count != count)
{
@@ -509,6 +489,7 @@ void ha_ndbcluster::no_uncommitted_rows_execute_failure()
return;
DBUG_ENTER("ha_ndbcluster::no_uncommitted_rows_execute_failure");
get_thd_ndb(current_thd)->m_error= TRUE;
+ get_thd_ndb(current_thd)->m_error_code= 0;
DBUG_VOID_RETURN;
}
@@ -536,13 +517,51 @@ void ha_ndbcluster::no_uncommitted_rows_reset(THD *thd)
DBUG_VOID_RETURN;
}
+/*
+ Sets the latest ndb error code on the thd_ndb object such that it
+ can be retrieved later to know which ndb error caused the handler
+ error.
+*/
+static void set_ndb_err(THD *thd, const NdbError &err)
+{
+ DBUG_ENTER("set_ndb_err");
+ ERR_PRINT(err);
+
+ Thd_ndb *thd_ndb= get_thd_ndb(thd);
+ if (thd_ndb == NULL)
+ DBUG_VOID_RETURN;
+#ifdef NOT_YET
+ /*
+ Check if error code is overwritten, in this case the original
+ failure cause will be lost. E.g. if 4350 error is given. So
+ push a warning so that it can be detected which is the root
+ error cause.
+ */
+ if (thd_ndb->m_query_id == thd->query_id &&
+ thd_ndb->m_error_code != 0 &&
+ thd_ndb->m_error_code != err.code)
+ {
+ char buf[FN_REFLEN];
+ ndb_error_string(thd_ndb->m_error_code, buf, sizeof(buf));
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
+ thd_ndb->m_error_code, buf, "NDB");
+ }
+#endif
+ thd_ndb->m_query_id= thd->query_id;
+ thd_ndb->m_error_code= err.code;
+ DBUG_VOID_RETURN;
+}
+
int ha_ndbcluster::ndb_err(NdbTransaction *trans)
{
+ THD *thd= current_thd;
int res;
NdbError err= trans->getNdbError();
DBUG_ENTER("ndb_err");
- ERR_PRINT(err);
+ set_ndb_err(thd, err);
+
switch (err.classification) {
case NdbError::SchemaError:
{
@@ -553,7 +572,7 @@ int ha_ndbcluster::ndb_err(NdbTransaction *trans)
bzero((char*) &table_list,sizeof(table_list));
table_list.db= m_dbname;
table_list.alias= table_list.table_name= m_tabname;
- close_cached_tables(current_thd, 0, &table_list);
+ close_cached_tables(thd, 0, &table_list);
break;
}
default:
@@ -674,7 +693,7 @@ static bool field_type_forces_var_part(enum_field_types type)
*/
bool ha_ndbcluster::set_hidden_key(NdbOperation *ndb_op,
- uint fieldnr, const byte *field_ptr)
+ uint fieldnr, const uchar *field_ptr)
{
DBUG_ENTER("set_hidden_key");
DBUG_RETURN(ndb_op->equal(fieldnr, (char*)field_ptr) != 0);
@@ -686,14 +705,14 @@ bool ha_ndbcluster::set_hidden_key(NdbOperation *ndb_op,
*/
int ha_ndbcluster::set_ndb_key(NdbOperation *ndb_op, Field *field,
- uint fieldnr, const byte *field_ptr)
+ uint fieldnr, const uchar *field_ptr)
{
uint32 pack_len= field->pack_length();
DBUG_ENTER("set_ndb_key");
DBUG_PRINT("enter", ("%d: %s, ndb_type: %u, len=%d",
fieldnr, field->field_name, field->type(),
pack_len));
- DBUG_DUMP("key", (char*)field_ptr, pack_len);
+ DBUG_DUMP("key", field_ptr, pack_len);
DBUG_ASSERT(ndb_supported_type(field->type()));
DBUG_ASSERT(! (field->flags & BLOB_FLAG));
@@ -710,13 +729,13 @@ int ha_ndbcluster::set_ndb_value(NdbOperation *ndb_op, Field *field,
uint fieldnr, int row_offset,
bool *set_blob_value)
{
- const byte* field_ptr= field->ptr + row_offset;
+ const uchar* field_ptr= field->ptr + row_offset;
uint32 pack_len= field->pack_length();
DBUG_ENTER("set_ndb_value");
DBUG_PRINT("enter", ("%d: %s type: %u len=%d is_null=%s",
fieldnr, field->field_name, field->type(),
pack_len, field->is_null(row_offset) ? "Y" : "N"));
- DBUG_DUMP("value", (char*) field_ptr, pack_len);
+ DBUG_DUMP("value", field_ptr, pack_len);
DBUG_ASSERT(ndb_supported_type(field->type()));
{
@@ -725,7 +744,7 @@ int ha_ndbcluster::set_ndb_value(NdbOperation *ndb_op, Field *field,
if (pack_len == 0)
{
pack_len= sizeof(empty_field);
- field_ptr= (byte *)&empty_field;
+ field_ptr= (uchar *)&empty_field;
if (field->is_null(row_offset))
empty_field= 0;
else
@@ -755,7 +774,7 @@ int ha_ndbcluster::set_ndb_value(NdbOperation *ndb_op, Field *field,
// Set value to NULL
DBUG_RETURN((ndb_op->setValue(fieldnr, (char*)NULL) != 0));
DBUG_PRINT("info", ("bit field"));
- DBUG_DUMP("value", (char*)&bits, pack_len);
+ DBUG_DUMP("value", (uchar*)&bits, pack_len);
#ifdef WORDS_BIGENDIAN
/* store lsw first */
bits = ((bits >> 32) & 0x00000000FFFFFFFFLL)
@@ -775,18 +794,18 @@ int ha_ndbcluster::set_ndb_value(NdbOperation *ndb_op, Field *field,
// Get length and pointer to data
uint32 blob_len= field_blob->get_length(field_ptr);
- char* blob_ptr= NULL;
+ uchar* blob_ptr= NULL;
field_blob->get_ptr(&blob_ptr);
// Looks like NULL ptr signals length 0 blob
if (blob_ptr == NULL) {
DBUG_ASSERT(blob_len == 0);
- blob_ptr= (char*)"";
+ blob_ptr= (uchar*)"";
}
DBUG_PRINT("value", ("set blob ptr: 0x%lx len: %u",
(long) blob_ptr, blob_len));
- DBUG_DUMP("value", (char*)blob_ptr, min(blob_len, 26));
+ DBUG_DUMP("value", blob_ptr, min(blob_len, 26));
if (set_blob_value)
*set_blob_value= TRUE;
@@ -830,7 +849,7 @@ int g_get_ndb_blobs_value(NdbBlob *ndb_blob, void *arg)
passes a record pointer diff.
*/
int get_ndb_blobs_value(TABLE* table, NdbValue* value_array,
- byte*& buffer, uint& buffer_size,
+ uchar*& buffer, uint& buffer_size,
my_ptrdiff_t ptrdiff)
{
DBUG_ENTER("get_ndb_blobs_value");
@@ -866,7 +885,7 @@ int get_ndb_blobs_value(TABLE* table, NdbValue* value_array,
size+= 8 - size % 8;
if (loop == 1)
{
- char *buf= buffer + offset;
+ uchar *buf= buffer + offset;
uint32 len= 0xffffffff; // Max uint32
if (ndb_blob->readData(buf, len) != 0)
ERR_RETURN(ndb_blob->getNdbError());
@@ -881,9 +900,9 @@ int get_ndb_blobs_value(TABLE* table, NdbValue* value_array,
else if (loop == 1) // undefined or null
{
// have to set length even in this case
- char *buf= buffer + offset; // or maybe NULL
+ uchar *buf= buffer + offset; // or maybe NULL
uint32 len= 0;
- field_blob->set_ptr_offset(ptrdiff, len, buf);
+ field_blob->set_ptr_offset(ptrdiff, len, buf);
DBUG_PRINT("info", ("[%u] isNull=%d", i, isNull));
}
}
@@ -892,7 +911,7 @@ int get_ndb_blobs_value(TABLE* table, NdbValue* value_array,
my_free(buffer, MYF(MY_ALLOW_ZERO_PTR));
buffer_size= 0;
DBUG_PRINT("info", ("allocate blobs buffer size %u", offset));
- buffer= my_malloc(offset, MYF(MY_WME));
+ buffer= (uchar*) my_malloc(offset, MYF(MY_WME));
if (buffer == NULL)
{
sql_print_error("ha_ndbcluster::get_ndb_blobs_value: "
@@ -913,7 +932,7 @@ int get_ndb_blobs_value(TABLE* table, NdbValue* value_array,
*/
int ha_ndbcluster::get_ndb_value(NdbOperation *ndb_op, Field *field,
- uint fieldnr, byte* buf)
+ uint fieldnr, uchar* buf)
{
DBUG_ENTER("get_ndb_value");
DBUG_PRINT("enter", ("fieldnr: %d flags: %o", fieldnr,
@@ -928,13 +947,13 @@ int ha_ndbcluster::get_ndb_value(NdbOperation *ndb_op, Field *field,
{
if (field->type() != MYSQL_TYPE_BIT)
{
- byte *field_buf;
+ uchar *field_buf;
if (field->pack_length() != 0)
field_buf= buf + (field->ptr - table->record[0]);
else
- field_buf= (byte *)&dummy_buf;
+ field_buf= (uchar *)&dummy_buf;
m_value[fieldnr].rec= ndb_op->getValue(fieldnr,
- field_buf);
+ (char*) field_buf);
}
else // if (field->type() == MYSQL_TYPE_BIT)
{
@@ -949,7 +968,7 @@ int ha_ndbcluster::get_ndb_value(NdbOperation *ndb_op, Field *field,
if (ndb_blob != NULL)
{
// Set callback
- m_blobs_offset= buf - (byte*) table->record[0];
+ m_blobs_offset= buf - (uchar*) table->record[0];
void *arg= (void *)this;
DBUG_RETURN(ndb_blob->setActiveHook(g_get_ndb_blobs_value, arg) != 0);
}
@@ -957,7 +976,7 @@ int ha_ndbcluster::get_ndb_value(NdbOperation *ndb_op, Field *field,
}
// Used for hidden key only
- m_value[fieldnr].rec= ndb_op->getValue(fieldnr, m_ref);
+ m_value[fieldnr].rec= ndb_op->getValue(fieldnr, (char*) m_ref);
DBUG_RETURN(m_value[fieldnr].rec == NULL);
}
@@ -1031,8 +1050,8 @@ int ha_ndbcluster::get_metadata(const char *path)
DBUG_ASSERT(m_table == NULL);
DBUG_ASSERT(m_table_info == NULL);
- const void *data= NULL, *pack_data= NULL;
- uint length, pack_length;
+ uchar *data= NULL, *pack_data= NULL;
+ size_t length, pack_length;
/*
Compare FrmData in NDB with frm file from disk.
@@ -1041,8 +1060,8 @@ int ha_ndbcluster::get_metadata(const char *path)
if (readfrm(path, &data, &length) ||
packfrm(data, length, &pack_data, &pack_length))
{
- my_free((char*)data, MYF(MY_ALLOW_ZERO_PTR));
- my_free((char*)pack_data, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(data, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(pack_data, MYF(MY_ALLOW_ZERO_PTR));
DBUG_RETURN(1);
}
@@ -1054,11 +1073,11 @@ int ha_ndbcluster::get_metadata(const char *path)
&& cmp_frm(tab, pack_data, pack_length))
{
DBUG_PRINT("error",
- ("metadata, pack_length: %d getFrmLength: %d memcmp: %d",
- pack_length, tab->getFrmLength(),
+ ("metadata, pack_length: %lu getFrmLength: %d memcmp: %d",
+ (ulong) pack_length, tab->getFrmLength(),
memcmp(pack_data, tab->getFrmData(), pack_length)));
- DBUG_DUMP("pack_data", (char*)pack_data, pack_length);
- DBUG_DUMP("frm", (char*)tab->getFrmData(), tab->getFrmLength());
+ DBUG_DUMP("pack_data", (uchar*) pack_data, pack_length);
+ DBUG_DUMP("frm", (uchar*) tab->getFrmData(), tab->getFrmLength());
error= HA_ERR_TABLE_DEF_CHANGED;
}
my_free((char*)data, MYF(0));
@@ -1561,7 +1580,7 @@ inline ulong ha_ndbcluster::index_flags(uint idx_no, uint part,
HA_KEY_SCAN_NOT_ROR);
}
-static void shrink_varchar(Field* field, const byte* & ptr, char* buf)
+static void shrink_varchar(Field* field, const uchar* & ptr, uchar* buf)
{
if (field->type() == MYSQL_TYPE_VARCHAR && ptr != NULL) {
Field_varstring* f= (Field_varstring*)field;
@@ -1580,7 +1599,7 @@ static void shrink_varchar(Field* field, const byte* & ptr, char* buf)
}
}
-int ha_ndbcluster::set_primary_key(NdbOperation *op, const byte *key)
+int ha_ndbcluster::set_primary_key(NdbOperation *op, const uchar *key)
{
KEY* key_info= table->key_info + table_share->primary_key;
KEY_PART_INFO* key_part= key_info->key_part;
@@ -1590,8 +1609,8 @@ int ha_ndbcluster::set_primary_key(NdbOperation *op, const byte *key)
for (; key_part != end; key_part++)
{
Field* field= key_part->field;
- const byte* ptr= key;
- char buf[256];
+ const uchar* ptr= key;
+ uchar buf[256];
shrink_varchar(field, ptr, buf);
if (set_ndb_key(op, field,
key_part->fieldnr-1, ptr))
@@ -1602,7 +1621,7 @@ int ha_ndbcluster::set_primary_key(NdbOperation *op, const byte *key)
}
-int ha_ndbcluster::set_primary_key_from_record(NdbOperation *op, const byte *record)
+int ha_ndbcluster::set_primary_key_from_record(NdbOperation *op, const uchar *record)
{
KEY* key_info= table->key_info + table_share->primary_key;
KEY_PART_INFO* key_part= key_info->key_part;
@@ -1620,7 +1639,7 @@ int ha_ndbcluster::set_primary_key_from_record(NdbOperation *op, const byte *rec
}
int ha_ndbcluster::set_index_key_from_record(NdbOperation *op,
- const byte *record, uint keyno)
+ const uchar *record, uint keyno)
{
KEY* key_info= table->key_info + keyno;
KEY_PART_INFO* key_part= key_info->key_part;
@@ -1641,7 +1660,7 @@ int ha_ndbcluster::set_index_key_from_record(NdbOperation *op,
int
ha_ndbcluster::set_index_key(NdbOperation *op,
const KEY *key_info,
- const byte * key_ptr)
+ const uchar * key_ptr)
{
DBUG_ENTER("ha_ndbcluster::set_index_key");
uint i;
@@ -1651,8 +1670,8 @@ ha_ndbcluster::set_index_key(NdbOperation *op,
for (i= 0; key_part != end; key_part++, i++)
{
Field* field= key_part->field;
- const byte* ptr= key_part->null_bit ? key_ptr + 1 : key_ptr;
- char buf[256];
+ const uchar* ptr= key_part->null_bit ? key_ptr + 1 : key_ptr;
+ uchar buf[256];
shrink_varchar(field, ptr, buf);
if (set_ndb_key(op, field, m_index[active_index].unique_index_attrid_map[i], ptr))
ERR_RETURN(m_active_trans->getNdbError());
@@ -1662,7 +1681,7 @@ ha_ndbcluster::set_index_key(NdbOperation *op,
}
inline
-int ha_ndbcluster::define_read_attrs(byte* buf, NdbOperation* op)
+int ha_ndbcluster::define_read_attrs(uchar* buf, NdbOperation* op)
{
uint i;
DBUG_ENTER("define_read_attrs");
@@ -1704,7 +1723,7 @@ int ha_ndbcluster::define_read_attrs(byte* buf, NdbOperation* op)
Read one record from NDB using primary key
*/
-int ha_ndbcluster::pk_read(const byte *key, uint key_len, byte *buf,
+int ha_ndbcluster::pk_read(const uchar *key, uint key_len, uchar *buf,
uint32 part_id)
{
uint no_fields= table_share->fields;
@@ -1714,7 +1733,7 @@ int ha_ndbcluster::pk_read(const byte *key, uint key_len, byte *buf,
int res;
DBUG_ENTER("pk_read");
DBUG_PRINT("enter", ("key_len: %u", key_len));
- DBUG_DUMP("key", (char*)key, key_len);
+ DBUG_DUMP("key", key, key_len);
m_write_op= FALSE;
NdbOperation::LockMode lm=
@@ -1727,7 +1746,7 @@ int ha_ndbcluster::pk_read(const byte *key, uint key_len, byte *buf,
{
// This table has no primary key, use "hidden" primary key
DBUG_PRINT("info", ("Using hidden key"));
- DBUG_DUMP("key", (char*)key, 8);
+ DBUG_DUMP("key", key, 8);
if (set_hidden_key(op, no_fields, key))
ERR_RETURN(trans->getNdbError());
@@ -1773,7 +1792,7 @@ int ha_ndbcluster::pk_read(const byte *key, uint key_len, byte *buf,
or hidden key
*/
-int ha_ndbcluster::complemented_read(const byte *old_data, byte *new_data,
+int ha_ndbcluster::complemented_read(const uchar *old_data, uchar *new_data,
uint32 old_part_id)
{
uint no_fields= table_share->fields, i;
@@ -1910,7 +1929,7 @@ bool ha_ndbcluster::check_all_operations_for_error(NdbTransaction *trans,
*/
static
int
-check_null_in_record(const KEY* key_info, const byte *record)
+check_null_in_record(const KEY* key_info, const uchar *record)
{
KEY_PART_INFO *curr_part, *end_part;
curr_part= key_info->key_part;
@@ -1937,7 +1956,7 @@ check_null_in_record(const KEY* key_info, const byte *record)
* primary key or unique index values
*/
-int ha_ndbcluster::peek_indexed_rows(const byte *record,
+int ha_ndbcluster::peek_indexed_rows(const uchar *record,
bool check_pk)
{
NdbTransaction *trans= m_active_trans;
@@ -2041,15 +2060,15 @@ int ha_ndbcluster::peek_indexed_rows(const byte *record,
Read one record from NDB using unique secondary index
*/
-int ha_ndbcluster::unique_index_read(const byte *key,
- uint key_len, byte *buf)
+int ha_ndbcluster::unique_index_read(const uchar *key,
+ uint key_len, uchar *buf)
{
int res;
NdbTransaction *trans= m_active_trans;
NdbIndexOperation *op;
DBUG_ENTER("ha_ndbcluster::unique_index_read");
DBUG_PRINT("enter", ("key_len: %u, index: %u", key_len, active_index));
- DBUG_DUMP("key", (char*)key, key_len);
+ DBUG_DUMP("key", key, key_len);
NdbOperation::LockMode lm=
(NdbOperation::LockMode)get_ndb_lock_type(m_lock.type);
@@ -2068,9 +2087,15 @@ int ha_ndbcluster::unique_index_read(const byte *key,
if (execute_no_commit_ie(this,trans,FALSE) != 0 ||
op->getNdbError().code)
{
- table->status= STATUS_NOT_FOUND;
- DBUG_RETURN(ndb_err(trans));
+ int err= ndb_err(trans);
+ if(err==HA_ERR_KEY_NOT_FOUND)
+ table->status= STATUS_NOT_FOUND;
+ else
+ table->status= STATUS_GARBAGE;
+
+ DBUG_RETURN(err);
}
+
// The value have now been fetched from NDB
unpack_record(buf);
table->status= 0;
@@ -2185,7 +2210,7 @@ inline int ha_ndbcluster::fetch_next(NdbScanOperation* cursor)
*/
-inline int ha_ndbcluster::next_result(byte *buf)
+inline int ha_ndbcluster::next_result(uchar *buf)
{
int res;
DBUG_ENTER("next_result");
@@ -2264,10 +2289,10 @@ int ha_ndbcluster::set_bounds(NdbIndexScanOperation *op,
struct part_st {
bool part_last;
const key_range *key;
- const byte *part_ptr;
+ const uchar *part_ptr;
bool part_null;
int bound_type;
- const char* bound_ptr;
+ const uchar* bound_ptr;
};
struct part_st part[2];
@@ -2377,13 +2402,13 @@ int ha_ndbcluster::set_bounds(NdbIndexScanOperation *op,
{
DBUG_PRINT("info", ("key %d:%d offset: %d length: %d last: %d bound: %d",
j, i, tot_len, part_len, p.part_last, p.bound_type));
- DBUG_DUMP("info", (const char*)p.part_ptr, part_store_len);
+ DBUG_DUMP("info", p.part_ptr, part_store_len);
// Set bound if not cancelled via type -1
if (p.bound_type != -1)
{
- const char* ptr= p.bound_ptr;
- char buf[256];
+ const uchar* ptr= p.bound_ptr;
+ uchar buf[256];
shrink_varchar(field, ptr, buf);
if (op->setBound(i, p.bound_type, ptr))
ERR_RETURN(op->getNdbError());
@@ -2403,7 +2428,7 @@ int ha_ndbcluster::set_bounds(NdbIndexScanOperation *op,
int ha_ndbcluster::ordered_index_scan(const key_range *start_key,
const key_range *end_key,
bool sorted, bool descending,
- byte* buf, part_id_range *part_spec)
+ uchar* buf, part_id_range *part_spec)
{
int res;
bool restart;
@@ -2509,9 +2534,9 @@ guess_scan_flags(NdbOperation::LockMode lm,
*/
int ha_ndbcluster::unique_index_scan(const KEY* key_info,
- const byte *key,
+ const uchar *key,
uint key_len,
- byte *buf)
+ uchar *buf)
{
int res;
NdbScanOperation *op;
@@ -2585,7 +2610,7 @@ int ha_ndbcluster::unique_index_scan(const KEY* key_info,
Start full table scan in NDB
*/
-int ha_ndbcluster::full_table_scan(byte *buf)
+int ha_ndbcluster::full_table_scan(uchar *buf)
{
int res;
NdbScanOperation *op;
@@ -2652,7 +2677,7 @@ int ha_ndbcluster::full_table_scan(byte *buf)
/*
Insert one record into NDB
*/
-int ha_ndbcluster::write_row(byte *record)
+int ha_ndbcluster::write_row(uchar *record)
{
bool has_auto_increment;
uint i;
@@ -2701,7 +2726,7 @@ int ha_ndbcluster::write_row(byte *record)
DBUG_RETURN(peek_res);
}
- statistic_increment(thd->status_var.ha_write_count, &LOCK_status);
+ ha_statistic_increment(&SSV::ha_write_count);
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
table->timestamp_field->set_time();
@@ -2731,18 +2756,25 @@ int ha_ndbcluster::write_row(byte *record)
{
// Table has hidden primary key
Ndb *ndb= get_ndb();
- int ret;
Uint64 auto_value;
uint retries= NDB_AUTO_INCREMENT_RETRIES;
- do {
+ int retry_sleep= 30; /* 30 milliseconds, transaction */
+ for (;;)
+ {
Ndb_tuple_id_range_guard g(m_share);
- ret= ndb->getAutoIncrementValue(m_table, g.range, auto_value, 1);
- } while (ret == -1 &&
- --retries &&
- ndb->getNdbError().status == NdbError::TemporaryError);
- if (ret == -1)
- ERR_RETURN(ndb->getNdbError());
- if (set_hidden_key(op, table_share->fields, (const byte*)&auto_value))
+ if (ndb->getAutoIncrementValue(m_table, g.range, auto_value, 1) == -1)
+ {
+ if (--retries &&
+ ndb->getNdbError().status == NdbError::TemporaryError);
+ {
+ my_sleep(retry_sleep);
+ continue;
+ }
+ ERR_RETURN(ndb->getNdbError());
+ }
+ break;
+ }
+ if (set_hidden_key(op, table_share->fields, (const uchar*)&auto_value))
ERR_RETURN(op->getNdbError());
}
else
@@ -2787,10 +2819,17 @@ int ha_ndbcluster::write_row(byte *record)
if (unlikely(m_slow_path))
{
- if (!(thd->options & OPTION_BIN_LOG))
- op->setAnyValue(NDB_ANYVALUE_FOR_NOLOGGING);
- else if (thd->slave_thread)
+ /*
+ ignore TNTO_NO_LOGGING for slave thd. It is used to indicate
+ log-slave-updates option. This is instead handled in the
+ injector thread, by looking explicitly at the
+ opt_log_slave_updates flag.
+ */
+ Thd_ndb *thd_ndb= get_thd_ndb(thd);
+ if (thd->slave_thread)
op->setAnyValue(thd->server_id);
+ else if (thd_ndb->trans_options & TNTO_NO_LOGGING)
+ op->setAnyValue(NDB_ANYVALUE_FOR_NOLOGGING);
}
m_rows_changed++;
@@ -2863,8 +2902,8 @@ int ha_ndbcluster::write_row(byte *record)
/* Compare if a key in a row has changed */
-int ha_ndbcluster::key_cmp(uint keynr, const byte * old_row,
- const byte * new_row)
+int ha_ndbcluster::key_cmp(uint keynr, const uchar * old_row,
+ const uchar * new_row)
{
KEY_PART_INFO *key_part=table->key_info[keynr].key_part;
KEY_PART_INFO *end=key_part+table->key_info[keynr].key_parts;
@@ -2880,8 +2919,8 @@ int ha_ndbcluster::key_cmp(uint keynr, const byte * old_row,
if (key_part->key_part_flag & (HA_BLOB_PART | HA_VAR_LENGTH_PART))
{
- if (key_part->field->cmp_binary((char*) (old_row + key_part->offset),
- (char*) (new_row + key_part->offset),
+ if (key_part->field->cmp_binary((old_row + key_part->offset),
+ (new_row + key_part->offset),
(ulong) key_part->length))
return 1;
}
@@ -2899,7 +2938,7 @@ int ha_ndbcluster::key_cmp(uint keynr, const byte * old_row,
Update one record in NDB using primary key
*/
-int ha_ndbcluster::update_row(const byte *old_data, byte *new_data)
+int ha_ndbcluster::update_row(const uchar *old_data, uchar *new_data)
{
THD *thd= table->in_use;
NdbTransaction *trans= m_active_trans;
@@ -2918,7 +2957,8 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data)
* If IGNORE the ignore constraint violations on primary and unique keys,
* but check that it is not part of INSERT ... ON DUPLICATE KEY UPDATE
*/
- if (m_ignore_dup_key && thd->lex->sql_command == SQLCOM_UPDATE)
+ if (m_ignore_dup_key && (thd->lex->sql_command == SQLCOM_UPDATE ||
+ thd->lex->sql_command == SQLCOM_UPDATE_MULTI))
{
int peek_res= peek_indexed_rows(new_data, pk_update);
@@ -2930,7 +2970,7 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data)
DBUG_RETURN(peek_res);
}
- statistic_increment(thd->status_var.ha_update_count, &LOCK_status);
+ ha_statistic_increment(&SSV::ha_update_count);
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
{
table->timestamp_field->set_time();
@@ -2984,7 +3024,7 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data)
{
// Undo delete_row(old_data)
m_primary_key_update= TRUE;
- undo_res= write_row((byte *)old_data);
+ undo_res= write_row((uchar *)old_data);
if (undo_res)
push_warning(current_thd,
MYSQL_ERROR::WARN_LEVEL_WARN,
@@ -3075,10 +3115,17 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data)
if (unlikely(m_slow_path))
{
- if (!(thd->options & OPTION_BIN_LOG))
- op->setAnyValue(NDB_ANYVALUE_FOR_NOLOGGING);
- else if (thd->slave_thread)
+ /*
+ ignore TNTO_NO_LOGGING for slave thd. It is used to indicate
+ log-slave-updates option. This is instead handled in the
+ injector thread, by looking explicitly at the
+ opt_log_slave_updates flag.
+ */
+ Thd_ndb *thd_ndb= get_thd_ndb(thd);
+ if (thd->slave_thread)
op->setAnyValue(thd->server_id);
+ else if (thd_ndb->trans_options & TNTO_NO_LOGGING)
+ op->setAnyValue(NDB_ANYVALUE_FOR_NOLOGGING);
}
/*
Execute update operation if we are not doing a scan for update
@@ -3099,7 +3146,7 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data)
Delete one record from NDB, using primary key
*/
-int ha_ndbcluster::delete_row(const byte *record)
+int ha_ndbcluster::delete_row(const uchar *record)
{
THD *thd= table->in_use;
NdbTransaction *trans= m_active_trans;
@@ -3110,7 +3157,7 @@ int ha_ndbcluster::delete_row(const byte *record)
DBUG_ENTER("delete_row");
m_write_op= TRUE;
- statistic_increment(thd->status_var.ha_delete_count,&LOCK_status);
+ ha_statistic_increment(&SSV::ha_delete_count);
m_rows_changed++;
if (m_use_partition_function &&
@@ -3142,12 +3189,19 @@ int ha_ndbcluster::delete_row(const byte *record)
if (unlikely(m_slow_path))
{
- if (!(thd->options & OPTION_BIN_LOG))
- ((NdbOperation *)trans->getLastDefinedOperation())->
- setAnyValue(NDB_ANYVALUE_FOR_NOLOGGING);
- else if (thd->slave_thread)
+ /*
+ ignore TNTO_NO_LOGGING for slave thd. It is used to indicate
+ log-slave-updates option. This is instead handled in the
+ injector thread, by looking explicitly at the
+ opt_log_slave_updates flag.
+ */
+ Thd_ndb *thd_ndb= get_thd_ndb(thd);
+ if (thd->slave_thread)
((NdbOperation *)trans->getLastDefinedOperation())->
setAnyValue(thd->server_id);
+ else if (thd_ndb->trans_options & TNTO_NO_LOGGING)
+ ((NdbOperation *)trans->getLastDefinedOperation())->
+ setAnyValue(NDB_ANYVALUE_FOR_NOLOGGING);
}
if (!(m_primary_key_update || m_delete_cannot_batch))
// If deleting from cursor, NoCommit will be handled in next_result
@@ -3181,10 +3235,17 @@ int ha_ndbcluster::delete_row(const byte *record)
if (unlikely(m_slow_path))
{
- if (!(thd->options & OPTION_BIN_LOG))
- op->setAnyValue(NDB_ANYVALUE_FOR_NOLOGGING);
- else if (thd->slave_thread)
+ /*
+ ignore TNTO_NO_LOGGING for slave thd. It is used to indicate
+ log-slave-updates option. This is instead handled in the
+ injector thread, by looking explicitly at the
+ opt_log_slave_updates flag.
+ */
+ Thd_ndb *thd_ndb= get_thd_ndb(thd);
+ if (thd->slave_thread)
op->setAnyValue(thd->server_id);
+ else if (thd_ndb->trans_options & TNTO_NO_LOGGING)
+ op->setAnyValue(NDB_ANYVALUE_FOR_NOLOGGING);
}
}
@@ -3211,7 +3272,7 @@ int ha_ndbcluster::delete_row(const byte *record)
*/
void ndb_unpack_record(TABLE *table, NdbValue *value,
- MY_BITMAP *defined, byte *buf)
+ MY_BITMAP *defined, uchar *buf)
{
Field **p_field= table->field, *field= *p_field;
my_ptrdiff_t row_offset= (my_ptrdiff_t) (buf - table->record[0]);
@@ -3298,13 +3359,13 @@ void ndb_unpack_record(TABLE *table, NdbValue *value,
field_bit->Field_bit::move_field_offset(-row_offset);
DBUG_PRINT("info",("[%u] SET",
(*value).rec->getColumn()->getColumnNo()));
- DBUG_DUMP("info", (const char*) field->ptr, field->pack_length());
+ DBUG_DUMP("info", field->ptr, field->pack_length());
}
else
{
DBUG_PRINT("info",("[%u] SET",
(*value).rec->getColumn()->getColumnNo()));
- DBUG_DUMP("info", (const char*) field->ptr, field->pack_length());
+ DBUG_DUMP("info", field->ptr, field->pack_length());
}
}
else
@@ -3328,7 +3389,7 @@ void ndb_unpack_record(TABLE *table, NdbValue *value,
#ifndef DBUG_OFF
// pointer vas set in get_ndb_blobs_value
Field_blob *field_blob= (Field_blob*)field;
- char* ptr;
+ uchar *ptr;
field_blob->get_ptr(&ptr, row_offset);
uint32 len= field_blob->get_length(row_offset);
DBUG_PRINT("info",("[%u] SET ptr: 0x%lx len: %u",
@@ -3342,7 +3403,7 @@ void ndb_unpack_record(TABLE *table, NdbValue *value,
DBUG_VOID_RETURN;
}
-void ha_ndbcluster::unpack_record(byte *buf)
+void ha_ndbcluster::unpack_record(uchar *buf)
{
ndb_unpack_record(table, m_value, 0, buf);
#ifndef DBUG_OFF
@@ -3455,10 +3516,10 @@ int ha_ndbcluster::index_end()
*/
static
int
-check_null_in_key(const KEY* key_info, const byte *key, uint key_len)
+check_null_in_key(const KEY* key_info, const uchar *key, uint key_len)
{
KEY_PART_INFO *curr_part, *end_part;
- const byte* end_ptr= key + key_len;
+ const uchar* end_ptr= key + key_len;
curr_part= key_info->key_part;
end_part= curr_part + key_info->key_parts;
@@ -3472,8 +3533,8 @@ check_null_in_key(const KEY* key_info, const byte *key, uint key_len)
return 0;
}
-int ha_ndbcluster::index_read(byte *buf,
- const byte *key, uint key_len,
+int ha_ndbcluster::index_read(uchar *buf,
+ const uchar *key, uint key_len,
enum ha_rkey_function find_flag)
{
key_range start_key;
@@ -3501,29 +3562,26 @@ int ha_ndbcluster::index_read(byte *buf,
}
-int ha_ndbcluster::index_next(byte *buf)
+int ha_ndbcluster::index_next(uchar *buf)
{
DBUG_ENTER("ha_ndbcluster::index_next");
- statistic_increment(current_thd->status_var.ha_read_next_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_next_count);
DBUG_RETURN(next_result(buf));
}
-int ha_ndbcluster::index_prev(byte *buf)
+int ha_ndbcluster::index_prev(uchar *buf)
{
DBUG_ENTER("ha_ndbcluster::index_prev");
- statistic_increment(current_thd->status_var.ha_read_prev_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_prev_count);
DBUG_RETURN(next_result(buf));
}
-int ha_ndbcluster::index_first(byte *buf)
+int ha_ndbcluster::index_first(uchar *buf)
{
DBUG_ENTER("ha_ndbcluster::index_first");
- statistic_increment(current_thd->status_var.ha_read_first_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_first_count);
// Start the ordered index scan and fetch the first row
// Only HA_READ_ORDER indexes get called by index_first
@@ -3531,14 +3589,14 @@ int ha_ndbcluster::index_first(byte *buf)
}
-int ha_ndbcluster::index_last(byte *buf)
+int ha_ndbcluster::index_last(uchar *buf)
{
DBUG_ENTER("ha_ndbcluster::index_last");
- statistic_increment(current_thd->status_var.ha_read_last_count,&LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_last_count);
DBUG_RETURN(ordered_index_scan(0, 0, TRUE, TRUE, buf, NULL));
}
-int ha_ndbcluster::index_read_last(byte * buf, const byte * key, uint key_len)
+int ha_ndbcluster::index_read_last(uchar * buf, const uchar * key, uint key_len)
{
DBUG_ENTER("ha_ndbcluster::index_read_last");
DBUG_RETURN(index_read(buf, key, key_len, HA_READ_PREFIX_LAST));
@@ -3547,7 +3605,7 @@ int ha_ndbcluster::index_read_last(byte * buf, const byte * key, uint key_len)
int ha_ndbcluster::read_range_first_to_buf(const key_range *start_key,
const key_range *end_key,
bool desc, bool sorted,
- byte* buf)
+ uchar* buf)
{
part_id_range part_spec;
ndb_index_type type= get_index_type(active_index);
@@ -3627,7 +3685,7 @@ int ha_ndbcluster::read_range_first(const key_range *start_key,
const key_range *end_key,
bool eq_r, bool sorted)
{
- byte* buf= table->record[0];
+ uchar* buf= table->record[0];
DBUG_ENTER("ha_ndbcluster::read_range_first");
DBUG_RETURN(read_range_first_to_buf(start_key, end_key, FALSE,
sorted, buf));
@@ -3717,11 +3775,10 @@ int ha_ndbcluster::rnd_end()
}
-int ha_ndbcluster::rnd_next(byte *buf)
+int ha_ndbcluster::rnd_next(uchar *buf)
{
DBUG_ENTER("rnd_next");
- statistic_increment(current_thd->status_var.ha_read_rnd_next_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_rnd_next_count);
if (!m_active_cursor)
DBUG_RETURN(full_table_scan(buf));
@@ -3736,11 +3793,10 @@ int ha_ndbcluster::rnd_next(byte *buf)
again
*/
-int ha_ndbcluster::rnd_pos(byte *buf, byte *pos)
+int ha_ndbcluster::rnd_pos(uchar *buf, uchar *pos)
{
DBUG_ENTER("rnd_pos");
- statistic_increment(current_thd->status_var.ha_read_rnd_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_rnd_count);
// The primary key for the record is stored in pos
// Perform a pk_read using primary key "index"
{
@@ -3754,7 +3810,7 @@ int ha_ndbcluster::rnd_pos(byte *buf, byte *pos)
The partition id has been fetched from ndb
and has been stored directly after the hidden key
*/
- DBUG_DUMP("key+part", (char *)pos, key_length);
+ DBUG_DUMP("key+part", pos, key_length);
key_length= ref_length - sizeof(m_part_id);
part_spec.start_part= part_spec.end_part= *(uint32 *)(pos + key_length);
}
@@ -3771,7 +3827,7 @@ int ha_ndbcluster::rnd_pos(byte *buf, byte *pos)
}
DBUG_PRINT("info", ("partition id %u", part_spec.start_part));
}
- DBUG_DUMP("key", (char *)pos, key_length);
+ DBUG_DUMP("key", pos, key_length);
DBUG_RETURN(pk_read(pos, key_length, buf, part_spec.start_part));
}
}
@@ -3783,12 +3839,12 @@ int ha_ndbcluster::rnd_pos(byte *buf, byte *pos)
using "reference" in rnd_pos
*/
-void ha_ndbcluster::position(const byte *record)
+void ha_ndbcluster::position(const uchar *record)
{
KEY *key_info;
KEY_PART_INFO *key_part;
KEY_PART_INFO *end;
- byte *buff;
+ uchar *buff;
uint key_length;
DBUG_ENTER("position");
@@ -3814,7 +3870,7 @@ void ha_ndbcluster::position(const byte *record)
}
size_t len = key_part->length;
- const byte * ptr = record + key_part->offset;
+ const uchar * ptr = record + key_part->offset;
Field *field = key_part->field;
if (field->type() == MYSQL_TYPE_VARCHAR)
{
@@ -3865,9 +3921,9 @@ void ha_ndbcluster::position(const byte *record)
}
#ifndef DBUG_OFF
if (table_share->primary_key == MAX_KEY && m_use_partition_function)
- DBUG_DUMP("key+part", (char*)ref, key_length+sizeof(m_part_id));
+ DBUG_DUMP("key+part", ref, key_length+sizeof(m_part_id));
#endif
- DBUG_DUMP("ref", (char*)ref, key_length);
+ DBUG_DUMP("ref", ref, key_length);
DBUG_VOID_RETURN;
}
@@ -3935,6 +3991,8 @@ int ha_ndbcluster::info(uint flag)
DBUG_PRINT("info", ("HA_STATUS_AUTO"));
if (m_table && table->found_next_number_field)
{
+ if ((my_errno= check_ndb_connection()))
+ DBUG_RETURN(my_errno);
Ndb *ndb= get_ndb();
Ndb_tuple_id_range_guard g(m_share);
@@ -4262,11 +4320,9 @@ THR_LOCK_DATA **ha_ndbcluster::store_lock(THD *thd,
*/
#ifdef HAVE_NDB_BINLOG
-extern MASTER_INFO *active_mi;
+extern Master_info *active_mi;
static int ndbcluster_update_apply_status(THD *thd, int do_update)
{
- return 0;
-
Thd_ndb *thd_ndb= get_thd_ndb(thd);
Ndb *ndb= thd_ndb->ndb;
NDBDICT *dict= ndb->getDictionary();
@@ -4343,7 +4399,7 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type)
{
m_transaction_on= FALSE;
/* Would be simpler if has_transactions() didn't always say "yes" */
- thd->no_trans_update.all= thd->no_trans_update.stmt= TRUE;
+ thd->transaction.all.modified_non_trans_table= thd->transaction.stmt.modified_non_trans_table= TRUE;
}
else if (!thd->transaction.on)
m_transaction_on= FALSE;
@@ -4360,14 +4416,22 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type)
trans= ndb->startTransaction();
if (trans == NULL)
+ {
+ thd_ndb->lock_count= 0;
ERR_RETURN(ndb->getNdbError());
+ }
thd_ndb->init_open_tables();
thd_ndb->stmt= trans;
thd_ndb->query_state&= NDB_QUERY_NORMAL;
thd_ndb->trans_options= 0;
thd_ndb->m_slow_path= FALSE;
- if (thd->slave_thread ||
- !(thd->options & OPTION_BIN_LOG))
+ if (!(thd->options & OPTION_BIN_LOG) ||
+ thd->variables.binlog_format == BINLOG_FORMAT_STMT)
+ {
+ thd_ndb->trans_options|= TNTO_NO_LOGGING;
+ thd_ndb->m_slow_path= TRUE;
+ }
+ else if (thd->slave_thread)
thd_ndb->m_slow_path= TRUE;
trans_register_ha(thd, FALSE, ndbcluster_hton);
}
@@ -4381,14 +4445,22 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type)
trans= ndb->startTransaction();
if (trans == NULL)
+ {
+ thd_ndb->lock_count= 0;
ERR_RETURN(ndb->getNdbError());
+ }
thd_ndb->init_open_tables();
thd_ndb->all= trans;
thd_ndb->query_state&= NDB_QUERY_NORMAL;
thd_ndb->trans_options= 0;
thd_ndb->m_slow_path= FALSE;
- if (thd->slave_thread ||
- !(thd->options & OPTION_BIN_LOG))
+ if (!(thd->options & OPTION_BIN_LOG) ||
+ thd->variables.binlog_format == BINLOG_FORMAT_STMT)
+ {
+ thd_ndb->trans_options|= TNTO_NO_LOGGING;
+ thd_ndb->m_slow_path= TRUE;
+ }
+ else if (thd->slave_thread)
thd_ndb->m_slow_path= TRUE;
trans_register_ha(thd, TRUE, ndbcluster_hton);
@@ -4507,7 +4579,6 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type)
DBUG_PRINT("warning", ("ops_pending != 0L"));
m_ops_pending= 0;
}
- thd->set_current_stmt_binlog_row_based_if_mixed();
DBUG_RETURN(error);
}
@@ -4557,7 +4628,6 @@ int ha_ndbcluster::start_stmt(THD *thd, thr_lock_type lock_type)
m_active_trans= trans;
// Start of statement
m_ops_pending= 0;
- thd->set_current_stmt_binlog_row_based_if_mixed();
DBUG_RETURN(error);
}
@@ -4595,7 +4665,7 @@ static int ndbcluster_commit(handlerton *hton, THD *thd, bool all)
{
const NdbError err= trans->getNdbError();
const NdbOperation *error_op= trans->getNdbErrorOperation();
- ERR_PRINT(err);
+ set_ndb_err(thd, err);
res= ndb_to_mysql_error(&err);
if (res != -1)
ndbcluster_print_error(res, error_op);
@@ -4646,7 +4716,7 @@ static int ndbcluster_rollback(handlerton *hton, THD *thd, bool all)
{
const NdbError err= trans->getNdbError();
const NdbOperation *error_op= trans->getNdbErrorOperation();
- ERR_PRINT(err);
+ set_ndb_err(thd, err);
res= ndb_to_mysql_error(&err);
if (res != -1)
ndbcluster_print_error(res, error_op);
@@ -4970,8 +5040,9 @@ int ha_ndbcluster::create(const char *name,
THD *thd= current_thd;
NDBTAB tab;
NDBCOL col;
- uint pack_length, length, i, pk_length= 0;
- const void *data= NULL, *pack_data= NULL;
+ size_t pack_length, length;
+ uint i, pk_length= 0;
+ uchar *data= NULL, *pack_data= NULL;
bool create_from_engine= (create_info->table_options & HA_OPTION_CREATE_FROM_ENGINE);
bool is_truncate= (thd->lex->sql_command == SQLCOM_TRUNCATE);
char tablespace[FN_LEN];
@@ -5055,7 +5126,9 @@ int ha_ndbcluster::create(const char *name,
my_free((char*)data, MYF(0));
DBUG_RETURN(2);
}
- DBUG_PRINT("info", ("setFrm data: 0x%lx len: %d", (long) pack_data, pack_length));
+ DBUG_PRINT("info",
+ ("setFrm data: 0x%lx len: %lu", (long) pack_data,
+ (ulong) pack_length));
tab.setFrm(pack_data, pack_length);
my_free((char*)data, MYF(0));
my_free((char*)pack_data, MYF(0));
@@ -5228,7 +5301,7 @@ int ha_ndbcluster::create(const char *name,
if (dict->createTable(tab) != 0)
{
const NdbError err= dict->getNdbError();
- ERR_PRINT(err);
+ set_ndb_err(thd, err);
my_errno= ndb_to_mysql_error(&err);
DBUG_RETURN(my_errno);
}
@@ -5242,7 +5315,7 @@ int ha_ndbcluster::create(const char *name,
{
/* purecov: begin deadcode */
const NdbError err= dict->getNdbError();
- ERR_PRINT(err);
+ set_ndb_err(thd, err);
my_errno= ndb_to_mysql_error(&err);
DBUG_RETURN(my_errno);
/* purecov: end */
@@ -5290,7 +5363,7 @@ int ha_ndbcluster::create(const char *name,
{
uint length= (uint) strlen(name);
if ((share= (NDB_SHARE*) hash_search(&ndbcluster_open_tables,
- (byte*) name, length)))
+ (uchar*) name, length)))
handle_trailing_share(share);
}
/*
@@ -5369,8 +5442,8 @@ int ha_ndbcluster::create_handler_files(const char *file,
{
Ndb* ndb;
const NDBTAB *tab;
- const void *data= NULL, *pack_data= NULL;
- uint length, pack_length;
+ uchar *data= NULL, *pack_data= NULL;
+ size_t length, pack_length;
int error= 0;
DBUG_ENTER("create_handler_files");
@@ -5414,6 +5487,7 @@ int ha_ndbcluster::create_handler_files(const char *file,
new_tab.setFrm(pack_data, pack_length);
if (dict->alterTableGlobal(*tab, new_tab))
{
+ set_ndb_err(current_thd, dict->getNdbError());
error= ndb_to_mysql_error(&dict->getNdbError());
}
my_free((char*)data, MYF(MY_ALLOW_ZERO_PTR));
@@ -5889,6 +5963,7 @@ retry_temporary_error1:
default:
break;
}
+ set_ndb_err(thd, dict->getNdbError());
res= ndb_to_mysql_error(&dict->getNdbError());
DBUG_PRINT("info", ("error(1) %u", res));
}
@@ -5928,6 +6003,7 @@ retry_temporary_error1:
}
}
}
+ set_ndb_err(thd, dict->getNdbError());
res= ndb_to_mysql_error(&dict->getNdbError());
DBUG_PRINT("info", ("error(2) %u", res));
break;
@@ -6052,7 +6128,7 @@ void ha_ndbcluster::get_auto_increment(ulonglong offset, ulonglong increment,
ulonglong nb_desired_values,
ulonglong *first_value,
ulonglong *nb_reserved_values)
-{
+{
int cache_size;
Uint64 auto_value;
DBUG_ENTER("get_auto_increment");
@@ -6069,24 +6145,28 @@ void ha_ndbcluster::get_auto_increment(ulonglong offset, ulonglong increment,
m_rows_to_insert - m_rows_inserted :
((m_rows_to_insert > m_autoincrement_prefetch) ?
m_rows_to_insert : m_autoincrement_prefetch));
- int ret;
uint retries= NDB_AUTO_INCREMENT_RETRIES;
- do {
+ int retry_sleep= 30; /* 30 milliseconds, transaction */
+ for (;;)
+ {
Ndb_tuple_id_range_guard g(m_share);
- ret=
- m_skip_auto_increment ?
- ndb->readAutoIncrementValue(m_table, g.range, auto_value) :
- ndb->getAutoIncrementValue(m_table, g.range, auto_value, cache_size);
- } while (ret == -1 &&
- --retries &&
- ndb->getNdbError().status == NdbError::TemporaryError);
- if (ret == -1)
- {
- const NdbError err= ndb->getNdbError();
- sql_print_error("Error %lu in ::get_auto_increment(): %s",
- (ulong) err.code, err.message);
- *first_value= ~(ulonglong) 0;
- DBUG_VOID_RETURN;
+ if (m_skip_auto_increment &&
+ ndb->readAutoIncrementValue(m_table, g.range, auto_value) ||
+ ndb->getAutoIncrementValue(m_table, g.range, auto_value, cache_size, increment, offset))
+ {
+ if (--retries &&
+ ndb->getNdbError().status == NdbError::TemporaryError);
+ {
+ my_sleep(retry_sleep);
+ continue;
+ }
+ const NdbError err= ndb->getNdbError();
+ sql_print_error("Error %lu in ::get_auto_increment(): %s",
+ (ulong) err.code, err.message);
+ *first_value= ~(ulonglong) 0;
+ DBUG_VOID_RETURN;
+ }
+ break;
}
*first_value= (longlong)auto_value;
/* From the point of view of MySQL, NDB reserves one row at a time */
@@ -6099,6 +6179,11 @@ void ha_ndbcluster::get_auto_increment(ulonglong offset, ulonglong increment,
Constructor for the NDB Cluster table handler
*/
+/*
+ Normal flags for binlogging is that ndb has HA_HAS_OWN_BINLOGGING
+ and preferes HA_BINLOG_ROW_CAPABLE
+ Other flags are set under certain circumstaces in table_flags()
+*/
#define HA_NDBCLUSTER_TABLE_FLAGS \
HA_REC_NOT_IN_SEQ | \
HA_NULL_IN_KEY | \
@@ -6111,6 +6196,7 @@ void ha_ndbcluster::get_auto_increment(ulonglong offset, ulonglong increment,
HA_PRIMARY_KEY_REQUIRED_FOR_DELETE | \
HA_PARTIAL_COLUMN_READ | \
HA_HAS_OWN_BINLOGGING | \
+ HA_BINLOG_ROW_CAPABLE | \
HA_HAS_RECORDS
ha_ndbcluster::ha_ndbcluster(handlerton *hton, TABLE_SHARE *table_arg):
@@ -6268,23 +6354,24 @@ int ha_ndbcluster::open(const char *name, int mode, uint test_if_locked)
set_dbname(name);
set_tabname(name);
- if (check_ndb_connection())
+ if ((res= check_ndb_connection()) ||
+ (res= get_metadata(name)))
{
/* ndb_share reference handler free */
DBUG_PRINT("NDB_SHARE", ("%s handler free use_count: %u",
m_share->key, m_share->use_count));
free_share(&m_share);
m_share= 0;
- DBUG_RETURN(HA_ERR_NO_CONNECTION);
+ DBUG_RETURN(res);
}
-
- res= get_metadata(name);
- if (!res)
+ while (1)
{
Ndb *ndb= get_ndb();
if (ndb->setDatabaseName(m_dbname))
{
- ERR_RETURN(ndb->getNdbError());
+ set_ndb_err(current_thd, ndb->getNdbError());
+ res= ndb_to_mysql_error(&ndb->getNdbError());
+ break;
}
struct Ndb_statistics stat;
res= ndb_get_table_statistics(NULL, FALSE, ndb, m_table, &stat);
@@ -6293,14 +6380,20 @@ int ha_ndbcluster::open(const char *name, int mode, uint test_if_locked)
stats.records= stat.row_count;
if(!res)
res= info(HA_STATUS_CONST);
+ break;
+ }
+ if (res)
+ {
+ free_share(&m_share);
+ m_share= 0;
+ release_metadata(current_thd, get_ndb());
+ DBUG_RETURN(res);
}
-
#ifdef HAVE_NDB_BINLOG
if (!ndb_binlog_tables_inited && ndb_binlog_running)
table->db_stat|= HA_READ_ONLY;
#endif
-
- DBUG_RETURN(res);
+ DBUG_RETURN(0);
}
/*
@@ -6436,13 +6529,13 @@ static int ndbcluster_close_connection(handlerton *hton, THD *thd)
int ndbcluster_discover(handlerton *hton, THD* thd, const char *db,
const char *name,
- const void** frmblob,
- uint* frmlen)
+ uchar **frmblob,
+ size_t *frmlen)
{
int error= 0;
NdbError ndb_error;
- uint len;
- const void* data= NULL;
+ size_t len;
+ uchar* data= NULL;
Ndb* ndb;
char key[FN_REFLEN];
DBUG_ENTER("ndbcluster_discover");
@@ -6503,7 +6596,7 @@ int ndbcluster_discover(handlerton *hton, THD* thd, const char *db,
goto err;
}
- if (unpackfrm(&data, &len, tab->getFrmData()))
+ if (unpackfrm(&data, &len, (uchar*) tab->getFrmData()))
{
DBUG_PRINT("error", ("Could not unpack table"));
error= 1;
@@ -6566,18 +6659,18 @@ int ndbcluster_table_exists_in_engine(handlerton *hton, THD* thd,
if (my_strcasecmp(system_charset_info, elmt.name, name))
continue;
DBUG_PRINT("info", ("Found table"));
- DBUG_RETURN(1);
+ DBUG_RETURN(HA_ERR_TABLE_EXIST);
}
- DBUG_RETURN(0);
+ DBUG_RETURN(HA_ERR_NO_SUCH_TABLE);
}
-extern "C" byte* tables_get_key(const char *entry, uint *length,
+extern "C" uchar* tables_get_key(const char *entry, size_t *length,
my_bool not_used __attribute__((unused)))
{
*length= strlen(entry);
- return (byte*) entry;
+ return (uchar*) entry;
}
@@ -6637,7 +6730,7 @@ int ndbcluster_drop_database_impl(const char *path)
const NdbError err= dict->getNdbError();
if (err.code != 709 && err.code != 723)
{
- ERR_PRINT(err);
+ set_ndb_err(thd, err);
ret= ndb_to_mysql_error(&err);
}
}
@@ -6679,7 +6772,7 @@ int ndb_create_table_from_engine(THD *thd, const char *db,
LEX *old_lex= thd->lex, newlex;
thd->lex= &newlex;
newlex.current_select= NULL;
- lex_start(thd, "", 0);
+ lex_start(thd);
int res= ha_create_table_from_engine(thd, db, table_name);
thd->lex= old_lex;
return res;
@@ -6758,8 +6851,8 @@ int ndbcluster_find_all_files(THD *thd)
/* finalize construction of path */
end+= tablename_to_filename(elmt.name, end,
sizeof(key)-(end-key));
- const void *data= 0, *pack_data= 0;
- uint length, pack_length;
+ uchar *data= 0, *pack_data= 0;
+ size_t length, pack_length;
int discover= 0;
if (readfrm(key, &data, &length) ||
packfrm(data, length, &pack_data, &pack_length))
@@ -6823,7 +6916,7 @@ int ndbcluster_find_all_files(THD *thd)
int ndbcluster_find_files(handlerton *hton, THD *thd,
const char *db,
const char *path,
- const char *wild, bool dir, List<char> *files)
+ const char *wild, bool dir, List<LEX_STRING> *files)
{
DBUG_ENTER("ndbcluster_find_files");
DBUG_PRINT("enter", ("db: %s", db));
@@ -6887,24 +6980,42 @@ int ndbcluster_find_files(handlerton *hton, THD *thd,
continue;
}
DBUG_PRINT("info", ("Inserting %s into ndb_tables hash", elmt.name));
- my_hash_insert(&ndb_tables, (byte*)thd->strdup(elmt.name));
+ my_hash_insert(&ndb_tables, (uchar*)thd->strdup(elmt.name));
}
- char *file_name;
- List_iterator<char> it(*files);
+ LEX_STRING *file_name;
+ List_iterator<LEX_STRING> it(*files);
List<char> delete_list;
+ char *file_name_str;
while ((file_name=it++))
{
bool file_on_disk= FALSE;
- DBUG_PRINT("info", ("%s", file_name));
- if (hash_search(&ndb_tables, file_name, strlen(file_name)))
+ DBUG_PRINT("info", ("%s", file_name->str));
+ if (hash_search(&ndb_tables, (uchar*) file_name->str, file_name->length))
{
- DBUG_PRINT("info", ("%s existed in NDB _and_ on disk ", file_name));
+ build_table_filename(name, sizeof(name), db, file_name->str, reg_ext, 0);
+ if (my_access(name, F_OK))
+ {
+ pthread_mutex_lock(&LOCK_open);
+ DBUG_PRINT("info", ("Table %s listed and need discovery",
+ file_name->str));
+ if (ndb_create_table_from_engine(thd, db, file_name->str))
+ {
+ pthread_mutex_unlock(&LOCK_open);
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_TABLE_EXISTS_ERROR,
+ "Discover of table %s.%s failed",
+ db, file_name->str);
+ continue;
+ }
+ pthread_mutex_unlock(&LOCK_open);
+ }
+ DBUG_PRINT("info", ("%s existed in NDB _and_ on disk ", file_name->str));
file_on_disk= TRUE;
}
// Check for .ndb file with this name
- build_table_filename(name, sizeof(name), db, file_name, ha_ndb_ext, 0);
+ build_table_filename(name, sizeof(name), db, file_name->str, ha_ndb_ext, 0);
DBUG_PRINT("info", ("Check access for %s", name));
if (my_access(name, F_OK))
{
@@ -6912,32 +7023,34 @@ int ndbcluster_find_files(handlerton *hton, THD *thd,
// .ndb file did not exist on disk, another table type
if (file_on_disk)
{
- // Ignore this ndb table
- gptr record= hash_search(&ndb_tables, file_name, strlen(file_name));
+ // Ignore this ndb table
+ uchar *record= hash_search(&ndb_tables, (uchar*) file_name->str,
+ file_name->length);
DBUG_ASSERT(record);
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",
- db, file_name);
+ db, file_name->str);
}
continue;
}
if (file_on_disk)
{
// File existed in NDB and as frm file, put in ok_tables list
- my_hash_insert(&ok_tables, (byte*)file_name);
+ my_hash_insert(&ok_tables, (uchar*) file_name->str);
continue;
}
DBUG_PRINT("info", ("%s existed on disk", name));
// The .ndb file exists on disk, but it's not in list of tables in ndb
// Verify that handler agrees table is gone.
- if (ndbcluster_table_exists_in_engine(hton, thd, db, file_name) == 0)
+ if (ndbcluster_table_exists_in_engine(hton, thd, db, file_name->str) ==
+ HA_ERR_NO_SUCH_TABLE)
{
- DBUG_PRINT("info", ("NDB says %s does not exists", file_name));
+ DBUG_PRINT("info", ("NDB says %s does not exists", file_name->str));
it.remove();
// Put in list of tables to remove from disk
- delete_list.push_back(thd->strdup(file_name));
+ delete_list.push_back(thd->strdup(file_name->str));
}
}
@@ -6948,12 +7061,12 @@ int ndbcluster_find_files(handlerton *hton, THD *thd,
build_table_filename(name, sizeof(name), db, "", "", 0);
for (i= 0; i < ok_tables.records; i++)
{
- file_name= (char*)hash_element(&ok_tables, i);
+ file_name_str= (char*)hash_element(&ok_tables, i);
end= end1 +
- tablename_to_filename(file_name, end1, sizeof(name) - (end1 - name));
+ tablename_to_filename(file_name_str, end1, sizeof(name) - (end1 - name));
pthread_mutex_lock(&LOCK_open);
ndbcluster_create_binlog_setup(ndb, name, end-name,
- db, file_name, TRUE);
+ db, file_name_str, TRUE);
pthread_mutex_unlock(&LOCK_open);
}
}
@@ -6964,56 +7077,60 @@ int ndbcluster_find_files(handlerton *hton, THD *thd,
List<char> create_list;
for (i= 0 ; i < ndb_tables.records ; i++)
{
- file_name= hash_element(&ndb_tables, i);
- if (!hash_search(&ok_tables, file_name, strlen(file_name)))
+ file_name_str= (char*) hash_element(&ndb_tables, i);
+ if (!hash_search(&ok_tables, (uchar*) file_name_str, strlen(file_name_str)))
{
- build_table_filename(name, sizeof(name), db, file_name, reg_ext, 0);
+ build_table_filename(name, sizeof(name), db, file_name_str, reg_ext, 0);
if (my_access(name, F_OK))
{
- DBUG_PRINT("info", ("%s must be discovered", file_name));
+ DBUG_PRINT("info", ("%s must be discovered", file_name_str));
// File is in list of ndb tables and not in ok_tables
// This table need to be created
- create_list.push_back(thd->strdup(file_name));
+ create_list.push_back(thd->strdup(file_name_str));
}
}
}
- // Lock mutex before deleting and creating frm files
- pthread_mutex_lock(&LOCK_open);
-
if (!global_read_lock)
{
// Delete old files
List_iterator_fast<char> it3(delete_list);
- while ((file_name=it3++))
+ while ((file_name_str= it3++))
{
- DBUG_PRINT("info", ("Remove table %s/%s", db, file_name));
+ DBUG_PRINT("info", ("Remove table %s/%s", db, file_name_str));
// Delete the table and all related files
TABLE_LIST table_list;
bzero((char*) &table_list,sizeof(table_list));
table_list.db= (char*) db;
- table_list.alias= table_list.table_name= (char*)file_name;
+ table_list.alias= table_list.table_name= (char*)file_name_str;
(void)mysql_rm_table_part2(thd, &table_list,
- /* if_exists */ FALSE,
- /* drop_temporary */ FALSE,
- /* drop_view */ FALSE,
- /* dont_log_query*/ TRUE);
+ FALSE, /* if_exists */
+ FALSE, /* drop_temporary */
+ FALSE, /* drop_view */
+ TRUE /* dont_log_query*/);
+
/* Clear error message that is returned when table is deleted */
thd->clear_error();
}
}
+ pthread_mutex_lock(&LOCK_open);
// Create new files
List_iterator_fast<char> it2(create_list);
- while ((file_name=it2++))
+ while ((file_name_str=it2++))
{
- DBUG_PRINT("info", ("Table %s need discovery", file_name));
- if (ndb_create_table_from_engine(thd, db, file_name) == 0)
- files->push_back(thd->strdup(file_name));
+ DBUG_PRINT("info", ("Table %s need discovery", file_name_str));
+ if (ndb_create_table_from_engine(thd, db, file_name_str) == 0)
+ {
+ LEX_STRING *tmp_file_name= 0;
+ tmp_file_name= thd->make_lex_string(tmp_file_name, file_name_str,
+ strlen(file_name_str), TRUE);
+ files->push_back(tmp_file_name);
+ }
}
pthread_mutex_unlock(&LOCK_open);
-
+
hash_free(&ok_tables);
hash_free(&ndb_tables);
@@ -7023,8 +7140,8 @@ int ndbcluster_find_files(handlerton *hton, THD *thd,
uint count = 0;
while (count++ < files->elements)
{
- file_name = (char *)files->pop();
- if (!strcmp(file_name, NDB_SCHEMA_TABLE))
+ file_name = (LEX_STRING *)files->pop();
+ if (!strcmp(file_name->str, NDB_SCHEMA_TABLE))
{
DBUG_PRINT("info", ("skip %s.%s table, it should be hidden to user",
NDB_REP_DB, NDB_SCHEMA_TABLE));
@@ -7061,6 +7178,7 @@ static int connect_callback()
}
extern int ndb_dictionary_is_mysqld;
+extern pthread_mutex_t LOCK_plugin;
static int ndbcluster_init(void *p)
{
@@ -7070,6 +7188,13 @@ static int ndbcluster_init(void *p)
if (ndbcluster_inited)
DBUG_RETURN(FALSE);
+ /*
+ Below we create new THD's. They'll need LOCK_plugin, but it's taken now by
+ plugin initialization code. Release it to avoid deadlocks. It's safe, as
+ there're no threads that may concurrently access plugin control structures.
+ */
+ pthread_mutex_unlock(&LOCK_plugin);
+
pthread_mutex_init(&ndbcluster_mutex,MY_MUTEX_INIT_FAST);
pthread_mutex_init(&LOCK_ndb_util_thread, MY_MUTEX_INIT_FAST);
pthread_cond_init(&COND_ndb_util_thread, NULL);
@@ -7081,7 +7206,7 @@ static int ndbcluster_init(void *p)
{
handlerton *h= ndbcluster_hton;
- h->state= have_ndbcluster;
+ h->state= SHOW_OPTION_YES;
h->db_type= DB_TYPE_NDBCLUSTER;
h->close_connection= ndbcluster_close_connection;
h->commit= ndbcluster_commit;
@@ -7103,9 +7228,6 @@ static int ndbcluster_init(void *p)
h->table_exists_in_engine= ndbcluster_table_exists_in_engine;
}
- if (have_ndbcluster != SHOW_OPTION_YES)
- DBUG_RETURN(0); // nothing else to do
-
// Initialize ndb interface
ndb_init_internal();
@@ -7213,6 +7335,8 @@ static int ndbcluster_init(void *p)
goto ndbcluster_init_error;
}
+ pthread_mutex_lock(&LOCK_plugin);
+
ndbcluster_inited= 1;
DBUG_RETURN(FALSE);
@@ -7223,9 +7347,10 @@ ndbcluster_init_error:
if (g_ndb_cluster_connection)
delete g_ndb_cluster_connection;
g_ndb_cluster_connection= NULL;
- have_ndbcluster= SHOW_OPTION_DISABLED; // If we couldn't use handler
ndbcluster_hton->state= SHOW_OPTION_DISABLED; // If we couldn't use handler
+ pthread_mutex_lock(&LOCK_plugin);
+
DBUG_RETURN(TRUE);
}
@@ -7521,9 +7646,17 @@ ha_ndbcluster::records_in_range(uint inx, key_range *min_key,
ulonglong ha_ndbcluster::table_flags(void) const
{
+ THD *thd= current_thd;
+ ulonglong f= m_table_flags;
if (m_ha_not_exact_count)
- return m_table_flags & ~HA_STATS_RECORDS_IS_EXACT;
- return m_table_flags;
+ f= f & ~HA_STATS_RECORDS_IS_EXACT;
+ /*
+ To allow for logging of ndb tables during stmt based logging;
+ flag cabablity, but also turn off flag for OWN_BINLOGGING
+ */
+ if (thd->variables.binlog_format == BINLOG_FORMAT_STMT)
+ f= (f | HA_BINLOG_STMT_CAPABLE) & ~HA_HAS_OWN_BINLOGGING;
+ return f;
}
const char * ha_ndbcluster::table_type() const
{
@@ -7589,7 +7722,7 @@ uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname,
DBUG_PRINT("enter", ("name: %s", name));
pthread_mutex_lock(&ndbcluster_mutex);
if (!(share=(NDB_SHARE*) hash_search(&ndbcluster_open_tables,
- (byte*) name,
+ (uchar*) name,
strlen(name))))
{
pthread_mutex_unlock(&ndbcluster_mutex);
@@ -7814,11 +7947,11 @@ ha_ndbcluster::register_query_cache_table(THD *thd,
data we want to or can share.
*/
-static byte *ndbcluster_get_key(NDB_SHARE *share,uint *length,
+static uchar *ndbcluster_get_key(NDB_SHARE *share, size_t *length,
my_bool not_used __attribute__((unused)))
{
*length= share->key_length;
- return (byte*) share->key;
+ return (uchar*) share->key;
}
@@ -7944,9 +8077,9 @@ int handle_trailing_share(NDB_SHARE *share)
}
}
- sql_print_error("NDB_SHARE: %s already exists use_count=%d."
- " Moving away for safety, but possible memleak.",
- share->key, share->use_count);
+ sql_print_warning("NDB_SHARE: %s already exists use_count=%d."
+ " Moving away for safety, but possible memleak.",
+ share->key, share->use_count);
dbug_print_open_tables();
/*
@@ -7961,7 +8094,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, (byte*) share);
+ hash_delete(&ndbcluster_open_tables, (uchar*) share);
/*
now give it a new name, just a running number
@@ -7971,7 +8104,7 @@ int handle_trailing_share(NDB_SHARE *share)
const uint min_key_length= 10;
if (share->key_length < min_key_length)
{
- share->key= alloc_root(&share->mem_root, min_key_length + 1);
+ share->key= (char*) alloc_root(&share->mem_root, min_key_length + 1);
share->key_length= min_key_length;
}
share->key_length=
@@ -7979,7 +8112,7 @@ int handle_trailing_share(NDB_SHARE *share)
trailing_share_id++);
}
/* Keep it for possible the future trailing free */
- my_hash_insert(&ndbcluster_open_tables, (byte*) share);
+ my_hash_insert(&ndbcluster_open_tables, (uchar*) share);
DBUG_RETURN(0);
}
@@ -7995,11 +8128,11 @@ static int rename_share(NDB_SHARE *share, const char *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,
- (byte*) new_key, new_length)))
+ (uchar*) new_key, new_length)))
handle_trailing_share(tmp);
/* remove the share from hash */
- hash_delete(&ndbcluster_open_tables, (byte*) share);
+ hash_delete(&ndbcluster_open_tables, (uchar*) share);
dbug_print_open_tables();
/* save old stuff if insert should fail */
@@ -8010,18 +8143,18 @@ static int rename_share(NDB_SHARE *share, const char *new_key)
now allocate and set the new key, db etc
enough space for key, db, and table_name
*/
- share->key= alloc_root(&share->mem_root, 2 * (new_length + 1));
+ share->key= (char*) alloc_root(&share->mem_root, 2 * (new_length + 1));
strmov(share->key, new_key);
share->key_length= new_length;
- if (my_hash_insert(&ndbcluster_open_tables, (byte*) share))
+ if (my_hash_insert(&ndbcluster_open_tables, (uchar*) share))
{
// ToDo free the allocated stuff above?
DBUG_PRINT("error", ("rename_share: my_hash_insert %s failed",
share->key));
share->key= old_key;
share->key_length= old_length;
- if (my_hash_insert(&ndbcluster_open_tables, (byte*) share))
+ if (my_hash_insert(&ndbcluster_open_tables, (uchar*) share))
{
sql_print_error("rename_share: failed to recover %s", share->key);
DBUG_PRINT("error", ("rename_share: my_hash_insert %s failed",
@@ -8101,7 +8234,7 @@ 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,
- (byte*) key,
+ (uchar*) key,
length)))
{
if (!create_if_not_exists)
@@ -8121,13 +8254,13 @@ NDB_SHARE *ndbcluster_get_share(const char *key, TABLE *table,
*root_ptr= &share->mem_root; // remember to reset before return
share->state= NSS_INITIAL;
/* enough space for key, db, and table_name */
- share->key= alloc_root(*root_ptr, 2 * (length + 1));
+ share->key= (char*) alloc_root(*root_ptr, 2 * (length + 1));
share->key_length= length;
strmov(share->key, key);
- if (my_hash_insert(&ndbcluster_open_tables, (byte*) share))
+ if (my_hash_insert(&ndbcluster_open_tables, (uchar*) share))
{
free_root(&share->mem_root, MYF(0));
- my_free((gptr) share, 0);
+ my_free((uchar*) share, 0);
*root_ptr= old_root;
if (!have_lock)
pthread_mutex_unlock(&ndbcluster_mutex);
@@ -8142,7 +8275,15 @@ NDB_SHARE *ndbcluster_get_share(const char *key, TABLE *table,
share->table_name= share->db + strlen(share->db) + 1;
ha_ndbcluster::set_tabname(key, share->table_name);
#ifdef HAVE_NDB_BINLOG
- ndbcluster_binlog_init_share(share, table);
+ if (ndbcluster_binlog_init_share(share, table))
+ {
+ DBUG_PRINT("error", ("get_share: %s could not init share", key));
+ ndbcluster_real_free_share(&share);
+ *root_ptr= old_root;
+ if (!have_lock)
+ pthread_mutex_unlock(&ndbcluster_mutex);
+ DBUG_RETURN(0);
+ }
#endif
*root_ptr= old_root;
}
@@ -8170,7 +8311,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, (byte*) *share);
+ hash_delete(&ndbcluster_open_tables, (uchar*) *share);
thr_lock_delete(&(*share)->lock);
pthread_mutex_destroy(&(*share)->mutex);
@@ -8182,15 +8323,15 @@ void ndbcluster_real_free_share(NDB_SHARE **share)
// (*share)->table_share->mem_root is freed by free_table_share
free_table_share((*share)->table_share);
#ifndef DBUG_OFF
- bzero((gptr)(*share)->table_share, sizeof(*(*share)->table_share));
- bzero((gptr)(*share)->table, sizeof(*(*share)->table));
+ bzero((uchar*)(*share)->table_share, sizeof(*(*share)->table_share));
+ bzero((uchar*)(*share)->table, sizeof(*(*share)->table));
(*share)->table_share= 0;
(*share)->table= 0;
#endif
}
#endif
free_root(&(*share)->mem_root, MYF(0));
- my_free((gptr) *share, MYF(0));
+ my_free((uchar*) *share, MYF(0));
*share= 0;
dbug_print_open_tables();
@@ -8349,6 +8490,7 @@ retry:
my_sleep(retry_sleep);
continue;
}
+ set_ndb_err(current_thd, error);
break;
} while(1);
DBUG_PRINT("exit", ("failed, reterr: %u, NdbError %u(%s)", reterr,
@@ -8415,13 +8557,13 @@ ha_ndbcluster::null_value_index_search(KEY_MULTI_RANGE *ranges,
KEY* key_info= table->key_info + active_index;
KEY_MULTI_RANGE *range= ranges;
ulong reclength= table->s->reclength;
- byte *curr= (byte*)buffer->buffer;
- byte *end_of_buffer= (byte*)buffer->buffer_end;
+ uchar *curr= (uchar*)buffer->buffer;
+ uchar *end_of_buffer= (uchar*)buffer->buffer_end;
for (; range<end_range && curr+reclength <= end_of_buffer;
range++)
{
- const byte *key= range->start_key.key;
+ const uchar *key= range->start_key.key;
uint key_len= range->start_key.length;
if (check_null_in_key(key_info, key, key_len))
DBUG_RETURN(TRUE);
@@ -8452,7 +8594,8 @@ ha_ndbcluster::read_multi_range_first(KEY_MULTI_RANGE **found_range_p,
if (uses_blob_value() ||
(cur_index_type == UNIQUE_INDEX &&
has_null_in_unique_index(active_index) &&
- null_value_index_search(ranges, ranges+range_count, buffer)))
+ null_value_index_search(ranges, ranges+range_count, buffer))
+ || m_delete_cannot_batch || m_update_cannot_batch)
{
m_disable_multi_read= TRUE;
DBUG_RETURN(handler::read_multi_range_first(found_range_p,
@@ -8489,8 +8632,8 @@ ha_ndbcluster::read_multi_range_first(KEY_MULTI_RANGE **found_range_p,
/**
* Variables for loop
*/
- byte *curr= (byte*)buffer->buffer;
- byte *end_of_buffer= (byte*)buffer->buffer_end;
+ uchar *curr= (uchar*)buffer->buffer;
+ uchar *end_of_buffer= (uchar*)buffer->buffer_end;
NdbOperation::LockMode lm=
(NdbOperation::LockMode)get_ndb_lock_type(m_lock.type);
bool need_pk = (lm == NdbOperation::LM_Read);
@@ -8619,7 +8762,7 @@ ha_ndbcluster::read_multi_range_first(KEY_MULTI_RANGE **found_range_p,
* This as we don't want mysqld to reuse the buffer when we read
* the remaining ranges
*/
- buffer->end_of_used_area= (byte*)buffer->buffer_end;
+ buffer->end_of_used_area= (uchar*)buffer->buffer_end;
}
else
{
@@ -8635,7 +8778,7 @@ ha_ndbcluster::read_multi_range_first(KEY_MULTI_RANGE **found_range_p,
{
m_multi_range_defined= multi_range_curr;
multi_range_curr= ranges;
- m_multi_range_result_ptr= (byte*)buffer->buffer;
+ m_multi_range_result_ptr= (uchar*)buffer->buffer;
DBUG_RETURN(read_multi_range_next(found_range_p));
}
ERR_RETURN(m_active_trans->getNdbError());
@@ -8854,7 +8997,7 @@ ha_ndbcluster::update_table_comment(
char *str;
const char *fmt="%s%snumber_of_replicas: %d";
const unsigned fmt_len_plus_extra= length + strlen(fmt);
- if ((str= my_malloc(fmt_len_plus_extra, MYF(0))) == NULL)
+ if ((str= (char*) my_malloc(fmt_len_plus_extra, MYF(0))) == NULL)
{
sql_print_error("ha_ndbcluster::update_table_comment: "
"my_malloc(%u) failed", (unsigned int)fmt_len_plus_extra);
@@ -8903,7 +9046,14 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
my_net_init(&thd->net, 0);
thd->main_security_ctx.master_access= ~0;
thd->main_security_ctx.priv_user = 0;
- thd->current_stmt_binlog_row_based= TRUE; // If in mixed mode
+
+ CHARSET_INFO *charset_connection;
+ charset_connection= get_charset_by_csname("utf8",
+ MY_CS_PRIMARY, MYF(MY_WME));
+ thd->variables.character_set_client= charset_connection;
+ thd->variables.character_set_results= charset_connection;
+ thd->variables.collation_connection= charset_connection;
+ thd->update_charset();
/* Signal successful initialization */
ndb_util_thread_running= 1;
@@ -9245,10 +9395,6 @@ ndbcluster_show_status(handlerton *hton, THD* thd, stat_print_fn *stat_print,
uint buflen;
DBUG_ENTER("ndbcluster_show_status");
- if (have_ndbcluster != SHOW_OPTION_YES)
- {
- DBUG_RETURN(FALSE);
- }
if (stat_type != HA_ENGINE_STATUS)
{
DBUG_RETURN(FALSE);
@@ -9993,7 +10139,7 @@ int ndbcluster_alter_tablespace(handlerton *hton,
ndberror:
err= dict->getNdbError();
ndberror2:
- ERR_PRINT(err);
+ set_ndb_err(thd, err);
ndb_to_mysql_error(&err);
my_error(error, MYF(0), errmsg);
@@ -10066,6 +10212,10 @@ static int ndbcluster_fill_files_table(handlerton *hton,
{
if (ndberr.classification == NdbError::SchemaError)
continue;
+
+ if (ndberr.classification == NdbError::UnknownResultError)
+ continue;
+
ERR_RETURN(ndberr);
}
NdbDictionary::Tablespace ts= dict->getTablespace(df.getTablespace());
@@ -10145,6 +10295,8 @@ static int ndbcluster_fill_files_table(handlerton *hton,
{
if (ndberr.classification == NdbError::SchemaError)
continue;
+ if (ndberr.classification == NdbError::UnknownResultError)
+ continue;
ERR_RETURN(ndberr);
}
NdbDictionary::LogfileGroup lfg=
diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h
index df621ff1938..a6f992226c2 100644
--- a/sql/ha_ndbcluster.h
+++ b/sql/ha_ndbcluster.h
@@ -84,7 +84,7 @@ typedef struct ndb_index_data {
typedef union { const NdbRecAttr *rec; NdbBlob *blob; void *ptr; } NdbValue;
int get_ndb_blobs_value(TABLE* table, NdbValue* value_array,
- byte*& buffer, uint& buffer_size,
+ uchar*& buffer, uint& buffer_size,
my_ptrdiff_t ptrdiff);
typedef enum {
@@ -115,7 +115,7 @@ typedef struct st_ndbcluster_share {
char *old_names; // for rename table
TABLE_SHARE *table_share;
TABLE *table;
- byte *record[2]; // pointer to allocated records for receiving data
+ uchar *record[2]; // pointer to allocated records for receiving data
NdbValue *ndb_value[2];
MY_BITMAP *subscriber_bitmap;
#endif
@@ -178,6 +178,7 @@ enum THD_NDB_OPTIONS
enum THD_NDB_TRANS_OPTIONS
{
TNTO_INJECTED_APPLY_STATUS= 1 << 0
+ ,TNTO_NO_LOGGING= 1 << 1
};
struct Ndb_local_table_statistics {
@@ -207,6 +208,8 @@ class Thd_ndb
NdbTransaction *stmt;
bool m_error;
bool m_slow_path;
+ int m_error_code;
+ uint32 m_query_id; /* query id whn m_error_code was set */
uint32 options;
uint32 trans_options;
List<NDB_SHARE> changed_tables;
@@ -224,30 +227,30 @@ class ha_ndbcluster: public handler
int open(const char *name, int mode, uint test_if_locked);
int close(void);
- int write_row(byte *buf);
- int update_row(const byte *old_data, byte *new_data);
- int delete_row(const byte *buf);
+ int write_row(uchar *buf);
+ int update_row(const uchar *old_data, uchar *new_data);
+ int delete_row(const uchar *buf);
int index_init(uint index, bool sorted);
int index_end();
- int index_read(byte *buf, const byte *key, uint key_len,
+ int index_read(uchar *buf, const uchar *key, uint key_len,
enum ha_rkey_function find_flag);
- int index_next(byte *buf);
- int index_prev(byte *buf);
- int index_first(byte *buf);
- int index_last(byte *buf);
- int index_read_last(byte * buf, const byte * key, uint key_len);
+ int index_next(uchar *buf);
+ int index_prev(uchar *buf);
+ int index_first(uchar *buf);
+ int index_last(uchar *buf);
+ int index_read_last(uchar * buf, const uchar * key, uint key_len);
int rnd_init(bool scan);
int rnd_end();
- int rnd_next(byte *buf);
- int rnd_pos(byte *buf, byte *pos);
- void position(const byte *record);
+ int rnd_next(uchar *buf);
+ int rnd_pos(uchar *buf, uchar *pos);
+ void position(const uchar *record);
int read_range_first(const key_range *start_key,
const key_range *end_key,
bool eq_range, bool sorted);
int read_range_first_to_buf(const key_range *start_key,
const key_range *end_key,
bool eq_range, bool sorted,
- byte* buf);
+ uchar* buf);
int read_range_next();
int alter_tablespace(st_alter_tablespace *info);
@@ -416,56 +419,56 @@ private:
char* get_tablespace_name(THD *thd, char *name, uint name_len);
int set_range_data(void *tab, partition_info* part_info);
int set_list_data(void *tab, partition_info* part_info);
- int complemented_read(const byte *old_data, byte *new_data,
+ int complemented_read(const uchar *old_data, uchar *new_data,
uint32 old_part_id);
- int pk_read(const byte *key, uint key_len, byte *buf, uint32 part_id);
+ int pk_read(const uchar *key, uint key_len, uchar *buf, uint32 part_id);
int ordered_index_scan(const key_range *start_key,
const key_range *end_key,
- bool sorted, bool descending, byte* buf,
+ bool sorted, bool descending, uchar* buf,
part_id_range *part_spec);
- int unique_index_read(const byte *key, uint key_len,
- byte *buf);
+ int unique_index_read(const uchar *key, uint key_len,
+ uchar *buf);
int unique_index_scan(const KEY* key_info,
- const byte *key,
+ const uchar *key,
uint key_len,
- byte *buf);
- int full_table_scan(byte * buf);
+ uchar *buf);
+ int full_table_scan(uchar * buf);
bool check_all_operations_for_error(NdbTransaction *trans,
const NdbOperation *first,
const NdbOperation *last,
uint errcode);
- int peek_indexed_rows(const byte *record, bool check_pk);
+ int peek_indexed_rows(const uchar *record, bool check_pk);
int fetch_next(NdbScanOperation* op);
- int next_result(byte *buf);
- int define_read_attrs(byte* buf, NdbOperation* op);
- int filtered_scan(const byte *key, uint key_len,
- byte *buf,
+ int next_result(uchar *buf);
+ int define_read_attrs(uchar* buf, NdbOperation* op);
+ int filtered_scan(const uchar *key, uint key_len,
+ uchar *buf,
enum ha_rkey_function find_flag);
int close_scan();
- void unpack_record(byte *buf);
+ void unpack_record(uchar *buf);
int get_ndb_lock_type(enum thr_lock_type type);
void set_dbname(const char *pathname);
void set_tabname(const char *pathname);
bool set_hidden_key(NdbOperation*,
- uint fieldnr, const byte* field_ptr);
+ uint fieldnr, const uchar* field_ptr);
int set_ndb_key(NdbOperation*, Field *field,
- uint fieldnr, const byte* field_ptr);
+ uint fieldnr, const uchar* field_ptr);
int set_ndb_value(NdbOperation*, Field *field, uint fieldnr,
int row_offset= 0, bool *set_blob_value= 0);
- int get_ndb_value(NdbOperation*, Field *field, uint fieldnr, byte*);
+ int get_ndb_value(NdbOperation*, Field *field, uint fieldnr, uchar*);
int get_ndb_partition_id(NdbOperation *);
friend int g_get_ndb_blobs_value(NdbBlob *ndb_blob, void *arg);
- int set_primary_key(NdbOperation *op, const byte *key);
- int set_primary_key_from_record(NdbOperation *op, const byte *record);
- int set_index_key_from_record(NdbOperation *op, const byte *record,
+ int set_primary_key(NdbOperation *op, const uchar *key);
+ int set_primary_key_from_record(NdbOperation *op, const uchar *record);
+ int set_index_key_from_record(NdbOperation *op, const uchar *record,
uint keyno);
int set_bounds(NdbIndexScanOperation*, uint inx, bool rir,
const key_range *keys[2], uint= 0);
- int key_cmp(uint keynr, const byte * old_row, const byte * new_row);
- int set_index_key(NdbOperation *, const KEY *key_info, const byte *key_ptr);
+ int key_cmp(uint keynr, const uchar * old_row, const uchar * new_row);
+ int set_index_key(NdbOperation *, const KEY *key_info, const uchar *key_ptr);
void print_results();
virtual void get_auto_increment(ulonglong offset, ulonglong increment,
@@ -508,10 +511,10 @@ private:
THD_NDB_SHARE *m_thd_ndb_share;
// NdbRecAttr has no reference to blob
NdbValue m_value[NDB_MAX_ATTRIBUTES_IN_TABLE];
- byte m_ref[NDB_HIDDEN_PRIMARY_KEY_LENGTH];
+ uchar m_ref[NDB_HIDDEN_PRIMARY_KEY_LENGTH];
partition_info *m_part_info;
uint32 m_part_id;
- byte *m_rec0;
+ uchar *m_rec0;
Field **m_part_field_array;
bool m_use_partition_function;
bool m_sorted;
@@ -534,7 +537,7 @@ private:
bool m_slow_path;
my_ptrdiff_t m_blobs_offset;
// memory for blobs in one tuple
- char *m_blobs_buffer;
+ uchar *m_blobs_buffer;
uint32 m_blobs_buffer_size;
uint m_dupkey;
// set from thread variables at external lock
@@ -545,12 +548,12 @@ private:
ha_ndbcluster_cond *m_cond;
bool m_disable_multi_read;
- byte *m_multi_range_result_ptr;
+ uchar *m_multi_range_result_ptr;
KEY_MULTI_RANGE *m_multi_ranges;
KEY_MULTI_RANGE *m_multi_range_defined;
const NdbOperation *m_current_multi_operation;
NdbIndexScanOperation *m_multi_cursor;
- byte *m_multi_range_cursor_result_ptr;
+ uchar *m_multi_range_cursor_result_ptr;
int setup_recattr(const NdbRecAttr*);
Ndb *get_ndb();
};
@@ -560,7 +563,7 @@ extern SHOW_VAR ndb_status_variables[];
int ndbcluster_discover(THD* thd, const char* dbname, const char* name,
const void** frmblob, uint* frmlen);
int ndbcluster_find_files(THD *thd,const char *db,const char *path,
- const char *wild, bool dir, List<char> *files);
+ const char *wild, bool dir, List<LEX_STRING> *files);
int ndbcluster_table_exists_in_engine(THD* thd,
const char *db, const char *name);
void ndbcluster_print_error(int error, const NdbOperation *error_op);
diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc
index 25a9ccdcb87..5d5c8a26447 100644
--- a/sql/ha_ndbcluster_binlog.cc
+++ b/sql/ha_ndbcluster_binlog.cc
@@ -81,6 +81,20 @@ static Ndb *injector_ndb= 0;
static Ndb *schema_ndb= 0;
static int ndbcluster_binlog_inited= 0;
+/*
+ Flag "ndbcluster_binlog_terminating" set when shutting down mysqld.
+ Server main loop should call handlerton function:
+
+ ndbcluster_hton->binlog_func ==
+ ndbcluster_binlog_func(...,BFN_BINLOG_END,...) ==
+ ndbcluster_binlog_end
+
+ at shutdown, which sets the flag. And then server needs to wait for it
+ to complete. Otherwise binlog will not be complete.
+
+ ndbcluster_hton->panic == ndbcluster_end() will not return until
+ ndb binlog is completed
+*/
static int ndbcluster_binlog_terminating= 0;
/*
@@ -100,6 +114,9 @@ NDB_SHARE *ndb_apply_status_share= 0;
NDB_SHARE *ndb_schema_share= 0;
pthread_mutex_t ndb_schema_share_mutex;
+extern my_bool opt_log_slave_updates;
+static my_bool g_ndb_log_slave_updates;
+
/* Schema object distribution handling */
HASH ndb_schema_objects;
typedef struct st_ndb_schema_object {
@@ -130,14 +147,14 @@ static TABLE_LIST binlog_tables;
#ifndef DBUG_OFF
/* purecov: begin deadcode */
-static void print_records(TABLE *table, const char *record)
+static void print_records(TABLE *table, const uchar *record)
{
for (uint j= 0; j < table->s->fields; j++)
{
char buf[40];
int pos= 0;
Field *field= table->field[j];
- const byte* field_ptr= field->ptr - table->record[0] + record;
+ const uchar* field_ptr= field->ptr - table->record[0] + record;
int pack_len= field->pack_length();
int n= pack_len < 10 ? pack_len : 10;
@@ -196,14 +213,14 @@ static void dbug_print_table(const char *info, TABLE *table)
(long) f->ptr, (int) (f->ptr - table->record[0]),
f->null_bit,
(long) f->null_ptr,
- (int) ((byte*) f->null_ptr - table->record[0])));
+ (int) ((uchar*) f->null_ptr - table->record[0])));
if (f->type() == MYSQL_TYPE_BIT)
{
Field_bit *g= (Field_bit*) f;
DBUG_PRINT("MYSQL_TYPE_BIT",("field_length: %d bit_ptr: 0x%lx[+%d] "
"bit_ofs: %d bit_len: %u",
g->field_length, (long) g->bit_ptr,
- (int) ((byte*) g->bit_ptr -
+ (int) ((uchar*) g->bit_ptr -
table->record[0]),
g->bit_ofs, g->bit_len));
}
@@ -222,7 +239,7 @@ static void dbug_print_table(const char *info, TABLE *table)
- creating the ndb_apply_status table
*/
static void run_query(THD *thd, char *buf, char *end,
- my_bool print_error, my_bool disable_binlog)
+ const int *no_print_error, my_bool disable_binlog)
{
ulong save_query_length= thd->query_length;
char *save_query= thd->query;
@@ -230,6 +247,7 @@ static void run_query(THD *thd, char *buf, char *end,
ulonglong save_thd_options= thd->options;
DBUG_ASSERT(sizeof(save_thd_options) == sizeof(thd->options));
NET save_net= thd->net;
+ const char* found_semicolon= NULL;
bzero((char*) &thd->net, sizeof(NET));
thd->query_length= end - buf;
@@ -239,13 +257,21 @@ static void run_query(THD *thd, char *buf, char *end,
thd->options&= ~OPTION_BIN_LOG;
DBUG_PRINT("query", ("%s", thd->query));
- mysql_parse(thd, thd->query, thd->query_length);
+ mysql_parse(thd, thd->query, thd->query_length, &found_semicolon);
- if (print_error && thd->query_error)
+ if (no_print_error && thd->query_error)
{
- sql_print_error("NDB: %s: error %s %d %d %d",
- buf, thd->net.last_error, thd->net.last_errno,
- thd->net.report_error, thd->query_error);
+ int i;
+ 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->net.last_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->net.last_error, thd->net.last_errno,
+ thd_ndb->m_error_code,
+ thd->net.report_error, thd->query_error);
}
thd->options= save_thd_options;
@@ -299,18 +325,14 @@ ndbcluster_binlog_open_table(THD *thd, NDB_SHARE *share,
share->key);
if ((error= open_table_def(thd, table_share, 0)))
{
- sql_print_error("Unable to get table share for %s, error=%d",
- share->key, error);
- DBUG_PRINT("error", ("open_table_def failed %d", error));
+ DBUG_PRINT("error", ("open_table_def failed: %d my_errno: %d", error, my_errno));
free_table_share(table_share);
DBUG_RETURN(error);
}
if ((error= open_table_from_share(thd, table_share, "", 0 /* fon't allocate buffers */,
(uint) READ_ALL, 0, table, FALSE)))
{
- sql_print_error("Unable to open table for %s, error=%d(%d)",
- share->key, error, my_errno);
- DBUG_PRINT("error", ("open_table_from_share failed %d", error));
+ DBUG_PRINT("error", ("open_table_from_share failed %d my_errno: %d", error, my_errno));
free_table_share(table_share);
DBUG_RETURN(error);
}
@@ -356,11 +378,12 @@ ndbcluster_binlog_open_table(THD *thd, NDB_SHARE *share,
/*
Initialize the binlog part of the NDB_SHARE
*/
-void ndbcluster_binlog_init_share(NDB_SHARE *share, TABLE *_table)
+int ndbcluster_binlog_init_share(NDB_SHARE *share, TABLE *_table)
{
THD *thd= current_thd;
MEM_ROOT *mem_root= &share->mem_root;
int do_event_op= ndb_binlog_running;
+ int error= 0;
DBUG_ENTER("ndbcluster_binlog_init_share");
share->connect_count= g_ndb_cluster_connection->get_connect_count();
@@ -403,7 +426,7 @@ void ndbcluster_binlog_init_share(NDB_SHARE *share, TABLE *_table)
{
share->flags|= NSF_NO_BINLOG;
}
- DBUG_VOID_RETURN;
+ DBUG_RETURN(error);
}
while (1)
{
@@ -430,7 +453,7 @@ void ndbcluster_binlog_init_share(NDB_SHARE *share, TABLE *_table)
share->flags|= NSF_BLOB_FLAG;
break;
}
- DBUG_VOID_RETURN;
+ DBUG_RETURN(error);
}
/*****************************************************************
@@ -487,7 +510,7 @@ static int ndbcluster_reset_logs(THD *thd)
char buf[1024];
char *end= strmov(buf, "DELETE FROM " NDB_REP_DB "." NDB_REP_TABLE);
- run_query(thd, buf, end, FALSE, TRUE);
+ run_query(thd, buf, end, NULL, TRUE);
DBUG_RETURN(0);
}
@@ -512,7 +535,7 @@ ndbcluster_binlog_index_purge_file(THD *thd, const char *file)
NDB_REP_DB "." NDB_REP_TABLE
" WHERE File='"), file), "'");
- run_query(thd, buf, end, FALSE, TRUE);
+ run_query(thd, buf, end, NULL, TRUE);
DBUG_RETURN(0);
}
@@ -629,7 +652,7 @@ static void ndbcluster_reset_slave(THD *thd)
DBUG_ENTER("ndbcluster_reset_slave");
char buf[1024];
char *end= strmov(buf, "DELETE FROM " NDB_REP_DB "." NDB_APPLY_TABLE);
- run_query(thd, buf, end, FALSE, TRUE);
+ run_query(thd, buf, end, NULL, TRUE);
DBUG_VOID_RETURN;
}
@@ -682,7 +705,7 @@ static NDB_SHARE *ndbcluster_check_ndb_apply_status_share()
pthread_mutex_lock(&ndbcluster_mutex);
void *share= hash_search(&ndbcluster_open_tables,
- NDB_APPLY_TABLE_FILE,
+ (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));
@@ -700,7 +723,7 @@ static NDB_SHARE *ndbcluster_check_ndb_schema_share()
pthread_mutex_lock(&ndbcluster_mutex);
void *share= hash_search(&ndbcluster_open_tables,
- NDB_SCHEMA_TABLE_FILE,
+ (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));
@@ -754,7 +777,11 @@ static int ndbcluster_create_ndb_apply_status_table(THD *thd)
" end_pos BIGINT UNSIGNED NOT NULL, "
" PRIMARY KEY USING HASH (server_id) ) ENGINE=NDB");
- run_query(thd, buf, end, TRUE, TRUE);
+ const int no_print_error[4]= {ER_TABLE_EXISTS_ERROR,
+ 701,
+ 4009,
+ 0}; // do not print error 701 etc
+ run_query(thd, buf, end, no_print_error, TRUE);
DBUG_RETURN(0);
}
@@ -810,7 +837,11 @@ static int ndbcluster_create_schema_table(THD *thd)
" type INT UNSIGNED NOT NULL,"
" PRIMARY KEY USING HASH (db,name) ) ENGINE=NDB");
- run_query(thd, buf, end, TRUE, TRUE);
+ const int no_print_error[4]= {ER_TABLE_EXISTS_ERROR,
+ 701,
+ 4009,
+ 0}; // do not print error 701 etc
+ run_query(thd, buf, end, no_print_error, TRUE);
DBUG_RETURN(0);
}
@@ -904,7 +935,7 @@ static void ndbcluster_get_schema(NDB_SHARE *share,
TABLE *table= share->table;
Field **field;
/* unpack blob values */
- byte* blobs_buffer= 0;
+ uchar* blobs_buffer= 0;
uint blobs_buffer_size= 0;
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set);
{
@@ -919,14 +950,14 @@ static void ndbcluster_get_schema(NDB_SHARE *share,
DBUG_ASSERT(FALSE);
}
}
- /* db varchar 1 length byte */
+ /* db varchar 1 length uchar */
field= table->field;
s->db_length= *(uint8*)(*field)->ptr;
DBUG_ASSERT(s->db_length <= (*field)->field_length);
DBUG_ASSERT((*field)->field_length + 1 == sizeof(s->db));
memcpy(s->db, (*field)->ptr + 1, s->db_length);
s->db[s->db_length]= 0;
- /* name varchar 1 length byte */
+ /* name varchar 1 length uchar */
field++;
s->name_length= *(uint8*)(*field)->ptr;
DBUG_ASSERT(s->name_length <= (*field)->field_length);
@@ -943,13 +974,11 @@ static void ndbcluster_get_schema(NDB_SHARE *share,
{
Field_blob *field_blob= (Field_blob*)(*field);
uint blob_len= field_blob->get_length((*field)->ptr);
- char *blob_ptr= 0;
+ uchar *blob_ptr= 0;
field_blob->get_ptr(&blob_ptr);
assert(blob_len == 0 || blob_ptr != 0);
s->query_length= blob_len;
- s->query= sql_alloc(blob_len+1);
- memcpy(s->query, blob_ptr, blob_len);
- s->query[blob_len]= 0;
+ s->query= sql_strmake((char*) blob_ptr, blob_len);
}
/* node_id */
field++;
@@ -1318,7 +1347,7 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share,
(void) pthread_mutex_unlock(&ndb_schema_object->mutex);
}
- DBUG_DUMP("schema_subscribers", (char*)schema_subscribers.bitmap,
+ DBUG_DUMP("schema_subscribers", (uchar*)schema_subscribers.bitmap,
no_bytes_in_map(&schema_subscribers));
DBUG_PRINT("info", ("bitmap_is_clear_all(&schema_subscribers): %d",
bitmap_is_clear_all(&schema_subscribers)));
@@ -1522,7 +1551,7 @@ end:
bitmap_intersect(&ndb_schema_object->slock_bitmap, &schema_subscribers);
DBUG_DUMP("ndb_schema_object->slock_bitmap.bitmap",
- (char*)ndb_schema_object->slock_bitmap.bitmap,
+ (uchar*)ndb_schema_object->slock_bitmap.bitmap,
no_bytes_in_map(&ndb_schema_object->slock_bitmap));
if (bitmap_is_clear_all(&ndb_schema_object->slock_bitmap))
@@ -1607,8 +1636,8 @@ ndb_handle_schema_change(THD *thd, Ndb *ndb, NdbEventOperation *pOp,
{
const char *tabname= table_share->table_name.str;
char key[FN_REFLEN];
- const void *data= 0, *pack_data= 0;
- uint length, pack_length;
+ uchar *data= 0, *pack_data= 0;
+ size_t length, pack_length;
int error;
NDBDICT *dict= ndb->getDictionary();
const NDBTAB *altered_table= pOp->getTable();
@@ -1626,7 +1655,7 @@ ndb_handle_schema_change(THD *thd, Ndb *ndb, NdbEventOperation *pOp,
packfrm(data, length, &pack_data, &pack_length) == 0 &&
cmp_frm(altered_table, pack_data, pack_length))
{
- DBUG_DUMP("frm", (char*)altered_table->getFrmData(),
+ DBUG_DUMP("frm", (uchar*) altered_table->getFrmData(),
altered_table->getFrmLength());
pthread_mutex_lock(&LOCK_open);
Ndb_table_guard ndbtab_g(dict, tabname);
@@ -1637,7 +1666,8 @@ ndb_handle_schema_change(THD *thd, Ndb *ndb, NdbEventOperation *pOp,
my_free((char*)data, MYF(MY_ALLOW_ZERO_PTR));
data= NULL;
- if ((error= unpackfrm(&data, &length, altered_table->getFrmData())) ||
+ if ((error= unpackfrm(&data, &length,
+ (const uchar*) altered_table->getFrmData())) ||
(error= writefrm(key, data, length)))
{
sql_print_information("NDB: Failed write frm for %s.%s, error %d",
@@ -1893,16 +1923,16 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
pthread_mutex_lock(&LOCK_open);
if (ndbcluster_check_if_local_table(schema->db, schema->name))
{
- DBUG_PRINT("info", ("NDB binlog: Skipping locally defined table '%s.%s'",
+ DBUG_PRINT("info", ("NDB Binlog: Skipping locally defined table '%s.%s'",
schema->db, schema->name));
- sql_print_error("NDB binlog: Skipping locally defined table '%s.%s' from "
+ sql_print_error("NDB Binlog: Skipping locally defined table '%s.%s' from "
"binlog schema event '%s' from node %d. ",
schema->db, schema->name, schema->query,
schema->node_id);
}
else if (ndb_create_table_from_engine(thd, schema->db, schema->name))
{
- sql_print_error("NDB binlog: Could not discover table '%s.%s' from "
+ 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,
@@ -1910,7 +1940,7 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
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);
+ sql_print_warning("NDB Binlog: (%d)%s", err->code, err->msg);
}
pthread_mutex_unlock(&LOCK_open);
log_query= 1;
@@ -1919,9 +1949,10 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
/* Drop the database locally if it only contains ndb tables */
if (! ndbcluster_check_if_local_tables_in_db(thd, schema->db))
{
+ const int no_print_error[1]= {0};
run_query(thd, schema->query,
schema->query + schema->query_length,
- TRUE, /* print error */
+ no_print_error, /* print error */
TRUE); /* don't binlog the query */
/* binlog dropping database after any table operations */
post_epoch_log_list->push_back(schema, mem_root);
@@ -1931,7 +1962,7 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
else
{
/* Database contained local tables, leave it */
- sql_print_error("NDB binlog: Skipping drop database '%s' since it contained local tables "
+ sql_print_error("NDB Binlog: Skipping drop database '%s' since it contained local tables "
"binlog schema event '%s' from node %d. ",
schema->db, schema->query,
schema->node_id);
@@ -1941,12 +1972,15 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
case SOT_CREATE_DB:
/* fall through */
case SOT_ALTER_DB:
+ {
+ const int no_print_error[1]= {0};
run_query(thd, schema->query,
schema->query + schema->query_length,
- TRUE, /* print error */
+ no_print_error, /* print error */
TRUE); /* don't binlog the query */
log_query= 1;
break;
+ }
case SOT_TABLESPACE:
case SOT_LOGFILE_GROUP:
log_query= 1;
@@ -1957,7 +1991,7 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
if (log_query && ndb_binlog_running)
ndb_binlog_query(thd, schema);
/* signal that schema operation has been handled */
- DBUG_DUMP("slock", (char*)schema->slock, schema->slock_length);
+ DBUG_DUMP("slock", (uchar*) schema->slock, schema->slock_length);
if (bitmap_is_set(&slock, node_id))
{
if (post_epoch_unlock)
@@ -2104,14 +2138,14 @@ 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,
- (byte*) key, strlen(key));
+ (uchar*) key, strlen(key));
if (ndb_schema_object)
{
pthread_mutex_lock(&ndb_schema_object->mutex);
memcpy(ndb_schema_object->slock, schema->slock,
sizeof(ndb_schema_object->slock));
DBUG_DUMP("ndb_schema_object->slock_bitmap.bitmap",
- (char*)ndb_schema_object->slock_bitmap.bitmap,
+ (uchar*)ndb_schema_object->slock_bitmap.bitmap,
no_bytes_in_map(&ndb_schema_object->slock_bitmap));
pthread_mutex_unlock(&ndb_schema_object->mutex);
pthread_cond_signal(&injector_cond);
@@ -2179,23 +2213,23 @@ ndb_binlog_thread_handle_schema_event_post_epoch(THD *thd,
pthread_mutex_lock(&LOCK_open);
if (ndbcluster_check_if_local_table(schema->db, schema->name))
{
- DBUG_PRINT("info", ("NDB binlog: Skipping locally defined table '%s.%s'",
+ DBUG_PRINT("info", ("NDB Binlog: Skipping locally defined table '%s.%s'",
schema->db, schema->name));
- sql_print_error("NDB binlog: Skipping locally defined table '%s.%s' from "
+ sql_print_error("NDB Binlog: Skipping locally defined table '%s.%s' from "
"binlog schema event '%s' from node %d. ",
schema->db, schema->name, schema->query,
schema->node_id);
}
else if (ndb_create_table_from_engine(thd, schema->db, schema->name))
{
- sql_print_error("NDB binlog: Could not discover table '%s.%s' from "
+ 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);
+ sql_print_warning("NDB Binlog: (%d)%s", err->code, err->msg);
}
pthread_mutex_unlock(&LOCK_open);
}
@@ -2453,8 +2487,8 @@ ndbcluster_check_if_local_tables_in_db(THD *thd, const char *dbname)
{
DBUG_ENTER("ndbcluster_check_if_local_tables_in_db");
DBUG_PRINT("info", ("Looking for files in directory %s", dbname));
- char *tabname;
- List<char> files;
+ LEX_STRING *tabname;
+ List<LEX_STRING> files;
char path[FN_REFLEN];
build_table_filename(path, sizeof(path), dbname, "", "", 0);
@@ -2466,8 +2500,8 @@ ndbcluster_check_if_local_tables_in_db(THD *thd, const char *dbname)
DBUG_PRINT("info",("found: %d files", files.elements));
while ((tabname= files.pop()))
{
- DBUG_PRINT("info", ("Found table %s", tabname));
- if (ndbcluster_check_if_local_table(dbname, tabname))
+ DBUG_PRINT("info", ("Found table %s", tabname->str));
+ if (ndbcluster_check_if_local_table(dbname, tabname->str))
DBUG_RETURN(true);
}
@@ -2495,7 +2529,7 @@ int ndbcluster_create_binlog_setup(Ndb *ndb, const char *key,
/* Handle any trailing share */
NDB_SHARE *share= (NDB_SHARE*) hash_search(&ndbcluster_open_tables,
- (byte*) key, key_len);
+ (uchar*) key, key_len);
if (share && share_may_exist)
{
@@ -2906,10 +2940,10 @@ ndbcluster_create_event_ops(NDB_SHARE *share, const NDBTAB *ndbtab,
if (is_ndb_compatible_type(f))
{
DBUG_PRINT("info", ("%s compatible", col_name));
- attr0.rec= op->getValue(col_name, f->ptr);
+ attr0.rec= op->getValue(col_name, (char*) f->ptr);
attr1.rec= op->getPreValue(col_name,
- (f->ptr - share->table->record[0]) +
- share->table->record[1]);
+ (f->ptr - share->table->record[0]) +
+ (char*) share->table->record[1]);
}
else if (! (f->flags & BLOB_FLAG))
{
@@ -3048,7 +3082,7 @@ ndbcluster_handle_drop_table(Ndb *ndb, const char *event_name,
/* ToDo; handle error? */
if (share && share->op &&
share->op->getState() == NdbEventOperation::EO_EXECUTING &&
- dict->getNdbError().code != 4009)
+ dict->getNdbError().mysql_code != HA_ERR_NO_CONNECTION)
{
DBUG_ASSERT(FALSE);
DBUG_RETURN(-1);
@@ -3175,11 +3209,6 @@ ndb_binlog_thread_handle_non_data_event(THD *thd, Ndb *ndb,
NDB_SHARE *share= (NDB_SHARE *)pOp->getCustomData();
NDBEVENT::TableEvent type= pOp->getEventType();
- /* make sure to flush any pending events as they can be dependent
- on one of the tables being changed below
- */
- thd->binlog_flush_pending_rows_event(TRUE);
-
switch (type)
{
case NDBEVENT::TE_CLUSTER_FAILURE:
@@ -3269,6 +3298,14 @@ ndb_binlog_thread_handle_data_event(Ndb *ndb, NdbEventOperation *pOp,
originating_server_id);
return 0;
}
+ else if (!g_ndb_log_slave_updates)
+ {
+ /*
+ This event comes from a slave applier since it has an originating
+ server id set. Since option to log slave updates is not set, skip it.
+ */
+ return 0;
+ }
TABLE *table= share->table;
DBUG_ASSERT(trans.good());
@@ -3295,7 +3332,7 @@ ndb_binlog_thread_handle_data_event(Ndb *ndb, NdbEventOperation *pOp,
for now malloc/free blobs buffer each time
TODO if possible share single permanent buffer with handlers
*/
- byte* blobs_buffer[2] = { 0, 0 };
+ uchar* blobs_buffer[2] = { 0, 0 };
uint blobs_buffer_size[2] = { 0, 0 };
switch(pOp->getEventType())
@@ -3455,11 +3492,13 @@ private:
Injector thread main loop
****************************************************************/
-static byte *ndb_schema_objects_get_key(NDB_SCHEMA_OBJECT *schema_object, uint *length,
- my_bool not_used __attribute__((unused)))
+static uchar *
+ndb_schema_objects_get_key(NDB_SCHEMA_OBJECT *schema_object,
+ size_t *length,
+ my_bool not_used __attribute__((unused)))
{
*length= schema_object->key_length;
- return (byte*) schema_object->key;
+ return (uchar*) schema_object->key;
}
static NDB_SCHEMA_OBJECT *ndb_get_schema_object(const char *key,
@@ -3475,7 +3514,7 @@ static NDB_SCHEMA_OBJECT *ndb_get_schema_object(const char *key,
pthread_mutex_lock(&ndbcluster_mutex);
while (!(ndb_schema_object=
(NDB_SCHEMA_OBJECT*) hash_search(&ndb_schema_objects,
- (byte*) key,
+ (uchar*) key,
length)))
{
if (!create_if_not_exists)
@@ -3493,9 +3532,9 @@ static NDB_SCHEMA_OBJECT *ndb_get_schema_object(const char *key,
ndb_schema_object->key= (char *)(ndb_schema_object+1);
memcpy(ndb_schema_object->key, key, length + 1);
ndb_schema_object->key_length= length;
- if (my_hash_insert(&ndb_schema_objects, (byte*) ndb_schema_object))
+ if (my_hash_insert(&ndb_schema_objects, (uchar*) ndb_schema_object))
{
- my_free((gptr) ndb_schema_object, 0);
+ my_free((uchar*) ndb_schema_object, 0);
break;
}
pthread_mutex_init(&ndb_schema_object->mutex, MY_MUTEX_INIT_FAST);
@@ -3525,9 +3564,9 @@ 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, (byte*) *ndb_schema_object);
+ hash_delete(&ndb_schema_objects, (uchar*) *ndb_schema_object);
pthread_mutex_destroy(&(*ndb_schema_object)->mutex);
- my_free((gptr) *ndb_schema_object, MYF(0));
+ my_free((uchar*) *ndb_schema_object, MYF(0));
*ndb_schema_object= 0;
}
else
@@ -3645,15 +3684,7 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
if (opt_bin_log)
{
- if (global_system_variables.binlog_format == BINLOG_FORMAT_ROW ||
- global_system_variables.binlog_format == BINLOG_FORMAT_MIXED)
- {
- ndb_binlog_running= TRUE;
- }
- else
- {
- sql_print_error("NDB: only row based binary logging is supported");
- }
+ ndb_binlog_running= TRUE;
}
/* Thread start up completed */
@@ -3808,6 +3839,17 @@ restart:
res= i_ndb->pollEvents(tot_poll_wait, &gci);
tot_poll_wait= 0;
}
+ else
+ {
+ /*
+ Just consume any events, not used if no binlogging
+ e.g. node failure events
+ */
+ Uint64 tmp_gci;
+ if (i_ndb->pollEvents(0, &tmp_gci))
+ while (i_ndb->nextEvent())
+ ;
+ }
int schema_res= s_ndb->pollEvents(tot_poll_wait, &schema_gci);
ndb_latest_received_binlog_epoch= gci;
@@ -3910,6 +3952,8 @@ restart:
! IS_NDB_BLOB_PREFIX(pOp->getEvent()->getTable()->getName()));
DBUG_ASSERT(gci <= ndb_latest_received_binlog_epoch);
+ /* initialize some variables for this epoch */
+ g_ndb_log_slave_updates= opt_log_slave_updates;
i_ndb->
setReportThreshEventGCISlip(ndb_report_thresh_binlog_epoch_slip);
i_ndb->setReportThreshEventFreeMem(ndb_report_thresh_binlog_mem_usage);
@@ -3956,7 +4000,7 @@ restart:
NdbDictionary::Event::TE_DELETE)) == 0)
{
DBUG_PRINT("info", ("skipping non data event table: %.*s",
- name.length, name.str));
+ (int) name.length, name.str));
continue;
}
if (!trans.good())
@@ -3965,7 +4009,8 @@ restart:
("Found new data event, initializing transaction"));
inj->new_trans(thd, &trans);
}
- DBUG_PRINT("info", ("use_table: %.*s", name.length, name.str));
+ 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);
DBUG_ASSERT(ret == 0);
@@ -3979,7 +4024,8 @@ restart:
#ifndef DBUG_OFF
const LEX_STRING& name= table->s->table_name;
- DBUG_PRINT("info", ("use_table: %.*s", name.length, name.str));
+ DBUG_PRINT("info", ("use_table: %.*s",
+ (int) name.length, name.str));
#endif
injector::transaction::table tbl(table, TRUE);
IF_DBUG(int ret=) trans.use_table(::server_id, tbl);
@@ -4098,7 +4144,7 @@ restart:
injector::transaction::binlog_pos start= trans.start_pos();
if (int r= trans.commit())
{
- sql_print_error("NDB binlog: "
+ sql_print_error("NDB Binlog: "
"Error during COMMIT of GCI. Error: %d",
r);
/* TODO: Further handling? */
diff --git a/sql/ha_ndbcluster_binlog.h b/sql/ha_ndbcluster_binlog.h
index ac0d769433e..1cad643e5ec 100644
--- a/sql/ha_ndbcluster_binlog.h
+++ b/sql/ha_ndbcluster_binlog.h
@@ -124,7 +124,7 @@ void ndbcluster_binlog_init_handlerton();
/*
Initialize the binlog part of the NDB_SHARE
*/
-void ndbcluster_binlog_init_share(NDB_SHARE *share, TABLE *table);
+int ndbcluster_binlog_init_share(NDB_SHARE *share, TABLE *table);
bool ndbcluster_check_if_local_table(const char *dbname, const char *tabname);
bool ndbcluster_check_if_local_tables_in_db(THD *thd, const char *dbname);
@@ -184,7 +184,7 @@ int ndbcluster_find_all_files(THD *thd);
#endif /* HAVE_NDB_BINLOG */
void ndb_unpack_record(TABLE *table, NdbValue *value,
- MY_BITMAP *defined, byte *buf);
+ MY_BITMAP *defined, uchar *buf);
char *ndb_pack_varchar(const NDBCOL *col, char *buf,
const char *str, int sz);
@@ -216,10 +216,12 @@ inline void free_share(NDB_SHARE **share, bool have_lock= FALSE)
inline
Thd_ndb *
-get_thd_ndb(THD *thd) { return (Thd_ndb *) thd->ha_data[ndbcluster_hton->slot]; }
+get_thd_ndb(THD *thd)
+{ return (Thd_ndb *) thd_get_ha_data(thd, ndbcluster_hton); }
inline
void
-set_thd_ndb(THD *thd, Thd_ndb *thd_ndb) { thd->ha_data[ndbcluster_hton->slot]= thd_ndb; }
+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);
diff --git a/sql/ha_ndbcluster_cond.cc b/sql/ha_ndbcluster_cond.cc
index 267be17c330..94342c6d2ad 100644
--- a/sql/ha_ndbcluster_cond.cc
+++ b/sql/ha_ndbcluster_cond.cc
@@ -46,6 +46,14 @@ void ndb_serialize_cond(const Item *item, void *arg)
// Check if we are skipping arguments to a function to be evaluated
if (context->skip)
{
+ if (!item)
+ {
+ DBUG_PRINT("info", ("Unexpected mismatch of found and expected number of function arguments %u", context->skip));
+ sql_print_error("ndb_serialize_cond: Unexpected mismatch of found and "
+ "expected number of function arguments %u", context->skip);
+ context->skip= 0;
+ DBUG_VOID_RETURN;
+ }
DBUG_PRINT("info", ("Skiping argument %d", context->skip));
context->skip--;
switch (item->type()) {
@@ -1377,9 +1385,9 @@ ha_ndbcluster_cond::generate_scan_filter_from_cond(NdbScanFilter& filter)
int ha_ndbcluster_cond::generate_scan_filter_from_key(NdbScanOperation *op,
const KEY* key_info,
- const byte *key,
+ const uchar *key,
uint key_len,
- byte *buf)
+ uchar *buf)
{
KEY_PART_INFO* key_part= key_info->key_part;
KEY_PART_INFO* end= key_part+key_info->key_parts;
@@ -1392,9 +1400,9 @@ int ha_ndbcluster_cond::generate_scan_filter_from_key(NdbScanOperation *op,
{
Field* field= key_part->field;
uint32 pack_len= field->pack_length();
- const byte* ptr= key;
+ const uchar* ptr= key;
DBUG_PRINT("info", ("Filtering value for %s", field->field_name));
- DBUG_DUMP("key", (char*)ptr, pack_len);
+ DBUG_DUMP("key", ptr, pack_len);
if (key_part->null_bit)
{
DBUG_PRINT("info", ("Generating ISNULL filter"));
diff --git a/sql/ha_ndbcluster_cond.h b/sql/ha_ndbcluster_cond.h
index 617302107d8..4d1d2ef9f92 100644
--- a/sql/ha_ndbcluster_cond.h
+++ b/sql/ha_ndbcluster_cond.h
@@ -198,7 +198,7 @@ public:
return value.item->str_value.ptr();
break;
case(NDB_FIELD):
- return value.field_value->field->ptr;
+ return (char*) value.field_value->field->ptr;
default:
break;
}
@@ -264,8 +264,20 @@ class Ndb_cond : public Sql_alloc
~Ndb_cond()
{
if (ndb_item) delete ndb_item;
- ndb_item= NULL;
- if (next) delete next;
+ ndb_item= NULL;
+ /*
+ First item in the linked list deletes all in a loop
+ Note - doing it recursively causes stack issues for
+ big IN clauses
+ */
+ Ndb_cond *n= next;
+ while (n)
+ {
+ Ndb_cond *tmp= n;
+ n= n->next;
+ tmp->next= NULL;
+ delete tmp;
+ }
next= prev= NULL;
};
Ndb_item *ndb_item;
@@ -458,9 +470,9 @@ public:
int generate_scan_filter_from_cond(NdbScanFilter& filter);
int generate_scan_filter_from_key(NdbScanOperation* op,
const KEY* key_info,
- const byte *key,
+ const uchar *key,
uint key_len,
- byte *buf);
+ uchar *buf);
private:
bool serialize_cond(const COND *cond, Ndb_cond_stack *ndb_cond,
TABLE *table, const NdbDictionary::Table *ndb_table);
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index d3979fa0718..200e8a97c67 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -145,6 +145,8 @@ static uint alter_table_flags(uint flags __attribute__((unused)))
HA_FAST_CHANGE_PARTITION);
}
+const uint ha_partition::NO_CURRENT_PART_ID= 0xFFFFFFFF;
+
/*
Constructor method
@@ -383,7 +385,8 @@ bool ha_partition::initialise_partition(MEM_ROOT *mem_root)
m_table_flags&= file->table_flags();
} while (*(++file_array));
m_table_flags&= ~(HA_CAN_GEOMETRY | HA_CAN_FULLTEXT | HA_DUPLICATE_POS |
- HA_CAN_SQL_HANDLER | HA_CAN_INSERT_DELAYED);
+ HA_CAN_SQL_HANDLER | HA_CAN_INSERT_DELAYED |
+ HA_PRIMARY_KEY_REQUIRED_FOR_POSITION);
m_table_flags|= HA_FILE_BASED | HA_REC_NOT_IN_SEQ;
DBUG_RETURN(0);
}
@@ -1124,7 +1127,7 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt,
0 Success
*/
-int ha_partition::prepare_new_partition(TABLE *table,
+int ha_partition::prepare_new_partition(TABLE *tbl,
HA_CREATE_INFO *create_info,
handler *file, const char *part_name,
partition_element *p_elem)
@@ -1133,14 +1136,20 @@ int ha_partition::prepare_new_partition(TABLE *table,
bool create_flag= FALSE;
DBUG_ENTER("prepare_new_partition");
- if ((error= set_up_table_before_create(table, part_name, create_info,
+ if ((error= set_up_table_before_create(tbl, part_name, create_info,
0, p_elem)))
goto error;
- if ((error= file->create(part_name, table, create_info)))
+ if ((error= file->create(part_name, tbl, create_info)))
goto error;
create_flag= TRUE;
- if ((error= file->ha_open(table, part_name, m_mode, m_open_test_lock)))
+ if ((error= file->ha_open(tbl, part_name, m_mode, m_open_test_lock)))
goto error;
+ /*
+ Note: if you plan to add another call that may return failure,
+ better to do it before external_lock() as cleanup_new_partition()
+ assumes that external_lock() is last call that may fail here.
+ Otherwise see description for cleanup_new_partition().
+ */
if ((error= file->external_lock(current_thd, m_lock_type)))
goto error;
@@ -1163,6 +1172,14 @@ error:
NONE
DESCRIPTION
+ This function is called immediately after prepare_new_partition() in
+ case the latter fails.
+
+ In prepare_new_partition() last call that may return failure is
+ external_lock(). That means if prepare_new_partition() fails,
+ partition does not have external lock. Thus no need to call
+ external_lock(F_UNLCK) here.
+
TODO:
We must ensure that in the case that we get an error during the process
that we call external_lock with F_UNLCK, close the table and delete the
@@ -1181,7 +1198,6 @@ void ha_partition::cleanup_new_partition(uint part_count)
m_file= m_added_file;
m_added_file= NULL;
- external_lock(current_thd, F_UNLCK);
/* delete_table also needed, a bit more complex */
close();
@@ -1224,9 +1240,9 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info,
const char *path,
ulonglong *copied,
ulonglong *deleted,
- const void *pack_frm_data
+ const uchar *pack_frm_data
__attribute__((unused)),
- uint pack_frm_len
+ size_t pack_frm_len
__attribute__((unused)))
{
List_iterator<partition_element> part_it(m_part_info->partitions);
@@ -1762,7 +1778,7 @@ partition_element *ha_partition::find_partition_element(uint part_id)
4) Data file name on partition
*/
-int ha_partition::set_up_table_before_create(TABLE *table,
+int ha_partition::set_up_table_before_create(TABLE *tbl,
const char *partition_name_with_path,
HA_CREATE_INFO *info,
uint part_id,
@@ -1779,8 +1795,8 @@ int ha_partition::set_up_table_before_create(TABLE *table,
if (!part_elem)
DBUG_RETURN(1); // Fatal error
}
- table->s->max_rows= part_elem->part_max_rows;
- table->s->min_rows= part_elem->part_min_rows;
+ tbl->s->max_rows= part_elem->part_max_rows;
+ tbl->s->min_rows= part_elem->part_min_rows;
partition_name= strrchr(partition_name_with_path, FN_LIBCHAR);
if ((part_elem->index_file_name &&
(error= append_file_to_dir(thd,
@@ -1964,8 +1980,8 @@ bool ha_partition::create_handler_file(const char *name)
if ((file= my_create(file_name, CREATE_MODE, O_RDWR | O_TRUNC,
MYF(MY_WME))) >= 0)
{
- result= my_write(file, (byte *) file_buffer, tot_len_byte,
- MYF(MY_WME | MY_NABP));
+ result= my_write(file, (uchar *) file_buffer, tot_len_byte,
+ MYF(MY_WME | MY_NABP)) != 0;
VOID(my_close(file, MYF(0)));
}
else
@@ -1986,6 +2002,8 @@ bool ha_partition::create_handler_file(const char *name)
void ha_partition::clear_handler_file()
{
+ if (m_engine_array)
+ plugin_unlock_list(NULL, m_engine_array, m_tot_parts);
my_free((char*) m_file_buffer, MYF(MY_ALLOW_ZERO_PTR));
my_free((char*) m_engine_array, MYF(MY_ALLOW_ZERO_PTR));
m_file_buffer= NULL;
@@ -2008,6 +2026,7 @@ bool ha_partition::create_handlers(MEM_ROOT *mem_root)
{
uint i;
uint alloc_len= (m_tot_parts + 1) * sizeof(handler*);
+ handlerton *hton0;
DBUG_ENTER("create_handlers");
if (!(m_file= (handler **) alloc_root(mem_root, alloc_len)))
@@ -2016,19 +2035,21 @@ bool ha_partition::create_handlers(MEM_ROOT *mem_root)
bzero((char*) m_file, alloc_len);
for (i= 0; i < m_tot_parts; i++)
{
+ handlerton *hton= plugin_data(m_engine_array[i], handlerton*);
if (!(m_file[i]= get_new_handler(table_share, mem_root,
- m_engine_array[i])))
+ hton)))
DBUG_RETURN(TRUE);
- DBUG_PRINT("info", ("engine_type: %u", m_engine_array[i]->db_type));
+ DBUG_PRINT("info", ("engine_type: %u", hton->db_type));
}
/* For the moment we only support partition over the same table engine */
- if (m_engine_array[0] == myisam_hton)
+ hton0= plugin_data(m_engine_array[0], handlerton*);
+ if (hton0 == myisam_hton)
{
DBUG_PRINT("info", ("MyISAM"));
m_myisam= TRUE;
}
/* INNODB may not be compiled in... */
- else if (ha_legacy_type(m_engine_array[0]) == DB_TYPE_INNODB)
+ else if (ha_legacy_type(hton0) == DB_TYPE_INNODB)
{
DBUG_PRINT("info", ("InnoDB"));
m_innodb= TRUE;
@@ -2141,14 +2162,14 @@ bool ha_partition::get_from_handler_file(const char *name, MEM_ROOT *mem_root)
/* Following could be done with my_stat to read in whole file */
if ((file= my_open(buff, O_RDONLY | O_SHARE, MYF(0))) < 0)
DBUG_RETURN(TRUE);
- if (my_read(file, (byte *) & buff[0], 8, MYF(MY_NABP)))
+ if (my_read(file, (uchar *) & buff[0], 8, MYF(MY_NABP)))
goto err1;
len_words= uint4korr(buff);
len_bytes= 4 * len_words;
- if (!(file_buffer= my_malloc(len_bytes, MYF(0))))
+ if (!(file_buffer= (char*) my_malloc(len_bytes, MYF(0))))
goto err1;
VOID(my_seek(file, 0, MY_SEEK_SET, MYF(0)));
- if (my_read(file, (byte *) file_buffer, len_bytes, MYF(MY_NABP)))
+ if (my_read(file, (uchar *) file_buffer, len_bytes, MYF(MY_NABP)))
goto err2;
chksum= 0;
@@ -2159,8 +2180,7 @@ bool ha_partition::get_from_handler_file(const char *name, MEM_ROOT *mem_root)
m_tot_parts= uint4korr((file_buffer) + 8);
DBUG_PRINT("info", ("No of parts = %u", m_tot_parts));
tot_partition_words= (m_tot_parts + 3) / 4;
- if (!(engine_array= (handlerton **) my_malloc(m_tot_parts * sizeof(handlerton*),MYF(0))))
- goto err2;
+ engine_array= (handlerton **) my_alloca(m_tot_parts * sizeof(handlerton*));
for (i= 0; i < m_tot_parts; i++)
engine_array[i]= ha_resolve_by_legacy_type(current_thd,
(enum legacy_db_type)
@@ -2168,12 +2188,21 @@ bool ha_partition::get_from_handler_file(const char *name, MEM_ROOT *mem_root)
address_tot_name_len= file_buffer + 12 + 4 * tot_partition_words;
tot_name_words= (uint4korr(address_tot_name_len) + 3) / 4;
if (len_words != (tot_partition_words + tot_name_words + 4))
- goto err2;
+ goto err3;
name_buffer_ptr= file_buffer + 16 + 4 * tot_partition_words;
VOID(my_close(file, MYF(0)));
m_file_buffer= file_buffer; // Will be freed in clear_handler_file()
m_name_buffer_ptr= name_buffer_ptr;
- m_engine_array= engine_array;
+
+ if (!(m_engine_array= (plugin_ref*)
+ my_malloc(m_tot_parts * sizeof(plugin_ref), MYF(MY_WME))))
+ goto err3;
+
+ for (i= 0; i < m_tot_parts; i++)
+ m_engine_array[i]= ha_lock_engine(NULL, engine_array[i]);
+
+ my_afree((gptr) engine_array);
+
if (!m_file && create_handlers(mem_root))
{
clear_handler_file();
@@ -2181,6 +2210,8 @@ bool ha_partition::get_from_handler_file(const char *name, MEM_ROOT *mem_root)
}
DBUG_RETURN(FALSE);
+err3:
+ my_afree((gptr) engine_array);
err2:
my_free(file_buffer, MYF(0));
err1:
@@ -2237,7 +2268,7 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
alloc_len+= table->s->max_key_length;
if (!m_ordered_rec_buffer)
{
- if (!(m_ordered_rec_buffer= (byte*)my_malloc(alloc_len, MYF(MY_WME))))
+ if (!(m_ordered_rec_buffer= (uchar*)my_malloc(alloc_len, MYF(MY_WME))))
{
DBUG_RETURN(1);
}
@@ -2256,7 +2287,7 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
int2store(ptr, i);
ptr+= m_rec_length + PARTITION_BYTES_IN_POS;
} while (++i < m_tot_parts);
- m_start_key.key= (const byte*)ptr;
+ m_start_key.key= (const uchar*)ptr;
}
}
@@ -2324,7 +2355,8 @@ err_handler:
handler *ha_partition::clone(MEM_ROOT *mem_root)
{
- handler *new_handler= get_new_handler(table->s, mem_root, table->s->db_type);
+ handler *new_handler= get_new_handler(table->s, mem_root,
+ table->s->db_type());
((ha_partition*)new_handler)->m_part_info= m_part_info;
((ha_partition*)new_handler)->is_clone= TRUE;
if (new_handler && !new_handler->ha_open(table,
@@ -2641,13 +2673,14 @@ void ha_partition::unlock_row()
may be used in determining which partition the row should be written to.
*/
-int ha_partition::write_row(byte * buf)
+int ha_partition::write_row(uchar * buf)
{
uint32 part_id;
int error;
longlong func_value;
+ bool autoincrement_lock= false;
#ifdef NOT_NEEDED
- byte *rec0= m_rec0;
+ uchar *rec0= m_rec0;
#endif
DBUG_ENTER("ha_partition::write_row");
DBUG_ASSERT(buf == m_rec0);
@@ -2661,7 +2694,29 @@ int ha_partition::write_row(byte * buf)
or a new row, then update the auto_increment value in the record.
*/
if (table->next_number_field && buf == table->record[0])
- update_auto_increment();
+ {
+ /*
+ Some engines (InnoDB for example) can change autoincrement
+ counter only after 'table->write_row' operation.
+ So if another thread gets inside the ha_partition::write_row
+ before it is complete, it gets same auto_increment value,
+ which means DUP_KEY error (bug #27405)
+ Here we separate the access using table_share->mutex, and
+ use autoincrement_lock variable to avoid unnecessary locks.
+ Probably not an ideal solution.
+ */
+ autoincrement_lock= true;
+ pthread_mutex_lock(&table_share->mutex);
+ error= update_auto_increment();
+
+ /*
+ If we have failed to set the auto-increment value for this row,
+ it is highly likely that we will not be able to insert it into
+ the correct partition. We must check and fail if neccessary.
+ */
+ if (error)
+ DBUG_RETURN(error);
+ }
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set);
#ifdef NOT_NEEDED
@@ -2682,11 +2737,15 @@ int ha_partition::write_row(byte * buf)
if (unlikely(error))
{
m_part_info->err_value= func_value;
- DBUG_RETURN(error);
+ goto exit;
}
m_last_part= part_id;
DBUG_PRINT("info", ("Insert in partition %d", part_id));
- DBUG_RETURN(m_file[part_id]->write_row(buf));
+ error= m_file[part_id]->write_row(buf);
+exit:
+ if (autoincrement_lock)
+ pthread_mutex_unlock(&table_share->mutex);
+ DBUG_RETURN(error);
}
@@ -2721,7 +2780,7 @@ int ha_partition::write_row(byte * buf)
old_data is normally record[1] but may be anything
*/
-int ha_partition::update_row(const byte *old_data, byte *new_data)
+int ha_partition::update_row(const uchar *old_data, uchar *new_data)
{
uint32 new_part_id, old_part_id;
int error;
@@ -2793,7 +2852,7 @@ int ha_partition::update_row(const byte *old_data, byte *new_data)
buf is either record[0] or record[1]
*/
-int ha_partition::delete_row(const byte *buf)
+int ha_partition::delete_row(const uchar *buf)
{
uint32 part_id;
int error;
@@ -2944,8 +3003,34 @@ int ha_partition::rnd_init(bool scan)
uint32 part_id;
DBUG_ENTER("ha_partition::rnd_init");
- include_partition_fields_in_used_fields();
-
+ /*
+ For operations that may need to change data, we may need to extend
+ read_set.
+ */
+ if (m_lock_type == F_WRLCK)
+ {
+ /*
+ If write_set contains any of the fields used in partition and
+ subpartition expression, we need to set all bits in read_set because
+ the row may need to be inserted in a different [sub]partition. In
+ other words update_row() can be converted into write_row(), which
+ requires a complete record.
+ */
+ if (bitmap_is_overlapping(&m_part_info->full_part_field_set,
+ table->write_set))
+ bitmap_set_all(table->read_set);
+ else
+ {
+ /*
+ Some handlers only read fields as specified by the bitmap for the
+ read set. For partitioned handlers we always require that the
+ fields of the partition functions are read such that we can
+ calculate the partition id to place updated and deleted records.
+ */
+ bitmap_union(table->read_set, &m_part_info->full_part_field_set);
+ }
+ }
+
/* Now we see what the index of our first important partition is */
DBUG_PRINT("info", ("m_part_info->used_partitions: 0x%lx",
(long) m_part_info->used_partitions.bitmap));
@@ -3064,7 +3149,7 @@ int ha_partition::rnd_end()
sql_table.cc, and sql_update.cc.
*/
-int ha_partition::rnd_next(byte *buf)
+int ha_partition::rnd_next(uchar *buf)
{
handler *file;
int result= HA_ERR_END_OF_FILE;
@@ -3101,7 +3186,7 @@ int ha_partition::rnd_next(byte *buf)
continue; // Probably MyISAM
if (result != HA_ERR_END_OF_FILE)
- break; // Return error
+ goto end_dont_reset_start_part; // Return error
/* End current partition */
late_extra_no_cache(part_id);
@@ -3127,6 +3212,7 @@ int ha_partition::rnd_next(byte *buf)
end:
m_part_spec.start_part= NO_CURRENT_PART_ID;
+end_dont_reset_start_part:
table->status= STATUS_NOT_FOUND;
DBUG_RETURN(result);
}
@@ -3157,7 +3243,7 @@ end:
Called from filesort.cc, sql_select.cc, sql_delete.cc and sql_update.cc.
*/
-void ha_partition::position(const byte *record)
+void ha_partition::position(const uchar *record)
{
handler *file= m_file[m_last_part];
DBUG_ENTER("ha_partition::position");
@@ -3176,6 +3262,14 @@ void ha_partition::position(const byte *record)
DBUG_VOID_RETURN;
}
+
+void ha_partition::column_bitmaps_signal()
+{
+ handler::column_bitmaps_signal();
+ bitmap_union(table->read_set, &m_part_info->full_part_field_set);
+}
+
+
/*
Read row using position
@@ -3197,13 +3291,13 @@ void ha_partition::position(const byte *record)
sql_update.cc.
*/
-int ha_partition::rnd_pos(byte * buf, byte *pos)
+int ha_partition::rnd_pos(uchar * buf, uchar *pos)
{
uint part_id;
handler *file;
DBUG_ENTER("ha_partition::rnd_pos");
- part_id= uint2korr((const byte *) pos);
+ part_id= uint2korr((const uchar *) pos);
DBUG_ASSERT(part_id < m_tot_parts);
file= m_file[part_id];
m_last_part= part_id;
@@ -3211,6 +3305,36 @@ int ha_partition::rnd_pos(byte * buf, byte *pos)
}
+/*
+ Read row using position using given record to find
+
+ SYNOPSIS
+ rnd_pos_by_record()
+ record Current record in MySQL Row Format
+
+ RETURN VALUE
+ >0 Error code
+ 0 Success
+
+ DESCRIPTION
+ this works as position()+rnd_pos() functions, but does some extra work,
+ calculating m_last_part - the partition to where the 'record'
+ should go.
+
+ called from replication (log_event.cc)
+*/
+
+int ha_partition::rnd_pos_by_record(uchar *record)
+{
+ DBUG_ENTER("ha_partition::rnd_pos_by_record");
+
+ if (unlikely(get_part_for_delete(record, m_rec0, m_part_info, &m_last_part)))
+ DBUG_RETURN(1);
+
+ DBUG_RETURN(handler::rnd_pos_by_record(record));
+}
+
+
/****************************************************************************
MODULE index scan
****************************************************************************/
@@ -3258,7 +3382,15 @@ int ha_partition::index_init(uint inx, bool sorted)
m_start_key.length= 0;
m_ordered= sorted;
m_curr_key_info= table->key_info+inx;
- include_partition_fields_in_used_fields();
+ /*
+ Some handlers only read fields as specified by the bitmap for the
+ read set. For partitioned handlers we always require that the
+ fields of the partition functions are read such that we can
+ calculate the partition id to place updated and deleted records.
+ But this is required for operations that may need to change data only.
+ */
+ if (m_lock_type == F_WRLCK)
+ bitmap_union(table->read_set, &m_part_info->full_part_field_set);
file= m_file;
do
{
@@ -3335,11 +3467,11 @@ int ha_partition::index_end()
used in conjuntion with multi read ranges.
*/
-int ha_partition::index_read(byte * buf, const byte * key,
- key_part_map keypart_map,
- enum ha_rkey_function find_flag)
+int ha_partition::index_read_map(uchar *buf, const uchar *key,
+ key_part_map keypart_map,
+ enum ha_rkey_function find_flag)
{
- DBUG_ENTER("ha_partition::index_read");
+ DBUG_ENTER("ha_partition::index_read_map");
end_range= 0;
m_index_scan_type= partition_index_read;
@@ -3356,7 +3488,7 @@ int ha_partition::index_read(byte * buf, const byte * key,
see index_read for rest
*/
-int ha_partition::common_index_read(byte *buf, const byte *key,
+int ha_partition::common_index_read(uchar *buf, const uchar *key,
key_part_map keypart_map,
enum ha_rkey_function find_flag)
{
@@ -3433,7 +3565,7 @@ int ha_partition::common_index_read(byte *buf, const byte *key,
and sql_select.cc.
*/
-int ha_partition::index_first(byte * buf)
+int ha_partition::index_first(uchar * buf)
{
DBUG_ENTER("ha_partition::index_first");
@@ -3464,7 +3596,7 @@ int ha_partition::index_first(byte * buf)
and sql_select.cc.
*/
-int ha_partition::index_last(byte * buf)
+int ha_partition::index_last(uchar * buf)
{
DBUG_ENTER("ha_partition::index_last");
@@ -3481,7 +3613,7 @@ int ha_partition::index_last(byte * buf)
see index_first for rest
*/
-int ha_partition::common_first_last(byte *buf)
+int ha_partition::common_first_last(uchar *buf)
{
int error;
@@ -3501,7 +3633,7 @@ int ha_partition::common_first_last(byte *buf)
index_read_last()
buf Read row in MySQL Row Format
key Key
- keylen Length of key
+ keypart_map Which part of key is used
RETURN VALUE
>0 Error code
@@ -3512,8 +3644,8 @@ int ha_partition::common_first_last(byte *buf)
Can only be used on indexes supporting HA_READ_ORDER
*/
-int ha_partition::index_read_last(byte *buf, const byte *key,
- key_part_map keypart_map)
+int ha_partition::index_read_last_map(uchar *buf, const uchar *key,
+ key_part_map keypart_map)
{
DBUG_ENTER("ha_partition::index_read_last");
@@ -3539,7 +3671,7 @@ int ha_partition::index_read_last(byte *buf, const byte *key,
Used to read forward through the index.
*/
-int ha_partition::index_next(byte * buf)
+int ha_partition::index_next(uchar * buf)
{
DBUG_ENTER("ha_partition::index_next");
@@ -3575,7 +3707,7 @@ int ha_partition::index_next(byte * buf)
as supplied in the call.
*/
-int ha_partition::index_next_same(byte *buf, const byte *key, uint keylen)
+int ha_partition::index_next_same(uchar *buf, const uchar *key, uint keylen)
{
DBUG_ENTER("ha_partition::index_next_same");
@@ -3602,7 +3734,7 @@ int ha_partition::index_next_same(byte *buf, const byte *key, uint keylen)
Used to read backwards through the index.
*/
-int ha_partition::index_prev(byte * buf)
+int ha_partition::index_prev(uchar * buf)
{
DBUG_ENTER("ha_partition::index_prev");
@@ -3711,7 +3843,7 @@ int ha_partition::read_range_next()
of them
*/
-int ha_partition::partition_scan_set_up(byte * buf, bool idx_read_flag)
+int ha_partition::partition_scan_set_up(uchar * buf, bool idx_read_flag)
{
DBUG_ENTER("ha_partition::partition_scan_set_up");
@@ -3792,7 +3924,7 @@ int ha_partition::partition_scan_set_up(byte * buf, bool idx_read_flag)
perform any sort.
*/
-int ha_partition::handle_unordered_next(byte *buf, bool is_next_same)
+int ha_partition::handle_unordered_next(uchar *buf, bool is_next_same)
{
handler *file= file= m_file[m_part_spec.start_part];
int error;
@@ -3847,7 +3979,7 @@ int ha_partition::handle_unordered_next(byte *buf, bool is_next_same)
Both initial start and after completing scan on one partition.
*/
-int ha_partition::handle_unordered_scan_next_partition(byte * buf)
+int ha_partition::handle_unordered_scan_next_partition(uchar * buf)
{
uint i;
DBUG_ENTER("ha_partition::handle_unordered_scan_next_partition");
@@ -3864,9 +3996,9 @@ int ha_partition::handle_unordered_scan_next_partition(byte * buf)
switch (m_index_scan_type) {
case partition_index_read:
DBUG_PRINT("info", ("index_read on partition %d", i));
- error= file->index_read(buf, m_start_key.key,
- m_start_key.keypart_map,
- m_start_key.flag);
+ error= file->index_read_map(buf, m_start_key.key,
+ m_start_key.keypart_map,
+ m_start_key.flag);
break;
case partition_index_first:
DBUG_PRINT("info", ("index_first on partition %d", i));
@@ -3934,7 +4066,7 @@ int ha_partition::handle_unordered_scan_next_partition(byte * buf)
entries.
*/
-int ha_partition::handle_ordered_index_scan(byte *buf, bool reverse_order)
+int ha_partition::handle_ordered_index_scan(uchar *buf, bool reverse_order)
{
uint i;
uint j= 0;
@@ -3949,16 +4081,16 @@ int ha_partition::handle_ordered_index_scan(byte *buf, bool reverse_order)
{
if (!(bitmap_is_set(&(m_part_info->used_partitions), i)))
continue;
- byte *rec_buf_ptr= rec_buf(i);
+ uchar *rec_buf_ptr= rec_buf(i);
int error;
handler *file= m_file[i];
switch (m_index_scan_type) {
case partition_index_read:
- error= file->index_read(rec_buf_ptr,
- m_start_key.key,
- m_start_key.keypart_map,
- m_start_key.flag);
+ error= file->index_read_map(rec_buf_ptr,
+ m_start_key.key,
+ m_start_key.keypart_map,
+ m_start_key.flag);
break;
case partition_index_first:
error= file->index_first(rec_buf_ptr);
@@ -3969,9 +4101,9 @@ int ha_partition::handle_ordered_index_scan(byte *buf, bool reverse_order)
reverse_order= TRUE;
break;
case partition_index_read_last:
- error= file->index_read_last(rec_buf_ptr,
- m_start_key.key,
- m_start_key.keypart_map);
+ error= file->index_read_last_map(rec_buf_ptr,
+ m_start_key.key,
+ m_start_key.keypart_map);
reverse_order= TRUE;
break;
default:
@@ -3984,7 +4116,7 @@ int ha_partition::handle_ordered_index_scan(byte *buf, bool reverse_order)
/*
Initialise queue without order first, simply insert
*/
- queue_element(&m_queue, j++)= (byte*)queue_buf(i);
+ queue_element(&m_queue, j++)= (uchar*)queue_buf(i);
}
else if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE)
{
@@ -4021,11 +4153,11 @@ int ha_partition::handle_ordered_index_scan(byte *buf, bool reverse_order)
NONE
*/
-void ha_partition::return_top_record(byte *buf)
+void ha_partition::return_top_record(uchar *buf)
{
uint part_id;
- byte *key_buffer= queue_top(&m_queue);
- byte *rec_buffer= key_buffer + PARTITION_BYTES_IN_POS;
+ uchar *key_buffer= queue_top(&m_queue);
+ uchar *rec_buffer= key_buffer + PARTITION_BYTES_IN_POS;
part_id= uint2korr(key_buffer);
memcpy(buf, rec_buffer, m_rec_length);
@@ -4048,7 +4180,7 @@ void ha_partition::return_top_record(byte *buf)
other Error code
*/
-int ha_partition::handle_ordered_next(byte *buf, bool is_next_same)
+int ha_partition::handle_ordered_next(uchar *buf, bool is_next_same)
{
int error;
uint part_id= m_top_entry;
@@ -4097,7 +4229,7 @@ int ha_partition::handle_ordered_next(byte *buf, bool is_next_same)
other Error code
*/
-int ha_partition::handle_ordered_prev(byte *buf)
+int ha_partition::handle_ordered_prev(uchar *buf)
{
int error;
uint part_id= m_top_entry;
@@ -4127,35 +4259,6 @@ int ha_partition::handle_ordered_prev(byte *buf)
}
-/*
- Set fields in partition functions in read set for underlying handlers
-
- SYNOPSIS
- include_partition_fields_in_used_fields()
-
- RETURN VALUE
- NONE
-
- DESCRIPTION
- Some handlers only read fields as specified by the bitmap for the
- read set. For partitioned handlers we always require that the
- fields of the partition functions are read such that we can
- calculate the partition id to place updated and deleted records.
-*/
-
-void ha_partition::include_partition_fields_in_used_fields()
-{
- Field **ptr= m_part_field_array;
- DBUG_ENTER("ha_partition::include_partition_fields_in_used_fields");
-
- do
- {
- bitmap_set_bit(table->read_set, (*ptr)->field_index);
- } while (*(++ptr));
- DBUG_VOID_RETURN;
-}
-
-
/****************************************************************************
MODULE information calls
****************************************************************************/
@@ -4237,22 +4340,16 @@ int ha_partition::info(uint flag)
if (flag & HA_STATUS_AUTO)
{
- ulonglong nb_reserved_values;
+ ulonglong auto_increment_value= 0;
DBUG_PRINT("info", ("HA_STATUS_AUTO"));
- /* we don't want to reserve any values, it's pure information */
-
- if (table->found_next_number_field)
+ file_array= m_file;
+ do
{
- /*
- Can only call get_auto_increment for tables that actually
- have auto_increment columns, otherwise there will be
- problems in handlers that don't expect get_auto_increment
- for non-autoincrement tables.
- */
- get_auto_increment(0, 0, 0, &stats.auto_increment_value,
- &nb_reserved_values);
- release_auto_increment();
- }
+ file= *file_array;
+ file->info(HA_STATUS_AUTO);
+ set_if_bigger(auto_increment_value, file->stats.auto_increment_value);
+ } while (*(++file_array));
+ stats.auto_increment_value= auto_increment_value;
}
if (flag & HA_STATUS_VARIABLE)
{
@@ -4703,6 +4800,12 @@ void ha_partition::get_dynamic_partition_info(PARTITION_INFO *stat_info,
HA_EXTRA_KEY_CACHE:
HA_EXTRA_NO_KEY_CACHE:
This parameters are no longer used and could be removed.
+
+ 7) Parameters only used by federated tables for query processing
+ ----------------------------------------------------------------
+ HA_EXTRA_INSERT_WITH_UPDATE:
+ Inform handler that an "INSERT...ON DUPLICATE KEY UPDATE" will be
+ executed. This condition is unset by HA_EXTRA_NO_IGNORE_DUP_KEY.
*/
int ha_partition::extra(enum ha_extra_function operation)
@@ -4784,6 +4887,9 @@ int ha_partition::extra(enum ha_extra_function operation)
*/
break;
}
+ /* Category 7), used by federated handlers */
+ case HA_EXTRA_INSERT_WITH_UPDATE:
+ DBUG_RETURN(loop_extra(operation));
default:
{
/* Temporary crash to discover what is wrong */
@@ -5342,7 +5448,7 @@ uint ha_partition::min_record_length(uint options) const
they are the same. Sort in partition id order if not equal.
*/
-int ha_partition::cmp_ref(const byte *ref1, const byte *ref2)
+int ha_partition::cmp_ref(const uchar *ref1, const uchar *ref2)
{
uint part_id;
my_ptrdiff_t diff1, diff2;
@@ -5402,16 +5508,20 @@ void ha_partition::get_auto_increment(ulonglong offset, ulonglong increment,
ulonglong first_value_part, last_value_part, nb_reserved_values_part,
last_value= ~ (ulonglong) 0;
handler **pos, **end;
+ bool retry= TRUE;
DBUG_ENTER("ha_partition::get_auto_increment");
+again:
for (pos=m_file, end= m_file+ m_tot_parts; pos != end ; pos++)
{
+ first_value_part= *first_value;
(*pos)->get_auto_increment(offset, increment, nb_desired_values,
&first_value_part, &nb_reserved_values_part);
if (first_value_part == ~(ulonglong)(0)) // error in one partition
{
*first_value= first_value_part;
- break;
+ sql_print_error("Partition failed to reserve auto_increment value");
+ DBUG_VOID_RETURN;
}
/*
Partition has reserved an interval. Intersect it with the intervals
@@ -5424,6 +5534,25 @@ void ha_partition::get_auto_increment(ulonglong offset, ulonglong increment,
}
if (last_value < *first_value) /* empty intersection, error */
{
+ /*
+ When we have an empty intersection, it means that one or more
+ partitions may have a significantly different autoinc next value.
+ We should not fail here - it just means that we should try to
+ find a new reservation making use of the current *first_value
+ wbich should now be compatible with all partitions.
+ */
+ if (retry)
+ {
+ retry= FALSE;
+ last_value= ~ (ulonglong) 0;
+ release_auto_increment();
+ goto again;
+ }
+ /*
+ We should not get here.
+ */
+ sql_print_error("Failed to calculate auto_increment value for partition");
+
*first_value= ~(ulonglong)(0);
}
if (increment) // If not check for values
@@ -5551,11 +5680,11 @@ static int partition_init= 0;
Function we use in the creation of our hash to get key.
*/
-static byte *partition_get_key(PARTITION_SHARE *share, uint *length,
+static uchar *partition_get_key(PARTITION_SHARE *share, size_t *length,
my_bool not_used __attribute__ ((unused)))
{
*length= share->table_name_length;
- return (byte *) share->table_name;
+ return (uchar *) share->table_name;
}
/*
@@ -5595,12 +5724,12 @@ static PARTITION_SHARE *get_share(const char *table_name, TABLE *table)
length= (uint) strlen(table_name);
if (!(share= (PARTITION_SHARE *) hash_search(&partition_open_tables,
- (byte *) table_name, length)))
+ (uchar *) table_name, length)))
{
if (!(share= (PARTITION_SHARE *)
my_multi_malloc(MYF(MY_WME | MY_ZEROFILL),
- &share, sizeof(*share),
- &tmp_name, length + 1, NullS)))
+ &share, (uint) sizeof(*share),
+ &tmp_name, (uint) length + 1, NullS)))
{
pthread_mutex_unlock(&partition_mutex);
return NULL;
@@ -5610,7 +5739,7 @@ static PARTITION_SHARE *get_share(const char *table_name, TABLE *table)
share->table_name_length= length;
share->table_name= tmp_name;
strmov(share->table_name, table_name);
- if (my_hash_insert(&partition_open_tables, (byte *) share))
+ if (my_hash_insert(&partition_open_tables, (uchar *) share))
goto error;
thr_lock_init(&share->lock);
pthread_mutex_init(&share->mutex, MY_MUTEX_INIT_FAST);
@@ -5622,7 +5751,7 @@ static PARTITION_SHARE *get_share(const char *table_name, TABLE *table)
error:
pthread_mutex_unlock(&partition_mutex);
- my_free((gptr) share, MYF(0));
+ my_free((uchar*) share, MYF(0));
return NULL;
}
@@ -5639,10 +5768,10 @@ static int free_share(PARTITION_SHARE *share)
pthread_mutex_lock(&partition_mutex);
if (!--share->use_count)
{
- hash_delete(&partition_open_tables, (byte *) share);
+ hash_delete(&partition_open_tables, (uchar *) share);
thr_lock_delete(&share->lock);
pthread_mutex_destroy(&share->mutex);
- my_free((gptr) share, MYF(0));
+ my_free((uchar*) share, MYF(0));
}
pthread_mutex_unlock(&partition_mutex);
diff --git a/sql/ha_partition.h b/sql/ha_partition.h
index a081e4bb472..9d10aea2b6f 100644
--- a/sql/ha_partition.h
+++ b/sql/ha_partition.h
@@ -27,6 +27,7 @@ enum partition_keywords
The partition implements the minimum of what you will probably need.
*/
+#ifdef NOT_USED
typedef struct st_partition_share
{
char *table_name;
@@ -34,6 +35,7 @@ typedef struct st_partition_share
pthread_mutex_t mutex;
THR_LOCK lock;
} PARTITION_SHARE;
+#endif
#define PARTITION_BYTES_IN_POS 2
@@ -54,19 +56,19 @@ private:
uint m_open_test_lock; // Open test_if_locked
char *m_file_buffer; // Buffer with names
char *m_name_buffer_ptr; // Pointer to first partition name
- handlerton **m_engine_array; // Array of types of the handlers
+ plugin_ref *m_engine_array; // Array of types of the handlers
handler **m_file; // Array of references to handler inst.
uint m_file_tot_parts; // Debug
handler **m_new_file; // Array of references to new handlers
handler **m_reorged_file; // Reorganised partitions
handler **m_added_file; // Added parts kept for errors
partition_info *m_part_info; // local reference to partition
- byte *m_start_key_ref; // Reference of start key in current
+ uchar *m_start_key_ref; // Reference of start key in current
// index scan info
Field **m_part_field_array; // Part field array locally to save acc
- byte *m_ordered_rec_buffer; // Row and key buffer for ord. idx scan
+ uchar *m_ordered_rec_buffer; // Row and key buffer for ord. idx scan
KEY *m_curr_key_info; // Current index
- byte *m_rec0; // table->record[0]
+ uchar *m_rec0; // table->record[0]
QUEUE m_queue; // Prio queue used by sorted read
/*
Since the partition handler is a handler on top of other handlers, it
@@ -130,7 +132,9 @@ private:
Variables for lock structures.
*/
THR_LOCK_DATA lock; /* MySQL lock */
+#ifdef NOT_USED
PARTITION_SHARE *share; /* Shared lock info */
+#endif
/*
TRUE <=> this object was created with ha_partition::clone and doesn't
@@ -195,8 +199,8 @@ public:
const char *path,
ulonglong *copied,
ulonglong *deleted,
- const void *pack_frm_data,
- uint pack_frm_len);
+ const uchar *pack_frm_data,
+ 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)
@@ -306,9 +310,9 @@ public:
number of calls to write_row.
Not yet though.
*/
- virtual int write_row(byte * buf);
- virtual int update_row(const byte * old_data, byte * new_data);
- virtual int delete_row(const byte * buf);
+ virtual int write_row(uchar * buf);
+ virtual int update_row(const uchar * old_data, uchar * new_data);
+ virtual int delete_row(const uchar * buf);
virtual int delete_all_rows(void);
virtual void start_bulk_insert(ha_rows rows);
virtual int end_bulk_insert();
@@ -347,9 +351,10 @@ public:
*/
virtual int rnd_init(bool scan);
virtual int rnd_end();
- virtual int rnd_next(byte * buf);
- virtual int rnd_pos(byte * buf, byte * pos);
- virtual void position(const byte * record);
+ virtual int rnd_next(uchar * buf);
+ virtual int rnd_pos(uchar * buf, uchar * pos);
+ virtual int rnd_pos_by_record(uchar *record);
+ virtual void position(const uchar * record);
/*
-------------------------------------------------------------------------
@@ -383,9 +388,9 @@ public:
index_init initializes an index before using it and index_end does
any end processing needed.
*/
- virtual int index_read(byte * buf, const byte * key,
- key_part_map keypart_map,
- enum ha_rkey_function find_flag);
+ virtual int index_read_map(uchar * buf, const uchar * key,
+ key_part_map keypart_map,
+ enum ha_rkey_function find_flag);
virtual int index_init(uint idx, bool sorted);
virtual int index_end();
@@ -393,20 +398,20 @@ public:
These methods are used to jump to next or previous entry in the index
scan. There are also methods to jump to first and last entry.
*/
- virtual int index_next(byte * buf);
- virtual int index_prev(byte * buf);
- virtual int index_first(byte * buf);
- virtual int index_last(byte * buf);
- virtual int index_next_same(byte * buf, const byte * key, uint keylen);
- virtual int index_read_last(byte * buf, const byte * key,
- key_part_map keypart_map);
+ virtual int index_next(uchar * buf);
+ virtual int index_prev(uchar * buf);
+ virtual int index_first(uchar * buf);
+ virtual int index_last(uchar * buf);
+ virtual int index_next_same(uchar * buf, const uchar * key, uint keylen);
+ virtual int index_read_last_map(uchar * buf, const uchar * key,
+ key_part_map keypart_map);
/*
read_first_row is virtual method but is only implemented by
handler.cc, no storage engine has implemented it so neither
will the partition handler.
- virtual int read_first_row(byte *buf, uint primary_key);
+ virtual int read_first_row(uchar *buf, uint primary_key);
*/
/*
@@ -424,28 +429,28 @@ public:
virtual int read_range_next();
private:
- int common_index_read(byte * buf, const byte * key,
+ int common_index_read(uchar * buf, const uchar * key,
key_part_map keypart_map,
enum ha_rkey_function find_flag);
- int common_first_last(byte * buf);
- int partition_scan_set_up(byte * buf, bool idx_read_flag);
- int handle_unordered_next(byte * buf, bool next_same);
- int handle_unordered_scan_next_partition(byte * buf);
- byte *queue_buf(uint part_id)
+ int common_first_last(uchar * buf);
+ int partition_scan_set_up(uchar * buf, bool idx_read_flag);
+ int handle_unordered_next(uchar * buf, bool next_same);
+ int handle_unordered_scan_next_partition(uchar * buf);
+ uchar *queue_buf(uint part_id)
{
return (m_ordered_rec_buffer +
(part_id * (m_rec_length + PARTITION_BYTES_IN_POS)));
}
- byte *rec_buf(uint part_id)
+ uchar *rec_buf(uint part_id)
{
return (queue_buf(part_id) +
PARTITION_BYTES_IN_POS);
}
- int handle_ordered_index_scan(byte * buf, bool reverse_order);
- int handle_ordered_next(byte * buf, bool next_same);
- int handle_ordered_prev(byte * buf);
- void return_top_record(byte * buf);
- void include_partition_fields_in_used_fields();
+ int handle_ordered_index_scan(uchar * buf, bool reverse_order);
+ int handle_ordered_next(uchar * buf, bool next_same);
+ int handle_ordered_prev(uchar * buf);
+ void return_top_record(uchar * buf);
+ void column_bitmaps_signal();
public:
/*
-------------------------------------------------------------------------
@@ -464,7 +469,7 @@ public:
virtual int reset(void);
private:
- static const uint NO_CURRENT_PART_ID= 0xFFFFFFFF;
+ static const uint NO_CURRENT_PART_ID;
int loop_extra(enum ha_extra_function operation);
void late_extra_cache(uint partition_id);
void late_extra_no_cache(uint partition_id);
@@ -809,7 +814,7 @@ public:
to check whether the rest of the reference part is also the same.
-------------------------------------------------------------------------
*/
- virtual int cmp_ref(const byte * ref1, const byte * ref2);
+ virtual int cmp_ref(const uchar * ref1, const uchar * ref2);
/*
-------------------------------------------------------------------------
MODULE auto increment
@@ -873,10 +878,10 @@ public:
Fulltext stuff not yet.
-------------------------------------------------------------------------
virtual int ft_init() { return HA_ERR_WRONG_COMMAND; }
- virtual FT_INFO *ft_init_ext(uint flags,uint inx,const byte *key,
+ virtual FT_INFO *ft_init_ext(uint flags,uint inx,const uchar *key,
uint keylen)
{ return NULL; }
- virtual int ft_read(byte *buf) { return HA_ERR_WRONG_COMMAND; }
+ virtual int ft_read(uchar *buf) { return HA_ERR_WRONG_COMMAND; }
*/
/*
@@ -885,7 +890,7 @@ public:
-------------------------------------------------------------------------
The following method is only used by MyISAM when used as
temporary tables in a join.
- virtual int restart_rnd_next(byte *buf, byte *pos);
+ virtual int restart_rnd_next(uchar *buf, uchar *pos);
*/
/*
diff --git a/sql/handler.cc b/sql/handler.cc
index e0018a66400..75c3a64bc27 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -25,8 +25,6 @@
#include "mysql_priv.h"
#include "rpl_filter.h"
-
-
#include <myisampack.h>
#include <errno.h>
@@ -64,7 +62,7 @@ static const LEX_STRING sys_table_aliases[]=
};
const char *ha_row_type[] = {
- "", "FIXED", "DYNAMIC", "COMPRESSED", "REDUNDANT", "COMPACT", "?","?","?"
+ "", "FIXED", "DYNAMIC", "COMPRESSED", "REDUNDANT", "COMPACT", "PAGE", "?","?","?"
};
const char *tx_isolation_names[] =
@@ -77,6 +75,15 @@ static TYPELIB known_extensions= {0,"known_exts", NULL, NULL};
uint known_extensions_id= 0;
+
+static plugin_ref ha_default_plugin(THD *thd)
+{
+ if (thd->variables.table_plugin)
+ return thd->variables.table_plugin;
+ return my_plugin_lock(thd, &global_system_variables.table_plugin);
+}
+
+
/** @brief
Return the default storage engine handlerton for thread
@@ -89,10 +96,11 @@ uint known_extensions_id= 0;
*/
handlerton *ha_default_handlerton(THD *thd)
{
- return (thd->variables.table_type != NULL) ?
- thd->variables.table_type :
- (global_system_variables.table_type != NULL ?
- global_system_variables.table_type : myisam_hton);
+ plugin_ref plugin= ha_default_plugin(thd);
+ DBUG_ASSERT(plugin);
+ handlerton *hton= plugin_data(plugin, handlerton*);
+ DBUG_ASSERT(hton);
+ return hton;
}
@@ -105,26 +113,30 @@ handlerton *ha_default_handlerton(THD *thd)
name name of storage engine
RETURN
- pointer to handlerton
+ pointer to storage engine plugin handle
*/
-handlerton *ha_resolve_by_name(THD *thd, const LEX_STRING *name)
+plugin_ref ha_resolve_by_name(THD *thd, const LEX_STRING *name)
{
const LEX_STRING *table_alias;
- st_plugin_int *plugin;
+ plugin_ref plugin;
redo:
/* my_strnncoll is a macro and gcc doesn't do early expansion of macro */
if (thd && !my_charset_latin1.coll->strnncoll(&my_charset_latin1,
(const uchar *)name->str, name->length,
(const uchar *)STRING_WITH_LEN("DEFAULT"), 0))
- return ha_default_handlerton(thd);
+ return ha_default_plugin(thd);
- if ((plugin= plugin_lock(name, MYSQL_STORAGE_ENGINE_PLUGIN)))
+ if ((plugin= my_plugin_lock_by_name(thd, name, MYSQL_STORAGE_ENGINE_PLUGIN)))
{
- handlerton *hton= (handlerton *)plugin->data;
+ handlerton *hton= plugin_data(plugin, handlerton *);
if (!(hton->flags & HTON_NOT_USER_SELECTABLE))
- return hton;
- plugin_unlock(plugin);
+ return plugin;
+
+ /*
+ unlocking plugin immediately after locking is relatively low cost.
+ */
+ plugin_unlock(thd, plugin);
}
/*
@@ -145,19 +157,19 @@ redo:
}
-const char *ha_get_storage_engine(enum legacy_db_type db_type)
+plugin_ref ha_lock_engine(THD *thd, handlerton *hton)
{
- switch (db_type) {
- case DB_TYPE_DEFAULT:
- return "DEFAULT";
- default:
- if (db_type > DB_TYPE_UNKNOWN && db_type < DB_TYPE_DEFAULT &&
- installed_htons[db_type])
- return hton2plugin[installed_htons[db_type]->slot]->name.str;
- /* fall through */
- case DB_TYPE_UNKNOWN:
- return "UNKNOWN";
+ if (hton)
+ {
+ st_plugin_int **plugin= hton2plugin + hton->slot;
+
+#ifdef DBUG_OFF
+ return my_plugin_lock(thd, plugin);
+#else
+ return my_plugin_lock(thd, &plugin);
+#endif
}
+ return NULL;
}
@@ -172,14 +184,16 @@ static handler *create_default(TABLE_SHARE *table, MEM_ROOT *mem_root)
handlerton *ha_resolve_by_legacy_type(THD *thd, enum legacy_db_type db_type)
{
+ plugin_ref plugin;
switch (db_type) {
case DB_TYPE_DEFAULT:
return ha_default_handlerton(thd);
- case DB_TYPE_UNKNOWN:
- return NULL;
default:
- if (db_type > DB_TYPE_UNKNOWN && db_type < DB_TYPE_DEFAULT)
- return installed_htons[db_type];
+ if (db_type > DB_TYPE_UNKNOWN && db_type < DB_TYPE_DEFAULT &&
+ (plugin= ha_lock_engine(thd, installed_htons[db_type])))
+ return plugin_data(plugin, handlerton*);
+ /* fall through */
+ case DB_TYPE_UNKNOWN:
return NULL;
}
}
@@ -199,7 +213,7 @@ handlerton *ha_checktype(THD *thd, enum legacy_db_type database_type,
{
if (report_error)
{
- const char *engine_name= ha_get_storage_engine(database_type);
+ const char *engine_name= ha_resolve_storage_engine_name(hton);
my_error(ER_FEATURE_DISABLED,MYF(0),engine_name,engine_name);
}
return NULL;
@@ -238,8 +252,7 @@ handler *get_new_handler(TABLE_SHARE *share, MEM_ROOT *alloc,
Here the call to current_thd() is ok as we call this function a lot of
times but we enter this branch very seldom.
*/
- DBUG_RETURN(get_new_handler(share, alloc,
- current_thd->variables.table_type));
+ DBUG_RETURN(get_new_handler(share, alloc, ha_default_handlerton(current_thd)));
}
@@ -353,7 +366,7 @@ static int ha_finish_errors(void)
/* Allocate a pointer array for the error message strings. */
if (! (errmsgs= my_error_unregister(HA_ERR_FIRST, HA_ERR_LAST)))
return 1;
- my_free((gptr) errmsgs, MYF(0));
+ my_free((uchar*) errmsgs, MYF(0));
return 0;
}
@@ -391,7 +404,7 @@ int ha_finalize_handlerton(st_plugin_int *plugin)
}
}
- my_free((gptr)hton, MYF(0));
+ my_free((uchar*)hton, MYF(0));
DBUG_RETURN(0);
}
@@ -401,6 +414,7 @@ int ha_initialize_handlerton(st_plugin_int *plugin)
{
handlerton *hton;
DBUG_ENTER("ha_initialize_handlerton");
+ DBUG_PRINT("plugin", ("initialize plugin: '%s'", plugin->name.str));
hton= (handlerton *)my_malloc(sizeof(handlerton),
MYF(MY_WME | MY_ZEROFILL));
@@ -522,10 +536,10 @@ int ha_end()
DBUG_RETURN(error);
}
-static my_bool dropdb_handlerton(THD *unused1, st_plugin_int *plugin,
+static my_bool dropdb_handlerton(THD *unused1, plugin_ref plugin,
void *path)
{
- handlerton *hton= (handlerton *)plugin->data;
+ handlerton *hton= plugin_data(plugin, handlerton *);
if (hton->state == SHOW_OPTION_YES && hton->drop_database)
hton->drop_database(hton, (char *)path);
return FALSE;
@@ -538,16 +552,16 @@ void ha_drop_database(char* path)
}
-static my_bool closecon_handlerton(THD *thd, st_plugin_int *plugin,
+static my_bool closecon_handlerton(THD *thd, plugin_ref plugin,
void *unused)
{
- handlerton *hton= (handlerton *)plugin->data;
+ handlerton *hton= plugin_data(plugin, handlerton *);
/*
there's no need to rollback here as all transactions must
be rolled back already
*/
if (hton->state == SHOW_OPTION_YES && hton->close_connection &&
- thd->ha_data[hton->slot])
+ thd_get_ha_data(thd, hton))
hton->close_connection(hton, thd);
return FALSE;
}
@@ -623,7 +637,7 @@ int ha_prepare(THD *thd)
for (; *ht; ht++)
{
int err;
- statistic_increment(thd->status_var.ha_prepare_count,&LOCK_status);
+ status_var_increment(thd->status_var.ha_prepare_count);
if ((*ht)->prepare)
{
if ((err= (*(*ht)->prepare)(*ht, thd, all)))
@@ -638,7 +652,7 @@ int ha_prepare(THD *thd)
{
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_ILLEGAL_HA, ER(ER_ILLEGAL_HA),
- hton2plugin[(*ht)->slot]->name.str);
+ ha_resolve_storage_engine_name(*ht));
}
}
}
@@ -718,7 +732,7 @@ int ha_commit_trans(THD *thd, bool all)
my_error(ER_ERROR_DURING_COMMIT, MYF(0), err);
error= 1;
}
- statistic_increment(thd->status_var.ha_prepare_count,&LOCK_status);
+ status_var_increment(thd->status_var.ha_prepare_count);
}
DBUG_EXECUTE_IF("crash_commit_after_prepare", abort(););
if (error || (is_real_trans && xid &&
@@ -765,7 +779,7 @@ int ha_commit_one_phase(THD *thd, bool all)
my_error(ER_ERROR_DURING_COMMIT, MYF(0), err);
error=1;
}
- statistic_increment(thd->status_var.ha_commit_count,&LOCK_status);
+ status_var_increment(thd->status_var.ha_commit_count);
*ht= 0;
}
trans->nht=0;
@@ -821,7 +835,7 @@ int ha_rollback_trans(THD *thd, bool all)
my_error(ER_ERROR_DURING_ROLLBACK, MYF(0), err);
error=1;
}
- statistic_increment(thd->status_var.ha_rollback_count,&LOCK_status);
+ status_var_increment(thd->status_var.ha_rollback_count);
*ht= 0;
}
trans->nht=0;
@@ -835,6 +849,9 @@ int ha_rollback_trans(THD *thd, bool all)
}
}
#endif /* USING_TRANSACTIONS */
+ if (all)
+ thd->transaction_rollback_request= FALSE;
+
/*
If a non-transactional table was updated, warn; don't warn if this is a
slave thread (because when a slave thread executes a ROLLBACK, it has
@@ -844,7 +861,7 @@ int ha_rollback_trans(THD *thd, bool all)
the error log; but we don't want users to wonder why they have this
message in the error log, so we don't send it.
*/
- if (is_real_trans && thd->no_trans_update.all &&
+ if (is_real_trans && thd->transaction.all.modified_non_trans_table &&
!thd->slave_thread && thd->killed != THD::KILL_CONNECTION)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARNING_NOT_COMPLETE_ROLLBACK,
@@ -871,6 +888,8 @@ int ha_autocommit_or_rollback(THD *thd, int error)
if (ha_commit_stmt(thd))
error=1;
}
+ else if (thd->transaction_rollback_request && !thd->in_sub_stmt)
+ (void) ha_rollback(thd);
else
(void) ha_rollback_stmt(thd);
@@ -886,10 +905,10 @@ struct xahton_st {
int result;
};
-static my_bool xacommit_handlerton(THD *unused1, st_plugin_int *plugin,
+static my_bool xacommit_handlerton(THD *unused1, plugin_ref plugin,
void *arg)
{
- handlerton *hton= (handlerton *)plugin->data;
+ handlerton *hton= plugin_data(plugin, handlerton *);
if (hton->state == SHOW_OPTION_YES && hton->recover)
{
hton->commit_by_xid(hton, ((struct xahton_st *)arg)->xid);
@@ -898,10 +917,10 @@ static my_bool xacommit_handlerton(THD *unused1, st_plugin_int *plugin,
return FALSE;
}
-static my_bool xarollback_handlerton(THD *unused1, st_plugin_int *plugin,
+static my_bool xarollback_handlerton(THD *unused1, plugin_ref plugin,
void *arg)
{
- handlerton *hton= (handlerton *)plugin->data;
+ handlerton *hton= plugin_data(plugin, handlerton *);
if (hton->state == SHOW_OPTION_YES && hton->recover)
{
hton->rollback_by_xid(hton, ((struct xahton_st *)arg)->xid);
@@ -1004,10 +1023,10 @@ struct xarecover_st
bool dry_run;
};
-static my_bool xarecover_handlerton(THD *unused, st_plugin_int *plugin,
+static my_bool xarecover_handlerton(THD *unused, plugin_ref plugin,
void *arg)
{
- handlerton *hton= (handlerton *)plugin->data;
+ handlerton *hton= plugin_data(plugin, handlerton *);
struct xarecover_st *info= (struct xarecover_st *) arg;
int got;
@@ -1016,7 +1035,7 @@ static my_bool xarecover_handlerton(THD *unused, st_plugin_int *plugin,
while ((got= hton->recover(hton, info->list, info->len)) > 0 )
{
sql_print_information("Found %d prepared transaction(s) in %s",
- got, hton2plugin[hton->slot]->name.str);
+ got, ha_resolve_storage_engine_name(hton));
for (int i=0; i < got; i ++)
{
my_xid x=info->list[i].get_my_xid();
@@ -1037,7 +1056,7 @@ static my_bool xarecover_handlerton(THD *unused, st_plugin_int *plugin,
}
// recovery mode
if (info->commit_list ?
- hash_search(info->commit_list, (byte *)&x, sizeof(x)) != 0 :
+ hash_search(info->commit_list, (uchar *)&x, sizeof(x)) != 0 :
tc_heuristic_recover == TC_HEURISTIC_RECOVER_COMMIT)
{
#ifndef DBUG_OFF
@@ -1107,7 +1126,7 @@ int ha_recover(HASH *commit_list)
plugin_foreach(NULL, xarecover_handlerton,
MYSQL_STORAGE_ENGINE_PLUGIN, &info);
- my_free((gptr)info.list, MYF(0));
+ my_free((uchar*)info.list, MYF(0));
if (info.found_foreign_xids)
sql_print_warning("Found %d prepared XA transactions",
info.found_foreign_xids);
@@ -1192,10 +1211,10 @@ bool mysql_xa_recover(THD *thd)
thd: the thread handle of the current connection
return value: always 0
*/
-static my_bool release_temporary_latches(THD *thd, st_plugin_int *plugin,
+static my_bool release_temporary_latches(THD *thd, plugin_ref plugin,
void *unused)
{
- handlerton *hton= (handlerton *)plugin->data;
+ handlerton *hton= plugin_data(plugin, handlerton *);
if (hton->state == SHOW_OPTION_YES && hton->release_temporary_latches)
hton->release_temporary_latches(hton, thd);
@@ -1231,13 +1250,12 @@ int ha_rollback_to_savepoint(THD *thd, SAVEPOINT *sv)
{
int err;
DBUG_ASSERT((*ht)->savepoint_set != 0);
- if ((err= (*(*ht)->savepoint_rollback)(*ht, thd, (byte *)(sv+1)+(*ht)->savepoint_offset)))
+ if ((err= (*(*ht)->savepoint_rollback)(*ht, thd, (uchar *)(sv+1)+(*ht)->savepoint_offset)))
{ // cannot happen
my_error(ER_ERROR_DURING_ROLLBACK, MYF(0), err);
error=1;
}
- statistic_increment(thd->status_var.ha_savepoint_rollback_count,
- &LOCK_status);
+ status_var_increment(thd->status_var.ha_savepoint_rollback_count);
trans->no_2pc|=(*ht)->prepare == 0;
}
/*
@@ -1252,7 +1270,7 @@ int ha_rollback_to_savepoint(THD *thd, SAVEPOINT *sv)
my_error(ER_ERROR_DURING_ROLLBACK, MYF(0), err);
error=1;
}
- statistic_increment(thd->status_var.ha_rollback_count,&LOCK_status);
+ status_var_increment(thd->status_var.ha_rollback_count);
*ht=0; // keep it conveniently zero-filled
}
DBUG_RETURN(error);
@@ -1280,12 +1298,12 @@ int ha_savepoint(THD *thd, SAVEPOINT *sv)
error=1;
break;
}
- if ((err= (*(*ht)->savepoint_set)(*ht, thd, (byte *)(sv+1)+(*ht)->savepoint_offset)))
+ if ((err= (*(*ht)->savepoint_set)(*ht, thd, (uchar *)(sv+1)+(*ht)->savepoint_offset)))
{ // cannot happen
my_error(ER_GET_ERRNO, MYF(0), err);
error=1;
}
- statistic_increment(thd->status_var.ha_savepoint_count,&LOCK_status);
+ status_var_increment(thd->status_var.ha_savepoint_count);
}
sv->nht=trans->nht;
#endif /* USING_TRANSACTIONS */
@@ -1307,7 +1325,7 @@ int ha_release_savepoint(THD *thd, SAVEPOINT *sv)
if (!(*ht)->savepoint_release)
continue;
if ((err= (*(*ht)->savepoint_release)(*ht, thd,
- (byte *)(sv+1)+
+ (uchar *)(sv+1)+
(*ht)->savepoint_offset)))
{ // cannot happen
my_error(ER_GET_ERRNO, MYF(0), err);
@@ -1318,10 +1336,10 @@ int ha_release_savepoint(THD *thd, SAVEPOINT *sv)
}
-static my_bool snapshot_handlerton(THD *thd, st_plugin_int *plugin,
+static my_bool snapshot_handlerton(THD *thd, plugin_ref plugin,
void *arg)
{
- handlerton *hton= (handlerton *)plugin->data;
+ handlerton *hton= plugin_data(plugin, handlerton *);
if (hton->state == SHOW_OPTION_YES &&
hton->start_consistent_snapshot)
{
@@ -1349,10 +1367,10 @@ int ha_start_consistent_snapshot(THD *thd)
}
-static my_bool flush_handlerton(THD *thd, st_plugin_int *plugin,
+static my_bool flush_handlerton(THD *thd, plugin_ref plugin,
void *arg)
{
- handlerton *hton= (handlerton *)plugin->data;
+ handlerton *hton= plugin_data(plugin, handlerton *);
if (hton->state == SHOW_OPTION_YES && hton->flush_logs &&
hton->flush_logs(hton))
return TRUE;
@@ -1377,6 +1395,25 @@ bool ha_flush_logs(handlerton *db_type)
return FALSE;
}
+static const char *check_lowercase_names(handler *file, const char *path,
+ char *tmp_path)
+{
+ if (lower_case_table_names != 2 || (file->ha_table_flags() & HA_FILE_BASED))
+ return path;
+
+ /* Ensure that table handler get path in lower case */
+ if (tmp_path != path)
+ strmov(tmp_path, path);
+
+ /*
+ we only should turn into lowercase database/table part
+ so start the process after homedirectory
+ */
+ my_casedn_str(files_charset_info, tmp_path + mysql_data_home_len);
+ return tmp_path;
+}
+
+
/** @brief
This should return ENOENT if the file doesn't exists.
The .frm file will be deleted only if we return 0 or ENOENT
@@ -1397,16 +1434,10 @@ int ha_delete_table(THD *thd, handlerton *table_type, const char *path,
/* DB_TYPE_UNKNOWN is used in ALTER TABLE when renaming only .frm files */
if (table_type == NULL ||
- ! (file=get_new_handler(&dummy_share, thd->mem_root, table_type)))
+ ! (file=get_new_handler((TABLE_SHARE*)0, thd->mem_root, table_type)))
DBUG_RETURN(ENOENT);
- if (lower_case_table_names == 2 && !(file->ha_table_flags() & HA_FILE_BASED))
- {
- /* Ensure that table handler get path in lower case */
- strmov(tmp_path, path);
- my_casedn_str(files_charset_info, tmp_path);
- path= tmp_path;
- }
+ path= check_lowercase_names(file, path, tmp_path);
if ((error= file->delete_table(path)) && generate_warning)
{
/*
@@ -1425,7 +1456,7 @@ int ha_delete_table(THD *thd, handlerton *table_type, const char *path,
strmake(buff, thd->net.last_error, sizeof(buff)-1);
thd->query_error= 0;
- thd->spcont= 0;
+ thd->spcont= NULL;
thd->lex->current_select= 0;
thd->net.last_error[0]= 0;
@@ -1438,6 +1469,8 @@ int ha_delete_table(THD *thd, handlerton *table_type, const char *path,
dummy_share.table_name.length= strlen(alias);
dummy_table.alias= alias;
+ file->table_share= &dummy_share;
+ file->table= &dummy_table;
file->print_error(error, 0);
strmake(new_error, thd->net.last_error, sizeof(buff)-1);
@@ -1458,7 +1491,7 @@ int ha_delete_table(THD *thd, handlerton *table_type, const char *path,
****************************************************************************/
handler *handler::clone(MEM_ROOT *mem_root)
{
- handler *new_handler= get_new_handler(table->s, mem_root, table->s->db_type);
+ handler *new_handler= get_new_handler(table->s, mem_root, table->s->db_type());
if (new_handler && !new_handler->ha_open(table,
table->s->normalized_path.str,
table->db_stat,
@@ -1471,38 +1504,21 @@ handler *handler::clone(MEM_ROOT *mem_root)
void handler::ha_statistic_increment(ulong SSV::*offset) const
{
- statistic_increment(table->in_use->status_var.*offset, &LOCK_status);
+ status_var_increment(table->in_use->status_var.*offset);
}
+void **handler::ha_data(THD *thd) const
+{
+ return thd_ha_data(thd, ht);
+}
-bool handler::check_if_log_table_locking_is_allowed(uint sql_command,
- ulong type, TABLE *table)
+THD *handler::ha_thd(void) const
{
- /*
- Deny locking of the log tables, which is incompatible with
- concurrent insert. The routine is not called if the table is
- being locked from a logger THD (general_log_thd or slow_log_thd)
- or from a privileged thread (see log.cc for details)
- */
- if (table->s->log_table &&
- sql_command != SQLCOM_TRUNCATE &&
- sql_command != SQLCOM_ALTER_TABLE &&
- !(sql_command == SQLCOM_FLUSH &&
- type & REFRESH_LOG) &&
- (table->reginfo.lock_type >= TL_READ_NO_INSERT))
- {
- /*
- The check >= TL_READ_NO_INSERT denies all write locks
- plus the only read lock (TL_READ_NO_INSERT itself)
- */
- table->reginfo.lock_type == TL_READ_NO_INSERT ?
- my_error(ER_CANT_READ_LOCK_LOG_TABLE, MYF(0)) :
- my_error(ER_CANT_WRITE_LOCK_LOG_TABLE, MYF(0));
- return FALSE;
- }
- return TRUE;
+ DBUG_ASSERT(!table || !table->in_use || table->in_use == current_thd);
+ return (table && table->in_use) ? table->in_use : current_thd;
}
+
/** @brief
Open database-handler.
@@ -1544,7 +1560,7 @@ int handler::ha_open(TABLE *table_arg, const char *name, int mode,
table->db_stat|=HA_READ_ONLY;
(void) extra(HA_EXTRA_NO_READCHECK); // Not needed in SQL
- if (!(ref= (byte*) alloc_root(&table->mem_root, ALIGN_SIZE(ref_length)*2)))
+ if (!(ref= (uchar*) alloc_root(&table->mem_root, ALIGN_SIZE(ref_length)*2)))
{
close();
error=HA_ERR_OUT_OF_MEM;
@@ -1562,13 +1578,12 @@ int handler::ha_open(TABLE *table_arg, const char *name, int mode,
This is never called for InnoDB tables, as these table types
has the HA_STATS_RECORDS_IS_EXACT set.
*/
-int handler::read_first_row(byte * buf, uint primary_key)
+int handler::read_first_row(uchar * buf, uint primary_key)
{
register int error;
DBUG_ENTER("handler::read_first_row");
- statistic_increment(table->in_use->status_var.ha_read_first_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_first_count);
/*
If there is very few deleted rows in the table, find the first row by
@@ -1972,13 +1987,13 @@ void handler::get_auto_increment(ulonglong offset, ulonglong increment,
}
else
{
- byte key[MAX_KEY_LENGTH];
+ uchar key[MAX_KEY_LENGTH];
key_copy(key, table->record[0],
table->key_info + table->s->next_number_index,
table->s->next_number_key_offset);
- error= index_read(table->record[1], key,
- make_prev_keypart_map(table->s->next_number_keypart),
- HA_READ_PREFIX_LAST);
+ error= index_read_map(table->record[1], key,
+ make_prev_keypart_map(table->s->next_number_keypart),
+ HA_READ_PREFIX_LAST);
/*
MySQL needs to call us for next row: assume we are inserting ("a",null)
here, we return 3, and next this statement will want to insert
@@ -2026,8 +2041,7 @@ void handler::print_keydup_error(uint key_nr, const char *msg)
{
/* Key is unknown */
str.copy("", 0, system_charset_info);
- my_printf_error(ER_DUP_ENTRY_WITH_KEY_NAME, msg,
- MYF(0), str.c_ptr(), "*UNKNOWN*");
+ my_printf_error(ER_DUP_ENTRY, msg, MYF(0), str.c_ptr(), "*UNKNOWN*");
}
else
{
@@ -2039,7 +2053,7 @@ void handler::print_keydup_error(uint key_nr, const char *msg)
str.length(max_length-4);
str.append(STRING_WITH_LEN("..."));
}
- my_printf_error(ER_DUP_ENTRY_WITH_KEY_NAME, msg,
+ my_printf_error(ER_DUP_ENTRY, msg,
MYF(0), str.c_ptr(), table->key_info[key_nr].name);
}
}
@@ -2316,7 +2330,13 @@ static bool update_frm_version(TABLE *table)
int result= 1;
DBUG_ENTER("update_frm_version");
- if (table->s->mysql_version != MYSQL_VERSION_ID)
+ /*
+ No need to update frm version in case table was created or checked
+ by server with the same version. This also ensures that we do not
+ update frm version for temporary tables as this code doesn't support
+ temporary tables.
+ */
+ if (table->s->mysql_version == MYSQL_VERSION_ID)
DBUG_RETURN(0);
strxmov(path, table->s->normalized_path.str, reg_ext, NullS);
@@ -2331,12 +2351,12 @@ static bool update_frm_version(TABLE *table)
int4store(version, MYSQL_VERSION_ID);
- if ((result= my_pwrite(file,(byte*) version,4,51L,MYF_RW)))
+ if ((result= my_pwrite(file,(uchar*) version,4,51L,MYF_RW)))
goto err;
- for (entry=(TABLE*) hash_first(&open_cache,(byte*) key,key_length, &state);
+ for (entry=(TABLE*) hash_first(&open_cache,(uchar*) key,key_length, &state);
entry;
- entry= (TABLE*) hash_next(&open_cache,(byte*) key,key_length, &state))
+ entry= (TABLE*) hash_next(&open_cache,(uchar*) key,key_length, &state))
entry->s->mysql_version= MYSQL_VERSION_ID;
}
err:
@@ -2499,7 +2519,7 @@ int ha_enable_transaction(THD *thd, bool on)
DBUG_RETURN(error);
}
-int handler::index_next_same(byte *buf, const byte *key, uint keylen)
+int handler::index_next_same(uchar *buf, const uchar *key, uint keylen)
{
int error;
if (!(error=index_next(buf)))
@@ -2571,15 +2591,7 @@ int ha_create_table(THD *thd, const char *path,
if (update_create_info)
update_create_info_from_table(create_info, &table);
- name= share.path.str;
- if (lower_case_table_names == 2 &&
- !(table.file->ha_table_flags() & HA_FILE_BASED))
- {
- /* Ensure that handler gets name in lower case */
- strmov(name_buff, name);
- my_casedn_str(files_charset_info, name_buff);
- name= name_buff;
- }
+ name= check_lowercase_names(table.file, share.path.str, name_buff);
error= table.file->create(name, &table, create_info);
VOID(closefrm(&table, 0));
@@ -2608,8 +2620,8 @@ err:
int ha_create_table_from_engine(THD* thd, const char *db, const char *name)
{
int error;
- const void *frmblob;
- uint frmlen;
+ uchar *frmblob;
+ size_t frmlen;
char path[FN_REFLEN];
HA_CREATE_INFO create_info;
TABLE table;
@@ -2617,7 +2629,7 @@ int ha_create_table_from_engine(THD* thd, const char *db, const char *name)
DBUG_ENTER("ha_create_table_from_engine");
DBUG_PRINT("enter", ("name '%s'.'%s'", db, name));
- bzero((char*) &create_info,sizeof(create_info));
+ bzero((uchar*) &create_info,sizeof(create_info));
if ((error= ha_discover(thd, db, name, &frmblob, &frmlen)))
{
/* Table could not be discovered and thus not created */
@@ -2629,10 +2641,11 @@ int ha_create_table_from_engine(THD* thd, const char *db, const char *name)
frmblob and frmlen are set, write the frm to disk
*/
- (void)strxnmov(path,FN_REFLEN-1,mysql_data_home,"/",db,"/",name,NullS);
+ (void)strxnmov(path,FN_REFLEN-1,mysql_data_home,FN_ROOTDIR,
+ db,FN_ROOTDIR,name,NullS);
// Save the frm file
error= writefrm(path, frmblob, frmlen);
- my_free((char*) frmblob, MYF(0));
+ my_free(frmblob, MYF(0));
if (error)
DBUG_RETURN(2);
@@ -2650,12 +2663,7 @@ int ha_create_table_from_engine(THD* thd, const char *db, const char *name)
update_create_info_from_table(&create_info, &table);
create_info.table_options|= HA_OPTION_CREATE_FROM_ENGINE;
- if (lower_case_table_names == 2 &&
- !(table.file->ha_table_flags() & HA_FILE_BASED))
- {
- /* Ensure that handler gets name in lower case */
- my_casedn_str(files_charset_info, path);
- }
+ check_lowercase_names(table.file, path, path);
error=table.file->create(path,&table,&create_info);
VOID(closefrm(&table, 1));
@@ -2689,8 +2697,8 @@ int ha_init_key_cache(const char *name, KEY_CACHE *key_cache)
if (!key_cache->key_cache_inited)
{
pthread_mutex_lock(&LOCK_global_system_variables);
- long tmp_buff_size= (long) key_cache->param_buff_size;
- long tmp_block_size= (long) key_cache->param_block_size;
+ ulong tmp_buff_size= (ulong) key_cache->param_buff_size;
+ uint tmp_block_size= (uint) key_cache->param_block_size;
uint division_limit= key_cache->param_division_limit;
uint age_threshold= key_cache->param_age_threshold;
pthread_mutex_unlock(&LOCK_global_system_variables);
@@ -2774,15 +2782,15 @@ struct st_discover_args
{
const char *db;
const char *name;
- const void** frmblob;
- uint* frmlen;
+ uchar **frmblob;
+ size_t *frmlen;
};
-static my_bool discover_handlerton(THD *thd, st_plugin_int *plugin,
+static my_bool discover_handlerton(THD *thd, plugin_ref plugin,
void *arg)
{
st_discover_args *vargs= (st_discover_args *)arg;
- handlerton *hton= (handlerton *)plugin->data;
+ handlerton *hton= plugin_data(plugin, handlerton *);
if (hton->state == SHOW_OPTION_YES && hton->discover &&
(!(hton->discover(hton, thd, vargs->db, vargs->name,
vargs->frmblob,
@@ -2793,7 +2801,7 @@ static my_bool discover_handlerton(THD *thd, st_plugin_int *plugin,
}
int ha_discover(THD *thd, const char *db, const char *name,
- const void **frmblob, uint *frmlen)
+ uchar **frmblob, size_t *frmlen)
{
int error= -1; // Table does not exist in any handler
DBUG_ENTER("ha_discover");
@@ -2808,7 +2816,7 @@ int ha_discover(THD *thd, const char *db, const char *name,
error= 0;
if (!error)
- statistic_increment(thd->status_var.ha_discover_count,&LOCK_status);
+ status_var_increment(thd->status_var.ha_discover_count);
DBUG_RETURN(error);
}
@@ -2824,14 +2832,14 @@ struct st_find_files_args
const char *path;
const char *wild;
bool dir;
- List<char> *files;
+ List<LEX_STRING> *files;
};
-static my_bool find_files_handlerton(THD *thd, st_plugin_int *plugin,
+static my_bool find_files_handlerton(THD *thd, plugin_ref plugin,
void *arg)
{
st_find_files_args *vargs= (st_find_files_args *)arg;
- handlerton *hton= (handlerton *)plugin->data;
+ handlerton *hton= plugin_data(plugin, handlerton *);
if (hton->state == SHOW_OPTION_YES && hton->find_files)
@@ -2844,7 +2852,7 @@ static my_bool find_files_handlerton(THD *thd, st_plugin_int *plugin,
int
ha_find_files(THD *thd,const char *db,const char *path,
- const char *wild, bool dir, List<char> *files)
+ const char *wild, bool dir, List<LEX_STRING> *files)
{
int error= 0;
DBUG_ENTER("ha_find_files");
@@ -2858,45 +2866,50 @@ ha_find_files(THD *thd,const char *db,const char *path,
DBUG_RETURN(error);
}
-
-/** @brief
+/*
Ask handler if the table exists in engine
RETURN
- 0 Table does not exist
- 1 Table exists
- # Error code
+ HA_ERR_NO_SUCH_TABLE Table does not exist
+ HA_ERR_TABLE_EXIST Table exists
+ # Error code
+
+ */
-*/
struct st_table_exists_in_engine_args
{
const char *db;
const char *name;
+ int err;
};
-static my_bool table_exists_in_engine_handlerton(THD *thd, st_plugin_int *plugin,
+static my_bool table_exists_in_engine_handlerton(THD *thd, plugin_ref plugin,
void *arg)
{
st_table_exists_in_engine_args *vargs= (st_table_exists_in_engine_args *)arg;
- handlerton *hton= (handlerton *)plugin->data;
+ handlerton *hton= plugin_data(plugin, handlerton *);
+
+ int err= HA_ERR_NO_SUCH_TABLE;
if (hton->state == SHOW_OPTION_YES && hton->table_exists_in_engine)
- if ((hton->table_exists_in_engine(hton, thd, vargs->db, vargs->name)) == 1)
- return TRUE;
+ err = hton->table_exists_in_engine(hton, thd, vargs->db, vargs->name);
+
+ vargs->err = err;
+ if (vargs->err == HA_ERR_TABLE_EXIST)
+ return TRUE;
return FALSE;
}
int ha_table_exists_in_engine(THD* thd, const char* db, const char* name)
{
- int error= 0;
DBUG_ENTER("ha_table_exists_in_engine");
DBUG_PRINT("enter", ("db: %s, name: %s", db, name));
- st_table_exists_in_engine_args args= {db, name};
- error= plugin_foreach(thd, table_exists_in_engine_handlerton,
+ st_table_exists_in_engine_args args= {db, name, HA_ERR_NO_SUCH_TABLE};
+ plugin_foreach(thd, table_exists_in_engine_handlerton,
MYSQL_STORAGE_ENGINE_PLUGIN, &args);
- DBUG_PRINT("exit", ("error: %d", error));
- DBUG_RETURN(error);
+ DBUG_PRINT("exit", ("error: %d", args.err));
+ DBUG_RETURN(args.err);
}
#ifdef HAVE_NDB_BINLOG
@@ -2922,10 +2935,10 @@ struct binlog_func_st
/** @brief
Listing handlertons first to avoid recursive calls and deadlock
*/
-static my_bool binlog_func_list(THD *thd, st_plugin_int *plugin, void *arg)
+static my_bool binlog_func_list(THD *thd, plugin_ref plugin, void *arg)
{
hton_list_st *hton_list= (hton_list_st *)arg;
- handlerton *hton= (handlerton *)plugin->data;
+ handlerton *hton= plugin_data(plugin, handlerton *);
if (hton->state == SHOW_OPTION_YES && hton->binlog_func)
{
uint sz= hton_list->sz;
@@ -3012,10 +3025,10 @@ static my_bool binlog_log_query_handlerton2(THD *thd,
}
static my_bool binlog_log_query_handlerton(THD *thd,
- st_plugin_int *plugin,
+ plugin_ref plugin,
void *args)
{
- return binlog_log_query_handlerton2(thd, (handlerton *)plugin->data, args);
+ return binlog_log_query_handlerton2(thd, plugin_data(plugin, handlerton *), args);
}
void ha_binlog_log_query(THD *thd, handlerton *hton,
@@ -3171,7 +3184,8 @@ int handler::read_multi_range_next(KEY_MULTI_RANGE **found_range_p)
read_range_first()
start_key Start key. Is 0 if no min range
end_key End key. Is 0 if no max range
- eq_range_arg Set to 1 if start_key == end_key
+ eq_range_arg Set to 1 if start_key == end_key and the range endpoints
+ will not change during query execution.
sorted Set to 1 if result should be sorted per key
NOTES
@@ -3203,10 +3217,10 @@ int handler::read_range_first(const key_range *start_key,
if (!start_key) // Read first record
result= index_first(table->record[0]);
else
- result= index_read(table->record[0],
- start_key->key,
- start_key->keypart_map,
- start_key->flag);
+ result= index_read_map(table->record[0],
+ start_key->key,
+ start_key->keypart_map,
+ start_key->flag);
if (result)
DBUG_RETURN((result == HA_ERR_KEY_NOT_FOUND)
? HA_ERR_END_OF_FILE
@@ -3278,15 +3292,15 @@ int handler::compare_key(key_range *range)
}
-int handler::index_read_idx(byte * buf, uint index, const byte * key,
- key_part_map keypart_map,
- enum ha_rkey_function find_flag)
+int handler::index_read_idx_map(uchar * buf, uint index, const uchar * key,
+ key_part_map keypart_map,
+ enum ha_rkey_function find_flag)
{
int error, error1;
error= index_init(index, 0);
if (!error)
{
- error= index_read(buf, key, keypart_map, find_flag);
+ error= index_read_map(buf, key, keypart_map, find_flag);
error1= index_end();
}
return error ? error : error1;
@@ -3307,11 +3321,11 @@ int handler::index_read_idx(byte * buf, uint index, const byte * key,
RETURN VALUE
pointer pointer to TYPELIB structure
*/
-static my_bool exts_handlerton(THD *unused, st_plugin_int *plugin,
+static my_bool exts_handlerton(THD *unused, plugin_ref plugin,
void *arg)
{
List<char> *found_exts= (List<char> *) arg;
- handlerton *hton= (handlerton *)plugin->data;
+ handlerton *hton= plugin_data(plugin, handlerton *);
handler *file;
if (hton->state == SHOW_OPTION_YES && hton->create &&
(file= hton->create(hton, (TABLE_SHARE*) 0, current_thd->mem_root)))
@@ -3344,8 +3358,8 @@ TYPELIB *ha_known_exts(void)
const char **ext, *old_ext;
known_extensions_id= mysys_usage_id;
- found_exts.push_back((char*) triggers_file_ext);
- found_exts.push_back((char*) trigname_file_ext);
+ found_exts.push_back((char*) TRG_EXT);
+ found_exts.push_back((char*) TRN_EXT);
plugin_foreach(NULL, exts_handlerton,
MYSQL_STORAGE_ENGINE_PLUGIN, &found_exts);
@@ -3382,11 +3396,11 @@ static bool stat_print(THD *thd, const char *type, uint type_len,
}
-static my_bool showstat_handlerton(THD *thd, st_plugin_int *plugin,
+static my_bool showstat_handlerton(THD *thd, plugin_ref plugin,
void *arg)
{
enum ha_stat_type stat= *(enum ha_stat_type *) arg;
- handlerton *hton= (handlerton *)plugin->data;
+ handlerton *hton= plugin_data(plugin, handlerton *);
if (hton->state == SHOW_OPTION_YES && hton->show_status &&
hton->show_status(hton, thd, stat_print, stat))
return TRUE;
@@ -3452,8 +3466,7 @@ namespace {
if (table->s->cached_row_logging_check == -1)
{
int const check(table->s->tmp_table == NO_TMP_TABLE &&
- binlog_filter->db_ok(table->s->db.str) &&
- !table->no_replicate);
+ binlog_filter->db_ok(table->s->db.str));
table->s->cached_row_logging_check= check;
}
@@ -3461,9 +3474,9 @@ namespace {
table->s->cached_row_logging_check == 1);
return (thd->current_stmt_binlog_row_based &&
+ table->s->cached_row_logging_check &&
(thd->options & OPTION_BIN_LOG) &&
- mysql_bin_log.is_open() &&
- table->s->cached_row_logging_check);
+ mysql_bin_log.is_open());
}
}
@@ -3538,10 +3551,10 @@ namespace
template<class RowsEventT> int
binlog_log_row(TABLE* table,
- const byte *before_record,
- const byte *after_record)
+ const uchar *before_record,
+ const uchar *after_record)
{
- if (table->file->ha_table_flags() & HA_HAS_OWN_BINLOGGING)
+ if (table->no_replicate)
return 0;
bool error= 0;
THD *const thd= table->in_use;
@@ -3588,13 +3601,13 @@ namespace
*/
template int
- binlog_log_row<Write_rows_log_event>(TABLE *, const byte *, const byte *);
+ binlog_log_row<Write_rows_log_event>(TABLE *, const uchar *, const uchar *);
template int
- binlog_log_row<Delete_rows_log_event>(TABLE *, const byte *, const byte *);
+ binlog_log_row<Delete_rows_log_event>(TABLE *, const uchar *, const uchar *);
template int
- binlog_log_row<Update_rows_log_event>(TABLE *, const byte *, const byte *);
+ binlog_log_row<Update_rows_log_event>(TABLE *, const uchar *, const uchar *);
}
@@ -3607,7 +3620,15 @@ int handler::ha_external_lock(THD *thd, int lock_type)
taken a table lock), ha_release_auto_increment() was too.
*/
DBUG_ASSERT(next_insert_id == 0);
- DBUG_RETURN(external_lock(thd, lock_type));
+
+ /*
+ We cache the table flags if the locking succeeded. Otherwise, we
+ keep them as they were when they were fetched in ha_open().
+ */
+ int error= external_lock(thd, lock_type);
+ if (error == 0)
+ cached_table_flags= table_flags();
+ DBUG_RETURN(error);
}
@@ -3618,9 +3639,9 @@ int handler::ha_reset()
{
DBUG_ENTER("ha_reset");
/* Check that we have called all proper deallocation functions */
- DBUG_ASSERT((byte*) table->def_read_set.bitmap +
+ DBUG_ASSERT((uchar*) table->def_read_set.bitmap +
table->s->column_bitmap_size ==
- (byte*) table->def_write_set.bitmap);
+ (uchar*) table->def_write_set.bitmap);
DBUG_ASSERT(bitmap_is_set_all(&table->s->all_set));
DBUG_ASSERT(table->key_read == 0);
/* ensure that ha_index_end / ha_rnd_end has been called */
@@ -3631,7 +3652,7 @@ int handler::ha_reset()
}
-int handler::ha_write_row(byte *buf)
+int handler::ha_write_row(uchar *buf)
{
int error;
if (unlikely(error= write_row(buf)))
@@ -3641,7 +3662,8 @@ int handler::ha_write_row(byte *buf)
return 0;
}
-int handler::ha_update_row(const byte *old_data, byte *new_data)
+
+int handler::ha_update_row(const uchar *old_data, uchar *new_data)
{
int error;
@@ -3658,7 +3680,7 @@ int handler::ha_update_row(const byte *old_data, byte *new_data)
return 0;
}
-int handler::ha_delete_row(const byte *buf)
+int handler::ha_delete_row(const uchar *buf)
{
int error;
if (unlikely(error= delete_row(buf)))
@@ -3781,7 +3803,7 @@ int fl_log_iterator_next(struct handler_iterator *iterator,
void fl_log_iterator_destroy(struct handler_iterator *iterator)
{
- my_free((gptr)iterator->buffer, MYF(MY_ALLOW_ZERO_PTR));
+ my_free((uchar*)iterator->buffer, MYF(MY_ALLOW_ZERO_PTR));
}
@@ -3794,7 +3816,7 @@ fl_log_iterator_buffer_init(struct handler_iterator *iterator)
MY_DIR *dirp;
struct fl_buff *buff;
char *name_ptr;
- byte *ptr;
+ uchar *ptr;
FILEINFO *file;
uint32 i;
@@ -3805,7 +3827,7 @@ fl_log_iterator_buffer_init(struct handler_iterator *iterator)
{
return HA_ITERATOR_ERROR;
}
- if ((ptr= (byte*)my_malloc(ALIGN_SIZE(sizeof(fl_buff)) +
+ if ((ptr= (uchar*)my_malloc(ALIGN_SIZE(sizeof(fl_buff)) +
((ALIGN_SIZE(sizeof(LEX_STRING)) +
sizeof(enum log_status) +
+ FN_REFLEN) *
diff --git a/sql/handler.h b/sql/handler.h
index cfa86358fa1..b91d8a39b88 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -117,6 +117,18 @@
#define HA_HAS_RECORDS (LL(1) << 32) /* records() gives exact count*/
/* Has it's own method of binlog logging */
#define HA_HAS_OWN_BINLOGGING (LL(1) << 33)
+/*
+ Engine is capable of row-format and statement-format logging,
+ respectively
+*/
+#define HA_BINLOG_ROW_CAPABLE (LL(1) << 34)
+#define HA_BINLOG_STMT_CAPABLE (LL(1) << 35)
+
+/*
+ Set of all binlog flags. Currently only contain the capabilities
+ flags.
+ */
+#define HA_BINLOG_FLAGS (HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE)
/* bits in index_flags(index_number) for what you can do with index */
#define HA_READ_NEXT 1 /* TODO really use this flag */
@@ -223,6 +235,7 @@
#define HA_LEX_CREATE_TMP_TABLE 1
#define HA_LEX_CREATE_IF_NOT_EXISTS 2
+#define HA_LEX_CREATE_TABLE_LIKE 4
#define HA_OPTION_NO_CHECKSUM (1L << 17)
#define HA_OPTION_NO_DELAY_KEY_WRITE (1L << 18)
#define HA_MAX_REC_LENGTH 65535
@@ -265,7 +278,7 @@ enum legacy_db_type
enum row_type { ROW_TYPE_NOT_USED=-1, ROW_TYPE_DEFAULT, ROW_TYPE_FIXED,
ROW_TYPE_DYNAMIC, ROW_TYPE_COMPRESSED,
- ROW_TYPE_REDUNDANT, ROW_TYPE_COMPACT, ROW_TYPE_PAGES };
+ ROW_TYPE_REDUNDANT, ROW_TYPE_COMPACT, ROW_TYPE_PAGE };
enum enum_binlog_func {
BFN_RESET_LOGS= 1,
@@ -308,6 +321,7 @@ enum enum_binlog_command {
#define HA_CREATE_USED_PASSWORD (1L << 17)
#define HA_CREATE_USED_CONNECTION (1L << 18)
#define HA_CREATE_USED_KEY_BLOCK_SIZE (1L << 19)
+#define HA_CREATE_USED_TRANSACTIONAL (1L << 20)
typedef ulonglong my_xid; // this line is the same as in log_event.h
#define MYSQL_XID_PREFIX "MySQLXid"
@@ -315,13 +329,21 @@ typedef ulonglong my_xid; // this line is the same as in log_event.h
#define MYSQL_XID_OFFSET (MYSQL_XID_PREFIX_LEN+sizeof(server_id))
#define MYSQL_XID_GTRID_LEN (MYSQL_XID_OFFSET+sizeof(my_xid))
-#define XIDDATASIZE 128
+#define XIDDATASIZE MYSQL_XIDDATASIZE
#define MAXGTRIDSIZE 64
#define MAXBQUALSIZE 64
#define COMPATIBLE_DATA_YES 0
#define COMPATIBLE_DATA_NO 1
+/**
+ struct xid_t is binary compatible with the XID structure as
+ in the X/Open CAE Specification, Distributed Transaction Processing:
+ The XA Specification, X/Open Company Ltd., 1991.
+ http://www.opengroup.org/bookstore/catalog/c193.htm
+
+ @see MYSQL_XID in mysql/plugin.h
+*/
struct xid_t {
long formatID;
long gtrid_length;
@@ -378,9 +400,9 @@ struct xid_t {
return sizeof(formatID)+sizeof(gtrid_length)+sizeof(bqual_length)+
gtrid_length+bqual_length;
}
- byte *key()
+ uchar *key()
{
- return (byte *)&gtrid_length;
+ return (uchar *)&gtrid_length;
}
uint key_length()
{
@@ -642,7 +664,7 @@ struct handlerton
uint (*alter_table_flags)(uint flags);
int (*alter_tablespace)(handlerton *hton, THD *thd, st_alter_tablespace *ts_info);
int (*fill_files_table)(handlerton *hton, THD *thd,
- struct st_table_list *tables,
+ TABLE_LIST *tables,
class Item *cond);
uint32 flags; /* global handler flags */
/*
@@ -674,12 +696,12 @@ struct handlerton
struct handler_iterator *fill_this_in);
int (*discover)(handlerton *hton, THD* thd, const char *db,
const char *name,
- const void** frmblob,
- uint* frmlen);
+ uchar **frmblob,
+ size_t *frmlen);
int (*find_files)(handlerton *hton, THD *thd,
const char *db,
const char *path,
- const char *wild, bool dir, List<char> *files);
+ const char *wild, bool dir, List<LEX_STRING> *files);
int (*table_exists_in_engine)(handlerton *hton, THD* thd, const char *db,
const char *name);
uint32 license; /* Flag for Engine License */
@@ -687,7 +709,7 @@ struct handlerton
};
-/* Possible flags of a handlerton */
+/* Possible flags of a handlerton (there can be 32 of them) */
#define HTON_NO_FLAGS 0
#define HTON_CLOSE_CURSORS_AT_COMMIT (1 << 0)
#define HTON_ALTER_NOT_SUPPORTED (1 << 1) //Engine does not support alter
@@ -707,6 +729,35 @@ typedef struct st_thd_trans
bool no_2pc;
/* storage engines that registered themselves for this transaction */
handlerton *ht[MAX_HA];
+ /*
+ The purpose of this flag is to keep track of non-transactional
+ tables that were modified in scope of:
+ - transaction, when the variable is a member of
+ THD::transaction.all
+ - top-level statement or sub-statement, when the variable is a
+ member of THD::transaction.stmt
+ This member has the following life cycle:
+ * stmt.modified_non_trans_table is used to keep track of
+ modified non-transactional tables of top-level statements. At
+ the end of the previous statement and at the beginning of the session,
+ it is reset to FALSE. If such functions
+ as mysql_insert, mysql_update, mysql_delete etc modify a
+ non-transactional table, they set this flag to TRUE. At the
+ end of the statement, the value of stmt.modified_non_trans_table
+ is merged with all.modified_non_trans_table and gets reset.
+ * all.modified_non_trans_table is reset at the end of transaction
+
+ * Since we do not have a dedicated context for execution of a
+ sub-statement, to keep track of non-transactional changes in a
+ sub-statement, we re-use stmt.modified_non_trans_table.
+ At entrance into a sub-statement, a copy of the value of
+ stmt.modified_non_trans_table (containing the changes of the
+ outer statement) is saved on stack. Then
+ stmt.modified_non_trans_table is reset to FALSE and the
+ substatement is executed. Then the new value is merged with the
+ saved value.
+ */
+ bool modified_non_trans_table;
} THD_TRANS;
enum enum_tx_isolation { ISO_READ_UNCOMMITTED, ISO_READ_COMMITTED,
@@ -738,6 +789,7 @@ class partition_info;
struct st_partition_iter;
#define NOT_A_PARTITION_ID ((uint32)-1)
+enum ha_choice { HA_CHOICE_UNDEF, HA_CHOICE_NO, HA_CHOICE_YES };
typedef struct st_ha_create_information
{
@@ -760,6 +812,8 @@ typedef struct st_ha_create_information
uint options; /* OR of HA_CREATE_ options */
uint merge_insert_method;
uint extra_size; /* length of extra data segment */
+ /* 0 not used, 1 if not transactional, 2 if transactional */
+ enum ha_choice transactional;
bool table_existed; /* 1 in create if table existed */
bool frm_only; /* 1 if no ha_create_table() */
bool varchar; /* 1 if table has a VARCHAR */
@@ -792,19 +846,37 @@ typedef struct st_key_create_information
class TABLEOP_HOOKS
{
public:
+ TABLEOP_HOOKS() {}
+ virtual ~TABLEOP_HOOKS() {}
+
inline void prelock(TABLE **tables, uint count)
{
do_prelock(tables, count);
}
- virtual ~TABLEOP_HOOKS() {}
- TABLEOP_HOOKS() {}
+ inline int postlock(TABLE **tables, uint count)
+ {
+ return do_postlock(tables, count);
+ }
private:
/* Function primitive that is called prior to locking tables */
virtual void do_prelock(TABLE **tables, uint count)
{
/* Default is to do nothing */
}
+
+ /**
+ Primitive called after tables are locked.
+
+ If an error is returned, the tables will be unlocked and error
+ handling start.
+
+ @return Error code or zero.
+ */
+ virtual int do_postlock(TABLE **tables, uint count)
+ {
+ return 0; /* Default is to do nothing */
+ }
};
typedef struct st_savepoint SAVEPOINT;
@@ -835,9 +907,9 @@ typedef struct st_ha_check_opt
typedef struct st_handler_buffer
{
- const byte *buffer; /* Buffer one can start using */
- const byte *buffer_end; /* End of buffer */
- byte *end_of_used_area; /* End of area that was used by handler */
+ const uchar *buffer; /* Buffer one can start using */
+ const uchar *buffer_end; /* End of buffer */
+ uchar *end_of_used_area; /* End of area that was used by handler */
} HANDLER_BUFFER;
typedef struct system_status_var SSV;
@@ -851,7 +923,15 @@ public:
ulonglong max_index_file_length;
ulonglong delete_length; /* Free bytes */
ulonglong auto_increment_value;
- ha_rows records; /* Estimated records in table */
+ /*
+ The number of records in the table.
+ 0 - means the table has exactly 0 rows
+ other - if (table_flags() & HA_STATS_RECORDS_IS_EXACT)
+ the value is the exact number of records in the table
+ else
+ it is an estimate
+ */
+ ha_rows records;
ha_rows deleted; /* Deleted records */
ulong mean_rec_length; /* physical reclength */
time_t create_time; /* When table was created */
@@ -867,7 +947,7 @@ public:
{}
};
-uint calculate_key_len(TABLE *, uint, const byte *, key_part_map);
+uint calculate_key_len(TABLE *, uint, const uchar *, key_part_map);
/*
bitmap with first N+1 bits set
(keypart_map for a key prefix of [0..N] keyparts)
@@ -888,11 +968,16 @@ uint calculate_key_len(TABLE *, uint, const byte *, key_part_map);
class handler :public Sql_alloc
{
friend class ha_partition;
+ friend int ha_delete_table(THD*,handlerton*,const char*,const char*,
+ const char*,bool);
+
+public:
+ typedef ulonglong Table_flags;
protected:
struct st_table_share *table_share; /* The table definition */
struct st_table *table; /* The current open table */
- ulonglong cached_table_flags; /* Set on init() and open() */
+ Table_flags cached_table_flags; /* Set on init() and open() */
virtual int index_init(uint idx, bool sorted) { active_index=idx; return 0; }
virtual int index_end() { active_index=MAX_KEY; return 0; }
@@ -905,16 +990,19 @@ class handler :public Sql_alloc
*/
virtual int rnd_init(bool scan) =0;
virtual int rnd_end() { return 0; }
- virtual ulonglong table_flags(void) const =0;
+ virtual Table_flags table_flags(void) const =0;
+
void ha_statistic_increment(ulong SSV::*offset) const;
+ void **ha_data(THD *) const;
+ THD *ha_thd(void) const;
ha_rows estimation_rows_to_insert;
virtual void start_bulk_insert(ha_rows rows) {}
virtual int end_bulk_insert() {return 0; }
public:
handlerton *ht; /* storage engine of this handler */
- byte *ref; /* Pointer to current row */
- byte *dup_ref; /* Pointer to duplicate row */
+ uchar *ref; /* Pointer to current row */
+ uchar *dup_ref; /* Pointer to duplicate row */
ha_statistics stats;
@@ -937,6 +1025,7 @@ public:
uint ref_length;
FT_INFO *ft_handler;
enum {NONE=0, INDEX, RND} inited;
+ bool locked;
bool implicit_emptied; /* Can be !=0 only if HEAP */
const COND *pushed_cond;
/*
@@ -963,14 +1052,17 @@ public:
Discrete_interval auto_inc_interval_for_cur_row;
handler(handlerton *ht_arg, TABLE_SHARE *share_arg)
- :table_share(share_arg), estimation_rows_to_insert(0), ht(ht_arg),
+ :table_share(share_arg), table(0),
+ estimation_rows_to_insert(0), ht(ht_arg),
ref(0), key_used_on_scan(MAX_KEY), active_index(MAX_KEY),
ref_length(sizeof(my_off_t)),
- ft_handler(0), inited(NONE), implicit_emptied(0),
- pushed_cond(NULL), next_insert_id(0), insert_id_for_cur_row(0)
+ ft_handler(0), inited(NONE),
+ locked(FALSE), implicit_emptied(0),
+ pushed_cond(0), next_insert_id(0), insert_id_for_cur_row(0)
{}
virtual ~handler(void)
{
+ DBUG_ASSERT(locked == FALSE);
/* TODO: DBUG_ASSERT(inited == NONE); */
}
virtual handler *clone(MEM_ROOT *mem_root);
@@ -979,44 +1071,6 @@ public:
{
cached_table_flags= table_flags();
}
- /*
- Check whether a handler allows to lock the table.
-
- SYNOPSIS
- check_if_locking_is_allowed()
- thd Handler of the thread, trying to lock the table
- table Table handler to check
- count Total number of tables to be locked
- current Index of the current table in the list of the tables
- to be locked.
- system_count Pointer to the counter of system tables seen thus
- far.
- called_by_privileged_thread TRUE if called from a logger THD
- (general_log_thd or slow_log_thd)
- or by a privileged thread, which
- has the right to lock log tables.
-
- DESCRIPTION
- Check whether a handler allows to lock the table. For instance,
- MyISAM does not allow to lock mysql.proc along with other tables.
- This limitation stems from the fact that MyISAM does not support
- row-level locking and we have to add this limitation to avoid
- deadlocks.
-
- RETURN
- TRUE Locking is allowed
- FALSE Locking is not allowed. The error was thrown.
- */
- virtual bool check_if_locking_is_allowed(uint sql_command,
- ulong type, TABLE *table,
- uint count, uint current,
- uint *system_count,
- bool called_by_privileged_thread)
- {
- return TRUE;
- }
- bool check_if_log_table_locking_is_allowed(uint sql_command,
- ulong type, TABLE *table);
int ha_open(TABLE *table, const char *name, int mode, int test_if_locked);
void adjust_next_insert_id_after_explicit_value(ulonglong nr);
int update_auto_increment();
@@ -1082,10 +1136,12 @@ public:
int ha_index_init(uint idx, bool sorted)
{
+ int result;
DBUG_ENTER("ha_index_init");
DBUG_ASSERT(inited==NONE);
- inited=INDEX;
- DBUG_RETURN(index_init(idx, sorted));
+ if (!(result= index_init(idx, sorted)))
+ inited=INDEX;
+ DBUG_RETURN(result);
}
int ha_index_end()
{
@@ -1096,10 +1152,11 @@ public:
}
int ha_rnd_init(bool scan)
{
+ int result;
DBUG_ENTER("ha_rnd_init");
DBUG_ASSERT(inited==NONE || (inited==RND && scan));
- inited=RND;
- DBUG_RETURN(rnd_init(scan));
+ inited= (result= rnd_init(scan)) ? NONE: RND;
+ DBUG_RETURN(result);
}
int ha_rnd_end()
{
@@ -1115,7 +1172,7 @@ public:
{
return inited == INDEX ? ha_index_end() : inited == RND ? ha_rnd_end() : 0;
}
- longlong ha_table_flags() { return cached_table_flags; }
+ Table_flags ha_table_flags() const { return cached_table_flags; }
/*
Signal that the table->read_set and table->write_set table maps changed
@@ -1136,9 +1193,9 @@ public:
and delete_row() below.
*/
int ha_external_lock(THD *thd, int lock_type);
- int ha_write_row(byte * buf);
- int ha_update_row(const byte * old_data, byte * new_data);
- int ha_delete_row(const byte * buf);
+ int ha_write_row(uchar * buf);
+ int ha_update_row(const uchar * old_data, uchar * new_data);
+ int ha_delete_row(const uchar * buf);
/*
SYNOPSIS
@@ -1171,7 +1228,7 @@ public:
0 Bulk delete used by handler
1 Bulk delete not used, normal operation used
*/
- virtual int bulk_update_row(const byte *old_data, byte *new_data,
+ virtual int bulk_update_row(const uchar *old_data, uchar *new_data,
uint *dup_key_found)
{
DBUG_ASSERT(FALSE);
@@ -1220,55 +1277,56 @@ public:
return HA_ERR_WRONG_COMMAND;
}
private:
- virtual int index_read(byte * buf, const byte * key, uint key_len,
+ virtual int index_read(uchar * buf, const uchar * key, uint key_len,
enum ha_rkey_function find_flag)
{ return HA_ERR_WRONG_COMMAND; }
public:
-/**
- @brief
- Positions an index cursor to the index specified in the handle. Fetches the
- row if available. If the key value is null, begin at the first key of the
- index.
-*/
- virtual int index_read(byte * buf, const byte * key, key_part_map keypart_map,
- enum ha_rkey_function find_flag)
- {
- uint key_len= calculate_key_len(table, active_index, key, keypart_map);
- return index_read(buf, key, key_len, find_flag);
- }
-/**
- @brief
- Positions an index cursor to the index specified in the handle. Fetches the
- row if available. If the key value is null, begin at the first key of the
- index.
-*/
- virtual int index_read_idx(byte * buf, uint index, const byte * key,
+ /**
+ @brief
+ Positions an index cursor to the index specified in the handle. Fetches the
+ row if available. If the key value is null, begin at the first key of the
+ index.
+ */
+ virtual int index_read_map(uchar * buf, const uchar * key,
key_part_map keypart_map,
- enum ha_rkey_function find_flag);
- virtual int index_next(byte * buf)
+ enum ha_rkey_function find_flag)
+ {
+ uint key_len= calculate_key_len(table, active_index, key, keypart_map);
+ return index_read(buf, key, key_len, find_flag);
+ }
+ /**
+ @brief
+ Positions an index cursor to the index specified in the handle. Fetches the
+ row if available. If the key value is null, begin at the first key of the
+ index.
+ */
+ virtual int index_read_idx_map(uchar * buf, uint index, const uchar * key,
+ key_part_map keypart_map,
+ enum ha_rkey_function find_flag);
+ virtual int index_next(uchar * buf)
{ return HA_ERR_WRONG_COMMAND; }
- virtual int index_prev(byte * buf)
+ virtual int index_prev(uchar * buf)
{ return HA_ERR_WRONG_COMMAND; }
- virtual int index_first(byte * buf)
+ virtual int index_first(uchar * buf)
{ return HA_ERR_WRONG_COMMAND; }
- virtual int index_last(byte * buf)
+ virtual int index_last(uchar * buf)
{ return HA_ERR_WRONG_COMMAND; }
- virtual int index_next_same(byte *buf, const byte *key, uint keylen);
+ virtual int index_next_same(uchar *buf, const uchar *key, uint keylen);
private:
- virtual int index_read_last(byte * buf, const byte * key, uint key_len)
+ virtual int index_read_last(uchar * buf, const uchar * key, uint key_len)
{ return (my_errno=HA_ERR_WRONG_COMMAND); }
public:
-/**
- @brief
- The following functions works like index_read, but it find the last
- row with the current key value or prefix.
-*/
- virtual int index_read_last(byte * buf, const byte * key,
- key_part_map keypart_map)
- {
- uint key_len= calculate_key_len(table, active_index, key, keypart_map);
- return index_read_last(buf, key, key_len);
- }
+ /**
+ @brief
+ The following functions works like index_read, but it find the last
+ row with the current key value or prefix.
+ */
+ virtual int index_read_last_map(uchar * buf, const uchar * key,
+ key_part_map keypart_map)
+ {
+ uint key_len= calculate_key_len(table, active_index, key, keypart_map);
+ return index_read_last(buf, key, key_len);
+ }
virtual int read_multi_range_first(KEY_MULTI_RANGE **found_range_p,
KEY_MULTI_RANGE *ranges, uint range_count,
bool sorted, HANDLER_BUFFER *buffer);
@@ -1282,21 +1340,32 @@ public:
void ft_end() { ft_handler=NULL; }
virtual FT_INFO *ft_init_ext(uint flags, uint inx,String *key)
{ return NULL; }
- virtual int ft_read(byte *buf) { return HA_ERR_WRONG_COMMAND; }
- virtual int rnd_next(byte *buf)=0;
- virtual int rnd_pos(byte * buf, byte *pos)=0;
- virtual int read_first_row(byte *buf, uint primary_key);
+ virtual int ft_read(uchar *buf) { return HA_ERR_WRONG_COMMAND; }
+ virtual int rnd_next(uchar *buf)=0;
+ virtual int rnd_pos(uchar * buf, uchar *pos)=0;
+ /*
+ one has to use this method when to find
+ random position by record as the plain
+ position() call doesn't work for some
+ handlers for random position
+ */
+ virtual int rnd_pos_by_record(uchar *record)
+ {
+ position(record);
+ return rnd_pos(record, ref);
+ }
+ virtual int read_first_row(uchar *buf, uint primary_key);
/*
The following function is only needed for tables that may be temporary
tables during joins
*/
- virtual int restart_rnd_next(byte *buf, byte *pos)
+ virtual int restart_rnd_next(uchar *buf, uchar *pos)
{ return HA_ERR_WRONG_COMMAND; }
- virtual int rnd_same(byte *buf, uint inx)
+ virtual int rnd_same(uchar *buf, uint inx)
{ return HA_ERR_WRONG_COMMAND; }
virtual ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key)
{ return (ha_rows) 10; }
- virtual void position(const byte *record)=0;
+ virtual void position(const uchar *record)=0;
virtual int info(uint)=0; // see my_base.h for full description
virtual void get_dynamic_partition_info(PARTITION_INFO *stat_info,
uint part_id);
@@ -1552,8 +1621,8 @@ public:
const char *path,
ulonglong *copied,
ulonglong *deleted,
- const void *pack_frm_data,
- uint pack_frm_len)
+ const uchar *pack_frm_data,
+ size_t pack_frm_len)
{ return HA_ERR_WRONG_COMMAND; }
virtual int drop_partitions(const char *path)
{ return HA_ERR_WRONG_COMMAND; }
@@ -1570,29 +1639,68 @@ public:
/* lock_count() can be more than one if the table is a MERGE */
virtual uint lock_count(void) const { return 1; }
+ /**
+ Is not invoked for non-transactional temporary tables.
+
+ @note that one can NOT rely on table->in_use in store_lock(). It may
+ refer to a different thread if called from mysql_lock_abort_for_thread().
+ */
virtual THR_LOCK_DATA **store_lock(THD *thd,
THR_LOCK_DATA **to,
enum thr_lock_type lock_type)=0;
/* Type of table for caching query */
virtual uint8 table_cache_type() { return HA_CACHE_TBL_NONTRANSACT; }
- /* ask handler about permission to cache table when query is to be cached */
+
+
+ /**
+ @brief Register a named table with a call back function to the query cache.
+
+ @param thd The thread handle
+ @param table_key A pointer to the table name in the table cache
+ @param key_length The length of the table name
+ @param[out] engine_callback The pointer to the storage engine call back
+ function
+ @param[out] engine_data Storage engine specific data which could be
+ anything
+
+ This method offers the storage engine, the possibility to store a reference
+ to a table name which is going to be used with query cache.
+ The method is called each time a statement is written to the cache and can
+ be used to verify if a specific statement is cachable. It also offers
+ the possibility to register a generic (but static) call back function which
+ is called each time a statement is matched against the query cache.
+
+ @note If engine_data supplied with this function is different from
+ engine_data supplied with the callback function, and the callback returns
+ FALSE, a table invalidation on the current table will occur.
+
+ @return Upon success the engine_callback will point to the storage engine
+ call back function, if any, and engine_data will point to any storage
+ engine data used in the specific implementation.
+ @retval TRUE Success
+ @retval FALSE The specified table or current statement should not be
+ cached
+ */
+
virtual my_bool register_query_cache_table(THD *thd, char *table_key,
- uint key_length,
- qc_engine_callback
- *engine_callback,
- ulonglong *engine_data)
+ uint key_length,
+ qc_engine_callback
+ *engine_callback,
+ ulonglong *engine_data)
{
*engine_callback= 0;
- return 1;
+ return TRUE;
}
+
+
/*
RETURN
true Primary key (if there is one) is clustered key covering all fields
false otherwise
*/
virtual bool primary_key_is_clustered() { return FALSE; }
- virtual int cmp_ref(const byte *ref1, const byte *ref2)
+ virtual int cmp_ref(const uchar *ref1, const uchar *ref2)
{
return memcmp(ref1, ref2, ref_length);
}
@@ -1637,18 +1745,18 @@ public:
{ return COMPATIBLE_DATA_NO; }
/* These are only called from sql_select for internal temporary tables */
- virtual int write_row(byte *buf __attribute__((unused)))
+ virtual int write_row(uchar *buf __attribute__((unused)))
{
return HA_ERR_WRONG_COMMAND;
}
- virtual int update_row(const byte *old_data __attribute__((unused)),
- byte *new_data __attribute__((unused)))
+ virtual int update_row(const uchar *old_data __attribute__((unused)),
+ uchar *new_data __attribute__((unused)))
{
return HA_ERR_WRONG_COMMAND;
}
- virtual int delete_row(const byte *buf __attribute__((unused)))
+ virtual int delete_row(const uchar *buf __attribute__((unused)))
{
return HA_ERR_WRONG_COMMAND;
}
@@ -1665,6 +1773,29 @@ private:
overridden by the storage engine class. To call these methods, use
the corresponding 'ha_*' method above.
*/
+
+ /**
+ Is not invoked for non-transactional temporary tables.
+
+ Tells the storage engine that we intend to read or write data
+ from the table. This call is prefixed with a call to handler::store_lock()
+ and is invoked only for those handler instances that stored the lock.
+
+ Calls to rnd_init/index_init are prefixed with this call. When table
+ IO is complete, we call external_lock(F_UNLCK).
+ A storage engine writer should expect that each call to
+ ::external_lock(F_[RD|WR]LOCK is followed by a call to
+ ::external_lock(F_UNLCK). If it is not, it is a bug in MySQL.
+
+ The name and signature originate from the first implementation
+ in MyISAM, which would call fcntl to set/clear an advisory
+ lock on the data file in this method.
+
+ @param lock_type F_RDLCK, F_WRLCK, F_UNLCK
+
+ @return non-0 in case of failure, 0 in case of success.
+ When lock_type is F_UNLCK, the return value is ignored.
+ */
virtual int external_lock(THD *thd __attribute__((unused)),
int lock_type __attribute__((unused)))
{
@@ -1675,6 +1806,8 @@ private:
/* Some extern variables used with handlers */
extern const char *ha_row_type[];
+extern const char *tx_isolation_names[];
+extern const char *binlog_format_names[];
extern TYPELIB tx_isolation_typelib;
extern TYPELIB myisam_stats_method_typelib;
extern ulong total_ha, total_ha_2pc;
@@ -1687,9 +1820,9 @@ extern ulong total_ha, total_ha_2pc;
/* lookups */
handlerton *ha_default_handlerton(THD *thd);
-handlerton *ha_resolve_by_name(THD *thd, const LEX_STRING *name);
+plugin_ref ha_resolve_by_name(THD *thd, const LEX_STRING *name);
+plugin_ref ha_lock_engine(THD *thd, handlerton *hton);
handlerton *ha_resolve_by_legacy_type(THD *thd, enum legacy_db_type db_type);
-const char *ha_get_storage_engine(enum legacy_db_type db_type);
handler *get_new_handler(TABLE_SHARE *share, MEM_ROOT *alloc,
handlerton *db_type);
handlerton *ha_checktype(THD *thd, enum legacy_db_type database_type,
@@ -1741,13 +1874,13 @@ bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat);
/* discovery */
int ha_create_table_from_engine(THD* thd, const char *db, const char *name);
int ha_discover(THD* thd, const char* dbname, const char* name,
- const void** frmblob, uint* frmlen);
+ uchar** frmblob, size_t* frmlen);
int ha_find_files(THD *thd,const char *db,const char *path,
- const char *wild, bool dir,List<char>* files);
+ const char *wild, bool dir, List<LEX_STRING>* files);
int ha_table_exists_in_engine(THD* thd, const char* db, const char* name);
/* key cache */
-int ha_init_key_cache(const char *name, KEY_CACHE *key_cache);
+extern "C" int ha_init_key_cache(const char *name, KEY_CACHE *key_cache);
int ha_resize_key_cache(KEY_CACHE *key_cache);
int ha_change_key_cache_param(KEY_CACHE *key_cache);
int ha_change_key_cache(KEY_CACHE *old_key_cache, KEY_CACHE *new_key_cache);
diff --git a/sql/hash_filo.h b/sql/hash_filo.h
index c25af67b572..ab13d338695 100644
--- a/sql/hash_filo.h
+++ b/sql/hash_filo.h
@@ -84,10 +84,10 @@ public:
first_link=last_link=0;
}
- hash_filo_element *search(gptr key,uint length)
+ hash_filo_element *search(uchar* key, size_t length)
{
hash_filo_element *entry=(hash_filo_element*)
- hash_search(&cache,(byte*) key,length);
+ hash_search(&cache,(uchar*) key,length);
if (entry)
{ // Found; link it first
if (entry != first_link)
@@ -113,9 +113,9 @@ public:
{
hash_filo_element *tmp=last_link;
last_link=last_link->prev_used;
- hash_delete(&cache,(byte*) tmp);
+ hash_delete(&cache,(uchar*) tmp);
}
- if (my_hash_insert(&cache,(byte*) entry))
+ if (my_hash_insert(&cache,(uchar*) entry))
{
if (free_element)
(*free_element)(entry); // This should never happen
diff --git a/sql/hostname.cc b/sql/hostname.cc
index 049220c6b6f..34384a9c8c0 100644
--- a/sql/hostname.cc
+++ b/sql/hostname.cc
@@ -84,7 +84,7 @@ static void add_hostname(struct in_addr *in,const char *name)
{
VOID(pthread_mutex_lock(&hostname_cache->lock));
host_entry *entry;
- if (!(entry=(host_entry*) hostname_cache->search((gptr) &in->s_addr,0)))
+ if (!(entry=(host_entry*) hostname_cache->search((uchar*) &in->s_addr,0)))
{
uint length=name ? (uint) strlen(name) : 0;
@@ -115,7 +115,7 @@ void inc_host_errors(struct in_addr *in)
{
VOID(pthread_mutex_lock(&hostname_cache->lock));
host_entry *entry;
- if ((entry=(host_entry*) hostname_cache->search((gptr) &in->s_addr,0)))
+ if ((entry=(host_entry*) hostname_cache->search((uchar*) &in->s_addr,0)))
entry->errors++;
VOID(pthread_mutex_unlock(&hostname_cache->lock));
}
@@ -124,7 +124,7 @@ void reset_host_errors(struct in_addr *in)
{
VOID(pthread_mutex_lock(&hostname_cache->lock));
host_entry *entry;
- if ((entry=(host_entry*) hostname_cache->search((gptr) &in->s_addr,0)))
+ if ((entry=(host_entry*) hostname_cache->search((uchar*) &in->s_addr,0)))
entry->errors=0;
VOID(pthread_mutex_unlock(&hostname_cache->lock));
}
@@ -134,7 +134,7 @@ void reset_host_errors(struct in_addr *in)
#define INADDR_LOOPBACK 0x7f000001UL
#endif
-my_string ip_to_hostname(struct in_addr *in, uint *errors)
+char * ip_to_hostname(struct in_addr *in, uint *errors)
{
uint i;
host_entry *entry;
@@ -149,7 +149,7 @@ my_string ip_to_hostname(struct in_addr *in, uint *errors)
if (!(specialflag & SPECIAL_NO_HOST_CACHE))
{
VOID(pthread_mutex_lock(&hostname_cache->lock));
- if ((entry=(host_entry*) hostname_cache->search((gptr) &in->s_addr,0)))
+ if ((entry=(host_entry*) hostname_cache->search((uchar*) &in->s_addr,0)))
{
char *name;
if (!entry->hostname)
diff --git a/sql/init.cc b/sql/init.cc
index ff236c03204..73feaa797c3 100644
--- a/sql/init.cc
+++ b/sql/init.cc
@@ -21,8 +21,6 @@
void unireg_init(ulong options)
{
- uint i;
- double nr;
DBUG_ENTER("unireg_init");
MYSYS_PROGRAM_DONT_USE_CURSES();
@@ -40,16 +38,5 @@ void unireg_init(ulong options)
VOID(strmov(reg_ext,".frm"));
reg_ext_length= 4;
specialflag=SPECIAL_SAME_DB_NAME | options; /* Set options from argv */
- /* Make a tab of powers of 10 */
- for (i=0,nr=1.0; i < array_elements(log_10) ; i++)
- { /* It's used by filesort... */
- log_10[i]= nr ; nr*= 10.0;
- }
- /* Make a tab of powers of 0.1 */
- for (i= 0, nr= 0.1; i < array_elements(log_01); i++)
- {
- log_01[i]= nr;
- nr*= 0.1;
- }
DBUG_VOID_RETURN;
}
diff --git a/sql/item.cc b/sql/item.cc
index e39a1199bae..d8080d62c39 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -161,6 +161,7 @@ Hybrid_type_traits_integer::fix_length_and_dec(Item *item, Item *arg) const
void item_init(void)
{
item_user_lock_init();
+ uuid_short_init();
}
@@ -333,6 +334,37 @@ int Item::save_date_in_field(Field *field)
}
+/*
+ Store the string value in field directly
+
+ SYNOPSIS
+ Item::save_str_value_in_field()
+ field a pointer to field where to store
+ result the pointer to the string value to be stored
+
+ DESCRIPTION
+ The method is used by Item_*::save_in_field implementations
+ when we don't need to calculate the value to store
+ See Item_string::save_in_field() implementation for example
+
+ IMPLEMENTATION
+ Check if the Item is null and stores the NULL or the
+ result value in the field accordingly.
+
+ RETURN
+ Nonzero value if error
+*/
+
+int Item::save_str_value_in_field(Field *field, String *result)
+{
+ if (null_value)
+ return set_field_to_null(field);
+ field->set_notnull();
+ return field->store(result->ptr(), result->length(),
+ collation.collation);
+}
+
+
Item::Item():
rsize(0), name(0), orig_name(0), name_length(0), fixed(0),
is_autogenerated_name(TRUE),
@@ -431,7 +463,7 @@ void Item::cleanup()
arg - a dummy parameter, is not used here
*/
-bool Item::cleanup_processor(byte *arg)
+bool Item::cleanup_processor(uchar *arg)
{
if (fixed)
cleanup();
@@ -494,7 +526,7 @@ void Item::rename(char *new_name)
pointer to newly allocated item is returned.
*/
-Item* Item::transform(Item_transformer transformer, byte *arg)
+Item* Item::transform(Item_transformer transformer, uchar *arg)
{
DBUG_ASSERT(!current_thd->is_stmt_prepare());
@@ -552,7 +584,7 @@ void Item_ident::cleanup()
DBUG_VOID_RETURN;
}
-bool Item_ident::remove_dependence_processor(byte * arg)
+bool Item_ident::remove_dependence_processor(uchar * arg)
{
DBUG_ENTER("Item_ident::remove_dependence_processor");
if (depended_from == (st_select_lex *) arg)
@@ -583,7 +615,7 @@ bool Item_ident::remove_dependence_processor(byte * arg)
for the subsequent items.
*/
-bool Item_field::collect_item_field_processor(byte *arg)
+bool Item_field::collect_item_field_processor(uchar *arg)
{
DBUG_ENTER("Item_field::collect_item_field_processor");
DBUG_PRINT("info", ("%s", field->field_name ? field->field_name : "noname"));
@@ -618,7 +650,7 @@ bool Item_field::collect_item_field_processor(byte *arg)
FALSE otherwise
*/
-bool Item_field::find_item_in_field_list_processor(byte *arg)
+bool Item_field::find_item_in_field_list_processor(uchar *arg)
{
KEY_PART_INFO *first_non_group_part= *((KEY_PART_INFO **) arg);
KEY_PART_INFO *last_part= *(((KEY_PART_INFO **) arg) + 1);
@@ -641,7 +673,7 @@ bool Item_field::find_item_in_field_list_processor(byte *arg)
column read set or to register used fields in a view
*/
-bool Item_field::register_field_in_read_map(byte *arg)
+bool Item_field::register_field_in_read_map(uchar *arg)
{
TABLE *table= (TABLE *) arg;
if (field->table == table || !table)
@@ -683,14 +715,20 @@ void Item::set_name(const char *str, uint length, CHARSET_INFO *cs)
str++;
}
if (orig_len != length && !is_autogenerated_name)
- push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_REMOVED_SPACES, ER(ER_REMOVED_SPACES),
- str + length - orig_len);
-
+ {
+ if (length == 0)
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_NAME_BECOMES_EMPTY, ER(ER_NAME_BECOMES_EMPTY),
+ str + length - orig_len);
+ else
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_REMOVED_SPACES, ER(ER_REMOVED_SPACES),
+ str + length - orig_len);
+ }
}
if (!my_charset_same(cs, system_charset_info))
{
- uint32 res_length;
+ size_t res_length;
name= sql_strmake_with_convert(str, name_length= length, cs,
MAX_ALIAS_NAME, system_charset_info,
&res_length);
@@ -785,7 +823,7 @@ Item *Item_string::safe_charset_converter(CHARSET_INFO *tocs)
*/
return NULL;
}
- if (!(ptr= current_thd->memdup(cstr.ptr(), cstr.length() + 1 )))
+ if (!(ptr= current_thd->strmake(cstr.ptr(), cstr.length())))
return NULL;
conv->str_value.set(ptr, cstr.length(), cstr.charset());
/* Ensure that no one is going to change the result string */
@@ -1050,9 +1088,9 @@ bool Item_sp_variable::is_null()
Item_splocal::Item_splocal(const LEX_STRING &sp_var_name,
uint sp_var_idx,
enum_field_types sp_var_type,
- uint pos_in_q)
+ uint pos_in_q, uint len_in_q)
:Item_sp_variable(sp_var_name.str, sp_var_name.length),
- m_var_idx(sp_var_idx), pos_in_query(pos_in_q)
+ m_var_idx(sp_var_idx), pos_in_query(pos_in_q), len_in_query(len_in_q)
{
maybe_null= TRUE;
@@ -1326,6 +1364,25 @@ void Item::split_sum_func2(THD *thd, Item **ref_pointer_array,
}
+static bool
+left_is_superset(DTCollation *left, DTCollation *right)
+{
+ /* Allow convert to Unicode */
+ if (left->collation->state & MY_CS_UNICODE &&
+ (left->derivation < right->derivation ||
+ (left->derivation == right->derivation &&
+ !(right->collation->state & MY_CS_UNICODE))))
+ return TRUE;
+ /* Allow convert from ASCII */
+ if (right->repertoire == MY_REPERTOIRE_ASCII &&
+ (left->derivation < right->derivation ||
+ (left->derivation == right->derivation &&
+ !(left->repertoire == MY_REPERTOIRE_ASCII))))
+ return TRUE;
+ /* Disallow conversion otherwise */
+ return FALSE;
+}
+
/*
Aggregate two collations together taking
into account their coercibility (aka derivation):
@@ -1390,18 +1447,12 @@ bool DTCollation::aggregate(DTCollation &dt, uint flags)
; // Do nothing
}
else if ((flags & MY_COLL_ALLOW_SUPERSET_CONV) &&
- collation->state & MY_CS_UNICODE &&
- (derivation < dt.derivation ||
- (derivation == dt.derivation &&
- !(dt.collation->state & MY_CS_UNICODE))))
+ left_is_superset(this, &dt))
{
// Do nothing
}
else if ((flags & MY_COLL_ALLOW_SUPERSET_CONV) &&
- dt.collation->state & MY_CS_UNICODE &&
- (dt.derivation < derivation ||
- (dt.derivation == derivation &&
- !(collation->state & MY_CS_UNICODE))))
+ left_is_superset(&dt, this))
{
set(dt);
}
@@ -1420,7 +1471,7 @@ bool DTCollation::aggregate(DTCollation &dt, uint flags)
else
{
// Cannot apply conversion
- set(0, DERIVATION_NONE);
+ set(0, DERIVATION_NONE, 0);
return 1;
}
}
@@ -1442,8 +1493,8 @@ bool DTCollation::aggregate(DTCollation &dt, uint flags)
{
if (derivation == DERIVATION_EXPLICIT)
{
- set(0, DERIVATION_NONE);
- return 1;
+ set(0, DERIVATION_NONE, 0);
+ return 1;
}
if (collation->state & MY_CS_BINSORT)
return 0;
@@ -1457,6 +1508,7 @@ bool DTCollation::aggregate(DTCollation &dt, uint flags)
set(bin, DERIVATION_NONE);
}
}
+ repertoire|= dt.repertoire;
return 0;
}
@@ -1600,12 +1652,16 @@ bool agg_item_charsets(DTCollation &coll, const char *fname,
{
Item* conv;
uint32 dummy_offset;
- if (!String::needs_conversion(0, coll.collation,
- (*arg)->collation.collation,
+ if (!String::needs_conversion(0, (*arg)->collation.collation,
+ coll.collation,
&dummy_offset))
continue;
- if (!(conv= (*arg)->safe_charset_converter(coll.collation)))
+ if (!(conv= (*arg)->safe_charset_converter(coll.collation)) &&
+ ((*arg)->collation.repertoire == MY_REPERTOIRE_ASCII))
+ conv= new Item_func_conv_charset(*arg, coll.collation, 1);
+
+ if (!conv)
{
if (nargs >=2 && nargs <= 3)
{
@@ -1655,7 +1711,7 @@ void Item_ident_for_show::make_field(Send_field *tmp_field)
tmp_field->type=field->type();
tmp_field->flags= field->table->maybe_null ?
(field->flags & ~NOT_NULL_FLAG) : field->flags;
- tmp_field->decimals= 0;
+ tmp_field->decimals= field->decimals();
}
/**********************************************/
@@ -1751,6 +1807,8 @@ void Item_field::set_field(Field *field_par)
unsigned_flag=test(field_par->flags & UNSIGNED_FLAG);
collation.set(field_par->charset(), field_par->derivation());
fixed= 1;
+ if (field->table->s->tmp_table == SYSTEM_TMP_TABLE)
+ any_privileges= 0;
}
@@ -1973,10 +2031,11 @@ bool Item_field::val_bool_result()
bool Item_field::eq(const Item *item, bool binary_cmp) const
{
- if (item->type() != FIELD_ITEM)
+ Item *real_item= ((Item *) item)->real_item();
+ if (real_item->type() != FIELD_ITEM)
return 0;
- Item_field *item_field= (Item_field*) item;
+ Item_field *item_field= (Item_field*) real_item;
if (item_field->field && field)
return item_field->field == field;
/*
@@ -2016,6 +2075,11 @@ Item *Item_field::get_tmp_table_item(THD *thd)
return new_item;
}
+longlong Item_field::val_int_endpoint(bool left_endp, bool *incl_endp)
+{
+ longlong res= val_int();
+ return null_value? LONGLONG_MIN : res;
+}
/*
Create an item from a string we KNOW points to a valid longlong
@@ -2139,7 +2203,7 @@ Item_decimal::Item_decimal(my_decimal *value_par)
}
-Item_decimal::Item_decimal(const char *bin, int precision, int scale)
+Item_decimal::Item_decimal(const uchar *bin, int precision, int scale)
{
binary2my_decimal(E_DEC_FATAL_ERROR, bin,
&decimal_value, precision, scale);
@@ -2347,7 +2411,8 @@ default_set_param_func(Item_param *param,
}
-Item_param::Item_param(unsigned pos_in_query_arg) :
+Item_param::Item_param(uint pos_in_query_arg) :
+ strict_type(FALSE),
state(NO_VALUE),
item_result_type(STRING_RESULT),
/* Don't pretend to be a literal unless value for this item is set. */
@@ -2542,16 +2607,16 @@ bool Item_param::set_from_user_var(THD *thd, const user_var_entry *entry)
if (entry && entry->value)
{
item_result_type= entry->type;
- switch (entry->type) {
+ if (strict_type && required_result_type != item_result_type)
+ DBUG_RETURN(1);
+ switch (item_result_type) {
case REAL_RESULT:
set_double(*(double*)entry->value);
item_type= Item::REAL_ITEM;
- item_result_type= REAL_RESULT;
break;
case INT_RESULT:
set_int(*(longlong*)entry->value, MY_INT64_NUM_DECIMAL_DIGITS);
item_type= Item::INT_ITEM;
- item_result_type= INT_RESULT;
break;
case STRING_RESULT:
{
@@ -2574,7 +2639,6 @@ bool Item_param::set_from_user_var(THD *thd, const user_var_entry *entry)
charset of connection, so we have to set it later.
*/
item_type= Item::STRING_ITEM;
- item_result_type= STRING_RESULT;
if (set_str((const char *)entry->value, entry->length))
DBUG_RETURN(1);
@@ -2588,6 +2652,7 @@ bool Item_param::set_from_user_var(THD *thd, const user_var_entry *entry)
decimals= ent_value->frac;
max_length= my_decimal_precision_to_length(ent_value->precision(),
decimals, unsigned_flag);
+ item_type= Item::DECIMAL_ITEM;
break;
}
default:
@@ -3043,16 +3108,6 @@ my_decimal *Item_copy_string::val_decimal(my_decimal *decimal_value)
}
-
-int Item_copy_string::save_in_field(Field *field, bool no_conversions)
-{
- if (null_value)
- return set_field_to_null(field);
- field->set_notnull();
- return field->store(str_value.ptr(),str_value.length(),
- collation.collation);
-}
-
/*
Functions to convert item to field (for send_fields)
*/
@@ -3558,7 +3613,8 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference)
prev_subselect_item->const_item_cache= 0;
set_field(*from_field);
if (!last_checked_context->select_lex->having_fix_field &&
- select->group_list.elements)
+ select->group_list.elements &&
+ (place == SELECT_LIST || place == IN_HAVING))
{
Item_outer_ref *rf;
/*
@@ -3826,15 +3882,15 @@ bool Item_field::fix_fields(THD *thd, Item **reference)
if ((*res)->type() == Item::FIELD_ITEM)
{
/*
- It's an Item_field referencing another Item_field in the select
- list.
- use the field from the Item_field in the select list and leave
- the Item_field instance in place.
+ It's an Item_field referencing another Item_field in the select
+ list.
+ Use the field from the Item_field in the select list and leave
+ the Item_field instance in place.
*/
- Field *field= (*((Item_field**)res))->field;
+ Field *new_field= (*((Item_field**)res))->field;
- if (field == NULL)
+ if (new_field == NULL)
{
/* The column to which we link isn't valid. */
my_error(ER_BAD_FIELD_ERROR, MYF(0), (*res)->name,
@@ -3842,7 +3898,7 @@ bool Item_field::fix_fields(THD *thd, Item **reference)
return(1);
}
- set_field(field);
+ set_field(new_field);
return 0;
}
else
@@ -4066,7 +4122,7 @@ Item_equal *Item_field::find_item_equal(COND_EQUAL *cond_equal)
FALSE otherwise
*/
-bool Item_field::subst_argument_checker(byte **arg)
+bool Item_field::subst_argument_checker(uchar **arg)
{
return (result_type() != STRING_RESULT) || (*arg);
}
@@ -4098,7 +4154,7 @@ bool Item_field::subst_argument_checker(byte **arg)
pointer to the field item, otherwise.
*/
-Item *Item_field::equal_fields_propagator(byte *arg)
+Item *Item_field::equal_fields_propagator(uchar *arg)
{
if (no_const_subst)
return this;
@@ -4129,7 +4185,7 @@ Item *Item_field::equal_fields_propagator(byte *arg)
See comments in Arg_comparator::set_compare_func() for details
*/
-bool Item_field::set_no_const_sub(byte *arg)
+bool Item_field::set_no_const_sub(uchar *arg)
{
if (field->charset() != &my_charset_bin)
no_const_subst=1;
@@ -4164,7 +4220,7 @@ bool Item_field::set_no_const_sub(byte *arg)
this - otherwise.
*/
-Item *Item_field::replace_equal_field(byte *arg)
+Item *Item_field::replace_equal_field(uchar *arg)
{
if (item_equal)
{
@@ -4314,42 +4370,42 @@ Field *Item::tmp_table_field_from_field_type(TABLE *table, bool fixed_length)
switch (field_type()) {
case MYSQL_TYPE_DECIMAL:
case MYSQL_TYPE_NEWDECIMAL:
- field= new Field_new_decimal((char*) 0, max_length, null_ptr, 0,
+ field= new Field_new_decimal((uchar*) 0, max_length, null_ptr, 0,
Field::NONE, name, decimals, 0,
unsigned_flag);
break;
case MYSQL_TYPE_TINY:
- field= new Field_tiny((char*) 0, max_length, null_ptr, 0, Field::NONE,
+ field= new Field_tiny((uchar*) 0, max_length, null_ptr, 0, Field::NONE,
name, 0, unsigned_flag);
break;
case MYSQL_TYPE_SHORT:
- field= new Field_short((char*) 0, max_length, null_ptr, 0, Field::NONE,
+ field= new Field_short((uchar*) 0, max_length, null_ptr, 0, Field::NONE,
name, 0, unsigned_flag);
break;
case MYSQL_TYPE_LONG:
- field= new Field_long((char*) 0, max_length, null_ptr, 0, Field::NONE,
+ field= new Field_long((uchar*) 0, max_length, null_ptr, 0, Field::NONE,
name, 0, unsigned_flag);
break;
#ifdef HAVE_LONG_LONG
case MYSQL_TYPE_LONGLONG:
- field= new Field_longlong((char*) 0, max_length, null_ptr, 0, Field::NONE,
+ field= new Field_longlong((uchar*) 0, max_length, null_ptr, 0, Field::NONE,
name, 0, unsigned_flag);
break;
#endif
case MYSQL_TYPE_FLOAT:
- field= new Field_float((char*) 0, max_length, null_ptr, 0, Field::NONE,
+ field= new Field_float((uchar*) 0, max_length, null_ptr, 0, Field::NONE,
name, decimals, 0, unsigned_flag);
break;
case MYSQL_TYPE_DOUBLE:
- field= new Field_double((char*) 0, max_length, null_ptr, 0, Field::NONE,
+ field= new Field_double((uchar*) 0, max_length, null_ptr, 0, Field::NONE,
name, decimals, 0, unsigned_flag);
break;
case MYSQL_TYPE_NULL:
- field= new Field_null((char*) 0, max_length, Field::NONE,
+ field= new Field_null((uchar*) 0, max_length, Field::NONE,
name, &my_charset_bin);
break;
case MYSQL_TYPE_INT24:
- field= new Field_medium((char*) 0, max_length, null_ptr, 0, Field::NONE,
+ field= new Field_medium((uchar*) 0, max_length, null_ptr, 0, Field::NONE,
name, 0, unsigned_flag);
break;
case MYSQL_TYPE_NEWDATE:
@@ -4366,7 +4422,7 @@ Field *Item::tmp_table_field_from_field_type(TABLE *table, bool fixed_length)
field= new Field_datetime(maybe_null, name, &my_charset_bin);
break;
case MYSQL_TYPE_YEAR:
- field= new Field_year((char*) 0, max_length, null_ptr, 0, Field::NONE,
+ field= new Field_year((uchar*) 0, max_length, null_ptr, 0, Field::NONE,
name);
break;
case MYSQL_TYPE_BIT:
@@ -4401,9 +4457,11 @@ Field *Item::tmp_table_field_from_field_type(TABLE *table, bool fixed_length)
field= new Field_blob(max_length, maybe_null, name, collation.collation);
break; // Blob handled outside of case
case MYSQL_TYPE_GEOMETRY:
- return new Field_geom(max_length, maybe_null, name, table->s,
+ field= new Field_geom(max_length, maybe_null, name, table->s,
(Field::geometry_type)
- ((Item_geometry_func *)this)->get_geometry_type());
+ ((type() == Item::TYPE_HOLDER) ?
+ ((Item_type_holder *)this)->get_geometry_type() :
+ ((Item_geometry_func *)this)->get_geometry_type()));
}
if (field)
field->init(table);
@@ -4502,6 +4560,12 @@ int Item_null::save_safe_in_field(Field *field)
}
+/*
+ This implementation can lose str_value content, so if the
+ Item uses str_value to store something, it should
+ reimplement it's ::save_in_field() as Item_string, for example, does
+*/
+
int Item::save_in_field(Field *field, bool no_conversions)
{
int error;
@@ -4559,10 +4623,7 @@ int Item_string::save_in_field(Field *field, bool no_conversions)
{
String *result;
result=val_str(&str_value);
- if (null_value)
- return set_field_to_null(field);
- field->set_notnull();
- return field->store(result->ptr(),result->length(),collation.collation);
+ return save_str_value_in_field(field, result);
}
@@ -4731,7 +4792,6 @@ inline uint char_val(char X)
Item_hex_string::Item_hex_string(const char *str, uint str_length)
{
- name=(char*) str-2; // Lex makes this start with 0x
max_length=(str_length+1)/2;
char *ptr=(char*) sql_alloc(max_length+1);
if (!ptr)
@@ -4842,7 +4902,6 @@ Item_bin_string::Item_bin_string(const char *str, uint str_length)
uchar bits= 0;
uint power= 1;
- name= (char*) str - 2;
max_length= (str_length + 7) >> 3;
char *ptr= (char*) sql_alloc(max_length + 1);
if (!ptr)
@@ -5032,7 +5091,7 @@ void Item_field::update_null_value()
this field otherwise
*/
-Item *Item_field::update_value_transformer(byte *select_arg)
+Item *Item_field::update_value_transformer(uchar *select_arg)
{
SELECT_LEX *select= (SELECT_LEX*)select_arg;
DBUG_ASSERT(fixed);
@@ -5589,6 +5648,21 @@ void Item_ref::make_field(Send_field *field)
}
+Item *Item_ref::get_tmp_table_item(THD *thd)
+{
+ if (!result_field)
+ return (*ref)->get_tmp_table_item(thd);
+
+ Item_field *item= new Item_field(result_field);
+ if (item)
+ {
+ item->table_name= table_name;
+ item->db_name= db_name;
+ }
+ return item;
+}
+
+
void Item_ref_null_helper::print(String *str)
{
str->append(STRING_WITH_LEN("<ref_null_helper>("));
@@ -5715,8 +5789,7 @@ bool Item_outer_ref::fix_fields(THD *thd, Item **reference)
DESCRIPTION
A view column reference is considered equal to another column
reference if the second one is a view column and if both column
- references resolve to the same item. It is assumed that both
- items are of the same type.
+ references resolve to the same item.
RETURN
TRUE Referenced item is equal to given item
@@ -5732,8 +5805,6 @@ bool Item_direct_view_ref::eq(const Item *item, bool binary_cmp) const
if (item_ref->ref_type() == VIEW_REF)
{
Item *item_ref_ref= *(item_ref->ref);
- DBUG_ASSERT((*ref)->real_item()->type() ==
- item_ref_ref->real_item()->type());
return ((*ref)->real_item() == item_ref_ref->real_item());
}
}
@@ -5849,7 +5920,7 @@ int Item_default_value::save_in_field(Field *field_arg, bool no_conversions)
same time it can replace some nodes in the tree
*/
-Item *Item_default_value::transform(Item_transformer transformer, byte *args)
+Item *Item_default_value::transform(Item_transformer transformer, uchar *args)
{
DBUG_ASSERT(!current_thd->is_stmt_prepare());
@@ -5883,7 +5954,7 @@ bool Item_insert_value::fix_fields(THD *thd, Item **items)
if (!arg->fixed)
{
bool res;
- st_table_list *orig_next_table= context->last_name_resolution_table;
+ TABLE_LIST *orig_next_table= context->last_name_resolution_table;
context->last_name_resolution_table= context->first_name_resolution_table;
res= arg->fix_fields(thd, &arg);
context->last_name_resolution_table= orig_next_table;
@@ -6514,6 +6585,10 @@ Item_type_holder::Item_type_holder(THD *thd, Item *item)
if (Field::result_merge_type(fld_type) == INT_RESULT)
decimals= 0;
prev_decimal_int_part= item->decimal_int_part();
+ if (item->field_type() == MYSQL_TYPE_GEOMETRY)
+ geometry_type= (item->type() == Item::FIELD_ITEM) ?
+ ((Item_field *)item)->get_geometry_type() :
+ (Field::geometry_type)((Item_geometry_func *)item)->get_geometry_type();
}
@@ -6667,9 +6742,15 @@ bool Item_type_holder::join_types(THD *thd, Item *item)
expansion of the size of the values because of character set
conversions.
*/
- max_length= max(old_max_chars * collation.collation->mbmaxlen,
- display_length(item) / item->collation.collation->mbmaxlen *
- collation.collation->mbmaxlen);
+ if (collation.collation != &my_charset_bin)
+ {
+ max_length= max(old_max_chars * collation.collation->mbmaxlen,
+ display_length(item) /
+ item->collation.collation->mbmaxlen *
+ collation.collation->mbmaxlen);
+ }
+ else
+ set_if_bigger(max_length, display_length(item));
break;
}
case REAL_RESULT:
@@ -6791,7 +6872,7 @@ Field *Item_type_holder::make_field_by_type(TABLE *table)
switch (fld_type) {
case MYSQL_TYPE_ENUM:
DBUG_ASSERT(enum_set_typelib);
- field= new Field_enum((char *) 0, max_length, null_ptr, 0,
+ field= new Field_enum((uchar *) 0, max_length, null_ptr, 0,
Field::NONE, name,
get_enum_pack_length(enum_set_typelib->count),
enum_set_typelib, collation.collation);
@@ -6800,7 +6881,7 @@ Field *Item_type_holder::make_field_by_type(TABLE *table)
return field;
case MYSQL_TYPE_SET:
DBUG_ASSERT(enum_set_typelib);
- field= new Field_set((char *) 0, max_length, null_ptr, 0,
+ field= new Field_set((uchar *) 0, max_length, null_ptr, 0,
Field::NONE, name,
get_set_pack_length(enum_set_typelib->count),
enum_set_typelib, collation.collation);
diff --git a/sql/item.h b/sql/item.h
index 957edbb8f0d..655159ab752 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -19,7 +19,7 @@
#endif
class Protocol;
-struct st_table_list;
+struct TABLE_LIST;
void item_init(void); /* Init item functions */
class Item_field;
@@ -49,29 +49,50 @@ class DTCollation {
public:
CHARSET_INFO *collation;
enum Derivation derivation;
+ uint repertoire;
+ void set_repertoire_from_charset(CHARSET_INFO *cs)
+ {
+ repertoire= cs->state & MY_CS_PUREASCII ?
+ MY_REPERTOIRE_ASCII : MY_REPERTOIRE_UNICODE30;
+ }
DTCollation()
{
collation= &my_charset_bin;
derivation= DERIVATION_NONE;
+ repertoire= MY_REPERTOIRE_UNICODE30;
}
DTCollation(CHARSET_INFO *collation_arg, Derivation derivation_arg)
{
collation= collation_arg;
derivation= derivation_arg;
+ set_repertoire_from_charset(collation_arg);
}
void set(DTCollation &dt)
{
collation= dt.collation;
derivation= dt.derivation;
+ repertoire= dt.repertoire;
}
void set(CHARSET_INFO *collation_arg, Derivation derivation_arg)
{
collation= collation_arg;
derivation= derivation_arg;
+ set_repertoire_from_charset(collation_arg);
+ }
+ void set(CHARSET_INFO *collation_arg,
+ Derivation derivation_arg,
+ uint repertoire_arg)
+ {
+ collation= collation_arg;
+ derivation= derivation_arg;
+ repertoire= repertoire_arg;
}
void set(CHARSET_INFO *collation_arg)
- { collation= collation_arg; }
+ {
+ collation= collation_arg;
+ set_repertoire_from_charset(collation_arg);
+ }
void set(Derivation derivation_arg)
{ derivation= derivation_arg; }
bool aggregate(DTCollation &dt, uint flags= 0);
@@ -426,7 +447,7 @@ public:
};
-typedef bool (Item::*Item_processor) (byte *arg);
+typedef bool (Item::*Item_processor) (uchar *arg);
/*
Analyzer function
SYNOPSIS
@@ -438,8 +459,8 @@ typedef bool (Item::*Item_processor) (byte *arg);
FALSE Don't do it
*/
-typedef bool (Item::*Item_analyzer) (byte **argp);
-typedef Item* (Item::*Item_transformer) (byte *arg);
+typedef bool (Item::*Item_analyzer) (uchar **argp);
+typedef Item* (Item::*Item_transformer) (uchar *arg);
typedef void (*Cond_traverser) (const Item *item, void *arg);
@@ -448,9 +469,9 @@ class Item {
void operator=(Item &);
public:
static void *operator new(size_t size)
- { return (void*) sql_alloc((uint) size); }
+ { return sql_alloc(size); }
static void *operator new(size_t size, MEM_ROOT *mem_root)
- { return (void*) alloc_root(mem_root, (uint) size); }
+ { return alloc_root(mem_root, size); }
static void operator delete(void *ptr,size_t size) { TRASH(ptr, size); }
static void operator delete(void *ptr, MEM_ROOT *mem_root) {}
@@ -476,9 +497,9 @@ public:
save_in_field
*/
String str_value;
- my_string name; /* Name from select */
+ char * name; /* Name from select */
/* Original item name (if it was renamed)*/
- my_string orig_name;
+ char * orig_name;
Item *next;
uint32 max_length;
uint name_length; /* Length of name */
@@ -548,6 +569,43 @@ public:
virtual enum_monotonicity_info get_monotonicity_info() const
{ return NON_MONOTONIC; }
+ /*
+ Convert "func_arg $CMP$ const" half-interval into "FUNC(func_arg) $CMP2$ const2"
+
+ SYNOPSIS
+ val_int_endpoint()
+ left_endp FALSE <=> The interval is "x < const" or "x <= const"
+ TRUE <=> The interval is "x > const" or "x >= const"
+
+ incl_endp IN TRUE <=> the comparison is '<' or '>'
+ FALSE <=> the comparison is '<=' or '>='
+ OUT The same but for the "F(x) $CMP$ F(const)" comparison
+
+ DESCRIPTION
+ This function is defined only for unary monotonic functions. The caller
+ supplies the source half-interval
+
+ x $CMP$ const
+
+ The value of const is supplied implicitly as the value this item's
+ argument, the form of $CMP$ comparison is specified through the
+ function's arguments. The calle returns the result interval
+
+ F(x) $CMP2$ F(const)
+
+ passing back F(const) as the return value, and the form of $CMP2$
+ through the out parameter. NULL values are assumed to be comparable and
+ be less than any non-NULL values.
+
+ RETURN
+ The output range bound, which equal to the value of val_int()
+ - If the value of the function is NULL then the bound is the
+ smallest possible value of LONGLONG_MIN
+ */
+ virtual longlong val_int_endpoint(bool left_endp, bool *incl_endp)
+ { DBUG_ASSERT(0); return 0; }
+
+
/* valXXX methods must return NULL or 0 or 0.0 if null_value is set. */
/*
Return double precision floating point representation of item.
@@ -653,6 +711,7 @@ public:
int save_time_in_field(Field *field);
int save_date_in_field(Field *field);
+ int save_str_value_in_field(Field *field, String *result);
virtual Field *get_tmp_table_field() { return 0; }
/* This is also used to create fields in CREATE ... SELECT: */
@@ -779,12 +838,12 @@ public:
static CHARSET_INFO *default_charset();
virtual CHARSET_INFO *compare_collation() { return NULL; }
- virtual bool walk(Item_processor processor, bool walk_subquery, byte *arg)
+ virtual bool walk(Item_processor processor, bool walk_subquery, uchar *arg)
{
return (this->*processor)(arg);
}
- virtual Item* transform(Item_transformer transformer, byte *arg);
+ virtual Item* transform(Item_transformer transformer, uchar *arg);
/*
This function performs a generic "compilation" of the Item tree.
@@ -802,8 +861,8 @@ public:
i.e. analysis is performed top-down while transformation is done
bottom-up.
*/
- virtual Item* compile(Item_analyzer analyzer, byte **arg_p,
- Item_transformer transformer, byte *arg_t)
+ virtual Item* compile(Item_analyzer analyzer, uchar **arg_p,
+ Item_transformer transformer, uchar *arg_t)
{
if ((this->*analyzer) (arg_p))
return ((this->*transformer) (arg_t));
@@ -816,15 +875,15 @@ public:
(*traverser)(this, arg);
}
- virtual bool remove_dependence_processor(byte * arg) { return 0; }
- virtual bool remove_fixed(byte * arg) { fixed= 0; return 0; }
- virtual bool cleanup_processor(byte *arg);
- virtual bool collect_item_field_processor(byte * arg) { return 0; }
- virtual bool find_item_in_field_list_processor(byte *arg) { return 0; }
- virtual bool change_context_processor(byte *context) { return 0; }
- virtual bool reset_query_id_processor(byte *query_id_arg) { return 0; }
- virtual bool is_expensive_processor(byte *arg) { return 0; }
- virtual bool register_field_in_read_map(byte *arg) { return 0; }
+ virtual bool remove_dependence_processor(uchar * arg) { return 0; }
+ virtual bool remove_fixed(uchar * arg) { fixed= 0; return 0; }
+ virtual bool cleanup_processor(uchar *arg);
+ virtual bool collect_item_field_processor(uchar * arg) { return 0; }
+ virtual bool find_item_in_field_list_processor(uchar *arg) { return 0; }
+ virtual bool change_context_processor(uchar *context) { return 0; }
+ virtual bool reset_query_id_processor(uchar *query_id_arg) { return 0; }
+ virtual bool is_expensive_processor(uchar *arg) { return 0; }
+ virtual bool register_field_in_read_map(uchar *arg) { return 0; }
/*
Check if a partition function is allowed
SYNOPSIS
@@ -843,8 +902,7 @@ public:
german character for double s is equal to 2 s.
The default is that an item is not allowed
- in a partition function. However all mathematical functions, string
- manipulation functions, date functions are allowed. Allowed functions
+ in a partition function. Allowed functions
can never depend on server version, they cannot depend on anything
related to the environment. They can also only depend on a set of
fields in the table itself. They cannot depend on other tables and
@@ -877,17 +935,17 @@ public:
assumes that there are no multi-byte collations amongst the partition
fields.
*/
- virtual bool check_partition_func_processor(byte *bool_arg) { return TRUE;}
- virtual bool subst_argument_checker(byte **arg)
+ virtual bool check_partition_func_processor(uchar *bool_arg) { return TRUE;}
+ virtual bool subst_argument_checker(uchar **arg)
{
if (*arg)
*arg= NULL;
return TRUE;
}
- virtual Item *equal_fields_propagator(byte * arg) { return this; }
- virtual bool set_no_const_sub(byte *arg) { return FALSE; }
- virtual Item *replace_equal_field(byte * arg) { return this; }
+ virtual Item *equal_fields_propagator(uchar * arg) { return this; }
+ virtual bool set_no_const_sub(uchar *arg) { return FALSE; }
+ virtual Item *replace_equal_field(uchar * arg) { return this; }
/*
For SP local variable returns pointer to Item representing its
@@ -916,7 +974,7 @@ public:
virtual Item_field *filed_for_view_update() { return 0; }
virtual Item *neg_transformer(THD *thd) { return NULL; }
- virtual Item *update_value_transformer(byte *select_arg) { return this; }
+ virtual Item *update_value_transformer(uchar *select_arg) { return this; }
virtual Item *safe_charset_converter(CHARSET_INFO *tocs);
void delete_self()
{
@@ -1054,9 +1112,18 @@ public:
SP variable in query text.
*/
uint pos_in_query;
+ /*
+ Byte length of SP variable name in the statement (see pos_in_query).
+ The value of this field may differ from the name_length value because
+ name_length contains byte length of UTF8-encoded item name, but
+ the query string (see sp_instr_stmt::m_query) is currently stored with
+ a charset from the SET NAMES statement.
+ */
+ uint len_in_query;
Item_splocal(const LEX_STRING &sp_var_name, uint sp_var_idx,
- enum_field_types sp_var_type, uint pos_in_q= 0);
+ enum_field_types sp_var_type,
+ uint pos_in_q= 0, uint len_in_q= 0);
bool is_splocal() { return 1; } /* Needed for error checking */
@@ -1224,7 +1291,7 @@ public:
Item_num() {} /* Remove gcc warning */
virtual Item_num *neg()= 0;
Item *safe_charset_converter(CHARSET_INFO *tocs);
- bool check_partition_func_processor(byte *int_arg) { return FALSE;}
+ bool check_partition_func_processor(uchar *int_arg) { return FALSE;}
};
#define NO_CACHED_FIELD_INDEX ((uint)(-1))
@@ -1268,9 +1335,9 @@ public:
Item_ident(THD *thd, Item_ident *item);
const char *full_name() const;
void cleanup();
- bool remove_dependence_processor(byte * arg);
+ bool remove_dependence_processor(uchar * arg);
void print(String *str);
- virtual bool change_context_processor(byte *cntx)
+ virtual bool change_context_processor(uchar *cntx)
{ context= (Name_resolution_context *)cntx; return FALSE; }
friend bool insert_fields(THD *thd, Name_resolution_context *context,
const char *db_name,
@@ -1371,6 +1438,7 @@ public:
{
return MONOTONIC_STRICT_INCREASING;
}
+ longlong val_int_endpoint(bool left_endp, bool *incl_endp);
Field *get_tmp_table_field() { return result_field; }
Field *tmp_table_field(TABLE *t_arg) { return result_field; }
bool get_date(MYSQL_TIME *ltime,uint fuzzydate);
@@ -1379,26 +1447,31 @@ public:
bool is_null() { return field->is_null(); }
void update_null_value();
Item *get_tmp_table_item(THD *thd);
- bool collect_item_field_processor(byte * arg);
- bool find_item_in_field_list_processor(byte *arg);
- bool register_field_in_read_map(byte *arg);
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
+ bool collect_item_field_processor(uchar * arg);
+ bool find_item_in_field_list_processor(uchar *arg);
+ bool register_field_in_read_map(uchar *arg);
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
void cleanup();
bool result_as_longlong()
{
return field->can_be_compared_as_longlong();
}
Item_equal *find_item_equal(COND_EQUAL *cond_equal);
- bool subst_argument_checker(byte **arg);
- Item *equal_fields_propagator(byte *arg);
- bool set_no_const_sub(byte *arg);
- Item *replace_equal_field(byte *arg);
+ bool subst_argument_checker(uchar **arg);
+ Item *equal_fields_propagator(uchar *arg);
+ bool set_no_const_sub(uchar *arg);
+ Item *replace_equal_field(uchar *arg);
inline uint32 max_disp_length() { return field->max_display_length(); }
Item_field *filed_for_view_update() { return this; }
Item *safe_charset_converter(CHARSET_INFO *tocs);
int fix_outer_field(THD *thd, Field **field, Item **reference);
- virtual Item *update_value_transformer(byte *select_arg);
+ virtual Item *update_value_transformer(uchar *select_arg);
void print(String *str);
+ Field::geometry_type get_geometry_type()
+ {
+ DBUG_ASSERT(field_type() == MYSQL_TYPE_GEOMETRY);
+ return field->get_geometry_type();
+ }
friend class Item_default_value;
friend class Item_insert_value;
friend class st_select_lex_unit;
@@ -1433,7 +1506,7 @@ public:
bool is_null() { return 1; }
void print(String *str) { str->append(STRING_WITH_LEN("NULL")); }
Item *safe_charset_converter(CHARSET_INFO *tocs);
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
class Item_null_result :public Item_null
@@ -1446,7 +1519,7 @@ public:
{
save_in_field(result_field, no_conversions);
}
- bool check_partition_func_processor(byte *int_arg) {return TRUE;}
+ bool check_partition_func_processor(uchar *int_arg) {return TRUE;}
};
/* Item represents one placeholder ('?') of prepared statement */
@@ -1456,8 +1529,10 @@ class Item_param :public Item
char cnvbuf[MAX_FIELD_WIDTH];
String cnvstr;
Item *cnvitem;
-public:
+ bool strict_type;
+ enum Item_result required_result_type;
+public:
enum enum_item_param_state
{
NO_VALUE, NULL_VALUE, INT_VALUE, REAL_VALUE,
@@ -1585,6 +1660,11 @@ public:
Otherwise return FALSE.
*/
bool eq(const Item *item, bool binary_cmp) const;
+ void set_strict_type(enum Item_result result_type_arg)
+ {
+ strict_type= TRUE;
+ required_result_type= result_type_arg;
+ }
};
@@ -1621,6 +1701,7 @@ public:
uint decimal_precision() const
{ return (uint)(max_length - test(value < 0)); }
bool eq(const Item *, bool binary_cmp) const;
+ bool check_partition_func_processor(uchar *bool_arg) { return FALSE;}
};
@@ -1638,6 +1719,7 @@ public:
void print(String *str);
Item_num *neg ();
uint decimal_precision() const { return max_length; }
+ bool check_partition_func_processor(uchar *bool_arg) { return FALSE;}
};
@@ -1653,7 +1735,7 @@ public:
Item_decimal(my_decimal *value_par);
Item_decimal(longlong val, bool unsig);
Item_decimal(double val, int precision, int scale);
- Item_decimal(const char *bin, int precision, int scale);
+ Item_decimal(const uchar *bin, int precision, int scale);
enum Type type() const { return DECIMAL_ITEM; }
enum Item_result result_type () const { return DECIMAL_RESULT; }
@@ -1680,6 +1762,7 @@ public:
uint decimal_precision() const { return decimal_value.precision(); }
bool eq(const Item *, bool binary_cmp) const;
void set_decimal_value(my_decimal *value_par);
+ bool check_partition_func_processor(uchar *bool_arg) { return FALSE;}
};
@@ -1698,8 +1781,11 @@ public:
max_length=length;
fixed= 1;
}
- Item_float(double value_par) :presentation(0), value(value_par) { fixed= 1; }
-
+ Item_float(double value_par, uint decimal_par) :presentation(0), value(value_par)
+ {
+ decimals= (uint8) decimal_par;
+ fixed= 1;
+ }
int save_in_field(Field *field, bool no_conversions);
enum Type type() const { return REAL_ITEM; }
enum_field_types field_type() const { return MYSQL_TYPE_DOUBLE; }
@@ -1740,7 +1826,6 @@ public:
{}
void print(String *str) { str->append(func_name); }
Item *safe_charset_converter(CHARSET_INFO *tocs);
- bool check_partition_func_processor(byte *int_arg) {return TRUE;}
};
@@ -1748,15 +1833,16 @@ class Item_string :public Item
{
public:
Item_string(const char *str,uint length,
- CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE)
+ CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE,
+ uint repertoire= MY_REPERTOIRE_UNICODE30)
{
- collation.set(cs, dv);
- str_value.set_or_copy_aligned(str,length,cs);
+ str_value.set_or_copy_aligned(str, length, cs);
+ collation.set(cs, dv, repertoire);
/*
We have to have a different max_length than 'length' here to
ensure that we get the right length if we do use the item
to create a new table. In this case max_length must be the maximum
- number of chars for a string of this type because we in create_field::
+ number of chars for a string of this type because we in Create_field::
divide the max_length with mbmaxlen).
*/
max_length= str_value.numchars()*cs->mbmaxlen;
@@ -1775,10 +1861,11 @@ public:
fixed= 1;
}
Item_string(const char *name_par, const char *str, uint length,
- CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE)
+ CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE,
+ uint repertoire= MY_REPERTOIRE_UNICODE30)
{
- collation.set(cs, dv);
- str_value.set_or_copy_aligned(str,length,cs);
+ str_value.set_or_copy_aligned(str, length, cs);
+ collation.set(cs, dv, repertoire);
max_length= str_value.numchars()*cs->mbmaxlen;
set_name(name_par, 0, cs);
decimals=NOT_FIXED_DEC;
@@ -1794,6 +1881,12 @@ public:
str_value.copy(str_arg, length_arg, collation.collation);
max_length= str_value.numchars() * collation.collation->mbmaxlen;
}
+ void set_repertoire_from_value()
+ {
+ collation.repertoire= my_string_repertoire(str_value.charset(),
+ str_value.ptr(),
+ str_value.length());
+ }
enum Type type() const { return STRING_ITEM; }
double val_real();
longlong val_int();
@@ -1822,7 +1915,7 @@ public:
void print(String *str);
// to prevent drop fixed flag (no need parent cleanup call)
void cleanup() {}
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -1837,7 +1930,7 @@ public:
{}
Item *safe_charset_converter(CHARSET_INFO *tocs);
void print(String *str) { str->append(func_name); }
- bool check_partition_func_processor(byte *int_arg) {return TRUE;}
+ bool check_partition_func_processor(uchar *int_arg) {return TRUE;}
};
@@ -1849,7 +1942,6 @@ public:
CHARSET_INFO *cs= NULL):
Item_string(name, length, cs)
{}
- bool check_partition_func_processor(byte *int_arg) {return TRUE;}
};
@@ -1876,11 +1968,17 @@ 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
+ the client.
+*/
+
class Item_empty_string :public Item_partition_func_safe_string
{
public:
Item_empty_string(const char *header,uint length, CHARSET_INFO *cs= NULL) :
- Item_partition_func_safe_string("",0, cs ? cs : &my_charset_bin)
+ Item_partition_func_safe_string("",0, cs ? cs : &my_charset_utf8_general_ci)
{ name=(char*) header; max_length= cs ? length * cs->mbmaxlen : length; }
void make_field(Send_field *field);
};
@@ -1897,7 +1995,6 @@ public:
unsigned_flag=1;
}
enum_field_types field_type() const { return int_field_type; }
- bool check_partition_func_processor(byte *int_arg) {return TRUE;}
};
@@ -1924,7 +2021,7 @@ public:
void cleanup() {}
bool eq(const Item *item, bool binary_cmp) const;
virtual Item *safe_charset_converter(CHARSET_INFO *tocs);
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -2019,11 +2116,7 @@ public:
enum_field_types field_type() const { return (*ref)->field_type(); }
Field *get_tmp_table_field()
{ return result_field ? result_field : (*ref)->get_tmp_table_field(); }
- Item *get_tmp_table_item(THD *thd)
- {
- return (result_field ? new Item_field(result_field) :
- (*ref)->get_tmp_table_item(thd));
- }
+ Item *get_tmp_table_item(THD *thd);
table_map used_tables() const
{
return depended_from ? OUTER_REF_TABLE_BIT : (*ref)->used_tables();
@@ -2044,7 +2137,7 @@ public:
{
return ref ? (*ref)->real_item() : this;
}
- bool walk(Item_processor processor, bool walk_subquery, byte *arg)
+ bool walk(Item_processor processor, bool walk_subquery, uchar *arg)
{ return (*ref)->walk(processor, walk_subquery, arg); }
void print(String *str);
bool result_as_longlong()
@@ -2102,6 +2195,12 @@ public:
bool fix_fields(THD *, Item **);
bool eq(const Item *item, bool binary_cmp) const;
+ Item *get_tmp_table_item(THD *thd)
+ {
+ Item *item= Item_ref::get_tmp_table_item(thd);
+ item->name= name;
+ return item;
+ }
virtual Ref_Type ref_type() { return VIEW_REF; }
};
@@ -2223,7 +2322,6 @@ public:
}
Item *clone_item();
virtual Item *real_item() { return ref; }
- bool check_partition_func_processor(byte *int_arg) {return TRUE;}
};
#ifdef MYSQL_SERVER
@@ -2275,7 +2373,10 @@ public:
my_decimal *val_decimal(my_decimal *);
void make_field(Send_field *field) { item->make_field(field); }
void copy();
- int save_in_field(Field *field, bool no_conversions);
+ int save_in_field(Field *field, bool no_conversions)
+ {
+ return save_str_value_in_field(field, &str_value);
+ }
table_map used_tables() const { return (table_map) 1L; }
bool const_item() const { return 0; }
bool is_null() { return null_value; }
@@ -2332,7 +2433,7 @@ public:
class Cached_item_field :public Cached_item
{
- char *buff;
+ uchar *buff;
Field *field;
uint length;
@@ -2340,7 +2441,7 @@ public:
Cached_item_field(Item_field *item)
{
field= item->field;
- buff= (char*) sql_calloc(length=field->pack_length());
+ buff= (uchar*) sql_calloc(length=field->pack_length());
}
bool cmp(void);
};
@@ -2364,13 +2465,13 @@ public:
int save_in_field(Field *field_arg, bool no_conversions);
table_map used_tables() const { return (table_map)0L; }
- bool walk(Item_processor processor, bool walk_subquery, byte *args)
+ bool walk(Item_processor processor, bool walk_subquery, uchar *args)
{
return arg->walk(processor, walk_subquery, args) ||
(this->*processor)(args);
}
- Item *transform(Item_transformer transformer, byte *args);
+ Item *transform(Item_transformer transformer, uchar *args);
};
/*
@@ -2404,7 +2505,7 @@ public:
*/
table_map used_tables() const { return RAND_TABLE_BIT; }
- bool walk(Item_processor processor, bool walk_subquery, byte *args)
+ bool walk(Item_processor processor, bool walk_subquery, uchar *args)
{
return arg->walk(processor, walk_subquery, args) ||
(this->*processor)(args);
@@ -2424,14 +2525,6 @@ enum trg_action_time_type
TRG_ACTION_BEFORE= 0, TRG_ACTION_AFTER= 1, TRG_ACTION_MAX
};
-/*
- Event on which trigger is invoked.
-*/
-enum trg_event_type
-{
- TRG_EVENT_INSERT= 0 , TRG_EVENT_UPDATE= 1, TRG_EVENT_DELETE= 2, TRG_EVENT_MAX
-};
-
class Table_triggers_list;
/*
@@ -2692,6 +2785,7 @@ class Item_type_holder: public Item
protected:
TYPELIB *enum_set_typelib;
enum_field_types fld_type;
+ Field::geometry_type geometry_type;
void get_full_info(Item *item);
@@ -2711,6 +2805,7 @@ public:
Field *make_field_by_type(TABLE *table);
static uint32 display_length(Item *item);
static enum_field_types get_real_type(Item *);
+ Field::geometry_type get_geometry_type() { return geometry_type; };
};
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 7b55abe8fc7..8f5ff050dd6 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -531,8 +531,8 @@ int Arg_comparator::set_compare_func(Item_bool_func2 *item, Item_result type)
which would be transformed to:
WHERE col= 'j'
*/
- (*a)->walk(&Item::set_no_const_sub, FALSE, (byte*) 0);
- (*b)->walk(&Item::set_no_const_sub, FALSE, (byte*) 0);
+ (*a)->walk(&Item::set_no_const_sub, FALSE, (uchar*) 0);
+ (*b)->walk(&Item::set_no_const_sub, FALSE, (uchar*) 0);
}
break;
}
@@ -560,7 +560,7 @@ int Arg_comparator::set_compare_func(Item_bool_func2 *item, Item_result type)
{
if ((*a)->decimals < NOT_FIXED_DEC && (*b)->decimals < NOT_FIXED_DEC)
{
- precision= 5 * log_01[max((*a)->decimals, (*b)->decimals)];
+ precision= 5 / log_10[max((*a)->decimals, (*b)->decimals) + 1];
if (func == &Arg_comparator::compare_real)
func= &Arg_comparator::compare_real_fixed;
else if (func == &Arg_comparator::compare_e_real)
@@ -690,7 +690,13 @@ Arg_comparator::can_compare_as_dates(Item *a, Item *b, ulonglong *const_value)
if (cmp_type != CMP_DATE_DFLT)
{
- if (cmp_type != CMP_DATE_WITH_DATE && str_arg->const_item())
+ /*
+ Do not cache GET_USER_VAR() function as its const_item() may return TRUE
+ for the current thread but it still may change during the execution.
+ */
+ if (cmp_type != CMP_DATE_WITH_DATE && str_arg->const_item() &&
+ (str_arg->type() != Item::FUNC_ITEM ||
+ ((Item_func*)str_arg)->functype() != Item_func::GUSERVAR_FUNC))
{
THD *thd= current_thd;
ulonglong value;
@@ -713,12 +719,73 @@ Arg_comparator::can_compare_as_dates(Item *a, Item *b, ulonglong *const_value)
}
+/*
+ Retrieves correct TIME value from the given item.
+
+ SYNOPSIS
+ get_time_value()
+ thd thread handle
+ item_arg [in/out] item to retrieve TIME value from
+ cache_arg [in/out] pointer to place to store the cache item to
+ warn_item [in] unused
+ is_null [out] TRUE <=> the item_arg is null
+
+ DESCRIPTION
+ Retrieves the correct TIME value from given item for comparison by the
+ compare_datetime() function.
+ If item's result can be compared as longlong then its int value is used
+ and a value returned by get_time function is used otherwise.
+ If an item is a constant one then its value is cached and it isn't
+ get parsed again. An Item_cache_int object is used for for cached values.
+ It seamlessly substitutes the original item. The cache item is marked as
+ non-constant to prevent re-caching it again.
+
+ RETURN
+ obtained value
+*/
+
+ulonglong
+get_time_value(THD *thd, Item ***item_arg, Item **cache_arg,
+ Item *warn_item, bool *is_null)
+{
+ ulonglong value;
+ Item *item= **item_arg;
+ MYSQL_TIME ltime;
+
+ if (item->result_as_longlong())
+ {
+ value= item->val_int();
+ *is_null= item->null_value;
+ }
+ else
+ {
+ *is_null= item->get_time(&ltime);
+ value= !*is_null ? TIME_to_ulonglong_datetime(&ltime) : 0;
+ }
+ /*
+ Do not cache GET_USER_VAR() function as its const_item() may return TRUE
+ for the current thread but it still may change during the execution.
+ */
+ if (item->const_item() && cache_arg && (item->type() != Item::FUNC_ITEM ||
+ ((Item_func*)item)->functype() != Item_func::GUSERVAR_FUNC))
+ {
+ Item_cache_int *cache= new Item_cache_int();
+ /* Mark the cache as non-const to prevent re-caching. */
+ cache->set_used_tables(1);
+ cache->store(item, value);
+ *cache_arg= cache;
+ *item_arg= cache_arg;
+ }
+ return value;
+}
+
+
int Arg_comparator::set_cmp_func(Item_bool_func2 *owner_arg,
Item **a1, Item **a2,
Item_result type)
{
enum enum_date_cmp_type cmp_type;
- ulonglong const_value;
+ ulonglong const_value= (ulonglong)-1;
a= a1;
b= a2;
@@ -731,8 +798,7 @@ int Arg_comparator::set_cmp_func(Item_bool_func2 *owner_arg,
a_cache= 0;
b_cache= 0;
- if (cmp_type != CMP_DATE_WITH_DATE &&
- ((*b)->const_item() || (*a)->const_item()))
+ if (const_value != (ulonglong)-1)
{
Item_cache_int *cache= new Item_cache_int();
/* Mark the cache as non-const to prevent re-caching. */
@@ -752,8 +818,23 @@ int Arg_comparator::set_cmp_func(Item_bool_func2 *owner_arg,
}
is_nulls_eq= test(owner && owner->functype() == Item_func::EQUAL_FUNC);
func= &Arg_comparator::compare_datetime;
+ get_value_func= &get_datetime_value;
return 0;
}
+ else if (type == STRING_RESULT && (*a)->field_type() == MYSQL_TYPE_TIME &&
+ (*b)->field_type() == MYSQL_TYPE_TIME)
+ {
+ /* Compare TIME values as integers. */
+ thd= current_thd;
+ owner= owner_arg;
+ a_cache= 0;
+ b_cache= 0;
+ is_nulls_eq= test(owner && owner->functype() == Item_func::EQUAL_FUNC);
+ func= &Arg_comparator::compare_datetime;
+ get_value_func= &get_time_value;
+ return 0;
+ }
+
return set_compare_func(owner_arg, type);
}
@@ -771,8 +852,10 @@ void Arg_comparator::set_datetime_cmp_func(Item **a1, Item **b1)
b_cache= 0;
is_nulls_eq= FALSE;
func= &Arg_comparator::compare_datetime;
+ get_value_func= &get_datetime_value;
}
+
/*
Retrieves correct DATETIME value from given item.
@@ -814,7 +897,12 @@ get_datetime_value(THD *thd, Item ***item_arg, Item **cache_arg,
{
value= item->val_int();
*is_null= item->null_value;
- if (item->field_type() == MYSQL_TYPE_DATE)
+ /*
+ Item_date_add_interval may return MYSQL_TYPE_STRING as the result
+ field type. To detect that the DATE value has been returned we
+ compare it with 1000000L - any DATE value should be less than it.
+ */
+ if (item->field_type() == MYSQL_TYPE_DATE || value < 100000000L)
value*= 1000000L;
}
else
@@ -838,7 +926,12 @@ get_datetime_value(THD *thd, Item ***item_arg, Item **cache_arg,
MYSQL_TYPE_DATE ? MYSQL_TIMESTAMP_DATE : MYSQL_TIMESTAMP_DATETIME;
value= get_date_from_str(thd, str, t_type, warn_item->name, &error);
}
- if (item->const_item() && cache_arg)
+ /*
+ Do not cache GET_USER_VAR() function as its const_item() may return TRUE
+ for the current thread but it still may change during the execution.
+ */
+ if (item->const_item() && cache_arg && (item->type() != Item::FUNC_ITEM ||
+ ((Item_func*)item)->functype() != Item_func::GUSERVAR_FUNC))
{
Item_cache_int *cache= new Item_cache_int();
/* Mark the cache as non-const to prevent re-caching. */
@@ -876,8 +969,8 @@ int Arg_comparator::compare_datetime()
bool is_null= FALSE;
ulonglong a_value, b_value;
- /* Get DATE/DATETIME value of the 'a' item. */
- a_value= get_datetime_value(thd, &a, &a_cache, *b, &is_null);
+ /* Get DATE/DATETIME/TIME value of the 'a' item. */
+ a_value= (*get_value_func)(thd, &a, &a_cache, *b, &is_null);
if (!is_nulls_eq && is_null)
{
if (owner)
@@ -885,8 +978,8 @@ int Arg_comparator::compare_datetime()
return -1;
}
- /* Get DATE/DATETIME value of the 'b' item. */
- b_value= get_datetime_value(thd, &b, &b_cache, *a, &is_null);
+ /* Get DATE/DATETIME/TIME value of the 'b' item. */
+ b_value= (*get_value_func)(thd, &b, &b_cache, *a, &is_null);
if (is_null)
{
if (owner)
@@ -1756,7 +1849,9 @@ void Item_func_between::fix_length_and_dec()
max_length= 1;
int i;
bool datetime_found= FALSE;
+ int time_items_found= 0;
compare_as_dates= TRUE;
+ THD *thd= current_thd;
/*
As some compare functions are generated after sql_yacc,
@@ -1775,17 +1870,19 @@ void Item_func_between::fix_length_and_dec()
At least one of items should be a DATE/DATETIME item and other items
should return the STRING result.
*/
- for (i= 0; i < 3; i++)
+ if (cmp_type == STRING_RESULT)
{
- if (args[i]->is_datetime())
+ for (i= 0; i < 3; i++)
{
- datetime_found= TRUE;
- continue;
+ if (args[i]->is_datetime())
+ {
+ datetime_found= TRUE;
+ continue;
+ }
+ if (args[i]->field_type() == MYSQL_TYPE_TIME &&
+ args[i]->result_as_longlong())
+ time_items_found++;
}
- if (args[i]->result_type() == STRING_RESULT)
- continue;
- compare_as_dates= FALSE;
- break;
}
if (!datetime_found)
compare_as_dates= FALSE;
@@ -1795,6 +1892,28 @@ void Item_func_between::fix_length_and_dec()
ge_cmp.set_datetime_cmp_func(args, args + 1);
le_cmp.set_datetime_cmp_func(args, args + 2);
}
+ else if (time_items_found == 3)
+ {
+ /* Compare TIME items as integers. */
+ cmp_type= INT_RESULT;
+ }
+ else if (args[0]->real_item()->type() == FIELD_ITEM &&
+ thd->lex->sql_command != SQLCOM_CREATE_VIEW &&
+ thd->lex->sql_command != SQLCOM_SHOW_CREATE)
+ {
+ Field *field=((Item_field*) (args[0]->real_item()))->field;
+ if (field->can_be_compared_as_longlong())
+ {
+ /*
+ The following can't be recoded with || as convert_constant_item
+ changes the argument
+ */
+ if (convert_constant_item(thd, field,&args[1]))
+ cmp_type=INT_RESULT; // Works for all types.
+ if (convert_constant_item(thd, field,&args[2]))
+ cmp_type=INT_RESULT; // Works for all types.
+ }
+ }
}
@@ -2425,7 +2544,7 @@ bool Item_func_case::fix_fields(THD *thd, Item **ref)
Item_func_case::val_int() -> Item_func_case::find_item()
*/
#ifndef EMBEDDED_LIBRARY
- char buff[MAX_FIELD_WIDTH*2+sizeof(String)*2+sizeof(String*)*2+sizeof(double)*2+sizeof(longlong)*2];
+ uchar buff[MAX_FIELD_WIDTH*2+sizeof(String)*2+sizeof(String*)*2+sizeof(double)*2+sizeof(longlong)*2];
#endif
bool res= Item_func::fix_fields(thd, ref);
/*
@@ -2553,6 +2672,21 @@ void Item_func_case::print(String *str)
str->append(STRING_WITH_LEN("end)"));
}
+
+void Item_func_case::cleanup()
+{
+ uint i;
+ DBUG_ENTER("Item_func_case::cleanup");
+ Item_func::cleanup();
+ for (i= 0; i <= (uint)DECIMAL_RESULT; i++)
+ {
+ delete cmp_items[i];
+ cmp_items[i]= 0;
+ }
+ DBUG_VOID_RETURN;
+}
+
+
/*
Coalesce - return first not NULL argument.
*/
@@ -2765,7 +2899,7 @@ static int cmp_decimal(void *cmp_arg, my_decimal *a, my_decimal *b)
int in_vector::find(Item *item)
{
- byte *result=get_value(item);
+ uchar *result=get_value(item);
if (!result || !used_count)
return 0; // Null value
@@ -2820,9 +2954,9 @@ void in_string::set(uint pos,Item *item)
}
-byte *in_string::get_value(Item *item)
+uchar *in_string::get_value(Item *item)
{
- return (byte*) item->val_str(&tmp);
+ return (uchar*) item->val_str(&tmp);
}
in_row::in_row(uint elements, Item * item)
@@ -2830,7 +2964,6 @@ in_row::in_row(uint elements, Item * item)
base= (char*) new cmp_item_row[count= elements];
size= sizeof(cmp_item_row);
compare= (qsort2_cmp) cmp_row;
- tmp.store_value(item);
/*
We need to reset these as otherwise we will call sort() with
uninitialized (even if not used) elements
@@ -2845,12 +2978,12 @@ in_row::~in_row()
delete [] (cmp_item_row*) base;
}
-byte *in_row::get_value(Item *item)
+uchar *in_row::get_value(Item *item)
{
tmp.store_value(item);
if (item->is_null())
return 0;
- return (byte *)&tmp;
+ return (uchar *)&tmp;
}
void in_row::set(uint pos, Item *item)
@@ -2873,13 +3006,34 @@ void in_longlong::set(uint pos,Item *item)
buff->unsigned_flag= item->unsigned_flag;
}
-byte *in_longlong::get_value(Item *item)
+uchar *in_longlong::get_value(Item *item)
{
tmp.val= item->val_int();
if (item->null_value)
return 0;
tmp.unsigned_flag= item->unsigned_flag;
- return (byte*) &tmp;
+ return (uchar*) &tmp;
+}
+
+void in_datetime::set(uint pos,Item *item)
+{
+ Item **tmp_item= &item;
+ bool is_null;
+ struct packed_longlong *buff= &((packed_longlong*) base)[pos];
+
+ buff->val= get_datetime_value(thd, &tmp_item, 0, warn_item, &is_null);
+ buff->unsigned_flag= 1L;
+}
+
+uchar *in_datetime::get_value(Item *item)
+{
+ bool is_null;
+ Item **tmp_item= lval_cache ? &lval_cache : &item;
+ tmp.val= get_datetime_value(thd, &tmp_item, &lval_cache, warn_item, &is_null);
+ if (item->null_value)
+ return 0;
+ tmp.unsigned_flag= 1L;
+ return (uchar*) &tmp;
}
in_double::in_double(uint elements)
@@ -2891,12 +3045,12 @@ void in_double::set(uint pos,Item *item)
((double*) base)[pos]= item->val_real();
}
-byte *in_double::get_value(Item *item)
+uchar *in_double::get_value(Item *item)
{
tmp= item->val_real();
if (item->null_value)
return 0; /* purecov: inspected */
- return (byte*) &tmp;
+ return (uchar*) &tmp;
}
@@ -2918,12 +3072,12 @@ void in_decimal::set(uint pos, Item *item)
}
-byte *in_decimal::get_value(Item *item)
+uchar *in_decimal::get_value(Item *item)
{
my_decimal *result= item->val_decimal(&val);
if (item->null_value)
return 0;
- return (byte *)result;
+ return (uchar *)result;
}
@@ -2986,12 +3140,18 @@ cmp_item_row::~cmp_item_row()
}
+void cmp_item_row::alloc_comparators()
+{
+ if (!comparators)
+ comparators= (cmp_item **) current_thd->calloc(sizeof(cmp_item *)*n);
+}
+
+
void cmp_item_row::store_value(Item *item)
{
DBUG_ENTER("cmp_item_row::store_value");
n= item->cols();
- if (!comparators)
- comparators= (cmp_item **) current_thd->calloc(sizeof(cmp_item *)*n);
+ alloc_comparators();
if (comparators)
{
item->bring_value();
@@ -3103,6 +3263,36 @@ cmp_item* cmp_item_decimal::make_same()
}
+void cmp_item_datetime::store_value(Item *item)
+{
+ bool is_null;
+ Item **tmp_item= lval_cache ? &lval_cache : &item;
+ value= get_datetime_value(thd, &tmp_item, &lval_cache, warn_item, &is_null);
+}
+
+
+int cmp_item_datetime::cmp(Item *arg)
+{
+ bool is_null;
+ Item **tmp_item= &arg;
+ return value !=
+ get_datetime_value(thd, &tmp_item, 0, warn_item, &is_null);
+}
+
+
+int cmp_item_datetime::compare(cmp_item *ci)
+{
+ cmp_item_datetime *l_cmp= (cmp_item_datetime *)ci;
+ return (value < l_cmp->value) ? -1 : ((value == l_cmp->value) ? 0 : 1);
+}
+
+
+cmp_item *cmp_item_datetime::make_same()
+{
+ return new cmp_item_datetime(warn_item);
+}
+
+
bool Item_func_in::nulls_in_row()
{
Item **arg,**arg_end;
@@ -3178,6 +3368,10 @@ void Item_func_in::fix_length_and_dec()
Item **arg, **arg_end;
bool const_itm= 1;
THD *thd= current_thd;
+ bool datetime_found= FALSE;
+ /* TRUE <=> arguments values will be compared as DATETIMEs. */
+ bool compare_as_datetime= FALSE;
+ Item *date_arg= 0;
uint found_types= 0;
uint type_cnt= 0, i;
Item_result cmp_type= STRING_RESULT;
@@ -3209,58 +3403,151 @@ void Item_func_in::fix_length_and_dec()
return;
arg_types_compatible= TRUE;
}
+ if (type_cnt == 1)
+ {
+ /*
+ When comparing rows create the row comparator object beforehand to ease
+ the DATETIME comparison detection procedure.
+ */
+ if (cmp_type == ROW_RESULT)
+ {
+ cmp_item_row *cmp= 0;
+ if (const_itm && !nulls_in_row())
+ {
+ array= new in_row(arg_count-1, 0);
+ cmp= &((in_row*)array)->tmp;
+ }
+ else
+ {
+ if (!(cmp= new cmp_item_row))
+ return;
+ cmp_items[ROW_RESULT]= cmp;
+ }
+ cmp->n= args[0]->cols();
+ cmp->alloc_comparators();
+ }
+ /* All DATE/DATETIME fields/functions has the STRING result type. */
+ if (cmp_type == STRING_RESULT || cmp_type == ROW_RESULT)
+ {
+ uint col, cols= args[0]->cols();
+ for (col= 0; col < cols; col++)
+ {
+ bool skip_column= FALSE;
+ /*
+ Check that all items to be compared has the STRING result type and at
+ least one of them is a DATE/DATETIME item.
+ */
+ for (arg= args, arg_end= args + arg_count; arg != arg_end ; arg++)
+ {
+ Item *itm= ((cmp_type == STRING_RESULT) ? arg[0] :
+ arg[0]->element_index(col));
+ if (itm->result_type() != STRING_RESULT)
+ {
+ skip_column= TRUE;
+ break;
+ }
+ else if (itm->is_datetime())
+ {
+ datetime_found= TRUE;
+ /*
+ Internally all DATE/DATETIME values are converted to the DATETIME
+ type. So try to find a DATETIME item to issue correct warnings.
+ */
+ if (!date_arg)
+ date_arg= itm;
+ else if (itm->field_type() == MYSQL_TYPE_DATETIME)
+ {
+ date_arg= itm;
+ /* All arguments are already checked to have the STRING result. */
+ if (cmp_type == STRING_RESULT)
+ break;
+ }
+ }
+ }
+ if (skip_column)
+ continue;
+ if (datetime_found)
+ {
+ if (cmp_type == ROW_RESULT)
+ {
+ cmp_item **cmp= 0;
+ if (array)
+ cmp= ((in_row*)array)->tmp.comparators + col;
+ else
+ cmp= ((cmp_item_row*)cmp_items[ROW_RESULT])->comparators + col;
+ *cmp= new cmp_item_datetime(date_arg);
+ /* Reset variables for the next column. */
+ date_arg= 0;
+ datetime_found= FALSE;
+ }
+ else
+ compare_as_datetime= TRUE;
+ }
+ }
+ }
+ }
/*
Row item with NULLs inside can return NULL or FALSE =>
they can't be processed as static
*/
if (type_cnt == 1 && const_itm && !nulls_in_row())
{
- /*
- IN must compare INT/DATE/DATETIME/TIMESTAMP columns and constants
- as int values (the same way as equality does).
- So we must check here if the column on the left and all the constant
- values on the right can be compared as integers and adjust the
- comparison type accordingly.
- */
- if (args[0]->real_item()->type() == FIELD_ITEM &&
- thd->lex->sql_command != SQLCOM_CREATE_VIEW &&
- thd->lex->sql_command != SQLCOM_SHOW_CREATE &&
- cmp_type != INT_RESULT)
+ if (compare_as_datetime)
+ array= new in_datetime(date_arg, arg_count - 1);
+ else
{
- Field *field= ((Item_field*) (args[0]->real_item()))->field;
- if (field->can_be_compared_as_longlong())
+ /*
+ IN must compare INT columns and constants as int values (the same
+ way as equality does).
+ So we must check here if the column on the left and all the constant
+ values on the right can be compared as integers and adjust the
+ comparison type accordingly.
+ */
+ if (args[0]->real_item()->type() == FIELD_ITEM &&
+ thd->lex->sql_command != SQLCOM_CREATE_VIEW &&
+ thd->lex->sql_command != SQLCOM_SHOW_CREATE &&
+ cmp_type != INT_RESULT)
{
- bool all_converted= TRUE;
- for (arg=args+1, arg_end=args+arg_count; arg != arg_end ; arg++)
+ Field *field= ((Item_field*) (args[0]->real_item()))->field;
+ if (field->can_be_compared_as_longlong())
{
- if (!convert_constant_item (thd, field, &arg[0]))
- all_converted= FALSE;
+ bool all_converted= TRUE;
+ for (arg=args+1, arg_end=args+arg_count; arg != arg_end ; arg++)
+ {
+ if (!convert_constant_item (thd, field, &arg[0]))
+ all_converted= FALSE;
+ }
+ if (all_converted)
+ cmp_type= INT_RESULT;
}
- if (all_converted)
- cmp_type= INT_RESULT;
}
- }
- switch (cmp_type) {
- case STRING_RESULT:
- array=new in_string(arg_count - 1,(qsort2_cmp) srtcmp_in,
- cmp_collation.collation);
- break;
- case INT_RESULT:
- array= new in_longlong(arg_count - 1);
- break;
- case REAL_RESULT:
- array= new in_double(arg_count - 1);
- break;
- case ROW_RESULT:
- array= new in_row(arg_count - 1, args[0]);
- break;
- case DECIMAL_RESULT:
- array= new in_decimal(arg_count - 1);
- break;
- default:
- DBUG_ASSERT(0);
- return;
+ switch (cmp_type) {
+ case STRING_RESULT:
+ array=new in_string(arg_count-1,(qsort2_cmp) srtcmp_in,
+ cmp_collation.collation);
+ break;
+ case INT_RESULT:
+ array= new in_longlong(arg_count-1);
+ break;
+ case REAL_RESULT:
+ array= new in_double(arg_count-1);
+ break;
+ case ROW_RESULT:
+ /*
+ The row comparator was created at the beginning but only DATETIME
+ items comparators were initialized. Call store_value() to setup
+ others.
+ */
+ ((in_row*)array)->tmp.store_value(args[0]);
+ break;
+ case DECIMAL_RESULT:
+ array= new in_decimal(arg_count - 1);
+ break;
+ default:
+ DBUG_ASSERT(0);
+ return;
+ }
}
if (array && !(thd->is_fatal_error)) // If not EOM
{
@@ -3279,17 +3566,23 @@ void Item_func_in::fix_length_and_dec()
}
else
{
- for (i= 0; i <= (uint) DECIMAL_RESULT; i++)
+ if (compare_as_datetime)
+ cmp_items[STRING_RESULT]= new cmp_item_datetime(date_arg);
+ else
{
- if (found_types & (1 << i) && !cmp_items[i])
+ for (i= 0; i <= (uint) DECIMAL_RESULT; i++)
{
- if ((Item_result)i == STRING_RESULT &&
- agg_arg_charsets(cmp_collation, args, arg_count, MY_COLL_CMP_CONV, 1))
- return;
- if (!(cmp_items[i]=
- cmp_item::get_comparator((Item_result)i,
- cmp_collation.collation)))
- return;
+ if (found_types & (1 << i) && !cmp_items[i])
+ {
+ if ((Item_result)i == STRING_RESULT &&
+ agg_arg_charsets(cmp_collation, args, arg_count,
+ MY_COLL_CMP_CONV, 1))
+ return;
+ if (!cmp_items[i] && !(cmp_items[i]=
+ cmp_item::get_comparator((Item_result)i,
+ cmp_collation.collation)))
+ return;
+ }
}
}
}
@@ -3434,7 +3727,7 @@ Item_cond::fix_fields(THD *thd, Item **ref)
List_iterator<Item> li(list);
Item *item;
#ifndef EMBEDDED_LIBRARY
- char buff[sizeof(char*)]; // Max local vars in function
+ uchar buff[sizeof(char*)]; // Max local vars in function
#endif
not_null_tables_cache= used_tables_cache= 0;
const_item_cache= 1;
@@ -3501,7 +3794,7 @@ Item_cond::fix_fields(THD *thd, Item **ref)
return FALSE;
}
-bool Item_cond::walk(Item_processor processor, bool walk_subquery, byte *arg)
+bool Item_cond::walk(Item_processor processor, bool walk_subquery, uchar *arg)
{
List_iterator_fast<Item> li(list);
Item *item;
@@ -3533,7 +3826,7 @@ bool Item_cond::walk(Item_processor processor, bool walk_subquery, byte *arg)
Item returned as the result of transformation of the root node
*/
-Item *Item_cond::transform(Item_transformer transformer, byte *arg)
+Item *Item_cond::transform(Item_transformer transformer, uchar *arg)
{
DBUG_ASSERT(!current_thd->is_stmt_prepare());
@@ -3584,8 +3877,8 @@ Item *Item_cond::transform(Item_transformer transformer, byte *arg)
Item returned as the result of transformation of the root node
*/
-Item *Item_cond::compile(Item_analyzer analyzer, byte **arg_p,
- Item_transformer transformer, byte *arg_t)
+Item *Item_cond::compile(Item_analyzer analyzer, uchar **arg_p,
+ Item_transformer transformer, uchar *arg_t)
{
if (!(this->*analyzer)(arg_p))
return 0;
@@ -3598,7 +3891,7 @@ Item *Item_cond::compile(Item_analyzer analyzer, byte **arg_p,
The same parameter value of arg_p must be passed
to analyze any argument of the condition formula.
*/
- byte *arg_v= *arg_p;
+ uchar *arg_v= *arg_p;
Item *new_item= item->compile(analyzer, &arg_v, transformer, arg_t);
if (new_item && new_item != item)
li.replace(new_item);
@@ -4832,7 +5125,7 @@ void Item_equal::fix_length_and_dec()
item->collation.collation);
}
-bool Item_equal::walk(Item_processor processor, bool walk_subquery, byte *arg)
+bool Item_equal::walk(Item_processor processor, bool walk_subquery, uchar *arg)
{
List_iterator_fast<Item_field> it(fields);
Item *item;
@@ -4844,7 +5137,7 @@ bool Item_equal::walk(Item_processor processor, bool walk_subquery, byte *arg)
return Item_func::walk(processor, walk_subquery, arg);
}
-Item *Item_equal::transform(Item_transformer transformer, byte *arg)
+Item *Item_equal::transform(Item_transformer transformer, uchar *arg)
{
DBUG_ASSERT(!current_thd->is_stmt_prepare());
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 7aede7d2954..40d0c2dfe91 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -42,6 +42,8 @@ class Arg_comparator: public Sql_alloc
bool is_nulls_eq; // TRUE <=> compare for the EQUAL_FUNC
enum enum_date_cmp_type { CMP_DATE_DFLT= 0, CMP_DATE_WITH_DATE,
CMP_DATE_WITH_STR, CMP_STR_WITH_DATE };
+ ulonglong (*get_value_func)(THD *thd, Item ***item_arg, Item **cache_arg,
+ Item *warn_item, bool *is_null);
public:
DTCollation cmp_collation;
@@ -355,8 +357,7 @@ public:
}
Item *neg_transformer(THD *thd);
virtual Item *negated_item();
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
- bool subst_argument_checker(byte **arg) { return TRUE; }
+ bool subst_argument_checker(uchar **arg) { return TRUE; }
};
class Item_func_not :public Item_bool_func
@@ -367,7 +368,6 @@ public:
enum Functype functype() const { return NOT_FUNC; }
const char *func_name() const { return "not"; }
Item *neg_transformer(THD *thd);
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
void print(String *str);
};
@@ -572,7 +572,7 @@ public:
return this;
}
bool eq(const Item *item, bool binary_cmp) const;
- bool subst_argument_checker(byte **arg) { return TRUE; }
+ bool subst_argument_checker(uchar **arg) { return TRUE; }
};
@@ -598,7 +598,6 @@ public:
bool is_bool_func() { return 1; }
CHARSET_INFO *compare_collation() { return cmp_collation.collation; }
uint decimal_precision() const { return 1; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -610,7 +609,6 @@ public:
optimize_type select_optimize() const { return OPTIMIZE_NONE; }
const char *func_name() const { return "strcmp"; }
void print(String *str) { Item_func::print(str); }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -673,7 +671,6 @@ public:
const char *func_name() const { return "ifnull"; }
Field *tmp_table_field(TABLE *table);
uint decimal_precision() const;
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -714,7 +711,6 @@ public:
void print(String *str) { Item_func::print(str); }
table_map not_null_tables() const { return 0; }
bool is_null();
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
/* Functions to handle the optimized IN */
@@ -739,7 +735,7 @@ public:
count(elements), used_count(elements) {}
virtual ~in_vector() {}
virtual void set(uint pos,Item *item)=0;
- virtual byte *get_value(Item *item)=0;
+ virtual uchar *get_value(Item *item)=0;
void sort()
{
qsort2(base,used_count,size,compare,collation);
@@ -782,7 +778,7 @@ public:
in_string(uint elements,qsort2_cmp cmp_func, CHARSET_INFO *cs);
~in_string();
void set(uint pos,Item *item);
- byte *get_value(Item *item);
+ uchar *get_value(Item *item);
Item* create_item()
{
return new Item_string(collation);
@@ -798,6 +794,7 @@ public:
class in_longlong :public in_vector
{
+protected:
/*
Here we declare a temporary variable (tmp) of the same type as the
elements of this vector. tmp is used in finding if a given value is in
@@ -811,7 +808,7 @@ class in_longlong :public in_vector
public:
in_longlong(uint elements);
void set(uint pos,Item *item);
- byte *get_value(Item *item);
+ uchar *get_value(Item *item);
Item* create_item()
{
@@ -832,32 +829,57 @@ public:
friend int cmp_longlong(void *cmp_arg, packed_longlong *a,packed_longlong *b);
};
+
+/*
+ Class to represent a vector of constant DATE/DATETIME values.
+ Values are obtained with help of the get_datetime_value() function.
+ If the left item is a constant one then its value is cached in the
+ lval_cache variable.
+*/
+class in_datetime :public in_longlong
+{
+public:
+ THD *thd;
+ /* An item used to issue warnings. */
+ Item *warn_item;
+ /* Cache for the left item. */
+ Item *lval_cache;
+
+ in_datetime(Item *warn_item_arg, uint elements)
+ :in_longlong(elements), thd(current_thd), warn_item(warn_item_arg),
+ lval_cache(0) {};
+ void set(uint pos,Item *item);
+ uchar *get_value(Item *item);
+ friend int cmp_longlong(void *cmp_arg, packed_longlong *a,packed_longlong *b);
+};
+
+
class in_double :public in_vector
{
double tmp;
public:
in_double(uint elements);
void set(uint pos,Item *item);
- byte *get_value(Item *item);
+ uchar *get_value(Item *item);
Item *create_item()
{
- return new Item_float(0.0);
+ return new Item_float(0.0, 0);
}
void value_to_item(uint pos, Item *item)
{
((Item_float*)item)->value= ((double*) base)[pos];
}
Item_result result_type() { return REAL_RESULT; }
-
};
+
class in_decimal :public in_vector
{
my_decimal val;
public:
in_decimal(uint elements);
void set(uint pos, Item *item);
- byte *get_value(Item *item);
+ uchar *get_value(Item *item);
Item *create_item()
{
return new Item_decimal(0, FALSE);
@@ -964,6 +986,30 @@ public:
cmp_item *make_same();
};
+/*
+ Compare items in the DATETIME context.
+ Values are obtained with help of the get_datetime_value() function.
+ If the left item is a constant one then its value is cached in the
+ lval_cache variable.
+*/
+class cmp_item_datetime :public cmp_item
+{
+ ulonglong value;
+public:
+ THD *thd;
+ /* Item used for issuing warnings. */
+ Item *warn_item;
+ /* Cache for the left item. */
+ Item *lval_cache;
+
+ cmp_item_datetime(Item *warn_item_arg)
+ :thd(current_thd), warn_item(warn_item_arg), lval_cache(0) {}
+ void store_value(Item *item);
+ int cmp(Item *arg);
+ int compare(cmp_item *ci);
+ cmp_item *make_same();
+};
+
class cmp_item_real :public cmp_item
{
double value;
@@ -998,32 +1044,6 @@ public:
};
-class cmp_item_row :public cmp_item
-{
- cmp_item **comparators;
- uint n;
-public:
- cmp_item_row(): comparators(0), n(0) {}
- ~cmp_item_row();
- void store_value(Item *item);
- int cmp(Item *arg);
- int compare(cmp_item *arg);
- cmp_item *make_same();
- void store_value_by_template(cmp_item *tmpl, Item *);
-};
-
-
-class in_row :public in_vector
-{
- cmp_item_row tmp;
-public:
- in_row(uint elements, Item *);
- ~in_row();
- void set(uint pos,Item *item);
- byte *get_value(Item *item);
- Item_result result_type() { return ROW_RESULT; }
-};
-
/*
cmp_item for optimized IN with row (right part string, which never
be changed)
@@ -1118,19 +1138,7 @@ public:
void print(String *str);
Item *find_item(String *str);
CHARSET_INFO *compare_collation() { return cmp_collation.collation; }
- bool check_partition_func_processor(byte *bool_arg) { return FALSE;}
- void cleanup()
- {
- uint i;
- DBUG_ENTER("Item_func_case::cleanup");
- Item_func::cleanup();
- for (i= 0; i <= (uint)DECIMAL_RESULT; i++)
- {
- delete cmp_items[i];
- cmp_items[i]= 0;
- }
- DBUG_VOID_RETURN;
- }
+ void cleanup();
};
/*
@@ -1150,7 +1158,6 @@ public:
class Item_func_in :public Item_func_opt_neg
{
public:
- Item_result cmp_type;
/*
an array of values when the right hand arguments of IN
are all SQL constant and there are no nulls
@@ -1163,7 +1170,7 @@ public:
*/
bool arg_types_compatible;
Item_result left_result_type;
- cmp_item *cmp_items[5]; /* One cmp_item for each result type */
+ cmp_item *cmp_items[6]; /* One cmp_item for each result type */
DTCollation cmp_collation;
Item_func_in(List<Item> &list)
@@ -1184,7 +1191,7 @@ public:
Item_int_func::cleanup();
delete array;
array= 0;
- for (i= 0; i <= (uint)DECIMAL_RESULT; i++)
+ for (i= 0; i <= (uint)DECIMAL_RESULT + 1; i++)
{
delete cmp_items[i];
cmp_items[i]= 0;
@@ -1199,7 +1206,35 @@ public:
bool nulls_in_row();
bool is_bool_func() { return 1; }
CHARSET_INFO *compare_collation() { return cmp_collation.collation; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
+};
+
+class cmp_item_row :public cmp_item
+{
+ cmp_item **comparators;
+ uint n;
+public:
+ cmp_item_row(): comparators(0), n(0) {}
+ ~cmp_item_row();
+ void store_value(Item *item);
+ inline void alloc_comparators();
+ int cmp(Item *arg);
+ int compare(cmp_item *arg);
+ cmp_item *make_same();
+ void store_value_by_template(cmp_item *tmpl, Item *);
+ friend void Item_func_in::fix_length_and_dec();
+};
+
+
+class in_row :public in_vector
+{
+ cmp_item_row tmp;
+public:
+ in_row(uint elements, Item *);
+ ~in_row();
+ void set(uint pos,Item *item);
+ uchar *get_value(Item *item);
+ friend void Item_func_in::fix_length_and_dec();
+ Item_result result_type() { return ROW_RESULT; }
};
/* Functions used by where clause */
@@ -1242,7 +1277,6 @@ public:
optimize_type select_optimize() const { return OPTIMIZE_NULL; }
Item *neg_transformer(THD *thd);
CHARSET_INFO *compare_collation() { return args[0]->collation.collation; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
/* Functions used by HAVING for rewriting IN subquery */
@@ -1269,7 +1303,6 @@ public:
*/
table_map used_tables() const
{ return used_tables_cache | RAND_TABLE_BIT; }
- bool check_partition_func_processor(byte *int_arg) {return TRUE;}
};
@@ -1292,7 +1325,6 @@ public:
void print(String *str);
CHARSET_INFO *compare_collation() { return args[0]->collation.collation; }
void top_level_item() { abort_on_null=1; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -1331,7 +1363,6 @@ public:
const char *func_name() const { return "like"; }
bool fix_fields(THD *thd, Item **ref);
void cleanup();
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
#ifdef USE_REGEX
@@ -1354,7 +1385,6 @@ public:
const char *func_name() const { return "regexp"; }
void print(String *str) { print_op(str); }
CHARSET_INFO *compare_collation() { return cmp_collation.collation; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
#else
@@ -1394,6 +1424,7 @@ public:
Item_cond(List<Item> &nlist)
:Item_bool_func(), list(nlist), abort_on_null(0) {}
bool add(Item *item) { return list.push_back(item); }
+ bool add_at_head(Item *item) { return list.push_front(item); }
void add_at_head(List<Item> *nlist) { list.prepand(nlist); }
bool fix_fields(THD *, Item **ref);
@@ -1407,14 +1438,13 @@ public:
COND **conds);
void top_level_item() { abort_on_null=1; }
void copy_andor_arguments(THD *thd, Item_cond *item);
- bool walk(Item_processor processor, bool walk_subquery, byte *arg);
- Item *transform(Item_transformer transformer, byte *arg);
+ bool walk(Item_processor processor, bool walk_subquery, uchar *arg);
+ Item *transform(Item_transformer transformer, uchar *arg);
void traverse_cond(Cond_traverser, void *arg, traverse_order order);
void neg_arguments(THD *thd);
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
- bool subst_argument_checker(byte **arg) { return TRUE; }
- Item *compile(Item_analyzer analyzer, byte **arg_p,
- Item_transformer transformer, byte *arg_t);
+ bool subst_argument_checker(uchar **arg) { return TRUE; }
+ Item *compile(Item_analyzer analyzer, uchar **arg_p,
+ Item_transformer transformer, uchar *arg_t);
};
@@ -1523,8 +1553,8 @@ public:
void fix_length_and_dec();
bool fix_fields(THD *thd, Item **ref);
void update_used_tables();
- bool walk(Item_processor processor, bool walk_subquery, byte *arg);
- Item *transform(Item_transformer transformer, byte *arg);
+ bool walk(Item_processor processor, bool walk_subquery, uchar *arg);
+ Item *transform(Item_transformer transformer, uchar *arg);
void print(String *str);
CHARSET_INFO *compare_collation()
{ return fields.head()->collation.collation; }
@@ -1540,7 +1570,6 @@ public:
the current and level */
COND_EQUAL()
{
- max_members= 0;
upper_levels= 0;
}
};
@@ -1588,6 +1617,15 @@ public:
Item *neg_transformer(THD *thd);
};
+inline bool is_cond_and(Item *item)
+{
+ if (item->type() != Item::COND_ITEM)
+ return FALSE;
+
+ Item_cond *cond_item= (Item_cond*) item;
+ return (cond_item->functype() == Item_func::COND_AND_FUNC);
+}
+
class Item_cond_or :public Item_cond
{
public:
@@ -1609,6 +1647,14 @@ public:
Item *neg_transformer(THD *thd);
};
+inline bool is_cond_or(Item *item)
+{
+ if (item->type() != Item::COND_ITEM)
+ return FALSE;
+
+ Item_cond *cond_item= (Item_cond*) item;
+ return (cond_item->functype() == Item_func::COND_OR_FUNC);
+}
/*
XOR is Item_cond, not an Item_int_func because we could like to
diff --git a/sql/item_create.cc b/sql/item_create.cc
index 8ff78ef1b48..12b795e79a1 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -37,7 +37,7 @@
class Create_native_func : public Create_func
{
public:
- virtual Item* create(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create(THD *thd, LEX_STRING name, List<Item> *item_list);
/**
Builder method, with no arguments.
@@ -46,7 +46,7 @@ public:
@param item_list The function parameters, none of which are named
@return An item representing the function call
*/
- virtual Item* create_native(THD *thd, LEX_STRING name,
+ virtual Item *create_native(THD *thd, LEX_STRING name,
List<Item> *item_list) = 0;
protected:
@@ -64,14 +64,14 @@ protected:
class Create_func_arg0 : public Create_func
{
public:
- virtual Item* create(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create(THD *thd, LEX_STRING name, List<Item> *item_list);
/**
Builder method, with no arguments.
@param thd The current thread
@return An item representing the function call
*/
- virtual Item* create(THD *thd) = 0;
+ virtual Item *create(THD *thd) = 0;
protected:
/** Constructor. */
@@ -88,7 +88,7 @@ protected:
class Create_func_arg1 : public Create_func
{
public:
- virtual Item* create(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create(THD *thd, LEX_STRING name, List<Item> *item_list);
/**
Builder method, with one argument.
@@ -96,7 +96,7 @@ public:
@param arg1 The first argument of the function
@return An item representing the function call
*/
- virtual Item* create(THD *thd, Item *arg1) = 0;
+ virtual Item *create(THD *thd, Item *arg1) = 0;
protected:
/** Constructor. */
@@ -113,7 +113,7 @@ protected:
class Create_func_arg2 : public Create_func
{
public:
- virtual Item* create(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create(THD *thd, LEX_STRING name, List<Item> *item_list);
/**
Builder method, with two arguments.
@@ -122,7 +122,7 @@ public:
@param arg2 The second argument of the function
@return An item representing the function call
*/
- virtual Item* create(THD *thd, Item *arg1, Item *arg2) = 0;
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2) = 0;
protected:
/** Constructor. */
@@ -139,7 +139,7 @@ protected:
class Create_func_arg3 : public Create_func
{
public:
- virtual Item* create(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create(THD *thd, LEX_STRING name, List<Item> *item_list);
/**
Builder method, with three arguments.
@@ -149,7 +149,7 @@ public:
@param arg3 The third argument of the function
@return An item representing the function call
*/
- virtual Item* create(THD *thd, Item *arg1, Item *arg2, Item *arg3) = 0;
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2, Item *arg3) = 0;
protected:
/** Constructor. */
@@ -166,7 +166,7 @@ protected:
class Create_sp_func : public Create_qfunc
{
public:
- virtual Item* create(THD *thd, LEX_STRING db, LEX_STRING name,
+ virtual Item *create(THD *thd, LEX_STRING db, LEX_STRING name,
bool use_explicit_name, List<Item> *item_list);
static Create_sp_func s_singleton;
@@ -189,7 +189,7 @@ protected:
class Create_func_no_geom : public Create_func
{
public:
- virtual Item* create(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create(THD *thd, LEX_STRING name, List<Item> *item_list);
/** Singleton. */
static Create_func_no_geom s_singleton;
@@ -212,7 +212,7 @@ protected:
class Create_func_abs : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_abs s_singleton;
@@ -225,7 +225,7 @@ protected:
class Create_func_acos : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_acos s_singleton;
@@ -238,7 +238,7 @@ protected:
class Create_func_addtime : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_addtime s_singleton;
@@ -251,7 +251,7 @@ protected:
class Create_func_aes_encrypt : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_aes_encrypt s_singleton;
@@ -264,7 +264,7 @@ protected:
class Create_func_aes_decrypt : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_aes_decrypt s_singleton;
@@ -278,7 +278,7 @@ protected:
class Create_func_area : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_area s_singleton;
@@ -293,7 +293,7 @@ protected:
class Create_func_as_wkb : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_as_wkb s_singleton;
@@ -308,7 +308,7 @@ protected:
class Create_func_as_wkt : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_as_wkt s_singleton;
@@ -322,7 +322,7 @@ protected:
class Create_func_asin : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_asin s_singleton;
@@ -335,7 +335,7 @@ protected:
class Create_func_atan : public Create_native_func
{
public:
- virtual Item* create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
static Create_func_atan s_singleton;
@@ -348,7 +348,7 @@ protected:
class Create_func_benchmark : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_benchmark s_singleton;
@@ -361,7 +361,7 @@ protected:
class Create_func_bin : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_bin s_singleton;
@@ -374,7 +374,7 @@ protected:
class Create_func_bit_count : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_bit_count s_singleton;
@@ -387,7 +387,7 @@ protected:
class Create_func_bit_length : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_bit_length s_singleton;
@@ -400,7 +400,7 @@ protected:
class Create_func_ceiling : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_ceiling s_singleton;
@@ -414,7 +414,7 @@ protected:
class Create_func_centroid : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_centroid s_singleton;
@@ -428,7 +428,7 @@ protected:
class Create_func_char_length : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_char_length s_singleton;
@@ -441,7 +441,7 @@ protected:
class Create_func_coercibility : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_coercibility s_singleton;
@@ -454,7 +454,7 @@ protected:
class Create_func_compress : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_compress s_singleton;
@@ -467,7 +467,7 @@ protected:
class Create_func_concat : public Create_native_func
{
public:
- virtual Item* create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
static Create_func_concat s_singleton;
@@ -480,7 +480,7 @@ protected:
class Create_func_concat_ws : public Create_native_func
{
public:
- virtual Item* create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
static Create_func_concat_ws s_singleton;
@@ -493,7 +493,7 @@ protected:
class Create_func_connection_id : public Create_func_arg0
{
public:
- virtual Item* create(THD *thd);
+ virtual Item *create(THD *thd);
static Create_func_connection_id s_singleton;
@@ -507,7 +507,7 @@ protected:
class Create_func_contains : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_contains s_singleton;
@@ -521,7 +521,7 @@ protected:
class Create_func_conv : public Create_func_arg3
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2, Item *arg3);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2, Item *arg3);
static Create_func_conv s_singleton;
@@ -534,7 +534,7 @@ protected:
class Create_func_convert_tz : public Create_func_arg3
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2, Item *arg3);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2, Item *arg3);
static Create_func_convert_tz s_singleton;
@@ -547,7 +547,7 @@ protected:
class Create_func_cos : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_cos s_singleton;
@@ -560,7 +560,7 @@ protected:
class Create_func_cot : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_cot s_singleton;
@@ -573,7 +573,7 @@ protected:
class Create_func_crc32 : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_crc32 s_singleton;
@@ -587,7 +587,7 @@ protected:
class Create_func_crosses : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_crosses s_singleton;
@@ -601,7 +601,7 @@ protected:
class Create_func_date_format : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_date_format s_singleton;
@@ -614,7 +614,7 @@ protected:
class Create_func_datediff : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_datediff s_singleton;
@@ -627,7 +627,7 @@ protected:
class Create_func_dayname : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_dayname s_singleton;
@@ -640,7 +640,7 @@ protected:
class Create_func_dayofmonth : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_dayofmonth s_singleton;
@@ -653,7 +653,7 @@ protected:
class Create_func_dayofweek : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_dayofweek s_singleton;
@@ -666,7 +666,7 @@ protected:
class Create_func_dayofyear : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_dayofyear s_singleton;
@@ -679,7 +679,7 @@ protected:
class Create_func_decode : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_decode s_singleton;
@@ -692,7 +692,7 @@ protected:
class Create_func_degrees : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_degrees s_singleton;
@@ -705,7 +705,7 @@ protected:
class Create_func_des_decrypt : public Create_native_func
{
public:
- virtual Item* create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
static Create_func_des_decrypt s_singleton;
@@ -718,7 +718,7 @@ protected:
class Create_func_des_encrypt : public Create_native_func
{
public:
- virtual Item* create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
static Create_func_des_encrypt s_singleton;
@@ -732,7 +732,7 @@ protected:
class Create_func_dimension : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_dimension s_singleton;
@@ -747,7 +747,7 @@ protected:
class Create_func_disjoint : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_disjoint s_singleton;
@@ -761,7 +761,7 @@ protected:
class Create_func_elt : public Create_native_func
{
public:
- virtual Item* create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
static Create_func_elt s_singleton;
@@ -774,7 +774,7 @@ protected:
class Create_func_encode : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_encode s_singleton;
@@ -787,7 +787,7 @@ protected:
class Create_func_encrypt : public Create_native_func
{
public:
- virtual Item* create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
static Create_func_encrypt s_singleton;
@@ -801,7 +801,7 @@ protected:
class Create_func_endpoint : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_endpoint s_singleton;
@@ -816,7 +816,7 @@ protected:
class Create_func_envelope : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_envelope s_singleton;
@@ -831,7 +831,7 @@ protected:
class Create_func_equals : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_equals s_singleton;
@@ -845,7 +845,7 @@ protected:
class Create_func_exp : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_exp s_singleton;
@@ -858,7 +858,7 @@ protected:
class Create_func_export_set : public Create_native_func
{
public:
- virtual Item* create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
static Create_func_export_set s_singleton;
@@ -872,7 +872,7 @@ protected:
class Create_func_exteriorring : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_exteriorring s_singleton;
@@ -886,7 +886,7 @@ protected:
class Create_func_field : public Create_native_func
{
public:
- virtual Item* create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
static Create_func_field s_singleton;
@@ -899,7 +899,7 @@ protected:
class Create_func_find_in_set : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_find_in_set s_singleton;
@@ -912,7 +912,7 @@ protected:
class Create_func_floor : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_floor s_singleton;
@@ -925,7 +925,7 @@ protected:
class Create_func_format : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_format s_singleton;
@@ -938,7 +938,7 @@ protected:
class Create_func_found_rows : public Create_func_arg0
{
public:
- virtual Item* create(THD *thd);
+ virtual Item *create(THD *thd);
static Create_func_found_rows s_singleton;
@@ -951,7 +951,7 @@ protected:
class Create_func_from_days : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_from_days s_singleton;
@@ -964,7 +964,7 @@ protected:
class Create_func_from_unixtime : public Create_native_func
{
public:
- virtual Item* create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
static Create_func_from_unixtime s_singleton;
@@ -978,7 +978,7 @@ protected:
class Create_func_geometry_from_text : public Create_native_func
{
public:
- virtual Item* create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
static Create_func_geometry_from_text s_singleton;
@@ -993,7 +993,7 @@ protected:
class Create_func_geometry_from_wkb : public Create_native_func
{
public:
- virtual Item* create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
static Create_func_geometry_from_wkb s_singleton;
@@ -1008,7 +1008,7 @@ protected:
class Create_func_geometry_type : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_geometry_type s_singleton;
@@ -1023,7 +1023,7 @@ protected:
class Create_func_geometryn : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_geometryn s_singleton;
@@ -1037,7 +1037,7 @@ protected:
class Create_func_get_lock : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_get_lock s_singleton;
@@ -1051,7 +1051,7 @@ protected:
class Create_func_glength : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_glength s_singleton;
@@ -1065,7 +1065,7 @@ protected:
class Create_func_greatest : public Create_native_func
{
public:
- virtual Item* create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
static Create_func_greatest s_singleton;
@@ -1078,7 +1078,7 @@ protected:
class Create_func_hex : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_hex s_singleton;
@@ -1091,7 +1091,7 @@ protected:
class Create_func_ifnull : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_ifnull s_singleton;
@@ -1104,7 +1104,7 @@ protected:
class Create_func_inet_ntoa : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_inet_ntoa s_singleton;
@@ -1117,7 +1117,7 @@ protected:
class Create_func_inet_aton : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_inet_aton s_singleton;
@@ -1130,7 +1130,7 @@ protected:
class Create_func_instr : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_instr s_singleton;
@@ -1144,7 +1144,7 @@ protected:
class Create_func_interiorringn : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_interiorringn s_singleton;
@@ -1159,7 +1159,7 @@ protected:
class Create_func_intersects : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_intersects s_singleton;
@@ -1173,7 +1173,7 @@ protected:
class Create_func_is_free_lock : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_is_free_lock s_singleton;
@@ -1186,7 +1186,7 @@ protected:
class Create_func_is_used_lock : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_is_used_lock s_singleton;
@@ -1200,7 +1200,7 @@ protected:
class Create_func_isclosed : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_isclosed s_singleton;
@@ -1215,7 +1215,7 @@ protected:
class Create_func_isempty : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_isempty s_singleton;
@@ -1229,7 +1229,7 @@ protected:
class Create_func_isnull : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_isnull s_singleton;
@@ -1243,7 +1243,7 @@ protected:
class Create_func_issimple : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_issimple s_singleton;
@@ -1257,7 +1257,7 @@ protected:
class Create_func_last_day : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_last_day s_singleton;
@@ -1270,7 +1270,7 @@ protected:
class Create_func_last_insert_id : public Create_native_func
{
public:
- virtual Item* create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
static Create_func_last_insert_id s_singleton;
@@ -1283,7 +1283,7 @@ protected:
class Create_func_lcase : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_lcase s_singleton;
@@ -1296,7 +1296,7 @@ protected:
class Create_func_least : public Create_native_func
{
public:
- virtual Item* create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
static Create_func_least s_singleton;
@@ -1309,7 +1309,7 @@ protected:
class Create_func_length : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_length s_singleton;
@@ -1322,7 +1322,7 @@ protected:
class Create_func_ln : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_ln s_singleton;
@@ -1335,7 +1335,7 @@ protected:
class Create_func_load_file : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_load_file s_singleton;
@@ -1348,7 +1348,7 @@ protected:
class Create_func_locate : public Create_native_func
{
public:
- virtual Item* create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
static Create_func_locate s_singleton;
@@ -1361,7 +1361,7 @@ protected:
class Create_func_log : public Create_native_func
{
public:
- virtual Item* create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
static Create_func_log s_singleton;
@@ -1374,7 +1374,7 @@ protected:
class Create_func_log10 : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_log10 s_singleton;
@@ -1387,7 +1387,7 @@ protected:
class Create_func_log2 : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_log2 s_singleton;
@@ -1400,7 +1400,7 @@ protected:
class Create_func_lpad : public Create_func_arg3
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2, Item *arg3);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2, Item *arg3);
static Create_func_lpad s_singleton;
@@ -1413,7 +1413,7 @@ protected:
class Create_func_ltrim : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_ltrim s_singleton;
@@ -1426,7 +1426,7 @@ protected:
class Create_func_makedate : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_makedate s_singleton;
@@ -1439,7 +1439,7 @@ protected:
class Create_func_maketime : public Create_func_arg3
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2, Item *arg3);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2, Item *arg3);
static Create_func_maketime s_singleton;
@@ -1452,7 +1452,7 @@ protected:
class Create_func_make_set : public Create_native_func
{
public:
- virtual Item* create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
static Create_func_make_set s_singleton;
@@ -1465,7 +1465,7 @@ protected:
class Create_func_master_pos_wait : public Create_native_func
{
public:
- virtual Item* create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
static Create_func_master_pos_wait s_singleton;
@@ -1478,7 +1478,7 @@ protected:
class Create_func_md5 : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_md5 s_singleton;
@@ -1491,7 +1491,7 @@ protected:
class Create_func_monthname : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_monthname s_singleton;
@@ -1504,7 +1504,7 @@ protected:
class Create_func_name_const : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_name_const s_singleton;
@@ -1517,7 +1517,7 @@ protected:
class Create_func_nullif : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_nullif s_singleton;
@@ -1531,7 +1531,7 @@ protected:
class Create_func_numgeometries : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_numgeometries s_singleton;
@@ -1546,7 +1546,7 @@ protected:
class Create_func_numinteriorring : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_numinteriorring s_singleton;
@@ -1561,7 +1561,7 @@ protected:
class Create_func_numpoints : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_numpoints s_singleton;
@@ -1575,7 +1575,7 @@ protected:
class Create_func_oct : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_oct s_singleton;
@@ -1588,7 +1588,7 @@ protected:
class Create_func_ord : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_ord s_singleton;
@@ -1602,7 +1602,7 @@ protected:
class Create_func_overlaps : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_overlaps s_singleton;
@@ -1616,7 +1616,7 @@ protected:
class Create_func_period_add : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_period_add s_singleton;
@@ -1629,7 +1629,7 @@ protected:
class Create_func_period_diff : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_period_diff s_singleton;
@@ -1642,7 +1642,7 @@ protected:
class Create_func_pi : public Create_func_arg0
{
public:
- virtual Item* create(THD *thd);
+ virtual Item *create(THD *thd);
static Create_func_pi s_singleton;
@@ -1656,7 +1656,7 @@ protected:
class Create_func_pointn : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_pointn s_singleton;
@@ -1670,7 +1670,7 @@ protected:
class Create_func_pow : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_pow s_singleton;
@@ -1683,7 +1683,7 @@ protected:
class Create_func_quote : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_quote s_singleton;
@@ -1696,7 +1696,7 @@ protected:
class Create_func_radians : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_radians s_singleton;
@@ -1709,7 +1709,7 @@ protected:
class Create_func_rand : public Create_native_func
{
public:
- virtual Item* create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
static Create_func_rand s_singleton;
@@ -1722,7 +1722,7 @@ protected:
class Create_func_release_lock : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_release_lock s_singleton;
@@ -1735,7 +1735,7 @@ protected:
class Create_func_reverse : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_reverse s_singleton;
@@ -1748,7 +1748,7 @@ protected:
class Create_func_round : public Create_native_func
{
public:
- virtual Item* create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
static Create_func_round s_singleton;
@@ -1761,7 +1761,7 @@ protected:
class Create_func_row_count : public Create_func_arg0
{
public:
- virtual Item* create(THD *thd);
+ virtual Item *create(THD *thd);
static Create_func_row_count s_singleton;
@@ -1774,7 +1774,7 @@ protected:
class Create_func_rpad : public Create_func_arg3
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2, Item *arg3);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2, Item *arg3);
static Create_func_rpad s_singleton;
@@ -1787,7 +1787,7 @@ protected:
class Create_func_rtrim : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_rtrim s_singleton;
@@ -1800,7 +1800,7 @@ protected:
class Create_func_sec_to_time : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_sec_to_time s_singleton;
@@ -1813,7 +1813,7 @@ protected:
class Create_func_sha : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_sha s_singleton;
@@ -1826,7 +1826,7 @@ protected:
class Create_func_sign : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_sign s_singleton;
@@ -1839,7 +1839,7 @@ protected:
class Create_func_sin : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_sin s_singleton;
@@ -1852,7 +1852,7 @@ protected:
class Create_func_sleep : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_sleep s_singleton;
@@ -1865,7 +1865,7 @@ protected:
class Create_func_soundex : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_soundex s_singleton;
@@ -1878,7 +1878,7 @@ protected:
class Create_func_space : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_space s_singleton;
@@ -1891,7 +1891,7 @@ protected:
class Create_func_sqrt : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_sqrt s_singleton;
@@ -1905,7 +1905,7 @@ protected:
class Create_func_srid : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_srid s_singleton;
@@ -1920,7 +1920,7 @@ protected:
class Create_func_startpoint : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_startpoint s_singleton;
@@ -1934,7 +1934,7 @@ protected:
class Create_func_str_to_date : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_str_to_date s_singleton;
@@ -1947,7 +1947,7 @@ protected:
class Create_func_strcmp : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_strcmp s_singleton;
@@ -1960,7 +1960,7 @@ protected:
class Create_func_substr_index : public Create_func_arg3
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2, Item *arg3);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2, Item *arg3);
static Create_func_substr_index s_singleton;
@@ -1973,7 +1973,7 @@ protected:
class Create_func_subtime : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_subtime s_singleton;
@@ -1986,7 +1986,7 @@ protected:
class Create_func_tan : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_tan s_singleton;
@@ -1999,7 +1999,7 @@ protected:
class Create_func_time_format : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_time_format s_singleton;
@@ -2012,7 +2012,7 @@ protected:
class Create_func_time_to_sec : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_time_to_sec s_singleton;
@@ -2025,7 +2025,7 @@ protected:
class Create_func_timediff : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_timediff s_singleton;
@@ -2038,7 +2038,7 @@ protected:
class Create_func_to_days : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_to_days s_singleton;
@@ -2052,7 +2052,7 @@ protected:
class Create_func_touches : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_touches s_singleton;
@@ -2066,7 +2066,7 @@ protected:
class Create_func_ucase : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_ucase s_singleton;
@@ -2079,7 +2079,7 @@ protected:
class Create_func_uncompress : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_uncompress s_singleton;
@@ -2092,7 +2092,7 @@ protected:
class Create_func_uncompressed_length : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_uncompressed_length s_singleton;
@@ -2105,7 +2105,7 @@ protected:
class Create_func_unhex : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_unhex s_singleton;
@@ -2118,7 +2118,7 @@ protected:
class Create_func_unix_timestamp : public Create_native_func
{
public:
- virtual Item* create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
static Create_func_unix_timestamp s_singleton;
@@ -2131,7 +2131,7 @@ protected:
class Create_func_uuid : public Create_func_arg0
{
public:
- virtual Item* create(THD *thd);
+ virtual Item *create(THD *thd);
static Create_func_uuid s_singleton;
@@ -2141,10 +2141,23 @@ protected:
};
+class Create_func_uuid_short : public Create_func_arg0
+{
+public:
+ virtual Item *create(THD *thd);
+
+ static Create_func_uuid_short s_singleton;
+
+protected:
+ Create_func_uuid_short() {}
+ virtual ~Create_func_uuid_short() {}
+};
+
+
class Create_func_version : public Create_func_arg0
{
public:
- virtual Item* create(THD *thd);
+ virtual Item *create(THD *thd);
static Create_func_version s_singleton;
@@ -2157,7 +2170,7 @@ protected:
class Create_func_weekday : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_weekday s_singleton;
@@ -2170,7 +2183,7 @@ protected:
class Create_func_weekofyear : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_weekofyear s_singleton;
@@ -2184,7 +2197,7 @@ protected:
class Create_func_within : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_within s_singleton;
@@ -2199,7 +2212,7 @@ protected:
class Create_func_x : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_x s_singleton;
@@ -2213,7 +2226,7 @@ protected:
class Create_func_xml_extractvalue : public Create_func_arg2
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
static Create_func_xml_extractvalue s_singleton;
@@ -2226,7 +2239,7 @@ protected:
class Create_func_xml_update : public Create_func_arg3
{
public:
- virtual Item* create(THD *thd, Item *arg1, Item *arg2, Item *arg3);
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2, Item *arg3);
static Create_func_xml_update s_singleton;
@@ -2240,7 +2253,7 @@ protected:
class Create_func_y : public Create_func_arg1
{
public:
- virtual Item* create(THD *thd, Item *arg1);
+ virtual Item *create(THD *thd, Item *arg1);
static Create_func_y s_singleton;
@@ -2254,7 +2267,7 @@ protected:
class Create_func_year_week : public Create_native_func
{
public:
- virtual Item* create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
static Create_func_year_week s_singleton;
@@ -2313,7 +2326,7 @@ Item*
Create_qfunc::create(THD *thd, LEX_STRING name, List<Item> *item_list)
{
LEX_STRING db;
- if (thd->copy_db_to(&db.str, &db.length))
+ if (thd->lex->copy_db_to(&db.str, &db.length))
return NULL;
return create(thd, db, name, false, item_list);
@@ -2341,7 +2354,7 @@ Create_udf_func::create(THD *thd, udf_func *udf, List<Item> *item_list)
if (item_list != NULL)
arg_count= item_list->elements;
- thd->lex->binlog_row_based_if_mixed= TRUE;
+ thd->lex->set_stmt_unsafe();
DBUG_ASSERT( (udf->type == UDFTYPE_FUNCTION)
|| (udf->type == UDFTYPE_AGGREGATE));
@@ -2424,6 +2437,7 @@ Create_udf_func::create(THD *thd, udf_func *udf, List<Item> *item_list)
my_error(ER_NOT_SUPPORTED_YET, MYF(0), "UDF return type");
}
}
+ thd->lex->safe_to_cache_query= 0;
return func;
}
#endif
@@ -3325,6 +3339,7 @@ Create_func_found_rows Create_func_found_rows::s_singleton;
Item*
Create_func_found_rows::create(THD *thd)
{
+ thd->lex->set_stmt_unsafe();
thd->lex->safe_to_cache_query= 0;
return new (thd->mem_root) Item_func_found_rows();
}
@@ -3916,6 +3931,7 @@ Create_func_master_pos_wait Create_func_master_pos_wait::s_singleton;
Item*
Create_func_master_pos_wait::create_native(THD *thd, LEX_STRING name,
List<Item> *item_list)
+
{
Item *func= NULL;
int arg_count= 0;
@@ -4219,6 +4235,7 @@ Create_func_row_count Create_func_row_count::s_singleton;
Item*
Create_func_row_count::create(THD *thd)
{
+ thd->lex->set_stmt_unsafe();
thd->lex->safe_to_cache_query= 0;
return new (thd->mem_root) Item_func_row_count();
}
@@ -4527,11 +4544,23 @@ Create_func_uuid Create_func_uuid::s_singleton;
Item*
Create_func_uuid::create(THD *thd)
{
- thd->lex->binlog_row_based_if_mixed= TRUE;
+ thd->lex->set_stmt_unsafe();
+ thd->lex->safe_to_cache_query= 0;
return new (thd->mem_root) Item_func_uuid();
}
+Create_func_uuid_short Create_func_uuid_short::s_singleton;
+
+Item*
+Create_func_uuid_short::create(THD *thd)
+{
+ thd->lex->set_stmt_unsafe();
+ thd->lex->safe_to_cache_query= 0;
+ return new (thd->mem_root) Item_func_uuid_short();
+}
+
+
Create_func_version Create_func_version::s_singleton;
Item*
@@ -4681,215 +4710,217 @@ struct Native_func_registry
static Native_func_registry func_array[] =
{
- { C_STRING_WITH_LEN("ABS"), BUILDER(Create_func_abs)},
- { C_STRING_WITH_LEN("ACOS"), BUILDER(Create_func_acos)},
- { C_STRING_WITH_LEN("ADDTIME"), BUILDER(Create_func_addtime)},
- { C_STRING_WITH_LEN("AES_DECRYPT"), BUILDER(Create_func_aes_decrypt)},
- { C_STRING_WITH_LEN("AES_ENCRYPT"), BUILDER(Create_func_aes_encrypt)},
- { C_STRING_WITH_LEN("AREA"), GEOM_BUILDER(Create_func_area)},
- { C_STRING_WITH_LEN("ASBINARY"), GEOM_BUILDER(Create_func_as_wkb)},
- { C_STRING_WITH_LEN("ASIN"), BUILDER(Create_func_asin)},
- { C_STRING_WITH_LEN("ASTEXT"), GEOM_BUILDER(Create_func_as_wkt)},
- { C_STRING_WITH_LEN("ASWKB"), GEOM_BUILDER(Create_func_as_wkb)},
- { C_STRING_WITH_LEN("ASWKT"), GEOM_BUILDER(Create_func_as_wkt)},
- { C_STRING_WITH_LEN("ATAN"), BUILDER(Create_func_atan)},
- { C_STRING_WITH_LEN("ATAN2"), BUILDER(Create_func_atan)},
- { C_STRING_WITH_LEN("BENCHMARK"), BUILDER(Create_func_benchmark)},
- { C_STRING_WITH_LEN("BIN"), BUILDER(Create_func_bin)},
- { C_STRING_WITH_LEN("BIT_COUNT"), BUILDER(Create_func_bit_count)},
- { C_STRING_WITH_LEN("BIT_LENGTH"), BUILDER(Create_func_bit_length)},
- { C_STRING_WITH_LEN("CEIL"), BUILDER(Create_func_ceiling)},
- { C_STRING_WITH_LEN("CEILING"), BUILDER(Create_func_ceiling)},
- { C_STRING_WITH_LEN("CENTROID"), GEOM_BUILDER(Create_func_centroid)},
- { C_STRING_WITH_LEN("CHARACTER_LENGTH"), BUILDER(Create_func_char_length)},
- { C_STRING_WITH_LEN("CHAR_LENGTH"), BUILDER(Create_func_char_length)},
- { C_STRING_WITH_LEN("COERCIBILITY"), BUILDER(Create_func_coercibility)},
- { C_STRING_WITH_LEN("COMPRESS"), BUILDER(Create_func_compress)},
- { C_STRING_WITH_LEN("CONCAT"), BUILDER(Create_func_concat)},
- { C_STRING_WITH_LEN("CONCAT_WS"), BUILDER(Create_func_concat_ws)},
- { C_STRING_WITH_LEN("CONNECTION_ID"), BUILDER(Create_func_connection_id)},
- { C_STRING_WITH_LEN("CONV"), BUILDER(Create_func_conv)},
- { C_STRING_WITH_LEN("CONVERT_TZ"), BUILDER(Create_func_convert_tz)},
- { C_STRING_WITH_LEN("COS"), BUILDER(Create_func_cos)},
- { C_STRING_WITH_LEN("COT"), BUILDER(Create_func_cot)},
- { C_STRING_WITH_LEN("CRC32"), BUILDER(Create_func_crc32)},
- { C_STRING_WITH_LEN("CROSSES"), GEOM_BUILDER(Create_func_crosses)},
- { C_STRING_WITH_LEN("DATEDIFF"), BUILDER(Create_func_datediff)},
- { C_STRING_WITH_LEN("DATE_FORMAT"), BUILDER(Create_func_date_format)},
- { C_STRING_WITH_LEN("DAYNAME"), BUILDER(Create_func_dayname)},
- { C_STRING_WITH_LEN("DAYOFMONTH"), BUILDER(Create_func_dayofmonth)},
- { C_STRING_WITH_LEN("DAYOFWEEK"), BUILDER(Create_func_dayofweek)},
- { C_STRING_WITH_LEN("DAYOFYEAR"), BUILDER(Create_func_dayofyear)},
- { C_STRING_WITH_LEN("DECODE"), BUILDER(Create_func_decode)},
- { C_STRING_WITH_LEN("DEGREES"), BUILDER(Create_func_degrees)},
- { C_STRING_WITH_LEN("DES_DECRYPT"), BUILDER(Create_func_des_decrypt)},
- { C_STRING_WITH_LEN("DES_ENCRYPT"), BUILDER(Create_func_des_encrypt)},
- { C_STRING_WITH_LEN("DIMENSION"), GEOM_BUILDER(Create_func_dimension)},
- { C_STRING_WITH_LEN("DISJOINT"), GEOM_BUILDER(Create_func_disjoint)},
- { C_STRING_WITH_LEN("ELT"), BUILDER(Create_func_elt)},
- { C_STRING_WITH_LEN("ENCODE"), BUILDER(Create_func_encode)},
- { C_STRING_WITH_LEN("ENCRYPT"), BUILDER(Create_func_encrypt)},
- { C_STRING_WITH_LEN("ENDPOINT"), GEOM_BUILDER(Create_func_endpoint)},
- { C_STRING_WITH_LEN("ENVELOPE"), GEOM_BUILDER(Create_func_envelope)},
- { C_STRING_WITH_LEN("EQUALS"), GEOM_BUILDER(Create_func_equals)},
- { C_STRING_WITH_LEN("EXP"), BUILDER(Create_func_exp)},
- { C_STRING_WITH_LEN("EXPORT_SET"), BUILDER(Create_func_export_set)},
- { C_STRING_WITH_LEN("EXTERIORRING"), GEOM_BUILDER(Create_func_exteriorring)},
- { C_STRING_WITH_LEN("EXTRACTVALUE"), BUILDER(Create_func_xml_extractvalue)},
- { C_STRING_WITH_LEN("FIELD"), BUILDER(Create_func_field)},
- { C_STRING_WITH_LEN("FIND_IN_SET"), BUILDER(Create_func_find_in_set)},
- { C_STRING_WITH_LEN("FLOOR"), BUILDER(Create_func_floor)},
- { C_STRING_WITH_LEN("FORMAT"), BUILDER(Create_func_format)},
- { C_STRING_WITH_LEN("FOUND_ROWS"), BUILDER(Create_func_found_rows)},
- { C_STRING_WITH_LEN("FROM_DAYS"), BUILDER(Create_func_from_days)},
- { C_STRING_WITH_LEN("FROM_UNIXTIME"), BUILDER(Create_func_from_unixtime)},
- { C_STRING_WITH_LEN("GEOMCOLLFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)},
- { C_STRING_WITH_LEN("GEOMCOLLFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)},
- { C_STRING_WITH_LEN("GEOMETRYCOLLECTIONFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)},
- { C_STRING_WITH_LEN("GEOMETRYCOLLECTIONFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)},
- { C_STRING_WITH_LEN("GEOMETRYFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)},
- { C_STRING_WITH_LEN("GEOMETRYFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)},
- { C_STRING_WITH_LEN("GEOMETRYN"), GEOM_BUILDER(Create_func_geometryn)},
- { C_STRING_WITH_LEN("GEOMETRYTYPE"), GEOM_BUILDER(Create_func_geometry_type)},
- { C_STRING_WITH_LEN("GEOMFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)},
- { C_STRING_WITH_LEN("GEOMFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)},
- { C_STRING_WITH_LEN("GET_LOCK"), BUILDER(Create_func_get_lock)},
- { C_STRING_WITH_LEN("GLENGTH"), GEOM_BUILDER(Create_func_glength)},
- { C_STRING_WITH_LEN("GREATEST"), BUILDER(Create_func_greatest)},
- { C_STRING_WITH_LEN("HEX"), BUILDER(Create_func_hex)},
- { C_STRING_WITH_LEN("IFNULL"), BUILDER(Create_func_ifnull)},
- { C_STRING_WITH_LEN("INET_ATON"), BUILDER(Create_func_inet_aton)},
- { C_STRING_WITH_LEN("INET_NTOA"), BUILDER(Create_func_inet_ntoa)},
- { C_STRING_WITH_LEN("INSTR"), BUILDER(Create_func_instr)},
- { C_STRING_WITH_LEN("INTERIORRINGN"), GEOM_BUILDER(Create_func_interiorringn)},
- { C_STRING_WITH_LEN("INTERSECTS"), GEOM_BUILDER(Create_func_intersects)},
- { C_STRING_WITH_LEN("ISCLOSED"), GEOM_BUILDER(Create_func_isclosed)},
- { C_STRING_WITH_LEN("ISEMPTY"), GEOM_BUILDER(Create_func_isempty)},
- { C_STRING_WITH_LEN("ISNULL"), BUILDER(Create_func_isnull)},
- { C_STRING_WITH_LEN("ISSIMPLE"), GEOM_BUILDER(Create_func_issimple)},
- { C_STRING_WITH_LEN("IS_FREE_LOCK"), BUILDER(Create_func_is_free_lock)},
- { C_STRING_WITH_LEN("IS_USED_LOCK"), BUILDER(Create_func_is_used_lock)},
- { C_STRING_WITH_LEN("LAST_DAY"), BUILDER(Create_func_last_day)},
- { C_STRING_WITH_LEN("LAST_INSERT_ID"), BUILDER(Create_func_last_insert_id)},
- { C_STRING_WITH_LEN("LCASE"), BUILDER(Create_func_lcase)},
- { C_STRING_WITH_LEN("LEAST"), BUILDER(Create_func_least)},
- { C_STRING_WITH_LEN("LENGTH"), BUILDER(Create_func_length)},
- { C_STRING_WITH_LEN("LINEFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)},
- { C_STRING_WITH_LEN("LINEFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)},
- { C_STRING_WITH_LEN("LINESTRINGFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)},
- { C_STRING_WITH_LEN("LINESTRINGFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)},
- { C_STRING_WITH_LEN("LN"), BUILDER(Create_func_ln)},
- { C_STRING_WITH_LEN("LOAD_FILE"), BUILDER(Create_func_load_file)},
- { C_STRING_WITH_LEN("LOCATE"), BUILDER(Create_func_locate)},
- { C_STRING_WITH_LEN("LOG"), BUILDER(Create_func_log)},
- { C_STRING_WITH_LEN("LOG10"), BUILDER(Create_func_log10)},
- { C_STRING_WITH_LEN("LOG2"), BUILDER(Create_func_log2)},
- { C_STRING_WITH_LEN("LOWER"), BUILDER(Create_func_lcase)},
- { C_STRING_WITH_LEN("LPAD"), BUILDER(Create_func_lpad)},
- { C_STRING_WITH_LEN("LTRIM"), BUILDER(Create_func_ltrim)},
- { C_STRING_WITH_LEN("MAKEDATE"), BUILDER(Create_func_makedate)},
- { C_STRING_WITH_LEN("MAKETIME"), BUILDER(Create_func_maketime)},
- { C_STRING_WITH_LEN("MAKE_SET"), BUILDER(Create_func_make_set)},
- { C_STRING_WITH_LEN("MASTER_POS_WAIT"), BUILDER(Create_func_master_pos_wait)},
- { C_STRING_WITH_LEN("MBRCONTAINS"), GEOM_BUILDER(Create_func_contains)},
- { C_STRING_WITH_LEN("MBRDISJOINT"), GEOM_BUILDER(Create_func_disjoint)},
- { C_STRING_WITH_LEN("MBREQUAL"), GEOM_BUILDER(Create_func_equals)},
- { C_STRING_WITH_LEN("MBRINTERSECTS"), GEOM_BUILDER(Create_func_intersects)},
- { C_STRING_WITH_LEN("MBROVERLAPS"), GEOM_BUILDER(Create_func_overlaps)},
- { C_STRING_WITH_LEN("MBRTOUCHES"), GEOM_BUILDER(Create_func_touches)},
- { C_STRING_WITH_LEN("MBRWITHIN"), GEOM_BUILDER(Create_func_within)},
- { C_STRING_WITH_LEN("MD5"), BUILDER(Create_func_md5)},
- { C_STRING_WITH_LEN("MLINEFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)},
- { C_STRING_WITH_LEN("MLINEFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)},
- { C_STRING_WITH_LEN("MONTHNAME"), BUILDER(Create_func_monthname)},
- { C_STRING_WITH_LEN("MPOINTFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)},
- { C_STRING_WITH_LEN("MPOINTFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)},
- { C_STRING_WITH_LEN("MPOLYFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)},
- { C_STRING_WITH_LEN("MPOLYFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)},
- { C_STRING_WITH_LEN("MULTILINESTRINGFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)},
- { C_STRING_WITH_LEN("MULTILINESTRINGFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)},
- { C_STRING_WITH_LEN("MULTIPOINTFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)},
- { C_STRING_WITH_LEN("MULTIPOINTFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)},
- { C_STRING_WITH_LEN("MULTIPOLYGONFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)},
- { C_STRING_WITH_LEN("MULTIPOLYGONFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)},
- { C_STRING_WITH_LEN("NAME_CONST"), BUILDER(Create_func_name_const)},
- { C_STRING_WITH_LEN("NULLIF"), BUILDER(Create_func_nullif)},
- { C_STRING_WITH_LEN("NUMGEOMETRIES"), GEOM_BUILDER(Create_func_numgeometries)},
- { C_STRING_WITH_LEN("NUMINTERIORRINGS"), GEOM_BUILDER(Create_func_numinteriorring)},
- { C_STRING_WITH_LEN("NUMPOINTS"), GEOM_BUILDER(Create_func_numpoints)},
- { C_STRING_WITH_LEN("OCT"), BUILDER(Create_func_oct)},
- { C_STRING_WITH_LEN("OCTET_LENGTH"), BUILDER(Create_func_length)},
- { C_STRING_WITH_LEN("ORD"), BUILDER(Create_func_ord)},
- { C_STRING_WITH_LEN("OVERLAPS"), GEOM_BUILDER(Create_func_overlaps)},
- { C_STRING_WITH_LEN("PERIOD_ADD"), BUILDER(Create_func_period_add)},
- { C_STRING_WITH_LEN("PERIOD_DIFF"), BUILDER(Create_func_period_diff)},
- { C_STRING_WITH_LEN("PI"), BUILDER(Create_func_pi)},
- { C_STRING_WITH_LEN("POINTFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)},
- { C_STRING_WITH_LEN("POINTFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)},
- { C_STRING_WITH_LEN("POINTN"), GEOM_BUILDER(Create_func_pointn)},
- { C_STRING_WITH_LEN("POLYFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)},
- { C_STRING_WITH_LEN("POLYFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)},
- { C_STRING_WITH_LEN("POLYGONFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)},
- { C_STRING_WITH_LEN("POLYGONFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)},
- { C_STRING_WITH_LEN("POW"), BUILDER(Create_func_pow)},
- { C_STRING_WITH_LEN("POWER"), BUILDER(Create_func_pow)},
- { C_STRING_WITH_LEN("QUOTE"), BUILDER(Create_func_quote)},
- { C_STRING_WITH_LEN("RADIANS"), BUILDER(Create_func_radians)},
- { C_STRING_WITH_LEN("RAND"), BUILDER(Create_func_rand)},
- { C_STRING_WITH_LEN("RELEASE_LOCK"), BUILDER(Create_func_release_lock)},
- { C_STRING_WITH_LEN("REVERSE"), BUILDER(Create_func_reverse)},
- { C_STRING_WITH_LEN("ROUND"), BUILDER(Create_func_round)},
- { C_STRING_WITH_LEN("ROW_COUNT"), BUILDER(Create_func_row_count)},
- { C_STRING_WITH_LEN("RPAD"), BUILDER(Create_func_rpad)},
- { C_STRING_WITH_LEN("RTRIM"), BUILDER(Create_func_rtrim)},
- { C_STRING_WITH_LEN("SEC_TO_TIME"), BUILDER(Create_func_sec_to_time)},
- { C_STRING_WITH_LEN("SHA"), BUILDER(Create_func_sha)},
- { C_STRING_WITH_LEN("SHA1"), BUILDER(Create_func_sha)},
- { C_STRING_WITH_LEN("SIGN"), BUILDER(Create_func_sign)},
- { C_STRING_WITH_LEN("SIN"), BUILDER(Create_func_sin)},
- { C_STRING_WITH_LEN("SLEEP"), BUILDER(Create_func_sleep)},
- { C_STRING_WITH_LEN("SOUNDEX"), BUILDER(Create_func_soundex)},
- { C_STRING_WITH_LEN("SPACE"), BUILDER(Create_func_space)},
- { C_STRING_WITH_LEN("SQRT"), BUILDER(Create_func_sqrt)},
- { C_STRING_WITH_LEN("SRID"), GEOM_BUILDER(Create_func_srid)},
- { C_STRING_WITH_LEN("STARTPOINT"), GEOM_BUILDER(Create_func_startpoint)},
- { C_STRING_WITH_LEN("STRCMP"), BUILDER(Create_func_strcmp)},
- { C_STRING_WITH_LEN("STR_TO_DATE"), BUILDER(Create_func_str_to_date)},
- { C_STRING_WITH_LEN("SUBSTRING_INDEX"), BUILDER(Create_func_substr_index)},
- { C_STRING_WITH_LEN("SUBTIME"), BUILDER(Create_func_subtime)},
- { C_STRING_WITH_LEN("TAN"), BUILDER(Create_func_tan)},
- { C_STRING_WITH_LEN("TIMEDIFF"), BUILDER(Create_func_timediff)},
- { C_STRING_WITH_LEN("TIME_FORMAT"), BUILDER(Create_func_time_format)},
- { 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("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)},
- { C_STRING_WITH_LEN("UNHEX"), BUILDER(Create_func_unhex)},
- { C_STRING_WITH_LEN("UNIX_TIMESTAMP"), BUILDER(Create_func_unix_timestamp)},
- { C_STRING_WITH_LEN("UPDATEXML"), BUILDER(Create_func_xml_update)},
- { C_STRING_WITH_LEN("UPPER"), BUILDER(Create_func_ucase)},
- { C_STRING_WITH_LEN("UUID"), BUILDER(Create_func_uuid)},
- { C_STRING_WITH_LEN("VERSION"), BUILDER(Create_func_version)},
- { C_STRING_WITH_LEN("WEEKDAY"), BUILDER(Create_func_weekday)},
- { C_STRING_WITH_LEN("WEEKOFYEAR"), BUILDER(Create_func_weekofyear)},
- { C_STRING_WITH_LEN("WITHIN"), GEOM_BUILDER(Create_func_within)},
- { C_STRING_WITH_LEN("X"), GEOM_BUILDER(Create_func_x)},
- { C_STRING_WITH_LEN("Y"), GEOM_BUILDER(Create_func_y)},
- { C_STRING_WITH_LEN("YEARWEEK"), BUILDER(Create_func_year_week)},
+ { { C_STRING_WITH_LEN("ABS") }, BUILDER(Create_func_abs)},
+ { { C_STRING_WITH_LEN("ACOS") }, BUILDER(Create_func_acos)},
+ { { C_STRING_WITH_LEN("ADDTIME") }, BUILDER(Create_func_addtime)},
+ { { C_STRING_WITH_LEN("AES_DECRYPT") }, BUILDER(Create_func_aes_decrypt)},
+ { { C_STRING_WITH_LEN("AES_ENCRYPT") }, BUILDER(Create_func_aes_encrypt)},
+ { { C_STRING_WITH_LEN("AREA") }, GEOM_BUILDER(Create_func_area)},
+ { { C_STRING_WITH_LEN("ASBINARY") }, GEOM_BUILDER(Create_func_as_wkb)},
+ { { C_STRING_WITH_LEN("ASIN") }, BUILDER(Create_func_asin)},
+ { { C_STRING_WITH_LEN("ASTEXT") }, GEOM_BUILDER(Create_func_as_wkt)},
+ { { C_STRING_WITH_LEN("ASWKB") }, GEOM_BUILDER(Create_func_as_wkb)},
+ { { C_STRING_WITH_LEN("ASWKT") }, GEOM_BUILDER(Create_func_as_wkt)},
+ { { C_STRING_WITH_LEN("ATAN") }, BUILDER(Create_func_atan)},
+ { { C_STRING_WITH_LEN("ATAN2") }, BUILDER(Create_func_atan)},
+ { { C_STRING_WITH_LEN("BENCHMARK") }, BUILDER(Create_func_benchmark)},
+ { { C_STRING_WITH_LEN("BIN") }, BUILDER(Create_func_bin)},
+ { { C_STRING_WITH_LEN("BIT_COUNT") }, BUILDER(Create_func_bit_count)},
+ { { C_STRING_WITH_LEN("BIT_LENGTH") }, BUILDER(Create_func_bit_length)},
+ { { C_STRING_WITH_LEN("CEIL") }, BUILDER(Create_func_ceiling)},
+ { { C_STRING_WITH_LEN("CEILING") }, BUILDER(Create_func_ceiling)},
+ { { C_STRING_WITH_LEN("CENTROID") }, GEOM_BUILDER(Create_func_centroid)},
+ { { C_STRING_WITH_LEN("CHARACTER_LENGTH") }, BUILDER(Create_func_char_length)},
+ { { C_STRING_WITH_LEN("CHAR_LENGTH") }, BUILDER(Create_func_char_length)},
+ { { C_STRING_WITH_LEN("COERCIBILITY") }, BUILDER(Create_func_coercibility)},
+ { { C_STRING_WITH_LEN("COMPRESS") }, BUILDER(Create_func_compress)},
+ { { C_STRING_WITH_LEN("CONCAT") }, BUILDER(Create_func_concat)},
+ { { C_STRING_WITH_LEN("CONCAT_WS") }, BUILDER(Create_func_concat_ws)},
+ { { C_STRING_WITH_LEN("CONNECTION_ID") }, BUILDER(Create_func_connection_id)},
+ { { C_STRING_WITH_LEN("CONV") }, BUILDER(Create_func_conv)},
+ { { C_STRING_WITH_LEN("CONVERT_TZ") }, BUILDER(Create_func_convert_tz)},
+ { { C_STRING_WITH_LEN("COS") }, BUILDER(Create_func_cos)},
+ { { C_STRING_WITH_LEN("COT") }, BUILDER(Create_func_cot)},
+ { { C_STRING_WITH_LEN("CRC32") }, BUILDER(Create_func_crc32)},
+ { { C_STRING_WITH_LEN("CROSSES") }, GEOM_BUILDER(Create_func_crosses)},
+ { { C_STRING_WITH_LEN("DATEDIFF") }, BUILDER(Create_func_datediff)},
+ { { C_STRING_WITH_LEN("DATE_FORMAT") }, BUILDER(Create_func_date_format)},
+ { { C_STRING_WITH_LEN("DAYNAME") }, BUILDER(Create_func_dayname)},
+ { { C_STRING_WITH_LEN("DAYOFMONTH") }, BUILDER(Create_func_dayofmonth)},
+ { { C_STRING_WITH_LEN("DAYOFWEEK") }, BUILDER(Create_func_dayofweek)},
+ { { C_STRING_WITH_LEN("DAYOFYEAR") }, BUILDER(Create_func_dayofyear)},
+ { { C_STRING_WITH_LEN("DECODE") }, BUILDER(Create_func_decode)},
+ { { C_STRING_WITH_LEN("DEGREES") }, BUILDER(Create_func_degrees)},
+ { { C_STRING_WITH_LEN("DES_DECRYPT") }, BUILDER(Create_func_des_decrypt)},
+ { { C_STRING_WITH_LEN("DES_ENCRYPT") }, BUILDER(Create_func_des_encrypt)},
+ { { C_STRING_WITH_LEN("DIMENSION") }, GEOM_BUILDER(Create_func_dimension)},
+ { { C_STRING_WITH_LEN("DISJOINT") }, GEOM_BUILDER(Create_func_disjoint)},
+ { { C_STRING_WITH_LEN("ELT") }, BUILDER(Create_func_elt)},
+ { { C_STRING_WITH_LEN("ENCODE") }, BUILDER(Create_func_encode)},
+ { { C_STRING_WITH_LEN("ENCRYPT") }, BUILDER(Create_func_encrypt)},
+ { { C_STRING_WITH_LEN("ENDPOINT") }, GEOM_BUILDER(Create_func_endpoint)},
+ { { C_STRING_WITH_LEN("ENVELOPE") }, GEOM_BUILDER(Create_func_envelope)},
+ { { C_STRING_WITH_LEN("EQUALS") }, GEOM_BUILDER(Create_func_equals)},
+ { { C_STRING_WITH_LEN("EXP") }, BUILDER(Create_func_exp)},
+ { { C_STRING_WITH_LEN("EXPORT_SET") }, BUILDER(Create_func_export_set)},
+ { { C_STRING_WITH_LEN("EXTERIORRING") }, GEOM_BUILDER(Create_func_exteriorring)},
+ { { C_STRING_WITH_LEN("EXTRACTVALUE") }, BUILDER(Create_func_xml_extractvalue)},
+ { { C_STRING_WITH_LEN("FIELD") }, BUILDER(Create_func_field)},
+ { { C_STRING_WITH_LEN("FIND_IN_SET") }, BUILDER(Create_func_find_in_set)},
+ { { C_STRING_WITH_LEN("FLOOR") }, BUILDER(Create_func_floor)},
+ { { C_STRING_WITH_LEN("FORMAT") }, BUILDER(Create_func_format)},
+ { { C_STRING_WITH_LEN("FOUND_ROWS") }, BUILDER(Create_func_found_rows)},
+ { { C_STRING_WITH_LEN("FROM_DAYS") }, BUILDER(Create_func_from_days)},
+ { { C_STRING_WITH_LEN("FROM_UNIXTIME") }, BUILDER(Create_func_from_unixtime)},
+ { { C_STRING_WITH_LEN("GEOMCOLLFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
+ { { C_STRING_WITH_LEN("GEOMCOLLFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
+ { { C_STRING_WITH_LEN("GEOMETRYCOLLECTIONFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
+ { { C_STRING_WITH_LEN("GEOMETRYCOLLECTIONFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
+ { { C_STRING_WITH_LEN("GEOMETRYFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
+ { { C_STRING_WITH_LEN("GEOMETRYFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
+ { { C_STRING_WITH_LEN("GEOMETRYN") }, GEOM_BUILDER(Create_func_geometryn)},
+ { { C_STRING_WITH_LEN("GEOMETRYTYPE") }, GEOM_BUILDER(Create_func_geometry_type)},
+ { { C_STRING_WITH_LEN("GEOMFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
+ { { C_STRING_WITH_LEN("GEOMFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
+ { { C_STRING_WITH_LEN("GET_LOCK") }, BUILDER(Create_func_get_lock)},
+ { { C_STRING_WITH_LEN("GLENGTH") }, GEOM_BUILDER(Create_func_glength)},
+ { { C_STRING_WITH_LEN("GREATEST") }, BUILDER(Create_func_greatest)},
+ { { C_STRING_WITH_LEN("HEX") }, BUILDER(Create_func_hex)},
+ { { C_STRING_WITH_LEN("IFNULL") }, BUILDER(Create_func_ifnull)},
+ { { C_STRING_WITH_LEN("INET_ATON") }, BUILDER(Create_func_inet_aton)},
+ { { C_STRING_WITH_LEN("INET_NTOA") }, BUILDER(Create_func_inet_ntoa)},
+ { { C_STRING_WITH_LEN("INSTR") }, BUILDER(Create_func_instr)},
+ { { C_STRING_WITH_LEN("INTERIORRINGN") }, GEOM_BUILDER(Create_func_interiorringn)},
+ { { C_STRING_WITH_LEN("INTERSECTS") }, GEOM_BUILDER(Create_func_intersects)},
+ { { C_STRING_WITH_LEN("ISCLOSED") }, GEOM_BUILDER(Create_func_isclosed)},
+ { { C_STRING_WITH_LEN("ISEMPTY") }, GEOM_BUILDER(Create_func_isempty)},
+ { { C_STRING_WITH_LEN("ISNULL") }, BUILDER(Create_func_isnull)},
+ { { C_STRING_WITH_LEN("ISSIMPLE") }, GEOM_BUILDER(Create_func_issimple)},
+ { { C_STRING_WITH_LEN("IS_FREE_LOCK") }, BUILDER(Create_func_is_free_lock)},
+ { { C_STRING_WITH_LEN("IS_USED_LOCK") }, BUILDER(Create_func_is_used_lock)},
+ { { C_STRING_WITH_LEN("LAST_DAY") }, BUILDER(Create_func_last_day)},
+ { { C_STRING_WITH_LEN("LAST_INSERT_ID") }, BUILDER(Create_func_last_insert_id)},
+ { { C_STRING_WITH_LEN("LCASE") }, BUILDER(Create_func_lcase)},
+ { { C_STRING_WITH_LEN("LEAST") }, BUILDER(Create_func_least)},
+ { { C_STRING_WITH_LEN("LENGTH") }, BUILDER(Create_func_length)},
+ { { C_STRING_WITH_LEN("LINEFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
+ { { C_STRING_WITH_LEN("LINEFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
+ { { C_STRING_WITH_LEN("LINESTRINGFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
+ { { C_STRING_WITH_LEN("LINESTRINGFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
+ { { C_STRING_WITH_LEN("LN") }, BUILDER(Create_func_ln)},
+ { { C_STRING_WITH_LEN("LOAD_FILE") }, BUILDER(Create_func_load_file)},
+ { { C_STRING_WITH_LEN("LOCATE") }, BUILDER(Create_func_locate)},
+ { { C_STRING_WITH_LEN("LOG") }, BUILDER(Create_func_log)},
+ { { C_STRING_WITH_LEN("LOG10") }, BUILDER(Create_func_log10)},
+ { { C_STRING_WITH_LEN("LOG2") }, BUILDER(Create_func_log2)},
+ { { C_STRING_WITH_LEN("LOWER") }, BUILDER(Create_func_lcase)},
+ { { C_STRING_WITH_LEN("LPAD") }, BUILDER(Create_func_lpad)},
+ { { C_STRING_WITH_LEN("LTRIM") }, BUILDER(Create_func_ltrim)},
+ { { C_STRING_WITH_LEN("MAKEDATE") }, BUILDER(Create_func_makedate)},
+ { { C_STRING_WITH_LEN("MAKETIME") }, BUILDER(Create_func_maketime)},
+ { { C_STRING_WITH_LEN("MAKE_SET") }, BUILDER(Create_func_make_set)},
+ { { C_STRING_WITH_LEN("MASTER_POS_WAIT") }, BUILDER(Create_func_master_pos_wait)},
+ { { C_STRING_WITH_LEN("MBRCONTAINS") }, GEOM_BUILDER(Create_func_contains)},
+ { { C_STRING_WITH_LEN("MBRDISJOINT") }, GEOM_BUILDER(Create_func_disjoint)},
+ { { C_STRING_WITH_LEN("MBREQUAL") }, GEOM_BUILDER(Create_func_equals)},
+ { { C_STRING_WITH_LEN("MBRINTERSECTS") }, GEOM_BUILDER(Create_func_intersects)},
+ { { C_STRING_WITH_LEN("MBROVERLAPS") }, GEOM_BUILDER(Create_func_overlaps)},
+ { { C_STRING_WITH_LEN("MBRTOUCHES") }, GEOM_BUILDER(Create_func_touches)},
+ { { C_STRING_WITH_LEN("MBRWITHIN") }, GEOM_BUILDER(Create_func_within)},
+ { { C_STRING_WITH_LEN("MD5") }, BUILDER(Create_func_md5)},
+ { { C_STRING_WITH_LEN("MLINEFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
+ { { C_STRING_WITH_LEN("MLINEFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
+ { { C_STRING_WITH_LEN("MONTHNAME") }, BUILDER(Create_func_monthname)},
+ { { C_STRING_WITH_LEN("MPOINTFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
+ { { C_STRING_WITH_LEN("MPOINTFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
+ { { C_STRING_WITH_LEN("MPOLYFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
+ { { C_STRING_WITH_LEN("MPOLYFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
+ { { C_STRING_WITH_LEN("MULTILINESTRINGFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
+ { { C_STRING_WITH_LEN("MULTILINESTRINGFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
+ { { C_STRING_WITH_LEN("MULTIPOINTFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
+ { { C_STRING_WITH_LEN("MULTIPOINTFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
+ { { C_STRING_WITH_LEN("MULTIPOLYGONFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
+ { { C_STRING_WITH_LEN("MULTIPOLYGONFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
+ { { C_STRING_WITH_LEN("NAME_CONST") }, BUILDER(Create_func_name_const)},
+ { { C_STRING_WITH_LEN("NULLIF") }, BUILDER(Create_func_nullif)},
+ { { C_STRING_WITH_LEN("NUMGEOMETRIES") }, GEOM_BUILDER(Create_func_numgeometries)},
+ { { C_STRING_WITH_LEN("NUMINTERIORRINGS") }, GEOM_BUILDER(Create_func_numinteriorring)},
+ { { C_STRING_WITH_LEN("NUMPOINTS") }, GEOM_BUILDER(Create_func_numpoints)},
+ { { C_STRING_WITH_LEN("OCT") }, BUILDER(Create_func_oct)},
+ { { C_STRING_WITH_LEN("OCTET_LENGTH") }, BUILDER(Create_func_length)},
+ { { C_STRING_WITH_LEN("ORD") }, BUILDER(Create_func_ord)},
+ { { C_STRING_WITH_LEN("OVERLAPS") }, GEOM_BUILDER(Create_func_overlaps)},
+ { { C_STRING_WITH_LEN("PERIOD_ADD") }, BUILDER(Create_func_period_add)},
+ { { C_STRING_WITH_LEN("PERIOD_DIFF") }, BUILDER(Create_func_period_diff)},
+ { { C_STRING_WITH_LEN("PI") }, BUILDER(Create_func_pi)},
+ { { C_STRING_WITH_LEN("POINTFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
+ { { C_STRING_WITH_LEN("POINTFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
+ { { C_STRING_WITH_LEN("POINTN") }, GEOM_BUILDER(Create_func_pointn)},
+ { { C_STRING_WITH_LEN("POLYFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
+ { { C_STRING_WITH_LEN("POLYFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
+ { { C_STRING_WITH_LEN("POLYGONFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
+ { { C_STRING_WITH_LEN("POLYGONFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
+ { { C_STRING_WITH_LEN("POW") }, BUILDER(Create_func_pow)},
+ { { C_STRING_WITH_LEN("POWER") }, BUILDER(Create_func_pow)},
+ { { C_STRING_WITH_LEN("QUOTE") }, BUILDER(Create_func_quote)},
+ { { C_STRING_WITH_LEN("RADIANS") }, BUILDER(Create_func_radians)},
+ { { C_STRING_WITH_LEN("RAND") }, BUILDER(Create_func_rand)},
+ { { C_STRING_WITH_LEN("RELEASE_LOCK") }, BUILDER(Create_func_release_lock)},
+ { { C_STRING_WITH_LEN("REVERSE") }, BUILDER(Create_func_reverse)},
+ { { C_STRING_WITH_LEN("ROUND") }, BUILDER(Create_func_round)},
+ { { C_STRING_WITH_LEN("ROW_COUNT") }, BUILDER(Create_func_row_count)},
+ { { C_STRING_WITH_LEN("RPAD") }, BUILDER(Create_func_rpad)},
+ { { C_STRING_WITH_LEN("RTRIM") }, BUILDER(Create_func_rtrim)},
+ { { C_STRING_WITH_LEN("SEC_TO_TIME") }, BUILDER(Create_func_sec_to_time)},
+ { { C_STRING_WITH_LEN("SHA") }, BUILDER(Create_func_sha)},
+ { { C_STRING_WITH_LEN("SHA1") }, BUILDER(Create_func_sha)},
+ { { C_STRING_WITH_LEN("SIGN") }, BUILDER(Create_func_sign)},
+ { { C_STRING_WITH_LEN("SIN") }, BUILDER(Create_func_sin)},
+ { { C_STRING_WITH_LEN("SLEEP") }, BUILDER(Create_func_sleep)},
+ { { C_STRING_WITH_LEN("SOUNDEX") }, BUILDER(Create_func_soundex)},
+ { { C_STRING_WITH_LEN("SPACE") }, BUILDER(Create_func_space)},
+ { { C_STRING_WITH_LEN("SQRT") }, BUILDER(Create_func_sqrt)},
+ { { C_STRING_WITH_LEN("SRID") }, GEOM_BUILDER(Create_func_srid)},
+ { { C_STRING_WITH_LEN("STARTPOINT") }, GEOM_BUILDER(Create_func_startpoint)},
+ { { C_STRING_WITH_LEN("STRCMP") }, BUILDER(Create_func_strcmp)},
+ { { C_STRING_WITH_LEN("STR_TO_DATE") }, BUILDER(Create_func_str_to_date)},
+ { { C_STRING_WITH_LEN("SUBSTRING_INDEX") }, BUILDER(Create_func_substr_index)},
+ { { C_STRING_WITH_LEN("SUBTIME") }, BUILDER(Create_func_subtime)},
+ { { C_STRING_WITH_LEN("TAN") }, BUILDER(Create_func_tan)},
+ { { C_STRING_WITH_LEN("TIMEDIFF") }, BUILDER(Create_func_timediff)},
+ { { C_STRING_WITH_LEN("TIME_FORMAT") }, BUILDER(Create_func_time_format)},
+ { { 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("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)},
+ { { C_STRING_WITH_LEN("UNHEX") }, BUILDER(Create_func_unhex)},
+ { { C_STRING_WITH_LEN("UNIX_TIMESTAMP") }, BUILDER(Create_func_unix_timestamp)},
+ { { C_STRING_WITH_LEN("UPDATEXML") }, BUILDER(Create_func_xml_update)},
+ { { C_STRING_WITH_LEN("UPPER") }, BUILDER(Create_func_ucase)},
+ { { C_STRING_WITH_LEN("UUID") }, BUILDER(Create_func_uuid)},
+ { { C_STRING_WITH_LEN("UUID_SHORT") }, BUILDER(Create_func_uuid_short)},
+ { { C_STRING_WITH_LEN("VERSION") }, BUILDER(Create_func_version)},
+ { { C_STRING_WITH_LEN("WEEKDAY") }, BUILDER(Create_func_weekday)},
+ { { C_STRING_WITH_LEN("WEEKOFYEAR") }, BUILDER(Create_func_weekofyear)},
+ { { C_STRING_WITH_LEN("WITHIN") }, GEOM_BUILDER(Create_func_within)},
+ { { C_STRING_WITH_LEN("X") }, GEOM_BUILDER(Create_func_x)},
+ { { C_STRING_WITH_LEN("Y") }, GEOM_BUILDER(Create_func_y)},
+ { { C_STRING_WITH_LEN("YEARWEEK") }, BUILDER(Create_func_year_week)},
{ {0, 0}, NULL}
};
static HASH native_functions_hash;
-extern "C" byte*
-get_native_fct_hash_key(const byte *buff, uint *length, my_bool /* unused */)
+extern "C" uchar*
+get_native_fct_hash_key(const uchar *buff, size_t *length,
+ my_bool /* unused */)
{
Native_func_registry *func= (Native_func_registry*) buff;
*length= func->name.length;
- return (byte*) func->name.str;
+ return (uchar*) func->name.str;
}
/*
@@ -4916,7 +4947,7 @@ int item_create_init()
for (func= func_array; func->builder != NULL; func++)
{
- if (my_hash_insert(& native_functions_hash, (byte*) func))
+ if (my_hash_insert(& native_functions_hash, (uchar*) func))
DBUG_RETURN(1);
}
@@ -4924,8 +4955,8 @@ int item_create_init()
for (uint i=0 ; i < native_functions_hash.records ; i++)
{
func= (Native_func_registry*) hash_element(& native_functions_hash, i);
- DBUG_PRINT("info", ("native function %s, length %d",
- func->name.str, func->name.length));
+ DBUG_PRINT("info", ("native function: %s length: %u",
+ func->name.str, (uint) func->name.length));
}
#endif
@@ -4953,7 +4984,7 @@ find_native_function_builder(THD *thd, LEX_STRING name)
/* Thread safe */
func= (Native_func_registry*) hash_search(& native_functions_hash,
- (byte*) name.str,
+ (uchar*) name.str,
name.length);
if (func)
@@ -4970,11 +5001,15 @@ find_qualified_function_builder(THD *thd)
return & Create_sp_func::s_singleton;
}
-Item*
-create_func_cast(THD *thd, Item *a, Cast_target cast_type, int len, int dec,
+
+Item *
+create_func_cast(THD *thd, Item *a, Cast_target cast_type,
+ const char *c_len, const char *c_dec,
CHARSET_INFO *cs)
{
Item *res;
+ ulong len;
+ uint dec;
LINT_INIT(res);
switch (cast_type) {
@@ -4998,18 +5033,33 @@ create_func_cast(THD *thd, Item *a, Cast_target cast_type, int len, int dec,
break;
case ITEM_CAST_DECIMAL:
{
- int tmp_len= (len>0) ? len : 10;
- if (tmp_len < dec)
+ len= c_len ? atoi(c_len) : 0;
+ dec= c_dec ? atoi(c_dec) : 0;
+ my_decimal_trim(&len, &dec);
+ if (len < dec)
{
my_error(ER_M_BIGGER_THAN_D, MYF(0), "");
return 0;
}
- res= new (thd->mem_root) Item_decimal_typecast(a, tmp_len, dec);
+ if (len > DECIMAL_MAX_PRECISION)
+ {
+ my_error(ER_TOO_BIG_PRECISION, MYF(0), len, a->name,
+ DECIMAL_MAX_PRECISION);
+ return 0;
+ }
+ if (dec > DECIMAL_MAX_SCALE)
+ {
+ my_error(ER_TOO_BIG_SCALE, MYF(0), dec, a->name,
+ DECIMAL_MAX_SCALE);
+ return 0;
+ }
+ res= new (thd->mem_root) Item_decimal_typecast(a, len, dec);
break;
}
case ITEM_CAST_CHAR:
{
CHARSET_INFO *real_cs= (cs ? cs : thd->variables.collation_connection);
+ len= c_len ? atoi(c_len) : -1;
res= new (thd->mem_root) Item_char_typecast(a, len, real_cs);
break;
}
@@ -5022,4 +5072,3 @@ create_func_cast(THD *thd, Item *a, Cast_target cast_type, int len, int dec,
}
return res;
}
-
diff --git a/sql/item_create.h b/sql/item_create.h
index 0a668b3e67f..a3ba6bd26a6 100644
--- a/sql/item_create.h
+++ b/sql/item_create.h
@@ -53,7 +53,7 @@ public:
@param item_list The list of arguments to the function, can be NULL
@return An item representing the parsed function call, or NULL
*/
- virtual Item* create(THD *thd, LEX_STRING name, List<Item> *item_list) = 0;
+ virtual Item *create(THD *thd, LEX_STRING name, List<Item> *item_list) = 0;
protected:
/** Constructor */
@@ -80,7 +80,7 @@ public:
@param item_list The list of arguments to the function, can be NULL
@return An item representing the parsed function call
*/
- virtual Item* create(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create(THD *thd, LEX_STRING name, List<Item> *item_list);
/**
The builder create method, for qualified functions.
@@ -127,7 +127,7 @@ extern Create_qfunc * find_qualified_function_builder(THD *thd);
class Create_udf_func : public Create_func
{
public:
- virtual Item* create(THD *thd, LEX_STRING name, List<Item> *item_list);
+ virtual Item *create(THD *thd, LEX_STRING name, List<Item> *item_list);
/**
The builder create method, for User Defined Functions.
@@ -136,7 +136,7 @@ public:
@param item_list The list of arguments to the function, can be NULL
@return An item representing the parsed function call
*/
- Item* create(THD *thd, udf_func *fct, List<Item> *item_list);
+ Item *create(THD *thd, udf_func *fct, List<Item> *item_list);
/** Singleton. */
static Create_udf_func s_singleton;
@@ -159,9 +159,9 @@ protected:
@param dec TODO
@param cs The character set
*/
-Item*
-create_func_cast(THD *thd, Item *a, Cast_target cast_type, int len, int dec,
+Item *
+create_func_cast(THD *thd, Item *a, Cast_target cast_type,
+ const char *len, const char *dec,
CHARSET_INFO *cs);
-
#endif
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 1d6903fb232..ef37cc4c6ad 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -36,7 +36,6 @@
#define sp_restore_security_context(A,B) while (0) {}
#endif
-
bool check_reserved_words(LEX_STRING *name)
{
if (!my_strcasecmp(system_charset_info, name->str, "GLOBAL") ||
@@ -143,7 +142,7 @@ Item_func::fix_fields(THD *thd, Item **ref)
DBUG_ASSERT(fixed == 0);
Item **arg,**arg_end;
#ifndef EMBEDDED_LIBRARY // Avoid compiler warning
- char buff[STACK_BUFF_ALLOC]; // Max argument in function
+ uchar buff[STACK_BUFF_ALLOC]; // Max argument in function
#endif
used_tables_cache= not_null_tables_cache= 0;
@@ -196,7 +195,7 @@ Item_func::fix_fields(THD *thd, Item **ref)
bool Item_func::walk(Item_processor processor, bool walk_subquery,
- byte *argument)
+ uchar *argument)
{
if (arg_count)
{
@@ -259,7 +258,7 @@ void Item_func::traverse_cond(Cond_traverser traverser,
Item returned as the result of transformation of the root node
*/
-Item *Item_func::transform(Item_transformer transformer, byte *argument)
+Item *Item_func::transform(Item_transformer transformer, uchar *argument)
{
DBUG_ASSERT(!current_thd->is_stmt_prepare());
@@ -312,8 +311,8 @@ Item *Item_func::transform(Item_transformer transformer, byte *argument)
Item returned as the result of transformation of the root node
*/
-Item *Item_func::compile(Item_analyzer analyzer, byte **arg_p,
- Item_transformer transformer, byte *arg_t)
+Item *Item_func::compile(Item_analyzer analyzer, uchar **arg_p,
+ Item_transformer transformer, uchar *arg_t)
{
if (!(this->*analyzer)(arg_p))
return 0;
@@ -326,7 +325,7 @@ Item *Item_func::compile(Item_analyzer analyzer, byte **arg_p,
The same parameter value of arg_p must be passed
to analyze any argument of the condition formula.
*/
- byte *arg_v= *arg_p;
+ uchar *arg_v= *arg_p;
Item *new_item= (*arg)->compile(analyzer, &arg_v, transformer, arg_t);
if (new_item && *arg != new_item)
current_thd->change_item_tree(arg, new_item);
@@ -466,7 +465,7 @@ Field *Item_func::tmp_table_field(TABLE *table)
}
-bool Item_func::is_expensive_processor(byte *arg)
+bool Item_func::is_expensive_processor(uchar *arg)
{
return is_expensive();
}
@@ -650,16 +649,8 @@ bool Item_func_connection_id::fix_fields(THD *thd, Item **ref)
{
if (Item_int_func::fix_fields(thd, ref))
return TRUE;
-
- /*
- To replicate CONNECTION_ID() properly we should use
- pseudo_thread_id on slave, which contains the value of thread_id
- on master.
- */
- value= ((thd->slave_thread) ?
- thd->variables.pseudo_thread_id :
- thd->thread_id);
-
+ thd->thread_specific_used= TRUE;
+ value= thd->variables.pseudo_thread_id;
return FALSE;
}
@@ -994,6 +985,8 @@ longlong Item_func_unsigned::val_int()
my_decimal tmp, *dec= args[0]->val_decimal(&tmp);
if (!(null_value= args[0]->null_value))
my_decimal2int(E_DEC_FATAL_ERROR, dec, 1, &value);
+ else
+ value= 0;
return value;
}
else if (args[0]->cast_to_int_type() != STRING_RESULT ||
@@ -1049,6 +1042,8 @@ my_decimal *Item_decimal_typecast::val_decimal(my_decimal *dec)
{
my_decimal tmp_buf, *tmp= args[0]->val_decimal(&tmp_buf);
bool sign;
+ uint precision;
+
if ((null_value= args[0]->null_value))
return NULL;
my_decimal_round(E_DEC_FATAL_ERROR, tmp, decimals, FALSE, dec);
@@ -1061,9 +1056,11 @@ my_decimal *Item_decimal_typecast::val_decimal(my_decimal *dec)
goto err;
}
}
- if (max_length - 2 - decimals < (uint) my_decimal_intg(dec))
+ precision= my_decimal_length_to_precision(max_length,
+ decimals, unsigned_flag);
+ if (precision - decimals < (uint) my_decimal_intg(dec))
{
- max_my_decimal(dec, max_length - 2, decimals);
+ max_my_decimal(dec, precision, decimals);
dec->sign(sign);
goto err;
}
@@ -1080,9 +1077,25 @@ err:
void Item_decimal_typecast::print(String *str)
{
+ char len_buf[20*3 + 1];
+ char *end;
+
+ uint precision= my_decimal_length_to_precision(max_length, decimals,
+ unsigned_flag);
str->append(STRING_WITH_LEN("cast("));
args[0]->print(str);
- str->append(STRING_WITH_LEN(" as decimal)"));
+ str->append(STRING_WITH_LEN(" as decimal("));
+
+ end=int10_to_str(precision, len_buf,10);
+ str->append(len_buf, (uint32) (end - len_buf));
+
+ str->append(',');
+
+ end=int10_to_str(decimals, len_buf,10);
+ str->append(len_buf, (uint32) (end - len_buf));
+
+ str->append(')');
+ str->append(')');
}
@@ -1499,16 +1512,20 @@ void Item_func_neg::fix_length_and_dec()
Use val() to get value as arg_type doesn't mean that item is
Item_int or Item_real due to existence of Item_param.
*/
- if (hybrid_type == INT_RESULT &&
- args[0]->type() == INT_ITEM &&
- ((ulonglong) args[0]->val_int() >= (ulonglong) LONGLONG_MIN))
+ if (hybrid_type == INT_RESULT && args[0]->const_item())
{
- /*
- Ensure that result is converted to DECIMAL, as longlong can't hold
- the negated number
- */
- hybrid_type= DECIMAL_RESULT;
- DBUG_PRINT("info", ("Type changed: DECIMAL_RESULT"));
+ longlong val= args[0]->val_int();
+ if ((ulonglong) val >= (ulonglong) LONGLONG_MIN &&
+ ((ulonglong) val != (ulonglong) LONGLONG_MIN ||
+ args[0]->type() != INT_ITEM))
+ {
+ /*
+ Ensure that result is converted to DECIMAL, as longlong can't hold
+ the negated number
+ */
+ hybrid_type= DECIMAL_RESULT;
+ DBUG_PRINT("info", ("Type changed: DECIMAL_RESULT"));
+ }
}
unsigned_flag= 0;
DBUG_VOID_RETURN;
@@ -1933,7 +1950,13 @@ void Item_func_round::fix_length_and_dec()
{
max_length= args[0]->max_length;
decimals= args[0]->decimals;
- hybrid_type= REAL_RESULT;
+ if (args[0]->result_type() == DECIMAL_RESULT)
+ {
+ max_length++;
+ hybrid_type= DECIMAL_RESULT;
+ }
+ else
+ hybrid_type= REAL_RESULT;
return;
}
@@ -2003,9 +2026,9 @@ double my_double_round(double value, longlong dec, bool dec_unsigned,
tmp=(abs_dec < array_elements(log_10) ?
log_10[abs_dec] : pow(10.0,(double) abs_dec));
- if (dec_negative && isinf(tmp))
+ if (dec_negative && my_isinf(tmp))
tmp2= 0;
- else if (!dec_negative && isinf(value * tmp))
+ else if (!dec_negative && my_isinf(value * tmp))
tmp2= value;
else if (truncate)
{
@@ -2344,7 +2367,7 @@ double Item_func_min_max::val_real()
double value=0.0;
if (compare_as_dates)
{
- ulonglong result;
+ ulonglong result= 0;
(void)cmp_datetimes(&result);
return (double)result;
}
@@ -2371,7 +2394,7 @@ longlong Item_func_min_max::val_int()
longlong value=0;
if (compare_as_dates)
{
- ulonglong result;
+ ulonglong result= 0;
(void)cmp_datetimes(&result);
return (longlong)result;
}
@@ -2400,7 +2423,7 @@ my_decimal *Item_func_min_max::val_decimal(my_decimal *dec)
if (compare_as_dates)
{
- ulonglong value;
+ ulonglong value= 0;
(void)cmp_datetimes(&value);
ulonglong2decimal(value, dec);
return dec;
@@ -2472,7 +2495,6 @@ longlong Item_func_coercibility::val_int()
void Item_func_locate::fix_length_and_dec()
{
- maybe_null= 0;
max_length= MY_INT32_NUM_DECIMAL_DIGITS;
agg_arg_charsets(cmp_collation, args, 2, MY_COLL_CMP_CONV, 1);
}
@@ -2782,7 +2804,7 @@ udf_handler::fix_fields(THD *thd, Item_result_field *func,
uint arg_count, Item **arguments)
{
#ifndef EMBEDDED_LIBRARY // Avoid compiler warning
- char buff[STACK_BUFF_ALLOC]; // Max argument in function
+ uchar buff[STACK_BUFF_ALLOC]; // Max argument in function
#endif
DBUG_ENTER("Item_udf_func::fix_fields");
@@ -2894,7 +2916,8 @@ udf_handler::fix_fields(THD *thd, Item_result_field *func,
String *res= arguments[i]->val_str(&buffers[i]);
if (arguments[i]->null_value)
continue;
- f_args.args[i]= (char*) res->ptr();
+ f_args.args[i]= (char*) res->c_ptr();
+ f_args.lengths[i]= res->length();
break;
}
case INT_RESULT:
@@ -3220,8 +3243,8 @@ static HASH hash_user_locks;
class User_level_lock
{
- char *key;
- uint key_length;
+ uchar *key;
+ size_t key_length;
public:
int count;
@@ -3230,16 +3253,16 @@ public:
my_thread_id thread_id;
void set_thread(THD *thd) { thread_id= thd->thread_id; }
- User_level_lock(const char *key_arg,uint length, ulong id)
+ User_level_lock(const uchar *key_arg,uint length, ulong id)
:key_length(length),count(1),locked(1), thread_id(id)
{
- key=(char*) my_memdup((byte*) key_arg,length,MYF(0));
+ key= (uchar*) my_memdup(key_arg,length,MYF(0));
pthread_cond_init(&cond,NULL);
if (key)
{
- if (my_hash_insert(&hash_user_locks,(byte*) this))
+ if (my_hash_insert(&hash_user_locks,(uchar*) this))
{
- my_free((gptr) key,MYF(0));
+ my_free(key,MYF(0));
key=0;
}
}
@@ -3248,22 +3271,22 @@ public:
{
if (key)
{
- hash_delete(&hash_user_locks,(byte*) this);
- my_free((gptr) key,MYF(0));
+ hash_delete(&hash_user_locks,(uchar*) this);
+ my_free(key, MYF(0));
}
pthread_cond_destroy(&cond);
}
inline bool initialized() { return key != 0; }
friend void item_user_lock_release(User_level_lock *ull);
- friend char *ull_get_key(const User_level_lock *ull, uint *length,
- my_bool not_used);
+ friend uchar *ull_get_key(const User_level_lock *ull, size_t *length,
+ my_bool not_used);
};
-char *ull_get_key(const User_level_lock *ull, uint *length,
- my_bool not_used __attribute__((unused)))
+uchar *ull_get_key(const User_level_lock *ull, size_t *length,
+ my_bool not_used __attribute__((unused)))
{
- *length=(uint) ull->key_length;
- return (char*) ull->key;
+ *length= ull->key_length;
+ return ull->key;
}
@@ -3333,8 +3356,8 @@ void debug_sync_point(const char* lock_name, uint lock_timeout)
THD* thd=current_thd;
User_level_lock* ull;
struct timespec abstime;
- int lock_name_len;
- lock_name_len=strlen(lock_name);
+ size_t lock_name_len;
+ lock_name_len= strlen(lock_name);
pthread_mutex_lock(&LOCK_user_locks);
if (thd->ull)
@@ -3349,8 +3372,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, lock_name,
- lock_name_len))))
+ if (!(ull= ((User_level_lock*) hash_search(&hash_user_locks,
+ (uchar*) lock_name,
+ lock_name_len))))
{
pthread_mutex_unlock(&LOCK_user_locks);
return;
@@ -3417,6 +3441,7 @@ longlong Item_func_get_lock::val_int()
THD *thd=current_thd;
User_level_lock *ull;
int error;
+ DBUG_ENTER("Item_func_get_lock::val_int");
/*
In slave thread no need to get locks, everything is serialized. Anyway
@@ -3426,7 +3451,7 @@ longlong Item_func_get_lock::val_int()
it's not guaranteed to be same as on master.
*/
if (thd->slave_thread)
- return 1;
+ DBUG_RETURN(1);
pthread_mutex_lock(&LOCK_user_locks);
@@ -3434,8 +3459,10 @@ longlong Item_func_get_lock::val_int()
{
pthread_mutex_unlock(&LOCK_user_locks);
null_value=1;
- return 0;
+ DBUG_RETURN(0);
}
+ DBUG_PRINT("info", ("lock %.*s, thd=%ld", res->length(), res->ptr(),
+ (long) thd->real_id));
null_value=0;
if (thd->ull)
@@ -3445,23 +3472,26 @@ longlong Item_func_get_lock::val_int()
}
if (!(ull= ((User_level_lock *) hash_search(&hash_user_locks,
- (byte*) res->ptr(),
- res->length()))))
+ (uchar*) res->ptr(),
+ (size_t) res->length()))))
{
- ull=new User_level_lock(res->ptr(),res->length(), thd->thread_id);
+ ull= new User_level_lock((uchar*) res->ptr(), (size_t) res->length(),
+ thd->thread_id);
if (!ull || !ull->initialized())
{
delete ull;
pthread_mutex_unlock(&LOCK_user_locks);
null_value=1; // Probably out of memory
- return 0;
+ DBUG_RETURN(0);
}
ull->set_thread(thd);
thd->ull=ull;
pthread_mutex_unlock(&LOCK_user_locks);
- return 1; // Got new lock
+ DBUG_PRINT("info", ("made new lock"));
+ DBUG_RETURN(1); // Got new lock
}
ull->count++;
+ DBUG_PRINT("info", ("ull->count=%d", ull->count));
/*
Structure is now initialized. Try to get the lock.
@@ -3475,9 +3505,13 @@ longlong Item_func_get_lock::val_int()
error= 0;
while (ull->locked && !thd->killed)
{
+ DBUG_PRINT("info", ("waiting on lock"));
error= pthread_cond_timedwait(&ull->cond,&LOCK_user_locks,&abstime);
if (error == ETIMEDOUT || error == ETIME)
+ {
+ DBUG_PRINT("info", ("lock wait timeout"));
break;
+ }
error= 0;
}
@@ -3501,6 +3535,7 @@ longlong Item_func_get_lock::val_int()
ull->thread_id= thd->thread_id;
thd->ull=ull;
error=0;
+ DBUG_PRINT("info", ("got the lock"));
}
pthread_mutex_unlock(&LOCK_user_locks);
@@ -3510,7 +3545,7 @@ longlong Item_func_get_lock::val_int()
thd->mysys_var->current_cond= 0;
pthread_mutex_unlock(&thd->mysys_var->mutex);
- return !error ? 1 : 0;
+ DBUG_RETURN(!error ? 1 : 0);
}
@@ -3528,32 +3563,40 @@ longlong Item_func_release_lock::val_int()
String *res=args[0]->val_str(&value);
User_level_lock *ull;
longlong result;
+ THD *thd=current_thd;
+ DBUG_ENTER("Item_func_release_lock::val_int");
if (!res || !res->length())
{
null_value=1;
- return 0;
+ DBUG_RETURN(0);
}
+ DBUG_PRINT("info", ("lock %.*s", res->length(), res->ptr()));
null_value=0;
result=0;
pthread_mutex_lock(&LOCK_user_locks);
if (!(ull= ((User_level_lock*) hash_search(&hash_user_locks,
- (const byte*) res->ptr(),
- res->length()))))
+ (const uchar*) res->ptr(),
+ (size_t) res->length()))))
{
null_value=1;
}
else
{
+ DBUG_PRINT("info", ("ull->locked=%d ull->thread=%lu thd=%lu",
+ (int) ull->locked,
+ (long)ull->thread_id,
+ (long)thd->thread_id));
if (ull->locked && current_thd->thread_id == ull->thread_id)
{
+ DBUG_PRINT("info", ("release lock"));
result=1; // Release is ok
item_user_lock_release(ull);
- current_thd->ull=0;
+ thd->ull=0;
}
}
pthread_mutex_unlock(&LOCK_user_locks);
- return result;
+ DBUG_RETURN(result);
}
@@ -3684,7 +3727,7 @@ static user_var_entry *get_variable(HASH *hash, LEX_STRING &name,
{
user_var_entry *entry;
- if (!(entry = (user_var_entry*) hash_search(hash, (byte*) name.str,
+ if (!(entry = (user_var_entry*) hash_search(hash, (uchar*) name.str,
name.length)) &&
create_if_not_exists)
{
@@ -3699,7 +3742,7 @@ static user_var_entry *get_variable(HASH *hash, LEX_STRING &name,
entry->value=0;
entry->length=0;
entry->update_query_id=0;
- entry->collation.set(NULL, DERIVATION_IMPLICIT);
+ entry->collation.set(NULL, DERIVATION_IMPLICIT, 0);
entry->unsigned_flag= 0;
/*
If we are here, we were called from a SET or a query which sets a
@@ -3714,7 +3757,7 @@ static user_var_entry *get_variable(HASH *hash, LEX_STRING &name,
entry->used_query_id=current_thd->query_id;
entry->type=STRING_RESULT;
memcpy(entry->name.str, name.str, name.length+1);
- if (my_hash_insert(hash,(byte*) entry))
+ if (my_hash_insert(hash,(uchar*) entry))
{
my_free((char*) entry,MYF(0));
return 0;
@@ -3776,6 +3819,23 @@ Item_func_set_user_var::fix_length_and_dec()
/*
+ Mark field in read_map
+
+ NOTES
+ This is used by filesort to register used fields in a a temporary
+ column read set or to register used fields in a view
+*/
+
+bool Item_func_set_user_var::register_field_in_read_map(uchar *arg)
+{
+ TABLE *table= (TABLE *) arg;
+ if (result_field->table == table || !table)
+ bitmap_set_bit(result_field->table->read_set, result_field->field_index);
+ return 0;
+}
+
+
+/*
Set value to user variable.
SYNOPSYS
@@ -4011,7 +4071,8 @@ bool
Item_func_set_user_var::check(bool use_result_field)
{
DBUG_ENTER("Item_func_set_user_var::check");
- DBUG_ASSERT(!use_result_field || result_field);
+ if (use_result_field && !result_field)
+ use_result_field= FALSE;
switch (cached_result_type) {
case REAL_RESULT:
@@ -4155,6 +4216,40 @@ my_decimal *Item_func_set_user_var::val_decimal(my_decimal *val)
}
+double Item_func_set_user_var::val_result()
+{
+ DBUG_ASSERT(fixed == 1);
+ check(TRUE);
+ update(); // Store expression
+ return entry->val_real(&null_value);
+}
+
+longlong Item_func_set_user_var::val_int_result()
+{
+ DBUG_ASSERT(fixed == 1);
+ check(TRUE);
+ update(); // Store expression
+ return entry->val_int(&null_value);
+}
+
+String *Item_func_set_user_var::str_result(String *str)
+{
+ DBUG_ASSERT(fixed == 1);
+ check(TRUE);
+ update(); // Store expression
+ return entry->val_str(&null_value, str, decimals);
+}
+
+
+my_decimal *Item_func_set_user_var::val_decimal_result(my_decimal *val)
+{
+ DBUG_ASSERT(fixed == 1);
+ check(TRUE);
+ update(); // Store expression
+ return entry->val_decimal(&null_value, val);
+}
+
+
void Item_func_set_user_var::print(String *str)
{
str->append(STRING_WITH_LEN("(@"));
@@ -4237,9 +4332,11 @@ void Item_func_set_user_var::make_field(Send_field *tmp_field)
TRUE Error
*/
-int Item_func_set_user_var::save_in_field(Field *field, bool no_conversions)
+int Item_func_set_user_var::save_in_field(Field *field, bool no_conversions,
+ bool can_use_result_field)
{
- bool use_result_field= (result_field && result_field != field);
+ bool use_result_field= (!can_use_result_field ? 0 :
+ (result_field && result_field != field));
int error;
/* Update the value of the user variable */
@@ -4279,11 +4376,11 @@ int Item_func_set_user_var::save_in_field(Field *field, bool no_conversions)
else if (result_type() == DECIMAL_RESULT)
{
my_decimal decimal_value;
- my_decimal *value= entry->val_decimal(&null_value, &decimal_value);
+ my_decimal *val= entry->val_decimal(&null_value, &decimal_value);
if (null_value)
return set_field_to_null(field);
field->set_notnull();
- error=field->store_decimal(value);
+ error=field->store_decimal(val);
}
else
{
@@ -4399,7 +4496,7 @@ int get_var_with_binlog(THD *thd, enum_sql_command sql_command,
List<set_var_base> tmp_var_list;
LEX *sav_lex= thd->lex, lex_tmp;
thd->lex= &lex_tmp;
- lex_start(thd, NULL, 0);
+ lex_start(thd);
tmp_var_list.push_back(new set_var_user(new Item_func_set_user_var(name,
new Item_null())));
/* Create the variable */
@@ -4431,7 +4528,7 @@ int get_var_with_binlog(THD *thd, enum_sql_command sql_command,
> set @a:=1;
> insert into t1 values (@a), (@a:=@a+1), (@a:=@a+1);
We have to write to binlog value @a= 1.
-
+
We allocate the user_var_event on user_var_events_alloc pool, not on
the this-statement-execution pool because in SPs user_var_event objects
may need to be valid after current [SP] statement execution pool is
@@ -4441,7 +4538,7 @@ int get_var_with_binlog(THD *thd, enum_sql_command sql_command,
if (!(user_var_event= (BINLOG_USER_VAR_EVENT *)
alloc_root(thd->user_var_events_alloc, size)))
goto err;
-
+
user_var_event->value= (char*) user_var_event +
ALIGN_SIZE(sizeof(BINLOG_USER_VAR_EVENT));
user_var_event->user_var_event= var_entry;
@@ -4461,9 +4558,9 @@ int get_var_with_binlog(THD *thd, enum_sql_command sql_command,
}
/* Mark that this variable has been used by this query */
var_entry->used_query_id= thd->query_id;
- if (insert_dynamic(&thd->user_var_events, (gptr) &user_var_event))
+ if (insert_dynamic(&thd->user_var_events, (uchar*) &user_var_event))
goto err;
-
+
*out_entry= var_entry;
return 0;
@@ -4472,7 +4569,6 @@ err:
return 1;
}
-
void Item_func_get_user_var::fix_length_and_dec()
{
THD *thd=current_thd;
@@ -4483,10 +4579,19 @@ void Item_func_get_user_var::fix_length_and_dec()
error= get_var_with_binlog(thd, thd->lex->sql_command, name, &var_entry);
+ /*
+ If the variable didn't exist it has been created as a STRING-type.
+ 'var_entry' is NULL only if there occured an error during the call to
+ get_var_with_binlog.
+ */
if (var_entry)
{
+ m_cached_result_type= var_entry->type;
+ unsigned_flag= var_entry->unsigned_flag;
+ max_length= var_entry->length;
+
collation.set(var_entry->collation);
- switch (var_entry->type) {
+ switch(m_cached_result_type) {
case REAL_RESULT:
max_length= DBL_DIG + 8;
break;
@@ -4511,6 +4616,8 @@ void Item_func_get_user_var::fix_length_and_dec()
{
collation.set(&my_charset_bin, DERIVATION_IMPLICIT);
null_value= 1;
+ m_cached_result_type= STRING_RESULT;
+ max_length= MAX_BLOB_WIDTH;
}
if (error)
@@ -4528,12 +4635,7 @@ bool Item_func_get_user_var::const_item() const
enum Item_result Item_func_get_user_var::result_type() const
{
- user_var_entry *entry;
- if (!(entry = (user_var_entry*) hash_search(&current_thd->user_vars,
- (byte*) name.str,
- name.length)))
- return STRING_RESULT;
- return entry->type;
+ return m_cached_result_type;
}
@@ -4968,7 +5070,7 @@ double Item_func_match::val_real()
if ((null_value= (a == 0)) || !a->length())
DBUG_RETURN(0);
DBUG_RETURN(ft_handler->please->find_relevance(ft_handler,
- (byte *)a->ptr(), a->length()));
+ (uchar *)a->ptr(), a->length()));
}
DBUG_RETURN(ft_handler->please->find_relevance(ft_handler,
table->record[0], 0));
@@ -5038,7 +5140,7 @@ Item *get_system_var(THD *thd, enum_var_type var_type, LEX_STRING name,
component_name= &component; // Empty string
}
- if (!(var= find_sys_var(base_name->str, base_name->length)))
+ if (!(var= find_sys_var(thd, base_name->str, base_name->length)))
return 0;
if (component.str)
{
@@ -5083,8 +5185,8 @@ longlong Item_func_is_free_lock::val_int()
}
pthread_mutex_lock(&LOCK_user_locks);
- ull= (User_level_lock *) hash_search(&hash_user_locks, (byte*) res->ptr(),
- res->length());
+ ull= (User_level_lock *) hash_search(&hash_user_locks, (uchar*) res->ptr(),
+ (size_t) res->length());
pthread_mutex_unlock(&LOCK_user_locks);
if (!ull || !ull->locked)
return 1;
@@ -5102,8 +5204,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, (byte*) res->ptr(),
- res->length());
+ ull= (User_level_lock *) hash_search(&hash_user_locks, (uchar*) res->ptr(),
+ (size_t) res->length());
pthread_mutex_unlock(&LOCK_user_locks);
if (!ull || !ull->locked)
return 0;
@@ -5163,10 +5265,11 @@ Item_func_sp::func_name() const
{
THD *thd= current_thd;
/* Calculate length to avoid reallocation of string for sure */
- uint len= ((m_name->m_explicit_name ? m_name->m_db.length : 0 +
+ uint len= (((m_name->m_explicit_name ? m_name->m_db.length : 0) +
m_name->m_name.length)*2 + //characters*quoting
2 + // ` and `
- 1 + // .
+ (m_name->m_explicit_name ?
+ 3 : 0) + // '`', '`' and '.' for the db
1 + // end of string
ALIGN_SIZE(1)); // to avoid String reallocation
String qname((char *)alloc_root(thd->mem_root, len), len,
@@ -5201,14 +5304,13 @@ Item_func_sp::func_name() const
@retval TRUE is returned on an error
@retval FALSE is returned on success.
*/
+
bool
Item_func_sp::init_result_field(THD *thd)
{
- DBUG_ENTER("Item_func_sp::init_result_field");
-
LEX_STRING empty_name= { C_STRING_WITH_LEN("") };
-
TABLE_SHARE *share;
+ DBUG_ENTER("Item_func_sp::init_result_field");
DBUG_ASSERT(m_sp == NULL);
DBUG_ASSERT(sp_result_field == NULL);
@@ -5235,30 +5337,34 @@ Item_func_sp::init_result_field(THD *thd)
share->table_cache_key = empty_name;
share->table_name = empty_name;
- if (!(sp_result_field= m_sp->create_result_field(max_length, name, dummy_table)))
+ if (!(sp_result_field= m_sp->create_result_field(max_length, name,
+ dummy_table)))
{
DBUG_RETURN(TRUE);
}
if (sp_result_field->pack_length() > sizeof(result_buf))
{
- sp_result_field->move_field(sql_alloc(sp_result_field->pack_length()));
- } else {
- sp_result_field->move_field(result_buf);
+ void *tmp;
+ if (!(tmp= sql_alloc(sp_result_field->pack_length())))
+ DBUG_RETURN(TRUE);
+ sp_result_field->move_field((uchar*) tmp);
}
+ else
+ sp_result_field->move_field(result_buf);
sp_result_field->null_ptr= (uchar *) &null_value;
sp_result_field->null_bit= 1;
-
-
DBUG_RETURN(FALSE);
}
+
/**
@brief Initialize local members with values from the Field interface.
@note called from Item::fix_fields.
*/
+
void Item_func_sp::fix_length_and_dec()
{
DBUG_ENTER("Item_func_sp::fix_length_and_dec");
@@ -5273,6 +5379,7 @@ void Item_func_sp::fix_length_and_dec()
DBUG_VOID_RETURN;
}
+
/**
@brief Execute function & store value in field.
@@ -5286,18 +5393,14 @@ Item_func_sp::execute()
{
THD *thd= current_thd;
- /*
- Get field in virtual tmp table to store result. Create the field if
- invoked first time.
- */
-
-
/* Execute function and store the return value in the field. */
if (execute_impl(thd))
{
null_value= 1;
context->process_error(thd);
+ if (thd->killed)
+ thd->send_kill_message();
return TRUE;
}
@@ -5489,5 +5592,52 @@ Item_func_sp::fix_fields(THD *thd, Item **ref)
#endif /* ! NO_EMBEDDED_ACCESS_CHECKS */
}
+ if (!m_sp->m_chistics->detistic)
+ used_tables_cache |= RAND_TABLE_BIT;
DBUG_RETURN(res);
}
+
+
+void Item_func_sp::update_used_tables()
+{
+ Item_func::update_used_tables();
+ if (!m_sp->m_chistics->detistic)
+ used_tables_cache |= RAND_TABLE_BIT;
+}
+
+
+/*
+ uuid_short handling.
+
+ The short uuid is defined as a longlong that contains the following bytes:
+
+ Bytes Comment
+ 1 Server_id & 255
+ 4 Startup time of server in seconds
+ 3 Incrementor
+
+ This means that an uuid is guaranteed to be unique
+ even in a replication environment if the following holds:
+
+ - The last byte of the server id is unique
+ - If you between two shutdown of the server don't get more than
+ an average of 2^24 = 16M calls to uuid_short() per second.
+*/
+
+ulonglong uuid_value;
+
+void uuid_short_init()
+{
+ uuid_value= ((((ulonglong) server_id) << 56) +
+ (((ulonglong) server_start_time) << 24));
+}
+
+
+longlong Item_func_uuid_short::val_int()
+{
+ ulonglong val;
+ pthread_mutex_lock(&LOCK_uuid_generator);
+ val= uuid_value++;
+ pthread_mutex_unlock(&LOCK_uuid_generator);
+ return (longlong) val;
+}
diff --git a/sql/item_func.h b/sql/item_func.h
index 10464a408a7..ea22e35773d 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -184,13 +184,13 @@ public:
{
return agg_item_charsets(c, func_name(), items, nitems, flags, item_sep);
}
- bool walk(Item_processor processor, bool walk_subquery, byte *arg);
- Item *transform(Item_transformer transformer, byte *arg);
- Item* compile(Item_analyzer analyzer, byte **arg_p,
- Item_transformer transformer, byte *arg_t);
+ bool walk(Item_processor processor, bool walk_subquery, uchar *arg);
+ Item *transform(Item_transformer transformer, uchar *arg);
+ Item* compile(Item_analyzer analyzer, uchar **arg_p,
+ Item_transformer transformer, uchar *arg_t);
void traverse_cond(Cond_traverser traverser,
void * arg, traverse_order order);
- bool is_expensive_processor(byte *arg);
+ bool is_expensive_processor(uchar *arg);
virtual bool is_expensive() { return 0; }
};
@@ -253,7 +253,6 @@ public:
void fix_num_length_and_dec();
void find_num_type();
String *str_op(String *str) { DBUG_ASSERT(0); return 0; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -266,7 +265,7 @@ class Item_num_op :public Item_func_numhybrid
void print(String *str) { print_op(str); }
void find_num_type();
String *str_op(String *str) { DBUG_ASSERT(0); return 0; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -311,7 +310,6 @@ public:
{ max_length=args[0]->max_length; unsigned_flag=0; }
void print(String *str);
uint decimal_precision() const { return args[0]->decimal_precision(); }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -333,8 +331,8 @@ class Item_decimal_typecast :public Item_func
public:
Item_decimal_typecast(Item *a, int len, int dec) :Item_func(a)
{
- max_length= len + 2;
decimals= dec;
+ max_length= my_decimal_precision_to_length(len, dec, unsigned_flag);
}
String *val_str(String *str);
double val_real();
@@ -345,7 +343,6 @@ public:
void fix_length_and_dec() {};
const char *func_name() const { return "decimal_typecast"; }
void print(String *);
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -414,7 +411,7 @@ public:
const char *func_name() const { return "DIV"; }
void fix_length_and_dec();
void print(String *str) { print_op(str); }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -442,6 +439,7 @@ public:
void fix_length_and_dec();
void fix_num_length_and_dec();
uint decimal_precision() const { return args[0]->decimal_precision(); }
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -454,6 +452,7 @@ public:
my_decimal *decimal_op(my_decimal *);
const char *func_name() const { return "abs"; }
void fix_length_and_dec();
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
// A class to handle logarithmic and trigonometric functions
@@ -488,7 +487,6 @@ public:
Item_func_exp(Item *a) :Item_dec_func(a) {}
double val_real();
const char *func_name() const { return "exp"; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -498,7 +496,6 @@ public:
Item_func_ln(Item *a) :Item_dec_func(a) {}
double val_real();
const char *func_name() const { return "ln"; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -509,7 +506,6 @@ public:
Item_func_log(Item *a,Item *b) :Item_dec_func(a,b) {}
double val_real();
const char *func_name() const { return "log"; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -519,7 +515,6 @@ public:
Item_func_log2(Item *a) :Item_dec_func(a) {}
double val_real();
const char *func_name() const { return "log2"; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -529,7 +524,6 @@ public:
Item_func_log10(Item *a) :Item_dec_func(a) {}
double val_real();
const char *func_name() const { return "log10"; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -539,7 +533,6 @@ public:
Item_func_sqrt(Item *a) :Item_dec_func(a) {}
double val_real();
const char *func_name() const { return "sqrt"; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -549,7 +542,6 @@ public:
Item_func_pow(Item *a,Item *b) :Item_dec_func(a,b) {}
double val_real();
const char *func_name() const { return "pow"; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -559,7 +551,6 @@ public:
Item_func_acos(Item *a) :Item_dec_func(a) {}
double val_real();
const char *func_name() const { return "acos"; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
class Item_func_asin :public Item_dec_func
@@ -568,7 +559,6 @@ public:
Item_func_asin(Item *a) :Item_dec_func(a) {}
double val_real();
const char *func_name() const { return "asin"; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
class Item_func_atan :public Item_dec_func
@@ -578,7 +568,6 @@ public:
Item_func_atan(Item *a,Item *b) :Item_dec_func(a,b) {}
double val_real();
const char *func_name() const { return "atan"; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
class Item_func_cos :public Item_dec_func
@@ -587,7 +576,6 @@ public:
Item_func_cos(Item *a) :Item_dec_func(a) {}
double val_real();
const char *func_name() const { return "cos"; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
class Item_func_sin :public Item_dec_func
@@ -596,7 +584,6 @@ public:
Item_func_sin(Item *a) :Item_dec_func(a) {}
double val_real();
const char *func_name() const { return "sin"; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
class Item_func_tan :public Item_dec_func
@@ -605,7 +592,6 @@ public:
Item_func_tan(Item *a) :Item_dec_func(a) {}
double val_real();
const char *func_name() const { return "tan"; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
class Item_func_integer :public Item_int_func
@@ -633,6 +619,7 @@ public:
longlong int_op();
double real_op();
my_decimal *decimal_op(my_decimal *);
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -644,6 +631,7 @@ public:
longlong int_op();
double real_op();
my_decimal *decimal_op(my_decimal *);
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
/* This handles round and truncate */
@@ -684,7 +672,6 @@ public:
Item_func_sign(Item *a) :Item_int_func(a) {}
const char *func_name() const { return "sign"; }
longlong val_int();
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -699,7 +686,6 @@ public:
const char *func_name() const { return name; }
void fix_length_and_dec()
{ decimals= NOT_FIXED_DEC; max_length= float_length(decimals); }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -724,7 +710,7 @@ public:
my_decimal *val_decimal(my_decimal *);
void fix_length_and_dec();
enum Item_result result_type () const { return cmp_type; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
+ bool result_as_longlong() { return compare_as_dates; };
uint cmp_datetimes(ulonglong *value);
};
@@ -780,7 +766,6 @@ public:
longlong val_int();
const char *func_name() const { return "length"; }
void fix_length_and_dec() { max_length=10; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
class Item_func_bit_length :public Item_func_length
@@ -800,7 +785,6 @@ public:
longlong val_int();
const char *func_name() const { return "char_length"; }
void fix_length_and_dec() { max_length=10; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
class Item_func_coercibility :public Item_int_func
@@ -824,7 +808,6 @@ public:
longlong val_int();
void fix_length_and_dec();
void print(String *str);
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -849,7 +832,6 @@ public:
longlong val_int();
const char *func_name() const { return "ascii"; }
void fix_length_and_dec() { max_length=3; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
class Item_func_ord :public Item_int_func
@@ -859,7 +841,6 @@ public:
Item_func_ord(Item *a) :Item_int_func(a) {}
longlong val_int();
const char *func_name() const { return "ord"; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
class Item_func_find_in_set :public Item_int_func
@@ -873,7 +854,6 @@ public:
longlong val_int();
const char *func_name() const { return "find_in_set"; }
void fix_length_and_dec();
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
/* Base class for all bit functions: '~', '|', '^', '&', '>>', '<<' */
@@ -885,7 +865,6 @@ public:
Item_func_bit(Item *a) :Item_int_func(a) {}
void fix_length_and_dec() { unsigned_flag= 1; }
void print(String *str) { print_op(str); }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
class Item_func_bit_or :public Item_func_bit
@@ -911,7 +890,6 @@ public:
longlong val_int();
const char *func_name() const { return "bit_count"; }
void fix_length_and_dec() { max_length=2; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
class Item_func_shift_left :public Item_func_bit
@@ -1235,6 +1213,10 @@ public:
longlong val_int();
String *val_str(String *str);
my_decimal *val_decimal(my_decimal *);
+ double val_result();
+ longlong val_int_result();
+ String *str_result(String *str);
+ my_decimal *val_decimal_result(my_decimal *);
bool update_hash(void *ptr, uint length, enum Item_result type,
CHARSET_INFO *cs, Derivation dv, bool unsigned_arg);
bool send(Protocol *protocol, String *str_arg);
@@ -1247,7 +1229,14 @@ public:
void print(String *str);
void print_as_stmt(String *str);
const char *func_name() const { return "set_user_var"; }
- int save_in_field(Field *field, bool no_conversions);
+ int save_in_field(Field *field, bool no_conversions,
+ bool can_use_result_field);
+ int save_in_field(Field *field, bool no_conversions)
+ {
+ return save_in_field(field, no_conversions, 1);
+ }
+ void save_org_in_field(Field *field) { (void)save_in_field(field, 1, 0); }
+ bool register_field_in_read_map(uchar *arg);
};
@@ -1255,11 +1244,12 @@ class Item_func_get_user_var :public Item_func,
private Settable_routine_parameter
{
user_var_entry *var_entry;
+ Item_result m_cached_result_type;
public:
LEX_STRING name; // keep it public
Item_func_get_user_var(LEX_STRING a):
- Item_func(), name(a) {}
+ Item_func(), m_cached_result_type(STRING_RESULT), name(a) {}
enum Functype functype() const { return GUSERVAR_FUNC; }
LEX_STRING get_name() { return name; }
double val_real();
@@ -1273,13 +1263,11 @@ public:
We must always return variables as strings to guard against selects of type
select @t1:=1,@t1,@t:="hello",@t from foo where (@t1:= t2.b)
*/
- enum_field_types field_type() const { return MYSQL_TYPE_VARCHAR; }
const char *func_name() const { return "get_user_var"; }
bool const_item() const;
table_map used_tables() const
{ return const_item() ? 0 : RAND_TABLE_BIT; }
bool eq(const Item *item, bool binary_cmp) const;
-
private:
bool set_value(THD *thd, sp_rcontext *ctx, Item **it);
@@ -1352,7 +1340,6 @@ public:
longlong val_int();
const char *func_name() const { return "inet_aton"; }
void fix_length_and_dec() { decimals= 0; max_length= 21; maybe_null= 1; unsigned_flag= 1;}
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -1465,7 +1452,7 @@ private:
sp_name *m_name;
mutable sp_head *m_sp;
TABLE *dummy_table;
- char result_buf[64];
+ uchar result_buf[64];
/*
The result field of the concrete stored function.
*/
@@ -1485,7 +1472,7 @@ public:
virtual ~Item_func_sp()
{}
- table_map used_tables() const { return RAND_TABLE_BIT; }
+ void update_used_tables();
void cleanup();
@@ -1539,7 +1526,7 @@ public:
return str;
}
- virtual bool change_context_processor(byte *cntx)
+ virtual bool change_context_processor(uchar *cntx)
{ context= (Name_resolution_context *)cntx; return FALSE; }
bool sp_check_access(THD * thd);
@@ -1559,3 +1546,18 @@ public:
const char *func_name() const { return "found_rows"; }
void fix_length_and_dec() { decimals= 0; maybe_null=0; }
};
+
+
+void uuid_short_init();
+
+class Item_func_uuid_short :public Item_int_func
+{
+public:
+ Item_func_uuid_short() :Item_int_func() {}
+ const char *func_name() const { return "uuid_short"; }
+ longlong val_int();
+ void fix_length_and_dec()
+ { max_length= 21; unsigned_flag=1; }
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
+};
+
diff --git a/sql/item_row.cc b/sql/item_row.cc
index 956556ca783..d1d1011ab2b 100644
--- a/sql/item_row.cc
+++ b/sql/item_row.cc
@@ -142,7 +142,7 @@ void Item_row::print(String *str)
}
-bool Item_row::walk(Item_processor processor, bool walk_subquery, byte *arg)
+bool Item_row::walk(Item_processor processor, bool walk_subquery, uchar *arg)
{
for (uint i= 0; i < arg_count; i++)
{
@@ -153,7 +153,7 @@ bool Item_row::walk(Item_processor processor, bool walk_subquery, byte *arg)
}
-Item *Item_row::transform(Item_transformer transformer, byte *arg)
+Item *Item_row::transform(Item_transformer transformer, uchar *arg)
{
DBUG_ASSERT(!current_thd->is_stmt_prepare());
diff --git a/sql/item_row.h b/sql/item_row.h
index d55d3ae223f..dd7436888f0 100644
--- a/sql/item_row.h
+++ b/sql/item_row.h
@@ -67,8 +67,8 @@ public:
void update_used_tables();
void print(String *str);
- bool walk(Item_processor processor, bool walk_subquery, byte *arg);
- Item *transform(Item_transformer transformer, byte *arg);
+ bool walk(Item_processor processor, bool walk_subquery, uchar *arg);
+ Item *transform(Item_transformer transformer, uchar *arg);
uint cols() { return arg_count; }
Item* element_index(uint i) { return items[i]; }
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index a1fd79cbfb0..d1c8e7a37e8 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -25,9 +25,10 @@
#include "mysql_priv.h"
#include <m_ctype.h>
-#include "md5.h"
+#include "my_md5.h"
#include "sha1.h"
#include "my_aes.h"
+#include <zlib.h>
C_MODE_START
#include "../mysys/my_static.h" // For soundex_map
C_MODE_END
@@ -1048,6 +1049,23 @@ String *Item_str_conv::val_str(String *str)
}
+void Item_func_lcase::fix_length_and_dec()
+{
+ collation.set(args[0]->collation);
+ multiply= collation.collation->casedn_multiply;
+ converter= collation.collation->cset->casedn;
+ max_length= args[0]->max_length * multiply;
+}
+
+void Item_func_ucase::fix_length_and_dec()
+{
+ collation.set(args[0]->collation);
+ multiply= collation.collation->caseup_multiply;
+ converter= collation.collation->cset->caseup;
+ max_length= args[0]->max_length * multiply;
+}
+
+
String *Item_func_left::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
@@ -1142,8 +1160,9 @@ String *Item_func_substr::val_str(String *str)
(arg_count == 3 && args[2]->null_value))))
return 0; /* purecov: inspected */
- /* Negative length, will return empty string. */
- if ((arg_count == 3) && (length <= 0) && !args[2]->unsigned_flag)
+ /* Negative or zero length, will return empty string. */
+ if ((arg_count == 3) && (length <= 0) &&
+ (length == 0 || !args[2]->unsigned_flag))
return &my_empty_string;
/* Assumes that the maximum length of a String is < INT_MAX32. */
@@ -2220,7 +2239,7 @@ String *Item_func_make_set::val_str(String *str)
}
-Item *Item_func_make_set::transform(Item_transformer transformer, byte *arg)
+Item *Item_func_make_set::transform(Item_transformer transformer, uchar *arg)
{
DBUG_ASSERT(!current_thd->is_stmt_prepare());
@@ -2701,7 +2720,8 @@ void Item_func_set_collation::fix_length_and_dec()
colname, args[0]->collation.collation->csname);
return;
}
- collation.set(set_collation, DERIVATION_EXPLICIT);
+ collation.set(set_collation, DERIVATION_EXPLICIT,
+ args[0]->collation.repertoire);
max_length= args[0]->max_length;
}
@@ -2903,7 +2923,7 @@ String *Item_load_file::val_str(String *str)
goto err;
if ((file = my_open(file_name->c_ptr(), O_RDONLY, MYF(0))) < 0)
goto err;
- if (my_read(file, (byte*) tmp_value.ptr(), stat_info.st_size, MYF(MY_NABP)))
+ if (my_read(file, (uchar*) tmp_value.ptr(), stat_info.st_size, MYF(MY_NABP)))
{
my_close(file, MYF(0));
goto err;
@@ -3363,7 +3383,7 @@ String *Item_func_uuid::val_str(String *str)
*--s=_dig_vec_lower[mac[i] >> 4];
}
randominit(&uuid_rand, tmp + (ulong) server_start_time,
- tmp + thd->status_var.bytes_sent);
+ tmp + (ulong) thd->status_var.bytes_sent);
set_clock_seq_str();
}
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index 60e7de42a9d..155f8457156 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -50,7 +50,6 @@ public:
String *val_str(String *);
void fix_length_and_dec();
const char *func_name() const { return "md5"; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -94,7 +93,6 @@ public:
String *val_str(String *);
void fix_length_and_dec();
const char *func_name() const { return "concat"; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
class Item_func_concat_ws :public Item_str_func
@@ -116,7 +114,6 @@ public:
String *val_str(String *);
void fix_length_and_dec();
const char *func_name() const { return "reverse"; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -148,13 +145,11 @@ class Item_str_conv :public Item_str_func
{
protected:
uint multiply;
- uint (*converter)(CHARSET_INFO *cs, char *src, uint srclen,
- char *dst, uint dstlen);
+ my_charset_conv_case converter;
String tmp_value;
public:
Item_str_conv(Item *item) :Item_str_func(item) {}
String *val_str(String *);
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -163,13 +158,7 @@ class Item_func_lcase :public Item_str_conv
public:
Item_func_lcase(Item *item) :Item_str_conv(item) {}
const char *func_name() const { return "lcase"; }
- void fix_length_and_dec()
- {
- collation.set(args[0]->collation);
- multiply= collation.collation->casedn_multiply;
- converter= collation.collation->cset->casedn;
- max_length= args[0]->max_length * multiply;
- }
+ void fix_length_and_dec();
};
class Item_func_ucase :public Item_str_conv
@@ -177,13 +166,7 @@ class Item_func_ucase :public Item_str_conv
public:
Item_func_ucase(Item *item) :Item_str_conv(item) {}
const char *func_name() const { return "ucase"; }
- void fix_length_and_dec()
- {
- collation.set(args[0]->collation);
- multiply= collation.collation->caseup_multiply;
- converter= collation.collation->cset->caseup;
- max_length= args[0]->max_length * multiply;
- }
+ void fix_length_and_dec();
};
@@ -431,6 +414,10 @@ public:
}
const char *func_name() const { return "user"; }
const char *fully_qualified_func_name() const { return "user()"; }
+ int save_in_field(Field *field, bool no_conversions)
+ {
+ return save_str_value_in_field(field, &str_value);
+ }
};
@@ -455,7 +442,6 @@ public:
String *val_str(String *);
void fix_length_and_dec();
const char *func_name() const { return "soundex"; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -491,12 +477,12 @@ public:
void update_used_tables();
const char *func_name() const { return "make_set"; }
- bool walk(Item_processor processor, bool walk_subquery, byte *arg)
+ bool walk(Item_processor processor, bool walk_subquery, uchar *arg)
{
return item->walk(processor, walk_subquery, arg) ||
Item_str_func::walk(processor, walk_subquery, arg);
}
- Item *transform(Item_transformer transformer, byte *arg);
+ Item *transform(Item_transformer transformer, uchar *arg);
void print(String *str);
};
@@ -549,7 +535,6 @@ public:
String *val_str(String *);
void fix_length_and_dec();
const char *func_name() const { return "rpad"; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -562,7 +547,6 @@ public:
String *val_str(String *);
void fix_length_and_dec();
const char *func_name() const { return "lpad"; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -577,7 +561,6 @@ public:
collation.set(default_charset());
max_length= 64;
}
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -594,7 +577,6 @@ public:
decimals=0;
max_length=args[0]->max_length*2*collation.collation->mbmaxlen;
}
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
class Item_func_unhex :public Item_str_func
@@ -614,7 +596,6 @@ public:
decimals=0;
max_length=(1+args[0]->max_length)/2;
}
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -638,7 +619,6 @@ public:
}
void print(String *str);
const char *func_name() const { return "cast_as_binary"; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -678,7 +658,6 @@ public:
String* val_str(String* str);
const char *func_name() const { return "inet_ntoa"; }
void fix_length_and_dec() { decimals = 0; max_length=3*8+7; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
class Item_func_quote :public Item_str_func
@@ -693,7 +672,6 @@ public:
collation.set(args[0]->collation);
max_length= args[0]->max_length * 2 + 2;
}
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
class Item_func_conv_charset :public Item_str_func
@@ -794,7 +772,6 @@ public:
const char *func_name() const { return "crc32"; }
void fix_length_and_dec() { max_length=10; }
longlong val_int();
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
class Item_func_uncompressed_length : public Item_int_func
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 8f6503810fc..843c6ced263 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -149,7 +149,7 @@ bool Item_subselect::fix_fields(THD *thd_param, Item **ref)
DBUG_ASSERT(fixed == 0);
engine->set_thd((thd= thd_param));
- if (check_stack_overrun(thd, STACK_MIN_SIZE, (gptr)&res))
+ if (check_stack_overrun(thd, STACK_MIN_SIZE, (uchar*)&res))
return TRUE;
res= engine->prepare();
@@ -206,7 +206,7 @@ err:
bool Item_subselect::walk(Item_processor processor, bool walk_subquery,
- byte *argument)
+ uchar *argument)
{
if (walk_subquery)
@@ -449,7 +449,7 @@ Item_singlerow_subselect::select_transformer(JOIN *join)
'upper' select is not really dependent => we remove this dependence
*/
substitution->walk(&Item::remove_dependence_processor, 0,
- (byte *) select_lex->outer_select());
+ (uchar *) select_lex->outer_select());
return RES_REDUCE;
}
return RES_OK;
@@ -624,7 +624,7 @@ void Item_exists_subselect::print(String *str)
}
-bool Item_in_subselect::test_limit(SELECT_LEX_UNIT *unit_arg)
+bool Item_in_subselect::test_limit(st_select_lex_unit *unit_arg)
{
if (unit_arg->fake_select_lex &&
unit_arg->fake_select_lex->test_limit())
@@ -818,6 +818,11 @@ bool Item_in_subselect::val_bool()
if (exec())
{
reset();
+ /*
+ Must mark the IN predicate as NULL so as to make sure an enclosing NOT
+ predicate will return FALSE. See the comments in
+ subselect_uniquesubquery_engine::copy_ref_key for further details.
+ */
null_value= 1;
return 0;
}
@@ -980,7 +985,8 @@ Item_in_subselect::single_value_transformer(JOIN *join,
DBUG_RETURN(RES_ERROR);
thd->lex->allow_sum_func= save_allow_sum_func;
/* we added aggregate function => we have to change statistic */
- count_field_types(&join->tmp_table_param, join->all_fields, 0);
+ count_field_types(select_lex, &join->tmp_table_param, join->all_fields,
+ 0);
subs= new Item_singlerow_subselect(select_lex);
}
@@ -1872,6 +1878,8 @@ int subselect_single_select_engine::exec()
if (cond_guard && !*cond_guard)
{
/* 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.record= tab->table->record[0];
tab->read_record.thd= join->thd;
@@ -1892,8 +1900,8 @@ int subselect_single_select_engine::exec()
JOIN_TAB *tab= *ptab;
tab->read_record.record= 0;
tab->read_record.ref_length= 0;
- tab->read_first_record= join_read_always_key_or_null;
- tab->read_record.read_record= join_read_next_same_or_null;
+ tab->read_first_record= tab->save_read_first_record;
+ tab->read_record.read_record= tab->save_read_record;
}
executed= 1;
thd->where= save_where;
@@ -1977,10 +1985,38 @@ int subselect_uniquesubquery_engine::scan_table()
DESCRIPTION
Copy ref key and check for null parts in it.
+ Depending on the nullability and conversion problems this function
+ recognizes and processes the following states :
+ 1. Partial match on top level. This means IN has a value of FALSE
+ regardless of the data in the subquery table.
+ Detected by finding a NULL in the left IN operand of a top level
+ expression.
+ We may actually skip reading the subquery, so return TRUE to skip
+ the table scan in subselect_uniquesubquery_engine::exec and make
+ the value of the IN predicate a NULL (that is equal to FALSE on
+ top level).
+ 2. No exact match when IN is nested inside another predicate.
+ Detected by finding a NULL in the left IN operand when IN is not
+ a top level predicate.
+ We cannot have an exact match. But we must proceed further with a
+ table scan to find out if it's a partial match (and IN has a value
+ of NULL) or no match (and IN has a value of FALSE).
+ So we return FALSE to continue with the scan and see if there are
+ any record that would constitute a partial match (as we cannot
+ determine that from the index).
+ 3. Error converting the left IN operand to the column type of the
+ right IN operand. This counts as no match (and IN has the value of
+ FALSE). We mark the subquery table cursor as having no more rows
+ (to ensure that the processing that follows will not find a match)
+ and return FALSE, so IN is not treated as returning NULL.
+
RETURN
- FALSE - ok, index lookup key without keys copied.
- TRUE - an error occured while copying the key
+ FALSE - The value of the IN predicate is not known. Proceed to find the
+ value of the IN predicate using the determined values of
+ null_keypart and table->status.
+ TRUE - IN predicate has a value of NULL. Stop the processing right there
+ and return NULL to the outer predicates.
*/
bool subselect_uniquesubquery_engine::copy_ref_key()
@@ -2000,13 +2036,37 @@ bool subselect_uniquesubquery_engine::copy_ref_key()
function.
*/
null_keypart= (*copy)->null_key;
- bool top_level= ((Item_in_subselect *) item)->is_top_level_item();
- if (null_keypart && !top_level)
- break;
- if ((tab->ref.key_err) & 1 || (null_keypart && top_level))
+ if (null_keypart)
+ {
+ bool top_level= ((Item_in_subselect *) item)->is_top_level_item();
+ if (top_level)
+ {
+ /* Partial match on top level */
+ DBUG_RETURN(1);
+ }
+ else
+ {
+ /* No exact match when IN is nested inside another predicate */
+ break;
+ }
+ }
+
+ /*
+ Check if the error is equal to STORE_KEY_FATAL. This is not expressed
+ using the store_key::store_key_result enum because ref.key_err is a
+ boolean and we want to detect both TRUE and STORE_KEY_FATAL from the
+ space of the union of the values of [TRUE, FALSE] and
+ store_key::store_key_result.
+ TODO: fix the variable an return types.
+ */
+ if (tab->ref.key_err & 1)
{
+ /*
+ Error converting the left IN operand to the column type of the right
+ IN operand.
+ */
tab->table->status= STATUS_NOT_FOUND;
- DBUG_RETURN(1);
+ break;
}
}
DBUG_RETURN(0);
@@ -2049,20 +2109,30 @@ int subselect_uniquesubquery_engine::exec()
int error;
TABLE *table= tab->table;
empty_result_set= TRUE;
+ table->status= 0;
/* TODO: change to use of 'full_scan' here? */
if (copy_ref_key())
DBUG_RETURN(1);
+ if (table->status)
+ {
+ /*
+ We know that there will be no rows even if we scan.
+ Can be set in copy_ref_key.
+ */
+ ((Item_in_subselect *) item)->value= 0;
+ DBUG_RETURN(0);
+ }
if (null_keypart)
DBUG_RETURN(scan_table());
if (!table->file->inited)
table->file->ha_index_init(tab->ref.key, 0);
- error= table->file->index_read(table->record[0],
- tab->ref.key_buff,
- make_prev_keypart_map(tab->ref.key_parts),
- HA_READ_KEY_EXACT);
+ error= table->file->index_read_map(table->record[0],
+ tab->ref.key_buff,
+ make_prev_keypart_map(tab->ref.key_parts),
+ HA_READ_KEY_EXACT);
if (error &&
error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE)
error= report_error(table, error);
@@ -2169,10 +2239,10 @@ int subselect_indexsubquery_engine::exec()
if (!table->file->inited)
table->file->ha_index_init(tab->ref.key, 1);
- error= table->file->index_read(table->record[0],
- tab->ref.key_buff,
- make_prev_keypart_map(tab->ref.key_parts),
- HA_READ_KEY_EXACT);
+ error= table->file->index_read_map(table->record[0],
+ tab->ref.key_buff,
+ make_prev_keypart_map(tab->ref.key_parts),
+ HA_READ_KEY_EXACT);
if (error &&
error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE)
error= report_error(table, error);
diff --git a/sql/item_subselect.h b/sql/item_subselect.h
index 7c21eac6ec3..51ab7b8ad42 100644
--- a/sql/item_subselect.h
+++ b/sql/item_subselect.h
@@ -125,7 +125,7 @@ public:
*/
virtual void reset_value_registration() {}
enum_parsing_place place() { return parsing_place; }
- bool walk(Item_processor processor, bool walk_subquery, byte *arg);
+ bool walk(Item_processor processor, bool walk_subquery, uchar *arg);
/**
Get the SELECT_LEX structure associated with this Item.
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 2eced347650..2684cce16ac 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -403,7 +403,7 @@ Item *Item_sum::get_tmp_table_item(THD *thd)
bool Item_sum::walk (Item_processor processor, bool walk_subquery,
- byte *argument)
+ uchar *argument)
{
if (arg_count)
{
@@ -431,7 +431,7 @@ Field *Item_sum::create_tmp_field(bool group, TABLE *table,
break;
case STRING_RESULT:
if (max_length/collation.collation->mbmaxlen <= 255 ||
- convert_blob_length >=UINT_MAX16 ||
+ convert_blob_length > Field_varstring::MAX_SIZE ||
!convert_blob_length)
return make_string_field(table);
field= new Field_varstring(convert_blob_length, maybe_null,
@@ -912,8 +912,8 @@ void Item_sum_distinct::fix_length_and_dec()
bool Item_sum_distinct::setup(THD *thd)
{
- List<create_field> field_list;
- create_field field_def; /* field definition */
+ List<Create_field> field_list;
+ Create_field field_def; /* field definition */
DBUG_ENTER("Item_sum_distinct::setup");
DBUG_ASSERT(tree == 0);
@@ -1434,7 +1434,7 @@ my_decimal *Item_sum_variance::val_decimal(my_decimal *dec_buf)
void Item_sum_variance::reset_field()
{
double nr;
- char *res= result_field->ptr;
+ uchar *res= result_field->ptr;
nr= args[0]->val_real(); /* sets null_value as side-effect */
@@ -1457,7 +1457,7 @@ void Item_sum_variance::reset_field()
void Item_sum_variance::update_field()
{
ulonglong field_count;
- char *res=result_field->ptr;
+ uchar *res=result_field->ptr;
double nr= args[0]->val_real(); /* sets null_value as side-effect */
@@ -1821,7 +1821,7 @@ bool Item_sum_and::add()
void Item_sum_num::reset_field()
{
double nr= args[0]->val_real();
- char *res=result_field->ptr;
+ uchar *res=result_field->ptr;
if (maybe_null)
{
@@ -1943,7 +1943,7 @@ void Item_sum_sum::reset_field()
void Item_sum_count::reset_field()
{
- char *res=result_field->ptr;
+ uchar *res=result_field->ptr;
longlong nr=0;
if (!args[0]->maybe_null || !args[0]->is_null())
@@ -1954,7 +1954,7 @@ void Item_sum_count::reset_field()
void Item_sum_avg::reset_field()
{
- char *res=result_field->ptr;
+ uchar *res=result_field->ptr;
if (hybrid_type == DECIMAL_RESULT)
{
longlong tmp;
@@ -1995,7 +1995,7 @@ void Item_sum_bit::reset_field()
void Item_sum_bit::update_field()
{
- char *res=result_field->ptr;
+ uchar *res=result_field->ptr;
bits= uint8korr(res);
add();
int8store(res, bits);
@@ -2030,7 +2030,7 @@ void Item_sum_sum::update_field()
else
{
double old_nr,nr;
- char *res=result_field->ptr;
+ uchar *res=result_field->ptr;
float8get(old_nr,res);
nr= args[0]->val_real();
@@ -2047,7 +2047,7 @@ void Item_sum_sum::update_field()
void Item_sum_count::update_field()
{
longlong nr;
- char *res=result_field->ptr;
+ uchar *res=result_field->ptr;
nr=sint8korr(res);
if (!args[0]->maybe_null || !args[0]->is_null())
@@ -2059,7 +2059,7 @@ void Item_sum_count::update_field()
void Item_sum_avg::update_field()
{
longlong field_count;
- char *res=result_field->ptr;
+ uchar *res=result_field->ptr;
if (hybrid_type == DECIMAL_RESULT)
{
my_decimal value, *arg_val= args[0]->val_decimal(&value);
@@ -2228,7 +2228,7 @@ double Item_avg_field::val_real()
// fix_fields() never calls for this Item
double nr;
longlong count;
- char *res;
+ uchar *res;
if (hybrid_type == DECIMAL_RESULT)
return val_real_from_decimal();
@@ -2361,10 +2361,10 @@ double Item_variance_field::val_real()
** COUNT(DISTINCT ...)
****************************************************************************/
-int simple_str_key_cmp(void* arg, byte* key1, byte* key2)
+int simple_str_key_cmp(void* arg, uchar* key1, uchar* key2)
{
Field *f= (Field*) arg;
- return f->cmp((const char*)key1, (const char*)key2);
+ return f->cmp(key1, key2);
}
/*
@@ -2374,7 +2374,7 @@ int simple_str_key_cmp(void* arg, byte* key1, byte* key2)
static
*/
-int composite_key_cmp(void* arg, byte* key1, byte* key2)
+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;
@@ -2384,7 +2384,7 @@ int composite_key_cmp(void* arg, byte* key1, byte* key2)
{
Field* f = *field;
int len = *lengths++;
- int res = f->cmp((char *) key1, (char *) key2);
+ int res = f->cmp(key1, key2);
if (res)
return res;
key1 += len;
@@ -2480,9 +2480,26 @@ bool Item_sum_count_distinct::setup(THD *thd)
}
if (always_null)
return FALSE;
- count_field_types(tmp_table_param,list,0);
+ 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),
@@ -2491,7 +2508,7 @@ bool Item_sum_count_distinct::setup(THD *thd)
table->file->extra(HA_EXTRA_NO_ROWS); // Don't update rows
table->no_rows=1;
- if (table->s->db_type == heap_hton)
+ if (table->s->db_type() == heap_hton)
{
/*
No blobs, otherwise it would have been MyISAM: set up a compare
@@ -2839,8 +2856,8 @@ String *Item_sum_udf_str::val_str(String *str)
GROUP_CONCAT(DISTINCT expr,...)
*/
-int group_concat_key_cmp_with_distinct(void* arg, byte* key1,
- byte* key2)
+int group_concat_key_cmp_with_distinct(void* arg, uchar* key1,
+ uchar* key2)
{
Item_func_group_concat* grp_item= (Item_func_group_concat*)arg;
TABLE *table= grp_item->table;
@@ -2865,7 +2882,7 @@ int group_concat_key_cmp_with_distinct(void* arg, byte* key1,
int res;
uint offset= (field->offset(field->table->record[0]) -
table->s->null_bytes);
- if ((res= field->cmp((char *) key1 + offset, (char *) key2 + offset)))
+ if ((res= field->cmp(key1 + offset, key2 + offset)))
return res;
}
}
@@ -2878,7 +2895,7 @@ int group_concat_key_cmp_with_distinct(void* arg, byte* key1,
GROUP_CONCAT(expr,... ORDER BY col,... )
*/
-int group_concat_key_cmp_with_order(void* arg, byte* key1, byte* key2)
+int group_concat_key_cmp_with_order(void* arg, uchar* key1, uchar* key2)
{
Item_func_group_concat* grp_item= (Item_func_group_concat*) arg;
ORDER **order_item, **end;
@@ -2904,7 +2921,7 @@ int group_concat_key_cmp_with_order(void* arg, byte* key1, byte* key2)
int res;
uint offset= (field->offset(field->table->record[0]) -
table->s->null_bytes);
- if ((res= field->cmp((char *) key1 + offset, (char *) key2 + offset)))
+ if ((res= field->cmp(key1 + offset, key2 + offset)))
return (*order_item)->asc ? res : -res;
}
}
@@ -2927,8 +2944,8 @@ int group_concat_key_cmp_with_order(void* arg, byte* key1, byte* key2)
the duplicated values when inserting things sorted by ORDER BY
*/
-int group_concat_key_cmp_with_distinct_and_order(void* arg,byte* key1,
- byte* key2)
+int group_concat_key_cmp_with_distinct_and_order(void* arg,uchar* key1,
+ uchar* key2)
{
if (!group_concat_key_cmp_with_distinct(arg,key1,key2))
return 0;
@@ -2940,7 +2957,7 @@ int group_concat_key_cmp_with_distinct_and_order(void* arg,byte* key1,
Append data from current leaf to item->result
*/
-int dump_leaf_key(byte* key, element_count count __attribute__((unused)),
+int dump_leaf_key(uchar* key, element_count count __attribute__((unused)),
Item_func_group_concat *item)
{
TABLE *table= item->table;
@@ -2974,7 +2991,7 @@ int dump_leaf_key(byte* key, element_count count __attribute__((unused)),
uint offset= (field->offset(field->table->record[0]) -
table->s->null_bytes);
DBUG_ASSERT(offset < table->s->reclength);
- res= field->val_str(&tmp, (char *) key + offset);
+ res= field->val_str(&tmp, key + offset);
}
else
res= (*arg)->val_str(&tmp);
@@ -3089,6 +3106,7 @@ Item_func_group_concat::Item_func_group_concat(THD *thd,
original(item)
{
quick_group= item->quick_group;
+ result.set_charset(collation.collation);
}
@@ -3230,6 +3248,27 @@ Item_func_group_concat::fix_fields(THD *thd, Item **ref)
null_value= 1;
max_length= thd->variables.group_concat_max_len;
+ uint32 offset;
+ if (separator->needs_conversion(separator->length(), separator->charset(),
+ collation.collation, &offset))
+ {
+ uint32 buflen= collation.collation->mbmaxlen * separator->length();
+ uint errors, conv_length;
+ char *buf;
+ String *new_separator;
+
+ if (!(buf= (char*) thd->stmt_arena->alloc(buflen)) ||
+ !(new_separator= new(thd->stmt_arena->mem_root)
+ String(buf, buflen, collation.collation)))
+ return TRUE;
+
+ conv_length= copy_and_convert(buf, buflen, collation.collation,
+ separator->ptr(), separator->length(),
+ separator->charset(), &errors);
+ new_separator->length(conv_length);
+ separator= new_separator;
+ }
+
if (check_sum_func(thd, ref))
return TRUE;
@@ -3286,18 +3325,24 @@ bool Item_func_group_concat::setup(THD *thd)
setup_order(thd, args, context->table_list, list, all_fields, *order))
DBUG_RETURN(TRUE);
- count_field_types(tmp_table_param,all_fields,0);
+ count_field_types(select_lex, tmp_table_param, all_fields, 0);
tmp_table_param->force_copy_fields= force_copy_fields;
DBUG_ASSERT(table == 0);
/*
+ Currently we have to force conversion of BLOB values to VARCHAR's
+ if we are to store them in TREE objects used for ORDER BY and
+ DISTINCT. This leads to truncation if the BLOB's size exceeds
+ Field_varstring::MAX_SIZE.
+ */
+ if (arg_count_order > 0 || distinct)
+ set_if_smaller(tmp_table_param->convert_blob_length,
+ Field_varstring::MAX_SIZE);
+ /*
We have to create a temporary table to get descriptions of fields
(types, sizes and so on).
Note that in the table, we first have the ORDER BY fields, then the
field list.
-
- We need to set set_sum_field in true for storing value of blob in buffer
- of a record instead of a pointer of one.
*/
if (!(table= create_tmp_table(thd, tmp_table_param, all_fields,
(ORDER*) 0, 0, TRUE,
@@ -3360,6 +3405,10 @@ String* Item_func_group_concat::val_str(String* str)
DBUG_ASSERT(fixed == 1);
if (null_value)
return 0;
+ if (!result.length() && tree)
+ /* 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)
{
/*
@@ -3371,11 +3420,6 @@ String* Item_func_group_concat::val_str(String* str)
ER_CUT_VALUE_GROUP_CONCAT,
ER(ER_CUT_VALUE_GROUP_CONCAT));
}
- if (result.length())
- return &result;
- if (tree)
- tree_walk(tree, (tree_walk_action)&dump_leaf_key, (void*)this,
- left_root_right);
return &result;
}
diff --git a/sql/item_sum.h b/sql/item_sum.h
index 5cf4f93af0e..b3a382012f1 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -361,7 +361,7 @@ public:
Item *get_tmp_table_item(THD *thd);
virtual Field *create_tmp_field(bool group, TABLE *table,
uint convert_blob_length);
- bool walk(Item_processor processor, bool walk_subquery, byte *argument);
+ bool walk(Item_processor processor, bool walk_subquery, uchar *argument);
bool init_sum_func_check(THD *thd);
bool check_sum_func(THD *thd, Item **ref);
bool register_sum_func(THD *thd, Item **ref);
@@ -587,8 +587,8 @@ class Item_sum_count_distinct :public Item_sum_int
bool always_null; // Set to 1 if the result is always NULL
- friend int composite_key_cmp(void* arg, byte* key1, byte* key2);
- friend int simple_str_key_cmp(void* arg, byte* key1, byte* key2);
+ 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)
@@ -966,8 +966,15 @@ public:
bool fix_fields(THD *thd, Item **ref)
{
DBUG_ASSERT(fixed == 0);
+
+ if (init_sum_func_check(thd))
+ return TRUE;
+
fixed= 1;
- return udf.fix_fields(thd, this, this->arg_count, this->args);
+ if (udf.fix_fields(thd, this, this->arg_count, this->args))
+ return TRUE;
+
+ return check_sum_func(thd, ref);
}
enum Sumfunctype sum_func () const { return UDF_SUM_FUNC; }
virtual bool have_field_update(void) const { return 0; }
@@ -1183,14 +1190,14 @@ class Item_func_group_concat : public Item_sum
*/
Item_func_group_concat *original;
- friend int group_concat_key_cmp_with_distinct(void* arg, byte* key1,
- byte* key2);
- friend int group_concat_key_cmp_with_order(void* arg, byte* key1,
- byte* key2);
+ friend int group_concat_key_cmp_with_distinct(void* arg, uchar* key1,
+ uchar* key2);
+ friend int group_concat_key_cmp_with_order(void* arg, uchar* key1,
+ uchar* key2);
friend int group_concat_key_cmp_with_distinct_and_order(void* arg,
- byte* key1,
- byte* key2);
- friend int dump_leaf_key(byte* key,
+ uchar* key1,
+ uchar* key2);
+ friend int dump_leaf_key(uchar* key,
element_count count __attribute__((unused)),
Item_func_group_concat *group_concat_item);
@@ -1243,6 +1250,6 @@ public:
Item *copy_or_same(THD* thd);
void no_rows_in_result() {}
void print(String *str);
- virtual bool change_context_processor(byte *cntx)
+ virtual bool change_context_processor(uchar *cntx)
{ context= (Name_resolution_context *)cntx; return FALSE; }
};
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 0fd57264784..300d0788f55 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -51,7 +51,7 @@ static bool make_datetime(date_time_format_types format, MYSQL_TIME *ltime,
{
char *buff;
CHARSET_INFO *cs= &my_charset_bin;
- uint length= 30;
+ uint length= MAX_DATE_STRING_REP_LENGTH;
if (str->alloc(length))
return 1;
@@ -597,7 +597,7 @@ err:
strmake(buff, val_begin, min(length, sizeof(buff)-1));
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
ER_WRONG_VALUE_FOR_TYPE, ER(ER_WRONG_VALUE_FOR_TYPE),
- date_time_type, buff, "str_to_time");
+ date_time_type, buff, "str_to_date");
}
DBUG_RETURN(1);
}
@@ -886,9 +886,9 @@ static bool get_interval_info(const char *str,uint length,CHARSET_INFO *cs,
{
i++;
/* Change values[0...i-1] -> values[0...count-1] */
- bmove_upp((char*) (values+count), (char*) (values+i),
+ bmove_upp((uchar*) (values+count), (uchar*) (values+i),
sizeof(*values)*i);
- bzero((char*) values, sizeof(*values)*(count-i));
+ bzero((uchar*) values, sizeof(*values)*(count-i));
break;
}
}
@@ -962,6 +962,44 @@ enum_monotonicity_info Item_func_to_days::get_monotonicity_info() const
}
+longlong Item_func_to_days::val_int_endpoint(bool left_endp, bool *incl_endp)
+{
+ DBUG_ASSERT(fixed == 1);
+ MYSQL_TIME ltime;
+ longlong res;
+ if (get_arg0_date(&ltime, TIME_NO_ZERO_DATE))
+ {
+ /* got NULL, leave the incl_endp intact */
+ return LONGLONG_MIN;
+ }
+ res=(longlong) calc_daynr(ltime.year,ltime.month,ltime.day);
+
+ if (args[0]->field_type() == MYSQL_TYPE_DATE)
+ {
+ // TO_DAYS() is strictly monotonic for dates, leave incl_endp intact
+ return res;
+ }
+
+ /*
+ Handle the special but practically useful case of datetime values that
+ point to day bound ("strictly less" comparison stays intact):
+
+ col < '2007-09-15 00:00:00' -> TO_DAYS(col) < TO_DAYS('2007-09-15')
+
+ which is different from the general case ("strictly less" changes to
+ "less or equal"):
+
+ col < '2007-09-15 12:34:56' -> TO_DAYS(col) <= TO_DAYS('2007-09-15')
+ */
+ if (!left_endp && !(ltime.hour || ltime.minute || ltime.second ||
+ ltime.second_part))
+ ; /* do nothing */
+ else
+ *incl_endp= TRUE;
+ return res;
+}
+
+
longlong Item_func_dayofyear::val_int()
{
DBUG_ASSERT(fixed == 1);
@@ -1152,7 +1190,7 @@ longlong Item_func_year::val_int()
Get information about this Item tree monotonicity
SYNOPSIS
- Item_func_to_days::get_monotonicity_info()
+ Item_func_year::get_monotonicity_info()
DESCRIPTION
Get information about monotonicity of the function represented by this item
@@ -1171,6 +1209,37 @@ enum_monotonicity_info Item_func_year::get_monotonicity_info() const
return NON_MONOTONIC;
}
+
+longlong Item_func_year::val_int_endpoint(bool left_endp, bool *incl_endp)
+{
+ DBUG_ASSERT(fixed == 1);
+ MYSQL_TIME ltime;
+ if (get_arg0_date(&ltime, TIME_FUZZY_DATE))
+ {
+ /* got NULL, leave the incl_endp intact */
+ return LONGLONG_MIN;
+ }
+
+ /*
+ Handle the special but practically useful case of datetime values that
+ point to year bound ("strictly less" comparison stays intact) :
+
+ col < '2007-01-01 00:00:00' -> YEAR(col) < 2007
+
+ which is different from the general case ("strictly less" changes to
+ "less or equal"):
+
+ col < '2007-09-15 23:00:00' -> YEAR(col) <= 2007
+ */
+ if (!left_endp && ltime.day == 1 && ltime.month == 1 &&
+ !(ltime.hour || ltime.minute || ltime.second || ltime.second_part))
+ ; /* do nothing */
+ else
+ *incl_endp= TRUE;
+ return ltime.year;
+}
+
+
longlong Item_func_unix_timestamp::val_int()
{
MYSQL_TIME ltime;
@@ -1223,7 +1292,7 @@ bool get_interval_value(Item *args,interval_type int_type,
ulonglong array[5];
longlong value;
const char *str;
- uint32 length;
+ size_t length;
CHARSET_INFO *cs=str_value->charset();
LINT_INIT(value);
@@ -1258,7 +1327,7 @@ bool get_interval_value(Item *args,interval_type int_type,
interval->neg=1;
str++;
}
- length=(uint32) (end-str); // Set up pointers to new str
+ length= (size_t) (end-str); // Set up pointers to new str
}
switch (int_type) {
@@ -1379,7 +1448,7 @@ String *Item_date::val_str(String *str)
MYSQL_TIME ltime;
if (get_date(&ltime, TIME_FUZZY_DATE))
return (String *) 0;
- if (str->alloc(11))
+ if (str->alloc(MAX_DATE_STRING_REP_LENGTH))
{
null_value= 1;
return (String *) 0;
@@ -1428,7 +1497,7 @@ void Item_func_curdate::fix_length_and_dec()
String *Item_func_curdate::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
- if (str->alloc(11))
+ if (str->alloc(MAX_DATE_STRING_REP_LENGTH))
{
null_value= 1;
return (String *) 0;
@@ -1594,7 +1663,7 @@ int Item_func_now::save_in_field(Field *to, bool no_conversions)
void Item_func_sysdate_local::store_now_in_TIME(MYSQL_TIME *now_time)
{
THD *thd= current_thd;
- thd->variables.time_zone->gmt_sec_to_TIME(now_time, (my_time_t) time(NULL));
+ thd->variables.time_zone->gmt_sec_to_TIME(now_time, (my_time_t) my_time(0));
thd->time_zone_used= 1;
}
@@ -1657,7 +1726,8 @@ String *Item_func_sec_to_time::val_str(String *str)
MYSQL_TIME ltime;
longlong arg_val= args[0]->val_int();
- if ((null_value=args[0]->null_value) || str->alloc(19))
+ if ((null_value=args[0]->null_value) ||
+ str->alloc(MAX_DATE_STRING_REP_LENGTH))
{
null_value= 1;
return (String*) 0;
@@ -1696,7 +1766,11 @@ void Item_func_date_format::fix_length_and_dec()
Item *arg1= args[1]->this_item();
decimals=0;
- collation.set(thd->variables.collation_connection);
+ CHARSET_INFO *cs= thd->variables.collation_connection;
+ uint32 repertoire= arg1->collation.repertoire;
+ if (!thd->variables.lc_time_names->is_ascii)
+ repertoire|= MY_REPERTOIRE_EXTENDED;
+ collation.set(cs, arg1->collation.derivation, repertoire);
if (arg1->type() == STRING_ITEM)
{ // Optimize the normal case
fixed_length=1;
@@ -1842,6 +1916,10 @@ String *Item_func_date_format::val_str(String *str)
size=max_length;
else
size=format_length(format);
+
+ if (size < MAX_DATE_STRING_REP_LENGTH)
+ size= MAX_DATE_STRING_REP_LENGTH;
+
if (format == str)
str= &value; // Save result here
if (str->alloc(size))
@@ -1885,13 +1963,14 @@ String *Item_func_from_unixtime::val_str(String *str)
if (get_date(&time_tmp, 0))
return 0;
- if (str->alloc(20*MY_CHARSET_BIN_MB_MAXLEN))
+ if (str->alloc(MAX_DATE_STRING_REP_LENGTH))
{
null_value= 1;
return 0;
}
make_datetime((DATE_TIME_FORMAT *) 0, &time_tmp, str);
+
return str;
}
@@ -1940,14 +2019,15 @@ String *Item_func_convert_tz::val_str(String *str)
if (get_date(&time_tmp, 0))
return 0;
-
- if (str->alloc(20*MY_CHARSET_BIN_MB_MAXLEN))
+
+ if (str->alloc(MAX_DATE_STRING_REP_LENGTH))
{
null_value= 1;
return 0;
}
-
+
make_datetime((DATE_TIME_FORMAT *) 0, &time_tmp, str);
+
return str;
}
@@ -2058,27 +2138,6 @@ bool Item_date_add_interval::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
if ((null_value= date_add_interval(ltime, int_type, interval)))
return 1;
-
- /* Adjust cached_field_type according to the detected type. */
- if (cached_field_type == MYSQL_TYPE_STRING)
- {
- switch (ltime->time_type)
- {
- case MYSQL_TIMESTAMP_DATE:
- cached_field_type= MYSQL_TYPE_DATE;
- break;
- case MYSQL_TIMESTAMP_DATETIME:
- cached_field_type= MYSQL_TYPE_DATETIME;
- break;
- case MYSQL_TIMESTAMP_TIME:
- cached_field_type= MYSQL_TYPE_TIME;
- break;
- default:
- /* Shouldn't get here. */
- DBUG_ASSERT(0);
- break;
- }
- }
return 0;
}
@@ -2454,6 +2513,7 @@ String *Item_datetime_typecast::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
MYSQL_TIME ltime;
+
if (!get_arg0_date(&ltime, TIME_FUZZY_DATE) &&
!make_datetime(ltime.second_part ? DATE_TIME_MICROSECOND : DATE_TIME,
&ltime, str))
@@ -2532,7 +2592,8 @@ String *Item_date_typecast::val_str(String *str)
DBUG_ASSERT(fixed == 1);
MYSQL_TIME ltime;
- if (!get_arg0_date(&ltime, TIME_FUZZY_DATE) && !str->alloc(11))
+ if (!get_arg0_date(&ltime, TIME_FUZZY_DATE) &&
+ !str->alloc(MAX_DATE_STRING_REP_LENGTH))
{
make_date((DATE_TIME_FORMAT *) 0, &ltime, str);
return str;
@@ -2546,11 +2607,8 @@ longlong Item_date_typecast::val_int()
{
DBUG_ASSERT(fixed == 1);
MYSQL_TIME ltime;
- if (args[0]->get_date(&ltime, TIME_FUZZY_DATE))
- {
- null_value= 1;
+ if ((null_value= args[0]->get_date(&ltime, TIME_FUZZY_DATE)))
return 0;
- }
return (longlong) (ltime.year * 10000L + ltime.month * 100 + ltime.day);
}
@@ -2585,7 +2643,7 @@ String *Item_func_makedate::val_str(String *str)
{
null_value=0;
get_date_from_daynr(days,&l_time.year,&l_time.month,&l_time.day);
- if (str->alloc(11))
+ if (str->alloc(MAX_DATE_STRING_REP_LENGTH))
goto err;
make_date((DATE_TIME_FORMAT *) 0, &l_time, str);
return str;
@@ -2721,6 +2779,7 @@ String *Item_func_add_time::val_str(String *str)
days= (long)(seconds/86400L);
calc_time_from_sec(&l_time3, (long)(seconds%86400L), microseconds);
+
if (!is_time)
{
get_date_from_daynr(days,&l_time3.year,&l_time3.month,&l_time3.day);
@@ -2836,7 +2895,7 @@ String *Item_func_maketime::val_str(String *str)
args[2]->null_value ||
minute < 0 || minute > 59 ||
second < 0 || second > 59 ||
- str->alloc(19))))
+ str->alloc(MAX_DATE_STRING_REP_LENGTH))))
return 0;
bzero((char *)&ltime, sizeof(ltime));
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index 992b79753ca..36556269d07 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -38,7 +38,6 @@ public:
{
max_length=6*MY_CHARSET_BIN_MB_MAXLEN;
}
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -53,7 +52,6 @@ public:
decimals=0;
max_length=6*MY_CHARSET_BIN_MB_MAXLEN;
}
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -70,7 +68,8 @@ public:
maybe_null=1;
}
enum_monotonicity_info get_monotonicity_info() const;
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
+ longlong val_int_endpoint(bool left_endp, bool *incl_endp);
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -86,7 +85,7 @@ public:
max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
maybe_null=1;
}
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -111,7 +110,7 @@ public:
max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
maybe_null=1;
}
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -129,6 +128,7 @@ public:
max_length=10*my_charset_bin.mbmaxlen;
maybe_null=1;
}
+ bool check_partition_func_processor(uchar *int_arg) {return TRUE;}
};
@@ -144,7 +144,7 @@ public:
max_length=3*MY_CHARSET_BIN_MB_MAXLEN;
maybe_null=1;
}
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -160,7 +160,7 @@ public:
max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
maybe_null=1;
}
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -176,7 +176,7 @@ public:
max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
maybe_null=1;
}
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -192,7 +192,7 @@ public:
max_length=1*MY_CHARSET_BIN_MB_MAXLEN;
maybe_null=1;
}
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -208,7 +208,7 @@ public:
max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
maybe_null=1;
}
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -224,7 +224,6 @@ public:
max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
maybe_null=1;
}
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
class Item_func_yearweek :public Item_int_func
@@ -239,7 +238,7 @@ public:
max_length=6*MY_CHARSET_BIN_MB_MAXLEN;
maybe_null=1;
}
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -250,13 +249,14 @@ public:
longlong val_int();
const char *func_name() const { return "year"; }
enum_monotonicity_info get_monotonicity_info() const;
+ longlong val_int_endpoint(bool left_endp, bool *incl_endp);
void fix_length_and_dec()
{
decimals=0;
max_length=4*MY_CHARSET_BIN_MB_MAXLEN;
maybe_null=1;
}
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -286,7 +286,7 @@ public:
max_length=1*MY_CHARSET_BIN_MB_MAXLEN;
maybe_null=1;
}
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
class Item_func_dayname :public Item_func_weekday
@@ -303,6 +303,7 @@ class Item_func_dayname :public Item_func_weekday
max_length=9*MY_CHARSET_BIN_MB_MAXLEN;
maybe_null=1;
}
+ bool check_partition_func_processor(uchar *int_arg) {return TRUE;}
};
@@ -319,7 +320,6 @@ public:
decimals=0;
max_length=10*MY_CHARSET_BIN_MB_MAXLEN;
}
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -334,7 +334,7 @@ public:
decimals=0;
max_length=10*MY_CHARSET_BIN_MB_MAXLEN;
}
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -585,7 +585,7 @@ public:
Item_func_from_days(Item *a) :Item_date(a) {}
const char *func_name() const { return "from_days"; }
bool get_date(MYSQL_TIME *res, uint fuzzy_date);
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -603,7 +603,6 @@ public:
void fix_length_and_dec();
uint format_length(const String *format);
bool eq(const Item *item, bool binary_cmp) const;
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -617,7 +616,6 @@ class Item_func_from_unixtime :public Item_date_func
const char *func_name() const { return "from_unixtime"; }
void fix_length_and_dec();
bool get_date(MYSQL_TIME *res, uint fuzzy_date);
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -676,7 +674,6 @@ public:
}
const char *func_name() const { return "sec_to_time"; }
bool result_as_longlong() { return TRUE; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -698,7 +695,6 @@ public:
bool get_date(MYSQL_TIME *res, uint fuzzy_date);
bool eq(const Item *item, bool binary_cmp) const;
void print(String *str);
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -716,7 +712,7 @@ class Item_extract :public Item_int_func
void fix_length_and_dec();
bool eq(const Item *item, bool binary_cmp) const;
void print(String *str);
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -753,7 +749,6 @@ public:
max_length=args[0]->max_length;
maybe_null= 1;
}
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -773,7 +768,6 @@ public:
String *val_str(String *a);
void fix_length_and_dec();
void print(String *str);
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -884,7 +878,6 @@ public:
max_length=MAX_DATE_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
}
longlong val_int();
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -907,7 +900,6 @@ public:
}
void print(String *str);
const char *func_name() const { return "add_time"; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
double val_real() { return val_real_from_decimal(); }
my_decimal *val_decimal(my_decimal *decimal_value)
{
@@ -949,7 +941,6 @@ public:
:Item_str_timefunc(a, b ,c) {}
String *val_str(String *str);
const char *func_name() const { return "maketime"; }
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
class Item_func_microsecond :public Item_int_func
@@ -963,7 +954,7 @@ public:
decimals=0;
maybe_null=1;
}
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -981,7 +972,6 @@ public:
maybe_null=1;
}
void print(String *str);
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
@@ -1028,7 +1018,6 @@ public:
{
return tmp_table_field_from_field_type(table, 1);
}
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc
index 26474990644..15be9c97b6e 100644
--- a/sql/item_xmlfunc.cc
+++ b/sql/item_xmlfunc.cc
@@ -19,7 +19,7 @@
#include "mysql_priv.h"
#include "my_xml.h"
-
+#include "sp_pcontext.h"
/*
TODO: future development directions:
@@ -570,13 +570,13 @@ String *Item_nodeset_func_rootelement::val_nodeset(String *nodeset)
String * Item_nodeset_func_union::val_nodeset(String *nodeset)
{
- uint numnodes= pxml->length() / sizeof(MY_XML_NODE);
+ uint num_nodes= pxml->length() / sizeof(MY_XML_NODE);
String set0, *s0= args[0]->val_nodeset(&set0);
String set1, *s1= args[1]->val_nodeset(&set1);
String both_str;
- both_str.alloc(numnodes);
+ both_str.alloc(num_nodes);
char *both= (char*) both_str.ptr();
- bzero((void*)both, numnodes);
+ bzero((void*)both, num_nodes);
MY_XPATH_FLT *flt;
fltbeg= (MY_XPATH_FLT*) s0->ptr();
@@ -590,7 +590,7 @@ String * Item_nodeset_func_union::val_nodeset(String *nodeset)
both[flt->num]= 1;
nodeset->length(0);
- for (uint i= 0, pos= 0; i < numnodes; i++)
+ for (uint i= 0, pos= 0; i < num_nodes; i++)
{
if (both[i])
((XPathFilter*)nodeset)->append_element(i, pos++);
@@ -923,8 +923,8 @@ static Item *create_comparator(MY_XPATH *xpath,
else if (a->type() == Item::XPATH_NODESET &&
b->type() == Item::XPATH_NODESET)
{
- uint len= context->end - context->beg;
- set_if_bigger(len, 32);
+ uint len= xpath->query.end - context->beg;
+ set_if_smaller(len, 32);
my_printf_error(ER_UNKNOWN_ERROR,
"XPATH error: "
"comparison of two nodesets is not supported: '%.*s'",
@@ -2412,21 +2412,78 @@ my_xpath_parse_QName(MY_XPATH *xpath)
}
-/*
+/**
Scan Variable reference
- SYNOPSYS
+ @details Implements parsing of two syntax structures:
- [36] VariableReference ::= '$' QName
- RETURN
- 1 - success
- 0 - failure
+ 1. Standard XPath syntax [36], for SP variables:
+
+ VariableReference ::= '$' QName
+
+ Finds a SP variable with the given name.
+ If outside of a SP context, or variable with
+ the given name doesn't exists, then error is returned.
+
+ 2. Non-standard syntax - MySQL extension for user variables:
+
+ VariableReference ::= '$' '@' QName
+
+ Item, corresponding to the variable, is returned
+ in xpath->item in both cases.
+
+ @param xpath pointer to XPath structure
+
+ @return Operation status
+ @retval 1 Success
+ @retval 0 Failure
*/
+
static int
my_xpath_parse_VariableReference(MY_XPATH *xpath)
{
- return my_xpath_parse_term(xpath, MY_XPATH_LEX_DOLLAR) &&
- my_xpath_parse_term(xpath, MY_XPATH_LEX_IDENT);
+ LEX_STRING name;
+ int user_var;
+ const char *dollar_pos;
+ if (!my_xpath_parse_term(xpath, MY_XPATH_LEX_DOLLAR) ||
+ (!(dollar_pos= xpath->prevtok.beg)) ||
+ (!((user_var= my_xpath_parse_term(xpath, MY_XPATH_LEX_AT) &&
+ my_xpath_parse_term(xpath, MY_XPATH_LEX_IDENT))) &&
+ !my_xpath_parse_term(xpath, MY_XPATH_LEX_IDENT)))
+ return 0;
+
+ name.length= xpath->prevtok.end - xpath->prevtok.beg;
+ name.str= (char*) xpath->prevtok.beg;
+
+ if (user_var)
+ xpath->item= new Item_func_get_user_var(name);
+ else
+ {
+ sp_variable_t *spv;
+ sp_pcontext *spc;
+ LEX *lex;
+ if ((lex= current_thd->lex) &&
+ (spc= lex->spcont) &&
+ (spv= spc->find_variable(&name)))
+ {
+ Item_splocal *splocal= new Item_splocal(name, spv->offset, spv->type, 0);
+#ifndef DBUG_OFF
+ if (splocal)
+ splocal->m_sp= lex->sphead;
+#endif
+ xpath->item= (Item*) splocal;
+ }
+ else
+ {
+ xpath->item= NULL;
+ DBUG_ASSERT(xpath->query.end > dollar_pos);
+ uint len= xpath->query.end - dollar_pos;
+ set_if_smaller(len, 32);
+ my_printf_error(ER_UNKNOWN_ERROR, "Unknown XPATH variable at: '%.*s'",
+ MYF(0), len, dollar_pos);
+ }
+ }
+ return xpath->item ? 1 : 0;
}
@@ -2534,12 +2591,10 @@ void Item_xml_str_func::fix_length_and_dec()
if (!rc)
{
- char context[32];
uint clen= xpath.query.end - xpath.lasttok.beg;
- set_if_bigger(clen, sizeof(context) - 1);
- strmake(context, xpath.lasttok.beg, clen);
- my_printf_error(ER_UNKNOWN_ERROR, "XPATH syntax error: '%s'",
- MYF(0), context);
+ set_if_smaller(clen, 32);
+ my_printf_error(ER_UNKNOWN_ERROR, "XPATH syntax error: '%.*s'",
+ MYF(0), clen, xpath.lasttok.beg);
return;
}
@@ -2601,7 +2656,9 @@ static uint xml_parent_tag(MY_XML_NODE *items, uint nitems, uint level)
RETURN
Currently only MY_XML_OK
*/
-static int xml_enter(MY_XML_PARSER *st,const char *attr, uint len)
+extern "C" int xml_enter(MY_XML_PARSER *st,const char *attr, size_t len);
+
+int xml_enter(MY_XML_PARSER *st,const char *attr, size_t len)
{
MY_XML_USER_DATA *data= (MY_XML_USER_DATA*)st->user_data;
MY_XML_NODE *nodes= (MY_XML_NODE*) data->pxml->ptr();
@@ -2632,7 +2689,9 @@ static int xml_enter(MY_XML_PARSER *st,const char *attr, uint len)
RETURN
Currently only MY_XML_OK
*/
-static int xml_value(MY_XML_PARSER *st,const char *attr, uint len)
+extern "C" int xml_value(MY_XML_PARSER *st,const char *attr, size_t len);
+
+int xml_value(MY_XML_PARSER *st,const char *attr, size_t len)
{
MY_XML_USER_DATA *data= (MY_XML_USER_DATA*)st->user_data;
MY_XML_NODE *nodes= (MY_XML_NODE*) data->pxml->ptr();
@@ -2662,7 +2721,9 @@ static int xml_value(MY_XML_PARSER *st,const char *attr, uint len)
RETURN
Currently only MY_XML_OK
*/
-static int xml_leave(MY_XML_PARSER *st,const char *attr, uint len)
+extern "C" int xml_leave(MY_XML_PARSER *st,const char *attr, size_t len);
+
+int xml_leave(MY_XML_PARSER *st,const char *attr, size_t len)
{
MY_XML_USER_DATA *data= (MY_XML_USER_DATA*)st->user_data;
DBUG_ASSERT(data->level > 0);
@@ -2712,9 +2773,9 @@ String *Item_xml_str_func::parse_xml(String *raw_xml, String *parsed_xml_buf)
if ((rc= my_xml_parse(&p, raw_xml->ptr(), raw_xml->length())) != MY_XML_OK)
{
char buf[128];
- my_snprintf(buf, sizeof(buf)-1, "parse error at line %d pos %d: %s",
+ my_snprintf(buf, sizeof(buf)-1, "parse error at line %d pos %lu: %s",
my_xml_error_lineno(&p) + 1,
- my_xml_error_pos(&p) + 1,
+ (ulong) my_xml_error_pos(&p) + 1,
my_xml_error_string(&p));
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WRONG_VALUE,
@@ -2768,6 +2829,16 @@ String *Item_func_xml_update::val_str(String *str)
nodebeg+= fltbeg->num;
+ if (!nodebeg->level)
+ {
+ /*
+ Root element, without NameTest:
+ UpdateXML(xml, '/', 'replacement');
+ Just return the replacement string.
+ */
+ return rep;
+ }
+
tmp_value.length(0);
tmp_value.set_charset(collation.collation);
uint offs= nodebeg->type == MY_XML_NODE_TAG ? 1 : 0;
diff --git a/sql/item_xmlfunc.h b/sql/item_xmlfunc.h
index 9f2860ef403..278c98baf7c 100644
--- a/sql/item_xmlfunc.h
+++ b/sql/item_xmlfunc.h
@@ -41,7 +41,6 @@ public:
Item_func_xml_extractvalue(Item *a,Item *b) :Item_xml_str_func(a,b) {}
const char *func_name() const { return "extractvalue"; }
String *val_str(String *);
- bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
diff --git a/sql/key.cc b/sql/key.cc
index 9a3155c459e..e8354ed2635 100644
--- a/sql/key.cc
+++ b/sql/key.cc
@@ -45,7 +45,7 @@
key_length is set to length of key before (not including) field
*/
-int find_ref_key(KEY *key, uint key_count, byte *record, Field *field,
+int find_ref_key(KEY *key, uint key_count, uchar *record, Field *field,
uint *key_length, uint *keypart)
{
reg2 int i;
@@ -111,7 +111,8 @@ int find_ref_key(KEY *key, uint key_count, byte *record, Field *field,
None
*/
-void key_copy(byte *to_key, byte *from_record, KEY *key_info, uint key_length)
+void key_copy(uchar *to_key, uchar *from_record, KEY *key_info,
+ uint key_length)
{
uint length;
KEY_PART_INFO *key_part;
@@ -131,7 +132,7 @@ void key_copy(byte *to_key, byte *from_record, KEY *key_info, uint key_length)
Field_bit *field= (Field_bit *) (key_part->field);
if (field->bit_len)
{
- uchar bits= get_rec_bits((uchar*) from_record +
+ uchar bits= get_rec_bits(from_record +
key_part->null_offset +
(key_part->null_bit == 128),
field->bit_ofs, field->bit_len);
@@ -144,7 +145,7 @@ void key_copy(byte *to_key, byte *from_record, KEY *key_info, uint key_length)
{
key_length-= HA_KEY_BLOB_LENGTH;
length= min(key_length, key_part->length);
- key_part->field->get_key_image((char*) to_key, length, Field::itRAW);
+ key_part->field->get_key_image(to_key, length, Field::itRAW);
to_key+= HA_KEY_BLOB_LENGTH;
}
else
@@ -152,7 +153,7 @@ void key_copy(byte *to_key, byte *from_record, KEY *key_info, uint key_length)
length= min(key_length, key_part->length);
Field *field= key_part->field;
CHARSET_INFO *cs= field->charset();
- uint bytes= field->get_key_image((char*) to_key, length, Field::itRAW);
+ uint bytes= field->get_key_image(to_key, length, Field::itRAW);
if (bytes < length)
cs->cset->fill(cs, (char*) to_key + bytes, length - bytes, ' ');
}
@@ -180,7 +181,7 @@ void key_copy(byte *to_key, byte *from_record, KEY *key_info, uint key_length)
None
*/
-void key_restore(byte *to_record, byte *from_key, KEY *key_info,
+void key_restore(uchar *to_record, uchar *from_key, KEY *key_info,
uint key_length)
{
uint length;
@@ -226,7 +227,7 @@ void key_restore(byte *to_record, byte *from_key, KEY *key_info,
from_key+= HA_KEY_BLOB_LENGTH;
key_length-= HA_KEY_BLOB_LENGTH;
field->set_ptr_offset(to_record - field->table->record[0],
- (ulong) blob_length, (char*) from_key);
+ (ulong) blob_length, from_key);
length= key_part->length;
}
else if (key_part->key_part_flag & HA_VAR_LENGTH_PART)
@@ -238,7 +239,7 @@ void key_restore(byte *to_record, byte *from_key, KEY *key_info,
key_length-= HA_KEY_BLOB_LENGTH;
length= min(key_length, key_part->length);
old_map= dbug_tmp_use_all_columns(field->table, field->table->write_set);
- field->set_key_image((char *) from_key, length);
+ field->set_key_image(from_key, length);
dbug_tmp_restore_column_map(field->table->write_set, old_map);
from_key+= HA_KEY_BLOB_LENGTH;
field->move_field_offset(-ptrdiff);
@@ -275,11 +276,11 @@ void key_restore(byte *to_record, byte *from_key, KEY *key_info,
1 Key has changed
*/
-bool key_cmp_if_same(TABLE *table,const byte *key,uint idx,uint key_length)
+bool key_cmp_if_same(TABLE *table,const uchar *key,uint idx,uint key_length)
{
uint store_length;
KEY_PART_INFO *key_part;
- const byte *key_end= key + key_length;;
+ const uchar *key_end= key + key_length;;
for (key_part=table->key_info[idx].key_part;
key < key_end ;
@@ -311,7 +312,7 @@ bool key_cmp_if_same(TABLE *table,const byte *key,uint idx,uint key_length)
{
CHARSET_INFO *cs= key_part->field->charset();
uint char_length= key_part->length / cs->mbmaxlen;
- const byte *pos= table->record[0] + key_part->offset;
+ const uchar *pos= table->record[0] + key_part->offset;
if (length > char_length)
{
char_length= my_charpos(cs, pos, pos + length, char_length);
@@ -435,11 +436,11 @@ bool is_key_used(TABLE *table, uint idx, const MY_BITMAP *fields)
1 Key is larger than range
*/
-int key_cmp(KEY_PART_INFO *key_part, const byte *key, uint key_length)
+int key_cmp(KEY_PART_INFO *key_part, const uchar *key, uint key_length)
{
uint store_length;
- for (const byte *end=key + key_length;
+ for (const uchar *end=key + key_length;
key < end;
key+= store_length, key_part++)
{
@@ -462,7 +463,7 @@ int key_cmp(KEY_PART_INFO *key_part, const byte *key, uint key_length)
key++; // Skip null byte
store_length--;
}
- if ((cmp=key_part->field->key_cmp((byte*) key, key_part->length)) < 0)
+ if ((cmp=key_part->field->key_cmp(key, key_part->length)) < 0)
return -1;
if (cmp > 0)
return 1;
@@ -479,6 +480,7 @@ int key_cmp(KEY_PART_INFO *key_part, const byte *key, uint key_length)
rec0 Pointer to table->record[0]
first_rec Pointer to record compare with
second_rec Pointer to record compare against first_rec
+
DESCRIPTION
This method is set-up such that it can be called directly from the
priority queue and it is attempted to be optimised as much as possible
@@ -495,13 +497,13 @@ int key_cmp(KEY_PART_INFO *key_part, const byte *key, uint key_length)
and return the result of the comparison.
*/
-int key_rec_cmp(void *key, byte *first_rec, byte *second_rec)
+int key_rec_cmp(void *key, uchar *first_rec, uchar *second_rec)
{
KEY *key_info= (KEY*)key;
uint key_parts= key_info->key_parts, i= 0;
KEY_PART_INFO *key_part= key_info->key_part;
- char *rec0= key_part->field->ptr - key_part->offset;
- my_ptrdiff_t first_diff= first_rec - (byte*)rec0, sec_diff= second_rec - (byte*)rec0;
+ uchar *rec0= key_part->field->ptr - key_part->offset;
+ my_ptrdiff_t first_diff= first_rec - rec0, sec_diff= second_rec - rec0;
int result= 0;
DBUG_ENTER("key_rec_cmp");
diff --git a/sql/lock.cc b/sql/lock.cc
index 4ce8f4a968d..4f6805b9954 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -60,6 +60,11 @@
- When calling UNLOCK TABLES we call mysql_unlock_tables() for all
tables used in LOCK TABLES
+ If table_handler->external_lock(thd, locktype) fails, we call
+ table_handler->external_lock(thd, F_UNLCK) for each table that was locked,
+ excluding one that caused failure. That means handler must cleanup itself
+ in case external_lock() fails.
+
TODO:
Change to use my_malloc() ONLY when using LOCK TABLES command or when
we are forced to use mysql_lock_merge.
@@ -69,6 +74,11 @@ TODO:
#include <hash.h>
#include <assert.h>
+/**
+ @defgroup Locking Locking
+ @{
+*/
+
extern HASH open_cache;
/* flags for get_lock_data */
@@ -92,6 +102,7 @@ static void print_lock_error(int error, const char *);
count The number of tables to lock.
flags Options:
MYSQL_LOCK_IGNORE_GLOBAL_READ_LOCK Ignore a global read lock
+ MYSQL_LOCK_IGNORE_GLOBAL_READ_ONLY Ignore SET GLOBAL READ_ONLY
MYSQL_LOCK_IGNORE_FLUSH Ignore a flush tables.
MYSQL_LOCK_NOTIFY_IF_NEED_REOPEN Instead of reopening altered
or dropped tables by itself,
@@ -110,16 +121,90 @@ static void print_lock_error(int error, const char *);
static int thr_lock_errno_to_mysql[]=
{ 0, 1, ER_LOCK_WAIT_TIMEOUT, ER_LOCK_DEADLOCK };
+/**
+ Perform semantic checks for mysql_lock_tables.
+ @param thd The current thread
+ @param tables The tables to lock
+ @param count The number of tables to lock
+ @param flags Lock flags
+ @return 0 if all the check passed, non zero if a check failed.
+*/
+int mysql_lock_tables_check(THD *thd, TABLE **tables, uint count, uint flags)
+{
+ bool log_table_write_query;
+ uint system_count;
+ uint i;
+
+ DBUG_ENTER("mysql_lock_tables_check");
+
+ system_count= 0;
+ log_table_write_query= (is_log_table_write_query(thd->lex->sql_command)
+ || ((flags & MYSQL_LOCK_PERF_SCHEMA) != 0));
+
+ for (i=0 ; i<count; i++)
+ {
+ TABLE *t= tables[i];
+
+ /* Protect against 'fake' partially initialized TABLE_SHARE */
+ DBUG_ASSERT(t->s->table_category != TABLE_UNKNOWN_CATEGORY);
+
+ /*
+ Table I/O to performance schema tables is performed
+ only internally by the server implementation.
+ When a user is requesting a lock, the following
+ constraints are enforced:
+ */
+ if (t->s->require_write_privileges() &&
+ ! log_table_write_query)
+ {
+ /*
+ A user should not be able to prevent writes,
+ or hold any type of lock in a session,
+ since this would be a DOS attack.
+ */
+ if ((t->reginfo.lock_type >= TL_READ_NO_INSERT)
+ || (thd->lex->sql_command == SQLCOM_LOCK_TABLES))
+ {
+ my_error(ER_CANT_LOCK_LOG_TABLE, MYF(0));
+ DBUG_RETURN(1);
+ }
+ }
+
+ if ((t->s->table_category == TABLE_CATEGORY_SYSTEM) &&
+ (t->reginfo.lock_type >= TL_WRITE_ALLOW_WRITE))
+ {
+ system_count++;
+ }
+ }
+
+ /*
+ Locking of system tables is restricted:
+ locking a mix of system and non-system tables in the same lock
+ is prohibited, to prevent contention.
+ */
+ if ((system_count > 0) && (system_count < count))
+ {
+ my_error(ER_WRONG_LOCK_OF_SYSTEM_TABLE, MYF(0));
+ DBUG_RETURN(1);
+ }
+
+ DBUG_RETURN(0);
+}
+
MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **tables, uint count,
uint flags, bool *need_reopen)
{
MYSQL_LOCK *sql_lock;
TABLE *write_lock_used;
int rc;
+
DBUG_ENTER("mysql_lock_tables");
*need_reopen= FALSE;
+ if (mysql_lock_tables_check(thd, tables, count, flags))
+ DBUG_RETURN (NULL);
+
for (;;)
{
if (! (sql_lock= get_lock_data(thd, tables, count, GET_LOCK_STORE_LOCKS,
@@ -137,7 +222,7 @@ MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **tables, uint count,
{
/* Clear the lock type of all lock data to avoid reusage. */
reset_lock_data(sql_lock);
- my_free((gptr) sql_lock,MYF(0));
+ my_free((uchar*) sql_lock,MYF(0));
sql_lock=0;
break;
}
@@ -145,23 +230,23 @@ MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **tables, uint count,
{
/* Clear the lock type of all lock data to avoid reusage. */
reset_lock_data(sql_lock);
- my_free((gptr) sql_lock,MYF(0));
+ my_free((uchar*) sql_lock,MYF(0));
goto retry;
}
}
- if ( write_lock_used
- && opt_readonly
- && ! (thd->security_ctx->master_access & SUPER_ACL)
- && ! thd->slave_thread
- )
+ if (!(flags & MYSQL_LOCK_IGNORE_GLOBAL_READ_ONLY) &&
+ write_lock_used &&
+ opt_readonly &&
+ !(thd->security_ctx->master_access & SUPER_ACL) &&
+ !thd->slave_thread)
{
/*
Someone has issued SET GLOBAL READ_ONLY=1 and we want a write lock.
We do not wait for READ_ONLY=0, and fail.
*/
reset_lock_data(sql_lock);
- my_free((gptr) sql_lock, MYF(0));
+ my_free((uchar*) sql_lock, MYF(0));
sql_lock=0;
my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--read-only");
break;
@@ -169,11 +254,12 @@ MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **tables, uint count,
thd_proc_info(thd, "System lock");
DBUG_PRINT("info", ("thd->proc_info %s", thd->proc_info));
- if (lock_external(thd, tables, count))
+ if (sql_lock->table_count && lock_external(thd, sql_lock->table,
+ sql_lock->table_count))
{
/* Clear the lock type of all lock data to avoid reusage. */
reset_lock_data(sql_lock);
- my_free((gptr) sql_lock,MYF(0));
+ my_free((uchar*) sql_lock,MYF(0));
sql_lock=0;
break;
}
@@ -190,18 +276,31 @@ MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **tables, uint count,
thd->lock_id)];
if (rc > 1) /* a timeout or a deadlock */
{
+ if (sql_lock->table_count)
+ VOID(unlock_external(thd, sql_lock->table, sql_lock->table_count));
my_error(rc, MYF(0));
- my_free((gptr) sql_lock,MYF(0));
+ my_free((uchar*) sql_lock,MYF(0));
sql_lock= 0;
break;
}
else if (rc == 1) /* aborted */
{
+ /*
+ reset_lock_data is required here. If thr_multi_lock fails it
+ resets lock type for tables, which were locked before (and
+ including) one that caused error. Lock type for other tables
+ preserved.
+ */
+ reset_lock_data(sql_lock);
thd->some_tables_deleted=1; // Try again
sql_lock->lock_count= 0; // Locks are already freed
}
else if (!thd->some_tables_deleted || (flags & MYSQL_LOCK_IGNORE_FLUSH))
{
+ /*
+ Thread was killed or lock aborted. Let upper level close all
+ used tables and retry or give error.
+ */
thd->locked=0;
break;
}
@@ -238,7 +337,7 @@ retry:
}
}
- thd->lock_time();
+ thd->set_time_after_lock();
DBUG_RETURN (sql_lock);
}
@@ -258,11 +357,13 @@ static int lock_external(THD *thd, TABLE **tables, uint count)
((*tables)->reginfo.lock_type >= TL_READ &&
(*tables)->reginfo.lock_type <= TL_READ_NO_INSERT))
lock_type=F_RDLCK;
+
if ((error=(*tables)->file->ha_external_lock(thd,lock_type)))
{
print_lock_error(error, (*tables)->file->table_type());
- for (; i-- ; tables--)
+ while (--i)
{
+ tables--;
(*tables)->file->ha_external_lock(thd, F_UNLCK);
(*tables)->current_lock=F_UNLCK;
}
@@ -285,7 +386,7 @@ void mysql_unlock_tables(THD *thd, MYSQL_LOCK *sql_lock)
thr_multi_unlock(sql_lock->locks,sql_lock->lock_count);
if (sql_lock->table_count)
VOID(unlock_external(thd,sql_lock->table,sql_lock->table_count));
- my_free((gptr) sql_lock,MYF(0));
+ my_free((uchar*) sql_lock,MYF(0));
DBUG_VOID_RETURN;
}
@@ -365,10 +466,31 @@ void mysql_unlock_read_tables(THD *thd, MYSQL_LOCK *sql_lock)
}
+/**
+ Try to find the table in the list of locked tables.
+ In case of success, unlock the table and remove it from this list.
+
+ @note This function has a legacy side effect: the table is
+ unlocked even if it is not found in the locked list.
+ It's not clear if this side effect is intentional or still
+ desirable. It might lead to unmatched calls to
+ unlock_external(). Moreover, a discrepancy can be left
+ unnoticed by the storage engine, because in
+ unlock_external() we call handler::external_lock(F_UNLCK) only
+ if table->current_lock is not F_UNLCK.
+
+ @param thd thread context
+ @param locked list of locked tables
+ @param table the table to unlock
+ @param always_unlock specify explicitly if the legacy side
+ effect is desired.
+*/
-void mysql_lock_remove(THD *thd, MYSQL_LOCK *locked,TABLE *table)
+void mysql_lock_remove(THD *thd, MYSQL_LOCK *locked,TABLE *table,
+ bool always_unlock)
{
- mysql_unlock_some_tables(thd, &table,1);
+ if (always_unlock == TRUE)
+ mysql_unlock_some_tables(thd, &table, /* table count */ 1);
if (locked)
{
reg1 uint i;
@@ -382,6 +504,10 @@ void mysql_lock_remove(THD *thd, MYSQL_LOCK *locked,TABLE *table)
DBUG_ASSERT(table->lock_position == i);
+ /* Unlock if not yet unlocked */
+ if (always_unlock == FALSE)
+ mysql_unlock_some_tables(thd, &table, /* table count */ 1);
+
/* Decrement table_count in advance, making below expressions easier */
old_tables= --locked->table_count;
@@ -431,11 +557,12 @@ void mysql_lock_downgrade_write(THD *thd, TABLE *table,
{
MYSQL_LOCK *locked;
TABLE *write_lock_used;
- if ((locked = get_lock_data(thd,&table,1,1,&write_lock_used)))
+ if ((locked = get_lock_data(thd, &table, 1, GET_LOCK_UNLOCK,
+ &write_lock_used)))
{
for (uint i=0; i < locked->lock_count; i++)
thr_downgrade_write_lock(locked->locks[i], new_lock_type);
- my_free((gptr) locked,MYF(0));
+ my_free((uchar*) locked,MYF(0));
}
}
@@ -453,7 +580,7 @@ void mysql_lock_abort(THD *thd, TABLE *table, bool upgrade_lock)
{
for (uint i=0; i < locked->lock_count; i++)
thr_abort_locks(locked->locks[i]->lock, upgrade_lock);
- my_free((gptr) locked,MYF(0));
+ my_free((uchar*) locked,MYF(0));
}
DBUG_VOID_RETURN;
}
@@ -488,7 +615,7 @@ bool mysql_lock_abort_for_thread(THD *thd, TABLE *table)
table->in_use->thread_id))
result= TRUE;
}
- my_free((gptr) locked,MYF(0));
+ my_free((uchar*) locked,MYF(0));
}
DBUG_RETURN(result);
}
@@ -530,8 +657,8 @@ MYSQL_LOCK *mysql_lock_merge(MYSQL_LOCK *a,MYSQL_LOCK *b)
}
/* Delete old, not needed locks */
- my_free((gptr) a,MYF(0));
- my_free((gptr) b,MYF(0));
+ my_free((uchar*) a,MYF(0));
+ my_free((uchar*) b,MYF(0));
DBUG_RETURN(sql_lock);
}
@@ -690,27 +817,19 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count,
TABLE **to, **table_buf;
DBUG_ENTER("get_lock_data");
+ DBUG_ASSERT((flags == GET_LOCK_UNLOCK) || (flags == GET_LOCK_STORE_LOCKS));
+
DBUG_PRINT("info", ("count %d", count));
*write_lock_used=0;
- uint system_count= 0;
for (i=tables=lock_count=0 ; i < count ; i++)
{
- if (table_ptr[i]->s->tmp_table != NON_TRANSACTIONAL_TMP_TABLE)
+ TABLE *t= table_ptr[i];
+
+ if (t->s->tmp_table != NON_TRANSACTIONAL_TMP_TABLE)
{
- tables+=table_ptr[i]->file->lock_count();
+ tables+= t->file->lock_count();
lock_count++;
}
- /*
- Check if we can lock the table. For some tables we cannot do that
- beacause of handler-specific locking issues.
- */
- if (!table_ptr[i]-> file->
- check_if_locking_is_allowed(thd->lex->sql_command, thd->lex->type,
- table_ptr[i], count, i, &system_count,
- (thd == logger.get_general_log_thd()) ||
- (thd == logger.get_slow_log_thd()) ||
- (thd == logger.get_privileged_thread())))
- DBUG_RETURN(0);
}
/*
@@ -740,6 +859,7 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count,
if ((table=table_ptr[i])->s->tmp_table == NON_TRANSACTIONAL_TMP_TABLE)
continue;
lock_type= table->reginfo.lock_type;
+ DBUG_ASSERT (lock_type != TL_WRITE_DEFAULT);
if (lock_type >= TL_WRITE_ALLOW_WRITE)
{
*write_lock_used=table;
@@ -749,7 +869,7 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count,
/* Clear the lock type of the lock data that are stored already. */
sql_lock->lock_count= locks - sql_lock->locks;
reset_lock_data(sql_lock);
- my_free((gptr) sql_lock,MYF(0));
+ my_free((uchar*) sql_lock,MYF(0));
DBUG_RETURN(0);
}
}
@@ -892,8 +1012,6 @@ end:
int lock_table_name(THD *thd, TABLE_LIST *table_list, bool check_in_use)
{
TABLE *table;
- TABLE_SHARE *share;
- char *key_buff;
char key[MAX_DBKEY_LENGTH];
char *db= table_list->db;
uint key_length;
@@ -906,10 +1024,10 @@ 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, (byte*)key,
+ for (table=(TABLE*) hash_first(&open_cache, (uchar*)key,
key_length, &state);
table ;
- table = (TABLE*) hash_next(&open_cache,(byte*) key,
+ table = (TABLE*) hash_next(&open_cache,(uchar*) key,
key_length, &state))
{
if (table->in_use == thd)
@@ -921,29 +1039,11 @@ int lock_table_name(THD *thd, TABLE_LIST *table_list, bool check_in_use)
}
}
}
- /*
- Create a table entry with the right key and with an old refresh version
- Note that we must use my_multi_malloc() here as this is freed by the
- table cache
- */
- if (!my_multi_malloc(MYF(MY_WME | MY_ZEROFILL),
- &table, sizeof(*table),
- &share, sizeof(*share),
- &key_buff, key_length,
- NULL))
- DBUG_RETURN(-1);
- table->s= share;
- share->set_table_cache_key(key_buff, key, key_length);
- share->tmp_table= INTERNAL_TMP_TABLE; // for intern_close_table
- table->in_use= thd;
- table->locked_by_name=1;
- table_list->table=table;
- if (my_hash_insert(&open_cache, (byte*) table))
- {
- my_free((gptr) table,MYF(0));
+ if (!(table= table_cache_insert_placeholder(thd, key, key_length)))
DBUG_RETURN(-1);
- }
+
+ table_list->table=table;
/* Return 1 if table is in use */
DBUG_RETURN(test(remove_table_from_cache(thd, db, table_list->table_name,
@@ -955,7 +1055,7 @@ void unlock_table_name(THD *thd, TABLE_LIST *table_list)
{
if (table_list->table)
{
- hash_delete(&open_cache, (byte*) table_list->table);
+ hash_delete(&open_cache, (uchar*) table_list->table);
broadcast_refresh();
}
}
@@ -1047,6 +1147,104 @@ end:
}
+/**
+ @brief Lock all tables in list with an exclusive table name lock.
+
+ @param thd Thread handle.
+ @param table_list Names of tables to lock.
+
+ @note This function needs to be protected by LOCK_open. If we're
+ under LOCK TABLES, this function does not work as advertised. Namely,
+ it does not exclude other threads from using this table and does not
+ put an exclusive name lock on this table into the table cache.
+
+ @see lock_table_names
+ @see unlock_table_names
+
+ @retval TRUE An error occured.
+ @retval FALSE Name lock successfully acquired.
+*/
+
+bool lock_table_names_exclusively(THD *thd, TABLE_LIST *table_list)
+{
+ if (lock_table_names(thd, table_list))
+ return TRUE;
+
+ /*
+ Upgrade the table name locks from semi-exclusive to exclusive locks.
+ */
+ for (TABLE_LIST *table= table_list; table; table= table->next_global)
+ {
+ if (table->table)
+ table->table->open_placeholder= 1;
+ }
+ return FALSE;
+}
+
+
+/**
+ @brief Test is 'table' is protected by an exclusive name lock.
+
+ @param[in] thd The current thread handler
+ @param[in] table_list Table container containing the single table to be
+ tested
+
+ @note Needs to be protected by LOCK_open mutex.
+
+ @return Error status code
+ @retval TRUE Table is protected
+ @retval FALSE Table is not protected
+*/
+
+bool
+is_table_name_exclusively_locked_by_this_thread(THD *thd,
+ TABLE_LIST *table_list)
+{
+ char key[MAX_DBKEY_LENGTH];
+ uint key_length;
+
+ key_length= create_table_def_key(thd, key, table_list, 0);
+
+ return is_table_name_exclusively_locked_by_this_thread(thd, (uchar *)key,
+ key_length);
+}
+
+
+/**
+ @brief Test is 'table key' is protected by an exclusive name lock.
+
+ @param[in] thd The current thread handler.
+ @param[in] key
+ @param[in] key_length
+
+ @note Needs to be protected by LOCK_open mutex
+
+ @retval TRUE Table is protected
+ @retval FALSE Table is not protected
+ */
+
+bool
+is_table_name_exclusively_locked_by_this_thread(THD *thd, uchar *key,
+ int key_length)
+{
+ HASH_SEARCH_STATE state;
+ TABLE *table;
+
+ for (table= (TABLE*) hash_first(&open_cache, key,
+ key_length, &state);
+ table ;
+ table= (TABLE*) hash_next(&open_cache, key,
+ key_length, &state))
+ {
+ if (table->in_use == thd &&
+ table->open_placeholder == 1 &&
+ table->s->version == 0)
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
/*
Unlock all tables in list with a name lock
@@ -1400,4 +1598,6 @@ void broadcast_refresh(void)
VOID(pthread_cond_broadcast(&COND_global_read_lock));
}
-
+/**
+ @} (end of group Locking)
+*/
diff --git a/sql/log.cc b/sql/log.cc
index 94c744f3f93..95204e89d0e 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -57,6 +57,35 @@ static int binlog_commit(handlerton *hton, THD *thd, bool all);
static int binlog_rollback(handlerton *hton, THD *thd, bool all);
static int binlog_prepare(handlerton *hton, THD *thd, bool all);
+/**
+ Silence all errors and warnings reported when performing a write
+ to a log table.
+ Errors and warnings are not reported to the client or SQL exception
+ handlers, so that the presence of logging does not interfere and affect
+ the logic of an application.
+*/
+class Silence_log_table_errors : public Internal_error_handler
+{
+public:
+ Silence_log_table_errors()
+ {}
+
+ virtual ~Silence_log_table_errors() {}
+
+ virtual bool handle_error(uint sql_errno,
+ MYSQL_ERROR::enum_warning_level level,
+ THD *thd);
+};
+
+bool
+Silence_log_table_errors::handle_error(uint /* sql_errno */,
+ MYSQL_ERROR::enum_warning_level /* level */,
+ THD * /* thd */)
+{
+ return TRUE;
+}
+
+
sql_print_message_func sql_print_message_handlers[3] =
{
sql_print_information,
@@ -187,6 +216,19 @@ public:
handlerton *binlog_hton;
+bool LOGGER::is_log_table_enabled(uint log_table_type)
+{
+ switch (log_table_type) {
+ case QUERY_LOG_SLOW:
+ return (table_log_handler != NULL) && opt_slow_log;
+ case QUERY_LOG_GENERAL:
+ return (table_log_handler != NULL) && opt_log ;
+ default:
+ DBUG_ASSERT(0);
+ return FALSE; /* make compiler happy */
+ }
+}
+
/* Check if a given table is opened log table */
int check_if_log_table(uint db_len, const char *db, uint table_name_len,
@@ -200,206 +242,38 @@ int check_if_log_table(uint db_len, const char *db, uint table_name_len,
if (table_name_len == 11 && !(lower_case_table_names ?
my_strcasecmp(system_charset_info,
table_name, "general_log") :
- strcmp(table_name, "general_log")) &&
- (!check_if_opened || logger.is_log_table_enabled(QUERY_LOG_GENERAL)))
- return QUERY_LOG_GENERAL;
- else
- if (table_name_len == 8 && !(lower_case_table_names ?
- my_strcasecmp(system_charset_info, table_name, "slow_log") :
- strcmp(table_name, "slow_log")) &&
- (!check_if_opened ||logger.is_log_table_enabled(QUERY_LOG_SLOW)))
+ strcmp(table_name, "general_log")))
+ {
+ if (!check_if_opened || logger.is_log_table_enabled(QUERY_LOG_GENERAL))
+ return QUERY_LOG_GENERAL;
+ return 0;
+ }
+
+ if (table_name_len == 8 && !(lower_case_table_names ?
+ my_strcasecmp(system_charset_info, table_name, "slow_log") :
+ strcmp(table_name, "slow_log")))
+ {
+ if (!check_if_opened || logger.is_log_table_enabled(QUERY_LOG_SLOW))
return QUERY_LOG_SLOW;
+ return 0;
+ }
}
return 0;
}
-/*
- Open log table of a given type (general or slow log)
-
- SYNOPSIS
- open_log_table()
-
- log_table_type type of the log table to open: QUERY_LOG_GENERAL
- or QUERY_LOG_SLOW
-
- DESCRIPTION
-
- The function opens a log table and marks it as such. Log tables are open
- during the whole time, while server is running. Except for the moments
- when they have to be reopened: during FLUSH LOGS and TRUNCATE. This
- function is invoked directly only once during startup. All subsequent
- calls happen through reopen_log_table(), which performs additional check.
-
- RETURN
- FALSE - OK
- TRUE - error occured
-*/
-
-bool Log_to_csv_event_handler::open_log_table(uint log_table_type)
-{
- THD *log_thd, *curr= current_thd;
- TABLE_LIST *table;
- bool error= FALSE;
- DBUG_ENTER("open_log_table");
-
- switch (log_table_type) {
- case QUERY_LOG_GENERAL:
- log_thd= general_log_thd;
- table= &general_log;
- /* clean up table before reuse/initial usage */
- bzero((char*) table, sizeof(TABLE_LIST));
- table->alias= table->table_name= (char*) "general_log";
- table->table_name_length= 11;
- break;
- case QUERY_LOG_SLOW:
- log_thd= slow_log_thd;
- table= &slow_log;
- bzero((char*) table, sizeof(TABLE_LIST));
- table->alias= table->table_name= (char*) "slow_log";
- table->table_name_length= 8;
- break;
- default:
- assert(0); // Impossible
- }
-
- /*
- This way we check that appropriate log thd was created ok during
- initialization. We cannot check "is_log_tables_initialized" var, as
- the very initialization is not finished until this function is
- completed in the very first time.
- */
- if (!log_thd)
- {
- DBUG_PRINT("error",("Cannot initialize log tables"));
- DBUG_RETURN(TRUE);
- }
-
- /*
- Set THD's thread_stack. This is needed to perform stack overrun
- check, which is done by some routines (e.g. open_table()).
- In the case we are called by thread, which already has this parameter
- set, we use this value. Otherwise we do a wild guess. This won't help
- to correctly track the stack overrun in these exceptional cases (which
- could probably happen only during startup and shutdown) but at least
- lets us to pass asserts.
- The problem stems from the fact that logger THDs are not real threads.
- */
- if (curr)
- log_thd->thread_stack= curr->thread_stack;
- else
- log_thd->thread_stack= (char*) &log_thd;
-
- log_thd->store_globals();
-
- table->lock_type= TL_WRITE_CONCURRENT_INSERT;
- table->db= log_thd->db;
- table->db_length= log_thd->db_length;
-
- if (simple_open_n_lock_tables(log_thd, table) ||
- table->table->file->extra(HA_EXTRA_MARK_AS_LOG_TABLE) ||
- table->table->file->ha_rnd_init(0))
- error= TRUE;
- else
- {
- table->table->use_all_columns();
- table->table->locked_by_logger= TRUE;
- table->table->no_replicate= TRUE;
- }
- /* restore thread settings */
- if (curr)
- curr->store_globals();
- else
- {
- my_pthread_setspecific_ptr(THR_THD, 0);
- my_pthread_setspecific_ptr(THR_MALLOC, 0);
- }
-
- /*
- After a log table was opened, we should clear privileged thread
- flag (which allows locking of a log table by a special thread, usually
- the one who closed log tables temporarily).
- */
- privileged_thread= 0;
- DBUG_RETURN(error);
-}
-
-
Log_to_csv_event_handler::Log_to_csv_event_handler()
{
- /* init artificial THD's */
- general_log_thd= new THD;
- /* logger thread always works with mysql database */
- general_log_thd->db= my_strdup("mysql", MYF(0));
- general_log_thd->db_length= 5;
- general_log.table= 0;
-
- slow_log_thd= new THD;
- /* logger thread always works with mysql database */
- slow_log_thd->db= my_strdup("mysql", MYF(0));;
- slow_log_thd->db_length= 5;
- slow_log.table= 0;
- /* no privileged thread exists at the moment */
- privileged_thread= 0;
}
Log_to_csv_event_handler::~Log_to_csv_event_handler()
{
- /* now cleanup the tables */
- if (general_log_thd)
- {
- delete general_log_thd;
- general_log_thd= NULL;
- }
-
- if (slow_log_thd)
- {
- delete slow_log_thd;
- slow_log_thd= NULL;
- }
-}
-
-
-/*
- Reopen log table of a given type
-
- SYNOPSIS
- reopen_log_table()
-
- log_table_type type of the log table to open: QUERY_LOG_GENERAL
- or QUERY_LOG_SLOW
-
- DESCRIPTION
-
- The function is a wrapper around open_log_table(). It is used during
- FLUSH LOGS and TRUNCATE of the log tables (i.e. when we need to close
- and reopen them). The difference is in the check of the
- logger.is_log_tables_initialized var, which can't be done in
- open_log_table(), as it makes no sense during startup.
-
- NOTE: this code assumes that we have logger mutex locked
-
- RETURN
- FALSE - ok
- TRUE - open_log_table() returned an error
-*/
-
-bool Log_to_csv_event_handler::reopen_log_table(uint log_table_type)
-{
- /* don't open the log table, if it wasn't enabled during startup */
- if (!logger.is_log_tables_initialized)
- return FALSE;
- return open_log_table(log_table_type);
}
void Log_to_csv_event_handler::cleanup()
{
- if (opt_log)
- close_log_table(QUERY_LOG_GENERAL, FALSE);
- if (opt_slow_log)
- close_log_table(QUERY_LOG_SLOW, FALSE);
logger.is_log_tables_initialized= FALSE;
}
@@ -431,48 +305,84 @@ void Log_to_csv_event_handler::cleanup()
*/
bool Log_to_csv_event_handler::
- log_general(time_t event_time, const char *user_host,
+ log_general(THD *thd, time_t event_time, const char *user_host,
uint user_host_len, int thread_id,
const char *command_type, uint command_type_len,
const char *sql_text, uint sql_text_len,
CHARSET_INFO *client_cs)
{
- TABLE *table= general_log.table;
+ TABLE_LIST table_list;
+ TABLE *table;
+ bool result= TRUE;
+ bool need_close= FALSE;
+ bool need_pop= FALSE;
+ bool need_rnd_end= FALSE;
+ uint field_index;
+ Silence_log_table_errors error_handler;
+ Open_tables_state open_tables_backup;
+ ulonglong save_thd_options;
+ bool save_time_zone_used;
+
+ /*
+ CSV uses TIME_to_timestamp() internally if table needs to be repaired
+ which will set thd->time_zone_used
+ */
+ save_time_zone_used= thd->time_zone_used;
+
+ save_thd_options= thd->options;
+ thd->options&= ~OPTION_BIN_LOG;
+
+ bzero(& table_list, sizeof(TABLE_LIST));
+ table_list.alias= table_list.table_name= GENERAL_LOG_NAME.str;
+ table_list.table_name_length= GENERAL_LOG_NAME.length;
+
+ table_list.lock_type= TL_WRITE_CONCURRENT_INSERT;
+
+ table_list.db= MYSQL_SCHEMA_NAME.str;
+ table_list.db_length= MYSQL_SCHEMA_NAME.length;
+
+ if (!(table= open_performance_schema_table(thd, & table_list,
+ & open_tables_backup)))
+ goto err;
+
+ need_close= TRUE;
+
+ if (table->file->extra(HA_EXTRA_MARK_AS_LOG_TABLE) ||
+ table->file->ha_rnd_init(0))
+ goto err;
+
+ need_rnd_end= TRUE;
+
+ /* Honor next number columns if present */
+ table->next_number_field= table->found_next_number_field;
/*
"INSERT INTO general_log" can generate warning sometimes.
- Let's reset warnings from previous queries,
- otherwise warning list can grow too much,
- so thd->query gets spoiled as some point in time,
- and mysql_parse() receives a broken query.
QQ: this problem needs to be studied in more details.
- Probably it's better to suppress warnings in logging INSERTs at all.
- Comment this line and run "cast.test" to see what's happening:
+ Comment this 2 lines and run "cast.test" to see what's happening:
*/
- mysql_reset_errors(table->in_use, 1);
-
- /* below should never happen */
- if (unlikely(!logger.is_log_tables_initialized))
- return FALSE;
+ thd->push_internal_handler(& error_handler);
+ need_pop= TRUE;
/*
NOTE: we do not call restore_record() here, as all fields are
filled by the Logger (=> no need to load default ones).
*/
- /* Set current time. Required for CURRENT_TIMESTAMP to work */
- general_log_thd->start_time= event_time;
-
/*
We do not set a value for table->field[0], as it will use
default value (which is CURRENT_TIMESTAMP).
*/
/* check that all columns exist */
- if (!table->field[1] || !table->field[2] || !table->field[3] ||
- !table->field[4] || !table->field[5])
+ if (table->s->fields < 6)
goto err;
+ DBUG_ASSERT(table->field[0]->type() == MYSQL_TYPE_TIMESTAMP);
+
+ ((Field_timestamp*) table->field[0])->store_timestamp((my_time_t)
+ event_time);
+
/* do a write */
if (table->field[1]->store(user_host, user_host_len, client_cs) ||
table->field[2]->store((longlong) thread_id, TRUE) ||
@@ -481,23 +391,48 @@ bool Log_to_csv_event_handler::
table->field[5]->store(sql_text, sql_text_len, client_cs))
goto err;
- /* mark tables as not null */
+
+ /* mark all fields as not null */
table->field[1]->set_notnull();
table->field[2]->set_notnull();
table->field[3]->set_notnull();
table->field[4]->set_notnull();
table->field[5]->set_notnull();
- /* log table entries are not replicated at the moment */
- tmp_disable_binlog(current_thd);
+ /* Set any extra columns to their default values */
+ for (field_index= 6 ; field_index < table->s->fields ; field_index++)
+ {
+ table->field[field_index]->set_default();
+ }
+
+ /* log table entries are not replicated */
+ if (table->file->ha_write_row(table->record[0]))
+ {
+ struct tm start;
+ localtime_r(&event_time, &start);
- table->file->ha_write_row(table->record[0]);
+ sql_print_error("%02d%02d%02d %2d:%02d:%02d - Failed to write to mysql.general_log",
+ start.tm_year % 100, start.tm_mon + 1,
+ start.tm_mday, start.tm_hour,
+ start.tm_min, start.tm_sec);
+ }
- reenable_binlog(current_thd);
+ result= FALSE;
- return FALSE;
err:
- return TRUE;
+ if (need_rnd_end)
+ {
+ table->file->ha_rnd_end();
+ table->file->ha_release_auto_increment();
+ }
+ if (need_pop)
+ thd->pop_internal_handler();
+ if (need_close)
+ close_performance_schema_table(thd, & open_tables_backup);
+
+ thd->options= save_thd_options;
+ thd->time_zone_used= save_time_zone_used;
+ return result;
}
@@ -512,8 +447,8 @@ err:
user_host the pointer to the string with user@host info
user_host_len length of the user_host string. this is computed once
and passed to all general log event handlers
- query_time Amount of time the query took to execute (in seconds)
- lock_time Amount of time the query was locked (in seconds)
+ query_time Amount of time the query took to execute (in microseconds)
+ lock_time Amount of time the query was locked (in microseconds)
is_command The flag, which determines, whether the sql_text is a
query or an administrator command (these are treated
differently by the old logging routines)
@@ -533,43 +468,66 @@ err:
bool Log_to_csv_event_handler::
log_slow(THD *thd, time_t current_time, time_t query_start_arg,
const char *user_host, uint user_host_len,
- longlong query_time, longlong lock_time, bool is_command,
+ ulonglong query_utime, ulonglong lock_utime, bool is_command,
const char *sql_text, uint sql_text_len)
{
- /* table variables */
- TABLE *table= slow_log.table;
+ TABLE_LIST table_list;
+ TABLE *table;
+ bool result= TRUE;
+ bool need_close= FALSE;
+ bool need_rnd_end= FALSE;
+ Open_tables_state open_tables_backup;
CHARSET_INFO *client_cs= thd->variables.character_set_client;
-
- DBUG_ENTER("log_slow");
-
- /* below should never happen */
- if (unlikely(!logger.is_log_tables_initialized))
- return FALSE;
+ bool save_time_zone_used;
+ DBUG_ENTER("Log_to_csv_event_handler::log_slow");
/*
- Set start time for CURRENT_TIMESTAMP to the start of the query.
- This will be default value for the field[0]
+ CSV uses TIME_to_timestamp() internally if table needs to be repaired
+ which will set thd->time_zone_used
*/
- slow_log_thd->start_time= query_start_arg;
- restore_record(table, s->default_values); // Get empty record
+ save_time_zone_used= thd->time_zone_used;
- /*
- We do not set a value for table->field[0], as it will use
- default value.
- */
+ bzero(& table_list, sizeof(TABLE_LIST));
+ table_list.alias= table_list.table_name= SLOW_LOG_NAME.str;
+ table_list.table_name_length= SLOW_LOG_NAME.length;
+
+ table_list.lock_type= TL_WRITE_CONCURRENT_INSERT;
+
+ table_list.db= MYSQL_SCHEMA_NAME.str;
+ table_list.db_length= MYSQL_SCHEMA_NAME.length;
+
+ if (!(table= open_performance_schema_table(thd, & table_list,
+ & open_tables_backup)))
+ goto err;
+
+ need_close= TRUE;
- if (!table->field[1] || !table->field[2] || !table->field[3] ||
- !table->field[4] || !table->field[5] || !table->field[6] ||
- !table->field[7] || !table->field[8] || !table->field[9] ||
- !table->field[10])
+ if (table->file->extra(HA_EXTRA_MARK_AS_LOG_TABLE) ||
+ table->file->ha_rnd_init(0))
goto err;
- /* store the value */
+ need_rnd_end= TRUE;
+
+ /* Honor next number columns if present */
+ table->next_number_field= table->found_next_number_field;
+
+ restore_record(table, s->default_values); // Get empty record
+
+ /* check that all columns exist */
+ if (table->s->fields < 11)
+ goto err;
+
+ /* store the time and user values */
+ DBUG_ASSERT(table->field[0]->type() == MYSQL_TYPE_TIMESTAMP);
+ ((Field_timestamp*) table->field[0])->store_timestamp((my_time_t)
+ current_time);
if (table->field[1]->store(user_host, user_host_len, client_cs))
goto err;
if (query_start_arg)
{
+ longlong query_time= (longlong) (query_utime/1000000);
+ longlong lock_time= (longlong) (lock_utime/1000000);
/*
A TIME field can not hold the full longlong range; query_time or
lock_time may be truncated without warning here, if greater than
@@ -600,7 +558,6 @@ bool Log_to_csv_event_handler::
table->field[4]->set_null();
table->field[5]->set_null();
}
-
/* fill database field */
if (thd->db)
{
@@ -642,17 +599,72 @@ bool Log_to_csv_event_handler::
if (table->field[10]->store(sql_text,sql_text_len, client_cs))
goto err;
- /* log table entries are not replicated at the moment */
- tmp_disable_binlog(current_thd);
+ /* log table entries are not replicated */
+ if (table->file->ha_write_row(table->record[0]))
+ {
+ struct tm start;
+ localtime_r(&current_time, &start);
- /* write the row */
- table->file->ha_write_row(table->record[0]);
+ sql_print_error("%02d%02d%02d %2d:%02d:%02d - Failed to write to mysql.slow_log",
+ start.tm_year % 100, start.tm_mon + 1,
+ start.tm_mday, start.tm_hour,
+ start.tm_min, start.tm_sec);
+ }
- reenable_binlog(current_thd);
+ result= FALSE;
- DBUG_RETURN(0);
err:
- DBUG_RETURN(1);
+ if (need_rnd_end)
+ {
+ table->file->ha_rnd_end();
+ table->file->ha_release_auto_increment();
+ }
+ if (need_close)
+ close_performance_schema_table(thd, & open_tables_backup);
+ thd->time_zone_used= save_time_zone_used;
+ DBUG_RETURN(result);
+}
+
+int Log_to_csv_event_handler::
+ activate_log(THD *thd, uint log_table_type)
+{
+ TABLE_LIST table_list;
+ TABLE *table;
+ int result;
+ Open_tables_state open_tables_backup;
+
+ DBUG_ENTER("Log_to_csv_event_handler::activate_log");
+
+ bzero(& table_list, sizeof(TABLE_LIST));
+
+ if (log_table_type == QUERY_LOG_GENERAL)
+ {
+ table_list.alias= table_list.table_name= GENERAL_LOG_NAME.str;
+ table_list.table_name_length= GENERAL_LOG_NAME.length;
+ }
+ else
+ {
+ DBUG_ASSERT(log_table_type == QUERY_LOG_SLOW);
+ table_list.alias= table_list.table_name= SLOW_LOG_NAME.str;
+ table_list.table_name_length= SLOW_LOG_NAME.length;
+ }
+
+ table_list.lock_type= TL_WRITE_CONCURRENT_INSERT;
+
+ table_list.db= MYSQL_SCHEMA_NAME.str;
+ table_list.db_length= MYSQL_SCHEMA_NAME.length;
+
+ table= open_performance_schema_table(thd, & table_list,
+ & open_tables_backup);
+ if (table)
+ {
+ result= 0;
+ close_performance_schema_table(thd, & open_tables_backup);
+ }
+ else
+ result= 1;
+
+ DBUG_RETURN(result);
}
bool Log_to_csv_event_handler::
@@ -682,12 +694,12 @@ void Log_to_file_event_handler::init_pthread_objects()
bool Log_to_file_event_handler::
log_slow(THD *thd, time_t current_time, time_t query_start_arg,
const char *user_host, uint user_host_len,
- longlong query_time, longlong lock_time, bool is_command,
+ ulonglong query_utime, ulonglong lock_utime, bool is_command,
const char *sql_text, uint sql_text_len)
{
return mysql_slow_log.write(thd, current_time, query_start_arg,
user_host, user_host_len,
- query_time, lock_time, is_command,
+ query_utime, lock_utime, is_command,
sql_text, sql_text_len);
}
@@ -698,7 +710,7 @@ bool Log_to_file_event_handler::
*/
bool Log_to_file_event_handler::
- log_general(time_t event_time, const char *user_host,
+ log_general(THD *thd, time_t event_time, const char *user_host,
uint user_host_len, int thread_id,
const char *command_type, uint command_type_len,
const char *sql_text, uint sql_text_len,
@@ -762,10 +774,10 @@ bool LOGGER::error_log_print(enum loglevel level, const char *format,
va_list args)
{
bool error= FALSE;
- Log_event_handler **current_handler= error_log_handler_list;
+ Log_event_handler **current_handler;
/* currently we don't need locking here as there is no error_log table */
- while (*current_handler)
+ for (current_handler= error_log_handler_list ; *current_handler ;)
error= (*current_handler++)->log_error(level, format, args) || error;
return error;
@@ -775,7 +787,7 @@ bool LOGGER::error_log_print(enum loglevel level, const char *format,
void LOGGER::cleanup_base()
{
DBUG_ASSERT(inited == 1);
- (void) pthread_mutex_destroy(&LOCK_logger);
+ rwlock_destroy(&LOCK_logger);
if (table_log_handler)
{
table_log_handler->cleanup();
@@ -794,12 +806,6 @@ void LOGGER::cleanup_end()
}
-void LOGGER::close_log_table(uint log_table_type, bool lock_in_use)
-{
- table_log_handler->close_log_table(log_table_type, lock_in_use);
-}
-
-
/*
Perform basic log initialization: create file-based log handler and
init error log.
@@ -821,7 +827,7 @@ void LOGGER::init_base()
init_error_log(LOG_FILE);
file_log_handler->init_pthread_objects();
- (void) pthread_mutex_init(&LOCK_logger, MY_MUTEX_INIT_SLOW);
+ my_rwlock_init(&LOCK_logger, NULL);
}
@@ -836,29 +842,6 @@ void LOGGER::init_log_tables()
}
-bool LOGGER::reopen_log_table(uint log_table_type)
-{
- return table_log_handler->reopen_log_table(log_table_type);
-}
-
-bool LOGGER::reopen_log_tables()
-{
- /*
- we use | and not || here, to ensure that both reopen_log_table
- are called, even if the first one fails
- */
- if ((opt_slow_log && logger.reopen_log_table(QUERY_LOG_SLOW)) |
- (opt_log && logger.reopen_log_table(QUERY_LOG_GENERAL)))
- return TRUE;
- return FALSE;
-}
-
-
-void LOGGER::tmp_close_log_tables(THD *thd)
-{
- table_log_handler->tmp_close_log_tables(thd);
-}
-
bool LOGGER::flush_logs(THD *thd)
{
int rc= 0;
@@ -867,19 +850,11 @@ bool LOGGER::flush_logs(THD *thd)
Now we lock logger, as nobody should be able to use logging routines while
log tables are closed
*/
- logger.lock();
- if (logger.is_log_tables_initialized)
- table_log_handler->tmp_close_log_tables(thd); // the locking happens here
+ logger.lock_exclusive();
/* reopen log files */
file_log_handler->flush();
- /* reopen tables in the case they were enabled */
- if (logger.is_log_tables_initialized)
- {
- if (reopen_log_tables())
- rc= TRUE;
- }
/* end of log flush */
logger.unlock();
return rc;
@@ -892,28 +867,27 @@ bool LOGGER::flush_logs(THD *thd)
SYNOPSIS
slow_log_print()
- thd THD of the query being logged
- query The query being logged
- query_length The length of the query string
- query_start_arg Query start timestamp
+ thd THD of the query being logged
+ query The query being logged
+ query_length The length of the query string
+ current_utime Current time in microseconds (from undefined start)
RETURN
- FALSE - OK
- TRUE - error occured
+ FALSE OK
+ TRUE error occured
*/
bool LOGGER::slow_log_print(THD *thd, const char *query, uint query_length,
- time_t query_start_arg)
+ ulonglong current_utime)
+
{
bool error= FALSE;
- Log_event_handler **current_handler= slow_log_handler_list;
+ Log_event_handler **current_handler;
bool is_command= FALSE;
char user_host_buff[MAX_USER_HOST_SIZE];
-
- time_t current_time;
Security_context *sctx= thd->security_ctx;
uint user_host_len= 0;
- longlong query_time= 0, lock_time= 0;
+ ulonglong query_utime, lock_utime;
/*
Print the message to the buffer if we have slow log enabled
@@ -921,13 +895,13 @@ bool LOGGER::slow_log_print(THD *thd, const char *query, uint query_length,
if (*slow_log_handler_list)
{
- current_time= time(NULL);
+ time_t current_time;
/* do not log slow queries from replication threads */
- if (thd->slave_thread)
+ if (thd->slave_thread && !opt_log_slow_slave_statements)
return 0;
- lock();
+ lock_shared();
if (!opt_slow_log)
{
unlock();
@@ -935,17 +909,22 @@ bool LOGGER::slow_log_print(THD *thd, const char *query, uint query_length,
}
/* fill in user_host value: the format is "%s[%s] @ %s [%s]" */
- user_host_len= strxnmov(user_host_buff, MAX_USER_HOST_SIZE,
- sctx->priv_user ? sctx->priv_user : "", "[",
- sctx->user ? sctx->user : "", "] @ ",
- sctx->host ? sctx->host : "", " [",
- sctx->ip ? sctx->ip : "", "]", NullS) -
- user_host_buff;
-
- if (query_start_arg)
+ user_host_len= (strxnmov(user_host_buff, MAX_USER_HOST_SIZE,
+ sctx->priv_user ? sctx->priv_user : "", "[",
+ sctx->user ? sctx->user : "", "] @ ",
+ sctx->host ? sctx->host : "", " [",
+ sctx->ip ? sctx->ip : "", "]", NullS) -
+ user_host_buff);
+
+ current_time= my_time_possible_from_micro(current_utime);
+ if (thd->start_utime)
+ {
+ query_utime= (current_utime - thd->start_utime);
+ lock_utime= (thd->utime_after_lock - thd->start_utime);
+ }
+ else
{
- query_time= (longlong) (current_time - query_start_arg);
- lock_time= (longlong) (thd->time_after_lock - query_start_arg);
+ query_utime= lock_utime= 0;
}
if (!query)
@@ -955,10 +934,10 @@ bool LOGGER::slow_log_print(THD *thd, const char *query, uint query_length,
query_length= command_name[thd->command].length;
}
- while (*current_handler)
- error= (*current_handler++)->log_slow(thd, current_time, query_start_arg,
+ for (current_handler= slow_log_handler_list; *current_handler ;)
+ error= (*current_handler++)->log_slow(thd, current_time, thd->start_time,
user_host_buff, user_host_len,
- query_time, lock_time, is_command,
+ query_utime, lock_utime, is_command,
query, query_length) || error;
unlock();
@@ -983,7 +962,7 @@ bool LOGGER::general_log_print(THD *thd, enum enum_server_command command,
Security_context *sctx= thd->security_ctx;
ulong id;
uint message_buff_len= 0, user_host_len= 0;
-
+ time_t current_time;
if (thd)
{ /* Normal thread */
if ((thd->options & OPTION_LOG_OFF)
@@ -999,14 +978,12 @@ bool LOGGER::general_log_print(THD *thd, enum enum_server_command command,
else
id=0; /* Log from connect handler */
- lock();
+ lock_shared();
if (!opt_log)
{
unlock();
return 0;
}
- time_t current_time= time(NULL);
-
user_host_len= strxnmov(user_host_buff, MAX_USER_HOST_SIZE,
sctx->priv_user ? sctx->priv_user : "", "[",
sctx->user ? sctx->user : "", "] @ ",
@@ -1021,9 +998,10 @@ bool LOGGER::general_log_print(THD *thd, enum enum_server_command command,
else
message_buff[0]= '\0';
+ current_time= my_time(0);
while (*current_handler)
error+= (*current_handler++)->
- log_general(current_time, user_host_buff,
+ log_general(thd, current_time, user_host_buff,
user_host_len, id,
command_name[(uint) command].str,
command_name[(uint) command].length,
@@ -1110,35 +1088,51 @@ void LOGGER::init_general_log(uint general_log_printer)
bool LOGGER::activate_log_handler(THD* thd, uint log_type)
{
- bool res= 0;
- lock();
+ MYSQL_QUERY_LOG *file_log;
+ bool res= FALSE;
+ lock_exclusive();
switch (log_type) {
case QUERY_LOG_SLOW:
if (!opt_slow_log)
{
- if ((res= reopen_log_table(log_type)))
- goto err;
- file_log_handler->get_mysql_slow_log()->
- open_slow_log(sys_var_slow_log_path.value);
- init_slow_log(log_output_options);
- opt_slow_log= TRUE;
+ file_log= file_log_handler->get_mysql_slow_log();
+
+ file_log->open_slow_log(sys_var_slow_log_path.value);
+ if (table_log_handler->activate_log(thd, QUERY_LOG_SLOW))
+ {
+ /* Error printed by open table in activate_log() */
+ res= TRUE;
+ file_log->close(0);
+ }
+ else
+ {
+ init_slow_log(log_output_options);
+ opt_slow_log= TRUE;
+ }
}
break;
case QUERY_LOG_GENERAL:
if (!opt_log)
{
- if ((res= reopen_log_table(log_type)))
- goto err;
- file_log_handler->get_mysql_log()->
- open_query_log(sys_var_general_log_path.value);
- init_general_log(log_output_options);
- opt_log= TRUE;
+ file_log= file_log_handler->get_mysql_log();
+
+ file_log->open_query_log(sys_var_general_log_path.value);
+ if (table_log_handler->activate_log(thd, QUERY_LOG_GENERAL))
+ {
+ /* Error printed by open table in activate_log() */
+ res= TRUE;
+ file_log->close(0);
+ }
+ else
+ {
+ init_general_log(log_output_options);
+ opt_log= TRUE;
+ }
}
break;
default:
DBUG_ASSERT(0);
}
-err:
unlock();
return res;
}
@@ -1146,23 +1140,17 @@ err:
void LOGGER::deactivate_log_handler(THD *thd, uint log_type)
{
- TABLE_LIST *table_list;
my_bool *tmp_opt= 0;
MYSQL_LOG *file_log;
- THD *log_thd;
switch (log_type) {
case QUERY_LOG_SLOW:
- table_list= &table_log_handler->slow_log;
tmp_opt= &opt_slow_log;
file_log= file_log_handler->get_mysql_slow_log();
- log_thd= table_log_handler->slow_log_thd;
break;
case QUERY_LOG_GENERAL:
- table_list= &table_log_handler->general_log;
tmp_opt= &opt_log;
file_log= file_log_handler->get_mysql_log();
- log_thd= table_log_handler->general_log_thd;
break;
default:
assert(0); // Impossible
@@ -1171,81 +1159,16 @@ void LOGGER::deactivate_log_handler(THD *thd, uint log_type)
if (!(*tmp_opt))
return;
- if (is_log_tables_initialized)
- lock_and_wait_for_table_name(log_thd, table_list);
- lock();
-
- if (is_log_tables_initialized)
- {
- VOID(pthread_mutex_lock(&LOCK_open));
- close_log_table(log_type, TRUE);
- table_list->table= 0;
- query_cache_invalidate3(log_thd, table_list, 0);
- unlock_table_name(log_thd, table_list);
- VOID(pthread_mutex_unlock(&LOCK_open));
- }
+ lock_exclusive();
file_log->close(0);
*tmp_opt= FALSE;
unlock();
}
-/*
- Close log tables temporarily. The thread which closed
- them this way can lock them in any mode it needs.
- NOTE: one should call logger.lock() before entering this
- function.
-*/
-void Log_to_csv_event_handler::tmp_close_log_tables(THD *thd)
-{
- TABLE_LIST close_slow_log, close_general_log;
-
- /* fill lists, we will need to perform operations on tables */
- bzero((char*) &close_slow_log, sizeof(TABLE_LIST));
- close_slow_log.alias= close_slow_log.table_name=(char*) "slow_log";
- close_slow_log.table_name_length= 8;
- close_slow_log.db= (char*) "mysql";
- close_slow_log.db_length= 5;
-
- bzero((char*) &close_general_log, sizeof(TABLE_LIST));
- close_general_log.alias= close_general_log.table_name=(char*) "general_log";
- close_general_log.table_name_length= 11;
- close_general_log.db= (char*) "mysql";
- close_general_log.db_length= 5;
-
- privileged_thread= thd;
-
- VOID(pthread_mutex_lock(&LOCK_open));
- /*
- NOTE: in fact, the first parameter used in query_cache_invalidate3()
- could be any non-NULL THD, as the underlying code makes certain
- assumptions about this.
- Here we use one of the logger handler THD's. Simply because it
- seems appropriate.
- */
- if (opt_log)
- {
- close_log_table(QUERY_LOG_GENERAL, TRUE);
- query_cache_invalidate3(general_log_thd, &close_general_log, 0);
- }
- if (opt_slow_log)
- {
- close_log_table(QUERY_LOG_SLOW, TRUE);
- query_cache_invalidate3(general_log_thd, &close_slow_log, 0);
- }
- VOID(pthread_mutex_unlock(&LOCK_open));
-}
-
/* the parameters are unused for the log tables */
bool Log_to_csv_event_handler::init()
{
- /*
- we use | and not || here, to ensure that both open_log_table
- are called, even if the first one fails
- */
- if ((opt_log && open_log_table(QUERY_LOG_GENERAL)) |
- (opt_slow_log && open_log_table(QUERY_LOG_SLOW)))
- return 1;
return 0;
}
@@ -1256,7 +1179,7 @@ int LOGGER::set_handlers(uint error_log_printer,
/* error log table is not supported yet */
DBUG_ASSERT(error_log_printer < LOG_TABLE);
- lock();
+ lock_exclusive();
if ((slow_log_printer & LOG_TABLE || general_log_printer & LOG_TABLE) &&
!is_log_tables_initialized)
@@ -1278,71 +1201,6 @@ int LOGGER::set_handlers(uint error_log_printer,
}
-/*
- Close log table of a given type (general or slow log)
-
- SYNOPSIS
- close_log_table()
-
- log_table_type type of the log table to close: QUERY_LOG_GENERAL
- or QUERY_LOG_SLOW
- lock_in_use Set to TRUE if the caller owns LOCK_open. FALSE otherwise.
-
- DESCRIPTION
-
- The function closes a log table. It is invoked (1) when we need to reopen
- log tables (e.g. FLUSH LOGS or TRUNCATE on the log table is being
- executed) or (2) during shutdown.
-*/
-
-void Log_to_csv_event_handler::
- close_log_table(uint log_table_type, bool lock_in_use)
-{
- THD *log_thd, *curr= current_thd;
- TABLE_LIST *table;
-
- if (!logger.is_log_table_enabled(log_table_type))
- return; /* do nothing */
-
- switch (log_table_type) {
- case QUERY_LOG_GENERAL:
- log_thd= general_log_thd;
- table= &general_log;
- break;
- case QUERY_LOG_SLOW:
- log_thd= slow_log_thd;
- table= &slow_log;
- break;
- default:
- assert(0); // Impossible
- }
-
- /*
- Set thread stack start for the logger thread. See comment in
- open_log_table() for details.
- */
- if (curr)
- log_thd->thread_stack= curr->thread_stack;
- else
- log_thd->thread_stack= (char*) &log_thd;
-
- /* close the table */
- log_thd->store_globals();
- table->table->file->ha_rnd_end();
- /* discard logger mark before unlock*/
- table->table->locked_by_logger= FALSE;
- close_thread_tables(log_thd, lock_in_use);
-
- if (curr)
- curr->store_globals();
- else
- {
- my_pthread_setspecific_ptr(THR_THD, 0);
- my_pthread_setspecific_ptr(THR_MALLOC, 0);
- }
-}
-
-
/*
Save position of binary log transaction cache.
@@ -1363,10 +1221,10 @@ binlog_trans_log_savepos(THD *thd, my_off_t *pos)
{
DBUG_ENTER("binlog_trans_log_savepos");
DBUG_ASSERT(pos != NULL);
- if (thd->ha_data[binlog_hton->slot] == NULL)
+ if (thd_get_ha_data(thd, binlog_hton) == NULL)
thd->binlog_setup_trx_data();
binlog_trx_data *const trx_data=
- (binlog_trx_data*) thd->ha_data[binlog_hton->slot];
+ (binlog_trx_data*) thd_get_ha_data(thd, binlog_hton);
DBUG_ASSERT(mysql_bin_log.is_open());
*pos= trx_data->position();
DBUG_PRINT("return", ("*pos: %lu", (ulong) *pos));
@@ -1395,12 +1253,12 @@ binlog_trans_log_truncate(THD *thd, my_off_t pos)
DBUG_ENTER("binlog_trans_log_truncate");
DBUG_PRINT("enter", ("pos: %lu", (ulong) pos));
- DBUG_ASSERT(thd->ha_data[binlog_hton->slot] != NULL);
+ DBUG_ASSERT(thd_get_ha_data(thd, binlog_hton) != NULL);
/* Only true if binlog_trans_log_savepos() wasn't called before */
DBUG_ASSERT(pos != ~(my_off_t) 0);
binlog_trx_data *const trx_data=
- (binlog_trx_data*) thd->ha_data[binlog_hton->slot];
+ (binlog_trx_data*) thd_get_ha_data(thd, binlog_hton);
trx_data->truncate(pos);
DBUG_VOID_RETURN;
}
@@ -1431,11 +1289,11 @@ int binlog_init(void *p)
static int binlog_close_connection(handlerton *hton, THD *thd)
{
binlog_trx_data *const trx_data=
- (binlog_trx_data*) thd->ha_data[binlog_hton->slot];
- DBUG_ASSERT(mysql_bin_log.is_open() && trx_data->empty());
- thd->ha_data[binlog_hton->slot]= 0;
+ (binlog_trx_data*) thd_get_ha_data(thd, binlog_hton);
+ DBUG_ASSERT(trx_data->empty());
+ thd_set_ha_data(thd, binlog_hton, NULL);
trx_data->~binlog_trx_data();
- my_free((gptr)trx_data, MYF(0));
+ my_free((uchar*)trx_data, MYF(0));
return 0;
}
@@ -1556,8 +1414,7 @@ static int binlog_commit(handlerton *hton, THD *thd, bool all)
{
DBUG_ENTER("binlog_commit");
binlog_trx_data *const trx_data=
- (binlog_trx_data*) thd->ha_data[binlog_hton->slot];
- DBUG_ASSERT(mysql_bin_log.is_open());
+ (binlog_trx_data*) thd_get_ha_data(thd, binlog_hton);
if (trx_data->empty())
{
@@ -1584,8 +1441,7 @@ static int binlog_rollback(handlerton *hton, THD *thd, bool all)
DBUG_ENTER("binlog_rollback");
int error=0;
binlog_trx_data *const trx_data=
- (binlog_trx_data*) thd->ha_data[binlog_hton->slot];
- DBUG_ASSERT(mysql_bin_log.is_open());
+ (binlog_trx_data*) thd_get_ha_data(thd, binlog_hton);
if (trx_data->empty()) {
trx_data->reset();
@@ -1598,7 +1454,8 @@ static int binlog_rollback(handlerton *hton, THD *thd, bool all)
table. Such cases should be rare (updating a
non-transactional table inside a transaction...)
*/
- if (unlikely(thd->no_trans_update.all || (thd->options & OPTION_KEEP_LOG)))
+ if (unlikely(thd->transaction.all.modified_non_trans_table ||
+ (thd->options & OPTION_KEEP_LOG)))
{
Query_log_event qev(thd, STRING_WITH_LEN("ROLLBACK"), TRUE, FALSE);
qev.error_code= 0; // see comment in MYSQL_LOG::write(THD, IO_CACHE)
@@ -1646,14 +1503,14 @@ static int binlog_savepoint_set(handlerton *hton, THD *thd, void *sv)
static int binlog_savepoint_rollback(handlerton *hton, THD *thd, void *sv)
{
DBUG_ENTER("binlog_savepoint_rollback");
- DBUG_ASSERT(mysql_bin_log.is_open());
/*
Write ROLLBACK TO SAVEPOINT to the binlog cache if we have updated some
non-transactional table. Otherwise, truncate the binlog cache starting
from the SAVEPOINT command.
*/
- if (unlikely(thd->no_trans_update.all || (thd->options & OPTION_KEEP_LOG)))
+ if (unlikely(thd->transaction.all.modified_non_trans_table ||
+ (thd->options & OPTION_KEEP_LOG)))
{
int error=
thd->binlog_query(THD::STMT_QUERY_TYPE,
@@ -1670,7 +1527,7 @@ int check_binlog_magic(IO_CACHE* log, const char** errmsg)
char magic[4];
DBUG_ASSERT(my_b_tell(log) == 0);
- if (my_b_read(log, (byte*) magic, sizeof(magic)))
+ if (my_b_read(log, (uchar*) magic, sizeof(magic)))
{
*errmsg = "I/O error reading the header from the binary log";
sql_print_error("%s, errno=%d, io cache code=%d", *errmsg, my_errno,
@@ -1772,15 +1629,16 @@ static int find_uniq_filename(char *name)
struct st_my_dir *dir_info;
reg1 struct fileinfo *file_info;
ulong max_found=0;
-
+ size_t buf_length, length;
+ char *start, *end;
DBUG_ENTER("find_uniq_filename");
- uint length = dirname_part(buff,name);
- char *start = name + length;
- char *end = strend(start);
+ length= dirname_part(buff, name, &buf_length);
+ start= name + length;
+ end= strend(start);
*end='.';
- length= (uint) (end-start+1);
+ length= (size_t) (end-start+1);
if (!(dir_info = my_dir(buff,MYF(MY_DONT_SORT))))
{ // This shouldn't happen
@@ -1790,7 +1648,7 @@ static int find_uniq_filename(char *name)
file_info= dir_info->dir_entry;
for (i=dir_info->number_off_files ; i-- ; file_info++)
{
- if (bcmp(file_info->name,start,length) == 0 &&
+ if (bcmp((uchar*) file_info->name, (uchar*) start, length) == 0 &&
test_if_number(file_info->name+length, &number,0))
{
set_if_bigger(max_found,(ulong) number);
@@ -1894,7 +1752,7 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
);
end= strnmov(buff + len, "Time Id Command Argument\n",
sizeof(buff) - len);
- if (my_b_write(&log_file, (byte*) buff, (uint) (end-buff)) ||
+ if (my_b_write(&log_file, (uchar*) buff, (uint) (end-buff)) ||
flush_io_cache(&log_file))
goto err;
}
@@ -1916,8 +1774,8 @@ shutdown the MySQL server and restart it.", name, errno);
}
MYSQL_LOG::MYSQL_LOG()
- : name(0), log_type(LOG_UNKNOWN), log_state(LOG_CLOSED), write_error(FALSE),
- inited(FALSE)
+ : name(0), write_error(FALSE), inited(FALSE), log_type(LOG_UNKNOWN),
+ log_state(LOG_CLOSED)
{
/*
We don't want to initialize LOCK_Log here as such initialization depends on
@@ -2082,10 +1940,12 @@ bool MYSQL_QUERY_LOG::write(time_t event_time, const char *user_host,
{
char buff[32];
uint length= 0;
- char time_buff[MAX_TIME_SIZE];
+ char local_time_buff[MAX_TIME_SIZE];
struct tm start;
uint time_buff_len= 0;
+ (void) pthread_mutex_lock(&LOCK_log);
+
/* Test if someone closed between the is_open test and lock */
if (is_open())
{
@@ -2096,40 +1956,41 @@ bool MYSQL_QUERY_LOG::write(time_t event_time, const char *user_host,
localtime_r(&event_time, &start);
- time_buff_len= my_snprintf(time_buff, MAX_TIME_SIZE,
+ time_buff_len= my_snprintf(local_time_buff, MAX_TIME_SIZE,
"%02d%02d%02d %2d:%02d:%02d",
start.tm_year % 100, start.tm_mon + 1,
start.tm_mday, start.tm_hour,
start.tm_min, start.tm_sec);
- if (my_b_write(&log_file, (byte*) &time_buff, time_buff_len))
+ if (my_b_write(&log_file, (uchar*) local_time_buff, time_buff_len))
goto err;
}
else
- if (my_b_write(&log_file, (byte*) "\t\t" ,2) < 0)
+ if (my_b_write(&log_file, (uchar*) "\t\t" ,2) < 0)
goto err;
/* command_type, thread_id */
length= my_snprintf(buff, 32, "%5ld ", (long) thread_id);
- if (my_b_write(&log_file, (byte*) buff, length))
+ if (my_b_write(&log_file, (uchar*) buff, length))
goto err;
- if (my_b_write(&log_file, (byte*) command_type, command_type_len))
+ if (my_b_write(&log_file, (uchar*) command_type, command_type_len))
goto err;
- if (my_b_write(&log_file, (byte*) "\t", 1))
+ if (my_b_write(&log_file, (uchar*) "\t", 1))
goto err;
/* sql_text */
- if (my_b_write(&log_file, (byte*) sql_text, sql_text_len))
+ if (my_b_write(&log_file, (uchar*) sql_text, sql_text_len))
goto err;
- if (my_b_write(&log_file, (byte*) "\n", 1) ||
+ if (my_b_write(&log_file, (uchar*) "\n", 1) ||
flush_io_cache(&log_file))
goto err;
}
+ (void) pthread_mutex_unlock(&LOCK_log);
return FALSE;
err:
@@ -2138,6 +1999,7 @@ err:
write_error= 1;
sql_print_error(ER(ER_ERROR_ON_WRITE), name, errno);
}
+ (void) pthread_mutex_unlock(&LOCK_log);
return TRUE;
}
@@ -2154,8 +2016,8 @@ err:
user_host the pointer to the string with user@host info
user_host_len length of the user_host string. this is computed once
and passed to all general log event handlers
- query_time Amount of time the query took to execute (in seconds)
- lock_time Amount of time the query was locked (in seconds)
+ query_utime Amount of time the query took to execute (in microseconds)
+ lock_utime Amount of time the query was locked (in microseconds)
is_command The flag, which determines, whether the sql_text is a
query or an administrator command.
sql_text the very text of the query or administrator command
@@ -2173,20 +2035,26 @@ err:
bool MYSQL_QUERY_LOG::write(THD *thd, time_t current_time,
time_t query_start_arg, const char *user_host,
- uint user_host_len, longlong query_time,
- longlong lock_time, bool is_command,
+ uint user_host_len, ulonglong query_utime,
+ ulonglong lock_utime, bool is_command,
const char *sql_text, uint sql_text_len)
{
bool error= 0;
DBUG_ENTER("MYSQL_QUERY_LOG::write");
+ (void) pthread_mutex_lock(&LOCK_log);
+
if (!is_open())
+ {
+ (void) pthread_mutex_unlock(&LOCK_log);
DBUG_RETURN(0);
+ }
if (is_open())
{ // Safety agains reopen
int tmp_errno= 0;
char buff[80], *end;
+ char query_time_buff[22+7], lock_time_buff[22+7];
uint buff_len;
end= buff;
@@ -2205,7 +2073,7 @@ bool MYSQL_QUERY_LOG::write(THD *thd, time_t current_time,
start.tm_min, start.tm_sec);
/* Note that my_b_write() assumes it knows the length for this */
- if (my_b_write(&log_file, (byte*) buff, buff_len))
+ if (my_b_write(&log_file, (uchar*) buff, buff_len))
tmp_errno= errno;
}
if (my_b_printf(&log_file, "# User@Host: ", sizeof("# User@Host: ") - 1)
@@ -2213,14 +2081,16 @@ bool MYSQL_QUERY_LOG::write(THD *thd, time_t current_time,
tmp_errno= errno;
if (my_b_printf(&log_file, user_host, user_host_len) != user_host_len)
tmp_errno= errno;
- if (my_b_write(&log_file, (byte*) "\n", 1))
+ if (my_b_write(&log_file, (uchar*) "\n", 1))
tmp_errno= errno;
}
/* For slow query log */
+ sprintf(query_time_buff, "%.6f", ulonglong2double(query_utime)/1000000.0);
+ sprintf(lock_time_buff, "%.6f", ulonglong2double(lock_utime)/1000000.0);
if (my_b_printf(&log_file,
- "# Query_time: %lu Lock_time: %lu"
+ "# Query_time: %s Lock_time: %s"
" Rows_sent: %lu Rows_examined: %lu\n",
- (ulong) query_time, (ulong) lock_time,
+ query_time_buff, lock_time_buff,
(ulong) thd->sent_row_count,
(ulong) thd->examined_row_count) == (uint) -1)
tmp_errno= errno;
@@ -2261,18 +2131,18 @@ bool MYSQL_QUERY_LOG::write(THD *thd, time_t current_time,
{
*end++=';';
*end='\n';
- if (my_b_write(&log_file, (byte*) "SET ", 4) ||
- my_b_write(&log_file, (byte*) buff + 1, (uint) (end-buff)))
+ if (my_b_write(&log_file, (uchar*) "SET ", 4) ||
+ my_b_write(&log_file, (uchar*) buff + 1, (uint) (end-buff)))
tmp_errno= errno;
}
if (is_command)
{
end= strxmov(buff, "# administrator command: ", NullS);
buff_len= (ulong) (end - buff);
- my_b_write(&log_file, (byte*) buff, buff_len);
+ my_b_write(&log_file, (uchar*) buff, buff_len);
}
- if (my_b_write(&log_file, (byte*) sql_text, sql_text_len) ||
- my_b_write(&log_file, (byte*) ";\n",2) ||
+ if (my_b_write(&log_file, (uchar*) sql_text, sql_text_len) ||
+ my_b_write(&log_file, (uchar*) ";\n",2) ||
flush_io_cache(&log_file))
tmp_errno= errno;
if (tmp_errno)
@@ -2285,6 +2155,7 @@ bool MYSQL_QUERY_LOG::write(THD *thd, time_t current_time,
}
}
}
+ (void) pthread_mutex_unlock(&LOCK_log);
DBUG_RETURN(error);
}
@@ -2456,7 +2327,7 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
an extension for the binary log files.
In this case we write a standard header to it.
*/
- if (my_b_safe_write(&log_file, (byte*) BINLOG_MAGIC,
+ if (my_b_safe_write(&log_file, (uchar*) BINLOG_MAGIC,
BIN_LOG_HEADER_SIZE))
goto err;
bytes_written+= BIN_LOG_HEADER_SIZE;
@@ -2481,8 +2352,7 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
s.flags|= LOG_EVENT_BINLOG_IN_USE_F;
if (!s.is_valid())
goto err;
- if (null_created_arg)
- s.created= 0;
+ s.dont_set_created= null_created_arg;
if (s.write(&log_file))
goto err;
bytes_written+= s.data_written;
@@ -2528,9 +2398,9 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
As this is a new log file, we write the file name to the index
file. As every time we write to the index file, we sync it.
*/
- if (my_b_write(&index_file, (byte*) log_file_name,
+ if (my_b_write(&index_file, (uchar*) log_file_name,
strlen(log_file_name)) ||
- my_b_write(&index_file, (byte*) "\n", 1) ||
+ my_b_write(&index_file, (uchar*) "\n", 1) ||
flush_io_cache(&index_file) ||
my_sync(index_file.file, MYF(MY_WME)))
goto err;
@@ -2598,7 +2468,7 @@ static bool copy_up_file_and_fill(IO_CACHE *index_file, my_off_t offset)
int bytes_read;
my_off_t init_offset= offset;
File file= index_file->file;
- byte io_buf[IO_SIZE*2];
+ uchar io_buf[IO_SIZE*2];
DBUG_ENTER("copy_up_file_and_fill");
for (;; offset+= bytes_read)
@@ -2610,7 +2480,7 @@ static bool copy_up_file_and_fill(IO_CACHE *index_file, my_off_t offset)
if (!bytes_read)
break; // end of file
(void) my_seek(file, offset-init_offset, MY_SEEK_SET, MYF(0));
- if (my_write(file, (byte*) io_buf, bytes_read, MYF(MY_WME | MY_NABP)))
+ if (my_write(file, io_buf, bytes_read, MYF(MY_WME | MY_NABP)))
goto err;
}
/* The following will either truncate the file or fill the end with \n' */
@@ -2822,7 +2692,7 @@ bool MYSQL_BIN_LOG::reset_logs(THD* thd)
need_start_event=1;
if (!open_index_file(index_file_name, 0))
open(save_name, log_type, 0, io_cache_type, no_auto_events, max_size, 0);
- my_free((gptr) save_name, MYF(0));
+ my_free((uchar*) save_name, MYF(0));
err:
VOID(pthread_mutex_unlock(&LOCK_thread_count));
@@ -2869,7 +2739,7 @@ err:
#ifdef HAVE_REPLICATION
-int MYSQL_BIN_LOG::purge_first_log(struct st_relay_log_info* rli, bool included)
+int MYSQL_BIN_LOG::purge_first_log(Relay_log_info* rli, bool included)
{
int error;
DBUG_ENTER("purge_first_log");
@@ -3324,7 +3194,7 @@ bool MYSQL_BIN_LOG::appendv(const char* buf, uint len,...)
safe_mutex_assert_owner(&LOCK_log);
do
{
- if (my_b_append(&log_file,(byte*) buf,len))
+ if (my_b_append(&log_file,(uchar*) buf,len))
{
error= 1;
goto err;
@@ -3387,23 +3257,22 @@ int THD::binlog_setup_trx_data()
{
DBUG_ENTER("THD::binlog_setup_trx_data");
binlog_trx_data *trx_data=
- (binlog_trx_data*) ha_data[binlog_hton->slot];
+ (binlog_trx_data*) thd_get_ha_data(this, binlog_hton);
if (trx_data)
DBUG_RETURN(0); // Already set up
- ha_data[binlog_hton->slot]= trx_data=
- (binlog_trx_data*) my_malloc(sizeof(binlog_trx_data), MYF(MY_ZEROFILL));
+ trx_data= (binlog_trx_data*) my_malloc(sizeof(binlog_trx_data), MYF(MY_ZEROFILL));
if (!trx_data ||
open_cached_file(&trx_data->trans_log, mysql_tmpdir,
LOG_PREFIX, binlog_cache_size, MYF(MY_WME)))
{
- my_free((gptr)trx_data, MYF(MY_ALLOW_ZERO_PTR));
- ha_data[binlog_hton->slot]= 0;
+ my_free((uchar*)trx_data, MYF(MY_ALLOW_ZERO_PTR));
DBUG_RETURN(1); // Didn't manage to set it up
}
+ thd_set_ha_data(this, binlog_hton, trx_data);
- trx_data= new (ha_data[binlog_hton->slot]) binlog_trx_data;
+ trx_data= new (thd_get_ha_data(this, binlog_hton)) binlog_trx_data;
DBUG_RETURN(0);
}
@@ -3439,7 +3308,7 @@ int THD::binlog_setup_trx_data()
void
THD::binlog_start_trans_and_stmt()
{
- binlog_trx_data *trx_data= (binlog_trx_data*) ha_data[binlog_hton->slot];
+ binlog_trx_data *trx_data= (binlog_trx_data*) thd_get_ha_data(this, binlog_hton);
DBUG_ENTER("binlog_start_trans_and_stmt");
DBUG_PRINT("enter", ("trx_data: 0x%lx trx_data->before_stmt_pos: %lu",
(long) trx_data,
@@ -3459,7 +3328,7 @@ THD::binlog_start_trans_and_stmt()
void THD::binlog_set_stmt_begin() {
binlog_trx_data *trx_data=
- (binlog_trx_data*) ha_data[binlog_hton->slot];
+ (binlog_trx_data*) thd_get_ha_data(this, binlog_hton);
/*
The call to binlog_trans_log_savepos() might create the trx_data
@@ -3469,14 +3338,15 @@ void THD::binlog_set_stmt_begin() {
*/
my_off_t pos= 0;
binlog_trans_log_savepos(this, &pos);
- trx_data= (binlog_trx_data*) ha_data[binlog_hton->slot];
+ trx_data= (binlog_trx_data*) thd_get_ha_data(this, binlog_hton);
trx_data->before_stmt_pos= pos;
}
int THD::binlog_flush_transaction_cache()
{
DBUG_ENTER("binlog_flush_transaction_cache");
- binlog_trx_data *trx_data= (binlog_trx_data*) ha_data[binlog_hton->slot];
+ binlog_trx_data *trx_data= (binlog_trx_data*)
+ thd_get_ha_data(this, binlog_hton);
DBUG_PRINT("enter", ("trx_data=0x%lu", (ulong) trx_data));
if (trx_data)
DBUG_PRINT("enter", ("trx_data->before_stmt_pos=%lu",
@@ -3539,7 +3409,7 @@ Rows_log_event*
THD::binlog_get_pending_rows_event() const
{
binlog_trx_data *const trx_data=
- (binlog_trx_data*) ha_data[binlog_hton->slot];
+ (binlog_trx_data*) thd_get_ha_data(this, binlog_hton);
/*
This is less than ideal, but here's the story: If there is no
trx_data, prepare_pending_rows_event() has never been called
@@ -3552,11 +3422,11 @@ THD::binlog_get_pending_rows_event() const
void
THD::binlog_set_pending_rows_event(Rows_log_event* ev)
{
- if (ha_data[binlog_hton->slot] == NULL)
+ if (thd_get_ha_data(this, binlog_hton) == NULL)
binlog_setup_trx_data();
binlog_trx_data *const trx_data=
- (binlog_trx_data*) ha_data[binlog_hton->slot];
+ (binlog_trx_data*) thd_get_ha_data(this, binlog_hton);
DBUG_ASSERT(trx_data);
trx_data->set_pending(ev);
@@ -3579,7 +3449,7 @@ MYSQL_BIN_LOG::flush_and_set_pending_rows_event(THD *thd,
int error= 0;
binlog_trx_data *const trx_data=
- (binlog_trx_data*) thd->ha_data[binlog_hton->slot];
+ (binlog_trx_data*) thd_get_ha_data(thd, binlog_hton);
DBUG_ASSERT(trx_data);
@@ -3730,7 +3600,7 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info)
goto err;
binlog_trx_data *const trx_data=
- (binlog_trx_data*) thd->ha_data[binlog_hton->slot];
+ (binlog_trx_data*) thd_get_ha_data(thd, binlog_hton);
IO_CACHE *trans_log= &trx_data->trans_log;
my_off_t trans_log_pos= my_b_tell(trans_log);
if (event_info->get_cache_stmt() || trans_log_pos != 0)
@@ -3804,7 +3674,7 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info)
for (uint i= 0; i < thd->user_var_events.elements; i++)
{
BINLOG_USER_VAR_EVENT *user_var_event;
- get_dynamic(&thd->user_var_events,(gptr) &user_var_event, i);
+ get_dynamic(&thd->user_var_events,(uchar*) &user_var_event, i);
User_var_log_event e(thd, user_var_event->user_var_event->name.str,
user_var_event->user_var_event->name.length,
user_var_event->value,
@@ -3861,9 +3731,9 @@ int error_log_print(enum loglevel level, const char *format,
bool slow_log_print(THD *thd, const char *query, uint query_length,
- time_t query_start_arg)
+ ulonglong current_utime)
{
- return logger.slow_log_print(thd, query, query_length, query_start_arg);
+ return logger.slow_log_print(thd, query, query_length, current_utime);
}
@@ -3891,7 +3761,7 @@ void MYSQL_BIN_LOG::rotate_and_purge(uint flags)
#ifdef HAVE_REPLICATION
if (expire_logs_days)
{
- long purge_time= (long) (time(0) - expire_logs_days*24*60*60);
+ time_t purge_time= my_time(0) - expire_logs_days*24*60*60;
if (purge_time >= 0)
purge_logs_before_date(purge_time);
}
@@ -3931,13 +3801,120 @@ int MYSQL_BIN_LOG::write_cache(IO_CACHE *cache, bool lock_log, bool sync_log)
if (reinit_io_cache(cache, READ_CACHE, 0, 0, 0))
return ER_ERROR_ON_WRITE;
- uint bytes= my_b_bytes_in_cache(cache);
+ uint length= my_b_bytes_in_cache(cache), group, carry, hdr_offs;
+ long val;
+ uchar header[LOG_EVENT_HEADER_LEN];
+
+ /*
+ The events in the buffer have incorrect end_log_pos data
+ (relative to beginning of group rather than absolute),
+ so we'll recalculate them in situ so the binlog is always
+ correct, even in the middle of a group. This is possible
+ because we now know the start position of the group (the
+ offset of this cache in the log, if you will); all we need
+ to do is to find all event-headers, and add the position of
+ the group to the end_log_pos of each event. This is pretty
+ straight forward, except that we read the cache in segments,
+ so an event-header might end up on the cache-border and get
+ split.
+ */
+
+ group= (uint)my_b_tell(&log_file);
+ hdr_offs= carry= 0;
+
do
{
- if (my_b_write(&log_file, cache->read_pos, bytes))
+
+ /*
+ if we only got a partial header in the last iteration,
+ get the other half now and process a full header.
+ */
+ if (unlikely(carry > 0))
+ {
+ DBUG_ASSERT(carry < LOG_EVENT_HEADER_LEN);
+
+ /* assemble both halves */
+ memcpy(&header[carry], (char *)cache->read_pos, LOG_EVENT_HEADER_LEN - carry);
+
+ /* fix end_log_pos */
+ val= uint4korr(&header[LOG_POS_OFFSET]) + group;
+ int4store(&header[LOG_POS_OFFSET], val);
+
+ /* write the first half of the split header */
+ if (my_b_write(&log_file, header, carry))
+ return ER_ERROR_ON_WRITE;
+
+ /*
+ copy fixed second half of header to cache so the correct
+ version will be written later.
+ */
+ memcpy((char *)cache->read_pos, &header[carry], LOG_EVENT_HEADER_LEN - carry);
+
+ /* next event header at ... */
+ hdr_offs = uint4korr(&header[EVENT_LEN_OFFSET]) - carry;
+
+ carry= 0;
+ }
+
+ /* if there is anything to write, process it. */
+
+ if (likely(length > 0))
+ {
+ /*
+ process all event-headers in this (partial) cache.
+ if next header is beyond current read-buffer,
+ we'll get it later (though not necessarily in the
+ very next iteration, just "eventually").
+ */
+
+ while (hdr_offs < length)
+ {
+ /*
+ partial header only? save what we can get, process once
+ we get the rest.
+ */
+
+ if (hdr_offs + LOG_EVENT_HEADER_LEN > length)
+ {
+ carry= length - hdr_offs;
+ memcpy(header, (char *)cache->read_pos + hdr_offs, carry);
+ length= hdr_offs;
+ }
+ else
+ {
+ /* we've got a full event-header, and it came in one piece */
+
+ uchar *log_pos= (uchar *)cache->read_pos + hdr_offs + LOG_POS_OFFSET;
+
+ /* fix end_log_pos */
+ val= uint4korr(log_pos) + group;
+ int4store(log_pos, val);
+
+ /* next event header at ... */
+ log_pos= (uchar *)cache->read_pos + hdr_offs + EVENT_LEN_OFFSET;
+ hdr_offs += uint4korr(log_pos);
+
+ }
+ }
+
+ /*
+ Adjust hdr_offs. Note that it may still point beyond the segment
+ read in the next iteration; if the current event is very long,
+ it may take a couple of read-iterations (and subsequent adjustments
+ of hdr_offs) for it to point into the then-current segment.
+ If we have a split header (!carry), hdr_offs will be set at the
+ beginning of the next iteration, overwriting the value we set here:
+ */
+ hdr_offs -= length;
+ }
+
+ /* Write data to the binary log file */
+ if (my_b_write(&log_file, cache->read_pos, length))
return ER_ERROR_ON_WRITE;
- cache->read_pos= cache->read_end;
- } while ((bytes= my_b_fill(cache)));
+ cache->read_pos=cache->read_end; // Mark buffer used up
+ } while ((length= my_b_fill(cache)));
+
+ DBUG_ASSERT(carry == 0);
if (sync_log)
flush_and_sync();
@@ -3976,6 +3953,7 @@ bool MYSQL_BIN_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event)
/* NULL would represent nothing to replicate after ROLLBACK */
DBUG_ASSERT(commit_event != NULL);
+ DBUG_ASSERT(is_open());
if (likely(is_open())) // Should always be true
{
/*
@@ -4014,7 +3992,7 @@ bool MYSQL_BIN_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event)
if ((write_error= write_cache(cache, false, false)))
goto err;
-
+
if (commit_event && commit_event->write(&log_file))
goto err;
if (flush_and_sync())
@@ -4131,8 +4109,16 @@ void MYSQL_BIN_LOG::close(uint exiting)
if (log_file.type == WRITE_CACHE && log_type == LOG_BIN)
{
my_off_t offset= BIN_LOG_HEADER_SIZE + FLAGS_OFFSET;
- byte flags=0; // clearing LOG_EVENT_BINLOG_IN_USE_F
+ my_off_t org_position= my_tell(log_file.file, MYF(0));
+ uchar flags= 0; // clearing LOG_EVENT_BINLOG_IN_USE_F
my_pwrite(log_file.file, &flags, 1, offset, MYF(0));
+ /*
+ Restore position so that anything we have in the IO_cache is written
+ to the correct position.
+ We need the seek here, as my_pwrite() is not guaranteed to keep the
+ original position on system that doesn't support pwrite().
+ */
+ my_seek(log_file.file, org_position, MY_SEEK_SET, MYF(0));
}
/* this will cleanup IO_CACHE, sync and close the file */
@@ -4256,17 +4242,21 @@ bool flush_error_log()
(void) my_delete(err_temp, MYF(0));
if (freopen(err_temp,"a+",stdout))
{
+ int fd;
+ size_t bytes;
+ uchar buf[IO_SIZE];
+
freopen(err_temp,"a+",stderr);
(void) my_delete(err_renamed, MYF(0));
my_rename(log_error_file,err_renamed,MYF(0));
if (freopen(log_error_file,"a+",stdout))
freopen(log_error_file,"a+",stderr);
- int fd, bytes;
- char buf[IO_SIZE];
+
if ((fd = my_open(err_temp, O_RDONLY, MYF(0))) >= 0)
{
- while ((bytes = (int) my_read(fd, (byte*) buf, IO_SIZE, MYF(0))) > 0)
- my_fwrite(stderr, (byte*) buf, bytes, MYF(0));
+ while ((bytes= my_read(fd, buf, IO_SIZE, MYF(0))) &&
+ bytes != MY_FILE_ERROR)
+ my_fwrite(stderr, buf, bytes, MYF(0));
my_close(fd, MYF(0));
}
(void) my_delete(err_temp, MYF(0));
@@ -4369,7 +4359,7 @@ static void print_buffer_to_file(enum loglevel level, const char *buffer)
VOID(pthread_mutex_lock(&LOCK_error_log));
- skr=time(NULL);
+ skr= my_time(0);
localtime_r(&skr, &tm_tmp);
start=&tm_tmp;
@@ -4840,9 +4830,9 @@ void TC_LOG_MMAP::close()
pthread_cond_destroy(&pages[i].cond);
}
case 3:
- my_free((gptr)pages, MYF(0));
+ my_free((uchar*)pages, MYF(0));
case 2:
- my_munmap((byte*)data, (size_t)file_length);
+ my_munmap((char*)data, (size_t)file_length);
case 1:
my_close(fd, MYF(0));
}
@@ -4876,13 +4866,13 @@ int TC_LOG_MMAP::recover()
}
if (hash_init(&xids, &my_charset_bin, tc_log_page_size/3, 0,
- sizeof(my_xid), 0, 0, MYF(0)))
+ sizeof(my_xid), 0, 0, MYF(0)))
goto err1;
for ( ; p < end_p ; p++)
{
for (my_xid *x=p->start; x < p->end; x++)
- if (*x && my_hash_insert(&xids, (byte *)x))
+ if (*x && my_hash_insert(&xids, (uchar *)x))
goto err2; // OOM
}
@@ -5047,7 +5037,7 @@ int TC_LOG_BINLOG::log_xid(THD *thd, my_xid xid)
DBUG_ENTER("TC_LOG_BINLOG::log");
Xid_log_event xle(thd, xid);
binlog_trx_data *trx_data=
- (binlog_trx_data*) thd->ha_data[binlog_hton->slot];
+ (binlog_trx_data*) thd_get_ha_data(thd, binlog_hton);
/*
We always commit the entire transaction when writing an XID. Also
note that the return value is inverted.
@@ -5075,7 +5065,7 @@ int TC_LOG_BINLOG::recover(IO_CACHE *log, Format_description_log_event *fdle)
if (! fdle->is_valid() ||
hash_init(&xids, &my_charset_bin, TC_LOG_PAGE_SIZE/3, 0,
- sizeof(my_xid), 0, 0, MYF(0)))
+ sizeof(my_xid), 0, 0, MYF(0)))
goto err1;
init_alloc_root(&mem_root, TC_LOG_PAGE_SIZE, TC_LOG_PAGE_SIZE);
@@ -5087,8 +5077,8 @@ int TC_LOG_BINLOG::recover(IO_CACHE *log, Format_description_log_event *fdle)
if (ev->get_type_code() == XID_EVENT)
{
Xid_log_event *xev=(Xid_log_event *)ev;
- byte *x=(byte *)memdup_root(&mem_root, (char *)& xev->xid,
- sizeof(xev->xid));
+ uchar *x= (uchar *) memdup_root(&mem_root, (uchar*) &xev->xid,
+ sizeof(xev->xid));
if (! x)
goto err2;
my_hash_insert(&xids, x);
@@ -5114,6 +5104,29 @@ err1:
return 1;
}
+
+#ifdef INNODB_COMPATIBILITY_HOOKS
+/**
+ Get the file name of the MySQL binlog.
+ @return the name of the binlog file
+*/
+extern "C"
+const char* mysql_bin_log_file_name(void)
+{
+ return mysql_bin_log.get_log_fname();
+}
+/**
+ Get the current position of the MySQL binlog.
+ @return byte offset from the beginning of the binlog
+*/
+extern "C"
+ulonglong mysql_bin_log_file_pos(void)
+{
+ return (ulonglong) mysql_bin_log.get_log_file()->pos_in_file;
+}
+#endif /* INNODB_COMPATIBILITY_HOOKS */
+
+
struct st_mysql_storage_engine binlog_storage_engine=
{ MYSQL_HANDLERTON_INTERFACE_VERSION };
diff --git a/sql/log.h b/sql/log.h
index ed0c3557d08..e597c986794 100644
--- a/sql/log.h
+++ b/sql/log.h
@@ -16,7 +16,7 @@
#ifndef LOG_H
#define LOG_H
-struct st_relay_log_info;
+class Relay_log_info;
class Format_description_log_event;
@@ -121,7 +121,7 @@ extern TC_LOG_DUMMY tc_log_dummy;
#define LOG_CLOSE_TO_BE_OPENED 2
#define LOG_CLOSE_STOP_EVENT 4
-struct st_relay_log_info;
+class Relay_log_info;
typedef struct st_log_info
{
@@ -198,7 +198,7 @@ public:
const char *sql_text, uint sql_text_len);
bool write(THD *thd, time_t current_time, time_t query_start_arg,
const char *user_host, uint user_host_len,
- longlong query_time, longlong lock_time, bool is_command,
+ ulonglong query_utime, ulonglong lock_utime, bool is_command,
const char *sql_text, uint sql_text_len);
bool open_slow_log(const char *log_name)
{
@@ -212,6 +212,7 @@ public:
return open(generate_name(log_name, ".log", 0, buf), LOG_NORMAL, 0,
WRITE_CACHE);
}
+
private:
time_t last_time;
};
@@ -361,7 +362,7 @@ public:
bool need_mutex, bool need_update_threads,
ulonglong *decrease_log_space);
int purge_logs_before_date(time_t purge_time);
- int purge_first_log(struct st_relay_log_info* rli, bool included);
+ int purge_first_log(Relay_log_info* rli, bool included);
bool reset_logs(THD* thd);
void close(uint exiting);
@@ -393,12 +394,12 @@ public:
virtual bool log_slow(THD *thd, time_t current_time,
time_t query_start_arg, const char *user_host,
- uint user_host_len, longlong query_time,
- longlong lock_time, bool is_command,
+ uint user_host_len, ulonglong query_utime,
+ ulonglong lock_utime, bool is_command,
const char *sql_text, uint sql_text_len)= 0;
virtual bool log_error(enum loglevel level, const char *format,
va_list args)= 0;
- virtual bool log_general(time_t event_time, const char *user_host,
+ virtual bool log_general(THD *thd, time_t event_time, const char *user_host,
uint user_host_len, int thread_id,
const char *command_type, uint command_type_len,
const char *sql_text, uint sql_text_len,
@@ -412,27 +413,7 @@ int check_if_log_table(uint db_len, const char *db, uint table_name_len,
class Log_to_csv_event_handler: public Log_event_handler
{
- /*
- We create artificial THD for each of the logs. This is to avoid
- locking issues: we don't want locks on the log tables reside in the
- THD's of the query. The reason is the locking order and duration.
- */
- THD *general_log_thd, *slow_log_thd;
- /*
- This is for the thread, which called tmp_close_log_tables. The thread
- will be allowed to write-lock the log tables (as it explicitly disabled
- logging). This is used for such operations as REPAIR, which require
- exclusive lock on the log tables.
- NOTE: there can be only one priviliged thread, as one should
- lock logger with logger.lock() before calling tmp_close_log_tables().
- So no other thread could get privileged status at the same time.
- */
- THD *privileged_thread;
friend class LOGGER;
- TABLE_LIST general_log, slow_log;
-
-private:
- bool open_log_table(uint log_type);
public:
Log_to_csv_event_handler();
@@ -442,23 +423,18 @@ public:
virtual bool log_slow(THD *thd, time_t current_time,
time_t query_start_arg, const char *user_host,
- uint user_host_len, longlong query_time,
- longlong lock_time, bool is_command,
+ uint user_host_len, ulonglong query_utime,
+ ulonglong lock_utime, bool is_command,
const char *sql_text, uint sql_text_len);
virtual bool log_error(enum loglevel level, const char *format,
va_list args);
- virtual bool log_general(time_t event_time, const char *user_host,
+ virtual bool log_general(THD *thd, time_t event_time, const char *user_host,
uint user_host_len, int thread_id,
const char *command_type, uint command_type_len,
const char *sql_text, uint sql_text_len,
- CHARSET_INFO *client_cs);
- void tmp_close_log_tables(THD *thd);
- void close_log_table(uint log_type, bool lock_in_use);
- bool reopen_log_table(uint log_type);
- THD* get_privileged_thread()
- {
- return privileged_thread;
- }
+ CHARSET_INFO *client_cs);
+
+ int activate_log(THD *thd, uint log_type);
};
@@ -479,12 +455,12 @@ public:
virtual bool log_slow(THD *thd, time_t current_time,
time_t query_start_arg, const char *user_host,
- uint user_host_len, longlong query_time,
- longlong lock_time, bool is_command,
+ uint user_host_len, ulonglong query_utime,
+ ulonglong lock_utime, bool is_command,
const char *sql_text, uint sql_text_len);
virtual bool log_error(enum loglevel level, const char *format,
va_list args);
- virtual bool log_general(time_t event_time, const char *user_host,
+ virtual bool log_general(THD *thd, time_t event_time, const char *user_host,
uint user_host_len, int thread_id,
const char *command_type, uint command_type_len,
const char *sql_text, uint sql_text_len,
@@ -499,7 +475,7 @@ public:
/* Class which manages slow, general and error log event handlers */
class LOGGER
{
- pthread_mutex_t LOCK_logger;
+ rw_lock_t LOCK_logger;
/* flag to check whether logger mutex is initialized */
uint inited;
@@ -519,21 +495,10 @@ public:
LOGGER() : inited(0), table_log_handler(NULL),
file_log_handler(NULL), is_log_tables_initialized(FALSE)
{}
- void lock() { (void) pthread_mutex_lock(&LOCK_logger); }
- void unlock() { (void) pthread_mutex_unlock(&LOCK_logger); }
- void tmp_close_log_tables(THD *thd);
- bool is_log_table_enabled(uint log_table_type)
- {
- switch (log_table_type) {
- case QUERY_LOG_SLOW:
- return table_log_handler && table_log_handler->slow_log.table != 0;
- case QUERY_LOG_GENERAL:
- return table_log_handler && table_log_handler->general_log.table != 0;
- default:
- DBUG_ASSERT(0);
- return FALSE; /* make compiler happy */
- }
- }
+ void lock_shared() { rw_rdlock(&LOCK_logger); }
+ void lock_exclusive() { rw_wrlock(&LOCK_logger); }
+ void unlock() { rw_unlock(&LOCK_logger); }
+ bool is_log_table_enabled(uint log_table_type);
/*
We want to initialize all log mutexes as soon as possible,
but we cannot do it in constructor, as safe_mutex relies on
@@ -543,20 +508,6 @@ public:
void init_base();
void init_log_tables();
bool flush_logs(THD *thd);
- THD *get_general_log_thd()
- {
- if (table_log_handler)
- return (THD *) table_log_handler->general_log_thd;
- else
- return NULL;
- }
- THD *get_slow_log_thd()
- {
- if (table_log_handler)
- return (THD *) table_log_handler->slow_log_thd;
- else
- return NULL;
- }
/* Perform basic logger cleanup. this will leave e.g. error log open. */
void cleanup_base();
/* Free memory. Nothing could be logged after this function is called */
@@ -564,14 +515,10 @@ public:
bool error_log_print(enum loglevel level, const char *format,
va_list args);
bool slow_log_print(THD *thd, const char *query, uint query_length,
- time_t query_start_arg);
+ ulonglong current_utime);
bool general_log_print(THD *thd,enum enum_server_command command,
const char *format, va_list args);
- void close_log_table(uint log_type, bool lock_in_use);
- bool reopen_log_table(uint log_type);
- bool reopen_log_tables();
-
/* we use this function to setup all enabled log event handlers */
int set_handlers(uint error_log_printer,
uint slow_log_printer,
@@ -593,23 +540,16 @@ public:
return file_log_handler->get_mysql_log();
return NULL;
}
- THD* get_privileged_thread()
- {
- if (table_log_handler)
- return table_log_handler->get_privileged_thread();
- else
- return NULL;
- }
};
enum enum_binlog_format {
- BINLOG_FORMAT_STMT= 0, // statement-based
- BINLOG_FORMAT_ROW= 1, // row_based
/*
statement-based except for cases where only row-based can work (UUID()
etc):
*/
- BINLOG_FORMAT_MIXED= 2,
+ BINLOG_FORMAT_MIXED= 0,
+ BINLOG_FORMAT_STMT= 1, // statement-based
+ BINLOG_FORMAT_ROW= 2, // row_based
/*
This value is last, after the end of binlog_format_typelib: it has no
corresponding cell in this typelib. We use this value to be able to know if
diff --git a/sql/log_event.cc b/sql/log_event.cc
index b7c9548e642..97f5ad2e3bd 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -146,12 +146,11 @@ static void pretty_print_str(IO_CACHE* cache, char* str, int len)
#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
-static void clear_all_errors(THD *thd, struct st_relay_log_info *rli)
+static void clear_all_errors(THD *thd, Relay_log_info *rli)
{
thd->query_error = 0;
thd->clear_error();
- *rli->last_slave_error = 0;
- rli->last_slave_errno = 0;
+ rli->clear_error();
}
@@ -299,10 +298,10 @@ static void cleanup_load_tmpdir()
static bool write_str(IO_CACHE *file, char *str, uint length)
{
- byte tmp[1];
- tmp[0]= (byte) length;
+ uchar tmp[1];
+ tmp[0]= (uchar) length;
return (my_b_safe_write(file, tmp, sizeof(tmp)) ||
- my_b_safe_write(file, (byte*) str, length));
+ my_b_safe_write(file, (uchar*) str, length));
}
@@ -310,8 +309,8 @@ static bool write_str(IO_CACHE *file, char *str, uint length)
read_str()
*/
-static inline int read_str(const char **buf, const char *buf_end, const char **str,
- uint8 *len)
+static inline int read_str(const char **buf, const char *buf_end,
+ const char **str, uint8 *len)
{
if (*buf + ((uint) (uchar) **buf) >= buf_end)
return 1;
@@ -457,7 +456,11 @@ Log_event::Log_event()
thd(0)
{
server_id= ::server_id;
- when= time(NULL);
+ /*
+ We can't call my_time() here as this would cause a call before
+ my_init() is called
+ */
+ when= 0;
log_pos= 0;
}
#endif /* !MYSQL_CLIENT */
@@ -537,7 +540,7 @@ Log_event::Log_event(const char* buf,
#ifndef MYSQL_CLIENT
#ifdef HAVE_REPLICATION
-int Log_event::do_update_pos(RELAY_LOG_INFO *rli)
+int Log_event::do_update_pos(Relay_log_info *rli)
{
/*
rli is null when (as far as I (Guilhem) know) the caller is
@@ -559,7 +562,7 @@ int Log_event::do_update_pos(RELAY_LOG_INFO *rli)
Log_event::enum_skip_reason
-Log_event::do_shall_skip(RELAY_LOG_INFO *rli)
+Log_event::do_shall_skip(Relay_log_info *rli)
{
DBUG_PRINT("info", ("ev->server_id=%lu, ::server_id=%lu,"
" rli->replicate_same_server_id=%d,"
@@ -598,7 +601,7 @@ int Log_event::net_send(Protocol *protocol, const char* log_name, my_off_t pos)
const char *event_type;
if (p)
log_name = p + 1;
-
+
protocol->prepare_for_resend();
protocol->store(log_name, &my_charset_bin);
protocol->store((ulonglong) pos);
@@ -637,7 +640,8 @@ void Log_event::init_show_field_list(List<Item>* field_list)
bool Log_event::write_header(IO_CACHE* file, ulong event_data_length)
{
- byte header[LOG_EVENT_HEADER_LEN];
+ uchar header[LOG_EVENT_HEADER_LEN];
+ ulong now;
DBUG_ENTER("Log_event::write_header");
/* Store number of bytes that will be written by this event */
@@ -688,6 +692,8 @@ bool Log_event::write_header(IO_CACHE* file, ulong event_data_length)
log_pos= my_b_safe_tell(file)+data_written;
}
+ now= (ulong) get_time(); // Query start time
+
/*
Header will be of size LOG_EVENT_HEADER_LEN for all events, except for
FORMAT_DESCRIPTION_EVENT and ROTATE_EVENT, where it will be
@@ -695,7 +701,7 @@ bool Log_event::write_header(IO_CACHE* file, ulong event_data_length)
because we read them before knowing the format).
*/
- int4store(header, (ulong) when); // timestamp
+ int4store(header, now); // timestamp
header[EVENT_TYPE_OFFSET]= get_type_code();
int4store(header+ SERVER_ID_OFFSET, server_id);
int4store(header+ EVENT_LEN_OFFSET, data_written);
@@ -724,7 +730,7 @@ int Log_event::read_log_event(IO_CACHE* file, String* packet,
if (log_lock)
pthread_mutex_lock(log_lock);
- if (my_b_read(file, (byte*) buf, sizeof(buf)))
+ if (my_b_read(file, (uchar*) buf, sizeof(buf)))
{
/*
If the read hits eof, we must report it as eof so the caller
@@ -804,10 +810,12 @@ end:
#ifndef MYSQL_CLIENT
Log_event* Log_event::read_log_event(IO_CACHE* file,
pthread_mutex_t* log_lock,
- const Format_description_log_event *description_event)
+ const Format_description_log_event
+ *description_event)
#else
Log_event* Log_event::read_log_event(IO_CACHE* file,
- const Format_description_log_event *description_event)
+ const Format_description_log_event
+ *description_event)
#endif
{
DBUG_ENTER("Log_event::read_log_event");
@@ -825,7 +833,7 @@ Log_event* Log_event::read_log_event(IO_CACHE* file,
LOCK_MUTEX;
DBUG_PRINT("info", ("my_b_tell: %lu", (ulong) my_b_tell(file)));
- if (my_b_read(file, (byte *) head, header_size))
+ if (my_b_read(file, (uchar *) head, header_size))
{
DBUG_PRINT("info", ("Log_event::read_log_event(IO_CACHE*,Format_desc*) \
failed my_b_read"));
@@ -859,14 +867,14 @@ failed my_b_read"));
}
// some events use the extra byte to null-terminate strings
- if (!(buf = my_malloc(data_len+1, MYF(MY_WME))))
+ if (!(buf = (char*) my_malloc(data_len+1, MYF(MY_WME))))
{
error = "Out of memory";
goto err;
}
buf[data_len] = 0;
memcpy(buf, head, header_size);
- if (my_b_read(file, (byte*) buf + header_size, data_len - header_size))
+ if (my_b_read(file, (uchar*) buf + header_size, data_len - header_size))
{
error = "read error";
goto err;
@@ -911,16 +919,15 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len,
DBUG_ENTER("Log_event::read_log_event(char*,...)");
DBUG_ASSERT(description_event != 0);
DBUG_PRINT("info", ("binlog_version: %d", description_event->binlog_version));
+ /* Check the integrity */
if (event_len < EVENT_LEN_OFFSET ||
+ buf[EVENT_TYPE_OFFSET] >= ENUM_END_EVENT ||
(uint) event_len != uint4korr(buf+EVENT_LEN_OFFSET))
{
*error="Sanity check failed"; // Needed to free buffer
DBUG_RETURN(NULL); // general sanity check - will fail on a partial read
}
- /* To check the integrity of the Log_event_type enumeration */
- DBUG_ASSERT(buf[EVENT_TYPE_OFFSET] < ENUM_END_EVENT);
-
switch(buf[EVENT_TYPE_OFFSET]) {
case QUERY_EVENT:
ev = new Query_log_event(buf, event_len, description_event, QUERY_EVENT);
@@ -1092,8 +1099,8 @@ void Log_event::print_header(IO_CACHE* file,
ptr[7], ptr[8], ptr[9], ptr[10], ptr[11], ptr[12], ptr[13],
ptr[14], ptr[15], ptr[16], ptr[17], ptr[18]);
DBUG_ASSERT(bytes_written >= 0);
- DBUG_ASSERT(static_cast<my_size_t>(bytes_written) < sizeof(emit_buf));
- my_b_write(file, (byte*) emit_buf, bytes_written);
+ DBUG_ASSERT(static_cast<size_t>(bytes_written) < sizeof(emit_buf));
+ my_b_write(file, (uchar*) emit_buf, bytes_written);
ptr += LOG_EVENT_MINIMAL_HEADER_LEN;
hexdump_from += LOG_EVENT_MINIMAL_HEADER_LEN;
}
@@ -1123,8 +1130,8 @@ void Log_event::print_header(IO_CACHE* file,
(unsigned long) (hexdump_from + (i & 0xfffffff0)),
hex_string, char_string);
DBUG_ASSERT(bytes_written >= 0);
- DBUG_ASSERT(static_cast<my_size_t>(bytes_written) < sizeof(emit_buf));
- my_b_write(file, (byte*) emit_buf, bytes_written);
+ DBUG_ASSERT(static_cast<size_t>(bytes_written) < sizeof(emit_buf));
+ my_b_write(file, (uchar*) emit_buf, bytes_written);
hex_string[0]= 0;
char_string[0]= 0;
c= char_string;
@@ -1134,7 +1141,6 @@ void Log_event::print_header(IO_CACHE* file,
}
*c= '\0';
- /* Non-full last line */
if (hex_string[0])
{
char emit_buf[256];
@@ -1144,14 +1150,14 @@ void Log_event::print_header(IO_CACHE* file,
(unsigned long) (hexdump_from + (i & 0xfffffff0)),
hex_string, char_string);
DBUG_ASSERT(bytes_written >= 0);
- DBUG_ASSERT(static_cast<my_size_t>(bytes_written) < sizeof(emit_buf));
- my_b_write(file, (byte*) emit_buf, bytes_written);
+ DBUG_ASSERT(static_cast<size_t>(bytes_written) < sizeof(emit_buf));
+ my_b_write(file, (uchar*) emit_buf, bytes_written);
}
/*
need a # to prefix the rest of printouts for example those of
Rows_log_event::print_helper().
*/
- my_b_write(file, reinterpret_cast<const byte*>("# "), 2);
+ my_b_write(file, reinterpret_cast<const uchar*>("# "), 2);
}
DBUG_VOID_RETURN;
}
@@ -1239,7 +1245,7 @@ void Query_log_event::pack_info(Protocol *protocol)
{
// TODO: show the catalog ??
char *buf, *pos;
- if (!(buf= my_malloc(9 + db_len + q_len, MYF(MY_WME))))
+ if (!(buf= (char*) my_malloc(9 + db_len + q_len, MYF(MY_WME))))
return;
pos= buf;
if (!(flags & LOG_EVENT_SUPPRESS_USE_F)
@@ -1440,12 +1446,12 @@ bool Query_log_event::write(IO_CACHE* file)
event_length= (uint) (start-buf) + get_post_header_size_for_derived() + db_len + 1 + q_len;
return (write_header(file, event_length) ||
- my_b_safe_write(file, (byte*) buf, QUERY_HEADER_LEN) ||
+ my_b_safe_write(file, (uchar*) buf, QUERY_HEADER_LEN) ||
write_post_header_for_derived(file) ||
- my_b_safe_write(file, (byte*) start_of_status,
+ my_b_safe_write(file, (uchar*) start_of_status,
(uint) (start-start_of_status)) ||
- my_b_safe_write(file, (db) ? (byte*) db : (byte*)"", db_len + 1) ||
- my_b_safe_write(file, (byte*) query, q_len)) ? 1 : 0;
+ my_b_safe_write(file, (db) ? (uchar*) db : (uchar*)"", db_len + 1) ||
+ my_b_safe_write(file, (uchar*) query, q_len)) ? 1 : 0;
}
/*
@@ -1462,20 +1468,33 @@ Query_log_event::Query_log_event()
/*
- Query_log_event::Query_log_event()
+ SYNOPSIS
+ Query_log_event::Query_log_event()
+ thd_arg - thread handle
+ query_arg - array of char representing the query
+ query_length - size of the `query_arg' array
+ using_trans - there is a modified transactional table
+ suppress_use - suppress the generation of 'USE' statements
+ killed_status_arg - an optional with default to THD::KILLED_NO_VALUE
+ if the value is different from the default, the arg
+ is set to the current thd->killed value.
+ A caller might need to masquerade thd->killed with
+ THD::NOT_KILLED.
+ DESCRIPTION
+ Creates an event for binlogging
+ The value for local `killed_status' can be supplied by caller.
*/
Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg,
ulong query_length, bool using_trans,
- bool suppress_use)
+ bool suppress_use,
+ THD::killed_state killed_status_arg)
:Log_event(thd_arg,
- ((thd_arg->tmp_table_used ? LOG_EVENT_THREAD_SPECIFIC_F : 0)
- | (suppress_use ? LOG_EVENT_SUPPRESS_USE_F : 0)),
+ (thd_arg->thread_specific_used ? LOG_EVENT_THREAD_SPECIFIC_F :
+ 0) |
+ (suppress_use ? LOG_EVENT_SUPPRESS_USE_F : 0),
using_trans),
data_buf(0), query(query_arg), catalog(thd_arg->catalog),
db(thd_arg->db), q_len((uint32) query_length),
- error_code((thd_arg->killed != THD::NOT_KILLED) ?
- ((thd_arg->system_thread & SYSTEM_THREAD_DELAYED_INSERT) ?
- 0 : thd->killed_errno()) : thd_arg->net.last_errno),
thread_id(thd_arg->thread_id),
/* save the original thread id; we already know the server id */
slave_proxy_id(thd_arg->variables.pseudo_thread_id),
@@ -1487,8 +1506,16 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg,
charset_database_number(0)
{
time_t end_time;
+
+ if (killed_status_arg == THD::KILLED_NO_VALUE)
+ killed_status_arg= thd_arg->killed;
+ error_code=
+ (killed_status_arg == THD::NOT_KILLED) ? thd_arg->net.last_errno :
+ ((thd_arg->system_thread & SYSTEM_THREAD_DELAYED_INSERT) ? 0 :
+ thd_arg->killed_errno());
+
time(&end_time);
- exec_time = (ulong) (end_time - thd->start_time);
+ exec_time = (ulong) (end_time - thd_arg->start_time);
catalog_len = (catalog) ? (uint32) strlen(catalog) : 0;
/* status_vars_len is set just before writing the event */
db_len = (db) ? (uint32) strlen(db) : 0;
@@ -1497,15 +1524,15 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg,
/*
If we don't use flags2 for anything else than options contained in
- thd->options, it would be more efficient to flags2=thd_arg->options
+ thd_arg->options, it would be more efficient to flags2=thd_arg->options
(OPTIONS_WRITTEN_TO_BINLOG 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 &.
*/
flags2= (uint32) (thd_arg->options & OPTIONS_WRITTEN_TO_BIN_LOG);
- DBUG_ASSERT(thd->variables.character_set_client->number < 256*256);
- DBUG_ASSERT(thd->variables.collation_connection->number < 256*256);
- DBUG_ASSERT(thd->variables.collation_server->number < 256*256);
+ 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);
int2store(charset, thd_arg->variables.character_set_client->number);
int2store(charset+2, thd_arg->variables.collation_connection->number);
int2store(charset+4, thd_arg->variables.collation_server->number);
@@ -1559,7 +1586,8 @@ static void copy_str_and_move(const char **src,
*/
Query_log_event::Query_log_event(const char* buf, uint event_len,
- const Format_description_log_event *description_event,
+ const Format_description_log_event
+ *description_event,
Log_event_type event_type)
:Log_event(buf, description_event), data_buf(0), query(NullS),
db(NullS), catalog_len(0), status_vars_len(0),
@@ -1752,7 +1780,7 @@ void Query_log_event::print_query_header(IO_CACHE* file,
end=int10_to_str((long) when, strmov(buff,"SET TIMESTAMP="),10);
end= strmov(end, print_event_info->delimiter);
*end++='\n';
- my_b_write(file, (byte*) buff, (uint) (end-buff));
+ my_b_write(file, (uchar*) buff, (uint) (end-buff));
if (flags & LOG_EVENT_THREAD_SPECIFIC_F)
my_b_printf(file,"SET @@session.pseudo_thread_id=%lu%s\n",
(ulong)thread_id, print_event_info->delimiter);
@@ -1836,7 +1864,7 @@ void Query_log_event::print_query_header(IO_CACHE* file,
print_event_info->charset_inited= 1;
print_event_info->charset[0]= ~charset[0]; // force a difference to force write
}
- if (unlikely(bcmp(print_event_info->charset, charset, 6)))
+ if (unlikely(bcmp((uchar*) print_event_info->charset, (uchar*) charset, 6)))
{
CHARSET_INFO *cs_info= get_charset(uint2korr(charset), MYF(MY_WME));
if (cs_info)
@@ -1859,7 +1887,8 @@ void Query_log_event::print_query_header(IO_CACHE* file,
}
if (time_zone_len)
{
- if (bcmp(print_event_info->time_zone_str, time_zone_str, time_zone_len+1))
+ if (bcmp((uchar*) print_event_info->time_zone_str,
+ (uchar*) time_zone_str, time_zone_len+1))
{
my_b_printf(file,"SET @@session.time_zone='%s'%s\n",
time_zone_str, print_event_info->delimiter);
@@ -1890,7 +1919,7 @@ void Query_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
Write_on_release_cache cache(&print_event_info->head_cache, file);
print_query_header(&cache, print_event_info);
- my_b_write(&cache, (byte*) query, q_len);
+ my_b_write(&cache, (uchar*) query, q_len);
my_b_printf(&cache, "%s\n", print_event_info->delimiter);
}
#endif /* MYSQL_CLIENT */
@@ -1902,13 +1931,13 @@ void Query_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
-int Query_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
+int Query_log_event::do_apply_event(Relay_log_info const *rli)
{
return do_apply_event(rli, query, q_len);
}
-int Query_log_event::do_apply_event(RELAY_LOG_INFO const *rli,
+int Query_log_event::do_apply_event(Relay_log_info const *rli,
const char *query_arg, uint32 q_len_arg)
{
LEX_STRING new_db;
@@ -1937,11 +1966,11 @@ int Query_log_event::do_apply_event(RELAY_LOG_INFO const *rli,
END of the current log event (COMMIT). We save it in rli so that InnoDB can
access it.
*/
- const_cast<RELAY_LOG_INFO*>(rli)->future_group_master_log_pos= log_pos;
+ const_cast<Relay_log_info*>(rli)->future_group_master_log_pos= log_pos;
DBUG_PRINT("info", ("log_pos: %lu", (ulong) log_pos));
- clear_all_errors(thd, const_cast<RELAY_LOG_INFO*>(rli));
- const_cast<RELAY_LOG_INFO*>(rli)->clear_tables_to_lock();
+ clear_all_errors(thd, const_cast<Relay_log_info*>(rli));
+ const_cast<Relay_log_info*>(rli)->clear_tables_to_lock();
/*
Note: We do not need to execute reset_one_shot_variables() if this
@@ -2053,8 +2082,9 @@ int Query_log_event::do_apply_event(RELAY_LOG_INFO const *rli,
thd->variables.collation_database= thd->db_charset;
/* Execute the query (note that we bypass dispatch_command()) */
- mysql_parse(thd, thd->query, thd->query_length);
-
+ const char* found_semicolon= NULL;
+ mysql_parse(thd, thd->query, thd->query_length, &found_semicolon);
+ log_slow_statement(thd);
}
else
{
@@ -2066,10 +2096,10 @@ int Query_log_event::do_apply_event(RELAY_LOG_INFO const *rli,
to check/fix it.
*/
if (mysql_test_parse_for_slave(thd, thd->query, thd->query_length))
- clear_all_errors(thd, const_cast<RELAY_LOG_INFO*>(rli)); /* Can ignore query */
+ clear_all_errors(thd, const_cast<Relay_log_info*>(rli)); /* Can ignore query */
else
{
- slave_print_msg(ERROR_LEVEL, rli, expected_error,
+ rli->report(ERROR_LEVEL, expected_error,
"\
Query partially completed on the master (error on master: %d) \
and was aborted. There is a chance that your master is inconsistent at this \
@@ -2098,7 +2128,7 @@ compare_errors:
!ignored_error_code(actual_error) &&
!ignored_error_code(expected_error))
{
- slave_print_msg(ERROR_LEVEL, rli, 0,
+ rli->report(ERROR_LEVEL, 0,
"\
Query caused different errors on master and slave. \
Error on master: '%s' (%d), Error on slave: '%s' (%d). \
@@ -2117,14 +2147,15 @@ Default database: '%s'. Query: '%s'",
ignored_error_code(actual_error))
{
DBUG_PRINT("info",("error ignored"));
- clear_all_errors(thd, const_cast<RELAY_LOG_INFO*>(rli));
+ clear_all_errors(thd, const_cast<Relay_log_info*>(rli));
+ thd->killed= THD::NOT_KILLED;
}
/*
Other cases: mostly we expected no error and get one.
*/
else if (thd->query_error || thd->is_fatal_error)
{
- slave_print_msg(ERROR_LEVEL, rli, actual_error,
+ rli->report(ERROR_LEVEL, actual_error,
"Error '%s' on query. Default database: '%s'. Query: '%s'",
(actual_error ? thd->net.last_error :
"unexpected success or fatal error"),
@@ -2187,7 +2218,7 @@ end:
return thd->query_error;
}
-int Query_log_event::do_update_pos(RELAY_LOG_INFO *rli)
+int Query_log_event::do_update_pos(Relay_log_info *rli)
{
/*
Note that we will not increment group* positions if we are just
@@ -2227,9 +2258,10 @@ Muted_query_log_event::Muted_query_log_event()
**************************************************************************/
#ifndef MYSQL_CLIENT
-Start_log_event_v3::Start_log_event_v3() :Log_event(), binlog_version(BINLOG_VERSION), artificial_event(0)
+Start_log_event_v3::Start_log_event_v3()
+ :Log_event(), created(0), binlog_version(BINLOG_VERSION),
+ artificial_event(0), dont_set_created(0)
{
- created= when;
memcpy(server_version, ::server_version, ST_SERVER_VER_LEN);
}
#endif
@@ -2299,7 +2331,8 @@ void Start_log_event_v3::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
*/
Start_log_event_v3::Start_log_event_v3(const char* buf,
- const Format_description_log_event* description_event)
+ const Format_description_log_event
+ *description_event)
:Log_event(buf, description_event)
{
buf+= description_event->common_header_len;
@@ -2311,6 +2344,7 @@ Start_log_event_v3::Start_log_event_v3(const char* buf,
created= uint4korr(buf+ST_CREATED_OFFSET);
/* We use log_pos to mark if this was an artificial event or not */
artificial_event= (log_pos == 0);
+ dont_set_created= 1;
}
@@ -2324,9 +2358,11 @@ bool Start_log_event_v3::write(IO_CACHE* file)
char buff[START_V3_HEADER_LEN];
int2store(buff + ST_BINLOG_VER_OFFSET,binlog_version);
memcpy(buff + ST_SERVER_VER_OFFSET,server_version,ST_SERVER_VER_LEN);
+ if (!dont_set_created)
+ created= when= get_time();
int4store(buff + ST_CREATED_OFFSET,created);
return (write_header(file, sizeof(buff)) ||
- my_b_safe_write(file, (byte*) buff, sizeof(buff)));
+ my_b_safe_write(file, (uchar*) buff, sizeof(buff)));
}
#endif
@@ -2351,11 +2387,10 @@ bool Start_log_event_v3::write(IO_CACHE* file)
*/
#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
-int Start_log_event_v3::do_apply_event(RELAY_LOG_INFO const *rli)
+int Start_log_event_v3::do_apply_event(Relay_log_info const *rli)
{
DBUG_ENTER("Start_log_event_v3::do_apply_event");
- switch (binlog_version)
- {
+ switch (binlog_version) {
case 3:
case 4:
/*
@@ -2426,7 +2461,6 @@ Format_description_log_event::
Format_description_log_event(uint8 binlog_ver, const char* server_ver)
:Start_log_event_v3()
{
- created= when;
binlog_version= binlog_ver;
switch (binlog_ver) {
case 4: /* MySQL 5.0 */
@@ -2561,7 +2595,7 @@ Format_description_log_event(const char* buf,
DBUG_PRINT("info", ("common_header_len=%d number_of_event_types=%d",
common_header_len, number_of_event_types));
/* If alloc fails, we'll detect it in is_valid() */
- post_header_len= (uint8*) my_memdup((byte*)buf+ST_COMMON_HEADER_LEN_OFFSET+1,
+ post_header_len= (uint8*) my_memdup((uchar*)buf+ST_COMMON_HEADER_LEN_OFFSET+1,
number_of_event_types*
sizeof(*post_header_len), MYF(0));
calc_server_version_split();
@@ -2575,12 +2609,14 @@ bool Format_description_log_event::write(IO_CACHE* file)
We don't call Start_log_event_v3::write() because this would make 2
my_b_safe_write().
*/
- byte buff[FORMAT_DESCRIPTION_HEADER_LEN];
+ uchar buff[FORMAT_DESCRIPTION_HEADER_LEN];
int2store(buff + ST_BINLOG_VER_OFFSET,binlog_version);
memcpy((char*) buff + ST_SERVER_VER_OFFSET,server_version,ST_SERVER_VER_LEN);
+ if (!dont_set_created)
+ created= when= get_time();
int4store(buff + ST_CREATED_OFFSET,created);
buff[ST_COMMON_HEADER_LEN_OFFSET]= LOG_EVENT_HEADER_LEN;
- memcpy((char*) buff+ST_COMMON_HEADER_LEN_OFFSET+1, (byte*) post_header_len,
+ memcpy((char*) buff+ST_COMMON_HEADER_LEN_OFFSET+1, (uchar*) post_header_len,
LOG_EVENT_TYPES);
return (write_header(file, sizeof(buff)) ||
my_b_safe_write(file, buff, sizeof(buff)));
@@ -2588,7 +2624,7 @@ bool Format_description_log_event::write(IO_CACHE* file)
#endif
#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
-int Format_description_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
+int Format_description_log_event::do_apply_event(Relay_log_info const *rli)
{
DBUG_ENTER("Format_description_log_event::do_apply_event");
@@ -2607,12 +2643,12 @@ int Format_description_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
if (!artificial_event && created && thd->transaction.all.nht)
{
/* This is not an error (XA is safe), just an information */
- slave_print_msg(INFORMATION_LEVEL, rli, 0,
- "Rolling back unfinished transaction (no COMMIT "
- "or ROLLBACK in relay log). A probable cause is that "
- "the master died while writing the transaction to "
- "its binary log, thus rolled back too.");
- const_cast<RELAY_LOG_INFO*>(rli)->cleanup_context(thd, 1);
+ rli->report(INFORMATION_LEVEL, 0,
+ "Rolling back unfinished transaction (no COMMIT "
+ "or ROLLBACK in relay log). A probable cause is that "
+ "the master died while writing the transaction to "
+ "its binary log, thus rolled back too.");
+ const_cast<Relay_log_info*>(rli)->cleanup_context(thd, 1);
}
#endif
/*
@@ -2636,7 +2672,7 @@ int Format_description_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
DBUG_RETURN(0);
}
-int Format_description_log_event::do_update_pos(RELAY_LOG_INFO *rli)
+int Format_description_log_event::do_update_pos(Relay_log_info *rli)
{
/* save the information describing this binlog */
delete rli->relay_log.description_event_for_exec;
@@ -2667,7 +2703,7 @@ int Format_description_log_event::do_update_pos(RELAY_LOG_INFO *rli)
}
Log_event::enum_skip_reason
-Format_description_log_event::do_shall_skip(RELAY_LOG_INFO *rli)
+Format_description_log_event::do_shall_skip(Relay_log_info *rli)
{
return Log_event::EVENT_SKIP_NOT;
}
@@ -2835,7 +2871,7 @@ void Load_log_event::pack_info(Protocol *protocol)
{
char *buf, *end;
- if (!(buf= my_malloc(get_query_buffer_length(), MYF(MY_WME))))
+ if (!(buf= (char*) my_malloc(get_query_buffer_length(), MYF(MY_WME))))
return;
print_query(TRUE, buf, &end, 0, 0);
protocol->store(buf, end-buf, &my_charset_bin);
@@ -2859,7 +2895,7 @@ bool Load_log_event::write_data_header(IO_CACHE* file)
buf[L_TBL_LEN_OFFSET] = (char)table_name_len;
buf[L_DB_LEN_OFFSET] = (char)db_len;
int4store(buf + L_NUM_FIELDS_OFFSET, num_fields);
- return my_b_safe_write(file, (byte*)buf, LOAD_HEADER_LEN) != 0;
+ return my_b_safe_write(file, (uchar*)buf, LOAD_HEADER_LEN) != 0;
}
@@ -2873,13 +2909,13 @@ bool Load_log_event::write_data_body(IO_CACHE* file)
return 1;
if (num_fields && fields && field_lens)
{
- if (my_b_safe_write(file, (byte*)field_lens, num_fields) ||
- my_b_safe_write(file, (byte*)fields, field_block_len))
+ if (my_b_safe_write(file, (uchar*)field_lens, num_fields) ||
+ my_b_safe_write(file, (uchar*)fields, field_block_len))
return 1;
}
- return (my_b_safe_write(file, (byte*)table_name, table_name_len + 1) ||
- my_b_safe_write(file, (byte*)db, db_len + 1) ||
- my_b_safe_write(file, (byte*)fname, fname_len));
+ return (my_b_safe_write(file, (uchar*)table_name, table_name_len + 1) ||
+ my_b_safe_write(file, (uchar*)db, db_len + 1) ||
+ my_b_safe_write(file, (uchar*)fname, fname_len));
}
@@ -2892,8 +2928,9 @@ Load_log_event::Load_log_event(THD *thd_arg, sql_exchange *ex,
List<Item> &fields_arg,
enum enum_duplicates handle_dup,
bool ignore, bool using_trans)
- :Log_event(thd_arg, !thd_arg->tmp_table_used ?
- 0 : LOG_EVENT_THREAD_SPECIFIC_F, using_trans),
+ :Log_event(thd_arg,
+ thd_arg->thread_specific_used ? LOG_EVENT_THREAD_SPECIFIC_F : 0,
+ using_trans),
thread_id(thd_arg->thread_id),
slave_proxy_id(thd_arg->variables.pseudo_thread_id),
num_fields(0),fields(0),
@@ -3209,7 +3246,7 @@ void Load_log_event::set_fields(const char* affected_db,
1 Failure
*/
-int Load_log_event::do_apply_event(NET* net, RELAY_LOG_INFO const *rli,
+int Load_log_event::do_apply_event(NET* net, Relay_log_info const *rli,
bool use_rli_only_for_errors)
{
LEX_STRING new_db;
@@ -3219,22 +3256,24 @@ int Load_log_event::do_apply_event(NET* net, RELAY_LOG_INFO const *rli,
DBUG_ASSERT(thd->query == 0);
thd->query_length= 0; // Should not be needed
thd->query_error= 0;
- clear_all_errors(thd, const_cast<RELAY_LOG_INFO*>(rli));
+ clear_all_errors(thd, const_cast<Relay_log_info*>(rli));
/* see Query_log_event::do_apply_event() and BUG#13360 */
DBUG_ASSERT(!rli->m_table_map.count());
/*
- Usually mysql_init_query() is called by mysql_parse(), but we need it here
+ Usually lex_start() is called by mysql_parse(), but we need it here
as the present method does not call mysql_parse().
*/
- mysql_init_query(thd, 0, 0);
+ lex_start(thd);
+ mysql_reset_thd_for_next_command(thd);
+
if (!use_rli_only_for_errors)
{
/*
Saved for InnoDB, see comment in
Query_log_event::do_apply_event()
*/
- const_cast<RELAY_LOG_INFO*>(rli)->future_group_master_log_pos= log_pos;
+ const_cast<Relay_log_info*>(rli)->future_group_master_log_pos= log_pos;
DBUG_PRINT("info", ("log_pos: %lu", (ulong) log_pos));
}
@@ -3427,6 +3466,10 @@ error:
thd->query_length= 0;
VOID(pthread_mutex_unlock(&LOCK_thread_count));
close_thread_tables(thd);
+
+ DBUG_EXECUTE_IF("LOAD_DATA_INFILE_has_fatal_error",
+ thd->query_error= 0; thd->is_fatal_error= 1;);
+
if (thd->query_error)
{
/* this err/sql_errno code is copy-paste from net_send_error() */
@@ -3439,19 +3482,25 @@ error:
sql_errno=ER_UNKNOWN_ERROR;
err=ER(sql_errno);
}
- slave_print_msg(ERROR_LEVEL, rli, sql_errno,"\
+ rli->report(ERROR_LEVEL, sql_errno,"\
Error '%s' running LOAD DATA INFILE on table '%s'. Default database: '%s'",
err, (char*)table_name, print_slave_db_safe(remember_db));
free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC));
return 1;
}
free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC));
-
+
if (thd->is_fatal_error)
{
- slave_print_msg(ERROR_LEVEL, rli, ER_UNKNOWN_ERROR, "\
-Fatal error running LOAD DATA INFILE on table '%s'. Default database: '%s'",
- (char*)table_name, print_slave_db_safe(remember_db));
+ char buf[256];
+ my_snprintf(buf, sizeof(buf),
+ "Running LOAD DATA INFILE on table '%-.64s'."
+ " Default database: '%-.64s'",
+ (char*)table_name,
+ print_slave_db_safe(remember_db));
+
+ rli->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR,
+ ER(ER_SLAVE_FATAL_ERROR), buf);
return 1;
}
@@ -3498,7 +3547,7 @@ void Rotate_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
print_header(&cache, print_event_info, FALSE);
my_b_printf(&cache, "\tRotate to ");
if (new_log_ident)
- my_b_write(&cache, (byte*) new_log_ident, (uint)ident_len);
+ my_b_write(&cache, (uchar*) new_log_ident, (uint)ident_len);
my_b_printf(&cache, " pos: %s\n", llstr(pos, buf));
}
#endif /* MYSQL_CLIENT */
@@ -3564,8 +3613,8 @@ bool Rotate_log_event::write(IO_CACHE* file)
char buf[ROTATE_HEADER_LEN];
int8store(buf + R_POS_OFFSET, pos);
return (write_header(file, ROTATE_HEADER_LEN + ident_len) ||
- my_b_safe_write(file, (byte*)buf, ROTATE_HEADER_LEN) ||
- my_b_safe_write(file, (byte*)new_log_ident, (uint) ident_len));
+ my_b_safe_write(file, (uchar*)buf, ROTATE_HEADER_LEN) ||
+ my_b_safe_write(file, (uchar*)new_log_ident, (uint) ident_len));
}
#endif
@@ -3588,7 +3637,7 @@ bool Rotate_log_event::write(IO_CACHE* file)
*/
#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
-int Rotate_log_event::do_update_pos(RELAY_LOG_INFO *rli)
+int Rotate_log_event::do_update_pos(Relay_log_info *rli)
{
DBUG_ENTER("Rotate_log_event::do_update_pos");
#ifndef DBUG_OFF
@@ -3658,7 +3707,7 @@ int Rotate_log_event::do_update_pos(RELAY_LOG_INFO *rli)
Log_event::enum_skip_reason
-Rotate_log_event::do_shall_skip(RELAY_LOG_INFO *rli)
+Rotate_log_event::do_shall_skip(Relay_log_info *rli)
{
enum_skip_reason reason= Log_event::do_shall_skip(rli);
@@ -3732,8 +3781,8 @@ const char* Intvar_log_event::get_var_type_name()
#ifndef MYSQL_CLIENT
bool Intvar_log_event::write(IO_CACHE* file)
{
- byte buf[9];
- buf[I_TYPE_OFFSET]= (byte) type;
+ uchar buf[9];
+ buf[I_TYPE_OFFSET]= (uchar) type;
int8store(buf + I_VAL_OFFSET, val);
return (write_header(file, sizeof(buf)) ||
my_b_safe_write(file, buf, sizeof(buf)));
@@ -3784,13 +3833,13 @@ void Intvar_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
*/
#if defined(HAVE_REPLICATION)&& !defined(MYSQL_CLIENT)
-int Intvar_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
+int Intvar_log_event::do_apply_event(Relay_log_info const *rli)
{
/*
We are now in a statement until the associated query log event has
been processed.
*/
- const_cast<RELAY_LOG_INFO*>(rli)->set_flag(RELAY_LOG_INFO::IN_STMT);
+ const_cast<Relay_log_info*>(rli)->set_flag(Relay_log_info::IN_STMT);
switch (type) {
case LAST_INSERT_ID_EVENT:
@@ -3804,7 +3853,7 @@ int Intvar_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
return 0;
}
-int Intvar_log_event::do_update_pos(RELAY_LOG_INFO *rli)
+int Intvar_log_event::do_update_pos(Relay_log_info *rli)
{
rli->inc_event_relay_log_pos();
return 0;
@@ -3812,7 +3861,7 @@ int Intvar_log_event::do_update_pos(RELAY_LOG_INFO *rli)
Log_event::enum_skip_reason
-Intvar_log_event::do_shall_skip(RELAY_LOG_INFO *rli)
+Intvar_log_event::do_shall_skip(Relay_log_info *rli)
{
/*
It is a common error to set the slave skip counter to 1 instead of
@@ -3861,7 +3910,7 @@ Rand_log_event::Rand_log_event(const char* buf,
#ifndef MYSQL_CLIENT
bool Rand_log_event::write(IO_CACHE* file)
{
- byte buf[16];
+ uchar buf[16];
int8store(buf + RAND_SEED1_OFFSET, seed1);
int8store(buf + RAND_SEED2_OFFSET, seed2);
return (write_header(file, sizeof(buf)) ||
@@ -3890,20 +3939,20 @@ void Rand_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
-int Rand_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
+int Rand_log_event::do_apply_event(Relay_log_info const *rli)
{
/*
We are now in a statement until the associated query log event has
been processed.
*/
- const_cast<RELAY_LOG_INFO*>(rli)->set_flag(RELAY_LOG_INFO::IN_STMT);
+ const_cast<Relay_log_info*>(rli)->set_flag(Relay_log_info::IN_STMT);
thd->rand.seed1= (ulong) seed1;
thd->rand.seed2= (ulong) seed2;
return 0;
}
-int Rand_log_event::do_update_pos(RELAY_LOG_INFO *rli)
+int Rand_log_event::do_update_pos(Relay_log_info *rli)
{
rli->inc_event_relay_log_pos();
return 0;
@@ -3911,7 +3960,7 @@ int Rand_log_event::do_update_pos(RELAY_LOG_INFO *rli)
Log_event::enum_skip_reason
-Rand_log_event::do_shall_skip(RELAY_LOG_INFO *rli)
+Rand_log_event::do_shall_skip(Relay_log_info *rli)
{
/*
It is a common error to set the slave skip counter to 1 instead of
@@ -3968,7 +4017,7 @@ Xid_log_event(const char* buf,
bool Xid_log_event::write(IO_CACHE* file)
{
return write_header(file, sizeof(xid)) ||
- my_b_safe_write(file, (byte*) &xid, sizeof(xid));
+ my_b_safe_write(file, (uchar*) &xid, sizeof(xid));
}
#endif
@@ -3993,7 +4042,7 @@ void Xid_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
-int Xid_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
+int Xid_log_event::do_apply_event(Relay_log_info const *rli)
{
/* For a slave Xid_log_event is COMMIT */
general_log_print(thd, COM_QUERY,
@@ -4016,7 +4065,8 @@ void User_var_log_event::pack_info(Protocol* protocol)
if (is_null)
{
- buf= my_malloc(val_offset + 5, MYF(MY_WME));
+ if (!(buf= (char*) my_malloc(val_offset + 5, MYF(MY_WME))))
+ return;
strmov(buf + val_offset, "NULL");
event_len= val_offset + 4;
}
@@ -4026,28 +4076,37 @@ void User_var_log_event::pack_info(Protocol* protocol)
case REAL_RESULT:
double real_val;
float8get(real_val, val);
- buf= my_malloc(val_offset + FLOATING_POINT_BUFFER, MYF(MY_WME));
+ if (!(buf= (char*) my_malloc(val_offset + FLOATING_POINT_BUFFER,
+ MYF(MY_WME))))
+ return;
event_len+= my_sprintf(buf + val_offset,
(buf + val_offset, "%.14g", real_val));
break;
case INT_RESULT:
- buf= my_malloc(val_offset + 22, MYF(MY_WME));
+ if (!(buf= (char*) my_malloc(val_offset + 22, MYF(MY_WME))))
+ return;
event_len= longlong10_to_str(uint8korr(val), buf + val_offset,-10)-buf;
break;
case DECIMAL_RESULT:
{
- buf= my_malloc(val_offset + DECIMAL_MAX_STR_LENGTH, MYF(MY_WME));
+ if (!(buf= (char*) my_malloc(val_offset + DECIMAL_MAX_STR_LENGTH,
+ MYF(MY_WME))))
+ return;
String str(buf+val_offset, DECIMAL_MAX_STR_LENGTH, &my_charset_bin);
my_decimal dec;
- binary2my_decimal(E_DEC_FATAL_ERROR, val+2, &dec, val[0], val[1]);
+ binary2my_decimal(E_DEC_FATAL_ERROR, (uchar*) (val+2), &dec, val[0],
+ val[1]);
my_decimal2string(E_DEC_FATAL_ERROR, &dec, 0, 0, 0, &str);
event_len= str.length() + val_offset;
break;
}
case STRING_RESULT:
/* 15 is for 'COLLATE' and other chars */
- buf= my_malloc(event_len+val_len*2+1+2*MY_CS_NAME_SIZE+15, MYF(MY_WME));
+ buf= (char*) my_malloc(event_len+val_len*2+1+2*MY_CS_NAME_SIZE+15,
+ MYF(MY_WME));
CHARSET_INFO *cs;
+ if (!buf)
+ return;
if (!(cs= get_charset(charset_number, MYF(0))))
{
strmov(buf+val_offset, "???");
@@ -4069,11 +4128,11 @@ void User_var_log_event::pack_info(Protocol* protocol)
}
buf[0]= '@';
buf[1]= '`';
+ memcpy(buf+2, name, name_len);
buf[2+name_len]= '`';
buf[3+name_len]= '=';
- memcpy(buf+2, name, name_len);
protocol->store(buf, event_len, &my_charset_bin);
- my_free(buf, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(buf, MYF(0));
}
#endif /* !MYSQL_CLIENT */
@@ -4113,7 +4172,7 @@ bool User_var_log_event::write(IO_CACHE* file)
char buf[UV_NAME_LEN_SIZE];
char buf1[UV_VAL_IS_NULL + UV_VAL_TYPE_SIZE +
UV_CHARSET_NUMBER_SIZE + UV_VAL_LEN_SIZE];
- char buf2[max(8, DECIMAL_MAX_FIELD_SIZE + 2)], *pos= buf2;
+ uchar buf2[max(8, DECIMAL_MAX_FIELD_SIZE + 2)], *pos= buf2;
uint buf1_length;
ulong event_length;
@@ -4122,7 +4181,7 @@ bool User_var_log_event::write(IO_CACHE* file)
if ((buf1[0]= is_null))
{
buf1_length= 1;
- val_len= 0;
+ val_len= 0; // Length of 'pos'
}
else
{
@@ -4147,7 +4206,7 @@ bool User_var_log_event::write(IO_CACHE* file)
break;
}
case STRING_RESULT:
- pos= val;
+ pos= (uchar*) val;
break;
case ROW_RESULT:
default:
@@ -4162,10 +4221,10 @@ bool User_var_log_event::write(IO_CACHE* file)
event_length= sizeof(buf)+ name_len + buf1_length + val_len;
return (write_header(file, event_length) ||
- my_b_safe_write(file, (byte*) buf, sizeof(buf)) ||
- my_b_safe_write(file, (byte*) name, name_len) ||
- my_b_safe_write(file, (byte*) buf1, buf1_length) ||
- my_b_safe_write(file, (byte*) pos, val_len));
+ my_b_safe_write(file, (uchar*) buf, sizeof(buf)) ||
+ my_b_safe_write(file, (uchar*) name, name_len) ||
+ my_b_safe_write(file, (uchar*) buf1, buf1_length) ||
+ my_b_safe_write(file, pos, val_len));
}
#endif
@@ -4187,7 +4246,7 @@ void User_var_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
}
my_b_printf(&cache, "SET @`");
- my_b_write(&cache, (byte*) name, (uint) (name_len));
+ my_b_write(&cache, (uchar*) name, (uint) (name_len));
my_b_printf(&cache, "`");
if (is_null)
@@ -4218,7 +4277,7 @@ void User_var_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
dec.len= 10;
dec.buf= dec_buf;
- bin2decimal(val+2, &dec, precision, scale);
+ bin2decimal((uchar*) val+2, &dec, precision, scale);
decimal2string(&dec, str_buf, &str_len, 0, 0, 0);
str_buf[str_len]= 0;
my_b_printf(&cache, ":=%s%s\n", str_buf, print_event_info->delimiter);
@@ -4280,7 +4339,7 @@ void User_var_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
*/
#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
-int User_var_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
+int User_var_log_event::do_apply_event(Relay_log_info const *rli)
{
Item *it= 0;
CHARSET_INFO *charset;
@@ -4296,7 +4355,7 @@ int User_var_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
We are now in a statement until the associated query log event has
been processed.
*/
- const_cast<RELAY_LOG_INFO*>(rli)->set_flag(RELAY_LOG_INFO::IN_STMT);
+ const_cast<Relay_log_info*>(rli)->set_flag(Relay_log_info::IN_STMT);
if (is_null)
{
@@ -4307,7 +4366,7 @@ int User_var_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
switch (type) {
case REAL_RESULT:
float8get(real_val, val);
- it= new Item_float(real_val);
+ it= new Item_float(real_val, 0);
val= (char*) &real_val; // Pointer to value in native format
val_len= 8;
break;
@@ -4319,7 +4378,7 @@ int User_var_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
break;
case DECIMAL_RESULT:
{
- Item_decimal *dec= new Item_decimal(val+2, val[0], val[1]);
+ Item_decimal *dec= new Item_decimal((uchar*) val+2, val[0], val[1]);
it= dec;
val= (char *)dec->val_decimal(NULL);
val_len= sizeof(my_decimal);
@@ -4351,14 +4410,14 @@ int User_var_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
return 0;
}
-int User_var_log_event::do_update_pos(RELAY_LOG_INFO *rli)
+int User_var_log_event::do_update_pos(Relay_log_info *rli)
{
rli->inc_event_relay_log_pos();
return 0;
}
Log_event::enum_skip_reason
-User_var_log_event::do_shall_skip(RELAY_LOG_INFO *rli)
+User_var_log_event::do_shall_skip(Relay_log_info *rli)
{
/*
It is a common error to set the slave skip counter to 1 instead
@@ -4412,14 +4471,14 @@ void Slave_log_event::pack_info(Protocol *protocol)
#ifndef MYSQL_CLIENT
Slave_log_event::Slave_log_event(THD* thd_arg,
- RELAY_LOG_INFO* rli)
+ Relay_log_info* rli)
:Log_event(thd_arg, 0, 0) , mem_pool(0), master_host(0)
{
DBUG_ENTER("Slave_log_event");
if (!rli->inited) // QQ When can this happen ?
DBUG_VOID_RETURN;
- MASTER_INFO* mi = rli->mi;
+ Master_info* mi = rli->mi;
// TODO: re-write this better without holding both locks at the same time
pthread_mutex_lock(&mi->data_lock);
pthread_mutex_lock(&rli->data_lock);
@@ -4484,7 +4543,7 @@ bool Slave_log_event::write(IO_CACHE* file)
// log and host are already there
return (write_header(file, event_length) ||
- my_b_safe_write(file, (byte*) mem_pool, event_length));
+ my_b_safe_write(file, (uchar*) mem_pool, event_length));
}
#endif
@@ -4522,7 +4581,7 @@ Slave_log_event::Slave_log_event(const char* buf, uint event_len)
#ifndef MYSQL_CLIENT
-int Slave_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
+int Slave_log_event::do_apply_event(Relay_log_info const *rli)
{
if (mysql_bin_log.is_open())
mysql_bin_log.write(this);
@@ -4569,7 +4628,7 @@ void Stop_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
*/
#ifndef MYSQL_CLIENT
-int Stop_log_event::do_update_pos(RELAY_LOG_INFO *rli)
+int Stop_log_event::do_update_pos(Relay_log_info *rli)
{
/*
We do not want to update master_log pos because we get a rotate event
@@ -4627,8 +4686,8 @@ bool Create_file_log_event::write_data_body(IO_CACHE* file)
bool res;
if ((res= Load_log_event::write_data_body(file)) || fake_base)
return res;
- return (my_b_safe_write(file, (byte*) "", 1) ||
- my_b_safe_write(file, (byte*) block, block_len));
+ return (my_b_safe_write(file, (uchar*) "", 1) ||
+ my_b_safe_write(file, (uchar*) block, block_len));
}
@@ -4639,7 +4698,7 @@ bool Create_file_log_event::write_data_body(IO_CACHE* file)
bool Create_file_log_event::write_data_header(IO_CACHE* file)
{
bool res;
- byte buf[CREATE_FILE_HEADER_LEN];
+ uchar buf[CREATE_FILE_HEADER_LEN];
if ((res= Load_log_event::write_data_header(file)) || fake_base)
return res;
int4store(buf + CF_FILE_ID_OFFSET, file_id);
@@ -4675,7 +4734,7 @@ Create_file_log_event::Create_file_log_event(const char* buf, uint len,
uint header_len= description_event->common_header_len;
uint8 load_header_len= description_event->post_header_len[LOAD_EVENT-1];
uint8 create_file_header_len= description_event->post_header_len[CREATE_FILE_EVENT-1];
- if (!(event_buf= my_memdup((byte*) buf, len, MYF(MY_WME))) ||
+ if (!(event_buf= (char*) my_memdup(buf, len, MYF(MY_WME))) ||
copy_log_event(event_buf,len,
((buf[EVENT_TYPE_OFFSET] == LOAD_EVENT) ?
load_header_len + header_len :
@@ -4782,7 +4841,7 @@ void Create_file_log_event::pack_info(Protocol *protocol)
*/
#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
-int Create_file_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
+int Create_file_log_event::do_apply_event(Relay_log_info const *rli)
{
char proc_info[17+FN_REFLEN+10], *fname_buf;
char *ext;
@@ -4801,8 +4860,9 @@ int Create_file_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
init_io_cache(&file, fd, IO_SIZE, WRITE_CACHE, (my_off_t)0, 0,
MYF(MY_WME|MY_NABP)))
{
- slave_print_msg(ERROR_LEVEL, rli, my_errno, "Error in Create_file event: "
- "could not open file '%s'", fname_buf);
+ rli->report(ERROR_LEVEL, my_errno,
+ "Error in Create_file event: could not open file '%s'",
+ fname_buf);
goto err;
}
@@ -4812,9 +4872,9 @@ int Create_file_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
if (write_base(&file))
{
strmov(ext, ".info"); // to have it right in the error message
- slave_print_msg(ERROR_LEVEL, rli, my_errno,
- "Error in Create_file event: could not write to file '%s'",
- fname_buf);
+ rli->report(ERROR_LEVEL, my_errno,
+ "Error in Create_file event: could not write to file '%s'",
+ fname_buf);
goto err;
}
end_io_cache(&file);
@@ -4826,14 +4886,16 @@ int Create_file_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
O_WRONLY | O_BINARY | O_EXCL | O_NOFOLLOW,
MYF(MY_WME))) < 0)
{
- slave_print_msg(ERROR_LEVEL, rli, my_errno, "Error in Create_file event: "
- "could not open file '%s'", fname_buf);
+ rli->report(ERROR_LEVEL, my_errno,
+ "Error in Create_file event: could not open file '%s'",
+ fname_buf);
goto err;
}
- if (my_write(fd, (byte*) block, block_len, MYF(MY_WME+MY_NABP)))
+ if (my_write(fd, (uchar*) block, block_len, MYF(MY_WME+MY_NABP)))
{
- slave_print_msg(ERROR_LEVEL, rli, my_errno, "Error in Create_file event: "
- "write to '%s' failed", fname_buf);
+ rli->report(ERROR_LEVEL, my_errno,
+ "Error in Create_file event: write to '%s' failed",
+ fname_buf);
goto err;
}
error=0; // Everything is ok
@@ -4858,8 +4920,9 @@ err:
*/
#ifndef MYSQL_CLIENT
-Append_block_log_event::Append_block_log_event(THD* thd_arg, const char* db_arg,
- char* block_arg,
+Append_block_log_event::Append_block_log_event(THD *thd_arg,
+ const char *db_arg,
+ char *block_arg,
uint block_len_arg,
bool using_trans)
:Log_event(thd_arg,0, using_trans), block(block_arg),
@@ -4898,11 +4961,11 @@ Append_block_log_event::Append_block_log_event(const char* buf, uint len,
#ifndef MYSQL_CLIENT
bool Append_block_log_event::write(IO_CACHE* file)
{
- byte buf[APPEND_BLOCK_HEADER_LEN];
+ uchar buf[APPEND_BLOCK_HEADER_LEN];
int4store(buf + AB_FILE_ID_OFFSET, file_id);
return (write_header(file, APPEND_BLOCK_HEADER_LEN + block_len) ||
my_b_safe_write(file, buf, APPEND_BLOCK_HEADER_LEN) ||
- my_b_safe_write(file, (byte*) block, block_len));
+ my_b_safe_write(file, (uchar*) block, block_len));
}
#endif
@@ -4955,7 +5018,7 @@ int Append_block_log_event::get_create_or_append() const
Append_block_log_event::do_apply_event()
*/
-int Append_block_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
+int Append_block_log_event::do_apply_event(Relay_log_info const *rli)
{
char proc_info[17+FN_REFLEN+10], *fname= proc_info+17;
int fd;
@@ -4972,25 +5035,25 @@ int Append_block_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
O_WRONLY | O_BINARY | O_EXCL | O_NOFOLLOW,
MYF(MY_WME))) < 0)
{
- slave_print_msg(ERROR_LEVEL, rli, my_errno,
- "Error in %s event: could not create file '%s'",
- get_type_str(), fname);
+ rli->report(ERROR_LEVEL, my_errno,
+ "Error in %s event: could not create file '%s'",
+ get_type_str(), fname);
goto err;
}
}
else if ((fd = my_open(fname, O_WRONLY | O_APPEND | O_BINARY | O_NOFOLLOW,
MYF(MY_WME))) < 0)
{
- slave_print_msg(ERROR_LEVEL, rli, my_errno,
- "Error in %s event: could not open file '%s'",
- get_type_str(), fname);
+ rli->report(ERROR_LEVEL, my_errno,
+ "Error in %s event: could not open file '%s'",
+ get_type_str(), fname);
goto err;
}
- if (my_write(fd, (byte*) block, block_len, MYF(MY_WME+MY_NABP)))
+ if (my_write(fd, (uchar*) block, block_len, MYF(MY_WME+MY_NABP)))
{
- slave_print_msg(ERROR_LEVEL, rli, my_errno,
- "Error in %s event: write to '%s' failed",
- get_type_str(), fname);
+ rli->report(ERROR_LEVEL, my_errno,
+ "Error in %s event: write to '%s' failed",
+ get_type_str(), fname);
goto err;
}
error=0;
@@ -5043,7 +5106,7 @@ Delete_file_log_event::Delete_file_log_event(const char* buf, uint len,
#ifndef MYSQL_CLIENT
bool Delete_file_log_event::write(IO_CACHE* file)
{
- byte buf[DELETE_FILE_HEADER_LEN];
+ uchar buf[DELETE_FILE_HEADER_LEN];
int4store(buf + DF_FILE_ID_OFFSET, file_id);
return (write_header(file, sizeof(buf)) ||
my_b_safe_write(file, buf, sizeof(buf)));
@@ -5087,7 +5150,7 @@ void Delete_file_log_event::pack_info(Protocol *protocol)
*/
#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
-int Delete_file_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
+int Delete_file_log_event::do_apply_event(Relay_log_info const *rli)
{
char fname[FN_REFLEN+10];
char *ext= slave_load_file_stem(fname, file_id, server_id, ".data");
@@ -5108,7 +5171,8 @@ int Delete_file_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
*/
#ifndef MYSQL_CLIENT
-Execute_load_log_event::Execute_load_log_event(THD *thd_arg, const char* db_arg,
+Execute_load_log_event::Execute_load_log_event(THD *thd_arg,
+ const char* db_arg,
bool using_trans)
:Log_event(thd_arg, 0, using_trans), file_id(thd_arg->file_id), db(db_arg)
{
@@ -5139,7 +5203,7 @@ Execute_load_log_event::Execute_load_log_event(const char* buf, uint len,
#ifndef MYSQL_CLIENT
bool Execute_load_log_event::write(IO_CACHE* file)
{
- byte buf[EXEC_LOAD_HEADER_LEN];
+ uchar buf[EXEC_LOAD_HEADER_LEN];
int4store(buf + EL_FILE_ID_OFFSET, file_id);
return (write_header(file, sizeof(buf)) ||
my_b_safe_write(file, buf, sizeof(buf)));
@@ -5183,7 +5247,7 @@ void Execute_load_log_event::pack_info(Protocol *protocol)
Execute_load_log_event::do_apply_event()
*/
-int Execute_load_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
+int Execute_load_log_event::do_apply_event(Relay_log_info const *rli)
{
char fname[FN_REFLEN+10];
char *ext;
@@ -5198,8 +5262,9 @@ int Execute_load_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
init_io_cache(&file, fd, IO_SIZE, READ_CACHE, (my_off_t)0, 0,
MYF(MY_WME|MY_NABP)))
{
- slave_print_msg(ERROR_LEVEL, rli, my_errno, "Error in Exec_load event: "
- "could not open file '%s'", fname);
+ rli->report(ERROR_LEVEL, my_errno,
+ "Error in Exec_load event: could not open file '%s'",
+ fname);
goto err;
}
if (!(lev = (Load_log_event*)Log_event::read_log_event(&file,
@@ -5207,7 +5272,7 @@ int Execute_load_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
rli->relay_log.description_event_for_exec)) ||
lev->get_type_code() != NEW_LOAD_EVENT)
{
- slave_print_msg(ERROR_LEVEL, rli, 0, "Error in Exec_load event: "
+ rli->report(ERROR_LEVEL, 0, "Error in Exec_load event: "
"file '%s' appears corrupted", fname);
goto err;
}
@@ -5221,7 +5286,7 @@ int Execute_load_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
calls mysql_load()).
*/
- const_cast<RELAY_LOG_INFO*>(rli)->future_group_master_log_pos= log_pos;
+ const_cast<Relay_log_info*>(rli)->future_group_master_log_pos= log_pos;
if (lev->do_apply_event(0,rli,1))
{
/*
@@ -5232,13 +5297,11 @@ int Execute_load_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
don't want to overwrite it with the filename.
What we want instead is add the filename to the current error message.
*/
- char *tmp= my_strdup(rli->last_slave_error,MYF(MY_WME));
+ char *tmp= my_strdup(rli->last_error().message, MYF(MY_WME));
if (tmp)
{
- slave_print_msg(ERROR_LEVEL, rli,
- rli->last_slave_errno, /* ok to re-use error code */
- "%s. Failed executing load from '%s'",
- tmp, fname);
+ rli->report(ERROR_LEVEL, rli->last_error().number,
+ "%s. Failed executing load from '%s'", tmp, fname);
my_free(tmp,MYF(0));
}
goto err;
@@ -5310,7 +5373,7 @@ int Begin_load_query_log_event::get_create_or_append() const
#ifndef MYSQL_CLIENT
Execute_load_query_log_event::
-Execute_load_query_log_event(THD* thd_arg, const char* query_arg,
+Execute_load_query_log_event(THD *thd_arg, const char* query_arg,
ulong query_length_arg, uint fn_pos_start_arg,
uint fn_pos_end_arg,
enum_load_dup_handling dup_handling_arg,
@@ -5357,12 +5420,12 @@ ulong Execute_load_query_log_event::get_post_header_size_for_derived()
bool
Execute_load_query_log_event::write_post_header_for_derived(IO_CACHE* file)
{
- char buf[EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN];
+ uchar buf[EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN];
int4store(buf, file_id);
int4store(buf + 4, fn_pos_start);
int4store(buf + 4 + 4, fn_pos_end);
- *(buf + 4 + 4 + 4)= (char)dup_handling;
- return my_b_safe_write(file, (byte*) buf, EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN);
+ *(buf + 4 + 4 + 4)= (uchar) dup_handling;
+ return my_b_safe_write(file, buf, EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN);
}
#endif
@@ -5385,19 +5448,19 @@ void Execute_load_query_log_event::print(FILE* file,
if (local_fname)
{
- my_b_write(&cache, (byte*) query, fn_pos_start);
+ my_b_write(&cache, (uchar*) query, fn_pos_start);
my_b_printf(&cache, " LOCAL INFILE \'");
my_b_printf(&cache, local_fname);
my_b_printf(&cache, "\'");
if (dup_handling == LOAD_DUP_REPLACE)
my_b_printf(&cache, " REPLACE");
my_b_printf(&cache, " INTO");
- my_b_write(&cache, (byte*) query + fn_pos_end, q_len-fn_pos_end);
+ my_b_write(&cache, (uchar*) query + fn_pos_end, q_len-fn_pos_end);
my_b_printf(&cache, "%s\n", print_event_info->delimiter);
}
else
{
- my_b_write(&cache, (byte*) query, q_len);
+ my_b_write(&cache, (uchar*) query, q_len);
my_b_printf(&cache, "%s\n", print_event_info->delimiter);
}
@@ -5411,7 +5474,7 @@ void Execute_load_query_log_event::print(FILE* file,
void Execute_load_query_log_event::pack_info(Protocol *protocol)
{
char *buf, *pos;
- if (!(buf= my_malloc(9 + db_len + q_len + 10 + 21, MYF(MY_WME))))
+ if (!(buf= (char*) my_malloc(9 + db_len + q_len + 10 + 21, MYF(MY_WME))))
return;
pos= buf;
if (db && db_len)
@@ -5433,7 +5496,7 @@ void Execute_load_query_log_event::pack_info(Protocol *protocol)
int
-Execute_load_query_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
+Execute_load_query_log_event::do_apply_event(Relay_log_info const *rli)
{
char *p;
char *buf;
@@ -5441,11 +5504,16 @@ Execute_load_query_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
char *fname_end;
int error;
+ buf= (char*) my_malloc(q_len + 1 - (fn_pos_end - fn_pos_start) +
+ (FN_REFLEN + 10) + 10 + 8 + 5, MYF(MY_WME));
+
+ DBUG_EXECUTE_IF("LOAD_DATA_INFILE_has_fatal_error", my_free(buf, MYF(0)); buf= NULL;);
+
/* Replace filename and LOCAL keyword in query before executing it */
- if (!(buf = my_malloc(q_len + 1 - (fn_pos_end - fn_pos_start) +
- (FN_REFLEN + 10) + 10 + 8 + 5, MYF(MY_WME))))
+ if (buf == NULL)
{
- slave_print_msg(ERROR_LEVEL, rli, my_errno, "Not enough memory");
+ rli->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR,
+ ER(ER_SLAVE_FATAL_ERROR), "Not enough memory");
return 1;
}
@@ -5505,7 +5573,7 @@ bool sql_ex_info::write_data(IO_CACHE* file)
write_str(file, line_term, (uint) line_term_len) ||
write_str(file, line_start, (uint) line_start_len) ||
write_str(file, escaped, (uint) escaped_len) ||
- my_b_safe_write(file,(byte*) &opt_flags,1));
+ my_b_safe_write(file,(uchar*) &opt_flags,1));
}
else
{
@@ -5517,7 +5585,7 @@ bool sql_ex_info::write_data(IO_CACHE* file)
old_ex.escaped= *escaped;
old_ex.opt_flags= opt_flags;
old_ex.empty_flags=empty_flags;
- return my_b_safe_write(file, (byte*) &old_ex, sizeof(old_ex)) != 0;
+ return my_b_safe_write(file, (uchar*) &old_ex, sizeof(old_ex)) != 0;
}
}
@@ -5585,14 +5653,16 @@ Rows_log_event::Rows_log_event(THD *thd_arg, TABLE *tbl_arg, ulong tid,
m_table(tbl_arg),
m_table_id(tid),
m_width(tbl_arg ? tbl_arg->s->fields : 1),
- m_rows_buf(0), m_rows_cur(0), m_rows_end(0),
- m_flags(0)
+ m_rows_buf(0), m_rows_cur(0), m_rows_end(0), m_flags(0)
+#ifdef HAVE_REPLICATION
+ ,m_key(NULL), m_curr_row(NULL), m_curr_row_end(NULL)
+#endif
{
/*
We allow a special form of dummy event when the table, and cols
are null and the table id is ~0UL. This is a temporary
solution, to be able to terminate a started statement in the
- binary log: the extreneous events will be removed in the future.
+ binary log: the extraneous events will be removed in the future.
*/
DBUG_ASSERT(tbl_arg && tbl_arg->s && tid != ~0UL ||
!tbl_arg && !cols && tid == ~0UL);
@@ -5601,15 +5671,18 @@ Rows_log_event::Rows_log_event(THD *thd_arg, TABLE *tbl_arg, ulong tid,
set_flags(NO_FOREIGN_KEY_CHECKS_F);
if (thd_arg->options & OPTION_RELAXED_UNIQUE_CHECKS)
set_flags(RELAXED_UNIQUE_CHECKS_F);
- /* if bitmap_init fails, catched in is_valid() */
+ /* if bitmap_init fails, caught in is_valid() */
if (likely(!bitmap_init(&m_cols,
m_width <= sizeof(m_bitbuf)*8 ? m_bitbuf : NULL,
- (m_width + 7) & ~7UL,
+ m_width,
false)))
{
/* Cols can be zero if this is a dummy binrows event */
if (likely(cols != NULL))
+ {
memcpy(m_cols.bitmap, cols->bitmap, no_bytes_in_map(cols));
+ create_last_word_mask(&m_cols);
+ }
}
else
{
@@ -5625,7 +5698,13 @@ Rows_log_event::Rows_log_event(const char *buf, uint event_len,
*description_event)
: Log_event(buf, description_event),
m_row_count(0),
- m_rows_buf(0), m_rows_cur(0), m_rows_end(0)
+#ifndef MYSQL_CLIENT
+ m_table(NULL),
+#endif
+ m_table_id(0), m_rows_buf(0), m_rows_cur(0), m_rows_end(0)
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
+ ,m_key(NULL), m_curr_row(NULL), m_curr_row_end(NULL)
+#endif
{
DBUG_ENTER("Rows_log_event::Rows_log_event(const char*,...)");
uint8 const common_header_len= description_event->common_header_len;
@@ -5652,9 +5731,9 @@ Rows_log_event::Rows_log_event(const char *buf, uint event_len,
m_flags= uint2korr(post_start);
- byte const *const var_start=
- (const byte *)buf + common_header_len + post_header_len;
- byte const *const ptr_width= var_start;
+ uchar const *const var_start=
+ (const uchar *)buf + common_header_len + post_header_len;
+ uchar const *const ptr_width= var_start;
uchar *ptr_after_width= (uchar*) ptr_width;
DBUG_PRINT("debug", ("Reading from %p", ptr_after_width));
m_width = net_field_length(&ptr_after_width);
@@ -5662,13 +5741,14 @@ Rows_log_event::Rows_log_event(const char *buf, uint event_len,
/* if bitmap_init fails, catched in is_valid() */
if (likely(!bitmap_init(&m_cols,
m_width <= sizeof(m_bitbuf)*8 ? m_bitbuf : NULL,
- (m_width + 7) & ~7UL,
+ m_width,
false)))
{
DBUG_PRINT("debug", ("Reading from %p", ptr_after_width));
memcpy(m_cols.bitmap, ptr_after_width, (m_width + 7) / 8);
+ create_last_word_mask(&m_cols);
ptr_after_width+= (m_width + 7) / 8;
- DBUG_DUMP("m_cols", (char*) m_cols.bitmap, no_bytes_in_map(&m_cols));
+ DBUG_DUMP("m_cols", (uchar*) m_cols.bitmap, no_bytes_in_map(&m_cols));
}
else
{
@@ -5683,16 +5763,18 @@ Rows_log_event::Rows_log_event(const char *buf, uint event_len,
{
DBUG_PRINT("debug", ("Reading from %p", ptr_after_width));
- /* if bitmap_init fails, catched in is_valid() */
+ /* if bitmap_init fails, caught in is_valid() */
if (likely(!bitmap_init(&m_cols_ai,
m_width <= sizeof(m_bitbuf_ai)*8 ? m_bitbuf_ai : NULL,
- (m_width + 7) & ~7UL,
+ m_width,
false)))
{
DBUG_PRINT("debug", ("Reading from %p", ptr_after_width));
memcpy(m_cols_ai.bitmap, ptr_after_width, (m_width + 7) / 8);
+ create_last_word_mask(&m_cols_ai);
ptr_after_width+= (m_width + 7) / 8;
- DBUG_DUMP("m_cols_ai", (char*) m_cols_ai.bitmap, no_bytes_in_map(&m_cols_ai));
+ DBUG_DUMP("m_cols_ai", (uchar*) m_cols_ai.bitmap,
+ no_bytes_in_map(&m_cols_ai));
}
else
{
@@ -5702,15 +5784,18 @@ Rows_log_event::Rows_log_event(const char *buf, uint event_len,
}
}
- const byte* const ptr_rows_data= (const byte*) ptr_after_width;
+ const uchar* const ptr_rows_data= (const uchar*) ptr_after_width;
- my_size_t const data_size= event_len - (ptr_rows_data - (const byte *) buf);
+ size_t const data_size= event_len - (ptr_rows_data - (const uchar *) buf);
DBUG_PRINT("info",("m_table_id: %lu m_flags: %d m_width: %lu data_size: %lu",
- m_table_id, m_flags, m_width, data_size));
+ m_table_id, m_flags, m_width, (ulong) data_size));
- m_rows_buf= (byte*)my_malloc(data_size, MYF(MY_WME));
+ m_rows_buf= (uchar*) my_malloc(data_size, MYF(MY_WME));
if (likely((bool)m_rows_buf))
{
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
+ m_curr_row= m_rows_buf;
+#endif
m_rows_end= m_rows_buf + data_size;
m_rows_cur= m_rows_end;
memcpy(m_rows_buf, ptr_rows_data, data_size);
@@ -5726,15 +5811,15 @@ Rows_log_event::~Rows_log_event()
if (m_cols.bitmap == m_bitbuf) // no my_malloc happened
m_cols.bitmap= 0; // so no my_free in bitmap_free
bitmap_free(&m_cols); // To pair with bitmap_init().
- my_free((gptr)m_rows_buf, MYF(MY_ALLOW_ZERO_PTR));
+ my_free((uchar*)m_rows_buf, MYF(MY_ALLOW_ZERO_PTR));
}
int Rows_log_event::get_data_size()
{
int const type_code= get_type_code();
- char buf[sizeof(m_width)+1];
- char *end= net_store_length(buf, (m_width + 7) / 8);
+ uchar buf[sizeof(m_width)+1];
+ uchar *end= net_store_length(buf, (m_width + 7) / 8);
DBUG_EXECUTE_IF("old_row_based_repl_4_byte_map_id_master",
return 6 + no_bytes_in_map(&m_cols) + (end - buf) +
@@ -5753,7 +5838,7 @@ int Rows_log_event::get_data_size()
#ifndef MYSQL_CLIENT
-int Rows_log_event::do_add_row_data(byte *row_data, my_size_t length)
+int Rows_log_event::do_add_row_data(uchar *row_data, size_t length)
{
/*
When the table has a primary key, we would probably want, by default, to
@@ -5768,7 +5853,7 @@ int Rows_log_event::do_add_row_data(byte *row_data, my_size_t length)
trigger false warnings.
*/
#ifndef HAVE_purify
- DBUG_DUMP("row_data", (const char*)row_data, min(length, 32));
+ DBUG_DUMP("row_data", row_data, min(length, 32));
#endif
DBUG_ASSERT(m_rows_buf <= m_rows_cur);
@@ -5776,14 +5861,14 @@ int Rows_log_event::do_add_row_data(byte *row_data, my_size_t length)
DBUG_ASSERT(m_rows_cur <= m_rows_end);
/* The cast will always work since m_rows_cur <= m_rows_end */
- if (static_cast<my_size_t>(m_rows_end - m_rows_cur) <= length)
+ if (static_cast<size_t>(m_rows_end - m_rows_cur) <= length)
{
- my_size_t const block_size= 1024;
+ size_t const block_size= 1024;
my_ptrdiff_t const cur_size= m_rows_cur - m_rows_buf;
my_ptrdiff_t const new_alloc=
block_size * ((cur_size + length + block_size - 1) / block_size);
- byte* const new_buf= (byte*)my_realloc((gptr)m_rows_buf, (uint) new_alloc,
+ uchar* const new_buf= (uchar*)my_realloc((uchar*)m_rows_buf, (uint) new_alloc,
MYF(MY_ALLOW_ZERO_PTR|MY_WME));
if (unlikely(!new_buf))
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
@@ -5811,11 +5896,10 @@ int Rows_log_event::do_add_row_data(byte *row_data, my_size_t length)
#endif
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
-int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
+int Rows_log_event::do_apply_event(Relay_log_info const *rli)
{
- DBUG_ENTER("Rows_log_event::do_apply_event(st_relay_log_info*)");
+ DBUG_ENTER("Rows_log_event::do_apply_event(Relay_log_info*)");
int error= 0;
- char const *row_start= (char const *)m_rows_buf;
/*
If m_table_id == ~0UL, then we have a dummy event that does not
@@ -5831,7 +5915,7 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
*/
DBUG_ASSERT(get_flags(STMT_END_F));
- const_cast<RELAY_LOG_INFO*>(rli)->clear_tables_to_lock();
+ const_cast<Relay_log_info*>(rli)->clear_tables_to_lock();
close_thread_tables(thd);
thd->clear_error();
DBUG_RETURN(0);
@@ -5860,7 +5944,7 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
Table_map_log_event::do_apply_event() we don't call
mysql_init_query() as that may reset the binlog format.
*/
- lex_start(thd, NULL, 0);
+ lex_start(thd);
while ((error= lock_tables(thd, rli->tables_to_lock,
rli->tables_to_lock_count, &need_reopen)))
@@ -5874,20 +5958,20 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
simplifications (we don't honour --slave-skip-errors)
*/
uint actual_error= thd->net.last_errno;
- slave_print_msg(ERROR_LEVEL, rli, actual_error,
- "Error '%s' in %s event: when locking tables",
- (actual_error ? thd->net.last_error :
- "unexpected success or fatal error"),
- get_type_str());
+ rli->report(ERROR_LEVEL, actual_error,
+ "Error '%s' in %s event: when locking tables",
+ (actual_error ? thd->net.last_error :
+ "unexpected success or fatal error"),
+ get_type_str());
thd->is_fatal_error= 1;
}
else
{
- slave_print_msg(ERROR_LEVEL, rli, error,
- "Error in %s event: when locking tables",
- get_type_str());
+ rli->report(ERROR_LEVEL, error,
+ "Error in %s event: when locking tables",
+ get_type_str());
}
- const_cast<RELAY_LOG_INFO*>(rli)->clear_tables_to_lock();
+ const_cast<Relay_log_info*>(rli)->clear_tables_to_lock();
DBUG_RETURN(error);
}
@@ -5918,13 +6002,13 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
simplifications (we don't honour --slave-skip-errors)
*/
uint actual_error= thd->net.last_errno;
- slave_print_msg(ERROR_LEVEL, rli, actual_error,
- "Error '%s' on reopening tables",
- (actual_error ? thd->net.last_error :
- "unexpected success or fatal error"));
+ rli->report(ERROR_LEVEL, actual_error,
+ "Error '%s' on reopening tables",
+ (actual_error ? thd->net.last_error :
+ "unexpected success or fatal error"));
thd->query_error= 1;
}
- const_cast<RELAY_LOG_INFO*>(rli)->clear_tables_to_lock();
+ const_cast<Relay_log_info*>(rli)->clear_tables_to_lock();
DBUG_RETURN(error);
}
}
@@ -5946,7 +6030,7 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
mysql_unlock_tables(thd, thd->lock);
thd->lock= 0;
thd->query_error= 1;
- const_cast<RELAY_LOG_INFO*>(rli)->clear_tables_to_lock();
+ const_cast<Relay_log_info*>(rli)->clear_tables_to_lock();
DBUG_RETURN(ERR_BAD_TABLE_DEF);
}
}
@@ -5968,17 +6052,16 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
*/
for (TABLE_LIST *ptr= rli->tables_to_lock ; ptr ; ptr= ptr->next_global)
{
- const_cast<RELAY_LOG_INFO*>(rli)->m_table_map.set_table(ptr->table_id, ptr->table);
+ const_cast<Relay_log_info*>(rli)->m_table_map.set_table(ptr->table_id, ptr->table);
}
#ifdef HAVE_QUERY_CACHE
query_cache.invalidate_locked_for_write(rli->tables_to_lock);
#endif
- const_cast<RELAY_LOG_INFO*>(rli)->clear_tables_to_lock();
}
- DBUG_ASSERT(rli->tables_to_lock == NULL && rli->tables_to_lock_count == 0);
-
- TABLE* table= const_cast<RELAY_LOG_INFO*>(rli)->m_table_map.get_table(m_table_id);
+ TABLE*
+ table=
+ m_table= const_cast<Relay_log_info*>(rli)->m_table_map.get_table(m_table_id);
if (table)
{
@@ -6023,24 +6106,43 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
inside a statement and halting abruptly might cause problems
when restarting.
*/
- const_cast<RELAY_LOG_INFO*>(rli)->set_flag(RELAY_LOG_INFO::IN_STMT);
+ const_cast<Relay_log_info*>(rli)->set_flag(Relay_log_info::IN_STMT);
- error= do_before_row_operations(table);
- while (error == 0 && row_start < (const char*) m_rows_end)
- {
- char const *row_end= NULL;
- if ((error= do_prepare_row(thd, rli, table, row_start, &row_end)))
- break; // We should perform the after-row operation even in
- // the case of error
+ if ( m_width == table->s->fields && bitmap_is_set_all(&m_cols))
+ set_flags(COMPLETE_ROWS_F);
- DBUG_ASSERT(row_end != NULL); // cannot happen
- DBUG_ASSERT(row_end <= (const char*)m_rows_end);
+ /*
+ Set tables write and read sets.
+
+ Read_set contains all slave columns (in case we are going to fetch
+ a complete record from slave)
+
+ Write_set equals the m_cols bitmap sent from master but it can be
+ longer if slave has extra columns.
+ */
+
+ DBUG_PRINT_BITSET("debug", "Setting table's write_set from: %s", &m_cols);
+
+ bitmap_set_all(table->read_set);
+ bitmap_set_all(table->write_set);
+ if (!get_flags(COMPLETE_ROWS_F))
+ bitmap_intersect(table->write_set,&m_cols);
+
+ // Do event specific preparations
+
+ error= do_before_row_operations(rli);
+
+ // row processing loop
+ while (error == 0 && m_curr_row < m_rows_end)
+ {
/* in_use can have been set to NULL in close_tables_for_reopen */
THD* old_thd= table->in_use;
if (!table->in_use)
table->in_use= thd;
- error= do_exec_row(table);
+
+ error= do_exec_row(rli);
+
table->in_use = old_thd;
switch (error)
{
@@ -6053,34 +6155,60 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
break;
default:
- slave_print_msg(ERROR_LEVEL, rli, thd->net.last_errno,
- "Error in %s event: row application failed",
- get_type_str());
+ rli->report(ERROR_LEVEL, thd->net.last_errno,
+ "Error in %s event: row application failed. %s",
+ get_type_str(),
+ thd->net.last_error ? thd->net.last_error : "");
thd->query_error= 1;
break;
}
- row_start= row_end;
- }
+ /*
+ If m_curr_row_end was not set during event execution (e.g., because
+ of errors) we can't proceed to the next row. If the error is transient
+ (i.e., error==0 at this point) we must call unpack_current_row() to set
+ m_curr_row_end.
+ */
+
+ if (!m_curr_row_end && !error)
+ unpack_current_row(rli);
+
+ // at this moment m_curr_row_end should be set
+ DBUG_ASSERT(error || m_curr_row_end != NULL);
+ DBUG_ASSERT(error || m_curr_row < m_curr_row_end);
+ DBUG_ASSERT(error || m_curr_row_end <= m_rows_end);
+
+ m_curr_row= m_curr_row_end;
+
+ } // row processing loop
+
DBUG_EXECUTE_IF("STOP_SLAVE_after_first_Rows_event",
- const_cast<RELAY_LOG_INFO*>(rli)->abort_slave= 1;);
- error= do_after_row_operations(table, error);
+ const_cast<Relay_log_info*>(rli)->abort_slave= 1;);
+ error= do_after_row_operations(rli, error);
if (!cache_stmt)
{
DBUG_PRINT("info", ("Marked that we need to keep log"));
thd->options|= OPTION_KEEP_LOG;
}
- }
+ } // if (table)
+
+ /*
+ We need to delay this clear until here bacause unpack_current_row() uses
+ master-side table definitions stored in rli.
+ */
+ if (rli->tables_to_lock && get_flags(STMT_END_F))
+ const_cast<Relay_log_info*>(rli)->clear_tables_to_lock();
if (error)
{ /* error has occured during the transaction */
- slave_print_msg(ERROR_LEVEL, rli, thd->net.last_errno,
- "Error in %s event: error during transaction execution "
- "on table %s.%s",
- get_type_str(), table->s->db.str,
- table->s->table_name.str);
+ rli->report(ERROR_LEVEL, thd->net.last_errno,
+ "Error in %s event: error during transaction execution "
+ "on table %s.%s. %s",
+ get_type_str(), table->s->db.str,
+ table->s->table_name.str,
+ thd->net.last_error ? thd->net.last_error : "");
- /*
+ /*
If one day we honour --skip-slave-errors in row-based replication, and
the error should be skipped, then we would clear mappings, rollback,
close tables, but the slave SQL thread would not stop and then may
@@ -6092,7 +6220,7 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
rollback at the caller along with sbr.
*/
thd->reset_current_stmt_binlog_row_based();
- const_cast<RELAY_LOG_INFO*>(rli)->cleanup_context(thd, error);
+ const_cast<Relay_log_info*>(rli)->cleanup_context(thd, error);
thd->query_error= 1;
DBUG_RETURN(error);
}
@@ -6119,16 +6247,30 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
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.
+ Relay_log_info::last_event_start_time and all its occurrences.
*/
- const_cast<RELAY_LOG_INFO*>(rli)->last_event_start_time= time(0);
+ const_cast<Relay_log_info*>(rli)->last_event_start_time= my_time(0);
}
DBUG_RETURN(0);
}
+Log_event::enum_skip_reason
+Rows_log_event::do_shall_skip(Relay_log_info *rli)
+{
+ /*
+ If the slave skip counter is 1 and this event does not end a
+ statement, then we should not start executing on the next event.
+ Otherwise, we defer the decision to the normal skipping logic.
+ */
+ if (rli->slave_skip_counter == 1 && !get_flags(STMT_END_F))
+ return Log_event::EVENT_SKIP_IGNORE;
+ else
+ return Log_event::do_shall_skip(rli);
+}
+
int
-Rows_log_event::do_update_pos(RELAY_LOG_INFO *rli)
+Rows_log_event::do_update_pos(Relay_log_info *rli)
{
DBUG_ENTER("Rows_log_event::do_update_pos");
int error= 0;
@@ -6198,9 +6340,11 @@ Rows_log_event::do_update_pos(RELAY_LOG_INFO *rli)
thd->clear_error();
}
else
- slave_print_msg(ERROR_LEVEL, rli, error,
- "Error in %s event: commit of row events failed",
- get_type_str());
+ rli->report(ERROR_LEVEL, error,
+ "Error in %s event: commit of row events failed, "
+ "table `%s`.`%s`",
+ get_type_str(), m_table->s->db.str,
+ m_table->s->table_name.str);
}
else
{
@@ -6215,7 +6359,7 @@ Rows_log_event::do_update_pos(RELAY_LOG_INFO *rli)
#ifndef MYSQL_CLIENT
bool Rows_log_event::write_data_header(IO_CACHE *file)
{
- byte buf[ROWS_HEADER_LEN]; // No need to init the buffer
+ uchar buf[ROWS_HEADER_LEN]; // No need to init the buffer
DBUG_ASSERT(m_table_id != ~0UL);
DBUG_EXECUTE_IF("old_row_based_repl_4_byte_map_id_master",
{
@@ -6234,34 +6378,30 @@ bool Rows_log_event::write_data_body(IO_CACHE*file)
Note that this should be the number of *bits*, not the number of
bytes.
*/
- char sbuf[sizeof(m_width)];
+ uchar sbuf[sizeof(m_width)];
my_ptrdiff_t const data_size= m_rows_cur - m_rows_buf;
bool res= false;
+ uchar *const sbuf_end= net_store_length(sbuf, (size_t) m_width);
+ DBUG_ASSERT(static_cast<size_t>(sbuf_end - sbuf) <= sizeof(sbuf));
- char *const sbuf_end= net_store_length((char*) sbuf, (uint) m_width);
- DBUG_ASSERT(static_cast<my_size_t>(sbuf_end - sbuf) <= sizeof(sbuf));
+ DBUG_DUMP("m_width", sbuf, (size_t) (sbuf_end - sbuf));
+ res= res || my_b_safe_write(file, sbuf, (size_t) (sbuf_end - sbuf));
- DBUG_DUMP("m_width", sbuf, sbuf_end - sbuf);
- res= res || my_b_safe_write(file,
- reinterpret_cast<byte*>(sbuf),
- sbuf_end - sbuf);
-
- DBUG_DUMP("m_cols", (char*) m_cols.bitmap, no_bytes_in_map(&m_cols));
- res= res || my_b_safe_write(file,
- reinterpret_cast<byte*>(m_cols.bitmap),
+ DBUG_DUMP("m_cols", (uchar*) m_cols.bitmap, no_bytes_in_map(&m_cols));
+ res= res || my_b_safe_write(file, (uchar*) m_cols.bitmap,
no_bytes_in_map(&m_cols));
/*
TODO[refactor write]: Remove the "down cast" here (and elsewhere).
*/
if (get_type_code() == UPDATE_ROWS_EVENT)
{
- DBUG_DUMP("m_cols_ai", (char*) m_cols_ai.bitmap, no_bytes_in_map(&m_cols_ai));
- res= res || my_b_safe_write(file,
- reinterpret_cast<byte*>(m_cols_ai.bitmap),
+ DBUG_DUMP("m_cols_ai", (uchar*) m_cols_ai.bitmap,
+ no_bytes_in_map(&m_cols_ai));
+ res= res || my_b_safe_write(file, (uchar*) m_cols_ai.bitmap,
no_bytes_in_map(&m_cols_ai));
}
- DBUG_DUMP("rows",(const char *) m_rows_buf, data_size);
- res= res || my_b_safe_write(file, m_rows_buf, (uint) data_size);
+ DBUG_DUMP("rows", m_rows_buf, data_size);
+ res= res || my_b_safe_write(file, m_rows_buf, (size_t) data_size);
return res;
@@ -6274,7 +6414,7 @@ void Rows_log_event::pack_info(Protocol *protocol)
char buf[256];
char const *const flagstr=
get_flags(STMT_END_F) ? " flags: STMT_END_F" : "";
- my_size_t bytes= my_snprintf(buf, sizeof(buf),
+ size_t bytes= my_snprintf(buf, sizeof(buf),
"table_id: %lu%s", m_table_id, flagstr);
protocol->store(buf, bytes, &my_charset_bin);
}
@@ -6309,6 +6449,62 @@ void Rows_log_event::print_helper(FILE *file,
Table_map_log_event member functions and support functions
**************************************************************************/
+/**
+ @page How replication of field metadata works.
+
+ When a table map is created, the master first calls
+ Table_map_log_event::save_field_metadata() which calculates how many
+ values will be in the field metadata. Only those fields that require the
+ extra data are added. The method also loops through all of the fields in
+ the table calling the method Field::save_field_metadata() which returns the
+ values for the field that will be saved in the metadata and replicated to
+ the slave. Once all fields have been processed, the table map is written to
+ the binlog adding the size of the field metadata and the field metadata to
+ the end of the body of the table map.
+
+ When a table map is read on the slave, the field metadata is read from the
+ table map and passed to the table_def class constructor which saves the
+ field metadata from the table map into an array based on the type of the
+ field. Field metadata values not present (those fields that do not use extra
+ data) in the table map are initialized as zero (0). The array size is the
+ same as the columns for the table on the slave.
+
+*/
+
+/**
+ Save the field metadata based on the real_type of the field.
+ The metadata saved depends on the type of the field. Some fields
+ store a single byte for pack_length() while others store two bytes
+ for field_length (max length).
+
+ @retval 0 Ok.
+
+ TODO: We may want to consider changing the encoding of the information.
+ Currently, the code attempts to minimize the number of bytes written to
+ the tablemap. There are at least two other alternatives; 1) using
+ net_store_length() to store the data allowing it to choose the number of
+ bytes that are appropriate thereby making the code much easier to
+ maintain (only 1 place to change the encoding), or 2) use a fixed number
+ of bytes for each field. The problem with option 1 is that net_store_length()
+ will use one byte if the value < 251, but 3 bytes if it is > 250. Thus,
+ for fields like CHAR which can be no larger than 255 characters, the method
+ will use 3 bytes when the value is > 250. Further, every value that is
+ encoded using 2 parts (e.g., pack_length, field_length) will be numerically
+ > 250 therefore will use 3 bytes for eah value. The problem with option 2
+ is less wasteful for space but does waste 1 byte for every field that does
+ not encode 2 parts.
+*/
+#if !defined(MYSQL_CLIENT)
+int Table_map_log_event::save_field_metadata()
+{
+ DBUG_ENTER("Table_map_log_event::save_field_metadata");
+ int index= 0;
+ for (unsigned int i= 0 ; i < m_table->s->fields ; i++)
+ index+= m_table->s->field[i]->save_field_metadata(&m_field_metadata[index]);
+ DBUG_RETURN(index);
+}
+#endif /* !defined(MYSQL_CLIENT) */
+
/*
Constructor used to build an event for writing to the binary log.
Mats says tbl->s lives longer than this event so it's ok to copy pointers
@@ -6323,9 +6519,9 @@ Table_map_log_event::Table_map_log_event(THD *thd, TABLE *tbl, ulong tid,
m_dblen(m_dbnam ? tbl->s->db.length : 0),
m_tblnam(tbl->s->table_name.str),
m_tbllen(tbl->s->table_name.length),
- m_colcnt(tbl->s->fields), m_coltype(0),
- m_table_id(tid),
- m_flags(flags)
+ m_colcnt(tbl->s->fields), m_field_metadata(0),
+ m_field_metadata_size(0), m_memory(NULL), m_meta_memory(NULL), m_data_size(0),
+ m_table_id(tid), m_null_bits(0), m_flags(flags)
{
DBUG_ASSERT(m_table_id != ~0UL);
/*
@@ -6345,13 +6541,49 @@ Table_map_log_event::Table_map_log_event(THD *thd, TABLE *tbl, ulong tid,
m_data_size+= m_tbllen + 2; // Include length and terminating \0
m_data_size+= 1 + m_colcnt; // COLCNT and column types
- /* If malloc fails, catched in is_valid() */
- if ((m_memory= my_malloc(m_colcnt, MYF(MY_WME))))
+ /* If malloc fails, caught in is_valid() */
+ if ((m_memory= (uchar*) my_malloc(m_colcnt, MYF(MY_WME))))
{
m_coltype= reinterpret_cast<uchar*>(m_memory);
for (unsigned int i= 0 ; i < m_table->s->fields ; ++i)
m_coltype[i]= m_table->field[i]->type();
}
+
+ /*
+ Calculate a bitmap for the results of maybe_null() for all columns.
+ The bitmap is used to determine when there is a column from the master
+ that is not on the slave and is null and thus not in the row data during
+ replication.
+ */
+ uint num_null_bytes= (m_table->s->fields + 7) / 8;
+ m_data_size+= num_null_bytes;
+ m_meta_memory= (uchar *)my_multi_malloc(MYF(MY_WME),
+ &m_null_bits, num_null_bytes,
+ &m_field_metadata, (m_colcnt * 2),
+ NULL);
+
+ bzero(m_field_metadata, (m_colcnt * 2));
+
+ /*
+ Create an array for the field metadata and store it.
+ */
+ m_field_metadata_size= save_field_metadata();
+ DBUG_ASSERT(m_field_metadata_size <= (m_colcnt * 2));
+
+ /*
+ Now set the size of the data to the size of the field metadata array
+ plus one or two bytes for number of elements in the field metadata array.
+ */
+ if (m_field_metadata_size > 255)
+ m_data_size+= m_field_metadata_size + 2;
+ else
+ m_data_size+= m_field_metadata_size + 1;
+
+ bzero(m_null_bits, num_null_bytes);
+ for (unsigned int i= 0 ; i < m_table->s->fields ; ++i)
+ if (m_table->field[i]->maybe_null())
+ m_null_bits[(i / 8)]+= 1 << (i % 8);
+
}
#endif /* !defined(MYSQL_CLIENT) */
@@ -6365,10 +6597,15 @@ Table_map_log_event::Table_map_log_event(const char *buf, uint event_len,
: Log_event(buf, description_event),
#ifndef MYSQL_CLIENT
- m_table(NULL),
+ m_table(NULL),
#endif
- m_memory(NULL)
+ m_dbnam(NULL), m_dblen(0), m_tblnam(NULL), m_tbllen(0),
+ m_colcnt(0), m_coltype(0),
+ m_memory(NULL), m_table_id(ULONG_MAX), m_flags(0),
+ m_data_size(0), m_field_metadata(0), m_field_metadata_size(0),
+ m_null_bits(0), m_meta_memory(NULL)
{
+ unsigned int bytes_read= 0;
DBUG_ENTER("Table_map_log_event::Table_map_log_event(const char*,uint,...)");
uint8 common_header_len= description_event->common_header_len;
@@ -6381,7 +6618,7 @@ Table_map_log_event::Table_map_log_event(const char *buf, uint event_len,
trigger false warnings.
*/
#ifndef HAVE_purify
- DBUG_DUMP("event buffer", buf, event_len);
+ DBUG_DUMP("event buffer", (uchar*) buf, event_len);
#endif
/* Read the post-header */
@@ -6409,29 +6646,29 @@ Table_map_log_event::Table_map_log_event(const char *buf, uint event_len,
const char *const vpart= buf + common_header_len + post_header_len;
/* Extract the length of the various parts from the buffer */
- byte const *const ptr_dblen= (byte const*)vpart + 0;
+ uchar const *const ptr_dblen= (uchar const*)vpart + 0;
m_dblen= *(uchar*) ptr_dblen;
/* Length of database name + counter + terminating null */
- byte const *const ptr_tbllen= ptr_dblen + m_dblen + 2;
+ uchar const *const ptr_tbllen= ptr_dblen + m_dblen + 2;
m_tbllen= *(uchar*) ptr_tbllen;
/* Length of table name + counter + terminating null */
- byte const *const ptr_colcnt= ptr_tbllen + m_tbllen + 2;
+ uchar const *const ptr_colcnt= ptr_tbllen + m_tbllen + 2;
uchar *ptr_after_colcnt= (uchar*) ptr_colcnt;
m_colcnt= net_field_length(&ptr_after_colcnt);
DBUG_PRINT("info",("m_dblen: %lu off: %ld m_tbllen: %lu off: %ld m_colcnt: %lu off: %ld",
- m_dblen, (long) (ptr_dblen-(const byte*)vpart),
- m_tbllen, (long) (ptr_tbllen-(const byte*)vpart),
- m_colcnt, (long) (ptr_colcnt-(const byte*)vpart)));
+ (ulong) m_dblen, (long) (ptr_dblen-(const uchar*)vpart),
+ (ulong) m_tbllen, (long) (ptr_tbllen-(const uchar*)vpart),
+ m_colcnt, (long) (ptr_colcnt-(const uchar*)vpart)));
- /* Allocate mem for all fields in one go. If fails, catched in is_valid() */
- m_memory= my_multi_malloc(MYF(MY_WME),
- &m_dbnam, m_dblen + 1,
- &m_tblnam, m_tbllen + 1,
- &m_coltype, m_colcnt,
- NULL);
+ /* Allocate mem for all fields in one go. If fails, caught in is_valid() */
+ m_memory= (uchar*) my_multi_malloc(MYF(MY_WME),
+ &m_dbnam, (uint) m_dblen + 1,
+ &m_tblnam, (uint) m_tbllen + 1,
+ &m_coltype, (uint) m_colcnt,
+ NullS);
if (m_memory)
{
@@ -6439,6 +6676,23 @@ Table_map_log_event::Table_map_log_event(const char *buf, uint event_len,
strncpy(const_cast<char*>(m_dbnam), (const char*)ptr_dblen + 1, m_dblen + 1);
strncpy(const_cast<char*>(m_tblnam), (const char*)ptr_tbllen + 1, m_tbllen + 1);
memcpy(m_coltype, ptr_after_colcnt, m_colcnt);
+
+ ptr_after_colcnt= ptr_after_colcnt + m_colcnt;
+ bytes_read= ptr_after_colcnt - (uchar *)buf;
+ DBUG_PRINT("info", ("Bytes read: %d.\n", bytes_read));
+ if (bytes_read < event_len)
+ {
+ m_field_metadata_size= net_field_length(&ptr_after_colcnt);
+ DBUG_ASSERT(m_field_metadata_size <= (m_colcnt * 2));
+ uint num_null_bytes= (m_colcnt + 7) / 8;
+ m_meta_memory= (uchar *)my_multi_malloc(MYF(MY_WME),
+ &m_null_bits, num_null_bytes,
+ &m_field_metadata, m_field_metadata_size,
+ NULL);
+ memcpy(m_field_metadata, ptr_after_colcnt, m_field_metadata_size);
+ ptr_after_colcnt= (uchar*)ptr_after_colcnt + m_field_metadata_size;
+ memcpy(m_null_bits, ptr_after_colcnt, num_null_bytes);
+ }
}
DBUG_VOID_RETURN;
@@ -6447,6 +6701,7 @@ Table_map_log_event::Table_map_log_event(const char *buf, uint event_len,
Table_map_log_event::~Table_map_log_event()
{
+ my_free(m_meta_memory, MYF(MY_ALLOW_ZERO_PTR));
my_free(m_memory, MYF(MY_ALLOW_ZERO_PTR));
}
@@ -6462,10 +6717,13 @@ Table_map_log_event::~Table_map_log_event()
*/
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
-int Table_map_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
+int Table_map_log_event::do_apply_event(Relay_log_info const *rli)
{
- DBUG_ENTER("Table_map_log_event::do_apply_event(st_relay_log_info*)");
-
+ RPL_TABLE_LIST *table_list;
+ char *db_mem, *tname_mem;
+ size_t dummy_len;
+ void *memory;
+ DBUG_ENTER("Table_map_log_event::do_apply_event(Relay_log_info*)");
DBUG_ASSERT(rli->sql_thd == thd);
/* Step the query id to mark what columns that are actually used. */
@@ -6473,19 +6731,13 @@ int Table_map_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
thd->query_id= next_query_id();
pthread_mutex_unlock(&LOCK_thread_count);
- RPL_TABLE_LIST *table_list;
- char *db_mem, *tname_mem;
- void *const memory=
- my_multi_malloc(MYF(MY_WME),
- &table_list, sizeof(RPL_TABLE_LIST),
- &db_mem, NAME_LEN + 1,
- &tname_mem, NAME_LEN + 1,
- NULL);
-
- if (memory == NULL)
+ if (!(memory= my_multi_malloc(MYF(MY_WME),
+ &table_list, (uint) sizeof(RPL_TABLE_LIST),
+ &db_mem, (uint) NAME_LEN + 1,
+ &tname_mem, (uint) NAME_LEN + 1,
+ NullS)))
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
- uint dummy_len;
bzero(table_list, sizeof(*table_list));
table_list->db = db_mem;
table_list->alias= table_list->table_name = tname_mem;
@@ -6501,7 +6753,7 @@ int Table_map_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
if (!rpl_filter->db_ok(table_list->db) ||
(rpl_filter->is_on() && !rpl_filter->tables_ok("", table_list)))
{
- my_free((gptr) memory, MYF(MY_WME));
+ my_free(memory, MYF(MY_WME));
}
else
{
@@ -6510,7 +6762,8 @@ int Table_map_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
initialized, so we should call lex_start(); to be even safer, we
call mysql_init_query() which does a more complete set of inits.
*/
- mysql_init_query(thd, NULL, 0);
+ lex_start(thd);
+ mysql_reset_thd_for_next_command(thd);
/*
Check if the slave is set to use SBR. If so, it should switch
to using RBR until the end of the "statement", i.e., next
@@ -6552,11 +6805,11 @@ int Table_map_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
simplifications (we don't honour --slave-skip-errors)
*/
uint actual_error= thd->net.last_errno;
- slave_print_msg(ERROR_LEVEL, rli, actual_error,
- "Error '%s' on opening table `%s`.`%s`",
- (actual_error ? thd->net.last_error :
- "unexpected success or fatal error"),
- table_list->db, table_list->table_name);
+ rli->report(ERROR_LEVEL, actual_error,
+ "Error '%s' on opening table `%s`.`%s`",
+ (actual_error ? thd->net.last_error :
+ "unexpected success or fatal error"),
+ table_list->db, table_list->table_name);
thd->query_error= 1;
}
goto err;
@@ -6576,10 +6829,11 @@ int Table_map_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
The memory allocated by the table_def structure (i.e., not the
memory allocated *for* the table_def structure) is released
- inside st_relay_log_info::clear_tables_to_lock() by calling the
+ inside Relay_log_info::clear_tables_to_lock() by calling the
table_def destructor explicitly.
*/
- new (&table_list->m_tabledef) table_def(m_coltype, m_colcnt);
+ new (&table_list->m_tabledef) table_def(m_coltype, m_colcnt,
+ m_field_metadata, m_field_metadata_size, m_null_bits);
table_list->m_tabledef_valid= TRUE;
/*
@@ -6587,19 +6841,32 @@ int Table_map_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
locked by linking the table into the list of tables to lock.
*/
table_list->next_global= table_list->next_local= rli->tables_to_lock;
- const_cast<RELAY_LOG_INFO*>(rli)->tables_to_lock= table_list;
- const_cast<RELAY_LOG_INFO*>(rli)->tables_to_lock_count++;
+ const_cast<Relay_log_info*>(rli)->tables_to_lock= table_list;
+ const_cast<Relay_log_info*>(rli)->tables_to_lock_count++;
/* 'memory' is freed in clear_tables_to_lock */
}
DBUG_RETURN(error);
err:
- my_free((gptr) memory, MYF(MY_WME));
+ my_free(memory, MYF(MY_WME));
DBUG_RETURN(error);
}
-int Table_map_log_event::do_update_pos(RELAY_LOG_INFO *rli)
+Log_event::enum_skip_reason
+Table_map_log_event::do_shall_skip(Relay_log_info *rli)
+{
+ /*
+ If the slave skip counter is 1, then we should not start executing
+ on the next event.
+ */
+ if (rli->slave_skip_counter == 1)
+ return Log_event::EVENT_SKIP_IGNORE;
+ else
+ return Log_event::do_shall_skip(rli);
+}
+
+int Table_map_log_event::do_update_pos(Relay_log_info *rli)
{
rli->inc_event_relay_log_pos();
return 0;
@@ -6611,7 +6878,7 @@ int Table_map_log_event::do_update_pos(RELAY_LOG_INFO *rli)
bool Table_map_log_event::write_data_header(IO_CACHE *file)
{
DBUG_ASSERT(m_table_id != ~0UL);
- byte buf[TABLE_MAP_HEADER_LEN];
+ uchar buf[TABLE_MAP_HEADER_LEN];
DBUG_EXECUTE_IF("old_row_based_repl_4_byte_map_id_master",
{
int4store(buf + 0, m_table_id);
@@ -6631,20 +6898,28 @@ bool Table_map_log_event::write_data_body(IO_CACHE *file)
DBUG_ASSERT(m_dblen < 128);
DBUG_ASSERT(m_tbllen < 128);
- byte const dbuf[]= { (byte) m_dblen };
- byte const tbuf[]= { (byte) m_tbllen };
+ uchar const dbuf[]= { (uchar) m_dblen };
+ uchar const tbuf[]= { (uchar) m_tbllen };
+
+ uchar cbuf[sizeof(m_colcnt)];
+ uchar *const cbuf_end= net_store_length(cbuf, (size_t) m_colcnt);
+ DBUG_ASSERT(static_cast<size_t>(cbuf_end - cbuf) <= sizeof(cbuf));
- char cbuf[sizeof(m_colcnt)];
- char *const cbuf_end= net_store_length((char*) cbuf, (uint) m_colcnt);
- DBUG_ASSERT(static_cast<my_size_t>(cbuf_end - cbuf) <= sizeof(cbuf));
+ /*
+ Store the size of the field metadata.
+ */
+ uchar mbuf[sizeof(m_field_metadata_size)];
+ uchar *const mbuf_end= net_store_length(mbuf, m_field_metadata_size);
return (my_b_safe_write(file, dbuf, sizeof(dbuf)) ||
- my_b_safe_write(file, (const byte*)m_dbnam, m_dblen+1) ||
+ my_b_safe_write(file, (const uchar*)m_dbnam, m_dblen+1) ||
my_b_safe_write(file, tbuf, sizeof(tbuf)) ||
- my_b_safe_write(file, (const byte*)m_tblnam, m_tbllen+1) ||
- my_b_safe_write(file, reinterpret_cast<byte*>(cbuf),
- cbuf_end - (char*) cbuf) ||
- my_b_safe_write(file, reinterpret_cast<byte*>(m_coltype), m_colcnt));
+ my_b_safe_write(file, (const uchar*)m_tblnam, m_tbllen+1) ||
+ my_b_safe_write(file, cbuf, (size_t) (cbuf_end - cbuf)) ||
+ my_b_safe_write(file, m_coltype, m_colcnt) ||
+ my_b_safe_write(file, mbuf, (size_t) (mbuf_end - mbuf)) ||
+ my_b_safe_write(file, m_field_metadata, m_field_metadata_size),
+ my_b_safe_write(file, m_null_bits, (m_colcnt + 7) / 8));
}
#endif
@@ -6659,7 +6934,7 @@ bool Table_map_log_event::write_data_body(IO_CACHE *file)
void Table_map_log_event::pack_info(Protocol *protocol)
{
char buf[256];
- my_size_t bytes= my_snprintf(buf, sizeof(buf),
+ size_t bytes= my_snprintf(buf, sizeof(buf),
"table_id: %lu (%s.%s)",
m_table_id, m_dbnam, m_tblnam);
protocol->store(buf, bytes, &my_charset_bin);
@@ -6714,7 +6989,8 @@ Write_rows_log_event::Write_rows_log_event(const char *buf, uint event_len,
#endif
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
-int Write_rows_log_event::do_before_row_operations(TABLE *table)
+int
+Write_rows_log_event::do_before_row_operations(const Slave_reporting_capability *const)
{
int error= 0;
@@ -6733,16 +7009,29 @@ int Write_rows_log_event::do_before_row_operations(TABLE *table)
lex->duplicates flag.
*/
thd->lex->sql_command= SQLCOM_REPLACE;
-
- table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); // Needed for ndbcluster
- table->file->extra(HA_EXTRA_WRITE_CAN_REPLACE); // Needed for ndbcluster
- table->file->extra(HA_EXTRA_IGNORE_NO_KEY); // Needed for ndbcluster
+ /*
+ Do not raise the error flag in case of hitting to an unique attribute
+ */
+ m_table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
+ /*
+ NDB specific: update from ndb master wrapped as Write_rows
+ */
+ /*
+ so that the event should be applied to replace slave's row
+ */
+ m_table->file->extra(HA_EXTRA_WRITE_CAN_REPLACE);
+ /*
+ NDB specific: if update from ndb master wrapped as Write_rows
+ does not find the row it's assumed idempotent binlog applying
+ is taking place; don't raise the error.
+ */
+ m_table->file->extra(HA_EXTRA_IGNORE_NO_KEY);
/*
TODO: the cluster team (Tomas?) says that it's better if the engine knows
how many rows are going to be inserted, then it can allocate needed memory
from the start.
*/
- table->file->ha_start_bulk_insert(0);
+ m_table->file->ha_start_bulk_insert(0);
/*
We need TIMESTAMP_NO_AUTO_SET otherwise ha_write_row() will not use fill
any TIMESTAMP column with data from the row but instead will use
@@ -6758,31 +7047,31 @@ int Write_rows_log_event::do_before_row_operations(TABLE *table)
some cases we won't want TIMESTAMP_NO_AUTO_SET (will require some code to
analyze if explicit data is provided for slave's TIMESTAMP columns).
*/
- table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
+ m_table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
return error;
}
-int Write_rows_log_event::do_after_row_operations(TABLE *table, int error)
+int
+Write_rows_log_event::do_after_row_operations(const Slave_reporting_capability *const,
+ int error)
{
- if (error == 0)
- error= table->file->ha_end_bulk_insert();
- return error;
+ int local_error= 0;
+ m_table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
+ m_table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE);
+ /*
+ reseting the extra with
+ table->file->extra(HA_EXTRA_NO_IGNORE_NO_KEY);
+ fires bug#27077
+ todo: explain or fix
+ */
+ if ((local_error= m_table->file->ha_end_bulk_insert()))
+ {
+ m_table->file->print_error(local_error, MYF(0));
+ }
+ return error? error : local_error;
}
-int Write_rows_log_event::do_prepare_row(THD *thd, RELAY_LOG_INFO const *rli,
- TABLE *table,
- char const *const row_start,
- char const **const row_end)
-{
- DBUG_ASSERT(table != NULL);
- DBUG_ASSERT(row_start && row_end);
-
- int error;
- error= unpack_row(rli, table, m_width, row_start, &m_cols, row_end,
- &m_master_reclength, table->write_set, WRITE_ROWS_EVENT);
- bitmap_copy(table->read_set, table->write_set);
- return error;
-}
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
/*
Check if there are more UNIQUE keys after the given key.
@@ -6796,130 +7085,6 @@ last_uniq_key(TABLE *table, uint keyno)
return 1;
}
-/* Anonymous namespace for template functions/classes */
-namespace {
-
- /*
- Smart pointer that will automatically call my_afree (a macro) when
- the pointer goes out of scope. This is used so that I do not have
- to remember to call my_afree() before each return. There is no
- overhead associated with this, since all functions are inline.
-
- I (Matz) would prefer to use the free function as a template
- parameter, but that is not possible when the "function" is a
- macro.
- */
- template <class Obj>
- class auto_afree_ptr
- {
- Obj* m_ptr;
- public:
- auto_afree_ptr(Obj* ptr) : m_ptr(ptr) { }
- ~auto_afree_ptr() { if (m_ptr) my_afree(m_ptr); }
- void assign(Obj* ptr) {
- /* Only to be called if it hasn't been given a value before. */
- DBUG_ASSERT(m_ptr == NULL);
- m_ptr= ptr;
- }
- Obj* get() { return m_ptr; }
- };
-
-}
-
-
-/*
- Copy "extra" columns from record[1] to record[0].
-
- Copy the extra fields that are not present on the master but are
- present on the slave from record[1] to record[0]. This is used
- after fetching a record that are to be updated, either inside
- replace_record() or as part of executing an update_row().
- */
-static int
-copy_extra_record_fields(TABLE *table,
- my_size_t master_reclength,
- my_ptrdiff_t master_fields)
-{
- DBUG_PRINT("info", ("Copying to 0x%lx "
- "from field %lu at offset %lu "
- "to field %d at offset %lu",
- (long) table->record[0],
- (ulong) master_fields, (ulong) master_reclength,
- table->s->fields, table->s->reclength));
- /*
- Copying the extra fields of the slave that does not exist on
- master into record[0] (which are basically the default values).
- */
- DBUG_ASSERT(master_reclength <= table->s->reclength);
- if (master_reclength < table->s->reclength)
- bmove_align(table->record[0] + master_reclength,
- table->record[1] + master_reclength,
- table->s->reclength - master_reclength);
-
- /*
- Bit columns are special. We iterate over all the remaining
- columns and copy the "extra" bits to the new record. This is
- not a very good solution: it should be refactored on
- opportunity.
-
- REFACTORING SUGGESTION (Matz). Introduce a member function
- similar to move_field_offset() called copy_field_offset() to
- copy field values and implement it for all Field subclasses. Use
- this function to copy data from the found record to the record
- that are going to be inserted.
-
- The copy_field_offset() function need to be a virtual function,
- which in this case will prevent copying an entire range of
- fields efficiently.
- */
- {
- Field **field_ptr= table->field + master_fields;
- for ( ; *field_ptr ; ++field_ptr)
- {
- /*
- Set the null bit according to the values in record[1]
- */
- if ((*field_ptr)->maybe_null() &&
- (*field_ptr)->is_null_in_record(reinterpret_cast<uchar*>(table->record[1])))
- (*field_ptr)->set_null();
- else
- (*field_ptr)->set_notnull();
-
- /*
- Do the extra work for special columns.
- */
- switch ((*field_ptr)->real_type())
- {
- default:
- /* Nothing to do */
- break;
-
- case MYSQL_TYPE_BIT:
- Field_bit *f= static_cast<Field_bit*>(*field_ptr);
- if (f->bit_len > 0)
- {
- my_ptrdiff_t const offset= table->record[1] - table->record[0];
- uchar const bits=
- get_rec_bits(f->bit_ptr + offset, f->bit_ofs, f->bit_len);
- set_rec_bits(bits, f->bit_ptr, f->bit_ofs, f->bit_len);
- }
- break;
- }
- }
- }
- return 0; // All OK
-}
-
-#define DBUG_PRINT_BITSET(N,FRM,BS) \
- do { \
- char buf[256]; \
- for (uint i = 0 ; i < (BS)->n_bits ; ++i) \
- buf[i] = bitmap_is_set((BS), i) ? '1' : '0'; \
- buf[(BS)->n_bits] = '\0'; \
- DBUG_PRINT((N), ((FRM), buf)); \
- } while (0)
-
-
/**
Check if an error is a duplicate key error.
@@ -6945,45 +7110,76 @@ is_duplicate_key_error(int errcode)
return false;
}
+/**
+ Write the current row into event's table.
-/*
- Replace the provided record in the database.
+ The row is located in the row buffer, pointed by @c m_curr_row member.
+ Number of columns of the row is stored in @c m_width member (it can be
+ different from the number of columns in the table to which we insert).
+ Bitmap @c m_cols indicates which columns are present in the row. It is assumed
+ that event's table is already open and pointed by @c m_table.
- SYNOPSIS
- replace_record()
- thd Thread context for writing the record.
- table Table to which record should be written.
- master_reclength
- Offset to first column that is not present on the master,
- alternatively the length of the record on the master
- side.
+ If the same record already exists in the table it can be either overwritten
+ or an error is reported depending on the value of @c overwrite flag
+ (error reporting not yet implemented). Note that the matching record can be
+ different from the row we insert if we use primary keys to identify records in
+ the table.
- RETURN VALUE
- Error code on failure, 0 on success.
+ The row to be inserted can contain values only for selected columns. The
+ missing columns are filled with default values using @c prepare_record()
+ function. If a matching record is found in the table and @c overwritte is
+ true, the missing columns are taken from it.
- DESCRIPTION
- Similar to how it is done in mysql_insert(), we first try to do
- a ha_write_row() and of that fails due to duplicated keys (or
- indices), we do an ha_update_row() or a ha_delete_row() instead.
- */
-static int
-replace_record(THD *thd, TABLE *table,
- ulong const master_reclength,
- uint const master_fields)
+ @param rli Relay log info (needed for row unpacking).
+ @param overwrite
+ Shall we overwrite if the row already exists or signal
+ error (currently ignored).
+
+ @returns Error code on failure, 0 on success.
+
+ This method, if successful, sets @c m_curr_row_end pointer to point at the
+ next row in the rows buffer. This is done when unpacking the row to be
+ inserted.
+
+ @note If a matching record is found, it is either updated using
+ @c ha_update_row() or first deleted and then new record written.
+*/
+
+int
+Rows_log_event::write_row(const Relay_log_info *const rli,
+ const bool overwrite)
{
- DBUG_ENTER("replace_record");
- DBUG_ASSERT(table != NULL && thd != NULL);
+ DBUG_ENTER("write_row");
+ DBUG_ASSERT(m_table != NULL && thd != NULL);
+ TABLE *table= m_table; // pointer to event's table
int error;
int keynum;
auto_afree_ptr<char> key(NULL);
+ /* fill table->record[0] with default values */
+
+ if ((error= prepare_record(rli, table, m_width,
+ TRUE /* check if columns have def. values */)))
+ DBUG_RETURN(error);
+
+ /* unpack row into table->record[0] */
+ error= unpack_current_row(rli); // TODO: how to handle errors?
+
#ifndef DBUG_OFF
- DBUG_DUMP("record[0]",(const char *) table->record[0], table->s->reclength);
+ DBUG_DUMP("record[0]", table->record[0], table->s->reclength);
DBUG_PRINT_BITSET("debug", "write_set = %s", table->write_set);
DBUG_PRINT_BITSET("debug", "read_set = %s", table->read_set);
#endif
+ /*
+ Try to write record. If a corresponding record already exists in the table,
+ we try to change it using ha_update_row() if possible. Otherwise we delete
+ it and repeat the whole process again.
+
+ TODO: Add safety measures against infinite looping.
+ */
+
while ((error= table->file->ha_write_row(table->record[0])))
{
if (error == HA_ERR_LOCK_DEADLOCK || error == HA_ERR_LOCK_WAIT_TIMEOUT)
@@ -6993,7 +7189,13 @@ replace_record(THD *thd, TABLE *table,
}
if ((keynum= table->file->get_dup_key(error)) < 0)
{
- /* We failed to retrieve the duplicate key */
+ DBUG_PRINT("info",("Can't locate duplicate key (get_dup_key returns %d)",keynum));
+ table->file->print_error(error, MYF(0));
+ /*
+ We failed to retrieve the duplicate key
+ - either because the error was not "duplicate key" error
+ - or because the information which key is not available
+ */
DBUG_RETURN(error);
}
@@ -7009,17 +7211,22 @@ replace_record(THD *thd, TABLE *table,
*/
if (table->file->ha_table_flags() & HA_DUPLICATE_POS)
{
+ DBUG_PRINT("info",("Locating offending record using rnd_pos()"));
error= table->file->rnd_pos(table->record[1], table->file->dup_ref);
if (error)
{
+ DBUG_PRINT("info",("rnd_pos() returns error %d",error));
table->file->print_error(error, MYF(0));
DBUG_RETURN(error);
}
}
else
{
+ DBUG_PRINT("info",("Locating offending record using index_read_idx()"));
+
if (table->file->extra(HA_EXTRA_FLUSH_CACHE))
{
+ DBUG_PRINT("info",("Error when setting HA_EXTRA_FLUSH_CACHE"));
DBUG_RETURN(my_errno);
}
@@ -7027,30 +7234,47 @@ replace_record(THD *thd, TABLE *table,
{
key.assign(static_cast<char*>(my_alloca(table->s->max_unique_length)));
if (key.get() == NULL)
+ {
+ DBUG_PRINT("info",("Can't allocate key buffer"));
DBUG_RETURN(ENOMEM);
+ }
}
- key_copy((byte*)key.get(), table->record[0], table->key_info + keynum, 0);
- error= table->file->index_read_idx(table->record[1], keynum,
- (const byte*)key.get(),
- HA_WHOLE_KEY,
- HA_READ_KEY_EXACT);
+ key_copy((uchar*)key.get(), table->record[0], table->key_info + keynum,
+ 0);
+ error= table->file->index_read_idx_map(table->record[1], keynum,
+ (const uchar*)key.get(),
+ HA_WHOLE_KEY,
+ HA_READ_KEY_EXACT);
if (error)
{
+ DBUG_PRINT("info",("index_read_idx() returns error %d",error));
table->file->print_error(error, MYF(0));
DBUG_RETURN(error);
}
}
/*
- Now, table->record[1] should contain the offending row. That
+ Now, record[1] should contain the offending row. That
will enable us to update it or, alternatively, delete it (so
that we can insert the new row afterwards).
+ */
- First we copy the columns into table->record[0] that are not
- present on the master from table->record[1], if there are any.
+ /*
+ If row is incomplete we will use the record found to fill
+ missing columns.
*/
- copy_extra_record_fields(table, master_reclength, master_fields);
+ if (!get_flags(COMPLETE_ROWS_F))
+ {
+ restore_record(table,record[1]);
+ error= unpack_current_row(rli);
+ }
+
+#ifndef DBUG_OFF
+ DBUG_PRINT("debug",("preparing for update: before and after image"));
+ DBUG_DUMP("record[1] (before)", table->record[1], table->s->reclength);
+ DBUG_DUMP("record[0] (after)", table->record[0], table->s->reclength);
+#endif
/*
REPLACE is defined as either INSERT or DELETE + INSERT. If
@@ -7070,16 +7294,32 @@ replace_record(THD *thd, TABLE *table,
if (last_uniq_key(table, keynum) &&
!table->file->referenced_by_foreign_key())
{
+ DBUG_PRINT("info",("Updating row using ha_update_row()"));
error=table->file->ha_update_row(table->record[1],
table->record[0]);
- if (error)
+ switch (error) {
+
+ case HA_ERR_RECORD_IS_THE_SAME:
+ DBUG_PRINT("info",("ignoring HA_ERR_RECORD_IS_THE_SAME error from"
+ " ha_update_row()"));
+ error= 0;
+
+ case 0:
+ break;
+
+ default:
+ DBUG_PRINT("info",("ha_update_row() returns error %d",error));
table->file->print_error(error, MYF(0));
+ }
+
DBUG_RETURN(error);
}
else
{
+ DBUG_PRINT("info",("Deleting offending row and trying to write new one again"));
if ((error= table->file->ha_delete_row(table->record[1])))
{
+ DBUG_PRINT("info",("ha_delete_row() returns error %d",error));
table->file->print_error(error, MYF(0));
DBUG_RETURN(error);
}
@@ -7090,12 +7330,20 @@ replace_record(THD *thd, TABLE *table,
DBUG_RETURN(error);
}
-int Write_rows_log_event::do_exec_row(TABLE *table)
+#endif
+
+int
+Write_rows_log_event::do_exec_row(const Relay_log_info *const rli)
{
- DBUG_ASSERT(table != NULL);
- int error= replace_record(thd, table, m_master_reclength, m_width);
- return error;
+ DBUG_ASSERT(m_table != NULL);
+ int error= write_row(rli, TRUE /* overwrite */);
+
+ if (error && !thd->net.last_errno)
+ thd->net.last_errno= error;
+
+ return error;
}
+
#endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */
#ifdef MYSQL_CLIENT
@@ -7130,7 +7378,7 @@ static bool record_compare(TABLE *table)
*/
bool result= FALSE;
- byte saved_x[2], saved_filler[2];
+ uchar saved_x[2], saved_filler[2];
if (table->s->null_bytes > 0)
{
@@ -7188,40 +7436,52 @@ record_compare_exit:
return result;
}
+/**
+ Locate the current row in event's table.
-/*
- Find the row given by 'key', if the table has keys, or else use a table scan
- to find (and fetch) the row.
-
- If the engine allows random access of the records, a combination of
- position() and rnd_pos() will be used.
+ The current row is pointed by @c m_curr_row. Member @c m_width tells how many
+ columns are there in the row (this can be differnet from the number of columns
+ in the table). It is assumed that event's table is already open and pointed
+ by @c m_table.
- @param table Pointer to table to search
- @param key Pointer to key to use for search, if table has key
+ If a corresponding record is found in the table it is stored in
+ @c m_table->record[0]. Note that when record is located based on a primary
+ key, it is possible that the record found differs from the row being located.
- @pre <code>table->record[0]</code> shall contain the row to locate
- and <code>key</code> shall contain a key to use for searching, if
- the engine has a key.
+ If no key is specified or table does not have keys, a table scan is used to
+ find the row. In that case the row should be complete and contain values for
+ all columns. However, it can still be shorter than the table, i.e. the table
+ can contain extra columns not present in the row. It is also possible that
+ the table has fewer columns than the row being located.
- @post If the return value is zero, <code>table->record[1]</code>
- will contain the fetched row and the internal "cursor" will refer to
- the row. If the return value is non-zero,
- <code>table->record[1]</code> is undefined. In either case,
- <code>table->record[0]</code> is undefined.
+ @returns Error code on failure, 0 on success.
+
+ @post In case of success @c m_table->record[0] contains the record found.
+ Also, the internal "cursor" of the table is positioned at the record found.
- @return Zero if the row was successfully fetched into
- <code>table->record[1]</code>, error code otherwise.
+ @note If the engine allows random access of the records, a combination of
+ @c position() and @c rnd_pos() will be used.
*/
-static int find_and_fetch_row(TABLE *table, byte *key)
+int Rows_log_event::find_row(const Relay_log_info *rli)
{
- DBUG_ENTER("find_and_fetch_row(TABLE *table, byte *key, byte *record)");
- DBUG_PRINT("enter", ("table: 0x%lx, key: 0x%lx record: 0x%lx",
- (long) table, (long) key, (long) table->record[1]));
+ DBUG_ENTER("find_row");
+
+ DBUG_ASSERT(m_table && m_table->in_use != NULL);
+
+ TABLE *table= m_table;
+ int error;
+
+ /* unpack row - missing fields get default values */
- DBUG_ASSERT(table->in_use != NULL);
+ // TODO: shall we check and report errors here?
+ prepare_record(NULL,table,m_width,FALSE /* don't check errors */);
+ error= unpack_current_row(rli);
- DBUG_DUMP("record[0]",(const char *) table->record[0], table->s->reclength);
+#ifndef DBUG_OFF
+ DBUG_PRINT("info",("looking for the following record"));
+ DBUG_DUMP("record[0]", table->record[0], table->s->reclength);
+#endif
if ((table->file->ha_table_flags() & HA_PRIMARY_KEY_REQUIRED_FOR_POSITION) &&
table->s->primary_key < MAX_KEY)
@@ -7244,34 +7504,53 @@ static int find_and_fetch_row(TABLE *table, byte *key)
table->s->reclength) == 0);
*/
- table->file->position(table->record[0]);
- int error= table->file->rnd_pos(table->record[0], table->file->ref);
- /*
- rnd_pos() returns the record in table->record[0], so we have to
- move it to table->record[1].
- */
- bmove_align(table->record[1], table->record[0], table->s->reclength);
+ DBUG_PRINT("info",("locating record using primary key (position)"));
+ int error= table->file->rnd_pos_by_record(table->record[0]);
+ if (error)
+ {
+ DBUG_PRINT("info",("rnd_pos returns error %d",error));
+ table->file->print_error(error, MYF(0));
+ }
DBUG_RETURN(error);
}
- /* We need to retrieve all fields */
- /* TODO: Move this out from this function to main loop */
+ // We can't use position() - try other methods.
+
+ /*
+ We need to retrieve all fields
+ TODO: Move this out from this function to main loop
+ */
table->use_all_columns();
+ /*
+ Save copy of the record in table->record[1]. It might be needed
+ later if linear search is used to find exact match.
+ */
+ store_record(table,record[1]);
+
if (table->s->keys > 0)
{
- int error;
+ DBUG_PRINT("info",("locating record using primary key (index_read)"));
+
/* We have a key: search the table using the index */
if (!table->file->inited && (error= table->file->ha_index_init(0, FALSE)))
+ {
+ DBUG_PRINT("info",("ha_index_init returns error %d",error));
+ table->file->print_error(error, MYF(0));
DBUG_RETURN(error);
+ }
- /*
- Don't print debug messages when running valgrind since they can
- trigger false warnings.
- */
+ /* Fill key data for the row */
+
+ DBUG_ASSERT(m_key);
+ key_copy(m_key, table->record[0], table->key_info, 0);
+
+ /*
+ Don't print debug messages when running valgrind since they can
+ trigger false warnings.
+ */
#ifndef HAVE_purify
- DBUG_DUMP("table->record[0]", (const char *)table->record[0], table->s->reclength);
- DBUG_DUMP("table->record[1]", (const char *)table->record[1], table->s->reclength);
+ DBUG_DUMP("key data", m_key, table->key_info->key_length);
#endif
/*
@@ -7282,10 +7561,13 @@ static int find_and_fetch_row(TABLE *table, byte *key)
*/
my_ptrdiff_t const pos=
table->s->null_bytes > 0 ? table->s->null_bytes - 1 : 0;
- table->record[1][pos]= 0xFF;
- if ((error= table->file->index_read(table->record[1], key, HA_WHOLE_KEY,
- HA_READ_KEY_EXACT)))
+ table->record[0][pos]= 0xFF;
+
+ if ((error= table->file->index_read_map(table->record[0], m_key,
+ HA_WHOLE_KEY,
+ HA_READ_KEY_EXACT)))
{
+ DBUG_PRINT("info",("no record matching the key found in the table"));
table->file->print_error(error, MYF(0));
table->file->ha_index_end();
DBUG_RETURN(error);
@@ -7296,8 +7578,8 @@ static int find_and_fetch_row(TABLE *table, byte *key)
trigger false warnings.
*/
#ifndef HAVE_purify
- DBUG_DUMP("table->record[0]", (const char *)table->record[0], table->s->reclength);
- DBUG_DUMP("table->record[1]", (const char *)table->record[1], table->s->reclength);
+ DBUG_PRINT("info",("found first matching record"));
+ DBUG_DUMP("record[0]", table->record[0], table->s->reclength);
#endif
/*
Below is a minor "optimization". If the key (i.e., key number
@@ -7319,10 +7601,15 @@ static int find_and_fetch_row(TABLE *table, byte *key)
DBUG_RETURN(0);
}
+ /*
+ In case key is not unique, we still have to iterate over records found
+ and find the one which is identical to the row given. A copy of the
+ record we are looking for is stored in record[1].
+ */
+ DBUG_PRINT("info",("non-unique index, scanning it to find matching record"));
+
while (record_compare(table))
{
- int error;
-
/*
We need to set the null bytes to ensure that the filler bit
are all set when returning. There are storage engines that
@@ -7334,15 +7621,16 @@ static int find_and_fetch_row(TABLE *table, byte *key)
*/
if (table->s->null_bytes > 0)
{
- table->record[1][table->s->null_bytes - 1]|=
+ table->record[0][table->s->null_bytes - 1]|=
256U - (1U << table->s->last_null_bit_pos);
}
- if ((error= table->file->index_next(table->record[1])))
+ if ((error= table->file->index_next(table->record[0])))
{
- table->file->print_error(error, MYF(0));
+ DBUG_PRINT("info",("no record matching the given row found"));
+ table->file->print_error(error, MYF(0));
table->file->ha_index_end();
- DBUG_RETURN(error);
+ DBUG_RETURN(error);
}
}
@@ -7353,45 +7641,57 @@ static int find_and_fetch_row(TABLE *table, byte *key)
}
else
{
+ DBUG_PRINT("info",("locating record using table scan (rnd_next)"));
+
int restart_count= 0; // Number of times scanning has restarted from top
- int error;
/* We don't have a key: search the table using rnd_next() */
if ((error= table->file->ha_rnd_init(1)))
- return error;
+ {
+ DBUG_PRINT("info",("error initializing table scan"
+ " (ha_rnd_init returns %d)",error));
+ table->file->print_error(error, MYF(0));
+ DBUG_RETURN(error);
+ }
/* Continue until we find the right record or have made a full loop */
do
{
- error= table->file->rnd_next(table->record[1]);
+ error= table->file->rnd_next(table->record[0]);
- DBUG_DUMP("record[0]",(const char *) table->record[0], table->s->reclength);
- DBUG_DUMP("record[1]",(const char *) table->record[1], table->s->reclength);
+ switch (error) {
- switch (error)
- {
case 0:
case HA_ERR_RECORD_DELETED:
- break;
+ break;
case HA_ERR_END_OF_FILE:
- if (++restart_count < 2)
- table->file->ha_rnd_init(1);
- break;
+ if (++restart_count < 2)
+ table->file->ha_rnd_init(1);
+ break;
default:
- table->file->print_error(error, MYF(0));
- DBUG_PRINT("info", ("Record not found"));
+ DBUG_PRINT("info", ("Failed to get next record"
+ " (rnd_next returns %d)",error));
+ table->file->print_error(error, MYF(0));
table->file->ha_rnd_end();
- DBUG_RETURN(error);
+ DBUG_RETURN(error);
}
}
while (restart_count < 2 && record_compare(table));
+
+ /*
+ Note: above record_compare will take into accout all record fields
+ which might be incorrect in case a partial row was given in the event
+ */
/*
Have to restart the scan to be able to fetch the next row.
*/
- DBUG_PRINT("info", ("Record %sfound", restart_count == 2 ? "not " : ""));
+ if (restart_count == 2)
+ DBUG_PRINT("info", ("Record not found"));
+ else
+ DBUG_DUMP("record found", table->record[0], table->s->reclength);
table->file->ha_rnd_end();
DBUG_ASSERT(error == HA_ERR_END_OF_FILE || error == 0);
@@ -7400,6 +7700,7 @@ static int find_and_fetch_row(TABLE *table, byte *key)
DBUG_RETURN(0);
}
+
#endif
/*
@@ -7411,9 +7712,6 @@ Delete_rows_log_event::Delete_rows_log_event(THD *thd_arg, TABLE *tbl_arg,
ulong tid, MY_BITMAP const *cols,
bool is_transactional)
: Rows_log_event(thd_arg, tbl_arg, tid, cols, is_transactional)
-#ifdef HAVE_REPLICATION
- ,m_memory(NULL), m_key(NULL), m_after_image(NULL)
-#endif
{
}
#endif /* #if !defined(MYSQL_CLIENT) */
@@ -7425,107 +7723,58 @@ Delete_rows_log_event::Delete_rows_log_event(THD *thd_arg, TABLE *tbl_arg,
Delete_rows_log_event::Delete_rows_log_event(const char *buf, uint event_len,
const Format_description_log_event
*description_event)
-#if defined(MYSQL_CLIENT)
: Rows_log_event(buf, event_len, DELETE_ROWS_EVENT, description_event)
-#else
- : Rows_log_event(buf, event_len, DELETE_ROWS_EVENT, description_event),
- m_memory(NULL), m_key(NULL), m_after_image(NULL)
-#endif
{
}
#endif
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
-int Delete_rows_log_event::do_before_row_operations(TABLE *table)
-{
- DBUG_ASSERT(m_memory == NULL);
- if ((table->file->ha_table_flags() & HA_PRIMARY_KEY_REQUIRED_FOR_POSITION) &&
- table->s->primary_key < MAX_KEY)
+int
+Delete_rows_log_event::do_before_row_operations(const Slave_reporting_capability *const)
+{
+ if ((m_table->file->ha_table_flags() & HA_PRIMARY_KEY_REQUIRED_FOR_POSITION) &&
+ m_table->s->primary_key < MAX_KEY)
{
/*
- We don't need to allocate any memory for m_after_image and
- m_key since they are not used.
+ We don't need to allocate any memory for m_key since it is not used.
*/
return 0;
}
- int error= 0;
-
- if (table->s->keys > 0)
- {
- m_memory=
- my_multi_malloc(MYF(MY_WME),
- &m_after_image, table->s->reclength,
- &m_key, table->key_info->key_length,
- NULL);
- }
- else
+ if (m_table->s->keys > 0)
{
- m_after_image= (byte*)my_malloc(table->s->reclength, MYF(MY_WME));
- m_memory= (gptr)m_after_image;
- m_key= NULL;
+ // Allocate buffer for key searches
+ m_key= (uchar*)my_malloc(m_table->key_info->key_length, MYF(MY_WME));
+ if (!m_key)
+ return HA_ERR_OUT_OF_MEM;
}
- if (!m_memory)
- return HA_ERR_OUT_OF_MEM;
-
- return error;
+ return 0;
}
-int Delete_rows_log_event::do_after_row_operations(TABLE *table, int error)
+int
+Delete_rows_log_event::do_after_row_operations(const Slave_reporting_capability *const,
+ int error)
{
/*error= ToDo:find out what this should really be, this triggers close_scan in nbd, returning error?*/
- table->file->ha_index_or_rnd_end();
- my_free(m_memory, MYF(MY_ALLOW_ZERO_PTR)); // Free for multi_malloc
- m_memory= NULL;
- m_after_image= NULL;
+ m_table->file->ha_index_or_rnd_end();
+ my_free(m_key, MYF(MY_ALLOW_ZERO_PTR));
m_key= NULL;
return error;
}
-int Delete_rows_log_event::do_prepare_row(THD *thd, RELAY_LOG_INFO const *rli,
- TABLE *table,
- char const *const row_start,
- char const **const row_end)
-{
- int error;
- DBUG_ASSERT(row_start && row_end);
- /*
- This assertion actually checks that there is at least as many
- columns on the slave as on the master.
- */
- DBUG_ASSERT(table->s->fields >= m_width);
-
- error= unpack_row(rli, table, m_width, row_start, &m_cols, row_end,
- &m_master_reclength, table->read_set, DELETE_ROWS_EVENT);
- /*
- If we will access rows using the random access method, m_key will
- be set to NULL, so we do not need to make a key copy in that case.
- */
- if (m_key)
- {
- KEY *const key_info= table->key_info;
-
- key_copy(m_key, table->record[0], key_info, 0);
- }
-
- return error;
-}
-
-int Delete_rows_log_event::do_exec_row(TABLE *table)
+int Delete_rows_log_event::do_exec_row(const Relay_log_info *const rli)
{
int error;
- DBUG_ASSERT(table != NULL);
+ DBUG_ASSERT(m_table != NULL);
- if (!(error= find_and_fetch_row(table, m_key)))
+ if (!(error= find_row(rli)))
{
/*
- Now we should have the right row to delete. We are using
- record[0] since it is guaranteed to point to a record with the
- correct value.
+ Delete the record found, located in record[0]
*/
- error= table->file->ha_delete_row(table->record[0]);
+ error= m_table->file->ha_delete_row(m_table->record[0]);
}
return error;
}
@@ -7555,10 +7804,6 @@ Update_rows_log_event::Update_rows_log_event(THD *thd_arg, TABLE *tbl_arg,
MY_BITMAP const *cols_ai,
bool is_transactional)
: Rows_log_event(thd_arg, tbl_arg, tid, cols_bi, is_transactional)
-#ifdef HAVE_REPLICATION
- , m_memory(NULL), m_key(NULL)
-
-#endif
{
init(cols_ai);
}
@@ -7568,24 +7813,24 @@ Update_rows_log_event::Update_rows_log_event(THD *thd_arg, TABLE *tbl_arg,
MY_BITMAP const *cols,
bool is_transactional)
: Rows_log_event(thd_arg, tbl_arg, tid, cols, is_transactional)
-#ifdef HAVE_REPLICATION
- , m_memory(NULL), m_key(NULL)
-#endif
{
init(cols);
}
void Update_rows_log_event::init(MY_BITMAP const *cols)
{
- /* if bitmap_init fails, catched in is_valid() */
+ /* if bitmap_init fails, caught in is_valid() */
if (likely(!bitmap_init(&m_cols_ai,
m_width <= sizeof(m_bitbuf_ai)*8 ? m_bitbuf_ai : NULL,
- (m_width + 7) & ~7UL,
+ m_width,
false)))
{
/* Cols can be zero if this is a dummy binrows event */
if (likely(cols != NULL))
+ {
memcpy(m_cols_ai.bitmap, cols->bitmap, no_bytes_in_map(cols));
+ create_last_word_mask(&m_cols_ai);
+ }
}
}
#endif /* !defined(MYSQL_CLIENT) */
@@ -7607,144 +7852,87 @@ Update_rows_log_event::Update_rows_log_event(const char *buf, uint event_len,
const
Format_description_log_event
*description_event)
-#if defined(MYSQL_CLIENT)
: Rows_log_event(buf, event_len, UPDATE_ROWS_EVENT, description_event)
-#else
- : Rows_log_event(buf, event_len, UPDATE_ROWS_EVENT, description_event),
- m_memory(NULL), m_key(NULL)
-#endif
{
}
#endif
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
-int Update_rows_log_event::do_before_row_operations(TABLE *table)
-{
- DBUG_ASSERT(m_memory == NULL);
- int error= 0;
-
- if (table->s->keys > 0)
- {
- m_memory=
- my_multi_malloc(MYF(MY_WME),
- &m_after_image, table->s->reclength,
- &m_key, table->key_info->key_length,
- NULL);
- }
- else
+int
+Update_rows_log_event::do_before_row_operations(const Slave_reporting_capability *const)
+{
+ if (m_table->s->keys > 0)
{
- m_after_image= (byte*)my_malloc(table->s->reclength, MYF(MY_WME));
- m_memory= (gptr)m_after_image;
- m_key= NULL;
+ // Allocate buffer for key searches
+ m_key= (uchar*)my_malloc(m_table->key_info->key_length, MYF(MY_WME));
+ if (!m_key)
+ return HA_ERR_OUT_OF_MEM;
}
- if (!m_memory)
- return HA_ERR_OUT_OF_MEM;
- table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
+ m_table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
- return error;
+ return 0;
}
-int Update_rows_log_event::do_after_row_operations(TABLE *table, int error)
+int
+Update_rows_log_event::do_after_row_operations(const Slave_reporting_capability *const,
+ int error)
{
/*error= ToDo:find out what this should really be, this triggers close_scan in nbd, returning error?*/
- table->file->ha_index_or_rnd_end();
- my_free(m_memory, MYF(MY_ALLOW_ZERO_PTR));
- m_memory= NULL;
- m_after_image= NULL;
+ m_table->file->ha_index_or_rnd_end();
+ my_free(m_key, MYF(MY_ALLOW_ZERO_PTR)); // Free for multi_malloc
m_key= NULL;
return error;
}
-int Update_rows_log_event::do_prepare_row(THD *thd, RELAY_LOG_INFO const *rli,
- TABLE *table,
- char const *const row_start,
- char const **const row_end)
+int
+Update_rows_log_event::do_exec_row(const Relay_log_info *const rli)
{
- int error;
- DBUG_ASSERT(row_start && row_end);
- /*
- This assertion actually checks that there is at least as many
- columns on the slave as on the master.
- */
- DBUG_ASSERT(table->s->fields >= m_width);
-
- /*
- We need to perform some juggling below since unpack_row() always
- unpacks into table->record[0]. For more information, see the
- comments for unpack_row().
- */
-
- /* record[0] is the before image for the update */
- error= unpack_row(rli, table, m_width, row_start, &m_cols, row_end,
- &m_master_reclength, table->read_set, UPDATE_ROWS_EVENT);
- store_record(table, record[1]);
- char const *next_start = *row_end;
- /* m_after_image is the after image for the update */
- error= unpack_row(rli, table, m_width, next_start, &m_cols_ai, row_end,
- &m_master_reclength, table->write_set, UPDATE_ROWS_EVENT);
- bmove_align(m_after_image, table->record[0], table->s->reclength);
- restore_record(table, record[1]);
+ DBUG_ASSERT(m_table != NULL);
- /*
- Don't print debug messages when running valgrind since they can
- trigger false warnings.
- */
-#ifndef HAVE_purify
- DBUG_DUMP("record[0]", (const char *)table->record[0], table->s->reclength);
- DBUG_DUMP("m_after_image", (const char *)m_after_image, table->s->reclength);
-#endif
+ int error= find_row(rli);
+ if (error)
+ return error;
/*
- If we will access rows using the random access method, m_key will
- be set to NULL, so we do not need to make a key copy in that case.
- */
- if (m_key)
- {
- KEY *const key_info= table->key_info;
+ This is the situation after locating BI:
- key_copy(m_key, table->record[0], key_info, 0);
- }
+ ===|=== before image ====|=== after image ===|===
+ ^ ^
+ m_curr_row m_curr_row_end
- return error;
-}
+ BI found in the table is stored in record[0]. We copy it to record[1]
+ and unpack AI to record[0].
+ */
-int Update_rows_log_event::do_exec_row(TABLE *table)
-{
- DBUG_ASSERT(table != NULL);
+ store_record(m_table,record[1]);
- int error= find_and_fetch_row(table, m_key);
- if (error)
- return error;
-
- /*
- We have to ensure that the new record (i.e., the after image) is
- in record[0] and the old record (i.e., the before image) is in
- record[1]. This since some storage engines require this (for
- example, the partition engine).
-
- Since find_and_fetch_row() puts the fetched record (i.e., the old
- record) in record[1], we can keep it there. We put the new record
- (i.e., the after image) into record[0], and copy the fields that
- are on the slave (i.e., in record[1]) into record[0], effectively
- overwriting the default values that where put there by the
- unpack_row() function.
- */
- bmove_align(table->record[0], m_after_image, table->s->reclength);
- copy_extra_record_fields(table, m_master_reclength, m_width);
+ m_curr_row= m_curr_row_end;
+ error= unpack_current_row(rli); // this also updates m_curr_row_end
/*
Now we have the right row to update. The old row (the one we're
- looking for) is in record[1] and the new row has is in record[0].
- We also have copied the original values already in the slave's
- database into the after image delivered from the master.
+ looking for) is in record[1] and the new row is in record[0].
*/
- error= table->file->ha_update_row(table->record[1], table->record[0]);
+#ifndef HAVE_purify
+ /*
+ Don't print debug messages when running valgrind since they can
+ trigger false warnings.
+ */
+ DBUG_PRINT("info",("Updating row in table"));
+ DBUG_DUMP("old record", m_table->record[1], m_table->s->reclength);
+ DBUG_DUMP("new values", m_table->record[0], m_table->s->reclength);
+#endif
+
+ error= m_table->file->ha_update_row(m_table->record[1], m_table->record[0]);
+ if (error == HA_ERR_RECORD_IS_THE_SAME)
+ error= 0;
return error;
}
+
#endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */
#ifdef MYSQL_CLIENT
@@ -7798,7 +7986,7 @@ Incident_log_event::description() const
DBUG_PRINT("info", ("m_incident: %d", m_incident));
DBUG_ASSERT(0 <= m_incident);
- DBUG_ASSERT((my_size_t) m_incident <= sizeof(description)/sizeof(*description));
+ DBUG_ASSERT((size_t) m_incident <= sizeof(description)/sizeof(*description));
return description[m_incident];
}
@@ -7808,7 +7996,7 @@ Incident_log_event::description() const
void Incident_log_event::pack_info(Protocol *protocol)
{
char buf[256];
- my_size_t bytes;
+ size_t bytes;
if (m_message.length > 0)
bytes= my_snprintf(buf, sizeof(buf), "#%d (%s)",
m_incident, description());
@@ -7836,13 +8024,13 @@ Incident_log_event::print(FILE *file,
#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
int
-Incident_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
+Incident_log_event::do_apply_event(Relay_log_info const *rli)
{
DBUG_ENTER("Incident_log_event::do_apply_event");
- slave_print_msg(ERROR_LEVEL, rli, ER_SLAVE_INCIDENT,
- ER(ER_SLAVE_INCIDENT),
- description(),
- m_message.length > 0 ? m_message.str : "<none>");
+ rli->report(ERROR_LEVEL, ER_SLAVE_INCIDENT,
+ ER(ER_SLAVE_INCIDENT),
+ description(),
+ m_message.length > 0 ? m_message.str : "<none>");
DBUG_RETURN(1);
}
#endif
@@ -7852,7 +8040,7 @@ Incident_log_event::write_data_header(IO_CACHE *file)
{
DBUG_ENTER("Incident_log_event::write_data_header");
DBUG_PRINT("enter", ("m_incident: %d", m_incident));
- byte buf[sizeof(int16)];
+ uchar buf[sizeof(int16)];
int2store(buf, (int16) m_incident);
DBUG_RETURN(my_b_safe_write(file, buf, sizeof(buf)));
}
@@ -7863,5 +8051,3 @@ Incident_log_event::write_data_body(IO_CACHE *file)
DBUG_ENTER("Incident_log_event::write_data_body");
DBUG_RETURN(write_str(file, m_message.str, m_message.length));
}
-
-
diff --git a/sql/log_event.h b/sql/log_event.h
index 4e43822cb38..0c66d1b190f 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -13,6 +13,15 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+/**
+ @addtogroup Replication
+ @{
+
+ @file
+
+ Binary log event definitions.
+*/
+
#ifndef _log_event_h
#define _log_event_h
@@ -23,6 +32,10 @@
#include <my_bitmap.h>
#include "rpl_constants.h"
+#ifndef MYSQL_CLIENT
+#include "rpl_record.h"
+#include "rpl_reporting.h"
+#endif
#define LOG_READ_EOF -1
#define LOG_READ_BOGUS -2
@@ -57,8 +70,8 @@
which increments every time we write an event to the binlog) (3 bytes).
Q: how do we handle when the counter is overflowed and restarts from 0 ?
- - Query and Load (Create or Execute) events may have a more precise timestamp
- (with microseconds), number of matched/affected/warnings rows
+ - Query and Load (Create or Execute) events may have a more precise
+ timestamp (with microseconds), number of matched/affected/warnings rows
and fields of session variables: SQL_MODE,
FOREIGN_KEY_CHECKS, UNIQUE_CHECKS, SQL_AUTO_IS_NULL, the collations and
charsets, the PASSWORD() version (old/new/...).
@@ -520,9 +533,7 @@ class THD;
#endif
class Format_description_log_event;
-
-struct st_relay_log_info;
-typedef st_relay_log_info RELAY_LOG_INFO;
+class Relay_log_info;
#ifdef MYSQL_CLIENT
/*
@@ -708,7 +719,8 @@ public:
*/
static Log_event* read_log_event(IO_CACHE* file,
pthread_mutex_t* log_lock,
- const Format_description_log_event *description_event);
+ const Format_description_log_event
+ *description_event);
static int read_log_event(IO_CACHE* file, String* packet,
pthread_mutex_t* log_lock);
/*
@@ -736,7 +748,8 @@ public:
Log_event() : temp_buf(0) {}
/* avoid having to link mysqlbinlog against libpthread */
static Log_event* read_log_event(IO_CACHE* file,
- const Format_description_log_event *description_event);
+ const Format_description_log_event
+ *description_event);
/* print*() functions are used by mysqlbinlog */
virtual void print(FILE* file, PRINT_EVENT_INFO* print_event_info) = 0;
void print_timestamp(IO_CACHE* file, time_t *ts = 0);
@@ -753,7 +766,7 @@ public:
static void operator delete(void *ptr, size_t size)
{
- my_free((gptr) ptr, MYF(MY_WME|MY_ALLOW_ZERO_PTR));
+ my_free((uchar*) ptr, MYF(MY_WME|MY_ALLOW_ZERO_PTR));
}
/* Placement version of the above operators */
@@ -772,12 +785,24 @@ public:
{ return 0; }
virtual bool write_data_body(IO_CACHE* file __attribute__((unused)))
{ return 0; }
+ inline time_t get_time()
+ {
+ THD *tmp_thd;
+ if (when)
+ return when;
+ if (thd)
+ return thd->start_time;
+ if ((tmp_thd= current_thd))
+ return tmp_thd->start_time;
+ return my_time(0);
+ }
#endif
virtual Log_event_type get_type_code() = 0;
virtual bool is_valid() const = 0;
virtual bool is_artificial_event() { return 0; }
inline bool get_cache_stmt() const { return cache_stmt; }
- Log_event(const char* buf, const Format_description_log_event* description_event);
+ Log_event(const char* buf, const Format_description_log_event
+ *description_event);
virtual ~Log_event() { free_temp_buf();}
void register_temp_buf(char* buf) { temp_buf = buf; }
void free_temp_buf()
@@ -800,6 +825,8 @@ public:
/* returns the human readable name of the event's type */
const char* get_type_str();
+ /* Return start of query time or current time */
+
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
public:
@@ -811,7 +838,8 @@ public:
@see do_apply_event
*/
- int apply_event(RELAY_LOG_INFO const *rli) {
+ int apply_event(Relay_log_info const *rli)
+ {
return do_apply_event(rli);
}
@@ -824,7 +852,7 @@ public:
@see do_update_pos
*/
- int update_pos(RELAY_LOG_INFO *rli)
+ int update_pos(Relay_log_info *rli)
{
return do_update_pos(rli);
}
@@ -835,7 +863,7 @@ public:
@see do_shall_skip
*/
- enum_skip_reason shall_skip(RELAY_LOG_INFO *rli)
+ enum_skip_reason shall_skip(Relay_log_info *rli)
{
return do_shall_skip(rli);
}
@@ -857,7 +885,7 @@ protected:
@retval 0 Event applied successfully
@retval errno Error code if event application failed
*/
- virtual int do_apply_event(RELAY_LOG_INFO const *rli)
+ virtual int do_apply_event(Relay_log_info const *rli)
{
return 0; /* Default implementation does nothing */
}
@@ -886,7 +914,7 @@ protected:
1). Observe that handler errors are returned by the
do_apply_event() function, and not by this one.
*/
- virtual int do_update_pos(RELAY_LOG_INFO *rli);
+ virtual int do_update_pos(Relay_log_info *rli);
/**
@@ -918,8 +946,7 @@ protected:
The event shall be skipped because the slave skip counter was
non-zero. The caller shall decrease the counter by one.
*/
- virtual enum_skip_reason do_shall_skip(RELAY_LOG_INFO *rli);
-
+ virtual enum_skip_reason do_shall_skip(Relay_log_info *rli);
#endif
};
@@ -1023,7 +1050,8 @@ public:
#ifndef MYSQL_CLIENT
Query_log_event(THD* thd_arg, const char* query_arg, ulong query_length,
- bool using_trans, bool suppress_use);
+ bool using_trans, bool suppress_use,
+ THD::killed_state killed_err_arg= THD::KILLED_NO_VALUE);
const char* get_db() { return db; }
#ifdef HAVE_REPLICATION
void pack_info(Protocol* protocol);
@@ -1040,7 +1068,7 @@ public:
~Query_log_event()
{
if (data_buf)
- my_free((gptr) data_buf, MYF(0));
+ my_free((uchar*) data_buf, MYF(0));
}
Log_event_type get_type_code() { return QUERY_EVENT; }
#ifndef MYSQL_CLIENT
@@ -1058,10 +1086,10 @@ public:
public: /* !!! Public in this patch to allow old usage */
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
- virtual int do_apply_event(RELAY_LOG_INFO const *rli);
- virtual int do_update_pos(RELAY_LOG_INFO *rli);
+ virtual int do_apply_event(Relay_log_info const *rli);
+ virtual int do_update_pos(Relay_log_info *rli);
- int do_apply_event(RELAY_LOG_INFO const *rli,
+ int do_apply_event(Relay_log_info const *rli,
const char *query_arg,
uint32 q_len_arg);
#endif /* HAVE_REPLICATION */
@@ -1113,7 +1141,7 @@ public:
uint16 master_port;
#ifndef MYSQL_CLIENT
- Slave_log_event(THD* thd_arg, RELAY_LOG_INFO* rli);
+ Slave_log_event(THD* thd_arg, Relay_log_info* rli);
void pack_info(Protocol* protocol);
#else
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
@@ -1130,7 +1158,7 @@ public:
private:
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
- virtual int do_apply_event(RELAY_LOG_INFO const* rli);
+ virtual int do_apply_event(Relay_log_info const* rli);
#endif
};
@@ -1150,7 +1178,8 @@ private:
char **fn_start, char **fn_end);
protected:
int copy_log_event(const char *buf, ulong event_len,
- int body_offset, const Format_description_log_event* description_event);
+ int body_offset,
+ const Format_description_log_event* description_event);
public:
ulong thread_id;
@@ -1235,12 +1264,12 @@ public:
public: /* !!! Public in this patch to allow old usage */
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
- virtual int do_apply_event(RELAY_LOG_INFO const* rli)
+ virtual int do_apply_event(Relay_log_info const* rli)
{
return do_apply_event(thd->slave_net,rli,0);
}
- int do_apply_event(NET *net, RELAY_LOG_INFO const *rli,
+ int do_apply_event(NET *net, Relay_log_info const *rli,
bool use_rli_only_for_errors);
#endif
};
@@ -1295,6 +1324,11 @@ public:
setting log_event == 0 (for now).
*/
bool artificial_event;
+ /*
+ We set this to 1 if we don't want to have the created time in the log,
+ which is the case when we rollover to a new log.
+ */
+ bool dont_set_created;
#ifndef MYSQL_CLIENT
Start_log_event_v3();
@@ -1322,8 +1356,8 @@ public:
protected:
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
- virtual int do_apply_event(RELAY_LOG_INFO const *rli);
- virtual enum_skip_reason do_shall_skip(RELAY_LOG_INFO*)
+ virtual int do_apply_event(Relay_log_info const *rli);
+ virtual enum_skip_reason do_shall_skip(Relay_log_info*)
{
/*
Events from ourself should be skipped, but they should not
@@ -1361,8 +1395,9 @@ public:
Format_description_log_event(uint8 binlog_ver, const char* server_ver=0);
Format_description_log_event(const char* buf, uint event_len,
- const Format_description_log_event* description_event);
- ~Format_description_log_event() { my_free((gptr)post_header_len, MYF(0)); }
+ const Format_description_log_event
+ *description_event);
+ ~Format_description_log_event() { my_free((uchar*)post_header_len, MYF(0)); }
Log_event_type get_type_code() { return FORMAT_DESCRIPTION_EVENT;}
#ifndef MYSQL_CLIENT
bool write(IO_CACHE* file);
@@ -1387,9 +1422,9 @@ public:
protected:
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
- virtual int do_apply_event(RELAY_LOG_INFO const *rli);
- virtual int do_update_pos(RELAY_LOG_INFO *rli);
- virtual enum_skip_reason do_shall_skip(RELAY_LOG_INFO *rli);
+ virtual int do_apply_event(Relay_log_info const *rli);
+ virtual int do_update_pos(Relay_log_info *rli);
+ virtual enum_skip_reason do_shall_skip(Relay_log_info *rli);
#endif
};
@@ -1419,7 +1454,8 @@ public:
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
- Intvar_log_event(const char* buf, const Format_description_log_event* description_event);
+ Intvar_log_event(const char* buf,
+ const Format_description_log_event *description_event);
~Intvar_log_event() {}
Log_event_type get_type_code() { return INTVAR_EVENT;}
const char* get_var_type_name();
@@ -1431,9 +1467,9 @@ public:
private:
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
- virtual int do_apply_event(RELAY_LOG_INFO const *rli);
- virtual int do_update_pos(RELAY_LOG_INFO *rli);
- virtual enum_skip_reason do_shall_skip(RELAY_LOG_INFO *rli);
+ virtual int do_apply_event(Relay_log_info const *rli);
+ virtual int do_update_pos(Relay_log_info *rli);
+ virtual enum_skip_reason do_shall_skip(Relay_log_info *rli);
#endif
};
@@ -1466,7 +1502,8 @@ class Rand_log_event: public Log_event
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
- Rand_log_event(const char* buf, const Format_description_log_event* description_event);
+ Rand_log_event(const char* buf,
+ const Format_description_log_event *description_event);
~Rand_log_event() {}
Log_event_type get_type_code() { return RAND_EVENT;}
int get_data_size() { return 16; /* sizeof(ulonglong) * 2*/ }
@@ -1477,9 +1514,9 @@ class Rand_log_event: public Log_event
private:
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
- virtual int do_apply_event(RELAY_LOG_INFO const *rli);
- virtual int do_update_pos(RELAY_LOG_INFO *rli);
- virtual enum_skip_reason do_shall_skip(RELAY_LOG_INFO *rli);
+ virtual int do_apply_event(Relay_log_info const *rli);
+ virtual int do_update_pos(Relay_log_info *rli);
+ virtual enum_skip_reason do_shall_skip(Relay_log_info *rli);
#endif
};
@@ -1509,7 +1546,8 @@ class Xid_log_event: public Log_event
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
- Xid_log_event(const char* buf, const Format_description_log_event* description_event);
+ Xid_log_event(const char* buf,
+ const Format_description_log_event *description_event);
~Xid_log_event() {}
Log_event_type get_type_code() { return XID_EVENT;}
int get_data_size() { return sizeof(xid); }
@@ -1520,7 +1558,7 @@ class Xid_log_event: public Log_event
private:
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
- virtual int do_apply_event(RELAY_LOG_INFO const *rli);
+ virtual int do_apply_event(Relay_log_info const *rli);
#endif
};
@@ -1555,7 +1593,8 @@ public:
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
- User_var_log_event(const char* buf, const Format_description_log_event* description_event);
+ User_var_log_event(const char* buf,
+ const Format_description_log_event *description_event);
~User_var_log_event() {}
Log_event_type get_type_code() { return USER_VAR_EVENT;}
#ifndef MYSQL_CLIENT
@@ -1565,9 +1604,9 @@ public:
private:
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
- virtual int do_apply_event(RELAY_LOG_INFO const *rli);
- virtual int do_update_pos(RELAY_LOG_INFO *rli);
- virtual enum_skip_reason do_shall_skip(RELAY_LOG_INFO *rli);
+ virtual int do_apply_event(Relay_log_info const *rli);
+ virtual int do_update_pos(Relay_log_info *rli);
+ virtual enum_skip_reason do_shall_skip(Relay_log_info *rli);
#endif
};
@@ -1587,7 +1626,8 @@ public:
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
- Stop_log_event(const char* buf, const Format_description_log_event* description_event):
+ Stop_log_event(const char* buf,
+ const Format_description_log_event *description_event):
Log_event(buf, description_event)
{}
~Stop_log_event() {}
@@ -1596,8 +1636,8 @@ public:
private:
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
- virtual int do_update_pos(RELAY_LOG_INFO *rli);
- virtual enum_skip_reason do_shall_skip(RELAY_LOG_INFO *rli)
+ virtual int do_update_pos(Relay_log_info *rli);
+ virtual enum_skip_reason do_shall_skip(Relay_log_info *rli)
{
/*
Events from ourself should be skipped, but they should not
@@ -1645,7 +1685,7 @@ public:
~Rotate_log_event()
{
if (flags & DUP_NAME)
- my_free((gptr) new_log_ident, MYF(MY_ALLOW_ZERO_PTR));
+ my_free((uchar*) new_log_ident, MYF(MY_ALLOW_ZERO_PTR));
}
Log_event_type get_type_code() { return ROTATE_EVENT;}
int get_data_size() { return ident_len + ROTATE_HEADER_LEN;}
@@ -1656,8 +1696,8 @@ public:
private:
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
- virtual int do_update_pos(RELAY_LOG_INFO *rli);
- virtual enum_skip_reason do_shall_skip(RELAY_LOG_INFO *rli);
+ virtual int do_update_pos(Relay_log_info *rli);
+ virtual enum_skip_reason do_shall_skip(Relay_log_info *rli);
#endif
};
@@ -1696,7 +1736,8 @@ public:
#endif /* HAVE_REPLICATION */
#else
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
- void print(FILE* file, PRINT_EVENT_INFO* print_event_info, bool enable_local);
+ void print(FILE* file, PRINT_EVENT_INFO* print_event_info,
+ bool enable_local);
#endif
Create_file_log_event(const char* buf, uint event_len,
@@ -1729,7 +1770,7 @@ public:
private:
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
- virtual int do_apply_event(RELAY_LOG_INFO const *rli);
+ virtual int do_apply_event(Relay_log_info const *rli);
#endif
};
@@ -1771,7 +1812,8 @@ public:
#endif
Append_block_log_event(const char* buf, uint event_len,
- const Format_description_log_event* description_event);
+ const Format_description_log_event
+ *description_event);
~Append_block_log_event() {}
Log_event_type get_type_code() { return APPEND_BLOCK_EVENT;}
int get_data_size() { return block_len + APPEND_BLOCK_HEADER_LEN ;}
@@ -1783,7 +1825,7 @@ public:
private:
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
- virtual int do_apply_event(RELAY_LOG_INFO const *rli);
+ virtual int do_apply_event(Relay_log_info const *rli);
#endif
};
@@ -1807,7 +1849,8 @@ public:
#endif /* HAVE_REPLICATION */
#else
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
- void print(FILE* file, PRINT_EVENT_INFO* print_event_info, bool enable_local);
+ void print(FILE* file, PRINT_EVENT_INFO* print_event_info,
+ bool enable_local);
#endif
Delete_file_log_event(const char* buf, uint event_len,
@@ -1823,7 +1866,7 @@ public:
private:
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
- virtual int do_apply_event(RELAY_LOG_INFO const *rli);
+ virtual int do_apply_event(Relay_log_info const *rli);
#endif
};
@@ -1850,7 +1893,8 @@ public:
#endif
Execute_load_log_event(const char* buf, uint event_len,
- const Format_description_log_event* description_event);
+ const Format_description_log_event
+ *description_event);
~Execute_load_log_event() {}
Log_event_type get_type_code() { return EXEC_LOAD_EVENT;}
int get_data_size() { return EXEC_LOAD_HEADER_LEN ;}
@@ -1862,7 +1906,7 @@ public:
private:
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
- virtual int do_apply_event(RELAY_LOG_INFO const *rli);
+ virtual int do_apply_event(Relay_log_info const *rli);
#endif
};
@@ -1889,7 +1933,8 @@ public:
#endif /* HAVE_REPLICATION */
#endif
Begin_load_query_log_event(const char* buf, uint event_len,
- const Format_description_log_event* description_event);
+ const Format_description_log_event
+ *description_event);
~Begin_load_query_log_event() {}
Log_event_type get_type_code() { return BEGIN_LOAD_QUERY_EVENT; }
};
@@ -1941,7 +1986,8 @@ public:
const char *local_fname);
#endif
Execute_load_query_log_event(const char* buf, uint event_len,
- const Format_description_log_event *description_event);
+ const Format_description_log_event
+ *description_event);
~Execute_load_query_log_event() {}
Log_event_type get_type_code() { return EXECUTE_LOAD_QUERY_EVENT; }
@@ -1954,7 +2000,7 @@ public:
private:
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
- virtual int do_apply_event(RELAY_LOG_INFO const *rli);
+ virtual int do_apply_event(Relay_log_info const *rli);
#endif
};
@@ -1968,7 +2014,8 @@ public:
Log_event's ctor, this way we can extract maximum information from the
event's header (the unique ID for example).
*/
- Unknown_log_event(const char* buf, const Format_description_log_event* description_event):
+ Unknown_log_event(const char* buf,
+ const Format_description_log_event *description_event):
Log_event(buf, description_event)
{}
~Unknown_log_event() {}
@@ -2048,6 +2095,7 @@ public:
virtual int get_data_size() { return m_data_size; }
#ifndef MYSQL_CLIENT
+ virtual int save_field_metadata();
virtual bool write_data_header(IO_CACHE *file);
virtual bool write_data_body(IO_CACHE *file);
virtual const char *get_db() { return m_dbnam; }
@@ -2064,25 +2112,34 @@ public:
private:
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
- virtual int do_apply_event(RELAY_LOG_INFO const *rli);
- virtual int do_update_pos(RELAY_LOG_INFO *rli);
+ virtual int do_apply_event(Relay_log_info const *rli);
+ virtual int do_update_pos(Relay_log_info *rli);
+ virtual enum_skip_reason do_shall_skip(Relay_log_info *rli);
#endif
#ifndef MYSQL_CLIENT
- TABLE *m_table;
+ TABLE *m_table;
#endif
char const *m_dbnam;
- my_size_t m_dblen;
+ size_t m_dblen;
char const *m_tblnam;
- my_size_t m_tbllen;
+ size_t m_tbllen;
ulong m_colcnt;
- unsigned char *m_coltype;
+ uchar *m_coltype;
- gptr m_memory;
+ uchar *m_memory;
ulong m_table_id;
flag_set m_flags;
- my_size_t m_data_size;
+ size_t m_data_size;
+
+ uchar *m_field_metadata; // buffer for field metadata
+ /*
+ The size of field metadata buffer set by calling save_field_metadata()
+ */
+ ulong m_field_metadata_size;
+ uchar *m_null_bits;
+ uchar *m_meta_memory;
};
@@ -2133,7 +2190,13 @@ public:
NO_FOREIGN_KEY_CHECKS_F = (1U << 1),
/* Value of the OPTION_RELAXED_UNIQUE_CHECKS flag in thd->options */
- RELAXED_UNIQUE_CHECKS_F = (1U << 2)
+ RELAXED_UNIQUE_CHECKS_F = (1U << 2),
+
+ /**
+ Indicates that rows in this event are complete, that is contain
+ values for all columns of the table.
+ */
+ COMPLETE_ROWS_F = (1U << 3)
};
typedef uint16 flag_set;
@@ -2160,7 +2223,7 @@ public:
#endif
#ifndef MYSQL_CLIENT
- int add_row_data(byte *data, my_size_t length)
+ int add_row_data(uchar *data, size_t length)
{
return do_add_row_data(data,length);
}
@@ -2170,7 +2233,7 @@ public:
virtual int get_data_size();
MY_BITMAP const *get_cols() const { return &m_cols; }
- my_size_t get_width() const { return m_width; }
+ size_t get_width() const { return m_width; }
ulong get_table_id() const { return m_table_id; }
#ifndef MYSQL_CLIENT
@@ -2209,7 +2272,7 @@ protected:
#endif
#ifndef MYSQL_CLIENT
- virtual int do_add_row_data(byte *data, my_size_t length);
+ virtual int do_add_row_data(uchar *data, size_t length);
#endif
#ifndef MYSQL_CLIENT
@@ -2233,17 +2296,37 @@ protected:
uint32 m_bitbuf[128/(sizeof(uint32)*8)];
uint32 m_bitbuf_ai[128/(sizeof(uint32)*8)];
- byte *m_rows_buf; /* The rows in packed format */
- byte *m_rows_cur; /* One-after the end of the data */
- byte *m_rows_end; /* One-after the end of the allocated space */
+ uchar *m_rows_buf; /* The rows in packed format */
+ uchar *m_rows_cur; /* One-after the end of the data */
+ uchar *m_rows_end; /* One-after the end of the allocated space */
- flag_set m_flags; /* Flags for row-level events */
+ flag_set m_flags; /* Flags for row-level events */
+
+ /* helper functions */
+
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
+ const uchar *m_curr_row; /* Start of the row being processed */
+ const uchar *m_curr_row_end; /* One-after the end of the current row */
+ uchar *m_key; /* Buffer to keep key value during searches */
+
+ int find_row(const Relay_log_info *const);
+ int write_row(const Relay_log_info *const, const bool);
+
+ // Unpack the current row into m_table->record[0]
+ int unpack_current_row(const Relay_log_info *const rli)
+ {
+ DBUG_ASSERT(m_table);
+ return ::unpack_row(rli, m_table, m_width, m_curr_row, &m_cols,
+ &m_curr_row_end, &m_master_reclength);
+ }
+#endif
private:
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
- virtual int do_apply_event(RELAY_LOG_INFO const *rli);
- virtual int do_update_pos(RELAY_LOG_INFO *rli);
+ virtual int do_apply_event(Relay_log_info const *rli);
+ virtual int do_update_pos(Relay_log_info *rli);
+ virtual enum_skip_reason do_shall_skip(Relay_log_info *rli);
/*
Primitive to prepare for a sequence of row executions.
@@ -2261,7 +2344,8 @@ private:
The member function will return 0 if all went OK, or a non-zero
error code otherwise.
*/
- virtual int do_before_row_operations(TABLE *table) = 0;
+ virtual
+ int do_before_row_operations(const Slave_reporting_capability *const log) = 0;
/*
Primitive to clean up after a sequence of row executions.
@@ -2271,44 +2355,33 @@ private:
After doing a sequence of do_prepare_row() and do_exec_row(),
this member function should be called to clean up and release
any allocated buffers.
+
+ The error argument, if non-zero, indicates an error which happened during
+ row processing before this function was called. In this case, even if
+ function is successful, it should return the error code given in the argument.
*/
- virtual int do_after_row_operations(TABLE *table, int error) = 0;
-
- /*
- Primitive to prepare for handling one row in a row-level event.
-
- DESCRIPTION
-
- The member function prepares for execution of operations needed for one
- row in a row-level event by reading up data from the buffer containing
- the row. No specific interpretation of the data is normally done here,
- since SQL thread specific data is not available: that data is made
- available for the do_exec function.
-
- A pointer to the start of the next row, or NULL if the preparation
- failed. Currently, preparation cannot fail, but don't rely on this
- behavior.
-
- RETURN VALUE
- Error code, if something went wrong, 0 otherwise.
- */
- virtual int do_prepare_row(THD*, RELAY_LOG_INFO const*, TABLE*,
- char const *row_start, char const **row_end) = 0;
+ virtual
+ int do_after_row_operations(const Slave_reporting_capability *const log,
+ int error) = 0;
/*
Primitive to do the actual execution necessary for a row.
DESCRIPTION
The member function will do the actual execution needed to handle a row.
+ The row is located at m_curr_row. When the function returns,
+ m_curr_row_end should point at the next row (one byte after the end
+ of the current row).
RETURN VALUE
0 if execution succeeded, 1 if execution failed.
*/
- virtual int do_exec_row(TABLE *table) = 0;
+ virtual int do_exec_row(const Relay_log_info *const rli) = 0;
#endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */
-};
+ friend class Old_rows_log_event;
+};
/*****************************************************************************
@@ -2341,9 +2414,9 @@ public:
bool is_transactional,
MY_BITMAP *cols,
uint fields,
- const byte *before_record
+ const uchar *before_record
__attribute__((unused)),
- const byte *after_record)
+ const uchar *after_record)
{
return thd->binlog_write_row(table, is_transactional,
cols, fields, after_record);
@@ -2358,14 +2431,9 @@ private:
#endif
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
- gptr m_memory;
- byte *m_after_image;
-
- virtual int do_before_row_operations(TABLE *table);
- virtual int do_after_row_operations(TABLE *table, int error);
- virtual int do_prepare_row(THD*, RELAY_LOG_INFO const*, TABLE*,
- char const *row_start, char const **row_end);
- virtual int do_exec_row(TABLE *table);
+ virtual int do_before_row_operations(const Slave_reporting_capability *const);
+ virtual int do_after_row_operations(const Slave_reporting_capability *const,int);
+ virtual int do_exec_row(const Relay_log_info *const);
#endif
};
@@ -2416,8 +2484,8 @@ public:
bool is_transactional,
MY_BITMAP *cols,
uint fields,
- const byte *before_record,
- const byte *after_record)
+ const uchar *before_record,
+ const uchar *after_record)
{
return thd->binlog_update_row(table, is_transactional,
cols, fields, before_record, after_record);
@@ -2437,15 +2505,9 @@ protected:
#endif
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
- gptr m_memory;
- byte *m_key;
- byte *m_after_image;
-
- virtual int do_before_row_operations(TABLE *table);
- virtual int do_after_row_operations(TABLE *table, int error);
- virtual int do_prepare_row(THD*, RELAY_LOG_INFO const*, TABLE*,
- char const *row_start, char const **row_end);
- virtual int do_exec_row(TABLE *table);
+ virtual int do_before_row_operations(const Slave_reporting_capability *const);
+ virtual int do_after_row_operations(const Slave_reporting_capability *const,int);
+ virtual int do_exec_row(const Relay_log_info *const);
#endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */
};
@@ -2491,8 +2553,8 @@ public:
bool is_transactional,
MY_BITMAP *cols,
uint fields,
- const byte *before_record,
- const byte *after_record
+ const uchar *before_record,
+ const uchar *after_record
__attribute__((unused)))
{
return thd->binlog_delete_row(table, is_transactional,
@@ -2508,15 +2570,9 @@ protected:
#endif
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
- gptr m_memory;
- byte *m_key;
- byte *m_after_image;
-
- virtual int do_before_row_operations(TABLE *table);
- virtual int do_after_row_operations(TABLE *table, int error);
- virtual int do_prepare_row(THD*, RELAY_LOG_INFO const*, TABLE*,
- char const *row_start, char const **row_end);
- virtual int do_exec_row(TABLE *table);
+ virtual int do_before_row_operations(const Slave_reporting_capability *const);
+ virtual int do_after_row_operations(const Slave_reporting_capability *const,int);
+ virtual int do_exec_row(const Relay_log_info *const);
#endif
};
@@ -2535,7 +2591,7 @@ protected:
<caption>Incident event format</caption>
<tr>
<th>Symbol</th>
- <th>Size<br/>(bytes)</th>
+ <th>Size<br>(bytes)</th>
<th>Description</th>
</tr>
<tr>
@@ -2592,7 +2648,7 @@ public:
#endif
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
- virtual int do_apply_event(RELAY_LOG_INFO const *rli);
+ virtual int do_apply_event(Relay_log_info const *rli);
#endif
virtual bool write_data_header(IO_CACHE *file);
@@ -2620,4 +2676,8 @@ static inline bool copy_event_cache_to_file_and_reinit(IO_CACHE *cache,
reinit_io_cache(cache, WRITE_CACHE, 0, FALSE, TRUE);
}
+/**
+ @} (end of group Replication)
+*/
+
#endif /* _log_event_h */
diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc
index 5153dff0e55..949179386ea 100644
--- a/sql/log_event_old.cc
+++ b/sql/log_event_old.cc
@@ -1,21 +1,979 @@
#include "mysql_priv.h"
+#ifndef MYSQL_CLIENT
+#include "rpl_rli.h"
+#include "rpl_utility.h"
+#endif
#include "log_event_old.h"
#include "rpl_record_old.h"
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
+
+// Old implementation of do_apply_event()
+int
+Old_rows_log_event::do_apply_event(Rows_log_event *ev, const Relay_log_info *rli)
+{
+ DBUG_ENTER("Rows_log_event::do_apply_event(st_relay_log_info*)");
+ int error= 0;
+ THD *thd= ev->thd;
+ uchar const *row_start= ev->m_rows_buf;
+
+ /*
+ If m_table_id == ~0UL, then we have a dummy event that does not
+ contain any data. In that case, we just remove all tables in the
+ tables_to_lock list, close the thread tables, and return with
+ success.
+ */
+ if (ev->m_table_id == ~0UL)
+ {
+ /*
+ This one is supposed to be set: just an extra check so that
+ nothing strange has happened.
+ */
+ DBUG_ASSERT(ev->get_flags(Rows_log_event::STMT_END_F));
+
+ const_cast<Relay_log_info*>(rli)->clear_tables_to_lock();
+ close_thread_tables(thd);
+ thd->clear_error();
+ DBUG_RETURN(0);
+ }
+
+ /*
+ 'thd' has been set by exec_relay_log_event(), just before calling
+ do_apply_event(). We still check here to prevent future coding
+ errors.
+ */
+ DBUG_ASSERT(rli->sql_thd == thd);
+
+ /*
+ If there is no locks taken, this is the first binrow event seen
+ after the table map events. We should then lock all the tables
+ used in the transaction and proceed with execution of the actual
+ event.
+ */
+ if (!thd->lock)
+ {
+ bool need_reopen= 1; /* To execute the first lap of the loop below */
+
+ /*
+ lock_tables() reads the contents of thd->lex, so they must be
+ initialized. Contrary to in
+ Table_map_log_event::do_apply_event() we don't call
+ mysql_init_query() as that may reset the binlog format.
+ */
+ lex_start(thd);
+
+ while ((error= lock_tables(thd, rli->tables_to_lock,
+ rli->tables_to_lock_count, &need_reopen)))
+ {
+ if (!need_reopen)
+ {
+ if (thd->query_error || thd->is_fatal_error)
+ {
+ /*
+ Error reporting borrowed from Query_log_event with many excessive
+ simplifications (we don't honour --slave-skip-errors)
+ */
+ uint actual_error= thd->net.last_errno;
+ rli->report(ERROR_LEVEL, actual_error,
+ "Error '%s' in %s event: when locking tables",
+ (actual_error ? thd->net.last_error :
+ "unexpected success or fatal error"),
+ ev->get_type_str());
+ thd->is_fatal_error= 1;
+ }
+ else
+ {
+ rli->report(ERROR_LEVEL, error,
+ "Error in %s event: when locking tables",
+ ev->get_type_str());
+ }
+ const_cast<Relay_log_info*>(rli)->clear_tables_to_lock();
+ DBUG_RETURN(error);
+ }
+
+ /*
+ So we need to reopen the tables.
+
+ We need to flush the pending RBR event, since it keeps a
+ pointer to an open table.
+
+ ALTERNATIVE SOLUTION (not implemented): Extract a pointer to
+ the pending RBR event and reset the table pointer after the
+ tables has been reopened.
+
+ NOTE: For this new scheme there should be no pending event:
+ need to add code to assert that is the case.
+ */
+ thd->binlog_flush_pending_rows_event(false);
+ TABLE_LIST *tables= rli->tables_to_lock;
+ close_tables_for_reopen(thd, &tables);
+
+ uint tables_count= rli->tables_to_lock_count;
+ if ((error= open_tables(thd, &tables, &tables_count, 0)))
+ {
+ if (thd->query_error || thd->is_fatal_error)
+ {
+ /*
+ Error reporting borrowed from Query_log_event with many excessive
+ simplifications (we don't honour --slave-skip-errors)
+ */
+ uint actual_error= thd->net.last_errno;
+ rli->report(ERROR_LEVEL, actual_error,
+ "Error '%s' on reopening tables",
+ (actual_error ? thd->net.last_error :
+ "unexpected success or fatal error"));
+ thd->query_error= 1;
+ }
+ const_cast<Relay_log_info*>(rli)->clear_tables_to_lock();
+ DBUG_RETURN(error);
+ }
+ }
+
+ /*
+ When the open and locking succeeded, we check all tables to
+ ensure that they still have the correct type.
+
+ We can use a down cast here since we know that every table added
+ to the tables_to_lock is a RPL_TABLE_LIST.
+ */
+
+ {
+ RPL_TABLE_LIST *ptr= rli->tables_to_lock;
+ for ( ; ptr ; ptr= static_cast<RPL_TABLE_LIST*>(ptr->next_global))
+ {
+ if (ptr->m_tabledef.compatible_with(rli, ptr->table))
+ {
+ mysql_unlock_tables(thd, thd->lock);
+ thd->lock= 0;
+ thd->query_error= 1;
+ const_cast<Relay_log_info*>(rli)->clear_tables_to_lock();
+ DBUG_RETURN(Rows_log_event::ERR_BAD_TABLE_DEF);
+ }
+ }
+ }
+
+ /*
+ ... and then we add all the tables to the table map and remove
+ them from tables to lock.
+
+ We also invalidate the query cache for all the tables, since
+ they will now be changed.
+
+ TODO [/Matz]: Maybe the query cache should not be invalidated
+ here? It might be that a table is not changed, even though it
+ was locked for the statement. We do know that each
+ Rows_log_event contain at least one row, so after processing one
+ Rows_log_event, we can invalidate the query cache for the
+ associated table.
+ */
+ for (TABLE_LIST *ptr= rli->tables_to_lock ; ptr ; ptr= ptr->next_global)
+ {
+ const_cast<Relay_log_info*>(rli)->m_table_map.set_table(ptr->table_id, ptr->table);
+ }
+#ifdef HAVE_QUERY_CACHE
+ query_cache.invalidate_locked_for_write(rli->tables_to_lock);
+#endif
+ }
+
+ TABLE* table= const_cast<Relay_log_info*>(rli)->m_table_map.get_table(ev->m_table_id);
+
+ if (table)
+ {
+ /*
+ table == NULL means that this table should not be replicated
+ (this was set up by Table_map_log_event::do_apply_event()
+ which tested replicate-* rules).
+ */
+
+ /*
+ It's not needed to set_time() but
+ 1) it continues the property that "Time" in SHOW PROCESSLIST shows how
+ much slave is behind
+ 2) it will be needed when we allow replication from a table with no
+ TIMESTAMP column to a table with one.
+ So we call set_time(), like in SBR. Presently it changes nothing.
+ */
+ thd->set_time((time_t)ev->when);
+ /*
+ There are a few flags that are replicated with each row event.
+ Make sure to set/clear them before executing the main body of
+ the event.
+ */
+ if (ev->get_flags(Rows_log_event::NO_FOREIGN_KEY_CHECKS_F))
+ thd->options|= OPTION_NO_FOREIGN_KEY_CHECKS;
+ else
+ thd->options&= ~OPTION_NO_FOREIGN_KEY_CHECKS;
+
+ if (ev->get_flags(Rows_log_event::RELAXED_UNIQUE_CHECKS_F))
+ thd->options|= OPTION_RELAXED_UNIQUE_CHECKS;
+ else
+ thd->options&= ~OPTION_RELAXED_UNIQUE_CHECKS;
+ /* A small test to verify that objects have consistent types */
+ DBUG_ASSERT(sizeof(thd->options) == sizeof(OPTION_RELAXED_UNIQUE_CHECKS));
+
+ /*
+ Now we are in a statement and will stay in a statement until we
+ see a STMT_END_F.
+
+ We set this flag here, before actually applying any rows, in
+ case the SQL thread is stopped and we need to detect that we're
+ inside a statement and halting abruptly might cause problems
+ when restarting.
+ */
+ const_cast<Relay_log_info*>(rli)->set_flag(Relay_log_info::IN_STMT);
+
+ error= do_before_row_operations(table);
+ while (error == 0 && row_start < ev->m_rows_end)
+ {
+ uchar const *row_end= NULL;
+ if ((error= do_prepare_row(thd, rli, table, row_start, &row_end)))
+ break; // We should perform the after-row operation even in
+ // the case of error
+
+ DBUG_ASSERT(row_end != NULL); // cannot happen
+ DBUG_ASSERT(row_end <= ev->m_rows_end);
+
+ /* in_use can have been set to NULL in close_tables_for_reopen */
+ THD* old_thd= table->in_use;
+ if (!table->in_use)
+ table->in_use= thd;
+ error= do_exec_row(table);
+ table->in_use = old_thd;
+ switch (error)
+ {
+ /* Some recoverable errors */
+ case HA_ERR_RECORD_CHANGED:
+ case HA_ERR_KEY_NOT_FOUND: /* Idempotency support: OK if
+ tuple does not exist */
+ error= 0;
+ case 0:
+ break;
+
+ default:
+ rli->report(ERROR_LEVEL, thd->net.last_errno,
+ "Error in %s event: row application failed. %s",
+ ev->get_type_str(),
+ thd->net.last_error ? thd->net.last_error : "");
+ thd->query_error= 1;
+ break;
+ }
+
+ row_start= row_end;
+ }
+ DBUG_EXECUTE_IF("STOP_SLAVE_after_first_Rows_event",
+ const_cast<Relay_log_info*>(rli)->abort_slave= 1;);
+ error= do_after_row_operations(table, error);
+ if (!ev->cache_stmt)
+ {
+ DBUG_PRINT("info", ("Marked that we need to keep log"));
+ thd->options|= OPTION_KEEP_LOG;
+ }
+ }
+
+ /*
+ We need to delay this clear until the table def is no longer needed.
+ The table def is needed in unpack_row().
+ */
+ if (rli->tables_to_lock && ev->get_flags(Rows_log_event::STMT_END_F))
+ const_cast<Relay_log_info*>(rli)->clear_tables_to_lock();
+
+ if (error)
+ { /* error has occured during the transaction */
+ rli->report(ERROR_LEVEL, thd->net.last_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->net.last_error ? thd->net.last_error : "");
+
+ /*
+ If one day we honour --skip-slave-errors in row-based replication, and
+ the error should be skipped, then we would clear mappings, rollback,
+ close tables, but the slave SQL thread would not stop and then may
+ assume the mapping is still available, the tables are still open...
+ So then we should clear mappings/rollback/close here only if this is a
+ STMT_END_F.
+ For now we code, knowing that error is not skippable and so slave SQL
+ thread is certainly going to stop.
+ rollback at the caller along with sbr.
+ */
+ thd->reset_current_stmt_binlog_row_based();
+ const_cast<Relay_log_info*>(rli)->cleanup_context(thd, error);
+ thd->query_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.
+ */
+ if (table && (table->s->primary_key == MAX_KEY) &&
+ !ev->cache_stmt &&
+ ev->get_flags(Rows_log_event::STMT_END_F) == 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 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
+
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
+
+/*
+ Check if there are more UNIQUE keys after the given key.
+*/
+static int
+last_uniq_key(TABLE *table, uint keyno)
+{
+ while (++keyno < table->s->keys)
+ if (table->key_info[keyno].flags & HA_NOSAME)
+ return 0;
+ return 1;
+}
+
+/*
+ Compares table->record[0] and table->record[1]
+
+ Returns TRUE if different.
+*/
+static bool record_compare(TABLE *table)
+{
+ /*
+ Need to set the X bit and the filler bits in both records since
+ there are engines that do not set it correctly.
+
+ In addition, since MyISAM checks that one hasn't tampered with the
+ record, it is necessary to restore the old bytes into the record
+ after doing the comparison.
+
+ TODO[record format ndb]: Remove it once NDB returns correct
+ records. Check that the other engines also return correct records.
+ */
+
+ bool result= FALSE;
+ uchar saved_x[2], saved_filler[2];
+
+ if (table->s->null_bytes > 0)
+ {
+ for (int i = 0 ; i < 2 ; ++i)
+ {
+ saved_x[i]= table->record[i][0];
+ saved_filler[i]= table->record[i][table->s->null_bytes - 1];
+ table->record[i][0]|= 1U;
+ table->record[i][table->s->null_bytes - 1]|=
+ 256U - (1U << table->s->last_null_bit_pos);
+ }
+ }
+
+ if (table->s->blob_fields + table->s->varchar_fields == 0)
+ {
+ result= cmp_record(table,record[1]);
+ goto record_compare_exit;
+ }
+
+ /* Compare null bits */
+ if (memcmp(table->null_flags,
+ table->null_flags+table->s->rec_buff_length,
+ table->s->null_bytes))
+ {
+ result= TRUE; // Diff in NULL value
+ goto record_compare_exit;
+ }
+
+ /* Compare updated fields */
+ for (Field **ptr=table->field ; *ptr ; ptr++)
+ {
+ if ((*ptr)->cmp_binary_offset(table->s->rec_buff_length))
+ {
+ result= TRUE;
+ goto record_compare_exit;
+ }
+ }
+
+record_compare_exit:
+ /*
+ Restore the saved bytes.
+
+ TODO[record format ndb]: Remove this code once NDB returns the
+ correct record format.
+ */
+ if (table->s->null_bytes > 0)
+ {
+ for (int i = 0 ; i < 2 ; ++i)
+ {
+ table->record[i][0]= saved_x[i];
+ table->record[i][table->s->null_bytes - 1]= saved_filler[i];
+ }
+ }
+
+ return result;
+}
+
+/*
+ Copy "extra" columns from record[1] to record[0].
+
+ Copy the extra fields that are not present on the master but are
+ present on the slave from record[1] to record[0]. This is used
+ after fetching a record that are to be updated, either inside
+ replace_record() or as part of executing an update_row().
+ */
+static int
+copy_extra_record_fields(TABLE *table,
+ size_t master_reclength,
+ my_ptrdiff_t master_fields)
+{
+ DBUG_ENTER("copy_extra_record_fields(table, master_reclen, master_fields)");
+ DBUG_PRINT("info", ("Copying to 0x%lx "
+ "from field %lu at offset %lu "
+ "to field %d at offset %lu",
+ (long) table->record[0],
+ (ulong) master_fields, (ulong) master_reclength,
+ table->s->fields, table->s->reclength));
+ /*
+ Copying the extra fields of the slave that does not exist on
+ master into record[0] (which are basically the default values).
+ */
+
+ if (table->s->fields < (uint) master_fields)
+ DBUG_RETURN(0);
+
+ DBUG_ASSERT(master_reclength <= table->s->reclength);
+ if (master_reclength < table->s->reclength)
+ bmove_align(table->record[0] + master_reclength,
+ table->record[1] + master_reclength,
+ table->s->reclength - master_reclength);
+
+ /*
+ Bit columns are special. We iterate over all the remaining
+ columns and copy the "extra" bits to the new record. This is
+ not a very good solution: it should be refactored on
+ opportunity.
+
+ REFACTORING SUGGESTION (Matz). Introduce a member function
+ similar to move_field_offset() called copy_field_offset() to
+ copy field values and implement it for all Field subclasses. Use
+ this function to copy data from the found record to the record
+ that are going to be inserted.
+
+ The copy_field_offset() function need to be a virtual function,
+ which in this case will prevent copying an entire range of
+ fields efficiently.
+ */
+ {
+ Field **field_ptr= table->field + master_fields;
+ for ( ; *field_ptr ; ++field_ptr)
+ {
+ /*
+ Set the null bit according to the values in record[1]
+ */
+ if ((*field_ptr)->maybe_null() &&
+ (*field_ptr)->is_null_in_record(reinterpret_cast<uchar*>(table->record[1])))
+ (*field_ptr)->set_null();
+ else
+ (*field_ptr)->set_notnull();
+
+ /*
+ Do the extra work for special columns.
+ */
+ switch ((*field_ptr)->real_type())
+ {
+ default:
+ /* Nothing to do */
+ break;
+
+ case MYSQL_TYPE_BIT:
+ Field_bit *f= static_cast<Field_bit*>(*field_ptr);
+ if (f->bit_len > 0)
+ {
+ my_ptrdiff_t const offset= table->record[1] - table->record[0];
+ uchar const bits=
+ get_rec_bits(f->bit_ptr + offset, f->bit_ofs, f->bit_len);
+ set_rec_bits(bits, f->bit_ptr, f->bit_ofs, f->bit_len);
+ }
+ break;
+ }
+ }
+ }
+ DBUG_RETURN(0); // All OK
+}
+
+/*
+ Replace the provided record in the database.
+
+ SYNOPSIS
+ replace_record()
+ thd Thread context for writing the record.
+ table Table to which record should be written.
+ master_reclength
+ Offset to first column that is not present on the master,
+ alternatively the length of the record on the master
+ side.
+
+ RETURN VALUE
+ Error code on failure, 0 on success.
+
+ DESCRIPTION
+ Similar to how it is done in mysql_insert(), we first try to do
+ a ha_write_row() and of that fails due to duplicated keys (or
+ indices), we do an ha_update_row() or a ha_delete_row() instead.
+ */
+static int
+replace_record(THD *thd, TABLE *table,
+ ulong const master_reclength,
+ uint const master_fields)
+{
+ DBUG_ENTER("replace_record");
+ DBUG_ASSERT(table != NULL && thd != NULL);
+
+ int error;
+ int keynum;
+ auto_afree_ptr<char> key(NULL);
+
+#ifndef DBUG_OFF
+ DBUG_DUMP("record[0]", table->record[0], table->s->reclength);
+ DBUG_PRINT_BITSET("debug", "write_set = %s", table->write_set);
+ DBUG_PRINT_BITSET("debug", "read_set = %s", table->read_set);
+#endif
+
+ while ((error= table->file->ha_write_row(table->record[0])))
+ {
+ if (error == HA_ERR_LOCK_DEADLOCK || error == HA_ERR_LOCK_WAIT_TIMEOUT)
+ {
+ table->file->print_error(error, MYF(0)); /* to check at exec_relay_log_event */
+ DBUG_RETURN(error);
+ }
+ if ((keynum= table->file->get_dup_key(error)) < 0)
+ {
+ table->file->print_error(error, MYF(0));
+ /*
+ We failed to retrieve the duplicate key
+ - either because the error was not "duplicate key" error
+ - or because the information which key is not available
+ */
+ DBUG_RETURN(error);
+ }
+
+ /*
+ We need to retrieve the old row into record[1] to be able to
+ either update or delete the offending record. We either:
+
+ - use rnd_pos() with a row-id (available as dupp_row) to the
+ offending row, if that is possible (MyISAM and Blackhole), or else
+
+ - use index_read_idx() with the key that is duplicated, to
+ retrieve the offending row.
+ */
+ if (table->file->ha_table_flags() & HA_DUPLICATE_POS)
+ {
+ error= table->file->rnd_pos(table->record[1], table->file->dup_ref);
+ if (error)
+ {
+ table->file->print_error(error, MYF(0));
+ DBUG_RETURN(error);
+ }
+ }
+ else
+ {
+ if (table->file->extra(HA_EXTRA_FLUSH_CACHE))
+ {
+ DBUG_RETURN(my_errno);
+ }
+
+ if (key.get() == NULL)
+ {
+ key.assign(static_cast<char*>(my_alloca(table->s->max_unique_length)));
+ if (key.get() == NULL)
+ DBUG_RETURN(ENOMEM);
+ }
+
+ key_copy((uchar*)key.get(), table->record[0], table->key_info + keynum,
+ 0);
+ error= table->file->index_read_idx_map(table->record[1], keynum,
+ (const uchar*)key.get(),
+ HA_WHOLE_KEY,
+ HA_READ_KEY_EXACT);
+ if (error)
+ {
+ table->file->print_error(error, MYF(0));
+ DBUG_RETURN(error);
+ }
+ }
+
+ /*
+ Now, table->record[1] should contain the offending row. That
+ will enable us to update it or, alternatively, delete it (so
+ that we can insert the new row afterwards).
+
+ First we copy the columns into table->record[0] that are not
+ present on the master from table->record[1], if there are any.
+ */
+ copy_extra_record_fields(table, master_reclength, master_fields);
+
+ /*
+ REPLACE is defined as either INSERT or DELETE + INSERT. If
+ possible, we can replace it with an UPDATE, but that will not
+ work on InnoDB if FOREIGN KEY checks are necessary.
+
+ I (Matz) am not sure of the reason for the last_uniq_key()
+ check as, but I'm guessing that it's something along the
+ following lines.
+
+ Suppose that we got the duplicate key to be a key that is not
+ the last unique key for the table and we perform an update:
+ then there might be another key for which the unique check will
+ fail, so we're better off just deleting the row and inserting
+ the correct row.
+ */
+ if (last_uniq_key(table, keynum) &&
+ !table->file->referenced_by_foreign_key())
+ {
+ error=table->file->ha_update_row(table->record[1],
+ table->record[0]);
+ if (error && error != HA_ERR_RECORD_IS_THE_SAME)
+ table->file->print_error(error, MYF(0));
+ else
+ error= 0;
+ DBUG_RETURN(error);
+ }
+ else
+ {
+ if ((error= table->file->ha_delete_row(table->record[1])))
+ {
+ table->file->print_error(error, MYF(0));
+ DBUG_RETURN(error);
+ }
+ /* Will retry ha_write_row() with the offending row removed. */
+ }
+ }
+
+ DBUG_RETURN(error);
+}
+
+/**
+ Find the row given by 'key', if the table has keys, or else use a table scan
+ to find (and fetch) the row.
+
+ If the engine allows random access of the records, a combination of
+ position() and rnd_pos() will be used.
+
+ @param table Pointer to table to search
+ @param key Pointer to key to use for search, if table has key
+
+ @pre <code>table->record[0]</code> shall contain the row to locate
+ and <code>key</code> shall contain a key to use for searching, if
+ the engine has a key.
+
+ @post If the return value is zero, <code>table->record[1]</code>
+ will contain the fetched row and the internal "cursor" will refer to
+ the row. If the return value is non-zero,
+ <code>table->record[1]</code> is undefined. In either case,
+ <code>table->record[0]</code> is undefined.
+
+ @return Zero if the row was successfully fetched into
+ <code>table->record[1]</code>, error code otherwise.
+ */
+
+static int find_and_fetch_row(TABLE *table, uchar *key)
+{
+ DBUG_ENTER("find_and_fetch_row(TABLE *table, uchar *key, uchar *record)");
+ DBUG_PRINT("enter", ("table: 0x%lx, key: 0x%lx record: 0x%lx",
+ (long) table, (long) key, (long) table->record[1]));
+
+ DBUG_ASSERT(table->in_use != NULL);
+
+ DBUG_DUMP("record[0]", table->record[0], table->s->reclength);
+
+ if ((table->file->ha_table_flags() & HA_PRIMARY_KEY_REQUIRED_FOR_POSITION) &&
+ table->s->primary_key < MAX_KEY)
+ {
+ /*
+ Use a more efficient method to fetch the record given by
+ table->record[0] if the engine allows it. We first compute a
+ row reference using the position() member function (it will be
+ stored in table->file->ref) and the use rnd_pos() to position
+ the "cursor" (i.e., record[0] in this case) at the correct row.
+
+ TODO: Add a check that the correct record has been fetched by
+ comparing with the original record. Take into account that the
+ record on the master and slave can be of different
+ length. Something along these lines should work:
+
+ ADD>>> store_record(table,record[1]);
+ int error= table->file->rnd_pos(table->record[0], table->file->ref);
+ ADD>>> DBUG_ASSERT(memcmp(table->record[1], table->record[0],
+ table->s->reclength) == 0);
+
+ */
+ table->file->position(table->record[0]);
+ int error= table->file->rnd_pos(table->record[0], table->file->ref);
+ /*
+ rnd_pos() returns the record in table->record[0], so we have to
+ move it to table->record[1].
+ */
+ bmove_align(table->record[1], table->record[0], table->s->reclength);
+ DBUG_RETURN(error);
+ }
+
+ /* We need to retrieve all fields */
+ /* TODO: Move this out from this function to main loop */
+ table->use_all_columns();
+
+ if (table->s->keys > 0)
+ {
+ int error;
+ /* We have a key: search the table using the index */
+ if (!table->file->inited && (error= table->file->ha_index_init(0, FALSE)))
+ DBUG_RETURN(error);
+
+ /*
+ Don't print debug messages when running valgrind since they can
+ trigger false warnings.
+ */
+#ifndef HAVE_purify
+ DBUG_DUMP("table->record[0]", table->record[0], table->s->reclength);
+ DBUG_DUMP("table->record[1]", table->record[1], table->s->reclength);
+#endif
+
+ /*
+ We need to set the null bytes to ensure that the filler bit are
+ all set when returning. There are storage engines that just set
+ the necessary bits on the bytes and don't set the filler bits
+ correctly.
+ */
+ my_ptrdiff_t const pos=
+ table->s->null_bytes > 0 ? table->s->null_bytes - 1 : 0;
+ table->record[1][pos]= 0xFF;
+ if ((error= table->file->index_read_map(table->record[1], key, HA_WHOLE_KEY,
+ HA_READ_KEY_EXACT)))
+ {
+ table->file->print_error(error, MYF(0));
+ table->file->ha_index_end();
+ DBUG_RETURN(error);
+ }
+
+ /*
+ Don't print debug messages when running valgrind since they can
+ trigger false warnings.
+ */
+#ifndef HAVE_purify
+ DBUG_DUMP("table->record[0]", table->record[0], table->s->reclength);
+ DBUG_DUMP("table->record[1]", table->record[1], table->s->reclength);
+#endif
+ /*
+ Below is a minor "optimization". If the key (i.e., key number
+ 0) has the HA_NOSAME flag set, we know that we have found the
+ correct record (since there can be no duplicates); otherwise, we
+ have to compare the record with the one found to see if it is
+ the correct one.
+
+ CAVEAT! This behaviour is essential for the replication of,
+ e.g., the mysql.proc table since the correct record *shall* be
+ found using the primary key *only*. There shall be no
+ comparison of non-PK columns to decide if the correct record is
+ found. I can see no scenario where it would be incorrect to
+ chose the row to change only using a PK or an UNNI.
+ */
+ if (table->key_info->flags & HA_NOSAME)
+ {
+ table->file->ha_index_end();
+ DBUG_RETURN(0);
+ }
+
+ while (record_compare(table))
+ {
+ int error;
+
+ /*
+ We need to set the null bytes to ensure that the filler bit
+ are all set when returning. There are storage engines that
+ just set the necessary bits on the bytes and don't set the
+ filler bits correctly.
+
+ TODO[record format ndb]: Remove this code once NDB returns the
+ correct record format.
+ */
+ if (table->s->null_bytes > 0)
+ {
+ table->record[1][table->s->null_bytes - 1]|=
+ 256U - (1U << table->s->last_null_bit_pos);
+ }
+
+ if ((error= table->file->index_next(table->record[1])))
+ {
+ table->file->print_error(error, MYF(0));
+ table->file->ha_index_end();
+ DBUG_RETURN(error);
+ }
+ }
+
+ /*
+ Have to restart the scan to be able to fetch the next row.
+ */
+ table->file->ha_index_end();
+ }
+ else
+ {
+ int restart_count= 0; // Number of times scanning has restarted from top
+ int error;
+
+ /* We don't have a key: search the table using rnd_next() */
+ if ((error= table->file->ha_rnd_init(1)))
+ return error;
+
+ /* Continue until we find the right record or have made a full loop */
+ do
+ {
+ error= table->file->rnd_next(table->record[1]);
+
+ DBUG_DUMP("record[0]", table->record[0], table->s->reclength);
+ DBUG_DUMP("record[1]", table->record[1], table->s->reclength);
+
+ switch (error) {
+ case 0:
+ case HA_ERR_RECORD_DELETED:
+ break;
+
+ case HA_ERR_END_OF_FILE:
+ if (++restart_count < 2)
+ table->file->ha_rnd_init(1);
+ break;
+
+ default:
+ table->file->print_error(error, MYF(0));
+ DBUG_PRINT("info", ("Record not found"));
+ table->file->ha_rnd_end();
+ DBUG_RETURN(error);
+ }
+ }
+ while (restart_count < 2 && record_compare(table));
+
+ /*
+ Have to restart the scan to be able to fetch the next row.
+ */
+ DBUG_PRINT("info", ("Record %sfound", restart_count == 2 ? "not " : ""));
+ table->file->ha_rnd_end();
+
+ DBUG_ASSERT(error == HA_ERR_END_OF_FILE || error == 0);
+ DBUG_RETURN(error);
+ }
+
+ DBUG_RETURN(0);
+}
+
+/**********************************************************
+ Row handling primitives for Write_rows_log_event_old
+ **********************************************************/
+
+int Write_rows_log_event_old::do_before_row_operations(TABLE *table)
+{
+ int error= 0;
+
+ /*
+ We are using REPLACE semantics and not INSERT IGNORE semantics
+ when writing rows, that is: new rows replace old rows. We need to
+ inform the storage engine that it should use this behaviour.
+ */
+
+ /* Tell the storage engine that we are using REPLACE semantics. */
+ thd->lex->duplicates= DUP_REPLACE;
+
+ /*
+ Pretend we're executing a REPLACE command: this is needed for
+ InnoDB and NDB Cluster since they are not (properly) checking the
+ lex->duplicates flag.
+ */
+ thd->lex->sql_command= SQLCOM_REPLACE;
+ /*
+ Do not raise the error flag in case of hitting to an unique attribute
+ */
+ table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
+ /*
+ NDB specific: update from ndb master wrapped as Write_rows
+ */
+ /*
+ so that the event should be applied to replace slave's row
+ */
+ table->file->extra(HA_EXTRA_WRITE_CAN_REPLACE);
+ /*
+ NDB specific: if update from ndb master wrapped as Write_rows
+ does not find the row it's assumed idempotent binlog applying
+ is taking place; don't raise the error.
+ */
+ table->file->extra(HA_EXTRA_IGNORE_NO_KEY);
+ /*
+ TODO: the cluster team (Tomas?) says that it's better if the engine knows
+ how many rows are going to be inserted, then it can allocate needed memory
+ from the start.
+ */
+ table->file->ha_start_bulk_insert(0);
+ /*
+ We need TIMESTAMP_NO_AUTO_SET otherwise ha_write_row() will not use fill
+ any TIMESTAMP column with data from the row but instead will use
+ the event's current time.
+ As we replicate from TIMESTAMP to TIMESTAMP and slave has no extra
+ columns, we know that all TIMESTAMP columns on slave will receive explicit
+ data from the row, so TIMESTAMP_NO_AUTO_SET is ok.
+ When we allow a table without TIMESTAMP to be replicated to a table having
+ more columns including a TIMESTAMP column, or when we allow a TIMESTAMP
+ column to be replicated into a BIGINT column and the slave's table has a
+ TIMESTAMP column, then the slave's TIMESTAMP column will take its value
+ from set_time() which we called earlier (consistent with SBR). And then in
+ some cases we won't want TIMESTAMP_NO_AUTO_SET (will require some code to
+ analyze if explicit data is provided for slave's TIMESTAMP columns).
+ */
+ table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
+ return error;
+}
+
+int Write_rows_log_event_old::do_after_row_operations(TABLE *table, int error)
+{
+ int local_error= 0;
+ table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
+ table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE);
+ /*
+ reseting the extra with
+ table->file->extra(HA_EXTRA_NO_IGNORE_NO_KEY);
+ fires bug#27077
+ todo: explain or fix
+ */
+ if ((local_error= table->file->ha_end_bulk_insert()))
+ {
+ table->file->print_error(local_error, MYF(0));
+ }
+ return error? error : local_error;
+}
+
int
-Write_rows_log_event_old::do_prepare_row(THD *thd,
- RELAY_LOG_INFO const *rli,
+Write_rows_log_event_old::do_prepare_row(THD *thd_arg,
+ Relay_log_info const *rli,
TABLE *table,
- char const *row_start,
- char const **row_end)
+ uchar const *row_start,
+ uchar const **row_end)
{
DBUG_ASSERT(table != NULL);
DBUG_ASSERT(row_start && row_end);
int error;
- error= unpack_row_old(const_cast<RELAY_LOG_INFO*>(rli),
+ error= unpack_row_old(const_cast<Relay_log_info*>(rli),
table, m_width, table->record[0],
row_start, &m_cols, row_end, &m_master_reclength,
table->write_set, PRE_GA_WRITE_ROWS_EVENT);
@@ -23,13 +981,72 @@ Write_rows_log_event_old::do_prepare_row(THD *thd,
return error;
}
+int Write_rows_log_event_old::do_exec_row(TABLE *table)
+{
+ DBUG_ASSERT(table != NULL);
+ int error= replace_record(thd, table, m_master_reclength, m_width);
+ return error;
+}
+
+/**********************************************************
+ Row handling primitives for Delete_rows_log_event_old
+ **********************************************************/
+
+int Delete_rows_log_event_old::do_before_row_operations(TABLE *table)
+{
+ DBUG_ASSERT(m_memory == NULL);
+
+ if ((table->file->ha_table_flags() & HA_PRIMARY_KEY_REQUIRED_FOR_POSITION) &&
+ table->s->primary_key < MAX_KEY)
+ {
+ /*
+ We don't need to allocate any memory for m_after_image and
+ m_key since they are not used.
+ */
+ return 0;
+ }
+
+ int error= 0;
+
+ if (table->s->keys > 0)
+ {
+ m_memory= (uchar*) my_multi_malloc(MYF(MY_WME),
+ &m_after_image,
+ (uint) table->s->reclength,
+ &m_key,
+ (uint) table->key_info->key_length,
+ NullS);
+ }
+ else
+ {
+ m_after_image= (uchar*) my_malloc(table->s->reclength, MYF(MY_WME));
+ m_memory= (uchar*)m_after_image;
+ m_key= NULL;
+ }
+ if (!m_memory)
+ return HA_ERR_OUT_OF_MEM;
+
+ return error;
+}
+
+int Delete_rows_log_event_old::do_after_row_operations(TABLE *table, int error)
+{
+ /*error= ToDo:find out what this should really be, this triggers close_scan in nbd, returning error?*/
+ table->file->ha_index_or_rnd_end();
+ my_free(m_memory, MYF(MY_ALLOW_ZERO_PTR)); // Free for multi_malloc
+ m_memory= NULL;
+ m_after_image= NULL;
+ m_key= NULL;
+
+ return error;
+}
int
-Delete_rows_log_event_old::do_prepare_row(THD *thd,
- RELAY_LOG_INFO const *rli,
+Delete_rows_log_event_old::do_prepare_row(THD *thd_arg,
+ Relay_log_info const *rli,
TABLE *table,
- char const *row_start,
- char const **row_end)
+ uchar const *row_start,
+ uchar const **row_end)
{
int error;
DBUG_ASSERT(row_start && row_end);
@@ -39,7 +1056,7 @@ Delete_rows_log_event_old::do_prepare_row(THD *thd,
*/
DBUG_ASSERT(table->s->fields >= m_width);
- error= unpack_row_old(const_cast<RELAY_LOG_INFO*>(rli),
+ error= unpack_row_old(const_cast<Relay_log_info*>(rli),
table, m_width, table->record[0],
row_start, &m_cols, row_end, &m_master_reclength,
table->read_set, PRE_GA_DELETE_ROWS_EVENT);
@@ -57,12 +1074,73 @@ Delete_rows_log_event_old::do_prepare_row(THD *thd,
return error;
}
+int Delete_rows_log_event_old::do_exec_row(TABLE *table)
+{
+ int error;
+ DBUG_ASSERT(table != NULL);
+
+ if (!(error= ::find_and_fetch_row(table, m_key)))
+ {
+ /*
+ Now we should have the right row to delete. We are using
+ record[0] since it is guaranteed to point to a record with the
+ correct value.
+ */
+ error= table->file->ha_delete_row(table->record[0]);
+ }
+ return error;
+}
+
+/**********************************************************
+ Row handling primitives for Update_rows_log_event_old
+ **********************************************************/
+
+int Update_rows_log_event_old::do_before_row_operations(TABLE *table)
+{
+ DBUG_ASSERT(m_memory == NULL);
+
+ int error= 0;
+
+ if (table->s->keys > 0)
+ {
+ m_memory= (uchar*) my_multi_malloc(MYF(MY_WME),
+ &m_after_image,
+ (uint) table->s->reclength,
+ &m_key,
+ (uint) table->key_info->key_length,
+ NullS);
+ }
+ else
+ {
+ m_after_image= (uchar*) my_malloc(table->s->reclength, MYF(MY_WME));
+ m_memory= m_after_image;
+ m_key= NULL;
+ }
+ if (!m_memory)
+ return HA_ERR_OUT_OF_MEM;
+
+ table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
+
+ return error;
+}
+
+int Update_rows_log_event_old::do_after_row_operations(TABLE *table, int error)
+{
+ /*error= ToDo:find out what this should really be, this triggers close_scan in nbd, returning error?*/
+ table->file->ha_index_or_rnd_end();
+ my_free(m_memory, MYF(MY_ALLOW_ZERO_PTR));
+ m_memory= NULL;
+ m_after_image= NULL;
+ m_key= NULL;
+
+ return error;
+}
-int Update_rows_log_event_old::do_prepare_row(THD *thd,
- RELAY_LOG_INFO const *rli,
+int Update_rows_log_event_old::do_prepare_row(THD *thd_arg,
+ Relay_log_info const *rli,
TABLE *table,
- char const *row_start,
- char const **row_end)
+ uchar const *row_start,
+ uchar const **row_end)
{
int error;
DBUG_ASSERT(row_start && row_end);
@@ -73,20 +1151,19 @@ int Update_rows_log_event_old::do_prepare_row(THD *thd,
DBUG_ASSERT(table->s->fields >= m_width);
/* record[0] is the before image for the update */
- error= unpack_row_old(const_cast<RELAY_LOG_INFO*>(rli),
+ error= unpack_row_old(const_cast<Relay_log_info*>(rli),
table, m_width, table->record[0],
row_start, &m_cols, row_end, &m_master_reclength,
table->read_set, PRE_GA_UPDATE_ROWS_EVENT);
row_start = *row_end;
/* m_after_image is the after image for the update */
- error= unpack_row_old(const_cast<RELAY_LOG_INFO*>(rli),
+ error= unpack_row_old(const_cast<Relay_log_info*>(rli),
table, m_width, m_after_image,
row_start, &m_cols, row_end, &m_master_reclength,
table->write_set, PRE_GA_UPDATE_ROWS_EVENT);
- DBUG_DUMP("record[0]", (const char*) table->record[0], table->s->reclength);
- DBUG_DUMP("m_after_image", (const char *) m_after_image, table->s->reclength);
-
+ DBUG_DUMP("record[0]", table->record[0], table->s->reclength);
+ DBUG_DUMP("m_after_image", m_after_image, table->s->reclength);
/*
If we will access rows using the random access method, m_key will
@@ -102,4 +1179,41 @@ int Update_rows_log_event_old::do_prepare_row(THD *thd,
return error;
}
+int Update_rows_log_event_old::do_exec_row(TABLE *table)
+{
+ DBUG_ASSERT(table != NULL);
+
+ int error= ::find_and_fetch_row(table, m_key);
+ if (error)
+ return error;
+
+ /*
+ We have to ensure that the new record (i.e., the after image) is
+ in record[0] and the old record (i.e., the before image) is in
+ record[1]. This since some storage engines require this (for
+ example, the partition engine).
+
+ Since find_and_fetch_row() puts the fetched record (i.e., the old
+ record) in record[1], we can keep it there. We put the new record
+ (i.e., the after image) into record[0], and copy the fields that
+ are on the slave (i.e., in record[1]) into record[0], effectively
+ overwriting the default values that where put there by the
+ unpack_row() function.
+ */
+ bmove_align(table->record[0], m_after_image, table->s->reclength);
+ copy_extra_record_fields(table, m_master_reclength, m_width);
+
+ /*
+ Now we have the right row to update. The old row (the one we're
+ looking for) is in record[1] and the new row has is in record[0].
+ We also have copied the original values already in the slave's
+ database into the after image delivered from the master.
+ */
+ error= table->file->ha_update_row(table->record[1], table->record[0]);
+ if (error == HA_ERR_RECORD_IS_THE_SAME)
+ error= 0;
+
+ return error;
+}
+
#endif
diff --git a/sql/log_event_old.h b/sql/log_event_old.h
index 87b11aea3a3..81e55097905 100644
--- a/sql/log_event_old.h
+++ b/sql/log_event_old.h
@@ -20,9 +20,90 @@
Need to include this file at the proper position of log_event.h
*/
+
+class Old_rows_log_event
+{
+ public:
+
+ virtual ~Old_rows_log_event() {}
+
+ protected:
+
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
+
+ int do_apply_event(Rows_log_event*,const Relay_log_info*);
+
+ /*
+ Primitive to prepare for a sequence of row executions.
+
+ DESCRIPTION
+
+ Before doing a sequence of do_prepare_row() and do_exec_row()
+ calls, this member function should be called to prepare for the
+ entire sequence. Typically, this member function will allocate
+ space for any buffers that are needed for the two member
+ functions mentioned above.
+
+ RETURN VALUE
+
+ The member function will return 0 if all went OK, or a non-zero
+ error code otherwise.
+ */
+ virtual int do_before_row_operations(TABLE *table) = 0;
+
+ /*
+ Primitive to clean up after a sequence of row executions.
+
+ DESCRIPTION
+
+ After doing a sequence of do_prepare_row() and do_exec_row(),
+ this member function should be called to clean up and release
+ any allocated buffers.
+ */
+ virtual int do_after_row_operations(TABLE *table, int error) = 0;
+
+ /*
+ Primitive to prepare for handling one row in a row-level event.
+
+ DESCRIPTION
+
+ The member function prepares for execution of operations needed for one
+ row in a row-level event by reading up data from the buffer containing
+ the row. No specific interpretation of the data is normally done here,
+ since SQL thread specific data is not available: that data is made
+ available for the do_exec function.
-class Write_rows_log_event_old : public Write_rows_log_event
+ A pointer to the start of the next row, or NULL if the preparation
+ failed. Currently, preparation cannot fail, but don't rely on this
+ behavior.
+
+ RETURN VALUE
+ Error code, if something went wrong, 0 otherwise.
+ */
+ virtual int do_prepare_row(THD*, Relay_log_info const*, TABLE*,
+ uchar const *row_start,
+ uchar const **row_end) = 0;
+
+ /*
+ Primitive to do the actual execution necessary for a row.
+
+ DESCRIPTION
+ The member function will do the actual execution needed to handle a row.
+
+ RETURN VALUE
+ 0 if execution succeeded, 1 if execution failed.
+
+ */
+ virtual int do_exec_row(TABLE *table) = 0;
+
+#endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */
+};
+
+
+class Write_rows_log_event_old
+ : public Write_rows_log_event, public Old_rows_log_event
{
+
public:
enum
{
@@ -49,14 +130,26 @@ private:
virtual Log_event_type get_type_code() { return (Log_event_type)TYPE_CODE; }
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
- virtual int do_prepare_row(THD*, RELAY_LOG_INFO const*, TABLE*,
- char const *row_start, char const **row_end);
+ // use old definition of do_apply_event()
+ virtual int do_apply_event(const Relay_log_info *rli)
+ { return Old_rows_log_event::do_apply_event(this,rli); }
+
+ // primitives for old version of do_apply_event()
+ virtual int do_before_row_operations(TABLE *table);
+ virtual int do_after_row_operations(TABLE *table, int error);
+ virtual int do_prepare_row(THD*, Relay_log_info const*, TABLE*,
+ uchar const *row_start, uchar const **row_end);
+ virtual int do_exec_row(TABLE *table);
+
#endif
};
-class Update_rows_log_event_old : public Update_rows_log_event
+class Update_rows_log_event_old
+ : public Update_rows_log_event, public Old_rows_log_event
{
+ uchar *m_after_image, *m_memory;
+
public:
enum
{
@@ -67,14 +160,16 @@ public:
#if !defined(MYSQL_CLIENT)
Update_rows_log_event_old(THD *thd, TABLE *table, ulong table_id,
MY_BITMAP const *cols, bool is_transactional)
- : Update_rows_log_event(thd, table, table_id, cols, is_transactional)
+ : Update_rows_log_event(thd, table, table_id, cols, is_transactional),
+ m_after_image(NULL), m_memory(NULL)
{
}
#endif
#if defined(HAVE_REPLICATION)
Update_rows_log_event_old(const char *buf, uint event_len,
const Format_description_log_event *descr)
- : Update_rows_log_event(buf, event_len, descr)
+ : Update_rows_log_event(buf, event_len, descr),
+ m_after_image(NULL), m_memory(NULL)
{
}
#endif
@@ -83,14 +178,25 @@ private:
virtual Log_event_type get_type_code() { return (Log_event_type)TYPE_CODE; }
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
- virtual int do_prepare_row(THD*, RELAY_LOG_INFO const*, TABLE*,
- char const *row_start, char const **row_end);
+ // use old definition of do_apply_event()
+ virtual int do_apply_event(const Relay_log_info *rli)
+ { return Old_rows_log_event::do_apply_event(this,rli); }
+
+ // primitives for old version of do_apply_event()
+ virtual int do_before_row_operations(TABLE *table);
+ virtual int do_after_row_operations(TABLE *table, int error);
+ virtual int do_prepare_row(THD*, Relay_log_info const*, TABLE*,
+ uchar const *row_start, uchar const **row_end);
+ virtual int do_exec_row(TABLE *table);
#endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */
};
-class Delete_rows_log_event_old : public Delete_rows_log_event
+class Delete_rows_log_event_old
+ : public Delete_rows_log_event, public Old_rows_log_event
{
+ uchar *m_after_image, *m_memory;
+
public:
enum
{
@@ -101,14 +207,16 @@ public:
#if !defined(MYSQL_CLIENT)
Delete_rows_log_event_old(THD *thd, TABLE *table, ulong table_id,
MY_BITMAP const *cols, bool is_transactional)
- : Delete_rows_log_event(thd, table, table_id, cols, is_transactional)
+ : Delete_rows_log_event(thd, table, table_id, cols, is_transactional),
+ m_after_image(NULL), m_memory(NULL)
{
}
#endif
#if defined(HAVE_REPLICATION)
Delete_rows_log_event_old(const char *buf, uint event_len,
const Format_description_log_event *descr)
- : Delete_rows_log_event(buf, event_len, descr)
+ : Delete_rows_log_event(buf, event_len, descr),
+ m_after_image(NULL), m_memory(NULL)
{
}
#endif
@@ -117,8 +225,16 @@ private:
virtual Log_event_type get_type_code() { return (Log_event_type)TYPE_CODE; }
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
- virtual int do_prepare_row(THD*, RELAY_LOG_INFO const*, TABLE*,
- char const *row_start, char const **row_end);
+ // use old definition of do_apply_event()
+ virtual int do_apply_event(const Relay_log_info *rli)
+ { return Old_rows_log_event::do_apply_event(this,rli); }
+
+ // primitives for old version of do_apply_event()
+ virtual int do_before_row_operations(TABLE *table);
+ virtual int do_after_row_operations(TABLE *table, int error);
+ virtual int do_prepare_row(THD*, Relay_log_info const*, TABLE*,
+ uchar const *row_start, uchar const **row_end);
+ virtual int do_exec_row(TABLE *table);
#endif
};
diff --git a/sql/mf_iocache.cc b/sql/mf_iocache.cc
index f237f15dbc9..5d9d6d834b4 100644
--- a/sql/mf_iocache.cc
+++ b/sql/mf_iocache.cc
@@ -40,8 +40,8 @@ extern "C" {
** Returns 0 if record read
*/
-int _my_b_net_read(register IO_CACHE *info, byte *Buffer,
- uint Count __attribute__((unused)))
+int _my_b_net_read(register IO_CACHE *info, uchar *Buffer,
+ size_t Count __attribute__((unused)))
{
ulong read_length;
NET *net= &(current_thd)->net;
@@ -61,7 +61,7 @@ int _my_b_net_read(register IO_CACHE *info, byte *Buffer,
DBUG_RETURN(1);
}
/* to set up stuff for my_b_get (no _) */
- info->read_end = (info->read_pos = (byte*) net->read_pos) + read_length;
+ info->read_end = (info->read_pos = (uchar*) net->read_pos) + read_length;
Buffer[0] = info->read_pos[0]; /* length is always 1 */
/*
diff --git a/sql/my_decimal.cc b/sql/my_decimal.cc
index 7b2d271639f..1f0ebf32795 100644
--- a/sql/my_decimal.cc
+++ b/sql/my_decimal.cc
@@ -118,7 +118,7 @@ int my_decimal2string(uint mask, const my_decimal *d,
E_DEC_OVERFLOW
*/
-int my_decimal2binary(uint mask, const my_decimal *d, char *bin, int prec,
+int my_decimal2binary(uint mask, const my_decimal *d, uchar *bin, int prec,
int scale)
{
int err1= E_DEC_OK, err2;
@@ -208,6 +208,17 @@ my_decimal *date2my_decimal(MYSQL_TIME *ltime, my_decimal *dec)
}
+void my_decimal_trim(ulong *precision, uint *scale)
+{
+ if (!(*precision) && !(*scale))
+ {
+ *precision= 10;
+ *scale= 0;
+ return;
+ }
+}
+
+
#ifndef DBUG_OFF
/* routines for debugging print */
@@ -233,7 +244,7 @@ print_decimal(const my_decimal *dec)
/* print decimal with its binary representation */
void
-print_decimal_buff(const my_decimal *dec, const byte* ptr, int length)
+print_decimal_buff(const my_decimal *dec, const uchar* ptr, int length)
{
print_decimal(dec);
fprintf(DBUG_FILE, "Record: ");
diff --git a/sql/my_decimal.h b/sql/my_decimal.h
index eade029677f..800ae23425b 100644
--- a/sql/my_decimal.h
+++ b/sql/my_decimal.h
@@ -36,13 +36,18 @@ C_MODE_END
/* maximum length of buffer in our big digits (uint32) */
#define DECIMAL_BUFF_LENGTH 9
+
+/* the number of digits that my_decimal can possibly contain */
+#define DECIMAL_MAX_POSSIBLE_PRECISION (DECIMAL_BUFF_LENGTH * 9)
+
+
/*
maximum guaranteed precision of number in decimal digits (number of our
digits * number of decimal digits in one our big digit - number of decimal
- digits in one our big digit decreased on 1 (because we always put decimal
+ digits in one our big digit decreased by 1 (because we always put decimal
point on the border of our big digits))
*/
-#define DECIMAL_MAX_PRECISION ((DECIMAL_BUFF_LENGTH * 9) - 8*2)
+#define DECIMAL_MAX_PRECISION (DECIMAL_MAX_POSSIBLE_PRECISION - 8*2)
#define DECIMAL_MAX_SCALE 30
#define DECIMAL_NOT_SPECIFIED 31
@@ -50,7 +55,7 @@ C_MODE_END
maximum length of string representation (number of maximum decimal
digits + 1 position for sign + 1 position for decimal point)
*/
-#define DECIMAL_MAX_STR_LENGTH (DECIMAL_MAX_PRECISION + 2)
+#define DECIMAL_MAX_STR_LENGTH (DECIMAL_MAX_POSSIBLE_PRECISION + 2)
/*
maximum size of packet length
*/
@@ -110,7 +115,7 @@ public:
#ifndef DBUG_OFF
void print_decimal(const my_decimal *dec);
-void print_decimal_buff(const my_decimal *dec, const byte* ptr, int length);
+void print_decimal_buff(const my_decimal *dec, const uchar* ptr, int length);
const char *dbug_decimal_as_string(char *buff, const my_decimal *val);
#else
#define dbug_decimal_as_string(A) NULL
@@ -200,16 +205,15 @@ void my_decimal2decimal(const my_decimal *from, my_decimal *to)
}
-int my_decimal2binary(uint mask, const my_decimal *d, char *bin, int prec,
+int my_decimal2binary(uint mask, const my_decimal *d, uchar *bin, int prec,
int scale);
inline
-int binary2my_decimal(uint mask, const char *bin, my_decimal *d, int prec,
+int binary2my_decimal(uint mask, const uchar *bin, my_decimal *d, int prec,
int scale)
{
- return check_result(mask, bin2decimal((char *)bin, (decimal_t*) d, prec,
- scale));
+ return check_result(mask, bin2decimal(bin, (decimal_t*) d, prec, scale));
}
@@ -395,5 +399,8 @@ int my_decimal_intg(const my_decimal *a)
}
+void my_decimal_trim(ulong *precision, uint *scale);
+
+
#endif /*my_decimal_h*/
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 0a7c1f3ef42..4a8c9b43b34 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -38,6 +38,7 @@
#include <queues.h>
#include "sql_bitmap.h"
#include "sql_array.h"
+#include "sql_plugin.h"
#include "scheduler.h"
/* TODO convert all these three maps to Bitmap classes */
@@ -72,38 +73,35 @@ extern const char *primary_key_name;
#include "unireg.h"
void init_sql_alloc(MEM_ROOT *root, uint block_size, uint pre_alloc_size);
-gptr sql_alloc(unsigned size);
-gptr sql_calloc(unsigned size);
+void *sql_alloc(size_t);
+void *sql_calloc(size_t);
char *sql_strdup(const char *str);
-char *sql_strmake(const char *str,uint len);
-gptr sql_memdup(const void * ptr,unsigned size);
+char *sql_strmake(const char *str, size_t len);
+void *sql_memdup(const void * ptr, size_t size);
void sql_element_free(void *ptr);
-char *sql_strmake_with_convert(const char *str, uint32 arg_length,
+char *sql_strmake_with_convert(const char *str, size_t arg_length,
CHARSET_INFO *from_cs,
- uint32 max_res_length,
- CHARSET_INFO *to_cs, uint32 *result_length);
+ size_t max_res_length,
+ CHARSET_INFO *to_cs, size_t *result_length);
uint kill_one_thread(THD *thd, ulong id, bool only_kill_query);
void sql_kill(THD *thd, ulong id, bool only_kill_query);
bool net_request_file(NET* net, const char* fname);
char* query_table_status(THD *thd,const char *db,const char *table_name);
-void net_set_write_timeout(NET *net, uint timeout);
-void net_set_read_timeout(NET *net, uint timeout);
-
-#define x_free(A) { my_free((gptr) (A),MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR)); }
-#define safeFree(x) { if(x) { my_free((gptr) x,MYF(0)); x = NULL; } }
+#define x_free(A) { my_free((uchar*) (A),MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR)); }
+#define safeFree(x) { if(x) { my_free((uchar*) x,MYF(0)); x = NULL; } }
#define PREV_BITS(type,A) ((type) (((type) 1 << (A)) -1))
#define all_bits_set(A,B) ((A) & (B) != (B))
#define WARN_DEPRECATED(Thd,Ver,Old,New) \
do { \
DBUG_ASSERT(strncmp(Ver, MYSQL_SERVER_VERSION, sizeof(Ver)-1) > 0); \
- if (((gptr)Thd) != NULL) \
+ if (((uchar*)Thd) != NULL) \
push_warning_printf(((THD *)Thd), MYSQL_ERROR::WARN_LEVEL_WARN, \
- ER_WARN_DEPRECATED_SYNTAX, ER(ER_WARN_DEPRECATED_SYNTAX), \
+ ER_WARN_DEPRECATED_SYNTAX, ER(ER_WARN_DEPRECATED_SYNTAX_WITH_VER), \
(Old), (Ver), (New)); \
else \
- sql_print_warning("The syntax %s is deprecated and will be removed " \
+ sql_print_warning("The syntax '%s' is deprecated and will be removed " \
"in MySQL %s. Please use %s instead.", (Old), (Ver), (New)); \
} while(0)
@@ -152,6 +150,87 @@ 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);
+/*************************************************************************/
+
+/**
+ Object_creation_ctx -- interface for creation context of database objects
+ (views, stored routines, events, triggers). Creation context -- is a set
+ of attributes, that should be fixed at the creation time and then be used
+ each time the object is parsed or executed.
+*/
+
+class Object_creation_ctx
+{
+public:
+ Object_creation_ctx *set_n_backup(THD *thd);
+
+ void restore_env(THD *thd, Object_creation_ctx *backup_ctx);
+
+protected:
+ Object_creation_ctx() {}
+ virtual Object_creation_ctx *create_backup_ctx(THD *thd) const = 0;
+
+ virtual void change_env(THD *thd) const = 0;
+
+public:
+ virtual ~Object_creation_ctx()
+ { }
+};
+
+/*************************************************************************/
+
+/**
+ Default_object_creation_ctx -- default implementation of
+ Object_creation_ctx.
+*/
+
+class Default_object_creation_ctx : public Object_creation_ctx
+{
+public:
+ CHARSET_INFO *get_client_cs()
+ {
+ return m_client_cs;
+ }
+
+ CHARSET_INFO *get_connection_cl()
+ {
+ return m_connection_cl;
+ }
+
+protected:
+ Default_object_creation_ctx(THD *thd);
+
+ Default_object_creation_ctx(CHARSET_INFO *client_cs,
+ CHARSET_INFO *connection_cl);
+
+protected:
+ virtual Object_creation_ctx *create_backup_ctx(THD *thd) const;
+
+ virtual void change_env(THD *thd) const;
+
+protected:
+ /**
+ client_cs stores the value of character_set_client session variable.
+ The only character set attribute is used.
+
+ Client character set is included into query context, because we save
+ query in the original character set, which is client character set. So,
+ in order to parse the query properly we have to switch client character
+ set on parsing.
+ */
+ CHARSET_INFO *m_client_cs;
+
+ /**
+ connection_cl stores the value of collation_connection session
+ variable. Both character set and collation attributes are used.
+
+ Connection collation is included into query context, becase it defines
+ the character set and collation of text literals in internal
+ representation of query (item-objects).
+ */
+ CHARSET_INFO *m_connection_cl;
+};
+
/***************************************************************************
Configuration parameters
****************************************************************************/
@@ -177,7 +256,7 @@ MY_LOCALE *my_locale_by_number(uint number);
#define STACK_MIN_SIZE 12000 // Abort if less stack during eval.
#define STACK_MIN_SIZE_FOR_OPEN 1024*80
-#define STACK_BUFF_ALLOC 256 // For stack overrun checks
+#define STACK_BUFF_ALLOC 352 // For stack overrun checks
#ifndef MYSQLD_NET_RETRY_COUNT
#define MYSQLD_NET_RETRY_COUNT 10 // Abort read after this many int.
#endif
@@ -260,9 +339,9 @@ MY_LOCALE *my_locale_by_number(uint number);
#define MAX_CONNECT_ERRORS 10 // errors before disabling host
#ifdef __NETWARE__
-#define IF_NETWARE(A,B) (A)
+#define IF_NETWARE(A,B) A
#else
-#define IF_NETWARE(A,B) (B)
+#define IF_NETWARE(A,B) B
#endif
#if defined(__WIN__)
@@ -388,7 +467,7 @@ MY_LOCALE *my_locale_by_number(uint number);
#define MODE_NO_KEY_OPTIONS 8192
#define MODE_NO_TABLE_OPTIONS 16384
#define MODE_NO_FIELD_OPTIONS 32768
-#define MODE_MYSQL323 65536
+#define MODE_MYSQL323 65536L
#define MODE_MYSQL40 (MODE_MYSQL323*2)
#define MODE_ANSI (MODE_MYSQL40*2)
#define MODE_NO_AUTO_VALUE_ON_ZERO (MODE_ANSI*2)
@@ -403,6 +482,8 @@ MY_LOCALE *my_locale_by_number(uint number);
#define MODE_NO_AUTO_CREATE_USER (MODE_TRADITIONAL*2)
#define MODE_HIGH_NOT_PRECEDENCE (MODE_NO_AUTO_CREATE_USER*2)
#define MODE_NO_ENGINE_SUBSTITUTION (MODE_HIGH_NOT_PRECEDENCE*2)
+#define MODE_PAD_CHAR_TO_FULL_LENGTH (ULL(1) << 31)
+
/*
Replication uses 8 bytes to store SQL_MODE in the binary log. The day you
use strictly more than 64 bits by adding one more define above, you should
@@ -455,9 +536,9 @@ void debug_sync_point(const char* lock_name, uint lock_timeout);
#define SHOW_LOG_STATUS_FREE "FREE"
#define SHOW_LOG_STATUS_INUSE "IN USE"
-struct st_table_list;
+struct TABLE_LIST;
class String;
-void view_store_options(THD *thd, st_table_list *table, String *buff);
+void view_store_options(THD *thd, TABLE_LIST *table, String *buff);
/* Options to add_table_to_list() */
#define TL_OPTION_UPDATING 1
@@ -500,12 +581,19 @@ struct st_table;
#define thd_proc_info(thd, msg) set_thd_proc_info(thd, msg, __func__, __FILE__, __LINE__)
class THD;
+enum enum_check_fields
+{
+ CHECK_FIELD_IGNORE,
+ CHECK_FIELD_WARN,
+ CHECK_FIELD_ERROR_FOR_NULL
+};
+
/* Struct to handle simple linked lists */
typedef struct st_sql_list {
uint elements;
- byte *first;
- byte **next;
+ uchar *first;
+ uchar **next;
st_sql_list() {} /* Remove gcc warning */
inline void empty()
@@ -514,7 +602,7 @@ typedef struct st_sql_list {
first=0;
next= &first;
}
- inline void link_in_list(byte *element,byte **next_ptr)
+ inline void link_in_list(uchar *element,uchar **next_ptr)
{
elements++;
(*next)=element;
@@ -551,9 +639,6 @@ inline THD *_current_thd(void)
}
#define current_thd _current_thd()
-/* below functions are required for plugins as THD class is opaque */
-my_bool thd_in_lock_tables(const THD *thd);
-my_bool thd_tablespace_op(const THD *thd);
/**
The meat of thd_proc_info(THD*, char*), a macro that packs the last
three calling-info parameters.
@@ -562,7 +647,6 @@ const char *set_thd_proc_info(THD *thd, const char *info,
const char *calling_func,
const char *calling_file,
const unsigned int calling_line);
-void **thd_ha_data(const THD *thd, const struct handlerton *hton);
/*
External variables
@@ -577,7 +661,6 @@ typedef my_bool (*qc_engine_callback)(THD *thd, char *table_key,
#include "sql_list.h"
#include "sql_map.h"
#include "my_decimal.h"
-#include "sql_plugin.h"
#include "handler.h"
#include "parse_file.h"
#include "table.h"
@@ -638,6 +721,10 @@ bool check_string_char_length(LEX_STRING *str, const char *err_msg,
uint max_char_length, CHARSET_INFO *cs,
bool no_error);
+bool parse_sql(THD *thd,
+ class Lex_input_stream *lip,
+ class Object_creation_ctx *creation_ctx);
+
enum enum_mysql_completiontype {
ROLLBACK_RELEASE=-2, ROLLBACK=1, ROLLBACK_AND_CHAIN=7,
COMMIT_RELEASE=-1, COMMIT=0, COMMIT_AND_CHAIN=6
@@ -648,6 +735,26 @@ bool end_active_trans(THD *thd);
int end_trans(THD *thd, enum enum_mysql_completiontype completion);
Item *negate_expression(THD *thd, Item *expr);
+
+/* log.cc */
+int vprint_msg_to_log(enum loglevel level, const char *format, va_list args);
+void sql_print_error(const char *format, ...) ATTRIBUTE_FORMAT(printf, 1, 2);
+void sql_print_warning(const char *format, ...) ATTRIBUTE_FORMAT(printf, 1, 2);
+void sql_print_information(const char *format, ...)
+ ATTRIBUTE_FORMAT(printf, 1, 2);
+typedef void (*sql_print_message_func)(const char *format, ...)
+ ATTRIBUTE_FORMAT(printf, 1, 2);
+extern sql_print_message_func sql_print_message_handlers[];
+
+int error_log_print(enum loglevel level, const char *format,
+ va_list args);
+
+bool slow_log_print(THD *thd, const char *query, uint query_length,
+ ulonglong current_utime);
+
+bool general_log_print(THD *thd, enum enum_server_command command,
+ const char *format,...);
+
#include "sql_class.h"
#include "sql_acl.h"
#include "tztime.h"
@@ -671,6 +778,8 @@ struct Query_cache_query_flags
ulong sql_mode;
ulong max_sort_length;
ulong group_concat_max_len;
+ ulong default_week_format;
+ ulong div_precision_increment;
MY_LOCALE *lc_time_names;
};
#define QUERY_CACHE_FLAGS_SIZE sizeof(Query_cache_query_flags)
@@ -806,8 +915,6 @@ check_and_unset_inject_value(int value)
#endif
-uint build_table_path(char *buff, size_t bufflen, const char *db,
- const char *table, const char *ext);
void write_bin_log(THD *thd, bool clear_error,
char const *query, ulong query_length);
@@ -837,10 +944,7 @@ void mysql_client_binlog_statement(THD *thd);
bool mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists,
my_bool drop_temporary);
int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
- bool drop_temporary, bool drop_view, bool log_query);
-int mysql_rm_table_part2_with_lock(THD *thd, TABLE_LIST *tables,
- bool if_exists, bool drop_temporary,
- bool log_query);
+ bool drop_temporary, bool drop_view, bool log_query);
bool quick_rm_table(handlerton *base,const char *db,
const char *table_name, uint flags);
void close_cached_table(THD *thd, TABLE *table);
@@ -848,15 +952,25 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent);
bool do_rename(THD *thd, TABLE_LIST *ren_table, char *new_db,
char *new_table_name, char *new_table_alias,
bool skip_error);
+
bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name,
bool force_switch);
-void mysql_parse(THD *thd,char *inBuf,uint length);
+
+bool mysql_opt_change_db(THD *thd,
+ const LEX_STRING *new_db_name,
+ LEX_STRING *saved_db_name,
+ bool force_switch,
+ bool *cur_db_changed);
+
+void mysql_parse(THD *thd, const char *inBuf, uint length,
+ const char ** semicolon);
+
bool mysql_test_parse_for_slave(THD *thd,char *inBuf,uint length);
bool is_update_query(enum enum_sql_command command);
+bool is_log_table_write_query(enum enum_sql_command command);
bool alloc_query(THD *thd, const char *packet, uint packet_length);
void mysql_init_select(LEX *lex);
void mysql_reset_thd_for_next_command(THD *thd);
-void mysql_init_query(THD *thd, const char *buf, uint length);
bool mysql_new_select(LEX *lex, bool move_down);
void create_select_for_variable(const char *var_name);
void mysql_init_multi_delete(LEX *lex);
@@ -904,9 +1018,9 @@ my_bool is_partition_management(LEX *lex);
All methods presume that there is at least one field to change.
*/
-void set_field_ptr(Field **ptr, const byte *new_buf, const byte *old_buf);
-void set_key_field_ptr(KEY *key_info, const byte *new_buf,
- const byte *old_buf);
+void set_field_ptr(Field **ptr, const uchar *new_buf, const uchar *old_buf);
+void set_key_field_ptr(KEY *key_info, const uchar *new_buf,
+ const uchar *old_buf);
bool mysql_backup_table(THD* thd, TABLE_LIST* table_list);
bool mysql_restore_table(THD* thd, TABLE_LIST* table_list);
@@ -926,7 +1040,7 @@ bool mysql_assign_to_keycache(THD* thd, TABLE_LIST* table_list,
bool mysql_preload_keys(THD* thd, TABLE_LIST* table_list);
int reassign_keycache_tables(THD* thd, KEY_CACHE *src_cache,
KEY_CACHE *dst_cache);
-TABLE *create_virtual_tmp_table(THD *thd, List<create_field> &field_list);
+TABLE *create_virtual_tmp_table(THD *thd, List<Create_field> &field_list);
bool mysql_xa_recover(THD *thd);
@@ -970,34 +1084,33 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
bool table_cant_handle_bit_fields,
bool make_copy_field,
uint convert_blob_length);
-void sp_prepare_create_field(THD *thd, create_field *sql_field);
-int prepare_create_field(create_field *sql_field,
+void sp_prepare_create_field(THD *thd, Create_field *sql_field);
+int prepare_create_field(Create_field *sql_field,
uint *blob_columns,
int *timestamps, int *timestamps_with_niladic,
longlong table_flags);
bool mysql_create_table(THD *thd,const char *db, const char *table_name,
HA_CREATE_INFO *create_info,
- List<create_field> &fields, List<Key> &keys,
- bool tmp_table, uint select_field_count,
- bool use_copy_create_info);
+ Alter_info *alter_info,
+ bool tmp_table, uint select_field_count);
+bool mysql_create_table_no_lock(THD *thd, const char *db,
+ const char *table_name,
+ HA_CREATE_INFO *create_info,
+ Alter_info *alter_info,
+ bool tmp_table, uint select_field_count);
bool mysql_alter_table(THD *thd, char *new_db, char *new_name,
HA_CREATE_INFO *create_info,
TABLE_LIST *table_list,
- List<create_field> &fields,
- List<Key> &keys,
- uint order_num, ORDER *order, bool ignore,
- ALTER_INFO *alter_info, bool do_send_ok);
-bool mysql_recreate_table(THD *thd, TABLE_LIST *table_list, bool do_send_ok);
+ Alter_info *alter_info,
+ uint order_num, ORDER *order, bool ignore);
+bool mysql_recreate_table(THD *thd, TABLE_LIST *table_list);
bool mysql_create_like_table(THD *thd, TABLE_LIST *table,
- HA_CREATE_INFO *create_info,
- Table_ident *src_table);
+ TABLE_LIST *src_table,
+ HA_CREATE_INFO *create_info);
bool mysql_rename_table(handlerton *base, const char *old_db,
const char * old_name, const char *new_db,
const char * new_name, uint flags);
-bool mysql_create_index(THD *thd, TABLE_LIST *table_list, List<Key> &keys);
-bool mysql_drop_index(THD *thd, TABLE_LIST *table_list,
- ALTER_INFO *alter_info);
bool mysql_prepare_update(THD *thd, TABLE_LIST *table_list,
Item **conds, uint order_num, ORDER *order);
int mysql_update(THD *thd,TABLE_LIST *tables,List<Item> &fields,
@@ -1034,13 +1147,21 @@ TABLE_SHARE *get_table_share(THD *thd, TABLE_LIST *table_list, char *key,
uint key_length, uint db_flags, int *error);
void release_table_share(TABLE_SHARE *share, enum release_type type);
TABLE_SHARE *get_cached_table_share(const char *db, const char *table_name);
-TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type update);
+TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type update,
+ uint lock_flags);
TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT* mem,
bool *refresh, uint flags);
-bool reopen_name_locked_table(THD* thd, TABLE_LIST* table);
+bool reopen_name_locked_table(THD* thd, TABLE_LIST* table_list, bool link_in);
+TABLE *table_cache_insert_placeholder(THD *thd, const char *key,
+ uint key_length);
+bool lock_table_name_if_not_cached(THD *thd, const char *db,
+ const char *table_name, TABLE **table);
TABLE *find_locked_table(THD *thd, const char *db,const char *table_name);
+bool reopen_table(TABLE *table);
bool reopen_tables(THD *thd,bool get_locks,bool in_refresh);
-bool close_data_tables(THD *thd,const char *db, const char *table_name);
+void close_data_files_and_morph_locks(THD *thd, const char *db,
+ const char *table_name);
+void close_handle_and_leave_table_as_lock(TABLE *table);
bool wait_for_tables(THD *thd);
bool table_is_used(TABLE *table, bool wait_for_name_lock);
TABLE *drop_locked_tables(THD *thd,const char *db, const char *table_name);
@@ -1103,7 +1224,11 @@ bool mysqld_show_open_tables(THD *thd,const char *wild);
bool mysqld_show_logs(THD *thd);
void append_identifier(THD *thd, String *packet, const char *name,
uint length);
+#endif /* MYSQL_SERVER */
+#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
int get_quote_char_for_identifier(THD *thd, const char *name, uint length);
+#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
+#ifdef MYSQL_SERVER
void mysqld_list_fields(THD *thd,TABLE_LIST *table, const char *wild);
int mysqld_dump_create_info(THD *thd, TABLE_LIST *table_list, int fd);
bool mysqld_show_create(THD *thd, TABLE_LIST *table_list);
@@ -1127,13 +1252,16 @@ int add_status_vars(SHOW_VAR *list);
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 */
+extern LEX_STRING MYSQL_SCHEMA_NAME;
+extern LEX_STRING GENERAL_LOG_NAME;
+extern LEX_STRING SLOW_LOG_NAME;
+
extern const LEX_STRING partition_keywords[];
-LEX_STRING *make_lex_string(THD *thd, LEX_STRING *lex_str,
- const char* str, uint length,
- bool allocate_lex_string);
ST_SCHEMA_TABLE *find_schema_table(THD *thd, const char* table_name);
ST_SCHEMA_TABLE *get_schema_table(enum enum_schema_tables schema_table_idx);
int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident,
@@ -1172,7 +1300,6 @@ bool mysql_ha_read(THD *, TABLE_LIST *,enum enum_ha_read_modes,char *,
List<Item> *,enum ha_rkey_function,Item *,ha_rows,ha_rows);
int mysql_ha_flush(THD *thd, TABLE_LIST *tables, uint mode_flags,
bool is_locked);
-void mysql_ha_mark_tables_for_reopen(THD *thd, TABLE *table);
/* mysql_ha_flush mode_flags bits */
#define MYSQL_HA_CLOSE_FINAL 0x00
#define MYSQL_HA_REOPEN_ON_USAGE 0x01
@@ -1189,7 +1316,7 @@ bool add_field_to_list(THD *thd, LEX_STRING *field_name, enum enum_field_types t
char *change, List<String> *interval_list,
CHARSET_INFO *cs,
uint uint_geom_type);
-create_field * new_create_field(THD *thd, char *field_name, enum_field_types type,
+Create_field * new_create_field(THD *thd, char *field_name, enum_field_types type,
char *length, char *decimals,
uint type_modifier,
Item *default_value, Item *on_update_value,
@@ -1205,7 +1332,9 @@ void add_join_on(TABLE_LIST *b,Item *expr);
void add_join_natural(TABLE_LIST *a,TABLE_LIST *b,List<String> *using_fields,
SELECT_LEX *lex);
bool add_proc_to_list(THD *thd, Item *item);
-TABLE *unlink_open_table(THD *thd,TABLE *list,TABLE *find);
+void unlink_open_table(THD *thd, TABLE *find, bool unlock);
+void drop_open_table(THD *thd, TABLE *table, const char *db_name,
+ const char *table_name);
void update_non_unique_table_error(TABLE_LIST *update,
const char *operation,
TABLE_LIST *duplicate);
@@ -1282,6 +1411,7 @@ int simple_open_n_lock_tables(THD *thd,TABLE_LIST *tables);
bool open_and_lock_tables(THD *thd,TABLE_LIST *tables);
bool open_normal_and_derived_tables(THD *thd, TABLE_LIST *tables, uint flags);
int lock_tables(THD *thd, TABLE_LIST *tables, uint counter, bool *need_reopen);
+int decide_logging_format(THD *thd, TABLE_LIST *tables);
TABLE *open_temporary_table(THD *thd, const char *path, const char *db,
const char *table_name, bool link_in_list);
bool rm_temporary_table(handlerton *base, char *path);
@@ -1291,7 +1421,7 @@ bool close_thread_table(THD *thd, TABLE **table_ptr);
void close_temporary_tables(THD *thd);
void close_tables_for_reopen(THD *thd, TABLE_LIST **tables);
TABLE_LIST *find_table_in_list(TABLE_LIST *table,
- st_table_list *TABLE_LIST::*link,
+ TABLE_LIST *TABLE_LIST::*link,
const char *db_name,
const char *table_name);
TABLE_LIST *unique_table(THD *thd, TABLE_LIST *table, TABLE_LIST *table_list,
@@ -1311,14 +1441,13 @@ char *make_default_log_name(char *buff,const char* log_ext);
#ifdef WITH_PARTITION_STORAGE_ENGINE
uint fast_alter_partition_table(THD *thd, TABLE *table,
- ALTER_INFO *alter_info,
+ Alter_info *alter_info,
HA_CREATE_INFO *create_info,
TABLE_LIST *table_list,
- List<create_field> *create_list,
- List<Key> *key_list, char *db,
+ char *db,
const char *table_name,
uint fast_alter_partition);
-uint prep_alter_part_table(THD *thd, TABLE *table, ALTER_INFO *alter_info,
+uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
HA_CREATE_INFO *create_info,
handlerton *old_db_type,
bool *partition_changed,
@@ -1350,20 +1479,16 @@ typedef struct st_lock_param_type
ulonglong deleted;
THD *thd;
HA_CREATE_INFO *create_info;
- ALTER_INFO *alter_info;
- List<create_field> *create_list;
- List<create_field> new_create_list;
- List<Key> *key_list;
- List<Key> new_key_list;
+ Alter_info *alter_info;
TABLE *table;
KEY *key_info_buffer;
const char *db;
const char *table_name;
- const void *pack_frm_data;
+ uchar *pack_frm_data;
enum thr_lock_type old_lock_type;
uint key_count;
uint db_options;
- uint pack_frm_len;
+ size_t pack_frm_len;
partition_info *part_info;
} ALTER_PARTITION_PARAM_TYPE;
@@ -1461,6 +1586,10 @@ bool open_system_tables_for_read(THD *thd, TABLE_LIST *table_list,
void close_system_tables(THD *thd, Open_tables_state *backup);
TABLE *open_system_table_for_update(THD *thd, TABLE_LIST *one_table);
+TABLE *open_performance_schema_table(THD *thd, TABLE_LIST *one_table,
+ Open_tables_state *backup);
+void close_performance_schema_table(THD *thd, Open_tables_state *backup);
+
bool close_cached_tables(THD *thd, bool wait_for_refresh, TABLE_LIST *tables, bool have_lock = FALSE);
bool close_cached_connection_tables(THD *thd, bool wait_for_refresh,
LEX_STRING *connect_string,
@@ -1526,41 +1655,22 @@ void print_plan(JOIN* join,uint idx, double record_count, double read_time,
#endif
void mysql_print_status();
/* key.cc */
-int find_ref_key(KEY *key, uint key_count, byte *record, Field *field,
+int find_ref_key(KEY *key, uint key_count, uchar *record, Field *field,
uint *key_length, uint *keypart);
-void key_copy(byte *to_key, byte *from_record, KEY *key_info, uint key_length);
-void key_restore(byte *to_record, byte *from_key, KEY *key_info,
+void key_copy(uchar *to_key, uchar *from_record, KEY *key_info, uint key_length);
+void key_restore(uchar *to_record, uchar *from_key, KEY *key_info,
uint key_length);
-bool key_cmp_if_same(TABLE *form,const byte *key,uint index,uint key_length);
+bool key_cmp_if_same(TABLE *form,const uchar *key,uint index,uint key_length);
void key_unpack(String *to,TABLE *form,uint index);
bool is_key_used(TABLE *table, uint idx, const MY_BITMAP *fields);
-int key_cmp(KEY_PART_INFO *key_part, const byte *key, uint key_length);
-int key_rec_cmp(void *key_info, byte *a, byte *b);
+int key_cmp(KEY_PART_INFO *key_part, const uchar *key, uint key_length);
+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);
-
-int vprint_msg_to_log(enum loglevel level, const char *format, va_list args);
-void sql_print_error(const char *format, ...) ATTRIBUTE_FORMAT(printf, 1, 2);
-void sql_print_warning(const char *format, ...) ATTRIBUTE_FORMAT(printf, 1, 2);
-void sql_print_information(const char *format, ...)
- ATTRIBUTE_FORMAT(printf, 1, 2);
-typedef void (*sql_print_message_func)(const char *format, ...)
- ATTRIBUTE_FORMAT(printf, 1, 2);
-extern sql_print_message_func sql_print_message_handlers[];
-
-int error_log_print(enum loglevel level, const char *format,
- va_list args);
-
-bool slow_log_print(THD *thd, const char *query, uint query_length,
- time_t query_start_arg);
-
-bool general_log_print(THD *thd, enum enum_server_command command,
- const char *format,...);
-
-bool fn_format_relative_to_data_home(my_string to, const char *name,
+bool fn_format_relative_to_data_home(char * to, const char *name,
const char *dir, const char *extension);
#ifdef MYSQL_SERVER
File open_binlog(IO_CACHE *log, const char *log_file_name,
@@ -1602,6 +1712,7 @@ bool check_db_dir_existence(const char *db_name);
bool load_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create);
bool load_db_opt_by_name(THD *thd, const char *db_name,
HA_CREATE_INFO *db_create_info);
+CHARSET_INFO *get_default_db_collation(THD *thd, const char *db_name);
bool my_dbopt_init(void);
void my_dbopt_cleanup(void);
extern int creating_database; // How many database locks are made
@@ -1612,8 +1723,14 @@ extern int creating_table; // How many mysql_create_table() are running
*/
extern time_t server_start_time, flush_status_time;
+#endif /* MYSQL_SERVER */
+#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
+extern uint mysql_data_home_len;
extern char *mysql_data_home,server_version[SERVER_VERSION_LENGTH],
- mysql_real_data_home[], *opt_mysql_tmpdir, mysql_charsets_dir[],
+ mysql_real_data_home[];
+#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
+#ifdef MYSQL_SERVER
+extern char *opt_mysql_tmpdir, mysql_charsets_dir[],
def_ft_boolean_syntax[sizeof(ft_boolean_syntax)];
#define mysql_tmpdir (my_tmpdir(&mysql_tmpdir_list))
extern MY_TMPDIR mysql_tmpdir_list;
@@ -1622,25 +1739,28 @@ extern const char *first_keyword, *my_localhost, *delayed_user, *binary_keyword;
extern const char **errmesg; /* Error messages */
extern const char *myisam_recover_options_str;
extern const char *in_left_expr_name, *in_additional_cond, *in_having_cond;
-extern const char * const triggers_file_ext;
-extern const char * const trigname_file_ext;
+extern const char * const TRG_EXT;
+extern const char * const TRN_EXT;
extern Eq_creator eq_creator;
extern Ne_creator ne_creator;
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], reg_ext[FN_EXTLEN];
+extern char language[FN_REFLEN];
+#endif /* MYSQL_SERVER */
+#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
+extern char reg_ext[FN_EXTLEN];
extern uint reg_ext_length;
+#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
+#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 log_error_file[FN_REFLEN], *opt_tc_log_file;
-extern double log_10[32];
-extern double log_01[32];
extern ulonglong log_10_int[20];
extern ulonglong keybuff_size;
extern ulonglong thd_startup_options;
-extern ulong refresh_version, thread_id;
+extern ulong thread_id;
extern ulong binlog_cache_use, binlog_cache_disk_use;
extern ulong aborted_threads,aborted_connects;
extern ulong delayed_insert_timeout;
@@ -1662,17 +1782,32 @@ extern ulong max_binlog_size, max_relay_log_size;
extern ulong opt_binlog_rows_event_max_size;
extern ulong rpl_recovery_rank, thread_cache_size, thread_pool_size;
extern ulong back_log;
-extern ulong specialflag, current_pid;
+#endif /* MYSQL_SERVER */
+#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
+extern ulong 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 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 uint test_flags,select_errors,ha_open_options;
extern uint protocol_version, mysqld_port, dropping_tables;
-extern uint delay_key_write_options, lower_case_table_names;
+extern uint delay_key_write_options;
+#endif /* MYSQL_SERVER */
+#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
+extern uint lower_case_table_names;
+#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
+#ifdef MYSQL_SERVER
extern bool opt_endinfo, using_udf_functions;
extern my_bool locked_in_memory;
-extern bool opt_using_transactions, mysqld_embedded;
+extern bool opt_using_transactions;
+#endif /* MYSQL_SERVER */
+#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
+extern bool mysqld_embedded;
+#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
+#ifdef MYSQL_SERVER
extern bool using_update_log, opt_large_files, server_id_supplied;
extern bool opt_update_log, opt_bin_log, opt_error_log;
extern my_bool opt_log, opt_slow_log;
@@ -1680,7 +1815,7 @@ extern ulong log_output_options;
extern my_bool opt_log_queries_not_using_indexes;
extern bool opt_disable_networking, opt_skip_show_db;
extern my_bool opt_character_set_client_handshake;
-extern bool volatile abort_loop, shutdown_in_progress, grant_option;
+extern bool volatile abort_loop, shutdown_in_progress;
extern uint volatile thread_count, thread_running, global_read_lock;
extern my_bool opt_sql_bin_update, opt_safe_user_create, opt_no_mix_types;
extern my_bool opt_safe_show_db, opt_local_infile, opt_myisam_use_mmap;
@@ -1689,15 +1824,19 @@ extern my_bool opt_readonly, lower_case_file_system;
extern my_bool opt_enable_named_pipe, opt_sync_frm, opt_allow_suspicious_udfs;
extern my_bool opt_secure_auth;
extern char* opt_secure_file_priv;
-extern my_bool opt_log_slow_admin_statements;
+extern my_bool opt_log_slow_admin_statements, opt_log_slow_slave_statements;
extern my_bool sp_automatic_privileges, opt_noacl;
extern my_bool opt_old_style_user_limits, trust_function_creators;
extern uint opt_crash_binlog_innodb;
extern char *shared_memory_base_name, *mysqld_unix_port;
extern my_bool opt_enable_shared_memory;
extern char *default_tz_name;
+#endif /* MYSQL_SERVER */
+#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
extern my_bool opt_large_pages;
extern uint opt_large_page_size;
+#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
+#ifdef MYSQL_SERVER
extern char *opt_logname, *opt_slow_logname;
extern const char *log_output_str;
@@ -1723,6 +1862,7 @@ extern pthread_mutex_t LOCK_server_started;
extern pthread_cond_t COND_server_started;
extern int mysqld_server_started;
extern rw_lock_t LOCK_grant, LOCK_sys_init_connect, LOCK_sys_init_slave;
+extern rw_lock_t LOCK_system_variables_hash;
extern pthread_cond_t COND_refresh, COND_thread_count, COND_manager;
extern pthread_cond_t COND_global_read_lock;
extern pthread_attr_t connection_attrib;
@@ -1731,8 +1871,12 @@ extern I_List<NAMED_LIST> key_caches;
extern MY_BITMAP temp_pool;
extern String my_empty_string;
extern const String my_null_string;
-extern SHOW_VAR init_vars[], status_vars[], internal_vars[];
+extern SHOW_VAR status_vars[];
+#endif /* MYSQL_SERVER */
+#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
extern struct system_variables global_system_variables;
+#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
+#ifdef MYSQL_SERVER
extern struct system_variables max_system_variables;
extern struct system_status_var global_status_var;
extern struct rand_struct sql_rand;
@@ -1753,11 +1897,6 @@ extern uint sql_command_flags[];
extern TYPELIB log_output_typelib;
/* optional things, have_* variables */
-
-extern SHOW_COMP_OPTION have_innodb;
-extern SHOW_COMP_OPTION have_csv_db;
-extern SHOW_COMP_OPTION have_ndbcluster;
-extern SHOW_COMP_OPTION have_partition_db;
extern SHOW_COMP_OPTION have_community_features;
extern handlerton *partition_hton;
@@ -1765,11 +1904,12 @@ extern handlerton *myisam_hton;
extern handlerton *heap_hton;
extern SHOW_COMP_OPTION have_ssl, have_symlink, have_dlopen;
-extern SHOW_COMP_OPTION have_query_cache;
+uextern SHOW_COMP_OPTION have_query_cache;
extern SHOW_COMP_OPTION have_geometry, have_rtree_keys;
extern SHOW_COMP_OPTION have_crypt;
extern SHOW_COMP_OPTION have_compress;
+
#ifndef __WIN__
extern pthread_t signal_thread;
#endif
@@ -1784,12 +1924,15 @@ MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **table, uint count,
#define MYSQL_LOCK_IGNORE_GLOBAL_READ_LOCK 0x0001
#define MYSQL_LOCK_IGNORE_FLUSH 0x0002
#define MYSQL_LOCK_NOTIFY_IF_NEED_REOPEN 0x0004
-#define MYSQL_OPEN_IGNORE_LOCKED_TABLES 0x0008
+#define MYSQL_OPEN_TEMPORARY_ONLY 0x0008
+#define MYSQL_LOCK_IGNORE_GLOBAL_READ_ONLY 0x0010
+#define MYSQL_LOCK_PERF_SCHEMA 0x0020
void mysql_unlock_tables(THD *thd, MYSQL_LOCK *sql_lock);
void mysql_unlock_read_tables(THD *thd, MYSQL_LOCK *sql_lock);
void mysql_unlock_some_tables(THD *thd, TABLE **table,uint count);
-void mysql_lock_remove(THD *thd, MYSQL_LOCK *locked,TABLE *table);
+void mysql_lock_remove(THD *thd, MYSQL_LOCK *locked,TABLE *table,
+ bool always_unlock);
void mysql_lock_abort(THD *thd, TABLE *table, bool upgrade_lock);
void mysql_lock_downgrade_write(THD *thd, TABLE *table,
thr_lock_type new_lock_type);
@@ -1815,6 +1958,11 @@ bool wait_for_locked_table_names(THD *thd, TABLE_LIST *table_list);
bool lock_table_names(THD *thd, TABLE_LIST *table_list);
void unlock_table_names(THD *thd, TABLE_LIST *table_list,
TABLE_LIST *last_table);
+bool lock_table_names_exclusively(THD *thd, TABLE_LIST *table_list);
+bool is_table_name_exclusively_locked_by_this_thread(THD *thd,
+ TABLE_LIST *table_list);
+bool is_table_name_exclusively_locked_by_this_thread(THD *thd, uchar *key,
+ int key_length);
/* old unireg functions */
@@ -1824,16 +1972,16 @@ void unireg_end(void) __attribute__((noreturn));
bool mysql_create_frm(THD *thd, const char *file_name,
const char *db, const char *table,
HA_CREATE_INFO *create_info,
- List<create_field> &create_field,
+ List<Create_field> &create_field,
uint key_count,KEY *key_info,handler *db_type);
int rea_create_table(THD *thd, const char *path,
const char *db, const char *table_name,
HA_CREATE_INFO *create_info,
- List<create_field> &create_field,
+ List<Create_field> &create_field,
uint key_count,KEY *key_info,
handler *file);
-int format_number(uint inputflag,uint max_length,my_string pos,uint length,
- my_string *errpos);
+int format_number(uint inputflag,uint max_length,char * pos,uint length,
+ char * *errpos);
/* table.cc */
TABLE_SHARE *alloc_table_share(TABLE_LIST *table_list, char *key,
@@ -1846,10 +1994,10 @@ void open_table_error(TABLE_SHARE *share, int error, int db_errno, int errarg);
int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
uint db_stat, uint prgflag, uint ha_open_flags,
TABLE *outparam, bool is_create_table);
-int readfrm(const char *name, const void** data, uint* length);
-int writefrm(const char* name, const void* data, uint len);
+int readfrm(const char *name, uchar **data, size_t *length);
+int writefrm(const char* name, const uchar* data, size_t len);
int closefrm(TABLE *table, bool free_share);
-int read_string(File file, gptr *to, uint length);
+int read_string(File file, uchar* *to, size_t length);
void free_blobs(TABLE *table);
int set_zone(int nr,int min_zone,int max_zone);
ulong convert_period_to_month(ulong period);
@@ -1894,7 +2042,7 @@ ulonglong get_datetime_value(THD *thd, Item ***item_arg, Item **cache_arg,
Item *warn_item, bool *is_null);
int test_if_number(char *str,int *res,bool allow_wildcards);
-void change_byte(byte *,uint,char,char);
+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);
@@ -1906,7 +2054,7 @@ ha_rows filesort(THD *thd, TABLE *form,struct st_sort_field *sortorder,
ha_rows max_rows, bool sort_positions,
ha_rows *examined_rows);
void filesort_free_buffers(TABLE *table, bool full);
-void change_double_for_sort(double nr,byte *to);
+void change_double_for_sort(double nr,uchar *to);
double my_double_round(double value, longlong dec, bool dec_unsigned,
bool truncate);
int get_quick_record(SQL_SELECT *select);
@@ -1914,7 +2062,7 @@ int get_quick_record(SQL_SELECT *select);
int calc_weekday(long daynr,bool sunday_first_day_of_week);
uint calc_week(MYSQL_TIME *l_time, uint week_behaviour, uint *year);
void find_date(char *pos,uint *vek,uint flag);
-TYPELIB *convert_strings_to_array_type(my_string *typelibs, my_string *end);
+TYPELIB *convert_strings_to_array_type(char * *typelibs, char * *end);
TYPELIB *typelib(MEM_ROOT *mem_root, List<String> &strings);
ulong get_form_pos(File file, uchar *head, TYPELIB *save_names);
ulong make_new_entry(File file,uchar *fileinfo,TYPELIB *formnames,
@@ -1935,12 +2083,22 @@ int wild_case_compare(CHARSET_INFO *cs, const char *str,const char *wildstr);
char *fn_rext(char *name);
/* Conversion functions */
+#endif /* MYSQL_SERVER */
+#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
uint strconvert(CHARSET_INFO *from_cs, const char *from,
CHARSET_INFO *to_cs, char *to, uint to_length, uint *errors);
uint filename_to_tablename(const char *from, char *to, uint to_length);
uint tablename_to_filename(const char *from, char *to, uint to_length);
+#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
+#ifdef MYSQL_SERVER
uint build_table_filename(char *buff, size_t bufflen, const char *db,
const char *table, const char *ext, uint flags);
+
+#define MYSQL50_TABLE_NAME_PREFIX "#mysql50#"
+#define MYSQL50_TABLE_NAME_PREFIX_LENGTH 9
+
+uint build_table_shadow_filename(char *buff, size_t bufflen,
+ ALTER_PARTITION_PARAM_TYPE *lpt);
/* Flags for conversion functions. */
#define FN_FROM_IS_TMP (1 << 0)
#define FN_TO_IS_TMP (1 << 1)
@@ -1949,7 +2107,7 @@ uint build_table_filename(char *buff, size_t bufflen, const char *db,
/* from hostname.cc */
struct in_addr;
-my_string ip_to_hostname(struct in_addr *in,uint *errors);
+char * ip_to_hostname(struct in_addr *in,uint *errors);
void inc_host_errors(struct in_addr *in);
void reset_host_errors(struct in_addr *in);
bool hostname_cache_init();
@@ -1974,7 +2132,6 @@ void free_list(I_List <i_string_pair> *list);
void free_list(I_List <i_string> *list);
/* sql_yacc.cc */
-extern int MYSQLparse(void *thd);
#ifndef DBUG_OFF
extern void turn_parser_debug_on();
#endif
@@ -2113,7 +2270,7 @@ inline bool is_user_table(TABLE * table)
#ifndef EMBEDDED_LIBRARY
extern "C" void unireg_abort(int exit_code) __attribute__((noreturn));
void kill_delayed_threads(void);
-bool check_stack_overrun(THD *thd, long margin, char *dummy);
+bool check_stack_overrun(THD *thd, long margin, uchar *dummy);
#else
#define unireg_abort(exit_code) DBUG_RETURN(exit_code)
inline void kill_delayed_threads(void) {}
@@ -2166,6 +2323,24 @@ bool schema_table_store_record(THD *thd, TABLE *table);
int item_create_init();
void item_create_cleanup();
+bool show_create_trigger(THD *thd, const sp_name *trg_name);
+
+inline void lex_string_set(LEX_STRING *lex_str, const char *c_str)
+{
+ lex_str->str= (char *) c_str;
+ lex_str->length= strlen(c_str);
+}
+
+bool load_charset(MEM_ROOT *mem_root,
+ Field *field,
+ CHARSET_INFO *dflt_cs,
+ CHARSET_INFO **cs);
+
+bool load_collation(MEM_ROOT *mem_root,
+ Field *field,
+ CHARSET_INFO *dflt_cl,
+ CHARSET_INFO **cl);
+
#endif /* MYSQL_SERVER */
#endif /* MYSQL_CLIENT */
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 8930200656e..35bd7e7d179 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -30,22 +30,17 @@
#include "rpl_injector.h"
-#ifdef WITH_INNOBASE_STORAGE_ENGINE
-#define OPT_INNODB_DEFAULT 1
-#else
-#define OPT_INNODB_DEFAULT 0
+#ifdef HAVE_SYS_PRCTL_H
+#include <sys/prctl.h>
#endif
-#define OPT_BDB_DEFAULT 0
+
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
-#define OPT_NDBCLUSTER_DEFAULT 0
#if defined(NOT_ENOUGH_TESTED) \
&& defined(NDB_SHM_TRANSPORTER) && MYSQL_VERSION_ID >= 50000
#define OPT_NDB_SHM_DEFAULT 1
#else
#define OPT_NDB_SHM_DEFAULT 0
#endif
-#else
-#define OPT_NDBCLUSTER_DEFAULT 0
#endif
#ifndef DEFAULT_SKIP_THREAD_PRIORITY
@@ -225,8 +220,10 @@ static const char *sql_mode_names[]=
"ERROR_FOR_DIVISION_BY_ZERO",
"TRADITIONAL", "NO_AUTO_CREATE_USER", "HIGH_NOT_PRECEDENCE",
"NO_ENGINE_SUBSTITUTION",
+ "PAD_CHAR_TO_FULL_LENGTH",
NullS
};
+
static const unsigned int sql_mode_names_len[]=
{
/*REAL_AS_FLOAT*/ 13,
@@ -259,8 +256,10 @@ static const unsigned int sql_mode_names_len[]=
/*TRADITIONAL*/ 11,
/*NO_AUTO_CREATE_USER*/ 19,
/*HIGH_NOT_PRECEDENCE*/ 19,
- /*NO_ENGINE_SUBSTITUTION*/ 22
+ /*NO_ENGINE_SUBSTITUTION*/ 22,
+ /*PAD_CHAR_TO_FULL_LENGTH*/ 23
};
+
TYPELIB sql_mode_typelib= { array_elements(sql_mode_names)-1,"",
sql_mode_names,
(unsigned int *)sql_mode_names_len };
@@ -322,7 +321,6 @@ static bool lower_case_table_names_used= 0;
static bool volatile select_thread_in_use, signal_thread_in_use;
static bool volatile ready_to_exit;
static my_bool opt_debugging= 0, opt_external_locking= 0, opt_console= 0;
-static my_bool opt_ndbcluster;
static my_bool opt_short_log_format= 0;
static uint kill_cached_threads, wake_thread;
static ulong killed_threads, thread_created;
@@ -340,6 +338,7 @@ static char *default_collation_name;
static char *default_storage_engine_str;
static char compiled_default_collation_name[]= MYSQL_DEFAULT_COLLATION_NAME;
static I_List<THD> thread_cache;
+static double long_query_time;
static pthread_cond_t COND_thread_cache, COND_flush_thread_cache;
@@ -357,7 +356,15 @@ bool opt_endinfo, using_udf_functions;
my_bool locked_in_memory;
bool opt_using_transactions, using_update_log;
bool volatile abort_loop;
-bool volatile shutdown_in_progress, grant_option;
+bool volatile shutdown_in_progress;
+/**
+ @brief 'grant_option' is used to indicate if privileges needs
+ to be checked, in which case the lock, LOCK_grant, is used
+ to protect access to the grant table.
+ @note This flag is dropped in 5.1
+ @see grant_init()
+ */
+bool volatile grant_option;
my_bool opt_skip_slave_start = 0; // If set, slave is not autostarted
my_bool opt_reckless_slave = 0;
@@ -366,7 +373,6 @@ my_bool opt_local_infile, opt_slave_compressed_protocol;
my_bool opt_safe_user_create = 0, opt_no_mix_types = 0;
my_bool opt_show_slave_auth_info, opt_sql_bin_update = 0;
my_bool opt_log_slave_updates= 0;
-my_bool opt_innodb;
bool slave_warning_issued = false;
/*
@@ -376,49 +382,10 @@ handlerton *heap_hton;
handlerton *myisam_hton;
handlerton *partition_hton;
-#ifdef WITH_INNOBASE_STORAGE_ENGINE
-extern ulong innobase_fast_shutdown;
-extern ulong innobase_large_page_size;
-extern char *innobase_home, *innobase_tmpdir, *innobase_logdir;
-extern long innobase_lock_scan_time;
-extern long innobase_mirrored_log_groups, innobase_log_files_in_group;
-extern longlong innobase_log_file_size;
-extern long innobase_log_buffer_size;
-extern longlong innobase_buffer_pool_size;
-extern long innobase_additional_mem_pool_size;
-extern long innobase_file_io_threads, innobase_lock_wait_timeout;
-extern long innobase_force_recovery;
-extern long innobase_open_files;
-extern char *innobase_data_home_dir, *innobase_data_file_path;
-extern char *innobase_log_group_home_dir, *innobase_log_arch_dir;
-extern char *innobase_unix_file_flush_method;
-/* The following variables have to be my_bool for SHOW VARIABLES to work */
-extern my_bool innobase_log_archive,
- innobase_use_doublewrite,
- innobase_use_checksums,
- innobase_use_large_pages,
- innobase_use_native_aio,
- innobase_file_per_table, innobase_locks_unsafe_for_binlog,
- innobase_rollback_on_timeout,
- innobase_stats_on_metadata,
- innobase_create_status_file;
-extern "C" {
-extern ulong srv_max_buf_pool_modified_pct;
-extern ulong srv_max_purge_lag;
-extern ulong srv_auto_extend_increment;
-extern ulong srv_n_spin_wait_rounds;
-extern ulong srv_n_free_tickets_to_enter;
-extern ulong srv_thread_sleep_delay;
-extern ulong srv_thread_concurrency;
-extern ulong srv_commit_concurrency;
-extern ulong srv_flush_log_at_trx_commit;
-}
-#endif
-
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
const char *opt_ndbcluster_connectstring= 0;
const char *opt_ndb_connectstring= 0;
-char opt_ndb_constrbuf[1024];
+char opt_ndb_constrbuf[1024]= {0};
unsigned opt_ndb_constrbuf_len= 0;
my_bool opt_ndb_shm, opt_ndb_optimized_node_selection;
ulong opt_ndb_cache_check_time;
@@ -440,6 +407,7 @@ my_bool opt_sync_frm, opt_allow_suspicious_udfs;
my_bool opt_secure_auth= 0;
char* opt_secure_file_priv= 0;
my_bool opt_log_slow_admin_statements= 0;
+my_bool opt_log_slow_slave_statements= 0;
my_bool lower_case_file_system= 0;
my_bool opt_large_pages= 0;
my_bool opt_myisam_use_mmap= 0;
@@ -455,7 +423,7 @@ my_bool opt_noacl;
my_bool sp_automatic_privileges= 1;
ulong opt_binlog_rows_event_max_size;
-const char *binlog_format_names[]= {"STATEMENT", "ROW", "MIXED", NullS};
+const char *binlog_format_names[]= {"MIXED", "STATEMENT", "ROW", NullS};
TYPELIB binlog_format_typelib=
{ array_elements(binlog_format_names) - 1, "",
binlog_format_names, NULL };
@@ -512,8 +480,6 @@ ulong expire_logs_days = 0;
ulong rpl_recovery_rank=0;
const char *log_output_str= "TABLE";
-double log_10[32]; /* 10 potences */
-double log_01[32];
time_t server_start_time, flush_status_time;
char mysql_home[FN_REFLEN], pidfile_name[FN_REFLEN], system_time_zone[30];
@@ -529,6 +495,7 @@ key_map key_map_full(0); // Will be initialized later
const char *opt_date_time_formats[3];
+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;
@@ -601,6 +568,7 @@ pthread_mutex_t LOCK_prepared_stmt_count;
pthread_mutex_t LOCK_des_key_file;
#endif
rw_lock_t LOCK_grant, LOCK_sys_init_connect, LOCK_sys_init_slave;
+rw_lock_t LOCK_system_variables_hash;
pthread_cond_t COND_refresh, COND_thread_count, COND_global_read_lock;
pthread_t signal_thread;
pthread_attr_t connection_attrib;
@@ -632,6 +600,7 @@ static ulong opt_specialflag, opt_myisam_block_size;
static char *opt_update_logname, *opt_binlog_index_name;
static char *opt_tc_heuristic_recover;
static char *mysql_home_ptr, *pidfile_name_ptr;
+static int defaults_argc;
static char **defaults_argv;
static char *opt_bin_logname;
@@ -724,7 +693,8 @@ struct st_VioSSLFd *ssl_acceptor_fd;
pthread_handler_t signal_hand(void *arg);
static void mysql_init_variables(void);
-static void get_options(int argc,char **argv);
+static void get_options(int *argc,char **argv);
+extern "C" my_bool mysqld_get_one_option(int, const struct my_option *, char *);
static void set_server_version(void);
static int init_thread_environment();
static char *get_relative_path(const char *path);
@@ -747,6 +717,7 @@ static void clean_up(bool print_message);
static int test_if_case_insensitive(const char *dir_name);
#ifndef EMBEDDED_LIBRARY
+static void usage(void);
static void start_signal_handler(void);
static void close_server_sock();
static void clean_up_mutexes(void);
@@ -776,14 +747,16 @@ static void close_connections(void)
(void) pthread_mutex_lock(&LOCK_manager);
if (manager_thread_in_use)
{
- DBUG_PRINT("quit",("killing manager thread: 0x%lx",manager_thread));
+ DBUG_PRINT("quit", ("killing manager thread: 0x%lx",
+ (ulong)manager_thread));
(void) pthread_cond_signal(&COND_manager);
}
(void) pthread_mutex_unlock(&LOCK_manager);
/* kill connection thread */
#if !defined(__WIN__) && !defined(__NETWARE__)
- DBUG_PRINT("quit",("waiting for select thread: 0x%lx",select_thread));
+ DBUG_PRINT("quit", ("waiting for select thread: 0x%lx",
+ (ulong) select_thread));
(void) pthread_mutex_lock(&LOCK_thread_count);
while (select_thread_in_use)
@@ -794,6 +767,7 @@ static void close_connections(void)
DBUG_PRINT("info",("Waiting for select thread"));
#ifndef DONT_USE_THR_ALARM
+ if (pthread_kill(select_thread, thr_client_alarm))
break; // allready dead
#endif
set_timespec(abstime, 2);
@@ -1170,9 +1144,12 @@ void unireg_end(void)
extern "C" void unireg_abort(int exit_code)
{
DBUG_ENTER("unireg_abort");
+
if (exit_code)
sql_print_error("Aborting\n");
- clean_up(exit_code || !opt_bootstrap); /* purecov: inspected */
+ else if (opt_help)
+ usage();
+ clean_up(!opt_help && (exit_code || !opt_bootstrap)); /* purecov: inspected */
DBUG_PRINT("quit",("done with cleanup in unireg_abort"));
wait_for_signal_thread_to_end();
clean_up_mutexes();
@@ -1188,13 +1165,14 @@ void clean_up(bool print_message)
if (cleanup_done++)
return; /* purecov: inspected */
- logger.cleanup_base();
-
/*
make sure that handlers finish up
what they have that is dependent on the binlog
*/
ha_binlog_end(current_thd);
+
+ logger.cleanup_base();
+
injector::free_instance();
mysql_bin_log.cleanup();
@@ -1229,7 +1207,7 @@ void clean_up(bool print_message)
if (tc_log)
tc_log->close();
xid_cache_free();
- delete_elements(&key_caches, (void (*)(const char*, gptr)) free_key_cache);
+ delete_elements(&key_caches, (void (*)(const char*, uchar*)) free_key_cache);
multi_keycache_free();
free_status_vars();
end_thr_alarm(1); /* Free allocated memory */
@@ -1268,15 +1246,15 @@ void clean_up(bool print_message)
my_regex_end();
#endif
- if (print_message && errmesg)
- sql_print_information(ER(ER_SHUTDOWN_COMPLETE),my_progname);
#if !defined(EMBEDDED_LIBRARY)
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);
thread_scheduler.end();
finish_client_errs();
- my_free((gptr) my_error_unregister(ER_ERROR_FIRST, ER_ERROR_LAST),
+ 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 */
@@ -1313,7 +1291,7 @@ static void wait_for_signal_thread_to_end()
*/
for (i= 0 ; i < 100 && signal_thread_in_use; i++)
{
- if (pthread_kill(signal_thread, MYSQL_KILL_SIGNAL))
+ if (pthread_kill(signal_thread, MYSQL_KILL_SIGNAL) != ESRCH)
break;
my_sleep(100); // Give it time to die
}
@@ -1357,6 +1335,7 @@ static void clean_up_mutexes()
(void) rwlock_destroy(&LOCK_sys_init_connect);
(void) rwlock_destroy(&LOCK_sys_init_slave);
(void) pthread_mutex_destroy(&LOCK_global_system_variables);
+ (void) rwlock_destroy(&LOCK_system_variables_hash);
(void) pthread_mutex_destroy(&LOCK_global_read_lock);
(void) pthread_mutex_destroy(&LOCK_uuid_generator);
(void) pthread_mutex_destroy(&LOCK_prepared_stmt_count);
@@ -1375,6 +1354,7 @@ static void clean_up_mutexes()
** Init IP and UNIX socket
****************************************************************************/
+#ifndef EMBEDDED_LIBRARY
static void set_ports()
{
char *env;
@@ -1399,7 +1379,6 @@ static void set_ports()
}
}
-#ifndef EMBEDDED_LIBRARY
/* Change to run as another user if started with --user */
static struct passwd *check_user(const char *user)
@@ -1453,6 +1432,15 @@ static struct passwd *check_user(const char *user)
err:
sql_print_error("Fatal error: Can't change to run as user '%s' ; Please check that the user exists!\n",user);
unireg_abort(1);
+
+#ifdef PR_SET_DUMPABLE
+ if (test_flags & TEST_CORE_ON_SIGNAL)
+ {
+ /* inform kernel that process is dumpable */
+ (void) prctl(PR_SET_DUMPABLE, 1);
+ }
+#endif
+
#endif
return NULL;
}
@@ -1815,7 +1803,7 @@ static bool cache_thread()
this thread for handling of new THD object/connection.
*/
thd->mysys_var->abort= 0;
- thd->thr_create_time= time(NULL);
+ thd->thr_create_utime= my_micro_time();
threads.append(thd);
return(1);
}
@@ -1917,9 +1905,11 @@ static void init_signals(void)
static void start_signal_handler(void)
{
+#ifndef EMBEDDED_LIBRARY
// Save vm id of this process
if (!opt_bootstrap)
create_pid_file();
+#endif /* EMBEDDED_LIBRARY */
}
@@ -2190,7 +2180,7 @@ extern "C" sig_handler handle_segfault(int sig)
segfaulted = 1;
- curr_time= time(NULL);
+ curr_time= my_time(0);
localtime_r(&curr_time, &tm);
fprintf(stderr,"\
@@ -2236,7 +2226,7 @@ the thread stack. Please read http://www.mysql.com/doc/en/Linux.html\n\n",
if (!(test_flags & TEST_NO_STACKTRACE))
{
fprintf(stderr,"thd: 0x%lx\n",(long) thd);
- print_stacktrace(thd ? (gptr) thd->thread_stack : (gptr) 0,
+ print_stacktrace(thd ? (uchar*) thd->thread_stack : (uchar*) 0,
thread_stack);
}
if (thd)
@@ -2263,6 +2253,16 @@ later when used with nscd), disable LDAP in your nsswitch.conf, or use a\n\
mysqld that is not statically linked.\n");
#endif
+#ifdef HAVE_NPTL
+ if (thd_lib_detected == THD_LIB_LT && !getenv("LD_ASSUME_KERNEL"))
+ fprintf(stderr,"\n\
+You are running a statically-linked LinuxThreads binary on an NPTL system.\n\
+This can result in crashes on some distributions due to LT/NPTL conflicts.\n\
+You should either build a dynamically-linked binary, or force LinuxThreads\n\
+to be used with the LD_ASSUME_KERNEL environment variable. Please consult\n\
+the documentation for your distribution on how to do that.\n");
+#endif
+
if (locked_in_memory)
{
fprintf(stderr, "\n\
@@ -2553,7 +2553,9 @@ static void check_data_home(const char *path)
/* ARGSUSED */
-static int my_message_sql(uint error, const char *str, myf MyFlags)
+extern "C" int my_message_sql(uint error, const char *str, myf MyFlags);
+
+int my_message_sql(uint error, const char *str, myf MyFlags)
{
THD *thd;
DBUG_ENTER("my_message_sql");
@@ -2616,15 +2618,18 @@ static int my_message_sql(uint error, const char *str, myf MyFlags)
#ifndef EMBEDDED_LIBRARY
-static void *my_str_malloc_mysqld(size_t size)
+extern "C" void *my_str_malloc_mysqld(size_t size);
+extern "C" void my_str_free_mysqld(void *ptr);
+
+void *my_str_malloc_mysqld(size_t size)
{
return my_malloc(size, MYF(MY_FAE));
}
-static void my_str_free_mysqld(void *ptr)
+void my_str_free_mysqld(void *ptr)
{
- my_free((gptr)ptr, MYF(MY_FAE));
+ my_free((uchar*)ptr, MYF(MY_FAE));
}
#endif /* EMBEDDED_LIBRARY */
@@ -2658,16 +2663,18 @@ int STDCALL handle_kill(ulong ctrl_type)
}
#endif
+#if !defined(EMBEDDED_LIBRARY)
static const char *load_default_groups[]= {
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
"mysql_cluster",
#endif
"mysqld","server", MYSQL_BASE_VERSION, 0, 0};
-#if defined(__WIN__) && !defined(EMBEDDED_LIBRARY)
+#if defined(__WIN__)
static const int load_default_groups_sz=
sizeof(load_default_groups)/sizeof(load_default_groups[0]);
#endif
+#endif /*!EMBEDDED_LIBRARY*/
/*
@@ -2715,13 +2722,13 @@ static bool init_global_datetime_format(timestamp_type format_type,
static int init_common_variables(const char *conf_file_name, int argc,
char **argv, const char **groups)
{
- char buff[FN_REFLEN];
+ char buff[FN_REFLEN], *s;
umask(((~my_umask) & 0666));
my_decimal_set_zero(&decimal_zero); // set decimal_zero constant;
tzset(); // Set tzname
max_system_variables.pseudo_thread_id= (ulong)~0;
- server_start_time= flush_status_time= time((time_t*) 0);
+ server_start_time= flush_status_time= my_time(0);
rpl_filter= new Rpl_filter;
binlog_filter= new Rpl_filter;
if (!rpl_filter || !binlog_filter)
@@ -2767,7 +2774,7 @@ static int init_common_variables(const char *conf_file_name, int argc,
strmake(pidfile_name, STRING_WITH_LEN("mysql"));
}
else
- strmake(pidfile_name, glob_hostname, sizeof(pidfile_name)-5);
+ strmake(pidfile_name, glob_hostname, sizeof(pidfile_name)-5);
strmov(fn_ext(pidfile_name),".pid"); // Add proper extension
/*
@@ -2781,7 +2788,8 @@ static int init_common_variables(const char *conf_file_name, int argc,
load_defaults(conf_file_name, groups, &argc, &argv);
defaults_argv=argv;
- get_options(argc,argv);
+ defaults_argc=argc;
+ get_options(&defaults_argc, defaults_argv);
set_server_version();
DBUG_PRINT("info",("%s Ver %s for %s on %s\n",my_progname,
@@ -2793,10 +2801,6 @@ static int init_common_variables(const char *conf_file_name, int argc,
{
my_use_large_pages= 1;
my_large_page_size= opt_large_page_size;
-#ifdef WITH_INNOBASE_STORAGE_ENGINE
- innobase_use_large_pages= 1;
- innobase_large_page_size= opt_large_page_size;
-#endif
}
#endif /* HAVE_LARGE_PAGES */
@@ -2859,7 +2863,12 @@ static int init_common_variables(const char *conf_file_name, int argc,
if (item_create_init())
return 1;
item_init();
- set_var_init();
+ if (set_var_init())
+ return 1;
+#ifdef HAVE_REPLICATION
+ if (init_replication_sys_vars())
+ return 1;
+#endif
mysys_uses_curses=0;
#ifdef USE_REGEX
my_regex_init(&my_charset_latin1);
@@ -2954,17 +2963,15 @@ static int init_common_variables(const char *conf_file_name, int argc,
&& !(log_output_options & LOG_NONE))
sql_print_warning("Although a path was specified for the "
"--log-slow-queries option, log tables are used. "
- "To enable logging to files use the --log-output option.");
+ "To enable logging to files use the --log-output=file option.");
- if (!opt_logname)
- opt_logname= make_default_log_name(buff, ".log");
- sys_var_general_log_path.value= my_strdup(opt_logname, MYF(0));
- sys_var_general_log_path.value_length= strlen(opt_logname);
+ s= opt_logname ? opt_logname : make_default_log_name(buff, ".log");
+ sys_var_general_log_path.value= my_strdup(s, MYF(0));
+ sys_var_general_log_path.value_length= strlen(s);
- if (!opt_slow_logname)
- opt_slow_logname= make_default_log_name(buff, "-slow.log");
- sys_var_slow_log_path.value= my_strdup(opt_slow_logname, MYF(0));
- sys_var_slow_log_path.value_length= strlen(opt_slow_logname);
+ s= opt_slow_logname ? opt_slow_logname : make_default_log_name(buff, "-slow.log");
+ sys_var_slow_log_path.value= my_strdup(s, MYF(0));
+ sys_var_slow_log_path.value_length= strlen(s);
if (use_temp_pool && bitmap_init(&temp_pool,0,1024,1))
return 1;
@@ -3043,6 +3050,7 @@ static int init_thread_environment()
(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_uuid_generator, MY_MUTEX_INIT_FAST);
@@ -3230,8 +3238,12 @@ static int init_server_components()
/* Setup logs */
- /* enable old-fashioned error log */
- if (opt_error_log)
+ /*
+ Enable old-fashioned error log, except when the user has requested
+ help information. Since the implementation of plugin server
+ variables the help output is now written much later.
+ */
+ if (opt_error_log && !opt_help)
{
if (!log_error_file_ptr[0])
fn_format(log_error_file, pidfile_name, mysql_data_home, ".err",
@@ -3317,14 +3329,14 @@ with --log-bin instead.");
}
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_error("You need to use --log-bin to make "
+ "--binlog-format work.");
+ unireg_abort(1);
+ }
else
- {
- global_system_variables.binlog_format= BINLOG_FORMAT_UNSPEC;
+ {
+ global_system_variables.binlog_format= BINLOG_FORMAT_MIXED;
}
else
if (opt_binlog_format_id == BINLOG_FORMAT_UNSPEC)
@@ -3332,7 +3344,7 @@ with --log-bin instead.");
else
{
DBUG_ASSERT(global_system_variables.binlog_format != BINLOG_FORMAT_UNSPEC);
- }
+ }
/* Check that we have not let the format to unspecified at this point */
DBUG_ASSERT((uint)global_system_variables.binlog_format <=
@@ -3386,12 +3398,51 @@ server.");
using_update_log=1;
}
- if (plugin_init(opt_bootstrap))
+ if (plugin_init(&defaults_argc, defaults_argv,
+ (opt_noacl ? PLUGIN_INIT_SKIP_PLUGIN_TABLE : 0) |
+ (opt_help ? PLUGIN_INIT_SKIP_INITIALIZATION : 0)))
{
- sql_print_error("Failed to init plugins.");
- return 1;
+ sql_print_error("Failed to initialize plugins.");
+ unireg_abort(1);
}
+ if (opt_help)
+ unireg_abort(0);
+
+ /* we do want to exit if there are any other unknown options */
+ if (defaults_argc > 1)
+ {
+ int ho_error;
+ char **tmp_argv= defaults_argv;
+ struct my_option no_opts[]=
+ {
+ {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
+ };
+ /*
+ We need to eat any 'loose' arguments first before we conclude
+ that there are unprocessed options.
+ But we need to preserve defaults_argv pointer intact for
+ free_defaults() to work. Thus we use a copy here.
+ */
+ my_getopt_skip_unknown= 0;
+
+ if ((ho_error= handle_options(&defaults_argc, &tmp_argv, no_opts,
+ mysqld_get_one_option)))
+ unireg_abort(ho_error);
+
+ if (defaults_argc)
+ {
+ fprintf(stderr, "%s: Too many arguments (first extra is '%s').\n"
+ "Use --verbose --help to get a list of available options\n",
+ my_progname, *tmp_argv);
+ unireg_abort(1);
+ }
+ }
+
+ /* if the errmsg.sys is not loaded, terminate to maintain behaviour */
+ if (!errmesg[0][0])
+ unireg_abort(1);
+
/* We have to initialize the storage engines before CSV logging */
if (ha_init())
{
@@ -3420,7 +3471,8 @@ server.");
else
{
/* fall back to the log files if tables are not present */
- if (have_csv_db == SHOW_OPTION_NO)
+ LEX_STRING csv_name={C_STRING_WITH_LEN("csv")};
+ if (!plugin_is_ready(&csv_name, MYSQL_STORAGE_ENGINE_PLUGIN))
{
/* purecov: begin inspected */
sql_print_error("CSV engine is not present, falling back to the "
@@ -3440,11 +3492,16 @@ server.");
/*
Check that the default storage engine is actually available.
*/
+ if (default_storage_engine_str)
{
LEX_STRING name= { default_storage_engine_str,
strlen(default_storage_engine_str) };
- handlerton *hton= ha_resolve_by_name(0, &name);
- if (hton == NULL)
+ plugin_ref plugin;
+ handlerton *hton;
+
+ if ((plugin= ha_resolve_by_name(0, &name)))
+ hton= plugin_data(plugin, handlerton*);
+ else
{
sql_print_error("Unknown/unsupported table type: %s",
default_storage_engine_str);
@@ -3458,9 +3515,17 @@ server.");
default_storage_engine_str);
unireg_abort(1);
}
- hton= myisam_hton;
+ DBUG_ASSERT(global_system_variables.table_plugin);
+ }
+ else
+ {
+ /*
+ Need to unlock as global_system_variables.table_plugin
+ was acquired during plugin_init()
+ */
+ plugin_unlock(0, global_system_variables.table_plugin);
+ global_system_variables.table_plugin= plugin;
}
- global_system_variables.table_type= hton;
}
tc_log= (total_ha_2pc > 1 ? (opt_bin_log ?
@@ -3486,7 +3551,7 @@ server.");
#ifdef HAVE_REPLICATION
if (opt_bin_log && expire_logs_days)
{
- long purge_time= (long) (time(0) - expire_logs_days*24*60*60);
+ time_t purge_time= server_start_time - expire_logs_days*24*60*60;
if (purge_time >= 0)
mysql_bin_log.purge_logs_before_date(purge_time);
}
@@ -3737,11 +3802,12 @@ int main(int argc, char **argv)
We have enough space for fiddling with the argv, continue
*/
check_data_home(mysql_real_data_home);
- if (my_setwd(mysql_real_data_home,MYF(MY_WME)))
+ if (my_setwd(mysql_real_data_home,MYF(MY_WME)) && !opt_help)
unireg_abort(1); /* purecov: inspected */
mysql_data_home= mysql_data_home_buff;
mysql_data_home[0]=FN_CURLIB; // all paths are relative from here
mysql_data_home[1]=0;
+ mysql_data_home_len= 2;
if ((user_info= check_user(mysqld_user)))
{
@@ -3785,6 +3851,11 @@ we force server id to 2, but this MySQL server will not act as a slave.");
freopen(log_error_file,"a+",stderr);
FreeConsole(); // Remove window
}
+ else
+ {
+ /* Don't show error dialog box when on foreground: it stops the server */
+ SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS);
+ }
#endif
/*
@@ -3840,7 +3911,6 @@ we force server id to 2, but this MySQL server will not act as a slave.");
*/
if (init_slave() && !active_mi)
{
- end_thr_alarm(1); // Don't allow alarms
unireg_abort(1);
}
@@ -3848,16 +3918,12 @@ we force server id to 2, but this MySQL server will not act as a slave.");
{
select_thread_in_use= 0; // Allow 'kill' to work
bootstrap(stdin);
- end_thr_alarm(1); // Don't allow alarms
unireg_abort(bootstrap_error ? 1 : 0);
}
if (opt_init_file)
{
if (read_init_file(opt_init_file))
- {
- end_thr_alarm(1); // Don't allow alarms
unireg_abort(1);
- }
}
execute_ddl_log_recovery();
@@ -4229,7 +4295,7 @@ void create_thread_to_handle_connection(THD *thd)
thread_created++;
threads.append(thd);
DBUG_PRINT("info",(("creating thread %lu"), thd->thread_id));
- thd->connect_time = time(NULL);
+ thd->connect_utime= thd->start_utime= my_micro_time();
if ((error=pthread_create(&thd->real_id,&connection_attrib,
handle_one_connection,
(void*) thd)))
@@ -4292,6 +4358,11 @@ static void create_new_thread(THD *thd)
DBUG_VOID_RETURN;
}
pthread_mutex_lock(&LOCK_thread_count);
+ /*
+ The initialization of thread_id is done in create_embedded_thd() for
+ the embedded library.
+ TODO: refactor this to avoid code duplication there
+ */
thd->thread_id= thd->variables.pseudo_thread_id= thread_id++;
/* Start a new thread to handle connection */
@@ -4633,7 +4704,7 @@ pthread_handler_t handle_connections_shared_memory(void *arg)
HANDLE event_connect_answer= 0;
ulong smem_buffer_length= shared_memory_buffer_length + 4;
ulong connect_number= 1;
- char tmp[63];
+ char *tmp= NULL;
char *suffix_pos;
char connect_number_char[22], *p;
const char *errmsg= 0;
@@ -4642,6 +4713,12 @@ pthread_handler_t handle_connections_shared_memory(void *arg)
DBUG_ENTER("handle_connections_shared_memorys");
DBUG_PRINT("general",("Waiting for allocated shared memory."));
+ /*
+ get enough space base-name + '_' + longest suffix we might ever send
+ */
+ if (!(tmp= (char *)my_malloc(strlen(shared_memory_base_name) + 32L, MYF(MY_FAE))))
+ goto error;
+
if (my_security_attr_create(&sa_event, &errmsg,
GENERIC_ALL, SYNCHRONIZE | EVENT_MODIFY_STATE))
goto error;
@@ -4829,6 +4906,9 @@ errorconn:
/* End shared memory handling */
error:
+ if (tmp)
+ my_free(tmp, MYF(0));
+
if (errmsg)
{
char buff[180];
@@ -4871,11 +4951,6 @@ enum options_mysqld
OPT_STORAGE_ENGINE, OPT_INIT_FILE,
OPT_DELAY_KEY_WRITE_ALL, OPT_SLOW_QUERY_LOG,
OPT_DELAY_KEY_WRITE, OPT_CHARSETS_DIR,
- OPT_BDB_HOME, OPT_BDB_LOG,
- OPT_BDB_TMP, OPT_BDB_SYNC,
- OPT_BDB_LOCK, OPT_BDB,
- OPT_BDB_NO_RECOVER, OPT_BDB_SHARED,
- OPT_BDB_DATA_DIRECT, OPT_BDB_LOG_DIRECT,
OPT_MASTER_HOST, OPT_MASTER_USER,
OPT_MASTER_PASSWORD, OPT_MASTER_PORT,
OPT_MASTER_INFO_FILE, OPT_MASTER_CONNECT_RETRY,
@@ -4894,28 +4969,14 @@ enum options_mysqld
OPT_WANT_CORE, OPT_CONCURRENT_INSERT,
OPT_MEMLOCK, OPT_MYISAM_RECOVER,
OPT_REPLICATE_REWRITE_DB, OPT_SERVER_ID,
- OPT_SKIP_SLAVE_START, OPT_SKIP_INNOBASE,
+ OPT_SKIP_SLAVE_START, OPT_SAFE_SHOW_DB,
OPT_SAFEMALLOC_MEM_LIMIT, OPT_REPLICATE_DO_TABLE,
OPT_REPLICATE_IGNORE_TABLE, OPT_REPLICATE_WILD_DO_TABLE,
OPT_REPLICATE_WILD_IGNORE_TABLE, OPT_REPLICATE_SAME_SERVER_ID,
OPT_DISCONNECT_SLAVE_EVENT_COUNT, OPT_TC_HEURISTIC_RECOVER,
OPT_ABORT_SLAVE_EVENT_COUNT,
- OPT_INNODB_DATA_HOME_DIR,
- OPT_INNODB_DATA_FILE_PATH,
- OPT_INNODB_LOG_GROUP_HOME_DIR,
- OPT_INNODB_LOG_ARCH_DIR,
- OPT_INNODB_LOG_ARCHIVE,
- OPT_INNODB_FLUSH_LOG_AT_TRX_COMMIT,
- OPT_INNODB_FLUSH_METHOD,
- OPT_INNODB_DOUBLEWRITE,
- OPT_INNODB_CHECKSUMS,
- OPT_INNODB_FAST_SHUTDOWN,
- OPT_INNODB_FILE_PER_TABLE, OPT_CRASH_BINLOG_INNODB,
- OPT_INNODB_LOCKS_UNSAFE_FOR_BINLOG,
OPT_LOG_BIN_TRUST_FUNCTION_CREATORS,
- OPT_SAFE_SHOW_DB, OPT_INNODB_SAFE_BINLOG,
- OPT_INNODB, OPT_ISAM,
- OPT_ENGINE_CONDITION_PUSHDOWN, OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING,
+ OPT_ENGINE_CONDITION_PUSHDOWN, OPT_NDB_CONNECTSTRING,
OPT_NDB_USE_EXACT_COUNT, OPT_NDB_USE_TRANSACTIONS,
OPT_NDB_FORCE_SEND, OPT_NDB_AUTOINCREMENT_PREFETCH_SZ,
OPT_NDB_SHM, OPT_NDB_OPTIMIZED_NODE_SELECTION, OPT_NDB_CACHE_CHECK_TIME,
@@ -4978,34 +5039,6 @@ enum options_mysqld
OPT_THREAD_CONCURRENCY, OPT_THREAD_CACHE_SIZE,
OPT_TMP_TABLE_SIZE, OPT_THREAD_STACK,
OPT_WAIT_TIMEOUT, OPT_MYISAM_REPAIR_THREADS,
- OPT_INNODB_MIRRORED_LOG_GROUPS,
- OPT_INNODB_LOG_FILES_IN_GROUP,
- OPT_INNODB_LOG_FILE_SIZE,
- OPT_INNODB_LOG_BUFFER_SIZE,
- OPT_INNODB_BUFFER_POOL_SIZE,
- OPT_INNODB_BUFFER_POOL_AWE_MEM_MB,
- OPT_INNODB_ADDITIONAL_MEM_POOL_SIZE,
- OPT_INNODB_MAX_PURGE_LAG,
- OPT_INNODB_FILE_IO_THREADS,
- OPT_INNODB_LOCK_WAIT_TIMEOUT,
- OPT_INNODB_THREAD_CONCURRENCY,
- OPT_INNODB_COMMIT_CONCURRENCY,
- OPT_INNODB_FORCE_RECOVERY,
- OPT_INNODB_STATUS_FILE,
- OPT_INNODB_MAX_DIRTY_PAGES_PCT,
- OPT_INNODB_TABLE_LOCKS,
- OPT_INNODB_SUPPORT_XA,
- OPT_INNODB_OPEN_FILES,
- OPT_INNODB_AUTOEXTEND_INCREMENT,
- OPT_INNODB_SYNC_SPIN_LOOPS,
- OPT_INNODB_CONCURRENCY_TICKETS,
- OPT_INNODB_THREAD_SLEEP_DELAY,
- OPT_INNODB_STATS_ON_METADATA,
- OPT_BDB_CACHE_SIZE,
- OPT_BDB_CACHE_PARTS,
- OPT_BDB_LOG_BUFFER_SIZE,
- OPT_BDB_MAX_LOCK,
- OPT_BDB_REGION_SIZE,
OPT_ERROR_LOG_FILE,
OPT_DEFAULT_WEEK_FORMAT,
OPT_RANGE_ALLOC_BLOCK_SIZE, OPT_ALLOW_SUSPICIOUS_UDFS,
@@ -5015,7 +5048,6 @@ enum options_mysqld
OPT_SYNC_REPLICATION,
OPT_SYNC_REPLICATION_SLAVE_ID,
OPT_SYNC_REPLICATION_TIMEOUT,
- OPT_BDB_NOSYNC,
OPT_ENABLE_SHARED_MEMORY,
OPT_SHARED_MEMORY_BASE_NAME,
OPT_OLD_PASSWORDS,
@@ -5046,16 +5078,19 @@ enum options_mysqld
OPT_OLD_STYLE_USER_LIMITS,
OPT_LOG_SLOW_ADMIN_STATEMENTS,
OPT_TABLE_LOCK_WAIT_TIMEOUT,
+ OPT_PLUGIN_LOAD,
OPT_PLUGIN_DIR,
OPT_LOG_OUTPUT,
OPT_PORT_OPEN_TIMEOUT,
OPT_PROFILING,
+ OPT_KEEP_FILES_ON_CREATE,
OPT_GENERAL_LOG,
OPT_SLOW_LOG,
- OPT_MERGE,
OPT_THREAD_HANDLING,
OPT_INNODB_ROLLBACK_ON_TIMEOUT,
OPT_SECURE_FILE_PRIV,
+ OPT_MIN_EXAMINED_ROW_LIMIT,
+ OPT_LOG_SLOW_SLAVE_STATEMENTS,
OPT_OLD_MODE
};
@@ -5065,12 +5100,12 @@ enum options_mysqld
struct my_option my_long_options[] =
{
{"help", '?', "Display this help and exit.",
- (gptr*) &opt_help, (gptr*) &opt_help, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+ (uchar**) &opt_help, (uchar**) &opt_help, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
#ifdef HAVE_REPLICATION
{"abort-slave-event-count", OPT_ABORT_SLAVE_EVENT_COUNT,
"Option used by mysql-test for debugging and testing of replication.",
- (gptr*) &abort_slave_event_count, (gptr*) &abort_slave_event_count,
+ (uchar**) &abort_slave_event_count, (uchar**) &abort_slave_event_count,
0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif /* HAVE_REPLICATION */
{"allow-suspicious-udfs", OPT_ALLOW_SUSPICIOUS_UDFS,
@@ -5078,33 +5113,33 @@ struct my_option my_long_options[] =
"without corresponding xxx_init() or xxx_deinit(). That also means "
"that one can load any function from any library, for example exit() "
"from libc.so",
- (gptr*) &opt_allow_suspicious_udfs, (gptr*) &opt_allow_suspicious_udfs,
+ (uchar**) &opt_allow_suspicious_udfs, (uchar**) &opt_allow_suspicious_udfs,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"ansi", 'a', "Use ANSI SQL syntax instead of MySQL syntax. This mode will also set transaction isolation level 'serializable'.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"auto-increment-increment", OPT_AUTO_INCREMENT,
"Auto-increment columns are incremented by this",
- (gptr*) &global_system_variables.auto_increment_increment,
- (gptr*) &max_system_variables.auto_increment_increment, 0, GET_ULONG,
+ (uchar**) &global_system_variables.auto_increment_increment,
+ (uchar**) &max_system_variables.auto_increment_increment, 0, GET_ULONG,
OPT_ARG, 1, 1, 65535, 0, 1, 0 },
{"auto-increment-offset", OPT_AUTO_INCREMENT_OFFSET,
"Offset added to Auto-increment columns. Used when auto-increment-increment != 1",
- (gptr*) &global_system_variables.auto_increment_offset,
- (gptr*) &max_system_variables.auto_increment_offset, 0, GET_ULONG, OPT_ARG,
+ (uchar**) &global_system_variables.auto_increment_offset,
+ (uchar**) &max_system_variables.auto_increment_offset, 0, GET_ULONG, OPT_ARG,
1, 1, 65535, 0, 1, 0 },
{"automatic-sp-privileges", OPT_SP_AUTOMATIC_PRIVILEGES,
"Creating and dropping stored procedures alters ACLs. Disable with --skip-automatic-sp-privileges.",
- (gptr*) &sp_automatic_privileges, (gptr*) &sp_automatic_privileges,
+ (uchar**) &sp_automatic_privileges, (uchar**) &sp_automatic_privileges,
0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"basedir", 'b',
"Path to installation directory. All paths are usually resolved relative to this.",
- (gptr*) &mysql_home_ptr, (gptr*) &mysql_home_ptr, 0, GET_STR, REQUIRED_ARG,
+ (uchar**) &mysql_home_ptr, (uchar**) &mysql_home_ptr, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"big-tables", OPT_BIG_TABLES,
"Allow big result sets by saving all temporary sets on file (Solves most 'table full' errors).",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"bind-address", OPT_BIND_ADDRESS, "IP address to bind to.",
- (gptr*) &my_bind_addr_str, (gptr*) &my_bind_addr_str, 0, GET_STR,
+ (uchar**) &my_bind_addr_str, (uchar**) &my_bind_addr_str, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"binlog_format", OPT_BINLOG_FORMAT,
"Does not have any effect without '--log-bin'. "
@@ -5118,9 +5153,8 @@ struct my_option my_long_options[] =
"If ndbcluster is enabled and binlog_format is `mixed', the format switches"
" to 'row' and back implicitly per each query accessing a NDB table."
#endif
- ,(gptr*) &opt_binlog_format, (gptr*) &opt_binlog_format,
- 0, GET_STR, REQUIRED_ARG, BINLOG_FORMAT_MIXED, BINLOG_FORMAT_STMT,
- BINLOG_FORMAT_MIXED, 0, 0, 0},
+ ,(uchar**) &opt_binlog_format, (uchar**) &opt_binlog_format,
+ 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"binlog-do-db", OPT_BINLOG_DO_DB,
"Tells the master it should log updates for the specified database, and exclude all others not explicitly mentioned.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -5131,8 +5165,8 @@ struct my_option my_long_options[] =
"The maximum size of a row-based binary log event in bytes. Rows will be "
"grouped into events smaller than this size if possible. "
"The value has to be a multiple of 256.",
- (gptr*) &opt_binlog_rows_event_max_size,
- (gptr*) &opt_binlog_rows_event_max_size, 0,
+ (uchar**) &opt_binlog_rows_event_max_size,
+ (uchar**) &opt_binlog_rows_event_max_size, 0,
GET_ULONG, REQUIRED_ARG,
/* def_value */ 1024, /* min_value */ 256, /* max_value */ ULONG_MAX,
/* sub_size */ 0, /* block_size */ 256,
@@ -5144,61 +5178,61 @@ struct my_option my_long_options[] =
#endif
{"character-set-client-handshake", OPT_CHARACTER_SET_CLIENT_HANDSHAKE,
"Don't ignore client side character set value sent during handshake.",
- (gptr*) &opt_character_set_client_handshake,
- (gptr*) &opt_character_set_client_handshake,
+ (uchar**) &opt_character_set_client_handshake,
+ (uchar**) &opt_character_set_client_handshake,
0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"character-set-filesystem", OPT_CHARACTER_SET_FILESYSTEM,
"Set the filesystem character set.",
- (gptr*) &character_set_filesystem_name,
- (gptr*) &character_set_filesystem_name,
+ (uchar**) &character_set_filesystem_name,
+ (uchar**) &character_set_filesystem_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{"character-set-server", 'C', "Set the default character set.",
- (gptr*) &default_character_set_name, (gptr*) &default_character_set_name,
+ (uchar**) &default_character_set_name, (uchar**) &default_character_set_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{"character-sets-dir", OPT_CHARSETS_DIR,
- "Directory where character sets are.", (gptr*) &charsets_dir,
- (gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Directory where character sets are.", (uchar**) &charsets_dir,
+ (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"chroot", 'r', "Chroot mysqld daemon during startup.",
- (gptr*) &mysqld_chroot, (gptr*) &mysqld_chroot, 0, GET_STR, REQUIRED_ARG,
+ (uchar**) &mysqld_chroot, (uchar**) &mysqld_chroot, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"collation-server", OPT_DEFAULT_COLLATION, "Set the default collation.",
- (gptr*) &default_collation_name, (gptr*) &default_collation_name,
+ (uchar**) &default_collation_name, (uchar**) &default_collation_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{"completion-type", OPT_COMPLETION_TYPE, "Default completion type.",
- (gptr*) &global_system_variables.completion_type,
- (gptr*) &max_system_variables.completion_type, 0, GET_ULONG,
+ (uchar**) &global_system_variables.completion_type,
+ (uchar**) &max_system_variables.completion_type, 0, GET_ULONG,
REQUIRED_ARG, 0, 0, 2, 0, 1, 0},
{"concurrent-insert", OPT_CONCURRENT_INSERT,
"Use concurrent insert with MyISAM. Disable with --concurrent-insert=0",
- (gptr*) &myisam_concurrent_insert, (gptr*) &myisam_concurrent_insert,
+ (uchar**) &myisam_concurrent_insert, (uchar**) &myisam_concurrent_insert,
0, GET_LONG, OPT_ARG, 1, 0, 2, 0, 0, 0},
{"console", OPT_CONSOLE, "Write error output on screen; Don't remove the console window on windows.",
- (gptr*) &opt_console, (gptr*) &opt_console, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+ (uchar**) &opt_console, (uchar**) &opt_console, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"core-file", OPT_WANT_CORE, "Write core on errors.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
- {"datadir", 'h', "Path to the database root.", (gptr*) &mysql_data_home,
- (gptr*) &mysql_data_home, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"datadir", 'h', "Path to the database root.", (uchar**) &mysql_data_home,
+ (uchar**) &mysql_data_home, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifndef DBUG_OFF
- {"debug", '#', "Debug log.", (gptr*) &default_dbug_option,
- (gptr*) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug", '#', "Debug log.", (uchar**) &default_dbug_option,
+ (uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"default-character-set", 'C', "Set the default character set (deprecated option, use --character-set-server instead).",
- (gptr*) &default_character_set_name, (gptr*) &default_character_set_name,
+ (uchar**) &default_character_set_name, (uchar**) &default_character_set_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{"default-collation", OPT_DEFAULT_COLLATION, "Set the default collation (deprecated option, use --collation-server instead).",
- (gptr*) &default_collation_name, (gptr*) &default_collation_name,
+ (uchar**) &default_collation_name, (uchar**) &default_collation_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{"default-storage-engine", OPT_STORAGE_ENGINE,
"Set the default storage engine (table type) for tables.",
- (gptr*)&default_storage_engine_str, (gptr*)&default_storage_engine_str,
+ (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.",
- (gptr*)&default_storage_engine_str, (gptr*)&default_storage_engine_str,
+ (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.",
- (gptr*) &default_tz_name, (gptr*) &default_tz_name,
+ (uchar**) &default_tz_name, (uchar**) &default_tz_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{"delay-key-write", OPT_DELAY_KEY_WRITE, "Type of DELAY_KEY_WRITE.",
0,0,0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
@@ -5208,33 +5242,33 @@ struct my_option my_long_options[] =
#ifdef HAVE_OPENSSL
{"des-key-file", OPT_DES_KEY_FILE,
"Load keys for des_encrypt() and des_encrypt from given file.",
- (gptr*) &des_key_file, (gptr*) &des_key_file, 0, GET_STR, REQUIRED_ARG,
+ (uchar**) &des_key_file, (uchar**) &des_key_file, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
#endif /* HAVE_OPENSSL */
#ifdef HAVE_REPLICATION
{"disconnect-slave-event-count", OPT_DISCONNECT_SLAVE_EVENT_COUNT,
"Option used by mysql-test for debugging and testing of replication.",
- (gptr*) &disconnect_slave_event_count,
- (gptr*) &disconnect_slave_event_count, 0, GET_INT, REQUIRED_ARG, 0, 0, 0,
+ (uchar**) &disconnect_slave_event_count,
+ (uchar**) &disconnect_slave_event_count, 0, GET_INT, REQUIRED_ARG, 0, 0, 0,
0, 0, 0},
#endif /* HAVE_REPLICATION */
{"enable-locking", OPT_ENABLE_LOCK,
"Deprecated option, use --external-locking instead.",
- (gptr*) &opt_external_locking, (gptr*) &opt_external_locking,
+ (uchar**) &opt_external_locking, (uchar**) &opt_external_locking,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef __NT__
{"enable-named-pipe", OPT_HAVE_NAMED_PIPE, "Enable the named pipe (NT).",
- (gptr*) &opt_enable_named_pipe, (gptr*) &opt_enable_named_pipe, 0, GET_BOOL,
+ (uchar**) &opt_enable_named_pipe, (uchar**) &opt_enable_named_pipe, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"enable-pstack", OPT_DO_PSTACK, "Print a symbolic stack trace on failure.",
- (gptr*) &opt_do_pstack, (gptr*) &opt_do_pstack, 0, GET_BOOL, NO_ARG, 0, 0,
+ (uchar**) &opt_do_pstack, (uchar**) &opt_do_pstack, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0},
{"engine-condition-pushdown",
OPT_ENGINE_CONDITION_PUSHDOWN,
"Push supported query conditions to the storage engine.",
- (gptr*) &global_system_variables.engine_condition_pushdown,
- (gptr*) &global_system_variables.engine_condition_pushdown,
+ (uchar**) &global_system_variables.engine_condition_pushdown,
+ (uchar**) &global_system_variables.engine_condition_pushdown,
0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
/* See how it's handled in get_one_option() */
{"event-scheduler", OPT_EVENT_SCHEDULER, "Enable/disable the event scheduler.",
@@ -5242,7 +5276,7 @@ struct my_option my_long_options[] =
{"exit-info", 'T', "Used for debugging; Use at your own risk!", 0, 0, 0,
GET_LONG, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"external-locking", OPT_USE_LOCKING, "Use system (external) locking (disabled by default). With this option enabled you can run myisamchk to test (not repair) tables while the MySQL server is running. Disable with --skip-external-locking.",
- (gptr*) &opt_external_locking, (gptr*) &opt_external_locking,
+ (uchar**) &opt_external_locking, (uchar**) &opt_external_locking,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"flush", OPT_FLUSH, "Flush tables to disk between SQL commands.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -5250,147 +5284,55 @@ struct my_option my_long_options[] =
easier to do */
{"gdb", OPT_DEBUGGING,
"Set up signals usable for debugging",
- (gptr*) &opt_debugging, (gptr*) &opt_debugging,
+ (uchar**) &opt_debugging, (uchar**) &opt_debugging,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"general-log", OPT_GENERAL_LOG,
- "Enable|disable general log", (gptr*) &opt_log,
- (gptr*) &opt_log, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
+ "Enable|disable general log", (uchar**) &opt_log,
+ (uchar**) &opt_log, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_LARGE_PAGES
{"large-pages", OPT_ENABLE_LARGE_PAGES, "Enable support for large pages. \
Disable with --skip-large-pages.",
- (gptr*) &opt_large_pages, (gptr*) &opt_large_pages, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+ (uchar**) &opt_large_pages, (uchar**) &opt_large_pages, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
#endif
{"init-connect", OPT_INIT_CONNECT, "Command(s) that are executed for each new connection",
- (gptr*) &opt_init_connect, (gptr*) &opt_init_connect, 0, GET_STR_ALLOC,
+ (uchar**) &opt_init_connect, (uchar**) &opt_init_connect, 0, GET_STR_ALLOC,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifndef DISABLE_GRANT_OPTIONS
{"init-file", OPT_INIT_FILE, "Read SQL commands from this file at startup.",
- (gptr*) &opt_init_file, (gptr*) &opt_init_file, 0, GET_STR, REQUIRED_ARG,
+ (uchar**) &opt_init_file, (uchar**) &opt_init_file, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
#endif
{"init-rpl-role", OPT_INIT_RPL_ROLE, "Set the replication role.", 0, 0, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"init-slave", OPT_INIT_SLAVE, "Command(s) that are executed when a slave connects to this master",
- (gptr*) &opt_init_slave, (gptr*) &opt_init_slave, 0, GET_STR_ALLOC,
+ (uchar**) &opt_init_slave, (uchar**) &opt_init_slave, 0, GET_STR_ALLOC,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"innodb", OPT_INNODB, "Enable InnoDB (if this version of MySQL supports it). \
-Disable with --skip-innodb (will save memory).",
- (gptr*) &opt_innodb, (gptr*) &opt_innodb, 0, GET_BOOL, NO_ARG, OPT_INNODB_DEFAULT, 0, 0,
- 0, 0, 0},
-#ifdef WITH_INNOBASE_STORAGE_ENGINE
- {"innodb_checksums", OPT_INNODB_CHECKSUMS, "Enable InnoDB checksums validation (enabled by default). \
-Disable with --skip-innodb-checksums.", (gptr*) &innobase_use_checksums,
- (gptr*) &innobase_use_checksums, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
-#endif
- {"innodb_data_file_path", OPT_INNODB_DATA_FILE_PATH,
- "Path to individual files and their sizes.",
- 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-#ifdef WITH_INNOBASE_STORAGE_ENGINE
- {"innodb_data_home_dir", OPT_INNODB_DATA_HOME_DIR,
- "The common part for InnoDB table spaces.", (gptr*) &innobase_data_home_dir,
- (gptr*) &innobase_data_home_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0,
- 0},
- {"innodb_doublewrite", OPT_INNODB_DOUBLEWRITE, "Enable InnoDB doublewrite buffer (enabled by default). \
-Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite,
- (gptr*) &innobase_use_doublewrite, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
- {"innodb_fast_shutdown", OPT_INNODB_FAST_SHUTDOWN,
- "Speeds up the shutdown process of the InnoDB storage engine. Possible "
- "values are 0, 1 (faster)"
- /*
- NetWare can't close unclosed files, can't automatically kill remaining
- threads, etc, so on this OS we disable the crash-like InnoDB shutdown.
- */
-#ifndef __NETWARE__
- " or 2 (fastest - crash-like)"
-#endif
- ".",
- (gptr*) &innobase_fast_shutdown,
- (gptr*) &innobase_fast_shutdown, 0, GET_ULONG, OPT_ARG, 1, 0,
- IF_NETWARE(1,2), 0, 0, 0},
- {"innodb_file_per_table", OPT_INNODB_FILE_PER_TABLE,
- "Stores each InnoDB table to an .ibd file in the database dir.",
- (gptr*) &innobase_file_per_table,
- (gptr*) &innobase_file_per_table, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"innodb_flush_log_at_trx_commit", OPT_INNODB_FLUSH_LOG_AT_TRX_COMMIT,
- "Set to 0 (write and flush once per second), 1 (write and flush at each commit) or 2 (write at commit, flush once per second).",
- (gptr*) &srv_flush_log_at_trx_commit,
- (gptr*) &srv_flush_log_at_trx_commit,
- 0, GET_ULONG, OPT_ARG, 1, 0, 2, 0, 0, 0},
- {"innodb_flush_method", OPT_INNODB_FLUSH_METHOD,
- "With which method to flush data.", (gptr*) &innobase_unix_file_flush_method,
- (gptr*) &innobase_unix_file_flush_method, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
- 0, 0, 0},
- {"innodb_locks_unsafe_for_binlog", OPT_INNODB_LOCKS_UNSAFE_FOR_BINLOG,
- "Force InnoDB to not use next-key locking, to use only row-level locking.",
- (gptr*) &innobase_locks_unsafe_for_binlog,
- (gptr*) &innobase_locks_unsafe_for_binlog, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"innodb_log_arch_dir", OPT_INNODB_LOG_ARCH_DIR,
- "Where full logs should be archived.", (gptr*) &innobase_log_arch_dir,
- (gptr*) &innobase_log_arch_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"innodb_log_archive", OPT_INNODB_LOG_ARCHIVE,
- "Set to 1 if you want to have logs archived.", 0, 0, 0, GET_LONG, OPT_ARG,
- 0, 0, 0, 0, 0, 0},
- {"innodb_log_group_home_dir", OPT_INNODB_LOG_GROUP_HOME_DIR,
- "Path to InnoDB log files.", (gptr*) &innobase_log_group_home_dir,
- (gptr*) &innobase_log_group_home_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
- 0, 0},
- {"innodb_max_dirty_pages_pct", OPT_INNODB_MAX_DIRTY_PAGES_PCT,
- "Percentage of dirty pages allowed in bufferpool.", (gptr*) &srv_max_buf_pool_modified_pct,
- (gptr*) &srv_max_buf_pool_modified_pct, 0, GET_ULONG, REQUIRED_ARG, 90, 0, 100, 0, 0, 0},
- {"innodb_max_purge_lag", OPT_INNODB_MAX_PURGE_LAG,
- "Desired maximum length of the purge queue (0 = no limit)",
- (gptr*) &srv_max_purge_lag,
- (gptr*) &srv_max_purge_lag, 0, GET_LONG, REQUIRED_ARG, 0, 0, ~0L,
- 0, 1L, 0},
- {"innodb_rollback_on_timeout", OPT_INNODB_ROLLBACK_ON_TIMEOUT,
- "Roll back the complete transaction on lock wait timeout, for 4.x compatibility (disabled by default)",
- (gptr*) &innobase_rollback_on_timeout, (gptr*) &innobase_rollback_on_timeout,
- 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
- {"innodb_status_file", OPT_INNODB_STATUS_FILE,
- "Enable SHOW INNODB STATUS output in the innodb_status.<pid> file",
- (gptr*) &innobase_create_status_file, (gptr*) &innobase_create_status_file,
- 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
- {"innodb_stats_on_metadata", OPT_INNODB_STATS_ON_METADATA,
- "Enable statistics gathering for metadata commands such as SHOW TABLE STATUS (on by default)",
- (gptr*) &innobase_stats_on_metadata, (gptr*) &innobase_stats_on_metadata,
- 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
- {"innodb_support_xa", OPT_INNODB_SUPPORT_XA,
- "Enable InnoDB support for the XA two-phase commit",
- (gptr*) &global_system_variables.innodb_support_xa,
- (gptr*) &global_system_variables.innodb_support_xa,
- 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
- {"innodb_table_locks", OPT_INNODB_TABLE_LOCKS,
- "Enable InnoDB locking in LOCK TABLES",
- (gptr*) &global_system_variables.innodb_table_locks,
- (gptr*) &global_system_variables.innodb_table_locks,
- 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
-#endif /* End WITH_INNOBASE_STORAGE_ENGINE */
- {"language", 'L',
+ {"language", 'L',
"Client error messages in given language. May be given as a full path.",
- (gptr*) &language_ptr, (gptr*) &language_ptr, 0, GET_STR, REQUIRED_ARG,
+ (uchar**) &language_ptr, (uchar**) &language_ptr, 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.",
- (gptr*) &lc_time_names_name,
- (gptr*) &lc_time_names_name,
+ (uchar**) &lc_time_names_name,
+ (uchar**) &lc_time_names_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{"local-infile", OPT_LOCAL_INFILE,
"Enable/disable LOAD DATA LOCAL INFILE (takes values 1|0).",
- (gptr*) &opt_local_infile,
- (gptr*) &opt_local_infile, 0, GET_BOOL, OPT_ARG,
+ (uchar**) &opt_local_infile,
+ (uchar**) &opt_local_infile, 0, GET_BOOL, OPT_ARG,
1, 0, 0, 0, 0, 0},
- {"log", 'l', "Log connections and queries to file.", (gptr*) &opt_logname,
- (gptr*) &opt_logname, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+ {"log", 'l', "Log connections and queries to file.", (uchar**) &opt_logname,
+ (uchar**) &opt_logname, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"log-bin", OPT_BIN_LOG,
"Log update queries in binary format. Optional (but strongly recommended "
"to avoid replication problems if server's hostname changes) argument "
"should be the chosen location for the binary log files.",
- (gptr*) &opt_bin_logname, (gptr*) &opt_bin_logname, 0, GET_STR_ALLOC,
+ (uchar**) &opt_bin_logname, (uchar**) &opt_bin_logname, 0, GET_STR_ALLOC,
OPT_ARG, 0, 0, 0, 0, 0, 0},
{"log-bin-index", OPT_BIN_LOG_INDEX,
"File that holds the names for last binary log files.",
- (gptr*) &opt_binlog_index_name, (gptr*) &opt_binlog_index_name, 0, GET_STR,
+ (uchar**) &opt_binlog_index_name, (uchar**) &opt_binlog_index_name, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifndef TO_BE_REMOVED_IN_5_1_OR_6_0
/*
@@ -5401,7 +5343,7 @@ Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite,
*/
{"log-bin-trust-routine-creators", OPT_LOG_BIN_TRUST_FUNCTION_CREATORS,
"(deprecated) Use log-bin-trust-function-creators.",
- (gptr*) &trust_function_creators, (gptr*) &trust_function_creators, 0,
+ (uchar**) &trust_function_creators, (uchar**) &trust_function_creators, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
/*
@@ -5415,13 +5357,13 @@ Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite,
"Note that if ALL connections to this server ALWAYS use row-based binary "
"logging, the security issues do not exist and the binary logging cannot "
"break, so you can safely set this to 1."
- ,(gptr*) &trust_function_creators, (gptr*) &trust_function_creators, 0,
+ ,(uchar**) &trust_function_creators, (uchar**) &trust_function_creators, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"log-error", OPT_ERROR_LOG_FILE, "Error log file.",
- (gptr*) &log_error_file_ptr, (gptr*) &log_error_file_ptr, 0, GET_STR,
+ (uchar**) &log_error_file_ptr, (uchar**) &log_error_file_ptr, 0, GET_STR,
OPT_ARG, 0, 0, 0, 0, 0, 0},
{"log-isam", OPT_ISAM_LOG, "Log all MyISAM changes to file.",
- (gptr*) &myisam_log_filename, (gptr*) &myisam_log_filename, 0, GET_STR,
+ (uchar**) &myisam_log_filename, (uchar**) &myisam_log_filename, 0, GET_STR,
OPT_ARG, 0, 0, 0, 0, 0, 0},
{"log-long-format", '0',
"Log some extra information to update log. Please note that this option is deprecated; see --log-short-format option.",
@@ -5430,165 +5372,166 @@ Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite,
{"log-output", OPT_LOG_OUTPUT,
"Syntax: log-output[=value[,value...]], where \"value\" could be TABLE, "
"FILE or NONE.",
- (gptr*) &log_output_str, (gptr*) &log_output_str, 0,
+ (uchar**) &log_output_str, (uchar**) &log_output_str, 0,
GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"log-queries-not-using-indexes", OPT_LOG_QUERIES_NOT_USING_INDEXES,
"Log queries that are executed without benefit of any index to the slow log if it is open.",
- (gptr*) &opt_log_queries_not_using_indexes, (gptr*) &opt_log_queries_not_using_indexes,
+ (uchar**) &opt_log_queries_not_using_indexes, (uchar**) &opt_log_queries_not_using_indexes,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"log-short-format", OPT_SHORT_LOG_FORMAT,
"Don't log extra information to update and slow-query logs.",
- (gptr*) &opt_short_log_format, (gptr*) &opt_short_log_format,
+ (uchar**) &opt_short_log_format, (uchar**) &opt_short_log_format,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"log-slave-updates", OPT_LOG_SLAVE_UPDATES,
"Tells the slave to log the updates from the slave thread to the binary log. You will need to turn it on if you plan to daisy-chain the slaves.",
- (gptr*) &opt_log_slave_updates, (gptr*) &opt_log_slave_updates, 0, GET_BOOL,
+ (uchar**) &opt_log_slave_updates, (uchar**) &opt_log_slave_updates, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"log-slow-admin-statements", OPT_LOG_SLOW_ADMIN_STATEMENTS,
"Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements to the slow log if it is open.",
- (gptr*) &opt_log_slow_admin_statements,
- (gptr*) &opt_log_slow_admin_statements,
+ (uchar**) &opt_log_slow_admin_statements,
+ (uchar**) &opt_log_slow_admin_statements,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"log-slow-slave-statements", OPT_LOG_SLOW_SLAVE_STATEMENTS,
+ "Log slow statements executed by slave thread to the slow log if it is open.",
+ (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 this log file. Defaults logging to hostname-slow.log file. Must be enabled to activate other slow log options.",
- (gptr*) &opt_slow_logname, (gptr*) &opt_slow_logname, 0, GET_STR, OPT_ARG,
+ "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.",
+ (uchar**) &opt_slow_logname, (uchar**) &opt_slow_logname, 0, GET_STR, OPT_ARG,
0, 0, 0, 0, 0, 0},
{"log-tc", OPT_LOG_TC,
"Path to transaction coordinator log (used for transactions that affect "
"more than one storage engine, when binary log is disabled)",
- (gptr*) &opt_tc_log_file, (gptr*) &opt_tc_log_file, 0, GET_STR,
+ (uchar**) &opt_tc_log_file, (uchar**) &opt_tc_log_file, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_MMAP
{"log-tc-size", OPT_LOG_TC_SIZE, "Size of transaction coordinator log.",
- (gptr*) &opt_tc_log_size, (gptr*) &opt_tc_log_size, 0, GET_ULONG,
+ (uchar**) &opt_tc_log_size, (uchar**) &opt_tc_log_size, 0, GET_ULONG,
REQUIRED_ARG, TC_LOG_MIN_SIZE, TC_LOG_MIN_SIZE, ~0L, 0, TC_LOG_PAGE_SIZE, 0},
#endif
{"log-update", OPT_UPDATE_LOG,
"The update log is deprecated since version 5.0, is replaced by the binary \
log and this option justs turns on --log-bin instead.",
- (gptr*) &opt_update_logname, (gptr*) &opt_update_logname, 0, GET_STR,
+ (uchar**) &opt_update_logname, (uchar**) &opt_update_logname, 0, GET_STR,
OPT_ARG, 0, 0, 0, 0, 0, 0},
{"log-warnings", 'W', "Log some not critical warnings to the log file.",
- (gptr*) &global_system_variables.log_warnings,
- (gptr*) &max_system_variables.log_warnings, 0, GET_ULONG, OPT_ARG, 1, 0, 0,
+ (uchar**) &global_system_variables.log_warnings,
+ (uchar**) &max_system_variables.log_warnings, 0, GET_ULONG, OPT_ARG, 1, 0, 0,
0, 0, 0},
{"low-priority-updates", OPT_LOW_PRIORITY_UPDATES,
"INSERT/DELETE/UPDATE has lower priority than selects.",
- (gptr*) &global_system_variables.low_priority_updates,
- (gptr*) &max_system_variables.low_priority_updates,
+ (uchar**) &global_system_variables.low_priority_updates,
+ (uchar**) &max_system_variables.low_priority_updates,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"master-connect-retry", OPT_MASTER_CONNECT_RETRY,
"The number of seconds the slave thread will sleep before retrying to connect to the master in case the master goes down or the connection is lost.",
- (gptr*) &master_connect_retry, (gptr*) &master_connect_retry, 0, GET_UINT,
+ (uchar**) &master_connect_retry, (uchar**) &master_connect_retry, 0, GET_UINT,
REQUIRED_ARG, 60, 0, 0, 0, 0, 0},
{"master-host", OPT_MASTER_HOST,
"Master hostname or IP address for replication. If not set, the slave thread will not be started. Note that the setting of master-host will be ignored if there exists a valid master.info file.",
- (gptr*) &master_host, (gptr*) &master_host, 0, GET_STR, REQUIRED_ARG, 0, 0,
+ (uchar**) &master_host, (uchar**) &master_host, 0, GET_STR, REQUIRED_ARG, 0, 0,
0, 0, 0, 0},
{"master-info-file", OPT_MASTER_INFO_FILE,
"The location and name of the file that remembers the master and where the I/O replication \
thread is in the master's binlogs.",
- (gptr*) &master_info_file, (gptr*) &master_info_file, 0, GET_STR,
+ (uchar**) &master_info_file, (uchar**) &master_info_file, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"master-password", OPT_MASTER_PASSWORD,
"The password the slave thread will authenticate with when connecting to the master. If not set, an empty password is assumed.The value in master.info will take precedence if it can be read.",
- (gptr*)&master_password, (gptr*)&master_password, 0,
+ (uchar**)&master_password, (uchar**)&master_password, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"master-port", OPT_MASTER_PORT,
"The port the master is listening on. If not set, the compiled setting of MYSQL_PORT is assumed. If you have not tinkered with configure options, this should be 3306. The value in master.info will take precedence if it can be read.",
- (gptr*) &master_port, (gptr*) &master_port, 0, GET_UINT, REQUIRED_ARG,
+ (uchar**) &master_port, (uchar**) &master_port, 0, GET_UINT, REQUIRED_ARG,
MYSQL_PORT, 0, 0, 0, 0, 0},
{"master-retry-count", OPT_MASTER_RETRY_COUNT,
"The number of tries the slave will make to connect to the master before giving up.",
- (gptr*) &master_retry_count, (gptr*) &master_retry_count, 0, GET_ULONG,
+ (uchar**) &master_retry_count, (uchar**) &master_retry_count, 0, GET_ULONG,
REQUIRED_ARG, 3600*24, 0, 0, 0, 0, 0},
{"master-ssl", OPT_MASTER_SSL,
"Enable the slave to connect to the master using SSL.",
- (gptr*) &master_ssl, (gptr*) &master_ssl, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+ (uchar**) &master_ssl, (uchar**) &master_ssl, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"master-ssl-ca", OPT_MASTER_SSL_CA,
"Master SSL CA file. Only applies if you have enabled master-ssl.",
- (gptr*) &master_ssl_ca, (gptr*) &master_ssl_ca, 0, GET_STR, OPT_ARG,
+ (uchar**) &master_ssl_ca, (uchar**) &master_ssl_ca, 0, GET_STR, OPT_ARG,
0, 0, 0, 0, 0, 0},
{"master-ssl-capath", OPT_MASTER_SSL_CAPATH,
"Master SSL CA path. Only applies if you have enabled master-ssl.",
- (gptr*) &master_ssl_capath, (gptr*) &master_ssl_capath, 0, GET_STR, OPT_ARG,
+ (uchar**) &master_ssl_capath, (uchar**) &master_ssl_capath, 0, GET_STR, OPT_ARG,
0, 0, 0, 0, 0, 0},
{"master-ssl-cert", OPT_MASTER_SSL_CERT,
"Master SSL certificate file name. Only applies if you have enabled \
master-ssl",
- (gptr*) &master_ssl_cert, (gptr*) &master_ssl_cert, 0, GET_STR, OPT_ARG,
+ (uchar**) &master_ssl_cert, (uchar**) &master_ssl_cert, 0, GET_STR, OPT_ARG,
0, 0, 0, 0, 0, 0},
{"master-ssl-cipher", OPT_MASTER_SSL_CIPHER,
"Master SSL cipher. Only applies if you have enabled master-ssl.",
- (gptr*) &master_ssl_cipher, (gptr*) &master_ssl_capath, 0, GET_STR, OPT_ARG,
+ (uchar**) &master_ssl_cipher, (uchar**) &master_ssl_capath, 0, GET_STR, OPT_ARG,
0, 0, 0, 0, 0, 0},
{"master-ssl-key", OPT_MASTER_SSL_KEY,
"Master SSL keyfile name. Only applies if you have enabled master-ssl.",
- (gptr*) &master_ssl_key, (gptr*) &master_ssl_key, 0, GET_STR, OPT_ARG,
+ (uchar**) &master_ssl_key, (uchar**) &master_ssl_key, 0, GET_STR, OPT_ARG,
0, 0, 0, 0, 0, 0},
{"master-user", OPT_MASTER_USER,
"The username the slave thread will use for authentication when connecting to the master. The user must have FILE privilege. If the master user is not set, user test is assumed. The value in master.info will take precedence if it can be read.",
- (gptr*) &master_user, (gptr*) &master_user, 0, GET_STR, REQUIRED_ARG, 0, 0,
+ (uchar**) &master_user, (uchar**) &master_user, 0, GET_STR, REQUIRED_ARG, 0, 0,
0, 0, 0, 0},
#ifdef HAVE_REPLICATION
{"max-binlog-dump-events", OPT_MAX_BINLOG_DUMP_EVENTS,
"Option used by mysql-test for debugging and testing of replication.",
- (gptr*) &max_binlog_dump_events, (gptr*) &max_binlog_dump_events, 0,
+ (uchar**) &max_binlog_dump_events, (uchar**) &max_binlog_dump_events, 0,
GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif /* HAVE_REPLICATION */
- {"memlock", OPT_MEMLOCK, "Lock mysqld in memory.", (gptr*) &locked_in_memory,
- (gptr*) &locked_in_memory, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"memlock", OPT_MEMLOCK, "Lock mysqld in memory.", (uchar**) &locked_in_memory,
+ (uchar**) &locked_in_memory, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"myisam-recover", OPT_MYISAM_RECOVER,
"Syntax: myisam-recover[=option[,option...]], where option can be DEFAULT, BACKUP, FORCE or QUICK.",
- (gptr*) &myisam_recover_options_str, (gptr*) &myisam_recover_options_str, 0,
+ (uchar**) &myisam_recover_options_str, (uchar**) &myisam_recover_options_str, 0,
GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
- {"ndbcluster", OPT_NDBCLUSTER, "Enable NDB Cluster (if this version of MySQL supports it). \
-Disable with --skip-ndbcluster (will save memory).",
- (gptr*) &opt_ndbcluster, (gptr*) &opt_ndbcluster, 0, GET_BOOL, NO_ARG,
- OPT_NDBCLUSTER_DEFAULT, 0, 0, 0, 0, 0},
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
{"ndb-connectstring", OPT_NDB_CONNECTSTRING,
"Connect string for ndbcluster.",
- (gptr*) &opt_ndb_connectstring,
- (gptr*) &opt_ndb_connectstring,
+ (uchar**) &opt_ndb_connectstring,
+ (uchar**) &opt_ndb_connectstring,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"ndb-mgmd-host", OPT_NDB_MGMD,
"Set host and port for ndb_mgmd. Syntax: hostname[:port]",
- (gptr*) &opt_ndb_mgmd,
- (gptr*) &opt_ndb_mgmd,
+ (uchar**) &opt_ndb_mgmd,
+ (uchar**) &opt_ndb_mgmd,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"ndb-nodeid", OPT_NDB_NODEID,
"Nodeid for this mysqlserver in the cluster.",
- (gptr*) &opt_ndb_nodeid,
- (gptr*) &opt_ndb_nodeid,
+ (uchar**) &opt_ndb_nodeid,
+ (uchar**) &opt_ndb_nodeid,
0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"ndb-autoincrement-prefetch-sz", OPT_NDB_AUTOINCREMENT_PREFETCH_SZ,
"Specify number of autoincrement values that are prefetched.",
- (gptr*) &global_system_variables.ndb_autoincrement_prefetch_sz,
- (gptr*) &global_system_variables.ndb_autoincrement_prefetch_sz,
+ (uchar**) &global_system_variables.ndb_autoincrement_prefetch_sz,
+ (uchar**) &global_system_variables.ndb_autoincrement_prefetch_sz,
0, GET_ULONG, REQUIRED_ARG, 32, 1, 256, 0, 0, 0},
{"ndb-distribution", OPT_NDB_DISTRIBUTION,
"Default distribution for new tables in ndb",
- (gptr*) &opt_ndb_distribution,
- (gptr*) &opt_ndb_distribution,
+ (uchar**) &opt_ndb_distribution,
+ (uchar**) &opt_ndb_distribution,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"ndb-force-send", OPT_NDB_FORCE_SEND,
"Force send of buffers to ndb immediately without waiting for "
"other threads.",
- (gptr*) &global_system_variables.ndb_force_send,
- (gptr*) &global_system_variables.ndb_force_send,
+ (uchar**) &global_system_variables.ndb_force_send,
+ (uchar**) &global_system_variables.ndb_force_send,
0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
{"ndb_force_send", OPT_NDB_FORCE_SEND,
"same as --ndb-force-send.",
- (gptr*) &global_system_variables.ndb_force_send,
- (gptr*) &global_system_variables.ndb_force_send,
+ (uchar**) &global_system_variables.ndb_force_send,
+ (uchar**) &global_system_variables.ndb_force_send,
0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
{"ndb-extra-logging", OPT_NDB_EXTRA_LOGGING,
"Turn on more logging in the error log.",
- (gptr*) &ndb_extra_logging,
- (gptr*) &ndb_extra_logging,
+ (uchar**) &ndb_extra_logging,
+ (uchar**) &ndb_extra_logging,
0, GET_INT, OPT_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_NDB_BINLOG
{"ndb-report-thresh-binlog-epoch-slip", OPT_NDB_REPORT_THRESH_BINLOG_EPOCH_SLIP,
@@ -5596,100 +5539,100 @@ Disable with --skip-ndbcluster (will save memory).",
"E.g. 3 means that if the difference between what epoch has been received "
"from the storage nodes and what has been applied to the binlog is 3 or more, "
"a status message will be sent to the cluster log.",
- (gptr*) &ndb_report_thresh_binlog_epoch_slip,
- (gptr*) &ndb_report_thresh_binlog_epoch_slip,
+ (uchar**) &ndb_report_thresh_binlog_epoch_slip,
+ (uchar**) &ndb_report_thresh_binlog_epoch_slip,
0, GET_ULONG, REQUIRED_ARG, 3, 0, 256, 0, 0, 0},
{"ndb-report-thresh-binlog-mem-usage", OPT_NDB_REPORT_THRESH_BINLOG_MEM_USAGE,
"Threshold on percentage of free memory before reporting binlog status. E.g. "
"10 means that if amount of available memory for receiving binlog data from "
"the storage nodes goes below 10%, "
"a status message will be sent to the cluster log.",
- (gptr*) &ndb_report_thresh_binlog_mem_usage,
- (gptr*) &ndb_report_thresh_binlog_mem_usage,
+ (uchar**) &ndb_report_thresh_binlog_mem_usage,
+ (uchar**) &ndb_report_thresh_binlog_mem_usage,
0, GET_ULONG, REQUIRED_ARG, 10, 0, 100, 0, 0, 0},
#endif
{"ndb-use-exact-count", OPT_NDB_USE_EXACT_COUNT,
"Use exact records count during query planning and for fast "
"select count(*), disable for faster queries.",
- (gptr*) &global_system_variables.ndb_use_exact_count,
- (gptr*) &global_system_variables.ndb_use_exact_count,
+ (uchar**) &global_system_variables.ndb_use_exact_count,
+ (uchar**) &global_system_variables.ndb_use_exact_count,
0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
{"ndb_use_exact_count", OPT_NDB_USE_EXACT_COUNT,
"same as --ndb-use-exact-count.",
- (gptr*) &global_system_variables.ndb_use_exact_count,
- (gptr*) &global_system_variables.ndb_use_exact_count,
+ (uchar**) &global_system_variables.ndb_use_exact_count,
+ (uchar**) &global_system_variables.ndb_use_exact_count,
0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
{"ndb-use-transactions", OPT_NDB_USE_TRANSACTIONS,
"Use transactions for large inserts, if enabled then large "
"inserts will be split into several smaller transactions",
- (gptr*) &global_system_variables.ndb_use_transactions,
- (gptr*) &global_system_variables.ndb_use_transactions,
+ (uchar**) &global_system_variables.ndb_use_transactions,
+ (uchar**) &global_system_variables.ndb_use_transactions,
0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
{"ndb_use_transactions", OPT_NDB_USE_TRANSACTIONS,
"same as --ndb-use-transactions.",
- (gptr*) &global_system_variables.ndb_use_transactions,
- (gptr*) &global_system_variables.ndb_use_transactions,
+ (uchar**) &global_system_variables.ndb_use_transactions,
+ (uchar**) &global_system_variables.ndb_use_transactions,
0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
{"ndb-shm", OPT_NDB_SHM,
"Use shared memory connections when available.",
- (gptr*) &opt_ndb_shm,
- (gptr*) &opt_ndb_shm,
+ (uchar**) &opt_ndb_shm,
+ (uchar**) &opt_ndb_shm,
0, GET_BOOL, OPT_ARG, OPT_NDB_SHM_DEFAULT, 0, 0, 0, 0, 0},
{"ndb-optimized-node-selection", OPT_NDB_OPTIMIZED_NODE_SELECTION,
"Select nodes for transactions in a more optimal way.",
- (gptr*) &opt_ndb_optimized_node_selection,
- (gptr*) &opt_ndb_optimized_node_selection,
+ (uchar**) &opt_ndb_optimized_node_selection,
+ (uchar**) &opt_ndb_optimized_node_selection,
0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
{ "ndb-cache-check-time", OPT_NDB_CACHE_CHECK_TIME,
"A dedicated thread is created to, at the given millisecons interval, invalidate the query cache if another MySQL server in the cluster has changed the data in the database.",
- (gptr*) &opt_ndb_cache_check_time, (gptr*) &opt_ndb_cache_check_time, 0, GET_ULONG, REQUIRED_ARG,
+ (uchar**) &opt_ndb_cache_check_time, (uchar**) &opt_ndb_cache_check_time, 0, GET_ULONG, REQUIRED_ARG,
0, 0, LONG_TIMEOUT, 0, 1, 0},
{"ndb-index-stat-enable", OPT_NDB_INDEX_STAT_ENABLE,
"Use ndb index statistics in query optimization.",
- (gptr*) &global_system_variables.ndb_index_stat_enable,
- (gptr*) &max_system_variables.ndb_index_stat_enable,
+ (uchar**) &global_system_variables.ndb_index_stat_enable,
+ (uchar**) &max_system_variables.ndb_index_stat_enable,
0, GET_BOOL, OPT_ARG, 0, 0, 1, 0, 0, 0},
#endif
{"ndb-use-copying-alter-table",
OPT_NDB_USE_COPYING_ALTER_TABLE,
"Force ndbcluster to always copy tables at alter table (should only be used if on-line alter table fails).",
- (gptr*) &global_system_variables.ndb_use_copying_alter_table,
- (gptr*) &global_system_variables.ndb_use_copying_alter_table,
+ (uchar**) &global_system_variables.ndb_use_copying_alter_table,
+ (uchar**) &global_system_variables.ndb_use_copying_alter_table,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"new", 'n', "Use very new possible 'unsafe' functions.",
- (gptr*) &global_system_variables.new_mode,
- (gptr*) &max_system_variables.new_mode,
+ (uchar**) &global_system_variables.new_mode,
+ (uchar**) &max_system_variables.new_mode,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef NOT_YET
{"no-mix-table-types", OPT_NO_MIX_TYPE, "Don't allow commands with uses two different table types.",
- (gptr*) &opt_no_mix_types, (gptr*) &opt_no_mix_types, 0, GET_BOOL, NO_ARG,
+ (uchar**) &opt_no_mix_types, (uchar**) &opt_no_mix_types, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
#endif
{"old-alter-table", OPT_OLD_ALTER_TABLE,
"Use old, non-optimized alter table.",
- (gptr*) &global_system_variables.old_alter_table,
- (gptr*) &max_system_variables.old_alter_table, 0, GET_BOOL, NO_ARG,
+ (uchar**) &global_system_variables.old_alter_table,
+ (uchar**) &max_system_variables.old_alter_table, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
{"old-passwords", OPT_OLD_PASSWORDS, "Use old password encryption method (needed for 4.0 and older clients).",
- (gptr*) &global_system_variables.old_passwords,
- (gptr*) &max_system_variables.old_passwords, 0, GET_BOOL, NO_ARG,
+ (uchar**) &global_system_variables.old_passwords,
+ (uchar**) &max_system_variables.old_passwords, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
{"one-thread", OPT_ONE_THREAD,
"(deprecated): Only use one thread (for debugging under Linux). Use thread-handling=no-threads instead",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"old-style-user-limits", OPT_OLD_STYLE_USER_LIMITS,
"Enable old-style user limits (before 5.0.3 user resources were counted per each user+host vs. per account)",
- (gptr*) &opt_old_style_user_limits, (gptr*) &opt_old_style_user_limits,
+ (uchar**) &opt_old_style_user_limits, (uchar**) &opt_old_style_user_limits,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"pid-file", OPT_PID_FILE, "Pid file used by safe_mysqld.",
- (gptr*) &pidfile_name_ptr, (gptr*) &pidfile_name_ptr, 0, GET_STR,
+ (uchar**) &pidfile_name_ptr, (uchar**) &pidfile_name_ptr, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"port", 'P', "Port number to use for connection.", (gptr*) &mysqld_port,
- (gptr*) &mysqld_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"port", 'P', "Port number to use for connection.", (uchar**) &mysqld_port,
+ (uchar**) &mysqld_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"port-open-timeout", OPT_PORT_OPEN_TIMEOUT,
"Maximum time in seconds to wait for the port to become free. "
- "(Default: no wait)", (gptr*) &mysqld_port_timeout,
- (gptr*) &mysqld_port_timeout, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "(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)
{"profiling_history_size", OPT_PROFILING, "Limit of query profiling memory",
(gptr*) &global_system_variables.profiling_history_size,
@@ -5698,17 +5641,17 @@ Disable with --skip-ndbcluster (will save memory).",
#endif
{"relay-log", OPT_RELAY_LOG,
"The location and name to use for relay logs.",
- (gptr*) &opt_relay_logname, (gptr*) &opt_relay_logname, 0,
+ (uchar**) &opt_relay_logname, (uchar**) &opt_relay_logname, 0,
GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"relay-log-index", OPT_RELAY_LOG_INDEX,
"The location and name to use for the file that keeps a list of the last \
relay logs.",
- (gptr*) &opt_relaylog_index_name, (gptr*) &opt_relaylog_index_name, 0,
+ (uchar**) &opt_relaylog_index_name, (uchar**) &opt_relaylog_index_name, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"relay-log-info-file", OPT_RELAY_LOG_INFO_FILE,
"The location and name of the file that remembers where the SQL replication \
thread is in the relay logs.",
- (gptr*) &relay_log_info_file, (gptr*) &relay_log_info_file, 0, GET_STR,
+ (uchar**) &relay_log_info_file, (uchar**) &relay_log_info_file, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"replicate-do-db", OPT_REPLICATE_DO_DB,
"Tells the slave thread to restrict replication to the specified database. To specify more than one database, use the directive multiple times, once for each database. Note that this will only work if you do not use cross-database queries such as UPDATE some_db.some_table SET foo='bar' while having selected a different or no database. If you need cross database updates to work, make sure you have 3.23.28 or later, and use replicate-wild-do-table=db_name.%.",
@@ -5730,8 +5673,8 @@ thread is in the relay logs.",
"In replication, if set to 1, do not skip events having our server id. \
Default value is 0 (to break infinite loops in circular replication). \
Can't be set to 1 if --log-slave-updates is used.",
- (gptr*) &replicate_same_server_id,
- (gptr*) &replicate_same_server_id,
+ (uchar**) &replicate_same_server_id,
+ (uchar**) &replicate_same_server_id,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"replicate-wild-do-table", OPT_REPLICATE_WILD_DO_TABLE,
@@ -5743,19 +5686,19 @@ Can't be set to 1 if --log-slave-updates is used.",
// In replication, we may need to tell the other servers how to connect
{"report-host", OPT_REPORT_HOST,
"Hostname or IP of the slave to be reported to to the master during slave registration. Will appear in the output of SHOW SLAVE HOSTS. Leave unset if you do not want the slave to register itself with the master. Note that it is not sufficient for the master to simply read the IP of the slave off the socket once the slave connects. Due to NAT and other routing issues, that IP may not be valid for connecting to the slave from the master or other hosts.",
- (gptr*) &report_host, (gptr*) &report_host, 0, GET_STR, REQUIRED_ARG, 0, 0,
+ (uchar**) &report_host, (uchar**) &report_host, 0, GET_STR, REQUIRED_ARG, 0, 0,
0, 0, 0, 0},
{"report-password", OPT_REPORT_PASSWORD, "Undocumented.",
- (gptr*) &report_password, (gptr*) &report_password, 0, GET_STR,
+ (uchar**) &report_password, (uchar**) &report_password, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"report-port", OPT_REPORT_PORT,
"Port for connecting to slave reported to the master during slave registration. Set it only if the slave is listening on a non-default port or if you have a special tunnel from the master or other clients to the slave. If not sure, leave this option unset.",
- (gptr*) &report_port, (gptr*) &report_port, 0, GET_UINT, REQUIRED_ARG,
+ (uchar**) &report_port, (uchar**) &report_port, 0, GET_UINT, REQUIRED_ARG,
MYSQL_PORT, 0, 0, 0, 0, 0},
- {"report-user", OPT_REPORT_USER, "Undocumented.", (gptr*) &report_user,
- (gptr*) &report_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"report-user", OPT_REPORT_USER, "Undocumented.", (uchar**) &report_user,
+ (uchar**) &report_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"rpl-recovery-rank", OPT_RPL_RECOVERY_RANK, "Undocumented.",
- (gptr*) &rpl_recovery_rank, (gptr*) &rpl_recovery_rank, 0, GET_ULONG,
+ (uchar**) &rpl_recovery_rank, (uchar**) &rpl_recovery_rank, 0, GET_ULONG,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"safe-mode", OPT_SAFE, "Skip some optimize stages (for testing).",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -5766,43 +5709,43 @@ Can't be set to 1 if --log-slave-updates is used.",
#endif
{"safe-user-create", OPT_SAFE_USER_CREATE,
"Don't allow new user creation by the user who has no write privileges to the mysql.user table.",
- (gptr*) &opt_safe_user_create, (gptr*) &opt_safe_user_create, 0, GET_BOOL,
+ (uchar**) &opt_safe_user_create, (uchar**) &opt_safe_user_create, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"safemalloc-mem-limit", OPT_SAFEMALLOC_MEM_LIMIT,
"Simulate memory shortage when compiled with the --with-debug=full option.",
0, 0, 0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"secure-auth", OPT_SECURE_AUTH, "Disallow authentication for accounts that have old (pre-4.1) passwords.",
- (gptr*) &opt_secure_auth, (gptr*) &opt_secure_auth, 0, GET_BOOL, NO_ARG,
+ (uchar**) &opt_secure_auth, (uchar**) &opt_secure_auth, 0, GET_BOOL, NO_ARG,
my_bool(0), 0, 0, 0, 0, 0},
{"secure-file-priv", OPT_SECURE_FILE_PRIV,
"Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to files within specified directory",
- (gptr*) &opt_secure_file_priv, (gptr*) &opt_secure_file_priv, 0,
+ (uchar**) &opt_secure_file_priv, (uchar**) &opt_secure_file_priv, 0,
GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"server-id", OPT_SERVER_ID,
"Uniquely identifies the server instance in the community of replication partners.",
- (gptr*) &server_id, (gptr*) &server_id, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 0,
+ (uchar**) &server_id, (uchar**) &server_id, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 0,
0, 0, 0},
{"set-variable", 'O',
"Change the value of a variable. Please note that this option is deprecated;you can set variables directly with --variable-name=value.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM
{"shared-memory", OPT_ENABLE_SHARED_MEMORY,
- "Enable the shared memory.",(gptr*) &opt_enable_shared_memory, (gptr*) &opt_enable_shared_memory,
+ "Enable the shared memory.",(uchar**) &opt_enable_shared_memory, (uchar**) &opt_enable_shared_memory,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
#ifdef HAVE_SMEM
{"shared-memory-base-name",OPT_SHARED_MEMORY_BASE_NAME,
- "Base name of shared memory.", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
+ "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"show-slave-auth-info", OPT_SHOW_SLAVE_AUTH_INFO,
"Show user and password in SHOW SLAVE HOSTS on this master",
- (gptr*) &opt_show_slave_auth_info, (gptr*) &opt_show_slave_auth_info, 0,
+ (uchar**) &opt_show_slave_auth_info, (uchar**) &opt_show_slave_auth_info, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifndef DISABLE_GRANT_OPTIONS
{"skip-grant-tables", OPT_SKIP_GRANT,
"Start without grant tables. This gives all users FULL ACCESS to all tables!",
- (gptr*) &opt_noacl, (gptr*) &opt_noacl, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
+ (uchar**) &opt_noacl, (uchar**) &opt_noacl, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0},
#endif
{"skip-host-cache", OPT_SKIP_HOST_CACHE, "Don't cache host names.", 0, 0, 0,
@@ -5829,8 +5772,8 @@ Can't be set to 1 if --log-slave-updates is used.",
"Don't allow 'SHOW DATABASE' commands.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
0, 0, 0, 0},
{"skip-slave-start", OPT_SKIP_SLAVE_START,
- "If set, slave is not autostarted.", (gptr*) &opt_skip_slave_start,
- (gptr*) &opt_skip_slave_start, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ "If set, slave is not autostarted.", (uchar**) &opt_skip_slave_start,
+ (uchar**) &opt_skip_slave_start, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"skip-stack-trace", OPT_SKIP_STACK_TRACE,
"Don't print a stack trace on failure.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
0, 0, 0, 0},
@@ -5843,23 +5786,23 @@ Can't be set to 1 if --log-slave-updates is used.",
{"slave-load-tmpdir", OPT_SLAVE_LOAD_TMPDIR,
"The location where the slave should put its temporary files when \
replicating a LOAD DATA INFILE command.",
- (gptr*) &slave_load_tmpdir, (gptr*) &slave_load_tmpdir, 0, GET_STR_ALLOC,
+ (uchar**) &slave_load_tmpdir, (uchar**) &slave_load_tmpdir, 0, GET_STR_ALLOC,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"slave-skip-errors", OPT_SLAVE_SKIP_ERRORS,
"Tells the slave thread to continue replication when a query returns an error from the provided list.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"slow-query-log", OPT_SLOW_LOG,
- "Enable|disable slow query log", (gptr*) &opt_slow_log,
- (gptr*) &opt_slow_log, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
+ "Enable|disable slow query log", (uchar**) &opt_slow_log,
+ (uchar**) &opt_slow_log, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"socket", OPT_SOCKET, "Socket file to use for connection.",
- (gptr*) &mysqld_unix_port, (gptr*) &mysqld_unix_port, 0, GET_STR,
+ (uchar**) &mysqld_unix_port, (uchar**) &mysqld_unix_port, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_REPLICATION
{"sporadic-binlog-dump-fail", OPT_SPORADIC_BINLOG_DUMP_FAIL,
"Option used by mysql-test for debugging and testing of replication.",
- (gptr*) &opt_sporadic_binlog_dump_fail,
- (gptr*) &opt_sporadic_binlog_dump_fail, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
+ (uchar**) &opt_sporadic_binlog_dump_fail,
+ (uchar**) &opt_sporadic_binlog_dump_fail, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0},
#endif /* HAVE_REPLICATION */
{"sql-bin-update-same", OPT_SQL_BIN_UPDATE_SAME,
@@ -5868,7 +5811,7 @@ log and this option does nothing anymore.",
0, 0, 0, GET_DISABLED, NO_ARG, 0, 0, 0, 0, 0, 0},
{"sql-mode", OPT_SQL_MODE,
"Syntax: sql-mode=option[,option[,option...]] where option can be one of: REAL_AS_FLOAT, PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, ONLY_FULL_GROUP_BY, NO_UNSIGNED_SUBTRACTION.",
- (gptr*) &sql_mode_str, (gptr*) &sql_mode_str, 0, GET_STR, REQUIRED_ARG, 0,
+ (uchar**) &sql_mode_str, (uchar**) &sql_mode_str, 0, GET_STR, REQUIRED_ARG, 0,
0, 0, 0, 0, 0},
#ifdef HAVE_OPENSSL
#include "sslopt-longopts.h"
@@ -5879,7 +5822,7 @@ log and this option does nothing anymore.",
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"symbolic-links", 's', "Enable symbolic link support.",
- (gptr*) &my_use_symdir, (gptr*) &my_use_symdir, 0, GET_BOOL, NO_ARG,
+ (uchar**) &my_use_symdir, (uchar**) &my_use_symdir, 0, GET_BOOL, NO_ARG,
/*
The system call realpath() produces warnings under valgrind and
purify. These are not suppressed: instead we disable symlinks
@@ -5888,19 +5831,19 @@ log and this option does nothing anymore.",
IF_PURIFY(0,1), 0, 0, 0, 0, 0},
{"sysdate-is-now", OPT_SYSDATE_IS_NOW,
"Non-default option to alias SYSDATE() to NOW() to make it safe-replicable. Since 5.0, SYSDATE() returns a `dynamic' value different for different invocations, even within the same statement.",
- (gptr*) &global_system_variables.sysdate_is_now,
+ (uchar**) &global_system_variables.sysdate_is_now,
0, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0},
{"tc-heuristic-recover", OPT_TC_HEURISTIC_RECOVER,
"Decision to use in heuristic recover process. Possible values are COMMIT or ROLLBACK.",
- (gptr*) &opt_tc_heuristic_recover, (gptr*) &opt_tc_heuristic_recover,
+ (uchar**) &opt_tc_heuristic_recover, (uchar**) &opt_tc_heuristic_recover,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"temp-pool", OPT_TEMP_POOL,
"Using this option will cause most temporary files created to use a small set of names, rather than a unique name for each new file.",
- (gptr*) &use_temp_pool, (gptr*) &use_temp_pool, 0, GET_BOOL, NO_ARG, 1,
+ (uchar**) &use_temp_pool, (uchar**) &use_temp_pool, 0, GET_BOOL, NO_ARG, 1,
0, 0, 0, 0, 0},
{"timed_mutexes", OPT_TIMED_MUTEXES,
"Specify whether to time mutexes (only InnoDB mutexes are currently supported)",
- (gptr*) &timed_mutexes, (gptr*) &timed_mutexes, 0, GET_BOOL, NO_ARG, 0,
+ (uchar**) &timed_mutexes, (uchar**) &timed_mutexes, 0, GET_BOOL, NO_ARG, 0,
0, 0, 0, 0, 0},
{"tmpdir", 't',
"Path for temporary files. Several paths may be specified, separated by a "
@@ -5910,83 +5853,83 @@ log and this option does nothing anymore.",
"colon (:)"
#endif
", in this case they are used in a round-robin fashion.",
- (gptr*) &opt_mysql_tmpdir,
- (gptr*) &opt_mysql_tmpdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ (uchar**) &opt_mysql_tmpdir,
+ (uchar**) &opt_mysql_tmpdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"transaction-isolation", OPT_TX_ISOLATION,
"Default transaction isolation level.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0,
0, 0, 0, 0, 0},
{"use-symbolic-links", 's', "Enable symbolic link support. Deprecated option; use --symbolic-links instead.",
- (gptr*) &my_use_symdir, (gptr*) &my_use_symdir, 0, GET_BOOL, NO_ARG,
+ (uchar**) &my_use_symdir, (uchar**) &my_use_symdir, 0, GET_BOOL, NO_ARG,
IF_PURIFY(0,1), 0, 0, 0, 0, 0},
{"user", 'u', "Run mysqld daemon as user.", 0, 0, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"verbose", 'v', "Used with --help option for detailed help",
- (gptr*) &opt_verbose, (gptr*) &opt_verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+ (uchar**) &opt_verbose, (uchar**) &opt_verbose, 0, GET_BOOL, NO_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},
{"warnings", 'W', "Deprecated; use --log-warnings instead.",
- (gptr*) &global_system_variables.log_warnings,
- (gptr*) &max_system_variables.log_warnings, 0, GET_ULONG, OPT_ARG, 1, 0, ~0L,
+ (uchar**) &global_system_variables.log_warnings,
+ (uchar**) &max_system_variables.log_warnings, 0, GET_ULONG, OPT_ARG, 1, 0, ~0L,
0, 0, 0},
{ "back_log", OPT_BACK_LOG,
"The number of outstanding connection requests MySQL can have. This comes into play when the main MySQL thread gets very many connection requests in a very short time.",
- (gptr*) &back_log, (gptr*) &back_log, 0, GET_ULONG,
+ (uchar**) &back_log, (uchar**) &back_log, 0, GET_ULONG,
REQUIRED_ARG, 50, 1, 65535, 0, 1, 0 },
{"binlog_cache_size", OPT_BINLOG_CACHE_SIZE,
"The size of the cache to hold the SQL statements for the binary log during a transaction. If you often use big, multi-statement transactions you can increase this to get more performance.",
- (gptr*) &binlog_cache_size, (gptr*) &binlog_cache_size, 0, GET_ULONG,
+ (uchar**) &binlog_cache_size, (uchar**) &binlog_cache_size, 0, GET_ULONG,
REQUIRED_ARG, 32*1024L, IO_SIZE, ~0L, 0, IO_SIZE, 0},
{"bulk_insert_buffer_size", OPT_BULK_INSERT_BUFFER_SIZE,
"Size of tree cache used in bulk insert optimisation. Note that this is a limit per thread!",
- (gptr*) &global_system_variables.bulk_insert_buff_size,
- (gptr*) &max_system_variables.bulk_insert_buff_size,
+ (uchar**) &global_system_variables.bulk_insert_buff_size,
+ (uchar**) &max_system_variables.bulk_insert_buff_size,
0, GET_ULONG, REQUIRED_ARG, 8192*1024, 0, ~0L, 0, 1, 0},
{"connect_timeout", OPT_CONNECT_TIMEOUT,
"The number of seconds the mysqld server is waiting for a connect packet before responding with 'Bad handshake'.",
- (gptr*) &connect_timeout, (gptr*) &connect_timeout,
+ (uchar**) &connect_timeout, (uchar**) &connect_timeout,
0, GET_ULONG, REQUIRED_ARG, CONNECT_TIMEOUT, 2, LONG_TIMEOUT, 0, 1, 0 },
{ "date_format", OPT_DATE_FORMAT,
"The DATE format (For future).",
- (gptr*) &opt_date_time_formats[MYSQL_TIMESTAMP_DATE],
- (gptr*) &opt_date_time_formats[MYSQL_TIMESTAMP_DATE],
+ (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_DATE],
+ (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_DATE],
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "datetime_format", OPT_DATETIME_FORMAT,
"The DATETIME/TIMESTAMP format (for future).",
- (gptr*) &opt_date_time_formats[MYSQL_TIMESTAMP_DATETIME],
- (gptr*) &opt_date_time_formats[MYSQL_TIMESTAMP_DATETIME],
+ (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_DATETIME],
+ (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_DATETIME],
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "default_week_format", OPT_DEFAULT_WEEK_FORMAT,
"The default week format used by WEEK() functions.",
- (gptr*) &global_system_variables.default_week_format,
- (gptr*) &max_system_variables.default_week_format,
+ (uchar**) &global_system_variables.default_week_format,
+ (uchar**) &max_system_variables.default_week_format,
0, GET_ULONG, REQUIRED_ARG, 0, 0, 7L, 0, 1, 0},
{"delayed_insert_limit", OPT_DELAYED_INSERT_LIMIT,
"After inserting delayed_insert_limit rows, the INSERT DELAYED handler will check if there are any SELECT statements pending. If so, it allows these to execute before continuing.",
- (gptr*) &delayed_insert_limit, (gptr*) &delayed_insert_limit, 0, GET_ULONG,
+ (uchar**) &delayed_insert_limit, (uchar**) &delayed_insert_limit, 0, GET_ULONG,
REQUIRED_ARG, DELAYED_LIMIT, 1, ~0L, 0, 1, 0},
{"delayed_insert_timeout", OPT_DELAYED_INSERT_TIMEOUT,
"How long a INSERT DELAYED thread should wait for INSERT statements before terminating.",
- (gptr*) &delayed_insert_timeout, (gptr*) &delayed_insert_timeout, 0,
+ (uchar**) &delayed_insert_timeout, (uchar**) &delayed_insert_timeout, 0,
GET_ULONG, REQUIRED_ARG, DELAYED_WAIT_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0},
{ "delayed_queue_size", OPT_DELAYED_QUEUE_SIZE,
"What size queue (in rows) should be allocated for handling INSERT DELAYED. If the queue becomes full, any client that does INSERT DELAYED will wait until there is room in the queue again.",
- (gptr*) &delayed_queue_size, (gptr*) &delayed_queue_size, 0, GET_ULONG,
+ (uchar**) &delayed_queue_size, (uchar**) &delayed_queue_size, 0, GET_ULONG,
REQUIRED_ARG, DELAYED_QUEUE_SIZE, 1, ~0L, 0, 1, 0},
{"div_precision_increment", OPT_DIV_PRECINCREMENT,
"Precision of the result of '/' operator will be increased on that value.",
- (gptr*) &global_system_variables.div_precincrement,
- (gptr*) &max_system_variables.div_precincrement, 0, GET_ULONG,
+ (uchar**) &global_system_variables.div_precincrement,
+ (uchar**) &max_system_variables.div_precincrement, 0, GET_ULONG,
REQUIRED_ARG, 4, 0, DECIMAL_MAX_SCALE, 0, 0, 0},
{"expire_logs_days", OPT_EXPIRE_LOGS_DAYS,
"If non-zero, binary logs will be purged after expire_logs_days "
"days; possible purges happen at startup and at binary log rotation.",
- (gptr*) &expire_logs_days,
- (gptr*) &expire_logs_days, 0, GET_ULONG,
+ (uchar**) &expire_logs_days,
+ (uchar**) &expire_logs_days, 0, GET_ULONG,
REQUIRED_ARG, 0, 0, 99, 0, 1, 0},
{ "flush_time", OPT_FLUSH_TIME,
"A dedicated thread is created to flush all tables at the given interval.",
- (gptr*) &flush_time, (gptr*) &flush_time, 0, GET_ULONG, REQUIRED_ARG,
+ (uchar**) &flush_time, (uchar**) &flush_time, 0, GET_ULONG, REQUIRED_ARG,
FLUSH_TIME, 0, LONG_TIMEOUT, 0, 1, 0},
{ "ft_boolean_syntax", OPT_FT_BOOLEAN_SYNTAX,
"List of operators for MATCH ... AGAINST ( ... IN BOOLEAN MODE)",
@@ -5994,148 +5937,75 @@ log and this option does nothing anymore.",
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "ft_max_word_len", OPT_FT_MAX_WORD_LEN,
"The maximum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable.",
- (gptr*) &ft_max_word_len, (gptr*) &ft_max_word_len, 0, GET_ULONG,
+ (uchar**) &ft_max_word_len, (uchar**) &ft_max_word_len, 0, GET_ULONG,
REQUIRED_ARG, HA_FT_MAXCHARLEN, 10, HA_FT_MAXCHARLEN, 0, 1, 0},
{ "ft_min_word_len", OPT_FT_MIN_WORD_LEN,
"The minimum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable.",
- (gptr*) &ft_min_word_len, (gptr*) &ft_min_word_len, 0, GET_ULONG,
+ (uchar**) &ft_min_word_len, (uchar**) &ft_min_word_len, 0, GET_ULONG,
REQUIRED_ARG, 4, 1, HA_FT_MAXCHARLEN, 0, 1, 0},
{ "ft_query_expansion_limit", OPT_FT_QUERY_EXPANSION_LIMIT,
"Number of best matches to use for query expansion",
- (gptr*) &ft_query_expansion_limit, (gptr*) &ft_query_expansion_limit, 0, GET_ULONG,
+ (uchar**) &ft_query_expansion_limit, (uchar**) &ft_query_expansion_limit, 0, GET_ULONG,
REQUIRED_ARG, 20, 0, 1000, 0, 1, 0},
{ "ft_stopword_file", OPT_FT_STOPWORD_FILE,
"Use stopwords from this file instead of built-in list.",
- (gptr*) &ft_stopword_file, (gptr*) &ft_stopword_file, 0, GET_STR,
+ (uchar**) &ft_stopword_file, (uchar**) &ft_stopword_file, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "group_concat_max_len", OPT_GROUP_CONCAT_MAX_LEN,
"The maximum length of the result of function group_concat.",
- (gptr*) &global_system_variables.group_concat_max_len,
- (gptr*) &max_system_variables.group_concat_max_len, 0, GET_ULONG,
+ (uchar**) &global_system_variables.group_concat_max_len,
+ (uchar**) &max_system_variables.group_concat_max_len, 0, GET_ULONG,
REQUIRED_ARG, 1024, 4, (long) ~0, 0, 1, 0},
-#ifdef WITH_INNOBASE_STORAGE_ENGINE
- {"innodb_additional_mem_pool_size", OPT_INNODB_ADDITIONAL_MEM_POOL_SIZE,
- "Size of a memory pool InnoDB uses to store data dictionary information and other internal data structures.",
- (gptr*) &innobase_additional_mem_pool_size,
- (gptr*) &innobase_additional_mem_pool_size, 0, GET_LONG, REQUIRED_ARG,
- 1*1024*1024L, 512*1024L, ~0L, 0, 1024, 0},
- {"innodb_autoextend_increment", OPT_INNODB_AUTOEXTEND_INCREMENT,
- "Data file autoextend increment in megabytes",
- (gptr*) &srv_auto_extend_increment,
- (gptr*) &srv_auto_extend_increment,
- 0, GET_LONG, REQUIRED_ARG, 8L, 1L, 1000L, 0, 1L, 0},
- {"innodb_buffer_pool_size", OPT_INNODB_BUFFER_POOL_SIZE,
- "The size of the memory buffer InnoDB uses to cache data and indexes of its tables.",
- (gptr*) &innobase_buffer_pool_size, (gptr*) &innobase_buffer_pool_size, 0,
- GET_LL, REQUIRED_ARG, 8*1024*1024L, 1024*1024L, LONGLONG_MAX, 0,
- 1024*1024L, 0},
- {"innodb_commit_concurrency", OPT_INNODB_COMMIT_CONCURRENCY,
- "Helps in performance tuning in heavily concurrent environments.",
- (gptr*) &srv_commit_concurrency, (gptr*) &srv_commit_concurrency,
- 0, GET_LONG, REQUIRED_ARG, 0, 0, 1000, 0, 1, 0},
- {"innodb_concurrency_tickets", OPT_INNODB_CONCURRENCY_TICKETS,
- "Number of times a thread is allowed to enter InnoDB within the same \
- SQL query after it has once got the ticket",
- (gptr*) &srv_n_free_tickets_to_enter,
- (gptr*) &srv_n_free_tickets_to_enter,
- 0, GET_LONG, REQUIRED_ARG, 500L, 1L, ~0L, 0, 1L, 0},
- {"innodb_file_io_threads", OPT_INNODB_FILE_IO_THREADS,
- "Number of file I/O threads in InnoDB.", (gptr*) &innobase_file_io_threads,
- (gptr*) &innobase_file_io_threads, 0, GET_LONG, REQUIRED_ARG, 4, 4, 64, 0,
- 1, 0},
- {"innodb_force_recovery", OPT_INNODB_FORCE_RECOVERY,
- "Helps to save your data in case the disk image of the database becomes corrupt.",
- (gptr*) &innobase_force_recovery, (gptr*) &innobase_force_recovery, 0,
- GET_LONG, REQUIRED_ARG, 0, 0, 6, 0, 1, 0},
- {"innodb_lock_wait_timeout", OPT_INNODB_LOCK_WAIT_TIMEOUT,
- "Timeout in seconds an InnoDB transaction may wait for a lock before being rolled back.",
- (gptr*) &innobase_lock_wait_timeout, (gptr*) &innobase_lock_wait_timeout,
- 0, GET_LONG, REQUIRED_ARG, 50, 1, 1024 * 1024 * 1024, 0, 1, 0},
- {"innodb_log_buffer_size", OPT_INNODB_LOG_BUFFER_SIZE,
- "The size of the buffer which InnoDB uses to write log to the log files on disk.",
- (gptr*) &innobase_log_buffer_size, (gptr*) &innobase_log_buffer_size, 0,
- GET_LONG, REQUIRED_ARG, 1024*1024L, 256*1024L, ~0L, 0, 1024, 0},
- {"innodb_log_file_size", OPT_INNODB_LOG_FILE_SIZE,
- "Size of each log file in a log group.",
- (gptr*) &innobase_log_file_size, (gptr*) &innobase_log_file_size, 0,
- GET_LL, REQUIRED_ARG, 5*1024*1024L, 1*1024*1024L, LONGLONG_MAX, 0,
- 1024*1024L, 0},
- {"innodb_log_files_in_group", OPT_INNODB_LOG_FILES_IN_GROUP,
- "Number of log files in the log group. InnoDB writes to the files in a circular fashion. Value 3 is recommended here.",
- (gptr*) &innobase_log_files_in_group, (gptr*) &innobase_log_files_in_group,
- 0, GET_LONG, REQUIRED_ARG, 2, 2, 100, 0, 1, 0},
- {"innodb_mirrored_log_groups", OPT_INNODB_MIRRORED_LOG_GROUPS,
- "Number of identical copies of log groups we keep for the database. Currently this should be set to 1.",
- (gptr*) &innobase_mirrored_log_groups,
- (gptr*) &innobase_mirrored_log_groups, 0, GET_LONG, REQUIRED_ARG, 1, 1, 10,
- 0, 1, 0},
- {"innodb_open_files", OPT_INNODB_OPEN_FILES,
- "How many files at the maximum InnoDB keeps open at the same time.",
- (gptr*) &innobase_open_files, (gptr*) &innobase_open_files, 0,
- GET_LONG, REQUIRED_ARG, 300L, 10L, ~0L, 0, 1L, 0},
- {"innodb_sync_spin_loops", OPT_INNODB_SYNC_SPIN_LOOPS,
- "Count of spin-loop rounds in InnoDB mutexes",
- (gptr*) &srv_n_spin_wait_rounds,
- (gptr*) &srv_n_spin_wait_rounds,
- 0, GET_LONG, REQUIRED_ARG, 20L, 0L, ~0L, 0, 1L, 0},
- {"innodb_thread_concurrency", OPT_INNODB_THREAD_CONCURRENCY,
- "Helps in performance tuning in heavily concurrent environments. "
- "Sets the maximum number of threads allowed inside InnoDB. Value 0"
- " will disable the thread throttling.",
- (gptr*) &srv_thread_concurrency, (gptr*) &srv_thread_concurrency,
- 0, GET_LONG, REQUIRED_ARG, 8, 0, 1000, 0, 1, 0},
- {"innodb_thread_sleep_delay", OPT_INNODB_THREAD_SLEEP_DELAY,
- "Time of innodb thread sleeping before joining InnoDB queue (usec). Value 0"
- " disable a sleep",
- (gptr*) &srv_thread_sleep_delay,
- (gptr*) &srv_thread_sleep_delay,
- 0, GET_LONG, REQUIRED_ARG, 10000L, 0L, ~0L, 0, 1L, 0},
-#endif /* WITH_INNOBASE_STORAGE_ENGINE */
{"interactive_timeout", OPT_INTERACTIVE_TIMEOUT,
"The number of seconds the server waits for activity on an interactive connection before closing it.",
- (gptr*) &global_system_variables.net_interactive_timeout,
- (gptr*) &max_system_variables.net_interactive_timeout, 0,
+ (uchar**) &global_system_variables.net_interactive_timeout,
+ (uchar**) &max_system_variables.net_interactive_timeout, 0,
GET_ULONG, REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0},
{"join_buffer_size", OPT_JOIN_BUFF_SIZE,
"The size of the buffer that is used for full joins.",
- (gptr*) &global_system_variables.join_buff_size,
- (gptr*) &max_system_variables.join_buff_size, 0, GET_ULONG,
+ (uchar**) &global_system_variables.join_buff_size,
+ (uchar**) &max_system_variables.join_buff_size, 0, GET_ULONG,
REQUIRED_ARG, 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, ~0L, MALLOC_OVERHEAD,
IO_SIZE, 0},
+ {"keep_files_on_create", OPT_KEEP_FILES_ON_CREATE,
+ "Don't overwrite stale .MYD and .MYI even if no directory is specified.",
+ (uchar**) &global_system_variables.keep_files_on_create,
+ (uchar**) &max_system_variables.keep_files_on_create,
+ 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"key_buffer_size", OPT_KEY_BUFFER_SIZE,
"The size of the buffer used for index blocks for MyISAM tables. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford; 64M on a 256M machine that mainly runs MySQL is quite common.",
- (gptr*) &dflt_key_cache_var.param_buff_size,
- (gptr*) 0,
+ (uchar**) &dflt_key_cache_var.param_buff_size,
+ (uchar**) 0,
0, (GET_ULL | GET_ASK_ADDR),
REQUIRED_ARG, KEY_CACHE_SIZE, MALLOC_OVERHEAD, ~(ulong) 0, MALLOC_OVERHEAD,
IO_SIZE, 0},
{"key_cache_age_threshold", OPT_KEY_CACHE_AGE_THRESHOLD,
"This characterizes the number of hits a hot block has to be untouched until it is considered aged enough to be downgraded to a warm block. This specifies the percentage ratio of that number of hits to the total number of blocks in key cache",
- (gptr*) &dflt_key_cache_var.param_age_threshold,
- (gptr*) 0,
+ (uchar**) &dflt_key_cache_var.param_age_threshold,
+ (uchar**) 0,
0, (GET_ULONG | GET_ASK_ADDR), REQUIRED_ARG,
300, 100, ~0L, 0, 100, 0},
{"key_cache_block_size", OPT_KEY_CACHE_BLOCK_SIZE,
"The default size of key cache blocks",
- (gptr*) &dflt_key_cache_var.param_block_size,
- (gptr*) 0,
+ (uchar**) &dflt_key_cache_var.param_block_size,
+ (uchar**) 0,
0, (GET_ULONG | GET_ASK_ADDR), REQUIRED_ARG,
- KEY_CACHE_BLOCK_SIZE , 512, 1024*16, MALLOC_OVERHEAD, 512, 0},
+ KEY_CACHE_BLOCK_SIZE, 512, 1024 * 16, 0, 512, 0},
{"key_cache_division_limit", OPT_KEY_CACHE_DIVISION_LIMIT,
"The minimum percentage of warm blocks in key cache",
- (gptr*) &dflt_key_cache_var.param_division_limit,
- (gptr*) 0,
+ (uchar**) &dflt_key_cache_var.param_division_limit,
+ (uchar**) 0,
0, (GET_ULONG | GET_ASK_ADDR) , REQUIRED_ARG, 100,
1, 100, 0, 1, 0},
{"long_query_time", OPT_LONG_QUERY_TIME,
- "Log all queries that have taken more than long_query_time seconds to execute to file.",
- (gptr*) &global_system_variables.long_query_time,
- (gptr*) &max_system_variables.long_query_time, 0, GET_ULONG,
- REQUIRED_ARG, 10, 1, LONG_TIMEOUT, 0, 1, 0},
+ "Log all queries that have taken more than long_query_time seconds to execute to file. "
+ "The argument will be treated as a decimal value with microsecond precission.",
+ (uchar**) &long_query_time, (uchar**) &long_query_time, 0, GET_DOUBLE,
+ REQUIRED_ARG, 10, 0, LONG_TIMEOUT, 0, 0, 0},
{"lower_case_table_names", OPT_LOWER_CASE_TABLE_NAMES,
"If set to 1 table names are stored in lowercase on disk and table names will be case-insensitive. Should be set to 2 if you are using a case insensitive file system",
- (gptr*) &lower_case_table_names,
- (gptr*) &lower_case_table_names, 0, GET_UINT, OPT_ARG,
+ (uchar**) &lower_case_table_names,
+ (uchar**) &lower_case_table_names, 0, GET_UINT, OPT_ARG,
#ifdef FN_NO_CASE_SENCE
1
#else
@@ -6144,351 +6014,362 @@ log and this option does nothing anymore.",
, 0, 2, 0, 1, 0},
{"max_allowed_packet", OPT_MAX_ALLOWED_PACKET,
"Max packetlength to send/receive from to server.",
- (gptr*) &global_system_variables.max_allowed_packet,
- (gptr*) &max_system_variables.max_allowed_packet, 0, GET_ULONG,
+ (uchar**) &global_system_variables.max_allowed_packet,
+ (uchar**) &max_system_variables.max_allowed_packet, 0, GET_ULONG,
REQUIRED_ARG, 1024*1024L, 1024, 1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0},
{"max_binlog_cache_size", OPT_MAX_BINLOG_CACHE_SIZE,
"Can be used to restrict the total size used to cache a multi-transaction query.",
- (gptr*) &max_binlog_cache_size, (gptr*) &max_binlog_cache_size, 0,
+ (uchar**) &max_binlog_cache_size, (uchar**) &max_binlog_cache_size, 0,
GET_ULONG, REQUIRED_ARG, ~0L, IO_SIZE, ~0L, 0, IO_SIZE, 0},
{"max_binlog_size", OPT_MAX_BINLOG_SIZE,
"Binary log will be rotated automatically when the size exceeds this \
value. Will also apply to relay logs if max_relay_log_size is 0. \
The minimum value for this variable is 4096.",
- (gptr*) &max_binlog_size, (gptr*) &max_binlog_size, 0, GET_ULONG,
+ (uchar**) &max_binlog_size, (uchar**) &max_binlog_size, 0, GET_ULONG,
REQUIRED_ARG, 1024*1024L*1024L, IO_SIZE, 1024*1024L*1024L, 0, IO_SIZE, 0},
{"max_connect_errors", OPT_MAX_CONNECT_ERRORS,
"If there is more than this number of interrupted connections from a host this host will be blocked from further connections.",
- (gptr*) &max_connect_errors, (gptr*) &max_connect_errors, 0, GET_ULONG,
+ (uchar**) &max_connect_errors, (uchar**) &max_connect_errors, 0, GET_ULONG,
REQUIRED_ARG, MAX_CONNECT_ERRORS, 1, ~0L, 0, 1, 0},
// Default max_connections of 151 is larger than Apache's default max
// children, to avoid "too many connections" error in a common setup
{"max_connections", OPT_MAX_CONNECTIONS,
- "The number of simultaneous clients allowed.", (gptr*) &max_connections,
- (gptr*) &max_connections, 0, GET_ULONG, REQUIRED_ARG, 151, 1, 100000, 0, 1,
+ "The number of simultaneous clients allowed.", (uchar**) &max_connections,
+ (uchar**) &max_connections, 0, GET_ULONG, REQUIRED_ARG, 151, 1, 100000, 0, 1,
0},
{"max_delayed_threads", OPT_MAX_DELAYED_THREADS,
"Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero, which means INSERT DELAYED is not used.",
- (gptr*) &global_system_variables.max_insert_delayed_threads,
- (gptr*) &max_system_variables.max_insert_delayed_threads,
+ (uchar**) &global_system_variables.max_insert_delayed_threads,
+ (uchar**) &max_system_variables.max_insert_delayed_threads,
0, GET_ULONG, REQUIRED_ARG, 20, 0, 16384, 0, 1, 0},
{"max_error_count", OPT_MAX_ERROR_COUNT,
"Max number of errors/warnings to store for a statement.",
- (gptr*) &global_system_variables.max_error_count,
- (gptr*) &max_system_variables.max_error_count,
+ (uchar**) &global_system_variables.max_error_count,
+ (uchar**) &max_system_variables.max_error_count,
0, GET_ULONG, REQUIRED_ARG, DEFAULT_ERROR_COUNT, 0, 65535, 0, 1, 0},
{"max_heap_table_size", OPT_MAX_HEP_TABLE_SIZE,
"Don't allow creation of heap tables bigger than this.",
- (gptr*) &global_system_variables.max_heap_table_size,
- (gptr*) &max_system_variables.max_heap_table_size, 0, GET_ULL,
+ (uchar**) &global_system_variables.max_heap_table_size,
+ (uchar**) &max_system_variables.max_heap_table_size, 0, GET_ULL,
REQUIRED_ARG, 16*1024*1024L, 16384, MAX_MEM_TABLE_SIZE,
MALLOC_OVERHEAD, 1024, 0},
{"max_join_size", OPT_MAX_JOIN_SIZE,
"Joins that are probably going to read more than max_join_size records return an error.",
- (gptr*) &global_system_variables.max_join_size,
- (gptr*) &max_system_variables.max_join_size, 0, GET_HA_ROWS, REQUIRED_ARG,
+ (uchar**) &global_system_variables.max_join_size,
+ (uchar**) &max_system_variables.max_join_size, 0, GET_HA_ROWS, REQUIRED_ARG,
~0L, 1, ~0L, 0, 1, 0},
{"max_length_for_sort_data", OPT_MAX_LENGTH_FOR_SORT_DATA,
"Max number of bytes in sorted records.",
- (gptr*) &global_system_variables.max_length_for_sort_data,
- (gptr*) &max_system_variables.max_length_for_sort_data, 0, GET_ULONG,
+ (uchar**) &global_system_variables.max_length_for_sort_data,
+ (uchar**) &max_system_variables.max_length_for_sort_data, 0, GET_ULONG,
REQUIRED_ARG, 1024, 4, 8192*1024L, 0, 1, 0},
{"max_prepared_stmt_count", OPT_MAX_PREPARED_STMT_COUNT,
"Maximum number of prepared statements in the server.",
- (gptr*) &max_prepared_stmt_count, (gptr*) &max_prepared_stmt_count,
+ (uchar**) &max_prepared_stmt_count, (uchar**) &max_prepared_stmt_count,
0, GET_ULONG, REQUIRED_ARG, 16382, 0, 1*1024*1024, 0, 1, 0},
{"max_relay_log_size", OPT_MAX_RELAY_LOG_SIZE,
"If non-zero: relay log will be rotated automatically when the size exceeds this value; if zero (the default): when the size exceeds max_binlog_size. 0 excepted, the minimum value for this variable is 4096.",
- (gptr*) &max_relay_log_size, (gptr*) &max_relay_log_size, 0, GET_ULONG,
+ (uchar**) &max_relay_log_size, (uchar**) &max_relay_log_size, 0, GET_ULONG,
REQUIRED_ARG, 0L, 0L, 1024*1024L*1024L, 0, IO_SIZE, 0},
{ "max_seeks_for_key", OPT_MAX_SEEKS_FOR_KEY,
"Limit assumed max number of seeks when looking up rows based on a key",
- (gptr*) &global_system_variables.max_seeks_for_key,
- (gptr*) &max_system_variables.max_seeks_for_key, 0, GET_ULONG,
+ (uchar**) &global_system_variables.max_seeks_for_key,
+ (uchar**) &max_system_variables.max_seeks_for_key, 0, GET_ULONG,
REQUIRED_ARG, ~0L, 1, ~0L, 0, 1, 0 },
{"max_sort_length", OPT_MAX_SORT_LENGTH,
"The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored).",
- (gptr*) &global_system_variables.max_sort_length,
- (gptr*) &max_system_variables.max_sort_length, 0, GET_ULONG,
+ (uchar**) &global_system_variables.max_sort_length,
+ (uchar**) &max_system_variables.max_sort_length, 0, GET_ULONG,
REQUIRED_ARG, 1024, 4, 8192*1024L, 0, 1, 0},
{"max_sp_recursion_depth", OPT_MAX_SP_RECURSION_DEPTH,
"Maximum stored procedure recursion depth. (discussed with docs).",
- (gptr*) &global_system_variables.max_sp_recursion_depth,
- (gptr*) &max_system_variables.max_sp_recursion_depth, 0, GET_ULONG,
+ (uchar**) &global_system_variables.max_sp_recursion_depth,
+ (uchar**) &max_system_variables.max_sp_recursion_depth, 0, GET_ULONG,
OPT_ARG, 0, 0, 255, 0, 1, 0 },
{"max_tmp_tables", OPT_MAX_TMP_TABLES,
"Maximum number of temporary tables a client can keep open at a time.",
- (gptr*) &global_system_variables.max_tmp_tables,
- (gptr*) &max_system_variables.max_tmp_tables, 0, GET_ULONG,
+ (uchar**) &global_system_variables.max_tmp_tables,
+ (uchar**) &max_system_variables.max_tmp_tables, 0, GET_ULONG,
REQUIRED_ARG, 32, 1, ~0L, 0, 1, 0},
{"max_user_connections", OPT_MAX_USER_CONNECTIONS,
"The maximum number of active connections for a single user (0 = no limit).",
- (gptr*) &max_user_connections, (gptr*) &max_user_connections, 0, GET_UINT,
+ (uchar**) &max_user_connections, (uchar**) &max_user_connections, 0, GET_UINT,
REQUIRED_ARG, 0, 1, ~0, 0, 1, 0},
{"max_write_lock_count", OPT_MAX_WRITE_LOCK_COUNT,
"After this many write locks, allow some read locks to run in between.",
- (gptr*) &max_write_lock_count, (gptr*) &max_write_lock_count, 0, GET_ULONG,
+ (uchar**) &max_write_lock_count, (uchar**) &max_write_lock_count, 0, GET_ULONG,
REQUIRED_ARG, ~0L, 1, ~0L, 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.",
+ (uchar**) &global_system_variables.min_examined_row_limit,
+ (uchar**) &max_system_variables.min_examined_row_limit, 0, GET_ULONG,
+ REQUIRED_ARG, 0, 0, ~0L, 0, 1L, 0},
{"multi_range_count", OPT_MULTI_RANGE_COUNT,
"Number of key ranges to request at once.",
- (gptr*) &global_system_variables.multi_range_count,
- (gptr*) &max_system_variables.multi_range_count, 0,
+ (uchar**) &global_system_variables.multi_range_count,
+ (uchar**) &max_system_variables.multi_range_count, 0,
GET_ULONG, REQUIRED_ARG, 256, 1, ~0L, 0, 1, 0},
{"myisam_block_size", OPT_MYISAM_BLOCK_SIZE,
"Block size to be used for MyISAM index pages.",
- (gptr*) &opt_myisam_block_size,
- (gptr*) &opt_myisam_block_size, 0, GET_ULONG, REQUIRED_ARG,
+ (uchar**) &opt_myisam_block_size,
+ (uchar**) &opt_myisam_block_size, 0, GET_ULONG, REQUIRED_ARG,
MI_KEY_BLOCK_LENGTH, MI_MIN_KEY_BLOCK_LENGTH, MI_MAX_KEY_BLOCK_LENGTH,
0, MI_MIN_KEY_BLOCK_LENGTH, 0},
{"myisam_data_pointer_size", OPT_MYISAM_DATA_POINTER_SIZE,
"Default pointer size to be used for MyISAM tables.",
- (gptr*) &myisam_data_pointer_size,
- (gptr*) &myisam_data_pointer_size, 0, GET_ULONG, REQUIRED_ARG,
+ (uchar**) &myisam_data_pointer_size,
+ (uchar**) &myisam_data_pointer_size, 0, GET_ULONG, REQUIRED_ARG,
6, 2, 7, 0, 1, 0},
{"myisam_max_extra_sort_file_size", OPT_MYISAM_MAX_EXTRA_SORT_FILE_SIZE,
"Deprecated option",
- (gptr*) &global_system_variables.myisam_max_extra_sort_file_size,
- (gptr*) &max_system_variables.myisam_max_extra_sort_file_size,
+ (uchar**) &global_system_variables.myisam_max_extra_sort_file_size,
+ (uchar**) &max_system_variables.myisam_max_extra_sort_file_size,
0, GET_ULL, REQUIRED_ARG, (ulonglong) MI_MAX_TEMP_LENGTH,
0, (ulonglong) MAX_FILE_SIZE, 0, 1, 0},
{"myisam_max_sort_file_size", OPT_MYISAM_MAX_SORT_FILE_SIZE,
"Don't use the fast sort index method to created index if the temporary file would get bigger than this.",
- (gptr*) &global_system_variables.myisam_max_sort_file_size,
- (gptr*) &max_system_variables.myisam_max_sort_file_size, 0,
+ (uchar**) &global_system_variables.myisam_max_sort_file_size,
+ (uchar**) &max_system_variables.myisam_max_sort_file_size, 0,
GET_ULL, REQUIRED_ARG, (longlong) LONG_MAX, 0, (ulonglong) MAX_FILE_SIZE,
0, 1024*1024, 0},
{"myisam_repair_threads", OPT_MYISAM_REPAIR_THREADS,
"Number of threads to use when repairing MyISAM tables. The value of 1 disables parallel repair.",
- (gptr*) &global_system_variables.myisam_repair_threads,
- (gptr*) &max_system_variables.myisam_repair_threads, 0,
+ (uchar**) &global_system_variables.myisam_repair_threads,
+ (uchar**) &max_system_variables.myisam_repair_threads, 0,
GET_ULONG, REQUIRED_ARG, 1, 1, ~0L, 0, 1, 0},
{"myisam_sort_buffer_size", OPT_MYISAM_SORT_BUFFER_SIZE,
"The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE.",
- (gptr*) &global_system_variables.myisam_sort_buff_size,
- (gptr*) &max_system_variables.myisam_sort_buff_size, 0,
+ (uchar**) &global_system_variables.myisam_sort_buff_size,
+ (uchar**) &max_system_variables.myisam_sort_buff_size, 0,
GET_ULONG, REQUIRED_ARG, 8192*1024, 4, ~0L, 0, 1, 0},
{"myisam_use_mmap", OPT_MYISAM_USE_MMAP,
"Use memory mapping for reading and writing MyISAM tables",
- (gptr*) &opt_myisam_use_mmap,
- (gptr*) &opt_myisam_use_mmap, 0, GET_BOOL, NO_ARG, 0,
+ (uchar**) &opt_myisam_use_mmap,
+ (uchar**) &opt_myisam_use_mmap, 0, GET_BOOL, NO_ARG, 0,
0, 0, 0, 0, 0},
{"myisam_stats_method", OPT_MYISAM_STATS_METHOD,
"Specifies how MyISAM index statistics collection code should threat NULLs. "
"Possible values of name are \"nulls_unequal\" (default behavior for 4.1/5.0), "
"\"nulls_equal\" (emulate 4.0 behavior), and \"nulls_ignored\".",
- (gptr*) &myisam_stats_method_str, (gptr*) &myisam_stats_method_str, 0,
+ (uchar**) &myisam_stats_method_str, (uchar**) &myisam_stats_method_str, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"net_buffer_length", OPT_NET_BUFFER_LENGTH,
"Buffer length for TCP/IP and socket communication.",
- (gptr*) &global_system_variables.net_buffer_length,
- (gptr*) &max_system_variables.net_buffer_length, 0, GET_ULONG,
+ (uchar**) &global_system_variables.net_buffer_length,
+ (uchar**) &max_system_variables.net_buffer_length, 0, GET_ULONG,
REQUIRED_ARG, 16384, 1024, 1024*1024L, 0, 1024, 0},
{"net_read_timeout", OPT_NET_READ_TIMEOUT,
"Number of seconds to wait for more data from a connection before aborting the read.",
- (gptr*) &global_system_variables.net_read_timeout,
- (gptr*) &max_system_variables.net_read_timeout, 0, GET_ULONG,
+ (uchar**) &global_system_variables.net_read_timeout,
+ (uchar**) &max_system_variables.net_read_timeout, 0, GET_ULONG,
REQUIRED_ARG, NET_READ_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0},
{"net_retry_count", OPT_NET_RETRY_COUNT,
"If a read on a communication port is interrupted, retry this many times before giving up.",
- (gptr*) &global_system_variables.net_retry_count,
- (gptr*) &max_system_variables.net_retry_count,0,
+ (uchar**) &global_system_variables.net_retry_count,
+ (uchar**) &max_system_variables.net_retry_count,0,
GET_ULONG, REQUIRED_ARG, MYSQLD_NET_RETRY_COUNT, 1, ~0L, 0, 1, 0},
{"net_write_timeout", OPT_NET_WRITE_TIMEOUT,
"Number of seconds to wait for a block to be written to a connection before aborting the write.",
- (gptr*) &global_system_variables.net_write_timeout,
- (gptr*) &max_system_variables.net_write_timeout, 0, GET_ULONG,
+ (uchar**) &global_system_variables.net_write_timeout,
+ (uchar**) &max_system_variables.net_write_timeout, 0, GET_ULONG,
REQUIRED_ARG, NET_WRITE_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0},
{ "old", OPT_OLD_MODE, "Use compatible behavior.",
- (gptr*) &global_system_variables.old_mode,
- (gptr*) &max_system_variables.old_mode, 0, GET_BOOL, NO_ARG,
+ (uchar**) &global_system_variables.old_mode,
+ (uchar**) &max_system_variables.old_mode, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
{"open_files_limit", OPT_OPEN_FILES_LIMIT,
"If this is not 0, then mysqld will use this value to reserve file descriptors to use with setrlimit(). If this value is 0 then mysqld will reserve max_connections*5 or max_connections + table_cache*2 (whichever is larger) number of files.",
- (gptr*) &open_files_limit, (gptr*) &open_files_limit, 0, GET_ULONG,
+ (uchar**) &open_files_limit, (uchar**) &open_files_limit, 0, GET_ULONG,
REQUIRED_ARG, 0, 0, OS_FILE_LIMIT, 0, 1, 0},
{"optimizer_prune_level", OPT_OPTIMIZER_PRUNE_LEVEL,
"Controls the heuristic(s) applied during query optimization to prune less-promising partial plans from the optimizer search space. Meaning: 0 - do not apply any heuristic, thus perform exhaustive search; 1 - prune plans based on number of retrieved rows.",
- (gptr*) &global_system_variables.optimizer_prune_level,
- (gptr*) &max_system_variables.optimizer_prune_level,
+ (uchar**) &global_system_variables.optimizer_prune_level,
+ (uchar**) &max_system_variables.optimizer_prune_level,
0, GET_ULONG, OPT_ARG, 1, 0, 1, 0, 1, 0},
{"optimizer_search_depth", OPT_OPTIMIZER_SEARCH_DEPTH,
"Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Smaller values than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value; if set to MAX_TABLES+2, the optimizer will switch to the original find_best (used for testing/comparison).",
- (gptr*) &global_system_variables.optimizer_search_depth,
- (gptr*) &max_system_variables.optimizer_search_depth,
+ (uchar**) &global_system_variables.optimizer_search_depth,
+ (uchar**) &max_system_variables.optimizer_search_depth,
0, GET_ULONG, OPT_ARG, MAX_TABLES+1, 0, MAX_TABLES+2, 0, 1, 0},
{"plugin_dir", OPT_PLUGIN_DIR,
"Directory for plugins.",
- (gptr*) &opt_plugin_dir_ptr, (gptr*) &opt_plugin_dir_ptr, 0,
+ (uchar**) &opt_plugin_dir_ptr, (uchar**) &opt_plugin_dir_ptr, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"preload_buffer_size", OPT_PRELOAD_BUFFER_SIZE,
+ {"plugin_load", OPT_PLUGIN_LOAD,
+ "Optional colon separated list of plugins to load, where each plugin is "
+ "identified by name and path to library seperated by an equals.",
+ (uchar**) &opt_plugin_load, (uchar**) &opt_plugin_load, 0,
+ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"preload_buffer_size", OPT_PRELOAD_BUFFER_SIZE,
"The size of the buffer that is allocated when preloading indexes",
- (gptr*) &global_system_variables.preload_buff_size,
- (gptr*) &max_system_variables.preload_buff_size, 0, GET_ULONG,
+ (uchar**) &global_system_variables.preload_buff_size,
+ (uchar**) &max_system_variables.preload_buff_size, 0, GET_ULONG,
REQUIRED_ARG, 32*1024L, 1024, 1024*1024*1024L, 0, 1, 0},
{"query_alloc_block_size", OPT_QUERY_ALLOC_BLOCK_SIZE,
"Allocation block size for query parsing and execution",
- (gptr*) &global_system_variables.query_alloc_block_size,
- (gptr*) &max_system_variables.query_alloc_block_size, 0, GET_ULONG,
+ (uchar**) &global_system_variables.query_alloc_block_size,
+ (uchar**) &max_system_variables.query_alloc_block_size, 0, GET_ULONG,
REQUIRED_ARG, QUERY_ALLOC_BLOCK_SIZE, 1024, ~0L, 0, 1024, 0},
#ifdef HAVE_QUERY_CACHE
{"query_cache_limit", OPT_QUERY_CACHE_LIMIT,
"Don't cache results that are bigger than this.",
- (gptr*) &query_cache_limit, (gptr*) &query_cache_limit, 0, GET_ULONG,
+ (uchar**) &query_cache_limit, (uchar**) &query_cache_limit, 0, GET_ULONG,
REQUIRED_ARG, 1024*1024L, 0, (longlong) ULONG_MAX, 0, 1, 0},
{"query_cache_min_res_unit", OPT_QUERY_CACHE_MIN_RES_UNIT,
"minimal size of unit in wich space for results is allocated (last unit will be trimed after writing all result data.",
- (gptr*) &query_cache_min_res_unit, (gptr*) &query_cache_min_res_unit,
+ (uchar**) &query_cache_min_res_unit, (uchar**) &query_cache_min_res_unit,
0, GET_ULONG, REQUIRED_ARG, QUERY_CACHE_MIN_RESULT_DATA_SIZE,
0, (longlong) ULONG_MAX, 0, 1, 0},
#endif /*HAVE_QUERY_CACHE*/
{"query_cache_size", OPT_QUERY_CACHE_SIZE,
"The memory allocated to store results from old queries.",
- (gptr*) &query_cache_size, (gptr*) &query_cache_size, 0, GET_ULONG,
+ (uchar**) &query_cache_size, (uchar**) &query_cache_size, 0, GET_ULONG,
REQUIRED_ARG, 0, 0, (longlong) ULONG_MAX, 0, 1024, 0},
#ifdef HAVE_QUERY_CACHE
{"query_cache_type", OPT_QUERY_CACHE_TYPE,
"0 = OFF = Don't cache or retrieve results. 1 = ON = Cache all results except SELECT SQL_NO_CACHE ... queries. 2 = DEMAND = Cache only SELECT SQL_CACHE ... queries.",
- (gptr*) &global_system_variables.query_cache_type,
- (gptr*) &max_system_variables.query_cache_type,
+ (uchar**) &global_system_variables.query_cache_type,
+ (uchar**) &max_system_variables.query_cache_type,
0, GET_ULONG, REQUIRED_ARG, 1, 0, 2, 0, 1, 0},
{"query_cache_wlock_invalidate", OPT_QUERY_CACHE_WLOCK_INVALIDATE,
"Invalidate queries in query cache on LOCK for write",
- (gptr*) &global_system_variables.query_cache_wlock_invalidate,
- (gptr*) &max_system_variables.query_cache_wlock_invalidate,
+ (uchar**) &global_system_variables.query_cache_wlock_invalidate,
+ (uchar**) &max_system_variables.query_cache_wlock_invalidate,
0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0},
#endif /*HAVE_QUERY_CACHE*/
{"query_prealloc_size", OPT_QUERY_PREALLOC_SIZE,
"Persistent buffer for query parsing and execution",
- (gptr*) &global_system_variables.query_prealloc_size,
- (gptr*) &max_system_variables.query_prealloc_size, 0, GET_ULONG,
+ (uchar**) &global_system_variables.query_prealloc_size,
+ (uchar**) &max_system_variables.query_prealloc_size, 0, GET_ULONG,
REQUIRED_ARG, QUERY_ALLOC_PREALLOC_SIZE, QUERY_ALLOC_PREALLOC_SIZE,
~0L, 0, 1024, 0},
{"range_alloc_block_size", OPT_RANGE_ALLOC_BLOCK_SIZE,
"Allocation block size for storing ranges during optimization",
- (gptr*) &global_system_variables.range_alloc_block_size,
- (gptr*) &max_system_variables.range_alloc_block_size, 0, GET_ULONG,
+ (uchar**) &global_system_variables.range_alloc_block_size,
+ (uchar**) &max_system_variables.range_alloc_block_size, 0, GET_ULONG,
REQUIRED_ARG, RANGE_ALLOC_BLOCK_SIZE, 4096, ~0L, 0, 1024, 0},
{"read_buffer_size", OPT_RECORD_BUFFER,
"Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value.",
- (gptr*) &global_system_variables.read_buff_size,
- (gptr*) &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG,
+ (uchar**) &global_system_variables.read_buff_size,
+ (uchar**) &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG,
128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, SSIZE_MAX, MALLOC_OVERHEAD, IO_SIZE,
0},
{"read_only", OPT_READONLY,
"Make all non-temporary tables read-only, with the exception for replication (slave) threads and users with the SUPER privilege",
- (gptr*) &opt_readonly,
- (gptr*) &opt_readonly,
+ (uchar**) &opt_readonly,
+ (uchar**) &opt_readonly,
0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0},
{"read_rnd_buffer_size", OPT_RECORD_RND_BUFFER,
"When reading rows in sorted order after a sort, the rows are read through this buffer to avoid a disk seeks. If not set, then it's set to the value of record_buffer.",
- (gptr*) &global_system_variables.read_rnd_buff_size,
- (gptr*) &max_system_variables.read_rnd_buff_size, 0,
+ (uchar**) &global_system_variables.read_rnd_buff_size,
+ (uchar**) &max_system_variables.read_rnd_buff_size, 0,
GET_ULONG, REQUIRED_ARG, 256*1024L, IO_SIZE*2+MALLOC_OVERHEAD,
SSIZE_MAX, MALLOC_OVERHEAD, IO_SIZE, 0},
{"record_buffer", OPT_RECORD_BUFFER,
"Alias for read_buffer_size",
- (gptr*) &global_system_variables.read_buff_size,
- (gptr*) &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG,
+ (uchar**) &global_system_variables.read_buff_size,
+ (uchar**) &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG,
128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, SSIZE_MAX, MALLOC_OVERHEAD, IO_SIZE, 0},
#ifdef HAVE_REPLICATION
{"relay_log_purge", OPT_RELAY_LOG_PURGE,
"0 = do not purge relay logs. 1 = purge them as soon as they are no more needed.",
- (gptr*) &relay_log_purge,
- (gptr*) &relay_log_purge, 0, GET_BOOL, NO_ARG,
+ (uchar**) &relay_log_purge,
+ (uchar**) &relay_log_purge, 0, GET_BOOL, NO_ARG,
1, 0, 1, 0, 1, 0},
{"relay_log_space_limit", OPT_RELAY_LOG_SPACE_LIMIT,
"Maximum space to use for all relay logs.",
- (gptr*) &relay_log_space_limit,
- (gptr*) &relay_log_space_limit, 0, GET_ULL, REQUIRED_ARG, 0L, 0L,
+ (uchar**) &relay_log_space_limit,
+ (uchar**) &relay_log_space_limit, 0, GET_ULL, REQUIRED_ARG, 0L, 0L,
(longlong) ULONG_MAX, 0, 1, 0},
{"slave_compressed_protocol", OPT_SLAVE_COMPRESSED_PROTOCOL,
"Use compression on master/slave protocol.",
- (gptr*) &opt_slave_compressed_protocol,
- (gptr*) &opt_slave_compressed_protocol,
+ (uchar**) &opt_slave_compressed_protocol,
+ (uchar**) &opt_slave_compressed_protocol,
0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0},
{"slave_net_timeout", OPT_SLAVE_NET_TIMEOUT,
"Number of seconds to wait for more data from a master/slave connection before aborting the read.",
- (gptr*) &slave_net_timeout, (gptr*) &slave_net_timeout, 0,
+ (uchar**) &slave_net_timeout, (uchar**) &slave_net_timeout, 0,
GET_ULONG, REQUIRED_ARG, SLAVE_NET_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0},
{"slave_transaction_retries", OPT_SLAVE_TRANS_RETRIES,
"Number of times the slave SQL thread will retry a transaction in case "
"it failed with a deadlock or elapsed lock wait timeout, "
"before giving up and stopping.",
- (gptr*) &slave_trans_retries, (gptr*) &slave_trans_retries, 0,
+ (uchar**) &slave_trans_retries, (uchar**) &slave_trans_retries, 0,
GET_ULONG, REQUIRED_ARG, 10L, 0L, (longlong) ULONG_MAX, 0, 1, 0},
#endif /* HAVE_REPLICATION */
{"slow_launch_time", OPT_SLOW_LAUNCH_TIME,
"If creating the thread takes longer than this value (in seconds), the Slow_launch_threads counter will be incremented.",
- (gptr*) &slow_launch_time, (gptr*) &slow_launch_time, 0, GET_ULONG,
+ (uchar**) &slow_launch_time, (uchar**) &slow_launch_time, 0, GET_ULONG,
REQUIRED_ARG, 2L, 0L, LONG_TIMEOUT, 0, 1, 0},
{"sort_buffer_size", OPT_SORT_BUFFER,
"Each thread that needs to do a sort allocates a buffer of this size.",
- (gptr*) &global_system_variables.sortbuff_size,
- (gptr*) &max_system_variables.sortbuff_size, 0, GET_ULONG, REQUIRED_ARG,
+ (uchar**) &global_system_variables.sortbuff_size,
+ (uchar**) &max_system_variables.sortbuff_size, 0, GET_ULONG, REQUIRED_ARG,
MAX_SORT_MEMORY, MIN_SORT_MEMORY+MALLOC_OVERHEAD*2, ~0L, MALLOC_OVERHEAD,
1, 0},
{"sync-binlog", OPT_SYNC_BINLOG,
"Synchronously flush binary log to disk after every #th event. "
"Use 0 (default) to disable synchronous flushing.",
- (gptr*) &sync_binlog_period, (gptr*) &sync_binlog_period, 0, GET_ULONG,
+ (uchar**) &sync_binlog_period, (uchar**) &sync_binlog_period, 0, GET_ULONG,
REQUIRED_ARG, 0, 0, ~0L, 0, 1, 0},
{"sync-frm", OPT_SYNC_FRM, "Sync .frm to disk on create. Enabled by default.",
- (gptr*) &opt_sync_frm, (gptr*) &opt_sync_frm, 0, GET_BOOL, NO_ARG, 1, 0,
+ (uchar**) &opt_sync_frm, (uchar**) &opt_sync_frm, 0, GET_BOOL, NO_ARG, 1, 0,
0, 0, 0, 0},
{"table_cache", OPT_TABLE_OPEN_CACHE,
"Deprecated; use --table_open_cache instead.",
- (gptr*) &table_cache_size, (gptr*) &table_cache_size, 0, GET_ULONG,
+ (uchar**) &table_cache_size, (uchar**) &table_cache_size, 0, GET_ULONG,
REQUIRED_ARG, TABLE_OPEN_CACHE_DEFAULT, 1, 512*1024L, 0, 1, 0},
{"table_definition_cache", OPT_TABLE_DEF_CACHE,
"The number of cached table definitions.",
- (gptr*) &table_def_size, (gptr*) &table_def_size,
+ (uchar**) &table_def_size, (uchar**) &table_def_size,
0, GET_ULONG, REQUIRED_ARG, 128, 1, 512*1024L, 0, 1, 0},
{"table_open_cache", OPT_TABLE_OPEN_CACHE,
"The number of cached open tables.",
- (gptr*) &table_cache_size, (gptr*) &table_cache_size, 0, GET_ULONG,
+ (uchar**) &table_cache_size, (uchar**) &table_cache_size, 0, GET_ULONG,
REQUIRED_ARG, TABLE_OPEN_CACHE_DEFAULT, 1, 512*1024L, 0, 1, 0},
{"table_lock_wait_timeout", OPT_TABLE_LOCK_WAIT_TIMEOUT,
"Timeout in seconds to wait for a table level lock before returning an "
"error. Used only if the connection has active cursors.",
- (gptr*) &table_lock_wait_timeout, (gptr*) &table_lock_wait_timeout,
+ (uchar**) &table_lock_wait_timeout, (uchar**) &table_lock_wait_timeout,
0, GET_ULONG, REQUIRED_ARG, 50, 1, 1024 * 1024 * 1024, 0, 1, 0},
{"thread_cache_size", OPT_THREAD_CACHE_SIZE,
"How many threads we should keep in a cache for reuse.",
- (gptr*) &thread_cache_size, (gptr*) &thread_cache_size, 0, GET_ULONG,
+ (uchar**) &thread_cache_size, (uchar**) &thread_cache_size, 0, GET_ULONG,
REQUIRED_ARG, 0, 0, 16384, 0, 1, 0},
{"thread_concurrency", OPT_THREAD_CONCURRENCY,
"Permits the application to give the threads system a hint for the desired number of threads that should be run at the same time.",
- (gptr*) &concurrency, (gptr*) &concurrency, 0, GET_ULONG, REQUIRED_ARG,
+ (uchar**) &concurrency, (uchar**) &concurrency, 0, GET_ULONG, REQUIRED_ARG,
DEFAULT_CONCURRENCY, 1, 512, 0, 1, 0},
#if HAVE_POOL_OF_THREADS == 1
{"thread_pool_size", OPT_THREAD_CACHE_SIZE,
"How many threads we should create to handle query requests in case of 'thread_handling=pool-of-threads'",
- (gptr*) &thread_pool_size, (gptr*) &thread_pool_size, 0, GET_ULONG,
+ (uchar**) &thread_pool_size, (uchar**) &thread_pool_size, 0, GET_ULONG,
REQUIRED_ARG, 20, 1, 16384, 0, 1, 0},
#endif
{"thread_stack", OPT_THREAD_STACK,
- "The stack size for each thread.", (gptr*) &thread_stack,
- (gptr*) &thread_stack, 0, GET_ULONG, REQUIRED_ARG,DEFAULT_THREAD_STACK,
+ "The stack size for each thread.", (uchar**) &thread_stack,
+ (uchar**) &thread_stack, 0, GET_ULONG, REQUIRED_ARG,DEFAULT_THREAD_STACK,
1024L*128L, ~0L, 0, 1024, 0},
{ "time_format", OPT_TIME_FORMAT,
"The TIME format (for future).",
- (gptr*) &opt_date_time_formats[MYSQL_TIMESTAMP_TIME],
- (gptr*) &opt_date_time_formats[MYSQL_TIMESTAMP_TIME],
+ (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_TIME],
+ (uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_TIME],
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"tmp_table_size", OPT_TMP_TABLE_SIZE,
- "If an in-memory temporary table exceeds this size, MySQL will automatically convert it to an on-disk MyISAM table.",
- (gptr*) &global_system_variables.tmp_table_size,
- (gptr*) &max_system_variables.tmp_table_size, 0, GET_ULL,
+ "If an internal in-memory temporary table exceeds this size, MySQL will"
+ " automatically convert it to an on-disk MyISAM table.",
+ (uchar**) &global_system_variables.tmp_table_size,
+ (uchar**) &max_system_variables.tmp_table_size, 0, GET_ULL,
REQUIRED_ARG, 16*1024*1024L, 1024, MAX_MEM_TABLE_SIZE, 0, 1, 0},
{"transaction_alloc_block_size", OPT_TRANS_ALLOC_BLOCK_SIZE,
"Allocation block size for various transaction-related structures",
- (gptr*) &global_system_variables.trans_alloc_block_size,
- (gptr*) &max_system_variables.trans_alloc_block_size, 0, GET_ULONG,
+ (uchar**) &global_system_variables.trans_alloc_block_size,
+ (uchar**) &max_system_variables.trans_alloc_block_size, 0, GET_ULONG,
REQUIRED_ARG, QUERY_ALLOC_BLOCK_SIZE, 1024, ~0L, 0, 1024, 0},
{"transaction_prealloc_size", OPT_TRANS_PREALLOC_SIZE,
"Persistent buffer for various transaction-related structures",
- (gptr*) &global_system_variables.trans_prealloc_size,
- (gptr*) &max_system_variables.trans_prealloc_size, 0, GET_ULONG,
+ (uchar**) &global_system_variables.trans_prealloc_size,
+ (uchar**) &max_system_variables.trans_prealloc_size, 0, GET_ULONG,
REQUIRED_ARG, TRANS_ALLOC_PREALLOC_SIZE, 1024, ~0L, 0, 1024, 0},
{"thread_handling", OPT_THREAD_HANDLING,
"Define threads usage for handling queries: "
@@ -6496,13 +6377,13 @@ The minimum value for this variable is 4096.",
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"updatable_views_with_limit", OPT_UPDATABLE_VIEWS_WITH_LIMIT,
"1 = YES = Don't issue an error message (warning only) if a VIEW without presence of a key of the underlying table is used in queries with a LIMIT clause for updating. 0 = NO = Prohibit update of a VIEW, which does not contain a key of the underlying table and the query uses a LIMIT clause (usually get from GUI tools).",
- (gptr*) &global_system_variables.updatable_views_with_limit,
- (gptr*) &max_system_variables.updatable_views_with_limit,
+ (uchar**) &global_system_variables.updatable_views_with_limit,
+ (uchar**) &max_system_variables.updatable_views_with_limit,
0, GET_ULONG, REQUIRED_ARG, 1, 0, 1, 0, 1, 0},
{"wait_timeout", OPT_WAIT_TIMEOUT,
"The number of seconds the server waits for activity on a connection before closing it.",
- (gptr*) &global_system_variables.net_wait_timeout,
- (gptr*) &max_system_variables.net_wait_timeout, 0, GET_ULONG,
+ (uchar**) &global_system_variables.net_wait_timeout,
+ (uchar**) &max_system_variables.net_wait_timeout, 0, GET_ULONG,
REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, IF_WIN(INT_MAX32/1000, LONG_TIMEOUT),
0, 1, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
@@ -6875,8 +6756,8 @@ SHOW_VAR status_vars[]= {
{"Aborted_connects", (char*) &aborted_connects, SHOW_LONG},
{"Binlog_cache_disk_use", (char*) &binlog_cache_disk_use, SHOW_LONG},
{"Binlog_cache_use", (char*) &binlog_cache_use, SHOW_LONG},
- {"Bytes_received", (char*) offsetof(STATUS_VAR, bytes_received), SHOW_LONG_STATUS},
- {"Bytes_sent", (char*) offsetof(STATUS_VAR, bytes_sent), SHOW_LONG_STATUS},
+ {"Bytes_received", (char*) offsetof(STATUS_VAR, bytes_received), SHOW_LONGLONG_STATUS},
+ {"Bytes_sent", (char*) offsetof(STATUS_VAR, bytes_sent), SHOW_LONGLONG_STATUS},
{"Com_admin_commands", (char*) offsetof(STATUS_VAR, com_other), SHOW_LONG_STATUS},
{"Com_alter_db", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_ALTER_DB]), SHOW_LONG_STATUS},
{"Com_alter_event", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_ALTER_EVENT]), SHOW_LONG_STATUS},
@@ -6884,6 +6765,7 @@ SHOW_VAR status_vars[]= {
{"Com_analyze", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_ANALYZE]), SHOW_LONG_STATUS},
{"Com_backup_table", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_BACKUP_TABLE]), SHOW_LONG_STATUS},
{"Com_begin", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_BEGIN]), SHOW_LONG_STATUS},
+ {"Com_call_procedure", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_CALL]), SHOW_LONG_STATUS},
{"Com_change_db", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_CHANGE_DB]), SHOW_LONG_STATUS},
{"Com_change_master", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_CHANGE_MASTER]), SHOW_LONG_STATUS},
{"Com_check", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_CHECK]), SHOW_LONG_STATUS},
@@ -7023,6 +6905,7 @@ SHOW_VAR status_vars[]= {
{"Open_streams", (char*) &my_stream_opened, SHOW_LONG_NOFLUSH},
{"Open_table_definitions", (char*) &show_table_definitions, SHOW_FUNC},
{"Open_tables", (char*) &show_open_tables, SHOW_FUNC},
+ {"Opened_files", (char*) &my_file_total_opened, SHOW_LONG_NOFLUSH},
{"Opened_tables", (char*) offsetof(STATUS_VAR, opened_tables), SHOW_LONG_STATUS},
{"Prepared_stmt_count", (char*) &show_prepared_stmt_count, SHOW_FUNC},
#ifdef HAVE_QUERY_CACHE
@@ -7109,6 +6992,7 @@ static void print_version(void)
server_version,SYSTEM_TYPE,MACHINE_TYPE, MYSQL_COMPILATION_COMMENT);
}
+#ifndef EMBEDDED_LIBRARY
static void usage(void)
{
if (!(default_charset_info= get_charset_by_csname(default_character_set_name,
@@ -7126,7 +7010,7 @@ Starts the MySQL database server\n");
printf("Usage: %s [OPTIONS]\n", my_progname);
if (!opt_verbose)
- puts("\nFor more help options (several pages), use mysqld --verbose --help\n");
+ puts("\nFor more help options (several pages), use mysqld --verbose --help");
else
{
#ifdef __WIN__
@@ -7144,17 +7028,17 @@ Starts the MySQL database server\n");
#endif
print_defaults(MYSQL_CONFIG_NAME,load_default_groups);
puts("");
- fix_paths();
set_ports();
- my_print_help(my_long_options);
- my_print_variables(my_long_options);
+ /* Print out all the options including plugin supplied options */
+ my_print_help_inc_plugins(my_long_options, sizeof(my_long_options)/sizeof(my_option));
puts("\n\
To see what values a running MySQL server is using, type\n\
-'mysqladmin variables' instead of 'mysqld --verbose --help'.\n");
+'mysqladmin variables' instead of 'mysqld --verbose --help'.");
}
}
+#endif /*!EMBEDDED_LIBRARY*/
/*
@@ -7191,6 +7075,7 @@ static void mysql_init_variables(void)
mqh_used= 0;
segfaulted= kill_in_progress= 0;
cleanup_done= 0;
+ defaults_argc= 0;
defaults_argv= 0;
server_id_supplied= 0;
test_flags= select_errors= dropping_tables= ha_open_options=0;
@@ -7211,7 +7096,7 @@ static void mysql_init_variables(void)
prepared_stmt_count= 0;
errmesg= 0;
mysqld_unix_port= opt_mysql_tmpdir= my_bind_addr_str= NullS;
- bzero((gptr) &mysql_tmpdir_list, sizeof(mysql_tmpdir_list));
+ bzero((uchar*) &mysql_tmpdir_list, sizeof(mysql_tmpdir_list));
bzero((char *) &global_status_var, sizeof(global_status_var));
opt_large_pages= 0;
key_map_full.set_all();
@@ -7258,6 +7143,7 @@ static void mysql_init_variables(void)
sizeof(mysql_real_data_home)-1);
mysql_data_home_buff[0]=FN_CURLIB; // all paths are relative from here
mysql_data_home_buff[1]=0;
+ mysql_data_home_len= 2;
/* Replication parameters */
master_user= (char*) "test";
@@ -7278,7 +7164,7 @@ static void mysql_init_variables(void)
lc_time_names_name= (char*) "en_US";
/* Set default values for some option variables */
default_storage_engine_str= (char*) "MyISAM";
- global_system_variables.table_type= myisam_hton;
+ global_system_variables.table_plugin= NULL;
global_system_variables.tx_isolation= ISO_REPEATABLE_READ;
global_system_variables.select_limit= (ulonglong) HA_POS_ERROR;
max_system_variables.select_limit= (ulonglong) HA_POS_ERROR;
@@ -7299,41 +7185,17 @@ static void mysql_init_variables(void)
"d:t:i:o,/tmp/mysqld.trace");
#endif
opt_error_log= IF_WIN(1,0);
-#ifdef WITH_INNOBASE_STORAGE_ENGINE
- have_innodb= SHOW_OPTION_YES;
-#else
- have_innodb= SHOW_OPTION_NO;
-#endif
-#ifdef WITH_CSV_STORAGE_ENGINE
- have_csv_db= SHOW_OPTION_YES;
-#else
- have_csv_db= SHOW_OPTION_NO;
-#endif
-#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
- have_ndbcluster= SHOW_OPTION_DISABLED;
-#else
- have_ndbcluster= SHOW_OPTION_NO;
-#endif
-#ifdef WITH_PARTITION_STORAGE_ENGINE
- have_partition_db= SHOW_OPTION_YES;
-#else
- have_partition_db= SHOW_OPTION_NO;
#endif
#ifdef COMMUNITY_SERVER
have_community_features = SHOW_OPTION_YES;
#else
have_community_features = SHOW_OPTION_NO;
-#endif
-#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
- have_ndbcluster=SHOW_OPTION_DISABLED;
global_system_variables.ndb_index_stat_enable=FALSE;
max_system_variables.ndb_index_stat_enable=TRUE;
global_system_variables.ndb_index_stat_cache_entries=32;
max_system_variables.ndb_index_stat_cache_entries=~0L;
global_system_variables.ndb_index_stat_update_freq=20;
max_system_variables.ndb_index_stat_update_freq=~0L;
-#else
- have_ndbcluster=SHOW_OPTION_NO;
#endif
#ifdef HAVE_OPENSSL
have_ssl=SHOW_OPTION_YES;
@@ -7418,9 +7280,10 @@ static void mysql_init_variables(void)
}
-static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument)
+my_bool
+mysqld_get_one_option(int optid,
+ const struct my_option *opt __attribute__((unused)),
+ char *argument)
{
switch(optid) {
case '#':
@@ -7447,6 +7310,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
strmake(mysql_real_data_home,argument, sizeof(mysql_real_data_home)-1);
/* Correct pointer set by my_getopt (for embedded library) */
mysql_data_home= mysql_real_data_home;
+ mysql_data_home_len= strlen(mysql_data_home);
break;
case 'u':
if (!mysqld_user || !strcmp(mysqld_user, argument))
@@ -7626,7 +7490,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
#endif
case OPT_EVENT_SCHEDULER:
if (Events::set_opt_event_scheduler(argument))
- exit(1);
+ exit(1);
break;
case (int) OPT_SKIP_NEW:
opt_specialflag|= SPECIAL_NO_NEW_FUNC;
@@ -7778,17 +7642,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
global_system_variables.tx_isolation= (type-1);
break;
}
- case OPT_MERGE:
- case OPT_BDB:
- break;
- case OPT_NDBCLUSTER:
-#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
- if (opt_ndbcluster)
- have_ndbcluster= SHOW_OPTION_YES;
- else
- have_ndbcluster= SHOW_OPTION_DISABLED;
-#endif
- break;
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
case OPT_NDB_MGMD:
case OPT_NDB_NODEID:
@@ -7827,31 +7680,18 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
ndb_extra_logging= atoi(argument);
break;
#endif
- case OPT_INNODB:
-#ifdef WITH_INNOBASE_STORAGE_ENGINE
- if (opt_innodb)
- have_innodb= SHOW_OPTION_YES;
- else
- have_innodb= SHOW_OPTION_DISABLED;
-#endif
- break;
- case OPT_INNODB_DATA_FILE_PATH:
-#ifdef WITH_INNOBASE_STORAGE_ENGINE
- innobase_data_file_path= argument;
-#endif
- break;
-#ifdef WITH_INNOBASE_STORAGE_ENGINE
- case OPT_INNODB_LOG_ARCHIVE:
- innobase_log_archive= argument ? test(atoi(argument)) : 1;
- break;
-#endif /* WITH_INNOBASE_STORAGE_ENGINE */
case OPT_MYISAM_RECOVER:
{
- if (!argument || !argument[0])
+ if (!argument)
{
myisam_recover_options= HA_RECOVER_DEFAULT;
myisam_recover_options_str= myisam_recover_typelib.type_names[0];
}
+ else if (!argument[0])
+ {
+ myisam_recover_options= HA_RECOVER_NONE;
+ myisam_recover_options_str= "OFF";
+ }
else
{
myisam_recover_options_str=argument;
@@ -7916,7 +7756,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
}
case OPT_FT_BOOLEAN_SYNTAX:
- if (ft_boolean_check_syntax_string((byte*) argument))
+ if (ft_boolean_check_syntax_string((uchar*) argument))
{
fprintf(stderr, "Invalid ft-boolean-syntax string: %s\n", argument);
exit(1);
@@ -7935,9 +7775,14 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
}
return 0;
}
- /* Initiates DEBUG - but no debugging here ! */
-static gptr *
+
+/* Handle arguments for multiple key caches */
+
+extern "C" uchar **mysql_getopt_value(const char *keyname, uint key_length,
+ const struct my_option *option);
+
+uchar* *
mysql_getopt_value(const char *keyname, uint key_length,
const struct my_option *option)
{
@@ -7952,13 +7797,13 @@ mysql_getopt_value(const char *keyname, uint key_length,
exit(1);
switch (option->id) {
case OPT_KEY_BUFFER_SIZE:
- return (gptr*) &key_cache->param_buff_size;
+ return (uchar**) &key_cache->param_buff_size;
case OPT_KEY_CACHE_BLOCK_SIZE:
- return (gptr*) &key_cache->param_block_size;
+ return (uchar**) &key_cache->param_block_size;
case OPT_KEY_CACHE_DIVISION_LIMIT:
- return (gptr*) &key_cache->param_division_limit;
+ return (uchar**) &key_cache->param_division_limit;
case OPT_KEY_CACHE_AGE_THRESHOLD:
- return (gptr*) &key_cache->param_age_threshold;
+ return (uchar**) &key_cache->param_age_threshold;
}
}
}
@@ -7966,16 +7811,24 @@ mysql_getopt_value(const char *keyname, uint key_length,
}
-static void option_error_reporter(enum loglevel level, const char *format, ...)
+extern "C" void option_error_reporter(enum loglevel level, const char *format, ...);
+
+void option_error_reporter(enum loglevel level, const char *format, ...)
{
va_list args;
va_start(args, format);
- vprint_msg_to_log(level, format, args);
+
+ /* Don't print warnings for --loose options during bootstrap */
+ if (level == ERROR_LEVEL || !opt_bootstrap ||
+ global_system_variables.log_warnings)
+ {
+ vprint_msg_to_log(level, format, args);
+ }
va_end(args);
}
-static void get_options(int argc,char **argv)
+static void get_options(int *argc,char **argv)
{
int ho_error;
@@ -7983,34 +7836,21 @@ static void get_options(int argc,char **argv)
strmake(def_ft_boolean_syntax, ft_boolean_syntax,
sizeof(ft_boolean_syntax)-1);
my_getopt_error_reporter= option_error_reporter;
- if ((ho_error= handle_options(&argc, &argv, my_long_options,
- get_one_option)))
+
+ /* Skip unknown options so that they may be processed later by plugins */
+ my_getopt_skip_unknown= TRUE;
+
+ if ((ho_error= handle_options(argc, &argv, my_long_options,
+ mysqld_get_one_option)))
exit(ho_error);
+ (*argc)++; /* add back one for the progname handle_options removes */
+ /* no need to do this for argv as we are discarding it. */
-#ifndef WITH_NDBCLUSTER_STORAGE_ENGINE
- if (opt_ndbcluster)
- sql_print_warning("this binary does not contain NDBCLUSTER storage engine");
-#endif
-#ifndef WITH_INNOBASE_STORAGE_ENGINE
- if (opt_innodb)
- sql_print_warning("this binary does not contain INNODB storage engine");
-#endif
- if ((opt_log_slow_admin_statements || opt_log_queries_not_using_indexes) &&
+ if ((opt_log_slow_admin_statements || opt_log_queries_not_using_indexes ||
+ opt_log_slow_slave_statements) &&
!opt_slow_log)
- sql_print_warning("options --log-slow-admin-statements and --log-queries-not-using-indexes have no effect if --log-slow-queries is not set");
+ sql_print_warning("options --log-slow-admin-statements, --log-queries-not-using-indexes and --log-slow-slave-statements have no effect if --log-slow-queries is not set");
- if (argc > 0)
- {
- fprintf(stderr, "%s: Too many arguments (first extra is '%s').\nUse --help to get a list of available options\n", my_progname, *argv);
- /* FIXME add EXIT_TOO_MANY_ARGUMENTS to "mysys_err.h" and return that code? */
- exit(1);
- }
-
- if (opt_help)
- {
- usage();
- exit(0);
- }
#if defined(HAVE_BROKEN_REALPATH)
my_use_symdir=0;
my_disable_symlinks=1;
@@ -8053,10 +7893,12 @@ static void get_options(int argc,char **argv)
/* Set global variables based on startup options */
myisam_block_size=(uint) 1 << my_bit_log2(opt_myisam_block_size);
+ /* long_query_time is in microseconds */
+ global_system_variables.long_query_time= max_system_variables.long_query_time=
+ (longlong) (long_query_time * 1000000.0);
+
if (opt_short_log_format)
opt_specialflag|= SPECIAL_SHORT_LOG_FORMAT;
- if (opt_log_queries_not_using_indexes)
- opt_specialflag|= SPECIAL_LOG_QUERIES_NOT_USING_INDEXES;
if (init_global_datetime_format(MYSQL_TIMESTAMP_DATE,
&global_system_variables.date_format) ||
@@ -8124,7 +7966,7 @@ static char *get_relative_path(const char *path)
*/
bool
-fn_format_relative_to_data_home(my_string to, const char *name,
+fn_format_relative_to_data_home(char * to, const char *name,
const char *dir, const char *extension)
{
char tmp_path[FN_REFLEN];
@@ -8242,7 +8084,7 @@ static ulong find_bit_type(const char *x, TYPELIB *bit_lib)
found=0;
found_end= 0;
- pos=(my_string) x;
+ pos=(char *) x;
while (*pos == ' ') pos++;
found_end= *pos == 0;
while (!found_end)
@@ -8339,7 +8181,7 @@ static void create_pid_file()
char buff[21], *end;
end= int10_to_str((long) getpid(), buff, 10);
*end++= '\n';
- if (!my_write(file, (byte*) buff, (uint) (end-buff), MYF(MY_WME | MY_NABP)))
+ if (!my_write(file, (uchar*) buff, (uint) (end-buff), MYF(MY_WME | MY_NABP)))
{
(void) my_close(file, MYF(0));
return;
@@ -8360,15 +8202,10 @@ void refresh_status(THD *thd)
add_to_status(&global_status_var, &thd->status_var);
/* Reset thread's status variables */
- bzero((char*) &thd->status_var, sizeof(thd->status_var));
+ bzero((uchar*) &thd->status_var, sizeof(thd->status_var));
/* Reset some global variables */
- for (SHOW_VAR *ptr= status_vars; ptr->name; ptr++)
- {
- /* Note that SHOW_LONG_NOFLUSH variables are not reset */
- if (ptr->type == SHOW_LONG)
- *(ulong*) ptr->value= 0;
- }
+ reset_status_vars();
/* Reset the counters of all key caches (default and named). */
process_key_caches(reset_key_cache_counters);
@@ -8390,51 +8227,9 @@ void refresh_status(THD *thd)
/*****************************************************************************
- Instantiate have_xyx for missing storage engines
+ Instantiate variables for missing storage engines
+ This section should go away soon
*****************************************************************************/
-#undef have_innodb
-#undef have_ndbcluster
-#undef have_csv_db
-
-SHOW_COMP_OPTION have_innodb= SHOW_OPTION_NO;
-SHOW_COMP_OPTION have_ndbcluster= SHOW_OPTION_NO;
-SHOW_COMP_OPTION have_csv_db= SHOW_OPTION_NO;
-SHOW_COMP_OPTION have_partition_db= SHOW_OPTION_NO;
-
-#ifndef WITH_INNOBASE_STORAGE_ENGINE
-uint innobase_flush_log_at_trx_commit;
-ulong innobase_fast_shutdown;
-long innobase_mirrored_log_groups, innobase_log_files_in_group;
-longlong innobase_log_file_size;
-long innobase_log_buffer_size;
-longlong innobase_buffer_pool_size;
-long innobase_additional_mem_pool_size;
-long innobase_file_io_threads, innobase_lock_wait_timeout;
-long innobase_force_recovery;
-long innobase_open_files;
-char *innobase_data_home_dir, *innobase_data_file_path;
-char *innobase_log_group_home_dir, *innobase_log_arch_dir;
-char *innobase_unix_file_flush_method;
-my_bool innobase_log_archive,
- innobase_use_doublewrite,
- innobase_use_checksums,
- innobase_file_per_table,
- innobase_locks_unsafe_for_binlog,
- innobase_rollback_on_timeout,
- innobase_stats_on_metadata;
-
-extern "C" {
-ulong srv_max_buf_pool_modified_pct;
-ulong srv_max_purge_lag;
-ulong srv_auto_extend_increment;
-ulong srv_n_spin_wait_rounds;
-ulong srv_n_free_tickets_to_enter;
-ulong srv_thread_sleep_delay;
-ulong srv_thread_concurrency;
-ulong srv_commit_concurrency;
-}
-
-#endif
#ifndef WITH_NDBCLUSTER_STORAGE_ENGINE
ulong ndb_cache_check_time;
diff --git a/sql/net_serv.cc b/sql/net_serv.cc
index 719e2ee0d3c..1f75d7ab1d7 100644
--- a/sql/net_serv.cc
+++ b/sql/net_serv.cc
@@ -108,7 +108,7 @@ extern void query_cache_insert(NET *net, const char *packet, ulong length);
#define TEST_BLOCKING 8
#define MAX_PACKET_LENGTH (256L*256L*256L-1)
-static my_bool net_write_buff(NET *net,const char *packet,ulong len);
+static my_bool net_write_buff(NET *net,const uchar *packet,ulong len);
/* Init with packet info */
@@ -116,13 +116,13 @@ static my_bool net_write_buff(NET *net,const char *packet,ulong len);
my_bool my_net_init(NET *net, Vio* vio)
{
DBUG_ENTER("my_net_init");
+ net->vio = vio;
my_net_local_init(net); /* Set some limits */
- if (!(net->buff=(uchar*) my_malloc((uint32) net->max_packet+
+ if (!(net->buff=(uchar*) my_malloc((size_t) net->max_packet+
NET_HEADER_SIZE + COMP_HEADER_SIZE,
MYF(MY_WME))))
DBUG_RETURN(1);
net->buff_end=net->buff+net->max_packet;
- net->vio = vio;
net->no_send_ok= net->no_send_eof= net->no_send_error= 0;
net->error=0; net->return_errno=0; net->return_status=0;
net->pkt_nr=net->compress_pkt_nr=0;
@@ -157,7 +157,7 @@ my_bool my_net_init(NET *net, Vio* vio)
void net_end(NET *net)
{
DBUG_ENTER("net_end");
- my_free((gptr) net->buff,MYF(MY_ALLOW_ZERO_PTR));
+ my_free(net->buff,MYF(MY_ALLOW_ZERO_PTR));
net->buff=0;
DBUG_VOID_RETURN;
}
@@ -165,17 +165,17 @@ void net_end(NET *net)
/* Realloc the packet buffer */
-my_bool net_realloc(NET *net, ulong length)
+my_bool net_realloc(NET *net, size_t length)
{
uchar *buff;
- ulong pkt_length;
+ size_t pkt_length;
DBUG_ENTER("net_realloc");
- DBUG_PRINT("enter",("length: %lu", length));
+ DBUG_PRINT("enter",("length: %lu", (ulong) length));
if (length >= net->max_packet_size)
{
DBUG_PRINT("error", ("Packet too large. Max size: %lu",
- net->max_packet_size));
+ net->max_packet_size));
net->error= 1;
net->report_error= 1;
net->last_errno= ER_NET_PACKET_TOO_LARGE;
@@ -186,9 +186,9 @@ my_bool net_realloc(NET *net, ulong length)
We must allocate some extra bytes for the end 0 and to be able to
read big compressed blocks
*/
- if (!(buff=(uchar*) my_realloc((char*) net->buff, (uint32) pkt_length +
- NET_HEADER_SIZE + COMP_HEADER_SIZE,
- MYF(MY_WME))))
+ if (!(buff= (uchar*) my_realloc((char*) net->buff, pkt_length +
+ NET_HEADER_SIZE + COMP_HEADER_SIZE,
+ MYF(MY_WME))))
{
net->error= 1;
net->report_error= 1;
@@ -196,7 +196,7 @@ my_bool net_realloc(NET *net, ulong length)
DBUG_RETURN(1);
}
net->buff=net->write_pos=buff;
- net->buff_end=buff+(net->max_packet=pkt_length);
+ net->buff_end=buff+(net->max_packet= (ulong) pkt_length);
DBUG_RETURN(0);
}
@@ -283,7 +283,8 @@ static int net_data_is_ready(my_socket sd)
void net_clear(NET *net, my_bool clear_buffer)
{
#if !defined(EMBEDDED_LIBRARY)
- int count, ready;
+ size_t count;
+ int ready;
#endif
DBUG_ENTER("net_clear");
@@ -293,14 +294,14 @@ void net_clear(NET *net, my_bool clear_buffer)
while ((ready= net_data_is_ready(net->vio->sd)) > 0)
{
/* The socket is ready */
- if ((count= vio_read(net->vio, (char*) (net->buff),
- (uint32) net->max_packet)) > 0)
+ if ((long) (count= vio_read(net->vio, net->buff,
+ (size_t) net->max_packet)) > 0)
{
- DBUG_PRINT("info",("skipped %d bytes from file: %s",
- count, vio_description(net->vio)));
+ DBUG_PRINT("info",("skipped %ld bytes from file: %s",
+ (long) count, vio_description(net->vio)));
#if defined(EXTRA_DEBUG)
- fprintf(stderr,"Note: net_clear() skipped %d bytes from file: %s\n",
- count, vio_description(net->vio));
+ fprintf(stderr,"Note: net_clear() skipped %ld bytes from file: %s\n",
+ (long) count, vio_description(net->vio));
#endif
}
else
@@ -318,10 +319,10 @@ void net_clear(NET *net, my_bool clear_buffer)
my_bool old_mode;
if (!vio_blocking(net->vio, FALSE, &old_mode))
{
- while ((count= vio_read(net->vio, (char*) (net->buff),
- (uint32) net->max_packet)) > 0)
- DBUG_PRINT("info",("skipped %d bytes from file: %s",
- count, vio_description(net->vio)));
+ while ((long) (count= vio_read(net->vio, net->buff,
+ (size_t) net->max_packet)) > 0)
+ DBUG_PRINT("info",("skipped %ld bytes from file: %s",
+ (long) count, vio_description(net->vio)));
vio_blocking(net->vio, TRUE, &old_mode);
}
}
@@ -342,8 +343,8 @@ my_bool net_flush(NET *net)
DBUG_ENTER("net_flush");
if (net->buff != net->write_pos)
{
- error=test(net_real_write(net,(char*) net->buff,
- (ulong) (net->write_pos - net->buff)));
+ error=test(net_real_write(net, net->buff,
+ (size_t) (net->write_pos - net->buff)));
net->write_pos=net->buff;
}
/* Sync packet number if using compression */
@@ -367,7 +368,7 @@ my_bool net_flush(NET *net)
*/
my_bool
-my_net_write(NET *net,const char *packet,ulong len)
+my_net_write(NET *net,const uchar *packet,size_t len)
{
uchar buff[NET_HEADER_SIZE];
if (unlikely(!net->vio)) /* nowhere to write */
@@ -382,7 +383,7 @@ my_net_write(NET *net,const char *packet,ulong len)
const ulong z_size = MAX_PACKET_LENGTH;
int3store(buff, z_size);
buff[3]= (uchar) net->pkt_nr++;
- if (net_write_buff(net, (char*) buff, NET_HEADER_SIZE) ||
+ if (net_write_buff(net, buff, NET_HEADER_SIZE) ||
net_write_buff(net, packet, z_size))
return 1;
packet += z_size;
@@ -391,10 +392,10 @@ my_net_write(NET *net,const char *packet,ulong len)
/* Write last packet */
int3store(buff,len);
buff[3]= (uchar) net->pkt_nr++;
- if (net_write_buff(net,(char*) buff,NET_HEADER_SIZE))
+ if (net_write_buff(net, buff, NET_HEADER_SIZE))
return 1;
#ifndef DEBUG_DATA_PACKETS
- DBUG_DUMP("packet_header",(char*) buff,NET_HEADER_SIZE);
+ DBUG_DUMP("packet_header", buff, NET_HEADER_SIZE);
#endif
return test(net_write_buff(net,packet,len));
}
@@ -429,14 +430,14 @@ my_net_write(NET *net,const char *packet,ulong len)
my_bool
net_write_command(NET *net,uchar command,
- const char *header, ulong head_len,
- const char *packet, ulong len)
+ const uchar *header, size_t head_len,
+ const uchar *packet, size_t len)
{
ulong length=len+1+head_len; /* 1 extra byte for command */
uchar buff[NET_HEADER_SIZE+1];
uint header_size=NET_HEADER_SIZE+1;
DBUG_ENTER("net_write_command");
- DBUG_PRINT("enter",("length: %lu", len));
+ DBUG_PRINT("enter",("length: %lu", (ulong) len));
buff[4]=command; /* For first packet */
@@ -448,7 +449,7 @@ net_write_command(NET *net,uchar command,
{
int3store(buff, MAX_PACKET_LENGTH);
buff[3]= (uchar) net->pkt_nr++;
- if (net_write_buff(net,(char*) buff, header_size) ||
+ if (net_write_buff(net, buff, header_size) ||
net_write_buff(net, header, head_len) ||
net_write_buff(net, packet, len))
DBUG_RETURN(1);
@@ -462,9 +463,9 @@ net_write_command(NET *net,uchar command,
}
int3store(buff,length);
buff[3]= (uchar) net->pkt_nr++;
- DBUG_RETURN(test(net_write_buff(net, (char*) buff, header_size) ||
- (head_len && net_write_buff(net, (char*) header, head_len)) ||
- net_write_buff(net, packet, len) || net_flush(net)));
+ DBUG_RETURN(test(net_write_buff(net, buff, header_size) ||
+ (head_len && net_write_buff(net, header, head_len)) ||
+ net_write_buff(net, packet, len) || net_flush(net)));
}
/*
@@ -497,7 +498,7 @@ net_write_command(NET *net,uchar command,
*/
static my_bool
-net_write_buff(NET *net,const char *packet,ulong len)
+net_write_buff(NET *net, const uchar *packet, ulong len)
{
ulong left_length;
if (net->compress && net->max_packet > MAX_PACKET_LENGTH)
@@ -514,8 +515,8 @@ net_write_buff(NET *net,const char *packet,ulong len)
{
/* Fill up already used packet and write it */
memcpy((char*) net->write_pos,packet,left_length);
- if (net_real_write(net,(char*) net->buff,
- (ulong) (net->write_pos - net->buff) + left_length))
+ if (net_real_write(net, net->buff,
+ (size_t) (net->write_pos - net->buff) + left_length))
return 1;
net->write_pos= net->buff;
packet+= left_length;
@@ -552,10 +553,10 @@ net_write_buff(NET *net,const char *packet,ulong len)
*/
int
-net_real_write(NET *net,const char *packet,ulong len)
+net_real_write(NET *net,const uchar *packet, size_t len)
{
- long int length;
- char *pos,*end;
+ size_t length;
+ const uchar *pos,*end;
thr_alarm_t alarmed;
#ifndef NO_ALARM
ALARM alarm_buff;
@@ -565,7 +566,7 @@ net_real_write(NET *net,const char *packet,ulong len)
DBUG_ENTER("net_real_write");
#if defined(MYSQL_SERVER) && defined(USE_QUERY_CACHE)
- query_cache_insert(net, packet, len);
+ query_cache_insert(net, (char*) packet, len);
#endif
if (net->error == 2)
@@ -575,11 +576,11 @@ net_real_write(NET *net,const char *packet,ulong len)
#ifdef HAVE_COMPRESS
if (net->compress)
{
- ulong complen;
+ size_t complen;
uchar *b;
uint header_length=NET_HEADER_SIZE+COMP_HEADER_SIZE;
- if (!(b=(uchar*) my_malloc((uint32) len + NET_HEADER_SIZE +
- COMP_HEADER_SIZE, MYF(MY_WME))))
+ if (!(b= (uchar*) my_malloc(len + NET_HEADER_SIZE +
+ COMP_HEADER_SIZE, MYF(MY_WME))))
{
#ifdef MYSQL_SERVER
net->last_errno= ER_OUT_OF_RESOURCES;
@@ -592,39 +593,40 @@ net_real_write(NET *net,const char *packet,ulong len)
}
memcpy(b+header_length,packet,len);
- if (my_compress((byte*) b+header_length,&len,&complen))
+ if (my_compress(b+header_length, &len, &complen))
complen=0;
int3store(&b[NET_HEADER_SIZE],complen);
int3store(b,len);
b[3]=(uchar) (net->compress_pkt_nr++);
len+= header_length;
- packet= (char*) b;
+ packet= b;
}
#endif /* HAVE_COMPRESS */
#ifdef DEBUG_DATA_PACKETS
- DBUG_DUMP("data",packet,len);
+ DBUG_DUMP("data", packet, len);
#endif
#ifndef NO_ALARM
thr_alarm_init(&alarmed);
if (net_blocking)
- thr_alarm(&alarmed,(uint) net->write_timeout,&alarm_buff);
+ thr_alarm(&alarmed, net->write_timeout, &alarm_buff);
#else
alarmed=0;
- /* Write timeout is set in net_set_write_timeout */
+ /* Write timeout is set in my_net_set_write_timeout */
#endif /* NO_ALARM */
- pos=(char*) packet; end=pos+len;
+ pos= packet;
+ end=pos+len;
while (pos != end)
{
- if ((long) (length=vio_write(net->vio,pos,(uint32) (end-pos))) <= 0)
+ if ((long) (length= vio_write(net->vio,pos,(size_t) (end-pos))) <= 0)
{
my_bool interrupted = vio_should_retry(net->vio);
#if !defined(__WIN__)
- if ((interrupted || length==0) && !thr_alarm_in_use(&alarmed))
+ if ((interrupted || length == 0) && !thr_alarm_in_use(&alarmed))
{
- if (!thr_alarm(&alarmed,(uint) net->write_timeout,&alarm_buff))
+ if (!thr_alarm(&alarmed, net->write_timeout, &alarm_buff))
{ /* Always true for client */
my_bool old_mode;
while (vio_blocking(net->vio, TRUE, &old_mode) < 0)
@@ -701,14 +703,14 @@ net_real_write(NET *net,const char *packet,ulong len)
#ifndef NO_ALARM
-static my_bool net_safe_read(NET *net, char *buff, uint32 length,
+static my_bool net_safe_read(NET *net, uchar *buff, size_t length,
thr_alarm_t *alarmed)
{
uint retry_count=0;
while (length > 0)
{
- int tmp;
- if ((tmp=vio_read(net->vio,(char*) net->buff, length)) <= 0)
+ size_t tmp;
+ if ((long) (tmp= vio_read(net->vio, buff, length)) <= 0)
{
my_bool interrupted = vio_should_retry(net->vio);
if (!thr_got_alarm(alarmed) && interrupted)
@@ -719,6 +721,7 @@ static my_bool net_safe_read(NET *net, char *buff, uint32 length,
return 1;
}
length-= tmp;
+ buff+= tmp;
}
return 0;
}
@@ -759,15 +762,15 @@ static my_bool my_net_skip_rest(NET *net, uint32 remain, thr_alarm_t *alarmed,
{
while (remain > 0)
{
- uint length= min(remain, net->max_packet);
- if (net_safe_read(net, (char*) net->buff, length, alarmed))
+ size_t length= min(remain, net->max_packet);
+ if (net_safe_read(net, net->buff, length, alarmed))
DBUG_RETURN(1);
update_statistics(thd_increment_bytes_received(length));
remain -= (uint32) length;
}
if (old != MAX_PACKET_LENGTH)
break;
- if (net_safe_read(net, (char*) net->buff, NET_HEADER_SIZE, alarmed))
+ if (net_safe_read(net, net->buff, NET_HEADER_SIZE, alarmed))
DBUG_RETURN(1);
old=remain= uint3korr(net->buff);
net->pkt_nr++;
@@ -784,10 +787,10 @@ static my_bool my_net_skip_rest(NET *net, uint32 remain, thr_alarm_t *alarmed,
*/
static ulong
-my_real_read(NET *net, ulong *complen)
+my_real_read(NET *net, size_t *complen)
{
uchar *pos;
- long length;
+ size_t length;
uint i,retry_count=0;
ulong len=packet_error;
thr_alarm_t alarmed;
@@ -805,7 +808,7 @@ my_real_read(NET *net, ulong *complen)
if (net_blocking)
thr_alarm(&alarmed,net->read_timeout,&alarm_buff);
#else
- /* Read timeout is set in net_set_read_timeout */
+ /* Read timeout is set in my_net_set_read_timeout */
#endif /* NO_ALARM */
pos = net->buff + net->where_b; /* net->packet -4 */
@@ -814,12 +817,12 @@ my_real_read(NET *net, ulong *complen)
while (remain > 0)
{
/* First read is done with non blocking mode */
- if ((int) (length=vio_read(net->vio,(char*) pos,remain)) <= 0L)
+ if ((long) (length= vio_read(net->vio, pos, remain)) <= 0L)
{
my_bool interrupted = vio_should_retry(net->vio);
DBUG_PRINT("info",("vio_read returned %ld errno: %d",
- length, vio_errno(net->vio)));
+ (long) length, vio_errno(net->vio)));
#if !defined(__WIN__) || defined(MYSQL_SERVER)
/*
We got an error that there was no data on the socket. We now set up
@@ -875,7 +878,7 @@ my_real_read(NET *net, ulong *complen)
}
#endif
DBUG_PRINT("error",("Couldn't read packet: remain: %u errno: %d length: %ld",
- remain, vio_errno(net->vio), length));
+ remain, vio_errno(net->vio), (long) length));
len= packet_error;
net->error= 2; /* Close socket */
net->report_error= 1;
@@ -886,13 +889,13 @@ my_real_read(NET *net, ulong *complen)
goto end;
}
remain -= (uint32) length;
- pos+= (ulong) length;
+ pos+= length;
update_statistics(thd_increment_bytes_received(length));
}
if (i == 0)
{ /* First parts is packet length */
ulong helping;
- DBUG_DUMP("packet_header",(char*) net->buff+net->where_b,
+ DBUG_DUMP("packet_header", net->buff+net->where_b,
NET_HEADER_SIZE);
if (net->buff[net->where_b + 3] != (uchar) net->pkt_nr)
{
@@ -963,7 +966,7 @@ end:
net->reading_or_writing=0;
#ifdef DEBUG_DATA_PACKETS
if (len != packet_error)
- DBUG_DUMP("data",(char*) net->buff+net->where_b, len);
+ DBUG_DUMP("data", net->buff+net->where_b, len);
#endif
return(len);
}
@@ -985,7 +988,7 @@ end:
ulong
my_net_read(NET *net)
{
- ulong len,complen;
+ size_t len, complen;
#ifdef HAVE_COMPRESS
if (!net->compress)
@@ -996,7 +999,7 @@ my_net_read(NET *net)
{
/* First packet of a multi-packet. Concatenate the packets */
ulong save_pos = net->where_b;
- ulong total_length=0;
+ size_t total_length= 0;
do
{
net->where_b += len;
@@ -1094,7 +1097,7 @@ my_net_read(NET *net)
net->where_b=buf_length;
if ((packet_len = my_real_read(net,&complen)) == packet_error)
return packet_error;
- if (my_uncompress((byte*) net->buff + net->where_b, &packet_len,
+ if (my_uncompress(net->buff + net->where_b, packet_len,
&complen))
{
net->error= 2; /* caller will close socket */
@@ -1104,7 +1107,7 @@ my_net_read(NET *net)
#endif
return packet_error;
}
- buf_length+=packet_len;
+ buf_length+= complen;
}
net->read_pos= net->buff+ first_packet_offset + NET_HEADER_SIZE;
@@ -1120,25 +1123,27 @@ my_net_read(NET *net)
}
-void net_set_read_timeout(NET *net, uint timeout)
+void my_net_set_read_timeout(NET *net, uint timeout)
{
- DBUG_ENTER("net_set_read_timeout");
+ DBUG_ENTER("my_net_set_read_timeout");
DBUG_PRINT("enter", ("timeout: %d", timeout));
net->read_timeout= timeout;
#ifdef NO_ALARM
- vio_timeout(net->vio, 0, timeout);
+ if (net->vio)
+ vio_timeout(net->vio, 0, timeout);
#endif
DBUG_VOID_RETURN;
}
-void net_set_write_timeout(NET *net, uint timeout)
+void my_net_set_write_timeout(NET *net, uint timeout)
{
- DBUG_ENTER("net_set_write_timeout");
+ DBUG_ENTER("my_net_set_write_timeout");
DBUG_PRINT("enter", ("timeout: %d", timeout));
net->write_timeout= timeout;
#ifdef NO_ALARM
- vio_timeout(net->vio, 1, timeout);
+ if (net->vio)
+ vio_timeout(net->vio, 1, timeout);
#endif
DBUG_VOID_RETURN;
}
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index f5cf79bd609..5a772501e48 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -80,9 +80,9 @@
*/
#define double2rows(x) ((ha_rows)(x))
-static int sel_cmp(Field *f,char *a,char *b,uint8 a_flag,uint8 b_flag);
+static int sel_cmp(Field *f,uchar *a,uchar *b,uint8 a_flag,uint8 b_flag);
-static char is_null_string[2]= {1,0};
+static uchar is_null_string[2]= {1,0};
class RANGE_OPT_PARAM;
/*
@@ -274,7 +274,7 @@ public:
ulong use_count;
Field *field;
- char *min_value,*max_value; // Pointer to range
+ uchar *min_value,*max_value; // Pointer to range
SEL_ARG *left,*right; /* R-B tree children */
SEL_ARG *next,*prev; /* Links for bi-directional interval list */
@@ -287,8 +287,8 @@ public:
SEL_ARG() {}
SEL_ARG(SEL_ARG &);
- SEL_ARG(Field *,const char *,const char *);
- SEL_ARG(Field *field, uint8 part, char *min_value, char *max_value,
+ SEL_ARG(Field *,const uchar *, const uchar *);
+ SEL_ARG(Field *field, uint8 part, uchar *min_value, uchar *max_value,
uint8 min_flag, uint8 max_flag, uint8 maybe_flag);
SEL_ARG(enum Type type_arg)
:min_flag(0),elements(1),use_count(1),left(0),next_key_part(0),
@@ -324,7 +324,7 @@ public:
}
SEL_ARG *clone_and(SEL_ARG* arg)
{ // Get overlapping range
- char *new_min,*new_max;
+ uchar *new_min,*new_max;
uint8 flag_min,flag_max;
if (cmp_min_to_min(arg) >= 0)
{
@@ -398,7 +398,7 @@ public:
min_flag=arg->max_flag & NEAR_MAX ? 0 : NEAR_MIN;
}
/* returns a number of keypart values (0 or 1) appended to the key buffer */
- int store_min(uint length,char **min_key,uint min_key_flag)
+ int store_min(uint length, uchar **min_key,uint min_key_flag)
{
if ((min_flag & GEOM_FLAG) ||
(!(min_flag & NO_MIN_RANGE) &&
@@ -417,7 +417,7 @@ public:
return 0;
}
/* returns a number of keypart values (0 or 1) appended to the key buffer */
- int store_max(uint length,char **max_key, uint max_key_flag)
+ int store_max(uint length, uchar **max_key, uint max_key_flag)
{
if (!(max_flag & NO_MAX_RANGE) &&
!(max_key_flag & (NO_MAX_RANGE | NEAR_MAX)))
@@ -436,7 +436,7 @@ public:
}
/* returns a number of keypart values appended to the key buffer */
- int store_min_key(KEY_PART *key,char **range_key, uint *range_key_flag)
+ int store_min_key(KEY_PART *key, uchar **range_key, uint *range_key_flag)
{
SEL_ARG *key_tree= first();
uint res= key_tree->store_min(key[key_tree->part].store_length,
@@ -452,7 +452,7 @@ public:
}
/* returns a number of keypart values appended to the key buffer */
- int store_max_key(KEY_PART *key,char **range_key, uint *range_key_flag)
+ int store_max_key(KEY_PART *key, uchar **range_key, uint *range_key_flag)
{
SEL_ARG *key_tree= last();
uint res=key_tree->store_max(key[key_tree->part].store_length,
@@ -534,8 +534,8 @@ public:
*/
if (min_flag || max_flag)
return FALSE;
- byte *min_val= (byte *)min_value;
- byte *max_val= (byte *)max_value;
+ uchar *min_val= min_value;
+ uchar *max_val= max_value;
if (maybe_null)
{
@@ -641,8 +641,7 @@ public:
longlong baseflag;
uint max_key_part, range_count;
-
- char min_key[MAX_KEY_LENGTH+MAX_FIELD_WIDTH],
+ uchar min_key[MAX_KEY_LENGTH+MAX_FIELD_WIDTH],
max_key[MAX_KEY_LENGTH+MAX_FIELD_WIDTH];
bool quick; // Don't calulate possible keys
@@ -683,8 +682,8 @@ static bool is_key_scan_ror(PARAM *param, uint keynr, uint8 nparts);
static ha_rows check_quick_select(PARAM *param,uint index,SEL_ARG *key_tree,
bool update_tbl_stats);
static ha_rows check_quick_keys(PARAM *param,uint index,SEL_ARG *key_tree,
- char *min_key, uint min_key_flag, int,
- char *max_key, uint max_key_flag, int);
+ uchar *min_key, uint min_key_flag, int,
+ uchar *max_key, uint max_key_flag, int);
QUICK_RANGE_SELECT *get_quick_select(PARAM *param,uint index,
SEL_ARG *key_tree,
@@ -726,12 +725,12 @@ static SEL_ARG *key_and(RANGE_OPT_PARAM *param, SEL_ARG *key1, SEL_ARG *key2,
uint clone_flag);
static bool get_range(SEL_ARG **e1,SEL_ARG **e2,SEL_ARG *root1);
bool get_quick_keys(PARAM *param,QUICK_RANGE_SELECT *quick,KEY_PART *key,
- SEL_ARG *key_tree,char *min_key,uint min_key_flag,
- char *max_key,uint max_key_flag);
+ SEL_ARG *key_tree, uchar *min_key,uint min_key_flag,
+ uchar *max_key,uint max_key_flag);
static bool eq_tree(SEL_ARG* a,SEL_ARG *b);
static SEL_ARG null_element(SEL_ARG::IMPOSSIBLE);
-static bool null_part_in_key(KEY_PART *key_part, const char *key,
+static bool null_part_in_key(KEY_PART *key_part, const uchar *key,
uint length);
bool sel_trees_can_be_ored(SEL_TREE *tree1, SEL_TREE *tree2, RANGE_OPT_PARAM* param);
@@ -986,7 +985,7 @@ SQL_SELECT *make_select(TABLE *head, table_map const_tables,
select->file= *head->sort.io_cache;
select->records=(ha_rows) (select->file.end_of_file/
head->file->ref_length);
- my_free((gptr) (head->sort.io_cache),MYF(0));
+ my_free(head->sort.io_cache, MYF(0));
head->sort.io_cache=0;
}
DBUG_RETURN(select);
@@ -1192,8 +1191,8 @@ QUICK_ROR_INTERSECT_SELECT::QUICK_ROR_INTERSECT_SELECT(THD *thd_param,
init_sql_alloc(&alloc, thd->variables.range_alloc_block_size, 0);
else
bzero(&alloc, sizeof(MEM_ROOT));
- last_rowid= (byte*)alloc_root(parent_alloc? parent_alloc : &alloc,
- head->file->ref_length);
+ last_rowid= (uchar*) alloc_root(parent_alloc? parent_alloc : &alloc,
+ head->file->ref_length);
}
@@ -1265,8 +1264,16 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler)
thd= head->in_use;
if (!(file= head->file->clone(thd->mem_root)))
{
+ /*
+ Manually set the error flag. Note: there seems to be quite a few
+ places where a failure could cause the server to "hang" the client by
+ sending no response to a query. ATM those are not real errors because
+ the storage engine calls in question happen to never fail with the
+ existing storage engines.
+ */
+ thd->net.report_error= 1; /* purecov: inspected */
/* Caller will free the memory */
- goto failure;
+ goto failure; /* purecov: inspected */
}
head->column_bitmaps_set(&column_bitmap, &column_bitmap);
@@ -1450,7 +1457,7 @@ int QUICK_ROR_UNION_SELECT::init()
DBUG_RETURN(1);
}
- if (!(cur_rowid= (byte*)alloc_root(&alloc, 2*head->file->ref_length)))
+ if (!(cur_rowid= (uchar*) alloc_root(&alloc, 2*head->file->ref_length)))
DBUG_RETURN(1);
prev_rowid= cur_rowid + head->file->ref_length;
DBUG_RETURN(0);
@@ -1468,7 +1475,7 @@ int QUICK_ROR_UNION_SELECT::init()
val2 Second merged select
*/
-int QUICK_ROR_UNION_SELECT::queue_cmp(void *arg, byte *val1, byte *val2)
+int QUICK_ROR_UNION_SELECT::queue_cmp(void *arg, uchar *val1, uchar *val2)
{
QUICK_ROR_UNION_SELECT *self= (QUICK_ROR_UNION_SELECT*)arg;
return self->head->file->cmp_ref(((QUICK_SELECT_I*)val1)->last_rowid,
@@ -1519,7 +1526,7 @@ int QUICK_ROR_UNION_SELECT::reset()
DBUG_RETURN(error);
}
quick->save_last_pos();
- queue_insert(&queue, (byte*)quick);
+ queue_insert(&queue, (uchar*)quick);
}
if (head->file->ha_rnd_init(1))
@@ -1552,8 +1559,8 @@ QUICK_ROR_UNION_SELECT::~QUICK_ROR_UNION_SELECT()
QUICK_RANGE::QUICK_RANGE()
:min_key(0),max_key(0),min_length(0),max_length(0),
- min_keypart_map(0), max_keypart_map(0),
- flag(NO_MIN_RANGE | NO_MAX_RANGE)
+ flag(NO_MIN_RANGE | NO_MAX_RANGE),
+ min_keypart_map(0), max_keypart_map(0)
{}
SEL_ARG::SEL_ARG(SEL_ARG &arg) :Sql_alloc()
@@ -1580,16 +1587,18 @@ inline void SEL_ARG::make_root()
use_count=0; elements=1;
}
-SEL_ARG::SEL_ARG(Field *f,const char *min_value_arg,const char *max_value_arg)
+SEL_ARG::SEL_ARG(Field *f,const uchar *min_value_arg,
+ const uchar *max_value_arg)
:min_flag(0), max_flag(0), maybe_flag(0), maybe_null(f->real_maybe_null()),
- elements(1), use_count(1), field(f), min_value((char*) min_value_arg),
- max_value((char*) max_value_arg), next(0),prev(0),
+ elements(1), use_count(1), field(f), min_value((uchar*) min_value_arg),
+ max_value((uchar*) max_value_arg), next(0),prev(0),
next_key_part(0),color(BLACK),type(KEY_RANGE)
{
left=right= &null_element;
}
-SEL_ARG::SEL_ARG(Field *field_,uint8 part_,char *min_value_,char *max_value_,
+SEL_ARG::SEL_ARG(Field *field_,uint8 part_,
+ uchar *min_value_, uchar *max_value_,
uint8 min_flag_,uint8 max_flag_,uint8 maybe_flag_)
:min_flag(min_flag_),max_flag(max_flag_),maybe_flag(maybe_flag_),
part(part_),maybe_null(field_->real_maybe_null()), elements(1),use_count(1),
@@ -1667,7 +1676,8 @@ SEL_ARG *SEL_ARG::last()
Returns -2 or 2 if the ranges where 'joined' like < 2 and >= 2
*/
-static int sel_cmp(Field *field, char *a,char *b,uint8 a_flag,uint8 b_flag)
+static int sel_cmp(Field *field, uchar *a, uchar *b, uint8 a_flag,
+ uint8 b_flag)
{
int cmp;
/* First check if there was a compare to a min or max element */
@@ -1691,7 +1701,7 @@ static int sel_cmp(Field *field, char *a,char *b,uint8 a_flag,uint8 b_flag)
goto end; // NULL where equal
a++; b++; // Skip NULL marker
}
- cmp=field->key_cmp((byte*) a,(byte*) b);
+ cmp=field->key_cmp(a , b);
if (cmp) return cmp < 0 ? -1 : 1; // The values differed
// Check if the compared equal arguments was defined with open/closed range
@@ -1746,10 +1756,10 @@ SEL_ARG *SEL_ARG::clone_tree(RANGE_OPT_PARAM *param)
the UPDATE/DELETE code will work:
* index can only be scanned in forward direction
* HA_EXTRA_KEYREAD will not be used
- Perhaps these assumptions could be relaxed
+ Perhaps these assumptions could be relaxed.
RETURN
- index number
+ Number of the index that produces the required ordering in the cheapest way
MAX_KEY if no such index was found.
*/
@@ -1768,6 +1778,7 @@ uint get_index_for_order(TABLE *table, ORDER *order, ha_rows limit)
if (!(table->keys_in_use_for_query.is_set(idx)))
continue;
KEY_PART_INFO *keyinfo= table->key_info[idx].key_part;
+ uint n_parts= table->key_info[idx].key_parts;
uint partno= 0;
/*
@@ -1777,7 +1788,7 @@ uint get_index_for_order(TABLE *table, ORDER *order, ha_rows limit)
*/
if (!(table->file->index_flags(idx, 0, 1) & HA_READ_ORDER))
continue;
- for (ord= order; ord; ord= ord->next, partno++)
+ for (ord= order; ord && partno < n_parts; ord= ord->next, partno++)
{
Item *item= order->item[0];
if (!(item->type() == Item::FIELD_ITEM &&
@@ -1970,7 +1981,7 @@ private:
KEY *index_info;
uint index;
uint key_infix_len;
- byte key_infix[MAX_KEY_LENGTH];
+ uchar key_infix[MAX_KEY_LENGTH];
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. */
@@ -1983,7 +1994,7 @@ public:
uint group_prefix_len_arg, uint used_key_parts_arg,
uint group_key_parts_arg, KEY *index_info_arg,
uint index_arg, uint key_infix_len_arg,
- byte *key_infix_arg,
+ uchar *key_infix_arg,
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),
@@ -2714,7 +2725,7 @@ end:
format.
*/
-void store_key_image_to_rec(Field *field, char *ptr, uint len)
+void store_key_image_to_rec(Field *field, uchar *ptr, uint len)
{
/* Do the same as print_key() does */
my_bitmap_map *old_map;
@@ -3416,7 +3427,7 @@ static void dbug_print_segment_range(SEL_ARG *arg, KEY_PART *part)
DBUG_LOCK_FILE;
if (!(arg->min_flag & NO_MIN_RANGE))
{
- store_key_image_to_rec(part->field, (char*)(arg->min_value), part->length);
+ store_key_image_to_rec(part->field, arg->min_value, part->length);
dbug_print_field(part->field);
if (arg->min_flag & NEAR_MIN)
fputs(" < ", DBUG_FILE);
@@ -3432,7 +3443,7 @@ static void dbug_print_segment_range(SEL_ARG *arg, KEY_PART *part)
fputs(" < ", DBUG_FILE);
else
fputs(" <= ", DBUG_FILE);
- store_key_image_to_rec(part->field, (char*)(arg->max_value), part->length);
+ store_key_image_to_rec(part->field, arg->max_value, part->length);
dbug_print_field(part->field);
}
fputs("\n", DBUG_FILE);
@@ -3495,7 +3506,7 @@ double get_sweep_read_cost(const PARAM *param, ha_rows records)
if (param->table->file->primary_key_is_clustered())
{
result= param->table->file->read_time(param->table->s->primary_key,
- records, records);
+ (uint)records, records);
}
else
{
@@ -3704,7 +3715,7 @@ TABLE_READ_PLAN *get_best_disjunct_quick(PARAM *param, SEL_IMERGE *imerge,
/* Add Unique operations cost */
unique_calc_buff_size=
- Unique::get_cost_calc_buff_size(non_cpk_scan_records,
+ Unique::get_cost_calc_buff_size((ulong)non_cpk_scan_records,
param->table->file->ref_length,
param->thd->variables.sortbuff_size);
if (param->imerge_cost_buff_size < unique_calc_buff_size)
@@ -3716,7 +3727,7 @@ TABLE_READ_PLAN *get_best_disjunct_quick(PARAM *param, SEL_IMERGE *imerge,
}
imerge_cost +=
- Unique::get_use_cost(param->imerge_cost_buff, non_cpk_scan_records,
+ Unique::get_use_cost(param->imerge_cost_buff, (uint)non_cpk_scan_records,
param->table->file->ref_length,
param->thd->variables.sortbuff_size);
DBUG_PRINT("info",("index_merge total cost: %g (wanted: less then %g)",
@@ -4056,7 +4067,7 @@ ROR_INTERSECT_INFO* ror_intersect_init(const PARAM *param)
info->is_covering= FALSE;
info->index_scan_costs= 0.0;
info->index_records= 0;
- info->out_rows= param->table->file->stats.records;
+ info->out_rows= (double) param->table->file->stats.records;
bitmap_clear_all(&info->covered_fields);
return info;
}
@@ -4169,8 +4180,8 @@ static double ror_scan_selectivity(const ROR_INTERSECT_INFO *info,
{
double selectivity_mult= 1.0;
KEY_PART_INFO *key_part= info->param->table->key_info[scan->keynr].key_part;
- byte key_val[MAX_KEY_LENGTH+MAX_FIELD_WIDTH]; /* key values tuple */
- char *key_ptr= (char*) key_val;
+ uchar key_val[MAX_KEY_LENGTH+MAX_FIELD_WIDTH]; /* key values tuple */
+ uchar *key_ptr= key_val;
SEL_ARG *sel_arg, *tuple_arg= NULL;
key_part_map keypart_map= 0;
bool cur_covered;
@@ -4178,9 +4189,9 @@ static double ror_scan_selectivity(const ROR_INTERSECT_INFO *info,
key_part->fieldnr-1));
key_range min_range;
key_range max_range;
- min_range.key= (byte*) key_val;
+ min_range.key= key_val;
min_range.flag= HA_READ_KEY_EXACT;
- max_range.key= (byte*) key_val;
+ max_range.key= key_val;
max_range.flag= HA_READ_AFTER_KEY;
ha_rows prev_records= info->param->table->file->stats.records;
DBUG_ENTER("ror_scan_selectivity");
@@ -4209,7 +4220,7 @@ static double ror_scan_selectivity(const ROR_INTERSECT_INFO *info,
&key_ptr, 0);
keypart_map= (keypart_map << 1) | 1;
}
- min_range.length= max_range.length= ((char*) key_ptr - (char*) key_val);
+ min_range.length= max_range.length= (size_t) (key_ptr - key_val);
min_range.keypart_map= max_range.keypart_map= keypart_map;
records= (info->param->table->file->
records_in_range(scan->keynr, &min_range, &max_range));
@@ -5549,7 +5560,7 @@ get_mm_leaf(RANGE_OPT_PARAM *param, COND *conf_func, Field *field,
bool optimize_range;
SEL_ARG *tree= 0;
MEM_ROOT *alloc= param->mem_root;
- char *str;
+ uchar *str;
ulong orig_sql_mode;
int err;
DBUG_ENTER("get_mm_leaf");
@@ -5611,9 +5622,10 @@ get_mm_leaf(RANGE_OPT_PARAM *param, COND *conf_func, Field *field,
if (type == Item_func::LIKE_FUNC)
{
bool like_error;
- char buff1[MAX_FIELD_WIDTH],*min_str,*max_str;
+ char buff1[MAX_FIELD_WIDTH];
+ uchar *min_str,*max_str;
String tmp(buff1,sizeof(buff1),value->collation.collation),*res;
- uint length,offset,min_length,max_length;
+ size_t length, offset, min_length, max_length;
uint field_length= field->pack_length()+maybe_null;
if (!optimize_range)
@@ -5660,7 +5672,7 @@ get_mm_leaf(RANGE_OPT_PARAM *param, COND *conf_func, Field *field,
field_length= length;
}
length+=offset;
- if (!(min_str= (char*) alloc_root(alloc, length*2)))
+ if (!(min_str= (uchar*) alloc_root(alloc, length*2)))
goto end;
max_str=min_str+length;
@@ -5673,7 +5685,7 @@ get_mm_leaf(RANGE_OPT_PARAM *param, COND *conf_func, Field *field,
((Item_func_like*)(param->cond))->escape,
wild_one, wild_many,
field_length,
- min_str+offset, max_str+offset,
+ (char*) min_str+offset, (char*) max_str+offset,
&min_length, &max_length);
if (like_error) // Can't optimize with LIKE
goto end;
@@ -5735,12 +5747,13 @@ get_mm_leaf(RANGE_OPT_PARAM *param, COND *conf_func, Field *field,
goto end;
}
field->table->in_use->variables.sql_mode= orig_sql_mode;
- str= (char*) alloc_root(alloc, key_part->store_length+1);
+ str= (uchar*) alloc_root(alloc, key_part->store_length+1);
if (!str)
goto end;
if (maybe_null)
- *str= (char) field->is_real_null(); // Set to 1 if null
- field->get_key_image(str+maybe_null, key_part->length, key_part->image_type);
+ *str= (uchar) field->is_real_null(); // Set to 1 if null
+ field->get_key_image(str+maybe_null, key_part->length,
+ key_part->image_type);
if (!(tree= new (alloc) SEL_ARG(field, str, str)))
goto end; // out of memory
@@ -7240,17 +7253,22 @@ check_quick_select(PARAM *param,uint idx,SEL_ARG *tree, bool update_tbl_stats)
param->is_ror_scan is cleared if the function detects that the key scan is
not a Rowid-Ordered Retrieval scan ( see comments for is_key_scan_ror
function for description of which key scans are ROR scans)
+
+ RETURN
+ #records E(#records) for given subtree
+ HA_POS_ERROR if subtree cannot be used for record retrieval
+
*/
static ha_rows
check_quick_keys(PARAM *param, uint idx, SEL_ARG *key_tree,
- char *min_key, uint min_key_flag, int min_keypart,
- char *max_key, uint max_key_flag, int max_keypart)
+ uchar *min_key, uint min_key_flag, int min_keypart,
+ uchar *max_key, uint max_key_flag, int max_keypart)
{
ha_rows records=0, tmp;
uint tmp_min_flag, tmp_max_flag, keynr, min_key_length, max_key_length;
uint tmp_min_keypart= min_keypart, tmp_max_keypart= max_keypart;
- char *tmp_min_key, *tmp_max_key;
+ uchar *tmp_min_key, *tmp_max_key;
uint8 save_first_null_comp= param->first_null_comp;
param->max_key_part=max(param->max_key_part,key_tree->part);
@@ -7370,7 +7388,7 @@ check_quick_keys(PARAM *param, uint idx, SEL_ARG *key_tree,
if (tmp_min_flag & GEOM_FLAG)
{
key_range min_range;
- min_range.key= (byte*) param->min_key;
+ min_range.key= param->min_key;
min_range.length= min_key_length;
min_range.keypart_map= make_keypart_map(tmp_min_keypart);
/* In this case tmp_min_flag contains the handler-read-function */
@@ -7383,12 +7401,12 @@ check_quick_keys(PARAM *param, uint idx, SEL_ARG *key_tree,
{
key_range min_range, max_range;
- min_range.key= (byte*) param->min_key;
+ min_range.key= param->min_key;
min_range.length= min_key_length;
min_range.flag= (tmp_min_flag & NEAR_MIN ? HA_READ_AFTER_KEY :
HA_READ_KEY_EXACT);
min_range.keypart_map= make_keypart_map(tmp_min_keypart);
- max_range.key= (byte*) param->max_key;
+ max_range.key= param->max_key;
max_range.length= max_key_length;
max_range.flag= (tmp_max_flag & NEAR_MAX ?
HA_READ_BEFORE_KEY : HA_READ_AFTER_KEY);
@@ -7441,27 +7459,24 @@ check_quick_keys(PARAM *param, uint idx, SEL_ARG *key_tree,
ROR (Rowid Ordered Retrieval) key scan is a key scan that produces
ordered sequence of rowids (ha_xxx::cmp_ref is the comparison function)
- An index scan is a ROR scan if it is done using a condition in form
+ This function is needed to handle a practically-important special case:
+ an index scan is a ROR scan if it is done using a condition in form
- "key1_1=c_1 AND ... AND key1_n=c_n" (1)
+ "key1_1=c_1 AND ... AND key1_n=c_n"
where the index is defined on (key1_1, ..., key1_N [,a_1, ..., a_n])
- and the table has a clustered Primary Key
-
- PRIMARY KEY(a_1, ..., a_n, b1, ..., b_k) with first key parts being
- identical to uncovered parts ot the key being scanned (2)
-
- Scans on HASH indexes are not ROR scans,
- any range scan on clustered primary key is ROR scan (3)
+ and the table has a clustered Primary Key defined as
- Check (1) is made in check_quick_keys()
- Check (3) is made check_quick_select()
- Check (2) is made by this function.
+ PRIMARY KEY(a_1, ..., a_n, b1, ..., b_k)
+
+ i.e. the first key parts of it are identical to uncovered parts ot the
+ key being scanned. This function assumes that the index flags do not
+ include HA_KEY_SCAN_NOT_ROR flag (that is checked elsewhere).
RETURN
- TRUE If the scan is ROR-scan
- FALSE otherwise
+ TRUE The scan is ROR-scan
+ FALSE Otherwise
*/
static bool is_key_scan_ror(PARAM *param, uint keynr, uint8 nparts)
@@ -7557,8 +7572,8 @@ get_quick_select(PARAM *param,uint idx,SEL_ARG *key_tree,
*/
bool
get_quick_keys(PARAM *param,QUICK_RANGE_SELECT *quick,KEY_PART *key,
- SEL_ARG *key_tree,char *min_key,uint min_key_flag,
- char *max_key, uint max_key_flag)
+ SEL_ARG *key_tree, uchar *min_key,uint min_key_flag,
+ uchar *max_key, uint max_key_flag)
{
QUICK_RANGE *range;
uint flag;
@@ -7571,7 +7586,7 @@ get_quick_keys(PARAM *param,QUICK_RANGE_SELECT *quick,KEY_PART *key,
min_key,min_key_flag, max_key, max_key_flag))
return 1;
}
- char *tmp_min_key=min_key,*tmp_max_key=max_key;
+ uchar *tmp_min_key=min_key,*tmp_max_key=max_key;
min_part+= key_tree->store_min(key[key_tree->part].store_length,
&tmp_min_key,min_key_flag);
max_part+= key_tree->store_max(key[key_tree->part].store_length,
@@ -7595,10 +7610,10 @@ 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);
+ &tmp_min_flag);
if (!tmp_max_flag)
max_part+= key_tree->next_key_part->store_max_key(key, &tmp_max_key,
- &tmp_max_flag);
+ &tmp_max_flag);
flag=tmp_min_flag | tmp_max_flag;
}
}
@@ -7646,10 +7661,10 @@ get_quick_keys(PARAM *param,QUICK_RANGE_SELECT *quick,KEY_PART *key,
}
/* Get range for retrieving rows in QUICK_SELECT::get_next */
- if (!(range= new QUICK_RANGE((const char *) param->min_key,
+ if (!(range= new QUICK_RANGE(param->min_key,
(uint) (tmp_min_key - param->min_key),
min_part >=0 ? make_keypart_map(min_part) : 0,
- (const char *) param->max_key,
+ param->max_key,
(uint) (tmp_max_key - param->max_key),
max_part >=0 ? make_keypart_map(max_part) : 0,
flag)))
@@ -7658,7 +7673,7 @@ get_quick_keys(PARAM *param,QUICK_RANGE_SELECT *quick,KEY_PART *key,
set_if_bigger(quick->max_used_key_length, range->min_length);
set_if_bigger(quick->max_used_key_length, range->max_length);
set_if_bigger(quick->used_key_parts, (uint) key_tree->part+1);
- if (insert_dynamic(&quick->ranges, (gptr)&range))
+ if (insert_dynamic(&quick->ranges, (uchar*) &range))
return 1;
end:
@@ -7691,9 +7706,9 @@ bool QUICK_RANGE_SELECT::unique_key_range()
/* Returns TRUE if any part of the key is NULL */
-static bool null_part_in_key(KEY_PART *key_part, const char *key, uint length)
+static bool null_part_in_key(KEY_PART *key_part, const uchar *key, uint length)
{
- for (const char *end=key+length ;
+ for (const uchar *end=key+length ;
key < end;
key+= key_part++->store_length)
{
@@ -7796,13 +7811,12 @@ QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table,
!(range= new(alloc) QUICK_RANGE()))
goto err; // out of memory
- range->min_key= range->max_key= (char*) ref->key_buff;
+ range->min_key= range->max_key= ref->key_buff;
range->min_length= range->max_length= ref->key_length;
range->min_keypart_map= range->max_keypart_map=
make_prev_keypart_map(ref->key_parts);
range->flag= ((ref->key_length == key_info->key_length &&
- (key_info->flags & (HA_NOSAME | HA_END_SPACE_KEY)) ==
- HA_NOSAME) ? EQ_RANGE : 0);
+ (key_info->flags & HA_END_SPACE_KEY) == 0) ? EQ_RANGE : 0);
if (!(quick->key_parts=key_part=(KEY_PART *)
alloc_root(&quick->alloc,sizeof(KEY_PART)*ref->key_parts)))
@@ -7817,7 +7831,7 @@ QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table,
key_part->null_bit= key_info->key_part[part].null_bit;
key_part->flag= (uint8) key_info->key_part[part].key_part_flag;
}
- if (insert_dynamic(&quick->ranges,(gptr)&range))
+ if (insert_dynamic(&quick->ranges,(uchar*)&range))
goto err;
/*
@@ -7832,13 +7846,13 @@ QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table,
*ref->null_ref_key= 1; // Set null byte then create a range
if (!(null_range= new (alloc)
- QUICK_RANGE((char*)ref->key_buff, ref->key_length,
+ QUICK_RANGE(ref->key_buff, ref->key_length,
make_prev_keypart_map(ref->key_parts),
- (char*)ref->key_buff, ref->key_length,
+ ref->key_buff, ref->key_length,
make_prev_keypart_map(ref->key_parts), EQ_RANGE)))
goto err;
*ref->null_ref_key= 0; // Clear null byte
- if (insert_dynamic(&quick->ranges,(gptr)&null_range))
+ if (insert_dynamic(&quick->ranges,(uchar*)&null_range))
goto err;
}
@@ -8093,7 +8107,7 @@ int QUICK_ROR_UNION_SELECT::get_next()
{
int error, dup_row;
QUICK_SELECT_I *quick;
- byte *tmp;
+ uchar *tmp;
DBUG_ENTER("QUICK_ROR_UNION_SELECT::get_next");
do
@@ -8143,7 +8157,7 @@ int QUICK_ROR_UNION_SELECT::get_next()
int QUICK_RANGE_SELECT::reset()
{
uint mrange_bufsiz;
- byte *mrange_buff;
+ uchar *mrange_buff;
DBUG_ENTER("QUICK_RANGE_SELECT::reset");
next=0;
last_range= NULL;
@@ -8182,12 +8196,13 @@ int QUICK_RANGE_SELECT::reset()
if (file->ha_table_flags() & HA_NEED_READ_RANGE_BUFFER)
{
mrange_bufsiz= min(multi_range_bufsiz,
- (QUICK_SELECT_I::records + 1)* head->s->reclength);
+ ((uint)QUICK_SELECT_I::records + 1)* head->s->reclength);
while (mrange_bufsiz &&
! my_multi_malloc(MYF(MY_WME),
- &multi_range_buff, sizeof(*multi_range_buff),
- &mrange_buff, mrange_bufsiz,
+ &multi_range_buff,
+ (uint) sizeof(*multi_range_buff),
+ &mrange_buff, (uint) mrange_bufsiz,
NullS))
{
/* Try to shrink the buffers until both are 0. */
@@ -8282,13 +8297,13 @@ int QUICK_RANGE_SELECT::get_next()
end_key= &mrange_slot->end_key;
last_range= *(cur_range++);
- start_key->key= (const byte*) last_range->min_key;
+ start_key->key= (const uchar*) last_range->min_key;
start_key->length= last_range->min_length;
start_key->flag= ((last_range->flag & NEAR_MIN) ? HA_READ_AFTER_KEY :
(last_range->flag & EQ_RANGE) ?
HA_READ_KEY_EXACT : HA_READ_KEY_OR_NEXT);
start_key->keypart_map= last_range->min_keypart_map;
- end_key->key= (const byte*) last_range->max_key;
+ end_key->key= (const uchar*) last_range->max_key;
end_key->length= last_range->max_length;
/*
We use HA_READ_AFTER_KEY here because if we are reading on a key
@@ -8348,7 +8363,7 @@ end:
int QUICK_RANGE_SELECT::get_next_prefix(uint prefix_length,
key_part_map keypart_map,
- byte *cur_prefix)
+ uchar *cur_prefix)
{
DBUG_ENTER("QUICK_RANGE_SELECT::get_next_prefix");
@@ -8360,7 +8375,8 @@ int QUICK_RANGE_SELECT::get_next_prefix(uint prefix_length,
{
/* Read the next record in the same range with prefix after cur_prefix. */
DBUG_ASSERT(cur_prefix != 0);
- result= file->index_read(record, cur_prefix, keypart_map, HA_READ_AFTER_KEY);
+ result= file->index_read_map(record, cur_prefix, keypart_map,
+ HA_READ_AFTER_KEY);
if (result || (file->compare_key(file->end_range) <= 0))
DBUG_RETURN(result);
}
@@ -8374,13 +8390,13 @@ int QUICK_RANGE_SELECT::get_next_prefix(uint prefix_length,
}
last_range= *(cur_range++);
- start_key.key= (const byte*) last_range->min_key;
+ start_key.key= (const uchar*) last_range->min_key;
start_key.length= min(last_range->min_length, prefix_length);
start_key.keypart_map= last_range->min_keypart_map & keypart_map;
start_key.flag= ((last_range->flag & NEAR_MIN) ? HA_READ_AFTER_KEY :
(last_range->flag & EQ_RANGE) ?
HA_READ_KEY_EXACT : HA_READ_KEY_OR_NEXT);
- end_key.key= (const byte*) last_range->max_key;
+ end_key.key= (const uchar*) last_range->max_key;
end_key.length= min(last_range->max_length, prefix_length);
end_key.keypart_map= last_range->max_keypart_map & keypart_map;
/*
@@ -8416,7 +8432,7 @@ int QUICK_RANGE_SELECT_GEOM::get_next()
if (last_range)
{
// Already read through key
- result= file->index_next_same(record, (byte*) last_range->min_key,
+ result= file->index_next_same(record, last_range->min_key,
last_range->min_length);
if (result != HA_ERR_END_OF_FILE)
DBUG_RETURN(result);
@@ -8431,9 +8447,10 @@ int QUICK_RANGE_SELECT_GEOM::get_next()
}
last_range= *(cur_range++);
- result= file->index_read(record, (byte*) last_range->min_key,
- last_range->min_keypart_map,
- (ha_rkey_function)(last_range->flag ^ GEOM_FLAG));
+ result= file->index_read_map(record, last_range->min_key,
+ last_range->min_keypart_map,
+ (ha_rkey_function)(last_range->flag ^
+ GEOM_FLAG));
if (result != HA_ERR_KEY_NOT_FOUND && result != HA_ERR_END_OF_FILE)
DBUG_RETURN(result);
last_range= 0; // Not found, to next range
@@ -8536,7 +8553,7 @@ int QUICK_SELECT_DESC::get_next()
if (last_range)
{ // Already read through key
result = ((last_range->flag & EQ_RANGE)
- ? file->index_next_same(record, (byte*) last_range->min_key,
+ ? file->index_next_same(record, last_range->min_key,
last_range->min_length) :
file->index_prev(record));
if (!result)
@@ -8564,18 +8581,19 @@ int QUICK_SELECT_DESC::get_next()
if (last_range->flag & EQ_RANGE)
{
- result = file->index_read(record, (byte*) last_range->max_key,
- last_range->max_keypart_map, HA_READ_KEY_EXACT);
+ result = file->index_read_map(record, last_range->max_key,
+ last_range->max_keypart_map,
+ HA_READ_KEY_EXACT);
}
else
{
DBUG_ASSERT(last_range->flag & NEAR_MAX ||
range_reads_after_key(last_range));
- result=file->index_read(record, (byte*) last_range->max_key,
- last_range->max_keypart_map,
- ((last_range->flag & NEAR_MAX) ?
- HA_READ_BEFORE_KEY :
- HA_READ_PREFIX_LAST_OR_PREV));
+ result=file->index_read_map(record, last_range->max_key,
+ last_range->max_keypart_map,
+ ((last_range->flag & NEAR_MAX) ?
+ HA_READ_BEFORE_KEY :
+ HA_READ_PREFIX_LAST_OR_PREV));
}
if (result)
{
@@ -8608,7 +8626,7 @@ int QUICK_RANGE_SELECT::cmp_next(QUICK_RANGE *range_arg)
KEY_PART *key_part=key_parts;
uint store_length;
- for (char *key=range_arg->max_key, *end=key+range_arg->max_length;
+ for (uchar *key=range_arg->max_key, *end=key+range_arg->max_length;
key < end;
key+= store_length, key_part++)
{
@@ -8627,7 +8645,7 @@ int QUICK_RANGE_SELECT::cmp_next(QUICK_RANGE *range_arg)
key++; // Skip null byte
store_length--;
}
- if ((cmp=key_part->field->key_cmp((byte*) key, key_part->length)) < 0)
+ if ((cmp=key_part->field->key_cmp(key, key_part->length)) < 0)
return 0;
if (cmp > 0)
return 1;
@@ -8646,7 +8664,7 @@ int QUICK_RANGE_SELECT::cmp_prev(QUICK_RANGE *range_arg)
if (range_arg->flag & NO_MIN_RANGE)
return 0; /* key can't be to small */
- cmp= key_cmp(key_part_info, (byte*) range_arg->min_key,
+ cmp= key_cmp(key_part_info, range_arg->min_key,
range_arg->min_length);
if (cmp > 0 || cmp == 0 && !(range_arg->flag & NEAR_MIN))
return 0;
@@ -8896,7 +8914,7 @@ static bool get_constant_key_infix(KEY *index_info, SEL_ARG *index_range_tree,
KEY_PART_INFO *first_non_group_part,
KEY_PART_INFO *min_max_arg_part,
KEY_PART_INFO *last_part, THD *thd,
- byte *key_infix, uint *key_infix_len,
+ uchar *key_infix, uint *key_infix_len,
KEY_PART_INFO **first_non_infix_part);
static bool
check_group_min_max_predicates(COND *cond, Item_field *min_max_arg_item,
@@ -9053,7 +9071,7 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree)
uint index= 0; /* The id of the chosen index. */
uint group_key_parts= 0; // Number of index key parts in the group prefix.
uint used_key_parts= 0; /* Number of index key parts used for access. */
- byte key_infix[MAX_KEY_LENGTH]; /* Constants from equality predicates.*/
+ uchar key_infix[MAX_KEY_LENGTH]; /* Constants from equality predicates.*/
uint key_infix_len= 0; /* Length of key_infix. */
TRP_GROUP_MIN_MAX *read_plan= NULL; /* The eventually constructed TRP. */
uint key_part_nr;
@@ -9337,7 +9355,7 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree)
/* Check if cur_part is referenced in the WHERE clause. */
if (join->conds->walk(&Item::find_item_in_field_list_processor, 0,
- (byte*) key_part_range))
+ (uchar*) key_part_range))
goto next_index;
}
}
@@ -9607,7 +9625,7 @@ get_constant_key_infix(KEY *index_info, SEL_ARG *index_range_tree,
KEY_PART_INFO *first_non_group_part,
KEY_PART_INFO *min_max_arg_part,
KEY_PART_INFO *last_part, THD *thd,
- byte *key_infix, uint *key_infix_len,
+ uchar *key_infix, uint *key_infix_len,
KEY_PART_INFO **first_non_infix_part)
{
SEL_ARG *cur_range;
@@ -9616,7 +9634,7 @@ get_constant_key_infix(KEY *index_info, SEL_ARG *index_range_tree,
KEY_PART_INFO *end_part= min_max_arg_part ? min_max_arg_part : last_part;
*key_infix_len= 0;
- byte *key_ptr= key_infix;
+ uchar *key_ptr= key_infix;
for (cur_part= first_non_group_part; cur_part != end_part; cur_part++)
{
/*
@@ -9804,7 +9822,7 @@ void cost_group_min_max(TABLE* table, KEY *index_info, uint used_key_parts,
bool have_min, bool have_max,
double *read_cost, ha_rows *records)
{
- uint table_records;
+ ha_rows table_records;
uint num_groups;
uint num_blocks;
uint keys_per_block;
@@ -9821,14 +9839,14 @@ void cost_group_min_max(TABLE* table, KEY *index_info, uint used_key_parts,
keys_per_block= (table->file->stats.block_size / 2 /
(index_info->key_length + table->file->ref_length)
+ 1);
- num_blocks= (table_records / keys_per_block) + 1;
+ num_blocks= (uint)(table_records / keys_per_block) + 1;
/* Compute the number of keys in a group. */
keys_per_group= index_info->rec_per_key[group_key_parts - 1];
if (keys_per_group == 0) /* If there is no statistics try to guess */
/* each group contains 10% of all records */
- keys_per_group= (table_records / 10) + 1;
- num_groups= (table_records / keys_per_group) + 1;
+ keys_per_group= (uint)(table_records / 10) + 1;
+ num_groups= (uint)(table_records / keys_per_group) + 1;
/* Apply the selectivity of the quick select for group prefixes. */
if (range_tree && (quick_prefix_records != HA_POS_ERROR))
@@ -9872,9 +9890,9 @@ void cost_group_min_max(TABLE* table, KEY *index_info, uint used_key_parts,
*records= num_groups;
DBUG_PRINT("info",
- ("table rows: %u keys/block: %u keys/group: %u result rows: %lu blocks: %u",
- table_records, keys_per_block, keys_per_group, (ulong) *records,
- num_blocks));
+ ("table rows: %lu keys/block: %u keys/group: %u result rows: %lu blocks: %u",
+ (ulong)table_records, keys_per_block, keys_per_group,
+ (ulong) *records, num_blocks));
DBUG_VOID_RETURN;
}
@@ -10006,13 +10024,14 @@ QUICK_GROUP_MIN_MAX_SELECT(TABLE *table, JOIN *join_arg, bool have_min_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,
- byte *key_infix_arg, MEM_ROOT *parent_alloc)
+ uchar *key_infix_arg, MEM_ROOT *parent_alloc)
:join(join_arg), index_info(index_info_arg),
- group_prefix_len(group_prefix_len_arg), have_min(have_min_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), group_key_parts(group_key_parts_arg)
+ max_functions_it(NULL)
{
head= table;
file= head->file;
@@ -10064,13 +10083,13 @@ int QUICK_GROUP_MIN_MAX_SELECT::init()
if (group_prefix) /* Already initialized. */
return 0;
- if (!(last_prefix= (byte*) alloc_root(&alloc, group_prefix_len)))
+ if (!(last_prefix= (uchar*) alloc_root(&alloc, group_prefix_len)))
return 1;
/*
We may use group_prefix to store keys with all select fields, so allocate
enough space for it.
*/
- if (!(group_prefix= (byte*) alloc_root(&alloc,
+ if (!(group_prefix= (uchar*) alloc_root(&alloc,
real_prefix_len + min_max_arg_len)))
return 1;
@@ -10080,7 +10099,7 @@ int QUICK_GROUP_MIN_MAX_SELECT::init()
The memory location pointed to by key_infix will be deleted soon, so
allocate a new buffer and copy the key_infix into it.
*/
- byte *tmp_key_infix= (byte*) alloc_root(&alloc, key_infix_len);
+ uchar *tmp_key_infix= (uchar*) alloc_root(&alloc, key_infix_len);
if (!tmp_key_infix)
return 1;
memcpy(tmp_key_infix, this->key_infix, key_infix_len);
@@ -10195,7 +10214,7 @@ bool QUICK_GROUP_MIN_MAX_SELECT::add_range(SEL_ARG *sel_range)
range_flag);
if (!range)
return TRUE;
- if (insert_dynamic(&min_max_ranges, (gptr)&range))
+ if (insert_dynamic(&min_max_ranges, (uchar*)&range))
return TRUE;
return FALSE;
}
@@ -10230,7 +10249,7 @@ void QUICK_GROUP_MIN_MAX_SELECT::adjust_prefix_ranges ()
{
QUICK_RANGE *range;
- get_dynamic(arr, (gptr)&range, inx);
+ get_dynamic(arr, (uchar*)&range, inx);
range->flag &= ~(NEAR_MIN | NEAR_MAX);
}
}
@@ -10266,7 +10285,7 @@ void QUICK_GROUP_MIN_MAX_SELECT::update_key_stat()
QUICK_RANGE *cur_range;
if (have_min)
{ /* Check if the right-most range has a lower boundary. */
- get_dynamic(&min_max_ranges, (gptr)&cur_range,
+ get_dynamic(&min_max_ranges, (uchar*)&cur_range,
min_max_ranges.elements - 1);
if (!(cur_range->flag & NO_MIN_RANGE))
{
@@ -10277,7 +10296,7 @@ void QUICK_GROUP_MIN_MAX_SELECT::update_key_stat()
}
if (have_max)
{ /* Check if the left-most range has an upper boundary. */
- get_dynamic(&min_max_ranges, (gptr)&cur_range, 0);
+ get_dynamic(&min_max_ranges, (uchar*)&cur_range, 0);
if (!(cur_range->flag & NO_MAX_RANGE))
{
max_used_key_length+= min_max_arg_len;
@@ -10430,9 +10449,9 @@ int QUICK_GROUP_MIN_MAX_SELECT::get_next()
first sub-group with the extended prefix.
*/
if (!have_min && !have_max && key_infix_len > 0)
- result= file->index_read(record, group_prefix,
- make_prev_keypart_map(real_key_parts),
- HA_READ_KEY_EXACT);
+ result= file->index_read_map(record, group_prefix,
+ make_prev_keypart_map(real_key_parts),
+ HA_READ_KEY_EXACT);
result= have_min ? min_res : have_max ? max_res : result;
} while ((result == HA_ERR_KEY_NOT_FOUND || result == HA_ERR_END_OF_FILE) &&
@@ -10494,9 +10513,9 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_min()
/* Apply the constant equality conditions to the non-group select fields */
if (key_infix_len > 0)
{
- if ((result= file->index_read(record, group_prefix,
- make_prev_keypart_map(real_key_parts),
- HA_READ_KEY_EXACT)))
+ if ((result= file->index_read_map(record, group_prefix,
+ make_prev_keypart_map(real_key_parts),
+ HA_READ_KEY_EXACT)))
DBUG_RETURN(result);
}
@@ -10511,9 +10530,9 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_min()
{
/* Find the first subsequent record without NULL in the MIN/MAX field. */
key_copy(tmp_record, record, index_info, 0);
- result= file->index_read(record, tmp_record,
- make_keypart_map(real_key_parts),
- HA_READ_AFTER_KEY);
+ result= file->index_read_map(record, tmp_record,
+ make_keypart_map(real_key_parts),
+ HA_READ_AFTER_KEY);
/*
Check if the new record belongs to the current group by comparing its
prefix with the group's prefix. If it is from the next group, then the
@@ -10568,9 +10587,9 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_max()
if (min_max_ranges.elements > 0)
result= next_max_in_range();
else
- result= file->index_read(record, group_prefix,
- make_prev_keypart_map(real_key_parts),
- HA_READ_PREFIX_LAST);
+ result= file->index_read_map(record, group_prefix,
+ make_prev_keypart_map(real_key_parts),
+ HA_READ_PREFIX_LAST);
DBUG_RETURN(result);
}
@@ -10603,7 +10622,7 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_prefix()
if (quick_prefix_select)
{
- byte *cur_prefix= seen_first_key ? group_prefix : NULL;
+ uchar *cur_prefix= seen_first_key ? group_prefix : NULL;
if ((result= quick_prefix_select->get_next_prefix(group_prefix_len,
make_prev_keypart_map(group_key_parts), cur_prefix)))
DBUG_RETURN(result);
@@ -10621,9 +10640,9 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_prefix()
else
{
/* Load the first key in this group into record. */
- result= file->index_read(record, group_prefix,
- make_prev_keypart_map(group_key_parts),
- HA_READ_AFTER_KEY);
+ result= file->index_read_map(record, group_prefix,
+ make_prev_keypart_map(group_key_parts),
+ HA_READ_AFTER_KEY);
if (result)
DBUG_RETURN(result);
}
@@ -10673,14 +10692,14 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_min_in_range()
for (uint range_idx= 0; range_idx < min_max_ranges.elements; range_idx++)
{ /* Search from the left-most range to the right. */
- get_dynamic(&min_max_ranges, (gptr)&cur_range, range_idx);
+ get_dynamic(&min_max_ranges, (uchar*)&cur_range, range_idx);
/*
If the current value for the min/max argument is bigger than the right
boundary of cur_range, there is no need to check this range.
*/
if (range_idx != 0 && !(cur_range->flag & NO_MAX_RANGE) &&
- (key_cmp(min_max_arg_part, (const byte*) cur_range->max_key,
+ (key_cmp(min_max_arg_part, (const uchar*) cur_range->max_key,
min_max_arg_len) == 1))
continue;
@@ -10700,7 +10719,7 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_min_in_range()
HA_READ_AFTER_KEY : HA_READ_KEY_OR_NEXT;
}
- result= file->index_read(record, group_prefix, keypart_map, find_flag);
+ result= file->index_read_map(record, group_prefix, keypart_map, find_flag);
if (result)
{
if ((result == HA_ERR_KEY_NOT_FOUND || result == HA_ERR_END_OF_FILE) &&
@@ -10741,7 +10760,7 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_min_in_range()
if ( !(cur_range->flag & NO_MAX_RANGE) )
{
/* Compose the MAX key for the range. */
- byte *max_key= (byte*) my_alloca(real_prefix_len + min_max_arg_len);
+ uchar *max_key= (uchar*) my_alloca(real_prefix_len + min_max_arg_len);
memcpy(max_key, group_prefix, real_prefix_len);
memcpy(max_key + real_prefix_len, cur_range->max_key,
cur_range->max_length);
@@ -10805,7 +10824,7 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_max_in_range()
for (uint range_idx= min_max_ranges.elements; range_idx > 0; range_idx--)
{ /* Search from the right-most range to the left. */
- get_dynamic(&min_max_ranges, (gptr)&cur_range, range_idx - 1);
+ get_dynamic(&min_max_ranges, (uchar*)&cur_range, range_idx - 1);
/*
If the current value for the min/max argument is smaller than the left
@@ -10813,7 +10832,7 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_max_in_range()
*/
if (range_idx != min_max_ranges.elements &&
!(cur_range->flag & NO_MIN_RANGE) &&
- (key_cmp(min_max_arg_part, (const byte*) cur_range->min_key,
+ (key_cmp(min_max_arg_part, (const uchar*) cur_range->min_key,
min_max_arg_len) == -1))
continue;
@@ -10833,7 +10852,7 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_max_in_range()
HA_READ_BEFORE_KEY : HA_READ_PREFIX_LAST_OR_PREV;
}
- result= file->index_read(record, group_prefix, keypart_map, find_flag);
+ result= file->index_read_map(record, group_prefix, keypart_map, find_flag);
if (result)
{
@@ -10859,7 +10878,7 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_max_in_range()
if ( !(cur_range->flag & NO_MIN_RANGE) )
{
/* Compose the MIN key for the range. */
- byte *min_key= (byte*) my_alloca(real_prefix_len + min_max_arg_len);
+ uchar *min_key= (uchar*) my_alloca(real_prefix_len + min_max_arg_len);
memcpy(min_key, group_prefix, real_prefix_len);
memcpy(min_key + real_prefix_len, cur_range->min_key,
cur_range->min_length);
@@ -11030,10 +11049,10 @@ static void print_ror_scans_arr(TABLE *table, const char *msg,
*****************************************************************************/
static void
-print_key(KEY_PART *key_part,const char *key,uint used_length)
+print_key(KEY_PART *key_part, const uchar *key, uint used_length)
{
char buff[1024];
- const char *key_end= key+used_length;
+ const uchar *key_end= key+used_length;
String tmp(buff,sizeof(buff),&my_charset_bin);
uint store_length;
TABLE *table= key_part->field->table;
@@ -11056,7 +11075,7 @@ print_key(KEY_PART *key_part,const char *key,uint used_length)
key++; // Skip null byte
store_length--;
}
- field->set_key_image((char*) key, key_part->length);
+ field->set_key_image(key, key_part->length);
if (field->type() == MYSQL_TYPE_BIT)
(void) field->val_int_as_str(&tmp, 1);
else
@@ -11111,7 +11130,7 @@ void QUICK_RANGE_SELECT::dbug_dump(int indent, bool verbose)
range= *pr;
if (!(range->flag & NO_MIN_RANGE))
{
- print_key(key_parts,range->min_key,range->min_length);
+ print_key(key_parts, range->min_key, range->min_length);
if (range->flag & NEAR_MIN)
fputs(" < ",DBUG_FILE);
else
@@ -11125,7 +11144,7 @@ void QUICK_RANGE_SELECT::dbug_dump(int indent, bool verbose)
fputs(" < ",DBUG_FILE);
else
fputs(" <= ",DBUG_FILE);
- print_key(key_parts,range->max_key,range->max_length);
+ print_key(key_parts, range->max_key, range->max_length);
}
fputs("\n",DBUG_FILE);
}
diff --git a/sql/opt_range.h b/sql/opt_range.h
index 1ad9567cddd..dd219129167 100644
--- a/sql/opt_range.h
+++ b/sql/opt_range.h
@@ -35,7 +35,7 @@ typedef struct st_key_part {
class QUICK_RANGE :public Sql_alloc {
public:
- char *min_key,*max_key;
+ uchar *min_key,*max_key;
uint16 min_length,max_length,flag;
key_part_map min_keypart_map, // bitmap of used keyparts in min_key
max_keypart_map; // bitmap of used keyparts in max_key
@@ -43,18 +43,18 @@ class QUICK_RANGE :public Sql_alloc {
uint16 dummy; /* Avoid warnings on 'flag' */
#endif
QUICK_RANGE(); /* Full range */
- QUICK_RANGE(const char *min_key_arg, uint min_length_arg,
+ QUICK_RANGE(const uchar *min_key_arg, uint min_length_arg,
key_part_map min_keypart_map_arg,
- const char *max_key_arg, uint max_length_arg,
+ const uchar *max_key_arg, uint max_length_arg,
key_part_map max_keypart_map_arg,
uint flag_arg)
- : min_key((char*) sql_memdup(min_key_arg,min_length_arg+1)),
- max_key((char*) sql_memdup(max_key_arg,max_length_arg+1)),
+ : min_key((uchar*) sql_memdup(min_key_arg,min_length_arg+1)),
+ max_key((uchar*) sql_memdup(max_key_arg,max_length_arg+1)),
min_length((uint16) min_length_arg),
max_length((uint16) max_length_arg),
+ flag((uint16) flag_arg),
min_keypart_map(min_keypart_map_arg),
- max_keypart_map(max_keypart_map_arg),
- flag((uint16) flag_arg)
+ max_keypart_map(max_keypart_map_arg)
{
#ifdef HAVE_purify
dummy=0;
@@ -241,12 +241,12 @@ public:
rowid of last row retrieved by this quick select. This is used only when
doing ROR-index_merge selects
*/
- byte *last_rowid;
+ uchar *last_rowid;
/*
Table record buffer used by this quick select.
*/
- byte *record;
+ uchar *record;
#ifndef DBUG_OFF
/*
Print quick select information to DBUG_FILE. Caller is responsible
@@ -296,8 +296,8 @@ protected:
friend bool get_quick_keys(PARAM *param,
QUICK_RANGE_SELECT *quick,KEY_PART *key,
SEL_ARG *key_tree,
- char *min_key, uint min_key_flag,
- char *max_key, uint max_key_flag);
+ uchar *min_key, uint min_key_flag,
+ uchar *max_key, uint max_key_flag);
friend QUICK_RANGE_SELECT *get_quick_select(PARAM*,uint idx,
SEL_ARG *key_tree,
MEM_ROOT *alloc);
@@ -327,7 +327,7 @@ public:
int get_next();
void range_end();
int get_next_prefix(uint prefix_length, key_part_map keypart_map,
- byte *cur_prefix);
+ uchar *cur_prefix);
bool reverse_sorted() { return 0; }
bool unique_key_range();
int init_ror_merged_scan(bool reuse_handler);
@@ -561,12 +561,12 @@ public:
MEM_ROOT alloc; /* Memory pool for this and merged quick selects data. */
THD *thd; /* current thread */
- byte *cur_rowid; /* buffer used in get_next() */
- byte *prev_rowid; /* rowid of last row returned by get_next() */
+ uchar *cur_rowid; /* buffer used in get_next() */
+ uchar *prev_rowid; /* rowid of last row returned by get_next() */
bool have_prev_rowid; /* true if prev_rowid has valid data */
uint rowid_length; /* table rowid length */
private:
- static int queue_cmp(void *arg, byte *val1, byte *val2);
+ static int queue_cmp(void *arg, uchar *val1, uchar *val2);
bool scans_inited;
};
@@ -610,19 +610,19 @@ private:
handler *file; /* The handler used to get data. */
JOIN *join; /* Descriptor of the current query */
KEY *index_info; /* The index chosen for data access */
- byte *record; /* Buffer where the next record is returned. */
- byte *tmp_record; /* Temporary storage for next_min(), next_max(). */
- byte *group_prefix; /* Key prefix consisting of the GROUP fields. */
+ uchar *record; /* Buffer where the next record is returned. */
+ uchar *tmp_record; /* Temporary storage for next_min(), next_max(). */
+ uchar *group_prefix; /* Key prefix consisting of the GROUP fields. */
uint group_prefix_len; /* Length of the group prefix. */
uint group_key_parts; /* A number of keyparts in the group prefix */
- byte *last_prefix; /* Prefix of the last group for detecting EOF. */
+ 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 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. */
uint min_max_arg_len; /* The length of the MIN/MAX argument field */
- byte *key_infix; /* Infix of constants from equality predicates. */
+ uchar *key_infix; /* Infix of constants from equality predicates. */
uint key_infix_len;
DYNAMIC_ARRAY min_max_ranges; /* Array of range ptrs for the MIN/MAX field. */
uint real_prefix_len; /* Length of key prefix extended with key_infix. */
@@ -652,7 +652,7 @@ public:
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, byte *key_infix, MEM_ROOT
+ key_infix_len, uchar *key_infix, MEM_ROOT
*parent_alloc);
~QUICK_GROUP_MIN_MAX_SELECT();
bool add_range(SEL_ARG *sel_range);
@@ -736,7 +736,7 @@ uint get_index_for_order(TABLE *table, ORDER *order, ha_rows limit);
#ifdef WITH_PARTITION_STORAGE_ENGINE
bool prune_partitions(THD *thd, TABLE *table, Item *pprune_cond);
-void store_key_image_to_rec(Field *field, char *ptr, uint len);
+void store_key_image_to_rec(Field *field, uchar *ptr, uint len);
#endif
#endif
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index f9a06f3fb6e..6836c53db4e 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -222,7 +222,7 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
Item *expr=item_sum->args[0];
if (expr->real_item()->type() == Item::FIELD_ITEM)
{
- byte key_buff[MAX_KEY_LENGTH];
+ uchar key_buff[MAX_KEY_LENGTH];
TABLE_REF ref;
uint range_fl, prefix_len;
@@ -249,12 +249,72 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
if (!ref.key_length)
error= table->file->index_first(table->record[0]);
- else
- error= table->file->index_read(table->record[0],key_buff,
- make_prev_keypart_map(ref.key_parts),
- range_fl & NEAR_MIN ?
- HA_READ_AFTER_KEY :
- HA_READ_KEY_OR_NEXT);
+ else
+ {
+ /*
+ Use index to replace MIN/MAX functions with their values
+ according to the following rules:
+
+ 1) Insert the minimum non-null values where the WHERE clause still
+ matches, or
+ 2) a NULL value if there are only NULL values for key_part_k.
+ 3) Fail, producing a row of nulls
+
+ Implementation: Read the smallest value using the search key. If
+ the interval is open, read the next value after the search
+ key. If read fails, and we're looking for a MIN() value for a
+ nullable column, test if there is an exact match for the key.
+ */
+ if (!(range_fl & NEAR_MIN))
+ /*
+ Closed interval: Either The MIN argument is non-nullable, or
+ we have a >= predicate for the MIN argument.
+ */
+ error= table->file->index_read_map(table->record[0],
+ ref.key_buff,
+ make_prev_keypart_map(ref.key_parts),
+ HA_READ_KEY_OR_NEXT);
+ else
+ {
+ /*
+ Open interval: There are two cases:
+ 1) We have only MIN() and the argument column is nullable, or
+ 2) there is a > predicate on it, nullability is irrelevant.
+ We need to scan the next bigger record first.
+ */
+ error= table->file->index_read_map(table->record[0],
+ ref.key_buff,
+ make_prev_keypart_map(ref.key_parts),
+ HA_READ_AFTER_KEY);
+ /*
+ If the found record is outside the group formed by the search
+ prefix, or there is no such record at all, check if all
+ records in that group have NULL in the MIN argument
+ column. If that is the case return that NULL.
+
+ Check if case 1 from above holds. If it does, we should read
+ the skipped tuple.
+ */
+ if (ref.key_buff[prefix_len] == 1 &&
+ /*
+ Last keypart (i.e. the argument to MIN) is set to NULL by
+ find_key_for_maxmin only if all other keyparts are bound
+ to constants in a conjunction of equalities. Hence, we
+ can detect this by checking only if the last keypart is
+ NULL.
+ */
+ (error == HA_ERR_KEY_NOT_FOUND ||
+ key_cmp_if_same(table, ref.key_buff, ref.key, prefix_len)))
+ {
+ DBUG_ASSERT(item_field->field->real_maybe_null());
+ error= table->file->index_read_map(table->record[0],
+ ref.key_buff,
+ make_prev_keypart_map(ref.key_parts),
+ HA_READ_KEY_EXACT);
+ }
+ }
+ }
+ /* Verify that the read tuple indeed matches the search key */
if (!error && reckey_in_range(0, &ref, item_field->field,
conds, range_fl, prefix_len))
error= HA_ERR_KEY_NOT_FOUND;
@@ -309,7 +369,7 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
Item *expr=item_sum->args[0];
if (expr->real_item()->type() == Item::FIELD_ITEM)
{
- byte key_buff[MAX_KEY_LENGTH];
+ uchar key_buff[MAX_KEY_LENGTH];
TABLE_REF ref;
uint range_fl, prefix_len;
@@ -337,11 +397,11 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
if (!ref.key_length)
error= table->file->index_last(table->record[0]);
else
- error= table->file->index_read(table->record[0], key_buff,
- make_prev_keypart_map(ref.key_parts),
- range_fl & NEAR_MAX ?
- HA_READ_BEFORE_KEY :
- HA_READ_PREFIX_LAST_OR_PREV);
+ error= table->file->index_read_map(table->record[0], key_buff,
+ make_prev_keypart_map(ref.key_parts),
+ range_fl & NEAR_MAX ?
+ HA_READ_BEFORE_KEY :
+ HA_READ_PREFIX_LAST_OR_PREV);
if (!error && reckey_in_range(1, &ref, item_field->field,
conds, range_fl, prefix_len))
error= HA_ERR_KEY_NOT_FOUND;
@@ -603,7 +663,7 @@ static bool matching_cond(bool max_fl, TABLE_REF *ref, KEY *keyinfo,
less_fl= 1-less_fl; // Convert '<' -> '>' (etc)
/* Check if field is part of the tested partial key */
- byte *key_ptr= ref->key_buff;
+ uchar *key_ptr= ref->key_buff;
KEY_PART_INFO *part;
for (part= keyinfo->key_part; ; key_ptr+= part++->store_length)
@@ -652,15 +712,15 @@ static bool matching_cond(bool max_fl, TABLE_REF *ref, KEY *keyinfo,
if (is_null)
{
part->field->set_null();
- *key_ptr= (byte) 1;
+ *key_ptr= (uchar) 1;
}
else
{
store_val_in_field(part->field, args[between && max_fl ? 2 : 1],
CHECK_FIELD_IGNORE);
if (part->null_bit)
- *key_ptr++= (byte) test(part->field->is_null());
- part->field->get_key_image((char*) key_ptr, part->length, Field::itRAW);
+ *key_ptr++= (uchar) test(part->field->is_null());
+ part->field->get_key_image(key_ptr, part->length, Field::itRAW);
}
if (is_field_part)
{
@@ -784,16 +844,26 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref,
if (!max_fl && key_part_used == key_part_to_use && part->null_bit)
{
/*
- SELECT MIN(key_part2) FROM t1 WHERE key_part1=const
- If key_part2 may be NULL, then we want to find the first row
- that is not null
+ The query is on this form:
+
+ SELECT MIN(key_part_k)
+ FROM t1
+ WHERE key_part_1 = const and ... and key_part_k-1 = const
+
+ If key_part_k is nullable, we want to find the first matching row
+ where key_part_k is not null. The key buffer is now {const, ...,
+ NULL}. This will be passed to the handler along with a flag
+ indicating open interval. If a tuple is read that does not match
+ these search criteria, an attempt will be made to read an exact
+ match for the key buffer.
*/
+ /* Set the first byte of key_part_k to 1, that means NULL */
ref->key_buff[ref->key_length]= 1;
ref->key_length+= part->store_length;
ref->key_parts++;
DBUG_ASSERT(ref->key_parts == jdx+1);
*range_fl&= ~NO_MIN_RANGE;
- *range_fl|= NEAR_MIN; // > NULL
+ *range_fl|= NEAR_MIN; // Open interval
}
/*
The following test is false when the key in the key tree is
diff --git a/sql/parse_file.cc b/sql/parse_file.cc
index f06c7c15202..19fb11ac0cc 100644
--- a/sql/parse_file.cc
+++ b/sql/parse_file.cc
@@ -49,27 +49,27 @@ write_escaped_string(IO_CACHE *file, LEX_STRING *val_s)
*/
switch(*ptr) {
case '\\': // escape character
- if (my_b_append(file, (const byte *)STRING_WITH_LEN("\\\\")))
+ if (my_b_append(file, (const uchar *)STRING_WITH_LEN("\\\\")))
return TRUE;
break;
case '\n': // parameter value delimiter
- if (my_b_append(file, (const byte *)STRING_WITH_LEN("\\n")))
+ if (my_b_append(file, (const uchar *)STRING_WITH_LEN("\\n")))
return TRUE;
break;
case '\0': // problem for some string processing utilities
- if (my_b_append(file, (const byte *)STRING_WITH_LEN("\\0")))
+ if (my_b_append(file, (const uchar *)STRING_WITH_LEN("\\0")))
return TRUE;
break;
case 26: // problem for windows utilities (Ctrl-Z)
- if (my_b_append(file, (const byte *)STRING_WITH_LEN("\\z")))
+ if (my_b_append(file, (const uchar *)STRING_WITH_LEN("\\z")))
return TRUE;
break;
case '\'': // list of string delimiter
- if (my_b_append(file, (const byte *)STRING_WITH_LEN("\\\'")))
+ if (my_b_append(file, (const uchar *)STRING_WITH_LEN("\\\'")))
return TRUE;
break;
default:
- if (my_b_append(file, (const byte *)ptr, 1))
+ if (my_b_append(file, (const uchar *)ptr, 1))
return TRUE;
}
}
@@ -93,7 +93,7 @@ write_escaped_string(IO_CACHE *file, LEX_STRING *val_s)
*/
static my_bool
-write_parameter(IO_CACHE *file, gptr base, File_option *parameter,
+write_parameter(IO_CACHE *file, uchar* base, File_option *parameter,
ulonglong *old_version)
{
char num_buf[20]; // buffer for numeric operations
@@ -105,7 +105,7 @@ write_parameter(IO_CACHE *file, gptr base, File_option *parameter,
case FILE_OPTIONS_STRING:
{
LEX_STRING *val_s= (LEX_STRING *)(base + parameter->offset);
- if (my_b_append(file, (const byte *)val_s->str, val_s->length))
+ if (my_b_append(file, (const uchar *)val_s->str, val_s->length))
DBUG_RETURN(TRUE);
break;
}
@@ -118,7 +118,7 @@ write_parameter(IO_CACHE *file, gptr base, File_option *parameter,
case FILE_OPTIONS_ULONGLONG:
{
num.set(*((ulonglong *)(base + parameter->offset)), &my_charset_bin);
- if (my_b_append(file, (const byte *)num.ptr(), num.length()))
+ if (my_b_append(file, (const uchar *)num.ptr(), num.length()))
DBUG_RETURN(TRUE);
break;
}
@@ -127,7 +127,7 @@ write_parameter(IO_CACHE *file, gptr base, File_option *parameter,
ulonglong *val_i= (ulonglong *)(base + parameter->offset);
*old_version= (*val_i)++;
num.set(*val_i, &my_charset_bin);
- if (my_b_append(file, (const byte *)num.ptr(), num.length()))
+ if (my_b_append(file, (const uchar *)num.ptr(), num.length()))
DBUG_RETURN(TRUE);
break;
}
@@ -135,12 +135,12 @@ write_parameter(IO_CACHE *file, gptr base, File_option *parameter,
{
/* string have to be allocated already */
LEX_STRING *val_s= (LEX_STRING *)(base + parameter->offset);
- time_t tm= time(NULL);
+ time_t tm= my_time(0);
get_date(val_s->str, GETDATE_DATE_TIME|GETDATE_GMT|GETDATE_FIXEDLENGTH,
tm);
val_s->length= PARSE_FILE_TIMESTAMPLENGTH;
- if (my_b_append(file, (const byte *)val_s->str,
+ if (my_b_append(file, (const uchar *)val_s->str,
PARSE_FILE_TIMESTAMPLENGTH))
DBUG_RETURN(TRUE);
break;
@@ -154,10 +154,10 @@ write_parameter(IO_CACHE *file, gptr base, File_option *parameter,
while ((str= it++))
{
// We need ' ' after string to detect list continuation
- if ((!first && my_b_append(file, (const byte *)STRING_WITH_LEN(" "))) ||
- my_b_append(file, (const byte *)STRING_WITH_LEN("\'")) ||
+ if ((!first && my_b_append(file, (const uchar *)STRING_WITH_LEN(" "))) ||
+ my_b_append(file, (const uchar *)STRING_WITH_LEN("\'")) ||
write_escaped_string(file, str) ||
- my_b_append(file, (const byte *)STRING_WITH_LEN("\'")))
+ my_b_append(file, (const uchar *)STRING_WITH_LEN("\'")))
{
DBUG_RETURN(TRUE);
}
@@ -175,8 +175,8 @@ write_parameter(IO_CACHE *file, gptr base, File_option *parameter,
{
num.set(*val, &my_charset_bin);
// We need ' ' after string to detect list continuation
- if ((!first && my_b_append(file, (const byte *)STRING_WITH_LEN(" "))) ||
- my_b_append(file, (const byte *)num.ptr(), num.length()))
+ if ((!first && my_b_append(file, (const uchar *)STRING_WITH_LEN(" "))) ||
+ my_b_append(file, (const uchar *)num.ptr(), num.length()))
{
DBUG_RETURN(TRUE);
}
@@ -212,7 +212,7 @@ write_parameter(IO_CACHE *file, gptr base, File_option *parameter,
my_bool
sql_create_definition_file(const LEX_STRING *dir, const LEX_STRING *file_name,
const LEX_STRING *type,
- gptr base, File_option *parameters,
+ uchar* base, File_option *parameters,
uint max_versions)
{
File handler;
@@ -254,19 +254,19 @@ sql_create_definition_file(const LEX_STRING *dir, const LEX_STRING *file_name,
goto err_w_file;
// write header (file signature)
- if (my_b_append(&file, (const byte *)STRING_WITH_LEN("TYPE=")) ||
- my_b_append(&file, (const byte *)type->str, type->length) ||
- my_b_append(&file, (const byte *)STRING_WITH_LEN("\n")))
+ if (my_b_append(&file, (const uchar *)STRING_WITH_LEN("TYPE=")) ||
+ my_b_append(&file, (const uchar *)type->str, type->length) ||
+ my_b_append(&file, (const uchar *)STRING_WITH_LEN("\n")))
goto err_w_file;
// write parameters to temporary file
for (param= parameters; param->name.str; param++)
{
- if (my_b_append(&file, (const byte *)param->name.str,
+ if (my_b_append(&file, (const uchar *)param->name.str,
param->name.length) ||
- my_b_append(&file, (const byte *)STRING_WITH_LEN("=")) ||
+ my_b_append(&file, (const uchar *)STRING_WITH_LEN("=")) ||
write_parameter(&file, base, param, &old_version) ||
- my_b_append(&file, (const byte *)STRING_WITH_LEN("\n")))
+ my_b_append(&file, (const uchar *)STRING_WITH_LEN("\n")))
goto err_w_cache;
}
@@ -423,7 +423,7 @@ sql_parse_prepare(const LEX_STRING *file_name, MEM_ROOT *mem_root,
bool bad_format_errors)
{
MY_STAT stat_info;
- uint len;
+ size_t len;
char *end, *sign;
File_parser *parser;
File file;
@@ -445,7 +445,7 @@ sql_parse_prepare(const LEX_STRING *file_name, MEM_ROOT *mem_root,
DBUG_RETURN(0);
}
- if (!(parser->buff= alloc_root(mem_root, stat_info.st_size+1)))
+ if (!(parser->buff= (char*) alloc_root(mem_root, stat_info.st_size+1)))
{
DBUG_RETURN(0);
}
@@ -455,7 +455,7 @@ sql_parse_prepare(const LEX_STRING *file_name, MEM_ROOT *mem_root,
DBUG_RETURN(0);
}
- if ((len= my_read(file, (byte *)parser->buff,
+ if ((len= my_read(file, (uchar *)parser->buff,
stat_info.st_size, MYF(MY_WME))) ==
MY_FILE_ERROR)
{
@@ -533,11 +533,8 @@ parse_string(char *ptr, char *end, MEM_ROOT *mem_root, LEX_STRING *str)
str->length= eol - ptr;
- if (!(str->str= alloc_root(mem_root, str->length+1)))
+ if (!(str->str= strmake_root(mem_root, ptr, str->length)))
return 0;
-
- memcpy(str->str, ptr, str->length);
- str->str[str->length]= '\0'; // just for safety
return eol+1;
}
@@ -623,7 +620,7 @@ parse_escaped_string(char *ptr, char *end, MEM_ROOT *mem_root, LEX_STRING *str)
char *eol= strchr(ptr, '\n');
if (eol == 0 || eol >= end ||
- !(str->str= alloc_root(mem_root, (eol - ptr) + 1)) ||
+ !(str->str= (char*) alloc_root(mem_root, (eol - ptr) + 1)) ||
read_escaped_string(ptr, eol, str))
return 0;
@@ -668,7 +665,7 @@ parse_quoted_escaped_string(char *ptr, char *end,
// process string
if (eol >= end ||
- !(str->str= alloc_root(mem_root, result_len + 1)) ||
+ !(str->str= (char*) alloc_root(mem_root, result_len + 1)) ||
read_escaped_string(ptr, eol, str))
return 0;
@@ -691,7 +688,7 @@ parse_quoted_escaped_string(char *ptr, char *end,
*/
bool get_file_options_ulllist(char *&ptr, char *end, char *line,
- gptr base, File_option *parameter,
+ uchar* base, File_option *parameter,
MEM_ROOT *mem_root)
{
List<ulonglong> *nlist= (List<ulonglong>*)(base + parameter->offset);
@@ -754,7 +751,7 @@ nlist_err:
*/
my_bool
-File_parser::parse(gptr base, MEM_ROOT *mem_root,
+File_parser::parse(uchar* base, MEM_ROOT *mem_root,
struct File_option *parameters, uint required,
Unknown_key_hook *hook)
{
@@ -963,7 +960,7 @@ list_err:
bool
File_parser_dummy_hook::process_unknown_string(char *&unknown_key,
- gptr base, MEM_ROOT *mem_root,
+ uchar* base, MEM_ROOT *mem_root,
char *end)
{
DBUG_ENTER("file_parser_dummy_hook::process_unknown_string");
diff --git a/sql/parse_file.h b/sql/parse_file.h
index 21873b32904..91700959681 100644
--- a/sql/parse_file.h
+++ b/sql/parse_file.h
@@ -50,7 +50,7 @@ class Unknown_key_hook
public:
Unknown_key_hook() {} /* Remove gcc warning */
virtual ~Unknown_key_hook() {} /* Remove gcc warning */
- virtual bool process_unknown_string(char *&unknown_key, gptr base,
+ virtual bool process_unknown_string(char *&unknown_key, uchar* base,
MEM_ROOT *mem_root, char *end)= 0;
};
@@ -61,14 +61,14 @@ class File_parser_dummy_hook: public Unknown_key_hook
{
public:
File_parser_dummy_hook() {} /* Remove gcc warning */
- virtual bool process_unknown_string(char *&unknown_key, gptr base,
+ virtual bool process_unknown_string(char *&unknown_key, uchar* base,
MEM_ROOT *mem_root, char *end);
};
extern File_parser_dummy_hook file_parser_dummy_hook;
bool get_file_options_ulllist(char *&ptr, char *end, char *line,
- gptr base, File_option *parameter,
+ uchar* base, File_option *parameter,
MEM_ROOT *mem_root);
char *
@@ -81,7 +81,7 @@ File_parser *sql_parse_prepare(const LEX_STRING *file_name,
my_bool
sql_create_definition_file(const LEX_STRING *dir, const LEX_STRING *file_name,
const LEX_STRING *type,
- gptr base, File_option *parameters, uint versions);
+ uchar* base, File_option *parameters, uint versions);
my_bool rename_in_schema_file(const char *schema, const char *old_name,
const char *new_name, ulonglong revision,
uint num_view_backups);
@@ -97,7 +97,7 @@ public:
my_bool ok() { return content_ok; }
LEX_STRING *type() { return &file_type; }
- my_bool parse(gptr base, MEM_ROOT *mem_root,
+ my_bool parse(uchar* base, MEM_ROOT *mem_root,
struct File_option *parameters, uint required,
Unknown_key_hook *hook);
diff --git a/sql/partition_element.h b/sql/partition_element.h
index c056d40b85b..905bc38165b 100644
--- a/sql/partition_element.h
+++ b/sql/partition_element.h
@@ -84,9 +84,9 @@ public:
partition_element(partition_element *part_elem)
: part_max_rows(part_elem->part_max_rows),
part_min_rows(part_elem->part_min_rows),
- partition_name(NULL),
+ range_value(0), partition_name(NULL),
tablespace_name(part_elem->tablespace_name),
- range_value(0), part_comment(part_elem->part_comment),
+ part_comment(part_elem->part_comment),
data_file_name(part_elem->data_file_name),
index_file_name(part_elem->index_file_name),
engine_type(part_elem->engine_type),
diff --git a/sql/partition_info.cc b/sql/partition_info.cc
index 3e0257f5b1d..ab887d5dda0 100644
--- a/sql/partition_info.cc
+++ b/sql/partition_info.cc
@@ -90,10 +90,11 @@ 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,
+char *partition_info::create_default_partition_names(uint part_no,
+ uint no_parts_arg,
uint start_no)
{
- char *ptr= sql_calloc(no_parts*MAX_PART_NAME_SIZE);
+ char *ptr= (char*) sql_calloc(no_parts_arg*MAX_PART_NAME_SIZE);
char *move_ptr= ptr;
uint i= 0;
DBUG_ENTER("create_default_partition_names");
@@ -104,11 +105,11 @@ char *partition_info::create_default_partition_names(uint part_no, uint no_parts
{
my_sprintf(move_ptr, (move_ptr,"p%u", (start_no + i)));
move_ptr+=MAX_PART_NAME_SIZE;
- } while (++i < no_parts);
+ } while (++i < no_parts_arg);
}
else
{
- mem_alloc_error(no_parts*MAX_PART_NAME_SIZE);
+ mem_alloc_error(no_parts_arg*MAX_PART_NAME_SIZE);
}
DBUG_RETURN(ptr);
}
@@ -129,7 +130,7 @@ char *partition_info::create_subpartition_name(uint subpart_no,
const char *part_name)
{
uint size_alloc= strlen(part_name) + MAX_PART_NAME_SIZE;
- char *ptr= sql_calloc(size_alloc);
+ char *ptr= (char*) sql_calloc(size_alloc);
DBUG_ENTER("create_subpartition_name");
if (likely(ptr != NULL))
@@ -902,9 +903,8 @@ void partition_info::print_no_partition_found(TABLE *table)
bool partition_info::set_up_charset_field_preps()
{
Field *field, **ptr;
- char **char_ptrs;
+ uchar **char_ptrs;
unsigned i;
- bool found;
size_t size;
uint tot_fields= 0;
uint tot_part_fields= 0;
@@ -917,7 +917,6 @@ bool partition_info::set_up_charset_field_preps()
{
ptr= part_field_array;
/* Set up arrays and buffers for those fields */
- i= 0;
while ((field= *(ptr++)))
{
if (field_is_partition_charset(field))
@@ -927,14 +926,14 @@ bool partition_info::set_up_charset_field_preps()
}
}
size= tot_part_fields * sizeof(char*);
- if (!(char_ptrs= (char**)sql_calloc(size)))
+ if (!(char_ptrs= (uchar**)sql_calloc(size)))
goto error;
part_field_buffers= char_ptrs;
- if (!(char_ptrs= (char**)sql_calloc(size)))
+ if (!(char_ptrs= (uchar**)sql_calloc(size)))
goto error;
restore_part_field_ptrs= char_ptrs;
size= (tot_part_fields + 1) * sizeof(Field*);
- if (!(char_ptrs= (char**)sql_alloc(size)))
+ if (!(char_ptrs= (uchar**)sql_alloc(size)))
goto error;
part_charset_field_array= (Field**)char_ptrs;
ptr= part_field_array;
@@ -943,9 +942,9 @@ bool partition_info::set_up_charset_field_preps()
{
if (field_is_partition_charset(field))
{
- char *field_buf;
+ uchar *field_buf;
size= field->pack_length();
- if (!(field_buf= sql_calloc(size)))
+ if (!(field_buf= (uchar*) sql_calloc(size)))
goto error;
part_charset_field_array[i]= field;
part_field_buffers[i++]= field_buf;
@@ -953,7 +952,7 @@ bool partition_info::set_up_charset_field_preps()
}
part_charset_field_array[i]= NULL;
}
- if (is_sub_partitioned() && list_of_subpart_fields &&
+ if (is_sub_partitioned() && !list_of_subpart_fields &&
check_part_func_fields(subpart_field_array, FALSE))
{
/* Set up arrays and buffers for those fields */
@@ -961,62 +960,53 @@ bool partition_info::set_up_charset_field_preps()
while ((field= *(ptr++)))
{
if (field_is_partition_charset(field))
+ {
tot_subpart_fields++;
+ tot_fields++;
+ }
}
size= tot_subpart_fields * sizeof(char*);
- if (!(char_ptrs= (char**)sql_calloc(size)))
+ if (!(char_ptrs= (uchar**) sql_calloc(size)))
goto error;
subpart_field_buffers= char_ptrs;
- if (!(char_ptrs= (char**)sql_calloc(size)))
+ if (!(char_ptrs= (uchar**) sql_calloc(size)))
goto error;
restore_subpart_field_ptrs= char_ptrs;
size= (tot_subpart_fields + 1) * sizeof(Field*);
- if (!(char_ptrs= (char**)sql_alloc(size)))
+ if (!(char_ptrs= (uchar**) sql_alloc(size)))
goto error;
subpart_charset_field_array= (Field**)char_ptrs;
+ ptr= subpart_field_array;
i= 0;
while ((field= *(ptr++)))
{
- unsigned j= 0;
CHARSET_INFO *cs;
- char *field_buf;
+ uchar *field_buf;
LINT_INIT(field_buf);
if (!field_is_partition_charset(field))
continue;
cs= ((Field_str*)field)->charset();
size= field->pack_length();
- found= FALSE;
- for (j= 0; j < tot_part_fields; j++)
- {
- if (field == part_charset_field_array[i])
- found= TRUE;
- }
- if (!found)
- {
- tot_fields++;
- if (!(field_buf= sql_calloc(size)))
- goto error;
- }
+ if (!(field_buf= (uchar*) sql_calloc(size)))
+ goto error;
+ subpart_charset_field_array[i]= field;
subpart_field_buffers[i++]= field_buf;
}
- if (!(char_ptrs= (char**)sql_calloc(size)))
- goto error;
- restore_subpart_field_ptrs= char_ptrs;
+ subpart_charset_field_array[i]= NULL;
}
if (tot_fields)
{
- uint j,k,l;
-
+ uint k;
size= tot_fields*sizeof(char**);
- if (!(char_ptrs= (char**)sql_calloc(size)))
+ if (!(char_ptrs= (uchar**)sql_calloc(size)))
goto error;
full_part_field_buffers= char_ptrs;
- if (!(char_ptrs= (char**)sql_calloc(size)))
+ 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= (char**)sql_calloc(size)))
+ 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++)
@@ -1025,11 +1015,12 @@ bool partition_info::set_up_charset_field_preps()
full_part_field_buffers[i]= part_field_buffers[i];
}
k= tot_part_fields;
- l= 0;
for (i= 0; i < tot_subpart_fields; i++)
{
+ uint j;
+ bool found= FALSE;
field= subpart_charset_field_array[i];
- found= FALSE;
+
for (j= 0; j < tot_part_fields; j++)
{
if (field == part_charset_field_array[i])
@@ -1037,12 +1028,12 @@ bool partition_info::set_up_charset_field_preps()
}
if (!found)
{
- full_part_charset_field_array[l]= subpart_charset_field_array[k];
- full_part_field_buffers[l]= subpart_field_buffers[k];
- k++; l++;
+ 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[tot_fields]= NULL;
+ full_part_charset_field_array[k]= NULL;
}
DBUG_RETURN(FALSE);
error:
diff --git a/sql/partition_info.h b/sql/partition_info.h
index 6c21002c184..b7d13e188f3 100644
--- a/sql/partition_info.h
+++ b/sql/partition_info.h
@@ -81,18 +81,25 @@ public:
*/
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
+ updating. We need to set all bits in read_set because the row may
+ need to be inserted in a different [sub]partition.
+ */
+ MY_BITMAP full_part_field_set;
/*
When we have a field that requires transformation before calling the
partition functions we must allocate field buffers for the field of
the fields in the partition function.
*/
- char **part_field_buffers;
- char **subpart_field_buffers;
- char **full_part_field_buffers;
- char **restore_part_field_ptrs;
- char **restore_subpart_field_ptrs;
- char **restore_full_part_field_ptrs;
+ 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;
@@ -132,20 +139,6 @@ public:
*/
get_partitions_in_range_iter get_subpart_iter_for_interval;
- /*
- Valid iff
- get_part_iter_for_interval=get_part_iter_for_interval_via_walking:
- controls how we'll process "field < C" and "field > C" intervals.
- If the partitioning function F is strictly increasing, then for any x, y
- "x < y" => "F(x) < F(y)" (*), i.e. when we get interval "field < C"
- we can perform partition pruning on the equivalent "F(field) < F(C)".
-
- If the partitioning function not strictly increasing (it is simply
- increasing), then instead of (*) we get "x < y" => "F(x) <= F(y)"
- i.e. for interval "field < C" we can perform partition pruning for
- "F(field) <= F(C)".
- */
- bool range_analysis_include_bounds;
/********************************************
* INTERVAL ANALYSIS ENDS
********************************************/
diff --git a/sql/protocol.cc b/sql/protocol.cc
index d537fd346f9..2ed241c4c98 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -33,9 +33,9 @@ static void write_eof_packet(THD *thd, NET *net);
#endif
#ifndef EMBEDDED_LIBRARY
-bool Protocol::net_store_data(const char *from, uint length)
+bool Protocol::net_store_data(const uchar *from, size_t length)
#else
-bool Protocol_binary::net_store_data(const char *from, uint length)
+bool Protocol_binary::net_store_data(const uchar *from, size_t length)
#endif
{
ulong packet_length=packet->length();
@@ -46,10 +46,9 @@ bool Protocol_binary::net_store_data(const char *from, uint length)
if (packet_length+9+length > packet->alloced_length() &&
packet->realloc(packet_length+9+length))
return 1;
- char *to=(char*) net_store_length((char*) packet->ptr()+packet_length,
- length);
+ uchar *to= net_store_length((uchar*) packet->ptr()+packet_length, length);
memcpy(to,from,length);
- packet->length((uint) (to+length-packet->ptr()));
+ packet->length((uint) (to+length-(uchar*) packet->ptr()));
return 0;
}
@@ -227,7 +226,7 @@ net_printf_error(THD *thd, uint errcode, ...)
memcpy(pos+3, mysql_errno_to_sqlstate(errcode), SQLSTATE_LENGTH);
}
}
- VOID(net_real_write(net,(char*) net->buff,length+head_length+1+offset));
+ VOID(net_real_write(net, net->buff, length+head_length+1+offset));
#else
net->last_errno= errcode;
strmake(net->last_error, text_pos, length);
@@ -271,7 +270,7 @@ void
send_ok(THD *thd, ha_rows affected_rows, ulonglong id, const char *message)
{
NET *net= &thd->net;
- char buff[MYSQL_ERRMSG_SIZE+10],*pos;
+ uchar buff[MYSQL_ERRMSG_SIZE+10],*pos;
DBUG_ENTER("send_ok");
if (net->no_send_ok || !net->vio) // hack for re-parsing queries
@@ -307,8 +306,8 @@ send_ok(THD *thd, ha_rows affected_rows, ulonglong id, const char *message)
pos+=2;
}
if (message)
- pos=net_store_data((char*) pos, message, strlen(message));
- VOID(my_net_write(net,buff,(uint) (pos-buff)));
+ pos= net_store_data(pos, (uchar*) message, strlen(message));
+ VOID(my_net_write(net, buff, (size_t) (pos-buff)));
VOID(net_flush(net));
/* We can't anymore send an error to the client */
thd->net.report_error= 0;
@@ -318,7 +317,7 @@ send_ok(THD *thd, ha_rows affected_rows, ulonglong id, const char *message)
DBUG_VOID_RETURN;
}
-static char eof_buff[1]= { (char) 254 }; /* Marker for end of fields */
+static uchar eof_buff[1]= { (uchar) 254 }; /* Marker for end of fields */
/*
Send eof (= end of result set) to the client
@@ -383,7 +382,7 @@ static void write_eof_packet(THD *thd, NET *net)
if (thd->is_fatal_error)
thd->server_status&= ~SERVER_MORE_RESULTS_EXISTS;
int2store(buff+3, thd->server_status);
- VOID(my_net_write(net, (char*) buff, 5));
+ VOID(my_net_write(net, buff, 5));
}
else
VOID(my_net_write(net, eof_buff, 1));
@@ -411,7 +410,7 @@ void net_send_error_packet(THD *thd, uint sql_errno, const char *err)
{
NET *net= &thd->net;
uint length;
- char buff[MYSQL_ERRMSG_SIZE+2], *pos;
+ uchar buff[MYSQL_ERRMSG_SIZE+2], *pos;
DBUG_ENTER("send_error_packet");
@@ -433,17 +432,19 @@ void net_send_error_packet(THD *thd, uint sql_errno, const char *err)
{
/* The first # is to make the protocol backward compatible */
buff[2]= '#';
- pos= strmov(buff+3, mysql_errno_to_sqlstate(sql_errno));
+ pos= (uchar*) strmov((char*) buff+3, mysql_errno_to_sqlstate(sql_errno));
}
- length= (uint) (strmake(pos, err, MYSQL_ERRMSG_SIZE-1) - buff);
- err=buff;
+ length= (uint) (strmake((char*) pos, err, MYSQL_ERRMSG_SIZE-1) -
+ (char*) buff);
+ err= (char*) buff;
}
else
{
length=(uint) strlen(err);
set_if_smaller(length,MYSQL_ERRMSG_SIZE-1);
}
- VOID(net_write_command(net,(uchar) 255, "", 0, (char*) err,length));
+ VOID(net_write_command(net,(uchar) 255, (uchar*) "", 0, (uchar*) err,
+ length));
DBUG_VOID_RETURN;
}
@@ -459,17 +460,16 @@ void net_send_error_packet(THD *thd, uint sql_errno, const char *err)
ulonglong for bigger numbers.
*/
-static char *net_store_length_fast(char *pkg, uint length)
+static uchar *net_store_length_fast(uchar *packet, uint length)
{
- uchar *packet=(uchar*) pkg;
if (length < 251)
{
*packet=(uchar) length;
- return (char*) packet+1;
+ return packet+1;
}
*packet++=252;
int2store(packet,(uint) length);
- return (char*) packet+2;
+ return packet+2;
}
@@ -480,14 +480,14 @@ static char *net_store_length_fast(char *pkg, uint length)
/* The following will only be used for short strings < 65K */
-char *net_store_data(char *to,const char *from, uint length)
+uchar *net_store_data(uchar *to, const uchar *from, size_t length)
{
to=net_store_length_fast(to,length);
memcpy(to,from,length);
return to+length;
}
-char *net_store_data(char *to,int32 from)
+uchar *net_store_data(uchar *to,int32 from)
{
char buff[20];
uint length=(uint) (int10_to_str(from,buff,10)-buff);
@@ -496,7 +496,7 @@ char *net_store_data(char *to,int32 from)
return to+length;
}
-char *net_store_data(char *to,longlong from)
+uchar *net_store_data(uchar *to,longlong from)
{
char buff[22];
uint length=(uint) (longlong10_to_str(from,buff,10)-buff);
@@ -555,7 +555,7 @@ bool Protocol::send_fields(List<Item> *list, uint flags)
{
List_iterator_fast<Item> it(*list);
Item *item;
- char buff[80];
+ uchar buff[80];
String tmp((char*) buff,sizeof(buff),&my_charset_bin);
Protocol_text prot(thd);
String *local_packet= prot.storage_packet();
@@ -564,8 +564,8 @@ bool Protocol::send_fields(List<Item> *list, uint flags)
if (flags & SEND_NUM_ROWS)
{ // Packet with number of elements
- char *pos=net_store_length(buff, list->elements);
- (void) my_net_write(&thd->net, buff,(uint) (pos-buff));
+ uchar *pos= net_store_length(buff, list->elements);
+ (void) my_net_write(&thd->net, buff, (size_t) (pos-buff));
}
#ifndef DBUG_OFF
@@ -698,7 +698,8 @@ err:
bool Protocol::write()
{
DBUG_ENTER("Protocol::write");
- DBUG_RETURN(my_net_write(&thd->net, packet->ptr(), packet->length()));
+ DBUG_RETURN(my_net_write(&thd->net, (uchar*) packet->ptr(),
+ packet->length()));
}
#endif /* EMBEDDED_LIBRARY */
@@ -785,7 +786,7 @@ bool Protocol_text::store_null()
and store in network buffer.
*/
-bool Protocol::store_string_aux(const char *from, uint length,
+bool Protocol::store_string_aux(const char *from, size_t length,
CHARSET_INFO *fromcs, CHARSET_INFO *tocs)
{
/* 'tocs' is set 0 when client issues SET character_set_results=NULL */
@@ -794,15 +795,15 @@ bool Protocol::store_string_aux(const char *from, uint length,
tocs != &my_charset_bin)
{
uint dummy_errors;
- return convert->copy(from, length, fromcs, tocs, &dummy_errors) ||
- net_store_data(convert->ptr(), convert->length());
+ return (convert->copy(from, length, fromcs, tocs, &dummy_errors) ||
+ net_store_data((uchar*) convert->ptr(), convert->length()));
}
- return net_store_data(from, length);
+ return net_store_data((uchar*) from, length);
}
-bool Protocol_text::store(const char *from, uint length,
- CHARSET_INFO *fromcs, CHARSET_INFO *tocs)
+bool Protocol_text::store(const char *from, size_t length,
+ CHARSET_INFO *fromcs, CHARSET_INFO *tocs)
{
#ifndef DBUG_OFF
DBUG_ASSERT(field_types == 0 ||
@@ -817,7 +818,7 @@ bool Protocol_text::store(const char *from, uint length,
}
-bool Protocol_text::store(const char *from, uint length,
+bool Protocol_text::store(const char *from, size_t length,
CHARSET_INFO *fromcs)
{
CHARSET_INFO *tocs= this->thd->variables.character_set_results;
@@ -841,8 +842,8 @@ bool Protocol_text::store_tiny(longlong from)
field_pos++;
#endif
char buff[20];
- return net_store_data((char*) buff,
- (uint) (int10_to_str((int) from,buff, -10)-buff));
+ return net_store_data((uchar*) buff,
+ (size_t) (int10_to_str((int) from, buff, -10) - buff));
}
@@ -855,8 +856,9 @@ bool Protocol_text::store_short(longlong from)
field_pos++;
#endif
char buff[20];
- return net_store_data((char*) buff,
- (uint) (int10_to_str((int) from,buff, -10)-buff));
+ return net_store_data((uchar*) buff,
+ (size_t) (int10_to_str((int) from, buff, -10) -
+ buff));
}
@@ -869,8 +871,9 @@ bool Protocol_text::store_long(longlong from)
field_pos++;
#endif
char buff[20];
- return net_store_data((char*) buff,
- (uint) (int10_to_str((long int)from,buff, (from <0)?-10:10)-buff));
+ return net_store_data((uchar*) buff,
+ (size_t) (int10_to_str((long int)from, buff,
+ (from <0)?-10:10)-buff));
}
@@ -882,10 +885,10 @@ bool Protocol_text::store_longlong(longlong from, bool unsigned_flag)
field_pos++;
#endif
char buff[22];
- return net_store_data((char*) buff,
- (uint) (longlong10_to_str(from,buff,
- unsigned_flag ? 10 : -10)-
- buff));
+ return net_store_data((uchar*) buff,
+ (size_t) (longlong10_to_str(from,buff,
+ unsigned_flag ? 10 : -10)-
+ buff));
}
@@ -899,7 +902,7 @@ bool Protocol_text::store_decimal(const my_decimal *d)
char buff[DECIMAL_MAX_STR_LENGTH];
String str(buff, sizeof(buff), &my_charset_bin);
(void) my_decimal2string(E_DEC_FATAL_ERROR, d, 0, 0, 0, &str);
- return net_store_data(str.ptr(), str.length());
+ return net_store_data((uchar*) str.ptr(), str.length());
}
@@ -911,7 +914,7 @@ bool Protocol_text::store(float from, uint32 decimals, String *buffer)
field_pos++;
#endif
buffer->set_real((double) from, decimals, thd->charset());
- return net_store_data((char*) buffer->ptr(), buffer->length());
+ return net_store_data((uchar*) buffer->ptr(), buffer->length());
}
@@ -923,7 +926,7 @@ bool Protocol_text::store(double from, uint32 decimals, String *buffer)
field_pos++;
#endif
buffer->set_real(from, decimals, thd->charset());
- return net_store_data((char*) buffer->ptr(), buffer->length());
+ return net_store_data((uchar*) buffer->ptr(), buffer->length());
}
@@ -979,8 +982,9 @@ bool Protocol_text::store(MYSQL_TIME *tm)
(int) tm->minute,
(int) tm->second));
if (tm->second_part)
- length+= my_sprintf(buff+length,(buff+length, ".%06d", (int)tm->second_part));
- return net_store_data((char*) buff, length);
+ length+= my_sprintf(buff+length,(buff+length, ".%06d",
+ (int)tm->second_part));
+ return net_store_data((uchar*) buff, length);
}
@@ -992,8 +996,8 @@ bool Protocol_text::store_date(MYSQL_TIME *tm)
field_pos++;
#endif
char buff[MAX_DATE_STRING_REP_LENGTH];
- int length= my_date_to_str(tm, buff);
- return net_store_data(buff, (uint) length);
+ size_t length= my_date_to_str(tm, buff);
+ return net_store_data((uchar*) buff, length);
}
@@ -1020,7 +1024,7 @@ bool Protocol_text::store_time(MYSQL_TIME *tm)
(int) tm->second));
if (tm->second_part)
length+= my_sprintf(buff+length,(buff+length, ".%06d", (int)tm->second_part));
- return net_store_data((char*) buff, length);
+ return net_store_data((uchar*) buff, length);
}
@@ -1057,12 +1061,12 @@ bool Protocol_binary::prepare_for_send(List<Item> *item_list)
void Protocol_binary::prepare_for_resend()
{
packet->length(bit_fields+1);
- bzero((char*) packet->ptr(), 1+bit_fields);
+ bzero((uchar*) packet->ptr(), 1+bit_fields);
field_pos=0;
}
-bool Protocol_binary::store(const char *from, uint length,
+bool Protocol_binary::store(const char *from, size_t length,
CHARSET_INFO *fromcs)
{
CHARSET_INFO *tocs= thd->variables.character_set_results;
@@ -1070,7 +1074,7 @@ bool Protocol_binary::store(const char *from, uint length,
return store_string_aux(from, length, fromcs, tocs);
}
-bool Protocol_binary::store(const char *from,uint length,
+bool Protocol_binary::store(const char *from, size_t length,
CHARSET_INFO *fromcs, CHARSET_INFO *tocs)
{
field_pos++;
diff --git a/sql/protocol.h b/sql/protocol.h
index e0672240e0e..46a2b6d36b6 100644
--- a/sql/protocol.h
+++ b/sql/protocol.h
@@ -35,14 +35,14 @@ protected:
#endif
uint field_count;
#ifndef EMBEDDED_LIBRARY
- bool net_store_data(const char *from, uint length);
+ bool net_store_data(const uchar *from, size_t length);
#else
- virtual bool net_store_data(const char *from, uint length);
+ virtual bool net_store_data(const uchar *from, size_t length);
char **next_field;
MYSQL_FIELD *next_mysql_field;
MEM_ROOT *alloc;
#endif
- bool store_string_aux(const char *from, uint length,
+ bool store_string_aux(const char *from, size_t length,
CHARSET_INFO *fromcs, CHARSET_INFO *tocs);
public:
Protocol() {}
@@ -83,8 +83,8 @@ public:
virtual bool store_long(longlong from)=0;
virtual bool store_longlong(longlong from, bool unsigned_flag)=0;
virtual bool store_decimal(const my_decimal *)=0;
- virtual bool store(const char *from, uint length, CHARSET_INFO *cs)=0;
- virtual bool store(const char *from, uint length,
+ virtual bool store(const char *from, size_t length, CHARSET_INFO *cs)=0;
+ virtual bool store(const char *from, size_t length,
CHARSET_INFO *fromcs, CHARSET_INFO *tocs)=0;
virtual bool store(float from, uint32 decimals, String *buffer)=0;
virtual bool store(double from, uint32 decimals, String *buffer)=0;
@@ -124,8 +124,8 @@ public:
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, uint length, CHARSET_INFO *cs);
- virtual bool store(const char *from, uint length,
+ 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);
@@ -151,7 +151,7 @@ public:
virtual void prepare_for_resend();
#ifdef EMBEDDED_LIBRARY
virtual bool write();
- bool net_store_data(const char *from, uint length);
+ bool net_store_data(const uchar *from, size_t length);
#endif
virtual bool store_null();
virtual bool store_tiny(longlong from);
@@ -159,8 +159,8 @@ public:
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,uint length, CHARSET_INFO *cs);
- virtual bool store(const char *from, uint length,
+ 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);
@@ -178,7 +178,7 @@ void send_ok(THD *thd, ha_rows affected_rows=0L, ulonglong id=0L,
const char *info=0);
void send_eof(THD *thd);
bool send_old_password_request(THD *thd);
-char *net_store_data(char *to,const char *from, uint length);
-char *net_store_data(char *to,int32 from);
-char *net_store_data(char *to,longlong from);
+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);
diff --git a/sql/records.cc b/sql/records.cc
index 0fb9f4f9650..81c26da4b4d 100644
--- a/sql/records.cc
+++ b/sql/records.cc
@@ -432,7 +432,7 @@ static int rr_unpack_from_tempfile(READ_RECORD *info)
static int rr_from_pointers(READ_RECORD *info)
{
int tmp;
- byte *cache_pos;
+ uchar *cache_pos;
for (;;)
{
@@ -502,7 +502,7 @@ static int init_rr_cache(THD *thd, READ_RECORD *info)
// We have to allocate one more byte to use uint3korr (see comments for it)
if (info->cache_records <= 2 ||
- !(info->cache=(byte*) my_malloc_lock(rec_cache_size+info->cache_records*
+ !(info->cache=(uchar*) my_malloc_lock(rec_cache_size+info->cache_records*
info->struct_length+1,
MYF(0))))
DBUG_RETURN(1);
@@ -523,7 +523,7 @@ static int rr_from_cache(READ_RECORD *info)
ulong length;
my_off_t rest_of_file;
int16 error;
- byte *position,*ref_position,*record_pos;
+ uchar *position,*ref_position,*record_pos;
ulong record;
for (;;)
@@ -560,7 +560,7 @@ static int rr_from_cache(READ_RECORD *info)
ref_position=info->read_positions;
for (i=0 ; i < length ; i++,position+=info->ref_length)
{
- memcpy(ref_position,position,(size_s) info->ref_length);
+ memcpy(ref_position,position,(size_t) info->ref_length);
ref_position+=MAX_REFLENGTH;
int3store(ref_position,(long) i);
ref_position+=3;
@@ -570,7 +570,7 @@ static int rr_from_cache(READ_RECORD *info)
position=info->read_positions;
for (i=0 ; i < length ; i++)
{
- memcpy(info->ref_pos,position,(size_s) info->ref_length);
+ memcpy(info->ref_pos,position,(size_t) info->ref_length);
position+=MAX_REFLENGTH;
record=uint3korr(position);
position+=3;
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index 3c911a8c205..d9f57abc701 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -134,9 +134,9 @@ void unregister_slave(THD* thd, bool only_mine, bool need_mutex)
SLAVE_INFO* old_si;
if ((old_si = (SLAVE_INFO*)hash_search(&slave_list,
- (byte*)&thd->server_id, 4)) &&
+ (uchar*)&thd->server_id, 4)) &&
(!only_mine || old_si->thd == thd))
- hash_delete(&slave_list, (byte*)old_si);
+ hash_delete(&slave_list, (uchar*)old_si);
if (need_mutex)
pthread_mutex_unlock(&LOCK_slave_list);
@@ -180,12 +180,12 @@ int register_slave(THD* thd, uchar* packet, uint packet_length)
pthread_mutex_lock(&LOCK_slave_list);
unregister_slave(thd,0,0);
- res= my_hash_insert(&slave_list, (byte*) si);
+ res= my_hash_insert(&slave_list, (uchar*) si);
pthread_mutex_unlock(&LOCK_slave_list);
return res;
err:
- my_free((gptr) si, MYF(MY_WME));
+ my_free(si, MYF(MY_WME));
my_message(ER_UNKNOWN_ERROR, "Wrong parameters to function register_slave",
MYF(0));
err2:
@@ -193,7 +193,7 @@ err2:
}
extern "C" uint32
-*slave_list_key(SLAVE_INFO* si, uint* len,
+*slave_list_key(SLAVE_INFO* si, size_t *len,
my_bool not_used __attribute__((unused)))
{
*len = 4;
@@ -202,7 +202,7 @@ extern "C" uint32
extern "C" void slave_info_free(void *s)
{
- my_free((gptr) s, MYF(MY_WME));
+ my_free(s, MYF(MY_WME));
}
void init_slave_list()
@@ -492,7 +492,7 @@ bool show_new_master(THD* thd)
0 success
*/
-int update_slave_list(MYSQL* mysql, MASTER_INFO* mi)
+int update_slave_list(MYSQL* mysql, Master_info* mi)
{
MYSQL_RES* res=0;
MYSQL_ROW row;
@@ -531,7 +531,7 @@ HOSTS";
SLAVE_INFO* si, *old_si;
log_server_id = atoi(row[0]);
if ((old_si= (SLAVE_INFO*)hash_search(&slave_list,
- (byte*)&log_server_id,4)))
+ (uchar*)&log_server_id,4)))
si = old_si;
else
{
@@ -542,7 +542,7 @@ HOSTS";
goto err;
}
si->server_id = log_server_id;
- my_hash_insert(&slave_list, (byte*)si);
+ my_hash_insert(&slave_list, (uchar*)si);
}
strmake(si->host, row[1], sizeof(si->host)-1);
si->port = atoi(row[port_ind]);
@@ -679,7 +679,7 @@ bool show_slave_hosts(THD* thd)
}
-int connect_to_master(THD *thd, MYSQL* mysql, MASTER_INFO* mi)
+int connect_to_master(THD *thd, MYSQL* mysql, Master_info* mi)
{
DBUG_ENTER("connect_to_master");
@@ -728,7 +728,7 @@ static inline void cleanup_mysql_results(MYSQL_RES* db_res,
static int fetch_db_tables(THD *thd, MYSQL *mysql, const char *db,
- MYSQL_RES *table_res, MASTER_INFO *mi)
+ MYSQL_RES *table_res, Master_info *mi)
{
MYSQL_ROW row;
for (row = mysql_fetch_row(table_res); row;
diff --git a/sql/repl_failsafe.h b/sql/repl_failsafe.h
index 561db00d841..6ff78067aca 100644
--- a/sql/repl_failsafe.h
+++ b/sql/repl_failsafe.h
@@ -33,12 +33,12 @@ extern const char* rpl_role_type[], *rpl_status_type[];
pthread_handler_t handle_failsafe_rpl(void *arg);
void change_rpl_status(RPL_STATUS from_status, RPL_STATUS to_status);
int find_recovery_captain(THD* thd, MYSQL* mysql);
-int update_slave_list(MYSQL* mysql, MASTER_INFO* mi);
+int update_slave_list(MYSQL* mysql, Master_info* mi);
extern HASH slave_list;
bool load_master_data(THD* thd);
-int connect_to_master(THD *thd, MYSQL* mysql, MASTER_INFO* mi);
+int connect_to_master(THD *thd, MYSQL* mysql, Master_info* mi);
bool show_new_master(THD* thd);
bool show_slave_hosts(THD* thd);
diff --git a/sql/rpl_filter.cc b/sql/rpl_filter.cc
index f76f798f6a6..fb609e12dcb 100644
--- a/sql/rpl_filter.cc
+++ b/sql/rpl_filter.cc
@@ -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, (byte*) hash_key, len))
+ if (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, (byte*) hash_key, len))
+ if (hash_search(&ignore_table, (uchar*) hash_key, len))
DBUG_RETURN(0);
}
if (wild_do_table_inited &&
@@ -319,7 +319,7 @@ Rpl_filter::add_table_rule(HASH* h, const char* table_spec)
e->key_len= len;
memcpy(e->db, table_spec, len);
- return my_hash_insert(h, (byte*)e);
+ return my_hash_insert(h, (uchar*)e);
}
@@ -340,7 +340,7 @@ Rpl_filter::add_wild_table_rule(DYNAMIC_ARRAY* a, const char* table_spec)
e->tbl_name= e->db + (dot - table_spec) + 1;
e->key_len= len;
memcpy(e->db, table_spec, len);
- insert_dynamic(a, (gptr)&e);
+ insert_dynamic(a, (uchar*)&e);
return 0;
}
@@ -362,22 +362,24 @@ Rpl_filter::add_ignore_db(const char* table_spec)
ignore_db.push_back(db);
}
+extern "C" uchar *get_table_key(const uchar *, size_t *, my_bool);
+extern "C" void free_table_ent(void* a);
-static byte* get_table_key(const byte* a, uint* len,
- my_bool __attribute__((unused)))
+uchar *get_table_key(const uchar* a, size_t *len,
+ my_bool __attribute__((unused)))
{
TABLE_RULE_ENT *e= (TABLE_RULE_ENT *) a;
*len= e->key_len;
- return (byte*)e->db;
+ return (uchar*)e->db;
}
-static void free_table_ent(void* a)
+void free_table_ent(void* a)
{
TABLE_RULE_ENT *e= (TABLE_RULE_ENT *) a;
- my_free((gptr) e, MYF(0));
+ my_free((uchar*) e, MYF(0));
}
@@ -408,7 +410,7 @@ Rpl_filter::find_wild(DYNAMIC_ARRAY *a, const char* key, int len)
for (i= 0; i < a->elements; i++)
{
TABLE_RULE_ENT* e ;
- get_dynamic(a, (gptr)&e, i);
+ get_dynamic(a, (uchar*)&e, i);
if (!my_wildcmp(system_charset_info, key, key_end,
(const char*)e->db,
(const char*)(e->db + e->key_len),
@@ -427,7 +429,7 @@ Rpl_filter::free_string_array(DYNAMIC_ARRAY *a)
for (i= 0; i < a->elements; i++)
{
char* p;
- get_dynamic(a, (gptr) &p, i);
+ get_dynamic(a, (uchar*) &p, i);
my_free(p, MYF(MY_WME));
}
delete_dynamic(a);
@@ -474,7 +476,7 @@ Rpl_filter::table_rule_ent_dynamic_array_to_str(String* s, DYNAMIC_ARRAY* a,
for (uint i= 0; i < a->elements; i++)
{
TABLE_RULE_ENT* e;
- get_dynamic(a, (gptr)&e, i);
+ get_dynamic(a, (uchar*)&e, i);
if (s->length())
s->append(',');
s->append(e->db,e->key_len);
@@ -512,7 +514,7 @@ Rpl_filter::get_wild_ignore_table(String* str)
const char*
-Rpl_filter::get_rewrite_db(const char* db, uint *new_len)
+Rpl_filter::get_rewrite_db(const char* db, size_t *new_len)
{
if (rewrite_db.is_empty() || !db)
return db;
diff --git a/sql/rpl_filter.h b/sql/rpl_filter.h
index 396207d3a28..ff7e4081bb1 100644
--- a/sql/rpl_filter.h
+++ b/sql/rpl_filter.h
@@ -69,7 +69,7 @@ public:
void get_wild_do_table(String* str);
void get_wild_ignore_table(String* str);
- const char* get_rewrite_db(const char* db, uint *new_len);
+ const char* get_rewrite_db(const char* db, size_t *new_len);
I_List<i_string>* get_do_db();
I_List<i_string>* get_ignore_db();
diff --git a/sql/rpl_injector.h b/sql/rpl_injector.h
index 9c444ee20b3..4ece092c5b8 100644
--- a/sql/rpl_injector.h
+++ b/sql/rpl_injector.h
@@ -74,7 +74,7 @@ public:
friend class injector;
public:
/* Convenience definitions */
- typedef byte* record_type;
+ typedef uchar* record_type;
typedef uint32 server_id_type;
/*
diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc
index 354a97cefde..1165164fd88 100644
--- a/sql/rpl_mi.cc
+++ b/sql/rpl_mi.cc
@@ -27,10 +27,11 @@ 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);
-MASTER_INFO::MASTER_INFO()
- :ssl(0), fd(-1), io_thd(0), inited(0),
- abort_slave(0),slave_running(0), slave_run_id(0),
- ssl_verify_server_cert(0)
+Master_info::Master_info()
+ :Slave_reporting_capability("I/O"),
+ ssl(0), fd(-1), io_thd(0), inited(0),
+ abort_slave(0),slave_running(0),
+ ssl_verify_server_cert(0), slave_run_id(0)
{
host[0] = 0; user[0] = 0; password[0] = 0;
ssl_ca[0]= 0; ssl_capath[0]= 0; ssl_cert[0]= 0;
@@ -44,7 +45,7 @@ MASTER_INFO::MASTER_INFO()
pthread_cond_init(&stop_cond, NULL);
}
-MASTER_INFO::~MASTER_INFO()
+Master_info::~Master_info()
{
pthread_mutex_destroy(&run_lock);
pthread_mutex_destroy(&data_lock);
@@ -54,7 +55,7 @@ MASTER_INFO::~MASTER_INFO()
}
-void init_master_info_with_options(MASTER_INFO* mi)
+void init_master_info_with_options(Master_info* mi)
{
DBUG_ENTER("init_master_info_with_options");
@@ -97,7 +98,7 @@ enum {
LINES_IN_MASTER_INFO= LINE_FOR_MASTER_SSL_VERIFY_SERVER_CERT
};
-int init_master_info(MASTER_INFO* mi, const char* master_info_fname,
+int init_master_info(Master_info* mi, const char* master_info_fname,
const char* slave_info_fname,
bool abort_if_no_master_info_file,
int thread_mask)
@@ -337,7 +338,7 @@ err:
1 - flush master info failed
0 - all ok
*/
-int flush_master_info(MASTER_INFO* mi, bool flush_relay_log_cache)
+int flush_master_info(Master_info* mi, bool flush_relay_log_cache)
{
IO_CACHE* file = &mi->file;
char lbuf[22];
@@ -391,7 +392,7 @@ int flush_master_info(MASTER_INFO* mi, bool flush_relay_log_cache)
}
-void end_master_info(MASTER_INFO* mi)
+void end_master_info(Master_info* mi)
{
DBUG_ENTER("end_master_info");
diff --git a/sql/rpl_mi.h b/sql/rpl_mi.h
index 08435795a91..93fb0a98198 100644
--- a/sql/rpl_mi.h
+++ b/sql/rpl_mi.h
@@ -19,19 +19,20 @@
#ifdef HAVE_REPLICATION
#include "rpl_rli.h"
+#include "rpl_reporting.h"
/*****************************************************************************
Replication IO Thread
- MASTER_INFO contains:
+ Master_info contains:
- information about how to connect to a master
- current master log name
- current master log offset
- misc control variables
- MASTER_INFO is initialized once from the master.info file if such
+ Master_info is initialized once from the master.info file if such
exists. Otherwise, data members corresponding to master.info fields
are initialized with defaults specified by master-* options. The
initialization is done through init_master_info() call.
@@ -54,11 +55,11 @@
*****************************************************************************/
-class MASTER_INFO
+class Master_info : public Slave_reporting_capability
{
public:
- MASTER_INFO();
- ~MASTER_INFO();
+ Master_info();
+ ~Master_info();
/* the variables below are needed because we can change masters on the fly */
char master_log_name[FN_REFLEN];
@@ -79,7 +80,7 @@ class MASTER_INFO
THD *io_thd;
MYSQL* mysql;
uint32 file_id; /* for 3.23 load data infile */
- RELAY_LOG_INFO rli;
+ Relay_log_info rli;
uint port;
uint connect_retry;
#ifndef DBUG_OFF
@@ -101,13 +102,13 @@ class MASTER_INFO
long clock_diff_with_master;
};
-void init_master_info_with_options(MASTER_INFO* mi);
-int init_master_info(MASTER_INFO* mi, const char* master_info_fname,
+void init_master_info_with_options(Master_info* mi);
+int init_master_info(Master_info* mi, const char* master_info_fname,
const char* slave_info_fname,
bool abort_if_no_master_info_file,
int thread_mask);
-void end_master_info(MASTER_INFO* mi);
-int flush_master_info(MASTER_INFO* mi, bool flush_relay_log_cache);
+void end_master_info(Master_info* mi);
+int flush_master_info(Master_info* mi, bool flush_relay_log_cache);
#endif /* HAVE_REPLICATION */
#endif /* RPL_MI_H */
diff --git a/sql/rpl_record.cc b/sql/rpl_record.cc
index 4c6686cf446..65c8e106112 100644
--- a/sql/rpl_record.cc
+++ b/sql/rpl_record.cc
@@ -14,8 +14,11 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "mysql_priv.h"
+#include "rpl_rli.h"
#include "rpl_record.h"
#include "slave.h" // Need to pull in slave_print_msg
+#include "rpl_utility.h"
+#include "rpl_rli.h"
/**
Pack a record of data for a table into a format suitable for
@@ -51,14 +54,14 @@
@return The number of bytes written at @c row_data.
*/
#if !defined(MYSQL_CLIENT)
-my_size_t
+size_t
pack_row(TABLE *table, MY_BITMAP const* cols,
- byte *row_data, const byte *record)
+ uchar *row_data, const uchar *record)
{
Field **p_field= table->field, *field;
int const null_byte_count= (bitmap_bits_set(cols) + 7) / 8;
- byte *pack_ptr = row_data + null_byte_count;
- byte *null_ptr = row_data;
+ uchar *pack_ptr = row_data + null_byte_count;
+ uchar *null_ptr = row_data;
my_ptrdiff_t const rec_offset= record - table->record[0];
my_ptrdiff_t const def_offset= table->s->default_values - table->record[0];
@@ -89,8 +92,30 @@ pack_row(TABLE *table, MY_BITMAP const* cols,
/*
We only store the data of the field if it is non-null
- */
- pack_ptr= (byte*)field->pack((char *) pack_ptr, field->ptr + offset);
+
+ For big-endian machines, we have to make sure that the
+ length is stored in little-endian format, since this is the
+ format used for the binlog.
+
+ We do this by setting the db_low_byte_first, which is used
+ inside some store_length() to decide what order to write the
+ bytes in.
+
+ In reality, db_log_byte_first is only set for legacy table
+ type Isam, but in the event of a bug, we need to guarantee
+ the endianess when writing to the binlog.
+
+ This is currently broken for NDB due to BUG#29549, so we
+ will fix it when NDB has fixed their way of handling BLOBs.
+ */
+#if 0
+ bool save= table->s->db_low_byte_first;
+ table->s->db_low_byte_first= TRUE;
+#endif
+ pack_ptr= field->pack(pack_ptr, field->ptr + offset);
+#if 0
+ table->s->db_low_byte_first= save;
+#endif
}
null_mask <<= 1;
@@ -119,7 +144,7 @@ pack_row(TABLE *table, MY_BITMAP const* cols,
*/
DBUG_ASSERT(null_ptr == row_data + null_byte_count);
- return static_cast<my_size_t>(pack_ptr - row_data);
+ return static_cast<size_t>(pack_ptr - row_data);
}
#endif
@@ -132,9 +157,8 @@ pack_row(TABLE *table, MY_BITMAP const* cols,
the various member functions of Field and subclasses expect to
write.
- The row is assumed to only consist of the fields for which the
- bitset represented by @c arr and @c bits; the other parts of the
- record are left alone.
+ The row is assumed to only consist of the fields for which the corresponding
+ bit in bitset @c cols is set; the other parts of the record are left alone.
At most @c colcnt columns are read: if the table is larger than
that, the remaining fields are not filled in.
@@ -142,16 +166,14 @@ pack_row(TABLE *table, MY_BITMAP const* cols,
@param rli Relay log info
@param table Table to unpack into
@param colcnt Number of columns to read from record
- @param row Packed row data
- @param cols Pointer to columns data to fill in
+ @param row_data
+ Packed row data
+ @param cols Pointer to bitset describing columns to fill in
@param row_end Pointer to variable that will hold the value of the
one-after-end position for the row
@param master_reclength
Pointer to variable that will be set to the length of the
record on the master side
- @param rw_set Pointer to bitmap that holds either the read_set or the
- write_set of the table
-
@retval 0 No error
@@ -162,23 +184,18 @@ pack_row(TABLE *table, MY_BITMAP const* cols,
*/
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
int
-unpack_row(RELAY_LOG_INFO const *rli,
+unpack_row(Relay_log_info const *rli,
TABLE *table, uint const colcnt,
- char const *const row_data, MY_BITMAP const *cols,
- char const **const row_end, ulong *const master_reclength,
- MY_BITMAP* const rw_set, Log_event_type const event_type)
+ uchar const *const row_data, MY_BITMAP const *cols,
+ uchar const **const row_end, ulong *const master_reclength)
{
DBUG_ENTER("unpack_row");
DBUG_ASSERT(row_data);
- my_size_t const master_null_byte_count= (bitmap_bits_set(cols) + 7) / 8;
+ size_t const master_null_byte_count= (bitmap_bits_set(cols) + 7) / 8;
int error= 0;
- char const *null_ptr= row_data;
- char const *pack_ptr= row_data + master_null_byte_count;
-
- bitmap_clear_all(rw_set);
-
- empty_record(table);
+ uchar const *null_ptr= row_data;
+ uchar const *pack_ptr= row_data + master_null_byte_count;
Field **const begin_ptr = table->field;
Field **field_ptr;
@@ -190,7 +207,9 @@ unpack_row(RELAY_LOG_INFO const *rli,
unsigned int null_mask= 1U;
// The "current" null bits
unsigned int null_bits= *null_ptr++;
- for (field_ptr= begin_ptr ; field_ptr < end_ptr ; ++field_ptr)
+ uint i= 0;
+ table_def *tabledef= ((Relay_log_info*)rli)->get_tabledef(table);
+ for (field_ptr= begin_ptr ; field_ptr < end_ptr && *field_ptr ; ++field_ptr)
{
Field *const f= *field_ptr;
@@ -219,12 +238,47 @@ unpack_row(RELAY_LOG_INFO const *rli,
f->set_notnull();
/*
- We only unpack the field if it was non-null
+ We only unpack the field if it was non-null.
+ Use the master's size information if available else call
+ normal unpack operation.
*/
- pack_ptr= f->unpack(f->ptr, pack_ptr);
+#if 0
+ bool save= table->s->db_low_byte_first;
+ table->s->db_low_byte_first= TRUE;
+#endif
+ uint16 const metadata= tabledef->field_metadata(i);
+ if (tabledef && metadata)
+ pack_ptr= f->unpack(f->ptr, pack_ptr, metadata);
+ else
+ pack_ptr= f->unpack(f->ptr, pack_ptr);
+#if 0
+ table->s->db_low_byte_first= save;
+#endif
}
- bitmap_set_bit(rw_set, f->field_index);
+ null_mask <<= 1;
+ }
+ i++;
+ }
+
+ /*
+ throw away master's extra fields
+ */
+ uint max_cols= min(tabledef->size(), cols->n_bits);
+ for (; i < max_cols; i++)
+ {
+ if (bitmap_is_set(cols, i))
+ {
+ if ((null_mask & 0xFF) == 0)
+ {
+ DBUG_ASSERT(null_ptr < row_data + master_null_byte_count);
+ null_mask= 1U;
+ null_bits= *null_ptr++;
+ }
+ DBUG_ASSERT(null_mask & 0xFF); // One of the 8 LSB should be set
+
+ if (!((null_bits & null_mask) && tabledef->maybe_null(i)))
+ pack_ptr+= tabledef->calc_field_size(i, (uchar *) pack_ptr);
null_mask <<= 1;
}
}
@@ -239,35 +293,63 @@ unpack_row(RELAY_LOG_INFO const *rli,
if (master_reclength)
{
if (*field_ptr)
- *master_reclength = (*field_ptr)->ptr - (char*) table->record[0];
+ *master_reclength = (*field_ptr)->ptr - table->record[0];
else
*master_reclength = table->s->reclength;
}
+
+ DBUG_RETURN(error);
+}
- /*
- Set properties for remaining columns, if there are any. We let the
- corresponding bit in the write_set be set, to write the value if
- it was not there already. We iterate over all remaining columns,
- even if there were an error, to get as many error messages as
- possible. We are still able to return a pointer to the next row,
- so redo that.
-
- This generation of error messages is only relevant when inserting
- new rows.
- */
- for ( ; *field_ptr ; ++field_ptr)
+/**
+ Fills @c table->record[0] with default values.
+
+ First @c empty_record() is called and then, additionally, fields are
+ initialized explicitly with a call to @c set_default().
+
+ For optimization reasons, the explicit initialization can be skipped for
+ first @c skip fields. This is useful if later we are going to fill these
+ fields from other source (e.g. from a Rows replication event).
+
+ If @c check is true, fields are explicitly initialized only if they have
+ default value or can be NULL. Otherwise error is reported.
+
+ @param log Used to report errors.
+ @param table Table whose record[0] buffer is prepared.
+ @param skip Number of columns for which default value initialization
+ should be skipped.
+ @param check Indicates if errors should be checked when setting default
+ values.
+
+ @returns 0 on success.
+ */
+int prepare_record(const Slave_reporting_capability *const log,
+ TABLE *const table,
+ const uint skip, const bool check)
+{
+ DBUG_ENTER("prepare_record");
+
+ int error= 0;
+ empty_record(table);
+
+ if (skip >= table->s->fields) // nothing to do
+ DBUG_RETURN(0);
+
+ /* Explicit initialization of fields */
+
+ for (Field **field_ptr= table->field+skip ; *field_ptr ; ++field_ptr)
{
uint32 const mask= NOT_NULL_FLAG | NO_DEFAULT_VALUE_FLAG;
Field *const f= *field_ptr;
- if (event_type == WRITE_ROWS_EVENT &&
- ((*field_ptr)->flags & mask) == mask)
+ if (check && ((f->flags & mask) == mask))
{
- slave_print_msg(ERROR_LEVEL, rli, ER_NO_DEFAULT_FOR_FIELD,
- "Field `%s` of table `%s`.`%s` "
- "has no default value and cannot be NULL",
- (*field_ptr)->field_name, table->s->db.str,
- table->s->table_name.str);
+ DBUG_ASSERT(log);
+ log->report(ERROR_LEVEL, ER_NO_DEFAULT_FOR_FIELD,
+ "Field `%s` of table `%s`.`%s` "
+ "has no default value and cannot be NULL",
+ f->field_name, table->s->db.str,
+ table->s->table_name.str);
error = ER_NO_DEFAULT_FOR_FIELD;
}
else
diff --git a/sql/rpl_record.h b/sql/rpl_record.h
index 7ff1bbc7c8e..0d6ceda7433 100644
--- a/sql/rpl_record.h
+++ b/sql/rpl_record.h
@@ -16,18 +16,22 @@
#ifndef RPL_RECORD_H
#define RPL_RECORD_H
+#include <rpl_reporting.h>
+
#if !defined(MYSQL_CLIENT)
-my_size_t pack_row(TABLE* table, MY_BITMAP const* cols,
- byte *row_data, const byte *data);
+size_t pack_row(TABLE* table, MY_BITMAP const* cols,
+ uchar *row_data, const uchar *data);
#endif
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
-int unpack_row(RELAY_LOG_INFO const *rli,
+int unpack_row(Relay_log_info const *rli,
TABLE *table, uint const colcnt,
- char const *const row_data, MY_BITMAP const *cols,
- char const **const row_end, ulong *const master_reclength,
- MY_BITMAP* const rw_set,
- Log_event_type const event_type);
+ uchar const *const row_data, MY_BITMAP const *cols,
+ uchar const **const row_end, ulong *const master_reclength);
+
+// Fill table's record[0] with default values.
+int prepare_record(const Slave_reporting_capability *const, TABLE *const,
+ const uint =0, const bool =FALSE);
#endif
#endif
diff --git a/sql/rpl_record_old.cc b/sql/rpl_record_old.cc
index 73e2f4e7344..ab4e993ce41 100644
--- a/sql/rpl_record_old.cc
+++ b/sql/rpl_record_old.cc
@@ -1,14 +1,15 @@
#include "mysql_priv.h"
+#include "rpl_rli.h"
#include "rpl_record_old.h"
-my_size_t
+size_t
pack_row_old(TABLE *table, MY_BITMAP const* cols,
- byte *row_data, const byte *record)
+ uchar *row_data, const uchar *record)
{
Field **p_field= table->field, *field;
int n_null_bytes= table->s->null_bytes;
- byte *ptr;
+ uchar *ptr;
uint i;
my_ptrdiff_t const rec_offset= record - table->record[0];
my_ptrdiff_t const def_offset= table->s->default_values - table->record[0];
@@ -22,11 +23,11 @@ pack_row_old(TABLE *table, MY_BITMAP const* cols,
my_ptrdiff_t const offset=
field->is_null(rec_offset) ? def_offset : rec_offset;
field->move_field_offset(offset);
- ptr= (byte*)field->pack((char *) ptr, field->ptr);
+ ptr= field->pack(ptr, field->ptr);
field->move_field_offset(-offset);
}
}
- return (static_cast<my_size_t>(ptr - row_data));
+ return (static_cast<size_t>(ptr - row_data));
}
@@ -69,15 +70,15 @@ pack_row_old(TABLE *table, MY_BITMAP const* cols,
*/
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
int
-unpack_row_old(RELAY_LOG_INFO *rli,
- TABLE *table, uint const colcnt, byte *record,
- char const *row, MY_BITMAP const *cols,
- char const **row_end, ulong *master_reclength,
+unpack_row_old(Relay_log_info *rli,
+ TABLE *table, uint const colcnt, uchar *record,
+ uchar const *row, MY_BITMAP const *cols,
+ uchar const **row_end, ulong *master_reclength,
MY_BITMAP* const rw_set, Log_event_type const event_type)
{
DBUG_ASSERT(record && row);
- my_ptrdiff_t const offset= record - (byte*) table->record[0];
- my_size_t master_null_bytes= table->s->null_bytes;
+ my_ptrdiff_t const offset= record - (uchar*) table->record[0];
+ size_t master_null_bytes= table->s->null_bytes;
if (colcnt != table->s->fields)
{
@@ -108,7 +109,7 @@ unpack_row_old(RELAY_LOG_INFO *rli,
Field **const begin_ptr = table->field;
Field **field_ptr;
- char const *ptr= row + master_null_bytes;
+ uchar const *ptr= row + master_null_bytes;
Field **const end_ptr= begin_ptr + colcnt;
for (field_ptr= begin_ptr ; field_ptr < end_ptr ; ++field_ptr)
{
@@ -130,7 +131,7 @@ unpack_row_old(RELAY_LOG_INFO *rli,
if (master_reclength)
{
if (*field_ptr)
- *master_reclength = (*field_ptr)->ptr - (char*) table->record[0];
+ *master_reclength = (*field_ptr)->ptr - table->record[0];
else
*master_reclength = table->s->reclength;
}
@@ -157,11 +158,11 @@ unpack_row_old(RELAY_LOG_INFO *rli,
if (event_type == WRITE_ROWS_EVENT &&
((*field_ptr)->flags & mask) == mask)
{
- slave_print_msg(ERROR_LEVEL, rli, ER_NO_DEFAULT_FOR_FIELD,
- "Field `%s` of table `%s`.`%s` "
- "has no default value and cannot be NULL",
- (*field_ptr)->field_name, table->s->db.str,
- table->s->table_name.str);
+ rli->report(ERROR_LEVEL, ER_NO_DEFAULT_FOR_FIELD,
+ "Field `%s` of table `%s`.`%s` "
+ "has no default value and cannot be NULL",
+ (*field_ptr)->field_name, table->s->db.str,
+ table->s->table_name.str);
error = ER_NO_DEFAULT_FOR_FIELD;
}
else
diff --git a/sql/rpl_record_old.h b/sql/rpl_record_old.h
index 6ddb01de07c..bdaedd56741 100644
--- a/sql/rpl_record_old.h
+++ b/sql/rpl_record_old.h
@@ -17,14 +17,14 @@
#define RPL_RECORD_OLD_H
#ifndef MYSQL_CLIENT
-my_size_t pack_row_old(TABLE *table, MY_BITMAP const* cols,
- byte *row_data, const byte *record);
+size_t pack_row_old(TABLE *table, MY_BITMAP const* cols,
+ uchar *row_data, const uchar *record);
#ifdef HAVE_REPLICATION
-int unpack_row_old(RELAY_LOG_INFO *rli,
- TABLE *table, uint const colcnt, byte *record,
- char const *row, MY_BITMAP const *cols,
- char const **row_end, ulong *master_reclength,
+int unpack_row_old(Relay_log_info *rli,
+ TABLE *table, uint const colcnt, uchar *record,
+ uchar const *row, MY_BITMAP const *cols,
+ uchar const **row_end, ulong *master_reclength,
MY_BITMAP* const rw_set,
Log_event_type const event_type);
#endif
diff --git a/sql/rpl_reporting.cc b/sql/rpl_reporting.cc
new file mode 100644
index 00000000000..28f257790c7
--- /dev/null
+++ b/sql/rpl_reporting.cc
@@ -0,0 +1,48 @@
+
+#include "mysql_priv.h"
+#include "rpl_reporting.h"
+
+void
+Slave_reporting_capability::report(loglevel level, int err_code,
+ const char *msg, ...) const
+{
+ void (*report_function)(const char *, ...);
+ char buff[MAX_SLAVE_ERRMSG];
+ char *pbuff= buff;
+ uint pbuffsize= sizeof(buff);
+ va_list args;
+ va_start(args, msg);
+
+ switch (level)
+ {
+ case ERROR_LEVEL:
+ /*
+ It's an error, it must be reported in Last_error and Last_errno in SHOW
+ SLAVE STATUS.
+ */
+ pbuff= m_last_error.message;
+ pbuffsize= sizeof(m_last_error.message);
+ m_last_error.number = err_code;
+ report_function= sql_print_error;
+ break;
+ case WARNING_LEVEL:
+ report_function= sql_print_warning;
+ break;
+ case INFORMATION_LEVEL:
+ report_function= sql_print_information;
+ break;
+ default:
+ DBUG_ASSERT(0); // should not come here
+ return; // don't crash production builds, just do nothing
+ }
+
+ my_vsnprintf(pbuff, pbuffsize, msg, args);
+
+ va_end(args);
+
+ /* If the msg string ends with '.', do not add a ',' it would be ugly */
+ report_function("Slave %s: %s%s Error_code: %d",
+ m_thread_name, pbuff,
+ (pbuff[0] && *(strend(pbuff)-1) == '.') ? "" : ",",
+ err_code);
+}
diff --git a/sql/rpl_reporting.h b/sql/rpl_reporting.h
new file mode 100644
index 00000000000..2e3fa3cea83
--- /dev/null
+++ b/sql/rpl_reporting.h
@@ -0,0 +1,85 @@
+#ifndef RPL_REPORTING_H
+#define RPL_REPORTING_H
+
+/**
+ Maximum size of an error message from a slave thread.
+ */
+#define MAX_SLAVE_ERRMSG 1024
+
+/**
+ Mix-in to handle the message logging and reporting for relay log
+ info and master log info structures.
+
+ By inheriting from this class, the class is imbued with
+ capabilities to do slave reporting.
+ */
+class Slave_reporting_capability
+{
+public:
+ /**
+ Constructor.
+
+ @param thread_name Printable name of the slave thread that is reporting.
+ */
+ Slave_reporting_capability(char const *thread_name)
+ : m_thread_name(thread_name)
+ {
+ }
+
+ /**
+ Writes a message and, if it's an error message, to Last_Error
+ (which will be displayed by SHOW SLAVE STATUS).
+
+ @param level The severity level
+ @param err_code The error code
+ @param msg The message (usually related to the error
+ code, but can contain more information), in
+ printf() format.
+ */
+ void report(loglevel level, int err_code, const char *msg, ...) const
+ ATTRIBUTE_FORMAT(printf, 4, 5);
+
+ /**
+ Clear errors. They will not show up under <code>SHOW SLAVE
+ STATUS</code>.
+ */
+ void clear_error() {
+ m_last_error.clear();
+ }
+
+ /**
+ Error information structure.
+ */
+ class Error {
+ friend class Slave_reporting_capability;
+ public:
+ Error()
+ {
+ clear();
+ }
+
+ void clear()
+ {
+ number= 0;
+ message[0]= '\0';
+ }
+
+ /** Error code */
+ uint32 number;
+ /** Error message */
+ char message[MAX_SLAVE_ERRMSG];
+ };
+
+ Error const& last_error() const { return m_last_error; }
+
+private:
+ /**
+ Last error produced by the I/O or SQL thread respectively.
+ */
+ mutable Error m_last_error;
+
+ char const *const m_thread_name;
+};
+
+#endif // RPL_REPORTING_H
+
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc
index 702dec72f56..867d55a60a3 100644
--- a/sql/rpl_rli.cc
+++ b/sql/rpl_rli.cc
@@ -21,7 +21,7 @@
#include "sql_repl.h" // For check_binlog_magic
#include "rpl_utility.h"
-static int count_relay_log_space(RELAY_LOG_INFO* rli);
+static int count_relay_log_space(Relay_log_info* rli);
// Defined in slave.cc
int init_intvar_from_file(int* var, IO_CACHE* f, int default_val);
@@ -29,22 +29,23 @@ int init_strvar_from_file(char *var, int max_size, IO_CACHE *f,
const char *default_val);
-st_relay_log_info::st_relay_log_info()
- :no_storage(FALSE), replicate_same_server_id(::replicate_same_server_id),
+Relay_log_info::Relay_log_info()
+ :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_master_log_pos(0), log_space_total(0),
ignore_log_space_limit(0), last_master_timestamp(0), slave_skip_counter(0),
- abort_pos_wait(0), slave_run_id(0), sql_thd(0), last_slave_errno(0),
+ abort_pos_wait(0), slave_run_id(0), sql_thd(0),
inited(0), abort_slave(0), slave_running(0), until_condition(UNTIL_NONE),
until_log_pos(0), retried_trans(0),
tables_to_lock(0), tables_to_lock_count(0),
last_event_start_time(0), m_flags(0)
{
- DBUG_ENTER("st_relay_log_info::st_relay_log_info");
+ DBUG_ENTER("Relay_log_info::Relay_log_info");
group_relay_log_name[0]= event_relay_log_name[0]=
group_master_log_name[0]= 0;
- last_slave_error[0]= until_log_name[0]= ign_master_log_name_end[0]= 0;
+ until_log_name[0]= ign_master_log_name_end[0]= 0;
bzero((char*) &info_file, sizeof(info_file));
bzero((char*) &cache_buf, sizeof(cache_buf));
cached_charset_invalidate();
@@ -60,9 +61,9 @@ st_relay_log_info::st_relay_log_info()
}
-st_relay_log_info::~st_relay_log_info()
+Relay_log_info::~Relay_log_info()
{
- DBUG_ENTER("st_relay_log_info::~st_relay_log_info");
+ DBUG_ENTER("Relay_log_info::~Relay_log_info");
pthread_mutex_destroy(&run_lock);
pthread_mutex_destroy(&data_lock);
@@ -76,7 +77,7 @@ st_relay_log_info::~st_relay_log_info()
}
-int init_relay_log_info(RELAY_LOG_INFO* rli,
+int init_relay_log_info(Relay_log_info* rli,
const char* info_fname)
{
char fname[FN_REFLEN+128];
@@ -293,7 +294,7 @@ err:
}
-static inline int add_relay_log(RELAY_LOG_INFO* rli,LOG_INFO* linfo)
+static inline int add_relay_log(Relay_log_info* rli,LOG_INFO* linfo)
{
MY_STAT s;
DBUG_ENTER("add_relay_log");
@@ -312,7 +313,7 @@ static inline int add_relay_log(RELAY_LOG_INFO* rli,LOG_INFO* linfo)
}
-static int count_relay_log_space(RELAY_LOG_INFO* rli)
+static int count_relay_log_space(Relay_log_info* rli)
{
LOG_INFO linfo;
DBUG_ENTER("count_relay_log_space");
@@ -337,29 +338,19 @@ static int count_relay_log_space(RELAY_LOG_INFO* rli)
}
-void st_relay_log_info::clear_slave_error()
-{
- DBUG_ENTER("clear_slave_error");
-
- /* Clear the errors displayed by SHOW SLAVE STATUS */
- last_slave_error[0]= 0;
- last_slave_errno= 0;
- DBUG_VOID_RETURN;
-}
-
/*
- Reset UNTIL condition for RELAY_LOG_INFO
+ Reset UNTIL condition for Relay_log_info
SYNOPSYS
clear_until_condition()
- rli - RELAY_LOG_INFO structure where UNTIL condition should be reset
+ rli - Relay_log_info structure where UNTIL condition should be reset
*/
-void st_relay_log_info::clear_until_condition()
+void Relay_log_info::clear_until_condition()
{
DBUG_ENTER("clear_until_condition");
- until_condition= RELAY_LOG_INFO::UNTIL_NONE;
+ until_condition= Relay_log_info::UNTIL_NONE;
until_log_name[0]= 0;
until_log_pos= 0;
DBUG_VOID_RETURN;
@@ -398,7 +389,7 @@ void st_relay_log_info::clear_until_condition()
1 error. errmsg is set to point to the error message
*/
-int init_relay_log_pos(RELAY_LOG_INFO* rli,const char* log,
+int init_relay_log_pos(Relay_log_info* rli,const char* log,
ulonglong pos, bool need_data_lock,
const char** errmsg,
bool look_for_description_event)
@@ -608,7 +599,7 @@ err:
before reaching the desired log/position
*/
-int st_relay_log_info::wait_for_pos(THD* thd, String* log_name,
+int Relay_log_info::wait_for_pos(THD* thd, String* log_name,
longlong log_pos,
longlong timeout)
{
@@ -617,7 +608,7 @@ int st_relay_log_info::wait_for_pos(THD* thd, String* log_name,
int error=0;
struct timespec abstime; // for timeout checking
const char *msg;
- DBUG_ENTER("st_relay_log_info::wait_for_pos");
+ DBUG_ENTER("Relay_log_info::wait_for_pos");
if (!inited)
DBUG_RETURN(-1);
@@ -788,10 +779,10 @@ improper_arguments: %d timed_out: %d",
}
-void st_relay_log_info::inc_group_relay_log_pos(ulonglong log_pos,
+void Relay_log_info::inc_group_relay_log_pos(ulonglong log_pos,
bool skip_lock)
{
- DBUG_ENTER("st_relay_log_info::inc_group_relay_log_pos");
+ DBUG_ENTER("Relay_log_info::inc_group_relay_log_pos");
if (!skip_lock)
pthread_mutex_lock(&data_lock);
@@ -845,10 +836,10 @@ void st_relay_log_info::inc_group_relay_log_pos(ulonglong log_pos,
}
-void st_relay_log_info::close_temporary_tables()
+void Relay_log_info::close_temporary_tables()
{
TABLE *table,*next;
- DBUG_ENTER("st_relay_log_info::close_temporary_tables");
+ DBUG_ENTER("Relay_log_info::close_temporary_tables");
for (table=save_temporary_tables ; table ; table=next)
{
@@ -872,7 +863,7 @@ void st_relay_log_info::close_temporary_tables()
Assumes to have a run lock on rli and that no slave thread are running.
*/
-int purge_relay_logs(RELAY_LOG_INFO* rli, THD *thd, bool just_reset,
+int purge_relay_logs(Relay_log_info* rli, THD *thd, bool just_reset,
const char** errmsg)
{
int error=0;
@@ -959,12 +950,12 @@ err:
/*
Check if condition stated in UNTIL clause of START SLAVE is reached.
SYNOPSYS
- st_relay_log_info::is_until_satisfied()
+ Relay_log_info::is_until_satisfied()
DESCRIPTION
Checks if UNTIL condition is reached. Uses caching result of last
comparison of current log file name and target log file name. So cached
value should be invalidated if current log file name changes
- (see st_relay_log_info::notify_... functions).
+ (see Relay_log_info::notify_... functions).
This caching is needed to avoid of expensive string comparisons and
strtol() conversions needed for log names comparison. We don't need to
@@ -984,11 +975,11 @@ err:
false - condition not met
*/
-bool st_relay_log_info::is_until_satisfied()
+bool Relay_log_info::is_until_satisfied()
{
const char *log_name;
ulonglong log_pos;
- DBUG_ENTER("st_relay_log_info::is_until_satisfied");
+ DBUG_ENTER("Relay_log_info::is_until_satisfied");
DBUG_ASSERT(until_condition != UNTIL_NONE);
@@ -1064,9 +1055,9 @@ bool st_relay_log_info::is_until_satisfied()
}
-void st_relay_log_info::cached_charset_invalidate()
+void Relay_log_info::cached_charset_invalidate()
{
- DBUG_ENTER("st_relay_log_info::cached_charset_invalidate");
+ DBUG_ENTER("Relay_log_info::cached_charset_invalidate");
/* Full of zeroes means uninitialized. */
bzero(cached_charset, sizeof(cached_charset));
@@ -1074,11 +1065,12 @@ void st_relay_log_info::cached_charset_invalidate()
}
-bool st_relay_log_info::cached_charset_compare(char *charset) const
+bool Relay_log_info::cached_charset_compare(char *charset) const
{
- DBUG_ENTER("st_relay_log_info::cached_charset_compare");
+ DBUG_ENTER("Relay_log_info::cached_charset_compare");
- if (bcmp(cached_charset, charset, sizeof(cached_charset)))
+ if (bcmp((uchar*) cached_charset, (uchar*) charset,
+ sizeof(cached_charset)))
{
memcpy(const_cast<char*>(cached_charset), charset, sizeof(cached_charset));
DBUG_RETURN(1);
@@ -1087,7 +1079,7 @@ bool st_relay_log_info::cached_charset_compare(char *charset) const
}
-void st_relay_log_info::stmt_done(my_off_t event_master_log_pos,
+void Relay_log_info::stmt_done(my_off_t event_master_log_pos,
time_t event_creation_time)
{
clear_flag(IN_STMT);
@@ -1134,9 +1126,9 @@ void st_relay_log_info::stmt_done(my_off_t event_master_log_pos,
}
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
-void st_relay_log_info::cleanup_context(THD *thd, bool error)
+void Relay_log_info::cleanup_context(THD *thd, bool error)
{
- DBUG_ENTER("st_relay_log_info::cleanup_context");
+ DBUG_ENTER("Relay_log_info::cleanup_context");
DBUG_ASSERT(sql_thd == thd);
/*
@@ -1164,11 +1156,11 @@ void st_relay_log_info::cleanup_context(THD *thd, bool error)
DBUG_VOID_RETURN;
}
-void st_relay_log_info::clear_tables_to_lock()
+void Relay_log_info::clear_tables_to_lock()
{
while (tables_to_lock)
{
- gptr to_free= reinterpret_cast<gptr>(tables_to_lock);
+ uchar* to_free= reinterpret_cast<uchar*>(tables_to_lock);
if (tables_to_lock->m_tabledef_valid)
{
tables_to_lock->m_tabledef.table_def::~table_def();
diff --git a/sql/rpl_rli.h b/sql/rpl_rli.h
index fada45722f6..10ecf1a43d4 100644
--- a/sql/rpl_rli.h
+++ b/sql/rpl_rli.h
@@ -16,27 +16,27 @@
#ifndef RPL_RLI_H
#define RPL_RLI_H
-#define MAX_SLAVE_ERRMSG 1024
-
#include "rpl_tblmap.h"
+#include "rpl_reporting.h"
+#include "rpl_utility.h"
struct RPL_TABLE_LIST;
-
+class Master_info;
/****************************************************************************
Replication SQL Thread
- st_relay_log_info contains:
+ Relay_log_info contains:
- the current relay log
- the current relay log offset
- master log name
- master log sequence corresponding to the last update
- misc information specific to the SQL thread
- st_relay_log_info is initialized from the slave.info file if such exists.
- Otherwise, data members are intialized with defaults. The initialization is
- done with init_relay_log_info() call.
+ Relay_log_info is initialized from the slave.info file if such
+ exists. Otherwise, data members are intialized with defaults. The
+ initialization is done with init_relay_log_info() call.
The format of slave.info file:
@@ -49,8 +49,9 @@ struct RPL_TABLE_LIST;
*****************************************************************************/
-typedef struct st_relay_log_info
+class Relay_log_info : public Slave_reporting_capability
{
+public:
/**
Flags for the state of the replication.
*/
@@ -120,8 +121,8 @@ typedef struct st_relay_log_info
*/
pthread_cond_t start_cond, stop_cond, data_cond;
- /* parent MASTER_INFO structure */
- class MASTER_INFO *mi;
+ /* parent Master_info structure */
+ Master_info *mi;
/*
Needed to deal properly with cur_log getting closed and re-opened with
@@ -186,7 +187,6 @@ typedef struct st_relay_log_info
time_t last_master_timestamp;
- void clear_slave_error();
void clear_until_condition();
/*
@@ -200,11 +200,9 @@ typedef struct st_relay_log_info
pthread_mutex_t log_space_lock;
pthread_cond_t log_space_cond;
THD * sql_thd;
- int last_slave_errno;
#ifndef DBUG_OFF
int events_till_abort;
#endif
- char last_slave_error[MAX_SLAVE_ERRMSG];
/* if not set, the value of other members of the structure are undefined */
bool inited;
@@ -258,8 +256,8 @@ typedef struct st_relay_log_info
char ign_master_log_name_end[FN_REFLEN];
ulonglong ign_master_log_pos_end;
- st_relay_log_info();
- ~st_relay_log_info();
+ Relay_log_info();
+ ~Relay_log_info();
/*
Invalidate cached until_log_name and group_relay_log_name comparison
@@ -305,6 +303,15 @@ typedef struct st_relay_log_info
uint tables_to_lock_count; /* RBR: Count of tables to lock */
table_mapping m_table_map; /* RBR: Mapping table-id to table */
+ inline table_def *get_tabledef(TABLE *tbl)
+ {
+ table_def *td= 0;
+ for (TABLE_LIST *ptr= tables_to_lock; ptr && !td; ptr= ptr->next_global)
+ if (ptr->table == tbl)
+ td= &((RPL_TABLE_LIST *)ptr)->m_tabledef;
+ return (td);
+ }
+
/*
Last charset (6 bytes) seen by slave SQL thread is cached here; it helps
the thread save 3 get_charset() per Query_log_event if the charset is not
@@ -385,11 +392,11 @@ typedef struct st_relay_log_info
private:
uint32 m_flags;
-} RELAY_LOG_INFO;
+};
// Defined in rpl_rli.cc
-int init_relay_log_info(RELAY_LOG_INFO* rli, const char* info_fname);
+int init_relay_log_info(Relay_log_info* rli, const char* info_fname);
#endif /* RPL_RLI_H */
diff --git a/sql/rpl_tblmap.cc b/sql/rpl_tblmap.cc
index 7df4bcbdde7..6c8b494dfa9 100644
--- a/sql/rpl_tblmap.cc
+++ b/sql/rpl_tblmap.cc
@@ -104,11 +104,11 @@ int table_mapping::set_table(ulong table_id, TABLE* table)
m_free= m_free->next;
}
else
- hash_delete(&m_table_ids,(byte *)e);
+ hash_delete(&m_table_ids,(uchar *)e);
e->table_id= table_id;
e->table= table;
- my_hash_insert(&m_table_ids,(byte *)e);
+ my_hash_insert(&m_table_ids,(uchar *)e);
DBUG_PRINT("info", ("tid %lu -> table 0x%lx (%s)",
table_id, (long) e->table,
@@ -121,7 +121,7 @@ int table_mapping::remove_table(ulong table_id)
entry *e= find_entry(table_id);
if (e)
{
- hash_delete(&m_table_ids,(byte *)e);
+ 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;
diff --git a/sql/rpl_tblmap.h b/sql/rpl_tblmap.h
index dbc968d0f67..446833d5ed6 100644
--- a/sql/rpl_tblmap.h
+++ b/sql/rpl_tblmap.h
@@ -85,7 +85,7 @@ private:
entry *find_entry(ulong table_id)
{
return (entry *)hash_search(&m_table_ids,
- (byte*)&table_id,
+ (uchar*)&table_id,
sizeof(table_id));
}
int expand();
diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc
index 1d7cc808f0c..d1ce5bf3b7b 100644
--- a/sql/rpl_utility.cc
+++ b/sql/rpl_utility.cc
@@ -14,18 +14,51 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "rpl_utility.h"
+#include "rpl_rli.h"
-uint32
-field_length_from_packed(enum_field_types const field_type,
- byte const *const data)
+/*********************************************************************
+ * table_def member definitions *
+ *********************************************************************/
+
+/*
+ This function returns the field size in raw bytes based on the type
+ and the encoded field data from the master's raw data.
+*/
+uint32 table_def::calc_field_size(uint col, uchar *master_data) const
{
uint32 length;
- switch (field_type) {
- case MYSQL_TYPE_DECIMAL:
+ switch (type(col)) {
case MYSQL_TYPE_NEWDECIMAL:
- length= ~(uint32) 0;
+ length= my_decimal_get_binary_size(m_field_metadata[col] >> 8,
+ m_field_metadata[col] - ((m_field_metadata[col] >> 8) << 8));
+ break;
+ case MYSQL_TYPE_DECIMAL:
+ case MYSQL_TYPE_FLOAT:
+ case MYSQL_TYPE_DOUBLE:
+ length= m_field_metadata[col];
+ break;
+ case MYSQL_TYPE_SET:
+ case MYSQL_TYPE_ENUM:
+ case MYSQL_TYPE_STRING:
+ {
+ if (((m_field_metadata[col] & 0xff00) == (MYSQL_TYPE_SET << 8)) ||
+ ((m_field_metadata[col] & 0xff00) == (MYSQL_TYPE_ENUM << 8)))
+ length= m_field_metadata[col] & 0x00ff;
+ else
+ {
+ length= m_field_metadata[col] & 0x00ff;
+ DBUG_ASSERT(length > 0);
+ if (length > 255)
+ {
+ DBUG_ASSERT(uint2korr(master_data) > 0);
+ length= uint2korr(master_data) + 2;
+ }
+ else
+ length= (uint) *master_data + 1;
+ }
break;
+ }
case MYSQL_TYPE_YEAR:
case MYSQL_TYPE_TINY:
length= 1;
@@ -44,12 +77,6 @@ field_length_from_packed(enum_field_types const field_type,
length= 8;
break;
#endif
- case MYSQL_TYPE_FLOAT:
- length= sizeof(float);
- break;
- case MYSQL_TYPE_DOUBLE:
- length= sizeof(double);
- break;
case MYSQL_TYPE_NULL:
length= 0;
break;
@@ -57,8 +84,6 @@ field_length_from_packed(enum_field_types const field_type,
length= 3;
break;
case MYSQL_TYPE_DATE:
- length= 4;
- break;
case MYSQL_TYPE_TIME:
length= 3;
break;
@@ -68,47 +93,78 @@ field_length_from_packed(enum_field_types const field_type,
case MYSQL_TYPE_DATETIME:
length= 8;
break;
- break;
case MYSQL_TYPE_BIT:
- length= ~(uint32) 0;
- break;
- default:
- /* This case should never be chosen */
- DBUG_ASSERT(0);
- /* If something goes awfully wrong, it's better to get a string than die */
- case MYSQL_TYPE_STRING:
- length= uint2korr(data);
+ {
+ uint from_len= (m_field_metadata[col] >> 8U) & 0x00ff;
+ uint from_bit_len= m_field_metadata[col] & 0x00ff;
+ DBUG_ASSERT(from_bit_len <= 7);
+ length= from_len + ((from_bit_len > 0) ? 1 : 0);
break;
-
- case MYSQL_TYPE_ENUM:
- case MYSQL_TYPE_SET:
- case MYSQL_TYPE_VAR_STRING:
+ }
case MYSQL_TYPE_VARCHAR:
- length= ~(uint32) 0; // NYI
+ {
+ length= m_field_metadata[col] > 255 ? 2 : 1; // c&p of Field_varstring::data_length()
+ DBUG_ASSERT(uint2korr(master_data) > 0);
+ length+= length == 1 ? (uint32) *master_data : uint2korr(master_data);
break;
-
+ }
case MYSQL_TYPE_TINY_BLOB:
case MYSQL_TYPE_MEDIUM_BLOB:
case MYSQL_TYPE_LONG_BLOB:
case MYSQL_TYPE_BLOB:
case MYSQL_TYPE_GEOMETRY:
- length= ~(uint32) 0; // NYI
+ {
+#if 1
+ /*
+ BUG#29549:
+ This is currently broken for NDB, which is using big-endian
+ order when packing length of BLOB. Once they have decided how to
+ fix the issue, we can enable the code below to make sure to
+ always read the length in little-endian order.
+ */
+ Field_blob fb(m_field_metadata[col]);
+ length= fb.get_packed_size(master_data, TRUE);
+#else
+ /*
+ Compute the length of the data. We cannot use get_length() here
+ since it is dependent on the specific table (and also checks the
+ packlength using the internal 'table' pointer) and replication
+ is using a fixed format for storing data in the binlog.
+ */
+ switch (m_field_metadata[col]) {
+ case 1:
+ length= *master_data;
+ break;
+ case 2:
+ length= sint2korr(master_data);
+ break;
+ case 3:
+ length= uint3korr(master_data);
+ break;
+ case 4:
+ length= uint4korr(master_data);
+ break;
+ default:
+ DBUG_ASSERT(0); // Should not come here
+ break;
+ }
+
+ length+= m_field_metadata[col];
+#endif
break;
}
-
+ default:
+ length= -1;
+ }
return length;
}
-/*********************************************************************
- * table_def member definitions *
- *********************************************************************/
-
/*
Is the definition compatible with a table?
*/
int
-table_def::compatible_with(RELAY_LOG_INFO const *rli_arg, TABLE *table)
+table_def::compatible_with(Relay_log_info const *rli_arg, TABLE *table)
const
{
/*
@@ -116,25 +172,10 @@ table_def::compatible_with(RELAY_LOG_INFO const *rli_arg, TABLE *table)
*/
uint const cols_to_check= min(table->s->fields, size());
int error= 0;
- RELAY_LOG_INFO const *rli= const_cast<RELAY_LOG_INFO*>(rli_arg);
+ Relay_log_info const *rli= const_cast<Relay_log_info*>(rli_arg);
TABLE_SHARE const *const tsh= table->s;
- /*
- To get proper error reporting for all columns of the table, we
- both check the width and iterate over all columns.
- */
- if (tsh->fields < size())
- {
- DBUG_ASSERT(tsh->db.str && tsh->table_name.str);
- error= 1;
- slave_print_msg(ERROR_LEVEL, rli, ER_BINLOG_ROW_WRONG_TABLE_DEF,
- "Table width mismatch - "
- "received %u columns, %s.%s has %u columns",
- (uint) size(), tsh->db.str, tsh->table_name.str,
- tsh->fields);
- }
-
for (uint col= 0 ; col < cols_to_check ; ++col)
{
if (table->field[col]->type() != type(col))
@@ -142,11 +183,32 @@ table_def::compatible_with(RELAY_LOG_INFO const *rli_arg, TABLE *table)
DBUG_ASSERT(col < size() && col < tsh->fields);
DBUG_ASSERT(tsh->db.str && tsh->table_name.str);
error= 1;
- slave_print_msg(ERROR_LEVEL, rli, ER_BINLOG_ROW_WRONG_TABLE_DEF,
- "Column %d type mismatch - "
- "received type %d, %s.%s has type %d",
- col, type(col), tsh->db.str, tsh->table_name.str,
- table->field[col]->type());
+ char buf[256];
+ my_snprintf(buf, sizeof(buf), "Column %d type mismatch - "
+ "received type %d, %s.%s has type %d",
+ col, type(col), tsh->db.str, tsh->table_name.str,
+ table->field[col]->type());
+ rli->report(ERROR_LEVEL, ER_BINLOG_ROW_WRONG_TABLE_DEF,
+ ER(ER_BINLOG_ROW_WRONG_TABLE_DEF), buf);
+ }
+ /*
+ Check the slave's field size against that of the master.
+ */
+ if (!error &&
+ !table->field[col]->compatible_field_size(field_metadata(col)))
+ {
+ error= 1;
+ char buf[256];
+ my_snprintf(buf, sizeof(buf), "Column %d size mismatch - "
+ "master has size %d, %s.%s on slave has size %d."
+ " Master's column size should be <= the slave's "
+ "column size.", col,
+ table->field[col]->pack_length_from_metadata(
+ m_field_metadata[col]),
+ tsh->db.str, tsh->table_name.str,
+ table->field[col]->row_pack_length());
+ rli->report(ERROR_LEVEL, ER_BINLOG_ROW_WRONG_TABLE_DEF,
+ ER(ER_BINLOG_ROW_WRONG_TABLE_DEF), buf);
}
}
diff --git a/sql/rpl_utility.h b/sql/rpl_utility.h
index 17879a9ecfc..26edbdd1405 100644
--- a/sql/rpl_utility.h
+++ b/sql/rpl_utility.h
@@ -22,11 +22,8 @@
#include "mysql_priv.h"
-struct st_relay_log_info;
-typedef st_relay_log_info RELAY_LOG_INFO;
+class Relay_log_info;
-uint32
-field_length_from_packed(enum_field_types field_type, byte const *data);
/**
A table definition from the master.
@@ -57,19 +54,100 @@ public:
@param types Array of types
@param size Number of elements in array 'types'
+ @param field_metadata Array of extra information about fields
+ @param metadata_size Size of the field_metadata array
+ @param null_bitmap The bitmap of fields that can be null
*/
- table_def(field_type *types, my_size_t size)
- : m_type(new unsigned char [size]), m_size(size)
+ table_def(field_type *types, ulong size, uchar *field_metadata,
+ int metadata_size, uchar *null_bitmap)
+ : m_size(size), m_type(0), m_field_metadata_size(metadata_size),
+ m_field_metadata(0), m_null_bits(0), m_memory(NULL)
{
+ m_memory= (uchar *)my_multi_malloc(MYF(MY_WME),
+ &m_type, size,
+ &m_field_metadata,
+ size * sizeof(uint16),
+ &m_null_bits, (size + 7) / 8,
+ NULL);
+
+ bzero(m_field_metadata, size * sizeof(uint16));
+
if (m_type)
memcpy(m_type, types, size);
else
m_size= 0;
+ /*
+ Extract the data from the table map into the field metadata array
+ iff there is field metadata. The variable metadata_size will be
+ 0 if we are replicating from an older version server since no field
+ metadata was written to the table map. This can also happen if
+ there were no fields in the master that needed extra metadata.
+ */
+ if (m_size && metadata_size)
+ {
+ int index= 0;
+ for (unsigned int i= 0; i < m_size; i++)
+ {
+ switch (m_type[i]) {
+ case MYSQL_TYPE_TINY_BLOB:
+ case MYSQL_TYPE_BLOB:
+ case MYSQL_TYPE_MEDIUM_BLOB:
+ case MYSQL_TYPE_LONG_BLOB:
+ case MYSQL_TYPE_DOUBLE:
+ case MYSQL_TYPE_FLOAT:
+ {
+ /*
+ These types store a single byte.
+ */
+ m_field_metadata[i]= (uchar)field_metadata[index];
+ index++;
+ break;
+ }
+ case MYSQL_TYPE_SET:
+ case MYSQL_TYPE_ENUM:
+ case MYSQL_TYPE_STRING:
+ {
+ short int x= field_metadata[index++] << 8U; // real_type
+ x = x + field_metadata[index++]; // pack or field length
+ m_field_metadata[i]= x;
+ break;
+ }
+ case MYSQL_TYPE_BIT:
+ {
+ short int x= field_metadata[index++];
+ x = x + (field_metadata[index++] << 8U);
+ m_field_metadata[i]= x;
+ break;
+ }
+ case MYSQL_TYPE_VARCHAR:
+ {
+ /*
+ These types store two bytes.
+ */
+ char *ptr= (char *)&field_metadata[index];
+ m_field_metadata[i]= sint2korr(ptr);
+ index= index + 2;
+ break;
+ }
+ case MYSQL_TYPE_NEWDECIMAL:
+ {
+ short int x= field_metadata[index++] << 8U; // precision
+ x = x + field_metadata[index++]; // decimals
+ m_field_metadata[i]= x;
+ break;
+ }
+ default:
+ m_field_metadata[i]= 0;
+ break;
+ }
+ }
+ }
+ if (m_size && null_bitmap)
+ memcpy(m_null_bits, null_bitmap, (m_size + 7) / 8);
}
~table_def() {
- if (m_type)
- delete [] m_type;
+ my_free(m_memory, MYF(0));
#ifndef DBUG_OFF
m_type= 0;
m_size= 0;
@@ -81,7 +159,7 @@ public:
@return The number of fields that there is type data for.
*/
- my_size_t size() const { return m_size; }
+ ulong size() const { return m_size; }
/*
@@ -93,13 +171,54 @@ public:
<code>index</code>. Currently, only the type identifier is
returned.
*/
- field_type type(my_ptrdiff_t index) const
+ field_type type(ulong index) const
{
- DBUG_ASSERT(0 <= index);
- DBUG_ASSERT(static_cast<my_size_t>(index) < m_size);
+ DBUG_ASSERT(index < m_size);
return m_type[index];
}
+
+ /*
+ This function allows callers to get the extra field data from the
+ table map for a given field. If there is no metadata for that field
+ or there is no extra metadata at all, the function returns 0.
+
+ The function returns the value for the field metadata for column at
+ position indicated by index. As mentioned, if the field was a type
+ that stores field metadata, that value is returned else zero (0) is
+ returned. This method is used in the unpack() methods of the
+ corresponding fields to properly extract the data from the binary log
+ in the event that the master's field is smaller than the slave.
+ */
+ uint16 field_metadata(uint index) const
+ {
+ DBUG_ASSERT(index < m_size);
+ if (m_field_metadata_size)
+ return m_field_metadata[index];
+ else
+ return 0;
+ }
+
+ /*
+ This function returns whether the field on the master can be null.
+ This value is derived from field->maybe_null().
+ */
+ my_bool maybe_null(uint index) const
+ {
+ DBUG_ASSERT(index < m_size);
+ return ((m_null_bits[(index / 8)] &
+ (1 << (index % 8))) == (1 << (index %8)));
+ }
+
+ /*
+ This function returns the field size in raw bytes based on the type
+ and the encoded field data from the master's raw data. This method can
+ be used for situations where the slave needs to skip a column (e.g.,
+ WL#3915) or needs to advance the pointer for the fields in the raw
+ data from the master to a specific column.
+ */
+ uint32 calc_field_size(uint col, uchar *master_data) const;
+
/**
Decide if the table definition is compatible with a table.
@@ -117,11 +236,15 @@ public:
@retval 1 if the table definition is not compatible with @c table
@retval 0 if the table definition is compatible with @c table
*/
- int compatible_with(RELAY_LOG_INFO const *rli, TABLE *table) const;
+ int compatible_with(Relay_log_info const *rli, TABLE *table) const;
private:
- my_size_t m_size; // Number of elements in the types array
+ ulong m_size; // Number of elements in the types array
field_type *m_type; // Array of type descriptors
+ uint m_field_metadata_size;
+ uint16 *m_field_metadata;
+ uchar *m_null_bits;
+ uchar *m_memory;
};
/**
@@ -129,10 +252,50 @@ private:
slave thread, but nowhere else.
*/
struct RPL_TABLE_LIST
- : public st_table_list
+ : public TABLE_LIST
{
bool m_tabledef_valid;
table_def m_tabledef;
};
+
+/* Anonymous namespace for template functions/classes */
+namespace {
+
+ /*
+ Smart pointer that will automatically call my_afree (a macro) when
+ the pointer goes out of scope. This is used so that I do not have
+ to remember to call my_afree() before each return. There is no
+ overhead associated with this, since all functions are inline.
+
+ I (Matz) would prefer to use the free function as a template
+ parameter, but that is not possible when the "function" is a
+ macro.
+ */
+ template <class Obj>
+ class auto_afree_ptr
+ {
+ Obj* m_ptr;
+ public:
+ auto_afree_ptr(Obj* ptr) : m_ptr(ptr) { }
+ ~auto_afree_ptr() { if (m_ptr) my_afree(m_ptr); }
+ void assign(Obj* ptr) {
+ /* Only to be called if it hasn't been given a value before. */
+ DBUG_ASSERT(m_ptr == NULL);
+ m_ptr= ptr;
+ }
+ Obj* get() { return m_ptr; }
+ };
+
+}
+
+#define DBUG_PRINT_BITSET(N,FRM,BS) \
+ do { \
+ char buf[256]; \
+ for (uint i = 0 ; i < (BS)->n_bits ; ++i) \
+ buf[i] = bitmap_is_set((BS), i) ? '1' : '0'; \
+ buf[(BS)->n_bits] = '\0'; \
+ DBUG_PRINT((N), ((FRM), buf)); \
+ } while (0)
+
#endif /* RPL_UTILITY_H */
diff --git a/sql/set_var.cc b/sql/set_var.cc
index cc0c7374139..0f647e6aae6 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -27,8 +27,6 @@
of it in the my_option structure list in mysqld.cc
- Don't forget to initialize new fields in global_system_variables and
max_system_variables!
- - If the variable should show up in 'show variables' add it to the
- init_vars[] struct in this file
NOTES:
- Be careful with var->save_result: sys_var::check() only updates
@@ -59,52 +57,24 @@
#include "events.h"
-/* WITH_INNOBASE_STORAGE_ENGINE */
-extern uint innobase_flush_log_at_trx_commit;
-extern ulong innobase_fast_shutdown;
-extern long innobase_mirrored_log_groups, innobase_log_files_in_group;
-extern longlong innobase_log_file_size;
-extern long innobase_log_buffer_size;
-extern longlong innobase_buffer_pool_size;
-extern long innobase_additional_mem_pool_size;
-extern long innobase_file_io_threads, innobase_lock_wait_timeout;
-extern long innobase_force_recovery;
-extern long innobase_open_files;
-extern char *innobase_data_home_dir, *innobase_data_file_path;
-extern char *innobase_log_group_home_dir, *innobase_log_arch_dir;
-extern char *innobase_unix_file_flush_method;
-/* The following variables have to be my_bool for SHOW VARIABLES to work */
-extern my_bool innobase_log_archive,
- innobase_use_doublewrite,
- innobase_use_checksums,
- innobase_file_per_table,
- innobase_locks_unsafe_for_binlog,
- innobase_rollback_on_timeout,
- innobase_stats_on_metadata;
-
-extern "C" {
-extern ulong srv_max_buf_pool_modified_pct;
-extern ulong srv_max_purge_lag;
-extern ulong srv_auto_extend_increment;
-extern ulong srv_n_spin_wait_rounds;
-extern ulong srv_n_free_tickets_to_enter;
-extern ulong srv_thread_sleep_delay;
-extern ulong srv_thread_concurrency;
-extern ulong srv_commit_concurrency;
-extern ulong srv_flush_log_at_trx_commit;
-}
-
/* WITH_NDBCLUSTER_STORAGE_ENGINE */
+#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
extern ulong ndb_cache_check_time;
+extern char opt_ndb_constrbuf[];
extern ulong ndb_extra_logging;
+#endif
+
#ifdef HAVE_NDB_BINLOG
extern ulong ndb_report_thresh_binlog_epoch_slip;
extern ulong ndb_report_thresh_binlog_mem_usage;
#endif
+extern CHARSET_INFO *character_set_filesystem;
+static DYNAMIC_ARRAY fixed_show_vars;
static HASH system_variable_hash;
+
const char *bool_type_names[]= { "OFF", "ON", NullS };
TYPELIB bool_typelib=
{
@@ -152,9 +122,9 @@ static void fix_trans_mem_root(THD *thd, enum_var_type type);
static void fix_server_id(THD *thd, enum_var_type type);
static KEY_CACHE *create_key_cache(const char *name, uint length);
void fix_sql_mode_var(THD *thd, enum_var_type type);
-static byte *get_error_count(THD *thd);
-static byte *get_warning_count(THD *thd);
-static byte *get_tmpdir(THD *thd);
+static uchar *get_error_count(THD *thd);
+static uchar *get_warning_count(THD *thd);
+static uchar *get_tmpdir(THD *thd);
static int sys_check_log_path(THD *thd, set_var *var);
static bool sys_update_general_log_path(THD *thd, set_var * var);
static void sys_default_general_log_path(THD *thd, enum_var_type type);
@@ -171,461 +141,444 @@ static void sys_default_slow_log_path(THD *thd, enum_var_type type);
it in the constructor (see sys_var class for details).
*/
-sys_var *sys_var::first= NULL;
-uint sys_var::sys_vars= 0;
+static sys_var_chain vars = { NULL, NULL };
-sys_var_thd_ulong sys_auto_increment_increment("auto_increment_increment",
+static sys_var_thd_ulong sys_auto_increment_increment(&vars, "auto_increment_increment",
&SV::auto_increment_increment);
-sys_var_thd_ulong sys_auto_increment_offset("auto_increment_offset",
+static sys_var_thd_ulong sys_auto_increment_offset(&vars, "auto_increment_offset",
&SV::auto_increment_offset);
-sys_var_bool_ptr sys_automatic_sp_privileges("automatic_sp_privileges",
+static sys_var_bool_ptr sys_automatic_sp_privileges(&vars, "automatic_sp_privileges",
&sp_automatic_privileges);
-sys_var_const_str sys_basedir("basedir", mysql_home);
-sys_var_long_ptr sys_binlog_cache_size("binlog_cache_size",
+static sys_var_const_str sys_basedir(&vars, "basedir", mysql_home);
+static sys_var_long_ptr sys_binlog_cache_size(&vars, "binlog_cache_size",
&binlog_cache_size);
-sys_var_thd_binlog_format sys_binlog_format("binlog_format",
+static sys_var_thd_binlog_format sys_binlog_format(&vars, "binlog_format",
&SV::binlog_format);
-sys_var_thd_ulong sys_bulk_insert_buff_size("bulk_insert_buffer_size",
+static sys_var_thd_ulong sys_bulk_insert_buff_size(&vars, "bulk_insert_buffer_size",
&SV::bulk_insert_buff_size);
-sys_var_character_set_server sys_character_set_server("character_set_server");
-sys_var_const_str sys_charset_system("character_set_system",
+static sys_var_character_set_sv sys_character_set_server(&vars, "character_set_server",
+ &SV::collation_server,
+ &default_charset_info);
+sys_var_const_str sys_charset_system(&vars, "character_set_system",
(char *)my_charset_utf8_general_ci.name);
-sys_var_character_set_database sys_character_set_database("character_set_database");
-sys_var_character_set_client sys_character_set_client("character_set_client");
-sys_var_character_set_connection sys_character_set_connection("character_set_connection");
-sys_var_character_set_results sys_character_set_results("character_set_results");
-sys_var_character_set_filesystem sys_character_set_filesystem("character_set_filesystem");
-sys_var_thd_ulong sys_completion_type("completion_type",
+static sys_var_character_set_database sys_character_set_database(&vars, "character_set_database");
+static sys_var_character_set_sv sys_character_set_client(&vars, "character_set_client",
+ &SV::character_set_client,
+ &default_charset_info);
+static sys_var_character_set_sv sys_character_set_connection(&vars, "character_set_connection",
+ &SV::collation_connection,
+ &default_charset_info);
+static sys_var_character_set_sv sys_character_set_results(&vars, "character_set_results",
+ &SV::character_set_results,
+ &default_charset_info, true);
+static sys_var_character_set_sv sys_character_set_filesystem(&vars, "character_set_filesystem",
+ &SV::character_set_filesystem,
+ &character_set_filesystem);
+static sys_var_thd_ulong sys_completion_type(&vars, "completion_type",
&SV::completion_type,
check_completion_type,
fix_completion_type);
-sys_var_collation_connection sys_collation_connection("collation_connection");
-sys_var_collation_database sys_collation_database("collation_database");
-sys_var_collation_server sys_collation_server("collation_server");
-sys_var_long_ptr sys_concurrent_insert("concurrent_insert",
+static sys_var_collation_sv sys_collation_connection(&vars, "collation_connection",
+ &SV::collation_connection,
+ &default_charset_info);
+static sys_var_collation_sv sys_collation_database(&vars, "collation_database",
+ &SV::collation_database,
+ &default_charset_info);
+static sys_var_collation_sv sys_collation_server(&vars, "collation_server",
+ &SV::collation_server,
+ &default_charset_info);
+static sys_var_long_ptr sys_concurrent_insert(&vars, "concurrent_insert",
&myisam_concurrent_insert);
-sys_var_long_ptr sys_connect_timeout("connect_timeout",
+static sys_var_long_ptr sys_connect_timeout(&vars, "connect_timeout",
&connect_timeout);
-sys_var_const_str sys_datadir("datadir", mysql_real_data_home);
+static sys_var_const_str sys_datadir(&vars, "datadir", mysql_real_data_home);
#ifndef DBUG_OFF
-sys_var_thd_dbug sys_dbug("debug");
+static sys_var_thd_dbug sys_dbug(&vars, "debug");
#endif
-sys_var_enum sys_delay_key_write("delay_key_write",
+static sys_var_enum sys_delay_key_write(&vars, "delay_key_write",
&delay_key_write_options,
&delay_key_write_typelib,
fix_delay_key_write);
-sys_var_long_ptr sys_delayed_insert_limit("delayed_insert_limit",
+static sys_var_long_ptr sys_delayed_insert_limit(&vars, "delayed_insert_limit",
&delayed_insert_limit);
-sys_var_long_ptr sys_delayed_insert_timeout("delayed_insert_timeout",
+static sys_var_long_ptr sys_delayed_insert_timeout(&vars, "delayed_insert_timeout",
&delayed_insert_timeout);
-sys_var_long_ptr sys_delayed_queue_size("delayed_queue_size",
+static sys_var_long_ptr sys_delayed_queue_size(&vars, "delayed_queue_size",
&delayed_queue_size);
-sys_var_event_scheduler sys_event_scheduler("event_scheduler");
-sys_var_long_ptr sys_expire_logs_days("expire_logs_days",
+static sys_var_event_scheduler sys_event_scheduler(&vars, "event_scheduler");
+static sys_var_long_ptr sys_expire_logs_days(&vars, "expire_logs_days",
&expire_logs_days);
-sys_var_bool_ptr sys_flush("flush", &myisam_flush);
-sys_var_long_ptr sys_flush_time("flush_time", &flush_time);
-sys_var_str sys_ft_boolean_syntax("ft_boolean_syntax",
+static sys_var_bool_ptr sys_flush(&vars, "flush", &myisam_flush);
+static sys_var_long_ptr sys_flush_time(&vars, "flush_time", &flush_time);
+static sys_var_str sys_ft_boolean_syntax(&vars, "ft_boolean_syntax",
sys_check_ftb_syntax,
sys_update_ftb_syntax,
sys_default_ftb_syntax,
ft_boolean_syntax);
-sys_var_str sys_init_connect("init_connect", 0,
+sys_var_str sys_init_connect(&vars, "init_connect", 0,
sys_update_init_connect,
sys_default_init_connect,0);
-sys_var_str sys_init_slave("init_slave", 0,
+sys_var_str sys_init_slave(&vars, "init_slave", 0,
sys_update_init_slave,
sys_default_init_slave,0);
-sys_var_thd_ulong sys_interactive_timeout("interactive_timeout",
+static sys_var_thd_ulong sys_interactive_timeout(&vars, "interactive_timeout",
&SV::net_interactive_timeout);
-sys_var_thd_ulong sys_join_buffer_size("join_buffer_size",
+static sys_var_thd_ulong sys_join_buffer_size(&vars, "join_buffer_size",
&SV::join_buff_size);
-sys_var_key_buffer_size sys_key_buffer_size("key_buffer_size");
-sys_var_key_cache_long sys_key_cache_block_size("key_cache_block_size",
+static sys_var_key_buffer_size sys_key_buffer_size(&vars, "key_buffer_size");
+static sys_var_key_cache_long sys_key_cache_block_size(&vars, "key_cache_block_size",
offsetof(KEY_CACHE,
param_block_size));
-sys_var_key_cache_long sys_key_cache_division_limit("key_cache_division_limit",
+static sys_var_key_cache_long sys_key_cache_division_limit(&vars, "key_cache_division_limit",
offsetof(KEY_CACHE,
param_division_limit));
-sys_var_key_cache_long sys_key_cache_age_threshold("key_cache_age_threshold",
+static sys_var_key_cache_long sys_key_cache_age_threshold(&vars, "key_cache_age_threshold",
offsetof(KEY_CACHE,
param_age_threshold));
-sys_var_bool_ptr sys_local_infile("local_infile",
+static sys_var_bool_ptr sys_local_infile(&vars, "local_infile",
&opt_local_infile);
-sys_var_trust_routine_creators
-sys_trust_routine_creators("log_bin_trust_routine_creators",
+static sys_var_trust_routine_creators
+sys_trust_routine_creators(&vars, "log_bin_trust_routine_creators",
&trust_function_creators);
-sys_var_bool_ptr
-sys_trust_function_creators("log_bin_trust_function_creators",
+static sys_var_bool_ptr
+sys_trust_function_creators(&vars, "log_bin_trust_function_creators",
&trust_function_creators);
-sys_var_bool_ptr
- sys_log_queries_not_using_indexes("log_queries_not_using_indexes",
+static sys_var_bool_ptr
+ sys_log_queries_not_using_indexes(&vars, "log_queries_not_using_indexes",
&opt_log_queries_not_using_indexes);
-sys_var_thd_ulong sys_log_warnings("log_warnings", &SV::log_warnings);
-sys_var_thd_ulong sys_long_query_time("long_query_time",
- &SV::long_query_time);
-sys_var_thd_bool sys_low_priority_updates("low_priority_updates",
+static sys_var_thd_ulong sys_log_warnings(&vars, "log_warnings", &SV::log_warnings);
+static sys_var_microseconds sys_var_long_query_time(&vars, "long_query_time",
+ &SV::long_query_time);
+static sys_var_thd_bool sys_low_priority_updates(&vars, "low_priority_updates",
&SV::low_priority_updates,
fix_low_priority_updates);
#ifndef TO_BE_DELETED /* Alias for the low_priority_updates */
-sys_var_thd_bool sys_sql_low_priority_updates("sql_low_priority_updates",
+static sys_var_thd_bool sys_sql_low_priority_updates(&vars, "sql_low_priority_updates",
&SV::low_priority_updates,
fix_low_priority_updates);
#endif
-sys_var_thd_ulong sys_max_allowed_packet("max_allowed_packet",
+static sys_var_thd_ulong sys_max_allowed_packet(&vars, "max_allowed_packet",
&SV::max_allowed_packet);
-sys_var_long_ptr sys_max_binlog_cache_size("max_binlog_cache_size",
+static sys_var_long_ptr sys_max_binlog_cache_size(&vars, "max_binlog_cache_size",
&max_binlog_cache_size);
-sys_var_long_ptr sys_max_binlog_size("max_binlog_size",
+static sys_var_long_ptr sys_max_binlog_size(&vars, "max_binlog_size",
&max_binlog_size,
fix_max_binlog_size);
-sys_var_long_ptr sys_max_connections("max_connections",
+static sys_var_long_ptr sys_max_connections(&vars, "max_connections",
&max_connections,
fix_max_connections);
-sys_var_long_ptr sys_max_connect_errors("max_connect_errors",
+static sys_var_long_ptr sys_max_connect_errors(&vars, "max_connect_errors",
&max_connect_errors);
-sys_var_thd_ulong sys_max_insert_delayed_threads("max_insert_delayed_threads",
+static sys_var_thd_ulong sys_max_insert_delayed_threads(&vars, "max_insert_delayed_threads",
&SV::max_insert_delayed_threads,
check_max_delayed_threads,
fix_max_connections);
-sys_var_thd_ulong sys_max_delayed_threads("max_delayed_threads",
+static sys_var_thd_ulong sys_max_delayed_threads(&vars, "max_delayed_threads",
&SV::max_insert_delayed_threads,
check_max_delayed_threads,
fix_max_connections);
-sys_var_thd_ulong sys_max_error_count("max_error_count",
+static sys_var_thd_ulong sys_max_error_count(&vars, "max_error_count",
&SV::max_error_count);
-sys_var_thd_ulonglong sys_max_heap_table_size("max_heap_table_size",
+static sys_var_thd_ulonglong sys_max_heap_table_size(&vars, "max_heap_table_size",
&SV::max_heap_table_size);
-sys_var_thd_ulong sys_pseudo_thread_id("pseudo_thread_id",
+static sys_var_thd_ulong sys_pseudo_thread_id(&vars, "pseudo_thread_id",
&SV::pseudo_thread_id,
check_pseudo_thread_id, 0);
-sys_var_thd_ha_rows sys_max_join_size("max_join_size",
+static sys_var_thd_ha_rows sys_max_join_size(&vars, "max_join_size",
&SV::max_join_size,
fix_max_join_size);
-sys_var_thd_ulong sys_max_seeks_for_key("max_seeks_for_key",
+static sys_var_thd_ulong sys_max_seeks_for_key(&vars, "max_seeks_for_key",
&SV::max_seeks_for_key);
-sys_var_thd_ulong sys_max_length_for_sort_data("max_length_for_sort_data",
+static sys_var_thd_ulong sys_max_length_for_sort_data(&vars, "max_length_for_sort_data",
&SV::max_length_for_sort_data);
#ifndef TO_BE_DELETED /* Alias for max_join_size */
-sys_var_thd_ha_rows sys_sql_max_join_size("sql_max_join_size",
+static sys_var_thd_ha_rows sys_sql_max_join_size(&vars, "sql_max_join_size",
&SV::max_join_size,
fix_max_join_size);
#endif
static sys_var_long_ptr_global
-sys_max_prepared_stmt_count("max_prepared_stmt_count",
+sys_max_prepared_stmt_count(&vars, "max_prepared_stmt_count",
&max_prepared_stmt_count,
&LOCK_prepared_stmt_count);
-sys_var_long_ptr sys_max_relay_log_size("max_relay_log_size",
+static sys_var_long_ptr sys_max_relay_log_size(&vars, "max_relay_log_size",
&max_relay_log_size,
fix_max_relay_log_size);
-sys_var_thd_ulong sys_max_sort_length("max_sort_length",
+static sys_var_thd_ulong sys_max_sort_length(&vars, "max_sort_length",
&SV::max_sort_length);
-sys_var_thd_ulong sys_max_sp_recursion_depth("max_sp_recursion_depth",
+static sys_var_thd_ulong sys_max_sp_recursion_depth(&vars, "max_sp_recursion_depth",
&SV::max_sp_recursion_depth);
-sys_var_max_user_conn sys_max_user_connections("max_user_connections");
-sys_var_thd_ulong sys_max_tmp_tables("max_tmp_tables",
+static sys_var_max_user_conn sys_max_user_connections(&vars, "max_user_connections");
+static sys_var_thd_ulong sys_max_tmp_tables(&vars, "max_tmp_tables",
&SV::max_tmp_tables);
-sys_var_long_ptr sys_max_write_lock_count("max_write_lock_count",
+static sys_var_long_ptr sys_max_write_lock_count(&vars, "max_write_lock_count",
&max_write_lock_count);
-sys_var_thd_ulong sys_multi_range_count("multi_range_count",
+static sys_var_thd_ulong sys_min_examined_row_limit(&vars, "min_examined_row_limit",
+ &SV::min_examined_row_limit);
+static sys_var_thd_ulong sys_multi_range_count(&vars, "multi_range_count",
&SV::multi_range_count);
-sys_var_long_ptr sys_myisam_data_pointer_size("myisam_data_pointer_size",
+static sys_var_long_ptr sys_myisam_data_pointer_size(&vars, "myisam_data_pointer_size",
&myisam_data_pointer_size);
-sys_var_thd_ulonglong sys_myisam_max_sort_file_size("myisam_max_sort_file_size", &SV::myisam_max_sort_file_size, fix_myisam_max_sort_file_size, 1);
-sys_var_thd_ulong sys_myisam_repair_threads("myisam_repair_threads", &SV::myisam_repair_threads);
-sys_var_thd_ulong sys_myisam_sort_buffer_size("myisam_sort_buffer_size", &SV::myisam_sort_buff_size);
-sys_var_bool_ptr sys_myisam_use_mmap("myisam_use_mmap",
+static sys_var_thd_ulonglong sys_myisam_max_sort_file_size(&vars, "myisam_max_sort_file_size", &SV::myisam_max_sort_file_size, fix_myisam_max_sort_file_size, 1);
+static sys_var_thd_ulong sys_myisam_repair_threads(&vars, "myisam_repair_threads", &SV::myisam_repair_threads);
+static sys_var_thd_ulong sys_myisam_sort_buffer_size(&vars, "myisam_sort_buffer_size", &SV::myisam_sort_buff_size);
+static sys_var_bool_ptr sys_myisam_use_mmap(&vars, "myisam_use_mmap",
&opt_myisam_use_mmap);
-sys_var_thd_enum sys_myisam_stats_method("myisam_stats_method",
+static sys_var_thd_enum sys_myisam_stats_method(&vars, "myisam_stats_method",
&SV::myisam_stats_method,
&myisam_stats_method_typelib,
NULL);
-sys_var_thd_ulong sys_net_buffer_length("net_buffer_length",
+static sys_var_thd_ulong sys_net_buffer_length(&vars, "net_buffer_length",
&SV::net_buffer_length);
-sys_var_thd_ulong sys_net_read_timeout("net_read_timeout",
+static sys_var_thd_ulong sys_net_read_timeout(&vars, "net_read_timeout",
&SV::net_read_timeout,
0, fix_net_read_timeout);
-sys_var_thd_ulong sys_net_write_timeout("net_write_timeout",
+static sys_var_thd_ulong sys_net_write_timeout(&vars, "net_write_timeout",
&SV::net_write_timeout,
0, fix_net_write_timeout);
-sys_var_thd_ulong sys_net_retry_count("net_retry_count",
+static sys_var_thd_ulong sys_net_retry_count(&vars, "net_retry_count",
&SV::net_retry_count,
0, fix_net_retry_count);
-sys_var_thd_bool sys_new_mode("new", &SV::new_mode);
-sys_var_bool_ptr_readonly sys_old_mode("old",
+static sys_var_thd_bool sys_new_mode(&vars, "new", &SV::new_mode);
+static sys_var_bool_ptr_readonly sys_old_mode(&vars, "old",
&global_system_variables.old_mode);
-sys_var_thd_bool sys_old_alter_table("old_alter_table",
- &SV::old_alter_table);
-sys_var_thd_bool sys_old_passwords("old_passwords", &SV::old_passwords);
-sys_var_thd_ulong sys_optimizer_prune_level("optimizer_prune_level",
+/* these two cannot be static */
+sys_var_thd_bool sys_old_alter_table(&vars, "old_alter_table",
+ &SV::old_alter_table);
+sys_var_thd_bool sys_old_passwords(&vars, "old_passwords", &SV::old_passwords);
+static sys_var_thd_ulong sys_optimizer_prune_level(&vars, "optimizer_prune_level",
&SV::optimizer_prune_level);
-sys_var_thd_ulong sys_optimizer_search_depth("optimizer_search_depth",
+static sys_var_thd_ulong sys_optimizer_search_depth(&vars, "optimizer_search_depth",
&SV::optimizer_search_depth);
-sys_var_thd_ulong sys_preload_buff_size("preload_buffer_size",
+static sys_var_thd_ulong sys_preload_buff_size(&vars, "preload_buffer_size",
&SV::preload_buff_size);
-sys_var_thd_ulong sys_read_buff_size("read_buffer_size",
+static sys_var_thd_ulong sys_read_buff_size(&vars, "read_buffer_size",
&SV::read_buff_size);
-sys_var_opt_readonly sys_readonly("read_only", &opt_readonly);
-sys_var_thd_ulong sys_read_rnd_buff_size("read_rnd_buffer_size",
+static sys_var_opt_readonly sys_readonly(&vars, "read_only", &opt_readonly);
+static sys_var_thd_ulong sys_read_rnd_buff_size(&vars, "read_rnd_buffer_size",
&SV::read_rnd_buff_size);
-sys_var_thd_ulong sys_div_precincrement("div_precision_increment",
+static sys_var_thd_ulong sys_div_precincrement(&vars, "div_precision_increment",
&SV::div_precincrement);
-#ifdef HAVE_REPLICATION
-sys_var_bool_ptr sys_relay_log_purge("relay_log_purge",
- &relay_log_purge);
-#endif
-sys_var_long_ptr sys_rpl_recovery_rank("rpl_recovery_rank",
+static sys_var_long_ptr sys_rpl_recovery_rank(&vars, "rpl_recovery_rank",
&rpl_recovery_rank);
-sys_var_long_ptr sys_query_cache_size("query_cache_size",
+static sys_var_long_ptr sys_query_cache_size(&vars, "query_cache_size",
&query_cache_size,
fix_query_cache_size);
-sys_var_thd_ulong sys_range_alloc_block_size("range_alloc_block_size",
+static sys_var_thd_ulong sys_range_alloc_block_size(&vars, "range_alloc_block_size",
&SV::range_alloc_block_size);
-sys_var_thd_ulong sys_query_alloc_block_size("query_alloc_block_size",
+static sys_var_thd_ulong sys_query_alloc_block_size(&vars, "query_alloc_block_size",
&SV::query_alloc_block_size,
0, fix_thd_mem_root);
-sys_var_thd_ulong sys_query_prealloc_size("query_prealloc_size",
+static sys_var_thd_ulong sys_query_prealloc_size(&vars, "query_prealloc_size",
&SV::query_prealloc_size,
0, fix_thd_mem_root);
-sys_var_readonly sys_tmpdir("tmpdir", OPT_GLOBAL, SHOW_CHAR, get_tmpdir);
-sys_var_thd_ulong sys_trans_alloc_block_size("transaction_alloc_block_size",
+static sys_var_readonly sys_tmpdir(&vars, "tmpdir", OPT_GLOBAL, SHOW_CHAR, get_tmpdir);
+static sys_var_thd_ulong sys_trans_alloc_block_size(&vars, "transaction_alloc_block_size",
&SV::trans_alloc_block_size,
0, fix_trans_mem_root);
-sys_var_thd_ulong sys_trans_prealloc_size("transaction_prealloc_size",
+static sys_var_thd_ulong sys_trans_prealloc_size(&vars, "transaction_prealloc_size",
&SV::trans_prealloc_size,
0, fix_trans_mem_root);
-sys_var_thd_enum sys_thread_handling("thread_handling",
+sys_var_thd_enum sys_thread_handling(&vars, "thread_handling",
&SV::thread_handling,
&thread_handling_typelib,
NULL);
#ifdef HAVE_QUERY_CACHE
-sys_var_long_ptr sys_query_cache_limit("query_cache_limit",
+static sys_var_long_ptr sys_query_cache_limit(&vars, "query_cache_limit",
&query_cache.query_cache_limit);
-sys_var_long_ptr sys_query_cache_min_res_unit("query_cache_min_res_unit",
+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);
-sys_var_thd_enum sys_query_cache_type("query_cache_type",
+static sys_var_thd_enum sys_query_cache_type(&vars, "query_cache_type",
&SV::query_cache_type,
&query_cache_type_typelib);
-sys_var_thd_bool
-sys_query_cache_wlock_invalidate("query_cache_wlock_invalidate",
+static sys_var_thd_bool
+sys_query_cache_wlock_invalidate(&vars, "query_cache_wlock_invalidate",
&SV::query_cache_wlock_invalidate);
#endif /* HAVE_QUERY_CACHE */
-sys_var_bool_ptr sys_secure_auth("secure_auth", &opt_secure_auth);
-sys_var_const_str_ptr sys_secure_file_priv("secure_file_priv",
+static sys_var_bool_ptr sys_secure_auth(&vars, "secure_auth", &opt_secure_auth);
+static sys_var_const_str_ptr sys_secure_file_priv(&vars, "secure_file_priv",
&opt_secure_file_priv);
-sys_var_long_ptr sys_server_id("server_id", &server_id, fix_server_id);
-sys_var_bool_ptr sys_slave_compressed_protocol("slave_compressed_protocol",
+static sys_var_long_ptr sys_server_id(&vars, "server_id", &server_id, fix_server_id);
+static sys_var_bool_ptr sys_slave_compressed_protocol(&vars, "slave_compressed_protocol",
&opt_slave_compressed_protocol);
-#ifdef HAVE_REPLICATION
-sys_var_long_ptr sys_slave_net_timeout("slave_net_timeout",
- &slave_net_timeout);
-sys_var_long_ptr sys_slave_trans_retries("slave_transaction_retries",
- &slave_trans_retries);
-#endif
-sys_var_long_ptr sys_slow_launch_time("slow_launch_time",
+static sys_var_long_ptr sys_slow_launch_time(&vars, "slow_launch_time",
&slow_launch_time);
-sys_var_thd_ulong sys_sort_buffer("sort_buffer_size",
+static sys_var_thd_ulong sys_sort_buffer(&vars, "sort_buffer_size",
&SV::sortbuff_size);
-sys_var_thd_sql_mode sys_sql_mode("sql_mode",
+static sys_var_thd_sql_mode sys_sql_mode(&vars, "sql_mode",
&SV::sql_mode);
#ifdef HAVE_OPENSSL
extern char *opt_ssl_ca, *opt_ssl_capath, *opt_ssl_cert, *opt_ssl_cipher,
*opt_ssl_key;
-sys_var_const_str_ptr sys_ssl_ca("ssl_ca", &opt_ssl_ca);
-sys_var_const_str_ptr sys_ssl_capath("ssl_capath", &opt_ssl_capath);
-sys_var_const_str_ptr sys_ssl_cert("ssl_cert", &opt_ssl_cert);
-sys_var_const_str_ptr sys_ssl_cipher("ssl_cipher", &opt_ssl_cipher);
-sys_var_const_str_ptr sys_ssl_key("ssl_key", &opt_ssl_key);
+static sys_var_const_str_ptr sys_ssl_ca(&vars, "ssl_ca", &opt_ssl_ca);
+static sys_var_const_str_ptr sys_ssl_capath(&vars, "ssl_capath", &opt_ssl_capath);
+static sys_var_const_str_ptr sys_ssl_cert(&vars, "ssl_cert", &opt_ssl_cert);
+static sys_var_const_str_ptr sys_ssl_cipher(&vars, "ssl_cipher", &opt_ssl_cipher);
+static sys_var_const_str_ptr sys_ssl_key(&vars, "ssl_key", &opt_ssl_key);
#else
-sys_var_const_str sys_ssl_ca("ssl_ca", NULL);
-sys_var_const_str sys_ssl_capath("ssl_capath", NULL);
-sys_var_const_str sys_ssl_cert("ssl_cert", NULL);
-sys_var_const_str sys_ssl_cipher("ssl_cipher", NULL);
-sys_var_const_str sys_ssl_key("ssl_key", NULL);
+static sys_var_const_str sys_ssl_ca(&vars, "ssl_ca", NULL);
+static sys_var_const_str sys_ssl_capath(&vars, "ssl_capath", NULL);
+static sys_var_const_str sys_ssl_cert(&vars, "ssl_cert", NULL);
+static sys_var_const_str sys_ssl_cipher(&vars, "ssl_cipher", NULL);
+static sys_var_const_str sys_ssl_key(&vars, "ssl_key", NULL);
#endif
-sys_var_thd_enum
-sys_updatable_views_with_limit("updatable_views_with_limit",
+static sys_var_thd_enum
+sys_updatable_views_with_limit(&vars, "updatable_views_with_limit",
&SV::updatable_views_with_limit,
&updatable_views_with_limit_typelib);
-sys_var_thd_table_type sys_table_type("table_type",
- &SV::table_type);
-sys_var_thd_storage_engine sys_storage_engine("storage_engine",
- &SV::table_type);
-#ifdef HAVE_REPLICATION
-sys_var_sync_binlog_period sys_sync_binlog_period("sync_binlog", &sync_binlog_period);
-#endif
-sys_var_bool_ptr sys_sync_frm("sync_frm", &opt_sync_frm);
-sys_var_const_str sys_system_time_zone("system_time_zone",
+static sys_var_thd_table_type sys_table_type(&vars, "table_type",
+ &SV::table_plugin);
+static sys_var_thd_storage_engine sys_storage_engine(&vars, "storage_engine",
+ &SV::table_plugin);
+static sys_var_bool_ptr sys_sync_frm(&vars, "sync_frm", &opt_sync_frm);
+static sys_var_const_str sys_system_time_zone(&vars, "system_time_zone",
system_time_zone);
-sys_var_long_ptr sys_table_def_size("table_definition_cache",
+static sys_var_long_ptr sys_table_def_size(&vars, "table_definition_cache",
&table_def_size);
-sys_var_long_ptr sys_table_cache_size("table_open_cache",
+static sys_var_long_ptr sys_table_cache_size(&vars, "table_open_cache",
&table_cache_size);
-sys_var_long_ptr sys_table_lock_wait_timeout("table_lock_wait_timeout",
+static sys_var_long_ptr sys_table_lock_wait_timeout(&vars, "table_lock_wait_timeout",
&table_lock_wait_timeout);
-sys_var_long_ptr sys_thread_cache_size("thread_cache_size",
+static sys_var_long_ptr sys_thread_cache_size(&vars, "thread_cache_size",
&thread_cache_size);
#if HAVE_POOL_OF_THREADS == 1
-sys_var_long_ptr sys_thread_pool_size("thread_pool_size",
+sys_var_long_ptr sys_thread_pool_size(&vars, "thread_pool_size",
&thread_pool_size);
#endif
-sys_var_thd_enum sys_tx_isolation("tx_isolation",
+static sys_var_thd_enum sys_tx_isolation(&vars, "tx_isolation",
&SV::tx_isolation,
&tx_isolation_typelib,
fix_tx_isolation,
check_tx_isolation);
-sys_var_thd_ulonglong sys_tmp_table_size("tmp_table_size",
+static sys_var_thd_ulonglong sys_tmp_table_size(&vars, "tmp_table_size",
&SV::tmp_table_size);
-sys_var_bool_ptr sys_timed_mutexes("timed_mutexes",
+static sys_var_bool_ptr sys_timed_mutexes(&vars, "timed_mutexes",
&timed_mutexes);
-sys_var_const_str sys_version("version", server_version);
-sys_var_const_str sys_version_comment("version_comment",
+static sys_var_const_str sys_version(&vars, "version", server_version);
+static sys_var_const_str sys_version_comment(&vars, "version_comment",
MYSQL_COMPILATION_COMMENT);
-sys_var_const_str sys_version_compile_machine("version_compile_machine",
+static sys_var_const_str sys_version_compile_machine(&vars, "version_compile_machine",
MACHINE_TYPE);
-sys_var_const_str sys_version_compile_os("version_compile_os",
+static sys_var_const_str sys_version_compile_os(&vars, "version_compile_os",
SYSTEM_TYPE);
-sys_var_thd_ulong sys_net_wait_timeout("wait_timeout",
+static sys_var_thd_ulong sys_net_wait_timeout(&vars, "wait_timeout",
&SV::net_wait_timeout);
-#ifdef WITH_INNOBASE_STORAGE_ENGINE
-sys_var_long_ptr sys_innodb_fast_shutdown("innodb_fast_shutdown",
- &innobase_fast_shutdown);
-sys_var_long_ptr sys_innodb_max_dirty_pages_pct("innodb_max_dirty_pages_pct",
- &srv_max_buf_pool_modified_pct);
-sys_var_long_ptr sys_innodb_max_purge_lag("innodb_max_purge_lag",
- &srv_max_purge_lag);
-sys_var_thd_bool sys_innodb_table_locks("innodb_table_locks",
- &SV::innodb_table_locks);
-sys_var_thd_bool sys_innodb_support_xa("innodb_support_xa",
- &SV::innodb_support_xa);
-sys_var_long_ptr sys_innodb_autoextend_increment("innodb_autoextend_increment",
- &srv_auto_extend_increment);
-sys_var_long_ptr sys_innodb_sync_spin_loops("innodb_sync_spin_loops",
- &srv_n_spin_wait_rounds);
-sys_var_long_ptr sys_innodb_concurrency_tickets("innodb_concurrency_tickets",
- &srv_n_free_tickets_to_enter);
-sys_var_long_ptr sys_innodb_thread_sleep_delay("innodb_thread_sleep_delay",
- &srv_thread_sleep_delay);
-sys_var_long_ptr sys_innodb_thread_concurrency("innodb_thread_concurrency",
- &srv_thread_concurrency);
-sys_var_long_ptr sys_innodb_commit_concurrency("innodb_commit_concurrency",
- &srv_commit_concurrency);
-sys_var_long_ptr sys_innodb_flush_log_at_trx_commit(
- "innodb_flush_log_at_trx_commit",
- &srv_flush_log_at_trx_commit);
-#endif
+
/* Condition pushdown to storage engine */
-sys_var_thd_bool
-sys_engine_condition_pushdown("engine_condition_pushdown",
+static sys_var_thd_bool
+sys_engine_condition_pushdown(&vars, "engine_condition_pushdown",
&SV::engine_condition_pushdown);
+#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
/* ndb thread specific variable settings */
-sys_var_thd_ulong
-sys_ndb_autoincrement_prefetch_sz("ndb_autoincrement_prefetch_sz",
+static sys_var_thd_ulong
+sys_ndb_autoincrement_prefetch_sz(&vars, "ndb_autoincrement_prefetch_sz",
&SV::ndb_autoincrement_prefetch_sz);
-sys_var_thd_bool
-sys_ndb_force_send("ndb_force_send", &SV::ndb_force_send);
+static sys_var_thd_bool
+sys_ndb_force_send(&vars, "ndb_force_send", &SV::ndb_force_send);
#ifdef HAVE_NDB_BINLOG
-sys_var_long_ptr
-sys_ndb_report_thresh_binlog_epoch_slip("ndb_report_thresh_binlog_epoch_slip",
+static sys_var_long_ptr
+sys_ndb_report_thresh_binlog_epoch_slip(&vars, "ndb_report_thresh_binlog_epoch_slip",
&ndb_report_thresh_binlog_epoch_slip);
-sys_var_long_ptr
-sys_ndb_report_thresh_binlog_mem_usage("ndb_report_thresh_binlog_mem_usage",
+static sys_var_long_ptr
+sys_ndb_report_thresh_binlog_mem_usage(&vars, "ndb_report_thresh_binlog_mem_usage",
&ndb_report_thresh_binlog_mem_usage);
#endif
-sys_var_thd_bool
-sys_ndb_use_exact_count("ndb_use_exact_count", &SV::ndb_use_exact_count);
-sys_var_thd_bool
-sys_ndb_use_transactions("ndb_use_transactions", &SV::ndb_use_transactions);
-sys_var_long_ptr
-sys_ndb_cache_check_time("ndb_cache_check_time", &ndb_cache_check_time);
-sys_var_thd_bool
-sys_ndb_index_stat_enable("ndb_index_stat_enable",
+static sys_var_thd_bool
+sys_ndb_use_exact_count(&vars, "ndb_use_exact_count", &SV::ndb_use_exact_count);
+static sys_var_thd_bool
+sys_ndb_use_transactions(&vars, "ndb_use_transactions", &SV::ndb_use_transactions);
+static sys_var_long_ptr
+sys_ndb_cache_check_time(&vars, "ndb_cache_check_time", &ndb_cache_check_time);
+static sys_var_const_str
+sys_ndb_connectstring(&vars, "ndb_connectstring", opt_ndb_constrbuf);
+static sys_var_thd_bool
+sys_ndb_index_stat_enable(&vars, "ndb_index_stat_enable",
&SV::ndb_index_stat_enable);
-sys_var_thd_ulong
-sys_ndb_index_stat_cache_entries("ndb_index_stat_cache_entries",
+static sys_var_thd_ulong
+sys_ndb_index_stat_cache_entries(&vars, "ndb_index_stat_cache_entries",
&SV::ndb_index_stat_cache_entries);
-sys_var_thd_ulong
-sys_ndb_index_stat_update_freq("ndb_index_stat_update_freq",
+static sys_var_thd_ulong
+sys_ndb_index_stat_update_freq(&vars, "ndb_index_stat_update_freq",
&SV::ndb_index_stat_update_freq);
-sys_var_long_ptr
-sys_ndb_extra_logging("ndb_extra_logging", &ndb_extra_logging);
-sys_var_thd_bool
-sys_ndb_use_copying_alter_table("ndb_use_copying_alter_table", &SV::ndb_use_copying_alter_table);
+static sys_var_long_ptr
+sys_ndb_extra_logging(&vars, "ndb_extra_logging", &ndb_extra_logging);
+static sys_var_thd_bool
+sys_ndb_use_copying_alter_table(&vars, "ndb_use_copying_alter_table", &SV::ndb_use_copying_alter_table);
+#endif //WITH_NDBCLUSTER_STORAGE_ENGINE
/* Time/date/datetime formats */
-sys_var_thd_date_time_format sys_time_format("time_format",
+static sys_var_thd_date_time_format sys_time_format(&vars, "time_format",
&SV::time_format,
MYSQL_TIMESTAMP_TIME);
-sys_var_thd_date_time_format sys_date_format("date_format",
+static sys_var_thd_date_time_format sys_date_format(&vars, "date_format",
&SV::date_format,
MYSQL_TIMESTAMP_DATE);
-sys_var_thd_date_time_format sys_datetime_format("datetime_format",
+static sys_var_thd_date_time_format sys_datetime_format(&vars, "datetime_format",
&SV::datetime_format,
MYSQL_TIMESTAMP_DATETIME);
/* Variables that are bits in THD */
-sys_var_thd_bit sys_autocommit("autocommit", 0,
+sys_var_thd_bit sys_autocommit(&vars, "autocommit", 0,
set_option_autocommit,
OPTION_NOT_AUTOCOMMIT,
1);
-static sys_var_thd_bit sys_big_tables("big_tables", 0,
+static sys_var_thd_bit sys_big_tables(&vars, "big_tables", 0,
set_option_bit,
OPTION_BIG_TABLES);
#ifndef TO_BE_DELETED /* Alias for big_tables */
-static sys_var_thd_bit sys_sql_big_tables("sql_big_tables", 0,
+static sys_var_thd_bit sys_sql_big_tables(&vars, "sql_big_tables", 0,
set_option_bit,
OPTION_BIG_TABLES);
#endif
-static sys_var_thd_bit sys_big_selects("sql_big_selects", 0,
+static sys_var_thd_bit sys_big_selects(&vars, "sql_big_selects", 0,
set_option_bit,
OPTION_BIG_SELECTS);
-static sys_var_thd_bit sys_log_off("sql_log_off",
+static sys_var_thd_bit sys_log_off(&vars, "sql_log_off",
check_log_update,
set_option_bit,
OPTION_LOG_OFF);
-static sys_var_thd_bit sys_log_update("sql_log_update",
+static sys_var_thd_bit sys_log_update(&vars, "sql_log_update",
check_log_update,
set_log_update,
OPTION_BIN_LOG);
-static sys_var_thd_bit sys_log_binlog("sql_log_bin",
+static sys_var_thd_bit sys_log_binlog(&vars, "sql_log_bin",
check_log_update,
set_option_bit,
OPTION_BIN_LOG);
-static sys_var_thd_bit sys_sql_warnings("sql_warnings", 0,
+static sys_var_thd_bit sys_sql_warnings(&vars, "sql_warnings", 0,
set_option_bit,
OPTION_WARNINGS);
-static sys_var_thd_bit sys_sql_notes("sql_notes", 0,
+static sys_var_thd_bit sys_sql_notes(&vars, "sql_notes", 0,
set_option_bit,
OPTION_SQL_NOTES);
-static sys_var_thd_bit sys_auto_is_null("sql_auto_is_null", 0,
+static sys_var_thd_bit sys_auto_is_null(&vars, "sql_auto_is_null", 0,
set_option_bit,
OPTION_AUTO_IS_NULL);
-static sys_var_thd_bit sys_safe_updates("sql_safe_updates", 0,
+static sys_var_thd_bit sys_safe_updates(&vars, "sql_safe_updates", 0,
set_option_bit,
OPTION_SAFE_UPDATES);
-static sys_var_thd_bit sys_buffer_results("sql_buffer_result", 0,
+static sys_var_thd_bit sys_buffer_results(&vars, "sql_buffer_result", 0,
set_option_bit,
OPTION_BUFFER_RESULT);
-static sys_var_thd_bit sys_quote_show_create("sql_quote_show_create", 0,
+static sys_var_thd_bit sys_quote_show_create(&vars, "sql_quote_show_create", 0,
set_option_bit,
OPTION_QUOTE_SHOW_CREATE);
-static sys_var_thd_bit sys_foreign_key_checks("foreign_key_checks", 0,
+static sys_var_thd_bit sys_foreign_key_checks(&vars, "foreign_key_checks", 0,
set_option_bit,
OPTION_NO_FOREIGN_KEY_CHECKS,
1);
-static sys_var_thd_bit sys_unique_checks("unique_checks", 0,
+static sys_var_thd_bit sys_unique_checks(&vars, "unique_checks", 0,
set_option_bit,
OPTION_RELAXED_UNIQUE_CHECKS,
1);
@@ -638,433 +591,133 @@ static sys_var_thd_ulong sys_profiling_history_size("profiling_history_size",
/* Local state variables */
-static sys_var_thd_ha_rows sys_select_limit("sql_select_limit",
+static sys_var_thd_ha_rows sys_select_limit(&vars, "sql_select_limit",
&SV::select_limit);
-static sys_var_timestamp sys_timestamp("timestamp");
-static sys_var_last_insert_id sys_last_insert_id("last_insert_id");
-static sys_var_last_insert_id sys_identity("identity");
+static sys_var_timestamp sys_timestamp(&vars, "timestamp");
+static sys_var_last_insert_id sys_last_insert_id(&vars, "last_insert_id");
+static sys_var_last_insert_id sys_identity(&vars, "identity");
-static sys_var_thd_lc_time_names sys_lc_time_names("lc_time_names");
+static sys_var_thd_lc_time_names sys_lc_time_names(&vars, "lc_time_names");
-static sys_var_insert_id sys_insert_id("insert_id");
-static sys_var_readonly sys_error_count("error_count",
+static sys_var_insert_id sys_insert_id(&vars, "insert_id");
+static sys_var_readonly sys_error_count(&vars, "error_count",
OPT_SESSION,
SHOW_LONG,
get_error_count);
-static sys_var_readonly sys_warning_count("warning_count",
+static sys_var_readonly sys_warning_count(&vars, "warning_count",
OPT_SESSION,
SHOW_LONG,
get_warning_count);
/* alias for last_insert_id() to be compatible with Sybase */
-#ifdef HAVE_REPLICATION
-static sys_var_slave_skip_counter sys_slave_skip_counter("sql_slave_skip_counter");
-#endif
-static sys_var_rand_seed1 sys_rand_seed1("rand_seed1");
-static sys_var_rand_seed2 sys_rand_seed2("rand_seed2");
+static sys_var_rand_seed1 sys_rand_seed1(&vars, "rand_seed1");
+static sys_var_rand_seed2 sys_rand_seed2(&vars, "rand_seed2");
-static sys_var_thd_ulong sys_default_week_format("default_week_format",
+static sys_var_thd_ulong sys_default_week_format(&vars, "default_week_format",
&SV::default_week_format);
-sys_var_thd_ulong sys_group_concat_max_len("group_concat_max_len",
+sys_var_thd_ulong sys_group_concat_max_len(&vars, "group_concat_max_len",
&SV::group_concat_max_len);
-sys_var_thd_time_zone sys_time_zone("time_zone");
+sys_var_thd_time_zone sys_time_zone(&vars, "time_zone");
+
+/* Global read-only variable containing hostname */
+static sys_var_const_str sys_hostname(&vars, "hostname", glob_hostname);
+sys_var_thd_bool sys_keep_files_on_create(&vars, "keep_files_on_create",
+ &SV::keep_files_on_create);
/* Read only variables */
-/* Global read-only variable containing hostname */
-sys_var_const_str sys_hostname("hostname", glob_hostname);
-
-
-sys_var_have_variable sys_have_compress("have_compress", &have_compress);
-sys_var_have_variable sys_have_crypt("have_crypt", &have_crypt);
-sys_var_have_variable sys_have_csv_db("have_csv", &have_csv_db);
-sys_var_have_variable sys_have_dlopen("have_dynamic_loading", &have_dlopen);
-sys_var_have_variable sys_have_geometry("have_geometry", &have_geometry);
-sys_var_have_variable sys_have_innodb("have_innodb", &have_innodb);
-sys_var_have_variable sys_have_ndbcluster("have_ndbcluster", &have_ndbcluster);
-sys_var_have_variable sys_have_openssl("have_openssl", &have_ssl);
-sys_var_have_variable sys_have_ssl("have_ssl", &have_ssl);
-sys_var_have_variable sys_have_partition_db("have_partitioning",
- &have_partition_db);
-sys_var_have_variable sys_have_query_cache("have_query_cache",
+static sys_var_have_variable sys_have_compress(&vars, "have_compress", &have_compress);
+static sys_var_have_variable sys_have_crypt(&vars, "have_crypt", &have_crypt);
+static sys_var_have_plugin sys_have_csv(&vars, "have_csv", C_STRING_WITH_LEN("csv"), MYSQL_STORAGE_ENGINE_PLUGIN);
+static sys_var_have_variable sys_have_dlopen(&vars, "have_dynamic_loading", &have_dlopen);
+static sys_var_have_variable sys_have_geometry(&vars, "have_geometry", &have_geometry);
+static sys_var_have_plugin sys_have_innodb(&vars, "have_innodb", C_STRING_WITH_LEN("innodb"), MYSQL_STORAGE_ENGINE_PLUGIN);
+static sys_var_have_plugin sys_have_ndbcluster(&vars, "have_ndbcluster", C_STRING_WITH_LEN("ndbcluster"), MYSQL_STORAGE_ENGINE_PLUGIN);
+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_query_cache(&vars, "have_query_cache",
&have_query_cache);
-sys_var_have_variable sys_have_rtree_keys("have_rtree_keys", &have_rtree_keys);
-sys_var_have_variable sys_have_symlink("have_symlink", &have_symlink);
-sys_var_have_variable sys_have_community_features("have_community_features", &have_community_features);
+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 */
-sys_var_const_str sys_license("license", STRINGIFY_ARG(LICENSE));
+static sys_var_const_str sys_license(&vars, "license", STRINGIFY_ARG(LICENSE));
/* Global variables which enable|disable logging */
-sys_var_log_state sys_var_general_log("general_log", &opt_log,
+static sys_var_log_state sys_var_general_log(&vars, "general_log", &opt_log,
QUERY_LOG_GENERAL);
-sys_var_log_state sys_var_slow_query_log("slow_query_log", &opt_slow_log,
+static sys_var_log_state sys_var_slow_query_log(&vars, "slow_query_log", &opt_slow_log,
QUERY_LOG_SLOW);
-sys_var_str sys_var_general_log_path("general_log_file", sys_check_log_path,
+sys_var_str sys_var_general_log_path(&vars, "general_log_file", sys_check_log_path,
sys_update_general_log_path,
sys_default_general_log_path,
opt_logname);
-sys_var_str sys_var_slow_log_path("slow_query_log_file", sys_check_log_path,
+sys_var_str sys_var_slow_log_path(&vars, "slow_query_log_file", sys_check_log_path,
sys_update_slow_log_path,
sys_default_slow_log_path,
opt_slow_logname);
-sys_var_log_output sys_var_log_output_state("log_output", &log_output_options,
+static sys_var_log_output sys_var_log_output_state(&vars, "log_output", &log_output_options,
&log_output_typelib, 0);
-#ifdef HAVE_REPLICATION
-static int show_slave_skip_errors(THD *thd, SHOW_VAR *var, char *buff)
-{
- var->type=SHOW_CHAR;
- var->value= buff;
- if (!use_slave_mask || bitmap_is_clear_all(&slave_error_mask))
- {
- var->value= const_cast<char *>("OFF");
- }
- else if (bitmap_is_set_all(&slave_error_mask))
- {
- var->value= const_cast<char *>("ALL");
- }
- else
- {
- /* 10 is enough assuming errors are max 4 digits */
- int i;
- var->value= buff;
- for (i= 1;
- i < MAX_SLAVE_ERROR &&
- (buff - var->value) < SHOW_VAR_FUNC_BUFF_SIZE;
- i++)
- {
- if (bitmap_is_set(&slave_error_mask, i))
- {
- buff= int10_to_str(i, buff, 10);
- *buff++= ',';
- }
- }
- if (var->value != buff)
- buff--; // Remove last ','
- if (i < MAX_SLAVE_ERROR)
- buff= strmov(buff, "..."); // Couldn't show all errors
- *buff=0;
- }
- return 0;
-}
-#endif /* HAVE_REPLICATION */
/*
- Variables shown by SHOW VARIABLES in alphabetical order
+ Additional variables (not derived from sys_var class, not accessible as
+ @@varname in SELECT or SET). Sorted in alphabetical order to facilitate
+ maintenance - SHOW VARIABLES will sort its output.
+ TODO: remove this list completely
*/
-SHOW_VAR init_vars[]= {
- {"auto_increment_increment", (char*) &sys_auto_increment_increment, SHOW_SYS},
- {"auto_increment_offset", (char*) &sys_auto_increment_offset, SHOW_SYS},
- {sys_automatic_sp_privileges.name,(char*) &sys_automatic_sp_privileges, SHOW_SYS},
+#define FIXED_VARS_SIZE (sizeof(fixed_vars) / sizeof(SHOW_VAR))
+static SHOW_VAR fixed_vars[]= {
{"back_log", (char*) &back_log, SHOW_LONG},
- {sys_basedir.name, (char*) &sys_basedir, SHOW_SYS},
- {sys_binlog_cache_size.name,(char*) &sys_binlog_cache_size, SHOW_SYS},
- {sys_binlog_format.name, (char*) &sys_binlog_format, SHOW_SYS},
- {sys_bulk_insert_buff_size.name,(char*) &sys_bulk_insert_buff_size,SHOW_SYS},
- {sys_character_set_client.name,(char*) &sys_character_set_client, SHOW_SYS},
- {sys_character_set_connection.name,(char*) &sys_character_set_connection,SHOW_SYS},
- {sys_character_set_database.name, (char*) &sys_character_set_database,SHOW_SYS},
- {sys_character_set_filesystem.name,(char*) &sys_character_set_filesystem, SHOW_SYS},
- {sys_character_set_results.name,(char*) &sys_character_set_results, SHOW_SYS},
- {sys_character_set_server.name, (char*) &sys_character_set_server,SHOW_SYS},
- {sys_charset_system.name, (char*) &sys_charset_system, SHOW_SYS},
{"character_sets_dir", mysql_charsets_dir, SHOW_CHAR},
- {sys_collation_connection.name,(char*) &sys_collation_connection, SHOW_SYS},
- {sys_collation_database.name,(char*) &sys_collation_database, SHOW_SYS},
- {sys_collation_server.name,(char*) &sys_collation_server, SHOW_SYS},
- {sys_completion_type.name, (char*) &sys_completion_type, SHOW_SYS},
- {sys_concurrent_insert.name,(char*) &sys_concurrent_insert, SHOW_SYS},
- {sys_connect_timeout.name, (char*) &sys_connect_timeout, SHOW_SYS},
- {sys_datadir.name, (char*) &sys_datadir, SHOW_SYS},
- {sys_date_format.name, (char*) &sys_date_format, SHOW_SYS},
- {sys_datetime_format.name, (char*) &sys_datetime_format, SHOW_SYS},
-#ifndef DBUG_OFF
- {sys_dbug.name, (char*) &sys_dbug, SHOW_SYS},
-#endif
- {sys_default_week_format.name, (char*) &sys_default_week_format, SHOW_SYS},
- {sys_delay_key_write.name, (char*) &sys_delay_key_write, SHOW_SYS},
- {sys_delayed_insert_limit.name, (char*) &sys_delayed_insert_limit,SHOW_SYS},
- {sys_delayed_insert_timeout.name, (char*) &sys_delayed_insert_timeout, SHOW_SYS},
- {sys_delayed_queue_size.name,(char*) &sys_delayed_queue_size, SHOW_SYS},
- {sys_div_precincrement.name,(char*) &sys_div_precincrement,SHOW_SYS},
- {sys_engine_condition_pushdown.name,
- (char*) &sys_engine_condition_pushdown, SHOW_SYS},
- {sys_event_scheduler.name, (char*) &sys_event_scheduler, SHOW_SYS},
- {sys_expire_logs_days.name, (char*) &sys_expire_logs_days, SHOW_SYS},
- {sys_flush.name, (char*) &sys_flush, SHOW_SYS},
- {sys_flush_time.name, (char*) &sys_flush_time, SHOW_SYS},
- {sys_ft_boolean_syntax.name,(char*) &ft_boolean_syntax, SHOW_CHAR},
{"ft_max_word_len", (char*) &ft_max_word_len, SHOW_LONG},
{"ft_min_word_len", (char*) &ft_min_word_len, SHOW_LONG},
{"ft_query_expansion_limit",(char*) &ft_query_expansion_limit, SHOW_LONG},
{"ft_stopword_file", (char*) &ft_stopword_file, SHOW_CHAR_PTR},
- {sys_var_general_log.name, (char*) &opt_log, SHOW_MY_BOOL},
- {sys_var_general_log_path.name, (char*) &sys_var_general_log_path, SHOW_SYS},
- {sys_group_concat_max_len.name, (char*) &sys_group_concat_max_len, SHOW_SYS},
- {sys_hostname.name, (char*) &sys_hostname, SHOW_SYS},
- {sys_have_community_features.name, (char*) &have_community_features, SHOW_HAVE},
- {sys_have_compress.name, (char*) &have_compress, SHOW_HAVE},
- {sys_have_crypt.name, (char*) &have_crypt, SHOW_HAVE},
- {sys_have_csv_db.name, (char*) &have_csv_db, SHOW_HAVE},
- {sys_have_dlopen.name, (char*) &have_dlopen, SHOW_HAVE},
- {sys_have_geometry.name, (char*) &have_geometry, SHOW_HAVE},
- {sys_have_innodb.name, (char*) &have_innodb, SHOW_HAVE},
- {sys_have_ndbcluster.name, (char*) &have_ndbcluster, SHOW_HAVE},
- {sys_have_openssl.name, (char*) &have_ssl, SHOW_HAVE},
- {sys_have_ssl.name, (char*) &have_ssl, SHOW_HAVE},
- {sys_have_partition_db.name,(char*) &have_partition_db, SHOW_HAVE},
- {sys_have_query_cache.name, (char*) &have_query_cache, SHOW_HAVE},
- {sys_have_rtree_keys.name, (char*) &have_rtree_keys, SHOW_HAVE},
- {sys_have_symlink.name, (char*) &have_symlink, SHOW_HAVE},
- {"init_connect", (char*) &sys_init_connect, SHOW_SYS},
{"init_file", (char*) &opt_init_file, SHOW_CHAR_PTR},
- {"init_slave", (char*) &sys_init_slave, SHOW_SYS},
-#ifdef WITH_INNOBASE_STORAGE_ENGINE
- {"innodb_additional_mem_pool_size", (char*) &innobase_additional_mem_pool_size, SHOW_LONG },
- {sys_innodb_autoextend_increment.name, (char*) &sys_innodb_autoextend_increment, SHOW_SYS},
- {"innodb_buffer_pool_size", (char*) &innobase_buffer_pool_size, SHOW_LONGLONG },
- {"innodb_checksums", (char*) &innobase_use_checksums, SHOW_MY_BOOL},
- {sys_innodb_commit_concurrency.name, (char*) &sys_innodb_commit_concurrency, SHOW_SYS},
- {sys_innodb_concurrency_tickets.name, (char*) &sys_innodb_concurrency_tickets, SHOW_SYS},
- {"innodb_data_file_path", (char*) &innobase_data_file_path, SHOW_CHAR_PTR},
- {"innodb_data_home_dir", (char*) &innobase_data_home_dir, SHOW_CHAR_PTR},
- {"innodb_doublewrite", (char*) &innobase_use_doublewrite, SHOW_MY_BOOL},
- {sys_innodb_fast_shutdown.name,(char*) &sys_innodb_fast_shutdown, SHOW_SYS},
- {"innodb_file_io_threads", (char*) &innobase_file_io_threads, SHOW_LONG },
- {"innodb_file_per_table", (char*) &innobase_file_per_table, SHOW_MY_BOOL},
- {"innodb_flush_method", (char*) &innobase_unix_file_flush_method, SHOW_CHAR_PTR},
- {"innodb_force_recovery", (char*) &innobase_force_recovery, SHOW_LONG },
- {"innodb_lock_wait_timeout", (char*) &innobase_lock_wait_timeout, SHOW_LONG },
- {"innodb_locks_unsafe_for_binlog", (char*) &innobase_locks_unsafe_for_binlog, SHOW_MY_BOOL},
- {"innodb_log_arch_dir", (char*) &innobase_log_arch_dir, SHOW_CHAR_PTR},
- {"innodb_log_archive", (char*) &innobase_log_archive, SHOW_MY_BOOL},
- {"innodb_log_buffer_size", (char*) &innobase_log_buffer_size, SHOW_LONG },
- {"innodb_log_file_size", (char*) &innobase_log_file_size, SHOW_LONGLONG},
- {"innodb_log_files_in_group", (char*) &innobase_log_files_in_group, SHOW_LONG},
- {"innodb_log_group_home_dir", (char*) &innobase_log_group_home_dir, SHOW_CHAR_PTR},
- {sys_innodb_max_dirty_pages_pct.name, (char*) &sys_innodb_max_dirty_pages_pct, SHOW_SYS},
- {sys_innodb_max_purge_lag.name, (char*) &sys_innodb_max_purge_lag, SHOW_SYS},
- {"innodb_mirrored_log_groups", (char*) &innobase_mirrored_log_groups, SHOW_LONG},
- {"innodb_open_files", (char*) &innobase_open_files, SHOW_LONG },
- {"innodb_rollback_on_timeout", (char*) &innobase_rollback_on_timeout, SHOW_MY_BOOL},
- {"innodb_stats_on_metadata", (char*) &innobase_stats_on_metadata, SHOW_MY_BOOL},
- {sys_innodb_support_xa.name, (char*) &sys_innodb_support_xa, SHOW_SYS},
- {sys_innodb_sync_spin_loops.name, (char*) &sys_innodb_sync_spin_loops, SHOW_SYS},
- {sys_innodb_table_locks.name, (char*) &sys_innodb_table_locks, SHOW_SYS},
- {sys_innodb_thread_concurrency.name, (char*) &sys_innodb_thread_concurrency, SHOW_SYS},
- {sys_innodb_thread_sleep_delay.name, (char*) &sys_innodb_thread_sleep_delay, SHOW_SYS},
- {sys_innodb_flush_log_at_trx_commit.name, (char*) &sys_innodb_flush_log_at_trx_commit, SHOW_SYS},
-#endif
- {sys_interactive_timeout.name,(char*) &sys_interactive_timeout, SHOW_SYS},
- {sys_join_buffer_size.name, (char*) &sys_join_buffer_size, SHOW_SYS},
- {sys_key_buffer_size.name, (char*) &sys_key_buffer_size, SHOW_SYS},
- {sys_key_cache_age_threshold.name, (char*) &sys_key_cache_age_threshold,
- SHOW_SYS},
- {sys_key_cache_block_size.name, (char*) &sys_key_cache_block_size,
- SHOW_SYS},
- {sys_key_cache_division_limit.name, (char*) &sys_key_cache_division_limit,
- SHOW_SYS},
{"language", language, SHOW_CHAR},
{"large_files_support", (char*) &opt_large_files, SHOW_BOOL},
{"large_page_size", (char*) &opt_large_page_size, SHOW_INT},
{"large_pages", (char*) &opt_large_pages, SHOW_MY_BOOL},
- {sys_lc_time_names.name, (char*) &sys_lc_time_names, SHOW_SYS},
- {sys_license.name, (char*) &sys_license, SHOW_SYS},
- {sys_local_infile.name, (char*) &sys_local_infile, SHOW_SYS},
#ifdef HAVE_MLOCKALL
- {"locked_in_memory", (char*) &locked_in_memory, SHOW_BOOL},
+ {"locked_in_memory", (char*) &locked_in_memory, SHOW_MY_BOOL},
#endif
- {"log", (char*) &opt_log, SHOW_BOOL},
+ {"log", (char*) &opt_log, SHOW_MY_BOOL},
{"log_bin", (char*) &opt_bin_log, SHOW_BOOL},
- {sys_trust_function_creators.name,(char*) &sys_trust_function_creators, SHOW_SYS},
{"log_error", (char*) log_error_file, SHOW_CHAR},
- {sys_var_log_output_state.name, (char*) &sys_var_log_output_state, SHOW_SYS},
- {sys_log_queries_not_using_indexes.name,
- (char*) &sys_log_queries_not_using_indexes, SHOW_SYS},
-#ifdef HAVE_REPLICATION
- {"log_slave_updates", (char*) &opt_log_slave_updates, SHOW_MY_BOOL},
-#endif
{"log_slow_queries", (char*) &opt_slow_log, SHOW_MY_BOOL},
- {sys_log_warnings.name, (char*) &sys_log_warnings, SHOW_SYS},
- {sys_long_query_time.name, (char*) &sys_long_query_time, SHOW_SYS},
- {sys_low_priority_updates.name, (char*) &sys_low_priority_updates, SHOW_SYS},
{"lower_case_file_system", (char*) &lower_case_file_system, SHOW_MY_BOOL},
{"lower_case_table_names", (char*) &lower_case_table_names, SHOW_INT},
- {sys_max_allowed_packet.name,(char*) &sys_max_allowed_packet, SHOW_SYS},
- {sys_max_binlog_cache_size.name,(char*) &sys_max_binlog_cache_size, SHOW_SYS},
- {sys_max_binlog_size.name, (char*) &sys_max_binlog_size, SHOW_SYS},
- {sys_max_connect_errors.name, (char*) &sys_max_connect_errors, SHOW_SYS},
- {sys_max_connections.name, (char*) &sys_max_connections, SHOW_SYS},
- {sys_max_delayed_threads.name,(char*) &sys_max_delayed_threads, SHOW_SYS},
- {sys_max_error_count.name, (char*) &sys_max_error_count, SHOW_SYS},
- {sys_max_heap_table_size.name,(char*) &sys_max_heap_table_size, SHOW_SYS},
- {sys_max_insert_delayed_threads.name,
- (char*) &sys_max_insert_delayed_threads, SHOW_SYS},
- {sys_max_join_size.name, (char*) &sys_max_join_size, SHOW_SYS},
- {sys_max_length_for_sort_data.name, (char*) &sys_max_length_for_sort_data,
- SHOW_SYS},
- {sys_max_prepared_stmt_count.name, (char*) &sys_max_prepared_stmt_count,
- SHOW_SYS},
- {sys_max_relay_log_size.name, (char*) &sys_max_relay_log_size, SHOW_SYS},
- {sys_max_seeks_for_key.name, (char*) &sys_max_seeks_for_key, SHOW_SYS},
- {sys_max_sort_length.name, (char*) &sys_max_sort_length, SHOW_SYS},
- {sys_max_sp_recursion_depth.name,
- (char*) &sys_max_sp_recursion_depth, SHOW_SYS},
- {sys_max_tmp_tables.name, (char*) &sys_max_tmp_tables, SHOW_SYS},
- {sys_max_user_connections.name,(char*) &sys_max_user_connections, SHOW_SYS},
- {sys_max_write_lock_count.name, (char*) &sys_max_write_lock_count,SHOW_SYS},
- {sys_multi_range_count.name, (char*) &sys_multi_range_count, SHOW_SYS},
- {sys_myisam_data_pointer_size.name, (char*) &sys_myisam_data_pointer_size, SHOW_SYS},
- {sys_myisam_max_sort_file_size.name, (char*) &sys_myisam_max_sort_file_size,
- SHOW_SYS},
{"myisam_recover_options", (char*) &myisam_recover_options_str, SHOW_CHAR_PTR},
- {sys_myisam_repair_threads.name, (char*) &sys_myisam_repair_threads,
- SHOW_SYS},
- {sys_myisam_sort_buffer_size.name, (char*) &sys_myisam_sort_buffer_size, SHOW_SYS},
-
- {sys_myisam_stats_method.name, (char*) &sys_myisam_stats_method, SHOW_SYS},
- {sys_myisam_use_mmap.name, (char*) &sys_myisam_use_mmap, SHOW_SYS},
-
#ifdef __NT__
{"named_pipe", (char*) &opt_enable_named_pipe, SHOW_MY_BOOL},
#endif
- {sys_ndb_autoincrement_prefetch_sz.name,
- (char*) &sys_ndb_autoincrement_prefetch_sz, SHOW_SYS},
- {sys_ndb_cache_check_time.name,(char*) &sys_ndb_cache_check_time, SHOW_SYS},
- {sys_ndb_extra_logging.name,(char*) &sys_ndb_extra_logging, SHOW_SYS},
- {sys_ndb_force_send.name, (char*) &sys_ndb_force_send, SHOW_SYS},
- {sys_ndb_index_stat_cache_entries.name, (char*) &sys_ndb_index_stat_cache_entries, SHOW_SYS},
- {sys_ndb_index_stat_enable.name, (char*) &sys_ndb_index_stat_enable, SHOW_SYS},
- {sys_ndb_index_stat_update_freq.name, (char*) &sys_ndb_index_stat_update_freq, SHOW_SYS},
-#ifdef HAVE_NDB_BINLOG
- {sys_ndb_report_thresh_binlog_epoch_slip.name,
- (char*) &sys_ndb_report_thresh_binlog_epoch_slip, SHOW_SYS},
- {sys_ndb_report_thresh_binlog_mem_usage.name,
- (char*) &sys_ndb_report_thresh_binlog_mem_usage, SHOW_SYS},
-#endif
- {sys_ndb_use_copying_alter_table.name,
- (char*) &sys_ndb_use_copying_alter_table, SHOW_SYS},
- {sys_ndb_use_exact_count.name,(char*) &sys_ndb_use_exact_count, SHOW_SYS},
- {sys_ndb_use_transactions.name,(char*) &sys_ndb_use_transactions, SHOW_SYS},
- {sys_net_buffer_length.name,(char*) &sys_net_buffer_length, SHOW_SYS},
- {sys_net_read_timeout.name, (char*) &sys_net_read_timeout, SHOW_SYS},
- {sys_net_retry_count.name, (char*) &sys_net_retry_count, SHOW_SYS},
- {sys_net_write_timeout.name,(char*) &sys_net_write_timeout, SHOW_SYS},
- {sys_new_mode.name, (char*) &sys_new_mode, SHOW_SYS},
- {sys_old_mode.name, (char*) &sys_old_mode, SHOW_SYS},
- {sys_old_alter_table.name, (char*) &sys_old_alter_table, SHOW_SYS},
- {sys_old_passwords.name, (char*) &sys_old_passwords, SHOW_SYS},
{"open_files_limit", (char*) &open_files_limit, SHOW_LONG},
- {sys_optimizer_prune_level.name, (char*) &sys_optimizer_prune_level,
- SHOW_SYS},
- {sys_optimizer_search_depth.name,(char*) &sys_optimizer_search_depth,
- SHOW_SYS},
{"pid_file", (char*) pidfile_name, SHOW_CHAR},
{"plugin_dir", (char*) opt_plugin_dir, SHOW_CHAR},
- {"port", (char*) &mysqld_port, SHOW_INT},
- {sys_preload_buff_size.name, (char*) &sys_preload_buff_size, SHOW_SYS},
+ {"port", (char*) &mysqld_port, SHOW_INT},
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
{sys_profiling.name, (char*) &sys_profiling, SHOW_SYS},
{sys_profiling_history_size.name, (char*) &sys_profiling_history_size, SHOW_SYS},
#endif
{"protocol_version", (char*) &protocol_version, SHOW_INT},
- {sys_query_alloc_block_size.name, (char*) &sys_query_alloc_block_size,
- SHOW_SYS},
-#ifdef HAVE_QUERY_CACHE
- {sys_query_cache_limit.name,(char*) &sys_query_cache_limit, SHOW_SYS},
- {sys_query_cache_min_res_unit.name, (char*) &sys_query_cache_min_res_unit,
- SHOW_SYS},
- {sys_query_cache_size.name, (char*) &sys_query_cache_size, SHOW_SYS},
- {sys_query_cache_type.name, (char*) &sys_query_cache_type, SHOW_SYS},
- {sys_query_cache_wlock_invalidate.name,
- (char *) &sys_query_cache_wlock_invalidate, SHOW_SYS},
-#endif /* HAVE_QUERY_CACHE */
- {sys_query_prealloc_size.name, (char*) &sys_query_prealloc_size, SHOW_SYS},
- {sys_range_alloc_block_size.name, (char*) &sys_range_alloc_block_size,
- SHOW_SYS},
- {sys_read_buff_size.name, (char*) &sys_read_buff_size, SHOW_SYS},
- {sys_readonly.name, (char*) &sys_readonly, SHOW_SYS},
- {sys_read_rnd_buff_size.name,(char*) &sys_read_rnd_buff_size, SHOW_SYS},
-#ifdef HAVE_REPLICATION
- {sys_relay_log_purge.name, (char*) &sys_relay_log_purge, SHOW_SYS},
- {"relay_log_space_limit", (char*) &relay_log_space_limit, SHOW_LONGLONG},
-#endif
- {sys_rpl_recovery_rank.name,(char*) &sys_rpl_recovery_rank, SHOW_SYS},
- {"secure_auth", (char*) &sys_secure_auth, SHOW_SYS},
- {"secure_file_priv", (char*) &sys_secure_file_priv, SHOW_SYS},
#ifdef HAVE_SMEM
{"shared_memory", (char*) &opt_enable_shared_memory, SHOW_MY_BOOL},
{"shared_memory_base_name", (char*) &shared_memory_base_name, SHOW_CHAR_PTR},
#endif
- {sys_server_id.name, (char*) &sys_server_id, SHOW_SYS},
{"skip_external_locking", (char*) &my_disable_locking, SHOW_MY_BOOL},
{"skip_networking", (char*) &opt_disable_networking, SHOW_BOOL},
{"skip_show_database", (char*) &opt_skip_show_db, SHOW_BOOL},
-#ifdef HAVE_REPLICATION
- {sys_slave_compressed_protocol.name,
- (char*) &sys_slave_compressed_protocol, SHOW_SYS},
- {"slave_load_tmpdir", (char*) &slave_load_tmpdir, SHOW_CHAR_PTR},
- {sys_slave_net_timeout.name,(char*) &sys_slave_net_timeout, SHOW_SYS},
- {"slave_skip_errors", (char*) &show_slave_skip_errors, SHOW_FUNC},
- {sys_slave_trans_retries.name,(char*) &sys_slave_trans_retries, SHOW_SYS},
-#endif
- {sys_slow_launch_time.name, (char*) &sys_slow_launch_time, SHOW_SYS},
- {sys_var_slow_query_log.name, (char*) &opt_slow_log, SHOW_MY_BOOL},
- {sys_var_slow_log_path.name, (char*) &sys_var_slow_log_path, SHOW_SYS},
#ifdef HAVE_SYS_UN_H
- {"socket", (char*) &mysqld_unix_port, SHOW_CHAR_PTR},
-#endif
- {sys_sort_buffer.name, (char*) &sys_sort_buffer, SHOW_SYS},
- {sys_big_selects.name, (char*) &sys_big_selects, SHOW_SYS},
- {sys_sql_mode.name, (char*) &sys_sql_mode, SHOW_SYS},
- {"sql_notes", (char*) &sys_sql_notes, SHOW_SYS},
- {"sql_warnings", (char*) &sys_sql_warnings, SHOW_SYS},
- {sys_ssl_ca.name, (char*) &sys_ssl_ca, SHOW_SYS},
- {sys_ssl_capath.name, (char*) &sys_ssl_capath, SHOW_SYS},
- {sys_ssl_cert.name, (char*) &sys_ssl_cert, SHOW_SYS},
- {sys_ssl_cipher.name, (char*) &sys_ssl_cipher, SHOW_SYS},
- {sys_ssl_key.name, (char*) &sys_ssl_key, SHOW_SYS},
- {sys_storage_engine.name, (char*) &sys_storage_engine, SHOW_SYS},
-#ifdef HAVE_REPLICATION
- {sys_sync_binlog_period.name,(char*) &sys_sync_binlog_period, SHOW_SYS},
+ {"socket", (char*) &mysqld_unix_port, SHOW_CHAR_PTR},
#endif
- {sys_sync_frm.name, (char*) &sys_sync_frm, SHOW_SYS},
-#ifdef HAVE_TZNAME
- {"system_time_zone", system_time_zone, SHOW_CHAR},
-#endif
- {"table_definition_cache", (char*) &table_def_size, SHOW_LONG},
- {"table_lock_wait_timeout", (char*) &table_lock_wait_timeout, SHOW_LONG },
- {"table_open_cache", (char*) &table_cache_size, SHOW_LONG},
- {sys_table_type.name, (char*) &sys_table_type, SHOW_SYS},
- {sys_thread_cache_size.name,(char*) &sys_thread_cache_size, SHOW_SYS},
#ifdef HAVE_THR_SETCONCURRENCY
{"thread_concurrency", (char*) &concurrency, SHOW_LONG},
#endif
- {sys_thread_handling.name, (char*) &sys_thread_handling, SHOW_SYS},
-#if HAVE_POOL_OF_THREADS == 1
- {sys_thread_pool_size.name, (char*) &sys_thread_pool_size, SHOW_SYS},
-#endif
{"thread_stack", (char*) &thread_stack, SHOW_LONG},
- {sys_time_format.name, (char*) &sys_time_format, SHOW_SYS},
- {"time_zone", (char*) &sys_time_zone, SHOW_SYS},
- {sys_timed_mutexes.name, (char*) &sys_timed_mutexes, SHOW_SYS},
- {sys_tmp_table_size.name, (char*) &sys_tmp_table_size, SHOW_SYS},
- {sys_tmpdir.name, (char*) &sys_tmpdir, SHOW_SYS},
- {sys_trans_alloc_block_size.name, (char*) &sys_trans_alloc_block_size,
- SHOW_SYS},
- {sys_trans_prealloc_size.name, (char*) &sys_trans_prealloc_size, SHOW_SYS},
- {sys_tx_isolation.name, (char*) &sys_tx_isolation, SHOW_SYS},
- {sys_updatable_views_with_limit.name,
- (char*) &sys_updatable_views_with_limit,SHOW_SYS},
- {sys_version.name, (char*) &sys_version, SHOW_SYS},
- {sys_version_comment.name, (char*) &sys_version_comment, SHOW_SYS},
- {sys_version_compile_machine.name, (char*) &sys_version_compile_machine,
- SHOW_SYS},
- {sys_version_compile_os.name, (char*) &sys_version_compile_os, SHOW_SYS},
- {sys_net_wait_timeout.name, (char*) &sys_net_wait_timeout, SHOW_SYS},
- {NullS, NullS, SHOW_LONG}
};
@@ -1148,7 +801,7 @@ static void sys_default_init_slave(THD* thd, enum_var_type type)
static int sys_check_ftb_syntax(THD *thd, set_var *var)
{
if (thd->security_ctx->master_access & SUPER_ACL)
- return (ft_boolean_check_syntax_string((byte*)
+ return (ft_boolean_check_syntax_string((uchar*)
var->value->str_value.c_ptr()) ?
-1 : 0);
else
@@ -1162,6 +815,11 @@ static bool sys_update_ftb_syntax(THD *thd, set_var * var)
{
strmake(ft_boolean_syntax, var->value->str_value.c_ptr(),
sizeof(ft_boolean_syntax)-1);
+
+#ifdef HAVE_QUERY_CACHE
+ query_cache.flush();
+#endif /* HAVE_QUERY_CACHE */
+
return 0;
}
@@ -1179,7 +837,11 @@ static void sys_default_ftb_syntax(THD *thd, enum_var_type type)
static void fix_low_priority_updates(THD *thd, enum_var_type type)
{
- if (type != OPT_GLOBAL)
+ if (type == OPT_GLOBAL)
+ thr_upgraded_concurrent_insert_lock=
+ (global_system_variables.low_priority_updates ?
+ TL_WRITE_LOW_PRIORITY : TL_WRITE);
+ else
thd->update_lock_default= (thd->variables.low_priority_updates ?
TL_WRITE_LOW_PRIORITY : TL_WRITE);
}
@@ -1257,14 +919,14 @@ static int check_completion_type(THD *thd, set_var *var)
static void fix_net_read_timeout(THD *thd, enum_var_type type)
{
if (type != OPT_GLOBAL)
- net_set_read_timeout(&thd->net, thd->variables.net_read_timeout);
+ my_net_set_read_timeout(&thd->net, thd->variables.net_read_timeout);
}
static void fix_net_write_timeout(THD *thd, enum_var_type type)
{
if (type != OPT_GLOBAL)
- net_set_write_timeout(&thd->net, thd->variables.net_write_timeout);
+ my_net_set_write_timeout(&thd->net, thd->variables.net_write_timeout);
}
static void fix_net_retry_count(THD *thd, enum_var_type type)
@@ -1288,12 +950,19 @@ static void fix_net_retry_count(THD *thd __attribute__((unused)),
static void fix_query_cache_size(THD *thd, enum_var_type type)
{
#ifdef HAVE_QUERY_CACHE
- ulong requested= query_cache_size;
- query_cache.resize(query_cache_size);
- if (requested != query_cache_size)
+ ulong new_cache_size= query_cache.resize(query_cache_size);
+
+ /*
+ Note: query_cache_size is a global variable reflecting the
+ requested cache size. See also query_cache_size_arg
+ */
+
+ if (query_cache_size != new_cache_size)
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_QC_RESIZE, ER(ER_WARN_QC_RESIZE),
- requested, query_cache_size);
+ query_cache_size, new_cache_size);
+
+ query_cache_size= new_cache_size;
#endif
}
@@ -1355,16 +1024,6 @@ bool sys_var_thd_binlog_format::is_readonly() const
my_error(ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT, MYF(0));
return 1;
}
-#ifdef HAVE_NDB_BINLOG
- /*
- Cluster does not support changing the binlog format on the fly yet.
- */
- if (opt_bin_log && (have_ndbcluster == SHOW_OPTION_YES))
- {
- my_error(ER_NDB_CANT_SWITCH_BINLOG_FORMAT, MYF(0));
- return 1;
- }
-#endif /* HAVE_NDB_BINLOG */
return sys_var_thd_enum::is_readonly();
}
@@ -1450,9 +1109,9 @@ static void fix_server_id(THD *thd, enum_var_type type)
sys_var_long_ptr::
-sys_var_long_ptr(const char *name_arg, ulong *value_ptr_arg,
+sys_var_long_ptr(sys_var_chain *chain, const char *name_arg, ulong *value_ptr_arg,
sys_after_update_func after_update_arg)
- :sys_var_long_ptr_global(name_arg, value_ptr_arg,
+ :sys_var_long_ptr_global(chain, name_arg, value_ptr_arg,
&LOCK_global_system_variables, after_update_arg)
{}
@@ -1526,9 +1185,9 @@ bool sys_var_enum::update(THD *thd, set_var *var)
}
-byte *sys_var_enum::value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
+uchar *sys_var_enum::value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
{
- return (byte*) enum_names->type_names[*value];
+ return (uchar*) enum_names->type_names[*value];
}
bool sys_var_thd_ulong::check(THD *thd, set_var *var)
@@ -1573,12 +1232,12 @@ void sys_var_thd_ulong::set_default(THD *thd, enum_var_type type)
}
-byte *sys_var_thd_ulong::value_ptr(THD *thd, enum_var_type type,
+uchar *sys_var_thd_ulong::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base)
{
if (type == OPT_GLOBAL)
- return (byte*) &(global_system_variables.*offset);
- return (byte*) &(thd->variables.*offset);
+ return (uchar*) &(global_system_variables.*offset);
+ return (uchar*) &(thd->variables.*offset);
}
@@ -1619,12 +1278,12 @@ void sys_var_thd_ha_rows::set_default(THD *thd, enum_var_type type)
}
-byte *sys_var_thd_ha_rows::value_ptr(THD *thd, enum_var_type type,
+uchar *sys_var_thd_ha_rows::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base)
{
if (type == OPT_GLOBAL)
- return (byte*) &(global_system_variables.*offset);
- return (byte*) &(thd->variables.*offset);
+ return (uchar*) &(global_system_variables.*offset);
+ return (uchar*) &(thd->variables.*offset);
}
bool sys_var_thd_ulonglong::update(THD *thd, set_var *var)
@@ -1662,12 +1321,12 @@ void sys_var_thd_ulonglong::set_default(THD *thd, enum_var_type type)
}
-byte *sys_var_thd_ulonglong::value_ptr(THD *thd, enum_var_type type,
+uchar *sys_var_thd_ulonglong::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base)
{
if (type == OPT_GLOBAL)
- return (byte*) &(global_system_variables.*offset);
- return (byte*) &(thd->variables.*offset);
+ return (uchar*) &(global_system_variables.*offset);
+ return (uchar*) &(thd->variables.*offset);
}
@@ -1690,12 +1349,12 @@ void sys_var_thd_bool::set_default(THD *thd, enum_var_type type)
}
-byte *sys_var_thd_bool::value_ptr(THD *thd, enum_var_type type,
+uchar *sys_var_thd_bool::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base)
{
if (type == OPT_GLOBAL)
- return (byte*) &(global_system_variables.*offset);
- return (byte*) &(thd->variables.*offset);
+ return (uchar*) &(global_system_variables.*offset);
+ return (uchar*) &(thd->variables.*offset);
}
@@ -1827,6 +1486,15 @@ Item *sys_var::item(THD *thd, enum_var_type var_type, LEX_STRING *base)
pthread_mutex_unlock(&LOCK_global_system_variables);
return new Item_int(value);
}
+ case SHOW_DOUBLE:
+ {
+ double value;
+ pthread_mutex_lock(&LOCK_global_system_variables);
+ value= *(double*) value_ptr(thd, var_type, base);
+ pthread_mutex_unlock(&LOCK_global_system_variables);
+ /* 6, as this is for now only used with microseconds */
+ return new Item_float(value, 6);
+ }
case SHOW_HA_ROWS:
{
ha_rows value;
@@ -1836,7 +1504,32 @@ Item *sys_var::item(THD *thd, enum_var_type var_type, LEX_STRING *base)
return new Item_int((longlong) value);
}
case SHOW_MY_BOOL:
- return new Item_int((int32) *(my_bool*) value_ptr(thd, var_type, base),1);
+ {
+ int32 value;
+ pthread_mutex_lock(&LOCK_global_system_variables);
+ value= *(my_bool*) value_ptr(thd, var_type, base);
+ pthread_mutex_unlock(&LOCK_global_system_variables);
+ return new Item_int(value,1);
+ }
+ case SHOW_CHAR_PTR:
+ {
+ Item *tmp;
+ pthread_mutex_lock(&LOCK_global_system_variables);
+ char *str= *(char**) value_ptr(thd, var_type, base);
+ if (str)
+ {
+ uint length= strlen(str);
+ tmp= new Item_string(thd->strmake(str, length), length,
+ system_charset_info, DERIVATION_SYSCONST);
+ }
+ else
+ {
+ tmp= new Item_null();
+ tmp->collation.set(system_charset_info, DERIVATION_SYSCONST);
+ }
+ pthread_mutex_unlock(&LOCK_global_system_variables);
+ return tmp;
+ }
case SHOW_CHAR:
{
Item *tmp;
@@ -1879,13 +1572,13 @@ void sys_var_thd_enum::set_default(THD *thd, enum_var_type type)
}
-byte *sys_var_thd_enum::value_ptr(THD *thd, enum_var_type type,
+uchar *sys_var_thd_enum::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base)
{
ulong tmp= ((type == OPT_GLOBAL) ?
global_system_variables.*offset :
thd->variables.*offset);
- return (byte*) enum_names->type_names[tmp];
+ return (uchar*) enum_names->type_names[tmp];
}
bool sys_var_thd_bit::check(THD *thd, set_var *var)
@@ -1901,7 +1594,7 @@ bool sys_var_thd_bit::update(THD *thd, set_var *var)
}
-byte *sys_var_thd_bit::value_ptr(THD *thd, enum_var_type type,
+uchar *sys_var_thd_bit::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base)
{
/*
@@ -1910,7 +1603,7 @@ byte *sys_var_thd_bit::value_ptr(THD *thd, enum_var_type type,
*/
thd->sys_var_tmp.my_bool_value= ((thd->options & bit_flag) ?
!reverse : reverse);
- return (byte*) &thd->sys_var_tmp.my_bool_value;
+ return (uchar*) &thd->sys_var_tmp.my_bool_value;
}
@@ -1921,7 +1614,7 @@ void sys_var_thd_date_time_format::update2(THD *thd, enum_var_type type,
{
DATE_TIME_FORMAT *old;
DBUG_ENTER("sys_var_date_time_format::update2");
- DBUG_DUMP("positions",(char*) new_value->positions,
+ DBUG_DUMP("positions", (uchar*) new_value->positions,
sizeof(new_value->positions));
if (type == OPT_GLOBAL)
@@ -2001,7 +1694,7 @@ void sys_var_thd_date_time_format::set_default(THD *thd, enum_var_type type)
}
-byte *sys_var_thd_date_time_format::value_ptr(THD *thd, enum_var_type type,
+uchar *sys_var_thd_date_time_format::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base)
{
if (type == OPT_GLOBAL)
@@ -2014,9 +1707,9 @@ byte *sys_var_thd_date_time_format::value_ptr(THD *thd, enum_var_type type,
*/
res= thd->strmake((global_system_variables.*offset)->format.str,
(global_system_variables.*offset)->format.length);
- return (byte*) res;
+ return (uchar*) res;
}
- return (byte*) (thd->variables.*offset)->format.str;
+ return (uchar*) (thd->variables.*offset)->format.str;
}
@@ -2137,130 +1830,33 @@ bool sys_var_character_set::update(THD *thd, set_var *var)
}
-byte *sys_var_character_set::value_ptr(THD *thd, enum_var_type type,
+uchar *sys_var_character_set::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base)
{
CHARSET_INFO *cs= ci_ptr(thd,type)[0];
- return cs ? (byte*) cs->csname : (byte*) NULL;
-}
-
-
-CHARSET_INFO ** sys_var_character_set_connection::ci_ptr(THD *thd,
- enum_var_type type)
-{
- if (type == OPT_GLOBAL)
- return &global_system_variables.collation_connection;
- else
- return &thd->variables.collation_connection;
-}
-
-
-void sys_var_character_set_connection::set_default(THD *thd,
- enum_var_type type)
-{
- if (type == OPT_GLOBAL)
- global_system_variables.collation_connection= default_charset_info;
- else
- {
- thd->variables.collation_connection= global_system_variables.collation_connection;
- thd->update_charset();
- }
-}
-
-
-CHARSET_INFO ** sys_var_character_set_client::ci_ptr(THD *thd,
- enum_var_type type)
-{
- if (type == OPT_GLOBAL)
- return &global_system_variables.character_set_client;
- else
- return &thd->variables.character_set_client;
-}
-
-
-void sys_var_character_set_client::set_default(THD *thd, enum_var_type type)
-{
- if (type == OPT_GLOBAL)
- global_system_variables.character_set_client= default_charset_info;
- else
- {
- thd->variables.character_set_client= (global_system_variables.
- character_set_client);
- thd->update_charset();
- }
-}
-
-
-CHARSET_INFO **
-sys_var_character_set_filesystem::ci_ptr(THD *thd, enum_var_type type)
-{
- if (type == OPT_GLOBAL)
- return &global_system_variables.character_set_filesystem;
- else
- return &thd->variables.character_set_filesystem;
-}
-
-
-extern CHARSET_INFO *character_set_filesystem;
-
-void
-sys_var_character_set_filesystem::set_default(THD *thd, enum_var_type type)
-{
- if (type == OPT_GLOBAL)
- global_system_variables.character_set_filesystem= character_set_filesystem;
- else
- {
- thd->variables.character_set_filesystem= (global_system_variables.
- character_set_filesystem);
- thd->update_charset();
- }
+ return cs ? (uchar*) cs->csname : (uchar*) NULL;
}
-CHARSET_INFO **
-sys_var_character_set_results::ci_ptr(THD *thd, enum_var_type type)
+void sys_var_character_set_sv::set_default(THD *thd, enum_var_type type)
{
if (type == OPT_GLOBAL)
- return &global_system_variables.character_set_results;
+ global_system_variables.*offset= *global_default;
else
- return &thd->variables.character_set_results;
-}
-
-
-void sys_var_character_set_results::set_default(THD *thd, enum_var_type type)
-{
- if (type == OPT_GLOBAL)
- global_system_variables.character_set_results= default_charset_info;
- else
- {
- thd->variables.character_set_results= (global_system_variables.
- character_set_results);
- thd->update_charset();
- }
+ {
+ thd->variables.*offset= global_system_variables.*offset;
+ thd->update_charset();
+ }
}
-
-
-CHARSET_INFO **
-sys_var_character_set_server::ci_ptr(THD *thd, enum_var_type type)
+CHARSET_INFO **sys_var_character_set_sv::ci_ptr(THD *thd, enum_var_type type)
{
if (type == OPT_GLOBAL)
- return &global_system_variables.collation_server;
+ return &(global_system_variables.*offset);
else
- return &thd->variables.collation_server;
+ return &(thd->variables.*offset);
}
-void sys_var_character_set_server::set_default(THD *thd, enum_var_type type)
-{
- if (type == OPT_GLOBAL)
- global_system_variables.collation_server= default_charset_info;
- else
- {
- thd->variables.collation_server= global_system_variables.collation_server;
- thd->update_charset();
- }
-}
-
CHARSET_INFO ** sys_var_character_set_database::ci_ptr(THD *thd,
enum_var_type type)
{
@@ -2283,110 +1879,37 @@ void sys_var_character_set_database::set_default(THD *thd, enum_var_type type)
}
-bool sys_var_collation_connection::update(THD *thd, set_var *var)
+bool sys_var_collation_sv::update(THD *thd, set_var *var)
{
if (var->type == OPT_GLOBAL)
- global_system_variables.collation_connection= var->save_result.charset;
+ global_system_variables.*offset= var->save_result.charset;
else
{
- thd->variables.collation_connection= var->save_result.charset;
+ thd->variables.*offset= var->save_result.charset;
thd->update_charset();
}
return 0;
}
-byte *sys_var_collation_connection::value_ptr(THD *thd, enum_var_type type,
- LEX_STRING *base)
-{
- CHARSET_INFO *cs= ((type == OPT_GLOBAL) ?
- global_system_variables.collation_connection :
- thd->variables.collation_connection);
- return cs ? (byte*) cs->name : (byte*) "NULL";
-}
-
-
-void sys_var_collation_connection::set_default(THD *thd, enum_var_type type)
+void sys_var_collation_sv::set_default(THD *thd, enum_var_type type)
{
- if (type == OPT_GLOBAL)
- global_system_variables.collation_connection= default_charset_info;
- else
- {
- thd->variables.collation_connection= (global_system_variables.
- collation_connection);
- thd->update_charset();
- }
-}
-
-bool sys_var_collation_database::update(THD *thd, set_var *var)
-{
- if (var->type == OPT_GLOBAL)
- global_system_variables.collation_database= var->save_result.charset;
- else
- {
- thd->variables.collation_database= var->save_result.charset;
- thd->update_charset();
- }
- return 0;
-}
-
-
-byte *sys_var_collation_database::value_ptr(THD *thd, enum_var_type type,
- LEX_STRING *base)
-{
- CHARSET_INFO *cs= ((type == OPT_GLOBAL) ?
- global_system_variables.collation_database :
- thd->variables.collation_database);
- return cs ? (byte*) cs->name : (byte*) "NULL";
-}
-
-
-void sys_var_collation_database::set_default(THD *thd, enum_var_type type)
-{
- if (type == OPT_GLOBAL)
- global_system_variables.collation_database= default_charset_info;
- else
- {
- thd->variables.collation_database= (global_system_variables.
- collation_database);
- thd->update_charset();
- }
-}
-
-
-bool sys_var_collation_server::update(THD *thd, set_var *var)
-{
- if (var->type == OPT_GLOBAL)
- global_system_variables.collation_server= var->save_result.charset;
+ if (type == OPT_GLOBAL)
+ global_system_variables.*offset= *global_default;
else
{
- thd->variables.collation_server= var->save_result.charset;
+ thd->variables.*offset= global_system_variables.*offset;
thd->update_charset();
}
- return 0;
}
-byte *sys_var_collation_server::value_ptr(THD *thd, enum_var_type type,
- LEX_STRING *base)
+uchar *sys_var_collation_sv::value_ptr(THD *thd, enum_var_type type,
+ LEX_STRING *base)
{
CHARSET_INFO *cs= ((type == OPT_GLOBAL) ?
- global_system_variables.collation_server :
- thd->variables.collation_server);
- return cs ? (byte*) cs->name : (byte*) "NULL";
-}
-
-
-void sys_var_collation_server::set_default(THD *thd, enum_var_type type)
-{
- if (type == OPT_GLOBAL)
- global_system_variables.collation_server= default_charset_info;
- else
- {
- thd->variables.collation_server= (global_system_variables.
- collation_server);
- thd->update_charset();
- }
+ global_system_variables.*offset : thd->variables.*offset);
+ return cs ? (uchar*) cs->name : (uchar*) "NULL";
}
@@ -2404,13 +1927,13 @@ KEY_CACHE *get_key_cache(LEX_STRING *cache_name)
}
-byte *sys_var_key_cache_param::value_ptr(THD *thd, enum_var_type type,
+uchar *sys_var_key_cache_param::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base)
{
KEY_CACHE *key_cache= get_key_cache(base);
if (!key_cache)
key_cache= &zero_key_cache;
- return (byte*) key_cache + offset ;
+ return (uchar*) key_cache + offset ;
}
@@ -2552,21 +2075,15 @@ end:
bool sys_var_log_state::update(THD *thd, set_var *var)
{
- bool res= 0;
+ bool res;
pthread_mutex_lock(&LOCK_global_system_variables);
if (!var->save_result.ulong_value)
- logger.deactivate_log_handler(thd, log_type);
- else
{
- if ((res= logger.activate_log_handler(thd, log_type)))
- {
- my_error(ER_CANT_ACTIVATE_LOG, MYF(0),
- log_type == QUERY_LOG_GENERAL ? "general" :
- "slow query");
- goto err;
- }
+ logger.deactivate_log_handler(thd, log_type);
+ res= false;
}
-err:
+ else
+ res= logger.activate_log_handler(thd, log_type);
pthread_mutex_unlock(&LOCK_global_system_variables);
return res;
}
@@ -2596,11 +2113,12 @@ static int sys_check_log_path(THD *thd, set_var *var)
}
else
{
+ size_t path_length;
/*
Check if directory exists and
we have permission to create file & write to file
*/
- (void) dirname_part(path, var_path);
+ (void) dirname_part(path, var_path, &path_length);
if (my_access(path, (F_OK|W_OK)))
return -1;
}
@@ -2641,7 +2159,7 @@ bool update_sys_var_str_path(THD *thd, sys_var_str *var_str,
}
pthread_mutex_lock(&LOCK_global_system_variables);
- logger.lock();
+ logger.lock_exclusive();
if (file_log && log_state)
file_log->close(0);
@@ -2704,7 +2222,7 @@ static void sys_default_slow_log_path(THD *thd, enum_var_type type)
bool sys_var_log_output::update(THD *thd, set_var *var)
{
pthread_mutex_lock(&LOCK_global_system_variables);
- logger.lock();
+ logger.lock_exclusive();
logger.init_slow_log(var->save_result.ulong_value);
logger.init_general_log(var->save_result.ulong_value);
*value= var->save_result.ulong_value;
@@ -2717,16 +2235,16 @@ bool sys_var_log_output::update(THD *thd, set_var *var)
void sys_var_log_output::set_default(THD *thd, enum_var_type type)
{
pthread_mutex_lock(&LOCK_global_system_variables);
- logger.lock();
- logger.init_slow_log(LOG_TABLE);
- logger.init_general_log(LOG_TABLE);
- *value= LOG_TABLE;
+ logger.lock_exclusive();
+ logger.init_slow_log(LOG_FILE);
+ logger.init_general_log(LOG_FILE);
+ *value= LOG_FILE;
logger.unlock();
pthread_mutex_unlock(&LOCK_global_system_variables);
}
-byte *sys_var_log_output::value_ptr(THD *thd, enum_var_type type,
+uchar *sys_var_log_output::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base)
{
char buff[256];
@@ -2747,7 +2265,7 @@ byte *sys_var_log_output::value_ptr(THD *thd, enum_var_type type,
if ((length= tmp.length()))
length--;
- return (byte*) thd->strmake(tmp.ptr(), length);
+ return (uchar*) thd->strmake(tmp.ptr(), length);
}
@@ -2786,11 +2304,11 @@ void sys_var_timestamp::set_default(THD *thd, enum_var_type type)
}
-byte *sys_var_timestamp::value_ptr(THD *thd, enum_var_type type,
+uchar *sys_var_timestamp::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base)
{
thd->sys_var_tmp.long_value= (long) thd->start_time;
- return (byte*) &thd->sys_var_tmp.long_value;
+ return (uchar*) &thd->sys_var_tmp.long_value;
}
@@ -2802,7 +2320,7 @@ bool sys_var_last_insert_id::update(THD *thd, set_var *var)
}
-byte *sys_var_last_insert_id::value_ptr(THD *thd, enum_var_type type,
+uchar *sys_var_last_insert_id::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base)
{
/*
@@ -2811,7 +2329,7 @@ byte *sys_var_last_insert_id::value_ptr(THD *thd, enum_var_type type,
*/
thd->sys_var_tmp.ulonglong_value=
thd->read_first_successful_insert_id_in_prev_stmt();
- return (byte*) &thd->sys_var_tmp.ulonglong_value;
+ return (uchar*) &thd->sys_var_tmp.ulonglong_value;
}
@@ -2822,61 +2340,15 @@ bool sys_var_insert_id::update(THD *thd, set_var *var)
}
-byte *sys_var_insert_id::value_ptr(THD *thd, enum_var_type type,
+uchar *sys_var_insert_id::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base)
{
thd->sys_var_tmp.ulonglong_value=
thd->auto_inc_intervals_forced.minimum();
- return (byte*) &thd->sys_var_tmp.ulonglong_value;
-}
-
-
-#ifdef HAVE_REPLICATION
-bool sys_var_slave_skip_counter::check(THD *thd, set_var *var)
-{
- int result= 0;
- pthread_mutex_lock(&LOCK_active_mi);
- pthread_mutex_lock(&active_mi->rli.run_lock);
- if (active_mi->rli.slave_running)
- {
- my_message(ER_SLAVE_MUST_STOP, ER(ER_SLAVE_MUST_STOP), MYF(0));
- result=1;
- }
- pthread_mutex_unlock(&active_mi->rli.run_lock);
- pthread_mutex_unlock(&LOCK_active_mi);
- var->save_result.ulong_value= (ulong) var->value->val_int();
- return result;
-}
-
-
-bool sys_var_slave_skip_counter::update(THD *thd, set_var *var)
-{
- pthread_mutex_lock(&LOCK_active_mi);
- pthread_mutex_lock(&active_mi->rli.run_lock);
- /*
- The following test should normally never be true as we test this
- in the check function; To be safe against multiple
- SQL_SLAVE_SKIP_COUNTER request, we do the check anyway
- */
- if (!active_mi->rli.slave_running)
- {
- pthread_mutex_lock(&active_mi->rli.data_lock);
- active_mi->rli.slave_skip_counter= var->save_result.ulong_value;
- pthread_mutex_unlock(&active_mi->rli.data_lock);
- }
- pthread_mutex_unlock(&active_mi->rli.run_lock);
- pthread_mutex_unlock(&LOCK_active_mi);
- return 0;
+ return (uchar*) &thd->sys_var_tmp.ulonglong_value;
}
-bool sys_var_sync_binlog_period::update(THD *thd, set_var *var)
-{
- sync_binlog_period= (ulong) var->save_result.ulonglong_value;
- return 0;
-}
-#endif /* HAVE_REPLICATION */
-
bool sys_var_rand_seed1::update(THD *thd, set_var *var)
{
thd->rand.seed1= (ulong) var->save_result.ulonglong_value;
@@ -2920,7 +2392,7 @@ bool sys_var_thd_time_zone::update(THD *thd, set_var *var)
}
-byte *sys_var_thd_time_zone::value_ptr(THD *thd, enum_var_type type,
+uchar *sys_var_thd_time_zone::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base)
{
/*
@@ -2928,7 +2400,7 @@ byte *sys_var_thd_time_zone::value_ptr(THD *thd, enum_var_type type,
time zone name is guaranteed to be zero ended.
*/
if (type == OPT_GLOBAL)
- return (byte *)(global_system_variables.time_zone->get_name()->ptr());
+ return (uchar *)(global_system_variables.time_zone->get_name()->ptr());
else
{
/*
@@ -2940,7 +2412,7 @@ byte *sys_var_thd_time_zone::value_ptr(THD *thd, enum_var_type type,
(binlog code stores session value only).
*/
thd->time_zone_used= 1;
- return (byte *)(thd->variables.time_zone->get_name()->ptr());
+ return (uchar *)(thd->variables.time_zone->get_name()->ptr());
}
}
@@ -3002,13 +2474,13 @@ void sys_var_max_user_conn::set_default(THD *thd, enum_var_type type)
}
-byte *sys_var_max_user_conn::value_ptr(THD *thd, enum_var_type type,
+uchar *sys_var_max_user_conn::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base)
{
if (type != OPT_GLOBAL &&
thd->user_connect && thd->user_connect->user_resources.user_conn)
- return (byte*) &(thd->user_connect->user_resources.user_conn);
- return (byte*) &(max_user_connections);
+ return (uchar*) &(thd->user_connect->user_resources.user_conn);
+ return (uchar*) &(max_user_connections);
}
@@ -3059,12 +2531,12 @@ bool sys_var_thd_lc_time_names::update(THD *thd, set_var *var)
}
-byte *sys_var_thd_lc_time_names::value_ptr(THD *thd, enum_var_type type,
+uchar *sys_var_thd_lc_time_names::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base)
{
return type == OPT_GLOBAL ?
- (byte *) global_system_variables.lc_time_names->name :
- (byte *) thd->variables.lc_time_names->name;
+ (uchar *) global_system_variables.lc_time_names->name :
+ (uchar *) thd->variables.lc_time_names->name;
}
@@ -3077,6 +2549,60 @@ void sys_var_thd_lc_time_names::set_default(THD *thd, enum_var_type type)
}
/*
+ Handling of microseoncds given as seconds.part_seconds
+
+ NOTES
+ The argument to long query time is in seconds in decimal
+ which is converted to ulonglong integer holding microseconds for storage.
+ This is used for handling long_query_time
+*/
+
+bool sys_var_microseconds::update(THD *thd, set_var *var)
+{
+ double num= var->value->val_real();
+ longlong microseconds;
+ if (num > (double) option_limits->max_value)
+ num= (double) option_limits->max_value;
+ if (num < (double) option_limits->min_value)
+ num= (double) option_limits->min_value;
+ microseconds= (longlong) (num * 1000000.0 + 0.5);
+ if (var->type == OPT_GLOBAL)
+ {
+ pthread_mutex_lock(&LOCK_global_system_variables);
+ (global_system_variables.*offset)= microseconds;
+ pthread_mutex_unlock(&LOCK_global_system_variables);
+ }
+ else
+ thd->variables.*offset= microseconds;
+ return 0;
+}
+
+
+void sys_var_microseconds::set_default(THD *thd, enum_var_type type)
+{
+ longlong microseconds= (longlong) (option_limits->def_value * 1000000.0);
+ if (type == OPT_GLOBAL)
+ {
+ pthread_mutex_lock(&LOCK_global_system_variables);
+ global_system_variables.*offset= microseconds;
+ pthread_mutex_unlock(&LOCK_global_system_variables);
+ }
+ else
+ thd->variables.*offset= microseconds;
+}
+
+
+uchar *sys_var_microseconds::value_ptr(THD *thd, enum_var_type type,
+ LEX_STRING *base)
+{
+ thd->tmp_double_value= (double) ((type == OPT_GLOBAL) ?
+ global_system_variables.*offset :
+ thd->variables.*offset) / 1000000.0;
+ return (uchar*) &thd->tmp_double_value;
+}
+
+
+/*
Functions to update thd->options bits
*/
@@ -3108,14 +2634,14 @@ static bool set_option_autocommit(THD *thd, set_var *var)
{
/* We changed to auto_commit mode */
thd->options&= ~(ulonglong) (OPTION_BEGIN | OPTION_KEEP_LOG);
- thd->no_trans_update.all= FALSE;
+ thd->transaction.all.modified_non_trans_table= FALSE;
thd->server_status|= SERVER_STATUS_AUTOCOMMIT;
if (ha_commit(thd))
return 1;
}
else
{
- thd->no_trans_update.all= FALSE;
+ thd->transaction.all.modified_non_trans_table= FALSE;
thd->server_status&= ~SERVER_STATUS_AUTOCOMMIT;
}
}
@@ -3173,20 +2699,20 @@ static int check_pseudo_thread_id(THD *thd, set_var *var)
#endif
}
-static byte *get_warning_count(THD *thd)
+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]);
- return (byte*) &thd->sys_var_tmp.long_value;
+ return (uchar*) &thd->sys_var_tmp.long_value;
}
-static byte *get_error_count(THD *thd)
+static uchar *get_error_count(THD *thd)
{
thd->sys_var_tmp.long_value=
thd->warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_ERROR];
- return (byte*) &thd->sys_var_tmp.long_value;
+ return (uchar*) &thd->sys_var_tmp.long_value;
}
@@ -3207,11 +2733,11 @@ static byte *get_error_count(THD *thd)
RETURN VALUES
ptr pointer to NUL-terminated string
*/
-static byte *get_tmpdir(THD *thd)
+static uchar *get_tmpdir(THD *thd)
{
if (opt_mysql_tmpdir)
- return (byte *)opt_mysql_tmpdir;
- return (byte*)mysql_tmpdir;
+ return (uchar *)opt_mysql_tmpdir;
+ return (uchar*)mysql_tmpdir;
}
/****************************************************************************
@@ -3257,31 +2783,161 @@ static struct my_option *find_option(struct my_option *opt, const char *name)
Return variable name and length for hashing of variables
*/
-static byte *get_sys_var_length(const sys_var *var, uint *length,
- my_bool first)
+static uchar *get_sys_var_length(const sys_var *var, size_t *length,
+ my_bool first)
{
*length= var->name_length;
- return (byte*) var->name;
+ return (uchar*) var->name;
}
/*
- Initialises sys variables and put them in system_variable_hash
+ Add variables to the dynamic hash of system variables
+
+ SYNOPSIS
+ mysql_add_sys_var_chain()
+ first Pointer to first system variable to add
+ long_opt (optional)command line arguments may be tied for limit checks.
+
+ RETURN VALUES
+ 0 SUCCESS
+ otherwise FAILURE
*/
-void set_var_init()
+int mysql_add_sys_var_chain(sys_var *first, struct my_option *long_options)
{
sys_var *var;
-
- hash_init(&system_variable_hash, system_charset_info, sys_var::sys_vars, 0,
- 0, (hash_get_key) get_sys_var_length, 0, 0);
- for (var= sys_var::first; var; var= var->next)
+
+ /* A write lock should be held on LOCK_system_variables_hash */
+
+ for (var= first; var; var= var->next)
{
var->name_length= strlen(var->name);
- var->option_limits= find_option(my_long_options, var->name);
- my_hash_insert(&system_variable_hash, (byte*) var);
+ /* this fails if there is a conflicting variable name. see HASH_UNIQUE */
+ if (my_hash_insert(&system_variable_hash, (uchar*) var))
+ goto error;
+ if (long_options)
+ var->option_limits= find_option(long_options, var->name);
+ }
+ return 0;
+
+error:
+ for (; first != var; first= first->next)
+ hash_delete(&system_variable_hash, (uchar*) first);
+ return 1;
+}
+
+
+/*
+ Remove variables to the dynamic hash of system variables
+
+ SYNOPSIS
+ mysql_del_sys_var_chain()
+ first Pointer to first system variable to remove
+
+ RETURN VALUES
+ 0 SUCCESS
+ otherwise FAILURE
+*/
+
+int mysql_del_sys_var_chain(sys_var *first)
+{
+ int result= 0;
+
+ /* 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);
+
+ return result;
+}
+
+
+static int show_cmp(SHOW_VAR *a, SHOW_VAR *b)
+{
+ return strcmp(a->name, b->name);
+}
+
+
+/*
+ Constructs an array of system variables for display to the user.
+
+ SYNOPSIS
+ enumerate_sys_vars()
+ thd current thread
+ sorted If TRUE, the system variables should be sorted
+
+ RETURN VALUES
+ pointer Array of SHOW_VAR elements for display
+ NULL FAILURE
+*/
+
+SHOW_VAR* enumerate_sys_vars(THD *thd, bool sorted)
+{
+ int count= system_variable_hash.records, i;
+ int fixed_count= fixed_show_vars.elements;
+ int size= sizeof(SHOW_VAR) * (count + fixed_count + 1);
+ SHOW_VAR *result= (SHOW_VAR*) thd->alloc(size);
+
+ if (result)
+ {
+ SHOW_VAR *show= result + fixed_count;
+ memcpy(result, fixed_show_vars.buffer, fixed_count * sizeof(SHOW_VAR));
+
+ for (i= 0; i < count; i++)
+ {
+ sys_var *var= (sys_var*) hash_element(&system_variable_hash, i);
+ show->name= var->name;
+ show->value= (char*) var;
+ show->type= SHOW_SYS;
+ show++;
+ }
+
+ /* sort into order */
+ if (sorted)
+ qsort(result, count + fixed_count, sizeof(SHOW_VAR), (qsort_cmp)show_cmp);
+
+ /* make last element empty */
+ bzero(show, sizeof(SHOW_VAR));
}
+ return result;
+}
+
+
+/*
+ Initialize the system variables
+
+ SYNOPSIS
+ set_var_init()
+
+ RETURN VALUES
+ 0 SUCCESS
+ otherwise FAILURE
+*/
+
+int set_var_init()
+{
+ uint count= 0;
+ DBUG_ENTER("set_var_init");
+
+ for (sys_var *var=vars.first; var; var= var->next, count++);
+
+ if (my_init_dynamic_array(&fixed_show_vars, sizeof(SHOW_VAR),
+ FIXED_VARS_SIZE + 64, 64))
+ goto error;
+
+ fixed_show_vars.elements= FIXED_VARS_SIZE;
+ memcpy(fixed_show_vars.buffer, fixed_vars, sizeof(fixed_vars));
+
+ if (hash_init(&system_variable_hash, system_charset_info, count, 0,
+ 0, (hash_get_key) get_sys_var_length, 0, HASH_UNIQUE))
+ goto error;
+
+ vars.last->next= NULL;
+ if (mysql_add_sys_var_chain(vars.first, my_long_options))
+ goto error;
+
/*
Special cases
Needed because MySQL can't find the limits for a variable it it has
@@ -3289,12 +2945,40 @@ void set_var_init()
As these variables are deprecated, this code will disappear soon...
*/
sys_sql_max_join_size.option_limits= sys_max_join_size.option_limits;
+
+ DBUG_RETURN(0);
+
+error:
+ fprintf(stderr, "failed to initialize system variables");
+ DBUG_RETURN(1);
}
void set_var_free()
{
hash_free(&system_variable_hash);
+ delete_dynamic(&fixed_show_vars);
+}
+
+
+/*
+ Add elements to the dynamic list of read-only system variables.
+
+ SYNOPSIS
+ mysql_append_static_vars()
+ show_vars Pointer to start of array
+ count Number of elements
+
+ RETURN VALUES
+ 0 SUCCESS
+ otherwise FAILURE
+*/
+int mysql_append_static_vars(const SHOW_VAR *show_vars, uint count)
+{
+ for (; count > 0; count--, show_vars++)
+ if (insert_dynamic(&fixed_show_vars, (uchar*) show_vars))
+ return 1;
+ return 0;
}
@@ -3302,7 +2986,7 @@ void set_var_free()
Find a user set-table variable
SYNOPSIS
- find_sys_var()
+ intern_find_sys_var()
str Name of system variable to find
length Length of variable. zero means that we should use strlen()
on the variable
@@ -3312,14 +2996,19 @@ void set_var_free()
0 Unknown variable (error message is given)
*/
-sys_var *find_sys_var(const char *str, uint length)
+sys_var *intern_find_sys_var(const char *str, uint length, bool no_error)
{
- sys_var *var= (sys_var*) hash_search(&system_variable_hash,
- (byte*) str,
- length ? length :
- strlen(str));
- if (!var)
+ sys_var *var;
+
+ /*
+ 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,
+ (uchar*) str, length ? length : strlen(str));
+ if (!(var || no_error))
my_error(ER_UNKNOWN_SYSTEM_VARIABLE, MYF(0), (char*) str);
+
return var;
}
@@ -3585,14 +3274,17 @@ bool sys_var_thd_storage_engine::check(THD *thd, set_var *var)
const char *value;
String str(buff, sizeof(buff), &my_charset_latin1), *res;
+ var->save_result.plugin= NULL;
if (var->value->result_type() == STRING_RESULT)
{
- LEX_STRING name;
- handlerton *db_type;
+ LEX_STRING engine_name;
+ handlerton *hton;
if (!(res=var->value->val_str(&str)) ||
- !(name.str= (char *)res->ptr()) || !(name.length= res->length()) ||
- !(var->save_result.hton= db_type= ha_resolve_by_name(thd, &name)) ||
- ha_checktype(thd, ha_legacy_type(db_type), 1, 0) != db_type)
+ !(engine_name.str= (char *)res->ptr()) ||
+ !(engine_name.length= res->length()) ||
+ !(var->save_result.plugin= ha_resolve_by_name(thd, &engine_name)) ||
+ !(hton= plugin_data(var->save_result.plugin, handlerton *)) ||
+ ha_checktype(thd, ha_legacy_type(hton), 1, 0) != hton)
{
value= res ? res->c_ptr() : "NULL";
goto err;
@@ -3607,31 +3299,55 @@ err:
}
-byte *sys_var_thd_storage_engine::value_ptr(THD *thd, enum_var_type type,
+uchar *sys_var_thd_storage_engine::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base)
{
- handlerton *val;
- val= (type == OPT_GLOBAL) ? global_system_variables.*offset :
- thd->variables.*offset;
- return (byte *) hton2plugin[val->slot]->name.str;
+ uchar* result;
+ handlerton *hton;
+ LEX_STRING *engine_name;
+ plugin_ref plugin= thd->variables.*offset;
+ if (type == OPT_GLOBAL)
+ plugin= my_plugin_lock(thd, &(global_system_variables.*offset));
+ hton= plugin_data(plugin, handlerton*);
+ engine_name= &hton2plugin[hton->slot]->name;
+ result= (uchar *) thd->strmake(engine_name->str, engine_name->length);
+ if (type == OPT_GLOBAL)
+ plugin_unlock(thd, plugin);
+ return result;
}
void sys_var_thd_storage_engine::set_default(THD *thd, enum_var_type type)
{
+ plugin_ref old_value, new_value, *value;
if (type == OPT_GLOBAL)
- global_system_variables.*offset= myisam_hton;
+ {
+ value= &(global_system_variables.*offset);
+ new_value= ha_lock_engine(NULL, myisam_hton);
+ }
else
- thd->variables.*offset= global_system_variables.*offset;
+ {
+ value= &(thd->variables.*offset);
+ new_value= my_plugin_lock(NULL, &(global_system_variables.*offset));
+ }
+ DBUG_ASSERT(new_value);
+ old_value= *value;
+ *value= new_value;
+ plugin_unlock(NULL, old_value);
}
bool sys_var_thd_storage_engine::update(THD *thd, set_var *var)
{
- handlerton **value= &(global_system_variables.*offset);
- if (var->type != OPT_GLOBAL)
- value= &(thd->variables.*offset);
- *value= var->save_result.hton;
+ plugin_ref *value= &(global_system_variables.*offset), old_value;
+ if (var->type != OPT_GLOBAL)
+ value= &(thd->variables.*offset);
+ old_value= *value;
+ if (old_value != var->save_result.plugin)
+ {
+ *value= my_plugin_lock(NULL, &var->save_result.plugin);
+ plugin_unlock(NULL, old_value);
+ }
return 0;
}
@@ -3696,14 +3412,14 @@ symbolic_mode_representation(THD *thd, ulonglong val, LEX_STRING *rep)
}
-byte *sys_var_thd_sql_mode::value_ptr(THD *thd, enum_var_type type,
+uchar *sys_var_thd_sql_mode::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base)
{
LEX_STRING sql_mode;
ulonglong val= ((type == OPT_GLOBAL) ? global_system_variables.*offset :
thd->variables.*offset);
(void) symbolic_mode_representation(thd, val, &sql_mode);
- return (byte *) sql_mode.str;
+ return (uchar *) sql_mode.str;
}
@@ -3794,7 +3510,7 @@ ulong fix_sql_mode(ulong sql_mode)
Named list handling
****************************************************************************/
-gptr find_named(I_List<NAMED_LIST> *list, const char *name, uint length,
+uchar* find_named(I_List<NAMED_LIST> *list, const char *name, uint length,
NAMED_LIST **found)
{
I_List_iterator<NAMED_LIST> it(*list);
@@ -3813,7 +3529,7 @@ gptr find_named(I_List<NAMED_LIST> *list, const char *name, uint length,
void delete_elements(I_List<NAMED_LIST> *list,
- void (*free_element)(const char *name, gptr))
+ void (*free_element)(const char *name, uchar*))
{
NAMED_LIST *element;
DBUG_ENTER("delete_elements");
@@ -3837,7 +3553,7 @@ static KEY_CACHE *create_key_cache(const char *name, uint length)
if ((key_cache= (KEY_CACHE*) my_malloc(sizeof(KEY_CACHE),
MYF(MY_ZEROFILL | MY_WME))))
{
- if (!new NAMED_LIST(&key_caches, name, length, (gptr) key_cache))
+ if (!new NAMED_LIST(&key_caches, name, length, (uchar*) key_cache))
{
my_free((char*) key_cache, MYF(0));
key_cache= 0;
@@ -3881,7 +3597,7 @@ void free_key_cache(const char *name, KEY_CACHE *key_cache)
}
-bool process_key_caches(int (* func) (const char *name, KEY_CACHE *))
+bool process_key_caches(process_key_cache_t func)
{
I_List_iterator<NAMED_LIST> it(key_caches);
NAMED_LIST *element;
@@ -3996,14 +3712,14 @@ bool sys_var_thd_dbug::update(THD *thd, set_var *var)
}
-byte *sys_var_thd_dbug::value_ptr(THD *thd, enum_var_type type, LEX_STRING *b)
+uchar *sys_var_thd_dbug::value_ptr(THD *thd, enum_var_type type, LEX_STRING *b)
{
char buf[256];
if (type == OPT_GLOBAL)
DBUG_EXPLAIN_INITIAL(buf, sizeof(buf));
else
DBUG_EXPLAIN(buf, sizeof(buf));
- return (byte*) thd->strdup(buf);
+ return (uchar*) thd->strdup(buf);
}
@@ -4046,10 +3762,10 @@ sys_var_event_scheduler::update(THD *thd, set_var *var)
}
-byte *sys_var_event_scheduler::value_ptr(THD *thd, enum_var_type type,
+uchar *sys_var_event_scheduler::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base)
{
- return (byte *) Events::get_opt_event_scheduler_str();
+ return (uchar *) Events::get_opt_event_scheduler_str();
}
diff --git a/sql/set_var.h b/sql/set_var.h
index a3963171192..eb2c893c89e 100644
--- a/sql/set_var.h
+++ b/sql/set_var.h
@@ -26,6 +26,7 @@
class sys_var;
class set_var;
+class sys_var_pluginvar; /* opaque */
typedef struct system_variables SV;
typedef struct my_locale_st MY_LOCALE;
@@ -35,13 +36,17 @@ typedef int (*sys_check_func)(THD *, set_var *);
typedef bool (*sys_update_func)(THD *, set_var *);
typedef void (*sys_after_update_func)(THD *,enum_var_type);
typedef void (*sys_set_default_func)(THD *, enum_var_type);
-typedef byte *(*sys_value_ptr_func)(THD *thd);
+typedef uchar *(*sys_value_ptr_func)(THD *thd);
+
+struct sys_var_chain
+{
+ sys_var *first;
+ sys_var *last;
+};
class sys_var
{
public:
- static sys_var *first;
- static uint sys_vars;
sys_var *next;
struct my_option *option_limits; /* Updated by by set_var_init() */
uint name_length; /* Updated by by set_var_init() */
@@ -52,13 +57,15 @@ public:
sys_var(const char *name_arg,sys_after_update_func func= NULL)
:name(name_arg), after_update(func)
, no_support_one_shot(1)
- { add_sys_var(); }
+ {}
virtual ~sys_var() {}
- void add_sys_var()
+ void chain_sys_var(sys_var_chain *chain_arg)
{
- next= first;
- first= this;
- sys_vars++;
+ if (chain_arg->last)
+ chain_arg->last->next= this;
+ else
+ chain_arg->first= this;
+ chain_arg->last= this;
}
virtual bool check(THD *thd, set_var *var);
bool check_enum(THD *thd, set_var *var, const TYPELIB *enum_names);
@@ -66,7 +73,7 @@ public:
virtual bool update(THD *thd, set_var *var)=0;
virtual void set_default(THD *thd_arg, enum_var_type type) {}
virtual SHOW_TYPE show_type() { return SHOW_UNDEF; }
- virtual byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
+ virtual uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
{ return 0; }
virtual bool check_type(enum_var_type type)
{ return type != OPT_GLOBAL; } /* Error if not GLOBAL */
@@ -77,6 +84,7 @@ public:
Item *item(THD *thd, enum_var_type type, LEX_STRING *base);
virtual bool is_struct() { return 0; }
virtual bool is_readonly() const { return 0; }
+ virtual sys_var_pluginvar *cast_pluginvar() { return 0; }
};
@@ -105,18 +113,19 @@ class sys_var_long_ptr_global: public sys_var_global
{
public:
ulong *value;
- sys_var_long_ptr_global(const char *name_arg, ulong *value_ptr_arg,
- pthread_mutex_t *guard_arg,
- sys_after_update_func after_update_arg= NULL)
+ sys_var_long_ptr_global(sys_var_chain *chain, const char *name_arg,
+ ulong *value_ptr_arg,
+ pthread_mutex_t *guard_arg,
+ sys_after_update_func after_update_arg= NULL)
:sys_var_global(name_arg, after_update_arg, guard_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_LONG; }
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
- { return (byte*) value; }
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
+ { return (uchar*) value; }
};
@@ -127,7 +136,7 @@ public:
class sys_var_long_ptr :public sys_var_long_ptr_global
{
public:
- sys_var_long_ptr(const char *name_arg, ulong *value_ptr,
+ sys_var_long_ptr(sys_var_chain *chain, const char *name_arg, ulong *value_ptr,
sys_after_update_func after_update_arg= NULL);
};
@@ -136,16 +145,18 @@ class sys_var_ulonglong_ptr :public sys_var
{
public:
ulonglong *value;
- sys_var_ulonglong_ptr(const char *name_arg, ulonglong *value_ptr_arg)
- :sys_var(name_arg),value(value_ptr_arg) {}
- sys_var_ulonglong_ptr(const char *name_arg, ulonglong *value_ptr_arg,
+ sys_var_ulonglong_ptr(sys_var_chain *chain, const char *name_arg, ulonglong *value_ptr_arg)
+ :sys_var(name_arg),value(value_ptr_arg)
+ { chain_sys_var(chain); }
+ sys_var_ulonglong_ptr(sys_var_chain *chain, const char *name_arg, ulonglong *value_ptr_arg,
sys_after_update_func func)
- :sys_var(name_arg,func), value(value_ptr_arg) {}
+ :sys_var(name_arg,func), value(value_ptr_arg)
+ { chain_sys_var(chain); }
bool update(THD *thd, set_var *var);
void set_default(THD *thd, enum_var_type type);
SHOW_TYPE show_type() { return SHOW_LONGLONG; }
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
- { return (byte*) value; }
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
+ { return (uchar*) value; }
};
@@ -153,9 +164,9 @@ class sys_var_bool_ptr :public sys_var
{
public:
my_bool *value;
- sys_var_bool_ptr(const char *name_arg, my_bool *value_arg)
+ sys_var_bool_ptr(sys_var_chain *chain, const char *name_arg, my_bool *value_arg)
:sys_var(name_arg),value(value_arg)
- {}
+ { chain_sys_var(chain); }
bool check(THD *thd, set_var *var)
{
return check_enum(thd, var, &bool_typelib);
@@ -163,8 +174,8 @@ public:
bool update(THD *thd, set_var *var);
void set_default(THD *thd, enum_var_type type);
SHOW_TYPE show_type() { return SHOW_MY_BOOL; }
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
- { return (byte*) value; }
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
+ { return (uchar*) value; }
bool check_update_type(Item_result type) { return 0; }
};
@@ -172,8 +183,9 @@ public:
class sys_var_bool_ptr_readonly :public sys_var_bool_ptr
{
public:
- sys_var_bool_ptr_readonly(const char *name_arg, my_bool *value_arg)
- :sys_var_bool_ptr(name_arg, value_arg)
+ sys_var_bool_ptr_readonly(sys_var_chain *chain, const char *name_arg,
+ my_bool *value_arg)
+ :sys_var_bool_ptr(chain, name_arg, value_arg)
{}
bool is_readonly() const { return 1; }
};
@@ -187,14 +199,14 @@ public:
sys_check_func check_func;
sys_update_func update_func;
sys_set_default_func set_default_func;
- sys_var_str(const char *name_arg,
+ sys_var_str(sys_var_chain *chain, const char *name_arg,
sys_check_func check_func_arg,
sys_update_func update_func_arg,
sys_set_default_func set_default_func_arg,
char *value_arg)
:sys_var(name_arg), value(value_arg), check_func(check_func_arg),
update_func(update_func_arg),set_default_func(set_default_func_arg)
- {}
+ { chain_sys_var(chain); }
bool check(THD *thd, set_var *var);
bool update(THD *thd, set_var *var)
{
@@ -205,8 +217,8 @@ public:
(*set_default_func)(thd, type);
}
SHOW_TYPE show_type() { return SHOW_CHAR; }
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
- { return (byte*) value; }
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
+ { return (uchar*) value; }
bool check_update_type(Item_result type)
{
return type != STRING_RESULT; /* Only accept strings */
@@ -219,9 +231,9 @@ class sys_var_const_str :public sys_var
{
public:
char *value; // Pointer to const value
- sys_var_const_str(const char *name_arg, const char *value_arg)
+ sys_var_const_str(sys_var_chain *chain, const char *name_arg, const char *value_arg)
:sys_var(name_arg),value((char*) value_arg)
- {}
+ { chain_sys_var(chain); }
bool check(THD *thd, set_var *var)
{
return 1;
@@ -231,9 +243,9 @@ public:
return 1;
}
SHOW_TYPE show_type() { return SHOW_CHAR; }
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
{
- return (byte*) value;
+ return (uchar*) value;
}
bool check_update_type(Item_result type)
{
@@ -248,9 +260,9 @@ class sys_var_const_str_ptr :public sys_var
{
public:
char **value; // Pointer to const value
- sys_var_const_str_ptr(const char *name_arg, char **value_arg)
+ sys_var_const_str_ptr(sys_var_chain *chain, const char *name_arg, char **value_arg)
:sys_var(name_arg),value(value_arg)
- {}
+ { chain_sys_var(chain); }
bool check(THD *thd, set_var *var)
{
return 1;
@@ -260,9 +272,9 @@ public:
return 1;
}
SHOW_TYPE show_type() { return SHOW_CHAR; }
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
{
- return (byte*) *value;
+ return (uchar*) *value;
}
bool check_update_type(Item_result type)
{
@@ -278,17 +290,17 @@ class sys_var_enum :public sys_var
uint *value;
TYPELIB *enum_names;
public:
- sys_var_enum(const char *name_arg, uint *value_arg,
+ sys_var_enum(sys_var_chain *chain, const char *name_arg, uint *value_arg,
TYPELIB *typelib, sys_after_update_func func)
:sys_var(name_arg,func), value(value_arg), enum_names(typelib)
- {}
+ { chain_sys_var(chain); }
bool check(THD *thd, set_var *var)
{
return check_enum(thd, var, enum_names);
}
bool update(THD *thd, set_var *var);
SHOW_TYPE show_type() { return SHOW_CHAR; }
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
bool check_update_type(Item_result type) { return 0; }
};
@@ -296,7 +308,8 @@ public:
class sys_var_thd :public sys_var
{
public:
- sys_var_thd(const char *name_arg, sys_after_update_func func= NULL)
+ sys_var_thd(const char *name_arg,
+ sys_after_update_func func= NULL)
:sys_var(name_arg,func)
{}
bool check_type(enum_var_type type) { return 0; }
@@ -312,18 +325,18 @@ class sys_var_thd_ulong :public sys_var_thd
sys_check_func check_func;
public:
ulong SV::*offset;
- sys_var_thd_ulong(const char *name_arg, ulong SV::*offset_arg)
+ sys_var_thd_ulong(sys_var_chain *chain, const char *name_arg, ulong SV::*offset_arg)
:sys_var_thd(name_arg), check_func(0), offset(offset_arg)
- {}
- sys_var_thd_ulong(const char *name_arg, ulong SV::*offset_arg,
+ { chain_sys_var(chain); }
+ sys_var_thd_ulong(sys_var_chain *chain, const char *name_arg, ulong SV::*offset_arg,
sys_check_func c_func, sys_after_update_func au_func)
:sys_var_thd(name_arg,au_func), check_func(c_func), offset(offset_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_LONG; }
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
};
@@ -331,17 +344,19 @@ class sys_var_thd_ha_rows :public sys_var_thd
{
public:
ha_rows SV::*offset;
- sys_var_thd_ha_rows(const char *name_arg, ha_rows SV::*offset_arg)
+ sys_var_thd_ha_rows(sys_var_chain *chain, const char *name_arg,
+ ha_rows SV::*offset_arg)
:sys_var_thd(name_arg), offset(offset_arg)
- {}
- sys_var_thd_ha_rows(const char *name_arg, ha_rows SV::*offset_arg,
+ { chain_sys_var(chain); }
+ sys_var_thd_ha_rows(sys_var_chain *chain, const char *name_arg,
+ ha_rows SV::*offset_arg,
sys_after_update_func func)
:sys_var_thd(name_arg,func), offset(offset_arg)
- {}
+ { chain_sys_var(chain); }
bool update(THD *thd, set_var *var);
void set_default(THD *thd, enum_var_type type);
SHOW_TYPE show_type() { return SHOW_HA_ROWS; }
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
};
@@ -350,18 +365,20 @@ class sys_var_thd_ulonglong :public sys_var_thd
public:
ulonglong SV::*offset;
bool only_global;
- sys_var_thd_ulonglong(const char *name_arg, ulonglong SV::*offset_arg)
+ sys_var_thd_ulonglong(sys_var_chain *chain, const char *name_arg,
+ ulonglong SV::*offset_arg)
:sys_var_thd(name_arg), offset(offset_arg)
- {}
- sys_var_thd_ulonglong(const char *name_arg, ulonglong SV::*offset_arg,
+ { chain_sys_var(chain); }
+ sys_var_thd_ulonglong(sys_var_chain *chain, const char *name_arg,
+ ulonglong SV::*offset_arg,
sys_after_update_func func, bool only_global_arg)
:sys_var_thd(name_arg, func), offset(offset_arg),
only_global(only_global_arg)
- {}
+ { chain_sys_var(chain); }
bool update(THD *thd, set_var *var);
void set_default(THD *thd, enum_var_type type);
SHOW_TYPE show_type() { return SHOW_LONGLONG; }
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
bool check_default(enum_var_type type)
{
return type == OPT_GLOBAL && !option_limits;
@@ -377,17 +394,17 @@ class sys_var_thd_bool :public sys_var_thd
{
public:
my_bool SV::*offset;
- sys_var_thd_bool(const char *name_arg, my_bool SV::*offset_arg)
+ sys_var_thd_bool(sys_var_chain *chain, const char *name_arg, my_bool SV::*offset_arg)
:sys_var_thd(name_arg), offset(offset_arg)
- {}
- sys_var_thd_bool(const char *name_arg, my_bool SV::*offset_arg,
+ { chain_sys_var(chain); }
+ sys_var_thd_bool(sys_var_chain *chain, const char *name_arg, my_bool SV::*offset_arg,
sys_after_update_func func)
:sys_var_thd(name_arg,func), offset(offset_arg)
- {}
+ { chain_sys_var(chain); }
bool update(THD *thd, set_var *var);
void set_default(THD *thd, enum_var_type type);
SHOW_TYPE show_type() { return SHOW_MY_BOOL; }
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
bool check(THD *thd, set_var *var)
{
return check_enum(thd, var, &bool_typelib);
@@ -403,23 +420,23 @@ protected:
TYPELIB *enum_names;
sys_check_func check_func;
public:
- sys_var_thd_enum(const char *name_arg, ulong SV::*offset_arg,
+ sys_var_thd_enum(sys_var_chain *chain, const char *name_arg, ulong SV::*offset_arg,
TYPELIB *typelib)
:sys_var_thd(name_arg), offset(offset_arg), enum_names(typelib),
check_func(0)
- {}
- sys_var_thd_enum(const char *name_arg, ulong SV::*offset_arg,
+ { chain_sys_var(chain); }
+ sys_var_thd_enum(sys_var_chain *chain, const char *name_arg, ulong SV::*offset_arg,
TYPELIB *typelib,
sys_after_update_func func)
:sys_var_thd(name_arg,func), offset(offset_arg), enum_names(typelib),
check_func(0)
- {}
- sys_var_thd_enum(const char *name_arg, ulong SV::*offset_arg,
+ { chain_sys_var(chain); }
+ sys_var_thd_enum(sys_var_chain *chain, const char *name_arg, ulong SV::*offset_arg,
TYPELIB *typelib, sys_after_update_func func,
sys_check_func check)
:sys_var_thd(name_arg,func), offset(offset_arg), enum_names(typelib),
check_func(check)
- {}
+ { chain_sys_var(chain); }
bool check(THD *thd, set_var *var)
{
int ret= 0;
@@ -430,7 +447,7 @@ public:
bool update(THD *thd, set_var *var);
void set_default(THD *thd, enum_var_type type);
SHOW_TYPE show_type() { return SHOW_CHAR; }
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
bool check_update_type(Item_result type) { return 0; }
};
@@ -440,8 +457,9 @@ extern void fix_sql_mode_var(THD *thd, enum_var_type type);
class sys_var_thd_sql_mode :public sys_var_thd_enum
{
public:
- sys_var_thd_sql_mode(const char *name_arg, ulong SV::*offset_arg)
- :sys_var_thd_enum(name_arg, offset_arg, &sql_mode_typelib,
+ sys_var_thd_sql_mode(sys_var_chain *chain, const char *name_arg,
+ ulong SV::*offset_arg)
+ :sys_var_thd_enum(chain, name_arg, offset_arg, &sql_mode_typelib,
fix_sql_mode_var)
{}
bool check(THD *thd, set_var *var)
@@ -449,7 +467,7 @@ public:
return check_set(thd, var, enum_names);
}
void set_default(THD *thd, enum_var_type type);
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
static bool symbolic_mode_representation(THD *thd, ulonglong sql_mode,
LEX_STRING *rep);
};
@@ -458,11 +476,12 @@ public:
class sys_var_thd_storage_engine :public sys_var_thd
{
protected:
- handlerton *SV::*offset;
+ plugin_ref SV::*offset;
public:
- sys_var_thd_storage_engine(const char *name_arg, handlerton *SV::*offset_arg)
+ sys_var_thd_storage_engine(sys_var_chain *chain, const char *name_arg,
+ plugin_ref SV::*offset_arg)
:sys_var_thd(name_arg), offset(offset_arg)
- {}
+ { chain_sys_var(chain); }
bool check(THD *thd, set_var *var);
SHOW_TYPE show_type() { return SHOW_CHAR; }
bool check_update_type(Item_result type)
@@ -471,14 +490,15 @@ public:
}
void set_default(THD *thd, enum_var_type type);
bool update(THD *thd, set_var *var);
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
};
class sys_var_thd_table_type :public sys_var_thd_storage_engine
{
public:
- sys_var_thd_table_type(const char *name_arg, handlerton *SV::*offset_arg)
- :sys_var_thd_storage_engine(name_arg, offset_arg)
+ sys_var_thd_table_type(sys_var_chain *chain, const char *name_arg,
+ plugin_ref SV::*offset_arg)
+ :sys_var_thd_storage_engine(chain, name_arg, offset_arg)
{}
void warn_deprecated(THD *thd);
void set_default(THD *thd, enum_var_type type);
@@ -492,30 +512,32 @@ class sys_var_thd_bit :public sys_var_thd
public:
ulonglong bit_flag;
bool reverse;
- sys_var_thd_bit(const char *name_arg,
+ sys_var_thd_bit(sys_var_chain *chain, const char *name_arg,
sys_check_func c_func, sys_update_func u_func,
ulonglong bit, bool reverse_arg=0)
:sys_var_thd(name_arg), check_func(c_func), update_func(u_func),
bit_flag(bit), reverse(reverse_arg)
- {}
+ { chain_sys_var(chain); }
bool check(THD *thd, set_var *var);
bool update(THD *thd, set_var *var);
bool check_update_type(Item_result type) { return 0; }
bool check_type(enum_var_type type) { return type == OPT_GLOBAL; }
SHOW_TYPE show_type() { return SHOW_MY_BOOL; }
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
};
class sys_var_thd_dbug :public sys_var_thd
{
public:
- sys_var_thd_dbug(const char *name_arg) :sys_var_thd(name_arg) {}
+ sys_var_thd_dbug(sys_var_chain *chain, const char *name_arg)
+ :sys_var_thd(name_arg)
+ { chain_sys_var(chain); }
bool check_update_type(Item_result type) { return type != STRING_RESULT; }
bool check(THD *thd, set_var *var);
SHOW_TYPE show_type() { return SHOW_CHAR; }
bool update(THD *thd, set_var *var);
void set_default(THD *thd, enum_var_type type) { DBUG_POP(); }
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *b);
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *b);
};
@@ -525,65 +547,50 @@ public:
class sys_var_timestamp :public sys_var
{
public:
- sys_var_timestamp(const char *name_arg) :sys_var(name_arg) {}
+ sys_var_timestamp(sys_var_chain *chain, const char *name_arg)
+ :sys_var(name_arg)
+ { chain_sys_var(chain); }
bool update(THD *thd, set_var *var);
void set_default(THD *thd, enum_var_type type);
bool check_type(enum_var_type type) { return type == OPT_GLOBAL; }
bool check_default(enum_var_type type) { return 0; }
SHOW_TYPE show_type() { return SHOW_LONG; }
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
};
class sys_var_last_insert_id :public sys_var
{
public:
- sys_var_last_insert_id(const char *name_arg) :sys_var(name_arg) {}
+ sys_var_last_insert_id(sys_var_chain *chain, const char *name_arg)
+ :sys_var(name_arg)
+ { chain_sys_var(chain); }
bool update(THD *thd, set_var *var);
bool check_type(enum_var_type type) { return type == OPT_GLOBAL; }
SHOW_TYPE show_type() { return SHOW_LONGLONG; }
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
};
class sys_var_insert_id :public sys_var
{
public:
- sys_var_insert_id(const char *name_arg) :sys_var(name_arg) {}
+ sys_var_insert_id(sys_var_chain *chain, const char *name_arg)
+ :sys_var(name_arg)
+ { chain_sys_var(chain); }
bool update(THD *thd, set_var *var);
bool check_type(enum_var_type type) { return type == OPT_GLOBAL; }
SHOW_TYPE show_type() { return SHOW_LONGLONG; }
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
};
-#ifdef HAVE_REPLICATION
-class sys_var_slave_skip_counter :public sys_var
-{
-public:
- sys_var_slave_skip_counter(const char *name_arg) :sys_var(name_arg) {}
- bool check(THD *thd, set_var *var);
- bool update(THD *thd, set_var *var);
- bool check_type(enum_var_type type) { return type != OPT_GLOBAL; }
- /*
- We can't retrieve the value of this, so we don't have to define
- show_type() or value_ptr()
- */
-};
-
-class sys_var_sync_binlog_period :public sys_var_long_ptr
-{
-public:
- sys_var_sync_binlog_period(const char *name_arg, ulong *value_ptr_arg)
- :sys_var_long_ptr(name_arg,value_ptr_arg) {}
- bool update(THD *thd, set_var *var);
-};
-#endif
-
class sys_var_rand_seed1 :public sys_var
{
public:
- sys_var_rand_seed1(const char *name_arg) :sys_var(name_arg) {}
+ sys_var_rand_seed1(sys_var_chain *chain, const char *name_arg)
+ :sys_var(name_arg)
+ { chain_sys_var(chain); }
bool update(THD *thd, set_var *var);
bool check_type(enum_var_type type) { return type == OPT_GLOBAL; }
};
@@ -591,7 +598,9 @@ public:
class sys_var_rand_seed2 :public sys_var
{
public:
- sys_var_rand_seed2(const char *name_arg) :sys_var(name_arg) {}
+ sys_var_rand_seed2(sys_var_chain *chain, const char *name_arg)
+ :sys_var(name_arg)
+ { chain_sys_var(chain); }
bool update(THD *thd, set_var *var);
bool check_type(enum_var_type type) { return type == OPT_GLOBAL; }
};
@@ -600,7 +609,8 @@ public:
class sys_var_collation :public sys_var_thd
{
public:
- sys_var_collation(const char *name_arg) :sys_var_thd(name_arg)
+ sys_var_collation(const char *name_arg)
+ :sys_var_thd(name_arg)
{
no_support_one_shot= 0;
}
@@ -618,10 +628,9 @@ class sys_var_character_set :public sys_var_thd
{
public:
bool nullable;
- sys_var_character_set(const char *name_arg) :
- sys_var_thd(name_arg)
+ sys_var_character_set(const char *name_arg, bool is_nullable= 0) :
+ sys_var_thd(name_arg), nullable(is_nullable)
{
- nullable= 0;
/*
In fact only almost all variables derived from sys_var_character_set
support ONE_SHOT; character_set_results doesn't. But that's good enough.
@@ -636,91 +645,54 @@ public:
}
bool check_default(enum_var_type type) { return 0; }
bool update(THD *thd, set_var *var);
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
virtual void set_default(THD *thd, enum_var_type type)= 0;
virtual CHARSET_INFO **ci_ptr(THD *thd, enum_var_type type)= 0;
};
-class sys_var_character_set_filesystem :public sys_var_character_set
+class sys_var_character_set_sv :public sys_var_character_set
{
+ CHARSET_INFO *SV::*offset;
+ CHARSET_INFO **global_default;
public:
- sys_var_character_set_filesystem(const char *name_arg) :
- sys_var_character_set(name_arg) {}
+ sys_var_character_set_sv(sys_var_chain *chain, const char *name_arg,
+ CHARSET_INFO *SV::*offset_arg,
+ CHARSET_INFO **global_default_arg,
+ bool is_nullable= 0)
+ : sys_var_character_set(name_arg, is_nullable),
+ offset(offset_arg), global_default(global_default_arg)
+ { chain_sys_var(chain); }
void set_default(THD *thd, enum_var_type type);
CHARSET_INFO **ci_ptr(THD *thd, enum_var_type type);
};
-class sys_var_character_set_client :public sys_var_character_set
-{
-public:
- sys_var_character_set_client(const char *name_arg) :
- sys_var_character_set(name_arg) {}
- void set_default(THD *thd, enum_var_type type);
- CHARSET_INFO **ci_ptr(THD *thd, enum_var_type type);
-};
-
-class sys_var_character_set_results :public sys_var_character_set
-{
-public:
- sys_var_character_set_results(const char *name_arg) :
- sys_var_character_set(name_arg)
- { nullable= 1; }
- void set_default(THD *thd, enum_var_type type);
- CHARSET_INFO **ci_ptr(THD *thd, enum_var_type type);
-};
-
-class sys_var_character_set_server :public sys_var_character_set
-{
-public:
- sys_var_character_set_server(const char *name_arg) :
- sys_var_character_set(name_arg) {}
- void set_default(THD *thd, enum_var_type type);
- CHARSET_INFO **ci_ptr(THD *thd, enum_var_type type);
-};
class sys_var_character_set_database :public sys_var_character_set
{
public:
- sys_var_character_set_database(const char *name_arg) :
- sys_var_character_set(name_arg) {}
- void set_default(THD *thd, enum_var_type type);
- CHARSET_INFO **ci_ptr(THD *thd, enum_var_type type);
-};
-
-class sys_var_character_set_connection :public sys_var_character_set
-{
-public:
- sys_var_character_set_connection(const char *name_arg) :
- sys_var_character_set(name_arg) {}
+ sys_var_character_set_database(sys_var_chain *chain, const char *name_arg) :
+ sys_var_character_set(name_arg)
+ { chain_sys_var(chain); }
void set_default(THD *thd, enum_var_type type);
CHARSET_INFO **ci_ptr(THD *thd, enum_var_type type);
};
-class sys_var_collation_connection :public sys_var_collation
-{
-public:
- sys_var_collation_connection(const char *name_arg) :sys_var_collation(name_arg) {}
- bool update(THD *thd, set_var *var);
- void set_default(THD *thd, enum_var_type type);
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
-};
-
-class sys_var_collation_server :public sys_var_collation
+class sys_var_collation_sv :public sys_var_collation
{
+ CHARSET_INFO *SV::*offset;
+ CHARSET_INFO **global_default;
public:
- sys_var_collation_server(const char *name_arg) :sys_var_collation(name_arg) {}
- bool update(THD *thd, set_var *var);
- void set_default(THD *thd, enum_var_type type);
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
-};
-
-class sys_var_collation_database :public sys_var_collation
-{
-public:
- sys_var_collation_database(const char *name_arg) :sys_var_collation(name_arg) {}
+ sys_var_collation_sv(sys_var_chain *chain, const char *name_arg,
+ CHARSET_INFO *SV::*offset_arg,
+ CHARSET_INFO **global_default_arg)
+ :sys_var_collation(name_arg),
+ offset(offset_arg), global_default(global_default_arg)
+ {
+ chain_sys_var(chain);
+ }
bool update(THD *thd, set_var *var);
void set_default(THD *thd, enum_var_type type);
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
};
@@ -729,10 +701,11 @@ class sys_var_key_cache_param :public sys_var
protected:
size_t offset;
public:
- sys_var_key_cache_param(const char *name_arg, size_t offset_arg)
+ sys_var_key_cache_param(sys_var_chain *chain, const char *name_arg,
+ size_t offset_arg)
:sys_var(name_arg), offset(offset_arg)
- {}
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
+ { chain_sys_var(chain); }
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
bool check_default(enum_var_type type) { return 1; }
bool is_struct() { return 1; }
};
@@ -741,8 +714,9 @@ public:
class sys_var_key_buffer_size :public sys_var_key_cache_param
{
public:
- sys_var_key_buffer_size(const char *name_arg)
- :sys_var_key_cache_param(name_arg, offsetof(KEY_CACHE, param_buff_size))
+ sys_var_key_buffer_size(sys_var_chain *chain, const char *name_arg)
+ :sys_var_key_cache_param(chain, name_arg,
+ offsetof(KEY_CACHE, param_buff_size))
{}
bool update(THD *thd, set_var *var);
SHOW_TYPE show_type() { return SHOW_LONGLONG; }
@@ -752,8 +726,8 @@ public:
class sys_var_key_cache_long :public sys_var_key_cache_param
{
public:
- sys_var_key_cache_long(const char *name_arg, size_t offset_arg)
- :sys_var_key_cache_param(name_arg, offset_arg)
+ sys_var_key_cache_long(sys_var_chain *chain, const char *name_arg, size_t offset_arg)
+ :sys_var_key_cache_param(chain, name_arg, offset_arg)
{}
bool update(THD *thd, set_var *var);
SHOW_TYPE show_type() { return SHOW_LONG; }
@@ -765,12 +739,12 @@ class sys_var_thd_date_time_format :public sys_var_thd
DATE_TIME_FORMAT *SV::*offset;
timestamp_type date_time_type;
public:
- sys_var_thd_date_time_format(const char *name_arg,
+ sys_var_thd_date_time_format(sys_var_chain *chain, const char *name_arg,
DATE_TIME_FORMAT *SV::*offset_arg,
timestamp_type date_time_type_arg)
:sys_var_thd(name_arg), offset(offset_arg),
date_time_type(date_time_type_arg)
- {}
+ { chain_sys_var(chain); }
SHOW_TYPE show_type() { return SHOW_CHAR; }
bool check_update_type(Item_result type)
{
@@ -780,7 +754,7 @@ public:
bool check(THD *thd, set_var *var);
bool update(THD *thd, set_var *var);
void update2(THD *thd, enum_var_type type, DATE_TIME_FORMAT *new_value);
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
void set_default(THD *thd, enum_var_type type);
};
@@ -789,8 +763,9 @@ class sys_var_log_state :public sys_var_bool_ptr
{
uint log_type;
public:
- sys_var_log_state(const char *name_arg, my_bool *value_arg, uint log_type_arg)
- :sys_var_bool_ptr(name_arg, value_arg), log_type(log_type_arg) {}
+ sys_var_log_state(sys_var_chain *chain, const char *name_arg, my_bool *value_arg,
+ uint log_type_arg)
+ :sys_var_bool_ptr(chain, name_arg, value_arg), log_type(log_type_arg) {}
bool update(THD *thd, set_var *var);
void set_default(THD *thd, enum_var_type type);
};
@@ -801,16 +776,16 @@ class sys_var_log_output :public sys_var
ulong *value;
TYPELIB *enum_names;
public:
- sys_var_log_output(const char *name_arg, ulong *value_arg,
+ sys_var_log_output(sys_var_chain *chain, const char *name_arg, ulong *value_arg,
TYPELIB *typelib, sys_after_update_func func)
:sys_var(name_arg,func), value(value_arg), enum_names(typelib)
- {}
+ { chain_sys_var(chain); }
bool check(THD *thd, set_var *var)
{
return check_set(thd, var, enum_names);
}
bool update(THD *thd, set_var *var);
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
bool check_update_type(Item_result type) { return 0; }
void set_default(THD *thd, enum_var_type type);
SHOW_TYPE show_type() { return SHOW_CHAR; }
@@ -825,17 +800,17 @@ public:
enum_var_type var_type;
SHOW_TYPE show_type_value;
sys_value_ptr_func value_ptr_func;
- sys_var_readonly(const char *name_arg, enum_var_type type,
+ sys_var_readonly(sys_var_chain *chain, const char *name_arg, enum_var_type type,
SHOW_TYPE show_type_arg,
sys_value_ptr_func value_ptr_func_arg)
:sys_var(name_arg), var_type(type),
show_type_value(show_type_arg), value_ptr_func(value_ptr_func_arg)
- {}
+ { chain_sys_var(chain); }
bool update(THD *thd, set_var *var) { return 1; }
bool check_default(enum_var_type type) { return 1; }
bool check_type(enum_var_type type) { return type != var_type; }
bool check_update_type(Item_result type) { return 1; }
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
{
return (*value_ptr_func)(thd);
}
@@ -844,19 +819,17 @@ public:
};
-class sys_var_have_variable: public sys_var
+class sys_var_have_option: public sys_var
{
- SHOW_COMP_OPTION *have_variable;
-
+protected:
+ virtual SHOW_COMP_OPTION get_option() = 0;
public:
- sys_var_have_variable(const char *variable_name,
- SHOW_COMP_OPTION *have_variable_arg):
- sys_var(variable_name),
- have_variable(have_variable_arg)
- { }
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
+ sys_var_have_option(sys_var_chain *chain, const char *variable_name):
+ sys_var(variable_name)
+ { chain_sys_var(chain); }
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
{
- return (byte*) show_comp_option_name[*have_variable];
+ return (uchar*) show_comp_option_name[get_option()];
}
bool update(THD *thd, set_var *var) { return 1; }
bool check_default(enum_var_type type) { return 1; }
@@ -867,13 +840,47 @@ public:
};
+class sys_var_have_variable: public sys_var_have_option
+{
+ SHOW_COMP_OPTION *have_variable;
+
+public:
+ sys_var_have_variable(sys_var_chain *chain, const char *variable_name,
+ SHOW_COMP_OPTION *have_variable_arg):
+ sys_var_have_option(chain, variable_name),
+ have_variable(have_variable_arg)
+ { }
+ SHOW_COMP_OPTION get_option() { return *have_variable; }
+};
+
+
+class sys_var_have_plugin: public sys_var_have_option
+{
+ const char *plugin_name_str;
+ const uint plugin_name_len;
+ const int plugin_type;
+
+public:
+ sys_var_have_plugin(sys_var_chain *chain, const char *variable_name,
+ const char *plugin_name_str_arg, uint plugin_name_len_arg,
+ int plugin_type_arg):
+ sys_var_have_option(chain, variable_name),
+ plugin_name_str(plugin_name_str_arg), plugin_name_len(plugin_name_len_arg),
+ plugin_type(plugin_type_arg)
+ { }
+ /* the following method is declared in sql_plugin.cc */
+ SHOW_COMP_OPTION get_option();
+};
+
+
class sys_var_thd_time_zone :public sys_var_thd
{
public:
- sys_var_thd_time_zone(const char *name_arg):
+ sys_var_thd_time_zone(sys_var_chain *chain, const char *name_arg):
sys_var_thd(name_arg)
{
no_support_one_shot= 0;
+ chain_sys_var(chain);
}
bool check(THD *thd, set_var *var);
SHOW_TYPE show_type() { return SHOW_CHAR; }
@@ -883,7 +890,7 @@ public:
}
bool check_default(enum_var_type type) { return 0; }
bool update(THD *thd, set_var *var);
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
virtual void set_default(THD *thd, enum_var_type type);
};
@@ -891,8 +898,9 @@ public:
class sys_var_max_user_conn : public sys_var_thd
{
public:
- sys_var_max_user_conn(const char *name_arg):
- sys_var_thd(name_arg) {}
+ sys_var_max_user_conn(sys_var_chain *chain, const char *name_arg):
+ sys_var_thd(name_arg)
+ { chain_sys_var(chain); }
bool check(THD *thd, set_var *var);
bool update(THD *thd, set_var *var);
bool check_default(enum_var_type type)
@@ -901,15 +909,37 @@ public:
}
void set_default(THD *thd, enum_var_type type);
SHOW_TYPE show_type() { return SHOW_INT; }
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
};
+
+class sys_var_microseconds :public sys_var_thd
+{
+ ulonglong SV::*offset;
+public:
+ sys_var_microseconds(sys_var_chain *chain, const char *name_arg,
+ ulonglong SV::*offset_arg):
+ sys_var_thd(name_arg), offset(offset_arg)
+ { chain_sys_var(chain); }
+ bool check(THD *thd, set_var *var) {return 0;}
+ bool update(THD *thd, set_var *var);
+ void set_default(THD *thd, enum_var_type type);
+ SHOW_TYPE show_type() { return SHOW_DOUBLE; }
+ bool check_update_type(Item_result type)
+ {
+ return (type != INT_RESULT && type != REAL_RESULT && type != DECIMAL_RESULT);
+ }
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
+};
+
+
class sys_var_trust_routine_creators :public sys_var_bool_ptr
{
/* We need a derived class only to have a warn_deprecated() */
public:
- sys_var_trust_routine_creators(const char *name_arg, my_bool *value_arg) :
- sys_var_bool_ptr(name_arg, value_arg) {};
+ sys_var_trust_routine_creators(sys_var_chain *chain,
+ const char *name_arg, my_bool *value_arg) :
+ sys_var_bool_ptr(chain, name_arg, value_arg) {};
void warn_deprecated(THD *thd);
void set_default(THD *thd, enum_var_type type);
bool update(THD *thd, set_var *var);
@@ -923,8 +953,9 @@ public:
class sys_var_opt_readonly :public sys_var_bool_ptr
{
public:
- sys_var_opt_readonly(const char *name_arg, my_bool *value_arg) :
- sys_var_bool_ptr(name_arg, value_arg) {};
+ sys_var_opt_readonly(sys_var_chain *chain, const char *name_arg,
+ my_bool *value_arg) :
+ sys_var_bool_ptr(chain, name_arg, value_arg) {};
~sys_var_opt_readonly() {};
bool update(THD *thd, set_var *var);
};
@@ -933,12 +964,13 @@ public:
class sys_var_thd_lc_time_names :public sys_var_thd
{
public:
- sys_var_thd_lc_time_names(const char *name_arg):
- sys_var_thd(name_arg)
+ sys_var_thd_lc_time_names(sys_var_chain *chain, const char *name_arg):
+ sys_var_thd(name_arg)
{
#if MYSQL_VERSION_ID < 50000
no_support_one_shot= 0;
#endif
+ chain_sys_var(chain);
}
bool check(THD *thd, set_var *var);
SHOW_TYPE show_type() { return SHOW_CHAR; }
@@ -948,7 +980,7 @@ public:
}
bool check_default(enum_var_type type) { return 0; }
bool update(THD *thd, set_var *var);
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
virtual void set_default(THD *thd, enum_var_type type);
};
@@ -957,10 +989,10 @@ class sys_var_event_scheduler :public sys_var_long_ptr
{
/* We need a derived class only to have a warn_deprecated() */
public:
- sys_var_event_scheduler(const char *name_arg) :
- sys_var_long_ptr(name_arg, NULL, NULL) {};
+ sys_var_event_scheduler(sys_var_chain *chain, const char *name_arg) :
+ sys_var_long_ptr(chain, name_arg, NULL, NULL) {};
bool update(THD *thd, set_var *var);
- byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
SHOW_TYPE show_type() { return SHOW_CHAR; }
bool check(THD *thd, set_var *var);
bool check_update_type(Item_result type)
@@ -974,8 +1006,9 @@ extern void fix_binlog_format_after_update(THD *thd, enum_var_type type);
class sys_var_thd_binlog_format :public sys_var_thd_enum
{
public:
- sys_var_thd_binlog_format(const char *name_arg, ulong SV::*offset_arg)
- :sys_var_thd_enum(name_arg, offset_arg,
+ sys_var_thd_binlog_format(sys_var_chain *chain, const char *name_arg,
+ ulong SV::*offset_arg)
+ :sys_var_thd_enum(chain, name_arg, offset_arg,
&binlog_format_typelib
, fix_binlog_format_after_update
)
@@ -1013,7 +1046,7 @@ public:
CHARSET_INFO *charset;
ulong ulong_value;
ulonglong ulonglong_value;
- handlerton *hton;
+ plugin_ref plugin;
DATE_TIME_FORMAT *date_time_format;
Time_zone *time_zone;
MY_LOCALE *locale_value;
@@ -1095,6 +1128,11 @@ public:
};
+extern "C"
+{
+ typedef int (*process_key_cache_t) (const char *, KEY_CACHE *);
+}
+
/* Named lists (used for keycaches) */
class NAMED_LIST :public ilink
@@ -1102,10 +1140,10 @@ class NAMED_LIST :public ilink
const char *name;
uint name_length;
public:
- gptr data;
+ uchar* data;
NAMED_LIST(I_List<NAMED_LIST> *links, const char *name_arg,
- uint name_length_arg, gptr data_arg)
+ uint name_length_arg, uchar* data_arg)
:name_length(name_length_arg), data(data_arg)
{
name= my_strndup(name_arg, name_length, MYF(MY_WME));
@@ -1117,12 +1155,11 @@ public:
}
~NAMED_LIST()
{
- my_free((char*) name, MYF(0));
+ my_free((uchar*) name, MYF(0));
}
- friend bool process_key_caches(int (* func) (const char *name,
- KEY_CACHE *));
+ friend bool process_key_caches(process_key_cache_t func);
friend void delete_elements(I_List<NAMED_LIST> *list,
- void (*free_element)(const char*, gptr));
+ void (*free_element)(const char*, uchar*));
};
/* updated in sql_acl.cc */
@@ -1142,9 +1179,13 @@ struct sys_var_with_base
Prototypes for helper functions
*/
-void set_var_init();
+int set_var_init();
void set_var_free();
-sys_var *find_sys_var(const char *str, uint length=0);
+int mysql_append_static_vars(const SHOW_VAR *show_vars, uint count);
+SHOW_VAR* enumerate_sys_vars(THD *thd, bool sorted);
+int mysql_add_sys_var_chain(sys_var *chain, struct my_option *long_options);
+int mysql_del_sys_var_chain(sys_var *chain);
+sys_var *find_sys_var(THD *thd, const char *str, uint length=0);
int sql_set_variables(THD *thd, List<set_var_base> *var_list);
bool not_all_support_one_shot(List<set_var_base> *var_list);
void fix_delay_key_write(THD *thd, enum_var_type type);
@@ -1155,7 +1196,7 @@ extern sys_var_str sys_init_slave;
extern sys_var_thd_time_zone sys_time_zone;
extern sys_var_thd_bit sys_autocommit;
CHARSET_INFO *get_old_charset_by_name(const char *old_name);
-gptr find_named(I_List<NAMED_LIST> *list, const char *name, uint length,
+uchar* find_named(I_List<NAMED_LIST> *list, const char *name, uint length,
NAMED_LIST **found);
extern sys_var_str sys_var_general_log_path, sys_var_slow_log_path;
@@ -1164,6 +1205,6 @@ extern sys_var_str sys_var_general_log_path, sys_var_slow_log_path;
KEY_CACHE *get_key_cache(LEX_STRING *cache_name);
KEY_CACHE *get_or_create_key_cache(const char *name, uint length);
void free_key_cache(const char *name, KEY_CACHE *key_cache);
-bool process_key_caches(int (* func) (const char *name, KEY_CACHE *));
+bool process_key_caches(process_key_cache_t func);
void delete_elements(I_List<NAMED_LIST> *list,
- void (*free_element)(const char*, gptr));
+ void (*free_element)(const char*, uchar*));
diff --git a/sql/share/charsets/ascii.xml b/sql/share/charsets/ascii.xml
index 97006c53680..f4fb79ac632 100644
--- a/sql/share/charsets/ascii.xml
+++ b/sql/share/charsets/ascii.xml
@@ -97,7 +97,7 @@
0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
-0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 0000
+0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
@@ -117,9 +117,9 @@
20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 5C 5D 5B 5E 5F
- 45 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
- 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 59 7F
+ 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
+ 60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
+ 50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt
index bb2d9c25a77..30cf85f3181 100644
--- a/sql/share/errmsg.txt
+++ b/sql/share/errmsg.txt
@@ -1478,6 +1478,8 @@ ER_DUP_KEYNAME 42000 S1009
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"
@@ -5022,7 +5024,9 @@ ER_UNKNOWN_STORAGE_ENGINE 42000
ger "Unbekannte Speicher-Engine '%s'"
por "Motor de tabela desconhecido '%s'"
spa "Desconocido motor de tabla '%s'"
-ER_UNUSED_1
+# 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"
@@ -5606,8 +5610,6 @@ ER_SP_RECURSION_LIMIT
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_FOREIGN_SERVER_EXISTS
- eng "The foreign server, %s, you are trying to create already exists."
ER_SP_WRONG_NAME 42000
eng "Incorrect routine name '%-.192s'"
ger "Ungültiger Routinenname '%-.192s'"
@@ -5629,6 +5631,38 @@ ER_NON_GROUPING_FIELD_USED 42000
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_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"
@@ -5843,14 +5877,11 @@ 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"
- ger "Tabellendefinition auf Master und Slave stimmt nicht überein"
+ 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_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_EVENT_ALREADY_EXISTS
eng "Event '%-.192s' already exists"
ger "Event '%-.192s' existiert bereits"
@@ -5901,14 +5932,16 @@ ER_EVENT_DATA_TOO_LONG
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"
-ER_WARN_DEPRECATED_SYNTAX
+# 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_READ_LOCK_LOG_TABLE
- eng "You can't use usual read lock with log tables. Try READ LOCAL instead"
+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"
@@ -5916,9 +5949,6 @@ ER_FOREIGN_DUPLICATE_KEY 23000 S1009
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_REMOVED_SPACES
- eng "Leading spaces are removed from name '%s'"
- ger "Führende Leerzeichen werden aus dem Namen '%s' entfernt"
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"
@@ -5975,9 +6005,6 @@ 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_NO_TRIGGERS_ON_SYSTEM_SCHEMA
- eng "Triggers can not be created on system tables"
- ger "Trigger können nicht auf Systemtabellen erzeugt werden"
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"
@@ -5987,27 +6014,12 @@ ER_EVENTS_DB_ERROR
ER_ONLY_INTEGERS_ALLOWED
eng "Only integers allowed as number here"
ger "An dieser Stelle sind nur Ganzzahlen zulässig"
-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_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_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_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'"
@@ -6023,6 +6035,8 @@ ER_WRONG_PARAMETERS_TO_STORED_FCT 42000
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'"
@@ -6052,10 +6066,46 @@ 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. Event has not been created"
+ 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. Event has not been altered"
+ 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 is not 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`"
diff --git a/sql/slave.cc b/sql/slave.cc
index 20fa541b42e..1c87f3122d1 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -27,13 +27,14 @@
#include <my_dir.h>
#include <sql_common.h>
#include <errmsg.h>
+#include <mysys_err.h>
#ifdef HAVE_REPLICATION
#include "rpl_tblmap.h"
-int queue_event(MASTER_INFO* mi,const char* buf,ulong event_len);
-static Log_event* next_event(RELAY_LOG_INFO* rli);
+int queue_event(Master_info* mi,const char* buf,ulong event_len);
+static Log_event* next_event(Relay_log_info* rli);
#define FLAGSTR(V,F) ((V)&(F)?#F" ":"")
@@ -45,7 +46,7 @@ MY_BITMAP slave_error_mask;
typedef bool (*CHECK_KILLED_FUNC)(THD*,void*);
char* slave_load_tmpdir = 0;
-MASTER_INFO *active_mi= 0;
+Master_info *active_mi= 0;
my_bool replicate_same_server_id;
ulonglong relay_log_space_limit = 0;
@@ -53,32 +54,89 @@ ulonglong relay_log_space_limit = 0;
When slave thread exits, we need to remember the temporary tables so we
can re-use them on slave start.
- TODO: move the vars below under MASTER_INFO
+ TODO: move the vars below under Master_info
*/
int disconnect_slave_event_count = 0, abort_slave_event_count = 0;
int events_till_abort = -1;
+enum enum_slave_reconnect_actions
+{
+ SLAVE_RECON_ACT_REG= 0,
+ SLAVE_RECON_ACT_DUMP= 1,
+ SLAVE_RECON_ACT_EVENT= 2,
+ SLAVE_RECON_ACT_MAX
+};
+
+enum enum_slave_reconnect_messages
+{
+ SLAVE_RECON_MSG_WAIT= 0,
+ SLAVE_RECON_MSG_KILLED_WAITING= 1,
+ SLAVE_RECON_MSG_AFTER= 2,
+ SLAVE_RECON_MSG_FAILED= 3,
+ SLAVE_RECON_MSG_COMMAND= 4,
+ SLAVE_RECON_MSG_KILLED_AFTER= 5,
+ SLAVE_RECON_MSG_MAX
+};
+
+static const char *reconnect_messages[SLAVE_RECON_ACT_MAX][SLAVE_RECON_MSG_MAX]=
+{
+ {
+ "Waiting to reconnect after a failed registration on master",
+ "Slave I/O thread killed while waitnig to reconnect after a failed \
+registration on master",
+ "Reconnecting after a failed registration on master",
+ "failed registering on master, reconnecting to try again, \
+log '%s' at postion %s",
+ "COM_REGISTER_SLAVE",
+ "Slave I/O thread killed during or after reconnect"
+ },
+ {
+ "Waiting to reconnect after a failed binlog dump request",
+ "Slave I/O thread killed while retrying master dump",
+ "Reconnecting after a failed binlog dump request",
+ "failed dump request, reconnecting to try again, log '%s' at postion %s",
+ "COM_BINLOG_DUMP",
+ "Slave I/O thread killed during or after reconnect"
+ },
+ {
+ "Waiting to reconnect after a failed master event read",
+ "Slave I/O thread killed while waiting to reconnect after a failed read",
+ "Reconnecting after a failed master event read",
+ "Slave I/O thread: Failed reading log event, reconnecting to retry, \
+log '%s' at postion %s",
+ "",
+ "Slave I/O thread killed during or after a reconnect done to recover from \
+failed read"
+ }
+};
+
+
typedef enum { SLAVE_THD_IO, SLAVE_THD_SQL} SLAVE_THD_TYPE;
-static int process_io_rotate(MASTER_INFO* mi, Rotate_log_event* rev);
-static int process_io_create_file(MASTER_INFO* mi, Create_file_log_event* cev);
-static bool wait_for_relay_log_space(RELAY_LOG_INFO* rli);
-static inline bool io_slave_killed(THD* thd,MASTER_INFO* mi);
-static inline bool sql_slave_killed(THD* thd,RELAY_LOG_INFO* rli);
+static int process_io_rotate(Master_info* mi, Rotate_log_event* rev);
+static int process_io_create_file(Master_info* mi, Create_file_log_event* cev);
+static bool wait_for_relay_log_space(Relay_log_info* rli);
+static inline bool io_slave_killed(THD* thd,Master_info* mi);
+static inline bool sql_slave_killed(THD* thd,Relay_log_info* rli);
static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type);
-static int safe_connect(THD* thd, MYSQL* mysql, MASTER_INFO* mi);
-static int safe_reconnect(THD* thd, MYSQL* mysql, MASTER_INFO* mi,
+static int safe_connect(THD* thd, MYSQL* mysql, Master_info* mi);
+static int safe_reconnect(THD* thd, MYSQL* mysql, Master_info* mi,
bool suppress_warnings);
-static int connect_to_master(THD* thd, MYSQL* mysql, MASTER_INFO* mi,
+static int connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi,
bool reconnect, bool suppress_warnings);
static int safe_sleep(THD* thd, int sec, CHECK_KILLED_FUNC thread_killed,
void* thread_killed_arg);
static int request_table_dump(MYSQL* mysql, const char* db, const char* table);
static int create_table_from_dump(THD* thd, MYSQL *mysql, const char* db,
const char* table_name, bool overwrite);
-static int get_master_version_and_clock(MYSQL* mysql, MASTER_INFO* mi);
-static Log_event* next_event(RELAY_LOG_INFO* rli);
+static int get_master_version_and_clock(MYSQL* mysql, Master_info* mi);
+static Log_event* next_event(Relay_log_info* rli);
+static int terminate_slave_thread(THD *thd,
+ pthread_mutex_t* term_lock,
+ pthread_cond_t* term_cond,
+ volatile uint *slave_running,
+ bool skip_lock);
/*
Find out which replications threads are running
@@ -98,7 +156,7 @@ static Log_event* next_event(RELAY_LOG_INFO* rli);
If inverse == 1, stopped threads
*/
-void init_thread_mask(int* mask,MASTER_INFO* mi,bool inverse)
+void init_thread_mask(int* mask,Master_info* mi,bool inverse)
{
bool set_io = mi->slave_running, set_sql = mi->rli.slave_running;
register int tmp_mask=0;
@@ -119,7 +177,7 @@ void init_thread_mask(int* mask,MASTER_INFO* mi,bool inverse)
lock_slave_threads()
*/
-void lock_slave_threads(MASTER_INFO* mi)
+void lock_slave_threads(Master_info* mi)
{
DBUG_ENTER("lock_slave_threads");
@@ -134,7 +192,7 @@ void lock_slave_threads(MASTER_INFO* mi)
unlock_slave_threads()
*/
-void unlock_slave_threads(MASTER_INFO* mi)
+void unlock_slave_threads(Master_info* mi)
{
DBUG_ENTER("unlock_slave_threads");
@@ -161,7 +219,7 @@ 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;
/*
If master_host is not specified, try to read it from the master_info file.
@@ -251,7 +309,7 @@ void init_slave_skip_errors(const char* arg)
}
-int terminate_slave_threads(MASTER_INFO* mi,int thread_mask,bool skip_lock)
+int terminate_slave_threads(Master_info* mi,int thread_mask,bool skip_lock)
{
DBUG_ENTER("terminate_slave_threads");
@@ -259,35 +317,26 @@ int terminate_slave_threads(MASTER_INFO* mi,int thread_mask,bool skip_lock)
DBUG_RETURN(0); /* successfully do nothing */
int error,force_all = (thread_mask & SLAVE_FORCE_ALL);
pthread_mutex_t *sql_lock = &mi->rli.run_lock, *io_lock = &mi->run_lock;
- pthread_mutex_t *sql_cond_lock,*io_cond_lock;
-
- sql_cond_lock=sql_lock;
- io_cond_lock=io_lock;
- if (skip_lock)
- {
- sql_lock = io_lock = 0;
- }
- if ((thread_mask & (SLAVE_IO|SLAVE_FORCE_ALL)) && mi->slave_running)
+ if ((thread_mask & (SLAVE_IO|SLAVE_FORCE_ALL)))
{
DBUG_PRINT("info",("Terminating IO thread"));
mi->abort_slave=1;
if ((error=terminate_slave_thread(mi->io_thd,io_lock,
- io_cond_lock,
&mi->stop_cond,
- &mi->slave_running)) &&
+ &mi->slave_running,
+ skip_lock)) &&
!force_all)
DBUG_RETURN(error);
}
- if ((thread_mask & (SLAVE_SQL|SLAVE_FORCE_ALL)) && mi->rli.slave_running)
+ if ((thread_mask & (SLAVE_SQL|SLAVE_FORCE_ALL)))
{
DBUG_PRINT("info",("Terminating SQL thread"));
- DBUG_ASSERT(mi->rli.sql_thd != 0) ;
mi->rli.abort_slave=1;
if ((error=terminate_slave_thread(mi->rli.sql_thd,sql_lock,
- sql_cond_lock,
&mi->rli.stop_cond,
- &mi->rli.slave_running)) &&
+ &mi->rli.slave_running,
+ skip_lock)) &&
!force_all)
DBUG_RETURN(error);
}
@@ -295,23 +344,60 @@ int terminate_slave_threads(MASTER_INFO* mi,int thread_mask,bool skip_lock)
}
-int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock,
- pthread_mutex_t *cond_lock,
- pthread_cond_t* term_cond,
- volatile uint *slave_running)
+/**
+ Wait for a slave thread to terminate.
+
+ This function is called after requesting the thread to terminate
+ (by setting @c abort_slave member of @c Relay_log_info or @c
+ Master_info structure to 1). Termination of the thread is
+ controlled with the the predicate <code>*slave_running</code>.
+
+ Function will acquire @c term_lock before waiting on the condition
+ unless @c skip_lock is true in which case the mutex should be owned
+ by the caller of this function and will remain acquired after
+ return from the function.
+
+ @param term_lock
+ Associated lock to use when waiting for @c term_cond
+
+ @param term_cond
+ Condition that is signalled when the thread has terminated
+
+ @param slave_running
+ Pointer to predicate to check for slave thread termination
+
+ @param skip_lock
+ If @c true the lock will not be acquired before waiting on
+ the condition. In this case, it is assumed that the calling
+ function acquires the lock before calling this function.
+
+ @retval 0 All OK
+ */
+static int
+terminate_slave_thread(THD *thd,
+ pthread_mutex_t* term_lock,
+ pthread_cond_t* term_cond,
+ volatile uint *slave_running,
+ bool skip_lock)
{
+ int error;
+
DBUG_ENTER("terminate_slave_thread");
- if (term_lock)
- {
+
+ if (!skip_lock)
pthread_mutex_lock(term_lock);
- if (!*slave_running)
- {
+
+ safe_mutex_assert_owner(term_lock);
+
+ if (!*slave_running)
+ {
+ if (!skip_lock)
pthread_mutex_unlock(term_lock);
- DBUG_RETURN(ER_SLAVE_NOT_RUNNING);
- }
+ DBUG_RETURN(ER_SLAVE_NOT_RUNNING);
}
DBUG_ASSERT(thd != 0);
THD_CHECK_SENTRY(thd);
+
/*
Is is critical to test if the slave is running. Otherwise, we might
be referening freed memory trying to kick it
@@ -327,9 +413,13 @@ int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock,
*/
struct timespec abstime;
set_timespec(abstime,2);
- pthread_cond_timedwait(term_cond, cond_lock, &abstime);
+ error= pthread_cond_timedwait(term_cond, term_lock, &abstime);
+ DBUG_ASSERT(error == ETIMEDOUT || error == 0);
}
- if (term_lock)
+
+ DBUG_ASSERT(*slave_running == 0);
+
+ if (!skip_lock)
pthread_mutex_unlock(term_lock);
DBUG_RETURN(0);
}
@@ -340,7 +430,7 @@ int start_slave_thread(pthread_handler h_func, pthread_mutex_t *start_lock,
pthread_cond_t *start_cond,
volatile uint *slave_running,
volatile ulong *slave_run_id,
- MASTER_INFO* mi,
+ Master_info* mi,
bool high_priority)
{
pthread_t th;
@@ -410,7 +500,7 @@ int start_slave_thread(pthread_handler h_func, pthread_mutex_t *start_lock,
*/
int start_slave_threads(bool need_slave_mutex, bool wait_for_start,
- MASTER_INFO* mi, const char* master_info_fname,
+ Master_info* mi, const char* master_info_fname,
const char* slave_info_fname, int thread_mask)
{
pthread_mutex_t *lock_io=0,*lock_sql=0,*lock_cond_io=0,*lock_cond_sql=0;
@@ -450,7 +540,7 @@ int start_slave_threads(bool need_slave_mutex, bool wait_for_start,
#ifdef NOT_USED_YET
-static int end_slave_on_walk(MASTER_INFO* mi, gptr /*unused*/)
+static int end_slave_on_walk(Master_info* mi, uchar* /*unused*/)
{
DBUG_ENTER("end_slave_on_walk");
@@ -496,7 +586,7 @@ void end_slave()
}
-static bool io_slave_killed(THD* thd, MASTER_INFO* mi)
+static bool io_slave_killed(THD* thd, Master_info* mi)
{
DBUG_ENTER("io_slave_killed");
@@ -506,7 +596,7 @@ static bool io_slave_killed(THD* thd, MASTER_INFO* mi)
}
-static bool sql_slave_killed(THD* thd, RELAY_LOG_INFO* rli)
+static bool sql_slave_killed(THD* thd, Relay_log_info* rli)
{
DBUG_ENTER("sql_slave_killed");
@@ -529,13 +619,13 @@ static bool sql_slave_killed(THD* thd, RELAY_LOG_INFO* rli)
"it some grace period"));
if (difftime(time(0), rli->last_event_start_time) > 60)
{
- slave_print_msg(ERROR_LEVEL, rli, 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.");
+ 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);
}
}
@@ -544,70 +634,6 @@ static bool sql_slave_killed(THD* thd, RELAY_LOG_INFO* rli)
/*
- Writes a message to stderr, and if it's an error message, to
- rli->last_slave_error and rli->last_slave_errno (which will be displayed by
- SHOW SLAVE STATUS).
-
- SYNOPSIS
- slave_print_msg()
- level The severity level
- rli
- err_code The error code
- msg The message (usually related to the error code, but can
- contain more information).
- ... (this is printf-like format, with % symbols in msg)
-
- RETURN VALUES
- void
-*/
-
-void slave_print_msg(enum loglevel level, RELAY_LOG_INFO const *rli,
- int err_code, const char* msg, ...)
-{
- void (*report_function)(const char *, ...);
- char buff[MAX_SLAVE_ERRMSG], *pbuff= buff;
- uint pbuffsize= sizeof(buff);
- va_list args;
- DBUG_ENTER("slave_print_msg");
-
- va_start(args,msg);
- switch (level)
- {
- case ERROR_LEVEL:
- /*
- This my_error call only has effect in client threads.
- Slave threads do nothing in my_error().
- */
- my_error(ER_UNKNOWN_ERROR, MYF(0), msg);
- /*
- It's an error, it must be reported in Last_error and Last_errno in SHOW
- SLAVE STATUS.
- */
- pbuff= const_cast<RELAY_LOG_INFO*>(rli)->last_slave_error;
- pbuffsize= sizeof(rli->last_slave_error);
- const_cast<RELAY_LOG_INFO*>(rli)->last_slave_errno = err_code;
- report_function= sql_print_error;
- break;
- case WARNING_LEVEL:
- report_function= sql_print_warning;
- break;
- case INFORMATION_LEVEL:
- report_function= sql_print_information;
- break;
- default:
- DBUG_ASSERT(0); // should not come here
- DBUG_VOID_RETURN; // don't crash production builds, just do nothing
- }
- my_vsnprintf(pbuff, pbuffsize, msg, args);
- /* If the msg string ends with '.', do not add a ',' it would be ugly */
- if (pbuff[0] && (*(strend(pbuff)-1) == '.'))
- (*report_function)("Slave: %s Error_code: %d", pbuff, err_code);
- else
- (*report_function)("Slave: %s, Error_code: %d", pbuff, err_code);
- DBUG_VOID_RETURN;
-}
-
-/*
skip_load_data_infile()
NOTES
@@ -620,7 +646,7 @@ void skip_load_data_infile(NET *net)
(void)net_request_file(net, "/dev/null");
(void)my_net_read(net); // discard response
- (void)net_write_command(net, 0, "", 0, "", 0); // Send ok
+ (void)net_write_command(net, 0, (uchar*) "", 0, (uchar*) "", 0); // ok
DBUG_VOID_RETURN;
}
@@ -628,7 +654,8 @@ void skip_load_data_infile(NET *net)
bool net_request_file(NET* net, const char* fname)
{
DBUG_ENTER("net_request_file");
- DBUG_RETURN(net_write_command(net, 251, fname, strlen(fname), "", 0));
+ DBUG_RETURN(net_write_command(net, 251, (uchar*) fname, strlen(fname),
+ (uchar*) "", 0));
}
/*
@@ -709,7 +736,7 @@ int init_intvar_from_file(int* var, IO_CACHE* f, int default_val)
1 error
*/
-static int get_master_version_and_clock(MYSQL* mysql, MASTER_INFO* mi)
+static int get_master_version_and_clock(MYSQL* mysql, Master_info* mi)
{
const char* errmsg= 0;
DBUG_ENTER("get_master_version_and_clock");
@@ -774,7 +801,9 @@ static int get_master_version_and_clock(MYSQL* mysql, MASTER_INFO* mi)
/* as we are here, we tried to allocate the event */
if (!mi->rli.relay_log.description_event_for_queue)
{
- sql_print_error("Slave I/O thread failed to create a default Format_description_log_event");
+ mi->report(ERROR_LEVEL, ER_SLAVE_CREATE_EVENT_FAILURE,
+ ER(ER_SLAVE_CREATE_EVENT_FAILURE),
+ "default Format_description_log_event");
DBUG_RETURN(1);
}
@@ -923,6 +952,7 @@ static int create_table_from_dump(THD* thd, MYSQL *mysql, const char* db,
handler *file;
ulonglong save_options;
NET *net= &mysql->net;
+ const char *found_semicolon= NULL;
DBUG_ENTER("create_table_from_dump");
packet_len= my_net_read(net); // read create table statement
@@ -974,7 +1004,7 @@ static int create_table_from_dump(THD* thd, MYSQL *mysql, const char* db,
thd->db = (char*)db;
DBUG_ASSERT(thd->db != 0);
thd->db_length= strlen(thd->db);
- mysql_parse(thd, thd->query, packet_len); // run create table
+ mysql_parse(thd, thd->query, packet_len, &found_semicolon); // run create table
thd->db = save_db; // leave things the way the were before
thd->db_length= save_db_length;
thd->options = save_options;
@@ -984,7 +1014,7 @@ static int create_table_from_dump(THD* thd, MYSQL *mysql, const char* db,
thd_proc_info(thd, "Opening master dump table");
tables.lock_type = TL_WRITE;
- if (!open_ltable(thd, &tables, TL_WRITE))
+ if (!open_ltable(thd, &tables, TL_WRITE, 0))
{
sql_print_error("create_table_from_dump: could not open created table");
goto err;
@@ -1025,7 +1055,7 @@ err:
int fetch_master_table(THD *thd, const char *db_name, const char *table_name,
- MASTER_INFO *mi, MYSQL *mysql, bool overwrite)
+ Master_info *mi, MYSQL *mysql, bool overwrite)
{
int error= 1;
const char *errmsg=0;
@@ -1080,10 +1110,10 @@ int fetch_master_table(THD *thd, const char *db_name, const char *table_name,
}
-static bool wait_for_relay_log_space(RELAY_LOG_INFO* rli)
+static bool wait_for_relay_log_space(Relay_log_info* rli)
{
bool slave_killed=0;
- MASTER_INFO* mi = rli->mi;
+ Master_info* mi = rli->mi;
const char *save_proc_info;
THD* thd = mi->io_thd;
DBUG_ENTER("wait_for_relay_log_space");
@@ -1115,9 +1145,9 @@ Waiting for the slave SQL thread to free enough relay log space");
ignored events' end position for the use of the slave SQL thread, by
calling this function. Only that thread can call it (see assertion).
*/
-static void write_ignored_events_info_to_relay_log(THD *thd, MASTER_INFO *mi)
+static void write_ignored_events_info_to_relay_log(THD *thd, Master_info *mi)
{
- RELAY_LOG_INFO *rli= &mi->rli;
+ Relay_log_info *rli= &mi->rli;
pthread_mutex_t *log_lock= rli->relay_log.get_log_lock();
DBUG_ENTER("write_ignored_events_info_to_relay_log");
@@ -1136,18 +1166,21 @@ static void write_ignored_events_info_to_relay_log(THD *thd, MASTER_INFO *mi)
{
ev->server_id= 0; // don't be ignored by slave SQL thread
if (unlikely(rli->relay_log.append(ev)))
- sql_print_error("Slave I/O thread failed to write a Rotate event"
- " to the relay log, "
- "SHOW SLAVE STATUS may be inaccurate");
+ mi->report(ERROR_LEVEL, ER_SLAVE_RELAY_LOG_WRITE_FAILURE,
+ ER(ER_SLAVE_RELAY_LOG_WRITE_FAILURE),
+ "failed to write a Rotate event"
+ " to the relay log, SHOW SLAVE STATUS may be"
+ " inaccurate");
rli->relay_log.harvest_bytes_written(&rli->log_space_total);
if (flush_master_info(mi, 1))
sql_print_error("Failed to flush master info file");
delete ev;
}
else
- sql_print_error("Slave I/O thread failed to create a Rotate event"
- " (out of memory?), "
- "SHOW SLAVE STATUS may be inaccurate");
+ mi->report(ERROR_LEVEL, ER_SLAVE_CREATE_EVENT_FAILURE,
+ ER(ER_SLAVE_CREATE_EVENT_FAILURE),
+ "Rotate_event (out of memory?),"
+ " SHOW SLAVE STATUS may be inaccurate");
}
else
pthread_mutex_unlock(log_lock);
@@ -1155,12 +1188,14 @@ static void write_ignored_events_info_to_relay_log(THD *thd, MASTER_INFO *mi)
}
-int register_slave_on_master(MYSQL* mysql)
+int register_slave_on_master(MYSQL* mysql, Master_info *mi,
+ bool *suppress_warnings)
{
- char buf[1024], *pos= buf;
+ uchar buf[1024], *pos= buf;
uint report_host_len, report_user_len=0, report_password_len=0;
DBUG_ENTER("register_slave_on_master");
+ *suppress_warnings= FALSE;
if (!report_host)
DBUG_RETURN(0);
report_host_len= strlen(report_host);
@@ -1174,27 +1209,35 @@ int register_slave_on_master(MYSQL* mysql)
DBUG_RETURN(0); // safety
int4store(pos, server_id); pos+= 4;
- pos= net_store_data(pos, report_host, report_host_len);
- pos= net_store_data(pos, report_user, report_user_len);
- pos= net_store_data(pos, report_password, report_password_len);
+ pos= net_store_data(pos, (uchar*) report_host, report_host_len);
+ pos= net_store_data(pos, (uchar*) report_user, report_user_len);
+ pos= net_store_data(pos, (uchar*) report_password, report_password_len);
int2store(pos, (uint16) report_port); pos+= 2;
int4store(pos, rpl_recovery_rank); pos+= 4;
/* The master will fill in master_id */
int4store(pos, 0); pos+= 4;
- if (simple_command(mysql, COM_REGISTER_SLAVE, (char*) buf,
- (uint) (pos- buf), 0))
+ if (simple_command(mysql, COM_REGISTER_SLAVE, buf, (size_t) (pos- buf), 0))
{
- sql_print_error("Error on COM_REGISTER_SLAVE: %d '%s'",
- mysql_errno(mysql),
- mysql_error(mysql));
+ if (mysql_errno(mysql) == ER_NET_READ_INTERRUPTED)
+ {
+ *suppress_warnings= TRUE; // Suppress reconnect warning
+ }
+ else
+ {
+ char buf[256];
+ my_snprintf(buf, sizeof(buf), "%s (Errno: %d)", mysql_error(mysql),
+ mysql_errno(mysql));
+ mi->report(ERROR_LEVEL, ER_SLAVE_MASTER_COM_FAILURE,
+ ER(ER_SLAVE_MASTER_COM_FAILURE), "COM_REGISTER_SLAVE", buf);
+ }
DBUG_RETURN(1);
}
DBUG_RETURN(0);
}
-bool show_master_info(THD* thd, MASTER_INFO* mi)
+bool show_master_info(THD* thd, Master_info* mi)
{
// TODO: fix this for multi-master
List<Item> field_list;
@@ -1257,6 +1300,10 @@ bool show_master_info(THD* thd, MASTER_INFO* mi)
MYSQL_TYPE_LONGLONG));
field_list.push_back(new Item_empty_string("Master_SSL_Verify_Server_Cert",
3));
+ field_list.push_back(new Item_return_int("Last_IO_Errno", 4, MYSQL_TYPE_LONG));
+ 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));
if (protocol->send_fields(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
@@ -1305,15 +1352,15 @@ bool show_master_info(THD* thd, MASTER_INFO* mi)
rpl_filter->get_wild_ignore_table(&tmp);
protocol->store(&tmp);
- protocol->store(mi->rli.last_slave_errno);
- protocol->store(mi->rli.last_slave_error, &my_charset_bin);
+ protocol->store(mi->rli.last_error().number);
+ protocol->store(mi->rli.last_error().message, &my_charset_bin);
protocol->store((uint32) mi->rli.slave_skip_counter);
protocol->store((ulonglong) mi->rli.group_master_log_pos);
protocol->store((ulonglong) mi->rli.log_space_total);
protocol->store(
- mi->rli.until_condition==RELAY_LOG_INFO::UNTIL_NONE ? "None":
- ( mi->rli.until_condition==RELAY_LOG_INFO::UNTIL_MASTER_POS? "Master":
+ mi->rli.until_condition==Relay_log_info::UNTIL_NONE ? "None":
+ ( mi->rli.until_condition==Relay_log_info::UNTIL_MASTER_POS? "Master":
"Relay"), &my_charset_bin);
protocol->store(mi->rli.until_log_name, &my_charset_bin);
protocol->store((ulonglong) mi->rli.until_log_pos);
@@ -1367,10 +1414,19 @@ bool show_master_info(THD* thd, MASTER_INFO* mi)
}
protocol->store(mi->ssl_verify_server_cert? "Yes":"No", &my_charset_bin);
+ // Last_IO_Errno
+ protocol->store(mi->last_error().number);
+ // Last_IO_Error
+ protocol->store(mi->last_error().message, &my_charset_bin);
+ // Last_SQL_Errno
+ protocol->store(mi->rli.last_error().number);
+ // Last_SQL_Error
+ protocol->store(mi->rli.last_error().message, &my_charset_bin);
+
pthread_mutex_unlock(&mi->rli.data_lock);
pthread_mutex_unlock(&mi->data_lock);
- if (my_net_write(&thd->net, (char*)thd->packet.ptr(), packet->length()))
+ if (my_net_write(&thd->net, (uchar*) thd->packet.ptr(), packet->length()))
DBUG_RETURN(TRUE);
}
send_eof(thd);
@@ -1400,7 +1456,7 @@ void set_slave_thread_options(THD* thd)
DBUG_VOID_RETURN;
}
-void set_slave_thread_default_charset(THD* thd, RELAY_LOG_INFO const *rli)
+void set_slave_thread_default_charset(THD* thd, Relay_log_info const *rli)
{
DBUG_ENTER("set_slave_thread_default_charset");
@@ -1418,7 +1474,7 @@ void set_slave_thread_default_charset(THD* thd, RELAY_LOG_INFO const *rli)
the thread. That the cache has to be invalidated is a secondary
effect.
*/
- const_cast<RELAY_LOG_INFO*>(rli)->cached_charset_invalidate();
+ const_cast<Relay_log_info*>(rli)->cached_charset_invalidate();
DBUG_VOID_RETURN;
}
@@ -1441,6 +1497,7 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type)
thd->variables.max_allowed_packet= global_system_variables.max_allowed_packet
+ MAX_LOG_EVENT_HEADER; /* note, incr over the global not session var */
thd->slave_thread = 1;
+ thd->enable_slow_log= opt_log_slow_slave_statements;
set_slave_thread_options(thd);
thd->client_capabilities = CLIENT_LOCAL_FILES;
pthread_mutex_lock(&LOCK_thread_count);
@@ -1472,7 +1529,7 @@ static int safe_sleep(THD* thd, int sec, CHECK_KILLED_FUNC thread_killed,
DBUG_ENTER("safe_sleep");
thr_alarm_init(&alarmed);
- time_t start_time= time((time_t*) 0);
+ time_t start_time= my_time(0);
time_t end_time= start_time+sec;
while ((nap_time= (int) (end_time - start_time)) > 0)
@@ -1489,20 +1546,22 @@ static int safe_sleep(THD* thd, int sec, CHECK_KILLED_FUNC thread_killed,
if ((*thread_killed)(thd,thread_killed_arg))
DBUG_RETURN(1);
- start_time=time((time_t*) 0);
+ start_time= my_time(0);
}
DBUG_RETURN(0);
}
-static int request_dump(MYSQL* mysql, MASTER_INFO* mi,
+static int request_dump(MYSQL* mysql, Master_info* mi,
bool *suppress_warnings)
{
- char buf[FN_REFLEN + 10];
+ uchar buf[FN_REFLEN + 10];
int len;
int binlog_flags = 0; // for now
char* logname = mi->master_log_name;
DBUG_ENTER("request_dump");
+
+ *suppress_warnings= FALSE;
// TODO if big log files: Change next to int8store()
int4store(buf, (ulong) mi->master_log_pos);
@@ -1518,7 +1577,7 @@ static int request_dump(MYSQL* mysql, MASTER_INFO* mi,
now we just fill up the error log :-)
*/
if (mysql_errno(mysql) == ER_NET_READ_INTERRUPTED)
- *suppress_warnings= 1; // Suppress reconnect warning
+ *suppress_warnings= TRUE; // Suppress reconnect warning
else
sql_print_error("Error on COM_BINLOG_DUMP: %d %s, will retry in %d secs",
mysql_errno(mysql), mysql_error(mysql),
@@ -1532,10 +1591,9 @@ static int request_dump(MYSQL* mysql, MASTER_INFO* mi,
static int request_table_dump(MYSQL* mysql, const char* db, const char* table)
{
- char buf[1024];
+ uchar buf[1024], *p = buf;
DBUG_ENTER("request_table_dump");
- char * p = buf;
uint table_len = (uint) strlen(table);
uint db_len = (uint) strlen(db);
if (table_len + db_len > sizeof(buf) - 2)
@@ -1578,12 +1636,12 @@ command");
number Length of packet
*/
-static ulong read_event(MYSQL* mysql, MASTER_INFO *mi, bool* suppress_warnings)
+static ulong read_event(MYSQL* mysql, Master_info *mi, bool* suppress_warnings)
{
ulong len;
DBUG_ENTER("read_event");
- *suppress_warnings= 0;
+ *suppress_warnings= FALSE;
/*
my_real_read() will time us out
We check if we were told to die, and if not, try reading again
@@ -1626,7 +1684,7 @@ static ulong read_event(MYSQL* mysql, MASTER_INFO *mi, bool* suppress_warnings)
}
-int check_expected_error(THD* thd, RELAY_LOG_INFO const *rli,
+int check_expected_error(THD* thd, Relay_log_info const *rli,
int expected_error)
{
DBUG_ENTER("check_expected_error");
@@ -1688,7 +1746,7 @@ static int has_temporary_error(THD *thd)
DBUG_RETURN(0);
}
-static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli)
+static int exec_relay_log_event(THD* thd, Relay_log_info* rli)
{
DBUG_ENTER("exec_relay_log_event");
@@ -1706,7 +1764,7 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli)
was an event ignored by the I/O thread just before (BUG#13861 to be
fixed).
*/
- if (rli->until_condition!=RELAY_LOG_INFO::UNTIL_NONE &&
+ if (rli->until_condition!=Relay_log_info::UNTIL_NONE &&
rli->is_until_satisfied())
{
char buf[22];
@@ -1776,7 +1834,7 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli)
thd->set_time(); // time the query
thd->lex->current_select= 0;
if (!ev->when)
- ev->when = time(NULL);
+ ev->when= my_time(0);
ev->thd = thd; // because up to this point, ev->thd == 0
int reason= ev->shall_skip(rli);
@@ -1824,13 +1882,13 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli)
*/
if (error)
{
- slave_print_msg(ERROR_LEVEL, rli, ER_UNKNOWN_ERROR,
- "It was not possible to update the positions"
- " of the relay log information: the slave may"
- " be in an inconsistent state."
- " Stopped in %s position %s",
- rli->group_relay_log_name,
- llstr(rli->group_relay_log_pos, buf));
+ rli->report(ERROR_LEVEL, ER_UNKNOWN_ERROR,
+ "It was not possible to update the positions"
+ " of the relay log information: the slave may"
+ " be in an inconsistent state."
+ " Stopped in %s position %s",
+ rli->group_relay_log_name,
+ llstr(rli->group_relay_log_pos, buf));
DBUG_RETURN(1);
}
}
@@ -1909,7 +1967,8 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli)
DBUG_RETURN(exec_res);
}
pthread_mutex_unlock(&rli->data_lock);
- slave_print_msg(ERROR_LEVEL, rli, 0, "\
+ rli->report(ERROR_LEVEL, ER_SLAVE_RELAY_LOG_READ_FAILURE,
+ ER(ER_SLAVE_RELAY_LOG_READ_FAILURE), "\
Could not parse relay log event entry. The possible reasons are: the master's \
binary log is corrupted (you can check this by running 'mysqlbinlog' on the \
binary log), the slave's relay log is corrupted (you can check this by running \
@@ -1922,17 +1981,108 @@ on this slave.\
}
+static bool check_io_slave_killed(THD *thd, Master_info *mi, const char *info)
+{
+ if (io_slave_killed(thd, mi))
+ {
+ if (global_system_variables.log_warnings)
+ sql_print_information(info);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+/**
+ @brief Try to reconnect slave IO thread.
+
+ @details Terminates current connection to master, sleeps for
+ @c mi->connect_retry msecs and initiates new connection with
+ @c safe_reconnect(). Variable pointed by @c retry_count is increased -
+ if it exceeds @c master_retry_count then connection is not re-established
+ and function signals error.
+ Unless @c suppres_warnings is TRUE, a warning is put in the server error log
+ when reconnecting. The warning message and messages used to report errors
+ are taken from @c messages array. In case @c master_retry_count is exceeded,
+ no messages are added to the log.
+
+ @param[in] thd Thread context.
+ @param[in] mysql MySQL connection.
+ @param[in] mi Master connection information.
+ @param[in,out] retry_count Number of attempts to reconnect.
+ @param[in] suppress_warnings TRUE when a normal net read timeout
+ has caused to reconnecting.
+ @param[in] messages Messages to print/log, see
+ reconnect_messages[] array.
+
+ @retval 0 OK.
+ @retval 1 There was an error.
+*/
+
+static int try_to_reconnect(THD *thd, MYSQL *mysql, Master_info *mi,
+ uint *retry_count, bool suppress_warnings,
+ const char *messages[SLAVE_RECON_MSG_MAX])
+{
+ mi->slave_running= MYSQL_SLAVE_RUN_NOT_CONNECT;
+ thd->proc_info= messages[SLAVE_RECON_MSG_WAIT];
+#ifdef SIGNAL_WITH_VIO_CLOSE
+ thd->clear_active_vio();
+#endif
+ end_server(mysql);
+ if ((*retry_count)++)
+ {
+ if (*retry_count > master_retry_count)
+ return 1; // Don't retry forever
+ safe_sleep(thd, mi->connect_retry, (CHECK_KILLED_FUNC) io_slave_killed,
+ (void *) mi);
+ }
+ if (check_io_slave_killed(thd, mi, messages[SLAVE_RECON_MSG_KILLED_WAITING]))
+ return 1;
+ thd->proc_info = messages[SLAVE_RECON_MSG_AFTER];
+ if (!suppress_warnings)
+ {
+ char buf[256], llbuff[22];
+ my_snprintf(buf, sizeof(buf), messages[SLAVE_RECON_MSG_FAILED],
+ IO_RPL_LOG_NAME, llstr(mi->master_log_pos, llbuff));
+ /*
+ Raise a warining during registering on master/requesting dump.
+ Log a message reading event.
+ */
+ if (messages[SLAVE_RECON_MSG_COMMAND][0])
+ {
+ mi->report(WARNING_LEVEL, ER_SLAVE_MASTER_COM_FAILURE,
+ ER(ER_SLAVE_MASTER_COM_FAILURE),
+ messages[SLAVE_RECON_MSG_COMMAND], buf);
+ }
+ else
+ {
+ sql_print_information(buf);
+ }
+ }
+ if (safe_reconnect(thd, mysql, mi, 1) || io_slave_killed(thd, mi))
+ {
+ if (global_system_variables.log_warnings)
+ sql_print_information(messages[SLAVE_RECON_MSG_KILLED_AFTER]);
+ return 1;
+ }
+ return 0;
+}
+
+
/* Slave I/O Thread entry point */
pthread_handler_t handle_slave_io(void *arg)
{
THD *thd; // needs to be first for thread_stack
MYSQL *mysql;
- MASTER_INFO *mi = (MASTER_INFO*)arg;
- RELAY_LOG_INFO *rli= &mi->rli;
+ Master_info *mi = (Master_info*)arg;
+ Relay_log_info *rli= &mi->rli;
char llbuff[22];
uint retry_count;
-
+ bool suppress_warnings;
+#ifndef DBUG_OFF
+ uint retry_count_reg= 0, retry_count_dump= 0, retry_count_event= 0;
+#endif
// needs to call my_thread_init(), otherwise we get a coredump in DBUG_ stuff
my_thread_init();
DBUG_ENTER("handle_slave_io");
@@ -1976,7 +2126,8 @@ pthread_handler_t handle_slave_io(void *arg)
if (!(mi->mysql = mysql = mysql_init(NULL)))
{
- sql_print_error("Slave I/O thread: error in mysql_init()");
+ mi->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR,
+ ER(ER_SLAVE_FATAL_ERROR), "error in mysql_init()");
goto err;
}
@@ -2015,74 +2166,58 @@ connected:
{
/*
Register ourselves with the master.
- If fails, this is not fatal - we just print the error message and go
- on with life.
*/
thd_proc_info(thd, "Registering slave on master");
- if (register_slave_on_master(mysql) || update_slave_list(mysql, mi))
- goto err;
+ if (register_slave_on_master(mysql, mi, &suppress_warnings))
+ {
+ sql_print_error("Slave I/O thread couldn't register on master");
+ if (check_io_slave_killed(thd, mi, "Slave I/O thread killed while \
+registering slave on master") ||
+ try_to_reconnect(thd, mysql, mi, &retry_count, suppress_warnings,
+ reconnect_messages[SLAVE_RECON_ACT_REG]))
+ goto err;
+ goto connected;
+ }
+ DBUG_EXECUTE_IF("FORCE_SLAVE_TO_RECONNECT_REG",
+ if (!retry_count_reg)
+ {
+ retry_count_reg++;
+ sql_print_information("Forcing to reconnect slave I/O thread");
+ if (try_to_reconnect(thd, mysql, mi, &retry_count, suppress_warnings,
+ reconnect_messages[SLAVE_RECON_ACT_REG]))
+ goto err;
+ goto connected;
+ });
}
DBUG_PRINT("info",("Starting reading binary log from master"));
while (!io_slave_killed(thd,mi))
{
- bool suppress_warnings= 0;
thd_proc_info(thd, "Requesting binlog dump");
if (request_dump(mysql, mi, &suppress_warnings))
{
sql_print_error("Failed on request_dump()");
- if (io_slave_killed(thd,mi))
- {
- sql_print_information("Slave I/O thread killed while requesting master \
-dump");
+ if (check_io_slave_killed(thd, mi, "Slave I/O thread killed while \
+requesting master dump") ||
+ try_to_reconnect(thd, mysql, mi, &retry_count, suppress_warnings,
+ reconnect_messages[SLAVE_RECON_ACT_DUMP]))
goto err;
- }
-
- mi->slave_running= MYSQL_SLAVE_RUN_NOT_CONNECT;
- thd_proc_info(thd, "Waiting to reconnect after a failed binlog dump request");
-#ifdef SIGNAL_WITH_VIO_CLOSE
- thd->clear_active_vio();
-#endif
- end_server(mysql);
- /*
- First time retry immediately, assuming that we can recover
- right away - if first time fails, sleep between re-tries
- hopefuly the admin can fix the problem sometime
- */
- if (retry_count++)
- {
- if (retry_count > master_retry_count)
- goto err; // Don't retry forever
- safe_sleep(thd,mi->connect_retry,(CHECK_KILLED_FUNC)io_slave_killed,
- (void*)mi);
- }
- if (io_slave_killed(thd,mi))
- {
- sql_print_information("Slave I/O thread killed while retrying master \
-dump");
- goto err;
- }
-
- thd_proc_info(thd, "Reconnecting after a failed binlog dump request");
- if (!suppress_warnings)
- sql_print_error("Slave I/O thread: failed dump request, \
-reconnecting to try again, log '%s' at postion %s", IO_RPL_LOG_NAME,
- llstr(mi->master_log_pos,llbuff));
- if (safe_reconnect(thd, mysql, mi, suppress_warnings) ||
- io_slave_killed(thd,mi))
- {
- sql_print_information("Slave I/O thread killed during or \
-after reconnect");
- goto err;
- }
-
goto connected;
}
+ DBUG_EXECUTE_IF("FORCE_SLAVE_TO_RECONNECT_DUMP",
+ if (!retry_count_dump)
+ {
+ retry_count_dump++;
+ sql_print_information("Forcing to reconnect slave I/O thread");
+ if (try_to_reconnect(thd, mysql, mi, &retry_count, suppress_warnings,
+ reconnect_messages[SLAVE_RECON_ACT_DUMP]))
+ goto err;
+ goto connected;
+ });
while (!io_slave_killed(thd,mi))
{
ulong event_len;
- suppress_warnings= 0;
/*
We say "waiting" because read_event() will wait if there's nothing to
read. But if there's something to read, it will not wait. The
@@ -2091,64 +2226,44 @@ after reconnect");
*/
thd_proc_info(thd, "Waiting for master to send event");
event_len= read_event(mysql, mi, &suppress_warnings);
- if (io_slave_killed(thd,mi))
- {
- if (global_system_variables.log_warnings)
- sql_print_information("Slave I/O thread killed while reading event");
+ if (check_io_slave_killed(thd, mi, "Slave I/O thread killed while \
+reading event"))
goto err;
- }
+ DBUG_EXECUTE_IF("FORCE_SLAVE_TO_RECONNECT_EVENT",
+ if (!retry_count_event)
+ {
+ retry_count_event++;
+ sql_print_information("Forcing to reconnect slave I/O thread");
+ if (try_to_reconnect(thd, mysql, mi, &retry_count, suppress_warnings,
+ reconnect_messages[SLAVE_RECON_ACT_EVENT]))
+ goto err;
+ goto connected;
+ });
if (event_len == packet_error)
{
uint mysql_error_number= mysql_errno(mysql);
- if (mysql_error_number == CR_NET_PACKET_TOO_LARGE)
- {
+ switch (mysql_error_number) {
+ case CR_NET_PACKET_TOO_LARGE:
sql_print_error("\
Log entry on master is longer than max_allowed_packet (%ld) on \
slave. If the entry is correct, restart the server with a higher value of \
max_allowed_packet",
thd->variables.max_allowed_packet);
goto err;
- }
- if (mysql_error_number == ER_MASTER_FATAL_ERROR_READING_BINLOG)
- {
+ case ER_MASTER_FATAL_ERROR_READING_BINLOG:
sql_print_error(ER(mysql_error_number), mysql_error_number,
mysql_error(mysql));
goto err;
- }
- mi->slave_running= MYSQL_SLAVE_RUN_NOT_CONNECT;
- thd_proc_info(thd, "Waiting to reconnect after a failed master event read");
-#ifdef SIGNAL_WITH_VIO_CLOSE
- thd->clear_active_vio();
-#endif
- end_server(mysql);
- if (retry_count++)
- {
- if (retry_count > master_retry_count)
- goto err; // Don't retry forever
- safe_sleep(thd,mi->connect_retry,(CHECK_KILLED_FUNC)io_slave_killed,
- (void*) mi);
- }
- if (io_slave_killed(thd,mi))
- {
- if (global_system_variables.log_warnings)
- sql_print_information("Slave I/O thread killed while waiting to \
-reconnect after a failed read");
+ case EE_OUTOFMEMORY:
+ case ER_OUTOFMEMORY:
+ sql_print_error("\
+Stopping slave I/O thread due to out-of-memory error from master");
goto err;
}
- thd_proc_info(thd, "Reconnecting after a failed master event read");
- if (!suppress_warnings)
- sql_print_information("Slave I/O thread: Failed reading log event, \
-reconnecting to retry, log '%s' position %s", IO_RPL_LOG_NAME,
- llstr(mi->master_log_pos, llbuff));
- if (safe_reconnect(thd, mysql, mi, suppress_warnings) ||
- io_slave_killed(thd,mi))
- {
- if (global_system_variables.log_warnings)
- sql_print_information("Slave I/O thread killed during or after a \
-reconnect done to recover from failed read");
+ if (try_to_reconnect(thd, mysql, mi, &retry_count, suppress_warnings,
+ reconnect_messages[SLAVE_RECON_ACT_EVENT]))
goto err;
- }
goto connected;
} // if (event_len == packet_error)
@@ -2157,7 +2272,9 @@ reconnect done to recover from failed read");
if (queue_event(mi,(const char*)mysql->net.read_pos + 1,
event_len))
{
- sql_print_error("Slave I/O thread could not queue event from master");
+ 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 (flush_master_info(mi, 1))
@@ -2232,7 +2349,7 @@ err:
/* Forget the relay log's format */
delete mi->rli.relay_log.description_event_for_queue;
mi->rli.relay_log.description_event_for_queue= 0;
- // TODO: make rpl_status part of MASTER_INFO
+ // TODO: make rpl_status part of Master_info
change_rpl_status(RPL_ACTIVE_SLAVE,RPL_IDLE_SLAVE);
DBUG_ASSERT(thd->net.buff != 0);
net_end(&thd->net); // destructor will not free it, because net.vio is 0
@@ -2264,7 +2381,7 @@ pthread_handler_t handle_slave_sql(void *arg)
THD *thd; /* needs to be first for thread_stack */
char llbuff[22],llbuff1[22];
- RELAY_LOG_INFO* rli = &((MASTER_INFO*)arg)->rli;
+ Relay_log_info* rli = &((Master_info*)arg)->rli;
const char *errmsg;
// needs to call my_thread_init(), otherwise we get a coredump in DBUG_ stuff
@@ -2326,7 +2443,7 @@ pthread_handler_t handle_slave_sql(void *arg)
now.
But the master timestamp is reset by RESET SLAVE & CHANGE MASTER.
*/
- rli->clear_slave_error();
+ rli->clear_error();
//tell the I/O thread to take relay_log_space_limit into account from now on
pthread_mutex_lock(&rli->log_space_lock);
@@ -2410,22 +2527,22 @@ Slave SQL thread aborted. Can't execute init_slave query");
codes and warnings and print this to the error log as to
allow the user to locate the error
*/
- DBUG_PRINT("info", ("thd->net.last_errno=%d; rli->last_slave_errno=%d",
- thd->net.last_errno, rli->last_slave_errno));
+ uint32 const last_errno= rli->last_error().number;
+
+ DBUG_PRINT("info", ("thd->net.last_errno=%d; rli->last_error.number=%d",
+ thd->net.last_errno, last_errno));
if (thd->net.last_errno != 0)
{
- if (rli->last_slave_errno == 0)
+ char const *const errmsg=
+ thd->net.last_error ? thd->net.last_error : "<no message>";
+ if (last_errno == 0)
{
- slave_print_msg(ERROR_LEVEL, rli, thd->net.last_errno,
- thd->net.last_error ?
- thd->net.last_error : "<no message>");
+ rli->report(ERROR_LEVEL, thd->net.last_errno, errmsg);
}
- else if (rli->last_slave_errno != (int) thd->net.last_errno)
+ else if (last_errno != thd->net.last_errno)
{
sql_print_error("Slave (additional info): %s Error_code: %d",
- thd->net.last_error ?
- thd->net.last_error : "<no message>",
- thd->net.last_errno);
+ errmsg, thd->net.last_errno);
}
}
@@ -2533,7 +2650,7 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \
process_io_create_file()
*/
-static int process_io_create_file(MASTER_INFO* mi, Create_file_log_event* cev)
+static int process_io_create_file(Master_info* mi, Create_file_log_event* cev)
{
int error = 1;
ulong num_bytes;
@@ -2580,7 +2697,8 @@ static int process_io_create_file(MASTER_INFO* mi, Create_file_log_event* cev)
}
if (unlikely(!num_bytes)) /* eof */
{
- net_write_command(net, 0, "", 0, "", 0);/* 3.23 master wants it */
+ /* 3.23 master wants it */
+ net_write_command(net, 0, (uchar*) "", 0, (uchar*) "", 0);
/*
If we wrote Create_file_log_event, then we need to write
Execute_load_log_event. If we did not write Create_file_log_event,
@@ -2593,8 +2711,9 @@ static int process_io_create_file(MASTER_INFO* mi, Create_file_log_event* cev)
xev.log_pos = cev->log_pos;
if (unlikely(mi->rli.relay_log.append(&xev)))
{
- sql_print_error("Slave I/O: error writing Exec_load event to \
-relay log");
+ mi->report(ERROR_LEVEL, ER_SLAVE_RELAY_LOG_WRITE_FAILURE,
+ ER(ER_SLAVE_RELAY_LOG_WRITE_FAILURE),
+ "error writing Exec_load event to relay log");
goto err;
}
mi->rli.relay_log.harvest_bytes_written(&mi->rli.log_space_total);
@@ -2606,8 +2725,9 @@ relay log");
cev->block_len = num_bytes;
if (unlikely(mi->rli.relay_log.append(cev)))
{
- sql_print_error("Slave I/O: error writing Create_file event to \
-relay log");
+ mi->report(ERROR_LEVEL, ER_SLAVE_RELAY_LOG_WRITE_FAILURE,
+ ER(ER_SLAVE_RELAY_LOG_WRITE_FAILURE),
+ "error writing Create_file event to relay log");
goto err;
}
cev_not_written=0;
@@ -2620,8 +2740,9 @@ relay log");
aev.log_pos = cev->log_pos;
if (unlikely(mi->rli.relay_log.append(&aev)))
{
- sql_print_error("Slave I/O: error writing Append_block event to \
-relay log");
+ mi->report(ERROR_LEVEL, ER_SLAVE_RELAY_LOG_WRITE_FAILURE,
+ ER(ER_SLAVE_RELAY_LOG_WRITE_FAILURE),
+ "error writing Append_block event to relay log");
goto err;
}
mi->rli.relay_log.harvest_bytes_written(&mi->rli.log_space_total) ;
@@ -2656,7 +2777,7 @@ err:
*/
-static int process_io_rotate(MASTER_INFO *mi, Rotate_log_event *rev)
+static int process_io_rotate(Master_info *mi, Rotate_log_event *rev)
{
DBUG_ENTER("process_io_rotate");
safe_mutex_assert_owner(&mi->data_lock);
@@ -2704,14 +2825,14 @@ static int process_io_rotate(MASTER_INFO *mi, Rotate_log_event *rev)
Reads a 3.23 event and converts it to the slave's format. This code was
copied from MySQL 4.0.
*/
-static int queue_binlog_ver_1_event(MASTER_INFO *mi, const char *buf,
+static int queue_binlog_ver_1_event(Master_info *mi, const char *buf,
ulong event_len)
{
const char *errmsg = 0;
ulong inc_pos;
bool ignore_event= 0;
char *tmp_buf = 0;
- RELAY_LOG_INFO *rli= &mi->rli;
+ Relay_log_info *rli= &mi->rli;
DBUG_ENTER("queue_binlog_ver_1_event");
/*
@@ -2722,7 +2843,8 @@ static int queue_binlog_ver_1_event(MASTER_INFO *mi, const char *buf,
{
if (unlikely(!(tmp_buf=(char*)my_malloc(event_len+1,MYF(MY_WME)))))
{
- sql_print_error("Slave I/O: out of memory for Load event");
+ mi->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR,
+ ER(ER_SLAVE_FATAL_ERROR), "Memory allocation failed");
DBUG_RETURN(1);
}
memcpy(tmp_buf,buf,event_len);
@@ -2821,13 +2943,13 @@ static int queue_binlog_ver_1_event(MASTER_INFO *mi, const char *buf,
Reads a 4.0 event and converts it to the slave's format. This code was copied
from queue_binlog_ver_1_event(), with some affordable simplifications.
*/
-static int queue_binlog_ver_3_event(MASTER_INFO *mi, const char *buf,
+static int queue_binlog_ver_3_event(Master_info *mi, const char *buf,
ulong event_len)
{
const char *errmsg = 0;
ulong inc_pos;
char *tmp_buf = 0;
- RELAY_LOG_INFO *rli= &mi->rli;
+ Relay_log_info *rli= &mi->rli;
DBUG_ENTER("queue_binlog_ver_3_event");
/* read_log_event() will adjust log_pos to be end_log_pos */
@@ -2885,7 +3007,7 @@ err:
setup with 3.23 master or 4.0 master
*/
-static int queue_old_event(MASTER_INFO *mi, const char *buf,
+static int queue_old_event(Master_info *mi, const char *buf,
ulong event_len)
{
DBUG_ENTER("queue_old_event");
@@ -2913,11 +3035,11 @@ static int queue_old_event(MASTER_INFO *mi, const char *buf,
any >=5.0.0 format.
*/
-int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len)
+int queue_event(Master_info* mi,const char* buf, ulong event_len)
{
int error= 0;
ulong inc_pos;
- RELAY_LOG_INFO *rli= &mi->rli;
+ Relay_log_info *rli= &mi->rli;
pthread_mutex_t *log_lock= rli->relay_log.get_log_lock();
DBUG_ENTER("queue_event");
@@ -3069,7 +3191,7 @@ err:
}
-void end_relay_log_info(RELAY_LOG_INFO* rli)
+void end_relay_log_info(Relay_log_info* rli)
{
DBUG_ENTER("end_relay_log_info");
@@ -3113,7 +3235,7 @@ void end_relay_log_info(RELAY_LOG_INFO* rli)
# Error
*/
-static int safe_connect(THD* thd, MYSQL* mysql, MASTER_INFO* mi)
+static int safe_connect(THD* thd, MYSQL* mysql, Master_info* mi)
{
DBUG_ENTER("safe_connect");
@@ -3130,7 +3252,7 @@ static int safe_connect(THD* thd, MYSQL* mysql, MASTER_INFO* mi)
master_retry_count times
*/
-static int connect_to_master(THD* thd, MYSQL* mysql, MASTER_INFO* mi,
+static int connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi,
bool reconnect, bool suppress_warnings)
{
int slave_was_killed;
@@ -3177,14 +3299,12 @@ static int connect_to_master(THD* thd, MYSQL* mysql, MASTER_INFO* mi,
{
last_errno=mysql_errno(mysql);
suppress_warnings= 0;
- sql_print_error("Slave I/O thread: error %s to master "
- "'%s@%s:%d': \
-Error: '%s' errno: %d retry-time: %d retries: %lu",
- (reconnect ? "reconnecting" : "connecting"),
- mi->user, mi->host, mi->port,
- mysql_error(mysql), last_errno,
- mi->connect_retry,
- master_retry_count);
+ mi->report(ERROR_LEVEL, last_errno,
+ "error %s to master '%s@%s:%d'"
+ " - retry-time: %d retries: %lu",
+ (reconnect ? "reconnecting" : "connecting"),
+ mi->user, mi->host, mi->port,
+ mi->connect_retry, master_retry_count);
}
/*
By default we try forever. The reason is that failure will trigger
@@ -3238,7 +3358,7 @@ replication resumed in log '%s' at position %s", mi->user,
master_retry_count times
*/
-static int safe_reconnect(THD* thd, MYSQL* mysql, MASTER_INFO* mi,
+static int safe_reconnect(THD* thd, MYSQL* mysql, Master_info* mi,
bool suppress_warnings)
{
DBUG_ENTER("safe_reconnect");
@@ -3275,7 +3395,7 @@ static int safe_reconnect(THD* thd, MYSQL* mysql, MASTER_INFO* mi,
1 write error
*/
-bool flush_relay_log_info(RELAY_LOG_INFO* rli)
+bool flush_relay_log_info(Relay_log_info* rli)
{
bool error=0;
DBUG_ENTER("flush_relay_log_info");
@@ -3295,7 +3415,7 @@ bool flush_relay_log_info(RELAY_LOG_INFO* rli)
*pos++='\n';
pos=longlong2str(rli->group_master_log_pos, pos, 10);
*pos='\n';
- if (my_b_write(file, (byte*) buff, (ulong) (pos-buff)+1))
+ if (my_b_write(file, (uchar*) buff, (size_t) (pos-buff)+1))
error=1;
if (flush_io_cache(file))
error=1;
@@ -3309,7 +3429,7 @@ bool flush_relay_log_info(RELAY_LOG_INFO* rli)
Called when we notice that the current "hot" log got rotated under our feet.
*/
-static IO_CACHE *reopen_relay_log(RELAY_LOG_INFO *rli, const char **errmsg)
+static IO_CACHE *reopen_relay_log(Relay_log_info *rli, const char **errmsg)
{
DBUG_ENTER("reopen_relay_log");
DBUG_ASSERT(rli->cur_log != &rli->cache_buf);
@@ -3330,7 +3450,7 @@ static IO_CACHE *reopen_relay_log(RELAY_LOG_INFO *rli, const char **errmsg)
}
-static Log_event* next_event(RELAY_LOG_INFO* rli)
+static Log_event* next_event(Relay_log_info* rli)
{
Log_event* ev;
IO_CACHE* cur_log = rli->cur_log;
@@ -3522,10 +3642,10 @@ static Log_event* next_event(RELAY_LOG_INFO* rli)
// prevent the I/O thread from blocking next times
rli->ignore_log_space_limit= 1;
/*
- If the I/O thread is blocked, unblock it.
- Ok to broadcast after unlock, because the mutex is only destroyed in
- ~st_relay_log_info(), i.e. when rli is destroyed, and rli will not be
- destroyed before we exit the present function.
+ If the I/O thread is blocked, unblock it. Ok to broadcast
+ after unlock, because the mutex is only destroyed in
+ ~Relay_log_info(), i.e. when rli is destroyed, and rli will
+ not be destroyed before we exit the present function.
*/
pthread_mutex_unlock(&rli->log_space_lock);
pthread_cond_broadcast(&rli->log_space_cond);
@@ -3682,10 +3802,10 @@ err:
is void).
*/
-void rotate_relay_log(MASTER_INFO* mi)
+void rotate_relay_log(Master_info* mi)
{
DBUG_ENTER("rotate_relay_log");
- RELAY_LOG_INFO* rli= &mi->rli;
+ Relay_log_info* rli= &mi->rli;
/* We don't lock rli->run_lock. This would lead to deadlocks. */
pthread_mutex_lock(&mi->run_lock);
@@ -3726,11 +3846,11 @@ end:
/**
Detects, based on master's version (as found in the relay log), if master
has a certain bug.
- @param rli RELAY_LOG_INFO which tells the master's version
+ @param rli Relay_log_info which tells the master's version
@param bug_id Number of the bug as found in bugs.mysql.com
@return TRUE if master has the bug, FALSE if it does not.
*/
-bool rpl_master_has_bug(RELAY_LOG_INFO *rli, uint bug_id)
+bool rpl_master_has_bug(Relay_log_info *rli, uint bug_id)
{
struct st_version_range_for_one_bug {
uint bug_id;
@@ -3762,9 +3882,9 @@ bool rpl_master_has_bug(RELAY_LOG_INFO *rli, uint bug_id)
" so slave stops; check error log on slave"
" for more info", MYF(0), bug_id);
// a verbose message for the error log
- slave_print_msg(ERROR_LEVEL, rli, ER_UNKNOWN_ERROR,
- "According to the master's version ('%s'),"
- " it is probable that master suffers from this bug:"
+ rli->report(ERROR_LEVEL, ER_UNKNOWN_ERROR,
+ "According to the master's version ('%s'),"
+ " it is probable that master suffers from this bug:"
" http://bugs.mysql.com/bug.php?id=%u"
" and thus replicating the current binary log event"
" may make the slave's data become different from the"
diff --git a/sql/slave.h b/sql/slave.h
index cb880c8125d..2cd9ea352ba 100644
--- a/sql/slave.h
+++ b/sql/slave.h
@@ -16,6 +16,12 @@
#ifndef SLAVE_H
#define SLAVE_H
+/**
+ @defgroup Replication Replication
+ @{
+
+ @file
+*/
#ifdef HAVE_REPLICATION
#include "log.h"
@@ -29,10 +35,9 @@
// Forward declarations
-struct st_relay_log_info;
-typedef st_relay_log_info RELAY_LOG_INFO;
+class Relay_log_info;
+class Master_info;
-class MASTER_INFO;
/*****************************************************************************
@@ -43,11 +48,11 @@ class MASTER_INFO;
I/O Thread - One of these threads is started for each master server.
They maintain a connection to their master server, read log
events from the master as they arrive, and queues them into
- a single, shared relay log file. A MASTER_INFO
+ a single, shared relay log file. A Master_info
represents each of these threads.
SQL Thread - One of these threads is started and reads from the relay log
- file, executing each event. A RELAY_LOG_INFO
+ file, executing each event. A Relay_log_info
represents this thread.
Buffering in the relay log file makes it unnecessary to reread events from
@@ -70,18 +75,18 @@ class MASTER_INFO;
mi->run_lock, keeps rli->run_lock, and tries to re-acquire mi->run_lock).
Currently active_mi never moves (it's created at startup and deleted at
- shutdown, and not changed: it always points to the same MASTER_INFO struct),
+ shutdown, and not changed: it always points to the same Master_info struct),
because we don't have multimaster. So for the moment, mi does not move, and
mi->rli does not either.
- In MASTER_INFO: run_lock, data_lock
+ In Master_info: run_lock, data_lock
run_lock protects all information about the run state: slave_running, and the
existence of the I/O thread (to stop/start it, you need this mutex).
data_lock protects some moving members of the struct: counters (log name,
position) and relay log (MYSQL_BIN_LOG object).
- In RELAY_LOG_INFO: run_lock, data_lock
- see MASTER_INFO
+ In Relay_log_info: run_lock, data_lock
+ see Master_info
Order of acquisition: if you want to have LOCK_active_mi and a run_lock, you
must acquire LOCK_active_mi first.
@@ -94,20 +99,20 @@ class MASTER_INFO;
extern ulong master_retry_count;
extern MY_BITMAP slave_error_mask;
extern bool use_slave_mask;
-extern char* slave_load_tmpdir;
-extern my_string master_info_file,relay_log_info_file;
-extern my_string opt_relay_logname, opt_relaylog_index_name;
+extern char *slave_load_tmpdir;
+extern char *master_info_file, *relay_log_info_file;
+extern char *opt_relay_logname, *opt_relaylog_index_name;
extern my_bool opt_skip_slave_start, opt_reckless_slave;
extern my_bool opt_log_slave_updates;
extern ulonglong relay_log_space_limit;
/*
- 3 possible values for MASTER_INFO::slave_running and
- RELAY_LOG_INFO::slave_running.
+ 3 possible values for Master_info::slave_running and
+ Relay_log_info::slave_running.
The values 0,1,2 are very important: to keep the diff small, I didn't
substitute places where we use 0/1 with the newly defined symbols. So don't change
these values.
- The same way, code is assuming that in RELAY_LOG_INFO we use only values
+ The same way, code is assuming that in Relay_log_info we use only values
0/1.
I started with using an enum, but
enum_variable=1; is not legal so would have required many line changes.
@@ -129,16 +134,12 @@ extern ulonglong relay_log_space_limit;
int init_slave();
void init_slave_skip_errors(const char* arg);
-bool flush_relay_log_info(RELAY_LOG_INFO* rli);
+bool flush_relay_log_info(Relay_log_info* rli);
int register_slave_on_master(MYSQL* mysql);
-int terminate_slave_threads(MASTER_INFO* mi, int thread_mask,
+int terminate_slave_threads(Master_info* mi, int thread_mask,
bool skip_lock = 0);
-int terminate_slave_thread(THD* thd, pthread_mutex_t* term_mutex,
- pthread_mutex_t* cond_lock,
- pthread_cond_t* term_cond,
- volatile uint* slave_running);
int start_slave_threads(bool need_slave_mutex, bool wait_for_start,
- MASTER_INFO* mi, const char* master_info_fname,
+ Master_info* mi, const char* master_info_fname,
const char* slave_info_fname, int thread_mask);
/*
cond_lock is usually same as start_lock. It is needed for the case when
@@ -151,7 +152,7 @@ int start_slave_thread(pthread_handler h_func, pthread_mutex_t* start_lock,
pthread_cond_t* start_cond,
volatile uint *slave_running,
volatile ulong *slave_run_id,
- MASTER_INFO* mi,
+ Master_info* mi,
bool high_priority);
/* If fd is -1, dump to NET */
@@ -160,40 +161,37 @@ int mysql_table_dump(THD* thd, const char* db,
/* retrieve table from master and copy to slave*/
int fetch_master_table(THD* thd, const char* db_name, const char* table_name,
- MASTER_INFO* mi, MYSQL* mysql, bool overwrite);
+ Master_info* mi, MYSQL* mysql, bool overwrite);
-bool show_master_info(THD* thd, MASTER_INFO* mi);
+bool show_master_info(THD* thd, Master_info* mi);
bool show_binlog_info(THD* thd);
-bool rpl_master_has_bug(RELAY_LOG_INFO *rli, uint bug_id);
+bool rpl_master_has_bug(Relay_log_info *rli, uint bug_id);
const char *print_slave_db_safe(const char *db);
-int check_expected_error(THD* thd, RELAY_LOG_INFO const *rli, int error_code);
+int check_expected_error(THD* thd, Relay_log_info const *rli, int error_code);
void skip_load_data_infile(NET* net);
-void slave_print_msg(enum loglevel level, RELAY_LOG_INFO const *rli,
- int err_code, const char* msg, ...)
- ATTRIBUTE_FORMAT(printf, 4, 5);
void end_slave(); /* clean up */
-void clear_until_condition(RELAY_LOG_INFO* rli);
-void clear_slave_error(RELAY_LOG_INFO* rli);
-void end_relay_log_info(RELAY_LOG_INFO* rli);
-void lock_slave_threads(MASTER_INFO* mi);
-void unlock_slave_threads(MASTER_INFO* mi);
-void init_thread_mask(int* mask,MASTER_INFO* mi,bool inverse);
-int init_relay_log_pos(RELAY_LOG_INFO* rli,const char* log,ulonglong pos,
+void clear_until_condition(Relay_log_info* rli);
+void clear_slave_error(Relay_log_info* rli);
+void end_relay_log_info(Relay_log_info* rli);
+void lock_slave_threads(Master_info* mi);
+void unlock_slave_threads(Master_info* mi);
+void init_thread_mask(int* mask,Master_info* mi,bool inverse);
+int init_relay_log_pos(Relay_log_info* rli,const char* log,ulonglong pos,
bool need_data_lock, const char** errmsg,
bool look_for_description_event);
-int purge_relay_logs(RELAY_LOG_INFO* rli, THD *thd, bool just_reset,
+int purge_relay_logs(Relay_log_info* rli, THD *thd, bool just_reset,
const char** errmsg);
void set_slave_thread_options(THD* thd);
-void set_slave_thread_default_charset(THD *thd, RELAY_LOG_INFO const *rli);
-void rotate_relay_log(MASTER_INFO* mi);
+void set_slave_thread_default_charset(THD *thd, Relay_log_info const *rli);
+void rotate_relay_log(Master_info* mi);
pthread_handler_t handle_slave_io(void *arg);
pthread_handler_t handle_slave_sql(void *arg);
extern bool volatile abort_loop;
-extern MASTER_INFO main_mi, *active_mi; /* active_mi for multi-master */
+extern Master_info main_mi, *active_mi; /* active_mi for multi-master */
extern LIST master_list;
extern my_bool replicate_same_server_id;
@@ -201,13 +199,13 @@ extern int disconnect_slave_event_count, abort_slave_event_count ;
/* the master variables are defaults read from my.cnf or command line */
extern uint master_port, master_connect_retry, report_port;
-extern my_string master_user, master_password, master_host,
- master_info_file, relay_log_info_file, report_user, report_host,
- report_password;
+extern char * master_user, *master_password, *master_host;
+extern char *master_info_file, *relay_log_info_file, *report_user;
+extern char *report_host, *report_password;
extern my_bool master_ssl;
-extern my_string master_ssl_ca, master_ssl_capath, master_ssl_cert,
- master_ssl_cipher, master_ssl_key;
+extern char *master_ssl_ca, *master_ssl_capath, *master_ssl_cert;
+extern char *master_ssl_cipher, *master_ssl_key;
extern I_List<THD> threads;
@@ -217,6 +215,8 @@ extern I_List<THD> threads;
#define SLAVE_IO 1
#define SLAVE_SQL 2
-#endif
-
+/**
+ @} (end of group Replication)
+*/
+#endif
diff --git a/sql/sp.cc b/sql/sp.cc
index d96e4295a83..6032688f7f1 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -35,7 +35,8 @@ static int
db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp,
ulong sql_mode, const char *params, const char *returns,
const char *body, st_sp_chistics &chistics,
- const char *definer, longlong created, longlong modified);
+ const char *definer, longlong created, longlong modified,
+ Stored_program_creation_ctx *creation_ctx);
/*
*
@@ -61,12 +62,192 @@ enum
MYSQL_PROC_FIELD_MODIFIED,
MYSQL_PROC_FIELD_SQL_MODE,
MYSQL_PROC_FIELD_COMMENT,
+ MYSQL_PROC_FIELD_CHARACTER_SET_CLIENT,
+ MYSQL_PROC_FIELD_COLLATION_CONNECTION,
+ MYSQL_PROC_FIELD_DB_COLLATION,
+ MYSQL_PROC_FIELD_BODY_UTF8,
MYSQL_PROC_FIELD_COUNT
};
/* Tells what SP_DEFAULT_ACCESS should be mapped to */
#define SP_DEFAULT_ACCESS_MAPPING SP_CONTAINS_SQL
+/*************************************************************************/
+
+/**
+ Stored_routine_creation_ctx -- creation context of stored routines
+ (stored procedures and functions).
+*/
+
+class Stored_routine_creation_ctx : public Stored_program_creation_ctx,
+ public Sql_alloc
+{
+public:
+ static Stored_routine_creation_ctx *
+ load_from_db(THD *thd, const sp_name *name, TABLE *proc_tbl);
+
+public:
+ virtual Stored_program_creation_ctx *clone(MEM_ROOT *mem_root)
+ {
+ return new (mem_root) Stored_routine_creation_ctx(m_client_cs,
+ m_connection_cl,
+ m_db_cl);
+ }
+
+protected:
+ virtual Object_creation_ctx *create_backup_ctx(THD *thd) const
+ {
+ DBUG_ENTER("Stored_routine_creation_ctx::create_backup_ctx");
+ DBUG_RETURN(new Stored_routine_creation_ctx(thd));
+ }
+
+private:
+ Stored_routine_creation_ctx(THD *thd)
+ : Stored_program_creation_ctx(thd)
+ { }
+
+ Stored_routine_creation_ctx(CHARSET_INFO *client_cs,
+ CHARSET_INFO *connection_cl,
+ CHARSET_INFO *db_cl)
+ : Stored_program_creation_ctx(client_cs, connection_cl, db_cl)
+ { }
+};
+
+/**************************************************************************
+ Stored_routine_creation_ctx implementation.
+**************************************************************************/
+
+bool load_charset(MEM_ROOT *mem_root,
+ Field *field,
+ CHARSET_INFO *dflt_cs,
+ CHARSET_INFO **cs)
+{
+ String cs_name;
+
+ if (get_field(mem_root, field, &cs_name))
+ {
+ *cs= dflt_cs;
+ return TRUE;
+ }
+
+ *cs= get_charset_by_csname(cs_name.c_ptr(), MY_CS_PRIMARY, MYF(0));
+
+ if (*cs == NULL)
+ {
+ *cs= dflt_cs;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+/*************************************************************************/
+
+bool load_collation(MEM_ROOT *mem_root,
+ Field *field,
+ CHARSET_INFO *dflt_cl,
+ CHARSET_INFO **cl)
+{
+ String cl_name;
+
+ if (get_field(mem_root, field, &cl_name))
+ {
+ *cl= dflt_cl;
+ return TRUE;
+ }
+
+ *cl= get_charset_by_name(cl_name.c_ptr(), MYF(0));
+
+ if (*cl == NULL)
+ {
+ *cl= dflt_cl;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+/*************************************************************************/
+
+Stored_routine_creation_ctx *
+Stored_routine_creation_ctx::load_from_db(THD *thd,
+ const sp_name *name,
+ TABLE *proc_tbl)
+{
+ /* Load character set/collation attributes. */
+
+ CHARSET_INFO *client_cs;
+ CHARSET_INFO *connection_cl;
+ CHARSET_INFO *db_cl;
+
+ const char *db_name= thd->strmake(name->m_db.str, name->m_db.length);
+ const char *sr_name= thd->strmake(name->m_name.str, name->m_name.length);
+
+ bool invalid_creation_ctx= FALSE;
+
+ if (load_charset(thd->mem_root,
+ proc_tbl->field[MYSQL_PROC_FIELD_CHARACTER_SET_CLIENT],
+ thd->variables.character_set_client,
+ &client_cs))
+ {
+ sql_print_warning("Stored routine '%s'.'%s': invalid value "
+ "in column mysql.proc.character_set_client.",
+ (const char *) db_name,
+ (const char *) sr_name);
+
+ invalid_creation_ctx= TRUE;
+ }
+
+ if (load_collation(thd->mem_root,
+ proc_tbl->field[MYSQL_PROC_FIELD_COLLATION_CONNECTION],
+ thd->variables.collation_connection,
+ &connection_cl))
+ {
+ sql_print_warning("Stored routine '%s'.'%s': invalid value "
+ "in column mysql.proc.collation_connection.",
+ (const char *) db_name,
+ (const char *) sr_name);
+
+ invalid_creation_ctx= TRUE;
+ }
+
+ if (load_collation(thd->mem_root,
+ proc_tbl->field[MYSQL_PROC_FIELD_DB_COLLATION],
+ NULL,
+ &db_cl))
+ {
+ sql_print_warning("Stored routine '%s'.'%s': invalid value "
+ "in column mysql.proc.db_collation.",
+ (const char *) db_name,
+ (const char *) sr_name);
+
+ invalid_creation_ctx= TRUE;
+ }
+
+ if (invalid_creation_ctx)
+ {
+ push_warning_printf(thd,
+ MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_SR_INVALID_CREATION_CTX,
+ ER(ER_SR_INVALID_CREATION_CTX),
+ (const char *) db_name,
+ (const char *) sr_name);
+ }
+
+ /*
+ If we failed to retrieve the database collation, load the default one
+ from the disk.
+ */
+
+ if (!db_cl)
+ db_cl= get_default_db_collation(thd, name->m_db.str);
+
+ /* Create the context. */
+
+ return new Stored_routine_creation_ctx(client_cs, connection_cl, db_cl);
+}
+
+/*************************************************************************/
/*
Open the mysql.proc table for read.
@@ -147,10 +328,10 @@ static TABLE *open_proc_table_for_update(THD *thd)
static int
db_find_routine_aux(THD *thd, int type, sp_name *name, TABLE *table)
{
- byte key[MAX_KEY_LENGTH]; // db, name, optional key length type
+ uchar key[MAX_KEY_LENGTH]; // db, name, optional key length type
DBUG_ENTER("db_find_routine_aux");
- DBUG_PRINT("enter", ("type: %d name: %.*s",
- type, name->m_name.length, name->m_name.str));
+ DBUG_PRINT("enter", ("type: %d name: %.*s",
+ type, (int) name->m_name.length, name->m_name.str));
/*
Create key to find row. We have to use field->store() to be able to
@@ -168,8 +349,8 @@ db_find_routine_aux(THD *thd, int type, sp_name *name, TABLE *table)
key_copy(key, table->record[0], table->key_info,
table->key_info->key_length);
- if (table->file->index_read_idx(table->record[0], 0, key, HA_WHOLE_KEY,
- HA_READ_KEY_EXACT))
+ if (table->file->index_read_idx_map(table->record[0], 0, key, HA_WHOLE_KEY,
+ HA_READ_KEY_EXACT))
DBUG_RETURN(SP_KEY_NOT_FOUND);
DBUG_RETURN(SP_OK);
@@ -213,9 +394,11 @@ db_find_routine(THD *thd, int type, sp_name *name, sp_head **sphp)
String str(buff, sizeof(buff), &my_charset_bin);
ulong sql_mode;
Open_tables_state open_tables_state_backup;
+ Stored_program_creation_ctx *creation_ctx;
+
DBUG_ENTER("db_find_routine");
DBUG_PRINT("enter", ("type: %d name: %.*s",
- type, name->m_name.length, name->m_name.str));
+ type, (int) name->m_name.length, name->m_name.str));
*sphp= 0; // In case of errors
if (!(table= open_proc_table_for_read(thd, &open_tables_state_backup)))
@@ -224,7 +407,7 @@ db_find_routine(THD *thd, int type, sp_name *name, sp_head **sphp)
if ((ret= db_find_routine_aux(thd, type, name, table)) != SP_OK)
goto done;
- if (table->s->fields != MYSQL_PROC_FIELD_COUNT)
+ if (table->s->fields < MYSQL_PROC_FIELD_COUNT)
{
ret= SP_GET_FIELD_FAILED;
goto done;
@@ -313,13 +496,14 @@ db_find_routine(THD *thd, int type, sp_name *name, sp_head **sphp)
chistics.comment.str= ptr;
chistics.comment.length= length;
+ creation_ctx= Stored_routine_creation_ctx::load_from_db(thd, name, table);
+
close_system_tables(thd, &open_tables_state_backup);
table= 0;
ret= db_load_routine(thd, type, name, sphp,
sql_mode, params, returns, body, chistics,
- definer, created, modified);
-
+ definer, created, modified, creation_ctx);
done:
if (table)
close_system_tables(thd, &open_tables_state_backup);
@@ -331,13 +515,15 @@ static int
db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp,
ulong sql_mode, const char *params, const char *returns,
const char *body, st_sp_chistics &chistics,
- const char *definer, longlong created, longlong modified)
+ const char *definer, longlong created, longlong modified,
+ Stored_program_creation_ctx *creation_ctx)
{
LEX *old_lex= thd->lex, newlex;
String defstr;
- char old_db_buf[NAME_LEN+1];
- LEX_STRING old_db= { old_db_buf, sizeof(old_db_buf) };
- bool dbchanged;
+ char saved_cur_db_name_buf[NAME_LEN+1];
+ LEX_STRING saved_cur_db_name=
+ { saved_cur_db_name_buf, sizeof(saved_cur_db_name_buf) };
+ bool cur_db_changed;
ulong old_sql_mode= thd->variables.sql_mode;
ha_rows old_select_limit= thd->variables.select_limit;
sp_rcontext *old_spcont= thd->spcont;
@@ -361,7 +547,7 @@ db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp,
definer_user_name.str, &definer_user_name.length,
definer_host_name.str, &definer_host_name.length);
- defstr.set_charset(system_charset_info);
+ defstr.set_charset(creation_ctx->get_client_cs());
/*
We have to add DEFINER clause and provide proper routine characterstics in
@@ -381,30 +567,64 @@ db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp,
goto end;
}
- if ((ret= sp_use_new_db(thd, name->m_db, &old_db, 1, &dbchanged)))
+ /*
+ Change the current database (if needed).
+
+ TODO: why do we force switch here?
+ */
+
+ if (mysql_opt_change_db(thd, &name->m_db, &saved_cur_db_name, TRUE,
+ &cur_db_changed))
+ {
+ ret= SP_INTERNAL_ERROR;
goto end;
+ }
- lex_start(thd, defstr.c_ptr(), defstr.length());
+ thd->spcont= NULL;
- thd->spcont= 0;
- if (MYSQLparse(thd) || thd->is_fatal_error || newlex.sphead == NULL)
{
- sp_head *sp= newlex.sphead;
+ Lex_input_stream lip(thd, defstr.c_ptr(), defstr.length());
+
+ lex_start(thd);
+
+ ret= parse_sql(thd, &lip, creation_ctx) || newlex.sphead == NULL;
- if (dbchanged && (ret= mysql_change_db(thd, &old_db, TRUE)))
+ /*
+ Force switching back to the saved current database (if changed),
+ because it may be NULL. In this case, mysql_change_db() would
+ generate an error.
+ */
+
+ if (cur_db_changed && mysql_change_db(thd, &saved_cur_db_name, TRUE))
+ {
+ delete newlex.sphead;
+ ret= SP_INTERNAL_ERROR;
goto end;
- delete sp;
- ret= SP_PARSE_ERROR;
- }
- else
- {
- if (dbchanged && (ret= mysql_change_db(thd, &old_db, TRUE)))
+ }
+
+ if (ret)
+ {
+ delete newlex.sphead;
+ ret= SP_PARSE_ERROR;
goto end;
+ }
+
*sphp= newlex.sphead;
(*sphp)->set_definer(&definer_user_name, &definer_host_name);
(*sphp)->set_info(created, modified, &chistics, sql_mode);
+ (*sphp)->set_creation_ctx(creation_ctx);
(*sphp)->optimize();
+ /*
+ Not strictly necessary to invoke this method here, since we know
+ that we've parsed CREATE PROCEDURE/FUNCTION and not an
+ UPDATE/DELETE/INSERT/REPLACE/LOAD/CREATE TABLE, but we try to
+ maintain the invariant that this method is called for each
+ distinct statement, in case its logic is extended with other
+ types of analyses in future.
+ */
+ newlex.set_trg_event_type_for_tables();
}
+
end:
lex_end(thd->lex);
thd->spcont= old_spcont;
@@ -437,16 +657,38 @@ sp_returns_type(THD *thd, String &result, sp_head *sp)
delete field;
}
-static int
-db_create_routine(THD *thd, int type, sp_head *sp)
+
+/**
+ Write stored-routine object into mysql.proc.
+
+ This operation stores attributes of the stored procedure/function into
+ the mysql.proc.
+
+ @param thd Thread context.
+ @param type Stored routine type
+ (TYPE_ENUM_PROCEDURE or TYPE_ENUM_FUNCTION).
+ @param sp Stored routine object to store.
+
+ @return Error code. SP_OK is returned on success. Other SP_ constants are
+ used to indicate about errors.
+*/
+
+int
+sp_create_routine(THD *thd, int type, sp_head *sp)
{
int ret;
TABLE *table;
char definer[USER_HOST_BUFF_SIZE];
- DBUG_ENTER("db_create_routine");
- DBUG_PRINT("enter", ("type: %d name: %.*s",type,sp->m_name.length,
+
+ CHARSET_INFO *db_cs= get_default_db_collation(thd, sp->m_db.str);
+
+ DBUG_ENTER("sp_create_routine");
+ DBUG_PRINT("enter", ("type: %d name: %.*s",type, (int) sp->m_name.length,
sp->m_name.str));
+ DBUG_ASSERT(type == TYPE_ENUM_PROCEDURE ||
+ type == TYPE_ENUM_FUNCTION);
+
/*
This statement will be replicated as a statement, even when using
row-based replication. The flag will be reset at the end of the
@@ -464,7 +706,7 @@ db_create_routine(THD *thd, int type, sp_head *sp)
strxnmov(definer, sizeof(definer)-1, thd->lex->definer->user.str, "@",
thd->lex->definer->host.str, NullS);
- if (table->s->fields != MYSQL_PROC_FIELD_COUNT)
+ if (table->s->fields < MYSQL_PROC_FIELD_COUNT)
{
ret= SP_GET_FIELD_FAILED;
goto done;
@@ -551,6 +793,26 @@ db_create_routine(THD *thd, int type, sp_head *sp)
}
}
+ table->field[MYSQL_PROC_FIELD_CHARACTER_SET_CLIENT]->set_notnull();
+ table->field[MYSQL_PROC_FIELD_CHARACTER_SET_CLIENT]->store(
+ thd->charset()->csname,
+ strlen(thd->charset()->csname),
+ system_charset_info);
+
+ table->field[MYSQL_PROC_FIELD_COLLATION_CONNECTION]->set_notnull();
+ table->field[MYSQL_PROC_FIELD_COLLATION_CONNECTION]->store(
+ thd->variables.collation_connection->name,
+ strlen(thd->variables.collation_connection->name),
+ system_charset_info);
+
+ table->field[MYSQL_PROC_FIELD_DB_COLLATION]->set_notnull();
+ table->field[MYSQL_PROC_FIELD_DB_COLLATION]->store(
+ db_cs->name, strlen(db_cs->name), system_charset_info);
+
+ table->field[MYSQL_PROC_FIELD_BODY_UTF8]->set_notnull();
+ table->field[MYSQL_PROC_FIELD_BODY_UTF8]->store(
+ sp->m_body_utf8.str, sp->m_body_utf8.length, system_charset_info);
+
ret= SP_OK;
if (table->file->ha_write_row(table->record[0]))
ret= SP_WRITE_ROW_FAILED;
@@ -563,10 +825,14 @@ db_create_routine(THD *thd, int type, sp_head *sp)
log_query.append(STRING_WITH_LEN("CREATE "));
append_definer(thd, &log_query, &thd->lex->definer->user,
&thd->lex->definer->host);
- log_query.append(thd->lex->stmt_definition_begin,
- (char *)sp->m_body_begin -
- thd->lex->stmt_definition_begin +
- sp->m_body.length);
+
+ LEX_STRING stmt_definition;
+ stmt_definition.str= (char*) thd->lex->stmt_definition_begin;
+ stmt_definition.length= thd->lex->stmt_definition_end
+ - thd->lex->stmt_definition_begin;
+ trim_whitespace(thd->charset(), & stmt_definition);
+
+ log_query.append(stmt_definition.str, stmt_definition.length);
/* Such a statement can always go directly to binlog, no trans cache */
thd->binlog_query(THD::MYSQL_QUERY_TYPE,
@@ -581,14 +847,32 @@ done:
}
-static int
-db_drop_routine(THD *thd, int type, sp_name *name)
+/**
+ Delete the record for the stored routine object from mysql.proc.
+
+ The operation deletes the record for the stored routine specified by name
+ from the mysql.proc table and invalidates the stored-routine cache.
+
+ @param thd Thread context.
+ @param type Stored routine type
+ (TYPE_ENUM_PROCEDURE or TYPE_ENUM_FUNCTION)
+ @param name Stored routine name.
+
+ @return Error code. SP_OK is returned on success. Other SP_ constants are
+ used to indicate about errors.
+*/
+
+int
+sp_drop_routine(THD *thd, int type, sp_name *name)
{
TABLE *table;
int ret;
- DBUG_ENTER("db_drop_routine");
- DBUG_PRINT("enter", ("type: %d name: %.*s",
- type, name->m_name.length, name->m_name.str));
+ DBUG_ENTER("sp_drop_routine");
+ DBUG_PRINT("enter", ("type: %d name: %.*s",
+ type, (int) name->m_name.length, name->m_name.str));
+
+ DBUG_ASSERT(type == TYPE_ENUM_PROCEDURE ||
+ type == TYPE_ENUM_FUNCTION);
/*
This statement will be replicated as a statement, even when using
@@ -607,12 +891,8 @@ db_drop_routine(THD *thd, int type, sp_name *name)
if (ret == SP_OK)
{
- if (mysql_bin_log.is_open())
- {
- thd->clear_error();
- thd->binlog_query(THD::MYSQL_QUERY_TYPE,
- thd->query, thd->query_length, FALSE, FALSE);
- }
+ write_bin_log(thd, TRUE, thd->query, thd->query_length);
+ sp_cache_invalidate();
}
close_thread_tables(thd);
@@ -620,18 +900,37 @@ db_drop_routine(THD *thd, int type, sp_name *name)
}
-static int
-db_update_routine(THD *thd, int type, sp_name *name, st_sp_chistics *chistics)
+/**
+ Find and updated the record for the stored routine object in mysql.proc.
+
+ The operation finds the record for the stored routine specified by name
+ in the mysql.proc table and updates it with new attributes. After
+ successful update, the cache is invalidated.
+
+ @param thd Thread context.
+ @param type Stored routine type
+ (TYPE_ENUM_PROCEDURE or TYPE_ENUM_FUNCTION)
+ @param name Stored routine name.
+ @param chistics New values of stored routine attributes to write.
+
+ @return Error code. SP_OK is returned on success. Other SP_ constants are
+ used to indicate about errors.
+*/
+
+int
+sp_update_routine(THD *thd, int type, sp_name *name, st_sp_chistics *chistics)
{
TABLE *table;
int ret;
- DBUG_ENTER("db_update_routine");
- DBUG_PRINT("enter", ("type: %d name: %.*s",
- type, name->m_name.length, name->m_name.str));
+ DBUG_ENTER("sp_update_routine");
+ DBUG_PRINT("enter", ("type: %d name: %.*s",
+ type, (int) name->m_name.length, name->m_name.str));
+ DBUG_ASSERT(type == TYPE_ENUM_PROCEDURE ||
+ type == TYPE_ENUM_FUNCTION);
/*
This statement will be replicated as a statement, even when using
- row-based replication. The flag will be reset at the end of the
+ row-based replication. The flag will be reset at the end of the
statement.
*/
thd->clear_current_stmt_binlog_row_based();
@@ -653,18 +952,17 @@ db_update_routine(THD *thd, int type, sp_name *name, st_sp_chistics *chistics)
table->field[MYSQL_PROC_FIELD_COMMENT]->store(chistics->comment.str,
chistics->comment.length,
system_charset_info);
- if ((table->file->ha_update_row(table->record[1],table->record[0])))
+ if ((ret= table->file->ha_update_row(table->record[1],table->record[0])) &&
+ ret != HA_ERR_RECORD_IS_THE_SAME)
ret= SP_WRITE_ROW_FAILED;
+ else
+ ret= 0;
}
if (ret == SP_OK)
{
- if (mysql_bin_log.is_open())
- {
- thd->clear_error();
- thd->binlog_query(THD::MYSQL_QUERY_TYPE,
- thd->query, thd->query_length, FALSE, FALSE);
- }
+ write_bin_log(thd, TRUE, thd->query, thd->query_length);
+ sp_cache_invalidate();
}
close_thread_tables(thd);
@@ -682,15 +980,18 @@ struct st_used_field
static struct st_used_field init_fields[]=
{
- { "Db", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0},
- { "Name", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0},
- { "Type", 9, MYSQL_TYPE_STRING, 0},
- { "Definer", 77, MYSQL_TYPE_STRING, 0},
- { "Modified", 0, MYSQL_TYPE_TIMESTAMP, 0},
- { "Created", 0, MYSQL_TYPE_TIMESTAMP, 0},
- { "Security_type", 1, MYSQL_TYPE_STRING, 0},
- { "Comment", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0},
- { 0, 0, MYSQL_TYPE_STRING, 0}
+ { "Db", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0},
+ { "Name", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0},
+ { "Type", 9, MYSQL_TYPE_STRING, 0},
+ { "Definer", USER_HOST_BUFF_SIZE, MYSQL_TYPE_STRING, 0},
+ { "Modified", 0, MYSQL_TYPE_TIMESTAMP, 0},
+ { "Created", 0, MYSQL_TYPE_TIMESTAMP, 0},
+ { "Security_type", 1, MYSQL_TYPE_STRING, 0},
+ { "Comment", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0},
+ { "character_set_client", MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0},
+ { "collation_connection", MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0},
+ { "Database Collation", MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0},
+ { 0, 0, MYSQL_TYPE_STRING, 0}
};
@@ -750,19 +1051,34 @@ print_field_values(THD *thd, TABLE *table,
}
-static int
-db_show_routine_status(THD *thd, int type, const char *wild)
+/**
+ Implement SHOW STATUS statement for stored routines.
+
+ @param thd Thread context.
+ @param type Stored routine type
+ (TYPE_ENUM_PROCEDURE or TYPE_ENUM_FUNCTION)
+ @param name_pattern Stored routine name pattern.
+
+ @return Error code. SP_OK is returned on success. Other SP_ constants are
+ used to indicate about errors.
+*/
+
+int
+sp_show_status_routine(THD *thd, int type, const char *name_pattern)
{
TABLE *table;
TABLE_LIST tables;
int res;
- DBUG_ENTER("db_show_routine_status");
+ DBUG_ENTER("sp_show_status_routine");
+
+ DBUG_ASSERT(type == TYPE_ENUM_PROCEDURE ||
+ type == TYPE_ENUM_FUNCTION);
memset(&tables, 0, sizeof(tables));
tables.db= (char*)"mysql";
tables.table_name= tables.alias= (char*)"proc";
- if (! (table= open_ltable(thd, &tables, TL_READ)))
+ if (! (table= open_ltable(thd, &tables, TL_READ, 0)))
{
res= SP_OPEN_TABLE_FAILED;
goto done;
@@ -784,14 +1100,14 @@ db_show_routine_status(THD *thd, int type, const char *wild)
{
switch (used_field->field_type) {
case MYSQL_TYPE_TIMESTAMP:
- field_list.push_back(item=
- new Item_return_date_time(used_field->field_name,
- MYSQL_TYPE_DATETIME));
+ item= new Item_return_date_time(used_field->field_name,
+ MYSQL_TYPE_DATETIME);
+ field_list.push_back(item);
break;
default:
- field_list.push_back(item=new Item_empty_string(used_field->field_name,
- used_field->
- field_length));
+ item= new Item_empty_string(used_field->field_name,
+ used_field->field_length);
+ field_list.push_back(item);
break;
}
}
@@ -835,13 +1151,16 @@ db_show_routine_status(THD *thd, int type, const char *wild)
res= (res == HA_ERR_END_OF_FILE) ? 0 : SP_INTERNAL_ERROR;
goto err_case1;
}
- if ((res= print_field_values(thd, table, used_fields, type, wild)))
- goto err_case1;
- while (!table->file->index_next(table->record[0]))
+
+ do
{
- if ((res= print_field_values(thd, table, used_fields, type, wild)))
+ res= print_field_values(thd, table, used_fields, type, name_pattern);
+
+ if (res)
goto err_case1;
}
+ while (!table->file->index_next(table->record[0]));
+
res= SP_OK;
}
@@ -874,9 +1193,9 @@ sp_drop_db_routines(THD *thd, char *db)
ret= SP_OK;
table->file->ha_index_init(0, 1);
- if (! table->file->index_read(table->record[0],
- (byte *)table->field[MYSQL_PROC_FIELD_DB]->ptr,
- (key_part_map)1, HA_READ_KEY_EXACT))
+ if (! table->file->index_read_map(table->record[0],
+ (uchar *)table->field[MYSQL_PROC_FIELD_DB]->ptr,
+ (key_part_map)1, HA_READ_KEY_EXACT))
{
int nxtres;
bool deleted= FALSE;
@@ -892,7 +1211,7 @@ sp_drop_db_routines(THD *thd, char *db)
break;
}
} while (! (nxtres= table->file->index_next_same(table->record[0],
- (byte *)table->field[MYSQL_PROC_FIELD_DB]->ptr,
+ (uchar *)table->field[MYSQL_PROC_FIELD_DB]->ptr,
key_len)));
if (nxtres != HA_ERR_END_OF_FILE)
ret= SP_KEY_NOT_FOUND;
@@ -908,9 +1227,62 @@ err:
}
-/*****************************************************************************
- PROCEDURE
-******************************************************************************/
+/**
+ Implement SHOW CREATE statement for stored routines.
+
+ The operation finds the stored routine object specified by name and then
+ calls sp_head::show_create_routine() for the object.
+
+ @param thd Thread context.
+ @param type Stored routine type
+ (TYPE_ENUM_PROCEDURE or TYPE_ENUM_FUNCTION)
+ @param name Stored routine name.
+
+ @return Error status.
+ @retval FALSE on success
+ @retval TRUE on error
+*/
+
+bool
+sp_show_create_routine(THD *thd, int type, sp_name *name)
+{
+ bool err_status= TRUE;
+ sp_head *sp;
+ sp_cache **cache = type == TYPE_ENUM_PROCEDURE ?
+ &thd->sp_proc_cache : &thd->sp_func_cache;
+
+ DBUG_ENTER("sp_show_create_routine");
+ DBUG_PRINT("enter", ("name: %.*s",
+ (int) name->m_name.length,
+ name->m_name.str));
+
+ DBUG_ASSERT(type == TYPE_ENUM_PROCEDURE ||
+ type == TYPE_ENUM_FUNCTION);
+
+ if (type == TYPE_ENUM_PROCEDURE)
+ {
+ /*
+ SHOW CREATE PROCEDURE may require two instances of one sp_head
+ object when SHOW CREATE PROCEDURE is called for the procedure that
+ is being executed. Basically, there is no actual recursion, so we
+ increase the recursion limit for this statement (kind of hack).
+
+ SHOW CREATE FUNCTION does not require this because SHOW CREATE
+ statements are prohibitted within stored functions.
+ */
+
+ thd->variables.max_sp_recursion_depth++;
+ }
+
+ if ((sp= sp_find_routine(thd, type, name, cache, FALSE)))
+ err_status= sp->show_create_routine(thd, type);
+
+ if (type == TYPE_ENUM_PROCEDURE)
+ thd->variables.max_sp_recursion_depth--;
+
+ DBUG_RETURN(err_status);
+}
+
/*
Obtain object representing stored procedure/function by its name from
@@ -939,9 +1311,9 @@ sp_find_routine(THD *thd, int type, sp_name *name, sp_cache **cp,
thd->variables.max_sp_recursion_depth :
0);
DBUG_ENTER("sp_find_routine");
- DBUG_PRINT("enter", ("name: %.*s.%.*s, type: %d, cache only %d",
- name->m_db.length, name->m_db.str,
- name->m_name.length, name->m_name.str,
+ DBUG_PRINT("enter", ("name: %.*s.%.*s type: %d cache only %d",
+ (int) name->m_db.length, name->m_db.str,
+ (int) name->m_name.length, name->m_name.str,
type, cache_only));
if ((sp= sp_cache_lookup(cp, name)))
@@ -995,7 +1367,8 @@ sp_find_routine(THD *thd, int type, sp_name *name, sp_cache **cp,
if (db_load_routine(thd, type, name, &new_sp,
sp->m_sql_mode, sp->m_params.str, returns,
sp->m_body.str, *sp->m_chistics, definer,
- sp->m_created, sp->m_modified) == SP_OK)
+ sp->m_created, sp->m_modified,
+ sp->get_creation_ctx()) == SP_OK)
{
sp->m_last_cached_sp->m_next_cached_sp= new_sp;
new_sp->m_recursion_level= level;
@@ -1104,151 +1477,6 @@ sp_routine_exists_in_table(THD *thd, int type, sp_name *name)
}
-int
-sp_create_procedure(THD *thd, sp_head *sp)
-{
- int ret;
- DBUG_ENTER("sp_create_procedure");
- DBUG_PRINT("enter", ("name: %.*s", sp->m_name.length, sp->m_name.str));
-
- ret= db_create_routine(thd, TYPE_ENUM_PROCEDURE, sp);
- DBUG_RETURN(ret);
-}
-
-
-int
-sp_drop_procedure(THD *thd, sp_name *name)
-{
- int ret;
- DBUG_ENTER("sp_drop_procedure");
- DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str));
-
- ret= db_drop_routine(thd, TYPE_ENUM_PROCEDURE, name);
- if (!ret)
- sp_cache_invalidate();
- DBUG_RETURN(ret);
-}
-
-
-int
-sp_update_procedure(THD *thd, sp_name *name, st_sp_chistics *chistics)
-{
- int ret;
- DBUG_ENTER("sp_update_procedure");
- DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str));
-
- ret= db_update_routine(thd, TYPE_ENUM_PROCEDURE, name, chistics);
- if (!ret)
- sp_cache_invalidate();
- DBUG_RETURN(ret);
-}
-
-
-int
-sp_show_create_procedure(THD *thd, sp_name *name)
-{
- int ret= SP_KEY_NOT_FOUND;
- sp_head *sp;
- DBUG_ENTER("sp_show_create_procedure");
- DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str));
-
- /*
- Increase the recursion limit for this statement. SHOW CREATE PROCEDURE
- does not do actual recursion.
- */
- thd->variables.max_sp_recursion_depth++;
- if ((sp= sp_find_routine(thd, TYPE_ENUM_PROCEDURE, name,
- &thd->sp_proc_cache, FALSE)))
- ret= sp->show_create_procedure(thd);
-
- thd->variables.max_sp_recursion_depth--;
- DBUG_RETURN(ret);
-}
-
-
-int
-sp_show_status_procedure(THD *thd, const char *wild)
-{
- int ret;
- DBUG_ENTER("sp_show_status_procedure");
-
- ret= db_show_routine_status(thd, TYPE_ENUM_PROCEDURE, wild);
- DBUG_RETURN(ret);
-}
-
-
-/*****************************************************************************
- FUNCTION
-******************************************************************************/
-
-int
-sp_create_function(THD *thd, sp_head *sp)
-{
- int ret;
- DBUG_ENTER("sp_create_function");
- DBUG_PRINT("enter", ("name: %.*s", sp->m_name.length, sp->m_name.str));
-
- ret= db_create_routine(thd, TYPE_ENUM_FUNCTION, sp);
- DBUG_RETURN(ret);
-}
-
-
-int
-sp_drop_function(THD *thd, sp_name *name)
-{
- int ret;
- DBUG_ENTER("sp_drop_function");
- DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str));
-
- ret= db_drop_routine(thd, TYPE_ENUM_FUNCTION, name);
- if (!ret)
- sp_cache_invalidate();
- DBUG_RETURN(ret);
-}
-
-
-int
-sp_update_function(THD *thd, sp_name *name, st_sp_chistics *chistics)
-{
- int ret;
- DBUG_ENTER("sp_update_procedure");
- DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str));
-
- ret= db_update_routine(thd, TYPE_ENUM_FUNCTION, name, chistics);
- if (!ret)
- sp_cache_invalidate();
- DBUG_RETURN(ret);
-}
-
-
-int
-sp_show_create_function(THD *thd, sp_name *name)
-{
- sp_head *sp;
- DBUG_ENTER("sp_show_create_function");
- DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str));
-
- if ((sp= sp_find_routine(thd, TYPE_ENUM_FUNCTION, name,
- &thd->sp_func_cache, FALSE)))
- {
- int ret= sp->show_create_function(thd);
-
- DBUG_RETURN(ret);
- }
- DBUG_RETURN(SP_KEY_NOT_FOUND);
-}
-
-
-int
-sp_show_status_function(THD *thd, const char *wild)
-{
- int ret;
- DBUG_ENTER("sp_show_status_function");
- ret= db_show_routine_status(thd, TYPE_ENUM_FUNCTION, wild);
- DBUG_RETURN(ret);
-}
-
-
/*
Structure that represents element in the set of stored routines
used by statement or routine.
@@ -1273,11 +1501,12 @@ struct Sroutine_hash_entry
};
-extern "C" byte* sp_sroutine_key(const byte *ptr, uint *plen, my_bool first)
+extern "C" uchar* sp_sroutine_key(const uchar *ptr, size_t *plen,
+ my_bool first)
{
Sroutine_hash_entry *rn= (Sroutine_hash_entry *)ptr;
*plen= rn->key.length;
- return (byte *)rn->key.str;
+ return (uchar *)rn->key.str;
}
@@ -1358,7 +1587,7 @@ static bool add_used_routine(LEX *lex, Query_arena *arena,
Query_tables_list::START_SROUTINES_HASH_SIZE,
0, 0, sp_sroutine_key, 0, 0);
- if (!hash_search(&lex->sroutines, (byte *)key->str, key->length))
+ if (!hash_search(&lex->sroutines, (uchar *)key->str, key->length))
{
Sroutine_hash_entry *rn=
(Sroutine_hash_entry *)arena->alloc(sizeof(Sroutine_hash_entry) +
@@ -1368,8 +1597,8 @@ static bool add_used_routine(LEX *lex, Query_arena *arena,
rn->key.length= key->length;
rn->key.str= (char *)rn + sizeof(Sroutine_hash_entry);
memcpy(rn->key.str, key->str, key->length);
- my_hash_insert(&lex->sroutines, (byte *)rn);
- lex->sroutines_list.link_in_list((byte *)rn, (byte **)&rn->next);
+ my_hash_insert(&lex->sroutines, (uchar *)rn);
+ lex->sroutines_list.link_in_list((uchar *)rn, (uchar **)&rn->next);
rn->belong_to_view= belong_to_view;
return TRUE;
}
@@ -1427,7 +1656,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, (byte *)not_own_rt);
+ hash_delete(&lex->sroutines, (uchar *)not_own_rt);
}
*(Sroutine_hash_entry **)lex->sroutines_list_own_last= NULL;
@@ -1459,8 +1688,8 @@ void 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, (byte *)rt->key.str, rt->key.length))
- my_hash_insert(dst, (byte *)rt);
+ if (!hash_search(dst, (uchar *)rt->key.str, rt->key.length))
+ my_hash_insert(dst, (uchar *)rt);
}
}
@@ -1703,32 +1932,40 @@ sp_cache_routines_and_add_tables_for_triggers(THD *thd, LEX *lex,
TABLE_LIST *table)
{
int ret= 0;
- Table_triggers_list *triggers= table->table->triggers;
- if (add_used_routine(lex, thd->stmt_arena, &triggers->sroutines_key,
- table->belong_to_view))
+
+ Sroutine_hash_entry **last_cached_routine_ptr=
+ (Sroutine_hash_entry **)lex->sroutines_list.next;
+
+ if (static_cast<int>(table->lock_type) >=
+ static_cast<int>(TL_WRITE_ALLOW_WRITE))
{
- Sroutine_hash_entry **last_cached_routine_ptr=
- (Sroutine_hash_entry **)lex->sroutines_list.next;
for (int i= 0; i < (int)TRG_EVENT_MAX; i++)
{
- for (int j= 0; j < (int)TRG_ACTION_MAX; j++)
+ if (table->trg_event_map &
+ static_cast<uint8>(1 << static_cast<int>(i)))
{
- sp_head *trigger_body= triggers->bodies[i][j];
- if (trigger_body)
+ for (int j= 0; j < (int)TRG_ACTION_MAX; j++)
{
- (void)trigger_body->
- add_used_tables_to_table_list(thd, &lex->query_tables_last,
- table->belong_to_view);
- sp_update_stmt_used_routines(thd, lex,
- &trigger_body->m_sroutines,
- table->belong_to_view);
- trigger_body->propagate_attributes(lex);
+ /* We can have only one trigger per action type currently */
+ sp_head *trigger= table->table->triggers->bodies[i][j];
+ if (trigger &&
+ add_used_routine(lex, thd->stmt_arena, &trigger->m_sroutines_key,
+ table->belong_to_view))
+ {
+ trigger->add_used_tables_to_table_list(thd, &lex->query_tables_last,
+ table->belong_to_view);
+ trigger->propagate_attributes(lex);
+ sp_update_stmt_used_routines(thd, lex,
+ &trigger->m_sroutines,
+ table->belong_to_view);
+ }
}
}
}
- ret= sp_cache_routines_and_add_tables_aux(thd, lex,
- *last_cached_routine_ptr, FALSE);
}
+ ret= sp_cache_routines_and_add_tables_aux(thd, lex,
+ *last_cached_routine_ptr,
+ FALSE);
return ret;
}
@@ -1798,74 +2035,3 @@ create_string(THD *thd, String *buf,
buf->append(body, bodylen);
return TRUE;
}
-
-
-
-/*
- Change the current database if needed.
-
- SYNOPSIS
- sp_use_new_db()
- thd thread handle
- new_db new database name (a string and its length)
- old_db [IN] str points to a buffer where to store the old
- database, length contains the size of the buffer
- [OUT] if old db was not NULL, its name is copied
- to the buffer pointed at by str and length is updated
- accordingly. Otherwise str[0] is set to '\0' and length
- is set to 0. The out parameter should be used only if
- the database name has been changed (see dbchangedp).
- dbchangedp [OUT] is set to TRUE if the current database is changed,
- FALSE otherwise. A database is not changed if the old
- name is the same as the new one, both names are empty,
- or an error has occurred.
-
- RETURN VALUE
- 0 success
- 1 access denied or out of memory (the error message is
- set in THD)
-*/
-
-int
-sp_use_new_db(THD *thd, LEX_STRING new_db, LEX_STRING *old_db,
- bool no_access_check, bool *dbchangedp)
-{
- int ret;
- DBUG_ENTER("sp_use_new_db");
- DBUG_PRINT("enter", ("newdb: %s", new_db.str));
-
- /*
- Set new_db to an empty string if it's NULL, because mysql_change_db
- requires a non-NULL argument.
- new_db.str can be NULL only if we're restoring the old database after
- execution of a stored procedure and there were no current database
- selected. The stored procedure itself must always have its database
- initialized.
- */
- if (new_db.str == NULL)
- new_db.str= empty_c_string;
-
- if (thd->db)
- {
- old_db->length= (strmake(old_db->str, thd->db, old_db->length) -
- old_db->str);
- }
- else
- {
- old_db->str[0]= '\0';
- old_db->length= 0;
- }
-
- /* Don't change the database if the new name is the same as the old one. */
- if (my_strcasecmp(system_charset_info, old_db->str, new_db.str) == 0)
- {
- *dbchangedp= FALSE;
- DBUG_RETURN(0);
- }
-
- ret= mysql_change_db(thd, &new_db, no_access_check);
-
- *dbchangedp= ret == 0;
- DBUG_RETURN(ret);
-}
-
diff --git a/sql/sp.h b/sql/sp.h
index 24c0756c426..3797eb289a4 100644
--- a/sql/sp.h
+++ b/sql/sp.h
@@ -44,37 +44,20 @@ sp_exist_routines(THD *thd, TABLE_LIST *procs, bool any, bool no_error);
int
sp_routine_exists_in_table(THD *thd, int type, sp_name *name);
-int
-sp_create_procedure(THD *thd, sp_head *sp);
-
-int
-sp_drop_procedure(THD *thd, sp_name *name);
-
-
-int
-sp_update_procedure(THD *thd, sp_name *name, st_sp_chistics *chistics);
-
-int
-sp_show_create_procedure(THD *thd, sp_name *name);
-
-int
-sp_show_status_procedure(THD *thd, const char *wild);
+bool
+sp_show_create_routine(THD *thd, int type, sp_name *name);
int
-sp_create_function(THD *thd, sp_head *sp);
+sp_show_status_routine(THD *thd, int type, const char *wild);
int
-sp_drop_function(THD *thd, sp_name *name);
+sp_create_routine(THD *thd, int type, sp_head *sp);
int
-sp_update_function(THD *thd, sp_name *name, st_sp_chistics *chistics);
+sp_update_routine(THD *thd, int type, sp_name *name, st_sp_chistics *chistics);
int
-sp_show_create_function(THD *thd, sp_name *name);
-
-int
-sp_show_status_function(THD *thd, const char *wild);
-
+sp_drop_routine(THD *thd, int type, sp_name *name);
/*
Procedures for pre-caching of stored routines and building table list
@@ -93,7 +76,8 @@ int sp_cache_routines_and_add_tables_for_view(THD *thd, LEX *lex,
int sp_cache_routines_and_add_tables_for_triggers(THD *thd, LEX *lex,
TABLE_LIST *table);
-extern "C" byte* sp_sroutine_key(const byte *ptr, uint *plen, my_bool first);
+extern "C" uchar* sp_sroutine_key(const uchar *ptr, size_t *plen,
+ my_bool first);
/*
Routines which allow open/lock and close mysql.proc table even when
@@ -101,15 +85,4 @@ extern "C" byte* sp_sroutine_key(const byte *ptr, uint *plen, my_bool first);
*/
TABLE *open_proc_table_for_read(THD *thd, Open_tables_state *backup);
-
-/*
- Do a "use new_db". The current db is stored at old_db. If new_db is the
- same as the current one, nothing is changed. dbchangedp is set to true if
- the db was actually changed.
-*/
-
-int
-sp_use_new_db(THD *thd, LEX_STRING new_db, LEX_STRING *old_db,
- bool no_access_check, bool *dbchangedp);
-
#endif /* _SP_H_ */
diff --git a/sql/sp_cache.cc b/sql/sp_cache.cc
index de4e1efd496..cc6ba9ef1d0 100644
--- a/sql/sp_cache.cc
+++ b/sql/sp_cache.cc
@@ -39,12 +39,12 @@ public:
inline void insert(sp_head *sp)
{
/* TODO: why don't we check return value? */
- my_hash_insert(&m_hashtable, (const byte *)sp);
+ my_hash_insert(&m_hashtable, (const uchar *)sp);
}
inline sp_head *lookup(char *name, uint namelen)
{
- return (sp_head *)hash_search(&m_hashtable, (const byte *)name, namelen);
+ return (sp_head *)hash_search(&m_hashtable, (const uchar *)name, namelen);
}
#ifdef NOT_USED
@@ -53,7 +53,7 @@ public:
sp_head *sp= lookup(name, namelen);
if (sp)
{
- hash_delete(&m_hashtable, (byte *)sp);
+ hash_delete(&m_hashtable, (uchar *)sp);
return TRUE;
}
return FALSE;
@@ -130,7 +130,7 @@ void sp_cache_insert(sp_cache **cp, sp_head *sp)
return; // End of memory error
c->version= Cversion; // No need to lock when reading long variable
}
- DBUG_PRINT("info",("sp_cache: inserting: %.*s", sp->m_qname.length,
+ DBUG_PRINT("info",("sp_cache: inserting: %.*s", (int) sp->m_qname.length,
sp->m_qname.str));
c->insert(sp);
*cp= c; // Update *cp if it was NULL
@@ -214,17 +214,20 @@ void sp_cache_flush_obsolete(sp_cache **cp)
Internal functions
*************************************************************************/
-static byte *hash_get_key_for_sp_head(const byte *ptr, uint *plen,
- my_bool first)
+extern "C" uchar *hash_get_key_for_sp_head(const uchar *ptr, size_t *plen,
+ my_bool first);
+extern "C" void hash_free_sp_head(void *p);
+
+uchar *hash_get_key_for_sp_head(const uchar *ptr, size_t *plen,
+ my_bool first)
{
sp_head *sp= (sp_head *)ptr;
*plen= sp->m_qname.length;
- return (byte*) sp->m_qname.str;
+ return (uchar*) sp->m_qname.str;
}
-static void
-hash_free_sp_head(void *p)
+void hash_free_sp_head(void *p)
{
sp_head *sp= (sp_head *)p;
delete sp;
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index e49a7d74f2a..ff7c4342329 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -32,6 +32,8 @@
#include <my_user.h>
+extern "C" uchar *sp_table_key(const uchar *ptr, size_t *plen, my_bool first);
+
Item_result
sp_map_result_type(enum enum_field_types type)
{
@@ -180,6 +182,7 @@ sp_get_flags_for_command(LEX *lex)
case SQLCOM_SHOW_CREATE_FUNC:
case SQLCOM_SHOW_CREATE_PROC:
case SQLCOM_SHOW_CREATE_EVENT:
+ case SQLCOM_SHOW_CREATE_TRIGGER:
case SQLCOM_SHOW_DATABASES:
case SQLCOM_SHOW_ERRORS:
case SQLCOM_SHOW_FIELDS:
@@ -246,11 +249,14 @@ sp_get_flags_for_command(LEX *lex)
case SQLCOM_CREATE_TRIGGER:
case SQLCOM_CREATE_USER:
case SQLCOM_ALTER_TABLE:
+ case SQLCOM_GRANT:
+ case SQLCOM_REVOKE:
case SQLCOM_BEGIN:
case SQLCOM_RENAME_TABLE:
case SQLCOM_RENAME_USER:
case SQLCOM_DROP_INDEX:
case SQLCOM_DROP_DB:
+ case SQLCOM_REVOKE_ALL:
case SQLCOM_DROP_USER:
case SQLCOM_DROP_VIEW:
case SQLCOM_DROP_TRIGGER:
@@ -280,7 +286,6 @@ sp_get_flags_for_command(LEX *lex)
return flags;
}
-
/*
Prepare an Item for evaluation (call of fix_fields).
@@ -349,13 +354,13 @@ sp_eval_expr(THD *thd, Field *result_field, Item **expr_item_ptr)
enum_check_fields save_count_cuted_fields= thd->count_cuted_fields;
bool save_abort_on_warning= thd->abort_on_warning;
- bool save_no_trans_update_stmt= thd->no_trans_update.stmt;
+ bool save_stmt_modified_non_trans_table= thd->transaction.stmt.modified_non_trans_table;
thd->count_cuted_fields= CHECK_FIELD_ERROR_FOR_NULL;
thd->abort_on_warning=
thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES);
- thd->no_trans_update.stmt= FALSE;
+ thd->transaction.stmt.modified_non_trans_table= FALSE;
/* Save the value in the field. Convert the value if needed. */
@@ -363,7 +368,7 @@ sp_eval_expr(THD *thd, Field *result_field, Item **expr_item_ptr)
thd->count_cuted_fields= save_count_cuted_fields;
thd->abort_on_warning= save_abort_on_warning;
- thd->no_trans_update.stmt= save_no_trans_update_stmt;
+ thd->transaction.stmt.modified_non_trans_table= save_stmt_modified_non_trans_table;
if (thd->net.report_error)
{
@@ -385,13 +390,13 @@ void
sp_name::init_qname(THD *thd)
{
m_sroutines_key.length= m_db.length + m_name.length + 2;
- if (!(m_sroutines_key.str= thd->alloc(m_sroutines_key.length + 1)))
+ if (!(m_sroutines_key.str= (char*) thd->alloc(m_sroutines_key.length + 1)))
return;
m_qname.length= m_sroutines_key.length - 1;
m_qname.str= m_sroutines_key.str + 1;
sprintf(m_qname.str, "%.*s.%.*s",
- m_db.length, (m_db.length ? m_db.str : ""),
- m_name.length, m_name.str);
+ (int) m_db.length, (m_db.length ? m_db.str : ""),
+ (int) m_name.length, m_name.str);
}
@@ -426,8 +431,6 @@ check_routine_name(LEX_STRING *ident)
return FALSE;
}
-/* ------------------------------------------------------------------ */
-
/*
*
@@ -485,8 +488,6 @@ sp_head::sp_head()
*/
m_db= m_name= m_qname= str_reset;
- extern byte *
- sp_table_key(const byte *ptr, uint *plen, my_bool first);
DBUG_ENTER("sp_head::sp_head");
m_backpatch.empty();
@@ -494,6 +495,10 @@ sp_head::sp_head()
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);
+
+ m_body_utf8.str= NULL;
+ m_body_utf8.length= 0;
+
DBUG_VOID_RETURN;
}
@@ -511,12 +516,35 @@ sp_head::init(LEX *lex)
*/
lex->trg_table_fields.empty();
my_init_dynamic_array(&m_instr, sizeof(sp_instr *), 16, 8);
- m_param_begin= m_param_end= m_body_begin= 0;
- m_qname.str= m_db.str= m_name.str= m_params.str=
- m_body.str= m_defstr.str= 0;
- m_qname.length= m_db.length= m_name.length= m_params.length=
- m_body.length= m_defstr.length= 0;
+
+ m_param_begin= NULL;
+ m_param_end= NULL;
+
+ m_body_begin= NULL ;
+
+ m_qname.str= NULL;
+ m_qname.length= 0;
+
+ m_db.str= NULL;
+ m_db.length= 0;
+
+ m_name.str= NULL;
+ m_name.length= 0;
+
+ m_params.str= NULL;
+ m_params.length= 0;
+
+ m_body.str= NULL;
+ m_body.length= 0;
+
+ m_defstr.str= NULL;
+ m_defstr.length= 0;
+
+ m_sroutines_key.str= NULL;
+ m_sroutines_key.length= 0;
+
m_return_field_def.charset= NULL;
+
DBUG_VOID_RETURN;
}
@@ -542,46 +570,72 @@ sp_head::init_sp_name(THD *thd, sp_name *spname)
if (spname->m_qname.length == 0)
spname->init_qname(thd);
- m_qname.length= spname->m_qname.length;
- m_qname.str= strmake_root(thd->mem_root, spname->m_qname.str,
- m_qname.length);
+ m_sroutines_key.length= spname->m_sroutines_key.length;
+ m_sroutines_key.str= (char*) memdup_root(thd->mem_root,
+ spname->m_sroutines_key.str,
+ spname->m_sroutines_key.length + 1);
+ m_sroutines_key.str[0]= static_cast<char>(m_type);
+
+ m_qname.length= m_sroutines_key.length - 1;
+ m_qname.str= m_sroutines_key.str + 1;
DBUG_VOID_RETURN;
}
void
-sp_head::init_strings(THD *thd, LEX *lex)
+sp_head::set_body_start(THD *thd, const char *begin_ptr)
+{
+ m_body_begin= begin_ptr;
+ thd->m_lip->body_utf8_start(thd, begin_ptr);
+}
+
+
+void
+sp_head::set_stmt_end(THD *thd)
{
- DBUG_ENTER("sp_head::init_strings");
- const char *endp; /* Used to trim the end */
- /* During parsing, we must use thd->mem_root */
- MEM_ROOT *root= thd->mem_root;
+ Lex_input_stream *lip= thd->m_lip; /* shortcut */
+ const char *end_ptr= lip->get_cpp_ptr(); /* shortcut */
+
+ /* Make the string of parameters. */
if (m_param_begin && m_param_end)
{
m_params.length= m_param_end - m_param_begin;
- m_params.str= strmake_root(root, m_param_begin, m_params.length);
+ m_params.str= thd->strmake(m_param_begin, m_params.length);
}
- /* If ptr has overrun end_of_query then end_of_query is the end */
- endp= (lex->ptr > lex->end_of_query ? lex->end_of_query : lex->ptr);
+ /* Remember end pointer for further dumping of whole statement. */
+
+ thd->lex->stmt_definition_end= end_ptr;
+
+ /* Make the string of body (in the original character set). */
+
+ m_body.length= end_ptr - m_body_begin;
+ m_body.str= thd->strmake(m_body_begin, m_body.length);
+ trim_whitespace(thd->charset(), & m_body);
+
+ /* Make the string of UTF-body. */
+
+ lip->body_utf8_append(end_ptr);
+
+ m_body_utf8.length= lip->get_body_utf8_length();
+ m_body_utf8.str= thd->strmake(lip->get_body_utf8_str(), m_body_utf8.length);
+ trim_whitespace(thd->charset(), & m_body_utf8);
+
/*
- Trim "garbage" at the end. This is sometimes needed with the
- "/ * ! VERSION... * /" wrapper in dump files.
+ Make the string of whole stored-program-definition query (in the
+ original character set).
*/
- endp= skip_rear_comments(m_body_begin, endp);
- m_body.length= endp - m_body_begin;
- m_body.str= strmake_root(root, m_body_begin, m_body.length);
- m_defstr.length= endp - lex->buf;
- m_defstr.str= strmake_root(root, lex->buf, m_defstr.length);
- DBUG_VOID_RETURN;
+ m_defstr.length= end_ptr - lip->get_cpp_buf();
+ m_defstr.str= thd->strmake(lip->get_cpp_buf(), m_defstr.length);
+ trim_whitespace(thd->charset(), & m_defstr);
}
static TYPELIB *
-create_typelib(MEM_ROOT *mem_root, create_field *field_def, List<String> *src)
+create_typelib(MEM_ROOT *mem_root, Create_field *field_def, List<String> *src)
{
TYPELIB *result= NULL;
CHARSET_INFO *cs= field_def->charset;
@@ -636,17 +690,10 @@ int
sp_head::create(THD *thd)
{
DBUG_ENTER("sp_head::create");
- int ret;
-
DBUG_PRINT("info", ("type: %d name: %s params: %s body: %s",
m_type, m_name.str, m_params.str, m_body.str));
- if (m_type == TYPE_ENUM_FUNCTION)
- ret= sp_create_function(thd, this);
- else
- ret= sp_create_procedure(thd, this);
-
- DBUG_RETURN(ret);
+ DBUG_RETURN(sp_create_routine(thd, m_type, this));
}
sp_head::~sp_head()
@@ -713,7 +760,7 @@ sp_head::create_result_field(uint field_max_length, const char *field_name,
field_max_length : m_return_field_def.length;
field= ::make_field(table->s, /* TABLE_SHARE ptr */
- (char*) 0, /* field ptr */
+ (uchar*) 0, /* field ptr */
field_length, /* field [max] length */
(uchar*) "", /* null ptr */
0, /* null bit */
@@ -815,7 +862,8 @@ int cmp_splocal_locations(Item_splocal * const *a, Item_splocal * const *b)
/*
- Replace thd->query{_length} with a string that one can write to the binlog.
+ Replace thd->query{_length} with a string that one can write to the binlog
+ or the query cache.
SYNOPSIS
subst_spvars()
@@ -827,7 +875,9 @@ int cmp_splocal_locations(Item_splocal * const *a, Item_splocal * const *b)
DESCRIPTION
The binlog-suitable string is produced by replacing references to SP local
- variables with NAME_CONST('sp_var_name', value) calls.
+ variables with NAME_CONST('sp_var_name', value) calls. To make this string
+ suitable for the query cache this function allocates some additional space
+ for the query cache flags.
RETURN
FALSE on success
@@ -840,80 +890,89 @@ static bool
subst_spvars(THD *thd, sp_instr *instr, LEX_STRING *query_str)
{
DBUG_ENTER("subst_spvars");
- if (thd->prelocked_mode == NON_PRELOCKED && mysql_bin_log.is_open())
- {
- Dynamic_array<Item_splocal*> sp_vars_uses;
- char *pbuf, *cur, buffer[512];
- String qbuf(buffer, sizeof(buffer), &my_charset_bin);
- int prev_pos, res;
- /* Find all instances of Item_splocal used in this statement */
- for (Item *item= instr->free_list; item; item= item->next)
- {
- if (item->is_splocal())
- {
- Item_splocal *item_spl= (Item_splocal*)item;
- if (item_spl->pos_in_query)
- sp_vars_uses.append(item_spl);
- }
- }
- if (!sp_vars_uses.elements())
- DBUG_RETURN(FALSE);
-
- /* Sort SP var refs by their occurences in the query */
- sp_vars_uses.sort(cmp_splocal_locations);
+ Dynamic_array<Item_splocal*> sp_vars_uses;
+ char *pbuf, *cur, buffer[512];
+ String qbuf(buffer, sizeof(buffer), &my_charset_bin);
+ int prev_pos, res, buf_len;
- /*
- Construct a statement string where SP local var refs are replaced
- with "NAME_CONST(name, value)"
- */
- qbuf.length(0);
- cur= query_str->str;
- prev_pos= res= 0;
- for (Item_splocal **splocal= sp_vars_uses.front();
- splocal < sp_vars_uses.back(); splocal++)
+ /* Find all instances of Item_splocal used in this statement */
+ for (Item *item= instr->free_list; item; item= item->next)
+ {
+ if (item->is_splocal())
{
- Item *val;
+ Item_splocal *item_spl= (Item_splocal*)item;
+ if (item_spl->pos_in_query)
+ sp_vars_uses.append(item_spl);
+ }
+ }
+ if (!sp_vars_uses.elements())
+ DBUG_RETURN(FALSE);
+
+ /* Sort SP var refs by their occurences in the query */
+ sp_vars_uses.sort(cmp_splocal_locations);
- char str_buffer[STRING_BUFFER_USUAL_SIZE];
- String str_value_holder(str_buffer, sizeof(str_buffer),
- &my_charset_latin1);
- String *str_value;
-
- /* append the text between sp ref occurences */
- res|= qbuf.append(cur + prev_pos, (*splocal)->pos_in_query - prev_pos);
- prev_pos= (*splocal)->pos_in_query + (*splocal)->m_name.length;
-
- /* append the spvar substitute */
- res|= qbuf.append(STRING_WITH_LEN(" NAME_CONST('"));
- res|= qbuf.append((*splocal)->m_name.str, (*splocal)->m_name.length);
- res|= qbuf.append(STRING_WITH_LEN("',"));
- res|= (*splocal)->fix_fields(thd, (Item **) splocal);
+ /*
+ Construct a statement string where SP local var refs are replaced
+ with "NAME_CONST(name, value)"
+ */
+ qbuf.length(0);
+ cur= query_str->str;
+ prev_pos= res= 0;
+ for (Item_splocal **splocal= sp_vars_uses.front();
+ splocal < sp_vars_uses.back(); splocal++)
+ {
+ Item *val;
- if (res)
- break;
+ char str_buffer[STRING_BUFFER_USUAL_SIZE];
+ String str_value_holder(str_buffer, sizeof(str_buffer),
+ &my_charset_latin1);
+ String *str_value;
+
+ /* append the text between sp ref occurences */
+ res|= qbuf.append(cur + prev_pos, (*splocal)->pos_in_query - prev_pos);
+ prev_pos= (*splocal)->pos_in_query + (*splocal)->len_in_query;
+
+ /* append the spvar substitute */
+ res|= qbuf.append(STRING_WITH_LEN(" NAME_CONST('"));
+ res|= qbuf.append((*splocal)->m_name.str, (*splocal)->m_name.length);
+ res|= qbuf.append(STRING_WITH_LEN("',"));
+ res|= (*splocal)->fix_fields(thd, (Item **) splocal);
- val= (*splocal)->this_item();
- DBUG_PRINT("info", ("print 0x%lx", (long) val));
- str_value= sp_get_item_value(thd, val, &str_value_holder);
- if (str_value)
- res|= qbuf.append(*str_value);
- else
- res|= qbuf.append(STRING_WITH_LEN("NULL"));
- res|= qbuf.append(')');
- if (res)
- break;
- }
- res|= qbuf.append(cur + prev_pos, query_str->length - prev_pos);
if (res)
- DBUG_RETURN(TRUE);
+ break;
- if (!(pbuf= thd->strmake(qbuf.ptr(), qbuf.length())))
- DBUG_RETURN(TRUE);
+ val= (*splocal)->this_item();
+ DBUG_PRINT("info", ("print 0x%lx", (long) val));
+ str_value= sp_get_item_value(thd, val, &str_value_holder);
+ if (str_value)
+ res|= qbuf.append(*str_value);
+ else
+ res|= qbuf.append(STRING_WITH_LEN("NULL"));
+ res|= qbuf.append(')');
+ if (res)
+ break;
+ }
+ res|= qbuf.append(cur + prev_pos, query_str->length - prev_pos);
+ if (res)
+ DBUG_RETURN(TRUE);
- thd->query= pbuf;
- thd->query_length= qbuf.length();
+ /*
+ Allocate additional space at the end of the new query string for the
+ query_cache_send_result_to_client function.
+ */
+ buf_len= qbuf.length() + thd->db_length + 1 + QUERY_CACHE_FLAGS_SIZE + 1;
+ if ((pbuf= (char *) alloc_root(thd->mem_root, buf_len)))
+ {
+ memcpy(pbuf, qbuf.ptr(), qbuf.length());
+ pbuf[qbuf.length()]= 0;
}
+ else
+ DBUG_RETURN(TRUE);
+
+ thd->query= pbuf;
+ thd->query_length= qbuf.length();
+
DBUG_RETURN(FALSE);
}
@@ -957,9 +1016,10 @@ bool
sp_head::execute(THD *thd)
{
DBUG_ENTER("sp_head::execute");
- char old_db_buf[NAME_LEN+1];
- LEX_STRING old_db= { old_db_buf, sizeof(old_db_buf) };
- bool dbchanged;
+ char saved_cur_db_name_buf[NAME_LEN+1];
+ LEX_STRING saved_cur_db_name=
+ { saved_cur_db_name_buf, sizeof(saved_cur_db_name_buf) };
+ bool cur_db_changed= FALSE;
sp_rcontext *ctx;
bool err_status= FALSE;
uint ip= 0;
@@ -976,8 +1036,10 @@ sp_head::execute(THD *thd)
Item_change_list old_change_list;
String old_packet;
+ Object_creation_ctx *saved_creation_ctx;
+
/* Use some extra margin for possible SP recursion and functions */
- if (check_stack_overrun(thd, 8 * STACK_MIN_SIZE, (char*)&old_packet))
+ if (check_stack_overrun(thd, 8 * STACK_MIN_SIZE, (uchar*)&old_packet))
DBUG_RETURN(TRUE);
/* init per-instruction memroot */
@@ -1012,8 +1074,11 @@ sp_head::execute(THD *thd)
*/
if (m_db.length &&
- (err_status= sp_use_new_db(thd, m_db, &old_db, 0, &dbchanged)))
+ (err_status= mysql_opt_change_db(thd, &m_db, &saved_cur_db_name, FALSE,
+ &cur_db_changed)))
+ {
goto done;
+ }
if ((ctx= thd->spcont))
ctx->clear_handler();
@@ -1021,6 +1086,12 @@ sp_head::execute(THD *thd)
old_arena= thd->stmt_arena;
/*
+ Switch query context. This has to be done early as this is sometimes
+ allocated trough sql_alloc
+ */
+ saved_creation_ctx= m_creation_ctx->set_n_backup(thd);
+
+ /*
We have to save/restore this info when we are changing call level to
be able properly do close_thread_tables() in instructions.
*/
@@ -1151,6 +1222,12 @@ sp_head::execute(THD *thd)
}
} while (!err_status && !thd->killed);
+ /* Restore query context. */
+
+ m_creation_ctx->restore_env(thd, saved_creation_ctx);
+
+ /* Restore arena. */
+
thd->restore_active_arena(&execute_arena, &backup_arena);
thd->spcont->pop_all_cursors(); // To avoid memory leaks after an error
@@ -1182,14 +1259,14 @@ sp_head::execute(THD *thd)
If the DB has changed, the pointer has changed too, but the
original thd->db will then have been freed
*/
- if (dbchanged)
+ if (cur_db_changed && !thd->killed)
{
/*
- No access check when changing back to where we came from.
- (It would generate an error from mysql_change_db() when old_db=="")
+ Force switching back to the saved current database, because it may be
+ NULL. In this case, mysql_change_db() would generate an error.
*/
- if (! thd->killed)
- err_status|= mysql_change_db(thd, &old_db, TRUE);
+
+ err_status|= mysql_change_db(thd, &saved_cur_db_name, TRUE);
}
m_flags&= ~IS_INVOKED;
DBUG_PRINT("info",
@@ -1276,30 +1353,31 @@ set_routine_security_ctx(THD *thd, sp_head *sp, bool is_proc,
#endif // ! NO_EMBEDDED_ACCESS_CHECKS
-/*
- Execute a trigger:
- - changes security context for triggers
- - switch to new memroot
- - call sp_head::execute
- - restore old memroot
- - restores security context
+/**
+ Execute trigger stored program.
- SYNOPSIS
- sp_head::execute_trigger()
- thd Thread handle
- db database name
- table table name
- grant_info GRANT_INFO structure to be filled with
- information about definer's privileges
- on subject table
-
- RETURN
- FALSE on success
- TRUE on error
+ Execute a trigger:
+ - changes security context for triggers;
+ - switch to new memroot;
+ - call sp_head::execute;
+ - restore old memroot;
+ - restores security context.
+
+ @param thd Thread context.
+ @param db_name Database name.
+ @param table_name Table name.
+ @param grant_info GRANT_INFO structure to be filled with information
+ about definer's privileges on subject table.
+
+ @return Error status.
+ @retval FALSE on success.
+ @retval TRUE on error.
*/
bool
-sp_head::execute_trigger(THD *thd, const char *db, const char *table,
+sp_head::execute_trigger(THD *thd,
+ const LEX_STRING *db_name,
+ const LEX_STRING *table_name,
GRANT_INFO *grant_info)
{
sp_rcontext *octx = thd->spcont;
@@ -1312,6 +1390,46 @@ sp_head::execute_trigger(THD *thd, const char *db, const char *table,
DBUG_ENTER("sp_head::execute_trigger");
DBUG_PRINT("info", ("trigger %s", m_name.str));
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
+ Security_context *save_ctx= NULL;
+
+
+ if (m_chistics->suid != SP_IS_NOT_SUID &&
+ m_security_ctx.change_security_context(thd,
+ &m_definer_user,
+ &m_definer_host,
+ &m_db,
+ &save_ctx))
+ DBUG_RETURN(TRUE);
+
+ /*
+ Fetch information about table-level privileges for subject table into
+ GRANT_INFO instance. The access check itself will happen in
+ Item_trigger_field, where this information will be used along with
+ information about column-level privileges.
+ */
+
+ fill_effective_table_privileges(thd,
+ grant_info,
+ db_name->str,
+ table_name->str);
+
+ /* Check that the definer has TRIGGER privilege on the subject table. */
+
+ if (!(grant_info->privilege & TRIGGER_ACL))
+ {
+ char priv_desc[128];
+ get_privilege_desc(priv_desc, sizeof(priv_desc), TRIGGER_ACL);
+
+ my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0), priv_desc,
+ thd->security_ctx->priv_user, thd->security_ctx->host_or_ip,
+ table_name->str);
+
+ m_security_ctx.restore_security_context(thd, save_ctx);
+ DBUG_RETURN(TRUE);
+ }
+#endif // NO_EMBEDDED_ACCESS_CHECKS
+
/*
Prepare arena and memroot for objects which lifetime is whole
duration of trigger call (sp_rcontext, it's tables and items,
@@ -1344,11 +1462,19 @@ sp_head::execute_trigger(THD *thd, const char *db, const char *table,
err_with_cleanup:
thd->restore_active_arena(&call_arena, &backup_arena);
+
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
+ m_security_ctx.restore_security_context(thd, save_ctx);
+#endif // NO_EMBEDDED_ACCESS_CHECKS
+
delete nctx;
call_arena.free_items();
free_root(&call_mem_root, MYF(0));
thd->spcont= octx;
+ if (thd->killed)
+ thd->send_kill_message();
+
DBUG_RETURN(err_status);
}
@@ -1664,7 +1790,7 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
{
List_iterator<Item> it_args(*args);
- DBUG_PRINT("info",(" %.*s: eval args", m_name.length, m_name.str));
+ DBUG_PRINT("info",(" %.*s: eval args", (int) m_name.length, m_name.str));
for (uint i= 0 ; i < params ; i++)
{
@@ -1722,7 +1848,8 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
if (!thd->in_sub_stmt)
close_thread_tables(thd, 0, 0);
- DBUG_PRINT("info",(" %.*s: eval args done", m_name.length, m_name.str));
+ DBUG_PRINT("info",(" %.*s: eval args done",
+ (int) m_name.length, m_name.str));
}
if (!(m_flags & LOG_SLOW_STATEMENTS) && thd->enable_slow_log)
{
@@ -1815,25 +1942,13 @@ sp_head::reset_lex(THD *thd)
DBUG_ENTER("sp_head::reset_lex");
LEX *sublex;
LEX *oldlex= thd->lex;
- my_lex_states org_next_state= oldlex->next_state;
(void)m_lex.push_front(oldlex);
thd->lex= sublex= new st_lex;
- /* Reset most stuff. The length arguments doesn't matter here. */
- lex_start(thd, oldlex->buf, (ulong) (oldlex->end_of_query - oldlex->ptr));
+ /* Reset most stuff. */
+ lex_start(thd);
- /*
- next_state is normally the same (0), but it happens that we swap lex in
- "mid-sentence", so we must restore it.
- */
- sublex->next_state= org_next_state;
- /* We must reset ptr and end_of_query again */
- sublex->ptr= oldlex->ptr;
- sublex->end_of_query= oldlex->end_of_query;
- sublex->tok_start= oldlex->tok_start;
- sublex->tok_end= oldlex->tok_end;
- sublex->yylineno= oldlex->yylineno;
/* And keep the SP stuff too */
sublex->sphead= oldlex->sphead;
sublex->spcont= oldlex->spcont;
@@ -1842,8 +1957,6 @@ sp_head::reset_lex(THD *thd)
sublex->trg_table_fields.empty();
sublex->sp_lex_in_use= FALSE;
- sublex->in_comment= oldlex->in_comment;
-
/* Reset type info. */
sublex->charset= NULL;
@@ -1861,15 +1974,14 @@ sp_head::restore_lex(THD *thd)
{
DBUG_ENTER("sp_head::restore_lex");
LEX *sublex= thd->lex;
- LEX *oldlex= (LEX *)m_lex.pop();
+ LEX *oldlex;
+
+ sublex->set_trg_event_type_for_tables();
+ oldlex= (LEX *)m_lex.pop();
if (! oldlex)
return; // Nothing to restore
- // Update some state in the old one first
- oldlex->ptr= sublex->ptr;
- oldlex->tok_end= sublex->tok_end;
- oldlex->next_state= sublex->next_state;
oldlex->trg_table_fields.push_back(&sublex->trg_table_fields);
/*
@@ -1877,7 +1989,7 @@ sp_head::restore_lex(THD *thd)
cannot switch from statement-based to row-based only for this
substatement).
*/
- if (sublex->binlog_row_based_if_mixed)
+ if (sublex->is_stmt_unsafe())
m_flags|= BINLOG_ROW_BASED_IF_MIXED;
/*
@@ -1927,7 +2039,7 @@ sp_head::backpatch(sp_label_t *lab)
}
/*
- Prepare an instance of create_field for field creation (fill all necessary
+ Prepare an instance of Create_field for field creation (fill all necessary
attributes).
SYNOPSIS
@@ -1935,7 +2047,7 @@ sp_head::backpatch(sp_label_t *lab)
thd [IN] Thread handle
lex [IN] Yacc parsing context
field_type [IN] Field type
- field_def [OUT] An instance of create_field to be filled
+ field_def [OUT] An instance of Create_field to be filled
RETURN
FALSE on success
@@ -1945,20 +2057,17 @@ sp_head::backpatch(sp_label_t *lab)
bool
sp_head::fill_field_definition(THD *thd, LEX *lex,
enum enum_field_types field_type,
- create_field *field_def)
+ Create_field *field_def)
{
- HA_CREATE_INFO sp_db_info;
LEX_STRING cmt = { 0, 0 };
uint unused1= 0;
int unused2= 0;
- load_db_opt_by_name(thd, m_db.str, &sp_db_info);
-
if (field_def->init(thd, (char*) "", field_type, lex->length, lex->dec,
lex->type, (Item*) 0, (Item*) 0, &cmt, 0,
&lex->interval_list,
- (lex->charset ? lex->charset :
- sp_db_info.default_table_charset),
+ lex->charset ? lex->charset :
+ thd->variables.collation_database,
lex->uint_geom_type))
return TRUE;
@@ -2119,49 +2228,112 @@ bool check_show_routine_access(THD *thd, sp_head *sp, bool *full_access)
}
-int
-sp_head::show_create_procedure(THD *thd)
+/**
+ Implement SHOW CREATE statement for stored routines.
+
+ @param thd Thread context.
+ @param type Stored routine type
+ (TYPE_ENUM_PROCEDURE or TYPE_ENUM_FUNCTION)
+
+ @return Error status.
+ @retval FALSE on success
+ @retval TRUE on error
+*/
+
+bool
+sp_head::show_create_routine(THD *thd, int type)
{
+ const char *col1_caption= type == TYPE_ENUM_PROCEDURE ?
+ "Procedure" : "Function";
+
+ const char *col3_caption= type == TYPE_ENUM_PROCEDURE ?
+ "Create Procedure" : "Create Function";
+
+ bool err_status;
+
Protocol *protocol= thd->protocol;
- char buff[2048];
- String buffer(buff, sizeof(buff), system_charset_info);
- int res;
- List<Item> field_list;
+ List<Item> fields;
+
LEX_STRING sql_mode;
+
bool full_access;
- DBUG_ENTER("sp_head::show_create_procedure");
- DBUG_PRINT("info", ("procedure %s", m_name.str));
+
+ DBUG_ENTER("sp_head::show_create_routine");
+ DBUG_PRINT("info", ("routine %s", m_name.str));
+
+ DBUG_ASSERT(type == TYPE_ENUM_PROCEDURE ||
+ type == TYPE_ENUM_FUNCTION);
if (check_show_routine_access(thd, this, &full_access))
- DBUG_RETURN(1);
+ DBUG_RETURN(TRUE);
- sys_var_thd_sql_mode::symbolic_mode_representation(thd, m_sql_mode,
- &sql_mode);
- field_list.push_back(new Item_empty_string("Procedure", NAME_CHAR_LEN));
- field_list.push_back(new Item_empty_string("sql_mode", sql_mode.length));
- // 1024 is for not to confuse old clients
- Item_empty_string *definition=
- new Item_empty_string("Create Procedure", max(buffer.length(),1024));
- definition->maybe_null= TRUE;
- field_list.push_back(definition);
+ sys_var_thd_sql_mode::symbolic_mode_representation(
+ thd, m_sql_mode, &sql_mode);
+
+ /* Send header. */
+
+ fields.push_back(new Item_empty_string(col1_caption, NAME_CHAR_LEN));
+ fields.push_back(new Item_empty_string("sql_mode", sql_mode.length));
+
+ {
+ /*
+ NOTE: SQL statement field must be not less than 1024 in order not to
+ confuse old clients.
+ */
+
+ Item_empty_string *stmt_fld=
+ new Item_empty_string(col3_caption,
+ max(m_defstr.length, 1024));
+
+ stmt_fld->maybe_null= TRUE;
+
+ fields.push_back(stmt_fld);
+ }
+
+ fields.push_back(new Item_empty_string("character_set_client",
+ MY_CS_NAME_SIZE));
+
+ fields.push_back(new Item_empty_string("collation_connection",
+ MY_CS_NAME_SIZE));
+
+ fields.push_back(new Item_empty_string("Database Collation",
+ MY_CS_NAME_SIZE));
+
+ if (protocol->send_fields(&fields,
+ Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
+ {
+ DBUG_RETURN(TRUE);
+ }
+
+ /* Send data. */
- if (protocol->send_fields(&field_list, Protocol::SEND_NUM_ROWS |
- Protocol::SEND_EOF))
- DBUG_RETURN(1);
protocol->prepare_for_resend();
+
protocol->store(m_name.str, m_name.length, system_charset_info);
- protocol->store((char*) sql_mode.str, sql_mode.length, system_charset_info);
+ protocol->store(sql_mode.str, sql_mode.length, system_charset_info);
+
if (full_access)
- protocol->store(m_defstr.str, m_defstr.length, system_charset_info);
+ protocol->store(m_defstr.str, m_defstr.length,
+ m_creation_ctx->get_client_cs());
else
protocol->store_null();
- res= protocol->write();
- send_eof(thd);
- DBUG_RETURN(res);
+
+ protocol->store(m_creation_ctx->get_client_cs()->csname, system_charset_info);
+ protocol->store(m_creation_ctx->get_connection_cl()->name, system_charset_info);
+ protocol->store(m_creation_ctx->get_db_cl()->name, system_charset_info);
+
+ err_status= protocol->write();
+
+ if (!err_status)
+ send_eof(thd);
+
+ DBUG_RETURN(err_status);
}
+
+
/*
Add instruction to SP
@@ -2181,49 +2353,7 @@ void sp_head::add_instr(sp_instr *instr)
entire stored procedure, as their life span is equal.
*/
instr->mem_root= &main_mem_root;
- insert_dynamic(&m_instr, (gptr)&instr);
-}
-
-
-int
-sp_head::show_create_function(THD *thd)
-{
- Protocol *protocol= thd->protocol;
- char buff[2048];
- String buffer(buff, sizeof(buff), system_charset_info);
- int res;
- List<Item> field_list;
- LEX_STRING sql_mode;
- bool full_access;
- DBUG_ENTER("sp_head::show_create_function");
- DBUG_PRINT("info", ("procedure %s", m_name.str));
-
- if (check_show_routine_access(thd, this, &full_access))
- DBUG_RETURN(1);
-
- sys_var_thd_sql_mode::symbolic_mode_representation(thd, m_sql_mode,
- &sql_mode);
- field_list.push_back(new Item_empty_string("Function",NAME_CHAR_LEN));
- field_list.push_back(new Item_empty_string("sql_mode", sql_mode.length));
- Item_empty_string *definition=
- new Item_empty_string("Create Function", max(buffer.length(),1024));
- definition->maybe_null= TRUE;
- field_list.push_back(definition);
-
- if (protocol->send_fields(&field_list,
- Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
- DBUG_RETURN(1);
- protocol->prepare_for_resend();
- protocol->store(m_name.str, m_name.length, system_charset_info);
- protocol->store(sql_mode.str, sql_mode.length, system_charset_info);
- if (full_access)
- protocol->store(m_defstr.str, m_defstr.length, system_charset_info);
- else
- protocol->store_null();
- res= protocol->write();
- send_eof(thd);
-
- DBUG_RETURN(res);
+ insert_dynamic(&m_instr, (uchar*)&instr);
}
@@ -2267,7 +2397,7 @@ void sp_head::optimize()
sp_instr *ibp;
List_iterator_fast<sp_instr> li(bp);
- set_dynamic(&m_instr, (gptr)&i, dst);
+ set_dynamic(&m_instr, (uchar*)&i, dst);
while ((ibp= li++))
{
sp_instr_opt_meta *im= static_cast<sp_instr_opt_meta *>(ibp);
@@ -2387,7 +2517,9 @@ sp_head::show_routine_code(THD *thd)
if ((res= protocol->write()))
break;
}
- send_eof(thd);
+
+ if (!res)
+ send_eof(thd);
DBUG_RETURN(res);
}
@@ -2425,6 +2557,13 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp,
int res= 0;
DBUG_ENTER("reset_lex_and_exec_core");
+ /*
+ The flag is saved at the entry to the following substatement.
+ It's reset further in the common code part.
+ It's merged with the saved parent's value at the exit of this func.
+ */
+ bool parent_modified_non_trans_table= thd->transaction.stmt.modified_non_trans_table;
+ thd->transaction.stmt.modified_non_trans_table= FALSE;
DBUG_ASSERT(!thd->derived_tables);
DBUG_ASSERT(thd->change_list.is_empty());
/*
@@ -2494,7 +2633,11 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp,
/* Update the state of the active arena. */
thd->stmt_arena->state= Query_arena::EXECUTED;
-
+ /*
+ Merge here with the saved parent's values
+ what is needed from the substatement gained
+ */
+ thd->transaction.stmt.modified_non_trans_table |= parent_modified_non_trans_table;
/*
Unlike for PS we should not call Item's destructors for newly created
items after execution of each instruction in stored routine. This is
@@ -2656,7 +2799,7 @@ sp_instr_set::exec_core(THD *thd, uint *nextp)
sp_rcontext *spcont= thd->spcont;
- thd->spcont= 0; /* Avoid handlers */
+ thd->spcont= NULL; /* Avoid handlers */
my_error(ER_OUT_OF_RESOURCES, MYF(0));
spcont->clear_handler();
thd->spcont= spcont;
@@ -3062,10 +3205,20 @@ sp_instr_hreturn::print(String *str)
uint
sp_instr_hreturn::opt_mark(sp_head *sp, List<sp_instr> *leads)
{
- if (m_dest)
- return sp_instr_jump::opt_mark(sp, leads);
-
marked= 1;
+
+ if (m_dest)
+ {
+ /*
+ This is an EXIT handler; next instruction step is in m_dest.
+ */
+ return m_dest;
+ }
+
+ /*
+ This is a CONTINUE handler; next instruction step will come from
+ the handler stack and not from opt_mark.
+ */
return UINT_MAX;
}
@@ -3381,7 +3534,7 @@ sp_instr_set_case_expr::exec_core(THD *thd, uint *nextp)
sp_rcontext *spcont= thd->spcont;
- thd->spcont= 0; /* Avoid handlers */
+ thd->spcont= NULL; /* Avoid handlers */
my_error(ER_OUT_OF_RESOURCES, MYF(0));
spcont->clear_handler();
thd->spcont= spcont;
@@ -3456,14 +3609,15 @@ typedef struct st_sp_table
thr_lock_type lock_type; /* lock type used for prelocking */
uint lock_count;
uint query_lock_count;
+ uint8 trg_event_map;
} SP_TABLE;
-byte *
-sp_table_key(const byte *ptr, uint *plen, my_bool first)
+
+uchar *sp_table_key(const uchar *ptr, size_t *plen, my_bool first)
{
SP_TABLE *tab= (SP_TABLE *)ptr;
*plen= tab->qname.length;
- return (byte *)tab->qname.str;
+ return (uchar *)tab->qname.str;
}
@@ -3520,12 +3674,20 @@ sp_head::merge_table_list(THD *thd, TABLE_LIST *table, LEX *lex_for_tmp_check)
tname[tlen]= '\0';
/*
+ Upgrade the lock type because this table list will be used
+ only in pre-locked mode, in which DELAYED inserts are always
+ converted to normal inserts.
+ */
+ if (table->lock_type == TL_WRITE_DELAYED)
+ table->lock_type= TL_WRITE;
+
+ /*
We ignore alias when we check if table was already marked as temporary
(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, (byte *)tname, tlen)) ||
- ((tab= (SP_TABLE *)hash_search(&m_sptabs, (byte *)tname,
+ if ((tab= (SP_TABLE *)hash_search(&m_sptabs, (uchar *)tname, tlen)) ||
+ ((tab= (SP_TABLE *)hash_search(&m_sptabs, (uchar *)tname,
tlen - alen - 1)) &&
tab->temp))
{
@@ -3534,6 +3696,7 @@ sp_head::merge_table_list(THD *thd, TABLE_LIST *table, LEX *lex_for_tmp_check)
tab->query_lock_count++;
if (tab->query_lock_count > tab->lock_count)
tab->lock_count++;
+ tab->trg_event_map|= table->trg_event_map;
}
else
{
@@ -3555,7 +3718,8 @@ sp_head::merge_table_list(THD *thd, TABLE_LIST *table, LEX *lex_for_tmp_check)
tab->db_length= table->db_length;
tab->lock_type= table->lock_type;
tab->lock_count= tab->query_lock_count= 1;
- my_hash_insert(&m_sptabs, (byte *)tab);
+ tab->trg_event_map= table->trg_event_map;
+ my_hash_insert(&m_sptabs, (uchar *)tab);
}
}
return TRUE;
@@ -3632,6 +3796,7 @@ sp_head::add_used_tables_to_table_list(THD *thd,
table->cacheable_table= 1;
table->prelocking_placeholder= 1;
table->belong_to_view= belong_to_view;
+ table->trg_event_map= stab->trg_event_map;
/* Everyting else should be zeroed */
diff --git a/sql/sp_head.h b/sql/sp_head.h
index 551707fa7bd..3a8b41acd4c 100644
--- a/sql/sp_head.h
+++ b/sql/sp_head.h
@@ -23,6 +23,11 @@
#include <stddef.h>
+/**
+ @defgroup Stored_Routines Stored Routines
+ @ingroup Runtime_Environment
+ @{
+*/
// Values for the type enum. This reflects the order of the enum declaration
// in the CREATE TABLE command.
#define TYPE_ENUM_FUNCTION 1
@@ -45,6 +50,58 @@ class sp_instr_jump_if_not;
struct sp_cond_type;
struct sp_variable;
+/*************************************************************************/
+
+/**
+ Stored_program_creation_ctx -- base class for creation context of stored
+ programs (stored routines, triggers, events).
+*/
+
+class Stored_program_creation_ctx :public Default_object_creation_ctx
+{
+public:
+ CHARSET_INFO *get_db_cl()
+ {
+ return m_db_cl;
+ }
+
+public:
+ virtual Stored_program_creation_ctx *clone(MEM_ROOT *mem_root) = 0;
+
+protected:
+ Stored_program_creation_ctx(THD *thd)
+ : Default_object_creation_ctx(thd),
+ m_db_cl(thd->variables.collation_database)
+ { }
+
+ Stored_program_creation_ctx(CHARSET_INFO *client_cs,
+ CHARSET_INFO *connection_cl,
+ CHARSET_INFO *db_cl)
+ : Default_object_creation_ctx(client_cs, connection_cl),
+ m_db_cl(db_cl)
+ { }
+
+protected:
+ virtual void change_env(THD *thd) const
+ {
+ thd->variables.collation_database= m_db_cl;
+
+ Default_object_creation_ctx::change_env(thd);
+ }
+
+protected:
+ /**
+ db_cl stores the value of the database collation. Both character set
+ and collation attributes are used.
+
+ Database collation is included into the context because it defines the
+ default collation for stored-program variables.
+ */
+ CHARSET_INFO *m_db_cl;
+};
+
+/*************************************************************************/
+
class sp_name : public Sql_alloc
{
public:
@@ -126,19 +183,41 @@ public:
int m_type;
uint m_flags; // Boolean attributes of a stored routine
- create_field m_return_field_def; /* This is used for FUNCTIONs only. */
+ Create_field m_return_field_def; /* This is used for FUNCTIONs only. */
const char *m_tmp_query; // Temporary pointer to sub query string
st_sp_chistics *m_chistics;
ulong m_sql_mode; // For SHOW CREATE and execution
LEX_STRING m_qname; // db.name
+ /**
+ Key representing routine in the set of stored routines used by statement.
+ [routine_type]db.name
+ @sa sp_name::m_sroutines_key
+ */
+ LEX_STRING m_sroutines_key;
LEX_STRING m_db;
LEX_STRING m_name;
LEX_STRING m_params;
LEX_STRING m_body;
+ LEX_STRING m_body_utf8;
LEX_STRING m_defstr;
LEX_STRING m_definer_user;
LEX_STRING m_definer_host;
+
+private:
+ Stored_program_creation_ctx *m_creation_ctx;
+
+public:
+ inline Stored_program_creation_ctx *get_creation_ctx()
+ {
+ return m_creation_ctx;
+ }
+
+ inline void set_creation_ctx(Stored_program_creation_ctx *creation_ctx)
+ {
+ m_creation_ctx= creation_ctx->clone(mem_root);
+ }
+
longlong m_created;
longlong m_modified;
/* Recursion level of the current SP instance. The levels are numbered from 0 */
@@ -176,8 +255,13 @@ public:
*/
HASH m_sroutines;
// Pointers set during parsing
- const char *m_param_begin, *m_param_end, *m_body_begin;
+ const char *m_param_begin;
+ const char *m_param_end;
+private:
+ const char *m_body_begin;
+
+public:
/*
Security context for stored routine which should be run under
definer privileges.
@@ -200,9 +284,13 @@ public:
void
init_sp_name(THD *thd, sp_name *spname);
- // Initialize strings after parsing header
+ /** Set the body-definition start position. */
void
- init_strings(THD *thd, LEX *lex);
+ set_body_start(THD *thd, const char *begin_ptr);
+
+ /** Set the statement-definition (body-definition) end position. */
+ void
+ set_stmt_end(THD *thd);
int
create(THD *thd);
@@ -214,8 +302,10 @@ public:
destroy();
bool
- execute_trigger(THD *thd, const char *db, const char *table,
- GRANT_INFO *grant_onfo);
+ execute_trigger(THD *thd,
+ const LEX_STRING *db_name,
+ const LEX_STRING *table_name,
+ GRANT_INFO *grant_info);
bool
execute_function(THD *thd, Item **args, uint argcount, Field *return_fld);
@@ -223,11 +313,8 @@ public:
bool
execute_procedure(THD *thd, List<Item> *args);
- int
- show_create_procedure(THD *thd);
-
- int
- show_create_function(THD *thd);
+ bool
+ show_create_routine(THD *thd, int type);
void
add_instr(sp_instr *instr);
@@ -243,7 +330,7 @@ public:
{
sp_instr *i;
- get_dynamic(&m_instr, (gptr)&i, m_instr.elements-1);
+ get_dynamic(&m_instr, (uchar*)&i, m_instr.elements-1);
return i;
}
@@ -291,7 +378,7 @@ public:
bool fill_field_definition(THD *thd, LEX *lex,
enum enum_field_types field_type,
- create_field *field_def);
+ Create_field *field_def);
void set_info(longlong created, longlong modified,
st_sp_chistics *chistics, ulong sql_mode);
@@ -325,7 +412,7 @@ public:
sp_instr *ip;
if (i < m_instr.elements)
- get_dynamic(&m_instr, (gptr)&ip, i);
+ get_dynamic(&m_instr, (uchar*)&ip, i);
else
ip= NULL;
return ip;
@@ -379,7 +466,7 @@ public:
the substatements not).
*/
if (m_flags & BINLOG_ROW_BASED_IF_MIXED)
- lex->binlog_row_based_if_mixed= TRUE;
+ lex->set_stmt_unsafe();
}
@@ -990,6 +1077,12 @@ public:
virtual void print(String *str);
+ /* This instruction will not be short cut optimized. */
+ virtual uint opt_shortcut_jump(sp_head *sp, sp_instr *start)
+ {
+ return m_ip;
+ }
+
virtual uint opt_mark(sp_head *sp, List<sp_instr> *leads);
private:
@@ -1234,4 +1327,8 @@ sp_prepare_func_item(THD* thd, Item **it_addr);
bool
sp_eval_expr(THD *thd, Field *result_field, Item **expr_item_ptr);
+/**
+ @} (end of group Stored_Routines)
+*/
+
#endif /* _SP_HEAD_H_ */
diff --git a/sql/sp_pcontext.cc b/sql/sp_pcontext.cc
index 780243cc79f..8babbd52ff6 100644
--- a/sql/sp_pcontext.cc
+++ b/sql/sp_pcontext.cc
@@ -211,7 +211,7 @@ sp_pcontext::find_variable(LEX_STRING *name, my_bool scoped)
{
sp_variable_t *p;
- get_dynamic(&m_vars, (gptr)&p, i);
+ get_dynamic(&m_vars, (uchar*)&p, i);
if (my_strnncoll(system_charset_info,
(const uchar *)name->str, name->length,
(const uchar *)p->name.str, p->name.length) == 0)
@@ -238,7 +238,7 @@ sp_pcontext::find_variable(uint offset)
{ // This frame
sp_variable_t *p;
- get_dynamic(&m_vars, (gptr)&p, offset - m_var_offset);
+ get_dynamic(&m_vars, (uchar*)&p, offset - m_var_offset);
return p;
}
if (m_parent)
@@ -263,7 +263,7 @@ sp_pcontext::push_variable(LEX_STRING *name, enum enum_field_types type,
p->mode= mode;
p->offset= current_var_count();
p->dflt= NULL;
- insert_dynamic(&m_vars, (gptr)&p);
+ insert_dynamic(&m_vars, (uchar*)&p);
return p;
}
@@ -318,7 +318,7 @@ sp_pcontext::push_cond(LEX_STRING *name, sp_cond_type_t *val)
p->name.str= name->str;
p->name.length= name->length;
p->val= val;
- insert_dynamic(&m_conds, (gptr)&p);
+ insert_dynamic(&m_conds, (uchar*)&p);
}
}
@@ -334,7 +334,7 @@ sp_pcontext::find_cond(LEX_STRING *name, my_bool scoped)
{
sp_cond_t *p;
- get_dynamic(&m_conds, (gptr)&p, i);
+ get_dynamic(&m_conds, (uchar*)&p, i);
if (my_strnncoll(system_charset_info,
(const uchar *)name->str, name->length,
(const uchar *)p->name.str, p->name.length) == 0)
@@ -361,7 +361,7 @@ sp_pcontext::find_handler(sp_cond_type_t *cond)
{
sp_cond_type_t *p;
- get_dynamic(&m_handlers, (gptr)&p, i);
+ get_dynamic(&m_handlers, (uchar*)&p, i);
if (cond->type == p->type)
{
switch (p->type)
@@ -391,7 +391,7 @@ sp_pcontext::push_cursor(LEX_STRING *name)
m_max_cursor_index+= 1;
n.str= name->str;
n.length= name->length;
- insert_dynamic(&m_cursors, (gptr)&n);
+ insert_dynamic(&m_cursors, (uchar*)&n);
}
/*
@@ -406,7 +406,7 @@ sp_pcontext::find_cursor(LEX_STRING *name, uint *poff, my_bool scoped)
{
LEX_STRING n;
- get_dynamic(&m_cursors, (gptr)&n, i);
+ get_dynamic(&m_cursors, (uchar*)&n, i);
if (my_strnncoll(system_charset_info,
(const uchar *)name->str, name->length,
(const uchar *)n.str, n.length) == 0)
@@ -422,14 +422,14 @@ sp_pcontext::find_cursor(LEX_STRING *name, uint *poff, my_bool scoped)
void
-sp_pcontext::retrieve_field_definitions(List<create_field> *field_def_lst)
+sp_pcontext::retrieve_field_definitions(List<Create_field> *field_def_lst)
{
/* Put local/context fields in the result list. */
for (uint i = 0; i < m_vars.elements; ++i)
{
sp_variable_t *var_def;
- get_dynamic(&m_vars, (gptr) &var_def, i);
+ get_dynamic(&m_vars, (uchar*) &var_def, i);
field_def_lst->push_back(&var_def->field_def);
}
@@ -453,7 +453,7 @@ sp_pcontext::find_cursor(uint offset, LEX_STRING *n)
if (m_cursor_offset <= offset &&
offset < m_cursor_offset + m_cursors.elements)
{ // This frame
- get_dynamic(&m_cursors, (gptr)n, offset - m_cursor_offset);
+ get_dynamic(&m_cursors, (uchar*)n, offset - m_cursor_offset);
return TRUE;
}
if (m_parent)
diff --git a/sql/sp_pcontext.h b/sql/sp_pcontext.h
index 5bffda79f98..aefc501b3b0 100644
--- a/sql/sp_pcontext.h
+++ b/sql/sp_pcontext.h
@@ -43,7 +43,7 @@ typedef struct sp_variable
uint offset;
Item *dflt;
- create_field field_def;
+ Create_field field_def;
} sp_variable_t;
@@ -234,7 +234,7 @@ public:
children.
*/
void
- retrieve_field_definitions(List<create_field> *field_def_lst);
+ retrieve_field_definitions(List<Create_field> *field_def_lst);
// Find by name
sp_variable_t *
@@ -273,7 +273,7 @@ public:
inline bool
push_case_expr_id(int case_expr_id)
{
- return insert_dynamic(&m_case_expr_id_lst, (gptr) &case_expr_id);
+ return insert_dynamic(&m_case_expr_id_lst, (uchar*) &case_expr_id);
}
inline void
@@ -287,7 +287,7 @@ public:
{
int case_expr_id;
- get_dynamic((DYNAMIC_ARRAY*)&m_case_expr_id_lst, (gptr) &case_expr_id,
+ get_dynamic((DYNAMIC_ARRAY*)&m_case_expr_id_lst, (uchar*) &case_expr_id,
m_case_expr_id_lst.elements - 1);
return case_expr_id;
@@ -343,7 +343,7 @@ public:
inline void
push_handler(sp_cond_type_t *cond)
{
- insert_dynamic(&m_handlers, (gptr)&cond);
+ insert_dynamic(&m_handlers, (uchar*)&cond);
}
bool
diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc
index e49c4eb1240..60a0c962c28 100644
--- a/sql/sp_rcontext.cc
+++ b/sql/sp_rcontext.cc
@@ -37,6 +37,7 @@ sp_rcontext::sp_rcontext(sp_pcontext *root_parsing_ctx,
m_var_items(0),
m_return_value_fld(return_value_fld),
m_return_value_set(FALSE),
+ in_sub_stmt(FALSE),
m_hcount(0),
m_hsp(0),
m_ihsp(0),
@@ -67,6 +68,8 @@ sp_rcontext::~sp_rcontext()
bool sp_rcontext::init(THD *thd)
{
+ in_sub_stmt= thd->in_sub_stmt;
+
if (init_var_table(thd) || init_var_items())
return TRUE;
@@ -102,7 +105,7 @@ bool sp_rcontext::init(THD *thd)
bool
sp_rcontext::init_var_table(THD *thd)
{
- List<create_field> field_def_lst;
+ List<Create_field> field_def_lst;
if (!m_root_parsing_ctx->max_var_index())
return FALSE;
@@ -191,7 +194,7 @@ sp_rcontext::set_return_value(THD *thd, Item **return_value_item)
*/
bool
-sp_rcontext::find_handler(uint sql_errno,
+sp_rcontext::find_handler(THD *thd, uint sql_errno,
MYSQL_ERROR::enum_warning_level level)
{
if (m_hfound >= 0)
@@ -200,6 +203,15 @@ sp_rcontext::find_handler(uint sql_errno,
const char *sqlstate= mysql_errno_to_sqlstate(sql_errno);
int i= m_hcount, found= -1;
+ /*
+ If this is a fatal sub-statement error, and this runtime
+ context corresponds to a sub-statement, no CONTINUE/EXIT
+ handlers from this context are applicable: try to locate one
+ in the outer scope.
+ */
+ if (thd->is_fatal_sub_stmt_error && in_sub_stmt)
+ i= 0;
+
/* Search handlers from the latest (innermost) to the oldest (outermost) */
while (i--)
{
@@ -252,7 +264,7 @@ sp_rcontext::find_handler(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(sql_errno, level);
+ return m_prev_runtime_ctx->find_handler(thd, sql_errno, level);
return FALSE;
}
m_hfound= found;
@@ -298,7 +310,7 @@ sp_rcontext::handle_error(uint sql_errno,
elevated_level= MYSQL_ERROR::WARN_LEVEL_ERROR;
}
- if (find_handler(sql_errno, elevated_level))
+ if (find_handler(thd, sql_errno, elevated_level))
{
if (elevated_level == MYSQL_ERROR::WARN_LEVEL_ERROR)
{
diff --git a/sql/sp_rcontext.h b/sql/sp_rcontext.h
index fbf479f52aa..0104b71a648 100644
--- a/sql/sp_rcontext.h
+++ b/sql/sp_rcontext.h
@@ -125,7 +125,7 @@ class sp_rcontext : public Sql_alloc
// Returns 1 if a handler was found, 0 otherwise.
bool
- find_handler(uint sql_errno,MYSQL_ERROR::enum_warning_level level);
+ find_handler(THD *thd, uint sql_errno,MYSQL_ERROR::enum_warning_level level);
// If there is an error handler for this error, handle it and return TRUE.
bool
@@ -236,6 +236,10 @@ private:
during execution.
*/
bool m_return_value_set;
+ /**
+ TRUE if the context is created for a sub-statement.
+ */
+ bool in_sub_stmt;
sp_handler_t *m_handler; // Visible handlers
uint m_hcount; // Stack pointer for m_handler
diff --git a/sql/spatial.cc b/sql/spatial.cc
index e0680ed182c..97e5fcfa27a 100644
--- a/sql/spatial.cc
+++ b/sql/spatial.cc
@@ -17,7 +17,28 @@
#ifdef HAVE_SPATIAL
-#define MAX_DIGITS_IN_DOUBLE 16
+/*
+ exponential notation :
+ 1 sign
+ 1 number before the decimal point
+ 1 decimal point
+ 14 number of significant digits (see String::qs_append(double))
+ 1 'e' sign
+ 1 exponent sign
+ 3 exponent digits
+ ==
+ 22
+
+ "f" notation :
+ 1 optional 0
+ 1 sign
+ 14 number significant digits (see String::qs_append(double) )
+ 1 decimal point
+ ==
+ 17
+*/
+
+#define MAX_DIGITS_IN_DOUBLE 22
/***************************** Gis_class_info *******************************/
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index ba1ec66fb02..7e017d7d028 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -160,11 +160,11 @@ public:
};
-static byte* acl_entry_get_key(acl_entry *entry,uint *length,
- my_bool not_used __attribute__((unused)))
+static uchar* acl_entry_get_key(acl_entry *entry, size_t *length,
+ my_bool not_used __attribute__((unused)))
{
*length=(uint) entry->length;
- return (byte*) entry->key;
+ return (uchar*) entry->key;
}
#define IP_ADDR_STRLEN (3+1+3+1+3+1+3)
@@ -362,9 +362,9 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
host.access|=REFERENCES_ACL | INDEX_ACL | ALTER_ACL | CREATE_TMP_ACL;
}
#endif
- VOID(push_dynamic(&acl_hosts,(gptr) &host));
+ VOID(push_dynamic(&acl_hosts,(uchar*) &host));
}
- qsort((gptr) dynamic_element(&acl_hosts,0,ACL_HOST*),acl_hosts.elements,
+ qsort((uchar*) dynamic_element(&acl_hosts,0,ACL_HOST*),acl_hosts.elements,
sizeof(ACL_HOST),(qsort_cmp) acl_compare);
end_read_record(&read_record_info);
freeze_size(&acl_hosts);
@@ -546,13 +546,13 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
user.access|= SUPER_ACL | EXECUTE_ACL;
#endif
}
- VOID(push_dynamic(&acl_users,(gptr) &user));
+ VOID(push_dynamic(&acl_users,(uchar*) &user));
if (!user.host.hostname ||
(user.host.hostname[0] == wild_many && !user.host.hostname[1]))
allow_all_hosts=1; // Anyone can connect
}
}
- qsort((gptr) dynamic_element(&acl_users,0,ACL_USER*),acl_users.elements,
+ qsort((uchar*) dynamic_element(&acl_users,0,ACL_USER*),acl_users.elements,
sizeof(ACL_USER),(qsort_cmp) acl_compare);
end_read_record(&read_record_info);
freeze_size(&acl_users);
@@ -609,9 +609,9 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
db.access|=REFERENCES_ACL | INDEX_ACL | ALTER_ACL;
}
#endif
- VOID(push_dynamic(&acl_dbs,(gptr) &db));
+ VOID(push_dynamic(&acl_dbs,(uchar*) &db));
}
- qsort((gptr) dynamic_element(&acl_dbs,0,ACL_DB*),acl_dbs.elements,
+ qsort((uchar*) dynamic_element(&acl_dbs,0,ACL_DB*),acl_dbs.elements,
sizeof(ACL_DB),(qsort_cmp) acl_compare);
end_read_record(&read_record_info);
freeze_size(&acl_dbs);
@@ -1110,14 +1110,15 @@ bool acl_getroot_no_password(Security_context *sctx, char *user, char *host,
*/
for (i=0 ; i < acl_users.elements ; i++)
{
- acl_user= dynamic_element(&acl_users,i,ACL_USER*);
- if ((!acl_user->user && !user[0]) ||
- (acl_user->user && strcmp(user, acl_user->user) == 0))
+ ACL_USER *acl_user_tmp= dynamic_element(&acl_users,i,ACL_USER*);
+ if ((!acl_user_tmp->user && !user[0]) ||
+ (acl_user_tmp->user && strcmp(user, acl_user_tmp->user) == 0))
{
- if (compare_hostname(&acl_user->host, host, ip))
+ if (compare_hostname(&acl_user_tmp->host, host, ip))
{
- res= 0;
- break;
+ acl_user= acl_user_tmp;
+ res= 0;
+ break;
}
}
}
@@ -1152,11 +1153,11 @@ bool acl_getroot_no_password(Security_context *sctx, char *user, char *host,
DBUG_RETURN(res);
}
-static byte* check_get_key(ACL_USER *buff,uint *length,
- my_bool not_used __attribute__((unused)))
+static uchar* check_get_key(ACL_USER *buff, size_t *length,
+ my_bool not_used __attribute__((unused)))
{
*length=buff->hostname_length;
- return (byte*) buff->host.hostname;
+ return (uchar*) buff->host.hostname;
}
@@ -1237,11 +1238,11 @@ static void acl_insert_user(const char *user, const char *host,
set_user_salt(&acl_user, password, password_len);
- VOID(push_dynamic(&acl_users,(gptr) &acl_user));
+ VOID(push_dynamic(&acl_users,(uchar*) &acl_user));
if (!acl_user.host.hostname ||
(acl_user.host.hostname[0] == wild_many && !acl_user.host.hostname[1]))
allow_all_hosts=1; // Anyone can connect /* purecov: tested */
- qsort((gptr) dynamic_element(&acl_users,0,ACL_USER*),acl_users.elements,
+ qsort((uchar*) dynamic_element(&acl_users,0,ACL_USER*),acl_users.elements,
sizeof(ACL_USER),(qsort_cmp) acl_compare);
/* Rebuild 'acl_check_hosts' since 'acl_users' has been modified */
@@ -1303,8 +1304,8 @@ static void acl_insert_db(const char *user, const char *host, const char *db,
acl_db.db=strdup_root(&mem,db);
acl_db.access=privileges;
acl_db.sort=get_sort(3,acl_db.host.hostname,acl_db.db,acl_db.user);
- VOID(push_dynamic(&acl_dbs,(gptr) &acl_db));
- qsort((gptr) dynamic_element(&acl_dbs,0,ACL_DB*),acl_dbs.elements,
+ VOID(push_dynamic(&acl_dbs,(uchar*) &acl_db));
+ qsort((uchar*) dynamic_element(&acl_dbs,0,ACL_DB*),acl_dbs.elements,
sizeof(ACL_DB),(qsort_cmp) acl_compare);
}
@@ -1321,7 +1322,8 @@ ulong acl_get(const char *host, const char *ip,
const char *user, const char *db, my_bool db_is_pattern)
{
ulong host_access= ~(ulong)0, db_access= 0;
- uint i,key_length;
+ uint i;
+ size_t key_length;
char key[ACL_KEY_LENGTH],*tmp_db,*end;
acl_entry *entry;
DBUG_ENTER("acl_get");
@@ -1333,8 +1335,9 @@ ulong acl_get(const char *host, const char *ip,
my_casedn_str(files_charset_info, tmp_db);
db=tmp_db;
}
- key_length=(uint) (end-key);
- if (!db_is_pattern && (entry=(acl_entry*) acl_cache->search(key,key_length)))
+ key_length= (size_t) (end-key);
+ if (!db_is_pattern && (entry=(acl_entry*) acl_cache->search((uchar*) key,
+ key_length)))
{
db_access=entry->access;
VOID(pthread_mutex_unlock(&acl_cache->lock));
@@ -1388,7 +1391,7 @@ exit:
{
entry->access=(db_access & host_access);
entry->length=key_length;
- memcpy((gptr) entry->key,key,key_length);
+ memcpy((uchar*) entry->key,key,key_length);
acl_cache->add(entry);
}
VOID(pthread_mutex_unlock(&acl_cache->lock));
@@ -1430,12 +1433,12 @@ static void init_check_host(void)
break; // already stored
}
if (j == acl_wild_hosts.elements) // If new
- (void) push_dynamic(&acl_wild_hosts,(char*) &acl_user->host);
+ (void) push_dynamic(&acl_wild_hosts,(uchar*) &acl_user->host);
}
- else if (!hash_search(&acl_check_hosts,(byte*) acl_user->host.hostname,
- (uint) strlen(acl_user->host.hostname)))
+ else if (!hash_search(&acl_check_hosts,(uchar*) acl_user->host.hostname,
+ strlen(acl_user->host.hostname)))
{
- if (my_hash_insert(&acl_check_hosts,(byte*) acl_user))
+ if (my_hash_insert(&acl_check_hosts,(uchar*) acl_user))
{ // End of memory
allow_all_hosts=1; // Should never happen
DBUG_VOID_RETURN;
@@ -1473,8 +1476,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,(byte*) host,(uint) strlen(host)) ||
- ip && hash_search(&acl_check_hosts,(byte*) ip,(uint) strlen(ip)))
+ if (host && hash_search(&acl_check_hosts,(uchar*) host,strlen(host)) ||
+ ip && hash_search(&acl_check_hosts,(uchar*) ip, strlen(ip)))
{
VOID(pthread_mutex_unlock(&acl_cache->lock));
return 0; // Found host
@@ -1533,7 +1536,7 @@ bool check_change_password(THD *thd, const char *host, const char *user,
MYF(0));
return(1);
}
- uint len=strlen(new_password);
+ size_t len= strlen(new_password);
if (len && len != SCRAMBLED_PASSWORD_CHAR_LENGTH &&
len != SCRAMBLED_PASSWORD_CHAR_LENGTH_323)
{
@@ -1567,7 +1570,7 @@ bool change_password(THD *thd, const char *host, const char *user,
/* Buffer should be extended when password length is extended. */
char buff[512];
ulong query_length;
- uint new_password_len= strlen(new_password);
+ uint new_password_len= (uint) strlen(new_password);
bool result= 1;
DBUG_ENTER("change_password");
DBUG_PRINT("enter",("host: '%s' user: '%s' new_password: '%s'",
@@ -1599,7 +1602,7 @@ bool change_password(THD *thd, const char *host, const char *user,
}
#endif
- if (!(table= open_ltable(thd, &tables, TL_WRITE)))
+ if (!(table= open_ltable(thd, &tables, TL_WRITE, 0)))
DBUG_RETURN(1);
VOID(pthread_mutex_lock(&acl_cache->lock));
@@ -1768,8 +1771,8 @@ bool hostname_requires_resolving(const char *hostname)
char cur;
if (!hostname)
return FALSE;
- int namelen= strlen(hostname);
- int lhlen= strlen(my_localhost);
+ size_t namelen= strlen(hostname);
+ size_t lhlen= strlen(my_localhost);
if ((namelen == lhlen) &&
!my_strnncoll(system_charset_info, (const uchar *)hostname, namelen,
(const uchar *)my_localhost, strlen(my_localhost)))
@@ -1809,12 +1812,12 @@ static bool update_user_table(THD *thd, TABLE *table,
table->use_all_columns();
table->field[0]->store(host,(uint) strlen(host), system_charset_info);
table->field[1]->store(user,(uint) strlen(user), system_charset_info);
- key_copy((byte *) user_key, table->record[0], table->key_info,
+ key_copy((uchar *) user_key, table->record[0], table->key_info,
table->key_info->key_length);
- if (table->file->index_read_idx(table->record[0], 0,
- (byte *) user_key, HA_WHOLE_KEY,
- HA_READ_KEY_EXACT))
+ if (table->file->index_read_idx_map(table->record[0], 0,
+ (uchar *) user_key, HA_WHOLE_KEY,
+ HA_READ_KEY_EXACT))
{
my_message(ER_PASSWORD_NO_MATCH, ER(ER_PASSWORD_NO_MATCH),
MYF(0)); /* purecov: deadcode */
@@ -1822,7 +1825,8 @@ static bool update_user_table(THD *thd, TABLE *table,
}
store_record(table,record[1]);
table->field[2]->store(new_password, new_password_len, system_charset_info);
- if ((error=table->file->ha_update_row(table->record[1],table->record[0])))
+ if ((error=table->file->ha_update_row(table->record[1],table->record[0])) &&
+ error != HA_ERR_RECORD_IS_THE_SAME)
{
table->file->print_error(error,MYF(0)); /* purecov: deadcode */
DBUG_RETURN(1);
@@ -1878,7 +1882,7 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo,
const char *password= "";
uint password_len= 0;
char what= (revoke_grant) ? 'N' : 'Y';
- byte user_key[MAX_KEY_LENGTH];
+ uchar user_key[MAX_KEY_LENGTH];
LEX *lex= thd->lex;
DBUG_ENTER("replace_user_table");
@@ -1904,8 +1908,9 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo,
key_copy(user_key, table->record[0], table->key_info,
table->key_info->key_length);
- if (table->file->index_read_idx(table->record[0], 0, user_key, HA_WHOLE_KEY,
- HA_READ_KEY_EXACT))
+ if (table->file->index_read_idx_map(table->record[0], 0, user_key,
+ HA_WHOLE_KEY,
+ HA_READ_KEY_EXACT))
{
/* what == 'N' means revoke */
if (what == 'N')
@@ -2038,12 +2043,18 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo,
We should NEVER delete from the user table, as a uses can still
use mysqld even if he doesn't have any privileges in the user table!
*/
- if (cmp_record(table,record[1]) &&
- (error=table->file->ha_update_row(table->record[1],table->record[0])))
- { // This should never happen
- table->file->print_error(error,MYF(0)); /* purecov: deadcode */
- error= -1; /* purecov: deadcode */
- goto end; /* purecov: deadcode */
+ if (cmp_record(table,record[1]))
+ {
+ if ((error=
+ table->file->ha_update_row(table->record[1],table->record[0])) &&
+ error != HA_ERR_RECORD_IS_THE_SAME)
+ { // This should never happen
+ table->file->print_error(error,MYF(0)); /* purecov: deadcode */
+ error= -1; /* purecov: deadcode */
+ goto end; /* purecov: deadcode */
+ }
+ else
+ error= 0;
}
}
else if ((error=table->file->ha_write_row(table->record[0]))) // insert
@@ -2096,7 +2107,7 @@ static int replace_db_table(TABLE *table, const char *db,
bool old_row_exists=0;
int error;
char what= (revoke_grant) ? 'N' : 'Y';
- byte user_key[MAX_KEY_LENGTH];
+ uchar user_key[MAX_KEY_LENGTH];
DBUG_ENTER("replace_db_table");
if (!initialized)
@@ -2121,8 +2132,9 @@ static int replace_db_table(TABLE *table, const char *db,
key_copy(user_key, table->record[0], table->key_info,
table->key_info->key_length);
- if (table->file->index_read_idx(table->record[0],0, user_key, HA_WHOLE_KEY,
- HA_READ_KEY_EXACT))
+ if (table->file->index_read_idx_map(table->record[0],0, user_key,
+ HA_WHOLE_KEY,
+ HA_READ_KEY_EXACT))
{
if (what == 'N')
{ // no row, no revoke
@@ -2158,7 +2170,8 @@ static int replace_db_table(TABLE *table, const char *db,
if (rights)
{
if ((error= table->file->ha_update_row(table->record[1],
- table->record[0])))
+ table->record[0])) &&
+ error != HA_ERR_RECORD_IS_THE_SAME)
goto table_error; /* purecov: deadcode */
}
else /* must have been a revoke of all privileges */
@@ -2198,16 +2211,16 @@ public:
uint key_length;
GRANT_COLUMN(String &c, ulong y) :rights (y)
{
- column= memdup_root(&memex,c.ptr(), key_length=c.length());
+ column= (char*) memdup_root(&memex,c.ptr(), key_length=c.length());
}
};
-static byte* get_key_column(GRANT_COLUMN *buff,uint *length,
+static uchar* get_key_column(GRANT_COLUMN *buff, size_t *length,
my_bool not_used __attribute__((unused)))
{
*length=buff->key_length;
- return (byte*) buff->column;
+ return (uchar*) buff->column;
}
@@ -2218,7 +2231,7 @@ public:
char *db, *user, *tname, *hash_key;
ulong privs;
ulong sort;
- uint key_length;
+ size_t key_length;
GRANT_NAME(const char *h, const char *d,const char *u,
const char *t, ulong p);
GRANT_NAME (TABLE *form);
@@ -2257,8 +2270,8 @@ GRANT_NAME::GRANT_NAME(const char *h, const char *d,const char *u,
my_casedn_str(files_charset_info, db);
my_casedn_str(files_charset_info, tname);
}
- key_length =(uint) strlen(d)+(uint) strlen(u)+(uint) strlen(t)+3;
- hash_key = (char*) alloc_root(&memex,key_length);
+ key_length= strlen(d) + strlen(u)+ strlen(t)+3;
+ hash_key= (char*) alloc_root(&memex,key_length);
strmov(strmov(strmov(hash_key,user)+1,db)+1,tname);
}
@@ -2292,9 +2305,8 @@ GRANT_NAME::GRANT_NAME(TABLE *form)
my_casedn_str(files_charset_info, db);
my_casedn_str(files_charset_info, tname);
}
- key_length = ((uint) strlen(db) + (uint) strlen(user) +
- (uint) strlen(tname) + 3);
- hash_key = (char*) alloc_root(&memex,key_length);
+ key_length= (strlen(db) + strlen(user) + strlen(tname) + 3);
+ hash_key= (char*) alloc_root(&memex, key_length);
strmov(strmov(strmov(hash_key,user)+1,db)+1,tname);
privs = (ulong) form->field[6]->val_int();
privs = fix_rights_for_table(privs);
@@ -2304,7 +2316,7 @@ GRANT_NAME::GRANT_NAME(TABLE *form)
GRANT_TABLE::GRANT_TABLE(TABLE *form, TABLE *col_privs)
:GRANT_NAME(form)
{
- byte key[MAX_KEY_LENGTH];
+ uchar key[MAX_KEY_LENGTH];
if (!db || !tname)
{
@@ -2338,8 +2350,8 @@ GRANT_TABLE::GRANT_TABLE(TABLE *form, TABLE *col_privs)
col_privs->field[4]->store("",0, &my_charset_latin1);
col_privs->file->ha_index_init(0, 1);
- if (col_privs->file->index_read(col_privs->record[0], (byte*) key,
- (key_part_map)15, HA_READ_KEY_EXACT))
+ if (col_privs->file->index_read_map(col_privs->record[0], (uchar*) key,
+ (key_part_map)15, HA_READ_KEY_EXACT))
{
cols = 0; /* purecov: deadcode */
col_privs->file->ha_index_end();
@@ -2359,7 +2371,7 @@ GRANT_TABLE::GRANT_TABLE(TABLE *form, TABLE *col_privs)
privs = cols = 0; /* purecov: deadcode */
return; /* purecov: deadcode */
}
- my_hash_insert(&hash_columns, (byte *) mem_check);
+ my_hash_insert(&hash_columns, (uchar *) mem_check);
} while (!col_privs->file->index_next(col_privs->record[0]) &&
!key_cmp_if_same(col_privs,key,0,key_prefix_len));
col_privs->file->ha_index_end();
@@ -2373,11 +2385,11 @@ GRANT_TABLE::~GRANT_TABLE()
}
-static byte* get_grant_table(GRANT_NAME *buff,uint *length,
+static uchar* get_grant_table(GRANT_NAME *buff, size_t *length,
my_bool not_used __attribute__((unused)))
{
*length=buff->key_length;
- return (byte*) buff->hash_key;
+ return (uchar*) buff->hash_key;
}
@@ -2401,10 +2413,10 @@ static GRANT_NAME *name_hash_search(HASH *name_hash,
HASH_SEARCH_STATE state;
len = (uint) (strmov(strmov(strmov(helping,user)+1,db)+1,tname)-helping)+ 1;
- for (grant_name= (GRANT_NAME*) hash_first(name_hash, (byte*) helping,
+ for (grant_name= (GRANT_NAME*) hash_first(name_hash, (uchar*) helping,
len, &state);
grant_name ;
- grant_name= (GRANT_NAME*) hash_next(name_hash,(byte*) helping,
+ grant_name= (GRANT_NAME*) hash_next(name_hash,(uchar*) helping,
len, &state))
{
if (exact)
@@ -2449,7 +2461,7 @@ 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, (byte*) cname,length);
+ return (GRANT_COLUMN*) hash_search(&t->hash_columns, (uchar*) cname,length);
}
@@ -2460,7 +2472,7 @@ static int replace_column_table(GRANT_TABLE *g_t,
ulong rights, bool revoke_grant)
{
int error=0,result=0;
- byte key[MAX_KEY_LENGTH];
+ uchar key[MAX_KEY_LENGTH];
uint key_prefix_length;
KEY_PART_INFO *key_part= table->key_info->key_part;
DBUG_ENTER("replace_column_table");
@@ -2491,7 +2503,7 @@ static int replace_column_table(GRANT_TABLE *g_t,
{
ulong privileges= column->rights;
bool old_row_exists=0;
- byte user_key[MAX_KEY_LENGTH];
+ uchar user_key[MAX_KEY_LENGTH];
key_restore(table->record[0],key,table->key_info,
key_prefix_length);
@@ -2501,8 +2513,8 @@ static int replace_column_table(GRANT_TABLE *g_t,
key_copy(user_key, table->record[0], table->key_info,
table->key_info->key_length);
- if (table->file->index_read(table->record[0], user_key, HA_WHOLE_KEY,
- HA_READ_KEY_EXACT))
+ if (table->file->index_read_map(table->record[0], user_key, HA_WHOLE_KEY,
+ HA_READ_KEY_EXACT))
{
if (revoke_grant)
{
@@ -2541,12 +2553,14 @@ static int replace_column_table(GRANT_TABLE *g_t,
error=table->file->ha_update_row(table->record[1],table->record[0]);
else
error=table->file->ha_delete_row(table->record[1]);
- if (error)
+ if (error && error != HA_ERR_RECORD_IS_THE_SAME)
{
table->file->print_error(error,MYF(0)); /* purecov: inspected */
result= -1; /* purecov: inspected */
goto end; /* purecov: inspected */
}
+ else
+ error= 0;
grant_column= column_hash_search(g_t, column->column.ptr(),
column->column.length());
if (grant_column) // Should always be true
@@ -2562,7 +2576,7 @@ static int replace_column_table(GRANT_TABLE *g_t,
goto end; /* purecov: inspected */
}
grant_column= new GRANT_COLUMN(column->column,privileges);
- my_hash_insert(&g_t->hash_columns,(byte*) grant_column);
+ my_hash_insert(&g_t->hash_columns,(uchar*) grant_column);
}
}
@@ -2573,12 +2587,13 @@ static int replace_column_table(GRANT_TABLE *g_t,
if (revoke_grant)
{
- byte user_key[MAX_KEY_LENGTH];
+ uchar user_key[MAX_KEY_LENGTH];
key_copy(user_key, table->record[0], table->key_info,
key_prefix_length);
- if (table->file->index_read(table->record[0], user_key, (key_part_map)15,
- HA_READ_KEY_EXACT))
+ if (table->file->index_read_map(table->record[0], user_key,
+ (key_part_map)15,
+ HA_READ_KEY_EXACT))
goto end;
/* Scan through all rows with the same host,db,user and table */
@@ -2606,7 +2621,8 @@ static int replace_column_table(GRANT_TABLE *g_t,
{
int tmp_error;
if ((tmp_error=table->file->ha_update_row(table->record[1],
- table->record[0])))
+ table->record[0])) &&
+ tmp_error != HA_ERR_RECORD_IS_THE_SAME)
{ /* purecov: deadcode */
table->file->print_error(tmp_error,MYF(0)); /* purecov: deadcode */
result= -1; /* purecov: deadcode */
@@ -2625,7 +2641,7 @@ static int replace_column_table(GRANT_TABLE *g_t,
goto end; /* purecov: deadcode */
}
if (grant_column)
- hash_delete(&g_t->hash_columns,(byte*) grant_column);
+ hash_delete(&g_t->hash_columns,(uchar*) grant_column);
}
}
} while (!table->file->index_next(table->record[0]) &&
@@ -2648,7 +2664,7 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table,
int old_row_exists = 1;
int error=0;
ulong store_table_rights, store_col_rights;
- byte user_key[MAX_KEY_LENGTH];
+ uchar user_key[MAX_KEY_LENGTH];
DBUG_ENTER("replace_table_table");
strxmov(grantor, thd->security_ctx->user, "@",
@@ -2678,8 +2694,9 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table,
key_copy(user_key, table->record[0], table->key_info,
table->key_info->key_length);
- if (table->file->index_read_idx(table->record[0], 0, user_key, HA_WHOLE_KEY,
- HA_READ_KEY_EXACT))
+ if (table->file->index_read_idx_map(table->record[0], 0, user_key,
+ HA_WHOLE_KEY,
+ HA_READ_KEY_EXACT))
{
/*
The following should never happen as we first check the in memory
@@ -2728,7 +2745,9 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table,
{
if (store_table_rights || store_col_rights)
{
- if ((error=table->file->ha_update_row(table->record[1],table->record[0])))
+ if ((error=table->file->ha_update_row(table->record[1],
+ table->record[0])) &&
+ error != HA_ERR_RECORD_IS_THE_SAME)
goto table_error; /* purecov: deadcode */
}
else if ((error = table->file->ha_delete_row(table->record[1])))
@@ -2748,7 +2767,7 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table,
}
else
{
- hash_delete(&column_priv_hash,(byte*) grant_table);
+ hash_delete(&column_priv_hash,(uchar*) grant_table);
}
DBUG_RETURN(0);
@@ -2801,9 +2820,10 @@ static int replace_routine_table(THD *thd, GRANT_NAME *grant_name,
TRUE);
store_record(table,record[1]); // store at pos 1
- if (table->file->index_read_idx(table->record[0], 0,
- (byte*) table->field[0]->ptr, HA_WHOLE_KEY,
- HA_READ_KEY_EXACT))
+ if (table->file->index_read_idx_map(table->record[0], 0,
+ (uchar*) table->field[0]->ptr,
+ HA_WHOLE_KEY,
+ HA_READ_KEY_EXACT))
{
/*
The following should never happen as we first check the in memory
@@ -2846,7 +2866,9 @@ static int replace_routine_table(THD *thd, GRANT_NAME *grant_name,
{
if (store_proc_rights)
{
- if ((error=table->file->ha_update_row(table->record[1],table->record[0])))
+ if ((error=table->file->ha_update_row(table->record[1],
+ table->record[0])) &&
+ error != HA_ERR_RECORD_IS_THE_SAME)
goto table_error;
}
else if ((error= table->file->ha_delete_row(table->record[1])))
@@ -2865,7 +2887,7 @@ static int replace_routine_table(THD *thd, GRANT_NAME *grant_name,
}
else
{
- hash_delete(is_proc ? &proc_priv_hash : &func_priv_hash,(byte*) grant_name);
+ hash_delete(is_proc ? &proc_priv_hash : &func_priv_hash,(uchar*) grant_name);
}
DBUG_RETURN(0);
@@ -3081,7 +3103,7 @@ bool mysql_table_grant(THD *thd, TABLE_LIST *table_list,
result= TRUE; /* purecov: deadcode */
continue; /* purecov: deadcode */
}
- my_hash_insert(&column_priv_hash,(byte*) grant_table);
+ my_hash_insert(&column_priv_hash,(uchar*) grant_table);
}
/* If revoke_grant, calculate the new column privilege for tables_priv */
@@ -3136,18 +3158,12 @@ bool mysql_table_grant(THD *thd, TABLE_LIST *table_list,
}
}
}
- grant_option=TRUE;
thd->mem_root= old_root;
pthread_mutex_unlock(&acl_cache->lock);
if (!result) /* success */
{
- if (mysql_bin_log.is_open())
- {
- thd->clear_error();
- thd->binlog_query(THD::MYSQL_QUERY_TYPE,
- thd->query, thd->query_length, FALSE, FALSE);
- }
+ write_bin_log(thd, TRUE, thd->query, thd->query_length);
}
rw_unlock(&LOCK_grant);
@@ -3300,7 +3316,7 @@ bool mysql_routine_grant(THD *thd, TABLE_LIST *table_list, bool is_proc,
result= TRUE;
continue;
}
- my_hash_insert(is_proc ? &proc_priv_hash : &func_priv_hash,(byte*) grant_name);
+ my_hash_insert(is_proc ? &proc_priv_hash : &func_priv_hash,(uchar*) grant_name);
}
if (replace_routine_table(thd, grant_name, tables[1].table, *Str,
@@ -3310,17 +3326,11 @@ bool mysql_routine_grant(THD *thd, TABLE_LIST *table_list, bool is_proc,
continue;
}
}
- grant_option=TRUE;
thd->mem_root= old_root;
pthread_mutex_unlock(&acl_cache->lock);
if (!result && !no_error)
{
- if (mysql_bin_log.is_open())
- {
- thd->clear_error();
- thd->binlog_query(THD::MYSQL_QUERY_TYPE,
- thd->query, thd->query_length, FALSE, FALSE);
- }
+ write_bin_log(thd, TRUE, thd->query, thd->query_length);
}
rw_unlock(&LOCK_grant);
@@ -3435,12 +3445,7 @@ bool mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
if (!result)
{
- if (mysql_bin_log.is_open())
- {
- thd->clear_error();
- thd->binlog_query(THD::MYSQL_QUERY_TYPE,
- thd->query, thd->query_length, FALSE, FALSE);
- }
+ write_bin_log(thd, TRUE, thd->query, thd->query_length);
}
rw_unlock(&LOCK_grant);
@@ -3458,7 +3463,6 @@ bool mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
void grant_free(void)
{
DBUG_ENTER("grant_free");
- grant_option = FALSE;
hash_free(&column_priv_hash);
hash_free(&proc_priv_hash);
hash_free(&func_priv_hash);
@@ -3522,7 +3526,6 @@ static my_bool grant_load(TABLE_LIST *tables)
THR_MALLOC);
DBUG_ENTER("grant_load");
- grant_option = FALSE;
(void) hash_init(&column_priv_hash,system_charset_info,
0,0,0, (hash_get_key) get_grant_table,
(hash_free_key) free_grant_table,0);
@@ -3552,7 +3555,6 @@ static my_bool grant_load(TABLE_LIST *tables)
if (!(mem_check=new (memex_ptr) GRANT_TABLE(t_table,c_table)))
{
/* This could only happen if we are out memory */
- grant_option= FALSE;
goto end_unlock;
}
@@ -3572,10 +3574,9 @@ static my_bool grant_load(TABLE_LIST *tables)
if (! mem_check->ok())
delete mem_check;
- else if (my_hash_insert(&column_priv_hash,(byte*) mem_check))
+ else if (my_hash_insert(&column_priv_hash,(uchar*) mem_check))
{
delete mem_check;
- grant_option= FALSE;
goto end_unlock;
}
}
@@ -3592,7 +3593,6 @@ static my_bool grant_load(TABLE_LIST *tables)
if (!(mem_check=new (&memex) GRANT_NAME(p_table)))
{
/* This could only happen if we are out memory */
- grant_option= FALSE;
goto end_unlock;
}
@@ -3628,16 +3628,14 @@ static my_bool grant_load(TABLE_LIST *tables)
mem_check->privs= fix_rights_for_procedure(mem_check->privs);
if (! mem_check->ok())
delete mem_check;
- else if (my_hash_insert(hash, (byte*) mem_check))
+ else if (my_hash_insert(hash, (uchar*) mem_check))
{
delete mem_check;
- grant_option= FALSE;
goto end_unlock;
}
}
while (!p_table->file->index_next(p_table->record[0]));
}
- grant_option= TRUE;
return_val=0; // Return ok
end_unlock:
@@ -3670,7 +3668,6 @@ my_bool grant_reload(THD *thd)
{
TABLE_LIST tables[3];
HASH old_column_priv_hash, old_proc_priv_hash, old_func_priv_hash;
- bool old_grant_option;
MEM_ROOT old_mem;
my_bool return_val= 1;
DBUG_ENTER("grant_reload");
@@ -3700,7 +3697,6 @@ my_bool grant_reload(THD *thd)
old_column_priv_hash= column_priv_hash;
old_proc_priv_hash= proc_priv_hash;
old_func_priv_hash= func_priv_hash;
- old_grant_option= grant_option;
old_mem= memex;
if ((return_val= grant_load(tables)))
@@ -3710,7 +3706,6 @@ my_bool grant_reload(THD *thd)
column_priv_hash= old_column_priv_hash; /* purecov: deadcode */
proc_priv_hash= old_proc_priv_hash;
func_priv_hash= old_func_priv_hash;
- grant_option= old_grant_option; /* purecov: deadcode */
memex= old_mem; /* purecov: deadcode */
}
else
@@ -4007,8 +4002,6 @@ bool check_grant_all_columns(THD *thd, ulong want_access, GRANT_INFO *grant,
want_access &= ~grant->privilege;
if (!want_access)
return 0; // Already checked
- if (!grant_option)
- goto err2;
rw_rdlock(&LOCK_grant);
@@ -4039,7 +4032,6 @@ bool check_grant_all_columns(THD *thd, ulong want_access, GRANT_INFO *grant,
err:
rw_unlock(&LOCK_grant);
-err2:
char command[128];
get_privilege_desc(command, sizeof(command), want_access);
my_error(ER_COLUMNACCESS_DENIED_ERROR, MYF(0),
@@ -4198,18 +4190,15 @@ bool check_routine_level_acl(THD *thd, const char *db, const char *name,
bool is_proc)
{
bool no_routine_acl= 1;
- if (grant_option)
- {
- GRANT_NAME *grant_proc;
- Security_context *sctx= thd->security_ctx;
- rw_rdlock(&LOCK_grant);
- if ((grant_proc= routine_hash_search(sctx->priv_host,
- sctx->ip, db,
- sctx->priv_user,
- name, is_proc, 0)))
- no_routine_acl= !(grant_proc->privs & SHOW_PROC_ACLS);
- rw_unlock(&LOCK_grant);
- }
+ GRANT_NAME *grant_proc;
+ Security_context *sctx= thd->security_ctx;
+ rw_rdlock(&LOCK_grant);
+ if ((grant_proc= routine_hash_search(sctx->priv_host,
+ sctx->ip, db,
+ sctx->priv_user,
+ name, is_proc, 0)))
+ no_routine_acl= !(grant_proc->privs & SHOW_PROC_ACLS);
+ rw_unlock(&LOCK_grant);
return no_routine_acl;
}
@@ -4945,8 +4934,12 @@ static int modify_grant_table(TABLE *table, Field *host_field,
system_charset_info);
user_field->store(user_to->user.str, user_to->user.length,
system_charset_info);
- if ((error= table->file->ha_update_row(table->record[1], table->record[0])))
+ if ((error= table->file->ha_update_row(table->record[1],
+ table->record[0])) &&
+ error != HA_ERR_RECORD_IS_THE_SAME)
table->file->print_error(error, MYF(0));
+ else
+ error= 0;
}
else
{
@@ -5002,7 +4995,7 @@ static int handle_grant_table(TABLE_LIST *tables, uint table_no, bool drop,
char *user_str= user_from->user.str;
const char *host;
const char *user;
- byte user_key[MAX_KEY_LENGTH];
+ uchar user_key[MAX_KEY_LENGTH];
uint key_prefix_length;
DBUG_ENTER("handle_grant_table");
@@ -5027,9 +5020,9 @@ static int handle_grant_table(TABLE_LIST *tables, uint table_no, bool drop,
table->key_info->key_part[1].store_length);
key_copy(user_key, table->record[0], table->key_info, key_prefix_length);
- if ((error= table->file->index_read_idx(table->record[0], 0,
- user_key, (key_part_map)3,
- HA_READ_KEY_EXACT)))
+ if ((error= table->file->index_read_idx_map(table->record[0], 0,
+ user_key, (key_part_map)3,
+ HA_READ_KEY_EXACT)))
{
if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE)
{
@@ -5239,11 +5232,11 @@ static int handle_grant_struct(uint struct_no, bool drop,
break;
case 2:
- hash_delete(&column_priv_hash, (byte*) grant_name);
+ hash_delete(&column_priv_hash, (uchar*) grant_name);
break;
case 3:
- hash_delete(&proc_priv_hash, (byte*) grant_name);
+ hash_delete(&proc_priv_hash, (uchar*) grant_name);
break;
}
elements--;
@@ -5485,11 +5478,7 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list)
VOID(pthread_mutex_unlock(&acl_cache->lock));
- if (mysql_bin_log.is_open())
- {
- thd->binlog_query(THD::MYSQL_QUERY_TYPE,
- thd->query, thd->query_length, FALSE, FALSE);
- }
+ write_bin_log(thd, FALSE, thd->query, thd->query_length);
rw_unlock(&LOCK_grant);
close_thread_tables(thd);
@@ -5555,16 +5544,16 @@ bool mysql_drop_user(THD *thd, List <LEX_USER> &list)
VOID(pthread_mutex_unlock(&acl_cache->lock));
- if (mysql_bin_log.is_open())
- {
- thd->binlog_query(THD::MYSQL_QUERY_TYPE,
- thd->query, thd->query_length, FALSE, FALSE);
- }
+ if (result)
+ my_error(ER_CANNOT_USER, MYF(0), "DROP USER", wrong_users.c_ptr_safe());
+
+ DBUG_PRINT("info", ("thd->net.last_errno: %d", thd->net.last_errno));
+ DBUG_PRINT("info", ("thd->net.last_error: %s", thd->net.last_error));
+
+ write_bin_log(thd, FALSE, thd->query, thd->query_length);
rw_unlock(&LOCK_grant);
close_thread_tables(thd);
- if (result)
- my_error(ER_CANNOT_USER, MYF(0), "DROP USER", wrong_users.c_ptr_safe());
DBUG_RETURN(result);
}
@@ -5638,11 +5627,7 @@ bool mysql_rename_user(THD *thd, List <LEX_USER> &list)
VOID(pthread_mutex_unlock(&acl_cache->lock));
- if (mysql_bin_log.is_open())
- {
- thd->binlog_query(THD::MYSQL_QUERY_TYPE,
- thd->query, thd->query_length, FALSE, FALSE);
- }
+ write_bin_log(thd, FALSE, thd->query, thd->query_length);
rw_unlock(&LOCK_grant);
close_thread_tables(thd);
@@ -5826,11 +5811,7 @@ bool mysql_revoke_all(THD *thd, List <LEX_USER> &list)
VOID(pthread_mutex_unlock(&acl_cache->lock));
- if (mysql_bin_log.is_open())
- {
- thd->binlog_query(THD::MYSQL_QUERY_TYPE,
- thd->query, thd->query_length, FALSE, FALSE);
- }
+ write_bin_log(thd, FALSE, thd->query, thd->query_length);
rw_unlock(&LOCK_grant);
close_thread_tables(thd);
@@ -6081,15 +6062,15 @@ void update_schema_privilege(TABLE *table, char *buff, const char* db,
int i= 2;
CHARSET_INFO *cs= system_charset_info;
restore_record(table, s->default_values);
- table->field[0]->store(buff, strlen(buff), cs);
+ table->field[0]->store(buff, (uint) strlen(buff), cs);
if (db)
- table->field[i++]->store(db, strlen(db), cs);
+ table->field[i++]->store(db, (uint) strlen(db), cs);
if (t_name)
- table->field[i++]->store(t_name, strlen(t_name), cs);
+ table->field[i++]->store(t_name, (uint) strlen(t_name), cs);
if (column)
table->field[i++]->store(column, col_length, cs);
table->field[i++]->store(priv, priv_length, cs);
- table->field[i]->store(is_grantable, strlen(is_grantable), cs);
+ table->field[i]->store(is_grantable, (uint) strlen(is_grantable), cs);
table->file->ha_write_row(table->record[0]);
}
@@ -6403,12 +6384,6 @@ void fill_effective_table_privileges(THD *thd, GRANT_INFO *grant,
/* db privileges */
grant->privilege|= acl_get(sctx->host, sctx->ip, sctx->priv_user, db, 0);
- if (!grant_option)
- {
- DBUG_PRINT("info", ("privilege 0x%lx", grant->privilege));
- DBUG_VOID_RETURN;
- }
-
/* table privileges */
rw_rdlock(&LOCK_grant);
if (grant->version != grant_version)
diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc
index e7decf4a8fc..490cc5e28c1 100644
--- a/sql/sql_analyse.cc
+++ b/sql/sql_analyse.cc
@@ -498,7 +498,7 @@ void field_decimal::add()
if (room_in_tree)
{
- char buf[DECIMAL_MAX_FIELD_SIZE];
+ uchar buf[DECIMAL_MAX_FIELD_SIZE];
my_decimal2binary(E_DEC_FATAL_ERROR, dec, buf,
item->max_length, item->decimals);
if (!(element = tree_insert(&tree, (void*)buf, 0, tree.custom_arg)))
@@ -668,7 +668,7 @@ void field_ulonglong::add()
} // field_ulonglong::add
-int analyse::send_row(List<Item> &field_list __attribute__((unused)))
+int analyse::send_row(List<Item> & /* field_list */)
{
field_info **f = f_info;
@@ -1108,7 +1108,7 @@ int collect_real(double *element, element_count count __attribute__((unused)),
} // collect_real
-int collect_decimal(char *element, element_count count,
+int collect_decimal(uchar *element, element_count count,
TREE_INFO *info)
{
char buff[DECIMAL_MAX_STR_LENGTH];
diff --git a/sql/sql_analyse.h b/sql/sql_analyse.h
index ac671b85e1e..827b6f4b217 100644
--- a/sql/sql_analyse.h
+++ b/sql/sql_analyse.h
@@ -143,7 +143,7 @@ public:
};
-int collect_decimal(char *element, element_count count,
+int collect_decimal(uchar *element, element_count count,
TREE_INFO *info);
class field_decimal :public field_info
@@ -165,7 +165,7 @@ public:
String *get_min_arg(String *);
String *get_max_arg(String *);
String *avg(String *s, ha_rows rows);
- friend int collect_decimal(char *element, element_count count,
+ friend int collect_decimal(uchar *element, element_count count,
TREE_INFO *info);
tree_walk_action collect_enum()
{ return (tree_walk_action) collect_decimal; }
@@ -348,7 +348,7 @@ public:
}
virtual void add() {}
virtual bool change_columns(List<Item> &fields);
- virtual int send_row(List<Item> &fields);
+ virtual int send_row(List<Item> &field_list);
virtual void end_group(void) {}
virtual bool end_of_records(void);
friend Procedure *proc_analyse_init(THD *thd, ORDER *param,
diff --git a/sql/sql_array.h b/sql/sql_array.h
index e2e12bee241..ab6fdd0c5c0 100644
--- a/sql/sql_array.h
+++ b/sql/sql_array.h
@@ -45,7 +45,7 @@ public:
bool append(Elem &el)
{
- return (insert_dynamic(&array, (gptr)&el));
+ return (insert_dynamic(&array, (uchar*)&el));
}
int elements()
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 97d304a6396..4f0c06c7ddd 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -28,6 +28,8 @@
#include <io.h>
#endif
+#define FLAGSTR(S,F) ((S) & (F) ? #F " " : "")
+
/**
This internal handler is used to trap internally
errors that can occur when executing open table
@@ -62,11 +64,11 @@ Prelock_error_handler::handle_error(uint sql_errno,
if (sql_errno == ER_NO_SUCH_TABLE)
{
m_handled_errors++;
- return TRUE; // 'TRUE', as per coding style
+ return TRUE;
}
m_unhandled_errors++;
- return FALSE; // 'FALSE', as per coding style
+ return FALSE;
}
@@ -80,6 +82,10 @@ bool Prelock_error_handler::safely_trapped_errors()
return ((m_handled_errors > 0) && (m_unhandled_errors == 0));
}
+/**
+ @defgroup Data_Dictionary Data Dictionary
+ @{
+*/
TABLE *unused_tables; /* Used by mysql_test */
HASH open_cache; /* Used by mysql_test */
@@ -97,26 +103,25 @@ static bool open_new_frm(THD *thd, TABLE_SHARE *share, const char *alias,
uint db_stat, uint prgflag,
uint ha_open_flags, TABLE *outparam,
TABLE_LIST *table_desc, MEM_ROOT *mem_root);
-static void close_old_data_files(THD *thd, TABLE *table, bool abort_locks,
+static void close_old_data_files(THD *thd, TABLE *table, bool morph_locks,
bool send_refresh);
-static bool reopen_table(TABLE *table);
static bool
has_two_write_locked_tables_with_auto_increment(TABLE_LIST *tables);
-extern "C" byte *table_cache_key(const byte *record,uint *length,
+extern "C" uchar *table_cache_key(const uchar *record, size_t *length,
my_bool not_used __attribute__((unused)))
{
TABLE *entry=(TABLE*) record;
*length= entry->s->table_cache_key.length;
- return (byte*) entry->s->table_cache_key.str;
+ return (uchar*) entry->s->table_cache_key.str;
}
bool table_cache_init(void)
{
return hash_init(&open_cache, &my_charset_bin, table_cache_size+16,
- 0, 0,table_cache_key,
+ 0, 0, table_cache_key,
(hash_free_key) free_cache_entry, 0) != 0;
}
@@ -243,12 +248,12 @@ uint create_table_def_key(THD *thd, char *key, TABLE_LIST *table_list,
Functions to handle table definition cach (TABLE_SHARE)
*****************************************************************************/
-extern "C" byte *table_def_key(const byte *record, uint *length,
+extern "C" uchar *table_def_key(const uchar *record, size_t *length,
my_bool not_used __attribute__((unused)))
{
TABLE_SHARE *entry=(TABLE_SHARE*) record;
*length= entry->table_cache_key.length;
- return (byte*) entry->table_cache_key.str;
+ return (uchar*) entry->table_cache_key.str;
}
@@ -334,7 +339,7 @@ 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,(byte*) key,
+ if ((share= (TABLE_SHARE*) hash_search(&table_def_cache,(uchar*) key,
key_length)))
goto found;
@@ -351,7 +356,7 @@ TABLE_SHARE *get_table_share(THD *thd, TABLE_LIST *table_list, char *key,
pthread_mutex_unlock(&LOCK_open);
pthread_mutex_lock(&LOCK_open);
/* Check that another thread didn't insert the same table in between */
- if ((old_share= hash_search(&table_def_cache, (byte*) key, key_length)))
+ if ((old_share= hash_search(&table_def_cache, (uchar*) key, key_length)))
{
(void) pthread_mutex_lock(&share->mutex);
free_table_share(share);
@@ -381,7 +386,7 @@ TABLE_SHARE *get_table_share(THD *thd, TABLE_LIST *table_list, char *key,
*/
assign_new_table_id(share);
- if (my_hash_insert(&table_def_cache, (byte*) share))
+ if (my_hash_insert(&table_def_cache, (uchar*) share))
{
#ifdef WAITING_FOR_TABLE_DEF_CACHE_STAGE_3
pthread_mutex_unlock(&LOCK_open);
@@ -407,7 +412,7 @@ TABLE_SHARE *get_table_share(THD *thd, TABLE_LIST *table_list, char *key,
(void) pthread_mutex_lock(&share->mutex);
#endif
*error= share->error;
- (void) hash_delete(&table_def_cache, (byte*) share);
+ (void) hash_delete(&table_def_cache, (uchar*) share);
DBUG_RETURN(0);
}
share->ref_count++; // Mark in use
@@ -462,7 +467,7 @@ found:
oldest_unused_share->next)
{
pthread_mutex_lock(&oldest_unused_share->mutex);
- VOID(hash_delete(&table_def_cache, (byte*) oldest_unused_share));
+ VOID(hash_delete(&table_def_cache, (uchar*) oldest_unused_share));
}
DBUG_PRINT("exit", ("share: 0x%lx ref_count: %u",
@@ -585,7 +590,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, (byte*) share);
+ hash_delete(&table_def_cache, (uchar*) share);
DBUG_VOID_RETURN;
}
pthread_mutex_unlock(&share->mutex);
@@ -611,13 +616,13 @@ void release_table_share(TABLE_SHARE *share, enum release_type type)
This code is execured when someone does FLUSH TABLES while on has
locked tables.
*/
- (void) hash_search(&def_cache,(byte*) key,key_length);
- hash_replace(&def_cache, def_cache.current_record,(byte*) name_lock);
+ (void) hash_search(&def_cache,(uchar*) key,key_length);
+ hash_replace(&def_cache, def_cache.current_record,(uchar*) name_lock);
}
else
{
/* Remove table definition */
- hash_delete(&def_cache,(byte*) share);
+ hash_delete(&def_cache,(uchar*) share);
}
pthread_mutex_unlock(&LOCK_open);
free_table_share(share);
@@ -662,7 +667,7 @@ 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,(byte*) key, key_length);
+ return (TABLE_SHARE*) hash_search(&table_def_cache,(uchar*) key, key_length);
}
@@ -681,13 +686,15 @@ TABLE_SHARE *get_cached_table_share(const char *db, const char *table_name)
*/
-static void close_handle_and_leave_table_as_lock(TABLE *table)
+void close_handle_and_leave_table_as_lock(TABLE *table)
{
TABLE_SHARE *share, *old_share= table->s;
char *key_buff;
MEM_ROOT *mem_root= &table->mem_root;
DBUG_ENTER("close_handle_and_leave_table_as_lock");
+ DBUG_ASSERT(table->db_stat);
+
/*
Make a local copy of the table share and free the current one.
This has to be done to ensure that the table share is removed from
@@ -840,7 +847,7 @@ static void free_cache_entry(TABLE *table)
}
check_unused(); // consisty check
}
- my_free((gptr) table,MYF(0));
+ my_free((uchar*) table,MYF(0));
DBUG_VOID_RETURN;
}
@@ -852,7 +859,7 @@ void free_io_cache(TABLE *table)
if (table->sort.io_cache)
{
close_cached_file(table->sort.io_cache);
- my_free((gptr) table->sort.io_cache,MYF(0));
+ my_free((uchar*) table->sort.io_cache,MYF(0));
table->sort.io_cache=0;
}
DBUG_VOID_RETURN;
@@ -881,17 +888,17 @@ bool close_cached_tables(THD *thd, bool if_wait_for_refresh,
while (unused_tables)
{
#ifdef EXTRA_DEBUG
- if (hash_delete(&open_cache,(byte*) unused_tables))
+ if (hash_delete(&open_cache,(uchar*) unused_tables))
printf("Warning: Couldn't delete open table from hash\n");
#else
- VOID(hash_delete(&open_cache,(byte*) unused_tables));
+ VOID(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, (byte*) oldest_unused_share));
+ VOID(hash_delete(&table_def_cache, (uchar*) oldest_unused_share));
}
}
else
@@ -899,8 +906,7 @@ bool close_cached_tables(THD *thd, bool if_wait_for_refresh,
bool found=0;
for (TABLE_LIST *table= tables; table; table= table->next_local)
{
- if ((!table->table || !table->table->s->log_table) &&
- remove_table_from_cache(thd, table->db, table->table_name,
+ if (remove_table_from_cache(thd, table->db, table->table_name,
RTFC_OWNED_BY_THD_FLAG))
found=1;
}
@@ -934,8 +940,21 @@ bool close_cached_tables(THD *thd, bool if_wait_for_refresh,
for (uint idx=0 ; idx < open_cache.records ; idx++)
{
TABLE *table=(TABLE*) hash_element(&open_cache,idx);
- if (!table->s->log_table &&
- ((table->s->version) < refresh_version && table->db_stat))
+ /*
+ Note that we wait here only for tables which are actually open, and
+ not for placeholders with TABLE::open_placeholder set. Waiting for
+ latter will cause deadlock in the following scenario, for example:
+
+ conn1: lock table t1 write;
+ conn2: lock table t2 write;
+ conn1: flush tables;
+ conn2: flush tables;
+
+ It also does not make sense to wait for those of placeholders that
+ are employed by CREATE TABLE as in this case table simply does not
+ exist yet.
+ */
+ if (table->needs_reopen_or_name_lock() && table->db_stat)
{
found=1;
DBUG_PRINT("signal", ("Waiting for COND_refresh"));
@@ -1202,13 +1221,6 @@ void close_thread_tables(THD *thd, bool lock_in_use, bool skip_derived)
DBUG_PRINT("info", ("thd->open_tables: 0x%lx", (long) thd->open_tables));
- /*
- End open index scans and table scans and remove references to the tables
- from the handler tables hash. After this preparation it is safe to close
- the tables.
- */
- mysql_ha_mark_tables_for_reopen(thd, thd->open_tables);
-
found_old_table= 0;
while (thd->open_tables)
found_old_table|= close_thread_table(thd, &thd->open_tables);
@@ -1216,7 +1228,7 @@ void close_thread_tables(THD *thd, bool lock_in_use, bool skip_derived)
/* Free tables to hold down open files */
while (open_cache.records > table_cache_size && unused_tables)
- VOID(hash_delete(&open_cache,(byte*) unused_tables)); /* purecov: tested */
+ VOID(hash_delete(&open_cache,(uchar*) unused_tables)); /* purecov: tested */
check_unused();
if (found_old_table)
{
@@ -1249,17 +1261,23 @@ bool close_thread_table(THD *thd, TABLE **table_ptr)
TABLE *table= *table_ptr;
DBUG_ENTER("close_thread_table");
DBUG_ASSERT(table->key_read == 0);
- DBUG_ASSERT(table->file->inited == handler::NONE);
+ DBUG_ASSERT(!table->file || table->file->inited == handler::NONE);
*table_ptr=table->next;
- if (table->s->version != refresh_version ||
+ if (table->needs_reopen_or_name_lock() ||
thd->version != refresh_version || !table->db_stat)
{
- VOID(hash_delete(&open_cache,(byte*) table));
+ VOID(hash_delete(&open_cache,(uchar*) table));
found_old_table=1;
}
else
{
+ /*
+ Open placeholders have TABLE::db_stat set to 0, so they should be
+ handled by the first alternative.
+ */
+ DBUG_ASSERT(!table->open_placeholder);
+
/* Free memory and reset for next loop */
table->file->ha_reset();
table->in_use=0;
@@ -1293,24 +1311,20 @@ void close_temporary_tables(THD *thd)
{
TABLE *table;
TABLE *next;
- /*
- TODO: 5.1 maintains prev link in temporary_tables
- double-linked list so we could fix it. But it is not necessary
- at this time when the list is being destroyed
- */
TABLE *prev_table;
/* Assume thd->options has OPTION_QUOTE_SHOW_CREATE */
bool was_quote_show= TRUE;
+ LINT_INIT(next);
if (!thd->temporary_tables)
return;
if (!mysql_bin_log.is_open() || thd->current_stmt_binlog_row_based)
{
- TABLE *next;
- for (table= thd->temporary_tables; table; table= next)
+ TABLE *tmp_next;
+ for (table= thd->temporary_tables; table; table= tmp_next)
{
- next=table->next;
+ tmp_next= table->next;
close_temporary(table, 1, 1);
}
thd->temporary_tables= 0;
@@ -1323,13 +1337,12 @@ void close_temporary_tables(THD *thd)
char buf[256];
String s_query= String(buf, sizeof(buf), system_charset_info);
bool found_user_tables= FALSE;
- LINT_INIT(next);
memcpy(buf, stub, stub_len);
/*
- insertion sort of temp tables by pseudo_thread_id to build ordered list
- of sublists of equal pseudo_thread_id
+ Insertion sort of temp tables by pseudo_thread_id to build ordered list
+ of sublists of equal pseudo_thread_id
*/
for (prev_table= thd->temporary_tables, table= prev_table->next;
@@ -1453,7 +1466,7 @@ void close_temporary_tables(THD *thd)
*/
TABLE_LIST *find_table_in_list(TABLE_LIST *table,
- st_table_list *TABLE_LIST::*link,
+ TABLE_LIST *TABLE_LIST::*link,
const char *db_name,
const char *table_name)
{
@@ -1656,8 +1669,28 @@ TABLE *find_temporary_table(THD *thd, TABLE_LIST *table_list)
}
-/*
- Close temporary table and unlink from thd->temporary tables
+/**
+ Drop a temporary table.
+
+ Try to locate the table in the list of thd->temporary_tables.
+ If the table is found:
+ - if the table is in thd->locked_tables, unlock it and
+ remove it from the list of locked tables. Currently only transactional
+ temporary tables are present in the locked_tables list.
+ - Close the temporary table, remove its .FRM
+ - remove the table from the list of temporary tables
+
+ This function is used to drop user temporary tables, as well as
+ internal tables created in CREATE TEMPORARY TABLE ... SELECT
+ or ALTER TABLE. Even though part of the work done by this function
+ is redundant when the table is internal, as long as we
+ link both internal and user temporary tables into the same
+ thd->temporary_tables list, it's impossible to tell here whether
+ we're dealing with an internal or a user temporary table.
+
+ @retval TRUE the table was not found in the list of temporary tables
+ of this thread
+ @retval FALSE the table was found and dropped successfully.
*/
bool close_temporary_table(THD *thd, TABLE_LIST *table_list)
@@ -1666,6 +1699,11 @@ bool close_temporary_table(THD *thd, TABLE_LIST *table_list)
if (!(table= find_temporary_table(thd, table_list)))
return 1;
+ /*
+ If LOCK TABLES list is not empty and contains this table,
+ unlock the table and remove the table from this list.
+ */
+ mysql_lock_remove(thd, thd->locked_tables, table, FALSE);
close_temporary_table(thd, table, 1, 1);
return 0;
}
@@ -1716,7 +1754,7 @@ void close_temporary_table(THD *thd, TABLE *table,
void close_temporary(TABLE *table, bool free_share, bool delete_table)
{
- handlerton *table_type= table->s->db_type;
+ handlerton *table_type= table->s->db_type();
DBUG_ENTER("close_temporary");
free_io_cache(table);
@@ -1778,18 +1816,32 @@ static void relink_unused(TABLE *table)
}
-/*
- Remove all instances of table from the current open list
- Free all locks on tables that are done with LOCK TABLES
- */
+/**
+ @brief Remove all instances of table from thread's open list and
+ table cache.
+
+ @param thd Thread context
+ @param find Table to remove
+ @param unlock TRUE - free all locks on tables removed that are
+ done with LOCK TABLES
+ FALSE - otherwise
+
+ @note When unlock parameter is FALSE or current thread doesn't have
+ any tables locked with LOCK TABLES tables are assumed to be
+ not locked (for example already unlocked).
+*/
-TABLE *unlink_open_table(THD *thd, TABLE *list, TABLE *find)
+void unlink_open_table(THD *thd, TABLE *find, bool unlock)
{
char key[MAX_DBKEY_LENGTH];
uint key_length= find->s->table_cache_key.length;
- TABLE *start=list,**prev,*next;
- prev= &start;
+ TABLE *list, **prev, *next;
+ DBUG_ENTER("unlink_open_table");
+
+ safe_mutex_assert_owner(&LOCK_open);
+ list= thd->open_tables;
+ prev= &thd->open_tables;
memcpy(key, find->s->table_cache_key.str, key_length);
for (; list ; list=next)
{
@@ -1797,9 +1849,9 @@ TABLE *unlink_open_table(THD *thd, TABLE *list, TABLE *find)
if (list->s->table_cache_key.length == key_length &&
!memcmp(list->s->table_cache_key.str, key, key_length))
{
- if (thd->locked_tables)
- mysql_lock_remove(thd, thd->locked_tables,list);
- VOID(hash_delete(&open_cache,(byte*) list)); // Close table
+ if (unlock && thd->locked_tables)
+ mysql_lock_remove(thd, thd->locked_tables, list, TRUE);
+ VOID(hash_delete(&open_cache,(uchar*) list)); // Close table
}
else
{
@@ -1810,7 +1862,46 @@ TABLE *unlink_open_table(THD *thd, TABLE *list, TABLE *find)
*prev=0;
// Notify any 'refresh' threads
broadcast_refresh();
- return start;
+ DBUG_VOID_RETURN;
+}
+
+
+/**
+ @brief Auxiliary routine which closes and drops open table.
+
+ @param thd Thread handle
+ @param table TABLE object for table to be dropped
+ @param db_name Name of database for this table
+ @param table_name Name of this table
+
+ @note This routine assumes that table to be closed is open only
+ by calling thread so we needn't wait until other threads
+ will close the table. Also unless called under implicit or
+ explicit LOCK TABLES mode it assumes that table to be
+ dropped is already unlocked. In the former case it will
+ also remove lock on the table. But one should not rely on
+ this behaviour as it may change in future.
+ Currently, however, this function is never called for a
+ table that was locked with LOCK TABLES.
+*/
+
+void drop_open_table(THD *thd, TABLE *table, const char *db_name,
+ const char *table_name)
+{
+ if (table->s->tmp_table)
+ close_temporary_table(thd, table, 1, 1);
+ else
+ {
+ handlerton *table_type= table->s->db_type();
+ VOID(pthread_mutex_lock(&LOCK_open));
+ /*
+ unlink_open_table() also tells threads waiting for refresh or close
+ that something has happened.
+ */
+ unlink_open_table(thd, table, FALSE);
+ quick_rm_table(table_type, db_name, table_name, 0);
+ VOID(pthread_mutex_unlock(&LOCK_open));
+ }
}
@@ -1867,6 +1958,11 @@ void wait_for_condition(THD *thd, pthread_mutex_t *mutex, pthread_cond_t *cond)
table_list TABLE_LIST object for table to be open, TABLE_LIST::table
member should point to TABLE object which was used for
name-locking.
+ link_in TRUE - if TABLE object for table to be opened should be
+ linked into THD::open_tables list.
+ FALSE - placeholder used for name-locking is already in
+ this list so we only need to preserve TABLE::next
+ pointer.
NOTE
This function assumes that its caller already acquired LOCK_open mutex.
@@ -1876,7 +1972,7 @@ void wait_for_condition(THD *thd, pthread_mutex_t *mutex, pthread_cond_t *cond)
TRUE - Error
*/
-bool reopen_name_locked_table(THD* thd, TABLE_LIST* table_list)
+bool reopen_name_locked_table(THD* thd, TABLE_LIST* table_list, bool link_in)
{
TABLE *table= table_list->table;
TABLE_SHARE *share;
@@ -1907,11 +2003,32 @@ bool reopen_name_locked_table(THD* thd, TABLE_LIST* table_list)
}
share= table->s;
+ /*
+ We want to prevent other connections from opening this table until end
+ of statement as it is likely that modifications of table's metadata are
+ not yet finished (for example CREATE TRIGGER have to change .TRG file,
+ or we might want to drop table if CREATE TABLE ... SELECT fails).
+ This also allows us to assume that no other connection will sneak in
+ before we will get table-level lock on this table.
+ */
share->version=0;
table->in_use = thd;
check_unused();
- table->next = thd->open_tables;
- thd->open_tables = table;
+
+ if (link_in)
+ {
+ table->next= thd->open_tables;
+ thd->open_tables= table;
+ }
+ else
+ {
+ /*
+ TABLE object should be already in THD::open_tables list so we just
+ need to set TABLE::next correctly.
+ */
+ table->next= orig_table.next;
+ }
+
table->tablenr=thd->current_tablenr++;
table->used_fields=0;
table->const_table=0;
@@ -1921,6 +2038,173 @@ bool reopen_name_locked_table(THD* thd, TABLE_LIST* table_list)
}
+/**
+ @brief Create and insert into table cache placeholder for table
+ which will prevent its opening (or creation) (a.k.a lock
+ table name).
+
+ @param thd Thread context
+ @param key Table cache key for name to be locked
+ @param key_length Table cache key length
+
+ @return Pointer to TABLE object used for name locking or 0 in
+ case of failure.
+*/
+
+TABLE *table_cache_insert_placeholder(THD *thd, const char *key,
+ uint key_length)
+{
+ TABLE *table;
+ TABLE_SHARE *share;
+ char *key_buff;
+ DBUG_ENTER("table_cache_insert_placeholder");
+
+ safe_mutex_assert_owner(&LOCK_open);
+
+ /*
+ Create a table entry with the right key and with an old refresh version
+ Note that we must use my_multi_malloc() here as this is freed by the
+ table cache
+ */
+ if (!my_multi_malloc(MYF(MY_WME | MY_ZEROFILL),
+ &table, sizeof(*table),
+ &share, sizeof(*share),
+ &key_buff, key_length,
+ NULL))
+ DBUG_RETURN(NULL);
+
+ table->s= share;
+ share->set_table_cache_key(key_buff, key, key_length);
+ share->tmp_table= INTERNAL_TMP_TABLE; // for intern_close_table
+ table->in_use= thd;
+ table->locked_by_name=1;
+
+ if (my_hash_insert(&open_cache, (uchar*)table))
+ {
+ my_free((uchar*) table, MYF(0));
+ DBUG_RETURN(NULL);
+ }
+
+ DBUG_RETURN(table);
+}
+
+
+/**
+ @brief Obtain an exclusive name lock on the table if it is not cached
+ in the table cache.
+
+ @param thd Thread context
+ @param db Name of database
+ @param table_name Name of table
+ @param[out] table Out parameter which is either:
+ - set to NULL if table cache contains record for
+ the table or
+ - set to point to the TABLE instance used for
+ name-locking.
+
+ @note This function takes into account all records for table in table
+ cache, even placeholders used for name-locking. This means that
+ 'table' parameter can be set to NULL for some situations when
+ table does not really exist.
+
+ @retval TRUE Error occured (OOM)
+ @retval FALSE Success. 'table' parameter set according to above rules.
+*/
+
+bool lock_table_name_if_not_cached(THD *thd, const char *db,
+ const char *table_name, TABLE **table)
+{
+ char key[MAX_DBKEY_LENGTH];
+ uint key_length;
+ DBUG_ENTER("lock_table_name_if_not_cached");
+
+ 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))
+ {
+ VOID(pthread_mutex_unlock(&LOCK_open));
+ DBUG_PRINT("info", ("Table is cached, name-lock is not obtained"));
+ *table= 0;
+ DBUG_RETURN(FALSE);
+ }
+ if (!(*table= table_cache_insert_placeholder(thd, key, key_length)))
+ {
+ VOID(pthread_mutex_unlock(&LOCK_open));
+ DBUG_RETURN(TRUE);
+ }
+ (*table)->open_placeholder= 1;
+ (*table)->next= thd->open_tables;
+ thd->open_tables= *table;
+ VOID(pthread_mutex_unlock(&LOCK_open));
+ DBUG_RETURN(FALSE);
+}
+
+
+/**
+ @brief Check that table exists in table definition cache, on disk
+ or in some storage engine.
+
+ @param thd Thread context
+ @param table Table list element
+ @param[out] exists Out parameter which is set to TRUE if table
+ exists and to FALSE otherwise.
+
+ @note This function assumes that caller owns LOCK_open mutex.
+ It also assumes that the fact that there are no name-locks
+ on the table was checked beforehand.
+
+ @note If there is no .FRM file for the table but it exists in one
+ of engines (e.g. it was created on another node of NDB cluster)
+ this function will fetch and create proper .FRM file for it.
+
+ @retval TRUE Some error occured
+ @retval FALSE No error. 'exists' out parameter set accordingly.
+*/
+
+bool check_if_table_exists(THD *thd, TABLE_LIST *table, bool *exists)
+{
+ char path[FN_REFLEN];
+ int rc;
+ DBUG_ENTER("check_if_table_exists");
+
+ safe_mutex_assert_owner(&LOCK_open);
+
+ *exists= TRUE;
+
+ if (get_cached_table_share(table->db, table->table_name))
+ DBUG_RETURN(FALSE);
+
+ build_table_filename(path, sizeof(path) - 1, table->db, table->table_name,
+ reg_ext, 0);
+
+ if (!access(path, F_OK))
+ DBUG_RETURN(FALSE);
+
+ /* .FRM file doesn't exist. Check if some engine can provide it. */
+
+ rc= ha_create_table_from_engine(thd, table->db, table->table_name);
+
+ if (rc < 0)
+ {
+ /* Table does not exists in engines as well. */
+ *exists= FALSE;
+ DBUG_RETURN(FALSE);
+ }
+ else if (!rc)
+ {
+ /* Table exists in some engine and .FRM for it was created. */
+ DBUG_RETURN(FALSE);
+ }
+ else /* (rc > 0) */
+ {
+ my_printf_error(ER_UNKNOWN_ERROR, "Failed to open '%-.64s', error while "
+ "unpacking from engine", MYF(0), table->table_name);
+ DBUG_RETURN(TRUE);
+ }
+}
+
+
/*
Open a table.
@@ -1936,12 +2220,17 @@ bool reopen_name_locked_table(THD* thd, TABLE_LIST* table_list)
MYSQL_LOCK_IGNORE_FLUSH - Open table even if
someone has done a flush or namelock on it.
No version number checking is done.
- MYSQL_OPEN_IGNORE_LOCKED_TABLES - Open table
- ignoring set of locked tables and prelocked mode.
+ MYSQL_OPEN_TEMPORARY_ONLY - Open only temporary
+ table not the base table or view.
IMPLEMENTATION
Uses a cache of open tables to find a table not in use.
+ If table list element for the table to be opened has "create" flag
+ set and table does not exist, this function will automatically insert
+ a placeholder for exclusive name lock into the open tables cache and
+ will return the TABLE instance that corresponds to this placeholder.
+
RETURN
NULL Open failed. If refresh is set then one should close
all other tables and retry the open.
@@ -1964,7 +2253,7 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
*refresh=0;
/* an open table operation needs a lot of the stack space */
- if (check_stack_overrun(thd, STACK_MIN_SIZE_FOR_OPEN, (char *)&alias))
+ if (check_stack_overrun(thd, STACK_MIN_SIZE_FOR_OPEN, (uchar *)&alias))
DBUG_RETURN(0);
if (thd->killed)
@@ -2007,13 +2296,19 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
}
table->query_id= thd->query_id;
table->clear_query_id= 1;
- thd->tmp_table_used= 1;
+ thd->thread_specific_used= TRUE;
DBUG_PRINT("info",("Using temporary table"));
goto reset;
}
}
}
+ if (flags & MYSQL_OPEN_TEMPORARY_ONLY)
+ {
+ my_error(ER_NO_SUCH_TABLE, MYF(0), table_list->db, table_list->table_name);
+ DBUG_RETURN(0);
+ }
+
/*
The table is not temporary - if we're in pre-locked or LOCK TABLES
mode, let's try to find the requested table in the list of pre-opened
@@ -2021,8 +2316,7 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
open not pre-opened tables in pre-locked/LOCK TABLES mode.
TODO: move this block into a separate function.
*/
- if (!(flags & MYSQL_OPEN_IGNORE_LOCKED_TABLES) &&
- (thd->locked_tables || thd->prelocked_mode))
+ if (thd->locked_tables || thd->prelocked_mode)
{ // Using table locks
TABLE *best_table= 0;
int best_distance= INT_MIN;
@@ -2120,10 +2414,17 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
VOID(pthread_mutex_unlock(&LOCK_open));
}
}
- if ((thd->locked_tables) && (thd->locked_tables->lock_count > 0))
- my_error(ER_TABLE_NOT_LOCKED, MYF(0), alias);
- else
+ /*
+ No table in the locked tables list. In case of explicit LOCK TABLES
+ this can happen if a user did not include the able into the list.
+ In case of pre-locked mode locked tables list is generated automatically,
+ so we may only end up here if the table did not exist when
+ locked tables list was created.
+ */
+ if (thd->prelocked_mode == PRELOCKED)
my_error(ER_NO_SUCH_TABLE, MYF(0), table_list->db, table_list->alias);
+ else
+ my_error(ER_TABLE_NOT_LOCKED, MYF(0), alias);
DBUG_RETURN(0);
}
@@ -2179,15 +2480,14 @@ 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, (byte*) key, key_length,
+ for (table= (TABLE*) hash_first(&open_cache, (uchar*) key, key_length,
&state);
table && table->in_use ;
- table= (TABLE*) hash_next(&open_cache, (byte*) key, key_length,
+ table= (TABLE*) hash_next(&open_cache, (uchar*) key, key_length,
&state))
{
/*
- Here we flush tables marked for flush. However we never flush log
- tables here. They are flushed only on FLUSH LOGS.
+ Here we flush tables marked for flush.
Normally, table->s->version contains the value of
refresh_version from the moment when this table was
(re-)opened and added to the cache.
@@ -2204,7 +2504,7 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
c1: name lock t2; -- blocks
c2: open t1; -- blocks
*/
- if (table->s->version != refresh_version && !table->s->log_table)
+ if (table->needs_reopen_or_name_lock())
{
DBUG_PRINT("note",
("Found table '%s.%s' with different refresh version",
@@ -2217,6 +2517,14 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
continue;
}
+ /* Avoid self-deadlocks by detecting self-dependencies. */
+ if (table->open_placeholder && table->in_use == thd)
+ {
+ VOID(pthread_mutex_unlock(&LOCK_open));
+ my_error(ER_UPDATE_TABLE_USED, MYF(0), table->s->table_name.str);
+ DBUG_RETURN(0);
+ }
+
/*
Back off, part 1: mark the table as "unused" for the
purpose of name-locking by setting table->db_stat to 0. Do
@@ -2233,6 +2541,14 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
and wait till the operation is complete: when any
operation that juggles with table->s->version completes,
it broadcasts COND_refresh condition variable.
+ If 'old' table we met is in use by current thread we return
+ without waiting since in this situation it's this thread
+ which is responsible for broadcasting on COND_refresh
+ (and this was done already in close_old_data_files()).
+ Good example of such situation is when we have statement
+ that needs two instances of table and FLUSH TABLES comes
+ after we open first instance but before we open second
+ instance.
*/
if (table->in_use != thd)
{
@@ -2271,7 +2587,41 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
int error;
/* Free cache if too big */
while (open_cache.records > table_cache_size && unused_tables)
- VOID(hash_delete(&open_cache,(byte*) unused_tables)); /* purecov: tested */
+ VOID(hash_delete(&open_cache,(uchar*) unused_tables)); /* purecov: tested */
+
+ if (table_list->create)
+ {
+ bool exists;
+
+ if (check_if_table_exists(thd, table_list, &exists))
+ {
+ VOID(pthread_mutex_unlock(&LOCK_open));
+ DBUG_RETURN(NULL);
+ }
+
+ if (!exists)
+ {
+ /*
+ Table to be created, so we need to create placeholder in table-cache.
+ */
+ if (!(table= table_cache_insert_placeholder(thd, key, key_length)))
+ {
+ VOID(pthread_mutex_unlock(&LOCK_open));
+ DBUG_RETURN(NULL);
+ }
+ /*
+ Link placeholder to the open tables list so it will be automatically
+ removed once tables are closed. Also mark it so it won't be ignored
+ by other trying to take name-lock.
+ */
+ table->open_placeholder= 1;
+ table->next= thd->open_tables;
+ thd->open_tables= table;
+ VOID(pthread_mutex_unlock(&LOCK_open));
+ DBUG_RETURN(table);
+ }
+ /* Table exists. Let us try to open it. */
+ }
/* make a new table */
if (!(table=(TABLE*) my_malloc(sizeof(*table),MYF(MY_WME))))
@@ -2284,7 +2634,7 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
mem_root, (flags & OPEN_VIEW_NO_PARSE));
if (error > 0)
{
- my_free((gptr)table, MYF(0));
+ my_free((uchar*)table, MYF(0));
VOID(pthread_mutex_unlock(&LOCK_open));
DBUG_RETURN(NULL);
}
@@ -2297,12 +2647,12 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
if (error < 0)
table_list->view= (st_lex*)1;
- my_free((gptr)table, MYF(0));
+ my_free((uchar*)table, MYF(0));
VOID(pthread_mutex_unlock(&LOCK_open));
DBUG_RETURN(0); // VIEW
}
DBUG_PRINT("info", ("inserting table 0x%lx into the cache", (long) table));
- VOID(my_hash_insert(&open_cache,(byte*) table));
+ VOID(my_hash_insert(&open_cache,(uchar*) table));
}
check_unused(); // Debugging call
@@ -2382,7 +2732,7 @@ TABLE *find_locked_table(THD *thd, const char *db,const char *table_name)
1 error. The old table object is not changed.
*/
-static bool reopen_table(TABLE *table)
+bool reopen_table(TABLE *table)
{
TABLE tmp;
bool error= 1;
@@ -2400,11 +2750,10 @@ static bool reopen_table(TABLE *table)
sql_print_error("Table %s had a open data handler in reopen_table",
table->alias);
#endif
+ bzero((char*) &table_list, sizeof(TABLE_LIST));
table_list.db= table->s->db.str;
table_list.table_name= table->s->table_name.str;
table_list.table= table;
- table_list.belong_to_view= 0;
- table_list.next_local= 0;
if (wait_for_locked_table_names(thd, &table_list))
DBUG_RETURN(1); // Thread was killed
@@ -2465,33 +2814,76 @@ static bool reopen_table(TABLE *table)
}
-/*
- Used with ALTER TABLE:
- Close all instanses of table when LOCK TABLES is in used;
- Close first all instances of table and then reopen them
+/**
+ @brief Close all instances of a table open by this thread and replace
+ them with exclusive name-locks.
+
+ @param thd Thread context
+ @param db Database name for the table to be closed
+ @param table_name Name of the table to be closed
+
+ @note This function assumes that if we are not under LOCK TABLES,
+ then there is only one table open and locked. This means that
+ the function probably has to be adjusted before it can be used
+ anywhere outside ALTER TABLE.
*/
-bool close_data_tables(THD *thd,const char *db, const char *table_name)
+void close_data_files_and_morph_locks(THD *thd, const char *db,
+ const char *table_name)
{
TABLE *table;
- DBUG_ENTER("close_data_tables");
+ DBUG_ENTER("close_data_files_and_morph_locks");
+
+ safe_mutex_assert_owner(&LOCK_open);
+
+ if (thd->lock)
+ {
+ /*
+ If we are not under LOCK TABLES we should have only one table
+ open and locked so it makes sense to remove the lock at once.
+ */
+ mysql_unlock_tables(thd, thd->lock);
+ thd->lock= 0;
+ }
+ /*
+ Note that open table list may contain a name-lock placeholder
+ for target table name if we process ALTER TABLE ... RENAME.
+ So loop below makes sense even if we are not under LOCK TABLES.
+ */
for (table=thd->open_tables; table ; table=table->next)
{
if (!strcmp(table->s->table_name.str, table_name) &&
!strcmp(table->s->db.str, db))
{
- mysql_lock_remove(thd, thd->locked_tables,table);
+ if (thd->locked_tables)
+ mysql_lock_remove(thd, thd->locked_tables, table, TRUE);
+ table->open_placeholder= 1;
close_handle_and_leave_table_as_lock(table);
}
}
- DBUG_RETURN(0); // For the future
+ DBUG_VOID_RETURN;
}
-/*
- Reopen all tables with closed data files
- One should have lock on LOCK_open when calling this
+/**
+ @brief Reopen all tables with closed data files.
+
+ @param thd Thread context
+ @param get_locks Should we get locks after reopening tables ?
+ @param in_refresh Are we in FLUSH TABLES ? TODO: It seems that
+ we can remove this parameter.
+
+ @note Since this function can't properly handle prelocking and
+ create placeholders it should be used in very special
+ situations like FLUSH TABLES or ALTER TABLE. In general
+ case one should just repeat open_tables()/lock_tables()
+ combination when one needs tables to be reopened (for
+ example see open_and_lock_tables()).
+
+ @note One should have lock on LOCK_open when calling this.
+
+ @return FALSE in case of success, TRUE - otherwise.
*/
bool reopen_tables(THD *thd,bool get_locks,bool in_refresh)
@@ -2525,7 +2917,7 @@ bool reopen_tables(THD *thd,bool get_locks,bool in_refresh)
if (!tables || (!db_stat && reopen_table(table)))
{
my_error(ER_CANT_REOPEN_TABLE, MYF(0), table->alias);
- VOID(hash_delete(&open_cache,(byte*) table));
+ VOID(hash_delete(&open_cache,(uchar*) table));
error=1;
}
else
@@ -2537,7 +2929,7 @@ bool reopen_tables(THD *thd,bool get_locks,bool in_refresh)
if (in_refresh)
{
table->s->version=0;
- table->locked_by_flush=0;
+ table->open_placeholder= 0;
}
}
}
@@ -2556,7 +2948,7 @@ bool reopen_tables(THD *thd,bool get_locks,bool in_refresh)
}
if (get_locks && tables)
{
- my_afree((gptr) tables);
+ my_afree((uchar*) tables);
}
broadcast_refresh();
*prev=0;
@@ -2564,13 +2956,21 @@ bool reopen_tables(THD *thd,bool get_locks,bool in_refresh)
}
-/*
- Close handlers for tables in list, but leave the TABLE structure
- intact so that we can re-open these quickly
- abort_locks is set if called from flush_tables.
+/**
+ @brief Close handlers for tables in list, but leave the TABLE structure
+ intact so that we can re-open these quickly.
+
+ @param thd Thread context
+ @param table Head of the list of TABLE objects
+ @param morph_locks TRUE - remove locks which we have on tables being closed
+ but ensure that no DML or DDL will sneak in before
+ we will re-open the table (i.e. temporarily morph
+ our table-level locks into name-locks).
+ FALSE - otherwise
+ @param send_refresh Should we awake waiters even if we didn't close any tables?
*/
-void close_old_data_files(THD *thd, TABLE *table, bool abort_locks,
+void close_old_data_files(THD *thd, TABLE *table, bool morph_locks,
bool send_refresh)
{
bool found= send_refresh;
@@ -2579,22 +2979,43 @@ void close_old_data_files(THD *thd, TABLE *table, bool abort_locks,
for (; table ; table=table->next)
{
/*
- Reopen marked for flush. But close log tables. They are flushed only
- explicitly on FLUSH LOGS
+ Reopen marked for flush.
*/
- if (table->s->version != refresh_version && !table->s->log_table)
+ if (table->needs_reopen_or_name_lock())
{
found=1;
if (table->db_stat)
{
- if (abort_locks)
+ if (morph_locks)
{
- mysql_lock_abort(thd,table, TRUE); // Close waiting threads
- mysql_lock_remove(thd, thd->locked_tables,table);
- table->locked_by_flush=1; // Will be reopened with locks
+ /*
+ Wake up threads waiting for table-level lock on this table
+ so they won't sneak in when we will temporarily remove our
+ lock on it. This will also give them a chance to close their
+ instances of this table.
+ */
+ mysql_lock_abort(thd, table, TRUE);
+ mysql_lock_remove(thd, thd->locked_tables, table, TRUE);
+ /*
+ We want to protect the table from concurrent DDL operations
+ (like RENAME TABLE) until we will re-open and re-lock it.
+ */
+ table->open_placeholder= 1;
}
close_handle_and_leave_table_as_lock(table);
}
+ else if (table->open_placeholder)
+ {
+ /*
+ We come here only in close-for-back-off scenario. So we have to
+ "close" create placeholder here to avoid deadlocks (for example,
+ in case of concurrent execution of CREATE TABLE t1 SELECT * FROM t2
+ and RENAME TABLE t2 TO t1). In close-for-re-open scenario we will
+ probably want to let it stay.
+ */
+ DBUG_ASSERT(!morph_locks);
+ table->open_placeholder= 0;
+ }
}
}
if (found)
@@ -2607,10 +3028,6 @@ void close_old_data_files(THD *thd, TABLE *table, bool abort_locks,
Wait until all threads has closed the tables in the list
We have also to wait if there is thread that has a lock on this table even
if the table is closed
- NOTE: log tables are handled differently by the logging routines.
- E.g. general_log is always opened and locked by the logger
- and the table handler used by the logger, will be skipped by
- this check.
*/
bool table_is_used(TABLE *table, bool wait_for_name_lock)
@@ -2623,17 +3040,17 @@ 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, (byte*) key,
+ for (TABLE *search= (TABLE*) hash_first(&open_cache, (uchar*) key,
key_length, &state);
search ;
- search= (TABLE*) hash_next(&open_cache, (byte*) key,
+ search= (TABLE*) hash_next(&open_cache, (uchar*) key,
key_length, &state))
{
- DBUG_PRINT("info", ("share: 0x%lx locked_by_logger: %d "
- "locked_by_flush: %d locked_by_name: %d "
+ DBUG_PRINT("info", ("share: 0x%lx "
+ "open_placeholder: %d locked_by_name: %d "
"db_stat: %u version: %lu",
- (ulong) search->s, search->locked_by_logger,
- search->locked_by_flush, search->locked_by_name,
+ (ulong) search->s,
+ search->open_placeholder, search->locked_by_name,
search->db_stat,
search->s->version));
if (search->in_use == table->in_use)
@@ -2644,13 +3061,9 @@ bool table_is_used(TABLE *table, bool wait_for_name_lock)
- If we are in flush table and we didn't execute the flush
- If the table engine is open and it's an old version
(We must wait until all engines are shut down to use the table)
- However we fo not wait if we encountered a table, locked by the logger.
- Log tables are managed separately by logging routines.
*/
- if (!search->locked_by_logger &&
- (search->locked_by_name && wait_for_name_lock ||
- search->locked_by_flush ||
- (search->db_stat && search->s->version < refresh_version)))
+ if ( (search->locked_by_name && wait_for_name_lock) ||
+ (search->is_name_opened() && search->needs_reopen_or_name_lock()))
DBUG_RETURN(1);
}
} while ((table=table->next));
@@ -2727,7 +3140,7 @@ TABLE *drop_locked_tables(THD *thd,const char *db, const char *table_name)
if (!strcmp(table->s->table_name.str, table_name) &&
!strcmp(table->s->db.str, db))
{
- mysql_lock_remove(thd, thd->locked_tables,table);
+ mysql_lock_remove(thd, thd->locked_tables, table, TRUE);
if (!found)
{
found= table;
@@ -2741,7 +3154,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,(byte*) table));
+ VOID(hash_delete(&open_cache,(uchar*) table));
}
}
else
@@ -2755,7 +3168,7 @@ TABLE *drop_locked_tables(THD *thd,const char *db, const char *table_name)
broadcast_refresh();
if (thd->locked_tables && thd->locked_tables->table_count == 0)
{
- my_free((gptr) thd->locked_tables,MYF(0));
+ my_free((uchar*) thd->locked_tables,MYF(0));
thd->locked_tables=0;
}
DBUG_RETURN(found);
@@ -2872,15 +3285,19 @@ static int open_unireg_entry(THD *thd, TABLE *entry, TABLE_LIST *table_list,
DBUG_ENTER("open_unireg_entry");
safe_mutex_assert_owner(&LOCK_open);
-
retry:
if (!(share= get_table_share_with_create(thd, table_list, cache_key,
cache_key_length,
- OPEN_VIEW, &error)))
+ OPEN_VIEW |
+ table_list->i_s_requested_object,
+ &error)))
DBUG_RETURN(1);
if (share->is_view)
{
+ if (table_list->i_s_requested_object & OPEN_TABLE_ONLY)
+ goto err;
+
/* Open view */
error= (int) open_new_frm(thd, share, alias,
(uint) (HA_OPEN_KEYFILE | HA_OPEN_RNDFILE |
@@ -2896,6 +3313,9 @@ retry:
DBUG_RETURN((flags & OPEN_VIEW_NO_PARSE)? -1 : 0);
}
+ if (table_list->i_s_requested_object & OPEN_VIEW_ONLY)
+ goto err;
+
while ((error= open_table_from_share(thd, share, alias,
(uint) (HA_OPEN_KEYFILE |
HA_OPEN_RNDFILE |
@@ -3098,7 +3518,7 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags)
*/
if (!thd->prelocked_mode && !thd->lex->requires_prelocking() &&
- thd->lex->sroutines_list.elements)
+ thd->lex->uses_stored_routines())
{
bool first_no_prelocking, need_prelocking;
TABLE_LIST **save_query_tables_last= thd->lex->query_tables_last;
@@ -3129,7 +3549,8 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags)
*/
for (tables= *start; tables ;tables= tables->next_global)
{
- safe_to_ignore_table= FALSE; // 'FALSE', as per coding style
+ safe_to_ignore_table= FALSE;
+
/*
Ignore placeholders for derived tables. After derived tables
processing, link to created temporary table will be put here.
@@ -3274,7 +3695,8 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags)
}
if (tables->lock_type != TL_UNLOCK && ! thd->locked_tables)
- tables->table->reginfo.lock_type=tables->lock_type;
+ tables->table->reginfo.lock_type= tables->lock_type == TL_WRITE_DEFAULT ?
+ thd->update_lock_default : tables->lock_type;
tables->table->grant= tables->grant;
process_view_routines:
@@ -3284,7 +3706,7 @@ process_view_routines:
*/
if (tables->view && !thd->prelocked_mode &&
!thd->lex->requires_prelocking() &&
- tables->view->sroutines_list.elements)
+ tables->view->uses_stored_routines())
{
/* We have at least one table in TL here. */
if (!query_tables_last_own)
@@ -3356,6 +3778,7 @@ static bool check_lock_and_start_stmt(THD *thd, TABLE *table,
thd Thread handler
table_list Table to open is first table in this list
lock_type Lock to use for open
+ lock_flags Flags passed to mysql_lock_table
NOTE
This function don't do anything like SP/SF/views/triggers analysis done
@@ -3371,7 +3794,8 @@ static bool check_lock_and_start_stmt(THD *thd, TABLE *table,
table_list->table table
*/
-TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type lock_type)
+TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type lock_type,
+ uint lock_flags)
{
TABLE *table;
bool refresh;
@@ -3387,13 +3811,6 @@ TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type lock_type)
if (table)
{
-#if defined( __WIN__)
- /* Win32 can't drop a file that is open */
- if (lock_type == TL_WRITE_ALLOW_READ)
- {
- lock_type= TL_WRITE;
- }
-#endif /* __WIN__ */
table_list->lock_type= lock_type;
table_list->table= table;
table->grant= table_list->grant;
@@ -3406,8 +3823,8 @@ TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type lock_type)
{
DBUG_ASSERT(thd->lock == 0); // You must lock everything at once
if ((table->reginfo.lock_type= lock_type) != TL_UNLOCK)
- if (! (thd->lock= mysql_lock_tables(thd, &table_list->table, 1, 0,
- &refresh)))
+ if (! (thd->lock= mysql_lock_tables(thd, &table_list->table, 1,
+ lock_flags, &refresh)))
table= 0;
}
}
@@ -3547,6 +3964,148 @@ static void mark_real_tables_as_free_for_reuse(TABLE_LIST *table)
}
+/**
+ Decide on logging format to use for the statement.
+
+ Compute the capabilities vector for the involved storage engines
+ and mask out the flags for the binary log. Right now, the binlog
+ flags only include the capabilities of the storage engines, so this
+ is safe.
+
+ We now have three alternatives that prevent the statement from
+ being loggable:
+
+ 1. If there are no capabilities left (all flags are clear) it is
+ not possible to log the statement at all, so we roll back the
+ statement and report an error.
+
+ 2. Statement mode is set, but the capabilities indicate that
+ statement format is not possible.
+
+ 3. Row mode is set, but the capabilities indicate that row
+ format is not possible.
+
+ 4. Statement is unsafe, but the capabilities indicate that row
+ format is not possible.
+
+ If we are in MIXED mode, we then decide what logging format to use:
+
+ 1. If the statement is unsafe, row-based logging is used.
+
+ 2. If statement-based logging is not possible, row-based logging is
+ used.
+
+ 3. Otherwise, statement-based logging is used.
+
+ @param thd Client thread
+ @param tables Tables involved in the query
+ */
+
+int decide_logging_format(THD *thd, TABLE_LIST *tables)
+{
+ if (mysql_bin_log.is_open() && (thd->options & OPTION_BIN_LOG))
+ {
+ handler::Table_flags flags_some_set= handler::Table_flags();
+ handler::Table_flags flags_all_set= ~handler::Table_flags();
+ my_bool multi_engine= FALSE;
+ void* prev_ht= NULL;
+ for (TABLE_LIST *table= tables; table; table= table->next_global)
+ {
+ if (!table->placeholder() && table->lock_type >= TL_WRITE_ALLOW_WRITE)
+ {
+ ulonglong const flags= table->table->file->ha_table_flags();
+ DBUG_PRINT("info", ("table: %s; ha_table_flags: %s%s",
+ table->table_name,
+ FLAGSTR(flags, HA_BINLOG_STMT_CAPABLE),
+ FLAGSTR(flags, HA_BINLOG_ROW_CAPABLE)));
+ if (prev_ht && prev_ht != table->table->file->ht)
+ multi_engine= TRUE;
+ prev_ht= table->table->file->ht;
+ flags_all_set &= flags;
+ flags_some_set |= flags;
+ }
+ }
+
+ DBUG_PRINT("info", ("flags_all_set: %s%s",
+ FLAGSTR(flags_all_set, HA_BINLOG_STMT_CAPABLE),
+ FLAGSTR(flags_all_set, HA_BINLOG_ROW_CAPABLE)));
+ DBUG_PRINT("info", ("flags_some_set: %s%s",
+ FLAGSTR(flags_some_set, HA_BINLOG_STMT_CAPABLE),
+ FLAGSTR(flags_some_set, HA_BINLOG_ROW_CAPABLE)));
+ DBUG_PRINT("info", ("thd->variables.binlog_format: %ld",
+ thd->variables.binlog_format));
+ DBUG_PRINT("info", ("multi_engine: %s",
+ multi_engine ? "TRUE" : "FALSE"));
+
+ int error= 0;
+ if (flags_all_set == 0)
+ {
+ my_error((error= ER_BINLOG_LOGGING_IMPOSSIBLE), MYF(0),
+ "Statement cannot be logged to the binary log in"
+ " row-based nor statement-based format");
+ }
+ else if (thd->variables.binlog_format == BINLOG_FORMAT_STMT &&
+ (flags_all_set & HA_BINLOG_STMT_CAPABLE) == 0)
+ {
+ my_error((error= ER_BINLOG_LOGGING_IMPOSSIBLE), MYF(0),
+ "Statement-based format required for this statement,"
+ " but not allowed by this combination of engines");
+ }
+ else if ((thd->variables.binlog_format == BINLOG_FORMAT_ROW ||
+ thd->lex->is_stmt_unsafe()) &&
+ (flags_all_set & HA_BINLOG_ROW_CAPABLE) == 0)
+ {
+ my_error((error= ER_BINLOG_LOGGING_IMPOSSIBLE), MYF(0),
+ "Row-based format required for this statement,"
+ " but not allowed by this combination of engines");
+ }
+
+ /*
+ If more than one engine is involved in the statement and at
+ least one is doing it's own logging (is *self-logging*), the
+ statement cannot be logged atomically, so we generate an error
+ rather than allowing the binlog to become corrupt.
+ */
+ if (multi_engine &&
+ (flags_some_set & HA_HAS_OWN_BINLOGGING))
+ {
+ error= ER_BINLOG_LOGGING_IMPOSSIBLE;
+ my_error(error, MYF(0),
+ "Statement cannot be written atomically since more"
+ " than one engine involved and at least one engine"
+ " is self-logging");
+ }
+
+ DBUG_PRINT("info", ("error: %d", error));
+
+ if (error)
+ {
+ ha_rollback_stmt(thd);
+ return -1;
+ }
+
+ /*
+ We switch to row-based format if we are in mixed mode and one of
+ the following are true:
+
+ 1. If the statement is unsafe
+ 2. If statement format cannot be used
+
+ Observe that point to cannot be decided before the tables
+ involved in a statement has been checked, i.e., we cannot put
+ this code in reset_current_stmt_binlog_row_based(), it has to be
+ here.
+ */
+ if (thd->lex->is_stmt_unsafe() ||
+ (flags_all_set & HA_BINLOG_STMT_CAPABLE) == 0)
+ {
+ thd->set_current_stmt_binlog_row_based_if_mixed();
+ }
+ }
+
+ return 0;
+}
+
/*
Lock all tables in list
@@ -3585,17 +4144,10 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen)
in prelocked mode.
*/
DBUG_ASSERT(!thd->prelocked_mode || !thd->lex->requires_prelocking());
-
*need_reopen= FALSE;
- /*
- CREATE ... SELECT UUID() locks no tables, we have to test here.
- */
- if (thd->lex->binlog_row_based_if_mixed)
- thd->set_current_stmt_binlog_row_based_if_mixed();
-
if (!tables && !thd->lex->requires_prelocking())
- DBUG_RETURN(0);
+ DBUG_RETURN(decide_logging_format(thd, tables));
/*
We need this extra check for thd->prelocked_mode because we want to avoid
@@ -3610,6 +4162,7 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen)
{
DBUG_ASSERT(thd->lock == 0); // You must lock everything at once
TABLE **start,**ptr;
+ uint lock_flag= MYSQL_LOCK_NOTIFY_IF_NEED_REOPEN;
if (!(ptr=start=(TABLE**) thd->alloc(sizeof(TABLE*)*count)))
DBUG_RETURN(-1);
@@ -3632,14 +4185,13 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen)
if (thd->variables.binlog_format == BINLOG_FORMAT_MIXED &&
has_two_write_locked_tables_with_auto_increment(tables))
{
- thd->lex->binlog_row_based_if_mixed= TRUE;
+ thd->lex->set_stmt_unsafe();
thd->set_current_stmt_binlog_row_based_if_mixed();
}
}
if (! (thd->lock= mysql_lock_tables(thd, start, (uint) (ptr - start),
- MYSQL_LOCK_NOTIFY_IF_NEED_REOPEN,
- need_reopen)))
+ lock_flag, need_reopen)))
{
if (thd->lex->requires_prelocking())
{
@@ -3648,6 +4200,7 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen)
}
DBUG_RETURN(-1);
}
+
if (thd->lex->requires_prelocking() &&
thd->lex->sql_command != SQLCOM_LOCK_TABLES)
{
@@ -3714,7 +4267,8 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen)
thd->prelocked_mode= PRELOCKED_UNDER_LOCK_TABLES;
}
}
- DBUG_RETURN(0);
+
+ DBUG_RETURN(decide_logging_format(thd, tables));
}
@@ -3953,8 +4507,7 @@ find_field_in_view(THD *thd, TABLE_LIST *table_list,
table_list->alias, name, item_name, (ulong) ref));
Field_iterator_view field_it;
field_it.set(table_list);
- Query_arena *arena, backup;
- LINT_INIT(arena);
+ Query_arena *arena= 0, backup;
DBUG_ASSERT(table_list->schema_table_reformed ||
(ref != 0 && table_list->view != 0));
@@ -3963,14 +4516,14 @@ find_field_in_view(THD *thd, TABLE_LIST *table_list,
if (!my_strcasecmp(system_charset_info, field_it.name(), name))
{
// in PS use own arena or data will be freed after prepare
- if (register_tree_change)
+ if (register_tree_change && thd->stmt_arena->is_stmt_prepare_or_first_sp_execute())
arena= thd->activate_stmt_arena_if_needed(&backup);
/*
create_item() may, or may not create a new Item, depending on
the column reference. See create_view_field() for details.
*/
Item *item= field_it.create_item(thd);
- if (register_tree_change && arena)
+ if (arena)
thd->restore_active_arena(arena, &backup);
if (!item)
@@ -4157,7 +4710,7 @@ 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, (byte*) name,
+ field_ptr= (Field**) hash_search(&table->s->name_hash, (uchar*) name,
length);
if (field_ptr)
{
@@ -4365,7 +4918,7 @@ find_field_in_table_ref(THD *thd, TABLE_LIST *table_list,
else
{
if (thd->mark_used_columns == MARK_COLUMNS_READ)
- it->walk(&Item::register_field_in_read_map, 1, (byte *) 0);
+ it->walk(&Item::register_field_in_read_map, 1, (uchar *) 0);
}
}
else
@@ -4404,7 +4957,7 @@ 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,(byte*) name,
+ field_ptr= (Field**)hash_search(&table->s->name_hash,(uchar*) name,
strlen(name));
if (field_ptr)
{
@@ -6177,6 +6730,7 @@ int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves,
DBUG_PRINT("info", ("thd->mark_used_columns: %d", thd->mark_used_columns));
select_lex->cond_count= 0;
select_lex->between_count= 0;
+ select_lex->max_equal_elems= 0;
for (table= tables; table; table= table->next_local)
{
@@ -6410,7 +6964,7 @@ fill_record(THD *thd, Field **ptr, List<Item> &values, bool ignore_errors)
table= (*ptr)->table;
table->auto_increment_field_not_null= FALSE;
}
- while ((field = *ptr++))
+ while ((field = *ptr++) && !thd->net.report_error)
{
value=v++;
table= field->table;
@@ -6496,14 +7050,15 @@ my_bool mysql_rm_tmp_tables(void)
(file->name[1] == '.' && !file->name[2])))
continue;
- if (!bcmp(file->name,tmp_file_prefix,tmp_file_prefix_length))
+ if (!bcmp((uchar*) file->name, (uchar*) tmp_file_prefix,
+ tmp_file_prefix_length))
{
char *ext= fn_ext(file->name);
uint ext_len= strlen(ext);
uint filePath_len= my_snprintf(filePath, sizeof(filePath),
"%s%c%s", tmpdir, FN_LIBCHAR,
file->name);
- if (!bcmp(reg_ext, ext, ext_len))
+ if (!bcmp((uchar*) reg_ext, (uchar*) ext, ext_len))
{
handler *handler_file= 0;
/* We should cut file extention before deleting of table */
@@ -6512,7 +7067,7 @@ my_bool mysql_rm_tmp_tables(void)
init_tmp_table_share(&share, "", 0, "", filePathCopy);
if (!open_table_def(thd, &share, 0) &&
((handler_file= get_new_handler(&share, thd->mem_root,
- share.db_type))))
+ share.db_type()))))
{
handler_file->delete_table(filePathCopy);
delete handler_file;
@@ -6566,7 +7121,7 @@ void remove_db_from_cache(const char *db)
}
}
while (unused_tables && !unused_tables->s->version)
- VOID(hash_delete(&open_cache,(byte*) unused_tables));
+ VOID(hash_delete(&open_cache,(uchar*) unused_tables));
}
@@ -6582,7 +7137,7 @@ void flush_tables()
{
(void) pthread_mutex_lock(&LOCK_open);
while (unused_tables)
- hash_delete(&open_cache,(byte*) unused_tables);
+ hash_delete(&open_cache,(uchar*) unused_tables);
(void) pthread_mutex_unlock(&LOCK_open);
}
@@ -6619,10 +7174,10 @@ 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, (byte*) key, key_length,
+ for (table= (TABLE*) hash_first(&open_cache, (uchar*) key, key_length,
&state);
table;
- table= (TABLE*) hash_next(&open_cache, (byte*) key, key_length,
+ table= (TABLE*) hash_next(&open_cache, (uchar*) key, key_length,
&state))
{
THD *in_use;
@@ -6636,8 +7191,13 @@ bool remove_table_from_cache(THD *thd, const char *db, const char *table_name,
else if (in_use != thd)
{
DBUG_PRINT("info", ("Table was in use by other thread"));
- in_use->some_tables_deleted=1;
- if (table->db_stat)
+ /*
+ Mark that table is going to be deleted from cache. This will
+ force threads that are in mysql_lock_tables() (but not yet
+ in thr_multi_lock()) to abort it's locks, close all tables and retry
+ */
+ in_use->some_tables_deleted= 1;
+ if (table->is_name_opened())
{
DBUG_PRINT("info", ("Found another active instance of the table"));
result=1;
@@ -6677,11 +7237,11 @@ 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,(byte*) unused_tables));
+ VOID(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,(byte*) key,
+ if ((share= (TABLE_SHARE*) hash_search(&table_def_cache,(uchar*) key,
key_length)))
{
DBUG_PRINT("info", ("share version: %lu ref_count: %u",
@@ -6690,7 +7250,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, (byte*) share));
+ VOID(hash_delete(&table_def_cache, (uchar*) share));
}
}
@@ -6932,10 +7492,10 @@ 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,(byte*) key,key_length,
+ for (table= (TABLE*) hash_first(&open_cache,(uchar*) key,key_length,
&state) ;
table;
- table= (TABLE*) hash_next(&open_cache,(byte*) key,key_length,
+ table= (TABLE*) hash_next(&open_cache,(uchar*) key,key_length,
&state))
{
THD *in_use= table->in_use;
@@ -7012,7 +7572,7 @@ has_two_write_locked_tables_with_auto_increment(TABLE_LIST *tables)
for (TABLE_LIST *table= tables; table; table= table->next_global)
{
/* we must do preliminary checks as table->table may be NULL */
- if (!table->placeholder() && !table->schema_table &&
+ if (!table->placeholder() &&
table->table->found_next_number_field &&
(table->lock_type >= TL_WRITE_ALLOW_WRITE))
{
@@ -7072,7 +7632,7 @@ open_system_tables_for_read(THD *thd, TABLE_LIST *table_list,
if (!table)
goto error;
- DBUG_ASSERT(table->s->system_table);
+ DBUG_ASSERT(table->s->table_category == TABLE_CATEGORY_SYSTEM);
table->use_all_columns();
table->reginfo.lock_type= tables->lock_type;
@@ -7139,12 +7699,106 @@ open_system_table_for_update(THD *thd, TABLE_LIST *one_table)
{
DBUG_ENTER("open_system_table_for_update");
- TABLE *table= open_ltable(thd, one_table, one_table->lock_type);
+ TABLE *table= open_ltable(thd, one_table, one_table->lock_type, 0);
if (table)
{
- DBUG_ASSERT(table->s->system_table);
+ DBUG_ASSERT(table->s->table_category == TABLE_CATEGORY_SYSTEM);
+ table->use_all_columns();
+ }
+
+ DBUG_RETURN(table);
+}
+
+/**
+ Open a performance schema table.
+ Opening such tables is performed internally in the server
+ implementation, and is a 'nested' open, since some tables
+ might be already opened by the current thread.
+ The thread context before this call is saved, and is restored
+ when calling close_performance_schema_table().
+ @param thd The current thread
+ @param one_table Performance schema table to open
+ @param backup [out] Temporary storage used to save the thread context
+*/
+TABLE *
+open_performance_schema_table(THD *thd, TABLE_LIST *one_table,
+ Open_tables_state *backup)
+{
+ uint flags= ( MYSQL_LOCK_IGNORE_GLOBAL_READ_LOCK |
+ MYSQL_LOCK_IGNORE_GLOBAL_READ_ONLY |
+ MYSQL_LOCK_IGNORE_FLUSH |
+ MYSQL_LOCK_PERF_SCHEMA);
+ TABLE *table;
+ /* Save value that is changed in mysql_lock_tables() */
+ ulonglong save_utime_after_lock= thd->utime_after_lock;
+ DBUG_ENTER("open_performance_schema_table");
+
+ thd->reset_n_backup_open_tables_state(backup);
+
+ if ((table= open_ltable(thd, one_table, one_table->lock_type, flags)))
+ {
+ DBUG_ASSERT(table->s->table_category == TABLE_CATEGORY_PERFORMANCE);
+ /* Make sure all columns get assigned to a default value */
table->use_all_columns();
+ table->no_replicate= 1;
+ /*
+ Don't set automatic timestamps as we may want to use time of logging,
+ not from query start
+ */
+ table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
}
+ else
+ thd->restore_backup_open_tables_state(backup);
+ thd->utime_after_lock= save_utime_after_lock;
DBUG_RETURN(table);
}
+
+/**
+ Close a performance schema table.
+ The last table opened by open_performance_schema_table()
+ is closed, then the thread context is restored.
+ @param thd The current thread
+ @param backup [in] the context to restore.
+*/
+void close_performance_schema_table(THD *thd, Open_tables_state *backup)
+{
+ bool found_old_table;
+
+ /*
+ If open_performance_schema_table() fails,
+ this function should not be called.
+ */
+ DBUG_ASSERT(thd->lock != NULL);
+
+ /*
+ Note:
+ We do not create explicitly a separate transaction for the
+ performance table I/O, but borrow the current transaction.
+ lock + unlock will autocommit the change done in the
+ performance schema table: this is the expected result.
+ The current transaction should not be affected by this code.
+ TODO: Note that if a transactional engine is used for log tables,
+ this code will need to be revised, as a separate transaction
+ might be needed.
+ */
+ mysql_unlock_tables(thd, thd->lock);
+ thd->lock= 0;
+
+ pthread_mutex_lock(&LOCK_open);
+
+ found_old_table= false;
+ while (thd->open_tables)
+ found_old_table|= close_thread_table(thd, &thd->open_tables);
+
+ if (found_old_table)
+ broadcast_refresh();
+
+ pthread_mutex_unlock(&LOCK_open);
+
+ thd->restore_backup_open_tables_state(backup);
+}
+
+/**
+ @} (end of group Data_Dictionary)
+*/
diff --git a/sql/sql_binlog.cc b/sql/sql_binlog.cc
index d3fdd95707c..a3a804db8f0 100644
--- a/sql/sql_binlog.cc
+++ b/sql/sql_binlog.cc
@@ -33,8 +33,8 @@ void mysql_client_binlog_statement(THD* thd)
{
DBUG_ENTER("mysql_client_binlog_statement");
DBUG_PRINT("info",("binlog base64: '%*s'",
- (thd->lex->comment.length < 2048 ?
- thd->lex->comment.length : 2048),
+ (int) (thd->lex->comment.length < 2048 ?
+ thd->lex->comment.length : 2048),
thd->lex->comment.str));
/*
@@ -44,15 +44,15 @@ void mysql_client_binlog_statement(THD* thd)
my_bool nsok= thd->net.no_send_ok;
thd->net.no_send_ok= TRUE;
- my_size_t coded_len= thd->lex->comment.length + 1;
- my_size_t decoded_len= base64_needed_decoded_length(coded_len);
+ size_t coded_len= thd->lex->comment.length + 1;
+ size_t decoded_len= base64_needed_decoded_length(coded_len);
DBUG_ASSERT(coded_len > 0);
/*
Allocation
*/
if (!thd->rli_fake)
- thd->rli_fake= new RELAY_LOG_INFO;
+ thd->rli_fake= new Relay_log_info;
const Format_description_log_event *desc=
new Format_description_log_event(4);
@@ -172,6 +172,7 @@ void mysql_client_binlog_statement(THD* thd)
not used at all: the rli_fake instance is used only for error
reporting.
*/
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
if (IF_DBUG(int err= ) ev->apply_event(thd->rli_fake))
{
DBUG_PRINT("info", ("apply_event() returned: %d", err));
@@ -182,6 +183,7 @@ void mysql_client_binlog_statement(THD* thd)
my_error(ER_UNKNOWN_ERROR, MYF(0), "Error executing BINLOG statement");
goto end;
}
+#endif
delete ev;
ev= 0;
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index ffe7f3309ab..a83bec5c79b 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -268,6 +268,39 @@ are stored in one block.
If join_results allocated new block(s) then we need call pack_cache again.
+7. Interface
+The query cache interfaces with the rest of the server code through 7
+functions:
+ 1. Query_cache::send_result_to_client
+ - Called before parsing and used to match a statement with the stored
+ queries hash.
+ If a match is found the cached result set is sent through repeated
+ calls to net_real_write. (note: calling thread doesn't have a regis-
+ tered result set writer: thd->net.query_cache_query=0)
+ 2. Query_cache::store_query
+ - Called just before handle_select() and is used to register a result
+ set writer to the statement currently being processed
+ (thd->net.query_cache_query).
+ 3. query_cache_insert
+ - Called from net_real_write to append a result set to a cached query
+ if (and only if) this query has a registered result set writer
+ (thd->net.query_cache_query).
+ 4. Query_cache::invalidate
+ - 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.
+ 5. Query_cache::flush
+ - Used when a RESET QUERY CACHE is issued. This clears the entire
+ cache block by block.
+ 6. Query_cache::resize
+ - Used to change the available memory used by the query cache. This
+ will also invalidate the entrie query cache in one free operation.
+ 7. Query_cache::pack
+ - Used when a FLUSH QUERY CACHE is issued. This changes the order of
+ the used memory blocks in physical memory order and move all avail-
+ able memory to the 'bottom' of the memory.
+
+
TODO list:
- Delayed till after-parsing qache answer (for column rights processing)
@@ -365,7 +398,7 @@ TYPELIB query_cache_type_typelib=
inline Query_cache_block * Query_cache_block_table::block()
{
- return (Query_cache_block *)(((byte*)this) -
+ return (Query_cache_block *)(((uchar*)this) -
ALIGN_SIZE(sizeof(Query_cache_block_table)*n) -
ALIGN_SIZE(sizeof(Query_cache_block)));
}
@@ -401,9 +434,9 @@ inline uint Query_cache_block::headers_len()
ALIGN_SIZE(sizeof(Query_cache_block)));
}
-inline gptr Query_cache_block::data(void)
+inline uchar* Query_cache_block::data(void)
{
- return (gptr)( ((byte*)this) + headers_len() );
+ return (uchar*)( ((uchar*)this) + headers_len() );
}
inline Query_cache_query * Query_cache_block::query()
@@ -437,7 +470,7 @@ inline Query_cache_result * Query_cache_block::result()
inline Query_cache_block_table * Query_cache_block::table(TABLE_COUNTER_TYPE n)
{
return ((Query_cache_block_table *)
- (((byte*)this)+ALIGN_SIZE(sizeof(Query_cache_block)) +
+ (((uchar*)this)+ALIGN_SIZE(sizeof(Query_cache_block)) +
n*sizeof(Query_cache_block_table)));
}
@@ -448,13 +481,13 @@ inline Query_cache_block_table * Query_cache_block::table(TABLE_COUNTER_TYPE n)
extern "C"
{
-byte *query_cache_table_get_key(const byte *record, uint *length,
+uchar *query_cache_table_get_key(const uchar *record, size_t *length,
my_bool not_used __attribute__((unused)))
{
Query_cache_block* table_block = (Query_cache_block*) record;
*length = (table_block->used - table_block->headers_len() -
ALIGN_SIZE(sizeof(Query_cache_table)));
- return (((byte *) table_block->data()) +
+ return (((uchar *) table_block->data()) +
ALIGN_SIZE(sizeof(Query_cache_table)));
}
}
@@ -522,7 +555,7 @@ void Query_cache_query::init_n_lock()
my_rwlock_init(&lock, NULL);
lock_writing();
DBUG_PRINT("qcache", ("inited & locked query for block 0x%lx",
- (long) (((byte*) this) -
+ (long) (((uchar*) this) -
ALIGN_SIZE(sizeof(Query_cache_block)))));
DBUG_VOID_RETURN;
}
@@ -532,7 +565,7 @@ void Query_cache_query::unlock_n_destroy()
{
DBUG_ENTER("Query_cache_query::unlock_n_destroy");
DBUG_PRINT("qcache", ("destroyed & unlocked query for block 0x%lx",
- (long) (((byte*) this) -
+ (long) (((uchar*) this) -
ALIGN_SIZE(sizeof(Query_cache_block)))));
/*
The following call is not needed on system where one can destroy an
@@ -546,13 +579,13 @@ void Query_cache_query::unlock_n_destroy()
extern "C"
{
-byte *query_cache_query_get_key(const byte *record, uint *length,
+uchar *query_cache_query_get_key(const uchar *record, size_t *length,
my_bool not_used)
{
Query_cache_block *query_block = (Query_cache_block*) record;
*length = (query_block->used - query_block->headers_len() -
ALIGN_SIZE(sizeof(Query_cache_query)));
- return (((byte *) query_block->data()) +
+ return (((uchar *) query_block->data()) +
ALIGN_SIZE(sizeof(Query_cache_query)));
}
}
@@ -615,49 +648,55 @@ void query_cache_insert(NET *net, const char *packet, ulong length)
DBUG_VOID_RETURN;
STRUCT_LOCK(&query_cache.structure_guard_mutex);
+ bool interrupt;
+ query_cache.wait_while_table_flush_is_in_progress(&interrupt);
+ if (interrupt)
+ {
+ STRUCT_UNLOCK(&query_cache.structure_guard_mutex);
+ return;
+ }
- if (unlikely(query_cache.query_cache_size == 0 ||
- query_cache.flush_in_progress))
+ Query_cache_block *query_block= (Query_cache_block*)net->query_cache_query;
+ if (!query_block)
{
+ /*
+ We lost the writer and the currently processed query has been
+ invalidated; there is nothing left to do.
+ */
STRUCT_UNLOCK(&query_cache.structure_guard_mutex);
DBUG_VOID_RETURN;
}
- Query_cache_block *query_block = ((Query_cache_block*)
- net->query_cache_query);
- if (query_block)
- {
- Query_cache_query *header = query_block->query();
- Query_cache_block *result = header->result();
+ Query_cache_query *header= query_block->query();
+ Query_cache_block *result= header->result();
- DUMP(&query_cache);
- BLOCK_LOCK_WR(query_block);
- DBUG_PRINT("qcache", ("insert packet %lu bytes long",length));
+ DUMP(&query_cache);
+ BLOCK_LOCK_WR(query_block);
+ DBUG_PRINT("qcache", ("insert packet %lu bytes long",length));
- /*
- On success STRUCT_UNLOCK(&query_cache.structure_guard_mutex) will be
- done by query_cache.append_result_data if success (if not we need
- query_cache.structure_guard_mutex locked to free query)
- */
- if (!query_cache.append_result_data(&result, length, (gptr) packet,
- query_block))
- {
- DBUG_PRINT("warning", ("Can't append data"));
- header->result(result);
- DBUG_PRINT("qcache", ("free query 0x%lx", (ulong) query_block));
- // The following call will remove the lock on query_block
- query_cache.free_query(query_block);
- // append_result_data no success => we need unlock
- STRUCT_UNLOCK(&query_cache.structure_guard_mutex);
- DBUG_VOID_RETURN;
- }
+ /*
+ On success, STRUCT_UNLOCK is done by append_result_data. Otherwise, we
+ 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))
+ {
+ DBUG_PRINT("warning", ("Can't append data"));
header->result(result);
- header->last_pkt_nr= net->pkt_nr;
- BLOCK_UNLOCK_WR(query_block);
- DBUG_EXECUTE("check_querycache",query_cache.check_integrity(0););
- }
- else
+ DBUG_PRINT("qcache", ("free query 0x%lx", (ulong) query_block));
+ // The following call will remove the lock on query_block
+ query_cache.free_query(query_block);
+ // append_result_data no success => we need unlock
STRUCT_UNLOCK(&query_cache.structure_guard_mutex);
+ DBUG_VOID_RETURN;
+ }
+
+ header->result(result);
+ header->last_pkt_nr= net->pkt_nr;
+ BLOCK_UNLOCK_WR(query_block);
+ DBUG_EXECUTE("check_querycache",query_cache.check_integrity(0););
+
DBUG_VOID_RETURN;
}
@@ -672,17 +711,21 @@ void query_cache_abort(NET *net)
DBUG_VOID_RETURN;
STRUCT_LOCK(&query_cache.structure_guard_mutex);
-
- if (unlikely(query_cache.query_cache_size == 0 ||
- query_cache.flush_in_progress))
+ bool interrupt;
+ query_cache.wait_while_table_flush_is_in_progress(&interrupt);
+ if (interrupt)
{
STRUCT_UNLOCK(&query_cache.structure_guard_mutex);
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);
- if (query_block) // Test if changed by other thread
+ if (query_block)
{
thd_proc_info(thd, "storing result in query cache");
DUMP(&query_cache);
@@ -708,6 +751,12 @@ void query_cache_end_of_result(THD *thd)
if (thd->net.query_cache_query == 0)
DBUG_VOID_RETURN;
+ if (thd->killed)
+ {
+ query_cache_abort(&thd->net);
+ DBUG_VOID_RETURN;
+ }
+
#ifdef EMBEDDED_LIBRARY
query_cache_insert(&thd->net, (char*)thd,
emb_count_querycache_size(thd));
@@ -715,48 +764,63 @@ void query_cache_end_of_result(THD *thd)
STRUCT_LOCK(&query_cache.structure_guard_mutex);
- if (unlikely(query_cache.query_cache_size == 0 ||
- query_cache.flush_in_progress))
- goto end;
+ bool interrupt;
+ query_cache.wait_while_table_flush_is_in_progress(&interrupt);
+ if (interrupt)
+ {
+ STRUCT_UNLOCK(&query_cache.structure_guard_mutex);
+ DBUG_VOID_RETURN;
+ }
query_block= ((Query_cache_block*) thd->net.query_cache_query);
if (query_block)
{
+ /*
+ The writer is still present; finish last result block by chopping it to
+ suitable size if needed and setting block type. Since this is the last
+ block, the writer should be dropped.
+ */
thd_proc_info(thd, "storing result in query cache");
DUMP(&query_cache);
BLOCK_LOCK_WR(query_block);
Query_cache_query *header= query_block->query();
- Query_cache_block *last_result_block= header->result()->prev;
- ulong allign_size= ALIGN_SIZE(last_result_block->used);
- ulong len= max(query_cache.min_allocation_unit, allign_size);
- if (last_result_block->length >= query_cache.min_allocation_unit + len)
- query_cache.split_block(last_result_block,len);
+ Query_cache_block *last_result_block;
+ ulong allign_size;
+ ulong len;
-#ifndef DBUG_OFF
if (header->result() == 0)
{
- DBUG_PRINT("error", ("end of data whith no result. query '%s'",
- header->query()));
- query_cache.wreck(__LINE__, "");
-
+ DBUG_PRINT("error", ("End of data with no result blocks; "
+ "Query '%s' removed from cache.", header->query()));
/*
- We do not need call of BLOCK_UNLOCK_WR(query_block); here because
- query_cache.wreck() switched query cache off but left content
- untouched for investigation (it is debugging method).
+ Extra safety: empty result should not happen in the normal call
+ to this function. In the release version that query should be ignored
+ and removed from QC.
*/
- goto end;
+ DBUG_ASSERT(0);
+ query_cache.free_query(query_block);
+ STRUCT_UNLOCK(&query_cache.structure_guard_mutex);
+ DBUG_VOID_RETURN;
}
-#endif
+
+ last_result_block= header->result()->prev;
+ allign_size= ALIGN_SIZE(last_result_block->used);
+ len= max(query_cache.min_allocation_unit, allign_size);
+ 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->result()->type= Query_cache_block::RESULT;
+
+ /* Drop the writer. */
header->writer(0);
thd->net.query_cache_query= 0;
+
BLOCK_UNLOCK_WR(query_block);
DBUG_EXECUTE("check_querycache",query_cache.check_integrity(1););
}
-end:
STRUCT_UNLOCK(&query_cache.structure_guard_mutex);
DBUG_VOID_RETURN;
}
@@ -768,6 +832,18 @@ void query_cache_invalidate_by_MyISAM_filename(const char *filename)
}
+/*
+ The following function forms part of the C plugin API
+*/
+extern "C"
+void mysql_query_cache_invalidate4(THD *thd,
+ const char *key, unsigned key_length,
+ int using_trx)
+{
+ query_cache.invalidate(thd, key, (uint32) key_length, (my_bool) using_trx);
+}
+
+
/*****************************************************************************
Query_cache methods
*****************************************************************************/
@@ -798,16 +874,31 @@ Query_cache::Query_cache(ulong query_cache_limit_arg,
ulong Query_cache::resize(ulong query_cache_size_arg)
{
+ ulong new_query_cache_size;
DBUG_ENTER("Query_cache::resize");
DBUG_PRINT("qcache", ("from %lu to %lu",query_cache_size,
query_cache_size_arg));
DBUG_ASSERT(initialized);
+
STRUCT_LOCK(&structure_guard_mutex);
+ while (is_flushing())
+ pthread_cond_wait(&COND_cache_status_changed, &structure_guard_mutex);
+ m_cache_status= Query_cache::FLUSH_IN_PROGRESS;
+ STRUCT_UNLOCK(&structure_guard_mutex);
+
free_cache();
+
query_cache_size= query_cache_size_arg;
- ::query_cache_size= init_cache();
+ new_query_cache_size= init_cache();
+
+ STRUCT_LOCK(&structure_guard_mutex);
+ m_cache_status= Query_cache::NO_FLUSH_IN_PROGRESS;
+ pthread_cond_signal(&COND_cache_status_changed);
+ if (new_query_cache_size)
+ DBUG_EXECUTE("check_querycache",check_integrity(1););
STRUCT_UNLOCK(&structure_guard_mutex);
- DBUG_RETURN(::query_cache_size);
+
+ DBUG_RETURN(new_query_cache_size);
}
@@ -870,10 +961,13 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used)
flags.max_sort_length= thd->variables.max_sort_length;
flags.lc_time_names= thd->variables.lc_time_names;
flags.group_concat_max_len= thd->variables.group_concat_max_len;
+ flags.div_precision_increment= thd->variables.div_precincrement;
+ flags.default_week_format= thd->variables.default_week_format;
DBUG_PRINT("qcache", ("\
long %d, 4.1: %d, bin_proto: %d, more results %d, pkt_nr: %d, \
CS client: %u, CS result: %u, CS conn: %u, limit: %lu, TZ: 0x%lx, \
-sql mode: 0x%lx, sort len: %lu, conncat len: %lu",
+sql mode: 0x%lx, sort len: %lu, conncat len: %lu, div_precision: %lu, \
+def_week_frmt: %lu",
(int)flags.client_long_flag,
(int)flags.client_protocol_41,
(int)flags.result_in_binary_protocol,
@@ -886,7 +980,9 @@ sql mode: 0x%lx, sort len: %lu, conncat len: %lu",
(ulong) flags.time_zone,
flags.sql_mode,
flags.max_sort_length,
- flags.group_concat_max_len));
+ flags.group_concat_max_len,
+ flags.div_precision_increment,
+ flags.default_week_format));
/*
Make InnoDB to release the adaptive hash index latch before
acquiring the query cache mutex.
@@ -894,8 +990,13 @@ sql mode: 0x%lx, sort len: %lu, conncat len: %lu",
ha_release_temporary_latches(thd);
STRUCT_LOCK(&structure_guard_mutex);
- if (query_cache_size == 0 || flush_in_progress)
+ if (query_cache_size == 0 || is_flushing())
{
+ /*
+ A table- or a full flush operation can potentially take a long time to
+ finish. We choose not to wait for them and skip caching statements
+ instead.
+ */
STRUCT_UNLOCK(&structure_guard_mutex);
DBUG_VOID_RETURN;
}
@@ -930,15 +1031,15 @@ sql mode: 0x%lx, sort len: %lu, conncat len: %lu",
/* Check if another thread is processing the same query? */
Query_cache_block *competitor = (Query_cache_block *)
- hash_search(&queries, (byte*) thd->query, tot_length);
+ hash_search(&queries, (uchar*) thd->query, tot_length);
DBUG_PRINT("qcache", ("competitor 0x%lx", (ulong) competitor));
if (competitor == 0)
{
/* Query is not in cache and no one is working with it; Store it */
Query_cache_block *query_block;
- query_block= write_block_data(tot_length, (gptr) thd->query,
+ query_block= write_block_data(tot_length, (uchar*) thd->query,
ALIGN_SIZE(sizeof(Query_cache_query)),
- Query_cache_block::QUERY, local_tables, 1);
+ Query_cache_block::QUERY, local_tables);
if (query_block != 0)
{
DBUG_PRINT("qcache", ("query block 0x%lx allocated, %lu",
@@ -946,7 +1047,7 @@ sql mode: 0x%lx, sort len: %lu, conncat len: %lu",
Query_cache_query *header = query_block->query();
header->init_n_lock();
- if (my_hash_insert(&queries, (byte*) query_block))
+ if (my_hash_insert(&queries, (uchar*) query_block))
{
refused++;
DBUG_PRINT("qcache", ("insertion in query hash"));
@@ -959,7 +1060,7 @@ sql mode: 0x%lx, sort len: %lu, conncat len: %lu",
{
refused++;
DBUG_PRINT("warning", ("tables list including failed"));
- hash_delete(&queries, (byte *) query_block);
+ hash_delete(&queries, (uchar *) query_block);
header->unlock_n_destroy();
free_memory_block(query_block);
STRUCT_UNLOCK(&structure_guard_mutex);
@@ -968,7 +1069,7 @@ sql mode: 0x%lx, sort len: %lu, conncat len: %lu",
double_linked_list_simple_include(query_block, &queries_blocks);
inserts++;
queries_in_cache++;
- net->query_cache_query= (gptr) query_block;
+ net->query_cache_query= (uchar*) query_block;
header->writer(net);
header->tables_type(tables_type);
@@ -1072,13 +1173,21 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
}
STRUCT_LOCK(&structure_guard_mutex);
- if (query_cache_size == 0 || flush_in_progress)
+
+ if (query_cache_size == 0)
+ goto err_unlock;
+
+ if (is_flushing())
{
- DBUG_PRINT("qcache", ("query cache disabled"));
+ /* Return; Query cache is temporarily disabled while we flush. */
+ DBUG_PRINT("qcache",("query cache disabled"));
goto err_unlock;
}
- /* Check that we haven't forgot to reset the query cache variables */
+ /*
+ 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;
@@ -1117,11 +1226,14 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
flags.sql_mode= thd->variables.sql_mode;
flags.max_sort_length= thd->variables.max_sort_length;
flags.group_concat_max_len= thd->variables.group_concat_max_len;
+ flags.div_precision_increment= thd->variables.div_precincrement;
+ flags.default_week_format= thd->variables.default_week_format;
flags.lc_time_names= thd->variables.lc_time_names;
DBUG_PRINT("qcache", ("\
long %d, 4.1: %d, bin_proto: %d, more results %d, pkt_nr: %d, \
CS client: %u, CS result: %u, CS conn: %u, limit: %lu, TZ: 0x%lx, \
-sql mode: 0x%lx, sort len: %lu, conncat len: %lu",
+sql mode: 0x%lx, sort len: %lu, conncat len: %lu, div_precision: %lu, \
+def_week_frmt: %lu",
(int)flags.client_long_flag,
(int)flags.client_protocol_41,
(int)flags.result_in_binary_protocol,
@@ -1134,10 +1246,12 @@ sql mode: 0x%lx, sort len: %lu, conncat len: %lu",
(ulong) flags.time_zone,
flags.sql_mode,
flags.max_sort_length,
- flags.group_concat_max_len));
- memcpy((void *)(sql + (tot_length - QUERY_CACHE_FLAGS_SIZE)),
- &flags, QUERY_CACHE_FLAGS_SIZE);
- query_block = (Query_cache_block *) hash_search(&queries, (byte*) sql,
+ flags.group_concat_max_len,
+ flags.div_precision_increment,
+ flags.default_week_format));
+ 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);
/* Quick abort on unlocked data */
if (query_block == 0 ||
@@ -1249,7 +1363,9 @@ sql mode: 0x%lx, sort len: %lu, conncat len: %lu",
("Handler require invalidation queries of %s.%s %lu-%lu",
table_list.db, table_list.alias,
(ulong) engine_data, (ulong) table->engine_data()));
- invalidate_table((byte *) table->db(), table->key_length());
+ invalidate_table_internal(thd,
+ (uchar *) table->db(),
+ table->key_length());
}
else
thd->lex->safe_to_cache_query= 0; // Don't try to cache this
@@ -1313,32 +1429,26 @@ void Query_cache::invalidate(THD *thd, TABLE_LIST *tables_used,
my_bool using_transactions)
{
DBUG_ENTER("Query_cache::invalidate (table list)");
- STRUCT_LOCK(&structure_guard_mutex);
- if (query_cache_size > 0 && !flush_in_progress)
- {
- DUMP(this);
- using_transactions= using_transactions &&
- (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
- for (; tables_used; tables_used= tables_used->next_local)
- {
- DBUG_ASSERT(!using_transactions || tables_used->table!=0);
- if (tables_used->derived)
- continue;
- if (using_transactions &&
- (tables_used->table->file->table_cache_type() ==
- HA_CACHE_TBL_TRANSACT))
- /*
- Tables_used->table can't be 0 in transaction.
- Only 'drop' invalidate not opened table, but 'drop'
- force transaction finish.
- */
- thd->add_changed_table(tables_used->table);
- else
- invalidate_table(tables_used);
- }
+ using_transactions= using_transactions &&
+ (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
+ for (; tables_used; tables_used= tables_used->next_local)
+ {
+ DBUG_ASSERT(!using_transactions || tables_used->table!=0);
+ if (tables_used->derived)
+ continue;
+ if (using_transactions &&
+ (tables_used->table->file->table_cache_type() ==
+ HA_CACHE_TBL_TRANSACT))
+ /*
+ tables_used->table can't be 0 in transaction.
+ Only 'drop' invalidate not opened table, but 'drop'
+ force transaction finish.
+ */
+ thd->add_changed_table(tables_used->table);
+ else
+ invalidate_table(thd, tables_used);
}
- STRUCT_UNLOCK(&structure_guard_mutex);
DBUG_VOID_RETURN;
}
@@ -1347,22 +1457,14 @@ void Query_cache::invalidate(CHANGED_TABLE_LIST *tables_used)
{
THD *thd= current_thd;
DBUG_ENTER("Query_cache::invalidate (changed table list)");
- if (tables_used)
+ THD *thd= current_thd;
+ for (; tables_used; tables_used= tables_used->next)
{
thd_proc_info(thd, "invalidating query cache entries (table list)");
- STRUCT_LOCK(&structure_guard_mutex);
- if (query_cache_size > 0 && !flush_in_progress)
- {
- DUMP(this);
- for (; tables_used; tables_used= tables_used->next)
- {
- invalidate_table((byte*) tables_used->key, tables_used->key_length);
- DBUG_PRINT("qcache", ("db: %s table: %s", tables_used->key,
- tables_used->key+
- strlen(tables_used->key)+1));
- }
- }
- STRUCT_UNLOCK(&structure_guard_mutex);
+ invalidate_table(thd, (uchar*) tables_used->key, tables_used->key_length);
+ DBUG_PRINT("qcache", ("db: %s table: %s", tables_used->key,
+ tables_used->key+
+ strlen(tables_used->key)+1));
}
DBUG_VOID_RETURN;
}
@@ -1382,21 +1484,15 @@ void Query_cache::invalidate_locked_for_write(TABLE_LIST *tables_used)
{
THD *thd= current_thd;
DBUG_ENTER("Query_cache::invalidate_locked_for_write");
- if (tables_used)
+ for (; tables_used; tables_used= tables_used->next_local)
{
thd_proc_info(thd, "invalidating query cache entries (table)");
- STRUCT_LOCK(&structure_guard_mutex);
- if (query_cache_size > 0 && !flush_in_progress)
+ if (tables_used->lock_type & (TL_WRITE_LOW_PRIORITY | TL_WRITE) &&
+ tables_used->table)
{
- DUMP(this);
- for (; tables_used; tables_used= tables_used->next_local)
- {
- if (tables_used->lock_type & (TL_WRITE_LOW_PRIORITY | TL_WRITE) &&
- tables_used->table)
- invalidate_table(tables_used->table);
- }
+ THD *thd= current_thd;
+ invalidate_table(thd, tables_used->table);
}
- STRUCT_UNLOCK(&structure_guard_mutex);
}
DBUG_VOID_RETURN;
}
@@ -1410,18 +1506,14 @@ void Query_cache::invalidate(THD *thd, TABLE *table,
{
DBUG_ENTER("Query_cache::invalidate (table)");
- STRUCT_LOCK(&structure_guard_mutex);
- if (query_cache_size > 0 && !flush_in_progress)
- {
- using_transactions= using_transactions &&
- (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
- if (using_transactions &&
- (table->file->table_cache_type() == HA_CACHE_TBL_TRANSACT))
- thd->add_changed_table(table);
- else
- invalidate_table(table);
- }
- STRUCT_UNLOCK(&structure_guard_mutex);
+ using_transactions= using_transactions &&
+ (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
+ if (using_transactions &&
+ (table->file->table_cache_type() == HA_CACHE_TBL_TRANSACT))
+ thd->add_changed_table(table);
+ else
+ invalidate_table(thd, table);
+
DBUG_VOID_RETURN;
}
@@ -1430,57 +1522,130 @@ void Query_cache::invalidate(THD *thd, const char *key, uint32 key_length,
my_bool using_transactions)
{
DBUG_ENTER("Query_cache::invalidate (key)");
-
- STRUCT_LOCK(&structure_guard_mutex);
- if (query_cache_size > 0 && !flush_in_progress)
- {
- thd_proc_info(thd, "invalidating query cache entries (key)");
- using_transactions= using_transactions &&
- (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
- if (using_transactions) // used for innodb => has_transactions() is TRUE
- thd->add_changed_table(key, key_length);
- else
- invalidate_table((byte*)key, key_length);
- }
- STRUCT_UNLOCK(&structure_guard_mutex);
+
+ using_transactions= using_transactions &&
+ (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
+ if (using_transactions) // used for innodb => has_transactions() is TRUE
+ thd->add_changed_table(key, key_length);
+ else
+ invalidate_table(thd, (uchar*)key, key_length);
DBUG_VOID_RETURN;
}
-/*
- Remove all cached queries that uses the given database
+
+/**
+ @brief Synchronize the thread with any flushing operations.
+
+ This helper function is called whenever a thread needs to operate on the
+ query cache structure (example: during invalidation). If a table flush is in
+ progress this function will wait for it to stop. If a full flush is in
+ progress, the function will set the interrupt parameter to indicate that the
+ current operation is redundant and should be interrupted.
+
+ @param[out] interrupt This out-parameter will be set to TRUE if the calling
+ function is redundant and should be interrupted.
+
+ @return If the interrupt-parameter is TRUE then m_cache_status is set to
+ NO_FLUSH_IN_PROGRESS. If the interrupt-parameter is FALSE then
+ m_cache_status is set to FLUSH_IN_PROGRESS.
+ The structure_guard_mutex will in any case be locked.
+*/
+
+void Query_cache::wait_while_table_flush_is_in_progress(bool *interrupt)
+{
+ while (is_flushing())
+ {
+ /*
+ If there already is a full flush in progress query cache isn't enabled
+ and additional flushes are redundant; just return instead.
+ */
+ if (m_cache_status == Query_cache::FLUSH_IN_PROGRESS)
+ {
+ *interrupt= TRUE;
+ return;
+ }
+ /*
+ If a table flush is in progress; wait on cache status to change.
+ */
+ if (m_cache_status == Query_cache::TABLE_FLUSH_IN_PROGRESS)
+ pthread_cond_wait(&COND_cache_status_changed, &structure_guard_mutex);
+ }
+ *interrupt= FALSE;
+}
+
+
+/**
+ @brief Remove all cached queries that uses the given database
*/
void Query_cache::invalidate(char *db)
{
+ bool restart= FALSE;
DBUG_ENTER("Query_cache::invalidate (db)");
+
STRUCT_LOCK(&structure_guard_mutex);
- if (query_cache_size > 0 && !flush_in_progress)
+ bool interrupt;
+ wait_while_table_flush_is_in_progress(&interrupt);
+ if (interrupt)
+ {
+ STRUCT_UNLOCK(&structure_guard_mutex);
+ return;
+ }
+
+ THD *thd= current_thd;
+
+ if (query_cache_size > 0)
{
- DUMP(this);
- restart_search:
if (tables_blocks)
{
- Query_cache_block *curr= tables_blocks;
- Query_cache_block *next;
- do
- {
- next= curr->next;
- if (strcmp(db, (char*)(curr->table()->db())) == 0)
- invalidate_table(curr);
+ Query_cache_block *table_block = tables_blocks;
+ do {
+ restart= FALSE;
+ do
+ {
+ Query_cache_block *next= table_block->next;
+ Query_cache_table *table = table_block->table();
+ if (strcmp(table->db(),db) == 0)
+ {
+ Query_cache_block_table *list_root= table_block->table(0);
+ invalidate_query_block_list(thd,list_root);
+ }
+
+ table_block= next;
+
+ /*
+ If our root node to used tables became null then the last element
+ in the table list was removed when a query was invalidated;
+ Terminate the search.
+ */
+ if (tables_blocks == 0)
+ {
+ table_block= tables_blocks;
+ }
+ /*
+ If the iterated list has changed underlying structure;
+ we need to restart the search.
+ */
+ else if (table_block->type == Query_cache_block::FREE)
+ {
+ restart= TRUE;
+ table_block= tables_blocks;
+ }
+ /*
+ The used tables are linked in a circular list;
+ loop until we return to the begining.
+ */
+ } while (table_block != tables_blocks);
/*
- invalidate_table can freed block on which point 'next' (if
- table of this block used only in queries which was deleted
- by invalidate_table). As far as we do not allocate new blocks
- and mark all headers of freed blocks as 'FREE' (even if they are
- merged with other blocks) we can just test type of block
- to be sure that block is not deleted
+ Invalidating a table will also mean that all cached queries using
+ this table also will be invalidated. This will in turn change the
+ list of tables associated with these queries and the linked list of
+ used table will be changed. Because of this we might need to restart
+ the search when a table has been invalidated.
*/
- if (next->type == Query_cache_block::FREE)
- goto restart_search;
- curr= next;
- } while (curr != tables_blocks);
- }
+ } while (restart);
+ } // end if( tables_blocks )
}
STRUCT_UNLOCK(&structure_guard_mutex);
@@ -1492,21 +1657,12 @@ void Query_cache::invalidate_by_MyISAM_filename(const char *filename)
{
DBUG_ENTER("Query_cache::invalidate_by_MyISAM_filename");
- STRUCT_LOCK(&structure_guard_mutex);
- if (query_cache_size > 0 && !flush_in_progress)
- {
- /* Calculate the key outside the lock to make the lock shorter */
- char key[MAX_DBKEY_LENGTH];
- uint32 db_length;
- uint key_length= filename_2_table_key(key, filename, &db_length);
- Query_cache_block *table_block;
- if ((table_block = (Query_cache_block*) hash_search(&tables,
- (byte*) key,
- key_length)))
- invalidate_table(table_block);
- }
- STRUCT_UNLOCK(&structure_guard_mutex);
-
+ /* Calculate the key outside the lock to make the lock shorter */
+ char key[MAX_DBKEY_LENGTH];
+ uint32 db_length;
+ uint key_length= filename_2_table_key(key, filename, &db_length);
+ THD *thd= current_thd;
+ invalidate_table(thd,(uchar *)key, key_length);
DBUG_VOID_RETURN;
}
@@ -1528,16 +1684,43 @@ void Query_cache::flush()
DBUG_VOID_RETURN;
}
- /* Join result in cache in 1 block (if result length > join_limit) */
+
+/**
+ @brief Rearrange the memory blocks and join result in cache in 1 block (if
+ result length > join_limit)
+
+ @param[in] join_limit If the minimum length of a result block to be joined.
+ @param[in] iteration_limit The maximum number of packing and joining
+ sequences.
+
+*/
void Query_cache::pack(ulong join_limit, uint iteration_limit)
{
DBUG_ENTER("Query_cache::pack");
+
+ bool interrupt;
+ STRUCT_LOCK(&structure_guard_mutex);
+ wait_while_table_flush_is_in_progress(&interrupt);
+ if (interrupt)
+ {
+ STRUCT_UNLOCK(&structure_guard_mutex);
+ DBUG_VOID_RETURN;
+ }
+
+ if (query_cache_size == 0)
+ {
+ STRUCT_UNLOCK(&structure_guard_mutex);
+ DBUG_VOID_RETURN;
+ }
+
uint i = 0;
do
{
pack_cache();
} while ((++i < iteration_limit) && join_results(join_limit));
+
+ STRUCT_UNLOCK(&structure_guard_mutex);
DBUG_VOID_RETURN;
}
@@ -1556,7 +1739,7 @@ void Query_cache::destroy()
free_cache();
STRUCT_UNLOCK(&structure_guard_mutex);
- pthread_cond_destroy(&COND_flush_finished);
+ pthread_cond_destroy(&COND_cache_status_changed);
pthread_mutex_destroy(&structure_guard_mutex);
initialized = 0;
}
@@ -1572,8 +1755,8 @@ void Query_cache::init()
{
DBUG_ENTER("Query_cache::init");
pthread_mutex_init(&structure_guard_mutex,MY_MUTEX_INIT_FAST);
- pthread_cond_init(&COND_flush_finished, NULL);
- flush_in_progress= FALSE;
+ pthread_cond_init(&COND_cache_status_changed, NULL);
+ m_cache_status= Query_cache::NO_FLUSH_IN_PROGRESS;
initialized = 1;
DBUG_VOID_RETURN;
}
@@ -1587,8 +1770,9 @@ ulong Query_cache::init_cache()
int align;
DBUG_ENTER("Query_cache::init_cache");
+
approx_additional_data_size = (sizeof(Query_cache) +
- sizeof(gptr)*(def_query_hash_size+
+ sizeof(uchar*)*(def_query_hash_size+
def_table_hash_size));
if (query_cache_size < approx_additional_data_size)
goto err;
@@ -1644,7 +1828,7 @@ ulong Query_cache::init_cache()
goto err;
query_cache_size -= additional_data_size;
- if (!(cache= (byte *)
+ if (!(cache= (uchar *)
my_malloc_lock(query_cache_size+additional_data_size, MYF(0))))
goto err;
@@ -1765,58 +1949,29 @@ void Query_cache::make_disabled()
mem_bin_num= mem_bin_steps= 0;
queries_in_cache= 0;
first_block= 0;
+ total_blocks= 0;
+ tables_blocks= 0;
DBUG_VOID_RETURN;
}
-/*
- free_cache() - free all resources allocated by the cache.
-
- SYNOPSIS
- free_cache()
+/**
+ @class Query_cache
+ @brief Free all resources allocated by the cache.
- DESCRIPTION
- This function frees all resources allocated by the cache. You
- have to call init_cache() before using the cache again.
+ This function frees all resources allocated by the cache. You
+ have to call init_cache() before using the cache again. This function
+ requires the structure_guard_mutex to be locked.
*/
void Query_cache::free_cache()
{
DBUG_ENTER("Query_cache::free_cache");
- if (query_cache_size > 0)
- flush_cache();
- /*
- There may be two free_cache() calls in progress, because we
- release 'structure_guard_mutex' in flush_cache(). When the second
- flush_cache() wakes up from the wait on 'COND_flush_finished', the
- first call to free_cache() has done its job. So we have to test
- 'query_cache_size > 0' the second time to see if the cache wasn't
- reset by other thread, or if it was reset and was re-enabled then.
- If the cache was reset, then we have nothing to do here.
- */
- if (query_cache_size > 0)
- {
-#ifndef DBUG_OFF
- if (bins[0].free_blocks == 0)
- {
- wreck(__LINE__,"no free memory found in (bins[0].free_blocks");
- DBUG_VOID_RETURN;
- }
-#endif
- /* Becasue we did a flush, all cache memory must be in one this block */
- bins[0].free_blocks->destroy();
- total_blocks--;
-#ifndef DBUG_OFF
- if (free_memory != query_cache_size)
- DBUG_PRINT("qcache", ("free memory %lu (should be %lu)",
- free_memory , query_cache_size));
-#endif
- my_free((gptr) cache, MYF(MY_ALLOW_ZERO_PTR));
- make_disabled();
- hash_free(&queries);
- hash_free(&tables);
- }
+ my_free((uchar*) cache, MYF(MY_ALLOW_ZERO_PTR));
+ make_disabled();
+ hash_free(&queries);
+ hash_free(&tables);
DBUG_VOID_RETURN;
}
@@ -1825,24 +1980,17 @@ void Query_cache::free_cache()
*****************************************************************************/
-/*
- flush_cache() - flush the cache.
-
- SYNOPSIS
- flush_cache()
+/**
+ @brief Flush the cache.
- DESCRIPTION
- This function will flush cache contents. It assumes we have
- 'structure_guard_mutex' locked. The function sets the
- flush_in_progress flag and releases the lock, so other threads may
- proceed skipping the cache as if it is disabled. Concurrent
- flushes are performed in turn.
-
- After flush_cache() call, the cache is flushed, all the freed
- memory is accumulated in bin[0], and the 'structure_guard_mutex'
- is locked. However, since we could release the mutex during
- execution, the rest of the cache state could have been changed,
- and should not be relied on.
+ This function will flush cache contents. It assumes we have
+ 'structure_guard_mutex' locked. The function sets the m_cache_status flag and
+ releases the lock, so other threads may proceed skipping the cache as if it
+ is disabled. Concurrent flushes are performed in turn.
+ After flush_cache() call, the cache is flushed, all the freed memory is
+ accumulated in bin[0], and the 'structure_guard_mutex' is locked. However,
+ since we could release the mutex during execution, the rest of the cache
+ state could have been changed, and should not be relied on.
*/
void Query_cache::flush_cache()
@@ -1854,15 +2002,15 @@ void Query_cache::flush_cache()
Query_cache::free_cache()) depends on the fact that after the
flush the cache is empty.
*/
- while (flush_in_progress)
- pthread_cond_wait(&COND_flush_finished, &structure_guard_mutex);
+ while (is_flushing())
+ pthread_cond_wait(&COND_cache_status_changed, &structure_guard_mutex);
/*
- Setting 'flush_in_progress' will prevent other threads from using
+ Setting 'FLUSH_IN_PROGRESS' will prevent other threads from using
the cache while we are in the middle of the flush, and we release
the lock so that other threads won't block.
*/
- flush_in_progress= TRUE;
+ m_cache_status= Query_cache::FLUSH_IN_PROGRESS;
STRUCT_UNLOCK(&structure_guard_mutex);
my_hash_reset(&queries);
@@ -1873,8 +2021,8 @@ void Query_cache::flush_cache()
}
STRUCT_LOCK(&structure_guard_mutex);
- flush_in_progress= FALSE;
- pthread_cond_signal(&COND_flush_finished);
+ m_cache_status= Query_cache::NO_FLUSH_IN_PROGRESS;
+ pthread_cond_signal(&COND_cache_status_changed);
}
/*
@@ -1892,7 +2040,7 @@ my_bool Query_cache::free_old_query()
sequence is breached.
Also we don't need remove locked queries at this point.
*/
- Query_cache_block *query_block = 0;
+ Query_cache_block *query_block= 0;
if (queries_blocks != 0)
{
Query_cache_block *block = queries_blocks;
@@ -2016,7 +2164,7 @@ void Query_cache::free_query(Query_cache_block *query_block)
(ulong) query_block,
query_block->query()->length() ));
- hash_delete(&queries,(byte *) query_block);
+ hash_delete(&queries,(uchar *) query_block);
free_query_internal(query_block);
DBUG_VOID_RETURN;
@@ -2027,11 +2175,10 @@ void Query_cache::free_query(Query_cache_block *query_block)
*****************************************************************************/
Query_cache_block *
-Query_cache::write_block_data(ulong data_len, gptr data,
+Query_cache::write_block_data(ulong data_len, uchar* data,
ulong header_len,
Query_cache_block::block_type type,
- TABLE_COUNTER_TYPE ntab,
- my_bool under_guard)
+ TABLE_COUNTER_TYPE ntab)
{
ulong all_headers_len = (ALIGN_SIZE(sizeof(Query_cache_block)) +
ALIGN_SIZE(ntab*sizeof(Query_cache_block_table)) +
@@ -2041,17 +2188,15 @@ Query_cache::write_block_data(ulong data_len, gptr data,
DBUG_ENTER("Query_cache::write_block_data");
DBUG_PRINT("qcache", ("data: %ld, header: %ld, all header: %ld",
data_len, header_len, all_headers_len));
- Query_cache_block *block = allocate_block(max(align_len,
- min_allocation_unit),
- 1, 0, under_guard);
+ Query_cache_block *block= allocate_block(max(align_len,
+ min_allocation_unit),1, 0);
if (block != 0)
{
block->type = type;
block->n_tables = ntab;
block->used = len;
- memcpy((void*) (((byte *) block)+ all_headers_len),
- (void*) data, data_len);
+ memcpy((uchar *) block+ all_headers_len, data, data_len);
}
DBUG_RETURN(block);
}
@@ -2063,7 +2208,7 @@ Query_cache::write_block_data(ulong data_len, gptr data,
my_bool
Query_cache::append_result_data(Query_cache_block **current_block,
- ulong data_len, gptr data,
+ ulong data_len, uchar* data,
Query_cache_block *query_block)
{
DBUG_ENTER("Query_cache::append_result_data");
@@ -2119,7 +2264,7 @@ Query_cache::append_result_data(Query_cache_block **current_block,
by the next call
*/
success = write_result_data(&new_block, data_len-last_block_free_space,
- (gptr)(((byte*)data)+last_block_free_space),
+ (uchar*)(((uchar*)data)+last_block_free_space),
query_block,
Query_cache_block::RES_CONT);
/*
@@ -2141,8 +2286,7 @@ Query_cache::append_result_data(Query_cache_block **current_block,
ulong to_copy = min(data_len,last_block_free_space);
DBUG_PRINT("qcache", ("use free space %lub at block 0x%lx to copy %lub",
last_block_free_space, (ulong)last_block, to_copy));
- memcpy((void*) (((byte*) last_block) + last_block->used), (void*) data,
- to_copy);
+ memcpy((uchar*) last_block + last_block->used, data, to_copy);
last_block->used+=to_copy;
}
DBUG_RETURN(success);
@@ -2150,7 +2294,7 @@ Query_cache::append_result_data(Query_cache_block **current_block,
my_bool Query_cache::write_result_data(Query_cache_block **result_block,
- ulong data_len, gptr data,
+ ulong data_len, uchar* data,
Query_cache_block *query_block,
Query_cache_block::block_type type)
{
@@ -2176,7 +2320,7 @@ my_bool Query_cache::write_result_data(Query_cache_block **result_block,
ALIGN_SIZE(sizeof(Query_cache_result)));
#ifndef EMBEDDED_LIBRARY
Query_cache_block *block= *result_block;
- byte *rest= (byte*) data;
+ uchar *rest= data;
// Now fill list of blocks that created by allocate_data_chain
do
{
@@ -2184,7 +2328,7 @@ my_bool Query_cache::write_result_data(Query_cache_block **result_block,
ulong length = block->used - headers_len;
DBUG_PRINT("qcache", ("write %lu byte in block 0x%lx",length,
(ulong)block));
- memcpy((void*)(((byte*) block)+headers_len), (void*) rest, length);
+ memcpy((uchar*) block+headers_len, rest, length);
rest += length;
block = block->next;
type = Query_cache_block::RES_CONT;
@@ -2262,8 +2406,7 @@ my_bool Query_cache::allocate_data_chain(Query_cache_block **result_block,
if (!(new_block= allocate_block(max(min_size, align_len),
min_result_data_size == 0,
- all_headers_len + min_result_data_size,
- 1)))
+ all_headers_len + min_result_data_size)))
{
DBUG_PRINT("warning", ("Can't allocate block for results"));
DBUG_RETURN(FALSE);
@@ -2305,51 +2448,109 @@ my_bool Query_cache::allocate_data_chain(Query_cache_block **result_block,
Invalidate the first table in the table_list
*/
-void Query_cache::invalidate_table(TABLE_LIST *table_list)
+void Query_cache::invalidate_table(THD *thd, TABLE_LIST *table_list)
{
if (table_list->table != 0)
- invalidate_table(table_list->table); // Table is open
+ invalidate_table(thd, table_list->table); // Table is open
else
{
char key[MAX_DBKEY_LENGTH];
uint key_length;
- Query_cache_block *table_block;
+
key_length=(uint) (strmov(strmov(key,table_list->db)+1,
table_list->table_name) -key)+ 1;
// We don't store temporary tables => no key_length+=4 ...
- if ((table_block = (Query_cache_block*)
- hash_search(&tables,(byte*) key,key_length)))
- invalidate_table(table_block);
+ invalidate_table(thd, (uchar *)key, key_length);
}
}
-void Query_cache::invalidate_table(TABLE *table)
+void Query_cache::invalidate_table(THD *thd, TABLE *table)
{
- invalidate_table((byte*) table->s->table_cache_key.str,
+ invalidate_table(thd, (uchar*) table->s->table_cache_key.str,
table->s->table_cache_key.length);
}
-void Query_cache::invalidate_table(byte * key, uint32 key_length)
+void Query_cache::invalidate_table(THD *thd, uchar * key, uint32 key_length)
{
- Query_cache_block *table_block;
- if ((table_block = ((Query_cache_block*)
- hash_search(&tables, key, key_length))))
- invalidate_table(table_block);
+ bool interrupt;
+ STRUCT_LOCK(&structure_guard_mutex);
+ wait_while_table_flush_is_in_progress(&interrupt);
+ if (interrupt)
+ {
+ STRUCT_UNLOCK(&structure_guard_mutex);
+ return;
+ }
+
+ /*
+ Setting 'TABLE_FLUSH_IN_PROGRESS' will temporarily disable the cache
+ so that structural changes to cache won't block the entire server.
+ However, threads requesting to change the query cache will still have
+ to wait for the flush to finish.
+ */
+ m_cache_status= Query_cache::TABLE_FLUSH_IN_PROGRESS;
+ STRUCT_UNLOCK(&structure_guard_mutex);
+
+ if (query_cache_size > 0)
+ invalidate_table_internal(thd, key, key_length);
+
+ STRUCT_LOCK(&structure_guard_mutex);
+ m_cache_status= Query_cache::NO_FLUSH_IN_PROGRESS;
+
+ /*
+ net_real_write might be waiting on a change on the m_cache_status
+ variable.
+ */
+ pthread_cond_signal(&COND_cache_status_changed);
+ STRUCT_UNLOCK(&structure_guard_mutex);
+}
+
+
+/**
+ Try to locate and invalidate a table by name.
+ The caller must ensure that no other thread is trying to work with
+ the query cache when this function is executed.
+
+ @pre structure_guard_mutex is acquired or TABLE_FLUSH_IN_PROGRESS is set.
+*/
+
+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);
+ if (table_block)
+ {
+ Query_cache_block_table *list_root= table_block->table(0);
+ invalidate_query_block_list(thd, list_root);
+ }
}
-void Query_cache::invalidate_table(Query_cache_block *table_block)
+/**
+ @brief Invalidate a linked list of query cache blocks.
+
+ Each block tries to aquire a block level lock before
+ free_query is a called. This function will in turn affect
+ related table- and result-blocks.
+
+ @param[in,out] thd Thread context.
+ @param[in,out] list_root A pointer to a circular list of query blocks.
+
+*/
+
+void
+Query_cache::invalidate_query_block_list(THD *thd,
+ Query_cache_block_table *list_root)
{
- Query_cache_block_table *list_root = table_block->table(0);
while (list_root->next != list_root)
{
- Query_cache_block *query_block = list_root->next->block();
+ Query_cache_block *query_block= list_root->next->block();
BLOCK_LOCK_WR(query_block);
free_query(query_block);
+ DBUG_EXECUTE_IF("debug_cache_locks", sleep(10););
}
}
-
/*
Register given table list begining with given position in tables table of
block
@@ -2408,12 +2609,13 @@ Query_cache::register_tables_from_list(TABLE_LIST *tables_used,
else
{
DBUG_PRINT("qcache",
- ("table: %s db: %s openinfo: 0x%lx keylen: %u key: 0x%lx",
+ ("table: %s db: %s openinfo: 0x%lx keylen: %lu key: 0x%lx",
tables_used->table->s->table_name.str,
tables_used->table->s->table_cache_key.str,
(ulong) tables_used->table,
- tables_used->table->s->table_cache_key.length,
+ (ulong) tables_used->table->s->table_cache_key.length,
(ulong) tables_used->table->s->table_cache_key.str));
+
if (!insert_table(tables_used->table->s->table_cache_key.length,
tables_used->table->s->table_cache_key.str,
block_table,
@@ -2423,7 +2625,12 @@ Query_cache::register_tables_from_list(TABLE_LIST *tables_used,
tables_used->engine_data))
DBUG_RETURN(0);
- if (tables_used->table->s->db_type->db_type == DB_TYPE_MRG_MYISAM)
+#ifdef WITH_MYISAMMRG_STORAGE_ENGINE
+ /*
+ XXX FIXME: Some generic mechanism is required here instead of this
+ MYISAMMRG-specific implementation.
+ */
+ if (tables_used->table->s->db_type()->db_type == DB_TYPE_MRG_MYISAM)
{
ha_myisammrg *handler = (ha_myisammrg *) tables_used->table->file;
MYRG_INFO *file = handler->myrg_info();
@@ -2446,6 +2653,7 @@ Query_cache::register_tables_from_list(TABLE_LIST *tables_used,
DBUG_RETURN(0);
}
}
+#endif
}
}
DBUG_RETURN(n - counter);
@@ -2474,9 +2682,8 @@ my_bool Query_cache::register_all_tables(Query_cache_block *block,
n= register_tables_from_list(tables_used, 0, block_table);
- if (n)
+ if (n==0)
{
- DBUG_PRINT("qcache", ("failed at table %d", (int) n));
/* Unlink the tables we allocated above */
for (Query_cache_block_table *tmp = block->table(0) ;
tmp != block_table;
@@ -2486,9 +2693,13 @@ my_bool Query_cache::register_all_tables(Query_cache_block *block,
return (n);
}
-/*
- Insert used tablename in cache
- Returns 0 on error
+
+/**
+ @brief Insert used table name into the cache.
+
+ @return Error status
+ @retval FALSE On error
+ @retval TRUE On success
*/
my_bool
@@ -2502,9 +2713,10 @@ Query_cache::insert_table(uint key_len, char *key,
DBUG_PRINT("qcache", ("insert table node 0x%lx, len %d",
(ulong)node, key_len));
- Query_cache_block *table_block = ((Query_cache_block *)
- hash_search(&tables, (byte*) key,
- key_len));
+ THD *thd= current_thd;
+
+ Query_cache_block *table_block=
+ (Query_cache_block *)hash_search(&tables, (uchar*) key, key_len);
if (table_block &&
table_block->table()->engine_data() != engine_data)
@@ -2519,7 +2731,11 @@ Query_cache::insert_table(uint key_len, char *key,
as far as we delete all queries with this table, table block will be
deleted, too
*/
- invalidate_table(table_block);
+ {
+ Query_cache_block_table *list_root= table_block->table(0);
+ invalidate_query_block_list(thd, list_root);
+ }
+
table_block= 0;
}
@@ -2527,42 +2743,67 @@ Query_cache::insert_table(uint key_len, char *key,
{
DBUG_PRINT("qcache", ("new table block from 0x%lx (%u)",
(ulong) key, (int) key_len));
- table_block = write_block_data(key_len, (gptr) key,
- ALIGN_SIZE(sizeof(Query_cache_table)),
- Query_cache_block::TABLE,
- 1, 1);
+ table_block= write_block_data(key_len, (uchar*) key,
+ ALIGN_SIZE(sizeof(Query_cache_table)),
+ Query_cache_block::TABLE, 1);
if (table_block == 0)
{
DBUG_PRINT("qcache", ("Can't write table name to cache"));
DBUG_RETURN(0);
}
- Query_cache_table *header = table_block->table();
+ Query_cache_table *header= table_block->table();
double_linked_list_simple_include(table_block,
- &tables_blocks);
- Query_cache_block_table *list_root = table_block->table(0);
- list_root->n = 0;
- list_root->next = list_root->prev = list_root;
- if (my_hash_insert(&tables, (const byte *) table_block))
+ &tables_blocks);
+ /*
+ First node in the Query_cache_block_table-chain is the table-type
+ block. This block will only have one Query_cache_block_table (n=0).
+ */
+ Query_cache_block_table *list_root= table_block->table(0);
+ list_root->n= 0;
+
+ /*
+ The node list is circular in nature.
+ */
+ list_root->next= list_root->prev= list_root;
+
+ if (my_hash_insert(&tables, (const uchar *) table_block))
{
DBUG_PRINT("qcache", ("Can't insert table to hash"));
// write_block_data return locked block
free_memory_block(table_block);
DBUG_RETURN(0);
}
- char *db = header->db();
+ char *db= header->db();
header->table(db + db_length + 1);
header->key_length(key_len);
header->type(cache_type);
header->callback(callback);
header->engine_data(engine_data);
+
+ /*
+ We insert this table without the assumption that it isn't refrenenced by
+ any queries.
+ */
+ header->m_cached_query_count= 0;
}
- Query_cache_block_table *list_root = table_block->table(0);
- node->next = list_root->next;
- list_root->next = node;
- node->next->prev = node;
- node->prev = list_root;
- node->parent = table_block->table();
+ /*
+ Table is now in the cache; link the table_block-node associated
+ with the currently processed query into the chain of queries depending
+ on the cached table.
+ */
+ Query_cache_block_table *list_root= table_block->table(0);
+ node->next= list_root->next;
+ list_root->next= node;
+ node->next->prev= node;
+ node->prev= list_root;
+ node->parent= table_block->table();
+ /*
+ Increase the counter to keep track on how long this chain
+ of queries is.
+ */
+ Query_cache_table *table_block_data= table_block->table();
+ table_block_data->m_cached_query_count++;
DBUG_RETURN(1);
}
@@ -2570,16 +2811,28 @@ Query_cache::insert_table(uint key_len, char *key,
void Query_cache::unlink_table(Query_cache_block_table *node)
{
DBUG_ENTER("Query_cache::unlink_table");
- node->prev->next = node->next;
- node->next->prev = node->prev;
- Query_cache_block_table *neighbour = node->next;
+ node->prev->next= node->next;
+ node->next->prev= node->prev;
+ Query_cache_block_table *neighbour= node->next;
+ Query_cache_table *table_block_data= node->parent;
+ table_block_data->m_cached_query_count--;
+
+ DBUG_ASSERT(table_block_data->m_cached_query_count >= 0);
+
if (neighbour->next == neighbour)
{
- // list is empty (neighbor is root of list)
- Query_cache_block *table_block = neighbour->block();
+ DBUG_ASSERT(table_block_data->m_cached_query_count == 0);
+ /*
+ If neighbor is root of list, the list is empty.
+ The root of the list is always a table-type block
+ which contain exactly one Query_cache_block_table
+ node object, thus we can use the block() method
+ to calculate the Query_cache_block address.
+ */
+ Query_cache_block *table_block= neighbour->block();
double_linked_list_exclude(table_block,
- &tables_blocks);
- hash_delete(&tables,(byte *) table_block);
+ &tables_blocks);
+ hash_delete(&tables,(uchar *) table_block);
free_memory_block(table_block);
}
DBUG_VOID_RETURN;
@@ -2590,12 +2843,11 @@ void Query_cache::unlink_table(Query_cache_block_table *node)
*****************************************************************************/
Query_cache_block *
-Query_cache::allocate_block(ulong len, my_bool not_less, ulong min,
- my_bool under_guard)
+Query_cache::allocate_block(ulong len, my_bool not_less, ulong min)
{
DBUG_ENTER("Query_cache::allocate_block");
- DBUG_PRINT("qcache", ("len %lu, not less %d, min %lu, uder_guard %d",
- len, not_less,min,under_guard));
+ DBUG_PRINT("qcache", ("len %lu, not less %d, min %lu",
+ len, not_less,min));
if (len >= min(query_cache_size, query_cache_limit))
{
@@ -2604,17 +2856,6 @@ Query_cache::allocate_block(ulong len, my_bool not_less, ulong min,
DBUG_RETURN(0); // in any case we don't have such piece of memory
}
- if (!under_guard)
- {
- STRUCT_LOCK(&structure_guard_mutex);
-
- if (unlikely(query_cache.query_cache_size == 0 || flush_in_progress))
- {
- STRUCT_UNLOCK(&structure_guard_mutex);
- DBUG_RETURN(0);
- }
- }
-
/* Free old queries until we have enough memory to store this block */
Query_cache_block *block;
do
@@ -2629,8 +2870,6 @@ Query_cache::allocate_block(ulong len, my_bool not_less, ulong min,
split_block(block,ALIGN_SIZE(len));
}
- if (!under_guard)
- STRUCT_UNLOCK(&structure_guard_mutex);
DBUG_RETURN(block);
}
@@ -2734,7 +2973,7 @@ void Query_cache::free_memory_block(Query_cache_block *block)
void Query_cache::split_block(Query_cache_block *block, ulong len)
{
DBUG_ENTER("Query_cache::split_block");
- Query_cache_block *new_block = (Query_cache_block*)(((byte*) block)+len);
+ Query_cache_block *new_block = (Query_cache_block*)(((uchar*) block)+len);
new_block->init(block->length - len);
total_blocks++;
@@ -2865,9 +3104,7 @@ uint Query_cache::find_bin(ulong size)
}
uint bin = steps[left].idx -
(uint)((size - steps[left].size)/steps[left].increment);
-#ifndef DBUG_OFF
- bins_dump();
-#endif
+
DBUG_PRINT("qcache", ("bin %u step %u, size %lu step size %lu",
bin, left, size, steps[left].size));
DBUG_RETURN(bin);
@@ -2966,8 +3203,11 @@ Query_cache::double_linked_list_exclude(Query_cache_block *point,
{
point->next->prev = point->prev;
point->prev->next = point->next;
+ /*
+ If the root is removed; select a new root
+ */
if (point == *list_pointer)
- *list_pointer = point->next;
+ *list_pointer= point->next;
}
DBUG_VOID_RETURN;
}
@@ -3002,14 +3242,42 @@ void Query_cache::double_linked_list_join(Query_cache_block *head_tail,
>0 number of tables
*/
-static TABLE_COUNTER_TYPE process_and_count_tables(TABLE_LIST *tables_used,
- uint8 *tables_type)
+TABLE_COUNTER_TYPE
+Query_cache::process_and_count_tables(THD *thd, TABLE_LIST *tables_used,
+ uint8 *tables_type)
{
DBUG_ENTER("process_and_count_tables");
TABLE_COUNTER_TYPE table_count = 0;
for (; tables_used; tables_used= tables_used->next_global)
{
table_count++;
+#ifdef HAVE_QUERY_CACHE
+ /*
+ Disable any attempt to store this statement if there are
+ column level grants on any referenced tables.
+ The grant.want_privileges flag was set to 1 in the
+ check_grant() function earlier if the TABLE_LIST object
+ had any associated column privileges.
+
+ We need to check that the TABLE_LIST object isn't part
+ of a VIEW definition because we want to be able to cache
+ views.
+
+ TODO: Although it is possible to cache views, the privilege
+ check on view tables always fall back on column privileges
+ even if there are more generic table privileges. Thus it isn't
+ currently possible to retrieve cached view-tables unless the
+ client has the super user privileges.
+ */
+ if (tables_used->grant.want_privilege &&
+ tables_used->belong_to_view == NULL)
+ {
+ DBUG_PRINT("qcache", ("Don't cache statement as it refers to "
+ "tables with column privileges."));
+ thd->lex->safe_to_cache_query= 0;
+ DBUG_RETURN(0);
+ }
+#endif
if (tables_used->view)
{
DBUG_PRINT("qcache", ("view: %s db: %s",
@@ -3022,7 +3290,7 @@ static TABLE_COUNTER_TYPE process_and_count_tables(TABLE_LIST *tables_used,
DBUG_PRINT("qcache", ("table: %s db: %s type: %u",
tables_used->table->s->table_name.str,
tables_used->table->s->db.str,
- tables_used->table->s->db_type->db_type));
+ tables_used->table->s->db_type()->db_type));
if (tables_used->derived)
{
table_count--;
@@ -3047,12 +3315,18 @@ static TABLE_COUNTER_TYPE process_and_count_tables(TABLE_LIST *tables_used,
"other non-cacheable table(s)"));
DBUG_RETURN(0);
}
- if (tables_used->table->s->db_type->db_type == DB_TYPE_MRG_MYISAM)
+#ifdef WITH_MYISAMMRG_STORAGE_ENGINE
+ /*
+ XXX FIXME: Some generic mechanism is required here instead of this
+ MYISAMMRG-specific implementation.
+ */
+ if (tables_used->table->s->db_type()->db_type == DB_TYPE_MRG_MYISAM)
{
ha_myisammrg *handler = (ha_myisammrg *)tables_used->table->file;
MYRG_INFO *file = handler->myrg_info();
table_count+= (file->end_table - file->open_tables);
}
+#endif
}
}
DBUG_RETURN(table_count);
@@ -3081,7 +3355,8 @@ Query_cache::is_cacheable(THD *thd, uint32 query_len, char *query, LEX *lex,
(long) lex->select_lex.options,
(int) thd->variables.query_cache_type));
- if (!(table_count= process_and_count_tables(tables_used, tables_type)))
+ if (!(table_count= process_and_count_tables(thd, tables_used,
+ tables_type)))
DBUG_RETURN(0);
if ((thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) &&
@@ -3147,21 +3422,20 @@ my_bool Query_cache::ask_handler_allowance(THD *thd,
Packing
*****************************************************************************/
+
+/**
+ @brief Rearrange all memory blocks so that free memory joins at the
+ 'bottom' of the allocated memory block containing all cache data.
+ @see Query_cache::pack(ulong join_limit, uint iteration_limit)
+*/
+
void Query_cache::pack_cache()
{
DBUG_ENTER("Query_cache::pack_cache");
- STRUCT_LOCK(&structure_guard_mutex);
-
- if (unlikely(query_cache_size == 0 || flush_in_progress))
- {
- STRUCT_UNLOCK(&structure_guard_mutex);
- DBUG_VOID_RETURN;
- }
-
DBUG_EXECUTE("check_querycache",query_cache.check_integrity(1););
- byte *border = 0;
+ uchar *border = 0;
Query_cache_block *before = 0;
ulong gap = 0;
my_bool ok = 1;
@@ -3192,12 +3466,11 @@ void Query_cache::pack_cache()
}
DBUG_EXECUTE("check_querycache",query_cache.check_integrity(1););
- STRUCT_UNLOCK(&structure_guard_mutex);
DBUG_VOID_RETURN;
}
-my_bool Query_cache::move_by_type(byte **border,
+my_bool Query_cache::move_by_type(uchar **border,
Query_cache_block **before, ulong *gap,
Query_cache_block *block)
{
@@ -3210,7 +3483,7 @@ my_bool Query_cache::move_by_type(byte **border,
DBUG_PRINT("qcache", ("block 0x%lx FREE", (ulong) block));
if (*border == 0)
{
- *border = (byte *) block;
+ *border = (uchar *) block;
*before = block->pprev;
DBUG_PRINT("qcache", ("gap beginning here"));
}
@@ -3240,10 +3513,10 @@ my_bool Query_cache::move_by_type(byte **border,
*new_block =(Query_cache_block *) *border;
uint tablename_offset = block->table()->table() - block->table()->db();
char *data = (char*) block->data();
- byte *key;
- uint key_length;
- key=query_cache_table_get_key((byte*) block, &key_length, 0);
- hash_first(&tables, (byte*) key, key_length, &record_idx);
+ 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);
block->destroy();
new_block->init(len);
@@ -3277,7 +3550,7 @@ my_bool Query_cache::move_by_type(byte **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, (byte*) new_block);
+ 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));
@@ -3300,10 +3573,10 @@ my_bool Query_cache::move_by_type(byte **border,
char *data = (char*) block->data();
Query_cache_block *first_result_block = ((Query_cache_query *)
block->data())->result();
- byte *key;
- uint key_length;
- key=query_cache_query_get_key((byte*) block, &key_length, 0);
- hash_first(&queries, (byte*) key, key_length, &record_idx);
+ 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);
// Move table of used tables
memmove((char*) new_block->table(0), (char*) block->table(0),
ALIGN_SIZE(n_tables*sizeof(Query_cache_block_table)));
@@ -3319,7 +3592,7 @@ my_bool Query_cache::move_by_type(byte **border,
queries_blocks = new_block;
Query_cache_block_table *beg_of_table_table= block->table(0),
*end_of_table_table= block->table(n_tables);
- byte *beg_of_new_table_table= (byte*) new_block->table(0);
+ uchar *beg_of_new_table_table= (uchar*) new_block->table(0);
for (TABLE_COUNTER_TYPE j=0; j < n_tables; j++)
{
@@ -3329,8 +3602,8 @@ my_bool Query_cache::move_by_type(byte **border,
if ((beg_of_table_table <= block_table->next) &&
(block_table->next < end_of_table_table))
((Query_cache_block_table *)(beg_of_new_table_table +
- (((byte*)block_table->next) -
- ((byte*)beg_of_table_table))))->prev=
+ (((uchar*)block_table->next) -
+ ((uchar*)beg_of_table_table))))->prev=
block_table;
else
block_table->next->prev= block_table;
@@ -3339,8 +3612,8 @@ my_bool Query_cache::move_by_type(byte **border,
if ((beg_of_table_table <= block_table->prev) &&
(block_table->prev < end_of_table_table))
((Query_cache_block_table *)(beg_of_new_table_table +
- (((byte*)block_table->prev) -
- ((byte*)beg_of_table_table))))->next=
+ (((uchar*)block_table->prev) -
+ ((uchar*)beg_of_table_table))))->next=
block_table;
else
block_table->prev->next = block_table;
@@ -3368,10 +3641,10 @@ my_bool Query_cache::move_by_type(byte **border,
NET *net = new_block->query()->writer();
if (net != 0)
{
- net->query_cache_query= (gptr) new_block;
+ net->query_cache_query= (uchar*) new_block;
}
/* Fix hash to point at moved block */
- hash_replace(&queries, &record_idx, (byte*) new_block);
+ 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;
@@ -3467,8 +3740,7 @@ my_bool Query_cache::join_results(ulong join_limit)
my_bool has_moving = 0;
DBUG_ENTER("Query_cache::join_results");
- STRUCT_LOCK(&structure_guard_mutex);
- if (queries_blocks != 0 && !flush_in_progress)
+ if (queries_blocks != 0)
{
DBUG_ASSERT(query_cache_size > 0);
Query_cache_block *block = queries_blocks;
@@ -3507,7 +3779,7 @@ my_bool Query_cache::join_results(ulong join_limit)
Query_cache_result *new_result = new_result_block->result();
new_result->parent(block);
- byte *write_to = (byte*) new_result->data();
+ uchar *write_to = (uchar*) new_result->data();
Query_cache_block *result_block = first_result;
do
{
@@ -3531,7 +3803,6 @@ my_bool Query_cache::join_results(ulong join_limit)
block = block->next;
} while ( block != queries_blocks );
}
- STRUCT_UNLOCK(&structure_guard_mutex);
DBUG_RETURN(has_moving);
}
@@ -3691,18 +3962,18 @@ void Query_cache::queries_dump()
Query_cache_block *block = queries_blocks;
do
{
- uint len;
- char *str = (char*) query_cache_query_get_key((byte*) block, &len, 0);
+ size_t len;
+ char *str = (char*) query_cache_query_get_key((uchar*) block, &len, 0);
len-= QUERY_CACHE_FLAGS_SIZE; // Point at flags
Query_cache_query_flags flags;
memcpy(&flags, str+len, QUERY_CACHE_FLAGS_SIZE);
str[len]= 0; // make zero ending DB name
- DBUG_PRINT("qcache", ("F: %u C: %u L: %lu T: '%s' (%u) '%s' '%s'",
+ DBUG_PRINT("qcache", ("F: %u C: %u L: %lu T: '%s' (%lu) '%s' '%s'",
flags.client_long_flag,
flags.character_set_client_num,
(ulong)flags.limit,
flags.time_zone->get_name()->ptr(),
- len, str, strend(str)+1));
+ (ulong) len, str, strend(str)+1));
DBUG_PRINT("qcache", ("-b- 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx", (ulong) block,
(ulong) block->next, (ulong) block->prev,
(ulong)block->pnext, (ulong)block->pprev));
@@ -3759,7 +4030,7 @@ void Query_cache::tables_dump()
Query_cache_table *table = table_block->table();
DBUG_PRINT("qcache", ("'%s' '%s'", table->db(), table->table()));
table_block = table_block->next;
- } while ( table_block != tables_blocks);
+ } while (table_block != tables_blocks);
}
else
DBUG_PRINT("qcache", ("no tables in list"));
@@ -3767,6 +4038,14 @@ void Query_cache::tables_dump()
}
+/**
+ @brief Checks integrity of the various linked lists
+
+ @return Error status code
+ @retval FALSE Query cache is operational.
+ @retval TRUE Query cache is broken.
+*/
+
my_bool Query_cache::check_integrity(bool locked)
{
my_bool result = 0;
@@ -3776,14 +4055,8 @@ my_bool Query_cache::check_integrity(bool locked)
if (!locked)
STRUCT_LOCK(&structure_guard_mutex);
- if (unlikely(query_cache_size == 0 || flush_in_progress))
- {
- if (!locked)
- STRUCT_UNLOCK(&query_cache.structure_guard_mutex);
-
- DBUG_PRINT("qcache", ("Query Cache not initialized"));
- DBUG_RETURN(0);
- }
+ while (is_flushing())
+ pthread_cond_wait(&COND_cache_status_changed,&structure_guard_mutex);
if (hash_check(&queries))
{
@@ -3802,6 +4075,10 @@ my_bool Query_cache::check_integrity(bool locked)
Query_cache_block * block = first_block;
do
{
+ /* When checking at system start, there is no block. */
+ if (!block)
+ break;
+
DBUG_PRINT("qcache", ("block 0x%lx, type %u...",
(ulong) block, (uint) block->type));
// Check allignment
@@ -3816,25 +4093,25 @@ my_bool Query_cache::check_integrity(bool locked)
// Check memory allocation
if (block->pnext == first_block) // Is it last block?
{
- if (((byte*)block) + block->length !=
- ((byte*)first_block) + query_cache_size)
+ if (((uchar*)block) + block->length !=
+ ((uchar*)first_block) + query_cache_size)
{
DBUG_PRINT("error",
("block 0x%lx, type %u, ended at 0x%lx, but cache ended at 0x%lx",
(ulong) block, (uint) block->type,
- (ulong) (((byte*)block) + block->length),
- (ulong) (((byte*)first_block) + query_cache_size)));
+ (ulong) (((uchar*)block) + block->length),
+ (ulong) (((uchar*)first_block) + query_cache_size)));
result = 1;
}
}
else
- if (((byte*)block) + block->length != ((byte*)block->pnext))
+ if (((uchar*)block) + block->length != ((uchar*)block->pnext))
{
DBUG_PRINT("error",
("block 0x%lx, type %u, ended at 0x%lx, but next block begining at 0x%lx",
(ulong) block, (uint) block->type,
- (ulong) (((byte*)block) + block->length),
- (ulong) ((byte*)block->pnext)));
+ (ulong) (((uchar*)block) + block->length),
+ (ulong) ((uchar*)block->pnext)));
}
if (block->type == Query_cache_block::FREE)
free+= block->length;
@@ -3846,8 +4123,8 @@ my_bool Query_cache::check_integrity(bool locked)
Query_cache_memory_bin *bin = *((Query_cache_memory_bin **)
block->data());
//is it correct pointer?
- if (((byte*)bin) < ((byte*)bins) ||
- ((byte*)bin) >= ((byte*)first_block))
+ if (((uchar*)bin) < ((uchar*)bins) ||
+ ((uchar*)bin) >= ((uchar*)first_block))
{
DBUG_PRINT("error",
("free block 0x%lx have bin pointer 0x%lx beyaond of bins array bounds [0x%lx,0x%lx]",
@@ -3859,7 +4136,7 @@ my_bool Query_cache::check_integrity(bool locked)
}
else
{
- int idx = (((byte*)bin) - ((byte*)bins)) /
+ int idx = (((uchar*)bin) - ((uchar*)bins)) /
sizeof(Query_cache_memory_bin);
if (in_list(bins[idx].free_blocks, block, "free memory"))
result = 1;
@@ -3881,7 +4158,7 @@ my_bool Query_cache::check_integrity(bool locked)
Query_cache_block_table *block_table = block->table(j);
Query_cache_block_table *block_table_root =
(Query_cache_block_table *)
- (((byte*)block_table->parent) -
+ (((uchar*)block_table->parent) -
ALIGN_SIZE(sizeof(Query_cache_block_table)));
if (in_table_list(block_table, block_table_root, "table list"))
@@ -3897,15 +4174,15 @@ my_bool Query_cache::check_integrity(bool locked)
case Query_cache_block::RESULT:
{
Query_cache_block * query_block = block->result()->parent();
- if (((byte*)query_block) < ((byte*)first_block) ||
- ((byte*)query_block) >= (((byte*)first_block) + query_cache_size))
+ if (((uchar*)query_block) < ((uchar*)first_block) ||
+ ((uchar*)query_block) >= (((uchar*)first_block) + query_cache_size))
{
DBUG_PRINT("error",
("result block 0x%lx have query block pointer 0x%lx beyaond of block pool bounds [0x%lx,0x%lx]",
(ulong) block,
(ulong) query_block,
(ulong) first_block,
- (ulong) (((byte*)first_block) + query_cache_size)));
+ (ulong) (((uchar*)first_block) + query_cache_size)));
result = 1;
}
else
@@ -3952,10 +4229,10 @@ my_bool Query_cache::check_integrity(bool locked)
{
DBUG_PRINT("qcache", ("block 0x%lx, type %u...",
(ulong) block, (uint) block->type));
- uint length;
- byte *key = query_cache_query_get_key((byte*) block, &length, 0);
- gptr val = hash_search(&queries, key, length);
- if (((gptr)block) != val)
+ size_t length;
+ uchar *key = query_cache_query_get_key((uchar*) block, &length, 0);
+ uchar* val = hash_search(&queries, key, length);
+ if (((uchar*)block) != val)
{
DBUG_PRINT("error", ("block 0x%lx found in queries hash like 0x%lx",
(ulong) block, (ulong) val));
@@ -3987,10 +4264,10 @@ my_bool Query_cache::check_integrity(bool locked)
{
DBUG_PRINT("qcache", ("block 0x%lx, type %u...",
(ulong) block, (uint) block->type));
- uint length;
- byte *key = query_cache_table_get_key((byte*) block, &length, 0);
- gptr val = hash_search(&tables, key, length);
- if (((gptr)block) != val)
+ size_t length;
+ uchar *key = query_cache_table_get_key((uchar*) block, &length, 0);
+ uchar* val = hash_search(&tables, key, length);
+ if (((uchar*)block) != val)
{
DBUG_PRINT("error", ("block 0x%lx found in tables hash like 0x%lx",
(ulong) block, (ulong) val));
diff --git a/sql/sql_cache.h b/sql/sql_cache.h
index bc00f7ea629..b47e2e9a43b 100644
--- a/sql/sql_cache.h
+++ b/sql/sql_cache.h
@@ -65,17 +65,44 @@ struct Query_cache_query;
struct Query_cache_result;
class Query_cache;
+/**
+ @brief This class represents a node in the linked chain of queries
+ belonging to one table.
+ @note The root of this linked list is not a query-type block, but the table-
+ type block which all queries has in common.
+*/
struct Query_cache_block_table
{
Query_cache_block_table() {} /* Remove gcc warning */
- TABLE_COUNTER_TYPE n; // numbr in table (from 0)
+
+ /**
+ This node holds a position in a static table list belonging
+ to the associated query (base 0).
+ */
+ TABLE_COUNTER_TYPE n;
+
+ /**
+ Pointers to the next and previous node, linking all queries with
+ a common table.
+ */
Query_cache_block_table *next, *prev;
+
+ /**
+ A pointer to the table-type block which all
+ linked queries has in common.
+ */
Query_cache_table *parent;
+
+ /**
+ A method to calculate the address of the query cache block
+ owning this node. The purpose of this calculation is to
+ make it easier to move the query cache block without having
+ to modify all the pointer addresses.
+ */
inline Query_cache_block *block();
};
-
struct Query_cache_block
{
Query_cache_block() {} /* Remove gcc warning */
@@ -98,7 +125,7 @@ struct Query_cache_block
void init(ulong length);
void destroy();
inline uint headers_len();
- inline gptr data(void);
+ inline uchar* data(void);
inline Query_cache_query *query();
inline Query_cache_table *table();
inline Query_cache_result *result();
@@ -115,6 +142,7 @@ struct Query_cache_query
uint8 tbls_type;
unsigned int last_pkt_nr;
+ Query_cache_query() {} /* Remove gcc warning */
inline void init_n_lock();
void unlock_n_destroy();
inline ulonglong found_rows() { return limit_found_rows; }
@@ -128,17 +156,15 @@ struct Query_cache_query
inline ulong length() { return len; }
inline ulong add(ulong packet_len) { return(len+= packet_len); }
inline void length(ulong length_arg) { len= length_arg; }
- inline gptr query()
+ inline uchar* query()
{
- return (gptr)(((byte*)this)+
- ALIGN_SIZE(sizeof(Query_cache_query)));
+ return (((uchar*)this) + ALIGN_SIZE(sizeof(Query_cache_query)));
}
void lock_writing();
void lock_reading();
my_bool try_lock_writing();
void unlock_writing();
void unlock_reading();
- static byte *cache_key(const byte *record, uint *length, my_bool not_used);
};
@@ -153,6 +179,11 @@ struct Query_cache_table
/* data need by some engines */
ulonglong engine_data_buff;
+ /**
+ The number of queries depending of this table.
+ */
+ int32 m_cached_query_count;
+
inline char *db() { return (char *) data(); }
inline char *table() { return tbl; }
inline void table(char *table_arg) { tbl= table_arg; }
@@ -164,9 +195,9 @@ struct Query_cache_table
inline void callback(qc_engine_callback fn){ callback_func= fn; }
inline ulonglong engine_data() { return engine_data_buff; }
inline void engine_data(ulonglong data_arg){ engine_data_buff= data_arg; }
- inline gptr data()
+ inline uchar* data()
{
- return (gptr)(((byte*)this)+
+ return (uchar*)(((uchar*)this)+
ALIGN_SIZE(sizeof(Query_cache_table)));
}
};
@@ -176,9 +207,9 @@ struct Query_cache_result
Query_cache_result() {} /* Remove gcc warning */
Query_cache_block *query;
- inline gptr data()
+ inline uchar* data()
{
- return (gptr)(((byte*) this)+
+ return (uchar*)(((uchar*) this)+
ALIGN_SIZE(sizeof(Query_cache_result)));
}
/* data_continue (if not whole packet contained by this block) */
@@ -189,10 +220,10 @@ struct Query_cache_result
extern "C"
{
- byte *query_cache_query_get_key(const byte *record, uint *length,
- my_bool not_used);
- byte *query_cache_table_get_key(const byte *record, uint *length,
- my_bool not_used);
+ uchar *query_cache_query_get_key(const uchar *record, size_t *length,
+ my_bool not_used);
+ uchar *query_cache_table_get_key(const uchar *record, size_t *length,
+ my_bool not_used);
}
extern "C" void query_cache_invalidate_by_MyISAM_filename(const char* filename);
@@ -239,11 +270,17 @@ public:
ulong free_memory, queries_in_cache, hits, inserts, refused,
free_memory_blocks, total_blocks, lowmem_prunes;
+
private:
- pthread_cond_t COND_flush_finished;
- bool flush_in_progress;
+ pthread_cond_t COND_cache_status_changed;
+
+ enum Cache_status { NO_FLUSH_IN_PROGRESS, FLUSH_IN_PROGRESS,
+ TABLE_FLUSH_IN_PROGRESS };
+
+ Cache_status m_cache_status;
void free_query_internal(Query_cache_block *point);
+ void invalidate_table_internal(THD *thd, uchar *key, uint32 key_length);
protected:
/*
@@ -255,13 +292,13 @@ protected:
2. query block (for operation inside query (query block/results))
Thread doing cache flush releases the mutex once it sets
- flush_in_progress flag, so other threads may bypass the cache as
+ m_cache_status flag, so other threads may bypass the cache as
if it is disabled, not waiting for reset to finish. The exception
is other threads that were going to do cache flush---they'll wait
till the end of a flush operation.
*/
pthread_mutex_t structure_guard_mutex;
- byte *cache; // cache memory
+ uchar *cache; // cache memory
Query_cache_block *first_block; // physical location block list
Query_cache_block *queries_blocks; // query list (LIFO)
Query_cache_block *tables_blocks;
@@ -272,6 +309,7 @@ protected:
/* options */
ulong min_allocation_unit, min_result_data_size;
uint def_query_hash_size, def_table_hash_size;
+
uint mem_bin_num, mem_bin_steps; // See at init_cache & find_bin
my_bool initialized;
@@ -297,10 +335,13 @@ protected:
ulong data_len,
Query_cache_block *query_block,
my_bool first_block);
- void invalidate_table(TABLE_LIST *table);
- void invalidate_table(TABLE *table);
- void invalidate_table(byte *key, uint32 key_length);
- void invalidate_table(Query_cache_block *table_block);
+ void invalidate_table(THD *thd, TABLE_LIST *table);
+ void invalidate_table(THD *thd, TABLE *table);
+ void invalidate_table(THD *thd, uchar *key, uint32 key_length);
+ void invalidate_table(THD *thd, Query_cache_block *table_block);
+ void invalidate_query_block_list(THD *thd,
+ Query_cache_block_table *list_root);
+
TABLE_COUNTER_TYPE
register_tables_from_list(TABLE_LIST *tables_used,
TABLE_COUNTER_TYPE counter,
@@ -324,7 +365,7 @@ protected:
ulong add_size);
void exclude_from_free_memory_list(Query_cache_block *free_block);
void insert_into_free_memory_list(Query_cache_block *new_block);
- my_bool move_by_type(byte **border, Query_cache_block **before,
+ my_bool move_by_type(uchar **border, Query_cache_block **before,
ulong *gap, Query_cache_block *i);
uint find_bin(ulong size);
void move_to_query_list_end(Query_cache_block *block);
@@ -339,6 +380,8 @@ protected:
Query_cache_block *pprev);
my_bool join_results(ulong join_limit);
+ void wait_while_table_flush_is_in_progress(bool *interrupt);
+
/*
Following function control structure_guard_mutex
by themself or don't need structure_guard_mutex
@@ -346,32 +389,32 @@ protected:
ulong init_cache();
void make_disabled();
void free_cache();
- Query_cache_block *write_block_data(ulong data_len, gptr data,
+ Query_cache_block *write_block_data(ulong data_len, uchar* data,
ulong header_len,
Query_cache_block::block_type type,
- TABLE_COUNTER_TYPE ntab = 0,
- my_bool under_guard=0);
+ TABLE_COUNTER_TYPE ntab = 0);
my_bool append_result_data(Query_cache_block **result,
- ulong data_len, gptr data,
+ ulong data_len, uchar* data,
Query_cache_block *parent);
my_bool write_result_data(Query_cache_block **result,
- ulong data_len, gptr data,
+ ulong data_len, uchar* data,
Query_cache_block *parent,
Query_cache_block::block_type
type=Query_cache_block::RESULT);
inline ulong get_min_first_result_data_size();
inline ulong get_min_append_result_data_size();
Query_cache_block *allocate_block(ulong len, my_bool not_less,
- ulong min,
- my_bool under_guard=0);
+ ulong min);
/*
If query is cacheable return number tables in query
(query without tables not cached)
*/
- static
TABLE_COUNTER_TYPE is_cacheable(THD *thd, uint32 query_len, char *query,
- LEX *lex, TABLE_LIST *tables_used,
- uint8 *tables_type);
+ LEX *lex, TABLE_LIST *tables_used,
+ uint8 *tables_type);
+ TABLE_COUNTER_TYPE process_and_count_tables(THD *thd,
+ TABLE_LIST *tables_used,
+ uint8 *tables_type);
static my_bool ask_handler_allowance(THD *thd, TABLE_LIST *tables_used);
public:
@@ -426,6 +469,11 @@ protected:
friend void query_cache_end_of_result(THD *thd);
friend void query_cache_abort(NET *net);
+ bool is_flushing(void)
+ {
+ return (m_cache_status != Query_cache::NO_FLUSH_IN_PROGRESS);
+ }
+
/*
The following functions are only used when debugging
We don't protect these with ifndef DBUG_OFF to not have to recompile
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index e25aba9ef78..1e8c559631e 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -59,8 +59,8 @@ const char * const THD::DEFAULT_WHERE= "field list";
/* Used templates */
template class List<Key>;
template class List_iterator<Key>;
-template class List<key_part_spec>;
-template class List_iterator<key_part_spec>;
+template class List<Key_part_spec>;
+template class List_iterator<Key_part_spec>;
template class List<Alter_drop>;
template class List_iterator<Alter_drop>;
template class List<Alter_column>;
@@ -71,11 +71,11 @@ template class List_iterator<Alter_column>;
** User variables
****************************************************************************/
-extern "C" byte *get_var_key(user_var_entry *entry, uint *length,
- my_bool not_used __attribute__((unused)))
+extern "C" uchar *get_var_key(user_var_entry *entry, size_t *length,
+ my_bool not_used __attribute__((unused)))
{
- *length=(uint) entry->name.length;
- return (byte*) entry->name.str;
+ *length= entry->name.length;
+ return (uchar*) entry->name.str;
}
extern "C" void free_user_var(user_var_entry *entry)
@@ -86,11 +86,45 @@ extern "C" void free_user_var(user_var_entry *entry)
my_free((char*) entry,MYF(0));
}
-bool key_part_spec::operator==(const key_part_spec& other) const
+bool Key_part_spec::operator==(const Key_part_spec& other) const
{
return length == other.length && !strcmp(field_name, other.field_name);
}
+/**
+ Construct an (almost) deep copy of this key. Only those
+ elements that are known to never change are not copied.
+ If out of memory, a partial copy is returned and an error is set
+ in THD.
+*/
+
+Key::Key(const Key &rhs, MEM_ROOT *mem_root)
+ :type(rhs.type),
+ key_create_info(rhs.key_create_info),
+ columns(rhs.columns, mem_root),
+ name(rhs.name),
+ generated(rhs.generated)
+{
+ list_copy_and_replace_each_value(columns, mem_root);
+}
+
+/**
+ Construct an (almost) deep copy of this foreign key. Only those
+ elements that are known to never change are not copied.
+ If out of memory, a partial copy is returned and an error is set
+ in THD.
+*/
+
+Foreign_key::Foreign_key(const Foreign_key &rhs, MEM_ROOT *mem_root)
+ :Key(rhs),
+ ref_table(rhs.ref_table),
+ ref_columns(rhs.ref_columns),
+ delete_opt(rhs.delete_opt),
+ update_opt(rhs.update_opt),
+ match_opt(rhs.match_opt)
+{
+ list_copy_and_replace_each_value(ref_columns, mem_root);
+}
/*
Test if a foreign key (= generated key) is a prefix of the given key
@@ -126,9 +160,9 @@ bool foreign_key_prefix(Key *a, Key *b)
if (a->columns.elements > b->columns.elements)
return TRUE; // Can't be prefix
- List_iterator<key_part_spec> col_it1(a->columns);
- List_iterator<key_part_spec> col_it2(b->columns);
- const key_part_spec *col1, *col2;
+ List_iterator<Key_part_spec> col_it1(a->columns);
+ List_iterator<Key_part_spec> col_it2(b->columns);
+ const Key_part_spec *col1, *col2;
#ifdef ENABLE_WHEN_INNODB_CAN_HANDLE_SWAPED_FOREIGN_KEY_COLUMNS
while ((col1= col_it1++))
@@ -169,18 +203,50 @@ Open_tables_state::Open_tables_state(ulong version_arg)
reset_open_tables_state();
}
-my_bool thd_in_lock_tables(const THD *thd)
+/*
+ The following functions form part of the C plugin API
+*/
+
+extern "C" int mysql_tmpfile(const char *prefix)
+{
+ char filename[FN_REFLEN];
+ File fd = create_temp_file(filename, mysql_tmpdir, prefix,
+#ifdef __WIN__
+ O_BINARY | O_TRUNC | O_SEQUENTIAL |
+ O_SHORT_LIVED |
+#endif /* __WIN__ */
+ O_CREAT | O_EXCL | O_RDWR | O_TEMPORARY,
+ MYF(MY_WME));
+ if (fd >= 0) {
+#ifndef __WIN__
+ /*
+ This can be removed once the following bug is fixed:
+ Bug #28903 create_temp_file() doesn't honor O_TEMPORARY option
+ (file not removed) (Unix)
+ */
+ unlink(filename);
+#endif /* !__WIN__ */
+ }
+
+ return fd;
+}
+
+
+extern "C"
+int thd_in_lock_tables(const THD *thd)
{
- return thd->in_lock_tables;
+ return test(thd->in_lock_tables);
}
-my_bool thd_tablespace_op(const THD *thd)
+extern "C"
+int thd_tablespace_op(const THD *thd)
{
- return thd->tablespace_op;
+ return test(thd->tablespace_op);
}
+extern "C"
const char *set_thd_proc_info(THD *thd, const char *info,
const char *calling_function,
const char *calling_file,
@@ -195,11 +261,103 @@ const char *set_thd_proc_info(THD *thd, const char *info,
return old_info;
}
+extern "C"
void **thd_ha_data(const THD *thd, const struct handlerton *hton)
{
return (void **) thd->ha_data + hton->slot;
}
+extern "C"
+long long thd_test_options(const THD *thd, long long test_options)
+{
+ return thd->options & test_options;
+}
+
+extern "C"
+int thd_sql_command(const THD *thd)
+{
+ return (int) thd->lex->sql_command;
+}
+
+extern "C"
+int thd_tx_isolation(const THD *thd)
+{
+ return (int) thd->variables.tx_isolation;
+}
+
+extern "C"
+void thd_inc_row_count(THD *thd)
+{
+ thd->row_count++;
+}
+
+/*
+ Dumps a text description of a thread, its security context
+ (user, host) and the current query.
+
+ SYNOPSIS
+ thd_security_context()
+ thd current thread context
+ buffer pointer to preferred result buffer
+ length length of buffer
+ max_query_len how many chars of query to copy (0 for all)
+
+ RETURN VALUES
+ pointer to string
+*/
+extern "C"
+char *thd_security_context(THD *thd, char *buffer, unsigned int length,
+ unsigned int max_query_len)
+{
+ String str(buffer, length, &my_charset_latin1);
+ const Security_context *sctx= &thd->main_security_ctx;
+ char header[64];
+ int len;
+
+ len= my_snprintf(header, sizeof(header),
+ "MySQL thread id %lu, query id %lu",
+ thd->thread_id, (ulong) thd->query_id);
+ str.length(0);
+ str.append(header, len);
+
+ if (sctx->host)
+ {
+ str.append(' ');
+ str.append(sctx->host);
+ }
+
+ if (sctx->ip)
+ {
+ str.append(' ');
+ str.append(sctx->ip);
+ }
+
+ if (sctx->user)
+ {
+ str.append(' ');
+ str.append(sctx->user);
+ }
+
+ if (thd->proc_info)
+ {
+ str.append(' ');
+ str.append(thd->proc_info);
+ }
+
+ if (thd->query)
+ {
+ if (max_query_len < 1)
+ len= thd->query_length;
+ else
+ len= min(thd->query_length, max_query_len);
+ str.append('\n');
+ str.append(thd->query, len);
+ }
+ if (str.c_ptr_safe() == buffer)
+ return buffer;
+ return thd->strmake(str.ptr(), str.length());
+}
+
THD::THD()
@@ -208,16 +366,23 @@ THD::THD()
Open_tables_state(refresh_version), rli_fake(0),
lock_id(&main_lock_id),
user_time(0), in_sub_stmt(0),
- binlog_table_maps(0),
- global_read_lock(0), is_fatal_error(0),
- rand_used(0), time_zone_used(0),
+ binlog_table_maps(0), binlog_flags(0UL),
arg_of_last_insert_id_function(FALSE),
first_successful_insert_id_in_prev_stmt(0),
first_successful_insert_id_in_prev_stmt_for_binlog(0),
first_successful_insert_id_in_cur_stmt(0),
- in_lock_tables(0), bootstrap(0), derived_tables_processing(FALSE),
stmt_depends_on_first_successful_insert_id_in_prev_stmt(FALSE),
- spcont(NULL)
+ global_read_lock(0),
+ is_fatal_error(0),
+ transaction_rollback_request(0),
+ is_fatal_sub_stmt_error(0),
+ rand_used(0),
+ time_zone_used(0),
+ in_lock_tables(0),
+ bootstrap(0),
+ derived_tables_processing(FALSE),
+ spcont(NULL),
+ m_lip(NULL)
{
ulong tmp;
@@ -229,7 +394,6 @@ THD::THD()
init_sql_alloc(&main_mem_root, ALLOC_ROOT_MIN_BLOCK_SIZE, 0);
stmt_arena= this;
thread_stack= 0;
- db= 0;
catalog= (char*)"std"; // the only catalog we have for now
main_security_ctx.init();
security_ctx= &main_security_ctx;
@@ -237,13 +401,14 @@ THD::THD()
query_start_used= 0;
count_cuted_fields= CHECK_FIELD_IGNORE;
killed= NOT_KILLED;
- db_length= col_access=0;
- query_error= tmp_table_used= 0;
+ col_access=0;
+ query_error= thread_specific_used= FALSE;
hash_clear(&handler_tables_hash);
tmp_table=0;
used_tables=0;
cuted_fields= sent_row_count= row_count= 0L;
limit_found_rows= 0;
+ row_count_func= -1;
statement_id_counter= 0UL;
#ifdef ERROR_INJECT_SUPPORT
error_inject_value= 0UL;
@@ -251,10 +416,12 @@ THD::THD()
// Must be reset to handle error with THD's created for init of mysqld
lex->current_select= 0;
start_time=(time_t) 0;
- time_after_lock=(time_t) 0;
+ start_utime= 0L;
+ utime_after_lock= 0L;
current_linfo = 0;
slave_thread = 0;
- thread_id= variables.pseudo_thread_id= 0;
+ bzero(&variables, sizeof(variables));
+ thread_id= 0;
one_shot_set= 0;
file_id = 0;
query_id= 0;
@@ -359,6 +526,49 @@ void THD::pop_internal_handler()
m_internal_handler= NULL;
}
+extern "C"
+void *thd_alloc(MYSQL_THD thd, unsigned int size)
+{
+ return thd->alloc(size);
+}
+
+extern "C"
+void *thd_calloc(MYSQL_THD thd, unsigned int size)
+{
+ return thd->calloc(size);
+}
+
+extern "C"
+char *thd_strdup(MYSQL_THD thd, const char *str)
+{
+ return thd->strdup(str);
+}
+
+extern "C"
+char *thd_strmake(MYSQL_THD thd, const char *str, unsigned int size)
+{
+ return thd->strmake(str, size);
+}
+
+extern "C"
+LEX_STRING *thd_make_lex_string(THD *thd, LEX_STRING *lex_str,
+ const char *str, unsigned int size,
+ int allocate_lex_string)
+{
+ return thd->make_lex_string(lex_str, str, size,
+ (bool) allocate_lex_string);
+}
+
+extern "C"
+void *thd_memdup(MYSQL_THD thd, const void* str, unsigned int size)
+{
+ return thd->memdup(str, size);
+}
+
+void thd_get_xid(const MYSQL_THD thd, MYSQL_XID *xid)
+{
+ *xid = *(MYSQL_XID *) &thd->transaction.xid_state.xid;
+}
/*
Init common variables that has to be reset on start and on change_user
@@ -367,19 +577,25 @@ void THD::pop_internal_handler()
void THD::init(void)
{
pthread_mutex_lock(&LOCK_global_system_variables);
- variables= global_system_variables;
+ plugin_thdvar_init(this);
variables.time_format= date_time_format_copy((THD*) 0,
variables.time_format);
variables.date_format= date_time_format_copy((THD*) 0,
variables.date_format);
variables.datetime_format= date_time_format_copy((THD*) 0,
variables.datetime_format);
+ /*
+ variables= global_system_variables above has reset
+ variables.pseudo_thread_id to 0. We need to correct it here to
+ avoid temporary tables replication failure.
+ */
+ variables.pseudo_thread_id= thread_id;
pthread_mutex_unlock(&LOCK_global_system_variables);
server_status= SERVER_STATUS_AUTOCOMMIT;
if (variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES)
server_status|= SERVER_STATUS_NO_BACKSLASH_ESCAPES;
options= thd_startup_options;
- no_trans_update.stmt= no_trans_update.all= FALSE;
+ transaction.all.modified_non_trans_table= transaction.stmt.modified_non_trans_table= FALSE;
open_options=ha_open_options;
update_lock_default= (variables.low_priority_updates ?
TL_WRITE_LOW_PRIORITY :
@@ -516,6 +732,7 @@ THD::~THD()
cleanup();
ha_close_connection(this);
+ plugin_thdvar_cleanup(this);
DBUG_PRINT("info", ("freeing security context"));
main_security_ctx.destroy();
@@ -555,7 +772,7 @@ THD::~THD()
void add_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var)
{
- ulong *end= (ulong*) ((byte*) to_var +
+ ulong *end= (ulong*) ((uchar*) to_var +
offsetof(STATUS_VAR, last_system_status_var) +
sizeof(ulong));
ulong *to= (ulong*) to_var, *from= (ulong*) from_var;
@@ -580,7 +797,7 @@ void add_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var)
void add_diff_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var,
STATUS_VAR *dec_var)
{
- ulong *end= (ulong*) ((byte*) to_var + offsetof(STATUS_VAR,
+ ulong *end= (ulong*) ((uchar*) to_var + offsetof(STATUS_VAR,
last_system_status_var) +
sizeof(ulong));
ulong *to= (ulong*) to_var, *from= (ulong*) from_var, *dec= (ulong*) dec_var;
@@ -726,6 +943,30 @@ void THD::cleanup_after_query()
}
+/**
+ Create a LEX_STRING in this connection
+
+ @param lex_str pointer to LEX_STRING object to be initialized
+ @param str initializer to be copied into lex_str
+ @param length length of str, in bytes
+ @param allocate_lex_string if TRUE, allocate new LEX_STRING object,
+ instead of using lex_str value
+ @return NULL on failure, or pointer to the LEX_STRING object
+*/
+LEX_STRING *THD::make_lex_string(LEX_STRING *lex_str,
+ const char* str, uint length,
+ bool allocate_lex_string)
+{
+ if (allocate_lex_string)
+ if (!(lex_str= (LEX_STRING *)alloc(sizeof(LEX_STRING))))
+ return 0;
+ if (!(lex_str->str= strmake_root(mem_root, str, length)))
+ return 0;
+ lex_str->length= length;
+ return lex_str;
+}
+
+
/*
Convert a string to another character set
@@ -751,9 +992,9 @@ bool THD::convert_string(LEX_STRING *to, CHARSET_INFO *to_cs,
CHARSET_INFO *from_cs)
{
DBUG_ENTER("convert_string");
- size_s new_length= to_cs->mbmaxlen * from_length;
+ size_t new_length= to_cs->mbmaxlen * from_length;
uint dummy_errors;
- if (!(to->str= alloc(new_length+1)))
+ if (!(to->str= (char*) alloc(new_length+1)))
{
to->length= 0; // Safety fix
DBUG_RETURN(1); // EOM
@@ -837,7 +1078,7 @@ void THD::add_changed_table(TABLE *table)
DBUG_ASSERT((options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) &&
table->file->has_transactions());
add_changed_table(table->s->table_cache_key.str,
- table->s->table_cache_key.length);
+ (long) table->s->table_cache_key.length);
DBUG_VOID_RETURN;
}
@@ -897,8 +1138,7 @@ CHANGED_TABLE_LIST* THD::changed_table_dup(const char *key, long key_length)
return 0;
}
- new_table->key = (char *) (((byte*)new_table)+
- ALIGN_SIZE(sizeof(CHANGED_TABLE_LIST)));
+ new_table->key= ((char*)new_table)+ ALIGN_SIZE(sizeof(CHANGED_TABLE_LIST));
new_table->next = 0;
new_table->key_length = key_length;
::memcpy(new_table->key, key, key_length);
@@ -1076,7 +1316,7 @@ void select_send::abort()
{
DBUG_ENTER("select_send::abort");
if (status && thd->spcont &&
- thd->spcont->find_handler(thd->net.last_errno,
+ thd->spcont->find_handler(thd, thd->net.last_errno,
MYSQL_ERROR::WARN_LEVEL_ERROR))
{
/*
@@ -1321,6 +1561,8 @@ select_export::prepare(List<Item> &list, SELECT_LEX_UNIT *u)
field_sep_char= (exchange->enclosed->length() ? (*exchange->enclosed)[0] :
field_term_length ? (*exchange->field_term)[0] : INT_MAX);
escape_char= (exchange->escaped->length() ? (*exchange->escaped)[0] : -1);
+ is_ambiguous_field_sep= test(strchr(ESCAPE_CHARS, field_sep_char));
+ is_unsafe_field_sep= test(strchr(NUMERIC_CHARS, field_sep_char));
line_sep_char= (exchange->line_term->length() ?
(*exchange->line_term)[0] : INT_MAX);
if (!field_term_length)
@@ -1333,6 +1575,11 @@ select_export::prepare(List<Item> &list, SELECT_LEX_UNIT *u)
}
+#define NEED_ESCAPING(x) ((int) (uchar) (x) == escape_char || \
+ (int) (uchar) (x) == field_sep_char || \
+ (int) (uchar) (x) == line_sep_char || \
+ !(x))
+
bool select_export::send_data(List<Item> &items)
{
@@ -1352,7 +1599,7 @@ bool select_export::send_data(List<Item> &items)
uint used_length=0,items_left=items.elements;
List_iterator_fast<Item> li(items);
- if (my_b_write(&cache,(byte*) exchange->line_start->ptr(),
+ if (my_b_write(&cache,(uchar*) exchange->line_start->ptr(),
exchange->line_start->length()))
goto err;
while ((item=li++))
@@ -1361,7 +1608,7 @@ bool select_export::send_data(List<Item> &items)
res=item->str_result(&tmp);
if (res && (!exchange->opt_enclosed || result_type == STRING_RESULT))
{
- if (my_b_write(&cache,(byte*) exchange->enclosed->ptr(),
+ if (my_b_write(&cache,(uchar*) exchange->enclosed->ptr(),
exchange->enclosed->length()))
goto err;
}
@@ -1373,10 +1620,10 @@ bool select_export::send_data(List<Item> &items)
{
null_buff[0]=escape_char;
null_buff[1]='N';
- if (my_b_write(&cache,(byte*) null_buff,2))
+ if (my_b_write(&cache,(uchar*) null_buff,2))
goto err;
}
- else if (my_b_write(&cache,(byte*) "NULL",4))
+ else if (my_b_write(&cache,(uchar*) "NULL",4))
goto err;
}
else
@@ -1390,16 +1637,23 @@ bool select_export::send_data(List<Item> &items)
used_length=min(res->length(),item->max_length);
else
used_length=res->length();
- if (result_type == STRING_RESULT && escape_char != -1)
+ if ((result_type == STRING_RESULT || is_unsafe_field_sep) &&
+ escape_char != -1)
{
- char *pos,*start,*end;
-
+ char *pos, *start, *end;
+ CHARSET_INFO *res_charset= res->charset();
+ CHARSET_INFO *character_set_client= thd->variables.
+ character_set_client;
+ bool check_second_byte= (res_charset == &my_charset_bin) &&
+ character_set_client->
+ escape_with_backslash_is_dangerous;
+ DBUG_ASSERT(character_set_client->mbmaxlen == 2 ||
+ !character_set_client->escape_with_backslash_is_dangerous);
for (start=pos=(char*) res->ptr(),end=pos+used_length ;
pos != end ;
pos++)
{
#ifdef USE_MB
- CHARSET_INFO *res_charset=res->charset();
if (use_mb(res_charset))
{
int l;
@@ -1410,22 +1664,60 @@ bool select_export::send_data(List<Item> &items)
}
}
#endif
- if ((int) *pos == escape_char || (int) *pos == field_sep_char ||
- (int) *pos == line_sep_char || !*pos)
- {
+
+ /*
+ Special case when dumping BINARY/VARBINARY/BLOB values
+ for the clients with character sets big5, cp932, gbk and sjis,
+ which can have the escape character (0x5C "\" by default)
+ as the second byte of a multi-byte sequence.
+
+ If
+ - pos[0] is a valid multi-byte head (e.g 0xEE) and
+ - pos[1] is 0x00, which will be escaped as "\0",
+
+ then we'll get "0xEE + 0x5C + 0x30" in the output file.
+
+ If this file is later loaded using this sequence of commands:
+
+ mysql> create table t1 (a varchar(128)) character set big5;
+ mysql> LOAD DATA INFILE 'dump.txt' INTO TABLE t1;
+
+ then 0x5C will be misinterpreted as the second byte
+ of a multi-byte character "0xEE + 0x5C", instead of
+ escape character for 0x00.
+
+ To avoid this confusion, we'll escape the multi-byte
+ head character too, so the sequence "0xEE + 0x00" will be
+ dumped as "0x5C + 0xEE + 0x5C + 0x30".
+
+ Note, in the condition below we only check if
+ mbcharlen is equal to 2, because there are no
+ character sets with mbmaxlen longer than 2
+ and with escape_with_backslash_is_dangerous set.
+ DBUG_ASSERT before the loop makes that sure.
+ */
+
+ if (NEED_ESCAPING(*pos) ||
+ (check_second_byte &&
+ my_mbcharlen(character_set_client, (uchar) *pos) == 2 &&
+ pos + 1 < end &&
+ NEED_ESCAPING(pos[1])))
+ {
char tmp_buff[2];
- tmp_buff[0]= escape_char;
+ tmp_buff[0]= ((int) *pos == field_sep_char &&
+ is_ambiguous_field_sep) ?
+ field_sep_char : escape_char;
tmp_buff[1]= *pos ? *pos : '0';
- if (my_b_write(&cache,(byte*) start,(uint) (pos-start)) ||
- my_b_write(&cache,(byte*) tmp_buff,2))
+ if (my_b_write(&cache,(uchar*) start,(uint) (pos-start)) ||
+ my_b_write(&cache,(uchar*) tmp_buff,2))
goto err;
start=pos+1;
}
}
- if (my_b_write(&cache,(byte*) start,(uint) (pos-start)))
+ if (my_b_write(&cache,(uchar*) start,(uint) (pos-start)))
goto err;
}
- else if (my_b_write(&cache,(byte*) res->ptr(),used_length))
+ else if (my_b_write(&cache,(uchar*) res->ptr(),used_length))
goto err;
}
if (fixed_row_size)
@@ -1441,27 +1733,27 @@ bool select_export::send_data(List<Item> &items)
uint length=item->max_length-used_length;
for (; length > sizeof(space) ; length-=sizeof(space))
{
- if (my_b_write(&cache,(byte*) space,sizeof(space)))
+ if (my_b_write(&cache,(uchar*) space,sizeof(space)))
goto err;
}
- if (my_b_write(&cache,(byte*) space,length))
+ if (my_b_write(&cache,(uchar*) space,length))
goto err;
}
}
if (res && (!exchange->opt_enclosed || result_type == STRING_RESULT))
{
- if (my_b_write(&cache, (byte*) exchange->enclosed->ptr(),
+ if (my_b_write(&cache, (uchar*) exchange->enclosed->ptr(),
exchange->enclosed->length()))
goto err;
}
if (--items_left)
{
- if (my_b_write(&cache, (byte*) exchange->field_term->ptr(),
+ if (my_b_write(&cache, (uchar*) exchange->field_term->ptr(),
field_term_length))
goto err;
}
}
- if (my_b_write(&cache,(byte*) exchange->line_term->ptr(),
+ if (my_b_write(&cache,(uchar*) exchange->line_term->ptr(),
exchange->line_term->length()))
goto err;
DBUG_RETURN(0);
@@ -1508,10 +1800,10 @@ bool select_dump::send_data(List<Item> &items)
res=item->str_result(&tmp);
if (!res) // If NULL
{
- if (my_b_write(&cache,(byte*) "",1))
+ if (my_b_write(&cache,(uchar*) "",1))
goto err;
}
- else if (my_b_write(&cache,(byte*) res->ptr(),res->length()))
+ else if (my_b_write(&cache,(uchar*) res->ptr(),res->length()))
{
my_error(ER_ERROR_ON_WRITE, MYF(0), path, my_errno);
goto err;
@@ -1746,7 +2038,7 @@ void Query_arena::cleanup_stmt()
}
/*
- Statement functions
+ Statement functions
*/
Statement::Statement(LEX *lex_arg, MEM_ROOT *mem_root_arg,
@@ -1757,7 +2049,9 @@ Statement::Statement(LEX *lex_arg, MEM_ROOT *mem_root_arg,
lex(lex_arg),
query(0),
query_length(0),
- cursor(0)
+ cursor(0),
+ db(NULL),
+ db_length(0)
{
name.str= NULL;
}
@@ -1846,13 +2140,13 @@ Statement::~Statement()
C_MODE_START
-static byte *
-get_statement_id_as_hash_key(const byte *record, uint *key_length,
+static uchar *
+get_statement_id_as_hash_key(const uchar *record, size_t *key_length,
my_bool not_used __attribute__((unused)))
{
const Statement *statement= (const Statement *) record;
*key_length= sizeof(statement->id);
- return (byte *) &((const Statement *) statement)->id;
+ return (uchar *) &((const Statement *) statement)->id;
}
static void delete_statement_as_hash_key(void *key)
@@ -1860,11 +2154,11 @@ static void delete_statement_as_hash_key(void *key)
delete (Statement *) key;
}
-static byte *get_stmt_name_hash_key(Statement *entry, uint *length,
+static uchar *get_stmt_name_hash_key(Statement *entry, size_t *length,
my_bool not_used __attribute__((unused)))
{
- *length=(uint) entry->name.length;
- return (byte*) entry->name.str;
+ *length= entry->name.length;
+ return (uchar*) entry->name.str;
}
C_MODE_END
@@ -1909,7 +2203,7 @@ Statement_map::Statement_map() :
int Statement_map::insert(THD *thd, Statement *statement)
{
- if (my_hash_insert(&st_hash, (byte*) statement))
+ if (my_hash_insert(&st_hash, (uchar*) statement))
{
/*
Delete is needed only in case of an insert failure. In all other
@@ -1919,7 +2213,7 @@ int Statement_map::insert(THD *thd, Statement *statement)
my_error(ER_OUT_OF_RESOURCES, MYF(0));
goto err_st_hash;
}
- if (statement->name.str && my_hash_insert(&names_hash, (byte*) statement))
+ if (statement->name.str && my_hash_insert(&names_hash, (uchar*) statement))
{
my_error(ER_OUT_OF_RESOURCES, MYF(0));
goto err_names_hash;
@@ -1947,9 +2241,9 @@ int Statement_map::insert(THD *thd, Statement *statement)
err_max:
if (statement->name.str)
- hash_delete(&names_hash, (byte*) statement);
+ hash_delete(&names_hash, (uchar*) statement);
err_names_hash:
- hash_delete(&st_hash, (byte*) statement);
+ hash_delete(&st_hash, (uchar*) statement);
err_st_hash:
return 1;
}
@@ -1970,9 +2264,9 @@ void Statement_map::erase(Statement *statement)
if (statement == last_found_statement)
last_found_statement= 0;
if (statement->name.str)
- hash_delete(&names_hash, (byte *) statement);
+ hash_delete(&names_hash, (uchar *) statement);
- hash_delete(&st_hash, (byte *) statement);
+ hash_delete(&st_hash, (uchar *) statement);
pthread_mutex_lock(&LOCK_prepared_stmt_count);
DBUG_ASSERT(prepared_stmt_count > 0);
prepared_stmt_count--;
@@ -2140,6 +2434,10 @@ bool Security_context::set_user(char *user_arg)
Initialize this security context from the passed in credentials
and activate it in the current thread.
+ @param thd
+ @param definer_user
+ @param definer_host
+ @param db
@param[out] backup Save a pointer to the current security context
in the thread. In case of success it points to the
saved old context, otherwise it points to NULL.
@@ -2265,7 +2563,48 @@ void THD::restore_backup_open_tables_state(Open_tables_state *backup)
DBUG_VOID_RETURN;
}
+/**
+ Check the killed state of a user thread
+ @param thd user thread
+ @retval 0 the user thread is active
+ @retval 1 the user thread has been killed
+*/
+extern "C" int thd_killed(const MYSQL_THD thd)
+{
+ return(thd->killed);
+}
+#ifdef INNODB_COMPATIBILITY_HOOKS
+extern "C" struct charset_info_st *thd_charset(MYSQL_THD thd)
+{
+ return(thd->charset());
+}
+
+extern "C" char **thd_query(MYSQL_THD thd)
+{
+ return(&thd->query);
+}
+
+extern "C" int thd_slave_thread(const MYSQL_THD thd)
+{
+ return(thd->slave_thread);
+}
+
+extern "C" int thd_non_transactional_update(const MYSQL_THD thd)
+{
+ return(thd->transaction.all.modified_non_trans_table);
+}
+
+extern "C" int thd_binlog_format(const MYSQL_THD thd)
+{
+ return (int) thd->variables.binlog_format;
+}
+
+extern "C" void thd_mark_transaction_to_rollback(MYSQL_THD thd, bool all)
+{
+ mark_transaction_to_rollback(thd, all);
+}
+#endif // INNODB_COMPATIBILITY_HOOKS */
/****************************************************************************
Handling of statement states in functions and triggers.
@@ -2366,6 +2705,13 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup)
limit_found_rows= backup->limit_found_rows;
sent_row_count= backup->sent_row_count;
client_capabilities= backup->client_capabilities;
+ /*
+ If we've left sub-statement mode, reset the fatal error flag.
+ Otherwise keep the current value, to propagate it up the sub-statement
+ stack.
+ */
+ if (!in_sub_stmt)
+ is_fatal_sub_stmt_error= FALSE;
if ((options & OPTION_BIN_LOG) && is_update_query(lex->sql_command) &&
!current_stmt_binlog_row_based)
@@ -2380,6 +2726,18 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup)
}
+/**
+ Mark transaction to rollback and mark error as fatal to a sub-statement.
+
+ @param thd Thread handle
+ @param all TRUE <=> rollback main transaction.
+*/
+
+void mark_transaction_to_rollback(THD *thd, bool all)
+{
+ thd->is_fatal_sub_stmt_error= TRUE;
+ thd->transaction_rollback_request= all;
+}
/***************************************************************************
Handling of XA id cacheing
***************************************************************************/
@@ -2387,17 +2745,20 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup)
pthread_mutex_t LOCK_xid_cache;
HASH xid_cache;
-static byte *xid_get_hash_key(const byte *ptr,uint *length,
+extern "C" uchar *xid_get_hash_key(const uchar *, size_t *, my_bool);
+extern "C" void xid_free_hash(void *);
+
+uchar *xid_get_hash_key(const uchar *ptr, size_t *length,
my_bool not_used __attribute__((unused)))
{
*length=((XID_STATE*)ptr)->xid.key_length();
return ((XID_STATE*)ptr)->xid.key();
}
-static void xid_free_hash (void *ptr)
+void xid_free_hash(void *ptr)
{
if (!((XID_STATE*)ptr)->in_thd)
- my_free((gptr)ptr, MYF(0));
+ my_free((uchar*)ptr, MYF(0));
}
bool xid_cache_init()
@@ -2439,7 +2800,7 @@ bool xid_cache_insert(XID *xid, enum xa_states xa_state)
xs->xa_state=xa_state;
xs->xid.set(xid);
xs->in_thd=0;
- res=my_hash_insert(&xid_cache, (byte*)xs);
+ res=my_hash_insert(&xid_cache, (uchar*)xs);
}
pthread_mutex_unlock(&LOCK_xid_cache);
return res;
@@ -2451,7 +2812,7 @@ 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);
- my_bool res=my_hash_insert(&xid_cache, (byte*)xid_state);
+ my_bool res=my_hash_insert(&xid_cache, (uchar*)xid_state);
pthread_mutex_unlock(&LOCK_xid_cache);
return res;
}
@@ -2460,7 +2821,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, (byte *)xid_state);
+ hash_delete(&xid_cache, (uchar *)xid_state);
pthread_mutex_unlock(&LOCK_xid_cache);
}
@@ -2496,8 +2857,8 @@ void xid_cache_delete(XID_STATE *xid_state)
template <class RowsEventT> Rows_log_event*
THD::binlog_prepare_pending_rows_event(TABLE* table, uint32 serv_id,
MY_BITMAP const* cols,
- my_size_t colcnt,
- my_size_t needed,
+ size_t colcnt,
+ size_t needed,
bool is_transactional,
RowsEventT *hint __attribute__((unused)))
{
@@ -2567,17 +2928,17 @@ THD::binlog_prepare_pending_rows_event(TABLE* table, uint32 serv_id,
*/
template Rows_log_event*
THD::binlog_prepare_pending_rows_event(TABLE*, uint32, MY_BITMAP const*,
- my_size_t, my_size_t, bool,
+ size_t, size_t, bool,
Write_rows_log_event*);
template Rows_log_event*
THD::binlog_prepare_pending_rows_event(TABLE*, uint32, MY_BITMAP const*,
- my_size_t colcnt, my_size_t, bool,
+ size_t colcnt, size_t, bool,
Delete_rows_log_event *);
template Rows_log_event*
THD::binlog_prepare_pending_rows_event(TABLE*, uint32, MY_BITMAP const*,
- my_size_t colcnt, my_size_t, bool,
+ size_t colcnt, size_t, bool,
Update_rows_log_event *);
#endif
@@ -2646,27 +3007,6 @@ field_type_name(enum_field_types type)
#endif
-my_size_t THD::max_row_length_blob(TABLE *table, const byte *data) const
-{
- my_size_t length= 0;
- TABLE_SHARE *table_s= table->s;
- uint* const beg= table_s->blob_field;
- uint* const end= beg + table_s->blob_fields;
-
- for (uint *ptr= beg ; ptr != end ; ++ptr)
- {
- Field_blob* const blob= (Field_blob*) table->field[*ptr];
- length+= blob->get_length((const char*) (data +
- blob->offset(table->record[0]))) +
- HA_KEY_BLOB_LENGTH;
- }
-
- return length;
-}
-
-
-
-
namespace {
/**
Class to handle temporary allocation of memory for row data.
@@ -2695,7 +3035,7 @@ namespace {
@param length
Length of data that is needed, if the record contain blobs.
*/
- Row_data_memory(TABLE *table, my_size_t const len1)
+ Row_data_memory(TABLE *table, size_t const len1)
: m_memory(0)
{
#ifndef DBUG_OFF
@@ -2706,7 +3046,7 @@ namespace {
m_ptr[1]= 0;
}
- Row_data_memory(TABLE *table, my_size_t const len1, my_size_t const len2)
+ Row_data_memory(TABLE *table, size_t const len1, size_t const len2)
: m_memory(0)
{
#ifndef DBUG_OFF
@@ -2720,7 +3060,7 @@ namespace {
~Row_data_memory()
{
if (m_memory != 0 && m_release_memory_on_destruction)
- my_free((gptr) m_memory, MYF(MY_WME));
+ my_free((uchar*) m_memory, MYF(MY_WME));
}
/**
@@ -2736,7 +3076,7 @@ namespace {
return m_memory != 0;
}
- byte *slot(uint s)
+ uchar *slot(uint s)
{
DBUG_ASSERT(s < sizeof(m_ptr)/sizeof(*m_ptr));
DBUG_ASSERT(m_ptr[s] != 0);
@@ -2745,7 +3085,7 @@ namespace {
}
private:
- void allocate_memory(TABLE *const table, my_size_t const total_length)
+ void allocate_memory(TABLE *const table, size_t const total_length)
{
if (table->s->blob_fields == 0)
{
@@ -2759,7 +3099,7 @@ namespace {
to add two bytes for each field, which can potentially be
added to hold the length of a packed field.
*/
- my_size_t const maxlen= table->s->reclength + 2 * table->s->fields;
+ size_t const maxlen= table->s->reclength + 2 * table->s->fields;
/*
Allocate memory for two records if memory hasn't been
@@ -2768,13 +3108,13 @@ namespace {
*/
if (table->write_row_record == 0)
table->write_row_record=
- (byte *) alloc_root(&table->mem_root, 2 * maxlen);
+ (uchar *) alloc_root(&table->mem_root, 2 * maxlen);
m_memory= table->write_row_record;
m_release_memory_on_destruction= FALSE;
}
else
{
- m_memory= (byte *) my_malloc(total_length, MYF(MY_WME));
+ m_memory= (uchar *) my_malloc(total_length, MYF(MY_WME));
m_release_memory_on_destruction= TRUE;
}
}
@@ -2783,15 +3123,15 @@ namespace {
mutable bool m_alloc_checked;
#endif
bool m_release_memory_on_destruction;
- byte *m_memory;
- byte *m_ptr[2];
+ uchar *m_memory;
+ uchar *m_ptr[2];
};
}
int THD::binlog_write_row(TABLE* table, bool is_trans,
- MY_BITMAP const* cols, my_size_t colcnt,
- byte const *record)
+ MY_BITMAP const* cols, size_t colcnt,
+ uchar const *record)
{
DBUG_ASSERT(current_stmt_binlog_row_based && mysql_bin_log.is_open());
@@ -2803,9 +3143,9 @@ int THD::binlog_write_row(TABLE* table, bool is_trans,
if (!memory.has_memory())
return HA_ERR_OUT_OF_MEM;
- byte *row_data= memory.slot(0);
+ uchar *row_data= memory.slot(0);
- my_size_t const len= pack_row(table, cols, row_data, record);
+ size_t const len= pack_row(table, cols, row_data, record);
Rows_log_event* const ev=
binlog_prepare_pending_rows_event(table, server_id, cols, colcnt,
@@ -2819,25 +3159,25 @@ int THD::binlog_write_row(TABLE* table, bool is_trans,
}
int THD::binlog_update_row(TABLE* table, bool is_trans,
- MY_BITMAP const* cols, my_size_t colcnt,
- const byte *before_record,
- const byte *after_record)
+ MY_BITMAP const* cols, size_t colcnt,
+ const uchar *before_record,
+ const uchar *after_record)
{
DBUG_ASSERT(current_stmt_binlog_row_based && mysql_bin_log.is_open());
- my_size_t const before_maxlen = max_row_length(table, before_record);
- my_size_t const after_maxlen = max_row_length(table, after_record);
+ size_t const before_maxlen = max_row_length(table, before_record);
+ size_t const after_maxlen = max_row_length(table, after_record);
Row_data_memory row_data(table, before_maxlen, after_maxlen);
if (!row_data.has_memory())
return HA_ERR_OUT_OF_MEM;
- byte *before_row= row_data.slot(0);
- byte *after_row= row_data.slot(1);
+ uchar *before_row= row_data.slot(0);
+ uchar *after_row= row_data.slot(1);
- my_size_t const before_size= pack_row(table, cols, before_row,
+ size_t const before_size= pack_row(table, cols, before_row,
before_record);
- my_size_t const after_size= pack_row(table, cols, after_row,
+ size_t const after_size= pack_row(table, cols, after_row,
after_record);
/*
@@ -2845,10 +3185,10 @@ int THD::binlog_update_row(TABLE* table, bool is_trans,
trigger false warnings.
*/
#ifndef HAVE_purify
- DBUG_DUMP("before_record", (const char *)before_record, table->s->reclength);
- DBUG_DUMP("after_record", (const char *)after_record, table->s->reclength);
- DBUG_DUMP("before_row", (const char *)before_row, before_size);
- DBUG_DUMP("after_row", (const char *)after_row, after_size);
+ DBUG_DUMP("before_record", before_record, table->s->reclength);
+ DBUG_DUMP("after_record", after_record, table->s->reclength);
+ DBUG_DUMP("before_row", before_row, before_size);
+ DBUG_DUMP("after_row", after_row, after_size);
#endif
Rows_log_event* const ev=
@@ -2865,8 +3205,8 @@ int THD::binlog_update_row(TABLE* table, bool is_trans,
}
int THD::binlog_delete_row(TABLE* table, bool is_trans,
- MY_BITMAP const* cols, my_size_t colcnt,
- byte const *record)
+ MY_BITMAP const* cols, size_t colcnt,
+ uchar const *record)
{
DBUG_ASSERT(current_stmt_binlog_row_based && mysql_bin_log.is_open());
@@ -2878,9 +3218,9 @@ int THD::binlog_delete_row(TABLE* table, bool is_trans,
if (unlikely(!memory.has_memory()))
return HA_ERR_OUT_OF_MEM;
- byte *row_data= memory.slot(0);
+ uchar *row_data= memory.slot(0);
- my_size_t const len= pack_row(table, cols, row_data, record);
+ size_t const len= pack_row(table, cols, row_data, record);
Rows_log_event* const ev=
binlog_prepare_pending_rows_event(table, server_id, cols, colcnt,
@@ -2926,15 +3266,6 @@ int THD::binlog_flush_pending_rows_event(bool stmt_end)
}
-void THD::binlog_delete_pending_rows_event()
-{
- if (Rows_log_event *pending= binlog_get_pending_rows_event())
- {
- delete pending;
- binlog_set_pending_rows_event(0);
- }
-}
-
/*
Member function that will log query, either row-based or
statement-based depending on the value of the 'current_stmt_binlog_row_based'
@@ -2958,13 +3289,13 @@ void THD::binlog_delete_pending_rows_event()
RETURN VALUE
Error code, or 0 if no error.
*/
-int THD::binlog_query(THD::enum_binlog_query_type qtype,
- char const *query, ulong query_len,
- bool is_trans, bool suppress_use)
+int THD::binlog_query(THD::enum_binlog_query_type qtype, char const *query_arg,
+ ulong query_len, bool is_trans, bool suppress_use,
+ THD::killed_state killed_status_arg)
{
DBUG_ENTER("THD::binlog_query");
- DBUG_PRINT("enter", ("qtype=%d, query='%s'", qtype, query));
- DBUG_ASSERT(query && mysql_bin_log.is_open());
+ DBUG_PRINT("enter", ("qtype: %d query: '%s'", qtype, query_arg));
+ DBUG_ASSERT(query_arg && mysql_bin_log.is_open());
/*
If we are not in prelocked mode, mysql_unlock_tables() will be
@@ -2979,6 +3310,27 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype,
if (int error= binlog_flush_pending_rows_event(TRUE))
DBUG_RETURN(error);
+ /*
+ If we are in statement mode and trying to log an unsafe statement,
+ we should print a warning.
+ */
+ if (lex->is_stmt_unsafe() &&
+ variables.binlog_format == BINLOG_FORMAT_STMT)
+ {
+ DBUG_ASSERT(this->query != NULL);
+ push_warning(this, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_BINLOG_UNSAFE_STATEMENT,
+ ER(ER_BINLOG_UNSAFE_STATEMENT));
+ if (!(binlog_flags & BINLOG_FLAG_UNSAFE_STMT_PRINTED))
+ {
+ char warn_buf[MYSQL_ERRMSG_SIZE];
+ my_snprintf(warn_buf, MYSQL_ERRMSG_SIZE, "%s Statement: %s",
+ ER(ER_BINLOG_UNSAFE_STATEMENT), this->query);
+ sql_print_warning(warn_buf);
+ binlog_flags|= BINLOG_FLAG_UNSAFE_STMT_PRINTED;
+ }
+ }
+
switch (qtype) {
case THD::ROW_QUERY_TYPE:
if (current_stmt_binlog_row_based)
@@ -2999,7 +3351,8 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype,
flush the pending rows event if necessary.
*/
{
- Query_log_event qinfo(this, query, query_len, is_trans, suppress_use);
+ Query_log_event qinfo(this, query_arg, query_len, is_trans, suppress_use,
+ killed_status_arg);
qinfo.flags|= LOG_EVENT_UPDATE_TABLE_MAP_VERSION_F;
/*
Binlog table maps will be irrelevant after a Query_log_event
diff --git a/sql/sql_class.h b/sql/sql_class.h
index b082adf9c9c..78b8d9f2228 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -23,14 +23,14 @@
#include "log.h"
#include "rpl_tblmap.h"
-struct st_relay_log_info;
-typedef st_relay_log_info RELAY_LOG_INFO;
+class Relay_log_info;
class Query_log_event;
class Load_log_event;
class Slave_log_event;
class sp_rcontext;
class sp_cache;
+class Lex_input_stream;
class Rows_log_event;
enum enum_enable_or_disable { LEAVE_AS_IS, ENABLE, DISABLE };
@@ -38,8 +38,6 @@ enum enum_ha_read_modes { RFIRST, RNEXT, RPREV, RLAST, RKEY, RNEXT_SAME };
enum enum_duplicates { DUP_ERROR, DUP_REPLACE, DUP_UPDATE };
enum enum_delay_key_write { DELAY_KEY_WRITE_NONE, DELAY_KEY_WRITE_ON,
DELAY_KEY_WRITE_ALL };
-enum enum_check_fields
-{ CHECK_FIELD_IGNORE, CHECK_FIELD_WARN, CHECK_FIELD_ERROR_FOR_NULL };
enum enum_mark_columns
{ MARK_COLUMNS_NONE, MARK_COLUMNS_READ, MARK_COLUMNS_WRITE};
@@ -66,12 +64,25 @@ typedef struct st_user_var_events
#define RP_LOCK_LOG_IS_ALREADY_LOCKED 1
#define RP_FORCE_ROTATE 2
+/*
+ The COPY_INFO structure is used by INSERT/REPLACE code.
+ The schema of the row counting by the INSERT/INSERT ... ON DUPLICATE KEY
+ UPDATE code:
+ If a row is inserted then the copied variable is incremented.
+ If a row is updated by the INSERT ... ON DUPLICATE KEY UPDATE and the
+ new data differs from the old one then the copied and the updated
+ variables are incremented.
+ The touched variable is incremented if a row was touched by the update part
+ of the INSERT ... ON DUPLICATE KEY UPDATE no matter whether the row
+ was actually changed or not.
+*/
typedef struct st_copy_info {
- ha_rows records;
- ha_rows deleted;
- ha_rows updated;
- ha_rows copied;
+ ha_rows records; /* Number of processed records */
+ ha_rows deleted; /* Number of deleted records */
+ ha_rows updated; /* Number of updated records */
+ ha_rows copied; /* Number of copied records */
ha_rows error_count;
+ ha_rows touched; /* Number of touched records */
enum enum_duplicates handle_duplicates;
int escape_char, last_errno;
bool ignore;
@@ -83,12 +94,23 @@ typedef struct st_copy_info {
} COPY_INFO;
-class key_part_spec :public Sql_alloc {
+class Key_part_spec :public Sql_alloc {
public:
const char *field_name;
uint length;
- key_part_spec(const char *name,uint len=0) :field_name(name), length(len) {}
- bool operator==(const key_part_spec& other) const;
+ Key_part_spec(const char *name,uint len=0) :field_name(name), length(len) {}
+ bool operator==(const Key_part_spec& other) const;
+ /**
+ Construct a copy of this Key_part_spec. field_name is copied
+ by-pointer as it is known to never change. At the same time
+ 'length' may be reset in mysql_prepare_create_table, and this
+ is why we supply it with a copy.
+
+ @return If out of memory, 0 is returned and an error is set in
+ THD.
+ */
+ Key_part_spec *clone(MEM_ROOT *mem_root) const
+ { return new (mem_root) Key_part_spec(*this); }
};
@@ -99,6 +121,12 @@ public:
enum drop_type type;
Alter_drop(enum drop_type par_type,const char *par_name)
:name(par_name), type(par_type) {}
+ /**
+ Used to make a clone of this object for ALTER/CREATE TABLE
+ @sa comment for Key_part_spec::clone
+ */
+ Alter_drop *clone(MEM_ROOT *mem_root) const
+ { return new (mem_root) Alter_drop(*this); }
};
@@ -108,6 +136,12 @@ public:
Item *def;
Alter_column(const char *par_name,Item *literal)
:name(par_name), def(literal) {}
+ /**
+ Used to make a clone of this object for ALTER/CREATE TABLE
+ @sa comment for Key_part_spec::clone
+ */
+ Alter_column *clone(MEM_ROOT *mem_root) const
+ { return new (mem_root) Alter_column(*this); }
};
@@ -116,24 +150,31 @@ public:
enum Keytype { PRIMARY, UNIQUE, MULTIPLE, FULLTEXT, SPATIAL, FOREIGN_KEY};
enum Keytype type;
KEY_CREATE_INFO key_create_info;
- List<key_part_spec> columns;
+ List<Key_part_spec> columns;
const char *name;
bool generated;
Key(enum Keytype type_par, const char *name_arg,
KEY_CREATE_INFO *key_info_arg,
- bool generated_arg, List<key_part_spec> &cols)
+ 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() {}
+ Key(const Key &rhs, MEM_ROOT *mem_root);
+ virtual ~Key() {}
/* Equality comparison of keys (ignoring name) */
friend bool foreign_key_prefix(Key *a, Key *b);
+ /**
+ Used to make a clone of this object for ALTER/CREATE TABLE
+ @sa comment for Key_part_spec::clone
+ */
+ virtual Key *clone(MEM_ROOT *mem_root) const
+ { return new (mem_root) Key(*this, mem_root); }
};
class Table_ident;
-class foreign_key: public Key {
+class Foreign_key: public Key {
public:
enum fk_match_opt { FK_MATCH_UNDEF, FK_MATCH_FULL,
FK_MATCH_PARTIAL, FK_MATCH_SIMPLE};
@@ -141,16 +182,23 @@ public:
FK_OPTION_SET_NULL, FK_OPTION_NO_ACTION, FK_OPTION_DEFAULT};
Table_ident *ref_table;
- List<key_part_spec> ref_columns;
+ List<Key_part_spec> ref_columns;
uint delete_opt, update_opt, match_opt;
- foreign_key(const char *name_arg, List<key_part_spec> &cols,
- Table_ident *table, List<key_part_spec> &ref_cols,
+ Foreign_key(const char *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),
- ref_table(table), ref_columns(cols),
+ ref_table(table), ref_columns(ref_cols),
delete_opt(delete_opt_arg), update_opt(update_opt_arg),
match_opt(match_opt_arg)
{}
+ Foreign_key(const Foreign_key &rhs, MEM_ROOT *mem_root);
+ /**
+ Used to make a clone of this object for ALTER/CREATE TABLE
+ @sa comment for Key_part_spec::clone
+ */
+ virtual Key *clone(MEM_ROOT *mem_root) const
+ { return new (mem_root) Foreign_key(*this, mem_root); }
};
typedef struct st_mysql_lock
@@ -171,7 +219,7 @@ public:
#include "sql_lex.h" /* Must be here */
-class delayed_insert;
+class Delayed_insert;
class select_result;
class Time_zone;
@@ -182,22 +230,37 @@ class Time_zone;
struct system_variables
{
+ /*
+ How dynamically allocated system variables are handled:
+
+ The global_system_variables and max_system_variables are "authoritative"
+ They both should have the same 'version' and 'size'.
+ When attempting to access a dynamic variable, if the session version
+ is out of date, then the session version is updated and realloced if
+ neccessary and bytes copied from global to make up for missing data.
+ */
+ ulong dynamic_variables_version;
+ char* dynamic_variables_ptr;
+ uint dynamic_variables_head; /* largest valid variable offset */
+ uint dynamic_variables_size; /* how many bytes are in use */
+
ulonglong myisam_max_extra_sort_file_size;
ulonglong myisam_max_sort_file_size;
ulonglong max_heap_table_size;
ulonglong tmp_table_size;
+ ulonglong long_query_time;
ha_rows select_limit;
ha_rows max_join_size;
ulong auto_increment_increment, auto_increment_offset;
ulong bulk_insert_buff_size;
ulong join_buff_size;
- ulong long_query_time;
ulong max_allowed_packet;
ulong max_error_count;
ulong max_length_for_sort_data;
ulong max_sort_length;
ulong max_tmp_tables;
ulong max_insert_delayed_threads;
+ ulong min_examined_row_limit;
ulong multi_range_count;
ulong myisam_repair_threads;
ulong myisam_sort_buff_size;
@@ -253,8 +316,7 @@ struct system_variables
my_bool old_mode;
my_bool query_cache_wlock_invalidate;
my_bool engine_condition_pushdown;
- my_bool innodb_table_locks;
- my_bool innodb_support_xa;
+ my_bool keep_files_on_create;
my_bool ndb_force_send;
my_bool ndb_use_copying_alter_table;
my_bool ndb_use_exact_count;
@@ -264,7 +326,7 @@ struct system_variables
my_bool old_alter_table;
my_bool old_passwords;
- handlerton *table_type;
+ plugin_ref table_plugin;
/* Only charset part of these variables is sensible */
CHARSET_INFO *character_set_filesystem;
@@ -294,8 +356,8 @@ struct system_variables
typedef struct system_status_var
{
- ulong bytes_received;
- ulong bytes_sent;
+ ulonglong bytes_received;
+ ulonglong bytes_sent;
ulong com_other;
ulong com_stat[(uint) SQLCOM_END];
ulong created_tmp_disk_tables;
@@ -362,6 +424,8 @@ typedef struct system_status_var
#define last_system_status_var com_stmt_close
+void mark_transaction_to_rollback(THD *thd, bool all);
+
#ifdef MYSQL_SERVER
void free_tmp_table(THD *thd, TABLE *entry);
@@ -386,6 +450,13 @@ public:
#ifndef DBUG_OFF
bool is_backup_arena; /* True if this arena is used for backup. */
#endif
+ /*
+ The states relfects three diffrent life cycles for three
+ different types of statements:
+ Prepared statement: INITIALIZED -> PREPARED -> EXECUTED.
+ Stored procedure: INITIALIZED_FOR_SP -> EXECUTED.
+ Other statements: CONVENTIONAL_EXECUTION never changes.
+ */
enum enum_state
{
INITIALIZED= 0, INITIALIZED_FOR_SP= 1, PREPARED= 2,
@@ -423,30 +494,24 @@ public:
inline bool is_conventional() const
{ return state == CONVENTIONAL_EXECUTION; }
- inline gptr alloc(unsigned int size) { return alloc_root(mem_root,size); }
- inline gptr calloc(unsigned int size)
+ inline void* alloc(size_t size) { return alloc_root(mem_root,size); }
+ inline void* calloc(size_t size)
{
- gptr ptr;
+ void *ptr;
if ((ptr=alloc_root(mem_root,size)))
- bzero((char*) ptr,size);
+ bzero(ptr, size);
return ptr;
}
inline char *strdup(const char *str)
{ return strdup_root(mem_root,str); }
- inline char *strmake(const char *str, uint size)
+ inline char *strmake(const char *str, size_t size)
{ return strmake_root(mem_root,str,size); }
- inline bool LEX_STRING_make(LEX_STRING *lex_str, const char *str, uint size)
- {
- return ((lex_str->str=
- strmake_root(mem_root, str, (lex_str->length= size)))) == 0;
- }
-
- inline char *memdup(const char *str, uint size)
+ inline void *memdup(const void *str, size_t size)
{ return memdup_root(mem_root,str,size); }
- inline char *memdup_w_gap(const char *str, uint size, uint gap)
+ inline void *memdup_w_gap(const void *str, size_t size, uint gap)
{
- gptr ptr;
- if ((ptr=alloc_root(mem_root,size+gap)))
+ void *ptr;
+ if ((ptr= alloc_root(mem_root,size+gap)))
memcpy(ptr,str,size);
return ptr;
}
@@ -529,6 +594,22 @@ public:
uint32 query_length; // current query length
Server_side_cursor *cursor;
+ /**
+ Name of the current (default) database.
+
+ If there is the current (default) database, "db" contains its name. If
+ there is no current (default) database, "db" is NULL and "db_length" is
+ 0. In other words, "db", "db_length" must either be NULL, or contain a
+ valid database name.
+
+ @note this attribute is set and alloced by the slave SQL thread (for
+ the THD of that thread); that thread is (and must remain, for now) the
+ only responsible for freeing this member.
+ */
+
+ char *db;
+ uint db_length;
+
public:
/* This constructor is called for backup statements */
@@ -568,7 +649,7 @@ public:
Statement *find_by_name(LEX_STRING *name)
{
Statement *stmt;
- stmt= (Statement*)hash_search(&names_hash, (byte*)name->str,
+ stmt= (Statement*)hash_search(&names_hash, (uchar*)name->str,
name->length);
return stmt;
}
@@ -578,7 +659,7 @@ public:
if (last_found_statement == 0 || id != last_found_statement->id)
{
Statement *stmt;
- stmt= (Statement *) hash_search(&st_hash, (byte *) &id, sizeof(id));
+ stmt= (Statement *) hash_search(&st_hash, (uchar *) &id, sizeof(id));
if (stmt && stmt->name.str)
return NULL;
last_found_statement= stmt;
@@ -703,13 +784,25 @@ enum prelocked_mode_type {NON_PRELOCKED= 0, PRELOCKED= 1,
class Open_tables_state
{
public:
- /*
- open_tables - list of regular tables in use by this thread
- temporary_tables - list of temp tables in use by this thread
- handler_tables - list of tables that were opened with HANDLER OPEN
- and are still in use by this thread
+ /**
+ List of regular tables in use by this thread. Contains temporary and
+ base tables that were opened with @see open_tables().
+ */
+ TABLE *open_tables;
+ /**
+ List of temporary tables used by this thread. Contains user-level
+ temporary tables, created with CREATE TEMPORARY TABLE, and
+ internal temporary tables, created, e.g., to resolve a SELECT,
+ or for an intermediate table used in ALTER.
+ XXX Why are internal temporary tables added to this list?
*/
- TABLE *open_tables, *temporary_tables, *handler_tables, *derived_tables;
+ TABLE *temporary_tables;
+ /**
+ List of tables that were opened with HANDLER OPEN and are
+ still in use by this thread.
+ */
+ TABLE *handler_tables;
+ TABLE *derived_tables;
/*
During a MySQL session, one can lock tables in two modes: automatic
or manual. In automatic mode all necessary tables are locked just before
@@ -893,7 +986,7 @@ class THD :public Statement,
{
public:
/* Used to execute base64 coded binlog events in MySQL server */
- RELAY_LOG_INFO* rli_fake;
+ Relay_log_info* rli_fake;
/*
Constant for THD::where initialization in the beginning of every query.
@@ -948,23 +1041,24 @@ public:
*/
char *thread_stack;
+ /**
+ Currently selected catalog.
+ */
+ char *catalog;
+
/*
- db - currently selected database
- catalog - currently selected catalog
- WARNING: some members of THD (currently 'db', 'catalog' and 'query') are
- set and alloced by the slave SQL thread (for the THD of that thread); that
- thread is (and must remain, for now) the only responsible for freeing these
- 3 members. If you add members here, and you add code to set them in
- replication, don't forget to free_them_and_set_them_to_0 in replication
- properly. For details see the 'err:' label of the handle_slave_sql()
- in sql/slave.cc.
- */
- char *db, *catalog;
+ WARNING: some members of THD (currently 'Statement::db',
+ 'catalog' and 'query') are set and alloced by the slave SQL thread
+ (for the THD of that thread); that thread is (and must remain, for now)
+ the only responsible for freeing these 3 members. If you add members
+ here, and you add code to set them in replication, don't forget to
+ free_them_and_set_them_to_0 in replication properly. For details see
+ the 'err:' label of the handle_slave_sql() in sql/slave.cc.
+ */
+
Security_context main_security_ctx;
Security_context *security_ctx;
- /* remote (peer) port */
- uint16 peer_port;
/*
Points to info-string that we show in SHOW PROCESSLIST
You are supposed to update thd->proc_info only if you have coded
@@ -975,6 +1069,14 @@ public:
*/
const char *proc_info;
+ /*
+ Used in error messages to tell user in what part of MySQL we found an
+ error. E. g. when where= "having clause", if fix_fields() fails, user
+ will know that the error was in having clause.
+ */
+ const char *where;
+
+ double tmp_double_value; /* Used in set_var.cc */
ulong client_capabilities; /* What the client supports */
ulong max_client_packet_length;
@@ -996,16 +1098,14 @@ public:
enum enum_server_command command;
uint32 server_id;
uint32 file_id; // for LOAD DATA INFILE
- /*
- Used in error messages to tell user in what part of MySQL we found an
- error. E. g. when where= "having clause", if fix_fields() fails, user
- will know that the error was in having clause.
- */
- const char *where;
- time_t start_time,time_after_lock,user_time;
- time_t connect_time,thr_create_time; // track down slow pthread_create
+ /* remote (peer) port */
+ uint16 peer_port;
+ time_t start_time, user_time;
+ ulonglong connect_utime, thr_create_utime; // track down slow pthread_create
+ ulonglong start_utime, utime_after_lock;
+
thr_lock_type update_lock_default;
- delayed_insert *di;
+ Delayed_insert *di;
/* <> 0 if we are inside of trigger or stored function. */
uint in_sub_stmt;
@@ -1024,14 +1124,14 @@ public:
void binlog_set_stmt_begin();
int binlog_write_table_map(TABLE *table, bool is_transactional);
int binlog_write_row(TABLE* table, bool is_transactional,
- MY_BITMAP const* cols, my_size_t colcnt,
- const byte *buf);
+ MY_BITMAP const* cols, size_t colcnt,
+ const uchar *buf);
int binlog_delete_row(TABLE* table, bool is_transactional,
- MY_BITMAP const* cols, my_size_t colcnt,
- const byte *buf);
+ MY_BITMAP const* cols, size_t colcnt,
+ const uchar *buf);
int binlog_update_row(TABLE* table, bool is_transactional,
- MY_BITMAP const* cols, my_size_t colcnt,
- const byte *old_data, const byte *new_data);
+ MY_BITMAP const* cols, size_t colcnt,
+ const uchar *old_data, const uchar *new_data);
void set_server_id(uint32 sid) { server_id = sid; }
@@ -1041,61 +1141,33 @@ public:
template <class RowsEventT> Rows_log_event*
binlog_prepare_pending_rows_event(TABLE* table, uint32 serv_id,
MY_BITMAP const* cols,
- my_size_t colcnt,
- my_size_t needed,
+ size_t colcnt,
+ size_t needed,
bool is_transactional,
RowsEventT* hint);
Rows_log_event* binlog_get_pending_rows_event() const;
void binlog_set_pending_rows_event(Rows_log_event* ev);
-
- my_size_t max_row_length_blob(TABLE* table, const byte *data) const;
- my_size_t max_row_length(TABLE* table, const byte *data) const
- {
- TABLE_SHARE *table_s= table->s;
- my_size_t length= table_s->reclength + 2 * table_s->fields;
- if (table_s->blob_fields == 0)
- return length;
-
- return (length+max_row_length_blob(table,data));
- }
-
int binlog_flush_pending_rows_event(bool stmt_end);
- void binlog_delete_pending_rows_event();
private:
uint binlog_table_maps; // Number of table maps currently in the binlog
+
+ enum enum_binlog_flag {
+ BINLOG_FLAG_UNSAFE_STMT_PRINTED,
+ BINLOG_FLAG_COUNT
+ };
+
+ /**
+ Flags with per-thread information regarding the status of the
+ binary log.
+ */
+ uint32 binlog_flags;
public:
uint get_binlog_table_maps() const {
return binlog_table_maps;
}
#endif /* MYSQL_CLIENT */
-#ifndef MYSQL_CLIENT
-public:
- enum enum_binlog_query_type {
- /*
- The query can be logged row-based or statement-based
- */
- ROW_QUERY_TYPE,
-
- /*
- The query has to be logged statement-based
- */
- STMT_QUERY_TYPE,
-
- /*
- The query represents a change to a table in the "mysql"
- database and is currently mapped to ROW_QUERY_TYPE.
- */
- MYSQL_QUERY_TYPE,
- QUERY_TYPE_COUNT
- };
-
- int binlog_query(enum_binlog_query_type qtype,
- char const *query, ulong query_len,
- bool is_trans, bool suppress_use);
-#endif
-
public:
struct st_transactions {
@@ -1268,10 +1340,10 @@ public:
mode, row-based binlogging is used for such cases where two
auto_increment columns are inserted.
*/
- inline void record_first_successful_insert_id_in_cur_stmt(ulonglong id)
+ inline void record_first_successful_insert_id_in_cur_stmt(ulonglong id_arg)
{
if (first_successful_insert_id_in_cur_stmt == 0)
- first_successful_insert_id_in_cur_stmt= id;
+ first_successful_insert_id_in_cur_stmt= id_arg;
}
inline ulonglong read_first_successful_insert_id_in_prev_stmt(void)
{
@@ -1345,7 +1417,6 @@ public:
uint tmp_table, global_read_lock;
uint server_status,open_options;
enum enum_thread_type system_thread;
- uint db_length;
uint select_number; //number of select (used for EXPLAIN)
/* variables.transaction_isolation is reset to this after each commit */
enum_tx_isolation session_tx_isolation;
@@ -1354,7 +1425,14 @@ public:
DYNAMIC_ARRAY user_var_events; /* For user variables replication */
MEM_ROOT *user_var_events_alloc; /* Allocate above array elements here */
- enum killed_state { NOT_KILLED=0, KILL_BAD_DATA=1, KILL_CONNECTION=ER_SERVER_SHUTDOWN, KILL_QUERY=ER_QUERY_INTERRUPTED };
+ enum killed_state
+ {
+ NOT_KILLED=0,
+ KILL_BAD_DATA=1,
+ KILL_CONNECTION=ER_SERVER_SHUTDOWN,
+ KILL_QUERY=ER_QUERY_INTERRUPTED,
+ KILLED_NO_VALUE /* means neither of the states */
+ };
killed_state volatile killed;
/* scramble - random string sent to client on handshake */
@@ -1365,20 +1443,44 @@ public:
bool current_stmt_binlog_row_based;
bool locked, some_tables_deleted;
bool last_cuted_field;
- bool no_errors, password, is_fatal_error;
+ bool no_errors, password;
+ /**
+ Set to TRUE if execution of the current compound statement
+ can not continue. In particular, disables activation of
+ CONTINUE or EXIT handlers of stored routines.
+ Reset in the end of processing of the current user request, in
+ @see mysql_reset_thd_for_next_command().
+ */
+ bool is_fatal_error;
+ /**
+ Set by a storage engine to request the entire
+ transaction (that possibly spans multiple engines) to
+ rollback. Reset in ha_rollback.
+ */
+ bool transaction_rollback_request;
+ /**
+ TRUE if we are in a sub-statement and the current error can
+ not be safely recovered until we left the sub-statement mode.
+ In particular, disables activation of CONTINUE and EXIT
+ handlers inside sub-statements. E.g. if it is a deadlock
+ error and requires a transaction-wide rollback, this flag is
+ raised (traditionally, MySQL first has to close all the reads
+ via @see handler::ha_index_or_rnd_end() and only then perform
+ the rollback).
+ Reset to FALSE when we leave the sub-statement mode.
+ */
+ bool is_fatal_sub_stmt_error;
bool query_start_used, rand_used, time_zone_used;
/* for IS NULL => = last_insert_id() fix in remove_eq_conds() */
bool substitute_null_with_insert_id;
bool in_lock_tables;
bool query_error, bootstrap, cleanup_done;
- bool tmp_table_used;
+
+ /** is set if some thread specific value(s) used in a statement. */
+ bool thread_specific_used;
bool charset_is_system_charset, charset_is_collation_connection;
bool charset_is_character_set_filesystem;
bool enable_slow_log; /* enable slow log for current statement */
- struct {
- bool all:1;
- bool stmt:1;
- } no_trans_update;
bool abort_on_warning;
bool got_warning; /* Set on call to push_warning() */
bool no_warnings_for_error; /* no warnings on call to my_error() */
@@ -1431,6 +1533,16 @@ public:
*/
query_id_t first_query_id;
} binlog_evt_union;
+
+ /**
+ Character input stream consumed by the lexical analyser,
+ used during parsing.
+ Note that since the parser is not re-entrant, we keep only one input
+ stream here. This member is valid only when executing code during parsing,
+ and may point to invalid memory after that.
+ */
+ Lex_input_stream *m_lip;
+
#ifdef WITH_PARTITION_STORAGE_ENGINE
partition_info *work_part_info;
#endif
@@ -1469,6 +1581,33 @@ public:
void close_active_vio();
#endif
void awake(THD::killed_state state_to_set);
+
+#ifndef MYSQL_CLIENT
+ enum enum_binlog_query_type {
+ /*
+ The query can be logged row-based or statement-based
+ */
+ ROW_QUERY_TYPE,
+
+ /*
+ The query has to be logged statement-based
+ */
+ STMT_QUERY_TYPE,
+
+ /*
+ The query represents a change to a table in the "mysql"
+ database and is currently mapped to ROW_QUERY_TYPE.
+ */
+ MYSQL_QUERY_TYPE,
+ QUERY_TYPE_COUNT
+ };
+
+ int binlog_query(enum_binlog_query_type qtype,
+ char const *query, ulong query_len,
+ bool is_trans, bool suppress_use,
+ THD::killed_state killed_err_arg= THD::KILLED_NO_VALUE);
+#endif
+
/*
For enter_cond() / exit_cond() to work the mutex must be got before
enter_cond(); this mutex is then released by exit_cond().
@@ -1500,10 +1639,24 @@ public:
pthread_mutex_unlock(&mysys_var->mutex);
}
inline time_t query_start() { query_start_used=1; return start_time; }
- inline void set_time() { if (user_time) start_time=time_after_lock=user_time; else time_after_lock=time(&start_time); }
- inline void end_time() { time(&start_time); }
- inline void set_time(time_t t) { time_after_lock=start_time=user_time=t; }
- inline void lock_time() { time(&time_after_lock); }
+ inline void set_time()
+ {
+ if (user_time)
+ {
+ start_time= user_time;
+ start_utime= utime_after_lock= my_micro_time();
+ }
+ else
+ start_utime= utime_after_lock= my_micro_time_and_time(&start_time);
+ }
+ inline void set_current_time() { start_time= my_time(MY_WME); }
+ inline void set_time(time_t t)
+ {
+ start_time= user_time= t;
+ start_utime= utime_after_lock= my_micro_time();
+ }
+ void set_time_after_lock() { utime_after_lock= my_micro_time(); }
+ ulonglong current_utime() { return my_micro_time(); }
inline ulonglong found_rows(void)
{
return limit_found_rows;
@@ -1524,11 +1677,15 @@ public:
{
return !stmt_arena->is_stmt_prepare();
}
- inline gptr trans_alloc(unsigned int size)
+ inline void* trans_alloc(unsigned int size)
{
return alloc_root(&transaction.mem_root,size);
}
+ LEX_STRING *make_lex_string(LEX_STRING *lex_str,
+ const char* str, uint length,
+ bool allocate_lex_string);
+
bool convert_string(LEX_STRING *to, CHARSET_INFO *to_cs,
const char *from, uint from_length,
CHARSET_INFO *from_cs);
@@ -1595,7 +1752,8 @@ public:
void end_statement();
inline int killed_errno() const
{
- return killed != KILL_BAD_DATA ? killed : 0;
+ killed_state killed_val; /* to cache the volatile 'killed' */
+ return (killed_val= killed) != KILL_BAD_DATA ? killed_val : 0;
}
inline void send_kill_message() const
{
@@ -1607,7 +1765,7 @@ public:
inline bool really_abort_on_warning()
{
return (abort_on_warning &&
- (!no_trans_update.stmt ||
+ (!transaction.stmt.modified_non_trans_table ||
(variables.sql_mode & MODE_STRICT_ALL_TABLES)));
}
void set_status_var_init();
@@ -1619,6 +1777,7 @@ public:
void restore_sub_statement_state(Sub_statement_state *backup);
void set_n_backup_active_arena(Query_arena *set, Query_arena *backup);
void restore_active_arena(Query_arena *set, Query_arena *backup);
+
inline void set_current_stmt_binlog_row_based_if_mixed()
{
/*
@@ -1669,13 +1828,28 @@ public:
}
}
- /*
- Initialize the current database from a NULL-terminated string with length
- If we run out of memory, we free the current database and return TRUE.
- This way the user will notice the error as there will be no current
- database selected (in addition to the error message set by malloc).
+ /**
+ Set the current database; use deep copy of C-string.
+
+ @param new_db a pointer to the new database name.
+ @param new_db_len length of the new database name.
+
+ Initialize the current database from a NULL-terminated string with
+ length. If we run out of memory, we free the current database and
+ return TRUE. This way the user will notice the error as there will be
+ no current database selected (in addition to the error message set by
+ malloc).
+
+ @note This operation just sets {db, db_length}. Switching the current
+ database usually involves other actions, like switching other database
+ attributes including security context. In the future, this operation
+ will be made private and more convenient interface will be provided.
+
+ @return Operation status
+ @retval FALSE Success
+ @retval TRUE Out-of-memory error
*/
- bool set_db(const char *new_db, uint new_db_len)
+ bool set_db(const char *new_db, size_t new_db_len)
{
/* Do not reallocate memory if current chunk is big enough. */
if (db && new_db && db_length >= new_db_len)
@@ -1688,7 +1862,19 @@ public:
db_length= db ? new_db_len : 0;
return new_db && !db;
}
- void reset_db(char *new_db, uint new_db_len)
+
+ /**
+ Set the current database; use shallow copy of C-string.
+
+ @param new_db a pointer to the new database name.
+ @param new_db_len length of the new database name.
+
+ @note This operation just sets {db, db_length}. Switching the current
+ database usually involves other actions, like switching other database
+ attributes including security context. In the future, this operation
+ will be made private and more convenient interface will be provided.
+ */
+ void reset_db(char *new_db, size_t new_db_len)
{
db= new_db;
db_length= new_db_len;
@@ -1698,7 +1884,7 @@ public:
allocate memory for a deep copy: current database may be freed after
a statement is parsed but before it's executed.
*/
- bool copy_db_to(char **p_db, uint *p_db_length)
+ bool copy_db_to(char **p_db, size_t *p_db_length)
{
if (db == NULL)
{
@@ -1880,9 +2066,30 @@ public:
};
+#define ESCAPE_CHARS "ntrb0ZN" // keep synchronous with READ_INFO::unescape
+
+
+/*
+ List of all possible characters of a numeric value text representation.
+*/
+#define NUMERIC_CHARS ".0123456789e+-"
+
+
class select_export :public select_to_file {
uint field_term_length;
int field_sep_char,escape_char,line_sep_char;
+ /*
+ The is_ambiguous_field_sep field is true if a value of the field_sep_char
+ field is one of the 'n', 't', 'r' etc characters
+ (see the READ_INFO::unescape method and the ESCAPE_CHARS constant value).
+ */
+ bool is_ambiguous_field_sep;
+ /*
+ The is_unsafe_field_sep field is true if a value of the field_sep_char
+ field is one of the '0'..'9', '+', '-', '.' and 'e' characters
+ (see the NUMERIC_CHARS constant value).
+ */
+ bool is_unsafe_field_sep;
bool fixed_row_size;
public:
select_export(sql_exchange *ex) :select_to_file(ex) {}
@@ -1921,6 +2128,7 @@ class select_insert :public select_result_interceptor {
virtual bool can_rollback_data() { return 0; }
void send_error(uint errcode,const char *err);
bool send_eof();
+ void abort();
/* not implemented: select_insert is never re-used in prepared statements */
void cleanup();
};
@@ -1929,19 +2137,21 @@ class select_insert :public select_result_interceptor {
class select_create: public select_insert {
ORDER *group;
TABLE_LIST *create_table;
- List<create_field> *extra_fields;
- List<Key> *keys;
HA_CREATE_INFO *create_info;
+ TABLE_LIST *select_tables;
+ Alter_info *alter_info;
Field **field;
public:
select_create (TABLE_LIST *table_arg,
HA_CREATE_INFO *create_info_par,
- List<create_field> &fields_par,
- List<Key> &keys_par,
- List<Item> &select_fields,enum_duplicates duplic, bool ignore)
+ Alter_info *alter_info_arg,
+ List<Item> &select_fields,enum_duplicates duplic, bool ignore,
+ TABLE_LIST *select_tables_arg)
:select_insert (NULL, NULL, &select_fields, 0, 0, duplic, ignore),
- create_table(table_arg), extra_fields(&fields_par),keys(&keys_par),
- create_info(create_info_par)
+ create_table(table_arg),
+ create_info(create_info_par),
+ select_tables(select_tables_arg),
+ alter_info(alter_info_arg)
{}
int prepare(List<Item> &list, SELECT_LEX_UNIT *u);
@@ -1977,7 +2187,7 @@ public:
List<Item> save_copy_funcs;
Copy_field *copy_field, *copy_field_end;
Copy_field *save_copy_field, *save_copy_field_end;
- byte *group_buff;
+ uchar *group_buff;
Item **items_to_copy; /* Fields in tmp table */
MI_COLUMNDEF *recinfo,*start_recinfo;
KEY *keyinfo;
@@ -2183,7 +2393,7 @@ class Unique :public Sql_alloc
ulonglong max_in_memory_size;
IO_CACHE file;
TREE tree;
- byte *record_pointers;
+ uchar *record_pointers;
bool flush();
uint size;
@@ -2216,8 +2426,8 @@ public:
void reset();
bool walk(tree_walk_action action, void *walk_action_arg);
- friend int unique_write_to_file(gptr key, element_count count, Unique *unique);
- friend int unique_write_to_ptrs(gptr key, element_count count, Unique *unique);
+ friend int unique_write_to_file(uchar* key, element_count count, Unique *unique);
+ friend int unique_write_to_ptrs(uchar* key, element_count count, Unique *unique);
};
@@ -2258,6 +2468,11 @@ class multi_update :public select_result_interceptor
List <Item> *fields, *values;
List <Item> **fields_for_table, **values_for_table;
uint table_count;
+ /*
+ List of tables referenced in the CHECK OPTION condition of
+ the updated view excluding the updated table.
+ */
+ List <TABLE> unupdated_check_opt_tables;
Copy_field *copy_field;
enum enum_duplicates handle_duplicates;
bool do_update, trans_safe;
@@ -2316,10 +2531,14 @@ public:
#define CF_HAS_ROW_COUNT 2
#define CF_STATUS_COMMAND 4
#define CF_SHOW_TABLE_COMMAND 8
+#define CF_WRITE_LOGS_COMMAND 16
/* Functions in sql_class.cc */
void add_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var);
+
void add_diff_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var,
STATUS_VAR *dec_var);
+void mark_transaction_to_rollback(THD *thd, bool all);
+
#endif /* MYSQL_SERVER */
diff --git a/sql/sql_client.cc b/sql/sql_client.cc
index d6f1183806e..032a2e26e3a 100644
--- a/sql/sql_client.cc
+++ b/sql/sql_client.cc
@@ -28,8 +28,11 @@ void my_net_local_init(NET *net)
{
#ifndef EMBEDDED_LIBRARY
net->max_packet= (uint) global_system_variables.net_buffer_length;
- net->read_timeout= (uint) global_system_variables.net_read_timeout;
- net->write_timeout=(uint) global_system_variables.net_write_timeout;
+
+ my_net_set_read_timeout(net, (uint)global_system_variables.net_read_timeout);
+ my_net_set_write_timeout(net,
+ (uint)global_system_variables.net_write_timeout);
+
net->retry_count= (uint) global_system_variables.net_retry_count;
net->max_packet_size= max(global_system_variables.net_buffer_length,
global_system_variables.max_allowed_packet);
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc
index d03a17079d8..6bb0f62d843 100644
--- a/sql/sql_connect.cc
+++ b/sql/sql_connect.cc
@@ -80,7 +80,7 @@ static int get_or_create_user_conn(THD *thd, const char *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,
- (byte*) temp_user, temp_len)))
+ (uchar*) temp_user, temp_len)))
{
/* First connection for user; Create a user connection object */
if (!(uc= ((struct user_conn*)
@@ -97,8 +97,8 @@ static int get_or_create_user_conn(THD *thd, const char *user,
uc->len= temp_len;
uc->connections= uc->questions= uc->updates= uc->conn_per_hour= 0;
uc->user_resources= *mqh;
- uc->intime= thd->thr_create_time;
- if (my_hash_insert(&hash_user_connections, (byte*) uc))
+ uc->reset_utime= thd->thr_create_utime;
+ if (my_hash_insert(&hash_user_connections, (uchar*) uc))
{
my_free((char*) uc,0);
net_send_error(thd, 0, NullS); // Out of memory
@@ -200,7 +200,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,(byte*) uc);
+ (void) hash_delete(&hash_user_connections,(uchar*) uc);
}
(void) pthread_mutex_unlock(&LOCK_user_conn);
DBUG_VOID_RETURN;
@@ -223,16 +223,16 @@ void decrease_user_connections(USER_CONN *uc)
void time_out_user_resource_limits(THD *thd, USER_CONN *uc)
{
- time_t check_time = thd->start_time ? thd->start_time : time(NULL);
+ ulonglong check_time= thd->start_utime;
DBUG_ENTER("time_out_user_resource_limits");
/* If more than a hour since last check, reset resource checking */
- if (check_time - uc->intime >= 3600)
+ if (check_time - uc->reset_utime >= LL(3600000000))
{
uc->questions=1;
uc->updates=0;
uc->conn_per_hour=0;
- uc->intime=check_time;
+ uc->reset_utime= check_time;
}
DBUG_VOID_RETURN;
@@ -512,11 +512,11 @@ int check_user(THD *thd, enum enum_server_command command,
started with corresponding variable that is greater then 0.
*/
-extern "C" byte *get_key_conn(user_conn *buff, uint *length,
+extern "C" uchar *get_key_conn(user_conn *buff, size_t *length,
my_bool not_used __attribute__((unused)))
{
- *length=buff->len;
- return (byte*) buff->user;
+ *length= buff->len;
+ return (uchar*) buff->user;
}
@@ -559,7 +559,7 @@ void reset_mqh(LEX_USER *lu, bool get_them= 0)
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,
- (byte*) temp_user, temp_len)))
+ (uchar*) temp_user, temp_len)))
{
uc->questions=0;
get_mqh(temp_user,&temp_user[lu->user.length+1],uc);
@@ -747,8 +747,8 @@ static int check_connection(THD *thd)
SCRAMBLE_LENGTH - SCRAMBLE_LENGTH_323) + 1;
/* At this point we write connection message and read reply */
- if (net_write_command(net, (uchar) protocol_version, "", 0, buff,
- (uint) (end-buff)) ||
+ if (net_write_command(net, (uchar) protocol_version, (uchar*) "", 0,
+ (uchar*) buff, (size_t) (end-buff)) ||
(pkt_len= my_net_read(net)) == packet_error ||
pkt_len < MIN_HANDSHAKE_SIZE)
{
@@ -837,9 +837,12 @@ static int check_connection(THD *thd)
password both send '\0'.
This strlen() can't be easily deleted without changing protocol.
+
+ Cast *passwd to an unsigned char, so that it doesn't extend the sign for
+ *passwd > 127 and become 2**32-127+ after casting to uint.
*/
uint passwd_len= thd->client_capabilities & CLIENT_SECURE_CONNECTION ?
- *passwd++ : strlen(passwd);
+ (uchar)(*passwd++) : strlen(passwd);
db= thd->client_capabilities & CLIENT_CONNECT_WITH_DB ?
db + passwd_len + 1 : 0;
/* strlen() can't be easily deleted without changing protocol */
@@ -936,8 +939,8 @@ bool login_connection(THD *thd)
net->no_send_error= 0;
/* Use "connect_timeout" value during connection phase */
- net_set_read_timeout(net, connect_timeout);
- net_set_write_timeout(net, connect_timeout);
+ my_net_set_read_timeout(net, connect_timeout);
+ my_net_set_write_timeout(net, connect_timeout);
if ((error=check_connection(thd)))
{ // Wrong permissions
@@ -951,8 +954,8 @@ bool login_connection(THD *thd)
DBUG_RETURN(1);
}
/* Connect completed, set read/write timeouts back to default */
- net_set_read_timeout(net, thd->variables.net_read_timeout);
- net_set_write_timeout(net, thd->variables.net_write_timeout);
+ my_net_set_read_timeout(net, thd->variables.net_read_timeout);
+ my_net_set_write_timeout(net, thd->variables.net_write_timeout);
DBUG_RETURN(0);
}
@@ -967,6 +970,7 @@ bool login_connection(THD *thd)
void end_connection(THD *thd)
{
NET *net= &thd->net;
+ plugin_thdvar_cleanup(thd);
if (thd->user_connect)
decrease_user_connections(thd->user_connect);
if (net->error && net->vio != 0 && net->report_error)
@@ -1004,6 +1008,11 @@ void prepare_new_connection_state(THD* thd)
if (thd->client_capabilities & CLIENT_COMPRESS)
thd->net.compress=1; // Use compression
+ /*
+ Much of this is duplicated in create_embedded_thd() for the
+ embedded server library.
+ TODO: refactor this to avoid code duplication there
+ */
thd->version= refresh_version;
thd->proc_info= 0;
thd->command= COM_SLEEP;
@@ -1049,8 +1058,8 @@ void prepare_new_connection_state(THD* thd)
pthread_handler_t handle_one_connection(void *arg)
{
THD *thd= (THD*) arg;
- uint launch_time =
- (uint) ((thd->thr_create_time = time(NULL)) - thd->connect_time);
+ ulong launch_time= (ulong) ((thd->thr_create_utime= my_micro_time()) -
+ thd->connect_utime);
if (thread_scheduler.init_new_connection_thread())
{
@@ -1059,7 +1068,7 @@ pthread_handler_t handle_one_connection(void *arg)
thread_scheduler.end_thread(thd,0);
return 0;
}
- if (launch_time >= slow_launch_time)
+ if (launch_time >= slow_launch_time*1000000L)
statistic_increment(slow_launch_threads,&LOCK_status);
/*
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index cfd610638ce..cd7ad048802 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -39,6 +39,10 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp,
static long mysql_rm_arc_files(THD *thd, MY_DIR *dirp, const char *org_path);
static my_bool rm_dir_w_symlink(const char *org_path, my_bool send_error);
+static void mysql_change_db_impl(THD *thd,
+ LEX_STRING *new_db_name,
+ ulong new_db_access,
+ CHARSET_INFO *new_db_charset);
/* Database lock hash */
@@ -59,11 +63,13 @@ typedef struct my_dblock_st
lock_db key.
*/
-static byte* lock_db_get_key(my_dblock_t *ptr, uint *length,
- my_bool not_used __attribute__((unused)))
+extern "C" uchar* lock_db_get_key(my_dblock_t *, size_t *, my_bool not_used);
+
+uchar* lock_db_get_key(my_dblock_t *ptr, size_t *length,
+ my_bool not_used __attribute__((unused)))
{
*length= ptr->name_length;
- return (byte*) ptr->name;
+ return (uchar*) ptr->name;
}
@@ -71,9 +77,11 @@ static byte* lock_db_get_key(my_dblock_t *ptr, uint *length,
Free lock_db hash element.
*/
-static void lock_db_free_element(void *ptr)
+extern "C" void lock_db_free_element(void *ptr);
+
+void lock_db_free_element(void *ptr)
{
- my_free((gptr) ptr, MYF(0));
+ my_free(ptr, MYF(0));
}
@@ -98,12 +106,12 @@ 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,
- (byte*) dbname, length)))
+ (uchar*) dbname, length)))
{
/* Db is not in the hash, insert it */
char *tmp_name;
if (!my_multi_malloc(MYF(MY_WME | MY_ZEROFILL),
- &opt, (uint) sizeof(*opt), &tmp_name, length+1,
+ &opt, (uint) sizeof(*opt), &tmp_name, (uint) length+1,
NullS))
{
error= 1;
@@ -114,11 +122,8 @@ static my_bool lock_db_insert(const char *dbname, uint length)
strmov(opt->name, dbname);
opt->name_length= length;
- if ((error= my_hash_insert(&lock_db_cache, (byte*) opt)))
- {
- my_free((gptr) opt, MYF(0));
- goto end;
- }
+ if ((error= my_hash_insert(&lock_db_cache, (uchar*) opt)))
+ my_free(opt, MYF(0));
}
end:
@@ -135,8 +140,8 @@ 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 byte*) name, length)))
- hash_delete(&lock_db_cache, (byte*) opt);
+ (const uchar*) name, length)))
+ hash_delete(&lock_db_cache, (uchar*) opt);
}
@@ -158,11 +163,14 @@ typedef struct my_dbopt_st
Function we use in the creation of our hash to get key.
*/
-static byte* dboptions_get_key(my_dbopt_t *opt, uint *length,
- my_bool not_used __attribute__((unused)))
+extern "C" uchar* dboptions_get_key(my_dbopt_t *opt, size_t *length,
+ my_bool not_used);
+
+uchar* dboptions_get_key(my_dbopt_t *opt, size_t *length,
+ my_bool not_used __attribute__((unused)))
{
*length= opt->name_length;
- return (byte*) opt->name;
+ return (uchar*) opt->name;
}
@@ -185,9 +193,11 @@ static inline void write_to_binlog(THD *thd, char *query, uint q_len,
Function to free dboptions hash element
*/
-static void free_dbopt(void *dbopt)
+extern "C" void free_dbopt(void *dbopt);
+
+void free_dbopt(void *dbopt)
{
- my_free((gptr) dbopt, MYF(0));
+ my_free((uchar*) dbopt, MYF(0));
}
@@ -280,7 +290,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, (byte*) dbname, length)))
+ if ((opt= (my_dbopt_t*) hash_search(&dboptions, (uchar*) dbname, length)))
{
create->default_table_charset= opt->charset;
error= 0;
@@ -312,12 +322,12 @@ 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, (byte*) dbname, length)))
+ if (!(opt= (my_dbopt_t*) hash_search(&dboptions, (uchar*) dbname, length)))
{
/* Options are not in the hash, insert them */
char *tmp_name;
if (!my_multi_malloc(MYF(MY_WME | MY_ZEROFILL),
- &opt, (uint) sizeof(*opt), &tmp_name, length+1,
+ &opt, (uint) sizeof(*opt), &tmp_name, (uint) length+1,
NullS))
{
error= 1;
@@ -328,9 +338,9 @@ static my_bool put_dbopt(const char *dbname, HA_CREATE_INFO *create)
strmov(opt->name, dbname);
opt->name_length= length;
- if ((error= my_hash_insert(&dboptions, (byte*) opt)))
+ if ((error= my_hash_insert(&dboptions, (uchar*) opt)))
{
- my_free((gptr) opt, MYF(0));
+ my_free(opt, MYF(0));
goto end;
}
}
@@ -352,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 byte*) path,
+ if ((opt= (my_dbopt_t *)hash_search(&dboptions, (const uchar*) path,
strlen(path))))
- hash_delete(&dboptions, (byte*) opt);
+ hash_delete(&dboptions, (uchar*) opt);
rw_unlock(&LOCK_dboptions);
}
@@ -392,7 +402,7 @@ static bool write_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create)
"\n", NullS) - buf);
/* Error is written by my_write */
- if (!my_write(file,(byte*) buf, length, MYF(MY_NABP+MY_WME)))
+ if (!my_write(file,(uchar*) buf, length, MYF(MY_NABP+MY_WME)))
error=0;
my_close(file,MYF(0));
}
@@ -541,6 +551,37 @@ bool load_db_opt_by_name(THD *thd, const char *db_name,
}
+/**
+ Return default database collation.
+
+ @param thd Thread context.
+ @param db_name Database name.
+
+ @return CHARSET_INFO object. The operation always return valid character
+ set, even if the database does not exist.
+*/
+
+CHARSET_INFO *get_default_db_collation(THD *thd, const char *db_name)
+{
+ HA_CREATE_INFO db_info;
+
+ if (thd->db != NULL && strcmp(db_name, thd->db) == 0)
+ return thd->db_charset;
+
+ load_db_opt_by_name(thd, db_name, &db_info);
+
+ /*
+ NOTE: even if load_db_opt_by_name() fails,
+ db_info.default_table_charset contains valid character set
+ (collation_server). We should not fail if load_db_opt_by_name() fails,
+ because it is valid case. If a database has been created just by
+ "mkdir", it does not contain db.opt file, but it is valid database.
+ */
+
+ return db_info.default_table_charset;
+}
+
+
/*
Create a database
@@ -754,10 +795,8 @@ bool mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info)
if ((error=write_db_opt(thd, path, create_info)))
goto exit;
- /*
- Change options if current database is being altered
- TODO: Delete this code
- */
+ /* Change options if current database is being altered. */
+
if (thd->db && !strcmp(thd->db,db))
{
thd->db_charset= create_info->default_table_charset ?
@@ -920,7 +959,7 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
TABLE_LIST *tbl;
uint db_len;
- if (!(query= thd->alloc(MAX_DROP_TABLE_Q_LEN)))
+ if (!(query= (char*) thd->alloc(MAX_DROP_TABLE_Q_LEN)))
goto exit; /* not much else we can do */
query_pos= query_data_start= strmov(query,"drop table ");
query_end= query + MAX_DROP_TABLE_Q_LEN;
@@ -962,7 +1001,7 @@ exit:
it to 0.
*/
if (thd->db && !strcmp(thd->db, db))
- thd->set_db(NULL, 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);
exit2:
@@ -1021,7 +1060,7 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
DBUG_PRINT("my",("New subdir found: %s", newpath));
if ((mysql_rm_known_files(thd, new_dirp, NullS, newpath,1,0)) < 0)
goto err;
- if (!(copy_of_path= thd->memdup(newpath, length+1)) ||
+ if (!(copy_of_path= (char*) thd->memdup(newpath, length+1)) ||
!(dir= new (thd->mem_root) String(copy_of_path, length,
&my_charset_bin)) ||
raid_dirs.push_back(dir))
@@ -1087,7 +1126,7 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
}
}
if (thd->killed ||
- (tot_list && mysql_rm_table_part2_with_lock(thd, tot_list, 1, 0, 1)))
+ (tot_list && mysql_rm_table_part2(thd, tot_list, 1, 0, 1, 1)))
goto err;
/* Remove RAID directories */
@@ -1320,22 +1359,108 @@ static void mysql_change_db_impl(THD *thd,
}
+
+/**
+ Backup the current database name before switch.
+
+ @param[in] thd thread handle
+ @param[in, out] saved_db_name IN: "str" points to a buffer where to store
+ the old database name, "length" contains the
+ buffer size
+ OUT: if the current (default) database is
+ not NULL, its name is copied to the
+ buffer pointed at by "str"
+ and "length" is updated accordingly.
+ Otherwise "str" is set to NULL and
+ "length" is set to 0.
+*/
+
+static void backup_current_db_name(THD *thd,
+ LEX_STRING *saved_db_name)
+{
+ if (!thd->db)
+ {
+ /* No current (default) database selected. */
+
+ saved_db_name->str= NULL;
+ saved_db_name->length= 0;
+ }
+ else
+ {
+ strmake(saved_db_name->str, thd->db, saved_db_name->length);
+ saved_db_name->length= thd->db_length;
+ }
+}
+
+
+/**
+ Return TRUE if db1_name is equal to db2_name, FALSE otherwise.
+
+ The function allows to compare database names according to the MySQL
+ rules. The database names db1 and db2 are equal if:
+ - db1 is NULL and db2 is NULL;
+ or
+ - db1 is not-NULL, db2 is not-NULL, db1 is equal (ignoring case) to
+ db2 in system character set (UTF8).
+*/
+
+static inline bool
+cmp_db_names(const char *db1_name,
+ const char *db2_name)
+{
+ return
+ /* db1 is NULL and db2 is NULL */
+ !db1_name && !db2_name ||
+
+ /* db1 is not-NULL, db2 is not-NULL, db1 == db2. */
+ db1_name && db2_name &&
+ my_strcasecmp(system_charset_info, db1_name, db2_name) == 0;
+}
+
+
/**
- @brief Change the current database.
+ @brief Change the current database and its attributes unconditionally.
@param thd thread handle
- @param name database name
- @param force_switch if this flag is set (TRUE), mysql_change_db() will
- switch to NULL db if the specified database is not
- available anymore. Corresponding warning will be
- thrown in this case. This flag is used to change
- database in stored-routine-execution code.
-
- @details Check that the database name corresponds to a valid and existent
- database, check access rights (unless called with no_access_check), and
- set the current database. This function is called to change the current
- database upon user request (COM_CHANGE_DB command) or temporarily, to
- execute a stored routine.
+ @param new_db_name database name
+ @param force_switch if force_switch is FALSE, then the operation will fail if
+
+ - new_db_name is NULL or empty;
+
+ - OR new database name is invalid
+ (check_db_name() failed);
+
+ - OR user has no privilege on the new database;
+
+ - OR new database does not exist;
+
+ if force_switch is TRUE, then
+
+ - if new_db_name is NULL or empty, the current
+ database will be NULL, @@collation_database will
+ be set to @@collation_server, the operation will
+ succeed.
+
+ - if new database name is invalid
+ (check_db_name() failed), the current database
+ will be NULL, @@collation_database will be set to
+ @@collation_server, but the operation will fail;
+
+ - user privileges will not be checked
+ (THD::db_access however is updated);
+
+ TODO: is this really the intention?
+ (see sp-security.test).
+
+ - if new database does not exist,the current database
+ will be NULL, @@collation_database will be set to
+ @@collation_server, a warning will be thrown, the
+ operation will succeed.
+
+ @details The function checks that the database name corresponds to a
+ valid and existent database, checks access rights and changes the current
+ database with database attributes (@@collation_database session variable,
+ THD::db_access).
This function is not the only way to switch the database that is
currently employed. When the replication slave thread switches the
@@ -1361,6 +1486,7 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
Security_context *sctx= thd->security_ctx;
ulong db_access= sctx->db_access;
+ CHARSET_INFO *db_default_cl;
DBUG_ENTER("mysql_change_db");
DBUG_PRINT("enter",("name: '%s'", new_db_name->str));
@@ -1370,10 +1496,15 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
{
if (force_switch)
{
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
- ER_NO_DB_ERROR, ER(ER_NO_DB_ERROR));
+ /*
+ This can happen only if we're switching the current database back
+ after loading stored program. The thing is that loading of stored
+ program can happen when there is no current database.
- /* Change db to NULL. */
+ TODO: actually, new_db_name and new_db_name->str seem to be always
+ non-NULL. In case of stored program, new_db_name->str == "" and
+ new_db_name->length == 0.
+ */
mysql_change_db_impl(thd, NULL, 0, thd->variables.collation_server);
@@ -1390,7 +1521,7 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
if (my_strcasecmp(system_charset_info, new_db_name->str,
INFORMATION_SCHEMA_NAME.str) == 0)
{
- /* Switch database to INFORMATION_SCHEMA. */
+ /* Switch the current database to INFORMATION_SCHEMA. */
mysql_change_db_impl(thd, &INFORMATION_SCHEMA_NAME, SELECT_ACL,
system_charset_info);
@@ -1417,8 +1548,8 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
even if we are called from sp_head::execute().
It's next to impossible however to get this error when we are called
- from sp_head::execute(). But let's switch database to NULL in this case
- to be sure.
+ from sp_head::execute(). But let's switch the current database to NULL
+ in this case to be sure.
*/
if (check_db_name(&new_db_file_name))
@@ -1427,10 +1558,8 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
my_free(new_db_file_name.str, MYF(0));
if (force_switch)
- {
- /* Change db to NULL. */
mysql_change_db_impl(thd, NULL, 0, thd->variables.collation_server);
- }
+
DBUG_RETURN(TRUE);
}
@@ -1448,7 +1577,7 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
if (!force_switch &&
!(db_access & DB_ACLS) &&
- (!grant_option || check_grant_db(thd, new_db_file_name.str)))
+ check_grant_db(thd, new_db_file_name.str))
{
my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
sctx->priv_user,
@@ -1465,6 +1594,8 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
{
if (force_switch)
{
+ /* Throw a warning and free new_db_file_name. */
+
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_BAD_DB_ERROR, ER(ER_BAD_DB_ERROR),
new_db_file_name.str);
@@ -1475,12 +1606,19 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
mysql_change_db_impl(thd, NULL, 0, thd->variables.collation_server);
+ /* The operation succeed. */
+
DBUG_RETURN(FALSE);
}
else
{
+ /* Report an error and free new_db_file_name. */
+
my_error(ER_BAD_DB_ERROR, MYF(0), new_db_file_name.str);
my_free(new_db_file_name.str, MYF(0));
+
+ /* The operation failed. */
+
DBUG_RETURN(TRUE);
}
}
@@ -1490,29 +1628,59 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
attributes and will be freed in THD::~THD().
*/
- {
- HA_CREATE_INFO db_options;
-
- load_db_opt_by_name(thd, new_db_name->str, &db_options);
+ db_default_cl= get_default_db_collation(thd, new_db_file_name.str);
- mysql_change_db_impl(thd, &new_db_file_name, db_access,
- db_options.default_table_charset ?
- db_options.default_table_charset :
- thd->variables.collation_server);
- }
+ mysql_change_db_impl(thd, &new_db_file_name, db_access, db_default_cl);
DBUG_RETURN(FALSE);
}
+/**
+ Change the current database and its attributes if needed.
+
+ @param thd thread handle
+ @param new_db_name database name
+ @param[in, out] saved_db_name IN: "str" points to a buffer where to store
+ the old database name, "length" contains the
+ buffer size
+ OUT: if the current (default) database is
+ not NULL, its name is copied to the
+ buffer pointed at by "str"
+ and "length" is updated accordingly.
+ Otherwise "str" is set to NULL and
+ "length" is set to 0.
+ @param force_switch @see mysql_change_db()
+ @param[out] cur_db_changed out-flag to indicate whether the current
+ database has been changed (valid only if
+ the function suceeded)
+*/
+
+bool mysql_opt_change_db(THD *thd,
+ const LEX_STRING *new_db_name,
+ LEX_STRING *saved_db_name,
+ bool force_switch,
+ bool *cur_db_changed)
+{
+ *cur_db_changed= !cmp_db_names(thd->db, new_db_name->str);
+
+ if (!*cur_db_changed)
+ return FALSE;
+
+ backup_current_db_name(thd, saved_db_name);
+
+ return mysql_change_db(thd, new_db_name, force_switch);
+}
+
+
static int
lock_databases(THD *thd, const char *db1, uint length1,
const char *db2, uint length2)
{
pthread_mutex_lock(&LOCK_lock_db);
while (!thd->killed &&
- (hash_search(&lock_db_cache,(byte*) db1, length1) ||
- hash_search(&lock_db_cache,(byte*) db2, length2)))
+ (hash_search(&lock_db_cache,(uchar*) db1, length1) ||
+ hash_search(&lock_db_cache,(uchar*) db2, length2)))
{
wait_for_condition(thd, &LOCK_lock_db, &COND_refresh);
pthread_mutex_lock(&LOCK_lock_db);
@@ -1654,7 +1822,7 @@ bool mysql_rename_db(THD *thd, LEX_STRING *old_db, LEX_STRING *new_db)
table_str.length= filename_to_tablename(file->name,
tname, sizeof(tname)-1);
- table_str.str= sql_memdup(tname, table_str.length + 1);
+ table_str.str= (char*) sql_memdup(tname, table_str.length + 1);
Table_ident *old_ident= new Table_ident(thd, *old_db, table_str, 0);
Table_ident *new_ident= new Table_ident(thd, *new_db, table_str, 0);
if (!old_ident || !new_ident ||
@@ -1800,7 +1968,7 @@ bool mysql_rename_db(THD *thd, LEX_STRING *old_db, LEX_STRING *new_db)
/* Step9: Let's do "use newdb" if we renamed the current database */
if (change_to_newdb)
- error|= mysql_change_db(thd, new_db, 0);
+ error|= mysql_change_db(thd, new_db, FALSE);
exit:
pthread_mutex_lock(&LOCK_lock_db);
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index d580ac13b3e..368b0da2ecb 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -90,14 +90,26 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
Test if the user wants to delete all rows and deletion doesn't have
any side-effects (because of triggers), so we can use optimized
handler::delete_all_rows() method.
- We implement fast TRUNCATE for InnoDB even if triggers are present.
- TRUNCATE ignores triggers.
+
+ We implement fast TRUNCATE for InnoDB even if triggers are
+ present. TRUNCATE ignores triggers.
+
+ We can use delete_all_rows() if and only if:
+ - We allow new functions (not using option --skip-new), and are
+ not in safe mode (not using option --safe-mode)
+ - There is no limit clause
+ - The condition is constant
+ - If there is a condition, then it it produces a non-zero value
+ - If the current command is DELETE FROM with no where clause
+ (i.e., not TRUNCATE) then:
+ - We should not be binlogging this statement row-based, and
+ - there should be no delete triggers associated with the table.
*/
if (!using_limit && const_cond && (!conds || conds->val_int()) &&
!(specialflag & (SPECIAL_NO_NEW_FUNC | SPECIAL_SAFE_MODE)) &&
(thd->lex->sql_command == SQLCOM_TRUNCATE ||
- !(table->triggers && table->triggers->has_delete_triggers())) &&
- !thd->current_stmt_binlog_row_based)
+ (!thd->current_stmt_binlog_row_based &&
+ !(table->triggers && table->triggers->has_delete_triggers()))))
{
/* Update the table->file->stats.records number */
table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK);
@@ -329,6 +341,9 @@ cleanup:
delete select;
transactional_table= table->file->has_transactions();
+ if (!transactional_table && deleted > 0)
+ thd->transaction.stmt.modified_non_trans_table= TRUE;
+
/* See similar binlogging code in sql_update.cc, for comments */
if ((error < 0) || (deleted && !transactional_table))
{
@@ -352,9 +367,10 @@ cleanup:
error=1;
}
}
- if (!transactional_table)
- thd->no_trans_update.all= TRUE;
+ if (thd->transaction.stmt.modified_non_trans_table)
+ thd->transaction.all.modified_non_trans_table= TRUE;
}
+ DBUG_ASSERT(transactional_table || !deleted || thd->transaction.stmt.modified_non_trans_table);
free_underlaid_joins(thd, select_lex);
if (transactional_table)
{
@@ -438,7 +454,7 @@ bool mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds)
extern "C" int refpos_order_cmp(void* arg, const void *a,const void *b)
{
handler *file= (handler*)arg;
- return file->cmp_ref((const byte*)a, (const byte*)b);
+ return file->cmp_ref((const uchar*)a, (const uchar*)b);
}
/*
@@ -665,20 +681,22 @@ bool multi_delete::send_data(List<Item> &values)
if (table->triggers &&
table->triggers->process_triggers(thd, TRG_EVENT_DELETE,
TRG_ACTION_BEFORE, FALSE))
- DBUG_RETURN(1);
+ DBUG_RETURN(1);
table->status|= STATUS_DELETED;
if (!(error=table->file->ha_delete_row(table->record[0])))
{
- deleted++;
+ deleted++;
+ if (!table->file->has_transactions())
+ thd->transaction.stmt.modified_non_trans_table= TRUE;
if (table->triggers &&
table->triggers->process_triggers(thd, TRG_EVENT_DELETE,
TRG_ACTION_AFTER, FALSE))
- DBUG_RETURN(1);
+ DBUG_RETURN(1);
}
else
{
- table->file->print_error(error,MYF(0));
- DBUG_RETURN(1);
+ table->file->print_error(error,MYF(0));
+ DBUG_RETURN(1);
}
}
else
@@ -728,6 +746,7 @@ void multi_delete::send_error(uint errcode,const char *err)
error= 1;
send_eof();
}
+ DBUG_ASSERT(!normal_tables || !deleted || thd->transaction.stmt.modified_non_trans_table);
DBUG_VOID_RETURN;
}
@@ -741,7 +760,7 @@ void multi_delete::send_error(uint errcode,const char *err)
int multi_delete::do_deletes()
{
- int local_error= 0, counter= 0, error;
+ int local_error= 0, counter= 0, tmp_error;
bool will_batch;
DBUG_ENTER("do_deletes");
DBUG_ASSERT(do_delete);
@@ -756,6 +775,7 @@ int multi_delete::do_deletes()
for (; table_being_deleted;
table_being_deleted= table_being_deleted->next_local, counter++)
{
+ ha_rows last_deleted= deleted;
TABLE *table = table_being_deleted->table;
if (tempfiles[counter]->get(table))
{
@@ -794,14 +814,16 @@ int multi_delete::do_deletes()
break;
}
}
- if (will_batch && (error= table->file->end_bulk_delete()))
+ if (will_batch && (tmp_error= table->file->end_bulk_delete()))
{
if (!local_error)
{
- local_error= error;
+ local_error= tmp_error;
table->file->print_error(local_error,MYF(0));
}
}
+ if (last_deleted != deleted && !table->file->has_transactions())
+ thd->transaction.stmt.modified_non_trans_table= TRUE;
end_read_record(&info);
if (thd->killed && !local_error)
local_error= 1;
@@ -840,7 +862,6 @@ bool multi_delete::send_eof()
{
query_cache_invalidate3(thd, delete_tables, 1);
}
-
if ((local_error == 0) || (deleted && normal_tables))
{
if (mysql_bin_log.is_open())
@@ -855,9 +876,11 @@ bool multi_delete::send_eof()
local_error=1; // Log write failed: roll back the SQL statement
}
}
- if (!transactional_tables)
- thd->no_trans_update.all= TRUE;
+ if (thd->transaction.stmt.modified_non_trans_table)
+ thd->transaction.all.modified_non_trans_table= TRUE;
}
+ DBUG_ASSERT(!normal_tables || !deleted || thd->transaction.stmt.modified_non_trans_table);
+
/* Commit or rollback the current SQL statement */
if (transactional_tables)
if (ha_autocommit_or_rollback(thd,local_error > 0))
@@ -894,16 +917,14 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
char path[FN_REFLEN];
TABLE *table;
bool error;
- uint closed_log_tables= 0, lock_logger= 0;
uint path_length;
- uint log_type;
DBUG_ENTER("mysql_truncate");
bzero((char*) &create_info,sizeof(create_info));
/* If it is a temporary table, close and regenerate it */
if (!dont_send_ok && (table= find_temporary_table(thd, table_list)))
{
- handlerton *table_type= table->s->db_type;
+ handlerton *table_type= table->s->db_type();
TABLE_SHARE *share= table->s;
if (!ha_check_storage_engine_flag(table_type, HTON_CAN_RECREATE))
goto trunc_by_del;
@@ -948,18 +969,6 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
DBUG_RETURN(TRUE);
}
- log_type= check_if_log_table(table_list->db_length, table_list->db,
- table_list->table_name_length,
- table_list->table_name, 1);
- /* close log tables in use */
- if (log_type)
- {
- lock_logger= 1;
- logger.lock();
- logger.close_log_table(log_type, FALSE);
- closed_log_tables= closed_log_tables | log_type;
- }
-
// Remove the .frm extension AIX 5.2 64-bit compiler bug (BUG#16155): this
// crashes, replacement works. *(path + path_length - reg_ext_length)=
// '\0';
@@ -975,29 +984,16 @@ end:
{
if (!error)
{
- if (mysql_bin_log.is_open())
- {
- /*
- TRUNCATE must always be statement-based binlogged (not row-based) so
- we don't test current_stmt_binlog_row_based.
- */
- thd->clear_error();
- thd->binlog_query(THD::STMT_QUERY_TYPE,
- thd->query, thd->query_length, FALSE, FALSE);
- }
+ /*
+ TRUNCATE must always be statement-based binlogged (not row-based) so
+ we don't test current_stmt_binlog_row_based.
+ */
+ write_bin_log(thd, TRUE, thd->query, thd->query_length);
send_ok(thd); // This should return record count
}
VOID(pthread_mutex_lock(&LOCK_open));
unlock_table_name(thd, table_list);
VOID(pthread_mutex_unlock(&LOCK_open));
-
- if (opt_slow_log && (closed_log_tables & QUERY_LOG_SLOW))
- logger.reopen_log_table(QUERY_LOG_SLOW);
-
- if (opt_log && (closed_log_tables & QUERY_LOG_GENERAL))
- logger.reopen_log_table(QUERY_LOG_GENERAL);
- if (lock_logger)
- logger.unlock();
}
else if (error)
{
diff --git a/sql/sql_error.cc b/sql/sql_error.cc
index 61442c52de7..8bdb2e59ed5 100644
--- a/sql/sql_error.cc
+++ b/sql/sql_error.cc
@@ -126,7 +126,7 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
sp_rcontext *spcont= thd->spcont;
thd->no_warnings_for_error= 1;
- thd->spcont= 0;
+ thd->spcont= NULL;
thd->killed= THD::KILL_BAD_DATA;
my_message(code, msg, MYF(0));
@@ -137,6 +137,9 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
level= MYSQL_ERROR::WARN_LEVEL_ERROR;
}
+ if (thd->handle_error(code, level))
+ DBUG_RETURN(NULL);
+
if (thd->spcont &&
thd->spcont->handle_error(code, level, thd))
{
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index cd87330cedb..1adce48c539 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -92,7 +92,7 @@ static int mysql_ha_flush_table(THD *thd, TABLE **table_ptr, uint mode_flags);
Pointer to the TABLE_LIST struct.
*/
-static char *mysql_ha_hash_get_key(TABLE_LIST *tables, uint *key_len_p,
+static char *mysql_ha_hash_get_key(TABLE_LIST *tables, size_t *key_len_p,
my_bool first __attribute__((unused)))
{
*key_len_p= strlen(tables->alias) + 1 ; /* include '\0' in comparisons */
@@ -119,6 +119,44 @@ static void mysql_ha_hash_free(TABLE_LIST *tables)
my_free((char*) tables, MYF(0));
}
+/**
+ Close a HANDLER table.
+
+ @param thd Thread identifier.
+ @param tables A list of tables with the first entry to close.
+
+ @note Though this function takes a list of tables, only the first list entry
+ will be closed.
+ @note Broadcasts refresh if it closed the table.
+*/
+
+static void mysql_ha_close_table(THD *thd, TABLE_LIST *tables)
+{
+ TABLE **table_ptr;
+
+ /*
+ Though we could take the table pointer from hash_tables->table,
+ we must follow the thd->handler_tables chain anyway, as we need the
+ address of the 'next' pointer referencing this table
+ for close_thread_table().
+ */
+ for (table_ptr= &(thd->handler_tables);
+ *table_ptr && (*table_ptr != tables->table);
+ table_ptr= &(*table_ptr)->next)
+ ;
+
+ if (*table_ptr)
+ {
+ (*table_ptr)->file->ha_index_or_rnd_end();
+ VOID(pthread_mutex_lock(&LOCK_open));
+ if (close_thread_table(thd, table_ptr))
+ {
+ /* Tell threads waiting for refresh that something has happened */
+ broadcast_refresh();
+ }
+ VOID(pthread_mutex_unlock(&LOCK_open));
+ }
+}
/*
Open a HANDLER table.
@@ -145,7 +183,7 @@ static void mysql_ha_hash_free(TABLE_LIST *tables)
bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen)
{
- TABLE_LIST *hash_tables;
+ TABLE_LIST *hash_tables = NULL;
char *db, *name, *alias;
uint dblen, namelen, aliaslen, counter;
int error;
@@ -167,7 +205,7 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen)
}
else if (! reopen) /* Otherwise we have 'tables' already. */
{
- if (hash_search(&thd->handler_tables_hash, (byte*) tables->alias,
+ if (hash_search(&thd->handler_tables_hash, (uchar*) tables->alias,
strlen(tables->alias) + 1))
{
DBUG_PRINT("info",("duplicate '%s'", tables->alias));
@@ -197,7 +235,6 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen)
{
if (! reopen)
my_error(ER_ILLEGAL_HA, MYF(0), tables->alias);
- mysql_ha_close(thd, tables);
goto err;
}
@@ -208,10 +245,10 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen)
namelen= strlen(tables->table_name) + 1;
aliaslen= strlen(tables->alias) + 1;
if (!(my_multi_malloc(MYF(MY_WME),
- &hash_tables, sizeof(*hash_tables),
- &db, dblen,
- &name, namelen,
- &alias, aliaslen,
+ &hash_tables, (uint) sizeof(*hash_tables),
+ &db, (uint) dblen,
+ &name, (uint) namelen,
+ &alias, (uint) aliaslen,
NullS)))
goto err;
/* structure copy */
@@ -224,12 +261,8 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen)
memcpy(hash_tables->alias, tables->alias, aliaslen);
/* add to hash */
- if (my_hash_insert(&thd->handler_tables_hash, (byte*) hash_tables))
- {
- my_free((char*) hash_tables, MYF(0));
- mysql_ha_close(thd, tables);
+ if (my_hash_insert(&thd->handler_tables_hash, (uchar*) hash_tables))
goto err;
- }
}
if (! reopen)
@@ -238,13 +271,17 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen)
DBUG_RETURN(FALSE);
err:
+ if (hash_tables)
+ my_free((char*) hash_tables, MYF(0));
+ if (tables->table)
+ mysql_ha_close_table(thd, tables);
DBUG_PRINT("exit",("ERROR"));
DBUG_RETURN(TRUE);
}
/*
- Close a HANDLER table.
+ Close a HANDLER table by alias or table name
SYNOPSIS
mysql_ha_close()
@@ -252,9 +289,8 @@ err:
tables A list of tables with the first entry to close.
DESCRIPTION
- Though this function takes a list of tables, only the first list entry
- will be closed.
- Broadcasts refresh if it closed the table.
+ Closes the table that is associated (on the handler tables hash) with the
+ name (table->alias) of the specified table.
RETURN
FALSE ok
@@ -264,38 +300,16 @@ err:
bool mysql_ha_close(THD *thd, TABLE_LIST *tables)
{
TABLE_LIST *hash_tables;
- TABLE **table_ptr;
DBUG_ENTER("mysql_ha_close");
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,
- (byte*) tables->alias,
+ (uchar*) tables->alias,
strlen(tables->alias) + 1)))
{
- /*
- Though we could take the table pointer from hash_tables->table,
- we must follow the thd->handler_tables chain anyway, as we need the
- address of the 'next' pointer referencing this table
- for close_thread_table().
- */
- for (table_ptr= &(thd->handler_tables);
- *table_ptr && (*table_ptr != hash_tables->table);
- table_ptr= &(*table_ptr)->next)
- ;
-
- if (*table_ptr)
- {
- (*table_ptr)->file->ha_index_or_rnd_end();
- VOID(pthread_mutex_lock(&LOCK_open));
- if (close_thread_table(thd, table_ptr))
- {
- /* Tell threads waiting for refresh that something has happened */
- broadcast_refresh();
- }
- VOID(pthread_mutex_unlock(&LOCK_open));
- }
- hash_delete(&thd->handler_tables_hash, (byte*) hash_tables);
+ mysql_ha_close_table(thd, hash_tables);
+ hash_delete(&thd->handler_tables_hash, (uchar*) hash_tables);
}
else
{
@@ -345,7 +359,7 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables,
String buffer(buff, sizeof(buff), system_charset_info);
int error, keyno= -1;
uint num_rows;
- byte *key;
+ uchar *key;
uint key_len;
bool not_used;
DBUG_ENTER("mysql_ha_read");
@@ -362,7 +376,7 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables,
it++;
if ((hash_tables= (TABLE_LIST*) hash_search(&thd->handler_tables_hash,
- (byte*) tables->alias,
+ (uchar*) tables->alias,
strlen(tables->alias) + 1)))
{
table= hash_tables->table;
@@ -430,7 +444,7 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables,
cond->cleanup(); // File was reopened
if ((!cond->fixed &&
cond->fix_fields(thd, &cond)) || cond->check_cols(1))
- goto err0;
+ goto err;
}
if (keyname)
@@ -438,13 +452,13 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables,
if ((keyno=find_type(keyname, &table->s->keynames, 1+2)-1)<0)
{
my_error(ER_KEY_DOES_NOT_EXITS, MYF(0), keyname, tables->alias);
- goto err0;
+ goto err;
}
}
if (insert_fields(thd, &thd->lex->select_lex.context,
tables->db, tables->alias, &it, 0))
- goto err0;
+ goto err;
protocol->send_fields(&list, Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF);
@@ -536,13 +550,13 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables,
keypart_map= (keypart_map << 1) | 1;
}
- if (!(key= (byte*) thd->calloc(ALIGN_SIZE(key_len))))
+ if (!(key= (uchar*) thd->calloc(ALIGN_SIZE(key_len))))
goto err;
table->file->ha_index_or_rnd_end();
table->file->ha_index_init(keyno, 1);
key_copy(key, table->record[0], table->key_info + keyno, key_len);
- error= table->file->index_read(table->record[0],
- key, keypart_map, ha_rkey_mode);
+ error= table->file->index_read_map(table->record[0],
+ key, keypart_map, ha_rkey_mode);
mode=rkey_to_rnext[(int)ha_rkey_mode];
break;
}
@@ -682,7 +696,7 @@ int mysql_ha_flush(THD *thd, TABLE_LIST *tables, uint mode_flags,
while (*table_ptr)
{
if ((mode_flags & MYSQL_HA_FLUSH_ALL) ||
- ((*table_ptr)->s->version != refresh_version))
+ (*table_ptr)->needs_reopen_or_name_lock())
{
/* The first time it is required, lock for close_thread_table(). */
if (! did_lock && ! is_locked)
@@ -732,13 +746,13 @@ static int mysql_ha_flush_table(THD *thd, TABLE **table_ptr, uint mode_flags)
table->alias, mode_flags));
if ((hash_tables= (TABLE_LIST*) hash_search(&thd->handler_tables_hash,
- (byte*) table->alias,
+ (uchar*) table->alias,
strlen(table->alias) + 1)))
{
if (! (mode_flags & MYSQL_HA_REOPEN_ON_USAGE))
{
/* This is a final close. Remove from hash. */
- hash_delete(&thd->handler_tables_hash, (byte*) hash_tables);
+ hash_delete(&thd->handler_tables_hash, (uchar*) hash_tables);
}
else
{
@@ -758,41 +772,3 @@ static int mysql_ha_flush_table(THD *thd, TABLE **table_ptr, uint mode_flags)
DBUG_RETURN(0);
}
-
-
-/*
- Mark tables for reopen.
-
- SYNOPSIS
- mysql_ha_mark_tables_for_reopen()
- thd Thread identifier.
- table Table list to mark for reopen.
-
- DESCRIPTION
- For each table found in the handler hash mark it as closed
- (ready for reopen) and end all index/table scans.
-
- NOTE
- The caller must lock LOCK_open.
-*/
-
-void mysql_ha_mark_tables_for_reopen(THD *thd, TABLE *table)
-{
- DBUG_ENTER("mysql_ha_mark_tables_for_reopen");
-
- safe_mutex_assert_owner(&LOCK_open);
- for (; table; table= table->next)
- {
- TABLE_LIST *hash_tables;
- if ((hash_tables= (TABLE_LIST*) hash_search(&thd->handler_tables_hash,
- (byte*) table->alias,
- strlen(table->alias) + 1)))
- {
- /* Mark table as ready for reopen. */
- hash_tables->table= NULL;
- /* End open index/table scans. */
- table->file->ha_index_or_rnd_end();
- }
- }
- DBUG_VOID_RETURN;
-}
diff --git a/sql/sql_help.cc b/sql/sql_help.cc
index 79d658c2a85..c1962c8c650 100644
--- a/sql/sql_help.cc
+++ b/sql/sql_help.cc
@@ -272,7 +272,7 @@ int get_topics_for_keyword(THD *thd, TABLE *topics, TABLE *relations,
List<String> *names,
String *name, String *description, String *example)
{
- char buff[8]; // Max int length
+ uchar buff[8]; // Max int length
int count= 0;
int iindex_topic, iindex_relations;
Field *rtopic_id, *rkey_id;
@@ -294,22 +294,22 @@ int get_topics_for_keyword(THD *thd, TABLE *topics, TABLE *relations,
rkey_id->store((longlong) key_id, TRUE);
rkey_id->get_key_image(buff, rkey_id->pack_length(), Field::itRAW);
- int key_res= relations->file->index_read(relations->record[0],
- (byte *) buff, (key_part_map)1,
- HA_READ_KEY_EXACT);
+ int key_res= relations->file->index_read_map(relations->record[0],
+ buff, (key_part_map) 1,
+ HA_READ_KEY_EXACT);
for ( ;
!key_res && key_id == (int16) rkey_id->val_int() ;
key_res= relations->file->index_next(relations->record[0]))
{
- char topic_id_buff[8];
+ uchar topic_id_buff[8];
longlong topic_id= rtopic_id->val_int();
Field *field= find_fields[help_topic_help_topic_id].field;
field->store((longlong) topic_id, TRUE);
field->get_key_image(topic_id_buff, field->pack_length(), Field::itRAW);
- if (!topics->file->index_read(topics->record[0], (byte *)topic_id_buff,
- (key_part_map)1, HA_READ_KEY_EXACT))
+ if (!topics->file->index_read_map(topics->record[0], topic_id_buff,
+ (key_part_map)1, HA_READ_KEY_EXACT))
{
memorize_variant_topic(thd,topics,count,find_fields,
names,name,description,example);
@@ -637,7 +637,7 @@ bool mysqld_help(THD *thd, const char *mask)
MEM_ROOT *mem_root= thd->mem_root;
DBUG_ENTER("mysqld_help");
- bzero((gptr)tables,sizeof(tables));
+ bzero((uchar*)tables,sizeof(tables));
tables[0].alias= tables[0].table_name= (char*) "help_topic";
tables[0].lock_type= TL_READ;
tables[0].next_global= tables[0].next_local=
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index bd219082f8f..d47b2079f9f 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -29,7 +29,7 @@
waited for to open and lock the table.
If accessing the thread succeeded, in
- delayed_insert::get_local_table() the table of the thread is copied
+ Delayed_insert::get_local_table() the table of the thread is copied
for local use. A copy is required because the normal insert logic
works on a target table, but the other threads table object must not
be used. The insert logic uses the record buffer to create a record.
@@ -63,8 +63,8 @@
#include "rpl_mi.h"
#ifndef EMBEDDED_LIBRARY
-static TABLE *delayed_get_table(THD *thd,TABLE_LIST *table_list);
-static int write_delayed(THD *thd, TABLE *table, enum_duplicates dup,
+static bool delayed_get_table(THD *thd, TABLE_LIST *table_list);
+static int write_delayed(THD *thd, TABLE *table, enum_duplicates duplic,
LEX_STRING query, bool ignore, bool log_on);
static void end_delayed_insert(THD *thd);
pthread_handler_t handle_delayed_insert(void *arg);
@@ -189,15 +189,12 @@ static int check_insert_fields(THD *thd, TABLE_LIST *table_list,
return -1;
}
#ifndef NO_EMBEDDED_ACCESS_CHECKS
- if (grant_option)
- {
- Field_iterator_table field_it;
- field_it.set_table(table);
- if (check_grant_all_columns(thd, INSERT_ACL, &table->grant,
- table->s->db.str, table->s->table_name.str,
- &field_it))
- return -1;
- }
+ Field_iterator_table field_it;
+ field_it.set_table(table);
+ if (check_grant_all_columns(thd, INSERT_ACL, &table->grant,
+ table->s->db.str, table->s->table_name.str,
+ &field_it))
+ return -1;
#endif
clear_timestamp_auto_bits(table->timestamp_field_type,
TIMESTAMP_AUTO_SET_ON_INSERT);
@@ -384,6 +381,170 @@ void prepare_triggers_for_insert_stmt(TABLE *table)
}
+/**
+ Upgrade table-level lock of INSERT statement to TL_WRITE if
+ a more concurrent lock is infeasible for some reason. This is
+ necessary for engines without internal locking support (MyISAM).
+ An engine with internal locking implementation might later
+ downgrade the lock in handler::store_lock() method.
+*/
+
+static
+void upgrade_lock_type(THD *thd, thr_lock_type *lock_type,
+ enum_duplicates duplic,
+ bool is_multi_insert)
+{
+ if (duplic == DUP_UPDATE ||
+ duplic == DUP_REPLACE && *lock_type == TL_WRITE_CONCURRENT_INSERT)
+ {
+ *lock_type= TL_WRITE_DEFAULT;
+ return;
+ }
+
+ if (*lock_type == TL_WRITE_DELAYED)
+ {
+ /*
+ We do not use delayed threads if:
+ - we're running in the safe mode or skip-new mode -- the
+ feature is disabled in these modes
+ - we're executing this statement on a replication slave --
+ we need to ensure serial execution of queries on the
+ slave
+ - it is INSERT .. ON DUPLICATE KEY UPDATE - in this case the
+ insert cannot be concurrent
+ - this statement is directly or indirectly invoked from
+ a stored function or trigger (under pre-locking) - to
+ avoid deadlocks, since INSERT DELAYED involves a lock
+ upgrade (TL_WRITE_DELAYED -> TL_WRITE) which we should not
+ attempt while keeping other table level locks.
+ - this statement itself may require pre-locking.
+ We should upgrade the lock even though in most cases
+ delayed functionality may work. Unfortunately, we can't
+ easily identify whether the subject table is not used in
+ the statement indirectly via a stored function or trigger:
+ if it is used, that will lead to a deadlock between the
+ client connection and the delayed thread.
+ */
+ if (specialflag & (SPECIAL_NO_NEW_FUNC | SPECIAL_SAFE_MODE) ||
+ thd->variables.max_insert_delayed_threads == 0 ||
+ thd->prelocked_mode ||
+ thd->lex->uses_stored_routines())
+ {
+ *lock_type= TL_WRITE;
+ return;
+ }
+ if (thd->slave_thread)
+ {
+ /* Try concurrent insert */
+ *lock_type= (duplic == DUP_UPDATE || duplic == DUP_REPLACE) ?
+ TL_WRITE : TL_WRITE_CONCURRENT_INSERT;
+ return;
+ }
+
+ bool log_on= (thd->options & OPTION_BIN_LOG ||
+ ! (thd->security_ctx->master_access & SUPER_ACL));
+ if (global_system_variables.binlog_format == BINLOG_FORMAT_STMT &&
+ log_on && mysql_bin_log.is_open() && is_multi_insert)
+ {
+ /*
+ Statement-based binary logging does not work in this case, because:
+ a) two concurrent statements may have their rows intermixed in the
+ queue, leading to autoincrement replication problems on slave (because
+ the values generated used for one statement don't depend only on the
+ value generated for the first row of this statement, so are not
+ replicable)
+ b) if first row of the statement has an error the full statement is
+ not binlogged, while next rows of the statement may be inserted.
+ c) if first row succeeds, statement is binlogged immediately with a
+ zero error code (i.e. "no error"), if then second row fails, query
+ will fail on slave too and slave will stop (wrongly believing that the
+ master got no error).
+ So we fallback to non-delayed INSERT.
+ Note that to be fully correct, we should test the "binlog format which
+ the delayed thread is going to use for this row". But in the common case
+ where the global binlog format is not changed and the session binlog
+ format may be changed, that is equal to the global binlog format.
+ We test it without mutex for speed reasons (condition rarely true), and
+ in the common case (global not changed) it is as good as without mutex;
+ if global value is changed, anyway there is uncertainty as the delayed
+ thread may be old and use the before-the-change value.
+ */
+ *lock_type= TL_WRITE;
+ }
+ }
+}
+
+
+/**
+ Find or create a delayed insert thread for the first table in
+ the table list, then open and lock the remaining tables.
+ If a table can not be used with insert delayed, upgrade the lock
+ and open and lock all tables using the standard mechanism.
+
+ @param thd thread context
+ @param table_list list of "descriptors" for tables referenced
+ directly in statement SQL text.
+ The first element in the list corresponds to
+ the destination table for inserts, remaining
+ tables, if any, are usually tables referenced
+ by sub-queries in the right part of the
+ INSERT.
+
+ @return Status of the operation. In case of success 'table'
+ member of every table_list element points to an instance of
+ class TABLE.
+
+ @sa open_and_lock_tables for more information about MySQL table
+ level locking
+*/
+
+static
+bool open_and_lock_for_insert_delayed(THD *thd, TABLE_LIST *table_list)
+{
+ DBUG_ENTER("open_and_lock_for_insert_delayed");
+
+#ifndef EMBEDDED_LIBRARY
+ if (delayed_get_table(thd, table_list))
+ DBUG_RETURN(TRUE);
+
+ if (table_list->table)
+ {
+ /*
+ Open tables used for sub-selects or in stored functions, will also
+ cache these functions.
+ */
+ if (open_and_lock_tables(thd, table_list->next_global))
+ {
+ end_delayed_insert(thd);
+ DBUG_RETURN(TRUE);
+ }
+ /*
+ First table was not processed by open_and_lock_tables(),
+ we need to set updatability flag "by hand".
+ */
+ if (!table_list->derived && !table_list->view)
+ table_list->updatable= 1; // usual table
+ DBUG_RETURN(FALSE);
+ }
+#endif
+ /*
+ * This is embedded library and we don't have auxiliary
+ threads OR
+ * a lock upgrade was requested inside delayed_get_table
+ because
+ - there are too many delayed insert threads OR
+ - the table has triggers.
+ Use a normal insert.
+ */
+ table_list->lock_type= TL_WRITE;
+ DBUG_RETURN(open_and_lock_tables(thd, table_list));
+}
+
+
+/**
+ INSERT statement implementation
+*/
+
bool mysql_insert(THD *thd,TABLE_LIST *table_list,
List<Item> &fields,
List<List_item> &values_list,
@@ -395,6 +556,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
int error, res;
bool transactional_table, joins_freed= FALSE;
bool changed;
+ bool was_insert_delayed= (table_list->lock_type == TL_WRITE_DELAYED);
uint value_count;
ulong counter = 1;
ulonglong id;
@@ -406,7 +568,6 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
Name_resolution_context_state ctx_state;
#ifndef EMBEDDED_LIBRARY
char *query= thd->query;
-#endif
/*
log_on is about delayed inserts only.
By default, both logs are enabled (this won't cause problems if the server
@@ -414,98 +575,42 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
*/
bool log_on= ((thd->options & OPTION_BIN_LOG) ||
(!(thd->security_ctx->master_access & SUPER_ACL)));
+#endif
thr_lock_type lock_type = table_list->lock_type;
Item *unused_conds= 0;
DBUG_ENTER("mysql_insert");
/*
- in safe mode or with skip-new change delayed insert to be regular
- if we are told to replace duplicates, the insert cannot be concurrent
- delayed insert changed to regular in slave thread
- */
-#ifdef EMBEDDED_LIBRARY
- if (lock_type == TL_WRITE_DELAYED)
- lock_type=TL_WRITE;
-#else
- if ((lock_type == TL_WRITE_DELAYED &&
- ((specialflag & (SPECIAL_NO_NEW_FUNC | SPECIAL_SAFE_MODE)) ||
- thd->slave_thread || !thd->variables.max_insert_delayed_threads)) ||
- (lock_type == TL_WRITE_CONCURRENT_INSERT && duplic == DUP_REPLACE) ||
- (duplic == DUP_UPDATE))
- lock_type=TL_WRITE;
-#endif
- if ((lock_type == TL_WRITE_DELAYED) &&
- (global_system_variables.binlog_format == BINLOG_FORMAT_STMT) &&
- log_on && mysql_bin_log.is_open() &&
- (values_list.elements > 1))
+ Upgrade lock type if the requested lock is incompatible with
+ the current connection mode or table operation.
+ */
+ upgrade_lock_type(thd, &table_list->lock_type, duplic,
+ values_list.elements > 1);
+
+ /*
+ We can't write-delayed into a table locked with LOCK TABLES:
+ this will lead to a deadlock, since the delayed thread will
+ never be able to get a lock on the table. QQQ: why not
+ upgrade the lock here instead?
+ */
+ if (table_list->lock_type == TL_WRITE_DELAYED && thd->locked_tables &&
+ find_locked_table(thd, table_list->db, table_list->table_name))
{
- /*
- Statement-based binary logging does not work in this case, because:
- a) two concurrent statements may have their rows intermixed in the
- queue, leading to autoincrement replication problems on slave (because
- the values generated used for one statement don't depend only on the
- value generated for the first row of this statement, so are not
- replicable)
- b) if first row of the statement has an error the full statement is
- not binlogged, while next rows of the statement may be inserted.
- c) if first row succeeds, statement is binlogged immediately with a
- zero error code (i.e. "no error"), if then second row fails, query
- will fail on slave too and slave will stop (wrongly believing that the
- master got no error).
- So we fallback to non-delayed INSERT.
- Note that to be fully correct, we should test the "binlog format which
- the delayed thread is going to use for this row". But in the common case
- where the global binlog format is not changed and the session binlog
- format may be changed, that is equal to the global binlog format.
- We test it without mutex for speed reasons (condition rarely true), and
- in the common case (global not changed) it is as good as without mutex;
- if global value is changed, anyway there is uncertainty as the delayed
- thread may be old and use the before-the-change value.
- */
- lock_type= TL_WRITE;
+ my_error(ER_DELAYED_INSERT_TABLE_LOCKED, MYF(0),
+ table_list->table_name);
+ DBUG_RETURN(TRUE);
}
- table_list->lock_type= lock_type;
-#ifndef EMBEDDED_LIBRARY
- if (lock_type == TL_WRITE_DELAYED)
+ if (table_list->lock_type == TL_WRITE_DELAYED)
{
- res= 1;
- if (thd->locked_tables)
- {
- DBUG_ASSERT(table_list->db); /* Must be set in the parser */
- if (find_locked_table(thd, table_list->db, table_list->table_name))
- {
- my_error(ER_DELAYED_INSERT_TABLE_LOCKED, MYF(0),
- table_list->table_name);
- DBUG_RETURN(TRUE);
- }
- }
- if ((table= delayed_get_table(thd,table_list)) && !thd->is_fatal_error)
- {
- /*
- Open tables used for sub-selects or in stored functions, will also
- cache these functions.
- */
- res= open_and_lock_tables(thd, table_list->next_global);
- /*
- First is not processed by open_and_lock_tables() => we need set
- updateability flags "by hands".
- */
- if (!table_list->derived && !table_list->view)
- table_list->updatable= 1; // usual table
- }
- else
- {
- /* Too many delayed insert threads; Use a normal insert */
- table_list->lock_type= lock_type= TL_WRITE;
- res= open_and_lock_tables(thd, table_list);
- }
+ if (open_and_lock_for_insert_delayed(thd, table_list))
+ DBUG_RETURN(TRUE);
}
else
-#endif /* EMBEDDED_LIBRARY */
- res= open_and_lock_tables(thd, table_list);
- if (res || thd->is_fatal_error)
- DBUG_RETURN(TRUE);
+ {
+ if (open_and_lock_tables(thd, table_list))
+ DBUG_RETURN(TRUE);
+ }
thd_proc_info(thd, "init");
thd->used_tables=0;
@@ -523,6 +628,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
/* mysql_prepare_insert set table_list->table if it was not set */
table= table_list->table;
+ lock_type= table_list->lock_type;
context= &thd->lex->select_lex.context;
/*
@@ -563,7 +669,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
/*
Fill in the given fields and dump it to the table file
*/
- info.records= info.deleted= info.copied= info.updated= 0;
+ bzero((char*) &info,sizeof(info));
info.ignore= ignore;
info.handle_duplicates=duplic;
info.update_fields= &update_fields;
@@ -597,6 +703,8 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
if (duplic == DUP_REPLACE &&
(!table->triggers || !table->triggers->has_delete_triggers()))
table->file->extra(HA_EXTRA_WRITE_CAN_REPLACE);
+ if (duplic == DUP_UPDATE)
+ table->file->extra(HA_EXTRA_INSERT_WITH_UPDATE);
/*
let's *try* to start bulk inserts. It won't necessary
start them as values_list.elements should be greater than
@@ -612,7 +720,6 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
if (lock_type != TL_WRITE_DELAYED && !thd->prelocked_mode)
table->file->ha_start_bulk_insert(values_list.elements);
- thd->no_trans_update.stmt= FALSE;
thd->abort_on_warning= (!ignore && (thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES |
MODE_STRICT_ALL_TABLES)));
@@ -732,35 +839,65 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
}
transactional_table= table->file->has_transactions();
- if ((changed= (info.copied || info.deleted || info.updated)))
+ if ((changed= (info.copied || info.deleted || info.updated)) ||
+ was_insert_delayed)
{
/*
Invalidate the table in the query cache if something changed.
For the transactional algorithm to work the invalidation must be
before binlog writing and ha_autocommit_or_rollback
*/
- query_cache_invalidate3(thd, table_list, 1);
+ if (changed)
+ query_cache_invalidate3(thd, table_list, 1);
if (error <= 0 || !transactional_table)
{
if (mysql_bin_log.is_open())
{
if (error <= 0)
+ {
+ /*
+ [Guilhem wrote] Temporary errors may have filled
+ thd->net.last_error/errno. For example if there has
+ been a disk full error when writing the row, and it was
+ MyISAM, then thd->net.last_error/errno will be set to
+ "disk full"... and the my_pwrite() will wait until free
+ space appears, and so when it finishes then the
+ write_row() was entirely successful
+ */
+ /* todo: consider removing */
thd->clear_error();
+ }
+ /* bug#22725:
+
+ A query which per-row-loop can not be interrupted with
+ KILLED, like INSERT, and that does not invoke stored
+ routines can be binlogged with neglecting the KILLED error.
+
+ If there was no error (error == zero) until after the end of
+ inserting loop the KILLED flag that appeared later can be
+ disregarded since previously possible invocation of stored
+ routines did not result in any error due to the KILLED. In
+ such case the flag is ignored for constructing binlog event.
+ */
+ DBUG_ASSERT(thd->killed != THD::KILL_BAD_DATA || error > 0);
if (thd->binlog_query(THD::ROW_QUERY_TYPE,
thd->query, thd->query_length,
- transactional_table, FALSE) &&
+ transactional_table, FALSE,
+ (error>0) ? thd->killed : THD::NOT_KILLED) &&
transactional_table)
{
error=1;
}
}
- if (!transactional_table)
- thd->no_trans_update.all= TRUE;
+ if (thd->transaction.stmt.modified_non_trans_table)
+ thd->transaction.all.modified_non_trans_table= TRUE;
}
}
+ DBUG_ASSERT(transactional_table || !changed ||
+ thd->transaction.stmt.modified_non_trans_table);
if (transactional_table)
error=ha_autocommit_or_rollback(thd,error);
-
+
if (thd->lock)
{
mysql_unlock_tables(thd, thd->lock);
@@ -808,20 +945,24 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
if (values_list.elements == 1 && (!(thd->options & OPTION_WARNINGS) ||
!thd->cuted_fields))
{
- thd->row_count_func= info.copied+info.deleted+info.updated;
+ thd->row_count_func= info.copied + info.deleted +
+ ((thd->client_capabilities & CLIENT_FOUND_ROWS) ?
+ info.touched : info.updated);
send_ok(thd, (ulong) thd->row_count_func, id);
}
else
{
char buff[160];
+ ha_rows updated=((thd->client_capabilities & CLIENT_FOUND_ROWS) ?
+ info.touched : info.updated);
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);
else
sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records,
- (ulong) (info.deleted+info.updated), (ulong) thd->cuted_fields);
- thd->row_count_func= info.copied+info.deleted+info.updated;
+ (ulong) (info.deleted + updated), (ulong) thd->cuted_fields);
+ thd->row_count_func= info.copied + info.deleted + updated;
::send_ok(thd, (ulong) thd->row_count_func, id, buff);
}
thd->abort_on_warning= 0;
@@ -1163,7 +1304,7 @@ static int last_uniq_key(TABLE *table,uint keynr)
then both on update triggers will work instead. Similarly both on
delete triggers will be invoked if we will delete conflicting records.
- Sets thd->no_trans_update.stmt to TRUE if table which is updated didn't have
+ Sets thd->transaction.stmt.modified_non_trans_table to TRUE if table which is updated didn't have
transactions.
RETURN VALUE
@@ -1256,10 +1397,10 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
goto err;
}
}
- key_copy((byte*) key,table->record[0],table->key_info+key_nr,0);
- if ((error=(table->file->index_read_idx(table->record[1],key_nr,
- (byte*) key, HA_WHOLE_KEY,
- HA_READ_KEY_EXACT))))
+ key_copy((uchar*) key,table->record[0],table->key_info+key_nr,0);
+ if ((error=(table->file->index_read_idx_map(table->record[1],key_nr,
+ (uchar*) key, HA_WHOLE_KEY,
+ HA_READ_KEY_EXACT))))
goto err;
}
if (info->handle_duplicates == DUP_UPDATE)
@@ -1276,7 +1417,8 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
DBUG_ASSERT(info->update_fields->elements ==
info->update_values->elements);
if (fill_record_n_invoke_before_triggers(thd, *info->update_fields,
- *info->update_values, 0,
+ *info->update_values,
+ info->ignore,
table->triggers,
TRG_EVENT_UPDATE))
goto before_trg_err;
@@ -1290,20 +1432,30 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
goto before_trg_err;
table->file->restore_auto_increment(prev_insert_id);
- if ((error=table->file->ha_update_row(table->record[1],
- table->record[0])))
- {
- if (info->ignore &&
- !table->file->is_fatal_error(error, HA_CHECK_DUP_KEY))
+ if (table->next_number_field)
+ table->file->adjust_next_insert_id_after_explicit_value(
+ table->next_number_field->val_int());
+ info->touched++;
+ if ((table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ &&
+ !bitmap_is_subset(table->write_set, table->read_set)) ||
+ compare_record(table))
+ {
+ if ((error=table->file->ha_update_row(table->record[1],
+ table->record[0])) &&
+ error != HA_ERR_RECORD_IS_THE_SAME)
{
- goto ok_or_after_trg_err;
+ if (info->ignore &&
+ !table->file->is_fatal_error(error, HA_CHECK_DUP_KEY))
+ {
+ goto ok_or_after_trg_err;
+ }
+ goto err;
}
- goto err;
- }
- if ((table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ) ||
- compare_record(table))
- {
- info->updated++;
+
+ if (error != HA_ERR_RECORD_IS_THE_SAME)
+ info->updated++;
+ else
+ error= 0;
/*
If ON DUP KEY UPDATE updates a row instead of inserting one, it's
like a regular UPDATE statement: it should not affect the value of a
@@ -1312,15 +1464,17 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
handled separately by THD::arg_of_last_insert_id_function.
*/
insert_id_for_cur_row= table->file->insert_id_for_cur_row= 0;
- if (table->next_number_field)
- table->file->adjust_next_insert_id_after_explicit_value(
- table->next_number_field->val_int());
trg_error= (table->triggers &&
table->triggers->process_triggers(thd, TRG_EVENT_UPDATE,
TRG_ACTION_AFTER, TRUE));
info->copied++;
}
+ if (table->next_number_field)
+ table->file->adjust_next_insert_id_after_explicit_value(
+ table->next_number_field->val_int());
+ info->touched++;
+
goto ok_or_after_trg_err;
}
else /* DUP_REPLACE */
@@ -1346,9 +1500,13 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
(!table->triggers || !table->triggers->has_delete_triggers()))
{
if ((error=table->file->ha_update_row(table->record[1],
- table->record[0])))
+ table->record[0])) &&
+ error != HA_ERR_RECORD_IS_THE_SAME)
goto err;
- info->deleted++;
+ if (error != HA_ERR_RECORD_IS_THE_SAME)
+ info->deleted++;
+ else
+ error= 0;
thd->record_first_successful_insert_id_in_cur_stmt(table->file->insert_id_for_cur_row);
/*
Since we pretend that we have done insert we should call
@@ -1366,7 +1524,7 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
goto err;
info->deleted++;
if (!table->file->has_transactions())
- thd->no_trans_update.stmt= TRUE;
+ thd->transaction.stmt.modified_non_trans_table= TRUE;
if (table->triggers &&
table->triggers->process_triggers(thd, TRG_EVENT_DELETE,
TRG_ACTION_AFTER, TRUE))
@@ -1407,7 +1565,7 @@ ok_or_after_trg_err:
if (key)
my_safe_afree(key,table->s->max_unique_length,MAX_KEY_LENGTH);
if (!table->file->has_transactions())
- thd->no_trans_update.stmt= TRUE;
+ thd->transaction.stmt.modified_non_trans_table= TRUE;
DBUG_RETURN(trg_error);
err:
@@ -1502,8 +1660,14 @@ public:
}
};
+/**
+ Delayed_insert - context of a thread responsible for delayed insert
+ into one table. When processing delayed inserts, we create an own
+ thread for every distinct table. Later on all delayed inserts directed
+ into that table are handled by a dedicated thread.
+*/
-class delayed_insert :public ilink {
+class Delayed_insert :public ilink {
uint locks_in_memory;
public:
THD thd;
@@ -1517,7 +1681,7 @@ public:
ulong group_count;
TABLE_LIST table_list; // Argument
- delayed_insert()
+ Delayed_insert()
:locks_in_memory(0),
table(0),tables_in_use(0),stacked_inserts(0), status(0), dead(0),
group_count(0)
@@ -1533,6 +1697,7 @@ public:
Statement-based replication of INSERT DELAYED has problems with RAND()
and user vars, so in mixed mode we go to row-based.
*/
+ thd.lex->set_stmt_unsafe();
thd.set_current_stmt_binlog_row_based_if_mixed();
bzero((char*) &thd.net, sizeof(thd.net)); // Safety
@@ -1547,7 +1712,7 @@ public:
delayed_insert_threads++;
VOID(pthread_mutex_unlock(&LOCK_thread_count));
}
- ~delayed_insert()
+ ~Delayed_insert()
{
/* The following is not really needed, but just for safety */
delayed_row *row;
@@ -1595,41 +1760,92 @@ public:
};
-I_List<delayed_insert> delayed_threads;
+I_List<Delayed_insert> delayed_threads;
-delayed_insert *find_handler(THD *thd, TABLE_LIST *table_list)
+/**
+ Return an instance of delayed insert thread that can handle
+ inserts into a given table, if it exists. Otherwise return NULL.
+*/
+
+static
+Delayed_insert *find_handler(THD *thd, TABLE_LIST *table_list)
{
thd_proc_info(thd, "waiting for delay_list");
pthread_mutex_lock(&LOCK_delayed_insert); // Protect master list
- I_List_iterator<delayed_insert> it(delayed_threads);
- delayed_insert *tmp;
- while ((tmp=it++))
+ I_List_iterator<Delayed_insert> it(delayed_threads);
+ Delayed_insert *di;
+ while ((di= it++))
{
- if (!strcmp(tmp->thd.db, table_list->db) &&
- !strcmp(table_list->table_name, tmp->table->s->table_name.str))
+ if (!strcmp(table_list->db, di->table_list.db) &&
+ !strcmp(table_list->table_name, di->table_list.table_name))
{
- tmp->lock();
+ di->lock();
break;
}
}
pthread_mutex_unlock(&LOCK_delayed_insert); // For unlink from list
- return tmp;
+ return di;
}
-static TABLE *delayed_get_table(THD *thd,TABLE_LIST *table_list)
+/**
+ Attempt to find or create a delayed insert thread to handle inserts
+ into this table.
+
+ @return In case of success, table_list->table points to a local copy
+ of the delayed table or is set to NULL, which indicates a
+ request for lock upgrade. In case of failure, value of
+ table_list->table is undefined.
+ @retval TRUE - this thread ran out of resources OR
+ - a newly created delayed insert thread ran out of
+ resources OR
+ - the created thread failed to open and lock the table
+ (e.g. because it does not exist) OR
+ - the table opened in the created thread turned out to
+ be a view
+ @retval FALSE - table successfully opened OR
+ - too many delayed insert threads OR
+ - the table has triggers and we have to fall back to
+ a normal INSERT
+ Two latter cases indicate a request for lock upgrade.
+
+ XXX: why do we regard INSERT DELAYED into a view as an error and
+ do not simply perform a lock upgrade?
+
+ TODO: The approach with using two mutexes to work with the
+ delayed thread list -- LOCK_delayed_insert and
+ LOCK_delayed_create -- is redundant, and we only need one of
+ them to protect the list. The reason we have two locks is that
+ we do not want to block look-ups in the list while we're waiting
+ for the newly created thread to open the delayed table. However,
+ this wait itself is redundant -- we always call get_local_table
+ later on, and there wait again until the created thread acquires
+ a table lock.
+
+ As is redundant the concept of locks_in_memory, since we already
+ have another counter with similar semantics - tables_in_use,
+ both of them are devoted to counting the number of producers for
+ a given consumer (delayed insert thread), only at different
+ stages of producer-consumer relationship.
+
+ 'dead' and 'status' variables in Delayed_insert are redundant
+ too, since there is already 'di->thd.killed' and
+ di->stacked_inserts.
+*/
+
+static
+bool delayed_get_table(THD *thd, TABLE_LIST *table_list)
{
int error;
- delayed_insert *tmp;
- TABLE *table;
+ Delayed_insert *di;
DBUG_ENTER("delayed_get_table");
/* Must be set in the parser */
DBUG_ASSERT(table_list->db);
/* Find the thread which handles this table. */
- if (!(tmp=find_handler(thd,table_list)))
+ if (!(di= find_handler(thd, table_list)))
{
/*
No match. Create a new thread to handle the table, but
@@ -1643,104 +1859,124 @@ static TABLE *delayed_get_table(THD *thd,TABLE_LIST *table_list)
The first search above was done without LOCK_delayed_create.
Another thread might have created the handler in between. Search again.
*/
- if (! (tmp= find_handler(thd, table_list)))
+ if (! (di= find_handler(thd, table_list)))
{
- if (!(tmp=new delayed_insert()))
+ if (!(di= new Delayed_insert()))
{
- my_error(ER_OUTOFMEMORY,MYF(0),sizeof(delayed_insert));
- goto err1;
+ my_error(ER_OUTOFMEMORY,MYF(0),sizeof(Delayed_insert));
+ thd->fatal_error();
+ goto end_create;
}
pthread_mutex_lock(&LOCK_thread_count);
thread_count++;
pthread_mutex_unlock(&LOCK_thread_count);
- tmp->thd.set_db(table_list->db, strlen(table_list->db));
- tmp->thd.query= my_strdup(table_list->table_name,MYF(MY_WME));
- if (tmp->thd.db == NULL || tmp->thd.query == NULL)
+ di->thd.set_db(table_list->db, strlen(table_list->db));
+ di->thd.query= my_strdup(table_list->table_name, MYF(MY_WME));
+ if (di->thd.db == NULL || di->thd.query == NULL)
{
- delete tmp;
- my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
- goto err1;
+ /* The error is reported */
+ delete di;
+ thd->fatal_error();
+ goto end_create;
}
- tmp->table_list= *table_list; // Needed to open table
- tmp->table_list.alias= tmp->table_list.table_name= tmp->thd.query;
- tmp->lock();
- pthread_mutex_lock(&tmp->mutex);
- if ((error=pthread_create(&tmp->thd.real_id,&connection_attrib,
- handle_delayed_insert,(void*) tmp)))
+ di->table_list= *table_list; // Needed to open table
+ /* Replace volatile strings with local copies */
+ di->table_list.alias= di->table_list.table_name= di->thd.query;
+ di->table_list.db= di->thd.db;
+ di->lock();
+ pthread_mutex_lock(&di->mutex);
+ if ((error= pthread_create(&di->thd.real_id, &connection_attrib,
+ handle_delayed_insert, (void*) di)))
{
DBUG_PRINT("error",
("Can't create thread to handle delayed insert (error %d)",
error));
- pthread_mutex_unlock(&tmp->mutex);
- tmp->unlock();
- delete tmp;
+ pthread_mutex_unlock(&di->mutex);
+ di->unlock();
+ delete di;
my_error(ER_CANT_CREATE_THREAD, MYF(0), error);
- goto err1;
+ thd->fatal_error();
+ goto end_create;
}
/* Wait until table is open */
thd_proc_info(thd, "waiting for handler open");
- while (!tmp->thd.killed && !tmp->table && !thd->killed)
+ while (!di->thd.killed && !di->table && !thd->killed)
{
- pthread_cond_wait(&tmp->cond_client,&tmp->mutex);
+ pthread_cond_wait(&di->cond_client, &di->mutex);
}
- pthread_mutex_unlock(&tmp->mutex);
+ pthread_mutex_unlock(&di->mutex);
thd_proc_info(thd, "got old table");
- if (tmp->thd.killed)
+ if (di->thd.killed)
{
- if (tmp->thd.is_fatal_error)
- {
- /* Copy error message and abort */
- thd->fatal_error();
- strmov(thd->net.last_error,tmp->thd.net.last_error);
- thd->net.last_errno=tmp->thd.net.last_errno;
+ if (di->thd.net.report_error)
+ {
+ /*
+ Copy the error message. Note that we don't treat fatal
+ errors in the delayed thread as fatal errors in the
+ main thread. Use of my_message will enable stored
+ procedures continue handlers.
+ */
+ my_message(di->thd.net.last_errno, di->thd.net.last_error,
+ MYF(0));
}
- tmp->unlock();
- goto err;
+ di->unlock();
+ goto end_create;
}
if (thd->killed)
{
- tmp->unlock();
- goto err;
+ di->unlock();
+ goto end_create;
}
+ pthread_mutex_lock(&LOCK_delayed_insert);
+ delayed_threads.append(di);
+ pthread_mutex_unlock(&LOCK_delayed_insert);
}
pthread_mutex_unlock(&LOCK_delayed_create);
}
- pthread_mutex_lock(&tmp->mutex);
- table= tmp->get_local_table(thd);
- pthread_mutex_unlock(&tmp->mutex);
- if (table)
- thd->di=tmp;
- else if (tmp->thd.is_fatal_error)
- thd->fatal_error();
+ pthread_mutex_lock(&di->mutex);
+ table_list->table= di->get_local_table(thd);
+ pthread_mutex_unlock(&di->mutex);
+ if (table_list->table)
+ {
+ DBUG_ASSERT(thd->net.report_error == 0);
+ thd->di= di;
+ }
/* Unlock the delayed insert object after its last access. */
- tmp->unlock();
- DBUG_RETURN((table_list->table=table));
+ di->unlock();
+ DBUG_RETURN((table_list->table == NULL));
- err1:
- thd->fatal_error();
- err:
+end_create:
pthread_mutex_unlock(&LOCK_delayed_create);
- DBUG_RETURN(0); // Continue with normal insert
+ DBUG_RETURN(thd->net.report_error);
}
-/*
- As we can't let many threads modify the same TABLE structure, we create
- an own structure for each tread. This includes a row buffer to save the
- column values and new fields that points to the new row buffer.
- The memory is allocated in the client thread and is freed automaticly.
+/**
+ As we can't let many client threads modify the same TABLE
+ structure of the dedicated delayed insert thread, we create an
+ own structure for each client thread. This includes a row
+ buffer to save the column values and new fields that point to
+ the new row buffer. The memory is allocated in the client
+ thread and is freed automatically.
+
+ @pre This function is called from the client thread. Delayed
+ insert thread mutex must be acquired before invoking this
+ function.
+
+ @return Not-NULL table object on success. NULL in case of an error,
+ which is set in client_thd.
*/
-TABLE *delayed_insert::get_local_table(THD* client_thd)
+TABLE *Delayed_insert::get_local_table(THD* client_thd)
{
my_ptrdiff_t adjust_ptrs;
Field **field,**org_field, *found_next_number_field;
TABLE *copy;
- TABLE_SHARE *share= table->s;
- byte *bitmap;
- DBUG_ENTER("delayed_insert::get_local_table");
+ TABLE_SHARE *share;
+ uchar *bitmap;
+ DBUG_ENTER("Delayed_insert::get_local_table");
/* First request insert thread to get a lock */
status=1;
@@ -1758,11 +1994,11 @@ TABLE *delayed_insert::get_local_table(THD* client_thd)
goto error;
if (dead)
{
- strmov(client_thd->net.last_error,thd.net.last_error);
- client_thd->net.last_errno=thd.net.last_errno;
+ my_message(thd.net.last_errno, thd.net.last_error, MYF(0));
goto error;
}
}
+ share= table->s;
/*
Allocate memory for the TABLE object, the field pointers array, and
@@ -1784,7 +2020,7 @@ TABLE *delayed_insert::get_local_table(THD* client_thd)
/* We don't need to change the file handler here */
/* Assign the pointers for the field pointers array and the record. */
field= copy->field= (Field**) (copy + 1);
- bitmap= (byte*) (field + share->fields + 1);
+ bitmap= (uchar*) (field + share->fields + 1);
copy->record[0]= (bitmap + share->column_bitmap_size * 2);
memcpy((char*) copy->record[0], (char*) table->record[0], share->reclength);
/*
@@ -1799,7 +2035,7 @@ TABLE *delayed_insert::get_local_table(THD* client_thd)
for (org_field= table->field; *org_field; org_field++, field++)
{
if (!(*field= (*org_field)->new_field(client_thd->mem_root, copy, 1)))
- DBUG_RETURN(0);
+ goto error;
(*field)->orig_table= copy; // Remove connection
(*field)->move_field_offset(adjust_ptrs); // Point at copy->record[0]
if (*org_field == found_next_number_field)
@@ -1845,15 +2081,16 @@ TABLE *delayed_insert::get_local_table(THD* client_thd)
/* Put a question in queue */
-static int
-write_delayed(THD *thd,TABLE *table, enum_duplicates duplic,
- LEX_STRING query, bool ignore, bool log_on)
+static
+int write_delayed(THD *thd, TABLE *table, enum_duplicates duplic,
+ LEX_STRING query, bool ignore, bool log_on)
{
delayed_row *row= 0;
- delayed_insert *di=thd->di;
+ Delayed_insert *di=thd->di;
const Discrete_interval *forced_auto_inc;
DBUG_ENTER("write_delayed");
- DBUG_PRINT("enter", ("query = '%s' length %u", query.str, query.length));
+ DBUG_PRINT("enter", ("query = '%s' length %lu", query.str,
+ (ulong) query.length));
thd_proc_info(thd, "waiting for handler insert");
pthread_mutex_lock(&di->mutex);
@@ -1929,11 +2166,15 @@ write_delayed(THD *thd,TABLE *table, enum_duplicates duplic,
DBUG_RETURN(1);
}
+/**
+ Signal the delayed insert thread that this user connection
+ is finished using it for this statement.
+*/
static void end_delayed_insert(THD *thd)
{
DBUG_ENTER("end_delayed_insert");
- delayed_insert *di=thd->di;
+ Delayed_insert *di=thd->di;
pthread_mutex_lock(&di->mutex);
DBUG_PRINT("info",("tables in use: %d",di->tables_in_use));
if (!--di->tables_in_use || di->thd.killed)
@@ -1952,27 +2193,27 @@ void kill_delayed_threads(void)
{
VOID(pthread_mutex_lock(&LOCK_delayed_insert)); // For unlink from list
- I_List_iterator<delayed_insert> it(delayed_threads);
- delayed_insert *tmp;
- while ((tmp=it++))
+ I_List_iterator<Delayed_insert> it(delayed_threads);
+ Delayed_insert *di;
+ while ((di= it++))
{
- tmp->thd.killed= THD::KILL_CONNECTION;
- if (tmp->thd.mysys_var)
+ di->thd.killed= THD::KILL_CONNECTION;
+ if (di->thd.mysys_var)
{
- pthread_mutex_lock(&tmp->thd.mysys_var->mutex);
- if (tmp->thd.mysys_var->current_cond)
+ pthread_mutex_lock(&di->thd.mysys_var->mutex);
+ if (di->thd.mysys_var->current_cond)
{
/*
We need the following test because the main mutex may be locked
in handle_delayed_insert()
*/
- if (&tmp->mutex != tmp->thd.mysys_var->current_mutex)
- pthread_mutex_lock(tmp->thd.mysys_var->current_mutex);
- pthread_cond_broadcast(tmp->thd.mysys_var->current_cond);
- if (&tmp->mutex != tmp->thd.mysys_var->current_mutex)
- pthread_mutex_unlock(tmp->thd.mysys_var->current_mutex);
+ if (&di->mutex != di->thd.mysys_var->current_mutex)
+ pthread_mutex_lock(di->thd.mysys_var->current_mutex);
+ pthread_cond_broadcast(di->thd.mysys_var->current_cond);
+ if (&di->mutex != di->thd.mysys_var->current_mutex)
+ pthread_mutex_unlock(di->thd.mysys_var->current_mutex);
}
- pthread_mutex_unlock(&tmp->thd.mysys_var->mutex);
+ pthread_mutex_unlock(&di->thd.mysys_var->mutex);
}
}
VOID(pthread_mutex_unlock(&LOCK_delayed_insert)); // For unlink from list
@@ -1985,14 +2226,14 @@ void kill_delayed_threads(void)
pthread_handler_t handle_delayed_insert(void *arg)
{
- delayed_insert *di=(delayed_insert*) arg;
+ Delayed_insert *di=(Delayed_insert*) arg;
THD *thd= &di->thd;
pthread_detach_this_thread();
/* Add thread to THD list so that's it's visible in 'show processlist' */
pthread_mutex_lock(&LOCK_thread_count);
thd->thread_id= thd->variables.pseudo_thread_id= thread_id++;
- thd->end_time();
+ thd->set_current_time();
threads.append(thd);
thd->killed=abort_loop ? THD::KILL_CONNECTION : THD::NOT_KILLED;
pthread_mutex_unlock(&LOCK_thread_count);
@@ -2024,7 +2265,7 @@ pthread_handler_t handle_delayed_insert(void *arg)
}
/* open table */
- if (!(di->table=open_ltable(thd,&di->table_list,TL_WRITE_DELAYED)))
+ if (!(di->table=open_ltable(thd, &di->table_list, TL_WRITE_DELAYED, 0)))
{
thd->fatal_error(); // Abort waiting inserts
goto err;
@@ -2035,13 +2276,17 @@ pthread_handler_t handle_delayed_insert(void *arg)
my_error(ER_ILLEGAL_HA, MYF(0), di->table_list.table_name);
goto err;
}
+ if (di->table->triggers)
+ {
+ /*
+ Table has triggers. This is not an error, but we do
+ not support triggers with delayed insert. Terminate the delayed
+ thread without an error and thus request lock upgrade.
+ */
+ goto err;
+ }
di->table->copy_blobs=1;
- /* One can now use this */
- pthread_mutex_lock(&LOCK_delayed_insert);
- delayed_threads.append(di);
- pthread_mutex_unlock(&LOCK_delayed_insert);
-
/* Tell client that the thread is initialized */
pthread_cond_signal(&di->cond_client);
@@ -2227,7 +2472,7 @@ static void free_delayed_insert_blobs(register TABLE *table)
{
if ((*ptr)->flags & BLOB_FLAG)
{
- char *str;
+ uchar *str;
((Field_blob *) (*ptr))->get_ptr(&str);
my_free(str,MYF(MY_ALLOW_ZERO_PTR));
((Field_blob *) (*ptr))->reset();
@@ -2236,7 +2481,7 @@ static void free_delayed_insert_blobs(register TABLE *table)
}
-bool delayed_insert::handle_inserts(void)
+bool Delayed_insert::handle_inserts(void)
{
int error;
ulong max_rows;
@@ -2261,7 +2506,7 @@ bool delayed_insert::handle_inserts(void)
thd_proc_info(&thd, "insert");
max_rows= delayed_insert_limit;
- if (thd.killed || table->s->version != refresh_version)
+ if (thd.killed || table->needs_reopen_or_name_lock())
{
thd.killed= THD::KILL_CONNECTION;
max_rows= ULONG_MAX; // Do as much as possible
@@ -2289,8 +2534,9 @@ bool delayed_insert::handle_inserts(void)
use values from the previous interval (of the previous rows).
*/
bool log_query= (row->log_query && row->query.str != NULL);
- DBUG_PRINT("delayed", ("query: '%s' length: %u", row->query.str ?
- row->query.str : "[NULL]", row->query.length));
+ DBUG_PRINT("delayed", ("query: '%s' length: %lu", row->query.str ?
+ row->query.str : "[NULL]",
+ (ulong) row->query.length));
if (log_query)
{
/*
@@ -2336,6 +2582,8 @@ bool delayed_insert::handle_inserts(void)
table->file->extra(HA_EXTRA_WRITE_CAN_REPLACE);
using_opt_replace= 1;
}
+ if (info.handle_duplicates == DUP_UPDATE)
+ table->file->extra(HA_EXTRA_INSERT_WITH_UPDATE);
thd.clear_error(); // reset error for binlog
if (write_record(&thd, table, &info))
{
@@ -2372,7 +2620,7 @@ bool delayed_insert::handle_inserts(void)
if (table->s->blob_fields)
free_delayed_insert_blobs(table);
- thread_safe_sub(delayed_rows_in_use,1,&LOCK_delayed_status);
+ thread_safe_decrement(delayed_rows_in_use,&LOCK_delayed_status);
thread_safe_increment(delayed_insert_writes,&LOCK_delayed_status);
pthread_mutex_lock(&mutex);
@@ -2622,7 +2870,7 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
while ((item= li++))
{
item->transform(&Item::update_value_transformer,
- (byte*)lex->current_select);
+ (uchar*)lex->current_select);
}
}
@@ -2680,7 +2928,8 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
if (info.handle_duplicates == DUP_REPLACE &&
(!table->triggers || !table->triggers->has_delete_triggers()))
table->file->extra(HA_EXTRA_WRITE_CAN_REPLACE);
- thd->no_trans_update.stmt= FALSE;
+ if (info.handle_duplicates == DUP_UPDATE)
+ table->file->extra(HA_EXTRA_INSERT_WITH_UPDATE);
thd->abort_on_warning= (!info.ignore &&
(thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES |
@@ -2818,57 +3067,8 @@ void select_insert::send_error(uint errcode,const char *err)
{
DBUG_ENTER("select_insert::send_error");
- /* Avoid an extra 'unknown error' message if we already reported an error */
- if (errcode != ER_UNKNOWN_ERROR && !thd->net.report_error)
- my_message(errcode, err, MYF(0));
-
- /*
- If the creation of the table failed (due to a syntax error, for
- example), no table will have been opened and therefore 'table'
- will be NULL. In that case, we still need to execute the rollback
- and the end of the function.
- */
- if (table)
- {
- /*
- If we are not in prelocked mode, we end the bulk insert started
- before.
- */
- if (!thd->prelocked_mode)
- table->file->ha_end_bulk_insert();
-
- /*
- If at least one row has been inserted/modified and will stay in
- the table (the table doesn't have transactions) we must write to
- the binlog (and the error code will make the slave stop).
-
- For many errors (example: we got a duplicate key error while
- inserting into a MyISAM table), no row will be added to the table,
- so passing the error to the slave will not help since there will
- be an error code mismatch (the inserts will succeed on the slave
- with no error).
+ my_message(errcode, err, MYF(0));
- If table creation failed, the number of rows modified will also be
- zero, so no check for that is made.
- */
- if (info.copied || info.deleted || info.updated)
- {
- DBUG_ASSERT(table != NULL);
- if (!table->file->has_transactions())
- {
- if (mysql_bin_log.is_open())
- thd->binlog_query(THD::ROW_QUERY_TYPE, thd->query, thd->query_length,
- table->file->has_transactions(), FALSE);
- if (!thd->current_stmt_binlog_row_based && !table->s->tmp_table &&
- !can_rollback_data())
- thd->no_trans_update.all= TRUE;
- query_cache_invalidate3(thd, table, 1);
- }
- }
- table->file->ha_release_auto_increment();
- }
-
- ha_rollback_stmt(thd);
DBUG_VOID_RETURN;
}
@@ -2878,6 +3078,7 @@ bool select_insert::send_eof()
int error;
bool const trans_table= table->file->has_transactions();
ulonglong id;
+ bool changed;
DBUG_ENTER("select_insert::send_eof");
DBUG_PRINT("enter", ("trans_table=%d, table_type='%s'",
trans_table, table->file->table_type()));
@@ -2886,24 +3087,18 @@ bool select_insert::send_eof()
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE);
- if (info.copied || info.deleted || info.updated)
+ if (changed= (info.copied || info.deleted || info.updated))
{
/*
We must invalidate the table in the query cache before binlog writing
and ha_autocommit_or_rollback.
*/
query_cache_invalidate3(thd, table, 1);
- /*
- Mark that we have done permanent changes if all of the below is true
- - Table doesn't support transactions
- - It's a normal (not temporary) table. (Changes to temporary tables
- are not logged in RBR)
- - We are using statement based replication
- */
- if (!trans_table &&
- (!table->s->tmp_table || !thd->current_stmt_binlog_row_based))
- thd->no_trans_update.all= TRUE;
- }
+ if (thd->transaction.stmt.modified_non_trans_table)
+ thd->transaction.all.modified_non_trans_table= TRUE;
+ }
+ DBUG_ASSERT(trans_table || !changed ||
+ thd->transaction.stmt.modified_non_trans_table);
/*
Write to binlog before commiting transaction. No statement will
@@ -2945,7 +3140,9 @@ bool select_insert::send_eof()
else
sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records,
(ulong) (info.deleted+info.updated), (ulong) thd->cuted_fields);
- thd->row_count_func= info.copied+info.deleted+info.updated;
+ thd->row_count_func= info.copied + info.deleted +
+ ((thd->client_capabilities & CLIENT_FOUND_ROWS) ?
+ info.touched : info.updated);
id= (thd->first_successful_insert_id_in_cur_stmt > 0) ?
thd->first_successful_insert_id_in_cur_stmt :
@@ -2956,14 +3153,67 @@ bool select_insert::send_eof()
DBUG_RETURN(0);
}
+void select_insert::abort() {
+
+ DBUG_ENTER("select_insert::abort");
+ /*
+ If the creation of the table failed (due to a syntax error, for
+ example), no table will have been opened and therefore 'table'
+ will be NULL. In that case, we still need to execute the rollback
+ and the end of the function.
+ */
+ if (table)
+ {
+ /*
+ If we are not in prelocked mode, we end the bulk insert started
+ before.
+ */
+ if (!thd->prelocked_mode)
+ table->file->ha_end_bulk_insert();
+
+ /*
+ If at least one row has been inserted/modified and will stay in
+ the table (the table doesn't have transactions) we must write to
+ the binlog (and the error code will make the slave stop).
+
+ For many errors (example: we got a duplicate key error while
+ inserting into a MyISAM table), no row will be added to the table,
+ so passing the error to the slave will not help since there will
+ be an error code mismatch (the inserts will succeed on the slave
+ with no error).
+
+ If table creation failed, the number of rows modified will also be
+ zero, so no check for that is made.
+ */
+ if (info.copied || info.deleted || info.updated)
+ {
+ DBUG_ASSERT(table != NULL);
+ if (!table->file->has_transactions())
+ {
+ if (mysql_bin_log.is_open())
+ thd->binlog_query(THD::ROW_QUERY_TYPE, thd->query, thd->query_length,
+ table->file->has_transactions(), FALSE);
+ if (!thd->current_stmt_binlog_row_based && !table->s->tmp_table &&
+ !can_rollback_data())
+ thd->transaction.all.modified_non_trans_table= TRUE;
+ query_cache_invalidate3(thd, table, 1);
+ }
+ }
+ table->file->ha_release_auto_increment();
+ }
+
+ ha_rollback_stmt(thd);
+ DBUG_VOID_RETURN;
+}
+
/***************************************************************************
CREATE TABLE (SELECT) ...
***************************************************************************/
/*
- Create table from lists of fields and items (or open existing table
- with same name).
+ Create table from lists of fields and items (or just return TABLE
+ object for pre-opened existing table).
SYNOPSIS
create_table_from_items()
@@ -2972,25 +3222,31 @@ bool select_insert::send_eof()
temporary table flag)
create_table in Pointer to TABLE_LIST object providing database
and name for table to be created or to be open
- extra_fields in/out Initial list of fields for table to be created
- keys in List of keys for table to be created
+ alter_info in/out Initial list of columns and indexes for the table
+ to be created
items in List of items which should be used to produce rest
of fields for the table (corresponding fields will
- be added to the end of 'extra_fields' list)
+ be added to the end of alter_info->create_list)
lock out Pointer to the MYSQL_LOCK object for table created
- (open) will be returned in this parameter. Since
- this table is not included in THD::lock caller is
- responsible for explicitly unlocking this table.
+ (or open temporary table) will be returned in this
+ parameter. Since this table is not included in
+ THD::lock caller is responsible for explicitly
+ unlocking this table.
hooks
NOTES
- If 'create_info->options' bitmask has HA_LEX_CREATE_IF_NOT_EXISTS
- flag and table with name provided already exists then this function will
- simply open existing table.
- Also note that create, open and lock sequence in this function is not
- atomic and thus contains gap for deadlock and can cause other troubles.
- Since this function contains some logic specific to CREATE TABLE ... SELECT
- it should be changed before it can be used in other contexts.
+ This function behaves differently for base and temporary tables:
+ - For base table we assume that either table exists and was pre-opened
+ and locked at open_and_lock_tables() stage (and in this case we just
+ emit error or warning and return pre-opened TABLE object) or special
+ placeholder was put in table cache that guarantees that this table
+ won't be created or opened until the placeholder will be removed
+ (so there is an exclusive lock on this table).
+ - We don't pre-open existing temporary table, instead we either open
+ or create and then open table in this function.
+
+ Since this function contains some logic specific to CREATE TABLE ...
+ SELECT it should be changed before it can be used in other contexts.
RETURN VALUES
non-zero Pointer to TABLE object for table created or opened
@@ -2999,13 +3255,12 @@ bool select_insert::send_eof()
static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
TABLE_LIST *create_table,
- List<create_field> *extra_fields,
- List<Key> *keys,
+ Alter_info *alter_info,
List<Item> *items,
MYSQL_LOCK **lock,
TABLEOP_HOOKS *hooks)
{
- TABLE tmp_table; // Used during 'create_field()'
+ TABLE tmp_table; // Used during 'Create_field()'
TABLE_SHARE share;
TABLE *table= 0;
uint select_field_count= items->elements;
@@ -3016,6 +3271,25 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
bool not_used;
DBUG_ENTER("create_table_from_items");
+ DBUG_EXECUTE_IF("sleep_create_select_before_check_if_exists", my_sleep(6000000););
+
+ if (!(create_info->options & HA_LEX_CREATE_TMP_TABLE) &&
+ create_table->table->db_stat)
+ {
+ /* Table already exists and was open at open_and_lock_tables() stage. */
+ if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS)
+ {
+ create_info->table_existed= 1; // Mark that table existed
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
+ ER_TABLE_EXISTS_ERROR, ER(ER_TABLE_EXISTS_ERROR),
+ create_table->table_name);
+ DBUG_RETURN(create_table->table);
+ }
+
+ my_error(ER_TABLE_EXISTS_ERROR, MYF(0), create_table->table_name);
+ DBUG_RETURN(0);
+ }
+
tmp_table.alias= 0;
tmp_table.timestamp_field= 0;
tmp_table.s= &share;
@@ -3030,7 +3304,7 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
while ((item=it++))
{
- create_field *cr_field;
+ Create_field *cr_field;
Field *field, *def_field;
if (item->type() == Item::FUNC_ITEM)
field= item->tmp_table_field(&tmp_table);
@@ -3039,16 +3313,23 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
(Item ***) 0, &tmp_field, &def_field, 0, 0, 0, 0,
0);
if (!field ||
- !(cr_field=new create_field(field,(item->type() == Item::FIELD_ITEM ?
+ !(cr_field=new Create_field(field,(item->type() == Item::FIELD_ITEM ?
((Item_field *)item)->field :
(Field*) 0))))
DBUG_RETURN(0);
if (item->maybe_null)
cr_field->flags &= ~NOT_NULL_FLAG;
- extra_fields->push_back(cr_field);
+ alter_info->create_list.push_back(cr_field);
}
+
+ DBUG_EXECUTE_IF("sleep_create_select_before_create", my_sleep(6000000););
+
/*
- create and lock table
+ Create and lock table.
+
+ Note that we either creating (or opening existing) temporary table or
+ creating base table on which name we have exclusive lock. So code below
+ should not cause deadlocks or races.
We don't log the statement, it will be logged later.
@@ -3058,63 +3339,79 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
don't want to delete from it) 2) it would be written before the CREATE
TABLE, which is a wrong order. So we keep binary logging disabled when we
open_table().
- NOTE: By locking table which we just have created (or for which we just
- have have found that it already exists) separately from other tables used
- by the statement we create potential window for deadlock.
- TODO: create and open should be done atomic !
*/
{
tmp_disable_binlog(thd);
- if (!mysql_create_table(thd, create_table->db, create_table->table_name,
- create_info, *extra_fields, *keys, 0,
- select_field_count, 0))
+ if (!mysql_create_table_no_lock(thd, create_table->db,
+ create_table->table_name,
+ create_info, alter_info, 0,
+ select_field_count))
{
- /*
- If we are here in prelocked mode we either create temporary table
- or prelocked mode is caused by the SELECT part of this statement.
- */
- DBUG_ASSERT(!thd->prelocked_mode ||
- create_info->options & HA_LEX_CREATE_TMP_TABLE ||
- thd->lex->requires_prelocking());
+ if (create_info->table_existed &&
+ !(create_info->options & HA_LEX_CREATE_TMP_TABLE))
+ {
+ /*
+ This means that someone created table underneath server
+ or it was created via different mysqld front-end to the
+ cluster. We don't have much options but throw an error.
+ */
+ my_error(ER_TABLE_EXISTS_ERROR, MYF(0), create_table->table_name);
+ DBUG_RETURN(0);
+ }
- /*
- NOTE: We don't want to ignore set of locked tables here if we are
- under explicit LOCK TABLES since it will open gap for deadlock
- too wide (and also is not backward compatible).
- */
+ DBUG_EXECUTE_IF("sleep_create_select_before_open", my_sleep(6000000););
- if (! (table= open_table(thd, create_table, thd->mem_root, (bool*) 0,
- (MYSQL_LOCK_IGNORE_FLUSH |
- ((thd->prelocked_mode == PRELOCKED) ?
- MYSQL_OPEN_IGNORE_LOCKED_TABLES:0)))))
- quick_rm_table(create_info->db_type, create_table->db,
- table_case_name(create_info, create_table->table_name),
- 0);
+ if (!(create_info->options & HA_LEX_CREATE_TMP_TABLE))
+ {
+ VOID(pthread_mutex_lock(&LOCK_open));
+ if (reopen_name_locked_table(thd, create_table, FALSE))
+ {
+ quick_rm_table(create_info->db_type, create_table->db,
+ table_case_name(create_info, create_table->table_name),
+ 0);
+ }
+ else
+ table= create_table->table;
+ VOID(pthread_mutex_unlock(&LOCK_open));
+ }
+ else
+ {
+ if (!(table= open_table(thd, create_table, thd->mem_root, (bool*) 0,
+ MYSQL_OPEN_TEMPORARY_ONLY)) &&
+ !create_info->table_existed)
+ {
+ /*
+ This shouldn't happen as creation of temporary table should make
+ it preparable for open. But let us do close_temporary_table() here
+ just in case.
+ */
+ close_temporary_table(thd, create_table);
+ }
+ }
}
reenable_binlog(thd);
if (!table) // open failed
DBUG_RETURN(0);
}
- /*
- FIXME: What happens if trigger manages to be created while we are
- obtaining this lock ? May be it is sensible just to disable
- trigger execution in this case ? Or will MYSQL_LOCK_IGNORE_FLUSH
- save us from that ?
- */
+ DBUG_EXECUTE_IF("sleep_create_select_before_lock", my_sleep(6000000););
+
table->reginfo.lock_type=TL_WRITE;
hooks->prelock(&table, 1); // Call prelock hooks
if (! ((*lock)= mysql_lock_tables(thd, &table, 1,
- MYSQL_LOCK_IGNORE_FLUSH, &not_used)))
+ MYSQL_LOCK_IGNORE_FLUSH, &not_used)) ||
+ hooks->postlock(&table, 1))
{
- VOID(pthread_mutex_lock(&LOCK_open));
- hash_delete(&open_cache,(byte*) table);
- VOID(pthread_mutex_unlock(&LOCK_open));
- quick_rm_table(create_info->db_type, create_table->db,
- table_case_name(create_info, create_table->table_name), 0);
+ if (*lock)
+ {
+ mysql_unlock_tables(thd, *lock);
+ *lock= 0;
+ }
+
+ if (!create_info->table_existed)
+ drop_open_table(thd, table, create_table->db, create_table->table_name);
DBUG_RETURN(0);
}
- table->file->extra(HA_EXTRA_WRITE_CACHE);
DBUG_RETURN(table);
}
@@ -3145,24 +3442,35 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
*/
class MY_HOOKS : public TABLEOP_HOOKS {
public:
- MY_HOOKS(select_create *x) : ptr(x) { }
+ MY_HOOKS(select_create *x, TABLE_LIST *create_table,
+ TABLE_LIST *select_tables)
+ : ptr(x), all_tables(*create_table)
+ {
+ all_tables.next_global= select_tables;
+ }
private:
- virtual void do_prelock(TABLE **tables, uint count)
+ virtual int do_postlock(TABLE **tables, uint count)
{
+ THD *thd= const_cast<THD*>(ptr->get_thd());
+ if (int error= decide_logging_format(thd, &all_tables))
+ return error;
+
TABLE const *const table = *tables;
- if (ptr->get_thd()->current_stmt_binlog_row_based &&
+ if (thd->current_stmt_binlog_row_based &&
!table->s->tmp_table &&
!ptr->get_create_info()->table_existed)
{
ptr->binlog_show_create_table(tables, count);
}
+ return 0;
}
select_create *ptr;
+ TABLE_LIST all_tables;
};
- MY_HOOKS hooks(this);
+ MY_HOOKS hooks(this, create_table, select_tables);
hook_ptr= &hooks;
unit= u;
@@ -3179,7 +3487,7 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
}
if (!(table= create_table_from_items(thd, create_info, create_table,
- extra_fields, keys, &values,
+ alter_info, &values,
&thd->extra_lock, hook_ptr)))
DBUG_RETURN(-1); // abort() deletes table
@@ -3207,9 +3515,10 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
if (info.handle_duplicates == DUP_REPLACE &&
(!table->triggers || !table->triggers->has_delete_triggers()))
table->file->extra(HA_EXTRA_WRITE_CAN_REPLACE);
+ if (info.handle_duplicates == DUP_UPDATE)
+ table->file->extra(HA_EXTRA_INSERT_WITH_UPDATE);
if (!thd->prelocked_mode)
table->file->ha_start_bulk_insert((ha_rows) 0);
- thd->no_trans_update.stmt= FALSE;
thd->abort_on_warning= (!info.ignore &&
(thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES |
@@ -3217,6 +3526,7 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
if (check_that_all_fields_are_given_values(thd, table, table_list))
DBUG_RETURN(1);
table->mark_columns_needed_for_insert();
+ table->file->extra(HA_EXTRA_WRITE_CACHE);
DBUG_RETURN(0);
}
@@ -3246,13 +3556,13 @@ select_create::binlog_show_create_table(TABLE **tables, uint count)
char buf[2048];
String query(buf, sizeof(buf), system_charset_info);
int result;
- TABLE_LIST table_list;
+ TABLE_LIST tmp_table_list;
- memset(&table_list, 0, sizeof(table_list));
- table_list.table = *tables;
+ memset(&tmp_table_list, 0, sizeof(tmp_table_list));
+ tmp_table_list.table = *tables;
query.length(0); // Have to zero it since constructor doesn't
- result= store_create_info(thd, &table_list, &query, create_info);
+ result= store_create_info(thd, &tmp_table_list, &query, create_info);
DBUG_ASSERT(result == 0); /* store_create_info() always return 0 */
thd->binlog_query(THD::STMT_QUERY_TYPE,
@@ -3319,24 +3629,27 @@ bool select_create::send_eof()
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE);
- VOID(pthread_mutex_lock(&LOCK_open));
- mysql_unlock_tables(thd, thd->extra_lock);
- if (!table->s->tmp_table)
+ if (thd->extra_lock)
{
- if (close_thread_table(thd, &table))
- broadcast_refresh();
+ mysql_unlock_tables(thd, thd->extra_lock);
+ thd->extra_lock=0;
}
- thd->extra_lock=0;
- table=0;
- VOID(pthread_mutex_unlock(&LOCK_open));
}
return tmp;
}
+
void select_create::abort()
{
DBUG_ENTER("select_create::abort");
- VOID(pthread_mutex_lock(&LOCK_open));
+
+ /*
+ Disable binlog, because we "roll back" partial inserts in ::abort
+ by removing the table, even for non-transactional tables.
+ */
+ tmp_disable_binlog(thd);
+ select_insert::abort();
+ reenable_binlog(thd);
/*
We roll back the statement, including truncating the transaction
@@ -3364,24 +3677,10 @@ void select_create::abort()
{
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE);
- handlerton *table_type=table->s->db_type;
- if (!table->s->tmp_table)
- {
- ulong version= table->s->version;
- table->s->version= 0;
- hash_delete(&open_cache,(byte*) table);
- if (!create_info->table_existed)
- quick_rm_table(table_type, create_table->db,
- create_table->table_name, 0);
- /* Tell threads waiting for refresh that something has happened */
- if (version != refresh_version)
- broadcast_refresh();
- }
- else if (!create_info->table_existed)
- close_temporary_table(thd, table, 1, 1);
+ if (!create_info->table_existed)
+ drop_open_table(thd, table, create_table->db, create_table->table_name);
table=0; // Safety
}
- VOID(pthread_mutex_unlock(&LOCK_open));
DBUG_VOID_RETURN;
}
@@ -3393,8 +3692,8 @@ void select_create::abort()
#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
template class List_iterator_fast<List_item>;
#ifndef EMBEDDED_LIBRARY
-template class I_List<delayed_insert>;
-template class I_List_iterator<delayed_insert>;
+template class I_List<Delayed_insert>;
+template class I_List_iterator<Delayed_insert>;
template class I_List<delayed_row>;
#endif /* EMBEDDED_LIBRARY */
#endif /* HAVE_EXPLICIT_TEMPLATE_INSTANTIATION */
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index b2057dce0e0..808d0744475 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -31,16 +31,6 @@
sys_var *trg_new_row_fake_var= (sys_var*) 0x01;
-/* Macros to look like lex */
-
-#define yyGet() ((uchar) *(lex->ptr++))
-#define yyGetLast() ((uchar) lex->ptr[-1])
-#define yyPeek() ((uchar) lex->ptr[0])
-#define yyPeek2() ((uchar) lex->ptr[1])
-#define yyUnget() lex->ptr--
-#define yySkip() lex->ptr++
-#define yyLength() ((uint) (lex->ptr - lex->tok_start)-1)
-
/* Longest standard keyword name */
#define TOCK_NAME_LENGTH 24
@@ -120,6 +110,167 @@ st_parsing_options::reset()
allows_derived= TRUE;
}
+Lex_input_stream::Lex_input_stream(THD *thd,
+ const char* buffer,
+ unsigned int length)
+: m_thd(thd),
+ yylineno(1),
+ yytoklen(0),
+ yylval(NULL),
+ m_ptr(buffer),
+ m_tok_start(NULL),
+ m_tok_end(NULL),
+ m_end_of_query(buffer + length),
+ m_tok_start_prev(NULL),
+ m_buf(buffer),
+ m_buf_length(length),
+ m_echo(TRUE),
+ m_cpp_tok_start(NULL),
+ m_cpp_tok_start_prev(NULL),
+ m_cpp_tok_end(NULL),
+ m_body_utf8(NULL),
+ m_cpp_utf8_processed_ptr(NULL),
+ next_state(MY_LEX_START),
+ found_semicolon(NULL),
+ ignore_space(test(thd->variables.sql_mode & MODE_IGNORE_SPACE)),
+ stmt_prepare_mode(FALSE),
+ in_comment(NO_COMMENT),
+ m_underscore_cs(NULL)
+{
+ m_cpp_buf= (char*) thd->alloc(length + 1);
+ m_cpp_ptr= m_cpp_buf;
+}
+
+Lex_input_stream::~Lex_input_stream()
+{}
+
+/**
+ The operation is called from the parser in order to
+ 1) designate the intention to have utf8 body;
+ 1) Indicate to the lexer that we will need a utf8 representation of this
+ statement;
+ 2) Determine the beginning of the body.
+
+ @param thd Thread context.
+ @param begin_ptr Pointer to the start of the body in the pre-processed
+ buffer.
+*/
+
+void Lex_input_stream::body_utf8_start(THD *thd, const char *begin_ptr)
+{
+ DBUG_ASSERT(begin_ptr);
+ DBUG_ASSERT(m_cpp_buf <= begin_ptr && begin_ptr <= m_cpp_buf + m_buf_length);
+
+ uint body_utf8_length=
+ (m_buf_length / thd->variables.character_set_client->mbminlen) *
+ my_charset_utf8_bin.mbmaxlen;
+
+ m_body_utf8= (char *) thd->alloc(body_utf8_length + 1);
+ m_body_utf8_ptr= m_body_utf8;
+ *m_body_utf8_ptr= 0;
+
+ m_cpp_utf8_processed_ptr= begin_ptr;
+}
+
+/**
+ @brief The operation appends unprocessed part of pre-processed buffer till
+ the given pointer (ptr) and sets m_cpp_utf8_processed_ptr to end_ptr.
+
+ The idea is that some tokens in the pre-processed buffer (like character
+ set introducers) should be skipped.
+
+ Example:
+ CPP buffer: SELECT 'str1', _latin1 'str2';
+ m_cpp_utf8_processed_ptr -- points at the "SELECT ...";
+ In order to skip "_latin1", the following call should be made:
+ body_utf8_append(<pointer to "_latin1 ...">, <pointer to " 'str2'...">)
+
+ @param ptr Pointer in the pre-processed buffer, which specifies the
+ end of the chunk, which should be appended to the utf8
+ body.
+ @param end_ptr Pointer in the pre-processed buffer, to which
+ m_cpp_utf8_processed_ptr will be set in the end of the
+ operation.
+*/
+
+void Lex_input_stream::body_utf8_append(const char *ptr,
+ const char *end_ptr)
+{
+ DBUG_ASSERT(m_cpp_buf <= ptr && ptr <= m_cpp_buf + m_buf_length);
+ DBUG_ASSERT(m_cpp_buf <= end_ptr && end_ptr <= m_cpp_buf + m_buf_length);
+
+ if (!m_body_utf8)
+ return;
+
+ if (m_cpp_utf8_processed_ptr >= ptr)
+ return;
+
+ int bytes_to_copy= ptr - m_cpp_utf8_processed_ptr;
+
+ memcpy(m_body_utf8_ptr, m_cpp_utf8_processed_ptr, bytes_to_copy);
+ m_body_utf8_ptr += bytes_to_copy;
+ *m_body_utf8_ptr= 0;
+
+ m_cpp_utf8_processed_ptr= end_ptr;
+}
+
+/**
+ The operation appends unprocessed part of the pre-processed buffer till
+ the given pointer (ptr) and sets m_cpp_utf8_processed_ptr to ptr.
+
+ @param ptr Pointer in the pre-processed buffer, which specifies the end
+ of the chunk, which should be appended to the utf8 body.
+*/
+
+void Lex_input_stream::body_utf8_append(const char *ptr)
+{
+ body_utf8_append(ptr, ptr);
+}
+
+/**
+ The operation converts the specified text literal to the utf8 and appends
+ the result to the utf8-body.
+
+ @param thd Thread context.
+ @param txt Text literal.
+ @param txt_cs Character set of the text literal.
+ @param end_ptr Pointer in the pre-processed buffer, to which
+ m_cpp_utf8_processed_ptr will be set in the end of the
+ operation.
+*/
+
+void Lex_input_stream::body_utf8_append_literal(THD *thd,
+ const LEX_STRING *txt,
+ CHARSET_INFO *txt_cs,
+ const char *end_ptr)
+{
+ if (!m_cpp_utf8_processed_ptr)
+ return;
+
+ LEX_STRING utf_txt;
+
+ if (!my_charset_same(txt_cs, &my_charset_utf8_general_ci))
+ {
+ thd->convert_string(&utf_txt,
+ &my_charset_utf8_general_ci,
+ txt->str, txt->length,
+ txt_cs);
+ }
+ else
+ {
+ utf_txt.str= txt->str;
+ utf_txt.length= txt->length;
+ }
+
+ /* NOTE: utf_txt.length is in bytes, not in symbols. */
+
+ memcpy(m_body_utf8_ptr, utf_txt.str, utf_txt.length);
+ m_body_utf8_ptr += utf_txt.length;
+ *m_body_utf8_ptr= 0;
+
+ m_cpp_utf8_processed_ptr= end_ptr;
+}
+
/*
This is called before every query that is to be parsed.
@@ -127,14 +278,12 @@ st_parsing_options::reset()
(We already do too much here)
*/
-void lex_start(THD *thd, const char *buf, uint length)
+void lex_start(THD *thd)
{
LEX *lex= thd->lex;
DBUG_ENTER("lex_start");
lex->thd= lex->unit.thd= thd;
- lex->buf= lex->ptr= buf;
- lex->end_of_query= buf+length;
lex->context_stack.empty();
lex->unit.init_query();
@@ -164,27 +313,20 @@ void lex_start(THD *thd, const char *buf, uint length)
lex->describe= 0;
lex->subqueries= FALSE;
lex->view_prepare_mode= FALSE;
- lex->stmt_prepare_mode= FALSE;
lex->derived_tables= 0;
lex->lock_option= TL_READ;
- lex->found_semicolon= 0;
lex->safe_to_cache_query= 1;
lex->leaf_tables_insert= 0;
lex->parsing_options.reset();
lex->empty_field_list_on_rset= 0;
lex->select_lex.select_number= 1;
- lex->next_state=MY_LEX_START;
- lex->yylineno = 1;
- lex->in_comment=0;
lex->length=0;
lex->part_info= 0;
lex->select_lex.in_sum_expr=0;
- lex->select_lex.expr_list.empty();
lex->select_lex.ftfunc_list_alloc.empty();
lex->select_lex.ftfunc_list= &lex->select_lex.ftfunc_list_alloc;
lex->select_lex.group_list.empty();
lex->select_lex.order_list.empty();
- lex->ignore_space=test(thd->variables.sql_mode & MODE_IGNORE_SPACE);
lex->sql_command= SQLCOM_END;
lex->duplicates= DUP_ERROR;
lex->ignore= 0;
@@ -193,6 +335,7 @@ void lex_start(THD *thd, const char *buf, uint length)
lex->spcont= NULL;
lex->proc_list.first= 0;
lex->escape_used= FALSE;
+ lex->query_tables= 0;
lex->reset_query_tables_list(FALSE);
lex->expr_allows_subselect= TRUE;
@@ -218,6 +361,7 @@ void lex_start(THD *thd, const char *buf, uint length)
lex->server_options.socket= 0;
lex->server_options.owner= 0;
lex->server_options.port= -1;
+
DBUG_VOID_RETURN;
}
@@ -232,28 +376,34 @@ void lex_end(LEX *lex)
lex->yacc_yyss= 0;
lex->yacc_yyvs= 0;
}
+
+ /* release used plugins */
+ plugin_unlock_list(0, (plugin_ref*)lex->plugins.buffer,
+ lex->plugins.elements);
+ reset_dynamic(&lex->plugins);
+
DBUG_VOID_RETURN;
}
-static int find_keyword(LEX *lex, uint len, bool function)
+static int find_keyword(Lex_input_stream *lip, uint len, bool function)
{
- const char *tok= lex->tok_start;
+ const char *tok= lip->get_tok_start();
SYMBOL *symbol= get_hash_symbol(tok, len, function);
if (symbol)
{
- lex->yylval->symbol.symbol=symbol;
- lex->yylval->symbol.str= (char*) tok;
- lex->yylval->symbol.length=len;
-
+ lip->yylval->symbol.symbol=symbol;
+ lip->yylval->symbol.str= (char*) tok;
+ lip->yylval->symbol.length=len;
+
if ((symbol->tok == NOT_SYM) &&
- (lex->thd->variables.sql_mode & MODE_HIGH_NOT_PRECEDENCE))
+ (lip->m_thd->variables.sql_mode & MODE_HIGH_NOT_PRECEDENCE))
return NOT2_SYM;
if ((symbol->tok == OR_OR_SYM) &&
- !(lex->thd->variables.sql_mode & MODE_PIPES_AS_CONCAT))
+ !(lip->m_thd->variables.sql_mode & MODE_PIPES_AS_CONCAT))
return OR2_SYM;
-
+
return symbol->tok;
}
return 0;
@@ -286,12 +436,16 @@ bool is_lex_native_function(const LEX_STRING *name)
/* make a copy of token before ptr and set yytoklen */
-static LEX_STRING get_token(LEX *lex,uint length)
+static LEX_STRING get_token(Lex_input_stream *lip, uint skip, uint length)
{
LEX_STRING tmp;
- yyUnget(); // ptr points now after last token char
- tmp.length=lex->yytoklen=length;
- tmp.str=(char*) lex->thd->strmake((char*) lex->tok_start,tmp.length);
+ lip->yyUnget(); // ptr points now after last token char
+ tmp.length=lip->yytoklen=length;
+ tmp.str= lip->m_thd->strmake(lip->get_tok_start() + skip, tmp.length);
+
+ lip->m_cpp_text_start= lip->get_cpp_tok_start() + skip;
+ lip->m_cpp_text_end= lip->m_cpp_text_start + tmp.length;
+
return tmp;
}
@@ -302,20 +456,30 @@ static LEX_STRING get_token(LEX *lex,uint length)
future to operate multichar strings (like ucs2)
*/
-static LEX_STRING get_quoted_token(LEX *lex,uint length, char quote)
+static LEX_STRING get_quoted_token(Lex_input_stream *lip,
+ uint skip,
+ uint length, char quote)
{
LEX_STRING tmp;
const char *from, *end;
char *to;
- yyUnget(); // ptr points now after last token char
- tmp.length=lex->yytoklen=length;
- tmp.str=(char*) lex->thd->alloc(tmp.length+1);
- for (from= lex->tok_start, to= tmp.str, end= to+length ;
- to != end ;
- )
+ lip->yyUnget(); // ptr points now after last token char
+ tmp.length= lip->yytoklen=length;
+ tmp.str=(char*) lip->m_thd->alloc(tmp.length+1);
+ from= lip->get_tok_start() + skip;
+ to= tmp.str;
+ end= to+length;
+
+ lip->m_cpp_text_start= lip->get_cpp_tok_start() + skip;
+ lip->m_cpp_text_end= lip->m_cpp_text_start + length;
+
+ for ( ; to != end; )
{
if ((*to++= *from++) == quote)
+ {
from++; // Skip double quotes
+ lip->m_cpp_text_start++;
+ }
}
*to= 0; // End null for safety
return tmp;
@@ -327,57 +491,70 @@ static LEX_STRING get_quoted_token(LEX *lex,uint length, char quote)
Fix sometimes to do only one scan of the string
*/
-static char *get_text(LEX *lex)
+static char *get_text(Lex_input_stream *lip, int pre_skip, int post_skip)
{
reg1 uchar c,sep;
uint found_escape=0;
- CHARSET_INFO *cs= lex->thd->charset();
+ CHARSET_INFO *cs= lip->m_thd->charset();
- sep= yyGetLast(); // String should end with this
- while (lex->ptr != lex->end_of_query)
+ lip->tok_bitmap= 0;
+ sep= lip->yyGetLast(); // String should end with this
+ while (! lip->eof())
{
- c = yyGet();
+ c= lip->yyGet();
+ lip->tok_bitmap|= c;
#ifdef USE_MB
{
int l;
if (use_mb(cs) &&
- (l = my_ismbchar(cs, lex->ptr-1, lex->end_of_query))) {
- lex->ptr += l-1;
- continue;
+ (l = my_ismbchar(cs,
+ lip->get_ptr() -1,
+ lip->get_end_of_query()))) {
+ lip->skip_binary(l-1);
+ continue;
}
}
#endif
if (c == '\\' &&
- !(lex->thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES))
+ !(lip->m_thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES))
{ // Escaped character
found_escape=1;
- if (lex->ptr == lex->end_of_query)
+ if (lip->eof())
return 0;
- yySkip();
+ lip->yySkip();
}
else if (c == sep)
{
- if (c == yyGet()) // Check if two separators in a row
+ if (c == lip->yyGet()) // Check if two separators in a row
{
- found_escape=1; // dupplicate. Remember for delete
+ found_escape=1; // duplicate. Remember for delete
continue;
}
else
- yyUnget();
+ lip->yyUnget();
/* Found end. Unescape and return string */
const char *str, *end;
char *start;
- str=lex->tok_start+1;
- end=lex->ptr-1;
- if (!(start= (char*) lex->thd->alloc((uint) (end-str)+1)))
+ str= lip->get_tok_start();
+ end= lip->get_ptr();
+ /* Extract the text from the token */
+ str += pre_skip;
+ end -= post_skip;
+ DBUG_ASSERT(end >= str);
+
+ if (!(start= (char*) lip->m_thd->alloc((uint) (end-str)+1)))
return (char*) ""; // Sql_alloc has set error flag
+
+ lip->m_cpp_text_start= lip->get_cpp_tok_start() + pre_skip;
+ lip->m_cpp_text_end= lip->get_cpp_ptr() - post_skip;
+
if (!found_escape)
{
- lex->yytoklen=(uint) (end-str);
- memcpy(start,str,lex->yytoklen);
- start[lex->yytoklen]=0;
+ lip->yytoklen=(uint) (end-str);
+ memcpy(start,str,lip->yytoklen);
+ start[lip->yytoklen]=0;
}
else
{
@@ -395,7 +572,7 @@ static char *get_text(LEX *lex)
continue;
}
#endif
- if (!(lex->thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) &&
+ if (!(lip->m_thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) &&
*str == '\\' && str+1 != end)
{
switch(*++str) {
@@ -432,7 +609,7 @@ static char *get_text(LEX *lex)
*to++ = *str;
}
*to=0;
- lex->yytoklen=(uint) (to-start);
+ lip->yytoklen=(uint) (to-start);
}
return start;
}
@@ -542,39 +719,45 @@ static inline uint int_token(const char *str,uint length)
int MYSQLlex(void *arg, void *yythd)
{
reg1 uchar c;
+ bool comment_closed;
int tokval, result_state;
uint length;
enum my_lex_states state;
- LEX *lex= ((THD *)yythd)->lex;
+ THD *thd= (THD *)yythd;
+ Lex_input_stream *lip= thd->m_lip;
+ LEX *lex= thd->lex;
YYSTYPE *yylval=(YYSTYPE*) arg;
- CHARSET_INFO *cs= ((THD *) yythd)->charset();
+ CHARSET_INFO *cs= thd->charset();
uchar *state_map= cs->state_map;
uchar *ident_map= cs->ident_map;
- lex->yylval=yylval; // The global state
-
- lex->tok_start_prev= lex->tok_start;
+ lip->yylval=yylval; // The global state
- lex->tok_start=lex->tok_end=lex->ptr;
- state=lex->next_state;
- lex->next_state=MY_LEX_OPERATOR_OR_IDENT;
+ lip->start_token();
+ state=lip->next_state;
+ lip->next_state=MY_LEX_OPERATOR_OR_IDENT;
LINT_INIT(c);
for (;;)
{
switch (state) {
case MY_LEX_OPERATOR_OR_IDENT: // Next is operator or keyword
case MY_LEX_START: // Start of token
- // Skip startspace
- for (c=yyGet() ; (state_map[c] == MY_LEX_SKIP) ; c= yyGet())
+ // Skip starting whitespace
+ while(state_map[c= lip->yyPeek()] == MY_LEX_SKIP)
{
if (c == '\n')
- lex->yylineno++;
+ lip->yylineno++;
+
+ lip->yySkip();
}
- lex->tok_start=lex->ptr-1; // Start of real token
+
+ /* Start of real token */
+ lip->restart_token();
+ c= lip->yyGet();
state= (enum my_lex_states) state_map[c];
break;
case MY_LEX_ESCAPE:
- if (yyGet() == 'N')
+ if (lip->yyGet() == 'N')
{ // Allow \N as shortcut for NULL
yylval->lex_str.str=(char*) "\\N";
yylval->lex_str.length=2;
@@ -582,55 +765,69 @@ int MYSQLlex(void *arg, void *yythd)
}
case MY_LEX_CHAR: // Unknown or single char token
case MY_LEX_SKIP: // This should not happen
- if (c == '-' && yyPeek() == '-' &&
- (my_isspace(cs,yyPeek2()) ||
- my_iscntrl(cs,yyPeek2())))
+ if (c == '-' && lip->yyPeek() == '-' &&
+ (my_isspace(cs,lip->yyPeekn(1)) ||
+ my_iscntrl(cs,lip->yyPeekn(1))))
{
state=MY_LEX_COMMENT;
break;
}
- yylval->lex_str.str=(char*) (lex->ptr=lex->tok_start);// Set to first chr
- yylval->lex_str.length=1;
- c=yyGet();
+
if (c != ')')
- lex->next_state= MY_LEX_START; // Allow signed numbers
+ lip->next_state= MY_LEX_START; // Allow signed numbers
+
if (c == ',')
- lex->tok_start=lex->ptr; // Let tok_start point at next item
- /*
- Check for a placeholder: it should not precede a possible identifier
- because of binlogging: when a placeholder is replaced with
- its value in a query for the binlog, the query must stay
- grammatically correct.
- */
- else if (c == '?' && lex->stmt_prepare_mode && !ident_map[yyPeek()])
+ {
+ /*
+ Warning:
+ This is a work around, to make the "remember_name" rule in
+ sql/sql_yacc.yy work properly.
+ The problem is that, when parsing "select expr1, expr2",
+ the code generated by bison executes the *pre* action
+ remember_name (see select_item) *before* actually parsing the
+ first token of expr2.
+ */
+ lip->restart_token();
+ }
+ else
+ {
+ /*
+ Check for a placeholder: it should not precede a possible identifier
+ because of binlogging: when a placeholder is replaced with
+ its value in a query for the binlog, the query must stay
+ grammatically correct.
+ */
+ if (c == '?' && lip->stmt_prepare_mode && !ident_map[lip->yyPeek()])
return(PARAM_MARKER);
+ }
+
return((int) c);
case MY_LEX_IDENT_OR_NCHAR:
- if (yyPeek() != '\'')
- {
+ if (lip->yyPeek() != '\'')
+ {
state= MY_LEX_IDENT;
break;
}
/* Found N'string' */
- lex->tok_start++; // Skip N
- yySkip(); // Skip '
- if (!(yylval->lex_str.str = get_text(lex)))
+ lip->yySkip(); // Skip '
+ if (!(yylval->lex_str.str = get_text(lip, 2, 1)))
{
state= MY_LEX_CHAR; // Read char by char
break;
}
- yylval->lex_str.length= lex->yytoklen;
+ yylval->lex_str.length= lip->yytoklen;
+ lex->text_string_is_7bit= (lip->tok_bitmap & 0x80) ? 0 : 1;
return(NCHAR_STRING);
case MY_LEX_IDENT_OR_HEX:
- if (yyPeek() == '\'')
+ if (lip->yyPeek() == '\'')
{ // Found x'hex-number'
state= MY_LEX_HEX_NUMBER;
break;
}
case MY_LEX_IDENT_OR_BIN:
- if (yyPeek() == '\'')
+ if (lip->yyPeek() == '\'')
{ // Found b'bin-number'
state= MY_LEX_BIN_NUMBER;
break;
@@ -641,82 +838,133 @@ int MYSQLlex(void *arg, void *yythd)
if (use_mb(cs))
{
result_state= IDENT_QUOTED;
- if (my_mbcharlen(cs, yyGetLast()) > 1)
+ if (my_mbcharlen(cs, lip->yyGetLast()) > 1)
{
- int l = my_ismbchar(cs, lex->ptr-1, lex->end_of_query);
+ int l = my_ismbchar(cs,
+ lip->get_ptr() -1,
+ lip->get_end_of_query());
if (l == 0) {
state = MY_LEX_CHAR;
continue;
}
- lex->ptr += l - 1;
+ lip->skip_binary(l - 1);
}
- while (ident_map[c=yyGet()])
+ while (ident_map[c=lip->yyGet()])
{
if (my_mbcharlen(cs, c) > 1)
{
int l;
- if ((l = my_ismbchar(cs, lex->ptr-1, lex->end_of_query)) == 0)
+ if ((l = my_ismbchar(cs,
+ lip->get_ptr() -1,
+ lip->get_end_of_query())) == 0)
break;
- lex->ptr += l-1;
+ lip->skip_binary(l-1);
}
}
}
else
#endif
{
- for (result_state= c; ident_map[c= yyGet()]; result_state|= c);
+ for (result_state= c; ident_map[c= lip->yyGet()]; result_state|= c);
/* If there were non-ASCII characters, mark that we must convert */
result_state= result_state & 0x80 ? IDENT_QUOTED : IDENT;
}
- length= (uint) (lex->ptr - lex->tok_start)-1;
- start= lex->ptr;
- if (lex->ignore_space)
+ length= lip->yyLength();
+ start= lip->get_ptr();
+ if (lip->ignore_space)
{
/*
If we find a space then this can't be an identifier. We notice this
below by checking start != lex->ptr.
*/
- for (; state_map[c] == MY_LEX_SKIP ; c= yyGet());
+ for (; state_map[c] == MY_LEX_SKIP ; c= lip->yyGet());
}
- if (start == lex->ptr && c == '.' && ident_map[yyPeek()])
- lex->next_state=MY_LEX_IDENT_SEP;
+ if (start == lip->get_ptr() && c == '.' && ident_map[lip->yyPeek()])
+ lip->next_state=MY_LEX_IDENT_SEP;
else
{ // '(' must follow directly if function
- yyUnget();
- if ((tokval = find_keyword(lex,length,c == '(')))
+ lip->yyUnget();
+ if ((tokval = find_keyword(lip, length, c == '(')))
{
- lex->next_state= MY_LEX_START; // Allow signed numbers
+ lip->next_state= MY_LEX_START; // Allow signed numbers
return(tokval); // Was keyword
}
- yySkip(); // next state does a unget
+ lip->yySkip(); // next state does a unget
}
- yylval->lex_str=get_token(lex,length);
+ yylval->lex_str=get_token(lip, 0, length);
- /*
+ /*
Note: "SELECT _bla AS 'alias'"
_bla should be considered as a IDENT if charset haven't been found.
- So we don't use MYF(MY_WME) with get_charset_by_csname to avoid
+ So we don't use MYF(MY_WME) with get_charset_by_csname to avoid
producing an error.
*/
- if ((yylval->lex_str.str[0]=='_') &&
- (lex->underscore_charset=
- get_charset_by_csname(yylval->lex_str.str + 1,
- MY_CS_PRIMARY,MYF(0))))
- return(UNDERSCORE_CHARSET);
+ if (yylval->lex_str.str[0] == '_')
+ {
+ CHARSET_INFO *cs= get_charset_by_csname(yylval->lex_str.str + 1,
+ MY_CS_PRIMARY, MYF(0));
+ if (cs)
+ {
+ yylval->charset= cs;
+ lip->m_underscore_cs= cs;
+
+ lip->body_utf8_append(lip->m_cpp_text_start,
+ lip->get_cpp_tok_start() + length);
+ return(UNDERSCORE_CHARSET);
+ }
+ }
+
+ lip->body_utf8_append(lip->m_cpp_text_start);
+
+ lip->body_utf8_append_literal(thd, &yylval->lex_str, cs,
+ lip->m_cpp_text_end);
+
return(result_state); // IDENT or IDENT_QUOTED
case MY_LEX_IDENT_SEP: // Found ident and now '.'
- yylval->lex_str.str=(char*) lex->ptr;
- yylval->lex_str.length=1;
- c=yyGet(); // should be '.'
- lex->next_state= MY_LEX_IDENT_START;// Next is an ident (not a keyword)
- if (!ident_map[yyPeek()]) // Probably ` or "
- lex->next_state= MY_LEX_START;
+ yylval->lex_str.str= (char*) lip->get_ptr();
+ yylval->lex_str.length= 1;
+ c= lip->yyGet(); // should be '.'
+ lip->next_state= MY_LEX_IDENT_START;// Next is an ident (not a keyword)
+ if (!ident_map[lip->yyPeek()]) // Probably ` or "
+ lip->next_state= MY_LEX_START;
return((int) c);
case MY_LEX_NUMBER_IDENT: // number or ident which num-start
- while (my_isdigit(cs,(c = yyGet()))) ;
+ if (lip->yyGetLast() == '0')
+ {
+ c= lip->yyGet();
+ if (c == 'x')
+ {
+ while (my_isxdigit(cs,(c = lip->yyGet()))) ;
+ if ((lip->yyLength() >= 3) && !ident_map[c])
+ {
+ /* skip '0x' */
+ yylval->lex_str=get_token(lip, 2, lip->yyLength()-2);
+ return (HEX_NUM);
+ }
+ lip->yyUnget();
+ state= MY_LEX_IDENT_START;
+ break;
+ }
+ else if (c == 'b')
+ {
+ while ((c= lip->yyGet()) == '0' || c == '1');
+ if ((lip->yyLength() >= 3) && !ident_map[c])
+ {
+ /* Skip '0b' */
+ yylval->lex_str= get_token(lip, 2, lip->yyLength()-2);
+ return (BIN_NUM);
+ }
+ lip->yyUnget();
+ state= MY_LEX_IDENT_START;
+ break;
+ }
+ lip->yyUnget();
+ }
+
+ while (my_isdigit(cs, (c = lip->yyGet()))) ;
if (!ident_map[c])
{ // Can't be identifier
state=MY_LEX_INT_OR_REAL;
@@ -725,46 +973,18 @@ int MYSQLlex(void *arg, void *yythd)
if (c == 'e' || c == 'E')
{
// The following test is written this way to allow numbers of type 1e1
- if (my_isdigit(cs,yyPeek()) ||
- (c=(yyGet())) == '+' || c == '-')
+ if (my_isdigit(cs,lip->yyPeek()) ||
+ (c=(lip->yyGet())) == '+' || c == '-')
{ // Allow 1E+10
- if (my_isdigit(cs,yyPeek())) // Number must have digit after sign
+ if (my_isdigit(cs,lip->yyPeek())) // Number must have digit after sign
{
- yySkip();
- while (my_isdigit(cs,yyGet())) ;
- yylval->lex_str=get_token(lex,yyLength());
+ lip->yySkip();
+ while (my_isdigit(cs,lip->yyGet())) ;
+ yylval->lex_str=get_token(lip, 0, lip->yyLength());
return(FLOAT_NUM);
}
}
- yyUnget(); /* purecov: inspected */
- }
- else if (c == 'x' && (lex->ptr - lex->tok_start) == 2 &&
- lex->tok_start[0] == '0' )
- { // Varbinary
- while (my_isxdigit(cs,(c = yyGet()))) ;
- if ((lex->ptr - lex->tok_start) >= 4 && !ident_map[c])
- {
- yylval->lex_str=get_token(lex,yyLength());
- yylval->lex_str.str+=2; // Skip 0x
- yylval->lex_str.length-=2;
- lex->yytoklen-=2;
- return (HEX_NUM);
- }
- yyUnget();
- }
- else if (c == 'b' && (lex->ptr - lex->tok_start) == 2 &&
- lex->tok_start[0] == '0' )
- { // b'bin-number'
- while (my_isxdigit(cs,(c = yyGet()))) ;
- if ((lex->ptr - lex->tok_start) >= 4 && !ident_map[c])
- {
- yylval->lex_str= get_token(lex, yyLength());
- yylval->lex_str.str+= 2; // Skip 0x
- yylval->lex_str.length-= 2;
- lex->yytoklen-= 2;
- return (BIN_NUM);
- }
- yyUnget();
+ lip->yyUnget();
}
// fall through
case MY_LEX_IDENT_START: // We come here after '.'
@@ -773,45 +993,52 @@ int MYSQLlex(void *arg, void *yythd)
if (use_mb(cs))
{
result_state= IDENT_QUOTED;
- while (ident_map[c=yyGet()])
+ while (ident_map[c=lip->yyGet()])
{
if (my_mbcharlen(cs, c) > 1)
{
int l;
- if ((l = my_ismbchar(cs, lex->ptr-1, lex->end_of_query)) == 0)
+ if ((l = my_ismbchar(cs,
+ lip->get_ptr() -1,
+ lip->get_end_of_query())) == 0)
break;
- lex->ptr += l-1;
+ lip->skip_binary(l-1);
}
}
}
else
#endif
{
- for (result_state=0; ident_map[c= yyGet()]; result_state|= c);
+ for (result_state=0; ident_map[c= lip->yyGet()]; result_state|= c);
/* If there were non-ASCII characters, mark that we must convert */
result_state= result_state & 0x80 ? IDENT_QUOTED : IDENT;
}
- if (c == '.' && ident_map[yyPeek()])
- lex->next_state=MY_LEX_IDENT_SEP;// Next is '.'
+ if (c == '.' && ident_map[lip->yyPeek()])
+ lip->next_state=MY_LEX_IDENT_SEP;// Next is '.'
+
+ yylval->lex_str= get_token(lip, 0, lip->yyLength());
+
+ lip->body_utf8_append(lip->m_cpp_text_start);
+
+ lip->body_utf8_append_literal(thd, &yylval->lex_str, cs,
+ lip->m_cpp_text_end);
- yylval->lex_str= get_token(lex,yyLength());
return(result_state);
case MY_LEX_USER_VARIABLE_DELIMITER: // Found quote char
{
uint double_quotes= 0;
char quote_char= c; // Used char
- lex->tok_start=lex->ptr; // Skip first `
- while ((c=yyGet()))
+ while ((c=lip->yyGet()))
{
int var_length;
if ((var_length= my_mbcharlen(cs, c)) == 1)
{
if (c == quote_char)
{
- if (yyPeek() != quote_char)
+ if (lip->yyPeek() != quote_char)
break;
- c=yyGet();
+ c=lip->yyGet();
double_quotes++;
continue;
}
@@ -819,252 +1046,348 @@ int MYSQLlex(void *arg, void *yythd)
#ifdef USE_MB
else if (var_length < 1)
break; // Error
- lex->ptr+= var_length-1;
+ lip->skip_binary(var_length-1);
#endif
}
if (double_quotes)
- yylval->lex_str=get_quoted_token(lex,yyLength() - double_quotes,
+ yylval->lex_str=get_quoted_token(lip, 1,
+ lip->yyLength() - double_quotes -1,
quote_char);
else
- yylval->lex_str=get_token(lex,yyLength());
+ yylval->lex_str=get_token(lip, 1, lip->yyLength() -1);
if (c == quote_char)
- yySkip(); // Skip end `
- lex->next_state= MY_LEX_START;
+ lip->yySkip(); // Skip end `
+ lip->next_state= MY_LEX_START;
+
+ lip->body_utf8_append(lip->m_cpp_text_start);
+
+ lip->body_utf8_append_literal(thd, &yylval->lex_str, cs,
+ lip->m_cpp_text_end);
+
return(IDENT_QUOTED);
}
- case MY_LEX_INT_OR_REAL: // Compleat int or incompleat real
+ case MY_LEX_INT_OR_REAL: // Complete int or incomplete real
if (c != '.')
{ // Found complete integer number.
- yylval->lex_str=get_token(lex,yyLength());
+ yylval->lex_str=get_token(lip, 0, lip->yyLength());
return int_token(yylval->lex_str.str,yylval->lex_str.length);
}
// fall through
case MY_LEX_REAL: // Incomplete real number
- while (my_isdigit(cs,c = yyGet())) ;
+ while (my_isdigit(cs,c = lip->yyGet())) ;
if (c == 'e' || c == 'E')
{
- c = yyGet();
+ c = lip->yyGet();
if (c == '-' || c == '+')
- c = yyGet(); // Skip sign
+ c = lip->yyGet(); // Skip sign
if (!my_isdigit(cs,c))
{ // No digit after sign
state= MY_LEX_CHAR;
break;
}
- while (my_isdigit(cs,yyGet())) ;
- yylval->lex_str=get_token(lex,yyLength());
+ while (my_isdigit(cs,lip->yyGet())) ;
+ yylval->lex_str=get_token(lip, 0, lip->yyLength());
return(FLOAT_NUM);
}
- yylval->lex_str=get_token(lex,yyLength());
+ yylval->lex_str=get_token(lip, 0, lip->yyLength());
return(DECIMAL_NUM);
case MY_LEX_HEX_NUMBER: // Found x'hexstring'
- yyGet(); // Skip '
- while (my_isxdigit(cs,(c = yyGet()))) ;
- length=(lex->ptr - lex->tok_start); // Length of hexnum+3
- if (!(length & 1) || c != '\'')
- {
- return(ABORT_SYM); // Illegal hex constant
- }
- yyGet(); // get_token makes an unget
- yylval->lex_str=get_token(lex,length);
- yylval->lex_str.str+=2; // Skip x'
- yylval->lex_str.length-=3; // Don't count x' and last '
- lex->yytoklen-=3;
+ lip->yySkip(); // Accept opening '
+ while (my_isxdigit(cs, (c= lip->yyGet()))) ;
+ if (c != '\'')
+ return(ABORT_SYM); // Illegal hex constant
+ lip->yySkip(); // Accept closing '
+ length= lip->yyLength(); // Length of hexnum+3
+ if ((length % 2) == 0)
+ return(ABORT_SYM); // odd number of hex digits
+ yylval->lex_str=get_token(lip,
+ 2, // skip x'
+ length-3); // don't count x' and last '
return (HEX_NUM);
case MY_LEX_BIN_NUMBER: // Found b'bin-string'
- yyGet(); // Skip '
- while ((c= yyGet()) == '0' || c == '1');
- length= (lex->ptr - lex->tok_start); // Length of bin-num + 3
+ lip->yySkip(); // Accept opening '
+ while ((c= lip->yyGet()) == '0' || c == '1');
if (c != '\'')
- return(ABORT_SYM); // Illegal hex constant
- yyGet(); // get_token makes an unget
- yylval->lex_str= get_token(lex, length);
- yylval->lex_str.str+= 2; // Skip b'
- yylval->lex_str.length-= 3; // Don't count b' and last '
- lex->yytoklen-= 3;
- return (BIN_NUM);
+ return(ABORT_SYM); // Illegal hex constant
+ lip->yySkip(); // Accept closing '
+ length= lip->yyLength(); // Length of bin-num + 3
+ yylval->lex_str= get_token(lip,
+ 2, // skip b'
+ length-3); // don't count b' and last '
+ return (BIN_NUM);
case MY_LEX_CMP_OP: // Incomplete comparison operator
- if (state_map[yyPeek()] == MY_LEX_CMP_OP ||
- state_map[yyPeek()] == MY_LEX_LONG_CMP_OP)
- yySkip();
- if ((tokval = find_keyword(lex,(uint) (lex->ptr - lex->tok_start),0)))
+ if (state_map[lip->yyPeek()] == MY_LEX_CMP_OP ||
+ state_map[lip->yyPeek()] == MY_LEX_LONG_CMP_OP)
+ lip->yySkip();
+ if ((tokval = find_keyword(lip, lip->yyLength() + 1, 0)))
{
- lex->next_state= MY_LEX_START; // Allow signed numbers
+ lip->next_state= MY_LEX_START; // Allow signed numbers
return(tokval);
}
state = MY_LEX_CHAR; // Something fishy found
break;
case MY_LEX_LONG_CMP_OP: // Incomplete comparison operator
- if (state_map[yyPeek()] == MY_LEX_CMP_OP ||
- state_map[yyPeek()] == MY_LEX_LONG_CMP_OP)
+ if (state_map[lip->yyPeek()] == MY_LEX_CMP_OP ||
+ state_map[lip->yyPeek()] == MY_LEX_LONG_CMP_OP)
{
- yySkip();
- if (state_map[yyPeek()] == MY_LEX_CMP_OP)
- yySkip();
+ lip->yySkip();
+ if (state_map[lip->yyPeek()] == MY_LEX_CMP_OP)
+ lip->yySkip();
}
- if ((tokval = find_keyword(lex,(uint) (lex->ptr - lex->tok_start),0)))
+ if ((tokval = find_keyword(lip, lip->yyLength() + 1, 0)))
{
- lex->next_state= MY_LEX_START; // Found long op
+ lip->next_state= MY_LEX_START; // Found long op
return(tokval);
}
state = MY_LEX_CHAR; // Something fishy found
break;
case MY_LEX_BOOL:
- if (c != yyPeek())
+ if (c != lip->yyPeek())
{
state=MY_LEX_CHAR;
break;
}
- yySkip();
- tokval = find_keyword(lex,2,0); // Is a bool operator
- lex->next_state= MY_LEX_START; // Allow signed numbers
+ lip->yySkip();
+ tokval = find_keyword(lip,2,0); // Is a bool operator
+ lip->next_state= MY_LEX_START; // Allow signed numbers
return(tokval);
case MY_LEX_STRING_OR_DELIMITER:
- if (((THD *) yythd)->variables.sql_mode & MODE_ANSI_QUOTES)
+ if (thd->variables.sql_mode & MODE_ANSI_QUOTES)
{
state= MY_LEX_USER_VARIABLE_DELIMITER;
break;
}
/* " used for strings */
case MY_LEX_STRING: // Incomplete text string
- if (!(yylval->lex_str.str = get_text(lex)))
+ if (!(yylval->lex_str.str = get_text(lip, 1, 1)))
{
state= MY_LEX_CHAR; // Read char by char
break;
}
- yylval->lex_str.length=lex->yytoklen;
+ yylval->lex_str.length=lip->yytoklen;
+
+ lip->body_utf8_append(lip->m_cpp_text_start);
+
+ lip->body_utf8_append_literal(thd, &yylval->lex_str,
+ lip->m_underscore_cs ? lip->m_underscore_cs : cs,
+ lip->m_cpp_text_end);
+
+ lip->m_underscore_cs= NULL;
+
+ lex->text_string_is_7bit= (lip->tok_bitmap & 0x80) ? 0 : 1;
return(TEXT_STRING);
case MY_LEX_COMMENT: // Comment
lex->select_lex.options|= OPTION_FOUND_COMMENT;
- while ((c = yyGet()) != '\n' && c) ;
- yyUnget(); // Safety against eof
+ while ((c = lip->yyGet()) != '\n' && c) ;
+ lip->yyUnget(); // Safety against eof
state = MY_LEX_START; // Try again
break;
case MY_LEX_LONG_COMMENT: /* Long C comment? */
- if (yyPeek() != '*')
+ if (lip->yyPeek() != '*')
{
state=MY_LEX_CHAR; // Probable division
break;
}
- yySkip(); // Skip '*'
lex->select_lex.options|= OPTION_FOUND_COMMENT;
- if (yyPeek() == '!') // MySQL command in comment
+ /* Reject '/' '*', since we might need to turn off the echo */
+ lip->yyUnget();
+
+ if (lip->yyPeekn(2) == '!')
{
- ulong version=MYSQL_VERSION_ID;
- yySkip();
- state=MY_LEX_START;
- if (my_isdigit(cs,yyPeek()))
- { // Version number
- version=strtol((char*) lex->ptr,(char**) &lex->ptr,10);
- }
- if (version <= MYSQL_VERSION_ID)
- {
- lex->in_comment=1;
- break;
- }
+ lip->in_comment= DISCARD_COMMENT;
+ /* Accept '/' '*' '!', but do not keep this marker. */
+ lip->set_echo(FALSE);
+ lip->yySkip();
+ lip->yySkip();
+ lip->yySkip();
+
+ /*
+ The special comment format is very strict:
+ '/' '*' '!', followed by exactly
+ 1 digit (major), 2 digits (minor), then 2 digits (dot).
+ 32302 -> 3.23.02
+ 50032 -> 5.0.32
+ 50114 -> 5.1.14
+ */
+ char version_str[6];
+ version_str[0]= lip->yyPeekn(0);
+ version_str[1]= lip->yyPeekn(1);
+ version_str[2]= lip->yyPeekn(2);
+ version_str[3]= lip->yyPeekn(3);
+ version_str[4]= lip->yyPeekn(4);
+ version_str[5]= 0;
+ if ( my_isdigit(cs, version_str[0])
+ && my_isdigit(cs, version_str[1])
+ && my_isdigit(cs, version_str[2])
+ && my_isdigit(cs, version_str[3])
+ && my_isdigit(cs, version_str[4])
+ )
+ {
+ ulong version;
+ version=strtol(version_str, NULL, 10);
+
+ /* Accept 'M' 'm' 'm' 'd' 'd' */
+ lip->yySkipn(5);
+
+ if (version <= MYSQL_VERSION_ID)
+ {
+ /* Expand the content of the special comment as real code */
+ lip->set_echo(TRUE);
+ state=MY_LEX_START;
+ break;
+ }
+ }
+ else
+ {
+ state=MY_LEX_START;
+ lip->set_echo(TRUE);
+ break;
+ }
}
- while (lex->ptr != lex->end_of_query &&
- ((c=yyGet()) != '*' || yyPeek() != '/'))
+ else
{
- if (c == '\n')
- lex->yylineno++;
+ lip->in_comment= PRESERVE_COMMENT;
+ lip->yySkip(); // Accept /
+ lip->yySkip(); // Accept *
}
- if (lex->ptr != lex->end_of_query)
- yySkip(); // remove last '/'
- state = MY_LEX_START; // Try again
+ /*
+ Discard:
+ - regular '/' '*' comments,
+ - special comments '/' '*' '!' for a future version,
+ by scanning until we find a closing '*' '/' marker.
+ Note: There is no such thing as nesting comments,
+ the first '*' '/' sequence seen will mark the end.
+ */
+ comment_closed= FALSE;
+ while (! lip->eof())
+ {
+ c= lip->yyGet();
+ if (c == '*')
+ {
+ if (lip->yyPeek() == '/')
+ {
+ lip->yySkip();
+ comment_closed= TRUE;
+ state = MY_LEX_START;
+ break;
+ }
+ }
+ else if (c == '\n')
+ lip->yylineno++;
+ }
+ /* Unbalanced comments with a missing '*' '/' are a syntax error */
+ if (! comment_closed)
+ return (ABORT_SYM);
+ state = MY_LEX_START; // Try again
+ lip->in_comment= NO_COMMENT;
+ lip->set_echo(TRUE);
break;
case MY_LEX_END_LONG_COMMENT:
- if (lex->in_comment && yyPeek() == '/')
+ if ((lip->in_comment != NO_COMMENT) && lip->yyPeek() == '/')
{
- yySkip();
- lex->in_comment=0;
- state=MY_LEX_START;
+ /* Reject '*' '/' */
+ lip->yyUnget();
+ /* Accept '*' '/', with the proper echo */
+ lip->set_echo(lip->in_comment == PRESERVE_COMMENT);
+ lip->yySkipn(2);
+ /* And start recording the tokens again */
+ lip->set_echo(TRUE);
+ lip->in_comment=NO_COMMENT;
+ state=MY_LEX_START;
}
else
state=MY_LEX_CHAR; // Return '*'
break;
case MY_LEX_SET_VAR: // Check if ':='
- if (yyPeek() != '=')
+ if (lip->yyPeek() != '=')
{
state=MY_LEX_CHAR; // Return ':'
break;
}
- yySkip();
+ lip->yySkip();
return (SET_VAR);
case MY_LEX_SEMICOLON: // optional line terminator
- if (yyPeek())
+ if (lip->yyPeek())
{
- THD* thd= (THD*)yythd;
if ((thd->client_capabilities & CLIENT_MULTI_STATEMENTS) &&
- !lex->stmt_prepare_mode)
+ !lip->stmt_prepare_mode)
{
lex->safe_to_cache_query= 0;
- lex->found_semicolon=(char*) lex->ptr;
+ lip->found_semicolon= lip->get_ptr();
thd->server_status|= SERVER_MORE_RESULTS_EXISTS;
- lex->next_state= MY_LEX_END;
+ lip->next_state= MY_LEX_END;
+ lip->set_echo(TRUE);
return (END_OF_INPUT);
}
state= MY_LEX_CHAR; // Return ';'
break;
}
- /* fall true */
+ lip->next_state=MY_LEX_END; // Mark for next loop
+ return(END_OF_INPUT);
case MY_LEX_EOL:
- if (lex->ptr >= lex->end_of_query)
+ if (lip->eof())
{
- lex->next_state=MY_LEX_END; // Mark for next loop
- return(END_OF_INPUT);
+ lip->yyUnget(); // Reject the last '\0'
+ lip->set_echo(FALSE);
+ lip->yySkip();
+ lip->set_echo(TRUE);
+ /* Unbalanced comments with a missing '*' '/' are a syntax error */
+ if (lip->in_comment != NO_COMMENT)
+ return (ABORT_SYM);
+ lip->next_state=MY_LEX_END; // Mark for next loop
+ return(END_OF_INPUT);
}
state=MY_LEX_CHAR;
break;
case MY_LEX_END:
- lex->next_state=MY_LEX_END;
+ lip->next_state=MY_LEX_END;
return(0); // We found end of input last time
/* Actually real shouldn't start with . but allow them anyhow */
case MY_LEX_REAL_OR_POINT:
- if (my_isdigit(cs,yyPeek()))
+ if (my_isdigit(cs,lip->yyPeek()))
state = MY_LEX_REAL; // Real
else
{
state= MY_LEX_IDENT_SEP; // return '.'
- yyUnget(); // Put back '.'
+ lip->yyUnget(); // Put back '.'
}
break;
case MY_LEX_USER_END: // end '@' of user@hostname
- switch (state_map[yyPeek()]) {
+ switch (state_map[lip->yyPeek()]) {
case MY_LEX_STRING:
case MY_LEX_USER_VARIABLE_DELIMITER:
case MY_LEX_STRING_OR_DELIMITER:
break;
case MY_LEX_USER_END:
- lex->next_state=MY_LEX_SYSTEM_VAR;
+ lip->next_state=MY_LEX_SYSTEM_VAR;
break;
default:
- lex->next_state=MY_LEX_HOSTNAME;
+ lip->next_state=MY_LEX_HOSTNAME;
break;
}
- yylval->lex_str.str=(char*) lex->ptr;
+ yylval->lex_str.str=(char*) lip->get_ptr();
yylval->lex_str.length=1;
return((int) '@');
case MY_LEX_HOSTNAME: // end '@' of user@hostname
- for (c=yyGet() ;
+ for (c=lip->yyGet() ;
my_isalnum(cs,c) || c == '.' || c == '_' || c == '$';
- c= yyGet()) ;
- yylval->lex_str=get_token(lex,yyLength());
+ c= lip->yyGet()) ;
+ yylval->lex_str=get_token(lip, 0, lip->yyLength());
return(LEX_HOSTNAME);
case MY_LEX_SYSTEM_VAR:
- yylval->lex_str.str=(char*) lex->ptr;
+ yylval->lex_str.str=(char*) lip->get_ptr();
yylval->lex_str.length=1;
- yySkip(); // Skip '@'
- lex->next_state= (state_map[yyPeek()] ==
+ lip->yySkip(); // Skip '@'
+ lip->next_state= (state_map[lip->yyPeek()] ==
MY_LEX_USER_VARIABLE_DELIMITER ?
MY_LEX_OPERATOR_OR_IDENT :
MY_LEX_IDENT_OR_KEYWORD);
@@ -1075,51 +1398,103 @@ int MYSQLlex(void *arg, void *yythd)
We should now be able to handle:
[(global | local | session) .]variable_name
*/
-
- for (result_state= 0; ident_map[c= yyGet()]; result_state|= c);
+
+ for (result_state= 0; ident_map[c= lip->yyGet()]; result_state|= c);
/* If there were non-ASCII characters, mark that we must convert */
result_state= result_state & 0x80 ? IDENT_QUOTED : IDENT;
-
+
if (c == '.')
- lex->next_state=MY_LEX_IDENT_SEP;
- length= (uint) (lex->ptr - lex->tok_start)-1;
- if (length == 0)
+ lip->next_state=MY_LEX_IDENT_SEP;
+ length= lip->yyLength();
+ if (length == 0)
return(ABORT_SYM); // Names must be nonempty.
- if ((tokval= find_keyword(lex,length,0)))
+ if ((tokval= find_keyword(lip, length,0)))
{
- yyUnget(); // Put back 'c'
+ lip->yyUnget(); // Put back 'c'
return(tokval); // Was keyword
}
- yylval->lex_str=get_token(lex,length);
+ yylval->lex_str=get_token(lip, 0, length);
+
+ lip->body_utf8_append(lip->m_cpp_text_start);
+
+ lip->body_utf8_append_literal(thd, &yylval->lex_str, cs,
+ lip->m_cpp_text_end);
+
return(result_state);
}
}
}
-/*
- Skip comment in the end of statement.
-
- SYNOPSIS
- skip_rear_comments()
- begin pointer to the beginning of statement
- end pointer to the end of statement
+/**
+ Construct a copy of this object to be used for mysql_alter_table
+ and mysql_create_table.
- DESCRIPTION
- The function is intended to trim comments at the end of the statement.
+ Historically, these two functions modify their Alter_info
+ arguments. This behaviour breaks re-execution of prepared
+ statements and stored procedures and is compensated by always
+ supplying a copy of Alter_info to these functions.
- RETURN
- Pointer to the last non-comment symbol of the statement.
+ @return You need to use check the error in THD for out
+ of memory condition after calling this function.
*/
-const char *skip_rear_comments(const char *begin, const char *end)
+Alter_info::Alter_info(const Alter_info &rhs, MEM_ROOT *mem_root)
+ :drop_list(rhs.drop_list, mem_root),
+ alter_list(rhs.alter_list, mem_root),
+ key_list(rhs.key_list, mem_root),
+ create_list(rhs.create_list, mem_root),
+ flags(rhs.flags),
+ keys_onoff(rhs.keys_onoff),
+ tablespace_op(rhs.tablespace_op),
+ partition_names(rhs.partition_names, mem_root),
+ no_parts(rhs.no_parts),
+ change_level(rhs.change_level),
+ datetime_field(rhs.datetime_field),
+ error_if_not_empty(rhs.error_if_not_empty)
{
- while (begin < end && (end[-1] <= ' ' || end[-1] == '*' ||
- end[-1] == '/' || end[-1] == ';'))
- end-= 1;
- return end;
+ /*
+ Make deep copies of used objects.
+ This is not a fully deep copy - clone() implementations
+ of Alter_drop, Alter_column, Key, foreign_key, Key_part_spec
+ do not copy string constants. At the same length the only
+ reason we make a copy currently is that ALTER/CREATE TABLE
+ code changes input Alter_info definitions, but string
+ constants never change.
+ */
+ list_copy_and_replace_each_value(drop_list, mem_root);
+ list_copy_and_replace_each_value(alter_list, mem_root);
+ list_copy_and_replace_each_value(key_list, mem_root);
+ list_copy_and_replace_each_value(create_list, mem_root);
+ /* partition_names are not deeply copied currently */
+}
+
+
+void trim_whitespace(CHARSET_INFO *cs, LEX_STRING *str)
+{
+ /*
+ TODO:
+ This code assumes that there are no multi-bytes characters
+ that can be considered white-space.
+ */
+
+ while ((str->length > 0) && (my_isspace(cs, str->str[0])))
+ {
+ str->length --;
+ str->str ++;
+ }
+
+ /*
+ FIXME:
+ Also, parsing backward is not safe with multi bytes characters
+ */
+ while ((str->length > 0) && (my_isspace(cs, str->str[str->length-1])))
+ {
+ str->length --;
+ }
}
+
/*
st_select_lex structures initialisations
*/
@@ -1181,6 +1556,7 @@ void st_select_lex::init_query()
*/
parent_lex->push_context(&context);
cond_count= between_count= with_wild= 0;
+ max_equal_elems= 0;
conds_processed_with_permanent_arena= 0;
ref_pointer_array= 0;
select_n_where_fields= 0;
@@ -1206,7 +1582,6 @@ void st_select_lex::init_select()
options= 0;
sql_cache= SQL_CACHE_UNSPECIFIED;
braces= 0;
- expr_list.empty();
interval_list.empty();
ftfunc_list_alloc.empty();
inner_sum_func_list= 0;
@@ -1214,7 +1589,7 @@ void st_select_lex::init_select()
linkage= UNSPECIFIED_TYPE;
order_list.elements= 0;
order_list.first= 0;
- order_list.next= (byte**) &order_list.first;
+ order_list.next= (uchar**) &order_list.first;
/* Set limit and offset to default values */
select_limit= 0; /* denotes the default limit = HA_POS_ERROR */
offset_limit= 0; /* denotes the default offset = 0 */
@@ -1401,7 +1776,7 @@ void st_select_lex_unit::exclude_tree()
'last' should be reachable from this st_select_lex_node
*/
-void st_select_lex::mark_as_dependent(SELECT_LEX *last)
+void st_select_lex::mark_as_dependent(st_select_lex *last)
{
/*
Mark all selects from resolved to 1 before select where was
@@ -1438,7 +1813,7 @@ TABLE_LIST *st_select_lex_node::add_table_to_list (THD *thd, Table_ident *table,
LEX_STRING *alias,
ulong table_join_options,
thr_lock_type flags,
- List<index_hint> *hints,
+ List<Index_hint> *hints,
LEX_STRING *option)
{
return 0;
@@ -1700,6 +2075,17 @@ void st_lex::cleanup_lex_after_parse_error(THD *thd)
void Query_tables_list::reset_query_tables_list(bool init)
{
+ if (!init && query_tables)
+ {
+ TABLE_LIST *table= query_tables;
+ for (;;)
+ {
+ delete table->view;
+ if (query_tables_last == &table->next_global ||
+ !(table= table->next_global))
+ break;
+ }
+ }
query_tables= 0;
query_tables_last= &query_tables;
query_tables_own_last= 0;
@@ -1719,7 +2105,7 @@ void Query_tables_list::reset_query_tables_list(bool init)
sroutines_list.empty();
sroutines_list_own_last= sroutines_list.next;
sroutines_list_own_elements= 0;
- binlog_row_based_if_mixed= FALSE;
+ binlog_stmt_flags= 0;
}
@@ -1752,8 +2138,13 @@ void Query_tables_list::destroy_query_tables_list()
st_lex::st_lex()
:result(0), yacc_yyss(0), yacc_yyvs(0),
- sql_command(SQLCOM_END)
+ sql_command(SQLCOM_END), option_type(OPT_DEFAULT)
{
+
+ my_init_dynamic_array2(&plugins, sizeof(plugin_ref),
+ plugins_static_buffer,
+ INITIAL_LEX_PLUGIN_LIST_SIZE,
+ INITIAL_LEX_PLUGIN_LIST_SIZE);
reset_query_tables_list(TRUE);
}
@@ -1949,7 +2340,7 @@ bool st_lex::need_correct_ident()
VIEW_CHECK_CASCADED CHECK OPTION CASCADED
*/
-uint8 st_lex::get_effective_with_check(st_table_list *view)
+uint8 st_lex::get_effective_with_check(TABLE_LIST *view)
{
if (view->select_lex->master_unit() == &unit &&
which_check_option_applicable())
@@ -1958,6 +2349,43 @@ uint8 st_lex::get_effective_with_check(st_table_list *view)
}
+/**
+ This method should be called only during parsing.
+ It is aware of compound statements (stored routine bodies)
+ and will initialize the destination with the default
+ database of the stored routine, rather than the default
+ database of the connection it is parsed in.
+ E.g. if one has no current database selected, or current database
+ set to 'bar' and then issues:
+
+ CREATE PROCEDURE foo.p1() BEGIN SELECT * FROM t1 END//
+
+ t1 is meant to refer to foo.t1, not to bar.t1.
+
+ This method is needed to support this rule.
+
+ @return TRUE in case of error (parsing should be aborted, FALSE in
+ case of success
+*/
+
+bool
+st_lex::copy_db_to(char **p_db, size_t *p_db_length) const
+{
+ if (sphead)
+ {
+ DBUG_ASSERT(sphead->m_db.str && sphead->m_db.length);
+ /*
+ It is safe to assign the string by-pointer, both sphead and
+ its statements reside in the same memory root.
+ */
+ *p_db= sphead->m_db.str;
+ if (p_db_length)
+ *p_db_length= sphead->m_db.length;
+ return FALSE;
+ }
+ return thd->copy_db_to(p_db, p_db_length);
+}
+
/*
initialize limit counters
@@ -1966,13 +2394,22 @@ uint8 st_lex::get_effective_with_check(st_table_list *view)
values - SELECT_LEX with initial values for counters
*/
-void st_select_lex_unit::set_limit(SELECT_LEX *sl)
+void st_select_lex_unit::set_limit(st_select_lex *sl)
{
ha_rows select_limit_val;
+ ulonglong val;
DBUG_ASSERT(! thd->stmt_arena->is_stmt_prepare());
- select_limit_val= (ha_rows)(sl->select_limit ? sl->select_limit->val_uint() :
- HA_POS_ERROR);
+ val= sl->select_limit ? sl->select_limit->val_uint() : HA_POS_ERROR;
+ select_limit_val= (ha_rows)val;
+#ifndef BIG_TABLES
+ /*
+ Check for overflow : ha_rows can be smaller then ulonglong if
+ BIG_TABLES is off.
+ */
+ if (val != (ulonglong)select_limit_val)
+ select_limit_val= HA_POS_ERROR;
+#endif
offset_limit_cnt= (ha_rows)(sl->offset_limit ? sl->offset_limit->val_uint() :
ULL(0));
select_limit_cnt= select_limit_val + offset_limit_cnt;
@@ -1981,6 +2418,154 @@ void st_select_lex_unit::set_limit(SELECT_LEX *sl)
}
+/**
+ @brief Set the initial purpose of this TABLE_LIST object in the list of used
+ tables.
+
+ We need to track this information on table-by-table basis, since when this
+ table becomes an element of the pre-locked list, it's impossible to identify
+ which SQL sub-statement it has been originally used in.
+
+ E.g.:
+
+ User request: SELECT * FROM t1 WHERE f1();
+ FUNCTION f1(): DELETE FROM t2; RETURN 1;
+ BEFORE DELETE trigger on t2: INSERT INTO t3 VALUES (old.a);
+
+ For this user request, the pre-locked list will contain t1, t2, t3
+ table elements, each needed for different DML.
+
+ The trigger event map is updated to reflect INSERT, UPDATE, DELETE,
+ REPLACE, LOAD DATA, CREATE TABLE .. SELECT, CREATE TABLE ..
+ REPLACE SELECT statements, and additionally ON DUPLICATE KEY UPDATE
+ clause.
+*/
+
+void st_lex::set_trg_event_type_for_tables()
+{
+ uint8 new_trg_event_map= 0;
+
+ /*
+ Some auxiliary operations
+ (e.g. GRANT processing) create TABLE_LIST instances outside
+ the parser. Additionally, some commands (e.g. OPTIMIZE) change
+ the lock type for a table only after parsing is done. Luckily,
+ these do not fire triggers and do not need to pre-load them.
+ For these TABLE_LISTs set_trg_event_type is never called, and
+ trg_event_map is always empty. That means that the pre-locking
+ algorithm will ignore triggers defined on these tables, if
+ any, and the execution will either fail with an assert in
+ sql_trigger.cc or with an error that a used table was not
+ pre-locked, in case of a production build.
+
+ TODO: this usage pattern creates unnecessary module dependencies
+ and should be rewritten to go through the parser.
+ Table list instances created outside the parser in most cases
+ refer to mysql.* system tables. It is not allowed to have
+ a trigger on a system table, but keeping track of
+ initialization provides extra safety in case this limitation
+ is circumvented.
+ */
+
+ switch (sql_command) {
+ case SQLCOM_LOCK_TABLES:
+ /*
+ On a LOCK TABLE, all triggers must be pre-loaded for this TABLE_LIST
+ when opening an associated TABLE.
+ */
+ new_trg_event_map= static_cast<uint8>
+ (1 << static_cast<int>(TRG_EVENT_INSERT)) |
+ static_cast<uint8>
+ (1 << static_cast<int>(TRG_EVENT_UPDATE)) |
+ static_cast<uint8>
+ (1 << static_cast<int>(TRG_EVENT_DELETE));
+ break;
+ /*
+ Basic INSERT. If there is an additional ON DUPLIATE KEY UPDATE
+ clause, it will be handled later in this method.
+ */
+ case SQLCOM_INSERT: /* fall through */
+ case SQLCOM_INSERT_SELECT:
+ /*
+ LOAD DATA ... INFILE is expected to fire BEFORE/AFTER INSERT
+ triggers.
+ If the statement also has REPLACE clause, it will be
+ handled later in this method.
+ */
+ case SQLCOM_LOAD: /* fall through */
+ /*
+ REPLACE is semantically equivalent to INSERT. In case
+ of a primary or unique key conflict, it deletes the old
+ record and inserts a new one. So we also may need to
+ fire ON DELETE triggers. This functionality is handled
+ later in this method.
+ */
+ case SQLCOM_REPLACE: /* fall through */
+ case SQLCOM_REPLACE_SELECT:
+ /*
+ CREATE TABLE ... SELECT defaults to INSERT if the table or
+ view already exists. REPLACE option of CREATE TABLE ...
+ REPLACE SELECT is handled later in this method.
+ */
+ case SQLCOM_CREATE_TABLE:
+ new_trg_event_map|= static_cast<uint8>
+ (1 << static_cast<int>(TRG_EVENT_INSERT));
+ break;
+ /* Basic update and multi-update */
+ case SQLCOM_UPDATE: /* fall through */
+ case SQLCOM_UPDATE_MULTI:
+ new_trg_event_map|= static_cast<uint8>
+ (1 << static_cast<int>(TRG_EVENT_UPDATE));
+ break;
+ /* Basic delete and multi-delete */
+ case SQLCOM_DELETE: /* fall through */
+ case SQLCOM_DELETE_MULTI:
+ new_trg_event_map|= static_cast<uint8>
+ (1 << static_cast<int>(TRG_EVENT_DELETE));
+ break;
+ default:
+ break;
+ }
+
+ switch (duplicates) {
+ case DUP_UPDATE:
+ new_trg_event_map|= static_cast<uint8>
+ (1 << static_cast<int>(TRG_EVENT_UPDATE));
+ break;
+ case DUP_REPLACE:
+ new_trg_event_map|= static_cast<uint8>
+ (1 << static_cast<int>(TRG_EVENT_DELETE));
+ break;
+ case DUP_ERROR:
+ default:
+ break;
+ }
+
+
+ /*
+ Do not iterate over sub-selects, only the tables in the outermost
+ SELECT_LEX can be modified, if any.
+ */
+ TABLE_LIST *tables= select_lex.get_table_list();
+
+ while (tables)
+ {
+ /*
+ This is a fast check to filter out statements that do
+ not change data, or tables on the right side, in case of
+ INSERT .. SELECT, CREATE TABLE .. SELECT and so on.
+ Here we also filter out OPTIMIZE statement and non-updateable
+ views, for which lock_type is TL_UNLOCK or TL_READ after
+ parsing.
+ */
+ if (static_cast<int>(tables->lock_type) >=
+ static_cast<int>(TL_WRITE_ALLOW_WRITE))
+ tables->trg_event_map= new_trg_event_map;
+ tables= tables->next_local;
+ }
+}
+
+
/*
Unlink the first table from the global table list and the first table from
outer select (lex->select_lex) local list
@@ -2020,7 +2605,7 @@ TABLE_LIST *st_lex::unlink_first_table(bool *link_to_local)
{
select_lex.context.table_list=
select_lex.context.first_name_resolution_table= first->next_local;
- select_lex.table_list.first= (byte*) (first->next_local);
+ select_lex.table_list.first= (uchar*) (first->next_local);
select_lex.table_list.elements--; //safety
first->next_local= 0;
/*
@@ -2101,7 +2686,7 @@ void st_lex::link_first_table_back(TABLE_LIST *first,
{
first->next_local= (TABLE_LIST*) select_lex.table_list.first;
select_lex.context.table_list= first;
- select_lex.table_list.first= (byte*) first;
+ select_lex.table_list.first= (uchar*) first;
select_lex.table_list.elements++; //safety
}
}
@@ -2289,8 +2874,8 @@ void st_select_lex::fix_prepare_information(THD *thd, Item **conds,
SYNOPSIS
set_index_hint_type()
- type the kind of hints to be added from now on.
- clause the clause to use for hints to be added from now on.
+ type_arg The kind of hints to be added from now on.
+ clause The clause to use for hints to be added from now on.
DESCRIPTION
Used in filling up the tagged hints list.
@@ -2299,10 +2884,10 @@ void st_select_lex::fix_prepare_information(THD *thd, Item **conds,
Then the context variable index_hint_type can be reset to the
next hint type.
*/
-void st_select_lex::set_index_hint_type(enum index_hint_type type,
+void st_select_lex::set_index_hint_type(enum index_hint_type type_arg,
index_clause_map clause)
{
- current_index_hint_type= type;
+ current_index_hint_type= type_arg;
current_index_hint_clause= clause;
}
@@ -2317,7 +2902,7 @@ void st_select_lex::set_index_hint_type(enum index_hint_type type,
void st_select_lex::alloc_index_hints (THD *thd)
{
- index_hints= new (thd->mem_root) List<index_hint>();
+ index_hints= new (thd->mem_root) List<Index_hint>();
}
@@ -2338,7 +2923,26 @@ void st_select_lex::alloc_index_hints (THD *thd)
bool st_select_lex::add_index_hint (THD *thd, char *str, uint length)
{
return index_hints->push_front (new (thd->mem_root)
- index_hint(current_index_hint_type,
+ Index_hint(current_index_hint_type,
current_index_hint_clause,
str, length));
}
+
+/**
+ A routine used by the parser to decide whether we are specifying a full
+ partitioning or if only partitions to add or to split.
+
+ @note This needs to be outside of WITH_PARTITION_STORAGE_ENGINE since it
+ is used from the sql parser that doesn't have any ifdef's
+
+ @retval TRUE Yes, it is part of a management partition command
+ @retval FALSE No, not a management partition command
+*/
+
+bool st_lex::is_partition_management() const
+{
+ return (sql_command == SQLCOM_ALTER_TABLE &&
+ (alter_info.flags == ALTER_ADD_PARTITION ||
+ alter_info.flags == ALTER_REORGANIZE_PARTITION));
+}
+
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 3e436b5ac43..b92f2df3e31 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.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 */
+/**
+ @defgroup Semantic_Analysis Semantic Analysis
+*/
/* YACC and LEX Definitions */
@@ -112,7 +115,8 @@ enum enum_sql_command {
SQLCOM_SHOW_CONTRIBUTORS,
SQLCOM_CREATE_SERVER, SQLCOM_DROP_SERVER, SQLCOM_ALTER_SERVER,
SQLCOM_CREATE_EVENT, SQLCOM_ALTER_EVENT, SQLCOM_DROP_EVENT,
- SQLCOM_SHOW_CREATE_EVENT, SQLCOM_SHOW_EVENTS,
+ SQLCOM_SHOW_CREATE_EVENT, SQLCOM_SHOW_EVENTS,
+ SQLCOM_SHOW_CREATE_TRIGGER,
SQLCOM_SHOW_PROFILE, SQLCOM_SHOW_PROFILES,
/*
@@ -225,7 +229,7 @@ enum tablespace_op_type
Keep in sync with index_hint_type.
*/
extern const char * index_hint_type_name[];
-typedef byte index_clause_map;
+typedef uchar index_clause_map;
/*
Bits in index_clause_map : one for each possible FOR clause in
@@ -239,7 +243,7 @@ typedef byte index_clause_map;
INDEX_HINT_MASK_ORDER)
/* Single element of an USE/FORCE/IGNORE INDEX list specified as a SQL hint */
-class index_hint : public Sql_alloc
+class Index_hint : public Sql_alloc
{
public:
/* The type of the hint : USE/FORCE/IGNORE */
@@ -252,7 +256,7 @@ public:
*/
LEX_STRING key_name;
- index_hint (enum index_hint_type type_arg, index_clause_map clause_arg,
+ Index_hint (enum index_hint_type type_arg, index_clause_map clause_arg,
char *str, uint length) :
type(type_arg), clause(clause_arg)
{
@@ -413,7 +417,7 @@ public:
static void *operator new(size_t size)
{
- return (void*) sql_alloc((uint) size);
+ return sql_alloc(size);
}
static void *operator new(size_t size, MEM_ROOT *mem_root)
{ return (void*) alloc_root(mem_root, (uint) size); }
@@ -444,7 +448,7 @@ public:
LEX_STRING *alias,
ulong table_options,
thr_lock_type flags= TL_UNLOCK,
- List<index_hint> *hints= 0,
+ List<Index_hint> *hints= 0,
LEX_STRING *option= 0);
virtual void set_lock_for_tables(thr_lock_type lock_type) {}
@@ -547,7 +551,7 @@ public:
void set_thd(THD *thd_arg) { thd= thd_arg; }
inline bool is_union ();
- friend void lex_start(THD *thd, const char *buf, uint length);
+ friend void lex_start(THD *thd);
friend int subselect_union_engine::exec();
List<Item> *get_unit_column_types();
@@ -596,7 +600,6 @@ public:
const char *type; /* type of select for EXPLAIN */
SQL_LIST order_list; /* ORDER clause */
- List<List_item> expr_list;
SQL_LIST *gorder_list;
Item *select_limit, *offset_limit; /* LIMIT clause parameters */
// Arrays of pointers to top elements of all_fields list
@@ -609,7 +612,8 @@ public:
*/
uint select_n_having_items;
uint cond_count; /* number of arguments of and/or/xor in where/having/on */
- uint between_count; /* number of between predicates in where/having/on */
+ uint between_count; /* number of between predicates in where/having/on */
+ uint max_equal_elems; /* maximal number of elements in multiple equalities */
/*
Number of fields used in select list or where clause of current select
and all inner subselects.
@@ -722,7 +726,7 @@ public:
LEX_STRING *alias,
ulong table_options,
thr_lock_type flags= TL_UNLOCK,
- List<index_hint> *hints= 0,
+ List<Index_hint> *hints= 0,
LEX_STRING *option= 0);
TABLE_LIST* get_table_list();
bool init_nested_join(THD *thd);
@@ -737,7 +741,7 @@ public:
{
order_list.elements= 0;
order_list.first= 0;
- order_list.next= (byte**) &order_list.first;
+ order_list.next= (uchar**) &order_list.first;
}
/*
This method created for reiniting LEX in mysql_admin_table() and can be
@@ -748,7 +752,7 @@ public:
void cut_subtree() { slave= 0; }
bool test_limit();
- friend void lex_start(THD *thd, const char *buf, uint length);
+ friend void lex_start(THD *thd);
st_select_lex() : n_sum_items(0), n_child_sum_items(0) {}
void make_empty_select()
{
@@ -782,9 +786,9 @@ public:
/* make a list to hold index hints */
void alloc_index_hints (THD *thd);
/* read and clear the index hints */
- List<index_hint>* pop_index_hints(void)
+ List<Index_hint>* pop_index_hints(void)
{
- List<index_hint> *hints= index_hints;
+ List<Index_hint> *hints= index_hints;
index_hints= NULL;
return hints;
}
@@ -796,7 +800,7 @@ private:
enum index_hint_type current_index_hint_type;
index_clause_map current_index_hint_clause;
/* a list of USE/FORCE/IGNORE INDEX */
- List<index_hint> *index_hints;
+ List<Index_hint> *index_hints;
};
typedef class st_select_lex SELECT_LEX;
@@ -834,26 +838,67 @@ inline bool st_select_lex_unit::is_union ()
#define ALTER_REMOVE_PARTITIONING (1L << 25)
#define ALTER_FOREIGN_KEY (1L << 26)
-typedef struct st_alter_info
+enum enum_alter_table_change_level
+{
+ ALTER_TABLE_METADATA_ONLY= 0,
+ ALTER_TABLE_DATA_CHANGED= 1,
+ ALTER_TABLE_INDEX_CHANGED= 2
+};
+
+/**
+ @brief Parsing data for CREATE or ALTER TABLE.
+
+ This structure contains a list of columns or indexes to be created,
+ altered or dropped.
+*/
+
+class Alter_info
{
- List<Alter_drop> drop_list;
- List<Alter_column> alter_list;
- uint flags;
- enum enum_enable_or_disable keys_onoff;
- enum tablespace_op_type tablespace_op;
- List<char> partition_names;
- uint no_parts;
-
- st_alter_info(){clear();}
- void clear()
+public:
+ List<Alter_drop> drop_list;
+ List<Alter_column> alter_list;
+ List<Key> key_list;
+ List<Create_field> create_list;
+ uint flags;
+ enum enum_enable_or_disable keys_onoff;
+ enum tablespace_op_type tablespace_op;
+ List<char> partition_names;
+ uint no_parts;
+ enum_alter_table_change_level change_level;
+ Create_field *datetime_field;
+ bool error_if_not_empty;
+
+
+ Alter_info() :
+ flags(0),
+ keys_onoff(LEAVE_AS_IS),
+ tablespace_op(NO_TABLESPACE_OP),
+ no_parts(0),
+ change_level(ALTER_TABLE_METADATA_ONLY),
+ datetime_field(NULL),
+ error_if_not_empty(FALSE)
+ {}
+
+ void reset()
{
+ drop_list.empty();
+ alter_list.empty();
+ key_list.empty();
+ create_list.empty();
+ flags= 0;
keys_onoff= LEAVE_AS_IS;
tablespace_op= NO_TABLESPACE_OP;
no_parts= 0;
partition_names.empty();
+ change_level= ALTER_TABLE_METADATA_ONLY;
+ datetime_field= 0;
+ error_if_not_empty= FALSE;
}
- void reset(){drop_list.empty();alter_list.empty();clear();}
-} ALTER_INFO;
+ Alter_info(const Alter_info &rhs, MEM_ROOT *mem_root);
+private:
+ Alter_info &operator=(const Alter_info &rhs); // not implemented
+ Alter_info(const Alter_info &rhs); // not implemented
+};
struct st_sp_chistics
{
@@ -917,18 +962,10 @@ public:
in which it was right after query parsing.
*/
SQL_LIST sroutines_list;
- byte **sroutines_list_own_last;
+ uchar **sroutines_list_own_last;
uint sroutines_list_own_elements;
/*
- Tells if the parsing stage detected that some items require row-based
- binlogging to give a reliable binlog/replication, or if we will use
- stored functions or triggers which themselves need require row-based
- binlogging.
- */
- bool binlog_row_based_if_mixed;
-
- /*
These constructor and destructor serve for creation/destruction
of Query_tables_list instances which are used as backup storage.
*/
@@ -975,6 +1012,48 @@ public:
query_tables_own_last= 0;
}
}
+
+ /**
+ Has the parser/scanner detected that this statement is unsafe?
+ */
+ inline bool is_stmt_unsafe() const {
+ return binlog_stmt_flags & (1U << BINLOG_STMT_FLAG_UNSAFE);
+ }
+
+ /**
+ Flag the current (top-level) statement as unsafe.
+
+ The flag will be reset after the statement has finished.
+
+ */
+ inline void set_stmt_unsafe() {
+ binlog_stmt_flags|= (1U << BINLOG_STMT_FLAG_UNSAFE);
+ }
+
+ inline void clear_stmt_unsafe() {
+ binlog_stmt_flags&= ~(1U << BINLOG_STMT_FLAG_UNSAFE);
+ }
+
+ /**
+ true if the parsed tree contains references to stored procedures
+ or functions, false otherwise
+ */
+ bool uses_stored_routines() const
+ { return sroutines_list.elements != 0; }
+
+private:
+ enum enum_binlog_stmt_flag {
+ BINLOG_STMT_FLAG_UNSAFE,
+ BINLOG_STMT_FLAG_COUNT
+ };
+
+ /*
+ Tells if the parsing stage detected properties of the statement,
+ for example: that some items require row-based binlogging to give
+ a reliable binlog/replication, or if we will use stored functions
+ or triggers which themselves need require row-based binlogging.
+ */
+ uint32 binlog_stmt_flags;
};
@@ -995,32 +1074,424 @@ struct st_parsing_options
};
+/**
+ The state of the lexical parser, when parsing comments.
+*/
+enum enum_comment_state
+{
+ /**
+ Not parsing comments.
+ */
+ NO_COMMENT,
+ /**
+ Parsing comments that need to be preserved.
+ Typically, these are user comments '/' '*' ... '*' '/'.
+ */
+ PRESERVE_COMMENT,
+ /**
+ Parsing comments that need to be discarded.
+ Typically, these are special comments '/' '*' '!' ... '*' '/',
+ or '/' '*' '!' 'M' 'M' 'm' 'm' 'm' ... '*' '/', where the comment
+ markers should not be expanded.
+ */
+ DISCARD_COMMENT
+};
+
+
+/**
+ @brief This class represents the character input stream consumed during
+ lexical analysis.
+
+ In addition to consuming the input stream, this class performs some
+ comment pre processing, by filtering out out of bound special text
+ from the query input stream.
+ Two buffers, with pointers inside each buffers, are maintained in
+ parallel. The 'raw' buffer is the original query text, which may
+ contain out-of-bound comments. The 'cpp' (for comments pre processor)
+ is the pre-processed buffer that contains only the query text that
+ should be seen once out-of-bound data is removed.
+*/
+
+class Lex_input_stream
+{
+public:
+ Lex_input_stream(THD *thd, const char* buff, unsigned int length);
+ ~Lex_input_stream();
+
+ /**
+ Set the echo mode.
+
+ When echo is true, characters parsed from the raw input stream are
+ preserved. When false, characters parsed are silently ignored.
+ @param echo the echo mode.
+ */
+ void set_echo(bool echo)
+ {
+ m_echo= echo;
+ }
+
+ /**
+ Skip binary from the input stream.
+ @param n number of bytes to accept.
+ */
+ void skip_binary(int n)
+ {
+ if (m_echo)
+ {
+ memcpy(m_cpp_ptr, m_ptr, n);
+ m_cpp_ptr += n;
+ }
+ m_ptr += n;
+ }
+
+ /**
+ Get a character, and advance in the stream.
+ @return the next character to parse.
+ */
+ char yyGet()
+ {
+ char c= *m_ptr++;
+ if (m_echo)
+ *m_cpp_ptr++ = c;
+ return c;
+ }
+
+ /**
+ Get the last character accepted.
+ @return the last character accepted.
+ */
+ char yyGetLast()
+ {
+ return m_ptr[-1];
+ }
+
+ /**
+ Look at the next character to parse, but do not accept it.
+ */
+ char yyPeek()
+ {
+ return m_ptr[0];
+ }
+
+ /**
+ Look ahead at some character to parse.
+ @param n offset of the character to look up
+ */
+ char yyPeekn(int n)
+ {
+ return m_ptr[n];
+ }
+
+ /**
+ Cancel the effect of the last yyGet() or yySkip().
+ Note that the echo mode should not change between calls to yyGet / yySkip
+ and yyUnget. The caller is responsible for ensuring that.
+ */
+ void yyUnget()
+ {
+ m_ptr--;
+ if (m_echo)
+ m_cpp_ptr--;
+ }
+
+ /**
+ Accept a character, by advancing the input stream.
+ */
+ void yySkip()
+ {
+ if (m_echo)
+ *m_cpp_ptr++ = *m_ptr++;
+ else
+ m_ptr++;
+ }
+
+ /**
+ Accept multiple characters at once.
+ @param n the number of characters to accept.
+ */
+ void yySkipn(int n)
+ {
+ if (m_echo)
+ {
+ memcpy(m_cpp_ptr, m_ptr, n);
+ m_cpp_ptr += n;
+ }
+ m_ptr += n;
+ }
+
+ /**
+ End of file indicator for the query text to parse.
+ @return true if there are no more characters to parse
+ */
+ bool eof()
+ {
+ return (m_ptr >= m_end_of_query);
+ }
+
+ /**
+ End of file indicator for the query text to parse.
+ @param n number of characters expected
+ @return true if there are less than n characters to parse
+ */
+ bool eof(int n)
+ {
+ return ((m_ptr + n) >= m_end_of_query);
+ }
+
+ /** Get the raw query buffer. */
+ const char *get_buf()
+ {
+ return m_buf;
+ }
+
+ /** Get the pre-processed query buffer. */
+ const char *get_cpp_buf()
+ {
+ return m_cpp_buf;
+ }
+
+ /** Get the end of the raw query buffer. */
+ const char *get_end_of_query()
+ {
+ return m_end_of_query;
+ }
+
+ /** Mark the stream position as the start of a new token. */
+ void start_token()
+ {
+ m_tok_start_prev= m_tok_start;
+ m_tok_start= m_ptr;
+ m_tok_end= m_ptr;
+
+ m_cpp_tok_start_prev= m_cpp_tok_start;
+ m_cpp_tok_start= m_cpp_ptr;
+ m_cpp_tok_end= m_cpp_ptr;
+ }
+
+ /**
+ Adjust the starting position of the current token.
+ This is used to compensate for starting whitespace.
+ */
+ void restart_token()
+ {
+ m_tok_start= m_ptr;
+ m_cpp_tok_start= m_cpp_ptr;
+ }
+
+ /** Get the token start position, in the raw buffer. */
+ const char *get_tok_start()
+ {
+ return m_tok_start;
+ }
+
+ /** Get the token start position, in the pre-processed buffer. */
+ const char *get_cpp_tok_start()
+ {
+ return m_cpp_tok_start;
+ }
+
+ /** Get the token end position, in the raw buffer. */
+ const char *get_tok_end()
+ {
+ return m_tok_end;
+ }
+
+ /** Get the token end position, in the pre-processed buffer. */
+ const char *get_cpp_tok_end()
+ {
+ return m_cpp_tok_end;
+ }
+
+ /** Get the previous token start position, in the raw buffer. */
+ const char *get_tok_start_prev()
+ {
+ return m_tok_start_prev;
+ }
+
+ /** Get the current stream pointer, in the raw buffer. */
+ const char *get_ptr()
+ {
+ return m_ptr;
+ }
+
+ /** Get the current stream pointer, in the pre-processed buffer. */
+ const char *get_cpp_ptr()
+ {
+ return m_cpp_ptr;
+ }
+
+ /** Get the length of the current token, in the raw buffer. */
+ uint yyLength()
+ {
+ /*
+ The assumption is that the lexical analyser is always 1 character ahead,
+ which the -1 account for.
+ */
+ DBUG_ASSERT(m_ptr > m_tok_start);
+ return (uint) ((m_ptr - m_tok_start) - 1);
+ }
+
+ /** Get the utf8-body string. */
+ const char *get_body_utf8_str()
+ {
+ return m_body_utf8;
+ }
+
+ /** Get the utf8-body length. */
+ uint get_body_utf8_length()
+ {
+ return m_body_utf8_ptr - m_body_utf8;
+ }
+
+ void body_utf8_start(THD *thd, const char *begin_ptr);
+ void body_utf8_append(const char *ptr);
+ void body_utf8_append(const char *ptr, const char *end_ptr);
+ void body_utf8_append_literal(THD *thd,
+ const LEX_STRING *txt,
+ CHARSET_INFO *txt_cs,
+ const char *end_ptr);
+
+ /** Current thread. */
+ THD *m_thd;
+
+ /** Current line number. */
+ uint yylineno;
+
+ /** Length of the last token parsed. */
+ uint yytoklen;
+
+ /** Interface with bison, value of the last token parsed. */
+ LEX_YYSTYPE yylval;
+
+private:
+ /** Pointer to the current position in the raw input stream. */
+ const char *m_ptr;
+
+ /** Starting position of the last token parsed, in the raw buffer. */
+ const char *m_tok_start;
+
+ /** Ending position of the previous token parsed, in the raw buffer. */
+ const char *m_tok_end;
+
+ /** End of the query text in the input stream, in the raw buffer. */
+ const char *m_end_of_query;
+
+ /** Starting position of the previous token parsed, in the raw buffer. */
+ const char *m_tok_start_prev;
+
+ /** Begining of the query text in the input stream, in the raw buffer. */
+ const char *m_buf;
+
+ /** Length of the raw buffer. */
+ uint m_buf_length;
+
+ /** Echo the parsed stream to the pre-processed buffer. */
+ bool m_echo;
+
+ /** Pre-processed buffer. */
+ char *m_cpp_buf;
+
+ /** Pointer to the current position in the pre-processed input stream. */
+ char *m_cpp_ptr;
+
+ /**
+ Starting position of the last token parsed,
+ in the pre-processed buffer.
+ */
+ const char *m_cpp_tok_start;
+
+ /**
+ Starting position of the previous token parsed,
+ in the pre-procedded buffer.
+ */
+ const char *m_cpp_tok_start_prev;
+
+ /**
+ Ending position of the previous token parsed,
+ in the pre-processed buffer.
+ */
+ const char *m_cpp_tok_end;
+
+ /** UTF8-body buffer created during parsing. */
+ char *m_body_utf8;
+
+ /** Pointer to the current position in the UTF8-body buffer. */
+ char *m_body_utf8_ptr;
+
+ /**
+ Position in the pre-processed buffer. The query from m_cpp_buf to
+ m_cpp_utf_processed_ptr is converted to UTF8-body.
+ */
+ const char *m_cpp_utf8_processed_ptr;
+
+public:
+
+ /** Current state of the lexical analyser. */
+ enum my_lex_states next_state;
+
+ /**
+ Position of ';' in the stream, to delimit multiple queries.
+ This delimiter is in the raw buffer.
+ */
+ const char *found_semicolon;
+
+ /** Token character bitmaps, to detect 7bit strings. */
+ uchar tok_bitmap;
+
+ /** SQL_MODE = IGNORE_SPACE. */
+ bool ignore_space;
+
+ /**
+ TRUE if we're parsing a prepared statement: in this mode
+ we should allow placeholders and disallow multi-statements.
+ */
+ bool stmt_prepare_mode;
+
+ /** State of the lexical analyser for comments. */
+ enum_comment_state in_comment;
+
+ /**
+ Starting position of the TEXT_STRING or IDENT in the pre-processed
+ buffer.
+
+ NOTE: this member must be used within MYSQLlex() function only.
+ */
+ const char *m_cpp_text_start;
+
+ /**
+ Ending position of the TEXT_STRING or IDENT in the pre-processed
+ buffer.
+
+ NOTE: this member must be used within MYSQLlex() function only.
+ */
+ const char *m_cpp_text_end;
+
+ /**
+ Character set specified by the character-set-introducer.
+
+ NOTE: this member must be used within MYSQLlex() function only.
+ */
+ CHARSET_INFO *m_underscore_cs;
+};
+
+
/* The state of the lex parsing. This is saved in the THD struct */
typedef struct st_lex : public Query_tables_list
{
- uint yylineno,yytoklen; /* Simulate lex */
- LEX_YYSTYPE yylval;
SELECT_LEX_UNIT unit; /* most upper unit */
SELECT_LEX select_lex; /* first SELECT_LEX */
/* current SELECT_LEX in parsing */
SELECT_LEX *current_select;
/* list of all SELECT_LEX */
SELECT_LEX *all_selects_list;
- const char *buf; /* The beginning of string, used by SPs */
- const char *ptr,*tok_start,*tok_end,*end_of_query;
-
- /* The value of tok_start as they were one call of MYSQLlex before */
- const char *tok_start_prev;
char *length,*dec,*change;
LEX_STRING name;
- Table_ident *like_name;
char *help_arg;
char *backup_dir; /* For RESTORE/BACKUP */
char* to_log; /* For PURGE MASTER LOGS TO */
char* x509_subject,*x509_issuer,*ssl_cipher;
- char* found_semicolon; /* For multi queries - next query */
String *wild;
sql_exchange *exchange;
select_result *result;
@@ -1028,13 +1499,28 @@ typedef struct st_lex : public Query_tables_list
LEX_STRING comment, ident;
LEX_USER *grant_user;
XID *xid;
- gptr yacc_yyss,yacc_yyvs;
+ uchar* yacc_yyss, *yacc_yyvs;
THD *thd;
- CHARSET_INFO *charset, *underscore_charset;
+
+ /* maintain a list of used plugins for this LEX */
+ DYNAMIC_ARRAY plugins;
+ plugin_ref plugins_static_buffer[INITIAL_LEX_PLUGIN_LIST_SIZE];
+
+ CHARSET_INFO *charset;
+ bool text_string_is_7bit;
/* store original leaf_tables for INSERT SELECT and PS/SP */
TABLE_LIST *leaf_tables_insert;
- /* Position (first character index) of SELECT of CREATE VIEW statement */
- uint create_view_select_start;
+
+ /** Start of SELECT of CREATE VIEW statement */
+ const char* create_view_select_start;
+ /** End of SELECT of CREATE VIEW statement */
+ const char* create_view_select_end;
+
+ /** Start of 'ON table', in trigger statements. */
+ const char* raw_trg_on_table_name_begin;
+ /** End of 'ON table', in trigger statements. */
+ const char* raw_trg_on_table_name_end;
+
/* Partition info structure filled in by PARTITION BY parse part */
partition_info *part_info;
@@ -1044,13 +1530,11 @@ typedef struct st_lex : public Query_tables_list
*/
LEX_USER *definer;
- List<key_part_spec> col_list;
- List<key_part_spec> ref_list;
+ List<Key_part_spec> col_list;
+ List<Key_part_spec> ref_list;
List<String> interval_list;
List<LEX_USER> users_list;
List<LEX_COLUMN> columns;
- List<Key> key_list;
- List<create_field> create_list;
List<Item> *insert_list,field_list,value_list,update_list;
List<List_item> many_values;
List<set_var_base> var_list;
@@ -1073,7 +1557,7 @@ typedef struct st_lex : public Query_tables_list
List<LEX_STRING> db_list;
SQL_LIST proc_list, auxiliary_table_list, save_list;
- create_field *last_field;
+ Create_field *last_field;
Item_sum *in_sum_func;
udf_func udf;
HA_CHECK_OPT check_opt; // check/repair options
@@ -1104,7 +1588,6 @@ typedef struct st_lex : public Query_tables_list
thr_lock_type lock_option;
enum SSL_type ssl_type; /* defined in violite.h */
- enum my_lex_states next_state;
enum enum_duplicates duplicates;
enum enum_tx_isolation tx_isolation;
enum enum_ha_read_modes ha_read_mode;
@@ -1139,7 +1622,9 @@ typedef struct st_lex : public Query_tables_list
uint8 create_view_algorithm;
uint8 create_view_check;
bool drop_if_exists, drop_temporary, local_file, one_shot_set;
- bool in_comment, ignore_space, verbose, no_write_to_binlog;
+
+ bool verbose, no_write_to_binlog;
+
bool tx_chain, tx_release;
/*
Special JOIN::prepare mode: changing of query is prohibited.
@@ -1149,15 +1634,10 @@ typedef struct st_lex : public Query_tables_list
to an .frm file. We need this definition to stay untouched.
*/
bool view_prepare_mode;
- /*
- TRUE if we're parsing a prepared statement: in this mode
- we should allow placeholders and disallow multistatements.
- */
- bool stmt_prepare_mode;
bool safe_to_cache_query;
bool subqueries, ignore;
st_parsing_options parsing_options;
- ALTER_INFO alter_info;
+ Alter_info alter_info;
/* Prepared statements SQL syntax:*/
LEX_STRING prepared_stmt_name; /* Statement name (in all queries) */
/*
@@ -1208,15 +1688,20 @@ typedef struct st_lex : public Query_tables_list
- CREATE FUNCTION (points to "FUNCTION" or "AGGREGATE");
This pointer is required to add possibly omitted DEFINER-clause to the
- DDL-statement before dumping it to the binlog.
+ DDL-statement before dumping it to the binlog.
*/
const char *stmt_definition_begin;
+ const char *stmt_definition_end;
+
/*
Pointers to part of LOAD DATA statement that should be rewritten
during replication ("LOCAL 'filename' REPLACE INTO" part).
*/
- const char *fname_start, *fname_end;
+ const char *fname_start;
+ const char *fname_end;
+
+ LEX_STRING view_body_utf8;
/*
Reference to a struct that contains information in various commands
@@ -1231,6 +1716,8 @@ typedef struct st_lex : public Query_tables_list
virtual ~st_lex()
{
destroy_query_tables_list();
+ plugin_unlock_list(NULL, (plugin_ref *)plugins.buffer, plugins.elements);
+ delete_dynamic(&plugins);
}
inline void uncacheable(uint8 cause)
@@ -1252,6 +1739,8 @@ typedef struct st_lex : public Query_tables_list
un->uncacheable|= cause;
}
}
+ void set_trg_event_type_for_tables();
+
TABLE_LIST *unlink_first_table(bool *link_to_local);
void link_first_table_back(TABLE_LIST *first, bool link_to_local);
void first_lists_tables_same();
@@ -1261,7 +1750,7 @@ typedef struct st_lex : public Query_tables_list
bool can_not_use_merged();
bool only_view_structure();
bool need_correct_ident();
- uint8 get_effective_with_check(st_table_list *view);
+ uint8 get_effective_with_check(TABLE_LIST *view);
/*
Is this update command where 'WHITH CHECK OPTION' clause is important
@@ -1300,6 +1789,8 @@ typedef struct st_lex : public Query_tables_list
context_stack.pop();
}
+ bool copy_db_to(char **p_db, size_t *p_db_length) const;
+
Name_resolution_context *current_context()
{
return context_stack.head();
@@ -1313,13 +1804,36 @@ typedef struct st_lex : public Query_tables_list
void restore_backup_query_tables_list(Query_tables_list *backup);
bool table_or_sp_used();
+ bool is_partition_management() const;
+
+ /**
+ @brief check if the statement is a single-level join
+ @return result of the check
+ @retval TRUE The statement doesn't contain subqueries, unions and
+ stored procedure calls.
+ @retval FALSE There are subqueries, UNIONs or stored procedure calls.
+ */
+ bool is_single_level_stmt()
+ {
+ /*
+ This check exploits the fact that the last added to all_select_list is
+ on its top. So select_lex (as the first added) will be at the tail
+ of the list.
+ */
+ if (&select_lex == all_selects_list && !sroutines.records)
+ {
+ DBUG_ASSERT(!all_selects_list->next_select_in_list());
+ return TRUE;
+ }
+ return FALSE;
+ }
} LEX;
struct st_lex_local: public st_lex
{
static void *operator new(size_t size)
{
- return (void*) sql_alloc((uint) size);
+ return sql_alloc(size);
}
static void *operator new(size_t size, MEM_ROOT *mem_root)
{
@@ -1333,11 +1847,16 @@ struct st_lex_local: public st_lex
extern void lex_init(void);
extern void lex_free(void);
-extern void lex_start(THD *thd, const char *buf, uint length);
+extern void lex_start(THD *thd);
extern void lex_end(LEX *lex);
extern int MYSQLlex(void *arg, void *yythd);
-extern const char *skip_rear_comments(const char *ubegin, const char *uend);
+
+extern void trim_whitespace(CHARSET_INFO *cs, LEX_STRING *str);
extern bool is_lex_native_function(const LEX_STRING *name);
+/**
+ @} (End of group Semantic_Analysis)
+*/
+
#endif /* MYSQL_SERVER */
diff --git a/sql/sql_list.cc b/sql/sql_list.cc
index 01ab9b91424..49b649133d0 100644
--- a/sql/sql_list.cc
+++ b/sql/sql_list.cc
@@ -36,3 +36,37 @@ void free_list(I_List <i_string> *list)
while ((tmp= list->get()))
delete tmp;
}
+
+
+base_list::base_list(const base_list &rhs, MEM_ROOT *mem_root)
+{
+ if (rhs.elements)
+ {
+ /*
+ It's okay to allocate an array of nodes at once: we never
+ call a destructor for list_node objects anyway.
+ */
+ first= (list_node*) alloc_root(mem_root,
+ sizeof(list_node) * rhs.elements);
+ if (first)
+ {
+ elements= rhs.elements;
+ list_node *dst= first;
+ list_node *src= rhs.first;
+ for (; dst < first + elements - 1; dst++, src= src->next)
+ {
+ dst->info= src->info;
+ dst->next= dst + 1;
+ }
+ /* Copy the last node */
+ dst->info= src->info;
+ dst->next= &end_of_list;
+ /* Setup 'last' member */
+ last= &dst->next;
+ return;
+ }
+ }
+ elements= 0;
+ first= &end_of_list;
+ last= &first;
+}
diff --git a/sql/sql_list.h b/sql/sql_list.h
index ba61a931e04..2e068f7f961 100644
--- a/sql/sql_list.h
+++ b/sql/sql_list.h
@@ -1,3 +1,5 @@
+#ifndef INCLUDES_MYSQL_SQL_LIST_H
+#define INCLUDES_MYSQL_SQL_LIST_H
/* Copyright (C) 2000-2003 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -25,16 +27,16 @@ class Sql_alloc
public:
static void *operator new(size_t size) throw ()
{
- return (void*) sql_alloc((uint) size);
+ return sql_alloc(size);
}
static void *operator new[](size_t size)
{
- return (void*) sql_alloc((uint) size);
+ return sql_alloc(size);
}
static void *operator new[](size_t size, MEM_ROOT *mem_root) throw ()
- { return (void*) alloc_root(mem_root, (uint) size); }
+ { return alloc_root(mem_root, size); }
static void *operator new(size_t size, MEM_ROOT *mem_root) throw ()
- { return (void*) alloc_root(mem_root, (uint) size); }
+ { return alloc_root(mem_root, size); }
static void operator delete(void *ptr, size_t size) { TRASH(ptr, size); }
static void operator delete(void *ptr, MEM_ROOT *mem_root)
{ /* never called */ }
@@ -63,21 +65,24 @@ public:
pointer.
*/
-class list_node :public Sql_alloc
+
+/**
+ list_node - a node of a single-linked list.
+ @note We never call a destructor for instances of this class.
+*/
+
+struct list_node :public Sql_alloc
{
-public:
list_node *next;
void *info;
list_node(void *info_par,list_node *next_par)
:next(next_par),info(info_par)
- {}
+ {}
list_node() /* For end_of_list */
- {
- info=0;
- next= this;
- }
- friend class base_list;
- friend class base_list_iterator;
+ {
+ info= 0;
+ next= this;
+ }
};
@@ -93,12 +98,28 @@ public:
inline void empty() { elements=0; first= &end_of_list; last=&first;}
inline base_list() { empty(); }
+ /**
+ This is a shallow copy constructor that implicitly passes the ownership
+ from the source list to the new instance. The old instance is not
+ updated, so both objects end up sharing the same nodes. If one of
+ the instances then adds or removes a node, the other becomes out of
+ sync ('last' pointer), while still operational. Some old code uses and
+ relies on this behaviour. This logic is quite tricky: please do not use
+ it in any new code.
+ */
inline base_list(const base_list &tmp) :Sql_alloc()
{
elements= tmp.elements;
first= tmp.first;
last= elements ? tmp.last : &first;
}
+ /**
+ Construct a deep copy of the argument in memory root mem_root.
+ The elements themselves are copied by pointer. If you also
+ need to copy elements by value, you should employ
+ list_copy_and_replace_each_value after creating a copy.
+ */
+ base_list(const base_list &rhs, MEM_ROOT *mem_root);
inline base_list(bool error) { }
inline bool push_back(void *info)
{
@@ -185,6 +206,15 @@ public:
elements+= list->elements;
}
}
+ /**
+ Swap two lists.
+ */
+ inline void swap(base_list &rhs)
+ {
+ swap_variables(list_node *, first, rhs.first);
+ swap_variables(list_node **, last, rhs.last);
+ swap_variables(uint, elements, rhs.elements);
+ }
inline list_node* last_node() { return *last; }
inline list_node* first_node() { return first;}
inline void *head() { return first->info; }
@@ -349,6 +379,8 @@ template <class T> class List :public base_list
public:
inline List() :base_list() {}
inline List(const List<T> &tmp) :base_list(tmp) {}
+ inline List(const List<T> &tmp, MEM_ROOT *mem_root) :
+ base_list(tmp, mem_root) {}
inline bool push_back(T *a) { return base_list::push_back(a); }
inline bool push_back(T *a, MEM_ROOT *mem_root)
{ return base_list::push_back(a, mem_root); }
@@ -424,7 +456,7 @@ struct ilink
}
static void operator delete(void* ptr_arg, size_t size)
{
- my_free((gptr)ptr_arg, MYF(MY_WME|MY_ALLOW_ZERO_PTR));
+ my_free((uchar*)ptr_arg, MYF(MY_WME|MY_ALLOW_ZERO_PTR));
}
inline ilink()
@@ -547,3 +579,32 @@ public:
I_List_iterator(I_List<T> &a) : base_ilist_iterator(a) {}
inline T* operator++(int) { return (T*) base_ilist_iterator::next(); }
};
+
+/**
+ Make a deep copy of each list element.
+
+ @note A template function and not a template method of class List
+ is employed because of explicit template instantiation:
+ in server code there are explicit instantiations of List<T> and
+ an explicit instantiation of a template requires that any method
+ of the instantiated class used in the template can be resolved.
+ Evidently not all template arguments have clone() method with
+ the right signature.
+
+ @return You must query the error state in THD for out-of-memory
+ situation after calling this function.
+*/
+
+template <typename T>
+inline
+void
+list_copy_and_replace_each_value(List<T> &list, MEM_ROOT *mem_root)
+{
+ /* Make a deep copy of each element */
+ List_iterator<T> it(list);
+ T *el;
+ while ((el= it++))
+ it.replace(el->clone(mem_root));
+}
+
+#endif // INCLUDES_MYSQL_SQL_LIST_H
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 71cc4c0507c..8bbe1e413b3 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -25,7 +25,7 @@
class READ_INFO {
File file;
- byte *buffer, /* Buffer for read text */
+ uchar *buffer, /* Buffer for read text */
*end_of_buff; /* Data in bufferts ends here */
uint buff_length, /* Length of buffert */
max_length; /* Max length of row */
@@ -40,7 +40,7 @@ class READ_INFO {
public:
bool error,line_cuted,found_null,enclosed;
- byte *row_start, /* Found row starts here */
+ uchar *row_start, /* Found row starts here */
*row_end; /* Found row ends here */
CHARSET_INFO *read_charset;
@@ -376,7 +376,6 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
table->file->ha_start_bulk_insert((ha_rows) 0);
table->copy_blobs=1;
- thd->no_trans_update.stmt= FALSE;
thd->abort_on_warning= (!ignore &&
(thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES |
@@ -410,12 +409,8 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
ha_autocommit_...
*/
query_cache_invalidate3(thd, table_list, 0);
-
if (error)
{
- if (transactional_table)
- ha_autocommit_or_rollback(thd,error);
-
if (read_file_from_client)
while (!read_info.next_line())
;
@@ -463,14 +458,17 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
}
}
#endif /*!EMBEDDED_LIBRARY*/
+ if (transactional_table)
+ ha_autocommit_or_rollback(thd,error);
+
error= -1; // Error on read
goto err;
}
sprintf(name, ER(ER_LOAD_INFO), (ulong) info.records, (ulong) info.deleted,
(ulong) (info.records - info.copied), (ulong) thd->cuted_fields);
- if (!transactional_table)
- thd->no_trans_update.all= TRUE;
+ if (thd->transaction.stmt.modified_non_trans_table)
+ thd->transaction.all.modified_non_trans_table= TRUE;
#ifndef EMBEDDED_LIBRARY
if (mysql_bin_log.is_open())
{
@@ -506,6 +504,8 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
/* ok to client sent only after binlog write and engine commit */
send_ok(thd, info.copied + info.deleted, 0L, name);
err:
+ DBUG_ASSERT(transactional_table || !(info.copied || info.deleted) ||
+ thd->transaction.stmt.modified_non_trans_table);
table->file->ha_release_auto_increment();
if (thd->lock)
{
@@ -552,7 +552,7 @@ read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
Item_field *sql_field;
TABLE *table= table_list->table;
ulonglong id;
- bool no_trans_update_stmt, err;
+ bool err;
DBUG_ENTER("read_fixed_length");
id= 0;
@@ -576,11 +576,10 @@ read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
continue;
}
it.rewind();
- byte *pos=read_info.row_start;
+ uchar *pos=read_info.row_start;
#ifdef HAVE_purify
read_info.row_end[0]=0;
#endif
- no_trans_update_stmt= !table->file->has_transactions();
restore_record(table, s->default_values);
/*
@@ -605,11 +604,13 @@ read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_TOO_FEW_RECORDS,
ER(ER_WARN_TOO_FEW_RECORDS), thd->row_count);
+ if (!field->maybe_null() && field->type() == FIELD_TYPE_TIMESTAMP)
+ ((Field_timestamp*) field)->set_time();
}
else
{
uint length;
- byte save_chr;
+ uchar save_chr;
if ((length=(uint) (read_info.row_end-pos)) >
field->field_length)
length=field->field_length;
@@ -648,7 +649,6 @@ read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
table->auto_increment_field_not_null= FALSE;
if (err)
DBUG_RETURN(1);
- thd->no_trans_update.stmt= no_trans_update_stmt;
/*
We don't need to reset auto-increment field since we are restoring
@@ -683,12 +683,11 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
TABLE *table= table_list->table;
uint enclosed_length;
ulonglong id;
- bool no_trans_update_stmt, err;
+ bool err;
DBUG_ENTER("read_sep_field");
enclosed_length=enclosed.length();
id= 0;
- no_trans_update_stmt= !table->file->has_transactions();
for (;;it.rewind())
{
@@ -703,7 +702,7 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
while ((item= it++))
{
uint length;
- byte *pos;
+ uchar *pos;
if (read_info.read_field())
break;
@@ -782,6 +781,8 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
thd->row_count);
DBUG_RETURN(1);
}
+ if (!field->maybe_null() && field->type() == FIELD_TYPE_TIMESTAMP)
+ ((Field_timestamp*) field)->set_time();
/*
QQ: We probably should not throw warning for each field.
But how about intention to always have the same number
@@ -823,7 +824,6 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
We don't need to reset auto-increment field since we are restoring
its default value at the beginning of each loop iteration.
*/
- thd->no_trans_update.stmt= no_trans_update_stmt;
if (read_info.next_line()) // Skip to next line
break;
if (read_info.line_cuted)
@@ -847,6 +847,7 @@ continue_loop:;
char
READ_INFO::unescape(char chr)
{
+ /* keep this switch synchornous with the ESCAPE_CHARS macro */
switch(chr) {
case 'n': return '\n';
case 't': return '\t';
@@ -910,7 +911,7 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, CHARSET_INFO *cs,
set_if_bigger(length,line_start.length());
stack=stack_pos=(int*) sql_alloc(sizeof(int)*length);
- if (!(buffer=(byte*) my_malloc(buff_length+1,MYF(0))))
+ if (!(buffer=(uchar*) my_malloc(buff_length+1,MYF(0))))
error=1; /* purecov: inspected */
else
{
@@ -920,7 +921,7 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, CHARSET_INFO *cs,
(is_fifo ? READ_FIFO : READ_CACHE),0L,1,
MYF(MY_WME)))
{
- my_free((gptr) buffer,MYF(0)); /* purecov: inspected */
+ my_free((uchar*) buffer,MYF(0)); /* purecov: inspected */
error=1;
}
else
@@ -951,7 +952,7 @@ READ_INFO::~READ_INFO()
{
if (need_end_io_cache)
::end_io_cache(&cache);
- my_free((gptr) buffer,MYF(0));
+ my_free((uchar*) buffer,MYF(0));
error=1;
}
}
@@ -984,7 +985,7 @@ inline int READ_INFO::terminator(char *ptr,uint length)
int READ_INFO::read_field()
{
int chr,found_enclosed_char;
- byte *to,*new_buffer;
+ uchar *to,*new_buffer;
found_null=0;
if (found_end_of_line)
@@ -1007,7 +1008,7 @@ int READ_INFO::read_field()
if (chr == enclosed_char)
{
found_enclosed_char=enclosed_char;
- *to++=(byte) chr; // If error
+ *to++=(uchar) chr; // If error
}
else
{
@@ -1049,7 +1050,7 @@ int READ_INFO::read_field()
{
if ((chr=GET) == my_b_EOF)
{
- *to++= (byte) escape_char;
+ *to++= (uchar) escape_char;
goto found_eof;
}
/*
@@ -1061,7 +1062,7 @@ int READ_INFO::read_field()
*/
if (escape_char != enclosed_char || chr == escape_char)
{
- *to++ = (byte) unescape((char) chr);
+ *to++ = (uchar) unescape((char) chr);
continue;
}
PUSH(chr);
@@ -1086,7 +1087,7 @@ int READ_INFO::read_field()
{
if ((chr=GET) == found_enclosed_char)
{ // Remove dupplicated
- *to++ = (byte) chr;
+ *to++ = (uchar) chr;
continue;
}
// End of enclosed field if followed by field_term or line_term
@@ -1126,12 +1127,12 @@ int READ_INFO::read_field()
return 0;
}
}
- *to++ = (byte) chr;
+ *to++ = (uchar) chr;
}
/*
** We come here if buffer is too small. Enlarge it and continue
*/
- if (!(new_buffer=(byte*) my_realloc((char*) buffer,buff_length+1+IO_SIZE,
+ if (!(new_buffer=(uchar*) my_realloc((char*) buffer,buff_length+1+IO_SIZE,
MYF(MY_WME))))
return (error=1);
to=new_buffer + (to-buffer);
@@ -1166,7 +1167,7 @@ found_eof:
int READ_INFO::read_fixed_length()
{
int chr;
- byte *to;
+ uchar *to;
if (found_end_of_line)
return 1; // One have to call next_line
@@ -1186,10 +1187,10 @@ int READ_INFO::read_fixed_length()
{
if ((chr=GET) == my_b_EOF)
{
- *to++= (byte) escape_char;
+ *to++= (uchar) escape_char;
goto found_eof;
}
- *to++ =(byte) unescape((char) chr);
+ *to++ =(uchar) unescape((char) chr);
continue;
}
if (chr == line_term_char)
@@ -1201,7 +1202,7 @@ int READ_INFO::read_fixed_length()
return 0;
}
}
- *to++ = (byte) chr;
+ *to++ = (uchar) chr;
}
row_end=to; // Found full line
return 0;
@@ -1232,7 +1233,7 @@ int READ_INFO::next_line()
#ifdef USE_MB
if (my_mbcharlen(read_charset, chr) > 1)
{
- for (int i=1;
+ for (uint i=1;
chr != my_b_EOF && i<my_mbcharlen(read_charset, chr);
i++)
chr = GET;
diff --git a/sql/sql_manager.cc b/sql/sql_manager.cc
index b0ca7667a62..171ab55145a 100644
--- a/sql/sql_manager.cc
+++ b/sql/sql_manager.cc
@@ -118,7 +118,7 @@ pthread_handler_t handle_manager(void *arg __attribute__((unused)))
{
struct handler_cb *next= cb->next;
cb->action();
- my_free((gptr)cb, MYF(0));
+ my_free((uchar*)cb, MYF(0));
cb= next;
}
diff --git a/sql/sql_map.cc b/sql/sql_map.cc
index 36a47f1aefc..55f9b08d3fe 100644
--- a/sql/sql_map.cc
+++ b/sql/sql_map.cc
@@ -24,7 +24,7 @@
#include <sys/mman.h>
#endif
-mapped_files::mapped_files(const my_string filename,byte *magic,uint magic_length)
+mapped_files::mapped_files(const char * filename,uchar *magic,uint magic_length)
{
#ifdef HAVE_MMAP
name=my_strdup(filename,MYF(0));
@@ -37,18 +37,18 @@ mapped_files::mapped_files(const my_string filename,byte *magic,uint magic_lengt
struct stat stat_buf;
if (!fstat(file,&stat_buf))
{
- if (!(map=(byte*) my_mmap(0,(size=(ulong) stat_buf.st_size),PROT_READ,
+ if (!(map=(uchar*) my_mmap(0,(size_t)(size= stat_buf.st_size),PROT_READ,
MAP_SHARED | MAP_NORESERVE,file,
0L)))
{
error=errno;
- my_error(ER_NO_FILE_MAPPING, MYF(0), (my_string) name, error);
+ my_error(ER_NO_FILE_MAPPING, MYF(0), (char *) name, error);
}
}
if (map && memcmp(map,magic,magic_length))
{
my_error(ER_WRONG_MAGIC, MYF(0), name);
- VOID(my_munmap(map,size));
+ VOID(my_munmap((char*) map,(size_t)size));
map=0;
}
if (!map)
@@ -66,7 +66,7 @@ mapped_files::~mapped_files()
#ifdef HAVE_MMAP
if (file >= 0)
{
- VOID(my_munmap(map,size));
+ VOID(my_munmap((char*) map,(size_t)size));
VOID(my_close(file,MYF(0)));
file= -1; map=0;
}
@@ -82,7 +82,7 @@ static I_List<mapped_files> maps_in_use;
** else alloc new object
*/
-mapped_files *map_file(const my_string name,byte *magic,uint magic_length)
+mapped_files *map_file(const char * name,uchar *magic,uint magic_length)
{
#ifdef HAVE_MMAP
VOID(pthread_mutex_lock(&LOCK_mapped_file));
diff --git a/sql/sql_map.h b/sql/sql_map.h
index d8eb64995aa..a1efba0da6f 100644
--- a/sql/sql_map.h
+++ b/sql/sql_map.h
@@ -21,11 +21,11 @@
#endif
class mapped_files;
-mapped_files *map_file(const my_string name,byte *magic,uint magic_length);
+mapped_files *map_file(const char * name,uchar *magic,uint magic_length);
void unmap_file(mapped_files *map);
class mapped_files :public ilink {
- byte *map;
+ uchar *map;
ha_rows size;
char *name; // name of mapped file
File file; // >= 0 if open
@@ -33,11 +33,11 @@ class mapped_files :public ilink {
uint use_count;
public:
- mapped_files(const my_string name,byte *magic,uint magic_length);
+ mapped_files(const char * name,uchar *magic,uint magic_length);
~mapped_files();
friend class mapped_file;
- friend mapped_files *map_file(const my_string name,byte *magic,
+ friend mapped_files *map_file(const char * name,uchar *magic,
uint magic_length);
friend void unmap_file(mapped_files *map);
};
@@ -47,7 +47,7 @@ class mapped_file
{
mapped_files *file;
public:
- mapped_file(const my_string name,byte *magic,uint magic_length)
+ mapped_file(const char * name,uchar *magic,uint magic_length)
{
file=map_file(name,magic,magic_length); /* old or new map */
}
@@ -55,7 +55,7 @@ public:
{
unmap_file(file); /* free map */
}
- byte *map()
+ uchar *map()
{
return file->map;
}
diff --git a/sql/sql_olap.cc b/sql/sql_olap.cc
index 818825d566b..dccfcbaf8ac 100644
--- a/sql/sql_olap.cc
+++ b/sql/sql_olap.cc
@@ -54,8 +54,8 @@ static int make_new_olap_select(LEX *lex, SELECT_LEX *select_lex, List<Item> new
new_select->linkage=OLAP_TYPE;
new_select->olap=NON_EXISTING_ONE;
new_select->group_list.elements=0;
- new_select->group_list.first=(byte *)0;
- new_select->group_list.next=(byte **)&new_select->group_list.first;
+ new_select->group_list.first=(uchar *)0;
+ new_select->group_list.next=(uchar **)&new_select->group_list.first;
List<Item> privlist;
List_iterator<Item> list_it(select_lex->item_list);
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 989904f5cbd..ced6c4babf5 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -28,6 +28,11 @@
#include "events.h"
#include "sql_trigger.h"
+/**
+ @defgroup Runtime_Environment Runtime Environment
+ @{
+*/
+
/* Used in error handling only */
#define SP_TYPE_STRING(LP) \
((LP)->sphead->m_type == TYPE_ENUM_FUNCTION ? "FUNCTION" : "PROCEDURE")
@@ -39,41 +44,42 @@
"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
const LEX_STRING command_name[]={
- C_STRING_WITH_LEN("Sleep"),
- C_STRING_WITH_LEN("Quit"),
- C_STRING_WITH_LEN("Init DB"),
- C_STRING_WITH_LEN("Query"),
- C_STRING_WITH_LEN("Field List"),
- C_STRING_WITH_LEN("Create DB"),
- C_STRING_WITH_LEN("Drop DB"),
- C_STRING_WITH_LEN("Refresh"),
- C_STRING_WITH_LEN("Shutdown"),
- C_STRING_WITH_LEN("Statistics"),
- C_STRING_WITH_LEN("Processlist"),
- C_STRING_WITH_LEN("Connect"),
- C_STRING_WITH_LEN("Kill"),
- C_STRING_WITH_LEN("Debug"),
- C_STRING_WITH_LEN("Ping"),
- C_STRING_WITH_LEN("Time"),
- C_STRING_WITH_LEN("Delayed insert"),
- C_STRING_WITH_LEN("Change user"),
- C_STRING_WITH_LEN("Binlog Dump"),
- C_STRING_WITH_LEN("Table Dump"),
- C_STRING_WITH_LEN("Connect Out"),
- C_STRING_WITH_LEN("Register Slave"),
- C_STRING_WITH_LEN("Prepare"),
- C_STRING_WITH_LEN("Execute"),
- C_STRING_WITH_LEN("Long Data"),
- C_STRING_WITH_LEN("Close stmt"),
- C_STRING_WITH_LEN("Reset stmt"),
- C_STRING_WITH_LEN("Set option"),
- C_STRING_WITH_LEN("Fetch"),
- C_STRING_WITH_LEN("Daemon"),
- C_STRING_WITH_LEN("Error") // Last command number
+ { C_STRING_WITH_LEN("Sleep") },
+ { C_STRING_WITH_LEN("Quit") },
+ { C_STRING_WITH_LEN("Init DB") },
+ { C_STRING_WITH_LEN("Query") },
+ { C_STRING_WITH_LEN("Field List") },
+ { C_STRING_WITH_LEN("Create DB") },
+ { C_STRING_WITH_LEN("Drop DB") },
+ { C_STRING_WITH_LEN("Refresh") },
+ { C_STRING_WITH_LEN("Shutdown") },
+ { C_STRING_WITH_LEN("Statistics") },
+ { C_STRING_WITH_LEN("Processlist") },
+ { C_STRING_WITH_LEN("Connect") },
+ { C_STRING_WITH_LEN("Kill") },
+ { C_STRING_WITH_LEN("Debug") },
+ { C_STRING_WITH_LEN("Ping") },
+ { C_STRING_WITH_LEN("Time") },
+ { C_STRING_WITH_LEN("Delayed insert") },
+ { C_STRING_WITH_LEN("Change user") },
+ { C_STRING_WITH_LEN("Binlog Dump") },
+ { C_STRING_WITH_LEN("Table Dump") },
+ { C_STRING_WITH_LEN("Connect Out") },
+ { C_STRING_WITH_LEN("Register Slave") },
+ { C_STRING_WITH_LEN("Prepare") },
+ { C_STRING_WITH_LEN("Execute") },
+ { C_STRING_WITH_LEN("Long Data") },
+ { C_STRING_WITH_LEN("Close stmt") },
+ { C_STRING_WITH_LEN("Reset stmt") },
+ { C_STRING_WITH_LEN("Set option") },
+ { C_STRING_WITH_LEN("Fetch") },
+ { C_STRING_WITH_LEN("Daemon") },
+ { C_STRING_WITH_LEN("Error") } // Last command number
};
const char *xa_state_names[]={
@@ -119,7 +125,7 @@ bool end_active_trans(THD *thd)
error=1;
}
thd->options&= ~(OPTION_BEGIN | OPTION_KEEP_LOG);
- thd->no_trans_update.all= FALSE;
+ thd->transaction.all.modified_non_trans_table= FALSE;
DBUG_RETURN(error);
}
@@ -192,12 +198,12 @@ uint sql_command_flags[SQLCOM_END+1];
void init_update_queries(void)
{
- bzero((gptr) &sql_command_flags, sizeof(sql_command_flags));
+ bzero((uchar*) &sql_command_flags, sizeof(sql_command_flags));
sql_command_flags[SQLCOM_CREATE_TABLE]= CF_CHANGES_DATA;
sql_command_flags[SQLCOM_CREATE_INDEX]= CF_CHANGES_DATA;
- sql_command_flags[SQLCOM_ALTER_TABLE]= CF_CHANGES_DATA;
- sql_command_flags[SQLCOM_TRUNCATE]= CF_CHANGES_DATA;
+ sql_command_flags[SQLCOM_ALTER_TABLE]= CF_CHANGES_DATA | CF_WRITE_LOGS_COMMAND;
+ sql_command_flags[SQLCOM_TRUNCATE]= CF_CHANGES_DATA | CF_WRITE_LOGS_COMMAND;
sql_command_flags[SQLCOM_DROP_TABLE]= CF_CHANGES_DATA;
sql_command_flags[SQLCOM_LOAD]= CF_CHANGES_DATA;
sql_command_flags[SQLCOM_CREATE_DB]= CF_CHANGES_DATA;
@@ -210,7 +216,7 @@ void init_update_queries(void)
sql_command_flags[SQLCOM_DROP_VIEW]= CF_CHANGES_DATA;
sql_command_flags[SQLCOM_CREATE_EVENT]= CF_CHANGES_DATA;
sql_command_flags[SQLCOM_ALTER_EVENT]= CF_CHANGES_DATA;
- sql_command_flags[SQLCOM_DROP_EVENT]= CF_CHANGES_DATA;
+ sql_command_flags[SQLCOM_DROP_EVENT]= CF_CHANGES_DATA;
sql_command_flags[SQLCOM_UPDATE]= CF_CHANGES_DATA | CF_HAS_ROW_COUNT;
sql_command_flags[SQLCOM_UPDATE_MULTI]= CF_CHANGES_DATA | CF_HAS_ROW_COUNT;
@@ -222,7 +228,6 @@ void init_update_queries(void)
sql_command_flags[SQLCOM_REPLACE_SELECT]= CF_CHANGES_DATA | CF_HAS_ROW_COUNT;
sql_command_flags[SQLCOM_SHOW_STATUS_PROC]= CF_STATUS_COMMAND;
- sql_command_flags[SQLCOM_SHOW_STATUS_FUNC]= CF_STATUS_COMMAND;
sql_command_flags[SQLCOM_SHOW_STATUS]= CF_STATUS_COMMAND;
sql_command_flags[SQLCOM_SHOW_DATABASES]= CF_STATUS_COMMAND;
sql_command_flags[SQLCOM_SHOW_TRIGGERS]= CF_STATUS_COMMAND;
@@ -234,10 +239,36 @@ void init_update_queries(void)
sql_command_flags[SQLCOM_SHOW_VARIABLES]= CF_STATUS_COMMAND;
sql_command_flags[SQLCOM_SHOW_CHARSETS]= CF_STATUS_COMMAND;
sql_command_flags[SQLCOM_SHOW_COLLATIONS]= CF_STATUS_COMMAND;
- sql_command_flags[SQLCOM_SHOW_STATUS_PROC]= CF_STATUS_COMMAND;
-
- sql_command_flags[SQLCOM_SHOW_TABLES]= (CF_STATUS_COMMAND |
- CF_SHOW_TABLE_COMMAND);
+ sql_command_flags[SQLCOM_SHOW_NEW_MASTER]= CF_STATUS_COMMAND;
+ 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_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;
+ sql_command_flags[SQLCOM_SHOW_PROCESSLIST]= CF_STATUS_COMMAND;
+ sql_command_flags[SQLCOM_SHOW_GRANTS]= CF_STATUS_COMMAND;
+ sql_command_flags[SQLCOM_SHOW_CREATE_DB]= CF_STATUS_COMMAND;
+ sql_command_flags[SQLCOM_SHOW_CREATE]= CF_STATUS_COMMAND;
+ sql_command_flags[SQLCOM_SHOW_MASTER_STAT]= CF_STATUS_COMMAND;
+ sql_command_flags[SQLCOM_SHOW_SLAVE_STAT]= CF_STATUS_COMMAND;
+ sql_command_flags[SQLCOM_SHOW_CREATE_PROC]= CF_STATUS_COMMAND;
+ sql_command_flags[SQLCOM_SHOW_CREATE_FUNC]= CF_STATUS_COMMAND;
+ sql_command_flags[SQLCOM_SHOW_CREATE_TRIGGER]= CF_STATUS_COMMAND;
+ sql_command_flags[SQLCOM_SHOW_STATUS_FUNC]= CF_STATUS_COMMAND;
+ sql_command_flags[SQLCOM_SHOW_PROC_CODE]= CF_STATUS_COMMAND;
+ sql_command_flags[SQLCOM_SHOW_FUNC_CODE]= CF_STATUS_COMMAND;
+ sql_command_flags[SQLCOM_SHOW_CREATE_EVENT]= CF_STATUS_COMMAND;
+
+ sql_command_flags[SQLCOM_SHOW_TABLES]= (CF_STATUS_COMMAND |
+ CF_SHOW_TABLE_COMMAND);
sql_command_flags[SQLCOM_SHOW_TABLE_STATUS]= (CF_STATUS_COMMAND |
CF_SHOW_TABLE_COMMAND);
@@ -249,6 +280,14 @@ void init_update_queries(void)
*/
sql_command_flags[SQLCOM_CALL]= CF_HAS_ROW_COUNT;
sql_command_flags[SQLCOM_EXECUTE]= CF_HAS_ROW_COUNT;
+
+ /*
+ The following admin table operations are allowed
+ on log tables.
+ */
+ sql_command_flags[SQLCOM_REPAIR]= CF_WRITE_LOGS_COMMAND;
+ sql_command_flags[SQLCOM_OPTIMIZE]= CF_WRITE_LOGS_COMMAND;
+ sql_command_flags[SQLCOM_ANALYZE]= CF_WRITE_LOGS_COMMAND;
}
@@ -258,6 +297,16 @@ bool is_update_query(enum enum_sql_command command)
return (sql_command_flags[command] & CF_CHANGES_DATA) != 0;
}
+/**
+ Check if a sql command is allowed to write to log tables.
+ @param command The SQL command
+ @return true if writing is allowed
+*/
+bool is_log_table_write_query(enum enum_sql_command command)
+{
+ DBUG_ASSERT(command >= 0 && command <= SQLCOM_END);
+ return (sql_command_flags[command] & CF_WRITE_LOGS_COMMAND) != 0;
+}
void execute_init_command(THD *thd, sys_var_str *init_command_var,
rw_lock_t *var_mutex)
@@ -300,6 +349,7 @@ pthread_handler_t handle_bootstrap(void *arg)
THD *thd=(THD*) arg;
FILE *file=bootstrap_file;
char *buff;
+ const char* found_semicolon= NULL;
/* The following must be called before DBUG_ENTER */
thd->thread_stack= (char*) &thd;
@@ -370,8 +420,9 @@ pthread_handler_t handle_bootstrap(void *arg)
continue;
thd->query_length=length;
- thd->query= thd->memdup_w_gap(buff, length+1,
- thd->db_length+1+QUERY_CACHE_FLAGS_SIZE);
+ thd->query= (char*) thd->memdup_w_gap(buff, length+1,
+ thd->db_length+1+
+ QUERY_CACHE_FLAGS_SIZE);
thd->query[length] = '\0';
DBUG_PRINT("query",("%-.4096s",thd->query));
/*
@@ -380,7 +431,7 @@ pthread_handler_t handle_bootstrap(void *arg)
*/
thd->query_id=next_query_id();
thd->set_time();
- mysql_parse(thd,thd->query,length);
+ mysql_parse(thd, thd->query, length, & found_semicolon);
close_thread_tables(thd); // Free tables
if (thd->is_fatal_error)
@@ -491,7 +542,7 @@ int mysql_table_dump(THD *thd, LEX_STRING *db, char *tbl_name)
if (lower_case_table_names)
my_casedn_str(files_charset_info, tbl_name);
- if (!(table=open_ltable(thd, table_list, TL_READ_NO_INSERT)))
+ if (!(table=open_ltable(thd, table_list, TL_READ_NO_INSERT, 0)))
DBUG_RETURN(1);
if (check_one_table_access(thd, SELECT_ACL, table_list))
@@ -551,7 +602,7 @@ int end_trans(THD *thd, enum enum_mysql_completiontype completion)
thd->server_status&= ~SERVER_STATUS_IN_TRANS;
res= ha_commit(thd);
thd->options&= ~(OPTION_BEGIN | OPTION_KEEP_LOG);
- thd->no_trans_update.all= FALSE;
+ thd->transaction.all.modified_non_trans_table= FALSE;
break;
case COMMIT_RELEASE:
do_release= 1; /* fall through */
@@ -569,7 +620,7 @@ int end_trans(THD *thd, enum enum_mysql_completiontype completion)
if (ha_rollback(thd))
res= -1;
thd->options&= ~(OPTION_BEGIN | OPTION_KEEP_LOG);
- thd->no_trans_update.all= FALSE;
+ thd->transaction.all.modified_non_trans_table= FALSE;
if (!res && (completion == ROLLBACK_AND_CHAIN))
res= begin_trans(thd);
break;
@@ -620,7 +671,7 @@ bool do_command(THD *thd)
the client, the connection is closed or "net_wait_timeout"
number of seconds has passed
*/
- net_set_read_timeout(net, thd->variables.net_wait_timeout);
+ my_net_set_read_timeout(net, thd->variables.net_wait_timeout);
thd->clear_error(); // Clear error message
@@ -652,7 +703,7 @@ bool do_command(THD *thd)
}
/* Restore read timeout value */
- net_set_read_timeout(net, thd->variables.net_read_timeout);
+ my_net_set_read_timeout(net, thd->variables.net_read_timeout);
/*
packet_length contains length of data, as it was stored in packet
@@ -720,8 +771,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
case COM_INIT_DB:
{
LEX_STRING tmp;
- statistic_increment(thd->status_var.com_stat[SQLCOM_CHANGE_DB],
- &LOCK_status);
+ status_var_increment(thd->status_var.com_stat[SQLCOM_CHANGE_DB]);
thd->convert_string(&tmp, system_charset_info,
packet, packet_length-1, thd->charset());
if (!mysql_change_db(thd, &tmp, FALSE))
@@ -756,15 +806,15 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
break;
}
- statistic_increment(thd->status_var.com_other, &LOCK_status);
+ status_var_increment(thd->status_var.com_other);
thd->enable_slow_log= opt_log_slow_admin_statements;
- db.str= thd->alloc(db_len + tbl_len + 2);
- db.length= db_len;
+ db.str= (char*) thd->alloc(db_len + tbl_len + 2);
if (!db.str)
{
my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
break;
}
+ db.length= db_len;
tbl_name= strmake(db.str, packet + 1, db_len)+1;
strmake(tbl_name, packet + db_len + 2, tbl_len);
mysql_table_dump(thd, &db, tbl_name);
@@ -772,7 +822,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
}
case COM_CHANGE_USER:
{
- statistic_increment(thd->status_var.com_other, &LOCK_status);
+ status_var_increment(thd->status_var.com_other);
char *user= (char*) packet, *packet_end= packet+ packet_length;
char *passwd= strend(user)+1;
@@ -783,12 +833,15 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
Old clients send null-terminated string ('\0' for empty string) for
password. New clients send the size (1 byte) + string (not null
terminated, so also '\0' for empty string).
+
+ Cast *passwd to an unsigned char, so that it doesn't extend the sign
+ for *passwd > 127 and become 2**32-127 after casting to uint.
*/
char db_buff[NAME_LEN+1]; // buffer to store db in utf8
char *db= passwd;
char *save_db;
uint passwd_len= (thd->client_capabilities & CLIENT_SECURE_CONNECTION ?
- *passwd++ : strlen(passwd));
+ (uchar)(*passwd++) : strlen(passwd));
uint dummy_errors, save_db_length, db_length;
int res;
Security_context save_security_ctx= *thd->security_ctx;
@@ -852,8 +905,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
if (save_user_connect)
decrease_user_connections(save_user_connect);
#endif /* NO_EMBEDDED_ACCESS_CHECKS */
- x_free((gptr) save_db);
- x_free((gptr) save_security_ctx.user);
+ x_free((uchar*) save_db);
+ x_free((uchar*) save_security_ctx.user);
}
break;
}
@@ -894,17 +947,19 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
char *packet_end= thd->query + thd->query_length;
/* 'b' stands for 'buffer' parameter', special for 'my_snprintf' */
const char *format= "%.*b";
+ const char* found_semicolon= NULL;
+
general_log_print(thd, command, format, thd->query_length, thd->query);
DBUG_PRINT("query",("%-.4096s",thd->query));
if (!(specialflag & SPECIAL_NO_PRIOR))
my_pthread_setprio(pthread_self(),QUERY_PRIOR);
- mysql_parse(thd,thd->query, thd->query_length);
+ mysql_parse(thd, thd->query, thd->query_length, & found_semicolon);
- while (!thd->killed && thd->lex->found_semicolon && !thd->net.report_error)
+ while (!thd->killed && found_semicolon && !thd->net.report_error)
{
- char *next_packet= thd->lex->found_semicolon;
+ char *next_packet= (char*) found_semicolon;
net->no_send_error= 0;
/*
Multiple queries exits, execute them individually
@@ -929,7 +984,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd->set_time(); /* Reset the query start time. */
/* TODO: set thd->lex->sql_command to SQLCOM_END here */
VOID(pthread_mutex_unlock(&LOCK_thread_count));
- mysql_parse(thd, next_packet, length);
+ mysql_parse(thd, next_packet, length, & found_semicolon);
}
if (!(specialflag & SPECIAL_NO_PRIOR))
@@ -948,15 +1003,13 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
/* Locked closure of all tables */
TABLE_LIST table_list;
LEX_STRING conv_name;
- uint dummy;
/* used as fields initializator */
- lex_start(thd, 0, 0);
+ lex_start(thd);
- statistic_increment(thd->status_var.com_stat[SQLCOM_SHOW_FIELDS],
- &LOCK_status);
+ status_var_increment(thd->status_var.com_stat[SQLCOM_SHOW_FIELDS]);
bzero((char*) &table_list,sizeof(table_list));
- if (thd->copy_db_to(&table_list.db, &dummy))
+ if (thd->copy_db_to(&table_list.db, &table_list.db_length))
break;
/*
We have name + wildcard in packet, separated by endzero
@@ -976,7 +1029,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
}
thd->query_length= (uint) (packet_end - packet); // Don't count end \0
- if (!(thd->query=fields=thd->memdup(packet,thd->query_length+1)))
+ if (!(thd->query=fields= (char*) thd->memdup(packet,thd->query_length+1)))
break;
general_log_print(thd, command, "%s %s", table_list.table_name, fields);
if (lower_case_table_names)
@@ -985,15 +1038,17 @@ 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 (grant_option &&
- check_grant(thd, SELECT_ACL, &table_list, 2, UINT_MAX, 0))
+ if (check_grant(thd, SELECT_ACL, &table_list, 2, UINT_MAX, 0))
break;
/* init structures for VIEW processing */
table_list.select_lex= &(thd->lex->select_lex);
- mysql_init_query(thd, "", 0);
+
+ lex_start(thd);
+ mysql_reset_thd_for_next_command(thd);
+
thd->lex->
- select_lex.table_list.link_in_list((byte*) &table_list,
- (byte**) &table_list.next_local);
+ select_lex.table_list.link_in_list((uchar*) &table_list,
+ (uchar**) &table_list.next_local);
thd->lex->add_to_query_tables(&table_list);
/* switch on VIEW optimisation: do not fill temporary tables */
@@ -1017,10 +1072,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
LEX_STRING db, alias;
HA_CREATE_INFO create_info;
- statistic_increment(thd->status_var.com_stat[SQLCOM_CREATE_DB],
- &LOCK_status);
- if (thd->LEX_STRING_make(&db, packet, packet_length -1) ||
- thd->LEX_STRING_make(&alias, db.str, db.length) ||
+ status_var_increment(thd->status_var.com_stat[SQLCOM_CREATE_DB]);
+ if (thd->make_lex_string(&db, packet, packet_length - 1, FALSE) ||
+ thd->make_lex_string(&alias, db.str, db.length, FALSE) ||
check_db_name(&db))
{
my_error(ER_WRONG_DB_NAME, MYF(0), db.str ? db.str : "NULL");
@@ -1037,11 +1091,10 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
}
case COM_DROP_DB: // QQ: To be removed
{
- statistic_increment(thd->status_var.com_stat[SQLCOM_DROP_DB],
- &LOCK_status);
+ status_var_increment(thd->status_var.com_stat[SQLCOM_DROP_DB]);
LEX_STRING db;
- if (thd->LEX_STRING_make(&db, packet, packet_length - 1) ||
+ if (thd->make_lex_string(&db, packet, packet_length - 1, FALSE) ||
check_db_name(&db))
{
my_error(ER_WRONG_DB_NAME, MYF(0), db.str ? db.str : "NULL");
@@ -1067,7 +1120,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
ushort flags;
uint32 slave_server_id;
- statistic_increment(thd->status_var.com_other,&LOCK_status);
+ status_var_increment(thd->status_var.com_other);
thd->enable_slow_log= opt_log_slow_admin_statements;
if (check_global_access(thd, REPL_SLAVE_ACL))
break;
@@ -1093,8 +1146,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
case COM_REFRESH:
{
bool not_used;
- statistic_increment(thd->status_var.com_stat[SQLCOM_FLUSH],
- &LOCK_status);
+ status_var_increment(thd->status_var.com_stat[SQLCOM_FLUSH]);
ulong options= (ulong) (uchar) packet[0];
if (check_global_access(thd,RELOAD_ACL))
break;
@@ -1106,7 +1158,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
#ifndef EMBEDDED_LIBRARY
case COM_SHUTDOWN:
{
- statistic_increment(thd->status_var.com_other, &LOCK_status);
+ status_var_increment(thd->status_var.com_other);
if (check_global_access(thd,SHUTDOWN_ACL))
break; /* purecov: inspected */
/*
@@ -1158,8 +1210,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
#endif
general_log_print(thd, command, NullS);
- statistic_increment(thd->status_var.com_stat[SQLCOM_SHOW_STATUS],
- &LOCK_status);
+ status_var_increment(thd->status_var.com_stat[SQLCOM_SHOW_STATUS]);
calc_sum_of_all_status(&current_global_status_var);
if (!(uptime= (ulong) (thd->start_time - server_start_time)))
queries_per_second1000= 0;
@@ -1189,18 +1240,17 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
}
#endif
#ifndef EMBEDDED_LIBRARY
- VOID(my_net_write(net, buff, length));
+ VOID(my_net_write(net, (uchar*) buff, length));
VOID(net_flush(net));
#endif
break;
}
case COM_PING:
- statistic_increment(thd->status_var.com_other, &LOCK_status);
+ status_var_increment(thd->status_var.com_other);
send_ok(thd); // Tell client we are alive
break;
case COM_PROCESS_INFO:
- statistic_increment(thd->status_var.com_stat[SQLCOM_SHOW_PROCESSLIST],
- &LOCK_status);
+ status_var_increment(thd->status_var.com_stat[SQLCOM_SHOW_PROCESSLIST]);
if (!thd->security_ctx->priv_user[0] &&
check_global_access(thd, PROCESS_ACL))
break;
@@ -1211,15 +1261,14 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
break;
case COM_PROCESS_KILL:
{
- statistic_increment(thd->status_var.com_stat[SQLCOM_KILL], &LOCK_status);
+ status_var_increment(thd->status_var.com_stat[SQLCOM_KILL]);
ulong id=(ulong) uint4korr(packet);
sql_kill(thd,id,false);
break;
}
case COM_SET_OPTION:
{
- statistic_increment(thd->status_var.com_stat[SQLCOM_SET_OPTION],
- &LOCK_status);
+ status_var_increment(thd->status_var.com_stat[SQLCOM_SET_OPTION]);
uint opt_command= uint2korr(packet);
switch (opt_command) {
@@ -1238,7 +1287,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
break;
}
case COM_DEBUG:
- statistic_increment(thd->status_var.com_other, &LOCK_status);
+ status_var_increment(thd->status_var.com_other);
if (check_global_access(thd, SUPER_ACL))
break; /* purecov: inspected */
mysql_print_status();
@@ -1296,7 +1345,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
void log_slow_statement(THD *thd)
{
- time_t start_of_query;
DBUG_ENTER("log_slow_statement");
/*
@@ -1307,26 +1355,26 @@ void log_slow_statement(THD *thd)
if (unlikely(thd->in_sub_stmt))
DBUG_VOID_RETURN; // Don't set time for sub stmt
- start_of_query= thd->start_time;
- thd->end_time(); // Set start time
-
/*
Do not log administrative statements unless the appropriate option is
set; do not log into slow log if reading from backup.
*/
if (thd->enable_slow_log && !thd->user_time)
{
+ ulonglong end_utime_of_query= thd->current_utime();
thd_proc_info(thd, "logging slow query");
- if ((ulong) (thd->start_time - thd->time_after_lock) >
- thd->variables.long_query_time ||
- ((thd->server_status &
- (SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED)) &&
- (specialflag & SPECIAL_LOG_QUERIES_NOT_USING_INDEXES)))
+ if (((end_utime_of_query - thd->utime_after_lock) >
+ thd->variables.long_query_time ||
+ ((thd->server_status &
+ (SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED)) &&
+ opt_log_queries_not_using_indexes &&
+ !(sql_command_flags[thd->lex->sql_command] & CF_STATUS_COMMAND))) &&
+ thd->examined_row_count >= thd->variables.min_examined_row_limit)
{
thd_proc_info(thd, "logging slow query");
thd->status_var.long_query_count++;
- slow_log_print(thd, thd->query, thd->query_length, start_of_query);
+ slow_log_print(thd, thd->query, thd->query_length, end_utime_of_query);
}
}
DBUG_VOID_RETURN;
@@ -1389,9 +1437,9 @@ int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident,
#else
{
LEX_STRING db;
- uint dummy;
+ size_t dummy;
if (lex->select_lex.db == NULL &&
- thd->copy_db_to(&lex->select_lex.db, &dummy))
+ lex->copy_db_to(&lex->select_lex.db, &dummy))
{
DBUG_RETURN(1);
}
@@ -1490,7 +1538,7 @@ bool alloc_query(THD *thd, const char *packet, uint packet_length)
}
/* We must allocate some extra memory for query cache */
thd->query_length= 0; // Extra safety: Avoid races
- if (!(thd->query= (char*) thd->memdup_w_gap((gptr) (packet),
+ if (!(thd->query= (char*) thd->memdup_w_gap((uchar*) (packet),
packet_length,
thd->db_length+ 1 +
QUERY_CACHE_FLAGS_SIZE)))
@@ -1569,7 +1617,7 @@ bool sp_process_definer(THD *thd)
if (lex->definer == NULL)
DBUG_RETURN(TRUE);
- if (thd->slave_thread)
+ if (thd->slave_thread && lex->sphead)
lex->sphead->m_chistics->suid= SP_IS_NOT_SUID;
}
else
@@ -1684,8 +1732,7 @@ 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->select_lex != lex->all_selects_list ||
- lex->sroutines.records) && !thd->spcont)
+ if ((all_tables || !lex->is_single_level_stmt()) && !thd->spcont)
mysql_reset_errors(thd, 0);
#ifdef HAVE_REPLICATION
@@ -1778,9 +1825,10 @@ mysql_execute_command(THD *thd)
#ifdef HAVE_REPLICATION
} /* endif unlikely slave */
#endif
- statistic_increment(thd->status_var.com_stat[lex->sql_command],
- &LOCK_status);
+ status_var_increment(thd->status_var.com_stat[lex->sql_command]);
+ DBUG_ASSERT(thd->transaction.stmt.modified_non_trans_table == FALSE);
+
switch (lex->sql_command) {
case SQLCOM_SHOW_EVENTS:
if ((res= check_access(thd, EVENT_ACL, thd->lex->select_lex.db, 0, 0, 0,
@@ -1821,6 +1869,7 @@ mysql_execute_command(THD *thd)
case SQLCOM_SHOW_VARIABLES:
case SQLCOM_SHOW_CHARSETS:
case SQLCOM_SHOW_COLLATIONS:
+ case SQLCOM_SHOW_STORAGE_ENGINES:
case SQLCOM_SELECT:
thd->status_var.last_query_cost= 0.0;
if (all_tables)
@@ -1986,7 +2035,7 @@ mysql_execute_command(THD *thd)
goto error; /* purecov: inspected */
thd->enable_slow_log= opt_log_slow_admin_statements;
res = mysql_backup_table(thd, first_table);
- select_lex->table_list.first= (byte*) first_table;
+ select_lex->table_list.first= (uchar*) first_table;
lex->query_tables=all_tables;
break;
}
@@ -1998,7 +2047,7 @@ mysql_execute_command(THD *thd)
goto error; /* purecov: inspected */
thd->enable_slow_log= opt_log_slow_admin_statements;
res = mysql_restore_table(thd, first_table);
- select_lex->table_list.first= (byte*) first_table;
+ select_lex->table_list.first= (uchar*) first_table;
lex->query_tables=all_tables;
break;
}
@@ -2083,12 +2132,10 @@ mysql_execute_command(THD *thd)
&first_table->grant.privilege, 0, 0,
test(first_table->schema_table)))
goto error; /* purecov: inspected */
- if (grant_option)
- {
- /* Check that the first table has CREATE privilege */
- if (check_grant(thd, CREATE_ACL, all_tables, 0, 1, 0))
- goto error;
- }
+ /* Check that the first table has CREATE privilege */
+ if (check_grant(thd, CREATE_ACL, all_tables, 0, 1, 0))
+ goto error;
+
pthread_mutex_lock(&LOCK_active_mi);
/*
fetch_master_table will send the error to the client on failure.
@@ -2120,23 +2167,47 @@ mysql_execute_command(THD *thd)
// Skip first table, which is the table we are creating
TABLE_LIST *create_table= lex->unlink_first_table(&link_to_local);
TABLE_LIST *select_tables= lex->query_tables;
+ /*
+ Code below (especially in mysql_create_table() and select_create
+ methods) may modify HA_CREATE_INFO structure in LEX, so we have to
+ use a copy of this structure to make execution prepared statement-
+ safe. A shallow copy is enough as this code won't modify any memory
+ referenced from this structure.
+ */
+ HA_CREATE_INFO create_info(lex->create_info);
+ /*
+ We need to copy alter_info for the same reasons of re-execution
+ safety, only in case of Alter_info we have to do (almost) a deep
+ copy.
+ */
+ Alter_info alter_info(lex->alter_info, thd->mem_root);
+
+ if (thd->is_fatal_error)
+ {
+ /* If out of memory when creating a copy of alter_info. */
+ res= 1;
+ goto end_with_restore_list;
+ }
if ((res= create_table_precheck(thd, select_tables, create_table)))
goto end_with_restore_list;
+ /* Might have been updated in create_table_precheck */
+ create_info.alias= create_table->alias;
+
#ifndef HAVE_READLINK
- if (lex->create_info.data_file_name)
+ if (create_info.data_file_name)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
"DATA DIRECTORY option ignored");
- if (lex->create_info.index_file_name)
+ if (create_info.index_file_name)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
"INDEX DIRECTORY option ignored");
- lex->create_info.data_file_name=lex->create_info.index_file_name=0;
+ create_info.data_file_name= create_info.index_file_name= NULL;
#else
/* Fix names if symlinked tables */
- if (append_file_to_dir(thd, &lex->create_info.data_file_name,
+ if (append_file_to_dir(thd, &create_info.data_file_name,
create_table->table_name) ||
- append_file_to_dir(thd, &lex->create_info.index_file_name,
+ append_file_to_dir(thd, &create_info.index_file_name,
create_table->table_name))
goto end_with_restore_list;
#endif
@@ -2144,14 +2215,14 @@ mysql_execute_command(THD *thd)
If we are using SET CHARSET without DEFAULT, add an implicit
DEFAULT to not confuse old users. (This may change).
*/
- if ((lex->create_info.used_fields &
+ if ((create_info.used_fields &
(HA_CREATE_USED_DEFAULT_CHARSET | HA_CREATE_USED_CHARSET)) ==
HA_CREATE_USED_CHARSET)
{
- lex->create_info.used_fields&= ~HA_CREATE_USED_CHARSET;
- lex->create_info.used_fields|= HA_CREATE_USED_DEFAULT_CHARSET;
- lex->create_info.default_table_charset= lex->create_info.table_charset;
- lex->create_info.table_charset= 0;
+ create_info.used_fields&= ~HA_CREATE_USED_CHARSET;
+ create_info.used_fields|= HA_CREATE_USED_DEFAULT_CHARSET;
+ create_info.default_table_charset= create_info.table_charset;
+ create_info.table_charset= 0;
}
/*
The create-select command will open and read-lock the select table
@@ -2190,15 +2261,22 @@ mysql_execute_command(THD *thd)
select_lex->options|= SELECT_NO_UNLOCK;
unit->set_limit(select_lex);
- if (!(res= open_and_lock_tables(thd, select_tables)))
+ if (!(create_info.options & HA_LEX_CREATE_TMP_TABLE))
+ {
+ lex->link_first_table_back(create_table, link_to_local);
+ create_table->create= TRUE;
+ }
+
+ if (!(res= open_and_lock_tables(thd, lex->query_tables)))
{
/*
Is table which we are changing used somewhere in other parts
of query
*/
- if (!(lex->create_info.options & HA_LEX_CREATE_TMP_TABLE))
+ if (!(create_info.options & HA_LEX_CREATE_TMP_TABLE))
{
TABLE_LIST *duplicate;
+ create_table= lex->unlink_first_table(&link_to_local);
if ((duplicate= unique_table(thd, create_table, select_tables, 0)))
{
update_non_unique_table_error(create_table, "CREATE", duplicate);
@@ -2207,10 +2285,10 @@ mysql_execute_command(THD *thd)
}
}
/* If we create merge table, we have to test tables in merge, too */
- if (lex->create_info.used_fields & HA_CREATE_USED_UNION)
+ if (create_info.used_fields & HA_CREATE_USED_UNION)
{
TABLE_LIST *tab;
- for (tab= (TABLE_LIST*) lex->create_info.merge_list.first;
+ for (tab= (TABLE_LIST*) create_info.merge_list.first;
tab;
tab= tab->next_local)
{
@@ -2224,13 +2302,17 @@ mysql_execute_command(THD *thd)
}
}
+ /*
+ select_create is currently not re-execution friendly and
+ needs to be created for every execution of a PS/SP.
+ */
if ((result= new select_create(create_table,
- &lex->create_info,
- lex->create_list,
- lex->key_list,
- select_lex->item_list,
- lex->duplicates,
- lex->ignore)))
+ &create_info,
+ &alter_info,
+ select_lex->item_list,
+ lex->duplicates,
+ lex->ignore,
+ select_tables)))
{
/*
CREATE from SELECT give its SELECT_LEX for SELECT,
@@ -2239,26 +2321,25 @@ mysql_execute_command(THD *thd)
res= handle_select(thd, lex, result, 0);
delete result;
}
- /* reset for PS */
- lex->create_list.empty();
- lex->key_list.empty();
}
+ else if (!(create_info.options & HA_LEX_CREATE_TMP_TABLE))
+ create_table= lex->unlink_first_table(&link_to_local);
+
}
else
{
/* So that CREATE TEMPORARY TABLE gets to binlog at commit/rollback */
- if (lex->create_info.options & HA_LEX_CREATE_TMP_TABLE)
+ if (create_info.options & HA_LEX_CREATE_TMP_TABLE)
thd->options|= OPTION_KEEP_LOG;
/* regular create */
- if (lex->like_name)
- res= mysql_create_like_table(thd, create_table, &lex->create_info,
- lex->like_name);
+ if (create_info.options & HA_LEX_CREATE_TABLE_LIKE)
+ res= mysql_create_like_table(thd, create_table, select_tables,
+ &create_info);
else
{
res= mysql_create_table(thd, create_table->db,
- create_table->table_name, &lex->create_info,
- lex->create_list,
- lex->key_list, 0, 0, 1);
+ create_table->table_name, &create_info,
+ &alter_info, 0, 0);
}
if (!res)
send_ok(thd);
@@ -2270,15 +2351,46 @@ end_with_restore_list:
break;
}
case SQLCOM_CREATE_INDEX:
+ /* Fall through */
+ case SQLCOM_DROP_INDEX:
+ /*
+ CREATE INDEX and DROP INDEX are implemented by calling ALTER
+ TABLE with proper arguments.
+
+ In the future ALTER TABLE will notice that the request is to
+ only add indexes and create these one by one for the existing
+ table without having to do a full rebuild.
+ */
+ {
+ /* Prepare stack copies to be re-execution safe */
+ HA_CREATE_INFO create_info;
+ Alter_info alter_info(lex->alter_info, thd->mem_root);
+
+ if (thd->is_fatal_error) /* out of memory creating a copy of alter_info */
+ goto error;
+
DBUG_ASSERT(first_table == all_tables && first_table != 0);
if (check_one_table_access(thd, INDEX_ACL, all_tables))
goto error; /* purecov: inspected */
- thd->enable_slow_log= opt_log_slow_admin_statements;
if (end_active_trans(thd))
goto error;
- res= mysql_create_index(thd, first_table, lex->key_list);
- break;
+ /*
+ Currently CREATE INDEX or DROP INDEX cause a full table rebuild
+ and thus classify as slow administrative statements just like
+ ALTER TABLE.
+ */
+ thd->enable_slow_log= opt_log_slow_admin_statements;
+
+ bzero((char*) &create_info, sizeof(create_info));
+ create_info.db_type= 0;
+ create_info.row_type= ROW_TYPE_NOT_USED;
+ create_info.default_table_charset= thd->variables.collation_database;
+ res= mysql_alter_table(thd, first_table->db, first_table->table_name,
+ &create_info, first_table, &alter_info,
+ 0, (ORDER*) 0, 0);
+ break;
+ }
#ifdef HAVE_REPLICATION
case SQLCOM_SLAVE_START:
{
@@ -2321,10 +2433,21 @@ end_with_restore_list:
ulong priv=0;
ulong priv_needed= ALTER_ACL;
/*
+ Code in mysql_alter_table() may modify its HA_CREATE_INFO argument,
+ so we have to use a copy of this structure to make execution
+ prepared statement- safe. A shallow copy is enough as no memory
+ referenced from this structure will be modified.
+ */
+ HA_CREATE_INFO create_info(lex->create_info);
+ Alter_info alter_info(lex->alter_info, thd->mem_root);
+
+ if (thd->is_fatal_error) /* out of memory creating a copy of alter_info */
+ goto error;
+ /*
We also require DROP priv for ALTER TABLE ... DROP PARTITION, as well
as for RENAME TO, as being done by SQLCOM_RENAME_TABLE
*/
- if (lex->alter_info.flags & (ALTER_DROP_PARTITION | ALTER_RENAME))
+ if (alter_info.flags & (ALTER_DROP_PARTITION | ALTER_RENAME))
priv_needed|= DROP_ACL;
/* Must be set in the parser */
@@ -2336,32 +2459,30 @@ end_with_restore_list:
is_schema_db(select_lex->db))||
check_merge_table_access(thd, first_table->db,
(TABLE_LIST *)
- lex->create_info.merge_list.first))
+ create_info.merge_list.first))
goto error; /* purecov: inspected */
- if (grant_option)
- {
- if (check_grant(thd, priv_needed, all_tables, 0, UINT_MAX, 0))
- goto error;
- if (lex->name.str && !test_all_bits(priv,INSERT_ACL | CREATE_ACL))
- { // Rename of table
- TABLE_LIST tmp_table;
- bzero((char*) &tmp_table,sizeof(tmp_table));
- 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))
- goto error;
- }
+ if (check_grant(thd, priv_needed, all_tables, 0, UINT_MAX, 0))
+ goto error;
+ if (lex->name.str && !test_all_bits(priv,INSERT_ACL | CREATE_ACL))
+ { // Rename of table
+ TABLE_LIST tmp_table;
+ bzero((char*) &tmp_table,sizeof(tmp_table));
+ 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))
+ goto error;
}
+
/* Don't yet allow changing of symlinks with ALTER TABLE */
- if (lex->create_info.data_file_name)
+ if (create_info.data_file_name)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
"DATA DIRECTORY option ignored");
- if (lex->create_info.index_file_name)
+ if (create_info.index_file_name)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
"INDEX DIRECTORY option ignored");
- lex->create_info.data_file_name=lex->create_info.index_file_name=0;
+ create_info.data_file_name= create_info.index_file_name= NULL;
/* ALTER TABLE ends previous transaction */
if (end_active_trans(thd))
goto error;
@@ -2375,12 +2496,12 @@ end_with_restore_list:
thd->enable_slow_log= opt_log_slow_admin_statements;
res= mysql_alter_table(thd, select_lex->db, lex->name.str,
- &lex->create_info,
- first_table, lex->create_list,
- lex->key_list,
+ &create_info,
+ first_table,
+ &alter_info,
select_lex->order_list.elements,
(ORDER *) select_lex->order_list.first,
- lex->ignore, &lex->alter_info, 1);
+ lex->ignore);
break;
}
case SQLCOM_RENAME_TABLE:
@@ -2395,23 +2516,20 @@ end_with_restore_list:
&table->next_local->grant.privilege, 0, 0,
test(table->next_local->schema_table)))
goto error;
- if (grant_option)
- {
- TABLE_LIST old_list, new_list;
- /*
- we do not need initialize old_list and new_list because we will
- come table[0] and table->next[0] there
- */
- old_list= table[0];
- new_list= table->next_local[0];
- if (check_grant(thd, ALTER_ACL | DROP_ACL, &old_list, 0, 1, 0) ||
- (!test_all_bits(table->next_local->grant.privilege,
- INSERT_ACL | CREATE_ACL) &&
- check_grant(thd, INSERT_ACL | CREATE_ACL, &new_list, 0, 1, 0)))
- goto error;
- }
+ TABLE_LIST old_list, new_list;
+ /*
+ we do not need initialize old_list and new_list because we will
+ come table[0] and table->next[0] there
+ */
+ old_list= table[0];
+ new_list= table->next_local[0];
+ if (check_grant(thd, ALTER_ACL | DROP_ACL, &old_list, 0, 1, 0) ||
+ (!test_all_bits(table->next_local->grant.privilege,
+ INSERT_ACL | CREATE_ACL) &&
+ check_grant(thd, INSERT_ACL | CREATE_ACL, &new_list, 0, 1, 0)))
+ goto error;
}
- query_cache_invalidate3(thd, first_table, 0);
+
if (end_active_trans(thd) || mysql_rename_tables(thd, first_table, 0))
goto error;
break;
@@ -2442,12 +2560,7 @@ end_with_restore_list:
/* Ignore temporary tables if this is "SHOW CREATE VIEW" */
if (lex->only_view)
first_table->skip_temporary= 1;
-
- if (check_access(thd, SELECT_ACL | EXTRA_ACL, first_table->db,
- &first_table->grant.privilege, 0, 0,
- test(first_table->schema_table)))
- goto error;
- if (grant_option && check_grant(thd, SELECT_ACL, all_tables, 2, UINT_MAX, 0))
+ if (check_show_create_table_access(thd, first_table))
goto error;
res= mysqld_show_create(thd, first_table);
break;
@@ -2474,14 +2587,9 @@ end_with_restore_list:
/*
Presumably, REPAIR and binlog writing doesn't require synchronization
*/
- if (mysql_bin_log.is_open())
- {
- thd->clear_error(); // No binlog error generated
- thd->binlog_query(THD::STMT_QUERY_TYPE,
- thd->query, thd->query_length, 0, FALSE);
- }
+ write_bin_log(thd, TRUE, thd->query, thd->query_length);
}
- select_lex->table_list.first= (byte*) first_table;
+ select_lex->table_list.first= (uchar*) first_table;
lex->query_tables=all_tables;
break;
}
@@ -2492,7 +2600,7 @@ end_with_restore_list:
goto error; /* purecov: inspected */
thd->enable_slow_log= opt_log_slow_admin_statements;
res = mysql_check_table(thd, first_table, &lex->check_opt);
- select_lex->table_list.first= (byte*) first_table;
+ select_lex->table_list.first= (uchar*) first_table;
lex->query_tables=all_tables;
break;
}
@@ -2509,14 +2617,9 @@ end_with_restore_list:
/*
Presumably, ANALYZE and binlog writing doesn't require synchronization
*/
- if (mysql_bin_log.is_open())
- {
- thd->clear_error(); // No binlog error generated
- thd->binlog_query(THD::STMT_QUERY_TYPE,
- thd->query, thd->query_length, 0, FALSE);
- }
+ write_bin_log(thd, TRUE, thd->query, thd->query_length);
}
- select_lex->table_list.first= (byte*) first_table;
+ select_lex->table_list.first= (uchar*) first_table;
lex->query_tables=all_tables;
break;
}
@@ -2528,7 +2631,7 @@ end_with_restore_list:
goto error; /* purecov: inspected */
thd->enable_slow_log= opt_log_slow_admin_statements;
res= (specialflag & (SPECIAL_SAFE_MODE | SPECIAL_NO_NEW_FUNC)) ?
- mysql_recreate_table(thd, first_table, 1) :
+ mysql_recreate_table(thd, first_table) :
mysql_optimize_table(thd, first_table, &lex->check_opt);
/* ! we write after unlocking the table */
if (!res && !lex->no_write_to_binlog)
@@ -2536,14 +2639,9 @@ end_with_restore_list:
/*
Presumably, OPTIMIZE and binlog writing doesn't require synchronization
*/
- if (mysql_bin_log.is_open())
- {
- thd->clear_error(); // No binlog error generated
- thd->binlog_query(THD::STMT_QUERY_TYPE,
- thd->query, thd->query_length, 0, FALSE);
- }
+ write_bin_log(thd, TRUE, thd->query, thd->query_length);
}
- select_lex->table_list.first= (byte*) first_table;
+ select_lex->table_list.first= (uchar*) first_table;
lex->query_tables=all_tables;
break;
}
@@ -2709,7 +2807,7 @@ end_with_restore_list:
{
/* Skip first table, which is the table we are inserting in */
TABLE_LIST *second_table= first_table->next_local;
- select_lex->table_list.first= (byte*) second_table;
+ select_lex->table_list.first= (uchar*) second_table;
select_lex->context.table_list=
select_lex->context.first_name_resolution_table= second_table;
res= mysql_insert_select_prepare(thd);
@@ -2742,7 +2840,7 @@ end_with_restore_list:
delete sel_result;
}
/* revert changes for SP */
- select_lex->table_list.first= (byte*) first_table;
+ select_lex->table_list.first= (uchar*) first_table;
}
/*
@@ -2881,14 +2979,6 @@ end_with_restore_list:
lex->drop_temporary);
}
break;
- case SQLCOM_DROP_INDEX:
- DBUG_ASSERT(first_table == all_tables && first_table != 0);
- if (check_one_table_access(thd, INDEX_ACL, all_tables))
- goto error; /* purecov: inspected */
- if (end_active_trans(thd))
- goto error;
- res= mysql_drop_index(thd, first_table, &lex->alter_info);
- break;
case SQLCOM_SHOW_PROCESSLIST:
if (!thd->security_ctx->priv_user[0] &&
check_global_access(thd,PROCESS_ACL))
@@ -2899,9 +2989,6 @@ end_with_restore_list:
thd->security_ctx->priv_user),
lex->verbose);
break;
- case SQLCOM_SHOW_STORAGE_ENGINES:
- res= mysqld_show_storage_engines(thd);
- break;
case SQLCOM_SHOW_AUTHORS:
res= mysqld_show_authors(thd);
break;
@@ -2921,7 +3008,7 @@ end_with_restore_list:
goto error;
#else
{
- if (grant_option && check_access(thd, FILE_ACL, any_db,0,0,0,0))
+ if (check_access(thd, FILE_ACL, any_db,0,0,0,0))
goto error;
res= ha_show_status(thd, lex->create_info.db_type, HA_ENGINE_LOGS);
break;
@@ -3005,6 +3092,7 @@ end_with_restore_list:
break;
case SQLCOM_LOCK_TABLES:
unlock_locked_tables(thd);
+ /* we must end the trasaction first, regardless of anything */
if (end_active_trans(thd))
goto error;
if (check_table_access(thd, LOCK_TABLES_ACL | SELECT_ACL, all_tables, 0))
@@ -3023,11 +3111,25 @@ end_with_restore_list:
send_ok(thd);
}
else
+ {
+ /*
+ Need to end the current transaction, so the storage engine (InnoDB)
+ can free its locks if LOCK TABLES locked some tables before finding
+ that it can't lock a table in its list
+ */
+ end_active_trans(thd);
thd->options&= ~(OPTION_TABLE_LOCK);
+ }
thd->in_lock_tables=0;
break;
case SQLCOM_CREATE_DB:
{
+ /*
+ As mysql_create_db() may modify HA_CREATE_INFO structure passed to
+ it, we need to use a copy of LEX::create_info to make execution
+ prepared statement- safe.
+ */
+ HA_CREATE_INFO create_info(lex->create_info);
if (end_active_trans(thd))
{
res= -1;
@@ -3060,7 +3162,7 @@ end_with_restore_list:
is_schema_db(lex->name.str)))
break;
res= mysql_create_db(thd,(lower_case_table_names == 2 ? alias :
- lex->name.str), &lex->create_info, 0);
+ lex->name.str), &create_info, 0);
break;
}
case SQLCOM_DROP_DB:
@@ -3153,6 +3255,7 @@ end_with_restore_list:
case SQLCOM_ALTER_DB:
{
LEX_STRING *db= &lex->name;
+ HA_CREATE_INFO create_info(lex->create_info);
if (check_db_name(db))
{
my_error(ER_WRONG_DB_NAME, MYF(0), db->str);
@@ -3182,11 +3285,13 @@ end_with_restore_list:
ER(ER_LOCK_OR_ACTIVE_TRANSACTION), MYF(0));
goto error;
}
- res= mysql_alter_db(thd, db->str, &lex->create_info);
+ res= mysql_alter_db(thd, db->str, &create_info);
break;
}
case SQLCOM_SHOW_CREATE_DB:
{
+ DBUG_EXECUTE_IF("4x_server_emul",
+ my_error(ER_UNKNOWN_ERROR, MYF(0)); goto error;);
if (check_db_name(&lex->name))
{
my_error(ER_WRONG_DB_NAME, MYF(0), lex->name.str);
@@ -3308,6 +3413,8 @@ end_with_restore_list:
}
case SQLCOM_REVOKE_ALL:
{
+ if (end_active_trans(thd))
+ goto error;
if (check_access(thd, UPDATE_ACL, "mysql", 0, 1, 1, 0) &&
check_global_access(thd,CREATE_USER_ACL))
break;
@@ -3319,6 +3426,9 @@ end_with_restore_list:
case SQLCOM_REVOKE:
case SQLCOM_GRANT:
{
+ if (end_active_trans(thd))
+ goto error;
+
if (check_access(thd, lex->grant | lex->grant_tot_col | GRANT_ACL,
first_table ? first_table->db : select_lex->db,
first_table ? &first_table->grant.privilege : 0,
@@ -3368,8 +3478,7 @@ end_with_restore_list:
uint grants= lex->all_privileges
? (PROC_ACLS & ~GRANT_ACL) | (lex->grant & GRANT_ACL)
: lex->grant;
- if (grant_option &&
- check_grant_routine(thd, grants | GRANT_ACL, all_tables,
+ if (check_grant_routine(thd, grants | GRANT_ACL, all_tables,
lex->type == TYPE_ENUM_PROCEDURE, 0))
goto error;
/* Conditionally writes to binlog */
@@ -3380,10 +3489,8 @@ end_with_restore_list:
}
else
{
- if (grant_option && check_grant(thd,
- (lex->grant | lex->grant_tot_col |
- GRANT_ACL),
- all_tables, 0, UINT_MAX, 0))
+ if (check_grant(thd,(lex->grant | lex->grant_tot_col | GRANT_ACL),
+ all_tables, 0, UINT_MAX, 0))
goto error;
/* Conditionally writes to binlog */
res= mysql_table_grant(thd, all_tables, lex->users_list,
@@ -3448,11 +3555,7 @@ end_with_restore_list:
*/
if (!lex->no_write_to_binlog && write_to_binlog)
{
- if (mysql_bin_log.is_open())
- {
- thd->binlog_query(THD::STMT_QUERY_TYPE,
- thd->query, thd->query_length, 0, FALSE);
- }
+ write_bin_log(thd, FALSE, thd->query, thd->query_length);
}
send_ok(thd);
}
@@ -3578,7 +3681,8 @@ end_with_restore_list:
res= TRUE; // cannot happen
else
{
- if (((thd->options & OPTION_KEEP_LOG) || thd->no_trans_update.all) &&
+ if (((thd->options & OPTION_KEEP_LOG) ||
+ thd->transaction.all.modified_non_trans_table) &&
!thd->slave_thread)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARNING_NOT_COMPLETE_ROLLBACK,
@@ -3773,7 +3877,7 @@ create_sp_error:
goto error;
}
- my_bool nsok= thd->net.no_send_ok;
+ my_bool save_no_send_ok= thd->net.no_send_ok;
thd->net.no_send_ok= TRUE;
if (sp->m_flags & sp_head::MULTI_RESULTS)
{
@@ -3784,7 +3888,7 @@ create_sp_error:
back
*/
my_error(ER_SP_BADSELECT, MYF(0), sp->m_qname.str);
- thd->net.no_send_ok= nsok;
+ thd->net.no_send_ok= save_no_send_ok;
goto error;
}
/*
@@ -3800,7 +3904,7 @@ create_sp_error:
if (check_routine_access(thd, EXECUTE_ACL,
sp->m_db.str, sp->m_name.str, TRUE, FALSE))
{
- thd->net.no_send_ok= nsok;
+ thd->net.no_send_ok= save_no_send_ok;
goto error;
}
#endif
@@ -3825,7 +3929,7 @@ create_sp_error:
thd->variables.select_limit= select_limit;
- thd->net.no_send_ok= nsok;
+ thd->net.no_send_ok= save_no_send_ok;
thd->server_status&= ~bits_to_be_cleared;
if (!res)
@@ -3893,11 +3997,15 @@ create_sp_error:
already puts on CREATE FUNCTION.
*/
/* Conditionally writes to binlog */
- if (lex->sql_command == SQLCOM_ALTER_PROCEDURE)
- sp_result= sp_update_procedure(thd, lex->spname,
- &lex->sp_chistics);
- else
- sp_result= sp_update_function(thd, lex->spname, &lex->sp_chistics);
+
+ int type= lex->sql_command == SQLCOM_ALTER_PROCEDURE ?
+ TYPE_ENUM_PROCEDURE :
+ TYPE_ENUM_FUNCTION;
+
+ sp_result= sp_update_routine(thd,
+ type,
+ lex->spname,
+ &lex->sp_chistics);
}
}
switch (sp_result)
@@ -3947,10 +4055,12 @@ create_sp_error:
}
#endif
/* Conditionally writes to binlog */
- if (lex->sql_command == SQLCOM_DROP_PROCEDURE)
- sp_result= sp_drop_procedure(thd, lex->spname);
- else
- sp_result= sp_drop_function(thd, lex->spname);
+
+ int type= lex->sql_command == SQLCOM_DROP_PROCEDURE ?
+ TYPE_ENUM_PROCEDURE :
+ TYPE_ENUM_FUNCTION;
+
+ sp_result= sp_drop_routine(thd, type, lex->spname);
}
else
{
@@ -4007,8 +4117,8 @@ create_sp_error:
}
case SQLCOM_SHOW_CREATE_PROC:
{
- if (sp_show_create_procedure(thd, lex->spname) != SP_OK)
- { /* We don't distinguish between errors for now */
+ if (sp_show_create_routine(thd, TYPE_ENUM_PROCEDURE, lex->spname))
+ {
my_error(ER_SP_DOES_NOT_EXIST, MYF(0),
SP_COM_STRING(lex), lex->spname->m_name.str);
goto error;
@@ -4017,8 +4127,8 @@ create_sp_error:
}
case SQLCOM_SHOW_CREATE_FUNC:
{
- if (sp_show_create_function(thd, lex->spname) != SP_OK)
- { /* We don't distinguish between errors for now */
+ if (sp_show_create_routine(thd, TYPE_ENUM_FUNCTION, lex->spname))
+ {
my_error(ER_SP_DOES_NOT_EXIST, MYF(0),
SP_COM_STRING(lex), lex->spname->m_name.str);
goto error;
@@ -4028,14 +4138,14 @@ create_sp_error:
#ifdef NOT_USED
case SQLCOM_SHOW_STATUS_PROC:
{
- res= sp_show_status_procedure(thd, (lex->wild ?
- lex->wild->ptr() : NullS));
+ res= sp_show_status_routine(thd, TYPE_ENUM_PROCEDURE,
+ (lex->wild ? lex->wild->ptr() : NullS));
break;
}
case SQLCOM_SHOW_STATUS_FUNC:
{
- res= sp_show_status_function(thd, (lex->wild ?
- lex->wild->ptr() : NullS));
+ res= sp_show_status_routine(thd, TYPE_ENUM_FUNCTION,
+ (lex->wild ? lex->wild->ptr() : NullS));
break;
}
#endif
@@ -4061,8 +4171,25 @@ create_sp_error:
break;
}
#endif // ifndef DBUG_OFF
+ case SQLCOM_SHOW_CREATE_TRIGGER:
+ {
+ if (lex->spname->m_name.length > NAME_LEN)
+ {
+ my_error(ER_TOO_LONG_IDENT, MYF(0), lex->spname->m_name.str);
+ goto error;
+ }
+
+ if (show_create_trigger(thd, lex->spname))
+ goto error; /* Error has been already logged. */
+
+ break;
+ }
case SQLCOM_CREATE_VIEW:
{
+ /*
+ Note: SQLCOM_CREATE_VIEW also handles 'ALTER VIEW' commands
+ as specified through the thd->lex->create_view_mode flag.
+ */
if (end_active_trans(thd))
goto error;
@@ -4135,8 +4262,8 @@ create_sp_error:
thd->transaction.xid_state.xa_state=XA_ACTIVE;
thd->transaction.xid_state.xid.set(thd->lex->xid);
xid_cache_insert(&thd->transaction.xid_state);
+ thd->transaction.all.modified_non_trans_table= FALSE;
thd->options= ((thd->options & ~(OPTION_KEEP_LOG)) | OPTION_BEGIN);
- thd->no_trans_update.all= FALSE;
thd->server_status|= SERVER_STATUS_IN_TRANS;
send_ok(thd);
break;
@@ -4230,7 +4357,7 @@ create_sp_error:
break;
}
thd->options&= ~(OPTION_BEGIN | OPTION_KEEP_LOG);
- thd->no_trans_update.all= FALSE;
+ thd->transaction.all.modified_non_trans_table= FALSE;
thd->server_status&= ~SERVER_STATUS_IN_TRANS;
xid_cache_delete(&thd->transaction.xid_state);
thd->transaction.xid_state.xa_state=XA_NOTR;
@@ -4261,7 +4388,7 @@ create_sp_error:
else
send_ok(thd);
thd->options&= ~(OPTION_BEGIN | OPTION_KEEP_LOG);
- thd->no_trans_update.all= FALSE;
+ thd->transaction.all.modified_non_trans_table= FALSE;
thd->server_status&= ~SERVER_STATUS_IN_TRANS;
xid_cache_delete(&thd->transaction.xid_state);
thd->transaction.xid_state.xa_state=XA_NOTR;
@@ -4497,8 +4624,7 @@ bool check_single_table_access(THD *thd, ulong privilege,
goto deny;
/* Show only 1 table for check_grant */
- if (grant_option &&
- !(all_tables->belong_to_view &&
+ if (!(all_tables->belong_to_view &&
(thd->lex->sql_command == SQLCOM_SHOW_FIELDS)) &&
check_grant(thd, privilege, all_tables, 0, 1, no_errors))
goto deny;
@@ -4579,7 +4705,17 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
Security_context *sctx= thd->security_ctx;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
ulong db_access;
- bool db_is_pattern= test(want_access & GRANT_ACL);
+ /*
+ 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
+ (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);
#endif
ulong dummy;
DBUG_ENTER("check_access");
@@ -4667,9 +4803,8 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
db_access, want_access));
db_access= ((*save_priv=(db_access | sctx->master_access)) & want_access);
- /* grant_option is set if there exists a single table or column grant */
if (db_access == want_access ||
- (grant_option && !dont_check_global_grants &&
+ (!dont_check_global_grants &&
!(want_access & ~(db_access | TABLE_ACLS | PROC_ACLS))))
DBUG_RETURN(FALSE); /* Ok */
@@ -4768,8 +4903,7 @@ static bool check_show_access(THD *thd, TABLE_LIST *table)
test(dst_table->schema_table)))
return FALSE;
- return (grant_option &&
- check_grant(thd, SELECT_ACL, dst_table, 2, UINT_MAX, FALSE));
+ return (check_grant(thd, SELECT_ACL, dst_table, 2, UINT_MAX, FALSE));
}
default:
break;
@@ -4806,8 +4940,6 @@ bool
check_table_access(THD *thd, ulong want_access,TABLE_LIST *tables,
bool no_errors)
{
- uint found=0;
- ulong found_access=0;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
TABLE_LIST *org_tables= tables;
#endif
@@ -4858,26 +4990,17 @@ check_table_access(THD *thd, ulong want_access,TABLE_LIST *tables,
tables->grant.privilege= want_access;
else if (tables->db && thd->db && strcmp(tables->db, thd->db) == 0)
{
- if (found && !grant_option) // db already checked
- tables->grant.privilege=found_access;
- else
- {
- if (check_access(thd,want_access,tables->db,&tables->grant.privilege,
+ if (check_access(thd,want_access,tables->db,&tables->grant.privilege,
0, no_errors, test(tables->schema_table)))
- goto deny; // Access denied
- found_access=tables->grant.privilege;
- found=1;
- }
+ goto deny; // Access denied
}
else if (check_access(thd,want_access,tables->db,&tables->grant.privilege,
0, no_errors, test(tables->schema_table)))
goto deny;
}
thd->security_ctx= backup_ctx;
- if (grant_option)
- return check_grant(thd,want_access & ~EXTRA_ACL,org_tables,
+ return check_grant(thd,want_access & ~EXTRA_ACL,org_tables,
test(want_access & EXTRA_ACL), UINT_MAX, no_errors);
- return FALSE;
deny:
thd->security_ctx= backup_ctx;
return TRUE;
@@ -4907,11 +5030,10 @@ check_routine_access(THD *thd, ulong want_access,char *db, char *name,
return TRUE;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
- if (grant_option)
return check_grant_routine(thd, want_access, tables, is_proc, no_errors);
-#endif
-
+#else
return FALSE;
+#endif
}
@@ -4973,7 +5095,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)) &&
- !grant_option || !check_grant(thd, access, table, 0, 1, 1))
+ !check_grant(thd, access, table, 0, 1, 1))
DBUG_RETURN(0);
}
}
@@ -5006,6 +5128,8 @@ bool check_merge_table_access(THD *thd, char *db,
Check stack size; Send error if there isn't enough stack to continue
****************************************************************************/
+#ifndef EMBEDDED_LIBRARY
+
#if STACK_DIRECTION < 0
#define used_stack(A,B) (long) (A - B)
#else
@@ -5016,7 +5140,6 @@ bool check_merge_table_access(THD *thd, char *db,
long max_stack_used;
#endif
-#ifndef EMBEDDED_LIBRARY
/*
Note: The 'buf' parameter is necessary, even if it is unused here.
- fix_fields functions has a "dummy" buffer large enough for the
@@ -5024,7 +5147,7 @@ long max_stack_used;
- Passing to check_stack_overrun() prevents the compiler from removing it.
*/
bool check_stack_overrun(THD *thd, long margin,
- char *buf __attribute__((unused)))
+ uchar *buf __attribute__((unused)))
{
long stack_used;
DBUG_ASSERT(thd == current_thd);
@@ -5056,19 +5179,19 @@ bool my_yyoverflow(short **yyss, YYSTYPE **yyvs, ulong *yystacksize)
if (!lex->yacc_yyvs)
old_info= *yystacksize;
*yystacksize= set_zone((*yystacksize)*2,MY_YACC_INIT,MY_YACC_MAX);
- if (!(lex->yacc_yyvs= (char*)
- my_realloc((gptr) lex->yacc_yyvs,
+ if (!(lex->yacc_yyvs= (uchar*)
+ my_realloc(lex->yacc_yyvs,
*yystacksize*sizeof(**yyvs),
MYF(MY_ALLOW_ZERO_PTR | MY_FREE_ON_ERROR))) ||
- !(lex->yacc_yyss= (char*)
- my_realloc((gptr) lex->yacc_yyss,
+ !(lex->yacc_yyss= (uchar*)
+ my_realloc(lex->yacc_yyss,
*yystacksize*sizeof(**yyss),
MYF(MY_ALLOW_ZERO_PTR | MY_FREE_ON_ERROR))))
return 1;
if (old_info)
{ // Copy old info from stack
- memcpy(lex->yacc_yyss, (gptr) *yyss, old_info*sizeof(**yyss));
- memcpy(lex->yacc_yyvs, (gptr) *yyvs, old_info*sizeof(**yyvs));
+ memcpy(lex->yacc_yyss, (uchar*) *yyss, old_info*sizeof(**yyss));
+ memcpy(lex->yacc_yyvs, (uchar*) *yyvs, old_info*sizeof(**yyvs));
}
*yyss=(short*) lex->yacc_yyss;
*yyvs=(YYSTYPE*) lex->yacc_yyvs;
@@ -5076,23 +5199,6 @@ bool my_yyoverflow(short **yyss, YYSTYPE **yyvs, ulong *yystacksize)
}
-/****************************************************************************
- Initialize global thd variables needed for query
-****************************************************************************/
-
-void
-mysql_init_query(THD *thd, const char *buf, uint length)
-{
- DBUG_ENTER("mysql_init_query");
- lex_start(thd, buf, length);
- mysql_reset_thd_for_next_command(thd);
-#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
- thd->profiling.reset();
-#endif
- DBUG_VOID_RETURN;
-}
-
-
/*
Reset THD part responsible for command processing state.
@@ -5133,10 +5239,10 @@ void mysql_reset_thd_for_next_command(THD *thd)
if (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
{
thd->options&= ~OPTION_KEEP_LOG;
- thd->no_trans_update.all= FALSE;
+ thd->transaction.all.modified_non_trans_table= FALSE;
}
DBUG_ASSERT(thd->security_ctx== &thd->main_security_ctx);
- thd->tmp_table_used= 0;
+ thd->thread_specific_used= FALSE;
if (!thd->in_sub_stmt)
{
if (opt_bin_log)
@@ -5190,6 +5296,11 @@ mysql_new_select(LEX *lex, bool move_down)
select_lex->init_query();
select_lex->init_select();
lex->nest_level++;
+ if (lex->nest_level > (int) MAX_SELECT_NESTING)
+ {
+ my_error(ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT,MYF(0),MAX_SELECT_NESTING);
+ DBUG_RETURN(1);
+ }
select_lex->nest_level= lex->nest_level;
/*
Don't evaluate this subquery during statement prepare even if
@@ -5307,22 +5418,55 @@ void mysql_init_multi_delete(LEX *lex)
mysql_test_parse_for_slave() in this same file.
*/
-void mysql_parse(THD *thd, char *inBuf, uint length)
+/**
+ Parse a query.
+
+ @param thd Current thread
+ @param inBuf Begining of the query text
+ @param length Length of the query text
+ @param[out] found_semicolon For multi queries, position of the character of
+ the next query in the query text.
+*/
+
+void mysql_parse(THD *thd, const char *inBuf, uint length,
+ const char ** found_semicolon)
{
DBUG_ENTER("mysql_parse");
DBUG_EXECUTE_IF("parser_debug", turn_parser_debug_on(););
- mysql_init_query(thd, inBuf, length);
+ /*
+ Warning.
+ The purpose of query_cache_send_result_to_client() is to lookup the
+ query in the query cache first, to avoid parsing and executing it.
+ So, the natural implementation would be to:
+ - first, call query_cache_send_result_to_client,
+ - second, if caching failed, initialise the lexical and syntactic parser.
+ The problem is that the query cache depends on a clean initialization
+ of (among others) lex->safe_to_cache_query and thd->server_status,
+ which are reset respectively in
+ - lex_start()
+ - mysql_reset_thd_for_next_command()
+ So, initializing the lexical analyser *before* using the query cache
+ is required for the cache to work properly.
+ FIXME: cleanup the dependencies in the code to simplify this.
+ */
+ lex_start(thd);
+ mysql_reset_thd_for_next_command(thd);
- if (query_cache_send_result_to_client(thd, inBuf, length) <= 0)
+ if (query_cache_send_result_to_client(thd, (char*) inBuf, length) <= 0)
{
LEX *lex= thd->lex;
-
+
sp_cache_flush_obsolete(&thd->sp_proc_cache);
sp_cache_flush_obsolete(&thd->sp_func_cache);
-
- if (!MYSQLparse((void *)thd) && ! thd->is_fatal_error)
+
+ Lex_input_stream lip(thd, inBuf, length);
+
+ bool err= parse_sql(thd, &lip, NULL);
+ *found_semicolon= lip.found_semicolon;
+
+ if (!err)
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (mqh_used && thd->user_connect &&
@@ -5345,12 +5489,13 @@ void mysql_parse(THD *thd, char *inBuf, uint length)
PROCESSLIST.
Note that we don't need LOCK_thread_count to modify query_length.
*/
- if (lex->found_semicolon &&
- (thd->query_length= (ulong)(lex->found_semicolon - thd->query)))
+ if (*found_semicolon &&
+ (thd->query_length= (ulong)(*found_semicolon - thd->query)))
thd->query_length--;
/* Actually execute the query */
- mysql_execute_command(thd);
- query_cache_end_of_result(thd);
+ lex->set_trg_event_type_for_tables();
+ mysql_execute_command(thd);
+ query_cache_end_of_result(thd);
}
}
}
@@ -5373,6 +5518,12 @@ void mysql_parse(THD *thd, char *inBuf, uint length)
thd->cleanup_after_query();
DBUG_ASSERT(thd->change_list.is_empty());
}
+ else
+ {
+ /* There are no multi queries in the cache. */
+ *found_semicolon= NULL;
+ }
+
DBUG_VOID_RETURN;
}
@@ -5393,8 +5544,11 @@ bool mysql_test_parse_for_slave(THD *thd, char *inBuf, uint length)
bool error= 0;
DBUG_ENTER("mysql_test_parse_for_slave");
- mysql_init_query(thd, inBuf, length);
- if (!MYSQLparse((void*) thd) && ! thd->is_fatal_error &&
+ Lex_input_stream lip(thd, inBuf, length);
+ lex_start(thd);
+ mysql_reset_thd_for_next_command(thd);
+
+ if (!parse_sql(thd, &lip, NULL) &&
all_tables_not_ok(thd,(TABLE_LIST*) lex->select_lex.table_list.first))
error= 1; /* Ignore question */
thd->end_statement();
@@ -5419,7 +5573,7 @@ bool add_field_to_list(THD *thd, LEX_STRING *field_name, enum_field_types type,
List<String> *interval_list, CHARSET_INFO *cs,
uint uint_geom_type)
{
- register create_field *new_field;
+ register Create_field *new_field;
LEX *lex= thd->lex;
DBUG_ENTER("add_field_to_list");
@@ -5431,18 +5585,22 @@ bool add_field_to_list(THD *thd, LEX_STRING *field_name, enum_field_types type,
}
if (type_modifier & PRI_KEY_FLAG)
{
- lex->col_list.push_back(new key_part_spec(field_name->str, 0));
- lex->key_list.push_back(new Key(Key::PRIMARY, NullS,
- &default_key_create_info,
- 0, lex->col_list));
+ Key *key;
+ lex->col_list.push_back(new Key_part_spec(field_name->str, 0));
+ key= new Key(Key::PRIMARY, NullS,
+ &default_key_create_info,
+ 0, lex->col_list);
+ lex->alter_info.key_list.push_back(key);
lex->col_list.empty();
}
if (type_modifier & (UNIQUE_FLAG | UNIQUE_KEY_FLAG))
{
- lex->col_list.push_back(new key_part_spec(field_name->str, 0));
- lex->key_list.push_back(new Key(Key::UNIQUE, NullS,
- &default_key_create_info, 0,
- lex->col_list));
+ Key *key;
+ lex->col_list.push_back(new Key_part_spec(field_name->str, 0));
+ key= new Key(Key::UNIQUE, NullS,
+ &default_key_create_info, 0,
+ lex->col_list);
+ lex->alter_info.key_list.push_back(key);
lex->col_list.empty();
}
@@ -5496,13 +5654,13 @@ bool add_field_to_list(THD *thd, LEX_STRING *field_name, enum_field_types type,
WARN_DEPRECATED(thd, "5.2", buf, "'TIMESTAMP'");
}
- if (!(new_field= new create_field()) ||
+ if (!(new_field= new Create_field()) ||
new_field->init(thd, field_name->str, type, length, decimals, type_modifier,
default_value, on_update_value, comment, change,
interval_list, cs, uint_geom_type))
DBUG_RETURN(1);
- lex->create_list.push_back(new_field);
+ lex->alter_info.create_list.push_back(new_field);
lex->last_field=new_field;
DBUG_RETURN(0);
}
@@ -5527,7 +5685,7 @@ add_proc_to_list(THD* thd, Item *item)
*item_ptr= item;
order->item=item_ptr;
order->free_me=0;
- thd->lex->proc_list.link_in_list((byte*) order,(byte**) &order->next);
+ thd->lex->proc_list.link_in_list((uchar*) order,(uchar**) &order->next);
return 0;
}
@@ -5549,7 +5707,7 @@ bool add_to_list(THD *thd, SQL_LIST &list,Item *item,bool asc)
order->free_me=0;
order->used=0;
order->counter_used= 0;
- list.link_in_list((byte*) order,(byte**) &order->next);
+ list.link_in_list((uchar*) order,(uchar**) &order->next);
DBUG_RETURN(0);
}
@@ -5579,7 +5737,7 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
LEX_STRING *alias,
ulong table_options,
thr_lock_type lock_type,
- List<index_hint> *index_hints_arg,
+ List<Index_hint> *index_hints_arg,
LEX_STRING *option)
{
register TABLE_LIST *ptr;
@@ -5614,7 +5772,7 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
ER(ER_DERIVED_MUST_HAVE_ALIAS), MYF(0));
DBUG_RETURN(0);
}
- if (!(alias_str=thd->memdup(alias_str,table->table.length+1)))
+ if (!(alias_str= (char*) thd->memdup(alias_str,table->table.length+1)))
DBUG_RETURN(0);
}
if (!(ptr = (TABLE_LIST *) thd->calloc(sizeof(TABLE_LIST))))
@@ -5624,7 +5782,7 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
ptr->db= table->db.str;
ptr->db_length= table->db.length;
}
- else if (thd->copy_db_to(&ptr->db, &ptr->db_length))
+ else if (lex->copy_db_to(&ptr->db, &ptr->db_length))
DBUG_RETURN(0);
ptr->alias= alias_str;
@@ -5701,7 +5859,7 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
previous table reference to 'ptr'. Here we also add one element to the
list 'table_list'.
*/
- table_list.link_in_list((byte*) ptr, (byte**) &ptr->next_local);
+ table_list.link_in_list((uchar*) ptr, (uchar**) &ptr->next_local);
ptr->next_name_resolution_table= NULL;
/* Link table in global list (all used tables) */
lex->add_to_query_tables(ptr);
@@ -5740,7 +5898,7 @@ bool st_select_lex::init_nested_join(THD *thd)
sizeof(NESTED_JOIN))))
DBUG_RETURN(1);
nested_join= ptr->nested_join=
- ((NESTED_JOIN*) ((byte*) ptr + ALIGN_SIZE(sizeof(TABLE_LIST))));
+ ((NESTED_JOIN*) ((uchar*) ptr + ALIGN_SIZE(sizeof(TABLE_LIST))));
join_list->push_front(ptr);
ptr->embedding= embedding;
@@ -5826,7 +5984,7 @@ TABLE_LIST *st_select_lex::nest_last_join(THD *thd)
sizeof(NESTED_JOIN))))
DBUG_RETURN(0);
nested_join= ptr->nested_join=
- ((NESTED_JOIN*) ((byte*) ptr + ALIGN_SIZE(sizeof(TABLE_LIST))));
+ ((NESTED_JOIN*) ((uchar*) ptr + ALIGN_SIZE(sizeof(TABLE_LIST))));
ptr->embedding= embedding;
ptr->join_list= join_list;
@@ -6419,7 +6577,7 @@ bool append_file_to_dir(THD *thd, const char **filename_ptr,
/* Fix is using unix filename format on dos */
strmov(buff,*filename_ptr);
end=convert_dirname(buff, *filename_ptr, NullS);
- if (!(ptr=thd->alloc((uint) (end-buff)+(uint) strlen(table_name)+1)))
+ if (!(ptr= (char*) thd->alloc((size_t) (end-buff) + strlen(table_name)+1)))
return 1; // End of memory
*filename_ptr=ptr;
strxmov(ptr,buff,table_name,NullS);
@@ -6445,8 +6603,9 @@ bool check_simple_select()
if (lex->current_select != &lex->select_lex)
{
char command[80];
- strmake(command, lex->yylval->symbol.str,
- min(lex->yylval->symbol.length, sizeof(command)-1));
+ Lex_input_stream *lip= thd->m_lip;
+ strmake(command, lip->yylval->symbol.str,
+ min(lip->yylval->symbol.length, sizeof(command)-1));
my_error(ER_CANT_USE_OPTION_HERE, MYF(0), command);
return 1;
}
@@ -6524,55 +6683,6 @@ Item * all_any_subquery_creator(Item *left_expr,
/*
- CREATE INDEX and DROP INDEX are implemented by calling ALTER TABLE with
- the proper arguments. This isn't very fast but it should work for most
- cases.
-
- In the future ALTER TABLE will notice that only added indexes
- and create these one by one for the existing table without having to do
- a full rebuild.
-
- One should normally create all indexes with CREATE TABLE or ALTER TABLE.
-*/
-
-bool mysql_create_index(THD *thd, TABLE_LIST *table_list, List<Key> &keys)
-{
- List<create_field> fields;
- ALTER_INFO alter_info;
- alter_info.flags= ALTER_ADD_INDEX;
- HA_CREATE_INFO create_info;
- DBUG_ENTER("mysql_create_index");
- bzero((char*) &create_info,sizeof(create_info));
- create_info.db_type= 0;
- create_info.default_table_charset= thd->variables.collation_database;
- create_info.row_type= ROW_TYPE_NOT_USED;
- DBUG_RETURN(mysql_alter_table(thd,table_list->db,table_list->table_name,
- &create_info, table_list,
- fields, keys, 0, (ORDER*)0,
- 0, &alter_info, 1));
-}
-
-
-bool mysql_drop_index(THD *thd, TABLE_LIST *table_list, ALTER_INFO *alter_info)
-{
- List<create_field> fields;
- List<Key> keys;
- HA_CREATE_INFO create_info;
- DBUG_ENTER("mysql_drop_index");
- bzero((char*) &create_info,sizeof(create_info));
- create_info.db_type= 0;
- create_info.default_table_charset= thd->variables.collation_database;
- create_info.row_type= ROW_TYPE_NOT_USED;
- alter_info->clear();
- alter_info->flags= ALTER_DROP_INDEX;
- DBUG_RETURN(mysql_alter_table(thd,table_list->db,table_list->table_name,
- &create_info, table_list,
- fields, keys, 0, (ORDER*)0,
- 0, alter_info, 1));
-}
-
-
-/*
Multi update query pre-check
SYNOPSIS
@@ -6609,12 +6719,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)) ||
- grant_option &&
check_grant(thd, UPDATE_ACL, table, 0, 1, 1)) &&
(check_access(thd, SELECT_ACL, table->db,
&table->grant.privilege, 0, 0,
test(table->schema_table)) ||
- grant_option && check_grant(thd, SELECT_ACL, table, 0, 1, 0)))
+ check_grant(thd, SELECT_ACL, table, 0, 1, 0)))
DBUG_RETURN(TRUE);
table->table_in_first_from_clause= 1;
@@ -6632,7 +6741,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)) ||
- grant_option && check_grant(thd, SELECT_ACL, table, 0, 1, 0))
+ check_grant(thd, SELECT_ACL, table, 0, 1, 0))
DBUG_RETURN(TRUE);
}
}
@@ -6839,6 +6948,25 @@ 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
@@ -6864,7 +6992,6 @@ bool create_table_precheck(THD *thd, TABLE_LIST *tables,
want_priv= ((lex->create_info.options & HA_LEX_CREATE_TMP_TABLE) ?
CREATE_TMP_ACL : CREATE_ACL);
- lex->create_info.alias= create_table->alias;
if (check_access(thd, want_priv, create_table->db,
&create_table->grant.privilege, 0, 0,
test(create_table->schema_table)) ||
@@ -6872,7 +6999,7 @@ bool create_table_precheck(THD *thd, TABLE_LIST *tables,
(TABLE_LIST *)
lex->create_info.merge_list.first))
goto err;
- if (grant_option && want_priv != CREATE_TMP_ACL &&
+ if (want_priv != CREATE_TMP_ACL &&
check_grant(thd, want_priv, create_table, 0, 1, 0))
goto err;
@@ -6904,6 +7031,11 @@ bool create_table_precheck(THD *thd, TABLE_LIST *tables,
if (tables && check_table_access(thd, SELECT_ACL, tables,0))
goto err;
}
+ else if (lex->create_info.options & HA_LEX_CREATE_TABLE_LIKE)
+ {
+ if (check_show_create_table_access(thd, tables))
+ goto err;
+ }
error= FALSE;
err:
@@ -7108,3 +7240,59 @@ bool check_string_char_length(LEX_STRING *str, const char *err_msg,
my_error(ER_WRONG_STRING_LENGTH, MYF(0), str->str, err_msg, max_char_length);
return TRUE;
}
+
+
+extern int MYSQLparse(void *thd); // from sql_yacc.cc
+
+
+/**
+ This is a wrapper of MYSQLparse(). All the code should call parse_sql()
+ instead of MYSQLparse().
+
+ @param thd Thread context.
+ @param lip Lexer context.
+ @param creation_ctx Object creation context.
+
+ @return Error status.
+ @retval FALSE on success.
+ @retval TRUE on parsing error.
+*/
+
+bool parse_sql(THD *thd,
+ Lex_input_stream *lip,
+ Object_creation_ctx *creation_ctx)
+{
+ DBUG_ASSERT(thd->m_lip == NULL);
+
+ /* Backup creation context. */
+
+ Object_creation_ctx *backup_ctx= NULL;
+
+ if (creation_ctx)
+ backup_ctx= creation_ctx->set_n_backup(thd);
+
+ /* Set Lex_input_stream. */
+
+ thd->m_lip= lip;
+
+ /* Parse the query. */
+
+ bool err_status= MYSQLparse(thd) != 0 || thd->is_fatal_error;
+
+ /* Reset Lex_input_stream. */
+
+ thd->m_lip= NULL;
+
+ /* Restore creation context. */
+
+ if (creation_ctx)
+ creation_ctx->restore_env(thd, backup_ctx);
+
+ /* That's it. */
+
+ return err_status;
+}
+
+/**
+ @} (end of group Runtime_Environment)
+*/
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index d445c8bfbe0..8a8a03cb4e4 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -36,7 +36,7 @@
#include "mysql_priv.h"
#include <errno.h>
#include <m_ctype.h>
-#include "md5.h"
+#include "my_md5.h"
#ifdef WITH_PARTITION_STORAGE_ENGINE
#include "ha_partition.h"
@@ -123,47 +123,23 @@ uint32 get_partition_id_hash_sub(partition_info *part_info);
uint32 get_partition_id_key_sub(partition_info *part_info);
uint32 get_partition_id_linear_hash_sub(partition_info *part_info);
uint32 get_partition_id_linear_key_sub(partition_info *part_info);
-#endif
-
static uint32 get_next_partition_via_walking(PARTITION_ITERATOR*);
+static void set_up_range_analysis_info(partition_info *part_info);
static uint32 get_next_subpartition_via_walking(PARTITION_ITERATOR*);
+#endif
+
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,
- char *min_value, char *max_value,
+ uchar *min_value, uchar *max_value,
uint flags,
PARTITION_ITERATOR *part_iter);
int get_part_iter_for_interval_via_walking(partition_info *part_info,
bool is_subpart,
- char *min_value, char *max_value,
+ uchar *min_value, uchar *max_value,
uint flags,
PARTITION_ITERATOR *part_iter);
-static void set_up_range_analysis_info(partition_info *part_info);
-
-/*
- A routine used by the parser to decide whether we are specifying a full
- partitioning or if only partitions to add or to split.
-
- SYNOPSIS
- is_partition_management()
- lex Reference to the lex object
-
- RETURN VALUE
- TRUE Yes, it is part of a management partition command
- FALSE No, not a management partition command
-
- DESCRIPTION
- This needs to be outside of WITH_PARTITION_STORAGE_ENGINE since it is
- used from the sql parser that doesn't have any #ifdef's
-*/
-
-my_bool is_partition_management(LEX *lex)
-{
- return (lex->sql_command == SQLCOM_ALTER_TABLE &&
- (lex->alter_info.flags == ALTER_ADD_PARTITION ||
- lex->alter_info.flags == ALTER_REORGANIZE_PARTITION));
-}
#ifdef WITH_PARTITION_STORAGE_ENGINE
/*
@@ -318,8 +294,8 @@ bool check_reorganise_list(partition_info *new_part_info,
> 0 Error code
*/
-int get_parts_for_update(const byte *old_data, byte *new_data,
- const byte *rec0, partition_info *part_info,
+int get_parts_for_update(const uchar *old_data, uchar *new_data,
+ const uchar *rec0, partition_info *part_info,
uint32 *old_part_id, uint32 *new_part_id,
longlong *new_func_value)
{
@@ -392,7 +368,7 @@ int get_parts_for_update(const byte *old_data, byte *new_data,
calculate the partition id.
*/
-int get_part_for_delete(const byte *buf, const byte *rec0,
+int get_part_for_delete(const uchar *buf, const uchar *rec0,
partition_info *part_info, uint32 *part_id)
{
int error;
@@ -547,6 +523,7 @@ static bool set_up_field_array(TABLE *table,
SYNOPSIS
create_full_part_field_array()
+ thd Thread handle
table TABLE object for which partition fields are set-up
part_info Reference to partitioning data structure
@@ -561,11 +538,12 @@ static bool set_up_field_array(TABLE *table,
This function is called from fix_partition_func
*/
-static bool create_full_part_field_array(TABLE *table,
+static bool create_full_part_field_array(THD *thd, TABLE *table,
partition_info *part_info)
{
bool result= FALSE;
Field **ptr;
+ my_bitmap_map *bitmap_buf;
DBUG_ENTER("create_full_part_field_array");
if (!part_info->is_sub_partitioned())
@@ -602,6 +580,35 @@ static bool create_full_part_field_array(TABLE *table,
part_info->full_part_field_array= field_array;
part_info->no_full_part_fields= no_part_fields;
}
+
+ /*
+ Initialize the set of all fields used in partition and subpartition
+ expression. Required for testing of partition fields in write_set
+ when updating. We need to set all bits in read_set because the row
+ may need to be inserted in a different [sub]partition.
+ */
+ if (!(bitmap_buf= (my_bitmap_map*)
+ thd->alloc(bitmap_buffer_size(table->s->fields))))
+ {
+ mem_alloc_error(bitmap_buffer_size(table->s->fields));
+ result= TRUE;
+ goto end;
+ }
+ if (bitmap_init(&part_info->full_part_field_set, bitmap_buf,
+ table->s->fields, FALSE))
+ {
+ mem_alloc_error(table->s->fields);
+ result= TRUE;
+ goto end;
+ }
+ /*
+ full_part_field_array may be NULL if storage engine supports native
+ partitioning.
+ */
+ if ((ptr= part_info->full_part_field_array))
+ for (; *ptr; ptr++)
+ bitmap_set_bit(&part_info->full_part_field_set, (*ptr)->field_index);
+
end:
DBUG_RETURN(result);
}
@@ -784,9 +791,9 @@ static bool handle_list_of_fields(List_iterator<char> it,
}
else
{
- if (table->s->db_type->partition_flags &&
- (table->s->db_type->partition_flags() & HA_USE_AUTO_PARTITION) &&
- (table->s->db_type->partition_flags() & HA_CAN_PARTITION))
+ if (table->s->db_type()->partition_flags &&
+ (table->s->db_type()->partition_flags() & HA_USE_AUTO_PARTITION) &&
+ (table->s->db_type()->partition_flags() & HA_CAN_PARTITION))
{
/*
This engine can handle automatic partitioning and there is no
@@ -931,7 +938,7 @@ bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table,
context->table_list= &tables;
context->first_name_resolution_table= &tables;
context->last_name_resolution_table= NULL;
- func_expr->walk(&Item::change_context_processor, 0, (byte*) context);
+ func_expr->walk(&Item::change_context_processor, 0, (uchar*) context);
save_where= thd->where;
thd->where= "partition function";
/*
@@ -1660,12 +1667,12 @@ bool fix_partition_func(THD *thd, TABLE *table,
my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0));
goto end;
}
- if (unlikely(create_full_part_field_array(table, part_info)))
+ if (unlikely(create_full_part_field_array(thd, table, part_info)))
goto end;
if (unlikely(check_primary_key(table)))
goto end;
- if (unlikely((!(table->s->db_type->partition_flags &&
- (table->s->db_type->partition_flags() & HA_CAN_PARTITION_UNIQUE))) &&
+ if (unlikely((!(table->s->db_type()->partition_flags &&
+ (table->s->db_type()->partition_flags() & HA_CAN_PARTITION_UNIQUE))) &&
check_unique_keys(table)))
goto end;
if (unlikely(set_up_partition_bitmap(thd, part_info)))
@@ -1697,7 +1704,7 @@ end:
static int add_write(File fptr, const char *buf, uint len)
{
- uint len_written= my_write(fptr, (const byte*)buf, len, MYF(0));
+ uint len_written= my_write(fptr, (const uchar*)buf, len, MYF(0));
if (likely(len == len_written))
return 0;
@@ -1872,7 +1879,7 @@ static int add_keyword_int(File fptr, const char *keyword, longlong num)
static int add_engine(File fptr, handlerton *engine_type)
{
- const char *engine_str= hton2plugin[engine_type->slot]->name.str;
+ const char *engine_str= ha_resolve_storage_engine_name(engine_type);
DBUG_PRINT("info", ("ENGINE: %s", engine_str));
int err= add_string(fptr, "ENGINE = ");
return err + add_string(fptr, engine_str);
@@ -2144,13 +2151,13 @@ char *generate_partition_syntax(partition_info *part_info,
goto close_file;
*buf_length= (uint)buffer_length;
if (use_sql_alloc)
- buf= sql_alloc(*buf_length+1);
+ buf= (char*) sql_alloc(*buf_length+1);
else
- buf= my_malloc(*buf_length+1, MYF(MY_WME));
+ buf= (char*) my_malloc(*buf_length+1, MYF(MY_WME));
if (!buf)
goto close_file;
- if (unlikely(my_read(fptr, (byte*)buf, *buf_length, MYF(MY_FNABP))))
+ if (unlikely(my_read(fptr, (uchar*)buf, *buf_length, MYF(MY_FNABP))))
{
if (!use_sql_alloc)
my_free(buf, MYF(0));
@@ -2188,8 +2195,8 @@ bool partition_key_modified(TABLE *table, const MY_BITMAP *fields)
if (!part_info)
DBUG_RETURN(FALSE);
- if (table->s->db_type->partition_flags &&
- (table->s->db_type->partition_flags() & HA_CAN_UPDATE_PARTITION_KEY))
+ if (table->s->db_type()->partition_flags &&
+ (table->s->db_type()->partition_flags() & HA_CAN_UPDATE_PARTITION_KEY))
DBUG_RETURN(FALSE);
for (fld= part_info->full_part_field_array; *fld; fld++)
if (bitmap_is_set(fields, (*fld)->field_index))
@@ -2413,8 +2420,8 @@ static uint32 get_part_id_linear_key(partition_info *part_info,
*/
static void copy_to_part_field_buffers(Field **ptr,
- char **field_bufs,
- char **restore_ptr)
+ uchar **field_bufs,
+ uchar **restore_ptr)
{
Field *field;
while ((field= *(ptr++)))
@@ -2425,7 +2432,7 @@ static void copy_to_part_field_buffers(Field **ptr,
{
CHARSET_INFO *cs= ((Field_str*)field)->charset();
uint len= field->pack_length();
- char *field_buf= *field_bufs;
+ uchar *field_buf= *field_bufs;
/*
We only use the field buffer for VARCHAR and CHAR strings
which isn't of a binary collation. We also only use the
@@ -2436,17 +2443,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, (uchar*)(field_buf + len_bytes), (len - len_bytes),
- (uchar*)(field->ptr + len_bytes), field->field_length);
+ my_strnxfrm(cs, field_buf + len_bytes, (len - len_bytes),
+ field->ptr + len_bytes, field->field_length);
if (len_bytes == 1)
- *field_buf= (uchar)field->field_length;
+ *field_buf= (uchar) field->field_length;
else
int2store(field_buf, field->field_length);
}
else
{
- my_strnxfrm(cs, (uchar*)field_buf, len,
- (uchar*)field->ptr, field->field_length);
+ my_strnxfrm(cs, field_buf, len,
+ field->ptr, field->field_length);
}
field->ptr= field_buf;
}
@@ -2465,7 +2472,7 @@ static void copy_to_part_field_buffers(Field **ptr,
RETURN VALUES
*/
-static void restore_part_field_pointers(Field **ptr, char **restore_ptr)
+static void restore_part_field_pointers(Field **ptr, uchar **restore_ptr)
{
Field *field;
while ((field= *(ptr++)))
@@ -2736,7 +2743,8 @@ uint32 get_list_array_idx_for_endpoint(partition_info *part_info,
uint min_list_index= 0, max_list_index= part_info->no_list_values - 1;
longlong list_value;
/* Get the partitioning function value for the endpoint */
- longlong part_func_value= part_val_int(part_info->part_expr);
+ longlong part_func_value=
+ part_info->part_expr->val_int_endpoint(left_endpoint, &include_endpoint);
bool unsigned_flag= part_info->part_expr->unsigned_flag;
DBUG_ENTER("get_list_array_idx_for_endpoint");
@@ -2880,7 +2888,9 @@ uint32 get_partition_id_range_for_endpoint(partition_info *part_info,
uint max_partition= part_info->no_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= part_val_int(part_info->part_expr);
+ longlong part_func_value=
+ part_info->part_expr->val_int_endpoint(left_endpoint, &include_endpoint);
+
bool unsigned_flag= part_info->part_expr->unsigned_flag;
DBUG_ENTER("get_partition_id_range_for_endpoint");
@@ -2893,6 +2903,8 @@ uint32 get_partition_id_range_for_endpoint(partition_info *part_info,
}
if (unsigned_flag)
part_func_value-= 0x8000000000000000ULL;
+ if (left_endpoint && !include_endpoint)
+ part_func_value++;
while (max_part_id > min_part_id)
{
loc_part_id= (max_part_id + min_part_id + 1) >> 1;
@@ -3307,18 +3319,20 @@ static bool check_part_func_bound(Field **ptr)
get the partition identity and restore field pointers afterwards.
*/
-static uint32 get_sub_part_id_from_key(const TABLE *table,byte *buf,
+static uint32 get_sub_part_id_from_key(const TABLE *table,uchar *buf,
KEY *key_info,
const key_range *key_spec)
{
- byte *rec0= table->record[0];
+ uchar *rec0= table->record[0];
partition_info *part_info= table->part_info;
uint32 part_id;
DBUG_ENTER("get_sub_part_id_from_key");
- key_restore(buf, (byte*)key_spec->key, key_info, key_spec->length);
+ key_restore(buf, (uchar*)key_spec->key, key_info, key_spec->length);
if (likely(rec0 == buf))
+ {
part_id= part_info->get_subpartition_id(part_info);
+ }
else
{
Field **part_field_array= part_info->subpart_field_array;
@@ -3350,19 +3364,21 @@ static uint32 get_sub_part_id_from_key(const TABLE *table,byte *buf,
get the partition identity and restore field pointers afterwards.
*/
-bool get_part_id_from_key(const TABLE *table, byte *buf, KEY *key_info,
+bool get_part_id_from_key(const TABLE *table, uchar *buf, KEY *key_info,
const key_range *key_spec, uint32 *part_id)
{
bool result;
- byte *rec0= table->record[0];
+ uchar *rec0= table->record[0];
partition_info *part_info= table->part_info;
longlong func_value;
DBUG_ENTER("get_part_id_from_key");
- key_restore(buf, (byte*)key_spec->key, key_info, key_spec->length);
+ key_restore(buf, (uchar*)key_spec->key, key_info, key_spec->length);
if (likely(rec0 == buf))
+ {
result= part_info->get_part_partition_id(part_info, part_id,
&func_value);
+ }
else
{
Field **part_field_array= part_info->part_field_array;
@@ -3395,21 +3411,23 @@ bool get_part_id_from_key(const TABLE *table, byte *buf, KEY *key_info,
get the partition identity and restore field pointers afterwards.
*/
-void get_full_part_id_from_key(const TABLE *table, byte *buf,
+void get_full_part_id_from_key(const TABLE *table, uchar *buf,
KEY *key_info,
const key_range *key_spec,
part_id_range *part_spec)
{
bool result;
partition_info *part_info= table->part_info;
- byte *rec0= table->record[0];
+ uchar *rec0= table->record[0];
longlong func_value;
DBUG_ENTER("get_full_part_id_from_key");
- key_restore(buf, (byte*)key_spec->key, key_info, key_spec->length);
+ key_restore(buf, (uchar*)key_spec->key, key_info, key_spec->length);
if (likely(rec0 == buf))
+ {
result= part_info->get_partition_id(part_info, &part_spec->start_part,
&func_value);
+ }
else
{
Field **part_field_array= part_info->full_part_field_array;
@@ -3494,7 +3512,7 @@ void prune_partition_set(const TABLE *table, part_id_range *part_spec)
RETURN VALUE
part_spec
*/
-void get_partition_set(const TABLE *table, byte *buf, const uint index,
+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;
@@ -3687,6 +3705,8 @@ void get_partition_set(const TABLE *table, byte *buf, const uint index,
table Table object of partitioned table
create_table_ind Is it called from CREATE TABLE
default_db_type What is the default engine of the table
+ work_part_info_used Flag is raised if we don't create new
+ part_info, but used thd->work_part_info
RETURN VALUE
TRUE Error
@@ -3707,7 +3727,8 @@ bool mysql_unpack_partition(THD *thd,
const char *part_buf, uint part_info_len,
const char *part_state, uint part_state_len,
TABLE* table, bool is_create_table_ind,
- handlerton *default_db_type)
+ handlerton *default_db_type,
+ bool *work_part_info_used)
{
bool result= TRUE;
partition_info *part_info;
@@ -3718,7 +3739,11 @@ bool mysql_unpack_partition(THD *thd,
thd->lex= &lex;
thd->variables.character_set_client= system_charset_info;
- lex_start(thd, part_buf, part_info_len);
+
+ Lex_input_stream lip(thd, part_buf, part_info_len);
+
+ lex_start(thd);
+ *work_part_info_used= false;
/*
We need to use the current SELECT_LEX since I need to keep the
Name_resolution_context object which is referenced from the
@@ -3745,7 +3770,7 @@ bool mysql_unpack_partition(THD *thd,
lex.part_info->part_state= part_state;
lex.part_info->part_state_len= part_state_len;
DBUG_PRINT("info", ("Parse: %s", part_buf));
- if (MYSQLparse((void*)thd) || thd->is_fatal_error)
+ if (parse_sql(thd, &lip, NULL))
{
thd->free_items();
goto end;
@@ -3772,20 +3797,15 @@ bool mysql_unpack_partition(THD *thd,
ha_legacy_type(default_db_type)));
if (is_create_table_ind && old_lex->sql_command == SQLCOM_CREATE_TABLE)
{
- if (old_lex->like_name)
+ if (old_lex->create_info.options & HA_LEX_CREATE_TABLE_LIKE)
{
/*
- This code is executed when we do a CREATE TABLE t1 LIKE t2
- old_lex->like_name contains the t2 and the table we are opening has
- name t1.
+ This code is executed when we create table in CREATE TABLE t1 LIKE t2.
+ old_lex->query_tables contains table list element for t2 and the table
+ we are opening has name t1.
*/
- Table_ident *table_ident= old_lex->like_name;
- char *src_db= table_ident->db.str ? table_ident->db.str : thd->db;
- char *src_table= table_ident->table.str;
- char buf[FN_REFLEN];
- build_table_filename(buf, sizeof(buf), src_db, src_table, "", 0);
- if (partition_default_handling(table, part_info,
- FALSE, buf))
+ if (partition_default_handling(table, part_info, FALSE,
+ old_lex->query_tables->table->s->path.str))
{
result= TRUE;
goto end;
@@ -3808,6 +3828,7 @@ bool mysql_unpack_partition(THD *thd,
thd->free_items();
part_info= thd->work_part_info;
table->s->version= 0UL;
+ *work_part_info_used= true;
}
}
table->part_info= part_info;
@@ -3831,9 +3852,9 @@ bool mysql_unpack_partition(THD *thd,
char *part_func_string= NULL;
char *subpart_func_string= NULL;
if ((part_func_len &&
- !((part_func_string= thd->alloc(part_func_len)))) ||
+ !((part_func_string= (char*) thd->alloc(part_func_len)))) ||
(subpart_func_len &&
- !((subpart_func_string= thd->alloc(subpart_func_len)))))
+ !((subpart_func_string= (char*) thd->alloc(subpart_func_len)))))
{
mem_alloc_error(part_func_len);
thd->free_items();
@@ -4126,7 +4147,7 @@ error:
change patterns.
*/
-uint prep_alter_part_table(THD *thd, TABLE *table, ALTER_INFO *alter_info,
+uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
HA_CREATE_INFO *create_info,
handlerton *old_db_type,
bool *partition_changed,
@@ -4204,8 +4225,8 @@ uint prep_alter_part_table(THD *thd, TABLE *table, ALTER_INFO *alter_info,
alter_info->no_parts= curr_part_no - new_part_no;
}
}
- if (table->s->db_type->alter_table_flags &&
- (!(flags= table->s->db_type->alter_table_flags(alter_info->flags))))
+ if (table->s->db_type()->alter_table_flags &&
+ (!(flags= table->s->db_type()->alter_table_flags(alter_info->flags))))
{
my_error(ER_PARTITION_FUNCTION_FAILURE, MYF(0));
DBUG_RETURN(1);
@@ -4951,7 +4972,7 @@ the generated partition syntax in a correct manner.
create_info->db_type= table->part_info->default_engine_type;
}
DBUG_PRINT("info", ("New engine type: %s",
- hton2plugin[create_info->db_type->slot]->name.str));
+ ha_resolve_storage_engine_name(create_info->db_type)));
thd->work_part_info= NULL;
*partition_changed= TRUE;
}
@@ -5484,8 +5505,7 @@ static bool write_log_drop_shadow_frm(ALTER_PARTITION_PARAM_TYPE *lpt)
char shadow_path[FN_LEN];
DBUG_ENTER("write_log_drop_shadow_frm");
- build_table_filename(shadow_path, sizeof(shadow_path), lpt->db,
- lpt->table_name, "#", 0);
+ build_table_shadow_filename(shadow_path, sizeof(shadow_path), lpt);
pthread_mutex_lock(&LOCK_gdl);
if (write_log_replace_delete_frm(lpt, 0UL, NULL,
(const char*)shadow_path, FALSE))
@@ -5533,8 +5553,7 @@ static bool write_log_rename_frm(ALTER_PARTITION_PARAM_TYPE *lpt)
part_info->first_log_entry= NULL;
build_table_filename(path, sizeof(path), lpt->db,
lpt->table_name, "", 0);
- build_table_filename(shadow_path, sizeof(shadow_path), lpt->db,
- lpt->table_name, "#", 0);
+ build_table_shadow_filename(shadow_path, sizeof(shadow_path), lpt);
pthread_mutex_lock(&LOCK_gdl);
if (write_log_replace_delete_frm(lpt, 0UL, shadow_path, path, TRUE))
goto error;
@@ -5699,8 +5718,7 @@ static bool write_log_final_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
part_info->first_log_entry= NULL;
build_table_filename(path, sizeof(path), lpt->db,
lpt->table_name, "", 0);
- build_table_filename(shadow_path, sizeof(shadow_path), lpt->db,
- lpt->table_name, "#", 0);
+ build_table_shadow_filename(shadow_path, sizeof(shadow_path), lpt);
pthread_mutex_lock(&LOCK_gdl);
if (write_log_dropped_partitions(lpt, &next_entry, (const char*)path,
lpt->alter_info->flags & ALTER_REORGANIZE_PARTITION))
@@ -5992,8 +6010,6 @@ void handle_alter_part_error(ALTER_PARTITION_PARAM_TYPE *lpt,
alter_info ALTER TABLE info
create_info Create info for CREATE TABLE
table_list List of the table involved
- create_list The fields in the resulting table
- key_list The keys in the resulting table
db Database name of new table
table_name Table name of new table
@@ -6007,11 +6023,10 @@ void handle_alter_part_error(ALTER_PARTITION_PARAM_TYPE *lpt,
*/
uint fast_alter_partition_table(THD *thd, TABLE *table,
- ALTER_INFO *alter_info,
+ Alter_info *alter_info,
HA_CREATE_INFO *create_info,
TABLE_LIST *table_list,
- List<create_field> *create_list,
- List<Key> *key_list, char *db,
+ char *db,
const char *table_name,
uint fast_alter_partition)
{
@@ -6028,8 +6043,6 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
lpt->part_info= part_info;
lpt->alter_info= alter_info;
lpt->create_info= create_info;
- lpt->create_list= create_list;
- lpt->key_list= key_list;
lpt->db_options= create_info->table_options;
if (create_info->row_type == ROW_TYPE_DYNAMIC)
lpt->db_options|= HA_OPTION_PACK_RECORD;
@@ -6107,7 +6120,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
The first approach here was to downgrade locks. Now a different approach
is decided upon. The idea is that the handler will have access to the
- ALTER_INFO when store_lock arrives with TL_WRITE_ALLOW_READ. So if the
+ Alter_info when store_lock arrives with TL_WRITE_ALLOW_READ. So if the
handler knows that this functionality can be handled with a lower lock
level it will set the lock level to TL_WRITE_ALLOW_WRITE immediately.
Thus the need to downgrade the lock disappears.
@@ -6380,7 +6393,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
user
*/
DBUG_RETURN(fast_end_partition(thd, lpt->copied, lpt->deleted,
- table, table_list, FALSE, lpt,
+ table, table_list, FALSE, NULL,
written_bin_log));
}
#endif
@@ -6404,8 +6417,8 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
also for other programs.
*/
-void set_field_ptr(Field **ptr, const byte *new_buf,
- const byte *old_buf)
+void set_field_ptr(Field **ptr, const uchar *new_buf,
+ const uchar *old_buf)
{
my_ptrdiff_t diff= (new_buf - old_buf);
DBUG_ENTER("set_field_ptr");
@@ -6438,8 +6451,8 @@ void set_field_ptr(Field **ptr, const byte *new_buf,
also for other programs.
*/
-void set_key_field_ptr(KEY *key_info, const byte *new_buf,
- const byte *old_buf)
+void set_key_field_ptr(KEY *key_info, const uchar *new_buf,
+ const uchar *old_buf)
{
KEY_PART_INFO *key_part= key_info->key_part;
uint key_parts= key_info->key_parts;
@@ -6580,8 +6593,6 @@ void make_used_partitions_str(partition_info *part_info, String *parts_str)
#ifdef WITH_PARTITION_STORAGE_ENGINE
static void set_up_range_analysis_info(partition_info *part_info)
{
- enum_monotonicity_info minfo;
-
/* Set the catch-all default */
part_info->get_part_iter_for_interval= NULL;
part_info->get_subpart_iter_for_interval= NULL;
@@ -6593,11 +6604,8 @@ static void set_up_range_analysis_info(partition_info *part_info)
switch (part_info->part_type) {
case RANGE_PARTITION:
case LIST_PARTITION:
- minfo= part_info->part_expr->get_monotonicity_info();
- if (minfo != NON_MONOTONIC)
+ if (part_info->part_expr->get_monotonicity_info() != NON_MONOTONIC)
{
- part_info->range_analysis_include_bounds=
- test(minfo == MONOTONIC_INCREASING);
part_info->get_part_iter_for_interval=
get_part_iter_for_interval_via_mapping;
goto setup_subparts;
@@ -6690,7 +6698,7 @@ typedef uint32 (*get_endpoint_func)(partition_info*, bool left_endpoint,
int get_part_iter_for_interval_via_mapping(partition_info *part_info,
bool is_subpart,
- char *min_value, char *max_value,
+ uchar *min_value, uchar *max_value,
uint flags,
PARTITION_ITERATOR *part_iter)
{
@@ -6765,8 +6773,7 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
index-in-ordered-array-of-list-constants (for LIST) space.
*/
store_key_image_to_rec(field, min_value, field_len);
- bool include_endp= part_info->range_analysis_include_bounds ||
- !test(flags & NEAR_MIN);
+ bool include_endp= !test(flags & NEAR_MIN);
part_iter->part_nums.start= get_endpoint(part_info, 1, include_endp);
part_iter->part_nums.cur= part_iter->part_nums.start;
if (part_iter->part_nums.start == max_endpoint_val)
@@ -6780,8 +6787,7 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
else
{
store_key_image_to_rec(field, max_value, field_len);
- bool include_endp= part_info->range_analysis_include_bounds ||
- !test(flags & NEAR_MAX);
+ bool include_endp= !test(flags & NEAR_MAX);
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)
@@ -6846,7 +6852,7 @@ 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,
- char *min_value, char *max_value,
+ uchar *min_value, uchar *max_value,
uint flags,
PARTITION_ITERATOR *part_iter)
{
diff --git a/sql/sql_partition.h b/sql/sql_partition.h
index e0c0f1c5bd3..56f24181b93 100644
--- a/sql/sql_partition.h
+++ b/sql/sql_partition.h
@@ -56,11 +56,11 @@ bool check_reorganise_list(partition_info *new_part_info,
partition_info *old_part_info,
List<char> list_part_names);
handler *get_ha_partition(partition_info *part_info);
-int get_parts_for_update(const byte *old_data, byte *new_data,
- const byte *rec0, partition_info *part_info,
+int get_parts_for_update(const uchar *old_data, uchar *new_data,
+ const uchar *rec0, partition_info *part_info,
uint32 *old_part_id, uint32 *new_part_id,
longlong *func_value);
-int get_part_for_delete(const byte *buf, const byte *rec0,
+int get_part_for_delete(const uchar *buf, const uchar *rec0,
partition_info *part_info, uint32 *part_id);
void prune_partition_set(const TABLE *table, part_id_range *part_spec);
bool check_partition_info(partition_info *part_info,handlerton **eng_type,
@@ -70,10 +70,10 @@ 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, byte *buf, const uint index,
+void get_partition_set(const TABLE *table, uchar *buf, const uint index,
const key_range *key_spec,
part_id_range *part_spec);
-void get_full_part_id_from_key(const TABLE *table, byte *buf,
+void get_full_part_id_from_key(const TABLE *table, uchar *buf,
KEY *key_info,
const key_range *key_spec,
part_id_range *part_spec);
@@ -81,7 +81,8 @@ bool mysql_unpack_partition(THD *thd, const char *part_buf,
uint part_info_len,
const char *part_state, uint part_state_len,
TABLE *table, bool is_create_table_ind,
- handlerton *default_db_type);
+ handlerton *default_db_type,
+ bool *work_part_info_used);
void make_used_partitions_str(partition_info *part_info, String *parts_str);
uint32 get_list_array_idx_for_endpoint(partition_info *part_info,
bool left_endpoint,
@@ -201,7 +202,7 @@ typedef struct st_partition_iter
typedef int (*get_partitions_in_range_iter)(partition_info *part_info,
bool is_subpart,
- char *min_val, char *max_val,
+ uchar *min_val, uchar *max_val,
uint flags,
PARTITION_ITERATOR *part_iter);
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index bc3e3cf0b05..2d33da29b77 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -15,15 +15,25 @@
#include "mysql_priv.h"
#include <my_pthread.h>
+#include <my_getopt.h>
#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[];
+char *opt_plugin_load= NULL;
char *opt_plugin_dir_ptr;
char opt_plugin_dir[FN_REFLEN];
/*
- When you ad a new plugin type, add both a string and make sure that the
+ When you ad a new plugin type, add both a string and make sure that the
init and deinit array are correctly updated.
*/
const LEX_STRING plugin_type_names[MYSQL_MAX_PLUGIN_TYPE_NUM]=
@@ -39,10 +49,10 @@ extern int initialize_schema_table(st_plugin_int *plugin);
extern int finalize_schema_table(st_plugin_int *plugin);
/*
- The number of elements in both plugin_type_initialize and
+ The number of elements in both plugin_type_initialize and
plugin_type_deinitialize should equal to the number of plugins
defined.
-*/
+*/
plugin_type_init plugin_type_initialize[MYSQL_MAX_PLUGIN_TYPE_NUM]=
{
0,ha_initialize_handlerton,0,0,initialize_schema_table
@@ -82,28 +92,198 @@ static int cur_plugin_info_interface_version[MYSQL_MAX_PLUGIN_TYPE_NUM]=
MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION
};
+static bool initialized= 0;
+
+/*
+ A mutex LOCK_plugin must be acquired before accessing the
+ following variables/structures.
+ We are always manipulating ref count, so a rwlock here is unneccessary.
+*/
+pthread_mutex_t LOCK_plugin;
static DYNAMIC_ARRAY plugin_dl_array;
static DYNAMIC_ARRAY plugin_array;
static HASH plugin_hash[MYSQL_MAX_PLUGIN_TYPE_NUM];
-static rw_lock_t THR_LOCK_plugin;
-static bool initialized= 0;
-
+static bool reap_needed= false;
static int plugin_array_version=0;
+/*
+ write-lock on LOCK_system_variables_hash is required before modifying
+ the following variables/structures
+*/
+static MEM_ROOT plugin_mem_root;
+static uint global_variables_dynamic_size= 0;
+static HASH bookmark_hash;
+
+
+/*
+ hidden part of opaque value passed to variable check functions.
+ Used to provide a object-like structure to non C++ consumers.
+*/
+struct st_item_value_holder : public st_mysql_value
+{
+ Item *item;
+};
+
+
+/*
+ stored in bookmark_hash, this structure is never removed from the
+ hash and is used to mark a single offset for a thd local variable
+ even if plugins have been uninstalled and reinstalled, repeatedly.
+ This structure is allocated from plugin_mem_root.
+
+ The key format is as follows:
+ 1 byte - variable type code
+ name_len bytes - variable name
+ '\0' - end of key
+*/
+struct st_bookmark
+{
+ uint name_len;
+ int offset;
+ uint version;
+ char key[1];
+};
+
+
+/*
+ skeleton of a plugin variable - portion of structure common to all.
+*/
+struct st_mysql_sys_var
+{
+ MYSQL_PLUGIN_VAR_HEADER;
+};
+
+
+/*
+ sys_var class for access to all plugin variables visible to the user
+*/
+class sys_var_pluginvar: public sys_var
+{
+public:
+ struct st_plugin_int *plugin;
+ struct st_mysql_sys_var *plugin_var;
+
+ static void *operator new(size_t size, MEM_ROOT *mem_root)
+ { return (void*) alloc_root(mem_root, (uint) size); }
+ static void operator delete(void *ptr_arg,size_t size)
+ { TRASH(ptr_arg, size); }
+
+ sys_var_pluginvar(const char *name_arg,
+ struct st_mysql_sys_var *plugin_var_arg)
+ :sys_var(name_arg), plugin_var(plugin_var_arg) {}
+ sys_var_pluginvar *cast_pluginvar() { return this; }
+ bool is_readonly() const { return plugin_var->flags & PLUGIN_VAR_READONLY; }
+ bool check_type(enum_var_type type)
+ { return !(plugin_var->flags & PLUGIN_VAR_THDLOCAL) && type != OPT_GLOBAL; }
+ bool check_update_type(Item_result type);
+ SHOW_TYPE show_type();
+ uchar* real_value_ptr(THD *thd, enum_var_type type);
+ TYPELIB* plugin_var_typelib(void);
+ uchar* value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
+ bool check(THD *thd, set_var *var);
+ void set_default(THD *thd, enum_var_type type);
+ bool update(THD *thd, set_var *var);
+};
+
+
/* prototypes */
-my_bool plugin_register_builtin(struct st_mysql_plugin *plugin);
-void plugin_load(void);
+static void plugin_load(MEM_ROOT *tmp_root, int *argc, char **argv);
+static bool plugin_load_list(MEM_ROOT *tmp_root, int *argc, char **argv,
+ const char *list);
+static int test_plugin_options(MEM_ROOT *, struct st_plugin_int *,
+ int *, char **, my_bool);
+static bool register_builtin(struct st_mysql_plugin *, struct st_plugin_int *,
+ struct st_plugin_int **);
+static void unlock_variables(THD *thd, struct system_variables *vars);
+static void cleanup_variables(THD *thd, struct system_variables *vars);
+static void plugin_vars_free_values(sys_var *vars);
+static void plugin_opt_set_limits(struct my_option *options,
+ const struct st_mysql_sys_var *opt);
+#define my_intern_plugin_lock(A,B) intern_plugin_lock(A,B CALLER_INFO)
+#define my_intern_plugin_lock_ci(A,B) intern_plugin_lock(A,B ORIG_CALLER_INFO)
+static plugin_ref intern_plugin_lock(LEX *lex, plugin_ref plugin
+ CALLER_INFO_PROTO);
+static void intern_plugin_unlock(LEX *lex, plugin_ref plugin);
+static void reap_plugins(void);
+
+
+/* declared in set_var.cc */
+extern sys_var *intern_find_sys_var(const char *str, uint length, bool no_error);
+
+#ifdef EMBEDDED_LIBRARY
+/* declared in sql_base.cc */
+extern bool check_if_table_exists(THD *thd, TABLE_LIST *table, bool *exists);
+#endif /* EMBEDDED_LIBRARY */
+
+
+/****************************************************************************
+ Value type thunks, allows the C world to play in the C++ world
+****************************************************************************/
+
+static int item_value_type(struct st_mysql_value *value)
+{
+ switch (((st_item_value_holder*)value)->item->result_type()) {
+ case INT_RESULT:
+ return MYSQL_VALUE_TYPE_INT;
+ case REAL_RESULT:
+ return MYSQL_VALUE_TYPE_REAL;
+ default:
+ return MYSQL_VALUE_TYPE_STRING;
+ }
+}
+
+static const char *item_val_str(struct st_mysql_value *value,
+ char *buffer, int *length)
+{
+ String str(buffer, *length, system_charset_info), *res;
+ if (!(res= ((st_item_value_holder*)value)->item->val_str(&str)))
+ return NULL;
+ *length= res->length();
+ if (res->c_ptr_quick() == buffer)
+ return buffer;
+
+ /*
+ Lets be nice and create a temporary string since the
+ buffer was too small
+ */
+ return current_thd->strmake(res->c_ptr_quick(), res->length());
+}
+
+
+static int item_val_int(struct st_mysql_value *value, long long *buf)
+{
+ Item *item= ((st_item_value_holder*)value)->item;
+ *buf= item->val_int();
+ if (item->is_null())
+ return 1;
+ return 0;
+}
+
+
+static int item_val_real(struct st_mysql_value *value, double *buf)
+{
+ Item *item= ((st_item_value_holder*)value)->item;
+ *buf= item->val_real();
+ if (item->is_null())
+ return 1;
+ return 0;
+}
+
+
+/****************************************************************************
+ Plugin support code
+****************************************************************************/
#ifdef HAVE_DLOPEN
static struct st_plugin_dl *plugin_dl_find(const LEX_STRING *dl)
{
uint i;
+ struct st_plugin_dl *tmp;
DBUG_ENTER("plugin_dl_find");
for (i= 0; i < plugin_dl_array.elements; i++)
{
- struct st_plugin_dl *tmp= dynamic_element(&plugin_dl_array, i,
- struct st_plugin_dl *);
+ tmp= *dynamic_element(&plugin_dl_array, i, struct st_plugin_dl **);
if (tmp->ref_count &&
! my_strnncoll(files_charset_info,
(const uchar *)dl->str, dl->length,
@@ -117,21 +297,24 @@ static struct st_plugin_dl *plugin_dl_find(const LEX_STRING *dl)
static st_plugin_dl *plugin_dl_insert_or_reuse(struct st_plugin_dl *plugin_dl)
{
uint i;
+ struct st_plugin_dl *tmp;
DBUG_ENTER("plugin_dl_insert_or_reuse");
for (i= 0; i < plugin_dl_array.elements; i++)
{
- struct st_plugin_dl *tmp= dynamic_element(&plugin_dl_array, i,
- struct st_plugin_dl *);
+ tmp= *dynamic_element(&plugin_dl_array, i, struct st_plugin_dl **);
if (! tmp->ref_count)
{
memcpy(tmp, plugin_dl, sizeof(struct st_plugin_dl));
DBUG_RETURN(tmp);
}
}
- if (insert_dynamic(&plugin_dl_array, (gptr)plugin_dl))
+ if (insert_dynamic(&plugin_dl_array, (uchar*)&plugin_dl))
DBUG_RETURN(0);
- DBUG_RETURN(dynamic_element(&plugin_dl_array, plugin_dl_array.elements - 1,
- struct st_plugin_dl *));
+ tmp= *dynamic_element(&plugin_dl_array, plugin_dl_array.elements - 1,
+ struct st_plugin_dl **)=
+ (struct st_plugin_dl *) memdup_root(&plugin_mem_root, (uchar*)plugin_dl,
+ sizeof(struct st_plugin_dl));
+ DBUG_RETURN(tmp);
}
#endif /* HAVE_DLOPEN */
@@ -144,9 +327,10 @@ static inline void free_plugin_mem(struct st_plugin_dl *p)
#endif
my_free(p->dl.str, MYF(MY_ALLOW_ZERO_PTR));
if (p->version != MYSQL_PLUGIN_INTERFACE_VERSION)
- my_free((gptr)p->plugins, MYF(MY_ALLOW_ZERO_PTR));
+ my_free((uchar*)p->plugins, MYF(MY_ALLOW_ZERO_PTR));
}
+
static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
{
#ifdef HAVE_DLOPEN
@@ -295,7 +479,7 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
/* Duplicate and convert dll name */
plugin_dl.dl.length= dl->length * files_charset_info->mbmaxlen + 1;
- if (! (plugin_dl.dl.str= my_malloc(plugin_dl.dl.length, MYF(0))))
+ if (! (plugin_dl.dl.str= (char*) my_malloc(plugin_dl.dl.length, MYF(0))))
{
free_plugin_mem(&plugin_dl);
if (report & REPORT_TO_USER)
@@ -335,10 +519,13 @@ static void plugin_dl_del(const LEX_STRING *dl)
#ifdef HAVE_DLOPEN
uint i;
DBUG_ENTER("plugin_dl_del");
+
+ safe_mutex_assert_owner(&LOCK_plugin);
+
for (i= 0; i < plugin_dl_array.elements; i++)
{
- struct st_plugin_dl *tmp= dynamic_element(&plugin_dl_array, i,
- struct st_plugin_dl *);
+ struct st_plugin_dl *tmp= *dynamic_element(&plugin_dl_array, i,
+ struct st_plugin_dl **);
if (tmp->ref_count &&
! my_strnncoll(files_charset_info,
(const uchar *)dl->str, dl->length,
@@ -364,50 +551,121 @@ static struct st_plugin_int *plugin_find_internal(const LEX_STRING *name, int ty
DBUG_ENTER("plugin_find_internal");
if (! initialized)
DBUG_RETURN(0);
+
+ safe_mutex_assert_owner(&LOCK_plugin);
+
if (type == MYSQL_ANY_PLUGIN)
{
for (i= 0; i < MYSQL_MAX_PLUGIN_TYPE_NUM; i++)
{
struct st_plugin_int *plugin= (st_plugin_int *)
- hash_search(&plugin_hash[i], (const byte *)name->str, name->length);
+ 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 byte *)name->str, name->length));
+ hash_search(&plugin_hash[type], (const uchar *)name->str, name->length));
DBUG_RETURN(0);
}
-my_bool plugin_is_ready(const LEX_STRING *name, int type)
+static SHOW_COMP_OPTION plugin_status(const LEX_STRING *name, int type)
{
- my_bool rc= FALSE;
+ SHOW_COMP_OPTION rc= SHOW_OPTION_NO;
struct st_plugin_int *plugin;
DBUG_ENTER("plugin_is_ready");
- rw_rdlock(&THR_LOCK_plugin);
- if ((plugin= plugin_find_internal(name, type)) &&
- plugin->state == PLUGIN_IS_READY)
- rc= TRUE;
- rw_unlock(&THR_LOCK_plugin);
+ pthread_mutex_lock(&LOCK_plugin);
+ if ((plugin= plugin_find_internal(name, type)))
+ {
+ rc= SHOW_OPTION_DISABLED;
+ if (plugin->state == PLUGIN_IS_READY)
+ rc= SHOW_OPTION_YES;
+ }
+ pthread_mutex_unlock(&LOCK_plugin);
DBUG_RETURN(rc);
}
-struct st_plugin_int *plugin_lock(const LEX_STRING *name, int type)
+bool plugin_is_ready(const LEX_STRING *name, int type)
{
- struct st_plugin_int *rc;
- DBUG_ENTER("plugin_lock");
- rw_wrlock(&THR_LOCK_plugin);
- if ((rc= plugin_find_internal(name, type)))
+ bool rc= FALSE;
+ if (plugin_status(name, type) == SHOW_OPTION_YES)
+ rc= TRUE;
+ return rc;
+}
+
+
+SHOW_COMP_OPTION sys_var_have_plugin::get_option()
+{
+ LEX_STRING plugin_name= { (char *) plugin_name_str, plugin_name_len };
+ return plugin_status(&plugin_name, plugin_type);
+}
+
+
+static plugin_ref intern_plugin_lock(LEX *lex, plugin_ref rc CALLER_INFO_PROTO)
+{
+ st_plugin_int *pi= plugin_ref_to_int(rc);
+ DBUG_ENTER("intern_plugin_lock");
+
+ safe_mutex_assert_owner(&LOCK_plugin);
+
+ if (pi->state & (PLUGIN_IS_READY | PLUGIN_IS_UNINITIALIZED))
{
- if (rc->state & (PLUGIN_IS_READY | PLUGIN_IS_UNINITIALIZED))
- rc->ref_count++;
- else
- rc= 0;
+ plugin_ref plugin;
+#ifdef DBUG_OFF
+ /* built-in plugins don't need ref counting */
+ if (!pi->plugin_dl)
+ DBUG_RETURN(pi);
+
+ plugin= pi;
+#else
+ /*
+ 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.
+ */
+ if (!(plugin= (plugin_ref) my_malloc_ci(sizeof(pi), MYF(MY_WME))))
+ DBUG_RETURN(NULL);
+
+ *plugin= pi;
+#endif
+ pi->ref_count++;
+ DBUG_PRINT("info",("thd: 0x%lx, plugin: \"%s\", ref_count: %d",
+ (long) current_thd, pi->name.str, pi->ref_count));
+
+ if (lex)
+ insert_dynamic(&lex->plugins, (uchar*)&plugin);
+ DBUG_RETURN(plugin);
}
- rw_unlock(&THR_LOCK_plugin);
+ DBUG_RETURN(NULL);
+}
+
+
+plugin_ref plugin_lock(THD *thd, plugin_ref *ptr CALLER_INFO_PROTO)
+{
+ LEX *lex= thd ? thd->lex : 0;
+ plugin_ref rc;
+ DBUG_ENTER("plugin_lock");
+ pthread_mutex_lock(&LOCK_plugin);
+ rc= my_intern_plugin_lock_ci(lex, *ptr);
+ pthread_mutex_unlock(&LOCK_plugin);
+ DBUG_RETURN(rc);
+}
+
+
+plugin_ref plugin_lock_by_name(THD *thd, const LEX_STRING *name, int type
+ CALLER_INFO_PROTO)
+{
+ LEX *lex= thd ? thd->lex : 0;
+ plugin_ref rc= NULL;
+ st_plugin_int *plugin;
+ DBUG_ENTER("plugin_lock_by_name");
+ pthread_mutex_lock(&LOCK_plugin);
+ if ((plugin= plugin_find_internal(name, type)))
+ rc= my_intern_plugin_lock_ci(lex, plugin_int_to_ref(plugin));
+ pthread_mutex_unlock(&LOCK_plugin);
DBUG_RETURN(rc);
}
@@ -415,24 +673,34 @@ struct st_plugin_int *plugin_lock(const LEX_STRING *name, int type)
static st_plugin_int *plugin_insert_or_reuse(struct st_plugin_int *plugin)
{
uint i;
+ struct st_plugin_int *tmp;
DBUG_ENTER("plugin_insert_or_reuse");
for (i= 0; i < plugin_array.elements; i++)
{
- struct st_plugin_int *tmp= dynamic_element(&plugin_array, i,
- struct st_plugin_int *);
+ tmp= *dynamic_element(&plugin_array, i, struct st_plugin_int **);
if (tmp->state == PLUGIN_IS_FREED)
{
memcpy(tmp, plugin, sizeof(struct st_plugin_int));
DBUG_RETURN(tmp);
}
}
- if (insert_dynamic(&plugin_array, (gptr)plugin))
+ if (insert_dynamic(&plugin_array, (uchar*)&plugin))
DBUG_RETURN(0);
- DBUG_RETURN(dynamic_element(&plugin_array, plugin_array.elements - 1,
- struct st_plugin_int *));
+ tmp= *dynamic_element(&plugin_array, plugin_array.elements - 1,
+ struct st_plugin_int **)=
+ (struct st_plugin_int *) memdup_root(&plugin_mem_root, (uchar*)plugin,
+ sizeof(struct st_plugin_int));
+ DBUG_RETURN(tmp);
}
-static my_bool plugin_add(const LEX_STRING *name, const LEX_STRING *dl, int report)
+
+/*
+ NOTE
+ Requires that a write-lock is held on LOCK_system_variables_hash
+*/
+static bool plugin_add(MEM_ROOT *tmp_root,
+ const LEX_STRING *name, const LEX_STRING *dl,
+ int *argc, char **argv, int report)
{
struct st_plugin_int tmp;
struct st_mysql_plugin *plugin;
@@ -445,6 +713,8 @@ static my_bool plugin_add(const LEX_STRING *name, const LEX_STRING *dl, int repo
sql_print_error(ER(ER_UDF_EXISTS), name->str);
DBUG_RETURN(TRUE);
}
+ /* Clear the whole struct to catch future extensions. */
+ bzero((char*) &tmp, sizeof(tmp));
if (! (tmp.plugin_dl= plugin_dl_add(dl, report)))
DBUG_RETURN(TRUE);
/* Find plugin by name */
@@ -478,14 +748,23 @@ static my_bool plugin_add(const LEX_STRING *name, const LEX_STRING *dl, int repo
tmp.name.length= name_len;
tmp.ref_count= 0;
tmp.state= PLUGIN_IS_UNINITIALIZED;
- if (! (tmp_plugin_ptr= plugin_insert_or_reuse(&tmp)))
- goto err;
- plugin_array_version++;
- if (my_hash_insert(&plugin_hash[plugin->type], (byte*)tmp_plugin_ptr))
+ if (!test_plugin_options(tmp_root, &tmp, argc, argv, true))
{
- tmp_plugin_ptr->state= PLUGIN_IS_FREED;
+ if ((tmp_plugin_ptr= plugin_insert_or_reuse(&tmp)))
+ {
+ plugin_array_version++;
+ if (!my_hash_insert(&plugin_hash[plugin->type], (uchar*)tmp_plugin_ptr))
+ {
+ init_alloc_root(&tmp_plugin_ptr->mem_root, 4096, 4096);
+ DBUG_RETURN(FALSE);
+ }
+ tmp_plugin_ptr->state= PLUGIN_IS_FREED;
+ }
+ mysql_del_sys_var_chain(tmp.system_vars);
goto err;
}
+ /* plugin was disabled */
+ plugin_dl_del(dl);
DBUG_RETURN(FALSE);
}
}
@@ -499,8 +778,14 @@ err:
}
-void plugin_deinitialize(struct st_plugin_int *plugin)
+static void plugin_deinitialize(struct st_plugin_int *plugin, bool ref_check)
{
+ /*
+ we don't want to hold the LOCK_plugin mutex as it may cause
+ deinitialization to deadlock if plugins have worker threads
+ with plugin locks
+ */
+ safe_mutex_assert_not_owner(&LOCK_plugin);
if (plugin->plugin->status_vars)
{
@@ -528,7 +813,7 @@ void plugin_deinitialize(struct st_plugin_int *plugin)
{
sql_print_error("Plugin '%s' of type %s failed deinitialization",
plugin->name.str, plugin_type_names[plugin->plugin->type].str);
- }
+ }
}
else if (plugin->plugin->deinit)
{
@@ -540,16 +825,32 @@ void plugin_deinitialize(struct st_plugin_int *plugin)
}
}
plugin->state= PLUGIN_IS_UNINITIALIZED;
+
+ /*
+ We do the check here because NDB has a worker THD which doesn't
+ exit until NDB is shut down.
+ */
+ if (ref_check && plugin->ref_count)
+ sql_print_error("Plugin '%s' has ref_count=%d after deinitialization.",
+ plugin->name.str, plugin->ref_count);
}
static void plugin_del(struct st_plugin_int *plugin)
{
DBUG_ENTER("plugin_del(plugin)");
- hash_delete(&plugin_hash[plugin->plugin->type], (byte*)plugin);
- plugin_dl_del(&plugin->plugin_dl->dl);
+ 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);
+ if (plugin->plugin_dl)
+ plugin_dl_del(&plugin->plugin_dl->dl);
plugin->state= PLUGIN_IS_FREED;
plugin_array_version++;
+ rw_wrlock(&LOCK_system_variables_hash);
+ mysql_del_sys_var_chain(plugin->system_vars);
+ rw_unlock(&LOCK_system_variables_hash);
+ free_root(&plugin->mem_root, MYF(0));
DBUG_VOID_RETURN;
}
@@ -566,18 +867,123 @@ static void plugin_del(const LEX_STRING *name)
#endif
-void plugin_unlock(struct st_plugin_int *plugin)
+static void reap_plugins(void)
{
- DBUG_ENTER("plugin_unlock");
- rw_wrlock(&THR_LOCK_plugin);
- DBUG_ASSERT(plugin && plugin->ref_count);
- plugin->ref_count--;
- if (plugin->state == PLUGIN_IS_DELETED && ! plugin->ref_count)
+ uint count, idx;
+ struct st_plugin_int *plugin, **reap, **list;
+
+ safe_mutex_assert_owner(&LOCK_plugin);
+
+ if (!reap_needed)
+ return;
+
+ reap_needed= false;
+ count= plugin_array.elements;
+ reap= (struct st_plugin_int **)my_alloca(sizeof(plugin)*(count+1));
+ *(reap++)= NULL;
+
+ for (idx= 0; idx < count; idx++)
{
- plugin_deinitialize(plugin);
+ plugin= *dynamic_element(&plugin_array, idx, struct st_plugin_int **);
+ if (plugin->state == PLUGIN_IS_DELETED && !plugin->ref_count)
+ {
+ /* change the status flag to prevent reaping by another thread */
+ plugin->state= PLUGIN_IS_DYING;
+ *(reap++)= plugin;
+ }
+ }
+
+ pthread_mutex_unlock(&LOCK_plugin);
+
+ list= reap;
+ while ((plugin= *(--list)))
+ plugin_deinitialize(plugin, true);
+
+ pthread_mutex_lock(&LOCK_plugin);
+
+ while ((plugin= *(--reap)))
plugin_del(plugin);
+
+ my_afree(reap);
+}
+
+static void intern_plugin_unlock(LEX *lex, plugin_ref plugin)
+{
+ int i;
+ st_plugin_int *pi;
+ DBUG_ENTER("intern_plugin_unlock");
+
+ safe_mutex_assert_owner(&LOCK_plugin);
+
+ if (!plugin)
+ DBUG_VOID_RETURN;
+
+ pi= plugin_ref_to_int(plugin);
+
+#ifdef DBUG_OFF
+ if (!pi->plugin_dl)
+ DBUG_VOID_RETURN;
+#else
+ my_free((uchar*) plugin, MYF(MY_WME));
+#endif
+
+ DBUG_PRINT("info",("unlocking plugin, name= %s, ref_count= %d",
+ pi->name.str, pi->ref_count));
+ if (lex)
+ {
+ /*
+ Remove one instance of this plugin from the use list.
+ We are searching backwards so that plugins locked last
+ could be unlocked faster - optimizing for LIFO semantics.
+ */
+ for (i= lex->plugins.elements - 1; i >= 0; i--)
+ if (plugin == *dynamic_element(&lex->plugins, i, plugin_ref*))
+ {
+ delete_dynamic_element(&lex->plugins, i);
+ break;
+ }
+ DBUG_ASSERT(i >= 0);
}
- rw_unlock(&THR_LOCK_plugin);
+
+ DBUG_ASSERT(pi->ref_count);
+ pi->ref_count--;
+
+ if (pi->state == PLUGIN_IS_DELETED && !pi->ref_count)
+ reap_needed= true;
+
+ DBUG_VOID_RETURN;
+}
+
+
+void plugin_unlock(THD *thd, plugin_ref plugin)
+{
+ LEX *lex= thd ? thd->lex : 0;
+ DBUG_ENTER("plugin_unlock");
+ if (!plugin)
+ DBUG_VOID_RETURN;
+#ifdef DBUG_OFF
+ /* built-in plugins don't need ref counting */
+ if (!plugin_dlib(plugin))
+ DBUG_VOID_RETURN;
+#endif
+ pthread_mutex_lock(&LOCK_plugin);
+ intern_plugin_unlock(lex, plugin);
+ reap_plugins();
+ pthread_mutex_unlock(&LOCK_plugin);
+ DBUG_VOID_RETURN;
+}
+
+
+void plugin_unlock_list(THD *thd, plugin_ref *list, uint count)
+{
+ LEX *lex= thd ? thd->lex : 0;
+ DBUG_ENTER("plugin_unlock_list");
+ DBUG_ASSERT(list);
+ pthread_mutex_lock(&LOCK_plugin);
+ while (count--)
+ intern_plugin_unlock(lex, *list++);
+ reap_plugins();
+ pthread_mutex_unlock(&LOCK_plugin);
DBUG_VOID_RETURN;
}
@@ -586,6 +992,8 @@ static int plugin_initialize(struct st_plugin_int *plugin)
{
DBUG_ENTER("plugin_initialize");
+ safe_mutex_assert_owner(&LOCK_plugin);
+
if (plugin_type_initialize[plugin->plugin->type])
{
if ((*plugin_type_initialize[plugin->plugin->type])(plugin))
@@ -628,17 +1036,47 @@ static int plugin_initialize(struct st_plugin_int *plugin)
#endif /* FIX_LATER */
}
+ /*
+ set the plugin attribute of plugin's sys vars so they are pointing
+ to the active plugin
+ */
+ if (plugin->system_vars)
+ {
+ sys_var_pluginvar *var= plugin->system_vars->cast_pluginvar();
+ for (;;)
+ {
+ var->plugin= plugin;
+ if (!var->next)
+ break;
+ var= var->next->cast_pluginvar();
+ }
+ }
+
DBUG_RETURN(0);
err:
DBUG_RETURN(1);
}
-static byte *get_hash_key(const byte *buff, uint *length,
- my_bool not_used __attribute__((unused)))
+
+extern "C" uchar *get_plugin_hash_key(const uchar *, size_t *, my_bool);
+extern "C" uchar *get_bookmark_hash_key(const uchar *, size_t *, my_bool);
+
+
+uchar *get_plugin_hash_key(const uchar *buff, size_t *length,
+ my_bool not_used __attribute__((unused)))
{
struct st_plugin_int *plugin= (st_plugin_int *)buff;
*length= (uint)plugin->name.length;
- return((byte *)plugin->name.str);
+ return((uchar *)plugin->name.str);
+}
+
+
+uchar *get_bookmark_hash_key(const uchar *buff, size_t *length,
+ my_bool not_used __attribute__((unused)))
+{
+ struct st_bookmark *var= (st_bookmark *)buff;
+ *length= var->name_len + 1;
+ return (uchar*) var->key;
}
@@ -647,33 +1085,48 @@ static byte *get_hash_key(const byte *buff, uint *length,
From there we load up the dynamic types (assuming we have not been told to
skip this part).
- Finally we inializie everything, aka the dynamic that have yet to initialize.
+ Finally we initialize everything, aka the dynamic that have yet to initialize.
*/
-int plugin_init(int skip_dynamic_loading)
+int plugin_init(int *argc, char **argv, int flags)
{
uint i;
+ bool def_enabled, is_myisam;
struct st_mysql_plugin **builtins;
struct st_mysql_plugin *plugin;
+ struct st_plugin_int tmp, *plugin_ptr, **reap;
+ MEM_ROOT tmp_root;
DBUG_ENTER("plugin_init");
if (initialized)
DBUG_RETURN(0);
- my_rwlock_init(&THR_LOCK_plugin, NULL);
+ 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))
+ goto err;
+
+
+ pthread_mutex_init(&LOCK_plugin, MY_MUTEX_INIT_FAST);
if (my_init_dynamic_array(&plugin_dl_array,
- sizeof(struct st_plugin_dl),16,16) ||
+ sizeof(struct st_plugin_dl *),16,16) ||
my_init_dynamic_array(&plugin_array,
- sizeof(struct st_plugin_int),16,16))
+ sizeof(struct st_plugin_int *),16,16))
goto err;
for (i= 0; i < MYSQL_MAX_PLUGIN_TYPE_NUM; i++)
{
if (hash_init(&plugin_hash[i], system_charset_info, 16, 0, 0,
- get_hash_key, NULL, 0))
+ get_plugin_hash_key, NULL, HASH_UNIQUE))
goto err;
}
+ pthread_mutex_lock(&LOCK_plugin);
+
+ initialized= 1;
+
/*
First we register builtin plugins
*/
@@ -681,84 +1134,191 @@ int plugin_init(int skip_dynamic_loading)
{
for (plugin= *builtins; plugin->info; plugin++)
{
-// if (!(strcmp(plugin->name, "MyISAM")))
+ /* by default, only ndbcluster is disabled */
+ def_enabled=
+ my_strcasecmp(&my_charset_latin1, plugin->name, "NDBCLUSTER") != 0;
+ bzero(&tmp, sizeof(tmp));
+ tmp.plugin= plugin;
+ tmp.name.str= (char *)plugin->name;
+ tmp.name.length= strlen(plugin->name);
+
+ free_root(&tmp_root, MYF(MY_MARK_BLOCKS_FREE));
+ if (test_plugin_options(&tmp_root, &tmp, argc, argv, def_enabled))
+ continue;
+
+ if (register_builtin(plugin, &tmp, &plugin_ptr))
+ goto err_unlock;
+
+ /* only initialize MyISAM and CSV at this stage */
+ if (!(is_myisam=
+ !my_strcasecmp(&my_charset_latin1, plugin->name, "MyISAM")) &&
+ my_strcasecmp(&my_charset_latin1, plugin->name, "CSV"))
+ continue;
+
+ if (plugin_initialize(plugin_ptr))
+ goto err_unlock;
+
+ /*
+ initialize the global default storage engine so that it may
+ not be null in any child thread.
+ */
+ if (is_myisam)
{
- if (plugin_register_builtin(plugin))
- goto err;
- struct st_plugin_int *tmp= dynamic_element(&plugin_array,
- plugin_array.elements-1,
- struct st_plugin_int *);
- if (plugin_initialize(tmp))
- goto err;
+ DBUG_ASSERT(!global_system_variables.table_plugin);
+ global_system_variables.table_plugin=
+ my_intern_plugin_lock(NULL, plugin_int_to_ref(plugin_ptr));
+ DBUG_ASSERT(plugin_ptr->ref_count == 1);
}
}
}
+ /* should now be set to MyISAM storage engine */
+ DBUG_ASSERT(global_system_variables.table_plugin);
+
+ pthread_mutex_unlock(&LOCK_plugin);
+
/* Register all dynamic plugins */
- if (!skip_dynamic_loading)
- plugin_load();
+ if (!(flags & PLUGIN_INIT_SKIP_DYNAMIC_LOADING))
+ {
+ if (opt_plugin_load &&
+ plugin_load_list(&tmp_root, argc, argv, opt_plugin_load))
+ goto err;
+ if (!(flags & PLUGIN_INIT_SKIP_PLUGIN_TABLE))
+ plugin_load(&tmp_root, argc, argv);
+ }
- initialized= 1;
+ if (flags & PLUGIN_INIT_SKIP_INITIALIZATION)
+ goto end;
/*
Now we initialize all remaining plugins
*/
+
+ pthread_mutex_lock(&LOCK_plugin);
+ reap= (st_plugin_int **) my_alloca((plugin_array.elements+1) * sizeof(void*));
+ *(reap++)= NULL;
+
for (i= 0; i < plugin_array.elements; i++)
{
- struct st_plugin_int *tmp= dynamic_element(&plugin_array, i,
- struct st_plugin_int *);
- if (tmp->state == PLUGIN_IS_UNINITIALIZED)
+ plugin_ptr= *dynamic_element(&plugin_array, i, struct st_plugin_int **);
+ if (plugin_ptr->state == PLUGIN_IS_UNINITIALIZED)
{
- if (plugin_initialize(tmp))
+ if (plugin_initialize(plugin_ptr))
{
- plugin_deinitialize(tmp);
- plugin_del(tmp);
+ plugin_ptr->state= PLUGIN_IS_DYING;
+ *(reap++)= plugin_ptr;
}
}
}
+ /*
+ Check if any plugins have to be reaped
+ */
+ while ((plugin_ptr= *(--reap)))
+ {
+ pthread_mutex_unlock(&LOCK_plugin);
+ plugin_deinitialize(plugin_ptr, true);
+ pthread_mutex_lock(&LOCK_plugin);
+ plugin_del(plugin_ptr);
+ }
+
+ pthread_mutex_unlock(&LOCK_plugin);
+ my_afree(reap);
+
+end:
+ free_root(&tmp_root, MYF(0));
+
DBUG_RETURN(0);
+err_unlock:
+ pthread_mutex_unlock(&LOCK_plugin);
err:
+ free_root(&tmp_root, MYF(0));
DBUG_RETURN(1);
}
-my_bool plugin_register_builtin(struct st_mysql_plugin *plugin)
+static bool register_builtin(struct st_mysql_plugin *plugin,
+ struct st_plugin_int *tmp,
+ struct st_plugin_int **ptr)
{
- struct st_plugin_int tmp;
+ DBUG_ENTER("register_builtin");
+
+ tmp->state= PLUGIN_IS_UNINITIALIZED;
+ tmp->ref_count= 0;
+ tmp->plugin_dl= 0;
+
+ if (insert_dynamic(&plugin_array, (uchar*)&tmp))
+ DBUG_RETURN(1);
+
+ *ptr= *dynamic_element(&plugin_array, plugin_array.elements - 1,
+ struct st_plugin_int **)=
+ (struct st_plugin_int *) memdup_root(&plugin_mem_root, (uchar*)tmp,
+ sizeof(struct st_plugin_int));
+
+ if (my_hash_insert(&plugin_hash[plugin->type],(uchar*) *ptr))
+ DBUG_RETURN(1);
+
+ DBUG_RETURN(0);
+}
+
+
+#ifdef NOT_USED_YET
+/*
+ Register a plugin at run time. (note, this doesn't initialize a plugin)
+ Will be useful for embedded applications.
+
+ SYNOPSIS
+ plugin_register_builtin()
+ thd current thread (used to store scratch data in mem_root)
+ plugin static plugin to install
+
+ RETURN
+ false - plugin registered successfully
+*/
+bool plugin_register_builtin(THD *thd, struct st_mysql_plugin *plugin)
+{
+ struct st_plugin_int tmp, *ptr;
+ bool result= true;
+ int dummy_argc= 0;
DBUG_ENTER("plugin_register_builtin");
+ bzero(&tmp, sizeof(tmp));
tmp.plugin= plugin;
tmp.name.str= (char *)plugin->name;
tmp.name.length= strlen(plugin->name);
- tmp.state= PLUGIN_IS_UNINITIALIZED;
- /* Cannot be unloaded */
- tmp.ref_count= 1;
- tmp.plugin_dl= 0;
+ pthread_mutex_lock(&LOCK_plugin);
+ rw_wrlock(&LOCK_system_variables_hash);
- if (insert_dynamic(&plugin_array, (gptr)&tmp))
- DBUG_RETURN(1);
+ if (test_plugin_options(thd->mem_root, &tmp, &dummy_argc, NULL, true))
+ goto end;
- if (my_hash_insert(&plugin_hash[plugin->type],
- (byte*)dynamic_element(&plugin_array,
- plugin_array.elements - 1,
- struct st_plugin_int *)))
- DBUG_RETURN(1);
+ if ((result= register_builtin(plugin, &tmp, &ptr)))
+ mysql_del_sys_var_chain(tmp.system_vars);
- DBUG_RETURN(0);
+end:
+ rw_unlock(&LOCK_system_variables_hash);
+ pthread_mutex_unlock(&LOCK_plugin);
+
+ DBUG_RETURN(result);;
}
+#endif /* NOT_USED_YET */
-void plugin_load(void)
+/*
+ called only by plugin_init()
+*/
+static void plugin_load(MEM_ROOT *tmp_root, int *argc, char **argv)
{
TABLE_LIST tables;
TABLE *table;
READ_RECORD read_record_info;
int error;
- MEM_ROOT mem;
THD *new_thd;
+#ifdef EMBEDDED_LIBRARY
+ bool table_exists;
+#endif /* EMBEDDED_LIBRARY */
DBUG_ENTER("plugin_load");
if (!(new_thd= new THD))
@@ -767,15 +1327,28 @@ void plugin_load(void)
delete new_thd;
DBUG_VOID_RETURN;
}
- init_sql_alloc(&mem, 1024, 0);
new_thd->thread_stack= (char*) &tables;
new_thd->store_globals();
new_thd->db= my_strdup("mysql", MYF(0));
new_thd->db_length= 5;
- bzero((gptr)&tables, sizeof(tables));
+ bzero((uchar*)&tables, sizeof(tables));
tables.alias= tables.table_name= (char*)"plugin";
tables.lock_type= TL_READ;
tables.db= new_thd->db;
+
+#ifdef EMBEDDED_LIBRARY
+ /*
+ When building an embedded library, if the mysql.plugin table
+ does not exist, we silently ignore the missing table
+ */
+ pthread_mutex_lock(&LOCK_open);
+ if (check_if_table_exists(new_thd, &tables, &table_exists))
+ table_exists= FALSE;
+ pthread_mutex_unlock(&LOCK_open);
+ if (!table_exists)
+ goto end;
+#endif /* EMBEDDED_LIBRARY */
+
if (simple_open_n_lock_tables(new_thd, &tables))
{
DBUG_PRINT("error",("Can't open plugin table"));
@@ -786,26 +1359,34 @@ void plugin_load(void)
table= tables.table;
init_read_record(&read_record_info, new_thd, table, NULL, 1, 0);
table->use_all_columns();
+ /*
+ there're no other threads running yet, so we don't need a mutex.
+ but plugin_add() before is designed to work in multi-threaded
+ environment, and it uses safe_mutex_assert_owner(), so we lock
+ the mutex here to satisfy the assert
+ */
+ pthread_mutex_lock(&LOCK_plugin);
while (!(error= read_record_info.read_record(&read_record_info)))
{
DBUG_PRINT("info", ("init plugin record"));
String str_name, str_dl;
- get_field(&mem, table->field[0], &str_name);
- get_field(&mem, table->field[1], &str_dl);
-
+ get_field(tmp_root, table->field[0], &str_name);
+ get_field(tmp_root, table->field[1], &str_dl);
+
LEX_STRING name= {(char *)str_name.ptr(), str_name.length()};
LEX_STRING dl= {(char *)str_dl.ptr(), str_dl.length()};
- if (plugin_add(&name, &dl, REPORT_TO_LOG))
+ if (plugin_add(tmp_root, &name, &dl, argc, argv, REPORT_TO_LOG))
sql_print_warning("Couldn't load plugin named '%s' with soname '%s'.",
str_name.c_ptr(), str_dl.c_ptr());
+ free_root(tmp_root, MYF(MY_MARK_BLOCKS_FREE));
}
+ pthread_mutex_unlock(&LOCK_plugin);
if (error > 0)
sql_print_error(ER(ER_GET_ERRNO), my_errno);
end_read_record(&read_record_info);
new_thd->version--; // Force close to free memory
end:
- free_root(&mem, MYF(0));
close_thread_tables(new_thd);
delete new_thd;
/* Remember that we don't have a THD */
@@ -814,46 +1395,222 @@ end:
}
+/*
+ called only by plugin_init()
+*/
+static bool plugin_load_list(MEM_ROOT *tmp_root, int *argc, char **argv,
+ const char *list)
+{
+ char buffer[FN_REFLEN];
+ LEX_STRING name= {buffer, 0}, dl= {NULL, 0}, *str= &name;
+ struct st_plugin_dl *plugin_dl;
+ struct st_mysql_plugin *plugin;
+ char *p= buffer;
+ DBUG_ENTER("plugin_load_list");
+ while (list)
+ {
+ if (p == buffer + sizeof(buffer) - 1)
+ break;
+ switch ((*(p++)= *(list++))) {
+ case '\0':
+ list= NULL; /* terminate the loop */
+ /* fall through */
+#ifndef __WIN__
+ case ':': /* can't use this as delimiter as it may be drive letter */
+#endif
+ case ';':
+ name.str[name.length]= '\0';
+ if (str != &dl) // load all plugins in named module
+ {
+ dl= name;
+ if ((plugin_dl= plugin_dl_add(&dl, REPORT_TO_LOG)))
+ {
+ for (plugin= plugin_dl->plugins; plugin->info; plugin++)
+ {
+ name.str= (char *) plugin->name;
+ name.length= strlen(name.str);
+
+ free_root(tmp_root, MYF(MY_MARK_BLOCKS_FREE));
+ if (plugin_add(tmp_root, &name, &dl, argc, argv, REPORT_TO_LOG))
+ goto error;
+ }
+ plugin_dl_del(&dl); // reduce ref count
+ }
+ }
+ else
+ {
+ free_root(tmp_root, MYF(MY_MARK_BLOCKS_FREE));
+ if (plugin_add(tmp_root, &name, &dl, argc, argv, REPORT_TO_LOG))
+ goto error;
+ }
+ name.length= dl.length= 0;
+ dl.str= NULL; name.str= p= buffer;
+ str= &name;
+ continue;
+ case '=':
+ case '#':
+ if (str == &name)
+ {
+ str= &dl;
+ str->str= p;
+ continue;
+ }
+ default:
+ str->length++;
+ continue;
+ }
+ }
+ DBUG_RETURN(FALSE);
+error:
+ sql_print_error("Couldn't load plugin named '%s' with soname '%s'.",
+ name.str, dl.str);
+ DBUG_RETURN(TRUE);
+}
+
+
void plugin_shutdown(void)
{
- uint i;
+ uint i, count= plugin_array.elements, free_slots= 0;
+ struct st_plugin_int **plugins, *plugin;
+ struct st_plugin_dl **dl;
DBUG_ENTER("plugin_shutdown");
- /*
- We loop through all plugins and call deinit() if they have one.
- */
- for (i= 0; i < plugin_array.elements; i++)
+ if (initialized)
{
- struct st_plugin_int *tmp= dynamic_element(&plugin_array, i,
- struct st_plugin_int *);
- plugin_deinitialize(tmp);
+ pthread_mutex_lock(&LOCK_plugin);
+
+ reap_needed= true;
+
+ /*
+ We want to shut down plugins in a reasonable order, this will
+ become important when we have plugins which depend upon each other.
+ Circular references cannot be reaped so they are forced afterwards.
+ TODO: Have an additional step here to notify all active plugins that
+ shutdown is requested to allow plugins to deinitialize in parallel.
+ */
+ while (reap_needed && (count= plugin_array.elements))
+ {
+ reap_plugins();
+ for (i= free_slots= 0; i < count; i++)
+ {
+ plugin= *dynamic_element(&plugin_array, i, struct st_plugin_int **);
+ switch (plugin->state) {
+ case PLUGIN_IS_READY:
+ plugin->state= PLUGIN_IS_DELETED;
+ reap_needed= true;
+ break;
+ case PLUGIN_IS_FREED:
+ case PLUGIN_IS_UNINITIALIZED:
+ free_slots++;
+ break;
+ }
+ }
+ if (!reap_needed)
+ {
+ /*
+ release any plugin references held.
+ */
+ unlock_variables(NULL, &global_system_variables);
+ unlock_variables(NULL, &max_system_variables);
+ }
+ }
+
+ if (count > free_slots)
+ sql_print_warning("Forcing shutdown of %d plugins", count - free_slots);
+
+ plugins= (struct st_plugin_int **) my_alloca(sizeof(void*) * (count+1));
+
+ /*
+ If we have any plugins which did not die cleanly, we force shutdown
+ */
+ for (i= 0; i < count; i++)
+ {
+ plugins[i]= *dynamic_element(&plugin_array, i, struct st_plugin_int **);
+ /* change the state to ensure no reaping races */
+ if (plugins[i]->state == PLUGIN_IS_DELETED)
+ plugins[i]->state= PLUGIN_IS_DYING;
+ }
+ pthread_mutex_unlock(&LOCK_plugin);
+
+ /*
+ We loop through all plugins and call deinit() if they have one.
+ */
+ for (i= 0; i < count; i++)
+ if (!(plugins[i]->state & (PLUGIN_IS_UNINITIALIZED | PLUGIN_IS_FREED)))
+ {
+ sql_print_information("Plugin '%s' will be forced to shutdown",
+ plugins[i]->name.str);
+ /*
+ We are forcing deinit on plugins so we don't want to do a ref_count
+ check until we have processed all the plugins.
+ */
+ plugin_deinitialize(plugins[i], false);
+ }
+
+ /*
+ It's perfectly safe not to lock LOCK_plugin, as there're no
+ concurrent threads anymore. But some functions called from here
+ use safe_mutex_assert_owner(), so we lock the mutex to satisfy it
+ */
+ pthread_mutex_lock(&LOCK_plugin);
+
+ /*
+ We defer checking ref_counts until after all plugins are deinitialized
+ as some may have worker threads holding on to plugin references.
+ */
+ for (i= 0; i < count; i++)
+ {
+ if (plugins[i]->ref_count)
+ sql_print_error("Plugin '%s' has ref_count=%d after shutdown.",
+ plugins[i]->name.str, plugins[i]->ref_count);
+ if (plugins[i]->state & PLUGIN_IS_UNINITIALIZED)
+ plugin_del(plugins[i]);
+ }
+
+ /*
+ Now we can deallocate all memory.
+ */
+
+ cleanup_variables(NULL, &global_system_variables);
+ cleanup_variables(NULL, &max_system_variables);
+ pthread_mutex_unlock(&LOCK_plugin);
+
+ initialized= 0;
+ pthread_mutex_destroy(&LOCK_plugin);
+ my_afree(plugins);
}
+ /* Dispose of the memory */
+
for (i= 0; i < MYSQL_MAX_PLUGIN_TYPE_NUM; i++)
hash_free(&plugin_hash[i]);
delete_dynamic(&plugin_array);
+
+ count= plugin_dl_array.elements;
+ dl= (struct st_plugin_dl **)my_alloca(sizeof(void*) * count);
+ for (i= 0; i < count; i++)
+ dl[i]= *dynamic_element(&plugin_dl_array, i, struct st_plugin_dl **);
for (i= 0; i < plugin_dl_array.elements; i++)
- {
- struct st_plugin_dl *tmp= dynamic_element(&plugin_dl_array, i,
- struct st_plugin_dl *);
- free_plugin_mem(tmp);
- }
+ free_plugin_mem(dl[i]);
+ my_afree(dl);
delete_dynamic(&plugin_dl_array);
- if (initialized)
- {
- initialized= 0;
- rwlock_destroy(&THR_LOCK_plugin);
- }
+
+ hash_free(&bookmark_hash);
+ free_root(&plugin_mem_root, MYF(0));
+
+ global_variables_dynamic_size= 0;
+
DBUG_VOID_RETURN;
}
-my_bool mysql_install_plugin(THD *thd, const LEX_STRING *name, const LEX_STRING *dl)
+bool mysql_install_plugin(THD *thd, const LEX_STRING *name, const LEX_STRING *dl)
{
TABLE_LIST tables;
TABLE *table;
- int error;
+ int error, argc;
+ char *argv[2];
struct st_plugin_int *tmp;
DBUG_ENTER("mysql_install_plugin");
@@ -863,14 +1620,21 @@ my_bool mysql_install_plugin(THD *thd, const LEX_STRING *name, const LEX_STRING
if (check_table_access(thd, INSERT_ACL, &tables, 0))
DBUG_RETURN(TRUE);
- /* need to open before acquiring THR_LOCK_plugin or it will deadlock */
- if (! (table = open_ltable(thd, &tables, TL_WRITE)))
+ /* need to open before acquiring LOCK_plugin or it will deadlock */
+ if (! (table = open_ltable(thd, &tables, TL_WRITE, 0)))
DBUG_RETURN(TRUE);
- rw_wrlock(&THR_LOCK_plugin);
- if (plugin_add(name, dl, REPORT_TO_USER))
+ pthread_mutex_lock(&LOCK_plugin);
+ rw_wrlock(&LOCK_system_variables_hash);
+ /* handle_options() assumes arg0 (program name) always exists */
+ argv[0]= const_cast<char*>(""); // without a cast gcc emits a warning
+ argv[1]= 0;
+ argc= 1;
+ error= plugin_add(thd->mem_root, name, dl, &argc, argv, REPORT_TO_USER);
+ rw_unlock(&LOCK_system_variables_hash);
+
+ if (error || !(tmp= plugin_find_internal(name, MYSQL_ANY_PLUGIN)))
goto err;
- tmp= plugin_find_internal(name, MYSQL_ANY_PLUGIN);
if (plugin_initialize(tmp))
{
@@ -890,18 +1654,19 @@ my_bool mysql_install_plugin(THD *thd, const LEX_STRING *name, const LEX_STRING
goto deinit;
}
- rw_unlock(&THR_LOCK_plugin);
+ pthread_mutex_unlock(&LOCK_plugin);
DBUG_RETURN(FALSE);
deinit:
- plugin_deinitialize(tmp);
- plugin_del(tmp);
+ tmp->state= PLUGIN_IS_DELETED;
+ reap_needed= true;
+ reap_plugins();
err:
- rw_unlock(&THR_LOCK_plugin);
+ pthread_mutex_unlock(&LOCK_plugin);
DBUG_RETURN(TRUE);
}
-my_bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name)
+bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name)
{
TABLE *table;
TABLE_LIST tables;
@@ -912,11 +1677,11 @@ my_bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name)
tables.db= (char *)"mysql";
tables.table_name= tables.alias= (char *)"plugin";
- /* need to open before acquiring THR_LOCK_plugin or it will deadlock */
- if (! (table= open_ltable(thd, &tables, TL_WRITE)))
+ /* need to open before acquiring LOCK_plugin or it will deadlock */
+ if (! (table= open_ltable(thd, &tables, TL_WRITE, 0)))
DBUG_RETURN(TRUE);
- rw_wrlock(&THR_LOCK_plugin);
+ pthread_mutex_lock(&LOCK_plugin);
if (!(plugin= plugin_find_internal(name, MYSQL_ANY_PLUGIN)))
{
my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "PLUGIN", name->str);
@@ -930,39 +1695,37 @@ my_bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name)
goto err;
}
+ plugin->state= PLUGIN_IS_DELETED;
if (plugin->ref_count)
- {
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
"Plugin is busy and will be uninstalled on shutdown");
- plugin->state= PLUGIN_IS_DELETED;
- }
else
- {
- plugin_deinitialize(plugin);
- plugin_del(plugin);
- }
+ reap_needed= true;
+ reap_plugins();
+ pthread_mutex_unlock(&LOCK_plugin);
table->use_all_columns();
table->field[0]->store(name->str, name->length, system_charset_info);
- if (! table->file->index_read_idx(table->record[0], 0,
- (byte *)table->field[0]->ptr, HA_WHOLE_KEY,
- HA_READ_KEY_EXACT))
+ if (! table->file->index_read_idx_map(table->record[0], 0,
+ (uchar *)table->field[0]->ptr,
+ HA_WHOLE_KEY,
+ HA_READ_KEY_EXACT))
{
int error;
if ((error= table->file->ha_delete_row(table->record[0])))
{
table->file->print_error(error, MYF(0));
- goto err;
+ DBUG_RETURN(TRUE);
}
}
- rw_unlock(&THR_LOCK_plugin);
DBUG_RETURN(FALSE);
err:
- rw_unlock(&THR_LOCK_plugin);
+ pthread_mutex_unlock(&LOCK_plugin);
DBUG_RETURN(TRUE);
}
-my_bool plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func,
+
+bool plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func,
int type, uint state_mask, void *arg)
{
uint idx, total;
@@ -970,21 +1733,24 @@ my_bool plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func,
int version=plugin_array_version;
DBUG_ENTER("plugin_foreach_with_mask");
+ if (!initialized)
+ DBUG_RETURN(FALSE);
+
state_mask= ~state_mask; // do it only once
- rw_rdlock(&THR_LOCK_plugin);
- total= type == MYSQL_ANY_PLUGIN ? plugin_array.elements
+ pthread_mutex_lock(&LOCK_plugin);
+ total= type == MYSQL_ANY_PLUGIN ? plugin_array.elements
: plugin_hash[type].records;
/*
Do the alloca out here in case we do have a working alloca:
- leaving the nested stack frame invalidates alloca allocation.
+ leaving the nested stack frame invalidates alloca allocation.
*/
- plugins=(struct st_plugin_int **)my_alloca(total*sizeof(*plugins));
+ plugins=(struct st_plugin_int **)my_alloca(total*sizeof(plugin));
if (type == MYSQL_ANY_PLUGIN)
{
for (idx= 0; idx < total; idx++)
{
- plugin= dynamic_element(&plugin_array, idx, struct st_plugin_int *);
+ plugin= *dynamic_element(&plugin_array, idx, struct st_plugin_int **);
plugins[idx]= !(plugin->state & state_mask) ? plugin : NULL;
}
}
@@ -997,20 +1763,21 @@ my_bool plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func,
plugins[idx]= !(plugin->state & state_mask) ? plugin : NULL;
}
}
- rw_unlock(&THR_LOCK_plugin);
+ pthread_mutex_unlock(&LOCK_plugin);
for (idx= 0; idx < total; idx++)
{
if (unlikely(version != plugin_array_version))
{
- rw_rdlock(&THR_LOCK_plugin);
+ pthread_mutex_lock(&LOCK_plugin);
for (uint i=idx; i < total; i++)
if (plugins[i] && plugins[i]->state & state_mask)
plugins[i]=0;
- rw_unlock(&THR_LOCK_plugin);
+ pthread_mutex_unlock(&LOCK_plugin);
}
plugin= plugins[idx];
- if (plugin && func(thd, plugin, arg))
+ /* It will stop iterating on first engine error when "func" returns TRUE */
+ if (plugin && func(thd, plugin_int_to_ref(plugin), arg))
goto err;
}
@@ -1021,3 +1788,1419 @@ err:
DBUG_RETURN(TRUE);
}
+
+/****************************************************************************
+ Internal type declarations for variables support
+****************************************************************************/
+
+#undef MYSQL_SYSVAR_NAME
+#define MYSQL_SYSVAR_NAME(name) name
+#define PLUGIN_VAR_TYPEMASK 0x007f
+
+#define EXTRA_OPTIONS 3 /* options for: 'foo', 'plugin-foo' and NULL */
+
+typedef DECLARE_MYSQL_SYSVAR_BASIC(sysvar_bool_t, my_bool);
+typedef DECLARE_MYSQL_THDVAR_BASIC(thdvar_bool_t, my_bool);
+typedef DECLARE_MYSQL_SYSVAR_BASIC(sysvar_str_t, char *);
+typedef DECLARE_MYSQL_THDVAR_BASIC(thdvar_str_t, char *);
+
+typedef DECLARE_MYSQL_SYSVAR_TYPELIB(sysvar_enum_t, unsigned long);
+typedef DECLARE_MYSQL_THDVAR_TYPELIB(thdvar_enum_t, unsigned long);
+typedef DECLARE_MYSQL_SYSVAR_TYPELIB(sysvar_set_t, ulonglong);
+typedef DECLARE_MYSQL_THDVAR_TYPELIB(thdvar_set_t, ulonglong);
+
+typedef DECLARE_MYSQL_SYSVAR_SIMPLE(sysvar_int_t, int);
+typedef DECLARE_MYSQL_SYSVAR_SIMPLE(sysvar_long_t, long);
+typedef DECLARE_MYSQL_SYSVAR_SIMPLE(sysvar_longlong_t, longlong);
+typedef DECLARE_MYSQL_SYSVAR_SIMPLE(sysvar_uint_t, uint);
+typedef DECLARE_MYSQL_SYSVAR_SIMPLE(sysvar_ulong_t, ulong);
+typedef DECLARE_MYSQL_SYSVAR_SIMPLE(sysvar_ulonglong_t, ulonglong);
+
+typedef DECLARE_MYSQL_THDVAR_SIMPLE(thdvar_int_t, int);
+typedef DECLARE_MYSQL_THDVAR_SIMPLE(thdvar_long_t, long);
+typedef DECLARE_MYSQL_THDVAR_SIMPLE(thdvar_longlong_t, longlong);
+typedef DECLARE_MYSQL_THDVAR_SIMPLE(thdvar_uint_t, uint);
+typedef DECLARE_MYSQL_THDVAR_SIMPLE(thdvar_ulong_t, ulong);
+typedef DECLARE_MYSQL_THDVAR_SIMPLE(thdvar_ulonglong_t, ulonglong);
+
+#define SET_PLUGIN_VAR_RESOLVE(opt)\
+ *(mysql_sys_var_ptr_p*)&((opt)->resolve)= mysql_sys_var_ptr
+typedef uchar *(*mysql_sys_var_ptr_p)(void* a_thd, int offset);
+
+
+/****************************************************************************
+ default variable data check and update functions
+****************************************************************************/
+
+static int check_func_bool(THD *thd, struct st_mysql_sys_var *var,
+ void *save, st_mysql_value *value)
+{
+ char buff[STRING_BUFFER_USUAL_SIZE];
+ const char *strvalue= "NULL", *str;
+ int result, length;
+ long long tmp;
+
+ if (value->value_type(value) == MYSQL_VALUE_TYPE_STRING)
+ {
+ length= sizeof(buff);
+ if (!(str= value->val_str(value, buff, &length)) ||
+ (result= find_type(&bool_typelib, str, length, 1)-1) < 0)
+ {
+ if (str)
+ strvalue= str;
+ goto err;
+ }
+ }
+ else
+ {
+ if (value->val_int(value, &tmp) < 0)
+ goto err;
+ if (tmp > 1)
+ {
+ llstr(tmp, buff);
+ strvalue= buff;
+ goto err;
+ }
+ result= (int) tmp;
+ }
+ *(int*)save= -result;
+ return 0;
+err:
+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->name, strvalue);
+ return 1;
+}
+
+
+static int check_func_int(THD *thd, struct st_mysql_sys_var *var,
+ void *save, st_mysql_value *value)
+{
+ long long tmp;
+ struct my_option options;
+ value->val_int(value, &tmp);
+ plugin_opt_set_limits(&options, var);
+ *(int *)save= (int) getopt_ull_limit_value(tmp, &options);
+ return (thd->variables.sql_mode & MODE_STRICT_ALL_TABLES) &&
+ (*(int *)save != (int) tmp);
+}
+
+
+static int check_func_long(THD *thd, struct st_mysql_sys_var *var,
+ void *save, st_mysql_value *value)
+{
+ long long tmp;
+ struct my_option options;
+ value->val_int(value, &tmp);
+ plugin_opt_set_limits(&options, var);
+ *(long *)save= (long) getopt_ull_limit_value(tmp, &options);
+ return (thd->variables.sql_mode & MODE_STRICT_ALL_TABLES) &&
+ (*(long *)save != (long) tmp);
+}
+
+
+static int check_func_longlong(THD *thd, struct st_mysql_sys_var *var,
+ void *save, st_mysql_value *value)
+{
+ long long tmp;
+ struct my_option options;
+ value->val_int(value, &tmp);
+ plugin_opt_set_limits(&options, var);
+ *(ulonglong *)save= getopt_ull_limit_value(tmp, &options);
+ return (thd->variables.sql_mode & MODE_STRICT_ALL_TABLES) &&
+ (*(long long *)save != tmp);
+}
+
+static int check_func_str(THD *thd, struct st_mysql_sys_var *var,
+ void *save, st_mysql_value *value)
+{
+ char buff[STRING_BUFFER_USUAL_SIZE];
+ const char *str;
+ int length;
+
+ length= sizeof(buff);
+ if ((str= value->val_str(value, buff, &length)))
+ str= thd->strmake(str, length);
+ *(const char**)save= str;
+ return 0;
+}
+
+
+static int check_func_enum(THD *thd, struct st_mysql_sys_var *var,
+ void *save, st_mysql_value *value)
+{
+ char buff[STRING_BUFFER_USUAL_SIZE];
+ const char *strvalue= "NULL", *str;
+ TYPELIB *typelib;
+ long long tmp;
+ long result;
+ int length;
+
+ if (var->flags & PLUGIN_VAR_THDLOCAL)
+ typelib= ((thdvar_enum_t*) var)->typelib;
+ else
+ typelib= ((sysvar_enum_t*) var)->typelib;
+
+ if (value->value_type(value) == MYSQL_VALUE_TYPE_STRING)
+ {
+ length= sizeof(buff);
+ if (!(str= value->val_str(value, buff, &length)))
+ goto err;
+ if ((result= find_type(typelib, str, length, 1)-1) < 0)
+ {
+ strvalue= str;
+ goto err;
+ }
+ }
+ else
+ {
+ if (value->val_int(value, &tmp))
+ goto err;
+ if (tmp >= typelib->count)
+ {
+ llstr(tmp, buff);
+ strvalue= buff;
+ goto err;
+ }
+ result= (long) tmp;
+ }
+ *(long*)save= result;
+ return 0;
+err:
+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->name, strvalue);
+ return 1;
+}
+
+
+static int check_func_set(THD *thd, struct st_mysql_sys_var *var,
+ void *save, st_mysql_value *value)
+{
+ char buff[STRING_BUFFER_USUAL_SIZE], *error= 0;
+ const char *strvalue= "NULL", *str;
+ TYPELIB *typelib;
+ ulonglong result;
+ uint error_len;
+ bool not_used;
+ int length;
+
+ if (var->flags & PLUGIN_VAR_THDLOCAL)
+ typelib= ((thdvar_set_t*) var)->typelib;
+ else
+ typelib= ((sysvar_set_t*)var)->typelib;
+
+ if (value->value_type(value) == MYSQL_VALUE_TYPE_STRING)
+ {
+ length= sizeof(buff);
+ if (!(str= value->val_str(value, buff, &length)))
+ goto err;
+ result= find_set(typelib, str, length, NULL,
+ &error, &error_len, &not_used);
+ if (error_len)
+ {
+ strmake(buff, error, min(sizeof(buff), error_len));
+ strvalue= buff;
+ goto err;
+ }
+ }
+ else
+ {
+ if (value->val_int(value, (long long *)&result))
+ goto err;
+ if (unlikely((result >= (ULL(1) << typelib->count)) &&
+ (typelib->count < sizeof(long)*8)))
+ {
+ llstr(result, buff);
+ strvalue= buff;
+ goto err;
+ }
+ }
+ *(ulonglong*)save= result;
+ return 0;
+err:
+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->name, strvalue);
+ return 1;
+}
+
+
+static void update_func_bool(THD *thd, struct st_mysql_sys_var *var,
+ void *tgt, void *save)
+{
+ *(my_bool *) tgt= *(int *) save ? 1 : 0;
+}
+
+
+static void update_func_int(THD *thd, struct st_mysql_sys_var *var,
+ void *tgt, void *save)
+{
+ *(int *)tgt= *(int *) save;
+}
+
+
+static void update_func_long(THD *thd, struct st_mysql_sys_var *var,
+ void *tgt, void *save)
+{
+ *(long *)tgt= *(long *) save;
+}
+
+
+static void update_func_longlong(THD *thd, struct st_mysql_sys_var *var,
+ void *tgt, void *save)
+{
+ *(longlong *)tgt= *(ulonglong *) save;
+}
+
+
+static void update_func_str(THD *thd, struct st_mysql_sys_var *var,
+ void *tgt, void *save)
+{
+ char *old= *(char **) tgt;
+ *(char **)tgt= *(char **) save;
+ if (var->flags & PLUGIN_VAR_MEMALLOC)
+ {
+ *(char **)tgt= my_strdup(*(char **) save, MYF(0));
+ my_free(old, MYF(0));
+ }
+}
+
+
+/****************************************************************************
+ System Variables support
+****************************************************************************/
+
+
+sys_var *find_sys_var(THD *thd, const char *str, uint length)
+{
+ sys_var *var;
+ sys_var_pluginvar *pi= NULL;
+ plugin_ref plugin;
+ DBUG_ENTER("find_sys_var");
+
+ pthread_mutex_lock(&LOCK_plugin);
+ rw_rdlock(&LOCK_system_variables_hash);
+ if ((var= intern_find_sys_var(str, length, false)) &&
+ (pi= var->cast_pluginvar()))
+ {
+ rw_unlock(&LOCK_system_variables_hash);
+ LEX *lex= thd ? thd->lex : 0;
+ if (!(plugin= my_intern_plugin_lock(lex, plugin_int_to_ref(pi->plugin))))
+ var= NULL; /* failed to lock it, it must be uninstalling */
+ else
+ if (!(plugin_state(plugin) & PLUGIN_IS_READY))
+ {
+ /* initialization not completed */
+ var= NULL;
+ intern_plugin_unlock(lex, plugin);
+ }
+ }
+ else
+ rw_unlock(&LOCK_system_variables_hash);
+ pthread_mutex_unlock(&LOCK_plugin);
+
+ /*
+ If the variable exists but the plugin it is associated with is not ready
+ then the intern_plugin_lock did not raise an error, so we do it here.
+ */
+ if (pi && !var)
+ my_error(ER_UNKNOWN_SYSTEM_VARIABLE, MYF(0), (char*) str);
+ DBUG_RETURN(var);
+}
+
+
+/*
+ called by register_var, construct_options and test_plugin_options.
+ Returns the 'bookmark' for the named variable.
+ LOCK_system_variables_hash should be at least read locked
+*/
+static st_bookmark *find_bookmark(const char *plugin, const char *name,
+ int flags)
+{
+ st_bookmark *result= NULL;
+ uint namelen, length, pluginlen= 0;
+ char *varname, *p;
+
+ if (!(flags & PLUGIN_VAR_THDLOCAL))
+ return NULL;
+
+ namelen= strlen(name);
+ if (plugin)
+ pluginlen= strlen(plugin) + 1;
+ length= namelen + pluginlen + 2;
+ varname= (char*) my_alloca(length);
+
+ if (plugin)
+ {
+ strxmov(varname + 1, plugin, "_", name, NullS);
+ for (p= varname + 1; *p; p++)
+ if (*p == '-')
+ *p= '_';
+ }
+ else
+ memcpy(varname + 1, name, namelen + 1);
+
+ varname[0]= flags & PLUGIN_VAR_TYPEMASK;
+
+ result= (st_bookmark*) hash_search(&bookmark_hash,
+ (const uchar*) varname, length - 1);
+
+ my_afree(varname);
+ return result;
+}
+
+
+/*
+ returns a bookmark for thd-local variables, creating if neccessary.
+ returns null for non thd-local variables.
+ Requires that a write lock is obtained on LOCK_system_variables_hash
+*/
+static st_bookmark *register_var(const char *plugin, const char *name,
+ int flags)
+{
+ uint length= strlen(plugin) + strlen(name) + 3, size= 0, offset, new_size;
+ st_bookmark *result;
+ char *varname, *p;
+
+ if (!(flags & PLUGIN_VAR_THDLOCAL))
+ return NULL;
+
+ switch (flags & PLUGIN_VAR_TYPEMASK) {
+ case PLUGIN_VAR_BOOL:
+ size= sizeof(my_bool);
+ break;
+ case PLUGIN_VAR_INT:
+ size= sizeof(int);
+ break;
+ case PLUGIN_VAR_LONG:
+ size= sizeof(long);
+ break;
+ case PLUGIN_VAR_LONGLONG:
+ size= sizeof(ulonglong);
+ break;
+ case PLUGIN_VAR_STR:
+ size= sizeof(char*);
+ break;
+ default:
+ DBUG_ASSERT(0);
+ return NULL;
+ };
+
+ varname= ((char*) my_alloca(length));
+ strxmov(varname + 1, plugin, "_", name, NullS);
+ for (p= varname + 1; *p; p++)
+ if (*p == '-')
+ *p= '_';
+
+ if (!(result= find_bookmark(NULL, varname + 1, flags)))
+ {
+ result= (st_bookmark*) alloc_root(&plugin_mem_root,
+ sizeof(struct st_bookmark) + length-1);
+ varname[0]= flags & PLUGIN_VAR_TYPEMASK;
+ memcpy(result->key, varname, length);
+ result->name_len= length - 2;
+ result->offset= -1;
+
+ DBUG_ASSERT(size && !(size & (size-1))); /* must be power of 2 */
+
+ offset= global_system_variables.dynamic_variables_size;
+ offset= (offset + size - 1) & ~(size - 1);
+ result->offset= (int) offset;
+
+ new_size= (offset + size + 63) & ~63;
+
+ if (new_size > global_variables_dynamic_size)
+ {
+ global_system_variables.dynamic_variables_ptr= (char*)
+ my_realloc(global_system_variables.dynamic_variables_ptr, new_size,
+ MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR));
+ max_system_variables.dynamic_variables_ptr= (char*)
+ my_realloc(max_system_variables.dynamic_variables_ptr, new_size,
+ MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR));
+ /*
+ Clear the new variable value space. This is required for string
+ variables. If their value is non-NULL, it must point to a valid
+ string.
+ */
+ bzero(global_system_variables.dynamic_variables_ptr +
+ global_variables_dynamic_size,
+ new_size - global_variables_dynamic_size);
+ bzero(max_system_variables.dynamic_variables_ptr +
+ global_variables_dynamic_size,
+ new_size - global_variables_dynamic_size);
+ global_variables_dynamic_size= new_size;
+ }
+
+ global_system_variables.dynamic_variables_head= offset;
+ max_system_variables.dynamic_variables_head= offset;
+ global_system_variables.dynamic_variables_size= offset + size;
+ max_system_variables.dynamic_variables_size= offset + size;
+ global_system_variables.dynamic_variables_version++;
+ max_system_variables.dynamic_variables_version++;
+
+ result->version= global_system_variables.dynamic_variables_version;
+
+ /* this should succeed because we have already checked if a dup exists */
+ if (my_hash_insert(&bookmark_hash, (uchar*) result))
+ {
+ fprintf(stderr, "failed to add placeholder to hash");
+ DBUG_ASSERT(0);
+ }
+ }
+ my_afree(varname);
+ return result;
+}
+
+
+/*
+ returns a pointer to the memory which holds the thd-local variable or
+ a pointer to the global variable if thd==null.
+ If required, will sync with global variables if the requested variable
+ has not yet been allocated in the current thread.
+*/
+static uchar *intern_sys_var_ptr(THD* thd, int offset, bool global_lock)
+{
+ DBUG_ASSERT(offset >= 0);
+ DBUG_ASSERT((uint)offset <= global_system_variables.dynamic_variables_head);
+
+ if (!thd)
+ return (uchar*) global_system_variables.dynamic_variables_ptr + offset;
+
+ /*
+ dynamic_variables_head points to the largest valid offset
+ */
+ if (!thd->variables.dynamic_variables_ptr ||
+ (uint)offset > thd->variables.dynamic_variables_head)
+ {
+ uint idx;
+
+ rw_rdlock(&LOCK_system_variables_hash);
+
+ thd->variables.dynamic_variables_ptr= (char*)
+ my_realloc(thd->variables.dynamic_variables_ptr,
+ global_variables_dynamic_size,
+ MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR));
+
+ if (global_lock)
+ pthread_mutex_lock(&LOCK_global_system_variables);
+
+ safe_mutex_assert_owner(&LOCK_global_system_variables);
+
+ memcpy(thd->variables.dynamic_variables_ptr +
+ thd->variables.dynamic_variables_size,
+ global_system_variables.dynamic_variables_ptr +
+ thd->variables.dynamic_variables_size,
+ global_system_variables.dynamic_variables_size -
+ thd->variables.dynamic_variables_size);
+
+ /*
+ now we need to iterate through any newly copied 'defaults'
+ and if it is a string type with MEMALLOC flag, we need to strdup
+ */
+ for (idx= 0; idx < bookmark_hash.records; idx++)
+ {
+ sys_var_pluginvar *pi;
+ sys_var *var;
+ st_bookmark *v= (st_bookmark*) 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)) ||
+ !(pi= var->cast_pluginvar()) ||
+ v->key[0] != (pi->plugin_var->flags & PLUGIN_VAR_TYPEMASK))
+ continue;
+
+ /* Here we do anything special that may be required of the data types */
+
+ if ((pi->plugin_var->flags & PLUGIN_VAR_TYPEMASK) == PLUGIN_VAR_STR &&
+ pi->plugin_var->flags & PLUGIN_VAR_MEMALLOC)
+ {
+ char **pp= (char**) (thd->variables.dynamic_variables_ptr +
+ *(int*)(pi->plugin_var + 1));
+ if ((*pp= *(char**) (global_system_variables.dynamic_variables_ptr +
+ *(int*)(pi->plugin_var + 1))))
+ *pp= my_strdup(*pp, MYF(MY_WME|MY_FAE));
+ }
+ }
+
+ if (global_lock)
+ pthread_mutex_unlock(&LOCK_global_system_variables);
+
+ thd->variables.dynamic_variables_version=
+ global_system_variables.dynamic_variables_version;
+ thd->variables.dynamic_variables_head=
+ global_system_variables.dynamic_variables_head;
+ thd->variables.dynamic_variables_size=
+ global_system_variables.dynamic_variables_size;
+
+ rw_unlock(&LOCK_system_variables_hash);
+ }
+ return (uchar*)thd->variables.dynamic_variables_ptr + offset;
+}
+
+static uchar *mysql_sys_var_ptr(void* a_thd, int offset)
+{
+ return intern_sys_var_ptr((THD *)a_thd, offset, true);
+}
+
+
+void plugin_thdvar_init(THD *thd)
+{
+ plugin_ref old_table_plugin= thd->variables.table_plugin;
+ DBUG_ENTER("plugin_thdvar_init");
+
+ thd->variables.table_plugin= NULL;
+ cleanup_variables(thd, &thd->variables);
+
+ thd->variables= global_system_variables;
+ thd->variables.table_plugin= NULL;
+
+ /* we are going to allocate these lazily */
+ thd->variables.dynamic_variables_version= 0;
+ thd->variables.dynamic_variables_size= 0;
+ thd->variables.dynamic_variables_ptr= 0;
+
+ pthread_mutex_lock(&LOCK_plugin);
+ thd->variables.table_plugin=
+ my_intern_plugin_lock(NULL, global_system_variables.table_plugin);
+ intern_plugin_unlock(NULL, old_table_plugin);
+ pthread_mutex_unlock(&LOCK_plugin);
+ DBUG_VOID_RETURN;
+}
+
+
+/*
+ Unlocks all system variables which hold a reference
+*/
+static void unlock_variables(THD *thd, struct system_variables *vars)
+{
+ intern_plugin_unlock(NULL, vars->table_plugin);
+ vars->table_plugin= NULL;
+}
+
+
+/*
+ Frees memory used by system variables
+
+ Unlike plugin_vars_free_values() it frees all variables of all plugins,
+ it's used on shutdown.
+*/
+static void cleanup_variables(THD *thd, struct system_variables *vars)
+{
+ st_bookmark *v;
+ sys_var_pluginvar *pivar;
+ sys_var *var;
+ int flags;
+ uint idx;
+
+ rw_rdlock(&LOCK_system_variables_hash);
+ for (idx= 0; idx < bookmark_hash.records; idx++)
+ {
+ v= (st_bookmark*) 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()) ||
+ v->key[0] != (pivar->plugin_var->flags & PLUGIN_VAR_TYPEMASK))
+ continue;
+
+ flags= pivar->plugin_var->flags;
+
+ if ((flags & PLUGIN_VAR_TYPEMASK) == PLUGIN_VAR_STR &&
+ flags & PLUGIN_VAR_THDLOCAL && flags & PLUGIN_VAR_MEMALLOC)
+ {
+ char **ptr= (char**) pivar->real_value_ptr(thd, OPT_SESSION);
+ my_free(*ptr, MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR));
+ *ptr= NULL;
+ }
+ }
+ rw_unlock(&LOCK_system_variables_hash);
+
+ DBUG_ASSERT(vars->table_plugin == NULL);
+
+ my_free(vars->dynamic_variables_ptr, MYF(MY_ALLOW_ZERO_PTR));
+ vars->dynamic_variables_ptr= NULL;
+ vars->dynamic_variables_size= 0;
+ vars->dynamic_variables_version= 0;
+}
+
+
+void plugin_thdvar_cleanup(THD *thd)
+{
+ uint idx;
+ plugin_ref *list;
+ DBUG_ENTER("plugin_thdvar_cleanup");
+
+ pthread_mutex_lock(&LOCK_plugin);
+
+ unlock_variables(thd, &thd->variables);
+ cleanup_variables(thd, &thd->variables);
+
+ if ((idx= thd->lex->plugins.elements))
+ {
+ list= ((plugin_ref*) thd->lex->plugins.buffer) + idx - 1;
+ DBUG_PRINT("info",("unlocking %d plugins", idx));
+ while ((uchar*) list >= thd->lex->plugins.buffer)
+ intern_plugin_unlock(NULL, *list--);
+ }
+
+ reap_plugins();
+ pthread_mutex_unlock(&LOCK_plugin);
+
+ reset_dynamic(&thd->lex->plugins);
+
+ DBUG_VOID_RETURN;
+}
+
+
+/**
+ @brief Free values of thread variables of a plugin.
+
+ This must be called before a plugin is deleted. Otherwise its
+ variables are no longer accessible and the value space is lost. Note
+ that only string values with PLUGIN_VAR_MEMALLOC are allocated and
+ must be freed.
+
+ @param[in] vars Chain of system variables of a plugin
+*/
+
+static void plugin_vars_free_values(sys_var *vars)
+{
+ DBUG_ENTER("plugin_vars_free_values");
+
+ for (sys_var *var= vars; var; var= var->next)
+ {
+ sys_var_pluginvar *piv= var->cast_pluginvar();
+ if (piv &&
+ ((piv->plugin_var->flags & PLUGIN_VAR_TYPEMASK) == PLUGIN_VAR_STR) &&
+ (piv->plugin_var->flags & PLUGIN_VAR_MEMALLOC))
+ {
+ /* Free the string from global_system_variables. */
+ char **valptr= (char**) piv->real_value_ptr(NULL, OPT_GLOBAL);
+ DBUG_PRINT("plugin", ("freeing value for: '%s' addr: 0x%lx",
+ var->name, (long) valptr));
+ my_free(*valptr, MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR));
+ *valptr= NULL;
+ }
+ }
+ DBUG_VOID_RETURN;
+}
+
+
+bool sys_var_pluginvar::check_update_type(Item_result type)
+{
+ if (is_readonly())
+ return 1;
+ switch (plugin_var->flags & PLUGIN_VAR_TYPEMASK) {
+ case PLUGIN_VAR_INT:
+ case PLUGIN_VAR_LONG:
+ case PLUGIN_VAR_LONGLONG:
+ return type != INT_RESULT;
+ case PLUGIN_VAR_STR:
+ return type != STRING_RESULT;
+ default:
+ return 0;
+ }
+}
+
+
+SHOW_TYPE sys_var_pluginvar::show_type()
+{
+ switch (plugin_var->flags & PLUGIN_VAR_TYPEMASK) {
+ case PLUGIN_VAR_BOOL:
+ return SHOW_MY_BOOL;
+ case PLUGIN_VAR_INT:
+ return SHOW_INT;
+ case PLUGIN_VAR_LONG:
+ return SHOW_LONG;
+ case PLUGIN_VAR_LONGLONG:
+ return SHOW_LONGLONG;
+ case PLUGIN_VAR_STR:
+ return SHOW_CHAR_PTR;
+ case PLUGIN_VAR_ENUM:
+ case PLUGIN_VAR_SET:
+ return SHOW_CHAR;
+ default:
+ DBUG_ASSERT(0);
+ return SHOW_UNDEF;
+ }
+}
+
+
+uchar* sys_var_pluginvar::real_value_ptr(THD *thd, enum_var_type type)
+{
+ DBUG_ASSERT(thd || (type == OPT_GLOBAL));
+ if (plugin_var->flags & PLUGIN_VAR_THDLOCAL)
+ {
+ if (type == OPT_GLOBAL)
+ thd= NULL;
+
+ return intern_sys_var_ptr(thd, *(int*) (plugin_var+1), false);
+ }
+ return *(uchar**) (plugin_var+1);
+}
+
+
+TYPELIB* sys_var_pluginvar::plugin_var_typelib(void)
+{
+ switch (plugin_var->flags & (PLUGIN_VAR_TYPEMASK | PLUGIN_VAR_THDLOCAL)) {
+ case PLUGIN_VAR_ENUM:
+ return ((sysvar_enum_t *)plugin_var)->typelib;
+ case PLUGIN_VAR_SET:
+ return ((sysvar_set_t *)plugin_var)->typelib;
+ case PLUGIN_VAR_ENUM | PLUGIN_VAR_THDLOCAL:
+ return ((thdvar_enum_t *)plugin_var)->typelib;
+ case PLUGIN_VAR_SET | PLUGIN_VAR_THDLOCAL:
+ return ((thdvar_set_t *)plugin_var)->typelib;
+ default:
+ return NULL;
+ }
+ return NULL;
+}
+
+
+uchar* sys_var_pluginvar::value_ptr(THD *thd, enum_var_type type,
+ LEX_STRING *base)
+{
+ uchar* result;
+
+ result= real_value_ptr(thd, type);
+
+ if ((plugin_var->flags & PLUGIN_VAR_TYPEMASK) == PLUGIN_VAR_ENUM)
+ result= (uchar*) get_type(plugin_var_typelib(), *(ulong*)result);
+ else if ((plugin_var->flags & PLUGIN_VAR_TYPEMASK) == PLUGIN_VAR_SET)
+ {
+ char buffer[STRING_BUFFER_USUAL_SIZE];
+ String str(buffer, sizeof(buffer), system_charset_info);
+ TYPELIB *typelib= plugin_var_typelib();
+ ulonglong mask= 1, value= *(ulonglong*) result;
+ uint i;
+
+ str.length(0);
+ for (i= 0; i < typelib->count; i++, mask<<=1)
+ {
+ if (!(value & mask))
+ continue;
+ str.append(typelib->type_names[i], typelib->type_lengths[i]);
+ str.append(',');
+ }
+
+ result= (uchar*) "";
+ if (str.length())
+ result= (uchar*) thd->strmake(str.ptr(), str.length()-1);
+ }
+ return result;
+}
+
+
+bool sys_var_pluginvar::check(THD *thd, set_var *var)
+{
+ st_item_value_holder value;
+ DBUG_ASSERT(is_readonly() || plugin_var->check);
+
+ value.value_type= item_value_type;
+ value.val_str= item_val_str;
+ value.val_int= item_val_int;
+ value.val_real= item_val_real;
+ value.item= var->value;
+
+ return is_readonly() ||
+ plugin_var->check(thd, plugin_var, &var->save_result, &value);
+}
+
+
+void sys_var_pluginvar::set_default(THD *thd, enum_var_type type)
+{
+ void *tgt, *src;
+
+ DBUG_ASSERT(is_readonly() || plugin_var->update);
+
+ if (is_readonly())
+ return;
+
+ tgt= real_value_ptr(thd, type);
+ src= ((void **) (plugin_var + 1) + 1);
+
+ if (plugin_var->flags & PLUGIN_VAR_THDLOCAL)
+ {
+ src= ((int*) (plugin_var + 1) + 1);
+ if (type != OPT_GLOBAL)
+ src= real_value_ptr(thd, OPT_GLOBAL);
+ }
+
+ /* thd must equal current_thd if PLUGIN_VAR_THDLOCAL flag is set */
+ DBUG_ASSERT(!(plugin_var->flags & PLUGIN_VAR_THDLOCAL) ||
+ thd == current_thd);
+
+ if (!(plugin_var->flags & PLUGIN_VAR_THDLOCAL) || type == OPT_GLOBAL)
+ {
+ pthread_mutex_lock(&LOCK_plugin);
+ plugin_var->update(thd, plugin_var, tgt, src);
+ pthread_mutex_unlock(&LOCK_plugin);
+ }
+ else
+ plugin_var->update(thd, plugin_var, tgt, src);
+}
+
+
+bool sys_var_pluginvar::update(THD *thd, set_var *var)
+{
+ void *tgt;
+
+ DBUG_ASSERT(is_readonly() || plugin_var->update);
+
+ /* thd must equal current_thd if PLUGIN_VAR_THDLOCAL flag is set */
+ DBUG_ASSERT(!(plugin_var->flags & PLUGIN_VAR_THDLOCAL) ||
+ thd == current_thd);
+
+ if (is_readonly())
+ return 1;
+
+ pthread_mutex_lock(&LOCK_global_system_variables);
+ tgt= real_value_ptr(thd, var->type);
+
+ if (!(plugin_var->flags & PLUGIN_VAR_THDLOCAL) || var->type == OPT_GLOBAL)
+ {
+ /* variable we are updating has global scope, so we unlock after updating */
+ plugin_var->update(thd, plugin_var, tgt, &var->save_result);
+ pthread_mutex_unlock(&LOCK_global_system_variables);
+ }
+ else
+ {
+ pthread_mutex_unlock(&LOCK_global_system_variables);
+ plugin_var->update(thd, plugin_var, tgt, &var->save_result);
+ }
+ return 0;
+}
+
+
+#define OPTION_SET_LIMITS(type, options, opt) \
+ options->var_type= type; \
+ options->def_value= (opt)->def_val; \
+ options->min_value= (opt)->min_val; \
+ options->max_value= (opt)->max_val; \
+ options->block_size= (long) (opt)->blk_sz
+
+
+static void plugin_opt_set_limits(struct my_option *options,
+ const struct st_mysql_sys_var *opt)
+{
+ switch (opt->flags & (PLUGIN_VAR_TYPEMASK |
+ PLUGIN_VAR_UNSIGNED | PLUGIN_VAR_THDLOCAL)) {
+ /* global system variables */
+ case PLUGIN_VAR_INT:
+ OPTION_SET_LIMITS(GET_INT, options, (sysvar_int_t*) opt);
+ break;
+ case PLUGIN_VAR_INT | PLUGIN_VAR_UNSIGNED:
+ OPTION_SET_LIMITS(GET_UINT, options, (sysvar_uint_t*) opt);
+ break;
+ case PLUGIN_VAR_LONG:
+ OPTION_SET_LIMITS(GET_LONG, options, (sysvar_long_t*) opt);
+ break;
+ case PLUGIN_VAR_LONG | PLUGIN_VAR_UNSIGNED:
+ OPTION_SET_LIMITS(GET_ULONG, options, (sysvar_ulong_t*) opt);
+ break;
+ case PLUGIN_VAR_LONGLONG:
+ OPTION_SET_LIMITS(GET_LL, options, (sysvar_longlong_t*) opt);
+ break;
+ case PLUGIN_VAR_LONGLONG | PLUGIN_VAR_UNSIGNED:
+ OPTION_SET_LIMITS(GET_ULL, options, (sysvar_ulonglong_t*) opt);
+ break;
+ case PLUGIN_VAR_ENUM:
+ options->var_type= GET_ENUM;
+ options->typelib= ((sysvar_enum_t*) opt)->typelib;
+ options->def_value= *(ulong*) ((int*) (opt + 1) + 1);
+ options->min_value= options->block_size= 0;
+ options->max_value= options->typelib->count - 1;
+ break;
+ case PLUGIN_VAR_SET:
+ options->var_type= GET_SET;
+ options->typelib= ((sysvar_set_t*) opt)->typelib;
+ options->def_value= *(ulonglong*) ((int*) (opt + 1) + 1);
+ options->min_value= options->block_size= 0;
+ options->max_value= (ULL(1) << options->typelib->count) - 1;
+ break;
+ case PLUGIN_VAR_BOOL:
+ options->var_type= GET_BOOL;
+ options->def_value= *(my_bool*) ((void**)(opt + 1) + 1);
+ break;
+ case PLUGIN_VAR_STR:
+ options->var_type= ((opt->flags & PLUGIN_VAR_MEMALLOC) ?
+ GET_STR_ALLOC : GET_STR);
+ options->def_value= (ulonglong)(intptr) *((char**) ((void**) (opt + 1) + 1));
+ break;
+ /* threadlocal variables */
+ case PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL:
+ OPTION_SET_LIMITS(GET_INT, options, (thdvar_int_t*) opt);
+ break;
+ case PLUGIN_VAR_INT | PLUGIN_VAR_UNSIGNED | PLUGIN_VAR_THDLOCAL:
+ OPTION_SET_LIMITS(GET_UINT, options, (thdvar_uint_t*) opt);
+ break;
+ case PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL:
+ OPTION_SET_LIMITS(GET_LONG, options, (thdvar_long_t*) opt);
+ break;
+ case PLUGIN_VAR_LONG | PLUGIN_VAR_UNSIGNED | PLUGIN_VAR_THDLOCAL:
+ OPTION_SET_LIMITS(GET_ULONG, options, (thdvar_ulong_t*) opt);
+ break;
+ case PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL:
+ OPTION_SET_LIMITS(GET_LL, options, (thdvar_longlong_t*) opt);
+ break;
+ case PLUGIN_VAR_LONGLONG | PLUGIN_VAR_UNSIGNED | PLUGIN_VAR_THDLOCAL:
+ OPTION_SET_LIMITS(GET_ULL, options, (thdvar_ulonglong_t*) opt);
+ break;
+ case PLUGIN_VAR_ENUM | PLUGIN_VAR_THDLOCAL:
+ options->var_type= GET_ENUM;
+ options->typelib= ((thdvar_enum_t*) opt)->typelib;
+ options->def_value= *(ulong*) ((int*) (opt + 1) + 1);
+ options->min_value= options->block_size= 0;
+ options->max_value= options->typelib->count - 1;
+ break;
+ case PLUGIN_VAR_SET | PLUGIN_VAR_THDLOCAL:
+ options->var_type= GET_SET;
+ options->typelib= ((thdvar_set_t*) opt)->typelib;
+ options->def_value= *(ulonglong*) ((int*) (opt + 1) + 1);
+ options->min_value= options->block_size= 0;
+ options->max_value= (ULL(1) << options->typelib->count) - 1;
+ break;
+ case PLUGIN_VAR_BOOL | PLUGIN_VAR_THDLOCAL:
+ options->var_type= GET_BOOL;
+ options->def_value= *(my_bool*) ((int*) (opt + 1) + 1);
+ break;
+ case PLUGIN_VAR_STR | PLUGIN_VAR_THDLOCAL:
+ options->var_type= ((opt->flags & PLUGIN_VAR_MEMALLOC) ?
+ GET_STR_ALLOC : GET_STR);
+ options->def_value= (intptr) *((char**) ((void**) (opt + 1) + 1));
+ break;
+ default:
+ DBUG_ASSERT(0);
+ }
+ options->arg_type= REQUIRED_ARG;
+ if (opt->flags & PLUGIN_VAR_NOCMDARG)
+ options->arg_type= NO_ARG;
+ if (opt->flags & PLUGIN_VAR_OPCMDARG)
+ options->arg_type= OPT_ARG;
+}
+
+extern "C" my_bool get_one_plugin_option(int optid, const struct my_option *,
+ char *);
+
+my_bool get_one_plugin_option(int optid __attribute__((unused)),
+ const struct my_option *opt,
+ char *argument)
+{
+ return 0;
+}
+
+
+static int construct_options(MEM_ROOT *mem_root, struct st_plugin_int *tmp,
+ my_option *options, my_bool **enabled,
+ bool can_disable)
+{
+ const char *plugin_name= tmp->plugin->name;
+ uint namelen= strlen(plugin_name), optnamelen;
+ uint buffer_length= namelen * 4 + (can_disable ? 75 : 10);
+ char *name= (char*) alloc_root(mem_root, buffer_length) + 1;
+ char *optname, *p;
+ int index= 0, offset= 0;
+ st_mysql_sys_var *opt, **plugin_option;
+ st_bookmark *v;
+ DBUG_ENTER("construct_options");
+ DBUG_PRINT("plugin", ("plugin: '%s' enabled: %d can_disable: %d",
+ plugin_name, **enabled, can_disable));
+
+ /* support --skip-plugin-foo syntax */
+ memcpy(name, plugin_name, namelen + 1);
+ my_casedn_str(&my_charset_latin1, name);
+ strxmov(name + namelen + 1, "plugin-", name, NullS);
+ /* Now we have namelen + 1 + 7 + namelen + 1 == namelen * 2 + 9. */
+
+ for (p= name + namelen*2 + 8; p > name; p--)
+ if (*p == '_')
+ *p= '-';
+
+ if (can_disable)
+ {
+ strxmov(name + namelen*2 + 10, "Enable ", plugin_name, " plugin. "
+ "Disable with --skip-", name," (will save memory).", NullS);
+ /*
+ Now we have namelen * 2 + 10 (one char unused) + 7 + namelen + 9 +
+ 20 + namelen + 20 + 1 == namelen * 4 + 67.
+ */
+
+ options[0].comment= name + namelen*2 + 10;
+ }
+
+ /*
+ NOTE: 'name' is one char above the allocated buffer!
+ NOTE: This code assumes that 'my_bool' and 'char' are of same size.
+ */
+ *((my_bool *)(name -1))= **enabled;
+ *enabled= (my_bool *)(name - 1);
+
+
+ options[1].name= (options[0].name= name) + namelen + 1;
+ options[0].id= options[1].id= 256; /* must be >255. dup id ok */
+ options[0].var_type= options[1].var_type= GET_BOOL;
+ options[0].arg_type= options[1].arg_type= NO_ARG;
+ options[0].def_value= options[1].def_value= **enabled;
+ options[0].value= options[0].u_max_value=
+ options[1].value= options[1].u_max_value= (uchar**) (name - 1);
+ options+= 2;
+
+ /*
+ Two passes as the 2nd pass will take pointer addresses for use
+ by my_getopt and register_var() in the first pass uses realloc
+ */
+
+ for (plugin_option= tmp->plugin->system_vars;
+ plugin_option && *plugin_option; plugin_option++, index++)
+ {
+ opt= *plugin_option;
+ if (!(opt->flags & PLUGIN_VAR_THDLOCAL))
+ continue;
+ if (!(register_var(name, opt->name, opt->flags)))
+ continue;
+ switch (opt->flags & PLUGIN_VAR_TYPEMASK) {
+ case PLUGIN_VAR_BOOL:
+ SET_PLUGIN_VAR_RESOLVE((thdvar_bool_t *) opt);
+ break;
+ case PLUGIN_VAR_INT:
+ SET_PLUGIN_VAR_RESOLVE((thdvar_int_t *) opt);
+ break;
+ case PLUGIN_VAR_LONG:
+ SET_PLUGIN_VAR_RESOLVE((thdvar_long_t *) opt);
+ break;
+ case PLUGIN_VAR_LONGLONG:
+ SET_PLUGIN_VAR_RESOLVE((thdvar_longlong_t *) opt);
+ break;
+ case PLUGIN_VAR_STR:
+ SET_PLUGIN_VAR_RESOLVE((thdvar_str_t *) opt);
+ break;
+ case PLUGIN_VAR_ENUM:
+ SET_PLUGIN_VAR_RESOLVE((thdvar_enum_t *) opt);
+ break;
+ case PLUGIN_VAR_SET:
+ SET_PLUGIN_VAR_RESOLVE((thdvar_set_t *) opt);
+ break;
+ default:
+ sql_print_error("Unknown variable type code 0x%x in plugin '%s'.",
+ opt->flags, plugin_name);
+ DBUG_RETURN(-1);
+ };
+ }
+
+ for (plugin_option= tmp->plugin->system_vars;
+ plugin_option && *plugin_option; plugin_option++, index++)
+ {
+ switch ((opt= *plugin_option)->flags & PLUGIN_VAR_TYPEMASK) {
+ case PLUGIN_VAR_BOOL:
+ if (!opt->check)
+ opt->check= check_func_bool;
+ if (!opt->update)
+ opt->update= update_func_bool;
+ break;
+ case PLUGIN_VAR_INT:
+ if (!opt->check)
+ opt->check= check_func_int;
+ if (!opt->update)
+ opt->update= update_func_int;
+ break;
+ case PLUGIN_VAR_LONG:
+ if (!opt->check)
+ opt->check= check_func_long;
+ if (!opt->update)
+ opt->update= update_func_long;
+ break;
+ case PLUGIN_VAR_LONGLONG:
+ if (!opt->check)
+ opt->check= check_func_longlong;
+ if (!opt->update)
+ opt->update= update_func_longlong;
+ break;
+ case PLUGIN_VAR_STR:
+ if (!opt->check)
+ opt->check= check_func_str;
+ if (!opt->update)
+ {
+ opt->update= update_func_str;
+ if (!(opt->flags & PLUGIN_VAR_MEMALLOC | PLUGIN_VAR_READONLY))
+ {
+ opt->flags|= PLUGIN_VAR_READONLY;
+ sql_print_warning("Server variable %s of plugin %s was forced "
+ "to be read-only: string variable without "
+ "update_func and PLUGIN_VAR_MEMALLOC flag",
+ opt->name, plugin_name);
+ }
+ }
+ break;
+ case PLUGIN_VAR_ENUM:
+ if (!opt->check)
+ opt->check= check_func_enum;
+ if (!opt->update)
+ opt->update= update_func_long;
+ break;
+ case PLUGIN_VAR_SET:
+ if (!opt->check)
+ opt->check= check_func_set;
+ if (!opt->update)
+ opt->update= update_func_longlong;
+ break;
+ default:
+ sql_print_error("Unknown variable type code 0x%x in plugin '%s'.",
+ opt->flags, plugin_name);
+ DBUG_RETURN(-1);
+ }
+
+ if (opt->flags & PLUGIN_VAR_NOCMDOPT)
+ continue;
+
+ if (!opt->name)
+ {
+ sql_print_error("Missing variable name in plugin '%s'.",
+ plugin_name);
+ DBUG_RETURN(-1);
+ }
+
+ if (!(v= find_bookmark(name, opt->name, opt->flags)))
+ {
+ optnamelen= strlen(opt->name);
+ optname= (char*) alloc_root(mem_root, namelen + optnamelen + 2);
+ strxmov(optname, name, "-", opt->name, NullS);
+ optnamelen= namelen + optnamelen + 1;
+ }
+ else
+ optname= (char*) memdup_root(mem_root, v->key + 1, (optnamelen= v->name_len) + 1);
+
+ /* convert '_' to '-' */
+ for (p= optname; *p; p++)
+ if (*p == '_')
+ *p= '-';
+
+ options->name= optname;
+ options->comment= opt->comment;
+ options->app_type= opt;
+ options->id= (options-1)->id + 1;
+
+ if (opt->flags & PLUGIN_VAR_THDLOCAL)
+ *(int*)(opt + 1)= offset= v->offset;
+
+ plugin_opt_set_limits(options, opt);
+
+ if ((opt->flags & PLUGIN_VAR_TYPEMASK) != PLUGIN_VAR_ENUM &&
+ (opt->flags & PLUGIN_VAR_TYPEMASK) != PLUGIN_VAR_SET)
+ {
+ if (opt->flags & PLUGIN_VAR_THDLOCAL)
+ options->value= options->u_max_value= (uchar**)
+ (global_system_variables.dynamic_variables_ptr + offset);
+ else
+ options->value= options->u_max_value= *(uchar***) (opt + 1);
+ }
+
+ options[1]= options[0];
+ options[1].name= p= (char*) alloc_root(mem_root, optnamelen + 8);
+ options[1].comment= 0; // hidden
+ strxmov(p, "plugin-", optname, NullS);
+
+ options+= 2;
+ }
+
+ DBUG_RETURN(0);
+}
+
+
+static my_option *construct_help_options(MEM_ROOT *mem_root,
+ struct st_plugin_int *p)
+{
+ st_mysql_sys_var **opt;
+ my_option *opts;
+ my_bool dummy, can_disable;
+ my_bool *dummy2= &dummy;
+ uint count= EXTRA_OPTIONS;
+ DBUG_ENTER("construct_help_options");
+
+ for (opt= p->plugin->system_vars; opt && *opt; opt++, count+= 2);
+
+ if (!(opts= (my_option*) alloc_root(mem_root, sizeof(my_option) * count)))
+ DBUG_RETURN(NULL);
+
+ bzero(opts, sizeof(my_option) * count);
+
+ dummy= TRUE; /* plugin is enabled. */
+
+ can_disable=
+ my_strcasecmp(&my_charset_latin1, p->name.str, "MyISAM") &&
+ my_strcasecmp(&my_charset_latin1, p->name.str, "MEMORY");
+
+ if (construct_options(mem_root, p, opts, &dummy2, can_disable))
+ DBUG_RETURN(NULL);
+
+ DBUG_RETURN(opts);
+}
+
+
+/*
+ SYNOPSIS
+ test_plugin_options()
+ tmp_root temporary scratch space
+ plugin internal plugin structure
+ argc user supplied arguments
+ argv user supplied arguments
+ default_enabled default plugin enable status
+ RETURNS:
+ 0 SUCCESS - plugin should be enabled/loaded
+ NOTE:
+ Requires that a write-lock is held on LOCK_system_variables_hash
+*/
+static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp,
+ int *argc, char **argv, my_bool default_enabled)
+{
+ struct sys_var_chain chain= { NULL, NULL };
+ my_bool enabled_saved= default_enabled, can_disable;
+ my_bool *enabled= &default_enabled;
+ MEM_ROOT *mem_root= alloc_root_inited(&tmp->mem_root) ?
+ &tmp->mem_root : &plugin_mem_root;
+ st_mysql_sys_var **opt;
+ my_option *opts;
+ char *p, *varname;
+ int error;
+ st_mysql_sys_var *o;
+ sys_var *v;
+ struct st_bookmark *var;
+ uint len, count= EXTRA_OPTIONS;
+ DBUG_ENTER("test_plugin_options");
+ DBUG_ASSERT(tmp->plugin && tmp->name.str);
+
+ for (opt= tmp->plugin->system_vars; opt && *opt; opt++)
+ count+= 2; /* --{plugin}-{optname} and --plugin-{plugin}-{optname} */
+
+ can_disable=
+ my_strcasecmp(&my_charset_latin1, tmp->name.str, "MyISAM") &&
+ my_strcasecmp(&my_charset_latin1, tmp->name.str, "MEMORY");
+
+ if (count > EXTRA_OPTIONS || (*argc > 1))
+ {
+ if (!(opts= (my_option*) alloc_root(tmp_root, sizeof(my_option) * count)))
+ {
+ sql_print_error("Out of memory for plugin '%s'.", tmp->name.str);
+ DBUG_RETURN(-1);
+ }
+ bzero(opts, sizeof(my_option) * count);
+
+ if (construct_options(tmp_root, tmp, opts, &enabled, can_disable))
+ {
+ sql_print_error("Bad options for plugin '%s'.", tmp->name.str);
+ DBUG_RETURN(-1);
+ }
+
+ error= handle_options(argc, &argv, opts, get_one_plugin_option);
+ (*argc)++; /* add back one for the program name */
+
+ if (error)
+ {
+ sql_print_error("Parsing options for plugin '%s' failed.",
+ tmp->name.str);
+ DBUG_RETURN(error);
+ }
+ }
+
+ if (!*enabled && !can_disable)
+ {
+ sql_print_warning("Plugin '%s' cannot be disabled", tmp->name.str);
+ *enabled= TRUE;
+ }
+
+ if (*enabled)
+ {
+ for (opt= tmp->plugin->system_vars; opt && *opt; opt++)
+ {
+ if (((o= *opt)->flags & PLUGIN_VAR_NOSYSVAR))
+ continue;
+
+ if ((var= find_bookmark(tmp->name.str, o->name, o->flags)))
+ v= new (mem_root) sys_var_pluginvar(var->key + 1, o);
+ else
+ {
+ len= tmp->name.length + strlen(o->name) + 2;
+ varname= (char*) alloc_root(mem_root, len);
+ strxmov(varname, tmp->name.str, "-", o->name, NullS);
+ my_casedn_str(&my_charset_latin1, varname);
+
+ for (p= varname; *p; p++)
+ if (*p == '-')
+ *p= '_';
+
+ v= new (mem_root) sys_var_pluginvar(varname, o);
+ }
+ DBUG_ASSERT(v); /* check that an object was actually constructed */
+
+ /*
+ Add to the chain of variables.
+ Done like this for easier debugging so that the
+ pointer to v is not lost on optimized builds.
+ */
+ v->chain_sys_var(&chain);
+ }
+ if (chain.first)
+ {
+ chain.last->next = NULL;
+ if (mysql_add_sys_var_chain(chain.first, NULL))
+ {
+ sql_print_error("Plugin '%s' has conflicting system variables",
+ tmp->name.str);
+ DBUG_RETURN(1);
+ }
+ tmp->system_vars= chain.first;
+ }
+ DBUG_RETURN(0);
+ }
+
+ if (enabled_saved && global_system_variables.log_warnings)
+ sql_print_information("Plugin '%s' disabled by command line option",
+ tmp->name.str);
+ DBUG_RETURN(1);
+}
+
+
+/****************************************************************************
+ Help Verbose text with Plugin System Variables
+****************************************************************************/
+
+static int option_cmp(my_option *a, my_option *b)
+{
+ return my_strcasecmp(&my_charset_latin1, a->name, b->name);
+}
+
+
+void my_print_help_inc_plugins(my_option *main_options, uint size)
+{
+ DYNAMIC_ARRAY all_options;
+ struct st_plugin_int *p;
+ MEM_ROOT mem_root;
+ my_option *opt;
+
+ init_alloc_root(&mem_root, 4096, 4096);
+ my_init_dynamic_array(&all_options, sizeof(my_option), size, size/4);
+
+ if (initialized)
+ for (uint idx= 0; idx < plugin_array.elements; idx++)
+ {
+ p= *dynamic_element(&plugin_array, idx, struct st_plugin_int **);
+
+ if (!p->plugin->system_vars ||
+ !(opt= construct_help_options(&mem_root, p)))
+ continue;
+
+ /* Only options with a non-NULL comment are displayed in help text */
+ for (;opt->id; opt++)
+ if (opt->comment)
+ insert_dynamic(&all_options, (uchar*) opt);
+ }
+
+ for (;main_options->id; main_options++)
+ insert_dynamic(&all_options, (uchar*) main_options);
+
+ sort_dynamic(&all_options, (qsort_cmp) option_cmp);
+
+ /* main_options now points to the empty option terminator */
+ insert_dynamic(&all_options, (uchar*) main_options);
+
+ my_print_help((my_option*) all_options.buffer);
+ my_print_variables((my_option*) all_options.buffer);
+
+ delete_dynamic(&all_options);
+ free_root(&mem_root, MYF(0));
+}
+
diff --git a/sql/sql_plugin.h b/sql/sql_plugin.h
index d86d9332a92..e8f2cb6ee5e 100644
--- a/sql/sql_plugin.h
+++ b/sql/sql_plugin.h
@@ -16,13 +16,25 @@
#ifndef _sql_plugin_h
#define _sql_plugin_h
+class sys_var;
+
+/*
+ the following flags are valid for plugin_init()
+*/
+#define PLUGIN_INIT_SKIP_DYNAMIC_LOADING 1
+#define PLUGIN_INIT_SKIP_PLUGIN_TABLE 2
+#define PLUGIN_INIT_SKIP_INITIALIZATION 4
+
+#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_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;
@@ -41,6 +53,7 @@ typedef struct st_mysql_show_var SHOW_VAR;
#define PLUGIN_IS_DELETED 2
#define PLUGIN_IS_UNINITIALIZED 4
#define PLUGIN_IS_READY 8
+#define PLUGIN_IS_DYING 16
/* A handle for the dynamic library containing a plugin or plugins. */
@@ -63,25 +76,64 @@ struct st_plugin_int
uint state;
uint ref_count; /* number of threads using the plugin */
void *data; /* plugin type specific, e.g. handlerton */
+ MEM_ROOT mem_root; /* memory for dynamic plugin structures */
+ sys_var *system_vars; /* server variables for this plugin */
};
+
+/*
+ See intern_plugin_lock() for the explanation for the
+ conditionally defined plugin_ref type
+*/
+#ifdef DBUG_OFF
+typedef struct st_plugin_int *plugin_ref;
+#define plugin_decl(pi) ((pi)->plugin)
+#define plugin_dlib(pi) ((pi)->plugin_dl)
+#define plugin_data(pi,cast) ((cast)((pi)->data))
+#define plugin_name(pi) (&((pi)->name))
+#define plugin_state(pi) ((pi)->state)
+#define plugin_equals(p1,p2) ((p1) == (p2))
+#else
+typedef struct st_plugin_int **plugin_ref;
+#define plugin_decl(pi) ((pi)[0]->plugin)
+#define plugin_dlib(pi) ((pi)[0]->plugin_dl)
+#define plugin_data(pi,cast) ((cast)((pi)[0]->data))
+#define plugin_name(pi) (&((pi)[0]->name))
+#define plugin_state(pi) ((pi)[0]->state)
+#define plugin_equals(p1,p2) ((p1) && (p2) && (p1)[0] == (p2)[0])
+#endif
+
typedef int (*plugin_type_init)(struct st_plugin_int *);
+extern char *opt_plugin_load;
extern char *opt_plugin_dir_ptr;
extern char opt_plugin_dir[FN_REFLEN];
extern const LEX_STRING plugin_type_names[];
-extern int plugin_init(int);
+
+extern int plugin_init(int *argc, char **argv, int init_flags);
extern void plugin_shutdown(void);
-extern my_bool plugin_is_ready(const LEX_STRING *name, int type);
-extern st_plugin_int *plugin_lock(const LEX_STRING *name, int type);
-extern void plugin_unlock(struct st_plugin_int *plugin);
-extern my_bool mysql_install_plugin(THD *thd, const LEX_STRING *name, const LEX_STRING *dl);
-extern my_bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name);
+extern void my_print_help_inc_plugins(struct my_option *options, uint size);
+extern bool plugin_is_ready(const LEX_STRING *name, int type);
+#define my_plugin_lock_by_name(A,B,C) plugin_lock_by_name(A,B,C CALLER_INFO)
+#define my_plugin_lock_by_name_ci(A,B,C) plugin_lock_by_name(A,B,C ORIG_CALLER_INFO)
+#define my_plugin_lock(A,B) plugin_lock(A,B CALLER_INFO)
+#define my_plugin_lock_ci(A,B) plugin_lock(A,B ORIG_CALLER_INFO)
+extern plugin_ref plugin_lock(THD *thd, plugin_ref *ptr CALLER_INFO_PROTO);
+extern plugin_ref plugin_lock_by_name(THD *thd, const LEX_STRING *name,
+ int type CALLER_INFO_PROTO);
+extern void plugin_unlock(THD *thd, plugin_ref plugin);
+extern void plugin_unlock_list(THD *thd, plugin_ref *list, uint count);
+extern bool mysql_install_plugin(THD *thd, const LEX_STRING *name,
+ const LEX_STRING *dl);
+extern bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name);
+extern bool plugin_register_builtin(struct st_mysql_plugin *plugin);
+extern void plugin_thdvar_init(THD *thd);
+extern void plugin_thdvar_cleanup(THD *thd);
typedef my_bool (plugin_foreach_func)(THD *thd,
- st_plugin_int *plugin,
+ plugin_ref plugin,
void *arg);
#define plugin_foreach(A,B,C,D) plugin_foreach_with_mask(A,B,C,PLUGIN_IS_READY,D)
-extern my_bool plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func,
- int type, uint state_mask, void *arg);
+extern bool plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func,
+ int type, uint state_mask, void *arg);
#endif
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index e493ded0b8a..65adf57bb02 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -112,7 +112,6 @@ public:
/****************************************************************************/
/**
- @class Prepared_statement
@brief Prepared_statement: a statement that can contain placeholders
*/
@@ -229,7 +228,7 @@ find_prepared_statement(THD *thd, ulong id, const char *where)
static bool send_prep_stmt(Prepared_statement *stmt, uint columns)
{
NET *net= &stmt->thd->net;
- char buff[12];
+ uchar buff[12];
uint tmp;
DBUG_ENTER("send_prep_stmt");
@@ -572,6 +571,8 @@ void set_param_date(Item_param *param, uchar **pos, ulong len)
static void set_param_str(Item_param *param, uchar **pos, ulong len)
{
ulong length= get_param_length(pos, len);
+ if (length > len)
+ length= len;
param->set_str((const char *)*pos, length);
*pos+= length;
}
@@ -742,6 +743,8 @@ static bool insert_params_with_log(Prepared_statement *stmt, uchar *null_array,
if (read_pos >= data_end)
DBUG_RETURN(1);
param->set_param_func(param, &read_pos, data_end - read_pos);
+ if (param->state == Item_param::NO_VALUE)
+ DBUG_RETURN(1);
}
}
res= param->query_val_str(&str);
@@ -778,6 +781,8 @@ static bool insert_params(Prepared_statement *stmt, uchar *null_array,
if (read_pos >= data_end)
DBUG_RETURN(1);
param->set_param_func(param, &read_pos, data_end - read_pos);
+ if (param->state == Item_param::NO_VALUE)
+ DBUG_RETURN(1);
}
}
if (param->convert_str_value(stmt->thd))
@@ -860,6 +865,8 @@ static bool emb_insert_params(Prepared_statement *stmt, String *expanded_query)
client_param->length ?
*client_param->length :
client_param->buffer_length);
+ if (param->state == Item_param::NO_VALUE)
+ DBUG_RETURN(1);
}
}
if (param->convert_str_value(thd))
@@ -902,6 +909,8 @@ static bool emb_insert_params_with_log(Prepared_statement *stmt,
client_param->length ?
*client_param->length :
client_param->buffer_length);
+ if (param->state == Item_param::NO_VALUE)
+ DBUG_RETURN(1);
}
}
res= param->query_val_str(&str);
@@ -946,7 +955,7 @@ 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,
- (byte*) varname->str,
+ (uchar*) varname->str,
varname->length);
if (param->set_from_user_var(stmt->thd, entry) ||
param->convert_str_value(stmt->thd))
@@ -981,6 +990,7 @@ static bool insert_params_from_vars_with_log(Prepared_statement *stmt,
String buf;
const String *val;
uint32 length= 0;
+ THD *thd= stmt->thd;
DBUG_ENTER("insert_params_from_vars");
@@ -991,34 +1001,20 @@ static bool insert_params_from_vars_with_log(Prepared_statement *stmt,
{
Item_param *param= *it;
varname= var_it++;
- if (get_var_with_binlog(stmt->thd, stmt->lex->sql_command,
- *varname, &entry))
- DBUG_RETURN(1);
- if (param->set_from_user_var(stmt->thd, entry))
+ entry= (user_var_entry *) 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
+ (e.g. value.cs_info.character_set_client is used in the query_val_str()).
+ */
+ setup_one_conversion_function(thd, param, param->param_type);
+ if (param->set_from_user_var(thd, entry))
DBUG_RETURN(1);
- /* Insert @'escaped-varname' instead of parameter in the query */
- if (entry)
- {
- char *start, *ptr;
- buf.length(0);
- if (buf.reserve(entry->name.length*2+3))
- DBUG_RETURN(1);
-
- start= ptr= buf.c_ptr_quick();
- *ptr++= '@';
- *ptr++= '\'';
- ptr+= escape_string_for_mysql(&my_charset_utf8_general_ci,
- ptr, 0, entry->name.str,
- entry->name.length);
- *ptr++= '\'';
- buf.length(ptr - start);
- val= &buf;
- }
- else
- val= &my_null_string;
+ val= param->query_val_str(&buf);
- if (param->convert_str_value(stmt->thd))
+ if (param->convert_str_value(thd))
DBUG_RETURN(1); /* out of memory */
if (query->replace(param->pos_in_query+length, 1, *val))
@@ -1077,7 +1073,7 @@ static bool mysql_test_insert(Prepared_statement *stmt,
if (table_list->table)
{
// don't allocate insert_values
- table_list->table->insert_values=(byte *)1;
+ table_list->table->insert_values=(uchar *)1;
}
if (mysql_prepare_insert(thd, table_list, table_list->table,
@@ -1164,8 +1160,9 @@ static int mysql_test_update(Prepared_statement *stmt,
goto error;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
- /* TABLE_LIST contain right privilages request */
- want_privilege= table_list->grant.want_privilege;
+ /* Force privilege re-checking for views after they have been opened. */
+ want_privilege= (table_list->view ? UPDATE_ACL :
+ table_list->grant.want_privilege);
#endif
if (mysql_prepare_update(thd, table_list, &select->where,
@@ -1492,8 +1489,21 @@ static bool mysql_test_create_table(Prepared_statement *stmt)
if (select_lex->item_list.elements)
{
+ if (!(lex->create_info.options & HA_LEX_CREATE_TMP_TABLE))
+ {
+ lex->link_first_table_back(create_table, link_to_local);
+ create_table->create= TRUE;
+ }
+
+ if (open_normal_and_derived_tables(stmt->thd, lex->query_tables, 0))
+ DBUG_RETURN(TRUE);
+
+ if (!(lex->create_info.options & HA_LEX_CREATE_TMP_TABLE))
+ create_table= lex->unlink_first_table(&link_to_local);
+
select_lex->context.resolve_in_select_list= TRUE;
- res= select_like_stmt_test_with_open(stmt, tables, 0, 0);
+
+ res= select_like_stmt_test(stmt, 0, 0);
}
/* put tables back for PS rexecuting */
@@ -1590,7 +1600,7 @@ static bool mysql_insert_select_prepare_tester(THD *thd)
next_local;
/* Skip first table, which is the table we are inserting in */
- first_select->table_list.first= (byte *) second_table;
+ first_select->table_list.first= (uchar *) second_table;
thd->lex->select_lex.context.table_list=
thd->lex->select_lex.context.first_name_resolution_table= second_table;
@@ -1621,7 +1631,7 @@ static bool mysql_test_insert_select(Prepared_statement *stmt,
if (tables->table)
{
// don't allocate insert_values
- tables->table->insert_values=(byte *)1;
+ tables->table->insert_values=(uchar *)1;
}
if (insert_precheck(stmt->thd, tables))
@@ -1636,7 +1646,7 @@ static bool mysql_test_insert_select(Prepared_statement *stmt,
&mysql_insert_select_prepare_tester,
OPTION_SETUP_TABLES_DONE);
/* revert changes made by mysql_insert_select_prepare_tester */
- lex->select_lex.table_list.first= (byte*) first_local_table;
+ lex->select_lex.table_list.first= (uchar*) first_local_table;
return res;
}
@@ -1715,6 +1725,13 @@ static bool check_prepared_statement(Prepared_statement *stmt,
res= mysql_test_create_table(stmt);
break;
+ case SQLCOM_CREATE_VIEW:
+ if (lex->create_view_mode == VIEW_ALTER)
+ {
+ my_message(ER_UNSUPPORTED_PS, ER(ER_UNSUPPORTED_PS), MYF(0));
+ goto error;
+ }
+ break;
case SQLCOM_DO:
res= mysql_test_do_fields(stmt, tables, lex->insert_list);
break;
@@ -1751,6 +1768,7 @@ static bool check_prepared_statement(Prepared_statement *stmt,
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:
@@ -1768,7 +1786,6 @@ static bool check_prepared_statement(Prepared_statement *stmt,
case SQLCOM_ROLLBACK:
case SQLCOM_TRUNCATE:
case SQLCOM_CALL:
- case SQLCOM_CREATE_VIEW:
case SQLCOM_DROP_VIEW:
case SQLCOM_REPAIR:
case SQLCOM_ANALYZE:
@@ -1794,6 +1811,9 @@ static bool check_prepared_statement(Prepared_statement *stmt,
case SQLCOM_KILL:
break;
+ case SQLCOM_PREPARE:
+ case SQLCOM_EXECUTE:
+ case SQLCOM_DEALLOCATE_PREPARE:
default:
/*
Trivial check of all status commands. This is easier than having
@@ -1920,13 +1940,6 @@ void mysql_stmt_prepare(THD *thd, const char *packet, uint packet_length)
/* Statement map deletes statement on erase */
thd->stmt_map.erase(stmt);
}
- else
- {
- const char *format= "[%lu] %.*b";
- general_log_print(thd, COM_STMT_PREPARE, format, stmt->id,
- stmt->query_length, stmt->query);
-
- }
/* check_prepared_statemnt sends the metadata packet in case of success */
DBUG_VOID_RETURN;
}
@@ -1970,7 +1983,7 @@ static const char *get_dynamic_sql_string(LEX *lex, uint *query_len)
*/
if ((entry=
(user_var_entry*)hash_search(&thd->user_vars,
- (byte*)lex->prepared_stmt_code.str,
+ (uchar*)lex->prepared_stmt_code.str,
lex->prepared_stmt_code.length))
&& entry->value)
{
@@ -1999,7 +2012,7 @@ static const char *get_dynamic_sql_string(LEX *lex, uint *query_len)
len= (needs_conversion ? var_value->length() * to_cs->mbmaxlen :
var_value->length());
- if (!(query_str= alloc_root(thd->mem_root, len+1)))
+ if (!(query_str= (char*) alloc_root(thd->mem_root, len+1)))
goto end;
if (needs_conversion)
@@ -2312,12 +2325,6 @@ void mysql_stmt_execute(THD *thd, char *packet_arg, uint packet_length)
test(flags & (ulong) CURSOR_TYPE_READ_ONLY));
if (!(specialflag & SPECIAL_NO_PRIOR))
my_pthread_setprio(pthread_self(), WAIT_PRIOR);
- if (error == 0)
- {
- const char *format= "[%lu] %.*b";
- general_log_print(thd, COM_STMT_EXECUTE, format, stmt->id,
- thd->query_length, thd->query);
- }
DBUG_VOID_RETURN;
set_params_data_err:
@@ -2355,7 +2362,7 @@ void mysql_sql_stmt_execute(THD *thd)
/* Query text for binary, general or slow log, if any of them is open */
String expanded_query;
DBUG_ENTER("mysql_sql_stmt_execute");
- DBUG_PRINT("info", ("EXECUTE: %.*s\n", name->length, name->str));
+ DBUG_PRINT("info", ("EXECUTE: %.*s\n", (int) name->length, name->str));
if (!(stmt= (Prepared_statement*) thd->stmt_map.find_by_name(name)))
{
@@ -2416,7 +2423,7 @@ void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length)
/* First of all clear possible warnings from the previous command */
mysql_reset_thd_for_next_command(thd);
- statistic_increment(thd->status_var.com_stmt_fetch, &LOCK_status);
+ status_var_increment(thd->status_var.com_stmt_fetch);
if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_fetch")))
DBUG_VOID_RETURN;
@@ -2480,7 +2487,7 @@ void mysql_stmt_reset(THD *thd, char *packet)
/* First of all clear possible warnings from the previous command */
mysql_reset_thd_for_next_command(thd);
- statistic_increment(thd->status_var.com_stmt_reset, &LOCK_status);
+ status_var_increment(thd->status_var.com_stmt_reset);
if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_reset")))
DBUG_VOID_RETURN;
@@ -2543,7 +2550,8 @@ void mysql_sql_stmt_close(THD *thd)
{
Prepared_statement* stmt;
LEX_STRING *name= &thd->lex->prepared_stmt_name;
- DBUG_PRINT("info", ("DEALLOCATE PREPARE: %.*s\n", name->length, name->str));
+ DBUG_PRINT("info", ("DEALLOCATE PREPARE: %.*s\n", (int) name->length,
+ name->str));
if (! (stmt= (Prepared_statement*) thd->stmt_map.find_by_name(name)))
{
@@ -2584,7 +2592,7 @@ void mysql_stmt_get_longdata(THD *thd, char *packet, ulong packet_length)
#endif
DBUG_ENTER("mysql_stmt_get_longdata");
- statistic_increment(thd->status_var.com_stmt_send_long_data, &LOCK_status);
+ status_var_increment(thd->status_var.com_stmt_send_long_data);
#ifndef EMBEDDED_LIBRARY
/* Minimal size of long data packet is 6 bytes */
if (packet_length <= MYSQL_LONG_DATA_HEADER)
@@ -2788,7 +2796,7 @@ void Prepared_statement::cleanup_stmt()
bool Prepared_statement::set_name(LEX_STRING *name_arg)
{
name.length= name_arg->length;
- name.str= memdup_root(mem_root, (char*) name_arg->str, name_arg->length);
+ name.str= (char*) memdup_root(mem_root, name_arg->str, name_arg->length);
return name.str == 0;
}
@@ -2835,7 +2843,7 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
However, it seems handy if com_stmt_prepare is increased always,
no matter what kind of prepare is processed.
*/
- statistic_increment(thd->status_var.com_stmt_prepare, &LOCK_status);
+ status_var_increment(thd->status_var.com_stmt_prepare);
/*
alloc_query() uses thd->memroot && thd->query, so we should call
@@ -2853,11 +2861,28 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
old_stmt_arena= thd->stmt_arena;
thd->stmt_arena= this;
- lex_start(thd, thd->query, thd->query_length);
- lex->stmt_prepare_mode= TRUE;
- error= MYSQLparse((void *)thd) || thd->is_fatal_error ||
- thd->net.report_error || init_param_array(this);
+ Lex_input_stream lip(thd, thd->query, thd->query_length);
+ lip.stmt_prepare_mode= TRUE;
+ lex_start(thd);
+
+ error= parse_sql(thd, &lip, NULL) ||
+ thd->net.report_error ||
+ init_param_array(this);
+ lex->set_trg_event_type_for_tables();
+
+ /* Remember the current database. */
+
+ if (thd->db && thd->db_length)
+ {
+ db= this->strmake(thd->db, thd->db_length);
+ db_length= thd->db_length;
+ }
+ else
+ {
+ db= NULL;
+ db_length= 0;
+ }
/*
While doing context analysis of the query (in check_prepared_statement)
@@ -2901,24 +2926,35 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
thd->restore_backup_statement(this, &stmt_backup);
thd->stmt_arena= old_stmt_arena;
- if ((protocol->type() == Protocol::PROTOCOL_TEXT) && (param_count > 0))
- {
- /*
- This is a mysql_sql_stmt_prepare(); query expansion will insert user
- variable references, and user variables are uncacheable, thus we have to
- mark this statement as uncacheable.
- This has to be done before setup_set_params(), as it may make expansion
- unneeded.
- */
- lex->safe_to_cache_query= FALSE;
- }
-
if (error == 0)
{
setup_set_params();
init_stmt_after_parse(lex);
state= Query_arena::PREPARED;
flags&= ~ (uint) IS_IN_USE;
+
+ /*
+ Log COM_EXECUTE to the general log. Note, that in case of SQL
+ prepared statements this causes two records to be output:
+
+ Query PREPARE stmt from @user_variable
+ Prepare <statement SQL text>
+
+ This is considered user-friendly, since in the
+ second log entry we output the actual statement text.
+
+ Do not print anything if this is an SQL prepared statement and
+ we're inside a stored procedure (also called Dynamic SQL) --
+ sub-statements inside stored procedures are not logged into
+ the general log.
+ */
+ if (thd->spcont == NULL)
+ {
+ const char *format= "[%lu] %.*b";
+ general_log_print(thd, COM_STMT_PREPARE, format, id,
+ query_length, query);
+
+ }
}
DBUG_RETURN(error);
}
@@ -2954,7 +2990,14 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
Query_arena *old_stmt_arena;
bool error= TRUE;
- statistic_increment(thd->status_var.com_stmt_execute, &LOCK_status);
+ char saved_cur_db_name_buf[NAME_LEN+1];
+ LEX_STRING saved_cur_db_name=
+ { saved_cur_db_name_buf, sizeof(saved_cur_db_name_buf) };
+ bool cur_db_changed;
+
+ LEX_STRING stmt_db_name= { db, db_length };
+
+ status_var_increment(thd->status_var.com_stmt_execute);
/* Check if we got an error when sending long data */
if (state == Query_arena::ERROR)
@@ -3002,6 +3045,21 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
*/
thd->set_n_backup_statement(this, &stmt_backup);
+
+ /*
+ Change the current database (if needed).
+
+ Force switching, because the database of the prepared statement may be
+ NULL (prepared statements can be created while no current database
+ selected).
+ */
+
+ if (mysql_opt_change_db(thd, &stmt_db_name, &saved_cur_db_name, TRUE,
+ &cur_db_changed))
+ goto error;
+
+ /* Allocate query. */
+
if (expanded_query->length() &&
alloc_query(thd, (char*) expanded_query->ptr(),
expanded_query->length()+1))
@@ -3030,6 +3088,8 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
thd->protocol= protocol; /* activate stmt protocol */
+ /* Go! */
+
if (open_cursor)
error= mysql_open_cursor(thd, (uint) ALWAYS_MATERIALIZED_CURSOR,
&result, &cursor);
@@ -3048,6 +3108,17 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
}
}
+ /*
+ Restore the current database (if changed).
+
+ Force switching back to the saved current database (if changed),
+ because it may be NULL. In this case, mysql_change_db() would generate
+ an error.
+ */
+
+ if (cur_db_changed)
+ mysql_change_db(thd, &saved_cur_db_name, TRUE);
+
thd->protocol= &thd->protocol_text; /* use normal protocol */
/* Assert that if an error, no cursor is open */
@@ -3065,6 +3136,28 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
if (state == Query_arena::PREPARED)
state= Query_arena::EXECUTED;
+ /*
+ Log COM_EXECUTE to the general log. Note, that in case of SQL
+ prepared statements this causes two records to be output:
+
+ Query EXECUTE <statement name>
+ Execute <statement SQL text>
+
+ This is considered user-friendly, since in the
+ second log entry we output values of parameter markers.
+
+ Do not print anything if this is an SQL prepared statement and
+ we're inside a stored procedure (also called Dynamic SQL) --
+ sub-statements inside stored procedures are not logged into
+ the general log.
+ */
+ if (error == 0 && thd->spcont == NULL)
+ {
+ const char *format= "[%lu] %.*b";
+ general_log_print(thd, COM_STMT_EXECUTE, format, id,
+ thd->query_length, thd->query);
+ }
+
error:
flags&= ~ (uint) IS_IN_USE;
return error;
@@ -3076,7 +3169,7 @@ error:
bool Prepared_statement::deallocate()
{
/* We account deallocate in the same manner as mysql_stmt_close */
- statistic_increment(thd->status_var.com_stmt_close, &LOCK_status);
+ status_var_increment(thd->status_var.com_stmt_close);
if (flags & (uint) IS_IN_USE)
{
my_error(ER_PS_NO_RECURSION, MYF(0));
diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc
index f34ec83b29c..750bcd50479 100644
--- a/sql/sql_rename.cc
+++ b/sql/sql_rename.cc
@@ -37,7 +37,6 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent)
TABLE_LIST *ren_table= 0;
int to_table;
char *rename_log_table[2]= {NULL, NULL};
- int disable_logs= 0;
DBUG_ENTER("mysql_rename_tables");
/*
@@ -80,12 +79,6 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent)
ren_table->table_name, 1)))
{
/*
- Log table encoutered we will need to disable and lock logs
- for duration of rename.
- */
- disable_logs= TRUE;
-
- /*
as we use log_table_rename as an array index, we need it to start
with 0, while QUERY_LOG_SLOW == 1 and QUERY_LOG_GENERAL == 2.
So, we shift the value to start with 0;
@@ -136,18 +129,15 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent)
rename_log_table[1]);
DBUG_RETURN(1);
}
-
- if (disable_logs)
- {
- logger.lock();
- logger.tmp_close_log_tables(thd);
- }
}
- VOID(pthread_mutex_lock(&LOCK_open));
- if (lock_table_names(thd, table_list))
+ pthread_mutex_lock(&LOCK_open);
+ if (lock_table_names_exclusively(thd, table_list))
+ {
+ pthread_mutex_unlock(&LOCK_open);
goto err;
-
+ }
+
error=0;
if ((ren_table=rename_tables(thd,table_list,0)))
{
@@ -170,30 +160,33 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent)
error= 1;
}
+ /*
+ An exclusive lock on table names is satisfactory to ensure
+ no other thread accesses this table.
+ However, NDB assumes that handler::rename_tables is called under
+ LOCK_open. And it indeed is, from ALTER TABLE.
+ TODO: remove this limitation.
+ We still should unlock LOCK_open as early as possible, to provide
+ higher concurrency - query_cache_invalidate can take minutes to
+ complete.
+ */
+ pthread_mutex_unlock(&LOCK_open);
/* Lets hope this doesn't fail as the result will be messy */
if (!silent && !error)
{
- if (mysql_bin_log.is_open())
- {
- thd->clear_error();
- thd->binlog_query(THD::STMT_QUERY_TYPE,
- thd->query, thd->query_length, FALSE, FALSE);
- }
+ write_bin_log(thd, TRUE, thd->query, thd->query_length);
send_ok(thd);
}
+ if (!error)
+ query_cache_invalidate3(thd, table_list, 0);
+
+ pthread_mutex_lock(&LOCK_open);
unlock_table_names(thd, table_list, (TABLE_LIST*) 0);
+ pthread_mutex_unlock(&LOCK_open);
err:
- pthread_mutex_unlock(&LOCK_open);
- /* enable logging back if needed */
- if (disable_logs)
- {
- if (logger.reopen_log_tables())
- error= TRUE;
- logger.unlock();
- }
start_waiting_global_read_lock(thd);
DBUG_RETURN(error);
}
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 99e969f9427..5eb9c61de64 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -72,7 +72,7 @@ static int fake_rotate_event(NET* net, String* packet, char* log_file_name,
int8store(buf+R_POS_OFFSET,position);
packet->append(buf, ROTATE_HEADER_LEN);
packet->append(p,ident_len);
- if (my_net_write(net, (char*)packet->ptr(), packet->length()))
+ if (my_net_write(net, (uchar*) packet->ptr(), packet->length()))
{
*errmsg = "failed on my_net_write()";
DBUG_RETURN(-1);
@@ -83,12 +83,13 @@ static int fake_rotate_event(NET* net, String* packet, char* log_file_name,
static int send_file(THD *thd)
{
NET* net = &thd->net;
- int fd = -1,bytes, error = 1;
+ int fd = -1, error = 1;
+ size_t bytes;
char fname[FN_REFLEN+1];
const char *errmsg = 0;
int old_timeout;
unsigned long packet_len;
- char buf[IO_SIZE]; // It's safe to alloc this
+ uchar buf[IO_SIZE]; // It's safe to alloc this
DBUG_ENTER("send_file");
/*
@@ -96,7 +97,7 @@ static int send_file(THD *thd)
the job
*/
old_timeout= net->read_timeout;
- net_set_read_timeout(net, thd->variables.net_wait_timeout);
+ my_net_set_read_timeout(net, thd->variables.net_wait_timeout);
/*
We need net_flush here because the client will not know it needs to send
@@ -121,7 +122,7 @@ static int send_file(THD *thd)
goto err;
}
- while ((bytes = (int) my_read(fd, (byte*) buf, IO_SIZE, MYF(0))) > 0)
+ while ((long) (bytes= my_read(fd, buf, IO_SIZE, MYF(0))) > 0)
{
if (my_net_write(net, buf, bytes))
{
@@ -131,7 +132,7 @@ static int send_file(THD *thd)
}
end:
- if (my_net_write(net, "", 0) || net_flush(net) ||
+ if (my_net_write(net, (uchar*) "", 0) || net_flush(net) ||
(my_net_read(net) == packet_error))
{
errmsg = "while negotiating file transfer close";
@@ -140,7 +141,7 @@ static int send_file(THD *thd)
error = 0;
err:
- net_set_read_timeout(net, old_timeout);
+ my_net_set_read_timeout(net, old_timeout);
if (fd >= 0)
(void) my_close(fd, MYF(0));
if (errmsg)
@@ -217,7 +218,8 @@ bool log_in_use(const char* log_name)
if ((linfo = tmp->current_linfo))
{
pthread_mutex_lock(&linfo->lock);
- result = !bcmp(log_name, linfo->log_file_name, log_name_len);
+ result = !bcmp((uchar*) log_name, (uchar*) linfo->log_file_name,
+ log_name_len);
pthread_mutex_unlock(&linfo->lock);
if (result)
break;
@@ -480,7 +482,7 @@ impossible position";
int4store((char*) packet->ptr()+LOG_EVENT_MINIMAL_HEADER_LEN+
ST_CREATED_OFFSET+1, (ulong) 0);
/* send it */
- if (my_net_write(net, (char*)packet->ptr(), packet->length()))
+ if (my_net_write(net, (uchar*) packet->ptr(), packet->length()))
{
errmsg = "Failed on my_net_write()";
my_errno= ER_UNKNOWN_ERROR;
@@ -538,7 +540,7 @@ impossible position";
else if ((*packet)[EVENT_TYPE_OFFSET+1] == STOP_EVENT)
binlog_can_be_corrupted= FALSE;
- if (my_net_write(net, (char*)packet->ptr(), packet->length()))
+ if (my_net_write(net, (uchar*) packet->ptr(), packet->length()))
{
errmsg = "Failed on my_net_write()";
my_errno= ER_UNKNOWN_ERROR;
@@ -651,7 +653,7 @@ impossible position";
if (read_packet)
{
thd_proc_info(thd, "Sending binlog event to slave");
- if (my_net_write(net, (char*)packet->ptr(), packet->length()) )
+ if (my_net_write(net, (uchar*) packet->ptr(), packet->length()) )
{
errmsg = "Failed on my_net_write()";
my_errno= ER_UNKNOWN_ERROR;
@@ -760,7 +762,7 @@ err:
DBUG_VOID_RETURN;
}
-int start_slave(THD* thd , MASTER_INFO* mi, bool net_report)
+int start_slave(THD* thd , Master_info* mi, bool net_report)
{
int slave_errno= 0;
int thread_mask;
@@ -797,7 +799,7 @@ int start_slave(THD* thd , MASTER_INFO* mi, bool net_report)
if (thd->lex->mi.pos)
{
- mi->rli.until_condition= RELAY_LOG_INFO::UNTIL_MASTER_POS;
+ mi->rli.until_condition= Relay_log_info::UNTIL_MASTER_POS;
mi->rli.until_log_pos= thd->lex->mi.pos;
/*
We don't check thd->lex->mi.log_file_name for NULL here
@@ -808,7 +810,7 @@ int start_slave(THD* thd , MASTER_INFO* mi, bool net_report)
}
else if (thd->lex->mi.relay_log_pos)
{
- mi->rli.until_condition= RELAY_LOG_INFO::UNTIL_RELAY_POS;
+ mi->rli.until_condition= Relay_log_info::UNTIL_RELAY_POS;
mi->rli.until_log_pos= thd->lex->mi.relay_log_pos;
strmake(mi->rli.until_log_name, thd->lex->mi.relay_log_name,
sizeof(mi->rli.until_log_name)-1);
@@ -816,7 +818,7 @@ int start_slave(THD* thd , MASTER_INFO* mi, bool net_report)
else
mi->rli.clear_until_condition();
- if (mi->rli.until_condition != RELAY_LOG_INFO::UNTIL_NONE)
+ if (mi->rli.until_condition != Relay_log_info::UNTIL_NONE)
{
/* Preparing members for effective until condition checking */
const char *p= fn_ext(mi->rli.until_log_name);
@@ -838,7 +840,7 @@ int start_slave(THD* thd , MASTER_INFO* mi, bool net_report)
/* mark the cached result of the UNTIL comparison as "undefined" */
mi->rli.until_log_names_cmp_result=
- RELAY_LOG_INFO::UNTIL_LOG_NAMES_CMP_UNKNOWN;
+ Relay_log_info::UNTIL_LOG_NAMES_CMP_UNKNOWN;
/* Issuing warning then started without --skip-slave-start */
if (!opt_skip_slave_start)
@@ -885,7 +887,7 @@ int start_slave(THD* thd , MASTER_INFO* mi, bool net_report)
}
-int stop_slave(THD* thd, MASTER_INFO* mi, bool net_report )
+int stop_slave(THD* thd, Master_info* mi, bool net_report )
{
DBUG_ENTER("stop_slave");
@@ -951,7 +953,7 @@ int stop_slave(THD* thd, MASTER_INFO* mi, bool net_report )
*/
-int reset_slave(THD *thd, MASTER_INFO* mi)
+int reset_slave(THD *thd, Master_info* mi)
{
MY_STAT stat_area;
char fname[FN_REFLEN];
@@ -989,7 +991,7 @@ int reset_slave(THD *thd, MASTER_INFO* mi)
Reset errors (the idea is that we forget about the
old master).
*/
- mi->rli.clear_slave_error();
+ mi->rli.clear_error();
mi->rli.clear_until_condition();
// close master_info_file, relay_log_info_file, set mi->inited=rli->inited=0
@@ -1065,7 +1067,7 @@ void kill_zombie_dump_threads(uint32 slave_server_id)
}
-bool change_master(THD* thd, MASTER_INFO* mi)
+bool change_master(THD* thd, Master_info* mi)
{
int thread_mask;
const char* errmsg= 0;
@@ -1261,7 +1263,7 @@ bool change_master(THD* thd, MASTER_INFO* mi)
pthread_mutex_lock(&mi->rli.data_lock);
mi->rli.abort_pos_wait++; /* for MASTER_POS_WAIT() to abort */
/* Clear the errors, for a clean start */
- mi->rli.clear_slave_error();
+ mi->rli.clear_error();
mi->rli.clear_until_condition();
/*
If we don't write new coordinates to disk now, then old will remain in
@@ -1440,13 +1442,11 @@ err:
}
if (errmsg)
- {
my_error(ER_ERROR_WHEN_EXECUTING_COMMAND, MYF(0),
"SHOW BINLOG EVENTS", errmsg);
- DBUG_RETURN(TRUE);
- }
+ else
+ send_eof(thd);
- send_eof(thd);
pthread_mutex_lock(&LOCK_thread_count);
thd->current_linfo = 0;
pthread_mutex_unlock(&LOCK_thread_count);
@@ -1607,6 +1607,149 @@ int log_loaded_block(IO_CACHE* file)
return 0;
}
+/*
+ Replication System Variables
+*/
+
+class sys_var_slave_skip_counter :public sys_var
+{
+public:
+ sys_var_slave_skip_counter(sys_var_chain *chain, const char *name_arg)
+ :sys_var(name_arg)
+ { chain_sys_var(chain); }
+ bool check(THD *thd, set_var *var);
+ bool update(THD *thd, set_var *var);
+ bool check_type(enum_var_type type) { return type != OPT_GLOBAL; }
+ /*
+ We can't retrieve the value of this, so we don't have to define
+ type() or value_ptr()
+ */
+};
+
+class sys_var_sync_binlog_period :public sys_var_long_ptr
+{
+public:
+ sys_var_sync_binlog_period(sys_var_chain *chain, const char *name_arg,
+ ulong *value_ptr)
+ :sys_var_long_ptr(chain, name_arg,value_ptr) {}
+ bool update(THD *thd, set_var *var);
+};
+
+static sys_var_chain vars = { NULL, NULL };
+
+static sys_var_bool_ptr sys_relay_log_purge(&vars, "relay_log_purge",
+ &relay_log_purge);
+static sys_var_long_ptr sys_slave_net_timeout(&vars, "slave_net_timeout",
+ &slave_net_timeout);
+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");
+
+static int show_slave_skip_errors(THD *thd, SHOW_VAR *var, char *buff);
+
+
+static SHOW_VAR fixed_vars[]= {
+ {"log_slave_updates", (char*) &opt_log_slave_updates, SHOW_MY_BOOL},
+ {"relay_log_space_limit", (char*) &relay_log_space_limit, SHOW_LONGLONG},
+ {"slave_load_tmpdir", (char*) &slave_load_tmpdir, SHOW_CHAR_PTR},
+ {"slave_skip_errors", (char*) &show_slave_skip_errors, SHOW_FUNC},
+};
+
+static int show_slave_skip_errors(THD *thd, SHOW_VAR *var, char *buff)
+{
+ var->type=SHOW_CHAR;
+ var->value= buff;
+ if (!use_slave_mask || bitmap_is_clear_all(&slave_error_mask))
+ {
+ var->value= const_cast<char *>("OFF");
+ }
+ else if (bitmap_is_set_all(&slave_error_mask))
+ {
+ var->value= const_cast<char *>("ALL");
+ }
+ else
+ {
+ /* 10 is enough assuming errors are max 4 digits */
+ int i;
+ var->value= buff;
+ for (i= 1;
+ i < MAX_SLAVE_ERROR &&
+ (buff - var->value) < SHOW_VAR_FUNC_BUFF_SIZE;
+ i++)
+ {
+ if (bitmap_is_set(&slave_error_mask, i))
+ {
+ buff= int10_to_str(i, buff, 10);
+ *buff++= ',';
+ }
+ }
+ if (var->value != buff)
+ buff--; // Remove last ','
+ if (i < MAX_SLAVE_ERROR)
+ buff= strmov(buff, "..."); // Couldn't show all errors
+ *buff=0;
+ }
+ return 0;
+}
+
+bool sys_var_slave_skip_counter::check(THD *thd, set_var *var)
+{
+ int result= 0;
+ pthread_mutex_lock(&LOCK_active_mi);
+ pthread_mutex_lock(&active_mi->rli.run_lock);
+ if (active_mi->rli.slave_running)
+ {
+ my_message(ER_SLAVE_MUST_STOP, ER(ER_SLAVE_MUST_STOP), MYF(0));
+ result=1;
+ }
+ pthread_mutex_unlock(&active_mi->rli.run_lock);
+ pthread_mutex_unlock(&LOCK_active_mi);
+ var->save_result.ulong_value= (ulong) var->value->val_int();
+ return result;
+}
+
+
+bool sys_var_slave_skip_counter::update(THD *thd, set_var *var)
+{
+ pthread_mutex_lock(&LOCK_active_mi);
+ pthread_mutex_lock(&active_mi->rli.run_lock);
+ /*
+ The following test should normally never be true as we test this
+ in the check function; To be safe against multiple
+ SQL_SLAVE_SKIP_COUNTER request, we do the check anyway
+ */
+ if (!active_mi->rli.slave_running)
+ {
+ pthread_mutex_lock(&active_mi->rli.data_lock);
+ active_mi->rli.slave_skip_counter= var->save_result.ulong_value;
+ pthread_mutex_unlock(&active_mi->rli.data_lock);
+ }
+ pthread_mutex_unlock(&active_mi->rli.run_lock);
+ pthread_mutex_unlock(&LOCK_active_mi);
+ return 0;
+}
+
+
+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()
+{
+ mysql_append_static_vars(fixed_vars, sizeof(fixed_vars) / sizeof(SHOW_VAR));
+
+ if (mysql_add_sys_var_chain(vars.first, my_long_options))
+ {
+ /* should not happen */
+ fprintf(stderr, "failed to initialize replication system variables");
+ unireg_abort(1);
+ }
+ return 0;
+}
+
#endif /* HAVE_REPLICATION */
diff --git a/sql/sql_repl.h b/sql/sql_repl.h
index b106391245d..cf5201f17b1 100644
--- a/sql/sql_repl.h
+++ b/sql/sql_repl.h
@@ -42,20 +42,20 @@ extern my_bool opt_sporadic_binlog_dump_fail;
pthread_mutex_unlock(&(thd)->LOCK_delete); \
} while(0)
-int start_slave(THD* thd, MASTER_INFO* mi, bool net_report);
-int stop_slave(THD* thd, MASTER_INFO* mi, bool net_report);
-bool change_master(THD* thd, MASTER_INFO* mi);
+int start_slave(THD* thd, Master_info* mi, bool net_report);
+int stop_slave(THD* thd, Master_info* mi, bool net_report);
+bool change_master(THD* thd, Master_info* mi);
bool mysql_show_binlog_events(THD* thd);
int cmp_master_pos(const char* log_file_name1, ulonglong log_pos1,
const char* log_file_name2, ulonglong log_pos2);
-int reset_slave(THD *thd, MASTER_INFO* mi);
+int reset_slave(THD *thd, Master_info* mi);
int reset_master(THD* thd);
bool purge_master_logs(THD* thd, const char* to_log);
bool purge_master_logs_before_date(THD* thd, time_t purge_time);
bool log_in_use(const char* log_name);
void adjust_linfo_offsets(my_off_t purge_offset);
bool show_binlogs(THD* thd);
-extern int init_master_info(MASTER_INFO* mi);
+extern int init_master_info(Master_info* mi);
void kill_zombie_dump_threads(uint32 slave_server_id);
int check_binlog_magic(IO_CACHE* log, const char** errmsg);
@@ -67,6 +67,7 @@ typedef struct st_load_file_info
} LOAD_FILE_INFO;
int log_loaded_block(IO_CACHE* file);
+int init_replication_sys_vars();
#endif /* HAVE_REPLICATION */
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 21feecbc236..16597eaf78e 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -13,6 +13,10 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+/**
+ @defgroup Query_Optimizer Query Optimizer
+ @{
+*/
/* mysql_select and join optimization */
@@ -49,15 +53,15 @@ static int sort_keyuse(KEYUSE *a,KEYUSE *b);
static void set_position(JOIN *join,uint index,JOIN_TAB *table,KEYUSE *key);
static bool create_ref_for_key(JOIN *join, JOIN_TAB *j, KEYUSE *org_keyuse,
table_map used_tables);
-static void choose_plan(JOIN *join,table_map join_tables);
+static bool choose_plan(JOIN *join,table_map join_tables);
static void best_access_path(JOIN *join, JOIN_TAB *s, THD *thd,
table_map remaining_tables, uint idx,
double record_count, double read_time);
static void optimize_straight_join(JOIN *join, table_map join_tables);
-static void greedy_search(JOIN *join, table_map remaining_tables,
+static bool greedy_search(JOIN *join, table_map remaining_tables,
uint depth, uint prune_level);
-static void best_extension_by_limited_search(JOIN *join,
+static bool best_extension_by_limited_search(JOIN *join,
table_map remaining_tables,
uint idx, double record_count,
double read_time, uint depth,
@@ -69,14 +73,14 @@ static int join_tab_cmp_straight(const void* ptr1, const void* ptr2);
TODO: 'find_best' is here only temporarily until 'greedy_search' is
tested and approved.
*/
-static void find_best(JOIN *join,table_map rest_tables,uint index,
+static bool find_best(JOIN *join,table_map rest_tables,uint index,
double record_count,double read_time);
static uint cache_record_length(JOIN *join,uint index);
static double prev_record_reads(JOIN *join, uint idx, table_map found_ref);
static bool get_best_combination(JOIN *join);
static store_key *get_store_key(THD *thd,
KEYUSE *keyuse, table_map used_tables,
- KEY_PART_INFO *key_part, char *key_buff,
+ KEY_PART_INFO *key_part, uchar *key_buff,
uint maybe_null);
static bool make_simple_join(JOIN *join,TABLE *tmp_table);
static void make_outerjoin_info(JOIN *join);
@@ -191,6 +195,7 @@ static bool setup_new_fields(THD *thd, List<Item> &fields,
List<Item> &all_fields, ORDER *new_order);
static ORDER *create_distinct_group(THD *thd, Item **ref_pointer_array,
ORDER *order, List<Item> &fields,
+ List<Item> &all_fields,
bool *all_order_by_fields_used);
static bool test_if_subpart(ORDER *a,ORDER *b);
static TABLE *get_sort_by_table(ORDER *a,ORDER *b,TABLE_LIST *tables);
@@ -261,11 +266,8 @@ bool handle_select(THD *thd, LEX *lex, select_result *result,
thd->net.report_error));
res|= thd->net.report_error;
if (unlikely(res))
- {
- /* If we had a another error reported earlier then this will be ignored */
- result->send_error(ER_UNKNOWN_ERROR, ER(ER_UNKNOWN_ERROR));
result->abort();
- }
+
DBUG_RETURN(res);
}
@@ -542,6 +544,28 @@ JOIN::prepare(Item ***rref_pointer_array,
fix_inner_refs(thd, all_fields, select_lex, ref_pointer_array))
DBUG_RETURN(-1);
+ if (group_list)
+ {
+ /*
+ Because HEAP tables can't index BIT fields we need to use an
+ additional hidden field for grouping because later it will be
+ converted to a LONG field. Original field will remain of the
+ BIT type and will be returned to a client.
+ */
+ for (ORDER *ord= group_list; ord; ord= ord->next)
+ {
+ if ((*ord->item)->type() == Item::FIELD_ITEM &&
+ (*ord->item)->field_type() == MYSQL_TYPE_BIT)
+ {
+ Item_field *field= new Item_field(thd, *(Item_field**)ord->item);
+ int el= all_fields.elements;
+ ref_pointer_array[el]= field;
+ all_fields.push_front(field);
+ ord->item= ref_pointer_array + el;
+ }
+ }
+ }
+
if (setup_ftfuncs(select_lex)) /* should be after having->fix_fields */
DBUG_RETURN(-1);
@@ -609,7 +633,7 @@ JOIN::prepare(Item ***rref_pointer_array,
goto err; /* purecov: inspected */
/* Init join struct */
- count_field_types(&tmp_table_param, all_fields, 0);
+ count_field_types(select_lex, &tmp_table_param, all_fields, 0);
ref_pointer_array_size= all_fields.elements*sizeof(Item*);
this->group= group_list != 0;
unit= unit_arg;
@@ -996,6 +1020,12 @@ JOIN::optimize()
}
}
+ if (conds &&!outer_join && const_table_map != found_const_table_map &&
+ (select_options & SELECT_DESCRIBE) &&
+ select_lex->master_unit() == &thd->lex->unit) // upper level SELECT
+ {
+ conds=new Item_int((longlong) 0,1); // Always false
+ }
if (make_join_select(this, select, conds))
{
zero_result_cause=
@@ -1047,6 +1077,20 @@ JOIN::optimize()
find_field_in_order_list,
(void *) group_list))
{
+ /*
+ We have found that grouping can be removed since groups correspond to
+ only one row anyway, but we still have to guarantee correct result
+ order. The line below effectively rewrites the query from GROUP BY
+ <fields> to ORDER BY <fields>. One exception is if skip_sort_order is
+ set (see above), then we can simply skip GROUP BY.
+ */
+ order= skip_sort_order ? 0 : group_list;
+ /*
+ If we have an IGNORE INDEX FOR GROUP BY(fields) clause, this must be
+ rewritten to IGNORE INDEX FOR ORDER BY(fields).
+ */
+ join_tab->table->keys_in_use_for_order_by=
+ join_tab->table->keys_in_use_for_group_by;
group_list= 0;
group= 0;
}
@@ -1086,12 +1130,13 @@ JOIN::optimize()
skip_sort_order= test_if_skip_sort_order(tab, order, select_limit, 1,
&tab->table->keys_in_use_for_order_by);
if ((group_list=create_distinct_group(thd, select_lex->ref_pointer_array,
- order, fields_list,
+ order, fields_list, all_fields,
&all_order_fields_used)))
{
bool skip_group= (skip_sort_order &&
test_if_skip_sort_order(tab, group_list, select_limit, 1,
&tab->table->keys_in_use_for_group_by) != 0);
+ count_field_types(select_lex, &tmp_table_param, all_fields, 0);
if ((skip_group && all_order_fields_used) ||
select_limit == HA_POS_ERROR ||
(order && !skip_sort_order))
@@ -1139,6 +1184,7 @@ JOIN::optimize()
order=0; // The output has only one row
simple_order=1;
select_distinct= 0; // No need in distinct for 1 row
+ group_optimized_away= 1;
}
calc_group_buffer(this, group_list);
@@ -1307,7 +1353,7 @@ JOIN::optimize()
for (ORDER *tmp_order= order; tmp_order ; tmp_order=tmp_order->next)
{
Item *item= *tmp_order->item;
- if (item->walk(&Item::is_expensive_processor, 0, (byte*)0))
+ if (item->walk(&Item::is_expensive_processor, 0, (uchar*)0))
{
/* Force tmp table without sort */
need_tmp=1; simple_order=simple_group=0;
@@ -1358,8 +1404,7 @@ JOIN::optimize()
there are aggregate functions, because in all these cases we need
all result rows.
*/
- ha_rows tmp_rows_limit= ((order == 0 || skip_sort_order ||
- test(select_options & OPTION_BUFFER_RESULT)) &&
+ ha_rows tmp_rows_limit= ((order == 0 || skip_sort_order) &&
!tmp_group &&
!thd->lex->current_select->with_sum_func) ?
select_limit : HA_POS_ERROR;
@@ -1548,7 +1593,7 @@ JOIN::save_join_tab()
{
if (!join_tab_save && select_lex->master_unit()->uncacheable)
{
- if (!(join_tab_save= (JOIN_TAB*)thd->memdup((gptr) join_tab,
+ if (!(join_tab_save= (JOIN_TAB*)thd->memdup((uchar*) join_tab,
sizeof(JOIN_TAB) * tables)))
return 1;
}
@@ -1640,6 +1685,10 @@ JOIN::exec()
DBUG_VOID_RETURN;
}
+ if ((this->select_lex->options & OPTION_SCHEMA_TABLE) &&
+ get_schema_tables_result(this, PROCESSED_BY_JOIN_EXEC))
+ DBUG_VOID_RETURN;
+
if (select_options & SELECT_DESCRIBE)
{
/*
@@ -1685,13 +1734,6 @@ JOIN::exec()
*/
curr_join->examined_rows= 0;
- if ((curr_join->select_lex->options & OPTION_SCHEMA_TABLE) &&
- !thd->lex->describe &&
- get_schema_tables_result(curr_join, PROCESSED_BY_JOIN_EXEC))
- {
- DBUG_VOID_RETURN;
- }
-
/* Create a tmp table if distinct or if the sort is too complicated */
if (need_tmp)
{
@@ -1797,7 +1839,7 @@ JOIN::exec()
if (make_simple_join(curr_join, curr_tmp_table))
DBUG_VOID_RETURN;
calc_group_buffer(curr_join, group_list);
- count_field_types(&curr_join->tmp_table_param,
+ count_field_types(select_lex, &curr_join->tmp_table_param,
curr_join->tmp_all_fields1,
curr_join->select_distinct && !curr_join->group_list);
curr_join->tmp_table_param.hidden_field_count=
@@ -1920,11 +1962,13 @@ JOIN::exec()
if (make_simple_join(curr_join, curr_tmp_table))
DBUG_VOID_RETURN;
calc_group_buffer(curr_join, curr_join->group_list);
- count_field_types(&curr_join->tmp_table_param, *curr_all_fields, 0);
+ count_field_types(select_lex, &curr_join->tmp_table_param,
+ *curr_all_fields, 0);
}
if (procedure)
- count_field_types(&curr_join->tmp_table_param, *curr_all_fields, 0);
+ count_field_types(select_lex, &curr_join->tmp_table_param,
+ *curr_all_fields, 0);
if (curr_join->group || curr_join->tmp_table_param.sum_func_count ||
(procedure && (procedure->flags & PROC_GROUP)))
@@ -2116,6 +2160,17 @@ JOIN::exec()
thd->examined_row_count+= curr_join->examined_rows;
DBUG_PRINT("counts", ("thd->examined_row_count: %lu",
(ulong) thd->examined_row_count));
+
+ /*
+ With EXPLAIN EXTENDED we have to restore original ref_array
+ for a derived table which is always materialized.
+ Otherwise we would not be able to print the query correctly.
+ */
+ if (items0 &&
+ (thd->lex->describe & DESCRIBE_EXTENDED) &&
+ select_lex->linkage == DERIVED_TABLE_TYPE)
+ set_items_ref_array(items0);
+
DBUG_VOID_RETURN;
}
@@ -2458,7 +2513,7 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables, COND *conds,
no_partitions_used) &&
!s->dependent &&
(table->file->ha_table_flags() & HA_STATS_RECORDS_IS_EXACT) &&
- !table->fulltext_searched)
+ !table->fulltext_searched && !join->no_const_tables)
{
set_position(join,const_count++,s,(KEYUSE*) 0);
}
@@ -2768,11 +2823,12 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables, COND *conds,
if (join->const_tables != join->tables)
{
optimize_keyuse(join, keyuse_array);
- choose_plan(join, all_table_map & ~join->const_table_map);
+ if (choose_plan(join, all_table_map & ~join->const_table_map))
+ DBUG_RETURN(TRUE);
}
else
{
- memcpy((gptr) join->best_positions,(gptr) join->positions,
+ memcpy((uchar*) join->best_positions,(uchar*) join->positions,
sizeof(POSITION)*join->const_tables);
join->best_read=1.0;
}
@@ -3393,7 +3449,7 @@ add_key_part(DYNAMIC_ARRAY *keyuse_array,KEY_FIELD *key_field)
keyuse.optimize= key_field->optimize & KEY_OPTIMIZE_REF_OR_NULL;
keyuse.null_rejecting= key_field->null_rejecting;
keyuse.cond_guard= key_field->cond_guard;
- VOID(insert_dynamic(keyuse_array,(gptr) &keyuse));
+ VOID(insert_dynamic(keyuse_array,(uchar*) &keyuse));
}
}
}
@@ -3460,7 +3516,7 @@ add_ft_keys(DYNAMIC_ARRAY *keyuse_array,
keyuse.used_tables=cond_func->key_item()->used_tables();
keyuse.optimize= 0;
keyuse.keypart_map= 0;
- VOID(insert_dynamic(keyuse_array,(gptr) &keyuse));
+ VOID(insert_dynamic(keyuse_array,(uchar*) &keyuse));
}
@@ -3567,10 +3623,7 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab,
uint and_level,i,found_eq_constant;
KEY_FIELD *key_fields, *end, *field;
uint sz;
- uint m= 1;
-
- if (cond_equal && cond_equal->max_members)
- m= cond_equal->max_members;
+ uint m= max(select_lex->max_equal_elems,1);
/*
We use the same piece of memory to store both KEY_FIELD
@@ -3590,7 +3643,8 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab,
it is considered as sargable only for its first argument.
Multiple equality can add elements that are filled after
substitution of field arguments by equal fields. There
- can be not more than cond_equal->max_members such substitutions.
+ can be not more than select_lex->max_equal_elems such
+ substitutions.
*/
sz= max(sizeof(KEY_FIELD),sizeof(SARGABLE_PARAM))*
(((thd->lex->current_select->cond_count+1)*2 +
@@ -3675,7 +3729,7 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab,
(qsort_cmp) sort_keyuse);
bzero((char*) &key_end,sizeof(key_end)); /* Add for easy testing */
- VOID(insert_dynamic(keyuse,(gptr) &key_end));
+ VOID(insert_dynamic(keyuse,(uchar*) &key_end));
use=save_pos=dynamic_element(keyuse,0,KEYUSE*);
prev= &key_end;
@@ -3710,7 +3764,7 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab,
save_pos++;
}
i=(uint) (save_pos-(KEYUSE*) keyuse->buffer);
- VOID(set_dynamic(keyuse,(gptr) &key_end,i));
+ VOID(set_dynamic(keyuse,(uchar*) &key_end,i));
keyuse->elements=i;
}
return FALSE;
@@ -3791,7 +3845,7 @@ add_group_and_distinct_keys(JOIN *join, JOIN_TAB *join_tab)
{ /* Collect all query fields referenced in the GROUP clause. */
for (cur_group= join->group_list; cur_group; cur_group= cur_group->next)
(*cur_group->item)->walk(&Item::collect_item_field_processor, 0,
- (byte*) &indexed_fields);
+ (uchar*) &indexed_fields);
}
else if (join->select_distinct)
{ /* Collect all query fields referenced in the SELECT clause. */
@@ -3800,7 +3854,7 @@ add_group_and_distinct_keys(JOIN *join, JOIN_TAB *join_tab)
Item *item;
while ((item= select_items_it++))
item->walk(&Item::collect_item_field_processor, 0,
- (byte*) &indexed_fields);
+ (uchar*) &indexed_fields);
}
else
return;
@@ -4288,7 +4342,7 @@ best_access_path(JOIN *join,
!(s->quick && best_key && s->quick->index == best_key->key && // (2)
best_max_key_part >= s->table->quick_key_parts[best_key->key]) &&// (2)
!((s->table->file->ha_table_flags() & HA_TABLE_SCAN_ON_INDEX) && // (3)
- ! s->table->covering_keys.is_clear_all() && best_key) && // (3)
+ ! s->table->covering_keys.is_clear_all() && best_key && !s->quick) &&// (3)
!(s->table->force_index && best_key && !s->quick)) // (4)
{ // Check full join
ha_rows rnd_records= s->found_records;
@@ -4417,11 +4471,12 @@ best_access_path(JOIN *join,
the array 'join->best_positions', and the cost of the plan in
'join->best_read'.
- RETURN
- None
+ RETURN VALUES
+ FALSE ok
+ TRUE Fatal error
*/
-static void
+static bool
choose_plan(JOIN *join, table_map join_tables)
{
uint search_depth= join->thd->variables.optimizer_search_depth;
@@ -4454,22 +4509,28 @@ choose_plan(JOIN *join, table_map join_tables)
the greedy version. Will be removed when greedy_search is approved.
*/
join->best_read= DBL_MAX;
- find_best(join, join_tables, join->const_tables, 1.0, 0.0);
+ if (find_best(join, join_tables, join->const_tables, 1.0, 0.0))
+ DBUG_RETURN(TRUE);
}
else
{
if (search_depth == 0)
/* Automatically determine a reasonable value for 'search_depth' */
search_depth= determine_search_depth(join);
- greedy_search(join, join_tables, search_depth, prune_level);
+ if (greedy_search(join, join_tables, search_depth, prune_level))
+ DBUG_RETURN(TRUE);
}
}
/*
Store the cost of this query into a user variable
+ Don't update last_query_cost for statements that are not "flat joins" :
+ i.e. they have subqueries, unions or call stored procedures.
+ TODO: calculate a correct cost for a query with subqueries and UNIONs.
*/
- join->thd->status_var.last_query_cost= join->best_read;
- DBUG_VOID_RETURN;
+ if (join->thd->lex->is_single_level_stmt())
+ join->thd->status_var.last_query_cost= join->best_read;
+ DBUG_RETURN(FALSE);
}
@@ -4621,7 +4682,7 @@ optimize_straight_join(JOIN *join, table_map join_tables)
if (join->sort_by_table &&
join->sort_by_table != join->positions[join->const_tables].table->table)
read_time+= record_count; // We have to make a temp table
- memcpy((gptr) join->best_positions, (gptr) join->positions,
+ memcpy((uchar*) join->best_positions, (uchar*) join->positions,
sizeof(POSITION)*idx);
join->best_read= read_time;
}
@@ -4697,11 +4758,12 @@ optimize_straight_join(JOIN *join, table_map join_tables)
In the future, 'greedy_search' might be extended to support other
implementations of 'best_extension', e.g. some simpler quadratic procedure.
- RETURN
- None
+ RETURN VALUES
+ FALSE ok
+ TRUE Fatal error
*/
-static void
+static bool
greedy_search(JOIN *join,
table_map remaining_tables,
uint search_depth,
@@ -4723,8 +4785,9 @@ greedy_search(JOIN *join,
do {
/* Find the extension of the current QEP with the lowest cost */
join->best_read= DBL_MAX;
- best_extension_by_limited_search(join, remaining_tables, idx, record_count,
- read_time, search_depth, prune_level);
+ if (best_extension_by_limited_search(join, remaining_tables, idx, record_count,
+ read_time, search_depth, prune_level))
+ DBUG_RETURN(TRUE);
if (size_remain <= search_depth)
{
@@ -4735,7 +4798,7 @@ greedy_search(JOIN *join,
DBUG_EXECUTE("opt", print_plan(join, join->tables,
record_count, read_time, read_time,
"optimal"););
- DBUG_VOID_RETURN;
+ DBUG_RETURN(FALSE);
}
/* select the first table in the optimal extension as most promising */
@@ -4880,11 +4943,12 @@ greedy_search(JOIN *join,
The parameter 'search_depth' provides control over the recursion
depth, and thus the size of the resulting optimal plan.
- RETURN
- None
+ RETURN VALUES
+ FALSE ok
+ TRUE Fatal error
*/
-static void
+static bool
best_extension_by_limited_search(JOIN *join,
table_map remaining_tables,
uint idx,
@@ -4893,11 +4957,12 @@ best_extension_by_limited_search(JOIN *join,
uint search_depth,
uint prune_level)
{
+ DBUG_ENTER("best_extension_by_limited_search");
+
THD *thd= join->thd;
if (thd->killed) // Abort
- return;
+ DBUG_RETURN(TRUE);
- DBUG_ENTER("best_extension_by_limited_search");
DBUG_EXECUTE("opt", print_plan(join, idx, read_time, record_count, idx,
"SOFAR:"););
@@ -4979,15 +5044,14 @@ best_extension_by_limited_search(JOIN *join,
if ( (search_depth > 1) && (remaining_tables & ~real_table_bit) )
{ /* Recursively expand the current partial plan */
swap_variables(JOIN_TAB*, join->best_ref[idx], *pos);
- best_extension_by_limited_search(join,
- remaining_tables & ~real_table_bit,
- idx + 1,
- current_record_count,
- current_read_time,
- search_depth - 1,
- prune_level);
- if (thd->killed)
- DBUG_VOID_RETURN;
+ if (best_extension_by_limited_search(join,
+ remaining_tables & ~real_table_bit,
+ idx + 1,
+ current_record_count,
+ current_read_time,
+ search_depth - 1,
+ prune_level))
+ DBUG_RETURN(TRUE);
swap_variables(JOIN_TAB*, join->best_ref[idx], *pos);
}
else
@@ -5003,7 +5067,7 @@ best_extension_by_limited_search(JOIN *join,
current_read_time+= current_record_count;
if ((search_depth == 1) || (current_read_time < join->best_read))
{
- memcpy((gptr) join->best_positions, (gptr) join->positions,
+ memcpy((uchar*) join->best_positions, (uchar*) join->positions,
sizeof(POSITION) * (idx + 1));
join->best_read= current_read_time - 0.001;
}
@@ -5016,19 +5080,26 @@ best_extension_by_limited_search(JOIN *join,
restore_prev_nj_state(s);
}
}
- DBUG_VOID_RETURN;
+ DBUG_RETURN(FALSE);
}
/*
TODO: this function is here only temporarily until 'greedy_search' is
tested and accepted.
+
+ RETURN VALUES
+ FALSE ok
+ TRUE Fatal error
*/
-static void
+static bool
find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
double read_time)
{
+ DBUG_ENTER("find_best");
THD *thd= join->thd;
+ if (thd->killed)
+ DBUG_RETURN(TRUE);
if (!rest_tables)
{
DBUG_PRINT("best",("read_time: %g record_count: %g",read_time,
@@ -5041,14 +5112,14 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
read_time+=record_count; // We have to make a temp table
if (read_time < join->best_read)
{
- memcpy((gptr) join->best_positions,(gptr) join->positions,
+ memcpy((uchar*) join->best_positions,(uchar*) join->positions,
sizeof(POSITION)*idx);
join->best_read= read_time - 0.001;
}
- return;
+ DBUG_RETURN(FALSE);
}
if (read_time+record_count/(double) TIME_FOR_COMPARE >= join->best_read)
- return; /* Found better before */
+ DBUG_RETURN(FALSE); /* Found better before */
JOIN_TAB *s;
double best_record_count=DBL_MAX,best_read_time=DBL_MAX;
@@ -5081,10 +5152,9 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
best_read_time=current_read_time;
}
swap_variables(JOIN_TAB*, join->best_ref[idx], *pos);
- find_best(join,rest_tables & ~real_table_bit,idx+1,
- current_record_count,current_read_time);
- if (thd->killed)
- return;
+ if (find_best(join,rest_tables & ~real_table_bit,idx+1,
+ current_record_count,current_read_time))
+ DBUG_RETURN(TRUE);
swap_variables(JOIN_TAB*, join->best_ref[idx], *pos);
}
restore_prev_nj_state(s);
@@ -5092,6 +5162,7 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
break; // Don't test all combinations
}
}
+ DBUG_RETURN(FALSE);
}
@@ -5352,7 +5423,7 @@ static bool create_ref_for_key(JOIN *join, JOIN_TAB *j, KEYUSE *org_keyuse,
j->ref.key_parts=keyparts;
j->ref.key_length=length;
j->ref.key=(int) key;
- if (!(j->ref.key_buff= (byte*) thd->calloc(ALIGN_SIZE(length)*2)) ||
+ if (!(j->ref.key_buff= (uchar*) thd->calloc(ALIGN_SIZE(length)*2)) ||
!(j->ref.key_copy= (store_key**) thd->alloc((sizeof(store_key*) *
(keyparts+1)))) ||
!(j->ref.items= (Item**) thd->alloc(sizeof(Item*)*keyparts)) ||
@@ -5366,7 +5437,7 @@ static bool create_ref_for_key(JOIN *join, JOIN_TAB *j, KEYUSE *org_keyuse,
keyuse=org_keyuse;
store_key **ref_key= j->ref.key_copy;
- byte *key_buff=j->ref.key_buff, *null_ref_key= 0;
+ uchar *key_buff=j->ref.key_buff, *null_ref_key= 0;
bool keyuse_uses_no_tables= TRUE;
if (ftkey)
{
@@ -5397,8 +5468,8 @@ static bool create_ref_for_key(JOIN *join, JOIN_TAB *j, KEYUSE *org_keyuse,
!(join->select_options & SELECT_DESCRIBE))
{ // Compare against constant
store_key_item tmp(thd, keyinfo->key_part[i].field,
- (char*)key_buff + maybe_null,
- maybe_null ? (char*) key_buff : 0,
+ key_buff + maybe_null,
+ maybe_null ? key_buff : 0,
keyinfo->key_part[i].length, keyuse->val);
if (thd->is_fatal_error)
DBUG_RETURN(TRUE);
@@ -5408,7 +5479,7 @@ static bool create_ref_for_key(JOIN *join, JOIN_TAB *j, KEYUSE *org_keyuse,
*ref_key++= get_store_key(thd,
keyuse,join->const_table_map,
&keyinfo->key_part[i],
- (char*) key_buff,maybe_null);
+ key_buff, maybe_null);
/*
Remember if we are going to use REF_OR_NULL
But only if field _really_ can be null i.e. we force JT_REF
@@ -5452,7 +5523,7 @@ static bool create_ref_for_key(JOIN *join, JOIN_TAB *j, KEYUSE *org_keyuse,
static store_key *
get_store_key(THD *thd, KEYUSE *keyuse, table_map used_tables,
- KEY_PART_INFO *key_part, char *key_buff, uint maybe_null)
+ KEY_PART_INFO *key_part, uchar *key_buff, uint maybe_null)
{
if (!((~used_tables) & keyuse->used_tables)) // if const item
{
@@ -5951,7 +6022,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
{
DBUG_EXECUTE("where",print_where(tmp,tab->table->alias););
SQL_SELECT *sel= tab->select= ((SQL_SELECT*)
- thd->memdup((gptr) select,
+ thd->memdup((uchar*) select,
sizeof(*select)));
if (!sel)
DBUG_RETURN(1); // End of memory
@@ -6074,7 +6145,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
/* Fix for EXPLAIN */
if (sel->quick)
- join->best_positions[i].records_read= sel->quick->records;
+ join->best_positions[i].records_read= (double)sel->quick->records;
}
else
{
@@ -6103,7 +6174,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
{
DBUG_EXECUTE("where",print_where(tmp,"cache"););
tab->cache.select=(SQL_SELECT*)
- thd->memdup((gptr) sel, sizeof(SQL_SELECT));
+ thd->memdup((uchar*) sel, sizeof(SQL_SELECT));
tab->cache.select->cond=tmp;
tab->cache.select->read_tables=join->const_table_map;
}
@@ -6112,13 +6183,39 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
}
/*
- Push down all predicates from on expressions.
- Each of these predicated are guarded by a variable
+ Push down conditions from all on expressions.
+ Each of these conditions are guarded by a variable
that turns if off just before null complemented row for
- outer joins is formed. Thus, the predicates from an
+ outer joins is formed. Thus, the condition from an
'on expression' are guaranteed not to be checked for
the null complemented row.
*/
+
+ /* First push down constant conditions from on expressions */
+ for (JOIN_TAB *join_tab= join->join_tab+join->const_tables;
+ join_tab < join->join_tab+join->tables ; join_tab++)
+ {
+ if (*join_tab->on_expr_ref)
+ {
+ JOIN_TAB *cond_tab= join_tab->first_inner;
+ COND *tmp= make_cond_for_table(*join_tab->on_expr_ref,
+ join->const_table_map,
+ (table_map) 0);
+ if (!tmp)
+ continue;
+ tmp= new Item_func_trig_cond(tmp, &cond_tab->not_null_compl);
+ if (!tmp)
+ DBUG_RETURN(1);
+ tmp->quick_fix_field();
+ cond_tab->select_cond= !cond_tab->select_cond ? tmp :
+ new Item_cond_and(cond_tab->select_cond,tmp);
+ if (!cond_tab->select_cond)
+ DBUG_RETURN(1);
+ cond_tab->select_cond->quick_fix_field();
+ }
+ }
+
+ /* Push down non-constant conditions from on expressions */
JOIN_TAB *last_tab= tab;
while (first_inner_tab && first_inner_tab->last_inner == last_tab)
{
@@ -6301,8 +6398,7 @@ make_join_readinfo(JOIN *join, ulonglong options)
join->thd->server_status|=SERVER_QUERY_NO_GOOD_INDEX_USED;
tab->read_first_record= join_init_quick_read_record;
if (statistics)
- statistic_increment(join->thd->status_var.select_range_check_count,
- &LOCK_status);
+ status_var_increment(join->thd->status_var.select_range_check_count);
}
else
{
@@ -6312,15 +6408,13 @@ make_join_readinfo(JOIN *join, ulonglong options)
if (tab->select && tab->select->quick)
{
if (statistics)
- statistic_increment(join->thd->status_var.select_range_count,
- &LOCK_status);
+ status_var_increment(join->thd->status_var.select_range_count);
}
else
{
join->thd->server_status|=SERVER_QUERY_NO_INDEX_USED;
if (statistics)
- statistic_increment(join->thd->status_var.select_scan_count,
- &LOCK_status);
+ status_var_increment(join->thd->status_var.select_scan_count);
}
}
else
@@ -6328,15 +6422,13 @@ make_join_readinfo(JOIN *join, ulonglong options)
if (tab->select && tab->select->quick)
{
if (statistics)
- statistic_increment(join->thd->status_var.select_full_range_join_count,
- &LOCK_status);
+ status_var_increment(join->thd->status_var.select_full_range_join_count);
}
else
{
join->thd->server_status|=SERVER_QUERY_NO_INDEX_USED;
if (statistics)
- statistic_increment(join->thd->status_var.select_full_join_count,
- &LOCK_status);
+ status_var_increment(join->thd->status_var.select_full_join_count);
}
}
if (!table->no_keyread)
@@ -6419,6 +6511,7 @@ void JOIN_TAB::cleanup()
quick= 0;
x_free(cache.buff);
cache.buff= 0;
+ limit= 0;
if (table)
{
if (table->key_read)
@@ -6571,7 +6664,6 @@ void JOIN::cleanup(bool full)
for (tab= join_tab, end= tab+tables; tab != end; tab++)
tab->cleanup();
table= 0;
- tables= 0;
}
else
{
@@ -7359,8 +7451,7 @@ static bool check_equality(THD *thd, Item *item, COND_EQUAL *cond_equal,
just an argument of a comparison predicate.
The function also determines the maximum number of members in
equality lists of each Item_cond_and object assigning it to
- cond_equal->max_members of this object and updating accordingly
- the upper levels COND_EQUAL structures.
+ thd->lex->current_select->max_equal_elems.
NOTES
Multiple equality predicate =(f1,..fn) is equivalent to the conjuction of
@@ -7405,7 +7496,6 @@ static COND *build_equal_items_for_cond(THD *thd, COND *cond,
COND_EQUAL *inherited)
{
Item_equal *item_equal;
- uint members;
COND_EQUAL cond_equal;
cond_equal.upper_levels= inherited;
@@ -7443,19 +7533,8 @@ static COND *build_equal_items_for_cond(THD *thd, COND *cond,
{
item_equal->fix_length_and_dec();
item_equal->update_used_tables();
- members= item_equal->members();
- if (cond_equal.max_members < members)
- cond_equal.max_members= members;
- }
- members= cond_equal.max_members;
- if (inherited && inherited->max_members < members)
- {
- do
- {
- inherited->max_members= members;
- inherited= inherited->upper_levels;
- }
- while (inherited);
+ set_if_bigger(thd->lex->current_select->max_equal_elems,
+ item_equal->members());
}
((Item_cond_and*)cond)->cond_equal= cond_equal;
@@ -7510,10 +7589,12 @@ static COND *build_equal_items_for_cond(THD *thd, COND *cond,
{
item_equal->fix_length_and_dec();
item_equal->update_used_tables();
- return item_equal;
}
else
- return eq_list.pop();
+ item_equal= (Item_equal *) eq_list.pop();
+ set_if_bigger(thd->lex->current_select->max_equal_elems,
+ item_equal->members());
+ return item_equal;
}
else
{
@@ -7529,9 +7610,8 @@ static COND *build_equal_items_for_cond(THD *thd, COND *cond,
{
item_equal->fix_length_and_dec();
item_equal->update_used_tables();
- members= item_equal->members();
- if (cond_equal.max_members < members)
- cond_equal.max_members= members;
+ set_if_bigger(thd->lex->current_select->max_equal_elems,
+ item_equal->members());
}
and_cond->cond_equal= cond_equal;
args->concat((List<Item> *)&cond_equal.current_level);
@@ -7545,11 +7625,11 @@ static COND *build_equal_items_for_cond(THD *thd, COND *cond,
as soon the field is not of a string type or the field reference is
an argument of a comparison predicate.
*/
- byte *is_subst_valid= (byte *) 1;
+ uchar *is_subst_valid= (uchar *) 1;
cond= cond->compile(&Item::subst_argument_checker,
&is_subst_valid,
&Item::equal_fields_propagator,
- (byte *) inherited);
+ (uchar *) inherited);
cond->update_used_tables();
}
return cond;
@@ -8673,9 +8753,15 @@ static void restore_prev_nj_state(JOIN_TAB *last)
{
TABLE_LIST *last_emb= last->table->pos_in_table_list->embedding;
JOIN *join= last->join;
- while (last_emb && !(--last_emb->nested_join->counter))
+ while (last_emb)
{
- join->cur_embedding_map &= last_emb->nested_join->nj_map;
+ if (!(--last_emb->nested_join->counter))
+ join->cur_embedding_map&= ~last_emb->nested_join->nj_map;
+ else if (last_emb->nested_join->join_list.elements-1 ==
+ last_emb->nested_join->counter)
+ join->cur_embedding_map|= last_emb->nested_join->nj_map;
+ else
+ break;
last_emb= last_emb->embedding;
}
}
@@ -9010,7 +9096,7 @@ Field *create_tmp_field_from_field(THD *thd, Field *org_field,
Make sure that the blob fits into a Field_varstring which has
2-byte lenght.
*/
- if (convert_blob_length && convert_blob_length < UINT_MAX16 &&
+ if (convert_blob_length && convert_blob_length <= Field_varstring::MAX_SIZE &&
(org_field->flags & BLOB_FLAG))
new_field= new Field_varstring(convert_blob_length,
org_field->maybe_null(),
@@ -9078,8 +9164,13 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
item->name, item->decimals, TRUE);
break;
case INT_RESULT:
- /* Select an integer type with the minimal fit precision */
- if (item->max_length > MY_INT32_NUM_DECIMAL_DIGITS)
+ /*
+ Select an integer type with the minimal fit precision.
+ MY_INT32_NUM_DECIMAL_DIGITS is sign inclusive, don't consider the sign.
+ Values with MY_INT32_NUM_DECIMAL_DIGITS digits may or may not fit into
+ Field_long : make them Field_longlong.
+ */
+ if (item->max_length >= (MY_INT32_NUM_DECIMAL_DIGITS - 1))
new_field=new Field_longlong(item->max_length, maybe_null,
item->name, item->unsigned_flag);
else
@@ -9103,7 +9194,8 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
2-byte lenght.
*/
else if (item->max_length/item->collation.collation->mbmaxlen > 255 &&
- convert_blob_length < UINT_MAX16 && convert_blob_length)
+ convert_blob_length <= Field_varstring::MAX_SIZE &&
+ convert_blob_length)
new_field= new Field_varstring(convert_blob_length, maybe_null,
item->name, table->s,
item->collation.collation);
@@ -9152,8 +9244,7 @@ Field *create_tmp_field_for_schema(THD *thd, Item *item, TABLE *table)
if (item->field_type() == MYSQL_TYPE_VARCHAR)
{
Field *field;
- if (item->max_length > MAX_FIELD_VARCHARLENGTH /
- item->collation.collation->mbmaxlen)
+ if (item->max_length > MAX_FIELD_VARCHARLENGTH)
field= new Field_blob(item->max_length, item->maybe_null,
item->name, item->collation.collation);
else
@@ -9309,7 +9400,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
a tmp_set bitmap to be used by things like filesort.
*/
-void setup_tmp_table_column_bitmaps(TABLE *table, byte *bitmaps)
+void setup_tmp_table_column_bitmaps(TABLE *table, uchar *bitmaps)
{
uint field_count= table->s->fields;
bitmap_init(&table->def_read_set, (my_bitmap_map*) bitmaps, field_count,
@@ -9378,8 +9469,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
bool using_unique_constraint= 0;
bool use_packed_rows= 0;
bool not_all_columns= !(select_options & TMP_TABLE_ALL_COLUMNS);
- char *tmpname,path[FN_REFLEN];
- byte *pos, *group_buff, *bitmaps;
+ char *tmpname,path[FN_REFLEN];
+ uchar *pos, *group_buff, *bitmaps;
uchar *null_flags;
Field **reg_field, **from_field, **default_field;
uint *blob_field;
@@ -9396,14 +9487,14 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
(int) distinct, (int) save_sum_fields,
(ulong) rows_limit,test(group)));
- statistic_increment(thd->status_var.created_tmp_tables, &LOCK_status);
+ status_var_increment(thd->status_var.created_tmp_tables);
if (use_temp_pool && !(test_flags & TEST_KEEP_TMP_TABLES))
temp_pool_slot = bitmap_lock_set_next(&temp_pool);
if (temp_pool_slot != MY_BIT_NONE) // we got a slot
sprintf(path, "%s_%lx_%i", tmp_file_prefix,
- current_pid, temp_pool_slot);
+ current_pid, temp_pool_slot);
else
{
/* if we run out of slots or we are not using tempool */
@@ -9417,6 +9508,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
*/
fn_format(path, path, mysql_tmpdir, "", MY_REPLACE_EXT|MY_UNPACK_FILENAME);
+
if (group)
{
if (!param->quick_group)
@@ -9671,12 +9763,14 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
share->fields= field_count;
/* If result table is small; use a heap */
+ /* future: storage engine selection can be made dynamic? */
if (blob_count || using_unique_constraint ||
(select_options & (OPTION_BIG_TABLES | SELECT_SMALL_RESULT)) ==
OPTION_BIG_TABLES || (select_options & TMP_TABLE_FORCE_MYISAM))
{
+ share->db_plugin= ha_lock_engine(0, myisam_hton);
table->file= get_new_handler(share, &table->mem_root,
- share->db_type= myisam_hton);
+ share->db_type());
if (group &&
(param->group_parts > table->file->max_key_parts() ||
param->group_length > table->file->max_key_length()))
@@ -9684,8 +9778,9 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
}
else
{
+ share->db_plugin= ha_lock_engine(0, heap_hton);
table->file= get_new_handler(share, &table->mem_root,
- share->db_type= heap_hton);
+ share->db_type());
}
if (!table->file)
goto err;
@@ -9720,7 +9815,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
{
uint alloc_length=ALIGN_SIZE(reclength+MI_UNIQUE_HASH_LENGTH+1);
share->rec_buff_length= alloc_length;
- if (!(table->record[0]= (byte*)
+ if (!(table->record[0]= (uchar*)
alloc_root(&table->mem_root, alloc_length*3)))
goto err;
table->record[1]= table->record[0]+alloc_length;
@@ -9736,7 +9831,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
pos=table->record[0]+ null_pack_length;
if (null_pack_length)
{
- bzero((byte*) recinfo,sizeof(*recinfo));
+ bzero((uchar*) recinfo,sizeof(*recinfo));
recinfo->type=FIELD_NORMAL;
recinfo->length=null_pack_length;
recinfo++;
@@ -9752,7 +9847,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
{
Field *field= *reg_field;
uint length;
- bzero((byte*) recinfo,sizeof(*recinfo));
+ bzero((uchar*) recinfo,sizeof(*recinfo));
if (!(field->flags & NOT_NULL_FLAG))
{
@@ -9766,19 +9861,19 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
recinfo->length=1;
recinfo->type=FIELD_NORMAL;
recinfo++;
- bzero((byte*) recinfo,sizeof(*recinfo));
+ bzero((uchar*) recinfo,sizeof(*recinfo));
}
else
{
recinfo->null_bit= 1 << (null_count & 7);
recinfo->null_pos= null_count/8;
}
- field->move_field((char*) pos,null_flags+null_count/8,
+ field->move_field(pos,null_flags+null_count/8,
1 << (null_count & 7));
null_count++;
}
else
- field->move_field((char*) pos,(uchar*) 0,0);
+ field->move_field(pos,(uchar*) 0,0);
if (field->type() == MYSQL_TYPE_BIT)
{
/* We have to reserve place for extra bits among null bits */
@@ -9847,7 +9942,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
if (thd->variables.tmp_table_size == ~ (ulonglong) 0) // No limit
share->max_rows= ~(ha_rows) 0;
else
- share->max_rows= (ha_rows) (((share->db_type == heap_hton) ?
+ share->max_rows= (ha_rows) (((share->db_type() == heap_hton) ?
min(thd->variables.tmp_table_size,
thd->variables.max_heap_table_size) :
thd->variables.tmp_table_size) /
@@ -9896,10 +9991,10 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
{
cur_group->buff=(char*) group_buff;
if (!(cur_group->field= field->new_key_field(thd->mem_root,table,
- (char*) group_buff +
- test(maybe_null),
- field->null_ptr,
- field->null_bit)))
+ group_buff +
+ test(maybe_null),
+ field->null_ptr,
+ field->null_bit)))
goto err; /* purecov: inspected */
if (maybe_null)
{
@@ -9961,7 +10056,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
key_part_info->null_bit=0;
key_part_info->offset=hidden_null_pack_length;
key_part_info->length=null_pack_length;
- key_part_info->field= new Field_string((char*) table->record[0],
+ key_part_info->field= new Field_string(table->record[0],
(uint32) key_part_info->length,
(uchar*) 0,
(uint) 0,
@@ -9995,7 +10090,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
if (thd->is_fatal_error) // If end of memory
goto err; /* purecov: inspected */
share->db_record_offset= 1;
- if (share->db_type == myisam_hton)
+ if (share->db_type() == myisam_hton)
{
if (create_myisam_tmp_table(table,param,select_options))
goto err;
@@ -10040,17 +10135,17 @@ err:
0 if out of memory, TABLE object in case of success
*/
-TABLE *create_virtual_tmp_table(THD *thd, List<create_field> &field_list)
+TABLE *create_virtual_tmp_table(THD *thd, List<Create_field> &field_list)
{
uint field_count= field_list.elements;
uint blob_count= 0;
Field **field;
- create_field *cdef; /* column definition */
+ Create_field *cdef; /* column definition */
uint record_length= 0;
uint null_count= 0; /* number of columns which may be null */
uint null_pack_length; /* NULL representation array length */
uint *blob_field;
- byte *bitmaps;
+ uchar *bitmaps;
TABLE *table;
TABLE_SHARE *share;
@@ -10073,7 +10168,7 @@ TABLE *create_virtual_tmp_table(THD *thd, List<create_field> &field_list)
setup_tmp_table_column_bitmaps(table, bitmaps);
/* Create all fields and calculate the total length of record */
- List_iterator_fast<create_field> it(field_list);
+ List_iterator_fast<Create_field> it(field_list);
while ((cdef= it++))
{
*field= make_field(share, 0, cdef->length,
@@ -10101,7 +10196,7 @@ TABLE *create_virtual_tmp_table(THD *thd, List<create_field> &field_list)
null_pack_length= (null_count + 7)/8;
share->reclength= record_length + null_pack_length;
share->rec_buff_length= ALIGN_SIZE(share->reclength + 1);
- table->record[0]= (byte*) thd->alloc(share->rec_buff_length);
+ table->record[0]= (uchar*) thd->alloc(share->rec_buff_length);
if (!table->record[0])
goto error;
@@ -10115,18 +10210,18 @@ TABLE *create_virtual_tmp_table(THD *thd, List<create_field> &field_list)
table->in_use= thd; /* field->reset() may access table->in_use */
{
/* Set up field pointers */
- byte *null_pos= table->record[0];
- byte *field_pos= null_pos + share->null_bytes;
+ uchar *null_pos= table->record[0];
+ uchar *field_pos= null_pos + share->null_bytes;
uint null_bit= 1;
for (field= table->field; *field; ++field)
{
Field *cur_field= *field;
if ((cur_field->flags & NOT_NULL_FLAG))
- cur_field->move_field((char*) field_pos);
+ cur_field->move_field(field_pos);
else
{
- cur_field->move_field((char*) field_pos, (uchar*) null_pos, null_bit);
+ cur_field->move_field(field_pos, (uchar*) null_pos, null_bit);
null_bit<<= 1;
if (null_bit == (1 << 8))
{
@@ -10151,7 +10246,7 @@ static bool open_tmp_table(TABLE *table)
{
int error;
if ((error=table->file->ha_open(table, table->s->table_name.str,O_RDWR,
- HA_OPEN_TMP_TABLE)))
+ HA_OPEN_TMP_TABLE | HA_OPEN_INTERNAL_TABLE)))
{
table->file->print_error(error,MYF(0)); /* purecov: inspected */
table->db_stat=0;
@@ -10195,7 +10290,7 @@ static bool create_myisam_tmp_table(TABLE *table,TMP_TABLE_PARAM *param,
uniquedef.null_are_equal=1;
/* Create extra column for hash value */
- bzero((byte*) param->recinfo,sizeof(*param->recinfo));
+ bzero((uchar*) param->recinfo,sizeof(*param->recinfo));
param->recinfo->type= FIELD_CHECK;
param->recinfo->length=MI_UNIQUE_HASH_LENGTH;
param->recinfo++;
@@ -10265,8 +10360,7 @@ static bool create_myisam_tmp_table(TABLE *table,TMP_TABLE_PARAM *param,
table->db_stat=0;
goto err;
}
- statistic_increment(table->in_use->status_var.created_tmp_disk_tables,
- &LOCK_status);
+ status_var_increment(table->in_use->status_var.created_tmp_disk_tables);
share->db_record_offset= 1;
DBUG_RETURN(0);
err:
@@ -10302,6 +10396,8 @@ free_tmp_table(THD *thd, TABLE *entry)
if (entry->temp_pool_slot != MY_BIT_NONE)
bitmap_lock_clear_bit(&temp_pool, entry->temp_pool_slot);
+ plugin_unlock(0, entry->s->db_plugin);
+
free_root(&own_root, MYF(0)); /* the table is allocated in its own root */
thd_proc_info(thd, save_proc_info);
@@ -10321,7 +10417,7 @@ bool create_myisam_from_heap(THD *thd, TABLE *table, TMP_TABLE_PARAM *param,
int write_err;
DBUG_ENTER("create_myisam_from_heap");
- if (table->s->db_type != heap_hton ||
+ if (table->s->db_type() != heap_hton ||
error != HA_ERR_RECORD_FILE_FULL)
{
table->file->print_error(error,MYF(0));
@@ -10330,9 +10426,9 @@ bool create_myisam_from_heap(THD *thd, TABLE *table, TMP_TABLE_PARAM *param,
new_table= *table;
share= *table->s;
new_table.s= &share;
- new_table.s->db_type= myisam_hton;
+ new_table.s->db_plugin= ha_lock_engine(thd, myisam_hton);
if (!(new_table.file= get_new_handler(&share, &new_table.mem_root,
- myisam_hton)))
+ new_table.s->db_type())))
DBUG_RETURN(1); // End of memory
save_proc_info=thd->proc_info;
@@ -10373,7 +10469,9 @@ bool create_myisam_from_heap(THD *thd, TABLE *table, TMP_TABLE_PARAM *param,
*/
while (!table->file->rnd_next(new_table.record[1]))
{
- if ((write_err= new_table.file->write_row(new_table.record[1])))
+ write_err= new_table.file->write_row(new_table.record[1]);
+ DBUG_EXECUTE_IF("raise_error", write_err= HA_ERR_FOUND_DUPP_KEY ;);
+ if (write_err)
goto err;
}
/* copy row that filled HEAP table */
@@ -10386,13 +10484,15 @@ bool create_myisam_from_heap(THD *thd, TABLE *table, TMP_TABLE_PARAM *param,
/* remove heap table and change to use myisam table */
(void) table->file->ha_rnd_end();
- (void) table->file->close();
- (void) table->file->delete_table(table->s->table_name.str);
+ (void) table->file->close(); // This deletes the table !
delete table->file;
table->file=0;
+ plugin_unlock(0, table->s->db_plugin);
+ share.db_plugin= my_plugin_lock(0, &share.db_plugin);
new_table.s= table->s; // Keep old share
*table= new_table;
*table->s= share;
+
table->file->change_table_ptr(table, table->s);
table->use_all_columns();
if (save_proc_info)
@@ -10402,7 +10502,7 @@ bool create_myisam_from_heap(THD *thd, TABLE *table, TMP_TABLE_PARAM *param,
err:
DBUG_PRINT("error",("Got error: %d",write_err));
- table->file->print_error(error,MYF(0)); // Give table is full error
+ table->file->print_error(write_err, MYF(0));
(void) table->file->ha_rnd_end();
(void) new_table.file->close();
err1:
@@ -10410,6 +10510,7 @@ bool create_myisam_from_heap(THD *thd, TABLE *table, TMP_TABLE_PARAM *param,
err2:
delete new_table.file;
thd_proc_info(thd, save_proc_info);
+ table->mem_root= new_table.mem_root;
DBUG_RETURN(1);
}
@@ -11100,10 +11201,10 @@ int safe_index_read(JOIN_TAB *tab)
{
int error;
TABLE *table= tab->table;
- if ((error=table->file->index_read(table->record[0],
- tab->ref.key_buff,
- make_prev_keypart_map(tab->ref.key_parts),
- HA_READ_KEY_EXACT)))
+ if ((error=table->file->index_read_map(table->record[0],
+ tab->ref.key_buff,
+ make_prev_keypart_map(tab->ref.key_parts),
+ HA_READ_KEY_EXACT)))
return report_error(table, error);
return 0;
}
@@ -11239,10 +11340,10 @@ join_read_const(JOIN_TAB *tab)
error=HA_ERR_KEY_NOT_FOUND;
else
{
- error=table->file->index_read_idx(table->record[0],tab->ref.key,
- (byte*) tab->ref.key_buff,
- make_prev_keypart_map(tab->ref.key_parts),
- HA_READ_KEY_EXACT);
+ error=table->file->index_read_idx_map(table->record[0],tab->ref.key,
+ (uchar*) tab->ref.key_buff,
+ make_prev_keypart_map(tab->ref.key_parts),
+ HA_READ_KEY_EXACT);
}
if (error)
{
@@ -11283,10 +11384,10 @@ join_read_key(JOIN_TAB *tab)
table->status=STATUS_NOT_FOUND;
return -1;
}
- error=table->file->index_read(table->record[0],
- tab->ref.key_buff,
- make_prev_keypart_map(tab->ref.key_parts),
- HA_READ_KEY_EXACT);
+ error=table->file->index_read_map(table->record[0],
+ tab->ref.key_buff,
+ make_prev_keypart_map(tab->ref.key_parts),
+ HA_READ_KEY_EXACT);
if (error && error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE)
return report_error(table, error);
}
@@ -11312,10 +11413,10 @@ join_read_always_key(JOIN_TAB *tab)
}
if (cp_buffer_from_ref(tab->join->thd, table, &tab->ref))
return -1;
- if ((error=table->file->index_read(table->record[0],
- tab->ref.key_buff,
- make_prev_keypart_map(tab->ref.key_parts),
- HA_READ_KEY_EXACT)))
+ if ((error=table->file->index_read_map(table->record[0],
+ tab->ref.key_buff,
+ make_prev_keypart_map(tab->ref.key_parts),
+ HA_READ_KEY_EXACT)))
{
if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE)
return report_error(table, error);
@@ -11340,8 +11441,9 @@ join_read_last_key(JOIN_TAB *tab)
table->file->ha_index_init(tab->ref.key, tab->sorted);
if (cp_buffer_from_ref(tab->join->thd, table, &tab->ref))
return -1;
- if ((error=table->file->index_read_last(table->record[0],
- tab->ref.key_buff, make_prev_keypart_map(tab->ref.key_parts))))
+ if ((error=table->file->index_read_last_map(table->record[0],
+ tab->ref.key_buff,
+ make_prev_keypart_map(tab->ref.key_parts))))
{
if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE)
return report_error(table, error);
@@ -11688,7 +11790,8 @@ end_send_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
if (!join->first_record || end_of_records ||
(idx=test_if_group_changed(join->group_fields)) >= 0)
{
- if (join->first_record || (end_of_records && !join->group))
+ if (join->first_record ||
+ (end_of_records && !join->group && !join->group_optimized_away))
{
if (join->procedure)
join->procedure->end_group();
@@ -11817,7 +11920,7 @@ end_write(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
if (item->maybe_null)
{
Field *field=item->get_tmp_table_field();
- field->ptr[-1]= (byte) (field->is_null() ? 1 : 0);
+ field->ptr[-1]= (uchar) (field->is_null() ? 1 : 0);
}
}
}
@@ -11881,9 +11984,10 @@ end_update(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
if (item->maybe_null)
group->buff[-1]= (char) group->field->is_null();
}
- if (!table->file->index_read(table->record[1],
- join->tmp_table_param.group_buff, HA_WHOLE_KEY,
- HA_READ_KEY_EXACT))
+ if (!table->file->index_read_map(table->record[1],
+ join->tmp_table_param.group_buff,
+ HA_WHOLE_KEY,
+ HA_READ_KEY_EXACT))
{ /* Update old record */
restore_record(table,record[1]);
update_tmptable_sum_func(join->sum_funcs,table);
@@ -12235,6 +12339,7 @@ static int test_if_order_by_key(ORDER *order, TABLE *table, uint idx,
key_part_end=key_part+table->key_info[idx].key_parts;
key_part_map const_key_parts=table->const_key_parts[idx];
int reverse=0;
+ my_bool on_primary_key= FALSE;
DBUG_ENTER("test_if_order_by_key");
for (; order ; order=order->next, const_key_parts>>=1)
@@ -12249,7 +12354,36 @@ static int test_if_order_by_key(ORDER *order, TABLE *table, uint idx,
for (; const_key_parts & 1 ; const_key_parts>>= 1)
key_part++;
- if (key_part == key_part_end || key_part->field != field)
+ if (key_part == key_part_end)
+ {
+ /*
+ We are at the end of the key. Check if the engine has the primary
+ key as a suffix to the secondary keys. If it has continue to check
+ the primary key as a suffix.
+ */
+ if (!on_primary_key &&
+ (table->file->ha_table_flags() & HA_PRIMARY_KEY_IN_READ_INDEX) &&
+ table->s->primary_key != MAX_KEY)
+ {
+ on_primary_key= TRUE;
+ key_part= table->key_info[table->s->primary_key].key_part;
+ key_part_end=key_part+table->key_info[table->s->primary_key].key_parts;
+ const_key_parts=table->const_key_parts[table->s->primary_key];
+
+ for (; const_key_parts & 1 ; const_key_parts>>= 1)
+ key_part++;
+ /*
+ The primary and secondary key parts were all const (i.e. there's
+ one row). The sorting doesn't matter.
+ */
+ if (key_part == key_part_end && reverse == 0)
+ DBUG_RETURN(1);
+ }
+ else
+ DBUG_RETURN(0);
+ }
+
+ if (key_part->field != field)
DBUG_RETURN(0);
/* set flag to 1 if we can use read-next on key, else to -1 */
@@ -12260,7 +12394,8 @@ static int test_if_order_by_key(ORDER *order, TABLE *table, uint idx,
reverse=flag; // Remember if reverse
key_part++;
}
- *used_key_parts= (uint) (key_part - table->key_info[idx].key_part);
+ *used_key_parts= on_primary_key ? table->key_info[idx].key_parts :
+ (uint) (key_part - table->key_info[idx].key_part);
if (reverse == -1 && !(table->file->index_flags(idx, *used_key_parts-1, 1) &
HA_READ_PREV))
reverse= 0; // Index can't be used
@@ -12509,9 +12644,12 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
{
int ref_key;
uint ref_key_parts;
+ int order_direction;
+ uint used_key_parts;
TABLE *table=tab->table;
SQL_SELECT *select=tab->select;
key_map usable_keys;
+ QUICK_SELECT_I *save_quick= 0;
DBUG_ENTER("test_if_skip_sort_order");
LINT_INIT(ref_key_parts);
@@ -12546,6 +12684,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
else if (select && select->quick) // Range found by opt_range
{
int quick_type= select->quick->get_type();
+ save_quick= select->quick;
/*
assume results are not ordered when index merge is used
TODO: sergeyp: Results of all index merge selects actually are ordered
@@ -12565,8 +12704,6 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
/*
We come here when there is a REF key.
*/
- int order_direction;
- uint used_key_parts;
if (!usable_keys.is_set(ref_key))
{
/*
@@ -12627,63 +12764,33 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
}
/* Check if we get the rows in requested sorted order by using the key */
if (usable_keys.is_set(ref_key) &&
- (order_direction = test_if_order_by_key(order,table,ref_key,
- &used_key_parts)))
- {
- if (order_direction == -1) // If ORDER BY ... DESC
- {
- if (select && select->quick)
- {
- /*
- Don't reverse the sort order, if it's already done.
- (In some cases test_if_order_by_key() can be called multiple times
- */
- if (!select->quick->reverse_sorted())
- {
- QUICK_SELECT_DESC *tmp;
- int quick_type= select->quick->get_type();
- if (quick_type == QUICK_SELECT_I::QS_TYPE_INDEX_MERGE ||
- quick_type == QUICK_SELECT_I::QS_TYPE_ROR_INTERSECT ||
- quick_type == QUICK_SELECT_I::QS_TYPE_ROR_UNION ||
- quick_type == QUICK_SELECT_I::QS_TYPE_GROUP_MIN_MAX)
- DBUG_RETURN(0); // Use filesort
-
- /* ORDER BY range_key DESC */
- tmp= new QUICK_SELECT_DESC((QUICK_RANGE_SELECT*)(select->quick),
- used_key_parts);
- if (!tmp || tmp->error)
- {
- delete tmp;
- DBUG_RETURN(0); // Reverse sort not supported
- }
- select->quick=tmp;
- }
- DBUG_RETURN(1);
- }
- if (tab->ref.key_parts < used_key_parts)
- {
- /*
- SELECT * FROM t1 WHERE a=1 ORDER BY a DESC,b DESC
-
- Use a traversal function that starts by reading the last row
- with key part (A) and then traverse the index backwards.
- */
- tab->read_first_record= join_read_last_key;
- tab->read_record.read_record= join_read_prev_same;
- /* fall through */
- }
- }
- else if (select && select->quick)
- select->quick->sorted= 1;
- DBUG_RETURN(1); /* No need to sort */
- }
+ (order_direction= test_if_order_by_key(order,table,ref_key,
+ &used_key_parts)))
+ goto check_reverse_order;
}
- else
{
- /* check if we can use a key to resolve the group */
- /* Tables using JT_NEXT are handled here */
+ /*
+ Check whether there is an index compatible with the given order
+ usage of which is cheaper than usage of the ref_key index (ref_key>=0)
+ or a table scan.
+ It may be the case if ORDER/GROUP BY is used with LIMIT.
+ */
uint nr;
key_map keys;
+ uint best_key_parts;
+ int best_key_direction;
+ ha_rows best_records;
+ double read_time;
+ int best_key= -1;
+ bool is_best_covering= FALSE;
+ double fanout= 1;
+ JOIN *join= tab->join;
+ uint tablenr= tab - join->join_tab;
+ ha_rows table_records= table->file->stats.records;
+ bool group= join->group && order == join->group_list;
+ LINT_INIT(best_key_parts);
+ LINT_INIT(best_key_direction);
+ LINT_INIT(best_records);
/*
filesort() and join cache are usually faster than reading in
@@ -12696,7 +12803,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
resolved with a key; This is because filesort() is usually faster than
retrieving all rows through an index.
*/
- if (select_limit >= table->file->stats.records)
+ if (select_limit >= table_records)
{
keys= *table->file->keys_to_use_for_scanning();
keys.merge(table->covering_keys);
@@ -12707,38 +12814,227 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
This is to allow users to use index in ORDER BY.
*/
if (table->force_index)
- keys.merge(table->keys_in_use_for_query);
+ keys.merge(group ? table->keys_in_use_for_group_by :
+ table->keys_in_use_for_order_by);
keys.intersect(usable_keys);
}
else
keys= usable_keys;
+ read_time= join->best_positions[tablenr].read_time;
+ for (uint i= tablenr+1; i < join->tables; i++)
+ fanout*= join->best_positions[i].records_read; // fanout is always >= 1
+
for (nr=0; nr < table->s->keys ; nr++)
{
- uint not_used;
- if (keys.is_set(nr))
+ int direction;
+ if (keys.is_set(nr) &&
+ (direction= test_if_order_by_key(order, table, nr, &used_key_parts)))
+ {
+ bool is_covering= table->covering_keys.is_set(nr) ||
+ nr == table->s->primary_key &&
+ table->file->primary_key_is_clustered();
+
+ /*
+ Don't use an index scan with ORDER BY without limit.
+ For GROUP BY without limit always use index scan
+ if there is a suitable index.
+ Why we hold to this asymmetry hardly can be explained
+ rationally. It's easy to demonstrate that using
+ temporary table + filesort could be cheaper for grouping
+ queries too.
+ */
+ if (is_covering ||
+ select_limit != HA_POS_ERROR ||
+ ref_key < 0 && (group || table->force_index))
+ {
+ double rec_per_key;
+ double index_scan_time;
+ KEY *keyinfo= tab->table->key_info+nr;
+ if (select_limit == HA_POS_ERROR)
+ select_limit= table_records;
+ if (group)
+ {
+ rec_per_key= keyinfo->rec_per_key[used_key_parts-1];
+ set_if_bigger(rec_per_key, 1);
+ /*
+ With a grouping query each group containing on average
+ rec_per_key records produces only one row that will
+ be included into the result set.
+ */
+ if (select_limit > table_records/rec_per_key)
+ select_limit= table_records;
+ else
+ select_limit= (ha_rows) (select_limit*rec_per_key);
+ }
+ /*
+ If tab=tk is not the last joined table tn then to get first
+ L records from the result set we can expect to retrieve
+ only L/fanout(tk,tn) where fanout(tk,tn) says how many
+ rows in the record set on average will match each row tk.
+ Usually our estimates for fanouts are too pessimistic.
+ So the estimate for L/fanout(tk,tn) will be too optimistic
+ and as result we'll choose an index scan when using ref/range
+ access + filesort will be cheaper.
+ */
+ select_limit= (ha_rows) (select_limit < fanout ?
+ 1 : select_limit/fanout);
+ /*
+ We assume that each of the tested indexes is not correlated
+ with ref_key. Thus, to select first N records we have to scan
+ N/selectivity(ref_key) index entries.
+ selectivity(ref_key) = #scanned_records/#table_records =
+ table->quick_condition_rows/table_records.
+ In any case we can't select more than #table_records.
+ N/(table->quick_condition_rows/table_records) > table_records
+ <=> N > table->quick_condition_rows.
+ */
+ if (select_limit > table->quick_condition_rows)
+ select_limit= table_records;
+ else
+ select_limit= (ha_rows) (select_limit *
+ (double) table_records /
+ table->quick_condition_rows);
+ rec_per_key= keyinfo->rec_per_key[keyinfo->key_parts-1];
+ set_if_bigger(rec_per_key, 1);
+ /*
+ Here we take into account the fact that rows are
+ accessed in sequences rec_per_key records in each.
+ Rows in such a sequence are supposed to be ordered
+ by rowid/primary key. When reading the data
+ in a sequence we'll touch not more pages than the
+ table file contains.
+ TODO. Use the formula for a disk sweep sequential access
+ to calculate the cost of accessing data rows for one
+ index entry.
+ */
+ index_scan_time= select_limit/rec_per_key *
+ min(rec_per_key, table->file->scan_time());
+ if (is_covering ||
+ ref_key < 0 && (group || table->force_index) ||
+ index_scan_time < read_time)
+ {
+ ha_rows quick_records= table_records;
+ if (is_best_covering && !is_covering)
+ continue;
+ if (table->quick_keys.is_set(nr))
+ quick_records= table->quick_rows[nr];
+ if (best_key < 0 ||
+ (select_limit <= min(quick_records,best_records) ?
+ keyinfo->key_parts < best_key_parts :
+ quick_records < best_records))
+ {
+ best_key= nr;
+ best_key_parts= keyinfo->key_parts;
+ best_records= quick_records;
+ is_best_covering= is_covering;
+ best_key_direction= direction;
+ }
+ }
+ }
+ }
+ }
+ if (best_key >= 0)
+ {
+ bool quick_created= FALSE;
+ if (table->quick_keys.is_set(best_key) && best_key != ref_key)
{
- int flag;
- if ((flag= test_if_order_by_key(order, table, nr, &not_used)))
+ key_map map;
+ map.clear_all(); // Force the creation of quick select
+ map.set_bit(best_key); // only best_key.
+ quick_created=
+ select->test_quick_select(join->thd, map, 0,
+ join->select_options & OPTION_FOUND_ROWS ?
+ HA_POS_ERROR :
+ join->unit->select_limit_cnt,
+ 0) > 0;
+ }
+ if (!no_changes)
+ {
+ if (!quick_created)
{
- if (!no_changes)
- {
- tab->index=nr;
- tab->read_first_record= (flag > 0 ? join_read_first:
- join_read_last);
- tab->type=JT_NEXT; // Read with index_first(), index_next()
- if (table->covering_keys.is_set(nr))
- {
- table->key_read=1;
- table->file->extra(HA_EXTRA_KEYREAD);
- }
- }
- DBUG_RETURN(1);
+ tab->index= best_key;
+ tab->read_first_record= best_key_direction > 0 ?
+ join_read_first:join_read_last;
+ tab->type=JT_NEXT; // Read with index_first(), index_next()
+ if (table->covering_keys.is_set(best_key))
+ {
+ table->key_read=1;
+ table->file->extra(HA_EXTRA_KEYREAD);
+ }
+ table->file->ha_index_or_rnd_end();
+ if (join->select_options & SELECT_DESCRIBE)
+ {
+ tab->ref.key= -1;
+ tab->ref.key_parts= 0;
+ if (select && select->quick)
+ {
+ delete select->quick;
+ select->quick= 0;
+ }
+ if (select_limit < table_records)
+ tab->limit= select_limit;
+ }
+ }
+ }
+ used_key_parts= best_key_parts;
+ order_direction= best_key_direction;
+ }
+ else
+ DBUG_RETURN(0);
+ }
+
+check_reverse_order:
+ if (order_direction == -1) // If ORDER BY ... DESC
+ {
+ if (select && select->quick)
+ {
+ /*
+ Don't reverse the sort order, if it's already done.
+ (In some cases test_if_order_by_key() can be called multiple times
+ */
+ if (!select->quick->reverse_sorted())
+ {
+ QUICK_SELECT_DESC *tmp;
+ int quick_type= select->quick->get_type();
+ if (quick_type == QUICK_SELECT_I::QS_TYPE_INDEX_MERGE ||
+ quick_type == QUICK_SELECT_I::QS_TYPE_ROR_INTERSECT ||
+ quick_type == QUICK_SELECT_I::QS_TYPE_ROR_UNION ||
+ quick_type == QUICK_SELECT_I::QS_TYPE_GROUP_MIN_MAX)
+ {
+ tab->limit= 0;
+ select->quick= save_quick;
+ DBUG_RETURN(0); // Use filesort
+ }
+
+ /* ORDER BY range_key DESC */
+ tmp= new QUICK_SELECT_DESC((QUICK_RANGE_SELECT*)(select->quick),
+ used_key_parts);
+ if (!tmp || tmp->error)
+ {
+ delete tmp;
+ select->quick= save_quick;
+ tab->limit= 0;
+ DBUG_RETURN(0); // Reverse sort not supported
}
+ select->quick=tmp;
}
}
+ else if (tab->ref.key >= 0 && tab->ref.key_parts <= used_key_parts)
+ {
+ /*
+ SELECT * FROM t1 WHERE a=1 ORDER BY a DESC,b DESC
+
+ Use a traversal function that starts by reading the last row
+ with key part (A) and then traverse the index backwards.
+ */
+ tab->read_first_record= join_read_last_key;
+ tab->read_record.read_record= join_read_prev_same;
+ }
}
- DBUG_RETURN(0); // Can't use index.
+ else if (select && select->quick)
+ select->quick->sorted= 1;
+ DBUG_RETURN(1);
}
@@ -12791,10 +13087,14 @@ create_sort_index(THD *thd, JOIN *join, ORDER *order,
/*
When there is SQL_BIG_RESULT do not sort using index for GROUP BY,
- and thus force sorting on disk.
+ and thus force sorting on disk unless a group min-max optimization
+ is going to be used as it is applied now only for one table queries
+ with covering indexes.
*/
if ((order != join->group_list ||
- !(join->select_options & SELECT_BIG_RESULT)) &&
+ !(join->select_options & SELECT_BIG_RESULT) ||
+ select && select->quick &&
+ select->quick->get_type() == QUICK_SELECT_I::QS_TYPE_GROUP_MIN_MAX) &&
test_if_skip_sort_order(tab,order,select_limit,0,
is_order_by ? &table->keys_in_use_for_order_by :
&table->keys_in_use_for_group_by))
@@ -12844,7 +13144,6 @@ create_sort_index(THD *thd, JOIN *join, ORDER *order,
/* Fill schema tables with data before filesort if it's necessary */
if ((join->select_lex->options & OPTION_SCHEMA_TABLE) &&
- !thd->lex->describe &&
get_schema_tables_result(join, PROCESSED_BY_CREATE_SORT_INDEX))
goto err;
@@ -12972,7 +13271,7 @@ remove_duplicates(JOIN *join, TABLE *entry,List<Item> &fields, Item *having)
field_count++;
}
- if (!field_count && !(join->select_options & OPTION_FOUND_ROWS))
+ if (!field_count && !(join->select_options & OPTION_FOUND_ROWS) && !having)
{ // only const items with no OPTION_FOUND_ROWS
join->unit->select_limit_cnt= 1; // Only send first row
DBUG_RETURN(0);
@@ -12985,7 +13284,7 @@ remove_duplicates(JOIN *join, TABLE *entry,List<Item> &fields, Item *having)
free_io_cache(entry); // Safety
entry->file->info(HA_STATUS_VARIABLE);
- if (entry->s->db_type == heap_hton ||
+ if (entry->s->db_type() == heap_hton ||
(!entry->s->blob_fields &&
((ALIGN_SIZE(reclength) + HASH_OVERHEAD) * entry->file->stats.records <
thd->variables.sortbuff_size)))
@@ -13006,7 +13305,7 @@ static int remove_dup_with_compare(THD *thd, TABLE *table, Field **first_field,
{
handler *file=table->file;
char *org_record,*new_record;
- byte *record;
+ uchar *record;
int error;
ulong reclength= table->s->reclength-offset;
DBUG_ENTER("remove_dup_with_compare");
@@ -13097,7 +13396,7 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table,
ulong key_length,
Item *having)
{
- byte *key_buffer, *key_pos, *record=table->record[0];
+ uchar *key_buffer, *key_pos, *record=table->record[0];
int error;
handler *file= table->file;
ulong extra_length= ALIGN_SIZE(key_length)-key_length;
@@ -13141,7 +13440,7 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table,
key_pos=key_buffer;
for (;;)
{
- byte *org_key_pos;
+ uchar *org_key_pos;
if (thd->killed)
{
thd->send_kill_message();
@@ -13168,7 +13467,7 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table,
field_length=field_lengths;
for (Field **ptr= first_field ; *ptr ; ptr++)
{
- (*ptr)->sort_string((char*) key_pos,*field_length);
+ (*ptr)->sort_string(key_pos,*field_length);
key_pos+= *field_length++;
}
/* Check if it exists before */
@@ -13249,7 +13548,8 @@ static int
join_init_cache(THD *thd,JOIN_TAB *tables,uint table_count)
{
reg1 uint i;
- uint length,blobs,size;
+ uint length, blobs;
+ size_t size;
CACHE_FIELD *copy,**blob_ptr;
JOIN_CACHE *cache;
JOIN_TAB *join_tab;
@@ -13271,7 +13571,7 @@ join_init_cache(THD *thd,JOIN_TAB *tables,uint table_count)
sizeof(CACHE_FIELD*))))
{
- my_free((gptr) cache->buff,MYF(0)); /* purecov: inspected */
+ my_free((uchar*) cache->buff,MYF(0)); /* purecov: inspected */
cache->buff=0; /* purecov: inspected */
DBUG_RETURN(1); /* purecov: inspected */
}
@@ -13304,7 +13604,7 @@ join_init_cache(THD *thd,JOIN_TAB *tables,uint table_count)
/* Copy null bits from table */
if (null_fields && tables[i].table->s->null_fields)
{ /* must copy null bits */
- copy->str=(char*) tables[i].table->null_flags;
+ copy->str= tables[i].table->null_flags;
copy->length= tables[i].table->s->null_bytes;
copy->strip=0;
copy->blob_field=0;
@@ -13315,7 +13615,7 @@ join_init_cache(THD *thd,JOIN_TAB *tables,uint table_count)
/* If outer join table, copy null_row flag */
if (tables[i].table->maybe_null)
{
- copy->str= (char*) &tables[i].table->null_row;
+ copy->str= (uchar*) &tables[i].table->null_row;
copy->length=sizeof(tables[i].table->null_row);
copy->strip=0;
copy->blob_field=0;
@@ -13365,7 +13665,7 @@ store_record_in_cache(JOIN_CACHE *cache)
length=cache->length;
if (cache->blobs)
length+=used_blob_length(cache->blob_ptr);
- if ((last_record=(length+cache->length > (uint) (cache->end - pos))))
+ if ((last_record= (length + cache->length > (size_t) (cache->end - pos))))
cache->ptr_record=cache->records;
/*
@@ -13378,13 +13678,13 @@ store_record_in_cache(JOIN_CACHE *cache)
{
if (last_record)
{
- copy->blob_field->get_image((char*) pos,copy->length+sizeof(char*),
+ copy->blob_field->get_image(pos, copy->length+sizeof(char*),
copy->blob_field->charset());
pos+=copy->length+sizeof(char*);
}
else
{
- copy->blob_field->get_image((char*) pos,copy->length, // blob length
+ copy->blob_field->get_image(pos, copy->length, // blob length
copy->blob_field->charset());
memcpy(pos+copy->length,copy->str,copy->blob_length); // Blob data
pos+=copy->length+copy->blob_length;
@@ -13394,7 +13694,7 @@ store_record_in_cache(JOIN_CACHE *cache)
{
if (copy->strip)
{
- char *str,*end;
+ uchar *str,*end;
for (str=copy->str,end= str+copy->length;
end > str && end[-1] == ' ' ;
end--) ;
@@ -13411,7 +13711,7 @@ store_record_in_cache(JOIN_CACHE *cache)
}
}
cache->pos=pos;
- return last_record || (uint) (cache->end -pos) < cache->length;
+ return last_record || (size_t) (cache->end - pos) < cache->length;
}
@@ -13450,13 +13750,13 @@ read_cached_record(JOIN_TAB *tab)
{
if (last_record)
{
- copy->blob_field->set_image((char*) pos,copy->length+sizeof(char*),
+ copy->blob_field->set_image(pos, copy->length+sizeof(char*),
copy->blob_field->charset());
pos+=copy->length+sizeof(char*);
}
else
{
- copy->blob_field->set_ptr((char*) pos,(char*) pos+copy->length);
+ copy->blob_field->set_ptr(pos, pos+copy->length);
pos+=copy->length+copy->blob_field->get_length();
}
}
@@ -13859,11 +14159,12 @@ setup_new_fields(THD *thd, List<Item> &fields,
static ORDER *
create_distinct_group(THD *thd, Item **ref_pointer_array,
- ORDER *order_list, List<Item> &fields,
+ ORDER *order_list, List<Item> &fields,
+ List<Item> &all_fields,
bool *all_order_by_fields_used)
{
List_iterator<Item> li(fields);
- Item *item;
+ Item *item, **orig_ref_pointer_array= ref_pointer_array;
ORDER *order,*group,**prev;
*all_order_by_fields_used= 1;
@@ -13903,12 +14204,31 @@ create_distinct_group(THD *thd, Item **ref_pointer_array,
ORDER *ord=(ORDER*) thd->calloc(sizeof(ORDER));
if (!ord)
return 0;
- /*
- We have here only field_list (not all_field_list), so we can use
- simple indexing of ref_pointer_array (order in the array and in the
- list are same)
- */
- ord->item= ref_pointer_array;
+
+ if (item->type() == Item::FIELD_ITEM &&
+ item->field_type() == MYSQL_TYPE_BIT)
+ {
+ /*
+ Because HEAP tables can't index BIT fields we need to use an
+ additional hidden field for grouping because later it will be
+ converted to a LONG field. Original field will remain of the
+ BIT type and will be returned to a client.
+ */
+ Item_field *new_item= new Item_field(thd, (Item_field*)item);
+ int el= all_fields.elements;
+ orig_ref_pointer_array[el]= new_item;
+ all_fields.push_front(new_item);
+ ord->item= orig_ref_pointer_array + el;
+ }
+ else
+ {
+ /*
+ We have here only field_list (not all_field_list), so we can use
+ simple indexing of ref_pointer_array (order in the array and in the
+ list are same)
+ */
+ ord->item= ref_pointer_array;
+ }
ord->asc=1;
*prev=ord;
prev= &ord->next;
@@ -13926,8 +14246,8 @@ next_item:
*****************************************************************************/
void
-count_field_types(TMP_TABLE_PARAM *param, List<Item> &fields,
- bool reset_with_sum_func)
+count_field_types(SELECT_LEX *select_lex, TMP_TABLE_PARAM *param,
+ List<Item> &fields, bool reset_with_sum_func)
{
List_iterator<Item> li(fields);
Item *field;
@@ -13945,18 +14265,22 @@ count_field_types(TMP_TABLE_PARAM *param, List<Item> &fields,
if (! field->const_item())
{
Item_sum *sum_item=(Item_sum*) field->real_item();
- if (!sum_item->quick_group)
- param->quick_group=0; // UDF SUM function
- param->sum_func_count++;
- param->func_count++;
+ if (!sum_item->depended_from() ||
+ sum_item->depended_from() == select_lex)
+ {
+ if (!sum_item->quick_group)
+ param->quick_group=0; // UDF SUM function
+ param->sum_func_count++;
- for (uint i=0 ; i < sum_item->arg_count ; i++)
- {
- if (sum_item->args[0]->real_item()->type() == Item::FIELD_ITEM)
- param->field_count++;
- else
- param->func_count++;
- }
+ for (uint i=0 ; i < sum_item->arg_count ; i++)
+ {
+ if (sum_item->args[0]->real_item()->type() == Item::FIELD_ITEM)
+ param->field_count++;
+ else
+ param->func_count++;
+ }
+ }
+ param->func_count++;
}
}
else
@@ -14206,7 +14530,7 @@ setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param,
for (i= 0; (pos= li++); i++)
{
Field *field;
- char *tmp;
+ uchar *tmp;
Item *real_pos= pos->real_item();
if (real_pos->type() == Item::FIELD_ITEM)
{
@@ -14251,8 +14575,7 @@ setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param,
another extra byte to not get warnings from purify in
Field_string::val_int
*/
- tmp= (char*) sql_alloc(field->pack_length()+2);
- if (!tmp)
+ if (!(tmp= (uchar*) sql_alloc(field->pack_length()+2)))
goto err;
if (copy)
{
@@ -14418,7 +14741,9 @@ bool JOIN::make_sum_func_list(List<Item> &field_list, List<Item> &send_fields,
func= sum_funcs;
while ((item=it++))
{
- if (item->type() == Item::SUM_FUNC_ITEM && !item->const_item())
+ if (item->type() == Item::SUM_FUNC_ITEM && !item->const_item() &&
+ (!((Item_sum*) item)->depended_from() ||
+ ((Item_sum *)item)->depended_from() == select_lex))
*func++= (Item_sum*) item;
}
if (before_group_by && rollup.state == ROLLUP::STATE_INITED)
@@ -14493,6 +14818,13 @@ change_to_use_tmp_fields(THD *thd, Item **ref_pointer_array,
if (!item_field)
DBUG_RETURN(TRUE); // Fatal error
item_field->name= item->name;
+ if (item->type() == Item::REF_ITEM)
+ {
+ Item_field *ifield= (Item_field *) item_field;
+ Item_ref *iref= (Item_ref *) item;
+ ifield->table_name= iref->table_name;
+ ifield->db_name= iref->db_name;
+ }
#ifndef DBUG_OFF
if (!item_field->name)
{
@@ -14993,7 +15325,10 @@ bool JOIN::rollup_make_fields(List<Item> &fields_arg, List<Item> &sel_fields,
ref_array= ref_array_start;
}
- if (item->type() == Item::SUM_FUNC_ITEM && !item->const_item())
+ if (item->type() == Item::SUM_FUNC_ITEM && !item->const_item() &&
+ (!((Item_sum*) item)->depended_from() ||
+ ((Item_sum *)item)->depended_from() == select_lex))
+
{
/*
This is a top level summary function that must be replaced with
@@ -15281,6 +15616,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
{
JOIN_TAB *tab=join->join_tab+i;
TABLE *table=tab->table;
+ TABLE_LIST *table_list= tab->table->pos_in_table_list;
char buff[512];
char buff1[512], buff2[512], buff3[512];
char keylen_str_buf[64];
@@ -15416,37 +15752,64 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
}
else
{
- item_list.push_back(item_null);
+ if (table_list->schema_table &&
+ table_list->schema_table->i_s_requested_object & OPTIMIZE_I_S_TABLE)
+ {
+ const char *tmp_buff;
+ int f_idx;
+ if (table_list->has_db_lookup_value)
+ {
+ f_idx= table_list->schema_table->idx_field1;
+ tmp_buff= table_list->schema_table->fields_info[f_idx].field_name;
+ tmp2.append(tmp_buff, strlen(tmp_buff), cs);
+ }
+ if (table_list->has_table_lookup_value)
+ {
+ if (table_list->has_db_lookup_value)
+ tmp2.append(',');
+ f_idx= table_list->schema_table->idx_field2;
+ tmp_buff= table_list->schema_table->fields_info[f_idx].field_name;
+ tmp2.append(tmp_buff, strlen(tmp_buff), cs);
+ }
+ if (tmp2.length())
+ item_list.push_back(new Item_string(tmp2.ptr(),tmp2.length(),cs));
+ else
+ item_list.push_back(item_null);
+ }
+ else
+ item_list.push_back(item_null);
item_list.push_back(item_null);
item_list.push_back(item_null);
}
/* Add "rows" field to item_list. */
- ha_rows examined_rows;
- if (tab->select && tab->select->quick)
- examined_rows= tab->select->quick->records;
- else if (tab->type == JT_NEXT || tab->type == JT_ALL)
- examined_rows= tab->table->file->records();
+ if (table_list->schema_table)
+ {
+ item_list.push_back(item_null);
+ }
else
- examined_rows=(ha_rows)join->best_positions[i].records_read;
-
- item_list.push_back(new Item_int((longlong) (ulonglong) examined_rows,
- MY_INT64_NUM_DECIMAL_DIGITS));
-
- /* Add "filtered" field to item_list. */
- if (join->thd->lex->describe & DESCRIBE_EXTENDED)
{
- Item_float *filtered;
- float f;
- if (examined_rows)
- f= (float) (100.0 * join->best_positions[i].records_read /
- examined_rows);
+ ha_rows examined_rows;
+ if (tab->select && tab->select->quick)
+ examined_rows= tab->select->quick->records;
+ else if (tab->type == JT_NEXT || tab->type == JT_ALL)
+ examined_rows= tab->limit ? tab->limit : tab->table->file->records();
else
- f= 0.0;
- item_list.push_back((filtered= new Item_float(f)));
- filtered->decimals= 2;
- }
+ examined_rows=(ha_rows)join->best_positions[i].records_read;
+
+ item_list.push_back(new Item_int((longlong) (ulonglong) examined_rows,
+ MY_INT64_NUM_DECIMAL_DIGITS));
+ /* Add "filtered" field to item_list. */
+ if (join->thd->lex->describe & DESCRIBE_EXTENDED)
+ {
+ float f= 0.0;
+ if (examined_rows)
+ f= (float) (100.0 * join->best_positions[i].records_read /
+ examined_rows);
+ item_list.push_back(new Item_float(f, 2));
+ }
+ }
/* Build "Extra" field and add it to item_list. */
my_bool key_read=table->key_read;
@@ -15514,6 +15877,24 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
extra.append(STRING_WITH_LEN("; Using where"));
}
}
+ if (table_list->schema_table &&
+ table_list->schema_table->i_s_requested_object & OPTIMIZE_I_S_TABLE)
+ {
+ if (!table_list->table_open_method)
+ extra.append(STRING_WITH_LEN("; Skip_open_table"));
+ else if (table_list->table_open_method == OPEN_FRM_ONLY)
+ extra.append(STRING_WITH_LEN("; Open_frm_only"));
+ else
+ extra.append(STRING_WITH_LEN("; Open_full_table"));
+ if (table_list->has_db_lookup_value &&
+ table_list->has_table_lookup_value)
+ extra.append(STRING_WITH_LEN("; Scanned 0 databases"));
+ else if (table_list->has_db_lookup_value ||
+ table_list->has_table_lookup_value)
+ extra.append(STRING_WITH_LEN("; Scanned 1 database"));
+ else
+ extra.append(STRING_WITH_LEN("; Scanned all databases"));
+ }
if (key_read)
{
if (quick_type == QUICK_SELECT_I::QS_TYPE_GROUP_MIN_MAX)
@@ -15544,8 +15925,8 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
break;
}
}
- if (tab->next_select == sub_select_cache)
- extra.append(STRING_WITH_LEN("; Using join cache"));
+ if (i > 0 && tab[-1].next_select == sub_select_cache)
+ extra.append(STRING_WITH_LEN("; Using join buffer"));
/* Skip initial "; "*/
const char *str= extra.ptr();
@@ -15685,11 +16066,11 @@ static void print_join(THD *thd, String *str, List<TABLE_LIST> *tables)
Print table as it should be in join list
SYNOPSIS
- st_table_list::print();
+ TABLE_LIST::print();
str string where table should bbe printed
*/
-void st_table_list::print(THD *thd, String *str)
+void TABLE_LIST::print(THD *thd, String *str)
{
if (nested_join)
{
@@ -15895,3 +16276,7 @@ bool JOIN::change_result(select_result *res)
}
DBUG_RETURN(FALSE);
}
+
+/**
+ @} (end of group Query_Optimizer)
+*/
diff --git a/sql/sql_select.h b/sql/sql_select.h
index 644224d1bed..efa92432e2b 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -56,8 +56,8 @@ typedef struct st_table_ref
uint key_parts; // num of ...
uint key_length; // length of key_buff
int key; // key no
- byte *key_buff; // value to look for with key
- byte *key_buff2; // key_buff+key_length
+ uchar *key_buff; // value to look for with key
+ uchar *key_buff2; // key_buff+key_length
store_key **key_copy; //
Item **items; // val()'s for each keypart
/*
@@ -79,7 +79,7 @@ typedef struct st_table_ref
key_part_map null_rejecting;
table_map depend_map; // Table depends on these tables.
/* null byte position in the key_buf. Used for REF_OR_NULL optimization */
- byte *null_ref_key;
+ uchar *null_ref_key;
} TABLE_REF;
@@ -89,8 +89,8 @@ typedef struct st_table_ref
*/
typedef struct st_cache_field {
- char *str;
- uint length,blob_length;
+ uchar *str;
+ uint length, blob_length;
Field_blob *blob_field;
bool strip;
} CACHE_FIELD;
@@ -160,6 +160,13 @@ typedef struct st_join_table {
Read_record_func read_first_record;
Next_select_func next_select;
READ_RECORD read_record;
+ /*
+ Currently the following two fields are used only for a [NOT] IN subquery
+ 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 */
double worst_seeks;
key_map const_keys; /* Keys with constant part */
key_map checked_keys; /* Keys checked in find_best */
@@ -187,6 +194,12 @@ typedef struct st_join_table {
enum join_type type;
bool cached_eq_ref_table,eq_ref_table,not_used_in_distinct;
bool sorted;
+ /*
+ If it's not 0 the number stored this field indicates that the index
+ scan has been chosen to access the table data and we expect to scan
+ this number of rows for the table.
+ */
+ ha_rows limit;
TABLE_REF ref;
JOIN_CACHE cache;
JOIN *join;
@@ -309,11 +322,27 @@ public:
SELECT_LEX_UNIT *unit;
// select that processed
SELECT_LEX *select_lex;
+ /*
+ TRUE <=> optimizer must not mark any table as a constant table.
+ This is needed for subqueries in form "a IN (SELECT .. UNION SELECT ..):
+ when we optimize the select that reads the results of the union from a
+ temporary table, we must not mark the temp. table as constant because
+ the number of rows in it may vary from one subquery execution to another.
+ */
+ bool no_const_tables;
JOIN *tmp_join; // copy of this JOIN to be used with temporary tables
ROLLUP rollup; // Used with rollup
bool select_distinct; // Set if SELECT DISTINCT
+ /*
+ If we have the GROUP BY statement in the query,
+ but the group_list was emptied by optimizer, this
+ flag is TRUE.
+ It happens when fields in the GROUP BY are from
+ constant table
+ */
+ bool group_optimized_away;
/*
simple_xxxxx is set if ORDER/GROUP BY doesn't include any references
@@ -422,6 +451,7 @@ public:
zero_result_cause= 0;
optimized= 0;
cond_equal= 0;
+ group_optimized_away= 0;
all_fields= fields_arg;
fields_list= fields_arg;
@@ -429,6 +459,8 @@ public:
tmp_table_param.init();
tmp_table_param.end_write_records= HA_POS_ERROR;
rollup.state= ROLLUP::STATE_NONE;
+
+ no_const_tables= FALSE;
}
int prepare(Item ***rref_pointer_array, TABLE_LIST *tables, uint wind_num,
@@ -502,8 +534,8 @@ TABLE *create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
ulonglong select_options, ha_rows rows_limit,
char* alias);
void free_tmp_table(THD *thd, TABLE *entry);
-void count_field_types(TMP_TABLE_PARAM *param, List<Item> &fields,
- bool reset_with_sum_func);
+void count_field_types(SELECT_LEX *select_lex, TMP_TABLE_PARAM *param,
+ List<Item> &fields, bool reset_with_sum_func);
bool setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param,
Item **ref_pointer_array,
List<Item> &new_list1, List<Item> &new_list2,
@@ -531,20 +563,20 @@ class store_key :public Sql_alloc
public:
bool null_key; /* TRUE <=> the value of the key has a null part */
enum store_key_result { STORE_KEY_OK, STORE_KEY_FATAL, STORE_KEY_CONV };
- store_key(THD *thd, Field *field_arg, char *ptr, char *null, uint length)
+ store_key(THD *thd, Field *field_arg, uchar *ptr, uchar *null, uint length)
:null_key(0), null_ptr(null), err(0)
{
if (field_arg->type() == MYSQL_TYPE_BLOB)
{
/* Key segments are always packed with a 2 byte length prefix */
- to_field= new Field_varstring(ptr, length, 2, (uchar*) null, 1,
+ to_field= new Field_varstring(ptr, length, 2, null, 1,
Field::NONE, field_arg->field_name,
field_arg->table->s, field_arg->charset());
to_field->init(field_arg->table);
}
else
to_field=field_arg->new_key_field(thd->mem_root, field_arg->table,
- ptr, (uchar*) null, 1);
+ ptr, null, 1);
}
virtual ~store_key() {} /* Not actually needed */
virtual const char *name() const=0;
@@ -572,8 +604,8 @@ public:
protected:
Field *to_field; // Store data here
- char *null_ptr;
- char err;
+ uchar *null_ptr;
+ uchar err;
virtual enum store_key_result copy_inner()=0;
};
@@ -584,11 +616,12 @@ class store_key_field: public store_key
Copy_field copy_field;
const char *field_name;
public:
- store_key_field(THD *thd, Field *to_field_arg, char *ptr, char *null_ptr_arg,
+ store_key_field(THD *thd, Field *to_field_arg, uchar *ptr,
+ uchar *null_ptr_arg,
uint length, Field *from_field, const char *name_arg)
:store_key(thd, to_field_arg,ptr,
null_ptr_arg ? null_ptr_arg : from_field->maybe_null() ? &err
- : NullS,length), field_name(name_arg)
+ : (uchar*) 0, length), field_name(name_arg)
{
if (to_field)
{
@@ -616,11 +649,11 @@ class store_key_item :public store_key
protected:
Item *item;
public:
- store_key_item(THD *thd, Field *to_field_arg, char *ptr, char *null_ptr_arg,
- uint length, Item *item_arg)
- :store_key(thd, to_field_arg,ptr,
+ store_key_item(THD *thd, Field *to_field_arg, uchar *ptr,
+ uchar *null_ptr_arg, uint length, Item *item_arg)
+ :store_key(thd, to_field_arg, ptr,
null_ptr_arg ? null_ptr_arg : item_arg->maybe_null ?
- &err : NullS, length), item(item_arg)
+ &err : (uchar*) 0, length), item(item_arg)
{}
const char *name() const { return "func"; }
@@ -642,12 +675,12 @@ class store_key_const_item :public store_key_item
{
bool inited;
public:
- store_key_const_item(THD *thd, Field *to_field_arg, char *ptr,
- char *null_ptr_arg, uint length,
+ store_key_const_item(THD *thd, Field *to_field_arg, uchar *ptr,
+ uchar *null_ptr_arg, uint length,
Item *item_arg)
:store_key_item(thd, to_field_arg,ptr,
null_ptr_arg ? null_ptr_arg : item_arg->maybe_null ?
- &err : NullS, length, item_arg), inited(0)
+ &err : (uchar*) 0, length, item_arg), inited(0)
{
}
const char *name() const { return "const"; }
diff --git a/sql/sql_servers.cc b/sql/sql_servers.cc
index a62ce98850b..a780c561ffe 100644
--- a/sql/sql_servers.cc
+++ b/sql/sql_servers.cc
@@ -77,7 +77,7 @@ static void merge_server_struct(FOREIGN_SERVER *from, FOREIGN_SERVER *to);
-static byte *servers_cache_get_key(FOREIGN_SERVER *server, uint *length,
+static uchar *servers_cache_get_key(FOREIGN_SERVER *server, size_t *length,
my_bool not_used __attribute__((unused)))
{
DBUG_ENTER("servers_cache_get_key");
@@ -86,7 +86,7 @@ static byte *servers_cache_get_key(FOREIGN_SERVER *server, uint *length,
server->server_name));
*length= (uint) server->server_name_length;
- DBUG_RETURN((byte*) server->server_name);
+ DBUG_RETURN((uchar*) server->server_name);
}
@@ -323,7 +323,7 @@ get_server_from_table_to_cache(TABLE *table)
DBUG_PRINT("info", ("server->username %s", server->username));
DBUG_PRINT("info", ("server->password %s", server->password));
DBUG_PRINT("info", ("server->socket %s", server->socket));
- if (my_hash_insert(&servers_cache, (byte*) server))
+ if (my_hash_insert(&servers_cache, (uchar*) server))
{
DBUG_PRINT("info", ("had a problem inserting server %s at %lx",
server->server_name, (long unsigned int) server));
@@ -366,7 +366,7 @@ insert_server(THD *thd, FOREIGN_SERVER *server)
tables.alias= tables.table_name= (char*) "servers";
/* need to open before acquiring THR_LOCK_plugin or it will deadlock */
- if (! (table= open_ltable(thd, &tables, TL_WRITE)))
+ if (! (table= open_ltable(thd, &tables, TL_WRITE, 0)))
goto end;
/* insert the server into the table */
@@ -411,7 +411,7 @@ insert_server_record_into_cache(FOREIGN_SERVER *server)
DBUG_PRINT("info", ("inserting server %s at %lx, length %d",
server->server_name, (long unsigned int) server,
server->server_name_length));
- if (my_hash_insert(&servers_cache, (byte*) server))
+ if (my_hash_insert(&servers_cache, (uchar*) server))
{
DBUG_PRINT("info", ("had a problem inserting server %s at %lx",
server->server_name, (long unsigned int) server));
@@ -516,9 +516,10 @@ int insert_server_record(TABLE *table, FOREIGN_SERVER *server)
system_charset_info);
/* read index until record is that specified in server_name */
- if ((error= table->file->index_read_idx(table->record[0], 0,
- (byte *)table->field[0]->ptr, HA_WHOLE_KEY,
- HA_READ_KEY_EXACT)))
+ if ((error= table->file->index_read_idx_map(table->record[0], 0,
+ (uchar *)table->field[0]->ptr,
+ HA_WHOLE_KEY,
+ HA_READ_KEY_EXACT)))
{
/* if not found, err */
if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE)
@@ -588,7 +589,7 @@ int drop_server(THD *thd, LEX_SERVER_OPTIONS *server_options)
if ((error= delete_server_record_in_cache(server_options)))
goto end;
- if (! (table= open_ltable(thd, &tables, TL_WRITE)))
+ if (! (table= open_ltable(thd, &tables, TL_WRITE, 0)))
{
error= my_errno;
goto end;
@@ -642,7 +643,7 @@ delete_server_record_in_cache(LEX_SERVER_OPTIONS *server_options)
if (!(server= (FOREIGN_SERVER *) hash_search(&servers_cache,
- (byte*) server_options->server_name,
+ (uchar*) server_options->server_name,
server_options->server_name_length)))
{
DBUG_PRINT("info", ("server_name %s length %d not found!",
@@ -658,7 +659,7 @@ delete_server_record_in_cache(LEX_SERVER_OPTIONS *server_options)
server->server_name,
server->server_name_length));
- VOID(hash_delete(&servers_cache, (byte*) server));
+ VOID(hash_delete(&servers_cache, (uchar*) server));
error= 0;
@@ -705,7 +706,7 @@ int update_server(THD *thd, FOREIGN_SERVER *existing, FOREIGN_SERVER *altered)
tables.db= (char*)"mysql";
tables.alias= tables.table_name= (char*)"servers";
- if (!(table= open_ltable(thd, &tables, TL_WRITE)))
+ if (!(table= open_ltable(thd, &tables, TL_WRITE, 0)))
{
error= my_errno;
goto end;
@@ -765,12 +766,12 @@ int update_server_record_in_cache(FOREIGN_SERVER *existing,
/*
delete the existing server struct from the server cache
*/
- VOID(hash_delete(&servers_cache, (byte*)existing));
+ VOID(hash_delete(&servers_cache, (uchar*)existing));
/*
Insert the altered server struct into the server cache
*/
- if (my_hash_insert(&servers_cache, (byte*)altered))
+ if (my_hash_insert(&servers_cache, (uchar*)altered))
{
DBUG_PRINT("info", ("had a problem inserting server %s at %lx",
altered->server_name, (long unsigned int) altered));
@@ -858,9 +859,10 @@ update_server_record(TABLE *table, FOREIGN_SERVER *server)
server->server_name_length,
system_charset_info);
- if ((error= table->file->index_read_idx(table->record[0], 0,
- (byte *)table->field[0]->ptr, ~(longlong)0,
- HA_READ_KEY_EXACT)))
+ if ((error= table->file->index_read_idx_map(table->record[0], 0,
+ (uchar *)table->field[0]->ptr,
+ ~(longlong)0,
+ HA_READ_KEY_EXACT)))
{
if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE)
table->file->print_error(error, MYF(0));
@@ -872,11 +874,15 @@ update_server_record(TABLE *table, FOREIGN_SERVER *server)
/* ok, so we can update since the record exists in the table */
store_record(table,record[1]);
store_server_fields(table, server);
- if ((error=table->file->ha_update_row(table->record[1],table->record[0])))
+ if ((error=table->file->ha_update_row(table->record[1],
+ table->record[0])) &&
+ error != HA_ERR_RECORD_IS_THE_SAME)
{
DBUG_PRINT("info",("problems with ha_update_row %d", error));
goto end;
}
+ else
+ error= 0;
}
end:
@@ -910,9 +916,10 @@ delete_server_record(TABLE *table,
/* set the field that's the PK to the value we're looking for */
table->field[0]->store(server_name, server_name_length, system_charset_info);
- if ((error= table->file->index_read_idx(table->record[0], 0,
- (byte *)table->field[0]->ptr, HA_WHOLE_KEY,
- HA_READ_KEY_EXACT)))
+ if ((error= table->file->index_read_idx_map(table->record[0], 0,
+ (uchar *)table->field[0]->ptr,
+ HA_WHOLE_KEY,
+ HA_READ_KEY_EXACT)))
{
if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE)
table->file->print_error(error, MYF(0));
@@ -954,7 +961,7 @@ int create_server(THD *thd, LEX_SERVER_OPTIONS *server_options)
rw_wrlock(&THR_LOCK_servers);
/* hit the memory first */
- if (hash_search(&servers_cache, (byte*) server_options->server_name,
+ if (hash_search(&servers_cache, (uchar*) server_options->server_name,
server_options->server_name_length))
goto end;
@@ -1000,7 +1007,7 @@ int alter_server(THD *thd, LEX_SERVER_OPTIONS *server_options)
rw_wrlock(&THR_LOCK_servers);
if (!(existing= (FOREIGN_SERVER *) hash_search(&servers_cache,
- (byte*) name.str,
+ (uchar*) name.str,
name.length)))
goto end;
@@ -1260,7 +1267,7 @@ 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,
- (byte*) server_name,
+ (uchar*) server_name,
server_name_length)))
{
DBUG_PRINT("info", ("server_name %s length %d not found!",
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 46634cc36c9..071babc99c1 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -54,10 +54,12 @@ enum enum_i_s_events_fields
ISE_LAST_ALTERED,
ISE_LAST_EXECUTED,
ISE_EVENT_COMMENT,
- ISE_ORIGINATOR
+ ISE_ORIGINATOR,
+ ISE_CLIENT_CS,
+ ISE_CONNECTION_CL,
+ ISE_DB_CL
};
-
#ifndef NO_EMBEDDED_ACCESS_CHECKS
static const char *grant_names[]={
"select","insert","update","delete","create","drop","reload","shutdown",
@@ -79,81 +81,31 @@ append_algorithm(TABLE_LIST *table, String *buff);
** List all table types supported
***************************************************************************/
-static my_bool show_handlerton(THD *thd, st_plugin_int *plugin,
- void *arg)
-{
- handlerton *default_type= (handlerton *) arg;
- Protocol *protocol= thd->protocol;
- handlerton *hton= (handlerton *)plugin->data;
-
- if (!(hton->flags & HTON_HIDDEN))
- {
- protocol->prepare_for_resend();
- protocol->store(plugin->name.str, plugin->name.length,
- system_charset_info);
- const char *option_name= show_comp_option_name[(int) hton->state];
-
- if (hton->state == SHOW_OPTION_YES && default_type == hton)
- option_name= "DEFAULT";
- protocol->store(option_name, system_charset_info);
- protocol->store(plugin->plugin->descr, system_charset_info);
- protocol->store(hton->commit ? "YES" : "NO", system_charset_info);
- protocol->store(hton->prepare ? "YES" : "NO", system_charset_info);
- protocol->store(hton->savepoint_set ? "YES" : "NO", system_charset_info);
-
- return protocol->write() ? 1 : 0;
- }
- return 0;
-}
-
-bool mysqld_show_storage_engines(THD *thd)
-{
- List<Item> field_list;
- Protocol *protocol= thd->protocol;
- DBUG_ENTER("mysqld_show_storage_engines");
-
- field_list.push_back(new Item_empty_string("Engine",10));
- field_list.push_back(new Item_empty_string("Support",10));
- field_list.push_back(new Item_empty_string("Comment",80));
- field_list.push_back(new Item_empty_string("Transactions",3));
- field_list.push_back(new Item_empty_string("XA",3));
- field_list.push_back(new Item_empty_string("Savepoints",3));
-
- if (protocol->send_fields(&field_list,
- Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
- DBUG_RETURN(TRUE);
-
- if (plugin_foreach(thd, show_handlerton,
- MYSQL_STORAGE_ENGINE_PLUGIN, thd->variables.table_type))
- DBUG_RETURN(TRUE);
-
- send_eof(thd);
- DBUG_RETURN(FALSE);
-}
-
static int make_version_string(char *buf, int buf_length, uint version)
{
return my_snprintf(buf, buf_length, "%d.%d", version>>8,version&0xff);
}
-static my_bool show_plugins(THD *thd, st_plugin_int *plugin,
+static my_bool show_plugins(THD *thd, plugin_ref plugin,
void *arg)
{
TABLE *table= (TABLE*) arg;
- struct st_mysql_plugin *plug= plugin->plugin;
+ struct st_mysql_plugin *plug= plugin_decl(plugin);
+ struct st_plugin_dl *plugin_dl= plugin_dlib(plugin);
CHARSET_INFO *cs= system_charset_info;
char version_buf[20];
restore_record(table, s->default_values);
- table->field[0]->store(plugin->name.str, plugin->name.length, cs);
+ table->field[0]->store(plugin_name(plugin)->str,
+ plugin_name(plugin)->length, cs);
table->field[1]->store(version_buf,
make_version_string(version_buf, sizeof(version_buf), plug->version),
cs);
- switch (plugin->state) {
+ switch (plugin_state(plugin)) {
/* case PLUGIN_IS_FREED: does not happen */
case PLUGIN_IS_DELETED:
table->field[2]->store(STRING_WITH_LEN("DELETED"), cs);
@@ -175,14 +127,13 @@ static my_bool show_plugins(THD *thd, st_plugin_int *plugin,
make_version_string(version_buf, sizeof(version_buf),
*(uint *)plug->info), cs);
- if (plugin->plugin_dl)
+ if (plugin_dl)
{
- table->field[5]->store(plugin->plugin_dl->dl.str,
- plugin->plugin_dl->dl.length, cs);
+ table->field[5]->store(plugin_dl->dl.str, plugin_dl->dl.length, cs);
table->field[5]->set_notnull();
table->field[6]->store(version_buf,
make_version_string(version_buf, sizeof(version_buf),
- plugin->plugin_dl->version),
+ plugin_dl->version),
cs);
table->field[6]->set_notnull();
}
@@ -492,13 +443,15 @@ bool mysqld_show_column_types(THD *thd)
find_files_result
-find_files(THD *thd, List<char> *files, const char *db,
+find_files(THD *thd, List<LEX_STRING> *files, const char *db,
const char *path, const char *wild, bool dir)
{
uint i;
char *ext;
MY_DIR *dirp;
FILEINFO *file;
+ LEX_STRING *file_name= 0;
+ uint file_name_len;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
uint col_access=thd->col_access;
#endif
@@ -547,10 +500,16 @@ find_files(THD *thd, List<char> *files, const char *db,
#endif
if (!MY_S_ISDIR(file->mystat->st_mode))
continue;
- VOID(filename_to_tablename(file->name, uname, sizeof(uname)));
+
+ file_name_len= filename_to_tablename(file->name, uname, sizeof(uname));
if (wild && wild_compare(uname, wild, 0))
continue;
- file->name= uname;
+ if (!(file_name=
+ thd->make_lex_string(file_name, uname, file_name_len, TRUE)))
+ {
+ my_dirend(dirp);
+ DBUG_RETURN(FIND_FILES_OOM);
+ }
}
else
{
@@ -559,16 +518,15 @@ find_files(THD *thd, List<char> *files, const char *db,
is_prefix(file->name, tmp_file_prefix))
continue;
*ext=0;
- VOID(filename_to_tablename(file->name, uname, sizeof(uname)));
- file->name= uname;
+ file_name_len= filename_to_tablename(file->name, uname, sizeof(uname));
if (wild)
{
if (lower_case_table_names)
{
- if (wild_case_compare(files_charset_info, file->name, wild))
+ if (wild_case_compare(files_charset_info, uname, wild))
continue;
}
- else if (wild_compare(file->name,wild,0))
+ else if (wild_compare(uname, wild, 0))
continue;
}
}
@@ -578,14 +536,16 @@ find_files(THD *thd, List<char> *files, const char *db,
{
table_list.db= (char*) db;
table_list.db_length= strlen(db);
- table_list.table_name= file->name;
- table_list.table_name_length= strlen(file->name);
+ 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))
continue;
}
#endif
- if (files->push_back(thd->strdup(file->name)))
+ if (!(file_name=
+ thd->make_lex_string(file_name, uname, file_name_len, TRUE)) ||
+ files->push_back(file_name))
{
my_dirend(dirp);
DBUG_RETURN(FIND_FILES_OOM);
@@ -594,7 +554,7 @@ find_files(THD *thd, List<char> *files, const char *db,
DBUG_PRINT("info",("found: %d files", files->elements));
my_dirend(dirp);
- VOID(ha_find_files(thd,db,path,wild,dir,files));
+ VOID(ha_find_files(thd, db, path, wild, dir, files));
DBUG_RETURN(FIND_FILES_OK);
}
@@ -643,6 +603,10 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list)
}
buffer.length(0);
+
+ if (table_list->view)
+ buffer.set_charset(table_list->view_creation_ctx->get_client_cs());
+
if ((table_list->view ?
view_store_create_info(thd, table_list, &buffer) :
store_create_info(thd, table_list, &buffer, NULL)))
@@ -654,6 +618,10 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list)
field_list.push_back(new Item_empty_string("View",NAME_CHAR_LEN));
field_list.push_back(new Item_empty_string("Create View",
max(buffer.length(),1024)));
+ field_list.push_back(new Item_empty_string("character_set_client",
+ MY_CS_NAME_SIZE));
+ field_list.push_back(new Item_empty_string("collation_connection",
+ MY_CS_NAME_SIZE));
}
else
{
@@ -677,10 +645,24 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list)
else
protocol->store(table_list->table->alias, system_charset_info);
}
- protocol->store(buffer.ptr(), buffer.length(), buffer.charset());
+
+ if (table_list->view)
+ {
+ protocol->store(buffer.ptr(), buffer.length(),
+ table_list->view_creation_ctx->get_client_cs());
+
+ protocol->store(table_list->view_creation_ctx->get_client_cs()->csname,
+ system_charset_info);
+
+ protocol->store(table_list->view_creation_ctx->get_connection_cl()->name,
+ system_charset_info);
+ }
+ else
+ protocol->store(buffer.ptr(), buffer.length(), buffer.charset());
if (protocol->write())
DBUG_RETURN(TRUE);
+
send_eof(thd);
DBUG_RETURN(FALSE);
}
@@ -705,7 +687,7 @@ bool mysqld_show_create_db(THD *thd, char *dbname,
else
db_access= (acl_get(sctx->host, sctx->ip, sctx->priv_user, dbname, 0) |
sctx->master_access);
- if (!(db_access & DB_ACLS) && (!grant_option || check_grant_db(thd,dbname)))
+ if (!(db_access & DB_ACLS) && check_grant_db(thd,dbname))
{
my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
sctx->priv_user, sctx->host_or_ip, dbname);
@@ -830,7 +812,7 @@ mysqld_dump_create_info(THD *thd, TABLE_LIST *table_list, int fd)
}
else
{
- if (my_write(fd, (const byte*) packet->ptr(), packet->length(),
+ if (my_write(fd, (const uchar*) packet->ptr(), packet->length(),
MYF(MY_WME)))
DBUG_RETURN(-1);
}
@@ -893,7 +875,7 @@ append_identifier(THD *thd, String *packet, const char *name, uint length)
if (q == EOF)
{
- packet->append(name, length, system_charset_info);
+ packet->append(name, length, packet->charset());
return;
}
@@ -911,7 +893,7 @@ append_identifier(THD *thd, String *packet, const char *name, uint length)
uchar chr= (uchar) *name;
length= my_mbcharlen(system_charset_info, chr);
/*
- my_mbcharlen can retur 0 on a wrong multibyte
+ my_mbcharlen can return 0 on a wrong multibyte
sequence. It is possible when upgrading from 4.0,
and identifier contains some accented characters.
The manual says it does not work. So we'll just
@@ -921,7 +903,7 @@ append_identifier(THD *thd, String *packet, const char *name, uint length)
length= 1;
if (length == 1 && chr == (uchar) quote_char)
packet->append(&quote_char, 1, system_charset_info);
- packet->append(name, length, packet->charset());
+ packet->append(name, length, system_charset_info);
}
packet->append(&quote_char, 1, system_charset_info);
}
@@ -993,6 +975,60 @@ static void append_directory(THD *thd, String *packet, const char *dir_type,
#define LIST_PROCESS_HOST_LEN 64
+static bool get_field_default_value(THD *thd, TABLE *table,
+ Field *field, String *def_value,
+ bool quoted)
+{
+ bool has_default;
+ bool has_now_default;
+
+ /*
+ We are using CURRENT_TIMESTAMP instead of NOW because it is
+ more standard
+ */
+ has_now_default= table->timestamp_field == field &&
+ field->unireg_check != Field::TIMESTAMP_UN_FIELD;
+
+ has_default= (field->type() != FIELD_TYPE_BLOB &&
+ !(field->flags & NO_DEFAULT_VALUE_FLAG) &&
+ field->unireg_check != Field::NEXT_NUMBER &&
+ !((thd->variables.sql_mode & (MODE_MYSQL323 | MODE_MYSQL40))
+ && has_now_default));
+
+ def_value->length(0);
+ if (has_default)
+ {
+ if (has_now_default)
+ def_value->append(STRING_WITH_LEN("CURRENT_TIMESTAMP"));
+ else if (!field->is_null())
+ { // Not null by default
+ char tmp[MAX_FIELD_WIDTH];
+ String type(tmp, sizeof(tmp), field->charset());
+ field->val_str(&type);
+ if (type.length())
+ {
+ String def_val;
+ uint dummy_errors;
+ /* convert to system_charset_info == utf8 */
+ def_val.copy(type.ptr(), type.length(), field->charset(),
+ system_charset_info, &dummy_errors);
+ if (quoted)
+ append_unescaped(def_value, def_val.ptr(), def_val.length());
+ else
+ def_value->append(def_val.ptr(), def_val.length());
+ }
+ else if (quoted)
+ def_value->append(STRING_WITH_LEN("''"));
+ }
+ else if (field->maybe_null() && quoted)
+ def_value->append(STRING_WITH_LEN("NULL")); // Null as default
+ else
+ return 0;
+
+ }
+ return has_default;
+}
+
/*
Build a CREATE TABLE statement for a table.
@@ -1007,11 +1043,11 @@ static void append_directory(THD *thd, String *packet, const char *dir_type,
to tailor the format of the statement. Can be
NULL, in which case only SQL_MODE is considered
when building the statement.
-
+
NOTE
Currently always return 0, but might return error code in the
future.
-
+
RETURN
0 OK
*/
@@ -1020,9 +1056,10 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
HA_CREATE_INFO *create_info_arg)
{
List<Item> field_list;
- char tmp[MAX_FIELD_WIDTH], *for_str, buff[128];
+ char tmp[MAX_FIELD_WIDTH], *for_str, buff[128], def_value_buf[MAX_FIELD_WIDTH];
const char *alias;
String type(tmp, sizeof(tmp), system_charset_info);
+ String def_value(def_value_buf, sizeof(def_value_buf), system_charset_info);
Field **ptr,*field;
uint primary_key;
KEY *key_info;
@@ -1075,8 +1112,6 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
for (ptr=table->field ; (field= *ptr); ptr++)
{
- bool has_default;
- bool has_now_default;
uint flags = field->flags;
if (ptr != table->field)
@@ -1124,44 +1159,10 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
packet->append(STRING_WITH_LEN(" NULL"));
}
- /*
- Again we are using CURRENT_TIMESTAMP instead of NOW because it is
- more standard
- */
- has_now_default= table->timestamp_field == field &&
- field->unireg_check != Field::TIMESTAMP_UN_FIELD;
-
- has_default= (field->type() != MYSQL_TYPE_BLOB &&
- !(field->flags & NO_DEFAULT_VALUE_FLAG) &&
- field->unireg_check != Field::NEXT_NUMBER &&
- !((thd->variables.sql_mode & (MODE_MYSQL323 | MODE_MYSQL40))
- && has_now_default));
-
- if (has_default)
+ if (get_field_default_value(thd, table, field, &def_value, 1))
{
packet->append(STRING_WITH_LEN(" DEFAULT "));
- if (has_now_default)
- packet->append(STRING_WITH_LEN("CURRENT_TIMESTAMP"));
- else if (!field->is_null())
- { // Not null by default
- type.set(tmp, sizeof(tmp), field->charset());
- field->val_str(&type);
- if (type.length())
- {
- String def_val;
- uint dummy_errors;
- /* convert to system_charset_info == utf8 */
- def_val.copy(type.ptr(), type.length(), field->charset(),
- system_charset_info, &dummy_errors);
- append_unescaped(packet, def_val.ptr(), def_val.length());
- }
- else
- packet->append(STRING_WITH_LEN("''"));
- }
- else if (field->maybe_null())
- packet->append(STRING_WITH_LEN("NULL")); // Null as default
- else
- packet->append(tmp);
+ packet->append(def_value.ptr(), def_value.length(), system_charset_info);
}
if (!limited_mysql_mode && table->timestamp_field == field &&
@@ -1239,9 +1240,9 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
store_key_options(thd, packet, table, key_info);
if (key_info->parser)
{
+ LEX_STRING *parser_name= plugin_name(key_info->parser);
packet->append(STRING_WITH_LEN(" /*!50100 WITH PARSER "));
- append_identifier(thd, packet, key_info->parser->name.str,
- key_info->parser->name.length);
+ append_identifier(thd, packet, parser_name->str, parser_name->length);
packet->append(STRING_WITH_LEN(" */ "));
}
}
@@ -1374,6 +1375,11 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
packet->append(STRING_WITH_LEN(" ROW_FORMAT="));
packet->append(ha_row_type[(uint) share->row_type]);
}
+ if (share->transactional != HA_CHOICE_UNDEF)
+ {
+ packet->append(STRING_WITH_LEN(" TRANSACTIONAL="));
+ packet->append(share->transactional == HA_CHOICE_YES ? "1" : "0", 1);
+ }
if (table->s->key_block_size)
{
char *end;
@@ -1659,7 +1665,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
if (tmp->peer_port && (tmp_sctx->host || tmp_sctx->ip) &&
thd->security_ctx->host_or_ip[0])
{
- if ((thd_info->host= thd->alloc(LIST_PROCESS_HOST_LEN+1)))
+ if ((thd_info->host= (char*) thd->alloc(LIST_PROCESS_HOST_LEN+1)))
my_snprintf((char *) thd_info->host, LIST_PROCESS_HOST_LEN,
"%s:%u", tmp_sctx->host_or_ip, tmp->peer_port);
}
@@ -1690,11 +1696,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
if (mysys_var)
pthread_mutex_unlock(&mysys_var->mutex);
-#ifdef EXTRA_DEBUG
- thd_info->start_time= tmp->time_after_lock;
-#else
thd_info->start_time= tmp->start_time;
-#endif
thd_info->query=0;
if (tmp->query)
{
@@ -1713,7 +1715,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
VOID(pthread_mutex_unlock(&LOCK_thread_count));
thread_info *thd_info;
- time_t now= time(0);
+ time_t now= my_time(0);
while ((thd_info=thread_infos.get()))
{
protocol->prepare_for_resend();
@@ -1743,7 +1745,7 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, COND* cond)
TABLE *table= tables->table;
CHARSET_INFO *cs= system_charset_info;
char *user;
- time_t now= time(0);
+ time_t now= my_time(0);
DBUG_ENTER("fill_process_list");
user= thd->security_ctx->master_access & PROCESS_ACL ?
@@ -1911,8 +1913,8 @@ int add_status_vars(SHOW_VAR *list)
goto err;
}
while (list->name)
- res|= insert_dynamic(&all_status_vars, (gptr)list++);
- res|= insert_dynamic(&all_status_vars, (gptr)list); // appending NULL-element
+ res|= insert_dynamic(&all_status_vars, (uchar*)list++);
+ res|= insert_dynamic(&all_status_vars, (uchar*)list); // appending NULL-element
all_status_vars.elements--; // but next insert_dynamic should overwite it
if (status_vars_inited)
sort_dynamic(&all_status_vars, show_var_cmp);
@@ -1936,6 +1938,18 @@ void init_status_vars()
sort_dynamic(&all_status_vars, show_var_cmp);
}
+void reset_status_vars()
+{
+ SHOW_VAR *ptr= (SHOW_VAR*) all_status_vars.buffer;
+ SHOW_VAR *last= ptr + all_status_vars.elements;
+ for (; ptr < last; ptr++)
+ {
+ /* Note that SHOW_LONG_NOFLUSH variables are not reset */
+ if (ptr->type == SHOW_LONG)
+ *(ulong*) ptr->value= 0;
+ }
+}
+
/*
catch-all cleanup function, cleans up everything no matter what
@@ -2022,7 +2036,9 @@ static bool show_status_array(THD *thd, const char *wild,
const char *prefix, TABLE *table,
bool ucase_names)
{
- char buff[SHOW_VAR_FUNC_BUFF_SIZE], *prefix_end;
+ MY_ALIGNED_BYTE_ARRAY(buff_data, SHOW_VAR_FUNC_BUFF_SIZE, long);
+ char * const buff= (char *) &buff_data;
+ char *prefix_end;
/* the variable name should not be longer than 64 characters */
char name_buffer[64];
int len;
@@ -2066,6 +2082,8 @@ static bool show_status_array(THD *thd, const char *wild,
char *value=var->value;
const char *pos, *end; // We assign a lot of const's
+ pthread_mutex_lock(&LOCK_global_system_variables);
+
if (show_type == SHOW_SYS)
{
show_type= ((sys_var*) value)->show_type();
@@ -2080,11 +2098,11 @@ static bool show_status_array(THD *thd, const char *wild,
*/
switch (show_type) {
case SHOW_DOUBLE_STATUS:
- {
value= ((char *) status_var + (ulong) value);
- end= buff + sprintf(buff, "%f", *(double*) value);
+ /* fall through */
+ case SHOW_DOUBLE:
+ end= buff + my_sprintf(buff, (buff, "%f", *(double*) value));
break;
- }
case SHOW_LONG_STATUS:
value= ((char *) status_var + (ulong) value);
/* fall through */
@@ -2092,6 +2110,9 @@ static bool show_status_array(THD *thd, const char *wild,
case SHOW_LONG_NOFLUSH: // the difference lies in refresh_status()
end= int10_to_str(*(long*) value, buff, 10);
break;
+ case SHOW_LONGLONG_STATUS:
+ value= ((char *) status_var + (ulonglong) value);
+ /* fall through */
case SHOW_LONGLONG:
end= longlong10_to_str(*(longlong*) value, buff, 10);
break;
@@ -2148,6 +2169,9 @@ static bool show_status_array(THD *thd, const char *wild,
system_charset_info);
table->field[1]->store(pos, (uint32) (end - pos), system_charset_info);
table->field[1]->set_notnull();
+
+ pthread_mutex_unlock(&LOCK_global_system_variables);
+
if (schema_table_store_record(thd, table))
DBUG_RETURN(TRUE);
}
@@ -2182,30 +2206,14 @@ void calc_sum_of_all_status(STATUS_VAR *to)
}
-LEX_STRING *make_lex_string(THD *thd, LEX_STRING *lex_str,
- const char* str, uint length,
- bool allocate_lex_string)
-{
- MEM_ROOT *mem= thd->mem_root;
- if (allocate_lex_string)
- if (!(lex_str= (LEX_STRING *)thd->alloc(sizeof(LEX_STRING))))
- return 0;
- lex_str->str= strmake_root(mem, str, length);
- lex_str->length= length;
- return lex_str;
-}
-
-
-/* INFORMATION_SCHEMA name */
-LEX_STRING INFORMATION_SCHEMA_NAME= { C_STRING_WITH_LEN("information_schema")};
-
/* This is only used internally, but we need it here as a forward reference */
extern ST_SCHEMA_TABLE schema_tables[];
-typedef struct st_index_field_values
+typedef struct st_lookup_field_values
{
- const char *db_value, *table_value;
-} INDEX_FIELD_VALUES;
+ LEX_STRING db_value, table_value;
+ bool wild_db_value, wild_table_value;
+} LOOKUP_FIELD_VALUES;
/*
@@ -2236,38 +2244,11 @@ bool schema_table_store_record(THD *thd, TABLE *table)
}
-void get_index_field_values(LEX *lex, INDEX_FIELD_VALUES *index_field_values)
-{
- const char *wild= lex->wild ? lex->wild->ptr() : NullS;
- switch (lex->sql_command) {
- case SQLCOM_SHOW_DATABASES:
- index_field_values->db_value= wild;
- break;
- case SQLCOM_SHOW_TABLES:
- case SQLCOM_SHOW_TABLE_STATUS:
- case SQLCOM_SHOW_TRIGGERS:
- case SQLCOM_SHOW_EVENTS:
- index_field_values->db_value= lex->select_lex.db;
- index_field_values->table_value= wild;
- break;
- default:
- index_field_values->db_value= NullS;
- index_field_values->table_value= NullS;
- break;
- }
-}
-
-
int make_table_list(THD *thd, SELECT_LEX *sel,
- char *db, char *table)
+ LEX_STRING *db_name, LEX_STRING *table_name)
{
Table_ident *table_ident;
- LEX_STRING ident_db, ident_table;
- ident_db.str= db;
- ident_db.length= strlen(db);
- ident_table.str= table;
- ident_table.length= strlen(table);
- table_ident= new Table_ident(thd, ident_db, ident_table, 1);
+ table_ident= new Table_ident(thd, *db_name, *table_name, 1);
sel->init_query();
if (!sel->add_table_to_list(thd, table_ident, 0, 0, TL_READ))
return 1;
@@ -2275,16 +2256,135 @@ int make_table_list(THD *thd, SELECT_LEX *sel,
}
+/**
+ @brief Get lookup value from the part of 'WHERE' condition
+
+ @details This function gets lookup value from
+ the part of 'WHERE' condition if it's possible and
+ fill appropriate lookup_field_vals struct field
+ with this value.
+
+ @param[in] thd thread handler
+ @param[in] item_func part of WHERE condition
+ @param[in] table I_S table
+ @param[in, out] lookup_field_vals Struct which holds lookup values
+
+ @return void
+*/
+
+void get_lookup_value(THD *thd, Item_func *item_func,
+ TABLE_LIST *table,
+ LOOKUP_FIELD_VALUES *lookup_field_vals)
+{
+ ST_SCHEMA_TABLE *schema_table= table->schema_table;
+ ST_FIELD_INFO *field_info= schema_table->fields_info;
+ const char *field_name1= schema_table->idx_field1 >= 0 ?
+ field_info[schema_table->idx_field1].field_name : "";
+ const char *field_name2= schema_table->idx_field2 >= 0 ?
+ field_info[schema_table->idx_field2].field_name : "";
+
+ if (item_func->functype() == Item_func::EQ_FUNC ||
+ item_func->functype() == Item_func::EQUAL_FUNC)
+ {
+ int idx_field, idx_val;
+ char tmp[MAX_FIELD_WIDTH];
+ String *tmp_str, str_buff(tmp, sizeof(tmp), system_charset_info);
+ Item_field *item_field;
+ CHARSET_INFO *cs= system_charset_info;
+
+ if (item_func->arguments()[0]->type() == Item::FIELD_ITEM &&
+ item_func->arguments()[1]->const_item())
+ {
+ idx_field= 0;
+ idx_val= 1;
+ }
+ else if (item_func->arguments()[1]->type() == Item::FIELD_ITEM &&
+ item_func->arguments()[0]->const_item())
+ {
+ idx_field= 1;
+ idx_val= 0;
+ }
+ else
+ return;
+
+ item_field= (Item_field*) item_func->arguments()[idx_field];
+ if (table->table != item_field->field->table)
+ return;
+ tmp_str= item_func->arguments()[idx_val]->val_str(&str_buff);
+
+ /* Lookup value is database name */
+ if (!cs->coll->strnncollsp(cs, (uchar *) field_name1, strlen(field_name1),
+ (uchar *) item_field->field_name,
+ strlen(item_field->field_name), 0))
+ {
+ thd->make_lex_string(&lookup_field_vals->db_value, tmp_str->ptr(),
+ tmp_str->length(), FALSE);
+ }
+ /* Lookup value is table name */
+ else if (!cs->coll->strnncollsp(cs, (uchar *) field_name2,
+ strlen(field_name2),
+ (uchar *) item_field->field_name,
+ strlen(item_field->field_name), 0))
+ {
+ thd->make_lex_string(&lookup_field_vals->table_value, tmp_str->ptr(),
+ tmp_str->length(), FALSE);
+ }
+ }
+ return;
+}
+
+
+/**
+ @brief Calculates lookup values from 'WHERE' condition
+
+ @details This function calculates lookup value(database name, table name)
+ from 'WHERE' condition if it's possible and
+ fill lookup_field_vals struct fields with these values.
+
+ @param[in] thd thread handler
+ @param[in] cond WHERE condition
+ @param[in] table I_S table
+ @param[in, out] lookup_field_vals Struct which holds lookup values
+
+ @return void
+*/
+
+void calc_lookup_values_from_cond(THD *thd, COND *cond, TABLE_LIST *table,
+ LOOKUP_FIELD_VALUES *lookup_field_vals)
+{
+ if (!cond)
+ return;
+
+ if (cond->type() == Item::COND_ITEM)
+ {
+ if (((Item_cond*) cond)->functype() == Item_func::COND_AND_FUNC)
+ {
+ List_iterator<Item> li(*((Item_cond*) cond)->argument_list());
+ Item *item;
+ while ((item= li++))
+ {
+ if (item->type() == Item::FUNC_ITEM)
+ get_lookup_value(thd, (Item_func*)item, table, lookup_field_vals);
+ else
+ calc_lookup_values_from_cond(thd, item, table, lookup_field_vals);
+ }
+ }
+ return;
+ }
+ else if (cond->type() == Item::FUNC_ITEM)
+ get_lookup_value(thd, (Item_func*) cond, table, lookup_field_vals);
+ return;
+}
+
+
bool uses_only_table_name_fields(Item *item, TABLE_LIST *table)
{
if (item->type() == Item::FUNC_ITEM)
{
Item_func *item_func= (Item_func*)item;
- Item **child;
- Item **item_end= (item_func->arguments()) + item_func->argument_count();
- for (child= item_func->arguments(); child != item_end; child++)
+ for (uint i=0; i<item_func->argument_count(); i++)
{
- if (!uses_only_table_name_fields(*child, table))
+ if (!uses_only_table_name_fields(item_func->arguments()[i], table))
return 0;
}
}
@@ -2294,21 +2394,23 @@ bool uses_only_table_name_fields(Item *item, TABLE_LIST *table)
CHARSET_INFO *cs= system_charset_info;
ST_SCHEMA_TABLE *schema_table= table->schema_table;
ST_FIELD_INFO *field_info= schema_table->fields_info;
- const char *field_name1= schema_table->idx_field1 >= 0 ? field_info[schema_table->idx_field1].field_name : "";
- const char *field_name2= schema_table->idx_field2 >= 0 ? field_info[schema_table->idx_field2].field_name : "";
+ const char *field_name1= schema_table->idx_field1 >= 0 ?
+ field_info[schema_table->idx_field1].field_name : "";
+ const char *field_name2= schema_table->idx_field2 >= 0 ?
+ field_info[schema_table->idx_field2].field_name : "";
if (table->table != item_field->field->table ||
(cs->coll->strnncollsp(cs, (uchar *) field_name1, strlen(field_name1),
- (uchar *) item_field->field_name,
+ (uchar *) item_field->field_name,
strlen(item_field->field_name), 0) &&
cs->coll->strnncollsp(cs, (uchar *) field_name2, strlen(field_name2),
- (uchar *) item_field->field_name,
+ (uchar *) item_field->field_name,
strlen(item_field->field_name), 0)))
return 0;
}
else if (item->type() == Item::REF_ITEM)
return uses_only_table_name_fields(item->real_item(), table);
- if (item->type() == Item::SUBSELECT_ITEM &&
- !item->const_item())
+
+ if (item->type() == Item::SUBSELECT_ITEM && !item->const_item())
return 0;
return 1;
@@ -2371,6 +2473,61 @@ static COND * make_cond_for_info_schema(COND *cond, TABLE_LIST *table)
}
+/**
+ @brief Calculate lookup values(database name, table name)
+
+ @details This function calculates lookup values(database name, table name)
+ from 'WHERE' condition or wild values (for 'SHOW' commands only)
+ from LEX struct and fill lookup_field_vals struct field
+ with these values.
+
+ @param[in] thd thread handler
+ @param[in] cond WHERE condition
+ @param[in] tables I_S table
+ @param[in, out] lookup_field_values Struct which holds lookup values
+
+ @return void
+*/
+
+void get_lookup_field_values(THD *thd, COND *cond, TABLE_LIST *tables,
+ LOOKUP_FIELD_VALUES *lookup_field_values)
+{
+ LEX *lex= thd->lex;
+ const char *wild= lex->wild ? lex->wild->ptr() : NullS;
+ bzero((char*) lookup_field_values, sizeof(LOOKUP_FIELD_VALUES));
+ switch (lex->sql_command) {
+ case SQLCOM_SHOW_DATABASES:
+ if (wild)
+ {
+ lookup_field_values->db_value.str= (char*) wild;
+ lookup_field_values->db_value.length= strlen(wild);
+ lookup_field_values->wild_db_value= 1;
+ }
+ break;
+ case SQLCOM_SHOW_TABLES:
+ case SQLCOM_SHOW_TABLE_STATUS:
+ case SQLCOM_SHOW_TRIGGERS:
+ case SQLCOM_SHOW_EVENTS:
+ lookup_field_values->db_value.str= lex->select_lex.db;
+ lookup_field_values->db_value.length=strlen(lex->select_lex.db);
+ if (wild)
+ {
+ lookup_field_values->table_value.str= (char*)wild;
+ lookup_field_values->table_value.length= strlen(wild);
+ lookup_field_values->wild_table_value= 1;
+ }
+ break;
+ default:
+ /*
+ The "default" is for queries over I_S.
+ All previous cases handle SHOW commands.
+ */
+ calc_lookup_values_from_cond(thd, cond, tables, lookup_field_values);
+ break;
+ }
+}
+
+
enum enum_schema_tables get_schema_table_idx(ST_SCHEMA_TABLE *schema_table)
{
return (enum enum_schema_tables) (schema_table - &schema_tables[0]);
@@ -2388,82 +2545,89 @@ enum enum_schema_tables get_schema_table_idx(ST_SCHEMA_TABLE *schema_table)
idx_field_vals idx_field_vals->db_name contains db name or
wild string
with_i_schema returns 1 if we added 'IS' name to list
- otherwise returns 0
- is_wild_value if value is 1 then idx_field_vals->db_name is
- wild string otherwise it's db name;
+ otherwise returns 0
RETURN
zero success
non-zero error
*/
-int make_db_list(THD *thd, List<char> *files,
- INDEX_FIELD_VALUES *idx_field_vals,
- bool *with_i_schema, bool is_wild_value)
+int make_db_list(THD *thd, List<LEX_STRING> *files,
+ LOOKUP_FIELD_VALUES *lookup_field_vals,
+ bool *with_i_schema)
{
- LEX *lex= thd->lex;
+ LEX_STRING *i_s_name_copy= 0;
+ i_s_name_copy= thd->make_lex_string(i_s_name_copy,
+ INFORMATION_SCHEMA_NAME.str,
+ INFORMATION_SCHEMA_NAME.length, TRUE);
*with_i_schema= 0;
- get_index_field_values(lex, idx_field_vals);
- if (is_wild_value)
+ if (lookup_field_vals->wild_db_value)
{
/*
This part of code is only for SHOW DATABASES command.
idx_field_vals->db_value can be 0 when we don't use
LIKE clause (see also get_index_field_values() function)
*/
- if (!idx_field_vals->db_value ||
+ if (!lookup_field_vals->db_value.str ||
!wild_case_compare(system_charset_info,
INFORMATION_SCHEMA_NAME.str,
- idx_field_vals->db_value))
+ lookup_field_vals->db_value.str))
{
*with_i_schema= 1;
- if (files->push_back(thd->strdup(INFORMATION_SCHEMA_NAME.str)))
+ if (files->push_back(i_s_name_copy))
return 1;
}
return (find_files(thd, files, NullS, mysql_data_home,
- idx_field_vals->db_value, 1) != FIND_FILES_OK);
+ lookup_field_vals->db_value.str, 1) != FIND_FILES_OK);
}
+
/*
- This part of code is for SHOW TABLES, SHOW TABLE STATUS commands.
- idx_field_vals->db_value can't be 0 (see get_index_field_values()
- function).
+ If we have db lookup vaule we just add it to list and
+ exit from the function
*/
- if (sql_command_flags[lex->sql_command] & CF_STATUS_COMMAND)
+ if (lookup_field_vals->db_value.str)
{
if (!my_strcasecmp(system_charset_info, INFORMATION_SCHEMA_NAME.str,
- idx_field_vals->db_value))
+ lookup_field_vals->db_value.str))
{
*with_i_schema= 1;
- return files->push_back(thd->strdup(INFORMATION_SCHEMA_NAME.str));
+ if (files->push_back(i_s_name_copy))
+ return 1;
+ return 0;
}
- return files->push_back(thd->strdup(idx_field_vals->db_value));
+ if (files->push_back(&lookup_field_vals->db_value))
+ return 1;
+ return 0;
}
/*
Create list of existing databases. It is used in case
of select from information schema table
*/
- if (files->push_back(thd->strdup(INFORMATION_SCHEMA_NAME.str)))
+ if (files->push_back(i_s_name_copy))
return 1;
*with_i_schema= 1;
return (find_files(thd, files, NullS,
mysql_data_home, NullS, 1) != FIND_FILES_OK);
}
+
struct st_add_schema_table
{
- List<char> *files;
+ List<LEX_STRING> *files;
const char *wild;
};
-static my_bool add_schema_table(THD *thd, st_plugin_int *plugin,
+
+static my_bool add_schema_table(THD *thd, plugin_ref plugin,
void* p_data)
{
+ LEX_STRING *file_name= 0;
st_add_schema_table *data= (st_add_schema_table *)p_data;
- List<char> *file_list= data->files;
+ List<LEX_STRING> *file_list= data->files;
const char *wild= data->wild;
- ST_SCHEMA_TABLE *schema_table= (ST_SCHEMA_TABLE *)plugin->data;
+ ST_SCHEMA_TABLE *schema_table= plugin_data(plugin, ST_SCHEMA_TABLE *);
DBUG_ENTER("add_schema_table");
if (schema_table->hidden)
@@ -2481,14 +2645,18 @@ static my_bool add_schema_table(THD *thd, st_plugin_int *plugin,
DBUG_RETURN(0);
}
- if (file_list->push_back(thd->strdup(schema_table->table_name)))
- DBUG_RETURN(1);
-
- DBUG_RETURN(0);
+ if ((file_name= thd->make_lex_string(file_name, schema_table->table_name,
+ strlen(schema_table->table_name),
+ TRUE)) &&
+ !file_list->push_back(file_name))
+ DBUG_RETURN(0);
+ DBUG_RETURN(1);
}
-int schema_tables_add(THD *thd, List<char> *files, const char *wild)
+
+int schema_tables_add(THD *thd, List<LEX_STRING> *files, const char *wild)
{
+ LEX_STRING *file_name= 0;
ST_SCHEMA_TABLE *tmp_schema_table= schema_tables;
st_add_schema_table add_data;
DBUG_ENTER("schema_tables_add");
@@ -2509,8 +2677,12 @@ int schema_tables_add(THD *thd, List<char> *files, const char *wild)
else if (wild_compare(tmp_schema_table->table_name, wild, 0))
continue;
}
- if (files->push_back(thd->strdup(tmp_schema_table->table_name)))
- DBUG_RETURN(1);
+ if ((file_name=
+ thd->make_lex_string(file_name, tmp_schema_table->table_name,
+ strlen(tmp_schema_table->table_name), TRUE)) &&
+ !files->push_back(file_name))
+ continue;
+ DBUG_RETURN(1);
}
add_data.files= files;
@@ -2523,37 +2695,401 @@ int schema_tables_add(THD *thd, List<char> *files, const char *wild)
}
+/**
+ @brief Create table names list
+
+ @details The function creates the list of table names in
+ database
+
+ @param[in] thd thread handler
+ @param[in] table_names List of table names in database
+ @param[in] lex pointer to LEX struct
+ @param[in] lookup_field_vals pointer to LOOKUP_FIELD_VALUE struct
+ @param[in] with_i_schema TRUE means that we add I_S tables to list
+ @param[in] db_name database name
+
+ @return Operation status
+ @retval 0 ok
+ @retval 1 fatal error
+ @retval 2 Not fatal error; Safe to ignore this file list
+*/
+
+static int
+make_table_name_list(THD *thd, List<LEX_STRING> *table_names, LEX *lex,
+ LOOKUP_FIELD_VALUES *lookup_field_vals,
+ bool with_i_schema, LEX_STRING *db_name)
+{
+ char path[FN_REFLEN];
+ build_table_filename(path, sizeof(path), db_name->str, "", "", 0);
+ if (!lookup_field_vals->wild_table_value &&
+ lookup_field_vals->table_value.str)
+ {
+ if (with_i_schema)
+ {
+ if (find_schema_table(thd, lookup_field_vals->table_value.str))
+ {
+ if (table_names->push_back(&lookup_field_vals->table_value))
+ return 1;
+ }
+ }
+ else
+ {
+ if (table_names->push_back(&lookup_field_vals->table_value))
+ return 1;
+ /*
+ Check that table is relevant in current transaction.
+ (used for ndb engine, see ndbcluster_find_files(), ha_ndbcluster.cc)
+ */
+ VOID(ha_find_files(thd, db_name->str, path,
+ lookup_field_vals->table_value.str, 0,
+ table_names));
+ }
+ return 0;
+ }
+
+ /*
+ This call will add all matching the wildcards (if specified) IS tables
+ to the list
+ */
+ if (with_i_schema)
+ return (schema_tables_add(thd, table_names,
+ lookup_field_vals->table_value.str));
+
+ find_files_result res= find_files(thd, table_names, db_name->str, path,
+ lookup_field_vals->table_value.str, 0);
+ if (res != FIND_FILES_OK)
+ {
+ /*
+ Downgrade errors about problems with database directory to
+ warnings if this is not a 'SHOW' command. Another thread
+ may have dropped database, and we may still have a name
+ for that directory.
+ */
+ if (res == FIND_FILES_DIR)
+ {
+ if (lex->sql_command != SQLCOM_SELECT)
+ return 1;
+ thd->clear_error();
+ return 2;
+ }
+ return 1;
+ }
+ return 0;
+}
+
+
+/**
+ @brief Fill I_S table for SHOW COLUMNS|INDEX commands
+
+ @param[in] thd thread handler
+ @param[in] tables TABLE_LIST for I_S table
+ @param[in] schema_table pointer to I_S structure
+ @param[in] open_tables_state_backup pointer to Open_tables_state object
+ which is used to save|restore original
+ status of variables related to
+ open tables state
+
+ @return Operation status
+ @retval 0 success
+ @retval 1 error
+*/
+
+static int
+fill_schema_show_cols_or_idxs(THD *thd, TABLE_LIST *tables,
+ ST_SCHEMA_TABLE *schema_table,
+ Open_tables_state *open_tables_state_backup)
+{
+ LEX *lex= thd->lex;
+ bool res;
+ LEX_STRING tmp_lex_string, tmp_lex_string1, *db_name, *table_name;
+ enum_sql_command save_sql_command= lex->sql_command;
+ TABLE_LIST *show_table_list= (TABLE_LIST*) tables->schema_select_lex->
+ table_list.first;
+ TABLE *table= tables->table;
+ int error= 1;
+ DBUG_ENTER("fill_schema_show");
+
+ lex->all_selects_list= tables->schema_select_lex;
+ /*
+ Restore thd->temporary_tables to be able to process
+ temporary tables(only for 'show index' & 'show columns').
+ This should be changed when processing of temporary tables for
+ I_S tables will be done.
+ */
+ thd->temporary_tables= open_tables_state_backup->temporary_tables;
+ /*
+ Let us set fake sql_command so views won't try to merge
+ themselves into main statement. If we don't do this,
+ SELECT * from information_schema.xxxx will cause problems.
+ SQLCOM_SHOW_FIELDS is used because it satisfies 'only_view_structure()'
+ */
+ lex->sql_command= SQLCOM_SHOW_FIELDS;
+ res= open_normal_and_derived_tables(thd, show_table_list,
+ MYSQL_LOCK_IGNORE_FLUSH);
+ lex->sql_command= save_sql_command;
+ /*
+ get_all_tables() returns 1 on failure and 0 on success thus
+ return only these and not the result code of ::process_table()
+
+ We should use show_table_list->alias instead of
+ show_table_list->table_name because table_name
+ could be changed during opening of I_S tables. It's safe
+ to use alias because alias contains original table name
+ in this case(this part of code is used only for
+ 'show columns' & 'show statistics' commands).
+ */
+ table_name= thd->make_lex_string(&tmp_lex_string1, show_table_list->alias,
+ strlen(show_table_list->alias), FALSE);
+ if (!show_table_list->view)
+ db_name= thd->make_lex_string(&tmp_lex_string, show_table_list->db,
+ show_table_list->db_length, FALSE);
+ else
+ db_name= &show_table_list->view_db;
+
+
+ error= test(schema_table->process_table(thd, show_table_list,
+ table, res, db_name,
+ table_name));
+ thd->temporary_tables= 0;
+ close_tables_for_reopen(thd, &show_table_list);
+ DBUG_RETURN(error);
+}
+
+
+/**
+ @brief Fill I_S table for SHOW TABLE NAMES commands
+
+ @param[in] thd thread handler
+ @param[in] table TABLE struct for I_S table
+ @param[in] db_name database name
+ @param[in] table_name table name
+ @param[in] with_i_schema I_S table if TRUE
+
+ @return Operation status
+ @retval 0 success
+ @retval 1 error
+*/
+
+static int fill_schema_table_names(THD *thd, TABLE *table,
+ LEX_STRING *db_name, LEX_STRING *table_name,
+ bool with_i_schema)
+{
+ if (with_i_schema)
+ {
+ table->field[3]->store(STRING_WITH_LEN("SYSTEM VIEW"),
+ system_charset_info);
+ }
+ else
+ {
+ enum legacy_db_type not_used;
+ char path[FN_REFLEN];
+ (void) build_table_filename(path, sizeof(path), db_name->str,
+ table_name->str, reg_ext, 0);
+ switch (mysql_frm_type(thd, path, &not_used)) {
+ case FRMTYPE_ERROR:
+ table->field[3]->store(STRING_WITH_LEN("ERROR"),
+ system_charset_info);
+ break;
+ case FRMTYPE_TABLE:
+ table->field[3]->store(STRING_WITH_LEN("BASE TABLE"),
+ system_charset_info);
+ break;
+ case FRMTYPE_VIEW:
+ table->field[3]->store(STRING_WITH_LEN("VIEW"),
+ system_charset_info);
+ break;
+ default:
+ DBUG_ASSERT(0);
+ }
+ if (thd->net.last_errno == ER_NO_SUCH_TABLE)
+ {
+ thd->clear_error();
+ return 0;
+ }
+ }
+ if (schema_table_store_record(thd, table))
+ return 1;
+ return 0;
+}
+
+
+/**
+ @brief Get open table method
+
+ @details The function calculates the method which will be used
+ for table opening:
+ SKIP_OPEN_TABLE - do not open table
+ OPEN_FRM_ONLY - open FRM file only
+ OPEN_FULL_TABLE - open FRM, data, index files
+ @param[in] tables I_S table table_list
+ @param[in] schema_table I_S table struct
+ @param[in] schema_table_idx I_S table index
+
+ @return return a set of flags
+ @retval SKIP_OPEN_TABLE | OPEN_FRM_ONLY | OPEN_FULL_TABLE
+*/
+
+static uint get_table_open_method(TABLE_LIST *tables,
+ ST_SCHEMA_TABLE *schema_table,
+ enum enum_schema_tables schema_table_idx)
+{
+ /*
+ determine which method will be used for table opening
+ */
+ if (schema_table->i_s_requested_object & OPTIMIZE_I_S_TABLE)
+ {
+ Field **ptr, *field;
+ int table_open_method= 0, field_indx= 0;
+ for (ptr=tables->table->field; (field= *ptr) ; ptr++)
+ {
+ if (bitmap_is_set(tables->table->read_set, field->field_index))
+ table_open_method|= schema_table->fields_info[field_indx].open_method;
+ field_indx++;
+ }
+ return table_open_method;
+ }
+ /* I_S tables which use get_all_tables but can not be optimized */
+ return (uint) OPEN_FULL_TABLE;
+}
+
+
+/**
+ @brief Fill I_S table with data from FRM file only
+
+ @param[in] thd thread handler
+ @param[in] table TABLE struct for I_S table
+ @param[in] schema_table I_S table struct
+ @param[in] db_name database name
+ @param[in] table_name table name
+ @param[in] schema_table_idx I_S table index
+
+ @return Operation status
+ @retval 0 Table is processed and we can continue
+ with new table
+ @retval 1 It's view and we have to use
+ open_tables function for this table
+*/
+
+static int fill_schema_table_from_frm(THD *thd,TABLE *table,
+ ST_SCHEMA_TABLE *schema_table,
+ LEX_STRING *db_name,
+ LEX_STRING *table_name,
+ enum enum_schema_tables schema_table_idx)
+{
+ TABLE_SHARE *share;
+ TABLE tbl;
+ TABLE_LIST table_list;
+ uint res= 0;
+ int error;
+ char key[MAX_DBKEY_LENGTH];
+ uint key_length;
+
+ 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;
+ key_length= create_table_def_key(thd, key, &table_list, 0);
+ pthread_mutex_lock(&LOCK_open);
+ share= get_table_share(thd, &table_list, key,
+ key_length, OPEN_VIEW, &error);
+ if (!share)
+ {
+ res= 0;
+ goto err;
+ }
+
+ if (share->is_view)
+ {
+ if (schema_table->i_s_requested_object & OPEN_TABLE_ONLY)
+ {
+ /* skip view processing */
+ res= 0;
+ goto err1;
+ }
+ else if (schema_table->i_s_requested_object & OPEN_VIEW_FULL)
+ {
+ /*
+ tell get_all_tables() to fall back to
+ open_normal_and_derived_tables()
+ */
+ res= 1;
+ goto err1;
+ }
+ }
+
+ if (share->is_view ||
+ !open_table_from_share(thd, share, table_name->str, 0,
+ (READ_KEYINFO | COMPUTE_TYPES |
+ EXTRA_RECORD | OPEN_FRM_FILE_ONLY),
+ thd->open_options, &tbl, FALSE))
+ {
+ tbl.s= share;
+ table_list.table= &tbl;
+ table_list.view= (st_lex*) share->is_view;
+ res= schema_table->process_table(thd, &table_list, table,
+ res, db_name, table_name);
+ closefrm(&tbl, true);
+ goto err;
+ }
+
+err1:
+ release_table_share(share, RELEASE_NORMAL);
+
+err:
+ pthread_mutex_unlock(&LOCK_open);
+ thd->clear_error();
+ return res;
+}
+
+
+
+/**
+ @brief Fill I_S tables whose data are retrieved
+ from frm files and storage engine
+
+ @details The information schema tables are internally represented as
+ temporary tables that are filled at query execution time.
+ Those I_S tables whose data are retrieved
+ from frm files and storage engine are filled by the function
+ get_all_tables().
+
+ @param[in] thd thread handler
+ @param[in] tables I_S table
+ @param[in] cond 'WHERE' condition
+
+ @return Operation status
+ @retval 0 success
+ @retval 1 error
+*/
+
int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
{
LEX *lex= thd->lex;
TABLE *table= tables->table;
- SELECT_LEX *select_lex= &lex->select_lex;
SELECT_LEX *old_all_select_lex= lex->all_selects_list;
enum_sql_command save_sql_command= lex->sql_command;
SELECT_LEX *lsel= tables->schema_select_lex;
ST_SCHEMA_TABLE *schema_table= tables->schema_table;
SELECT_LEX sel;
- INDEX_FIELD_VALUES idx_field_vals;
- char path[FN_REFLEN], *base_name, *orig_base_name, *file_name;
- uint len;
+ LOOKUP_FIELD_VALUES lookup_field_vals;
+ LEX_STRING *db_name, *table_name;
bool with_i_schema;
enum enum_schema_tables schema_table_idx;
- List<char> bases;
- List_iterator_fast<char> it(bases);
- COND *partial_cond;
+ List<LEX_STRING> db_names;
+ List_iterator_fast<LEX_STRING> it(db_names);
+ COND *partial_cond= 0;
uint derived_tables= lex->derived_tables;
int error= 1;
- enum legacy_db_type not_used;
Open_tables_state open_tables_state_backup;
bool save_view_prepare_mode= lex->view_prepare_mode;
Query_tables_list query_tables_list_backup;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
Security_context *sctx= thd->security_ctx;
#endif
+ uint table_open_method;
DBUG_ENTER("get_all_tables");
- LINT_INIT(len);
-
lex->view_prepare_mode= TRUE;
lex->reset_n_backup_query_tables_list(&query_tables_list_backup);
@@ -2564,183 +3100,160 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
*/
thd->reset_n_backup_open_tables_state(&open_tables_state_backup);
+ /*
+ this branch processes SHOW FIELDS, SHOW INDEXES commands.
+ see sql_parse.cc, prepare_schema_table() function where
+ this values are initialized
+ */
if (lsel && lsel->table_list.first)
{
- TABLE_LIST *show_table_list= (TABLE_LIST*) lsel->table_list.first;
- bool res;
-
- lex->all_selects_list= lsel;
- /*
- Restore thd->temporary_tables to be able to process
- temporary tables(only for 'show index' & 'show columns').
- This should be changed when processing of temporary tables for
- I_S tables will be done.
- */
- thd->temporary_tables= open_tables_state_backup.temporary_tables;
- /*
- Let us set fake sql_command so views won't try to merge
- themselves into main statement. If we don't do this,
- SELECT * from information_schema.xxxx will cause problems.
- SQLCOM_SHOW_FIELDS is used because it satisfies 'only_view_structure()'
- */
- lex->sql_command= SQLCOM_SHOW_FIELDS;
- res= open_normal_and_derived_tables(thd, show_table_list,
- MYSQL_LOCK_IGNORE_FLUSH);
- lex->sql_command= save_sql_command;
- /*
- get_all_tables() returns 1 on failure and 0 on success thus
- return only these and not the result code of ::process_table()
-
- We should use show_table_list->alias instead of
- show_table_list->table_name because table_name
- could be changed during opening of I_S tables. It's safe
- to use alias because alias contains original table name
- in this case(this part of code is used only for
- 'show columns' & 'show statistics' commands).
- */
- error= test(schema_table->process_table(thd, show_table_list,
- table, res,
- (show_table_list->view ?
- show_table_list->view_db.str :
- show_table_list->db),
- show_table_list->alias));
- thd->temporary_tables= 0;
- close_tables_for_reopen(thd, &show_table_list);
+ error= fill_schema_show_cols_or_idxs(thd, tables, schema_table,
+ &open_tables_state_backup);
goto err;
}
schema_table_idx= get_schema_table_idx(schema_table);
+ get_lookup_field_values(thd, cond, tables, &lookup_field_vals);
+ DBUG_PRINT("INDEX VALUES",("db_name='%s', table_name='%s'",
+ lookup_field_vals.db_value.str,
+ lookup_field_vals.table_value.str));
+
+ if (!lookup_field_vals.wild_db_value && !lookup_field_vals.wild_table_value)
+ {
+ /*
+ if lookup value is empty string then
+ it's impossible table name or db name
+ */
+ if (lookup_field_vals.db_value.str &&
+ !lookup_field_vals.db_value.str[0] ||
+ lookup_field_vals.table_value.str &&
+ !lookup_field_vals.table_value.str[0])
+ {
+ error= 0;
+ goto err;
+ }
+ }
+
+ if (lookup_field_vals.db_value.length &&
+ !lookup_field_vals.wild_db_value)
+ tables->has_db_lookup_value= TRUE;
+ if (lookup_field_vals.table_value.length &&
+ !lookup_field_vals.wild_table_value)
+ tables->has_table_lookup_value= TRUE;
+
+ if (tables->has_db_lookup_value && tables->has_table_lookup_value)
+ partial_cond= 0;
+ else
+ partial_cond= make_cond_for_info_schema(cond, tables);
+
+ tables->table_open_method= table_open_method=
+ get_table_open_method(tables, schema_table, schema_table_idx);
- if (make_db_list(thd, &bases, &idx_field_vals,
- &with_i_schema, 0))
+ if (lex->describe)
+ {
+ /* EXPLAIN SELECT */
+ error= 0;
goto err;
+ }
- partial_cond= make_cond_for_info_schema(cond, tables);
+ if (make_db_list(thd, &db_names, &lookup_field_vals, &with_i_schema))
+ goto err;
it.rewind(); /* To get access to new elements in basis list */
-
- /*
- Below we generate error for non existing database.
- (to save old behaviour for SHOW TABLES FROM db)
- */
- while ((orig_base_name= base_name= it++) ||
- ((sql_command_flags[save_sql_command] & CF_SHOW_TABLE_COMMAND) &&
- (base_name= select_lex->db) && !bases.elements))
+ while ((db_name= it++))
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
- if (!check_access(thd,SELECT_ACL, base_name,
+ if (!check_access(thd,SELECT_ACL, db_name->str,
&thd->col_access, 0, 1, with_i_schema) ||
sctx->master_access & (DB_ACLS | SHOW_DB_ACL) ||
- acl_get(sctx->host, sctx->ip, sctx->priv_user, base_name,0) ||
- (grant_option && !check_grant_db(thd, base_name)))
+ acl_get(sctx->host, sctx->ip, sctx->priv_user, db_name->str, 0) ||
+ !check_grant_db(thd, db_name->str))
#endif
{
- List<char> files;
- if (with_i_schema) // information schema table names
- {
- if (schema_tables_add(thd, &files, idx_field_vals.table_value))
- goto err;
- }
- else
+ thd->no_warnings_for_error= 1;
+ List<LEX_STRING> table_names;
+ int res= make_table_name_list(thd, &table_names, lex,
+ &lookup_field_vals,
+ with_i_schema, db_name);
+ if (res == 2) /* Not fatal error, continue */
+ continue;
+ if (res)
+ goto err;
+
+ List_iterator_fast<LEX_STRING> it_files(table_names);
+ while ((table_name= it_files++))
{
- len= build_table_filename(path, sizeof(path), base_name, "", "", 0);
- len= FN_LEN - len;
- find_files_result res= find_files(thd, &files, base_name,
- path, idx_field_vals.table_value, 0);
- if (res != FIND_FILES_OK)
+ restore_record(table, s->default_values);
+ table->field[schema_table->idx_field1]->
+ store(db_name->str, db_name->length, system_charset_info);
+ table->field[schema_table->idx_field2]->
+ store(table_name->str, table_name->length, system_charset_info);
+
+ if (!partial_cond || partial_cond->val_int())
{
/*
- Downgrade errors about problems with database directory to
- warnings if this is not a 'SHOW' command. Another thread
- may have dropped database, and we may still have a name
- for that directory.
+ If table is I_S.tables and open_table_method is 0 (eg SKIP_OPEN)
+ we can skip table opening and we don't have lookup value for
+ table name or lookup value is wild string(table name list is
+ already created by make_table_name_list() function).
*/
- if (res == FIND_FILES_DIR && lex->sql_command == SQLCOM_END)
+ if (!table_open_method && schema_table_idx == SCH_TABLES &&
+ (!lookup_field_vals.table_value.length ||
+ lookup_field_vals.wild_table_value))
{
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- thd->net.last_errno, thd->net.last_error);
- thd->clear_error();
+ if (schema_table_store_record(thd, table))
+ goto err; /* Out of space in temporary table */
continue;
}
- else
- {
- goto err;
- }
- }
- if (lower_case_table_names)
- orig_base_name= thd->strdup(base_name);
- }
- List_iterator_fast<char> it_files(files);
- while ((file_name= it_files++))
- {
- restore_record(table, s->default_values);
- table->field[schema_table->idx_field1]->
- store(base_name, strlen(base_name), system_charset_info);
- table->field[schema_table->idx_field2]->
- store(file_name, strlen(file_name),system_charset_info);
- if (!partial_cond || partial_cond->val_int())
- {
+ /* SHOW TABLE NAMES command */
if (schema_table_idx == SCH_TABLE_NAMES)
{
- if (lex->verbose ||
- (sql_command_flags[save_sql_command] & CF_STATUS_COMMAND) == 0)
- {
- if (with_i_schema)
- {
- table->field[3]->store(STRING_WITH_LEN("SYSTEM VIEW"),
- system_charset_info);
- }
- else
- {
- build_table_filename(path, sizeof(path),
- base_name, file_name, reg_ext, 0);
-
- switch (mysql_frm_type(thd, path, &not_used)) {
- case FRMTYPE_ERROR:
- table->field[3]->store(STRING_WITH_LEN("ERROR"),
- system_charset_info);
- break;
- case FRMTYPE_TABLE:
- table->field[3]->store(STRING_WITH_LEN("BASE TABLE"),
- system_charset_info);
- break;
- case FRMTYPE_VIEW:
- table->field[3]->store(STRING_WITH_LEN("VIEW"),
- system_charset_info);
- break;
- default:
- DBUG_ASSERT(0);
- }
- }
- }
- if (schema_table_store_record(thd, table))
- goto err;
+ if (fill_schema_table_names(thd, tables->table, db_name,
+ table_name, with_i_schema))
+ continue;
}
else
{
+ if (!(table_open_method & ~OPEN_FRM_ONLY) &&
+ !with_i_schema)
+ {
+ if (!fill_schema_table_from_frm(thd, table, schema_table, db_name,
+ table_name, schema_table_idx))
+ continue;
+ }
+
int res;
+ LEX_STRING tmp_lex_string, orig_db_name;
/*
Set the parent lex of 'sel' because it is needed by
sel.init_query() which is called inside make_table_list.
*/
+ thd->no_warnings_for_error= 1;
sel.parent_lex= lex;
- if (make_table_list(thd, &sel, base_name, file_name))
+ /* db_name can be changed in make_table_list() func */
+ if (!thd->make_lex_string(&orig_db_name, db_name->str,
+ db_name->length, FALSE))
+ goto err;
+ if (make_table_list(thd, &sel, db_name, table_name))
goto err;
TABLE_LIST *show_table_list= (TABLE_LIST*) sel.table_list.first;
lex->all_selects_list= &sel;
lex->derived_tables= 0;
lex->sql_command= SQLCOM_SHOW_FIELDS;
+ show_table_list->i_s_requested_object=
+ schema_table->i_s_requested_object;
res= open_normal_and_derived_tables(thd, show_table_list,
MYSQL_LOCK_IGNORE_FLUSH);
lex->sql_command= save_sql_command;
- /*
- They can drop table after table names list creation and
- before table opening. We open non existing table and
- get ER_NO_SUCH_TABLE error. In this case we do not store
- the record into I_S table and clear error.
- */
+
if (thd->net.last_errno == ER_NO_SUCH_TABLE)
{
+ /*
+ Hide error for not existing table.
+ This error can occur for example when we use
+ where condition with db name and table name and this
+ table does not exist.
+ */
res= 0;
thd->clear_error();
}
@@ -2753,12 +3266,14 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
to use alias because alias contains original table name
in this case.
*/
+ thd->make_lex_string(&tmp_lex_string, show_table_list->alias,
+ strlen(show_table_list->alias), FALSE);
res= schema_table->process_table(thd, show_table_list, table,
- res, orig_base_name,
- show_table_list->alias);
+ res, &orig_db_name,
+ &tmp_lex_string);
close_tables_for_reopen(thd, &show_table_list);
- DBUG_ASSERT(!lex->query_tables_own_last);
}
+ DBUG_ASSERT(!lex->query_tables_own_last);
if (res)
goto err;
}
@@ -2784,27 +3299,27 @@ err:
}
-bool store_schema_shemata(THD* thd, TABLE *table, const char *db_name,
+bool store_schema_shemata(THD* thd, TABLE *table, LEX_STRING *db_name,
CHARSET_INFO *cs)
{
restore_record(table, s->default_values);
- table->field[1]->store(db_name, strlen(db_name), 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);
return schema_table_store_record(thd, table);
}
-int fill_schema_shemata(THD *thd, TABLE_LIST *tables, COND *cond)
+int fill_schema_schemata(THD *thd, TABLE_LIST *tables, COND *cond)
{
/*
TODO: fill_schema_shemata() is called when new client is connected.
Returning error status in this case leads to client hangup.
*/
- INDEX_FIELD_VALUES idx_field_vals;
- List<char> files;
- char *file_name;
+ LOOKUP_FIELD_VALUES lookup_field_vals;
+ List<LEX_STRING> db_names;
+ LEX_STRING *db_name;
bool with_i_schema;
HA_CREATE_INFO create;
TABLE *table= tables->table;
@@ -2813,16 +3328,37 @@ int fill_schema_shemata(THD *thd, TABLE_LIST *tables, COND *cond)
#endif
DBUG_ENTER("fill_schema_shemata");
- if (make_db_list(thd, &files, &idx_field_vals,
- &with_i_schema, 1))
+ get_lookup_field_values(thd, cond, tables, &lookup_field_vals);
+ DBUG_PRINT("INDEX VALUES",("db_name='%s', table_name='%s'",
+ lookup_field_vals.db_value.str,
+ lookup_field_vals.table_value.str));
+ if (make_db_list(thd, &db_names, &lookup_field_vals,
+ &with_i_schema))
DBUG_RETURN(1);
- List_iterator_fast<char> it(files);
- while ((file_name=it++))
+ /*
+ If we have lookup db value we should check that the database exists
+ */
+ if(lookup_field_vals.db_value.str && !lookup_field_vals.wild_db_value)
+ {
+ char path[FN_REFLEN+16];
+ uint path_len;
+ MY_STAT stat_info;
+ if (!lookup_field_vals.db_value.str[0])
+ DBUG_RETURN(0);
+ path_len= build_table_filename(path, sizeof(path),
+ lookup_field_vals.db_value.str, "", "", 0);
+ path[path_len-1]= 0;
+ if (!my_stat(path,&stat_info,MYF(0)))
+ DBUG_RETURN(0);
+ }
+
+ List_iterator_fast<LEX_STRING> it(db_names);
+ while ((db_name=it++))
{
if (with_i_schema) // information schema name is always first in list
{
- if (store_schema_shemata(thd, table, file_name,
+ if (store_schema_shemata(thd, table, db_name,
system_charset_info))
DBUG_RETURN(1);
with_i_schema= 0;
@@ -2830,13 +3366,12 @@ int fill_schema_shemata(THD *thd, TABLE_LIST *tables, COND *cond)
}
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (sctx->master_access & (DB_ACLS | SHOW_DB_ACL) ||
- acl_get(sctx->host, sctx->ip, sctx->priv_user, file_name,0) ||
- (grant_option && !check_grant_db(thd, file_name)))
+ acl_get(sctx->host, sctx->ip, sctx->priv_user, db_name->str, 0) ||
+ !check_grant_db(thd, db_name->str))
#endif
{
- load_db_opt_by_name(thd, file_name, &create);
-
- if (store_schema_shemata(thd, table, file_name,
+ load_db_opt_by_name(thd, db_name->str, &create);
+ if (store_schema_shemata(thd, table, db_name,
create.default_table_charset))
DBUG_RETURN(1);
}
@@ -2845,10 +3380,10 @@ int fill_schema_shemata(THD *thd, TABLE_LIST *tables, COND *cond)
}
-static int get_schema_tables_record(THD *thd, struct st_table_list *tables,
+static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
TABLE *table, bool res,
- const char *base_name,
- const char *file_name)
+ LEX_STRING *db_name,
+ LEX_STRING *table_name)
{
const char *tmp_buff;
MYSQL_TIME time;
@@ -2856,8 +3391,8 @@ static int get_schema_tables_record(THD *thd, struct st_table_list *tables,
DBUG_ENTER("get_schema_tables_record");
restore_record(table, s->default_values);
- table->field[1]->store(base_name, strlen(base_name), cs);
- table->field[2]->store(file_name, strlen(file_name), 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)
{
/*
@@ -2880,12 +3415,11 @@ static int get_schema_tables_record(THD *thd, struct st_table_list *tables,
}
else
{
+ char option_buff[350],*ptr;
TABLE *show_table= tables->table;
TABLE_SHARE *share= show_table->s;
handler *file= show_table->file;
-
- file->info(HA_STATUS_VARIABLE | HA_STATUS_TIME | HA_STATUS_AUTO |
- HA_STATUS_NO_LOCK);
+ handlerton *tmp_db_type= share->db_type();
if (share->tmp_table == SYSTEM_TMP_TABLE)
table->field[3]->store(STRING_WITH_LEN("SYSTEM VIEW"), cs);
else if (share->tmp_table)
@@ -2899,89 +3433,15 @@ static int get_schema_tables_record(THD *thd, struct st_table_list *tables,
continue;
table->field[i]->set_notnull();
}
- tmp_buff= file->table_type();
+#ifdef WITH_PARTITION_STORAGE_ENGINE
+ if (share->db_type() == partition_hton &&
+ share->partition_info_len)
+ tmp_db_type= share->default_part_db_type;
+#endif
+ tmp_buff= (char *) ha_resolve_storage_engine_name(tmp_db_type);
table->field[4]->store(tmp_buff, strlen(tmp_buff), cs);
table->field[5]->store((longlong) share->frm_version, TRUE);
- enum row_type row_type = file->get_row_type();
- switch (row_type) {
- case ROW_TYPE_NOT_USED:
- case ROW_TYPE_DEFAULT:
- tmp_buff= ((share->db_options_in_use &
- HA_OPTION_COMPRESS_RECORD) ? "Compressed" :
- (share->db_options_in_use & HA_OPTION_PACK_RECORD) ?
- "Dynamic" : "Fixed");
- break;
- case ROW_TYPE_FIXED:
- tmp_buff= "Fixed";
- break;
- case ROW_TYPE_DYNAMIC:
- tmp_buff= "Dynamic";
- break;
- case ROW_TYPE_COMPRESSED:
- tmp_buff= "Compressed";
- break;
- case ROW_TYPE_REDUNDANT:
- tmp_buff= "Redundant";
- break;
- case ROW_TYPE_COMPACT:
- tmp_buff= "Compact";
- break;
- case ROW_TYPE_PAGES:
- tmp_buff= "Paged";
- break;
- }
- table->field[6]->store(tmp_buff, strlen(tmp_buff), cs);
- if (!tables->schema_table)
- {
- table->field[7]->store((longlong) file->stats.records, TRUE);
- table->field[7]->set_notnull();
- }
- table->field[8]->store((longlong) file->stats.mean_rec_length, TRUE);
- table->field[9]->store((longlong) file->stats.data_file_length, TRUE);
- if (file->stats.max_data_file_length)
- {
- table->field[10]->store((longlong) file->stats.max_data_file_length,
- TRUE);
- }
- table->field[11]->store((longlong) file->stats.index_file_length, TRUE);
- table->field[12]->store((longlong) file->stats.delete_length, TRUE);
- if (show_table->found_next_number_field)
- {
- table->field[13]->store((longlong) file->stats.auto_increment_value,
- TRUE);
- table->field[13]->set_notnull();
- }
- if (file->stats.create_time)
- {
- thd->variables.time_zone->gmt_sec_to_TIME(&time,
- (my_time_t) file->stats.create_time);
- table->field[14]->store_time(&time, MYSQL_TIMESTAMP_DATETIME);
- table->field[14]->set_notnull();
- }
- if (file->stats.update_time)
- {
- thd->variables.time_zone->gmt_sec_to_TIME(&time,
- (my_time_t) file->stats.update_time);
- table->field[15]->store_time(&time, MYSQL_TIMESTAMP_DATETIME);
- table->field[15]->set_notnull();
- }
- if (file->stats.check_time)
- {
- thd->variables.time_zone->gmt_sec_to_TIME(&time,
- (my_time_t) file->stats.check_time);
- table->field[16]->store_time(&time, MYSQL_TIMESTAMP_DATETIME);
- table->field[16]->set_notnull();
- }
- tmp_buff= (share->table_charset ?
- share->table_charset->name : "default");
- table->field[17]->store(tmp_buff, strlen(tmp_buff), cs);
- if (file->ha_table_flags() & (ulong) HA_HAS_CHECKSUM)
- {
- table->field[18]->store((longlong) file->checksum(), TRUE);
- table->field[18]->set_notnull();
- }
- char option_buff[350],*ptr;
ptr=option_buff;
if (share->min_rows)
{
@@ -3010,8 +3470,14 @@ static int get_schema_tables_record(THD *thd, struct st_table_list *tables,
ptr=strxmov(ptr, " row_format=",
ha_row_type[(uint) share->row_type],
NullS);
+ if (share->transactional != HA_CHOICE_UNDEF)
+ {
+ ptr= strxmov(ptr, " TRANSACTIONAL=",
+ (share->transactional == HA_CHOICE_YES ? "1" : "0"),
+ NullS);
+ }
#ifdef WITH_PARTITION_STORAGE_ENGINE
- if (show_table->s->db_type == partition_hton &&
+ if (show_table->s->db_type() == partition_hton &&
show_table->part_info != NULL &&
show_table->part_info->no_parts > 0)
ptr= strmov(ptr, " partitioned");
@@ -3019,17 +3485,91 @@ static int get_schema_tables_record(THD *thd, struct st_table_list *tables,
table->field[19]->store(option_buff+1,
(ptr == option_buff ? 0 :
(uint) (ptr-option_buff)-1), cs);
+
+ if (share->comment.str)
+ table->field[20]->store(share->comment.str, share->comment.length, cs);
+
+ if(file)
{
- char *comment;
- comment= show_table->file->update_table_comment(share->comment.str);
- if (comment)
+ file->info(HA_STATUS_VARIABLE | HA_STATUS_TIME | HA_STATUS_AUTO |
+ HA_STATUS_NO_LOCK);
+ enum row_type row_type = file->get_row_type();
+ switch (row_type) {
+ case ROW_TYPE_NOT_USED:
+ case ROW_TYPE_DEFAULT:
+ tmp_buff= ((share->db_options_in_use &
+ HA_OPTION_COMPRESS_RECORD) ? "Compressed" :
+ (share->db_options_in_use & HA_OPTION_PACK_RECORD) ?
+ "Dynamic" : "Fixed");
+ break;
+ case ROW_TYPE_FIXED:
+ tmp_buff= "Fixed";
+ break;
+ case ROW_TYPE_DYNAMIC:
+ tmp_buff= "Dynamic";
+ break;
+ case ROW_TYPE_COMPRESSED:
+ tmp_buff= "Compressed";
+ break;
+ case ROW_TYPE_REDUNDANT:
+ tmp_buff= "Redundant";
+ break;
+ case ROW_TYPE_COMPACT:
+ tmp_buff= "Compact";
+ break;
+ case ROW_TYPE_PAGE:
+ tmp_buff= "Paged";
+ break;
+ }
+ table->field[6]->store(tmp_buff, strlen(tmp_buff), cs);
+ if (!tables->schema_table)
+ {
+ table->field[7]->store((longlong) file->stats.records, TRUE);
+ table->field[7]->set_notnull();
+ }
+ table->field[8]->store((longlong) file->stats.mean_rec_length, TRUE);
+ table->field[9]->store((longlong) file->stats.data_file_length, TRUE);
+ if (file->stats.max_data_file_length)
+ {
+ table->field[10]->store((longlong) file->stats.max_data_file_length,
+ TRUE);
+ }
+ table->field[11]->store((longlong) file->stats.index_file_length, TRUE);
+ table->field[12]->store((longlong) file->stats.delete_length, TRUE);
+ if (show_table->found_next_number_field)
{
- table->field[20]->store(comment,
- (comment == share->comment.str ?
- share->comment.length :
- strlen(comment)), cs);
- if (comment != share->comment.str)
- my_free(comment, MYF(0));
+ table->field[13]->store((longlong) file->stats.auto_increment_value,
+ TRUE);
+ table->field[13]->set_notnull();
+ }
+ if (file->stats.create_time)
+ {
+ thd->variables.time_zone->gmt_sec_to_TIME(&time,
+ (my_time_t) file->stats.create_time);
+ table->field[14]->store_time(&time, MYSQL_TIMESTAMP_DATETIME);
+ table->field[14]->set_notnull();
+ }
+ if (file->stats.update_time)
+ {
+ thd->variables.time_zone->gmt_sec_to_TIME(&time,
+ (my_time_t) file->stats.update_time);
+ table->field[15]->store_time(&time, MYSQL_TIMESTAMP_DATETIME);
+ table->field[15]->set_notnull();
+ }
+ if (file->stats.check_time)
+ {
+ thd->variables.time_zone->gmt_sec_to_TIME(&time,
+ (my_time_t) file->stats.check_time);
+ table->field[16]->store_time(&time, MYSQL_TIMESTAMP_DATETIME);
+ table->field[16]->set_notnull();
+ }
+ tmp_buff= (share->table_charset ?
+ share->table_charset->name : "default");
+ table->field[17]->store(tmp_buff, strlen(tmp_buff), cs);
+ if (file->ha_table_flags() & (ulong) HA_HAS_CHECKSUM)
+ {
+ table->field[18]->store((longlong) file->checksum(), TRUE);
+ table->field[18]->set_notnull();
}
}
}
@@ -3037,19 +3577,17 @@ static int get_schema_tables_record(THD *thd, struct st_table_list *tables,
}
-static int get_schema_column_record(THD *thd, struct st_table_list *tables,
+static int get_schema_column_record(THD *thd, TABLE_LIST *tables,
TABLE *table, bool res,
- const char *base_name,
- const char *file_name)
+ LEX_STRING *db_name,
+ LEX_STRING *table_name)
{
LEX *lex= thd->lex;
const char *wild= lex->wild ? lex->wild->ptr() : NullS;
CHARSET_INFO *cs= system_charset_info;
TABLE *show_table;
- handler *file;
Field **ptr,*field;
int count;
- uint base_name_length, file_name_length;
DBUG_ENTER("get_schema_column_record");
if (res)
@@ -3069,22 +3607,17 @@ static int get_schema_column_record(THD *thd, struct st_table_list *tables,
}
show_table= tables->table;
- file= show_table->file;
count= 0;
- file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK);
restore_record(show_table, s->default_values);
- base_name_length= strlen(base_name);
- file_name_length= strlen(file_name);
show_table->use_all_columns(); // Required for default
- for (ptr=show_table->field; (field= *ptr) ; ptr++)
+ for (ptr= show_table->field; (field= *ptr) ; ptr++)
{
const char *tmp_buff;
- byte *pos;
+ uchar *pos;
bool is_blob;
uint flags=field->flags;
char tmp[MAX_FIELD_WIDTH];
- char tmp1[MAX_FIELD_WIDTH];
String type(tmp,sizeof(tmp), system_charset_info);
char *end;
int decimals, field_length;
@@ -3100,13 +3633,12 @@ static int get_schema_column_record(THD *thd, struct st_table_list *tables,
#ifndef NO_EMBEDDED_ACCESS_CHECKS
uint col_access;
- check_access(thd,SELECT_ACL | EXTRA_ACL, base_name,
+ check_access(thd,SELECT_ACL | EXTRA_ACL, db_name->str,
&tables->grant.privilege, 0, 0, test(tables->schema_table));
col_access= get_column_grant(thd, &tables->grant,
- base_name, file_name,
+ db_name->str, table_name->str,
field->field_name) & COL_ACLS;
- if (lex->sql_command != SQLCOM_SHOW_FIELDS &&
- !tables->schema_table && !col_access)
+ if (!tables->schema_table && !col_access)
continue;
end= tmp;
for (uint bitnr=0; col_access ; col_access>>=1,bitnr++)
@@ -3120,8 +3652,8 @@ static int get_schema_column_record(THD *thd, struct st_table_list *tables,
table->field[17]->store(tmp+1,end == tmp ? 0 : (uint) (end-tmp-1), cs);
#endif
- table->field[1]->store(base_name, base_name_length, cs);
- table->field[2]->store(file_name, file_name_length, 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),
cs);
table->field[4]->store((longlong) count, TRUE);
@@ -3131,34 +3663,13 @@ static int get_schema_column_record(THD *thd, struct st_table_list *tables,
table->field[7]->store(type.ptr(),
(tmp_buff ? tmp_buff - type.ptr() :
type.length()), cs);
- if (show_table->timestamp_field == field &&
- field->unireg_check != Field::TIMESTAMP_UN_FIELD)
- {
- table->field[5]->store(STRING_WITH_LEN("CURRENT_TIMESTAMP"), cs);
- table->field[5]->set_notnull();
- }
- else if (field->unireg_check != Field::NEXT_NUMBER &&
- !field->is_null() &&
- !(field->flags & NO_DEFAULT_VALUE_FLAG))
- {
- String def(tmp1,sizeof(tmp1), cs);
- type.set(tmp, sizeof(tmp), field->charset());
- field->val_str(&type);
- uint dummy_errors;
- def.copy(type.ptr(), type.length(), type.charset(), cs, &dummy_errors);
- table->field[5]->store(def.ptr(), def.length(), def.charset());
- table->field[5]->set_notnull();
- }
- else if (field->unireg_check == Field::NEXT_NUMBER ||
- lex->sql_command != SQLCOM_SHOW_FIELDS ||
- field->maybe_null())
- table->field[5]->set_null(); // Null as default
- else
+
+ if (get_field_default_value(thd, show_table, field, &type, 0))
{
- table->field[5]->store("",0, cs);
+ table->field[5]->store(type.ptr(), type.length(), cs);
table->field[5]->set_notnull();
}
- pos=(byte*) ((flags & NOT_NULL_FLAG) ? "NO" : "YES");
+ pos=(uchar*) ((flags & NOT_NULL_FLAG) ? "NO" : "YES");
table->field[6]->store((const char*) pos,
strlen((const char*) pos), cs);
is_blob= (field->type() == MYSQL_TYPE_BLOB);
@@ -3226,16 +3737,16 @@ static int get_schema_column_record(THD *thd, struct st_table_list *tables,
if (field->has_charset())
{
- pos=(byte*) field->charset()->csname;
+ pos=(uchar*) field->charset()->csname;
table->field[12]->store((const char*) pos,
strlen((const char*) pos), cs);
table->field[12]->set_notnull();
- pos=(byte*) field->charset()->name;
+ pos=(uchar*) field->charset()->name;
table->field[13]->store((const char*) pos,
strlen((const char*) pos), cs);
table->field[13]->set_notnull();
}
- pos=(byte*) ((field->flags & PRI_KEY_FLAG) ? "PRI" :
+ pos=(uchar*) ((field->flags & PRI_KEY_FLAG) ? "PRI" :
(field->flags & UNIQUE_KEY_FLAG) ? "UNI" :
(field->flags & MULTIPLE_KEY_FLAG) ? "MUL":"");
table->field[15]->store((const char*) pos,
@@ -3286,32 +3797,34 @@ int fill_schema_charsets(THD *thd, TABLE_LIST *tables, COND *cond)
}
-static my_bool iter_schema_engines(THD *thd, st_plugin_int *plugin,
+static my_bool iter_schema_engines(THD *thd, plugin_ref plugin,
void *ptable)
{
TABLE *table= (TABLE *) ptable;
- handlerton *hton= (handlerton *)plugin->data;
+ handlerton *hton= plugin_data(plugin, handlerton *);
const char *wild= thd->lex->wild ? thd->lex->wild->ptr() : NullS;
CHARSET_INFO *scs= system_charset_info;
+ handlerton *default_type= ha_default_handlerton(thd);
DBUG_ENTER("iter_schema_engines");
if (!(hton->flags & HTON_HIDDEN))
{
+ LEX_STRING *name= plugin_name(plugin);
if (!(wild && wild[0] &&
- wild_case_compare(scs, plugin->name.str,wild)))
+ wild_case_compare(scs, name->str,wild)))
{
- LEX_STRING state[2]= {{ C_STRING_WITH_LEN("ENABLED") },
- { C_STRING_WITH_LEN("DISABLED") }};
LEX_STRING yesno[2]= {{ C_STRING_WITH_LEN("NO") },
{ C_STRING_WITH_LEN("YES") }};
LEX_STRING *tmp;
+ const char *option_name= show_comp_option_name[(int) hton->state];
restore_record(table, s->default_values);
- table->field[0]->store(plugin->name.str, plugin->name.length, scs);
- tmp= &state[test(hton->state)];
- table->field[1]->store(tmp->str, tmp->length, scs);
- table->field[2]->store(plugin->plugin->descr,
- strlen(plugin->plugin->descr), scs);
+ table->field[0]->store(name->str, name->length, scs);
+ if (hton->state == SHOW_OPTION_YES && default_type == hton)
+ option_name= "DEFAULT";
+ table->field[1]->store(option_name, strlen(option_name), scs);
+ table->field[2]->store(plugin_decl(plugin)->descr,
+ strlen(plugin_decl(plugin)->descr), scs);
tmp= &yesno[test(hton->commit)];
table->field[3]->store(tmp->str, tmp->length, scs);
tmp= &yesno[test(hton->prepare)];
@@ -3449,7 +3962,7 @@ bool store_schema_proc(THD *thd, TABLE *table, TABLE *proc_table,
}
if (full_access)
{
- get_field(thd->mem_root, proc_table->field[10], &tmp_string);
+ get_field(thd->mem_root, proc_table->field[19], &tmp_string);
table->field[7]->store(tmp_string.ptr(), tmp_string.length(), cs);
table->field[7]->set_notnull();
}
@@ -3472,6 +3985,16 @@ bool store_schema_proc(THD *thd, TABLE *table, TABLE *proc_table,
get_field(thd->mem_root, proc_table->field[15], &tmp_string);
table->field[18]->store(tmp_string.ptr(), tmp_string.length(), cs);
table->field[19]->store(definer.ptr(), definer.length(), cs);
+
+ get_field(thd->mem_root, proc_table->field[16], &tmp_string);
+ table->field[20]->store(tmp_string.ptr(), tmp_string.length(), cs);
+
+ get_field(thd->mem_root, proc_table->field[17], &tmp_string);
+ table->field[21]->store(tmp_string.ptr(), tmp_string.length(), cs);
+
+ get_field(thd->mem_root, proc_table->field[18], &tmp_string);
+ table->field[22]->store(tmp_string.ptr(), tmp_string.length(), cs);
+
return schema_table_store_record(thd, table);
}
}
@@ -3532,10 +4055,10 @@ err:
}
-static int get_schema_stat_record(THD *thd, struct st_table_list *tables,
+static int get_schema_stat_record(THD *thd, TABLE_LIST *tables,
TABLE *table, bool res,
- const char *base_name,
- const char *file_name)
+ LEX_STRING *db_name,
+ LEX_STRING *table_name)
{
CHARSET_INFO *cs= system_charset_info;
DBUG_ENTER("get_schema_stat_record");
@@ -3547,7 +4070,7 @@ static int get_schema_stat_record(THD *thd, struct st_table_list *tables,
I.e. we are in SELECT FROM INFORMATION_SCHEMA.STATISTICS
rather than in SHOW KEYS
*/
- if (!tables->view)
+ if (thd->net.last_errno)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
thd->net.last_errno, thd->net.last_error);
thd->clear_error();
@@ -3558,10 +4081,11 @@ static int get_schema_stat_record(THD *thd, struct st_table_list *tables,
else if (!tables->view)
{
TABLE *show_table= tables->table;
- KEY *key_info=show_table->key_info;
- show_table->file->info(HA_STATUS_VARIABLE |
- HA_STATUS_NO_LOCK |
- HA_STATUS_TIME);
+ KEY *key_info=show_table->s->key_info;
+ if (show_table->file)
+ show_table->file->info(HA_STATUS_VARIABLE |
+ HA_STATUS_NO_LOCK |
+ HA_STATUS_TIME);
for (uint i=0 ; i < show_table->s->keys ; i++,key_info++)
{
KEY_PART_INFO *key_part= key_info->key_part;
@@ -3569,35 +4093,40 @@ static int get_schema_stat_record(THD *thd, struct st_table_list *tables,
for (uint j=0 ; j < key_info->key_parts ; j++,key_part++)
{
restore_record(table, s->default_values);
- table->field[1]->store(base_name, strlen(base_name), cs);
- table->field[2]->store(file_name, strlen(file_name), 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 &
HA_NOSAME) ? 0 : 1), TRUE);
- table->field[4]->store(base_name, strlen(base_name), cs);
+ table->field[4]->store(db_name->str, db_name->length, cs);
table->field[5]->store(key_info->name, strlen(key_info->name), cs);
table->field[6]->store((longlong) (j+1), TRUE);
str=(key_part->field ? key_part->field->field_name :
"?unknown field?");
table->field[7]->store(str, strlen(str), cs);
- if (show_table->file->index_flags(i, j, 0) & HA_READ_ORDER)
+ if (show_table->file)
{
- table->field[8]->store(((key_part->key_part_flag &
- HA_REVERSE_SORT) ?
- "D" : "A"), 1, cs);
- table->field[8]->set_notnull();
- }
- KEY *key=show_table->key_info+i;
- if (key->rec_per_key[j])
- {
- ha_rows records=(show_table->file->stats.records /
- key->rec_per_key[j]);
- table->field[9]->store((longlong) records, TRUE);
- table->field[9]->set_notnull();
+ if (show_table->file->index_flags(i, j, 0) & HA_READ_ORDER)
+ {
+ table->field[8]->store(((key_part->key_part_flag &
+ HA_REVERSE_SORT) ?
+ "D" : "A"), 1, cs);
+ table->field[8]->set_notnull();
+ }
+ KEY *key=show_table->key_info+i;
+ if (key->rec_per_key[j])
+ {
+ ha_rows records=(show_table->file->stats.records /
+ key->rec_per_key[j]);
+ table->field[9]->store((longlong) records, TRUE);
+ table->field[9]->set_notnull();
+ }
+ str= show_table->file->index_type(i);
+ table->field[13]->store(str, strlen(str), cs);
}
if (!(key_info->flags & HA_FULLTEXT) &&
(key_part->field &&
key_part->length !=
- show_table->field[key_part->fieldnr-1]->key_length()))
+ show_table->s->field[key_part->fieldnr-1]->key_length()))
{
table->field[10]->store((longlong) key_part->length /
key_part->field->charset()->mbmaxlen, TRUE);
@@ -3606,8 +4135,6 @@ static int get_schema_stat_record(THD *thd, struct st_table_list *tables,
uint flags= key_part->field ? key_part->field->flags : 0;
const char *pos=(char*) ((flags & NOT_NULL_FLAG) ? "" : "YES");
table->field[12]->store(pos, strlen(pos), cs);
- pos= show_table->file->index_type(i);
- table->field[13]->store(pos, strlen(pos), cs);
if (!show_table->s->keys_in_use.is_set(i))
table->field[14]->store(STRING_WITH_LEN("disabled"), cs);
else
@@ -3622,20 +4149,30 @@ static int get_schema_stat_record(THD *thd, struct st_table_list *tables,
}
-static int get_schema_views_record(THD *thd, struct st_table_list *tables,
+static int get_schema_views_record(THD *thd, TABLE_LIST *tables,
TABLE *table, bool res,
- const char *base_name,
- const char *file_name)
+ LEX_STRING *db_name,
+ LEX_STRING *table_name)
{
CHARSET_INFO *cs= system_charset_info;
DBUG_ENTER("get_schema_views_record");
+ LEX_STRING *tmp_db_name, *tmp_table_name;
char definer[USER_HOST_BUFF_SIZE];
uint definer_len;
+ bool updatable_view;
+ /*
+ if SELECT FROM I_S.VIEWS uses only fields
+ which have OPEN_FRM_ONLY flag then 'tables'
+ structure is zeroed and only tables->view is set.
+ (see fill_schema_table_from_frm() function).
+ So we should disable other fields filling.
+ */
+ bool only_share= !tables->definer.user.str;
if (tables->view)
{
Security_context *sctx= thd->security_ctx;
- if (!tables->allowed_show)
+ if (!only_share && !tables->allowed_show)
{
if (!my_strcasecmp(system_charset_info, tables->definer.user.str,
sctx->priv_user) &&
@@ -3644,44 +4181,88 @@ static int get_schema_views_record(THD *thd, struct st_table_list *tables,
tables->allowed_show= TRUE;
}
restore_record(table, s->default_values);
- table->field[1]->store(tables->view_db.str, tables->view_db.length, cs);
- table->field[2]->store(tables->view_name.str, tables->view_name.length, cs);
- if (tables->allowed_show)
+ tmp_db_name= &tables->view_db;
+ tmp_table_name= &tables->view_name;
+ if (only_share)
{
- char buff[2048];
- String qwe_str(buff, sizeof(buff), cs);
- qwe_str.length(0);
- qwe_str.append(STRING_WITH_LEN("/* "));
- append_algorithm(tables, &qwe_str);
- qwe_str.append(STRING_WITH_LEN("*/ "));
- qwe_str.append(tables->query.str, tables->query.length);
- table->field[3]->store(qwe_str.ptr(), qwe_str.length(), cs);
+ tmp_db_name= db_name;
+ tmp_table_name= table_name;
}
-
- if (tables->with_check != VIEW_CHECK_NONE)
+ 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)
{
- if (tables->with_check == VIEW_CHECK_LOCAL)
- table->field[4]->store(STRING_WITH_LEN("LOCAL"), cs);
+ if (tables->allowed_show)
+ {
+ table->field[3]->store(tables->view_body_utf8.str,
+ tables->view_body_utf8.length,
+ cs);
+ }
+
+ if (tables->with_check != VIEW_CHECK_NONE)
+ {
+ if (tables->with_check == VIEW_CHECK_LOCAL)
+ table->field[4]->store(STRING_WITH_LEN("LOCAL"), cs);
+ else
+ table->field[4]->store(STRING_WITH_LEN("CASCADED"), cs);
+ }
+ else
+ table->field[4]->store(STRING_WITH_LEN("NONE"), cs);
+
+ updatable_view= 0;
+ if (tables->algorithm != VIEW_ALGORITHM_TMPTABLE)
+ {
+ /*
+ We should use tables->view->select_lex.item_list here and
+ can not use Field_iterator_view because the view always uses
+ temporary algorithm during opening for I_S and
+ TABLE_LIST fields 'field_translation' & 'field_translation_end'
+ are uninitialized is this case.
+ */
+ List<Item> *fields= &tables->view->select_lex.item_list;
+ List_iterator<Item> it(*fields);
+ Item *item;
+ Item_field *field;
+ /*
+ check that at least one column in view is updatable
+ */
+ while ((item= it++))
+ {
+ if ((field= item->filed_for_view_update()) && field->field &&
+ !field->field->table->pos_in_table_list->schema_table)
+ {
+ updatable_view= 1;
+ break;
+ }
+ }
+ if (updatable_view && !tables->view->can_be_merged())
+ updatable_view= 0;
+ }
+ if (updatable_view)
+ table->field[5]->store(STRING_WITH_LEN("YES"), cs);
else
- table->field[4]->store(STRING_WITH_LEN("CASCADED"), cs);
+ table->field[5]->store(STRING_WITH_LEN("NO"), cs);
+ definer_len= (strxmov(definer, tables->definer.user.str, "@",
+ tables->definer.host.str, NullS) - definer);
+ table->field[6]->store(definer, definer_len, cs);
+ if (tables->view_suid)
+ table->field[7]->store(STRING_WITH_LEN("DEFINER"), cs);
+ else
+ table->field[7]->store(STRING_WITH_LEN("INVOKER"), cs);
+
+ table->field[8]->store(tables->view_creation_ctx->get_client_cs()->csname,
+ strlen(tables->view_creation_ctx->
+ get_client_cs()->csname), cs);
+
+ table->field[9]->store(tables->view_creation_ctx->
+ get_connection_cl()->name,
+ strlen(tables->view_creation_ctx->
+ get_connection_cl()->name), cs);
}
- else
- table->field[4]->store(STRING_WITH_LEN("NONE"), cs);
- if (tables->updatable_view)
- table->field[5]->store(STRING_WITH_LEN("YES"), cs);
- else
- table->field[5]->store(STRING_WITH_LEN("NO"), cs);
- definer_len= (strxmov(definer, tables->definer.user.str, "@",
- tables->definer.host.str, NullS) - definer);
- table->field[6]->store(definer, definer_len, cs);
- if (tables->view_suid)
- table->field[7]->store(STRING_WITH_LEN("DEFINER"), cs);
- else
- table->field[7]->store(STRING_WITH_LEN("INVOKER"), cs);
if (schema_table_store_record(thd, table))
DBUG_RETURN(1);
- if (res)
+ if (res && thd->net.last_errno)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
thd->net.last_errno, thd->net.last_error);
}
@@ -3691,30 +4272,30 @@ static int get_schema_views_record(THD *thd, struct st_table_list *tables,
}
-bool store_constraints(THD *thd, TABLE *table, const char *db,
- const char *tname, const char *key_name,
+bool store_constraints(THD *thd, TABLE *table, LEX_STRING *db_name,
+ LEX_STRING *table_name, const char *key_name,
uint key_len, const char *con_type, uint con_len)
{
CHARSET_INFO *cs= system_charset_info;
restore_record(table, s->default_values);
- table->field[1]->store(db, strlen(db), 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, strlen(db), cs);
- table->field[4]->store(tname, strlen(tname), cs);
+ table->field[3]->store(db_name->str, db_name->length, cs);
+ table->field[4]->store(table_name->str, table_name->length, cs);
table->field[5]->store(con_type, con_len, cs);
return schema_table_store_record(thd, table);
}
-static int get_schema_constraints_record(THD *thd, struct st_table_list *tables,
+static int get_schema_constraints_record(THD *thd, TABLE_LIST *tables,
TABLE *table, bool res,
- const char *base_name,
- const char *file_name)
+ LEX_STRING *db_name,
+ LEX_STRING *table_name)
{
DBUG_ENTER("get_schema_constraints_record");
if (res)
{
- if (!tables->view)
+ if (thd->net.last_errno)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
thd->net.last_errno, thd->net.last_error);
thd->clear_error();
@@ -3736,14 +4317,14 @@ static int get_schema_constraints_record(THD *thd, struct st_table_list *tables,
if (i == primary_key && !strcmp(key_info->name, primary_key_name))
{
- if (store_constraints(thd, table, base_name, file_name, key_info->name,
+ if (store_constraints(thd, table, db_name, table_name, key_info->name,
strlen(key_info->name),
STRING_WITH_LEN("PRIMARY KEY")))
DBUG_RETURN(1);
}
else if (key_info->flags & HA_NOSAME)
{
- if (store_constraints(thd, table, base_name, file_name, key_info->name,
+ if (store_constraints(thd, table, db_name, table_name, key_info->name,
strlen(key_info->name),
STRING_WITH_LEN("UNIQUE")))
DBUG_RETURN(1);
@@ -3755,7 +4336,7 @@ static int get_schema_constraints_record(THD *thd, struct st_table_list *tables,
List_iterator_fast<FOREIGN_KEY_INFO> it(f_key_list);
while ((f_key_info=it++))
{
- if (store_constraints(thd, table, base_name, file_name,
+ if (store_constraints(thd, table, db_name, table_name,
f_key_info->forein_id->str,
strlen(f_key_info->forein_id->str),
"FOREIGN KEY", 11))
@@ -3766,24 +4347,27 @@ static int get_schema_constraints_record(THD *thd, struct st_table_list *tables,
}
-static bool store_trigger(THD *thd, TABLE *table, const char *db,
- const char *tname, LEX_STRING *trigger_name,
+static bool store_trigger(THD *thd, TABLE *table, LEX_STRING *db_name,
+ LEX_STRING *table_name, LEX_STRING *trigger_name,
enum trg_event_type event,
enum trg_action_time_type timing,
LEX_STRING *trigger_stmt,
ulong sql_mode,
- LEX_STRING *definer_buffer)
+ LEX_STRING *definer_buffer,
+ LEX_STRING *client_cs_name,
+ LEX_STRING *connection_cl_name,
+ LEX_STRING *db_cl_name)
{
CHARSET_INFO *cs= system_charset_info;
LEX_STRING sql_mode_rep;
restore_record(table, s->default_values);
- table->field[1]->store(db, strlen(db), 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[5]->store(db, strlen(db), cs);
- table->field[6]->store(tname, strlen(tname), 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);
table->field[10]->store(STRING_WITH_LEN("ROW"), cs);
table->field[11]->store(trg_action_time_type_names[timing].str,
@@ -3794,15 +4378,20 @@ static bool store_trigger(THD *thd, TABLE *table, const char *db,
sys_var_thd_sql_mode::symbolic_mode_representation(thd, sql_mode,
&sql_mode_rep);
table->field[17]->store(sql_mode_rep.str, sql_mode_rep.length, cs);
- table->field[18]->store((const char *)definer_buffer->str, definer_buffer->length, cs);
+ table->field[18]->store(definer_buffer->str, definer_buffer->length, cs);
+ table->field[19]->store(client_cs_name->str, client_cs_name->length, cs);
+ table->field[20]->store(connection_cl_name->str,
+ connection_cl_name->length, cs);
+ table->field[21]->store(db_cl_name->str, db_cl_name->length, cs);
+
return schema_table_store_record(thd, table);
}
-static int get_schema_triggers_record(THD *thd, struct st_table_list *tables,
+static int get_schema_triggers_record(THD *thd, TABLE_LIST *tables,
TABLE *table, bool res,
- const char *base_name,
- const char *file_name)
+ LEX_STRING *db_name,
+ LEX_STRING *table_name)
{
DBUG_ENTER("get_schema_triggers_record");
/*
@@ -3811,7 +4400,7 @@ static int get_schema_triggers_record(THD *thd, struct st_table_list *tables,
*/
if (res)
{
- if (!tables->view)
+ if (thd->net.last_errno)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
thd->net.last_errno, thd->net.last_error);
thd->clear_error();
@@ -3821,6 +4410,12 @@ static int get_schema_triggers_record(THD *thd, struct st_table_list *tables,
{
Table_triggers_list *triggers= tables->table->triggers;
int event, timing;
+
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
+ if (check_table_access(thd, TRIGGER_ACL, tables, 1))
+ goto ret;
+#endif
+
for (event= 0; event < (int)TRG_EVENT_MAX; event++)
{
for (timing= 0; timing < (int)TRG_ACTION_MAX; timing++)
@@ -3830,51 +4425,65 @@ static int get_schema_triggers_record(THD *thd, struct st_table_list *tables,
ulong sql_mode;
char definer_holder[USER_HOST_BUFF_SIZE];
LEX_STRING definer_buffer;
+ LEX_STRING client_cs_name;
+ LEX_STRING connection_cl_name;
+ LEX_STRING db_cl_name;
+
definer_buffer.str= definer_holder;
if (triggers->get_trigger_info(thd, (enum trg_event_type) event,
(enum trg_action_time_type)timing,
&trigger_name, &trigger_stmt,
&sql_mode,
- &definer_buffer))
+ &definer_buffer,
+ &client_cs_name,
+ &connection_cl_name,
+ &db_cl_name))
continue;
- if (store_trigger(thd, table, base_name, file_name, &trigger_name,
+ if (store_trigger(thd, table, db_name, table_name, &trigger_name,
(enum trg_event_type) event,
(enum trg_action_time_type) timing, &trigger_stmt,
sql_mode,
- &definer_buffer))
+ &definer_buffer,
+ &client_cs_name,
+ &connection_cl_name,
+ &db_cl_name))
DBUG_RETURN(1);
}
}
}
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
+ret:
+#endif
DBUG_RETURN(0);
}
-void store_key_column_usage(TABLE *table, const char*db, const char *tname,
- const char *key_name, uint key_len,
- const char *con_type, uint con_len, longlong idx)
+void store_key_column_usage(TABLE *table, LEX_STRING *db_name,
+ LEX_STRING *table_name, const char *key_name,
+ uint key_len, const char *con_type, uint con_len,
+ longlong idx)
{
CHARSET_INFO *cs= system_charset_info;
- table->field[1]->store(db, strlen(db), cs);
+ table->field[1]->store(db_name->str, db_name->length, cs);
table->field[2]->store(key_name, key_len, cs);
- table->field[4]->store(db, strlen(db), cs);
- table->field[5]->store(tname, strlen(tname), 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);
table->field[7]->store((longlong) idx, TRUE);
}
static int get_schema_key_column_usage_record(THD *thd,
- struct st_table_list *tables,
+ TABLE_LIST *tables,
TABLE *table, bool res,
- const char *base_name,
- const char *file_name)
+ LEX_STRING *db_name,
+ LEX_STRING *table_name)
{
DBUG_ENTER("get_schema_key_column_usage_record");
if (res)
{
- if (!tables->view)
+ if (thd->net.last_errno)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
thd->net.last_errno, thd->net.last_error);
thd->clear_error();
@@ -3901,7 +4510,7 @@ static int get_schema_key_column_usage_record(THD *thd,
{
f_idx++;
restore_record(table, s->default_values);
- store_key_column_usage(table, base_name, file_name,
+ store_key_column_usage(table, db_name, table_name,
key_info->name,
strlen(key_info->name),
key_part->field->field_name,
@@ -3928,7 +4537,7 @@ static int get_schema_key_column_usage_record(THD *thd,
r_info= it1++;
f_idx++;
restore_record(table, s->default_values);
- store_key_column_usage(table, base_name, file_name,
+ store_key_column_usage(table, db_name, table_name,
f_key_info->forein_id->str,
f_key_info->forein_id->length,
f_info->str, f_info->length,
@@ -3955,6 +4564,7 @@ static int get_schema_key_column_usage_record(THD *thd,
}
+#ifdef WITH_PARTITION_STORAGE_ENGINE
static void collect_partition_expr(List<char> &field_list, String *str)
{
List_iterator<char> part_it(field_list);
@@ -3969,6 +4579,7 @@ static void collect_partition_expr(List<char> &field_list, String *str)
}
return;
}
+#endif
static void store_schema_partitions_record(THD *thd, TABLE *schema_table,
@@ -4023,7 +4634,7 @@ static void store_schema_partitions_record(THD *thd, TABLE *schema_table,
table->field[22]->store(part_elem->part_comment,
strlen(part_elem->part_comment), cs);
else
- table->field[22]->store(STRING_WITH_LEN("default"), cs);
+ table->field[22]->store(STRING_WITH_LEN(""), cs);
if (part_elem->nodegroup_id != UNDEF_NODEGROUP)
table->field[23]->store((longlong) part_elem->nodegroup_id, TRUE);
else
@@ -4049,10 +4660,10 @@ static void store_schema_partitions_record(THD *thd, TABLE *schema_table,
}
-static int get_schema_partitions_record(THD *thd, struct st_table_list *tables,
+static int get_schema_partitions_record(THD *thd, TABLE_LIST *tables,
TABLE *table, bool res,
- const char *base_name,
- const char *file_name)
+ LEX_STRING *db_name,
+ LEX_STRING *table_name)
{
CHARSET_INFO *cs= system_charset_info;
char buff[61];
@@ -4067,7 +4678,7 @@ static int get_schema_partitions_record(THD *thd, struct st_table_list *tables,
if (res)
{
- if (!tables->view)
+ if (thd->net.last_errno)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
thd->net.last_errno, thd->net.last_error);
thd->clear_error();
@@ -4083,8 +4694,8 @@ static int get_schema_partitions_record(THD *thd, struct st_table_list *tables,
uint part_pos= 0, part_id= 0;
restore_record(table, s->default_values);
- table->field[1]->store(base_name, strlen(base_name), cs);
- table->field[2]->store(file_name, strlen(file_name), cs);
+ table->field[1]->store(db_name->str, db_name->length, cs);
+ table->field[2]->store(table_name->str, table_name->length, cs);
/* Partition method*/
@@ -4318,7 +4929,7 @@ copy_event_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table)
const char *wild= thd->lex->wild ? thd->lex->wild->ptr() : NullS;
CHARSET_INFO *scs= system_charset_info;
MYSQL_TIME time;
- Event_timed et;
+ Event_timed et;
DBUG_ENTER("copy_event_to_schema_table");
restore_record(sch_table, s->default_values);
@@ -4355,8 +4966,8 @@ copy_event_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table)
store(tz_name->ptr(), tz_name->length(), scs);
sch_table->field[ISE_EVENT_BODY]->
store(STRING_WITH_LEN("SQL"), scs);
- sch_table->field[ISE_EVENT_DEFINITION]->
- store(et.body.str, et.body.length, scs);
+ sch_table->field[ISE_EVENT_DEFINITION]->store(
+ et.body_utf8.str, et.body_utf8.length, scs);
/* SQL_MODE */
{
@@ -4459,6 +5070,24 @@ copy_event_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table)
sch_table->field[ISE_EVENT_COMMENT]->
store(et.comment.str, et.comment.length, scs);
+ sch_table->field[ISE_CLIENT_CS]->set_notnull();
+ sch_table->field[ISE_CLIENT_CS]->store(
+ et.creation_ctx->get_client_cs()->csname,
+ strlen(et.creation_ctx->get_client_cs()->csname),
+ scs);
+
+ sch_table->field[ISE_CONNECTION_CL]->set_notnull();
+ sch_table->field[ISE_CONNECTION_CL]->store(
+ et.creation_ctx->get_connection_cl()->name,
+ strlen(et.creation_ctx->get_connection_cl()->name),
+ scs);
+
+ sch_table->field[ISE_DB_CL]->set_notnull();
+ sch_table->field[ISE_DB_CL]->store(
+ et.creation_ctx->get_db_cl()->name,
+ strlen(et.creation_ctx->get_db_cl()->name),
+ scs);
+
if (schema_table_store_record(thd, sch_table))
DBUG_RETURN(1);
@@ -4497,10 +5126,20 @@ int fill_variables(THD *thd, TABLE_LIST *tables, COND *cond)
int res= 0;
LEX *lex= thd->lex;
const char *wild= lex->wild ? lex->wild->ptr() : NullS;
- pthread_mutex_lock(&LOCK_global_system_variables);
- res= show_status_array(thd, wild, init_vars,
- lex->option_type, 0, "", tables->table, 0);
- pthread_mutex_unlock(&LOCK_global_system_variables);
+ enum enum_schema_tables schema_table_idx=
+ get_schema_table_idx(tables->schema_table);
+ enum enum_var_type option_type= OPT_SESSION;
+ bool upper_case_names= (schema_table_idx != SCH_VARIABLES);
+ bool sorted_vars= (schema_table_idx == SCH_VARIABLES);
+
+ if (lex->option_type == OPT_GLOBAL ||
+ schema_table_idx == SCH_GLOBAL_VARIABLES)
+ option_type= OPT_GLOBAL;
+
+ rw_rdlock(&LOCK_system_variables_hash);
+ res= show_status_array(thd, wild, enumerate_sys_vars(thd, sorted_vars),
+ option_type, NULL, "", tables->table, upper_case_names);
+ rw_unlock(&LOCK_system_variables_hash);
DBUG_RETURN(res);
}
@@ -4511,16 +5150,38 @@ int fill_status(THD *thd, TABLE_LIST *tables, COND *cond)
LEX *lex= thd->lex;
const char *wild= lex->wild ? lex->wild->ptr() : NullS;
int res= 0;
- STATUS_VAR tmp;
+ STATUS_VAR *tmp1, tmp;
+ enum enum_schema_tables schema_table_idx=
+ get_schema_table_idx(tables->schema_table);
+ enum enum_var_type option_type;
+ bool upper_case_names= (schema_table_idx != SCH_STATUS);
+
+ if (schema_table_idx == SCH_STATUS)
+ {
+ option_type= lex->option_type;
+ if (option_type == OPT_GLOBAL)
+ tmp1= &tmp;
+ else
+ tmp1= thd->initial_status_var;
+ }
+ else if (schema_table_idx == SCH_GLOBAL_STATUS)
+ {
+ option_type= OPT_GLOBAL;
+ tmp1= &tmp;
+ }
+ else
+ {
+ option_type= OPT_SESSION;
+ tmp1= &thd->status_var;
+ }
+
pthread_mutex_lock(&LOCK_status);
- if (lex->option_type == OPT_GLOBAL)
+ if (option_type == OPT_GLOBAL)
calc_sum_of_all_status(&tmp);
res= show_status_array(thd, wild,
(SHOW_VAR *)all_status_vars.buffer,
- OPT_GLOBAL,
- (lex->option_type == OPT_GLOBAL ?
- &tmp: thd->initial_status_var),
- "", tables->table, 0);
+ option_type, tmp1, "", tables->table,
+ upper_case_names);
pthread_mutex_unlock(&LOCK_status);
DBUG_RETURN(res);
}
@@ -4545,16 +5206,16 @@ int fill_status(THD *thd, TABLE_LIST *tables, COND *cond)
*/
static int
-get_referential_constraints_record(THD *thd, struct st_table_list *tables,
+get_referential_constraints_record(THD *thd, TABLE_LIST *tables,
TABLE *table, bool res,
- const char *base_name, const char *file_name)
+ LEX_STRING *db_name, LEX_STRING *table_name)
{
CHARSET_INFO *cs= system_charset_info;
DBUG_ENTER("get_referential_constraints_record");
if (res)
{
- if (!tables->view)
+ if (thd->net.last_errno)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
thd->net.last_errno, thd->net.last_error);
thd->clear_error();
@@ -4574,8 +5235,8 @@ get_referential_constraints_record(THD *thd, struct st_table_list *tables,
while ((f_key_info= it++))
{
restore_record(table, s->default_values);
- table->field[1]->store(base_name, strlen(base_name), cs);
- table->field[9]->store(file_name, strlen(file_name), 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[4]->store(f_key_info->referenced_db->str,
@@ -4616,12 +5277,12 @@ struct schema_table_ref
0 table not found
1 found the schema table
*/
-static my_bool find_schema_table_in_plugin(THD *thd, st_plugin_int *plugin,
+static my_bool find_schema_table_in_plugin(THD *thd, plugin_ref plugin,
void* p_table)
{
schema_table_ref *p_schema_table= (schema_table_ref *)p_table;
const char* table_name= p_schema_table->table_name;
- ST_SCHEMA_TABLE *schema_table= (ST_SCHEMA_TABLE *)plugin->data;
+ ST_SCHEMA_TABLE *schema_table= plugin_data(plugin, ST_SCHEMA_TABLE *);
DBUG_ENTER("find_schema_table_in_plugin");
if (!my_strcasecmp(system_charset_info,
@@ -4645,7 +5306,7 @@ static my_bool find_schema_table_in_plugin(THD *thd, st_plugin_int *plugin,
RETURN
0 table not found
- # pointer to 'shema_tables' element
+ # pointer to 'schema_tables' element
*/
ST_SCHEMA_TABLE *find_schema_table(THD *thd, const char* table_name)
@@ -4763,12 +5424,10 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list)
/* Don't let unimplemented types pass through. Could be a grave error. */
DBUG_ASSERT(fields_info->field_type == MYSQL_TYPE_STRING);
- /* this should be changed when Item_empty_string is fixed(in 4.1) */
- if (!(item= new Item_empty_string("", 0, cs)))
+ if (!(item= new Item_empty_string("", fields_info->field_length, cs)))
{
DBUG_RETURN(0);
}
- item->max_length= fields_info->field_length * cs->mbmaxlen;
item->set_name(fields_info->field_name,
strlen(fields_info->field_name), cs);
break;
@@ -4790,6 +5449,12 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list)
TMP_TABLE_ALL_COLUMNS),
HA_POS_ERROR, table_list->alias)))
DBUG_RETURN(0);
+ my_bitmap_map* bitmaps=
+ (my_bitmap_map*) thd->alloc(bitmap_buffer_size(field_count));
+ bitmap_init(&table->def_read_set, (my_bitmap_map*) bitmaps, field_count,
+ FALSE);
+ table->read_set= &table->def_read_set;
+ bitmap_clear_all(table->read_set);
table_list->schema_table_param= tmp_table_param;
DBUG_RETURN(table);
}
@@ -4955,7 +5620,7 @@ int make_character_sets_old_format(THD *thd, ST_SCHEMA_TABLE *schema_table)
int make_proc_old_format(THD *thd, ST_SCHEMA_TABLE *schema_table)
{
- int fields_arr[]= {2, 3, 4, 19, 16, 15, 14, 18, -1};
+ int fields_arr[]= {2, 3, 4, 19, 16, 15, 14, 18, 20, 21, 22, -1};
int *field_num= fields_arr;
ST_FIELD_INFO *field_info;
Name_resolution_context *context= &thd->lex->select_lex.context;
@@ -5086,10 +5751,10 @@ int make_schema_select(THD *thd, SELECT_LEX *sel,
We have to make non const db_name & table_name
because of lower_case_table_names
*/
- make_lex_string(thd, &db, INFORMATION_SCHEMA_NAME.str,
- INFORMATION_SCHEMA_NAME.length, 0);
- make_lex_string(thd, &table, schema_table->table_name,
- strlen(schema_table->table_name), 0);
+ thd->make_lex_string(&db, INFORMATION_SCHEMA_NAME.str,
+ INFORMATION_SCHEMA_NAME.length, 0);
+ thd->make_lex_string(&table, schema_table->table_name,
+ strlen(schema_table->table_name), 0);
if (schema_table->old_format(thd, schema_table) || /* Handle old syntax */
!sel->add_table_to_list(thd, new Table_ident(thd, db, table, 0),
0, 0, TL_READ))
@@ -5133,6 +5798,13 @@ bool get_schema_tables_result(JOIN *join,
{
bool is_subselect= (&lex->unit != lex->current_select->master_unit() &&
lex->current_select->master_unit()->item);
+
+
+ /* skip I_S optimizations specific to get_all_tables */
+ if (thd->lex->describe &&
+ (table_list->schema_table->fill_table != get_all_tables))
+ continue;
+
/*
If schema table is already processed and
the statement is not a subselect then
@@ -5184,12 +5856,12 @@ struct run_hton_fill_schema_files_args
COND *cond;
};
-static my_bool run_hton_fill_schema_files(THD *thd, st_plugin_int *plugin,
+static my_bool run_hton_fill_schema_files(THD *thd, plugin_ref plugin,
void *arg)
{
struct run_hton_fill_schema_files_args *args=
(run_hton_fill_schema_files_args *) arg;
- handlerton *hton= (handlerton *)plugin->data;
+ handlerton *hton= plugin_data(plugin, handlerton *);
if(hton->fill_files_table && hton->state == SHOW_OPTION_YES)
hton->fill_files_table(hton, thd, args->tables, args->cond);
return false;
@@ -5209,644 +5881,540 @@ int fill_schema_files(THD *thd, TABLE_LIST *tables, COND *cond)
DBUG_RETURN(0);
}
-int fill_schema_status(THD *thd, SHOW_VAR *variables,
- struct system_status_var *status_var,
- const char *prefix, TABLE *table)
-{
- SHOW_VAR tmp, *var;
- SHOW_TYPE show_type;
- LEX_STRING null_lex_str;
- char buff[SHOW_VAR_FUNC_BUFF_SIZE];
- char name_buf[64], *name_pos;
- int name_len;
- DBUG_ENTER("fill_schema_status");
-
- null_lex_str.str= 0;
- null_lex_str.length= 0;
-
- name_pos= strnmov(name_buf, prefix, sizeof(name_buf) - 1);
- if (*prefix)
- *name_pos++= '_';
- name_len= name_buf + sizeof(name_buf) - name_pos;
-
- for (; variables->name; variables++)
- {
- strnmov(name_pos, variables->name, name_len);
- name_buf[sizeof(name_buf) - 1]= 0;
- make_upper(name_buf);
-
- for (var= variables; var->type == SHOW_FUNC; var= &tmp)
- ((mysql_show_var_func)(var->value))(thd, &tmp, buff);
-
- show_type= var->type;
-
- if (show_type == SHOW_ARRAY)
- {
- fill_schema_status(thd, (SHOW_VAR*) var->value,
- status_var, name_buf, table);
- }
- else
- {
- char *value= var->value;
-
- restore_record(table, s->default_values);
- table->field[0]->store(name_buf, strlen(name_buf), system_charset_info);
-
- if (show_type == SHOW_SYS)
- {
- show_type= ((sys_var*) value)->show_type();
- value= (char*) ((sys_var*) value)->value_ptr(thd, OPT_GLOBAL,
- &null_lex_str);
- }
-
- switch (show_type)
- {
- case SHOW_DOUBLE_STATUS:
- value= (char*) status_var + (ulong) value;
- table->field[1]->store(*(double*) value);
- break;
- case SHOW_LONG_STATUS:
- value= (char*) status_var + (ulong) value;
- /* fall through */
- case SHOW_LONG:
- case SHOW_LONG_NOFLUSH: /* the difference lies in refresh_status() */
- table->field[1]->store((longlong) *(long*) value, false);
- break;
- case SHOW_LONGLONG:
- table->field[1]->store(*(longlong*) value, false);
- break;
- case SHOW_HA_ROWS:
- table->field[1]->store((longlong) *(ha_rows*) value, false);
- break;
- case SHOW_BOOL:
- table->field[1]->store((longlong) *(bool*) value, false);
- break;
- case SHOW_MY_BOOL:
- table->field[1]->store((longlong) *(my_bool*) value, false);
- break;
- case SHOW_INT:
- table->field[1]->store((longlong) *(uint32*) value, false);
- break;
- case SHOW_HAVE: /* always displayed as 0 */
- table->field[1]->store((longlong) 0, false);
- break;
- case SHOW_CHAR_PTR:
- value= *(char**) value;
- /* fall through */
- case SHOW_CHAR: /* always displayed as 0 */
- table->field[1]->store((longlong) 0, false);
- break;
- case SHOW_KEY_CACHE_LONG:
- value= (char*) dflt_key_cache + (ulong) value;
- table->field[1]->store((longlong) *(long*) value, false);
- break;
- case SHOW_KEY_CACHE_LONGLONG:
- value= (char*) dflt_key_cache + (ulong) value;
- table->field[1]->store(*(longlong*) value, false);
- break;
- case SHOW_UNDEF: /* always displayed as 0 */
- table->field[1]->store((longlong) 0, false);
- break;
- case SHOW_SYS: /* cannot happen */
- default:
- DBUG_ASSERT(0);
- break;
- }
-
- table->field[1]->set_notnull();
- if (schema_table_store_record(thd, table))
- DBUG_RETURN(1);
- }
- }
-
- DBUG_RETURN(0);
-}
-
-int fill_schema_global_status(THD *thd, TABLE_LIST *tables, COND *cond)
-{
- STATUS_VAR tmp;
- int res= 0;
- DBUG_ENTER("fill_schema_global_status");
-
- pthread_mutex_lock(&LOCK_status);
- calc_sum_of_all_status(&tmp);
- res= fill_schema_status(thd, (SHOW_VAR*) all_status_vars.buffer,
- &tmp, "", tables->table);
- pthread_mutex_unlock(&LOCK_status);
-
- DBUG_RETURN(res);
-}
-
-int fill_schema_session_status(THD *thd, TABLE_LIST *tables, COND *cond)
-{
- int res= 0;
- DBUG_ENTER("fill_schema_session_status");
-
- pthread_mutex_lock(&LOCK_status);
- res= fill_schema_status(thd, (SHOW_VAR*) all_status_vars.buffer,
- &thd->status_var, "", tables->table);
- pthread_mutex_unlock(&LOCK_status);
-
- DBUG_RETURN(res);
-}
-
-int fill_schema_global_variables(THD *thd, TABLE_LIST *tables, COND *cond)
-{
- int res= 0;
- DBUG_ENTER("fill_schema_global_variables");
-
- pthread_mutex_lock(&LOCK_global_system_variables);
- res= show_status_array(thd, "", init_vars, OPT_GLOBAL,
- NULL, "", tables->table, 1);
- pthread_mutex_unlock(&LOCK_global_system_variables);
-
- DBUG_RETURN(res);
-}
-
-int fill_schema_session_variables(THD *thd, TABLE_LIST *tables, COND *cond)
-{
- int res= 0;
- DBUG_ENTER("fill_schema_session_variables");
-
- pthread_mutex_lock(&LOCK_global_system_variables);
- res= show_status_array(thd, "", init_vars, OPT_SESSION,
- NULL, "", tables->table, 1);
- pthread_mutex_unlock(&LOCK_global_system_variables);
-
- DBUG_RETURN(res);
-}
ST_FIELD_INFO schema_fields_info[]=
{
- {"CATALOG_NAME", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"SCHEMA_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Database"},
- {"DEFAULT_CHARACTER_SET_NAME", 64, MYSQL_TYPE_STRING, 0, 0, 0},
- {"DEFAULT_COLLATION_NAME", 64, MYSQL_TYPE_STRING, 0, 0, 0},
- {"SQL_PATH", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+ {"CATALOG_NAME", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"SCHEMA_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Database",
+ SKIP_OPEN_TABLE},
+ {"DEFAULT_CHARACTER_SET_NAME", 64, MYSQL_TYPE_STRING, 0, 0, 0,
+ SKIP_OPEN_TABLE},
+ {"DEFAULT_COLLATION_NAME", 64, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
+ {"SQL_PATH", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
ST_FIELD_INFO tables_fields_info[]=
{
- {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Name"},
- {"TABLE_TYPE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"ENGINE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, "Engine"},
+ {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 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},
+ {"TABLE_TYPE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY},
+ {"ENGINE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, "Engine", OPEN_FRM_ONLY},
{"VERSION", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG, 0,
- (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Version"},
- {"ROW_FORMAT", 10, MYSQL_TYPE_STRING, 0, 1, "Row_format"},
+ (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Version", OPEN_FRM_ONLY},
+ {"ROW_FORMAT", 10, MYSQL_TYPE_STRING, 0, 1, "Row_format", OPEN_FULL_TABLE},
{"TABLE_ROWS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG, 0,
- (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Rows"},
+ (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Rows", OPEN_FULL_TABLE},
{"AVG_ROW_LENGTH", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG, 0,
- (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Avg_row_length"},
+ (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Avg_row_length", OPEN_FULL_TABLE},
{"DATA_LENGTH", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG, 0,
- (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Data_length"},
+ (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Data_length", OPEN_FULL_TABLE},
{"MAX_DATA_LENGTH", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG, 0,
- (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Max_data_length"},
+ (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Max_data_length", OPEN_FULL_TABLE},
{"INDEX_LENGTH", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG, 0,
- (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Index_length"},
+ (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Index_length", OPEN_FULL_TABLE},
{"DATA_FREE", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG, 0,
- (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Data_free"},
+ (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Data_free", OPEN_FULL_TABLE},
{"AUTO_INCREMENT", MY_INT64_NUM_DECIMAL_DIGITS , MYSQL_TYPE_LONGLONG, 0,
- (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Auto_increment"},
- {"CREATE_TIME", 0, MYSQL_TYPE_DATETIME, 0, 1, "Create_time"},
- {"UPDATE_TIME", 0, MYSQL_TYPE_DATETIME, 0, 1, "Update_time"},
- {"CHECK_TIME", 0, MYSQL_TYPE_DATETIME, 0, 1, "Check_time"},
- {"TABLE_COLLATION", 64, MYSQL_TYPE_STRING, 0, 1, "Collation"},
+ (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Auto_increment", OPEN_FULL_TABLE},
+ {"CREATE_TIME", 0, MYSQL_TYPE_DATETIME, 0, 1, "Create_time", OPEN_FULL_TABLE},
+ {"UPDATE_TIME", 0, MYSQL_TYPE_DATETIME, 0, 1, "Update_time", OPEN_FULL_TABLE},
+ {"CHECK_TIME", 0, MYSQL_TYPE_DATETIME, 0, 1, "Check_time", OPEN_FULL_TABLE},
+ {"TABLE_COLLATION", 64, MYSQL_TYPE_STRING, 0, 1, "Collation", OPEN_FRM_ONLY},
{"CHECKSUM", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG, 0,
- (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Checksum"},
- {"CREATE_OPTIONS", 255, MYSQL_TYPE_STRING, 0, 1, "Create_options"},
- {"TABLE_COMMENT", 80, MYSQL_TYPE_STRING, 0, 0, "Comment"},
- {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+ (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Checksum", OPEN_FULL_TABLE},
+ {"CREATE_OPTIONS", 255, MYSQL_TYPE_STRING, 0, 1, "Create_options",
+ OPEN_FRM_ONLY},
+ {"TABLE_COMMENT", 80, MYSQL_TYPE_STRING, 0, 0, "Comment", OPEN_FRM_ONLY},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
ST_FIELD_INFO columns_fields_info[]=
{
- {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"COLUMN_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Field"},
+ {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 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",
+ OPEN_FRM_ONLY},
{"ORDINAL_POSITION", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG, 0,
- MY_I_S_UNSIGNED, 0},
+ MY_I_S_UNSIGNED, 0, OPEN_FRM_ONLY},
{"COLUMN_DEFAULT", MAX_FIELD_VARCHARLENGTH, MYSQL_TYPE_STRING, 0,
- 1, "Default"},
- {"IS_NULLABLE", 3, MYSQL_TYPE_STRING, 0, 0, "Null"},
- {"DATA_TYPE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
+ 1, "Default", OPEN_FRM_ONLY},
+ {"IS_NULLABLE", 3, MYSQL_TYPE_STRING, 0, 0, "Null", OPEN_FRM_ONLY},
+ {"DATA_TYPE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY},
{"CHARACTER_MAXIMUM_LENGTH", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
- 0, (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), 0},
+ 0, (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), 0, OPEN_FRM_ONLY},
{"CHARACTER_OCTET_LENGTH", MY_INT64_NUM_DECIMAL_DIGITS , MYSQL_TYPE_LONGLONG,
- 0, (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), 0},
+ 0, (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), 0, OPEN_FRM_ONLY},
{"NUMERIC_PRECISION", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
- 0, (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), 0},
+ 0, (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), 0, OPEN_FRM_ONLY},
{"NUMERIC_SCALE", MY_INT64_NUM_DECIMAL_DIGITS , MYSQL_TYPE_LONGLONG,
- 0, (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), 0},
- {"CHARACTER_SET_NAME", 64, MYSQL_TYPE_STRING, 0, 1, 0},
- {"COLLATION_NAME", 64, MYSQL_TYPE_STRING, 0, 1, "Collation"},
- {"COLUMN_TYPE", 65535, MYSQL_TYPE_STRING, 0, 0, "Type"},
- {"COLUMN_KEY", 3, MYSQL_TYPE_STRING, 0, 0, "Key"},
- {"EXTRA", 20, MYSQL_TYPE_STRING, 0, 0, "Extra"},
- {"PRIVILEGES", 80, MYSQL_TYPE_STRING, 0, 0, "Privileges"},
- {"COLUMN_COMMENT", 255, MYSQL_TYPE_STRING, 0, 0, "Comment"},
- {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+ 0, (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), 0, OPEN_FRM_ONLY},
+ {"CHARACTER_SET_NAME", 64, MYSQL_TYPE_STRING, 0, 1, 0, OPEN_FRM_ONLY},
+ {"COLLATION_NAME", 64, MYSQL_TYPE_STRING, 0, 1, "Collation", OPEN_FRM_ONLY},
+ {"COLUMN_TYPE", 65535, MYSQL_TYPE_STRING, 0, 0, "Type", OPEN_FRM_ONLY},
+ {"COLUMN_KEY", 3, MYSQL_TYPE_STRING, 0, 0, "Key", OPEN_FRM_ONLY},
+ {"EXTRA", 20, MYSQL_TYPE_STRING, 0, 0, "Extra", OPEN_FRM_ONLY},
+ {"PRIVILEGES", 80, MYSQL_TYPE_STRING, 0, 0, "Privileges", OPEN_FRM_ONLY},
+ {"COLUMN_COMMENT", 255, MYSQL_TYPE_STRING, 0, 0, "Comment", OPEN_FRM_ONLY},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
ST_FIELD_INFO charsets_fields_info[]=
{
- {"CHARACTER_SET_NAME", 64, MYSQL_TYPE_STRING, 0, 0, "Charset"},
- {"DEFAULT_COLLATE_NAME", 64, MYSQL_TYPE_STRING, 0, 0, "Default collation"},
- {"DESCRIPTION", 60, MYSQL_TYPE_STRING, 0, 0, "Description"},
- {"MAXLEN", 3, MYSQL_TYPE_LONGLONG, 0, 0, "Maxlen"},
- {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+ {"CHARACTER_SET_NAME", 64, MYSQL_TYPE_STRING, 0, 0, "Charset",
+ SKIP_OPEN_TABLE},
+ {"DEFAULT_COLLATE_NAME", 64, MYSQL_TYPE_STRING, 0, 0, "Default collation",
+ SKIP_OPEN_TABLE},
+ {"DESCRIPTION", 60, MYSQL_TYPE_STRING, 0, 0, "Description",
+ SKIP_OPEN_TABLE},
+ {"MAXLEN", 3, MYSQL_TYPE_LONGLONG, 0, 0, "Maxlen", SKIP_OPEN_TABLE},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
ST_FIELD_INFO collation_fields_info[]=
{
- {"COLLATION_NAME", 64, MYSQL_TYPE_STRING, 0, 0, "Collation"},
- {"CHARACTER_SET_NAME", 64, MYSQL_TYPE_STRING, 0, 0, "Charset"},
- {"ID", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG, 0, 0, "Id"},
- {"IS_DEFAULT", 3, MYSQL_TYPE_STRING, 0, 0, "Default"},
- {"IS_COMPILED", 3, MYSQL_TYPE_STRING, 0, 0, "Compiled"},
- {"SORTLEN", 3, MYSQL_TYPE_LONGLONG, 0, 0, "Sortlen"},
- {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+ {"COLLATION_NAME", 64, MYSQL_TYPE_STRING, 0, 0, "Collation", SKIP_OPEN_TABLE},
+ {"CHARACTER_SET_NAME", 64, MYSQL_TYPE_STRING, 0, 0, "Charset",
+ SKIP_OPEN_TABLE},
+ {"ID", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG, 0, 0, "Id",
+ SKIP_OPEN_TABLE},
+ {"IS_DEFAULT", 3, MYSQL_TYPE_STRING, 0, 0, "Default", SKIP_OPEN_TABLE},
+ {"IS_COMPILED", 3, MYSQL_TYPE_STRING, 0, 0, "Compiled", SKIP_OPEN_TABLE},
+ {"SORTLEN", 3, MYSQL_TYPE_LONGLONG, 0, 0, "Sortlen", SKIP_OPEN_TABLE},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
ST_FIELD_INFO engines_fields_info[]=
{
- {"ENGINE", 64, MYSQL_TYPE_STRING, 0, 0, "Engine"},
- {"SUPPORT", 8, MYSQL_TYPE_STRING, 0, 0, "Support"},
- {"COMMENT", 80, MYSQL_TYPE_STRING, 0, 0, "Comment"},
- {"TRANSACTIONS", 3, MYSQL_TYPE_STRING, 0, 0, "Transactions"},
- {"XA", 3, MYSQL_TYPE_STRING, 0, 0, "XA"},
- {"SAVEPOINTS", 3 ,MYSQL_TYPE_STRING, 0, 0, "Savepoints"},
- {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+ {"ENGINE", 64, MYSQL_TYPE_STRING, 0, 0, "Engine", SKIP_OPEN_TABLE},
+ {"SUPPORT", 8, MYSQL_TYPE_STRING, 0, 0, "Support", SKIP_OPEN_TABLE},
+ {"COMMENT", 80, MYSQL_TYPE_STRING, 0, 0, "Comment", SKIP_OPEN_TABLE},
+ {"TRANSACTIONS", 3, MYSQL_TYPE_STRING, 0, 0, "Transactions", SKIP_OPEN_TABLE},
+ {"XA", 3, MYSQL_TYPE_STRING, 0, 0, "XA", SKIP_OPEN_TABLE},
+ {"SAVEPOINTS", 3 ,MYSQL_TYPE_STRING, 0, 0, "Savepoints", SKIP_OPEN_TABLE},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
ST_FIELD_INFO events_fields_info[]=
{
- {"EVENT_CATALOG", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"EVENT_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Db"},
- {"EVENT_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Name"},
- {"DEFINER", 77, MYSQL_TYPE_STRING, 0, 0, "Definer"},
- {"TIME_ZONE", 64, MYSQL_TYPE_STRING, 0, 0, "Time zone"},
- {"EVENT_BODY", 8, MYSQL_TYPE_STRING, 0, 0, 0},
- {"EVENT_DEFINITION", 65535, MYSQL_TYPE_STRING, 0, 0, 0},
- {"EVENT_TYPE", 9, MYSQL_TYPE_STRING, 0, 0, "Type"},
- {"EXECUTE_AT", 0, MYSQL_TYPE_DATETIME, 0, 1, "Execute at"},
- {"INTERVAL_VALUE", 256, MYSQL_TYPE_STRING, 0, 1, "Interval value"},
- {"INTERVAL_FIELD", 18, MYSQL_TYPE_STRING, 0, 1, "Interval field"},
- {"SQL_MODE", 65535, MYSQL_TYPE_STRING, 0, 0, 0},
- {"STARTS", 0, MYSQL_TYPE_DATETIME, 0, 1, "Starts"},
- {"ENDS", 0, MYSQL_TYPE_DATETIME, 0, 1, "Ends"},
- {"STATUS", 18, MYSQL_TYPE_STRING, 0, 0, "Status"},
- {"ON_COMPLETION", 12, MYSQL_TYPE_STRING, 0, 0, 0},
- {"CREATED", 0, MYSQL_TYPE_DATETIME, 0, 0, 0},
- {"LAST_ALTERED", 0, MYSQL_TYPE_DATETIME, 0, 0, 0},
- {"LAST_EXECUTED", 0, MYSQL_TYPE_DATETIME, 0, 1, 0},
- {"EVENT_COMMENT", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"ORIGINATOR", 10, MYSQL_TYPE_LONGLONG, 0, 0, "Originator"},
- {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+ {"EVENT_CATALOG", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 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",
+ SKIP_OPEN_TABLE},
+ {"DEFINER", 77, MYSQL_TYPE_STRING, 0, 0, "Definer", SKIP_OPEN_TABLE},
+ {"TIME_ZONE", 64, MYSQL_TYPE_STRING, 0, 0, "Time zone", SKIP_OPEN_TABLE},
+ {"EVENT_BODY", 8, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
+ {"EVENT_DEFINITION", 65535, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
+ {"EVENT_TYPE", 9, MYSQL_TYPE_STRING, 0, 0, "Type", SKIP_OPEN_TABLE},
+ {"EXECUTE_AT", 0, MYSQL_TYPE_DATETIME, 0, 1, "Execute at", SKIP_OPEN_TABLE},
+ {"INTERVAL_VALUE", 256, MYSQL_TYPE_STRING, 0, 1, "Interval value",
+ SKIP_OPEN_TABLE},
+ {"INTERVAL_FIELD", 18, MYSQL_TYPE_STRING, 0, 1, "Interval field",
+ SKIP_OPEN_TABLE},
+ {"SQL_MODE", 65535, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
+ {"STARTS", 0, MYSQL_TYPE_DATETIME, 0, 1, "Starts", SKIP_OPEN_TABLE},
+ {"ENDS", 0, MYSQL_TYPE_DATETIME, 0, 1, "Ends", SKIP_OPEN_TABLE},
+ {"STATUS", 18, MYSQL_TYPE_STRING, 0, 0, "Status", SKIP_OPEN_TABLE},
+ {"ON_COMPLETION", 12, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
+ {"CREATED", 0, MYSQL_TYPE_DATETIME, 0, 0, 0, SKIP_OPEN_TABLE},
+ {"LAST_ALTERED", 0, MYSQL_TYPE_DATETIME, 0, 0, 0, SKIP_OPEN_TABLE},
+ {"LAST_EXECUTED", 0, MYSQL_TYPE_DATETIME, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"EVENT_COMMENT", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
+ {"ORIGINATOR", 10, MYSQL_TYPE_LONGLONG, 0, 0, "Originator", SKIP_OPEN_TABLE},
+ {"CHARACTER_SET_CLIENT", MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0, 0,
+ "character_set_client", SKIP_OPEN_TABLE},
+ {"COLLATION_CONNECTION", MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0, 0,
+ "collation_connection", SKIP_OPEN_TABLE},
+ {"DATABASE_COLLATION", MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0, 0,
+ "Database Collation", SKIP_OPEN_TABLE},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
ST_FIELD_INFO coll_charset_app_fields_info[]=
{
- {"COLLATION_NAME", 64, MYSQL_TYPE_STRING, 0, 0, 0},
- {"CHARACTER_SET_NAME", 64, MYSQL_TYPE_STRING, 0, 0, 0},
- {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+ {"COLLATION_NAME", 64, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
+ {"CHARACTER_SET_NAME", 64, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
ST_FIELD_INFO proc_fields_info[]=
{
- {"SPECIFIC_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"ROUTINE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"ROUTINE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Db"},
- {"ROUTINE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Name"},
- {"ROUTINE_TYPE", 9, MYSQL_TYPE_STRING, 0, 0, "Type"},
- {"DTD_IDENTIFIER", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"ROUTINE_BODY", 8, MYSQL_TYPE_STRING, 0, 0, 0},
- {"ROUTINE_DEFINITION", 65535, MYSQL_TYPE_STRING, 0, 1, 0},
- {"EXTERNAL_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"EXTERNAL_LANGUAGE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"PARAMETER_STYLE", 8, MYSQL_TYPE_STRING, 0, 0, 0},
- {"IS_DETERMINISTIC", 3, MYSQL_TYPE_STRING, 0, 0, 0},
- {"SQL_DATA_ACCESS", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"SQL_PATH", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"SECURITY_TYPE", 7, MYSQL_TYPE_STRING, 0, 0, "Security_type"},
- {"CREATED", 0, MYSQL_TYPE_DATETIME, 0, 0, "Created"},
- {"LAST_ALTERED", 0, MYSQL_TYPE_DATETIME, 0, 0, "Modified"},
- {"SQL_MODE", 65535, MYSQL_TYPE_STRING, 0, 0, 0},
- {"ROUTINE_COMMENT", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Comment"},
- {"DEFINER", 77, MYSQL_TYPE_STRING, 0, 0, "Definer"},
- {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+ {"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_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Db",
+ SKIP_OPEN_TABLE},
+ {"ROUTINE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Name",
+ SKIP_OPEN_TABLE},
+ {"ROUTINE_TYPE", 9, MYSQL_TYPE_STRING, 0, 0, "Type", SKIP_OPEN_TABLE},
+ {"DTD_IDENTIFIER", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"ROUTINE_BODY", 8, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
+ {"ROUTINE_DEFINITION", 65535, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"EXTERNAL_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"EXTERNAL_LANGUAGE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0,
+ SKIP_OPEN_TABLE},
+ {"PARAMETER_STYLE", 8, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
+ {"IS_DETERMINISTIC", 3, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
+ {"SQL_DATA_ACCESS", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0,
+ SKIP_OPEN_TABLE},
+ {"SQL_PATH", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"SECURITY_TYPE", 7, MYSQL_TYPE_STRING, 0, 0, "Security_type",
+ SKIP_OPEN_TABLE},
+ {"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", 65535, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
+ {"ROUTINE_COMMENT", NAME_CHAR_LEN, 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,
+ "character_set_client", SKIP_OPEN_TABLE},
+ {"COLLATION_CONNECTION", MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0, 0,
+ "collation_connection", SKIP_OPEN_TABLE},
+ {"DATABASE_COLLATION", MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0, 0,
+ "Database Collation", SKIP_OPEN_TABLE},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
ST_FIELD_INFO stat_fields_info[]=
{
- {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Table"},
- {"NON_UNIQUE", 1, MYSQL_TYPE_LONGLONG, 0, 0, "Non_unique"},
- {"INDEX_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"INDEX_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Key_name"},
- {"SEQ_IN_INDEX", 2, MYSQL_TYPE_LONGLONG, 0, 0, "Seq_in_index"},
- {"COLUMN_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Column_name"},
- {"COLLATION", 1, MYSQL_TYPE_STRING, 0, 1, "Collation"},
+ {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 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},
+ {"INDEX_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY},
+ {"INDEX_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Key_name",
+ OPEN_FRM_ONLY},
+ {"SEQ_IN_INDEX", 2, MYSQL_TYPE_LONGLONG, 0, 0, "Seq_in_index", OPEN_FRM_ONLY},
+ {"COLUMN_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Column_name",
+ OPEN_FRM_ONLY},
+ {"COLLATION", 1, MYSQL_TYPE_STRING, 0, 1, "Collation", OPEN_FRM_ONLY},
{"CARDINALITY", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG, 0, 1,
- "Cardinality"},
- {"SUB_PART", 3, MYSQL_TYPE_LONGLONG, 0, 1, "Sub_part"},
- {"PACKED", 10, MYSQL_TYPE_STRING, 0, 1, "Packed"},
- {"NULLABLE", 3, MYSQL_TYPE_STRING, 0, 0, "Null"},
- {"INDEX_TYPE", 16, MYSQL_TYPE_STRING, 0, 0, "Index_type"},
- {"COMMENT", 16, MYSQL_TYPE_STRING, 0, 1, "Comment"},
- {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+ "Cardinality", OPEN_FULL_TABLE},
+ {"SUB_PART", 3, MYSQL_TYPE_LONGLONG, 0, 1, "Sub_part", OPEN_FRM_ONLY},
+ {"PACKED", 10, MYSQL_TYPE_STRING, 0, 1, "Packed", OPEN_FRM_ONLY},
+ {"NULLABLE", 3, MYSQL_TYPE_STRING, 0, 0, "Null", OPEN_FRM_ONLY},
+ {"INDEX_TYPE", 16, MYSQL_TYPE_STRING, 0, 0, "Index_type", OPEN_FULL_TABLE},
+ {"COMMENT", 16, MYSQL_TYPE_STRING, 0, 1, "Comment", OPEN_FRM_ONLY},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
ST_FIELD_INFO view_fields_info[]=
{
- {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"VIEW_DEFINITION", 65535, MYSQL_TYPE_STRING, 0, 0, 0},
- {"CHECK_OPTION", 8, MYSQL_TYPE_STRING, 0, 0, 0},
- {"IS_UPDATABLE", 3, MYSQL_TYPE_STRING, 0, 0, 0},
- {"DEFINER", 77, MYSQL_TYPE_STRING, 0, 0, 0},
- {"SECURITY_TYPE", 7, MYSQL_TYPE_STRING, 0, 0, 0},
- {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+ {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 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},
+ {"CHECK_OPTION", 8, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
+ {"IS_UPDATABLE", 3, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
+ {"DEFINER", 77, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
+ {"SECURITY_TYPE", 7, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
+ {"CHARACTER_SET_CLIENT", MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0, 0, 0,
+ OPEN_FULL_TABLE},
+ {"COLLATION_CONNECTION", MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0, 0, 0,
+ OPEN_FULL_TABLE},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
ST_FIELD_INFO user_privileges_fields_info[]=
{
- {"GRANTEE", 81, MYSQL_TYPE_STRING, 0, 0, 0},
- {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"PRIVILEGE_TYPE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"IS_GRANTABLE", 3, MYSQL_TYPE_STRING, 0, 0, 0},
- {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+ {"GRANTEE", 81, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
+ {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 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}
};
ST_FIELD_INFO schema_privileges_fields_info[]=
{
- {"GRANTEE", 81, MYSQL_TYPE_STRING, 0, 0, 0},
- {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"PRIVILEGE_TYPE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"IS_GRANTABLE", 3, MYSQL_TYPE_STRING, 0, 0, 0},
- {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+ {"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_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},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
ST_FIELD_INFO table_privileges_fields_info[]=
{
- {"GRANTEE", 81, MYSQL_TYPE_STRING, 0, 0, 0},
- {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"PRIVILEGE_TYPE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"IS_GRANTABLE", 3, MYSQL_TYPE_STRING, 0, 0, 0},
- {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+ {"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_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},
+ {"IS_GRANTABLE", 3, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
ST_FIELD_INFO column_privileges_fields_info[]=
{
- {"GRANTEE", 81, MYSQL_TYPE_STRING, 0, 0, 0},
- {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"COLUMN_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"PRIVILEGE_TYPE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"IS_GRANTABLE", 3, MYSQL_TYPE_STRING, 0, 0, 0},
- {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+ {"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_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},
+ {"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}
};
ST_FIELD_INFO table_constraints_fields_info[]=
{
- {"CONSTRAINT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"CONSTRAINT_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"CONSTRAINT_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"CONSTRAINT_TYPE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+ {"CONSTRAINT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 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_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},
+ {"CONSTRAINT_TYPE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0,
+ OPEN_FULL_TABLE},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
ST_FIELD_INFO key_column_usage_fields_info[]=
{
- {"CONSTRAINT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"CONSTRAINT_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"CONSTRAINT_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"COLUMN_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"ORDINAL_POSITION", 10 ,MYSQL_TYPE_LONGLONG, 0, 0, 0},
- {"POSITION_IN_UNIQUE_CONSTRAINT", 10 ,MYSQL_TYPE_LONGLONG, 0, 1, 0},
- {"REFERENCED_TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"REFERENCED_TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"REFERENCED_COLUMN_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+ {"CONSTRAINT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 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_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},
+ {"ORDINAL_POSITION", 10 ,MYSQL_TYPE_LONGLONG, 0, 0, 0, OPEN_FULL_TABLE},
+ {"POSITION_IN_UNIQUE_CONSTRAINT", 10 ,MYSQL_TYPE_LONGLONG, 0, 1, 0,
+ OPEN_FULL_TABLE},
+ {"REFERENCED_TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0,
+ OPEN_FULL_TABLE},
+ {"REFERENCED_TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0,
+ OPEN_FULL_TABLE},
+ {"REFERENCED_COLUMN_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0,
+ OPEN_FULL_TABLE},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
ST_FIELD_INFO table_names_fields_info[]=
{
- {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"TABLE_SCHEMA",NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Tables_in_"},
- {"TABLE_TYPE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Table_type"},
- {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+ {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 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},
+ {"TABLE_TYPE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Table_type",
+ OPEN_FRM_ONLY},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
ST_FIELD_INFO open_tables_fields_info[]=
{
- {"Database", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Database"},
- {"Table",NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Table"},
- {"In_use", 1, MYSQL_TYPE_LONGLONG, 0, 0, "In_use"},
- {"Name_locked", 4, MYSQL_TYPE_LONGLONG, 0, 0, "Name_locked"},
- {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+ {"Database", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Database",
+ SKIP_OPEN_TABLE},
+ {"Table",NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Table", SKIP_OPEN_TABLE},
+ {"In_use", 1, MYSQL_TYPE_LONGLONG, 0, 0, "In_use", SKIP_OPEN_TABLE},
+ {"Name_locked", 4, MYSQL_TYPE_LONGLONG, 0, 0, "Name_locked", SKIP_OPEN_TABLE},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
ST_FIELD_INFO triggers_fields_info[]=
{
- {"TRIGGER_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"TRIGGER_SCHEMA",NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"TRIGGER_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Trigger"},
- {"EVENT_MANIPULATION", 6, MYSQL_TYPE_STRING, 0, 0, "Event"},
- {"EVENT_OBJECT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"EVENT_OBJECT_SCHEMA",NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"EVENT_OBJECT_TABLE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Table"},
- {"ACTION_ORDER", 4, MYSQL_TYPE_LONGLONG, 0, 0, 0},
- {"ACTION_CONDITION", 65535, MYSQL_TYPE_STRING, 0, 1, 0},
- {"ACTION_STATEMENT", 65535, MYSQL_TYPE_STRING, 0, 0, "Statement"},
- {"ACTION_ORIENTATION", 9, MYSQL_TYPE_STRING, 0, 0, 0},
- {"ACTION_TIMING", 6, MYSQL_TYPE_STRING, 0, 0, "Timing"},
- {"ACTION_REFERENCE_OLD_TABLE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"ACTION_REFERENCE_NEW_TABLE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"ACTION_REFERENCE_OLD_ROW", 3, MYSQL_TYPE_STRING, 0, 0, 0},
- {"ACTION_REFERENCE_NEW_ROW", 3, MYSQL_TYPE_STRING, 0, 0, 0},
- {"CREATED", 0, MYSQL_TYPE_DATETIME, 0, 1, "Created"},
- {"SQL_MODE", 65535, MYSQL_TYPE_STRING, 0, 0, "sql_mode"},
- {"DEFINER", 65535, MYSQL_TYPE_STRING, 0, 0, "Definer"},
- {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+ {"TRIGGER_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 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,
+ OPEN_FULL_TABLE},
+ {"EVENT_OBJECT_SCHEMA",NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0,
+ OPEN_FULL_TABLE},
+ {"EVENT_OBJECT_TABLE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Table",
+ OPEN_FULL_TABLE},
+ {"ACTION_ORDER", 4, MYSQL_TYPE_LONGLONG, 0, 0, 0, OPEN_FULL_TABLE},
+ {"ACTION_CONDITION", 65535, MYSQL_TYPE_STRING, 0, 1, 0, OPEN_FULL_TABLE},
+ {"ACTION_STATEMENT", 65535, MYSQL_TYPE_STRING, 0, 0, "Statement",
+ OPEN_FULL_TABLE},
+ {"ACTION_ORIENTATION", 9, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
+ {"ACTION_TIMING", 6, MYSQL_TYPE_STRING, 0, 0, "Timing", OPEN_FULL_TABLE},
+ {"ACTION_REFERENCE_OLD_TABLE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0,
+ OPEN_FULL_TABLE},
+ {"ACTION_REFERENCE_NEW_TABLE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0,
+ OPEN_FULL_TABLE},
+ {"ACTION_REFERENCE_OLD_ROW", 3, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
+ {"ACTION_REFERENCE_NEW_ROW", 3, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
+ {"CREATED", 0, MYSQL_TYPE_DATETIME, 0, 1, "Created", OPEN_FULL_TABLE},
+ {"SQL_MODE", 65535, MYSQL_TYPE_STRING, 0, 0, "sql_mode", OPEN_FULL_TABLE},
+ {"DEFINER", 65535, MYSQL_TYPE_STRING, 0, 0, "Definer", OPEN_FULL_TABLE},
+ {"CHARACTER_SET_CLIENT", MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0, 0,
+ "character_set_client", OPEN_FULL_TABLE},
+ {"COLLATION_CONNECTION", MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0, 0,
+ "collation_connection", OPEN_FULL_TABLE},
+ {"DATABASE_COLLATION", MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0, 0,
+ "Database Collation", OPEN_FULL_TABLE},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
ST_FIELD_INFO partitions_fields_info[]=
{
- {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"TABLE_SCHEMA",NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"PARTITION_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"SUBPARTITION_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
+ {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 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},
+ {"SUBPARTITION_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0,
+ OPEN_FULL_TABLE},
{"PARTITION_ORDINAL_POSITION", 21 , MYSQL_TYPE_LONGLONG, 0,
- (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), 0},
+ (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},
- {"PARTITION_METHOD", 12, MYSQL_TYPE_STRING, 0, 1, 0},
- {"SUBPARTITION_METHOD", 12, MYSQL_TYPE_STRING, 0, 1, 0},
- {"PARTITION_EXPRESSION", 65535, MYSQL_TYPE_STRING, 0, 1, 0},
- {"SUBPARTITION_EXPRESSION", 65535, MYSQL_TYPE_STRING, 0, 1, 0},
- {"PARTITION_DESCRIPTION", 65535, MYSQL_TYPE_STRING, 0, 1, 0},
- {"TABLE_ROWS", 21 , MYSQL_TYPE_LONGLONG, 0, MY_I_S_UNSIGNED, 0},
- {"AVG_ROW_LENGTH", 21 , MYSQL_TYPE_LONGLONG, 0, MY_I_S_UNSIGNED, 0},
- {"DATA_LENGTH", 21 , MYSQL_TYPE_LONGLONG, 0, MY_I_S_UNSIGNED, 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},
+ {"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,
+ OPEN_FULL_TABLE},
+ {"PARTITION_DESCRIPTION", 65535, MYSQL_TYPE_STRING, 0, 1, 0, OPEN_FULL_TABLE},
+ {"TABLE_ROWS", 21 , MYSQL_TYPE_LONGLONG, 0, MY_I_S_UNSIGNED, 0,
+ OPEN_FULL_TABLE},
+ {"AVG_ROW_LENGTH", 21 , MYSQL_TYPE_LONGLONG, 0, MY_I_S_UNSIGNED, 0,
+ OPEN_FULL_TABLE},
+ {"DATA_LENGTH", 21 , MYSQL_TYPE_LONGLONG, 0, MY_I_S_UNSIGNED, 0,
+ OPEN_FULL_TABLE},
{"MAX_DATA_LENGTH", 21 , MYSQL_TYPE_LONGLONG, 0,
- (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), 0},
- {"INDEX_LENGTH", 21 , MYSQL_TYPE_LONGLONG, 0, MY_I_S_UNSIGNED, 0},
- {"DATA_FREE", 21 , MYSQL_TYPE_LONGLONG, 0, MY_I_S_UNSIGNED, 0},
- {"CREATE_TIME", 0, MYSQL_TYPE_DATETIME, 0, 1, 0},
- {"UPDATE_TIME", 0, MYSQL_TYPE_DATETIME, 0, 1, 0},
- {"CHECK_TIME", 0, MYSQL_TYPE_DATETIME, 0, 1, 0},
+ (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), 0, OPEN_FULL_TABLE},
+ {"INDEX_LENGTH", 21 , MYSQL_TYPE_LONGLONG, 0, MY_I_S_UNSIGNED, 0,
+ OPEN_FULL_TABLE},
+ {"DATA_FREE", 21 , MYSQL_TYPE_LONGLONG, 0, MY_I_S_UNSIGNED, 0,
+ OPEN_FULL_TABLE},
+ {"CREATE_TIME", 0, MYSQL_TYPE_DATETIME, 0, 1, 0, OPEN_FULL_TABLE},
+ {"UPDATE_TIME", 0, MYSQL_TYPE_DATETIME, 0, 1, 0, OPEN_FULL_TABLE},
+ {"CHECK_TIME", 0, MYSQL_TYPE_DATETIME, 0, 1, 0, OPEN_FULL_TABLE},
{"CHECKSUM", 21 , MYSQL_TYPE_LONGLONG, 0,
- (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), 0},
- {"PARTITION_COMMENT", 80, MYSQL_TYPE_STRING, 0, 0, 0},
- {"NODEGROUP", 12 , MYSQL_TYPE_STRING, 0, 0, 0},
- {"TABLESPACE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+ (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), 0, OPEN_FULL_TABLE},
+ {"PARTITION_COMMENT", 80, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
+ {"NODEGROUP", 12 , MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
+ {"TABLESPACE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0,
+ OPEN_FULL_TABLE},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
ST_FIELD_INFO variables_fields_info[]=
{
- {"Variable_name", 80, MYSQL_TYPE_STRING, 0, 0, "Variable_name"},
- {"Value", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, "Value"},
- {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
-};
-
-
-ST_FIELD_INFO status_fields_info[]=
-{
- {"VARIABLE_NAME", 64, MYSQL_TYPE_STRING, 0, 0, "Variable_name"},
- {"VARIABLE_VALUE", 2207, MYSQL_TYPE_DECIMAL, 0, 0, "Value"},
- {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
-};
-
-
-ST_FIELD_INFO system_variables_fields_info[]=
-{
- {"VARIABLE_NAME", 64, MYSQL_TYPE_STRING, 0, 0, "Variable_name"},
- {"VARIABLE_VALUE", 65535, MYSQL_TYPE_STRING, 0, 1, "Value"},
- {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+ {"VARIABLE_NAME", 64, MYSQL_TYPE_STRING, 0, 0, "Variable_name",
+ SKIP_OPEN_TABLE},
+ {"VARIABLE_VALUE", 20480, MYSQL_TYPE_STRING, 0, 1, "Value", SKIP_OPEN_TABLE},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
ST_FIELD_INFO processlist_fields_info[]=
{
- {"ID", 4, MYSQL_TYPE_LONGLONG, 0, 0, "Id"},
- {"USER", 16, MYSQL_TYPE_STRING, 0, 0, "User"},
- {"HOST", LIST_PROCESS_HOST_LEN, MYSQL_TYPE_STRING, 0, 0, "Host"},
- {"DB", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, "Db"},
- {"COMMAND", 16, MYSQL_TYPE_STRING, 0, 0, "Command"},
- {"TIME", 7, MYSQL_TYPE_LONGLONG, 0, 0, "Time"},
- {"STATE", 64, MYSQL_TYPE_STRING, 0, 1, "State"},
- {"INFO", PROCESS_LIST_INFO_WIDTH, MYSQL_TYPE_STRING, 0, 1, "Info"},
- {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+ {"ID", 4, MYSQL_TYPE_LONGLONG, 0, 0, "Id", SKIP_OPEN_TABLE},
+ {"USER", 16, MYSQL_TYPE_STRING, 0, 0, "User", SKIP_OPEN_TABLE},
+ {"HOST", LIST_PROCESS_HOST_LEN, MYSQL_TYPE_STRING, 0, 0, "Host",
+ SKIP_OPEN_TABLE},
+ {"DB", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, "Db", SKIP_OPEN_TABLE},
+ {"COMMAND", 16, MYSQL_TYPE_STRING, 0, 0, "Command", SKIP_OPEN_TABLE},
+ {"TIME", 7, MYSQL_TYPE_LONGLONG, 0, 0, "Time", SKIP_OPEN_TABLE},
+ {"STATE", 64, MYSQL_TYPE_STRING, 0, 1, "State", SKIP_OPEN_TABLE},
+ {"INFO", PROCESS_LIST_INFO_WIDTH, MYSQL_TYPE_STRING, 0, 1, "Info",
+ SKIP_OPEN_TABLE},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
ST_FIELD_INFO plugin_fields_info[]=
{
- {"PLUGIN_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Name"},
- {"PLUGIN_VERSION", 20, MYSQL_TYPE_STRING, 0, 0, 0},
- {"PLUGIN_STATUS", 10, MYSQL_TYPE_STRING, 0, 0, "Status"},
- {"PLUGIN_TYPE", 80, MYSQL_TYPE_STRING, 0, 0, "Type"},
- {"PLUGIN_TYPE_VERSION", 20, MYSQL_TYPE_STRING, 0, 0, 0},
- {"PLUGIN_LIBRARY", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, "Library"},
- {"PLUGIN_LIBRARY_VERSION", 20, MYSQL_TYPE_STRING, 0, 1, 0},
- {"PLUGIN_AUTHOR", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"PLUGIN_DESCRIPTION", 65535, MYSQL_TYPE_STRING, 0, 1, 0},
- {"PLUGIN_LICENSE", 80, MYSQL_TYPE_STRING, 0, 1, "License"},
- {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+ {"PLUGIN_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Name",
+ SKIP_OPEN_TABLE},
+ {"PLUGIN_VERSION", 20, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
+ {"PLUGIN_STATUS", 10, MYSQL_TYPE_STRING, 0, 0, "Status", SKIP_OPEN_TABLE},
+ {"PLUGIN_TYPE", 80, MYSQL_TYPE_STRING, 0, 0, "Type", SKIP_OPEN_TABLE},
+ {"PLUGIN_TYPE_VERSION", 20, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
+ {"PLUGIN_LIBRARY", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, "Library",
+ SKIP_OPEN_TABLE},
+ {"PLUGIN_LIBRARY_VERSION", 20, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"PLUGIN_AUTHOR", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"PLUGIN_DESCRIPTION", 65535, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"PLUGIN_LICENSE", 80, MYSQL_TYPE_STRING, 0, 1, "License", SKIP_OPEN_TABLE},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
ST_FIELD_INFO files_fields_info[]=
{
- {"FILE_ID", 4, MYSQL_TYPE_LONGLONG, 0, 0, 0},
- {"FILE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"FILE_TYPE", 20, MYSQL_TYPE_STRING, 0, 0, 0},
- {"TABLESPACE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"TABLE_CATALOG", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"LOGFILE_GROUP_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"LOGFILE_GROUP_NUMBER", 4, MYSQL_TYPE_LONGLONG, 0, 1, 0},
- {"ENGINE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"FULLTEXT_KEYS", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"DELETED_ROWS", 4, MYSQL_TYPE_LONGLONG, 0, 1, 0},
- {"UPDATE_COUNT", 4, MYSQL_TYPE_LONGLONG, 0, 1, 0},
- {"FREE_EXTENTS", 4, MYSQL_TYPE_LONGLONG, 0, 1, 0},
- {"TOTAL_EXTENTS", 4, MYSQL_TYPE_LONGLONG, 0, 1, 0},
- {"EXTENT_SIZE", 4, MYSQL_TYPE_LONGLONG, 0, 0, 0},
+ {"FILE_ID", 4, MYSQL_TYPE_LONGLONG, 0, 0, 0, SKIP_OPEN_TABLE},
+ {"FILE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"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_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,
+ SKIP_OPEN_TABLE},
+ {"LOGFILE_GROUP_NUMBER", 4, MYSQL_TYPE_LONGLONG, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"ENGINE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
+ {"FULLTEXT_KEYS", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"DELETED_ROWS", 4, MYSQL_TYPE_LONGLONG, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"UPDATE_COUNT", 4, MYSQL_TYPE_LONGLONG, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"FREE_EXTENTS", 4, MYSQL_TYPE_LONGLONG, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"TOTAL_EXTENTS", 4, MYSQL_TYPE_LONGLONG, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"EXTENT_SIZE", 4, MYSQL_TYPE_LONGLONG, 0, 0, 0, SKIP_OPEN_TABLE},
{"INITIAL_SIZE", 21, MYSQL_TYPE_LONGLONG, 0,
- (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), 0},
+ (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), 0, SKIP_OPEN_TABLE},
{"MAXIMUM_SIZE", 21, MYSQL_TYPE_LONGLONG, 0,
- (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), 0},
+ (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), 0, SKIP_OPEN_TABLE},
{"AUTOEXTEND_SIZE", 21, MYSQL_TYPE_LONGLONG, 0,
- (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), 0},
- {"CREATION_TIME", 0, MYSQL_TYPE_DATETIME, 0, 1, 0},
- {"LAST_UPDATE_TIME", 0, MYSQL_TYPE_DATETIME, 0, 1, 0},
- {"LAST_ACCESS_TIME", 0, MYSQL_TYPE_DATETIME, 0, 1, 0},
- {"RECOVER_TIME", 4, MYSQL_TYPE_LONGLONG, 0, 1, 0},
- {"TRANSACTION_COUNTER", 4, MYSQL_TYPE_LONGLONG, 0, 1, 0},
+ (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), 0, SKIP_OPEN_TABLE},
+ {"CREATION_TIME", 0, MYSQL_TYPE_DATETIME, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"LAST_UPDATE_TIME", 0, MYSQL_TYPE_DATETIME, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"LAST_ACCESS_TIME", 0, MYSQL_TYPE_DATETIME, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"RECOVER_TIME", 4, MYSQL_TYPE_LONGLONG, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"TRANSACTION_COUNTER", 4, MYSQL_TYPE_LONGLONG, 0, 1, 0, SKIP_OPEN_TABLE},
{"VERSION", 21 , MYSQL_TYPE_LONGLONG, 0,
- (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Version"},
- {"ROW_FORMAT", 10, MYSQL_TYPE_STRING, 0, 1, "Row_format"},
+ (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Version", SKIP_OPEN_TABLE},
+ {"ROW_FORMAT", 10, MYSQL_TYPE_STRING, 0, 1, "Row_format", SKIP_OPEN_TABLE},
{"TABLE_ROWS", 21 , MYSQL_TYPE_LONGLONG, 0,
- (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Rows"},
+ (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Rows", SKIP_OPEN_TABLE},
{"AVG_ROW_LENGTH", 21 , MYSQL_TYPE_LONGLONG, 0,
- (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Avg_row_length"},
+ (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Avg_row_length", SKIP_OPEN_TABLE},
{"DATA_LENGTH", 21 , MYSQL_TYPE_LONGLONG, 0,
- (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Data_length"},
+ (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Data_length", SKIP_OPEN_TABLE},
{"MAX_DATA_LENGTH", 21 , MYSQL_TYPE_LONGLONG, 0,
- (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Max_data_length"},
+ (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Max_data_length", SKIP_OPEN_TABLE},
{"INDEX_LENGTH", 21 , MYSQL_TYPE_LONGLONG, 0,
- (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Index_length"},
+ (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Index_length", SKIP_OPEN_TABLE},
{"DATA_FREE", 21 , MYSQL_TYPE_LONGLONG, 0,
- (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Data_free"},
- {"CREATE_TIME", 0, MYSQL_TYPE_DATETIME, 0, 1, "Create_time"},
- {"UPDATE_TIME", 0, MYSQL_TYPE_DATETIME, 0, 1, "Update_time"},
- {"CHECK_TIME", 0, MYSQL_TYPE_DATETIME, 0, 1, "Check_time"},
+ (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Data_free", SKIP_OPEN_TABLE},
+ {"CREATE_TIME", 0, MYSQL_TYPE_DATETIME, 0, 1, "Create_time", SKIP_OPEN_TABLE},
+ {"UPDATE_TIME", 0, MYSQL_TYPE_DATETIME, 0, 1, "Update_time", SKIP_OPEN_TABLE},
+ {"CHECK_TIME", 0, MYSQL_TYPE_DATETIME, 0, 1, "Check_time", SKIP_OPEN_TABLE},
{"CHECKSUM", 21 , MYSQL_TYPE_LONGLONG, 0,
- (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Checksum"},
- {"STATUS", 20, MYSQL_TYPE_STRING, 0, 0, 0},
- {"EXTRA", 255, MYSQL_TYPE_STRING, 0, 1, 0},
- {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+ (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Checksum", SKIP_OPEN_TABLE},
+ {"STATUS", 20, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
+ {"EXTRA", 255, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
void init_fill_schema_files_row(TABLE* table)
@@ -5861,18 +6429,24 @@ 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},
- {"CONSTRAINT_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"CONSTRAINT_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"UNIQUE_CONSTRAINT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0},
- {"UNIQUE_CONSTRAINT_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"UNIQUE_CONSTRAINT_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"MATCH_OPTION", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"UPDATE_RULE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"DELETE_RULE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {"REFERENCED_TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
- {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+ {"CONSTRAINT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 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,
+ OPEN_FULL_TABLE},
+ {"UNIQUE_CONSTRAINT_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0,
+ OPEN_FULL_TABLE},
+ {"UNIQUE_CONSTRAINT_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0,
+ OPEN_FULL_TABLE},
+ {"MATCH_OPTION", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
+ {"UPDATE_RULE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
+ {"DELETE_RULE", 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},
+ {"REFERENCED_TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0,
+ OPEN_FULL_TABLE},
+ {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
@@ -5886,71 +6460,77 @@ ST_FIELD_INFO referential_constraints_fields_info[]=
ST_SCHEMA_TABLE schema_tables[]=
{
{"CHARACTER_SETS", charsets_fields_info, create_schema_table,
- fill_schema_charsets, make_character_sets_old_format, 0, -1, -1, 0},
+ fill_schema_charsets, make_character_sets_old_format, 0, -1, -1, 0, 0},
{"COLLATIONS", collation_fields_info, create_schema_table,
- fill_schema_collation, make_old_format, 0, -1, -1, 0},
+ fill_schema_collation, make_old_format, 0, -1, -1, 0, 0},
{"COLLATION_CHARACTER_SET_APPLICABILITY", coll_charset_app_fields_info,
- create_schema_table, fill_schema_coll_charset_app, 0, 0, -1, -1, 0},
+ create_schema_table, fill_schema_coll_charset_app, 0, 0, -1, -1, 0, 0},
{"COLUMNS", columns_fields_info, create_schema_table,
- get_all_tables, make_columns_old_format, get_schema_column_record, 1, 2, 0},
+ get_all_tables, make_columns_old_format, get_schema_column_record, 1, 2, 0,
+ OPTIMIZE_I_S_TABLE|OPEN_VIEW_FULL},
{"COLUMN_PRIVILEGES", column_privileges_fields_info, create_schema_table,
- fill_schema_column_privileges, 0, 0, -1, -1, 0},
+ fill_schema_column_privileges, 0, 0, -1, -1, 0, 0},
{"ENGINES", engines_fields_info, create_schema_table,
- fill_schema_engines, make_old_format, 0, -1, -1, 0},
+ fill_schema_engines, make_old_format, 0, -1, -1, 0, 0},
{"EVENTS", events_fields_info, create_schema_table,
- Events::fill_schema_events, make_old_format, 0, -1, -1, 0},
+ Events::fill_schema_events, make_old_format, 0, -1, -1, 0, 0},
{"FILES", files_fields_info, create_schema_table,
- fill_schema_files, 0, 0, -1, -1, 0},
- {"GLOBAL_STATUS", status_fields_info, create_schema_table,
- fill_schema_global_status, make_old_format, 0, -1, -1, 0},
- {"GLOBAL_VARIABLES", system_variables_fields_info, create_schema_table,
- fill_schema_global_variables, make_old_format, 0, -1, -1, 0},
+ fill_schema_files, 0, 0, -1, -1, 0, 0},
+ {"GLOBAL_STATUS", variables_fields_info, create_schema_table,
+ fill_status, make_old_format, 0, -1, -1, 0, 0},
+ {"GLOBAL_VARIABLES", variables_fields_info, create_schema_table,
+ fill_variables, make_old_format, 0, -1, -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},
+ get_all_tables, 0, get_schema_key_column_usage_record, 4, 5, 0,
+ OPEN_TABLE_ONLY},
{"OPEN_TABLES", open_tables_fields_info, create_schema_table,
- fill_open_tables, make_old_format, 0, -1, -1, 1},
+ 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},
+ get_all_tables, 0, get_schema_partitions_record, 1, 2, 0, OPEN_TABLE_ONLY},
{"PLUGINS", plugin_fields_info, create_schema_table,
- fill_plugins, make_old_format, 0, -1, -1, 0},
+ fill_plugins, make_old_format, 0, -1, -1, 0, 0},
{"PROCESSLIST", processlist_fields_info, create_schema_table,
- fill_schema_processlist, make_old_format, 0, -1, -1, 0},
+ fill_schema_processlist, make_old_format, 0, -1, -1, 0, 0},
{"PROFILING", query_profile_statistics_info, create_schema_table,
fill_query_profile_statistics_info, NULL, NULL, -1, -1, false},
{"REFERENTIAL_CONSTRAINTS", referential_constraints_fields_info,
create_schema_table, get_all_tables, 0, get_referential_constraints_record,
- 1, 9, 0},
+ 1, 9, 0, OPEN_TABLE_ONLY},
{"ROUTINES", proc_fields_info, create_schema_table,
- fill_schema_proc, make_proc_old_format, 0, -1, -1, 0},
+ fill_schema_proc, make_proc_old_format, 0, -1, -1, 0, 0},
{"SCHEMATA", schema_fields_info, create_schema_table,
- fill_schema_shemata, make_schemata_old_format, 0, 1, -1, 0},
+ fill_schema_schemata, make_schemata_old_format, 0, 1, -1, 0, 0},
{"SCHEMA_PRIVILEGES", schema_privileges_fields_info, create_schema_table,
- fill_schema_schema_privileges, 0, 0, -1, -1, 0},
- {"SESSION_STATUS", status_fields_info, create_schema_table,
- fill_schema_session_status, make_old_format, 0, -1, -1, 0},
- {"SESSION_VARIABLES", system_variables_fields_info, create_schema_table,
- fill_schema_session_variables, make_old_format, 0, -1, -1, 0},
+ fill_schema_schema_privileges, 0, 0, -1, -1, 0, 0},
+ {"SESSION_STATUS", variables_fields_info, create_schema_table,
+ fill_status, make_old_format, 0, -1, -1, 0, 0},
+ {"SESSION_VARIABLES", variables_fields_info, create_schema_table,
+ fill_variables, make_old_format, 0, -1, -1, 0, 0},
{"STATISTICS", stat_fields_info, create_schema_table,
- get_all_tables, make_old_format, get_schema_stat_record, 1, 2, 0},
+ get_all_tables, make_old_format, get_schema_stat_record, 1, 2, 0,
+ OPEN_TABLE_ONLY|OPTIMIZE_I_S_TABLE},
{"STATUS", variables_fields_info, create_schema_table, fill_status,
- make_old_format, 0, -1, -1, 1},
+ make_old_format, 0, -1, -1, 1, 0},
{"TABLES", tables_fields_info, create_schema_table,
- get_all_tables, make_old_format, get_schema_tables_record, 1, 2, 0},
+ 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},
+ get_all_tables, 0, get_schema_constraints_record, 3, 4, 0, OPEN_TABLE_ONLY},
{"TABLE_NAMES", table_names_fields_info, create_schema_table,
- get_all_tables, make_table_names_old_format, 0, 1, 2, 1},
+ 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},
+ 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},
+ get_all_tables, make_old_format, get_schema_triggers_record, 5, 6, 0,
+ OPEN_TABLE_ONLY},
{"USER_PRIVILEGES", user_privileges_fields_info, create_schema_table,
- fill_schema_user_privileges, 0, 0, -1, -1, 0},
+ fill_schema_user_privileges, 0, 0, -1, -1, 0, 0},
{"VARIABLES", variables_fields_info, create_schema_table, fill_variables,
- make_old_format, 0, -1, -1, 1},
+ make_old_format, 0, -1, -1, 1, 0},
{"VIEWS", view_fields_info, create_schema_table,
- get_all_tables, 0, get_schema_views_record, 1, 2, 0},
- {0, 0, 0, 0, 0, 0, 0, 0, 0}
+ get_all_tables, 0, get_schema_views_record, 1, 2, 0,
+ OPEN_VIEW_ONLY|OPTIMIZE_I_S_TABLE},
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
};
@@ -5976,18 +6556,23 @@ int initialize_schema_table(st_plugin_int *plugin)
schema_table->idx_field1= -1,
schema_table->idx_field2= -1;
+ /* Make the name available to the init() function. */
+ schema_table->table_name= plugin->name.str;
+
if (plugin->plugin->init(schema_table))
{
sql_print_error("Plugin '%s' init function returned error.",
plugin->name.str);
goto err;
}
+
+ /* Make sure the plugin name is not set inside the init() function. */
schema_table->table_name= plugin->name.str;
}
DBUG_RETURN(0);
err:
- my_free((gptr)schema_table, MYF(0));
+ my_free(schema_table, MYF(0));
DBUG_RETURN(1);
}
@@ -6004,8 +6589,305 @@ int finalize_schema_table(st_plugin_int *plugin)
DBUG_PRINT("warning", ("Plugin '%s' deinit function returned error.",
plugin->name.str));
}
- my_free((gptr)schema_table, MYF(0));
+ my_free(schema_table, MYF(0));
}
-
DBUG_RETURN(0);
}
+
+
+/**
+ Output trigger information (SHOW CREATE TRIGGER) to the client.
+
+ @param thd Thread context.
+ @param triggers List of triggers for the table.
+ @param trigger_idx Index of the trigger to dump.
+
+ @return Operation status
+ @retval TRUE Error.
+ @retval FALSE Success.
+*/
+
+static bool show_create_trigger_impl(THD *thd,
+ Table_triggers_list *triggers,
+ int trigger_idx)
+{
+ int ret_code;
+
+ Protocol *p= thd->protocol;
+ List<Item> fields;
+
+ LEX_STRING trg_name;
+ ulonglong trg_sql_mode;
+ LEX_STRING trg_sql_mode_str;
+ LEX_STRING trg_sql_original_stmt;
+ LEX_STRING trg_client_cs_name;
+ LEX_STRING trg_connection_cl_name;
+ LEX_STRING trg_db_cl_name;
+
+ CHARSET_INFO *trg_client_cs;
+
+ /*
+ TODO: Check privileges here. This functionality will be added by
+ implementation of the following WL items:
+ - WL#2227: New privileges for new objects
+ - WL#3482: Protect SHOW CREATE PROCEDURE | FUNCTION | VIEW | TRIGGER
+ properly
+
+ SHOW TRIGGERS and I_S.TRIGGERS will be affected too.
+ */
+
+ /* Prepare trigger "object". */
+
+ triggers->get_trigger_info(thd,
+ trigger_idx,
+ &trg_name,
+ &trg_sql_mode,
+ &trg_sql_original_stmt,
+ &trg_client_cs_name,
+ &trg_connection_cl_name,
+ &trg_db_cl_name);
+
+ sys_var_thd_sql_mode::symbolic_mode_representation(thd,
+ trg_sql_mode,
+ &trg_sql_mode_str);
+
+ /* Resolve trigger client character set. */
+
+ if (resolve_charset(trg_client_cs_name.str, NULL, &trg_client_cs))
+ return TRUE;
+
+ /* Send header. */
+
+ fields.push_back(new Item_empty_string("Trigger", NAME_LEN));
+ fields.push_back(new Item_empty_string("sql_mode", trg_sql_mode_str.length));
+
+ {
+ /*
+ NOTE: SQL statement field must be not less than 1024 in order not to
+ confuse old clients.
+ */
+
+ Item_empty_string *stmt_fld=
+ new Item_empty_string("SQL Original Statement",
+ max(trg_sql_original_stmt.length, 1024));
+
+ stmt_fld->maybe_null= TRUE;
+
+ fields.push_back(stmt_fld);
+ }
+
+ fields.push_back(new Item_empty_string("character_set_client",
+ MY_CS_NAME_SIZE));
+
+ fields.push_back(new Item_empty_string("collation_connection",
+ MY_CS_NAME_SIZE));
+
+ 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))
+ return TRUE;
+
+ /* Send data. */
+
+ p->prepare_for_resend();
+
+ p->store(trg_name.str,
+ trg_name.length,
+ system_charset_info);
+
+ p->store(trg_sql_mode_str.str,
+ trg_sql_mode_str.length,
+ system_charset_info);
+
+ p->store(trg_sql_original_stmt.str,
+ trg_sql_original_stmt.length,
+ trg_client_cs);
+
+ p->store(trg_client_cs_name.str,
+ trg_client_cs_name.length,
+ system_charset_info);
+
+ p->store(trg_connection_cl_name.str,
+ trg_connection_cl_name.length,
+ system_charset_info);
+
+ p->store(trg_db_cl_name.str,
+ trg_db_cl_name.length,
+ system_charset_info);
+
+ ret_code= p->write();
+
+ if (!ret_code)
+ send_eof(thd);
+
+ return ret_code != 0;
+}
+
+
+/**
+ Read TRN and TRG files to obtain base table name for the specified
+ trigger name and construct TABE_LIST object for the base table.
+
+ @param thd Thread context.
+ @param trg_name Trigger name.
+
+ @return TABLE_LIST object corresponding to the base table.
+
+ TODO: This function is a copy&paste from add_table_to_list() and
+ sp_add_to_query_tables(). The problem is that in order to be compatible
+ with Stored Programs (Prepared Statements), we should not touch thd->lex.
+ The "source" functions also add created TABLE_LIST object to the
+ thd->lex->query_tables.
+
+ The plan to eliminate this copy&paste is to:
+
+ - get rid of sp_add_to_query_tables() and use Lex::add_table_to_list().
+ Only add_table_to_list() must be used to add tables from the parser
+ into Lex::query_tables list.
+
+ - do not update Lex::query_tables in add_table_to_list().
+*/
+
+static TABLE_LIST *get_trigger_table_impl(
+ THD *thd,
+ const sp_name *trg_name)
+{
+ char trn_path_buff[FN_REFLEN];
+
+ LEX_STRING trn_path= { trn_path_buff, 0 };
+ LEX_STRING tbl_name;
+
+ build_trn_path(thd, trg_name, &trn_path);
+
+ if (check_trn_exists(&trn_path))
+ {
+ my_error(ER_TRG_DOES_NOT_EXIST, MYF(0));
+ return NULL;
+ }
+
+ if (load_table_name_for_trigger(thd, trg_name, &trn_path, &tbl_name))
+ return NULL;
+
+ /* We need to reset statement table list to be PS/SP friendly. */
+
+ TABLE_LIST *table;
+
+ if (!(table= (TABLE_LIST *)thd->calloc(sizeof(TABLE_LIST))))
+ {
+ my_error(ER_OUTOFMEMORY, MYF(0), sizeof(TABLE_LIST));
+ return NULL;
+ }
+
+ table->db_length= trg_name->m_db.length;
+ table->db= thd->strmake(trg_name->m_db.str, trg_name->m_db.length);
+
+ table->table_name_length= tbl_name.length;
+ table->table_name= thd->strmake(tbl_name.str, tbl_name.length);
+
+ table->alias= thd->strmake(tbl_name.str, tbl_name.length);
+
+ table->lock_type= TL_IGNORE;
+ table->cacheable_table= 0;
+
+ return table;
+}
+
+/**
+ Read TRN and TRG files to obtain base table name for the specified
+ trigger name and construct TABE_LIST object for the base table. Acquire
+ LOCK_open when doing this.
+
+ @param thd Thread context.
+ @param trg_name Trigger name.
+
+ @return TABLE_LIST object corresponding to the base table.
+*/
+
+static TABLE_LIST *get_trigger_table(THD *thd, const sp_name *trg_name)
+{
+ /* Acquire LOCK_open (stop the server). */
+
+ pthread_mutex_lock(&LOCK_open);
+
+ /*
+ Load base table name from the TRN-file and create TABLE_LIST object.
+ */
+
+ TABLE_LIST *lst= get_trigger_table_impl(thd, trg_name);
+
+ /* Release LOCK_open (continue the server). */
+
+ pthread_mutex_unlock(&LOCK_open);
+
+ /* That's it. */
+
+ return lst;
+}
+
+
+/**
+ SHOW CREATE TRIGGER high-level implementation.
+
+ @param thd Thread context.
+ @param trg_name Trigger name.
+
+ @return Operation status
+ @retval TRUE Error.
+ @retval FALSE Success.
+*/
+
+bool show_create_trigger(THD *thd, const sp_name *trg_name)
+{
+ TABLE_LIST *lst= get_trigger_table(thd, trg_name);
+
+ /*
+ Open the table by name in order to load Table_triggers_list object.
+
+ NOTE: there is race condition here -- the table can be dropped after
+ LOCK_open is released. It will be fixed later by introducing
+ acquire-shared-table-name-lock functionality.
+ */
+
+ uint num_tables; /* NOTE: unused, only to pass to open_tables(). */
+
+ if (open_tables(thd, &lst, &num_tables, 0))
+ {
+ my_error(ER_TRG_CANT_OPEN_TABLE, MYF(0),
+ (const char *) trg_name->m_db.str,
+ (const char *) lst->table_name);
+
+ return TRUE;
+
+ /* Perform closing actions and return error status. */
+ }
+
+ DBUG_ASSERT(num_tables == 1);
+
+ Table_triggers_list *triggers= lst->table->triggers;
+
+ if (!triggers)
+ {
+ my_error(ER_TRG_DOES_NOT_EXIST, MYF(0));
+ return TRUE;
+ }
+
+ int trigger_idx= triggers->find_trigger_by_name(&trg_name->m_name);
+
+ if (trigger_idx < 0)
+ {
+ my_error(ER_TRG_CORRUPTED_FILE, MYF(0),
+ (const char *) trg_name->m_db.str,
+ (const char *) lst->table_name);
+
+ return TRUE;
+ }
+
+ return show_create_trigger_impl(thd, triggers, trigger_idx);
+
+ /*
+ NOTE: if show_create_trigger_impl() failed, that means we could not
+ send data to the client. In this case we simply raise the error
+ status and client connection will be closed.
+ */
+}
diff --git a/sql/sql_show.h b/sql/sql_show.h
index d5c3f3bf675..d63217584b2 100644
--- a/sql/sql_show.h
+++ b/sql/sql_show.h
@@ -20,9 +20,8 @@
class String;
class THD;
struct st_ha_create_information;
-struct st_table_list;
typedef st_ha_create_information HA_CREATE_INFO;
-typedef st_table_list TABLE_LIST;
+struct TABLE_LIST;
enum find_files_result {
FIND_FILES_OK,
@@ -30,7 +29,7 @@ enum find_files_result {
FIND_FILES_DIR
};
-find_files_result find_files(THD *thd, List<char> *files, const char *db,
+find_files_result find_files(THD *thd, List<LEX_STRING> *files, const char *db,
const char *path, const char *wild, bool dir);
int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
diff --git a/sql/sql_sort.h b/sql/sql_sort.h
index da28ca07e2c..1e9322f7f5b 100644
--- a/sql/sql_sort.h
+++ b/sql/sql_sort.h
@@ -50,6 +50,12 @@ typedef struct st_buffpek { /* Struktur om sorteringsbuffrarna */
ulong max_keys; /* Max keys in buffert */
} BUFFPEK;
+struct BUFFPEK_COMPARE_CONTEXT
+{
+ qsort_cmp2 key_compare;
+ void *key_compare_arg;
+};
+
typedef struct st_sort_param {
uint rec_length; /* Length of sorted records */
uint sort_length; /* Length of sorted columns */
@@ -65,6 +71,9 @@ typedef struct st_sort_param {
uchar *unique_buff;
bool not_killable;
char* tmp_buffer;
+ /* The fields below are used only by Unique class */
+ qsort2_cmp compare;
+ BUFFPEK_COMPARE_CONTEXT cmp_context;
} SORTPARAM;
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index 52af2f2dd90..a8eb7360339 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -32,7 +32,7 @@
required by the string function
*/
-extern gptr sql_alloc(unsigned size);
+extern uchar* sql_alloc(unsigned size);
extern void sql_element_free(void *ptr);
#include "sql_string.h"
@@ -496,7 +496,7 @@ bool String::append(FILE* file, uint32 arg_length, myf my_flags)
{
if (realloc(str_length+arg_length))
return TRUE;
- if (my_fread(file, (byte*) Ptr + str_length, arg_length, my_flags))
+ if (my_fread(file, (uchar*) Ptr + str_length, arg_length, my_flags))
{
shrink(str_length);
return TRUE;
@@ -510,7 +510,7 @@ bool String::append(IO_CACHE* file, uint32 arg_length)
{
if (realloc(str_length+arg_length))
return TRUE;
- if (my_b_read(file, (byte*) Ptr + str_length, arg_length))
+ if (my_b_read(file, (uchar*) Ptr + str_length, arg_length))
{
shrink(str_length);
return TRUE;
@@ -635,7 +635,7 @@ bool String::replace(uint32 offset,uint32 arg_length,
{
if (realloc(str_length+(uint32) diff))
return TRUE;
- bmove_upp(Ptr+str_length+diff,Ptr+str_length,
+ bmove_upp((uchar*) Ptr+str_length+diff, (uchar*) Ptr+str_length,
str_length-offset-arg_length);
}
if (to_length)
@@ -795,10 +795,8 @@ copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
const uchar *from_end= (const uchar*) from+from_length;
char *to_start= to;
uchar *to_end= (uchar*) to+to_length;
- int (*mb_wc)(struct charset_info_st *, my_wc_t *, const uchar *,
- const uchar *) = from_cs->cset->mb_wc;
- int (*wc_mb)(struct charset_info_st *, my_wc_t, uchar *s, uchar *e)=
- to_cs->cset->wc_mb;
+ my_charset_conv_mb_wc mb_wc= from_cs->cset->mb_wc;
+ my_charset_conv_wc_mb wc_mb= to_cs->cset->wc_mb;
uint error_count= 0;
while (1)
@@ -940,10 +938,8 @@ well_formed_copy_nchars(CHARSET_INFO *to_cs,
{
int cnvres;
my_wc_t wc;
- int (*mb_wc)(struct charset_info_st *, my_wc_t *,
- const uchar *, const uchar *)= from_cs->cset->mb_wc;
- int (*wc_mb)(struct charset_info_st *, my_wc_t,
- uchar *s, uchar *e)= to_cs->cset->wc_mb;
+ my_charset_conv_mb_wc mb_wc= from_cs->cset->mb_wc;
+ my_charset_conv_wc_mb wc_mb= to_cs->cset->wc_mb;
const uchar *from_end= (const uchar*) from + from_length;
uchar *to_end= (uchar*) to + to_length;
char *to_start= to;
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index ed4675348f9..a05f141c1d0 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -34,23 +34,38 @@ const char *primary_key_name="PRIMARY";
static bool check_if_keyname_exists(const char *name,KEY *start, KEY *end);
static char *make_unique_key_name(const char *field_name,KEY *start,KEY *end);
static int copy_data_between_tables(TABLE *from,TABLE *to,
- List<create_field> &create, bool ignore,
+ List<Create_field> &create, bool ignore,
uint order_num, ORDER *order,
ha_rows *copied,ha_rows *deleted,
- enum enum_enable_or_disable keys_onoff);
+ enum enum_enable_or_disable keys_onoff,
+ bool error_if_not_empty);
-static bool prepare_blob_field(THD *thd, create_field *sql_field);
-static bool check_engine(THD *thd, const char *table_name,
- HA_CREATE_INFO *create_info);
-static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
- List<create_field> *fields,
- List<Key> *keys, bool tmp_table,
- uint *db_options,
- handler *file, KEY **key_info_buffer,
- uint *key_count, int select_field_count);
+static bool prepare_blob_field(THD *thd, Create_field *sql_field);
+static bool check_engine(THD *, const char *, HA_CREATE_INFO *);
+static bool
+mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
+ Alter_info *alter_info,
+ bool tmp_table,
+ uint *db_options,
+ handler *file, KEY **key_info_buffer,
+ uint *key_count, int select_field_count);
+static bool
+mysql_prepare_alter_table(THD *thd, TABLE *table,
+ HA_CREATE_INFO *create_info,
+ Alter_info *alter_info);
-#define MYSQL50_TABLE_NAME_PREFIX "#mysql50#"
-#define MYSQL50_TABLE_NAME_PREFIX_LENGTH 9
+#ifndef DBUG_OFF
+
+/* Wait until we get a 'mysql_kill' signal */
+
+static void wait_for_kill_signal(THD *thd)
+{
+ while (thd->killed == 0)
+ sleep(1);
+ // Reset signal and continue as if nothing happend
+ thd->killed= THD::NOT_KILLED;
+}
+#endif
/*
@@ -142,6 +157,7 @@ uint tablename_to_filename(const char *from, char *to, uint to_length)
SYNOPSIS
build_table_filename()
buff Where to write result in my_charset_filename.
+ This may be the same as table_name.
bufflen buff size
db Database name in system_charset_info.
table_name Table name in system_charset_info.
@@ -171,10 +187,11 @@ uint tablename_to_filename(const char *from, char *to, uint to_length)
uint build_table_filename(char *buff, size_t bufflen, const char *db,
const char *table_name, const char *ext, uint flags)
{
- uint length;
char dbbuff[FN_REFLEN];
char tbbuff[FN_REFLEN];
DBUG_ENTER("build_table_filename");
+ DBUG_PRINT("enter", ("db: '%s' table_name: '%s' ext: '%s' flags: %x",
+ db, table_name, ext, flags));
if (flags & FN_IS_TMP) // FN_FROM_IS_TMP | FN_TO_IS_TMP
strnmov(tbbuff, table_name, sizeof(tbbuff));
@@ -182,10 +199,18 @@ uint build_table_filename(char *buff, size_t bufflen, const char *db,
VOID(tablename_to_filename(table_name, tbbuff, sizeof(tbbuff)));
VOID(tablename_to_filename(db, dbbuff, sizeof(dbbuff)));
- length= strxnmov(buff, bufflen, mysql_data_home, FN_ROOTDIR, dbbuff,
- FN_ROOTDIR, tbbuff, ext, NullS) - buff;
+
+ char *end = buff + bufflen;
+ /* Don't add FN_ROOTDIR if mysql_data_home already includes it */
+ char *pos = strnmov(buff, mysql_data_home, bufflen);
+ int rootdir_len= strlen(FN_ROOTDIR);
+ if (pos - rootdir_len >= buff &&
+ memcmp(pos - rootdir_len, FN_ROOTDIR, rootdir_len) != 0)
+ pos= strnmov(pos, FN_ROOTDIR, end - pos);
+ pos= strxnmov(pos, end - pos, dbbuff, FN_ROOTDIR, tbbuff, ext, NullS);
+
DBUG_PRINT("exit", ("buff: '%s'", buff));
- DBUG_RETURN(length);
+ DBUG_RETURN(pos - buff);
}
@@ -228,112 +253,6 @@ uint build_tmptable_filename(THD* thd, char *buff, size_t bufflen)
}
/*
- Return values for compare_tables().
- If you make compare_tables() non-static, move them to a header file.
-*/
-#define ALTER_TABLE_DATA_CHANGED 1
-#define ALTER_TABLE_INDEX_CHANGED 2
-
-
-/*
- SYNOPSIS
- mysql_copy_create_list()
- orig_create_list Original list of created fields
- inout::new_create_list Copy of original list
-
- RETURN VALUES
- FALSE Success
- TRUE Memory allocation error
-
- DESCRIPTION
- mysql_prepare_table destroys the create_list and in some cases we need
- this lists for more purposes. Thus we copy it specifically for use
- by mysql_prepare_table
-*/
-
-static int mysql_copy_create_list(List<create_field> *orig_create_list,
- List<create_field> *new_create_list)
-{
- List_iterator<create_field> prep_field_it(*orig_create_list);
- create_field *prep_field;
- DBUG_ENTER("mysql_copy_create_list");
-
- while ((prep_field= prep_field_it++))
- {
- create_field *field= new create_field(*prep_field);
- if (!field || new_create_list->push_back(field))
- {
- mem_alloc_error(2);
- DBUG_RETURN(TRUE);
- }
- }
- DBUG_RETURN(FALSE);
-}
-
-
-/*
- SYNOPSIS
- mysql_copy_key_list()
- orig_key Original list of keys
- inout::new_key Copy of original list
-
- RETURN VALUES
- FALSE Success
- TRUE Memory allocation error
-
- DESCRIPTION
- mysql_prepare_table destroys the key list and in some cases we need
- this lists for more purposes. Thus we copy it specifically for use
- by mysql_prepare_table
-*/
-
-static int mysql_copy_key_list(List<Key> *orig_key,
- List<Key> *new_key)
-{
- List_iterator<Key> prep_key_it(*orig_key);
- Key *prep_key;
- DBUG_ENTER("mysql_copy_key_list");
-
- while ((prep_key= prep_key_it++))
- {
- List<key_part_spec> prep_columns;
- List_iterator<key_part_spec> prep_col_it(prep_key->columns);
- key_part_spec *prep_col;
- Key *temp_key;
-
- while ((prep_col= prep_col_it++))
- {
- key_part_spec *prep_key_part;
-
- if (!(prep_key_part= new key_part_spec(*prep_col)))
- {
- mem_alloc_error(sizeof(key_part_spec));
- DBUG_RETURN(TRUE);
- }
- if (prep_columns.push_back(prep_key_part))
- {
- mem_alloc_error(2);
- DBUG_RETURN(TRUE);
- }
- }
- if (!(temp_key= new Key(prep_key->type, prep_key->name,
- &prep_key->key_create_info,
- prep_key->generated,
- prep_columns)))
- {
- mem_alloc_error(sizeof(Key));
- DBUG_RETURN(TRUE);
- }
- if (new_key->push_back(temp_key))
- {
- mem_alloc_error(2);
- DBUG_RETURN(TRUE);
- }
- }
- DBUG_RETURN(FALSE);
-}
-
-/*
--------------------------------------------------------------------------
MODULE: DDL log
@@ -409,11 +328,11 @@ static bool read_ddl_log_file_entry(uint entry_no)
{
bool error= FALSE;
File file_id= global_ddl_log.file_id;
- char *file_entry_buf= (char*)global_ddl_log.file_entry_buf;
+ uchar *file_entry_buf= (uchar*)global_ddl_log.file_entry_buf;
uint io_size= global_ddl_log.io_size;
DBUG_ENTER("read_ddl_log_file_entry");
- if (my_pread(file_id, (byte*)file_entry_buf, io_size, io_size * entry_no,
+ if (my_pread(file_id, file_entry_buf, io_size, io_size * entry_no,
MYF(MY_WME)) != io_size)
error= TRUE;
DBUG_RETURN(error);
@@ -437,7 +356,7 @@ static bool write_ddl_log_file_entry(uint entry_no)
char *file_entry_buf= (char*)global_ddl_log.file_entry_buf;
DBUG_ENTER("write_ddl_log_file_entry");
- if (my_pwrite(file_id, (byte*)file_entry_buf,
+ if (my_pwrite(file_id, (uchar*)file_entry_buf,
IO_SIZE, IO_SIZE * entry_no, MYF(MY_WME)) != IO_SIZE)
error= TRUE;
DBUG_RETURN(error);
@@ -650,7 +569,9 @@ static int execute_ddl_log_action(THD *thd, DDL_LOG_ENTRY *ddl_log_entry)
int error= TRUE;
char to_path[FN_REFLEN];
char from_path[FN_REFLEN];
+#ifdef WITH_PARTITION_STORAGE_ENGINE
char *par_ext= (char*)".par";
+#endif
handlerton *hton;
DBUG_ENTER("execute_ddl_log_action");
@@ -665,16 +586,14 @@ static int execute_ddl_log_action(THD *thd, DDL_LOG_ENTRY *ddl_log_entry)
frm_action= TRUE;
else
{
- TABLE_SHARE dummy;
-
- hton= ha_resolve_by_name(thd, &handler_name);
- if (!hton)
+ plugin_ref plugin= ha_resolve_by_name(thd, &handler_name);
+ if (!plugin)
{
my_error(ER_ILLEGAL_HA, MYF(0), ddl_log_entry->handler_name);
goto error;
}
- bzero(&dummy, sizeof(TABLE_SHARE));
- file= get_new_handler(&dummy, &mem_root, hton);
+ hton= plugin_data(plugin, handlerton*);
+ file= get_new_handler((TABLE_SHARE*)0, &mem_root, hton);
if (!file)
{
mem_alloc_error(sizeof(handler));
@@ -1235,13 +1154,13 @@ void release_ddl_log()
while (used_list)
{
DDL_LOG_MEMORY_ENTRY *tmp= used_list->next_log_entry;
- my_free((char*)used_list, MYF(0));
+ my_free(used_list, MYF(0));
used_list= tmp;
}
while (free_list)
{
DDL_LOG_MEMORY_ENTRY *tmp= free_list->next_log_entry;
- my_free((char*)free_list, MYF(0));
+ my_free(free_list, MYF(0));
free_list= tmp;
}
close_ddl_log();
@@ -1262,6 +1181,31 @@ void release_ddl_log()
*/
+/**
+ @brief construct a temporary shadow file name.
+
+ @details Make a shadow file name used by ALTER TABLE to construct the
+ modified table (with keeping the original). The modified table is then
+ moved back as original table. The name must start with the temp file
+ prefix so it gets filtered out by table files listing routines.
+
+ @param[out] buff buffer to receive the constructed name
+ @param bufflen size of buff
+ @param lpt alter table data structure
+
+ @retval path length
+*/
+
+uint build_table_shadow_filename(char *buff, size_t bufflen,
+ ALTER_PARTITION_PARAM_TYPE *lpt)
+{
+ char tmp_name[FN_REFLEN];
+ my_snprintf (tmp_name, sizeof (tmp_name), "%s-%s", tmp_file_prefix,
+ lpt->table_name);
+ return build_table_filename(buff, bufflen, lpt->db, tmp_name, "", FN_IS_TMP);
+}
+
+
/*
SYNOPSIS
mysql_write_frm()
@@ -1302,24 +1246,18 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
/*
Build shadow frm file name
*/
- build_table_filename(shadow_path, sizeof(shadow_path), lpt->db,
- lpt->table_name, "#", 0);
+ build_table_shadow_filename(shadow_path, sizeof(shadow_path), lpt);
strxmov(shadow_frm_name, shadow_path, reg_ext, NullS);
if (flags & WFRM_WRITE_SHADOW)
{
- if (mysql_copy_create_list(lpt->create_list,
- &lpt->new_create_list) ||
- mysql_copy_key_list(lpt->key_list,
- &lpt->new_key_list) ||
- mysql_prepare_table(lpt->thd, lpt->create_info,
- &lpt->new_create_list,
- &lpt->new_key_list,
- /*tmp_table*/ 1,
- &lpt->db_options,
- lpt->table->file,
- &lpt->key_info_buffer,
- &lpt->key_count,
- /*select_field_count*/ 0))
+ if (mysql_prepare_create_table(lpt->thd, lpt->create_info,
+ lpt->alter_info,
+ /*tmp_table*/ 1,
+ &lpt->db_options,
+ lpt->table->file,
+ &lpt->key_info_buffer,
+ &lpt->key_count,
+ /*select_field_count*/ 0))
{
DBUG_RETURN(TRUE);
}
@@ -1331,6 +1269,7 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
if (part_info)
{
+ TABLE_SHARE *share= lpt->table->s;
if (!(part_syntax_buf= generate_partition_syntax(part_info,
&syntax_len,
TRUE, TRUE)))
@@ -1338,7 +1277,16 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
DBUG_RETURN(TRUE);
}
part_info->part_info_string= part_syntax_buf;
- part_info->part_info_len= syntax_len;
+ share->partition_info_len= part_info->part_info_len= syntax_len;
+ if (share->partition_info_buffer_size < syntax_len + 1)
+ {
+ share->partition_info_buffer_size= syntax_len+1;
+ if (!(share->partition_info=
+ (char*) alloc_root(&share->mem_root, syntax_len+1)))
+ DBUG_RETURN(TRUE);
+
+ }
+ memcpy((char*) share->partition_info, part_syntax_buf, syntax_len + 1);
}
}
#endif
@@ -1346,7 +1294,7 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
lpt->create_info->table_options= lpt->db_options;
if ((mysql_create_frm(lpt->thd, shadow_frm_name, lpt->db,
lpt->table_name, lpt->create_info,
- lpt->new_create_list, lpt->key_count,
+ lpt->alter_info->create_list, lpt->key_count,
lpt->key_info_buffer, lpt->table->file)) ||
lpt->table->file->create_handler_files(shadow_path, NULL,
CHF_CREATE_FLAG,
@@ -1365,13 +1313,13 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
handlers that have the main version of the frm file stored in the
handler.
*/
- const void *data= 0;
- uint length= 0;
+ uchar *data;
+ size_t length;
if (readfrm(shadow_path, &data, &length) ||
packfrm(data, length, &lpt->pack_frm_data, &lpt->pack_frm_len))
{
- my_free((char*)data, MYF(MY_ALLOW_ZERO_PTR));
- my_free((char*)lpt->pack_frm_data, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(data, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(lpt->pack_frm_data, MYF(MY_ALLOW_ZERO_PTR));
mem_alloc_error(length);
error= 1;
goto end;
@@ -1506,19 +1454,8 @@ bool mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists,
LOCK_open during wait_if_global_read_lock(), other threads could not
close their tables. This would make a pretty deadlock.
*/
- thd->mysys_var->current_mutex= &LOCK_open;
- thd->mysys_var->current_cond= &COND_refresh;
- VOID(pthread_mutex_lock(&LOCK_open));
-
error= mysql_rm_table_part2(thd, tables, if_exists, drop_temporary, 0, 0);
- pthread_mutex_unlock(&LOCK_open);
-
- pthread_mutex_lock(&thd->mysys_var->mutex);
- thd->mysys_var->current_mutex= 0;
- thd->mysys_var->current_cond= 0;
- pthread_mutex_unlock(&thd->mysys_var->mutex);
-
if (need_start_waiters)
start_waiting_global_read_lock(thd);
@@ -1528,49 +1465,6 @@ bool mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists,
DBUG_RETURN(FALSE);
}
-
-/*
- delete (drop) tables.
-
- SYNOPSIS
- mysql_rm_table_part2_with_lock()
- thd Thread handle
- tables List of tables to delete
- if_exists If 1, don't give error if one table doesn't exists
- dont_log_query Don't write query to log files. This will also not
- generate warnings if the handler files doesn't exists
-
- NOTES
- Works like documented in mysql_rm_table(), but don't check
- global_read_lock and don't send_ok packet to server.
-
- RETURN
- 0 ok
- 1 error
-*/
-
-int mysql_rm_table_part2_with_lock(THD *thd,
- TABLE_LIST *tables, bool if_exists,
- bool drop_temporary, bool dont_log_query)
-{
- int error;
- thd->mysys_var->current_mutex= &LOCK_open;
- thd->mysys_var->current_cond= &COND_refresh;
- VOID(pthread_mutex_lock(&LOCK_open));
-
- error= mysql_rm_table_part2(thd, tables, if_exists, drop_temporary, 1,
- dont_log_query);
-
- pthread_mutex_unlock(&LOCK_open);
-
- pthread_mutex_lock(&thd->mysys_var->mutex);
- thd->mysys_var->current_mutex= 0;
- thd->mysys_var->current_cond= 0;
- pthread_mutex_unlock(&thd->mysys_var->mutex);
- return error;
-}
-
-
/*
Execute the drop of a normal or temporary table
@@ -1617,7 +1511,6 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
LINT_INIT(alias);
LINT_INIT(path_length);
- safe_mutex_assert_owner(&LOCK_open);
if (thd->current_stmt_binlog_row_based && !dont_log_query)
{
@@ -1627,6 +1520,9 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
else
built_query.append("DROP TABLE ");
}
+
+ pthread_mutex_lock(&LOCK_open);
+
/*
If we have the table in the definition cache, we don't have to check the
.frm file to find if the table is a normal table (not view) and what
@@ -1638,20 +1534,24 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
TABLE_SHARE *share;
table->db_type= NULL;
if ((share= get_cached_table_share(table->db, table->table_name)))
- table->db_type= share->db_type;
+ table->db_type= share->db_type();
/* Disable drop of enabled log tables */
- if (share && share->log_table &&
+ if (share && (share->table_category == TABLE_CATEGORY_PERFORMANCE) &&
check_if_log_table(table->db_length, table->db,
table->table_name_length, table->table_name, 1))
{
my_error(ER_BAD_LOG_STATEMENT, MYF(0), "DROP");
+ pthread_mutex_unlock(&LOCK_open);
DBUG_RETURN(1);
}
}
- if (!drop_temporary && lock_table_names(thd, tables))
+ if (!drop_temporary && lock_table_names_exclusively(thd, tables))
+ {
+ pthread_mutex_unlock(&LOCK_open);
DBUG_RETURN(1);
+ }
/* Don't give warnings for not found errors, as we already generate notes */
thd->no_warnings_for_error= 1;
@@ -1662,7 +1562,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
handlerton *table_type;
enum legacy_db_type frm_db_type;
- mysql_ha_flush(thd, table, MYSQL_HA_CLOSE_FINAL, TRUE);
+ mysql_ha_flush(thd, table, MYSQL_HA_CLOSE_FINAL, 1);
if (!close_temporary_table(thd, table))
{
tmp_table_deleted=1;
@@ -1711,8 +1611,8 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
if (thd->killed)
{
- thd->no_warnings_for_error= 0;
- DBUG_RETURN(-1);
+ error= -1;
+ goto err_with_placeholders;
}
alias= (lower_case_table_names == 2) ? table->alias : table->table_name;
/* remove .frm file and engine files */
@@ -1775,7 +1675,12 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
wrong_tables.append(String(table->table_name,system_charset_info));
}
}
- thd->tmp_table_used= tmp_table_deleted;
+ /*
+ It's safe to unlock LOCK_open: we have an exclusive lock
+ on the table name.
+ */
+ pthread_mutex_unlock(&LOCK_open);
+ thd->thread_specific_used|= tmp_table_deleted;
error= 0;
if (wrong_tables.length())
{
@@ -1834,9 +1739,10 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
*/
}
}
-
- if (!drop_temporary)
- unlock_table_names(thd, tables, (TABLE_LIST*) 0);
+ pthread_mutex_lock(&LOCK_open);
+err_with_placeholders:
+ unlock_table_names(thd, tables, (TABLE_LIST*) 0);
+ pthread_mutex_unlock(&LOCK_open);
thd->no_warnings_for_error= 0;
DBUG_RETURN(error);
}
@@ -2015,7 +1921,7 @@ void calculate_interval_lengths(CHARSET_INFO *cs, TYPELIB *interval,
table_flags table flags
DESCRIPTION
- This function prepares a create_field instance.
+ This function prepares a Create_field instance.
Fields such as pack_flag are valid after this call.
RETURN VALUES
@@ -2023,7 +1929,7 @@ void calculate_interval_lengths(CHARSET_INFO *cs, TYPELIB *interval,
1 Error
*/
-int prepare_create_field(create_field *sql_field,
+int prepare_create_field(Create_field *sql_field,
uint *blob_columns,
int *timestamps, int *timestamps_with_niladic,
longlong table_flags)
@@ -2032,7 +1938,7 @@ int prepare_create_field(create_field *sql_field,
DBUG_ENTER("prepare_field");
/*
- This code came from mysql_prepare_table.
+ This code came from mysql_prepare_create_table.
Indent preserved to make patching easier
*/
DBUG_ASSERT(sql_field->charset);
@@ -2133,7 +2039,8 @@ int prepare_create_field(create_field *sql_field,
break;
case MYSQL_TYPE_BIT:
/*
- We have sql_field->pack_flag already set here, see mysql_prepare_table().
+ We have sql_field->pack_flag already set here, see
+ mysql_prepare_create_table().
*/
break;
case MYSQL_TYPE_NEWDECIMAL:
@@ -2182,11 +2089,10 @@ int prepare_create_field(create_field *sql_field,
Preparation for table creation
SYNOPSIS
- mysql_prepare_table()
+ mysql_prepare_create_table()
thd Thread object.
create_info Create information (like MAX_ROWS).
- fields List of fields to create.
- keys List of keys to create.
+ alter_info List of columns and indexes to create
tmp_table If a temporary table is to be created.
db_options INOUT Table options (like HA_OPTION_PACK_RECORD).
file The handler for the new table.
@@ -2201,19 +2107,20 @@ int prepare_create_field(create_field *sql_field,
sets create_info->varchar if the table has a varchar
RETURN VALUES
- 0 ok
- -1 error
+ FALSE OK
+ TRUE error
*/
-static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
- List<create_field> *fields,
- List<Key> *keys, bool tmp_table,
- uint *db_options,
- handler *file, KEY **key_info_buffer,
- uint *key_count, int select_field_count)
+static bool
+mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
+ Alter_info *alter_info,
+ bool tmp_table,
+ uint *db_options,
+ handler *file, KEY **key_info_buffer,
+ uint *key_count, int select_field_count)
{
const char *key_name;
- create_field *sql_field,*dup_field;
+ Create_field *sql_field,*dup_field;
uint field,null_fields,blob_columns,max_key_length;
ulong record_offset= 0;
KEY *key_info;
@@ -2221,11 +2128,12 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
int timestamps= 0, timestamps_with_niladic= 0;
int field_no,dup_no;
int select_field_pos,auto_increment=0;
- List_iterator<create_field> it(*fields),it2(*fields);
+ List_iterator<Create_field> it(alter_info->create_list);
+ List_iterator<Create_field> it2(alter_info->create_list);
uint total_uneven_bit_length= 0;
- DBUG_ENTER("mysql_prepare_table");
+ DBUG_ENTER("mysql_prepare_create_table");
- select_field_pos= fields->elements - select_field_count;
+ select_field_pos= alter_info->create_list.elements - select_field_count;
null_fields=blob_columns=0;
create_info->varchar= 0;
max_key_length= file->max_key_length();
@@ -2260,7 +2168,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
strmake(strmake(tmp, save_cs->csname, sizeof(tmp)-4),
STRING_WITH_LEN("_bin"));
my_error(ER_UNKNOWN_COLLATION, MYF(0), tmp);
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
/*
@@ -2274,26 +2182,23 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
sql_field->sql_type == MYSQL_TYPE_SET ||
sql_field->sql_type == MYSQL_TYPE_ENUM))
{
- Query_arena backup_arena;
- bool need_to_change_arena= !thd->stmt_arena->is_conventional();
- if (need_to_change_arena)
- {
- /* Asser that we don't do that at every PS execute */
- DBUG_ASSERT(thd->stmt_arena->is_first_stmt_execute() ||
- thd->stmt_arena->is_first_sp_execute());
- thd->set_n_backup_active_arena(thd->stmt_arena, &backup_arena);
- }
-
+ /*
+ Starting from 5.1 we work here with a copy of Create_field
+ created by the caller, not with the instance that was
+ originally created during parsing. It's OK to create
+ a temporary item and initialize with it a member of the
+ copy -- this item will be thrown away along with the copy
+ at the end of execution, and thus not introduce a dangling
+ pointer in the parsed tree of a prepared statement or a
+ stored procedure statement.
+ */
sql_field->def= sql_field->def->safe_charset_converter(save_cs);
- if (need_to_change_arena)
- thd->restore_active_arena(thd->stmt_arena, &backup_arena);
-
if (sql_field->def == NULL)
{
/* Could not convert */
my_error(ER_INVALID_DEFAULT, MYF(0), sql_field->field_name);
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
}
@@ -2312,12 +2217,11 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
if (!interval)
{
/*
- Create the typelib in prepared statement memory if we're
- executing one.
+ Create the typelib in runtime memory - we will free the
+ occupied memory at the same time when we free this
+ sql_field -- at the end of execution.
*/
- MEM_ROOT *stmt_root= thd->stmt_arena->mem_root;
-
- interval= sql_field->interval= typelib(stmt_root,
+ interval= sql_field->interval= typelib(thd->mem_root,
sql_field->interval_list);
List_iterator<String> int_it(sql_field->interval_list);
String conv, *tmp;
@@ -2334,7 +2238,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
{
uint cnv_errs;
conv.copy(tmp->ptr(), tmp->length(), tmp->charset(), cs, &cnv_errs);
- interval->type_names[i]= strmake_root(stmt_root, conv.ptr(),
+ interval->type_names[i]= strmake_root(thd->mem_root, conv.ptr(),
conv.length());
interval->type_lengths[i]= conv.length();
}
@@ -2351,7 +2255,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
comma_buf, comma_length, NULL, 0))
{
my_error(ER_ILLEGAL_VALUE_FOR_TYPE, MYF(0), "set", tmp->ptr());
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
}
}
@@ -2372,7 +2276,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
if ((sql_field->flags & NOT_NULL_FLAG) != 0)
{
my_error(ER_INVALID_DEFAULT, MYF(0), sql_field->field_name);
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
/* else, NULL is an allowed value */
@@ -2388,7 +2292,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
if (not_found)
{
my_error(ER_INVALID_DEFAULT, MYF(0), sql_field->field_name);
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
}
calculate_interval_lengths(cs, interval, &dummy, &field_length);
@@ -2406,7 +2310,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
if ((sql_field->flags & NOT_NULL_FLAG) != 0)
{
my_error(ER_INVALID_DEFAULT, MYF(0), sql_field->field_name);
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
/* else, the defaults yield the correct length for NULLs. */
@@ -2417,7 +2321,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
if (find_type2(interval, def->ptr(), def->length(), cs) == 0) /* not found */
{
my_error(ER_INVALID_DEFAULT, MYF(0), sql_field->field_name);
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
}
}
@@ -2438,7 +2342,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
sql_field->create_length_to_internal_length();
if (prepare_blob_field(thd, sql_field))
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
if (!(sql_field->flags & NOT_NULL_FLAG))
null_fields++;
@@ -2446,7 +2350,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
if (check_column_name(sql_field->field_name))
{
my_error(ER_WRONG_COLUMN_NAME, MYF(0), sql_field->field_name);
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
/* Check if we have used the same field name before */
@@ -2463,7 +2367,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
if (field_no < select_field_pos || dup_no >= select_field_pos)
{
my_error(ER_DUP_FIELDNAME, MYF(0), sql_field->field_name);
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
else
{
@@ -2514,9 +2418,9 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
if (prepare_create_field(sql_field, &blob_columns,
&timestamps, &timestamps_with_niladic,
file->ha_table_flags()))
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
if (sql_field->sql_type == MYSQL_TYPE_VARCHAR)
- create_info->varchar= 1;
+ create_info->varchar= TRUE;
sql_field->offset= record_offset;
if (MTYP_TYPENR(sql_field->unireg_check) == Field::NEXT_NUMBER)
auto_increment++;
@@ -2526,31 +2430,32 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
{
my_message(ER_TOO_MUCH_AUTO_TIMESTAMP_COLS,
ER(ER_TOO_MUCH_AUTO_TIMESTAMP_COLS), MYF(0));
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
if (auto_increment > 1)
{
my_message(ER_WRONG_AUTO_KEY, ER(ER_WRONG_AUTO_KEY), MYF(0));
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
if (auto_increment &&
(file->ha_table_flags() & HA_NO_AUTO_INCREMENT))
{
my_message(ER_TABLE_CANT_HANDLE_AUTO_INCREMENT,
ER(ER_TABLE_CANT_HANDLE_AUTO_INCREMENT), MYF(0));
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
if (blob_columns && (file->ha_table_flags() & HA_NO_BLOBS))
{
my_message(ER_TABLE_CANT_HANDLE_BLOB, ER(ER_TABLE_CANT_HANDLE_BLOB),
MYF(0));
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
/* Create keys */
- List_iterator<Key> key_iterator(*keys), key_iterator2(*keys);
+ List_iterator<Key> key_iterator(alter_info->key_list);
+ List_iterator<Key> key_iterator2(alter_info->key_list);
uint key_parts=0, fk_key_count=0;
bool primary_key=0,unique_key=0;
Key *key, *key2;
@@ -2569,14 +2474,14 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
if (key->type == Key::FOREIGN_KEY)
{
fk_key_count++;
- foreign_key *fk_key= (foreign_key*) key;
+ Foreign_key *fk_key= (Foreign_key*) key;
if (fk_key->ref_columns.elements &&
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"),
ER(ER_KEY_REF_DO_NOT_MATCH_TABLE_REF));
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
continue;
}
@@ -2585,7 +2490,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
if (key->columns.elements > tmp)
{
my_error(ER_TOO_MANY_KEY_PARTS,MYF(0),tmp);
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
key_name_str.str= (char*) key->name;
key_name_str.length= key->name ? strlen(key->name) : 0;
@@ -2593,7 +2498,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
system_charset_info, 1))
{
my_error(ER_TOO_LONG_IDENT, MYF(0), key->name);
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
key_iterator2.rewind ();
if (key->type != Key::FOREIGN_KEY)
@@ -2633,27 +2538,27 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
!my_strcasecmp(system_charset_info,key->name,primary_key_name))
{
my_error(ER_WRONG_NAME_FOR_INDEX, MYF(0), key->name);
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
}
tmp=file->max_keys();
if (*key_count > tmp)
{
my_error(ER_TOO_MANY_KEYS,MYF(0),tmp);
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
(*key_info_buffer)= key_info= (KEY*) sql_calloc(sizeof(KEY) * (*key_count));
key_part_info=(KEY_PART_INFO*) sql_calloc(sizeof(KEY_PART_INFO)*key_parts);
if (!*key_info_buffer || ! key_part_info)
- DBUG_RETURN(-1); // Out of memory
+ DBUG_RETURN(TRUE); // Out of memory
key_iterator.rewind();
key_number=0;
for (; (key=key_iterator++) ; key_number++)
{
uint key_length=0;
- key_part_spec *column;
+ Key_part_spec *column;
if (key->name == ignore_key)
{
@@ -2683,7 +2588,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
#else
my_error(ER_FEATURE_DISABLED, MYF(0),
sym_group_geom.name, sym_group_geom.needed_define);
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
#endif
case Key::FOREIGN_KEY:
key_number--; // Skip this key
@@ -2706,7 +2611,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
{
my_message(ER_TABLE_CANT_HANDLE_FT, ER(ER_TABLE_CANT_HANDLE_FT),
MYF(0));
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
}
/*
@@ -2724,12 +2629,12 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
{
my_message(ER_TABLE_CANT_HANDLE_SPKEYS, ER(ER_TABLE_CANT_HANDLE_SPKEYS),
MYF(0));
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
if (key_info->key_parts != 1)
{
my_error(ER_WRONG_ARGUMENTS, MYF(0), "SPATIAL INDEX");
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
}
else if (key_info->algorithm == HA_KEY_ALG_RTREE)
@@ -2738,15 +2643,15 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
if ((key_info->key_parts & 1) == 1)
{
my_error(ER_WRONG_ARGUMENTS, MYF(0), "RTREE INDEX");
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
/* TODO: To be deleted */
my_error(ER_NOT_SUPPORTED_YET, MYF(0), "RTREE INDEX");
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
#else
my_error(ER_FEATURE_DISABLED, MYF(0),
sym_group_rtree.name, sym_group_rtree.needed_define);
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
#endif
}
@@ -2762,12 +2667,12 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
if (key_info->block_size)
key_info->flags|= HA_USES_BLOCK_SIZE;
- List_iterator<key_part_spec> cols(key->columns), cols2(key->columns);
+ List_iterator<Key_part_spec> cols(key->columns), cols2(key->columns);
CHARSET_INFO *ft_key_charset=0; // for FULLTEXT
for (uint column_nr=0 ; (column=cols++) ; column_nr++)
{
uint length;
- key_part_spec *dup_column;
+ Key_part_spec *dup_column;
it.rewind();
field=0;
@@ -2779,7 +2684,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
if (!sql_field)
{
my_error(ER_KEY_COLUMN_DOES_NOT_EXITS, MYF(0), column->field_name);
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
while ((dup_column= cols2++) != column)
{
@@ -2789,7 +2694,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
my_printf_error(ER_DUP_FIELDNAME,
ER(ER_DUP_FIELDNAME),MYF(0),
column->field_name);
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
}
cols2.rewind();
@@ -2822,7 +2727,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
if (key->type == Key::SPATIAL && column->length)
{
my_error(ER_WRONG_SUB_KEY, MYF(0));
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
if (f_is_blob(sql_field->pack_flag) ||
@@ -2831,7 +2736,7 @@ static int mysql_prepare_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);
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
if (f_is_geom(sql_field->pack_flag) && sql_field->geom_type ==
Field::GEOM_POINT)
@@ -2839,7 +2744,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
if (!column->length)
{
my_error(ER_BLOB_KEY_WITHOUT_LENGTH, MYF(0), column->field_name);
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
}
#ifdef HAVE_SPATIAL
@@ -2870,13 +2775,13 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
if (!(file->ha_table_flags() & HA_NULL_IN_KEY))
{
my_error(ER_NULL_COLUMN_IN_INDEX, MYF(0), column->field_name);
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
if (key->type == Key::SPATIAL)
{
my_message(ER_SPATIAL_CANT_HAVE_NULL,
ER(ER_SPATIAL_CANT_HAVE_NULL), MYF(0));
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
}
}
@@ -2908,11 +2813,13 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
length);
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TOO_LONG_KEY, warn_buff);
+ /* Align key length to multibyte char boundary */
+ length-= length % sql_field->charset->mbmaxlen;
}
else
{
my_error(ER_TOO_LONG_KEY,MYF(0),length);
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
}
}
@@ -2925,7 +2832,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
column->length != length)))
{
my_message(ER_WRONG_SUB_KEY, ER(ER_WRONG_SUB_KEY), MYF(0));
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
else if (!(file->ha_table_flags() & HA_NO_PREFIX_CHAR_KEYS))
length=column->length;
@@ -2933,13 +2840,11 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
else if (length == 0)
{
my_error(ER_WRONG_KEY_COLUMN, MYF(0), column->field_name);
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
if (length > file->max_key_part_length() && key->type != Key::FULLTEXT)
{
length= file->max_key_part_length();
- /* Align key length to multibyte char boundary */
- length-= length % sql_field->charset->mbmaxlen;
if (key->type == Key::MULTIPLE)
{
/* not a critical problem */
@@ -2948,11 +2853,13 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
length);
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TOO_LONG_KEY, warn_buff);
+ /* Align key length to multibyte char boundary */
+ length-= length % sql_field->charset->mbmaxlen;
}
else
{
my_error(ER_TOO_LONG_KEY,MYF(0),length);
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
}
key_part_info->length=(uint16) length;
@@ -2981,7 +2888,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
{
my_message(ER_MULTIPLE_PRI_KEY, ER(ER_MULTIPLE_PRI_KEY),
MYF(0));
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
key_name=primary_key_name;
primary_key=1;
@@ -2992,7 +2899,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
if (check_if_keyname_exists(key_name, *key_info_buffer, key_info))
{
my_error(ER_DUP_KEYNAME, MYF(0), key_name);
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
key_info->name=(char*) key_name;
}
@@ -3000,7 +2907,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
if (!key_info->name || check_column_name(key_info->name))
{
my_error(ER_WRONG_NAME_FOR_INDEX, MYF(0), key_info->name);
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
if (!(key_info->flags & HA_NULL_PART_KEY))
unique_key=1;
@@ -3008,7 +2915,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
if (key_length > max_key_length && key->type != Key::FULLTEXT)
{
my_error(ER_TOO_LONG_KEY,MYF(0),max_key_length);
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
key_info++;
}
@@ -3016,19 +2923,19 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
(file->ha_table_flags() & HA_REQUIRE_PRIMARY_KEY))
{
my_message(ER_REQUIRES_PRIMARY_KEY, ER(ER_REQUIRES_PRIMARY_KEY), MYF(0));
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
if (auto_increment > 0)
{
my_message(ER_WRONG_AUTO_KEY, ER(ER_WRONG_AUTO_KEY), MYF(0));
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
}
/* Sort keys in optimized order */
- qsort((gptr) *key_info_buffer, *key_count, sizeof(KEY),
+ qsort((uchar*) *key_info_buffer, *key_count, sizeof(KEY),
(qsort_cmp) sort_keys);
create_info->null_bits= null_fields;
- DBUG_RETURN(0);
+ DBUG_RETURN(FALSE);
}
@@ -3077,7 +2984,7 @@ static void set_table_default_charset(THD *thd,
In this case the error is given
*/
-static bool prepare_blob_field(THD *thd, create_field *sql_field)
+static bool prepare_blob_field(THD *thd, Create_field *sql_field)
{
DBUG_ENTER("prepare_blob_field");
@@ -3118,8 +3025,9 @@ static bool prepare_blob_field(THD *thd, create_field *sql_field)
/*
- Preparation of create_field for SP function return values.
- Based on code used in the inner loop of mysql_prepare_table() above
+ Preparation of Create_field for SP function return values.
+ Based on code used in the inner loop of mysql_prepare_create_table()
+ above.
SYNOPSIS
sp_prepare_create_field()
@@ -3131,7 +3039,7 @@ static bool prepare_blob_field(THD *thd, create_field *sql_field)
*/
-void sp_prepare_create_field(THD *thd, create_field *sql_field)
+void sp_prepare_create_field(THD *thd, Create_field *sql_field)
{
if (sql_field->sql_type == MYSQL_TYPE_SET ||
sql_field->sql_type == MYSQL_TYPE_ENUM)
@@ -3168,51 +3076,28 @@ void sp_prepare_create_field(THD *thd, create_field *sql_field)
/*
- Copy HA_CREATE_INFO struct
- SYNOPSIS
- copy_create_info()
- lex_create_info The create_info struct setup by parser
- RETURN VALUES
- > 0 A pointer to a copy of the lex_create_info
- 0 Memory allocation error
- DESCRIPTION
- Allocate memory for copy of HA_CREATE_INFO structure from parser
- to ensure we can reuse the parser struct in stored procedures
- and prepared statements.
-*/
-
-static HA_CREATE_INFO *copy_create_info(HA_CREATE_INFO *lex_create_info)
-{
- HA_CREATE_INFO *create_info;
- if (!(create_info= (HA_CREATE_INFO*)sql_alloc(sizeof(HA_CREATE_INFO))))
- mem_alloc_error(sizeof(HA_CREATE_INFO));
- else
- memcpy((void*)create_info, (void*)lex_create_info, sizeof(HA_CREATE_INFO));
- return create_info;
-}
-
-
-/*
Create a table
SYNOPSIS
- mysql_create_table_internal()
+ mysql_create_table_no_lock()
thd Thread object
db Database
table_name Table name
- lex_create_info Create information (like MAX_ROWS)
+ create_info Create information (like MAX_ROWS)
fields List of fields to create
keys List of keys to create
internal_tmp_table Set to 1 if this is an internal temporary table
(From ALTER TABLE)
- select_field_count
- use_copy_create_info Should we make a copy of create info (we do this
- when this is called from sql_parse.cc where we
- want to ensure lex object isn't manipulated.
+ select_field_count
DESCRIPTION
If one creates a temporary table, this is automatically opened
+ Note that this function assumes that caller already have taken
+ name-lock on table being created or used some other way to ensure
+ that concurrent operations won't intervene. mysql_create_table()
+ is a wrapper that can be used for this.
+
no_log is needed for the case of CREATE ... SELECT,
as the logging will be done later in sql_insert.cc
select_field_count is also used for CREATE ... SELECT,
@@ -3223,38 +3108,27 @@ static HA_CREATE_INFO *copy_create_info(HA_CREATE_INFO *lex_create_info)
TRUE error
*/
-bool mysql_create_table_internal(THD *thd,
+bool mysql_create_table_no_lock(THD *thd,
const char *db, const char *table_name,
- HA_CREATE_INFO *lex_create_info,
- List<create_field> &fields,
- List<Key> &keys,bool internal_tmp_table,
- uint select_field_count,
- bool use_copy_create_info)
+ HA_CREATE_INFO *create_info,
+ Alter_info *alter_info,
+ bool internal_tmp_table,
+ uint select_field_count)
{
char path[FN_REFLEN];
uint path_length;
const char *alias;
uint db_options, key_count;
KEY *key_info_buffer;
- HA_CREATE_INFO *create_info;
handler *file;
bool error= TRUE;
- DBUG_ENTER("mysql_create_table_internal");
+ DBUG_ENTER("mysql_create_table_no_lock");
DBUG_PRINT("enter", ("db: '%s' table: '%s' tmp: %d",
db, table_name, internal_tmp_table));
- if (use_copy_create_info)
- {
- if (!(create_info= copy_create_info(lex_create_info)))
- {
- DBUG_RETURN(TRUE);
- }
- }
- else
- create_info= lex_create_info;
-
+
/* Check for duplicate fields and check type of table to create */
- if (!fields.elements)
+ if (!alter_info->create_list.elements)
{
my_message(ER_TABLE_MUST_HAVE_COLUMNS, ER(ER_TABLE_MUST_HAVE_COLUMNS),
MYF(0));
@@ -3306,7 +3180,7 @@ bool mysql_create_table_internal(THD *thd,
Check that we don't use foreign keys in the table since it won't
work even with InnoDB beneath it.
*/
- List_iterator<Key> key_iterator(keys);
+ List_iterator<Key> key_iterator(alter_info->key_list);
Key *key;
handlerton *part_engine_type= create_info->db_type;
char *part_syntax_buf;
@@ -3433,10 +3307,11 @@ bool mysql_create_table_internal(THD *thd,
set_table_default_charset(thd, create_info, (char*) db);
- if (mysql_prepare_table(thd, create_info, &fields,
- &keys, internal_tmp_table, &db_options, file,
- &key_info_buffer, &key_count,
- select_field_count))
+ if (mysql_prepare_create_table(thd, create_info, alter_info,
+ internal_tmp_table,
+ &db_options, file,
+ &key_info_buffer, &key_count,
+ select_field_count))
goto err;
/* Check if table exists */
@@ -3514,15 +3389,25 @@ bool mysql_create_table_internal(THD *thd,
{
bool create_if_not_exists =
create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS;
-
- if (ha_table_exists_in_engine(thd, db, table_name))
+ int retcode = ha_table_exists_in_engine(thd, db, table_name);
+ DBUG_PRINT("info", ("exists_in_engine: %u",retcode));
+ switch (retcode)
{
- DBUG_PRINT("info", ("Table with same name already existed in handler"));
+ case HA_ERR_NO_SUCH_TABLE:
+ /* Normal case, no table exists. we can go and create it */
+ break;
+ case HA_ERR_TABLE_EXIST:
+ DBUG_PRINT("info", ("Table existed in handler"));
- if (create_if_not_exists)
- goto warn;
- my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name);
- goto unlock_and_end;
+ if (create_if_not_exists)
+ goto warn;
+ my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name);
+ goto unlock_and_end;
+ break;
+ default:
+ DBUG_PRINT("info", ("error: %u from storage engine", retcode));
+ my_error(retcode, MYF(0),table_name);
+ goto unlock_and_end;
}
}
@@ -3534,7 +3419,8 @@ bool mysql_create_table_internal(THD *thd,
create_info->table_options=db_options;
path[path_length - reg_ext_length]= '\0'; // Remove .frm extension
- if (rea_create_table(thd, path, db, table_name, create_info, fields,
+ if (rea_create_table(thd, path, db, table_name,
+ create_info, alter_info->create_list,
key_count, key_info_buffer, file))
goto unlock_and_end;
@@ -3546,7 +3432,7 @@ bool mysql_create_table_internal(THD *thd,
(void) rm_temporary_table(create_info->db_type, path);
goto unlock_and_end;
}
- thd->tmp_table_used= 1;
+ thd->thread_specific_used= TRUE;
}
/*
@@ -3581,23 +3467,23 @@ warn:
/*
- Database locking aware wrapper for mysql_create_table_internal(),
+ Database and name-locking aware wrapper for mysql_create_table_no_lock(),
*/
bool mysql_create_table(THD *thd, const char *db, const char *table_name,
HA_CREATE_INFO *create_info,
- List<create_field> &fields,
- List<Key> &keys,bool internal_tmp_table,
- uint select_field_count,
- bool use_copy_create_info)
+ Alter_info *alter_info,
+ bool internal_tmp_table,
+ uint select_field_count)
{
+ TABLE *name_lock= 0;
bool result;
DBUG_ENTER("mysql_create_table");
/* Wait for any database locks */
pthread_mutex_lock(&LOCK_lock_db);
while (!thd->killed &&
- hash_search(&lock_db_cache,(byte*) db, strlen(db)))
+ hash_search(&lock_db_cache,(uchar*) db, strlen(db)))
{
wait_for_condition(thd, &LOCK_lock_db, &COND_refresh);
pthread_mutex_lock(&LOCK_lock_db);
@@ -3611,11 +3497,44 @@ bool mysql_create_table(THD *thd, const char *db, const char *table_name,
creating_table++;
pthread_mutex_unlock(&LOCK_lock_db);
- result= mysql_create_table_internal(thd, db, table_name, create_info,
- fields, keys, internal_tmp_table,
- select_field_count,
- use_copy_create_info);
+ if (!(create_info->options & HA_LEX_CREATE_TMP_TABLE))
+ {
+ if (lock_table_name_if_not_cached(thd, db, table_name, &name_lock))
+ {
+ result= TRUE;
+ goto unlock;
+ }
+ if (!name_lock)
+ {
+ if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS)
+ {
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
+ ER_TABLE_EXISTS_ERROR, ER(ER_TABLE_EXISTS_ERROR),
+ table_name);
+ create_info->table_existed= 1;
+ result= FALSE;
+ }
+ else
+ {
+ my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name);
+ result= TRUE;
+ }
+ goto unlock;
+ }
+ }
+
+ result= mysql_create_table_no_lock(thd, db, table_name, create_info,
+ alter_info,
+ internal_tmp_table,
+ select_field_count);
+unlock:
+ if (name_lock)
+ {
+ pthread_mutex_lock(&LOCK_open);
+ unlink_open_table(thd, name_lock, FALSE);
+ pthread_mutex_unlock(&LOCK_open);
+ }
pthread_mutex_lock(&LOCK_lock_db);
if (!--creating_table && creating_database)
pthread_cond_signal(&COND_refresh);
@@ -3818,7 +3737,7 @@ void close_cached_table(THD *thd, TABLE *table)
thd->lock=0; // Start locked threads
}
/* Close all copies of 'table'. This also frees all LOCK TABLES lock */
- thd->open_tables=unlink_open_table(thd,thd->open_tables,table);
+ unlink_open_table(thd, table, TRUE);
/* When lock on LOCK_open is freed other threads can continue */
broadcast_refresh();
@@ -3894,7 +3813,7 @@ static int prepare_for_restore(THD* thd, TABLE_LIST* table,
to finish the restore in the handler later on
*/
pthread_mutex_lock(&LOCK_open);
- if (reopen_name_locked_table(thd, table))
+ if (reopen_name_locked_table(thd, table, TRUE))
{
unlock_table_name(thd, table);
pthread_mutex_unlock(&LOCK_open);
@@ -4026,7 +3945,7 @@ static int prepare_for_repair(THD *thd, TABLE_LIST *table_list,
to finish the repair in the handler later on.
*/
pthread_mutex_lock(&LOCK_open);
- if (reopen_name_locked_table(thd, table_list))
+ if (reopen_name_locked_table(thd, table_list, TRUE))
{
unlock_table_name(thd, table_list);
pthread_mutex_unlock(&LOCK_open);
@@ -4073,7 +3992,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
Item *item;
Protocol *protocol= thd->protocol;
LEX *lex= thd->lex;
- int result_code, disable_logs= 0;
+ int result_code;
DBUG_ENTER("mysql_admin_table");
if (end_active_trans(thd))
@@ -4107,7 +4026,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
table->next_global= 0;
save_next_local= table->next_local;
table->next_local= 0;
- select->table_list.first= (byte*)table;
+ select->table_list.first= (uchar*)table;
/*
Time zone tables and SP tables can be add to lex->query_tables list,
so it have to be prepared.
@@ -4121,22 +4040,6 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
if (view_operator_func == NULL)
table->required_type=FRMTYPE_TABLE;
- /*
- If we want to perform an admin operation on the log table
- (E.g. rename) and lock_type >= TL_READ_NO_INSERT disable
- log tables
- */
-
- if (check_if_log_table(table->db_length, table->db,
- table->table_name_length,
- table->table_name, 1) &&
- lock_type >= TL_READ_NO_INSERT)
- {
- disable_logs= 1;
- logger.lock();
- logger.tmp_close_log_tables(thd);
- }
-
open_and_lock_tables(thd, table);
thd->no_warnings_for_error= 0;
table->next_global= save_next_global;
@@ -4167,34 +4070,16 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
*/
if (!table->table)
{
- char buf[ERRMSGSIZE+ERRMSGSIZE+2];
- const char *err_msg;
- protocol->prepare_for_resend();
- protocol->store(table_name, system_charset_info);
- protocol->store(operator_name, system_charset_info);
- protocol->store(STRING_WITH_LEN("error"), system_charset_info);
- if (!(err_msg=thd->net.last_error))
- err_msg=ER(ER_CHECK_NO_SUCH_TABLE);
+ if (!thd->warn_list.elements)
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ 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)
- {
- strxmov(buf, err_msg, "; ", ER(ER_VIEW_CHECKSUM), NullS);
- err_msg= (const char *)buf;
- }
- protocol->store(err_msg, system_charset_info);
- lex->cleanup_after_one_table_open();
- thd->clear_error();
- /*
- View opening can be interrupted in the middle of process so some
- tables can be left opening
- */
- ha_autocommit_or_rollback(thd, 1);
- close_thread_tables(thd);
- lex->reset_query_tables_list(FALSE);
- if (protocol->write())
- goto err;
- continue;
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ ER_VIEW_CHECKSUM, ER(ER_VIEW_CHECKSUM));
+ result_code= HA_ADMIN_CORRUPT;
+ goto send_result;
}
if (table->view)
@@ -4224,8 +4109,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
}
/* Close all instances of the table to allow repair to rename files */
- if (lock_type == TL_WRITE && table->table->s->version &&
- !table->table->s->log_table)
+ if (lock_type == TL_WRITE && table->table->s->version)
{
pthread_mutex_lock(&LOCK_open);
const char *old_message=thd->enter_cond(&COND_refresh, &LOCK_open,
@@ -4236,6 +4120,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
RTFC_WAIT_OTHER_THREAD_FLAG |
RTFC_CHECK_KILLED_FLAG);
thd->exit_cond(old_message);
+ DBUG_EXECUTE_IF("wait_in_mysql_admin_table", wait_for_kill_signal(thd););
if (thd->killed)
goto err;
/* Flush entries in the query cache involving this table. */
@@ -4255,16 +4140,20 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
goto err;
}
- if (operator_func == &handler::ha_repair)
+ if (operator_func == &handler::ha_repair &&
+ !(check_opt->sql_flags & TT_USEFRM))
{
if ((table->table->file->check_old_types() == HA_ADMIN_NEEDS_ALTER) ||
(table->table->file->ha_check_for_upgrade(check_opt) ==
HA_ADMIN_NEEDS_ALTER))
{
+ my_bool save_no_send_ok= thd->net.no_send_ok;
ha_autocommit_or_rollback(thd, 1);
close_thread_tables(thd);
tmp_disable_binlog(thd); // binlogging is done by caller if wanted
- result_code= mysql_recreate_table(thd, table, 0);
+ thd->net.no_send_ok= TRUE;
+ result_code= mysql_recreate_table(thd, table);
+ thd->net.no_send_ok= save_no_send_ok;
reenable_binlog(thd);
goto send_result;
}
@@ -4277,6 +4166,23 @@ 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);
+ 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,
+ system_charset_info);
+ protocol->store(err->msg, system_charset_info);
+ if (protocol->write())
+ goto err;
+ }
+ mysql_reset_errors(thd, true);
+ }
protocol->prepare_for_resend();
protocol->store(table_name, system_charset_info);
protocol->store(operator_name, system_charset_info);
@@ -4343,6 +4249,7 @@ send_result_message:
case HA_ADMIN_TRY_ALTER:
{
+ my_bool save_no_send_ok= thd->net.no_send_ok;
/*
This is currently used only by InnoDB. ha_innobase::optimize() answers
"try with alter", so here we close the table, do an ALTER TABLE,
@@ -4354,13 +4261,15 @@ send_result_message:
*save_next_global= table->next_global;
table->next_local= table->next_global= 0;
tmp_disable_binlog(thd); // binlogging is done by caller if wanted
- result_code= mysql_recreate_table(thd, table, 0);
+ thd->net.no_send_ok= TRUE;
+ result_code= mysql_recreate_table(thd, table);
+ thd->net.no_send_ok= save_no_send_ok;
reenable_binlog(thd);
ha_autocommit_or_rollback(thd, 0);
close_thread_tables(thd);
if (!result_code) // recreation went ok
{
- if ((table->table= open_ltable(thd, table, lock_type)) &&
+ if ((table->table= open_ltable(thd, table, lock_type, 0)) &&
((result_code= table->table->file->analyze(thd, check_opt)) > 0))
result_code= 0; // analyze went ok
}
@@ -4426,10 +4335,9 @@ send_result_message:
}
if (table->table)
{
- /* in the below check we do not refresh the log tables */
if (fatal_error)
table->table->s->version=0; // Force close of table
- else if (open_for_modify && !table->table->s->log_table)
+ else if (open_for_modify)
{
if (table->table->s->tmp_table)
table->table->file->info(HA_STATUS_CONST);
@@ -4452,24 +4360,11 @@ send_result_message:
}
send_eof(thd);
- if (disable_logs)
- {
- if (logger.reopen_log_tables())
- my_error(ER_CANT_ACTIVATE_LOG, MYF(0));
- logger.unlock();
- }
DBUG_RETURN(FALSE);
err:
ha_autocommit_or_rollback(thd, 1);
close_thread_tables(thd); // Shouldn't be needed
- /* enable logging back if needed */
- if (disable_logs)
- {
- if (logger.reopen_log_tables())
- my_error(ER_CANT_ACTIVATE_LOG, MYF(0));
- logger.unlock();
- }
if (table)
table->table=0;
DBUG_RETURN(TRUE);
@@ -4479,6 +4374,8 @@ send_result_message:
bool mysql_backup_table(THD* thd, TABLE_LIST* table_list)
{
DBUG_ENTER("mysql_backup_table");
+ WARN_DEPRECATED(thd, "5.2", "BACKUP TABLE",
+ "MySQL Administrator (mysqldump, mysql)");
DBUG_RETURN(mysql_admin_table(thd, table_list, 0,
"backup", TL_READ, 0, 0, 0, 0,
&handler::backup, 0));
@@ -4488,6 +4385,8 @@ bool mysql_backup_table(THD* thd, TABLE_LIST* table_list)
bool mysql_restore_table(THD* thd, TABLE_LIST* table_list)
{
DBUG_ENTER("mysql_restore_table");
+ WARN_DEPRECATED(thd, "5.2", "RESTORE TABLE",
+ "MySQL Administrator (mysqldump, mysql)");
DBUG_RETURN(mysql_admin_table(thd, table_list, 0,
"restore", TL_WRITE, 1, 1, 0,
&prepare_for_restore,
@@ -4607,8 +4506,13 @@ int reassign_keycache_tables(THD *thd, KEY_CACHE *src_cache,
bool mysql_preload_keys(THD* thd, TABLE_LIST* tables)
{
DBUG_ENTER("mysql_preload_keys");
+ /*
+ We cannot allow concurrent inserts. The storage engine reads
+ directly from the index file, bypassing the cache. It could read
+ outdated information if parallel inserts into cache blocks happen.
+ */
DBUG_RETURN(mysql_admin_table(thd, tables, 0,
- "preload_keys", TL_READ, 0, 0, 0, 0,
+ "preload_keys", TL_READ_NO_INSERT, 0, 0, 0, 0,
&handler::preload_keys, 0));
}
@@ -4619,114 +4523,46 @@ bool mysql_preload_keys(THD* thd, TABLE_LIST* tables)
SYNOPSIS
mysql_create_like_table()
thd Thread object
- table Table list (one table only)
+ table Table list element for target table
+ src_table Table list element for source table
create_info Create info
- table_ident Src table_ident
RETURN VALUES
FALSE OK
TRUE error
*/
-bool mysql_create_like_table(THD* thd, TABLE_LIST* table,
- HA_CREATE_INFO *lex_create_info,
- Table_ident *table_ident)
+bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table,
+ HA_CREATE_INFO *create_info)
{
- TABLE *tmp_table;
+ TABLE *name_lock= 0;
char src_path[FN_REFLEN], dst_path[FN_REFLEN];
- char src_table_name_buff[FN_REFLEN], src_db_name_buff[FN_REFLEN];
uint dst_path_length;
char *db= table->db;
char *table_name= table->table_name;
- char *src_db;
- char *src_table= table_ident->table.str;
int err;
- bool res= TRUE, unlock_dst_table= FALSE;
- enum legacy_db_type not_used;
- HA_CREATE_INFO *create_info;
+ bool res= TRUE;
+ uint not_used;
#ifdef WITH_PARTITION_STORAGE_ENGINE
char tmp_path[FN_REFLEN];
#endif
char ts_name[FN_LEN];
- TABLE_LIST src_tables_list, dst_tables_list;
DBUG_ENTER("mysql_create_like_table");
- if (!(create_info= copy_create_info(lex_create_info)))
- {
- DBUG_RETURN(TRUE);
- }
- DBUG_ASSERT(table_ident->db.str); /* Must be set in the parser */
- src_db= table_ident->db.str;
- /*
- Validate the source table
- */
- if (check_string_char_length(&table_ident->table, "", NAME_CHAR_LEN,
- system_charset_info, 1) ||
- (table_ident->table.length &&
- check_table_name(src_table,table_ident->table.length)))
- {
- my_error(ER_WRONG_TABLE_NAME, MYF(0), src_table);
- DBUG_RETURN(TRUE);
- }
- if (!src_db || check_db_name(&table_ident->db))
- {
- my_error(ER_WRONG_DB_NAME, MYF(0), src_db ? src_db : "NULL");
- DBUG_RETURN(-1);
- }
+ /* CREATE TABLE ... LIKE is not allowed for views. */
+ src_table->required_type= FRMTYPE_TABLE;
- if ((tmp_table= find_temporary_table(thd, src_db, src_table)))
- strxmov(src_path, tmp_table->s->path.str, reg_ext, NullS);
- else
- {
- build_table_filename(src_path, sizeof(src_path),
- src_db, src_table, reg_ext, 0);
- /* Resolve symlinks (for windows) */
- unpack_filename(src_path, src_path);
- if (lower_case_table_names)
- my_casedn_str(files_charset_info, src_path);
- if (access(src_path, F_OK))
- {
- my_error(ER_BAD_TABLE_ERROR, MYF(0), src_table);
- goto err;
- }
- }
-
- /*
- create like should be not allowed for Views, Triggers, ...
+ /*
+ By opening source table we guarantee that it exists and no concurrent
+ DDL operation will mess with it. Later we also take an exclusive
+ name-lock on target table name, which makes copying of .frm file,
+ call to ha_create_table() and binlogging atomic against concurrent DML
+ and DDL operations on target table. Thus by holding both these "locks"
+ we ensure that our statement is properly isolated from all concurrent
+ operations which matter.
*/
- if (mysql_frm_type(thd, src_path, &not_used) != FRMTYPE_TABLE)
- {
- my_error(ER_WRONG_OBJECT, MYF(0), src_db, src_table, "BASE TABLE");
- goto err;
- }
-
- if (lower_case_table_names)
- {
- if (src_db)
- {
- strmake(src_db_name_buff, src_db,
- min(sizeof(src_db_name_buff) - 1, table_ident->db.length));
- my_casedn_str(files_charset_info, src_db_name_buff);
- src_db= src_db_name_buff;
- }
- if (src_table)
- {
- strmake(src_table_name_buff, src_table,
- min(sizeof(src_table_name_buff) - 1, table_ident->table.length));
- my_casedn_str(files_charset_info, src_table_name_buff);
- src_table= src_table_name_buff;
- }
- }
-
- bzero((gptr)&src_tables_list, sizeof(src_tables_list));
- src_tables_list.db= src_db;
- src_tables_list.db_length= table_ident->db.length;
- src_tables_list.lock_type= TL_READ;
- src_tables_list.table_name= src_table;
- src_tables_list.alias= src_table;
-
- if (simple_open_n_lock_tables(thd, &src_tables_list))
+ if (open_tables(thd, &src_table, &not_used, 0))
DBUG_RETURN(TRUE);
/*
@@ -4735,17 +4571,19 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table,
Add something to get possible tablespace info from src table,
it can get valid tablespace name only for disk-base ndb table
*/
- if ((src_tables_list.table->file->get_tablespace_name(thd, ts_name, FN_LEN)))
+ if ((src_table->table->file->get_tablespace_name(thd, ts_name, FN_LEN)))
{
create_info->tablespace= ts_name;
create_info->storage_media= HA_SM_DISK;
}
- /*
- Validate the destination table
+ strxmov(src_path, src_table->table->s->path.str, reg_ext, NullS);
- skip the destination table name checking as this is already
- validated.
+ DBUG_EXECUTE_IF("sleep_create_like_before_check_if_exists", my_sleep(6000000););
+
+ /*
+ Check that destination tables does not exist. Note that its name
+ was already checked when it was added to the table list.
*/
if (create_info->options & HA_LEX_CREATE_TMP_TABLE)
{
@@ -4756,21 +4594,39 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table,
}
else
{
+ if (lock_table_name_if_not_cached(thd, db, table_name, &name_lock))
+ goto err;
+ if (!name_lock)
+ goto table_exists;
dst_path_length= build_table_filename(dst_path, sizeof(dst_path),
db, table_name, reg_ext, 0);
if (!access(dst_path, F_OK))
goto table_exists;
}
+ DBUG_EXECUTE_IF("sleep_create_like_before_copy", my_sleep(6000000););
+
/*
Create a new table by copying from source table
+
+ Altough exclusive name-lock on target table protects us from concurrent
+ DML and DDL operations on it we still want to wrap .FRM creation and call
+ to ha_create_table() in critical section protected by LOCK_open in order
+ to provide minimal atomicity against operations which disregard name-locks,
+ like I_S implementation, for example. This is a temporary and should not
+ be copied. Instead we should fix our code to always honor name-locks.
+
+ Also some engines (e.g. NDB cluster) require that LOCK_open should be held
+ during the call to ha_create_table(). See bug #28614 for more info.
*/
+ VOID(pthread_mutex_lock(&LOCK_open));
if (my_copy(src_path, dst_path, MYF(MY_DONT_OVERWRITE_FILE)))
{
if (my_errno == ENOENT)
my_error(ER_BAD_DB_ERROR,MYF(0),db);
else
my_error(ER_CANT_CREATE_FILE,MYF(0),dst_path,my_errno);
+ VOID(pthread_mutex_unlock(&LOCK_open));
goto err;
}
@@ -4792,10 +4648,15 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table,
strmov(src_path, tmp_path);
my_copy(src_path, dst_path, MYF(MY_DONT_OVERWRITE_FILE));
#endif
+
+ DBUG_EXECUTE_IF("sleep_create_like_before_ha_create", my_sleep(6000000););
+
dst_path[dst_path_length - reg_ext_length]= '\0'; // Remove .frm
- pthread_mutex_lock(&LOCK_open);
+ if (thd->variables.keep_files_on_create)
+ create_info->options|= HA_CREATE_KEEP_FILES;
err= ha_create_table(thd, dst_path, db, table_name, create_info, 1);
- pthread_mutex_unlock(&LOCK_open);
+ VOID(pthread_mutex_unlock(&LOCK_open));
+
if (create_info->options & HA_LEX_CREATE_TMP_TABLE)
{
if (err || !open_temporary_table(thd, dst_path, db, table_name, 1))
@@ -4812,6 +4673,8 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table,
goto err; /* purecov: inspected */
}
+ DBUG_EXECUTE_IF("sleep_create_like_before_binlogging", my_sleep(6000000););
+
/*
We have to write the query before we unlock the tables.
*/
@@ -4831,40 +4694,29 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table,
3 temporary normal Nothing
4 temporary temporary Nothing
==== ========= ========= ==============================
-
- The variable 'tmp_table' below is used to see if the source
- table is a temporary table: if it is set, then the source table
- was a temporary table and we can take apropriate actions.
*/
if (!(create_info->options & HA_LEX_CREATE_TMP_TABLE))
{
- if (tmp_table) // Case 2
+ if (src_table->table->s->tmp_table) // Case 2
{
char buf[2048];
String query(buf, sizeof(buf), system_charset_info);
query.length(0); // Have to zero it since constructor doesn't
- uint counter;
/*
- Here we open the destination table. This is needed for
- store_create_info() to work. The table will be closed
- by close_thread_tables() at the end of the statement.
+ Here we open the destination table, on which we already have
+ name-lock. This is needed for store_create_info() to work.
+ The table will be closed by unlink_open_table() at the end
+ of this function.
*/
- if (open_tables(thd, &table, &counter, 0))
- goto err;
-
- bzero((gptr)&dst_tables_list, sizeof(dst_tables_list));
- dst_tables_list.db= table->db;
- dst_tables_list.table_name= table->table_name;
-
- /*
- lock destination table name, to make sure that nobody
- can drop/alter the table while we execute store_create_info()
- */
- if (lock_and_wait_for_table_name(thd, &dst_tables_list))
+ table->table= name_lock;
+ VOID(pthread_mutex_lock(&LOCK_open));
+ if (reopen_name_locked_table(thd, table, FALSE))
+ {
+ VOID(pthread_mutex_unlock(&LOCK_open));
goto err;
- else
- unlock_dst_table= TRUE;
+ }
+ VOID(pthread_mutex_unlock(&LOCK_open));
IF_DBUG(int result=) store_create_info(thd, table, &query,
create_info);
@@ -4899,10 +4751,10 @@ table_exists:
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), table_name);
err:
- if (unlock_dst_table)
+ if (name_lock)
{
pthread_mutex_lock(&LOCK_open);
- unlock_table_name(thd, &dst_tables_list);
+ unlink_open_table(thd, name_lock, FALSE);
pthread_mutex_unlock(&LOCK_open);
}
DBUG_RETURN(res);
@@ -4927,7 +4779,7 @@ bool mysql_check_table(THD* thd, TABLE_LIST* tables,HA_CHECK_OPT* check_opt)
DBUG_ENTER("mysql_check_table");
DBUG_RETURN(mysql_admin_table(thd, tables, check_opt,
"check", lock_type,
- 0, HA_OPEN_FOR_REPAIR, 0, 0,
+ 0, 0, HA_OPEN_FOR_REPAIR, 0,
&handler::ha_check, &view_checksum));
}
@@ -4957,7 +4809,7 @@ mysql_discard_or_import_tablespace(THD *thd,
not complain when we lock the table
*/
thd->tablespace_op= TRUE;
- if (!(table=open_ltable(thd,table_list,TL_WRITE)))
+ if (!(table=open_ltable(thd, table_list, TL_WRITE, 0)))
{
thd->tablespace_op=FALSE;
DBUG_RETURN(-1);
@@ -5005,12 +4857,18 @@ err:
SYNOPSIS
compare_tables()
table The original table.
- create_list The fields for the new table.
- key_info_buffer An array of KEY structs for the new indexes.
- key_count The number of elements in the array.
+ alter_info Alter options, fields and keys for the new
+ table.
create_info Create options for the new table.
- alter_info Alter options.
order_num Number of order list elements.
+ need_copy_table OUT Result of the comparison. Undefined if error.
+ Otherwise is one of:
+ ALTER_TABLE_METADATA_ONLY No copy needed
+ ALTER_TABLE_DATA_CHANGED Data changes,
+ copy needed
+ ALTER_TABLE_INDEX_CHANGED Index changes,
+ copy might be needed
+ key_info_buffer OUT An array of KEY structs for new indexes
index_drop_buffer OUT An array of offsets into table->key_info.
index_drop_count OUT The number of elements in the array.
index_add_buffer OUT An array of offsets into key_info_buffer.
@@ -5032,27 +4890,69 @@ err:
that need to be dropped and/or (re-)created.
RETURN VALUES
- 0 No copy needed
- ALTER_TABLE_DATA_CHANGED Data changes, copy needed
- ALTER_TABLE_INDEX_CHANGED Index changes, copy might be needed
+ TRUE error
+ FALSE success
*/
-static uint compare_tables(TABLE *table, List<create_field> *create_list,
- KEY *key_info_buffer, uint key_count,
- HA_CREATE_INFO *create_info,
- ALTER_INFO *alter_info, uint order_num,
- uint *index_drop_buffer, uint *index_drop_count,
- uint *index_add_buffer, uint *index_add_count,
- bool varchar)
+static
+bool
+compare_tables(TABLE *table,
+ Alter_info *alter_info,
+ HA_CREATE_INFO *create_info,
+ uint order_num,
+ enum_alter_table_change_level *need_copy_table,
+ KEY **key_info_buffer,
+ uint **index_drop_buffer, uint *index_drop_count,
+ uint **index_add_buffer, uint *index_add_count)
{
Field **f_ptr, *field;
uint changes= 0, tmp;
- List_iterator_fast<create_field> new_field_it(*create_list);
- create_field *new_field;
+ uint key_count;
+ List_iterator_fast<Create_field> new_field_it(alter_info->create_list);
+ Create_field *new_field;
KEY_PART_INFO *key_part;
KEY_PART_INFO *end;
+ /*
+ Remember if the new definition has new VARCHAR column;
+ create_info->varchar will be reset in mysql_prepare_create_table.
+ */
+ bool varchar= create_info->varchar;
DBUG_ENTER("compare_tables");
+ {
+ THD *thd= table->in_use;
+ /*
+ Create a copy of alter_info.
+ To compare the new and old table definitions, we need to "prepare"
+ the new definition - transform it from parser output to a format
+ that describes the final table layout (all column defaults are
+ initialized, duplicate columns are removed). This is done by
+ mysql_prepare_create_table. Unfortunately,
+ mysql_prepare_create_table performs its transformations
+ "in-place", that is, modifies the argument. Since we would
+ like to keep compare_tables() idempotent (not altering any
+ of the arguments) we create a copy of alter_info here and
+ pass it to mysql_prepare_create_table, then use the result
+ to evaluate possibility of fast ALTER TABLE, and then
+ destroy the copy.
+ */
+ Alter_info tmp_alter_info(*alter_info, thd->mem_root);
+ uint db_options= 0; /* not used */
+ /* Create the prepared information. */
+ if (mysql_prepare_create_table(thd, create_info,
+ &tmp_alter_info,
+ (table->s->tmp_table != NO_TMP_TABLE),
+ &db_options,
+ table->file, key_info_buffer,
+ &key_count, 0))
+ DBUG_RETURN(1);
+ /* Allocate result buffers. */
+ if (! (*index_drop_buffer=
+ (uint*) thd->alloc(sizeof(uint) * table->s->keys)) ||
+ ! (*index_add_buffer=
+ (uint*) thd->alloc(sizeof(uint) * tmp_alter_info.key_list.elements)))
+ DBUG_RETURN(1);
+ }
/*
Some very basic checks. If number of fields changes, or the
handler, we need to run full ALTER TABLE. In the future
@@ -5079,8 +4979,8 @@ static uint compare_tables(TABLE *table, List<create_field> *create_list,
prior to 5.0 branch.
See BUG#6236.
*/
- if (table->s->fields != create_list->elements ||
- table->s->db_type != create_info->db_type ||
+ if (table->s->fields != alter_info->create_list.elements ||
+ table->s->db_type() != create_info->db_type ||
table->s->tmp_table ||
create_info->used_fields & HA_CREATE_USED_ENGINE ||
create_info->used_fields & HA_CREATE_USED_CHARSET ||
@@ -5089,7 +4989,10 @@ static uint compare_tables(TABLE *table, List<create_field> *create_list,
order_num ||
!table->s->mysql_version ||
(table->s->frm_version < FRM_VER_TRUE_VARCHAR && varchar))
- DBUG_RETURN(ALTER_TABLE_DATA_CHANGED);
+ {
+ *need_copy_table= ALTER_TABLE_DATA_CHANGED;
+ DBUG_RETURN(0);
+ }
/*
Go through fields and check if the original ones are compatible
@@ -5105,7 +5008,10 @@ static uint compare_tables(TABLE *table, List<create_field> *create_list,
/* Check that NULL behavior is same for old and new fields */
if ((new_field->flags & NOT_NULL_FLAG) !=
(uint) (field->flags & NOT_NULL_FLAG))
- DBUG_RETURN(ALTER_TABLE_DATA_CHANGED);
+ {
+ *need_copy_table= ALTER_TABLE_DATA_CHANGED;
+ DBUG_RETURN(0);
+ }
/* Don't pack rows in old tables if the user has requested this. */
if (create_info->row_type == ROW_TYPE_DYNAMIC ||
@@ -5123,7 +5029,10 @@ static uint compare_tables(TABLE *table, List<create_field> *create_list,
/* Evaluate changes bitmap and send to check_if_incompatible_data() */
if (!(tmp= field->is_equal(new_field)))
- DBUG_RETURN(ALTER_TABLE_DATA_CHANGED);
+ {
+ *need_copy_table= ALTER_TABLE_DATA_CHANGED;
+ DBUG_RETURN(0);
+ }
// Clear indexed marker
field->flags&= ~FIELD_IN_ADD_INDEX;
changes|= tmp;
@@ -5136,7 +5045,7 @@ static uint compare_tables(TABLE *table, List<create_field> *create_list,
KEY *table_key;
KEY *table_key_end= table->key_info + table->s->keys;
KEY *new_key;
- KEY *new_key_end= key_info_buffer + key_count;
+ KEY *new_key_end= *key_info_buffer + key_count;
DBUG_PRINT("info", ("index count old: %d new: %d",
table->s->keys, key_count));
@@ -5152,7 +5061,7 @@ static uint compare_tables(TABLE *table, List<create_field> *create_list,
KEY_PART_INFO *new_part;
/* Search a new key with the same name. */
- for (new_key= key_info_buffer; new_key < new_key_end; new_key++)
+ for (new_key= *key_info_buffer; new_key < new_key_end; new_key++)
{
if (! strcmp(table_key->name, new_key->name))
break;
@@ -5160,7 +5069,7 @@ static uint compare_tables(TABLE *table, List<create_field> *create_list,
if (new_key >= new_key_end)
{
/* Key not found. Add the offset of the key to the drop buffer. */
- index_drop_buffer[(*index_drop_count)++]= table_key - table->key_info;
+ (*index_drop_buffer)[(*index_drop_count)++]= table_key - table->key_info;
DBUG_PRINT("info", ("index dropped: '%s'", table_key->name));
continue;
}
@@ -5193,8 +5102,8 @@ static uint compare_tables(TABLE *table, List<create_field> *create_list,
index_changed:
/* Key modified. Add the offset of the key to both buffers. */
- index_drop_buffer[(*index_drop_count)++]= table_key - table->key_info;
- index_add_buffer[(*index_add_count)++]= new_key - key_info_buffer;
+ (*index_drop_buffer)[(*index_drop_count)++]= table_key - table->key_info;
+ (*index_add_buffer)[(*index_add_count)++]= new_key - *key_info_buffer;
key_part= new_key->key_part;
end= key_part + new_key->key_parts;
for(; key_part != end; key_part++)
@@ -5210,7 +5119,7 @@ static uint compare_tables(TABLE *table, List<create_field> *create_list,
/*
Step through all keys of the new table and find matching old keys.
*/
- for (new_key= key_info_buffer; new_key < new_key_end; new_key++)
+ for (new_key= *key_info_buffer; new_key < new_key_end; new_key++)
{
/* Search an old key with the same name. */
for (table_key= table->key_info; table_key < table_key_end; table_key++)
@@ -5221,7 +5130,7 @@ static uint compare_tables(TABLE *table, List<create_field> *create_list,
if (table_key >= table_key_end)
{
/* Key not found. Add the offset of the key to the add buffer. */
- index_add_buffer[(*index_add_count)++]= new_key - key_info_buffer;
+ (*index_add_buffer)[(*index_add_count)++]= new_key - *key_info_buffer;
key_part= new_key->key_part;
end= key_part + new_key->key_parts;
for(; key_part != end; key_part++)
@@ -5236,12 +5145,19 @@ static uint compare_tables(TABLE *table, List<create_field> *create_list,
/* Check if changes are compatible with current handler without a copy */
if (table->file->check_if_incompatible_data(create_info, changes))
- DBUG_RETURN(ALTER_TABLE_DATA_CHANGED);
+ {
+ *need_copy_table= ALTER_TABLE_DATA_CHANGED;
+ DBUG_RETURN(0);
+ }
if (*index_drop_count || *index_add_count)
- DBUG_RETURN(ALTER_TABLE_INDEX_CHANGED);
+ {
+ *need_copy_table= ALTER_TABLE_INDEX_CHANGED;
+ DBUG_RETURN(0);
+ }
- DBUG_RETURN(0); // Tables are compatible
+ *need_copy_table= ALTER_TABLE_METADATA_ONLY; // Tables are compatible
+ DBUG_RETURN(0);
}
@@ -5293,6 +5209,411 @@ bool alter_table_manage_keys(TABLE *table, int indexes_were_disabled,
}
+/**
+ Prepare column and key definitions for CREATE TABLE in ALTER TABLE.
+
+ This function transforms parse output of ALTER TABLE - lists of
+ columns and keys to add, drop or modify into, essentially,
+ CREATE TABLE definition - a list of columns and keys of the new
+ table. While doing so, it also performs some (bug not all)
+ semantic checks.
+
+ This function is invoked when we know that we're going to
+ perform ALTER TABLE via a temporary table -- i.e. fast ALTER TABLE
+ is not possible, perhaps because the ALTER statement contains
+ instructions that require change in table data, not only in
+ table definition or indexes.
+
+ @param[in,out] thd thread handle. Used as a memory pool
+ and source of environment information.
+ @param[in] table the source table, open and locked
+ Used as an interface to the storage engine
+ to acquire additional information about
+ the original table.
+ @param[in,out] create_info A blob with CREATE/ALTER TABLE
+ parameters
+ @param[in,out] alter_info Another blob with ALTER/CREATE parameters.
+ Originally create_info was used only in
+ CREATE TABLE and alter_info only in ALTER TABLE.
+ But since ALTER might end-up doing CREATE,
+ this distinction is gone and we just carry
+ around two structures.
+
+ @return
+ Fills various create_info members based on information retrieved
+ from the storage engine.
+ Sets create_info->varchar if the table has a VARCHAR column.
+ Prepares alter_info->create_list and alter_info->key_list with
+ columns and keys of the new table.
+ @retval TRUE error, out of memory or a semantical error in ALTER
+ TABLE instructions
+ @retval FALSE success
+*/
+
+static bool
+mysql_prepare_alter_table(THD *thd, TABLE *table,
+ HA_CREATE_INFO *create_info,
+ Alter_info *alter_info)
+{
+ /* New column definitions are added here */
+ List<Create_field> new_create_list;
+ /* New key definitions are added here */
+ List<Key> new_key_list;
+ List_iterator<Alter_drop> drop_it(alter_info->drop_list);
+ List_iterator<Create_field> def_it(alter_info->create_list);
+ List_iterator<Alter_column> alter_it(alter_info->alter_list);
+ List_iterator<Key> key_it(alter_info->key_list);
+ List_iterator<Create_field> find_it(new_create_list);
+ List_iterator<Create_field> field_it(new_create_list);
+ List<Key_part_spec> key_parts;
+ uint db_create_options= (table->s->db_create_options
+ & ~(HA_OPTION_PACK_RECORD));
+ uint used_fields= create_info->used_fields;
+ KEY *key_info=table->key_info;
+ bool rc= TRUE;
+
+ DBUG_ENTER("mysql_prepare_alter_table");
+
+ create_info->varchar= FALSE;
+ /* Let new create options override the old ones */
+ if (!(used_fields & HA_CREATE_USED_MIN_ROWS))
+ create_info->min_rows= table->s->min_rows;
+ if (!(used_fields & HA_CREATE_USED_MAX_ROWS))
+ create_info->max_rows= table->s->max_rows;
+ if (!(used_fields & HA_CREATE_USED_AVG_ROW_LENGTH))
+ create_info->avg_row_length= table->s->avg_row_length;
+ if (!(used_fields & HA_CREATE_USED_DEFAULT_CHARSET))
+ create_info->default_table_charset= table->s->table_charset;
+ if (!(used_fields & HA_CREATE_USED_AUTO) && table->found_next_number_field)
+ {
+ /* Table has an autoincrement, copy value to new table */
+ table->file->info(HA_STATUS_AUTO);
+ create_info->auto_increment_value= table->file->stats.auto_increment_value;
+ }
+ if (!(used_fields & HA_CREATE_USED_KEY_BLOCK_SIZE))
+ create_info->key_block_size= table->s->key_block_size;
+ if (!(used_fields & HA_CREATE_USED_TRANSACTIONAL))
+ create_info->transactional= table->s->transactional;
+
+ if (!create_info->tablespace && create_info->storage_media != HA_SM_MEMORY)
+ {
+ char *tablespace= static_cast<char *>(thd->alloc(FN_LEN));
+ /*
+ Regular alter table of disk stored table (no tablespace/storage change)
+ Copy tablespace name
+ */
+ if (tablespace &&
+ (table->file->get_tablespace_name(thd, tablespace, FN_LEN)))
+ create_info->tablespace= tablespace;
+ }
+ restore_record(table, s->default_values); // Empty record for DEFAULT
+ Create_field *def;
+
+ /*
+ First collect all fields from table which isn't in drop_list
+ */
+ Field **f_ptr,*field;
+ for (f_ptr=table->field ; (field= *f_ptr) ; f_ptr++)
+ {
+ if (field->type() == MYSQL_TYPE_STRING)
+ create_info->varchar= TRUE;
+ /* Check if field should be dropped */
+ Alter_drop *drop;
+ drop_it.rewind();
+ while ((drop=drop_it++))
+ {
+ if (drop->type == Alter_drop::COLUMN &&
+ !my_strcasecmp(system_charset_info,field->field_name, drop->name))
+ {
+ /* Reset auto_increment value if it was dropped */
+ if (MTYP_TYPENR(field->unireg_check) == Field::NEXT_NUMBER &&
+ !(used_fields & HA_CREATE_USED_AUTO))
+ {
+ create_info->auto_increment_value=0;
+ create_info->used_fields|=HA_CREATE_USED_AUTO;
+ }
+ break;
+ }
+ }
+ if (drop)
+ {
+ drop_it.remove();
+ continue;
+ }
+ /* Check if field is changed */
+ def_it.rewind();
+ while ((def=def_it++))
+ {
+ if (def->change &&
+ !my_strcasecmp(system_charset_info,field->field_name, def->change))
+ break;
+ }
+ if (def)
+ { // Field is changed
+ def->field=field;
+ if (!def->after)
+ {
+ new_create_list.push_back(def);
+ def_it.remove();
+ }
+ }
+ else
+ {
+ /*
+ This field was not dropped and not changed, add it to the list
+ for the new table.
+ */
+ def= new Create_field(field, field);
+ new_create_list.push_back(def);
+ alter_it.rewind(); // Change default if ALTER
+ Alter_column *alter;
+ while ((alter=alter_it++))
+ {
+ if (!my_strcasecmp(system_charset_info,field->field_name, alter->name))
+ break;
+ }
+ if (alter)
+ {
+ if (def->sql_type == MYSQL_TYPE_BLOB)
+ {
+ my_error(ER_BLOB_CANT_HAVE_DEFAULT, MYF(0), def->change);
+ goto err;
+ }
+ if ((def->def=alter->def)) // Use new default
+ def->flags&= ~NO_DEFAULT_VALUE_FLAG;
+ else
+ def->flags|= NO_DEFAULT_VALUE_FLAG;
+ alter_it.remove();
+ }
+ }
+ }
+ def_it.rewind();
+ while ((def=def_it++)) // Add new columns
+ {
+ if (def->change && ! def->field)
+ {
+ my_error(ER_BAD_FIELD_ERROR, MYF(0), def->change, table->s->table_name);
+ goto err;
+ }
+ /*
+ Check that the DATE/DATETIME not null field we are going to add is
+ either has a default value or the '0000-00-00' is allowed by the
+ set sql mode.
+ If the '0000-00-00' value isn't allowed then raise the error_if_not_empty
+ flag to allow ALTER TABLE only if the table to be altered is empty.
+ */
+ if ((def->sql_type == MYSQL_TYPE_DATE ||
+ def->sql_type == MYSQL_TYPE_NEWDATE ||
+ def->sql_type == MYSQL_TYPE_DATETIME) &&
+ !alter_info->datetime_field &&
+ !(~def->flags & (NO_DEFAULT_VALUE_FLAG | NOT_NULL_FLAG)) &&
+ thd->variables.sql_mode & MODE_NO_ZERO_DATE)
+ {
+ alter_info->datetime_field= def;
+ alter_info->error_if_not_empty= TRUE;
+ }
+ if (!def->after)
+ new_create_list.push_back(def);
+ else if (def->after == first_keyword)
+ new_create_list.push_front(def);
+ else
+ {
+ Create_field *find;
+ find_it.rewind();
+ while ((find=find_it++)) // Add new columns
+ {
+ if (!my_strcasecmp(system_charset_info,def->after, find->field_name))
+ break;
+ }
+ if (!find)
+ {
+ my_error(ER_BAD_FIELD_ERROR, MYF(0), def->after, table->s->table_name);
+ goto err;
+ }
+ find_it.after(def); // Put element after this
+ alter_info->change_level= ALTER_TABLE_DATA_CHANGED;
+ }
+ }
+ if (alter_info->alter_list.elements)
+ {
+ my_error(ER_BAD_FIELD_ERROR, MYF(0),
+ alter_info->alter_list.head()->name, table->s->table_name);
+ goto err;
+ }
+ if (!new_create_list.elements)
+ {
+ my_message(ER_CANT_REMOVE_ALL_FIELDS, ER(ER_CANT_REMOVE_ALL_FIELDS),
+ MYF(0));
+ goto err;
+ }
+
+ /*
+ Collect all keys which isn't in drop list. Add only those
+ for which some fields exists.
+ */
+
+ for (uint i=0 ; i < table->s->keys ; i++,key_info++)
+ {
+ char *key_name= key_info->name;
+ Alter_drop *drop;
+ drop_it.rewind();
+ while ((drop=drop_it++))
+ {
+ if (drop->type == Alter_drop::KEY &&
+ !my_strcasecmp(system_charset_info,key_name, drop->name))
+ break;
+ }
+ if (drop)
+ {
+ drop_it.remove();
+ continue;
+ }
+
+ KEY_PART_INFO *key_part= key_info->key_part;
+ key_parts.empty();
+ for (uint j=0 ; j < key_info->key_parts ; j++,key_part++)
+ {
+ if (!key_part->field)
+ continue; // Wrong field (from UNIREG)
+ const char *key_part_name=key_part->field->field_name;
+ Create_field *cfield;
+ field_it.rewind();
+ while ((cfield=field_it++))
+ {
+ if (cfield->change)
+ {
+ if (!my_strcasecmp(system_charset_info, key_part_name,
+ cfield->change))
+ break;
+ }
+ else if (!my_strcasecmp(system_charset_info,
+ key_part_name, cfield->field_name))
+ break;
+ }
+ if (!cfield)
+ continue; // Field is removed
+ uint key_part_length=key_part->length;
+ if (cfield->field) // Not new field
+ {
+ /*
+ If the field can't have only a part used in a key according to its
+ new type, or should not be used partially according to its
+ previous type, or the field length is less than the key part
+ length, unset the key part length.
+
+ We also unset the key part length if it is the same as the
+ old field's length, so the whole new field will be used.
+
+ BLOBs may have cfield->length == 0, which is why we test it before
+ checking whether cfield->length < key_part_length (in chars).
+ */
+ if (!Field::type_can_have_key_part(cfield->field->type()) ||
+ !Field::type_can_have_key_part(cfield->sql_type) ||
+ /* spatial keys can't have sub-key length */
+ (key_info->flags & HA_SPATIAL) ||
+ (cfield->field->field_length == key_part_length &&
+ !f_is_blob(key_part->key_type)) ||
+ (cfield->length && (cfield->length < key_part_length /
+ key_part->field->charset()->mbmaxlen)))
+ key_part_length= 0; // Use whole field
+ }
+ key_part_length /= key_part->field->charset()->mbmaxlen;
+ key_parts.push_back(new Key_part_spec(cfield->field_name,
+ key_part_length));
+ }
+ if (key_parts.elements)
+ {
+ KEY_CREATE_INFO key_create_info;
+ Key *key;
+ enum Key::Keytype key_type;
+ bzero((char*) &key_create_info, sizeof(key_create_info));
+
+ key_create_info.algorithm= key_info->algorithm;
+ if (key_info->flags & HA_USES_BLOCK_SIZE)
+ key_create_info.block_size= key_info->block_size;
+ if (key_info->flags & HA_USES_PARSER)
+ key_create_info.parser_name= *key_info->parser_name;
+
+ if (key_info->flags & HA_SPATIAL)
+ key_type= Key::SPATIAL;
+ else if (key_info->flags & HA_NOSAME)
+ {
+ if (! my_strcasecmp(system_charset_info, key_name, primary_key_name))
+ key_type= Key::PRIMARY;
+ else
+ key_type= Key::UNIQUE;
+ }
+ else if (key_info->flags & HA_FULLTEXT)
+ key_type= Key::FULLTEXT;
+ else
+ key_type= Key::MULTIPLE;
+
+ key= new Key(key_type, key_name,
+ &key_create_info,
+ test(key_info->flags & HA_GENERATED_KEY),
+ key_parts);
+ new_key_list.push_back(key);
+ }
+ }
+ {
+ Key *key;
+ while ((key=key_it++)) // Add new keys
+ {
+ 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))
+ {
+ my_error(ER_WRONG_NAME_FOR_INDEX, MYF(0), key->name);
+ goto err;
+ }
+ }
+ }
+
+ if (alter_info->drop_list.elements)
+ {
+ my_error(ER_CANT_DROP_FIELD_OR_KEY, MYF(0),
+ alter_info->drop_list.head()->name);
+ goto err;
+ }
+ if (alter_info->alter_list.elements)
+ {
+ my_error(ER_CANT_DROP_FIELD_OR_KEY, MYF(0),
+ alter_info->alter_list.head()->name);
+ goto err;
+ }
+
+ if (!create_info->comment.str)
+ {
+ create_info->comment.str= table->s->comment.str;
+ create_info->comment.length= table->s->comment.length;
+ }
+
+ table->file->update_create_info(create_info);
+ if ((create_info->table_options &
+ (HA_OPTION_PACK_KEYS | HA_OPTION_NO_PACK_KEYS)) ||
+ (used_fields & HA_CREATE_USED_PACK_KEYS))
+ db_create_options&= ~(HA_OPTION_PACK_KEYS | HA_OPTION_NO_PACK_KEYS);
+ if (create_info->table_options &
+ (HA_OPTION_CHECKSUM | HA_OPTION_NO_CHECKSUM))
+ db_create_options&= ~(HA_OPTION_CHECKSUM | HA_OPTION_NO_CHECKSUM);
+ if (create_info->table_options &
+ (HA_OPTION_DELAY_KEY_WRITE | HA_OPTION_NO_DELAY_KEY_WRITE))
+ db_create_options&= ~(HA_OPTION_DELAY_KEY_WRITE |
+ HA_OPTION_NO_DELAY_KEY_WRITE);
+ create_info->table_options|= db_create_options;
+
+ if (table->s->tmp_table)
+ create_info->options|=HA_LEX_CREATE_TMP_TABLE;
+
+ rc= FALSE;
+ alter_info->create_list.swap(new_create_list);
+ alter_info->key_list.swap(new_key_list);
+err:
+ DBUG_RETURN(rc);
+}
+
+
/*
Alter table
@@ -5301,21 +5622,14 @@ bool alter_table_manage_keys(TABLE *table, int indexes_were_disabled,
thd Thread handle
new_db If there is a RENAME clause
new_name If there is a RENAME clause
- lex_create_info Information from the parsing phase. Since some
- clauses are common to CREATE and ALTER TABLE, the
- data is stored in lex->create_info. The non-common
- is stored in lex->alter_info.
+ create_info Information from the parsing phase about new
+ table properties.
table_list The table to change.
- fields lex->create_list - List of fields to be changed,
- added or dropped.
- keys lex->key_list - List of keys to be changed, added or
- dropped.
+ alter_info Lists of fields, keys to be changed, added
+ or dropped.
order_num How many ORDER BY fields has been specified.
order List of fields to ORDER BY.
ignore Whether we have ALTER IGNORE TABLE
- alter_info Information from the parsing phase specific to ALTER
- TABLE and not shared with CREATE TABLE.
- do_send_ok Whether to call send_ok() on success.
DESCRIPTION
This is a veery long function and is everything but the kitchen sink :)
@@ -5327,15 +5641,15 @@ bool alter_table_manage_keys(TABLE *table, int indexes_were_disabled,
the table and/or enabling/disabling the keys. In this case, the FRM is
not changed, directly by mysql_alter_table. However, if there is a
RENAME + change of a field, or an index, the short cut is not used.
- See how `fields` is used to generate the new FRM regarding the structure
- of the fields. The same is done for the indices of the table.
+ See how `create_list` is used to generate the new FRM regarding the
+ structure of the fields. The same is done for the indices of the table.
Important is the fact, that this function tries to do as little work as
possible, by finding out whether a intermediate table is needed to copy
data into and when finishing the altering to use it as the original table.
For this reason the function compare_tables() is called, which decides
based on all kind of data how similar are the new and the original
- tables.
+ tables.
RETURN VALUES
FALSE OK
@@ -5343,36 +5657,28 @@ bool alter_table_manage_keys(TABLE *table, int indexes_were_disabled,
*/
bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
- HA_CREATE_INFO *lex_create_info,
+ HA_CREATE_INFO *create_info,
TABLE_LIST *table_list,
- List<create_field> &fields, List<Key> &keys,
- uint order_num, ORDER *order, bool ignore,
- ALTER_INFO *alter_info, bool do_send_ok)
+ Alter_info *alter_info,
+ uint order_num, ORDER *order, bool ignore)
{
- TABLE *table,*new_table=0;
+ TABLE *table, *new_table= 0, *name_lock= 0;
int error= 0;
char tmp_name[80],old_name[32],new_name_buff[FN_REFLEN];
char new_alias_buff[FN_REFLEN], *table_name, *db, *new_alias, *alias;
- char index_file[FN_REFLEN], data_file[FN_REFLEN], tablespace[FN_LEN];
+ char index_file[FN_REFLEN], data_file[FN_REFLEN];
char path[FN_REFLEN];
char reg_path[FN_REFLEN+1];
ha_rows copied,deleted;
- uint db_create_options, used_fields;
handlerton *old_db_type, *new_db_type, *save_old_db_type;
legacy_db_type table_type;
- HA_CREATE_INFO *create_info;
frm_type_enum frm_type;
- uint need_copy_table= 0;
- bool no_table_reopen= FALSE, varchar= FALSE;
+ enum_alter_table_change_level need_copy_table= ALTER_TABLE_METADATA_ONLY;
#ifdef WITH_PARTITION_STORAGE_ENGINE
uint fast_alter_partition= 0;
bool partition_changed= FALSE;
#endif
- List<create_field> prepared_create_list;
- List<Key> prepared_key_list;
bool need_lock_for_indexes= TRUE;
- uint db_options= 0;
- uint key_count;
KEY *key_info_buffer;
uint index_drop_count;
uint *index_drop_buffer;
@@ -5386,6 +5692,12 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
LINT_INIT(index_add_buffer);
LINT_INIT(index_drop_buffer);
+ /*
+ Check if we attempt to alter mysql.slow_log or
+ mysql.general_log table and return an error if
+ it is the case.
+ TODO: this design is obsolete and will be removed.
+ */
if (table_list && table_list->db && table_list->table_name)
{
int table_kind= 0;
@@ -5394,29 +5706,40 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
table_list->table_name_length,
table_list->table_name, 0);
- /* Disable alter of enabled log tables */
- if (table_kind && logger.is_log_table_enabled(table_kind))
+ if (table_kind)
{
- my_error(ER_BAD_LOG_STATEMENT, MYF(0), "ALTER");
- DBUG_RETURN(TRUE);
- }
+ /* Disable alter of enabled log tables */
+ if (logger.is_log_table_enabled(table_kind))
+ {
+ my_error(ER_BAD_LOG_STATEMENT, MYF(0), "ALTER");
+ DBUG_RETURN(TRUE);
+ }
- /* Disable alter of log tables to unsupported engine */
- if (table_kind &&
- (lex_create_info->used_fields & HA_CREATE_USED_ENGINE) &&
- (!lex_create_info->db_type || /* unknown engine */
- !(lex_create_info->db_type->flags & HTON_SUPPORT_LOG_TABLES)))
- {
- my_error(ER_UNSUPORTED_LOG_ENGINE, MYF(0));
- DBUG_RETURN(TRUE);
+ /* Disable alter of log tables to unsupported engine */
+ if ((create_info->used_fields & HA_CREATE_USED_ENGINE) &&
+ (!create_info->db_type || /* unknown engine */
+ !(create_info->db_type->flags & HTON_SUPPORT_LOG_TABLES)))
+ {
+ my_error(ER_UNSUPORTED_LOG_ENGINE, MYF(0));
+ DBUG_RETURN(TRUE);
+ }
+
+#ifdef WITH_PARTITION_STORAGE_ENGINE
+ if (alter_info->flags & ALTER_PARTITION)
+ {
+ my_error(ER_WRONG_USAGE, MYF(0), "PARTITION", "log table");
+ DBUG_RETURN(TRUE);
+ }
+#endif
}
}
+ /*
+ Assign variables table_name, new_name, db, new_db, path, reg_path
+ to simplify further comparisions: we want to see if it's a RENAME
+ later just by comparing the pointers, avoiding the need for strcmp.
+ */
thd_proc_info(thd, "init");
- if (!(create_info= copy_create_info(lex_create_info)))
- {
- DBUG_RETURN(TRUE);
- }
table_name=table_list->table_name;
alias= (lower_case_table_names == 2) ? table_list->alias : table_name;
db=table_list->db;
@@ -5425,7 +5748,6 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
build_table_filename(reg_path, sizeof(reg_path), db, table_name, reg_ext, 0);
build_table_filename(path, sizeof(path), db, table_name, "", 0);
- used_fields=create_info->used_fields;
mysql_ha_flush(thd, table_list, MYSQL_HA_CLOSE_FINAL, FALSE);
@@ -5437,10 +5759,22 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
strxnmov(new_name_buff, sizeof (new_name_buff) - 1, mysql_data_home, "/", db,
"/", table_name, reg_ext, NullS);
(void) unpack_filename(new_name_buff, new_name_buff);
- if (lower_case_table_names != 2)
- my_casedn_str(files_charset_info, new_name_buff);
+ /*
+ If this is just a rename of a view, short cut to the
+ following scenario: 1) lock LOCK_open 2) do a RENAME
+ 2) unlock LOCK_open.
+ This is a copy-paste added to make sure
+ ALTER (sic:) TABLE .. RENAME works for views. ALTER VIEW is handled
+ as an independent branch in mysql_execute_command. The need
+ for a copy-paste arose because the main code flow of ALTER TABLE
+ ... RENAME tries to use open_ltable, which does not work for views
+ (open_ltable was never modified to merge table lists of child tables
+ into the main table list, like open_tables does).
+ This code is wrong and will be removed, please do not copy.
+ */
frm_type= mysql_frm_type(thd, new_name_buff, &table_type);
/* Rename a view */
+ /* Sic: there is a race here */
if (frm_type == FRMTYPE_VIEW && !(alter_info->flags & ~ALTER_RENAME))
{
/*
@@ -5482,7 +5816,7 @@ view_err:
start_waiting_global_read_lock(thd);
DBUG_RETURN(error);
}
- if (!(table=open_ltable(thd,table_list,TL_WRITE_ALLOW_READ)))
+ if (!(table=open_ltable(thd, table_list, TL_WRITE_ALLOW_READ, 0)))
DBUG_RETURN(TRUE);
table->use_all_columns();
@@ -5522,13 +5856,21 @@ view_err:
}
else
{
+ if (lock_table_name_if_not_cached(thd, new_db, new_name, &name_lock))
+ DBUG_RETURN(TRUE);
+ if (!name_lock)
+ {
+ my_error(ER_TABLE_EXISTS_ERROR, MYF(0), new_alias);
+ DBUG_RETURN(TRUE);
+ }
+
build_table_filename(new_name_buff, sizeof(new_name_buff),
new_db, new_name_buff, reg_ext, 0);
if (!access(new_name_buff, F_OK))
{
/* Table will be closed in do_command() */
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), new_alias);
- DBUG_RETURN(TRUE);
+ goto err;
}
}
}
@@ -5539,7 +5881,7 @@ view_err:
new_name= table_name;
}
- old_db_type= table->s->db_type;
+ old_db_type= table->s->db_type();
if (!create_info->db_type)
{
#ifdef WITH_PARTITION_STORAGE_ENGINE
@@ -5560,16 +5902,17 @@ view_err:
create_info->db_type= old_db_type;
}
-#ifdef WITH_PARTITION_STORAGE_ENGINE
- if (prep_alter_part_table(thd, table, alter_info, create_info, old_db_type,
- &partition_changed, &fast_alter_partition))
- {
- DBUG_RETURN(TRUE);
- }
-#endif
if (check_engine(thd, new_name, create_info))
- DBUG_RETURN(TRUE);
+ goto err;
new_db_type= create_info->db_type;
+
+ if (new_db_type != old_db_type &&
+ !table->file->can_switch_engines())
+ {
+ my_error(ER_ROW_IS_REFERENCED, MYF(0));
+ goto err;
+ }
+
if (create_info->row_type == ROW_TYPE_NOT_USED)
create_info->row_type= table->s->row_type;
@@ -5581,7 +5924,7 @@ view_err:
{
DBUG_PRINT("info", ("doesn't support alter"));
my_error(ER_ILLEGAL_HA, MYF(0), table_name);
- DBUG_RETURN(TRUE);
+ goto err;
}
thd_proc_info(thd, "setup");
@@ -5604,6 +5947,7 @@ view_err:
VOID(pthread_mutex_lock(&LOCK_open));
wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN);
VOID(pthread_mutex_unlock(&LOCK_open));
+ DBUG_EXECUTE_IF("sleep_alter_enable_indexes", my_sleep(6000000););
error= table->file->enable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE);
/* COND_refresh will be signaled in close_thread_tables() */
break;
@@ -5640,7 +5984,19 @@ view_err:
if (!error && (new_name != table_name || new_db != db))
{
thd_proc_info(thd, "rename");
- /* Then do a 'simple' rename of the table */
+ /*
+ Then do a 'simple' rename of the table. First we need to close all
+ instances of 'source' table.
+ */
+ close_cached_table(thd, table);
+ /*
+ Then, we want check once again that target table does not exist.
+ Actually the order of these two steps does not matter since
+ earlier we took name-lock on the target table, so we do them
+ in this particular order only to be consistent with 5.0, in which
+ we don't take this name-lock and where this order really matters.
+ TODO: Investigate if we need this access() check at all.
+ */
if (!access(new_name_buff,F_OK))
{
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), new_name);
@@ -5649,8 +6005,6 @@ view_err:
else
{
*fn_ext(new_name)=0;
- table->s->version= 0; // Force removal of table def
- close_cached_table(thd, table);
if (mysql_rename_table(old_db_type,db,table_name,new_db,new_alias, 0))
error= -1;
else if (Table_triggers_list::change_table_name(thd, db, table_name,
@@ -5674,412 +6028,69 @@ view_err:
if (!error)
{
write_bin_log(thd, TRUE, thd->query, thd->query_length);
- if (do_send_ok)
- send_ok(thd);
+ send_ok(thd);
}
else if (error > 0)
{
table->file->print_error(error, MYF(0));
error= -1;
}
+ if (name_lock)
+ unlink_open_table(thd, name_lock, FALSE);
VOID(pthread_mutex_unlock(&LOCK_open));
table_list->table= NULL; // For query cache
query_cache_invalidate3(thd, table_list, 0);
DBUG_RETURN(error);
}
- /* We have to do full alter table */
-
- /* Let new create options override the old ones */
- if (!(used_fields & HA_CREATE_USED_MIN_ROWS))
- create_info->min_rows= table->s->min_rows;
- if (!(used_fields & HA_CREATE_USED_MAX_ROWS))
- create_info->max_rows= table->s->max_rows;
- if (!(used_fields & HA_CREATE_USED_AVG_ROW_LENGTH))
- create_info->avg_row_length= table->s->avg_row_length;
- if (!(used_fields & HA_CREATE_USED_DEFAULT_CHARSET))
- create_info->default_table_charset= table->s->table_charset;
- if (!(used_fields & HA_CREATE_USED_AUTO) && table->found_next_number_field)
- {
- /* Table has an autoincrement, copy value to new table */
- table->file->info(HA_STATUS_AUTO);
- create_info->auto_increment_value= table->file->stats.auto_increment_value;
- }
- if (!(used_fields & HA_CREATE_USED_KEY_BLOCK_SIZE))
- create_info->key_block_size= table->s->key_block_size;
-
- if (!create_info->tablespace && create_info->storage_media != HA_SM_MEMORY)
- {
- /*
- Regular alter table of disk stored table (no tablespace/storage change)
- Copy tablespace name
- */
- if ((table->file->get_tablespace_name(thd, tablespace, FN_LEN)))
- create_info->tablespace= tablespace;
- }
- restore_record(table, s->default_values); // Empty record for DEFAULT
- List_iterator<Alter_drop> drop_it(alter_info->drop_list);
- List_iterator<create_field> def_it(fields);
- List_iterator<Alter_column> alter_it(alter_info->alter_list);
- List<create_field> create_list; // Add new fields here
- List<Key> key_list; // Add new keys here
- create_field *def;
-
- /*
- First collect all fields from table which isn't in drop_list
- */
-
- Field **f_ptr,*field;
- for (f_ptr=table->field ; (field= *f_ptr) ; f_ptr++)
- {
- if (field->type() == MYSQL_TYPE_STRING)
- varchar= TRUE;
- /* Check if field should be dropped */
- Alter_drop *drop;
- drop_it.rewind();
- while ((drop=drop_it++))
- {
- if (drop->type == Alter_drop::COLUMN &&
- !my_strcasecmp(system_charset_info,field->field_name, drop->name))
- {
- /* Reset auto_increment value if it was dropped */
- if (MTYP_TYPENR(field->unireg_check) == Field::NEXT_NUMBER &&
- !(used_fields & HA_CREATE_USED_AUTO))
- {
- create_info->auto_increment_value=0;
- create_info->used_fields|=HA_CREATE_USED_AUTO;
- }
- break;
- }
- }
- if (drop)
- {
- drop_it.remove();
- continue;
- }
- /* Check if field is changed */
- def_it.rewind();
- while ((def=def_it++))
- {
- if (def->change &&
- !my_strcasecmp(system_charset_info,field->field_name, def->change))
- break;
- }
- if (def)
- { // Field is changed
- def->field=field;
- if (!def->after)
- {
- create_list.push_back(def);
- def_it.remove();
- }
- }
- else
- {
- /*
- This field was not dropped and not changed, add it to the list
- for the new table.
- */
- create_list.push_back(def=new create_field(field,field));
- alter_it.rewind(); // Change default if ALTER
- Alter_column *alter;
- while ((alter=alter_it++))
- {
- if (!my_strcasecmp(system_charset_info,field->field_name, alter->name))
- break;
- }
- if (alter)
- {
- if (def->sql_type == MYSQL_TYPE_BLOB)
- {
- my_error(ER_BLOB_CANT_HAVE_DEFAULT, MYF(0), def->change);
- DBUG_RETURN(TRUE);
- }
- if ((def->def=alter->def)) // Use new default
- def->flags&= ~NO_DEFAULT_VALUE_FLAG;
- else
- def->flags|= NO_DEFAULT_VALUE_FLAG;
- alter_it.remove();
- }
- }
- }
- def_it.rewind();
- List_iterator<create_field> find_it(create_list);
- while ((def=def_it++)) // Add new columns
- {
- if (def->change && ! def->field)
- {
- my_error(ER_BAD_FIELD_ERROR, MYF(0), def->change, table_name);
- DBUG_RETURN(TRUE);
- }
- if (!def->after)
- create_list.push_back(def);
- else if (def->after == first_keyword)
- create_list.push_front(def);
- else
- {
- create_field *find;
- find_it.rewind();
- while ((find=find_it++)) // Add new columns
- {
- if (!my_strcasecmp(system_charset_info,def->after, find->field_name))
- break;
- }
- if (!find)
- {
- my_error(ER_BAD_FIELD_ERROR, MYF(0), def->after, table_name);
- DBUG_RETURN(TRUE);
- }
- find_it.after(def); // Put element after this
- }
- }
- if (alter_info->alter_list.elements)
- {
- my_error(ER_BAD_FIELD_ERROR, MYF(0),
- alter_info->alter_list.head()->name, table_name);
- DBUG_RETURN(TRUE);
- }
- if (!create_list.elements)
- {
- my_message(ER_CANT_REMOVE_ALL_FIELDS, ER(ER_CANT_REMOVE_ALL_FIELDS),
- MYF(0));
- DBUG_RETURN(TRUE);
- }
+ /* We have to do full alter table. */
+#ifdef WITH_PARTITION_STORAGE_ENGINE
+ if (prep_alter_part_table(thd, table, alter_info, create_info, old_db_type,
+ &partition_changed, &fast_alter_partition))
+ goto err;
+#endif
/*
- Collect all keys which isn't in drop list. Add only those
- for which some fields exists.
+ If the old table had partitions and we are doing ALTER TABLE ...
+ engine= <new_engine>, the new table must preserve the original
+ partitioning. That means that the new engine is still the
+ partitioning engine, not the engine specified in the parser.
+ This is discovered in prep_alter_part_table, which in such case
+ updates create_info->db_type.
+ Now we need to update the stack copy of create_info->db_type,
+ as otherwise we won't be able to correctly move the files of the
+ temporary table to the result table files.
*/
+ new_db_type= create_info->db_type;
- List_iterator<Key> key_it(keys);
- List_iterator<create_field> field_it(create_list);
- List<key_part_spec> key_parts;
-
- KEY *key_info=table->key_info;
- for (uint i=0 ; i < table->s->keys ; i++,key_info++)
- {
- char *key_name= key_info->name;
- Alter_drop *drop;
- drop_it.rewind();
- while ((drop=drop_it++))
- {
- if (drop->type == Alter_drop::KEY &&
- !my_strcasecmp(system_charset_info,key_name, drop->name))
- break;
- }
- if (drop)
- {
- drop_it.remove();
- continue;
- }
-
- KEY_PART_INFO *key_part= key_info->key_part;
- key_parts.empty();
- for (uint j=0 ; j < key_info->key_parts ; j++,key_part++)
- {
- if (!key_part->field)
- continue; // Wrong field (from UNIREG)
- const char *key_part_name=key_part->field->field_name;
- create_field *cfield;
- field_it.rewind();
- while ((cfield=field_it++))
- {
- if (cfield->change)
- {
- if (!my_strcasecmp(system_charset_info, key_part_name,
- cfield->change))
- break;
- }
- else if (!my_strcasecmp(system_charset_info,
- key_part_name, cfield->field_name))
- break;
- }
- if (!cfield)
- continue; // Field is removed
- uint key_part_length=key_part->length;
- if (cfield->field) // Not new field
- {
- /*
- If the field can't have only a part used in a key according to its
- new type, or should not be used partially according to its
- previous type, or the field length is less than the key part
- length, unset the key part length.
-
- We also unset the key part length if it is the same as the
- old field's length, so the whole new field will be used.
-
- BLOBs may have cfield->length == 0, which is why we test it before
- checking whether cfield->length < key_part_length (in chars).
- */
- if (!Field::type_can_have_key_part(cfield->field->type()) ||
- !Field::type_can_have_key_part(cfield->sql_type) ||
- /* spatial keys can't have sub-key length */
- (key_info->flags & HA_SPATIAL) ||
- (cfield->field->field_length == key_part_length &&
- !f_is_blob(key_part->key_type)) ||
- (cfield->length && (cfield->length < key_part_length /
- key_part->field->charset()->mbmaxlen)))
- key_part_length= 0; // Use whole field
- }
- key_part_length /= key_part->field->charset()->mbmaxlen;
- key_parts.push_back(new key_part_spec(cfield->field_name,
- key_part_length));
- }
- if (key_parts.elements)
- {
- KEY_CREATE_INFO key_create_info;
- bzero((char*) &key_create_info, sizeof(key_create_info));
-
- key_create_info.algorithm= key_info->algorithm;
- if (key_info->flags & HA_USES_BLOCK_SIZE)
- key_create_info.block_size= key_info->block_size;
- if (key_info->flags & HA_USES_PARSER)
- key_create_info.parser_name= *key_info->parser_name;
-
- key_list.push_back(new Key(key_info->flags & HA_SPATIAL ? Key::SPATIAL :
- (key_info->flags & HA_NOSAME ?
- (!my_strcasecmp(system_charset_info,
- key_name, primary_key_name) ?
- Key::PRIMARY : Key::UNIQUE) :
- (key_info->flags & HA_FULLTEXT ?
- Key::FULLTEXT : Key::MULTIPLE)),
- key_name,
- &key_create_info,
- test(key_info->flags & HA_GENERATED_KEY),
- key_parts));
- }
- }
- {
- Key *key;
- while ((key=key_it++)) // Add new keys
- {
- if (key->type != Key::FOREIGN_KEY)
- key_list.push_back(key);
- if (key->name &&
- !my_strcasecmp(system_charset_info,key->name,primary_key_name))
- {
- my_error(ER_WRONG_NAME_FOR_INDEX, MYF(0), key->name);
- DBUG_RETURN(TRUE);
- }
- }
- }
-
- if (alter_info->drop_list.elements)
- {
- my_error(ER_CANT_DROP_FIELD_OR_KEY, MYF(0),
- alter_info->drop_list.head()->name);
- goto err;
- }
- if (alter_info->alter_list.elements)
- {
- my_error(ER_CANT_DROP_FIELD_OR_KEY, MYF(0),
- alter_info->alter_list.head()->name);
- goto err;
- }
-
- db_create_options= table->s->db_create_options & ~(HA_OPTION_PACK_RECORD);
- my_snprintf(tmp_name, sizeof(tmp_name), "%s-%lx_%lx", tmp_file_prefix,
- current_pid, thd->thread_id);
- /* Safety fix for innodb */
- if (lower_case_table_names)
- my_casedn_str(files_charset_info, tmp_name);
- if (new_db_type != old_db_type && !table->file->can_switch_engines()) {
- my_error(ER_ROW_IS_REFERENCED, MYF(0));
+ if (mysql_prepare_alter_table(thd, table, create_info, alter_info))
goto err;
- }
- create_info->db_type=new_db_type;
- if (!create_info->comment.str)
- {
- create_info->comment.str= table->s->comment.str;
- create_info->comment.length= table->s->comment.length;
- }
-
- table->file->update_create_info(create_info);
- if ((create_info->table_options &
- (HA_OPTION_PACK_KEYS | HA_OPTION_NO_PACK_KEYS)) ||
- (used_fields & HA_CREATE_USED_PACK_KEYS))
- db_create_options&= ~(HA_OPTION_PACK_KEYS | HA_OPTION_NO_PACK_KEYS);
- if (create_info->table_options &
- (HA_OPTION_CHECKSUM | HA_OPTION_NO_CHECKSUM))
- db_create_options&= ~(HA_OPTION_CHECKSUM | HA_OPTION_NO_CHECKSUM);
- if (create_info->table_options &
- (HA_OPTION_DELAY_KEY_WRITE | HA_OPTION_NO_DELAY_KEY_WRITE))
- db_create_options&= ~(HA_OPTION_DELAY_KEY_WRITE |
- HA_OPTION_NO_DELAY_KEY_WRITE);
- create_info->table_options|= db_create_options;
-
- if (table->s->tmp_table)
- create_info->options|=HA_LEX_CREATE_TMP_TABLE;
+
+ need_copy_table= alter_info->change_level;
set_table_default_charset(thd, create_info, db);
- {
- /*
- For some purposes we need prepared table structures and translated
- key descriptions with proper default key name assignment.
-
- Unfortunately, mysql_prepare_table() modifies the field and key
- lists. mysql_create_table() needs the unmodified lists. Hence, we
- need to copy the lists and all their elements. The lists contain
- pointers to the elements only.
-
- We cannot copy conditionally because the partition code always
- needs prepared lists and compare_tables() needs them and is almost
- always called.
- */
-
- /* Copy fields. */
- List_iterator<create_field> prep_field_it(create_list);
- create_field *prep_field;
- while ((prep_field= prep_field_it++))
- prepared_create_list.push_back(new create_field(*prep_field));
-
- /* Copy keys and key parts. */
- List_iterator<Key> prep_key_it(key_list);
- Key *prep_key;
- while ((prep_key= prep_key_it++))
- {
- List<key_part_spec> prep_columns;
- List_iterator<key_part_spec> prep_col_it(prep_key->columns);
- key_part_spec *prep_col;
-
- while ((prep_col= prep_col_it++))
- prep_columns.push_back(new key_part_spec(*prep_col));
- prepared_key_list.push_back(new Key(prep_key->type, prep_key->name,
- &prep_key->key_create_info,
- prep_key->generated, prep_columns));
- }
-
- /* Create the prepared information. */
- if (mysql_prepare_table(thd, create_info, &prepared_create_list,
- &prepared_key_list,
- (table->s->tmp_table != NO_TMP_TABLE), &db_options,
- table->file, &key_info_buffer, &key_count, 0))
- goto err;
- }
-
if (thd->variables.old_alter_table
- || (table->s->db_type != create_info->db_type)
+ || (table->s->db_type() != create_info->db_type)
#ifdef WITH_PARTITION_STORAGE_ENGINE
|| partition_changed
#endif
)
- need_copy_table= 1;
+ need_copy_table= ALTER_TABLE_DATA_CHANGED;
else
{
- /* Try to optimize ALTER TABLE. Allocate result buffers. */
- if (! (index_drop_buffer=
- (uint*) thd->alloc(sizeof(uint) * table->s->keys)) ||
- ! (index_add_buffer=
- (uint*) thd->alloc(sizeof(uint) * prepared_key_list.elements)))
- goto err;
+ enum_alter_table_change_level need_copy_table_res;
/* Check how much the tables differ. */
- need_copy_table= compare_tables(table, &prepared_create_list,
- key_info_buffer, key_count,
- create_info, alter_info, order_num,
- index_drop_buffer, &index_drop_count,
- index_add_buffer, &index_add_count,
- varchar);
+ if (compare_tables(table, alter_info,
+ create_info, order_num,
+ &need_copy_table_res,
+ &key_info_buffer,
+ &index_drop_buffer, &index_drop_count,
+ &index_add_buffer, &index_add_count))
+ goto err;
+
+ if (need_copy_table == ALTER_TABLE_METADATA_ONLY)
+ need_copy_table= need_copy_table_res;
}
/*
@@ -6097,8 +6108,8 @@ view_err:
uint *idx_p;
uint *idx_end_p;
- if (table->s->db_type->alter_table_flags)
- alter_flags= table->s->db_type->alter_table_flags(alter_info->flags);
+ if (table->s->db_type()->alter_table_flags)
+ alter_flags= table->s->db_type()->alter_table_flags(alter_info->flags);
DBUG_PRINT("info", ("alter_flags: %lu", alter_flags));
/* Check dropped indexes. */
for (idx_p= index_drop_buffer, idx_end_p= idx_p + index_drop_count;
@@ -6177,13 +6188,13 @@ view_err:
if ((alter_flags & needed_online_flags) == needed_online_flags)
{
/* All required online flags are present. */
- need_copy_table= 0;
+ need_copy_table= ALTER_TABLE_METADATA_ONLY;
need_lock_for_indexes= FALSE;
}
else if ((alter_flags & needed_fast_flags) == needed_fast_flags)
{
/* All required fast flags are present. */
- need_copy_table= 0;
+ need_copy_table= ALTER_TABLE_METADATA_ONLY;
}
}
DBUG_PRINT("info", ("need_copy_table: %u need_lock: %d",
@@ -6195,20 +6206,26 @@ view_err:
alter_info->flags & ALTER_ADD_COLUMN|ALTER_ADD_INDEX|...
so that ALTER TABLE won't break when somebody will add new flag
*/
- if (!need_copy_table)
+ if (need_copy_table == ALTER_TABLE_METADATA_ONLY)
create_info->frm_only= 1;
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (fast_alter_partition)
{
+ DBUG_ASSERT(!name_lock);
DBUG_RETURN(fast_alter_partition_table(thd, table, alter_info,
create_info, table_list,
- &create_list, &key_list,
db, table_name,
fast_alter_partition));
}
#endif
+ my_snprintf(tmp_name, sizeof(tmp_name), "%s-%lx_%lx", tmp_file_prefix,
+ current_pid, thd->thread_id);
+ /* Safety fix for innodb */
+ if (lower_case_table_names)
+ my_casedn_str(files_charset_info, tmp_name);
+
/*
Handling of symlinked tables:
If no rename:
@@ -6261,14 +6278,16 @@ view_err:
We don't log the statement, it will be logged later.
*/
tmp_disable_binlog(thd);
- error= mysql_create_table(thd, new_db, tmp_name,
- create_info,create_list,key_list,1,0,0);
+ error= mysql_create_table_no_lock(thd, new_db, tmp_name,
+ create_info,
+ alter_info,
+ 1, 0);
reenable_binlog(thd);
if (error)
- DBUG_RETURN(error);
+ goto err;
/* Open the table if we need to copy the data. */
- if (need_copy_table)
+ if (need_copy_table != ALTER_TABLE_METADATA_ONLY)
{
if (table->s->tmp_table)
{
@@ -6303,19 +6322,22 @@ view_err:
/* We don't want update TIMESTAMP fields during ALTER TABLE. */
new_table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
new_table->next_number_field=new_table->found_next_number_field;
- error=copy_data_between_tables(table, new_table, create_list, ignore,
- order_num, order, &copied, &deleted,
- alter_info->keys_onoff);
+ error= copy_data_between_tables(table, new_table,
+ alter_info->create_list, ignore,
+ order_num, order, &copied, &deleted,
+ alter_info->keys_onoff,
+ alter_info->error_if_not_empty);
}
else
{
VOID(pthread_mutex_lock(&LOCK_open));
wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN);
- table->file->ha_external_lock(thd, F_WRLCK);
+ VOID(pthread_mutex_unlock(&LOCK_open));
alter_table_manage_keys(table, table->file->indexes_are_disabled(),
alter_info->keys_onoff);
- table->file->ha_external_lock(thd, F_UNLCK);
- VOID(pthread_mutex_unlock(&LOCK_open));
+ error= ha_commit_stmt(thd);
+ if (ha_commit(thd))
+ error= 1;
}
thd->count_cuted_fields= CHECK_FIELD_IGNORE;
@@ -6335,26 +6357,6 @@ view_err:
table->file->prepare_for_alter();
if (index_add_count)
{
-#ifdef XXX_TO_BE_DONE_LATER_BY_WL3020_AND_WL1892
- if (! need_lock_for_indexes)
- {
- /* Downgrade the write lock. */
- mysql_lock_downgrade_write(thd, table, TL_WRITE_ALLOW_WRITE);
- }
-
- /* Create a new .frm file for crash recovery. */
- /* TODO: Must set INDEX_TO_BE_ADDED flags in the frm file. */
- VOID(pthread_mutex_lock(&LOCK_open));
- error= (mysql_create_frm(thd, reg_path, db, table_name,
- create_info, prepared_create_list, key_count,
- key_info_buffer, table->file) ||
- table->file->create_handler_files(reg_path, NULL, CHF_INDEX_FLAG,
- create_info));
- VOID(pthread_mutex_unlock(&LOCK_open));
- if (error)
- goto err1;
-#endif
-
/* The add_index() method takes an array of KEY structs. */
key_info= (KEY*) thd->alloc(sizeof(KEY) * index_add_count);
key= key_info;
@@ -6387,36 +6389,6 @@ view_err:
if (index_drop_count)
{
-#ifdef XXX_TO_BE_DONE_LATER_BY_WL3020_AND_WL1892
- /* Create a new .frm file for crash recovery. */
- /* TODO: Must set INDEX_IS_ADDED in the frm file. */
- /* TODO: Must set INDEX_TO_BE_DROPPED in the frm file. */
- VOID(pthread_mutex_lock(&LOCK_open));
- error= (mysql_create_frm(thd, reg_path, db, table_name,
- create_info, prepared_create_list, key_count,
- key_info_buffer, table->file) ||
- table->file->create_handler_files(reg_path, NULL, CHF_INDEX_FLAG,
- create_info));
- VOID(pthread_mutex_unlock(&LOCK_open));
- if (error)
- goto err1;
-
- if (! need_lock_for_indexes)
- {
- LOCK_PARAM_TYPE lpt;
-
- lpt.thd= thd;
- lpt.table= table;
- lpt.db= db;
- lpt.table_name= table_name;
- lpt.create_info= create_info;
- lpt.create_list= &create_list;
- lpt.key_count= key_count;
- lpt.key_info_buffer= key_info_buffer;
- abort_and_upgrade_lock(lpt);
- }
-#endif
-
/* The prepare_drop_index() method takes an array of key numbers. */
key_numbers= (uint*) thd->alloc(sizeof(uint) * index_drop_count);
keyno_p= key_numbers;
@@ -6436,27 +6408,6 @@ view_err:
goto err1;
}
-#ifdef XXX_TO_BE_DONE_LATER_BY_WL3020
- if (! need_lock_for_indexes)
- {
- /* Downgrade the lock again. */
- if (table->reginfo.lock_type == TL_WRITE_ALLOW_READ)
- {
- LOCK_PARAM_TYPE lpt;
-
- lpt.thd= thd;
- lpt.table= table;
- lpt.db= db;
- lpt.table_name= table_name;
- lpt.create_info= create_info;
- lpt.create_list= &create_list;
- lpt.key_count= key_count;
- lpt.key_info_buffer= key_info_buffer;
- close_open_tables_and_downgrade(lpt);
- }
- }
-#endif
-
/* Tell the handler to finally drop the indexes. */
if ((error= table->file->final_drop_index(table)))
{
@@ -6505,7 +6456,7 @@ view_err:
{
/* Close the intermediate table that will be the new table */
intern_close_table(new_table);
- my_free((gptr) new_table,MYF(0));
+ my_free(new_table,MYF(0));
}
VOID(pthread_mutex_lock(&LOCK_open));
if (error)
@@ -6516,9 +6467,19 @@ view_err:
}
/*
- Data is copied. Now we rename the old table to a temp name,
- rename the new one to the old name, remove all entries about the old table
- from the cache, free all locks, close the old table and remove it.
+ Data is copied. Now we:
+ 1) Wait until all other threads close old version of table.
+ 2) Close instances of table open by this thread and replace them
+ with exclusive name-locks.
+ 3) Rename the old table to a temp name, rename the new one to the
+ old name.
+ 4) If we are under LOCK TABLES and don't do ALTER TABLE ... RENAME
+ we reopen new version of table.
+ 5) Write statement to the binary log.
+ 6) If we are under LOCK TABLES and do ALTER TABLE ... RENAME we
+ remove name-locks from list of open tables and table cache.
+ 7) If we are not not under LOCK TABLES we rely on close_thread_tables()
+ call to remove name-locks from table cache and list of open table.
*/
thd_proc_info(thd, "rename result table");
@@ -6526,36 +6487,9 @@ view_err:
current_pid, thd->thread_id);
if (lower_case_table_names)
my_casedn_str(files_charset_info, old_name);
- if (new_name != table_name || new_db != db)
- {
- if (!access(new_name_buff,F_OK))
- {
- error=1;
- my_error(ER_TABLE_EXISTS_ERROR, MYF(0), new_name_buff);
- VOID(quick_rm_table(new_db_type, new_db, tmp_name, FN_IS_TMP));
- VOID(pthread_mutex_unlock(&LOCK_open));
- goto err;
- }
- }
-
-#if !defined( __WIN__)
- if (table->file->has_transactions())
-#endif
- {
- /*
- Win32 and InnoDB can't drop a table that is in use, so we must
- close the original table before doing the rename
- */
- table->s->version= 0; // Force removal of table def
- close_cached_table(thd, table);
- table=0; // Marker that table is closed
- no_table_reopen= TRUE;
- }
-#if !defined( __WIN__)
- else
- table->file->extra(HA_EXTRA_FORCE_REOPEN); // Don't use this file anymore
-#endif
+ wait_while_table_is_used(thd, table, HA_EXTRA_PREPARE_FOR_DELETE);
+ close_data_files_and_morph_locks(thd, db, table_name);
error=0;
save_old_db_type= old_db_type;
@@ -6573,18 +6507,22 @@ view_err:
table is renamed and the SE is also changed, then an intermediate table
is created and the additional call will not take place.
*/
- if (!need_copy_table)
- new_db_type=old_db_type= NULL; // this type cannot happen in regular ALTER
+ if (need_copy_table == ALTER_TABLE_METADATA_ONLY)
+ {
+ DBUG_ASSERT(new_db_type == old_db_type);
+ /* This type cannot happen in regular ALTER. */
+ new_db_type= old_db_type= NULL;
+ }
if (mysql_rename_table(old_db_type, db, table_name, db, old_name,
FN_TO_IS_TMP))
{
error=1;
VOID(quick_rm_table(new_db_type, new_db, tmp_name, FN_IS_TMP));
}
- else if (mysql_rename_table(new_db_type,new_db,tmp_name,new_db,
+ else if (mysql_rename_table(new_db_type, new_db, tmp_name, new_db,
new_alias, FN_FROM_IS_TMP) ||
(new_name != table_name || new_db != db) && // we also do rename
- (need_copy_table ||
+ (need_copy_table != ALTER_TABLE_METADATA_ONLY ||
mysql_rename_table(save_old_db_type, db, table_name, new_db,
new_alias, NO_FRM_RENAME)) &&
Table_triggers_list::change_table_name(thd, db, table_name,
@@ -6600,104 +6538,68 @@ view_err:
if (error)
{
+ /* This shouldn't happen. But let us play it safe. */
+ goto err_with_placeholders;
+ }
+
+ if (need_copy_table == ALTER_TABLE_METADATA_ONLY)
+ {
/*
- This shouldn't happen. We solve this the safe way by
- closing the locked table.
+ Now we have to inform handler that new .FRM file is in place.
+ To do this we need to obtain a handler object for it.
*/
- if (table)
- {
- table->s->version= 0; // Force removal of table def
- close_cached_table(thd,table);
+ TABLE *t_table;
+ if (new_name != table_name || new_db != db)
+ {
+ table_list->alias= new_name;
+ table_list->table_name= new_name;
+ table_list->table_name_length= strlen(new_name);
+ table_list->db= new_db;
+ table_list->db_length= strlen(new_db);
+ table_list->table= name_lock;
+ if (reopen_name_locked_table(thd, table_list, FALSE))
+ goto err_with_placeholders;
+ t_table= table_list->table;
}
- VOID(pthread_mutex_unlock(&LOCK_open));
- goto err;
- }
- if (! need_copy_table)
- {
- if (! table)
+ else
{
- if (new_name != table_name || new_db != db)
- {
- table_list->alias= new_name;
- table_list->table_name= new_name;
- table_list->table_name_length= strlen(new_name);
- table_list->db= new_db;
- table_list->db_length= strlen(new_db);
- }
-
- VOID(pthread_mutex_unlock(&LOCK_open));
- if (! (table= open_ltable(thd, table_list, TL_WRITE_ALLOW_READ)))
- goto err;
- VOID(pthread_mutex_lock(&LOCK_open));
+ if (reopen_table(table))
+ goto err_with_placeholders;
+ t_table= table;
}
/* Tell the handler that a new frm file is in place. */
- if (table->file->create_handler_files(path, NULL, CHF_INDEX_FLAG,
- create_info))
+ if (t_table->file->create_handler_files(path, NULL, CHF_INDEX_FLAG,
+ create_info))
+ goto err_with_placeholders;
+ if (thd->locked_tables && new_name == table_name && new_db == db)
{
- VOID(pthread_mutex_unlock(&LOCK_open));
- goto err;
+ /*
+ We are going to reopen table down on the road, so we have to restore
+ state of the TABLE object which we used for obtaining of handler
+ object to make it suitable for reopening.
+ */
+ DBUG_ASSERT(t_table == table);
+ table->open_placeholder= 1;
+ close_handle_and_leave_table_as_lock(table);
}
}
- if (thd->lock || new_name != table_name || no_table_reopen) // True if WIN32
- {
- /*
- Not table locking or alter table with rename.
- Free locks and remove old table
- */
- if (table)
- {
- table->s->version= 0; // Force removal of table def
- close_cached_table(thd,table);
- }
- VOID(quick_rm_table(old_db_type, db, old_name, FN_IS_TMP));
- }
- else
- {
- /*
- Using LOCK TABLES without rename.
- This code is never executed on WIN32!
- Remove old renamed table, reopen table and get new locks
- */
- if (table)
- {
- VOID(table->file->extra(HA_EXTRA_FORCE_REOPEN)); // Use new file
- /* Mark in-use copies old */
- remove_table_from_cache(thd,db,table_name,RTFC_NO_FLAG);
- /* end threads waiting on lock */
- mysql_lock_abort(thd,table, TRUE);
- }
- VOID(quick_rm_table(old_db_type, db, old_name, FN_IS_TMP));
- if (close_data_tables(thd,db,table_name) ||
- reopen_tables(thd,1,0))
- { // This shouldn't happen
- if (table)
- {
- table->s->version= 0; // Force removal of table def
- close_cached_table(thd,table); // Remove lock for table
- }
- VOID(pthread_mutex_unlock(&LOCK_open));
- goto err;
- }
- }
- VOID(pthread_mutex_unlock(&LOCK_open));
- broadcast_refresh();
- /*
- The ALTER TABLE is always in its own transaction.
- Commit must not be called while LOCK_open is locked. It could call
- wait_if_global_read_lock(), which could create a deadlock if called
- with LOCK_open.
- */
- if (!committed)
+ VOID(quick_rm_table(old_db_type, db, old_name, FN_IS_TMP));
+
+ if (thd->locked_tables && new_name == table_name && new_db == db)
{
- error = ha_commit_stmt(thd);
- if (ha_commit(thd))
- error=1;
+ thd->in_lock_tables= 1;
+ error= reopen_tables(thd, 1, 0);
+ thd->in_lock_tables= 0;
if (error)
- goto err;
+ goto err_with_placeholders;
}
+ VOID(pthread_mutex_unlock(&LOCK_open));
+
thd_proc_info(thd, "end");
+ DBUG_EXECUTE_IF("sleep_alter_before_main_binlog", my_sleep(6000000););
+
ha_binlog_log_query(thd, create_info->db_type, LOGCOM_ALTER_TABLE,
thd->query, thd->query_length,
db, table_name);
@@ -6707,7 +6609,7 @@ view_err:
(create_info->options & HA_LEX_CREATE_TMP_TABLE)));
write_bin_log(thd, TRUE, thd->query, thd->query_length);
- if (ha_check_storage_engine_flag(old_db_type,HTON_FLUSH_AFTER_RENAME))
+ if (ha_check_storage_engine_flag(old_db_type, HTON_FLUSH_AFTER_RENAME))
{
/*
For the alter table to be properly flushed to the logs, we
@@ -6715,12 +6617,13 @@ view_err:
shutdown.
*/
char path[FN_REFLEN];
+ TABLE *t_table;
build_table_filename(path, sizeof(path), new_db, table_name, "", 0);
- table=open_temporary_table(thd, path, new_db, tmp_name,0);
- if (table)
+ t_table= open_temporary_table(thd, path, new_db, tmp_name, 0);
+ if (t_table)
{
- intern_close_table(table);
- my_free((char*) table, MYF(0));
+ intern_close_table(t_table);
+ my_free(t_table, MYF(0));
}
else
sql_print_warning("Could not open table %s.%s after rename\n",
@@ -6730,12 +6633,25 @@ view_err:
table_list->table=0; // For query cache
query_cache_invalidate3(thd, table_list, 0);
+ if (thd->locked_tables && (new_name != table_name || new_db != db))
+ {
+ /*
+ If are we under LOCK TABLES and did ALTER TABLE with RENAME we need
+ to remove placeholders for the old table and for the target table
+ from the list of open tables and table cache. If we are not under
+ LOCK TABLES we can rely on close_thread_tables() doing this job.
+ */
+ pthread_mutex_lock(&LOCK_open);
+ unlink_open_table(thd, table, FALSE);
+ unlink_open_table(thd, name_lock, FALSE);
+ pthread_mutex_unlock(&LOCK_open);
+ }
+
end_temporary:
my_snprintf(tmp_name, sizeof(tmp_name), ER(ER_INSERT_INFO),
(ulong) (copied + deleted), (ulong) deleted,
(ulong) thd->cuted_fields);
- if (do_send_ok)
- send_ok(thd,copied+deleted,0L,tmp_name);
+ send_ok(thd, copied + deleted, 0L, tmp_name);
thd->some_tables_deleted=0;
DBUG_RETURN(FALSE);
@@ -6749,18 +6665,69 @@ err1:
VOID(quick_rm_table(new_db_type, new_db, tmp_name, FN_IS_TMP));
err:
+ /*
+ No default value was provided for a DATE/DATETIME field, the
+ current sql_mode doesn't allow the '0000-00-00' value and
+ the table to be altered isn't empty.
+ Report error here.
+ */
+ if (alter_info->error_if_not_empty && thd->row_count)
+ {
+ const char *f_val= 0;
+ enum enum_mysql_timestamp_type t_type= MYSQL_TIMESTAMP_DATE;
+ switch (alter_info->datetime_field->sql_type)
+ {
+ case MYSQL_TYPE_DATE:
+ case MYSQL_TYPE_NEWDATE:
+ f_val= "0000-00-00";
+ t_type= MYSQL_TIMESTAMP_DATE;
+ break;
+ case MYSQL_TYPE_DATETIME:
+ f_val= "0000-00-00 00:00:00";
+ t_type= MYSQL_TIMESTAMP_DATETIME;
+ break;
+ default:
+ /* Shouldn't get here. */
+ DBUG_ASSERT(0);
+ }
+ bool save_abort_on_warning= thd->abort_on_warning;
+ thd->abort_on_warning= TRUE;
+ make_truncated_value_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ f_val, strlength(f_val), t_type,
+ alter_info->datetime_field->field_name);
+ thd->abort_on_warning= save_abort_on_warning;
+ }
+ if (name_lock)
+ {
+ pthread_mutex_lock(&LOCK_open);
+ unlink_open_table(thd, name_lock, FALSE);
+ pthread_mutex_unlock(&LOCK_open);
+ }
+ DBUG_RETURN(TRUE);
+
+err_with_placeholders:
+ /*
+ An error happened while we were holding exclusive name-lock on table
+ being altered. To be safe under LOCK TABLES we should remove placeholders
+ from list of open tables list and table cache.
+ */
+ unlink_open_table(thd, table, FALSE);
+ if (name_lock)
+ unlink_open_table(thd, name_lock, FALSE);
+ VOID(pthread_mutex_unlock(&LOCK_open));
DBUG_RETURN(TRUE);
}
/* mysql_alter_table */
static int
copy_data_between_tables(TABLE *from,TABLE *to,
- List<create_field> &create,
+ List<Create_field> &create,
bool ignore,
uint order_num, ORDER *order,
ha_rows *copied,
ha_rows *deleted,
- enum enum_enable_or_disable keys_onoff)
+ enum enum_enable_or_disable keys_onoff,
+ bool error_if_not_empty)
{
int error;
Copy_field *copy,*copy_end;
@@ -6798,7 +6765,6 @@ copy_data_between_tables(TABLE *from,TABLE *to,
alter_table_manage_keys(to, from->file->indexes_are_disabled(), keys_onoff);
/* We can abort alter table for any table type */
- thd->no_trans_update.stmt= FALSE;
thd->abort_on_warning= !ignore && test(thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES |
MODE_STRICT_ALL_TABLES));
@@ -6808,8 +6774,8 @@ copy_data_between_tables(TABLE *from,TABLE *to,
save_sql_mode= thd->variables.sql_mode;
- List_iterator<create_field> it(create);
- create_field *def;
+ List_iterator<Create_field> it(create);
+ Create_field *def;
copy_end=copy;
for (Field **ptr=to->field ; *ptr ; ptr++)
{
@@ -6872,6 +6838,12 @@ copy_data_between_tables(TABLE *from,TABLE *to,
break;
}
thd->row_count++;
+ /* Return error if source table isn't empty. */
+ if (error_if_not_empty)
+ {
+ error= 1;
+ break;
+ }
if (to->next_number_field)
{
if (auto_increment_field_copied)
@@ -6885,7 +6857,7 @@ copy_data_between_tables(TABLE *from,TABLE *to,
copy_ptr->do_copy(copy_ptr);
}
prev_insert_id= to->file->next_insert_id;
- error=to->file->write_row((byte*) to->record[0]);
+ error=to->file->write_row(to->record[0]);
to->auto_increment_field_not_null= FALSE;
if (error)
{
@@ -6927,8 +6899,12 @@ copy_data_between_tables(TABLE *from,TABLE *to,
}
to->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
- ha_enable_transaction(thd,TRUE);
-
+ if (ha_enable_transaction(thd, TRUE))
+ {
+ error= 1;
+ goto err;
+ }
+
/*
Ensure that the new table is saved properly to disk so that we
can do a rename
@@ -6958,31 +6934,26 @@ copy_data_between_tables(TABLE *from,TABLE *to,
mysql_recreate_table()
thd Thread handler
tables Tables to recreate
- do_send_ok If we should send_ok() or leave it to caller
RETURN
Like mysql_alter_table().
*/
-bool mysql_recreate_table(THD *thd, TABLE_LIST *table_list,
- bool do_send_ok)
+bool mysql_recreate_table(THD *thd, TABLE_LIST *table_list)
{
- DBUG_ENTER("mysql_recreate_table");
- LEX *lex= thd->lex;
HA_CREATE_INFO create_info;
- lex->create_list.empty();
- lex->key_list.empty();
- lex->col_list.empty();
- lex->alter_info.reset();
- bzero((char*) &create_info,sizeof(create_info));
+ Alter_info alter_info;
+
+ DBUG_ENTER("mysql_recreate_table");
+
+ bzero((char*) &create_info, sizeof(create_info));
create_info.db_type= 0;
create_info.row_type=ROW_TYPE_NOT_USED;
create_info.default_table_charset=default_charset_info;
/* Force alter table to recreate table */
- lex->alter_info.flags= (ALTER_CHANGE_COLUMN | ALTER_RECREATE);
+ alter_info.flags= (ALTER_CHANGE_COLUMN | ALTER_RECREATE);
DBUG_RETURN(mysql_alter_table(thd, NullS, NullS, &create_info,
- table_list, lex->create_list,
- lex->key_list, 0, (ORDER *) 0,
- 0, &lex->alter_info, do_send_ok));
+ table_list, &alter_info, 0,
+ (ORDER *) 0, 0));
}
@@ -7011,7 +6982,7 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables,
strxmov(table_name, table->db ,".", table->table_name, NullS);
- t= table->table= open_ltable(thd, table, TL_READ);
+ t= table->table= open_ltable(thd, table, TL_READ, 0);
thd->clear_error(); // these errors shouldn't get client
protocol->prepare_for_resend();
@@ -7071,10 +7042,10 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables,
{
String tmp;
f->val_str(&tmp);
- row_crc= my_checksum(row_crc, (byte*) tmp.ptr(), tmp.length());
+ row_crc= my_checksum(row_crc, (uchar*) tmp.ptr(), tmp.length());
}
else
- row_crc= my_checksum(row_crc, (byte*) f->ptr,
+ row_crc= my_checksum(row_crc, f->ptr,
f->pack_length());
}
@@ -7115,7 +7086,7 @@ static bool check_engine(THD *thd, const char *table_name,
if (req_engine && req_engine != *new_engine)
{
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_WARN_USING_OTHER_HANDLER,
ER(ER_WARN_USING_OTHER_HANDLER),
ha_resolve_storage_engine_name(*new_engine),
@@ -7127,7 +7098,7 @@ static bool check_engine(THD *thd, const char *table_name,
if (create_info->used_fields & HA_CREATE_USED_ENGINE)
{
my_error(ER_ILLEGAL_HA_CREATE_OPTION, MYF(0),
- hton2plugin[(*new_engine)->slot]->name.str, "TEMPORARY");
+ ha_resolve_storage_engine_name(*new_engine), "TEMPORARY");
*new_engine= 0;
return TRUE;
}
diff --git a/sql/sql_tablespace.cc b/sql/sql_tablespace.cc
index 84391a54642..9fec0e3bc63 100644
--- a/sql/sql_tablespace.cc
+++ b/sql/sql_tablespace.cc
@@ -34,7 +34,7 @@ int mysql_alter_tablespace(THD *thd, st_alter_tablespace *ts_info)
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
ER_WARN_USING_OTHER_HANDLER,
ER(ER_WARN_USING_OTHER_HANDLER),
- hton2plugin[hton->slot]->name.str,
+ ha_resolve_storage_engine_name(hton),
ts_info->tablespace_name ? ts_info->tablespace_name
: ts_info->logfile_group_name);
}
@@ -63,13 +63,9 @@ int mysql_alter_tablespace(THD *thd, st_alter_tablespace *ts_info)
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
ER_ILLEGAL_HA_CREATE_OPTION,
ER(ER_ILLEGAL_HA_CREATE_OPTION),
- hton2plugin[hton->slot]->name.str,
+ ha_resolve_storage_engine_name(hton),
"TABLESPACE or LOGFILE GROUP");
}
- if (mysql_bin_log.is_open())
- {
- thd->binlog_query(THD::STMT_QUERY_TYPE,
- thd->query, thd->query_length, FALSE, TRUE);
- }
+ write_bin_log(thd, FALSE, thd->query, thd->query_length);
DBUG_RETURN(FALSE);
}
diff --git a/sql/sql_test.cc b/sql/sql_test.cc
index d7573b42c5f..0fe299d4505 100644
--- a/sql/sql_test.cc
+++ b/sql/sql_test.cc
@@ -349,7 +349,7 @@ static void push_locks_into_array(DYNAMIC_ARRAY *ar, THR_LOCK_DATA *data,
table_lock_info.lock_text=text;
// lock_type is also obtainable from THR_LOCK_DATA
table_lock_info.type=table->reginfo.lock_type;
- VOID(push_dynamic(ar,(gptr) &table_lock_info));
+ VOID(push_dynamic(ar,(uchar*) &table_lock_info));
}
}
}
@@ -394,7 +394,7 @@ static void display_table_locks(void)
VOID(pthread_mutex_unlock(&THR_LOCK_lock));
if (!saved_table_locks.elements) goto end;
- qsort((gptr) dynamic_element(&saved_table_locks,0,TABLE_LOCK_INFO *),saved_table_locks.elements,sizeof(TABLE_LOCK_INFO),(qsort_cmp) dl_compare);
+ qsort((uchar*) dynamic_element(&saved_table_locks,0,TABLE_LOCK_INFO *),saved_table_locks.elements,sizeof(TABLE_LOCK_INFO),(qsort_cmp) dl_compare);
freeze_size(&saved_table_locks);
puts("\nThread database.table_name Locked/Waiting Lock_type\n");
@@ -508,7 +508,9 @@ Next alarm time: %lu\n",
display_table_locks();
fflush(stdout);
my_checkmalloc();
- TERMINATE(stdout); // Write malloc information
+ fprintf(stdout,"\nBegin safemalloc memory dump:\n"); // tag needed for test suite
+ TERMINATE(stdout, 1); // Write malloc information
+ fprintf(stdout,"\nEnd safemalloc memory dump.\n");
#ifdef HAVE_MALLINFO
struct mallinfo info= mallinfo();
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index 7b4deba527a..ce26b025430 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -20,10 +20,153 @@
#include "sql_trigger.h"
#include "parse_file.h"
+/*************************************************************************/
+
+template <class T>
+inline T *alloc_type(MEM_ROOT *m)
+{
+ return (T *) alloc_root(m, sizeof (T));
+}
+
+/*
+ NOTE: Since alloc_type() is declared as inline, alloc_root() calls should
+ be inlined by the compiler. So, implementation of alloc_root() is not
+ needed. However, let's put the implementation in object file just in case
+ of stupid MS or other old compilers.
+*/
+
+template LEX_STRING *alloc_type<LEX_STRING>(MEM_ROOT *m);
+template ulonglong *alloc_type<ulonglong>(MEM_ROOT *m);
+
+inline LEX_STRING *alloc_lex_string(MEM_ROOT *m)
+{
+ return alloc_type<LEX_STRING>(m);
+}
+
+/*************************************************************************/
+/**
+ Trigger_creation_ctx -- creation context of triggers.
+*/
+
+class Trigger_creation_ctx : public Stored_program_creation_ctx,
+ public Sql_alloc
+{
+public:
+ static Trigger_creation_ctx *create(THD *thd,
+ const char *db_name,
+ const char *table_name,
+ const LEX_STRING *client_cs_name,
+ const LEX_STRING *connection_cl_name,
+ const LEX_STRING *db_cl_name);
+
+public:
+ virtual Stored_program_creation_ctx *clone(MEM_ROOT *mem_root)
+ {
+ return new (mem_root) Trigger_creation_ctx(m_client_cs,
+ m_connection_cl,
+ m_db_cl);
+ }
+
+protected:
+ virtual Object_creation_ctx *create_backup_ctx(THD *thd) const
+ {
+ return new Trigger_creation_ctx(thd);
+ }
+
+private:
+ Trigger_creation_ctx(THD *thd)
+ :Stored_program_creation_ctx(thd)
+ { }
+
+ Trigger_creation_ctx(CHARSET_INFO *client_cs,
+ CHARSET_INFO *connection_cl,
+ CHARSET_INFO *db_cl)
+ :Stored_program_creation_ctx(client_cs, connection_cl, db_cl)
+ { }
+};
+
+/**************************************************************************
+ Trigger_creation_ctx implementation.
+**************************************************************************/
+
+Trigger_creation_ctx *
+Trigger_creation_ctx::create(THD *thd,
+ const char *db_name,
+ const char *table_name,
+ const LEX_STRING *client_cs_name,
+ const LEX_STRING *connection_cl_name,
+ const LEX_STRING *db_cl_name)
+{
+ CHARSET_INFO *client_cs;
+ CHARSET_INFO *connection_cl;
+ CHARSET_INFO *db_cl;
+
+ bool invalid_creation_ctx= FALSE;
+
+ if (resolve_charset(client_cs_name->str,
+ thd->variables.character_set_client,
+ &client_cs))
+ {
+ sql_print_warning("Trigger for table '%s'.'%s': "
+ "invalid character_set_client value (%s).",
+ (const char *) db_name,
+ (const char *) table_name,
+ (const char *) client_cs_name->str);
+
+ invalid_creation_ctx= TRUE;
+ }
+
+ if (resolve_collation(connection_cl_name->str,
+ thd->variables.collation_connection,
+ &connection_cl))
+ {
+ sql_print_warning("Trigger for table '%s'.'%s': "
+ "invalid collation_connection value (%s).",
+ (const char *) db_name,
+ (const char *) table_name,
+ (const char *) connection_cl_name->str);
+
+ invalid_creation_ctx= TRUE;
+ }
+
+ if (resolve_collation(db_cl_name->str, NULL, &db_cl))
+ {
+ sql_print_warning("Trigger for table '%s'.'%s': "
+ "invalid database_collation value (%s).",
+ (const char *) db_name,
+ (const char *) table_name,
+ (const char *) db_cl_name->str);
+
+ invalid_creation_ctx= TRUE;
+ }
+
+ if (invalid_creation_ctx)
+ {
+ push_warning_printf(thd,
+ MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_TRG_INVALID_CREATION_CTX,
+ ER(ER_TRG_INVALID_CREATION_CTX),
+ (const char *) db_name,
+ (const char *) table_name);
+ }
+
+ /*
+ If we failed to resolve the database collation, load the default one
+ from the disk.
+ */
+
+ if (!db_cl)
+ db_cl= get_default_db_collation(thd, db_name);
+
+ return new Trigger_creation_ctx(client_cs, connection_cl, db_cl);
+}
+
+/*************************************************************************/
+
static const LEX_STRING triggers_file_type=
{ C_STRING_WITH_LEN("TRIGGERS") };
-const char * const triggers_file_ext= ".TRG";
+const char * const TRG_EXT= ".TRG";
/*
Table of .TRG file field descriptors.
@@ -48,6 +191,21 @@ static File_option triggers_file_parameters[]=
my_offsetof(class Table_triggers_list, definers_list),
FILE_OPTIONS_STRLIST
},
+ {
+ { C_STRING_WITH_LEN("client_cs_names") },
+ my_offsetof(class Table_triggers_list, client_cs_names),
+ FILE_OPTIONS_STRLIST
+ },
+ {
+ { C_STRING_WITH_LEN("connection_cl_names") },
+ my_offsetof(class Table_triggers_list, connection_cl_names),
+ FILE_OPTIONS_STRLIST
+ },
+ {
+ { C_STRING_WITH_LEN("db_cl_names") },
+ my_offsetof(class Table_triggers_list, db_cl_names),
+ FILE_OPTIONS_STRLIST
+ },
{ { 0, 0 }, 0, FILE_OPTIONS_STRING }
};
@@ -64,7 +222,7 @@ File_option sql_modes_parameters=
.trg file.
*/
-static const int TRG_NUM_REQUIRED_PARAMETERS= 4;
+static const int TRG_NUM_REQUIRED_PARAMETERS= 6;
/*
Structure representing contents of .TRN file which are used to support
@@ -79,7 +237,7 @@ struct st_trigname
static const LEX_STRING trigname_file_type=
{ C_STRING_WITH_LEN("TRIGGERNAME") };
-const char * const trigname_file_ext= ".TRN";
+const char * const TRN_EXT= ".TRN";
static File_option trigname_file_parameters[]=
{
@@ -114,10 +272,11 @@ public:
Handle_old_incorrect_sql_modes_hook(char *file_path)
:path(file_path)
{};
- virtual bool process_unknown_string(char *&unknown_key, gptr base,
+ virtual bool process_unknown_string(char *&unknown_key, uchar* base,
MEM_ROOT *mem_root, char *end);
};
+
class Handle_old_incorrect_trigger_table_hook: public Unknown_key_hook
{
public:
@@ -125,13 +284,14 @@ public:
LEX_STRING *trigger_table_arg)
:path(file_path), trigger_table_value(trigger_table_arg)
{};
- virtual bool process_unknown_string(char *&unknown_key, gptr base,
+ virtual bool process_unknown_string(char *&unknown_key, uchar* base,
MEM_ROOT *mem_root, char *end);
private:
char *path;
LEX_STRING *trigger_table_value;
};
+
/*
Create or drop trigger for table.
@@ -279,7 +439,7 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
/* We also don't allow creation of triggers on views. */
tables->required_type= FRMTYPE_TABLE;
- if (reopen_name_locked_table(thd, tables))
+ if (reopen_name_locked_table(thd, tables, TRUE))
{
unlock_table_name(thd, tables);
goto end;
@@ -306,14 +466,7 @@ end:
if (!result)
{
- if (mysql_bin_log.is_open())
- {
- thd->clear_error();
-
- /* Such a statement can always go directly to binlog, no trans cache. */
- thd->binlog_query(THD::STMT_QUERY_TYPE,
- stmt_query.ptr(), stmt_query.length(), FALSE, FALSE);
- }
+ write_bin_log(thd, TRUE, stmt_query.ptr(), stmt_query.length());
}
VOID(pthread_mutex_unlock(&LOCK_open));
@@ -365,6 +518,9 @@ bool Table_triggers_list::create_trigger(THD *thd, TABLE_LIST *tables,
LEX_STRING *trg_definer;
Item_trigger_field *trg_field;
struct st_trigname trigname;
+ LEX_STRING *trg_client_cs_name;
+ LEX_STRING *trg_connection_cl_name;
+ LEX_STRING *trg_db_cl_name;
/* Trigger must be in the same schema as target table. */
@@ -463,14 +619,14 @@ bool Table_triggers_list::create_trigger(THD *thd, TABLE_LIST *tables,
sql_create_definition_file() files handles renaming and backup of older
versions
*/
- file.length= build_table_filename(file_buff, FN_REFLEN-1,
+ file.length= build_table_filename(file_buff, FN_REFLEN - 1,
tables->db, tables->table_name,
- triggers_file_ext, 0);
+ TRG_EXT, 0);
file.str= file_buff;
trigname_file.length= build_table_filename(trigname_buff, FN_REFLEN-1,
tables->db,
lex->spname->m_name.str,
- trigname_file_ext, 0);
+ TRN_EXT, 0);
trigname_file.str= trigname_buff;
/* Use the filesystem to enforce trigger namespace constraints. */
@@ -484,7 +640,7 @@ bool Table_triggers_list::create_trigger(THD *thd, TABLE_LIST *tables,
trigname.trigger_table.length= tables->table_name_length;
if (sql_create_definition_file(NULL, &trigname_file, &trigname_file_type,
- (gptr)&trigname, trigname_file_parameters, 0))
+ (uchar*)&trigname, trigname_file_parameters, 0))
return 1;
/*
@@ -495,16 +651,26 @@ bool Table_triggers_list::create_trigger(THD *thd, TABLE_LIST *tables,
QQ: Hmm... probably we should not care about setting up active thread
mem_root too.
*/
- if (!(trg_def= (LEX_STRING *)alloc_root(&table->mem_root,
- sizeof(LEX_STRING))) ||
+ if (!(trg_def= alloc_lex_string(&table->mem_root)) ||
definitions_list.push_back(trg_def, &table->mem_root) ||
- !(trg_sql_mode= (ulonglong*)alloc_root(&table->mem_root,
- sizeof(ulonglong))) ||
+
+ !(trg_sql_mode= alloc_type<ulonglong>(&table->mem_root)) ||
definition_modes_list.push_back(trg_sql_mode, &table->mem_root) ||
- !(trg_definer= (LEX_STRING*) alloc_root(&table->mem_root,
- sizeof(LEX_STRING))) ||
- definers_list.push_back(trg_definer, &table->mem_root))
+
+ !(trg_definer= alloc_lex_string(&table->mem_root)) ||
+ definers_list.push_back(trg_definer, &table->mem_root) ||
+
+ !(trg_client_cs_name= alloc_lex_string(&table->mem_root)) ||
+ client_cs_names.push_back(trg_client_cs_name, &table->mem_root) ||
+
+ !(trg_connection_cl_name= alloc_lex_string(&table->mem_root)) ||
+ connection_cl_names.push_back(trg_connection_cl_name, &table->mem_root) ||
+
+ !(trg_db_cl_name= alloc_lex_string(&table->mem_root)) ||
+ db_cl_names.push_back(trg_db_cl_name, &table->mem_root))
+ {
goto err_with_cleanup;
+ }
*trg_sql_mode= thd->variables.sql_mode;
@@ -547,6 +713,21 @@ bool Table_triggers_list::create_trigger(THD *thd, TABLE_LIST *tables,
}
/*
+ Fill character set information:
+ - client character set contains charset info only;
+ - connection collation contains pair {character set, collation};
+ - database collation contains pair {character set, collation};
+ */
+
+ lex_string_set(trg_client_cs_name, thd->charset()->csname);
+
+ lex_string_set(trg_connection_cl_name,
+ thd->variables.collation_connection->name);
+
+ lex_string_set(trg_db_cl_name,
+ get_default_db_collation(thd, tables->db)->name);
+
+ /*
Create well-formed trigger definition query. Original query is not
appropriated, because definer-clause can be not truncated.
*/
@@ -563,10 +744,13 @@ bool Table_triggers_list::create_trigger(THD *thd, TABLE_LIST *tables,
append_definer(thd, stmt_query, &definer_user, &definer_host);
}
- stmt_query->append(thd->lex->stmt_definition_begin,
- (char *) thd->lex->sphead->m_body_begin -
- thd->lex->stmt_definition_begin +
- thd->lex->sphead->m_body.length);
+ LEX_STRING stmt_definition;
+ stmt_definition.str= (char*) thd->lex->stmt_definition_begin;
+ stmt_definition.length= thd->lex->stmt_definition_end
+ - thd->lex->stmt_definition_begin;
+ trim_whitespace(thd->charset(), & stmt_definition);
+
+ stmt_query->append(stmt_definition.str, stmt_definition.length);
trg_def->str= stmt_query->c_ptr();
trg_def->length= stmt_query->length();
@@ -574,7 +758,7 @@ bool Table_triggers_list::create_trigger(THD *thd, TABLE_LIST *tables,
/* Create trigger definition file. */
if (!sql_create_definition_file(NULL, &file, &triggers_file_type,
- (gptr)this, triggers_file_parameters, 0))
+ (uchar*)this, triggers_file_parameters, 0))
return 0;
err_with_cleanup:
@@ -601,7 +785,7 @@ err_with_cleanup:
static bool rm_trigger_file(char *path, const char *db,
const char *table_name)
{
- build_table_filename(path, FN_REFLEN-1, db, table_name, triggers_file_ext, 0);
+ build_table_filename(path, FN_REFLEN-1, db, table_name, TRG_EXT, 0);
return my_delete(path, MYF(MY_WME));
}
@@ -624,8 +808,7 @@ static bool rm_trigger_file(char *path, const char *db,
static bool rm_trigname_file(char *path, const char *db,
const char *trigger_name)
{
- build_table_filename(path, FN_REFLEN-1,
- db, trigger_name, trigname_file_ext, 0);
+ build_table_filename(path, FN_REFLEN - 1, db, trigger_name, TRN_EXT, 0);
return my_delete(path, MYF(MY_WME));
}
@@ -650,11 +833,11 @@ static bool save_trigger_file(Table_triggers_list *triggers, const char *db,
char file_buff[FN_REFLEN];
LEX_STRING file;
- file.length= build_table_filename(file_buff, FN_REFLEN-1, db, table_name,
- triggers_file_ext, 0);
+ file.length= build_table_filename(file_buff, FN_REFLEN - 1, db, table_name,
+ TRG_EXT, 0);
file.str= file_buff;
return sql_create_definition_file(NULL, &file, &triggers_file_type,
- (gptr)triggers, triggers_file_parameters,
+ (uchar*)triggers, triggers_file_parameters,
0);
}
@@ -678,14 +861,20 @@ static bool save_trigger_file(Table_triggers_list *triggers, const char *db,
bool Table_triggers_list::drop_trigger(THD *thd, TABLE_LIST *tables,
String *stmt_query)
{
- LEX *lex= thd->lex;
+ const char *sp_name= thd->lex->spname->m_name.str; // alias
+
LEX_STRING *name;
- List_iterator_fast<LEX_STRING> it_name(names_list);
- List_iterator<LEX_STRING> it_def(definitions_list);
- List_iterator<ulonglong> it_mod(definition_modes_list);
- List_iterator<LEX_STRING> it_definer(definers_list);
char path[FN_REFLEN];
+ List_iterator_fast<LEX_STRING> it_name(names_list);
+
+ List_iterator<ulonglong> it_mod(definition_modes_list);
+ List_iterator<LEX_STRING> it_def(definitions_list);
+ List_iterator<LEX_STRING> it_definer(definers_list);
+ List_iterator<LEX_STRING> it_client_cs_name(client_cs_names);
+ List_iterator<LEX_STRING> it_connection_cl_name(connection_cl_names);
+ List_iterator<LEX_STRING> it_db_cl_name(db_cl_names);
+
stmt_query->append(thd->query, thd->query_length);
while ((name= it_name++))
@@ -693,9 +882,11 @@ bool Table_triggers_list::drop_trigger(THD *thd, TABLE_LIST *tables,
it_def++;
it_mod++;
it_definer++;
+ it_client_cs_name++;
+ it_connection_cl_name++;
+ it_db_cl_name++;
- if (my_strcasecmp(table_alias_charset, lex->spname->m_name.str,
- name->str) == 0)
+ if (my_strcasecmp(table_alias_charset, sp_name, name->str) == 0)
{
/*
Again we don't care much about other things required for
@@ -704,6 +895,9 @@ bool Table_triggers_list::drop_trigger(THD *thd, TABLE_LIST *tables,
it_def.remove();
it_mod.remove();
it_definer.remove();
+ it_client_cs_name.remove();
+ it_connection_cl_name.remove();
+ it_db_cl_name.remove();
if (definitions_list.is_empty())
{
@@ -722,7 +916,7 @@ bool Table_triggers_list::drop_trigger(THD *thd, TABLE_LIST *tables,
return 1;
}
- if (rm_trigname_file(path, tables->db, lex->spname->m_name.str))
+ if (rm_trigname_file(path, tables->db, sp_name))
return 1;
return 0;
}
@@ -831,8 +1025,8 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
DBUG_ENTER("Table_triggers_list::check_n_load");
- path.length= build_table_filename(path_buff, FN_REFLEN-1,
- db, table_name, triggers_file_ext, 0);
+ path.length= build_table_filename(path_buff, FN_REFLEN - 1,
+ db, table_name, TRG_EXT, 0);
path.str= path_buff;
// QQ: should we analyze errno somehow ?
@@ -861,11 +1055,15 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
we should initialize the list for safety:
- sql_modes;
- definers;
+ - character sets (client, connection, database);
*/
triggers->definition_modes_list.empty();
triggers->definers_list.empty();
+ triggers->client_cs_names.empty();
+ triggers->connection_cl_names.empty();
+ triggers->db_cl_names.empty();
- if (parser->parse((gptr)triggers, &table->mem_root,
+ if (parser->parse((uchar*)triggers, &table->mem_root,
triggers_file_parameters,
TRG_NUM_REQUIRED_PARAMETERS,
&sql_modes_hook))
@@ -884,8 +1082,7 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
We use one mode (current) for all triggers, because we have not
information about mode in old format.
*/
- if (!(trg_sql_mode= (ulonglong*)alloc_root(&table->mem_root,
- sizeof(ulonglong))))
+ if (!(trg_sql_mode= alloc_type<ulonglong>(&table->mem_root)))
{
DBUG_RETURN(1); // EOM
}
@@ -914,8 +1111,7 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
LEX_STRING *trg_definer;
- if (! (trg_definer= (LEX_STRING*)alloc_root(&table->mem_root,
- sizeof(LEX_STRING))))
+ if (!(trg_definer= alloc_lex_string(&table->mem_root)))
DBUG_RETURN(1); // EOM
trg_definer->str= (char*) "";
@@ -933,25 +1129,89 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
it.rewind();
}
+ if (!triggers->definitions_list.is_empty() &&
+ (triggers->client_cs_names.is_empty() ||
+ triggers->connection_cl_names.is_empty() ||
+ triggers->db_cl_names.is_empty()))
+ {
+ /*
+ It is old file format => we should fill lists of character sets.
+ */
+
+ LEX_STRING *trg_client_cs_name;
+ LEX_STRING *trg_connection_cl_name;
+ LEX_STRING *trg_db_cl_name;
+
+ if (!triggers->client_cs_names.is_empty() ||
+ !triggers->connection_cl_names.is_empty() ||
+ !triggers->db_cl_names.is_empty())
+ {
+ my_error(ER_TRG_CORRUPTED_FILE, MYF(0),
+ (const char *) db,
+ (const char *) table_name);
+
+ DBUG_RETURN(1); // EOM
+ }
+
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_TRG_NO_CREATION_CTX,
+ ER(ER_TRG_NO_CREATION_CTX),
+ (const char*) db,
+ (const char*) table_name);
+
+ if (!(trg_client_cs_name= alloc_lex_string(&table->mem_root)) ||
+ !(trg_connection_cl_name= alloc_lex_string(&table->mem_root)) ||
+ !(trg_db_cl_name= alloc_lex_string(&table->mem_root)))
+ {
+ DBUG_RETURN(1); // EOM
+ }
+
+ /*
+ Backward compatibility: assume that the query is in the current
+ character set.
+ */
+
+ lex_string_set(trg_client_cs_name,
+ thd->variables.character_set_client->csname);
+
+ lex_string_set(trg_connection_cl_name,
+ thd->variables.collation_connection->name);
+
+ lex_string_set(trg_db_cl_name,
+ thd->variables.collation_database->name);
+
+ while (it++)
+ {
+ if (triggers->client_cs_names.push_back(trg_client_cs_name,
+ &table->mem_root) ||
+
+ triggers->connection_cl_names.push_back(trg_connection_cl_name,
+ &table->mem_root) ||
+
+ triggers->db_cl_names.push_back(trg_db_cl_name,
+ &table->mem_root))
+ {
+ DBUG_RETURN(1); // EOM
+ }
+ }
+
+ it.rewind();
+ }
+
DBUG_ASSERT(triggers->definition_modes_list.elements ==
triggers->definitions_list.elements);
DBUG_ASSERT(triggers->definers_list.elements ==
triggers->definitions_list.elements);
+ DBUG_ASSERT(triggers->client_cs_names.elements ==
+ triggers->definitions_list.elements);
+ DBUG_ASSERT(triggers->connection_cl_names.elements ==
+ triggers->definitions_list.elements);
+ DBUG_ASSERT(triggers->db_cl_names.elements ==
+ triggers->definitions_list.elements);
table->triggers= triggers;
/*
- Construct key that will represent triggers for this table in the set
- of routines used by statement.
- */
- triggers->sroutines_key.length= 1+strlen(db)+1+strlen(table_name)+1;
- if (!(triggers->sroutines_key.str=
- alloc_root(&table->mem_root, triggers->sroutines_key.length)))
- DBUG_RETURN(1);
- triggers->sroutines_key.str[0]= TYPE_ENUM_TRIGGER;
- strxmov(triggers->sroutines_key.str+1, db, ".", table_name, NullS);
-
- /*
TODO: This could be avoided if there is no triggers
for UPDATE and DELETE.
*/
@@ -960,6 +1220,9 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
List_iterator_fast<ulonglong> itm(triggers->definition_modes_list);
List_iterator_fast<LEX_STRING> it_definer(triggers->definers_list);
+ List_iterator_fast<LEX_STRING> it_client_cs_name(triggers->client_cs_names);
+ List_iterator_fast<LEX_STRING> it_connection_cl_name(triggers->connection_cl_names);
+ List_iterator_fast<LEX_STRING> it_db_cl_name(triggers->db_cl_names);
LEX *old_lex= thd->lex, lex;
sp_rcontext *save_spcont= thd->spcont;
ulong save_sql_mode= thd->variables.sql_mode;
@@ -976,20 +1239,43 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
LEX_STRING *trg_definer= it_definer++;
thd->variables.sql_mode= (ulong)*trg_sql_mode;
- lex_start(thd, trg_create_str->str, trg_create_str->length);
- thd->spcont= 0;
- if (MYSQLparse((void *)thd) || thd->is_fatal_error)
+ Lex_input_stream lip(thd, trg_create_str->str, trg_create_str->length);
+
+ Trigger_creation_ctx *creation_ctx=
+ Trigger_creation_ctx::create(thd,
+ db,
+ table_name,
+ it_client_cs_name++,
+ it_connection_cl_name++,
+ it_db_cl_name++);
+
+ lex_start(thd);
+ thd->spcont= NULL;
+
+ if (parse_sql(thd, &lip, creation_ctx))
{
/* Currently sphead is always deleted in case of a parse error */
DBUG_ASSERT(lex.sphead == 0);
goto err_with_lex_cleanup;
}
+ /*
+ Not strictly necessary to invoke this method here, since we know
+ that we've parsed CREATE TRIGGER and not an
+ UPDATE/DELETE/INSERT/REPLACE/LOAD/CREATE TABLE, but we try to
+ maintain the invariant that this method is called for each
+ distinct statement, in case its logic is extended with other
+ types of analyses in future.
+ */
+ lex.set_trg_event_type_for_tables();
lex.sphead->set_info(0, 0, &lex.sp_chistics, (ulong) *trg_sql_mode);
- triggers->bodies[lex.trg_chistics.event]
- [lex.trg_chistics.action_time]= lex.sphead;
+ int event= lex.trg_chistics.event;
+ int action_time= lex.trg_chistics.action_time;
+
+ lex.sphead->set_creation_ctx(creation_ctx);
+ triggers->bodies[event][action_time]= lex.sphead;
if (!trg_definer->length)
{
@@ -1025,10 +1311,13 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
&table->mem_root))
goto err_with_lex_cleanup;
- if (!(on_table_name= (LEX_STRING*) alloc_root(&table->mem_root,
- sizeof(LEX_STRING))))
+ if (!(on_table_name= alloc_lex_string(&table->mem_root)))
goto err_with_lex_cleanup;
- *on_table_name= lex.ident;
+
+ on_table_name->str= (char*) lex.raw_trg_on_table_name_begin;
+ on_table_name->length= lex.raw_trg_on_table_name_end
+ - lex.raw_trg_on_table_name_begin;
+
if (triggers->on_table_names_list.push_back(on_table_name, &table->mem_root))
goto err_with_lex_cleanup;
@@ -1068,7 +1357,7 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
trg_field;
trg_field= trg_field->next_trg_field)
{
- trg_field->setup_field(thd, table,
+ trg_field->setup_field(thd, table,
&triggers->subject_table_grants[lex.trg_chistics.event]
[lex.trg_chistics.action_time]);
}
@@ -1097,7 +1386,7 @@ err_with_lex_cleanup:
be merged into .FRM anyway.
*/
my_error(ER_WRONG_OBJECT, MYF(0),
- table_name, triggers_file_ext+1, "TRIGGER");
+ table_name, TRG_EXT + 1, "TRIGGER");
DBUG_RETURN(1);
}
@@ -1130,14 +1419,20 @@ bool Table_triggers_list::get_trigger_info(THD *thd, trg_event_type event,
LEX_STRING *trigger_name,
LEX_STRING *trigger_stmt,
ulong *sql_mode,
- LEX_STRING *definer)
+ LEX_STRING *definer,
+ LEX_STRING *client_cs_name,
+ LEX_STRING *connection_cl_name,
+ LEX_STRING *db_cl_name)
{
sp_head *body;
DBUG_ENTER("get_trigger_info");
if ((body= bodies[event][time_type]))
{
+ Stored_program_creation_ctx *creation_ctx=
+ bodies[event][time_type]->get_creation_ctx();
+
*trigger_name= body->m_name;
- *trigger_stmt= body->m_body;
+ *trigger_stmt= body->m_body_utf8;
*sql_mode= body->m_sql_mode;
if (body->m_chistics->suid == SP_IS_NOT_SUID)
@@ -1151,89 +1446,134 @@ bool Table_triggers_list::get_trigger_info(THD *thd, trg_event_type event,
body->m_definer_host.str, NullS) - definer->str;
}
+ lex_string_set(client_cs_name,
+ creation_ctx->get_client_cs()->csname);
+
+ lex_string_set(connection_cl_name,
+ creation_ctx->get_connection_cl()->name);
+
+ lex_string_set(db_cl_name,
+ creation_ctx->get_db_cl()->name);
+
DBUG_RETURN(0);
}
DBUG_RETURN(1);
}
-/*
+void Table_triggers_list::get_trigger_info(THD *thd,
+ int trigger_idx,
+ LEX_STRING *trigger_name,
+ ulonglong *sql_mode,
+ LEX_STRING *sql_original_stmt,
+ LEX_STRING *client_cs_name,
+ LEX_STRING *connection_cl_name,
+ LEX_STRING *db_cl_name)
+{
+ List_iterator_fast<LEX_STRING> it_trigger_name(names_list);
+ List_iterator_fast<ulonglong> it_sql_mode(definition_modes_list);
+ List_iterator_fast<LEX_STRING> it_sql_orig_stmt(definitions_list);
+ List_iterator_fast<LEX_STRING> it_client_cs_name(client_cs_names);
+ List_iterator_fast<LEX_STRING> it_connection_cl_name(connection_cl_names);
+ List_iterator_fast<LEX_STRING> it_db_cl_name(db_cl_names);
+
+ for (int i = 0; i < trigger_idx; ++i)
+ {
+ it_trigger_name.next_fast();
+ it_sql_mode.next_fast();
+ it_sql_orig_stmt.next_fast();
+
+ it_client_cs_name.next_fast();
+ it_connection_cl_name.next_fast();
+ it_db_cl_name.next_fast();
+ }
+
+ *trigger_name= *(it_trigger_name++);
+ *sql_mode= *(it_sql_mode++);
+ *sql_original_stmt= *(it_sql_orig_stmt++);
+
+ *client_cs_name= *(it_client_cs_name++);
+ *connection_cl_name= *(it_connection_cl_name++);
+ *db_cl_name= *(it_db_cl_name++);
+}
+
+
+int Table_triggers_list::find_trigger_by_name(const LEX_STRING *trg_name)
+{
+ List_iterator_fast<LEX_STRING> it(names_list);
+
+ for (int i = 0; ; ++i)
+ {
+ LEX_STRING *cur_name= it++;
+
+ if (!cur_name)
+ return -1;
+
+ if (strcmp(cur_name->str, trg_name->str) == 0)
+ return i;
+ }
+}
+
+/**
Find trigger's table from trigger identifier and add it to
the statement table list.
- SYNOPSIS
- mysql_table_for_trigger()
- thd - current thread context
- trig - identifier for trigger
- if_exists - treat a not existing trigger as a warning if TRUE
- table - pointer to TABLE_LIST object for the table trigger (output)
-
- RETURN VALUE
- 0 Success
- 1 Error
+ @param[in] thd Thread context.
+ @param[in] trg_name Trigger name.
+ @param[in] if_exists TRUE if SQL statement contains "IF EXISTS" clause.
+ That means a warning instead of error should be
+ thrown if trigger with given name does not exist.
+ @param[out] table Pointer to TABLE_LIST object for the
+ table trigger.
+
+ @return Operation status
+ @retval FALSE On success.
+ @retval TRUE Otherwise.
*/
-int
-add_table_for_trigger(THD *thd, sp_name *trig, bool if_exists,
- TABLE_LIST **table)
+bool add_table_for_trigger(THD *thd,
+ const sp_name *trg_name,
+ bool if_exists,
+ TABLE_LIST **table)
{
LEX *lex= thd->lex;
- char path_buff[FN_REFLEN];
- LEX_STRING path;
- File_parser *parser;
- struct st_trigname trigname;
- Handle_old_incorrect_trigger_table_hook trigger_table_hook(
- path_buff, &trigname.trigger_table);
-
+ char trn_path_buff[FN_REFLEN];
+ LEX_STRING trn_path= { trn_path_buff, 0 };
+ LEX_STRING tbl_name;
+
DBUG_ENTER("add_table_for_trigger");
- DBUG_ASSERT(table != NULL);
- path.length= build_table_filename(path_buff, FN_REFLEN-1,
- trig->m_db.str, trig->m_name.str,
- trigname_file_ext, 0);
- path.str= path_buff;
+ build_trn_path(thd, trg_name, &trn_path);
- if (access(path_buff, F_OK))
+ if (check_trn_exists(&trn_path))
{
if (if_exists)
{
push_warning_printf(thd,
- MYSQL_ERROR::WARN_LEVEL_NOTE,
- ER_TRG_DOES_NOT_EXIST,
- ER(ER_TRG_DOES_NOT_EXIST));
+ MYSQL_ERROR::WARN_LEVEL_NOTE,
+ ER_TRG_DOES_NOT_EXIST,
+ ER(ER_TRG_DOES_NOT_EXIST));
+
*table= NULL;
- DBUG_RETURN(0);
+
+ DBUG_RETURN(FALSE);
}
my_error(ER_TRG_DOES_NOT_EXIST, MYF(0));
- DBUG_RETURN(1);
- }
-
- if (!(parser= sql_parse_prepare(&path, thd->mem_root, 1)))
- DBUG_RETURN(1);
-
- if (!is_equal(&trigname_file_type, parser->type()))
- {
- my_error(ER_WRONG_OBJECT, MYF(0), trig->m_name.str, trigname_file_ext+1,
- "TRIGGERNAME");
- DBUG_RETURN(1);
+ DBUG_RETURN(TRUE);
}
- if (parser->parse((gptr)&trigname, thd->mem_root,
- trigname_file_parameters, 1,
- &trigger_table_hook))
- DBUG_RETURN(1);
+ if (load_table_name_for_trigger(thd, trg_name, &trn_path, &tbl_name))
+ DBUG_RETURN(TRUE);
/* We need to reset statement table list to be PS/SP friendly. */
lex->query_tables= 0;
lex->query_tables_last= &lex->query_tables;
- *table= sp_add_to_query_tables(thd, lex, trig->m_db.str,
- trigname.trigger_table.str, TL_IGNORE);
- if (! *table)
- DBUG_RETURN(1);
+ *table= sp_add_to_query_tables(thd, lex, trg_name->m_db.str,
+ tbl_name.str, TL_IGNORE);
- DBUG_RETURN(0);
+ DBUG_RETURN(*table ? FALSE : TRUE);
}
@@ -1264,8 +1604,6 @@ bool Table_triggers_list::drop_all_triggers(THD *thd, char *db, char *name)
bzero(&table, sizeof(table));
init_alloc_root(&table.mem_root, 8192, 0);
- safe_mutex_assert_owner(&LOCK_open);
-
if (Table_triggers_list::check_n_load(thd, db, name, &table, 1))
{
result= 1;
@@ -1344,7 +1682,12 @@ Table_triggers_list::change_table_name_in_triggers(THD *thd,
/* Construct CREATE TRIGGER statement with new table name. */
buff.length(0);
+
+ /* WARNING: 'on_table_name' is supposed to point inside 'def' */
+ DBUG_ASSERT(on_table_name->str > def->str);
+ DBUG_ASSERT(on_table_name->str < (def->str + def->length));
before_on_len= on_table_name->str - def->str;
+
buff.append(def->str, before_on_len);
buff.append(STRING_WITH_LEN("ON "));
append_identifier(thd, &buff, new_table_name->str, new_table_name->length);
@@ -1356,8 +1699,8 @@ Table_triggers_list::change_table_name_in_triggers(THD *thd,
It is OK to allocate some memory on table's MEM_ROOT since this
table instance will be thrown out at the end of rename anyway.
*/
- new_def.str= memdup_root(&trigger_table->mem_root, buff.ptr(),
- buff.length());
+ new_def.str= (char*) memdup_root(&trigger_table->mem_root, buff.ptr(),
+ buff.length());
new_def.length= buff.length();
on_table_name->str= new_def.str + before_on_len;
on_table_name->length= on_q_table_name_len;
@@ -1412,13 +1755,13 @@ Table_triggers_list::change_table_name_in_trignames(const char *db_name,
{
trigname_file.length= build_table_filename(trigname_buff, FN_REFLEN-1,
db_name, trigger->str,
- trigname_file_ext, 0);
+ TRN_EXT, 0);
trigname_file.str= trigname_buff;
trigname.trigger_table= *new_table_name;
if (sql_create_definition_file(NULL, &trigname_file, &trigname_file_type,
- (gptr)&trigname, trigname_file_parameters,
+ (uchar*)&trigname, trigname_file_parameters,
0))
return trigger;
}
@@ -1427,26 +1770,24 @@ Table_triggers_list::change_table_name_in_trignames(const char *db_name,
}
-/*
- Update .TRG and .TRN files after renaming triggers' subject table.
+/**
+ @brief Update .TRG and .TRN files after renaming triggers' subject table.
- SYNOPSIS
- change_table_name()
- thd Thread context
- db Old database of subject table
- old_table Old name of subject table
- new_db New database for subject table
- new_table New name of subject table
+ @param[in,out] thd Thread context
+ @param[in] db Old database of subject table
+ @param[in] old_table Old name of subject table
+ @param[in] new_db New database for subject table
+ @param[in] new_table New name of subject table
- NOTE
+ @note
This method tries to leave trigger related files in consistent state,
i.e. it either will complete successfully, or will fail leaving files
in their initial state.
Also this method assumes that subject table is not renamed to itself.
+ This method needs to be called under an exclusive table name lock.
- RETURN VALUE
- FALSE Success
- TRUE Error
+ @retval FALSE Success
+ @retval TRUE Error
*/
bool Table_triggers_list::change_table_name(THD *thd, const char *db,
@@ -1462,7 +1803,19 @@ bool Table_triggers_list::change_table_name(THD *thd, const char *db,
bzero(&table, sizeof(table));
init_alloc_root(&table.mem_root, 8192, 0);
- safe_mutex_assert_owner(&LOCK_open);
+ /*
+ This method interfaces the mysql server code protected by
+ either LOCK_open mutex or with an exclusive table name lock.
+ In the future, only an exclusive table name lock will be enough.
+ */
+#ifndef DBUG_OFF
+ uchar key[MAX_DBKEY_LENGTH];
+ uint key_length= (uint) (strmov(strmov((char*)&key[0], db)+1,
+ old_table)-(char*)&key[0])+1;
+
+ if (!is_table_name_exclusively_locked_by_this_thread(thd, key, key_length))
+ safe_mutex_assert_owner(&LOCK_open);
+#endif
DBUG_ASSERT(my_strcasecmp(table_alias_charset, db, new_db) ||
my_strcasecmp(table_alias_charset, old_table, new_table));
@@ -1521,77 +1874,60 @@ end:
}
-bool Table_triggers_list::process_triggers(THD *thd, trg_event_type event,
- trg_action_time_type time_type,
- bool old_row_is_record1)
-{
- bool err_status= FALSE;
- sp_head *sp_trigger= bodies[event][time_type];
-
- if (sp_trigger)
- {
- Sub_statement_state statement_state;
-
- if (old_row_is_record1)
- {
- old_field= record1_field;
- new_field= trigger_table->field;
- }
- else
- {
- new_field= record1_field;
- old_field= trigger_table->field;
- }
-#ifndef NO_EMBEDDED_ACCESS_CHECKS
- Security_context *sctx= &sp_trigger->m_security_ctx;
- Security_context *save_ctx= NULL;
-
+/**
+ Execute trigger for given (event, time) pair.
- if (sp_trigger->m_chistics->suid != SP_IS_NOT_SUID &&
- sctx->change_security_context(thd,
- &sp_trigger->m_definer_user,
- &sp_trigger->m_definer_host,
- &sp_trigger->m_db,
- &save_ctx))
- return TRUE;
+ The operation executes trigger for the specified event (insert, update,
+ delete) and time (after, before) if it is set.
- /*
- Fetch information about table-level privileges to GRANT_INFO structure for
- subject table. Check of privileges that will use it and information about
- column-level privileges will happen in Item_trigger_field::fix_fields().
- */
+ @param thd
+ @param event
+ @param time_type
+ @param old_row_is_record1
- fill_effective_table_privileges(thd,
- &subject_table_grants[event][time_type],
- trigger_table->s->db.str,
- trigger_table->s->table_name.str);
+ @return Error status.
+ @retval FALSE on success.
+ @retval TRUE on error.
+*/
- /* Check that the definer has TRIGGER privilege on the subject table. */
+bool Table_triggers_list::process_triggers(THD *thd,
+ trg_event_type event,
+ trg_action_time_type time_type,
+ bool old_row_is_record1)
+{
+ bool err_status;
+ Sub_statement_state statement_state;
+ sp_head *sp_trigger= bodies[event][time_type];
- if (!(subject_table_grants[event][time_type].privilege & TRIGGER_ACL))
- {
- char priv_desc[128];
- get_privilege_desc(priv_desc, sizeof(priv_desc), TRIGGER_ACL);
+ if (sp_trigger == NULL)
+ return FALSE;
- my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0), priv_desc,
- thd->security_ctx->priv_user, thd->security_ctx->host_or_ip,
- trigger_table->s->table_name.str);
+ if (old_row_is_record1)
+ {
+ old_field= record1_field;
+ new_field= trigger_table->field;
+ }
+ else
+ {
+ new_field= record1_field;
+ old_field= trigger_table->field;
+ }
+ /*
+ This trigger must have been processed by the pre-locking
+ algorithm.
+ */
+ DBUG_ASSERT(trigger_table->pos_in_table_list->trg_event_map &
+ static_cast<uint>(1 << static_cast<int>(event)));
- sctx->restore_security_context(thd, save_ctx);
- return TRUE;
- }
-#endif // NO_EMBEDDED_ACCESS_CHECKS
+ thd->reset_sub_statement_state(&statement_state, SUB_STMT_TRIGGER);
- thd->reset_sub_statement_state(&statement_state, SUB_STMT_TRIGGER);
- err_status= sp_trigger->execute_trigger
- (thd, trigger_table->s->db.str, trigger_table->s->table_name.str,
- &subject_table_grants[event][time_type]);
- thd->restore_sub_statement_state(&statement_state);
+ err_status=
+ sp_trigger->execute_trigger(thd,
+ &trigger_table->s->db,
+ &trigger_table->s->table_name,
+ &subject_table_grants[event][time_type]);
-#ifndef NO_EMBEDDED_ACCESS_CHECKS
- sctx->restore_security_context(thd, save_ctx);
-#endif // NO_EMBEDDED_ACCESS_CHECKS
- }
+ thd->restore_sub_statement_state(&statement_state);
return err_status;
}
@@ -1603,7 +1939,7 @@ bool Table_triggers_list::process_triggers(THD *thd, trg_event_type event,
SYNOPSIS
mark_fields_used()
thd Current thread context
- event Type of event triggers for which we are going to inspect
+ event Type of event triggers for which we are going to ins
DESCRIPTION
This method marks fields of subject table which are read/set in its
@@ -1659,7 +1995,7 @@ void Table_triggers_list::mark_fields_used(trg_event_type event)
bool
Handle_old_incorrect_sql_modes_hook::process_unknown_string(char *&unknown_key,
- gptr base,
+ uchar* base,
MEM_ROOT *mem_root,
char *end)
{
@@ -1702,7 +2038,7 @@ Handle_old_incorrect_sql_modes_hook::process_unknown_string(char *&unknown_key,
bool
Handle_old_incorrect_trigger_table_hook::
-process_unknown_string(char *&unknown_key, gptr base, MEM_ROOT *mem_root,
+process_unknown_string(char *&unknown_key, uchar* base, MEM_ROOT *mem_root,
char *end)
{
DBUG_ENTER("Handle_old_incorrect_trigger_table_hook::process_unknown_string");
@@ -1733,3 +2069,95 @@ process_unknown_string(char *&unknown_key, gptr base, MEM_ROOT *mem_root,
}
DBUG_RETURN(FALSE);
}
+
+
+/**
+ Contruct path to TRN-file.
+
+ @param[in] thd Thread context.
+ @param[in] trg_name Trigger name.
+ @param[out] trn_path Variable to store constructed path
+*/
+
+void build_trn_path(THD *thd, const sp_name *trg_name, LEX_STRING *trn_path)
+{
+ /* Construct path to the TRN-file. */
+
+ trn_path->length= build_table_filename(trn_path->str,
+ FN_REFLEN - 1,
+ trg_name->m_db.str,
+ trg_name->m_name.str,
+ TRN_EXT,
+ 0);
+}
+
+
+/**
+ Check if TRN-file exists.
+
+ @return
+ @retval TRUE if TRN-file does not exist.
+ @retval FALSE if TRN-file exists.
+*/
+
+bool check_trn_exists(const LEX_STRING *trn_path)
+{
+ return access(trn_path->str, F_OK) != 0;
+}
+
+
+/**
+ Retrieve table name for given trigger.
+
+ @param[in] thd Thread context.
+ @param[in] trg_name Trigger name.
+ @param[in] trn_path Path to the corresponding TRN-file.
+ @param[out] tbl_name Variable to store retrieved table name.
+
+ @return Error status.
+ @retval FALSE on success.
+ @retval TRUE if table name could not be retrieved.
+*/
+
+bool load_table_name_for_trigger(THD *thd,
+ const sp_name *trg_name,
+ const LEX_STRING *trn_path,
+ LEX_STRING *tbl_name)
+{
+ File_parser *parser;
+ struct st_trigname trn_data;
+
+ Handle_old_incorrect_trigger_table_hook trigger_table_hook(
+ trn_path->str,
+ &trn_data.trigger_table);
+
+ DBUG_ENTER("load_table_name_for_trigger");
+
+ /* Parse the TRN-file. */
+
+ if (!(parser= sql_parse_prepare(trn_path, thd->mem_root, TRUE)))
+ DBUG_RETURN(TRUE);
+
+ if (!is_equal(&trigname_file_type, parser->type()))
+ {
+ my_error(ER_WRONG_OBJECT, MYF(0),
+ trg_name->m_name.str,
+ TRN_EXT + 1,
+ "TRIGGERNAME");
+
+ DBUG_RETURN(TRUE);
+ }
+
+ if (parser->parse((uchar*) &trn_data, thd->mem_root,
+ trigname_file_parameters, 1,
+ &trigger_table_hook))
+ DBUG_RETURN(TRUE);
+
+ /* Copy trigger table name. */
+
+ *tbl_name= trn_data.trigger_table;
+
+ /* That's all. */
+
+ DBUG_RETURN(FALSE);
+}
diff --git a/sql/sql_trigger.h b/sql/sql_trigger.h
index 7d99dd811cd..8f6b08c927f 100644
--- a/sql/sql_trigger.h
+++ b/sql/sql_trigger.h
@@ -17,7 +17,7 @@
/*
This class holds all information about triggers of table.
- QQ: Will it be merged into TABLE in future ?
+ QQ: Will it be merged into TABLE in the future ?
*/
class Table_triggers_list: public Sql_alloc
@@ -56,14 +56,6 @@ class Table_triggers_list: public Sql_alloc
updating trigger definitions during RENAME TABLE.
*/
List<LEX_STRING> on_table_names_list;
- /*
- Key representing triggers for this table in set of all stored
- routines used by statement.
- TODO: We won't need this member once triggers namespace will be
- database-wide instead of table-wide because then we will be able
- to use key based on sp_name as for other stored routines.
- */
- LEX_STRING sroutines_key;
/*
Grant information for each trigger (pair: subject table, trigger definer).
@@ -83,6 +75,14 @@ public:
List<LEX_STRING> definers_list;
+ /* Character set context, used for parsing and executing triggers. */
+
+ List<LEX_STRING> client_cs_names;
+ List<LEX_STRING> connection_cl_names;
+ List<LEX_STRING> db_cl_names;
+
+ /* End of character ser context. */
+
Table_triggers_list(TABLE *table_arg):
record1_field(0), trigger_table(table_arg)
{
@@ -97,11 +97,26 @@ public:
bool process_triggers(THD *thd, trg_event_type event,
trg_action_time_type time_type,
bool old_row_is_record1);
+
bool get_trigger_info(THD *thd, trg_event_type event,
trg_action_time_type time_type,
LEX_STRING *trigger_name, LEX_STRING *trigger_stmt,
ulong *sql_mode,
- LEX_STRING *definer);
+ LEX_STRING *definer,
+ LEX_STRING *client_cs_name,
+ LEX_STRING *connection_cl_name,
+ LEX_STRING *db_cl_name);
+
+ void get_trigger_info(THD *thd,
+ int trigger_idx,
+ LEX_STRING *trigger_name,
+ ulonglong *sql_mode,
+ LEX_STRING *sql_original_stmt,
+ LEX_STRING *client_cs_name,
+ LEX_STRING *connection_cl_name,
+ LEX_STRING *db_cl_name);
+
+ int find_trigger_by_name(const LEX_STRING *trigger_name);
static bool check_n_load(THD *thd, const char *db, const char *table_name,
TABLE *table, bool names_only);
@@ -143,6 +158,17 @@ private:
extern const LEX_STRING trg_action_time_type_names[];
extern const LEX_STRING trg_event_type_names[];
-int
-add_table_for_trigger(THD *thd, sp_name *trig, bool if_exists,
- TABLE_LIST **table);
+bool add_table_for_trigger(THD *thd,
+ const sp_name *trg_name,
+ bool continue_if_not_exist,
+ TABLE_LIST **table);
+
+void build_trn_path(THD *thd, const sp_name *trg_name, LEX_STRING *trn_path);
+
+bool check_trn_exists(const LEX_STRING *trn_path);
+
+bool load_table_name_for_trigger(THD *thd,
+ const sp_name *trg_name,
+ const LEX_STRING *trn_path,
+ LEX_STRING *tbl_name);
+
diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc
index 89084c21c0c..19582af38f4 100644
--- a/sql/sql_udf.cc
+++ b/sql/sql_udf.cc
@@ -92,12 +92,12 @@ static char *init_syms(udf_func *tmp, char *nm)
}
-extern "C" byte* get_hash_key(const byte *buff,uint *length,
+extern "C" uchar* get_hash_key(const uchar *buff, size_t *length,
my_bool not_used __attribute__((unused)))
{
udf_func *udf=(udf_func*) buff;
*length=(uint) udf->name.length;
- return (byte*) udf->name.str;
+ return (uchar*) udf->name.str;
}
@@ -137,7 +137,7 @@ void udf_init()
new_thd->store_globals();
new_thd->set_db(db, sizeof(db)-1);
- bzero((gptr) &tables,sizeof(tables));
+ bzero((uchar*) &tables,sizeof(tables));
tables.alias= tables.table_name= (char*) "func";
tables.lock_type = TL_READ;
tables.db= db;
@@ -169,11 +169,15 @@ void udf_init()
Ensure that the .dll doesn't have a path
This is done to ensure that only approved dll from the system
directories are used (to make this even remotely secure).
+
+ On windows we must check both FN_LIBCHAR and '/'.
*/
if (my_strchr(files_charset_info, dl_name,
- dl_name + strlen(dl_name), FN_LIBCHAR) ||
- check_string_char_length(&name, "", NAME_CHAR_LEN,
- system_charset_info, 1))
+ dl_name + strlen(dl_name), FN_LIBCHAR) ||
+ IF_WIN(my_strchr(files_charset_info, dl_name,
+ dl_name + strlen(dl_name), '/'), 0) ||
+ check_string_char_length(&name, "", NAME_CHAR_LEN,
+ system_charset_info, 1))
{
sql_print_error("Invalid row in mysql.func table for function '%.64s'",
name.str);
@@ -190,10 +194,13 @@ void udf_init()
void *dl = find_udf_dl(tmp->dl);
if (dl == NULL)
{
- if (!(dl= dlopen(tmp->dl, RTLD_NOW)))
+ char dlpath[FN_REFLEN];
+ strxnmov(dlpath, sizeof(dlpath) - 1, opt_plugin_dir, "/", tmp->dl,
+ NullS);
+ if (!(dl= dlopen(dlpath, RTLD_NOW)))
{
/* Print warning to log */
- sql_print_error(ER(ER_CANT_OPEN_LIBRARY), tmp->dl, errno, dlerror());
+ sql_print_error(ER(ER_CANT_OPEN_LIBRARY), tmp->dl, errno, dlerror());
/* Keep the udf in the hash so that we can remove it later */
continue;
}
@@ -260,7 +267,7 @@ static void del_udf(udf_func *udf)
DBUG_ENTER("del_udf");
if (!--udf->usage_count)
{
- hash_delete(&udf_hash,(byte*) udf);
+ hash_delete(&udf_hash,(uchar*) udf);
using_udf_functions=udf_hash.records != 0;
}
else
@@ -274,7 +281,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,(byte*) udf,(byte*) name,name_length);
+ hash_update(&udf_hash,(uchar*) udf,(uchar*) name,name_length);
}
DBUG_VOID_RETURN;
}
@@ -294,7 +301,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,(byte*) udf);
+ hash_delete(&udf_hash,(uchar*) udf);
using_udf_functions=udf_hash.records != 0;
if (!find_udf_dl(udf->dl))
dlclose(udf->dlhandle);
@@ -320,7 +327,7 @@ 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,(byte*) name,
+ if ((udf=(udf_func*) hash_search(&udf_hash,(uchar*) name,
length ? length : (uint) strlen(name))))
{
if (!udf->dlhandle)
@@ -367,7 +374,7 @@ static udf_func *add_udf(LEX_STRING *name, Item_result ret, char *dl,
tmp->returns = ret;
tmp->type = type;
tmp->usage_count=1;
- if (my_hash_insert(&udf_hash,(byte*) tmp))
+ if (my_hash_insert(&udf_hash,(uchar*) tmp))
return 0;
using_udf_functions=1;
return tmp;
@@ -394,8 +401,13 @@ int mysql_create_function(THD *thd,udf_func *udf)
Ensure that the .dll doesn't have a path
This is done to ensure that only approved dll from the system
directories are used (to make this even remotely secure).
+
+ On windows we must check both FN_LIBCHAR and '/'.
*/
- if (my_strchr(files_charset_info, udf->dl, udf->dl + strlen(udf->dl), FN_LIBCHAR))
+ if (my_strchr(files_charset_info, udf->dl,
+ udf->dl + strlen(udf->dl), FN_LIBCHAR) ||
+ IF_WIN(my_strchr(files_charset_info, udf->dl,
+ udf->dl + strlen(udf->dl), '/'), 0))
{
my_message(ER_UDF_NO_PATHS, ER(ER_UDF_NO_PATHS), MYF(0));
DBUG_RETURN(1);
@@ -415,17 +427,19 @@ 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,(byte*) udf->name.str, udf->name.length)))
+ if ((hash_search(&udf_hash,(uchar*) udf->name.str, udf->name.length)))
{
my_error(ER_UDF_EXISTS, MYF(0), udf->name);
goto err;
}
if (!(dl = find_udf_dl(udf->dl)))
{
- if (!(dl = dlopen(udf->dl, RTLD_NOW)))
+ char dlpath[FN_REFLEN];
+ strxnmov(dlpath, sizeof(dlpath) - 1, opt_plugin_dir, "/", udf->dl, NullS);
+ if (!(dl = dlopen(dlpath, RTLD_NOW)))
{
DBUG_PRINT("error",("dlopen of %s failed, error: %d (%s)",
- udf->dl, errno, dlerror()));
+ udf->dl, errno, dlerror()));
my_error(ER_CANT_OPEN_LIBRARY, MYF(0),
udf->dl, errno, dlerror());
goto err;
@@ -458,7 +472,7 @@ int mysql_create_function(THD *thd,udf_func *udf)
tables.db= (char*) "mysql";
tables.table_name= tables.alias= (char*) "func";
/* Allow creation of functions even if we can't open func table */
- if (!(table = open_ltable(thd,&tables,TL_WRITE)))
+ if (!(table = open_ltable(thd, &tables, TL_WRITE, 0)))
goto err;
table->use_all_columns();
restore_record(table, s->default_values); // Default values for fields
@@ -479,12 +493,7 @@ int mysql_create_function(THD *thd,udf_func *udf)
rw_unlock(&THR_LOCK_udf);
/* Binlog the create function. */
- if (mysql_bin_log.is_open())
- {
- thd->clear_error();
- thd->binlog_query(THD::MYSQL_QUERY_TYPE,
- thd->query, thd->query_length, FALSE, FALSE);
- }
+ write_bin_log(thd, TRUE, thd->query, thd->query_length);
DBUG_RETURN(0);
@@ -519,7 +528,7 @@ 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,(byte*) udf_name->str,
+ if (!(udf=(udf_func*) hash_search(&udf_hash,(uchar*) udf_name->str,
(uint) udf_name->length)))
{
my_error(ER_FUNCTION_NOT_DEFINED, MYF(0), udf_name->str);
@@ -538,13 +547,14 @@ int mysql_drop_function(THD *thd,const LEX_STRING *udf_name)
bzero((char*) &tables,sizeof(tables));
tables.db=(char*) "mysql";
tables.table_name= tables.alias= (char*) "func";
- if (!(table = open_ltable(thd,&tables,TL_WRITE)))
+ if (!(table = open_ltable(thd, &tables, TL_WRITE, 0)))
goto err;
table->use_all_columns();
table->field[0]->store(exact_name_str, exact_name_len, &my_charset_bin);
- if (!table->file->index_read_idx(table->record[0], 0,
- (byte*) table->field[0]->ptr, HA_WHOLE_KEY,
- HA_READ_KEY_EXACT))
+ if (!table->file->index_read_idx_map(table->record[0], 0,
+ (uchar*) table->field[0]->ptr,
+ HA_WHOLE_KEY,
+ HA_READ_KEY_EXACT))
{
int error;
if ((error = table->file->ha_delete_row(table->record[0])))
@@ -555,12 +565,7 @@ int mysql_drop_function(THD *thd,const LEX_STRING *udf_name)
rw_unlock(&THR_LOCK_udf);
/* Binlog the drop function. */
- if (mysql_bin_log.is_open())
- {
- thd->clear_error();
- thd->binlog_query(THD::MYSQL_QUERY_TYPE,
- thd->query, thd->query_length, FALSE, FALSE);
- }
+ write_bin_log(thd, TRUE, thd->query, thd->query_length);
DBUG_RETURN(0);
err:
diff --git a/sql/sql_udf.h b/sql/sql_udf.h
index 3cd9343610c..4b8b492698e 100644
--- a/sql/sql_udf.h
+++ b/sql/sql_udf.h
@@ -47,7 +47,6 @@ typedef struct st_udf_func
} udf_func;
class Item_result_field;
-struct st_table_list;
class udf_handler :public Sql_alloc
{
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 2a1db422058..5da4b97cc5d 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -144,17 +144,25 @@ void
st_select_lex_unit::init_prepare_fake_select_lex(THD *thd_arg)
{
thd_arg->lex->current_select= fake_select_lex;
- fake_select_lex->table_list.link_in_list((byte *)&result_table_list,
- (byte **)
+ fake_select_lex->table_list.link_in_list((uchar *)&result_table_list,
+ (uchar **)
&result_table_list.next_local);
- fake_select_lex->context.table_list= fake_select_lex->context.first_name_resolution_table=
+ fake_select_lex->context.table_list=
+ fake_select_lex->context.first_name_resolution_table=
fake_select_lex->get_table_list();
+ if (!fake_select_lex->first_execution)
+ {
+ for (ORDER *order= (ORDER *) global_parameters->order_list.first;
+ order;
+ order= order->next)
+ order->item= &order->item_ptr;
+ }
for (ORDER *order= (ORDER *)global_parameters->order_list.first;
order;
order=order->next)
{
(*order->item)->walk(&Item::change_context_processor, 0,
- (byte*) &fake_select_lex->context);
+ (uchar*) &fake_select_lex->context);
}
}
@@ -539,6 +547,10 @@ bool st_select_lex_unit::exec()
/*
allocate JOIN for fake select only once (prevent
mysql_select automatic allocation)
+ TODO: The above is nonsense. mysql_select() will not allocate the
+ join if one already exists. There must be some other reason why we
+ don't let it allocate the join. Perhaps this is because we need
+ some special parameter values passed to join constructor?
*/
if (!(fake_select_lex->join= new JOIN(thd, item_list,
fake_select_lex->options, result)))
@@ -546,33 +558,52 @@ bool st_select_lex_unit::exec()
fake_select_lex->table_list.empty();
DBUG_RETURN(TRUE);
}
+ fake_select_lex->join->no_const_tables= TRUE;
/*
Fake st_select_lex should have item list for correctref_array
allocation.
*/
fake_select_lex->item_list= item_list;
+ saved_error= mysql_select(thd, &fake_select_lex->ref_pointer_array,
+ &result_table_list,
+ 0, item_list, NULL,
+ global_parameters->order_list.elements,
+ (ORDER*)global_parameters->order_list.first,
+ (ORDER*) NULL, NULL, (ORDER*) NULL,
+ fake_select_lex->options | SELECT_NO_UNLOCK,
+ result, this, fake_select_lex);
}
else
{
- JOIN_TAB *tab,*end;
- for (tab=join->join_tab, end=tab+join->tables ;
- tab && tab != end ;
- tab++)
- {
- delete tab->select;
- delete tab->quick;
- }
- join->init(thd, item_list, fake_select_lex->options, result);
+ if (describe)
+ {
+ /*
+ In EXPLAIN command, constant subqueries that do not use any
+ tables are executed two times:
+ - 1st time is a real evaluation to get the subquery value
+ - 2nd time is to produce EXPLAIN output rows.
+ 1st execution sets certain members (e.g. select_result) to perform
+ subquery execution rather than EXPLAIN line production. In order
+ to reset them back, we re-do all of the actions (yes it is ugly):
+ */
+ join->init(thd, item_list, fake_select_lex->options, result);
+ saved_error= mysql_select(thd, &fake_select_lex->ref_pointer_array,
+ &result_table_list,
+ 0, item_list, NULL,
+ global_parameters->order_list.elements,
+ (ORDER*)global_parameters->order_list.first,
+ (ORDER*) NULL, NULL, (ORDER*) NULL,
+ fake_select_lex->options | SELECT_NO_UNLOCK,
+ result, this, fake_select_lex);
+ }
+ else
+ {
+ join->examined_rows= 0;
+ saved_error= join->reinit();
+ join->exec();
+ }
}
- saved_error= mysql_select(thd, &fake_select_lex->ref_pointer_array,
- &result_table_list,
- 0, item_list, NULL,
- global_parameters->order_list.elements,
- (ORDER*)global_parameters->order_list.first,
- (ORDER*) NULL, NULL, (ORDER*) NULL,
- fake_select_lex->options | SELECT_NO_UNLOCK,
- result, this, fake_select_lex);
fake_select_lex->table_list.empty();
if (!saved_error)
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 851420f3f86..fff12c74840 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -83,6 +83,75 @@ static bool check_fields(THD *thd, List<Item> &items)
}
+/**
+ @brief Re-read record if more columns are needed for error message.
+
+ If we got a duplicate key error, we want to write an error
+ message containing the value of the duplicate key. If we do not have
+ all fields of the key value in record[0], we need to re-read the
+ record with a proper read_set.
+
+ @param[in] error error number
+ @param[in] table table
+*/
+
+static void prepare_record_for_error_message(int error, TABLE *table)
+{
+ Field **field_p;
+ Field *field;
+ uint keynr;
+ MY_BITMAP unique_map; /* Fields in offended unique. */
+ my_bitmap_map unique_map_buf[bitmap_buffer_size(MAX_FIELDS)];
+ DBUG_ENTER("prepare_record_for_error_message");
+
+ /*
+ Only duplicate key errors print the key value.
+ If storage engine does always read all columns, we have the value alraedy.
+ */
+ if ((error != HA_ERR_FOUND_DUPP_KEY) ||
+ !(table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ))
+ DBUG_VOID_RETURN;
+
+ /*
+ Get the number of the offended index.
+ We will see MAX_KEY if the engine cannot determine the affected index.
+ */
+ if ((keynr= table->file->get_dup_key(error)) >= MAX_KEY)
+ DBUG_VOID_RETURN;
+
+ /* Create unique_map with all fields used by that index. */
+ bitmap_init(&unique_map, unique_map_buf, table->s->fields, FALSE);
+ table->mark_columns_used_by_index_no_reset(keynr, &unique_map);
+
+ /* Subtract read_set and write_set. */
+ bitmap_subtract(&unique_map, table->read_set);
+ bitmap_subtract(&unique_map, table->write_set);
+
+ /*
+ If the unique index uses columns that are neither in read_set
+ nor in write_set, we must re-read the record.
+ Otherwise no need to do anything.
+ */
+ if (bitmap_is_clear_all(&unique_map))
+ DBUG_VOID_RETURN;
+
+ /* Get identifier of last read record into table->file->ref. */
+ table->file->position(table->record[0]);
+ /* Add all fields used by unique index to read_set. */
+ bitmap_union(table->read_set, &unique_map);
+ /* Tell the engine about the new set. */
+ table->file->column_bitmaps_signal();
+ /* Read record that is identified by table->file->ref. */
+ (void) table->file->rnd_pos(table->record[1], table->file->ref);
+ /* Copy the newly read columns into the new record. */
+ for (field_p= table->field; (field= *field_p); field_p++)
+ if (bitmap_is_set(&unique_map, field->field_index))
+ field->copy_from_tmp(table->s->rec_buff_length);
+
+ DBUG_VOID_RETURN;
+}
+
+
/*
Process usual UPDATE
@@ -170,8 +239,9 @@ int mysql_update(THD *thd,
table->quick_keys.clear_all();
#ifndef NO_EMBEDDED_ACCESS_CHECKS
- /* TABLE_LIST contain right privilages request */
- want_privilege= table_list->grant.want_privilege;
+ /* Force privilege re-checking for views after they have been opened. */
+ want_privilege= (table_list->view ? UPDATE_ACL :
+ table_list->grant.want_privilege);
#endif
if (mysql_prepare_update(thd, table_list, &conds, order_num, order))
DBUG_RETURN(1);
@@ -230,6 +300,17 @@ int mysql_update(THD *thd,
if (cond_value == Item::COND_FALSE)
limit= 0; // Impossible WHERE
}
+
+ /*
+ If a timestamp field settable on UPDATE is present then to avoid wrong
+ update force the table handler to retrieve write-only fields to be able
+ to compare records and detect data change.
+ */
+ if (table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ &&
+ table->timestamp_field &&
+ (table->timestamp_field_type == TIMESTAMP_AUTO_SET_ON_UPDATE ||
+ table->timestamp_field_type == TIMESTAMP_AUTO_SET_ON_BOTH))
+ bitmap_union(table->read_set, table->write_set);
// Don't count on usage of 'only index' when calculating which key to use
table->covering_keys.clear_all();
@@ -380,7 +461,7 @@ int mysql_update(THD *thd,
init_read_record_idx(&info, thd, table, 1, used_index);
thd_proc_info(thd, "Searching rows for update");
- uint tmp_limit= limit;
+ ha_rows tmp_limit= limit;
while (!(error=info.read_record(&info)) && !thd->killed)
{
@@ -449,7 +530,6 @@ int mysql_update(THD *thd,
thd_proc_info(thd, "Updating");
transactional_table= table->file->has_transactions();
- thd->no_trans_update.stmt= FALSE;
thd->abort_on_warning= test(!ignore &&
(thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES |
@@ -470,6 +550,13 @@ int mysql_update(THD *thd,
will_batch= !table->file->start_bulk_update();
/*
+ Assure that we can use position()
+ if we need to create an error message.
+ */
+ if (table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ)
+ table->prepare_for_position();
+
+ /*
We can use compare_record() to optimize away updates if
the table handler is returning all columns OR if
if all updated columns are read
@@ -544,13 +631,15 @@ int mysql_update(THD *thd,
else
{
/* Non-batched update */
- error= table->file->ha_update_row((byte*) table->record[1],
- (byte*) table->record[0]);
+ error= table->file->ha_update_row(table->record[1],
+ table->record[0]);
}
- if (!error)
+ if (!error || error == HA_ERR_RECORD_IS_THE_SAME)
{
- updated++;
- thd->no_trans_update.stmt= !transactional_table;
+ if (error != HA_ERR_RECORD_IS_THE_SAME)
+ updated++;
+ else
+ error= 0;
if (table->triggers &&
table->triggers->process_triggers(thd, TRG_EVENT_UPDATE,
@@ -569,6 +658,8 @@ int mysql_update(THD *thd,
*/
if (table->file->is_fatal_error(error, HA_CHECK_DUP_KEY))
thd->fatal_error(); /* Other handler errors are fatal */
+
+ prepare_record_for_error_message(error, table);
table->file->print_error(error,MYF(0));
error= 1;
break;
@@ -592,13 +683,16 @@ int mysql_update(THD *thd,
{
if (error)
{
+ /* purecov: begin inspected */
/*
The handler should not report error of duplicate keys if they
are ignored. This is a requirement on batching handlers.
*/
+ prepare_record_for_error_message(error, table);
table->file->print_error(error,MYF(0));
error= 1;
break;
+ /* purecov: end */
}
/*
Either an error was found and we are ignoring errors or there
@@ -620,6 +714,41 @@ int mysql_update(THD *thd,
thd->row_count++;
}
dup_key_found= 0;
+
+ if (!transactional_table && updated > 0)
+ thd->transaction.stmt.modified_non_trans_table= TRUE;
+
+
+ /*
+ todo bug#27571: to avoid asynchronization of `error' and
+ `error_code' of binlog event constructor
+
+ The concept, which is a bit different for insert(!), is to
+ replace `error' assignment with the following lines
+
+ killed_status= thd->killed; // get the status of the volatile
+
+ Notice: thd->killed is type of "state" whereas the lhs has
+ "status" the suffix which translates according to WordNet: a state
+ at a particular time - at the time of the end of per-row loop in
+ our case. Binlogging ops are conducted with the status.
+
+ error= (killed_status == THD::NOT_KILLED)? error : 1;
+
+ which applies to most mysql_$query functions.
+ Event's constructor will accept `killed_status' as an argument:
+
+ Query_log_event qinfo(..., killed_status);
+
+ thd->killed might be changed after killed_status had got cached and this
+ won't affect binlogging event but other effects remain.
+
+ Open issue: In a case the error happened not because of KILLED -
+ and then KILLED was caught later still within the loop - we shall
+ do something to avoid binlogging of incorrect ER_SERVER_SHUTDOWN
+ error_code.
+ */
+
if (thd->killed && !error)
error= 1; // Aborted
else if (will_batch &&
@@ -633,9 +762,12 @@ int mysql_update(THD *thd,
in the batched update.
*/
{
+ /* purecov: begin inspected */
thd->fatal_error();
+ prepare_record_for_error_message(loc_error, table);
table->file->print_error(loc_error,MYF(0));
error= 1;
+ /* purecov: end */
}
else
updated-= dup_key_found;
@@ -679,9 +811,10 @@ int mysql_update(THD *thd,
error=1; // Rollback update
}
}
- if (!transactional_table)
- thd->no_trans_update.all= TRUE;
+ if (thd->transaction.stmt.modified_non_trans_table)
+ thd->transaction.all.modified_non_trans_table= TRUE;
}
+ DBUG_ASSERT(transactional_table || !updated || thd->transaction.stmt.modified_non_trans_table);
free_underlaid_joins(thd, select_lex);
if (transactional_table)
{
@@ -935,7 +1068,7 @@ reopen_tables:
if (check_access(thd, want_privilege,
tl->db, &tl->grant.privilege, 0, 0,
test(tl->schema_table)) ||
- (grant_option && check_grant(thd, want_privilege, tl, 0, 1, 0)))
+ check_grant(thd, want_privilege, tl, 0, 1, 0))
DBUG_RETURN(TRUE);
}
}
@@ -1037,6 +1170,7 @@ bool mysql_multi_update(THD *thd,
SELECT_LEX_UNIT *unit, SELECT_LEX *select_lex)
{
multi_update *result;
+ bool res;
DBUG_ENTER("mysql_multi_update");
if (!(result= new multi_update(table_list,
@@ -1045,13 +1179,12 @@ bool mysql_multi_update(THD *thd,
handle_duplicates, ignore)))
DBUG_RETURN(TRUE);
- thd->no_trans_update.stmt= FALSE;
thd->abort_on_warning= test(thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES |
MODE_STRICT_ALL_TABLES));
List<Item> total_list;
- (void) mysql_select(thd, &select_lex->ref_pointer_array,
+ res= mysql_select(thd, &select_lex->ref_pointer_array,
table_list, select_lex->with_wild,
total_list,
conds, 0, (ORDER *) NULL, (ORDER *)NULL, (Item *) NULL,
@@ -1059,6 +1192,15 @@ bool mysql_multi_update(THD *thd,
options | SELECT_NO_JOIN_CACHE | SELECT_NO_UNLOCK |
OPTION_SETUP_TABLES_DONE,
result, unit, select_lex);
+ DBUG_PRINT("info",("res: %d report_error: %d", res,
+ thd->net.report_error));
+ res|= thd->net.report_error;
+ if (unlikely(res))
+ {
+ /* If we had a another error reported earlier then this will be ignored */
+ result->send_error(ER_UNKNOWN_ERROR, ER(ER_UNKNOWN_ERROR));
+ result->abort();
+ }
delete result;
thd->abort_on_warning= 0;
DBUG_RETURN(FALSE);
@@ -1092,6 +1234,7 @@ int multi_update::prepare(List<Item> &not_used_values,
List_iterator_fast<Item> field_it(*fields);
List_iterator_fast<Item> value_it(*values);
uint i, max_fields;
+ uint leaf_table_count= 0;
DBUG_ENTER("multi_update::prepare");
thd->count_cuted_fields= CHECK_FIELD_WARN;
@@ -1125,13 +1268,14 @@ int multi_update::prepare(List<Item> &not_used_values,
{
/* TODO: add support of view of join support */
TABLE *table=table_ref->table;
+ leaf_table_count++;
if (tables_to_update & table->map)
{
TABLE_LIST *tl= (TABLE_LIST*) thd->memdup((char*) table_ref,
sizeof(*tl));
if (!tl)
DBUG_RETURN(1);
- update.link_in_list((byte*) tl, (byte**) &tl->next_local);
+ update.link_in_list((uchar*) tl, (uchar**) &tl->next_local);
tl->shared= table_count++;
table->no_keyread=1;
table->covering_keys.clear_all();
@@ -1186,7 +1330,7 @@ int multi_update::prepare(List<Item> &not_used_values,
/* Allocate copy fields */
max_fields=0;
for (i=0 ; i < table_count ; i++)
- set_if_bigger(max_fields, fields_for_table[i]->elements);
+ set_if_bigger(max_fields, fields_for_table[i]->elements + leaf_table_count);
copy_field= new Copy_field[max_fields];
DBUG_RETURN(thd->is_fatal_error != 0);
}
@@ -1277,13 +1421,22 @@ multi_update::initialize_tables(JOIN *join)
trans_safe= transactional_tables= main_table->file->has_transactions();
table_to_update= 0;
+ /* Any update has at least one pair (field, value) */
+ DBUG_ASSERT(fields->elements);
+ /*
+ Only one table may be modified by UPDATE of an updatable view.
+ For an updatable view first_table_for_update indicates this
+ table.
+ For a regular multi-update it refers to some updated table.
+ */
+ TABLE *first_table_for_update= ((Item_field *) fields->head())->field->table;
+
/* Create a temporary table for keys to all tables, except main table */
for (table_ref= update_tables; table_ref; table_ref= table_ref->next_local)
{
TABLE *table=table_ref->table;
uint cnt= table_ref->shared;
- Item_field *ifield;
- List<Item> temp_fields= *fields_for_table[cnt];
+ List<Item> temp_fields;
ORDER group;
TMP_TABLE_PARAM *tmp_param;
@@ -1300,27 +1453,56 @@ multi_update::initialize_tables(JOIN *join)
}
table->prepare_for_position();
+ if (table == first_table_for_update && table_ref->check_option)
+ {
+ table_map unupdated_tables= table_ref->check_option->used_tables() &
+ ~first_table_for_update->map;
+ for (TABLE_LIST *tbl_ref =leaves;
+ unupdated_tables && tbl_ref;
+ tbl_ref= tbl_ref->next_leaf)
+ {
+ if (unupdated_tables & tbl_ref->table->map)
+ unupdated_tables&= ~tbl_ref->table->map;
+ else
+ continue;
+ if (unupdated_check_opt_tables.push_back(tbl_ref->table))
+ DBUG_RETURN(1);
+ }
+ }
+
tmp_param= tmp_table_param+cnt;
+
/*
Create a temporary table to store all fields that are changed for this
table. The first field in the temporary table is a pointer to the
- original row so that we can find and update it
+ original row so that we can find and update it. For the updatable
+ VIEW a few following fields are rowids of tables used in the CHECK
+ OPTION condition.
*/
- /* ok to be on stack as this is not referenced outside of this func */
- Field_string offset(table->file->ref_length, 0, "offset",
- &my_charset_bin);
- offset.init(table);
- /*
- The field will be converted to varstring when creating tmp table if
- table to be updated was created by mysql 4.1. Deny this.
- */
- offset.can_alter_field_type= 0;
- if (!(ifield= new Item_field(((Field *) &offset))))
- DBUG_RETURN(1);
- ifield->maybe_null= 0;
- if (temp_fields.push_front(ifield))
- DBUG_RETURN(1);
+ List_iterator_fast<TABLE> tbl_it(unupdated_check_opt_tables);
+ TABLE *tbl= table;
+ do
+ {
+ Field_string *field= new Field_string(tbl->file->ref_length, 0,
+ tbl->alias, &my_charset_bin);
+ if (!field)
+ DBUG_RETURN(1);
+ field->init(tbl);
+ /*
+ The field will be converted to varstring when creating tmp table if
+ table to be updated was created by mysql 4.1. Deny this.
+ */
+ field->can_alter_field_type= 0;
+ Item_field *ifield= new Item_field((Field *) field);
+ if (!ifield)
+ DBUG_RETURN(1);
+ ifield->maybe_null= 0;
+ if (temp_fields.push_back(ifield))
+ DBUG_RETURN(1);
+ } while ((tbl= tbl_it++));
+
+ temp_fields.concat(fields_for_table[cnt]);
/* Make an unique key over the first field to avoid duplicated updates */
bzero((char*) &group, sizeof(group));
@@ -1369,8 +1551,8 @@ multi_update::~multi_update()
if (copy_field)
delete [] copy_field;
thd->count_cuted_fields= CHECK_FIELD_IGNORE; // Restore this setting
- if (!trans_safe)
- thd->no_trans_update.all= TRUE;
+ DBUG_ASSERT(trans_safe || !updated ||
+ thd->transaction.all.modified_non_trans_table);
}
@@ -1441,7 +1623,8 @@ bool multi_update::send_data(List<Item> &not_used_values)
main_table->file->extra(HA_EXTRA_PREPARE_FOR_UPDATE);
}
if ((error=table->file->ha_update_row(table->record[1],
- table->record[0])))
+ table->record[0])) &&
+ error != HA_ERR_RECORD_IS_THE_SAME)
{
updated--;
if (!ignore ||
@@ -1453,14 +1636,28 @@ bool multi_update::send_data(List<Item> &not_used_values)
*/
if (table->file->is_fatal_error(error, HA_CHECK_DUP_KEY))
thd->fatal_error(); /* Other handler errors are fatal */
+
+ prepare_record_for_error_message(error, table);
table->file->print_error(error,MYF(0));
DBUG_RETURN(1);
}
}
else
{
- if (!table->file->has_transactions())
- thd->no_trans_update.stmt= TRUE;
+ if (error == HA_ERR_RECORD_IS_THE_SAME)
+ {
+ error= 0;
+ updated--;
+ }
+ /* non-transactional or transactional table got modified */
+ /* either multi_update class' flag is raised in its branch */
+ if (table->file->has_transactions())
+ transactional_tables= 1;
+ else
+ {
+ trans_safe= 0;
+ thd->transaction.stmt.modified_non_trans_table= TRUE;
+ }
if (table->triggers &&
table->triggers->process_triggers(thd, TRG_EVENT_UPDATE,
TRG_ACTION_AFTER, TRUE))
@@ -1472,11 +1669,26 @@ bool multi_update::send_data(List<Item> &not_used_values)
{
int error;
TABLE *tmp_table= tmp_tables[offset];
- table->file->position(table->record[0]);
- fill_record(thd, tmp_table->field+1, *values_for_table[offset], 1);
- /* Store pointer to row */
- memcpy((char*) tmp_table->field[0]->ptr,
- (char*) table->file->ref, table->file->ref_length);
+ /*
+ For updatable VIEW store rowid of the updated table and
+ rowids of tables used in the CHECK OPTION condition.
+ */
+ uint field_num= 0;
+ List_iterator_fast<TABLE> tbl_it(unupdated_check_opt_tables);
+ TABLE *tbl= table;
+ do
+ {
+ tbl->file->position(tbl->record[0]);
+ memcpy((char*) tmp_table->field[field_num]->ptr,
+ (char*) tbl->file->ref, tbl->file->ref_length);
+ field_num++;
+ } while ((tbl= tbl_it++));
+
+ /* Store regular updated fields in the row. */
+ fill_record(thd,
+ tmp_table->field + 1 + unupdated_check_opt_tables.elements,
+ *values_for_table[offset], 1);
+
/* Write row, ignoring duplicated updates to a row */
error= tmp_table->file->ha_write_row(tmp_table->record[0]);
if (error != HA_ERR_FOUND_DUPP_KEY && error != HA_ERR_FOUND_DUPP_UNIQUE)
@@ -1502,23 +1714,54 @@ void multi_update::send_error(uint errcode,const char *err)
my_error(errcode, MYF(0), err);
/* If nothing updated return */
- if (!updated)
- return;
+ if (updated == 0) /* the counter might be reset in send_eof */
+ return; /* and then the query has been binlogged */
/* Something already updated so we have to invalidate cache */
query_cache_invalidate3(thd, update_tables, 1);
-
/*
If all tables that has been updated are trans safe then just do rollback.
If not attempt to do remaining updates.
*/
if (trans_safe)
- ha_rollback_stmt(thd);
- else if (do_update && table_count > 1)
{
- /* Add warning here */
- VOID(do_updates(0));
+ DBUG_ASSERT(transactional_tables);
+ (void) ha_autocommit_or_rollback(thd, 1);
+ }
+ else
+ {
+ DBUG_ASSERT(thd->transaction.stmt.modified_non_trans_table);
+ if (do_update && table_count > 1)
+ {
+ /* Add warning here */
+ /*
+ todo/fixme: do_update() is never called with the arg 1.
+ should it change the signature to become argless?
+ */
+ VOID(do_updates(0));
+ }
+ }
+ if (thd->transaction.stmt.modified_non_trans_table)
+ {
+ /*
+ The query has to binlog because there's a modified non-transactional table
+ either from the query's list or via a stored routine: bug#13270,23333
+ */
+ if (mysql_bin_log.is_open())
+ {
+ thd->binlog_query(THD::ROW_QUERY_TYPE,
+ thd->query, thd->query_length,
+ transactional_tables, FALSE);
+ }
+ if (!trans_safe)
+ thd->transaction.all.modified_non_trans_table= TRUE;
+ }
+ DBUG_ASSERT(trans_safe || !updated || thd->transaction.stmt.modified_non_trans_table);
+
+ if (transactional_tables)
+ {
+ (void) ha_autocommit_or_rollback(thd, 1);
}
}
@@ -1526,18 +1769,19 @@ void multi_update::send_error(uint errcode,const char *err)
int multi_update::do_updates(bool from_send_error)
{
TABLE_LIST *cur_table;
- int local_error;
+ int local_error= 0;
ha_rows org_updated;
TABLE *table, *tmp_table;
- DBUG_ENTER("do_updates");
+ List_iterator_fast<TABLE> check_opt_it(unupdated_check_opt_tables);
+ DBUG_ENTER("multi_update::do_updates");
do_update= 0; // Don't retry this function
if (!found)
DBUG_RETURN(0);
for (cur_table= update_tables; cur_table; cur_table= cur_table->next_local)
{
- byte *ref_pos;
bool can_compare_record;
+ uint offset= cur_table->shared;
table = cur_table->table;
if (table == table_to_update)
@@ -1548,11 +1792,20 @@ int multi_update::do_updates(bool from_send_error)
(void) table->file->ha_rnd_init(0);
table->file->extra(HA_EXTRA_NO_CACHE);
+ check_opt_it.rewind();
+ while(TABLE *tbl= check_opt_it++)
+ {
+ if (tbl->file->ha_rnd_init(1))
+ goto err;
+ tbl->file->extra(HA_EXTRA_CACHE);
+ }
+
/*
Setup copy functions to copy fields from temporary table
*/
- List_iterator_fast<Item> field_it(*fields_for_table[cur_table->shared]);
- Field **field= tmp_table->field+1; // Skip row pointer
+ List_iterator_fast<Item> field_it(*fields_for_table[offset]);
+ Field **field= tmp_table->field +
+ 1 + unupdated_check_opt_tables.elements; // Skip row pointers
Copy_field *copy_field_ptr= copy_field, *copy_field_end;
for ( ; *field ; field++)
{
@@ -1569,7 +1822,6 @@ int multi_update::do_updates(bool from_send_error)
bitmap_is_subset(table->write_set,
table->read_set));
- ref_pos= (byte*) tmp_table->field[0]->ptr;
for (;;)
{
if (thd->killed && trans_safe)
@@ -1582,8 +1834,20 @@ int multi_update::do_updates(bool from_send_error)
continue; // May happen on dup key
goto err;
}
- if ((local_error= table->file->rnd_pos(table->record[0], ref_pos)))
- goto err;
+
+ /* call rnd_pos() using rowids from temporary table */
+ check_opt_it.rewind();
+ TABLE *tbl= table;
+ uint field_num= 0;
+ do
+ {
+ if((local_error=
+ tbl->file->rnd_pos(tbl->record[0],
+ (uchar *) tmp_table->field[field_num]->ptr)))
+ goto err;
+ field_num++;
+ } while((tbl= check_opt_it++));
+
table->status|= STATUS_UPDATED;
store_record(table,record[1]);
@@ -1610,13 +1874,17 @@ int multi_update::do_updates(bool from_send_error)
goto err;
}
if ((local_error=table->file->ha_update_row(table->record[1],
- table->record[0])))
+ table->record[0])) &&
+ local_error != HA_ERR_RECORD_IS_THE_SAME)
{
if (!ignore ||
table->file->is_fatal_error(local_error, HA_CHECK_DUP_KEY))
goto err;
}
- updated++;
+ if (local_error != HA_ERR_RECORD_IS_THE_SAME)
+ updated++;
+ else
+ local_error= 0;
if (table->triggers &&
table->triggers->process_triggers(thd, TRG_EVENT_UPDATE,
@@ -1628,12 +1896,19 @@ int multi_update::do_updates(bool from_send_error)
if (updated != org_updated)
{
if (table->file->has_transactions())
- transactional_tables= 1;
+ transactional_tables= 1;
else
- trans_safe= 0; // Can't do safe rollback
+ {
+ trans_safe= 0; // Can't do safe rollback
+ thd->transaction.stmt.modified_non_trans_table= TRUE;
+ }
}
(void) table->file->ha_rnd_end();
(void) tmp_table->file->ha_rnd_end();
+ check_opt_it.rewind();
+ while (TABLE *tbl= check_opt_it++)
+ tbl->file->ha_rnd_end();
+
}
DBUG_RETURN(0);
@@ -1641,19 +1916,26 @@ err:
if (!from_send_error)
{
thd->fatal_error();
+ prepare_record_for_error_message(local_error, table);
table->file->print_error(local_error,MYF(0));
}
err2:
(void) table->file->ha_rnd_end();
(void) tmp_table->file->ha_rnd_end();
+ check_opt_it.rewind();
+ while (TABLE *tbl= check_opt_it++)
+ tbl->file->ha_rnd_end();
if (updated != org_updated)
{
if (table->file->has_transactions())
transactional_tables= 1;
else
+ {
trans_safe= 0;
+ thd->transaction.stmt.modified_non_trans_table= TRUE;
+ }
}
DBUG_RETURN(1);
}
@@ -1665,6 +1947,7 @@ bool multi_update::send_eof()
{
char buff[STRING_BUFFER_USUAL_SIZE];
ulonglong id;
+ DBUG_ENTER("multi_update::send_eof");
thd_proc_info(thd, "updating reference tables");
/* Does updates for the last n - 1 tables, returns 0 if ok */
@@ -1678,19 +1961,25 @@ bool multi_update::send_eof()
{
query_cache_invalidate3(thd, update_tables, 1);
}
-
/*
Write the SQL statement to the binlog if we updated
rows and we succeeded or if we updated some non
transactional tables.
+
+ The query has to binlog because there's a modified non-transactional table
+ either from the query's list or via a stored routine: bug#13270,23333
*/
- if ((local_error == 0) || (updated && !trans_safe))
+ DBUG_ASSERT(trans_safe || !updated ||
+ thd->transaction.stmt.modified_non_trans_table);
+ if (local_error == 0 || thd->transaction.stmt.modified_non_trans_table)
{
if (mysql_bin_log.is_open())
{
if (local_error == 0)
thd->clear_error();
+ else
+ updated= 0; /* if there's an error binlog it here not in ::send_error */
if (thd->binlog_query(THD::ROW_QUERY_TYPE,
thd->query, thd->query_length,
transactional_tables, FALSE) &&
@@ -1699,8 +1988,8 @@ bool multi_update::send_eof()
local_error= 1; // Rollback update
}
}
- if (!transactional_tables)
- thd->no_trans_update.all= TRUE;
+ if (thd->transaction.stmt.modified_non_trans_table)
+ thd->transaction.all.modified_non_trans_table= TRUE;
}
if (transactional_tables)
@@ -1711,10 +2000,10 @@ bool multi_update::send_eof()
if (local_error > 0) // if the above log write did not fail ...
{
- /* Safety: If we haven't got an error before (should not happen) */
+ /* Safety: If we haven't got an error before (can happen in do_updates) */
my_message(ER_UNKNOWN_ERROR, "An error occured in multi-table update",
MYF(0));
- return TRUE;
+ DBUG_RETURN(TRUE);
}
id= thd->arg_of_last_insert_id_function ?
@@ -1724,5 +2013,5 @@ bool multi_update::send_eof()
thd->row_count_func=
(thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated;
::send_ok(thd, (ulong) thd->row_count_func, id, buff);
- return FALSE;
+ DBUG_RETURN(FALSE);
}
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index d2d5d178bdb..4de9c180afc 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -205,18 +205,17 @@ fill_defined_view_parts (THD *thd, TABLE_LIST *view)
}
-/*
- Creating/altering VIEW procedure
+/**
+ @brief Creating/altering VIEW procedure
- SYNOPSIS
- mysql_create_view()
- thd - thread handler
- views - views to create
- mode - VIEW_CREATE_NEW, VIEW_ALTER, VIEW_CREATE_OR_REPLACE
+ @param thd thread handler
+ @param views views to create
+ @param mode VIEW_CREATE_NEW, VIEW_ALTER, VIEW_CREATE_OR_REPLACE
- RETURN VALUE
- FALSE OK
- TRUE Error
+ @note This function handles both create and alter view commands.
+
+ @retval FALSE Operation was a success.
+ @retval TRUE An error occured.
*/
bool mysql_create_view(THD *thd, TABLE_LIST *views,
@@ -322,11 +321,11 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
*/
if ((check_access(thd, CREATE_VIEW_ACL, view->db, &view->grant.privilege,
0, 0, is_schema_db(view->db)) ||
- grant_option && check_grant(thd, CREATE_VIEW_ACL, view, 0, 1, 0)) ||
+ check_grant(thd, CREATE_VIEW_ACL, view, 0, 1, 0)) ||
(mode != VIEW_CREATE_NEW &&
(check_access(thd, DROP_ACL, view->db, &view->grant.privilege,
0, 0, is_schema_db(view->db)) ||
- grant_option && check_grant(thd, DROP_ACL, view, 0, 1, 0))))
+ check_grant(thd, DROP_ACL, view, 0, 1, 0))))
{
res= TRUE;
goto err;
@@ -379,7 +378,7 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
{
if (check_access(thd, SELECT_ACL, tbl->db,
&tbl->grant.privilege, 0, 0, test(tbl->schema_table)) ||
- grant_option && check_grant(thd, SELECT_ACL, tbl, 0, 1, 0))
+ check_grant(thd, SELECT_ACL, tbl, 0, 1, 0))
{
res= TRUE;
goto err;
@@ -398,7 +397,13 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
{
Item_field *field;
if ((field= item->filed_for_view_update()))
+ {
+ /*
+ any_privileges may be reset later by the Item_field::set_field
+ method in case of a system temporary table.
+ */
field->any_privileges= 1;
+ }
}
}
#endif
@@ -611,8 +616,8 @@ err:
/* index of revision number in following table */
static const int revision_number_position= 8;
-/* index of last required parameter for making view */
-static const int required_view_parameters= 10;
+/* number of required parameters for making view */
+static const int required_view_parameters= 16;
/* number of backups */
static const int num_view_backups= 3;
@@ -624,7 +629,7 @@ static const int num_view_backups= 3;
*/
static File_option view_parameters[]=
{{{ C_STRING_WITH_LEN("query")},
- my_offsetof(TABLE_LIST, query),
+ my_offsetof(TABLE_LIST, select_stmt),
FILE_OPTIONS_ESTRING},
{{ C_STRING_WITH_LEN("md5")},
my_offsetof(TABLE_LIST, md5),
@@ -659,6 +664,15 @@ static File_option view_parameters[]=
{{ C_STRING_WITH_LEN("source")},
my_offsetof(TABLE_LIST, source),
FILE_OPTIONS_ESTRING},
+ {{(char*) STRING_WITH_LEN("client_cs_name")},
+ my_offsetof(TABLE_LIST, view_client_cs_name),
+ FILE_OPTIONS_STRING},
+ {{(char*) STRING_WITH_LEN("connection_cl_name")},
+ my_offsetof(TABLE_LIST, view_connection_cl_name),
+ FILE_OPTIONS_STRING},
+ {{(char*) STRING_WITH_LEN("view_body_utf8")},
+ my_offsetof(TABLE_LIST, view_body_utf8),
+ FILE_OPTIONS_STRING},
{{NullS, 0}, 0,
FILE_OPTIONS_STRING}
};
@@ -686,25 +700,74 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
{
LEX *lex= thd->lex;
char buff[4096];
- String str(buff,(uint32) sizeof(buff), system_charset_info);
+ String view_query(buff, sizeof (buff), thd->charset());
char md5[MD5_BUFF_LENGTH];
bool can_be_merged;
char dir_buff[FN_REFLEN], path_buff[FN_REFLEN];
- const char *endp;
LEX_STRING dir, file, path;
+ int error= 0;
DBUG_ENTER("mysql_register_view");
/* print query */
- str.length(0);
+ view_query.length(0);
{
ulong sql_mode= thd->variables.sql_mode & MODE_ANSI_QUOTES;
thd->variables.sql_mode&= ~MODE_ANSI_QUOTES;
- lex->unit.print(&str);
+ lex->unit.print(&view_query);
thd->variables.sql_mode|= sql_mode;
}
- str.append('\0');
- DBUG_PRINT("info", ("View: %s", str.ptr()));
+ DBUG_PRINT("info", ("View: %s", view_query.ptr()));
+ /* fill structure */
+ view->select_stmt.str= view_query.c_ptr_safe();
+ view->select_stmt.length= view_query.length();
+
+ view->source.str= (char*) thd->lex->create_view_select_start;
+ view->source.length= (thd->lex->create_view_select_end
+ - thd->lex->create_view_select_start);
+ trim_whitespace(thd->charset(), & view->source);
+
+ view->file_version= 1;
+ view->calc_md5(md5);
+ view->md5.str= md5;
+ view->md5.length= 32;
+ can_be_merged= lex->can_be_merged();
+ if (lex->create_view_algorithm == VIEW_ALGORITHM_MERGE &&
+ !lex->can_be_merged())
+ {
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_VIEW_MERGE,
+ ER(ER_WARN_VIEW_MERGE));
+ lex->create_view_algorithm= VIEW_ALGORITHM_UNDEFINED;
+ }
+ view->algorithm= lex->create_view_algorithm;
+ view->definer.user= lex->definer->user;
+ view->definer.host= lex->definer->host;
+ view->view_suid= lex->create_view_suid;
+ view->with_check= lex->create_view_check;
+ if ((view->updatable_view= (can_be_merged &&
+ view->algorithm != VIEW_ALGORITHM_TMPTABLE)))
+ {
+ /* TODO: change here when we will support UNIONs */
+ for (TABLE_LIST *tbl= (TABLE_LIST *)lex->select_lex.table_list.first;
+ tbl;
+ tbl= tbl->next_local)
+ {
+ if ((tbl->view && !tbl->updatable_view) || tbl->schema_table)
+ {
+ view->updatable_view= 0;
+ break;
+ }
+ for (TABLE_LIST *up= tbl; up; up= up->embedding)
+ {
+ if (up->outer_join)
+ {
+ view->updatable_view= 0;
+ goto loop_out;
+ }
+ }
+ }
+ }
+loop_out:
/* print file name */
dir.length= build_table_filename(dir_buff, sizeof(dir_buff),
view->db, "", "", 0);
@@ -736,16 +799,21 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
if (mode == VIEW_CREATE_NEW)
{
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), view->alias);
- DBUG_RETURN(-1);
+ error= -1;
+ goto err;
}
if (!(parser= sql_parse_prepare(&path, thd->mem_root, 0)))
- DBUG_RETURN(1);
+ {
+ error= 1;
+ goto err;
+ }
if (!parser->ok() || !is_equal(&view_type, parser->type()))
{
my_error(ER_WRONG_OBJECT, MYF(0), view->db, view->table_name, "VIEW");
- DBUG_RETURN(-1);
+ error= -1;
+ goto err;
}
/*
@@ -754,70 +822,42 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
TODO: read dependence list, too, to process cascade/restrict
TODO: special cascade/restrict procedure for alter?
*/
- if (parser->parse((gptr)view, thd->mem_root,
+ if (parser->parse((uchar*)view, thd->mem_root,
view_parameters + revision_number_position, 1,
&file_parser_dummy_hook))
{
- DBUG_RETURN(thd->net.report_error? -1 : 0);
+ error= thd->net.report_error? -1 : 0;
+ goto err;
}
}
else
- {
+ {
if (mode == VIEW_ALTER)
{
my_error(ER_NO_SUCH_TABLE, MYF(0), view->db, view->alias);
- DBUG_RETURN(-1);
- }
- }
- }
- /* fill structure */
- view->query.str= (char*)str.ptr();
- view->query.length= str.length()-1; // we do not need last \0
- view->source.str= thd->query + thd->lex->create_view_select_start;
- endp= view->source.str;
- endp= skip_rear_comments(endp, thd->query + thd->query_length);
- view->source.length= endp - view->source.str;
- view->file_version= 1;
- view->calc_md5(md5);
- view->md5.str= md5;
- view->md5.length= 32;
- can_be_merged= lex->can_be_merged();
- if (lex->create_view_algorithm == VIEW_ALGORITHM_MERGE &&
- !lex->can_be_merged())
- {
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_VIEW_MERGE,
- ER(ER_WARN_VIEW_MERGE));
- lex->create_view_algorithm= VIEW_ALGORITHM_UNDEFINED;
- }
- view->algorithm= lex->create_view_algorithm;
- view->definer.user= lex->definer->user;
- view->definer.host= lex->definer->host;
- view->view_suid= lex->create_view_suid;
- view->with_check= lex->create_view_check;
- if ((view->updatable_view= (can_be_merged &&
- view->algorithm != VIEW_ALGORITHM_TMPTABLE)))
- {
- /* TODO: change here when we will support UNIONs */
- for (TABLE_LIST *tbl= (TABLE_LIST *)lex->select_lex.table_list.first;
- tbl;
- tbl= tbl->next_local)
- {
- if ((tbl->view && !tbl->updatable_view) || tbl->schema_table)
- {
- view->updatable_view= 0;
- break;
- }
- for (TABLE_LIST *up= tbl; up; up= up->embedding)
- {
- if (up->outer_join)
- {
- view->updatable_view= 0;
- goto loop_out;
- }
+ error= -1;
+ goto err;
}
}
}
-loop_out:
+
+ /* Initialize view creation context from the environment. */
+
+ view->view_creation_ctx= View_creation_ctx::create(thd);
+
+ /*
+ Set LEX_STRING attributes in view-structure for parser to create
+ frm-file.
+ */
+
+ lex_string_set(&view->view_client_cs_name,
+ view->view_creation_ctx->get_client_cs()->csname);
+
+ lex_string_set(&view->view_connection_cl_name,
+ view->view_creation_ctx->get_connection_cl()->name);
+
+ view->view_body_utf8= lex->view_body_utf8;
+
/*
Check that table of main select do not used in subqueries.
@@ -842,15 +882,23 @@ loop_out:
!view->updatable_view)
{
my_error(ER_VIEW_NONUPD_CHECK, MYF(0), view->db, view->table_name);
- DBUG_RETURN(-1);
+ error= -1;
+ goto err;
}
if (sql_create_definition_file(&dir, &file, view_file_type,
- (gptr)view, view_parameters, num_view_backups))
+ (uchar*)view, view_parameters, num_view_backups))
{
- DBUG_RETURN(thd->net.report_error? -1 : 1);
+ error= thd->net.report_error? -1 : 1;
+ goto err;
}
DBUG_RETURN(0);
+err:
+ view->select_stmt.str= NULL;
+ view->select_stmt.length= 0;
+ view->md5.str= NULL;
+ view->md5.length= 0;
+ DBUG_RETURN(error);
}
@@ -876,9 +924,10 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
LEX *old_lex, *lex;
Query_arena *arena, backup;
TABLE_LIST *top_view= table->top_table();
- int res;
+ bool parse_status;
bool result, view_is_mergeable;
TABLE_LIST *view_main_select_tables;
+
DBUG_ENTER("mysql_make_view");
DBUG_PRINT("info", ("table: 0x%lx (%s)", (ulong) table, table->table_name));
@@ -945,7 +994,7 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
TODO: when VIEWs will be stored in cache, table mem_root should
be used here
*/
- if (parser->parse((gptr)table, thd->mem_root, view_parameters,
+ if (parser->parse((uchar*)table, thd->mem_root, view_parameters,
required_view_parameters, &file_parser_dummy_hook))
goto err;
@@ -979,17 +1028,42 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
/*TODO: md5 test here and warning if it is differ */
/*
+ Initialize view definition context by character set names loaded from
+ the view definition file. Use UTF8 character set if view definition
+ file is of old version and does not contain the character set names.
+ */
+
+ table->view_creation_ctx= View_creation_ctx::create(thd, table);
+
+ /*
TODO: TABLE mem root should be used here when VIEW will be stored in
TABLE cache
now Lex placed in statement memory
*/
table->view= lex= thd->lex= (LEX*) new(thd->mem_root) st_lex_local;
- lex_start(thd, table->query.str, table->query.length);
- view_select= &lex->select_lex;
- view_select->select_number= ++thd->select_number;
+
{
- ulong save_mode= thd->variables.sql_mode;
+ char old_db_buf[NAME_LEN+1];
+ LEX_STRING old_db= { old_db_buf, sizeof(old_db_buf) };
+ bool dbchanged;
+ Lex_input_stream lip(thd,
+ table->select_stmt.str,
+ table->select_stmt.length);
+
+ /*
+ Use view db name as thread default database, in order to ensure
+ that the view is parsed and prepared correctly.
+ */
+ if ((result= mysql_opt_change_db(thd, &table->view_db, &old_db, 1,
+ &dbchanged)))
+ goto end;
+
+ lex_start(thd);
+ view_select= &lex->select_lex;
+ view_select->select_number= ++thd->select_number;
+
+ ulong saved_mode= thd->variables.sql_mode;
/* switch off modes which can prevent normal parsing of VIEW
- MODE_REAL_AS_FLOAT affect only CREATE TABLE parsing
+ MODE_PIPES_AS_CONCAT affect expression parsing
@@ -1016,18 +1090,23 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
*/
thd->variables.sql_mode&= ~(MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES |
MODE_IGNORE_SPACE | MODE_NO_BACKSLASH_ESCAPES);
- CHARSET_INFO *save_cs= thd->variables.character_set_client;
- thd->variables.character_set_client= system_charset_info;
- res= MYSQLparse((void *)thd);
+
+ /* Parse the query. */
+
+ parse_status= parse_sql(thd, &lip, table->view_creation_ctx);
+
+ /* Restore environment. */
if ((old_lex->sql_command == SQLCOM_SHOW_FIELDS) ||
(old_lex->sql_command == SQLCOM_SHOW_CREATE))
lex->sql_command= old_lex->sql_command;
- thd->variables.character_set_client= save_cs;
- thd->variables.sql_mode= save_mode;
+ thd->variables.sql_mode= saved_mode;
+
+ if (dbchanged && mysql_change_db(thd, &old_db, TRUE))
+ goto err;
}
- if (!res && !thd->is_fatal_error)
+ if (!parse_status)
{
TABLE_LIST *view_tables= lex->query_tables;
TABLE_LIST *view_tables_tail= 0;
@@ -1114,8 +1193,8 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
If the view's body needs row-based binlogging (e.g. the VIEW is created
from SELECT UUID()), the top statement also needs it.
*/
- if (lex->binlog_row_based_if_mixed)
- old_lex->binlog_row_based_if_mixed= TRUE;
+ if (lex->is_stmt_unsafe())
+ old_lex->set_stmt_unsafe();
view_is_mergeable= (table->algorithm != VIEW_ALGORITHM_TMPTABLE &&
lex->can_be_merged());
LINT_INIT(view_main_select_tables);
@@ -1140,7 +1219,20 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
*/
for (tbl= view_main_select_tables; tbl; tbl= tbl->next_local)
tbl->lock_type= table->lock_type;
+ /*
+ If the view is mergeable, we might want to
+ INSERT/UPDATE/DELETE into tables of this view. Preserve the
+ original sql command and 'duplicates' of the outer lex.
+ This is used later in set_trg_event_type_for_command.
+ */
+ lex->sql_command= old_lex->sql_command;
+ lex->duplicates= old_lex->duplicates;
}
+ /*
+ This method has a dependency on the proper lock type being set,
+ so in case of views should be called here.
+ */
+ lex->set_trg_event_type_for_tables();
/*
If we are opening this view as part of implicit LOCK TABLES, then
@@ -1447,12 +1539,7 @@ bool mysql_drop_view(THD *thd, TABLE_LIST *views, enum_drop_mode drop_mode)
DBUG_RETURN(TRUE);
}
- if (mysql_bin_log.is_open())
- {
- thd->clear_error();
- thd->binlog_query(THD::STMT_QUERY_TYPE,
- thd->query, thd->query_length, FALSE, FALSE);
- }
+ write_bin_log(thd, TRUE, thd->query, thd->query_length);
send_ok(thd);
VOID(pthread_mutex_unlock(&LOCK_open));
@@ -1484,7 +1571,7 @@ frm_type_enum mysql_frm_type(THD *thd, char *path, enum legacy_db_type *dbt)
if ((file= my_open(path, O_RDONLY | O_SHARE, MYF(0))) < 0)
DBUG_RETURN(FRMTYPE_ERROR);
- error= my_read(file, (byte*) header, sizeof(header), MYF(MY_WME | MY_NABP));
+ error= my_read(file, (uchar*) header, sizeof(header), MYF(MY_WME | MY_NABP));
my_close(file, MYF(MY_WME));
if (error)
@@ -1747,7 +1834,7 @@ mysql_rename_view(THD *thd,
view_def.view_suid= TRUE;
/* get view definition and source */
- if (parser->parse((gptr)&view_def, thd->mem_root, view_parameters,
+ if (parser->parse((uchar*)&view_def, thd->mem_root, view_parameters,
array_elements(view_parameters)-1,
&file_parser_dummy_hook))
goto err;
@@ -1769,7 +1856,7 @@ mysql_rename_view(THD *thd,
file.length= pathstr.length - dir.length;
if (sql_create_definition_file(&dir, &file, view_file_type,
- (gptr)&view_def, view_parameters,
+ (uchar*)&view_def, view_parameters,
num_view_backups))
{
/* restore renamed view in case of error */
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 0a698f0f84d..ee7c3a8288b 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -15,8 +15,13 @@
/* sql_yacc.yy */
+/**
+ @defgroup Parser Parser
+ @{
+*/
+
%{
-/* thd is passed as an arg to yyparse(), and subsequently to yylex().
+/* thd is passed as an argument to yyparse(), and subsequently to yylex().
** The type will be void*, so it must be cast to (THD*) when used.
** Use the YYTHD macro for this.
*/
@@ -26,7 +31,7 @@
#define MYSQL_YACC
#define YYINITDEPTH 100
-#define YYMAXDEPTH 3200 /* Because of 64K stack */
+#define YYMAXDEPTH 3200 /* Because of 64K stack */
#define Lex (YYTHD->lex)
#define Select Lex->current_select
#include "mysql_priv.h"
@@ -43,9 +48,21 @@
int yylex(void *yylval, void *yythd);
-const LEX_STRING null_lex_str={0,0};
+const LEX_STRING null_lex_str= {0,0};
-#define yyoverflow(A,B,C,D,E,F) {ulong val= *(F); if (my_yyoverflow((B), (D), &val)) { yyerror((char*) (A)); return 2; } else { *(F)= (YYSIZE_T)val; }}
+#define yyoverflow(A,B,C,D,E,F) \
+ { \
+ ulong val= *(F); \
+ if (my_yyoverflow((B), (D), &val)) \
+ { \
+ yyerror((char*) (A)); \
+ return 2; \
+ } \
+ else \
+ { \
+ *(F)= (YYSIZE_T)val; \
+ } \
+ }
#define MYSQL_YYABORT \
do \
@@ -104,12 +121,13 @@ const LEX_STRING null_lex_str={0,0};
void my_parse_error(const char *s)
{
THD *thd= current_thd;
+ Lex_input_stream *lip= thd->m_lip;
- char *yytext= (char*) thd->lex->tok_start;
+ const char *yytext= lip->get_tok_start();
/* Push an error into the error stack */
my_printf_error(ER_PARSE_ERROR, ER(ER_PARSE_ERROR), MYF(0), s,
- (yytext ? (char*) yytext : ""),
- thd->lex->yylineno);
+ (yytext ? yytext : ""),
+ lip->yylineno);
}
/**
@@ -455,7 +473,7 @@ Item* handle_sql2003_note184_exception(THD *thd, Item* left, bool equal,
List<Item> *item_list;
List<String> *string_list;
String *string;
- key_part_spec *key_part;
+ Key_part_spec *key_part;
TABLE_LIST *table_list;
udf_func *udf;
LEX_USER *lex_user;
@@ -488,12 +506,12 @@ Item* handle_sql2003_note184_exception(THD *thd, Item* left, bool equal,
bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%}
-%pure_parser /* We have threads */
+%pure_parser /* We have threads */
/*
- Currently there is 287 shift/reduce conflict. We should not introduce
- new conflicts any more.
+ Currently there are 280 shift/reduce conflicts.
+ We should not introduce new conflicts any more.
*/
-%expect 286
+%expect 280
/*
Comments for TOKENS.
@@ -1020,6 +1038,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token TO_SYM /* SQL-2003-R */
%token TRAILING /* SQL-2003-R */
%token TRANSACTION_SYM
+%token TRANSACTIONAL_SYM
%token TRIGGERS_SYM
%token TRIGGER_SYM /* SQL-2003-R */
%token TRIM /* SQL-2003-N */
@@ -1083,43 +1102,45 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
/* A dummy token to force the priority of table_ref production in a join. */
%left TABLE_REF_PRIORITY
%left SET_VAR
-%left OR_OR_SYM OR_SYM OR2_SYM XOR
-%left AND_SYM AND_AND_SYM
-%left BETWEEN_SYM CASE_SYM WHEN_SYM THEN_SYM ELSE
-%left EQ EQUAL_SYM GE GT_SYM LE LT NE IS LIKE REGEXP IN_SYM
-%left '|'
-%left '&'
-%left SHIFT_LEFT SHIFT_RIGHT
-%left '-' '+'
-%left '*' '/' '%' DIV_SYM MOD_SYM
+%left OR_OR_SYM OR_SYM OR2_SYM
+%left XOR
+%left AND_SYM AND_AND_SYM
+%left BETWEEN_SYM CASE_SYM WHEN_SYM THEN_SYM ELSE
+%left EQ EQUAL_SYM GE GT_SYM LE LT NE IS LIKE REGEXP IN_SYM
+%left '|'
+%left '&'
+%left SHIFT_LEFT SHIFT_RIGHT
+%left '-' '+'
+%left '*' '/' '%' DIV_SYM MOD_SYM
%left '^'
-%left NEG '~'
-%right NOT_SYM NOT2_SYM
-%right BINARY COLLATE_SYM
+%left NEG '~'
+%right NOT_SYM NOT2_SYM
+%right BINARY COLLATE_SYM
+%left INTERVAL_SYM
%type <lex_str>
IDENT IDENT_QUOTED TEXT_STRING DECIMAL_NUM FLOAT_NUM NUM LONG_NUM HEX_NUM
- LEX_HOSTNAME ULONGLONG_NUM field_ident select_alias ident ident_or_text
- UNDERSCORE_CHARSET IDENT_sys TEXT_STRING_sys TEXT_STRING_literal
- NCHAR_STRING opt_component key_cache_name
+ LEX_HOSTNAME ULONGLONG_NUM field_ident select_alias ident ident_or_text
+ 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
%type <lex_str_ptr>
- opt_table_alias
+ opt_table_alias
%type <table>
- table_ident table_ident_nodb references xid
+ 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_ident opt_db text_or_password
+ opt_constraint constraint
%type <string>
- text_string opt_gconcat_separator
+ text_string opt_gconcat_separator
%type <num>
- type int_type real_type order_dir lock_option
- udf_type if_exists opt_local opt_table_options table_options
+ type int_type real_type order_dir lock_option
+ udf_type if_exists opt_local opt_table_options table_options
table_option opt_if_not_exists opt_no_write_to_binlog
delete_option opt_temporary all_or_any opt_distinct
opt_ignore_leaves fulltext_options spatial_type union_option
@@ -1130,28 +1151,28 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
ev_alter_on_schedule_completion opt_ev_rename_to opt_ev_sql_stmt
%type <ulong_num>
- ulong_num real_ulong_num merge_insert_types
+ ulong_num real_ulong_num merge_insert_types
%type <ulonglong_number>
- ulonglong_num real_ulonglong_num size_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
+ replace_lock_option opt_low_priority insert_lock_option load_data_lock
%type <item>
- literal text_literal insert_ident order_ident
- simple_ident select_item2 expr opt_expr opt_else sum_expr in_sum_expr
- variable variable_aux bool_term bool_factor bool_test bool_pri
- predicate bit_expr bit_term bit_factor value_expr term factor
- table_wild simple_expr udf_expr
- expr_or_default set_expr_or_default interval_expr
- param_marker geometry_function
- signed_literal now_or_signed_literal opt_escape
- sp_opt_default
- simple_ident_nospvar simple_ident_q
+ literal text_literal insert_ident order_ident
+ simple_ident select_item2 expr opt_expr opt_else sum_expr in_sum_expr
+ variable variable_aux bool_pri
+ predicate bit_expr
+ table_wild simple_expr udf_expr
+ expr_or_default set_expr_or_default interval_expr
+ param_marker geometry_function
+ signed_literal now_or_signed_literal opt_escape
+ sp_opt_default
+ simple_ident_nospvar simple_ident_q
field_or_var limit_option
part_func_expr
function_call_keyword
@@ -1160,29 +1181,29 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
function_call_conflict
%type <item_num>
- NUM_literal
+ NUM_literal
%type <item_list>
- expr_list udf_expr_list udf_expr_list2 when_list
- ident_list ident_list_arg opt_expr_list
+ expr_list opt_udf_expr_list udf_expr_list when_list
+ ident_list ident_list_arg opt_expr_list
%type <var_type>
option_type opt_var_type opt_var_ident_type
%type <key_type>
- key_type opt_unique_or_fulltext constraint_key_type
+ key_type opt_unique_or_fulltext constraint_key_type
%type <key_alg>
- btree_or_rtree
+ btree_or_rtree
%type <string_list>
- using_list
+ using_list
%type <key_part>
- key_part
+ key_part
%type <table_list>
- join_table_list join_table
+ join_table_list join_table
table_factor table_ref
select_derived derived_table_list
@@ -1208,57 +1229,59 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%type <lex_user> user grant_user
%type <charset>
- opt_collate
- charset_name
- charset_name_or_default
- old_or_new_charset_name
- old_or_new_charset_name_or_default
- collation_name
- collation_name_or_default
- opt_load_data_charset
+ opt_collate
+ charset_name
+ charset_name_or_default
+ old_or_new_charset_name
+ old_or_new_charset_name_or_default
+ collation_name
+ collation_name_or_default
+ opt_load_data_charset
+ UNDERSCORE_CHARSET
%type <variable> internal_variable_name
%type <select_lex> subselect subselect_init
- get_select_lex
+ get_select_lex
%type <boolfunc2creator> comp_op
%type <NONE>
- query verb_clause create change select do drop insert replace insert2
- insert_values update delete truncate rename
- show describe load alter optimize keycache preload flush
- reset purge begin commit rollback savepoint release
- 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
- 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
- expr_list2 udf_expr_list3 handler
- opt_precision opt_ignore opt_column opt_restrict
- grant revoke set lock unlock string_list field_options field_option
- field_opt_list opt_binary table_lock_list table_lock
- ref_list opt_on_delete opt_on_delete_list opt_on_delete_item use
- opt_delete_options opt_delete_option varchar nchar nvarchar
- opt_outer table_list table_name opt_option opt_place
- opt_attribute opt_attribute_list attribute column_list column_list_id
- opt_column_list grant_privileges grant_ident grant_list grant_option
- object_privilege object_privilege_list user_list rename_list
- clear_privileges flush_options flush_option
- equal optional_braces
- opt_mi_check_type opt_to mi_check_types normal_join
- db_to_db table_to_table_list table_to_table opt_table_list opt_as
- handler_rkey_function handler_read_or_scan
- single_multi table_wild_list table_wild_one opt_wild
- union_clause union_list
- precision subselect_start opt_and charset
- subselect_end select_var_list select_var_list_init help opt_len
- opt_extended_describe
+ query verb_clause create change select do drop insert replace insert2
+ insert_values update delete truncate rename
+ show describe load alter optimize keycache preload flush
+ reset purge begin commit rollback savepoint release
+ 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
+ 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
+ handler
+ opt_precision opt_ignore opt_column opt_restrict
+ grant revoke set lock unlock string_list field_options field_option
+ field_opt_list opt_binary table_lock_list table_lock
+ ref_list opt_on_delete opt_on_delete_list opt_on_delete_item use
+ opt_delete_options opt_delete_option varchar nchar nvarchar
+ opt_outer table_list table_name table_alias_ref_list table_alias_ref
+ opt_option opt_place
+ opt_attribute opt_attribute_list attribute column_list column_list_id
+ opt_column_list grant_privileges grant_ident grant_list grant_option
+ object_privilege object_privilege_list user_list rename_list
+ clear_privileges flush_options flush_option
+ equal optional_braces
+ opt_mi_check_type opt_to mi_check_types normal_join
+ db_to_db table_to_table_list table_to_table opt_table_list opt_as
+ handler_rkey_function handler_read_or_scan
+ single_multi table_wild_list table_wild_one opt_wild
+ union_clause union_list
+ precision subselect_start opt_and charset
+ subselect_end select_var_list select_var_list_init help opt_len
+ opt_extended_describe
prepare prepare_src execute deallocate
- statement sp_suid
- sp_c_chistics sp_a_chistics sp_chistic sp_c_chistic xa
+ 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
definer view_replace_or_algorithm view_replace
view_algorithm view_or_trigger_or_sp_or_event
@@ -1266,7 +1289,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
view_suid view_tail view_list_opt view_list view_select
view_check_option trigger_tail sp_tail
install uninstall partition_entry binlog_base64_event
- init_key_options key_options key_opts key_opt key_using_alg
+ init_key_options key_options key_opts key_opt key_using_alg
server_def server_options_list server_option
END_OF_INPUT
@@ -1287,381 +1310,397 @@ END_OF_INPUT
%type <num> index_hint_clause
%type <NONE>
- '-' '+' '*' '/' '%' '(' ')'
- ',' '!' '{' '}' '&' '|' AND_SYM OR_SYM OR_OR_SYM BETWEEN_SYM CASE_SYM
- THEN_SYM WHEN_SYM DIV_SYM MOD_SYM OR2_SYM AND_AND_SYM
+ '-' '+' '*' '/' '%' '(' ')'
+ ',' '!' '{' '}' '&' '|' AND_SYM OR_SYM OR_OR_SYM BETWEEN_SYM CASE_SYM
+ THEN_SYM WHEN_SYM DIV_SYM MOD_SYM OR2_SYM AND_AND_SYM
%%
+/*
+ Indentation of grammar rules:
+
+rule: <-- starts at col 1
+ rule1a rule1b rule1c <-- starts at col 11
+ { <-- starts at col 11
+ code <-- starts at col 13, indentation is 2 spaces
+ }
+ | rule2a rule2b
+ {
+ code
+ }
+ ; <-- on a line by itself, starts at col 9
+
+ Also, please do not use any <TAB>, but spaces.
+ Having a uniform indentation in this file helps
+ code reviews, patches, merges, and make maintenance easier.
+ Tip: grep [[:cntrl:]] sql_yacc.yy
+ Thanks.
+*/
query:
- END_OF_INPUT
- {
- THD *thd= YYTHD;
- if (!thd->bootstrap &&
- (!(thd->lex->select_lex.options & OPTION_FOUND_COMMENT)))
- {
- my_message(ER_EMPTY_QUERY, ER(ER_EMPTY_QUERY), MYF(0));
- MYSQL_YYABORT;
- }
- else
- {
- thd->lex->sql_command= SQLCOM_EMPTY_QUERY;
- }
- }
- | verb_clause END_OF_INPUT {};
+ END_OF_INPUT
+ {
+ THD *thd= YYTHD;
+ if (!thd->bootstrap &&
+ (!(thd->lex->select_lex.options & OPTION_FOUND_COMMENT)))
+ {
+ my_message(ER_EMPTY_QUERY, ER(ER_EMPTY_QUERY), MYF(0));
+ MYSQL_YYABORT;
+ }
+ else
+ {
+ thd->lex->sql_command= SQLCOM_EMPTY_QUERY;
+ }
+ }
+ | verb_clause END_OF_INPUT {}
+ ;
verb_clause:
- statement
- | begin
- ;
+ statement
+ | begin
+ ;
/* Verb clauses, except begin */
statement:
- alter
- | analyze
- | backup
- | binlog_base64_event
- | call
- | change
- | check
- | checksum
- | commit
- | create
+ alter
+ | analyze
+ | backup
+ | binlog_base64_event
+ | call
+ | change
+ | check
+ | checksum
+ | commit
+ | create
| deallocate
- | delete
- | describe
- | do
- | drop
+ | delete
+ | describe
+ | do
+ | drop
| execute
- | flush
- | grant
- | handler
- | help
- | insert
+ | flush
+ | grant
+ | handler
+ | help
+ | insert
| install
- | kill
- | load
- | lock
- | optimize
+ | kill
+ | load
+ | lock
+ | optimize
| keycache
| partition_entry
- | preload
+ | preload
| prepare
- | purge
- | release
- | rename
- | repair
- | replace
- | reset
- | restore
- | revoke
- | rollback
- | savepoint
- | select
- | set
- | show
- | slave
- | start
- | truncate
+ | purge
+ | release
+ | rename
+ | repair
+ | replace
+ | reset
+ | restore
+ | revoke
+ | rollback
+ | savepoint
+ | select
+ | set
+ | show
+ | slave
+ | start
+ | truncate
| uninstall
- | unlock
- | update
- | use
- | xa
+ | unlock
+ | update
+ | use
+ | xa
;
deallocate:
- deallocate_or_drop PREPARE_SYM ident
- {
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- if (lex->stmt_prepare_mode)
+ deallocate_or_drop PREPARE_SYM ident
{
- my_parse_error(ER(ER_SYNTAX_ERROR));
- MYSQL_YYABORT;
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ lex->sql_command= SQLCOM_DEALLOCATE_PREPARE;
+ lex->prepared_stmt_name= $3;
}
- lex->sql_command= SQLCOM_DEALLOCATE_PREPARE;
- lex->prepared_stmt_name= $3;
- };
+ ;
deallocate_or_drop:
- DEALLOCATE_SYM |
- DROP
- ;
-
+ DEALLOCATE_SYM
+ | DROP
+ ;
prepare:
- PREPARE_SYM ident FROM prepare_src
- {
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- if (lex->stmt_prepare_mode)
+ PREPARE_SYM ident FROM prepare_src
{
- my_parse_error(ER(ER_SYNTAX_ERROR));
- MYSQL_YYABORT;
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ lex->sql_command= SQLCOM_PREPARE;
+ lex->prepared_stmt_name= $2;
}
- lex->sql_command= SQLCOM_PREPARE;
- lex->prepared_stmt_name= $2;
- };
+ ;
prepare_src:
- TEXT_STRING_sys
- {
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- lex->prepared_stmt_code= $1;
- lex->prepared_stmt_code_is_varref= FALSE;
- }
+ TEXT_STRING_sys
+ {
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ lex->prepared_stmt_code= $1;
+ lex->prepared_stmt_code_is_varref= FALSE;
+ }
| '@' ident_or_text
- {
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- lex->prepared_stmt_code= $2;
- lex->prepared_stmt_code_is_varref= TRUE;
- };
+ {
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ lex->prepared_stmt_code= $2;
+ lex->prepared_stmt_code_is_varref= TRUE;
+ }
+ ;
execute:
- EXECUTE_SYM ident
- {
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- if (lex->stmt_prepare_mode)
+ EXECUTE_SYM ident
{
- my_parse_error(ER(ER_SYNTAX_ERROR));
- MYSQL_YYABORT;
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ lex->sql_command= SQLCOM_EXECUTE;
+ lex->prepared_stmt_name= $2;
}
- lex->sql_command= SQLCOM_EXECUTE;
- lex->prepared_stmt_name= $2;
- }
- execute_using
- {}
+ execute_using
+ {}
;
execute_using:
- /* nothing */
+ /* nothing */
| USING execute_var_list
;
execute_var_list:
- execute_var_list ',' execute_var_ident
+ execute_var_list ',' execute_var_ident
| execute_var_ident
;
-execute_var_ident: '@' ident_or_text
- {
- LEX *lex=Lex;
- LEX_STRING *lexstr= (LEX_STRING*)sql_memdup(&$2, sizeof(LEX_STRING));
- if (!lexstr || lex->prepared_stmt_params.push_back(lexstr))
+execute_var_ident:
+ '@' ident_or_text
+ {
+ LEX *lex=Lex;
+ LEX_STRING *lexstr= (LEX_STRING*)sql_memdup(&$2, sizeof(LEX_STRING));
+ if (!lexstr || lex->prepared_stmt_params.push_back(lexstr))
MYSQL_YYABORT;
- }
+ }
;
/* help */
help:
- HELP_SYM
- {
- if (Lex->sphead)
- {
- my_error(ER_SP_BADSTATEMENT, MYF(0), "HELP");
- MYSQL_YYABORT;
- }
- }
- ident_or_text
- {
- LEX *lex= Lex;
- lex->sql_command= SQLCOM_HELP;
- lex->help_arg= $3.str;
- };
+ HELP_SYM
+ {
+ if (Lex->sphead)
+ {
+ my_error(ER_SP_BADSTATEMENT, MYF(0), "HELP");
+ MYSQL_YYABORT;
+ }
+ }
+ ident_or_text
+ {
+ LEX *lex= Lex;
+ lex->sql_command= SQLCOM_HELP;
+ lex->help_arg= $3.str;
+ }
+ ;
/* change master */
change:
- CHANGE MASTER_SYM TO_SYM
- {
- LEX *lex = Lex;
- lex->sql_command = SQLCOM_CHANGE_MASTER;
- bzero((char*) &lex->mi, sizeof(lex->mi));
- }
- master_defs
- {}
- ;
+ CHANGE MASTER_SYM TO_SYM
+ {
+ LEX *lex = Lex;
+ lex->sql_command = SQLCOM_CHANGE_MASTER;
+ bzero((char*) &lex->mi, sizeof(lex->mi));
+ }
+ master_defs
+ {}
+ ;
master_defs:
- master_def
- | master_defs ',' master_def;
+ master_def
+ | master_defs ',' master_def
+ ;
master_def:
- MASTER_HOST_SYM EQ TEXT_STRING_sys
- {
- Lex->mi.host = $3.str;
- }
- |
- MASTER_USER_SYM EQ TEXT_STRING_sys
- {
- Lex->mi.user = $3.str;
- }
- |
- MASTER_PASSWORD_SYM EQ TEXT_STRING_sys
- {
- Lex->mi.password = $3.str;
- }
- |
- MASTER_PORT_SYM EQ ulong_num
- {
- Lex->mi.port = $3;
- }
- |
- MASTER_CONNECT_RETRY_SYM EQ ulong_num
- {
- Lex->mi.connect_retry = $3;
- }
- | MASTER_SSL_SYM EQ ulong_num
- {
- Lex->mi.ssl= $3 ?
- LEX_MASTER_INFO::SSL_ENABLE : LEX_MASTER_INFO::SSL_DISABLE;
- }
- | MASTER_SSL_CA_SYM EQ TEXT_STRING_sys
- {
- Lex->mi.ssl_ca= $3.str;
- }
- | MASTER_SSL_CAPATH_SYM EQ TEXT_STRING_sys
- {
- Lex->mi.ssl_capath= $3.str;
- }
- | MASTER_SSL_CERT_SYM EQ TEXT_STRING_sys
- {
- Lex->mi.ssl_cert= $3.str;
- }
- | MASTER_SSL_CIPHER_SYM EQ TEXT_STRING_sys
- {
- Lex->mi.ssl_cipher= $3.str;
- }
- | MASTER_SSL_KEY_SYM EQ TEXT_STRING_sys
- {
- Lex->mi.ssl_key= $3.str;
- }
- | 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;
- }
- |
- master_file_def
- ;
+ MASTER_HOST_SYM EQ TEXT_STRING_sys
+ {
+ Lex->mi.host = $3.str;
+ }
+ | MASTER_USER_SYM EQ TEXT_STRING_sys
+ {
+ Lex->mi.user = $3.str;
+ }
+ | MASTER_PASSWORD_SYM EQ TEXT_STRING_sys
+ {
+ Lex->mi.password = $3.str;
+ }
+ | MASTER_PORT_SYM EQ ulong_num
+ {
+ Lex->mi.port = $3;
+ }
+ | MASTER_CONNECT_RETRY_SYM EQ ulong_num
+ {
+ Lex->mi.connect_retry = $3;
+ }
+ | MASTER_SSL_SYM EQ ulong_num
+ {
+ Lex->mi.ssl= $3 ?
+ LEX_MASTER_INFO::SSL_ENABLE : LEX_MASTER_INFO::SSL_DISABLE;
+ }
+ | MASTER_SSL_CA_SYM EQ TEXT_STRING_sys
+ {
+ Lex->mi.ssl_ca= $3.str;
+ }
+ | MASTER_SSL_CAPATH_SYM EQ TEXT_STRING_sys
+ {
+ Lex->mi.ssl_capath= $3.str;
+ }
+ | MASTER_SSL_CERT_SYM EQ TEXT_STRING_sys
+ {
+ Lex->mi.ssl_cert= $3.str;
+ }
+ | MASTER_SSL_CIPHER_SYM EQ TEXT_STRING_sys
+ {
+ Lex->mi.ssl_cipher= $3.str;
+ }
+ | MASTER_SSL_KEY_SYM EQ TEXT_STRING_sys
+ {
+ Lex->mi.ssl_key= $3.str;
+ }
+ | 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;
+ }
+ | master_file_def
+ ;
master_file_def:
- MASTER_LOG_FILE_SYM EQ TEXT_STRING_sys
- {
- Lex->mi.log_file_name = $3.str;
- }
- | MASTER_LOG_POS_SYM EQ ulonglong_num
- {
- Lex->mi.pos = $3;
- /*
- If the user specified a value < BIN_LOG_HEADER_SIZE, adjust it
- instead of causing subsequent errors.
- We need to do it in this file, because only there we know that
- MASTER_LOG_POS has been explicitely specified. On the contrary
- in change_master() (sql_repl.cc) we cannot distinguish between 0
- (MASTER_LOG_POS explicitely specified as 0) and 0 (unspecified),
- whereas we want to distinguish (specified 0 means "read the binlog
- from 0" (4 in fact), unspecified means "don't change the position
- (keep the preceding value)").
- */
- Lex->mi.pos = max(BIN_LOG_HEADER_SIZE, Lex->mi.pos);
- }
- | RELAY_LOG_FILE_SYM EQ TEXT_STRING_sys
- {
- Lex->mi.relay_log_name = $3.str;
- }
- | RELAY_LOG_POS_SYM EQ ulong_num
- {
- Lex->mi.relay_log_pos = $3;
- /* Adjust if < BIN_LOG_HEADER_SIZE (same comment as Lex->mi.pos) */
- Lex->mi.relay_log_pos = max(BIN_LOG_HEADER_SIZE, Lex->mi.relay_log_pos);
- }
- ;
+ MASTER_LOG_FILE_SYM EQ TEXT_STRING_sys
+ {
+ Lex->mi.log_file_name = $3.str;
+ }
+ | MASTER_LOG_POS_SYM EQ ulonglong_num
+ {
+ Lex->mi.pos = $3;
+ /*
+ If the user specified a value < BIN_LOG_HEADER_SIZE, adjust it
+ instead of causing subsequent errors.
+ We need to do it in this file, because only there we know that
+ MASTER_LOG_POS has been explicitely specified. On the contrary
+ in change_master() (sql_repl.cc) we cannot distinguish between 0
+ (MASTER_LOG_POS explicitely specified as 0) and 0 (unspecified),
+ whereas we want to distinguish (specified 0 means "read the binlog
+ from 0" (4 in fact), unspecified means "don't change the position
+ (keep the preceding value)").
+ */
+ Lex->mi.pos = max(BIN_LOG_HEADER_SIZE, Lex->mi.pos);
+ }
+ | RELAY_LOG_FILE_SYM EQ TEXT_STRING_sys
+ {
+ Lex->mi.relay_log_name = $3.str;
+ }
+ | RELAY_LOG_POS_SYM EQ ulong_num
+ {
+ Lex->mi.relay_log_pos = $3;
+ /* Adjust if < BIN_LOG_HEADER_SIZE (same comment as Lex->mi.pos) */
+ Lex->mi.relay_log_pos = max(BIN_LOG_HEADER_SIZE, Lex->mi.relay_log_pos);
+ }
+ ;
/* create a table */
create:
- CREATE opt_table_options TABLE_SYM opt_if_not_exists table_ident
- {
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- lex->sql_command= SQLCOM_CREATE_TABLE;
- if (!lex->select_lex.add_table_to_list(thd, $5, NULL,
- TL_OPTION_UPDATING,
- (using_update_log ?
- TL_READ_NO_INSERT:
- TL_READ)))
- MYSQL_YYABORT;
- lex->create_list.empty();
- lex->key_list.empty();
- lex->col_list.empty();
- lex->change=NullS;
- bzero((char*) &lex->create_info,sizeof(lex->create_info));
- lex->create_info.options=$2 | $4;
- lex->create_info.db_type= lex->thd->variables.table_type;
- lex->create_info.default_table_charset= NULL;
- lex->name.str= 0;
- lex->name.length= 0;
- lex->like_name= 0;
- }
- create2
- { Lex->current_select= &Lex->select_lex; }
- | CREATE opt_unique_or_fulltext INDEX_SYM ident key_alg ON
- table_ident
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_CREATE_INDEX;
- if (!lex->current_select->add_table_to_list(lex->thd, $7,
- NULL,
- TL_OPTION_UPDATING))
- MYSQL_YYABORT;
- lex->create_list.empty();
- lex->key_list.empty();
- lex->col_list.empty();
- lex->change=NullS;
- }
- '(' key_list ')' key_options
- {
- LEX *lex=Lex;
- if ($2 != Key::FULLTEXT && lex->key_create_info.parser_name.str)
- {
- my_parse_error(ER(ER_SYNTAX_ERROR));
- MYSQL_YYABORT;
- }
- lex->key_list.push_back(new Key($2, $4.str, &lex->key_create_info, 0,
- lex->col_list));
- lex->col_list.empty();
- }
- | CREATE DATABASE opt_if_not_exists ident
- {
- Lex->create_info.default_table_charset= NULL;
- Lex->create_info.used_fields= 0;
- }
- opt_create_database_options
- {
- LEX *lex=Lex;
- lex->sql_command=SQLCOM_CREATE_DB;
- lex->name= $4;
+ CREATE opt_table_options TABLE_SYM opt_if_not_exists table_ident
+ {
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ lex->sql_command= SQLCOM_CREATE_TABLE;
+ if (!lex->select_lex.add_table_to_list(thd, $5, NULL,
+ TL_OPTION_UPDATING,
+ TL_WRITE))
+ MYSQL_YYABORT;
+ lex->alter_info.reset();
+ lex->col_list.empty();
+ lex->change=NullS;
+ bzero((char*) &lex->create_info,sizeof(lex->create_info));
+ lex->create_info.options=$2 | $4;
+ lex->create_info.db_type= ha_default_handlerton(thd);
+ lex->create_info.default_table_charset= NULL;
+ lex->name.str= 0;
+ lex->name.length= 0;
+ }
+ create2
+ {
+ LEX *lex= YYTHD->lex;
+ lex->current_select= &lex->select_lex;
+ if (!lex->create_info.db_type)
+ {
+ lex->create_info.db_type= ha_default_handlerton(YYTHD);
+ push_warning_printf(YYTHD, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_WARN_USING_OTHER_HANDLER,
+ ER(ER_WARN_USING_OTHER_HANDLER),
+ ha_resolve_storage_engine_name(lex->create_info.db_type),
+ $5->table.str);
+ }
+ }
+ | CREATE opt_unique_or_fulltext INDEX_SYM ident key_alg ON
+ table_ident
+ {
+ LEX *lex=Lex;
+ lex->sql_command= SQLCOM_CREATE_INDEX;
+ if (!lex->current_select->add_table_to_list(lex->thd, $7,
+ NULL,
+ TL_OPTION_UPDATING))
+ MYSQL_YYABORT;
+ lex->alter_info.reset();
+ lex->alter_info.flags= ALTER_ADD_INDEX;
+ lex->col_list.empty();
+ lex->change=NullS;
+ }
+ '(' key_list ')' key_options
+ {
+ LEX *lex=Lex;
+ Key *key;
+ if ($2 != Key::FULLTEXT && lex->key_create_info.parser_name.str)
+ {
+ my_parse_error(ER(ER_SYNTAX_ERROR));
+ MYSQL_YYABORT;
+ }
+ key= new Key($2, $4.str, &lex->key_create_info, 0,
+ lex->col_list);
+ lex->alter_info.key_list.push_back(key);
+ lex->col_list.empty();
+ }
+ | CREATE DATABASE opt_if_not_exists ident
+ {
+ Lex->create_info.default_table_charset= NULL;
+ Lex->create_info.used_fields= 0;
+ }
+ opt_create_database_options
+ {
+ LEX *lex=Lex;
+ lex->sql_command=SQLCOM_CREATE_DB;
+ lex->name= $4;
lex->create_info.options=$3;
- }
- | CREATE
- {
+ }
+ | CREATE
+ {
Lex->create_view_mode= VIEW_CREATE_NEW;
Lex->create_view_algorithm= VIEW_ALGORITHM_UNDEFINED;
Lex->create_view_suid= TRUE;
- }
- view_or_trigger_or_sp_or_event
- {}
- | CREATE USER clear_privileges grant_list
- {
- Lex->sql_command = SQLCOM_CREATE_USER;
}
- | CREATE LOGFILE_SYM GROUP_SYM logfile_group_info
+ view_or_trigger_or_sp_or_event
+ {}
+ | CREATE USER clear_privileges grant_list
+ {
+ Lex->sql_command = SQLCOM_CREATE_USER;
+ }
+ | CREATE LOGFILE_SYM GROUP_SYM logfile_group_info
{
Lex->alter_tablespace_info->ts_cmd_type= CREATE_LOGFILE_GROUP;
}
@@ -1669,84 +1708,86 @@ create:
{
Lex->alter_tablespace_info->ts_cmd_type= CREATE_TABLESPACE;
}
- | CREATE server_def
- {
- Lex->sql_command= SQLCOM_CREATE_SERVER;
+ | CREATE server_def
+ {
+ Lex->sql_command= SQLCOM_CREATE_SERVER;
}
- ;
+ ;
+
server_def:
- SERVER_SYM ident_or_text FOREIGN DATA_SYM WRAPPER_SYM ident_or_text OPTIONS_SYM '(' server_options_list ')'
- {
- Lex->server_options.server_name= $2.str;
- Lex->server_options.server_name_length= $2.length;
- Lex->server_options.scheme= $6.str;
- }
+ SERVER_SYM
+ ident_or_text
+ FOREIGN DATA_SYM WRAPPER_SYM
+ ident_or_text
+ OPTIONS_SYM '(' server_options_list ')'
+ {
+ Lex->server_options.server_name= $2.str;
+ Lex->server_options.server_name_length= $2.length;
+ Lex->server_options.scheme= $6.str;
+ }
;
server_options_list:
- server_option
+ server_option
| server_options_list ',' server_option
;
server_option:
- USER TEXT_STRING_sys
- {
- Lex->server_options.username= $2.str;
- }
- |
- HOST_SYM TEXT_STRING_sys
- {
- Lex->server_options.host= $2.str;
- }
- |
- DATABASE TEXT_STRING_sys
- {
- Lex->server_options.db= $2.str;
- }
- |
- OWNER_SYM TEXT_STRING_sys
- {
- Lex->server_options.owner= $2.str;
- }
- |
- PASSWORD TEXT_STRING_sys
- {
- Lex->server_options.password= $2.str;
- }
- |
- SOCKET_SYM TEXT_STRING_sys
- {
- Lex->server_options.socket= $2.str;
- }
- |
- PORT_SYM ulong_num
- {
- Lex->server_options.port= $2;
- }
+ USER TEXT_STRING_sys
+ {
+ Lex->server_options.username= $2.str;
+ }
+ | HOST_SYM TEXT_STRING_sys
+ {
+ Lex->server_options.host= $2.str;
+ }
+ | DATABASE TEXT_STRING_sys
+ {
+ Lex->server_options.db= $2.str;
+ }
+ | OWNER_SYM TEXT_STRING_sys
+ {
+ Lex->server_options.owner= $2.str;
+ }
+ | PASSWORD TEXT_STRING_sys
+ {
+ Lex->server_options.password= $2.str;
+ }
+ | SOCKET_SYM TEXT_STRING_sys
+ {
+ Lex->server_options.socket= $2.str;
+ }
+ | PORT_SYM ulong_num
+ {
+ Lex->server_options.port= $2;
+ }
;
event_tail:
EVENT_SYM opt_if_not_exists sp_name
/*
- BE CAREFUL when you add a new rule to update the block where
- YYTHD->client_capabilities is set back to original value
+ BE CAREFUL when you add a new rule to update the block where
+ YYTHD->client_capabilities is set back to original value
*/
{
- Lex->create_info.options= $2;
+ THD *thd= YYTHD;
+ LEX *lex=Lex;
- if (!(Lex->event_parse_data= Event_parse_data::new_instance(YYTHD)))
+ lex->create_info.options= $2;
+
+ if (!(lex->event_parse_data= Event_parse_data::new_instance(thd)))
MYSQL_YYABORT;
- Lex->event_parse_data->identifier= $3;
+ lex->event_parse_data->identifier= $3;
/*
We have to turn of CLIENT_MULTI_QUERIES while parsing a
stored procedure, otherwise yylex will chop it into pieces
at each ';'.
*/
- $<ulong_num>$= YYTHD->client_capabilities & CLIENT_MULTI_QUERIES;
- YYTHD->client_capabilities &= (~CLIENT_MULTI_QUERIES);
+ $<ulong_num>$= thd->client_capabilities & CLIENT_MULTI_QUERIES;
+ thd->client_capabilities &= (~CLIENT_MULTI_QUERIES);
- Lex->sql_command= SQLCOM_CREATE_EVENT;
+ lex->sql_command= SQLCOM_CREATE_EVENT;
/* We need that for disallowing subqueries */
}
ON SCHEDULE_SYM ev_schedule_time
@@ -1770,10 +1811,11 @@ event_tail:
*/
Lex->sql_command= SQLCOM_CREATE_EVENT;
}
- ;
+ ;
-ev_schedule_time: EVERY_SYM expr interval
- {
+ev_schedule_time:
+ EVERY_SYM expr interval
+ {
Lex->event_parse_data->item_expression= $2;
Lex->event_parse_data->interval= $3;
}
@@ -1785,7 +1827,8 @@ ev_schedule_time: EVERY_SYM expr interval
}
;
-opt_ev_status: /* empty */ { $$= 0; }
+opt_ev_status:
+ /* empty */ { $$= 0; }
| ENABLE_SYM
{
Lex->event_parse_data->status= Event_basic::ENABLED;
@@ -1801,9 +1844,10 @@ opt_ev_status: /* empty */ { $$= 0; }
Lex->event_parse_data->status= Event_basic::DISABLED;
$$= 1;
}
- ;
+ ;
-ev_starts: /* empty */
+ev_starts:
+ /* empty */
{
Lex->event_parse_data->item_starts= new Item_func_now_local();
}
@@ -1811,18 +1855,20 @@ ev_starts: /* empty */
{
Lex->event_parse_data->item_starts= $2;
}
- ;
+ ;
-ev_ends: /* empty */
+ev_ends:
+ /* empty */
| ENDS_SYM expr
{
Lex->event_parse_data->item_ends= $2;
}
- ;
+ ;
-opt_ev_on_completion: /* empty */ { $$= 0; }
+opt_ev_on_completion:
+ /* empty */ { $$= 0; }
| ev_on_completion
- ;
+ ;
ev_on_completion:
ON COMPLETION_SYM PRESERVE_SYM
@@ -1837,19 +1883,22 @@ ev_on_completion:
Event_basic::ON_COMPLETION_DROP;
$$= 1;
}
- ;
+ ;
-opt_ev_comment: /* empty */ { $$= 0; }
+opt_ev_comment:
+ /* empty */ { $$= 0; }
| COMMENT_SYM TEXT_STRING_sys
{
Lex->comment= Lex->event_parse_data->comment= $2;
$$= 1;
}
- ;
+ ;
ev_sql_stmt:
{
- LEX *lex= Lex;
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
/*
This stops the following :
@@ -1877,33 +1926,31 @@ ev_sql_stmt:
if (!(lex->sphead= new sp_head()))
MYSQL_YYABORT;
- lex->sphead->reset_thd_mem_root(YYTHD);
+ lex->sphead->reset_thd_mem_root(thd);
lex->sphead->init(lex);
- lex->sphead->init_sp_name(YYTHD, Lex->event_parse_data->identifier);
+ lex->sphead->init_sp_name(thd, lex->event_parse_data->identifier);
lex->sphead->m_type= TYPE_ENUM_PROCEDURE;
bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics));
lex->sphead->m_chistics= &lex->sp_chistics;
- lex->sphead->m_body_begin= lex->ptr;
-
- Lex->event_parse_data->body_begin= lex->ptr;
-
+ lex->sphead->set_body_start(thd, lip->get_cpp_ptr());
}
ev_sql_stmt_inner
{
- LEX *lex=Lex;
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
/* return back to the original memory root ASAP */
- lex->sphead->init_strings(YYTHD, lex);
- lex->sphead->restore_thd_mem_root(YYTHD);
+ lex->sphead->set_stmt_end(thd);
+ lex->sphead->restore_thd_mem_root(thd);
lex->sp_chistics.suid= SP_IS_SUID; //always the definer!
- Lex->event_parse_data->init_body(YYTHD);
+ lex->event_parse_data->body_changed= TRUE;
}
- ;
+ ;
ev_sql_stmt_inner:
sp_proc_stmt_statement
@@ -1917,60 +1964,60 @@ ev_sql_stmt_inner:
| sp_proc_stmt_open
| sp_proc_stmt_fetch
| sp_proc_stmt_close
- ;
-
+ ;
clear_privileges:
- /* Nothing */
- {
- LEX *lex=Lex;
- lex->users_list.empty();
- lex->columns.empty();
- lex->grant= lex->grant_tot_col= 0;
- lex->all_privileges= 0;
- lex->select_lex.db= 0;
- lex->ssl_type= SSL_TYPE_NOT_SPECIFIED;
- lex->ssl_cipher= lex->x509_subject= lex->x509_issuer= 0;
- bzero((char *)&(lex->mqh),sizeof(lex->mqh));
- }
+ /* Nothing */
+ {
+ LEX *lex=Lex;
+ lex->users_list.empty();
+ lex->columns.empty();
+ lex->grant= lex->grant_tot_col= 0;
+ lex->all_privileges= 0;
+ lex->select_lex.db= 0;
+ lex->ssl_type= SSL_TYPE_NOT_SPECIFIED;
+ lex->ssl_cipher= lex->x509_subject= lex->x509_issuer= 0;
+ bzero((char *)&(lex->mqh),sizeof(lex->mqh));
+ }
;
sp_name:
- ident '.' ident
- {
+ ident '.' ident
+ {
if (!$1.str || check_db_name(&$1))
{
- my_error(ER_WRONG_DB_NAME, MYF(0), $1.str);
- MYSQL_YYABORT;
- }
- if (check_routine_name(&$3))
- {
- MYSQL_YYABORT;
- }
- $$= new sp_name($1, $3, true);
- $$->init_qname(YYTHD);
- }
- | ident
- {
+ my_error(ER_WRONG_DB_NAME, MYF(0), $1.str);
+ MYSQL_YYABORT;
+ }
+ if (check_routine_name(&$3))
+ {
+ MYSQL_YYABORT;
+ }
+ $$= new sp_name($1, $3, true);
+ $$->init_qname(YYTHD);
+ }
+ | ident
+ {
THD *thd= YYTHD;
+ LEX *lex= thd->lex;
LEX_STRING db;
- if (check_routine_name(&$1))
+ if (check_routine_name(&$1))
{
- MYSQL_YYABORT;
- }
- if (thd->copy_db_to(&db.str, &db.length))
MYSQL_YYABORT;
- $$= new sp_name(db, $1, false);
+ }
+ if (lex->copy_db_to(&db.str, &db.length))
+ MYSQL_YYABORT;
+ $$= new sp_name(db, $1, false);
if ($$)
- $$->init_qname(YYTHD);
- }
- ;
+ $$->init_qname(thd);
+ }
+ ;
create_function_tail:
- RETURNS_SYM udf_type SONAME_SYM TEXT_STRING_sys
- {
+ RETURNS_SYM udf_type SONAME_SYM TEXT_STRING_sys
+ {
THD *thd= YYTHD;
- LEX *lex= thd->lex;
+ LEX *lex= thd->lex;
if (lex->definer != NULL)
{
/*
@@ -1979,7 +2026,7 @@ create_function_tail:
Using DEFINER with UDF has therefore no semantic,
and is considered a parsing error.
*/
- my_error(ER_WRONG_USAGE, MYF(0), "SONAME", "DEFINER");
+ my_error(ER_WRONG_USAGE, MYF(0), "SONAME", "DEFINER");
MYSQL_YYABORT;
}
if (is_native_function(thd, & lex->spname->m_name))
@@ -1988,15 +2035,18 @@ create_function_tail:
lex->spname->m_name.str);
MYSQL_YYABORT;
}
- lex->sql_command = SQLCOM_CREATE_FUNCTION;
- lex->udf.name = lex->spname->m_name;
- lex->udf.returns=(Item_result) $2;
- lex->udf.dl=$4.str;
- }
- | '('
- {
- LEX *lex= Lex;
- sp_head *sp;
+ lex->sql_command = SQLCOM_CREATE_FUNCTION;
+ lex->udf.name = lex->spname->m_name;
+ lex->udf.returns=(Item_result) $2;
+ lex->udf.dl=$4.str;
+ }
+ | '('
+ {
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
+ sp_head *sp;
+ const char* tmp_param_begin;
/*
First check if AGGREGATE was used, in that case it's a
@@ -2008,46 +2058,51 @@ create_function_tail:
MYSQL_YYABORT;
}
- if (lex->sphead)
- {
- my_error(ER_SP_NO_RECURSIVE_CREATE, MYF(0), "FUNCTION");
- MYSQL_YYABORT;
- }
- /* Order is important here: new - reset - init */
- sp= new sp_head();
- sp->reset_thd_mem_root(YYTHD);
- sp->init(lex);
- sp->init_sp_name(YYTHD, lex->spname);
-
- sp->m_type= TYPE_ENUM_FUNCTION;
- lex->sphead= sp;
- /*
- We have to turn off CLIENT_MULTI_QUERIES while parsing a
- stored procedure, otherwise yylex will chop it into pieces
- at each ';'.
- */
- $<ulong_num>$= YYTHD->client_capabilities & CLIENT_MULTI_QUERIES;
- YYTHD->client_capabilities &= ~CLIENT_MULTI_QUERIES;
- lex->sphead->m_param_begin= lex->tok_start+1;
- }
+ if (lex->sphead)
+ {
+ my_error(ER_SP_NO_RECURSIVE_CREATE, MYF(0), "FUNCTION");
+ MYSQL_YYABORT;
+ }
+ /* Order is important here: new - reset - init */
+ sp= new sp_head();
+ sp->reset_thd_mem_root(thd);
+ sp->init(lex);
+ sp->init_sp_name(thd, lex->spname);
+
+ sp->m_type= TYPE_ENUM_FUNCTION;
+ lex->sphead= sp;
+ /*
+ We have to turn off CLIENT_MULTI_QUERIES while parsing a
+ stored procedure, otherwise yylex will chop it into pieces
+ at each ';'.
+ */
+ $<ulong_num>$= thd->client_capabilities & CLIENT_MULTI_QUERIES;
+ thd->client_capabilities &= ~CLIENT_MULTI_QUERIES;
+
+ tmp_param_begin= lip->get_cpp_tok_start();
+ tmp_param_begin++;
+ lex->sphead->m_param_begin= tmp_param_begin;
+ }
sp_fdparam_list ')'
- {
- LEX *lex= Lex;
-
- lex->sphead->m_param_end= lex->tok_start;
- }
- RETURNS_SYM
- {
- LEX *lex= Lex;
- lex->charset= NULL;
- lex->length= lex->dec= NULL;
- lex->interval_list.empty();
- lex->type= 0;
- }
- type
- {
- LEX *lex= Lex;
- sp_head *sp= lex->sphead;
+ {
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
+
+ lex->sphead->m_param_end= lip->get_cpp_tok_start();
+ }
+ RETURNS_SYM
+ {
+ LEX *lex= Lex;
+ lex->charset= NULL;
+ lex->length= lex->dec= NULL;
+ lex->interval_list.empty();
+ lex->type= 0;
+ }
+ type
+ {
+ LEX *lex= Lex;
+ sp_head *sp= lex->sphead;
/*
This was disabled in 5.1.12. See bug #20701
When collation support in SP is implemented, then this test
@@ -2065,26 +2120,28 @@ create_function_tail:
&sp->m_return_field_def))
MYSQL_YYABORT;
- bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics));
- }
- sp_c_chistics
- {
- LEX *lex= Lex;
+ bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics));
+ }
+ sp_c_chistics
+ {
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
- lex->sphead->m_chistics= &lex->sp_chistics;
- lex->sphead->m_body_begin= lex->tok_start;
- }
- sp_proc_stmt
- {
+ lex->sphead->m_chistics= &lex->sp_chistics;
+ lex->sphead->set_body_start(thd, lip->get_cpp_tok_start());
+ }
+ sp_proc_stmt
+ {
THD *thd= YYTHD;
- LEX *lex= thd->lex;
- sp_head *sp= lex->sphead;
+ LEX *lex= thd->lex;
+ sp_head *sp= lex->sphead;
if (sp->is_not_allowed_in_function("function"))
MYSQL_YYABORT;
- lex->sql_command= SQLCOM_CREATE_SPFUNCTION;
- sp->init_strings(thd, lex);
+ lex->sql_command= SQLCOM_CREATE_SPFUNCTION;
+ sp->set_stmt_end(thd);
if (!(sp->m_flags & sp_head::HAS_RETURN))
{
my_error(ER_SP_NORETURN, MYF(0), sp->m_qname.str);
@@ -2125,76 +2182,76 @@ create_function_tail:
ER(ER_NATIVE_FCT_NAME_COLLISION),
sp->m_name.str);
}
- /* Restore flag if it was cleared above */
- thd->client_capabilities |= $<ulong_num>2;
- sp->restore_thd_mem_root(thd);
- }
- ;
+ /* Restore flag if it was cleared above */
+ thd->client_capabilities |= $<ulong_num>2;
+ sp->restore_thd_mem_root(thd);
+ }
+ ;
sp_a_chistics:
- /* Empty */ {}
- | sp_a_chistics sp_chistic {}
- ;
+ /* Empty */ {}
+ | sp_a_chistics sp_chistic {}
+ ;
sp_c_chistics:
- /* Empty */ {}
- | sp_c_chistics sp_c_chistic {}
- ;
+ /* Empty */ {}
+ | sp_c_chistics sp_c_chistic {}
+ ;
/* Characteristics for both create and alter */
sp_chistic:
- COMMENT_SYM TEXT_STRING_sys
- { Lex->sp_chistics.comment= $2; }
- | LANGUAGE_SYM SQL_SYM
- { /* Just parse it, we only have one language for now. */ }
- | NO_SYM SQL_SYM
- { Lex->sp_chistics.daccess= SP_NO_SQL; }
- | CONTAINS_SYM SQL_SYM
- { Lex->sp_chistics.daccess= SP_CONTAINS_SQL; }
- | READS_SYM SQL_SYM DATA_SYM
- { Lex->sp_chistics.daccess= SP_READS_SQL_DATA; }
- | MODIFIES_SYM SQL_SYM DATA_SYM
- { Lex->sp_chistics.daccess= SP_MODIFIES_SQL_DATA; }
- | sp_suid
- { }
- ;
+ COMMENT_SYM TEXT_STRING_sys
+ { Lex->sp_chistics.comment= $2; }
+ | LANGUAGE_SYM SQL_SYM
+ { /* Just parse it, we only have one language for now. */ }
+ | NO_SYM SQL_SYM
+ { Lex->sp_chistics.daccess= SP_NO_SQL; }
+ | CONTAINS_SYM SQL_SYM
+ { Lex->sp_chistics.daccess= SP_CONTAINS_SQL; }
+ | READS_SYM SQL_SYM DATA_SYM
+ { Lex->sp_chistics.daccess= SP_READS_SQL_DATA; }
+ | MODIFIES_SYM SQL_SYM DATA_SYM
+ { Lex->sp_chistics.daccess= SP_MODIFIES_SQL_DATA; }
+ | sp_suid
+ {}
+ ;
/* Create characteristics */
sp_c_chistic:
- sp_chistic { }
- | DETERMINISTIC_SYM { Lex->sp_chistics.detistic= TRUE; }
- | not DETERMINISTIC_SYM { Lex->sp_chistics.detistic= FALSE; }
- ;
+ sp_chistic { }
+ | DETERMINISTIC_SYM { Lex->sp_chistics.detistic= TRUE; }
+ | not DETERMINISTIC_SYM { Lex->sp_chistics.detistic= FALSE; }
+ ;
sp_suid:
- SQL_SYM SECURITY_SYM DEFINER_SYM
- {
- Lex->sp_chistics.suid= SP_IS_SUID;
- }
- | SQL_SYM SECURITY_SYM INVOKER_SYM
- {
- Lex->sp_chistics.suid= SP_IS_NOT_SUID;
- }
- ;
+ SQL_SYM SECURITY_SYM DEFINER_SYM
+ {
+ Lex->sp_chistics.suid= SP_IS_SUID;
+ }
+ | SQL_SYM SECURITY_SYM INVOKER_SYM
+ {
+ Lex->sp_chistics.suid= SP_IS_NOT_SUID;
+ }
+ ;
call:
- CALL_SYM sp_name
- {
- LEX *lex = Lex;
-
- lex->sql_command= SQLCOM_CALL;
- lex->spname= $2;
- lex->value_list.empty();
- sp_add_used_routine(lex, YYTHD, $2, TYPE_ENUM_PROCEDURE);
- }
+ CALL_SYM sp_name
+ {
+ LEX *lex = Lex;
+
+ lex->sql_command= SQLCOM_CALL;
+ lex->spname= $2;
+ lex->value_list.empty();
+ sp_add_used_routine(lex, YYTHD, $2, TYPE_ENUM_PROCEDURE);
+ }
opt_sp_cparam_list {}
- ;
+ ;
/* CALL parameters */
opt_sp_cparam_list:
- /* Empty */
- | '(' opt_sp_cparams ')'
- ;
+ /* Empty */
+ | '(' opt_sp_cparams ')'
+ ;
opt_sp_cparams:
/* Empty */
@@ -2202,58 +2259,58 @@ opt_sp_cparams:
;
sp_cparams:
- sp_cparams ',' expr
- {
- Lex->value_list.push_back($3);
- }
- | expr
- {
- Lex->value_list.push_back($1);
- }
- ;
+ sp_cparams ',' expr
+ {
+ Lex->value_list.push_back($3);
+ }
+ | expr
+ {
+ Lex->value_list.push_back($1);
+ }
+ ;
/* Stored FUNCTION parameter declaration list */
sp_fdparam_list:
- /* Empty */
- | sp_fdparams
- ;
+ /* Empty */
+ | sp_fdparams
+ ;
sp_fdparams:
- sp_fdparams ',' sp_fdparam
- | sp_fdparam
- ;
+ sp_fdparams ',' sp_fdparam
+ | sp_fdparam
+ ;
sp_init_param:
- /* Empty */
- {
- LEX *lex= Lex;
-
- lex->length= 0;
- lex->dec= 0;
- lex->type= 0;
-
- lex->default_value= 0;
- lex->on_update_value= 0;
-
- lex->comment= null_lex_str;
- lex->charset= NULL;
-
- lex->interval_list.empty();
- lex->uint_geom_type= 0;
- }
- ;
+ /* Empty */
+ {
+ LEX *lex= Lex;
+
+ lex->length= 0;
+ lex->dec= 0;
+ lex->type= 0;
+
+ lex->default_value= 0;
+ lex->on_update_value= 0;
+
+ lex->comment= null_lex_str;
+ lex->charset= NULL;
+
+ lex->interval_list.empty();
+ lex->uint_geom_type= 0;
+ }
+ ;
sp_fdparam:
- ident sp_init_param type
- {
- LEX *lex= Lex;
- sp_pcontext *spc= lex->spcont;
-
- if (spc->find_variable(&$1, TRUE))
- {
- my_error(ER_SP_DUP_PARAM, MYF(0), $1.str);
- MYSQL_YYABORT;
- }
+ ident sp_init_param type
+ {
+ LEX *lex= Lex;
+ sp_pcontext *spc= lex->spcont;
+
+ if (spc->find_variable(&$1, TRUE))
+ {
+ my_error(ER_SP_DUP_PARAM, MYF(0), $1.str);
+ MYSQL_YYABORT;
+ }
sp_variable_t *spvar= spc->push_variable(&$1,
(enum enum_field_types)$3,
sp_param_in);
@@ -2266,31 +2323,31 @@ sp_fdparam:
}
spvar->field_def.field_name= spvar->name.str;
spvar->field_def.pack_flag |= FIELDFLAG_MAYBE_NULL;
- }
- ;
+ }
+ ;
/* Stored PROCEDURE parameter declaration list */
sp_pdparam_list:
- /* Empty */
- | sp_pdparams
- ;
+ /* Empty */
+ | sp_pdparams
+ ;
sp_pdparams:
- sp_pdparams ',' sp_pdparam
- | sp_pdparam
- ;
+ sp_pdparams ',' sp_pdparam
+ | sp_pdparam
+ ;
sp_pdparam:
- sp_opt_inout sp_init_param ident type
- {
- LEX *lex= Lex;
- sp_pcontext *spc= lex->spcont;
-
- if (spc->find_variable(&$3, TRUE))
- {
- my_error(ER_SP_DUP_PARAM, MYF(0), $3.str);
- MYSQL_YYABORT;
- }
+ sp_opt_inout sp_init_param ident type
+ {
+ LEX *lex= Lex;
+ sp_pcontext *spc= lex->spcont;
+
+ if (spc->find_variable(&$3, TRUE))
+ {
+ my_error(ER_SP_DUP_PARAM, MYF(0), $3.str);
+ MYSQL_YYABORT;
+ }
sp_variable_t *spvar= spc->push_variable(&$3,
(enum enum_field_types)$4,
(sp_param_mode_t)$1);
@@ -2303,55 +2360,55 @@ sp_pdparam:
}
spvar->field_def.field_name= spvar->name.str;
spvar->field_def.pack_flag |= FIELDFLAG_MAYBE_NULL;
- }
- ;
+ }
+ ;
sp_opt_inout:
- /* Empty */ { $$= sp_param_in; }
- | IN_SYM { $$= sp_param_in; }
- | OUT_SYM { $$= sp_param_out; }
- | INOUT_SYM { $$= sp_param_inout; }
- ;
+ /* Empty */ { $$= sp_param_in; }
+ | IN_SYM { $$= sp_param_in; }
+ | OUT_SYM { $$= sp_param_out; }
+ | INOUT_SYM { $$= sp_param_inout; }
+ ;
sp_proc_stmts:
- /* Empty */ {}
- | sp_proc_stmts sp_proc_stmt ';'
- ;
+ /* Empty */ {}
+ | sp_proc_stmts sp_proc_stmt ';'
+ ;
sp_proc_stmts1:
- sp_proc_stmt ';' {}
- | sp_proc_stmts1 sp_proc_stmt ';'
- ;
+ sp_proc_stmt ';' {}
+ | sp_proc_stmts1 sp_proc_stmt ';'
+ ;
sp_decls:
- /* Empty */
- {
- $$.vars= $$.conds= $$.hndlrs= $$.curs= 0;
- }
- | sp_decls sp_decl ';'
- {
- /* We check for declarations out of (standard) order this way
- because letting the grammar rules reflect it caused tricky
- shift/reduce conflicts with the wrong result. (And we get
- better error handling this way.) */
- if (($2.vars || $2.conds) && ($1.curs || $1.hndlrs))
- { /* Variable or condition following cursor or handler */
- my_message(ER_SP_VARCOND_AFTER_CURSHNDLR,
+ /* Empty */
+ {
+ $$.vars= $$.conds= $$.hndlrs= $$.curs= 0;
+ }
+ | sp_decls sp_decl ';'
+ {
+ /* We check for declarations out of (standard) order this way
+ because letting the grammar rules reflect it caused tricky
+ shift/reduce conflicts with the wrong result. (And we get
+ better error handling this way.) */
+ if (($2.vars || $2.conds) && ($1.curs || $1.hndlrs))
+ { /* Variable or condition following cursor or handler */
+ my_message(ER_SP_VARCOND_AFTER_CURSHNDLR,
ER(ER_SP_VARCOND_AFTER_CURSHNDLR), MYF(0));
- MYSQL_YYABORT;
- }
- if ($2.curs && $1.hndlrs)
- { /* Cursor following handler */
- my_message(ER_SP_CURSOR_AFTER_HANDLER,
+ MYSQL_YYABORT;
+ }
+ if ($2.curs && $1.hndlrs)
+ { /* Cursor following handler */
+ my_message(ER_SP_CURSOR_AFTER_HANDLER,
ER(ER_SP_CURSOR_AFTER_HANDLER), MYF(0));
- MYSQL_YYABORT;
- }
- $$.vars= $1.vars + $2.vars;
- $$.conds= $1.conds + $2.conds;
- $$.hndlrs= $1.hndlrs + $2.hndlrs;
- $$.curs= $1.curs + $2.curs;
- }
- ;
+ MYSQL_YYABORT;
+ }
+ $$.vars= $1.vars + $2.vars;
+ $$.conds= $1.conds + $2.conds;
+ $$.hndlrs= $1.hndlrs + $2.hndlrs;
+ $$.curs= $1.curs + $2.curs;
+ }
+ ;
sp_decl:
DECLARE_SYM sp_decl_idents
@@ -2410,126 +2467,126 @@ sp_decl:
$$.vars= $2;
$$.conds= $$.hndlrs= $$.curs= 0;
}
- | DECLARE_SYM ident CONDITION_SYM FOR_SYM sp_cond
- {
- 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;
- }
- YYTHD->lex->spcont->push_cond(&$2, $5);
- $$.vars= $$.hndlrs= $$.curs= 0;
- $$.conds= 1;
- }
- | DECLARE_SYM sp_handler_type HANDLER_SYM FOR_SYM
- {
- LEX *lex= Lex;
- sp_head *sp= lex->sphead;
+ | DECLARE_SYM ident CONDITION_SYM FOR_SYM sp_cond
+ {
+ 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;
+ }
+ YYTHD->lex->spcont->push_cond(&$2, $5);
+ $$.vars= $$.hndlrs= $$.curs= 0;
+ $$.conds= 1;
+ }
+ | DECLARE_SYM sp_handler_type HANDLER_SYM FOR_SYM
+ {
+ LEX *lex= Lex;
+ sp_head *sp= lex->sphead;
lex->spcont= lex->spcont->push_context(LABEL_HANDLER_SCOPE);
- sp_pcontext *ctx= lex->spcont;
- sp_instr_hpush_jump *i=
+ sp_pcontext *ctx= lex->spcont;
+ sp_instr_hpush_jump *i=
new sp_instr_hpush_jump(sp->instructions(), ctx, $2,
- ctx->current_var_count());
-
- sp->add_instr(i);
- sp->push_backpatch(i, ctx->push_label((char *)"", 0));
- }
- sp_hcond_list sp_proc_stmt
- {
- LEX *lex= Lex;
- sp_head *sp= lex->sphead;
- sp_pcontext *ctx= lex->spcont;
- sp_label_t *hlab= lex->spcont->pop_label(); /* After this hdlr */
- sp_instr_hreturn *i;
-
- if ($2 == SP_HANDLER_CONTINUE)
- {
- i= new sp_instr_hreturn(sp->instructions(), ctx,
- ctx->current_var_count());
- sp->add_instr(i);
- }
- else
- { /* EXIT or UNDO handler, just jump to the end of the block */
- i= new sp_instr_hreturn(sp->instructions(), ctx, 0);
-
- sp->add_instr(i);
- sp->push_backpatch(i, lex->spcont->last_label()); /* Block end */
- }
- lex->sphead->backpatch(hlab);
+ ctx->current_var_count());
+
+ sp->add_instr(i);
+ sp->push_backpatch(i, ctx->push_label((char *)"", 0));
+ }
+ sp_hcond_list sp_proc_stmt
+ {
+ LEX *lex= Lex;
+ sp_head *sp= lex->sphead;
+ sp_pcontext *ctx= lex->spcont;
+ sp_label_t *hlab= lex->spcont->pop_label(); /* After this hdlr */
+ sp_instr_hreturn *i;
+
+ if ($2 == SP_HANDLER_CONTINUE)
+ {
+ i= new sp_instr_hreturn(sp->instructions(), ctx,
+ ctx->current_var_count());
+ sp->add_instr(i);
+ }
+ else
+ { /* EXIT or UNDO handler, just jump to the end of the block */
+ i= new sp_instr_hreturn(sp->instructions(), ctx, 0);
+
+ sp->add_instr(i);
+ sp->push_backpatch(i, lex->spcont->last_label()); /* Block end */
+ }
+ lex->sphead->backpatch(hlab);
lex->spcont= ctx->pop_context();
- $$.vars= $$.conds= $$.curs= 0;
- $$.hndlrs= $6;
- lex->spcont->add_handlers($6);
- }
- | DECLARE_SYM ident CURSOR_SYM FOR_SYM sp_cursor_stmt
- {
- LEX *lex= Lex;
- sp_head *sp= lex->sphead;
- sp_pcontext *ctx= lex->spcont;
- uint offp;
- sp_instr_cpush *i;
-
- if (ctx->find_cursor(&$2, &offp, TRUE))
- {
- my_error(ER_SP_DUP_CURS, MYF(0), $2.str);
- delete $5;
- MYSQL_YYABORT;
- }
+ $$.vars= $$.conds= $$.curs= 0;
+ $$.hndlrs= $6;
+ lex->spcont->add_handlers($6);
+ }
+ | DECLARE_SYM ident CURSOR_SYM FOR_SYM sp_cursor_stmt
+ {
+ LEX *lex= Lex;
+ sp_head *sp= lex->sphead;
+ sp_pcontext *ctx= lex->spcont;
+ uint offp;
+ sp_instr_cpush *i;
+
+ if (ctx->find_cursor(&$2, &offp, TRUE))
+ {
+ my_error(ER_SP_DUP_CURS, MYF(0), $2.str);
+ delete $5;
+ MYSQL_YYABORT;
+ }
i= new sp_instr_cpush(sp->instructions(), ctx, $5,
ctx->current_cursor_count());
- sp->add_instr(i);
- ctx->push_cursor(&$2);
- $$.vars= $$.conds= $$.hndlrs= 0;
- $$.curs= 1;
- }
- ;
+ sp->add_instr(i);
+ ctx->push_cursor(&$2);
+ $$.vars= $$.conds= $$.hndlrs= 0;
+ $$.curs= 1;
+ }
+ ;
sp_cursor_stmt:
- {
- Lex->sphead->reset_lex(YYTHD);
-
- /*
- We use statement here just be able to get a better
- error message. Using 'select' works too, but will then
- result in a generic "syntax error" if a non-select
- statement is given.
- */
- }
- statement
- {
- LEX *lex= Lex;
-
- if (lex->sql_command != SQLCOM_SELECT &&
- !(sql_command_flags[lex->sql_command] & CF_STATUS_COMMAND))
- {
- my_message(ER_SP_BAD_CURSOR_QUERY, ER(ER_SP_BAD_CURSOR_QUERY),
+ {
+ Lex->sphead->reset_lex(YYTHD);
+
+ /*
+ We use statement here just be able to get a better
+ error message. Using 'select' works too, but will then
+ result in a generic "syntax error" if a non-select
+ statement is given.
+ */
+ }
+ statement
+ {
+ LEX *lex= Lex;
+
+ if (lex->sql_command != SQLCOM_SELECT &&
+ !(sql_command_flags[lex->sql_command] & CF_STATUS_COMMAND))
+ {
+ my_message(ER_SP_BAD_CURSOR_QUERY, ER(ER_SP_BAD_CURSOR_QUERY),
MYF(0));
- MYSQL_YYABORT;
- }
- if (lex->result)
- {
- my_message(ER_SP_BAD_CURSOR_SELECT, ER(ER_SP_BAD_CURSOR_SELECT),
+ MYSQL_YYABORT;
+ }
+ if (lex->result)
+ {
+ my_message(ER_SP_BAD_CURSOR_SELECT, ER(ER_SP_BAD_CURSOR_SELECT),
MYF(0));
- MYSQL_YYABORT;
- }
- lex->sp_lex_in_use= TRUE;
- $$= lex;
- lex->sphead->restore_lex(YYTHD);
- }
- ;
+ MYSQL_YYABORT;
+ }
+ lex->sp_lex_in_use= TRUE;
+ $$= lex;
+ lex->sphead->restore_lex(YYTHD);
+ }
+ ;
sp_handler_type:
- EXIT_SYM { $$= SP_HANDLER_EXIT; }
- | CONTINUE_SYM { $$= SP_HANDLER_CONTINUE; }
-/* | UNDO_SYM { QQ No yet } */
- ;
+ EXIT_SYM { $$= SP_HANDLER_EXIT; }
+ | CONTINUE_SYM { $$= SP_HANDLER_CONTINUE; }
+ /*| UNDO_SYM { QQ No yet } */
+ ;
sp_hcond_list:
sp_hcond_element
@@ -2539,170 +2596,175 @@ sp_hcond_list:
;
sp_hcond_element:
- sp_hcond
- {
- LEX *lex= Lex;
- sp_head *sp= lex->sphead;
- sp_pcontext *ctx= lex->spcont->parent_context();
-
- if (ctx->find_handler($1))
- {
- my_message(ER_SP_DUP_HANDLER, ER(ER_SP_DUP_HANDLER), MYF(0));
- MYSQL_YYABORT;
- }
- else
- {
- sp_instr_hpush_jump *i=
+ sp_hcond
+ {
+ LEX *lex= Lex;
+ sp_head *sp= lex->sphead;
+ sp_pcontext *ctx= lex->spcont->parent_context();
+
+ if (ctx->find_handler($1))
+ {
+ my_message(ER_SP_DUP_HANDLER, ER(ER_SP_DUP_HANDLER), MYF(0));
+ MYSQL_YYABORT;
+ }
+ else
+ {
+ sp_instr_hpush_jump *i=
(sp_instr_hpush_jump *)sp->last_instruction();
- i->add_condition($1);
- ctx->push_handler($1);
- }
- }
- ;
+ i->add_condition($1);
+ ctx->push_handler($1);
+ }
+ }
+ ;
sp_cond:
- ulong_num
- { /* mysql errno */
- $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t));
- $$->type= sp_cond_type_t::number;
- $$->mysqlerr= $1;
- }
- | SQLSTATE_SYM opt_value TEXT_STRING_literal
- { /* SQLSTATE */
- if (!sp_cond_check(&$3))
- {
- my_error(ER_SP_BAD_SQLSTATE, MYF(0), $3.str);
- MYSQL_YYABORT;
- }
- $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t));
- $$->type= sp_cond_type_t::state;
- memcpy($$->sqlstate, $3.str, 5);
- $$->sqlstate[5]= '\0';
- }
- ;
+ ulong_num
+ { /* mysql errno */
+ $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t));
+ $$->type= sp_cond_type_t::number;
+ $$->mysqlerr= $1;
+ }
+ | SQLSTATE_SYM opt_value TEXT_STRING_literal
+ { /* SQLSTATE */
+ if (!sp_cond_check(&$3))
+ {
+ my_error(ER_SP_BAD_SQLSTATE, MYF(0), $3.str);
+ MYSQL_YYABORT;
+ }
+ $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t));
+ $$->type= sp_cond_type_t::state;
+ memcpy($$->sqlstate, $3.str, 5);
+ $$->sqlstate[5]= '\0';
+ }
+ ;
opt_value:
- /* Empty */ {}
- | VALUE_SYM {}
- ;
+ /* Empty */ {}
+ | VALUE_SYM {}
+ ;
sp_hcond:
- sp_cond
- {
- $$= $1;
- }
- | ident /* CONDITION name */
- {
- $$= Lex->spcont->find_cond(&$1);
- if ($$ == NULL)
- {
- my_error(ER_SP_COND_MISMATCH, MYF(0), $1.str);
- MYSQL_YYABORT;
- }
- }
- | SQLWARNING_SYM /* SQLSTATEs 01??? */
- {
- $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t));
- $$->type= sp_cond_type_t::warning;
- }
- | not FOUND_SYM /* SQLSTATEs 02??? */
- {
- $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t));
- $$->type= sp_cond_type_t::notfound;
- }
- | SQLEXCEPTION_SYM /* All other SQLSTATEs */
- {
- $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t));
- $$->type= sp_cond_type_t::exception;
- }
- ;
+ sp_cond
+ {
+ $$= $1;
+ }
+ | ident /* CONDITION name */
+ {
+ $$= Lex->spcont->find_cond(&$1);
+ if ($$ == NULL)
+ {
+ my_error(ER_SP_COND_MISMATCH, MYF(0), $1.str);
+ MYSQL_YYABORT;
+ }
+ }
+ | SQLWARNING_SYM /* SQLSTATEs 01??? */
+ {
+ $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t));
+ $$->type= sp_cond_type_t::warning;
+ }
+ | not FOUND_SYM /* SQLSTATEs 02??? */
+ {
+ $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t));
+ $$->type= sp_cond_type_t::notfound;
+ }
+ | SQLEXCEPTION_SYM /* All other SQLSTATEs */
+ {
+ $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t));
+ $$->type= sp_cond_type_t::exception;
+ }
+ ;
sp_decl_idents:
- ident
- {
+ ident
+ {
/* NOTE: field definition is filled in sp_decl section. */
- LEX *lex= Lex;
- sp_pcontext *spc= lex->spcont;
-
- if (spc->find_variable(&$1, TRUE))
- {
- my_error(ER_SP_DUP_VAR, MYF(0), $1.str);
- MYSQL_YYABORT;
- }
- spc->push_variable(&$1, (enum_field_types)0, sp_param_in);
- $$= 1;
- }
- | sp_decl_idents ',' ident
- {
+ LEX *lex= Lex;
+ sp_pcontext *spc= lex->spcont;
+
+ if (spc->find_variable(&$1, TRUE))
+ {
+ my_error(ER_SP_DUP_VAR, MYF(0), $1.str);
+ MYSQL_YYABORT;
+ }
+ spc->push_variable(&$1, (enum_field_types)0, sp_param_in);
+ $$= 1;
+ }
+ | sp_decl_idents ',' ident
+ {
/* NOTE: field definition is filled in sp_decl section. */
- LEX *lex= Lex;
- sp_pcontext *spc= lex->spcont;
-
- if (spc->find_variable(&$3, TRUE))
- {
- my_error(ER_SP_DUP_VAR, MYF(0), $3.str);
- MYSQL_YYABORT;
- }
- spc->push_variable(&$3, (enum_field_types)0, sp_param_in);
- $$= $1 + 1;
- }
- ;
+ LEX *lex= Lex;
+ sp_pcontext *spc= lex->spcont;
+
+ if (spc->find_variable(&$3, TRUE))
+ {
+ my_error(ER_SP_DUP_VAR, MYF(0), $3.str);
+ MYSQL_YYABORT;
+ }
+ spc->push_variable(&$3, (enum_field_types)0, sp_param_in);
+ $$= $1 + 1;
+ }
+ ;
sp_opt_default:
- /* Empty */ { $$ = NULL; }
+ /* Empty */ { $$ = NULL; }
| DEFAULT expr { $$ = $2; }
- ;
+ ;
sp_proc_stmt:
- sp_proc_stmt_statement
+ sp_proc_stmt_statement
| sp_proc_stmt_return
- | sp_proc_stmt_if
- | case_stmt_specification
- | sp_labeled_control
- | sp_proc_stmt_unlabeled
- | sp_proc_stmt_leave
- | sp_proc_stmt_iterate
- | sp_proc_stmt_open
- | sp_proc_stmt_fetch
+ | sp_proc_stmt_if
+ | case_stmt_specification
+ | sp_labeled_control
+ | sp_proc_stmt_unlabeled
+ | sp_proc_stmt_leave
+ | sp_proc_stmt_iterate
+ | sp_proc_stmt_open
+ | sp_proc_stmt_fetch
| sp_proc_stmt_close
;
sp_proc_stmt_if:
- IF { Lex->sphead->new_cont_backpatch(NULL); }
- sp_if END IF
- { Lex->sphead->do_cont_backpatch(); }
+ IF
+ { Lex->sphead->new_cont_backpatch(NULL); }
+ sp_if END IF
+ { Lex->sphead->do_cont_backpatch(); }
;
sp_proc_stmt_statement:
- {
- LEX *lex= Lex;
+ {
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
- lex->sphead->reset_lex(YYTHD);
- lex->sphead->m_tmp_query= lex->tok_start;
- }
- statement
- {
- LEX *lex= Lex;
- sp_head *sp= lex->sphead;
+ lex->sphead->reset_lex(thd);
+ lex->sphead->m_tmp_query= lip->get_tok_start();
+ }
+ statement
+ {
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
+ sp_head *sp= lex->sphead;
sp->m_flags|= sp_get_flags_for_command(lex);
- if (lex->sql_command == SQLCOM_CHANGE_DB)
- { /* "USE db" doesn't work in a procedure */
- my_error(ER_SP_BADSTATEMENT, MYF(0), "USE");
- MYSQL_YYABORT;
- }
- /*
+ if (lex->sql_command == SQLCOM_CHANGE_DB)
+ { /* "USE db" doesn't work in a procedure */
+ my_error(ER_SP_BADSTATEMENT, MYF(0), "USE");
+ MYSQL_YYABORT;
+ }
+ /*
Don't add an instruction for SET statements, since all
instructions for them were already added during processing
of "set" rule.
- */
+ */
DBUG_ASSERT(lex->sql_command != SQLCOM_SET_OPTION ||
lex->var_list.is_empty());
if (lex->sql_command != SQLCOM_SET_OPTION)
- {
+ {
sp_instr_stmt *i=new sp_instr_stmt(sp->instructions(),
lex->spcont, lex);
@@ -2712,267 +2774,266 @@ sp_proc_stmt_statement:
lex->tok_end otherwise.
*/
if (yychar == YYEMPTY)
- i->m_query.length= lex->ptr - sp->m_tmp_query;
+ i->m_query.length= lip->get_ptr() - sp->m_tmp_query;
else
- i->m_query.length= lex->tok_end - sp->m_tmp_query;
- i->m_query.str= strmake_root(YYTHD->mem_root,
+ i->m_query.length= lip->get_tok_end() - sp->m_tmp_query;
+ i->m_query.str= strmake_root(thd->mem_root,
sp->m_tmp_query,
i->m_query.length);
sp->add_instr(i);
}
- sp->restore_lex(YYTHD);
+ sp->restore_lex(thd);
}
;
sp_proc_stmt_return:
- RETURN_SYM
+ RETURN_SYM
{ Lex->sphead->reset_lex(YYTHD); }
expr
- {
- LEX *lex= Lex;
- sp_head *sp= lex->sphead;
-
- if (sp->m_type != TYPE_ENUM_FUNCTION)
- {
- my_message(ER_SP_BADRETURN, ER(ER_SP_BADRETURN), MYF(0));
- MYSQL_YYABORT;
- }
- else
- {
- sp_instr_freturn *i;
-
- i= new sp_instr_freturn(sp->instructions(), lex->spcont, $3,
+ {
+ LEX *lex= Lex;
+ sp_head *sp= lex->sphead;
+
+ if (sp->m_type != TYPE_ENUM_FUNCTION)
+ {
+ my_message(ER_SP_BADRETURN, ER(ER_SP_BADRETURN), MYF(0));
+ MYSQL_YYABORT;
+ }
+ else
+ {
+ sp_instr_freturn *i;
+
+ i= new sp_instr_freturn(sp->instructions(), lex->spcont, $3,
sp->m_return_field_def.sql_type, lex);
- sp->add_instr(i);
- sp->m_flags|= sp_head::HAS_RETURN;
- }
- sp->restore_lex(YYTHD);
- }
+ sp->add_instr(i);
+ sp->m_flags|= sp_head::HAS_RETURN;
+ }
+ sp->restore_lex(YYTHD);
+ }
;
sp_proc_stmt_unlabeled:
- { /* Unlabeled controls get a secret label. */
- LEX *lex= Lex;
+ { /* Unlabeled controls get a secret label. */
+ LEX *lex= Lex;
- lex->spcont->push_label((char *)"", lex->sphead->instructions());
- }
- sp_unlabeled_control
- {
- LEX *lex= Lex;
+ lex->spcont->push_label((char *)"", lex->sphead->instructions());
+ }
+ sp_unlabeled_control
+ {
+ LEX *lex= Lex;
- lex->sphead->backpatch(lex->spcont->pop_label());
- }
+ lex->sphead->backpatch(lex->spcont->pop_label());
+ }
;
sp_proc_stmt_leave:
- LEAVE_SYM label_ident
- {
- LEX *lex= Lex;
- sp_head *sp = lex->sphead;
- sp_pcontext *ctx= lex->spcont;
- sp_label_t *lab= ctx->find_label($2.str);
-
- if (! lab)
- {
- my_error(ER_SP_LILABEL_MISMATCH, MYF(0), "LEAVE", $2.str);
- MYSQL_YYABORT;
- }
- else
- {
- sp_instr_jump *i;
- uint ip= sp->instructions();
- uint n;
-
- n= ctx->diff_handlers(lab->ctx, TRUE); /* Exclusive the dest. */
- if (n)
- sp->add_instr(new sp_instr_hpop(ip++, ctx, n));
- n= ctx->diff_cursors(lab->ctx, TRUE); /* Exclusive the dest. */
- if (n)
- sp->add_instr(new sp_instr_cpop(ip++, ctx, n));
- i= new sp_instr_jump(ip, ctx);
- sp->push_backpatch(i, lab); /* Jumping forward */
+ LEAVE_SYM label_ident
+ {
+ LEX *lex= Lex;
+ sp_head *sp = lex->sphead;
+ sp_pcontext *ctx= lex->spcont;
+ sp_label_t *lab= ctx->find_label($2.str);
+
+ if (! lab)
+ {
+ my_error(ER_SP_LILABEL_MISMATCH, MYF(0), "LEAVE", $2.str);
+ MYSQL_YYABORT;
+ }
+ else
+ {
+ sp_instr_jump *i;
+ uint ip= sp->instructions();
+ uint n;
+
+ n= ctx->diff_handlers(lab->ctx, TRUE); /* Exclusive the dest. */
+ if (n)
+ sp->add_instr(new sp_instr_hpop(ip++, ctx, n));
+ n= ctx->diff_cursors(lab->ctx, TRUE); /* Exclusive the dest. */
+ if (n)
+ sp->add_instr(new sp_instr_cpop(ip++, ctx, n));
+ i= new sp_instr_jump(ip, ctx);
+ sp->push_backpatch(i, lab); /* Jumping forward */
sp->add_instr(i);
- }
- }
+ }
+ }
;
sp_proc_stmt_iterate:
- ITERATE_SYM label_ident
- {
- LEX *lex= Lex;
- sp_head *sp= lex->sphead;
- sp_pcontext *ctx= lex->spcont;
- sp_label_t *lab= ctx->find_label($2.str);
-
- if (! lab || lab->type != SP_LAB_ITER)
- {
- my_error(ER_SP_LILABEL_MISMATCH, MYF(0), "ITERATE", $2.str);
- MYSQL_YYABORT;
- }
- else
- {
- sp_instr_jump *i;
- uint ip= sp->instructions();
- uint n;
-
- n= ctx->diff_handlers(lab->ctx, FALSE); /* Inclusive the dest. */
- if (n)
- sp->add_instr(new sp_instr_hpop(ip++, ctx, n));
- n= ctx->diff_cursors(lab->ctx, FALSE); /* Inclusive the dest. */
- if (n)
- sp->add_instr(new sp_instr_cpop(ip++, ctx, n));
- i= new sp_instr_jump(ip, ctx, lab->ip); /* Jump back */
+ ITERATE_SYM label_ident
+ {
+ LEX *lex= Lex;
+ sp_head *sp= lex->sphead;
+ sp_pcontext *ctx= lex->spcont;
+ sp_label_t *lab= ctx->find_label($2.str);
+
+ if (! lab || lab->type != SP_LAB_ITER)
+ {
+ my_error(ER_SP_LILABEL_MISMATCH, MYF(0), "ITERATE", $2.str);
+ MYSQL_YYABORT;
+ }
+ else
+ {
+ sp_instr_jump *i;
+ uint ip= sp->instructions();
+ uint n;
+
+ n= ctx->diff_handlers(lab->ctx, FALSE); /* Inclusive the dest. */
+ if (n)
+ sp->add_instr(new sp_instr_hpop(ip++, ctx, n));
+ n= ctx->diff_cursors(lab->ctx, FALSE); /* Inclusive the dest. */
+ if (n)
+ sp->add_instr(new sp_instr_cpop(ip++, ctx, n));
+ i= new sp_instr_jump(ip, ctx, lab->ip); /* Jump back */
sp->add_instr(i);
- }
- }
+ }
+ }
;
sp_proc_stmt_open:
- OPEN_SYM ident
- {
- LEX *lex= Lex;
- sp_head *sp= lex->sphead;
- uint offset;
- sp_instr_copen *i;
-
- if (! lex->spcont->find_cursor(&$2, &offset))
- {
- my_error(ER_SP_CURSOR_MISMATCH, MYF(0), $2.str);
- MYSQL_YYABORT;
- }
- i= new sp_instr_copen(sp->instructions(), lex->spcont, offset);
- sp->add_instr(i);
- }
+ OPEN_SYM ident
+ {
+ LEX *lex= Lex;
+ sp_head *sp= lex->sphead;
+ uint offset;
+ sp_instr_copen *i;
+
+ if (! lex->spcont->find_cursor(&$2, &offset))
+ {
+ my_error(ER_SP_CURSOR_MISMATCH, MYF(0), $2.str);
+ MYSQL_YYABORT;
+ }
+ i= new sp_instr_copen(sp->instructions(), lex->spcont, offset);
+ sp->add_instr(i);
+ }
;
sp_proc_stmt_fetch:
- FETCH_SYM sp_opt_fetch_noise ident INTO
- {
- LEX *lex= Lex;
- sp_head *sp= lex->sphead;
- uint offset;
- sp_instr_cfetch *i;
-
- if (! lex->spcont->find_cursor(&$3, &offset))
- {
- my_error(ER_SP_CURSOR_MISMATCH, MYF(0), $3.str);
- MYSQL_YYABORT;
- }
- i= new sp_instr_cfetch(sp->instructions(), lex->spcont, offset);
- sp->add_instr(i);
- }
- sp_fetch_list
- { }
+ FETCH_SYM sp_opt_fetch_noise ident INTO
+ {
+ LEX *lex= Lex;
+ sp_head *sp= lex->sphead;
+ uint offset;
+ sp_instr_cfetch *i;
+
+ if (! lex->spcont->find_cursor(&$3, &offset))
+ {
+ my_error(ER_SP_CURSOR_MISMATCH, MYF(0), $3.str);
+ MYSQL_YYABORT;
+ }
+ i= new sp_instr_cfetch(sp->instructions(), lex->spcont, offset);
+ sp->add_instr(i);
+ }
+ sp_fetch_list
+ {}
;
sp_proc_stmt_close:
- CLOSE_SYM ident
- {
- LEX *lex= Lex;
- sp_head *sp= lex->sphead;
- uint offset;
- sp_instr_cclose *i;
-
- if (! lex->spcont->find_cursor(&$2, &offset))
- {
- my_error(ER_SP_CURSOR_MISMATCH, MYF(0), $2.str);
- MYSQL_YYABORT;
- }
- i= new sp_instr_cclose(sp->instructions(), lex->spcont, offset);
- sp->add_instr(i);
- }
- ;
+ CLOSE_SYM ident
+ {
+ LEX *lex= Lex;
+ sp_head *sp= lex->sphead;
+ uint offset;
+ sp_instr_cclose *i;
+
+ if (! lex->spcont->find_cursor(&$2, &offset))
+ {
+ my_error(ER_SP_CURSOR_MISMATCH, MYF(0), $2.str);
+ MYSQL_YYABORT;
+ }
+ i= new sp_instr_cclose(sp->instructions(), lex->spcont, offset);
+ sp->add_instr(i);
+ }
+ ;
sp_opt_fetch_noise:
- /* Empty */
- | NEXT_SYM FROM
- | FROM
- ;
+ /* Empty */
+ | NEXT_SYM FROM
+ | FROM
+ ;
sp_fetch_list:
- ident
- {
- LEX *lex= Lex;
- sp_head *sp= lex->sphead;
- sp_pcontext *spc= lex->spcont;
- sp_variable_t *spv;
-
- if (!spc || !(spv = spc->find_variable(&$1)))
- {
- my_error(ER_SP_UNDECLARED_VAR, MYF(0), $1.str);
- MYSQL_YYABORT;
- }
- else
- {
- /* An SP local variable */
- sp_instr_cfetch *i= (sp_instr_cfetch *)sp->last_instruction();
-
- i->add_to_varlist(spv);
- }
- }
- |
- sp_fetch_list ',' ident
- {
- LEX *lex= Lex;
- sp_head *sp= lex->sphead;
- sp_pcontext *spc= lex->spcont;
- sp_variable_t *spv;
-
- if (!spc || !(spv = spc->find_variable(&$3)))
- {
- my_error(ER_SP_UNDECLARED_VAR, MYF(0), $3.str);
- MYSQL_YYABORT;
- }
- else
- {
- /* An SP local variable */
- sp_instr_cfetch *i= (sp_instr_cfetch *)sp->last_instruction();
-
- i->add_to_varlist(spv);
- }
- }
- ;
+ ident
+ {
+ LEX *lex= Lex;
+ sp_head *sp= lex->sphead;
+ sp_pcontext *spc= lex->spcont;
+ sp_variable_t *spv;
+
+ if (!spc || !(spv = spc->find_variable(&$1)))
+ {
+ my_error(ER_SP_UNDECLARED_VAR, MYF(0), $1.str);
+ MYSQL_YYABORT;
+ }
+ else
+ {
+ /* An SP local variable */
+ sp_instr_cfetch *i= (sp_instr_cfetch *)sp->last_instruction();
+
+ i->add_to_varlist(spv);
+ }
+ }
+ | sp_fetch_list ',' ident
+ {
+ LEX *lex= Lex;
+ sp_head *sp= lex->sphead;
+ sp_pcontext *spc= lex->spcont;
+ sp_variable_t *spv;
+
+ if (!spc || !(spv = spc->find_variable(&$3)))
+ {
+ my_error(ER_SP_UNDECLARED_VAR, MYF(0), $3.str);
+ MYSQL_YYABORT;
+ }
+ else
+ {
+ /* An SP local variable */
+ sp_instr_cfetch *i= (sp_instr_cfetch *)sp->last_instruction();
+
+ i->add_to_varlist(spv);
+ }
+ }
+ ;
sp_if:
{ Lex->sphead->reset_lex(YYTHD); }
expr THEN_SYM
- {
- LEX *lex= Lex;
- sp_head *sp= lex->sphead;
- sp_pcontext *ctx= lex->spcont;
- uint ip= sp->instructions();
- sp_instr_jump_if_not *i = new sp_instr_jump_if_not(ip, ctx,
+ {
+ LEX *lex= Lex;
+ sp_head *sp= lex->sphead;
+ sp_pcontext *ctx= lex->spcont;
+ uint ip= sp->instructions();
+ sp_instr_jump_if_not *i = new sp_instr_jump_if_not(ip, ctx,
$2, lex);
- 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);
sp->restore_lex(YYTHD);
- }
- sp_proc_stmts1
- {
- sp_head *sp= Lex->sphead;
- sp_pcontext *ctx= Lex->spcont;
- uint ip= sp->instructions();
- sp_instr_jump *i = new sp_instr_jump(ip, ctx);
-
- sp->add_instr(i);
- sp->backpatch(ctx->pop_label());
- sp->push_backpatch(i, ctx->push_label((char *)"", 0));
- }
- sp_elseifs
- {
- LEX *lex= Lex;
-
- lex->sphead->backpatch(lex->spcont->pop_label());
- }
- ;
+ }
+ sp_proc_stmts1
+ {
+ sp_head *sp= Lex->sphead;
+ sp_pcontext *ctx= Lex->spcont;
+ uint ip= sp->instructions();
+ sp_instr_jump *i = new sp_instr_jump(ip, ctx);
+
+ sp->add_instr(i);
+ sp->backpatch(ctx->pop_label());
+ sp->push_backpatch(i, ctx->push_label((char *)"", 0));
+ }
+ sp_elseifs
+ {
+ LEX *lex= Lex;
+
+ lex->sphead->backpatch(lex->spcont->pop_label());
+ }
+ ;
sp_elseifs:
- /* Empty */
- | ELSEIF_SYM sp_if
- | ELSE sp_proc_stmts1
- ;
+ /* Empty */
+ | ELSEIF_SYM sp_if
+ | ELSE sp_proc_stmts1
+ ;
case_stmt_specification:
simple_case_stmt
@@ -3084,138 +3145,138 @@ else_clause_opt:
;
sp_labeled_control:
- label_ident ':'
- {
- LEX *lex= Lex;
- sp_pcontext *ctx= lex->spcont;
- sp_label_t *lab= ctx->find_label($1.str);
-
- if (lab)
- {
- my_error(ER_SP_LABEL_REDEFINE, MYF(0), $1.str);
- MYSQL_YYABORT;
- }
- else
- {
- lab= lex->spcont->push_label($1.str,
- lex->sphead->instructions());
- lab->type= SP_LAB_ITER;
- }
- }
- sp_unlabeled_control sp_opt_label
- {
- LEX *lex= Lex;
-
- if ($5.str)
- {
- sp_label_t *lab= lex->spcont->find_label($5.str);
-
- if (!lab ||
- my_strcasecmp(system_charset_info, $5.str, lab->name) != 0)
- {
- my_error(ER_SP_LABEL_MISMATCH, MYF(0), $5.str);
- MYSQL_YYABORT;
- }
- }
- lex->sphead->backpatch(lex->spcont->pop_label());
- }
- ;
+ label_ident ':'
+ {
+ LEX *lex= Lex;
+ sp_pcontext *ctx= lex->spcont;
+ sp_label_t *lab= ctx->find_label($1.str);
+
+ if (lab)
+ {
+ my_error(ER_SP_LABEL_REDEFINE, MYF(0), $1.str);
+ MYSQL_YYABORT;
+ }
+ else
+ {
+ lab= lex->spcont->push_label($1.str,
+ lex->sphead->instructions());
+ lab->type= SP_LAB_ITER;
+ }
+ }
+ sp_unlabeled_control sp_opt_label
+ {
+ LEX *lex= Lex;
+
+ if ($5.str)
+ {
+ sp_label_t *lab= lex->spcont->find_label($5.str);
+
+ if (!lab ||
+ my_strcasecmp(system_charset_info, $5.str, lab->name) != 0)
+ {
+ my_error(ER_SP_LABEL_MISMATCH, MYF(0), $5.str);
+ MYSQL_YYABORT;
+ }
+ }
+ lex->sphead->backpatch(lex->spcont->pop_label());
+ }
+ ;
sp_opt_label:
- /* Empty */ { $$= null_lex_str; }
+ /* Empty */ { $$= null_lex_str; }
| label_ident { $$= $1; }
- ;
+ ;
sp_unlabeled_control:
- BEGIN_SYM
- { /* QQ This is just a dummy for grouping declarations and statements
- together. No [[NOT] ATOMIC] yet, and we need to figure out how
- make it coexist with the existing BEGIN COMMIT/ROLLBACK. */
- LEX *lex= Lex;
- sp_label_t *lab= lex->spcont->last_label();
-
- lab->type= SP_LAB_BEGIN;
- lex->spcont= lex->spcont->push_context(LABEL_DEFAULT_SCOPE);
- }
- sp_decls
- sp_proc_stmts
- END
- {
- LEX *lex= Lex;
- sp_head *sp= lex->sphead;
- sp_pcontext *ctx= lex->spcont;
-
- sp->backpatch(ctx->last_label()); /* We always have a label */
- if ($3.hndlrs)
- sp->add_instr(new sp_instr_hpop(sp->instructions(), ctx,
- $3.hndlrs));
- if ($3.curs)
- sp->add_instr(new sp_instr_cpop(sp->instructions(), ctx,
- $3.curs));
- lex->spcont= ctx->pop_context();
- }
- | LOOP_SYM
- sp_proc_stmts1 END LOOP_SYM
- {
- LEX *lex= Lex;
- uint ip= lex->sphead->instructions();
- sp_label_t *lab= lex->spcont->last_label(); /* Jumping back */
- sp_instr_jump *i = new sp_instr_jump(ip, lex->spcont, lab->ip);
-
- lex->sphead->add_instr(i);
- }
+ BEGIN_SYM
+ { /* QQ This is just a dummy for grouping declarations and statements
+ together. No [[NOT] ATOMIC] yet, and we need to figure out how
+ make it coexist with the existing BEGIN COMMIT/ROLLBACK. */
+ LEX *lex= Lex;
+ sp_label_t *lab= lex->spcont->last_label();
+
+ lab->type= SP_LAB_BEGIN;
+ lex->spcont= lex->spcont->push_context(LABEL_DEFAULT_SCOPE);
+ }
+ sp_decls
+ sp_proc_stmts
+ END
+ {
+ LEX *lex= Lex;
+ sp_head *sp= lex->sphead;
+ sp_pcontext *ctx= lex->spcont;
+
+ sp->backpatch(ctx->last_label()); /* We always have a label */
+ if ($3.hndlrs)
+ sp->add_instr(new sp_instr_hpop(sp->instructions(), ctx,
+ $3.hndlrs));
+ if ($3.curs)
+ sp->add_instr(new sp_instr_cpop(sp->instructions(), ctx,
+ $3.curs));
+ lex->spcont= ctx->pop_context();
+ }
+ | LOOP_SYM
+ sp_proc_stmts1 END LOOP_SYM
+ {
+ LEX *lex= Lex;
+ uint ip= lex->sphead->instructions();
+ sp_label_t *lab= lex->spcont->last_label(); /* Jumping back */
+ sp_instr_jump *i = new sp_instr_jump(ip, lex->spcont, lab->ip);
+
+ lex->sphead->add_instr(i);
+ }
| WHILE_SYM
{ Lex->sphead->reset_lex(YYTHD); }
expr DO_SYM
- {
- LEX *lex= Lex;
- sp_head *sp= lex->sphead;
- uint ip= sp->instructions();
- sp_instr_jump_if_not *i = new sp_instr_jump_if_not(ip, lex->spcont,
- $3, lex);
-
- /* Jumping forward */
- sp->push_backpatch(i, lex->spcont->last_label());
+ {
+ LEX *lex= Lex;
+ sp_head *sp= lex->sphead;
+ uint ip= sp->instructions();
+ sp_instr_jump_if_not *i = new sp_instr_jump_if_not(ip, lex->spcont,
+ $3, lex);
+
+ /* Jumping forward */
+ sp->push_backpatch(i, lex->spcont->last_label());
sp->new_cont_backpatch(i);
sp->add_instr(i);
sp->restore_lex(YYTHD);
- }
- sp_proc_stmts1 END WHILE_SYM
- {
- LEX *lex= Lex;
- uint ip= lex->sphead->instructions();
- sp_label_t *lab= lex->spcont->last_label(); /* Jumping back */
- sp_instr_jump *i = new sp_instr_jump(ip, lex->spcont, lab->ip);
-
- lex->sphead->add_instr(i);
+ }
+ sp_proc_stmts1 END WHILE_SYM
+ {
+ LEX *lex= Lex;
+ uint ip= lex->sphead->instructions();
+ sp_label_t *lab= lex->spcont->last_label(); /* Jumping back */
+ sp_instr_jump *i = new sp_instr_jump(ip, lex->spcont, lab->ip);
+
+ lex->sphead->add_instr(i);
lex->sphead->do_cont_backpatch();
- }
+ }
| REPEAT_SYM sp_proc_stmts1 UNTIL_SYM
{ Lex->sphead->reset_lex(YYTHD); }
expr END REPEAT_SYM
- {
- LEX *lex= Lex;
- uint ip= lex->sphead->instructions();
- sp_label_t *lab= lex->spcont->last_label(); /* Jumping back */
- sp_instr_jump_if_not *i = new sp_instr_jump_if_not(ip, lex->spcont,
+ {
+ LEX *lex= Lex;
+ uint ip= lex->sphead->instructions();
+ sp_label_t *lab= lex->spcont->last_label(); /* Jumping back */
+ sp_instr_jump_if_not *i = new sp_instr_jump_if_not(ip, lex->spcont,
$5, lab->ip,
lex);
lex->sphead->add_instr(i);
lex->sphead->restore_lex(YYTHD);
/* We can shortcut the cont_backpatch here */
i->m_cont_dest= ip+1;
- }
- ;
+ }
+ ;
trg_action_time:
- BEFORE_SYM
+ BEFORE_SYM
{ Lex->trg_chistics.action_time= TRG_ACTION_BEFORE; }
- | AFTER_SYM
+ | AFTER_SYM
{ Lex->trg_chistics.action_time= TRG_ACTION_AFTER; }
;
trg_event:
- INSERT
+ INSERT
{ Lex->trg_chistics.event= TRG_EVENT_INSERT; }
| UPDATE_SYM
{ Lex->trg_chistics.event= TRG_EVENT_UPDATE; }
@@ -3238,156 +3299,157 @@ trg_event:
change_tablespace_access:
tablespace_name
ts_access_mode
- ;
+ ;
change_tablespace_info:
tablespace_name
CHANGE ts_datafile
change_ts_option_list
- ;
+ ;
tablespace_info:
tablespace_name
ADD ts_datafile
opt_logfile_group_name
tablespace_option_list
- ;
+ ;
opt_logfile_group_name:
/* empty */ {}
- | USE_SYM LOGFILE_SYM GROUP_SYM ident
+ | USE_SYM LOGFILE_SYM GROUP_SYM ident
{
LEX *lex= Lex;
lex->alter_tablespace_info->logfile_group_name= $4.str;
- };
+ }
+ ;
alter_tablespace_info:
tablespace_name
ADD ts_datafile
- alter_tablespace_option_list
- {
- Lex->alter_tablespace_info->ts_alter_tablespace_type= ALTER_TABLESPACE_ADD_FILE;
+ alter_tablespace_option_list
+ {
+ Lex->alter_tablespace_info->ts_alter_tablespace_type= ALTER_TABLESPACE_ADD_FILE;
}
- |
- tablespace_name
+ | tablespace_name
DROP ts_datafile
- alter_tablespace_option_list
- {
- Lex->alter_tablespace_info->ts_alter_tablespace_type= ALTER_TABLESPACE_DROP_FILE;
- };
+ alter_tablespace_option_list
+ {
+ Lex->alter_tablespace_info->ts_alter_tablespace_type= ALTER_TABLESPACE_DROP_FILE;
+ }
+ ;
logfile_group_info:
logfile_group_name
add_log_file
logfile_group_option_list
- ;
+ ;
alter_logfile_group_info:
logfile_group_name
add_log_file
alter_logfile_group_option_list
- ;
+ ;
add_log_file:
ADD lg_undofile
- | ADD lg_redofile
- ;
+ | ADD lg_redofile
+ ;
change_ts_option_list:
/* empty */ {}
change_ts_options
- ;
+ ;
change_ts_options:
change_ts_option
- | change_ts_options change_ts_option
- | change_ts_options ',' change_ts_option
- ;
+ | change_ts_options change_ts_option
+ | change_ts_options ',' change_ts_option
+ ;
change_ts_option:
opt_ts_initial_size
- | opt_ts_autoextend_size
- | opt_ts_max_size
- ;
+ | opt_ts_autoextend_size
+ | opt_ts_max_size
+ ;
tablespace_option_list:
/* empty */ {}
- tablespace_options
- ;
+ tablespace_options
+ ;
tablespace_options:
tablespace_option
- | tablespace_options tablespace_option
- | tablespace_options ',' tablespace_option
- ;
+ | tablespace_options tablespace_option
+ | tablespace_options ',' tablespace_option
+ ;
tablespace_option:
opt_ts_initial_size
- | opt_ts_autoextend_size
- | opt_ts_max_size
- | opt_ts_extent_size
- | opt_ts_nodegroup
- | opt_ts_engine
- | ts_wait
- | opt_ts_comment
- ;
+ | opt_ts_autoextend_size
+ | opt_ts_max_size
+ | opt_ts_extent_size
+ | opt_ts_nodegroup
+ | opt_ts_engine
+ | ts_wait
+ | opt_ts_comment
+ ;
alter_tablespace_option_list:
/* empty */ {}
- alter_tablespace_options
- ;
+ alter_tablespace_options
+ ;
alter_tablespace_options:
alter_tablespace_option
- | alter_tablespace_options alter_tablespace_option
- | alter_tablespace_options ',' alter_tablespace_option
- ;
+ | alter_tablespace_options alter_tablespace_option
+ | alter_tablespace_options ',' alter_tablespace_option
+ ;
alter_tablespace_option:
opt_ts_initial_size
- | opt_ts_autoextend_size
- | opt_ts_max_size
- | opt_ts_engine
- | ts_wait
- ;
+ | opt_ts_autoextend_size
+ | opt_ts_max_size
+ | opt_ts_engine
+ | ts_wait
+ ;
logfile_group_option_list:
/* empty */ {}
- logfile_group_options
- ;
+ logfile_group_options
+ ;
logfile_group_options:
logfile_group_option
- | logfile_group_options logfile_group_option
- | logfile_group_options ',' logfile_group_option
- ;
+ | logfile_group_options logfile_group_option
+ | logfile_group_options ',' logfile_group_option
+ ;
logfile_group_option:
opt_ts_initial_size
- | opt_ts_undo_buffer_size
- | opt_ts_redo_buffer_size
- | opt_ts_nodegroup
- | opt_ts_engine
- | ts_wait
- | opt_ts_comment
- ;
+ | opt_ts_undo_buffer_size
+ | opt_ts_redo_buffer_size
+ | opt_ts_nodegroup
+ | opt_ts_engine
+ | ts_wait
+ | opt_ts_comment
+ ;
alter_logfile_group_option_list:
/* empty */ {}
alter_logfile_group_options
- ;
+ ;
alter_logfile_group_options:
alter_logfile_group_option
- | alter_logfile_group_options alter_logfile_group_option
- | alter_logfile_group_options ',' alter_logfile_group_option
- ;
+ | alter_logfile_group_options alter_logfile_group_option
+ | alter_logfile_group_options ',' alter_logfile_group_option
+ ;
alter_logfile_group_option:
opt_ts_initial_size
- | opt_ts_engine
- | ts_wait
- ;
+ | opt_ts_engine
+ | ts_wait
+ ;
ts_datafile:
@@ -3395,21 +3457,24 @@ ts_datafile:
{
LEX *lex= Lex;
lex->alter_tablespace_info->data_file_name= $2.str;
- };
+ }
+ ;
lg_undofile:
UNDOFILE_SYM TEXT_STRING_sys
{
LEX *lex= Lex;
lex->alter_tablespace_info->undo_file_name= $2.str;
- };
+ }
+ ;
lg_redofile:
REDOFILE_SYM TEXT_STRING_sys
{
LEX *lex= Lex;
lex->alter_tablespace_info->redo_file_name= $2.str;
- };
+ }
+ ;
tablespace_name:
ident
@@ -3418,7 +3483,8 @@ tablespace_name:
lex->alter_tablespace_info= new st_alter_tablespace();
lex->alter_tablespace_info->tablespace_name= $1.str;
lex->sql_command= SQLCOM_ALTER_TABLESPACE;
- };
+ }
+ ;
logfile_group_name:
ident
@@ -3427,7 +3493,8 @@ logfile_group_name:
lex->alter_tablespace_info= new st_alter_tablespace();
lex->alter_tablespace_info->logfile_group_name= $1.str;
lex->sql_command= SQLCOM_ALTER_TABLESPACE;
- };
+ }
+ ;
ts_access_mode:
READ_ONLY_SYM
@@ -3435,58 +3502,65 @@ ts_access_mode:
LEX *lex= Lex;
lex->alter_tablespace_info->ts_access_mode= TS_READ_ONLY;
}
- | READ_WRITE_SYM
+ | READ_WRITE_SYM
{
LEX *lex= Lex;
lex->alter_tablespace_info->ts_access_mode= TS_READ_WRITE;
}
- | NOT_SYM ACCESSIBLE_SYM
+ | NOT_SYM ACCESSIBLE_SYM
{
LEX *lex= Lex;
lex->alter_tablespace_info->ts_access_mode= TS_NOT_ACCESSIBLE;
- };
+ }
+ ;
opt_ts_initial_size:
INITIAL_SIZE_SYM opt_equal size_number
{
LEX *lex= Lex;
lex->alter_tablespace_info->initial_size= $3;
- };
+ }
+ ;
opt_ts_autoextend_size:
AUTOEXTEND_SIZE_SYM opt_equal size_number
{
LEX *lex= Lex;
lex->alter_tablespace_info->autoextend_size= $3;
- };
+ }
+ ;
opt_ts_max_size:
MAX_SIZE_SYM opt_equal size_number
{
LEX *lex= Lex;
lex->alter_tablespace_info->max_size= $3;
- };
+ }
+ ;
opt_ts_extent_size:
EXTENT_SIZE_SYM opt_equal size_number
{
LEX *lex= Lex;
lex->alter_tablespace_info->extent_size= $3;
- };
+ }
+ ;
opt_ts_undo_buffer_size:
UNDO_BUFFER_SIZE_SYM opt_equal size_number
{
LEX *lex= Lex;
lex->alter_tablespace_info->undo_buffer_size= $3;
- };
+ }
+ ;
opt_ts_redo_buffer_size:
REDO_BUFFER_SIZE_SYM opt_equal size_number
{
LEX *lex= Lex;
lex->alter_tablespace_info->redo_buffer_size= $3;
- };
+ }
+ ;
opt_ts_nodegroup:
NODEGROUP_SYM opt_equal real_ulong_num
@@ -3498,7 +3572,8 @@ opt_ts_nodegroup:
MYSQL_YYABORT;
}
lex->alter_tablespace_info->nodegroup_id= $3;
- };
+ }
+ ;
opt_ts_comment:
COMMENT_SYM opt_equal TEXT_STRING_sys
@@ -3510,7 +3585,8 @@ opt_ts_comment:
MYSQL_YYABORT;
}
lex->alter_tablespace_info->ts_comment= $3.str;
- };
+ }
+ ;
opt_ts_engine:
opt_storage ENGINE_SYM opt_equal storage_engines
@@ -3523,12 +3599,13 @@ opt_ts_engine:
MYSQL_YYABORT;
}
lex->alter_tablespace_info->storage_engine= $4;
- };
+ }
+ ;
opt_ts_wait:
/* empty */
- | ts_wait
- ;
+ | ts_wait
+ ;
ts_wait:
WAIT_SYM
@@ -3536,7 +3613,7 @@ ts_wait:
LEX *lex= Lex;
lex->alter_tablespace_info->wait_until_completed= TRUE;
}
- | NO_WAIT_SYM
+ | NO_WAIT_SYM
{
LEX *lex= Lex;
if (!(lex->alter_tablespace_info->wait_until_completed))
@@ -3545,11 +3622,12 @@ ts_wait:
MYSQL_YYABORT;
}
lex->alter_tablespace_info->wait_until_completed= FALSE;
- };
+ }
+ ;
size_number:
real_ulong_num { $$= $1;}
- | IDENT
+ | IDENT
{
ulonglong number;
uint text_shift_number= 0;
@@ -3593,45 +3671,39 @@ size_number:
}
$$= number;
}
- ;
+ ;
/*
End tablespace part
*/
create2:
- '(' create2a {}
+ '(' create2a {}
| opt_create_table_options
- opt_partitioning {}
+ opt_partitioning {}
create3 {}
| LIKE table_ident
{
THD *thd= YYTHD;
LEX *lex= thd->lex;
- if (!(lex->like_name= $2))
- MYSQL_YYABORT;
- if ($2->db.str == NULL &&
- thd->copy_db_to(&($2->db.str), &($2->db.length)))
- {
+
+ lex->create_info.options|= HA_LEX_CREATE_TABLE_LIKE;
+ if (!lex->select_lex.add_table_to_list(thd, $2, NULL, 0, TL_READ))
MYSQL_YYABORT;
- }
}
| '(' LIKE table_ident ')'
{
THD *thd= YYTHD;
LEX *lex= thd->lex;
- if (!(lex->like_name= $3))
- MYSQL_YYABORT;
- if ($3->db.str == NULL &&
- thd->copy_db_to(&($3->db.str), &($3->db.length)))
- {
+
+ lex->create_info.options|= HA_LEX_CREATE_TABLE_LIKE;
+ if (!lex->select_lex.add_table_to_list(thd, $3, NULL, 0, TL_READ))
MYSQL_YYABORT;
- }
}
;
create2a:
- field_list ')' opt_create_table_options
+ field_list ')' opt_create_table_options
opt_partitioning {}
create3 {}
| opt_partitioning {}
@@ -3640,10 +3712,10 @@ create2a:
;
create3:
- /* empty */ {}
- | opt_duplicate opt_as create_select
+ /* empty */ {}
+ | opt_duplicate opt_as create_select
{ Select->set_braces(0);} union_clause {}
- | opt_duplicate opt_as '(' create_select ')'
+ | opt_duplicate opt_as '(' create_select ')'
{ Select->set_braces(1);} union_opt {}
;
@@ -3672,546 +3744,552 @@ create3:
from the openfrm function.
*/
opt_partitioning:
- /* empty */ {}
+ /* empty */ {}
| partitioning
;
partitioning:
- PARTITION_SYM
- {
-#ifdef WITH_PARTITION_STORAGE_ENGINE
- LEX *lex= Lex;
- lex->part_info= new partition_info();
- if (!lex->part_info)
- {
- mem_alloc_error(sizeof(partition_info));
- MYSQL_YYABORT;
- }
- if (lex->sql_command == SQLCOM_ALTER_TABLE)
+ PARTITION_SYM
{
- lex->alter_info.flags|= ALTER_PARTITION;
- }
+#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_FEATURE_DISABLED, MYF(0),
+ "partitioning", "--with-partition");
+ MYSQL_YYABORT;
+ }
+ lex->part_info= new partition_info();
+ if (!lex->part_info)
+ {
+ mem_alloc_error(sizeof(partition_info));
+ MYSQL_YYABORT;
+ }
+ if (lex->sql_command == SQLCOM_ALTER_TABLE)
+ {
+ lex->alter_info.flags|= ALTER_PARTITION;
+ }
#else
- my_error(ER_FEATURE_DISABLED, MYF(0),
- "partitioning", "--with-partition");
- MYSQL_YYABORT;
+ my_error(ER_FEATURE_DISABLED, MYF(0),
+ "partitioning", "--with-partition");
+ MYSQL_YYABORT;
#endif
- }
- partition
+ }
+ partition
;
partition_entry:
- PARTITION_SYM
- {
- LEX *lex= Lex;
- if (!lex->part_info)
+ PARTITION_SYM
{
- my_parse_error(ER(ER_PARTITION_ENTRY_ERROR));
- MYSQL_YYABORT;
+ LEX *lex= Lex;
+ if (!lex->part_info)
+ {
+ my_parse_error(ER(ER_PARTITION_ENTRY_ERROR));
+ MYSQL_YYABORT;
+ }
+ /*
+ We enter here when opening the frm file to translate
+ partition info string into part_info data structure.
+ */
}
- /*
- We enter here when opening the frm file to translate
- partition info string into part_info data structure.
- */
- }
- partition {}
+ partition {}
;
partition:
- BY part_type_def opt_no_parts {} opt_sub_part {} part_defs
+ BY part_type_def opt_no_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;
- }
+ 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;
+ }
| opt_linear HASH_SYM
- { Lex->part_info->part_type= HASH_PARTITION; }
- part_func {}
+ { Lex->part_info->part_type= HASH_PARTITION; }
+ part_func {}
| RANGE_SYM
- { Lex->part_info->part_type= RANGE_PARTITION; }
- part_func {}
+ { Lex->part_info->part_type= RANGE_PARTITION; }
+ part_func {}
| LIST_SYM
- { Lex->part_info->part_type= LIST_PARTITION; }
- part_func {}
+ { Lex->part_info->part_type= LIST_PARTITION; }
+ part_func {}
;
opt_linear:
- /* empty */ {}
+ /* empty */ {}
| LINEAR_SYM
- { Lex->part_info->linear_hash_ind= TRUE;}
+ { Lex->part_info->linear_hash_ind= TRUE;}
;
part_field_list:
- /* empty */ {}
+ /* empty */ {}
| part_field_item_list {}
;
part_field_item_list:
- part_field_item {}
+ part_field_item {}
| part_field_item_list ',' part_field_item {}
;
part_field_item:
- ident
- {
- if (Lex->part_info->part_field_list.push_back($1.str))
+ ident
{
- mem_alloc_error(1);
- MYSQL_YYABORT;
+ if (Lex->part_info->part_field_list.push_back($1.str))
+ {
+ mem_alloc_error(1);
+ MYSQL_YYABORT;
+ }
}
- }
;
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;
- lex->part_info->part_func_string= (char* ) sql_memdup($2+1, expr_len);
- lex->part_info->part_func_len= expr_len;
- }
+ '(' 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;
+ lex->part_info->part_func_string= (char* ) sql_memdup($2+1, expr_len);
+ lex->part_info->part_func_len= expr_len;
+ }
;
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;
- lex->part_info->subpart_func_string= (char* ) sql_memdup($2+1, expr_len);
- lex->part_info->subpart_func_len= expr_len;
- }
+ '(' 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;
+ lex->part_info->subpart_func_string= (char* ) sql_memdup($2+1, expr_len);
+ lex->part_info->subpart_func_len= expr_len;
+ }
;
opt_no_parts:
- /* empty */ {}
- | PARTITIONS_SYM real_ulong_num
- {
- uint no_parts= $2;
- LEX *lex= Lex;
- if (no_parts == 0)
- {
- my_error(ER_NO_PARTS_ERROR, MYF(0), "partitions");
- MYSQL_YYABORT;
- }
+ /* empty */ {}
+ | PARTITIONS_SYM real_ulong_num
+ {
+ uint no_parts= $2;
+ LEX *lex= Lex;
+ if (no_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;
- }
+ lex->part_info->no_parts= no_parts;
+ lex->part_info->use_default_no_partitions= FALSE;
+ }
;
opt_sub_part:
- /* empty */ {}
+ /* empty */ {}
| SUBPARTITION_SYM BY opt_linear HASH_SYM sub_part_func
- { Lex->part_info->subpart_type= HASH_PARTITION; }
- opt_no_subparts {}
+ { Lex->part_info->subpart_type= HASH_PARTITION; }
+ opt_no_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;
- }
- opt_no_subparts {}
+ {
+ LEX *lex= Lex;
+ lex->part_info->subpart_type= HASH_PARTITION;
+ lex->part_info->list_of_subpart_fields= TRUE;
+ }
+ opt_no_subparts {}
;
sub_part_field_list:
- sub_part_field_item {}
+ sub_part_field_item {}
| sub_part_field_list ',' sub_part_field_item {}
;
sub_part_field_item:
- ident
- {
- if (Lex->part_info->subpart_field_list.push_back($1.str))
+ ident
{
- mem_alloc_error(1);
- MYSQL_YYABORT;
+ if (Lex->part_info->subpart_field_list.push_back($1.str))
+ {
+ mem_alloc_error(1);
+ MYSQL_YYABORT;
+ }
}
- }
;
part_func_expr:
- bit_expr
- {
- LEX *lex= Lex;
- bool not_corr_func;
- not_corr_func= !lex->safe_to_cache_query;
- lex->safe_to_cache_query= 1;
- if (not_corr_func)
+ bit_expr
{
- my_parse_error(ER(ER_CONST_EXPR_IN_PARTITION_FUNC_ERROR));
- MYSQL_YYABORT;
+ LEX *lex= Lex;
+ bool not_corr_func;
+ not_corr_func= !lex->safe_to_cache_query;
+ lex->safe_to_cache_query= 1;
+ if (not_corr_func)
+ {
+ my_parse_error(ER(ER_CONST_EXPR_IN_PARTITION_FUNC_ERROR));
+ MYSQL_YYABORT;
+ }
+ $$=$1;
}
- $$=$1;
- }
;
opt_no_subparts:
- /* empty */ {}
+ /* empty */ {}
| SUBPARTITIONS_SYM real_ulong_num
- {
- uint no_parts= $2;
- LEX *lex= Lex;
- if (no_parts == 0)
{
- my_error(ER_NO_PARTS_ERROR, MYF(0), "subpartitions");
- MYSQL_YYABORT;
+ uint no_parts= $2;
+ LEX *lex= Lex;
+ if (no_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->no_subparts= no_parts;
- lex->part_info->use_default_no_subpartitions= FALSE;
- }
;
part_defs:
- /* empty */
- {}
+ /* empty */
+ {}
| '(' part_def_list ')'
- {
- LEX *lex= Lex;
- partition_info *part_info= lex->part_info;
- uint count_curr_parts= part_info->partitions.elements;
- if (part_info->no_parts != 0)
{
- if (part_info->no_parts !=
- count_curr_parts)
+ LEX *lex= Lex;
+ partition_info *part_info= lex->part_info;
+ uint count_curr_parts= part_info->partitions.elements;
+ if (part_info->no_parts != 0)
{
- my_parse_error(ER(ER_PARTITION_WRONG_NO_PART_ERROR));
- MYSQL_YYABORT;
+ if (part_info->no_parts !=
+ count_curr_parts)
+ {
+ my_parse_error(ER(ER_PARTITION_WRONG_NO_PART_ERROR));
+ MYSQL_YYABORT;
+ }
}
+ else if (count_curr_parts > 0)
+ {
+ part_info->no_parts= count_curr_parts;
+ }
+ part_info->count_curr_subparts= 0;
}
- else if (count_curr_parts > 0)
- {
- part_info->no_parts= count_curr_parts;
- }
- part_info->count_curr_subparts= 0;
- }
;
part_def_list:
- part_definition {}
+ part_definition {}
| part_def_list ',' part_definition {}
;
part_definition:
- PARTITION_SYM
- {
- LEX *lex= Lex;
- partition_info *part_info= lex->part_info;
- partition_element *p_elem= new partition_element();
-
- if (!p_elem || part_info->partitions.push_back(p_elem))
+ PARTITION_SYM
{
- mem_alloc_error(sizeof(partition_element));
- MYSQL_YYABORT;
+ LEX *lex= Lex;
+ partition_info *part_info= lex->part_info;
+ partition_element *p_elem= new partition_element();
+
+ if (!p_elem || part_info->partitions.push_back(p_elem))
+ {
+ mem_alloc_error(sizeof(partition_element));
+ MYSQL_YYABORT;
+ }
+ p_elem->part_state= PART_NORMAL;
+ 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;
}
- p_elem->part_state= PART_NORMAL;
- 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_name {}
- opt_part_values {}
- opt_part_options {}
- opt_sub_partition {}
+ part_name {}
+ opt_part_values {}
+ opt_part_options {}
+ opt_sub_partition {}
;
part_name:
- ident
- {
- LEX *lex= Lex;
- partition_info *part_info= lex->part_info;
- partition_element *p_elem= part_info->curr_part_elem;
- p_elem->partition_name= $1.str;
- }
+ ident
+ {
+ LEX *lex= Lex;
+ partition_info *part_info= lex->part_info;
+ partition_element *p_elem= part_info->curr_part_elem;
+ p_elem->partition_name= $1.str;
+ }
;
opt_part_values:
- /* empty */
- {
- LEX *lex= Lex;
- if (!is_partition_management(lex))
+ /* empty */
{
- if (lex->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)
+ LEX *lex= Lex;
+ if (! lex->is_partition_management())
{
- my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0),
- "LIST", "IN");
- MYSQL_YYABORT;
+ if (lex->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)
+ {
+ my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0),
+ "LIST", "IN");
+ MYSQL_YYABORT;
+ }
}
+ else
+ lex->part_info->part_type= HASH_PARTITION;
}
- else
- lex->part_info->part_type= HASH_PARTITION;
- }
| VALUES LESS_SYM THAN_SYM part_func_max
- {
- LEX *lex= Lex;
- if (!is_partition_management(lex))
{
- if (Lex->part_info->part_type != RANGE_PARTITION)
+ LEX *lex= Lex;
+ if (! lex->is_partition_management())
{
- my_error(ER_PARTITION_WRONG_VALUES_ERROR, MYF(0),
- "RANGE", "LESS THAN");
- MYSQL_YYABORT;
+ if (Lex->part_info->part_type != RANGE_PARTITION)
+ {
+ my_error(ER_PARTITION_WRONG_VALUES_ERROR, MYF(0),
+ "RANGE", "LESS THAN");
+ MYSQL_YYABORT;
+ }
}
+ else
+ lex->part_info->part_type= RANGE_PARTITION;
}
- else
- lex->part_info->part_type= RANGE_PARTITION;
- }
| VALUES IN_SYM '(' part_list_func ')'
- {
- LEX *lex= Lex;
- if (!is_partition_management(lex))
{
- if (Lex->part_info->part_type != LIST_PARTITION)
+ LEX *lex= Lex;
+ if (! lex->is_partition_management())
{
- my_error(ER_PARTITION_WRONG_VALUES_ERROR, MYF(0),
- "LIST", "IN");
- MYSQL_YYABORT;
+ if (Lex->part_info->part_type != LIST_PARTITION)
+ {
+ my_error(ER_PARTITION_WRONG_VALUES_ERROR, MYF(0),
+ "LIST", "IN");
+ MYSQL_YYABORT;
+ }
}
+ else
+ lex->part_info->part_type= LIST_PARTITION;
}
- else
- lex->part_info->part_type= LIST_PARTITION;
- }
;
part_func_max:
- max_value_sym
- {
- LEX *lex= Lex;
- if (lex->part_info->defined_max_value)
+ max_value_sym
{
- my_parse_error(ER(ER_PARTITION_MAXVALUE_ERROR));
- MYSQL_YYABORT;
+ LEX *lex= Lex;
+ if (lex->part_info->defined_max_value)
+ {
+ my_parse_error(ER(ER_PARTITION_MAXVALUE_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;
}
- 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)
- {
- my_parse_error(ER(ER_PARTITION_MAXVALUE_ERROR));
- MYSQL_YYABORT;
- }
- if (Lex->part_info->curr_part_elem->has_null_value)
{
- my_parse_error(ER(ER_NULL_IN_VALUES_LESS_THAN));
- MYSQL_YYABORT;
+ if (Lex->part_info->defined_max_value)
+ {
+ my_parse_error(ER(ER_PARTITION_MAXVALUE_ERROR));
+ MYSQL_YYABORT;
+ }
+ if (Lex->part_info->curr_part_elem->has_null_value)
+ {
+ my_parse_error(ER(ER_NULL_IN_VALUES_LESS_THAN));
+ MYSQL_YYABORT;
+ }
}
- }
;
max_value_sym:
- MAX_VALUE_SYM
+ MAX_VALUE_SYM
| '(' MAX_VALUE_SYM ')'
;
part_range_func:
- '(' part_bit_expr ')'
- {
- 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;
- }
+ '(' part_bit_expr ')'
+ {
+ 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;
+ }
;
part_list_func:
- part_list_item {}
+ part_list_item {}
| part_list_func ',' part_list_item {}
;
part_list_item:
- part_bit_expr
- {
- 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))
- {
- mem_alloc_error(sizeof(part_elem_value));
- MYSQL_YYABORT;
+ part_bit_expr
+ {
+ 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))
+ {
+ mem_alloc_error(sizeof(part_elem_value));
+ MYSQL_YYABORT;
+ }
}
- }
;
part_bit_expr:
- bit_expr
- {
- 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)
- {
- mem_alloc_error(sizeof(part_elem_value));
- MYSQL_YYABORT;
- }
- if (part_expr->walk(&Item::check_partition_func_processor, 0,
- NULL))
+ bit_expr
{
- my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0));
- 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))
- {
- 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))
- {
- if (Lex->part_info->curr_part_elem->has_null_value)
+ 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)
{
- my_error(ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR, MYF(0));
+ mem_alloc_error(sizeof(part_elem_value));
MYSQL_YYABORT;
}
- Lex->part_info->curr_part_elem->has_null_value= TRUE;
- }
- else if (part_expr->result_type() != INT_RESULT &&
- !part_expr->null_value)
- {
- my_parse_error(ER(ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR));
- MYSQL_YYABORT;
+ if (part_expr->walk(&Item::check_partition_func_processor, 0,
+ NULL))
+ {
+ my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0));
+ 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))
+ {
+ 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))
+ {
+ 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;
+ }
+ else if (part_expr->result_type() != INT_RESULT)
+ {
+ my_parse_error(ER(ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR));
+ MYSQL_YYABORT;
+ }
+ $$= value_ptr;
}
- $$= value_ptr;
- }
;
opt_sub_partition:
- /* empty */
- {
- if (Lex->part_info->no_subparts != 0 &&
- !Lex->part_info->use_default_subpartitions)
- {
- my_parse_error(ER(ER_PARTITION_WRONG_NO_SUBPART_ERROR));
- MYSQL_YYABORT;
- }
- }
- | '(' sub_part_list ')'
- {
- LEX *lex= Lex;
- partition_info *part_info= lex->part_info;
- if (part_info->no_subparts != 0)
+ /* empty */
{
- if (part_info->no_subparts !=
- part_info->count_curr_subparts)
+ if (Lex->part_info->no_subparts != 0 &&
+ !Lex->part_info->use_default_subpartitions)
{
my_parse_error(ER(ER_PARTITION_WRONG_NO_SUBPART_ERROR));
MYSQL_YYABORT;
}
}
- else if (part_info->count_curr_subparts > 0)
+ | '(' sub_part_list ')'
{
- if (part_info->partitions.elements > 1)
+ LEX *lex= Lex;
+ partition_info *part_info= lex->part_info;
+ if (part_info->no_subparts != 0)
{
- my_parse_error(ER(ER_PARTITION_WRONG_NO_SUBPART_ERROR));
- MYSQL_YYABORT;
+ if (part_info->no_subparts !=
+ part_info->count_curr_subparts)
+ {
+ my_parse_error(ER(ER_PARTITION_WRONG_NO_SUBPART_ERROR));
+ MYSQL_YYABORT;
+ }
+ }
+ else if (part_info->count_curr_subparts > 0)
+ {
+ if (part_info->partitions.elements > 1)
+ {
+ my_parse_error(ER(ER_PARTITION_WRONG_NO_SUBPART_ERROR));
+ MYSQL_YYABORT;
+ }
+ part_info->no_subparts= part_info->count_curr_subparts;
}
- part_info->no_subparts= part_info->count_curr_subparts;
+ part_info->count_curr_subparts= 0;
}
- part_info->count_curr_subparts= 0;
- }
;
sub_part_list:
- sub_part_definition {}
+ sub_part_definition {}
| sub_part_list ',' sub_part_definition {}
;
sub_part_definition:
- SUBPARTITION_SYM
- {
- LEX *lex= Lex;
- 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 (!sub_p_elem ||
- curr_part->subpartitions.push_back(sub_p_elem))
+ SUBPARTITION_SYM
{
- mem_alloc_error(sizeof(partition_element));
- MYSQL_YYABORT;
+ LEX *lex= Lex;
+ 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 (!sub_p_elem ||
+ curr_part->subpartitions.push_back(sub_p_elem))
+ {
+ mem_alloc_error(sizeof(partition_element));
+ MYSQL_YYABORT;
+ }
+ part_info->curr_part_elem= sub_p_elem;
+ part_info->use_default_subpartitions= FALSE;
+ part_info->use_default_no_subpartitions= FALSE;
+ part_info->count_curr_subparts++;
}
- part_info->curr_part_elem= sub_p_elem;
- part_info->use_default_subpartitions= FALSE;
- part_info->use_default_no_subpartitions= FALSE;
- part_info->count_curr_subparts++;
- }
- sub_name opt_part_options {}
+ sub_name opt_part_options {}
;
sub_name:
- ident_or_text
- { Lex->part_info->curr_part_elem->partition_name= $1.str; }
+ ident_or_text
+ { Lex->part_info->curr_part_elem->partition_name= $1.str; }
;
opt_part_options:
- /* empty */ {}
+ /* empty */ {}
| opt_part_option_list {}
;
opt_part_option_list:
- opt_part_option_list opt_part_option {}
+ opt_part_option_list opt_part_option {}
| opt_part_option {}
;
opt_part_option:
- TABLESPACE opt_equal ident_or_text
- { Lex->part_info->curr_part_elem->tablespace_name= $3.str; }
+ TABLESPACE opt_equal ident_or_text
+ { 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;
- }
+ {
+ LEX *lex= Lex;
+ lex->part_info->curr_part_elem->engine_type= $4;
+ lex->part_info->default_engine_type= $4;
+ }
| NODEGROUP_SYM opt_equal real_ulong_num
- { Lex->part_info->curr_part_elem->nodegroup_id= (uint16) $3; }
+ { Lex->part_info->curr_part_elem->nodegroup_id= (uint16) $3; }
| MAX_ROWS opt_equal real_ulonglong_num
- { Lex->part_info->curr_part_elem->part_max_rows= (ha_rows) $3; }
+ { Lex->part_info->curr_part_elem->part_max_rows= (ha_rows) $3; }
| MIN_ROWS opt_equal real_ulonglong_num
- { Lex->part_info->curr_part_elem->part_min_rows= (ha_rows) $3; }
+ { Lex->part_info->curr_part_elem->part_min_rows= (ha_rows) $3; }
| DATA_SYM DIRECTORY_SYM opt_equal TEXT_STRING_sys
- { Lex->part_info->curr_part_elem->data_file_name= $4.str; }
+ { Lex->part_info->curr_part_elem->data_file_name= $4.str; }
| INDEX_SYM DIRECTORY_SYM opt_equal TEXT_STRING_sys
- { Lex->part_info->curr_part_elem->index_file_name= $4.str; }
+ { Lex->part_info->curr_part_elem->index_file_name= $4.str; }
| COMMENT_SYM opt_equal TEXT_STRING_sys
- { Lex->part_info->curr_part_elem->part_comment= $3.str; }
+ { Lex->part_info->curr_part_elem->part_comment= $3.str; }
;
/*
@@ -4221,93 +4299,132 @@ opt_part_option:
create_select:
SELECT_SYM
{
- LEX *lex=Lex;
- lex->lock_option= using_update_log ? TL_READ_NO_INSERT : TL_READ;
- if (lex->sql_command == SQLCOM_INSERT)
- lex->sql_command= SQLCOM_INSERT_SELECT;
- else if (lex->sql_command == SQLCOM_REPLACE)
- lex->sql_command= SQLCOM_REPLACE_SELECT;
- /*
+ LEX *lex=Lex;
+ lex->lock_option= using_update_log ? TL_READ_NO_INSERT : TL_READ;
+ if (lex->sql_command == SQLCOM_INSERT)
+ lex->sql_command= SQLCOM_INSERT_SELECT;
+ else if (lex->sql_command == SQLCOM_REPLACE)
+ lex->sql_command= SQLCOM_REPLACE_SELECT;
+ /*
The following work only with the local list, the global list
is created correctly in this case
- */
- lex->current_select->table_list.save_and_clear(&lex->save_list);
- mysql_init_select(lex);
- lex->current_select->parsing_place= SELECT_LIST;
+ */
+ lex->current_select->table_list.save_and_clear(&lex->save_list);
+ mysql_init_select(lex);
+ lex->current_select->parsing_place= SELECT_LIST;
}
select_options select_item_list
- {
- Select->parsing_place= NO_MATTER;
- }
- opt_select_from
- {
- /*
+ {
+ Select->parsing_place= NO_MATTER;
+ }
+ opt_select_from
+ {
+ /*
The following work only with the local list, the global list
is created correctly in this case
- */
- Lex->current_select->table_list.push_front(&Lex->save_list);
- }
+ */
+ Lex->current_select->table_list.push_front(&Lex->save_list);
+ }
;
opt_as:
- /* empty */ {}
- | AS {};
+ /* empty */ {}
+ | AS {}
+ ;
opt_create_database_options:
- /* empty */ {}
- | create_database_options {};
+ /* empty */ {}
+ | create_database_options {}
+ ;
create_database_options:
- create_database_option {}
- | create_database_options create_database_option {};
+ create_database_option {}
+ | create_database_options create_database_option {}
+ ;
create_database_option:
- default_collation {}
- | default_charset {};
+ default_collation {}
+ | default_charset {}
+ ;
opt_table_options:
- /* empty */ { $$= 0; }
- | table_options { $$= $1;};
+ /* empty */ { $$= 0; }
+ | table_options { $$= $1;}
+ ;
table_options:
- table_option { $$=$1; }
- | table_option table_options { $$= $1 | $2; };
+ table_option { $$=$1; }
+ | table_option table_options { $$= $1 | $2; }
+ ;
table_option:
- TEMPORARY { $$=HA_LEX_CREATE_TMP_TABLE; };
+ TEMPORARY { $$=HA_LEX_CREATE_TMP_TABLE; }
+ ;
opt_if_not_exists:
- /* empty */ { $$= 0; }
- | IF not EXISTS { $$=HA_LEX_CREATE_IF_NOT_EXISTS; };
+ /* empty */ { $$= 0; }
+ | IF not EXISTS { $$=HA_LEX_CREATE_IF_NOT_EXISTS; }
+ ;
opt_create_table_options:
- /* empty */
- | create_table_options;
+ /* empty */
+ | create_table_options
+ ;
create_table_options_space_separated:
- create_table_option
- | create_table_option create_table_options_space_separated;
+ create_table_option
+ | create_table_option create_table_options_space_separated
+ ;
create_table_options:
- create_table_option
- | create_table_option create_table_options
- | create_table_option ',' create_table_options;
+ create_table_option
+ | create_table_option create_table_options
+ | create_table_option ',' create_table_options
+ ;
create_table_option:
- ENGINE_SYM opt_equal storage_engines { Lex->create_info.db_type= $3; Lex->create_info.used_fields|= HA_CREATE_USED_ENGINE; }
- | TYPE_SYM opt_equal storage_engines
+ ENGINE_SYM opt_equal storage_engines
+ {
+ Lex->create_info.db_type= $3;
+ Lex->create_info.used_fields|= HA_CREATE_USED_ENGINE;
+ }
+ | TYPE_SYM opt_equal storage_engines
{
Lex->create_info.db_type= $3;
WARN_DEPRECATED(yythd, "5.2", "TYPE=storage_engine",
"'ENGINE=storage_engine'");
Lex->create_info.used_fields|= HA_CREATE_USED_ENGINE;
}
- | MAX_ROWS opt_equal ulonglong_num { Lex->create_info.max_rows= $3; Lex->create_info.used_fields|= HA_CREATE_USED_MAX_ROWS;}
- | MIN_ROWS opt_equal ulonglong_num { Lex->create_info.min_rows= $3; Lex->create_info.used_fields|= HA_CREATE_USED_MIN_ROWS;}
- | AVG_ROW_LENGTH opt_equal ulong_num { Lex->create_info.avg_row_length=$3; Lex->create_info.used_fields|= HA_CREATE_USED_AVG_ROW_LENGTH;}
- | PASSWORD opt_equal TEXT_STRING_sys { Lex->create_info.password=$3.str; Lex->create_info.used_fields|= HA_CREATE_USED_PASSWORD; }
- | COMMENT_SYM opt_equal TEXT_STRING_sys { Lex->create_info.comment=$3; Lex->create_info.used_fields|= HA_CREATE_USED_COMMENT; }
- | AUTO_INC opt_equal ulonglong_num { Lex->create_info.auto_increment_value=$3; Lex->create_info.used_fields|= HA_CREATE_USED_AUTO;}
+ | MAX_ROWS opt_equal ulonglong_num
+ {
+ Lex->create_info.max_rows= $3;
+ Lex->create_info.used_fields|= HA_CREATE_USED_MAX_ROWS;
+ }
+ | MIN_ROWS opt_equal ulonglong_num
+ {
+ Lex->create_info.min_rows= $3;
+ Lex->create_info.used_fields|= HA_CREATE_USED_MIN_ROWS;
+ }
+ | AVG_ROW_LENGTH opt_equal ulong_num
+ {
+ Lex->create_info.avg_row_length=$3;
+ Lex->create_info.used_fields|= HA_CREATE_USED_AVG_ROW_LENGTH;
+ }
+ | PASSWORD opt_equal TEXT_STRING_sys
+ {
+ Lex->create_info.password=$3.str;
+ Lex->create_info.used_fields|= HA_CREATE_USED_PASSWORD;
+ }
+ | COMMENT_SYM opt_equal TEXT_STRING_sys
+ {
+ Lex->create_info.comment=$3;
+ Lex->create_info.used_fields|= HA_CREATE_USED_COMMENT;
+ }
+ | AUTO_INC opt_equal ulonglong_num
+ {
+ Lex->create_info.auto_increment_value=$3;
+ Lex->create_info.used_fields|= HA_CREATE_USED_AUTO;
+ }
| PACK_KEYS_SYM opt_equal ulong_num
{
switch($3) {
@@ -4329,294 +4446,402 @@ create_table_option:
~(HA_OPTION_PACK_KEYS | HA_OPTION_NO_PACK_KEYS);
Lex->create_info.used_fields|= HA_CREATE_USED_PACK_KEYS;
}
- | CHECKSUM_SYM opt_equal ulong_num { Lex->create_info.table_options|= $3 ? HA_OPTION_CHECKSUM : HA_OPTION_NO_CHECKSUM; Lex->create_info.used_fields|= HA_CREATE_USED_CHECKSUM; }
- | DELAY_KEY_WRITE_SYM opt_equal ulong_num { Lex->create_info.table_options|= $3 ? HA_OPTION_DELAY_KEY_WRITE : HA_OPTION_NO_DELAY_KEY_WRITE; Lex->create_info.used_fields|= HA_CREATE_USED_DELAY_KEY_WRITE; }
- | ROW_FORMAT_SYM opt_equal row_types { Lex->create_info.row_type= $3; Lex->create_info.used_fields|= HA_CREATE_USED_ROW_FORMAT; }
- | UNION_SYM opt_equal '(' table_list ')'
- {
- /* Move the union list to the merge_list */
- LEX *lex=Lex;
- TABLE_LIST *table_list= lex->select_lex.get_table_list();
- lex->create_info.merge_list= lex->select_lex.table_list;
- lex->create_info.merge_list.elements--;
- lex->create_info.merge_list.first=
- (byte*) (table_list->next_local);
- lex->select_lex.table_list.elements=1;
- lex->select_lex.table_list.next=
- (byte**) &(table_list->next_local);
- table_list->next_local= 0;
- lex->create_info.used_fields|= HA_CREATE_USED_UNION;
- }
- | default_charset
- | default_collation
- | INSERT_METHOD opt_equal merge_insert_types { Lex->create_info.merge_insert_method= $3; Lex->create_info.used_fields|= HA_CREATE_USED_INSERT_METHOD;}
- | DATA_SYM DIRECTORY_SYM opt_equal TEXT_STRING_sys { Lex->create_info.data_file_name= $4.str; Lex->create_info.used_fields|= HA_CREATE_USED_DATADIR; }
- | INDEX_SYM DIRECTORY_SYM opt_equal TEXT_STRING_sys { Lex->create_info.index_file_name= $4.str; Lex->create_info.used_fields|= HA_CREATE_USED_INDEXDIR; }
- | TABLESPACE ident {Lex->create_info.tablespace= $2.str;}
- | STORAGE_SYM DISK_SYM {Lex->create_info.storage_media= HA_SM_DISK;}
- | STORAGE_SYM MEMORY_SYM {Lex->create_info.storage_media= HA_SM_MEMORY;}
- | CONNECTION_SYM opt_equal TEXT_STRING_sys { Lex->create_info.connect_string.str= $3.str; Lex->create_info.connect_string.length= $3.length; Lex->create_info.used_fields|= HA_CREATE_USED_CONNECTION; }
- | KEY_BLOCK_SIZE opt_equal ulong_num
- {
- Lex->create_info.used_fields|= HA_CREATE_USED_KEY_BLOCK_SIZE;
- Lex->create_info.key_block_size= $3;
- }
+ | CHECKSUM_SYM opt_equal ulong_num
+ {
+ Lex->create_info.table_options|= $3 ? HA_OPTION_CHECKSUM : HA_OPTION_NO_CHECKSUM;
+ Lex->create_info.used_fields|= HA_CREATE_USED_CHECKSUM;
+ }
+ | DELAY_KEY_WRITE_SYM opt_equal ulong_num
+ {
+ Lex->create_info.table_options|= $3 ? HA_OPTION_DELAY_KEY_WRITE : HA_OPTION_NO_DELAY_KEY_WRITE;
+ Lex->create_info.used_fields|= HA_CREATE_USED_DELAY_KEY_WRITE;
+ }
+ | ROW_FORMAT_SYM opt_equal row_types
+ {
+ Lex->create_info.row_type= $3;
+ Lex->create_info.used_fields|= HA_CREATE_USED_ROW_FORMAT;
+ }
+ | UNION_SYM opt_equal '(' table_list ')'
+ {
+ /* Move the union list to the merge_list */
+ LEX *lex=Lex;
+ TABLE_LIST *table_list= lex->select_lex.get_table_list();
+ lex->create_info.merge_list= lex->select_lex.table_list;
+ lex->create_info.merge_list.elements--;
+ lex->create_info.merge_list.first=
+ (uchar*) (table_list->next_local);
+ lex->select_lex.table_list.elements=1;
+ lex->select_lex.table_list.next=
+ (uchar**) &(table_list->next_local);
+ table_list->next_local= 0;
+ lex->create_info.used_fields|= HA_CREATE_USED_UNION;
+ }
+ | default_charset
+ | default_collation
+ | INSERT_METHOD opt_equal merge_insert_types
+ {
+ Lex->create_info.merge_insert_method= $3;
+ Lex->create_info.used_fields|= HA_CREATE_USED_INSERT_METHOD;
+ }
+ | DATA_SYM DIRECTORY_SYM opt_equal TEXT_STRING_sys
+ {
+ Lex->create_info.data_file_name= $4.str;
+ Lex->create_info.used_fields|= HA_CREATE_USED_DATADIR;
+ }
+ | INDEX_SYM DIRECTORY_SYM opt_equal TEXT_STRING_sys
+ {
+ Lex->create_info.index_file_name= $4.str;
+ Lex->create_info.used_fields|= HA_CREATE_USED_INDEXDIR;
+ }
+ | TABLESPACE ident
+ {Lex->create_info.tablespace= $2.str;}
+ | STORAGE_SYM DISK_SYM
+ {Lex->create_info.storage_media= HA_SM_DISK;}
+ | STORAGE_SYM MEMORY_SYM
+ {Lex->create_info.storage_media= HA_SM_MEMORY;}
+ | CONNECTION_SYM opt_equal TEXT_STRING_sys
+ {
+ Lex->create_info.connect_string.str= $3.str;
+ Lex->create_info.connect_string.length= $3.length;
+ Lex->create_info.used_fields|= HA_CREATE_USED_CONNECTION;
+ }
+ | KEY_BLOCK_SIZE opt_equal ulong_num
+ {
+ Lex->create_info.used_fields|= HA_CREATE_USED_KEY_BLOCK_SIZE;
+ Lex->create_info.key_block_size= $3;
+ }
+ | TRANSACTIONAL_SYM opt_equal ulong_num
+ {
+ Lex->create_info.used_fields|= HA_CREATE_USED_TRANSACTIONAL;
+ Lex->create_info.transactional= ($3 != 0 ? HA_CHOICE_YES :
+ HA_CHOICE_NO);
+ }
+
;
default_charset:
- opt_default charset opt_equal charset_name_or_default
- {
- HA_CREATE_INFO *cinfo= &Lex->create_info;
- if ((cinfo->used_fields & HA_CREATE_USED_DEFAULT_CHARSET) &&
- cinfo->default_table_charset && $4 &&
- !my_charset_same(cinfo->default_table_charset,$4))
- {
- my_error(ER_CONFLICTING_DECLARATIONS, MYF(0),
- "CHARACTER SET ", cinfo->default_table_charset->csname,
- "CHARACTER SET ", $4->csname);
- MYSQL_YYABORT;
- }
- Lex->create_info.default_table_charset= $4;
- Lex->create_info.used_fields|= HA_CREATE_USED_DEFAULT_CHARSET;
- };
-
-default_collation:
- opt_default COLLATE_SYM opt_equal collation_name_or_default
- {
- HA_CREATE_INFO *cinfo= &Lex->create_info;
- if ((cinfo->used_fields & HA_CREATE_USED_DEFAULT_CHARSET) &&
- cinfo->default_table_charset && $4 &&
- !my_charset_same(cinfo->default_table_charset,$4))
+ opt_default charset opt_equal charset_name_or_default
+ {
+ HA_CREATE_INFO *cinfo= &Lex->create_info;
+ if ((cinfo->used_fields & HA_CREATE_USED_DEFAULT_CHARSET) &&
+ cinfo->default_table_charset && $4 &&
+ !my_charset_same(cinfo->default_table_charset,$4))
{
- my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
- $4->name, cinfo->default_table_charset->csname);
+ my_error(ER_CONFLICTING_DECLARATIONS, MYF(0),
+ "CHARACTER SET ", cinfo->default_table_charset->csname,
+ "CHARACTER SET ", $4->csname);
MYSQL_YYABORT;
}
Lex->create_info.default_table_charset= $4;
Lex->create_info.used_fields|= HA_CREATE_USED_DEFAULT_CHARSET;
- };
+ }
+ ;
-known_storage_engines:
- ident_or_text
- {
- $$ = ha_resolve_by_name(YYTHD, &$1);
- if ($$ == NULL)
+default_collation:
+ opt_default COLLATE_SYM opt_equal collation_name_or_default
{
- my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), $1.str);
- MYSQL_YYABORT;
+ HA_CREATE_INFO *cinfo= &Lex->create_info;
+ if ((cinfo->used_fields & HA_CREATE_USED_DEFAULT_CHARSET) &&
+ cinfo->default_table_charset && $4 &&
+ !my_charset_same(cinfo->default_table_charset,$4))
+ {
+ my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
+ $4->name, cinfo->default_table_charset->csname);
+ MYSQL_YYABORT;
+ }
+ Lex->create_info.default_table_charset= $4;
+ Lex->create_info.used_fields|= HA_CREATE_USED_DEFAULT_CHARSET;
}
- }
;
storage_engines:
- ident_or_text
- {
- $$ = ha_resolve_by_name(YYTHD, &$1);
- if ($$ == NULL)
+ ident_or_text
{
- if (YYTHD->variables.sql_mode & MODE_NO_ENGINE_SUBSTITUTION)
- {
- my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), $1.str);
- MYSQL_YYABORT;
- }
+ plugin_ref plugin= ha_resolve_by_name(YYTHD, &$1);
- push_warning_printf(YYTHD, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_UNKNOWN_STORAGE_ENGINE,
- ER(ER_UNKNOWN_STORAGE_ENGINE), $1.str);
+ if (plugin)
+ $$= plugin_data(plugin, handlerton*);
+ else
+ {
+ if (YYTHD->variables.sql_mode & MODE_NO_ENGINE_SUBSTITUTION)
+ {
+ my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), $1.str);
+ MYSQL_YYABORT;
+ }
+ $$= 0;
+ push_warning_printf(YYTHD, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_UNKNOWN_STORAGE_ENGINE,
+ ER(ER_UNKNOWN_STORAGE_ENGINE),
+ $1.str);
+ }
}
- };
+ ;
+
+known_storage_engines:
+ ident_or_text
+ {
+ plugin_ref plugin;
+ if ((plugin= ha_resolve_by_name(YYTHD, &$1)))
+ $$= plugin_data(plugin, handlerton*);
+ else
+ {
+ my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), $1.str);
+ MYSQL_YYABORT;
+ }
+ }
+ ;
row_types:
- DEFAULT { $$= ROW_TYPE_DEFAULT; }
- | FIXED_SYM { $$= ROW_TYPE_FIXED; }
- | DYNAMIC_SYM { $$= ROW_TYPE_DYNAMIC; }
- | COMPRESSED_SYM { $$= ROW_TYPE_COMPRESSED; }
- | REDUNDANT_SYM { $$= ROW_TYPE_REDUNDANT; }
- | COMPACT_SYM { $$= ROW_TYPE_COMPACT; };
+ DEFAULT { $$= ROW_TYPE_DEFAULT; }
+ | FIXED_SYM { $$= ROW_TYPE_FIXED; }
+ | DYNAMIC_SYM { $$= ROW_TYPE_DYNAMIC; }
+ | COMPRESSED_SYM { $$= ROW_TYPE_COMPRESSED; }
+ | REDUNDANT_SYM { $$= ROW_TYPE_REDUNDANT; }
+ | COMPACT_SYM { $$= ROW_TYPE_COMPACT; }
+ | PAGE_SYM { $$= ROW_TYPE_PAGE; }
+ ;
merge_insert_types:
- NO_SYM { $$= MERGE_INSERT_DISABLED; }
+ NO_SYM { $$= MERGE_INSERT_DISABLED; }
| FIRST_SYM { $$= MERGE_INSERT_TO_FIRST; }
- | LAST_SYM { $$= MERGE_INSERT_TO_LAST; };
+ | LAST_SYM { $$= MERGE_INSERT_TO_LAST; }
+ ;
opt_select_from:
- opt_limit_clause {}
- | select_from select_lock_type;
+ opt_limit_clause {}
+ | select_from select_lock_type
+ ;
udf_func_type:
- /* empty */ { $$ = UDFTYPE_FUNCTION; }
- | AGGREGATE_SYM { $$ = UDFTYPE_AGGREGATE; };
+ /* empty */ { $$ = UDFTYPE_FUNCTION; }
+ | AGGREGATE_SYM { $$ = UDFTYPE_AGGREGATE; };
udf_type:
- STRING_SYM {$$ = (int) STRING_RESULT; }
- | REAL {$$ = (int) REAL_RESULT; }
+ STRING_SYM {$$ = (int) STRING_RESULT; }
+ | REAL {$$ = (int) REAL_RESULT; }
| DECIMAL_SYM {$$ = (int) DECIMAL_RESULT; }
- | INT_SYM {$$ = (int) INT_RESULT; };
+ | INT_SYM {$$ = (int) INT_RESULT; }
+ ;
field_list:
- field_list_item
- | field_list ',' field_list_item;
-
+ field_list_item
+ | field_list ',' field_list_item
+ ;
field_list_item:
- column_def
- | key_def
- ;
+ column_def
+ | key_def
+ ;
column_def:
- field_spec opt_check_constraint
- | field_spec references
- {
- Lex->col_list.empty(); /* Alloced by sql_alloc */
- }
- ;
+ field_spec opt_check_constraint
+ | field_spec references
+ {
+ Lex->col_list.empty(); /* Alloced by sql_alloc */
+ }
+ ;
key_def:
- key_type opt_ident key_alg '(' key_list ')' key_options
- {
- LEX *lex=Lex;
- if ($1 != Key::FULLTEXT && lex->key_create_info.parser_name.str)
- {
- my_parse_error(ER(ER_SYNTAX_ERROR));
- MYSQL_YYABORT;
- }
- lex->key_list.push_back(new Key($1,$2, &lex->key_create_info, 0,
- lex->col_list));
- lex->col_list.empty(); /* Alloced by sql_alloc */
- }
- | opt_constraint constraint_key_type opt_ident key_alg
- '(' key_list ')' key_options
- {
- LEX *lex=Lex;
- const char *key_name= $3 ? $3 : $1;
- lex->key_list.push_back(new Key($2, key_name, &lex->key_create_info, 0,
- lex->col_list));
- lex->col_list.empty(); /* Alloced by sql_alloc */
- }
- | opt_constraint FOREIGN KEY_SYM opt_ident '(' key_list ')' references
- {
- LEX *lex=Lex;
- lex->key_list.push_back(new foreign_key($4 ? $4:$1, lex->col_list,
- $8,
- lex->ref_list,
- lex->fk_delete_opt,
- lex->fk_update_opt,
- lex->fk_match_option));
- lex->key_list.push_back(new Key(Key::MULTIPLE, $4 ? $4 : $1,
- &default_key_create_info, 1,
- lex->col_list));
- lex->col_list.empty(); /* Alloced by sql_alloc */
-
+ key_type opt_ident key_alg '(' key_list ')' key_options
+ {
+ LEX *lex=Lex;
+ if ($1 != Key::FULLTEXT && lex->key_create_info.parser_name.str)
+ {
+ my_parse_error(ER(ER_SYNTAX_ERROR));
+ MYSQL_YYABORT;
+ }
+ Key *key= new Key($1, $2, &lex->key_create_info, 0,
+ lex->col_list);
+ lex->alter_info.key_list.push_back(key);
+ lex->col_list.empty(); /* Alloced by sql_alloc */
+ }
+ | opt_constraint constraint_key_type opt_ident key_alg
+ '(' 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,
+ lex->col_list);
+ lex->alter_info.key_list.push_back(key);
+ lex->col_list.empty(); /* Alloced by sql_alloc */
+ }
+ | opt_constraint FOREIGN KEY_SYM opt_ident '(' key_list ')' references
+ {
+ LEX *lex=Lex;
+ const char *key_name= $4 ? $4 : $1;
+ Key *key= new Foreign_key(key_name, lex->col_list,
+ $8,
+ lex->ref_list,
+ lex->fk_delete_opt,
+ lex->fk_update_opt,
+ lex->fk_match_option);
+ lex->alter_info.key_list.push_back(key);
+ key= new Key(Key::MULTIPLE, key_name,
+ &default_key_create_info, 1,
+ lex->col_list);
+ lex->alter_info.key_list.push_back(key);
+ lex->col_list.empty(); /* Alloced by sql_alloc */
/* Only used for ALTER TABLE. Ignored otherwise. */
lex->alter_info.flags|= ALTER_FOREIGN_KEY;
- }
- | constraint opt_check_constraint
- {
- Lex->col_list.empty(); /* Alloced by sql_alloc */
- }
- | opt_constraint check_constraint
- {
- Lex->col_list.empty(); /* Alloced by sql_alloc */
- }
- ;
+ }
+ | constraint opt_check_constraint
+ {
+ Lex->col_list.empty(); /* Alloced by sql_alloc */
+ }
+ | opt_constraint check_constraint
+ {
+ Lex->col_list.empty(); /* Alloced by sql_alloc */
+ }
+ ;
opt_check_constraint:
- /* empty */
- | check_constraint
- ;
+ /* empty */
+ | check_constraint
+ ;
check_constraint:
- CHECK_SYM expr
- ;
+ CHECK_SYM expr
+ ;
opt_constraint:
- /* empty */ { $$=(char*) 0; }
- | constraint { $$= $1; }
- ;
+ /* empty */ { $$=(char*) 0; }
+ | constraint { $$= $1; }
+ ;
constraint:
- CONSTRAINT opt_ident { $$=$2; }
- ;
+ CONSTRAINT opt_ident { $$=$2; }
+ ;
field_spec:
- field_ident
- {
- LEX *lex=Lex;
- lex->length=lex->dec=0; lex->type=0;
- lex->default_value= lex->on_update_value= 0;
- lex->comment=null_lex_str;
- lex->charset=NULL;
- }
- type opt_attribute
- {
- LEX *lex=Lex;
- if (add_field_to_list(lex->thd, &$1, (enum enum_field_types) $3,
- lex->length,lex->dec,lex->type,
- lex->default_value, lex->on_update_value,
- &lex->comment,
- lex->change,&lex->interval_list,lex->charset,
- lex->uint_geom_type))
- MYSQL_YYABORT;
- };
+ field_ident
+ {
+ LEX *lex=Lex;
+ lex->length=lex->dec=0;
+ lex->type=0;
+ lex->default_value= lex->on_update_value= 0;
+ lex->comment=null_lex_str;
+ lex->charset=NULL;
+ }
+ type opt_attribute
+ {
+ LEX *lex=Lex;
+ if (add_field_to_list(lex->thd, &$1, (enum enum_field_types) $3,
+ lex->length,lex->dec,lex->type,
+ lex->default_value, lex->on_update_value,
+ &lex->comment,
+ lex->change,&lex->interval_list,lex->charset,
+ lex->uint_geom_type))
+ MYSQL_YYABORT;
+ }
+ ;
type:
- int_type opt_len field_options { $$=$1; }
- | real_type opt_precision field_options { $$=$1; }
- | FLOAT_SYM float_options field_options { $$=MYSQL_TYPE_FLOAT; }
- | BIT_SYM { Lex->length= (char*) "1";
- $$=MYSQL_TYPE_BIT; }
- | BIT_SYM '(' NUM ')' { Lex->length= $3.str;
- $$=MYSQL_TYPE_BIT; }
- | BOOL_SYM { Lex->length=(char*) "1";
- $$=MYSQL_TYPE_TINY; }
- | BOOLEAN_SYM { Lex->length=(char*) "1";
- $$=MYSQL_TYPE_TINY; }
- | char '(' NUM ')' opt_binary { Lex->length=$3.str;
- $$=MYSQL_TYPE_STRING; }
- | char opt_binary { Lex->length=(char*) "1";
- $$=MYSQL_TYPE_STRING; }
- | nchar '(' NUM ')' opt_bin_mod { Lex->length=$3.str;
- $$=MYSQL_TYPE_STRING;
- Lex->charset=national_charset_info; }
- | nchar opt_bin_mod { Lex->length=(char*) "1";
- $$=MYSQL_TYPE_STRING;
- Lex->charset=national_charset_info; }
- | BINARY '(' NUM ')' { Lex->length=$3.str;
- Lex->charset=&my_charset_bin;
- $$=MYSQL_TYPE_STRING; }
- | BINARY { Lex->length= (char*) "1";
- Lex->charset=&my_charset_bin;
- $$=MYSQL_TYPE_STRING; }
- | varchar '(' NUM ')' opt_binary { Lex->length=$3.str;
- $$= MYSQL_TYPE_VARCHAR; }
- | nvarchar '(' NUM ')' opt_bin_mod { Lex->length=$3.str;
- $$= MYSQL_TYPE_VARCHAR;
- Lex->charset=national_charset_info; }
- | VARBINARY '(' NUM ')' { Lex->length=$3.str;
- Lex->charset=&my_charset_bin;
- $$= MYSQL_TYPE_VARCHAR; }
- | YEAR_SYM opt_len field_options { $$=MYSQL_TYPE_YEAR; }
- | DATE_SYM { $$=MYSQL_TYPE_DATE; }
- | TIME_SYM { $$=MYSQL_TYPE_TIME; }
- | TIMESTAMP opt_len
- {
- if (YYTHD->variables.sql_mode & MODE_MAXDB)
- $$=MYSQL_TYPE_DATETIME;
- else
+ int_type opt_len field_options { $$=$1; }
+ | real_type opt_precision field_options { $$=$1; }
+ | FLOAT_SYM float_options field_options { $$=MYSQL_TYPE_FLOAT; }
+ | BIT_SYM
+ {
+ Lex->length= (char*) "1";
+ $$=MYSQL_TYPE_BIT;
+ }
+ | BIT_SYM '(' NUM ')'
+ {
+ Lex->length= $3.str;
+ $$=MYSQL_TYPE_BIT;
+ }
+ | BOOL_SYM
+ {
+ Lex->length=(char*) "1";
+ $$=MYSQL_TYPE_TINY;
+ }
+ | BOOLEAN_SYM
+ {
+ Lex->length=(char*) "1";
+ $$=MYSQL_TYPE_TINY;
+ }
+ | char '(' NUM ')' opt_binary
+ {
+ Lex->length=$3.str;
+ $$=MYSQL_TYPE_STRING;
+ }
+ | char opt_binary
+ {
+ Lex->length=(char*) "1";
+ $$=MYSQL_TYPE_STRING;
+ }
+ | nchar '(' NUM ')' opt_bin_mod
+ {
+ Lex->length=$3.str;
+ $$=MYSQL_TYPE_STRING;
+ Lex->charset=national_charset_info;
+ }
+ | nchar opt_bin_mod
+ {
+ Lex->length=(char*) "1";
+ $$=MYSQL_TYPE_STRING;
+ Lex->charset=national_charset_info;
+ }
+ | BINARY '(' NUM ')'
+ {
+ Lex->length=$3.str;
+ Lex->charset=&my_charset_bin;
+ $$=MYSQL_TYPE_STRING;
+ }
+ | BINARY
+ {
+ Lex->length= (char*) "1";
+ Lex->charset=&my_charset_bin;
+ $$=MYSQL_TYPE_STRING;
+ }
+ | varchar '(' NUM ')' opt_binary
+ {
+ Lex->length=$3.str;
+ $$= MYSQL_TYPE_VARCHAR;
+ }
+ | nvarchar '(' NUM ')' opt_bin_mod
+ {
+ Lex->length=$3.str;
+ $$= MYSQL_TYPE_VARCHAR;
+ Lex->charset=national_charset_info;
+ }
+ | VARBINARY '(' NUM ')'
+ {
+ Lex->length=$3.str;
+ Lex->charset=&my_charset_bin;
+ $$= MYSQL_TYPE_VARCHAR;
+ }
+ | YEAR_SYM opt_len field_options
+ { $$=MYSQL_TYPE_YEAR; }
+ | DATE_SYM
+ { $$=MYSQL_TYPE_DATE; }
+ | TIME_SYM
+ { $$=MYSQL_TYPE_TIME; }
+ | TIMESTAMP opt_len
+ {
+ if (YYTHD->variables.sql_mode & MODE_MAXDB)
+ $$=MYSQL_TYPE_DATETIME;
+ else
{
/*
Unlike other types TIMESTAMP fields are NOT NULL by default.
*/
Lex->type|= NOT_NULL_FLAG;
- $$=MYSQL_TYPE_TIMESTAMP;
+ $$=MYSQL_TYPE_TIMESTAMP;
}
- }
- | DATETIME { $$=MYSQL_TYPE_DATETIME; }
- | TINYBLOB { Lex->charset=&my_charset_bin;
- $$=MYSQL_TYPE_TINY_BLOB; }
- | BLOB_SYM opt_len { Lex->charset=&my_charset_bin;
- $$=MYSQL_TYPE_BLOB; }
- | spatial_type
+ }
+ | DATETIME
+ { $$=MYSQL_TYPE_DATETIME; }
+ | TINYBLOB
+ {
+ Lex->charset=&my_charset_bin;
+ $$=MYSQL_TYPE_TINY_BLOB;
+ }
+ | BLOB_SYM opt_len
+ {
+ Lex->charset=&my_charset_bin;
+ $$=MYSQL_TYPE_BLOB;
+ }
+ | spatial_type
{
#ifdef HAVE_SPATIAL
Lex->charset=&my_charset_bin;
@@ -4628,379 +4853,439 @@ type:
MYSQL_YYABORT;
#endif
}
- | MEDIUMBLOB { Lex->charset=&my_charset_bin;
- $$=MYSQL_TYPE_MEDIUM_BLOB; }
- | LONGBLOB { Lex->charset=&my_charset_bin;
- $$=MYSQL_TYPE_LONG_BLOB; }
- | LONG_SYM VARBINARY { Lex->charset=&my_charset_bin;
- $$=MYSQL_TYPE_MEDIUM_BLOB; }
- | LONG_SYM varchar opt_binary { $$=MYSQL_TYPE_MEDIUM_BLOB; }
- | TINYTEXT opt_binary { $$=MYSQL_TYPE_TINY_BLOB; }
- | TEXT_SYM opt_len opt_binary { $$=MYSQL_TYPE_BLOB; }
- | MEDIUMTEXT opt_binary { $$=MYSQL_TYPE_MEDIUM_BLOB; }
- | LONGTEXT opt_binary { $$=MYSQL_TYPE_LONG_BLOB; }
- | DECIMAL_SYM float_options field_options
- { $$=MYSQL_TYPE_NEWDECIMAL;}
- | NUMERIC_SYM float_options field_options
- { $$=MYSQL_TYPE_NEWDECIMAL;}
- | FIXED_SYM float_options field_options
- { $$=MYSQL_TYPE_NEWDECIMAL;}
- | ENUM {Lex->interval_list.empty();} '(' string_list ')' opt_binary
- { $$=MYSQL_TYPE_ENUM; }
- | SET { Lex->interval_list.empty();} '(' string_list ')' opt_binary
- { $$=MYSQL_TYPE_SET; }
- | LONG_SYM opt_binary { $$=MYSQL_TYPE_MEDIUM_BLOB; }
- | SERIAL_SYM
- {
- $$=MYSQL_TYPE_LONGLONG;
- Lex->type|= (AUTO_INCREMENT_FLAG | NOT_NULL_FLAG | UNSIGNED_FLAG |
- UNIQUE_FLAG);
- }
- ;
+ | MEDIUMBLOB
+ {
+ Lex->charset=&my_charset_bin;
+ $$=MYSQL_TYPE_MEDIUM_BLOB;
+ }
+ | LONGBLOB
+ {
+ Lex->charset=&my_charset_bin;
+ $$=MYSQL_TYPE_LONG_BLOB;
+ }
+ | LONG_SYM VARBINARY
+ {
+ Lex->charset=&my_charset_bin;
+ $$=MYSQL_TYPE_MEDIUM_BLOB;
+ }
+ | LONG_SYM varchar opt_binary
+ { $$=MYSQL_TYPE_MEDIUM_BLOB; }
+ | TINYTEXT opt_binary
+ { $$=MYSQL_TYPE_TINY_BLOB; }
+ | TEXT_SYM opt_len opt_binary
+ { $$=MYSQL_TYPE_BLOB; }
+ | MEDIUMTEXT opt_binary
+ { $$=MYSQL_TYPE_MEDIUM_BLOB; }
+ | LONGTEXT opt_binary
+ { $$=MYSQL_TYPE_LONG_BLOB; }
+ | DECIMAL_SYM float_options field_options
+ { $$=MYSQL_TYPE_NEWDECIMAL;}
+ | NUMERIC_SYM float_options field_options
+ { $$=MYSQL_TYPE_NEWDECIMAL;}
+ | FIXED_SYM float_options field_options
+ { $$=MYSQL_TYPE_NEWDECIMAL;}
+ | ENUM
+ {Lex->interval_list.empty();}
+ '(' string_list ')' opt_binary
+ { $$=MYSQL_TYPE_ENUM; }
+ | SET
+ { Lex->interval_list.empty();}
+ '(' string_list ')' opt_binary
+ { $$=MYSQL_TYPE_SET; }
+ | LONG_SYM opt_binary
+ { $$=MYSQL_TYPE_MEDIUM_BLOB; }
+ | SERIAL_SYM
+ {
+ $$=MYSQL_TYPE_LONGLONG;
+ Lex->type|= (AUTO_INCREMENT_FLAG | NOT_NULL_FLAG | UNSIGNED_FLAG |
+ UNIQUE_FLAG);
+ }
+ ;
spatial_type:
- GEOMETRY_SYM { $$= Field::GEOM_GEOMETRY; }
- | GEOMETRYCOLLECTION { $$= Field::GEOM_GEOMETRYCOLLECTION; }
- | POINT_SYM { Lex->length= (char*)"21";
- $$= Field::GEOM_POINT;
- }
- | MULTIPOINT { $$= Field::GEOM_MULTIPOINT; }
- | LINESTRING { $$= Field::GEOM_LINESTRING; }
- | MULTILINESTRING { $$= Field::GEOM_MULTILINESTRING; }
- | POLYGON { $$= Field::GEOM_POLYGON; }
- | MULTIPOLYGON { $$= Field::GEOM_MULTIPOLYGON; }
- ;
+ GEOMETRY_SYM { $$= Field::GEOM_GEOMETRY; }
+ | GEOMETRYCOLLECTION { $$= Field::GEOM_GEOMETRYCOLLECTION; }
+ | POINT_SYM
+ {
+ Lex->length= (char*)"21";
+ $$= Field::GEOM_POINT;
+ }
+ | MULTIPOINT { $$= Field::GEOM_MULTIPOINT; }
+ | LINESTRING { $$= Field::GEOM_LINESTRING; }
+ | MULTILINESTRING { $$= Field::GEOM_MULTILINESTRING; }
+ | POLYGON { $$= Field::GEOM_POLYGON; }
+ | MULTIPOLYGON { $$= Field::GEOM_MULTIPOLYGON; }
+ ;
char:
- CHAR_SYM {}
- ;
+ CHAR_SYM {}
+ ;
nchar:
- NCHAR_SYM {}
- | NATIONAL_SYM CHAR_SYM {}
- ;
+ NCHAR_SYM {}
+ | NATIONAL_SYM CHAR_SYM {}
+ ;
varchar:
- char VARYING {}
- | VARCHAR {}
- ;
+ char VARYING {}
+ | VARCHAR {}
+ ;
nvarchar:
- NATIONAL_SYM VARCHAR {}
- | NVARCHAR_SYM {}
- | NCHAR_SYM VARCHAR {}
- | NATIONAL_SYM CHAR_SYM VARYING {}
- | NCHAR_SYM VARYING {}
- ;
+ NATIONAL_SYM VARCHAR {}
+ | NVARCHAR_SYM {}
+ | NCHAR_SYM VARCHAR {}
+ | NATIONAL_SYM CHAR_SYM VARYING {}
+ | NCHAR_SYM VARYING {}
+ ;
int_type:
- INT_SYM { $$=MYSQL_TYPE_LONG; }
- | TINYINT { $$=MYSQL_TYPE_TINY; }
- | SMALLINT { $$=MYSQL_TYPE_SHORT; }
- | MEDIUMINT { $$=MYSQL_TYPE_INT24; }
- | BIGINT { $$=MYSQL_TYPE_LONGLONG; };
+ INT_SYM { $$=MYSQL_TYPE_LONG; }
+ | TINYINT { $$=MYSQL_TYPE_TINY; }
+ | SMALLINT { $$=MYSQL_TYPE_SHORT; }
+ | MEDIUMINT { $$=MYSQL_TYPE_INT24; }
+ | BIGINT { $$=MYSQL_TYPE_LONGLONG; }
+ ;
real_type:
- REAL { $$= YYTHD->variables.sql_mode & MODE_REAL_AS_FLOAT ?
- MYSQL_TYPE_FLOAT : MYSQL_TYPE_DOUBLE; }
- | DOUBLE_SYM { $$=MYSQL_TYPE_DOUBLE; }
- | DOUBLE_SYM PRECISION { $$=MYSQL_TYPE_DOUBLE; };
-
+ REAL
+ {
+ $$= YYTHD->variables.sql_mode & MODE_REAL_AS_FLOAT ?
+ MYSQL_TYPE_FLOAT : MYSQL_TYPE_DOUBLE;
+ }
+ | DOUBLE_SYM
+ { $$=MYSQL_TYPE_DOUBLE; }
+ | DOUBLE_SYM PRECISION
+ { $$=MYSQL_TYPE_DOUBLE; }
+ ;
float_options:
- /* empty */ { Lex->dec=Lex->length= (char*)0; }
- | '(' NUM ')' { Lex->length=$2.str; Lex->dec= (char*)0; }
- | precision {};
+ /* empty */
+ { Lex->dec=Lex->length= (char*)0; }
+ | '(' NUM ')'
+ { Lex->length=$2.str; Lex->dec= (char*)0; }
+ | precision
+ {}
+ ;
precision:
- '(' NUM ',' NUM ')'
- {
- LEX *lex=Lex;
- lex->length=$2.str; lex->dec=$4.str;
- };
+ '(' NUM ',' NUM ')'
+ {
+ LEX *lex=Lex;
+ lex->length=$2.str;
+ lex->dec=$4.str;
+ }
+ ;
field_options:
- /* empty */ {}
- | field_opt_list {};
+ /* empty */ {}
+ | field_opt_list {}
+ ;
field_opt_list:
- field_opt_list field_option {}
- | field_option {};
+ field_opt_list field_option {}
+ | field_option {}
+ ;
field_option:
- SIGNED_SYM {}
- | UNSIGNED { Lex->type|= UNSIGNED_FLAG;}
- | ZEROFILL { Lex->type|= UNSIGNED_FLAG | ZEROFILL_FLAG; };
+ SIGNED_SYM {}
+ | UNSIGNED { Lex->type|= UNSIGNED_FLAG;}
+ | ZEROFILL { Lex->type|= UNSIGNED_FLAG | ZEROFILL_FLAG; }
+ ;
opt_len:
- /* empty */ { Lex->length=(char*) 0; } /* use default length */
- | '(' NUM ')' { Lex->length= $2.str; };
+ /* empty */ { Lex->length=(char*) 0; /* use default length */ }
+ | '(' NUM ')' { Lex->length= $2.str; }
+ ;
opt_precision:
- /* empty */ {}
- | precision {};
+ /* empty */ {}
+ | precision {}
+ ;
opt_attribute:
- /* empty */ {}
- | opt_attribute_list {};
+ /* empty */ {}
+ | opt_attribute_list {}
+ ;
opt_attribute_list:
- opt_attribute_list attribute {}
- | attribute;
+ opt_attribute_list attribute {}
+ | attribute
+ ;
attribute:
- NULL_SYM { Lex->type&= ~ NOT_NULL_FLAG; }
- | not NULL_SYM { Lex->type|= NOT_NULL_FLAG; }
- | DEFAULT now_or_signed_literal { Lex->default_value=$2; }
- | ON UPDATE_SYM NOW_SYM optional_braces
+ NULL_SYM { Lex->type&= ~ NOT_NULL_FLAG; }
+ | not NULL_SYM { Lex->type|= NOT_NULL_FLAG; }
+ | DEFAULT now_or_signed_literal { Lex->default_value=$2; }
+ | ON UPDATE_SYM NOW_SYM optional_braces
{ Lex->on_update_value= new Item_func_now_local(); }
- | AUTO_INC { Lex->type|= AUTO_INCREMENT_FLAG | NOT_NULL_FLAG; }
- | SERIAL_SYM DEFAULT VALUE_SYM
- {
- LEX *lex=Lex;
- lex->type|= AUTO_INCREMENT_FLAG | NOT_NULL_FLAG | UNIQUE_FLAG;
- lex->alter_info.flags|= ALTER_ADD_INDEX;
- }
- | opt_primary KEY_SYM
- {
- LEX *lex=Lex;
- lex->type|= PRI_KEY_FLAG | NOT_NULL_FLAG;
- lex->alter_info.flags|= ALTER_ADD_INDEX;
- }
- | UNIQUE_SYM
- {
- LEX *lex=Lex;
- lex->type|= UNIQUE_FLAG;
- lex->alter_info.flags|= ALTER_ADD_INDEX;
- }
- | UNIQUE_SYM KEY_SYM
- {
- LEX *lex=Lex;
- lex->type|= UNIQUE_KEY_FLAG;
- lex->alter_info.flags|= ALTER_ADD_INDEX;
- }
- | COMMENT_SYM TEXT_STRING_sys { Lex->comment= $2; }
- | COLLATE_SYM collation_name
- {
- if (Lex->charset && !my_charset_same(Lex->charset,$2))
- {
- my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
+ | AUTO_INC { Lex->type|= AUTO_INCREMENT_FLAG | NOT_NULL_FLAG; }
+ | SERIAL_SYM DEFAULT VALUE_SYM
+ {
+ LEX *lex=Lex;
+ lex->type|= AUTO_INCREMENT_FLAG | NOT_NULL_FLAG | UNIQUE_FLAG;
+ lex->alter_info.flags|= ALTER_ADD_INDEX;
+ }
+ | opt_primary KEY_SYM
+ {
+ LEX *lex=Lex;
+ lex->type|= PRI_KEY_FLAG | NOT_NULL_FLAG;
+ lex->alter_info.flags|= ALTER_ADD_INDEX;
+ }
+ | UNIQUE_SYM
+ {
+ LEX *lex=Lex;
+ lex->type|= UNIQUE_FLAG;
+ lex->alter_info.flags|= ALTER_ADD_INDEX;
+ }
+ | UNIQUE_SYM KEY_SYM
+ {
+ LEX *lex=Lex;
+ lex->type|= UNIQUE_KEY_FLAG;
+ lex->alter_info.flags|= ALTER_ADD_INDEX;
+ }
+ | COMMENT_SYM TEXT_STRING_sys { Lex->comment= $2; }
+ | COLLATE_SYM collation_name
+ {
+ if (Lex->charset && !my_charset_same(Lex->charset,$2))
+ {
+ my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
$2->name,Lex->charset->csname);
- MYSQL_YYABORT;
- }
- else
- {
- Lex->charset=$2;
- }
- }
- ;
+ MYSQL_YYABORT;
+ }
+ else
+ {
+ Lex->charset=$2;
+ }
+ }
+ ;
now_or_signed_literal:
- NOW_SYM optional_braces { $$= new Item_func_now_local(); }
- | signed_literal { $$=$1; }
+ NOW_SYM optional_braces
+ { $$= new Item_func_now_local(); }
+ | signed_literal
+ { $$=$1; }
;
charset:
- CHAR_SYM SET {}
- | CHARSET {}
- ;
+ CHAR_SYM SET {}
+ | CHARSET {}
+ ;
charset_name:
- ident_or_text
- {
- if (!($$=get_charset_by_csname($1.str,MY_CS_PRIMARY,MYF(0))))
- {
- my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), $1.str);
- MYSQL_YYABORT;
- }
- }
- | BINARY { $$= &my_charset_bin; }
- ;
+ ident_or_text
+ {
+ if (!($$=get_charset_by_csname($1.str,MY_CS_PRIMARY,MYF(0))))
+ {
+ my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), $1.str);
+ MYSQL_YYABORT;
+ }
+ }
+ | BINARY { $$= &my_charset_bin; }
+ ;
charset_name_or_default:
- charset_name { $$=$1; }
- | DEFAULT { $$=NULL; } ;
+ charset_name { $$=$1; }
+ | DEFAULT { $$=NULL; }
+ ;
opt_load_data_charset:
- /* Empty */ { $$= NULL; }
- | charset charset_name_or_default { $$= $2; }
- ;
+ /* Empty */ { $$= NULL; }
+ | charset charset_name_or_default { $$= $2; }
+ ;
old_or_new_charset_name:
- ident_or_text
- {
- if (!($$=get_charset_by_csname($1.str,MY_CS_PRIMARY,MYF(0))) &&
- !($$=get_old_charset_by_name($1.str)))
- {
- my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), $1.str);
- MYSQL_YYABORT;
- }
- }
- | BINARY { $$= &my_charset_bin; }
- ;
+ ident_or_text
+ {
+ if (!($$=get_charset_by_csname($1.str,MY_CS_PRIMARY,MYF(0))) &&
+ !($$=get_old_charset_by_name($1.str)))
+ {
+ my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), $1.str);
+ MYSQL_YYABORT;
+ }
+ }
+ | BINARY { $$= &my_charset_bin; }
+ ;
old_or_new_charset_name_or_default:
- old_or_new_charset_name { $$=$1; }
- | DEFAULT { $$=NULL; } ;
+ old_or_new_charset_name { $$=$1; }
+ | DEFAULT { $$=NULL; }
+ ;
collation_name:
- ident_or_text
- {
- if (!($$=get_charset_by_name($1.str,MYF(0))))
- {
- my_error(ER_UNKNOWN_COLLATION, MYF(0), $1.str);
- MYSQL_YYABORT;
- }
- };
+ ident_or_text
+ {
+ if (!($$=get_charset_by_name($1.str,MYF(0))))
+ {
+ my_error(ER_UNKNOWN_COLLATION, MYF(0), $1.str);
+ MYSQL_YYABORT;
+ }
+ }
+ ;
opt_collate:
- /* empty */ { $$=NULL; }
- | COLLATE_SYM collation_name_or_default { $$=$2; }
- ;
+ /* empty */ { $$=NULL; }
+ | COLLATE_SYM collation_name_or_default { $$=$2; }
+ ;
collation_name_or_default:
- collation_name { $$=$1; }
- | DEFAULT { $$=NULL; } ;
+ collation_name { $$=$1; }
+ | DEFAULT { $$=NULL; }
+ ;
opt_default:
- /* empty */ {}
- | DEFAULT {};
+ /* empty */ {}
+ | DEFAULT {}
+ ;
opt_binary:
- /* empty */ { Lex->charset=NULL; }
- | ASCII_SYM opt_bin_mod { Lex->charset=&my_charset_latin1; }
- | BYTE_SYM { Lex->charset=&my_charset_bin; }
- | UNICODE_SYM opt_bin_mod
- {
- if (!(Lex->charset=get_charset_by_csname("ucs2",
- MY_CS_PRIMARY,MYF(0))))
- {
- my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), "ucs2");
- MYSQL_YYABORT;
- }
- }
- | charset charset_name opt_bin_mod { Lex->charset=$2; }
- | BINARY opt_bin_charset { Lex->type|= BINCMP_FLAG; };
+ /* empty */ { Lex->charset=NULL; }
+ | ASCII_SYM opt_bin_mod { Lex->charset=&my_charset_latin1; }
+ | BYTE_SYM { Lex->charset=&my_charset_bin; }
+ | UNICODE_SYM opt_bin_mod
+ {
+ if (!(Lex->charset=get_charset_by_csname("ucs2",
+ MY_CS_PRIMARY,MYF(0))))
+ {
+ my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), "ucs2");
+ MYSQL_YYABORT;
+ }
+ }
+ | charset charset_name opt_bin_mod { Lex->charset=$2; }
+ | BINARY opt_bin_charset { Lex->type|= BINCMP_FLAG; }
+ ;
opt_bin_mod:
- /* empty */ { }
- | BINARY { Lex->type|= BINCMP_FLAG; };
+ /* empty */ { }
+ | BINARY { Lex->type|= BINCMP_FLAG; }
+ ;
opt_bin_charset:
- /* empty */ { Lex->charset= NULL; }
- | ASCII_SYM { Lex->charset=&my_charset_latin1; }
- | UNICODE_SYM
- {
- if (!(Lex->charset=get_charset_by_csname("ucs2",
- MY_CS_PRIMARY,MYF(0))))
- {
- my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), "ucs2");
- MYSQL_YYABORT;
- }
- }
- | charset charset_name { Lex->charset=$2; } ;
+ /* empty */ { Lex->charset= NULL; }
+ | ASCII_SYM { Lex->charset=&my_charset_latin1; }
+ | UNICODE_SYM
+ {
+ if (!(Lex->charset=get_charset_by_csname("ucs2",
+ MY_CS_PRIMARY,MYF(0))))
+ {
+ my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), "ucs2");
+ MYSQL_YYABORT;
+ }
+ }
+ | charset charset_name { Lex->charset=$2; }
+ ;
opt_primary:
- /* empty */
- | PRIMARY_SYM
- ;
+ /* empty */
+ | PRIMARY_SYM
+ ;
references:
- REFERENCES table_ident
- {
- LEX *lex=Lex;
- lex->fk_delete_opt= lex->fk_update_opt= lex->fk_match_option= 0;
- lex->ref_list.empty();
- }
- opt_ref_list
- {
- $$=$2;
- };
+ REFERENCES table_ident
+ {
+ LEX *lex=Lex;
+ lex->fk_delete_opt= lex->fk_update_opt= lex->fk_match_option= 0;
+ lex->ref_list.empty();
+ }
+ opt_ref_list
+ {
+ $$=$2;
+ }
+ ;
opt_ref_list:
- /* empty */ opt_on_delete {}
- | '(' ref_list ')' opt_on_delete {};
+ /* empty */ opt_on_delete {}
+ | '(' ref_list ')' opt_on_delete {}
+ ;
ref_list:
- ref_list ',' ident { Lex->ref_list.push_back(new key_part_spec($3.str)); }
- | ident { Lex->ref_list.push_back(new key_part_spec($1.str)); };
-
+ ref_list ',' ident { Lex->ref_list.push_back(new Key_part_spec($3.str)); }
+ | ident { Lex->ref_list.push_back(new Key_part_spec($1.str)); }
+ ;
opt_on_delete:
- /* empty */ {}
- | opt_on_delete_list {};
+ /* empty */ {}
+ | opt_on_delete_list {}
+ ;
opt_on_delete_list:
- opt_on_delete_list opt_on_delete_item {}
- | opt_on_delete_item {};
+ opt_on_delete_list opt_on_delete_item {}
+ | opt_on_delete_item {}
+ ;
opt_on_delete_item:
- ON DELETE_SYM delete_option { Lex->fk_delete_opt= $3; }
- | ON UPDATE_SYM delete_option { Lex->fk_update_opt= $3; }
- | MATCH FULL { Lex->fk_match_option= foreign_key::FK_MATCH_FULL; }
- | MATCH PARTIAL { Lex->fk_match_option= foreign_key::FK_MATCH_PARTIAL; }
- | MATCH SIMPLE_SYM { Lex->fk_match_option= foreign_key::FK_MATCH_SIMPLE; };
+ ON DELETE_SYM delete_option { Lex->fk_delete_opt= $3; }
+ | ON UPDATE_SYM delete_option { Lex->fk_update_opt= $3; }
+ | MATCH FULL { Lex->fk_match_option= Foreign_key::FK_MATCH_FULL; }
+ | MATCH PARTIAL { Lex->fk_match_option= Foreign_key::FK_MATCH_PARTIAL; }
+ | MATCH SIMPLE_SYM { Lex->fk_match_option= Foreign_key::FK_MATCH_SIMPLE; }
+ ;
delete_option:
- RESTRICT { $$= (int) foreign_key::FK_OPTION_RESTRICT; }
- | CASCADE { $$= (int) foreign_key::FK_OPTION_CASCADE; }
- | SET NULL_SYM { $$= (int) foreign_key::FK_OPTION_SET_NULL; }
- | NO_SYM ACTION { $$= (int) foreign_key::FK_OPTION_NO_ACTION; }
- | SET DEFAULT { $$= (int) foreign_key::FK_OPTION_DEFAULT; };
+ RESTRICT { $$= (int) Foreign_key::FK_OPTION_RESTRICT; }
+ | CASCADE { $$= (int) Foreign_key::FK_OPTION_CASCADE; }
+ | SET NULL_SYM { $$= (int) Foreign_key::FK_OPTION_SET_NULL; }
+ | NO_SYM ACTION { $$= (int) Foreign_key::FK_OPTION_NO_ACTION; }
+ | SET DEFAULT { $$= (int) Foreign_key::FK_OPTION_DEFAULT; }
+ ;
key_type:
- key_or_index { $$= Key::MULTIPLE; }
- | FULLTEXT_SYM opt_key_or_index { $$= Key::FULLTEXT; }
- | SPATIAL_SYM opt_key_or_index
- {
+ key_or_index { $$= Key::MULTIPLE; }
+ | FULLTEXT_SYM opt_key_or_index { $$= Key::FULLTEXT; }
+ | SPATIAL_SYM opt_key_or_index
+ {
#ifdef HAVE_SPATIAL
- $$= Key::SPATIAL;
+ $$= Key::SPATIAL;
#else
- my_error(ER_FEATURE_DISABLED, MYF(0),
+ my_error(ER_FEATURE_DISABLED, MYF(0),
sym_group_geom.name, sym_group_geom.needed_define);
- MYSQL_YYABORT;
+ MYSQL_YYABORT;
#endif
- };
+ }
+ ;
constraint_key_type:
- PRIMARY_SYM KEY_SYM { $$= Key::PRIMARY; }
- | UNIQUE_SYM opt_key_or_index { $$= Key::UNIQUE; };
+ PRIMARY_SYM KEY_SYM { $$= Key::PRIMARY; }
+ | UNIQUE_SYM opt_key_or_index { $$= Key::UNIQUE; }
+ ;
key_or_index:
- KEY_SYM {}
- | INDEX_SYM {};
+ KEY_SYM {}
+ | INDEX_SYM {}
+ ;
opt_key_or_index:
- /* empty */ {}
- | key_or_index
- ;
+ /* empty */ {}
+ | key_or_index
+ ;
keys_or_index:
- KEYS {}
- | INDEX_SYM {}
- | INDEXES {};
+ KEYS {}
+ | INDEX_SYM {}
+ | INDEXES {}
+ ;
opt_unique_or_fulltext:
- /* empty */ { $$= Key::MULTIPLE; }
- | UNIQUE_SYM { $$= Key::UNIQUE; }
- | FULLTEXT_SYM { $$= Key::FULLTEXT;}
- | SPATIAL_SYM
- {
+ /* empty */ { $$= Key::MULTIPLE; }
+ | UNIQUE_SYM { $$= Key::UNIQUE; }
+ | FULLTEXT_SYM { $$= Key::FULLTEXT;}
+ | SPATIAL_SYM
+ {
#ifdef HAVE_SPATIAL
- $$= Key::SPATIAL;
+ $$= Key::SPATIAL;
#else
my_error(ER_FEATURE_DISABLED, MYF(0),
sym_group_geom.name, sym_group_geom.needed_define);
- MYSQL_YYABORT;
+ MYSQL_YYABORT;
#endif
- }
+ }
;
init_key_options:
- {
- Lex->key_create_info= default_key_create_info;
- }
- ;
+ {
+ Lex->key_create_info= default_key_create_info;
+ }
+ ;
/*
For now, key_alg initializies lex->key_create_info.
@@ -5009,30 +5294,30 @@ init_key_options:
*/
key_alg:
- /* empty */ init_key_options
- | init_key_options key_using_alg
- ;
+ init_key_options
+ | init_key_options key_using_alg
+ ;
key_options:
- /* empty */ {}
- | key_opts
- ;
+ /* empty */ {}
+ | key_opts
+ ;
key_opts:
- key_opt
- | key_opts key_opt
- ;
+ key_opt
+ | key_opts key_opt
+ ;
key_using_alg:
- USING btree_or_rtree { Lex->key_create_info.algorithm= $2; }
- | TYPE_SYM btree_or_rtree { Lex->key_create_info.algorithm= $2; }
+ USING btree_or_rtree { Lex->key_create_info.algorithm= $2; }
+ | TYPE_SYM btree_or_rtree { Lex->key_create_info.algorithm= $2; }
;
key_opt:
- key_using_alg
- | KEY_BLOCK_SIZE opt_equal ulong_num
- { Lex->key_create_info.block_size= $3; }
- | WITH PARSER_SYM IDENT_sys
+ key_using_alg
+ | KEY_BLOCK_SIZE opt_equal ulong_num
+ { Lex->key_create_info.block_size= $3; }
+ | WITH PARSER_SYM IDENT_sys
{
if (plugin_is_ready(&$3, MYSQL_FTPARSER_PLUGIN))
Lex->key_create_info.parser_name= $3;
@@ -5044,131 +5329,135 @@ key_opt:
}
;
-
btree_or_rtree:
- BTREE_SYM { $$= HA_KEY_ALG_BTREE; }
- | RTREE_SYM
- {
- $$= HA_KEY_ALG_RTREE;
- }
- | HASH_SYM { $$= HA_KEY_ALG_HASH; };
+ BTREE_SYM { $$= HA_KEY_ALG_BTREE; }
+ | RTREE_SYM { $$= HA_KEY_ALG_RTREE; }
+ | HASH_SYM { $$= HA_KEY_ALG_HASH; }
+ ;
key_list:
- key_list ',' key_part order_dir { Lex->col_list.push_back($3); }
- | key_part order_dir { Lex->col_list.push_back($1); };
+ key_list ',' key_part order_dir { Lex->col_list.push_back($3); }
+ | key_part order_dir { Lex->col_list.push_back($1); }
+ ;
key_part:
- ident { $$=new key_part_spec($1.str); }
- | ident '(' NUM ')'
- {
- int key_part_len= atoi($3.str);
- if (!key_part_len)
+ ident { $$=new Key_part_spec($1.str); }
+ | ident '(' NUM ')'
{
- my_error(ER_KEY_PART_0, MYF(0), $1.str);
+ int key_part_len= atoi($3.str);
+ if (!key_part_len)
+ {
+ 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.str,(uint) key_part_len);
- };
+ ;
opt_ident:
- /* empty */ { $$=(char*) 0; } /* Defaultlength */
- | field_ident { $$=$1.str; };
+ /* empty */ { $$=(char*) 0; /* Default length */ }
+ | field_ident { $$=$1.str; }
+ ;
opt_component:
- /* empty */ { $$= null_lex_str; }
- | '.' ident { $$= $2; };
+ /* empty */ { $$= null_lex_str; }
+ | '.' ident { $$= $2; }
+ ;
string_list:
- text_string { Lex->interval_list.push_back($1); }
- | string_list ',' text_string { Lex->interval_list.push_back($3); };
+ text_string { Lex->interval_list.push_back($1); }
+ | string_list ',' text_string { Lex->interval_list.push_back($3); };
/*
** Alter table
*/
alter:
- ALTER opt_ignore TABLE_SYM table_ident
- {
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- lex->name.str= 0;
- lex->name.length= 0;
- lex->sql_command= SQLCOM_ALTER_TABLE;
- lex->duplicates= DUP_ERROR;
- if (!lex->select_lex.add_table_to_list(thd, $4, NULL,
- TL_OPTION_UPDATING))
- MYSQL_YYABORT;
- lex->create_list.empty();
- lex->key_list.empty();
- lex->col_list.empty();
- lex->select_lex.init_order();
- lex->like_name= 0;
- lex->select_lex.db=
- ((TABLE_LIST*) lex->select_lex.table_list.first)->db;
- bzero((char*) &lex->create_info,sizeof(lex->create_info));
- lex->create_info.db_type= 0;
- lex->create_info.default_table_charset= NULL;
- lex->create_info.row_type= ROW_TYPE_NOT_USED;
- lex->alter_info.reset();
- lex->alter_info.flags= 0;
- lex->no_write_to_binlog= 0;
- lex->create_info.storage_media= HA_SM_DEFAULT;
- }
- alter_commands
- {}
- | ALTER DATABASE ident_or_empty
+ ALTER opt_ignore TABLE_SYM table_ident
+ {
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ lex->name.str= 0;
+ lex->name.length= 0;
+ lex->sql_command= SQLCOM_ALTER_TABLE;
+ lex->duplicates= DUP_ERROR;
+ 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=
+ ((TABLE_LIST*) lex->select_lex.table_list.first)->db;
+ bzero((char*) &lex->create_info,sizeof(lex->create_info));
+ lex->create_info.db_type= 0;
+ lex->create_info.default_table_charset= NULL;
+ lex->create_info.row_type= ROW_TYPE_NOT_USED;
+ lex->alter_info.reset();
+ lex->no_write_to_binlog= 0;
+ lex->create_info.storage_media= HA_SM_DEFAULT;
+ }
+ alter_commands
+ {}
+ | ALTER DATABASE ident_or_empty
{
Lex->create_info.default_table_charset= NULL;
Lex->create_info.used_fields= 0;
}
- opt_create_database_options
- {
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- lex->sql_command=SQLCOM_ALTER_DB;
- lex->name= $3;
+ create_database_options
+ {
+ LEX *lex=Lex;
+ lex->sql_command=SQLCOM_ALTER_DB;
+ lex->name= $3;
if (lex->name.str == NULL &&
- thd->copy_db_to(&lex->name.str, &lex->name.length))
- MYSQL_YYABORT;
- }
- | ALTER PROCEDURE sp_name
- {
- LEX *lex= Lex;
-
- if (lex->sphead)
- {
- my_error(ER_SP_NO_DROP_SP, MYF(0), "PROCEDURE");
- MYSQL_YYABORT;
- }
- bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics));
- }
- sp_a_chistics
- {
- LEX *lex=Lex;
-
- lex->sql_command= SQLCOM_ALTER_PROCEDURE;
- lex->spname= $3;
- }
- | ALTER FUNCTION_SYM sp_name
- {
- LEX *lex= Lex;
-
- if (lex->sphead)
- {
- my_error(ER_SP_NO_DROP_SP, MYF(0), "FUNCTION");
- MYSQL_YYABORT;
- }
- bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics));
- }
- sp_a_chistics
- {
- LEX *lex=Lex;
-
- lex->sql_command= SQLCOM_ALTER_FUNCTION;
- lex->spname= $3;
- }
+ lex->copy_db_to(&lex->name.str, &lex->name.length))
+ MYSQL_YYABORT;
+ }
+ | ALTER PROCEDURE sp_name
+ {
+ LEX *lex= Lex;
+
+ if (lex->sphead)
+ {
+ my_error(ER_SP_NO_DROP_SP, MYF(0), "PROCEDURE");
+ MYSQL_YYABORT;
+ }
+ bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics));
+ }
+ sp_a_chistics
+ {
+ LEX *lex=Lex;
+
+ lex->sql_command= SQLCOM_ALTER_PROCEDURE;
+ lex->spname= $3;
+ }
+ | ALTER FUNCTION_SYM sp_name
+ {
+ LEX *lex= Lex;
+
+ if (lex->sphead)
+ {
+ my_error(ER_SP_NO_DROP_SP, MYF(0), "FUNCTION");
+ MYSQL_YYABORT;
+ }
+ bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics));
+ }
+ sp_a_chistics
+ {
+ LEX *lex=Lex;
+
+ lex->sql_command= SQLCOM_ALTER_FUNCTION;
+ lex->spname= $3;
+ }
| ALTER view_algorithm definer
{
- Lex->create_view_mode= VIEW_ALTER;
+ LEX *lex= Lex;
+
+ if (lex->sphead)
+ {
+ my_error(ER_SP_BADSTATEMENT, MYF(0), "ALTER VIEW");
+ MYSQL_YYABORT;
+ }
+ lex->create_view_mode= VIEW_ALTER;
}
view_tail
{}
@@ -5180,12 +5469,18 @@ alter:
*/
{
LEX *lex= Lex;
+
+ if (lex->sphead)
+ {
+ my_error(ER_SP_BADSTATEMENT, MYF(0), "ALTER VIEW");
+ MYSQL_YYABORT;
+ }
lex->create_view_algorithm= VIEW_ALGORITHM_UNDEFINED;
lex->create_view_mode= VIEW_ALTER;
}
view_tail
{}
- | ALTER definer EVENT_SYM sp_name
+ | ALTER definer EVENT_SYM sp_name
/*
BE CAREFUL when you add a new rule to update the block where
YYTHD->client_capabilities is set back to original value
@@ -5230,7 +5525,7 @@ alter:
if (!($6 || $7 || $8 || $9 || $10))
{
- my_parse_error(ER(ER_SYNTAX_ERROR));
+ my_parse_error(ER(ER_SYNTAX_ERROR));
MYSQL_YYABORT;
}
/*
@@ -5266,15 +5561,17 @@ alter:
lex->server_options.server_name= $3.str;
lex->server_options.server_name_length= $3.length;
}
- ;
+ ;
-ev_alter_on_schedule_completion: /* empty */ { $$= 0;}
+ev_alter_on_schedule_completion:
+ /* empty */ { $$= 0;}
| ON SCHEDULE_SYM ev_schedule_time { $$= 1; }
| ev_on_completion { $$= 1; }
| ON SCHEDULE_SYM ev_schedule_time ev_on_completion { $$= 1; }
- ;
+ ;
-opt_ev_rename_to: /* empty */ { $$= 0;}
+opt_ev_rename_to:
+ /* empty */ { $$= 0;}
| RENAME TO_SYM sp_name
{
/*
@@ -5284,19 +5581,22 @@ opt_ev_rename_to: /* empty */ { $$= 0;}
Lex->spname= $3;
$$= 1;
}
- ;
+ ;
-opt_ev_sql_stmt: /* empty*/ { $$= 0;}
+opt_ev_sql_stmt:
+ /* empty*/ { $$= 0;}
| DO_SYM ev_sql_stmt { $$= 1; }
;
ident_or_empty:
- /* empty */ { $$.str= 0; $$.length= 0; }
- | ident { $$= $1; };
+ /* empty */ { $$.str= 0; $$.length= 0; }
+ | ident { $$= $1; }
+ ;
alter_commands:
- | DISCARD TABLESPACE { Lex->alter_info.tablespace_op= DISCARD_TABLESPACE; }
- | IMPORT TABLESPACE { Lex->alter_info.tablespace_op= IMPORT_TABLESPACE; }
+ /* empty */
+ | DISCARD TABLESPACE { Lex->alter_info.tablespace_op= DISCARD_TABLESPACE; }
+ | IMPORT TABLESPACE { Lex->alter_info.tablespace_op= IMPORT_TABLESPACE; }
| alter_list
opt_partitioning
| alter_list
@@ -5314,20 +5614,20 @@ alter_commands:
| add_partition_rule
| DROP PARTITION_SYM alt_part_name_list
{
- Lex->alter_info.flags|= ALTER_DROP_PARTITION;
+ Lex->alter_info.flags|= ALTER_DROP_PARTITION;
}
| REBUILD_SYM PARTITION_SYM opt_no_write_to_binlog
all_or_alt_part_name_list
{
LEX *lex= Lex;
- lex->alter_info.flags|= ALTER_REBUILD_PARTITION;
+ lex->alter_info.flags|= ALTER_REBUILD_PARTITION;
lex->no_write_to_binlog= $3;
}
| OPTIMIZE PARTITION_SYM opt_no_write_to_binlog
all_or_alt_part_name_list
{
LEX *lex= Lex;
- lex->alter_info.flags|= ALTER_OPTIMIZE_PARTITION;
+ lex->alter_info.flags|= ALTER_OPTIMIZE_PARTITION;
lex->no_write_to_binlog= $3;
lex->check_opt.init();
}
@@ -5336,7 +5636,7 @@ alter_commands:
all_or_alt_part_name_list
{
LEX *lex= Lex;
- lex->alter_info.flags|= ALTER_ANALYZE_PARTITION;
+ lex->alter_info.flags|= ALTER_ANALYZE_PARTITION;
lex->no_write_to_binlog= $3;
lex->check_opt.init();
}
@@ -5344,7 +5644,7 @@ alter_commands:
| CHECK_SYM PARTITION_SYM all_or_alt_part_name_list
{
LEX *lex= Lex;
- lex->alter_info.flags|= ALTER_CHECK_PARTITION;
+ lex->alter_info.flags|= ALTER_CHECK_PARTITION;
lex->check_opt.init();
}
opt_mi_check_type
@@ -5352,7 +5652,7 @@ alter_commands:
all_or_alt_part_name_list
{
LEX *lex= Lex;
- lex->alter_info.flags|= ALTER_REPAIR_PARTITION;
+ lex->alter_info.flags|= ALTER_REPAIR_PARTITION;
lex->no_write_to_binlog= $3;
lex->check_opt.init();
}
@@ -5360,104 +5660,104 @@ alter_commands:
| COALESCE PARTITION_SYM opt_no_write_to_binlog real_ulong_num
{
LEX *lex= Lex;
- lex->alter_info.flags|= ALTER_COALESCE_PARTITION;
+ lex->alter_info.flags|= ALTER_COALESCE_PARTITION;
lex->no_write_to_binlog= $3;
- lex->alter_info.no_parts= $4;
+ lex->alter_info.no_parts= $4;
}
| reorg_partition_rule
;
remove_partitioning:
- REMOVE_SYM PARTITIONING_SYM
- {
- Lex->alter_info.flags|= ALTER_REMOVE_PARTITIONING;
- }
+ REMOVE_SYM PARTITIONING_SYM
+ {
+ Lex->alter_info.flags|= ALTER_REMOVE_PARTITIONING;
+ }
;
all_or_alt_part_name_list:
- ALL
- {
- Lex->alter_info.flags|= ALTER_ALL_PARTITION;
- }
+ ALL
+ {
+ Lex->alter_info.flags|= ALTER_ALL_PARTITION;
+ }
| alt_part_name_list
;
add_partition_rule:
- ADD PARTITION_SYM opt_no_write_to_binlog
- {
- LEX *lex= Lex;
- lex->part_info= new partition_info();
- if (!lex->part_info)
+ ADD PARTITION_SYM opt_no_write_to_binlog
{
- mem_alloc_error(sizeof(partition_info));
- MYSQL_YYABORT;
+ LEX *lex= Lex;
+ lex->part_info= new partition_info();
+ if (!lex->part_info)
+ {
+ mem_alloc_error(sizeof(partition_info));
+ MYSQL_YYABORT;
+ }
+ lex->alter_info.flags|= ALTER_ADD_PARTITION;
+ lex->no_write_to_binlog= $3;
}
- lex->alter_info.flags|= ALTER_ADD_PARTITION;
- lex->no_write_to_binlog= $3;
- }
- add_part_extra
- {}
+ add_part_extra
+ {}
;
add_part_extra:
+ /* empty */
| '(' part_def_list ')'
- {
- LEX *lex= Lex;
- lex->part_info->no_parts= lex->part_info->partitions.elements;
- }
+ {
+ LEX *lex= Lex;
+ lex->part_info->no_parts= lex->part_info->partitions.elements;
+ }
| PARTITIONS_SYM real_ulong_num
- {
- LEX *lex= Lex;
- lex->part_info->no_parts= $2;
- }
+ {
+ LEX *lex= Lex;
+ lex->part_info->no_parts= $2;
+ }
;
reorg_partition_rule:
- REORGANIZE_SYM PARTITION_SYM opt_no_write_to_binlog
- {
- LEX *lex= Lex;
- lex->part_info= new partition_info();
- if (!lex->part_info)
+ REORGANIZE_SYM PARTITION_SYM opt_no_write_to_binlog
{
+ LEX *lex= Lex;
+ lex->part_info= new partition_info();
+ if (!lex->part_info)
+ {
mem_alloc_error(sizeof(partition_info));
- MYSQL_YYABORT;
+ MYSQL_YYABORT;
+ }
+ lex->no_write_to_binlog= $3;
}
- lex->no_write_to_binlog= $3;
- }
- reorg_parts_rule
+ reorg_parts_rule
;
reorg_parts_rule:
- /* empty */
- {
- Lex->alter_info.flags|= ALTER_TABLE_REORG;
- }
- |
- alt_part_name_list
- {
- Lex->alter_info.flags|= ALTER_REORGANIZE_PARTITION;
- }
- INTO '(' part_def_list ')'
- {
- LEX *lex= Lex;
- lex->part_info->no_parts= lex->part_info->partitions.elements;
- }
+ /* empty */
+ {
+ Lex->alter_info.flags|= ALTER_TABLE_REORG;
+ }
+ | alt_part_name_list
+ {
+ Lex->alter_info.flags|= ALTER_REORGANIZE_PARTITION;
+ }
+ INTO '(' part_def_list ')'
+ {
+ LEX *lex= Lex;
+ lex->part_info->no_parts= lex->part_info->partitions.elements;
+ }
;
alt_part_name_list:
- alt_part_name_item {}
+ alt_part_name_item {}
| alt_part_name_list ',' alt_part_name_item {}
;
alt_part_name_item:
- ident
- {
- if (Lex->alter_info.partition_names.push_back($1.str))
+ ident
{
- mem_alloc_error(1);
- MYSQL_YYABORT;
+ if (Lex->alter_info.partition_names.push_back($1.str))
+ {
+ mem_alloc_error(1);
+ MYSQL_YYABORT;
+ }
}
- }
;
/*
@@ -5465,34 +5765,35 @@ alt_part_name_item:
*/
alter_list:
- alter_list_item
- | alter_list ',' alter_list_item
+ alter_list_item
+ | alter_list ',' alter_list_item
;
add_column:
- ADD opt_column
- {
- LEX *lex=Lex;
- lex->change=0;
- lex->alter_info.flags|= ALTER_ADD_COLUMN;
- };
+ ADD opt_column
+ {
+ LEX *lex=Lex;
+ lex->change=0;
+ lex->alter_info.flags|= ALTER_ADD_COLUMN;
+ }
+ ;
alter_list_item:
- add_column column_def opt_place { }
- | ADD key_def
- {
- Lex->alter_info.flags|= ALTER_ADD_INDEX;
- }
- | add_column '(' field_list ')'
- {
- Lex->alter_info.flags|= ALTER_ADD_COLUMN | ALTER_ADD_INDEX;
- }
- | CHANGE opt_column field_ident
- {
- LEX *lex=Lex;
- lex->change= $3.str;
- lex->alter_info.flags|= ALTER_CHANGE_COLUMN;
- }
+ add_column column_def opt_place { }
+ | ADD key_def
+ {
+ Lex->alter_info.flags|= ALTER_ADD_INDEX;
+ }
+ | add_column '(' field_list ')'
+ {
+ Lex->alter_info.flags|= ALTER_ADD_COLUMN | ALTER_ADD_INDEX;
+ }
+ | CHANGE opt_column field_ident
+ {
+ LEX *lex=Lex;
+ lex->change= $3.str;
+ lex->alter_info.flags|= ALTER_CHANGE_COLUMN;
+ }
field_spec opt_place
| MODIFY_SYM opt_column field_ident
{
@@ -5500,8 +5801,8 @@ alter_list_item:
lex->length=lex->dec=0; lex->type=0;
lex->default_value= lex->on_update_value= 0;
lex->comment=null_lex_str;
- lex->charset= NULL;
- lex->alter_info.flags|= ALTER_CHANGE_COLUMN;
+ lex->charset= NULL;
+ lex->alter_info.flags|= ALTER_CHANGE_COLUMN;
}
type opt_attribute
{
@@ -5511,69 +5812,68 @@ alter_list_item:
lex->length,lex->dec,lex->type,
lex->default_value, lex->on_update_value,
&lex->comment,
- $3.str, &lex->interval_list, lex->charset,
- lex->uint_geom_type))
- MYSQL_YYABORT;
+ $3.str, &lex->interval_list, lex->charset,
+ lex->uint_geom_type))
+ MYSQL_YYABORT;
}
opt_place
- | DROP opt_column field_ident opt_restrict
- {
- LEX *lex=Lex;
- lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::COLUMN,
+ | DROP opt_column field_ident opt_restrict
+ {
+ LEX *lex=Lex;
+ lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::COLUMN,
$3.str));
- lex->alter_info.flags|= ALTER_DROP_COLUMN;
- }
- | DROP FOREIGN KEY_SYM opt_ident
- {
- Lex->alter_info.flags|= ALTER_DROP_INDEX | ALTER_FOREIGN_KEY;
- }
- | DROP PRIMARY_SYM KEY_SYM
- {
- LEX *lex=Lex;
- lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY,
- primary_key_name));
- lex->alter_info.flags|= ALTER_DROP_INDEX;
- }
- | DROP key_or_index field_ident
- {
- LEX *lex=Lex;
- lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY,
- $3.str));
- lex->alter_info.flags|= ALTER_DROP_INDEX;
- }
- | DISABLE_SYM KEYS
- {
- LEX *lex=Lex;
+ lex->alter_info.flags|= ALTER_DROP_COLUMN;
+ }
+ | DROP FOREIGN KEY_SYM opt_ident
+ {
+ Lex->alter_info.flags|= ALTER_DROP_INDEX | ALTER_FOREIGN_KEY;
+ }
+ | DROP PRIMARY_SYM KEY_SYM
+ {
+ LEX *lex=Lex;
+ lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY,
+ primary_key_name));
+ lex->alter_info.flags|= ALTER_DROP_INDEX;
+ }
+ | DROP key_or_index field_ident
+ {
+ LEX *lex=Lex;
+ lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY,
+ $3.str));
+ lex->alter_info.flags|= ALTER_DROP_INDEX;
+ }
+ | DISABLE_SYM KEYS
+ {
+ LEX *lex=Lex;
lex->alter_info.keys_onoff= DISABLE;
- lex->alter_info.flags|= ALTER_KEYS_ONOFF;
+ lex->alter_info.flags|= ALTER_KEYS_ONOFF;
}
- | ENABLE_SYM KEYS
+ | ENABLE_SYM KEYS
{
- LEX *lex=Lex;
+ LEX *lex=Lex;
lex->alter_info.keys_onoff= ENABLE;
- lex->alter_info.flags|= ALTER_KEYS_ONOFF;
- }
- | ALTER opt_column field_ident SET DEFAULT signed_literal
- {
- LEX *lex=Lex;
- lex->alter_info.alter_list.push_back(new Alter_column($3.str,$6));
- lex->alter_info.flags|= ALTER_CHANGE_COLUMN_DEFAULT;
- }
- | ALTER opt_column field_ident DROP DEFAULT
- {
- LEX *lex=Lex;
- lex->alter_info.alter_list.push_back(new Alter_column($3.str,
+ lex->alter_info.flags|= ALTER_KEYS_ONOFF;
+ }
+ | ALTER opt_column field_ident SET DEFAULT signed_literal
+ {
+ LEX *lex=Lex;
+ lex->alter_info.alter_list.push_back(new Alter_column($3.str,$6));
+ lex->alter_info.flags|= ALTER_CHANGE_COLUMN_DEFAULT;
+ }
+ | ALTER opt_column field_ident DROP DEFAULT
+ {
+ LEX *lex=Lex;
+ lex->alter_info.alter_list.push_back(new Alter_column($3.str,
(Item*) 0));
- lex->alter_info.flags|= ALTER_CHANGE_COLUMN_DEFAULT;
- }
- | RENAME opt_to table_ident
- {
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- uint dummy;
- lex->select_lex.db=$3->db.str;
+ lex->alter_info.flags|= ALTER_CHANGE_COLUMN_DEFAULT;
+ }
+ | RENAME opt_to table_ident
+ {
+ LEX *lex=Lex;
+ size_t dummy;
+ lex->select_lex.db=$3->db.str;
if (lex->select_lex.db == NULL &&
- thd->copy_db_to(&lex->select_lex.db, &dummy))
+ lex->copy_db_to(&lex->select_lex.db, &dummy))
{
MYSQL_YYABORT;
}
@@ -5583,150 +5883,153 @@ alter_list_item:
my_error(ER_WRONG_TABLE_NAME, MYF(0), $3->table.str);
MYSQL_YYABORT;
}
- lex->name= $3->table;
- lex->alter_info.flags|= ALTER_RENAME;
- }
- | CONVERT_SYM TO_SYM charset charset_name_or_default opt_collate
- {
- if (!$4)
- {
- THD *thd= YYTHD;
- $4= thd->variables.collation_database;
- }
- $5= $5 ? $5 : $4;
- if (!my_charset_same($4,$5))
- {
- my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
+ lex->name= $3->table;
+ lex->alter_info.flags|= ALTER_RENAME;
+ }
+ | CONVERT_SYM TO_SYM charset charset_name_or_default opt_collate
+ {
+ if (!$4)
+ {
+ THD *thd= YYTHD;
+ $4= thd->variables.collation_database;
+ }
+ $5= $5 ? $5 : $4;
+ if (!my_charset_same($4,$5))
+ {
+ my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
$5->name, $4->csname);
- MYSQL_YYABORT;
- }
- LEX *lex= Lex;
- lex->create_info.table_charset=
- lex->create_info.default_table_charset= $5;
- lex->create_info.used_fields|= (HA_CREATE_USED_CHARSET |
- HA_CREATE_USED_DEFAULT_CHARSET);
- lex->alter_info.flags|= ALTER_CONVERT;
- }
+ MYSQL_YYABORT;
+ }
+ LEX *lex= Lex;
+ lex->create_info.table_charset=
+ lex->create_info.default_table_charset= $5;
+ lex->create_info.used_fields|= (HA_CREATE_USED_CHARSET |
+ HA_CREATE_USED_DEFAULT_CHARSET);
+ lex->alter_info.flags|= ALTER_CONVERT;
+ }
| create_table_options_space_separated
- {
- LEX *lex=Lex;
- lex->alter_info.flags|= ALTER_OPTIONS;
- }
- | FORCE_SYM
- {
- Lex->alter_info.flags|= ALTER_FORCE;
- }
- | alter_order_clause
- {
- LEX *lex=Lex;
- lex->alter_info.flags|= ALTER_ORDER;
- };
+ {
+ LEX *lex=Lex;
+ lex->alter_info.flags|= ALTER_OPTIONS;
+ }
+ | FORCE_SYM
+ {
+ Lex->alter_info.flags|= ALTER_FORCE;
+ }
+ | alter_order_clause
+ {
+ LEX *lex=Lex;
+ lex->alter_info.flags|= ALTER_ORDER;
+ }
+ ;
opt_column:
- /* empty */ {}
- | COLUMN_SYM {};
+ /* empty */ {}
+ | COLUMN_SYM {}
+ ;
opt_ignore:
- /* empty */ { Lex->ignore= 0;}
- | IGNORE_SYM { Lex->ignore= 1;}
- ;
+ /* empty */ { Lex->ignore= 0;}
+ | IGNORE_SYM { Lex->ignore= 1;}
+ ;
opt_restrict:
- /* empty */ { Lex->drop_mode= DROP_DEFAULT; }
- | RESTRICT { Lex->drop_mode= DROP_RESTRICT; }
- | CASCADE { Lex->drop_mode= DROP_CASCADE; }
- ;
+ /* empty */ { Lex->drop_mode= DROP_DEFAULT; }
+ | RESTRICT { Lex->drop_mode= DROP_RESTRICT; }
+ | CASCADE { Lex->drop_mode= DROP_CASCADE; }
+ ;
opt_place:
- /* empty */ {}
- | AFTER_SYM ident { store_position_for_column($2.str); }
- | FIRST_SYM { store_position_for_column(first_keyword); };
+ /* empty */ {}
+ | AFTER_SYM ident { store_position_for_column($2.str); }
+ | FIRST_SYM { store_position_for_column(first_keyword); }
+ ;
opt_to:
- /* empty */ {}
- | TO_SYM {}
- | EQ {}
- | AS {};
+ /* empty */ {}
+ | TO_SYM {}
+ | EQ {}
+ | AS {}
+ ;
/*
SLAVE START and SLAVE STOP are deprecated. We keep them for compatibility.
*/
slave:
- START_SYM SLAVE slave_thread_opts
+ START_SYM SLAVE slave_thread_opts
{
- LEX *lex=Lex;
+ LEX *lex=Lex;
lex->sql_command = SQLCOM_SLAVE_START;
- lex->type = 0;
- /* We'll use mi structure for UNTIL options */
- bzero((char*) &lex->mi, sizeof(lex->mi));
+ lex->type = 0;
+ /* We'll use mi structure for UNTIL options */
+ bzero((char*) &lex->mi, sizeof(lex->mi));
/* If you change this code don't forget to update SLAVE START too */
}
slave_until
{}
| STOP_SYM SLAVE slave_thread_opts
{
- LEX *lex=Lex;
+ LEX *lex=Lex;
lex->sql_command = SQLCOM_SLAVE_STOP;
- lex->type = 0;
+ lex->type = 0;
/* If you change this code don't forget to update SLAVE STOP too */
}
- | SLAVE START_SYM slave_thread_opts
- {
- LEX *lex=Lex;
- lex->sql_command = SQLCOM_SLAVE_START;
- lex->type = 0;
- /* We'll use mi structure for UNTIL options */
- bzero((char*) &lex->mi, sizeof(lex->mi));
+ | SLAVE START_SYM slave_thread_opts
+ {
+ LEX *lex=Lex;
+ lex->sql_command = SQLCOM_SLAVE_START;
+ lex->type = 0;
+ /* We'll use mi structure for UNTIL options */
+ bzero((char*) &lex->mi, sizeof(lex->mi));
}
slave_until
{}
- | SLAVE STOP_SYM slave_thread_opts
- {
- LEX *lex=Lex;
- lex->sql_command = SQLCOM_SLAVE_STOP;
- lex->type = 0;
- }
+ | SLAVE STOP_SYM slave_thread_opts
+ {
+ LEX *lex=Lex;
+ lex->sql_command = SQLCOM_SLAVE_STOP;
+ lex->type = 0;
+ }
;
-
start:
- START_SYM TRANSACTION_SYM start_transaction_opts
- {
- LEX *lex= Lex;
- lex->sql_command= SQLCOM_BEGIN;
- lex->start_transaction_opt= $3;
- }
- ;
+ START_SYM TRANSACTION_SYM start_transaction_opts
+ {
+ LEX *lex= Lex;
+ lex->sql_command= SQLCOM_BEGIN;
+ lex->start_transaction_opt= $3;
+ }
+ ;
start_transaction_opts:
- /*empty*/ { $$ = 0; }
+ /*empty*/ { $$ = 0; }
| WITH CONSISTENT_SYM SNAPSHOT_SYM
- {
- $$= MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT;
- }
+ {
+ $$= MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT;
+ }
;
slave_thread_opts:
- { Lex->slave_thd_opt= 0; }
- slave_thread_opt_list
- {}
- ;
+ { Lex->slave_thd_opt= 0; }
+ slave_thread_opt_list
+ {}
+ ;
slave_thread_opt_list:
- slave_thread_opt
- | slave_thread_opt_list ',' slave_thread_opt
- ;
+ slave_thread_opt
+ | slave_thread_opt_list ',' slave_thread_opt
+ ;
slave_thread_opt:
- /*empty*/ {}
- | SQL_THREAD { Lex->slave_thd_opt|=SLAVE_SQL; }
- | RELAY_THREAD { Lex->slave_thd_opt|=SLAVE_IO; }
- ;
+ /*empty*/ {}
+ | SQL_THREAD { Lex->slave_thd_opt|=SLAVE_SQL; }
+ | RELAY_THREAD { Lex->slave_thd_opt|=SLAVE_IO; }
+ ;
slave_until:
- /*empty*/ {}
- | UNTIL_SYM slave_until_opts
+ /*empty*/ {}
+ | UNTIL_SYM slave_until_opts
{
LEX *lex=Lex;
if ((lex->mi.log_file_name || lex->mi.pos) &&
@@ -5738,177 +6041,180 @@ slave_until:
ER(ER_BAD_SLAVE_UNTIL_COND), MYF(0));
MYSQL_YYABORT;
}
-
}
- ;
+ ;
slave_until_opts:
- master_file_def
- | slave_until_opts ',' master_file_def ;
-
+ master_file_def
+ | slave_until_opts ',' master_file_def
+ ;
restore:
- RESTORE_SYM table_or_tables
- {
- Lex->sql_command = SQLCOM_RESTORE_TABLE;
- WARN_DEPRECATED(yythd, "5.2", "RESTORE TABLE",
- "MySQL Administrator (mysqldump, mysql)");
- }
- table_list FROM TEXT_STRING_sys
- {
- Lex->backup_dir = $6.str;
- };
+ RESTORE_SYM table_or_tables
+ {
+ Lex->sql_command = SQLCOM_RESTORE_TABLE;
+ }
+ table_list FROM TEXT_STRING_sys
+ {
+ Lex->backup_dir = $6.str;
+ }
+ ;
backup:
- BACKUP_SYM table_or_tables
- {
- Lex->sql_command = SQLCOM_BACKUP_TABLE;
- WARN_DEPRECATED(yythd, "5.2", "BACKUP TABLE",
- "MySQL Administrator (mysqldump, mysql)");
- }
- table_list TO_SYM TEXT_STRING_sys
- {
- Lex->backup_dir = $6.str;
- };
+ BACKUP_SYM table_or_tables
+ {
+ Lex->sql_command = SQLCOM_BACKUP_TABLE;
+ }
+ table_list TO_SYM TEXT_STRING_sys
+ {
+ Lex->backup_dir = $6.str;
+ }
+ ;
checksum:
- CHECKSUM_SYM table_or_tables
- {
- LEX *lex=Lex;
- lex->sql_command = SQLCOM_CHECKSUM;
- }
- table_list opt_checksum_type
- {}
- ;
+ CHECKSUM_SYM table_or_tables
+ {
+ LEX *lex=Lex;
+ lex->sql_command = SQLCOM_CHECKSUM;
+ }
+ table_list opt_checksum_type
+ {}
+ ;
opt_checksum_type:
- /* nothing */ { Lex->check_opt.flags= 0; }
- | QUICK { Lex->check_opt.flags= T_QUICK; }
- | EXTENDED_SYM { Lex->check_opt.flags= T_EXTEND; }
+ /* nothing */ { Lex->check_opt.flags= 0; }
+ | QUICK { Lex->check_opt.flags= T_QUICK; }
+ | EXTENDED_SYM { Lex->check_opt.flags= T_EXTEND; }
;
repair:
- REPAIR opt_no_write_to_binlog table_or_tables
- {
- LEX *lex=Lex;
- lex->sql_command = SQLCOM_REPAIR;
- lex->no_write_to_binlog= $2;
- lex->check_opt.init();
- }
- table_list opt_mi_repair_type
- {}
- ;
+ REPAIR opt_no_write_to_binlog table_or_tables
+ {
+ LEX *lex=Lex;
+ lex->sql_command = SQLCOM_REPAIR;
+ lex->no_write_to_binlog= $2;
+ lex->check_opt.init();
+ }
+ table_list opt_mi_repair_type
+ {}
+ ;
opt_mi_repair_type:
- /* empty */ { Lex->check_opt.flags = T_MEDIUM; }
- | mi_repair_types {};
+ /* empty */ { Lex->check_opt.flags = T_MEDIUM; }
+ | mi_repair_types {}
+ ;
mi_repair_types:
- mi_repair_type {}
- | mi_repair_type mi_repair_types {};
+ mi_repair_type {}
+ | mi_repair_type mi_repair_types {}
+ ;
mi_repair_type:
- QUICK { Lex->check_opt.flags|= T_QUICK; }
- | EXTENDED_SYM { Lex->check_opt.flags|= T_EXTEND; }
- | USE_FRM { Lex->check_opt.sql_flags|= TT_USEFRM; };
+ QUICK { Lex->check_opt.flags|= T_QUICK; }
+ | EXTENDED_SYM { Lex->check_opt.flags|= T_EXTEND; }
+ | USE_FRM { Lex->check_opt.sql_flags|= TT_USEFRM; }
+ ;
analyze:
- ANALYZE_SYM opt_no_write_to_binlog table_or_tables
- {
- LEX *lex=Lex;
- lex->sql_command = SQLCOM_ANALYZE;
- lex->no_write_to_binlog= $2;
- lex->check_opt.init();
- }
- table_list opt_mi_check_type
- {}
- ;
+ ANALYZE_SYM opt_no_write_to_binlog table_or_tables
+ {
+ LEX *lex=Lex;
+ lex->sql_command = SQLCOM_ANALYZE;
+ lex->no_write_to_binlog= $2;
+ lex->check_opt.init();
+ }
+ table_list opt_mi_check_type
+ {}
+ ;
binlog_base64_event:
- BINLOG_SYM TEXT_STRING_sys
- {
- Lex->sql_command = SQLCOM_BINLOG_BASE64_EVENT;
- Lex->comment= $2;
- }
+ BINLOG_SYM TEXT_STRING_sys
+ {
+ Lex->sql_command = SQLCOM_BINLOG_BASE64_EVENT;
+ Lex->comment= $2;
+ }
;
check:
- CHECK_SYM table_or_tables
- {
- LEX *lex=Lex;
+ CHECK_SYM table_or_tables
+ {
+ LEX *lex=Lex;
- if (lex->sphead)
- {
- my_error(ER_SP_BADSTATEMENT, MYF(0), "CHECK");
- MYSQL_YYABORT;
- }
- lex->sql_command = SQLCOM_CHECK;
- lex->check_opt.init();
- }
- table_list opt_mi_check_type
- {}
- ;
+ if (lex->sphead)
+ {
+ my_error(ER_SP_BADSTATEMENT, MYF(0), "CHECK");
+ MYSQL_YYABORT;
+ }
+ lex->sql_command = SQLCOM_CHECK;
+ lex->check_opt.init();
+ }
+ table_list opt_mi_check_type
+ {}
+ ;
opt_mi_check_type:
- /* empty */ { Lex->check_opt.flags = T_MEDIUM; }
- | mi_check_types {};
+ /* empty */ { Lex->check_opt.flags = T_MEDIUM; }
+ | mi_check_types {}
+ ;
mi_check_types:
- mi_check_type {}
- | mi_check_type mi_check_types {};
+ mi_check_type {}
+ | mi_check_type mi_check_types {}
+ ;
mi_check_type:
- QUICK { Lex->check_opt.flags|= T_QUICK; }
- | FAST_SYM { Lex->check_opt.flags|= T_FAST; }
- | MEDIUM_SYM { Lex->check_opt.flags|= T_MEDIUM; }
- | EXTENDED_SYM { Lex->check_opt.flags|= T_EXTEND; }
- | CHANGED { Lex->check_opt.flags|= T_CHECK_ONLY_CHANGED; }
- | FOR_SYM UPGRADE_SYM { Lex->check_opt.sql_flags|= TT_FOR_UPGRADE; };
+ QUICK { Lex->check_opt.flags|= T_QUICK; }
+ | FAST_SYM { Lex->check_opt.flags|= T_FAST; }
+ | MEDIUM_SYM { Lex->check_opt.flags|= T_MEDIUM; }
+ | EXTENDED_SYM { Lex->check_opt.flags|= T_EXTEND; }
+ | CHANGED { Lex->check_opt.flags|= T_CHECK_ONLY_CHANGED; }
+ | FOR_SYM UPGRADE_SYM { Lex->check_opt.sql_flags|= TT_FOR_UPGRADE; }
+ ;
optimize:
- OPTIMIZE opt_no_write_to_binlog table_or_tables
- {
- LEX *lex=Lex;
- lex->sql_command = SQLCOM_OPTIMIZE;
- lex->no_write_to_binlog= $2;
- lex->check_opt.init();
- }
- table_list opt_mi_check_type
- {}
- ;
+ OPTIMIZE opt_no_write_to_binlog table_or_tables
+ {
+ LEX *lex=Lex;
+ lex->sql_command = SQLCOM_OPTIMIZE;
+ lex->no_write_to_binlog= $2;
+ lex->check_opt.init();
+ }
+ table_list opt_mi_check_type
+ {}
+ ;
opt_no_write_to_binlog:
- /* empty */ { $$= 0; }
- | NO_WRITE_TO_BINLOG { $$= 1; }
- | LOCAL_SYM { $$= 1; }
- ;
+ /* empty */ { $$= 0; }
+ | NO_WRITE_TO_BINLOG { $$= 1; }
+ | LOCAL_SYM { $$= 1; }
+ ;
rename:
- RENAME table_or_tables
- {
- Lex->sql_command= SQLCOM_RENAME_TABLE;
- }
- table_to_table_list
- {}
- | RENAME DATABASE
+ RENAME table_or_tables
+ {
+ Lex->sql_command= SQLCOM_RENAME_TABLE;
+ }
+ table_to_table_list
+ {}
+ | RENAME DATABASE
{
Lex->db_list.empty();
Lex->sql_command= SQLCOM_RENAME_DB;
}
db_to_db
{}
- | RENAME USER clear_privileges rename_list
+ | RENAME USER clear_privileges rename_list
{
- Lex->sql_command = SQLCOM_RENAME_USER;
+ Lex->sql_command = SQLCOM_RENAME_USER;
}
- ;
+ ;
rename_list:
- user TO_SYM user
- {
- if (Lex->users_list.push_back($1) || Lex->users_list.push_back($3))
- MYSQL_YYABORT;
- }
+ user TO_SYM user
+ {
+ if (Lex->users_list.push_back($1) || Lex->users_list.push_back($3))
+ MYSQL_YYABORT;
+ }
| rename_list ',' user TO_SYM user
{
if (Lex->users_list.push_back($3) || Lex->users_list.push_back($5))
@@ -5917,103 +6223,108 @@ rename_list:
;
table_to_table_list:
- table_to_table
- | table_to_table_list ',' table_to_table;
+ table_to_table
+ | table_to_table_list ',' table_to_table
+ ;
table_to_table:
- table_ident TO_SYM table_ident
- {
- LEX *lex=Lex;
- SELECT_LEX *sl= lex->current_select;
- if (!sl->add_table_to_list(lex->thd, $1,NULL,TL_OPTION_UPDATING,
- TL_IGNORE) ||
- !sl->add_table_to_list(lex->thd, $3,NULL,TL_OPTION_UPDATING,
- TL_IGNORE))
- MYSQL_YYABORT;
- };
+ table_ident TO_SYM table_ident
+ {
+ LEX *lex=Lex;
+ SELECT_LEX *sl= lex->current_select;
+ if (!sl->add_table_to_list(lex->thd, $1,NULL,TL_OPTION_UPDATING,
+ TL_IGNORE) ||
+ !sl->add_table_to_list(lex->thd, $3,NULL,TL_OPTION_UPDATING,
+ TL_IGNORE))
+ MYSQL_YYABORT;
+ }
+ ;
db_to_db:
- ident TO_SYM ident
- {
- LEX *lex=Lex;
- if (lex->db_list.push_back((LEX_STRING*)
- sql_memdup(&$1, sizeof(LEX_STRING))) ||
- lex->db_list.push_back((LEX_STRING*)
- sql_memdup(&$3, sizeof(LEX_STRING))))
+ ident TO_SYM ident
+ {
+ LEX *lex=Lex;
+ if (lex->db_list.push_back((LEX_STRING*)
+ sql_memdup(&$1, sizeof(LEX_STRING))) ||
+ lex->db_list.push_back((LEX_STRING*)
+ sql_memdup(&$3, sizeof(LEX_STRING))))
MYSQL_YYABORT;
- };
+ }
+ ;
keycache:
- CACHE_SYM INDEX_SYM keycache_list IN_SYM key_cache_name
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_ASSIGN_TO_KEYCACHE;
- lex->ident= $5;
- }
+ CACHE_SYM INDEX_SYM keycache_list IN_SYM key_cache_name
+ {
+ LEX *lex=Lex;
+ lex->sql_command= SQLCOM_ASSIGN_TO_KEYCACHE;
+ lex->ident= $5;
+ }
;
keycache_list:
- assign_to_keycache
- | keycache_list ',' assign_to_keycache;
+ assign_to_keycache
+ | keycache_list ',' assign_to_keycache
+ ;
assign_to_keycache:
- table_ident cache_keys_spec
- {
- if (!Select->add_table_to_list(YYTHD, $1, NULL, 0, TL_READ,
- Select->pop_index_hints()))
- MYSQL_YYABORT;
- }
+ table_ident 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; }
- ;
+ ident { $$= $1; }
+ | DEFAULT { $$ = default_key_cache_base; }
+ ;
preload:
- LOAD INDEX_SYM INTO CACHE_SYM
- {
- LEX *lex=Lex;
- lex->sql_command=SQLCOM_PRELOAD_KEYS;
- }
- preload_list
- {}
- ;
+ LOAD INDEX_SYM INTO CACHE_SYM
+ {
+ LEX *lex=Lex;
+ lex->sql_command=SQLCOM_PRELOAD_KEYS;
+ }
+ preload_list
+ {}
+ ;
preload_list:
- preload_keys
- | preload_list ',' preload_keys;
+ preload_keys
+ | preload_list ',' preload_keys
+ ;
preload_keys:
- table_ident cache_keys_spec opt_ignore_leaves
- {
- if (!Select->add_table_to_list(YYTHD, $1, NULL, $3, TL_READ,
- Select->pop_index_hints()))
- MYSQL_YYABORT;
- }
- ;
+ table_ident cache_keys_spec opt_ignore_leaves
+ {
+ if (!Select->add_table_to_list(YYTHD, $1, NULL, $3, TL_READ,
+ Select->pop_index_hints()))
+ MYSQL_YYABORT;
+ }
+ ;
cache_keys_spec:
- {
- Lex->select_lex.alloc_index_hints(YYTHD);
- Select->set_index_hint_type(INDEX_HINT_USE,
- global_system_variables.old_mode ?
+ {
+ Lex->select_lex.alloc_index_hints(YYTHD);
+ Select->set_index_hint_type(INDEX_HINT_USE,
+ global_system_variables.old_mode ?
INDEX_HINT_MASK_JOIN :
INDEX_HINT_MASK_ALL);
- }
- cache_key_list_or_empty
+ }
+ cache_key_list_or_empty
;
cache_key_list_or_empty:
- /* empty */ { }
- | key_or_index '(' opt_key_usage_list ')'
- ;
+ /* empty */ { }
+ | key_or_index '(' opt_key_usage_list ')'
+ ;
opt_ignore_leaves:
- /* empty */
- { $$= 0; }
- | IGNORE_SYM LEAVES { $$= TL_OPTION_IGNORE_LEAVES; }
- ;
+ /* empty */
+ { $$= 0; }
+ | IGNORE_SYM LEAVES { $$= TL_OPTION_IGNORE_LEAVES; }
+ ;
/*
Select : retrieve data from table
@@ -6021,29 +6332,29 @@ opt_ignore_leaves:
select:
- select_init
- {
- LEX *lex= Lex;
- lex->sql_command= SQLCOM_SELECT;
- }
- ;
+ select_init
+ {
+ LEX *lex= Lex;
+ lex->sql_command= SQLCOM_SELECT;
+ }
+ ;
/* Need select_init2 for subselects. */
select_init:
- SELECT_SYM select_init2
- |
- '(' select_paren ')' union_opt;
+ SELECT_SYM select_init2
+ | '(' select_paren ')' union_opt
+ ;
select_paren:
- SELECT_SYM select_part2
- {
- LEX *lex= Lex;
+ SELECT_SYM select_part2
+ {
+ LEX *lex= Lex;
SELECT_LEX * sel= lex->current_select;
- if (sel->set_braces(1))
- {
+ if (sel->set_braces(1))
+ {
my_parse_error(ER(ER_SYNTAX_ERROR));
- MYSQL_YYABORT;
- }
+ MYSQL_YYABORT;
+ }
if (sel->linkage == UNION_TYPE &&
!sel->master_unit()->first_select()->braces &&
sel->master_unit()->first_select()->linkage ==
@@ -6053,56 +6364,59 @@ select_paren:
MYSQL_YYABORT;
}
/* select in braces, can't contain global parameters */
- if (sel->master_unit()->fake_select_lex)
+ if (sel->master_unit()->fake_select_lex)
sel->master_unit()->global_parameters=
sel->master_unit()->fake_select_lex;
}
- | '(' select_paren ')';
+ | '(' select_paren ')'
+ ;
select_init2:
- select_part2
- {
- LEX *lex= Lex;
- SELECT_LEX * sel= lex->current_select;
- if (lex->current_select->set_braces(0))
- {
- my_parse_error(ER(ER_SYNTAX_ERROR));
- MYSQL_YYABORT;
- }
- if (sel->linkage == UNION_TYPE &&
- sel->master_unit()->first_select()->braces)
- {
- my_parse_error(ER(ER_SYNTAX_ERROR));
- MYSQL_YYABORT;
- }
- }
- union_clause
- ;
+ select_part2
+ {
+ LEX *lex= Lex;
+ SELECT_LEX * sel= lex->current_select;
+ if (lex->current_select->set_braces(0))
+ {
+ my_parse_error(ER(ER_SYNTAX_ERROR));
+ MYSQL_YYABORT;
+ }
+ if (sel->linkage == UNION_TYPE &&
+ sel->master_unit()->first_select()->braces)
+ {
+ my_parse_error(ER(ER_SYNTAX_ERROR));
+ MYSQL_YYABORT;
+ }
+ }
+ union_clause
+ ;
select_part2:
- {
- LEX *lex= Lex;
- SELECT_LEX *sel= lex->current_select;
- if (sel->linkage != UNION_TYPE)
- mysql_init_select(lex);
- lex->current_select->parsing_place= SELECT_LIST;
- }
- select_options select_item_list
- {
- Select->parsing_place= NO_MATTER;
- }
- select_into select_lock_type;
+ {
+ LEX *lex= Lex;
+ SELECT_LEX *sel= lex->current_select;
+ if (sel->linkage != UNION_TYPE)
+ mysql_init_select(lex);
+ lex->current_select->parsing_place= SELECT_LIST;
+ }
+ select_options select_item_list
+ {
+ Select->parsing_place= NO_MATTER;
+ }
+ select_into select_lock_type
+ ;
select_into:
- opt_order_clause opt_limit_clause {}
+ opt_order_clause opt_limit_clause {}
| into
- | select_from
- | into select_from
- | select_from into;
+ | select_from
+ | into select_from
+ | select_from into
+ ;
select_from:
- FROM join_table_list where_clause group_clause having_clause
- opt_order_clause opt_limit_clause procedure_clause
+ FROM join_table_list where_clause group_clause having_clause
+ opt_order_clause opt_limit_clause procedure_clause
{
Select->context.table_list=
Select->context.first_name_resolution_table=
@@ -6113,215 +6427,284 @@ select_from:
and DUAL is system table without fields.
Is "SELECT 1 FROM DUAL" any better than "SELECT 1" ?
Hmmm :) */
- ;
+ ;
select_options:
- /* empty*/
- | select_option_list
- {
- if (Select->options & SELECT_DISTINCT && Select->options & SELECT_ALL)
- {
- my_error(ER_WRONG_USAGE, MYF(0), "ALL", "DISTINCT");
+ /* empty*/
+ | select_option_list
+ {
+ if (Select->options & SELECT_DISTINCT && Select->options & SELECT_ALL)
+ {
+ my_error(ER_WRONG_USAGE, MYF(0), "ALL", "DISTINCT");
MYSQL_YYABORT;
- }
+ }
}
- ;
+ ;
select_option_list:
- select_option_list select_option
- | select_option;
+ select_option_list select_option
+ | select_option
+ ;
select_option:
- STRAIGHT_JOIN { Select->options|= SELECT_STRAIGHT_JOIN; }
- | HIGH_PRIORITY
- {
- if (check_simple_select())
- MYSQL_YYABORT;
- Lex->lock_option= TL_READ_HIGH_PRIORITY;
- }
- | DISTINCT { Select->options|= SELECT_DISTINCT; }
- | SQL_SMALL_RESULT { Select->options|= SELECT_SMALL_RESULT; }
- | SQL_BIG_RESULT { Select->options|= SELECT_BIG_RESULT; }
- | SQL_BUFFER_RESULT
- {
- if (check_simple_select())
- MYSQL_YYABORT;
- Select->options|= OPTION_BUFFER_RESULT;
- }
- | SQL_CALC_FOUND_ROWS
- {
- if (check_simple_select())
- MYSQL_YYABORT;
- Select->options|= OPTION_FOUND_ROWS;
- }
- | SQL_NO_CACHE_SYM
+ STRAIGHT_JOIN { Select->options|= SELECT_STRAIGHT_JOIN; }
+ | HIGH_PRIORITY
+ {
+ if (check_simple_select())
+ MYSQL_YYABORT;
+ Lex->lock_option= TL_READ_HIGH_PRIORITY;
+ }
+ | DISTINCT { Select->options|= SELECT_DISTINCT; }
+ | SQL_SMALL_RESULT { Select->options|= SELECT_SMALL_RESULT; }
+ | SQL_BIG_RESULT { Select->options|= SELECT_BIG_RESULT; }
+ | SQL_BUFFER_RESULT
+ {
+ if (check_simple_select())
+ MYSQL_YYABORT;
+ Select->options|= OPTION_BUFFER_RESULT;
+ }
+ | SQL_CALC_FOUND_ROWS
+ {
+ if (check_simple_select())
+ MYSQL_YYABORT;
+ Select->options|= OPTION_FOUND_ROWS;
+ }
+ | SQL_NO_CACHE_SYM
{
Lex->safe_to_cache_query=0;
- Lex->select_lex.options&= ~OPTION_TO_QUERY_CACHE;
+ Lex->select_lex.options&= ~OPTION_TO_QUERY_CACHE;
Lex->select_lex.sql_cache= SELECT_LEX::SQL_NO_CACHE;
}
- | SQL_CACHE_SYM
- {
- /* Honor this flag only if SQL_NO_CACHE wasn't specified. */
- if (Lex->select_lex.sql_cache != SELECT_LEX::SQL_NO_CACHE)
+ | SQL_CACHE_SYM
+ {
+ /*
+ Honor this flag only if SQL_NO_CACHE wasn't specified AND
+ we are parsing the outermost SELECT in the query.
+ */
+ if (Lex->select_lex.sql_cache != SELECT_LEX::SQL_NO_CACHE &&
+ Lex->current_select == &Lex->select_lex)
{
Lex->safe_to_cache_query=1;
- Lex->select_lex.options|= OPTION_TO_QUERY_CACHE;
+ Lex->select_lex.options|= OPTION_TO_QUERY_CACHE;
Lex->select_lex.sql_cache= SELECT_LEX::SQL_CACHE;
}
- }
- | ALL { Select->options|= SELECT_ALL; }
- ;
+ }
+ | ALL { Select->options|= SELECT_ALL; }
+ ;
select_lock_type:
- /* empty */
- | FOR_SYM UPDATE_SYM
- {
- LEX *lex=Lex;
- lex->current_select->set_lock_for_tables(TL_WRITE);
- lex->safe_to_cache_query=0;
- }
- | LOCK_SYM IN_SYM SHARE_SYM MODE_SYM
- {
- LEX *lex=Lex;
- lex->current_select->
- set_lock_for_tables(TL_READ_WITH_SHARED_LOCKS);
- lex->safe_to_cache_query=0;
- }
- ;
+ /* empty */
+ | FOR_SYM UPDATE_SYM
+ {
+ LEX *lex=Lex;
+ lex->current_select->set_lock_for_tables(TL_WRITE);
+ lex->safe_to_cache_query=0;
+ }
+ | LOCK_SYM IN_SYM SHARE_SYM MODE_SYM
+ {
+ LEX *lex=Lex;
+ lex->current_select->
+ set_lock_for_tables(TL_READ_WITH_SHARED_LOCKS);
+ lex->safe_to_cache_query=0;
+ }
+ ;
select_item_list:
- select_item_list ',' select_item
- | select_item
- | '*'
- {
- THD *thd= YYTHD;
- if (add_item_to_list(thd,
+ select_item_list ',' select_item
+ | select_item
+ | '*'
+ {
+ THD *thd= YYTHD;
+ if (add_item_to_list(thd,
new Item_field(&thd->lex->current_select->
context,
NULL, NULL, "*")))
- MYSQL_YYABORT;
- (thd->lex->current_select->with_wild)++;
- };
-
+ MYSQL_YYABORT;
+ (thd->lex->current_select->with_wild)++;
+ }
+ ;
select_item:
- remember_name select_item2 remember_end select_alias
- {
- if (add_item_to_list(YYTHD, $2))
- MYSQL_YYABORT;
- if ($4.str)
+ remember_name select_item2 remember_end select_alias
+ {
+ THD *thd= YYTHD;
+ DBUG_ASSERT($1 < $3);
+
+ if (add_item_to_list(thd, $2))
+ MYSQL_YYABORT;
+ if ($4.str)
{
$2->is_autogenerated_name= FALSE;
- $2->set_name($4.str, $4.length, system_charset_info);
+ $2->set_name($4.str, $4.length, system_charset_info);
+ }
+ else if (!$2->name)
+ {
+ $2->set_name($1, (uint) ($3 - $1), thd->charset());
}
- else if (!$2->name) {
- char *str = $1;
- if (str[-1] == '`')
- str--;
- $2->set_name(str,(uint) ($3 - str), YYTHD->charset());
- }
- };
+ }
+ ;
remember_name:
- { $$=(char*) Lex->tok_start; };
+ {
+ THD *thd= YYTHD;
+ Lex_input_stream *lip= thd->m_lip;
+ $$= (char*) lip->get_cpp_tok_start();
+ }
+ ;
remember_end:
- { $$=(char*) Lex->tok_end; };
+ {
+ THD *thd= YYTHD;
+ Lex_input_stream *lip= thd->m_lip;
+ $$= (char*) lip->get_cpp_tok_end();
+ }
+ ;
select_item2:
- table_wild { $$=$1; } /* table.* */
- | expr { $$=$1; };
+ table_wild { $$=$1; /* table.* */ }
+ | expr { $$=$1; }
+ ;
select_alias:
- /* empty */ { $$=null_lex_str;}
- | AS ident { $$=$2; }
- | AS TEXT_STRING_sys { $$=$2; }
- | ident { $$=$1; }
- | TEXT_STRING_sys { $$=$1; }
- ;
+ /* empty */ { $$=null_lex_str;}
+ | AS ident { $$=$2; }
+ | AS TEXT_STRING_sys { $$=$2; }
+ | ident { $$=$1; }
+ | TEXT_STRING_sys { $$=$1; }
+ ;
optional_braces:
- /* empty */ {}
- | '(' ')' {};
+ /* empty */ {}
+ | '(' ')' {}
+ ;
/* all possible expressions */
-expr:
- bool_term { Select->expr_list.push_front(new List<Item>); }
- bool_or_expr
+expr:
+ expr or expr %prec OR_SYM
{
- List<Item> *list= Select->expr_list.pop();
- if (list->elements)
+ /*
+ Design notes:
+ Do not use a manually maintained stack like thd->lex->xxx_list,
+ but use the internal bison stack ($$, $1 and $3) instead.
+ Using the bison stack is:
+ - more robust to changes in the grammar,
+ - guaranteed to be in sync with the parser state,
+ - better for performances (no memory allocation).
+ */
+ Item_cond_or *item1;
+ Item_cond_or *item3;
+ if (is_cond_or($1))
{
- list->push_front($1);
- $$= new Item_cond_or(*list);
- /* optimize construction of logical OR to reduce
- amount of objects for complex expressions */
+ item1= (Item_cond_or*) $1;
+ if (is_cond_or($3))
+ {
+ item3= (Item_cond_or*) $3;
+ /*
+ (X1 OR X2) OR (Y1 OR Y2) ==> OR (X1, X2, Y1, Y2)
+ */
+ item3->add_at_head(item1->argument_list());
+ $$ = $3;
+ }
+ else
+ {
+ /*
+ (X1 OR X2) OR Y ==> OR (X1, X2, Y)
+ */
+ item1->add($3);
+ $$ = $1;
+ }
+ }
+ else if (is_cond_or($3))
+ {
+ item3= (Item_cond_or*) $3;
+ /*
+ X OR (Y1 OR Y2) ==> OR (X, Y1, Y2)
+ */
+ item3->add_at_head($1);
+ $$ = $3;
}
else
- $$= $1;
- delete list;
+ {
+ /* X OR Y */
+ $$ = new (YYTHD->mem_root) Item_cond_or($1, $3);
+ }
}
- ;
-
-bool_or_expr:
- /* empty */
- | bool_or_expr or bool_term
- { Select->expr_list.head()->push_back($3); }
- ;
-
-bool_term:
- bool_term XOR bool_term { $$= new Item_cond_xor($1,$3); }
- | bool_factor { Select->expr_list.push_front(new List<Item>); }
- bool_and_expr
+ | expr XOR expr %prec XOR
+ {
+ /* XOR is a proprietary extension */
+ $$ = new (YYTHD->mem_root) Item_cond_xor($1, $3);
+ }
+ | expr and expr %prec AND_SYM
{
- List<Item> *list= Select->expr_list.pop();
- if (list->elements)
+ /* See comments in rule expr: expr or expr */
+ Item_cond_and *item1;
+ Item_cond_and *item3;
+ if (is_cond_and($1))
+ {
+ item1= (Item_cond_and*) $1;
+ if (is_cond_and($3))
+ {
+ item3= (Item_cond_and*) $3;
+ /*
+ (X1 AND X2) AND (Y1 AND Y2) ==> AND (X1, X2, Y1, Y2)
+ */
+ item3->add_at_head(item1->argument_list());
+ $$ = $3;
+ }
+ else
+ {
+ /*
+ (X1 AND X2) AND Y ==> AND (X1, X2, Y)
+ */
+ item1->add($3);
+ $$ = $1;
+ }
+ }
+ else if (is_cond_and($3))
{
- list->push_front($1);
- $$= new Item_cond_and(*list);
- /* optimize construction of logical AND to reduce
- amount of objects for complex expressions */
+ item3= (Item_cond_and*) $3;
+ /*
+ X AND (Y1 AND Y2) ==> AND (X, Y1, Y2)
+ */
+ item3->add_at_head($1);
+ $$ = $3;
}
else
- $$= $1;
- delete list;
+ {
+ /* X AND Y */
+ $$ = new (YYTHD->mem_root) Item_cond_and($1, $3);
+ }
}
- ;
-
-bool_and_expr:
- /* empty */
- | bool_and_expr and bool_factor
- { Select->expr_list.head()->push_back($3); }
- ;
-
-bool_factor:
- NOT_SYM bool_factor { $$= negate_expression(YYTHD, $2); }
- | bool_test ;
-
-bool_test:
- bool_pri IS TRUE_SYM
+ | NOT_SYM expr %prec NOT_SYM
+ { $$= negate_expression(YYTHD, $2); }
+ | bool_pri IS TRUE_SYM %prec IS
{ $$= new (YYTHD->mem_root) Item_func_istrue($1); }
- | bool_pri IS not TRUE_SYM
+ | bool_pri IS not TRUE_SYM %prec IS
{ $$= new (YYTHD->mem_root) Item_func_isnottrue($1); }
- | bool_pri IS FALSE_SYM
+ | bool_pri IS FALSE_SYM %prec IS
{ $$= new (YYTHD->mem_root) Item_func_isfalse($1); }
- | bool_pri IS not FALSE_SYM
+ | bool_pri IS not FALSE_SYM %prec IS
{ $$= new (YYTHD->mem_root) Item_func_isnotfalse($1); }
- | bool_pri IS UNKNOWN_SYM { $$= new Item_func_isnull($1); }
- | bool_pri IS not UNKNOWN_SYM { $$= new Item_func_isnotnull($1); }
+ | bool_pri IS UNKNOWN_SYM %prec IS
+ { $$= new Item_func_isnull($1); }
+ | bool_pri IS not UNKNOWN_SYM %prec IS
+ { $$= new Item_func_isnotnull($1); }
| bool_pri
;
bool_pri:
- bool_pri IS NULL_SYM { $$= new Item_func_isnull($1); }
- | bool_pri IS not NULL_SYM { $$= new Item_func_isnotnull($1); }
- | bool_pri EQUAL_SYM predicate { $$= new Item_func_equal($1,$3); }
- | bool_pri comp_op predicate %prec EQ
- { $$= (*$2)(0)->create($1,$3); }
- | bool_pri comp_op all_or_any '(' subselect ')' %prec EQ
- { $$= all_any_subquery_creator($1, $2, $3, $5); }
- | predicate ;
+ bool_pri IS NULL_SYM %prec IS
+ { $$= new Item_func_isnull($1); }
+ | bool_pri IS not NULL_SYM %prec IS
+ { $$= new Item_func_isnotnull($1); }
+ | bool_pri EQUAL_SYM predicate %prec EQUAL_SYM
+ { $$= new Item_func_equal($1,$3); }
+ | bool_pri comp_op predicate %prec EQ
+ { $$= (*$2)(0)->create($1,$3); }
+ | bool_pri comp_op all_or_any '(' subselect ')' %prec EQ
+ { $$= all_any_subquery_creator($1, $2, $3, $5); }
+ | predicate ;
+ ;
predicate:
bit_expr IN_SYM '(' subselect ')'
@@ -6356,130 +6739,147 @@ predicate:
item->negate();
$$= item;
}
- | bit_expr BETWEEN_SYM bit_expr AND_SYM predicate
- { $$= new Item_func_between($1,$3,$5); }
- | bit_expr not BETWEEN_SYM bit_expr AND_SYM predicate
- {
- Item_func_between *item= new Item_func_between($1,$4,$6);
- item->negate();
- $$= item;
- }
- | bit_expr SOUNDS_SYM LIKE bit_expr
- { $$= new Item_func_eq(new Item_func_soundex($1),
- new Item_func_soundex($4)); }
- | bit_expr LIKE simple_expr opt_escape
+ | bit_expr BETWEEN_SYM bit_expr AND_SYM predicate
+ { $$= new Item_func_between($1,$3,$5); }
+ | bit_expr not BETWEEN_SYM bit_expr AND_SYM predicate
+ {
+ Item_func_between *item= new Item_func_between($1,$4,$6);
+ item->negate();
+ $$= item;
+ }
+ | bit_expr SOUNDS_SYM LIKE bit_expr
+ {
+ $$= new Item_func_eq(new Item_func_soundex($1),
+ new Item_func_soundex($4));
+ }
+ | bit_expr LIKE simple_expr opt_escape
{ $$= new Item_func_like($1,$3,$4,Lex->escape_used); }
- | bit_expr not LIKE simple_expr opt_escape
+ | bit_expr not LIKE simple_expr opt_escape
{ $$= new Item_func_not(new Item_func_like($1,$4,$5, Lex->escape_used)); }
- | bit_expr REGEXP bit_expr { $$= new Item_func_regex($1,$3); }
- | bit_expr not REGEXP bit_expr
+ | bit_expr REGEXP bit_expr { $$= new Item_func_regex($1,$3); }
+ | bit_expr not REGEXP bit_expr
{ $$= negate_expression(YYTHD, new Item_func_regex($1,$4)); }
- | bit_expr ;
+ | bit_expr
+ ;
bit_expr:
- bit_expr '|' bit_term { $$= new Item_func_bit_or($1,$3); }
- | bit_term ;
-
-bit_term:
- bit_term '&' bit_factor { $$= new Item_func_bit_and($1,$3); }
- | bit_factor ;
-
-bit_factor:
- bit_factor SHIFT_LEFT value_expr
- { $$= new Item_func_shift_left($1,$3); }
- | bit_factor SHIFT_RIGHT value_expr
- { $$= new Item_func_shift_right($1,$3); }
- | value_expr ;
-
-value_expr:
- value_expr '+' term { $$= new Item_func_plus($1,$3); }
- | value_expr '-' term { $$= new Item_func_minus($1,$3); }
- | value_expr '+' interval_expr interval
- { $$= new Item_date_add_interval($1,$3,$4,0); }
- | value_expr '-' interval_expr interval
- { $$= new Item_date_add_interval($1,$3,$4,1); }
- | term ;
-
-term:
- term '*' factor { $$= new Item_func_mul($1,$3); }
- | term '/' factor { $$= new Item_func_div($1,$3); }
- | term '%' factor { $$= new Item_func_mod($1,$3); }
- | term DIV_SYM factor { $$= new Item_func_int_div($1,$3); }
- | term MOD_SYM factor { $$= new Item_func_mod($1,$3); }
- | factor ;
-
-factor:
- factor '^' simple_expr { $$= new Item_func_bit_xor($1,$3); }
- | simple_expr ;
-
-or: OR_SYM | OR2_SYM;
-and: AND_SYM | AND_AND_SYM;
-not: NOT_SYM | NOT2_SYM;
-not2: '!' | NOT2_SYM;
-
-comp_op: EQ { $$ = &comp_eq_creator; }
- | GE { $$ = &comp_ge_creator; }
- | GT_SYM { $$ = &comp_gt_creator; }
- | LE { $$ = &comp_le_creator; }
- | LT { $$ = &comp_lt_creator; }
- | NE { $$ = &comp_ne_creator; }
- ;
+ bit_expr '|' bit_expr %prec '|'
+ { $$= new Item_func_bit_or($1,$3); }
+ | bit_expr '&' bit_expr %prec '&'
+ { $$= new Item_func_bit_and($1,$3); }
+ | bit_expr SHIFT_LEFT bit_expr %prec SHIFT_LEFT
+ { $$= new Item_func_shift_left($1,$3); }
+ | bit_expr SHIFT_RIGHT bit_expr %prec SHIFT_RIGHT
+ { $$= new Item_func_shift_right($1,$3); }
+ | bit_expr '+' bit_expr %prec '+'
+ { $$= new Item_func_plus($1,$3); }
+ | bit_expr '-' bit_expr %prec '-'
+ { $$= new Item_func_minus($1,$3); }
+ | bit_expr '+' interval_expr interval %prec '+'
+ { $$= new Item_date_add_interval($1,$3,$4,0); }
+ | bit_expr '-' interval_expr interval %prec '-'
+ { $$= new Item_date_add_interval($1,$3,$4,1); }
+ | bit_expr '*' bit_expr %prec '*'
+ { $$= new Item_func_mul($1,$3); }
+ | bit_expr '/' bit_expr %prec '/'
+ { $$= new Item_func_div($1,$3); }
+ | bit_expr '%' bit_expr %prec '%'
+ { $$= new Item_func_mod($1,$3); }
+ | bit_expr DIV_SYM bit_expr %prec DIV_SYM
+ { $$= new Item_func_int_div($1,$3); }
+ | bit_expr MOD_SYM bit_expr %prec MOD_SYM
+ { $$= new Item_func_mod($1,$3); }
+ | bit_expr '^' bit_expr
+ { $$= new Item_func_bit_xor($1,$3); }
+ | simple_expr
+ ;
+
+or:
+ OR_SYM
+ | OR2_SYM
+ ;
+
+and:
+ AND_SYM
+ | AND_AND_SYM
+ ;
+
+not:
+ NOT_SYM
+ | NOT2_SYM
+ ;
-all_or_any: ALL { $$ = 1; }
- | ANY_SYM { $$ = 0; }
+not2:
+ '!'
+ | NOT2_SYM
+ ;
+
+comp_op:
+ EQ { $$ = &comp_eq_creator; }
+ | GE { $$ = &comp_ge_creator; }
+ | GT_SYM { $$ = &comp_gt_creator; }
+ | LE { $$ = &comp_le_creator; }
+ | LT { $$ = &comp_lt_creator; }
+ | NE { $$ = &comp_ne_creator; }
+ ;
+
+all_or_any:
+ ALL { $$ = 1; }
+ | ANY_SYM { $$ = 0; }
;
interval_expr:
- INTERVAL_SYM expr { $$=$2; }
+ INTERVAL_SYM expr %prec INTERVAL_SYM
+ { $$=$2; }
;
simple_expr:
- simple_ident
+ simple_ident
| function_call_keyword
| function_call_nonkeyword
| function_call_generic
| function_call_conflict
- | simple_expr COLLATE_SYM ident_or_text %prec NEG
- {
+ | simple_expr COLLATE_SYM ident_or_text %prec NEG
+ {
THD *thd= YYTHD;
Item *i1= new (thd->mem_root) Item_string($3.str,
$3.length,
thd->charset());
- $$= new (thd->mem_root) Item_func_set_collation($1, i1);
- }
- | literal
- | param_marker
- | variable
- | sum_expr
- | simple_expr OR_OR_SYM simple_expr
- { $$= new (YYTHD->mem_root) Item_func_concat($1, $3); }
- | '+' simple_expr %prec NEG { $$= $2; }
- | '-' simple_expr %prec NEG
+ $$= new (thd->mem_root) Item_func_set_collation($1, i1);
+ }
+ | literal
+ | param_marker
+ | variable
+ | sum_expr
+ | simple_expr OR_OR_SYM simple_expr
+ { $$= new (YYTHD->mem_root) Item_func_concat($1, $3); }
+ | '+' simple_expr %prec NEG { $$= $2; }
+ | '-' simple_expr %prec NEG
{ $$= new (YYTHD->mem_root) Item_func_neg($2); }
- | '~' simple_expr %prec NEG
+ | '~' simple_expr %prec NEG
{ $$= new (YYTHD->mem_root) Item_func_bit_neg($2); }
- | not2 simple_expr %prec NEG
+ | not2 simple_expr %prec NEG
{ $$= negate_expression(YYTHD, $2); }
- | '(' subselect ')'
+ | '(' subselect ')'
{
$$= new (YYTHD->mem_root) Item_singlerow_subselect($2);
}
- | '(' expr ')' { $$= $2; }
- | '(' expr ',' expr_list ')'
- {
- $4->push_front($2);
- $$= new (YYTHD->mem_root) Item_row(*$4);
- }
- | ROW_SYM '(' expr ',' expr_list ')'
- {
- $5->push_front($3);
- $$= new (YYTHD->mem_root) Item_row(*$5);
- }
- | EXISTS '(' subselect ')'
+ | '(' expr ')' { $$= $2; }
+ | '(' expr ',' expr_list ')'
+ {
+ $4->push_front($2);
+ $$= new (YYTHD->mem_root) Item_row(*$4);
+ }
+ | ROW_SYM '(' expr ',' expr_list ')'
+ {
+ $5->push_front($3);
+ $$= new (YYTHD->mem_root) Item_row(*$5);
+ }
+ | EXISTS '(' subselect ')'
{
$$= new (YYTHD->mem_root) Item_exists_subselect($3);
}
- | '{' ident expr '}' { $$= $3; }
+ | '{' ident expr '}' { $$= $3; }
| MATCH ident_list_arg AGAINST '(' bit_expr fulltext_options ')'
{
$2->push_front($5);
@@ -6487,54 +6887,52 @@ simple_expr:
Select->add_ftfunc_to_list(i1);
$$= i1;
}
- | BINARY simple_expr %prec NEG
- {
- $$= create_func_cast(YYTHD, $2, ITEM_CAST_CHAR, -1, 0,
+ | BINARY simple_expr %prec NEG
+ {
+ $$= create_func_cast(YYTHD, $2, ITEM_CAST_CHAR, NULL, NULL,
&my_charset_bin);
- }
- | CAST_SYM '(' expr AS cast_type ')'
- {
+ }
+ | CAST_SYM '(' expr AS cast_type ')'
+ {
LEX *lex= Lex;
- $$= create_func_cast(YYTHD, $3, $5,
- lex->length ? atoi(lex->length) : -1,
- lex->dec ? atoi(lex->dec) : 0,
+ $$= create_func_cast(YYTHD, $3, $5, lex->length, lex->dec,
lex->charset);
if (!$$)
MYSQL_YYABORT;
- }
- | CASE_SYM opt_expr when_list opt_else END
- { $$= new (YYTHD->mem_root) Item_func_case(* $3, $2, $4 ); }
- | CONVERT_SYM '(' expr ',' cast_type ')'
- {
- $$= create_func_cast(YYTHD, $3, $5,
- Lex->length ? atoi(Lex->length) : -1,
- Lex->dec ? atoi(Lex->dec) : 0,
- Lex->charset);
+ }
+ | CASE_SYM opt_expr when_list opt_else END
+ { $$= new (YYTHD->mem_root) Item_func_case(* $3, $2, $4 ); }
+ | CONVERT_SYM '(' expr ',' cast_type ')'
+ {
+ $$= create_func_cast(YYTHD, $3, $5, Lex->length, Lex->dec,
+ Lex->charset);
if (!$$)
MYSQL_YYABORT;
- }
- | CONVERT_SYM '(' expr USING charset_name ')'
- { $$= new (YYTHD->mem_root) Item_func_conv_charset($3,$5); }
- | DEFAULT '(' simple_ident ')'
- {
- if ($3->is_splocal())
- {
- Item_splocal *il= static_cast<Item_splocal *>($3);
-
- my_error(ER_WRONG_COLUMN_NAME, MYF(0), il->my_name()->str);
- MYSQL_YYABORT;
- }
- $$= new (YYTHD->mem_root) Item_default_value(Lex->current_context(),
+ }
+ | CONVERT_SYM '(' expr USING charset_name ')'
+ { $$= new (YYTHD->mem_root) Item_func_conv_charset($3,$5); }
+ | DEFAULT '(' simple_ident ')'
+ {
+ if ($3->is_splocal())
+ {
+ Item_splocal *il= static_cast<Item_splocal *>($3);
+
+ my_error(ER_WRONG_COLUMN_NAME, MYF(0), il->my_name()->str);
+ MYSQL_YYABORT;
+ }
+ $$= new (YYTHD->mem_root) Item_default_value(Lex->current_context(),
$3);
- }
- | VALUES '(' simple_ident_nospvar ')'
- { $$= new (YYTHD->mem_root) Item_insert_value(Lex->current_context(),
- $3); }
- | interval_expr interval '+' expr
- /* we cannot put interval before - */
- { $$= new (YYTHD->mem_root) Item_date_add_interval($4,$1,$2,0); }
- | interval_expr
- {
+ }
+ | VALUES '(' simple_ident_nospvar ')'
+ {
+ $$= new (YYTHD->mem_root) Item_insert_value(Lex->current_context(),
+ $3);
+ }
+ | interval_expr interval '+' expr
+ /* we cannot put interval before - */
+ { $$= new (YYTHD->mem_root) Item_date_add_interval($4,$1,$2,0); }
+ | interval_expr
+ {
if ($1->type() != Item::ROW_ITEM)
{
my_parse_error(ER(ER_SYNTAX_ERROR));
@@ -6551,62 +6949,62 @@ simple_expr:
There is no potential for conflicts
*/
function_call_keyword:
- CHAR_SYM '(' expr_list ')'
- { $$= new (YYTHD->mem_root) Item_func_char(*$3); }
- | CHAR_SYM '(' expr_list USING charset_name ')'
- { $$= new (YYTHD->mem_root) Item_func_char(*$3, $5); }
- | CURRENT_USER optional_braces
+ CHAR_SYM '(' expr_list ')'
+ { $$= new (YYTHD->mem_root) Item_func_char(*$3); }
+ | CHAR_SYM '(' expr_list USING charset_name ')'
+ { $$= new (YYTHD->mem_root) Item_func_char(*$3, $5); }
+ | CURRENT_USER optional_braces
{
$$= new (YYTHD->mem_root) Item_func_current_user(Lex->current_context());
Lex->safe_to_cache_query= 0;
}
- | DATE_SYM '(' expr ')'
- { $$= new (YYTHD->mem_root) Item_date_typecast($3); }
- | DAY_SYM '(' expr ')'
- { $$= new (YYTHD->mem_root) Item_func_dayofmonth($3); }
- | HOUR_SYM '(' expr ')'
- { $$= new (YYTHD->mem_root) Item_func_hour($3); }
- | INSERT '(' expr ',' expr ',' expr ',' expr ')'
- { $$= new (YYTHD->mem_root) Item_func_insert($3,$5,$7,$9); }
- | LEFT '(' expr ',' expr ')'
- { $$= new (YYTHD->mem_root) Item_func_left($3,$5); }
- | MINUTE_SYM '(' expr ')'
- { $$= new (YYTHD->mem_root) Item_func_minute($3); }
- | MONTH_SYM '(' expr ')'
- { $$= new (YYTHD->mem_root) Item_func_month($3); }
- | RIGHT '(' expr ',' expr ')'
- { $$= new (YYTHD->mem_root) Item_func_right($3,$5); }
- | SECOND_SYM '(' expr ')'
- { $$= new (YYTHD->mem_root) Item_func_second($3); }
- | TIME_SYM '(' expr ')'
- { $$= new (YYTHD->mem_root) Item_time_typecast($3); }
- | TIMESTAMP '(' expr ')'
- { $$= new (YYTHD->mem_root) Item_datetime_typecast($3); }
- | TIMESTAMP '(' expr ',' expr ')'
- { $$= new (YYTHD->mem_root) Item_func_add_time($3, $5, 1, 0); }
- | TRIM '(' expr ')'
- { $$= new (YYTHD->mem_root) Item_func_trim($3); }
- | TRIM '(' LEADING expr FROM expr ')'
- { $$= new (YYTHD->mem_root) Item_func_ltrim($6,$4); }
- | TRIM '(' TRAILING expr FROM expr ')'
- { $$= new (YYTHD->mem_root) Item_func_rtrim($6,$4); }
- | TRIM '(' BOTH expr FROM expr ')'
- { $$= new (YYTHD->mem_root) Item_func_trim($6,$4); }
- | TRIM '(' LEADING FROM expr ')'
- { $$= new (YYTHD->mem_root) Item_func_ltrim($5); }
- | TRIM '(' TRAILING FROM expr ')'
- { $$= new (YYTHD->mem_root) Item_func_rtrim($5); }
- | TRIM '(' BOTH FROM expr ')'
- { $$= new (YYTHD->mem_root) Item_func_trim($5); }
- | TRIM '(' expr FROM expr ')'
- { $$= new (YYTHD->mem_root) Item_func_trim($5,$3); }
- | USER '(' ')'
- {
+ | DATE_SYM '(' expr ')'
+ { $$= new (YYTHD->mem_root) Item_date_typecast($3); }
+ | DAY_SYM '(' expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_dayofmonth($3); }
+ | HOUR_SYM '(' expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_hour($3); }
+ | INSERT '(' expr ',' expr ',' expr ',' expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_insert($3,$5,$7,$9); }
+ | LEFT '(' expr ',' expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_left($3,$5); }
+ | MINUTE_SYM '(' expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_minute($3); }
+ | MONTH_SYM '(' expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_month($3); }
+ | RIGHT '(' expr ',' expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_right($3,$5); }
+ | SECOND_SYM '(' expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_second($3); }
+ | TIME_SYM '(' expr ')'
+ { $$= new (YYTHD->mem_root) Item_time_typecast($3); }
+ | TIMESTAMP '(' expr ')'
+ { $$= new (YYTHD->mem_root) Item_datetime_typecast($3); }
+ | TIMESTAMP '(' expr ',' expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_add_time($3, $5, 1, 0); }
+ | TRIM '(' expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_trim($3); }
+ | TRIM '(' LEADING expr FROM expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_ltrim($6,$4); }
+ | TRIM '(' TRAILING expr FROM expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_rtrim($6,$4); }
+ | TRIM '(' BOTH expr FROM expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_trim($6,$4); }
+ | TRIM '(' LEADING FROM expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_ltrim($5); }
+ | TRIM '(' TRAILING FROM expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_rtrim($5); }
+ | TRIM '(' BOTH FROM expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_trim($5); }
+ | TRIM '(' expr FROM expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_trim($5,$3); }
+ | USER '(' ')'
+ {
$$= new (YYTHD->mem_root) Item_func_user();
Lex->safe_to_cache_query=0;
}
- | YEAR_SYM '(' expr ')'
- { $$= new (YYTHD->mem_root) Item_func_year($3); }
+ | YEAR_SYM '(' expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_year($3); }
;
/*
@@ -6622,64 +7020,64 @@ function_call_keyword:
discouraged.
*/
function_call_nonkeyword:
- ADDDATE_SYM '(' expr ',' expr ')'
- {
+ ADDDATE_SYM '(' expr ',' expr ')'
+ {
$$= new (YYTHD->mem_root) Item_date_add_interval($3, $5,
INTERVAL_DAY, 0);
}
- | ADDDATE_SYM '(' expr ',' INTERVAL_SYM expr interval ')'
- { $$= new (YYTHD->mem_root) Item_date_add_interval($3, $6, $7, 0); }
- | CURDATE optional_braces
- {
+ | ADDDATE_SYM '(' expr ',' INTERVAL_SYM expr interval ')'
+ { $$= new (YYTHD->mem_root) Item_date_add_interval($3, $6, $7, 0); }
+ | CURDATE optional_braces
+ {
$$= new (YYTHD->mem_root) Item_func_curdate_local();
Lex->safe_to_cache_query=0;
}
- | CURTIME optional_braces
- {
+ | CURTIME optional_braces
+ {
$$= new (YYTHD->mem_root) Item_func_curtime_local();
Lex->safe_to_cache_query=0;
}
- | CURTIME '(' expr ')'
- {
- $$= new (YYTHD->mem_root) Item_func_curtime_local($3);
- Lex->safe_to_cache_query=0;
- }
- | DATE_ADD_INTERVAL '(' expr ',' interval_expr interval ')'
- { $$= new (YYTHD->mem_root) Item_date_add_interval($3,$5,$6,0); }
- | DATE_SUB_INTERVAL '(' expr ',' interval_expr interval ')'
- { $$= new (YYTHD->mem_root) Item_date_add_interval($3,$5,$6,1); }
- | EXTRACT_SYM '(' interval FROM expr ')'
- { $$=new (YYTHD->mem_root) Item_extract( $3, $5); }
- | GET_FORMAT '(' date_time_type ',' expr ')'
- { $$= new (YYTHD->mem_root) Item_func_get_format($3, $5); }
- | NOW_SYM optional_braces
- {
+ | CURTIME '(' expr ')'
+ {
+ $$= new (YYTHD->mem_root) Item_func_curtime_local($3);
+ Lex->safe_to_cache_query=0;
+ }
+ | DATE_ADD_INTERVAL '(' expr ',' interval_expr interval ')'
+ { $$= new (YYTHD->mem_root) Item_date_add_interval($3,$5,$6,0); }
+ | DATE_SUB_INTERVAL '(' expr ',' interval_expr interval ')'
+ { $$= new (YYTHD->mem_root) Item_date_add_interval($3,$5,$6,1); }
+ | EXTRACT_SYM '(' interval FROM expr ')'
+ { $$=new (YYTHD->mem_root) Item_extract( $3, $5); }
+ | GET_FORMAT '(' date_time_type ',' expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_get_format($3, $5); }
+ | NOW_SYM optional_braces
+ {
$$= new (YYTHD->mem_root) Item_func_now_local();
Lex->safe_to_cache_query=0;
}
- | NOW_SYM '(' expr ')'
- {
+ | NOW_SYM '(' expr ')'
+ {
$$= new (YYTHD->mem_root) Item_func_now_local($3);
Lex->safe_to_cache_query=0;
}
- | POSITION_SYM '(' bit_expr IN_SYM expr ')'
- { $$ = new (YYTHD->mem_root) Item_func_locate($5,$3); }
- | SUBDATE_SYM '(' expr ',' expr ')'
- {
+ | POSITION_SYM '(' bit_expr IN_SYM expr ')'
+ { $$ = new (YYTHD->mem_root) Item_func_locate($5,$3); }
+ | SUBDATE_SYM '(' expr ',' expr ')'
+ {
$$= new (YYTHD->mem_root) Item_date_add_interval($3, $5,
INTERVAL_DAY, 1);
}
- | SUBDATE_SYM '(' expr ',' INTERVAL_SYM expr interval ')'
- { $$= new (YYTHD->mem_root) Item_date_add_interval($3, $6, $7, 1); }
- | SUBSTRING '(' expr ',' expr ',' expr ')'
- { $$= new (YYTHD->mem_root) Item_func_substr($3,$5,$7); }
- | SUBSTRING '(' expr ',' expr ')'
- { $$= new (YYTHD->mem_root) Item_func_substr($3,$5); }
- | SUBSTRING '(' expr FROM expr FOR_SYM expr ')'
- { $$= new (YYTHD->mem_root) Item_func_substr($3,$5,$7); }
- | SUBSTRING '(' expr FROM expr ')'
- { $$= new (YYTHD->mem_root) Item_func_substr($3,$5); }
- | SYSDATE optional_braces
+ | SUBDATE_SYM '(' expr ',' INTERVAL_SYM expr interval ')'
+ { $$= new (YYTHD->mem_root) Item_date_add_interval($3, $6, $7, 1); }
+ | SUBSTRING '(' expr ',' expr ',' expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_substr($3,$5,$7); }
+ | SUBSTRING '(' expr ',' expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_substr($3,$5); }
+ | SUBSTRING '(' expr FROM expr FOR_SYM expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_substr($3,$5,$7); }
+ | SUBSTRING '(' expr FROM expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_substr($3,$5); }
+ | SYSDATE optional_braces
{
if (global_system_variables.sysdate_is_now == 0)
$$= new (YYTHD->mem_root) Item_func_sysdate_local();
@@ -6687,7 +7085,7 @@ function_call_nonkeyword:
$$= new (YYTHD->mem_root) Item_func_now_local();
Lex->safe_to_cache_query=0;
}
- | SYSDATE '(' expr ')'
+ | SYSDATE '(' expr ')'
{
if (global_system_variables.sysdate_is_now == 0)
$$= new (YYTHD->mem_root) Item_func_sysdate_local($3);
@@ -6695,22 +7093,22 @@ function_call_nonkeyword:
$$= new (YYTHD->mem_root) Item_func_now_local($3);
Lex->safe_to_cache_query=0;
}
- | TIMESTAMP_ADD '(' interval_time_st ',' expr ',' expr ')'
- { $$= new (YYTHD->mem_root) Item_date_add_interval($7,$5,$3,0); }
- | TIMESTAMP_DIFF '(' interval_time_st ',' expr ',' expr ')'
- { $$= new (YYTHD->mem_root) Item_func_timestamp_diff($5,$7,$3); }
- | UTC_DATE_SYM optional_braces
- {
+ | TIMESTAMP_ADD '(' interval_time_st ',' expr ',' expr ')'
+ { $$= new (YYTHD->mem_root) Item_date_add_interval($7,$5,$3,0); }
+ | TIMESTAMP_DIFF '(' interval_time_st ',' expr ',' expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_timestamp_diff($5,$7,$3); }
+ | UTC_DATE_SYM optional_braces
+ {
$$= new (YYTHD->mem_root) Item_func_curdate_utc();
Lex->safe_to_cache_query=0;
}
- | UTC_TIME_SYM optional_braces
- {
+ | UTC_TIME_SYM optional_braces
+ {
$$= new (YYTHD->mem_root) Item_func_curtime_utc();
Lex->safe_to_cache_query=0;
}
- | UTC_TIMESTAMP_SYM optional_braces
- {
+ | UTC_TIMESTAMP_SYM optional_braces
+ {
$$= new (YYTHD->mem_root) Item_func_now_utc();
Lex->safe_to_cache_query=0;
}
@@ -6722,29 +7120,29 @@ function_call_nonkeyword:
a dedicated rule is needed here.
*/
function_call_conflict:
- ASCII_SYM '(' expr ')'
+ ASCII_SYM '(' expr ')'
{ $$= new (YYTHD->mem_root) Item_func_ascii($3); }
- | CHARSET '(' expr ')'
- { $$= new (YYTHD->mem_root) Item_func_charset($3); }
- | COALESCE '(' expr_list ')'
- { $$= new (YYTHD->mem_root) Item_func_coalesce(* $3); }
- | COLLATION_SYM '(' expr ')'
- { $$= new (YYTHD->mem_root) Item_func_collation($3); }
- | DATABASE '(' ')'
- {
- $$= new (YYTHD->mem_root) Item_func_database();
+ | CHARSET '(' expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_charset($3); }
+ | COALESCE '(' expr_list ')'
+ { $$= new (YYTHD->mem_root) Item_func_coalesce(* $3); }
+ | COLLATION_SYM '(' expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_collation($3); }
+ | DATABASE '(' ')'
+ {
+ $$= new (YYTHD->mem_root) Item_func_database();
Lex->safe_to_cache_query=0;
- }
- | IF '(' expr ',' expr ',' expr ')'
- { $$= new (YYTHD->mem_root) Item_func_if($3,$5,$7); }
- | MICROSECOND_SYM '(' expr ')'
- { $$= new (YYTHD->mem_root) Item_func_microsecond($3); }
- | MOD_SYM '(' expr ',' expr ')'
- { $$ = new (YYTHD->mem_root) Item_func_mod( $3, $5); }
- | OLD_PASSWORD '(' expr ')'
- { $$= new (YYTHD->mem_root) Item_func_old_password($3); }
- | PASSWORD '(' expr ')'
- {
+ }
+ | IF '(' expr ',' expr ',' expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_if($3,$5,$7); }
+ | MICROSECOND_SYM '(' expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_microsecond($3); }
+ | MOD_SYM '(' expr ',' expr ')'
+ { $$ = new (YYTHD->mem_root) Item_func_mod( $3, $5); }
+ | OLD_PASSWORD '(' expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_old_password($3); }
+ | PASSWORD '(' expr ')'
+ {
THD *thd= YYTHD;
Item* i1;
if (thd->variables.old_passwords)
@@ -6752,17 +7150,17 @@ function_call_conflict:
else
i1= new (thd->mem_root) Item_func_password($3);
$$= i1;
- }
- | QUARTER_SYM '(' expr ')'
- { $$ = new (YYTHD->mem_root) Item_func_quarter($3); }
- | REPEAT_SYM '(' expr ',' expr ')'
- { $$= new (YYTHD->mem_root) Item_func_repeat($3,$5); }
- | REPLACE '(' expr ',' expr ',' expr ')'
- { $$= new (YYTHD->mem_root) Item_func_replace($3,$5,$7); }
- | TRUNCATE_SYM '(' expr ',' expr ')'
- { $$= new (YYTHD->mem_root) Item_func_round($3,$5,1); }
- | WEEK_SYM '(' expr ')'
- {
+ }
+ | QUARTER_SYM '(' expr ')'
+ { $$ = new (YYTHD->mem_root) Item_func_quarter($3); }
+ | REPEAT_SYM '(' expr ',' expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_repeat($3,$5); }
+ | REPLACE '(' expr ',' expr ',' expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_replace($3,$5,$7); }
+ | TRUNCATE_SYM '(' expr ',' expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_round($3,$5,1); }
+ | WEEK_SYM '(' expr ')'
+ {
THD *thd= YYTHD;
Item *i1= new (thd->mem_root) Item_int((char*) "0",
thd->variables.default_week_format,
@@ -6770,8 +7168,8 @@ function_call_conflict:
$$= new (thd->mem_root) Item_func_week($3, i1);
}
- | WEEK_SYM '(' expr ',' expr ')'
- { $$= new (YYTHD->mem_root) Item_func_week($3,$5); }
+ | WEEK_SYM '(' expr ',' expr ')'
+ { $$= new (YYTHD->mem_root) Item_func_week($3,$5); }
| geometry_function
{
#ifdef HAVE_SPATIAL
@@ -6785,54 +7183,54 @@ function_call_conflict:
;
geometry_function:
- CONTAINS_SYM '(' expr ',' expr ')'
- {
+ CONTAINS_SYM '(' expr ',' expr ')'
+ {
$$= GEOM_NEW(YYTHD,
Item_func_spatial_rel($3, $5,
Item_func::SP_CONTAINS_FUNC));
}
- | GEOMETRYCOLLECTION '(' expr_list ')'
- {
+ | GEOMETRYCOLLECTION '(' expr_list ')'
+ {
$$= GEOM_NEW(YYTHD,
Item_func_spatial_collection(* $3,
Geometry::wkb_geometrycollection,
Geometry::wkb_point));
}
- | LINESTRING '(' expr_list ')'
- {
+ | LINESTRING '(' expr_list ')'
+ {
$$= GEOM_NEW(YYTHD,
Item_func_spatial_collection(* $3,
Geometry::wkb_linestring,
Geometry::wkb_point));
}
- | MULTILINESTRING '(' expr_list ')'
- {
+ | MULTILINESTRING '(' expr_list ')'
+ {
$$= GEOM_NEW(YYTHD,
Item_func_spatial_collection(* $3,
Geometry::wkb_multilinestring,
Geometry::wkb_linestring));
}
- | MULTIPOINT '(' expr_list ')'
- {
+ | MULTIPOINT '(' expr_list ')'
+ {
$$= GEOM_NEW(YYTHD,
Item_func_spatial_collection(* $3,
Geometry::wkb_multipoint,
Geometry::wkb_point));
}
- | MULTIPOLYGON '(' expr_list ')'
- {
+ | MULTIPOLYGON '(' expr_list ')'
+ {
$$= GEOM_NEW(YYTHD,
Item_func_spatial_collection(* $3,
Geometry::wkb_multipolygon,
Geometry::wkb_polygon));
}
- | POINT_SYM '(' expr ',' expr ')'
- { $$= GEOM_NEW(YYTHD, Item_func_point($3,$5)); }
- | POLYGON '(' expr_list ')'
- {
+ | POINT_SYM '(' expr ',' expr ')'
+ { $$= GEOM_NEW(YYTHD, Item_func_point($3,$5)); }
+ | POLYGON '(' expr_list ')'
+ {
$$= GEOM_NEW(YYTHD,
Item_func_spatial_collection(* $3,
- Geometry::wkb_polygon,
+ Geometry::wkb_polygon,
Geometry::wkb_linestring));
}
;
@@ -6847,103 +7245,103 @@ geometry_function:
in sql/item_create.cc
*/
function_call_generic:
- IDENT_sys '('
- {
-#ifdef HAVE_DLOPEN
- udf_func *udf= 0;
- LEX *lex= Lex;
- if (using_udf_functions &&
- (udf= find_udf($1.str, $1.length)) &&
- udf->type == UDFTYPE_AGGREGATE)
+ IDENT_sys '('
{
- if (lex->current_select->inc_in_sum_expr())
+#ifdef HAVE_DLOPEN
+ udf_func *udf= 0;
+ LEX *lex= Lex;
+ if (using_udf_functions &&
+ (udf= find_udf($1.str, $1.length)) &&
+ udf->type == UDFTYPE_AGGREGATE)
{
- my_parse_error(ER(ER_SYNTAX_ERROR));
- MYSQL_YYABORT;
+ if (lex->current_select->inc_in_sum_expr())
+ {
+ my_parse_error(ER(ER_SYNTAX_ERROR));
+ MYSQL_YYABORT;
+ }
}
- }
- /* Temporary placing the result of find_udf in $3 */
- $<udf>$= udf;
+ /* Temporary placing the result of find_udf in $3 */
+ $<udf>$= udf;
#endif
- }
- udf_expr_list ')'
- {
- THD *thd= YYTHD;
- Create_func *builder;
- Item *item= NULL;
-
- /*
- Implementation note:
- names are resolved with the following order:
- - MySQL native functions,
- - User Defined Functions,
- - Stored Functions (assuming the current <use> database)
-
- This will be revised with WL#2128 (SQL PATH)
- */
- builder= find_native_function_builder(thd, $1);
- if (builder)
- {
- item= builder->create(thd, $1, $4);
}
- else
+ opt_udf_expr_list ')'
{
-#ifdef HAVE_DLOPEN
- /* Retrieving the result of find_udf */
- udf_func *udf= $<udf>3;
+ THD *thd= YYTHD;
+ Create_func *builder;
+ Item *item= NULL;
- if (udf)
- {
- if (udf->type == UDFTYPE_AGGREGATE)
- {
- Select->in_sum_expr--;
- }
+ /*
+ Implementation note:
+ names are resolved with the following order:
+ - MySQL native functions,
+ - User Defined Functions,
+ - Stored Functions (assuming the current <use> database)
- item= Create_udf_func::s_singleton.create(thd, udf, $4);
+ This will be revised with WL#2128 (SQL PATH)
+ */
+ builder= find_native_function_builder(thd, $1);
+ if (builder)
+ {
+ item= builder->create(thd, $1, $4);
}
else
+ {
+#ifdef HAVE_DLOPEN
+ /* Retrieving the result of find_udf */
+ udf_func *udf= $<udf>3;
+
+ if (udf)
+ {
+ if (udf->type == UDFTYPE_AGGREGATE)
+ {
+ Select->in_sum_expr--;
+ }
+
+ item= Create_udf_func::s_singleton.create(thd, udf, $4);
+ }
+ else
#endif
+ {
+ builder= find_qualified_function_builder(thd);
+ DBUG_ASSERT(builder);
+ item= builder->create(thd, $1, $4);
+ }
+ }
+
+ if (! ($$= item))
{
- builder= find_qualified_function_builder(thd);
- DBUG_ASSERT(builder);
- item= builder->create(thd, $1, $4);
+ MYSQL_YYABORT;
}
}
-
- if (! ($$= item))
+ | ident '.' ident '(' opt_expr_list ')'
{
- MYSQL_YYABORT;
- }
- }
- | ident '.' ident '(' opt_expr_list ')'
- {
- THD *thd= YYTHD;
- Create_qfunc *builder;
- Item *item= NULL;
+ THD *thd= YYTHD;
+ Create_qfunc *builder;
+ Item *item= NULL;
- /*
- The following in practice calls:
- <code>Create_sp_func::create()</code>
- and builds a stored function.
-
- However, it's important to maintain the interface between the
- parser and the implementation in item_create.cc clean,
- since this will change with WL#2128 (SQL PATH):
- - INFORMATION_SCHEMA.version() is the SQL 99 syntax for the native
- function version(),
- - MySQL.version() is the SQL 2003 syntax for the native function
- version() (a vendor can specify any schema).
- */
+ /*
+ The following in practice calls:
+ <code>Create_sp_func::create()</code>
+ and builds a stored function.
+
+ However, it's important to maintain the interface between the
+ parser and the implementation in item_create.cc clean,
+ since this will change with WL#2128 (SQL PATH):
+ - INFORMATION_SCHEMA.version() is the SQL 99 syntax for the native
+ function version(),
+ - MySQL.version() is the SQL 2003 syntax for the native function
+ version() (a vendor can specify any schema).
+ */
- builder= find_qualified_function_builder(thd);
- DBUG_ASSERT(builder);
- item= builder->create(thd, $1, $3, true, $5);
+ builder= find_qualified_function_builder(thd);
+ DBUG_ASSERT(builder);
+ item= builder->create(thd, $1, $3, true, $5);
- if (! ($$= item))
- {
- MYSQL_YYABORT;
+ if (! ($$= item))
+ {
+ MYSQL_YYABORT;
+ }
}
- }
;
fulltext_options:
@@ -6954,115 +7352,112 @@ fulltext_options:
;
opt_natural_language_mode:
- /* nothing */ { $$= FT_NL; }
+ /* nothing */ { $$= FT_NL; }
| IN_SYM NATURAL LANGUAGE_SYM MODE_SYM { $$= FT_NL; }
;
opt_query_expansion:
- /* nothing */ { $$= 0; }
+ /* nothing */ { $$= 0; }
| WITH QUERY_SYM EXPANSION_SYM { $$= FT_EXPAND; }
;
-udf_expr_list:
- /* empty */ { $$= NULL; }
- | udf_expr_list2 { $$= $1;}
- ;
-
-udf_expr_list2:
- { Select->expr_list.push_front(new List<Item>); }
- udf_expr_list3
- { $$= Select->expr_list.pop(); }
- ;
+opt_udf_expr_list:
+ /* empty */ { $$= NULL; }
+ | udf_expr_list { $$= $1; }
+ ;
-udf_expr_list3:
- udf_expr
- {
- Select->expr_list.head()->push_back($1);
- }
- | udf_expr_list3 ',' udf_expr
- {
- Select->expr_list.head()->push_back($3);
- }
- ;
+udf_expr_list:
+ udf_expr
+ {
+ $$= new (YYTHD->mem_root) List<Item>;
+ $$->push_back($1);
+ }
+ | udf_expr_list ',' udf_expr
+ {
+ $1->push_back($3);
+ $$= $1;
+ }
+ ;
udf_expr:
- remember_name expr remember_end select_alias
- {
- /*
- Use Item::name as a storage for the attribute value of user
- defined function argument. It is safe to use Item::name
- because the syntax will not allow having an explicit name here.
- See WL#1017 re. udf attributes.
- */
- if ($4.str)
+ remember_name expr remember_end select_alias
{
- $2->is_autogenerated_name= FALSE;
- $2->set_name($4.str, $4.length, system_charset_info);
+ /*
+ Use Item::name as a storage for the attribute value of user
+ defined function argument. It is safe to use Item::name
+ because the syntax will not allow having an explicit name here.
+ See WL#1017 re. udf attributes.
+ */
+ if ($4.str)
+ {
+ $2->is_autogenerated_name= FALSE;
+ $2->set_name($4.str, $4.length, system_charset_info);
+ }
+ else
+ $2->set_name($1, (uint) ($3 - $1), YYTHD->charset());
+ $$= $2;
}
- else
- $2->set_name($1, (uint) ($3 - $1), YYTHD->charset());
- $$= $2;
- }
- ;
+ ;
sum_expr:
- AVG_SYM '(' in_sum_expr ')'
- { $$=new Item_sum_avg($3); }
- | AVG_SYM '(' DISTINCT in_sum_expr ')'
- { $$=new Item_sum_avg_distinct($4); }
- | BIT_AND '(' in_sum_expr ')'
- { $$=new Item_sum_and($3); }
- | BIT_OR '(' in_sum_expr ')'
- { $$=new Item_sum_or($3); }
- | BIT_XOR '(' in_sum_expr ')'
- { $$=new Item_sum_xor($3); }
- | COUNT_SYM '(' opt_all '*' ')'
- { $$=new Item_sum_count(new Item_int((int32) 0L,1)); }
- | COUNT_SYM '(' in_sum_expr ')'
- { $$=new Item_sum_count($3); }
- | COUNT_SYM '(' DISTINCT
- { Select->in_sum_expr++; }
- expr_list
- { Select->in_sum_expr--; }
- ')'
- { $$=new Item_sum_count_distinct(* $5); }
- | MIN_SYM '(' in_sum_expr ')'
- { $$=new Item_sum_min($3); }
-/*
- According to ANSI SQL, DISTINCT is allowed and has
- no sense inside MIN and MAX grouping functions; so MIN|MAX(DISTINCT ...)
- is processed like an ordinary MIN | MAX()
- */
- | MIN_SYM '(' DISTINCT in_sum_expr ')'
- { $$=new Item_sum_min($4); }
- | MAX_SYM '(' in_sum_expr ')'
- { $$=new Item_sum_max($3); }
- | MAX_SYM '(' DISTINCT in_sum_expr ')'
- { $$=new Item_sum_max($4); }
- | STD_SYM '(' in_sum_expr ')'
- { $$=new Item_sum_std($3, 0); }
- | VARIANCE_SYM '(' in_sum_expr ')'
- { $$=new Item_sum_variance($3, 0); }
- | STDDEV_SAMP_SYM '(' in_sum_expr ')'
- { $$=new Item_sum_std($3, 1); }
- | VAR_SAMP_SYM '(' in_sum_expr ')'
- { $$=new Item_sum_variance($3, 1); }
- | SUM_SYM '(' in_sum_expr ')'
- { $$=new Item_sum_sum($3); }
- | SUM_SYM '(' DISTINCT in_sum_expr ')'
- { $$=new Item_sum_sum_distinct($4); }
- | GROUP_CONCAT_SYM '(' opt_distinct
- { Select->in_sum_expr++; }
- expr_list opt_gorder_clause
- opt_gconcat_separator
- ')'
- {
+ AVG_SYM '(' in_sum_expr ')'
+ { $$=new Item_sum_avg($3); }
+ | AVG_SYM '(' DISTINCT in_sum_expr ')'
+ { $$=new Item_sum_avg_distinct($4); }
+ | BIT_AND '(' in_sum_expr ')'
+ { $$=new Item_sum_and($3); }
+ | BIT_OR '(' in_sum_expr ')'
+ { $$=new Item_sum_or($3); }
+ | BIT_XOR '(' in_sum_expr ')'
+ { $$=new Item_sum_xor($3); }
+ | COUNT_SYM '(' opt_all '*' ')'
+ { $$=new Item_sum_count(new Item_int((int32) 0L,1)); }
+ | COUNT_SYM '(' in_sum_expr ')'
+ { $$=new Item_sum_count($3); }
+ | COUNT_SYM '(' DISTINCT
+ { Select->in_sum_expr++; }
+ expr_list
+ { Select->in_sum_expr--; }
+ ')'
+ { $$=new Item_sum_count_distinct(* $5); }
+ | MIN_SYM '(' in_sum_expr ')'
+ { $$=new Item_sum_min($3); }
+ /*
+ According to ANSI SQL, DISTINCT is allowed and has
+ no sense inside MIN and MAX grouping functions; so MIN|MAX(DISTINCT ...)
+ is processed like an ordinary MIN | MAX()
+ */
+ | MIN_SYM '(' DISTINCT in_sum_expr ')'
+ { $$=new Item_sum_min($4); }
+ | MAX_SYM '(' in_sum_expr ')'
+ { $$=new Item_sum_max($3); }
+ | MAX_SYM '(' DISTINCT in_sum_expr ')'
+ { $$=new Item_sum_max($4); }
+ | STD_SYM '(' in_sum_expr ')'
+ { $$=new Item_sum_std($3, 0); }
+ | VARIANCE_SYM '(' in_sum_expr ')'
+ { $$=new Item_sum_variance($3, 0); }
+ | STDDEV_SAMP_SYM '(' in_sum_expr ')'
+ { $$=new Item_sum_std($3, 1); }
+ | VAR_SAMP_SYM '(' in_sum_expr ')'
+ { $$=new Item_sum_variance($3, 1); }
+ | SUM_SYM '(' in_sum_expr ')'
+ { $$=new Item_sum_sum($3); }
+ | SUM_SYM '(' DISTINCT in_sum_expr ')'
+ { $$=new Item_sum_sum_distinct($4); }
+ | GROUP_CONCAT_SYM '(' opt_distinct
+ { Select->in_sum_expr++; }
+ expr_list opt_gorder_clause
+ opt_gconcat_separator
+ ')'
+ {
SELECT_LEX *sel= Select;
- sel->in_sum_expr--;
- $$=new Item_func_group_concat(Lex->current_context(), $3, $5,
+ sel->in_sum_expr--;
+ $$=new Item_func_group_concat(Lex->current_context(), $3, $5,
sel->gorder_list, $7);
- $5->empty();
- };
+ $5->empty();
+ }
+ ;
variable:
'@'
@@ -7077,7 +7472,7 @@ variable:
{
$$= $3;
}
- ;
+ ;
variable_aux:
ident_or_text SET_VAR expr
@@ -7105,93 +7500,120 @@ variable_aux:
;
opt_distinct:
- /* empty */ { $$ = 0; }
- |DISTINCT { $$ = 1; };
+ /* empty */ { $$ = 0; }
+ | DISTINCT { $$ = 1; }
+ ;
opt_gconcat_separator:
- /* empty */ { $$ = new (YYTHD->mem_root) String(",",1,default_charset_info); }
- |SEPARATOR_SYM text_string { $$ = $2; };
-
+ /* empty */
+ {
+ $$= new (YYTHD->mem_root) String(",", 1, &my_charset_latin1);
+ }
+ | SEPARATOR_SYM text_string { $$ = $2; }
+ ;
opt_gorder_clause:
- /* empty */
- {
+ /* empty */
+ {
Select->gorder_list = NULL;
- }
- | order_clause
+ }
+ | order_clause
{
SELECT_LEX *select= Select;
select->gorder_list=
- (SQL_LIST*) sql_memdup((char*) &select->order_list,
- sizeof(st_sql_list));
- select->order_list.empty();
- };
-
+ (SQL_LIST*) sql_memdup((char*) &select->order_list,
+ sizeof(st_sql_list));
+ select->order_list.empty();
+ }
+ ;
in_sum_expr:
- opt_all
- {
- LEX *lex= Lex;
- if (lex->current_select->inc_in_sum_expr())
- {
- my_parse_error(ER(ER_SYNTAX_ERROR));
- MYSQL_YYABORT;
- }
- }
- expr
- {
- Select->in_sum_expr--;
- $$= $3;
- };
+ opt_all
+ {
+ LEX *lex= Lex;
+ if (lex->current_select->inc_in_sum_expr())
+ {
+ my_parse_error(ER(ER_SYNTAX_ERROR));
+ MYSQL_YYABORT;
+ }
+ }
+ expr
+ {
+ Select->in_sum_expr--;
+ $$= $3;
+ }
+ ;
cast_type:
- BINARY opt_len { $$=ITEM_CAST_CHAR; Lex->charset= &my_charset_bin; Lex->dec= 0; }
- | CHAR_SYM opt_len opt_binary { $$=ITEM_CAST_CHAR; Lex->dec= 0; }
- | NCHAR_SYM opt_len { $$=ITEM_CAST_CHAR; Lex->charset= national_charset_info; Lex->dec=0; }
- | SIGNED_SYM { $$=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
- | SIGNED_SYM INT_SYM { $$=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
- | UNSIGNED { $$=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
- | UNSIGNED INT_SYM { $$=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
- | DATE_SYM { $$=ITEM_CAST_DATE; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
- | TIME_SYM { $$=ITEM_CAST_TIME; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
- | DATETIME { $$=ITEM_CAST_DATETIME; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
- | DECIMAL_SYM float_options { $$=ITEM_CAST_DECIMAL; Lex->charset= NULL; }
- ;
+ BINARY opt_len
+ { $$=ITEM_CAST_CHAR; Lex->charset= &my_charset_bin; Lex->dec= 0; }
+ | CHAR_SYM opt_len opt_binary
+ { $$=ITEM_CAST_CHAR; Lex->dec= 0; }
+ | NCHAR_SYM opt_len
+ { $$=ITEM_CAST_CHAR; Lex->charset= national_charset_info; Lex->dec=0; }
+ | SIGNED_SYM
+ { $$=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
+ | SIGNED_SYM INT_SYM
+ { $$=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
+ | UNSIGNED
+ { $$=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
+ | UNSIGNED INT_SYM
+ { $$=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
+ | DATE_SYM
+ { $$=ITEM_CAST_DATE; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
+ | TIME_SYM
+ { $$=ITEM_CAST_TIME; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
+ | DATETIME
+ { $$=ITEM_CAST_DATETIME; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
+ | DECIMAL_SYM float_options
+ { $$=ITEM_CAST_DECIMAL; Lex->charset= NULL; }
+ ;
opt_expr_list:
- /* empty */ { $$= NULL; }
- | expr_list { $$= $1;}
- ;
+ /* empty */ { $$= NULL; }
+ | expr_list { $$= $1;}
+ ;
expr_list:
- { Select->expr_list.push_front(new List<Item>); }
- expr_list2
- { $$= Select->expr_list.pop(); };
-
-expr_list2:
- expr { Select->expr_list.head()->push_back($1); }
- | expr_list2 ',' expr { Select->expr_list.head()->push_back($3); };
+ expr
+ {
+ $$= new (YYTHD->mem_root) List<Item>;
+ $$->push_back($1);
+ }
+ | expr_list ',' expr
+ {
+ $1->push_back($3);
+ $$= $1;
+ }
+ ;
ident_list_arg:
ident_list { $$= $1; }
- | '(' ident_list ')' { $$= $2; };
+ | '(' ident_list ')' { $$= $2; }
+ ;
ident_list:
- { Select->expr_list.push_front(new List<Item>); }
- ident_list2
- { $$= Select->expr_list.pop(); };
-
-ident_list2:
- simple_ident { Select->expr_list.head()->push_back($1); }
- | ident_list2 ',' simple_ident { Select->expr_list.head()->push_back($3); };
+ simple_ident
+ {
+ $$= new (YYTHD->mem_root) List<Item>;
+ $$->push_back($1);
+ }
+ | ident_list ',' simple_ident
+ {
+ $1->push_back($3);
+ $$= $1;
+ }
+ ;
opt_expr:
- /* empty */ { $$= NULL; }
- | expr { $$= $1; };
+ /* empty */ { $$= NULL; }
+ | expr { $$= $1; }
+ ;
opt_else:
- /* empty */ { $$= NULL; }
- | ELSE expr { $$= $2; };
+ /* empty */ { $$= NULL; }
+ | ELSE expr { $$= $2; }
+ ;
when_list:
WHEN_SYM expr THEN_SYM expr
@@ -7210,22 +7632,22 @@ when_list:
/* Warning - may return NULL in case of incomplete SELECT */
table_ref:
- table_factor { $$=$1; }
+ table_factor { $$=$1; }
| join_table
{
- LEX *lex= Lex;
+ LEX *lex= Lex;
if (!($$= lex->current_select->nest_last_join(lex->thd)))
MYSQL_YYABORT;
}
;
join_table_list:
- derived_table_list { MYSQL_YYABORT_UNLESS($$=$1); }
- ;
+ derived_table_list { MYSQL_YYABORT_UNLESS($$=$1); }
+ ;
/* Warning - may return NULL in case of incomplete SELECT */
derived_table_list:
- table_ref { $$=$1; }
+ table_ref { $$=$1; }
| derived_table_list ',' table_ref
{
MYSQL_YYABORT_UNLESS($1 && ($$=$3));
@@ -7240,17 +7662,17 @@ derived_table_list:
and subsequent optimization phases.
*/
join_table:
-/* INNER JOIN variants */
- /*
- Use %prec to evaluate production 'table_ref' before 'normal_join'
- so that [INNER | CROSS] JOIN is properly nested as other
- left-associative joins.
- */
- table_ref %prec TABLE_REF_PRIORITY normal_join table_ref
+ /* INNER JOIN variants */
+ /*
+ Use %prec to evaluate production 'table_ref' before 'normal_join'
+ so that [INNER | CROSS] JOIN is properly nested as other
+ left-associative joins.
+ */
+ table_ref normal_join table_ref %prec TABLE_REF_PRIORITY
{ MYSQL_YYABORT_UNLESS($1 && ($$=$3)); }
- | table_ref STRAIGHT_JOIN table_factor
- { MYSQL_YYABORT_UNLESS($1 && ($$=$3)); $3->straight=1; }
- | table_ref normal_join table_ref
+ | table_ref STRAIGHT_JOIN table_factor
+ { MYSQL_YYABORT_UNLESS($1 && ($$=$3)); $3->straight=1; }
+ | table_ref normal_join table_ref
ON
{
MYSQL_YYABORT_UNLESS($1 && $3);
@@ -7260,7 +7682,7 @@ join_table:
Select->parsing_place= IN_ON;
}
expr
- {
+ {
add_join_on($3,$6);
Lex->pop_context();
Select->parsing_place= NO_MATTER;
@@ -7281,21 +7703,21 @@ join_table:
Lex->pop_context();
Select->parsing_place= NO_MATTER;
}
- | table_ref normal_join table_ref
- USING
- {
+ | table_ref normal_join table_ref
+ USING
+ {
MYSQL_YYABORT_UNLESS($1 && $3);
- }
- '(' using_list ')'
+ }
+ '(' using_list ')'
{ add_join_natural($1,$3,$7,Select); $$=$3; }
- | table_ref NATURAL JOIN_SYM table_factor
- {
+ | table_ref NATURAL JOIN_SYM table_factor
+ {
MYSQL_YYABORT_UNLESS($1 && ($$=$4));
add_join_natural($1,$4,NULL,Select);
}
-/* LEFT JOIN variants */
- | table_ref LEFT opt_outer JOIN_SYM table_ref
+ /* LEFT JOIN variants */
+ | table_ref LEFT opt_outer JOIN_SYM table_ref
ON
{
MYSQL_YYABORT_UNLESS($1 && $5);
@@ -7305,33 +7727,33 @@ join_table:
Select->parsing_place= IN_ON;
}
expr
- {
+ {
add_join_on($5,$8);
Lex->pop_context();
$5->outer_join|=JOIN_TYPE_LEFT;
$$=$5;
Select->parsing_place= NO_MATTER;
}
- | table_ref LEFT opt_outer JOIN_SYM table_factor
- {
+ | table_ref LEFT opt_outer JOIN_SYM table_factor
+ {
MYSQL_YYABORT_UNLESS($1 && $5);
- }
- USING '(' using_list ')'
+ }
+ USING '(' using_list ')'
{
add_join_natural($1,$5,$9,Select);
$5->outer_join|=JOIN_TYPE_LEFT;
$$=$5;
}
- | table_ref NATURAL LEFT opt_outer JOIN_SYM table_factor
- {
+ | table_ref NATURAL LEFT opt_outer JOIN_SYM table_factor
+ {
MYSQL_YYABORT_UNLESS($1 && $6);
- add_join_natural($1,$6,NULL,Select);
- $6->outer_join|=JOIN_TYPE_LEFT;
- $$=$6;
- }
+ add_join_natural($1,$6,NULL,Select);
+ $6->outer_join|=JOIN_TYPE_LEFT;
+ $$=$6;
+ }
-/* RIGHT JOIN variants */
- | table_ref RIGHT opt_outer JOIN_SYM table_ref
+ /* RIGHT JOIN variants */
+ | table_ref RIGHT opt_outer JOIN_SYM table_ref
ON
{
MYSQL_YYABORT_UNLESS($1 && $5);
@@ -7342,55 +7764,56 @@ join_table:
}
expr
{
- LEX *lex= Lex;
+ LEX *lex= Lex;
if (!($$= lex->current_select->convert_right_join()))
MYSQL_YYABORT;
add_join_on($$, $8);
Lex->pop_context();
Select->parsing_place= NO_MATTER;
}
- | table_ref RIGHT opt_outer JOIN_SYM table_factor
- {
+ | table_ref RIGHT opt_outer JOIN_SYM table_factor
+ {
MYSQL_YYABORT_UNLESS($1 && $5);
- }
- USING '(' using_list ')'
+ }
+ USING '(' using_list ')'
{
- LEX *lex= Lex;
+ LEX *lex= Lex;
if (!($$= lex->current_select->convert_right_join()))
MYSQL_YYABORT;
add_join_natural($$,$5,$9,Select);
}
- | table_ref NATURAL RIGHT opt_outer JOIN_SYM table_factor
- {
+ | table_ref NATURAL RIGHT opt_outer JOIN_SYM table_factor
+ {
MYSQL_YYABORT_UNLESS($1 && $6);
- add_join_natural($6,$1,NULL,Select);
- LEX *lex= Lex;
+ add_join_natural($6,$1,NULL,Select);
+ LEX *lex= Lex;
if (!($$= lex->current_select->convert_right_join()))
MYSQL_YYABORT;
- };
+ }
+ ;
normal_join:
- JOIN_SYM {}
- | INNER_SYM JOIN_SYM {}
- | CROSS JOIN_SYM {}
- ;
+ JOIN_SYM {}
+ | INNER_SYM JOIN_SYM {}
+ | CROSS JOIN_SYM {}
+ ;
/* Warning - may return NULL in case of incomplete SELECT */
table_factor:
- {
- SELECT_LEX *sel= Select;
- sel->table_join_options= 0;
- }
- table_ident opt_table_alias opt_key_definition
- {
- if (!($$= Select->add_table_to_list(YYTHD, $2, $3,
- Select->get_table_join_options(),
- Lex->lock_option,
- Select->pop_index_hints())))
- MYSQL_YYABORT;
- Select->add_joined_table($$);
- }
- | '{' ident table_ref LEFT OUTER JOIN_SYM table_ref
+ {
+ SELECT_LEX *sel= Select;
+ sel->table_join_options= 0;
+ }
+ table_ident opt_table_alias opt_key_definition
+ {
+ if (!($$= Select->add_table_to_list(YYTHD, $2, $3,
+ Select->get_table_join_options(),
+ Lex->lock_option,
+ Select->pop_index_hints())))
+ MYSQL_YYABORT;
+ Select->add_joined_table($$);
+ }
+ | '{' ident table_ref LEFT OUTER JOIN_SYM table_ref
ON
{
/* Change the current name resolution context to a local context. */
@@ -7399,8 +7822,8 @@ table_factor:
}
expr '}'
- {
- LEX *lex= Lex;
+ {
+ LEX *lex= Lex;
MYSQL_YYABORT_UNLESS($3 && $7);
add_join_on($7,$10);
Lex->pop_context();
@@ -7409,19 +7832,19 @@ table_factor:
if (!($$= lex->current_select->nest_last_join(lex->thd)))
MYSQL_YYABORT;
}
- | select_derived_init get_select_lex select_derived2
+ | select_derived_init get_select_lex select_derived2
{
LEX *lex= Lex;
SELECT_LEX *sel= lex->current_select;
if ($1)
{
- if (sel->set_braces(1))
- {
+ if (sel->set_braces(1))
+ {
my_parse_error(ER(ER_SYNTAX_ERROR));
- MYSQL_YYABORT;
- }
+ MYSQL_YYABORT;
+ }
/* select in braces, can't contain global parameters */
- if (sel->master_unit()->fake_select_lex)
+ if (sel->master_unit()->fake_select_lex)
sel->master_unit()->global_parameters=
sel->master_unit()->fake_select_lex;
}
@@ -7431,54 +7854,52 @@ table_factor:
/* incomplete derived tables return NULL, we must be
nested in select_derived rule to be here. */
}
- | '(' get_select_lex select_derived union_opt ')' opt_table_alias
- {
- /* Use $2 instead of Lex->current_select as derived table will
- alter value of Lex->current_select. */
-
- if (!($3 || $6) && $2->embedding &&
- !$2->embedding->nested_join->join_list.elements)
- {
- /* we have a derived table ($3 == NULL) but no alias,
- Since we are nested in further parentheses so we
- can pass NULL to the outer level parentheses
- Permits parsing of "((((select ...))) as xyz)" */
- $$= 0;
- }
- else
- if (!$3)
+ | '(' get_select_lex select_derived union_opt ')' opt_table_alias
{
- /* Handle case of derived table, alias may be NULL if there
- are no outer parentheses, add_table_to_list() will throw
- error in this case */
- LEX *lex=Lex;
- SELECT_LEX *sel= lex->current_select;
- SELECT_LEX_UNIT *unit= sel->master_unit();
- lex->current_select= sel= unit->outer_select();
- if (!($$= sel->
- add_table_to_list(lex->thd, new Table_ident(unit), $6, 0,
- TL_READ)))
-
- MYSQL_YYABORT;
- sel->add_joined_table($$);
- lex->pop_context();
+ /* Use $2 instead of Lex->current_select as derived table will
+ alter value of Lex->current_select. */
+
+ if (!($3 || $6) && $2->embedding &&
+ !$2->embedding->nested_join->join_list.elements)
+ {
+ /* we have a derived table ($3 == NULL) but no alias,
+ Since we are nested in further parentheses so we
+ can pass NULL to the outer level parentheses
+ Permits parsing of "((((select ...))) as xyz)" */
+ $$= 0;
+ }
+ else if (!$3)
+ {
+ /* Handle case of derived table, alias may be NULL if there
+ are no outer parentheses, add_table_to_list() will throw
+ error in this case */
+ LEX *lex=Lex;
+ SELECT_LEX *sel= lex->current_select;
+ SELECT_LEX_UNIT *unit= sel->master_unit();
+ lex->current_select= sel= unit->outer_select();
+ if (!($$= sel->add_table_to_list(lex->thd,
+ new Table_ident(unit), $6, 0,
+ TL_READ)))
+
+ MYSQL_YYABORT;
+ sel->add_joined_table($$);
+ lex->pop_context();
+ }
+ else if ($4 || $6)
+ {
+ /* simple nested joins cannot have aliases or unions */
+ my_parse_error(ER(ER_SYNTAX_ERROR));
+ MYSQL_YYABORT;
+ }
+ else
+ $$= $3;
}
- else
- if ($4 || $6)
- {
- /* simple nested joins cannot have aliases or unions */
- my_parse_error(ER(ER_SYNTAX_ERROR));
- MYSQL_YYABORT;
- }
- else
- $$= $3;
- }
;
/* handle contents of parentheses in join expression */
select_derived:
- get_select_lex
- {
+ get_select_lex
+ {
LEX *lex= Lex;
if ($1->init_nested_join(lex->thd))
MYSQL_YYABORT;
@@ -7494,36 +7915,37 @@ select_derived:
if (!$3 && $$)
{
my_parse_error(ER(ER_SYNTAX_ERROR));
- MYSQL_YYABORT;
+ MYSQL_YYABORT;
}
}
- ;
+ ;
select_derived2:
- {
- LEX *lex= Lex;
- lex->derived_tables|= DERIVED_SUBQUERY;
- if (!lex->expr_allows_subselect)
- {
- my_parse_error(ER(ER_SYNTAX_ERROR));
- MYSQL_YYABORT;
- }
- if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE ||
- mysql_new_select(lex, 1))
- MYSQL_YYABORT;
- mysql_init_select(lex);
- lex->current_select->linkage= DERIVED_TABLE_TYPE;
- lex->current_select->parsing_place= SELECT_LIST;
- }
- select_options select_item_list
- {
- Select->parsing_place= NO_MATTER;
- }
- opt_select_from
+ {
+ LEX *lex= Lex;
+ lex->derived_tables|= DERIVED_SUBQUERY;
+ if (!lex->expr_allows_subselect ||
+ lex->sql_command == (int)SQLCOM_PURGE)
+ {
+ my_parse_error(ER(ER_SYNTAX_ERROR));
+ MYSQL_YYABORT;
+ }
+ if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE ||
+ mysql_new_select(lex, 1))
+ MYSQL_YYABORT;
+ mysql_init_select(lex);
+ lex->current_select->linkage= DERIVED_TABLE_TYPE;
+ lex->current_select->parsing_place= SELECT_LIST;
+ }
+ select_options select_item_list
+ {
+ Select->parsing_place= NO_MATTER;
+ }
+ opt_select_from
;
get_select_lex:
- /* Empty */ { $$= Select; }
+ /* Empty */ { $$= Select; }
;
select_derived_init:
@@ -7540,11 +7962,11 @@ select_derived_init:
SELECT_LEX *sel= lex->current_select;
TABLE_LIST *embedding;
if (!sel->embedding || sel->end_nested_join(lex->thd))
- {
+ {
/* we are not in parentheses */
my_parse_error(ER(ER_SYNTAX_ERROR));
- MYSQL_YYABORT;
- }
+ MYSQL_YYABORT;
+ }
embedding= Select->embedding;
$$= embedding &&
!embedding->nested_join->join_list.elements;
@@ -7553,226 +7975,231 @@ select_derived_init:
;
opt_outer:
- /* empty */ {}
- | OUTER {};
+ /* empty */ {}
+ | OUTER {}
+ ;
index_hint_clause:
- /* empty */
- {
+ /* empty */
+ {
$$= global_system_variables.old_mode ?
INDEX_HINT_MASK_JOIN : INDEX_HINT_MASK_ALL;
- }
- | FOR_SYM JOIN_SYM { $$= INDEX_HINT_MASK_JOIN; }
- | FOR_SYM ORDER_SYM BY { $$= INDEX_HINT_MASK_ORDER; }
- | FOR_SYM GROUP_SYM BY { $$= INDEX_HINT_MASK_GROUP; }
- ;
+ }
+ | FOR_SYM JOIN_SYM { $$= INDEX_HINT_MASK_JOIN; }
+ | FOR_SYM ORDER_SYM BY { $$= INDEX_HINT_MASK_ORDER; }
+ | FOR_SYM GROUP_SYM BY { $$= INDEX_HINT_MASK_GROUP; }
+ ;
index_hint_type:
- FORCE_SYM { $$= INDEX_HINT_FORCE; }
- | IGNORE_SYM { $$= INDEX_HINT_IGNORE; }
- ;
+ FORCE_SYM { $$= INDEX_HINT_FORCE; }
+ | IGNORE_SYM { $$= INDEX_HINT_IGNORE; }
+ ;
index_hint_definition:
- index_hint_type key_or_index index_hint_clause
- {
- Select->set_index_hint_type($1, $3);
- }
- '(' key_usage_list ')'
- | USE_SYM key_or_index index_hint_clause
- {
- Select->set_index_hint_type(INDEX_HINT_USE, $3);
- }
- '(' opt_key_usage_list ')'
+ index_hint_type key_or_index index_hint_clause
+ {
+ Select->set_index_hint_type($1, $3);
+ }
+ '(' key_usage_list ')'
+ | USE_SYM key_or_index index_hint_clause
+ {
+ Select->set_index_hint_type(INDEX_HINT_USE, $3);
+ }
+ '(' opt_key_usage_list ')'
;
index_hints_list:
- index_hint_definition
- | index_hints_list index_hint_definition
- ;
+ index_hint_definition
+ | index_hints_list index_hint_definition
+ ;
opt_index_hints_list:
- /* empty */
- | { Select->alloc_index_hints(YYTHD); } index_hints_list
- ;
+ /* empty */
+ | { Select->alloc_index_hints(YYTHD); } index_hints_list
+ ;
opt_key_definition:
- { Select->clear_index_hints(); }
- opt_index_hints_list
- ;
+ { Select->clear_index_hints(); }
+ opt_index_hints_list
+ ;
opt_key_usage_list:
- /* empty */ { Select->add_index_hint(YYTHD, NULL, 0); }
- | key_usage_list {}
- ;
+ /* empty */ { Select->add_index_hint(YYTHD, NULL, 0); }
+ | key_usage_list {}
+ ;
key_usage_element:
- ident { Select->add_index_hint(YYTHD, $1.str, $1.length); }
- | PRIMARY_SYM
- {
- Select->add_index_hint(YYTHD, (char *)"PRIMARY", 7);
- }
+ ident
+ { Select->add_index_hint(YYTHD, $1.str, $1.length); }
+ | PRIMARY_SYM
+ { Select->add_index_hint(YYTHD, (char *)"PRIMARY", 7); }
;
key_usage_list:
- key_usage_element
- | key_usage_list ',' key_usage_element
+ key_usage_element
+ | key_usage_list ',' key_usage_element
;
using_list:
- ident
- {
+ ident
+ {
if (!($$= new List<String>))
- MYSQL_YYABORT;
+ MYSQL_YYABORT;
$$->push_back(new (YYTHD->mem_root)
String((const char *) $1.str, $1.length,
system_charset_info));
- }
- | using_list ',' ident
- {
+ }
+ | using_list ',' ident
+ {
$1->push_back(new (YYTHD->mem_root)
String((const char *) $3.str, $3.length,
system_charset_info));
$$= $1;
- };
+ }
+ ;
interval:
- interval_time_st {}
- | DAY_HOUR_SYM { $$=INTERVAL_DAY_HOUR; }
- | DAY_MICROSECOND_SYM { $$=INTERVAL_DAY_MICROSECOND; }
- | DAY_MINUTE_SYM { $$=INTERVAL_DAY_MINUTE; }
- | DAY_SECOND_SYM { $$=INTERVAL_DAY_SECOND; }
- | HOUR_MICROSECOND_SYM { $$=INTERVAL_HOUR_MICROSECOND; }
- | HOUR_MINUTE_SYM { $$=INTERVAL_HOUR_MINUTE; }
- | HOUR_SECOND_SYM { $$=INTERVAL_HOUR_SECOND; }
- | MICROSECOND_SYM { $$=INTERVAL_MICROSECOND; }
- | MINUTE_MICROSECOND_SYM { $$=INTERVAL_MINUTE_MICROSECOND; }
- | MINUTE_SECOND_SYM { $$=INTERVAL_MINUTE_SECOND; }
- | SECOND_MICROSECOND_SYM { $$=INTERVAL_SECOND_MICROSECOND; }
- | YEAR_MONTH_SYM { $$=INTERVAL_YEAR_MONTH; };
+ interval_time_st {}
+ | DAY_HOUR_SYM { $$=INTERVAL_DAY_HOUR; }
+ | DAY_MICROSECOND_SYM { $$=INTERVAL_DAY_MICROSECOND; }
+ | DAY_MINUTE_SYM { $$=INTERVAL_DAY_MINUTE; }
+ | DAY_SECOND_SYM { $$=INTERVAL_DAY_SECOND; }
+ | HOUR_MICROSECOND_SYM { $$=INTERVAL_HOUR_MICROSECOND; }
+ | HOUR_MINUTE_SYM { $$=INTERVAL_HOUR_MINUTE; }
+ | HOUR_SECOND_SYM { $$=INTERVAL_HOUR_SECOND; }
+ | MICROSECOND_SYM { $$=INTERVAL_MICROSECOND; }
+ | MINUTE_MICROSECOND_SYM { $$=INTERVAL_MINUTE_MICROSECOND; }
+ | MINUTE_SECOND_SYM { $$=INTERVAL_MINUTE_SECOND; }
+ | SECOND_MICROSECOND_SYM { $$=INTERVAL_SECOND_MICROSECOND; }
+ | YEAR_MONTH_SYM { $$=INTERVAL_YEAR_MONTH; }
+ ;
interval_time_st:
- DAY_SYM { $$=INTERVAL_DAY; }
- | WEEK_SYM { $$=INTERVAL_WEEK; }
- | HOUR_SYM { $$=INTERVAL_HOUR; }
- | FRAC_SECOND_SYM { $$=INTERVAL_MICROSECOND; }
- | MINUTE_SYM { $$=INTERVAL_MINUTE; }
- | MONTH_SYM { $$=INTERVAL_MONTH; }
- | QUARTER_SYM { $$=INTERVAL_QUARTER; }
- | SECOND_SYM { $$=INTERVAL_SECOND; }
- | YEAR_SYM { $$=INTERVAL_YEAR; }
+ DAY_SYM { $$=INTERVAL_DAY; }
+ | WEEK_SYM { $$=INTERVAL_WEEK; }
+ | HOUR_SYM { $$=INTERVAL_HOUR; }
+ | FRAC_SECOND_SYM { $$=INTERVAL_MICROSECOND; }
+ | MINUTE_SYM { $$=INTERVAL_MINUTE; }
+ | MONTH_SYM { $$=INTERVAL_MONTH; }
+ | QUARTER_SYM { $$=INTERVAL_QUARTER; }
+ | SECOND_SYM { $$=INTERVAL_SECOND; }
+ | YEAR_SYM { $$=INTERVAL_YEAR; }
;
date_time_type:
- DATE_SYM {$$=MYSQL_TIMESTAMP_DATE;}
- | TIME_SYM {$$=MYSQL_TIMESTAMP_TIME;}
- | DATETIME {$$=MYSQL_TIMESTAMP_DATETIME;}
- | TIMESTAMP {$$=MYSQL_TIMESTAMP_DATETIME;}
+ DATE_SYM {$$=MYSQL_TIMESTAMP_DATE;}
+ | TIME_SYM {$$=MYSQL_TIMESTAMP_TIME;}
+ | DATETIME {$$=MYSQL_TIMESTAMP_DATETIME;}
+ | TIMESTAMP {$$=MYSQL_TIMESTAMP_DATETIME;}
;
table_alias:
- /* empty */
- | AS
- | EQ;
+ /* empty */
+ | AS
+ | EQ
+ ;
opt_table_alias:
- /* empty */ { $$=0; }
- | table_alias ident
- { $$= (LEX_STRING*) sql_memdup(&$2,sizeof(LEX_STRING)); };
+ /* empty */ { $$=0; }
+ | table_alias ident
+ { $$= (LEX_STRING*) sql_memdup(&$2,sizeof(LEX_STRING)); }
+ ;
opt_all:
- /* empty */
- | ALL
- ;
+ /* empty */
+ | ALL
+ ;
where_clause:
- /* empty */ { Select->where= 0; }
- | WHERE
+ /* empty */ { Select->where= 0; }
+ | WHERE
{
Select->parsing_place= IN_WHERE;
}
expr
- {
+ {
SELECT_LEX *select= Select;
- select->where= $3;
+ select->where= $3;
select->parsing_place= NO_MATTER;
- if ($3)
- $3->top_level_item();
- }
- ;
+ if ($3)
+ $3->top_level_item();
+ }
+ ;
having_clause:
- /* empty */
- | HAVING
- {
- Select->parsing_place= IN_HAVING;
- }
- expr
- {
- SELECT_LEX *sel= Select;
- sel->having= $3;
- sel->parsing_place= NO_MATTER;
- if ($3)
- $3->top_level_item();
- }
- ;
+ /* empty */
+ | HAVING
+ {
+ Select->parsing_place= IN_HAVING;
+ }
+ expr
+ {
+ SELECT_LEX *sel= Select;
+ sel->having= $3;
+ sel->parsing_place= NO_MATTER;
+ if ($3)
+ $3->top_level_item();
+ }
+ ;
opt_escape:
- ESCAPE_SYM simple_expr
+ ESCAPE_SYM simple_expr
{
Lex->escape_used= TRUE;
$$= $2;
}
- | /* empty */
+ | /* empty */
{
Lex->escape_used= FALSE;
$$= ((YYTHD->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) ?
- new Item_string("", 0, &my_charset_latin1) :
+ new Item_string("", 0, &my_charset_latin1) :
new Item_string("\\", 1, &my_charset_latin1));
}
;
-
/*
group by statement in select
*/
group_clause:
- /* empty */
- | GROUP_SYM BY group_list olap_opt;
+ /* empty */
+ | GROUP_SYM BY group_list olap_opt
+ ;
group_list:
- group_list ',' order_ident order_dir
- { if (add_group_to_list(YYTHD, $3,(bool) $4)) MYSQL_YYABORT; }
- | order_ident order_dir
- { if (add_group_to_list(YYTHD, $1,(bool) $2)) MYSQL_YYABORT; };
+ group_list ',' order_ident order_dir
+ { if (add_group_to_list(YYTHD, $3,(bool) $4)) MYSQL_YYABORT; }
+ | order_ident order_dir
+ { if (add_group_to_list(YYTHD, $1,(bool) $2)) MYSQL_YYABORT; }
+ ;
olap_opt:
- /* empty */ {}
- | WITH CUBE_SYM
- {
- LEX *lex=Lex;
- if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE)
- {
- my_error(ER_WRONG_USAGE, MYF(0), "WITH CUBE",
- "global union parameters");
- MYSQL_YYABORT;
- }
- lex->current_select->olap= CUBE_TYPE;
- my_error(ER_NOT_SUPPORTED_YET, MYF(0), "CUBE");
- MYSQL_YYABORT; /* To be deleted in 5.1 */
- }
- | WITH ROLLUP_SYM
- {
- LEX *lex= Lex;
- if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE)
- {
- my_error(ER_WRONG_USAGE, MYF(0), "WITH ROLLUP",
- "global union parameters");
- MYSQL_YYABORT;
- }
- lex->current_select->olap= ROLLUP_TYPE;
- }
- ;
+ /* empty */ {}
+ | WITH CUBE_SYM
+ {
+ LEX *lex=Lex;
+ if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE)
+ {
+ my_error(ER_WRONG_USAGE, MYF(0), "WITH CUBE",
+ "global union parameters");
+ MYSQL_YYABORT;
+ }
+ lex->current_select->olap= CUBE_TYPE;
+ my_error(ER_NOT_SUPPORTED_YET, MYF(0), "CUBE");
+ MYSQL_YYABORT; /* To be deleted in 5.1 */
+ }
+ | WITH ROLLUP_SYM
+ {
+ LEX *lex= Lex;
+ if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE)
+ {
+ my_error(ER_WRONG_USAGE, MYF(0), "WITH ROLLUP",
+ "global union parameters");
+ MYSQL_YYABORT;
+ }
+ lex->current_select->olap= ROLLUP_TYPE;
+ }
+ ;
/*
Order by statement in ALTER TABLE
@@ -7802,163 +8229,172 @@ alter_order_item:
*/
opt_order_clause:
- /* empty */
- | order_clause;
+ /* empty */
+ | order_clause
+ ;
order_clause:
- ORDER_SYM BY
- {
- LEX *lex=Lex;
- SELECT_LEX *sel= lex->current_select;
- SELECT_LEX_UNIT *unit= sel-> master_unit();
- if (sel->linkage != GLOBAL_OPTIONS_TYPE &&
- sel->olap != UNSPECIFIED_OLAP_TYPE)
- {
- my_error(ER_WRONG_USAGE, MYF(0),
- "CUBE/ROLLUP", "ORDER BY");
- MYSQL_YYABORT;
- }
- if (lex->sql_command != SQLCOM_ALTER_TABLE && !unit->fake_select_lex)
+ ORDER_SYM BY
{
- /*
- A query of the of the form (SELECT ...) ORDER BY order_list is
- executed in the same way as the query
- SELECT ... ORDER BY order_list
- unless the SELECT construct contains ORDER BY or LIMIT clauses.
- Otherwise we create a fake SELECT_LEX if it has not been created
- yet.
- */
- SELECT_LEX *first_sl= unit->first_select();
- if (!unit->is_union() &&
- (first_sl->order_list.elements ||
- first_sl->select_limit) &&
- unit->add_fake_select_lex(lex->thd))
+ LEX *lex=Lex;
+ SELECT_LEX *sel= lex->current_select;
+ SELECT_LEX_UNIT *unit= sel-> master_unit();
+ if (sel->linkage != GLOBAL_OPTIONS_TYPE &&
+ sel->olap != UNSPECIFIED_OLAP_TYPE)
+ {
+ my_error(ER_WRONG_USAGE, MYF(0),
+ "CUBE/ROLLUP", "ORDER BY");
MYSQL_YYABORT;
+ }
+ if (lex->sql_command != SQLCOM_ALTER_TABLE && !unit->fake_select_lex)
+ {
+ /*
+ A query of the of the form (SELECT ...) ORDER BY order_list is
+ executed in the same way as the query
+ SELECT ... ORDER BY order_list
+ unless the SELECT construct contains ORDER BY or LIMIT clauses.
+ Otherwise we create a fake SELECT_LEX if it has not been created
+ yet.
+ */
+ SELECT_LEX *first_sl= unit->first_select();
+ if (!unit->is_union() &&
+ (first_sl->order_list.elements ||
+ first_sl->select_limit) &&
+ unit->add_fake_select_lex(lex->thd))
+ MYSQL_YYABORT;
+ }
}
- } order_list;
+ order_list
+ ;
order_list:
- order_list ',' order_ident order_dir
- { if (add_order_to_list(YYTHD, $3,(bool) $4)) MYSQL_YYABORT; }
- | order_ident order_dir
- { if (add_order_to_list(YYTHD, $1,(bool) $2)) MYSQL_YYABORT; };
+ order_list ',' order_ident order_dir
+ { if (add_order_to_list(YYTHD, $3,(bool) $4)) MYSQL_YYABORT; }
+ | order_ident order_dir
+ { if (add_order_to_list(YYTHD, $1,(bool) $2)) MYSQL_YYABORT; }
+ ;
order_dir:
- /* empty */ { $$ = 1; }
- | ASC { $$ =1; }
- | DESC { $$ =0; };
-
+ /* empty */ { $$ = 1; }
+ | ASC { $$ =1; }
+ | DESC { $$ =0; }
+ ;
opt_limit_clause_init:
- /* empty */
- {
- LEX *lex= Lex;
- SELECT_LEX *sel= lex->current_select;
- sel->offset_limit= 0;
- sel->select_limit= 0;
- }
- | limit_clause {}
- ;
+ /* empty */
+ {
+ LEX *lex= Lex;
+ SELECT_LEX *sel= lex->current_select;
+ sel->offset_limit= 0;
+ sel->select_limit= 0;
+ }
+ | limit_clause {}
+ ;
opt_limit_clause:
- /* empty */ {}
- | limit_clause {}
- ;
+ /* empty */ {}
+ | limit_clause {}
+ ;
limit_clause:
- LIMIT limit_options {}
- ;
+ LIMIT limit_options {}
+ ;
limit_options:
- limit_option
- {
+ limit_option
+ {
SELECT_LEX *sel= Select;
sel->select_limit= $1;
sel->offset_limit= 0;
- sel->explicit_limit= 1;
- }
- | limit_option ',' limit_option
- {
- SELECT_LEX *sel= Select;
- sel->select_limit= $3;
- sel->offset_limit= $1;
- sel->explicit_limit= 1;
- }
- | limit_option OFFSET_SYM limit_option
- {
- SELECT_LEX *sel= Select;
- sel->select_limit= $1;
- sel->offset_limit= $3;
- sel->explicit_limit= 1;
- }
- ;
+ sel->explicit_limit= 1;
+ }
+ | limit_option ',' limit_option
+ {
+ SELECT_LEX *sel= Select;
+ sel->select_limit= $3;
+ sel->offset_limit= $1;
+ sel->explicit_limit= 1;
+ }
+ | limit_option OFFSET_SYM limit_option
+ {
+ SELECT_LEX *sel= Select;
+ sel->select_limit= $1;
+ sel->offset_limit= $3;
+ sel->explicit_limit= 1;
+ }
+ ;
+
limit_option:
- param_marker
+ param_marker
+ {
+ ((Item_param *) $1)->set_strict_type(INT_RESULT);
+ }
| ULONGLONG_NUM { $$= new Item_uint($1.str, $1.length); }
- | LONG_NUM { $$= new Item_uint($1.str, $1.length); }
+ | LONG_NUM { $$= new Item_uint($1.str, $1.length); }
| NUM { $$= new Item_uint($1.str, $1.length); }
;
delete_limit_clause:
- /* empty */
- {
- LEX *lex=Lex;
- lex->current_select->select_limit= 0;
- }
- | LIMIT limit_option
- {
- SELECT_LEX *sel= Select;
- sel->select_limit= $2;
- sel->explicit_limit= 1;
- };
+ /* empty */
+ {
+ LEX *lex=Lex;
+ lex->current_select->select_limit= 0;
+ }
+ | LIMIT limit_option
+ {
+ SELECT_LEX *sel= Select;
+ sel->select_limit= $2;
+ sel->explicit_limit= 1;
+ }
+ ;
ulong_num:
NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
- | HEX_NUM { $$= (ulong) strtol($1.str, (char**) 0, 16); }
- | LONG_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
- | ULONGLONG_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
+ | HEX_NUM { $$= (ulong) strtol($1.str, (char**) 0, 16); }
+ | LONG_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
+ | ULONGLONG_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
| DECIMAL_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
- | FLOAT_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
+ | FLOAT_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
;
real_ulong_num:
NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
- | HEX_NUM { $$= (ulong) strtol($1.str, (char**) 0, 16); }
- | LONG_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
- | ULONGLONG_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
+ | HEX_NUM { $$= (ulong) strtol($1.str, (char**) 0, 16); }
+ | LONG_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
+ | ULONGLONG_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
| dec_num_error { MYSQL_YYABORT; }
;
ulonglong_num:
- NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
- | ULONGLONG_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
- | LONG_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
- | DECIMAL_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
- | FLOAT_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
- ;
+ NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
+ | ULONGLONG_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
+ | LONG_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
+ | DECIMAL_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
+ | FLOAT_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
+ ;
real_ulonglong_num:
- NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
- | ULONGLONG_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
- | LONG_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
+ NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
+ | ULONGLONG_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
+ | LONG_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
| dec_num_error { MYSQL_YYABORT; }
;
dec_num_error:
- dec_num
- { my_parse_error(ER(ER_ONLY_INTEGERS_ALLOWED)); }
+ dec_num
+ { my_parse_error(ER(ER_ONLY_INTEGERS_ALLOWED)); }
;
dec_num:
- DECIMAL_NUM
- | FLOAT_NUM
+ DECIMAL_NUM
+ | FLOAT_NUM
;
procedure_clause:
- /* empty */
- | PROCEDURE ident /* Procedure name */
- {
- LEX *lex=Lex;
+ /* empty */
+ | PROCEDURE ident /* Procedure name */
+ {
+ LEX *lex=Lex;
if (! lex->parsing_options.allows_select_procedure)
{
@@ -7966,224 +8402,227 @@ procedure_clause:
MYSQL_YYABORT;
}
- if (&lex->select_lex != lex->current_select)
- {
- my_error(ER_WRONG_USAGE, MYF(0), "PROCEDURE", "subquery");
- MYSQL_YYABORT;
- }
- lex->proc_list.elements=0;
- lex->proc_list.first=0;
- lex->proc_list.next= (byte**) &lex->proc_list.first;
- if (add_proc_to_list(lex->thd, new Item_field(&lex->
+ if (&lex->select_lex != lex->current_select)
+ {
+ my_error(ER_WRONG_USAGE, MYF(0), "PROCEDURE", "subquery");
+ MYSQL_YYABORT;
+ }
+ lex->proc_list.elements=0;
+ lex->proc_list.first=0;
+ lex->proc_list.next= (uchar**) &lex->proc_list.first;
+ if (add_proc_to_list(lex->thd, new Item_field(&lex->
current_select->
context,
NULL,NULL,$2.str)))
- MYSQL_YYABORT;
- Lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
- }
- '(' procedure_list ')';
-
+ MYSQL_YYABORT;
+ Lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
+ }
+ '(' procedure_list ')'
+ ;
procedure_list:
- /* empty */ {}
- | procedure_list2 {};
+ /* empty */ {}
+ | procedure_list2 {}
+ ;
procedure_list2:
- procedure_list2 ',' procedure_item
- | procedure_item;
+ procedure_list2 ',' procedure_item
+ | procedure_item
+ ;
procedure_item:
- remember_name expr
- {
- LEX *lex= Lex;
- if (add_proc_to_list(lex->thd, $2))
- MYSQL_YYABORT;
- if (!$2->name)
- $2->set_name($1,(uint) ((char*) lex->tok_end - $1),
- YYTHD->charset());
- }
- ;
+ remember_name expr remember_end
+ {
+ THD *thd= YYTHD;
+ if (add_proc_to_list(thd, $2))
+ MYSQL_YYABORT;
+ if (!$2->name)
+ $2->set_name($1, (uint) ($3 - $1), thd->charset());
+ }
+ ;
select_var_list_init:
- {
- LEX *lex=Lex;
- if (!lex->describe && (!(lex->result= new select_dumpvar())))
- MYSQL_YYABORT;
- }
- select_var_list
- {}
- ;
+ {
+ LEX *lex=Lex;
+ if (!lex->describe && (!(lex->result= new select_dumpvar())))
+ MYSQL_YYABORT;
+ }
+ select_var_list
+ {}
+ ;
select_var_list:
- select_var_list ',' select_var_ident
- | select_var_ident {}
- ;
+ select_var_list ',' select_var_ident
+ | select_var_ident {}
+ ;
select_var_ident:
- '@' ident_or_text
- {
- LEX *lex=Lex;
- if (lex->result)
- ((select_dumpvar *)lex->result)->var_list.push_back( new my_var($2,0,0,(enum_field_types)0));
- else
- /*
- The parser won't create select_result instance only
- if it's an EXPLAIN.
- */
- DBUG_ASSERT(lex->describe);
- }
- | ident_or_text
- {
- LEX *lex=Lex;
- sp_variable_t *t;
-
- if (!lex->spcont || !(t=lex->spcont->find_variable(&$1)))
- {
- my_error(ER_SP_UNDECLARED_VAR, MYF(0), $1.str);
- MYSQL_YYABORT;
- }
- if (lex->result)
- {
- my_var *var;
- ((select_dumpvar *)lex->result)->
- var_list.push_back(var= new my_var($1,1,t->offset,t->type));
+ '@' ident_or_text
+ {
+ LEX *lex=Lex;
+ if (lex->result)
+ ((select_dumpvar *)lex->result)->var_list.push_back( new my_var($2,0,0,(enum_field_types)0));
+ else
+ /*
+ The parser won't create select_result instance only
+ if it's an EXPLAIN.
+ */
+ DBUG_ASSERT(lex->describe);
+ }
+ | ident_or_text
+ {
+ LEX *lex=Lex;
+ sp_variable_t *t;
+
+ if (!lex->spcont || !(t=lex->spcont->find_variable(&$1)))
+ {
+ my_error(ER_SP_UNDECLARED_VAR, MYF(0), $1.str);
+ MYSQL_YYABORT;
+ }
+ if (lex->result)
+ {
+ my_var *var;
+ ((select_dumpvar *)lex->result)->
+ var_list.push_back(var= new my_var($1,1,t->offset,t->type));
#ifndef DBUG_OFF
- if (var)
- var->sp= lex->sphead;
+ if (var)
+ var->sp= lex->sphead;
#endif
- }
- else
- {
- /*
- The parser won't create select_result instance only
- if it's an EXPLAIN.
- */
- DBUG_ASSERT(lex->describe);
- }
- }
- ;
+ }
+ else
+ {
+ /*
+ The parser won't create select_result instance only
+ if it's an EXPLAIN.
+ */
+ DBUG_ASSERT(lex->describe);
+ }
+ }
+ ;
into:
- INTO
- {
- if (! Lex->parsing_options.allows_select_into)
+ INTO
{
- my_error(ER_VIEW_SELECT_CLAUSE, MYF(0), "INTO");
- MYSQL_YYABORT;
+ if (! Lex->parsing_options.allows_select_into)
+ {
+ my_error(ER_VIEW_SELECT_CLAUSE, MYF(0), "INTO");
+ MYSQL_YYABORT;
+ }
}
- }
- into_destination
+ into_destination
;
into_destination:
- OUTFILE TEXT_STRING_filesystem
- {
- LEX *lex= Lex;
- lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
- if (!(lex->exchange= new sql_exchange($2.str, 0)) ||
- !(lex->result= new select_export(lex->exchange)))
- MYSQL_YYABORT;
- }
- opt_field_term opt_line_term
- | DUMPFILE TEXT_STRING_filesystem
- {
- LEX *lex=Lex;
- if (!lex->describe)
- {
- lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
- if (!(lex->exchange= new sql_exchange($2.str,1)))
- MYSQL_YYABORT;
- if (!(lex->result= new select_dump(lex->exchange)))
- MYSQL_YYABORT;
- }
- }
+ OUTFILE TEXT_STRING_filesystem
+ {
+ LEX *lex= Lex;
+ lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
+ if (!(lex->exchange= new sql_exchange($2.str, 0)) ||
+ !(lex->result= new select_export(lex->exchange)))
+ MYSQL_YYABORT;
+ }
+ opt_field_term opt_line_term
+ | DUMPFILE TEXT_STRING_filesystem
+ {
+ LEX *lex=Lex;
+ if (!lex->describe)
+ {
+ lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
+ if (!(lex->exchange= new sql_exchange($2.str,1)))
+ MYSQL_YYABORT;
+ if (!(lex->result= new select_dump(lex->exchange)))
+ MYSQL_YYABORT;
+ }
+ }
| select_var_list_init
- {
- Lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
- }
+ {
+ Lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
+ }
;
/*
DO statement
*/
-do: DO_SYM
- {
- LEX *lex=Lex;
- lex->sql_command = SQLCOM_DO;
- mysql_init_select(lex);
- }
- expr_list
- {
- Lex->insert_list= $3;
- }
- ;
+do:
+ DO_SYM
+ {
+ LEX *lex=Lex;
+ lex->sql_command = SQLCOM_DO;
+ mysql_init_select(lex);
+ }
+ expr_list
+ {
+ Lex->insert_list= $3;
+ }
+ ;
/*
Drop : delete tables or index or user
*/
drop:
- DROP opt_temporary table_or_tables if_exists table_list opt_restrict
- {
- LEX *lex=Lex;
- lex->sql_command = SQLCOM_DROP_TABLE;
- lex->drop_temporary= $2;
- lex->drop_if_exists= $4;
- }
- | DROP INDEX_SYM ident ON table_ident {}
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_DROP_INDEX;
- lex->alter_info.drop_list.empty();
- lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY,
- $3.str));
- if (!lex->current_select->add_table_to_list(lex->thd, $5, NULL,
- TL_OPTION_UPDATING))
- MYSQL_YYABORT;
- }
- | DROP DATABASE if_exists ident
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_DROP_DB;
- lex->drop_if_exists=$3;
- lex->name= $4;
- }
- | DROP FUNCTION_SYM if_exists sp_name
- {
- LEX *lex=Lex;
- if (lex->sphead)
- {
- my_error(ER_SP_NO_DROP_SP, MYF(0), "FUNCTION");
- MYSQL_YYABORT;
- }
- lex->sql_command = SQLCOM_DROP_FUNCTION;
- lex->drop_if_exists= $3;
- lex->spname= $4;
- }
- | DROP PROCEDURE if_exists sp_name
- {
- LEX *lex=Lex;
- if (lex->sphead)
- {
- my_error(ER_SP_NO_DROP_SP, MYF(0), "PROCEDURE");
- MYSQL_YYABORT;
- }
- lex->sql_command = SQLCOM_DROP_PROCEDURE;
- lex->drop_if_exists= $3;
- lex->spname= $4;
- }
- | DROP USER clear_privileges user_list
- {
- Lex->sql_command = SQLCOM_DROP_USER;
- }
- | DROP VIEW_SYM if_exists table_list opt_restrict
- {
- LEX *lex= Lex;
- lex->sql_command= SQLCOM_DROP_VIEW;
- lex->drop_if_exists= $3;
- }
+ DROP opt_temporary table_or_tables if_exists table_list opt_restrict
+ {
+ LEX *lex=Lex;
+ lex->sql_command = SQLCOM_DROP_TABLE;
+ lex->drop_temporary= $2;
+ lex->drop_if_exists= $4;
+ }
+ | DROP INDEX_SYM ident ON table_ident {}
+ {
+ LEX *lex=Lex;
+ lex->sql_command= SQLCOM_DROP_INDEX;
+ lex->alter_info.reset();
+ lex->alter_info.flags= ALTER_DROP_INDEX;
+ lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY,
+ $3.str));
+ if (!lex->current_select->add_table_to_list(lex->thd, $5, NULL,
+ TL_OPTION_UPDATING))
+ MYSQL_YYABORT;
+ }
+ | DROP DATABASE if_exists ident
+ {
+ LEX *lex=Lex;
+ lex->sql_command= SQLCOM_DROP_DB;
+ lex->drop_if_exists=$3;
+ lex->name= $4;
+ }
+ | DROP FUNCTION_SYM if_exists sp_name
+ {
+ LEX *lex=Lex;
+ if (lex->sphead)
+ {
+ my_error(ER_SP_NO_DROP_SP, MYF(0), "FUNCTION");
+ MYSQL_YYABORT;
+ }
+ lex->sql_command = SQLCOM_DROP_FUNCTION;
+ lex->drop_if_exists= $3;
+ lex->spname= $4;
+ }
+ | DROP PROCEDURE if_exists sp_name
+ {
+ LEX *lex=Lex;
+ if (lex->sphead)
+ {
+ my_error(ER_SP_NO_DROP_SP, MYF(0), "PROCEDURE");
+ MYSQL_YYABORT;
+ }
+ lex->sql_command = SQLCOM_DROP_PROCEDURE;
+ lex->drop_if_exists= $3;
+ lex->spname= $4;
+ }
+ | DROP USER clear_privileges user_list
+ {
+ Lex->sql_command = SQLCOM_DROP_USER;
+ }
+ | DROP VIEW_SYM if_exists table_list opt_restrict
+ {
+ LEX *lex= Lex;
+ lex->sql_command= SQLCOM_DROP_VIEW;
+ lex->drop_if_exists= $3;
+ }
| DROP EVENT_SYM if_exists sp_name
{
Lex->drop_if_exists= $3;
@@ -8196,7 +8635,7 @@ drop:
lex->sql_command= SQLCOM_DROP_TRIGGER;
lex->drop_if_exists= $3;
lex->spname= $4;
- }
+ }
| DROP TABLESPACE tablespace_name opt_ts_engine opt_ts_wait
{
LEX *lex= Lex;
@@ -8206,79 +8645,95 @@ drop:
{
LEX *lex= Lex;
lex->alter_tablespace_info->ts_cmd_type= DROP_LOGFILE_GROUP;
- }
+ }
| DROP SERVER_SYM if_exists ident_or_text
- {
- Lex->sql_command = SQLCOM_DROP_SERVER;
- Lex->drop_if_exists= $3;
- Lex->server_options.server_name= $4.str;
- Lex->server_options.server_name_length= $4.length;
- }
- ;
+ {
+ Lex->sql_command = SQLCOM_DROP_SERVER;
+ Lex->drop_if_exists= $3;
+ Lex->server_options.server_name= $4.str;
+ Lex->server_options.server_name_length= $4.length;
+ }
+ ;
table_list:
- table_name
- | table_list ',' table_name;
+ table_name
+ | table_list ',' table_name
+ ;
table_name:
+ table_ident
+ {
+ if (!Select->add_table_to_list(YYTHD, $1, NULL, TL_OPTION_UPDATING))
+ MYSQL_YYABORT;
+ }
+ ;
+
+table_alias_ref_list:
+ table_alias_ref
+ | table_alias_ref_list ',' table_alias_ref;
+
+table_alias_ref:
table_ident
{
- if (!Select->add_table_to_list(YYTHD, $1, NULL, TL_OPTION_UPDATING))
+ if (!Select->add_table_to_list(YYTHD, $1, NULL,
+ TL_OPTION_UPDATING | TL_OPTION_ALIAS,
+ Lex->lock_option ))
MYSQL_YYABORT;
}
;
if_exists:
- /* empty */ { $$= 0; }
- | IF EXISTS { $$= 1; }
- ;
+ /* empty */ { $$= 0; }
+ | IF EXISTS { $$= 1; }
+ ;
opt_temporary:
- /* empty */ { $$= 0; }
- | TEMPORARY { $$= 1; }
- ;
+ /* empty */ { $$= 0; }
+ | TEMPORARY { $$= 1; }
+ ;
/*
** Insert : add new data to table
*/
insert:
- INSERT
- {
- LEX *lex= Lex;
- lex->sql_command= SQLCOM_INSERT;
- lex->duplicates= DUP_ERROR;
- mysql_init_select(lex);
- /* for subselects */
- lex->lock_option= (using_update_log) ? TL_READ_NO_INSERT : TL_READ;
- } insert_lock_option
- opt_ignore insert2
- {
- Select->set_lock_for_tables($3);
- Lex->current_select= &Lex->select_lex;
- }
- insert_field_spec opt_insert_update
- {}
- ;
+ INSERT
+ {
+ LEX *lex= Lex;
+ lex->sql_command= SQLCOM_INSERT;
+ lex->duplicates= DUP_ERROR;
+ mysql_init_select(lex);
+ /* for subselects */
+ lex->lock_option= (using_update_log) ? TL_READ_NO_INSERT : TL_READ;
+ }
+ insert_lock_option
+ opt_ignore insert2
+ {
+ Select->set_lock_for_tables($3);
+ Lex->current_select= &Lex->select_lex;
+ }
+ insert_field_spec opt_insert_update
+ {}
+ ;
replace:
- REPLACE
- {
- LEX *lex=Lex;
- lex->sql_command = SQLCOM_REPLACE;
- lex->duplicates= DUP_REPLACE;
- mysql_init_select(lex);
- }
- replace_lock_option insert2
- {
- Select->set_lock_for_tables($3);
- Lex->current_select= &Lex->select_lex;
- }
- insert_field_spec
- {}
- ;
+ REPLACE
+ {
+ LEX *lex=Lex;
+ lex->sql_command = SQLCOM_REPLACE;
+ lex->duplicates= DUP_REPLACE;
+ mysql_init_select(lex);
+ }
+ replace_lock_option insert2
+ {
+ Select->set_lock_for_tables($3);
+ Lex->current_select= &Lex->select_lex;
+ }
+ insert_field_spec
+ {}
+ ;
insert_lock_option:
- /* empty */
+ /* empty */
{
#ifdef HAVE_QUERY_CACHE
/*
@@ -8286,279 +8741,301 @@ insert_lock_option:
insert visible only after the table unlocking but everyone can
read table.
*/
- $$= (Lex->sphead ? TL_WRITE :TL_WRITE_CONCURRENT_INSERT);
+ $$= (Lex->sphead ? TL_WRITE_DEFAULT : TL_WRITE_CONCURRENT_INSERT);
#else
$$= TL_WRITE_CONCURRENT_INSERT;
#endif
}
- | LOW_PRIORITY { $$= TL_WRITE_LOW_PRIORITY; }
- | DELAYED_SYM { $$= TL_WRITE_DELAYED; }
- | HIGH_PRIORITY { $$= TL_WRITE; }
- ;
+ | LOW_PRIORITY { $$= TL_WRITE_LOW_PRIORITY; }
+ | DELAYED_SYM { $$= TL_WRITE_DELAYED; }
+ | HIGH_PRIORITY { $$= TL_WRITE; }
+ ;
replace_lock_option:
- opt_low_priority { $$= $1; }
- | DELAYED_SYM { $$= TL_WRITE_DELAYED; };
+ opt_low_priority { $$= $1; }
+ | DELAYED_SYM { $$= TL_WRITE_DELAYED; }
+ ;
insert2:
- INTO insert_table {}
- | insert_table {};
+ INTO insert_table {}
+ | insert_table {}
+ ;
insert_table:
- table_name
- {
- LEX *lex=Lex;
- lex->field_list.empty();
- lex->many_values.empty();
- lex->insert_list=0;
- };
+ table_name
+ {
+ LEX *lex=Lex;
+ lex->field_list.empty();
+ lex->many_values.empty();
+ lex->insert_list=0;
+ };
insert_field_spec:
- insert_values {}
- | '(' ')' insert_values {}
- | '(' fields ')' insert_values {}
- | SET
- {
- LEX *lex=Lex;
- if (!(lex->insert_list = new List_item) ||
- lex->many_values.push_back(lex->insert_list))
- MYSQL_YYABORT;
- }
- ident_eq_list;
+ insert_values {}
+ | '(' ')' insert_values {}
+ | '(' fields ')' insert_values {}
+ | SET
+ {
+ LEX *lex=Lex;
+ if (!(lex->insert_list = new List_item) ||
+ lex->many_values.push_back(lex->insert_list))
+ MYSQL_YYABORT;
+ }
+ ident_eq_list
+ ;
fields:
- fields ',' insert_ident { Lex->field_list.push_back($3); }
- | insert_ident { Lex->field_list.push_back($1); };
+ fields ',' insert_ident { Lex->field_list.push_back($3); }
+ | insert_ident { Lex->field_list.push_back($1); }
+ ;
insert_values:
- VALUES values_list {}
- | VALUE_SYM values_list {}
- | create_select { Select->set_braces(0);} union_clause {}
- | '(' create_select ')' { Select->set_braces(1);} union_opt {}
+ VALUES values_list {}
+ | VALUE_SYM values_list {}
+ | create_select
+ { Select->set_braces(0);}
+ union_clause {}
+ | '(' create_select ')'
+ { Select->set_braces(1);}
+ union_opt {}
;
values_list:
- values_list ',' no_braces
- | no_braces;
+ values_list ',' no_braces
+ | no_braces
+ ;
ident_eq_list:
- ident_eq_list ',' ident_eq_value
- |
- ident_eq_value;
+ ident_eq_list ',' ident_eq_value
+ | ident_eq_value
+ ;
ident_eq_value:
- simple_ident_nospvar equal expr_or_default
- {
- LEX *lex=Lex;
- if (lex->field_list.push_back($1) ||
- lex->insert_list->push_back($3))
- MYSQL_YYABORT;
- };
+ simple_ident_nospvar equal expr_or_default
+ {
+ LEX *lex=Lex;
+ if (lex->field_list.push_back($1) ||
+ lex->insert_list->push_back($3))
+ MYSQL_YYABORT;
+ }
+ ;
-equal: EQ {}
- | SET_VAR {}
- ;
+equal:
+ EQ {}
+ | SET_VAR {}
+ ;
opt_equal:
- /* empty */ {}
- | equal {}
- ;
+ /* empty */ {}
+ | equal {}
+ ;
no_braces:
- '('
- {
- if (!(Lex->insert_list = new List_item))
- MYSQL_YYABORT;
- }
- opt_values ')'
- {
- LEX *lex=Lex;
- if (lex->many_values.push_back(lex->insert_list))
- MYSQL_YYABORT;
- };
+ '('
+ {
+ if (!(Lex->insert_list = new List_item))
+ MYSQL_YYABORT;
+ }
+ opt_values ')'
+ {
+ LEX *lex=Lex;
+ if (lex->many_values.push_back(lex->insert_list))
+ MYSQL_YYABORT;
+ }
+ ;
opt_values:
- /* empty */ {}
- | values;
+ /* empty */ {}
+ | values
+ ;
values:
- values ',' expr_or_default
- {
- if (Lex->insert_list->push_back($3))
- MYSQL_YYABORT;
- }
- | expr_or_default
- {
- if (Lex->insert_list->push_back($1))
- MYSQL_YYABORT;
- }
- ;
+ values ',' expr_or_default
+ {
+ if (Lex->insert_list->push_back($3))
+ MYSQL_YYABORT;
+ }
+ | expr_or_default
+ {
+ if (Lex->insert_list->push_back($1))
+ MYSQL_YYABORT;
+ }
+ ;
expr_or_default:
- expr { $$= $1;}
- | DEFAULT {$$= new Item_default_value(Lex->current_context()); }
- ;
+ expr { $$= $1;}
+ | DEFAULT {$$= new Item_default_value(Lex->current_context()); }
+ ;
opt_insert_update:
- /* empty */
- | ON DUPLICATE_SYM { Lex->duplicates= DUP_UPDATE; }
+ /* empty */
+ | ON DUPLICATE_SYM { Lex->duplicates= DUP_UPDATE; }
KEY_SYM UPDATE_SYM insert_update_list
;
/* Update rows in a table */
update:
- UPDATE_SYM
- {
- LEX *lex= Lex;
- mysql_init_select(lex);
- lex->sql_command= SQLCOM_UPDATE;
- lex->lock_option= TL_UNLOCK; /* Will be set later */
- lex->duplicates= DUP_ERROR;
- }
- opt_low_priority opt_ignore join_table_list
- SET update_list
- {
- LEX *lex= Lex;
- if (lex->select_lex.table_list.elements > 1)
- lex->sql_command= SQLCOM_UPDATE_MULTI;
- else if (lex->select_lex.get_table_list()->derived)
- {
- /* it is single table update and it is update of derived table */
- my_error(ER_NON_UPDATABLE_TABLE, MYF(0),
- lex->select_lex.get_table_list()->alias, "UPDATE");
- MYSQL_YYABORT;
- }
- /*
- In case of multi-update setting write lock for all tables may
- be too pessimistic. We will decrease lock level if possible in
- mysql_multi_update().
- */
- Select->set_lock_for_tables($3);
- }
- where_clause opt_order_clause delete_limit_clause {}
- ;
+ UPDATE_SYM
+ {
+ LEX *lex= Lex;
+ mysql_init_select(lex);
+ lex->sql_command= SQLCOM_UPDATE;
+ lex->lock_option= TL_UNLOCK; /* Will be set later */
+ lex->duplicates= DUP_ERROR;
+ }
+ opt_low_priority opt_ignore join_table_list
+ SET update_list
+ {
+ LEX *lex= Lex;
+ if (lex->select_lex.table_list.elements > 1)
+ lex->sql_command= SQLCOM_UPDATE_MULTI;
+ else if (lex->select_lex.get_table_list()->derived)
+ {
+ /* it is single table update and it is update of derived table */
+ my_error(ER_NON_UPDATABLE_TABLE, MYF(0),
+ lex->select_lex.get_table_list()->alias, "UPDATE");
+ MYSQL_YYABORT;
+ }
+ /*
+ In case of multi-update setting write lock for all tables may
+ be too pessimistic. We will decrease lock level if possible in
+ mysql_multi_update().
+ */
+ Select->set_lock_for_tables($3);
+ }
+ where_clause opt_order_clause delete_limit_clause {}
+ ;
update_list:
- update_list ',' update_elem
- | update_elem;
+ update_list ',' update_elem
+ | update_elem
+ ;
update_elem:
- simple_ident_nospvar equal expr_or_default
- {
- if (add_item_to_list(YYTHD, $1) || add_value_to_list(YYTHD, $3))
- MYSQL_YYABORT;
- };
+ simple_ident_nospvar equal expr_or_default
+ {
+ if (add_item_to_list(YYTHD, $1) || add_value_to_list(YYTHD, $3))
+ MYSQL_YYABORT;
+ }
+ ;
insert_update_list:
- insert_update_list ',' insert_update_elem
- | insert_update_elem;
+ insert_update_list ',' insert_update_elem
+ | insert_update_elem
+ ;
insert_update_elem:
- simple_ident_nospvar equal expr_or_default
- {
- LEX *lex= Lex;
- if (lex->update_list.push_back($1) ||
- lex->value_list.push_back($3))
- MYSQL_YYABORT;
- };
+ simple_ident_nospvar equal expr_or_default
+ {
+ LEX *lex= Lex;
+ if (lex->update_list.push_back($1) ||
+ lex->value_list.push_back($3))
+ MYSQL_YYABORT;
+ }
+ ;
opt_low_priority:
- /* empty */ { $$= YYTHD->update_lock_default; }
- | LOW_PRIORITY { $$= TL_WRITE_LOW_PRIORITY; };
+ /* empty */ { $$= TL_WRITE_DEFAULT; }
+ | LOW_PRIORITY { $$= TL_WRITE_LOW_PRIORITY; }
+ ;
/* Delete rows from a table */
delete:
- DELETE_SYM
- {
- LEX *lex= Lex;
- lex->sql_command= SQLCOM_DELETE;
- mysql_init_select(lex);
- lex->lock_option= lex->thd->update_lock_default;
- lex->ignore= 0;
- lex->select_lex.init_order();
- }
- opt_delete_options single_multi {}
- ;
+ DELETE_SYM
+ {
+ LEX *lex= Lex;
+ lex->sql_command= SQLCOM_DELETE;
+ mysql_init_select(lex);
+ lex->lock_option= TL_WRITE_DEFAULT;
+ lex->ignore= 0;
+ lex->select_lex.init_order();
+ }
+ opt_delete_options single_multi {}
+ ;
single_multi:
- FROM table_ident
- {
- if (!Select->add_table_to_list(YYTHD, $2, NULL, TL_OPTION_UPDATING,
- Lex->lock_option))
- MYSQL_YYABORT;
- }
- where_clause opt_order_clause
- delete_limit_clause {}
- | table_wild_list
- { mysql_init_multi_delete(Lex); }
+ FROM table_ident
+ {
+ if (!Select->add_table_to_list(YYTHD, $2, NULL, TL_OPTION_UPDATING,
+ Lex->lock_option))
+ MYSQL_YYABORT;
+ }
+ where_clause opt_order_clause
+ delete_limit_clause {}
+ | table_wild_list
+ { mysql_init_multi_delete(Lex); }
FROM join_table_list where_clause
{
if (multi_delete_set_locks_and_link_aux_tables(Lex))
MYSQL_YYABORT;
}
- | FROM table_wild_list
- { mysql_init_multi_delete(Lex); }
- USING join_table_list where_clause
+ | FROM table_alias_ref_list
+ { mysql_init_multi_delete(Lex); }
+ USING join_table_list where_clause
{
if (multi_delete_set_locks_and_link_aux_tables(Lex))
MYSQL_YYABORT;
}
- ;
+ ;
table_wild_list:
- table_wild_one {}
- | table_wild_list ',' table_wild_one {};
+ table_wild_one {}
+ | table_wild_list ',' table_wild_one {}
+ ;
table_wild_one:
- ident opt_wild opt_table_alias
- {
- if (!Select->add_table_to_list(YYTHD, new Table_ident($1), $3,
- TL_OPTION_UPDATING |
- TL_OPTION_ALIAS, Lex->lock_option))
- MYSQL_YYABORT;
- }
- | ident '.' ident opt_wild opt_table_alias
- {
- if (!Select->add_table_to_list(YYTHD,
- new Table_ident(YYTHD, $1, $3, 0),
- $5,
- TL_OPTION_UPDATING |
- TL_OPTION_ALIAS,
- Lex->lock_option))
- MYSQL_YYABORT;
- }
- ;
+ ident opt_wild opt_table_alias
+ {
+ if (!Select->add_table_to_list(YYTHD, new Table_ident($1),
+ $3,
+ TL_OPTION_UPDATING | TL_OPTION_ALIAS,
+ Lex->lock_option))
+ MYSQL_YYABORT;
+ }
+ | ident '.' ident opt_wild opt_table_alias
+ {
+ if (!Select->add_table_to_list(YYTHD,
+ new Table_ident(YYTHD, $1, $3, 0),
+ $5,
+ TL_OPTION_UPDATING | TL_OPTION_ALIAS,
+ Lex->lock_option))
+ MYSQL_YYABORT;
+ }
+ ;
opt_wild:
- /* empty */ {}
- | '.' '*' {};
-
+ /* empty */ {}
+ | '.' '*' {}
+ ;
opt_delete_options:
- /* empty */ {}
- | opt_delete_option opt_delete_options {};
+ /* empty */ {}
+ | opt_delete_option opt_delete_options {}
+ ;
opt_delete_option:
- QUICK { Select->options|= OPTION_QUICK; }
- | LOW_PRIORITY { Lex->lock_option= TL_WRITE_LOW_PRIORITY; }
- | IGNORE_SYM { Lex->ignore= 1; };
+ QUICK { Select->options|= OPTION_QUICK; }
+ | LOW_PRIORITY { Lex->lock_option= TL_WRITE_LOW_PRIORITY; }
+ | IGNORE_SYM { Lex->ignore= 1; }
+ ;
truncate:
- TRUNCATE_SYM opt_table_sym table_name
- {
- LEX* lex= Lex;
- lex->sql_command= SQLCOM_TRUNCATE;
- lex->select_lex.options= 0;
- lex->select_lex.sql_cache= SELECT_LEX::SQL_CACHE_UNSPECIFIED;
- lex->select_lex.init_order();
- }
- ;
+ TRUNCATE_SYM opt_table_sym table_name
+ {
+ LEX* lex= Lex;
+ lex->sql_command= SQLCOM_TRUNCATE;
+ lex->select_lex.options= 0;
+ lex->select_lex.sql_cache= SELECT_LEX::SQL_CACHE_UNSPECIFIED;
+ lex->select_lex.init_order();
+ }
+ ;
opt_table_sym:
- /* empty */
- | TABLE_SYM;
+ /* empty */
+ | TABLE_SYM
+ ;
opt_profile_defs:
/* empty */
@@ -8620,27 +9097,28 @@ opt_profile_args:
/* Show things */
-show: SHOW
- {
- LEX *lex=Lex;
- lex->wild=0;
- lex->lock_option= TL_READ;
- mysql_init_select(lex);
- lex->current_select->parsing_place= SELECT_LIST;
- bzero((char*) &lex->create_info,sizeof(lex->create_info));
- }
- show_param
- {}
- ;
+show:
+ SHOW
+ {
+ LEX *lex=Lex;
+ lex->wild=0;
+ lex->lock_option= TL_READ;
+ mysql_init_select(lex);
+ lex->current_select->parsing_place= SELECT_LIST;
+ bzero((char*) &lex->create_info,sizeof(lex->create_info));
+ }
+ show_param
+ {}
+ ;
show_param:
- DATABASES wild_and_where
- {
- LEX *lex= Lex;
- lex->sql_command= SQLCOM_SHOW_DATABASES;
- if (prepare_schema_table(YYTHD, lex, 0, SCH_SCHEMATA))
- MYSQL_YYABORT;
- }
+ DATABASES wild_and_where
+ {
+ LEX *lex= Lex;
+ lex->sql_command= SQLCOM_SHOW_DATABASES;
+ if (prepare_schema_table(YYTHD, lex, 0, SCH_SCHEMATA))
+ MYSQL_YYABORT;
+ }
| opt_full TABLES opt_db wild_and_where
{
LEX *lex= Lex;
@@ -8674,110 +9152,115 @@ show_param:
MYSQL_YYABORT;
}
| OPEN_SYM TABLES opt_db wild_and_where
- {
- LEX *lex= Lex;
+ {
+ LEX *lex= Lex;
lex->sql_command= SQLCOM_SHOW_OPEN_TABLES;
- lex->select_lex.db= $3;
+ lex->select_lex.db= $3;
if (prepare_schema_table(YYTHD, lex, 0, SCH_OPEN_TABLES))
MYSQL_YYABORT;
- }
+ }
| opt_full PLUGIN_SYM
- {
- LEX *lex= Lex;
- WARN_DEPRECATED(yythd, "5.2", "SHOW PLUGIN", "'SHOW PLUGINS'");
+ {
+ LEX *lex= Lex;
+ WARN_DEPRECATED(yythd, "5.2", "SHOW PLUGIN", "'SHOW PLUGINS'");
lex->sql_command= SQLCOM_SHOW_PLUGINS;
if (prepare_schema_table(YYTHD, lex, 0, SCH_PLUGINS))
MYSQL_YYABORT;
- }
+ }
| PLUGINS_SYM
- {
- LEX *lex= Lex;
+ {
+ LEX *lex= Lex;
lex->sql_command= SQLCOM_SHOW_PLUGINS;
if (prepare_schema_table(YYTHD, lex, 0, SCH_PLUGINS))
MYSQL_YYABORT;
- }
- | ENGINE_SYM known_storage_engines show_engine_param
- { Lex->create_info.db_type= $2; }
- | ENGINE_SYM ALL show_engine_param
- { Lex->create_info.db_type= NULL; }
- | opt_full COLUMNS from_or_in table_ident opt_db wild_and_where
- {
- LEX *lex= Lex;
- lex->sql_command= SQLCOM_SHOW_FIELDS;
- if ($5)
- $4->change_db($5);
- if (prepare_schema_table(YYTHD, lex, $4, SCH_COLUMNS))
- MYSQL_YYABORT;
- }
- | NEW_SYM MASTER_SYM FOR_SYM SLAVE WITH MASTER_LOG_FILE_SYM EQ
- TEXT_STRING_sys AND_SYM MASTER_LOG_POS_SYM EQ ulonglong_num
- AND_SYM MASTER_SERVER_ID_SYM EQ
- ulong_num
- {
- Lex->sql_command = SQLCOM_SHOW_NEW_MASTER;
- Lex->mi.log_file_name = $8.str;
- Lex->mi.pos = $12;
- Lex->mi.server_id = $16;
+ }
+ | ENGINE_SYM known_storage_engines show_engine_param
+ { Lex->create_info.db_type= $2; }
+ | ENGINE_SYM ALL show_engine_param
+ { Lex->create_info.db_type= NULL; }
+ | opt_full COLUMNS from_or_in table_ident opt_db wild_and_where
+ {
+ LEX *lex= Lex;
+ lex->sql_command= SQLCOM_SHOW_FIELDS;
+ if ($5)
+ $4->change_db($5);
+ if (prepare_schema_table(YYTHD, lex, $4, SCH_COLUMNS))
+ MYSQL_YYABORT;
+ }
+ | NEW_SYM MASTER_SYM FOR_SYM SLAVE
+ WITH MASTER_LOG_FILE_SYM EQ
+ TEXT_STRING_sys /* $8 */
+ AND_SYM MASTER_LOG_POS_SYM EQ
+ ulonglong_num /* $12 */
+ AND_SYM MASTER_SERVER_ID_SYM EQ
+ ulong_num /* $16 */
+ {
+ Lex->sql_command = SQLCOM_SHOW_NEW_MASTER;
+ Lex->mi.log_file_name = $8.str;
+ Lex->mi.pos = $12;
+ Lex->mi.server_id = $16;
}
| master_or_binary LOGS_SYM
{
- Lex->sql_command = SQLCOM_SHOW_BINLOGS;
+ Lex->sql_command = SQLCOM_SHOW_BINLOGS;
}
| SLAVE HOSTS_SYM
{
- Lex->sql_command = SQLCOM_SHOW_SLAVE_HOSTS;
+ Lex->sql_command = SQLCOM_SHOW_SLAVE_HOSTS;
}
| BINLOG_SYM EVENTS_SYM binlog_in binlog_from
{
- LEX *lex= Lex;
- lex->sql_command= SQLCOM_SHOW_BINLOG_EVENTS;
+ LEX *lex= Lex;
+ lex->sql_command= SQLCOM_SHOW_BINLOG_EVENTS;
} opt_limit_clause_init
| keys_or_index from_or_in table_ident opt_db where_clause
{
LEX *lex= Lex;
lex->sql_command= SQLCOM_SHOW_KEYS;
- if ($4)
- $3->change_db($4);
+ if ($4)
+ $3->change_db($4);
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;
- lex->sql_command= SQLCOM_SHOW_STORAGE_ENGINES;
- WARN_DEPRECATED(yythd, "5.2", "SHOW TABLE TYPES", "'SHOW [STORAGE] ENGINES'");
- }
- | opt_storage ENGINES_SYM
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_SHOW_STORAGE_ENGINES;
+ }
+ | COLUMN_SYM TYPES_SYM
+ {
+ LEX *lex=Lex;
+ lex->sql_command= SQLCOM_SHOW_COLUMN_TYPES;
+ }
+ | TABLE_SYM TYPES_SYM
+ {
+ LEX *lex=Lex;
+ lex->sql_command= SQLCOM_SHOW_STORAGE_ENGINES;
+ WARN_DEPRECATED(yythd, "5.2", "SHOW TABLE TYPES", "'SHOW [STORAGE] ENGINES'");
+ if (prepare_schema_table(YYTHD, lex, 0, SCH_ENGINES))
+ MYSQL_YYABORT;
+ }
+ | opt_storage ENGINES_SYM
+ {
+ LEX *lex=Lex;
+ lex->sql_command= SQLCOM_SHOW_STORAGE_ENGINES;
if (prepare_schema_table(YYTHD, lex, 0, SCH_ENGINES))
MYSQL_YYABORT;
- }
- | AUTHORS_SYM
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_SHOW_AUTHORS;
- }
- | CONTRIBUTORS_SYM
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_SHOW_CONTRIBUTORS;
- }
- | PRIVILEGES
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_SHOW_PRIVILEGES;
- }
+ }
+ | AUTHORS_SYM
+ {
+ LEX *lex=Lex;
+ lex->sql_command= SQLCOM_SHOW_AUTHORS;
+ }
+ | CONTRIBUTORS_SYM
+ {
+ LEX *lex=Lex;
+ lex->sql_command= SQLCOM_SHOW_CONTRIBUTORS;
+ }
+ | PRIVILEGES
+ {
+ LEX *lex=Lex;
+ lex->sql_command= SQLCOM_SHOW_PRIVILEGES;
+ }
| COUNT_SYM '(' '*' ')' WARNINGS
{ (void) create_select_for_variable("warning_count"); }
| COUNT_SYM '(' '*' ')' ERRORS
- { (void) create_select_for_variable("error_count"); }
+ { (void) create_select_for_variable("error_count"); }
| WARNINGS opt_limit_clause_init
{ Lex->sql_command = SQLCOM_SHOW_WARNS;}
| ERRORS opt_limit_clause_init
@@ -8793,7 +9276,7 @@ show_param:
lex->option_type= $1;
if (prepare_schema_table(YYTHD, lex, 0, SCH_STATUS))
MYSQL_YYABORT;
- }
+ }
| INNOBASE_SYM STATUS_SYM
{
LEX *lex= Lex;
@@ -8801,33 +9284,33 @@ show_param:
if (!(lex->create_info.db_type=
ha_resolve_by_legacy_type(YYTHD, DB_TYPE_INNODB)))
{
- my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), "InnoDB");
- MYSQL_YYABORT;
+ my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), "InnoDB");
+ MYSQL_YYABORT;
}
WARN_DEPRECATED(yythd, "5.2", "SHOW INNODB STATUS", "'SHOW ENGINE INNODB STATUS'");
- }
+ }
| MUTEX_SYM STATUS_SYM
{
- LEX *lex= Lex;
+ LEX *lex= Lex;
lex->sql_command = SQLCOM_SHOW_ENGINE_MUTEX;
if (!(lex->create_info.db_type=
ha_resolve_by_legacy_type(YYTHD, DB_TYPE_INNODB)))
{
- my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), "InnoDB");
- MYSQL_YYABORT;
+ my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), "InnoDB");
+ MYSQL_YYABORT;
}
WARN_DEPRECATED(yythd, "5.2", "SHOW MUTEX STATUS", "'SHOW ENGINE INNODB MUTEX'");
- }
- | opt_full PROCESSLIST_SYM
- { Lex->sql_command= SQLCOM_SHOW_PROCESSLIST;}
+ }
+ | opt_full PROCESSLIST_SYM
+ { Lex->sql_command= SQLCOM_SHOW_PROCESSLIST;}
| opt_var_type VARIABLES wild_and_where
- {
+ {
LEX *lex= Lex;
lex->sql_command= SQLCOM_SHOW_VARIABLES;
lex->option_type= $1;
if (prepare_schema_table(YYTHD, lex, 0, SCH_VARIABLES))
MYSQL_YYABORT;
- }
+ }
| charset wild_and_where
{
LEX *lex= Lex;
@@ -8842,86 +9325,92 @@ show_param:
if (prepare_schema_table(YYTHD, lex, 0, SCH_COLLATIONS))
MYSQL_YYABORT;
}
- | GRANTS
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_SHOW_GRANTS;
- LEX_USER *curr_user;
+ | GRANTS
+ {
+ LEX *lex=Lex;
+ lex->sql_command= SQLCOM_SHOW_GRANTS;
+ LEX_USER *curr_user;
if (!(curr_user= (LEX_USER*) lex->thd->alloc(sizeof(st_lex_user))))
MYSQL_YYABORT;
bzero(curr_user, sizeof(st_lex_user));
- lex->grant_user= curr_user;
- }
- | GRANTS FOR_SYM user
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_SHOW_GRANTS;
- lex->grant_user=$3;
- lex->grant_user->password=null_lex_str;
- }
- | CREATE DATABASE opt_if_not_exists ident
- {
- Lex->sql_command=SQLCOM_SHOW_CREATE_DB;
- Lex->create_info.options=$3;
- Lex->name= $4;
- }
+ lex->grant_user= curr_user;
+ }
+ | GRANTS FOR_SYM user
+ {
+ LEX *lex=Lex;
+ lex->sql_command= SQLCOM_SHOW_GRANTS;
+ lex->grant_user=$3;
+ lex->grant_user->password=null_lex_str;
+ }
+ | CREATE DATABASE opt_if_not_exists ident
+ {
+ Lex->sql_command=SQLCOM_SHOW_CREATE_DB;
+ Lex->create_info.options=$3;
+ Lex->name= $4;
+ }
| CREATE TABLE_SYM table_ident
{
LEX *lex= Lex;
- lex->sql_command = SQLCOM_SHOW_CREATE;
- if (!lex->select_lex.add_table_to_list(YYTHD, $3, NULL,0))
- MYSQL_YYABORT;
+ lex->sql_command = SQLCOM_SHOW_CREATE;
+ if (!lex->select_lex.add_table_to_list(YYTHD, $3, NULL,0))
+ MYSQL_YYABORT;
lex->only_view= 0;
- lex->create_info.storage_media= HA_SM_DEFAULT;
- }
+ lex->create_info.storage_media= HA_SM_DEFAULT;
+ }
| CREATE VIEW_SYM table_ident
{
LEX *lex= Lex;
- lex->sql_command = SQLCOM_SHOW_CREATE;
- if (!lex->select_lex.add_table_to_list(YYTHD, $3, NULL, 0))
- MYSQL_YYABORT;
+ lex->sql_command = SQLCOM_SHOW_CREATE;
+ if (!lex->select_lex.add_table_to_list(YYTHD, $3, NULL, 0))
+ MYSQL_YYABORT;
lex->only_view= 1;
- }
+ }
| MASTER_SYM STATUS_SYM
{
- Lex->sql_command = SQLCOM_SHOW_MASTER_STAT;
+ Lex->sql_command = SQLCOM_SHOW_MASTER_STAT;
}
| SLAVE STATUS_SYM
{
- Lex->sql_command = SQLCOM_SHOW_SLAVE_STAT;
+ Lex->sql_command = SQLCOM_SHOW_SLAVE_STAT;
}
- | CREATE PROCEDURE sp_name
- {
- LEX *lex= Lex;
+ | CREATE PROCEDURE sp_name
+ {
+ LEX *lex= Lex;
- lex->sql_command = SQLCOM_SHOW_CREATE_PROC;
- lex->spname= $3;
- }
- | CREATE FUNCTION_SYM sp_name
- {
- LEX *lex= Lex;
+ lex->sql_command = SQLCOM_SHOW_CREATE_PROC;
+ lex->spname= $3;
+ }
+ | CREATE FUNCTION_SYM sp_name
+ {
+ LEX *lex= Lex;
- lex->sql_command = SQLCOM_SHOW_CREATE_FUNC;
- lex->spname= $3;
- }
- | PROCEDURE STATUS_SYM wild_and_where
- {
+ lex->sql_command = SQLCOM_SHOW_CREATE_FUNC;
+ lex->spname= $3;
+ }
+ | CREATE TRIGGER_SYM sp_name
+ {
+ LEX *lex= Lex;
+ lex->sql_command= SQLCOM_SHOW_CREATE_TRIGGER;
+ lex->spname= $3;
+ }
+ | PROCEDURE STATUS_SYM wild_and_where
+ {
LEX *lex= Lex;
lex->sql_command= SQLCOM_SHOW_STATUS_PROC;
- if (!sp_add_to_query_tables(YYTHD, lex, "mysql", "proc", TL_READ))
- MYSQL_YYABORT;
+ if (!sp_add_to_query_tables(YYTHD, lex, "mysql", "proc", TL_READ))
+ MYSQL_YYABORT;
if (prepare_schema_table(YYTHD, lex, 0, SCH_PROCEDURES))
MYSQL_YYABORT;
- }
- | FUNCTION_SYM STATUS_SYM wild_and_where
- {
+ }
+ | FUNCTION_SYM STATUS_SYM wild_and_where
+ {
LEX *lex= Lex;
lex->sql_command= SQLCOM_SHOW_STATUS_FUNC;
- if (!sp_add_to_query_tables(YYTHD, lex, "mysql", "proc", TL_READ))
- MYSQL_YYABORT;
+ if (!sp_add_to_query_tables(YYTHD, lex, "mysql", "proc", TL_READ))
+ MYSQL_YYABORT;
if (prepare_schema_table(YYTHD, lex, 0, SCH_PROCEDURES))
MYSQL_YYABORT;
- }
+ }
| PROCEDURE CODE_SYM sp_name
{
#ifdef DBUG_OFF
@@ -8929,7 +9418,7 @@ show_param:
MYSQL_YYABORT;
#else
Lex->sql_command= SQLCOM_SHOW_PROC_CODE;
- Lex->spname= $3;
+ Lex->spname= $3;
#endif
}
| FUNCTION_SYM CODE_SYM sp_name
@@ -8939,7 +9428,7 @@ show_param:
MYSQL_YYABORT;
#else
Lex->sql_command= SQLCOM_SHOW_FUNC_CODE;
- Lex->spname= $3;
+ Lex->spname= $3;
#endif
}
| CREATE EVENT_SYM sp_name
@@ -8947,325 +9436,371 @@ show_param:
Lex->spname= $3;
Lex->sql_command = SQLCOM_SHOW_CREATE_EVENT;
}
- ;
+ ;
show_engine_param:
- STATUS_SYM
- { Lex->sql_command= SQLCOM_SHOW_ENGINE_STATUS; }
- | MUTEX_SYM
- { Lex->sql_command= SQLCOM_SHOW_ENGINE_MUTEX; }
- | LOGS_SYM
- { Lex->sql_command= SQLCOM_SHOW_ENGINE_LOGS; };
+ STATUS_SYM
+ { Lex->sql_command= SQLCOM_SHOW_ENGINE_STATUS; }
+ | MUTEX_SYM
+ { Lex->sql_command= SQLCOM_SHOW_ENGINE_MUTEX; }
+ | LOGS_SYM
+ { Lex->sql_command= SQLCOM_SHOW_ENGINE_LOGS; }
+ ;
master_or_binary:
- MASTER_SYM
- | BINARY;
+ MASTER_SYM
+ | BINARY
+ ;
opt_storage:
- /* empty */
- | STORAGE_SYM;
+ /* empty */
+ | STORAGE_SYM
+ ;
opt_db:
- /* empty */ { $$= 0; }
- | from_or_in ident { $$= $2.str; };
+ /* empty */ { $$= 0; }
+ | from_or_in ident { $$= $2.str; }
+ ;
opt_full:
- /* empty */ { Lex->verbose=0; }
- | FULL { Lex->verbose=1; };
+ /* empty */ { Lex->verbose=0; }
+ | FULL { Lex->verbose=1; }
+ ;
from_or_in:
- FROM
- | IN_SYM;
+ FROM
+ | IN_SYM
+ ;
binlog_in:
- /* empty */ { Lex->mi.log_file_name = 0; }
- | IN_SYM TEXT_STRING_sys { Lex->mi.log_file_name = $2.str; };
+ /* empty */ { Lex->mi.log_file_name = 0; }
+ | IN_SYM TEXT_STRING_sys { Lex->mi.log_file_name = $2.str; }
+ ;
binlog_from:
- /* empty */ { Lex->mi.pos = 4; /* skip magic number */ }
- | FROM ulonglong_num { Lex->mi.pos = $2; };
+ /* empty */ { Lex->mi.pos = 4; /* skip magic number */ }
+ | FROM ulonglong_num { Lex->mi.pos = $2; }
+ ;
wild_and_where:
- /* empty */
- | LIKE TEXT_STRING_sys
- { Lex->wild= new (YYTHD->mem_root) String($2.str, $2.length,
- system_charset_info); }
- | WHERE expr
- {
- Select->where= $2;
- if ($2)
- $2->top_level_item();
- }
- ;
-
+ /* empty */
+ | LIKE TEXT_STRING_sys
+ {
+ Lex->wild= new (YYTHD->mem_root) String($2.str, $2.length,
+ system_charset_info);
+ }
+ | WHERE expr
+ {
+ Select->where= $2;
+ if ($2)
+ $2->top_level_item();
+ }
+ ;
/* A Oracle compatible synonym for show */
describe:
- describe_command table_ident
- {
- LEX *lex= Lex;
- lex->lock_option= TL_READ;
- mysql_init_select(lex);
- lex->current_select->parsing_place= SELECT_LIST;
- lex->sql_command= SQLCOM_SHOW_FIELDS;
- lex->select_lex.db= 0;
- lex->verbose= 0;
- if (prepare_schema_table(YYTHD, lex, $2, SCH_COLUMNS))
- MYSQL_YYABORT;
- }
- opt_describe_column {}
- | describe_command opt_extended_describe
- { Lex->describe|= DESCRIBE_NORMAL; }
- select
- {
- LEX *lex=Lex;
- lex->select_lex.options|= SELECT_DESCRIBE;
- }
- ;
+ describe_command table_ident
+ {
+ LEX *lex= Lex;
+ lex->lock_option= TL_READ;
+ mysql_init_select(lex);
+ lex->current_select->parsing_place= SELECT_LIST;
+ lex->sql_command= SQLCOM_SHOW_FIELDS;
+ lex->select_lex.db= 0;
+ lex->verbose= 0;
+ if (prepare_schema_table(YYTHD, lex, $2, SCH_COLUMNS))
+ MYSQL_YYABORT;
+ }
+ opt_describe_column {}
+ | describe_command opt_extended_describe
+ { Lex->describe|= DESCRIBE_NORMAL; }
+ select
+ {
+ LEX *lex=Lex;
+ lex->select_lex.options|= SELECT_DESCRIBE;
+ }
+ ;
describe_command:
- DESC
- | DESCRIBE;
+ DESC
+ | DESCRIBE
+ ;
opt_extended_describe:
- /* empty */ {}
- | EXTENDED_SYM { Lex->describe|= DESCRIBE_EXTENDED; }
- | PARTITIONS_SYM { Lex->describe|= DESCRIBE_PARTITIONS; }
- ;
-
+ /* empty */ {}
+ | EXTENDED_SYM { Lex->describe|= DESCRIBE_EXTENDED; }
+ | PARTITIONS_SYM { Lex->describe|= DESCRIBE_PARTITIONS; }
+ ;
opt_describe_column:
- /* empty */ {}
- | text_string { Lex->wild= $1; }
- | ident
- { Lex->wild= new (YYTHD->mem_root) String((const char*) $1.str,$1.length,system_charset_info); };
+ /* empty */ {}
+ | text_string { Lex->wild= $1; }
+ | ident
+ {
+ Lex->wild= new (YYTHD->mem_root) String((const char*) $1.str,
+ $1.length,
+ system_charset_info);
+ }
+ ;
/* flush things */
flush:
- FLUSH_SYM opt_no_write_to_binlog
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_FLUSH;
- lex->type= 0;
- lex->no_write_to_binlog= $2;
- }
- flush_options
- {}
- ;
+ FLUSH_SYM opt_no_write_to_binlog
+ {
+ LEX *lex=Lex;
+ lex->sql_command= SQLCOM_FLUSH;
+ lex->type= 0;
+ lex->no_write_to_binlog= $2;
+ }
+ flush_options
+ {}
+ ;
flush_options:
- flush_options ',' flush_option
- | flush_option;
+ flush_options ',' flush_option
+ | flush_option
+ ;
flush_option:
- table_or_tables { Lex->type|= REFRESH_TABLES; } opt_table_list {}
- | TABLES WITH READ_SYM LOCK_SYM { Lex->type|= REFRESH_TABLES | REFRESH_READ_LOCK; }
- | QUERY_SYM CACHE_SYM { Lex->type|= REFRESH_QUERY_CACHE_FREE; }
- | HOSTS_SYM { Lex->type|= REFRESH_HOSTS; }
- | PRIVILEGES { Lex->type|= REFRESH_GRANT; }
- | LOGS_SYM { Lex->type|= REFRESH_LOG; }
- | STATUS_SYM { Lex->type|= REFRESH_STATUS; }
- | SLAVE { Lex->type|= REFRESH_SLAVE; }
- | MASTER_SYM { Lex->type|= REFRESH_MASTER; }
- | DES_KEY_FILE { Lex->type|= REFRESH_DES_KEY_FILE; }
- | RESOURCES { Lex->type|= REFRESH_USER_RESOURCES; };
+ table_or_tables
+ { Lex->type|= REFRESH_TABLES; }
+ opt_table_list {}
+ | TABLES WITH READ_SYM LOCK_SYM
+ { Lex->type|= REFRESH_TABLES | REFRESH_READ_LOCK; }
+ | QUERY_SYM CACHE_SYM
+ { Lex->type|= REFRESH_QUERY_CACHE_FREE; }
+ | HOSTS_SYM
+ { Lex->type|= REFRESH_HOSTS; }
+ | PRIVILEGES
+ { Lex->type|= REFRESH_GRANT; }
+ | LOGS_SYM
+ { Lex->type|= REFRESH_LOG; }
+ | STATUS_SYM
+ { Lex->type|= REFRESH_STATUS; }
+ | SLAVE
+ { Lex->type|= REFRESH_SLAVE; }
+ | MASTER_SYM
+ { Lex->type|= REFRESH_MASTER; }
+ | DES_KEY_FILE
+ { Lex->type|= REFRESH_DES_KEY_FILE; }
+ | RESOURCES
+ { Lex->type|= REFRESH_USER_RESOURCES; }
+ ;
opt_table_list:
- /* empty */ {;}
- | table_list {;};
+ /* empty */ {}
+ | table_list {}
+ ;
reset:
- RESET_SYM
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_RESET; lex->type=0;
- } reset_options
- {}
- ;
+ RESET_SYM
+ {
+ LEX *lex=Lex;
+ lex->sql_command= SQLCOM_RESET; lex->type=0;
+ }
+ reset_options
+ {}
+ ;
reset_options:
- reset_options ',' reset_option
- | reset_option;
+ reset_options ',' reset_option
+ | reset_option
+ ;
reset_option:
- SLAVE { Lex->type|= REFRESH_SLAVE; }
+ SLAVE { Lex->type|= REFRESH_SLAVE; }
| MASTER_SYM { Lex->type|= REFRESH_MASTER; }
- | QUERY_SYM CACHE_SYM { Lex->type|= REFRESH_QUERY_CACHE;};
+ | QUERY_SYM CACHE_SYM { Lex->type|= REFRESH_QUERY_CACHE;}
+ ;
purge:
- PURGE
- {
- LEX *lex=Lex;
- lex->type=0;
- } purge_options
- {}
- ;
+ PURGE
+ {
+ LEX *lex=Lex;
+ lex->type=0;
+ lex->sql_command = SQLCOM_PURGE;
+ }
+ purge_options
+ {}
+ ;
purge_options:
- master_or_binary LOGS_SYM purge_option
- ;
+ master_or_binary LOGS_SYM purge_option
+ ;
purge_option:
- TO_SYM TEXT_STRING_sys
- {
- Lex->sql_command = SQLCOM_PURGE;
- Lex->to_log = $2.str;
- }
- | BEFORE_SYM expr
- {
- LEX *lex= Lex;
- lex->value_list.empty();
- lex->value_list.push_front($2);
- lex->sql_command= SQLCOM_PURGE_BEFORE;
- }
- ;
+ TO_SYM TEXT_STRING_sys
+ {
+ Lex->to_log = $2.str;
+ }
+ | BEFORE_SYM expr
+ {
+ LEX *lex= Lex;
+ lex->value_list.empty();
+ lex->value_list.push_front($2);
+ lex->sql_command= SQLCOM_PURGE_BEFORE;
+ }
+ ;
/* kill threads */
kill:
- KILL_SYM kill_option expr
- {
- LEX *lex=Lex;
- lex->value_list.empty();
- lex->value_list.push_front($3);
- lex->sql_command= SQLCOM_KILL;
- };
+ KILL_SYM kill_option expr
+ {
+ LEX *lex=Lex;
+ lex->value_list.empty();
+ lex->value_list.push_front($3);
+ lex->sql_command= SQLCOM_KILL;
+ }
+ ;
kill_option:
- /* empty */ { Lex->type= 0; }
- | CONNECTION_SYM { Lex->type= 0; }
- | QUERY_SYM { Lex->type= ONLY_KILL_QUERY; }
+ /* empty */ { Lex->type= 0; }
+ | CONNECTION_SYM { Lex->type= 0; }
+ | QUERY_SYM { Lex->type= ONLY_KILL_QUERY; }
;
/* change database */
-use: USE_SYM ident
- {
- LEX *lex=Lex;
- lex->sql_command=SQLCOM_CHANGE_DB;
- lex->select_lex.db= $2.str;
- };
+use:
+ USE_SYM ident
+ {
+ LEX *lex=Lex;
+ lex->sql_command=SQLCOM_CHANGE_DB;
+ lex->select_lex.db= $2.str;
+ }
+ ;
/* import, export of files */
-load: LOAD DATA_SYM
- {
- LEX *lex=Lex;
- if (lex->sphead)
- {
- my_error(ER_SP_BADSTATEMENT, MYF(0), "LOAD DATA");
- MYSQL_YYABORT;
- }
- lex->fname_start= lex->ptr;
- }
- load_data
- {}
- |
- LOAD TABLE_SYM table_ident FROM MASTER_SYM
- {
- LEX *lex=Lex;
- WARN_DEPRECATED(yythd, "5.2", "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:
+ LOAD DATA_SYM
+ {
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
+
+ if (lex->sphead)
+ {
+ my_error(ER_SP_BADSTATEMENT, MYF(0), "LOAD DATA");
+ MYSQL_YYABORT;
+ }
+ lex->fname_start= lip->get_ptr();
+ }
+ load_data
+ {}
+ | LOAD TABLE_SYM table_ident FROM MASTER_SYM
+ {
+ LEX *lex=Lex;
+ WARN_DEPRECATED(yythd, "5.2", "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->duplicates= DUP_ERROR;
- lex->ignore= 0;
- if (!(lex->exchange= new sql_exchange($4.str, 0)))
- MYSQL_YYABORT;
- }
- opt_duplicate INTO
- {
- LEX *lex=Lex;
- lex->fname_end= lex->ptr;
- }
- TABLE_SYM table_ident
- {
- LEX *lex=Lex;
- if (!Select->add_table_to_list(YYTHD, $10, NULL, TL_OPTION_UPDATING,
- lex->lock_option))
- MYSQL_YYABORT;
- lex->field_list.empty();
- lex->update_list.empty();
- lex->value_list.empty();
- }
- opt_load_data_charset
- { Lex->exchange->cs= $12; }
- opt_field_term opt_line_term opt_ignore_lines opt_field_or_var_spec
- opt_load_data_set_spec
- {}
- |
- FROM MASTER_SYM
- {
- Lex->sql_command = SQLCOM_LOAD_MASTER_DATA;
- WARN_DEPRECATED(yythd, "5.2", "LOAD DATA FROM MASTER",
- "mysqldump or future "
- "BACKUP/RESTORE DATABASE facility");
- };
+ 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->duplicates= DUP_ERROR;
+ lex->ignore= 0;
+ if (!(lex->exchange= new sql_exchange($4.str, 0)))
+ MYSQL_YYABORT;
+ }
+ opt_duplicate INTO
+ {
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
+ lex->fname_end= lip->get_ptr();
+ }
+ TABLE_SYM table_ident
+ {
+ LEX *lex=Lex;
+ if (!Select->add_table_to_list(YYTHD, $10, NULL, TL_OPTION_UPDATING,
+ lex->lock_option))
+ MYSQL_YYABORT;
+ lex->field_list.empty();
+ lex->update_list.empty();
+ lex->value_list.empty();
+ }
+ opt_load_data_charset
+ { Lex->exchange->cs= $12; }
+ opt_field_term opt_line_term opt_ignore_lines opt_field_or_var_spec
+ opt_load_data_set_spec
+ {}
+ | FROM MASTER_SYM
+ {
+ Lex->sql_command = SQLCOM_LOAD_MASTER_DATA;
+ WARN_DEPRECATED(yythd, "5.2", "LOAD DATA FROM MASTER",
+ "mysqldump or future "
+ "BACKUP/RESTORE DATABASE facility");
+ }
+ ;
opt_local:
- /* empty */ { $$=0;}
- | LOCAL_SYM { $$=1;};
+ /* empty */ { $$=0;}
+ | LOCAL_SYM { $$=1;}
+ ;
load_data_lock:
- /* empty */ { $$= YYTHD->update_lock_default; }
- | CONCURRENT
+ /* empty */ { $$= TL_WRITE_DEFAULT; }
+ | CONCURRENT
{
#ifdef HAVE_QUERY_CACHE
/*
Ignore this option in SP to avoid problem with query cache
*/
if (Lex->sphead != 0)
- $$= YYTHD->update_lock_default;
+ $$= TL_WRITE_DEFAULT;
else
#endif
$$= TL_WRITE_CONCURRENT_INSERT;
}
- | LOW_PRIORITY { $$= TL_WRITE_LOW_PRIORITY; };
-
+ | LOW_PRIORITY { $$= TL_WRITE_LOW_PRIORITY; }
+ ;
opt_duplicate:
- /* empty */ { Lex->duplicates=DUP_ERROR; }
- | REPLACE { Lex->duplicates=DUP_REPLACE; }
- | IGNORE_SYM { Lex->ignore= 1; };
+ /* empty */ { Lex->duplicates=DUP_ERROR; }
+ | REPLACE { Lex->duplicates=DUP_REPLACE; }
+ | IGNORE_SYM { Lex->ignore= 1; }
+ ;
opt_field_term:
- /* empty */
- | COLUMNS field_term_list;
+ /* empty */
+ | COLUMNS field_term_list
+ ;
field_term_list:
- field_term_list field_term
- | field_term;
+ field_term_list field_term
+ | field_term
+ ;
field_term:
- TERMINATED BY text_string
+ TERMINATED BY text_string
{
DBUG_ASSERT(Lex->exchange != 0);
Lex->exchange->field_term= $3;
}
- | OPTIONALLY ENCLOSED BY text_string
- {
+ | OPTIONALLY ENCLOSED BY text_string
+ {
LEX *lex= Lex;
DBUG_ASSERT(lex->exchange != 0);
lex->exchange->enclosed= $4;
lex->exchange->opt_enclosed= 1;
- }
+ }
| ENCLOSED BY text_string
{
DBUG_ASSERT(Lex->exchange != 0);
@@ -9275,18 +9810,21 @@ field_term:
{
DBUG_ASSERT(Lex->exchange != 0);
Lex->exchange->escaped= $3;
- };
+ }
+ ;
opt_line_term:
- /* empty */
- | LINES line_term_list;
+ /* empty */
+ | LINES line_term_list
+ ;
line_term_list:
- line_term_list line_term
- | line_term;
+ line_term_list line_term
+ | line_term
+ ;
line_term:
- TERMINATED BY text_string
+ TERMINATED BY text_string
{
DBUG_ASSERT(Lex->exchange != 0);
Lex->exchange->line_term= $3;
@@ -9295,363 +9833,426 @@ line_term:
{
DBUG_ASSERT(Lex->exchange != 0);
Lex->exchange->line_start= $3;
- };
+ }
+ ;
opt_ignore_lines:
- /* empty */
+ /* empty */
| IGNORE_SYM NUM LINES
{
DBUG_ASSERT(Lex->exchange != 0);
Lex->exchange->skip_lines= atol($2.str);
- };
+ }
+ ;
opt_field_or_var_spec:
- /* empty */ { }
- | '(' fields_or_vars ')' { }
- | '(' ')' { };
+ /* empty */ {}
+ | '(' fields_or_vars ')' {}
+ | '(' ')' {}
+ ;
fields_or_vars:
- fields_or_vars ',' field_or_var
+ fields_or_vars ',' field_or_var
{ Lex->field_list.push_back($3); }
| field_or_var
{ Lex->field_list.push_back($1); }
;
field_or_var:
- simple_ident_nospvar {$$= $1;}
+ simple_ident_nospvar {$$= $1;}
| '@' ident_or_text
{ $$= new Item_user_var_as_out_param($2); }
;
opt_load_data_set_spec:
- /* empty */ { }
- | SET insert_update_list { };
-
+ /* empty */ {}
+ | SET insert_update_list {}
+ ;
/* Common definitions */
text_literal:
- TEXT_STRING_literal
- {
- THD *thd= YYTHD;
- $$ = new Item_string($1.str,$1.length,thd->variables.collation_connection);
- }
- | NCHAR_STRING
- { $$= new Item_string($1.str,$1.length,national_charset_info); }
- | UNDERSCORE_CHARSET TEXT_STRING
- { $$ = new Item_string($2.str,$2.length,Lex->underscore_charset); }
- | text_literal TEXT_STRING_literal
- { ((Item_string*) $1)->append($2.str,$2.length); }
- ;
+ TEXT_STRING
+ {
+ LEX_STRING tmp;
+ THD *thd= YYTHD;
+ CHARSET_INFO *cs_con= thd->variables.collation_connection;
+ CHARSET_INFO *cs_cli= thd->variables.character_set_client;
+ uint repertoire= thd->lex->text_string_is_7bit &&
+ my_charset_is_ascii_based(cs_cli) ?
+ MY_REPERTOIRE_ASCII : MY_REPERTOIRE_UNICODE30;
+ if (thd->charset_is_collation_connection ||
+ (repertoire == MY_REPERTOIRE_ASCII &&
+ my_charset_is_ascii_based(cs_con)))
+ tmp= $1;
+ else
+ thd->convert_string(&tmp, cs_con, $1.str, $1.length, cs_cli);
+ $$= new Item_string(tmp.str, tmp.length, cs_con,
+ DERIVATION_COERCIBLE, repertoire);
+ }
+ | NCHAR_STRING
+ {
+ uint repertoire= Lex->text_string_is_7bit ?
+ MY_REPERTOIRE_ASCII : MY_REPERTOIRE_UNICODE30;
+ DBUG_ASSERT(my_charset_is_ascii_based(national_charset_info));
+ $$= new Item_string($1.str, $1.length, national_charset_info,
+ DERIVATION_COERCIBLE, repertoire);
+ }
+ | UNDERSCORE_CHARSET TEXT_STRING
+ {
+ $$= new Item_string($2.str, $2.length, $1);
+ ((Item_string*) $$)->set_repertoire_from_value();
+ }
+ | text_literal TEXT_STRING_literal
+ {
+ Item_string* item= (Item_string*) $1;
+ item->append($2.str, $2.length);
+ if (!(item->collation.repertoire & MY_REPERTOIRE_EXTENDED))
+ {
+ /*
+ If the string has been pure ASCII so far,
+ check the new part.
+ */
+ CHARSET_INFO *cs= YYTHD->variables.collation_connection;
+ item->collation.repertoire|= my_string_repertoire(cs,
+ $2.str,
+ $2.length);
+ }
+ }
+ ;
text_string:
- TEXT_STRING_literal
- { $$= new (YYTHD->mem_root) String($1.str,$1.length,YYTHD->variables.collation_connection); }
- | HEX_NUM
- {
- Item *tmp= new Item_hex_string($1.str, $1.length);
- /*
- it is OK only emulate fix_fields, because we need only
+ TEXT_STRING_literal
+ {
+ $$= new (YYTHD->mem_root) String($1.str,
+ $1.length,
+ YYTHD->variables.collation_connection);
+ }
+ | HEX_NUM
+ {
+ Item *tmp= new Item_hex_string($1.str, $1.length);
+ /*
+ it is OK only emulate fix_fields, because we need only
value of constant
- */
- $$= tmp ?
- tmp->quick_fix_field(), tmp->val_str((String*) 0) :
- (String*) 0;
- }
+ */
+ $$= tmp ?
+ tmp->quick_fix_field(), tmp->val_str((String*) 0) :
+ (String*) 0;
+ }
| BIN_NUM
{
- Item *tmp= new Item_bin_string($1.str, $1.length);
- /*
- it is OK only emulate fix_fields, because we need only
+ Item *tmp= new Item_bin_string($1.str, $1.length);
+ /*
+ it is OK only emulate fix_fields, because we need only
value of constant
- */
- $$= tmp ? tmp->quick_fix_field(), tmp->val_str((String*) 0) :
- (String*) 0;
+ */
+ $$= tmp ? tmp->quick_fix_field(), tmp->val_str((String*) 0) :
+ (String*) 0;
}
- ;
+ ;
param_marker:
- PARAM_MARKER
- {
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- Item_param *item;
- if (! lex->parsing_options.allows_variable)
- {
- my_error(ER_VIEW_SELECT_VARIABLE, MYF(0));
- MYSQL_YYABORT;
- }
- item= new Item_param((uint) (lex->tok_start - thd->query));
- if (!($$= item) || lex->param_list.push_back(item))
+ PARAM_MARKER
{
- my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
- MYSQL_YYABORT;
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
+ Item_param *item;
+ if (! lex->parsing_options.allows_variable)
+ {
+ my_error(ER_VIEW_SELECT_VARIABLE, MYF(0));
+ MYSQL_YYABORT;
+ }
+ item= new Item_param((uint) (lip->get_tok_start() - thd->query));
+ if (!($$= item) || lex->param_list.push_back(item))
+ {
+ my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
+ MYSQL_YYABORT;
+ }
}
- }
- ;
+ ;
signed_literal:
- literal { $$ = $1; }
- | '+' NUM_literal { $$ = $2; }
- | '-' NUM_literal
- {
- $2->max_length++;
- $$= $2->neg();
- }
- ;
-
+ literal { $$ = $1; }
+ | '+' NUM_literal { $$ = $2; }
+ | '-' NUM_literal
+ {
+ $2->max_length++;
+ $$= $2->neg();
+ }
+ ;
literal:
- text_literal { $$ = $1; }
- | NUM_literal { $$ = $1; }
- | NULL_SYM { $$ = new Item_null();
- Lex->next_state=MY_LEX_OPERATOR_OR_IDENT;}
- | FALSE_SYM { $$= new Item_int((char*) "FALSE",0,1); }
- | TRUE_SYM { $$= new Item_int((char*) "TRUE",1,1); }
- | HEX_NUM { $$ = new Item_hex_string($1.str, $1.length);}
- | BIN_NUM { $$= new Item_bin_string($1.str, $1.length); }
- | UNDERSCORE_CHARSET HEX_NUM
- {
- Item *tmp= new Item_hex_string($2.str, $2.length);
- /*
- it is OK only emulate fix_fieds, because we need only
+ text_literal { $$ = $1; }
+ | NUM_literal { $$ = $1; }
+ | NULL_SYM
+ {
+ $$ = new Item_null();
+ YYTHD->m_lip->next_state=MY_LEX_OPERATOR_OR_IDENT;
+ }
+ | FALSE_SYM { $$= new Item_int((char*) "FALSE",0,1); }
+ | TRUE_SYM { $$= new Item_int((char*) "TRUE",1,1); }
+ | HEX_NUM { $$ = new Item_hex_string($1.str, $1.length);}
+ | BIN_NUM { $$= new Item_bin_string($1.str, $1.length); }
+ | UNDERSCORE_CHARSET HEX_NUM
+ {
+ Item *tmp= new Item_hex_string($2.str, $2.length);
+ /*
+ it is OK only emulate fix_fieds, because we need only
value of constant
- */
- String *str= tmp ?
- tmp->quick_fix_field(), tmp->val_str((String*) 0) :
- (String*) 0;
- $$= new Item_string(str ? str->ptr() : "",
- str ? str->length() : 0,
- Lex->underscore_charset);
- }
- | UNDERSCORE_CHARSET BIN_NUM
- {
- Item *tmp= new Item_bin_string($2.str, $2.length);
- /*
- it is OK only emulate fix_fieds, because we need only
+ */
+ String *str= tmp ?
+ tmp->quick_fix_field(), tmp->val_str((String*) 0) :
+ (String*) 0;
+ $$= new Item_string(str ? str->ptr() : "",
+ str ? str->length() : 0,
+ $1);
+ if ($$)
+ ((Item_string *) $$)->set_repertoire_from_value();
+ }
+ | UNDERSCORE_CHARSET BIN_NUM
+ {
+ Item *tmp= new Item_bin_string($2.str, $2.length);
+ /*
+ it is OK only emulate fix_fieds, because we need only
value of constant
- */
- String *str= tmp ?
- tmp->quick_fix_field(), tmp->val_str((String*) 0) :
- (String*) 0;
- $$= new Item_string(str ? str->ptr() : "",
- str ? str->length() : 0,
- Lex->charset);
- }
- | DATE_SYM text_literal { $$ = $2; }
- | TIME_SYM text_literal { $$ = $2; }
- | TIMESTAMP text_literal { $$ = $2; };
+ */
+ String *str= tmp ?
+ tmp->quick_fix_field(), tmp->val_str((String*) 0) :
+ (String*) 0;
+ $$= new Item_string(str ? str->ptr() : "",
+ str ? str->length() : 0,
+ Lex->charset);
+ }
+ | DATE_SYM text_literal { $$ = $2; }
+ | TIME_SYM text_literal { $$ = $2; }
+ | TIMESTAMP text_literal { $$ = $2; }
+ ;
NUM_literal:
- NUM { int error; $$ = new Item_int($1.str, (longlong) my_strtoll10($1.str, NULL, &error), $1.length); }
- | LONG_NUM { int error; $$ = new Item_int($1.str, (longlong) my_strtoll10($1.str, NULL, &error), $1.length); }
- | ULONGLONG_NUM { $$ = new Item_uint($1.str, $1.length); }
+ NUM
+ {
+ int error;
+ $$ = new Item_int($1.str, (longlong) my_strtoll10($1.str, NULL, &error), $1.length);
+ }
+ | LONG_NUM
+ {
+ int error;
+ $$ = new Item_int($1.str, (longlong) my_strtoll10($1.str, NULL, &error), $1.length);
+ }
+ | ULONGLONG_NUM
+ { $$ = new Item_uint($1.str, $1.length); }
| DECIMAL_NUM
- {
- $$= new Item_decimal($1.str, $1.length, YYTHD->charset());
- if (YYTHD->net.report_error)
- {
- MYSQL_YYABORT;
- }
- }
- | FLOAT_NUM
- {
- $$ = new Item_float($1.str, $1.length);
- if (YYTHD->net.report_error)
- {
- MYSQL_YYABORT;
- }
- }
- ;
+ {
+ $$= new Item_decimal($1.str, $1.length, YYTHD->charset());
+ if (YYTHD->net.report_error)
+ {
+ MYSQL_YYABORT;
+ }
+ }
+ | FLOAT_NUM
+ {
+ $$ = new Item_float($1.str, $1.length);
+ if (YYTHD->net.report_error)
+ {
+ MYSQL_YYABORT;
+ }
+ }
+ ;
/**********************************************************************
** Creating different items.
**********************************************************************/
insert_ident:
- simple_ident_nospvar { $$=$1; }
- | table_wild { $$=$1; };
+ simple_ident_nospvar { $$=$1; }
+ | table_wild { $$=$1; }
+ ;
table_wild:
- ident '.' '*'
- {
- SELECT_LEX *sel= Select;
- $$ = new Item_field(Lex->current_context(), NullS, $1.str, "*");
- sel->with_wild++;
- }
- | ident '.' ident '.' '*'
- {
- SELECT_LEX *sel= Select;
- $$ = new Item_field(Lex->current_context(), (YYTHD->client_capabilities &
- CLIENT_NO_SCHEMA ? NullS : $1.str),
- $3.str,"*");
- sel->with_wild++;
- }
- ;
+ ident '.' '*'
+ {
+ SELECT_LEX *sel= Select;
+ $$ = new Item_field(Lex->current_context(), NullS, $1.str, "*");
+ sel->with_wild++;
+ }
+ | ident '.' ident '.' '*'
+ {
+ SELECT_LEX *sel= Select;
+ $$ = new Item_field(Lex->current_context(), (YYTHD->client_capabilities &
+ CLIENT_NO_SCHEMA ? NullS : $1.str),
+ $3.str,"*");
+ sel->with_wild++;
+ }
+ ;
order_ident:
- expr { $$=$1; };
+ expr { $$=$1; }
+ ;
simple_ident:
- ident
- {
- sp_variable_t *spv;
- LEX *lex = Lex;
- sp_pcontext *spc = lex->spcont;
- if (spc && (spv = spc->find_variable(&$1)))
- {
- /* We're compiling a stored procedure and found a variable */
- if (! lex->parsing_options.allows_variable)
+ ident
+ {
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
+ sp_variable_t *spv;
+ sp_pcontext *spc = lex->spcont;
+ if (spc && (spv = spc->find_variable(&$1)))
{
- my_error(ER_VIEW_SELECT_VARIABLE, MYF(0));
- MYSQL_YYABORT;
- }
+ /* We're compiling a stored procedure and found a variable */
+ if (! lex->parsing_options.allows_variable)
+ {
+ my_error(ER_VIEW_SELECT_VARIABLE, MYF(0));
+ MYSQL_YYABORT;
+ }
- Item_splocal *splocal;
- splocal= new Item_splocal($1, spv->offset, spv->type,
- lex->tok_start_prev -
- lex->sphead->m_tmp_query);
+ Item_splocal *splocal;
+ splocal= new Item_splocal($1, spv->offset, spv->type,
+ lip->get_tok_start_prev() -
+ lex->sphead->m_tmp_query,
+ lip->get_tok_end() - lip->get_tok_start_prev());
#ifndef DBUG_OFF
- if (splocal)
- splocal->m_sp= lex->sphead;
+ if (splocal)
+ splocal->m_sp= lex->sphead;
#endif
- $$ = (Item*) splocal;
- lex->safe_to_cache_query=0;
- }
- else
- {
- SELECT_LEX *sel=Select;
- $$= (sel->parsing_place != IN_HAVING ||
- sel->get_in_sum_expr() > 0) ?
- (Item*) new Item_field(Lex->current_context(), NullS, NullS, $1.str) :
- (Item*) new Item_ref(Lex->current_context(), NullS, NullS, $1.str);
- }
- }
+ $$ = (Item*) splocal;
+ lex->safe_to_cache_query=0;
+ }
+ else
+ {
+ SELECT_LEX *sel=Select;
+ $$= (sel->parsing_place != IN_HAVING ||
+ sel->get_in_sum_expr() > 0) ?
+ (Item*) new Item_field(Lex->current_context(), NullS, NullS, $1.str) :
+ (Item*) new Item_ref(Lex->current_context(), NullS, NullS, $1.str);
+ }
+ }
| simple_ident_q { $$= $1; }
- ;
+ ;
simple_ident_nospvar:
- ident
- {
- SELECT_LEX *sel=Select;
- $$= (sel->parsing_place != IN_HAVING ||
- sel->get_in_sum_expr() > 0) ?
- (Item*) new Item_field(Lex->current_context(), NullS, NullS, $1.str) :
- (Item*) new Item_ref(Lex->current_context(), NullS, NullS, $1.str);
- }
- | simple_ident_q { $$= $1; }
- ;
+ ident
+ {
+ SELECT_LEX *sel=Select;
+ $$= (sel->parsing_place != IN_HAVING ||
+ sel->get_in_sum_expr() > 0) ?
+ (Item*) new Item_field(Lex->current_context(), NullS, NullS, $1.str) :
+ (Item*) new Item_ref(Lex->current_context(), NullS, NullS, $1.str);
+ }
+ | simple_ident_q { $$= $1; }
+ ;
simple_ident_q:
- ident '.' ident
- {
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
-
- /*
- FIXME This will work ok in simple_ident_nospvar case because
- we can't meet simple_ident_nospvar in trigger now. But it
- should be changed in future.
- */
- if (lex->sphead && lex->sphead->m_type == TYPE_ENUM_TRIGGER &&
- (!my_strcasecmp(system_charset_info, $1.str, "NEW") ||
- !my_strcasecmp(system_charset_info, $1.str, "OLD")))
+ ident '.' ident
{
- Item_trigger_field *trg_fld;
- bool new_row= ($1.str[0]=='N' || $1.str[0]=='n');
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
- if (lex->trg_chistics.event == TRG_EVENT_INSERT &&
- !new_row)
+ /*
+ FIXME This will work ok in simple_ident_nospvar case because
+ we can't meet simple_ident_nospvar in trigger now. But it
+ should be changed in future.
+ */
+ if (lex->sphead && lex->sphead->m_type == TYPE_ENUM_TRIGGER &&
+ (!my_strcasecmp(system_charset_info, $1.str, "NEW") ||
+ !my_strcasecmp(system_charset_info, $1.str, "OLD")))
{
- my_error(ER_TRG_NO_SUCH_ROW_IN_TRG, MYF(0), "OLD", "on INSERT");
- MYSQL_YYABORT;
- }
+ Item_trigger_field *trg_fld;
+ bool new_row= ($1.str[0]=='N' || $1.str[0]=='n');
- if (lex->trg_chistics.event == TRG_EVENT_DELETE &&
- new_row)
- {
- my_error(ER_TRG_NO_SUCH_ROW_IN_TRG, MYF(0), "NEW", "on DELETE");
- MYSQL_YYABORT;
- }
+ if (lex->trg_chistics.event == TRG_EVENT_INSERT &&
+ !new_row)
+ {
+ my_error(ER_TRG_NO_SUCH_ROW_IN_TRG, MYF(0), "OLD", "on INSERT");
+ MYSQL_YYABORT;
+ }
- DBUG_ASSERT(!new_row ||
- (lex->trg_chistics.event == TRG_EVENT_INSERT ||
- lex->trg_chistics.event == TRG_EVENT_UPDATE));
- const bool read_only=
- !(new_row && lex->trg_chistics.action_time == TRG_ACTION_BEFORE);
- if (!(trg_fld= new Item_trigger_field(Lex->current_context(),
- new_row ?
- Item_trigger_field::NEW_ROW:
- Item_trigger_field::OLD_ROW,
- $3.str,
- SELECT_ACL,
- read_only)))
- MYSQL_YYABORT;
+ if (lex->trg_chistics.event == TRG_EVENT_DELETE &&
+ new_row)
+ {
+ my_error(ER_TRG_NO_SUCH_ROW_IN_TRG, MYF(0), "NEW", "on DELETE");
+ MYSQL_YYABORT;
+ }
- /*
- Let us add this item to list of all Item_trigger_field objects
- in trigger.
- */
- lex->trg_table_fields.link_in_list((byte *)trg_fld,
- (byte**)&trg_fld->next_trg_field);
-
- $$= (Item *)trg_fld;
- }
- else
- {
- SELECT_LEX *sel= lex->current_select;
- if (sel->no_table_names_allowed)
- {
- my_error(ER_TABLENAME_NOT_ALLOWED_HERE,
- MYF(0), $1.str, thd->where);
- }
- $$= (sel->parsing_place != IN_HAVING ||
- sel->get_in_sum_expr() > 0) ?
- (Item*) new Item_field(Lex->current_context(), NullS, $1.str, $3.str) :
- (Item*) new Item_ref(Lex->current_context(), NullS, $1.str, $3.str);
- }
- }
- | '.' ident '.' ident
- {
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- SELECT_LEX *sel= lex->current_select;
- if (sel->no_table_names_allowed)
- {
- my_error(ER_TABLENAME_NOT_ALLOWED_HERE,
- MYF(0), $2.str, thd->where);
- }
- $$= (sel->parsing_place != IN_HAVING ||
- sel->get_in_sum_expr() > 0) ?
- (Item*) new Item_field(Lex->current_context(), NullS, $2.str, $4.str) :
- (Item*) new Item_ref(Lex->current_context(), NullS, $2.str, $4.str);
- }
- | ident '.' ident '.' ident
- {
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- SELECT_LEX *sel= lex->current_select;
- if (sel->no_table_names_allowed)
- {
- my_error(ER_TABLENAME_NOT_ALLOWED_HERE,
- MYF(0), $3.str, thd->where);
- }
- $$= (sel->parsing_place != IN_HAVING ||
- sel->get_in_sum_expr() > 0) ?
- (Item*) new Item_field(Lex->current_context(),
- (YYTHD->client_capabilities &
- CLIENT_NO_SCHEMA ? NullS : $1.str),
- $3.str, $5.str) :
- (Item*) new Item_ref(Lex->current_context(),
- (YYTHD->client_capabilities &
- CLIENT_NO_SCHEMA ? NullS : $1.str),
- $3.str, $5.str);
- };
+ DBUG_ASSERT(!new_row ||
+ (lex->trg_chistics.event == TRG_EVENT_INSERT ||
+ lex->trg_chistics.event == TRG_EVENT_UPDATE));
+ const bool read_only=
+ !(new_row && lex->trg_chistics.action_time == TRG_ACTION_BEFORE);
+ if (!(trg_fld= new Item_trigger_field(Lex->current_context(),
+ new_row ?
+ Item_trigger_field::NEW_ROW:
+ Item_trigger_field::OLD_ROW,
+ $3.str,
+ SELECT_ACL,
+ read_only)))
+ MYSQL_YYABORT;
+ /*
+ Let us add this item to list of all Item_trigger_field objects
+ in trigger.
+ */
+ lex->trg_table_fields.link_in_list((uchar*) trg_fld,
+ (uchar**) &trg_fld->next_trg_field);
+
+ $$= (Item *)trg_fld;
+ }
+ else
+ {
+ SELECT_LEX *sel= lex->current_select;
+ if (sel->no_table_names_allowed)
+ {
+ my_error(ER_TABLENAME_NOT_ALLOWED_HERE,
+ MYF(0), $1.str, thd->where);
+ }
+ $$= (sel->parsing_place != IN_HAVING ||
+ sel->get_in_sum_expr() > 0) ?
+ (Item*) new Item_field(Lex->current_context(), NullS, $1.str, $3.str) :
+ (Item*) new Item_ref(Lex->current_context(), NullS, $1.str, $3.str);
+ }
+ }
+ | '.' ident '.' ident
+ {
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ SELECT_LEX *sel= lex->current_select;
+ if (sel->no_table_names_allowed)
+ {
+ my_error(ER_TABLENAME_NOT_ALLOWED_HERE,
+ MYF(0), $2.str, thd->where);
+ }
+ $$= (sel->parsing_place != IN_HAVING ||
+ sel->get_in_sum_expr() > 0) ?
+ (Item*) new Item_field(Lex->current_context(), NullS, $2.str, $4.str) :
+ (Item*) new Item_ref(Lex->current_context(), NullS, $2.str, $4.str);
+ }
+ | ident '.' ident '.' ident
+ {
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ SELECT_LEX *sel= lex->current_select;
+ if (sel->no_table_names_allowed)
+ {
+ my_error(ER_TABLENAME_NOT_ALLOWED_HERE,
+ MYF(0), $3.str, thd->where);
+ }
+ $$= (sel->parsing_place != IN_HAVING ||
+ sel->get_in_sum_expr() > 0) ?
+ (Item*) new Item_field(Lex->current_context(),
+ (YYTHD->client_capabilities &
+ CLIENT_NO_SCHEMA ? NullS : $1.str),
+ $3.str, $5.str) :
+ (Item*) new Item_ref(Lex->current_context(),
+ (YYTHD->client_capabilities &
+ CLIENT_NO_SCHEMA ? NullS : $1.str),
+ $3.str, $5.str);
+ }
+ ;
field_ident:
- ident { $$=$1;}
- | ident '.' ident '.' ident
+ ident { $$=$1;}
+ | ident '.' ident '.' ident
{
TABLE_LIST *table= (TABLE_LIST*) Select->table_list.first;
if (my_strcasecmp(table_alias_charset, $1.str, table->db))
@@ -9667,7 +10268,7 @@ field_ident:
}
$$=$5;
}
- | ident '.' ident
+ | ident '.' ident
{
TABLE_LIST *table= (TABLE_LIST*) Select->table_list.first;
if (my_strcasecmp(table_alias_charset, $1.str, table->alias))
@@ -9677,24 +10278,30 @@ field_ident:
}
$$=$3;
}
- | '.' ident { $$=$2;} /* For Delphi */;
+ | '.' ident { $$=$2;} /* For Delphi */
+ ;
table_ident:
- ident { $$=new Table_ident($1); }
- | ident '.' ident { $$=new Table_ident(YYTHD, $1,$3,0);}
- | '.' ident { $$=new Table_ident($2);} /* For Delphi */
+ ident { $$=new Table_ident($1); }
+ | ident '.' ident { $$=new Table_ident(YYTHD, $1,$3,0);}
+ | '.' ident { $$=new Table_ident($2);} /* For Delphi */
;
table_ident_nodb:
- ident { LEX_STRING db={(char*) any_db,3}; $$=new Table_ident(YYTHD, db,$1,0); }
+ ident
+ {
+ LEX_STRING db={(char*) any_db,3};
+ $$=new Table_ident(YYTHD, db,$1,0);
+ }
;
IDENT_sys:
- IDENT { $$= $1; }
- | IDENT_QUOTED
- {
- THD *thd= YYTHD;
- if (thd->charset_is_system_charset)
+ IDENT { $$= $1; }
+ | IDENT_QUOTED
+ {
+ THD *thd= YYTHD;
+
+ if (thd->charset_is_system_charset)
{
CHARSET_INFO *cs= system_charset_info;
int dummy_error;
@@ -9707,176 +10314,180 @@ IDENT_sys:
cs->csname, $1.str + wlen);
MYSQL_YYABORT;
}
- $$= $1;
+ $$= $1;
}
- else
- thd->convert_string(&$$, system_charset_info,
- $1.str, $1.length, thd->charset());
- }
- ;
+ else
+ thd->convert_string(&$$, system_charset_info,
+ $1.str, $1.length, thd->charset());
+ }
+ ;
TEXT_STRING_sys:
- TEXT_STRING
- {
- THD *thd= YYTHD;
- if (thd->charset_is_system_charset)
- $$= $1;
- else
- thd->convert_string(&$$, system_charset_info,
- $1.str, $1.length, thd->charset());
- }
- ;
+ TEXT_STRING
+ {
+ THD *thd= YYTHD;
+
+ if (thd->charset_is_system_charset)
+ $$= $1;
+ else
+ thd->convert_string(&$$, system_charset_info,
+ $1.str, $1.length, thd->charset());
+ }
+ ;
TEXT_STRING_literal:
- TEXT_STRING
- {
- THD *thd= YYTHD;
- if (thd->charset_is_collation_connection)
- $$= $1;
- else
- thd->convert_string(&$$, thd->variables.collation_connection,
- $1.str, $1.length, thd->charset());
- }
- ;
+ TEXT_STRING
+ {
+ THD *thd= YYTHD;
+ if (thd->charset_is_collation_connection)
+ $$= $1;
+ else
+ thd->convert_string(&$$, thd->variables.collation_connection,
+ $1.str, $1.length, thd->charset());
+ }
+ ;
TEXT_STRING_filesystem:
- TEXT_STRING
- {
- THD *thd= YYTHD;
- if (thd->charset_is_character_set_filesystem)
- $$= $1;
- else
- thd->convert_string(&$$, thd->variables.character_set_filesystem,
- $1.str, $1.length, thd->charset());
- }
- ;
+ TEXT_STRING
+ {
+ THD *thd= YYTHD;
+
+ if (thd->charset_is_character_set_filesystem)
+ $$= $1;
+ else
+ thd->convert_string(&$$, thd->variables.character_set_filesystem,
+ $1.str, $1.length, thd->charset());
+ }
+ ;
ident:
- IDENT_sys { $$=$1; }
- | READ_ONLY_SYM
- {
- THD *thd= YYTHD;
- $$.str= thd->strmake("read_only",9);
- $$.length= 9;
- }
- | keyword
- {
- THD *thd= YYTHD;
- $$.str= thd->strmake($1.str, $1.length);
- $$.length= $1.length;
- }
- ;
+ IDENT_sys { $$=$1; }
+ | READ_ONLY_SYM
+ {
+ THD *thd= YYTHD;
+ $$.str= thd->strmake("read_only",9);
+ $$.length= 9;
+ }
+ | keyword
+ {
+ THD *thd= YYTHD;
+ $$.str= thd->strmake($1.str, $1.length);
+ $$.length= $1.length;
+ }
+ ;
label_ident:
- IDENT_sys { $$=$1; }
- | keyword_sp
- {
- THD *thd= YYTHD;
- $$.str= thd->strmake($1.str, $1.length);
- $$.length= $1.length;
- }
- ;
+ IDENT_sys { $$=$1; }
+ | keyword_sp
+ {
+ THD *thd= YYTHD;
+ $$.str= thd->strmake($1.str, $1.length);
+ $$.length= $1.length;
+ }
+ ;
ident_or_text:
- ident { $$=$1;}
- | TEXT_STRING_sys { $$=$1;}
- | LEX_HOSTNAME { $$=$1;};
+ ident { $$=$1;}
+ | TEXT_STRING_sys { $$=$1;}
+ | LEX_HOSTNAME { $$=$1;}
+ ;
user:
- ident_or_text
- {
- THD *thd= YYTHD;
- if (!($$=(LEX_USER*) thd->alloc(sizeof(st_lex_user))))
- MYSQL_YYABORT;
- $$->user = $1;
- $$->host.str= (char *) "%";
- $$->host.length= 1;
+ ident_or_text
+ {
+ THD *thd= YYTHD;
+ if (!($$=(LEX_USER*) thd->alloc(sizeof(st_lex_user))))
+ MYSQL_YYABORT;
+ $$->user = $1;
+ $$->host.str= (char *) "%";
+ $$->host.length= 1;
- if (check_string_char_length(&$$->user, ER(ER_USERNAME),
- USERNAME_CHAR_LENGTH,
- system_charset_info, 0))
- MYSQL_YYABORT;
- }
- | ident_or_text '@' ident_or_text
- {
- THD *thd= YYTHD;
- if (!($$=(LEX_USER*) thd->alloc(sizeof(st_lex_user))))
- MYSQL_YYABORT;
- $$->user = $1; $$->host=$3;
-
- if (check_string_char_length(&$$->user, ER(ER_USERNAME),
+ if (check_string_char_length(&$$->user, ER(ER_USERNAME),
+ USERNAME_CHAR_LENGTH,
+ system_charset_info, 0))
+ MYSQL_YYABORT;
+ }
+ | ident_or_text '@' ident_or_text
+ {
+ THD *thd= YYTHD;
+ if (!($$=(LEX_USER*) thd->alloc(sizeof(st_lex_user))))
+ MYSQL_YYABORT;
+ $$->user = $1; $$->host=$3;
+
+ if (check_string_char_length(&$$->user, ER(ER_USERNAME),
USERNAME_CHAR_LENGTH,
system_charset_info, 0) ||
- check_string_byte_length(&$$->host, ER(ER_HOSTNAME),
+ check_string_byte_length(&$$->host, ER(ER_HOSTNAME),
HOSTNAME_LENGTH))
- MYSQL_YYABORT;
- }
- | CURRENT_USER optional_braces
- {
- if (!($$=(LEX_USER*) YYTHD->alloc(sizeof(st_lex_user))))
- MYSQL_YYABORT;
- /*
- empty LEX_USER means current_user and
- will be handled in the get_current_user() function
- later
- */
- bzero($$, sizeof(LEX_USER));
- };
+ MYSQL_YYABORT;
+ }
+ | CURRENT_USER optional_braces
+ {
+ if (!($$=(LEX_USER*) YYTHD->alloc(sizeof(st_lex_user))))
+ MYSQL_YYABORT;
+ /*
+ empty LEX_USER means current_user and
+ will be handled in the get_current_user() function
+ later
+ */
+ bzero($$, sizeof(LEX_USER));
+ }
+ ;
/* Keyword that we allow for identifiers (except SP labels) */
keyword:
- keyword_sp {}
- | ASCII_SYM {}
- | BACKUP_SYM {}
- | BEGIN_SYM {}
- | BYTE_SYM {}
- | CACHE_SYM {}
- | CHARSET {}
- | CHECKSUM_SYM {}
- | CLOSE_SYM {}
- | COMMENT_SYM {}
- | COMMIT_SYM {}
- | CONTAINS_SYM {}
+ keyword_sp {}
+ | ASCII_SYM {}
+ | BACKUP_SYM {}
+ | BEGIN_SYM {}
+ | BYTE_SYM {}
+ | CACHE_SYM {}
+ | CHARSET {}
+ | CHECKSUM_SYM {}
+ | CLOSE_SYM {}
+ | COMMENT_SYM {}
+ | COMMIT_SYM {}
+ | CONTAINS_SYM {}
| DEALLOCATE_SYM {}
- | DO_SYM {}
- | END {}
- | EXECUTE_SYM {}
- | FLUSH_SYM {}
- | HANDLER_SYM {}
- | HELP_SYM {}
- | HOST_SYM {}
+ | DO_SYM {}
+ | END {}
+ | EXECUTE_SYM {}
+ | FLUSH_SYM {}
+ | HANDLER_SYM {}
+ | HELP_SYM {}
+ | HOST_SYM {}
| INSTALL_SYM {}
- | LANGUAGE_SYM {}
- | NO_SYM {}
- | OPEN_SYM {}
- | OPTIONS_SYM {}
- | OWNER_SYM {}
+ | LANGUAGE_SYM {}
+ | NO_SYM {}
+ | OPEN_SYM {}
+ | OPTIONS_SYM {}
+ | OWNER_SYM {}
| PARSER_SYM {}
- | PARTITION_SYM {}
+ | PARTITION_SYM {}
| PORT_SYM {}
| PREPARE_SYM {}
- | REMOVE_SYM {}
- | REPAIR {}
- | RESET_SYM {}
- | RESTORE_SYM {}
- | ROLLBACK_SYM {}
- | SAVEPOINT_SYM {}
- | SECURITY_SYM {}
+ | REMOVE_SYM {}
+ | REPAIR {}
+ | RESET_SYM {}
+ | RESTORE_SYM {}
+ | ROLLBACK_SYM {}
+ | SAVEPOINT_SYM {}
+ | SECURITY_SYM {}
| SERVER_SYM {}
- | SIGNED_SYM {}
- | SOCKET_SYM {}
- | SLAVE {}
+ | SIGNED_SYM {}
+ | SOCKET_SYM {}
+ | SLAVE {}
| SONAME_SYM {}
- | START_SYM {}
- | STOP_SYM {}
- | TRUNCATE_SYM {}
- | UNICODE_SYM {}
+ | START_SYM {}
+ | STOP_SYM {}
+ | TRUNCATE_SYM {}
+ | UNICODE_SYM {}
| UNINSTALL_SYM {}
- | WRAPPER_SYM {}
+ | WRAPPER_SYM {}
| XA_SYM {}
| UPGRADE_SYM {}
- ;
+ ;
/*
* Keywords that we allow for labels in SPs.
@@ -9885,590 +10496,603 @@ keyword:
* conflicts.
*/
keyword_sp:
- ACTION {}
- | ADDDATE_SYM {}
- | AFTER_SYM {}
- | AGAINST {}
- | AGGREGATE_SYM {}
- | ALGORITHM_SYM {}
- | ANY_SYM {}
- | AT_SYM {}
- | AUTHORS_SYM {}
- | AUTO_INC {}
- | AUTOEXTEND_SIZE_SYM {}
- | AVG_ROW_LENGTH {}
- | AVG_SYM {}
- | BINLOG_SYM {}
- | BIT_SYM {}
- | BLOCK_SYM {}
- | BOOL_SYM {}
- | BOOLEAN_SYM {}
- | BTREE_SYM {}
- | CASCADED {}
- | CHAIN_SYM {}
- | CHANGED {}
- | CIPHER_SYM {}
- | CLIENT_SYM {}
- | COALESCE {}
- | CODE_SYM {}
- | COLLATION_SYM {}
- | COLUMNS {}
- | COMMITTED_SYM {}
- | COMPACT_SYM {}
- | COMPLETION_SYM {}
- | COMPRESSED_SYM {}
- | CONCURRENT {}
- | CONNECTION_SYM {}
- | CONSISTENT_SYM {}
- | CONTEXT_SYM {}
- | CONTRIBUTORS_SYM {}
- | CPU_SYM {}
- | CUBE_SYM {}
- | DATA_SYM {}
- | DATAFILE_SYM {}
- | DATETIME {}
- | DATE_SYM {}
- | DAY_SYM {}
- | DEFINER_SYM {}
- | DELAY_KEY_WRITE_SYM {}
- | DES_KEY_FILE {}
- | DIRECTORY_SYM {}
- | DISABLE_SYM {}
- | DISCARD {}
- | DISK_SYM {}
- | DUMPFILE {}
- | DUPLICATE_SYM {}
- | DYNAMIC_SYM {}
- | ENDS_SYM {}
- | ENUM {}
- | ENGINE_SYM {}
- | ENGINES_SYM {}
- | ERRORS {}
- | ESCAPE_SYM {}
- | EVENT_SYM {}
- | EVENTS_SYM {}
- | EVERY_SYM {}
- | EXPANSION_SYM {}
- | EXTENDED_SYM {}
- | EXTENT_SIZE_SYM {}
- | FAST_SYM {}
- | FAULTS_SYM {}
- | FOUND_SYM {}
- | ENABLE_SYM {}
- | FULL {}
- | FILE_SYM {}
- | FIRST_SYM {}
- | FIXED_SYM {}
- | FRAC_SECOND_SYM {}
- | GEOMETRY_SYM {}
- | GEOMETRYCOLLECTION {}
- | GET_FORMAT {}
- | GRANTS {}
- | GLOBAL_SYM {}
- | HASH_SYM {}
- | HOSTS_SYM {}
- | HOUR_SYM {}
- | IDENTIFIED_SYM {}
- | INVOKER_SYM {}
- | IMPORT {}
- | INDEXES {}
- | INITIAL_SIZE_SYM {}
- | ISOLATION {}
- | ISSUER_SYM {}
- | INNOBASE_SYM {}
- | INSERT_METHOD {}
- | IO_SYM {}
- | IPC_SYM {}
- | KEY_BLOCK_SIZE {}
- | LAST_SYM {}
- | LEAVES {}
- | LESS_SYM {}
- | LEVEL_SYM {}
- | LINESTRING {}
- | LIST_SYM {}
- | LOCAL_SYM {}
- | LOCKS_SYM {}
- | LOGFILE_SYM {}
- | LOGS_SYM {}
- | MAX_ROWS {}
- | MASTER_SYM {}
- | MASTER_HOST_SYM {}
- | MASTER_PORT_SYM {}
- | MASTER_LOG_FILE_SYM {}
- | MASTER_LOG_POS_SYM {}
- | MASTER_USER_SYM {}
- | MASTER_PASSWORD_SYM {}
- | MASTER_SERVER_ID_SYM {}
- | MASTER_CONNECT_RETRY_SYM {}
- | MASTER_SSL_SYM {}
- | MASTER_SSL_CA_SYM {}
- | MASTER_SSL_CAPATH_SYM {}
- | MASTER_SSL_CERT_SYM {}
- | MASTER_SSL_CIPHER_SYM {}
- | MASTER_SSL_KEY_SYM {}
- | MAX_CONNECTIONS_PER_HOUR {}
- | MAX_QUERIES_PER_HOUR {}
- | MAX_SIZE_SYM {}
- | MAX_UPDATES_PER_HOUR {}
- | MAX_USER_CONNECTIONS_SYM {}
- | MAX_VALUE_SYM {}
- | MEDIUM_SYM {}
- | MEMORY_SYM {}
- | MERGE_SYM {}
- | MICROSECOND_SYM {}
- | MIGRATE_SYM {}
- | MINUTE_SYM {}
- | MIN_ROWS {}
- | MODIFY_SYM {}
- | MODE_SYM {}
- | MONTH_SYM {}
- | MULTILINESTRING {}
- | MULTIPOINT {}
- | MULTIPOLYGON {}
- | MUTEX_SYM {}
- | NAME_SYM {}
- | NAMES_SYM {}
- | NATIONAL_SYM {}
- | NCHAR_SYM {}
- | NDBCLUSTER_SYM {}
- | NEXT_SYM {}
- | NEW_SYM {}
- | NO_WAIT_SYM {}
- | NODEGROUP_SYM {}
- | NONE_SYM {}
- | NVARCHAR_SYM {}
- | OFFSET_SYM {}
- | OLD_PASSWORD {}
- | ONE_SHOT_SYM {}
- | ONE_SYM {}
- | PACK_KEYS_SYM {}
- | PAGE_SYM {}
- | PARTIAL {}
- | PARTITIONING_SYM {}
- | PARTITIONS_SYM {}
- | PASSWORD {}
- | PHASE_SYM {}
- | PLUGIN_SYM {}
- | PLUGINS_SYM {}
- | POINT_SYM {}
- | POLYGON {}
- | PRESERVE_SYM {}
- | PREV_SYM {}
- | PRIVILEGES {}
- | PROCESS {}
- | PROCESSLIST_SYM {}
- | PROFILE_SYM {}
- | PROFILES_SYM {}
- | QUARTER_SYM {}
- | QUERY_SYM {}
- | QUICK {}
- | REBUILD_SYM {}
- | RECOVER_SYM {}
- | REDO_BUFFER_SIZE_SYM {}
- | REDOFILE_SYM {}
- | REDUNDANT_SYM {}
- | RELAY_LOG_FILE_SYM {}
- | RELAY_LOG_POS_SYM {}
- | RELAY_THREAD {}
- | RELOAD {}
- | REORGANIZE_SYM {}
- | REPEATABLE_SYM {}
- | REPLICATION {}
- | RESOURCES {}
- | RESUME_SYM {}
- | RETURNS_SYM {}
- | ROLLUP_SYM {}
- | ROUTINE_SYM {}
- | ROWS_SYM {}
- | ROW_FORMAT_SYM {}
- | ROW_SYM {}
- | RTREE_SYM {}
- | SCHEDULE_SYM {}
- | SECOND_SYM {}
- | SERIAL_SYM {}
- | SERIALIZABLE_SYM {}
- | SESSION_SYM {}
- | SIMPLE_SYM {}
- | SHARE_SYM {}
- | SHUTDOWN {}
- | SNAPSHOT_SYM {}
- | SOUNDS_SYM {}
- | SOURCE_SYM {}
- | SQL_CACHE_SYM {}
- | SQL_BUFFER_RESULT {}
- | SQL_NO_CACHE_SYM {}
- | SQL_THREAD {}
- | STARTS_SYM {}
- | STATUS_SYM {}
- | STORAGE_SYM {}
- | STRING_SYM {}
- | SUBDATE_SYM {}
- | SUBJECT_SYM {}
- | SUBPARTITION_SYM {}
- | SUBPARTITIONS_SYM {}
- | SUPER_SYM {}
- | SUSPEND_SYM {}
- | SWAPS_SYM {}
- | SWITCHES_SYM {}
- | TABLES {}
- | TABLESPACE {}
- | TEMPORARY {}
- | TEMPTABLE_SYM {}
- | TEXT_SYM {}
- | THAN_SYM {}
- | TRANSACTION_SYM {}
- | TRIGGERS_SYM {}
- | TIMESTAMP {}
- | TIMESTAMP_ADD {}
- | TIMESTAMP_DIFF {}
- | TIME_SYM {}
- | TYPES_SYM {}
- | TYPE_SYM {}
- | UDF_RETURNS_SYM {}
- | FUNCTION_SYM {}
- | UNCOMMITTED_SYM {}
- | UNDEFINED_SYM {}
- | UNDO_BUFFER_SIZE_SYM {}
- | UNDOFILE_SYM {}
- | UNKNOWN_SYM {}
- | UNTIL_SYM {}
- | USER {}
- | USE_FRM {}
- | VARIABLES {}
- | VIEW_SYM {}
- | VALUE_SYM {}
- | WARNINGS {}
- | WAIT_SYM {}
- | WEEK_SYM {}
- | WORK_SYM {}
- | X509_SYM {}
- | YEAR_SYM {}
- ;
+ ACTION {}
+ | ADDDATE_SYM {}
+ | AFTER_SYM {}
+ | AGAINST {}
+ | AGGREGATE_SYM {}
+ | ALGORITHM_SYM {}
+ | ANY_SYM {}
+ | AT_SYM {}
+ | AUTHORS_SYM {}
+ | AUTO_INC {}
+ | AUTOEXTEND_SIZE_SYM {}
+ | AVG_ROW_LENGTH {}
+ | AVG_SYM {}
+ | BINLOG_SYM {}
+ | BIT_SYM {}
+ | BLOCK_SYM {}
+ | BOOL_SYM {}
+ | BOOLEAN_SYM {}
+ | BTREE_SYM {}
+ | CASCADED {}
+ | CHAIN_SYM {}
+ | CHANGED {}
+ | CIPHER_SYM {}
+ | CLIENT_SYM {}
+ | COALESCE {}
+ | CODE_SYM {}
+ | COLLATION_SYM {}
+ | COLUMNS {}
+ | COMMITTED_SYM {}
+ | COMPACT_SYM {}
+ | COMPLETION_SYM {}
+ | COMPRESSED_SYM {}
+ | CONCURRENT {}
+ | CONNECTION_SYM {}
+ | CONSISTENT_SYM {}
+ | CONTEXT_SYM {}
+ | CONTRIBUTORS_SYM {}
+ | CPU_SYM {}
+ | CUBE_SYM {}
+ | DATA_SYM {}
+ | DATAFILE_SYM {}
+ | DATETIME {}
+ | DATE_SYM {}
+ | DAY_SYM {}
+ | DEFINER_SYM {}
+ | DELAY_KEY_WRITE_SYM {}
+ | DES_KEY_FILE {}
+ | DIRECTORY_SYM {}
+ | DISABLE_SYM {}
+ | DISCARD {}
+ | DISK_SYM {}
+ | DUMPFILE {}
+ | DUPLICATE_SYM {}
+ | DYNAMIC_SYM {}
+ | ENDS_SYM {}
+ | ENUM {}
+ | ENGINE_SYM {}
+ | ENGINES_SYM {}
+ | ERRORS {}
+ | ESCAPE_SYM {}
+ | EVENT_SYM {}
+ | EVENTS_SYM {}
+ | EVERY_SYM {}
+ | EXPANSION_SYM {}
+ | EXTENDED_SYM {}
+ | EXTENT_SIZE_SYM {}
+ | FAULTS_SYM {}
+ | FAST_SYM {}
+ | FOUND_SYM {}
+ | ENABLE_SYM {}
+ | FULL {}
+ | FILE_SYM {}
+ | FIRST_SYM {}
+ | FIXED_SYM {}
+ | FRAC_SECOND_SYM {}
+ | GEOMETRY_SYM {}
+ | GEOMETRYCOLLECTION {}
+ | GET_FORMAT {}
+ | GRANTS {}
+ | GLOBAL_SYM {}
+ | HASH_SYM {}
+ | HOSTS_SYM {}
+ | HOUR_SYM {}
+ | IDENTIFIED_SYM {}
+ | INVOKER_SYM {}
+ | IMPORT {}
+ | INDEXES {}
+ | INITIAL_SIZE_SYM {}
+ | IO_SYM {}
+ | IPC_SYM {}
+ | ISOLATION {}
+ | ISSUER_SYM {}
+ | INNOBASE_SYM {}
+ | INSERT_METHOD {}
+ | KEY_BLOCK_SIZE {}
+ | LAST_SYM {}
+ | LEAVES {}
+ | LESS_SYM {}
+ | LEVEL_SYM {}
+ | LINESTRING {}
+ | LIST_SYM {}
+ | LOCAL_SYM {}
+ | LOCKS_SYM {}
+ | LOGFILE_SYM {}
+ | LOGS_SYM {}
+ | MAX_ROWS {}
+ | MASTER_SYM {}
+ | MASTER_HOST_SYM {}
+ | MASTER_PORT_SYM {}
+ | MASTER_LOG_FILE_SYM {}
+ | MASTER_LOG_POS_SYM {}
+ | MASTER_USER_SYM {}
+ | MASTER_PASSWORD_SYM {}
+ | MASTER_SERVER_ID_SYM {}
+ | MASTER_CONNECT_RETRY_SYM {}
+ | MASTER_SSL_SYM {}
+ | MASTER_SSL_CA_SYM {}
+ | MASTER_SSL_CAPATH_SYM {}
+ | MASTER_SSL_CERT_SYM {}
+ | MASTER_SSL_CIPHER_SYM {}
+ | MASTER_SSL_KEY_SYM {}
+ | MAX_CONNECTIONS_PER_HOUR {}
+ | MAX_QUERIES_PER_HOUR {}
+ | MAX_SIZE_SYM {}
+ | MAX_UPDATES_PER_HOUR {}
+ | MAX_USER_CONNECTIONS_SYM {}
+ | MAX_VALUE_SYM {}
+ | MEDIUM_SYM {}
+ | MEMORY_SYM {}
+ | MERGE_SYM {}
+ | MICROSECOND_SYM {}
+ | MIGRATE_SYM {}
+ | MINUTE_SYM {}
+ | MIN_ROWS {}
+ | MODIFY_SYM {}
+ | MODE_SYM {}
+ | MONTH_SYM {}
+ | MULTILINESTRING {}
+ | MULTIPOINT {}
+ | MULTIPOLYGON {}
+ | MUTEX_SYM {}
+ | NAME_SYM {}
+ | NAMES_SYM {}
+ | NATIONAL_SYM {}
+ | NCHAR_SYM {}
+ | NDBCLUSTER_SYM {}
+ | NEXT_SYM {}
+ | NEW_SYM {}
+ | NO_WAIT_SYM {}
+ | NODEGROUP_SYM {}
+ | NONE_SYM {}
+ | NVARCHAR_SYM {}
+ | OFFSET_SYM {}
+ | OLD_PASSWORD {}
+ | ONE_SHOT_SYM {}
+ | ONE_SYM {}
+ | PACK_KEYS_SYM {}
+ | PAGE_SYM {}
+ | PARTIAL {}
+ | PARTITIONING_SYM {}
+ | PARTITIONS_SYM {}
+ | PASSWORD {}
+ | PHASE_SYM {}
+ | PLUGIN_SYM {}
+ | PLUGINS_SYM {}
+ | POINT_SYM {}
+ | POLYGON {}
+ | PRESERVE_SYM {}
+ | PREV_SYM {}
+ | PRIVILEGES {}
+ | PROCESS {}
+ | PROCESSLIST_SYM {}
+ | PROFILE_SYM {}
+ | PROFILES_SYM {}
+ | QUARTER_SYM {}
+ | QUERY_SYM {}
+ | QUICK {}
+ | REBUILD_SYM {}
+ | RECOVER_SYM {}
+ | REDO_BUFFER_SIZE_SYM {}
+ | REDOFILE_SYM {}
+ | REDUNDANT_SYM {}
+ | RELAY_LOG_FILE_SYM {}
+ | RELAY_LOG_POS_SYM {}
+ | RELAY_THREAD {}
+ | RELOAD {}
+ | REORGANIZE_SYM {}
+ | REPEATABLE_SYM {}
+ | REPLICATION {}
+ | RESOURCES {}
+ | RESUME_SYM {}
+ | RETURNS_SYM {}
+ | ROLLUP_SYM {}
+ | ROUTINE_SYM {}
+ | ROWS_SYM {}
+ | ROW_FORMAT_SYM {}
+ | ROW_SYM {}
+ | RTREE_SYM {}
+ | SCHEDULE_SYM {}
+ | SECOND_SYM {}
+ | SERIAL_SYM {}
+ | SERIALIZABLE_SYM {}
+ | SESSION_SYM {}
+ | SIMPLE_SYM {}
+ | SHARE_SYM {}
+ | SHUTDOWN {}
+ | SNAPSHOT_SYM {}
+ | SOUNDS_SYM {}
+ | SOURCE_SYM {}
+ | SQL_CACHE_SYM {}
+ | SQL_BUFFER_RESULT {}
+ | SQL_NO_CACHE_SYM {}
+ | SQL_THREAD {}
+ | STARTS_SYM {}
+ | STATUS_SYM {}
+ | STORAGE_SYM {}
+ | STRING_SYM {}
+ | SUBDATE_SYM {}
+ | SUBJECT_SYM {}
+ | SUBPARTITION_SYM {}
+ | SUBPARTITIONS_SYM {}
+ | SUPER_SYM {}
+ | SUSPEND_SYM {}
+ | SWAPS_SYM {}
+ | SWITCHES_SYM {}
+ | TABLES {}
+ | TABLESPACE {}
+ | TEMPORARY {}
+ | TEMPTABLE_SYM {}
+ | TEXT_SYM {}
+ | THAN_SYM {}
+ | TRANSACTION_SYM {}
+ | TRANSACTIONAL_SYM {}
+ | TRIGGERS_SYM {}
+ | TIMESTAMP {}
+ | TIMESTAMP_ADD {}
+ | TIMESTAMP_DIFF {}
+ | TIME_SYM {}
+ | TYPES_SYM {}
+ | TYPE_SYM {}
+ | UDF_RETURNS_SYM {}
+ | FUNCTION_SYM {}
+ | UNCOMMITTED_SYM {}
+ | UNDEFINED_SYM {}
+ | UNDO_BUFFER_SIZE_SYM {}
+ | UNDOFILE_SYM {}
+ | UNKNOWN_SYM {}
+ | UNTIL_SYM {}
+ | USER {}
+ | USE_FRM {}
+ | VARIABLES {}
+ | VIEW_SYM {}
+ | VALUE_SYM {}
+ | WARNINGS {}
+ | WAIT_SYM {}
+ | WEEK_SYM {}
+ | WORK_SYM {}
+ | X509_SYM {}
+ | YEAR_SYM {}
+ ;
/* Option functions */
set:
- SET opt_option
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_SET_OPTION;
- mysql_init_select(lex);
- lex->option_type=OPT_SESSION;
- lex->var_list.empty();
- lex->one_shot_set= 0;
- }
- option_value_list
- {}
- ;
+ SET opt_option
+ {
+ LEX *lex=Lex;
+ lex->sql_command= SQLCOM_SET_OPTION;
+ mysql_init_select(lex);
+ lex->option_type=OPT_SESSION;
+ lex->var_list.empty();
+ lex->one_shot_set= 0;
+ }
+ option_value_list
+ {}
+ ;
opt_option:
- /* empty */ {}
- | OPTION {};
+ /* empty */ {}
+ | OPTION {}
+ ;
option_value_list:
- option_type_value
- | option_value_list ',' option_type_value;
+ option_type_value
+ | option_value_list ',' option_type_value
+ ;
option_type_value:
- {
- if (Lex->sphead)
{
- /*
- If we are in SP we want have own LEX for each assignment.
- This is mostly because it is hard for several sp_instr_set
- and sp_instr_set_trigger instructions share one LEX.
- (Well, it is theoretically possible but adds some extra
- overhead on preparation for execution stage and IMO less
- robust).
-
- QQ: May be we should simply prohibit group assignments in SP?
- */
- LEX *lex;
- Lex->sphead->reset_lex(YYTHD);
- lex= Lex;
-
- /* Set new LEX as if we at start of set rule. */
- lex->sql_command= SQLCOM_SET_OPTION;
- mysql_init_select(lex);
- lex->option_type=OPT_SESSION;
- lex->var_list.empty();
- lex->one_shot_set= 0;
- lex->sphead->m_tmp_query= lex->tok_start;
- }
- }
- ext_option_value
- {
- LEX *lex= Lex;
-
- if (lex->sphead)
- {
- sp_head *sp= lex->sphead;
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
- if (!lex->var_list.is_empty())
- {
+ if (lex->sphead)
+ {
/*
- We have assignment to user or system variable or
- option setting, so we should construct sp_instr_stmt
- for it.
+ If we are in SP we want have own LEX for each assignment.
+ This is mostly because it is hard for several sp_instr_set
+ and sp_instr_set_trigger instructions share one LEX.
+ (Well, it is theoretically possible but adds some extra
+ overhead on preparation for execution stage and IMO less
+ robust).
+
+ QQ: May be we should simply prohibit group assignments in SP?
*/
- LEX_STRING qbuff;
- sp_instr_stmt *i;
+ lex->sphead->reset_lex(thd);
+ lex= thd->lex;
+
+ /* Set new LEX as if we at start of set rule. */
+ lex->sql_command= SQLCOM_SET_OPTION;
+ mysql_init_select(lex);
+ lex->option_type=OPT_SESSION;
+ lex->var_list.empty();
+ lex->one_shot_set= 0;
+ lex->sphead->m_tmp_query= lip->get_tok_start();
+ }
+ }
+ ext_option_value
+ {
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
- if (!(i= new sp_instr_stmt(sp->instructions(), lex->spcont,
- lex)))
- MYSQL_YYABORT;
+ if (lex->sphead)
+ {
+ sp_head *sp= lex->sphead;
- /*
- Extract the query statement from the tokenizer. The
- end is either lex->ptr, if there was no lookahead,
- lex->tok_end otherwise.
- */
- if (yychar == YYEMPTY)
- qbuff.length= lex->ptr - sp->m_tmp_query;
- else
- qbuff.length= lex->tok_end - sp->m_tmp_query;
+ if (!lex->var_list.is_empty())
+ {
+ /*
+ We have assignment to user or system variable or
+ option setting, so we should construct sp_instr_stmt
+ for it.
+ */
+ LEX_STRING qbuff;
+ sp_instr_stmt *i;
+
+ if (!(i= new sp_instr_stmt(sp->instructions(), lex->spcont,
+ lex)))
+ MYSQL_YYABORT;
- if (!(qbuff.str= alloc_root(YYTHD->mem_root, qbuff.length + 5)))
- MYSQL_YYABORT;
+ /*
+ Extract the query statement from the tokenizer. The
+ end is either lip->ptr, if there was no lookahead,
+ lip->tok_end otherwise.
+ */
+ if (yychar == YYEMPTY)
+ qbuff.length= lip->get_ptr() - sp->m_tmp_query;
+ else
+ qbuff.length= lip->get_tok_end() - sp->m_tmp_query;
+
+ if (!(qbuff.str= (char*) alloc_root(thd->mem_root,
+ qbuff.length + 5)))
+ MYSQL_YYABORT;
- strmake(strmake(qbuff.str, "SET ", 4), sp->m_tmp_query,
- qbuff.length);
- qbuff.length+= 4;
- i->m_query= qbuff;
- sp->add_instr(i);
+ strmake(strmake(qbuff.str, "SET ", 4), sp->m_tmp_query,
+ qbuff.length);
+ qbuff.length+= 4;
+ i->m_query= qbuff;
+ sp->add_instr(i);
+ }
+ lex->sphead->restore_lex(thd);
}
- lex->sphead->restore_lex(YYTHD);
}
- };
+ ;
option_type:
- option_type2 {}
- | GLOBAL_SYM { $$=OPT_GLOBAL; }
- | LOCAL_SYM { $$=OPT_SESSION; }
- | SESSION_SYM { $$=OPT_SESSION; }
- ;
+ option_type2 {}
+ | GLOBAL_SYM { $$=OPT_GLOBAL; }
+ | LOCAL_SYM { $$=OPT_SESSION; }
+ | SESSION_SYM { $$=OPT_SESSION; }
+ ;
option_type2:
- /* empty */ { $$= OPT_DEFAULT; }
- | ONE_SHOT_SYM { Lex->one_shot_set= 1; $$= OPT_SESSION; }
- ;
+ /* empty */ { $$= OPT_DEFAULT; }
+ | ONE_SHOT_SYM { Lex->one_shot_set= 1; $$= OPT_SESSION; }
+ ;
opt_var_type:
- /* empty */ { $$=OPT_SESSION; }
- | GLOBAL_SYM { $$=OPT_GLOBAL; }
- | LOCAL_SYM { $$=OPT_SESSION; }
- | SESSION_SYM { $$=OPT_SESSION; }
- ;
+ /* empty */ { $$=OPT_SESSION; }
+ | GLOBAL_SYM { $$=OPT_GLOBAL; }
+ | LOCAL_SYM { $$=OPT_SESSION; }
+ | SESSION_SYM { $$=OPT_SESSION; }
+ ;
opt_var_ident_type:
- /* empty */ { $$=OPT_DEFAULT; }
- | GLOBAL_SYM '.' { $$=OPT_GLOBAL; }
- | LOCAL_SYM '.' { $$=OPT_SESSION; }
- | SESSION_SYM '.' { $$=OPT_SESSION; }
- ;
+ /* empty */ { $$=OPT_DEFAULT; }
+ | GLOBAL_SYM '.' { $$=OPT_GLOBAL; }
+ | LOCAL_SYM '.' { $$=OPT_SESSION; }
+ | SESSION_SYM '.' { $$=OPT_SESSION; }
+ ;
ext_option_value:
- sys_option_value
- | option_type2 option_value;
+ sys_option_value
+ | option_type2 option_value
+ ;
sys_option_value:
- option_type internal_variable_name equal set_expr_or_default
- {
- LEX *lex=Lex;
-
- if ($2.var == trg_new_row_fake_var)
+ option_type internal_variable_name equal set_expr_or_default
{
- /* We are in trigger and assigning value to field of new row */
- Item *it;
- Item_trigger_field *trg_fld;
- sp_instr_set_trigger_field *sp_fld;
- LINT_INIT(sp_fld);
- if ($1)
- {
- my_parse_error(ER(ER_SYNTAX_ERROR));
- MYSQL_YYABORT;
- }
- if ($4)
- it= $4;
- else
+ LEX *lex=Lex;
+
+ if ($2.var == trg_new_row_fake_var)
{
- /* QQ: Shouldn't this be field's default value ? */
- it= new Item_null();
- }
+ /* We are in trigger and assigning value to field of new row */
+ Item *it;
+ Item_trigger_field *trg_fld;
+ sp_instr_set_trigger_field *sp_fld;
+ LINT_INIT(sp_fld);
+ if ($1)
+ {
+ my_parse_error(ER(ER_SYNTAX_ERROR));
+ MYSQL_YYABORT;
+ }
+ if ($4)
+ it= $4;
+ else
+ {
+ /* QQ: Shouldn't this be field's default value ? */
+ it= new Item_null();
+ }
- DBUG_ASSERT(lex->trg_chistics.action_time == TRG_ACTION_BEFORE &&
- (lex->trg_chistics.event == TRG_EVENT_INSERT ||
- lex->trg_chistics.event == TRG_EVENT_UPDATE));
- if (!(trg_fld= new Item_trigger_field(Lex->current_context(),
- Item_trigger_field::NEW_ROW,
- $2.base_name.str,
- UPDATE_ACL, FALSE)) ||
- !(sp_fld= new sp_instr_set_trigger_field(lex->sphead->
- instructions(),
- lex->spcont,
- trg_fld,
- it, lex)))
- MYSQL_YYABORT;
+ DBUG_ASSERT(lex->trg_chistics.action_time == TRG_ACTION_BEFORE &&
+ (lex->trg_chistics.event == TRG_EVENT_INSERT ||
+ lex->trg_chistics.event == TRG_EVENT_UPDATE));
+ if (!(trg_fld= new Item_trigger_field(Lex->current_context(),
+ Item_trigger_field::NEW_ROW,
+ $2.base_name.str,
+ UPDATE_ACL, FALSE)) ||
+ !(sp_fld= new sp_instr_set_trigger_field(lex->sphead->
+ instructions(),
+ lex->spcont,
+ trg_fld,
+ it, lex)))
+ MYSQL_YYABORT;
- /*
- Let us add this item to list of all Item_trigger_field
- objects in trigger.
- */
- lex->trg_table_fields.link_in_list((byte *)trg_fld,
- (byte **)&trg_fld->next_trg_field);
+ /*
+ Let us add this item to list of all Item_trigger_field
+ objects in trigger.
+ */
+ lex->trg_table_fields.link_in_list((uchar *)trg_fld,
+ (uchar **) &trg_fld->
+ next_trg_field);
- lex->sphead->add_instr(sp_fld);
- }
- else if ($2.var)
- { /* System variable */
- if ($1)
- lex->option_type= $1;
- lex->var_list.push_back(new set_var(lex->option_type, $2.var,
- &$2.base_name, $4));
- }
- else
- {
- /* An SP local variable */
- sp_pcontext *ctx= lex->spcont;
- sp_variable_t *spv;
- sp_instr_set *sp_set;
- Item *it;
- if ($1)
- {
- my_parse_error(ER(ER_SYNTAX_ERROR));
- MYSQL_YYABORT;
+ lex->sphead->add_instr(sp_fld);
}
+ else if ($2.var)
+ { /* System variable */
+ if ($1)
+ lex->option_type= $1;
+ lex->var_list.push_back(new set_var(lex->option_type, $2.var,
+ &$2.base_name, $4));
+ }
+ else
+ {
+ /* An SP local variable */
+ sp_pcontext *ctx= lex->spcont;
+ sp_variable_t *spv;
+ sp_instr_set *sp_set;
+ Item *it;
+ if ($1)
+ {
+ my_parse_error(ER(ER_SYNTAX_ERROR));
+ MYSQL_YYABORT;
+ }
- spv= ctx->find_variable(&$2.base_name);
+ spv= ctx->find_variable(&$2.base_name);
- if ($4)
- it= $4;
- else if (spv->dflt)
- it= spv->dflt;
- else
- it= new Item_null();
- sp_set= new sp_instr_set(lex->sphead->instructions(), ctx,
- spv->offset, it, spv->type, lex, TRUE);
- lex->sphead->add_instr(sp_set);
+ if ($4)
+ it= $4;
+ else if (spv->dflt)
+ it= spv->dflt;
+ else
+ it= new Item_null();
+ sp_set= new sp_instr_set(lex->sphead->instructions(), ctx,
+ spv->offset, it, spv->type, lex, TRUE);
+ lex->sphead->add_instr(sp_set);
+ }
}
- }
| option_type TRANSACTION_SYM ISOLATION LEVEL_SYM isolation_types
- {
- LEX *lex=Lex;
- lex->option_type= $1;
- lex->var_list.push_back(new set_var(lex->option_type,
- find_sys_var("tx_isolation"),
- &null_lex_str,
- new Item_int((int32) $5)));
- }
+ {
+ LEX *lex=Lex;
+ lex->option_type= $1;
+ lex->var_list.push_back(new set_var(lex->option_type,
+ find_sys_var(YYTHD, "tx_isolation"),
+ &null_lex_str,
+ new Item_int((int32) $5)));
+ }
;
option_value:
- '@' ident_or_text equal expr
- {
- Lex->var_list.push_back(new set_var_user(new Item_func_set_user_var($2,$4)));
- }
- | '@' '@' opt_var_ident_type internal_variable_name equal set_expr_or_default
- {
- LEX *lex=Lex;
- lex->var_list.push_back(new set_var($3, $4.var, &$4.base_name, $6));
- }
- | charset old_or_new_charset_name_or_default
- {
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- $2= $2 ? $2: global_system_variables.character_set_client;
- lex->var_list.push_back(new set_var_collation_client($2,thd->variables.collation_database,$2));
- }
+ '@' ident_or_text equal expr
+ {
+ Lex->var_list.push_back(new set_var_user(new Item_func_set_user_var($2,$4)));
+ }
+ | '@' '@' opt_var_ident_type internal_variable_name equal set_expr_or_default
+ {
+ LEX *lex=Lex;
+ lex->var_list.push_back(new set_var($3, $4.var, &$4.base_name, $6));
+ }
+ | charset old_or_new_charset_name_or_default
+ {
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ $2= $2 ? $2: global_system_variables.character_set_client;
+ lex->var_list.push_back(new set_var_collation_client($2,thd->variables.collation_database,$2));
+ }
| NAMES_SYM equal expr
- {
- LEX *lex= Lex;
+ {
+ LEX *lex= Lex;
sp_pcontext *spc= lex->spcont;
- LEX_STRING names;
+ LEX_STRING names;
- names.str= (char *)"names";
- names.length= 5;
- if (spc && spc->find_variable(&names))
+ names.str= (char *)"names";
+ names.length= 5;
+ if (spc && spc->find_variable(&names))
my_error(ER_SP_BAD_VAR_SHADOW, MYF(0), names.str);
else
my_parse_error(ER(ER_SYNTAX_ERROR));
- MYSQL_YYABORT;
- }
- | NAMES_SYM charset_name_or_default opt_collate
- {
- LEX *lex= Lex;
- $2= $2 ? $2 : global_system_variables.character_set_client;
- $3= $3 ? $3 : $2;
- if (!my_charset_same($2,$3))
- {
- my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
- $3->name, $2->csname);
- MYSQL_YYABORT;
- }
- lex->var_list.push_back(new set_var_collation_client($3,$3,$3));
- }
- | PASSWORD equal text_or_password
- {
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- LEX_USER *user;
+ MYSQL_YYABORT;
+ }
+ | NAMES_SYM charset_name_or_default opt_collate
+ {
+ LEX *lex= Lex;
+ $2= $2 ? $2 : global_system_variables.character_set_client;
+ $3= $3 ? $3 : $2;
+ if (!my_charset_same($2,$3))
+ {
+ my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
+ $3->name, $2->csname);
+ MYSQL_YYABORT;
+ }
+ lex->var_list.push_back(new set_var_collation_client($3,$3,$3));
+ }
+ | PASSWORD equal text_or_password
+ {
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ LEX_USER *user;
sp_pcontext *spc= lex->spcont;
- LEX_STRING pw;
+ LEX_STRING pw;
- pw.str= (char *)"password";
- pw.length= 8;
- if (spc && spc->find_variable(&pw))
- {
+ pw.str= (char *)"password";
+ pw.length= 8;
+ if (spc && spc->find_variable(&pw))
+ {
my_error(ER_SP_BAD_VAR_SHADOW, MYF(0), pw.str);
- MYSQL_YYABORT;
- }
- if (!(user=(LEX_USER*) thd->alloc(sizeof(LEX_USER))))
- MYSQL_YYABORT;
- user->host=null_lex_str;
- user->user.str=thd->security_ctx->priv_user;
- thd->lex->var_list.push_back(new set_var_password(user, $3));
- }
- | PASSWORD FOR_SYM user equal text_or_password
- {
- Lex->var_list.push_back(new set_var_password($3,$5));
- }
- ;
+ MYSQL_YYABORT;
+ }
+ if (!(user=(LEX_USER*) thd->alloc(sizeof(LEX_USER))))
+ MYSQL_YYABORT;
+ user->host=null_lex_str;
+ user->user.str=thd->security_ctx->priv_user;
+ thd->lex->var_list.push_back(new set_var_password(user, $3));
+ }
+ | PASSWORD FOR_SYM user equal text_or_password
+ {
+ Lex->var_list.push_back(new set_var_password($3,$5));
+ }
+ ;
internal_variable_name:
- ident
- {
- LEX *lex= Lex;
- sp_pcontext *spc= lex->spcont;
- sp_variable_t *spv;
-
- /* We have to lookup here since local vars can shadow sysvars */
- if (!spc || !(spv = spc->find_variable(&$1)))
- {
- /* Not an SP local variable */
- sys_var *tmp=find_sys_var($1.str, $1.length);
- if (!tmp)
- MYSQL_YYABORT;
- $$.var= tmp;
- $$.base_name= null_lex_str;
- if (spc && tmp == &sys_autocommit)
+ ident
+ {
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ sp_pcontext *spc= lex->spcont;
+ sp_variable_t *spv;
+
+ /* We have to lookup here since local vars can shadow sysvars */
+ if (!spc || !(spv = spc->find_variable(&$1)))
{
- /*
- We don't allow setting AUTOCOMMIT from a stored function
- or trigger.
- */
- lex->sphead->m_flags|= sp_head::HAS_SET_AUTOCOMMIT_STMT;
- }
- }
- else
- {
- /* An SP local variable */
- $$.var= NULL;
- $$.base_name= $1;
- }
- }
- | ident '.' ident
- {
+ /* Not an SP local variable */
+ sys_var *tmp=find_sys_var(thd, $1.str, $1.length);
+ if (!tmp)
+ MYSQL_YYABORT;
+ $$.var= tmp;
+ $$.base_name= null_lex_str;
+ if (spc && tmp == &sys_autocommit)
+ {
+ /*
+ We don't allow setting AUTOCOMMIT from a stored function
+ or trigger.
+ */
+ lex->sphead->m_flags|= sp_head::HAS_SET_AUTOCOMMIT_STMT;
+ }
+ }
+ else
+ {
+ /* An SP local variable */
+ $$.var= NULL;
+ $$.base_name= $1;
+ }
+ }
+ | ident '.' ident
+ {
LEX *lex= Lex;
if (check_reserved_words(&$1))
{
@@ -10501,7 +11125,7 @@ internal_variable_name:
}
else
{
- sys_var *tmp=find_sys_var($3.str, $3.length);
+ sys_var *tmp=find_sys_var(YYTHD, $3.str, $3.length);
if (!tmp)
MYSQL_YYABORT;
if (!tmp->is_struct())
@@ -10509,523 +11133,533 @@ internal_variable_name:
$$.var= tmp;
$$.base_name= $1;
}
- }
- | DEFAULT '.' ident
- {
- sys_var *tmp=find_sys_var($3.str, $3.length);
- if (!tmp)
- MYSQL_YYABORT;
- if (!tmp->is_struct())
- my_error(ER_VARIABLE_IS_NOT_STRUCT, MYF(0), $3.str);
- $$.var= tmp;
- $$.base_name.str= (char*) "default";
- $$.base_name.length= 7;
- }
+ }
+ | DEFAULT '.' ident
+ {
+ sys_var *tmp=find_sys_var(YYTHD, $3.str, $3.length);
+ if (!tmp)
+ MYSQL_YYABORT;
+ if (!tmp->is_struct())
+ my_error(ER_VARIABLE_IS_NOT_STRUCT, MYF(0), $3.str);
+ $$.var= tmp;
+ $$.base_name.str= (char*) "default";
+ $$.base_name.length= 7;
+ }
;
isolation_types:
- READ_SYM UNCOMMITTED_SYM { $$= ISO_READ_UNCOMMITTED; }
- | READ_SYM COMMITTED_SYM { $$= ISO_READ_COMMITTED; }
- | REPEATABLE_SYM READ_SYM { $$= ISO_REPEATABLE_READ; }
- | SERIALIZABLE_SYM { $$= ISO_SERIALIZABLE; }
- ;
+ READ_SYM UNCOMMITTED_SYM { $$= ISO_READ_UNCOMMITTED; }
+ | READ_SYM COMMITTED_SYM { $$= ISO_READ_COMMITTED; }
+ | REPEATABLE_SYM READ_SYM { $$= ISO_REPEATABLE_READ; }
+ | SERIALIZABLE_SYM { $$= ISO_SERIALIZABLE; }
+ ;
text_or_password:
- TEXT_STRING { $$=$1.str;}
- | PASSWORD '(' TEXT_STRING ')'
- {
- $$= $3.length ? YYTHD->variables.old_passwords ?
- Item_func_old_password::alloc(YYTHD, $3.str) :
- Item_func_password::alloc(YYTHD, $3.str) :
- $3.str;
- }
- | OLD_PASSWORD '(' TEXT_STRING ')'
- {
- $$= $3.length ? Item_func_old_password::alloc(YYTHD, $3.str) :
- $3.str;
- }
- ;
+ TEXT_STRING { $$=$1.str;}
+ | PASSWORD '(' TEXT_STRING ')'
+ {
+ $$= $3.length ? YYTHD->variables.old_passwords ?
+ Item_func_old_password::alloc(YYTHD, $3.str) :
+ Item_func_password::alloc(YYTHD, $3.str) :
+ $3.str;
+ }
+ | OLD_PASSWORD '(' TEXT_STRING ')'
+ {
+ $$= $3.length ? Item_func_old_password::alloc(YYTHD, $3.str) :
+ $3.str;
+ }
+ ;
set_expr_or_default:
- expr { $$=$1; }
- | DEFAULT { $$=0; }
- | ON { $$=new Item_string("ON", 2, system_charset_info); }
- | ALL { $$=new Item_string("ALL", 3, system_charset_info); }
- | BINARY { $$=new Item_string("binary", 6, system_charset_info); }
- ;
-
+ expr { $$=$1; }
+ | DEFAULT { $$=0; }
+ | ON { $$=new Item_string("ON", 2, system_charset_info); }
+ | ALL { $$=new Item_string("ALL", 3, system_charset_info); }
+ | BINARY { $$=new Item_string("binary", 6, system_charset_info); }
+ ;
/* Lock function */
lock:
- LOCK_SYM table_or_tables
- {
- LEX *lex= Lex;
+ LOCK_SYM table_or_tables
+ {
+ LEX *lex= Lex;
- if (lex->sphead)
- {
- my_error(ER_SP_BADSTATEMENT, MYF(0), "LOCK");
- MYSQL_YYABORT;
- }
- lex->sql_command= SQLCOM_LOCK_TABLES;
- }
- table_lock_list
- {}
- ;
+ if (lex->sphead)
+ {
+ my_error(ER_SP_BADSTATEMENT, MYF(0), "LOCK");
+ MYSQL_YYABORT;
+ }
+ lex->sql_command= SQLCOM_LOCK_TABLES;
+ }
+ table_lock_list
+ {}
+ ;
table_or_tables:
- TABLE_SYM
- | TABLES;
+ TABLE_SYM
+ | TABLES
+ ;
table_lock_list:
- table_lock
- | table_lock_list ',' table_lock;
+ table_lock
+ | table_lock_list ',' table_lock
+ ;
table_lock:
- table_ident opt_table_alias lock_option
- {
- if (!Select->add_table_to_list(YYTHD, $1, $2, 0, (thr_lock_type) $3))
- MYSQL_YYABORT;
- }
+ table_ident opt_table_alias lock_option
+ {
+ if (!Select->add_table_to_list(YYTHD, $1, $2, 0, (thr_lock_type) $3))
+ MYSQL_YYABORT;
+ }
;
lock_option:
- READ_SYM { $$=TL_READ_NO_INSERT; }
- | WRITE_SYM { $$=YYTHD->update_lock_default; }
- | LOW_PRIORITY WRITE_SYM { $$=TL_WRITE_LOW_PRIORITY; }
- | READ_SYM LOCAL_SYM { $$= TL_READ; }
+ READ_SYM { $$= TL_READ_NO_INSERT; }
+ | WRITE_SYM { $$= TL_WRITE_DEFAULT; }
+ | LOW_PRIORITY WRITE_SYM { $$= TL_WRITE_LOW_PRIORITY; }
+ | READ_SYM LOCAL_SYM { $$= TL_READ; }
;
unlock:
- UNLOCK_SYM
- {
- LEX *lex= Lex;
+ UNLOCK_SYM
+ {
+ LEX *lex= Lex;
- if (lex->sphead)
- {
- my_error(ER_SP_BADSTATEMENT, MYF(0), "UNLOCK");
- MYSQL_YYABORT;
- }
- lex->sql_command= SQLCOM_UNLOCK_TABLES;
- }
- table_or_tables
- {}
+ if (lex->sphead)
+ {
+ my_error(ER_SP_BADSTATEMENT, MYF(0), "UNLOCK");
+ MYSQL_YYABORT;
+ }
+ lex->sql_command= SQLCOM_UNLOCK_TABLES;
+ }
+ table_or_tables
+ {}
;
-
/*
** Handler: direct access to ISAM functions
*/
handler:
- HANDLER_SYM table_ident OPEN_SYM opt_table_alias
- {
- LEX *lex= Lex;
- if (lex->sphead)
- {
- my_error(ER_SP_BADSTATEMENT, MYF(0), "HANDLER");
- MYSQL_YYABORT;
- }
- lex->sql_command = SQLCOM_HA_OPEN;
- if (!lex->current_select->add_table_to_list(lex->thd, $2, $4, 0))
- MYSQL_YYABORT;
- }
- | HANDLER_SYM table_ident_nodb CLOSE_SYM
- {
- LEX *lex= Lex;
- if (lex->sphead)
- {
- my_error(ER_SP_BADSTATEMENT, MYF(0), "HANDLER");
- MYSQL_YYABORT;
- }
- lex->sql_command = SQLCOM_HA_CLOSE;
- if (!lex->current_select->add_table_to_list(lex->thd, $2, 0, 0))
- MYSQL_YYABORT;
- }
- | HANDLER_SYM table_ident_nodb READ_SYM
- {
- LEX *lex=Lex;
- if (lex->sphead)
- {
- my_error(ER_SP_BADSTATEMENT, MYF(0), "HANDLER");
- MYSQL_YYABORT;
- }
- lex->expr_allows_subselect= FALSE;
- lex->sql_command = SQLCOM_HA_READ;
- lex->ha_rkey_mode= HA_READ_KEY_EXACT; /* Avoid purify warnings */
- lex->current_select->select_limit= new Item_int((int32) 1);
- lex->current_select->offset_limit= 0;
- if (!lex->current_select->add_table_to_list(lex->thd, $2, 0, 0))
- MYSQL_YYABORT;
- }
- handler_read_or_scan where_clause opt_limit_clause
- {
- Lex->expr_allows_subselect= TRUE;
- }
+ HANDLER_SYM table_ident OPEN_SYM opt_table_alias
+ {
+ LEX *lex= Lex;
+ if (lex->sphead)
+ {
+ my_error(ER_SP_BADSTATEMENT, MYF(0), "HANDLER");
+ MYSQL_YYABORT;
+ }
+ lex->sql_command = SQLCOM_HA_OPEN;
+ if (!lex->current_select->add_table_to_list(lex->thd, $2, $4, 0))
+ MYSQL_YYABORT;
+ }
+ | HANDLER_SYM table_ident_nodb CLOSE_SYM
+ {
+ LEX *lex= Lex;
+ if (lex->sphead)
+ {
+ my_error(ER_SP_BADSTATEMENT, MYF(0), "HANDLER");
+ MYSQL_YYABORT;
+ }
+ lex->sql_command = SQLCOM_HA_CLOSE;
+ if (!lex->current_select->add_table_to_list(lex->thd, $2, 0, 0))
+ MYSQL_YYABORT;
+ }
+ | HANDLER_SYM table_ident_nodb READ_SYM
+ {
+ LEX *lex=Lex;
+ if (lex->sphead)
+ {
+ my_error(ER_SP_BADSTATEMENT, MYF(0), "HANDLER");
+ MYSQL_YYABORT;
+ }
+ lex->expr_allows_subselect= FALSE;
+ lex->sql_command = SQLCOM_HA_READ;
+ lex->ha_rkey_mode= HA_READ_KEY_EXACT; /* Avoid purify warnings */
+ lex->current_select->select_limit= new Item_int((int32) 1);
+ lex->current_select->offset_limit= 0;
+ if (!lex->current_select->add_table_to_list(lex->thd, $2, 0, 0))
+ MYSQL_YYABORT;
+ }
+ handler_read_or_scan where_clause opt_limit_clause
+ {
+ Lex->expr_allows_subselect= TRUE;
+ }
;
handler_read_or_scan:
- handler_scan_function { Lex->ident= null_lex_str; }
+ handler_scan_function { Lex->ident= null_lex_str; }
| ident handler_rkey_function { Lex->ident= $1; }
;
handler_scan_function:
- FIRST_SYM { Lex->ha_read_mode = RFIRST; }
- | NEXT_SYM { Lex->ha_read_mode = RNEXT; }
+ FIRST_SYM { Lex->ha_read_mode = RFIRST; }
+ | NEXT_SYM { Lex->ha_read_mode = RNEXT; }
;
handler_rkey_function:
- FIRST_SYM { Lex->ha_read_mode = RFIRST; }
- | NEXT_SYM { Lex->ha_read_mode = RNEXT; }
- | PREV_SYM { Lex->ha_read_mode = RPREV; }
- | LAST_SYM { Lex->ha_read_mode = RLAST; }
- | handler_rkey_mode
- {
- LEX *lex=Lex;
- lex->ha_read_mode = RKEY;
- lex->ha_rkey_mode=$1;
- if (!(lex->insert_list = new List_item))
- MYSQL_YYABORT;
- } '(' values ')' { }
+ FIRST_SYM { Lex->ha_read_mode = RFIRST; }
+ | NEXT_SYM { Lex->ha_read_mode = RNEXT; }
+ | PREV_SYM { Lex->ha_read_mode = RPREV; }
+ | LAST_SYM { Lex->ha_read_mode = RLAST; }
+ | handler_rkey_mode
+ {
+ LEX *lex=Lex;
+ lex->ha_read_mode = RKEY;
+ lex->ha_rkey_mode=$1;
+ if (!(lex->insert_list = new List_item))
+ MYSQL_YYABORT;
+ }
+ '(' values ')'
+ {}
;
handler_rkey_mode:
- EQ { $$=HA_READ_KEY_EXACT; }
- | GE { $$=HA_READ_KEY_OR_NEXT; }
- | LE { $$=HA_READ_KEY_OR_PREV; }
- | GT_SYM { $$=HA_READ_AFTER_KEY; }
- | LT { $$=HA_READ_BEFORE_KEY; }
+ EQ { $$=HA_READ_KEY_EXACT; }
+ | GE { $$=HA_READ_KEY_OR_NEXT; }
+ | LE { $$=HA_READ_KEY_OR_PREV; }
+ | GT_SYM { $$=HA_READ_AFTER_KEY; }
+ | LT { $$=HA_READ_BEFORE_KEY; }
;
/* GRANT / REVOKE */
revoke:
- REVOKE clear_privileges revoke_command
- {}
+ REVOKE clear_privileges revoke_command
+ {}
;
revoke_command:
- grant_privileges ON opt_table grant_ident FROM grant_list
- {
- LEX *lex= Lex;
- lex->sql_command= SQLCOM_REVOKE;
- lex->type= 0;
- }
- |
- grant_privileges ON FUNCTION_SYM grant_ident FROM grant_list
- {
- LEX *lex= Lex;
- if (lex->columns.elements)
+ grant_privileges ON opt_table grant_ident FROM grant_list
{
- my_parse_error(ER(ER_SYNTAX_ERROR));
- MYSQL_YYABORT;
+ LEX *lex= Lex;
+ lex->sql_command= SQLCOM_REVOKE;
+ lex->type= 0;
}
- lex->sql_command= SQLCOM_REVOKE;
- lex->type= TYPE_ENUM_FUNCTION;
-
- }
- |
- grant_privileges ON PROCEDURE grant_ident FROM grant_list
- {
- LEX *lex= Lex;
- if (lex->columns.elements)
+ | grant_privileges ON FUNCTION_SYM grant_ident FROM grant_list
{
- my_parse_error(ER(ER_SYNTAX_ERROR));
- MYSQL_YYABORT;
+ LEX *lex= Lex;
+ if (lex->columns.elements)
+ {
+ my_parse_error(ER(ER_SYNTAX_ERROR));
+ MYSQL_YYABORT;
+ }
+ lex->sql_command= SQLCOM_REVOKE;
+ lex->type= TYPE_ENUM_FUNCTION;
}
- lex->sql_command= SQLCOM_REVOKE;
- lex->type= TYPE_ENUM_PROCEDURE;
- }
- |
- ALL opt_privileges ',' GRANT OPTION FROM grant_list
- {
- Lex->sql_command = SQLCOM_REVOKE_ALL;
- }
- ;
+ | grant_privileges ON PROCEDURE grant_ident FROM grant_list
+ {
+ LEX *lex= Lex;
+ if (lex->columns.elements)
+ {
+ my_parse_error(ER(ER_SYNTAX_ERROR));
+ MYSQL_YYABORT;
+ }
+ lex->sql_command= SQLCOM_REVOKE;
+ lex->type= TYPE_ENUM_PROCEDURE;
+ }
+ | ALL opt_privileges ',' GRANT OPTION FROM grant_list
+ {
+ Lex->sql_command = SQLCOM_REVOKE_ALL;
+ }
+ ;
grant:
- GRANT clear_privileges grant_command
- {}
+ GRANT clear_privileges grant_command
+ {}
;
grant_command:
- grant_privileges ON opt_table grant_ident TO_SYM grant_list
- require_clause grant_options
- {
- LEX *lex= Lex;
- lex->sql_command= SQLCOM_GRANT;
- lex->type= 0;
- }
- |
- grant_privileges ON FUNCTION_SYM grant_ident TO_SYM grant_list
- require_clause grant_options
- {
- LEX *lex= Lex;
- if (lex->columns.elements)
+ grant_privileges ON opt_table grant_ident TO_SYM grant_list
+ require_clause grant_options
{
- my_parse_error(ER(ER_SYNTAX_ERROR));
- MYSQL_YYABORT;
+ LEX *lex= Lex;
+ lex->sql_command= SQLCOM_GRANT;
+ lex->type= 0;
}
- lex->sql_command= SQLCOM_GRANT;
- lex->type= TYPE_ENUM_FUNCTION;
- }
- |
- grant_privileges ON PROCEDURE grant_ident TO_SYM grant_list
- require_clause grant_options
- {
- LEX *lex= Lex;
- if (lex->columns.elements)
+ | grant_privileges ON FUNCTION_SYM grant_ident TO_SYM grant_list
+ require_clause grant_options
{
- my_parse_error(ER(ER_SYNTAX_ERROR));
- MYSQL_YYABORT;
+ LEX *lex= Lex;
+ if (lex->columns.elements)
+ {
+ my_parse_error(ER(ER_SYNTAX_ERROR));
+ MYSQL_YYABORT;
+ }
+ lex->sql_command= SQLCOM_GRANT;
+ lex->type= TYPE_ENUM_FUNCTION;
+ }
+ | grant_privileges ON PROCEDURE grant_ident TO_SYM grant_list
+ require_clause grant_options
+ {
+ LEX *lex= Lex;
+ if (lex->columns.elements)
+ {
+ my_parse_error(ER(ER_SYNTAX_ERROR));
+ MYSQL_YYABORT;
+ }
+ lex->sql_command= SQLCOM_GRANT;
+ lex->type= TYPE_ENUM_PROCEDURE;
}
- lex->sql_command= SQLCOM_GRANT;
- lex->type= TYPE_ENUM_PROCEDURE;
- }
;
opt_table:
- /* Empty */
- | TABLE_SYM ;
-
+ /* Empty */
+ | TABLE_SYM
+ ;
+
grant_privileges:
- object_privilege_list { }
- | ALL opt_privileges
- {
- Lex->all_privileges= 1;
- Lex->grant= GLOBAL_ACLS;
- }
+ object_privilege_list {}
+ | ALL opt_privileges
+ {
+ Lex->all_privileges= 1;
+ Lex->grant= GLOBAL_ACLS;
+ }
;
opt_privileges:
- /* empty */
- | PRIVILEGES
- ;
+ /* empty */
+ | PRIVILEGES
+ ;
object_privilege_list:
- object_privilege
- | object_privilege_list ',' object_privilege;
+ object_privilege
+ | object_privilege_list ',' object_privilege
+ ;
object_privilege:
- SELECT_SYM { Lex->which_columns = SELECT_ACL;} opt_column_list {}
- | INSERT { Lex->which_columns = INSERT_ACL;} opt_column_list {}
- | UPDATE_SYM { Lex->which_columns = UPDATE_ACL; } opt_column_list {}
- | REFERENCES { Lex->which_columns = REFERENCES_ACL;} opt_column_list {}
- | DELETE_SYM { Lex->grant |= DELETE_ACL;}
- | USAGE {}
- | INDEX_SYM { Lex->grant |= INDEX_ACL;}
- | ALTER { Lex->grant |= ALTER_ACL;}
- | CREATE { Lex->grant |= CREATE_ACL;}
- | DROP { Lex->grant |= DROP_ACL;}
- | EXECUTE_SYM { Lex->grant |= EXECUTE_ACL;}
- | RELOAD { Lex->grant |= RELOAD_ACL;}
- | SHUTDOWN { Lex->grant |= SHUTDOWN_ACL;}
- | PROCESS { Lex->grant |= PROCESS_ACL;}
- | FILE_SYM { Lex->grant |= FILE_ACL;}
- | GRANT OPTION { Lex->grant |= GRANT_ACL;}
- | SHOW DATABASES { Lex->grant |= SHOW_DB_ACL;}
- | SUPER_SYM { Lex->grant |= SUPER_ACL;}
- | CREATE TEMPORARY TABLES { Lex->grant |= CREATE_TMP_ACL;}
- | LOCK_SYM TABLES { Lex->grant |= LOCK_TABLES_ACL; }
- | REPLICATION SLAVE { Lex->grant |= REPL_SLAVE_ACL; }
- | REPLICATION CLIENT_SYM { Lex->grant |= REPL_CLIENT_ACL; }
- | CREATE VIEW_SYM { Lex->grant |= CREATE_VIEW_ACL; }
- | SHOW VIEW_SYM { Lex->grant |= SHOW_VIEW_ACL; }
- | CREATE ROUTINE_SYM { Lex->grant |= CREATE_PROC_ACL; }
- | ALTER ROUTINE_SYM { Lex->grant |= ALTER_PROC_ACL; }
- | CREATE USER { Lex->grant |= CREATE_USER_ACL; }
- | EVENT_SYM { Lex->grant |= EVENT_ACL;}
- | TRIGGER_SYM { Lex->grant |= TRIGGER_ACL; }
- ;
-
+ SELECT_SYM
+ { Lex->which_columns = SELECT_ACL;}
+ opt_column_list {}
+ | INSERT
+ { Lex->which_columns = INSERT_ACL;}
+ opt_column_list {}
+ | UPDATE_SYM
+ { Lex->which_columns = UPDATE_ACL; }
+ opt_column_list {}
+ | REFERENCES
+ { Lex->which_columns = REFERENCES_ACL;}
+ opt_column_list {}
+ | DELETE_SYM { Lex->grant |= DELETE_ACL;}
+ | USAGE {}
+ | INDEX_SYM { Lex->grant |= INDEX_ACL;}
+ | ALTER { Lex->grant |= ALTER_ACL;}
+ | CREATE { Lex->grant |= CREATE_ACL;}
+ | DROP { Lex->grant |= DROP_ACL;}
+ | EXECUTE_SYM { Lex->grant |= EXECUTE_ACL;}
+ | RELOAD { Lex->grant |= RELOAD_ACL;}
+ | SHUTDOWN { Lex->grant |= SHUTDOWN_ACL;}
+ | PROCESS { Lex->grant |= PROCESS_ACL;}
+ | FILE_SYM { Lex->grant |= FILE_ACL;}
+ | GRANT OPTION { Lex->grant |= GRANT_ACL;}
+ | SHOW DATABASES { Lex->grant |= SHOW_DB_ACL;}
+ | SUPER_SYM { Lex->grant |= SUPER_ACL;}
+ | CREATE TEMPORARY TABLES { Lex->grant |= CREATE_TMP_ACL;}
+ | LOCK_SYM TABLES { Lex->grant |= LOCK_TABLES_ACL; }
+ | REPLICATION SLAVE { Lex->grant |= REPL_SLAVE_ACL; }
+ | REPLICATION CLIENT_SYM { Lex->grant |= REPL_CLIENT_ACL; }
+ | CREATE VIEW_SYM { Lex->grant |= CREATE_VIEW_ACL; }
+ | SHOW VIEW_SYM { Lex->grant |= SHOW_VIEW_ACL; }
+ | CREATE ROUTINE_SYM { Lex->grant |= CREATE_PROC_ACL; }
+ | ALTER ROUTINE_SYM { Lex->grant |= ALTER_PROC_ACL; }
+ | CREATE USER { Lex->grant |= CREATE_USER_ACL; }
+ | EVENT_SYM { Lex->grant |= EVENT_ACL;}
+ | TRIGGER_SYM { Lex->grant |= TRIGGER_ACL; }
+ ;
opt_and:
- /* empty */ {}
- | AND_SYM {}
- ;
+ /* empty */ {}
+ | AND_SYM {}
+ ;
require_list:
- require_list_element opt_and require_list
- | require_list_element
- ;
+ require_list_element opt_and require_list
+ | require_list_element
+ ;
require_list_element:
- SUBJECT_SYM TEXT_STRING
- {
- LEX *lex=Lex;
- if (lex->x509_subject)
- {
- my_error(ER_DUP_ARGUMENT, MYF(0), "SUBJECT");
- MYSQL_YYABORT;
- }
- lex->x509_subject=$2.str;
- }
- | ISSUER_SYM TEXT_STRING
- {
- LEX *lex=Lex;
- if (lex->x509_issuer)
- {
- my_error(ER_DUP_ARGUMENT, MYF(0), "ISSUER");
- MYSQL_YYABORT;
- }
- lex->x509_issuer=$2.str;
- }
- | CIPHER_SYM TEXT_STRING
- {
- LEX *lex=Lex;
- if (lex->ssl_cipher)
- {
- my_error(ER_DUP_ARGUMENT, MYF(0), "CIPHER");
- MYSQL_YYABORT;
- }
- lex->ssl_cipher=$2.str;
- }
- ;
+ SUBJECT_SYM TEXT_STRING
+ {
+ LEX *lex=Lex;
+ if (lex->x509_subject)
+ {
+ my_error(ER_DUP_ARGUMENT, MYF(0), "SUBJECT");
+ MYSQL_YYABORT;
+ }
+ lex->x509_subject=$2.str;
+ }
+ | ISSUER_SYM TEXT_STRING
+ {
+ LEX *lex=Lex;
+ if (lex->x509_issuer)
+ {
+ my_error(ER_DUP_ARGUMENT, MYF(0), "ISSUER");
+ MYSQL_YYABORT;
+ }
+ lex->x509_issuer=$2.str;
+ }
+ | CIPHER_SYM TEXT_STRING
+ {
+ LEX *lex=Lex;
+ if (lex->ssl_cipher)
+ {
+ my_error(ER_DUP_ARGUMENT, MYF(0), "CIPHER");
+ MYSQL_YYABORT;
+ }
+ lex->ssl_cipher=$2.str;
+ }
+ ;
grant_ident:
- '*'
- {
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- uint dummy;
- if (thd->copy_db_to(&lex->current_select->db, &dummy))
- MYSQL_YYABORT;
- if (lex->grant == GLOBAL_ACLS)
- lex->grant = DB_ACLS & ~GRANT_ACL;
- else if (lex->columns.elements)
- {
- my_message(ER_ILLEGAL_GRANT_FOR_TABLE,
+ '*'
+ {
+ LEX *lex= Lex;
+ size_t dummy;
+ if (lex->copy_db_to(&lex->current_select->db, &dummy))
+ MYSQL_YYABORT;
+ if (lex->grant == GLOBAL_ACLS)
+ lex->grant = DB_ACLS & ~GRANT_ACL;
+ else if (lex->columns.elements)
+ {
+ my_message(ER_ILLEGAL_GRANT_FOR_TABLE,
ER(ER_ILLEGAL_GRANT_FOR_TABLE), MYF(0));
- MYSQL_YYABORT;
- }
- }
- | ident '.' '*'
- {
- LEX *lex= Lex;
- lex->current_select->db = $1.str;
- if (lex->grant == GLOBAL_ACLS)
- lex->grant = DB_ACLS & ~GRANT_ACL;
- else if (lex->columns.elements)
- {
- my_message(ER_ILLEGAL_GRANT_FOR_TABLE,
+ MYSQL_YYABORT;
+ }
+ }
+ | ident '.' '*'
+ {
+ LEX *lex= Lex;
+ lex->current_select->db = $1.str;
+ if (lex->grant == GLOBAL_ACLS)
+ lex->grant = DB_ACLS & ~GRANT_ACL;
+ else if (lex->columns.elements)
+ {
+ my_message(ER_ILLEGAL_GRANT_FOR_TABLE,
ER(ER_ILLEGAL_GRANT_FOR_TABLE), MYF(0));
- MYSQL_YYABORT;
- }
- }
- | '*' '.' '*'
- {
- LEX *lex= Lex;
- lex->current_select->db = NULL;
- if (lex->grant == GLOBAL_ACLS)
- lex->grant= GLOBAL_ACLS & ~GRANT_ACL;
- else if (lex->columns.elements)
- {
- my_message(ER_ILLEGAL_GRANT_FOR_TABLE,
+ MYSQL_YYABORT;
+ }
+ }
+ | '*' '.' '*'
+ {
+ LEX *lex= Lex;
+ lex->current_select->db = NULL;
+ if (lex->grant == GLOBAL_ACLS)
+ lex->grant= GLOBAL_ACLS & ~GRANT_ACL;
+ else if (lex->columns.elements)
+ {
+ my_message(ER_ILLEGAL_GRANT_FOR_TABLE,
ER(ER_ILLEGAL_GRANT_FOR_TABLE), MYF(0));
- MYSQL_YYABORT;
- }
- }
- | table_ident
- {
- LEX *lex=Lex;
- if (!lex->current_select->add_table_to_list(lex->thd, $1,NULL,
+ MYSQL_YYABORT;
+ }
+ }
+ | table_ident
+ {
+ LEX *lex=Lex;
+ if (!lex->current_select->add_table_to_list(lex->thd, $1,NULL,
TL_OPTION_UPDATING))
- MYSQL_YYABORT;
- if (lex->grant == GLOBAL_ACLS)
- lex->grant = TABLE_ACLS & ~GRANT_ACL;
- }
- ;
-
+ MYSQL_YYABORT;
+ if (lex->grant == GLOBAL_ACLS)
+ lex->grant = TABLE_ACLS & ~GRANT_ACL;
+ }
+ ;
user_list:
- user { if (Lex->users_list.push_back($1)) MYSQL_YYABORT;}
- | user_list ',' user
- {
- if (Lex->users_list.push_back($3))
- MYSQL_YYABORT;
- }
- ;
-
+ user
+ {
+ if (Lex->users_list.push_back($1))
+ MYSQL_YYABORT;
+ }
+ | user_list ',' user
+ {
+ if (Lex->users_list.push_back($3))
+ MYSQL_YYABORT;
+ }
+ ;
grant_list:
- grant_user { if (Lex->users_list.push_back($1)) MYSQL_YYABORT;}
- | grant_list ',' grant_user
- {
- if (Lex->users_list.push_back($3))
- MYSQL_YYABORT;
- }
- ;
-
+ grant_user
+ {
+ if (Lex->users_list.push_back($1))
+ MYSQL_YYABORT;
+ }
+ | grant_list ',' grant_user
+ {
+ if (Lex->users_list.push_back($3))
+ MYSQL_YYABORT;
+ }
+ ;
grant_user:
- user IDENTIFIED_SYM BY TEXT_STRING
- {
- $$=$1; $1->password=$4;
- if ($4.length)
- {
- if (YYTHD->variables.old_passwords)
- {
- char *buff=
- (char *) YYTHD->alloc(SCRAMBLED_PASSWORD_CHAR_LENGTH_323+1);
- if (buff)
- make_scrambled_password_323(buff, $4.str);
- $1->password.str= buff;
- $1->password.length= SCRAMBLED_PASSWORD_CHAR_LENGTH_323;
- }
- else
- {
- char *buff=
- (char *) YYTHD->alloc(SCRAMBLED_PASSWORD_CHAR_LENGTH+1);
- if (buff)
- make_scrambled_password(buff, $4.str);
- $1->password.str= buff;
- $1->password.length= SCRAMBLED_PASSWORD_CHAR_LENGTH;
- }
- }
- }
- | user IDENTIFIED_SYM BY PASSWORD TEXT_STRING
- { $$= $1; $1->password= $5; }
- | user
- { $$= $1; $1->password= null_lex_str; }
+ user IDENTIFIED_SYM BY TEXT_STRING
+ {
+ $$=$1; $1->password=$4;
+ if ($4.length)
+ {
+ if (YYTHD->variables.old_passwords)
+ {
+ char *buff=
+ (char *) YYTHD->alloc(SCRAMBLED_PASSWORD_CHAR_LENGTH_323+1);
+ if (buff)
+ make_scrambled_password_323(buff, $4.str);
+ $1->password.str= buff;
+ $1->password.length= SCRAMBLED_PASSWORD_CHAR_LENGTH_323;
+ }
+ else
+ {
+ char *buff=
+ (char *) YYTHD->alloc(SCRAMBLED_PASSWORD_CHAR_LENGTH+1);
+ if (buff)
+ make_scrambled_password(buff, $4.str);
+ $1->password.str= buff;
+ $1->password.length= SCRAMBLED_PASSWORD_CHAR_LENGTH;
+ }
+ }
+ }
+ | user IDENTIFIED_SYM BY PASSWORD TEXT_STRING
+ { $$= $1; $1->password= $5; }
+ | user
+ { $$= $1; $1->password= null_lex_str; }
;
-
opt_column_list:
- /* empty */
- {
- LEX *lex=Lex;
- lex->grant |= lex->which_columns;
- }
- | '(' column_list ')';
+ /* empty */
+ {
+ LEX *lex=Lex;
+ lex->grant |= lex->which_columns;
+ }
+ | '(' column_list ')'
+ ;
column_list:
- column_list ',' column_list_id
- | column_list_id;
+ column_list ',' column_list_id
+ | column_list_id
+ ;
column_list_id:
- ident
- {
- String *new_str = new (YYTHD->mem_root) String((const char*) $1.str,$1.length,system_charset_info);
- List_iterator <LEX_COLUMN> iter(Lex->columns);
- class LEX_COLUMN *point;
- LEX *lex=Lex;
- while ((point=iter++))
- {
- if (!my_strcasecmp(system_charset_info,
- point->column.ptr(), new_str->ptr()))
- break;
- }
- lex->grant_tot_col|= lex->which_columns;
- if (point)
- point->rights |= lex->which_columns;
- else
- lex->columns.push_back(new LEX_COLUMN (*new_str,lex->which_columns));
- }
+ ident
+ {
+ String *new_str = new (YYTHD->mem_root) String((const char*) $1.str,$1.length,system_charset_info);
+ List_iterator <LEX_COLUMN> iter(Lex->columns);
+ class LEX_COLUMN *point;
+ LEX *lex=Lex;
+ while ((point=iter++))
+ {
+ if (!my_strcasecmp(system_charset_info,
+ point->column.ptr(), new_str->ptr()))
+ break;
+ }
+ lex->grant_tot_col|= lex->which_columns;
+ if (point)
+ point->rights |= lex->which_columns;
+ else
+ lex->columns.push_back(new LEX_COLUMN (*new_str,lex->which_columns));
+ }
;
-
-require_clause: /* empty */
+require_clause:
+ /* empty */
| REQUIRE_SYM require_list
{
Lex->ssl_type=SSL_TYPE_SPECIFIED;
@@ -11038,220 +11672,223 @@ require_clause: /* empty */
{
Lex->ssl_type=SSL_TYPE_X509;
}
- | REQUIRE_SYM NONE_SYM
- {
- Lex->ssl_type=SSL_TYPE_NONE;
- }
- ;
+ | REQUIRE_SYM NONE_SYM
+ {
+ Lex->ssl_type=SSL_TYPE_NONE;
+ }
+ ;
grant_options:
- /* empty */ {}
- | WITH grant_option_list;
+ /* empty */ {}
+ | WITH grant_option_list
+ ;
grant_option_list:
- grant_option_list grant_option {}
- | grant_option {}
+ grant_option_list grant_option {}
+ | grant_option {}
;
grant_option:
- GRANT OPTION { Lex->grant |= GRANT_ACL;}
+ GRANT OPTION { Lex->grant |= GRANT_ACL;}
| MAX_QUERIES_PER_HOUR ulong_num
- {
- LEX *lex=Lex;
- lex->mqh.questions=$2;
- lex->mqh.specified_limits|= USER_RESOURCES::QUERIES_PER_HOUR;
- }
+ {
+ LEX *lex=Lex;
+ lex->mqh.questions=$2;
+ lex->mqh.specified_limits|= USER_RESOURCES::QUERIES_PER_HOUR;
+ }
| MAX_UPDATES_PER_HOUR ulong_num
- {
- LEX *lex=Lex;
- lex->mqh.updates=$2;
- lex->mqh.specified_limits|= USER_RESOURCES::UPDATES_PER_HOUR;
- }
+ {
+ LEX *lex=Lex;
+ lex->mqh.updates=$2;
+ lex->mqh.specified_limits|= USER_RESOURCES::UPDATES_PER_HOUR;
+ }
| MAX_CONNECTIONS_PER_HOUR ulong_num
- {
- LEX *lex=Lex;
- lex->mqh.conn_per_hour= $2;
- lex->mqh.specified_limits|= USER_RESOURCES::CONNECTIONS_PER_HOUR;
- }
+ {
+ LEX *lex=Lex;
+ lex->mqh.conn_per_hour= $2;
+ lex->mqh.specified_limits|= USER_RESOURCES::CONNECTIONS_PER_HOUR;
+ }
| MAX_USER_CONNECTIONS_SYM ulong_num
- {
- LEX *lex=Lex;
- lex->mqh.user_conn= $2;
- lex->mqh.specified_limits|= USER_RESOURCES::USER_CONNECTIONS;
- }
+ {
+ LEX *lex=Lex;
+ lex->mqh.user_conn= $2;
+ lex->mqh.specified_limits|= USER_RESOURCES::USER_CONNECTIONS;
+ }
;
begin:
- BEGIN_SYM
- {
- LEX *lex=Lex;
- lex->sql_command = SQLCOM_BEGIN;
- lex->start_transaction_opt= 0;
- }
- opt_work {}
- ;
+ BEGIN_SYM
+ {
+ LEX *lex=Lex;
+ lex->sql_command = SQLCOM_BEGIN;
+ lex->start_transaction_opt= 0;
+ }
+ opt_work {}
+ ;
opt_work:
- /* empty */ {}
- | WORK_SYM {}
+ /* empty */ {}
+ | WORK_SYM {}
;
opt_chain:
- /* empty */ { $$= (YYTHD->variables.completion_type == 1); }
- | AND_SYM NO_SYM CHAIN_SYM { $$=0; }
- | AND_SYM CHAIN_SYM { $$=1; }
- ;
+ /* empty */
+ { $$= (YYTHD->variables.completion_type == 1); }
+ | AND_SYM NO_SYM CHAIN_SYM { $$=0; }
+ | AND_SYM CHAIN_SYM { $$=1; }
+ ;
opt_release:
- /* empty */ { $$= (YYTHD->variables.completion_type == 2); }
- | RELEASE_SYM { $$=1; }
- | NO_SYM RELEASE_SYM { $$=0; }
- ;
-
+ /* empty */
+ { $$= (YYTHD->variables.completion_type == 2); }
+ | RELEASE_SYM { $$=1; }
+ | NO_SYM RELEASE_SYM { $$=0; }
+;
+
opt_savepoint:
- /* empty */ {}
- | SAVEPOINT_SYM {}
- ;
+ /* empty */ {}
+ | SAVEPOINT_SYM {}
+ ;
commit:
- COMMIT_SYM opt_work opt_chain opt_release
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_COMMIT;
- lex->tx_chain= $3;
- lex->tx_release= $4;
- }
- ;
+ COMMIT_SYM opt_work opt_chain opt_release
+ {
+ LEX *lex=Lex;
+ lex->sql_command= SQLCOM_COMMIT;
+ lex->tx_chain= $3;
+ lex->tx_release= $4;
+ }
+ ;
rollback:
- ROLLBACK_SYM opt_work opt_chain opt_release
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_ROLLBACK;
- lex->tx_chain= $3;
- lex->tx_release= $4;
- }
- | ROLLBACK_SYM opt_work
- TO_SYM opt_savepoint ident
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_ROLLBACK_TO_SAVEPOINT;
- lex->ident= $5;
- }
- ;
+ ROLLBACK_SYM opt_work opt_chain opt_release
+ {
+ LEX *lex=Lex;
+ lex->sql_command= SQLCOM_ROLLBACK;
+ lex->tx_chain= $3;
+ lex->tx_release= $4;
+ }
+ | ROLLBACK_SYM opt_work
+ TO_SYM opt_savepoint ident
+ {
+ LEX *lex=Lex;
+ lex->sql_command= SQLCOM_ROLLBACK_TO_SAVEPOINT;
+ lex->ident= $5;
+ }
+ ;
savepoint:
- SAVEPOINT_SYM ident
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_SAVEPOINT;
- lex->ident= $2;
- }
- ;
+ SAVEPOINT_SYM ident
+ {
+ LEX *lex=Lex;
+ lex->sql_command= SQLCOM_SAVEPOINT;
+ lex->ident= $2;
+ }
+ ;
release:
- RELEASE_SYM SAVEPOINT_SYM ident
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_RELEASE_SAVEPOINT;
- lex->ident= $3;
- }
- ;
-
+ RELEASE_SYM SAVEPOINT_SYM ident
+ {
+ LEX *lex=Lex;
+ lex->sql_command= SQLCOM_RELEASE_SAVEPOINT;
+ lex->ident= $3;
+ }
+ ;
+
/*
UNIONS : glue selects together
*/
union_clause:
- /* empty */ {}
- | union_list
- ;
+ /* empty */ {}
+ | union_list
+ ;
union_list:
- UNION_SYM union_option
- {
- LEX *lex=Lex;
- if (lex->result)
- {
- /* Only the last SELECT can have INTO...... */
- my_error(ER_WRONG_USAGE, MYF(0), "UNION", "INTO");
- MYSQL_YYABORT;
- }
- if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE)
- {
- my_parse_error(ER(ER_SYNTAX_ERROR));
- MYSQL_YYABORT;
- }
- /* This counter shouldn't be incremented for UNION parts */
- Lex->nest_level--;
- if (mysql_new_select(lex, 0))
- MYSQL_YYABORT;
- mysql_init_select(lex);
- lex->current_select->linkage=UNION_TYPE;
- if ($2) /* UNION DISTINCT - remember position */
- lex->current_select->master_unit()->union_distinct=
- lex->current_select;
- }
- select_init
- {
- /*
- Remove from the name resolution context stack the context of the
- last select in the union.
- */
- Lex->pop_context();
- }
- ;
+ UNION_SYM union_option
+ {
+ LEX *lex=Lex;
+ if (lex->result)
+ {
+ /* Only the last SELECT can have INTO...... */
+ my_error(ER_WRONG_USAGE, MYF(0), "UNION", "INTO");
+ MYSQL_YYABORT;
+ }
+ if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE)
+ {
+ my_parse_error(ER(ER_SYNTAX_ERROR));
+ MYSQL_YYABORT;
+ }
+ /* This counter shouldn't be incremented for UNION parts */
+ Lex->nest_level--;
+ if (mysql_new_select(lex, 0))
+ MYSQL_YYABORT;
+ mysql_init_select(lex);
+ lex->current_select->linkage=UNION_TYPE;
+ if ($2) /* UNION DISTINCT - remember position */
+ lex->current_select->master_unit()->union_distinct=
+ lex->current_select;
+ }
+ select_init
+ {
+ /*
+ Remove from the name resolution context stack the context of the
+ last select in the union.
+ */
+ Lex->pop_context();
+ }
+ ;
union_opt:
- /* Empty */ { $$= 0; }
- | union_list { $$= 1; }
- | union_order_or_limit { $$= 1; }
- ;
+ /* Empty */ { $$= 0; }
+ | union_list { $$= 1; }
+ | union_order_or_limit { $$= 1; }
+ ;
union_order_or_limit:
- {
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- DBUG_ASSERT(lex->current_select->linkage != GLOBAL_OPTIONS_TYPE);
- SELECT_LEX *sel= lex->current_select;
- SELECT_LEX_UNIT *unit= sel->master_unit();
- SELECT_LEX *fake= unit->fake_select_lex;
- if (fake)
- {
- unit->global_parameters= fake;
- fake->no_table_names_allowed= 1;
- lex->current_select= fake;
- }
- thd->where= "global ORDER clause";
- }
- order_or_limit
- {
- THD *thd= YYTHD;
- thd->lex->current_select->no_table_names_allowed= 0;
- thd->where= "";
+ {
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ DBUG_ASSERT(lex->current_select->linkage != GLOBAL_OPTIONS_TYPE);
+ SELECT_LEX *sel= lex->current_select;
+ SELECT_LEX_UNIT *unit= sel->master_unit();
+ SELECT_LEX *fake= unit->fake_select_lex;
+ if (fake)
+ {
+ unit->global_parameters= fake;
+ fake->no_table_names_allowed= 1;
+ lex->current_select= fake;
+ }
+ thd->where= "global ORDER clause";
}
- ;
+ order_or_limit
+ {
+ THD *thd= YYTHD;
+ thd->lex->current_select->no_table_names_allowed= 0;
+ thd->where= "";
+ }
+ ;
order_or_limit:
- order_clause opt_limit_clause_init
- | limit_clause
- ;
+ order_clause opt_limit_clause_init
+ | limit_clause
+ ;
union_option:
- /* empty */ { $$=1; }
- | DISTINCT { $$=1; }
- | ALL { $$=0; }
+ /* empty */ { $$=1; }
+ | DISTINCT { $$=1; }
+ | ALL { $$=0; }
;
subselect:
- SELECT_SYM subselect_start subselect_init subselect_end
- {
- $$= $3;
- }
+ SELECT_SYM subselect_start subselect_init subselect_end
+ {
+ $$= $3;
+ }
| '(' subselect_start subselect ')'
{
- THD *thd= YYTHD;
+ THD *thd= YYTHD;
/*
note that a local variable can't be used for
$3 as it's used in local variable construction
@@ -11266,48 +11903,53 @@ subselect:
while ((item= it++))
add_item_to_list(thd, item);
}
- union_clause subselect_end { $$= $3; };
+ union_clause subselect_end { $$= $3; }
+ ;
subselect_init:
- select_init2
- {
- $$= Lex->current_select->master_unit()->first_select();
- };
+ select_init2
+ {
+ $$= Lex->current_select->master_unit()->first_select();
+ }
+ ;
subselect_start:
- {
- LEX *lex=Lex;
- if (!lex->expr_allows_subselect)
- {
- my_parse_error(ER(ER_SYNTAX_ERROR));
- MYSQL_YYABORT;
- }
- /*
- we are making a "derived table" for the parenthesis
- as we need to have a lex level to fit the union
- after the parenthesis, e.g.
- (SELECT .. ) UNION ... becomes
- SELECT * FROM ((SELECT ...) UNION ...)
- */
- if (mysql_new_select(Lex, 1))
- MYSQL_YYABORT;
- };
+ {
+ LEX *lex=Lex;
+ if (!lex->expr_allows_subselect ||
+ lex->sql_command == (int)SQLCOM_PURGE)
+ {
+ my_parse_error(ER(ER_SYNTAX_ERROR));
+ MYSQL_YYABORT;
+ }
+ /*
+ we are making a "derived table" for the parenthesis
+ as we need to have a lex level to fit the union
+ after the parenthesis, e.g.
+ (SELECT .. ) UNION ... becomes
+ SELECT * FROM ((SELECT ...) UNION ...)
+ */
+ if (mysql_new_select(Lex, 1))
+ MYSQL_YYABORT;
+ }
+ ;
subselect_end:
- {
- LEX *lex=Lex;
- lex->pop_context();
- SELECT_LEX *child= lex->current_select;
- lex->current_select = lex->current_select->return_after_parsing();
- lex->nest_level--;
- lex->current_select->n_child_sum_items += child->n_sum_items;
- /*
- A subselect can add fields to an outer select. Reserve space for
- them.
- */
- lex->current_select->select_n_where_fields+=
+ {
+ LEX *lex=Lex;
+ lex->pop_context();
+ SELECT_LEX *child= lex->current_select;
+ lex->current_select = lex->current_select->return_after_parsing();
+ lex->nest_level--;
+ lex->current_select->n_child_sum_items += child->n_sum_items;
+ /*
+ A subselect can add fields to an outer select. Reserve space for
+ them.
+ */
+ lex->current_select->select_n_where_fields+=
child->select_n_where_fields;
- };
+ }
+ ;
/**************************************************************************
@@ -11316,22 +11958,22 @@ subselect_end:
**************************************************************************/
view_or_trigger_or_sp_or_event:
- definer view_or_trigger_or_sp_or_event_tail
- {}
- | view_replace_or_algorithm definer view_tail
- {}
- ;
+ definer view_or_trigger_or_sp_or_event_tail
+ {}
+ | view_replace_or_algorithm definer view_tail
+ {}
+ ;
view_or_trigger_or_sp_or_event_tail:
- view_tail
- {}
- | trigger_tail
- {}
- | sp_tail
- {}
- | event_tail
- {}
- ;
+ view_tail
+ {}
+ | trigger_tail
+ {}
+ | sp_tail
+ {}
+ | event_tail
+ {}
+ ;
/**************************************************************************
@@ -11340,22 +11982,22 @@ view_or_trigger_or_sp_or_event_tail:
**************************************************************************/
definer:
- /* empty */
- {
- /*
- We have to distinguish missing DEFINER-clause from case when
- CURRENT_USER specified as definer explicitly in order to properly
- handle CREATE TRIGGER statements which come to replication thread
- from older master servers (i.e. to create non-suid trigger in this
- case).
- */
- YYTHD->lex->definer= 0;
- }
- | DEFINER_SYM EQ user
- {
- YYTHD->lex->definer= get_current_user(YYTHD, $3);
- }
- ;
+ /* empty */
+ {
+ /*
+ We have to distinguish missing DEFINER-clause from case when
+ CURRENT_USER specified as definer explicitly in order to properly
+ handle CREATE TRIGGER statements which come to replication thread
+ from older master servers (i.e. to create non-suid trigger in this
+ case).
+ */
+ YYTHD->lex->definer= 0;
+ }
+ | DEFINER_SYM EQ user
+ {
+ YYTHD->lex->definer= get_current_user(YYTHD, $3);
+ }
+ ;
/**************************************************************************
@@ -11364,117 +12006,128 @@ definer:
**************************************************************************/
view_replace_or_algorithm:
- view_replace
- {}
- | view_replace view_algorithm
- {}
- | view_algorithm
- {}
- ;
+ view_replace
+ {}
+ | view_replace view_algorithm
+ {}
+ | view_algorithm
+ {}
+ ;
view_replace:
- OR_SYM REPLACE
- { Lex->create_view_mode= VIEW_CREATE_OR_REPLACE; }
- ;
+ OR_SYM REPLACE
+ { Lex->create_view_mode= VIEW_CREATE_OR_REPLACE; }
+ ;
view_algorithm:
- ALGORITHM_SYM EQ UNDEFINED_SYM
- { Lex->create_view_algorithm= VIEW_ALGORITHM_UNDEFINED; }
- | ALGORITHM_SYM EQ MERGE_SYM
- { Lex->create_view_algorithm= VIEW_ALGORITHM_MERGE; }
- | ALGORITHM_SYM EQ TEMPTABLE_SYM
- { Lex->create_view_algorithm= VIEW_ALGORITHM_TMPTABLE; }
- ;
+ ALGORITHM_SYM EQ UNDEFINED_SYM
+ { Lex->create_view_algorithm= VIEW_ALGORITHM_UNDEFINED; }
+ | ALGORITHM_SYM EQ MERGE_SYM
+ { Lex->create_view_algorithm= VIEW_ALGORITHM_MERGE; }
+ | ALGORITHM_SYM EQ TEMPTABLE_SYM
+ { Lex->create_view_algorithm= VIEW_ALGORITHM_TMPTABLE; }
+ ;
view_suid:
- /* empty */
- { Lex->create_view_suid= VIEW_SUID_DEFAULT; }
- | SQL_SYM SECURITY_SYM DEFINER_SYM
- { Lex->create_view_suid= VIEW_SUID_DEFINER; }
- | SQL_SYM SECURITY_SYM INVOKER_SYM
- { Lex->create_view_suid= VIEW_SUID_INVOKER; }
- ;
+ /* empty */
+ { Lex->create_view_suid= VIEW_SUID_DEFAULT; }
+ | SQL_SYM SECURITY_SYM DEFINER_SYM
+ { Lex->create_view_suid= VIEW_SUID_DEFINER; }
+ | SQL_SYM SECURITY_SYM INVOKER_SYM
+ { Lex->create_view_suid= VIEW_SUID_INVOKER; }
+ ;
view_tail:
- view_suid VIEW_SYM table_ident
- {
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- lex->sql_command= SQLCOM_CREATE_VIEW;
- /* first table in list is target VIEW name */
- if (!lex->select_lex.add_table_to_list(thd, $3, NULL, TL_OPTION_UPDATING))
- MYSQL_YYABORT;
- }
- view_list_opt AS view_select view_check_option
- {}
- ;
+ view_suid VIEW_SYM table_ident
+ {
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ lex->sql_command= SQLCOM_CREATE_VIEW;
+ /* first table in list is target VIEW name */
+ if (!lex->select_lex.add_table_to_list(thd, $3, NULL, TL_OPTION_UPDATING))
+ MYSQL_YYABORT;
+ }
+ view_list_opt AS
+ {
+ THD *thd= YYTHD;
+ Lex_input_stream *lip= thd->m_lip;
+
+ lip->body_utf8_start(thd, lip->get_cpp_ptr());
+ }
+ view_select
+ {
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
+
+ lip->body_utf8_append(lip->get_cpp_ptr());
+
+ lex->view_body_utf8.str= thd->strmake(lip->get_body_utf8_str(),
+ lip->get_body_utf8_length());
+ lex->view_body_utf8.length= lip->get_body_utf8_length();
+
+ trim_whitespace(&my_charset_utf8_general_ci, &lex->view_body_utf8);
+ }
+ ;
view_list_opt:
- /* empty */
- {}
- | '(' view_list ')'
- ;
+ /* empty */
+ {}
+ | '(' view_list ')'
+ ;
view_list:
- ident
- {
- Lex->view_list.push_back((LEX_STRING*)
- sql_memdup(&$1, sizeof(LEX_STRING)));
- }
- | view_list ',' ident
- {
- Lex->view_list.push_back((LEX_STRING*)
- sql_memdup(&$3, sizeof(LEX_STRING)));
- }
- ;
+ ident
+ {
+ Lex->view_list.push_back((LEX_STRING*)
+ sql_memdup(&$1, sizeof(LEX_STRING)));
+ }
+ | view_list ',' ident
+ {
+ Lex->view_list.push_back((LEX_STRING*)
+ sql_memdup(&$3, sizeof(LEX_STRING)));
+ }
+ ;
view_select:
- {
- LEX *lex= Lex;
- lex->parsing_options.allows_variable= FALSE;
- lex->parsing_options.allows_select_into= FALSE;
- lex->parsing_options.allows_select_procedure= FALSE;
- lex->parsing_options.allows_derived= FALSE;
- }
- view_select_aux
- {
- LEX *lex= Lex;
- lex->parsing_options.allows_variable= TRUE;
- lex->parsing_options.allows_select_into= TRUE;
- lex->parsing_options.allows_select_procedure= TRUE;
- lex->parsing_options.allows_derived= TRUE;
- }
+ {
+ THD *thd= YYTHD;
+ LEX *lex= Lex;
+ Lex_input_stream *lip= thd->m_lip;
+ lex->parsing_options.allows_variable= FALSE;
+ lex->parsing_options.allows_select_into= FALSE;
+ lex->parsing_options.allows_select_procedure= FALSE;
+ lex->parsing_options.allows_derived= FALSE;
+ lex->create_view_select_start= lip->get_cpp_ptr();
+ }
+ view_select_aux view_check_option
+ {
+ THD *thd= YYTHD;
+ LEX *lex= Lex;
+ Lex_input_stream *lip= thd->m_lip;
+ lex->parsing_options.allows_variable= TRUE;
+ lex->parsing_options.allows_select_into= TRUE;
+ lex->parsing_options.allows_select_procedure= TRUE;
+ lex->parsing_options.allows_derived= TRUE;
+ lex->create_view_select_end= lip->get_cpp_ptr();
+ }
;
view_select_aux:
- SELECT_SYM remember_name select_init2
- {
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- const char *stmt_beg= (lex->sphead ?
- lex->sphead->m_tmp_query : thd->query);
- lex->create_view_select_start= $2 - stmt_beg;
- }
- | '(' remember_name select_paren ')' union_opt
- {
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- const char *stmt_beg= (lex->sphead ?
- lex->sphead->m_tmp_query : thd->query);
- lex->create_view_select_start= $2 - stmt_beg;
- }
- ;
+ SELECT_SYM select_init2
+ | '(' select_paren ')' union_opt
+ ;
view_check_option:
- /* empty */
- { Lex->create_view_check= VIEW_CHECK_NONE; }
- | WITH CHECK_SYM OPTION
- { Lex->create_view_check= VIEW_CHECK_CASCADED; }
- | WITH CASCADED CHECK_SYM OPTION
- { Lex->create_view_check= VIEW_CHECK_CASCADED; }
- | WITH LOCAL_SYM CHECK_SYM OPTION
- { Lex->create_view_check= VIEW_CHECK_LOCAL; }
- ;
+ /* empty */
+ { Lex->create_view_check= VIEW_CHECK_NONE; }
+ | WITH CHECK_SYM OPTION
+ { Lex->create_view_check= VIEW_CHECK_CASCADED; }
+ | WITH CASCADED CHECK_SYM OPTION
+ { Lex->create_view_check= VIEW_CHECK_CASCADED; }
+ | WITH LOCAL_SYM CHECK_SYM OPTION
+ { Lex->create_view_check= VIEW_CHECK_LOCAL; }
+ ;
/**************************************************************************
@@ -11483,71 +12136,93 @@ view_check_option:
**************************************************************************/
trigger_tail:
- TRIGGER_SYM remember_name sp_name trg_action_time trg_event
- ON remember_name table_ident FOR_SYM remember_name EACH_SYM ROW_SYM
- {
- LEX *lex= Lex;
- sp_head *sp;
+ TRIGGER_SYM
+ remember_name
+ sp_name
+ trg_action_time
+ trg_event
+ ON
+ remember_name /* $7 */
+ { /* $8 */
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
+ lex->raw_trg_on_table_name_begin= lip->get_tok_start();
+ }
+ table_ident /* $9 */
+ FOR_SYM
+ remember_name /* $11 */
+ { /* $12 */
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
+ lex->raw_trg_on_table_name_end= lip->get_tok_start();
+ }
+ EACH_SYM
+ ROW_SYM
+ { /* $15 */
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
+ sp_head *sp;
- if (lex->sphead)
- {
- my_error(ER_SP_NO_RECURSIVE_CREATE, MYF(0), "TRIGGER");
- MYSQL_YYABORT;
- }
+ if (lex->sphead)
+ {
+ my_error(ER_SP_NO_RECURSIVE_CREATE, MYF(0), "TRIGGER");
+ MYSQL_YYABORT;
+ }
- if (!(sp= new sp_head()))
- MYSQL_YYABORT;
- sp->reset_thd_mem_root(YYTHD);
- sp->init(lex);
- sp->init_sp_name(YYTHD, $3);
- lex->stmt_definition_begin= $2;
- lex->ident.str= $7;
- lex->ident.length= $10 - $7;
-
- sp->m_type= TYPE_ENUM_TRIGGER;
- lex->sphead= sp;
- lex->spname= $3;
- /*
- We have to turn of CLIENT_MULTI_QUERIES while parsing a
- stored procedure, otherwise yylex will chop it into pieces
- at each ';'.
- */
- $<ulong_num>$= YYTHD->client_capabilities & CLIENT_MULTI_QUERIES;
- YYTHD->client_capabilities &= ~CLIENT_MULTI_QUERIES;
-
- bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics));
- lex->sphead->m_chistics= &lex->sp_chistics;
- lex->sphead->m_body_begin= lex->ptr;
- while (my_isspace(system_charset_info, lex->sphead->m_body_begin[0]))
- ++lex->sphead->m_body_begin;
- }
- sp_proc_stmt
- {
- LEX *lex= Lex;
- sp_head *sp= lex->sphead;
-
- lex->sql_command= SQLCOM_CREATE_TRIGGER;
- sp->init_strings(YYTHD, lex);
- /* Restore flag if it was cleared above */
-
- YYTHD->client_capabilities |= $<ulong_num>13;
- sp->restore_thd_mem_root(YYTHD);
-
- if (sp->is_not_allowed_in_function("trigger"))
- MYSQL_YYABORT;
-
- /*
- We have to do it after parsing trigger body, because some of
- sp_proc_stmt alternatives are not saving/restoring LEX, so
- lex->query_tables can be wiped out.
- */
- if (!lex->select_lex.add_table_to_list(YYTHD, $8,
- (LEX_STRING*) 0,
- TL_OPTION_UPDATING,
- TL_IGNORE))
- MYSQL_YYABORT;
- }
- ;
+ if (!(sp= new sp_head()))
+ MYSQL_YYABORT;
+ sp->reset_thd_mem_root(thd);
+ sp->init(lex);
+ sp->m_type= TYPE_ENUM_TRIGGER;
+ sp->init_sp_name(thd, $3);
+ lex->stmt_definition_begin= $2;
+ lex->ident.str= $7;
+ lex->ident.length= $11 - $7;
+
+ lex->sphead= sp;
+ lex->spname= $3;
+ /*
+ We have to turn of CLIENT_MULTI_QUERIES while parsing a
+ stored procedure, otherwise yylex will chop it into pieces
+ at each ';'.
+ */
+ $<ulong_num>$= thd->client_capabilities & CLIENT_MULTI_QUERIES;
+ thd->client_capabilities &= ~CLIENT_MULTI_QUERIES;
+
+ bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics));
+ lex->sphead->m_chistics= &lex->sp_chistics;
+ lex->sphead->set_body_start(thd, lip->get_cpp_ptr());
+ }
+ sp_proc_stmt /* $16 */
+ { /* $17 */
+ LEX *lex= Lex;
+ sp_head *sp= lex->sphead;
+
+ lex->sql_command= SQLCOM_CREATE_TRIGGER;
+ sp->set_stmt_end(YYTHD);
+ /* Restore flag if it was cleared above */
+
+ YYTHD->client_capabilities |= $<ulong_num>15;
+ sp->restore_thd_mem_root(YYTHD);
+
+ if (sp->is_not_allowed_in_function("trigger"))
+ MYSQL_YYABORT;
+
+ /*
+ We have to do it after parsing trigger body, because some of
+ sp_proc_stmt alternatives are not saving/restoring LEX, so
+ lex->query_tables can be wiped out.
+ */
+ if (!lex->select_lex.add_table_to_list(YYTHD, $9,
+ (LEX_STRING*) 0,
+ TL_OPTION_UPDATING,
+ TL_IGNORE))
+ MYSQL_YYABORT;
+ }
+ ;
/**************************************************************************
@@ -11556,172 +12231,192 @@ trigger_tail:
**************************************************************************/
sp_tail:
- udf_func_type remember_name FUNCTION_SYM sp_name
- {
- LEX *lex=Lex;
- lex->udf.type= $1;
- lex->stmt_definition_begin= $2;
- lex->spname= $4;
- }
- create_function_tail
- {}
- | PROCEDURE remember_name sp_name
- {
- LEX *lex= Lex;
- sp_head *sp;
+ udf_func_type remember_name FUNCTION_SYM sp_name
+ {
+ LEX *lex=Lex;
+ lex->udf.type= $1;
+ lex->stmt_definition_begin= $2;
+ lex->spname= $4;
+ }
+ create_function_tail
+ {}
+ | PROCEDURE remember_name sp_name
+ {
+ LEX *lex= Lex;
+ sp_head *sp;
- if (lex->sphead)
- {
- my_error(ER_SP_NO_RECURSIVE_CREATE, MYF(0), "PROCEDURE");
- MYSQL_YYABORT;
- }
-
- lex->stmt_definition_begin= $2;
-
- /* Order is important here: new - reset - init */
- sp= new sp_head();
- sp->reset_thd_mem_root(YYTHD);
- sp->init(lex);
- sp->init_sp_name(YYTHD, $3);
-
- sp->m_type= TYPE_ENUM_PROCEDURE;
- lex->sphead= sp;
- /*
- * We have to turn of CLIENT_MULTI_QUERIES while parsing a
- * stored procedure, otherwise yylex will chop it into pieces
- * at each ';'.
- */
- $<ulong_num>$= YYTHD->client_capabilities & CLIENT_MULTI_QUERIES;
- YYTHD->client_capabilities &= (~CLIENT_MULTI_QUERIES);
- }
- '('
- {
- LEX *lex= Lex;
+ if (lex->sphead)
+ {
+ my_error(ER_SP_NO_RECURSIVE_CREATE, MYF(0), "PROCEDURE");
+ MYSQL_YYABORT;
+ }
- lex->sphead->m_param_begin= lex->tok_start+1;
- }
- sp_pdparam_list
- ')'
- {
- LEX *lex= Lex;
+ lex->stmt_definition_begin= $2;
- lex->sphead->m_param_end= lex->tok_start;
- bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics));
- }
- sp_c_chistics
- {
- LEX *lex= Lex;
+ /* Order is important here: new - reset - init */
+ sp= new sp_head();
+ sp->reset_thd_mem_root(YYTHD);
+ sp->init(lex);
+ sp->m_type= TYPE_ENUM_PROCEDURE;
+ sp->init_sp_name(YYTHD, $3);
- lex->sphead->m_chistics= &lex->sp_chistics;
- lex->sphead->m_body_begin= lex->tok_start;
- }
- sp_proc_stmt
- {
- LEX *lex= Lex;
- sp_head *sp= lex->sphead;
+ lex->sphead= sp;
+ /*
+ * We have to turn of CLIENT_MULTI_QUERIES while parsing a
+ * stored procedure, otherwise yylex will chop it into pieces
+ * at each ';'.
+ */
+ $<ulong_num>$= YYTHD->client_capabilities & CLIENT_MULTI_QUERIES;
+ YYTHD->client_capabilities &= (~CLIENT_MULTI_QUERIES);
+ }
+ '('
+ {
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
+ const char* tmp_param_begin;
- sp->init_strings(YYTHD, lex);
- lex->sql_command= SQLCOM_CREATE_PROCEDURE;
- /*
- Restore flag if it was cleared above
- Be careful with counting. the block where we save the value
- is $4.
- */
- YYTHD->client_capabilities |= $<ulong_num>4;
- sp->restore_thd_mem_root(YYTHD);
- }
- ;
+ tmp_param_begin= lip->get_cpp_tok_start();
+ tmp_param_begin++;
+ lex->sphead->m_param_begin= tmp_param_begin;
+ }
+ sp_pdparam_list
+ ')'
+ {
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
+
+ lex->sphead->m_param_end= lip->get_cpp_tok_start();
+ bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics));
+ }
+ sp_c_chistics
+ {
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ Lex_input_stream *lip= thd->m_lip;
+
+ lex->sphead->m_chistics= &lex->sp_chistics;
+ lex->sphead->set_body_start(thd, lip->get_cpp_tok_start());
+ }
+ sp_proc_stmt
+ {
+ LEX *lex= Lex;
+ sp_head *sp= lex->sphead;
+
+ sp->set_stmt_end(YYTHD);
+ lex->sql_command= SQLCOM_CREATE_PROCEDURE;
+ /*
+ Restore flag if it was cleared above
+ Be careful with counting. the block where we save the value
+ is $4.
+ */
+ YYTHD->client_capabilities |= $<ulong_num>4;
+ sp->restore_thd_mem_root(YYTHD);
+ }
+ ;
/*************************************************************************/
-xa: XA_SYM begin_or_start xid opt_join_or_resume
- {
- Lex->sql_command = SQLCOM_XA_START;
- }
- | XA_SYM END xid opt_suspend
- {
- Lex->sql_command = SQLCOM_XA_END;
- }
- | XA_SYM PREPARE_SYM xid
- {
- Lex->sql_command = SQLCOM_XA_PREPARE;
- }
- | XA_SYM COMMIT_SYM xid opt_one_phase
- {
- Lex->sql_command = SQLCOM_XA_COMMIT;
- }
- | XA_SYM ROLLBACK_SYM xid
- {
- Lex->sql_command = SQLCOM_XA_ROLLBACK;
- }
- | XA_SYM RECOVER_SYM
- {
- Lex->sql_command = SQLCOM_XA_RECOVER;
- }
- ;
-
-xid: text_string
- {
- MYSQL_YYABORT_UNLESS($1->length() <= MAXGTRIDSIZE);
- if (!(Lex->xid=(XID *)YYTHD->alloc(sizeof(XID))))
- MYSQL_YYABORT;
- Lex->xid->set(1L, $1->ptr(), $1->length(), 0, 0);
- }
- | text_string ',' text_string
- {
- MYSQL_YYABORT_UNLESS($1->length() <= MAXGTRIDSIZE && $3->length() <= MAXBQUALSIZE);
- if (!(Lex->xid=(XID *)YYTHD->alloc(sizeof(XID))))
- MYSQL_YYABORT;
- Lex->xid->set(1L, $1->ptr(), $1->length(), $3->ptr(), $3->length());
- }
- | text_string ',' text_string ',' ulong_num
- {
- MYSQL_YYABORT_UNLESS($1->length() <= MAXGTRIDSIZE && $3->length() <= MAXBQUALSIZE);
- if (!(Lex->xid=(XID *)YYTHD->alloc(sizeof(XID))))
- MYSQL_YYABORT;
- Lex->xid->set($5, $1->ptr(), $1->length(), $3->ptr(), $3->length());
- }
- ;
-
-begin_or_start: BEGIN_SYM {}
- | START_SYM {}
- ;
+xa:
+ XA_SYM begin_or_start xid opt_join_or_resume
+ {
+ Lex->sql_command = SQLCOM_XA_START;
+ }
+ | XA_SYM END xid opt_suspend
+ {
+ Lex->sql_command = SQLCOM_XA_END;
+ }
+ | XA_SYM PREPARE_SYM xid
+ {
+ Lex->sql_command = SQLCOM_XA_PREPARE;
+ }
+ | XA_SYM COMMIT_SYM xid opt_one_phase
+ {
+ Lex->sql_command = SQLCOM_XA_COMMIT;
+ }
+ | XA_SYM ROLLBACK_SYM xid
+ {
+ Lex->sql_command = SQLCOM_XA_ROLLBACK;
+ }
+ | XA_SYM RECOVER_SYM
+ {
+ Lex->sql_command = SQLCOM_XA_RECOVER;
+ }
+ ;
+
+xid:
+ text_string
+ {
+ MYSQL_YYABORT_UNLESS($1->length() <= MAXGTRIDSIZE);
+ if (!(Lex->xid=(XID *)YYTHD->alloc(sizeof(XID))))
+ MYSQL_YYABORT;
+ Lex->xid->set(1L, $1->ptr(), $1->length(), 0, 0);
+ }
+ | text_string ',' text_string
+ {
+ MYSQL_YYABORT_UNLESS($1->length() <= MAXGTRIDSIZE && $3->length() <= MAXBQUALSIZE);
+ if (!(Lex->xid=(XID *)YYTHD->alloc(sizeof(XID))))
+ MYSQL_YYABORT;
+ Lex->xid->set(1L, $1->ptr(), $1->length(), $3->ptr(), $3->length());
+ }
+ | text_string ',' text_string ',' ulong_num
+ {
+ MYSQL_YYABORT_UNLESS($1->length() <= MAXGTRIDSIZE && $3->length() <= MAXBQUALSIZE);
+ if (!(Lex->xid=(XID *)YYTHD->alloc(sizeof(XID))))
+ MYSQL_YYABORT;
+ Lex->xid->set($5, $1->ptr(), $1->length(), $3->ptr(), $3->length());
+ }
+ ;
+
+begin_or_start:
+ BEGIN_SYM {}
+ | START_SYM {}
+ ;
opt_join_or_resume:
- /* nothing */ { Lex->xa_opt=XA_NONE; }
- | JOIN_SYM { Lex->xa_opt=XA_JOIN; }
- | RESUME_SYM { Lex->xa_opt=XA_RESUME; }
- ;
+ /* nothing */ { Lex->xa_opt=XA_NONE; }
+ | JOIN_SYM { Lex->xa_opt=XA_JOIN; }
+ | RESUME_SYM { Lex->xa_opt=XA_RESUME; }
+ ;
opt_one_phase:
- /* nothing */ { Lex->xa_opt=XA_NONE; }
- | ONE_SYM PHASE_SYM { Lex->xa_opt=XA_ONE_PHASE; }
- ;
+ /* nothing */ { Lex->xa_opt=XA_NONE; }
+ | ONE_SYM PHASE_SYM { Lex->xa_opt=XA_ONE_PHASE; }
+ ;
opt_suspend:
- /* nothing */ { Lex->xa_opt=XA_NONE; }
- | SUSPEND_SYM { Lex->xa_opt=XA_SUSPEND; }
- opt_migrate
- ;
+ /* nothing */
+ { Lex->xa_opt=XA_NONE; }
+ | SUSPEND_SYM
+ { Lex->xa_opt=XA_SUSPEND; }
+ opt_migrate
+ ;
opt_migrate:
- /* nothing */ { }
- | FOR_SYM MIGRATE_SYM { Lex->xa_opt=XA_FOR_MIGRATE; }
- ;
+ /* nothing */ {}
+ | FOR_SYM MIGRATE_SYM { Lex->xa_opt=XA_FOR_MIGRATE; }
+ ;
install:
- INSTALL_SYM PLUGIN_SYM ident SONAME_SYM TEXT_STRING_sys
- {
- LEX *lex= Lex;
- lex->sql_command= SQLCOM_INSTALL_PLUGIN;
- lex->comment= $3;
- lex->ident= $5;
- };
+ INSTALL_SYM PLUGIN_SYM ident SONAME_SYM TEXT_STRING_sys
+ {
+ LEX *lex= Lex;
+ lex->sql_command= SQLCOM_INSTALL_PLUGIN;
+ lex->comment= $3;
+ lex->ident= $5;
+ }
+ ;
uninstall:
- UNINSTALL_SYM PLUGIN_SYM ident
- {
- LEX *lex= Lex;
- lex->sql_command= SQLCOM_UNINSTALL_PLUGIN;
- lex->comment= $3;
- };
+ UNINSTALL_SYM PLUGIN_SYM ident
+ {
+ LEX *lex= Lex;
+ lex->sql_command= SQLCOM_UNINSTALL_PLUGIN;
+ lex->comment= $3;
+ }
+ ;
+
+/**
+ @} (end of group Parser)
+*/
diff --git a/sql/stacktrace.c b/sql/stacktrace.c
index 078f62c6b2b..b1267e20774 100644
--- a/sql/stacktrace.c
+++ b/sql/stacktrace.c
@@ -94,7 +94,7 @@ inline uint32* find_prev_pc(uint32* pc, uchar** fp)
#endif /* defined(__alpha__) && defined(__GNUC__) */
-void print_stacktrace(gptr stack_bottom, ulong thread_stack)
+void print_stacktrace(uchar* stack_bottom, ulong thread_stack)
{
uchar** fp;
uint frame_count = 0, sigreturn_frame_count;
@@ -129,11 +129,11 @@ terribly wrong...\n");
return;
}
- if (!stack_bottom || (gptr) stack_bottom > (gptr) &fp)
+ if (!stack_bottom || (uchar*) stack_bottom > (uchar*) &fp)
{
ulong tmp= min(0x10000,thread_stack);
/* Assume that the stack starts at the previous even 65K */
- stack_bottom= (gptr) (((ulong) &fp + tmp) &
+ stack_bottom= (uchar*) (((ulong) &fp + tmp) &
~(ulong) 0xFFFF);
fprintf(stderr, "Cannot determine thread, fp=%p, backtrace may not be correct.\n", fp);
}
@@ -206,9 +206,11 @@ terribly wrong...\n");
fprintf(stderr, "Stack trace seems successful - bottom reached\n");
end:
- fprintf(stderr, "Please read http://dev.mysql.com/doc/mysql/en/using-stack-trace.html and follow instructions on how to resolve the stack trace. Resolved\n\
-stack trace is much more helpful in diagnosing the problem, so please do \n\
-resolve it\n");
+ fprintf(stderr,
+ "Please read http://dev.mysql.com/doc/refman/5.1/en/resolve-stack-dump.html\n"
+ "and follow instructions on how to resolve the stack trace.\n"
+ "Resolved stack trace is much more helpful in diagnosing the\n"
+ "problem, so please do resolve it\n");
}
#endif /* TARGET_OS_LINUX */
#endif /* HAVE_STACKTRACE */
@@ -226,6 +228,15 @@ void write_core(int sig)
void write_core(int sig)
{
signal(sig, SIG_DFL);
+#ifdef HAVE_gcov
+ /*
+ For GCOV build, crashing will prevent the writing of code coverage
+ information from this process, causing gcov output to be incomplete.
+ So we force the writing of coverage information here before terminating.
+ */
+ extern void __gcov_flush(void);
+ __gcov_flush();
+#endif
pthread_kill(pthread_self(), sig);
#if defined(P_MYID) && !defined(SCO)
/* On Solaris, the above kill is not enough */
diff --git a/sql/stacktrace.h b/sql/stacktrace.h
index 56b9877180a..1a0b80c88d3 100644
--- a/sql/stacktrace.h
+++ b/sql/stacktrace.h
@@ -28,7 +28,7 @@ extern char* heap_start;
#define init_stacktrace() do { \
heap_start = (char*) &__bss_start; \
} while(0);
-void print_stacktrace(gptr stack_bottom, ulong thread_stack);
+void print_stacktrace(uchar* stack_bottom, ulong thread_stack);
void safe_print_str(const char* name, const char* val, int max_len);
#endif /* (defined (__i386__) || (defined(__alpha__) && defined(__GNUC__))) */
#endif /* TARGET_OS_LINUX */
diff --git a/sql/strfunc.cc b/sql/strfunc.cc
index 9ffc5fd127f..c03365cfc2b 100644
--- a/sql/strfunc.cc
+++ b/sql/strfunc.cc
@@ -265,10 +265,8 @@ uint strconvert(CHARSET_INFO *from_cs, const char *from,
my_wc_t wc;
char *to_start= to;
uchar *to_end= (uchar*) to + to_length - 1;
- int (*mb_wc)(struct charset_info_st *, my_wc_t *, const uchar *,
- const uchar *)= from_cs->cset->mb_wc;
- int (*wc_mb)(struct charset_info_st *, my_wc_t, uchar *s, uchar *e)=
- to_cs->cset->wc_mb;
+ my_charset_conv_mb_wc mb_wc= from_cs->cset->mb_wc;
+ my_charset_conv_wc_mb wc_mb= to_cs->cset->wc_mb;
uint error_count= 0;
while (1)
diff --git a/sql/structs.h b/sql/structs.h
index 4cf9379d2bb..09a3c4d7285 100644
--- a/sql/structs.h
+++ b/sql/structs.h
@@ -28,8 +28,8 @@ typedef struct st_date_time_format {
typedef struct st_keyfile_info { /* used with ha_info() */
- byte ref[MAX_REFLENGTH]; /* Pointer to current row */
- byte dupp_ref[MAX_REFLENGTH]; /* Pointer to dupp row */
+ uchar ref[MAX_REFLENGTH]; /* Pointer to current row */
+ uchar dupp_ref[MAX_REFLENGTH]; /* Pointer to dupp row */
uint ref_length; /* Length of ref (1-8) */
uint block_size; /* index block size */
File filenr; /* (uniq) filenr for table */
@@ -83,7 +83,7 @@ typedef struct st_key {
*/
union
{
- struct st_plugin_int *parser; /* Fulltext [pre]parser */
+ plugin_ref parser; /* Fulltext [pre]parser */
LEX_STRING *parser_name; /* Fulltext [pre]parser name */
};
KEY_PART_INFO *key_part;
@@ -126,10 +126,10 @@ typedef struct st_read_record { /* Parameter to read_record */
uint cache_records;
uint ref_length,struct_length,reclength,rec_cache_size,error_offset;
uint index;
- byte *ref_pos; /* pointer to form->refpos */
- byte *record;
- byte *rec_buf; /* to read field values after filesort */
- byte *cache,*cache_pos,*cache_end,*read_positions;
+ 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;
} READ_RECORD;
@@ -209,6 +209,11 @@ typedef struct user_conn {
char *user;
/* Pointer to host part of the key. */
char *host;
+ /*
+ The moment of time when per hour counters were reset last time
+ (i.e. start of "hour" for conn_per_hour, updates, questions counters).
+ */
+ ulonglong reset_utime;
/* Total length of the key. */
uint len;
/* Current amount of concurrent connections for this account. */
@@ -220,11 +225,6 @@ typedef struct user_conn {
uint conn_per_hour, updates, questions;
/* Maximum amount of resources which account is allowed to consume. */
USER_RESOURCES user_resources;
- /*
- The moment of time when per hour counters were reset last time
- (i.e. start of "hour" for conn_per_hour, updates, questions counters).
- */
- time_t intime;
} USER_CONN;
/* Bits in form->update */
diff --git a/sql/table.cc b/sql/table.cc
index 9be98eb14b9..c1d8e3abe94 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -19,7 +19,19 @@
#include "mysql_priv.h"
#include "sql_trigger.h"
#include <m_ctype.h>
-#include "md5.h"
+#include "my_md5.h"
+
+/* INFORMATION_SCHEMA name */
+LEX_STRING INFORMATION_SCHEMA_NAME= {C_STRING_WITH_LEN("information_schema")};
+
+/* MYSQL_SCHEMA name */
+LEX_STRING MYSQL_SCHEMA_NAME= {C_STRING_WITH_LEN("mysql")};
+
+/* GENERAL_LOG name */
+LEX_STRING GENERAL_LOG_NAME= {C_STRING_WITH_LEN("general_log")};
+
+/* SLOW_LOG name */
+LEX_STRING SLOW_LOG_NAME= {C_STRING_WITH_LEN("slow_log")};
/* Functions defined in this file */
@@ -29,20 +41,143 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share,
uchar *head, File file);
static void fix_type_pointers(const char ***array, TYPELIB *point_to_type,
uint types, char **names);
-static uint find_field(Field **fields, byte *record, uint start, uint length);
+static uint find_field(Field **fields, uchar *record, uint start, uint length);
+
+inline bool is_system_table_name(const char *name, uint length);
+
+/**************************************************************************
+ Object_creation_ctx implementation.
+**************************************************************************/
+
+Object_creation_ctx *Object_creation_ctx::set_n_backup(THD *thd)
+{
+ Object_creation_ctx *backup_ctx;
+ DBUG_ENTER("Object_creation_ctx::set_n_backup");
+
+ backup_ctx= create_backup_ctx(thd);
+ change_env(thd);
+
+ DBUG_RETURN(backup_ctx);
+}
+
+void Object_creation_ctx::restore_env(THD *thd, Object_creation_ctx *backup_ctx)
+{
+ if (!backup_ctx)
+ return;
+
+ backup_ctx->change_env(thd);
+
+ delete backup_ctx;
+}
+
+/**************************************************************************
+ Default_object_creation_ctx implementation.
+**************************************************************************/
+
+Default_object_creation_ctx::Default_object_creation_ctx(THD *thd)
+ : m_client_cs(thd->variables.character_set_client),
+ m_connection_cl(thd->variables.collation_connection)
+{ }
+Default_object_creation_ctx::Default_object_creation_ctx(
+ CHARSET_INFO *client_cs, CHARSET_INFO *connection_cl)
+ : m_client_cs(client_cs),
+ m_connection_cl(connection_cl)
+{ }
+
+Object_creation_ctx *
+Default_object_creation_ctx::create_backup_ctx(THD *thd) const
+{
+ return new Default_object_creation_ctx(thd);
+}
+
+void Default_object_creation_ctx::change_env(THD *thd) const
+{
+ thd->variables.character_set_client= m_client_cs;
+ thd->variables.collation_connection= m_connection_cl;
+
+ thd->update_charset();
+}
+
+/**************************************************************************
+ View_creation_ctx implementation.
+**************************************************************************/
+
+View_creation_ctx *View_creation_ctx::create(THD *thd)
+{
+ View_creation_ctx *ctx= new (thd->mem_root) View_creation_ctx(thd);
+
+ return ctx;
+}
+
+/*************************************************************************/
+
+View_creation_ctx * View_creation_ctx::create(THD *thd,
+ TABLE_LIST *view)
+{
+ View_creation_ctx *ctx= new (thd->mem_root) View_creation_ctx(thd);
+
+ /* Throw a warning if there is NULL cs name. */
+
+ if (!view->view_client_cs_name.str ||
+ !view->view_connection_cl_name.str)
+ {
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
+ ER_VIEW_NO_CREATION_CTX,
+ ER(ER_VIEW_NO_CREATION_CTX),
+ (const char *) view->db,
+ (const char *) view->table_name);
+
+ ctx->m_client_cs= system_charset_info;
+ ctx->m_connection_cl= system_charset_info;
+
+ return ctx;
+ }
+
+ /* Resolve cs names. Throw a warning if there is unknown cs name. */
+
+ bool invalid_creation_ctx;
+
+ invalid_creation_ctx= resolve_charset(view->view_client_cs_name.str,
+ system_charset_info,
+ &ctx->m_client_cs);
+
+ invalid_creation_ctx= resolve_collation(view->view_connection_cl_name.str,
+ system_charset_info,
+ &ctx->m_connection_cl) ||
+ invalid_creation_ctx;
+
+ if (invalid_creation_ctx)
+ {
+ sql_print_warning("View '%s'.'%s': there is unknown charset/collation "
+ "names (client: '%s'; connection: '%s').",
+ (const char *) view->db,
+ (const char *) view->table_name,
+ (const char *) view->view_client_cs_name.str,
+ (const char *) view->view_connection_cl_name.str);
+
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
+ ER_VIEW_INVALID_CREATION_CTX,
+ ER(ER_VIEW_INVALID_CREATION_CTX),
+ (const char *) view->db,
+ (const char *) view->table_name);
+ }
+
+ return ctx;
+}
+
+/*************************************************************************/
/* Get column name from column hash */
-static byte *get_field_name(Field **buff, uint *length,
- my_bool not_used __attribute__((unused)))
+static uchar *get_field_name(Field **buff, size_t *length,
+ my_bool not_used __attribute__((unused)))
{
*length= (uint) strlen((*buff)->field_name);
- return (byte*) (*buff)->field_name;
+ return (uchar*) (*buff)->field_name;
}
-
/*
Returns pointer to '.frm' extension of the file name.
@@ -72,6 +207,49 @@ char *fn_rext(char *name)
return name + strlen(name);
}
+TABLE_CATEGORY get_table_category(const LEX_STRING *db, const LEX_STRING *name)
+{
+ DBUG_ASSERT(db != NULL);
+ DBUG_ASSERT(name != NULL);
+
+ if ((db->length == INFORMATION_SCHEMA_NAME.length) &&
+ (my_strcasecmp(system_charset_info,
+ INFORMATION_SCHEMA_NAME.str,
+ db->str) == 0))
+ {
+ return TABLE_CATEGORY_INFORMATION;
+ }
+
+ if ((db->length == MYSQL_SCHEMA_NAME.length) &&
+ (my_strcasecmp(system_charset_info,
+ MYSQL_SCHEMA_NAME.str,
+ db->str) == 0))
+ {
+ if (is_system_table_name(name->str, name->length))
+ {
+ return TABLE_CATEGORY_SYSTEM;
+ }
+
+ if ((name->length == GENERAL_LOG_NAME.length) &&
+ (my_strcasecmp(system_charset_info,
+ GENERAL_LOG_NAME.str,
+ name->str) == 0))
+ {
+ return TABLE_CATEGORY_PERFORMANCE;
+ }
+
+ if ((name->length == SLOW_LOG_NAME.length) &&
+ (my_strcasecmp(system_charset_info,
+ SLOW_LOG_NAME.str,
+ name->str) == 0))
+ {
+ return TABLE_CATEGORY_PERFORMANCE;
+ }
+ }
+
+ return TABLE_CATEGORY_USER;
+}
+
/*
Allocate a setup TABLE_SHARE structure
@@ -177,7 +355,8 @@ void init_tmp_table_share(TABLE_SHARE *share, const char *key,
bzero((char*) share, sizeof(*share));
init_sql_alloc(&share->mem_root, TABLE_ALLOC_BLOCK_SIZE, 0);
- share->tmp_table= INTERNAL_TMP_TABLE;
+ share->table_category= TABLE_CATEGORY_TEMPORARY;
+ share->tmp_table= INTERNAL_TMP_TABLE;
share->db.str= (char*) key;
share->db.length= strlen(key);
share->table_cache_key.str= (char*) key;
@@ -237,6 +416,9 @@ void free_table_share(TABLE_SHARE *share)
pthread_cond_destroy(&share->cond);
}
hash_free(&share->name_hash);
+
+ plugin_unlock(NULL, share->db_plugin);
+ share->db_plugin= NULL;
/* We must copy mem_root from share because share is allocated through it */
memcpy((char*) &mem_root, (char*) &share->mem_root, sizeof(mem_root));
@@ -340,10 +522,25 @@ int open_table_def(THD *thd, TABLE_SHARE *share, uint db_flags)
strxmov(path, share->normalized_path.str, reg_ext, NullS);
if ((file= my_open(path, O_RDONLY | O_SHARE, MYF(0))) < 0)
{
- if (strchr(share->table_name.str, '@'))
+ /*
+ We don't try to open 5.0 unencoded name, if
+ - non-encoded name contains '@' signs,
+ because '@' can be misinterpreted.
+ It is not clear if '@' is escape character in 5.1,
+ or a normal character in 5.0.
+
+ - non-encoded db or table name contain "#mysql50#" prefix.
+ This kind of tables must have been opened only by the
+ my_open() above.
+ */
+ if (strchr(share->table_name.str, '@') ||
+ !strncmp(share->db.str, MYSQL50_TABLE_NAME_PREFIX,
+ MYSQL50_TABLE_NAME_PREFIX_LENGTH) ||
+ !strncmp(share->table_name.str, MYSQL50_TABLE_NAME_PREFIX,
+ MYSQL50_TABLE_NAME_PREFIX_LENGTH))
goto err_not_open;
- /* Try unecoded 5.0 name */
+ /* Try unencoded 5.0 name */
uint length;
strxnmov(path, sizeof(path)-1,
mysql_data_home, "/", share->db.str, "/",
@@ -370,14 +567,22 @@ int open_table_def(THD *thd, TABLE_SHARE *share, uint db_flags)
}
error= 4;
- if (my_read(file,(byte*) head, 64, MYF(MY_NABP)))
+ if (my_read(file, head, 64, MYF(MY_NABP)))
goto err;
if (head[0] == (uchar) 254 && head[1] == 1)
{
if (head[2] == FRM_VER || head[2] == FRM_VER+1 ||
(head[2] >= FRM_VER+3 && head[2] <= FRM_VER+4))
+ {
+ /* Open view only */
+ if (db_flags & OPEN_VIEW_ONLY)
+ {
+ error_given= 1;
+ goto err;
+ }
table_type= 1;
+ }
else
{
error= 6; // Unkown .frm version
@@ -406,28 +611,11 @@ int open_table_def(THD *thd, TABLE_SHARE *share, uint db_flags)
*root_ptr= &share->mem_root;
error= open_binary_frm(thd, share, head, file);
*root_ptr= old_root;
-
- if (share->db.length == 5 && !(lower_case_table_names ?
- my_strcasecmp(system_charset_info, share->db.str, "mysql") :
- strcmp(share->db.str, "mysql")))
- {
- /*
- We can't mark all tables in 'mysql' database as system since we don't
- allow to lock such tables for writing with any other tables (even with
- other system tables) and some privilege tables need this.
- */
- share->system_table= is_system_table_name(share->table_name.str,
- share->table_name.length);
- if (!share->system_table)
- {
- share->log_table= check_if_log_table(share->db.length, share->db.str,
- share->table_name.length,
- share->table_name.str, 0);
- }
- }
error_given= 1;
}
+ share->table_category= get_table_category(& share->db, & share->table_name);
+
if (!error)
thd->status_var.opened_shares++;
@@ -460,7 +648,8 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
uint extra_rec_buf_length;
uint i,j;
bool use_hash;
- char *keynames, *record, *names, *comment_pos;
+ char *keynames, *names, *comment_pos;
+ uchar *record;
uchar *disk_buff, *strpos, *null_flags, *null_pos;
ulong pos, record_offset, *rec_per_key, rec_buff_length;
handler *handler_file= 0;
@@ -500,7 +689,15 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
DBUG_PRINT("info", ("default_part_db_type = %u", head[61]));
#endif
legacy_db_type= (enum legacy_db_type) (uint) *(head+3);
- share->db_type= ha_checktype(thd, legacy_db_type, 0, 0);
+ DBUG_ASSERT(share->db_plugin == NULL);
+ /*
+ if the storage engine is dynamic, no point in resolving it by its
+ dynamically allocated legacy_db_type. We will resolve it later by name.
+ */
+ if (legacy_db_type > DB_TYPE_UNKNOWN &&
+ legacy_db_type < DB_TYPE_FIRST_DYNAMIC)
+ share->db_plugin= ha_lock_engine(NULL,
+ ha_checktype(thd, legacy_db_type, 0, 0));
share->db_create_options= db_create_options= uint2korr(head+30);
share->db_options_in_use= share->db_create_options;
share->mysql_version= uint4korr(head+51);
@@ -508,7 +705,8 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
if (!head[32]) // New frm file in 3.23
{
share->avg_row_length= uint4korr(head+34);
- share-> row_type= (row_type) head[40];
+ share->transactional= (ha_choice) head[39];
+ share->row_type= (row_type) head[40];
share->table_charset= get_charset((uint) head[38],MYF(0));
share->null_field_first= 1;
}
@@ -537,7 +735,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
/* Read keyinformation */
key_info_length= (uint) uint2korr(head+28);
VOID(my_seek(file,(ulong) uint2korr(head+6),MY_SEEK_SET,MYF(0)));
- if (read_string(file,(gptr*) &disk_buff,key_info_length))
+ if (read_string(file,(uchar**) &disk_buff,key_info_length))
goto err; /* purecov: inspected */
if (disk_buff[0] & 0x80)
{
@@ -636,19 +834,21 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
if ((n_length= uint4korr(head+55)))
{
/* Read extra data segment */
- char *buff, *next_chunk, *buff_end;
+ uchar *buff, *next_chunk, *buff_end;
DBUG_PRINT("info", ("extra segment size is %u bytes", n_length));
- if (!(next_chunk= buff= my_malloc(n_length, MYF(MY_WME))))
+ if (!(next_chunk= buff= (uchar*) my_malloc(n_length, MYF(MY_WME))))
goto err;
- if (my_pread(file, (byte*)buff, n_length, record_offset + share->reclength,
+ if (my_pread(file, buff, n_length, record_offset + share->reclength,
MYF(MY_NABP)))
{
my_free(buff, MYF(0));
goto err;
}
share->connect_string.length= uint2korr(buff);
- if (! (share->connect_string.str= strmake_root(&share->mem_root,
- next_chunk + 2, share->connect_string.length)))
+ if (!(share->connect_string.str= strmake_root(&share->mem_root,
+ (char*) next_chunk + 2,
+ share->connect_string.
+ length)))
{
my_free(buff, MYF(0));
goto err;
@@ -658,25 +858,51 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
if (next_chunk + 2 < buff_end)
{
uint str_db_type_length= uint2korr(next_chunk);
- LEX_STRING name= { next_chunk + 2, str_db_type_length };
- handlerton *tmp_db_type= ha_resolve_by_name(thd, &name);
- if (tmp_db_type != NULL)
+ LEX_STRING name;
+ name.str= (char*) next_chunk + 2;
+ name.length= str_db_type_length;
+
+ plugin_ref tmp_plugin= ha_resolve_by_name(thd, &name);
+ if (tmp_plugin != NULL && !plugin_equals(tmp_plugin, share->db_plugin))
{
- share->db_type= tmp_db_type;
+ if (legacy_db_type > DB_TYPE_UNKNOWN &&
+ legacy_db_type < DB_TYPE_FIRST_DYNAMIC &&
+ legacy_db_type != ha_legacy_type(
+ plugin_data(tmp_plugin, handlerton *)))
+ {
+ /* bad file, legacy_db_type did not match the name */
+ my_free(buff, MYF(0));
+ goto err;
+ }
+ /*
+ tmp_plugin is locked with a local lock.
+ we unlock the old value of share->db_plugin before
+ replacing it with a globally locked version of tmp_plugin
+ */
+ plugin_unlock(NULL, share->db_plugin);
+ share->db_plugin= my_plugin_lock(NULL, &tmp_plugin);
DBUG_PRINT("info", ("setting dbtype to '%.*s' (%d)",
str_db_type_length, next_chunk + 2,
- ha_legacy_type(share->db_type)));
+ ha_legacy_type(share->db_type())));
}
#ifdef WITH_PARTITION_STORAGE_ENGINE
else
{
- if (!strncmp(next_chunk + 2, "partition", str_db_type_length))
+ LEX_STRING pname= { C_STRING_WITH_LEN( "partition" ) };
+ if (str_db_type_length == pname.length &&
+ !strncmp((char *) next_chunk + 2, pname.str, pname.length))
{
- /* Use partition handler */
- share->db_type= partition_hton;
+ /*
+ Use partition handler
+ tmp_plugin is locked with a local lock.
+ we unlock the old value of share->db_plugin before
+ replacing it with a globally locked version of tmp_plugin
+ */
+ plugin_unlock(NULL, share->db_plugin);
+ share->db_plugin= ha_lock_engine(NULL, partition_hton);
DBUG_PRINT("info", ("setting dbtype to '%.*s' (%d)",
str_db_type_length, next_chunk + 2,
- ha_legacy_type(share->db_type)));
+ ha_legacy_type(share->db_type())));
}
}
#endif
@@ -686,9 +912,10 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
{
uint32 partition_info_len = uint4korr(next_chunk);
#ifdef WITH_PARTITION_STORAGE_ENGINE
- if ((share->partition_info_len= partition_info_len))
+ if ((share->partition_info_buffer_size=
+ share->partition_info_len= partition_info_len))
{
- if (!(share->partition_info=
+ if (!(share->partition_info= (char*)
memdup_root(&share->mem_root, next_chunk + 4,
partition_info_len + 1)))
{
@@ -740,9 +967,10 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
my_free(buff, MYF(0));
goto err;
}
- parser_name.str= next_chunk;
- parser_name.length= strlen(next_chunk);
- keyinfo->parser= plugin_lock(&parser_name, MYSQL_FTPARSER_PLUGIN);
+ parser_name.str= (char*) next_chunk;
+ parser_name.length= strlen((char*) next_chunk);
+ keyinfo->parser= my_plugin_lock_by_name(NULL, &parser_name,
+ MYSQL_FTPARSER_PLUGIN);
if (! keyinfo->parser)
{
my_error(ER_PLUGIN_IS_NOT_LOADED, MYF(0), parser_name.str);
@@ -759,16 +987,16 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
extra_rec_buf_length= uint2korr(head+59);
rec_buff_length= ALIGN_SIZE(share->reclength + 1 + extra_rec_buf_length);
share->rec_buff_length= rec_buff_length;
- if (!(record= (char *) alloc_root(&share->mem_root,
- rec_buff_length)))
+ if (!(record= (uchar *) alloc_root(&share->mem_root,
+ rec_buff_length)))
goto err; /* purecov: inspected */
- share->default_values= (byte *) record;
- if (my_pread(file,(byte*) record, (uint) share->reclength,
+ share->default_values= record;
+ if (my_pread(file, record, (size_t) share->reclength,
record_offset, MYF(MY_NABP)))
goto err; /* purecov: inspected */
VOID(my_seek(file,pos,MY_SEEK_SET,MYF(0)));
- if (my_read(file,(byte*) head,288,MYF(MY_NABP)))
+ if (my_read(file, head,288,MYF(MY_NABP)))
goto err;
#ifdef HAVE_CRYPTED_FRM
if (crypted)
@@ -798,14 +1026,14 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
(uint) ((share->fields+1)*sizeof(Field*)+
interval_count*sizeof(TYPELIB)+
(share->fields+interval_parts+
- keys+3)*sizeof(my_string)+
+ keys+3)*sizeof(char *)+
(n_length+int_length+com_length)))))
goto err; /* purecov: inspected */
share->field= field_ptr;
read_length=(uint) (share->fields * field_pack_length +
pos+ (uint) (n_length+int_length+com_length));
- if (read_string(file,(gptr*) &disk_buff,read_length))
+ if (read_string(file,(uchar**) &disk_buff,read_length))
goto err; /* purecov: inspected */
#ifdef HAVE_CRYPTED_FRM
if (crypted)
@@ -858,10 +1086,10 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
/* Allocate handler */
if (!(handler_file= get_new_handler(share, thd->mem_root,
- share->db_type)))
+ share->db_type())))
goto err;
- record= (char*) share->default_values-1; /* Fieldstart = 1 */
+ record= share->default_values-1; /* Fieldstart = 1 */
if (share->null_field_first)
{
null_flags= null_pos= (uchar*) record+1;
@@ -1055,7 +1283,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
if (use_hash)
(void) my_hash_insert(&share->name_hash,
- (byte*) field_ptr); // never fail
+ (uchar*) field_ptr); // never fail
}
*field_ptr=0; // End marker
@@ -1114,7 +1342,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
key_part->type= field->key_type();
if (field->null_ptr)
{
- key_part->null_offset=(uint) ((byte*) field->null_ptr -
+ key_part->null_offset=(uint) ((uchar*) field->null_ptr -
share->default_values);
key_part->null_bit= field->null_bit;
key_part->store_length+=HA_KEY_NULL_LENGTH;
@@ -1172,7 +1400,11 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
the primary key, then we can use any key to find this column
*/
if (ha_option & HA_PRIMARY_KEY_IN_READ_INDEX)
+ {
field->part_of_key= share->keys_in_use;
+ if (field->part_of_sortkey.is_set(key))
+ field->part_of_sortkey= share->keys_in_use;
+ }
}
if (field->key_length() != key_part->length)
{
@@ -1255,7 +1487,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
}
else
share->primary_key= MAX_KEY;
- x_free((gptr) disk_buff);
+ x_free((uchar*) disk_buff);
disk_buff=0;
if (new_field_pack_flag <= 1)
{
@@ -1327,7 +1559,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
share->error= error;
share->open_errno= my_errno;
share->errarg= errarg;
- x_free((gptr) disk_buff);
+ x_free((uchar*) disk_buff);
delete crypted;
delete handler_file;
hash_free(&share->name_hash);
@@ -1369,7 +1601,7 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
int error;
uint records, i, bitmap_size;
bool error_reported= FALSE;
- byte *record, *bitmaps;
+ uchar *record, *bitmaps;
Field **field_ptr;
DBUG_ENTER("open_table_from_share");
DBUG_PRINT("enter",("name: '%s.%s' form: 0x%lx", share->db.str,
@@ -1391,9 +1623,17 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
outparam->keys_in_use_for_query.init();
/* Allocate handler */
- if (!(outparam->file= get_new_handler(share, &outparam->mem_root,
- share->db_type)))
- goto err;
+ outparam->file= 0;
+ if (!(prgflag & OPEN_FRM_FILE_ONLY))
+ {
+ if (!(outparam->file= get_new_handler(share, &outparam->mem_root,
+ share->db_type())))
+ goto err;
+ }
+ else
+ {
+ DBUG_ASSERT(!db_stat);
+ }
error= 4;
outparam->reginfo.lock_type= TL_UNLOCK;
@@ -1404,7 +1644,7 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
if (prgflag & (READ_ALL+EXTRA_RECORD))
records++;
- if (!(record= (byte*) alloc_root(&outparam->mem_root,
+ if (!(record= (uchar*) alloc_root(&outparam->mem_root,
share->rec_buff_length * records)))
goto err; /* purecov: inspected */
@@ -1444,7 +1684,7 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
outparam->field= field_ptr;
- record= (byte*) outparam->record[0]-1; /* Fieldstart = 1 */
+ record= (uchar*) outparam->record[0]-1; /* Fieldstart = 1 */
if (share->null_field_first)
outparam->null_flags= (uchar*) record+1;
else
@@ -1513,7 +1753,7 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
}
#ifdef WITH_PARTITION_STORAGE_ENGINE
- if (share->partition_info_len)
+ if (share->partition_info_len && outparam->file)
{
/*
In this execution we must avoid calling thd->change_item_tree since
@@ -1532,21 +1772,30 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
thd->set_n_backup_active_arena(&part_func_arena, &backup_arena);
thd->stmt_arena= &part_func_arena;
bool tmp;
+ bool work_part_info_used;
tmp= mysql_unpack_partition(thd, share->partition_info,
share->partition_info_len,
share->part_state,
share->part_state_len,
outparam, is_create_table,
- share->default_part_db_type);
+ share->default_part_db_type,
+ &work_part_info_used);
outparam->part_info->is_auto_partitioned= share->auto_partitioned;
DBUG_PRINT("info", ("autopartitioned: %u", share->auto_partitioned));
- if (!tmp)
+ /* we should perform the fix_partition_func in either local or
+ caller's arena depending on work_part_info_used value
+ */
+ if (!tmp && !work_part_info_used)
tmp= fix_partition_func(thd, outparam, is_create_table);
thd->stmt_arena= backup_stmt_arena_ptr;
thd->restore_active_arena(&part_func_arena, &backup_arena);
if (!tmp)
+ {
+ if (work_part_info_used)
+ tmp= fix_partition_func(thd, outparam, is_create_table);
outparam->part_info->item_free_list= part_func_arena.free_list;
+ }
if (tmp)
{
if (is_create_table)
@@ -1566,7 +1815,7 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
/* Allocate bitmaps */
bitmap_size= share->column_bitmap_size;
- if (!(bitmaps= (byte*) alloc_root(&outparam->mem_root, bitmap_size*3)))
+ if (!(bitmaps= (uchar*) alloc_root(&outparam->mem_root, bitmap_size*3)))
goto err;
bitmap_init(&outparam->def_read_set,
(my_bitmap_map*) bitmaps, share->fields, FALSE);
@@ -1632,6 +1881,9 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
bzero((char*) bitmaps, bitmap_size*3);
#endif
+ outparam->no_replicate= outparam->file &&
+ test(outparam->file->ha_table_flags() &
+ HA_HAS_OWN_BINLOGGING);
thd->status_var.opened_tables++;
DBUG_RETURN (0);
@@ -1676,7 +1928,7 @@ int closefrm(register TABLE *table, bool free_share)
{
if (key_info->flags & HA_USES_PARSER)
{
- plugin_unlock(key_info->parser);
+ plugin_unlock(NULL, key_info->parser);
key_info->flags= 0;
}
}
@@ -1733,7 +1985,7 @@ ulong get_form_pos(File file, uchar *head, TYPELIB *save_names)
DBUG_ENTER("get_form_pos");
names=uint2korr(head+8);
- a_length=(names+2)*sizeof(my_string); /* Room for two extra */
+ a_length=(names+2)*sizeof(char *); /* Room for two extra */
if (!save_names)
a_length=0;
@@ -1744,12 +1996,12 @@ ulong get_form_pos(File file, uchar *head, TYPELIB *save_names)
{
length=uint2korr(head+4);
VOID(my_seek(file,64L,MY_SEEK_SET,MYF(0)));
- if (!(buf= (uchar*) my_malloc((uint) length+a_length+names*4,
+ if (!(buf= (uchar*) my_malloc((size_t) length+a_length+names*4,
MYF(MY_WME))) ||
- my_read(file,(byte*) buf+a_length,(uint) (length+names*4),
+ my_read(file, buf+a_length, (size_t) (length+names*4),
MYF(MY_NABP)))
{ /* purecov: inspected */
- x_free((gptr) buf); /* purecov: inspected */
+ x_free((uchar*) buf); /* purecov: inspected */
DBUG_RETURN(0L); /* purecov: inspected */
}
pos= buf+a_length+length;
@@ -1758,7 +2010,7 @@ ulong get_form_pos(File file, uchar *head, TYPELIB *save_names)
if (! save_names)
{
if (names)
- my_free((gptr) buf,MYF(0));
+ my_free((uchar*) buf,MYF(0));
}
else if (!names)
bzero((char*) save_names,sizeof(save_names));
@@ -1772,19 +2024,24 @@ ulong get_form_pos(File file, uchar *head, TYPELIB *save_names)
}
- /* Read string from a file with malloc */
+/*
+ Read string from a file with malloc
+
+ NOTES:
+ We add an \0 at end of the read string to make reading of C strings easier
+*/
-int read_string(File file, gptr *to, uint length)
+int read_string(File file, uchar**to, size_t length)
{
DBUG_ENTER("read_string");
- x_free((gptr) *to);
- if (!(*to= (gptr) my_malloc(length+1,MYF(MY_WME))) ||
- my_read(file,(byte*) *to,length,MYF(MY_NABP)))
+ x_free(*to);
+ if (!(*to= (uchar*) my_malloc(length+1,MYF(MY_WME))) ||
+ my_read(file, *to, length,MYF(MY_NABP)))
{
- x_free((gptr) *to); /* purecov: inspected */
- *to= 0; /* purecov: inspected */
- DBUG_RETURN(1); /* purecov: inspected */
+ x_free(*to); /* purecov: inspected */
+ *to= 0; /* purecov: inspected */
+ DBUG_RETURN(1); /* purecov: inspected */
}
*((char*) *to+length)= '\0';
DBUG_RETURN (0);
@@ -1798,7 +2055,7 @@ ulong make_new_entry(File file, uchar *fileinfo, TYPELIB *formnames,
{
uint i,bufflength,maxlength,n_length,length,names;
ulong endpos,newpos;
- char buff[IO_SIZE];
+ uchar buff[IO_SIZE];
uchar *pos;
DBUG_ENTER("make_new_entry");
@@ -1818,17 +2075,17 @@ ulong make_new_entry(File file, uchar *fileinfo, TYPELIB *formnames,
while (endpos > maxlength)
{
VOID(my_seek(file,(ulong) (endpos-bufflength),MY_SEEK_SET,MYF(0)));
- if (my_read(file,(byte*) buff,bufflength,MYF(MY_NABP+MY_WME)))
+ if (my_read(file, buff, bufflength, MYF(MY_NABP+MY_WME)))
DBUG_RETURN(0L);
VOID(my_seek(file,(ulong) (endpos-bufflength+IO_SIZE),MY_SEEK_SET,
MYF(0)));
- if ((my_write(file,(byte*) buff,bufflength,MYF(MY_NABP+MY_WME))))
+ if ((my_write(file, buff,bufflength,MYF(MY_NABP+MY_WME))))
DBUG_RETURN(0);
endpos-=bufflength; bufflength=IO_SIZE;
}
bzero(buff,IO_SIZE); /* Null new block */
VOID(my_seek(file,(ulong) maxlength,MY_SEEK_SET,MYF(0)));
- if (my_write(file,(byte*) buff,bufflength,MYF(MY_NABP+MY_WME)))
+ if (my_write(file,buff,bufflength,MYF(MY_NABP+MY_WME)))
DBUG_RETURN(0L);
maxlength+=IO_SIZE; /* Fix old ref */
int2store(fileinfo+6,maxlength);
@@ -1843,15 +2100,15 @@ ulong make_new_entry(File file, uchar *fileinfo, TYPELIB *formnames,
if (n_length == 1 )
{ /* First name */
length++;
- VOID(strxmov(buff,"/",newname,"/",NullS));
+ VOID(strxmov((char*) buff,"/",newname,"/",NullS));
}
else
- VOID(strxmov(buff,newname,"/",NullS)); /* purecov: inspected */
+ VOID(strxmov((char*) buff,newname,"/",NullS)); /* purecov: inspected */
VOID(my_seek(file,63L+(ulong) n_length,MY_SEEK_SET,MYF(0)));
- if (my_write(file,(byte*) buff,(uint) length+1,MYF(MY_NABP+MY_WME)) ||
- (names && my_write(file,(byte*) (*formnames->type_names+n_length-1),
+ if (my_write(file, buff, (size_t) length+1,MYF(MY_NABP+MY_WME)) ||
+ (names && my_write(file,(uchar*) (*formnames->type_names+n_length-1),
names*4, MYF(MY_NABP+MY_WME))) ||
- my_write(file,(byte*) fileinfo+10,(uint) 4,MYF(MY_NABP+MY_WME)))
+ my_write(file, fileinfo+10, 4,MYF(MY_NABP+MY_WME)))
DBUG_RETURN(0L); /* purecov: inspected */
int2store(fileinfo+8,names+1);
@@ -1887,10 +2144,10 @@ void open_table_error(TABLE_SHARE *share, int error, int db_errno, int errarg)
handler *file= 0;
const char *datext= "";
- if (share->db_type != NULL)
+ if (share->db_type() != NULL)
{
if ((file= get_new_handler(share, current_thd->mem_root,
- share->db_type)))
+ share->db_type())))
{
if (!(datext= *file->bas_ext()))
datext= "";
@@ -2011,7 +2268,7 @@ TYPELIB *typelib(MEM_ROOT *mem_root, List<String> &strings)
# field number +1
*/
-static uint find_field(Field **fields, byte *record, uint start, uint length)
+static uint find_field(Field **fields, uchar *record, uint start, uint length)
{
Field **field;
uint i, pos;
@@ -2124,7 +2381,7 @@ File create_frm(THD *thd, const char *name, const char *db,
{
register File file;
ulong length;
- char fill[IO_SIZE];
+ uchar fill[IO_SIZE];
int create_flags= O_RDWR | O_TRUNC;
if (create_info->options & HA_LEX_CREATE_TMP_TABLE)
@@ -2150,7 +2407,19 @@ File create_frm(THD *thd, const char *name, const char *db,
ha_checktype(thd,ha_legacy_type(create_info->db_type),0,0));
fileinfo[4]=1;
int2store(fileinfo+6,IO_SIZE); /* Next block starts here */
- key_length=keys*(7+NAME_LEN+MAX_REF_PARTS*9)+16;
+ /*
+ Keep in sync with pack_keys() in unireg.cc
+ For each key:
+ 8 bytes for the key header
+ 9 bytes for each key-part (MAX_REF_PARTS)
+ NAME_LEN bytes for the name
+ 1 byte for the NAMES_SEP_CHAR (before the name)
+ For all keys:
+ 6 bytes for the header
+ 1 byte for the NAMES_SEP_CHAR (after the last name)
+ 9 extra bytes (padding for safety? alignment?)
+ */
+ key_length= keys * (8 + MAX_REF_PARTS * 9 + NAME_LEN + 1) + 16;
length= next_io_size((ulong) (IO_SIZE+key_length+reclength+
create_info->extra_size));
int4store(fileinfo+10,length);
@@ -2167,6 +2436,7 @@ File create_frm(THD *thd, const char *name, const char *db,
int4store(fileinfo+34,create_info->avg_row_length);
fileinfo[38]= (create_info->default_table_charset ?
create_info->default_table_charset->number : 0);
+ fileinfo[39]= (uchar) create_info->transactional;
fileinfo[40]= (uchar) create_info->row_type;
/* Next few bytes were for RAID support */
fileinfo[41]= 0;
@@ -2187,7 +2457,7 @@ File create_frm(THD *thd, const char *name, const char *db,
bzero(fill,IO_SIZE);
for (; length > IO_SIZE ; length-= IO_SIZE)
{
- if (my_write(file,(byte*) fill,IO_SIZE,MYF(MY_WME | MY_NABP)))
+ if (my_write(file,fill, IO_SIZE, MYF(MY_WME | MY_NABP)))
{
VOID(my_close(file,MYF(0)));
VOID(my_delete(name,MYF(0)));
@@ -2218,6 +2488,7 @@ void update_create_info_from_table(HA_CREATE_INFO *create_info, TABLE *table)
create_info->row_type= share->row_type;
create_info->default_table_charset= share->table_charset;
create_info->table_charset= 0;
+ create_info->comment= share->comment;
DBUG_VOID_RETURN;
}
@@ -2298,7 +2569,7 @@ char *get_field(MEM_ROOT *mem, Field *field)
given a buffer with a key value, and a map of keyparts
that are present in this value, returns the length of the value
*/
-uint calculate_key_len(TABLE *table, uint key, const byte *buf,
+uint calculate_key_len(TABLE *table, uint key, const uchar *buf,
key_part_map keypart_map)
{
/* works only with key prefixes */
@@ -2650,16 +2921,16 @@ void st_table::reset_item_list(List<Item> *item_list) const
calculate md5 of query
SYNOPSIS
- st_table_list::calc_md5()
+ TABLE_LIST::calc_md5()
buffer buffer for md5 writing
*/
-void st_table_list::calc_md5(char *buffer)
+void TABLE_LIST::calc_md5(char *buffer)
{
my_MD5_CTX context;
uchar digest[16];
my_MD5Init(&context);
- my_MD5Update(&context,(uchar *) query.str, query.length);
+ my_MD5Update(&context,(uchar *) select_stmt.str, select_stmt.length);
my_MD5Final(digest, &context);
sprintf((char *) buffer,
"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
@@ -2679,10 +2950,10 @@ void st_table_list::calc_md5(char *buffer)
it (it is a kind of optimisation)
SYNOPSIS
- st_table_list::set_underlying_merge()
+ TABLE_LIST::set_underlying_merge()
*/
-void st_table_list::set_underlying_merge()
+void TABLE_LIST::set_underlying_merge()
{
TABLE_LIST *tbl;
@@ -2717,7 +2988,7 @@ void st_table_list::set_underlying_merge()
setup fields of placeholder of merged VIEW
SYNOPSIS
- st_table_list::setup_underlying()
+ TABLE_LIST::setup_underlying()
thd - thread handler
DESCRIPTION
@@ -2730,9 +3001,9 @@ void st_table_list::set_underlying_merge()
TRUE - error
*/
-bool st_table_list::setup_underlying(THD *thd)
+bool TABLE_LIST::setup_underlying(THD *thd)
{
- DBUG_ENTER("st_table_list::setup_underlying");
+ DBUG_ENTER("TABLE_LIST::setup_underlying");
if (!field_translation && merge_underlying_list)
{
@@ -2743,7 +3014,7 @@ bool st_table_list::setup_underlying(THD *thd)
List_iterator_fast<Item> it(select->item_list);
uint field_count= 0;
- if (check_stack_overrun(thd, STACK_MIN_SIZE, (char *)&field_count))
+ if (check_stack_overrun(thd, STACK_MIN_SIZE, (uchar*) &field_count))
{
DBUG_RETURN(TRUE);
}
@@ -2795,7 +3066,7 @@ bool st_table_list::setup_underlying(THD *thd)
Prepare where expression of view
SYNOPSIS
- st_table_list::prep_where()
+ TABLE_LIST::prep_where()
thd - thread handler
conds - condition of this JOIN
no_where_clause - do not build WHERE or ON outer qwery do not need it
@@ -2809,10 +3080,10 @@ bool st_table_list::setup_underlying(THD *thd)
TRUE - error
*/
-bool st_table_list::prep_where(THD *thd, Item **conds,
+bool TABLE_LIST::prep_where(THD *thd, Item **conds,
bool no_where_clause)
{
- DBUG_ENTER("st_table_list::prep_where");
+ DBUG_ENTER("TABLE_LIST::prep_where");
for (TABLE_LIST *tbl= merge_underlying_list; tbl; tbl= tbl->next_local)
{
@@ -2868,10 +3139,51 @@ bool st_table_list::prep_where(THD *thd, Item **conds,
/*
+ Merge ON expressions for a view
+
+ SYNOPSIS
+ merge_on_conds()
+ thd thread handle
+ table table for the VIEW
+ is_cascaded TRUE <=> merge ON expressions from underlying views
+
+ DESCRIPTION
+ This function returns the result of ANDing the ON expressions
+ of the given view and all underlying views. The ON expressions
+ of the underlying views are added only if is_cascaded is TRUE.
+
+ RETURN
+ Pointer to the built expression if there is any.
+ Otherwise and in the case of a failure NULL is returned.
+*/
+
+static Item *
+merge_on_conds(THD *thd, TABLE_LIST *table, bool is_cascaded)
+{
+ DBUG_ENTER("merge_on_conds");
+
+ Item *cond= NULL;
+ DBUG_PRINT("info", ("alias: %s", table->alias));
+ if (table->on_expr)
+ cond= table->on_expr->copy_andor_structure(thd);
+ if (!table->nested_join)
+ DBUG_RETURN(cond);
+ List_iterator<TABLE_LIST> li(table->nested_join->join_list);
+ while (TABLE_LIST *tbl= li++)
+ {
+ if (tbl->view && !is_cascaded)
+ continue;
+ cond= and_conds(cond, merge_on_conds(thd, tbl, is_cascaded));
+ }
+ DBUG_RETURN(cond);
+}
+
+
+/*
Prepare check option expression of table
SYNOPSIS
- st_table_list::prep_check_option()
+ TABLE_LIST::prep_check_option()
thd - thread handler
check_opt_type - WITH CHECK OPTION type (VIEW_CHECK_NONE,
VIEW_CHECK_LOCAL, VIEW_CHECK_CASCADED)
@@ -2883,51 +3195,55 @@ bool st_table_list::prep_where(THD *thd, Item **conds,
VIEW_CHECK_LOCAL option.
NOTE
- This method build check options for every call
- (usual execution or every SP/PS call)
+ This method builds check option condition to use it later on
+ every call (usual execution or every SP/PS call).
This method have to be called after WHERE preparation
- (st_table_list::prep_where)
+ (TABLE_LIST::prep_where)
RETURN
FALSE - OK
TRUE - error
*/
-bool st_table_list::prep_check_option(THD *thd, uint8 check_opt_type)
+bool TABLE_LIST::prep_check_option(THD *thd, uint8 check_opt_type)
{
- DBUG_ENTER("st_table_list::prep_check_option");
+ DBUG_ENTER("TABLE_LIST::prep_check_option");
+ bool is_cascaded= check_opt_type == VIEW_CHECK_CASCADED;
for (TABLE_LIST *tbl= merge_underlying_list; tbl; tbl= tbl->next_local)
{
/* see comment of check_opt_type parameter */
- if (tbl->view &&
- tbl->prep_check_option(thd,
- ((check_opt_type == VIEW_CHECK_CASCADED) ?
- VIEW_CHECK_CASCADED :
- VIEW_CHECK_NONE)))
- {
+ if (tbl->view && tbl->prep_check_option(thd, (is_cascaded ?
+ VIEW_CHECK_CASCADED :
+ VIEW_CHECK_NONE)))
DBUG_RETURN(TRUE);
- }
}
- if (check_opt_type)
+ if (check_opt_type && !check_option_processed)
{
- Item *item= 0;
+ Query_arena *arena= thd->stmt_arena, backup;
+ arena= thd->activate_stmt_arena_if_needed(&backup); // For easier test
+
if (where)
{
DBUG_ASSERT(where->fixed);
- item= where->copy_andor_structure(thd);
+ check_option= where->copy_andor_structure(thd);
}
- if (check_opt_type == VIEW_CHECK_CASCADED)
+ if (is_cascaded)
{
for (TABLE_LIST *tbl= merge_underlying_list; tbl; tbl= tbl->next_local)
{
if (tbl->check_option)
- item= and_conds(item, tbl->check_option);
+ check_option= and_conds(check_option, tbl->check_option);
}
}
- if (item)
- thd->change_item_tree(&check_option, item);
+ check_option= and_conds(check_option,
+ merge_on_conds(thd, this, is_cascaded));
+
+ if (arena)
+ thd->restore_active_arena(arena, &backup);
+ check_option_processed= TRUE;
+
}
if (check_option)
@@ -2950,12 +3266,12 @@ bool st_table_list::prep_check_option(THD *thd, uint8 check_opt_type)
Hide errors which show view underlying table information
SYNOPSIS
- st_table_list::hide_view_error()
+ TABLE_LIST::hide_view_error()
thd thread handler
*/
-void st_table_list::hide_view_error(THD *thd)
+void TABLE_LIST::hide_view_error(THD *thd)
{
/* Hide "Unknown column" or "Unknown function" error */
if (thd->net.last_errno == ER_BAD_FIELD_ERROR ||
@@ -2986,7 +3302,7 @@ void st_table_list::hide_view_error(THD *thd)
table_to_find (TABLE)
SYNOPSIS
- st_table_list::find_underlying_table()
+ TABLE_LIST::find_underlying_table()
table_to_find table to find
RETURN
@@ -2994,7 +3310,7 @@ void st_table_list::hide_view_error(THD *thd)
found table reference
*/
-st_table_list *st_table_list::find_underlying_table(TABLE *table_to_find)
+TABLE_LIST *TABLE_LIST::find_underlying_table(TABLE *table_to_find)
{
/* is this real table and table which we are looking for? */
if (table == table_to_find && merge_underlying_list == 0)
@@ -3013,10 +3329,10 @@ st_table_list *st_table_list::find_underlying_table(TABLE *table_to_find)
cleunup items belonged to view fields translation table
SYNOPSIS
- st_table_list::cleanup_items()
+ TABLE_LIST::cleanup_items()
*/
-void st_table_list::cleanup_items()
+void TABLE_LIST::cleanup_items()
{
if (!field_translation)
return;
@@ -3032,7 +3348,7 @@ void st_table_list::cleanup_items()
check CHECK OPTION condition
SYNOPSIS
- check_option()
+ TABLE_LIST::view_check_option()
ignore_failure ignore check option fail
RETURN
@@ -3041,7 +3357,7 @@ void st_table_list::cleanup_items()
VIEW_CHECK_SKIP FAILED, but continue
*/
-int st_table_list::view_check_option(THD *thd, bool ignore_failure)
+int TABLE_LIST::view_check_option(THD *thd, bool ignore_failure)
{
if (check_option && check_option->val_int() == 0)
{
@@ -3066,7 +3382,7 @@ int st_table_list::view_check_option(THD *thd, bool ignore_failure)
table belong to given mask
SYNOPSIS
- st_table_list::check_single_table()
+ TABLE_LIST::check_single_table()
table_arg reference on variable where to store found table
(should be 0 on call, to find table, or point to table for
unique test)
@@ -3078,9 +3394,9 @@ int st_table_list::view_check_option(THD *thd, bool ignore_failure)
TRUE found several tables
*/
-bool st_table_list::check_single_table(st_table_list **table_arg,
+bool TABLE_LIST::check_single_table(TABLE_LIST **table_arg,
table_map map,
- st_table_list *view_arg)
+ TABLE_LIST *view_arg)
{
for (TABLE_LIST *tbl= merge_underlying_list; tbl; tbl= tbl->next_local)
{
@@ -3113,12 +3429,12 @@ bool st_table_list::check_single_table(st_table_list **table_arg,
TRUE - out of memory
*/
-bool st_table_list::set_insert_values(MEM_ROOT *mem_root)
+bool TABLE_LIST::set_insert_values(MEM_ROOT *mem_root)
{
if (table)
{
if (!table->insert_values &&
- !(table->insert_values= (byte *)alloc_root(mem_root,
+ !(table->insert_values= (uchar *)alloc_root(mem_root,
table->s->rec_buff_length)))
return TRUE;
}
@@ -3137,7 +3453,7 @@ bool st_table_list::set_insert_values(MEM_ROOT *mem_root)
Test if this is a leaf with respect to name resolution.
SYNOPSIS
- st_table_list::is_leaf_for_name_resolution()
+ TABLE_LIST::is_leaf_for_name_resolution()
DESCRIPTION
A table reference is a leaf with respect to name resolution if
@@ -3149,7 +3465,7 @@ bool st_table_list::set_insert_values(MEM_ROOT *mem_root)
RETURN
TRUE if a leaf, FALSE otherwise.
*/
-bool st_table_list::is_leaf_for_name_resolution()
+bool TABLE_LIST::is_leaf_for_name_resolution()
{
return (view || is_natural_join || is_join_columns_complete ||
!nested_join);
@@ -3161,7 +3477,7 @@ bool st_table_list::is_leaf_for_name_resolution()
respect to name resolution.
SYNOPSIS
- st_table_list::first_leaf_for_name_resolution()
+ TABLE_LIST::first_leaf_for_name_resolution()
DESCRIPTION
Given that 'this' is a nested table reference, recursively walk
@@ -3179,7 +3495,7 @@ bool st_table_list::is_leaf_for_name_resolution()
else return 'this'
*/
-TABLE_LIST *st_table_list::first_leaf_for_name_resolution()
+TABLE_LIST *TABLE_LIST::first_leaf_for_name_resolution()
{
TABLE_LIST *cur_table_ref;
NESTED_JOIN *cur_nested_join;
@@ -3219,7 +3535,7 @@ TABLE_LIST *st_table_list::first_leaf_for_name_resolution()
respect to name resolution.
SYNOPSIS
- st_table_list::last_leaf_for_name_resolution()
+ TABLE_LIST::last_leaf_for_name_resolution()
DESCRIPTION
Given that 'this' is a nested table reference, recursively walk
@@ -3237,7 +3553,7 @@ TABLE_LIST *st_table_list::first_leaf_for_name_resolution()
- else - 'this'
*/
-TABLE_LIST *st_table_list::last_leaf_for_name_resolution()
+TABLE_LIST *TABLE_LIST::last_leaf_for_name_resolution()
{
TABLE_LIST *cur_table_ref= this;
NESTED_JOIN *cur_nested_join;
@@ -3279,7 +3595,7 @@ TABLE_LIST *st_table_list::last_leaf_for_name_resolution()
want_access Acess which we require
*/
-void st_table_list::register_want_access(ulong want_access)
+void TABLE_LIST::register_want_access(ulong want_access)
{
/* Remove SHOW_VIEW_ACL, because it will be checked during making view */
want_access&= ~SHOW_VIEW_ACL;
@@ -3298,7 +3614,7 @@ void st_table_list::register_want_access(ulong want_access)
Load security context information for this view
SYNOPSIS
- st_table_list::prepare_view_securety_context()
+ TABLE_LIST::prepare_view_securety_context()
thd [in] thread handler
RETURN
@@ -3307,9 +3623,9 @@ void st_table_list::register_want_access(ulong want_access)
*/
#ifndef NO_EMBEDDED_ACCESS_CHECKS
-bool st_table_list::prepare_view_securety_context(THD *thd)
+bool TABLE_LIST::prepare_view_securety_context(THD *thd)
{
- DBUG_ENTER("st_table_list::prepare_view_securety_context");
+ DBUG_ENTER("TABLE_LIST::prepare_view_securety_context");
DBUG_PRINT("enter", ("table: %s", alias));
DBUG_ASSERT(!prelocking_placeholder && view);
@@ -3358,17 +3674,17 @@ bool st_table_list::prepare_view_securety_context(THD *thd)
Find security context of current view
SYNOPSIS
- st_table_list::find_view_security_context()
+ TABLE_LIST::find_view_security_context()
thd [in] thread handler
*/
#ifndef NO_EMBEDDED_ACCESS_CHECKS
-Security_context *st_table_list::find_view_security_context(THD *thd)
+Security_context *TABLE_LIST::find_view_security_context(THD *thd)
{
Security_context *sctx;
TABLE_LIST *upper_view= this;
- DBUG_ENTER("st_table_list::find_view_security_context");
+ DBUG_ENTER("TABLE_LIST::find_view_security_context");
DBUG_ASSERT(view);
while (upper_view && !upper_view->view_suid)
@@ -3397,7 +3713,7 @@ Security_context *st_table_list::find_view_security_context(THD *thd)
Prepare security context and load underlying tables priveleges for view
SYNOPSIS
- st_table_list::prepare_security()
+ TABLE_LIST::prepare_security()
thd [in] thread handler
RETURN
@@ -3405,11 +3721,11 @@ Security_context *st_table_list::find_view_security_context(THD *thd)
TRUE Error
*/
-bool st_table_list::prepare_security(THD *thd)
+bool TABLE_LIST::prepare_security(THD *thd)
{
List_iterator_fast<TABLE_LIST> tb(*view_tables);
TABLE_LIST *tbl;
- DBUG_ENTER("st_table_list::prepare_security");
+ DBUG_ENTER("TABLE_LIST::prepare_security");
#ifndef NO_EMBEDDED_ACCESS_CHECKS
Security_context *save_security_ctx= thd->security_ctx;
@@ -4158,10 +4474,10 @@ void st_table::mark_columns_needed_for_insert()
Cleanup this table for re-execution.
SYNOPSIS
- st_table_list::reinit_before_use()
+ TABLE_LIST::reinit_before_use()
*/
-void st_table_list::reinit_before_use(THD *thd)
+void TABLE_LIST::reinit_before_use(THD *thd)
{
/*
Reset old pointers to TABLEs: they are not valid since the tables
@@ -4188,7 +4504,7 @@ void st_table_list::reinit_before_use(THD *thd)
Return subselect that contains the FROM list this table is taken from
SYNOPSIS
- st_table_list::containing_subselect()
+ TABLE_LIST::containing_subselect()
RETURN
Subselect item for the subquery that contains the FROM list
@@ -4197,7 +4513,7 @@ void st_table_list::reinit_before_use(THD *thd)
*/
-Item_subselect *st_table_list::containing_subselect()
+Item_subselect *TABLE_LIST::containing_subselect()
{
return (select_lex ? select_lex->master_unit()->item : 0);
}
@@ -4211,7 +4527,7 @@ Item_subselect *st_table_list::containing_subselect()
DESCRIPTION
The parser collects the index hints for each table in a "tagged list"
- (st_table_list::index_hints). Using the information in this 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,
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.
@@ -4253,11 +4569,11 @@ Item_subselect *st_table_list::containing_subselect()
FALSE no errors found
TRUE found and reported an error.
*/
-bool st_table_list::process_index_hints(TABLE *table)
+bool TABLE_LIST::process_index_hints(TABLE *tbl)
{
/* initialize the result variables */
- table->keys_in_use_for_query= table->keys_in_use_for_group_by=
- table->keys_in_use_for_order_by= table->s->keys_in_use;
+ tbl->keys_in_use_for_query= tbl->keys_in_use_for_group_by=
+ tbl->keys_in_use_for_order_by= tbl->s->keys_in_use;
/* index hint list processing */
if (index_hints)
@@ -4265,11 +4581,11 @@ bool st_table_list::process_index_hints(TABLE *table)
key_map index_join[INDEX_HINT_FORCE + 1];
key_map index_order[INDEX_HINT_FORCE + 1];
key_map index_group[INDEX_HINT_FORCE + 1];
- index_hint *hint;
+ Index_hint *hint;
int type;
bool have_empty_use_join= FALSE, have_empty_use_order= FALSE,
have_empty_use_group= FALSE;
- List_iterator <index_hint> iter(*index_hints);
+ List_iterator <Index_hint> iter(*index_hints);
/* initialize temporary variables used to collect hints of each kind */
for (type= INDEX_HINT_IGNORE; type <= INDEX_HINT_FORCE; type++)
@@ -4309,8 +4625,8 @@ bool st_table_list::process_index_hints(TABLE *table)
Check if an index with the given name exists and get his offset in
the keys bitmask for the table
*/
- if (table->s->keynames.type_names == 0 ||
- (pos= find_type(&table->s->keynames, hint->key_name.str,
+ if (tbl->s->keynames.type_names == 0 ||
+ (pos= find_type(&tbl->s->keynames, hint->key_name.str,
hint->key_name.length, 1)) <= 0)
{
my_error(ER_KEY_DOES_NOT_EXITS, MYF(0), hint->key_name.str, alias);
@@ -4346,7 +4662,7 @@ bool st_table_list::process_index_hints(TABLE *table)
!index_order[INDEX_HINT_FORCE].is_clear_all() ||
!index_group[INDEX_HINT_FORCE].is_clear_all())
{
- table->force_index= TRUE;
+ tbl->force_index= TRUE;
index_join[INDEX_HINT_USE].merge(index_join[INDEX_HINT_FORCE]);
index_order[INDEX_HINT_USE].merge(index_order[INDEX_HINT_FORCE]);
index_group[INDEX_HINT_USE].merge(index_group[INDEX_HINT_FORCE]);
@@ -4354,23 +4670,41 @@ bool st_table_list::process_index_hints(TABLE *table)
/* apply USE INDEX */
if (!index_join[INDEX_HINT_USE].is_clear_all() || have_empty_use_join)
- table->keys_in_use_for_query.intersect(index_join[INDEX_HINT_USE]);
+ tbl->keys_in_use_for_query.intersect(index_join[INDEX_HINT_USE]);
if (!index_order[INDEX_HINT_USE].is_clear_all() || have_empty_use_order)
- table->keys_in_use_for_order_by.intersect (index_order[INDEX_HINT_USE]);
+ tbl->keys_in_use_for_order_by.intersect (index_order[INDEX_HINT_USE]);
if (!index_group[INDEX_HINT_USE].is_clear_all() || have_empty_use_group)
- table->keys_in_use_for_group_by.intersect (index_group[INDEX_HINT_USE]);
+ tbl->keys_in_use_for_group_by.intersect (index_group[INDEX_HINT_USE]);
/* apply IGNORE INDEX */
- table->keys_in_use_for_query.subtract (index_join[INDEX_HINT_IGNORE]);
- table->keys_in_use_for_order_by.subtract (index_order[INDEX_HINT_IGNORE]);
- table->keys_in_use_for_group_by.subtract (index_group[INDEX_HINT_IGNORE]);
+ tbl->keys_in_use_for_query.subtract (index_join[INDEX_HINT_IGNORE]);
+ tbl->keys_in_use_for_order_by.subtract (index_order[INDEX_HINT_IGNORE]);
+ tbl->keys_in_use_for_group_by.subtract (index_group[INDEX_HINT_IGNORE]);
}
/* make sure covering_keys don't include indexes disabled with a hint */
- table->covering_keys.intersect(table->keys_in_use_for_query);
+ tbl->covering_keys.intersect(tbl->keys_in_use_for_query);
return 0;
}
+
+size_t max_row_length(TABLE *table, const uchar *data)
+{
+ TABLE_SHARE *table_s= table->s;
+ size_t length= table_s->reclength + 2 * table_s->fields;
+ uint *const beg= table_s->blob_field;
+ uint *const end= beg + table_s->blob_fields;
+
+ for (uint *ptr= beg ; ptr != end ; ++ptr)
+ {
+ Field_blob* const blob= (Field_blob*) table->field[*ptr];
+ length+= blob->get_length((const uchar*)
+ (data + blob->offset(table->record[0]))) +
+ HA_KEY_BLOB_LENGTH;
+ }
+ return length;
+}
+
/*****************************************************************************
** Instansiate templates
*****************************************************************************/
diff --git a/sql/table.h b/sql/table.h
index 2755d0dee26..01f24e02fb6 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -25,6 +25,29 @@ class partition_info;
class COND_EQUAL;
class Security_context;
+/*************************************************************************/
+
+/**
+ View_creation_ctx -- creation context of view objects.
+*/
+
+class View_creation_ctx : public Default_object_creation_ctx,
+ public Sql_alloc
+{
+public:
+ static View_creation_ctx *create(THD *thd);
+
+ static View_creation_ctx *create(THD *thd,
+ TABLE_LIST *view);
+
+private:
+ View_creation_ctx(THD *thd)
+ : Default_object_creation_ctx(thd)
+ { }
+};
+
+/*************************************************************************/
+
/* Order clause list element */
typedef struct st_order {
@@ -62,6 +85,15 @@ enum tmp_table_type
INTERNAL_TMP_TABLE, SYSTEM_TMP_TABLE
};
+/** Event on which trigger is invoked. */
+enum trg_event_type
+{
+ TRG_EVENT_INSERT= 0,
+ TRG_EVENT_UPDATE= 1,
+ TRG_EVENT_DELETE= 2,
+ TRG_EVENT_MAX
+};
+
enum frm_type_enum
{
FRMTYPE_ERROR= 0,
@@ -73,16 +105,16 @@ enum release_type { RELEASE_NORMAL, RELEASE_WAIT_FOR_DROP };
typedef struct st_filesort_info
{
- IO_CACHE *io_cache; /* If sorted through filebyte */
- uchar **sort_keys; /* Buffer for sorting keys */
- byte *buffpek; /* Buffer for buffpek structures */
- uint buffpek_len; /* Max number of buffpeks in the buffer */
- byte *addon_buf; /* Pointer to a buffer if sorted with fields */
- uint addon_length; /* Length of the buffer */
+ IO_CACHE *io_cache; /* If sorted through filesort */
+ uchar **sort_keys; /* Buffer for sorting keys */
+ uchar *buffpek; /* Buffer for buffpek structures */
+ uint buffpek_len; /* Max number of buffpeks in the buffer */
+ uchar *addon_buf; /* Pointer to a buffer if sorted with fields */
+ size_t addon_length; /* Length of the buffer */
struct st_sort_addon_field *addon_field; /* Pointer to the fields info */
- void (*unpack)(struct st_sort_addon_field *, byte *); /* To unpack back */
- byte *record_pointers; /* If sorted in memory */
- ha_rows found_records; /* How many records in sort */
+ void (*unpack)(struct st_sort_addon_field *, uchar *); /* To unpack back */
+ uchar *record_pointers; /* If sorted in memory */
+ ha_rows found_records; /* How many records in sort */
} FILESORT_INFO;
@@ -108,6 +140,100 @@ class Field_timestamp;
class Field_blob;
class Table_triggers_list;
+/**
+ Category of table found in the table share.
+*/
+enum enum_table_category
+{
+ /**
+ Unknown value.
+ */
+ TABLE_UNKNOWN_CATEGORY=0,
+
+ /**
+ Temporary table.
+ The table is visible only in the session.
+ Therefore,
+ - FLUSH TABLES WITH READ LOCK
+ - SET GLOBAL READ_ONLY = ON
+ do not apply to this table.
+ Note that LOCK TABLE t FOR READ/WRITE
+ can be used on temporary tables.
+ Temporary tables are not part of the table cache.
+ */
+ TABLE_CATEGORY_TEMPORARY=1,
+
+ /**
+ User table.
+ These tables do honor:
+ - LOCK TABLE t FOR READ/WRITE
+ - FLUSH TABLES WITH READ LOCK
+ - SET GLOBAL READ_ONLY = ON
+ User tables are cached in the table cache.
+ */
+ TABLE_CATEGORY_USER=2,
+
+ /**
+ System table, maintained by the server.
+ These tables do honor:
+ - LOCK TABLE t FOR READ/WRITE
+ - FLUSH TABLES WITH READ LOCK
+ - SET GLOBAL READ_ONLY = ON
+ Typically, writes to system tables are performed by
+ the server implementation, not explicitly be a user.
+ System tables are cached in the table cache.
+ */
+ TABLE_CATEGORY_SYSTEM=3,
+
+ /**
+ Information schema tables.
+ These tables are an interface provided by the system
+ to inspect the system metadata.
+ These tables do *not* honor:
+ - LOCK TABLE t FOR READ/WRITE
+ - FLUSH TABLES WITH READ LOCK
+ - SET GLOBAL READ_ONLY = ON
+ as there is no point in locking explicitely
+ an INFORMATION_SCHEMA table.
+ Nothing is directly written to information schema tables.
+ Note that this value is not used currently,
+ since information schema tables are not shared,
+ but implemented as session specific temporary tables.
+ */
+ /*
+ TODO: Fixing the performance issues of I_S will lead
+ to I_S tables in the table cache, which should use
+ this table type.
+ */
+ TABLE_CATEGORY_INFORMATION=4,
+
+ /**
+ Performance schema tables.
+ These tables are an interface provided by the system
+ to inspect the system performance data.
+ These tables do *not* honor:
+ - LOCK TABLE t FOR READ/WRITE
+ - FLUSH TABLES WITH READ LOCK
+ - SET GLOBAL READ_ONLY = ON
+ as there is no point in locking explicitely
+ a PERFORMANCE_SCHEMA table.
+ An example of PERFORMANCE_SCHEMA tables are:
+ - mysql.slow_log
+ - mysql.general_log,
+ which *are* updated even when there is either
+ a GLOBAL READ LOCK or a GLOBAL READ_ONLY in effect.
+ User queries do not write directly to these tables
+ (there are exceptions for log tables).
+ The server implementation perform writes.
+ Performance tables are cached in the table cache.
+ */
+ TABLE_CATEGORY_PERFORMANCE=5
+};
+typedef enum enum_table_category TABLE_CATEGORY;
+
+TABLE_CATEGORY get_table_category(const LEX_STRING *db,
+ const LEX_STRING *name);
+
/*
This structure is shared between different table objects. There is one
instance of table share per one table in the database.
@@ -116,6 +242,10 @@ class Table_triggers_list;
typedef struct st_table_share
{
st_table_share() {} /* Remove gcc warning */
+
+ /** Category of this table. */
+ TABLE_CATEGORY table_category;
+
/* hash of field names (contains pointers to elements of field array) */
HASH name_hash; /* hash of field names */
MEM_ROOT mem_root;
@@ -137,7 +267,7 @@ typedef struct st_table_share
KEY *key_info; /* data of keys in database */
uint *blob_field; /* Index to blobs in Field arrray*/
- byte *default_values; /* row with default values */
+ uchar *default_values; /* row with default values */
LEX_STRING comment; /* Comment about table */
CHARSET_INFO *table_charset; /* Default charset of string fields */
@@ -172,9 +302,15 @@ typedef struct st_table_share
ulong timestamp_offset; /* Set to offset+1 of record */
ulong reclength; /* Recordlength */
- handlerton *db_type; /* table_type for handler */
+ plugin_ref db_plugin; /* storage engine plugin */
+ inline handlerton *db_type() const /* table_type for handler */
+ {
+ // DBUG_ASSERT(db_plugin);
+ return db_plugin ? plugin_data(db_plugin, handlerton*) : NULL;
+ }
enum row_type row_type; /* How rows are stored */
enum tmp_table_type tmp_table;
+ enum ha_choice transactional;
uint ref_count; /* How many TABLE objects uses this */
uint open_count; /* Number of tables in open list */
@@ -222,22 +358,11 @@ typedef struct st_table_share
*/
int cached_row_logging_check;
- /*
- TRUE if this is a system table like 'mysql.proc', which we want to be
- able to open and lock even when we already have some tables open and
- locked. To avoid deadlocks we have to put certain restrictions on
- locking of this table for writing. FALSE - otherwise.
- */
- bool system_table;
- /*
- This flag is set for the log tables. Used during FLUSH instances to skip
- log tables, while closing tables (since logs must be always available)
- */
- bool log_table;
#ifdef WITH_PARTITION_STORAGE_ENGINE
bool auto_partitioned;
const char *partition_info;
uint partition_info_len;
+ uint partition_info_buffer_size;
const char *part_state;
uint part_state_len;
handlerton *default_part_db_type;
@@ -296,9 +421,21 @@ typedef struct st_table_share
set_table_cache_key(key_buff, key_length);
}
+ inline bool honor_global_locks()
+ {
+ return ((table_category == TABLE_CATEGORY_USER)
+ || (table_category == TABLE_CATEGORY_SYSTEM));
+ }
+
+ inline bool require_write_privileges()
+ {
+ return (table_category == TABLE_CATEGORY_PERFORMANCE);
+ }
} TABLE_SHARE;
+extern ulong refresh_version;
+
/* Information for one open table */
enum index_hint_type
{
@@ -314,17 +451,17 @@ struct st_table {
handler *file;
#ifdef NOT_YET
struct st_table *used_next, **used_prev; /* Link to used tables */
-#endif
struct st_table *open_next, **open_prev; /* Link to open tables */
+#endif
struct st_table *next, *prev;
THD *in_use; /* Which thread uses this */
Field **field; /* Pointer to fields */
- byte *record[2]; /* Pointer to records */
- byte *write_row_record; /* Used as optimisation in
+ uchar *record[2]; /* Pointer to records */
+ uchar *write_row_record; /* Used as optimisation in
THD::write_row */
- byte *insert_values; /* used by INSERT ... UPDATE */
+ uchar *insert_values; /* used by INSERT ... UPDATE */
/*
Map of keys that can be used to retrieve all data from this table
needed by the query without reading the row.
@@ -355,7 +492,7 @@ struct st_table {
/* Table's triggers, 0 if there are no of them */
Table_triggers_list *triggers;
- struct st_table_list *pos_in_table_list;/* Element referring to this table */
+ TABLE_LIST *pos_in_table_list;/* Element referring to this table */
ORDER *group;
const char *alias; /* alias or table name */
uchar *null_flags;
@@ -422,16 +559,35 @@ struct st_table {
/*
If true, the current table row is considered to have all columns set to
NULL, including columns declared as "not null" (see maybe_null).
+ */
+ my_bool null_row;
- TODO: Each of these flags take up 8 bits. They can just as easily
+ /*
+ TODO: Each of the following flags take up 8 bits. They can just as easily
be put into one single unsigned long and instead of taking up 18
bytes, it would take up 4.
*/
- my_bool null_row;
my_bool force_index;
my_bool distinct,const_table,no_rows;
my_bool key_read, no_keyread;
- my_bool locked_by_flush;
+ /*
+ Placeholder for an open table which prevents other connections
+ from taking name-locks on this table. Typically used with
+ TABLE_SHARE::version member to take an exclusive name-lock on
+ this table name -- a name lock that not only prevents other
+ threads from opening the table, but also blocks other name
+ locks. This is achieved by:
+ - setting open_placeholder to 1 - this will block other name
+ locks, as wait_for_locked_table_name will be forced to wait,
+ see table_is_used for details.
+ - setting version to 0 - this will force other threads to close
+ the instance of this table and wait (this is the same approach
+ as used for usual name locks).
+ An exclusively name-locked table currently can have no handler
+ object associated with it (db_stat is always 0), but please do
+ not rely on that.
+ */
+ my_bool open_placeholder;
my_bool locked_by_logger;
my_bool no_replicate;
my_bool locked_by_name;
@@ -492,7 +648,13 @@ struct st_table {
read_set= &def_read_set;
write_set= &def_write_set;
}
-
+ /* Is table open or should be treated as such by name-locking? */
+ inline bool is_name_opened() { return db_stat || open_placeholder; }
+ /*
+ Is this instance of the table should be reopen or represents a name-lock?
+ */
+ inline bool needs_reopen_or_name_lock()
+ { return s->version != refresh_version; }
};
enum enum_schema_table_state
@@ -559,6 +721,10 @@ enum enum_schema_tables
#define MY_I_S_UNSIGNED 2
+#define SKIP_OPEN_TABLE 0 // do not open table
+#define OPEN_FRM_ONLY 1 // open FRM file only
+#define OPEN_FULL_TABLE 2 // open FRM,MYD, MYI files
+
typedef struct st_field_info
{
const char* field_name;
@@ -567,10 +733,11 @@ typedef struct st_field_info
int value;
uint field_flags; // Field atributes(maybe_null, signed, unsigned etc.)
const char* old_name;
+ uint open_method;
} ST_FIELD_INFO;
-struct st_table_list;
+struct TABLE_LIST;
typedef class Item COND;
typedef struct st_schema_table
@@ -578,16 +745,16 @@ typedef struct st_schema_table
const char* table_name;
ST_FIELD_INFO *fields_info;
/* Create information_schema table */
- TABLE *(*create_table) (THD *thd, struct st_table_list *table_list);
+ TABLE *(*create_table) (THD *thd, TABLE_LIST *table_list);
/* Fill table with data */
- int (*fill_table) (THD *thd, struct st_table_list *tables, COND *cond);
+ int (*fill_table) (THD *thd, TABLE_LIST *tables, COND *cond);
/* Handle fileds for old SHOW */
int (*old_format) (THD *thd, struct st_schema_table *schema_table);
- int (*process_table) (THD *thd, struct st_table_list *tables,
- TABLE *table, bool res, const char *base_name,
- const char *file_name);
+ int (*process_table) (THD *thd, TABLE_LIST *tables, TABLE *table,
+ bool res, LEX_STRING *db_name, LEX_STRING *table_name);
int idx_field1, idx_field2;
bool hidden;
+ uint i_s_requested_object; /* the object we need to open(TABLE | VIEW) */
} ST_SCHEMA_TABLE;
@@ -616,7 +783,7 @@ struct st_lex;
class select_union;
class TMP_TABLE_PARAM;
-Item *create_view_field(THD *thd, st_table_list *view, Item **field_ref,
+Item *create_view_field(THD *thd, TABLE_LIST *view, Item **field_ref,
const char *name);
struct Field_translator
@@ -637,7 +804,7 @@ class Natural_join_column: public Sql_alloc
public:
Field_translator *view_field; /* Column reference of merge view. */
Field *table_field; /* Column reference of table or temp view. */
- st_table_list *table_ref; /* Original base table/view reference. */
+ TABLE_LIST *table_ref; /* Original base table/view reference. */
/*
True if a common join column of two NATURAL/USING join operands. Notice
that when we have a hierarchy of nested NATURAL/USING joins, a column can
@@ -647,8 +814,8 @@ public:
*/
bool is_common;
public:
- Natural_join_column(Field_translator *field_param, st_table_list *tab);
- Natural_join_column(Field *field_param, st_table_list *tab);
+ Natural_join_column(Field_translator *field_param, TABLE_LIST *tab);
+ Natural_join_column(Field *field_param, TABLE_LIST *tab);
const char *name();
Item *create_item(THD *thd);
Field *field();
@@ -690,10 +857,10 @@ public:
(TABLE_LIST::join_using_fields != NULL)
*/
-class index_hint;
-typedef struct st_table_list
+class Index_hint;
+struct TABLE_LIST
{
- st_table_list() {} /* Remove gcc warning */
+ TABLE_LIST() {} /* Remove gcc warning */
/**
Prepare TABLE_LIST that consists of one table instance to use in
@@ -714,9 +881,9 @@ typedef struct st_table_list
views as leaves (unlike 'next_leaf' below). Created at parse time
in st_select_lex::add_table_to_list() -> table_list.link_in_list().
*/
- struct st_table_list *next_local;
+ TABLE_LIST *next_local;
/* link in a global list of all queries tables */
- struct st_table_list *next_global, **prev_global;
+ TABLE_LIST *next_global, **prev_global;
char *db, *alias, *table_name, *schema_table_name;
char *option; /* Used by cache index */
Item *on_expr; /* Used with outer join */
@@ -736,7 +903,7 @@ typedef struct st_table_list
'this' represents a NATURAL or USING join operation. Thus after
parsing 'this' is a NATURAL/USING join iff (natural_join != NULL).
*/
- struct st_table_list *natural_join;
+ TABLE_LIST *natural_join;
/*
True if 'this' represents a nested join that is a NATURAL JOIN.
For one of the operands of 'this', the member 'natural_join' points
@@ -760,9 +927,9 @@ typedef struct st_table_list
base tables. All of these TABLE_LIST instances contain a
materialized list of columns. The list is local to a subquery.
*/
- struct st_table_list *next_name_resolution_table;
+ TABLE_LIST *next_name_resolution_table;
/* Index names in a "... JOIN ... USE/IGNORE INDEX ..." clause. */
- List<index_hint> *index_hints;
+ List<Index_hint> *index_hints;
TABLE *table; /* opened table */
uint table_id; /* table id (from binlog) for opened table */
/*
@@ -777,7 +944,7 @@ typedef struct st_table_list
here it will be reference of first occurrence of t1 to second (as you
can see this lists can't be merged)
*/
- st_table_list *correspondent_table;
+ TABLE_LIST *correspondent_table;
st_select_lex_unit *derived; /* SELECT_LEX_UNIT of derived table */
ST_SCHEMA_TABLE *schema_table; /* Information_schema table */
st_select_lex *schema_select_lex;
@@ -798,20 +965,20 @@ typedef struct st_table_list
does not include the tables of subqueries used in the view. Is set only
for merged views.
*/
- st_table_list *merge_underlying_list;
+ TABLE_LIST *merge_underlying_list;
/*
- 0 for base tables
- in case of the view it is the list of all (not only underlying
tables but also used in subquery ones) tables of the view.
*/
- List<st_table_list> *view_tables;
+ List<TABLE_LIST> *view_tables;
/* most upper view this table belongs to */
- st_table_list *belong_to_view;
+ TABLE_LIST *belong_to_view;
/*
The view directly referencing this table
(non-zero only for merged underlying tables of a view).
*/
- st_table_list *referencing_view;
+ TABLE_LIST *referencing_view;
/*
Security context (non-zero only for tables which belong
to view with SQL SECURITY DEFINER)
@@ -828,10 +995,10 @@ typedef struct st_table_list
leaves. Created in setup_tables() -> make_leaves_list().
*/
bool allowed_show;
- st_table_list *next_leaf;
+ TABLE_LIST *next_leaf;
Item *where; /* VIEW WHERE clause condition */
Item *check_option; /* WITH CHECK OPTION condition */
- LEX_STRING query; /* text of (CRETE/SELECT) statement */
+ LEX_STRING select_stmt; /* text of (CREATE/SELECT) statement */
LEX_STRING md5; /* md5 of query text */
LEX_STRING source; /* source of CREATE VIEW */
LEX_STRING view_db; /* saved view database */
@@ -858,8 +1025,8 @@ typedef struct st_table_list
thr_lock_type lock_type;
uint outer_join; /* Which join type */
uint shared; /* Used in multi-upd */
- uint db_length;
- uint32 table_name_length;
+ size_t db_length;
+ size_t table_name_length;
bool updatable; /* VIEW/TABLE can be updated now */
bool straight; /* optimize with prev table */
bool updating; /* for replicate-do/ignore table */
@@ -868,8 +1035,8 @@ typedef struct st_table_list
table_map dep_tables; /* tables the table depends on */
table_map on_expr_dep_tables; /* tables on expression depends on */
struct st_nested_join *nested_join; /* if the element is a nested join */
- st_table_list *embedding; /* nested join containing the table */
- List<struct st_table_list> *join_list;/* join list the table belongs to */
+ TABLE_LIST *embedding; /* nested join containing the table */
+ List<TABLE_LIST> *join_list;/* join list the table belongs to */
bool cacheable_table; /* stop PS caching */
/* used in multi-upd/views privilege check */
bool table_in_first_from_clause;
@@ -880,6 +1047,8 @@ typedef struct st_table_list
bool compact_view_format; /* Use compact format for SHOW CREATE VIEW */
/* view where processed */
bool where_processed;
+ /* TRUE <=> VIEW CHECK OPTION expression has been processed */
+ bool check_option_processed;
/* FRMTYPE_ERROR if any type is acceptable */
enum frm_type_enum required_type;
handlerton *db_type; /* table_type for handler */
@@ -889,24 +1058,71 @@ typedef struct st_table_list
used for implicit LOCK TABLES only and won't be used in real statement.
*/
bool prelocking_placeholder;
+ /*
+ This TABLE_LIST object corresponds to the table to be created
+ so it is possible that it does not exist (used in CREATE TABLE
+ ... SELECT implementation).
+ */
+ bool create;
+
+ /* View creation context. */
+
+ View_creation_ctx *view_creation_ctx;
+
+ /*
+ Attributes to save/load view creation context in/from frm-file.
+
+ Ther are required only to be able to use existing parser to load
+ view-definition file. As soon as the parser parsed the file, view
+ creation context is initialized and the attributes become redundant.
+
+ These attributes MUST NOT be used for any purposes but the parsing.
+ */
+
+ LEX_STRING view_client_cs_name;
+ LEX_STRING view_connection_cl_name;
+
+ /*
+ View definition (SELECT-statement) in the UTF-form.
+ */
+
+ LEX_STRING view_body_utf8;
+
+ /* End of view definition context. */
+
+ /**
+ Indicates what triggers we need to pre-load for this TABLE_LIST
+ when opening an associated TABLE. This is filled after
+ the parsed tree is created.
+ */
+ uint8 trg_event_map;
+
+ uint i_s_requested_object;
+ bool has_db_lookup_value;
+ bool has_table_lookup_value;
+ uint table_open_method;
enum enum_schema_table_state schema_table_state;
void calc_md5(char *buffer);
void set_underlying_merge();
int view_check_option(THD *thd, bool ignore_failure);
bool setup_underlying(THD *thd);
void cleanup_items();
- bool placeholder() {return derived || view || schema_table || !table; }
+ bool placeholder()
+ {
+ return derived || view || schema_table || create && !table->db_stat ||
+ !table;
+ }
void print(THD *thd, String *str);
- bool check_single_table(st_table_list **table, table_map map,
- st_table_list *view);
+ bool check_single_table(TABLE_LIST **table, table_map map,
+ TABLE_LIST *view);
bool set_insert_values(MEM_ROOT *mem_root);
void hide_view_error(THD *thd);
- st_table_list *find_underlying_table(TABLE *table);
- st_table_list *first_leaf_for_name_resolution();
- st_table_list *last_leaf_for_name_resolution();
+ TABLE_LIST *find_underlying_table(TABLE *table);
+ TABLE_LIST *first_leaf_for_name_resolution();
+ TABLE_LIST *last_leaf_for_name_resolution();
bool is_leaf_for_name_resolution();
- inline st_table_list *top_table()
+ inline TABLE_LIST *top_table()
{ return belong_to_view ? belong_to_view : this; }
inline bool prepare_check_option(THD *thd)
{
@@ -950,7 +1166,7 @@ private:
Cleanup for re-execution in a prepared statement or a stored
procedure.
*/
-} TABLE_LIST;
+};
class Item;
@@ -1153,3 +1369,6 @@ static inline void dbug_tmp_restore_column_map(MY_BITMAP *bitmap,
tmp_restore_column_map(bitmap, old);
#endif
}
+
+size_t max_row_length(TABLE *table, const uchar *data);
+
diff --git a/sql/thr_malloc.cc b/sql/thr_malloc.cc
index 392db9224c3..ddf35002880 100644
--- a/sql/thr_malloc.cc
+++ b/sql/thr_malloc.cc
@@ -35,26 +35,25 @@ void init_sql_alloc(MEM_ROOT *mem_root, uint block_size, uint pre_alloc)
}
-gptr sql_alloc(uint Size)
+void *sql_alloc(size_t Size)
{
MEM_ROOT *root= *my_pthread_getspecific_ptr(MEM_ROOT**,THR_MALLOC);
- char *ptr= (char*) alloc_root(root,Size);
- return ptr;
+ return alloc_root(root,Size);
}
-gptr sql_calloc(uint size)
+void *sql_calloc(size_t size)
{
- gptr ptr;
+ void *ptr;
if ((ptr=sql_alloc(size)))
- bzero((char*) ptr,size);
+ bzero(ptr,size);
return ptr;
}
char *sql_strdup(const char *str)
{
- uint len=(uint) strlen(str)+1;
+ size_t len= strlen(str)+1;
char *pos;
if ((pos= (char*) sql_alloc(len)))
memcpy(pos,str,len);
@@ -62,7 +61,7 @@ char *sql_strdup(const char *str)
}
-char *sql_strmake(const char *str,uint len)
+char *sql_strmake(const char *str, size_t len)
{
char *pos;
if ((pos= (char*) sql_alloc(len+1)))
@@ -74,10 +73,10 @@ char *sql_strmake(const char *str,uint len)
}
-gptr sql_memdup(const void *ptr,uint len)
+void* sql_memdup(const void *ptr, size_t len)
{
- char *pos;
- if ((pos= (char*) sql_alloc(len)))
+ void *pos;
+ if ((pos= sql_alloc(len)))
memcpy(pos,ptr,len);
return pos;
}
@@ -87,17 +86,17 @@ void sql_element_free(void *ptr __attribute__((unused)))
-char *sql_strmake_with_convert(const char *str, uint32 arg_length,
+char *sql_strmake_with_convert(const char *str, size_t arg_length,
CHARSET_INFO *from_cs,
- uint32 max_res_length,
- CHARSET_INFO *to_cs, uint32 *result_length)
+ size_t max_res_length,
+ CHARSET_INFO *to_cs, size_t *result_length)
{
char *pos;
- uint32 new_length= to_cs->mbmaxlen*arg_length;
+ size_t new_length= to_cs->mbmaxlen*arg_length;
max_res_length--; // Reserve place for end null
set_if_smaller(new_length, max_res_length);
- if (!(pos= sql_alloc(new_length+1)))
+ if (!(pos= (char*) sql_alloc(new_length+1)))
return pos; // Error
if ((from_cs == &my_charset_bin) || (to_cs == &my_charset_bin))
diff --git a/sql/time.cc b/sql/time.cc
index c552d085f5e..a6619cf4cee 100644
--- a/sql/time.cc
+++ b/sql/time.cc
@@ -263,11 +263,11 @@ my_time_t TIME_to_timestamp(THD *thd, const MYSQL_TIME *t, my_bool *in_dst_time_
my_time_t timestamp;
*in_dst_time_gap= 0;
+ thd->time_zone_used= 1;
timestamp= thd->variables.time_zone->TIME_to_gmt_sec(t, in_dst_time_gap);
if (timestamp)
{
- thd->time_zone_used= 1;
return timestamp;
}
diff --git a/sql/tzfile.h b/sql/tzfile.h
index 1a57c0c5f69..1ff82d62329 100644
--- a/sql/tzfile.h
+++ b/sql/tzfile.h
@@ -34,14 +34,14 @@
#define TZ_MAGIC "TZif"
struct tzhead {
- char tzh_magic[4]; /* TZ_MAGIC */
- char tzh_reserved[16]; /* reserved for future use */
- char tzh_ttisgmtcnt[4]; /* coded number of trans. time flags */
- char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */
- char tzh_leapcnt[4]; /* coded number of leap seconds */
- char tzh_timecnt[4]; /* coded number of transition times */
- char tzh_typecnt[4]; /* coded number of local time types */
- char tzh_charcnt[4]; /* coded number of abbr. chars */
+ uchar tzh_magic[4]; /* TZ_MAGIC */
+ uchar tzh_reserved[16]; /* reserved for future use */
+ uchar tzh_ttisgmtcnt[4]; /* coded number of trans. time flags */
+ uchar tzh_ttisstdcnt[4]; /* coded number of trans. time flags */
+ uchar tzh_leapcnt[4]; /* coded number of leap seconds */
+ uchar tzh_timecnt[4]; /* coded number of transition times */
+ uchar tzh_typecnt[4]; /* coded number of local time types */
+ uchar tzh_charcnt[4]; /* coded number of abbr. chars */
};
/*
diff --git a/sql/tztime.cc b/sql/tztime.cc
index 08b93cfd203..9eb38e97827 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -153,7 +153,7 @@ static my_bool prepare_tz_info(TIME_ZONE_INFO *sp, MEM_ROOT *storage);
static my_bool
tz_load(const char *name, TIME_ZONE_INFO *sp, MEM_ROOT *storage)
{
- char *p;
+ uchar *p;
int read_from_file;
uint i;
FILE *file;
@@ -164,8 +164,8 @@ tz_load(const char *name, TIME_ZONE_INFO *sp, MEM_ROOT *storage)
union
{
struct tzhead tzhead;
- char buf[sizeof(struct tzhead) + sizeof(my_time_t) * TZ_MAX_TIMES +
- TZ_MAX_TIMES + sizeof(TRAN_TYPE_INFO) * TZ_MAX_TYPES +
+ uchar buf[sizeof(struct tzhead) + sizeof(my_time_t) * TZ_MAX_TIMES +
+ TZ_MAX_TIMES + sizeof(TRAN_TYPE_INFO) * TZ_MAX_TYPES +
#ifdef ABBR_ARE_USED
max(TZ_MAX_CHARS + 1, (2 * (MY_TZNAME_MAX + 1))) +
#endif
@@ -189,7 +189,7 @@ tz_load(const char *name, TIME_ZONE_INFO *sp, MEM_ROOT *storage)
sp->timecnt= int4net(u.tzhead.tzh_timecnt);
sp->typecnt= int4net(u.tzhead.tzh_typecnt);
sp->charcnt= int4net(u.tzhead.tzh_charcnt);
- p= u.tzhead.tzh_charcnt + sizeof u.tzhead.tzh_charcnt;
+ p= u.tzhead.tzh_charcnt + sizeof(u.tzhead.tzh_charcnt);
if (sp->leapcnt > TZ_MAX_LEAPS ||
sp->typecnt == 0 || sp->typecnt > TZ_MAX_TYPES ||
sp->timecnt > TZ_MAX_TIMES ||
@@ -807,19 +807,6 @@ sec_since_epoch(int year, int mon, int mday, int hour, int min ,int sec)
SECS_PER_MIN + sec;
}
-
- /*
- Works like sec_since_epoch but expects MYSQL_TIME structure as parameter.
-*/
-
-my_time_t
-sec_since_epoch_TIME(MYSQL_TIME *t)
-{
- return sec_since_epoch(t->year, t->month, t->day,
- t->hour, t->minute, t->second);
-}
-
-
/*
Converts local time in broken down MYSQL_TIME representation to my_time_t
representation.
@@ -1425,7 +1412,9 @@ Time_zone_offset::get_name() const
static Time_zone_utc tz_UTC;
static Time_zone_system tz_SYSTEM;
+static Time_zone_offset tz_OFFSET0(0);
+Time_zone *my_tz_OFFSET0= &tz_OFFSET0;
Time_zone *my_tz_UTC= &tz_UTC;
Time_zone *my_tz_SYSTEM= &tz_SYSTEM;
@@ -1489,18 +1478,21 @@ public:
they should obey C calling conventions.
*/
-extern "C" byte* my_tz_names_get_key(Tz_names_entry *entry, uint *length,
- my_bool not_used __attribute__((unused)))
+extern "C" uchar *
+my_tz_names_get_key(Tz_names_entry *entry, size_t *length,
+ my_bool not_used __attribute__((unused)))
{
*length= entry->name.length();
- return (byte*) entry->name.ptr();
+ return (uchar*) entry->name.ptr();
}
-extern "C" byte* my_offset_tzs_get_key(Time_zone_offset *entry, uint *length,
- my_bool not_used __attribute__((unused)))
+extern "C" uchar *
+my_offset_tzs_get_key(Time_zone_offset *entry,
+ size_t *length,
+ my_bool not_used __attribute__((unused)))
{
*length= sizeof(long);
- return (byte*) &entry->offset;
+ return (uchar*) &entry->offset;
}
@@ -1586,7 +1578,7 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap)
/* 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))
+ 0, 0, (hash_get_key) my_tz_names_get_key, 0, 0))
{
sql_print_error("Fatal error: OOM while initializing time zones");
goto end;
@@ -1610,7 +1602,7 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap)
}
tmp_tzname->name.set(STRING_WITH_LEN("SYSTEM"), &my_charset_latin1);
tmp_tzname->tz= my_tz_SYSTEM;
- if (my_hash_insert(&tz_names, (const byte *)tmp_tzname))
+ if (my_hash_insert(&tz_names, (const uchar *)tmp_tzname))
{
sql_print_error("Fatal error: OOM while initializing time zones");
goto end_with_cleanup;
@@ -1832,8 +1824,8 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables)
DBUG_ENTER("tz_load_from_open_tables");
/* Prepare tz_info for loading also let us make copy of time zone name */
- if (!(alloc_buff= alloc_root(&tz_storage, sizeof(TIME_ZONE_INFO) +
- tz_name->length() + 1)))
+ if (!(alloc_buff= (char*) alloc_root(&tz_storage, sizeof(TIME_ZONE_INFO) +
+ tz_name->length() + 1)))
{
sql_print_error("Out of memory while loading time zone description");
return 0;
@@ -1862,8 +1854,8 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables)
*/
(void)table->file->ha_index_init(0, 1);
- if (table->file->index_read(table->record[0], (byte*)table->field[0]->ptr,
- HA_WHOLE_KEY, HA_READ_KEY_EXACT))
+ if (table->file->index_read_map(table->record[0], table->field[0]->ptr,
+ HA_WHOLE_KEY, HA_READ_KEY_EXACT))
{
#ifdef EXTRA_DEBUG
/*
@@ -1889,8 +1881,8 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables)
table->field[0]->store((longlong) tzid, TRUE);
(void)table->file->ha_index_init(0, 1);
- if (table->file->index_read(table->record[0], (byte*)table->field[0]->ptr,
- HA_WHOLE_KEY, HA_READ_KEY_EXACT))
+ if (table->file->index_read_map(table->record[0], table->field[0]->ptr,
+ HA_WHOLE_KEY, HA_READ_KEY_EXACT))
{
sql_print_error("Can't find description of time zone '%u'", tzid);
goto end;
@@ -1916,8 +1908,8 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables)
table->field[0]->store((longlong) tzid, TRUE);
(void)table->file->ha_index_init(0, 1);
- res= table->file->index_read(table->record[0], (byte*)table->field[0]->ptr,
- (key_part_map)1, HA_READ_KEY_EXACT);
+ res= table->file->index_read_map(table->record[0], table->field[0]->ptr,
+ (key_part_map)1, HA_READ_KEY_EXACT);
while (!res)
{
ttid= (uint)table->field[1]->val_int();
@@ -1965,7 +1957,7 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables)
tz_info->typecnt= ttid + 1;
res= table->file->index_next_same(table->record[0],
- (byte*)table->field[0]->ptr, 4);
+ table->field[0]->ptr, 4);
}
if (res != HA_ERR_END_OF_FILE)
@@ -1987,8 +1979,8 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables)
table->field[0]->store((longlong) tzid, TRUE);
(void)table->file->ha_index_init(0, 1);
- res= table->file->index_read(table->record[0], (byte*)table->field[0]->ptr,
- (key_part_map)1, HA_READ_KEY_EXACT);
+ res= table->file->index_read_map(table->record[0], table->field[0]->ptr,
+ (key_part_map)1, HA_READ_KEY_EXACT);
while (!res)
{
ttime= (my_time_t)table->field[1]->val_int();
@@ -2018,7 +2010,7 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables)
tzid, (ulong) ttime, ttid));
res= table->file->index_next_same(table->record[0],
- (byte*)table->field[0]->ptr, 4);
+ table->field[0]->ptr, 4);
}
/*
@@ -2038,21 +2030,21 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables)
/*
Now we will allocate memory and init TIME_ZONE_INFO structure.
*/
- if (!(alloc_buff= alloc_root(&tz_storage,
- ALIGN_SIZE(sizeof(my_time_t) *
- tz_info->timecnt) +
- ALIGN_SIZE(tz_info->timecnt) +
+ if (!(alloc_buff= (char*) alloc_root(&tz_storage,
+ ALIGN_SIZE(sizeof(my_time_t) *
+ tz_info->timecnt) +
+ ALIGN_SIZE(tz_info->timecnt) +
#ifdef ABBR_ARE_USED
- ALIGN_SIZE(tz_info->charcnt) +
+ ALIGN_SIZE(tz_info->charcnt) +
#endif
- sizeof(TRAN_TYPE_INFO) * tz_info->typecnt)))
+ sizeof(TRAN_TYPE_INFO) *
+ tz_info->typecnt)))
{
sql_print_error("Out of memory while loading time zone description");
goto end;
}
-
- tz_info->ats= (my_time_t *)alloc_buff;
+ tz_info->ats= (my_time_t *) alloc_buff;
memcpy(tz_info->ats, ats, tz_info->timecnt * sizeof(my_time_t));
alloc_buff+= ALIGN_SIZE(sizeof(my_time_t) * tz_info->timecnt);
tz_info->types= (uchar *)alloc_buff;
@@ -2087,7 +2079,7 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables)
&(tmp_tzname->name))) ||
(tmp_tzname->name.set(tz_name_buff, tz_name->length(),
&my_charset_latin1),
- my_hash_insert(&tz_names, (const byte *)tmp_tzname)))
+ my_hash_insert(&tz_names, (const uchar *)tmp_tzname)))
{
sql_print_error("Out of memory while loading time zone");
goto end;
@@ -2244,13 +2236,13 @@ my_tz_find(THD *thd, const String *name)
{
if (!(result_tz= (Time_zone_offset *)hash_search(&offset_tzs,
- (const byte *)&offset,
+ (const uchar *)&offset,
sizeof(long))))
{
DBUG_PRINT("info", ("Creating new Time_zone_offset object"));
if (!(result_tz= new (&tz_storage) Time_zone_offset(offset)) ||
- my_hash_insert(&offset_tzs, (const byte *) result_tz))
+ my_hash_insert(&offset_tzs, (const uchar *) result_tz))
{
result_tz= 0;
sql_print_error("Fatal error: Out of memory "
@@ -2262,7 +2254,7 @@ my_tz_find(THD *thd, const String *name)
{
result_tz= 0;
if ((tmp_tzname= (Tz_names_entry *)hash_search(&tz_names,
- (const byte *)name->ptr(),
+ (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 f7cc7042d79..ddd80b88bf2 100644
--- a/sql/tztime.h
+++ b/sql/tztime.h
@@ -59,6 +59,7 @@ public:
extern Time_zone * my_tz_UTC;
extern Time_zone * my_tz_SYSTEM;
+extern Time_zone * my_tz_OFFSET0;
extern Time_zone * my_tz_find(THD *thd, const String *name);
extern my_bool my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap);
extern void my_tz_free();
diff --git a/sql/udf_example.c b/sql/udf_example.c
index d37c6505ced..6c07a929b04 100644
--- a/sql/udf_example.c
+++ b/sql/udf_example.c
@@ -130,7 +130,8 @@ typedef long long longlong;
#include <m_string.h> /* To get strmov() */
#else
/* when compiled as standalone */
-#define strmov(a,b) strcpy(a,b)
+#include <string.h>
+#define strmov(a,b) stpcpy(a,b)
#define bzero(a,b) memset(a,0,b)
#define memcpy_fixed(a,b,c) memcpy(a,b,c)
#endif
@@ -1105,4 +1106,39 @@ char * is_const(UDF_INIT *initid, UDF_ARGS *args __attribute__((unused)),
}
+my_bool check_const_len_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
+{
+ if (args->arg_count != 1)
+ {
+ strmov(message, "IS_CONST accepts only one argument");
+ return 1;
+ }
+ if (args->args[0] == 0)
+ {
+ initid->ptr= (char*)"Not constant";
+ }
+ else if(strlen(args->args[0]) == args->lengths[0])
+ {
+ initid->ptr= (char*)"Correct length";
+ }
+ else
+ {
+ initid->ptr= (char*)"Wrong length";
+ }
+ initid->max_length = 100;
+ return 0;
+}
+
+char * check_const_len(UDF_INIT *initid, UDF_ARGS *args __attribute__((unused)),
+ char *result, unsigned long *length,
+ char *is_null, char *error __attribute__((unused)))
+{
+ strmov(result, initid->ptr);
+ *length= strlen(result);
+ *is_null= 0;
+ return result;
+}
+
+
+
#endif /* HAVE_DLOPEN */
diff --git a/sql/udf_example.def b/sql/udf_example.def
index 7a87147d7b6..3d569941cc8 100644
--- a/sql/udf_example.def
+++ b/sql/udf_example.def
@@ -23,3 +23,5 @@ EXPORTS
avgcost
is_const
is_const_init
+ check_const_len
+ check_const_len_init
diff --git a/sql/uniques.cc b/sql/uniques.cc
index 9eb827f62a3..0394eee9c6d 100644
--- a/sql/uniques.cc
+++ b/sql/uniques.cc
@@ -34,7 +34,7 @@
#include "sql_sort.h"
-int unique_write_to_file(gptr key, element_count count, Unique *unique)
+int unique_write_to_file(uchar* key, element_count count, Unique *unique)
{
/*
Use unique->size (size of element stored in the tree) and not
@@ -42,11 +42,10 @@ int unique_write_to_file(gptr key, element_count count, Unique *unique)
when tree implementation chooses to store pointer to key in TREE_ELEMENT
(instead of storing the element itself there)
*/
- return my_b_write(&unique->file, (byte*) key,
- unique->size) ? 1 : 0;
+ return my_b_write(&unique->file, key, unique->size) ? 1 : 0;
}
-int unique_write_to_ptrs(gptr key, element_count count, Unique *unique)
+int unique_write_to_ptrs(uchar* key, element_count count, Unique *unique)
{
memcpy(unique->record_pointers, key, unique->size);
unique->record_pointers+=unique->size;
@@ -330,7 +329,7 @@ bool Unique::flush()
if (tree_walk(&tree, (tree_walk_action) unique_write_to_file,
(void*) this, left_root_right) ||
- insert_dynamic(&file_ptrs, (gptr) &file_ptr))
+ insert_dynamic(&file_ptrs, (uchar*) &file_ptr))
return 1;
delete_tree(&tree);
return 0;
@@ -361,24 +360,19 @@ Unique::reset()
}
/*
- The comparison function, passed to queue_init() in merge_walk() must
+ The comparison function, passed to queue_init() in merge_walk() and in
+ merge_buffers() when the latter is called from Uniques::get() must
use comparison function of Uniques::tree, but compare members of struct
BUFFPEK.
*/
-struct BUFFPEK_COMPARE_CONTEXT
-{
- qsort_cmp2 key_compare;
- void *key_compare_arg;
-};
-
C_MODE_START
-static int buffpek_compare(void *arg, byte *key_ptr1, byte *key_ptr2)
+static int buffpek_compare(void *arg, uchar *key_ptr1, uchar *key_ptr2)
{
BUFFPEK_COMPARE_CONTEXT *ctx= (BUFFPEK_COMPARE_CONTEXT *) arg;
return ctx->key_compare(ctx->key_compare_arg,
- *((byte **) key_ptr1), *((byte **)key_ptr2));
+ *((uchar **) key_ptr1), *((uchar **)key_ptr2));
}
C_MODE_END
@@ -455,7 +449,7 @@ static bool merge_walk(uchar *merge_buffer, ulong merge_buffer_size,
if (bytes_read == (uint) (-1))
goto end;
DBUG_ASSERT(bytes_read);
- queue_insert(&queue, (byte *) top);
+ queue_insert(&queue, (uchar *) top);
}
top= (BUFFPEK *) queue_top(&queue);
while (queue.elements > 1)
@@ -586,7 +580,7 @@ bool Unique::get(TABLE *table)
if (my_b_tell(&file) == 0)
{
/* Whole tree is in memory; Don't use disk if you don't need to */
- if ((record_pointers=table->sort.record_pointers= (byte*)
+ if ((record_pointers=table->sort.record_pointers= (uchar*)
my_malloc(size * tree.elements_in_tree, MYF(0))))
{
(void) tree_walk(&tree, (tree_walk_action) unique_write_to_ptrs,
@@ -630,6 +624,10 @@ bool Unique::get(TABLE *table)
sort_param.unique_buff= sort_buffer+(sort_param.keys*
sort_param.sort_length);
+ sort_param.compare= (qsort2_cmp) buffpek_compare;
+ sort_param.cmp_context.key_compare= tree.compare;
+ sort_param.cmp_context.key_compare_arg= tree.custom_arg;
+
/* Merge the buffers to one file, removing duplicates */
if (merge_many_buff(&sort_param,sort_buffer,file_ptr,&maxbuffer,&file))
goto err;
@@ -641,7 +639,7 @@ bool Unique::get(TABLE *table)
goto err;
error=0;
err:
- x_free((gptr) sort_buffer);
+ x_free(sort_buffer);
if (flush_io_cache(outfile))
error=1;
diff --git a/sql/unireg.cc b/sql/unireg.cc
index a69a9be6a43..f9e8e54439a 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -29,21 +29,21 @@
#define FCOMP 17 /* Bytes for a packed field */
-static uchar * pack_screens(List<create_field> &create_fields,
+static uchar * pack_screens(List<Create_field> &create_fields,
uint *info_length, uint *screens, bool small_file);
static uint pack_keys(uchar *keybuff,uint key_count, KEY *key_info,
ulong data_offset);
static bool pack_header(uchar *forminfo,enum legacy_db_type table_type,
- List<create_field> &create_fields,
+ List<Create_field> &create_fields,
uint info_length, uint screens, uint table_options,
ulong data_offset, handler *file);
-static uint get_interval_id(uint *int_count,List<create_field> &create_fields,
- create_field *last_field);
-static bool pack_fields(File file, List<create_field> &create_fields,
+static uint get_interval_id(uint *int_count,List<Create_field> &create_fields,
+ Create_field *last_field);
+static bool pack_fields(File file, List<Create_field> &create_fields,
ulong data_offset);
static bool make_empty_rec(THD *thd, int file, enum legacy_db_type table_type,
uint table_options,
- List<create_field> &create_fields,
+ List<Create_field> &create_fields,
uint reclength, ulong data_offset,
handler *handler);
@@ -70,7 +70,7 @@ static bool make_empty_rec(THD *thd, int file, enum legacy_db_type table_type,
bool mysql_create_frm(THD *thd, const char *file_name,
const char *db, const char *table,
HA_CREATE_INFO *create_info,
- List<create_field> &create_fields,
+ List<Create_field> &create_fields,
uint keys, KEY *key_info,
handler *db_file)
{
@@ -104,7 +104,7 @@ bool mysql_create_frm(THD *thd, const char *file_name,
screens, create_info->table_options,
data_offset, db_file))
{
- my_free((gptr) screen_buff,MYF(0));
+ my_free(screen_buff, MYF(0));
if (thd->net.last_errno != ER_TOO_MANY_FIELDS)
DBUG_RETURN(1);
@@ -116,7 +116,7 @@ bool mysql_create_frm(THD *thd, const char *file_name,
create_fields,info_length,
screens, create_info->table_options, data_offset, db_file))
{
- my_free((gptr) screen_buff,MYF(0));
+ my_free(screen_buff, MYF(0));
DBUG_RETURN(1);
}
}
@@ -152,7 +152,7 @@ bool mysql_create_frm(THD *thd, const char *file_name,
if ((file=create_frm(thd, file_name, db, table, reclength, fileinfo,
create_info, keys)) < 0)
{
- my_free((gptr) screen_buff,MYF(0));
+ my_free(screen_buff, MYF(0));
DBUG_RETURN(1);
}
@@ -200,8 +200,8 @@ bool mysql_create_frm(THD *thd, const char *file_name,
#endif
int2store(fileinfo+59,db_file->extra_rec_buf_length());
- if (my_pwrite(file,(byte*) fileinfo,64,0L,MYF_RW) ||
- my_pwrite(file,(byte*) keybuff,key_info_length,
+ if (my_pwrite(file, fileinfo, 64, 0L, MYF_RW) ||
+ my_pwrite(file, keybuff, key_info_length,
(ulong) uint2korr(fileinfo+6),MYF_RW))
goto err;
VOID(my_seek(file,
@@ -213,14 +213,14 @@ bool mysql_create_frm(THD *thd, const char *file_name,
goto err;
int2store(buff, create_info->connect_string.length);
- if (my_write(file, (const byte*)buff, 2, MYF(MY_NABP)) ||
- my_write(file, (const byte*)create_info->connect_string.str,
+ if (my_write(file, (const uchar*)buff, 2, MYF(MY_NABP)) ||
+ my_write(file, (const uchar*)create_info->connect_string.str,
create_info->connect_string.length, MYF(MY_NABP)))
goto err;
int2store(buff, str_db_type.length);
- if (my_write(file, (const byte*)buff, 2, MYF(MY_NABP)) ||
- my_write(file, (const byte*)str_db_type.str,
+ if (my_write(file, (const uchar*)buff, 2, MYF(MY_NABP)) ||
+ my_write(file, (const uchar*)str_db_type.str,
str_db_type.length, MYF(MY_NABP)))
goto err;
@@ -229,32 +229,32 @@ bool mysql_create_frm(THD *thd, const char *file_name,
{
char auto_partitioned= part_info->is_auto_partitioned ? 1 : 0;
int4store(buff, part_info->part_info_len);
- if (my_write(file, (const byte*)buff, 4, MYF_RW) ||
- my_write(file, (const byte*)part_info->part_info_string,
+ if (my_write(file, (const uchar*)buff, 4, MYF_RW) ||
+ my_write(file, (const uchar*)part_info->part_info_string,
part_info->part_info_len + 1, MYF_RW) ||
- my_write(file, (const byte*)&auto_partitioned, 1, MYF_RW))
+ my_write(file, (const uchar*)&auto_partitioned, 1, MYF_RW))
goto err;
}
else
#endif
{
- bzero(buff, 6);
- if (my_write(file, (byte*) buff, 6, MYF_RW))
+ bzero((uchar*) buff, 6);
+ if (my_write(file, (uchar*) buff, 6, MYF_RW))
goto err;
}
for (i= 0; i < keys; i++)
{
if (key_info[i].parser_name)
{
- if (my_write(file, (const byte*)key_info[i].parser_name->str,
+ if (my_write(file, (const uchar*)key_info[i].parser_name->str,
key_info[i].parser_name->length + 1, MYF(MY_NABP)))
goto err;
}
}
VOID(my_seek(file,filepos,MY_SEEK_SET,MYF(0)));
- if (my_write(file,(byte*) forminfo,288,MYF_RW) ||
- my_write(file,(byte*) screen_buff,info_length,MYF_RW) ||
+ if (my_write(file, forminfo, 288, MYF_RW) ||
+ my_write(file, screen_buff, info_length, MYF_RW) ||
pack_fields(file, create_fields, data_offset))
goto err;
@@ -267,7 +267,7 @@ bool mysql_create_frm(THD *thd, const char *file_name,
goto err;
uint read_length=uint2korr(forminfo)-256;
VOID(my_seek(file,filepos+256,MY_SEEK_SET,MYF(0)));
- if (read_string(file,(gptr*) &disk_buff,read_length))
+ if (read_string(file,(uchar**) &disk_buff,read_length))
goto err;
crypted->encode(disk_buff,read_length);
delete crypted;
@@ -280,8 +280,8 @@ bool mysql_create_frm(THD *thd, const char *file_name,
}
#endif
- my_free((gptr) screen_buff,MYF(0));
- my_free((gptr) keybuff, MYF(0));
+ my_free(screen_buff,MYF(0));
+ my_free(keybuff, MYF(0));
if (opt_sync_frm && !(create_info->options & HA_LEX_CREATE_TMP_TABLE) &&
my_sync(file, MYF(MY_WME)))
@@ -294,8 +294,8 @@ bool mysql_create_frm(THD *thd, const char *file_name,
Restore all UCS2 intervals.
HEX representation of them is not needed anymore.
*/
- List_iterator<create_field> it(create_fields);
- create_field *field;
+ List_iterator<Create_field> it(create_fields);
+ Create_field *field;
while ((field=it++))
{
if (field->save_interval)
@@ -308,8 +308,8 @@ bool mysql_create_frm(THD *thd, const char *file_name,
DBUG_RETURN(0);
err:
- my_free((gptr) screen_buff,MYF(0));
- my_free((gptr) keybuff, MYF(0));
+ my_free(screen_buff, MYF(0));
+ my_free(keybuff, MYF(0));
err2:
VOID(my_close(file,MYF(MY_WME)));
err3:
@@ -341,7 +341,7 @@ err3:
int rea_create_table(THD *thd, const char *path,
const char *db, const char *table_name,
HA_CREATE_INFO *create_info,
- List<create_field> &create_fields,
+ List<Create_field> &create_fields,
uint keys, KEY *key_info, handler *file)
{
DBUG_ENTER("rea_create_table");
@@ -355,6 +355,8 @@ int rea_create_table(THD *thd, const char *path,
// Make sure mysql_create_frm din't remove extension
DBUG_ASSERT(*fn_rext(frm_name));
+ if (thd->variables.keep_files_on_create)
+ create_info->options|= HA_CREATE_KEEP_FILES;
if (file->create_handler_files(path, NULL, CHF_CREATE_FLAG, create_info))
goto err_handler;
if (!create_info->frm_only && ha_create_table(thd, path, db, table_name,
@@ -371,7 +373,7 @@ err_handler:
/* Pack screens to a screen for save in a form-file */
-static uchar *pack_screens(List<create_field> &create_fields,
+static uchar *pack_screens(List<Create_field> &create_fields,
uint *info_length, uint *screens,
bool small_file)
{
@@ -380,7 +382,7 @@ static uchar *pack_screens(List<create_field> &create_fields,
uint length,cols;
uchar *info,*pos,*start_screen;
uint fields=create_fields.elements;
- List_iterator<create_field> it(create_fields);
+ List_iterator<Create_field> it(create_fields);
DBUG_ENTER("pack_screens");
start_row=4; end_row=22; cols=80; fields_on_screen=end_row+1-start_row;
@@ -388,7 +390,7 @@ static uchar *pack_screens(List<create_field> &create_fields,
*screens=(fields-1)/fields_on_screen+1;
length= (*screens) * (SC_INFO_LENGTH+ (cols>> 1)+4);
- create_field *field;
+ Create_field *field;
while ((field=it++))
length+=(uint) strlen(field->field_name)+1+TE_INFO_LENGTH+cols/2;
@@ -401,7 +403,7 @@ static uchar *pack_screens(List<create_field> &create_fields,
it.rewind();
for (i=0 ; i < fields ; i++)
{
- create_field *cfield=it++;
+ Create_field *cfield=it++;
if (row++ == end_row)
{
if (i)
@@ -417,7 +419,7 @@ static uchar *pack_screens(List<create_field> &create_fields,
pos[0]= (uchar) start_row-2; /* Header string */
pos[1]= (uchar) (cols >> 2);
pos[2]= (uchar) (cols >> 1) +1;
- strfill((my_string) pos+3,(uint) (cols >> 1),' ');
+ strfill((char *) pos+3,(uint) (cols >> 1),' ');
pos+=(cols >> 1)+4;
}
length=(uint) strlen(cfield->field_name);
@@ -521,7 +523,7 @@ static uint pack_keys(uchar *keybuff, uint key_count, KEY *keyinfo,
/* Make formheader */
static bool pack_header(uchar *forminfo, enum legacy_db_type table_type,
- List<create_field> &create_fields,
+ List<Create_field> &create_fields,
uint info_length, uint screens, uint table_options,
ulong data_offset, handler *file)
{
@@ -544,8 +546,8 @@ static bool pack_header(uchar *forminfo, enum legacy_db_type table_type,
/* Check fields */
- List_iterator<create_field> it(create_fields);
- create_field *field;
+ List_iterator<Create_field> it(create_fields);
+ Create_field *field;
while ((field=it++))
{
uint tmp_len= system_charset_info->cset->charpos(system_charset_info,
@@ -626,7 +628,8 @@ static bool pack_header(uchar *forminfo, enum legacy_db_type table_type,
length= field->save_interval->type_lengths[pos];
hex_length= length * 2;
field->interval->type_lengths[pos]= hex_length;
- field->interval->type_names[pos]= dst= sql_alloc(hex_length + 1);
+ field->interval->type_names[pos]= dst= (char*) sql_alloc(hex_length +
+ 1);
octet2hex(dst, src, length);
}
}
@@ -686,11 +689,11 @@ static bool pack_header(uchar *forminfo, enum legacy_db_type table_type,
/* get each unique interval each own id */
-static uint get_interval_id(uint *int_count,List<create_field> &create_fields,
- create_field *last_field)
+static uint get_interval_id(uint *int_count,List<Create_field> &create_fields,
+ Create_field *last_field)
{
- List_iterator<create_field> it(create_fields);
- create_field *field;
+ List_iterator<Create_field> it(create_fields);
+ Create_field *field;
TYPELIB *interval=last_field->interval;
while ((field=it++) != last_field)
@@ -714,18 +717,18 @@ static uint get_interval_id(uint *int_count,List<create_field> &create_fields,
/* Save fields, fieldnames and intervals */
-static bool pack_fields(File file, List<create_field> &create_fields,
+static bool pack_fields(File file, List<Create_field> &create_fields,
ulong data_offset)
{
reg2 uint i;
uint int_count, comment_length=0;
uchar buff[MAX_FIELD_WIDTH];
- create_field *field;
+ Create_field *field;
DBUG_ENTER("pack_fields");
/* Write field info */
- List_iterator<create_field> it(create_fields);
+ List_iterator<Create_field> it(create_fields);
int_count=0;
while ((field=it++))
@@ -756,13 +759,13 @@ static bool pack_fields(File file, List<create_field> &create_fields,
int2store(buff+15, field->comment.length);
comment_length+= field->comment.length;
set_if_bigger(int_count,field->interval_id);
- if (my_write(file,(byte*) buff,FCOMP,MYF_RW))
+ if (my_write(file, buff, FCOMP, MYF_RW))
DBUG_RETURN(1);
}
/* Write fieldnames */
buff[0]=(uchar) NAMES_SEP_CHAR;
- if (my_write(file,(byte*) buff,1,MYF_RW))
+ if (my_write(file, buff, 1, MYF_RW))
DBUG_RETURN(1);
i=0;
it.rewind();
@@ -772,7 +775,7 @@ static bool pack_fields(File file, List<create_field> &create_fields,
*pos++=NAMES_SEP_CHAR;
if (i == create_fields.elements-1)
*pos++=0;
- if (my_write(file,(byte*) buff,(uint) (pos-(char*) buff),MYF_RW))
+ if (my_write(file, buff, (size_t) (pos-(char*) buff),MYF_RW))
DBUG_RETURN(1);
i++;
}
@@ -832,7 +835,7 @@ static bool pack_fields(File file, List<create_field> &create_fields,
tmp.append('\0'); // End of intervall
}
}
- if (my_write(file,(byte*) tmp.ptr(),tmp.length(),MYF_RW))
+ if (my_write(file,(uchar*) tmp.ptr(),tmp.length(),MYF_RW))
DBUG_RETURN(1);
}
if (comment_length)
@@ -842,7 +845,7 @@ static bool pack_fields(File file, List<create_field> &create_fields,
while ((field=it++))
{
if (field->comment.length)
- if (my_write(file, (byte*) field->comment.str, field->comment.length,
+ if (my_write(file, (uchar*) field->comment.str, field->comment.length,
MYF_RW))
DBUG_RETURN(1);
}
@@ -855,7 +858,7 @@ static bool pack_fields(File file, List<create_field> &create_fields,
static bool make_empty_rec(THD *thd, File file,enum legacy_db_type table_type,
uint table_options,
- List<create_field> &create_fields,
+ List<Create_field> &create_fields,
uint reclength,
ulong data_offset,
handler *handler)
@@ -866,7 +869,7 @@ static bool make_empty_rec(THD *thd, File file,enum legacy_db_type table_type,
uchar *buff,*null_pos;
TABLE table;
TABLE_SHARE share;
- create_field *field;
+ Create_field *field;
enum_check_fields old_count_cuted_fields= thd->count_cuted_fields;
DBUG_ENTER("make_empty_rec");
@@ -875,7 +878,7 @@ static bool make_empty_rec(THD *thd, File file,enum legacy_db_type table_type,
bzero((char*) &share, sizeof(share));
table.s= &share;
- if (!(buff=(uchar*) my_malloc((uint) reclength,MYF(MY_WME | MY_ZEROFILL))))
+ if (!(buff=(uchar*) my_malloc((size_t) reclength,MYF(MY_WME | MY_ZEROFILL))))
{
DBUG_RETURN(1);
}
@@ -892,7 +895,7 @@ static bool make_empty_rec(THD *thd, File file,enum legacy_db_type table_type,
}
null_pos= buff;
- List_iterator<create_field> it(create_fields);
+ List_iterator<Create_field> it(create_fields);
thd->count_cuted_fields= CHECK_FIELD_WARN; // To find wrong default values
while ((field=it++))
{
@@ -900,7 +903,7 @@ static bool make_empty_rec(THD *thd, File file,enum legacy_db_type table_type,
regfield don't have to be deleted as it's allocated with sql_alloc()
*/
Field *regfield= make_field(&share,
- (char*) buff+field->offset + data_offset,
+ buff+field->offset + data_offset,
field->length,
null_pos + null_count / 8,
null_count & 7,
@@ -968,10 +971,10 @@ static bool make_empty_rec(THD *thd, File file,enum legacy_db_type table_type,
if (null_count & 7)
*(null_pos + null_count / 8)|= ~(((uchar) 1 << (null_count & 7)) - 1);
- error=(int) my_write(file,(byte*) buff, (uint) reclength,MYF_RW);
+ error= my_write(file, buff, (size_t) reclength,MYF_RW) != 0;
err:
- my_free((gptr) buff,MYF(MY_FAE));
+ my_free(buff, MYF(MY_FAE));
thd->count_cuted_fields= old_count_cuted_fields;
DBUG_RETURN(error);
} /* make_empty_rec */
diff --git a/sql/unireg.h b/sql/unireg.h
index d67fa372083..f0b4a88c7f8 100644
--- a/sql/unireg.h
+++ b/sql/unireg.h
@@ -74,6 +74,7 @@
#define MAX_TIME_WIDTH 23 /* -DDDDDD HH:MM:SS.###### */
#define MAX_DATETIME_FULL_WIDTH 29 /* YYYY-MM-DD HH:MM:SS.###### AM */
#define MAX_DATETIME_WIDTH 19 /* YYYY-MM-DD HH:MM:SS */
+#define MAX_DATETIME_COMPRESSED_WIDTH 14 /* YYYYMMDDHHMMSS */
#define MAX_TABLES (sizeof(table_map)*8-3) /* Max tables in join */
#define PARAM_TABLE_BIT (((table_map) 1) << (sizeof(table_map)*8-3))
@@ -84,6 +85,8 @@
#define MAX_FIELDS 4096 /* Limit in the .frm file */
#define MAX_PARTITIONS 1024
+#define MAX_SELECT_NESTING (sizeof(nesting_map)*8-1)
+
#define MAX_SORT_MEMORY (2048*1024-MALLOC_OVERHEAD)
#define MIN_SORT_MEMORY (32*1024-MALLOC_OVERHEAD)
@@ -123,7 +126,7 @@
#define SPECIAL_NO_HOST_CACHE 512 /* Don't cache hosts */
#define SPECIAL_SHORT_LOG_FORMAT 1024
#define SPECIAL_SAFE_MODE 2048
-#define SPECIAL_LOG_QUERIES_NOT_USING_INDEXES 4096 /* Log q not using indexes */
+#define SPECIAL_LOG_QUERIES_NOT_USING_INDEXES 4096 /* Obsolete */
/* Extern defines */
#define store_record(A,B) bmove_align((A)->B,(A)->record[0],(size_t) (A)->s->reclength)
@@ -152,6 +155,40 @@
#define OPEN_VIEW 8192 /* Allow open on view */
#define OPEN_VIEW_NO_PARSE 16384 /* Open frm only if it's a view,
but do not parse view itself */
+/*
+ This flag is used in function get_all_tables() which fills
+ I_S tables with data which are retrieved from frm files and storage engine
+ The flag means that we need to open FRM file only to get necessary data.
+*/
+#define OPEN_FRM_FILE_ONLY 32768
+/*
+ This flag is used in function get_all_tables() which fills
+ I_S tables with data which are retrieved from frm files and storage engine
+ The flag means that we need to process tables only to get necessary data.
+ Views are not processed.
+*/
+#define OPEN_TABLE_ONLY OPEN_FRM_FILE_ONLY*2
+/*
+ This flag is used in function get_all_tables() which fills
+ I_S tables with data which are retrieved from frm files and storage engine
+ The flag means that we need to process views only to get necessary data.
+ Tables are not processed.
+*/
+#define OPEN_VIEW_ONLY OPEN_TABLE_ONLY*2
+/*
+ This flag is used in function get_all_tables() which fills
+ I_S tables with data which are retrieved from frm files and storage engine.
+ The flag means that we need to open a view using
+ open_normal_and_derived_tables() function.
+*/
+#define OPEN_VIEW_FULL OPEN_VIEW_ONLY*2
+/*
+ This flag is used in function get_all_tables() which fills
+ I_S tables with data which are retrieved from frm files and storage engine.
+ The flag means that I_S table uses optimization algorithm.
+*/
+#define OPTIMIZE_I_S_TABLE OPEN_VIEW_FULL*2
+
#define SC_INFO_LENGTH 4 /* Form format constant */
#define TE_INFO_LENGTH 3
#define MTYP_NOEMPTY_BIT 128
diff --git a/storage/archive/CMakeLists.txt b/storage/archive/CMakeLists.txt
index 09227a6cc2d..9a1cfe081b6 100644
--- a/storage/archive/CMakeLists.txt
+++ b/storage/archive/CMakeLists.txt
@@ -20,5 +20,9 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib
${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/extra/yassl/include)
-ADD_LIBRARY(archive azio.c ha_archive.cc ha_archive.h)
-TARGET_LINK_LIBRARIES(archive zlib mysys dbug strings)
+
+SET(ARCHIVE_SOURCES azio.c ha_archive.cc ha_archive.h)
+
+IF(NOT SOURCE_SUBLIBS)
+ ADD_LIBRARY(archive ${ARCHIVE_SOURCES})
+ENDIF(NOT SOURCE_SUBLIBS)
diff --git a/storage/archive/archive_reader.c b/storage/archive/archive_reader.c
index 14018217dea..bfc01073161 100644
--- a/storage/archive/archive_reader.c
+++ b/storage/archive/archive_reader.c
@@ -110,7 +110,7 @@ int main(int argc, char *argv[])
if (opt_check)
{
- byte size_buffer[ARCHIVE_ROW_HEADER_SIZE];
+ uchar size_buffer[ARCHIVE_ROW_HEADER_SIZE];
int error;
unsigned int x;
unsigned int read;
@@ -118,7 +118,7 @@ int main(int argc, char *argv[])
unsigned long long row_count= 0;
char buffer;
- while ((read= azread(&reader_handle, (byte *)size_buffer,
+ while ((read= azread(&reader_handle, (uchar *)size_buffer,
ARCHIVE_ROW_HEADER_SIZE, &error)))
{
if (error == Z_STREAM_ERROR || (read && read < ARCHIVE_ROW_HEADER_SIZE))
@@ -171,7 +171,7 @@ int main(int argc, char *argv[])
if (opt_backup)
{
- byte size_buffer[ARCHIVE_ROW_HEADER_SIZE];
+ uchar size_buffer[ARCHIVE_ROW_HEADER_SIZE];
int error;
unsigned int read;
unsigned int row_len;
@@ -213,7 +213,7 @@ int main(int argc, char *argv[])
my_free(ptr, MYF(0));
}
- while ((read= azread(&reader_handle, (byte *)size_buffer,
+ while ((read= azread(&reader_handle, (uchar *)size_buffer,
ARCHIVE_ROW_HEADER_SIZE, &error)))
{
if (error == Z_STREAM_ERROR || (read && read < ARCHIVE_ROW_HEADER_SIZE))
@@ -263,7 +263,7 @@ int main(int argc, char *argv[])
frm_file= my_open(argv[1], O_CREAT|O_RDWR|O_BINARY, MYF(0));
ptr= (char *)my_malloc(sizeof(char) * reader_handle.frm_length, MYF(0));
azread_frm(&reader_handle, ptr);
- my_write(frm_file, ptr, reader_handle.frm_length, MYF(0));
+ my_write(frm_file, (uchar*) ptr, reader_handle.frm_length, MYF(0));
my_close(frm_file, MYF(0));
my_free(ptr, MYF(0));
}
@@ -355,15 +355,15 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"set-auto-increment", 'A',
"Force auto_increment to start at this or higher value. If no value is given, then sets the next auto_increment value to the highest used value for the auto key + 1.",
- (gptr*) &new_auto_increment,
- (gptr*) &new_auto_increment,
+ (uchar**) &new_auto_increment,
+ (uchar**) &new_auto_increment,
0, GET_ULL, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"silent", 's',
"Only print errors. One can use two -s to make archive_reader very silent.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"tmpdir", 't',
"Path for temporary files.",
- (gptr*) &opt_tmpdir,
+ (uchar**) &opt_tmpdir,
0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V',
"Print version and exit.",
diff --git a/storage/archive/azio.c b/storage/archive/azio.c
index 6b01d9c3c88..c04749444cb 100644
--- a/storage/archive/azio.c
+++ b/storage/archive/azio.c
@@ -19,7 +19,7 @@
static int const gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */
static int const az_magic[3] = {0xfe, 0x03, 0x01}; /* az magic header */
-/* gzip flag byte */
+/* gzip flag uchar */
#define ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */
#define HEAD_CRC 0x02 /* bit 1 set: header CRC present */
#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */
@@ -139,8 +139,8 @@ int az_open (azio_stream *s, const char *path, int Flags, File fd)
}
else if (s->mode == 'w')
{
- unsigned char buffer[AZHEADER_SIZE + AZMETA_BUFFER_SIZE];
- my_pread(s->file, (byte*) buffer, AZHEADER_SIZE + AZMETA_BUFFER_SIZE, 0,
+ uchar buffer[AZHEADER_SIZE + AZMETA_BUFFER_SIZE];
+ my_pread(s->file, buffer, AZHEADER_SIZE + AZMETA_BUFFER_SIZE, 0,
MYF(0));
read_header(s, buffer); /* skip the .az header */
my_seek(s->file, 0, MY_SEEK_END, MYF(0));
@@ -190,7 +190,8 @@ void write_header(azio_stream *s)
*(ptr + AZ_DIRTY_POS)= (unsigned char)s->dirty; /* Start of Data Block Index Block */
/* Always begin at the begining, and end there as well */
- my_pwrite(s->file, buffer, AZHEADER_SIZE + AZMETA_BUFFER_SIZE, 0, MYF(0));
+ my_pwrite(s->file, (uchar*) buffer, AZHEADER_SIZE + AZMETA_BUFFER_SIZE, 0,
+ MYF(0));
}
/* ===========================================================================
@@ -224,7 +225,7 @@ int get_byte(s)
if (s->stream.avail_in == 0)
{
errno = 0;
- s->stream.avail_in = my_read(s->file, (byte *)s->inbuf, AZ_BUFSIZE_READ, MYF(0));
+ s->stream.avail_in = my_read(s->file, (uchar *)s->inbuf, AZ_BUFSIZE_READ, MYF(0));
if (s->stream.avail_in == 0)
{
s->z_eof = 1;
@@ -248,8 +249,8 @@ int get_byte(s)
*/
void check_header(azio_stream *s)
{
- int method; /* method byte */
- int flags; /* flags byte */
+ int method; /* method uchar */
+ int flags; /* flags uchar */
uInt len;
int c;
@@ -260,7 +261,7 @@ void check_header(azio_stream *s)
if (len < 2) {
if (len) s->inbuf[0] = s->stream.next_in[0];
errno = 0;
- len = (uInt)my_read(s->file, (byte *)s->inbuf + len, AZ_BUFSIZE_READ >> len, MYF(0));
+ len = (uInt)my_read(s->file, (uchar *)s->inbuf + len, AZ_BUFSIZE_READ >> len, MYF(0));
if (len == 0) s->z_err = Z_ERRNO;
s->stream.avail_in += len;
s->stream.next_in = s->inbuf;
@@ -442,7 +443,7 @@ unsigned int ZEXPORT azread ( azio_stream *s, voidp buf, unsigned int len, int *
if (s->stream.avail_out > 0)
{
s->stream.avail_out -=
- (uInt)my_read(s->file, (byte *)next_out, s->stream.avail_out, MYF(0));
+ (uInt)my_read(s->file, (uchar *)next_out, s->stream.avail_out, MYF(0));
}
len -= s->stream.avail_out;
s->in += len;
@@ -455,7 +456,7 @@ unsigned int ZEXPORT azread ( azio_stream *s, voidp buf, unsigned int len, int *
if (s->stream.avail_in == 0 && !s->z_eof) {
errno = 0;
- s->stream.avail_in = (uInt)my_read(s->file, (byte *)s->inbuf, AZ_BUFSIZE_READ, MYF(0));
+ s->stream.avail_in = (uInt)my_read(s->file, (uchar *)s->inbuf, AZ_BUFSIZE_READ, MYF(0));
if (s->stream.avail_in == 0)
{
s->z_eof = 1;
@@ -509,7 +510,7 @@ unsigned int ZEXPORT azread ( azio_stream *s, voidp buf, unsigned int len, int *
Writes the given number of uncompressed bytes into the compressed file.
azwrite returns the number of bytes actually written (0 in case of error).
*/
-unsigned int azwrite (azio_stream *s, voidpc buf, unsigned int len)
+unsigned int azwrite (azio_stream *s, const voidp buf, unsigned int len)
{
s->stream.next_in = (Bytef*)buf;
s->stream.avail_in = len;
@@ -522,7 +523,7 @@ unsigned int azwrite (azio_stream *s, voidpc buf, unsigned int len)
{
s->stream.next_out = s->outbuf;
- if (my_write(s->file, (byte *)s->outbuf, AZ_BUFSIZE_WRITE,
+ if (my_write(s->file, (uchar *)s->outbuf, AZ_BUFSIZE_WRITE,
MYF(0)) != AZ_BUFSIZE_WRITE)
{
s->z_err = Z_ERRNO;
@@ -557,6 +558,7 @@ int do_flush (azio_stream *s, int flush)
{
uInt len;
int done = 0;
+ my_off_t afterwrite_pos;
if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
@@ -569,7 +571,7 @@ int do_flush (azio_stream *s, int flush)
if (len != 0)
{
s->check_point= my_tell(s->file, MYF(0));
- if ((uInt)my_write(s->file, (byte *)s->outbuf, len, MYF(0)) != len)
+ if ((uInt)my_write(s->file, (uchar *)s->outbuf, len, MYF(0)) != len)
{
s->z_err = Z_ERRNO;
return Z_ERRNO;
@@ -597,7 +599,10 @@ int do_flush (azio_stream *s, int flush)
s->dirty= AZ_STATE_CLEAN; /* Mark it clean, we should be good now */
else
s->dirty= AZ_STATE_SAVED; /* Mark it clean, we should be good now */
+
+ afterwrite_pos= my_tell(s->file, MYF(0));
write_header(s);
+ my_seek(s->file, afterwrite_pos, SEEK_SET, MYF(0));
return s->z_err == Z_STREAM_END ? Z_OK : s->z_err;
}
@@ -611,7 +616,7 @@ int ZEXPORT azflush (s, flush)
if (s->mode == 'r')
{
unsigned char buffer[AZHEADER_SIZE + AZMETA_BUFFER_SIZE];
- my_pread(s->file, (byte*) buffer, AZHEADER_SIZE + AZMETA_BUFFER_SIZE, 0,
+ my_pread(s->file, (uchar*) buffer, AZHEADER_SIZE + AZMETA_BUFFER_SIZE, 0,
MYF(0));
read_header(s, buffer); /* skip the .az header */
@@ -748,7 +753,7 @@ my_off_t ZEXPORT aztell (file)
void putLong (File file, uLong x)
{
int n;
- byte buffer[1];
+ uchar buffer[1];
for (n = 0; n < 4; n++)
{
@@ -817,7 +822,7 @@ int azwrite_frm(azio_stream *s, char *blob, unsigned int length)
s->frm_length= length;
s->start+= length;
- my_pwrite(s->file, blob, s->frm_length, s->frm_start_pos, MYF(0));
+ my_pwrite(s->file, (uchar*) blob, s->frm_length, s->frm_start_pos, MYF(0));
write_header(s);
my_seek(s->file, 0, MY_SEEK_END, MYF(0));
@@ -827,7 +832,7 @@ int azwrite_frm(azio_stream *s, char *blob, unsigned int length)
int azread_frm(azio_stream *s, char *blob)
{
- my_pread(s->file, blob, s->frm_length, s->frm_start_pos, MYF(0));
+ my_pread(s->file, (uchar*) blob, s->frm_length, s->frm_start_pos, MYF(0));
return 0;
}
@@ -848,7 +853,8 @@ int azwrite_comment(azio_stream *s, char *blob, unsigned int length)
s->comment_length= length;
s->start+= length;
- my_pwrite(s->file, blob, s->comment_length, s->comment_start_pos, MYF(0));
+ my_pwrite(s->file, (uchar*) blob, s->comment_length, s->comment_start_pos,
+ MYF(0));
write_header(s);
my_seek(s->file, 0, MY_SEEK_END, MYF(0));
@@ -858,7 +864,8 @@ int azwrite_comment(azio_stream *s, char *blob, unsigned int length)
int azread_comment(azio_stream *s, char *blob)
{
- my_pread(s->file, blob, s->comment_length, s->comment_start_pos, MYF(0));
+ my_pread(s->file, (uchar*) blob, s->comment_length, s->comment_start_pos,
+ MYF(0));
return 0;
}
diff --git a/storage/archive/azlib.h b/storage/archive/azlib.h
index a5bee1befae..47772b1c4fe 100644
--- a/storage/archive/azlib.h
+++ b/storage/archive/azlib.h
@@ -273,7 +273,7 @@ extern unsigned int azread ( azio_stream *s, voidp buf, unsigned int len, int *e
gzread returns the number of uncompressed bytes actually read (0 for
end of file, -1 for error). */
-extern unsigned int azwrite (azio_stream *s, voidpc buf, unsigned int len);
+extern unsigned int azwrite (azio_stream *s, const voidp buf, unsigned int len);
/*
Writes the given number of uncompressed bytes into the compressed file.
azwrite returns the number of uncompressed bytes actually written
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc
index 6853e879f55..6696eac2fbb 100644
--- a/storage/archive/ha_archive.cc
+++ b/storage/archive/ha_archive.cc
@@ -113,9 +113,9 @@ static handler *archive_create_handler(handlerton *hton,
TABLE_SHARE *table,
MEM_ROOT *mem_root);
int archive_discover(handlerton *hton, THD* thd, const char *db,
- const char *name,
- const void** frmblob,
- uint* frmlen);
+ const char *name,
+ uchar **frmblob,
+ size_t *frmlen);
/*
Number of rows that will force a bulk insert.
@@ -137,11 +137,11 @@ static handler *archive_create_handler(handlerton *hton,
/*
Used for hash table that tracks open tables.
*/
-static byte* archive_get_key(ARCHIVE_SHARE *share,uint *length,
+static uchar* archive_get_key(ARCHIVE_SHARE *share, size_t *length,
my_bool not_used __attribute__((unused)))
{
*length=share->table_name_length;
- return (byte*) share->table_name;
+ return (uchar*) share->table_name;
}
@@ -216,9 +216,9 @@ ha_archive::ha_archive(handlerton *hton, TABLE_SHARE *table_arg)
}
int archive_discover(handlerton *hton, THD* thd, const char *db,
- const char *name,
- const void** frmblob,
- uint* frmlen)
+ const char *name,
+ uchar **frmblob,
+ size_t *frmlen)
{
DBUG_ENTER("archive_discover");
DBUG_PRINT("archive_discover", ("db: %s, name: %s", db, name));
@@ -247,7 +247,7 @@ int archive_discover(handlerton *hton, THD* thd, const char *db,
azclose(&frm_stream);
*frmlen= frm_stream.frm_length;
- *frmblob= frm_ptr;
+ *frmblob= (uchar*) frm_ptr;
DBUG_RETURN(0);
err:
@@ -316,7 +316,7 @@ ARCHIVE_SHARE *ha_archive::get_share(const char *table_name, int *rc)
length=(uint) strlen(table_name);
if (!(share=(ARCHIVE_SHARE*) hash_search(&archive_open_tables,
- (byte*) table_name,
+ (uchar*) table_name,
length)))
{
char *tmp_name;
@@ -362,7 +362,7 @@ ARCHIVE_SHARE *ha_archive::get_share(const char *table_name, int *rc)
share->crashed= archive_tmp.dirty;
azclose(&archive_tmp);
- VOID(my_hash_insert(&archive_open_tables, (byte*) share));
+ VOID(my_hash_insert(&archive_open_tables, (uchar*) share));
thr_lock_init(&share->lock);
}
share->use_count++;
@@ -393,7 +393,7 @@ int ha_archive::free_share()
pthread_mutex_lock(&archive_mutex);
if (!--share->use_count)
{
- hash_delete(&archive_open_tables, (byte*) share);
+ hash_delete(&archive_open_tables, (uchar*) share);
thr_lock_delete(&share->lock);
VOID(pthread_mutex_destroy(&share->mutex));
/*
@@ -408,7 +408,7 @@ int ha_archive::free_share()
if (azclose(&(share->archive_write)))
rc= 1;
}
- my_free((gptr) share, MYF(0));
+ my_free((uchar*) share, MYF(0));
}
pthread_mutex_unlock(&archive_mutex);
@@ -436,6 +436,9 @@ int ha_archive::init_archive_writer()
}
+/*
+ No locks are required because it is associated with just one handler instance
+*/
int ha_archive::init_archive_reader()
{
DBUG_ENTER("ha_archive::init_archive_reader");
@@ -579,7 +582,7 @@ int ha_archive::create(const char *name, TABLE *table_arg,
azio_stream create_stream; /* Archive file we are working with */
File frm_file; /* File handler for readers */
MY_STAT file_stat; // Stat information for the data file
- byte *frm_ptr;
+ uchar *frm_ptr;
DBUG_ENTER("ha_archive::create");
@@ -651,12 +654,12 @@ int ha_archive::create(const char *name, TABLE *table_arg,
{
if (!my_fstat(frm_file, &file_stat, MYF(MY_WME)))
{
- frm_ptr= (byte *)my_malloc(sizeof(byte) * file_stat.st_size , MYF(0));
+ frm_ptr= (uchar *)my_malloc(sizeof(uchar) * file_stat.st_size, MYF(0));
if (frm_ptr)
{
my_read(frm_file, frm_ptr, file_stat.st_size, MYF(0));
azwrite_frm(&create_stream, (char *)frm_ptr, file_stat.st_size);
- my_free((gptr)frm_ptr, MYF(0));
+ my_free((uchar*)frm_ptr, MYF(0));
}
}
my_close(frm_file, MYF(0));
@@ -696,7 +699,7 @@ error:
/*
This is where the actual row is written out.
*/
-int ha_archive::real_write_row(byte *buf, azio_stream *writer)
+int ha_archive::real_write_row(uchar *buf, azio_stream *writer)
{
my_off_t written;
unsigned int r_pack_length;
@@ -726,7 +729,7 @@ int ha_archive::real_write_row(byte *buf, azio_stream *writer)
the bytes required for the length in the header.
*/
-uint32 ha_archive::max_row_length(const byte *buf)
+uint32 ha_archive::max_row_length(const uchar *buf)
{
uint32 length= (uint32)(table->s->reclength + table->s->fields*2);
length+= ARCHIVE_ROW_HEADER_SIZE;
@@ -743,9 +746,9 @@ uint32 ha_archive::max_row_length(const byte *buf)
}
-unsigned int ha_archive::pack_row(byte *record)
+unsigned int ha_archive::pack_row(uchar *record)
{
- byte *ptr;
+ uchar *ptr;
DBUG_ENTER("ha_archive::pack_row");
@@ -761,8 +764,7 @@ unsigned int ha_archive::pack_row(byte *record)
for (Field **field=table->field ; *field ; field++)
{
if (!((*field)->is_null()))
- ptr=(byte*) (*field)->pack((char*) ptr,
- (char*) record + (*field)->offset(record));
+ ptr= (*field)->pack(ptr, record + (*field)->offset(record));
}
int4store(record_buffer->buffer, (int)(ptr - record_buffer->buffer -
@@ -784,26 +786,27 @@ unsigned int ha_archive::pack_row(byte *record)
for implementing start_bulk_insert() is that we could skip
setting dirty to true each time.
*/
-int ha_archive::write_row(byte *buf)
+int ha_archive::write_row(uchar *buf)
{
int rc;
- byte *read_buf= NULL;
+ uchar *read_buf= NULL;
ulonglong temp_auto;
- byte *record= table->record[0];
+ uchar *record= table->record[0];
DBUG_ENTER("ha_archive::write_row");
if (share->crashed)
DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
- if (!share->archive_write_open)
- if (init_archive_writer())
- DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
-
ha_statistic_increment(&SSV::ha_write_count);
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
table->timestamp_field->set_time();
pthread_mutex_lock(&share->mutex);
+ if (!share->archive_write_open)
+ if (init_archive_writer())
+ DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
+
+
if (table->next_number_field && record == table->record[0])
{
KEY *mkey= &table->s->key_info[0]; // We only support one key right now
@@ -832,7 +835,7 @@ int ha_archive::write_row(byte *buf)
First we create a buffer that we can use for reading rows, and can pass
to get_row().
*/
- if (!(read_buf= (byte*) my_malloc(table->s->reclength, MYF(MY_WME))))
+ if (!(read_buf= (uchar*) my_malloc(table->s->reclength, MYF(MY_WME))))
{
rc= HA_ERR_OUT_OF_MEM;
goto error;
@@ -882,7 +885,7 @@ int ha_archive::write_row(byte *buf)
error:
pthread_mutex_unlock(&share->mutex);
if (read_buf)
- my_free((gptr) read_buf, MYF(0));
+ my_free((uchar*) read_buf, MYF(0));
DBUG_RETURN(rc);
}
@@ -910,7 +913,7 @@ int ha_archive::index_init(uint keynr, bool sorted)
No indexes, so if we get a request for an index search since we tell
the optimizer that we have unique indexes, we scan
*/
-int ha_archive::index_read(byte *buf, const byte *key,
+int ha_archive::index_read(uchar *buf, const uchar *key,
uint key_len, enum ha_rkey_function find_flag)
{
int rc;
@@ -920,7 +923,7 @@ int ha_archive::index_read(byte *buf, const byte *key,
}
-int ha_archive::index_read_idx(byte *buf, uint index, const byte *key,
+int ha_archive::index_read_idx(uchar *buf, uint index, const uchar *key,
uint key_len, enum ha_rkey_function find_flag)
{
int rc;
@@ -955,7 +958,7 @@ error:
}
-int ha_archive::index_next(byte * buf)
+int ha_archive::index_next(uchar * buf)
{
bool found= 0;
@@ -993,24 +996,6 @@ int ha_archive::rnd_init(bool scan)
{
DBUG_PRINT("info", ("archive will retrieve %llu rows",
(unsigned long long) scan_rows));
- stats.records= 0;
-
- /*
- If dirty, we lock, and then reset/flush the data.
- I found that just calling azflush() doesn't always work.
- */
- pthread_mutex_lock(&share->mutex);
- scan_rows= share->rows_recorded;
- if (share->dirty == TRUE)
- {
- if (share->dirty == TRUE)
- {
- DBUG_PRINT("ha_archive", ("archive flushing out rows for scan"));
- azflush(&(share->archive_write), Z_SYNC_FLUSH);
- share->dirty= FALSE;
- }
- }
- pthread_mutex_unlock(&share->mutex);
if (read_data_header(&archive))
DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
@@ -1024,7 +1009,7 @@ int ha_archive::rnd_init(bool scan)
This is the method that is used to read a row. It assumes that the row is
positioned where you want it.
*/
-int ha_archive::get_row(azio_stream *file_to_read, byte *buf)
+int ha_archive::get_row(azio_stream *file_to_read, uchar *buf)
{
int rc;
DBUG_ENTER("ha_archive::get_row");
@@ -1051,8 +1036,8 @@ bool ha_archive::fix_rec_buff(unsigned int length)
if (length > record_buffer->length)
{
- byte *newptr;
- if (!(newptr=(byte*) my_realloc((gptr) record_buffer->buffer,
+ uchar *newptr;
+ if (!(newptr=(uchar*) my_realloc((uchar*) record_buffer->buffer,
length,
MYF(MY_ALLOW_ZERO_PTR))))
DBUG_RETURN(1);
@@ -1065,17 +1050,17 @@ bool ha_archive::fix_rec_buff(unsigned int length)
DBUG_RETURN(0);
}
-int ha_archive::unpack_row(azio_stream *file_to_read, byte *record)
+int ha_archive::unpack_row(azio_stream *file_to_read, uchar *record)
{
DBUG_ENTER("ha_archive::unpack_row");
unsigned int read;
int error;
- byte size_buffer[ARCHIVE_ROW_HEADER_SIZE];
+ uchar size_buffer[ARCHIVE_ROW_HEADER_SIZE];
unsigned int row_len;
/* First we grab the length stored */
- read= azread(file_to_read, (byte *)size_buffer, ARCHIVE_ROW_HEADER_SIZE, &error);
+ read= azread(file_to_read, size_buffer, ARCHIVE_ROW_HEADER_SIZE, &error);
if (error == Z_STREAM_ERROR || (read && read < ARCHIVE_ROW_HEADER_SIZE))
DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
@@ -1100,21 +1085,21 @@ int ha_archive::unpack_row(azio_stream *file_to_read, byte *record)
}
/* Copy null bits */
- const char *ptr= (const char*) record_buffer->buffer;
+ const uchar *ptr= record_buffer->buffer;
memcpy(record, ptr, table->s->null_bytes);
ptr+= table->s->null_bytes;
for (Field **field=table->field ; *field ; field++)
+ {
if (!((*field)->is_null()))
{
- ptr= (*field)->unpack((char *)record +
- (*field)->offset(table->record[0]), ptr);
+ ptr= (*field)->unpack(record + (*field)->offset(table->record[0]), ptr);
}
-
+ }
DBUG_RETURN(0);
}
-int ha_archive::get_row_version3(azio_stream *file_to_read, byte *buf)
+int ha_archive::get_row_version3(azio_stream *file_to_read, uchar *buf)
{
DBUG_ENTER("ha_archive::get_row_version3");
@@ -1124,7 +1109,7 @@ int ha_archive::get_row_version3(azio_stream *file_to_read, byte *buf)
}
-int ha_archive::get_row_version2(azio_stream *file_to_read, byte *buf)
+int ha_archive::get_row_version2(azio_stream *file_to_read, uchar *buf)
{
unsigned int read;
int error;
@@ -1190,7 +1175,7 @@ int ha_archive::get_row_version2(azio_stream *file_to_read, byte *buf)
if ((size_t) read != size)
DBUG_RETURN(HA_ERR_END_OF_FILE);
- ((Field_blob*) table->field[*ptr])->set_ptr(size, last);
+ ((Field_blob*) table->field[*ptr])->set_ptr(size, (uchar*) last);
last += size;
}
else
@@ -1208,7 +1193,7 @@ int ha_archive::get_row_version2(azio_stream *file_to_read, byte *buf)
or by having had ha_archive::rnd_pos() called before it is called.
*/
-int ha_archive::rnd_next(byte *buf)
+int ha_archive::rnd_next(uchar *buf)
{
int rc;
DBUG_ENTER("ha_archive::rnd_next");
@@ -1224,9 +1209,7 @@ int ha_archive::rnd_next(byte *buf)
current_position= aztell(&archive);
rc= get_row(&archive, buf);
-
- if (rc != HA_ERR_END_OF_FILE)
- stats.records++;
+ table->status=rc ? STATUS_NOT_FOUND: 0;
DBUG_RETURN(rc);
}
@@ -1238,7 +1221,7 @@ int ha_archive::rnd_next(byte *buf)
needed.
*/
-void ha_archive::position(const byte *record)
+void ha_archive::position(const uchar *record)
{
DBUG_ENTER("ha_archive::position");
my_store_ptr(ref, ref_length, current_position);
@@ -1253,7 +1236,7 @@ void ha_archive::position(const byte *record)
correctly ordered row.
*/
-int ha_archive::rnd_pos(byte * buf, byte *pos)
+int ha_archive::rnd_pos(uchar * buf, uchar *pos)
{
DBUG_ENTER("ha_archive::rnd_pos");
ha_statistic_increment(&SSV::ha_read_rnd_next_count);
@@ -1346,8 +1329,8 @@ int ha_archive::optimize(THD* thd, HA_CHECK_OPT* check_opt)
{
Field *field= table->found_next_number_field;
ulonglong auto_value=
- (ulonglong) field->val_int((char*)(table->record[0] +
- field->offset(table->record[0])));
+ (ulonglong) field->val_int(table->record[0] +
+ field->offset(table->record[0]));
if (share->archive_write.auto_increment < auto_value)
stats.auto_increment_value= share->archive_write.auto_increment=
auto_value;
@@ -1462,12 +1445,33 @@ void ha_archive::update_create_info(HA_CREATE_INFO *create_info)
int ha_archive::info(uint flag)
{
DBUG_ENTER("ha_archive::info");
+
+ /*
+ If dirty, we lock, and then reset/flush the data.
+ I found that just calling azflush() doesn't always work.
+ */
+ pthread_mutex_lock(&share->mutex);
+ if (share->dirty == TRUE)
+ {
+ if (share->dirty == TRUE)
+ {
+ DBUG_PRINT("ha_archive", ("archive flushing out rows for scan"));
+ azflush(&(share->archive_write), Z_SYNC_FLUSH);
+ share->dirty= FALSE;
+ }
+ }
+
/*
This should be an accurate number now, though bulk and delayed inserts can
cause the number to be inaccurate.
*/
stats.records= share->rows_recorded;
+ pthread_mutex_unlock(&share->mutex);
+
+ scan_rows= stats.records;
stats.deleted= 0;
+
+ DBUG_PRINT("ha_archive", ("Stats rows is %d\n", (int)stats.records));
/* Costs quite a bit more to get all information */
if (flag & HA_STATUS_TIME)
{
@@ -1487,7 +1491,9 @@ int ha_archive::info(uint flag)
if (flag & HA_STATUS_AUTO)
{
init_archive_reader();
+ pthread_mutex_lock(&share->mutex);
azflush(&archive, Z_SYNC_FLUSH);
+ pthread_mutex_unlock(&share->mutex);
stats.auto_increment_value= archive.auto_increment;
}
@@ -1549,36 +1555,24 @@ bool ha_archive::is_crashed() const
int ha_archive::check(THD* thd, HA_CHECK_OPT* check_opt)
{
int rc= 0;
- byte *buf;
const char *old_proc_info;
ha_rows count= share->rows_recorded;
DBUG_ENTER("ha_archive::check");
old_proc_info= thd_proc_info(thd, "Checking table");
/* Flush any waiting data */
+ pthread_mutex_lock(&share->mutex);
azflush(&(share->archive_write), Z_SYNC_FLUSH);
-
- /*
- First we create a buffer that we can use for reading rows, and can pass
- to get_row().
- */
- if (!(buf= (byte*) my_malloc(table->s->reclength, MYF(MY_WME))))
- rc= HA_ERR_OUT_OF_MEM;
+ pthread_mutex_unlock(&share->mutex);
/*
Now we will rewind the archive file so that we are positioned at the
start of the file.
*/
init_archive_reader();
-
- if (!rc)
- read_data_header(&archive);
-
- if (!rc)
- while (!(rc= get_row(&archive, buf)))
- count--;
-
- my_free((char*)buf, MYF(0));
+ read_data_header(&archive);
+ while (!(rc= get_row(&archive, table->record[0])))
+ count--;
thd_proc_info(thd, old_proc_info);
@@ -1618,7 +1612,7 @@ archive_record_buffer *ha_archive::create_record_buffer(unsigned int length)
}
r->length= (int)length;
- if (!(r->buffer= (byte*) my_malloc(r->length,
+ if (!(r->buffer= (uchar*) my_malloc(r->length,
MYF(MY_WME))))
{
my_free((char*) r, MYF(MY_ALLOW_ZERO_PTR));
diff --git a/storage/archive/ha_archive.h b/storage/archive/ha_archive.h
index 8fc54f6715f..ab630ed22fd 100644
--- a/storage/archive/ha_archive.h
+++ b/storage/archive/ha_archive.h
@@ -27,7 +27,7 @@
*/
typedef struct st_archive_record_buffer {
- byte *buffer;
+ uchar *buffer;
uint32 length;
} archive_record_buffer;
@@ -62,12 +62,12 @@ class ha_archive: public handler
azio_stream archive; /* Archive file we are working with */
my_off_t current_position; /* The position of the row we just read */
- byte byte_buffer[IO_SIZE]; /* Initial buffer for our string */
+ uchar byte_buffer[IO_SIZE]; /* Initial buffer for our string */
String buffer; /* Buffer used for blob storage */
ha_rows scan_rows; /* Number of rows left in scan */
bool delayed_insert; /* If the insert is delayed */
bool bulk_insert; /* If we are performing a bulk insert */
- const byte *current_key;
+ const uchar *current_key;
uint current_key_len;
uint current_k_offset;
archive_record_buffer *record_buffer;
@@ -87,6 +87,9 @@ public:
ulonglong table_flags() const
{
return (HA_NO_TRANSACTIONS | HA_REC_NOT_IN_SEQ | HA_CAN_BIT_FIELD |
+ HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE |
+ HA_STATS_RECORDS_IS_EXACT |
+ HA_HAS_RECORDS |
HA_FILE_BASED | HA_CAN_INSERT_DELAYED | HA_CAN_GEOMETRY);
}
ulong index_flags(uint idx, uint part, bool all_parts) const
@@ -100,30 +103,31 @@ public:
uint max_supported_keys() const { return 1; }
uint max_supported_key_length() const { return sizeof(ulonglong); }
uint max_supported_key_part_length() const { return sizeof(ulonglong); }
+ ha_rows records() { return share->rows_recorded; }
int index_init(uint keynr, bool sorted);
- virtual int index_read(byte * buf, const byte * key,
+ virtual int index_read(uchar * buf, const uchar * key,
uint key_len, enum ha_rkey_function find_flag);
- virtual int index_read_idx(byte * buf, uint index, const byte * key,
+ virtual int index_read_idx(uchar * buf, uint index, const uchar * key,
uint key_len, enum ha_rkey_function find_flag);
- int index_next(byte * buf);
+ int index_next(uchar * buf);
int open(const char *name, int mode, uint test_if_locked);
int close(void);
- int write_row(byte * buf);
- int real_write_row(byte *buf, azio_stream *writer);
+ int write_row(uchar * buf);
+ int real_write_row(uchar *buf, azio_stream *writer);
int delete_all_rows();
int rnd_init(bool scan=1);
- int rnd_next(byte *buf);
- int rnd_pos(byte * buf, byte *pos);
- int get_row(azio_stream *file_to_read, byte *buf);
- int get_row_version2(azio_stream *file_to_read, byte *buf);
- int get_row_version3(azio_stream *file_to_read, byte *buf);
+ int rnd_next(uchar *buf);
+ int rnd_pos(uchar * buf, uchar *pos);
+ int get_row(azio_stream *file_to_read, uchar *buf);
+ int get_row_version2(azio_stream *file_to_read, uchar *buf);
+ int get_row_version3(azio_stream *file_to_read, uchar *buf);
ARCHIVE_SHARE *get_share(const char *table_name, int *rc);
int free_share();
int init_archive_writer();
int init_archive_reader();
bool auto_repair() const { return 1; } // For the moment we just do this
int read_data_header(azio_stream *file_to_read);
- void position(const byte *record);
+ void position(const uchar *record);
int info(uint);
void update_create_info(HA_CREATE_INFO *create_info);
int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info);
@@ -140,9 +144,9 @@ public:
bool is_crashed() const;
int check(THD* thd, HA_CHECK_OPT* check_opt);
bool check_and_repair(THD *thd);
- uint32 max_row_length(const byte *buf);
+ uint32 max_row_length(const uchar *buf);
bool fix_rec_buff(unsigned int length);
- int unpack_row(azio_stream *file_to_read, byte *record);
- unsigned int pack_row(byte *record);
+ int unpack_row(azio_stream *file_to_read, uchar *record);
+ unsigned int pack_row(uchar *record);
};
diff --git a/storage/blackhole/CMakeLists.txt b/storage/blackhole/CMakeLists.txt
index 6b02e1effa9..9b6dd7adac9 100644
--- a/storage/blackhole/CMakeLists.txt
+++ b/storage/blackhole/CMakeLists.txt
@@ -19,4 +19,9 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/extra/yassl/include)
-ADD_LIBRARY(blackhole ha_blackhole.cc ha_blackhole.h)
+
+SET(BLACKHOLE_SOURCES ha_blackhole.cc ha_blackhole.h)
+
+IF(NOT SOURCE_SUBLIBS)
+ ADD_LIBRARY(blackhole ${BLACKHOLE_SOURCES})
+ENDIF(NOT SOURCE_SUBLIBS)
diff --git a/storage/blackhole/ha_blackhole.cc b/storage/blackhole/ha_blackhole.cc
index 6f07c4183f1..4e12e9f0ee7 100644
--- a/storage/blackhole/ha_blackhole.cc
+++ b/storage/blackhole/ha_blackhole.cc
@@ -31,6 +31,14 @@ static handler *blackhole_create_handler(handlerton *hton,
}
+/* Static declarations for shared structures */
+
+static pthread_mutex_t blackhole_mutex;
+static HASH blackhole_open_tables;
+
+static st_blackhole_share *get_share(const char *table_name);
+static void free_share(st_blackhole_share *share);
+
/*****************************************************************************
** BLACKHOLE tables
*****************************************************************************/
@@ -53,15 +61,18 @@ const char **ha_blackhole::bas_ext() const
int ha_blackhole::open(const char *name, int mode, uint test_if_locked)
{
DBUG_ENTER("ha_blackhole::open");
- thr_lock_init(&thr_lock);
- thr_lock_data_init(&thr_lock,&lock,NULL);
+
+ if (!(share= get_share(name)))
+ DBUG_RETURN(HA_ERR_OUT_OF_MEM);
+
+ thr_lock_data_init(&share->lock, &lock, NULL);
DBUG_RETURN(0);
}
int ha_blackhole::close(void)
{
DBUG_ENTER("ha_blackhole::close");
- thr_lock_delete(&thr_lock);
+ free_share(share);
DBUG_RETURN(0);
}
@@ -83,7 +94,7 @@ const char *ha_blackhole::index_type(uint key_number)
HA_KEY_ALG_RTREE) ? "RTREE" : "BTREE");
}
-int ha_blackhole::write_row(byte * buf)
+int ha_blackhole::write_row(uchar * buf)
{
DBUG_ENTER("ha_blackhole::write_row");
DBUG_RETURN(0);
@@ -96,14 +107,14 @@ int ha_blackhole::rnd_init(bool scan)
}
-int ha_blackhole::rnd_next(byte *buf)
+int ha_blackhole::rnd_next(uchar *buf)
{
DBUG_ENTER("ha_blackhole::rnd_next");
DBUG_RETURN(HA_ERR_END_OF_FILE);
}
-int ha_blackhole::rnd_pos(byte * buf, byte *pos)
+int ha_blackhole::rnd_pos(uchar * buf, uchar *pos)
{
DBUG_ENTER("ha_blackhole::rnd_pos");
DBUG_ASSERT(0);
@@ -111,7 +122,7 @@ int ha_blackhole::rnd_pos(byte * buf, byte *pos)
}
-void ha_blackhole::position(const byte *record)
+void ha_blackhole::position(const uchar *record)
{
DBUG_ENTER("ha_blackhole::position");
DBUG_ASSERT(0);
@@ -136,23 +147,45 @@ int ha_blackhole::external_lock(THD *thd, int lock_type)
}
-uint ha_blackhole::lock_count(void) const
-{
- DBUG_ENTER("ha_blackhole::lock_count");
- DBUG_RETURN(0);
-}
-
THR_LOCK_DATA **ha_blackhole::store_lock(THD *thd,
THR_LOCK_DATA **to,
enum thr_lock_type lock_type)
{
DBUG_ENTER("ha_blackhole::store_lock");
+ if (lock_type != TL_IGNORE && lock.type == TL_UNLOCK)
+ {
+ /*
+ Here is where we get into the guts of a row level lock.
+ If TL_UNLOCK is set
+ If we are not doing a LOCK TABLE or DISCARD/IMPORT
+ TABLESPACE, then allow multiple writers
+ */
+
+ if ((lock_type >= TL_WRITE_CONCURRENT_INSERT &&
+ lock_type <= TL_WRITE) && !thd_in_lock_tables(thd)
+ && !thd_tablespace_op(thd))
+ lock_type = TL_WRITE_ALLOW_WRITE;
+
+ /*
+ In queries of type INSERT INTO t1 SELECT ... FROM t2 ...
+ MySQL would use the lock TL_READ_NO_INSERT on t2, and that
+ would conflict with TL_WRITE_ALLOW_WRITE, blocking all inserts
+ to t2. Convert the lock to a normal read lock to allow
+ concurrent inserts to t2.
+ */
+
+ if (lock_type == TL_READ_NO_INSERT && !thd_in_lock_tables(thd))
+ lock_type = TL_READ;
+
+ lock.type= lock_type;
+ }
+ *to++= &lock;
DBUG_RETURN(to);
}
-int ha_blackhole::index_read(byte * buf, const byte * key,
- key_part_map keypart_map,
+int ha_blackhole::index_read_map(uchar * buf, const uchar * key,
+ key_part_map keypart_map,
enum ha_rkey_function find_flag)
{
DBUG_ENTER("ha_blackhole::index_read");
@@ -160,7 +193,7 @@ int ha_blackhole::index_read(byte * buf, const byte * key,
}
-int ha_blackhole::index_read_idx(byte * buf, uint idx, const byte * key,
+int ha_blackhole::index_read_idx_map(uchar * buf, uint idx, const uchar * key,
key_part_map keypart_map,
enum ha_rkey_function find_flag)
{
@@ -169,41 +202,98 @@ int ha_blackhole::index_read_idx(byte * buf, uint idx, const byte * key,
}
-int ha_blackhole::index_read_last(byte * buf, const byte * key,
- key_part_map keypart_map)
+int ha_blackhole::index_read_last_map(uchar * buf, const uchar * key,
+ key_part_map keypart_map)
{
DBUG_ENTER("ha_blackhole::index_read_last");
DBUG_RETURN(HA_ERR_END_OF_FILE);
}
-int ha_blackhole::index_next(byte * buf)
+int ha_blackhole::index_next(uchar * buf)
{
DBUG_ENTER("ha_blackhole::index_next");
DBUG_RETURN(HA_ERR_END_OF_FILE);
}
-int ha_blackhole::index_prev(byte * buf)
+int ha_blackhole::index_prev(uchar * buf)
{
DBUG_ENTER("ha_blackhole::index_prev");
DBUG_RETURN(HA_ERR_END_OF_FILE);
}
-int ha_blackhole::index_first(byte * buf)
+int ha_blackhole::index_first(uchar * buf)
{
DBUG_ENTER("ha_blackhole::index_first");
DBUG_RETURN(HA_ERR_END_OF_FILE);
}
-int ha_blackhole::index_last(byte * buf)
+int ha_blackhole::index_last(uchar * buf)
{
DBUG_ENTER("ha_blackhole::index_last");
DBUG_RETURN(HA_ERR_END_OF_FILE);
}
+
+static st_blackhole_share *get_share(const char *table_name)
+{
+ st_blackhole_share *share;
+ uint length;
+
+ 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_malloc(sizeof(st_blackhole_share) +
+ length,
+ MYF(MY_WME | MY_ZEROFILL))))
+ goto error;
+
+ share->table_name_length= length;
+ strmov(share->table_name, table_name);
+
+ if (my_hash_insert(&blackhole_open_tables, (uchar*) share))
+ {
+ my_free((uchar*) share, MYF(0));
+ share= NULL;
+ goto error;
+ }
+
+ thr_lock_init(&share->lock);
+ }
+ share->use_count++;
+
+error:
+ pthread_mutex_unlock(&blackhole_mutex);
+ return share;
+}
+
+static void free_share(st_blackhole_share *share)
+{
+ pthread_mutex_lock(&blackhole_mutex);
+ if (!--share->use_count)
+ hash_delete(&blackhole_open_tables, (uchar*) share);
+ pthread_mutex_unlock(&blackhole_mutex);
+}
+
+static void blackhole_free_key(st_blackhole_share *share)
+{
+ thr_lock_delete(&share->lock);
+ my_free((uchar*) share, MYF(0));
+}
+
+static uchar* blackhole_get_key(st_blackhole_share *share, size_t *length,
+ my_bool not_used __attribute__((unused)))
+{
+ *length= share->table_name_length;
+ return (uchar*) share->table_name;
+}
+
static int blackhole_init(void *p)
{
handlerton *blackhole_hton;
@@ -212,6 +302,20 @@ static int blackhole_init(void *p)
blackhole_hton->db_type= DB_TYPE_BLACKHOLE_DB;
blackhole_hton->create= blackhole_create_handler;
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);
+
+ return 0;
+}
+
+static int blackhole_fini(void *p)
+{
+ hash_free(&blackhole_open_tables);
+ pthread_mutex_destroy(&blackhole_mutex);
+
return 0;
}
@@ -227,7 +331,7 @@ mysql_declare_plugin(blackhole)
"/dev/null storage engine (anything you write to it disappears)",
PLUGIN_LICENSE_GPL,
blackhole_init, /* Plugin Init */
- NULL, /* Plugin Deinit */
+ blackhole_fini, /* Plugin Deinit */
0x0100 /* 1.0 */,
NULL, /* status variables */
NULL, /* system variables */
diff --git a/storage/blackhole/ha_blackhole.h b/storage/blackhole/ha_blackhole.h
index 2af12b33077..d5a0d08926c 100644
--- a/storage/blackhole/ha_blackhole.h
+++ b/storage/blackhole/ha_blackhole.h
@@ -18,13 +18,24 @@
#endif
/*
+ Shared structure for correct LOCK operation
+*/
+struct st_blackhole_share {
+ THR_LOCK lock;
+ uint use_count;
+ uint table_name_length;
+ char table_name[1];
+};
+
+
+/*
Class definition for the blackhole storage engine
"Dumbest named feature ever"
*/
class ha_blackhole: public handler
{
THR_LOCK_DATA lock; /* MySQL lock */
- THR_LOCK thr_lock;
+ st_blackhole_share *share;
public:
ha_blackhole(handlerton *hton, TABLE_SHARE *table_arg);
@@ -42,6 +53,7 @@ public:
ulonglong table_flags() const
{
return(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER |
+ HA_BINLOG_STMT_CAPABLE |
HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY |
HA_FILE_BASED | HA_CAN_GEOMETRY | HA_CAN_INSERT_DELAYED);
}
@@ -60,23 +72,23 @@ public:
uint max_supported_key_part_length() const { return BLACKHOLE_MAX_KEY_LENGTH; }
int open(const char *name, int mode, uint test_if_locked);
int close(void);
- int write_row(byte * buf);
+ int write_row(uchar * buf);
int rnd_init(bool scan);
- int rnd_next(byte *buf);
- int rnd_pos(byte * buf, byte *pos);
- int index_read(byte * buf, const byte * key, key_part_map keypart_map,
- enum ha_rkey_function find_flag);
- int index_read_idx(byte * buf, uint idx, const byte * key,
- key_part_map keypart_map, enum ha_rkey_function find_flag);
- int index_read_last(byte * buf, const byte * key, key_part_map keypart_map);
- int index_next(byte * buf);
- int index_prev(byte * buf);
- int index_first(byte * buf);
- int index_last(byte * buf);
- void position(const byte *record);
+ int rnd_next(uchar *buf);
+ int rnd_pos(uchar * buf, uchar *pos);
+ int index_read_map(uchar * buf, const uchar * key, key_part_map keypart_map,
+ enum ha_rkey_function find_flag);
+ int index_read_idx_map(uchar * buf, uint idx, const uchar * key,
+ key_part_map keypart_map,
+ enum ha_rkey_function find_flag);
+ int index_read_last_map(uchar * buf, const uchar * key, key_part_map keypart_map);
+ int index_next(uchar * buf);
+ int index_prev(uchar * buf);
+ int index_first(uchar * buf);
+ int index_last(uchar * buf);
+ void position(const uchar *record);
int info(uint flag);
int external_lock(THD *thd, int lock_type);
- uint lock_count(void) const;
int create(const char *name, TABLE *table_arg,
HA_CREATE_INFO *create_info);
THR_LOCK_DATA **store_lock(THD *thd,
diff --git a/storage/csv/CMakeLists.txt b/storage/csv/CMakeLists.txt
index 359d1509a7e..bb0df45e5f4 100644
--- a/storage/csv/CMakeLists.txt
+++ b/storage/csv/CMakeLists.txt
@@ -19,4 +19,9 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/extra/yassl/include)
-ADD_LIBRARY(csv ha_tina.cc ha_tina.h transparent_file.cc transparent_file.h)
+
+SET(CSV_SOURCES ha_tina.cc ha_tina.h transparent_file.cc transparent_file.h)
+
+IF(NOT SOURCE_SUBLIBS)
+ ADD_LIBRARY(csv ${CSV_SOURCES})
+ENDIF(NOT SOURCE_SUBLIBS)
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index 07a4ffc65c5..9a7781e017d 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -46,10 +46,9 @@ TODO:
#endif
#include "mysql_priv.h"
-
+#include <mysql/plugin.h>
#include "ha_tina.h"
-#include <mysql/plugin.h>
/*
uchar + uchar + ulonglong + ulonglong + ulonglong + ulonglong + uchar
@@ -69,6 +68,10 @@ static int free_share(TINA_SHARE *share);
static int read_meta_file(File meta_file, ha_rows *rows);
static int write_meta_file(File meta_file, ha_rows rows, bool dirty);
+extern "C" void tina_get_status(void* param, int concurrent_insert);
+extern "C" void tina_update_status(void* param);
+extern "C" my_bool tina_check_status(void* param);
+
/* Stuff for shares */
pthread_mutex_t tina_mutex;
static HASH tina_open_tables;
@@ -93,11 +96,11 @@ int sort_set (tina_set *a, tina_set *b)
return ( a->begin > b->begin ? 1 : ( a->begin < b->begin ? -1 : 0 ) );
}
-static byte* tina_get_key(TINA_SHARE *share,uint *length,
+static uchar* tina_get_key(TINA_SHARE *share, size_t *length,
my_bool not_used __attribute__((unused)))
{
*length=share->table_name_length;
- return (byte*) share->table_name;
+ return (uchar*) share->table_name;
}
static int tina_init_func(void *p)
@@ -144,7 +147,7 @@ static TINA_SHARE *get_share(const char *table_name, TABLE *table)
initialize its members.
*/
if (!(share=(TINA_SHARE*) hash_search(&tina_open_tables,
- (byte*) table_name,
+ (uchar*) table_name,
length)))
{
if (!my_multi_malloc(MYF(MY_WME | MY_ZEROFILL),
@@ -164,6 +167,7 @@ static TINA_SHARE *get_share(const char *table_name, TABLE *table)
share->rows_recorded= 0;
share->update_file_opened= FALSE;
share->tina_write_opened= FALSE;
+ share->data_file_version= 0;
strmov(share->table_name, table_name);
fn_format(share->data_file_name, table_name, "", CSV_EXT,
MY_REPLACE_EXT|MY_UNPACK_FILENAME);
@@ -174,7 +178,7 @@ static TINA_SHARE *get_share(const char *table_name, TABLE *table)
goto error;
share->saved_data_file_length= file_stat.st_size;
- if (my_hash_insert(&tina_open_tables, (byte*) share))
+ if (my_hash_insert(&tina_open_tables, (uchar*) share))
goto error;
thr_lock_init(&share->lock);
pthread_mutex_init(&share->mutex,MY_MUTEX_INIT_FAST);
@@ -203,7 +207,7 @@ static TINA_SHARE *get_share(const char *table_name, TABLE *table)
error:
pthread_mutex_unlock(&tina_mutex);
- my_free((gptr) share, MYF(0));
+ my_free((uchar*) share, MYF(0));
return NULL;
}
@@ -236,7 +240,7 @@ static int read_meta_file(File meta_file, ha_rows *rows)
DBUG_ENTER("ha_tina::read_meta_file");
VOID(my_seek(meta_file, 0, MY_SEEK_SET, MYF(0)));
- if (my_read(meta_file, (byte*)meta_buffer, META_BUFFER_SIZE, 0)
+ if (my_read(meta_file, (uchar*)meta_buffer, META_BUFFER_SIZE, 0)
!= META_BUFFER_SIZE)
DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
@@ -305,7 +309,7 @@ static int write_meta_file(File meta_file, ha_rows rows, bool dirty)
*ptr= (uchar)dirty;
VOID(my_seek(meta_file, 0, MY_SEEK_SET, MYF(0)));
- if (my_write(meta_file, (byte *)meta_buffer, META_BUFFER_SIZE, 0)
+ if (my_write(meta_file, (uchar *)meta_buffer, META_BUFFER_SIZE, 0)
!= META_BUFFER_SIZE)
DBUG_RETURN(-1);
@@ -376,10 +380,10 @@ static int free_share(TINA_SHARE *share)
share->tina_write_opened= FALSE;
}
- hash_delete(&tina_open_tables, (byte*) share);
+ hash_delete(&tina_open_tables, (uchar*) share);
thr_lock_delete(&share->lock);
pthread_mutex_destroy(&share->mutex);
- my_free((gptr) share, MYF(0));
+ my_free((uchar*) share, MYF(0));
}
pthread_mutex_unlock(&tina_mutex);
@@ -441,10 +445,10 @@ ha_tina::ha_tina(handlerton *hton, TABLE_SHARE *table_arg)
*/
current_position(0), next_position(0), local_saved_data_file_length(0),
file_buff(0), chain_alloced(0), chain_size(DEFAULT_CHAIN_LENGTH),
- records_is_known(0)
+ local_data_file_version(0), records_is_known(0)
{
/* Set our original buffers from pre-allocated memory */
- buffer.set((char*)byte_buffer, IO_SIZE, system_charset_info);
+ buffer.set((char*)byte_buffer, IO_SIZE, &my_charset_bin);
chain= chain_buffer;
file_buff= new Transparent_file();
}
@@ -454,7 +458,7 @@ ha_tina::ha_tina(handlerton *hton, TABLE_SHARE *table_arg)
Encode a buffer into the quoted format.
*/
-int ha_tina::encode_quote(byte *buf)
+int ha_tina::encode_quote(uchar *buf)
{
char attribute_buffer[1024];
String attribute(attribute_buffer, sizeof(attribute_buffer),
@@ -558,7 +562,7 @@ int ha_tina::chain_append()
if (chain_alloced)
{
/* Must cast since my_malloc unlike malloc doesn't have a void ptr */
- if ((chain= (tina_set *) my_realloc((gptr)chain,
+ if ((chain= (tina_set *) my_realloc((uchar*)chain,
chain_size, MYF(MY_WME))) == NULL)
return -1;
}
@@ -584,12 +588,13 @@ int ha_tina::chain_append()
/*
Scans for a row.
*/
-int ha_tina::find_current_row(byte *buf)
+int ha_tina::find_current_row(uchar *buf)
{
off_t end_offset, curr_offset= current_position;
int eoln_len;
my_bitmap_map *org_bitmap;
int error;
+ bool read_all;
DBUG_ENTER("ha_tina::find_current_row");
/*
@@ -601,6 +606,8 @@ int ha_tina::find_current_row(byte *buf)
local_saved_data_file_length, &eoln_len)) == 0)
DBUG_RETURN(HA_ERR_END_OF_FILE);
+ /* We must read all columns in case a table is opened for update */
+ read_all= !bitmap_is_clear_all(table->write_set);
/* Avoid asserts in ::store() for columns that are not going to be updated */
org_bitmap= dbug_tmp_use_all_columns(table, table->write_set);
error= HA_ERR_CRASHED_ON_USAGE;
@@ -609,37 +616,41 @@ int ha_tina::find_current_row(byte *buf)
for (Field **field=table->field ; *field ; field++)
{
+ char curr_char;
+
buffer.length(0);
- if (curr_offset < end_offset &&
- file_buff->get_value(curr_offset) == '"')
+ if (curr_offset >= end_offset)
+ goto err;
+ curr_char= file_buff->get_value(curr_offset);
+ if (curr_char == '"')
{
curr_offset++; // Incrementpast the first quote
- for(;curr_offset < end_offset; curr_offset++)
+ for(; curr_offset < end_offset; curr_offset++)
{
+ curr_char= file_buff->get_value(curr_offset);
// Need to convert line feeds!
- if (file_buff->get_value(curr_offset) == '"' &&
- ((file_buff->get_value(curr_offset + 1) == ',') ||
- (curr_offset == end_offset -1 )))
+ if (curr_char == '"' &&
+ (curr_offset == end_offset - 1 ||
+ file_buff->get_value(curr_offset + 1) == ','))
{
curr_offset+= 2; // Move past the , and the "
break;
}
- if (file_buff->get_value(curr_offset) == '\\' &&
- curr_offset != (end_offset - 1))
+ if (curr_char == '\\' && curr_offset != (end_offset - 1))
{
curr_offset++;
- if (file_buff->get_value(curr_offset) == 'r')
+ curr_char= file_buff->get_value(curr_offset);
+ if (curr_char == 'r')
buffer.append('\r');
- else if (file_buff->get_value(curr_offset) == 'n' )
+ else if (curr_char == 'n' )
buffer.append('\n');
- else if ((file_buff->get_value(curr_offset) == '\\') ||
- (file_buff->get_value(curr_offset) == '"'))
- buffer.append(file_buff->get_value(curr_offset));
+ else if (curr_char == '\\' || curr_char == '"')
+ buffer.append(curr_char);
else /* This could only happed with an externally created file */
{
buffer.append('\\');
- buffer.append(file_buff->get_value(curr_offset));
+ buffer.append(curr_char);
}
}
else // ordinary symbol
@@ -650,36 +661,30 @@ int ha_tina::find_current_row(byte *buf)
*/
if (curr_offset == end_offset - 1)
goto err;
- buffer.append(file_buff->get_value(curr_offset));
+ buffer.append(curr_char);
}
}
}
- else if (my_isdigit(system_charset_info,
- file_buff->get_value(curr_offset)))
+ else
{
- for(;curr_offset < end_offset; curr_offset++)
+ for(; curr_offset < end_offset; curr_offset++)
{
- if (file_buff->get_value(curr_offset) == ',')
+ curr_char= file_buff->get_value(curr_offset);
+ if (curr_char == ',')
{
- curr_offset+= 1; // Move past the ,
+ curr_offset++; // Skip the ,
break;
}
-
- if (my_isdigit(system_charset_info, file_buff->get_value(curr_offset)))
- buffer.append(file_buff->get_value(curr_offset));
- else if (file_buff->get_value(curr_offset) == '.')
- buffer.append(file_buff->get_value(curr_offset));
- else
- goto err;
+ buffer.append(curr_char);
}
}
- else
+
+ if (read_all || bitmap_is_set(table->read_set, (*field)->field_index))
{
- goto err;
+ if ((*field)->store(buffer.ptr(), buffer.length(), buffer.charset(),
+ CHECK_FIELD_WARN))
+ goto err;
}
-
- if (bitmap_is_set(table->read_set, (*field)->field_index))
- (*field)->store(buffer.ptr(), buffer.length(), system_charset_info);
}
next_position= end_offset + eoln_len;
error= 0;
@@ -785,18 +790,6 @@ void ha_tina::update_status()
}
-bool ha_tina::check_if_locking_is_allowed(uint sql_command,
- ulong type, TABLE *table,
- uint count, uint current,
- uint *system_count,
- bool called_by_privileged_thread)
-{
- if (!called_by_privileged_thread)
- return check_if_log_table_locking_is_allowed(sql_command, type, table);
-
- return TRUE;
-}
-
/*
Open a database file. Keep in mind that tables are caches, so
this will not be called for every request. Any sort of positions
@@ -815,6 +808,7 @@ int ha_tina::open(const char *name, int mode, uint open_options)
DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
}
+ local_data_file_version= share->data_file_version;
if ((data_file= my_open(share->data_file_name, O_RDONLY, MYF(0))) == -1)
DBUG_RETURN(0);
@@ -851,7 +845,7 @@ int ha_tina::close(void)
of the file and appends the data. In an error case it really should
just truncate to the original position (this is not done yet).
*/
-int ha_tina::write_row(byte * buf)
+int ha_tina::write_row(uchar * buf)
{
int size;
DBUG_ENTER("ha_tina::write_row");
@@ -871,7 +865,7 @@ int ha_tina::write_row(byte * buf)
DBUG_RETURN(-1);
/* use pwrite, as concurrent reader could have changed the position */
- if (my_write(share->tina_write_filedes, (byte*)buffer.ptr(), size,
+ if (my_write(share->tina_write_filedes, (uchar*)buffer.ptr(), size,
MYF(MY_WME | MY_NABP)))
DBUG_RETURN(-1);
@@ -904,6 +898,7 @@ int ha_tina::open_update_temp_file_if_needed()
0, O_RDWR | O_TRUNC, MYF(MY_WME))) < 0)
return 1;
share->update_file_opened= TRUE;
+ temp_file_length= 0;
}
return 0;
}
@@ -916,7 +911,7 @@ int ha_tina::open_update_temp_file_if_needed()
This will be called in a table scan right before the previous ::rnd_next()
call.
*/
-int ha_tina::update_row(const byte * old_data, byte * new_data)
+int ha_tina::update_row(const uchar * old_data, uchar * new_data)
{
int size;
DBUG_ENTER("ha_tina::update_row");
@@ -928,15 +923,23 @@ int ha_tina::update_row(const byte * old_data, byte * new_data)
size= encode_quote(new_data);
+ /*
+ During update we mark each updating record as deleted
+ (see the chain_append()) then write new one to the temporary data file.
+ At the end of the sequence in the rnd_end() we append all non-marked
+ records from the data file to the temporary data file then rename it.
+ The temp_file_length is used to calculate new data file length.
+ */
if (chain_append())
DBUG_RETURN(-1);
if (open_update_temp_file_if_needed())
DBUG_RETURN(-1);
- if (my_write(update_temp_file, (byte*)buffer.ptr(), size,
+ if (my_write(update_temp_file, (uchar*)buffer.ptr(), size,
MYF(MY_WME | MY_NABP)))
DBUG_RETURN(-1);
+ temp_file_length+= size;
/* UPDATE should never happen on the log tables */
DBUG_ASSERT(!share->is_log_table);
@@ -954,7 +957,7 @@ int ha_tina::update_row(const byte * old_data, byte * new_data)
The table will then be deleted/positioned based on the ORDER (so RANDOM,
DESC, ASC).
*/
-int ha_tina::delete_row(const byte * buf)
+int ha_tina::delete_row(const uchar * buf)
{
DBUG_ENTER("ha_tina::delete_row");
ha_statistic_increment(&SSV::ha_delete_count);
@@ -963,6 +966,11 @@ int ha_tina::delete_row(const byte * buf)
DBUG_RETURN(-1);
stats.records--;
+ /* Update shared info */
+ DBUG_ASSERT(share->rows_recorded);
+ pthread_mutex_lock(&share->mutex);
+ share->rows_recorded--;
+ pthread_mutex_unlock(&share->mutex);
/* DELETE should never happen on the log table */
DBUG_ASSERT(!share->is_log_table);
@@ -971,6 +979,33 @@ int ha_tina::delete_row(const byte * buf)
}
+/**
+ @brief Initialize the data file.
+
+ @details Compare the local version of the data file with the shared one.
+ If they differ, there are some changes behind and we have to reopen
+ the data file to make the changes visible.
+ Call @c file_buff->init_buff() at the end to read the beginning of the
+ data file into buffer.
+
+ @retval 0 OK.
+ @retval 1 There was an error.
+*/
+
+int ha_tina::init_data_file()
+{
+ if (local_data_file_version != share->data_file_version)
+ {
+ local_data_file_version= share->data_file_version;
+ if (my_close(data_file, MYF(0)) ||
+ (data_file= my_open(share->data_file_name, O_RDONLY, MYF(0))) == -1)
+ return 1;
+ }
+ file_buff->init_buff(data_file);
+ return 0;
+}
+
+
/*
All table scans call this first.
The order of a table scan is:
@@ -1007,9 +1042,8 @@ int ha_tina::rnd_init(bool scan)
DBUG_ENTER("ha_tina::rnd_init");
/* set buffer to the beginning of the file */
- file_buff->init_buff(data_file);
- if (share->crashed)
- DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
+ if (share->crashed || init_data_file())
+ DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
current_position= next_position= 0;
stats.records= 0;
@@ -1033,7 +1067,7 @@ int ha_tina::rnd_init(bool scan)
NULL and "". This is ok since this table handler is for spreadsheets and
they don't know about them either :)
*/
-int ha_tina::rnd_next(byte *buf)
+int ha_tina::rnd_next(uchar *buf)
{
int rc;
DBUG_ENTER("ha_tina::rnd_next");
@@ -1065,7 +1099,7 @@ int ha_tina::rnd_next(byte *buf)
its just a position. Look at the bdb code if you want to see a case
where something other then a number is stored.
*/
-void ha_tina::position(const byte *record)
+void ha_tina::position(const uchar *record)
{
DBUG_ENTER("ha_tina::position");
my_store_ptr(ref, ref_length, current_position);
@@ -1078,7 +1112,7 @@ void ha_tina::position(const byte *record)
my_get_ptr() retrieves the data for you.
*/
-int ha_tina::rnd_pos(byte * buf, byte *pos)
+int ha_tina::rnd_pos(uchar * buf, uchar *pos)
{
DBUG_ENTER("ha_tina::rnd_pos");
ha_statistic_increment(&SSV::ha_read_rnd_next_count);
@@ -1174,15 +1208,18 @@ int ha_tina::rnd_end()
while ((file_buffer_start != -1)) // while not end of file
{
bool in_hole= get_write_pos(&write_end, ptr);
+ off_t write_length= write_end - write_begin;
/* if there is something to write, write it */
- if ((write_end - write_begin) &&
- (my_write(update_temp_file,
- (byte*)(file_buff->ptr() +
- (write_begin - file_buff->start())),
- write_end - write_begin, MYF_RW)))
- goto error;
-
+ if (write_length)
+ {
+ if (my_write(update_temp_file,
+ (uchar*) (file_buff->ptr() +
+ (write_begin - file_buff->start())),
+ write_length, MYF_RW))
+ goto error;
+ temp_file_length+= write_length;
+ }
if (in_hole)
{
/* skip hole */
@@ -1230,11 +1267,26 @@ int ha_tina::rnd_end()
if (((data_file= my_open(share->data_file_name, O_RDONLY, MYF(0))) == -1))
DBUG_RETURN(-1);
/*
+ As we reopened the data file, increase share->data_file_version
+ in order to force other threads waiting on a table lock and
+ have already opened the table to reopen the data file.
+ That makes the latest changes become visible to them.
+ Update local_data_file_version as no need to reopen it in the
+ current thread.
+ */
+ share->data_file_version++;
+ local_data_file_version= share->data_file_version;
+ /*
The datafile is consistent at this point and the write filedes is
closed, so nothing worrying will happen to it in case of a crash.
Here we record this fact to the meta-file.
*/
(void)write_meta_file(share->meta_file, share->rows_recorded, FALSE);
+ /*
+ Update local_saved_data_file_length with the real length of the
+ data file.
+ */
+ local_saved_data_file_length= temp_file_length;
}
DBUG_RETURN(0);
@@ -1266,7 +1318,7 @@ error:
int ha_tina::repair(THD* thd, HA_CHECK_OPT* check_opt)
{
char repaired_fname[FN_REFLEN];
- byte *buf;
+ uchar *buf;
File repair_file;
int rc;
ha_rows rows_repaired= 0;
@@ -1282,11 +1334,12 @@ int ha_tina::repair(THD* thd, HA_CHECK_OPT* check_opt)
/* Don't assert in field::val() functions */
table->use_all_columns();
- if (!(buf= (byte*) my_malloc(table->s->reclength, MYF(MY_WME))))
+ if (!(buf= (uchar*) my_malloc(table->s->reclength, MYF(MY_WME))))
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
/* position buffer to the start of the file */
- file_buff->init_buff(data_file);
+ if (init_data_file())
+ DBUG_RETURN(HA_ERR_CRASHED_ON_REPAIR);
/*
Local_saved_data_file_length is initialized during the lock phase.
@@ -1300,6 +1353,7 @@ int ha_tina::repair(THD* thd, HA_CHECK_OPT* check_opt)
/* Read the file row-by-row. If everything is ok, repair is not needed. */
while (!(rc= find_current_row(buf)))
{
+ thd_inc_row_count(thd);
rows_repaired++;
current_position= next_position;
}
@@ -1338,7 +1392,7 @@ int ha_tina::repair(THD* thd, HA_CHECK_OPT* check_opt)
{
write_end= min(file_buff->end(), current_position);
if ((write_end - write_begin) &&
- (my_write(repair_file, (byte*)file_buff->ptr(),
+ (my_write(repair_file, (uchar*)file_buff->ptr(),
write_end - write_begin, MYF_RW)))
DBUG_RETURN(-1);
@@ -1392,6 +1446,11 @@ int ha_tina::delete_all_rows()
rc= my_chsize(share->tina_write_filedes, 0, 0, MYF(MY_WME));
stats.records=0;
+ /* Update shared info */
+ pthread_mutex_lock(&share->mutex);
+ share->rows_recorded= 0;
+ pthread_mutex_unlock(&share->mutex);
+ local_saved_data_file_length= 0;
DBUG_RETURN(rc);
}
@@ -1442,17 +1501,18 @@ int ha_tina::create(const char *name, TABLE *table_arg,
int ha_tina::check(THD* thd, HA_CHECK_OPT* check_opt)
{
int rc= 0;
- byte *buf;
+ uchar *buf;
const char *old_proc_info;
ha_rows count= share->rows_recorded;
DBUG_ENTER("ha_tina::check");
old_proc_info= thd_proc_info(thd, "Checking table");
- if (!(buf= (byte*) my_malloc(table->s->reclength, MYF(MY_WME))))
+ if (!(buf= (uchar*) my_malloc(table->s->reclength, MYF(MY_WME))))
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
/* position buffer to the start of the file */
- file_buff->init_buff(data_file);
+ if (init_data_file())
+ DBUG_RETURN(HA_ERR_CRASHED);
/*
Local_saved_data_file_length is initialized during the lock phase.
@@ -1465,6 +1525,7 @@ int ha_tina::check(THD* thd, HA_CHECK_OPT* check_opt)
/* Read the file row-by-row. If everything is ok, repair is not needed. */
while (!(rc= find_current_row(buf)))
{
+ thd_inc_row_count(thd);
count--;
current_position= next_position;
}
diff --git a/storage/csv/ha_tina.h b/storage/csv/ha_tina.h
index c096f21fca2..5ce09783b9b 100644
--- a/storage/csv/ha_tina.h
+++ b/storage/csv/ha_tina.h
@@ -49,6 +49,7 @@ typedef struct st_tina_share {
File tina_write_filedes; /* File handler for readers */
bool crashed; /* Meta file is crashed */
ha_rows rows_recorded; /* Number of rows in tables */
+ uint data_file_version; /* Version of the data file used */
} TINA_SHARE;
struct tina_set {
@@ -63,7 +64,8 @@ class ha_tina: public handler
off_t current_position; /* Current position in the file during a file scan */
off_t next_position; /* Next position in the file scan */
off_t local_saved_data_file_length; /* save position for reads */
- byte byte_buffer[IO_SIZE];
+ off_t temp_file_length;
+ uchar byte_buffer[IO_SIZE];
Transparent_file *file_buff;
File data_file; /* File handler for readers */
File update_temp_file;
@@ -76,21 +78,23 @@ class ha_tina: public handler
tina_set chain_buffer[DEFAULT_CHAIN_LENGTH];
tina_set *chain;
tina_set *chain_ptr;
- byte chain_alloced;
+ uchar chain_alloced;
uint32 chain_size;
+ uint local_data_file_version; /* Saved version of the data file used */
bool records_is_known;
private:
bool get_write_pos(off_t *end_pos, tina_set *closest_hole);
int open_update_temp_file_if_needed();
int init_tina_writer();
+ int init_data_file();
public:
ha_tina(handlerton *hton, TABLE_SHARE *table_arg);
~ha_tina()
{
if (chain_alloced)
- my_free((gptr)chain, 0);
+ my_free(chain, 0);
if (file_buff)
delete file_buff;
}
@@ -99,7 +103,8 @@ public:
const char **bas_ext() const;
ulonglong table_flags() const
{
- return (HA_NO_TRANSACTIONS | HA_REC_NOT_IN_SEQ | HA_NO_AUTO_INCREMENT);
+ return (HA_NO_TRANSACTIONS | HA_REC_NOT_IN_SEQ | HA_NO_AUTO_INCREMENT |
+ HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE);
}
ulong index_flags(uint idx, uint part, bool all_parts) const
{
@@ -126,19 +131,14 @@ public:
*/
ha_rows estimate_rows_upper_bound() { return HA_POS_ERROR; }
- virtual bool check_if_locking_is_allowed(uint sql_command,
- ulong type, TABLE *table,
- uint count, uint current,
- uint *system_count,
- bool called_by_logger_thread);
int open(const char *name, int mode, uint open_options);
int close(void);
- int write_row(byte * buf);
- int update_row(const byte * old_data, byte * new_data);
- int delete_row(const byte * buf);
+ int write_row(uchar * buf);
+ int update_row(const uchar * old_data, uchar * new_data);
+ int delete_row(const uchar * buf);
int rnd_init(bool scan=1);
- int rnd_next(byte *buf);
- int rnd_pos(byte * buf, byte *pos);
+ int rnd_next(uchar *buf);
+ int rnd_pos(uchar * buf, uchar *pos);
bool check_and_repair(THD *thd);
int check(THD* thd, HA_CHECK_OPT* check_opt);
bool is_crashed() const;
@@ -146,7 +146,7 @@ public:
int repair(THD* thd, HA_CHECK_OPT* check_opt);
/* This is required for SQL layer to know that we support autorepair */
bool auto_repair() const { return 1; }
- void position(const byte *record);
+ void position(const uchar *record);
int info(uint);
int extra(enum ha_extra_function operation);
int delete_all_rows(void);
@@ -165,8 +165,8 @@ public:
void update_status();
/* The following methods were added just for TINA */
- int encode_quote(byte *buf);
- int find_current_row(byte *buf);
+ int encode_quote(uchar *buf);
+ int find_current_row(uchar *buf);
int chain_append();
};
diff --git a/storage/csv/transparent_file.cc b/storage/csv/transparent_file.cc
index 27cc8c024b4..a200fa6ac36 100644
--- a/storage/csv/transparent_file.cc
+++ b/storage/csv/transparent_file.cc
@@ -22,12 +22,12 @@
Transparent_file::Transparent_file() : lower_bound(0), buff_size(IO_SIZE)
{
- buff= (byte *) my_malloc(buff_size*sizeof(byte), MYF(MY_WME));
+ buff= (uchar *) my_malloc(buff_size*sizeof(uchar), MYF(MY_WME));
}
Transparent_file::~Transparent_file()
{
- my_free((gptr)buff, MYF(MY_ALLOW_ZERO_PTR));
+ my_free((uchar*)buff, MYF(MY_ALLOW_ZERO_PTR));
}
void Transparent_file::init_buff(File filedes_arg)
@@ -40,7 +40,7 @@ void Transparent_file::init_buff(File filedes_arg)
upper_bound= my_read(filedes, buff, buff_size, MYF(0));
}
-byte *Transparent_file::ptr()
+uchar *Transparent_file::ptr()
{
return buff;
}
@@ -57,18 +57,18 @@ off_t Transparent_file::end()
off_t Transparent_file::read_next()
{
- off_t bytes_read;
+ size_t bytes_read;
/*
No need to seek here, as the file managed by Transparent_file class
always points to upper_bound byte
*/
if ((bytes_read= my_read(filedes, buff, buff_size, MYF(0))) == MY_FILE_ERROR)
- return -1;
+ return (off_t) -1;
/* end of file */
if (!bytes_read)
- return -1;
+ return (off_t) -1;
lower_bound= upper_bound;
upper_bound+= bytes_read;
@@ -79,26 +79,24 @@ off_t Transparent_file::read_next()
char Transparent_file::get_value(off_t offset)
{
- off_t bytes_read;
+ size_t bytes_read;
/* check boundaries */
if ((lower_bound <= offset) && (offset < upper_bound))
return buff[offset - lower_bound];
- else
- {
- VOID(my_seek(filedes, offset, MY_SEEK_SET, MYF(0)));
- /* read appropriate portion of the file */
- if ((bytes_read= my_read(filedes, buff, buff_size,
- MYF(0))) == MY_FILE_ERROR)
- return 0;
-
- lower_bound= offset;
- upper_bound= lower_bound + bytes_read;
-
- /* end of file */
- if (upper_bound == offset)
- return 0;
-
- return buff[0];
- }
+
+ VOID(my_seek(filedes, offset, MY_SEEK_SET, MYF(0)));
+ /* read appropriate portion of the file */
+ if ((bytes_read= my_read(filedes, buff, buff_size,
+ MYF(0))) == MY_FILE_ERROR)
+ return 0;
+
+ lower_bound= offset;
+ upper_bound= lower_bound + bytes_read;
+
+ /* end of file */
+ if (upper_bound == offset)
+ return 0;
+
+ return buff[0];
}
diff --git a/storage/csv/transparent_file.h b/storage/csv/transparent_file.h
index ceb59ec7caf..4c0f4cce7e7 100644
--- a/storage/csv/transparent_file.h
+++ b/storage/csv/transparent_file.h
@@ -21,7 +21,7 @@
class Transparent_file
{
File filedes;
- byte *buff; /* in-memory window to the file or mmaped area */
+ uchar *buff; /* in-memory window to the file or mmaped area */
/* current window sizes */
off_t lower_bound;
off_t upper_bound;
@@ -33,7 +33,7 @@ public:
~Transparent_file();
void init_buff(File filedes_arg);
- byte *ptr();
+ uchar *ptr();
off_t start();
off_t end();
char get_value (off_t offset);
diff --git a/storage/example/CMakeLists.txt b/storage/example/CMakeLists.txt
index f4e8639ef25..99c223f3f85 100644
--- a/storage/example/CMakeLists.txt
+++ b/storage/example/CMakeLists.txt
@@ -19,4 +19,9 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/extra/yassl/include)
-ADD_LIBRARY(example ha_example.cc)
+
+SET(EXAMPLE_SOURCES ha_example.cc)
+
+IF(NOT SOURCE_SUBLIBS)
+ ADD_LIBRARY(example ${EXAMPLE_SOURCES})
+ENDIF(NOT SOURCE_SUBLIBS)
diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc
index a4cdcafc6d0..b7186dda676 100644
--- a/storage/example/ha_example.cc
+++ b/storage/example/ha_example.cc
@@ -79,6 +79,10 @@
ha_example::open() would also have been necessary. Calls to
ha_example::extra() are hints as to what will be occuring to the request.
+ A Longer Example can be found called the "Skeleton Engine" which can be
+ found on TangentOrg. It has both an engine and a full build environment
+ for building a pluggable storage engine.
+
Happy coding!<br>
-Brian
*/
@@ -114,11 +118,11 @@ pthread_mutex_t example_mutex;
Function we use in the creation of our hash to get key.
*/
-static byte* example_get_key(EXAMPLE_SHARE *share,uint *length,
+static uchar* example_get_key(EXAMPLE_SHARE *share, size_t *length,
my_bool not_used __attribute__((unused)))
{
*length=share->table_name_length;
- return (byte*) share->table_name;
+ return (uchar*) share->table_name;
}
@@ -132,7 +136,6 @@ static int example_init_func(void *p)
(hash_get_key) example_get_key,0,0);
example_hton->state= SHOW_OPTION_YES;
- example_hton->db_type= DB_TYPE_EXAMPLE_DB;
example_hton->create= example_create_handler;
example_hton->flags= HTON_CAN_RECREATE;
@@ -172,7 +175,7 @@ static EXAMPLE_SHARE *get_share(const char *table_name, TABLE *table)
length=(uint) strlen(table_name);
if (!(share=(EXAMPLE_SHARE*) hash_search(&example_open_tables,
- (byte*) table_name,
+ (uchar*) table_name,
length)))
{
if (!(share=(EXAMPLE_SHARE *)
@@ -189,7 +192,7 @@ static EXAMPLE_SHARE *get_share(const char *table_name, TABLE *table)
share->table_name_length=length;
share->table_name=tmp_name;
strmov(share->table_name,table_name);
- if (my_hash_insert(&example_open_tables, (byte*) share))
+ if (my_hash_insert(&example_open_tables, (uchar*) share))
goto error;
thr_lock_init(&share->lock);
pthread_mutex_init(&share->mutex,MY_MUTEX_INIT_FAST);
@@ -201,7 +204,7 @@ static EXAMPLE_SHARE *get_share(const char *table_name, TABLE *table)
error:
pthread_mutex_destroy(&share->mutex);
- my_free((gptr) share, MYF(0));
+ my_free(share, MYF(0));
return NULL;
}
@@ -218,10 +221,10 @@ static int free_share(EXAMPLE_SHARE *share)
pthread_mutex_lock(&example_mutex);
if (!--share->use_count)
{
- hash_delete(&example_open_tables, (byte*) share);
+ hash_delete(&example_open_tables, (uchar*) share);
thr_lock_delete(&share->lock);
pthread_mutex_destroy(&share->mutex);
- my_free((gptr) share, MYF(0));
+ my_free(share, MYF(0));
}
pthread_mutex_unlock(&example_mutex);
@@ -349,7 +352,7 @@ int ha_example::close(void)
sql_insert.cc, sql_select.cc, sql_table.cc, sql_udf.cc and sql_update.cc
*/
-int ha_example::write_row(byte * buf)
+int ha_example::write_row(uchar *buf)
{
DBUG_ENTER("ha_example::write_row");
DBUG_RETURN(HA_ERR_WRONG_COMMAND);
@@ -378,7 +381,7 @@ int ha_example::write_row(byte * buf)
@see
sql_select.cc, sql_acl.cc, sql_update.cc and sql_insert.cc
*/
-int ha_example::update_row(const byte * old_data, byte * new_data)
+int ha_example::update_row(const uchar *old_data, uchar *new_data)
{
DBUG_ENTER("ha_example::update_row");
@@ -406,7 +409,7 @@ int ha_example::update_row(const byte * old_data, byte * new_data)
sql_acl.cc, sql_udf.cc, sql_delete.cc, sql_insert.cc and sql_select.cc
*/
-int ha_example::delete_row(const byte * buf)
+int ha_example::delete_row(const uchar *buf)
{
DBUG_ENTER("ha_example::delete_row");
DBUG_RETURN(HA_ERR_WRONG_COMMAND);
@@ -420,10 +423,10 @@ int ha_example::delete_row(const byte * buf)
index.
*/
-int ha_example::index_read(byte * buf, const byte * key,
- key_part_map keypart_map __attribute__((unused)),
- enum ha_rkey_function find_flag
- __attribute__((unused)))
+int ha_example::index_read_map(uchar *buf, const uchar *key,
+ key_part_map keypart_map __attribute__((unused)),
+ enum ha_rkey_function find_flag
+ __attribute__((unused)))
{
DBUG_ENTER("ha_example::index_read");
DBUG_RETURN(HA_ERR_WRONG_COMMAND);
@@ -435,7 +438,7 @@ int ha_example::index_read(byte * buf, const byte * key,
Used to read forward through the index.
*/
-int ha_example::index_next(byte * buf)
+int ha_example::index_next(uchar *buf)
{
DBUG_ENTER("ha_example::index_next");
DBUG_RETURN(HA_ERR_WRONG_COMMAND);
@@ -447,7 +450,7 @@ int ha_example::index_next(byte * buf)
Used to read backwards through the index.
*/
-int ha_example::index_prev(byte * buf)
+int ha_example::index_prev(uchar *buf)
{
DBUG_ENTER("ha_example::index_prev");
DBUG_RETURN(HA_ERR_WRONG_COMMAND);
@@ -464,7 +467,7 @@ int ha_example::index_prev(byte * buf)
@see
opt_range.cc, opt_sum.cc, sql_handler.cc and sql_select.cc
*/
-int ha_example::index_first(byte * buf)
+int ha_example::index_first(uchar *buf)
{
DBUG_ENTER("ha_example::index_first");
DBUG_RETURN(HA_ERR_WRONG_COMMAND);
@@ -481,7 +484,7 @@ int ha_example::index_first(byte * buf)
@see
opt_range.cc, opt_sum.cc, sql_handler.cc and sql_select.cc
*/
-int ha_example::index_last(byte * buf)
+int ha_example::index_last(uchar *buf)
{
DBUG_ENTER("ha_example::index_last");
DBUG_RETURN(HA_ERR_WRONG_COMMAND);
@@ -528,7 +531,7 @@ int ha_example::rnd_end()
@see
filesort.cc, records.cc, sql_handler.cc, sql_select.cc, sql_table.cc and sql_update.cc
*/
-int ha_example::rnd_next(byte *buf)
+int ha_example::rnd_next(uchar *buf)
{
DBUG_ENTER("ha_example::rnd_next");
DBUG_RETURN(HA_ERR_END_OF_FILE);
@@ -556,7 +559,7 @@ int ha_example::rnd_next(byte *buf)
@see
filesort.cc, sql_select.cc, sql_delete.cc and sql_update.cc
*/
-void ha_example::position(const byte *record)
+void ha_example::position(const uchar *record)
{
DBUG_ENTER("ha_example::position");
DBUG_VOID_RETURN;
@@ -576,7 +579,7 @@ void ha_example::position(const byte *record)
@see
filesort.cc, records.cc, sql_insert.cc, sql_select.cc and sql_update.cc
*/
-int ha_example::rnd_pos(byte * buf, byte *pos)
+int ha_example::rnd_pos(uchar *buf, uchar *pos)
{
DBUG_ENTER("ha_example::rnd_pos");
DBUG_RETURN(HA_ERR_WRONG_COMMAND);
@@ -723,6 +726,11 @@ int ha_example::external_lock(THD *thd, int lock_type)
Called from lock.cc by get_lock_data().
+ @note
+ In this method one should NEVER rely on table->in_use, it may, in fact,
+ refer to a different thread! (this happens if get_lock_data() is called
+ from mysql_lock_abort_for_thread() function)
+
@see
get_lock_data() in lock.cc
*/
diff --git a/storage/example/ha_example.h b/storage/example/ha_example.h
index 9777a478209..ec3987ced5d 100644
--- a/storage/example/ha_example.h
+++ b/storage/example/ha_example.h
@@ -82,7 +82,12 @@ public:
*/
ulonglong table_flags() const
{
- return 0;
+ /*
+ We are saying that this engine is just row capable to have an
+ engine that can only handle row-based logging. This is used in
+ testing.
+ */
+ return HA_BINLOG_ROW_CAPABLE;
}
/** @brief
@@ -172,50 +177,50 @@ public:
We implement this in ha_example.cc. It's not an obligatory method;
skip it and and MySQL will treat it as not implemented.
*/
- int write_row(byte * buf);
+ int write_row(uchar *buf);
/** @brief
We implement this in ha_example.cc. It's not an obligatory method;
skip it and and MySQL will treat it as not implemented.
*/
- int update_row(const byte * old_data, byte * new_data);
+ int update_row(const uchar *old_data, uchar *new_data);
/** @brief
We implement this in ha_example.cc. It's not an obligatory method;
skip it and and MySQL will treat it as not implemented.
*/
- int delete_row(const byte * buf);
+ int delete_row(const uchar *buf);
/** @brief
We implement this in ha_example.cc. It's not an obligatory method;
skip it and and MySQL will treat it as not implemented.
*/
- int index_read(byte * buf, const byte * key,
- key_part_map keypart_map, enum ha_rkey_function find_flag);
+ int index_read_map(uchar *buf, const uchar *key,
+ key_part_map keypart_map, enum ha_rkey_function find_flag);
/** @brief
We implement this in ha_example.cc. It's not an obligatory method;
skip it and and MySQL will treat it as not implemented.
*/
- int index_next(byte * buf);
+ int index_next(uchar *buf);
/** @brief
We implement this in ha_example.cc. It's not an obligatory method;
skip it and and MySQL will treat it as not implemented.
*/
- int index_prev(byte * buf);
+ int index_prev(uchar *buf);
/** @brief
We implement this in ha_example.cc. It's not an obligatory method;
skip it and and MySQL will treat it as not implemented.
*/
- int index_first(byte * buf);
+ int index_first(uchar *buf);
/** @brief
We implement this in ha_example.cc. It's not an obligatory method;
skip it and and MySQL will treat it as not implemented.
*/
- int index_last(byte * buf);
+ int index_last(uchar *buf);
/** @brief
Unlike index_init(), rnd_init() can be called two consecutive times
@@ -227,9 +232,9 @@ public:
*/
int rnd_init(bool scan); //required
int rnd_end();
- int rnd_next(byte *buf); ///< required
- int rnd_pos(byte * buf, byte *pos); ///< required
- void position(const byte *record); ///< required
+ int rnd_next(uchar *buf); ///< required
+ int rnd_pos(uchar *buf, uchar *pos); ///< required
+ void position(const uchar *record); ///< required
int info(uint); ///< required
int extra(enum ha_extra_function operation);
int external_lock(THD *thd, int lock_type); ///< required
diff --git a/storage/example/plug.in b/storage/example/plug.in
index ba35b1ea117..ee6beaac64f 100644
--- a/storage/example/plug.in
+++ b/storage/example/plug.in
@@ -1,3 +1,3 @@
MYSQL_STORAGE_ENGINE(example,, [Example Storage Engine],
- [Skeleton for Storage Engines for developers], [max,max-no-ndb])
+ [Example for Storage Engines for developers], [max,max-no-ndb])
MYSQL_PLUGIN_DYNAMIC(example, [ha_example.la])
diff --git a/storage/federated/CMakeLists.txt b/storage/federated/CMakeLists.txt
index 1f1f4dcd517..62064a633b1 100644
--- a/storage/federated/CMakeLists.txt
+++ b/storage/federated/CMakeLists.txt
@@ -19,4 +19,9 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/extra/yassl/include)
-ADD_LIBRARY(federated ha_federated.cc)
+
+SET(FEDERATED_SOURCES ha_federated.cc)
+
+IF(NOT SOURCE_SUBLIBS)
+ ADD_LIBRARY(federated ${FEDERATED_SOURCES})
+ENDIF(NOT SOURCE_SUBLIBS)
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc
index aa7184268f5..3fc17e18e76 100644
--- a/storage/federated/ha_federated.cc
+++ b/storage/federated/ha_federated.cc
@@ -388,6 +388,11 @@
/* Variables for federated share methods */
static HASH federated_open_tables; // To track open tables
pthread_mutex_t federated_mutex; // To init the hash
+static char ident_quote_char= '`'; // Character for quoting
+ // identifiers
+static char value_quote_char= '\''; // Character for quoting
+ // literals
+static const int bulk_padding= 64; // bytes "overhead" in packet
/* Variables used when chopping off trailing characters */
static const uint sizeof_trailing_comma= sizeof(", ") - 1;
@@ -414,11 +419,11 @@ static handler *federated_create_handler(handlerton *hton,
/* Function we use in the creation of our hash to get key */
-static byte *federated_get_key(FEDERATED_SHARE *share, uint *length,
- my_bool not_used __attribute__ ((unused)))
+static uchar *federated_get_key(FEDERATED_SHARE *share, size_t *length,
+ my_bool not_used __attribute__ ((unused)))
{
*length= share->share_key_length;
- return (byte*) share->share_key;
+ return (uchar*) share->share_key;
}
/*
@@ -444,6 +449,13 @@ int federated_db_init(void *p)
federated_hton->create= federated_create_handler;
federated_hton->flags= HTON_ALTER_NOT_SUPPORTED | HTON_NO_PARTITION;
+ /*
+ Support for transactions disabled until WL#2952 fixes it.
+ We do it like this to avoid "defined but not used" compiler warnings.
+ */
+ federated_hton->commit= 0;
+ federated_hton->rollback= 0;
+
if (pthread_mutex_init(&federated_mutex, MY_MUTEX_INIT_FAST))
goto error;
if (!hash_init(&federated_open_tables, &my_charset_bin, 32, 0, 0,
@@ -477,105 +489,54 @@ int federated_done(void *p)
}
-/*
- Check (in create) whether the tables exists, and that it can be connected to
+/**
+ @brief Append identifiers to the string.
- SYNOPSIS
- check_foreign_data_source()
- share pointer to FEDERATED share
- table_create_flag tells us that ::create is the caller,
- therefore, return CANT_CREATE_FEDERATED_TABLE
+ @param[in,out] string The target string.
+ @param[in] name Identifier name
+ @param[in] length Length of identifier name in bytes
+ @param[in] quote_char Quote char to use for quoting identifier.
- DESCRIPTION
- This method first checks that the connection information that parse url
- has populated into the share will be sufficient to connect to the foreign
- table, and if so, does the foreign table exist.
+ @return Operation Status
+ @retval FALSE OK
+ @retval TRUE There was an error appending to the string.
+
+ @note This function is based upon the append_identifier() function
+ in sql_show.cc except that quoting always occurs.
*/
-static int check_foreign_data_source(FEDERATED_SHARE *share,
- bool table_create_flag)
+static bool append_ident(String *string, const char *name, uint length,
+ const char quote_char)
{
- char escaped_table_name[NAME_LEN*2];
- char query_buffer[FEDERATED_QUERY_BUFFER_SIZE];
- char error_buffer[FEDERATED_QUERY_BUFFER_SIZE];
- uint error_code;
- String query(query_buffer, sizeof(query_buffer), &my_charset_bin);
- MYSQL *mysql;
- DBUG_ENTER("ha_federated::check_foreign_data_source");
-
- /* Zero the length, otherwise the string will have misc chars */
- query.length(0);
+ bool result;
+ uint clen;
+ const char *name_end;
+ DBUG_ENTER("append_ident");
- /* error out if we can't alloc memory for mysql_init(NULL) (per Georg) */
- if (!(mysql= mysql_init(NULL)))
- DBUG_RETURN(HA_ERR_OUT_OF_MEM);
- /* check if we can connect */
- if (!mysql_real_connect(mysql,
- share->hostname,
- share->username,
- share->password,
- share->database,
- share->port,
- share->socket, 0))
- {
- /*
- we want the correct error message, but it to return
- ER_CANT_CREATE_FEDERATED_TABLE if called by ::create
- */
- error_code= (table_create_flag ?
- ER_CANT_CREATE_FEDERATED_TABLE :
- ER_CONNECT_TO_FOREIGN_DATA_SOURCE);
-
- my_sprintf(error_buffer,
- (error_buffer,
- "database: '%s' username: '%s' hostname: '%s'",
- share->database, share->username, share->hostname));
-
- my_error(ER_CONNECT_TO_FOREIGN_DATA_SOURCE, MYF(0), error_buffer);
- goto error;
- }
- else
+ if (quote_char)
{
- int escaped_table_name_length= 0;
- /*
- Since we do not support transactions at this version, we can let the
- client API silently reconnect. For future versions, we will need more
- logic to deal with transactions
- */
- mysql->reconnect= 1;
- /*
- Note: I am not using INORMATION_SCHEMA because this needs to work with
- versions prior to 5.0
-
- if we can connect, then make sure the table exists
+ string->reserve(length * 2 + 2);
+ if ((result= string->append(&quote_char, 1, system_charset_info)))
+ goto err;
- the query will be: SELECT * FROM `tablename` WHERE 1=0
- */
- query.append(STRING_WITH_LEN("SELECT * FROM `"));
- escaped_table_name_length=
- escape_string_for_mysql(&my_charset_bin, (char*)escaped_table_name,
- sizeof(escaped_table_name),
- share->table_name,
- share->table_name_length);
- query.append(escaped_table_name, escaped_table_name_length);
- query.append(STRING_WITH_LEN("` WHERE 1=0"));
-
- if (mysql_real_query(mysql, query.ptr(), query.length()))
+ for (name_end= name+length; name < name_end; name+= clen)
{
- error_code= table_create_flag ?
- ER_CANT_CREATE_FEDERATED_TABLE : ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST;
- my_sprintf(error_buffer, (error_buffer, "error: %d '%s'",
- mysql_errno(mysql), mysql_error(mysql)));
-
- my_error(error_code, MYF(0), error_buffer);
- goto error;
+ uchar c= *(uchar *) name;
+ if (!(clen= my_mbcharlen(system_charset_info, c)))
+ clen= 1;
+ if (clen == 1 && c == (uchar) quote_char &&
+ (result= string->append(&quote_char, 1, system_charset_info)))
+ goto err;
+ if ((result= string->append(name, clen, string->charset())))
+ goto err;
}
+ result= string->append(&quote_char, 1, system_charset_info);
}
- error_code=0;
+ else
+ result= string->append(name, length, system_charset_info);
-error:
- mysql_close(mysql);
- DBUG_RETURN(error_code);
+err:
+ DBUG_RETURN(result);
}
@@ -725,8 +686,8 @@ static int parse_url(MEM_ROOT *mem_root, FEDERATED_SHARE *share, TABLE *table,
share->port= 0;
share->socket= 0;
DBUG_PRINT("info", ("share at %lx", (long unsigned int) share));
- DBUG_PRINT("info", ("Length: %d", table->s->connect_string.length));
- DBUG_PRINT("info", ("String: '%.*s'", table->s->connect_string.length,
+ DBUG_PRINT("info", ("Length: %u", (uint) table->s->connect_string.length));
+ DBUG_PRINT("info", ("String: '%.*s'", (int) table->s->connect_string.length,
table->s->connect_string.str));
share->connection_string= strmake_root(mem_root, table->s->connect_string.str,
table->s->connect_string.length);
@@ -907,6 +868,7 @@ ha_federated::ha_federated(handlerton *hton,
mysql(0), stored_result(0)
{
trx_next= 0;
+ bzero(&bulk_insert, sizeof(bulk_insert));
}
@@ -930,7 +892,7 @@ ha_federated::ha_federated(handlerton *hton,
0 After fields have had field values stored from record
*/
-uint ha_federated::convert_row_to_internal_format(byte *record,
+uint ha_federated::convert_row_to_internal_format(uchar *record,
MYSQL_ROW row,
MYSQL_RES *result)
{
@@ -969,16 +931,15 @@ uint ha_federated::convert_row_to_internal_format(byte *record,
static bool emit_key_part_name(String *to, KEY_PART_INFO *part)
{
DBUG_ENTER("emit_key_part_name");
- if (to->append(STRING_WITH_LEN("`")) ||
- to->append(part->field->field_name) ||
- to->append(STRING_WITH_LEN("`")))
+ if (append_ident(to, part->field->field_name,
+ strlen(part->field->field_name), ident_quote_char))
DBUG_RETURN(1); // Out of memory
DBUG_RETURN(0);
}
static bool emit_key_part_element(String *to, KEY_PART_INFO *part,
bool needs_quotes, bool is_like,
- const byte *ptr, uint len)
+ const uchar *ptr, uint len)
{
Field *field= part->field;
DBUG_ENTER("emit_key_part_element");
@@ -1019,7 +980,7 @@ static bool emit_key_part_element(String *to, KEY_PART_INFO *part,
char strbuff[MAX_FIELD_WIDTH];
String str(strbuff, sizeof(strbuff), part->field->charset()), *res;
- res= field->val_str(&str, (char *)ptr);
+ res= field->val_str(&str, ptr);
if (field->result_type() == STRING_RESULT)
{
@@ -1286,7 +1247,7 @@ bool ha_federated::create_where_from_key(String *to,
{
bool both_not_null=
(start_key != NULL && end_key != NULL) ? TRUE : FALSE;
- const byte *ptr;
+ const uchar *ptr;
uint remainder, length;
char tmpbuff[FEDERATED_QUERY_BUFFER_SIZE];
String tmp(tmpbuff, sizeof(tmpbuff), system_charset_info);
@@ -1325,7 +1286,7 @@ bool ha_federated::create_where_from_key(String *to,
uint store_length= key_part->store_length;
uint part_length= min(store_length, length);
needs_quotes= field->str_needs_quotes();
- DBUG_DUMP("key, start of loop", (char *) ptr, length);
+ DBUG_DUMP("key, start of loop", ptr, length);
if (key_part->null_bit)
{
@@ -1507,7 +1468,7 @@ static FEDERATED_SHARE *get_share(const char *table_name, TABLE *table)
/* TODO: change tmp_share.scheme to LEX_STRING object */
if (!(share= (FEDERATED_SHARE *) hash_search(&federated_open_tables,
- (byte*) tmp_share.share_key,
+ (uchar*) tmp_share.share_key,
tmp_share.
share_key_length)))
{
@@ -1515,20 +1476,20 @@ static FEDERATED_SHARE *get_share(const char *table_name, TABLE *table)
query.append(STRING_WITH_LEN("SELECT "));
for (field= table->field; *field; field++)
{
- query.append(STRING_WITH_LEN("`"));
- query.append((*field)->field_name);
- query.append(STRING_WITH_LEN("`, "));
+ append_ident(&query, (*field)->field_name,
+ strlen((*field)->field_name), ident_quote_char);
+ query.append(STRING_WITH_LEN(", "));
}
/* chops off trailing comma */
query.length(query.length() - sizeof_trailing_comma);
- query.append(STRING_WITH_LEN(" FROM `"));
- query.append(tmp_share.table_name, tmp_share.table_name_length);
- query.append(STRING_WITH_LEN("`"));
- DBUG_PRINT("info", ("calling alloc_root"));
+ query.append(STRING_WITH_LEN(" FROM "));
+
+ append_ident(&query, tmp_share.table_name,
+ tmp_share.table_name_length, ident_quote_char);
if (!(share= (FEDERATED_SHARE *) memdup_root(&mem_root, (char*)&tmp_share, sizeof(*share))) ||
- !(share->select_query= (char*) strmake_root(&mem_root, query.ptr(), query.length())))
+ !(share->select_query= (char*) strmake_root(&mem_root, query.ptr(), query.length() + 1)))
goto error;
share->use_count= 0;
@@ -1537,7 +1498,7 @@ static FEDERATED_SHARE *get_share(const char *table_name, TABLE *table)
DBUG_PRINT("info",
("share->select_query %s", share->select_query));
- if (my_hash_insert(&federated_open_tables, (byte*) share))
+ if (my_hash_insert(&federated_open_tables, (uchar*) share))
goto error;
thr_lock_init(&share->lock);
pthread_mutex_init(&share->mutex, MY_MUTEX_INIT_FAST);
@@ -1571,7 +1532,7 @@ static int free_share(FEDERATED_SHARE *share)
pthread_mutex_lock(&federated_mutex);
if (!--share->use_count)
{
- hash_delete(&federated_open_tables, (byte*) share);
+ hash_delete(&federated_open_tables, (uchar*) share);
thr_lock_delete(&share->lock);
VOID(pthread_mutex_destroy(&share->mutex));
free_root(&mem_root, MYF(0));
@@ -1631,44 +1592,15 @@ int ha_federated::open(const char *name, int mode, uint test_if_locked)
DBUG_RETURN(1);
thr_lock_data_init(&share->lock, &lock, NULL);
- /* Connect to foreign database mysql_real_connect() */
- mysql= mysql_init(0);
-
- /*
- BUG# 17044 Federated Storage Engine is not UTF8 clean
- Add set names to whatever charset the table is at open
- of table
- */
- /* this sets the csname like 'set names utf8' */
- mysql_options(mysql,MYSQL_SET_CHARSET_NAME,
- this->table->s->table_charset->csname);
-
- DBUG_PRINT("info", ("calling mysql_real_connect hostname %s user %s",
- share->hostname, share->username));
- if (!mysql || !mysql_real_connect(mysql,
- share->hostname,
- share->username,
- share->password,
- share->database,
- share->port,
- share->socket, 0))
- {
- free_share(share);
- DBUG_RETURN(stash_remote_error());
- }
- /*
- Since we do not support transactions at this version, we can let the client
- API silently reconnect. For future versions, we will need more logic to
- deal with transactions
- */
-
- mysql->reconnect= 1;
+ DBUG_ASSERT(mysql == NULL);
ref_length= (table->s->primary_key != MAX_KEY ?
table->key_info[table->s->primary_key].key_length :
table->s->reclength);
DBUG_PRINT("info", ("ref_length: %u", ref_length));
+ reset();
+
DBUG_RETURN(0);
}
@@ -1696,8 +1628,8 @@ int ha_federated::close(void)
stored_result= 0;
}
/* Disconnect from mysql */
- if (mysql) // QQ is this really needed
- mysql_close(mysql);
+ mysql_close(mysql);
+ mysql= NULL;
retval= free_share(share);
DBUG_RETURN(retval);
@@ -1741,85 +1673,106 @@ static inline uint field_in_record_is_null(TABLE *table,
}
-/*
- write_row() inserts a row. No extra() hint is given currently if a bulk load
- is happeneding. buf() is a byte array of data. You can use the field
- information to extract the data from the native byte array type.
- Example of this would be:
- for (Field **field=table->field ; *field ; field++)
- {
- ...
- }
-
- Called from item_sum.cc, item_sum.cc, sql_acl.cc, sql_insert.cc,
- sql_insert.cc, sql_select.cc, sql_table.cc, sql_udf.cc, and sql_update.cc.
+/**
+ @brief Construct the INSERT statement.
+
+ @details This method will construct the INSERT statement and appends it to
+ the supplied query string buffer.
+
+ @return
+ @retval FALSE No error
+ @retval TRUE Failure
*/
-int ha_federated::write_row(byte *buf)
+bool ha_federated::append_stmt_insert(String *query)
{
- /*
- I need a bool again, in 5.0, I used table->s->fields to accomplish this.
- This worked as a flag that says there are fields with values or not.
- In 5.1, this value doesn't work the same, and I end up with the code
- truncating open parenthesis:
-
- the statement "INSERT INTO t1 VALUES ()" ends up being first built
- in two strings
- "INSERT INTO t1 ("
- and
- " VALUES ("
-
- If there are fields with values, they get appended, with commas, and
- the last loop, a trailing comma is there
-
- "INSERT INTO t1 ( col1, col2, colN, "
-
- " VALUES ( 'val1', 'val2', 'valN', "
-
- Then, if there are fields, it should decrement the string by ", " length.
-
- "INSERT INTO t1 ( col1, col2, colN"
- " VALUES ( 'val1', 'val2', 'valN'"
+ char insert_buffer[FEDERATED_QUERY_BUFFER_SIZE];
+ Field **field;
+ uint tmp_length;
+ bool added_field= FALSE;
- Then it adds a close paren to both - if there are fields
+ /* The main insert query string */
+ String insert_string(insert_buffer, sizeof(insert_buffer), &my_charset_bin);
+ DBUG_ENTER("ha_federated::append_stmt_insert");
- "INSERT INTO t1 ( col1, col2, colN)"
- " VALUES ( 'val1', 'val2', 'valN')"
+ insert_string.length(0);
- Then appends both together
- "INSERT INTO t1 ( col1, col2, colN) VALUES ( 'val1', 'val2', 'valN')"
+ if (replace_duplicates)
+ insert_string.append(STRING_WITH_LEN("REPLACE INTO "));
+ else if (ignore_duplicates && !insert_dup_update)
+ insert_string.append(STRING_WITH_LEN("INSERT IGNORE INTO "));
+ else
+ insert_string.append(STRING_WITH_LEN("INSERT INTO "));
+ append_ident(&insert_string, share->table_name, share->table_name_length,
+ ident_quote_char);
+ tmp_length= insert_string.length();
+ insert_string.append(STRING_WITH_LEN(" ("));
- So... the problem, is if you have the original statement:
+ /*
+ loop through the field pointer array, add any fields to both the values
+ list and the fields list that match the current query id
+ */
+ for (field= table->field; *field; field++)
+ {
+ if (bitmap_is_set(table->write_set, (*field)->field_index))
+ {
+ /* append the field name */
+ append_ident(&insert_string, (*field)->field_name,
+ strlen((*field)->field_name), ident_quote_char);
- "INSERT INTO t1 VALUES ()"
+ /* append commas between both fields and fieldnames */
+ /*
+ unfortunately, we can't use the logic if *(fields + 1) to
+ make the following appends conditional as we don't know if the
+ next field is in the write set
+ */
+ insert_string.append(STRING_WITH_LEN(", "));
+ added_field= TRUE;
+ }
+ }
- Which is legitimate, but if the code thinks there are fields
+ if (added_field)
+ {
+ /* Remove trailing comma. */
+ insert_string.length(insert_string.length() - sizeof_trailing_comma);
+ insert_string.append(STRING_WITH_LEN(") "));
+ }
+ else
+ {
+ /* If there were no fields, we don't want to add a closing paren. */
+ insert_string.length(tmp_length);
+ }
- "INSERT INTO t1 ("
- " VALUES ( "
+ insert_string.append(STRING_WITH_LEN(" VALUES "));
- If the field flag is set, but there are no commas, reduces the
- string by strlen(", ")
+ DBUG_RETURN(query->append(insert_string));
+}
- "INSERT INTO t1 "
- " VALUES "
- Then adds the close parenthesis
+/*
+ write_row() inserts a row. No extra() hint is given currently if a bulk load
+ is happeneding. buf() is a byte array of data. You can use the field
+ information to extract the data from the native byte array type.
+ Example of this would be:
+ for (Field **field=table->field ; *field ; field++)
+ {
+ ...
+ }
- "INSERT INTO t1 )"
- " VALUES )"
+ Called from item_sum.cc, item_sum.cc, sql_acl.cc, sql_insert.cc,
+ sql_insert.cc, sql_select.cc, sql_table.cc, sql_udf.cc, and sql_update.cc.
+*/
- So, I have to use a bool as before, set in the loop where fields and commas
- are appended to the string
- */
- my_bool commas_added= FALSE;
- char insert_buffer[FEDERATED_QUERY_BUFFER_SIZE];
+int ha_federated::write_row(uchar *buf)
+{
char values_buffer[FEDERATED_QUERY_BUFFER_SIZE];
char insert_field_value_buffer[STRING_BUFFER_USUAL_SIZE];
Field **field;
+ uint tmp_length;
+ int error= 0;
+ bool use_bulk_insert;
+ bool auto_increment_update_required= (table->next_number_field != NULL);
- /* The main insert query string */
- String insert_string(insert_buffer, sizeof(insert_buffer), &my_charset_bin);
/* The string containing the values to be added to the insert */
String values_string(values_buffer, sizeof(values_buffer), &my_charset_bin);
/* The actual value of the field, to be added to the values_string */
@@ -1830,22 +1783,26 @@ int ha_federated::write_row(byte *buf)
DBUG_ENTER("ha_federated::write_row");
values_string.length(0);
- insert_string.length(0);
insert_field_value_string.length(0);
- statistic_increment(table->in_use->status_var.ha_write_count, &LOCK_status);
+ ha_statistic_increment(&SSV::ha_write_count);
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
table->timestamp_field->set_time();
/*
start both our field and field values strings
+ We must disable multi-row insert for "INSERT...ON DUPLICATE KEY UPDATE"
+ Ignore duplicates is always true when insert_dup_update is true.
+ When replace_duplicates == TRUE, we can safely enable multi-row insert.
+ When performing multi-row insert, we only collect the columns values for
+ the row. The start of the statement is only created when the first
+ row is copied in to the bulk_insert string.
*/
- insert_string.append(STRING_WITH_LEN("INSERT INTO `"));
- insert_string.append(share->table_name, share->table_name_length);
- insert_string.append('`');
- insert_string.append(STRING_WITH_LEN(" ("));
+ if (!(use_bulk_insert= bulk_insert.str &&
+ (!insert_dup_update || replace_duplicates)))
+ append_stmt_insert(&values_string);
- values_string.append(STRING_WITH_LEN(" VALUES "));
values_string.append(STRING_WITH_LEN(" ("));
+ tmp_length= values_string.length();
/*
loop through the field pointer array, add any fields to both the values
@@ -1855,7 +1812,6 @@ int ha_federated::write_row(byte *buf)
{
if (bitmap_is_set(table->write_set, (*field)->field_index))
{
- commas_added= TRUE;
if ((*field)->is_null())
values_string.append(STRING_WITH_LEN(" NULL "));
else
@@ -1863,15 +1819,13 @@ int ha_federated::write_row(byte *buf)
bool needs_quote= (*field)->str_needs_quotes();
(*field)->val_str(&insert_field_value_string);
if (needs_quote)
- values_string.append('\'');
+ values_string.append(value_quote_char);
insert_field_value_string.print(&values_string);
if (needs_quote)
- values_string.append('\'');
+ values_string.append(value_quote_char);
insert_field_value_string.length(0);
}
- /* append the field name */
- insert_string.append((*field)->field_name);
/* append commas between both fields and fieldnames */
/*
@@ -1879,7 +1833,6 @@ int ha_federated::write_row(byte *buf)
make the following appends conditional as we don't know if the
next field is in the write set
*/
- insert_string.append(STRING_WITH_LEN(", "));
values_string.append(STRING_WITH_LEN(", "));
}
}
@@ -1890,26 +1843,52 @@ int ha_federated::write_row(byte *buf)
AND, we don't want to chop off the last char '('
insert will be "INSERT INTO t1 VALUES ();"
*/
- if (commas_added)
+ if (values_string.length() > tmp_length)
{
- insert_string.length(insert_string.length() - sizeof_trailing_comma);
- /* chops off leading commas */
+ /* chops off trailing comma */
values_string.length(values_string.length() - sizeof_trailing_comma);
- insert_string.append(STRING_WITH_LEN(") "));
- }
- else
- {
- /* chops off trailing ) */
- insert_string.length(insert_string.length() - sizeof_trailing_closeparen);
}
-
/* we always want to append this, even if there aren't any fields */
values_string.append(STRING_WITH_LEN(") "));
- /* add the values */
- insert_string.append(values_string);
+ if (use_bulk_insert)
+ {
+ /*
+ Send the current bulk insert out if appending the current row would
+ cause the statement to overflow the packet size, otherwise set
+ auto_increment_update_required to FALSE as no query was executed.
+ */
+ if (bulk_insert.length + values_string.length() + bulk_padding >
+ mysql->net.max_packet_size && bulk_insert.length)
+ {
+ error= real_query(bulk_insert.str, bulk_insert.length);
+ bulk_insert.length= 0;
+ }
+ else
+ auto_increment_update_required= FALSE;
+
+ if (bulk_insert.length == 0)
+ {
+ char insert_buffer[FEDERATED_QUERY_BUFFER_SIZE];
+ String insert_string(insert_buffer, sizeof(insert_buffer),
+ &my_charset_bin);
+ insert_string.length(0);
+ append_stmt_insert(&insert_string);
+ dynstr_append_mem(&bulk_insert, insert_string.ptr(),
+ insert_string.length());
+ }
+ else
+ dynstr_append_mem(&bulk_insert, ",", 1);
- if (mysql_real_query(mysql, insert_string.ptr(), insert_string.length()))
+ dynstr_append_mem(&bulk_insert, values_string.ptr(),
+ values_string.length());
+ }
+ else
+ {
+ error= real_query(values_string.ptr(), values_string.length());
+ }
+
+ if (error)
{
DBUG_RETURN(stash_remote_error());
}
@@ -1917,12 +1896,91 @@ int ha_federated::write_row(byte *buf)
If the table we've just written a record to contains an auto_increment
field, then store the last_insert_id() value from the foreign server
*/
- if (table->next_number_field)
+ if (auto_increment_update_required)
+ {
update_auto_increment();
+ /* mysql_insert() uses this for protocol return value */
+ table->next_number_field->store(stats.auto_increment_value, 1);
+ }
+
DBUG_RETURN(0);
}
+
+/**
+ @brief Prepares the storage engine for bulk inserts.
+
+ @param[in] rows estimated number of rows in bulk insert
+ or 0 if unknown.
+
+ @details Initializes memory structures required for bulk insert.
+*/
+
+void ha_federated::start_bulk_insert(ha_rows rows)
+{
+ uint page_size;
+ DBUG_ENTER("ha_federated::start_bulk_insert");
+
+ dynstr_free(&bulk_insert);
+
+ /**
+ We don't bother with bulk-insert semantics when the estimated rows == 1
+ The rows value will be 0 if the server does not know how many rows
+ would be inserted. This can occur when performing INSERT...SELECT
+ */
+
+ if (rows == 1)
+ DBUG_VOID_RETURN;
+
+ /*
+ Make sure we have an open connection so that we know the
+ maximum packet size.
+ */
+ if (!mysql && real_connect())
+ DBUG_VOID_RETURN;
+
+ page_size= (uint) my_getpagesize();
+
+ if (init_dynamic_string(&bulk_insert, NULL, page_size, page_size))
+ DBUG_VOID_RETURN;
+
+ bulk_insert.length= 0;
+ DBUG_VOID_RETURN;
+}
+
+
+/**
+ @brief End bulk insert.
+
+ @details This method will send any remaining rows to the remote server.
+ Finally, it will deinitialize the bulk insert data structure.
+
+ @return Operation status
+ @retval 0 No error
+ @retval != 0 Error occured at remote server. Also sets my_errno.
+*/
+
+int ha_federated::end_bulk_insert()
+{
+ int error= 0;
+ DBUG_ENTER("ha_federated::end_bulk_insert");
+
+ if (bulk_insert.str && bulk_insert.length)
+ {
+ if (real_query(bulk_insert.str, bulk_insert.length))
+ error= stash_remote_error();
+ else
+ if (table->next_number_field)
+ update_auto_increment();
+ }
+
+ dynstr_free(&bulk_insert);
+
+ DBUG_RETURN(my_errno= error);
+}
+
+
/*
ha_federated::update_auto_increment
@@ -1936,8 +1994,9 @@ void ha_federated::update_auto_increment(void)
THD *thd= current_thd;
DBUG_ENTER("ha_federated::update_auto_increment");
+ ha_federated::info(HA_STATUS_AUTO);
thd->first_successful_insert_id_in_cur_stmt=
- mysql->last_used_con->insert_id;
+ stats.auto_increment_value;
DBUG_PRINT("info",("last_insert_id: %ld", (long) stats.auto_increment_value));
DBUG_VOID_RETURN;
@@ -1952,11 +2011,11 @@ int ha_federated::optimize(THD* thd, HA_CHECK_OPT* check_opt)
query.length(0);
query.set_charset(system_charset_info);
- query.append(STRING_WITH_LEN("OPTIMIZE TABLE `"));
- query.append(share->table_name, share->table_name_length);
- query.append(STRING_WITH_LEN("`"));
+ query.append(STRING_WITH_LEN("OPTIMIZE TABLE "));
+ append_ident(&query, share->table_name, share->table_name_length,
+ ident_quote_char);
- if (mysql_real_query(mysql, query.ptr(), query.length()))
+ if (real_query(query.ptr(), query.length()))
{
DBUG_RETURN(stash_remote_error());
}
@@ -1974,9 +2033,9 @@ int ha_federated::repair(THD* thd, HA_CHECK_OPT* check_opt)
query.length(0);
query.set_charset(system_charset_info);
- query.append(STRING_WITH_LEN("REPAIR TABLE `"));
- query.append(share->table_name, share->table_name_length);
- query.append(STRING_WITH_LEN("`"));
+ query.append(STRING_WITH_LEN("REPAIR TABLE "));
+ append_ident(&query, share->table_name, share->table_name_length,
+ ident_quote_char);
if (check_opt->flags & T_QUICK)
query.append(STRING_WITH_LEN(" QUICK"));
if (check_opt->flags & T_EXTEND)
@@ -1984,7 +2043,7 @@ int ha_federated::repair(THD* thd, HA_CHECK_OPT* check_opt)
if (check_opt->sql_flags & TT_USEFRM)
query.append(STRING_WITH_LEN(" USE_FRM"));
- if (mysql_real_query(mysql, query.ptr(), query.length()))
+ if (real_query(query.ptr(), query.length()))
{
DBUG_RETURN(stash_remote_error());
}
@@ -2010,7 +2069,7 @@ int ha_federated::repair(THD* thd, HA_CHECK_OPT* check_opt)
Called from sql_select.cc, sql_acl.cc, sql_update.cc, and sql_insert.cc.
*/
-int ha_federated::update_row(const byte *old_data, byte *new_data)
+int ha_federated::update_row(const uchar *old_data, uchar *new_data)
{
/*
This used to control how the query was built. If there was a
@@ -2044,7 +2103,7 @@ int ha_federated::update_row(const byte *old_data, byte *new_data)
String where_string(where_buffer,
sizeof(where_buffer),
&my_charset_bin);
- byte *record= table->record[0];
+ uchar *record= table->record[0];
DBUG_ENTER("ha_federated::update_row");
/*
set string lengths to 0 to avoid misc chars in string
@@ -2053,9 +2112,13 @@ int ha_federated::update_row(const byte *old_data, byte *new_data)
update_string.length(0);
where_string.length(0);
- update_string.append(STRING_WITH_LEN("UPDATE `"));
- update_string.append(share->table_name);
- update_string.append(STRING_WITH_LEN("` SET "));
+ if (ignore_duplicates)
+ update_string.append(STRING_WITH_LEN("UPDATE IGNORE "));
+ else
+ update_string.append(STRING_WITH_LEN("UPDATE "));
+ append_ident(&update_string, share->table_name,
+ share->table_name_length, ident_quote_char);
+ update_string.append(STRING_WITH_LEN(" SET "));
/*
In this loop, we want to match column names to values being inserted
@@ -2071,7 +2134,9 @@ int ha_federated::update_row(const byte *old_data, byte *new_data)
{
if (bitmap_is_set(table->write_set, (*field)->field_index))
{
- update_string.append((*field)->field_name);
+ uint field_name_length= strlen((*field)->field_name);
+ append_ident(&update_string, (*field)->field_name, field_name_length,
+ ident_quote_char);
update_string.append(STRING_WITH_LEN(" = "));
if ((*field)->is_null())
@@ -2083,10 +2148,10 @@ int ha_federated::update_row(const byte *old_data, byte *new_data)
bool needs_quote= (*field)->str_needs_quotes();
(*field)->val_str(&field_value);
if (needs_quote)
- update_string.append('\'');
+ update_string.append(value_quote_char);
field_value.print(&update_string);
if (needs_quote)
- update_string.append('\'');
+ update_string.append(value_quote_char);
field_value.length(0);
tmp_restore_column_map(table->read_set, old_map);
}
@@ -2095,7 +2160,9 @@ int ha_federated::update_row(const byte *old_data, byte *new_data)
if (bitmap_is_set(table->read_set, (*field)->field_index))
{
- where_string.append((*field)->field_name);
+ uint field_name_length= strlen((*field)->field_name);
+ append_ident(&where_string, (*field)->field_name, field_name_length,
+ ident_quote_char);
if (field_in_record_is_null(table, *field, (char*) old_data))
where_string.append(STRING_WITH_LEN(" IS NULL "));
else
@@ -2103,12 +2170,12 @@ int ha_federated::update_row(const byte *old_data, byte *new_data)
bool needs_quote= (*field)->str_needs_quotes();
where_string.append(STRING_WITH_LEN(" = "));
(*field)->val_str(&field_value,
- (char*) (old_data + (*field)->offset(record)));
+ (old_data + (*field)->offset(record)));
if (needs_quote)
- where_string.append('\'');
+ where_string.append(value_quote_char);
field_value.print(&where_string);
if (needs_quote)
- where_string.append('\'');
+ where_string.append(value_quote_char);
field_value.length(0);
}
where_string.append(STRING_WITH_LEN(" AND "));
@@ -2133,7 +2200,7 @@ int ha_federated::update_row(const byte *old_data, byte *new_data)
if (!has_a_primary_key)
update_string.append(STRING_WITH_LEN(" LIMIT 1"));
- if (mysql_real_query(mysql, update_string.ptr(), update_string.length()))
+ if (real_query(update_string.ptr(), update_string.length()))
{
DBUG_RETURN(stash_remote_error());
}
@@ -2155,7 +2222,7 @@ int ha_federated::update_row(const byte *old_data, byte *new_data)
calls.
*/
-int ha_federated::delete_row(const byte *buf)
+int ha_federated::delete_row(const uchar *buf)
{
char delete_buffer[FEDERATED_QUERY_BUFFER_SIZE];
char data_buffer[FEDERATED_QUERY_BUFFER_SIZE];
@@ -2165,9 +2232,10 @@ int ha_federated::delete_row(const byte *buf)
DBUG_ENTER("ha_federated::delete_row");
delete_string.length(0);
- delete_string.append(STRING_WITH_LEN("DELETE FROM `"));
- delete_string.append(share->table_name);
- delete_string.append(STRING_WITH_LEN("` WHERE "));
+ delete_string.append(STRING_WITH_LEN("DELETE FROM "));
+ append_ident(&delete_string, share->table_name,
+ share->table_name_length, ident_quote_char);
+ delete_string.append(STRING_WITH_LEN(" WHERE "));
for (Field **field= table->field; *field; field++)
{
@@ -2175,8 +2243,9 @@ int ha_federated::delete_row(const byte *buf)
found++;
if (bitmap_is_set(table->read_set, cur_field->field_index))
{
+ append_ident(&delete_string, (*field)->field_name,
+ strlen((*field)->field_name), ident_quote_char);
data_string.length(0);
- delete_string.append(cur_field->field_name);
if (cur_field->is_null())
{
delete_string.append(STRING_WITH_LEN(" IS NULL "));
@@ -2187,10 +2256,10 @@ int ha_federated::delete_row(const byte *buf)
delete_string.append(STRING_WITH_LEN(" = "));
cur_field->val_str(&data_string);
if (needs_quote)
- delete_string.append('\'');
+ delete_string.append(value_quote_char);
data_string.print(&delete_string);
if (needs_quote)
- delete_string.append('\'');
+ delete_string.append(value_quote_char);
}
delete_string.append(STRING_WITH_LEN(" AND "));
}
@@ -2204,7 +2273,7 @@ int ha_federated::delete_row(const byte *buf)
delete_string.append(STRING_WITH_LEN(" LIMIT 1"));
DBUG_PRINT("info",
("Delete sql: %s", delete_string.c_ptr_quick()));
- if (mysql_real_query(mysql, delete_string.ptr(), delete_string.length()))
+ if (real_query(delete_string.ptr(), delete_string.length()))
{
DBUG_RETURN(stash_remote_error());
}
@@ -2225,7 +2294,7 @@ int ha_federated::delete_row(const byte *buf)
a WHERE clause on a non-primary key index, simply calls index_read_idx.
*/
-int ha_federated::index_read(byte *buf, const byte *key,
+int ha_federated::index_read(uchar *buf, const uchar *key,
uint key_len, ha_rkey_function find_flag)
{
DBUG_ENTER("ha_federated::index_read");
@@ -2251,7 +2320,7 @@ int ha_federated::index_read(byte *buf, const byte *key,
returns. We need to be able to be calable from ha_rnd_pos()
*/
-int ha_federated::index_read_idx(byte *buf, uint index, const byte *key,
+int ha_federated::index_read_idx(uchar *buf, uint index, const uchar *key,
uint key_len, enum ha_rkey_function find_flag)
{
int retval;
@@ -2277,8 +2346,8 @@ int ha_federated::index_read_idx(byte *buf, uint index, const byte *key,
table->status == STATUS_NOT_FOUND
*/
-int ha_federated::index_read_idx_with_result_set(byte *buf, uint index,
- const byte *key,
+int ha_federated::index_read_idx_with_result_set(uchar *buf, uint index,
+ const uchar *key,
uint key_len,
ha_rkey_function find_flag,
MYSQL_RES **result)
@@ -2299,8 +2368,7 @@ int ha_federated::index_read_idx_with_result_set(byte *buf, uint index,
*result= 0; // In case of errors
index_string.length(0);
sql_query.length(0);
- statistic_increment(table->in_use->status_var.ha_read_key_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_key_count);
sql_query.append(share->select_query);
@@ -2313,7 +2381,7 @@ int ha_federated::index_read_idx_with_result_set(byte *buf, uint index,
NULL, 0, 0);
sql_query.append(index_string);
- if (mysql_real_query(mysql, sql_query.ptr(), sql_query.length()))
+ if (real_query(sql_query.ptr(), sql_query.length()))
{
my_sprintf(error_buffer, (error_buffer, "error: %d '%s'",
mysql_errno(mysql), mysql_error(mysql)));
@@ -2379,7 +2447,7 @@ int ha_federated::read_range_first(const key_range *start_key,
mysql_free_result(stored_result);
stored_result= 0;
}
- if (mysql_real_query(mysql, sql_query.ptr(), sql_query.length()))
+ if (real_query(sql_query.ptr(), sql_query.length()))
{
retval= ER_QUERY_ON_FOREIGN_DATA_SOURCE;
goto error;
@@ -2411,11 +2479,10 @@ int ha_federated::read_range_next()
/* Used to read forward through the index. */
-int ha_federated::index_next(byte *buf)
+int ha_federated::index_next(uchar *buf)
{
DBUG_ENTER("ha_federated::index_next");
- statistic_increment(table->in_use->status_var.ha_read_next_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_next_count);
DBUG_RETURN(read_next(buf, stored_result));
}
@@ -2479,9 +2546,7 @@ int ha_federated::rnd_init(bool scan)
stored_result= 0;
}
- if (mysql_real_query(mysql,
- share->select_query,
- strlen(share->select_query)))
+ if (real_query(share->select_query, strlen(share->select_query)))
goto error;
stored_result= mysql_store_result(mysql);
@@ -2525,7 +2590,7 @@ int ha_federated::index_end(void)
sql_table.cc, and sql_update.cc.
*/
-int ha_federated::rnd_next(byte *buf)
+int ha_federated::rnd_next(uchar *buf)
{
DBUG_ENTER("ha_federated::rnd_next");
@@ -2562,7 +2627,7 @@ int ha_federated::rnd_next(byte *buf)
0 no error
*/
-int ha_federated::read_next(byte *buf, MYSQL_RES *result)
+int ha_federated::read_next(uchar *buf, MYSQL_RES *result)
{
int retval;
MYSQL_ROW row;
@@ -2591,11 +2656,11 @@ int ha_federated::read_next(byte *buf, MYSQL_RES *result)
Called from filesort.cc, sql_select.cc, sql_delete.cc and sql_update.cc.
*/
-void ha_federated::position(const byte *record)
+void ha_federated::position(const uchar *record)
{
DBUG_ENTER("ha_federated::position");
if (table->s->primary_key != MAX_KEY)
- key_copy(ref, (byte *)record, table->key_info + table->s->primary_key,
+ key_copy(ref, (uchar *)record, table->key_info + table->s->primary_key,
ref_length);
else
memcpy(ref, record, ref_length);
@@ -2612,12 +2677,11 @@ void ha_federated::position(const byte *record)
Called from filesort.cc records.cc sql_insert.cc sql_select.cc sql_update.cc.
*/
-int ha_federated::rnd_pos(byte *buf, byte *pos)
+int ha_federated::rnd_pos(uchar *buf, uchar *pos)
{
int result;
DBUG_ENTER("ha_federated::rnd_pos");
- statistic_increment(table->in_use->status_var.ha_read_rnd_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_rnd_count);
if (table->s->primary_key != MAX_KEY)
{
/* We have a primary key, so use index_read_idx to find row */
@@ -2683,7 +2747,6 @@ int ha_federated::info(uint flag)
{
char error_buffer[FEDERATED_QUERY_BUFFER_SIZE];
char status_buf[FEDERATED_QUERY_BUFFER_SIZE];
- char escaped_table_name[FEDERATED_QUERY_BUFFER_SIZE];
int error;
uint error_code;
MYSQL_RES *result= 0;
@@ -2696,16 +2759,11 @@ int ha_federated::info(uint flag)
if (flag & (HA_STATUS_VARIABLE | HA_STATUS_CONST))
{
status_query_string.length(0);
- status_query_string.append(STRING_WITH_LEN("SHOW TABLE STATUS LIKE '"));
- escape_string_for_mysql(&my_charset_bin, (char *)escaped_table_name,
- sizeof(escaped_table_name),
- share->table_name,
- share->table_name_length);
- status_query_string.append(escaped_table_name);
- status_query_string.append(STRING_WITH_LEN("'"));
-
- if (mysql_real_query(mysql, status_query_string.ptr(),
- status_query_string.length()))
+ status_query_string.append(STRING_WITH_LEN("SHOW TABLE STATUS LIKE "));
+ append_ident(&status_query_string, share->table_name,
+ share->table_name_length, value_quote_char);
+
+ if (real_query(status_query_string.ptr(), status_query_string.length()))
goto error;
status_query_string.length(0);
@@ -2737,15 +2795,15 @@ int ha_federated::info(uint flag)
stats.records= (ha_rows) my_strtoll10(row[4], (char**) 0,
&error);
if (row[5] != NULL)
- stats.mean_rec_length= (ha_rows) my_strtoll10(row[5], (char**) 0, &error);
+ stats.mean_rec_length= (ulong) my_strtoll10(row[5], (char**) 0, &error);
stats.data_file_length= stats.records * stats.mean_rec_length;
if (row[12] != NULL)
- stats.update_time= (ha_rows) my_strtoll10(row[12], (char**) 0,
+ stats.update_time= (time_t) my_strtoll10(row[12], (char**) 0,
&error);
if (row[13] != NULL)
- stats.check_time= (ha_rows) my_strtoll10(row[13], (char**) 0,
+ stats.check_time= (time_t) my_strtoll10(row[13], (char**) 0,
&error);
}
/*
@@ -2757,22 +2815,90 @@ int ha_federated::info(uint flag)
}
- if (result)
- mysql_free_result(result);
+ if (flag & HA_STATUS_AUTO)
+ stats.auto_increment_value= mysql->last_used_con->insert_id;
+
+ mysql_free_result(result);
DBUG_RETURN(0);
error:
- if (result)
- mysql_free_result(result);
-
- my_sprintf(error_buffer, (error_buffer, ": %d : %s",
- mysql_errno(mysql), mysql_error(mysql)));
- my_error(error_code, MYF(0), error_buffer);
+ mysql_free_result(result);
+ if (mysql)
+ {
+ my_sprintf(error_buffer, (error_buffer, ": %d : %s",
+ mysql_errno(mysql), mysql_error(mysql)));
+ my_error(error_code, MYF(0), error_buffer);
+ }
+ else
+ if (remote_error_number != -1 /* error already reported */)
+ {
+ error_code= remote_error_number;
+ my_error(error_code, MYF(0), ER(error_code));
+ }
DBUG_RETURN(error_code);
}
+/**
+ @brief Handles extra signals from MySQL server
+
+ @param[in] operation Hint for storage engine
+
+ @return Operation Status
+ @retval 0 OK
+ */
+int ha_federated::extra(ha_extra_function operation)
+{
+ DBUG_ENTER("ha_federated::extra");
+ switch (operation) {
+ case HA_EXTRA_IGNORE_DUP_KEY:
+ ignore_duplicates= TRUE;
+ break;
+ case HA_EXTRA_NO_IGNORE_DUP_KEY:
+ insert_dup_update= FALSE;
+ ignore_duplicates= FALSE;
+ break;
+ case HA_EXTRA_WRITE_CAN_REPLACE:
+ replace_duplicates= TRUE;
+ break;
+ case HA_EXTRA_WRITE_CANNOT_REPLACE:
+ /*
+ We use this flag to ensure that we do not create an "INSERT IGNORE"
+ statement when inserting new rows into the remote table.
+ */
+ replace_duplicates= FALSE;
+ break;
+ case HA_EXTRA_INSERT_WITH_UPDATE:
+ insert_dup_update= TRUE;
+ break;
+ default:
+ /* do nothing */
+ DBUG_PRINT("info",("unhandled operation: %d", (uint) operation));
+ }
+ DBUG_RETURN(0);
+}
+
+
+/**
+ @brief Reset state of file to after 'open'.
+
+ @detail This function is called after every statement for all tables
+ used by that statement.
+
+ @return Operation status
+ @retval 0 OK
+*/
+
+int ha_federated::reset(void)
+{
+ insert_dup_update= FALSE;
+ ignore_duplicates= FALSE;
+ replace_duplicates= FALSE;
+ return 0;
+}
+
+
/*
Used to delete all rows in a table. Both for cases of truncate and
for cases where the optimizer realizes that all rows will be
@@ -2794,14 +2920,14 @@ int ha_federated::delete_all_rows()
query.length(0);
query.set_charset(system_charset_info);
- query.append(STRING_WITH_LEN("TRUNCATE `"));
- query.append(share->table_name);
- query.append(STRING_WITH_LEN("`"));
+ query.append(STRING_WITH_LEN("TRUNCATE "));
+ append_ident(&query, share->table_name, share->table_name_length,
+ ident_quote_char);
/*
TRUNCATE won't return anything in mysql_affected_rows
*/
- if (mysql_real_query(mysql, query.ptr(), query.length()))
+ if (real_query(query.ptr(), query.length()))
{
DBUG_RETURN(stash_remote_error());
}
@@ -2891,19 +3017,125 @@ int ha_federated::create(const char *name, TABLE *table_arg,
FEDERATED_SHARE tmp_share; // Only a temporary share, to test the url
DBUG_ENTER("ha_federated::create");
- if (!(retval= parse_url(thd->mem_root, &tmp_share, table_arg, 1)))
- retval= check_foreign_data_source(&tmp_share, 1);
+ retval= parse_url(thd->mem_root, &tmp_share, table_arg, 1);
DBUG_RETURN(retval);
}
+int ha_federated::real_connect()
+{
+ char buffer[FEDERATED_QUERY_BUFFER_SIZE];
+ String sql_query(buffer, sizeof(buffer), &my_charset_bin);
+ DBUG_ENTER("ha_federated::real_connect");
+
+ /*
+ Bug#25679
+ Ensure that we do not hold the LOCK_open mutex while attempting
+ to establish Federated connection to guard against a trivial
+ Denial of Service scenerio.
+ */
+ safe_mutex_assert_not_owner(&LOCK_open);
+
+ DBUG_ASSERT(mysql == NULL);
+
+ if (!(mysql= mysql_init(NULL)))
+ {
+ remote_error_number= HA_ERR_OUT_OF_MEM;
+ DBUG_RETURN(-1);
+ }
+
+ /*
+ BUG# 17044 Federated Storage Engine is not UTF8 clean
+ Add set names to whatever charset the table is at open
+ of table
+ */
+ /* this sets the csname like 'set names utf8' */
+ mysql_options(mysql,MYSQL_SET_CHARSET_NAME,
+ this->table->s->table_charset->csname);
+
+ sql_query.length(0);
+
+ if (!mysql_real_connect(mysql,
+ share->hostname,
+ share->username,
+ share->password,
+ share->database,
+ share->port,
+ share->socket, 0))
+ {
+ stash_remote_error();
+ mysql_close(mysql);
+ mysql= NULL;
+ my_error(ER_CONNECT_TO_FOREIGN_DATA_SOURCE, MYF(0), remote_error_buf);
+ remote_error_number= -1;
+ DBUG_RETURN(-1);
+ }
+
+ /*
+ We have established a connection, lets try a simple dummy query just
+ to check that the table and expected columns are present.
+ */
+ sql_query.append(share->select_query);
+ sql_query.append(STRING_WITH_LEN(" WHERE 1=0"));
+ if (mysql_real_query(mysql, sql_query.ptr(), sql_query.length()))
+ {
+ sql_query.length(0);
+ sql_query.append("error: ");
+ sql_query.qs_append(mysql_errno(mysql));
+ sql_query.append(" '");
+ sql_query.append(mysql_error(mysql));
+ sql_query.append("'");
+ mysql_close(mysql);
+ mysql= NULL;
+ my_error(ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST, MYF(0), sql_query.ptr());
+ remote_error_number= -1;
+ DBUG_RETURN(-1);
+ }
+
+ /* Just throw away the result, no rows anyways but need to keep in sync */
+ mysql_free_result(mysql_store_result(mysql));
+
+ /*
+ Since we do not support transactions at this version, we can let the client
+ API silently reconnect. For future versions, we will need more logic to
+ deal with transactions
+ */
+
+ mysql->reconnect= 1;
+ DBUG_RETURN(0);
+}
+
+
+int ha_federated::real_query(const char *query, uint length)
+{
+ int rc= 0;
+ DBUG_ENTER("ha_federated::real_query");
+
+ if (!mysql && (rc= real_connect()))
+ goto end;
+
+ if (!query || !length)
+ goto end;
+
+ rc= mysql_real_query(mysql, query, length);
+
+end:
+ DBUG_RETURN(rc);
+}
+
+
int ha_federated::stash_remote_error()
{
DBUG_ENTER("ha_federated::stash_remote_error()");
+ if (!mysql)
+ DBUG_RETURN(remote_error_number);
remote_error_number= mysql_errno(mysql);
strmake(remote_error_buf, mysql_error(mysql), sizeof(remote_error_buf)-1);
+ if (remote_error_number == ER_DUP_ENTRY ||
+ remote_error_number == ER_DUP_KEY)
+ DBUG_RETURN(HA_ERR_FOUND_DUPP_KEY);
DBUG_RETURN(HA_FEDERATED_ERROR_WITH_REMOTE_SYSTEM);
}
@@ -2929,11 +3161,16 @@ bool ha_federated::get_error_message(int error, String* buf)
int ha_federated::external_lock(THD *thd, int lock_type)
{
int error= 0;
- ha_federated *trx= (ha_federated *)thd->ha_data[ht->slot];
DBUG_ENTER("ha_federated::external_lock");
+ /*
+ Support for transactions disabled until WL#2952 fixes it.
+ */
+#ifdef XXX_SUPERCEDED_BY_WL2952
if (lock_type != F_UNLCK)
{
+ ha_federated *trx= (ha_federated *)thd_get_ha_data(thd, ht);
+
DBUG_PRINT("info",("federated not lock F_UNLCK"));
if (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
{
@@ -2963,7 +3200,7 @@ int ha_federated::external_lock(THD *thd, int lock_type)
DBUG_PRINT("info", ("error setting autocommit FALSE: %d", error));
DBUG_RETURN(error);
}
- thd->ha_data[ht->slot]= this;
+ thd_set_ha_data(thd, ht, this);
trans_register_ha(thd, TRUE, ht);
/*
Send a lock table to the remote end.
@@ -2985,14 +3222,15 @@ int ha_federated::external_lock(THD *thd, int lock_type)
}
}
}
- DBUG_RETURN(0);
+#endif /* XXX_SUPERCEDED_BY_WL2952 */
+ DBUG_RETURN(error);
}
static int federated_commit(handlerton *hton, THD *thd, bool all)
{
int return_val= 0;
- ha_federated *trx= (ha_federated *)thd->ha_data[hton->slot];
+ ha_federated *trx= (ha_federated *) thd_get_ha_data(thd, hton);
DBUG_ENTER("federated_commit");
if (all)
@@ -3007,7 +3245,7 @@ static int federated_commit(handlerton *hton, THD *thd, bool all)
if (error && !return_val)
return_val= error;
}
- thd->ha_data[hton->slot]= NULL;
+ thd_set_ha_data(thd, hton, NULL);
}
DBUG_PRINT("info", ("error val: %d", return_val));
@@ -3018,7 +3256,7 @@ static int federated_commit(handlerton *hton, THD *thd, bool all)
static int federated_rollback(handlerton *hton, THD *thd, bool all)
{
int return_val= 0;
- ha_federated *trx= (ha_federated *)thd->ha_data[hton->slot];
+ ha_federated *trx= (ha_federated *)thd_get_ha_data(thd, hton);
DBUG_ENTER("federated_rollback");
if (all)
@@ -3033,7 +3271,7 @@ static int federated_rollback(handlerton *hton, THD *thd, bool all)
if (error && !return_val)
return_val= error;
}
- thd->ha_data[hton->slot]= NULL;
+ thd_set_ha_data(thd, hton, NULL);
}
DBUG_PRINT("info", ("error val: %d", return_val));
diff --git a/storage/federated/ha_federated.h b/storage/federated/ha_federated.h
index 4d2eefdd986..40bcf9cc402 100644
--- a/storage/federated/ha_federated.h
+++ b/storage/federated/ha_federated.h
@@ -88,13 +88,16 @@ class ha_federated: public handler
MYSQL_ROW_OFFSET current_position; // Current position used by ::position()
int remote_error_number;
char remote_error_buf[FEDERATED_QUERY_BUFFER_SIZE];
+ bool ignore_duplicates, replace_duplicates;
+ bool insert_dup_update;
+ DYNAMIC_STRING bulk_insert;
private:
/*
return 0 on success
return errorcode otherwise
*/
- uint convert_row_to_internal_format(byte *buf, MYSQL_ROW row,
+ uint convert_row_to_internal_format(uchar *buf, MYSQL_ROW row,
MYSQL_RES *result);
bool create_where_from_key(String *to, KEY *key_info,
const key_range *start_key,
@@ -102,6 +105,16 @@ private:
bool records_in_range, bool eq_range);
int stash_remote_error();
+ bool append_stmt_insert(String *query);
+
+ int read_next(uchar *buf, MYSQL_RES *result);
+ int index_read_idx_with_result_set(uchar *buf, uint index,
+ const uchar *key,
+ uint key_len,
+ ha_rkey_function find_flag,
+ MYSQL_RES **result);
+ int real_query(const char *query, uint length);
+ int real_connect();
public:
ha_federated(handlerton *hton, TABLE_SHARE *table_arg);
~ha_federated() {}
@@ -128,7 +141,9 @@ public:
/* fix server to be able to get remote server table flags */
return (HA_PRIMARY_KEY_IN_READ_INDEX | HA_FILE_BASED
| HA_REC_NOT_IN_SEQ | HA_AUTO_PART_KEY | HA_CAN_INDEX_BLOBS |
+ HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE |
HA_NO_PREFIX_CHAR_KEYS | HA_PRIMARY_KEY_REQUIRED_FOR_DELETE |
+ HA_NO_TRANSACTIONS /* until fixed by WL#2952 */ |
HA_PARTIAL_COLUMN_READ | HA_NULL_IN_KEY);
}
/*
@@ -150,6 +165,7 @@ public:
uint max_supported_keys() const { return MAX_KEY; }
uint max_supported_key_parts() const { return MAX_REF_PARTS; }
uint max_supported_key_length() const { return FEDERATED_MAX_KEY_LENGTH; }
+ uint max_supported_key_part_length() const { return FEDERATED_MAX_KEY_LENGTH; }
/*
Called in test_quick_select to determine if indexes should be used.
Normally, we need to know number of blocks . For federated we need to
@@ -188,15 +204,17 @@ public:
int open(const char *name, int mode, uint test_if_locked); // required
int close(void); // required
- int write_row(byte *buf);
- int update_row(const byte *old_data, byte *new_data);
- int delete_row(const byte *buf);
+ void start_bulk_insert(ha_rows rows);
+ int end_bulk_insert();
+ int write_row(uchar *buf);
+ int update_row(const uchar *old_data, uchar *new_data);
+ int delete_row(const uchar *buf);
int index_init(uint keynr, bool sorted);
- int index_read(byte *buf, const byte *key,
+ int index_read(uchar *buf, const uchar *key,
uint key_len, enum ha_rkey_function find_flag);
- int index_read_idx(byte *buf, uint idx, const byte *key,
+ int index_read_idx(uchar *buf, uint idx, const uchar *key,
uint key_len, enum ha_rkey_function find_flag);
- int index_next(byte *buf);
+ int index_next(uchar *buf);
int index_end();
int read_range_first(const key_range *start_key,
const key_range *end_key,
@@ -212,10 +230,11 @@ public:
*/
int rnd_init(bool scan); //required
int rnd_end();
- int rnd_next(byte *buf); //required
- int rnd_pos(byte *buf, byte *pos); //required
- void position(const byte *record); //required
+ int rnd_next(uchar *buf); //required
+ int rnd_pos(uchar *buf, uchar *pos); //required
+ void position(const uchar *record); //required
int info(uint); //required
+ int extra(ha_extra_function operation);
void update_auto_increment(void);
int repair(THD* thd, HA_CHECK_OPT* check_opt);
@@ -230,18 +249,12 @@ public:
THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
enum thr_lock_type lock_type); //required
- virtual bool get_error_message(int error, String *buf);
+ bool get_error_message(int error, String *buf);
int external_lock(THD *thd, int lock_type);
int connection_commit();
int connection_rollback();
int connection_autocommit(bool state);
int execute_simple_query(const char *query, int len);
-
- int read_next(byte *buf, MYSQL_RES *result);
- int index_read_idx_with_result_set(byte *buf, uint index,
- const byte *key,
- uint key_len,
- ha_rkey_function find_flag,
- MYSQL_RES **result);
+ int reset(void);
};
diff --git a/storage/heap/CMakeLists.txt b/storage/heap/CMakeLists.txt
index 39953684b8f..fd3ce149b2c 100644..100755
--- a/storage/heap/CMakeLists.txt
+++ b/storage/heap/CMakeLists.txt
@@ -20,8 +20,13 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib
${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/extra/yassl/include)
-ADD_LIBRARY(heap _check.c _rectest.c hp_block.c hp_clear.c hp_close.c hp_create.c
+
+SET(HEAP_SOURCES _check.c _rectest.c hp_block.c hp_clear.c hp_close.c hp_create.c
ha_heap.cc
hp_delete.c hp_extra.c hp_hash.c hp_info.c hp_open.c hp_panic.c
hp_rename.c hp_rfirst.c hp_rkey.c hp_rlast.c hp_rnext.c hp_rprev.c
hp_rrnd.c hp_rsame.c hp_scan.c hp_static.c hp_update.c hp_write.c)
+
+IF(NOT SOURCE_SUBLIBS)
+ ADD_LIBRARY(heap ${HEAP_SOURCES})
+ENDIF(NOT SOURCE_SUBLIBS)
diff --git a/storage/heap/_check.c b/storage/heap/_check.c
index 05f12dade0d..08b6da62ae1 100644
--- a/storage/heap/_check.c
+++ b/storage/heap/_check.c
@@ -167,7 +167,7 @@ static int check_one_rb_key(HP_INFO *info, uint keynr, ulong records,
HP_KEYDEF *keydef= info->s->keydef + keynr;
int error= 0;
ulong found= 0;
- byte *key, *recpos;
+ uchar *key, *recpos;
uint key_length;
uint not_used[2];
@@ -176,7 +176,7 @@ static int check_one_rb_key(HP_INFO *info, uint keynr, ulong records,
{
do
{
- memcpy(&recpos, key + (*keydef->get_key_length)(keydef,key), sizeof(byte*));
+ memcpy(&recpos, key + (*keydef->get_key_length)(keydef,key), sizeof(uchar*));
key_length= hp_rb_make_key(keydef, info->recbuf, recpos, 0);
if (ha_key_cmp(keydef->seg, (uchar*) info->recbuf, (uchar*) key,
key_length, SEARCH_FIND | SEARCH_SAME, not_used))
diff --git a/storage/heap/_rectest.c b/storage/heap/_rectest.c
index 2fd2d39bed7..068fedf719c 100644
--- a/storage/heap/_rectest.c
+++ b/storage/heap/_rectest.c
@@ -18,7 +18,7 @@
#include "heapdef.h"
-int hp_rectest(register HP_INFO *info, register const byte *old)
+int hp_rectest(register HP_INFO *info, register const uchar *old)
{
DBUG_ENTER("hp_rectest");
diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc
index 8c378f7334f..601d4612dda 100644
--- a/storage/heap/ha_heap.cc
+++ b/storage/heap/ha_heap.cc
@@ -22,7 +22,7 @@
#include "mysql_priv.h"
#include <mysql/plugin.h>
#include "ha_heap.h"
-
+#include "heapdef.h"
static handler *heap_create_handler(handlerton *hton,
TABLE_SHARE *table,
@@ -61,8 +61,8 @@ static handler *heap_create_handler(handlerton *hton,
*****************************************************************************/
ha_heap::ha_heap(handlerton *hton, TABLE_SHARE *table_arg)
- :handler(hton, table_arg), file(0), records_changed(0),
- key_stat_version(0)
+ :handler(hton, table_arg), file(0), records_changed(0), internal_table(0),
+ key_stat_version(0)
{}
@@ -90,13 +90,25 @@ const char **ha_heap::bas_ext() const
int ha_heap::open(const char *name, int mode, uint test_if_locked)
{
- if (!(file= heap_open(name, mode)) && my_errno == ENOENT)
+ if ((test_if_locked & HA_OPEN_INTERNAL_TABLE) ||
+ !(file= heap_open(name, mode)) && my_errno == ENOENT)
{
HA_CREATE_INFO create_info;
+ internal_table= test(test_if_locked & HA_OPEN_INTERNAL_TABLE);
bzero(&create_info, sizeof(create_info));
+ file= 0;
if (!create(name, table, &create_info))
{
- file= heap_open(name, mode);
+ file= internal_table ?
+ heap_open_from_share(internal_share, mode) :
+ heap_open_from_share_and_register(internal_share, mode);
+ if (!file)
+ {
+ /* Couldn't open table; Remove the newly created table */
+ pthread_mutex_lock(&THR_LOCK_heap);
+ hp_free(internal_share);
+ pthread_mutex_unlock(&THR_LOCK_heap);
+ }
implicit_emptied= 1;
}
}
@@ -120,7 +132,27 @@ int ha_heap::open(const char *name, int mode, uint test_if_locked)
int ha_heap::close(void)
{
- return heap_close(file);
+ return internal_table ? hp_close(file) : heap_close(file);
+}
+
+
+/*
+ Create a copy of this table
+
+ DESCRIPTION
+ Do same as default implementation but use file->s->name instead of
+ table->s->path. This is needed by Windows where the clone() call sees
+ '/'-delimited path in table->s->path, while ha_peap::open() was called
+ with '\'-delimited path.
+*/
+
+handler *ha_heap::clone(MEM_ROOT *mem_root)
+{
+ handler *new_handler= get_new_handler(table->s, mem_root, table->s->db_type());
+ if (new_handler && !new_handler->ha_open(table, file->s->name, table->db_stat,
+ HA_OPEN_IGNORE_IF_LOCKED))
+ return new_handler;
+ return NULL; /* purecov: inspected */
}
@@ -165,7 +197,7 @@ void ha_heap::update_key_stats()
else
{
ha_rows hash_buckets= file->s->keydef[i].hash_buckets;
- uint no_records= hash_buckets ? file->s->records/hash_buckets : 2;
+ uint no_records= hash_buckets ? (uint) (file->s->records/hash_buckets) : 2;
if (no_records < 2)
no_records= 2;
key->rec_per_key[key->key_parts-1]= no_records;
@@ -178,10 +210,10 @@ void ha_heap::update_key_stats()
}
-int ha_heap::write_row(byte * buf)
+int ha_heap::write_row(uchar * buf)
{
int res;
- statistic_increment(table->in_use->status_var.ha_write_count,&LOCK_status);
+ ha_statistic_increment(&SSV::ha_write_count);
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
table->timestamp_field->set_time();
if (table->next_number_field && buf == table->record[0])
@@ -202,10 +234,10 @@ int ha_heap::write_row(byte * buf)
return res;
}
-int ha_heap::update_row(const byte * old_data, byte * new_data)
+int ha_heap::update_row(const uchar * old_data, uchar * new_data)
{
int res;
- statistic_increment(table->in_use->status_var.ha_update_count,&LOCK_status);
+ ha_statistic_increment(&SSV::ha_update_count);
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
table->timestamp_field->set_time();
res= heap_update(file,old_data,new_data);
@@ -221,10 +253,10 @@ int ha_heap::update_row(const byte * old_data, byte * new_data)
return res;
}
-int ha_heap::delete_row(const byte * buf)
+int ha_heap::delete_row(const uchar * buf)
{
int res;
- statistic_increment(table->in_use->status_var.ha_delete_count,&LOCK_status);
+ ha_statistic_increment(&SSV::ha_delete_count);
res= heap_delete(file,buf);
if (!res && table->s->tmp_table == NO_TMP_TABLE &&
++records_changed*HEAP_STATS_UPDATE_THRESHOLD > file->s->records)
@@ -238,74 +270,69 @@ int ha_heap::delete_row(const byte * buf)
return res;
}
-int ha_heap::index_read(byte * buf, const byte * key, key_part_map keypart_map,
- enum ha_rkey_function find_flag)
+int ha_heap::index_read_map(uchar *buf, const uchar *key,
+ key_part_map keypart_map,
+ enum ha_rkey_function find_flag)
{
DBUG_ASSERT(inited==INDEX);
- statistic_increment(table->in_use->status_var.ha_read_key_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_key_count);
int error = heap_rkey(file,buf,active_index, key, keypart_map, find_flag);
table->status = error ? STATUS_NOT_FOUND : 0;
return error;
}
-int ha_heap::index_read_last(byte *buf, const byte *key, key_part_map keypart_map)
+int ha_heap::index_read_last_map(uchar *buf, const uchar *key,
+ key_part_map keypart_map)
{
DBUG_ASSERT(inited==INDEX);
- statistic_increment(table->in_use->status_var.ha_read_key_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_key_count);
int error= heap_rkey(file, buf, active_index, key, keypart_map,
HA_READ_PREFIX_LAST);
table->status= error ? STATUS_NOT_FOUND : 0;
return error;
}
-int ha_heap::index_read_idx(byte * buf, uint index, const byte * key,
- key_part_map keypart_map,
- enum ha_rkey_function find_flag)
+int ha_heap::index_read_idx_map(uchar *buf, uint index, const uchar *key,
+ key_part_map keypart_map,
+ enum ha_rkey_function find_flag)
{
- statistic_increment(table->in_use->status_var.ha_read_key_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_key_count);
int error = heap_rkey(file, buf, index, key, keypart_map, find_flag);
table->status = error ? STATUS_NOT_FOUND : 0;
return error;
}
-int ha_heap::index_next(byte * buf)
+int ha_heap::index_next(uchar * buf)
{
DBUG_ASSERT(inited==INDEX);
- statistic_increment(table->in_use->status_var.ha_read_next_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_next_count);
int error=heap_rnext(file,buf);
table->status=error ? STATUS_NOT_FOUND: 0;
return error;
}
-int ha_heap::index_prev(byte * buf)
+int ha_heap::index_prev(uchar * buf)
{
DBUG_ASSERT(inited==INDEX);
- statistic_increment(table->in_use->status_var.ha_read_prev_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_prev_count);
int error=heap_rprev(file,buf);
table->status=error ? STATUS_NOT_FOUND: 0;
return error;
}
-int ha_heap::index_first(byte * buf)
+int ha_heap::index_first(uchar * buf)
{
DBUG_ASSERT(inited==INDEX);
- statistic_increment(table->in_use->status_var.ha_read_first_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_first_count);
int error=heap_rfirst(file, buf, active_index);
table->status=error ? STATUS_NOT_FOUND: 0;
return error;
}
-int ha_heap::index_last(byte * buf)
+int ha_heap::index_last(uchar * buf)
{
DBUG_ASSERT(inited==INDEX);
- statistic_increment(table->in_use->status_var.ha_read_last_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_last_count);
int error=heap_rlast(file, buf, active_index);
table->status=error ? STATUS_NOT_FOUND: 0;
return error;
@@ -316,28 +343,26 @@ int ha_heap::rnd_init(bool scan)
return scan ? heap_scan_init(file) : 0;
}
-int ha_heap::rnd_next(byte *buf)
+int ha_heap::rnd_next(uchar *buf)
{
- statistic_increment(table->in_use->status_var.ha_read_rnd_next_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_rnd_next_count);
int error=heap_scan(file, buf);
table->status=error ? STATUS_NOT_FOUND: 0;
return error;
}
-int ha_heap::rnd_pos(byte * buf, byte *pos)
+int ha_heap::rnd_pos(uchar * buf, uchar *pos)
{
int error;
HEAP_PTR heap_position;
- statistic_increment(table->in_use->status_var.ha_read_rnd_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_rnd_count);
memcpy_fixed((char*) &heap_position, pos, sizeof(HEAP_PTR));
error=heap_rrnd(file, buf, heap_position);
table->status=error ? STATUS_NOT_FOUND: 0;
return error;
}
-void ha_heap::position(const byte *record)
+void ha_heap::position(const uchar *record)
{
*(HEAP_PTR*) ref= heap_position(file); // Ref is aligned
}
@@ -531,7 +556,7 @@ int ha_heap::delete_table(const char *name)
void ha_heap::drop_table(const char *name)
{
- heap_drop_table(file);
+ file->s->delete_on_close= 1;
close();
}
@@ -670,16 +695,16 @@ int ha_heap::create(const char *name, TABLE *table_arg,
create_info->auto_increment_value - 1 : 0);
hp_create_info.max_table_size=current_thd->variables.max_heap_table_size;
hp_create_info.with_auto_increment= found_real_auto_increment;
+ hp_create_info.internal_table= internal_table;
max_rows = (ha_rows) (hp_create_info.max_table_size / mem_per_row);
error= heap_create(name,
keys, keydef, share->reclength,
(ulong) ((share->max_rows < max_rows &&
share->max_rows) ?
share->max_rows : max_rows),
- (ulong) share->min_rows, &hp_create_info);
- my_free((gptr) keydef, MYF(0));
- if (file)
- info(HA_STATUS_NO_LOCK | HA_STATUS_CONST | HA_STATUS_VARIABLE);
+ (ulong) share->min_rows, &hp_create_info, &internal_share);
+ my_free((uchar*) keydef, MYF(0));
+ DBUG_ASSERT(file == 0);
return (error);
}
diff --git a/storage/heap/ha_heap.h b/storage/heap/ha_heap.h
index a2d531fc515..5c5ad43658e 100644
--- a/storage/heap/ha_heap.h
+++ b/storage/heap/ha_heap.h
@@ -25,13 +25,16 @@
class ha_heap: public handler
{
HP_INFO *file;
+ HP_SHARE *internal_share;
key_map btree_keys;
/* number of records changed since last statistics update */
uint records_changed;
uint key_stat_version;
+ my_bool internal_table;
public:
ha_heap(handlerton *hton, TABLE_SHARE *table);
~ha_heap() {}
+ handler *clone(MEM_ROOT *mem_root);
const char *table_type() const
{
return (table->in_use->variables.sql_mode & MODE_MYSQL323) ?
@@ -48,14 +51,15 @@ public:
ulonglong table_flags() const
{
return (HA_FAST_KEY_READ | HA_NO_BLOBS | HA_NULL_IN_KEY |
+ HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE |
HA_REC_NOT_IN_SEQ | HA_CAN_INSERT_DELAYED | HA_NO_TRANSACTIONS |
HA_HAS_RECORDS | HA_STATS_RECORDS_IS_EXACT);
}
ulong index_flags(uint inx, uint part, bool all_parts) const
{
return ((table_share->key_info[inx].algorithm == HA_KEY_ALG_BTREE) ?
- HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER | HA_READ_RANGE :
- HA_ONLY_WHOLE_INDEX);
+ HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER | HA_READ_RANGE :
+ HA_ONLY_WHOLE_INDEX | HA_KEY_SCAN_NOT_ROR);
}
const key_map *keys_to_use_for_scanning() { return &btree_keys; }
uint max_supported_keys() const { return MAX_KEY; }
@@ -68,26 +72,27 @@ public:
int open(const char *name, int mode, uint test_if_locked);
int close(void);
void set_keys_for_scanning(void);
- int write_row(byte * buf);
- int update_row(const byte * old_data, byte * new_data);
- int delete_row(const byte * buf);
+ int write_row(uchar * buf);
+ int update_row(const uchar * old_data, uchar * new_data);
+ int delete_row(const uchar * buf);
virtual void get_auto_increment(ulonglong offset, ulonglong increment,
ulonglong nb_desired_values,
ulonglong *first_value,
ulonglong *nb_reserved_values);
- int index_read(byte * buf, const byte * key, key_part_map keypart_map,
- enum ha_rkey_function find_flag);
- int index_read_last(byte *buf, const byte *key, key_part_map keypart_map);
- int index_read_idx(byte * buf, uint index, const byte * key,
- key_part_map keypart_map, enum ha_rkey_function find_flag);
- int index_next(byte * buf);
- int index_prev(byte * buf);
- int index_first(byte * buf);
- int index_last(byte * buf);
+ int index_read_map(uchar * buf, const uchar * key, key_part_map keypart_map,
+ enum ha_rkey_function find_flag);
+ int index_read_last_map(uchar *buf, const uchar *key, key_part_map keypart_map);
+ int index_read_idx_map(uchar * buf, uint index, const uchar * key,
+ key_part_map keypart_map,
+ enum ha_rkey_function find_flag);
+ int index_next(uchar * buf);
+ int index_prev(uchar * buf);
+ int index_first(uchar * buf);
+ int index_last(uchar * buf);
int rnd_init(bool scan);
- int rnd_next(byte *buf);
- int rnd_pos(byte * buf, byte *pos);
- void position(const byte *record);
+ int rnd_next(uchar *buf);
+ int rnd_pos(uchar * buf, uchar *pos);
+ void position(const uchar *record);
int info(uint);
int extra(enum ha_extra_function operation);
int reset();
@@ -105,11 +110,9 @@ public:
THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
enum thr_lock_type lock_type);
- int cmp_ref(const byte *ref1, const byte *ref2)
+ int cmp_ref(const uchar *ref1, const uchar *ref2)
{
- HEAP_PTR ptr1=*(HEAP_PTR*)ref1;
- HEAP_PTR ptr2=*(HEAP_PTR*)ref2;
- return ptr1 < ptr2? -1 : (ptr1 > ptr2? 1 : 0);
+ return memcmp(ref1, ref2, sizeof(HEAP_PTR));
}
bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes);
private:
diff --git a/storage/heap/heapdef.h b/storage/heap/heapdef.h
index b52a6c60ac6..3fc94062303 100644
--- a/storage/heap/heapdef.h
+++ b/storage/heap/heapdef.h
@@ -16,6 +16,7 @@
/* This file is included in all heap-files */
#include <my_base.h> /* This includes global */
+C_MODE_START
#ifdef THREAD
#include <my_pthread.h>
#endif
@@ -48,7 +49,7 @@ if (!(info->update & HA_STATE_AKTIV))\
typedef struct st_hp_hash_info
{
struct st_hp_hash_info *next_key;
- byte *ptr_to_rec;
+ uchar *ptr_to_rec;
} HASH_INFO;
typedef struct {
@@ -60,42 +61,42 @@ typedef struct {
/* Prototypes for intern functions */
extern HP_SHARE *hp_find_named_heap(const char *name);
-extern int hp_rectest(HP_INFO *info,const byte *old);
-extern byte *hp_find_block(HP_BLOCK *info,ulong pos);
-extern int hp_get_new_block(HP_BLOCK *info, ulong* alloc_length);
+extern int hp_rectest(HP_INFO *info,const uchar *old);
+extern uchar *hp_find_block(HP_BLOCK *info,ulong pos);
+extern int hp_get_new_block(HP_BLOCK *info, size_t* alloc_length);
extern void hp_free(HP_SHARE *info);
-extern byte *hp_free_level(HP_BLOCK *block,uint level,HP_PTRS *pos,
- byte *last_pos);
+extern uchar *hp_free_level(HP_BLOCK *block,uint level,HP_PTRS *pos,
+ uchar *last_pos);
extern int hp_write_key(HP_INFO *info, HP_KEYDEF *keyinfo,
- const byte *record, byte *recpos);
+ const uchar *record, uchar *recpos);
extern int hp_rb_write_key(HP_INFO *info, HP_KEYDEF *keyinfo,
- const byte *record, byte *recpos);
+ const uchar *record, uchar *recpos);
extern int hp_rb_delete_key(HP_INFO *info,HP_KEYDEF *keyinfo,
- const byte *record,byte *recpos,int flag);
+ const uchar *record,uchar *recpos,int flag);
extern int hp_delete_key(HP_INFO *info,HP_KEYDEF *keyinfo,
- const byte *record,byte *recpos,int flag);
+ const uchar *record,uchar *recpos,int flag);
extern HASH_INFO *_heap_find_hash(HP_BLOCK *block,ulong pos);
-extern byte *hp_search(HP_INFO *info,HP_KEYDEF *keyinfo,const byte *key,
+extern uchar *hp_search(HP_INFO *info,HP_KEYDEF *keyinfo,const uchar *key,
uint nextflag);
-extern byte *hp_search_next(HP_INFO *info, HP_KEYDEF *keyinfo,
- const byte *key, HASH_INFO *pos);
-extern ulong hp_hashnr(HP_KEYDEF *keyinfo,const byte *key);
-extern ulong hp_rec_hashnr(HP_KEYDEF *keyinfo,const byte *rec);
+extern uchar *hp_search_next(HP_INFO *info, HP_KEYDEF *keyinfo,
+ const uchar *key, HASH_INFO *pos);
+extern ulong hp_hashnr(HP_KEYDEF *keyinfo,const uchar *key);
+extern ulong hp_rec_hashnr(HP_KEYDEF *keyinfo,const uchar *rec);
extern ulong hp_mask(ulong hashnr,ulong buffmax,ulong maxlength);
extern void hp_movelink(HASH_INFO *pos,HASH_INFO *next_link,
HASH_INFO *newlink);
-extern int hp_rec_key_cmp(HP_KEYDEF *keydef,const byte *rec1,
- const byte *rec2,
+extern int hp_rec_key_cmp(HP_KEYDEF *keydef,const uchar *rec1,
+ const uchar *rec2,
my_bool diff_if_only_endspace_difference);
-extern int hp_key_cmp(HP_KEYDEF *keydef,const byte *rec,
- const byte *key);
-extern void hp_make_key(HP_KEYDEF *keydef,byte *key,const byte *rec);
-extern uint hp_rb_make_key(HP_KEYDEF *keydef, byte *key,
- const byte *rec, byte *recpos);
-extern uint hp_rb_key_length(HP_KEYDEF *keydef, const byte *key);
-extern uint hp_rb_null_key_length(HP_KEYDEF *keydef, const byte *key);
-extern uint hp_rb_var_key_length(HP_KEYDEF *keydef, const byte *key);
-extern my_bool hp_if_null_in_key(HP_KEYDEF *keyinfo, const byte *record);
+extern int hp_key_cmp(HP_KEYDEF *keydef,const uchar *rec,
+ const uchar *key);
+extern void hp_make_key(HP_KEYDEF *keydef,uchar *key,const uchar *rec);
+extern uint hp_rb_make_key(HP_KEYDEF *keydef, uchar *key,
+ const uchar *rec, uchar *recpos);
+extern uint hp_rb_key_length(HP_KEYDEF *keydef, const uchar *key);
+extern uint hp_rb_null_key_length(HP_KEYDEF *keydef, const uchar *key);
+extern uint hp_rb_var_key_length(HP_KEYDEF *keydef, const uchar *key);
+extern my_bool hp_if_null_in_key(HP_KEYDEF *keyinfo, const uchar *record);
extern int hp_close(register HP_INFO *info);
extern void hp_clear(HP_SHARE *info);
extern void hp_clear_keys(HP_SHARE *info);
@@ -107,3 +108,4 @@ extern pthread_mutex_t THR_LOCK_heap;
#define pthread_mutex_lock(A)
#define pthread_mutex_unlock(A)
#endif
+C_MODE_END
diff --git a/storage/heap/hp_block.c b/storage/heap/hp_block.c
index 85219380287..c622a9e52f8 100644
--- a/storage/heap/hp_block.c
+++ b/storage/heap/hp_block.c
@@ -26,7 +26,7 @@
{p_0, p_1, ...} serve as indexes to descend the blocks tree.
*/
-byte *hp_find_block(HP_BLOCK *block, ulong pos)
+uchar *hp_find_block(HP_BLOCK *block, ulong pos)
{
reg1 int i;
reg3 HP_PTRS *ptr; /* block base ptr */
@@ -36,12 +36,13 @@ byte *hp_find_block(HP_BLOCK *block, ulong pos)
ptr=(HP_PTRS*)ptr->blocks[pos/block->level_info[i].records_under_level];
pos%=block->level_info[i].records_under_level;
}
- return (byte*) ptr+ pos*block->recbuffer;
+ return (uchar*) ptr+ pos*block->recbuffer;
}
/*
Get one new block-of-records. Alloc ptr to block if needed
+
SYNOPSIS
hp_get_new_block()
block HP_BLOCK tree-like block
@@ -53,7 +54,7 @@ byte *hp_find_block(HP_BLOCK *block, ulong pos)
1 Out of memory
*/
-int hp_get_new_block(HP_BLOCK *block, ulong *alloc_length)
+int hp_get_new_block(HP_BLOCK *block, size_t *alloc_length)
{
reg1 uint i,j;
HP_PTRS *root;
@@ -101,13 +102,13 @@ int hp_get_new_block(HP_BLOCK *block, ulong *alloc_length)
/* Occupy the free slot we've found at level i */
block->level_info[i].last_blocks->
blocks[HP_PTRS_IN_NOD - block->level_info[i].free_ptrs_in_block--]=
- (byte*) root;
+ (uchar*) root;
/* Add a block subtree with each node having one left-most child */
for (j=i-1 ; j >0 ; j--)
{
block->level_info[j].last_blocks= root++;
- block->level_info[j].last_blocks->blocks[0]=(byte*) root;
+ block->level_info[j].last_blocks->blocks[0]=(uchar*) root;
block->level_info[j].free_ptrs_in_block=HP_PTRS_IN_NOD-1;
}
@@ -124,27 +125,27 @@ int hp_get_new_block(HP_BLOCK *block, ulong *alloc_length)
/* free all blocks under level */
-byte *hp_free_level(HP_BLOCK *block, uint level, HP_PTRS *pos, byte *last_pos)
+uchar *hp_free_level(HP_BLOCK *block, uint level, HP_PTRS *pos, uchar *last_pos)
{
int i,max_pos;
- byte *next_ptr;
+ uchar *next_ptr;
if (level == 1)
- next_ptr=(byte*) pos+block->recbuffer;
+ next_ptr=(uchar*) pos+block->recbuffer;
else
{
max_pos= (block->level_info[level-1].last_blocks == pos) ?
HP_PTRS_IN_NOD - block->level_info[level-1].free_ptrs_in_block :
HP_PTRS_IN_NOD;
- next_ptr=(byte*) (pos+1);
+ next_ptr=(uchar*) (pos+1);
for (i=0 ; i < max_pos ; i++)
next_ptr=hp_free_level(block,level-1,
(HP_PTRS*) pos->blocks[i],next_ptr);
}
- if ((byte*) pos != last_pos)
+ if ((uchar*) pos != last_pos)
{
- my_free((gptr) pos,MYF(0));
+ my_free((uchar*) pos,MYF(0));
return last_pos;
}
return next_ptr; /* next memory position */
diff --git a/storage/heap/hp_clear.c b/storage/heap/hp_clear.c
index 2d8b8b394d5..babfcbd6f41 100644
--- a/storage/heap/hp_clear.c
+++ b/storage/heap/hp_clear.c
@@ -32,7 +32,7 @@ void hp_clear(HP_SHARE *info)
if (info->block.levels)
VOID(hp_free_level(&info->block,info->block.levels,info->block.root,
- (byte*) 0));
+ (uchar*) 0));
info->block.levels=0;
hp_clear_keys(info);
info->records= info->deleted= 0;
@@ -94,7 +94,7 @@ void hp_clear_keys(HP_SHARE *info)
{
HP_BLOCK *block= &keyinfo->block;
if (block->levels)
- VOID(hp_free_level(block,block->levels,block->root,(byte*) 0));
+ VOID(hp_free_level(block,block->levels,block->root,(uchar*) 0));
block->levels=0;
block->last_allocated=0;
keyinfo->hash_buckets= 0;
diff --git a/storage/heap/hp_close.c b/storage/heap/hp_close.c
index 5f6fc3249b5..d571815980c 100644
--- a/storage/heap/hp_close.c
+++ b/storage/heap/hp_close.c
@@ -42,9 +42,10 @@ int hp_close(register HP_INFO *info)
}
#endif
info->s->changed=0;
- heap_open_list=list_delete(heap_open_list,&info->open_list);
+ if (info->open_list.data)
+ heap_open_list=list_delete(heap_open_list,&info->open_list);
if (!--info->s->open_count && info->s->delete_on_close)
hp_free(info->s); /* Table was deleted */
- my_free((gptr) info,MYF(0));
+ my_free((uchar*) info,MYF(0));
DBUG_RETURN(error);
}
diff --git a/storage/heap/hp_create.c b/storage/heap/hp_create.c
index 4e1347966b9..b6814fc1614 100644
--- a/storage/heap/hp_create.c
+++ b/storage/heap/hp_create.c
@@ -19,33 +19,37 @@ static int keys_compare(heap_rb_param *param, uchar *key1, uchar *key2);
static void init_block(HP_BLOCK *block,uint reclength,ulong min_records,
ulong max_records);
+/* Create a heap table */
+
int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
uint reclength, ulong max_records, ulong min_records,
- HP_CREATE_INFO *create_info)
+ HP_CREATE_INFO *create_info, HP_SHARE **res)
{
uint i, j, key_segs, max_length, length;
- HP_SHARE *share;
+ HP_SHARE *share= 0;
HA_KEYSEG *keyseg;
-
DBUG_ENTER("heap_create");
- pthread_mutex_lock(&THR_LOCK_heap);
- if ((share= hp_find_named_heap(name)) && share->open_count == 0)
+ if (!create_info->internal_table)
{
- hp_free(share);
- share= NULL;
- }
-
+ pthread_mutex_lock(&THR_LOCK_heap);
+ if ((share= hp_find_named_heap(name)) && share->open_count == 0)
+ {
+ hp_free(share);
+ share= 0;
+ }
+ }
+
if (!share)
{
HP_KEYDEF *keyinfo;
DBUG_PRINT("info",("Initializing new table"));
/*
- We have to store sometimes byte* del_link in records,
- so the record length should be at least sizeof(byte*)
+ We have to store sometimes uchar* del_link in records,
+ so the record length should be at least sizeof(uchar*)
*/
- set_if_bigger(reclength, sizeof (byte*));
+ set_if_bigger(reclength, sizeof (uchar*));
for (i= key_segs= max_length= 0, keyinfo= keydef; i < keys; i++, keyinfo++)
{
@@ -112,7 +116,7 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
}
keyinfo->length= length;
length+= keyinfo->rb_tree.size_of_element +
- ((keyinfo->algorithm == HA_KEY_ALG_BTREE) ? sizeof(byte*) : 0);
+ ((keyinfo->algorithm == HA_KEY_ALG_BTREE) ? sizeof(uchar*) : 0);
if (length > max_length)
max_length= length;
key_segs+= keyinfo->keysegs;
@@ -131,10 +135,7 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
keys*sizeof(HP_KEYDEF)+
key_segs*sizeof(HA_KEYSEG),
MYF(MY_ZEROFILL))))
- {
- pthread_mutex_unlock(&THR_LOCK_heap);
- DBUG_RETURN(1);
- }
+ goto err;
share->keydef= (HP_KEYDEF*) (share + 1);
share->key_stat_version= 1;
keyseg= (HA_KEYSEG*) (share->keydef + keys);
@@ -152,12 +153,12 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
{
/* additional HA_KEYTYPE_END keyseg */
keyseg->type= HA_KEYTYPE_END;
- keyseg->length= sizeof(byte*);
+ keyseg->length= sizeof(uchar*);
keyseg->flag= 0;
keyseg->null_bit= 0;
keyseg++;
- init_tree(&keyinfo->rb_tree, 0, 0, sizeof(byte*),
+ init_tree(&keyinfo->rb_tree, 0, 0, sizeof(uchar*),
(qsort_cmp2)keys_compare, 1, NULL, NULL);
keyinfo->delete_key= hp_rb_delete_key;
keyinfo->write_key= hp_rb_write_key;
@@ -188,21 +189,34 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
/* Must be allocated separately for rename to work */
if (!(share->name= my_strdup(name,MYF(0))))
{
- my_free((gptr) share,MYF(0));
- pthread_mutex_unlock(&THR_LOCK_heap);
- DBUG_RETURN(1);
+ my_free((uchar*) share,MYF(0));
+ goto err;
}
#ifdef THREAD
thr_lock_init(&share->lock);
VOID(pthread_mutex_init(&share->intern_lock,MY_MUTEX_INIT_FAST));
#endif
- share->open_list.data= (void*) share;
- heap_share_list= list_add(heap_share_list,&share->open_list);
+ if (!create_info->internal_table)
+ {
+ share->open_list.data= (void*) share;
+ heap_share_list= list_add(heap_share_list,&share->open_list);
+ }
+ else
+ share->delete_on_close= 1;
}
- pthread_mutex_unlock(&THR_LOCK_heap);
+ if (!create_info->internal_table)
+ pthread_mutex_unlock(&THR_LOCK_heap);
+
+ *res= share;
DBUG_RETURN(0);
+
+err:
+ if (!create_info->internal_table)
+ pthread_mutex_unlock(&THR_LOCK_heap);
+ DBUG_RETURN(1);
} /* heap_create */
+
static int keys_compare(heap_rb_param *param, uchar *key1, uchar *key2)
{
uint not_used[2];
@@ -218,7 +232,7 @@ static void init_block(HP_BLOCK *block, uint reclength, ulong min_records,
max_records= max(min_records,max_records);
if (!max_records)
max_records= 1000; /* As good as quess as anything */
- recbuffer= (uint) (reclength + sizeof(byte**) - 1) & ~(sizeof(byte**) - 1);
+ recbuffer= (uint) (reclength + sizeof(uchar**) - 1) & ~(sizeof(uchar**) - 1);
records_in_block= max_records / 10;
if (records_in_block < 10 && max_records)
records_in_block= 10;
@@ -279,13 +293,14 @@ void heap_drop_table(HP_INFO *info)
void hp_free(HP_SHARE *share)
{
- heap_share_list= list_delete(heap_share_list, &share->open_list);
+ if (share->open_list.data) /* If not internal table */
+ heap_share_list= list_delete(heap_share_list, &share->open_list);
hp_clear(share); /* Remove blocks from memory */
#ifdef THREAD
thr_lock_delete(&share->lock);
VOID(pthread_mutex_destroy(&share->intern_lock));
#endif
- my_free((gptr) share->name, MYF(0));
- my_free((gptr) share, MYF(0));
+ my_free((uchar*) share->name, MYF(0));
+ my_free((uchar*) share, MYF(0));
return;
}
diff --git a/storage/heap/hp_delete.c b/storage/heap/hp_delete.c
index 637e5f1a497..1dd79a42e0b 100644
--- a/storage/heap/hp_delete.c
+++ b/storage/heap/hp_delete.c
@@ -17,9 +17,9 @@
#include "heapdef.h"
-int heap_delete(HP_INFO *info, const byte *record)
+int heap_delete(HP_INFO *info, const uchar *record)
{
- byte *pos;
+ uchar *pos;
HP_SHARE *share=info->s;
HP_KEYDEF *keydef, *end, *p_lastinx;
DBUG_ENTER("heap_delete");
@@ -43,7 +43,7 @@ int heap_delete(HP_INFO *info, const byte *record)
}
info->update=HA_STATE_DELETED;
- *((byte**) pos)=share->del_link;
+ *((uchar**) pos)=share->del_link;
share->del_link=pos;
pos[share->reclength]=0; /* Record deleted */
share->deleted++;
@@ -65,7 +65,7 @@ err:
*/
int hp_rb_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo,
- const byte *record, byte *recpos, int flag)
+ const uchar *record, uchar *recpos, int flag)
{
heap_rb_param custom_arg;
uint old_allocated;
@@ -105,7 +105,7 @@ int hp_rb_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo,
*/
int hp_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo,
- const byte *record, byte *recpos, int flag)
+ const uchar *record, uchar *recpos, int flag)
{
ulong blength,pos2,pos_hashnr,lastpos_hashnr;
HASH_INFO *lastpos,*gpos,*pos,*pos3,*empty,*last_ptr;
diff --git a/storage/heap/hp_hash.c b/storage/heap/hp_hash.c
index fbf3e541372..aaaa0fe833f 100644
--- a/storage/heap/hp_hash.c
+++ b/storage/heap/hp_hash.c
@@ -97,7 +97,7 @@ ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, key_range *min_key,
/* Sets info->current_ptr to found record */
/* next_flag: Search=0, next=1, prev =2, same =3 */
-byte *hp_search(HP_INFO *info, HP_KEYDEF *keyinfo, const byte *key,
+uchar *hp_search(HP_INFO *info, HP_KEYDEF *keyinfo, const uchar *key,
uint nextflag)
{
reg1 HASH_INFO *pos,*prev_ptr;
@@ -175,7 +175,7 @@ byte *hp_search(HP_INFO *info, HP_KEYDEF *keyinfo, const byte *key,
since last read !
*/
-byte *hp_search_next(HP_INFO *info, HP_KEYDEF *keyinfo, const byte *key,
+uchar *hp_search_next(HP_INFO *info, HP_KEYDEF *keyinfo, const uchar *key,
HASH_INFO *pos)
{
DBUG_ENTER("hp_search_next");
@@ -238,7 +238,7 @@ void hp_movelink(HASH_INFO *pos, HASH_INFO *next_link, HASH_INFO *newlink)
/* Calc hashvalue for a key */
-ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
+ulong hp_hashnr(register HP_KEYDEF *keydef, register const uchar *key)
{
/*register*/
ulong nr=1, nr2=4;
@@ -304,7 +304,7 @@ ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
/* Calc hashvalue for a key in a record */
-ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
+ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const uchar *rec)
{
ulong nr=1, nr2=4;
HA_KEYSEG *seg,*endseg;
@@ -377,9 +377,15 @@ ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
* far, and works well on both numbers and strings.
*/
-ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
+ulong hp_hashnr(register HP_KEYDEF *keydef, register const uchar *key)
{
- register ulong nr=0;
+ /*
+ Note, if a key consists of a combination of numeric and
+ a text columns, it most likely won't work well.
+ Making text columns work with NEW_HASH_FUNCTION
+ needs also changes in strings/ctype-xxx.c.
+ */
+ ulong nr= 1, nr2= 4;
HA_KEYSEG *seg,*endseg;
for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; seg++)
@@ -401,14 +407,15 @@ ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
}
if (seg->type == HA_KEYTYPE_TEXT)
{
- seg->charset->hash_sort(seg->charset,pos,((uchar*)key)-pos,&nr,NULL);
+ seg->charset->coll->hash_sort(seg->charset, pos, ((uchar*)key)-pos,
+ &nr, &nr2);
}
else if (seg->type == HA_KEYTYPE_VARTEXT1) /* Any VARCHAR segments */
{
uint pack_length= 2; /* Key packing is constant */
uint length= uint2korr(pos);
- seg->charset->hash_sort(seg->charset, pos+pack_length, length, &nr,
- NULL);
+ seg->charset->coll->hash_sort(seg->charset, pos+pack_length, length,
+ &nr, &nr2);
key+= pack_length;
}
else
@@ -426,9 +433,9 @@ ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
/* Calc hashvalue for a key in a record */
-ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
+ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const uchar *rec)
{
- register ulong nr=0;
+ ulong nr= 1, nr2= 4;
HA_KEYSEG *seg,*endseg;
for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; seg++)
@@ -444,14 +451,16 @@ ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
}
if (seg->type == HA_KEYTYPE_TEXT)
{
- seg->charset->hash_sort(seg->charset,pos,((uchar*)key)-pos,&nr,NULL);
+ uint char_length= seg->length; /* TODO: fix to use my_charpos() */
+ seg->charset->coll->hash_sort(seg->charset, pos, char_length,
+ &nr, &nr2);
}
else if (seg->type == HA_KEYTYPE_VARTEXT1) /* Any VARCHAR segments */
{
uint pack_length= seg->bit_start;
uint length= (pack_length == 1 ? (uint) *(uchar*) pos : uint2korr(pos));
- seg->charset->hash_sort(seg->charset, pos+pack_length,
- length, &nr, NULL);
+ seg->charset->coll->hash_sort(seg->charset, pos+pack_length,
+ length, &nr, &nr2);
}
else
{
@@ -490,7 +499,7 @@ ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
<> 0 Key differes
*/
-int hp_rec_key_cmp(HP_KEYDEF *keydef, const byte *rec1, const byte *rec2,
+int hp_rec_key_cmp(HP_KEYDEF *keydef, const uchar *rec1, const uchar *rec2,
my_bool diff_if_only_endspace_difference)
{
HA_KEYSEG *seg,*endseg;
@@ -577,7 +586,7 @@ int hp_rec_key_cmp(HP_KEYDEF *keydef, const byte *rec1, const byte *rec2,
/* Compare a key in a record to a whole key */
-int hp_key_cmp(HP_KEYDEF *keydef, const byte *rec, const byte *key)
+int hp_key_cmp(HP_KEYDEF *keydef, const uchar *rec, const uchar *key)
{
HA_KEYSEG *seg,*endseg;
@@ -661,7 +670,7 @@ int hp_key_cmp(HP_KEYDEF *keydef, const byte *rec, const byte *key)
/* Copy a key from a record to a keybuffer */
-void hp_make_key(HP_KEYDEF *keydef, byte *key, const byte *rec)
+void hp_make_key(HP_KEYDEF *keydef, uchar *key, const uchar *rec)
{
HA_KEYSEG *seg,*endseg;
@@ -693,10 +702,10 @@ void hp_make_key(HP_KEYDEF *keydef, byte *key, const byte *rec)
} while(0)
-uint hp_rb_make_key(HP_KEYDEF *keydef, byte *key,
- const byte *rec, byte *recpos)
+uint hp_rb_make_key(HP_KEYDEF *keydef, uchar *key,
+ const uchar *rec, uchar *recpos)
{
- byte *start_key= key;
+ uchar *start_key= key;
HA_KEYSEG *seg, *endseg;
for (seg= keydef->seg, endseg= seg + keydef->keysegs; seg < endseg; seg++)
@@ -710,7 +719,7 @@ uint hp_rb_make_key(HP_KEYDEF *keydef, byte *key,
if (seg->flag & HA_SWAP_KEY)
{
uint length= seg->length;
- byte *pos= (byte*) rec + seg->start;
+ uchar *pos= (uchar*) rec + seg->start;
#ifdef HAVE_ISNAN
if (seg->type == HA_KEYTYPE_FLOAT)
@@ -759,7 +768,7 @@ uint hp_rb_make_key(HP_KEYDEF *keydef, byte *key,
set_if_smaller(length,tmp_length);
FIX_LENGTH(cs, pos, length, char_length);
store_key_length_inc(key,char_length);
- memcpy((byte*) key,(byte*) pos,(size_t) char_length);
+ memcpy((uchar*) key,(uchar*) pos,(size_t) char_length);
key+= char_length;
continue;
}
@@ -778,7 +787,7 @@ uint hp_rb_make_key(HP_KEYDEF *keydef, byte *key,
memcpy(key, rec + seg->start, (size_t) char_length);
key+= seg->length;
}
- memcpy(key, &recpos, sizeof(byte*));
+ memcpy(key, &recpos, sizeof(uchar*));
return (uint) (key - start_key);
}
@@ -802,7 +811,7 @@ uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old,
if (seg->flag & HA_SWAP_KEY)
{
uint length= seg->length;
- byte *pos= (byte*) old + length;
+ uchar *pos= (uchar*) old + length;
while (length--)
{
@@ -822,7 +831,7 @@ uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old,
set_if_smaller(length,tmp_length); /* Safety */
FIX_LENGTH(cs, old, length, char_length);
store_key_length_inc(key,char_length);
- memcpy((byte*) key, old,(size_t) char_length);
+ memcpy((uchar*) key, old,(size_t) char_length);
key+= char_length;
continue;
}
@@ -844,15 +853,15 @@ uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old,
uint hp_rb_key_length(HP_KEYDEF *keydef,
- const byte *key __attribute__((unused)))
+ const uchar *key __attribute__((unused)))
{
return keydef->length;
}
-uint hp_rb_null_key_length(HP_KEYDEF *keydef, const byte *key)
+uint hp_rb_null_key_length(HP_KEYDEF *keydef, const uchar *key)
{
- const byte *start_key= key;
+ const uchar *start_key= key;
HA_KEYSEG *seg, *endseg;
for (seg= keydef->seg, endseg= seg + keydef->keysegs; seg < endseg; seg++)
@@ -865,9 +874,9 @@ uint hp_rb_null_key_length(HP_KEYDEF *keydef, const byte *key)
}
-uint hp_rb_var_key_length(HP_KEYDEF *keydef, const byte *key)
+uint hp_rb_var_key_length(HP_KEYDEF *keydef, const uchar *key)
{
- const byte *start_key= key;
+ const uchar *start_key= key;
HA_KEYSEG *seg, *endseg;
for (seg= keydef->seg, endseg= seg + keydef->keysegs; seg < endseg; seg++)
@@ -892,7 +901,7 @@ uint hp_rb_var_key_length(HP_KEYDEF *keydef, const byte *key)
0 otherwise
*/
-my_bool hp_if_null_in_key(HP_KEYDEF *keydef, const byte *record)
+my_bool hp_if_null_in_key(HP_KEYDEF *keydef, const uchar *record)
{
HA_KEYSEG *seg,*endseg;
for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; seg++)
@@ -918,7 +927,7 @@ my_bool hp_if_null_in_key(HP_KEYDEF *keydef, const byte *record)
less than zero.
*/
-void heap_update_auto_increment(HP_INFO *info, const byte *record)
+void heap_update_auto_increment(HP_INFO *info, const uchar *record)
{
ulonglong value= 0; /* Store unsigned values here */
longlong s_value= 0; /* Store signed values here */
diff --git a/storage/heap/hp_info.c b/storage/heap/hp_info.c
index 2c58604eed1..ea78c53fd40 100644
--- a/storage/heap/hp_info.c
+++ b/storage/heap/hp_info.c
@@ -18,7 +18,7 @@
#include "heapdef.h"
-byte *heap_position(HP_INFO *info)
+uchar *heap_position(HP_INFO *info)
{
return ((info->update & HA_STATE_AKTIV) ? info->current_ptr :
(HEAP_PTR) 0);
diff --git a/storage/heap/hp_open.c b/storage/heap/hp_open.c
index 02a8d4f95ca..4d5ec6e27ac 100644
--- a/storage/heap/hp_open.c
+++ b/storage/heap/hp_open.c
@@ -22,43 +22,34 @@
#include "my_sys.h"
-HP_INFO *heap_open(const char *name, int mode)
+/*
+ Open heap table based on HP_SHARE structure
+
+ NOTE
+ This doesn't register the table in the open table list.
+*/
+
+HP_INFO *heap_open_from_share(HP_SHARE *share, int mode)
{
HP_INFO *info;
- HP_SHARE *share;
+ DBUG_ENTER("heap_open_from_share");
- DBUG_ENTER("heap_open");
- pthread_mutex_lock(&THR_LOCK_heap);
- if (!(share= hp_find_named_heap(name)))
- {
- my_errno= ENOENT;
- pthread_mutex_unlock(&THR_LOCK_heap);
- DBUG_RETURN(0);
- }
if (!(info= (HP_INFO*) my_malloc((uint) sizeof(HP_INFO) +
2 * share->max_key_length,
MYF(MY_ZEROFILL))))
{
- pthread_mutex_unlock(&THR_LOCK_heap);
DBUG_RETURN(0);
}
share->open_count++;
#ifdef THREAD
thr_lock_data_init(&share->lock,&info->lock,NULL);
#endif
- info->open_list.data= (void*) info;
- heap_open_list= list_add(heap_open_list,&info->open_list);
- pthread_mutex_unlock(&THR_LOCK_heap);
-
info->s= share;
- info->lastkey= (byte*) (info + 1);
- info->recbuf= (byte*) (info->lastkey + share->max_key_length);
+ info->lastkey= (uchar*) (info + 1);
+ info->recbuf= (uchar*) (info->lastkey + share->max_key_length);
info->mode= mode;
info->current_record= (ulong) ~0L; /* No current record */
- info->current_ptr= 0;
- info->current_hash_ptr= 0;
info->lastinx= info->errkey= -1;
- info->update= 0;
#ifndef DBUG_OFF
info->opt_flag= READ_CHECK_USED; /* Check when changing */
#endif
@@ -68,7 +59,59 @@ HP_INFO *heap_open(const char *name, int mode)
DBUG_RETURN(info);
}
- /* map name to a heap-nr. If name isn't found return 0 */
+
+/*
+ Open heap table based on HP_SHARE structure and register it
+*/
+
+HP_INFO *heap_open_from_share_and_register(HP_SHARE *share, int mode)
+{
+ HP_INFO *info;
+ DBUG_ENTER("heap_open_from_share_and_register");
+
+ pthread_mutex_lock(&THR_LOCK_heap);
+ if ((info= heap_open_from_share(share, mode)))
+ {
+ info->open_list.data= (void*) info;
+ heap_open_list= list_add(heap_open_list,&info->open_list);
+ }
+ pthread_mutex_unlock(&THR_LOCK_heap);
+ DBUG_RETURN(info);
+}
+
+
+/*
+ Open heap table based on name
+
+ NOTE
+ This register the table in the open table list. so that it can be
+ found by future heap_open() calls.
+*/
+
+HP_INFO *heap_open(const char *name, int mode)
+{
+ HP_INFO *info;
+ HP_SHARE *share;
+ DBUG_ENTER("heap_open");
+
+ pthread_mutex_lock(&THR_LOCK_heap);
+ if (!(share= hp_find_named_heap(name)))
+ {
+ my_errno= ENOENT;
+ pthread_mutex_unlock(&THR_LOCK_heap);
+ DBUG_RETURN(0);
+ }
+ if ((info= heap_open_from_share(share, mode)))
+ {
+ info->open_list.data= (void*) info;
+ heap_open_list= list_add(heap_open_list,&info->open_list);
+ }
+ pthread_mutex_unlock(&THR_LOCK_heap);
+ DBUG_RETURN(info);
+}
+
+
+/* map name to a heap-nr. If name isn't found return 0 */
HP_SHARE *hp_find_named_heap(const char *name)
{
diff --git a/storage/heap/hp_rfirst.c b/storage/heap/hp_rfirst.c
index d1842949421..48c1e625bd8 100644
--- a/storage/heap/hp_rfirst.c
+++ b/storage/heap/hp_rfirst.c
@@ -17,7 +17,7 @@
/* Read first record with the current key */
-int heap_rfirst(HP_INFO *info, byte *record, int inx)
+int heap_rfirst(HP_INFO *info, uchar *record, int inx)
{
HP_SHARE *share = info->s;
HP_KEYDEF *keyinfo = share->keydef + inx;
@@ -26,13 +26,13 @@ int heap_rfirst(HP_INFO *info, byte *record, int inx)
info->lastinx= inx;
if (keyinfo->algorithm == HA_KEY_ALG_BTREE)
{
- byte *pos;
+ uchar *pos;
if ((pos = tree_search_edge(&keyinfo->rb_tree, info->parents,
&info->last_pos, offsetof(TREE_ELEMENT, left))))
{
memcpy(&pos, pos + (*keyinfo->get_key_length)(keyinfo, pos),
- sizeof(byte*));
+ sizeof(uchar*));
info->current_ptr = pos;
memcpy(record, pos, (size_t)share->reclength);
info->update = HA_STATE_AKTIV;
diff --git a/storage/heap/hp_rkey.c b/storage/heap/hp_rkey.c
index ced81985f99..6eeac6acd7b 100644
--- a/storage/heap/hp_rkey.c
+++ b/storage/heap/hp_rkey.c
@@ -15,10 +15,10 @@
#include "heapdef.h"
-int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key,
+int heap_rkey(HP_INFO *info, uchar *record, int inx, const uchar *key,
key_part_map keypart_map, enum ha_rkey_function find_flag)
{
- byte *pos;
+ uchar *pos;
HP_SHARE *share= info->s;
HP_KEYDEF *keyinfo= share->keydef + inx;
DBUG_ENTER("heap_rkey");
@@ -53,7 +53,7 @@ int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key,
info->update= 0;
DBUG_RETURN(my_errno= HA_ERR_KEY_NOT_FOUND);
}
- memcpy(&pos, pos + (*keyinfo->get_key_length)(keyinfo, pos), sizeof(byte*));
+ memcpy(&pos, pos + (*keyinfo->get_key_length)(keyinfo, pos), sizeof(uchar*));
info->current_ptr= pos;
}
else
@@ -74,7 +74,7 @@ int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key,
/* Quick find of record */
-gptr heap_find(HP_INFO *info, int inx, const byte *key)
+uchar* heap_find(HP_INFO *info, int inx, const uchar *key)
{
return hp_search(info, info->s->keydef + inx, key, 0);
}
diff --git a/storage/heap/hp_rlast.c b/storage/heap/hp_rlast.c
index b72e815147f..45ad7c21f49 100644
--- a/storage/heap/hp_rlast.c
+++ b/storage/heap/hp_rlast.c
@@ -18,7 +18,7 @@
/* Read first record with the current key */
-int heap_rlast(HP_INFO *info, byte *record, int inx)
+int heap_rlast(HP_INFO *info, uchar *record, int inx)
{
HP_SHARE *share= info->s;
HP_KEYDEF *keyinfo= share->keydef + inx;
@@ -27,13 +27,13 @@ int heap_rlast(HP_INFO *info, byte *record, int inx)
info->lastinx= inx;
if (keyinfo->algorithm == HA_KEY_ALG_BTREE)
{
- byte *pos;
+ uchar *pos;
if ((pos = tree_search_edge(&keyinfo->rb_tree, info->parents,
&info->last_pos, offsetof(TREE_ELEMENT, right))))
{
memcpy(&pos, pos + (*keyinfo->get_key_length)(keyinfo, pos),
- sizeof(byte*));
+ sizeof(uchar*));
info->current_ptr = pos;
memcpy(record, pos, (size_t)share->reclength);
info->update = HA_STATE_AKTIV;
diff --git a/storage/heap/hp_rnext.c b/storage/heap/hp_rnext.c
index 3b436fe87aa..262754e9e64 100644
--- a/storage/heap/hp_rnext.c
+++ b/storage/heap/hp_rnext.c
@@ -17,9 +17,9 @@
/* Read next record with the same key */
-int heap_rnext(HP_INFO *info, byte *record)
+int heap_rnext(HP_INFO *info, uchar *record)
{
- byte *pos;
+ uchar *pos;
HP_SHARE *share=info->s;
HP_KEYDEF *keyinfo;
DBUG_ENTER("heap_rnext");
@@ -47,7 +47,7 @@ int heap_rnext(HP_INFO *info, byte *record)
if (pos)
{
memcpy(&pos, pos + (*keyinfo->get_key_length)(keyinfo, pos),
- sizeof(byte*));
+ sizeof(uchar*));
info->current_ptr = pos;
}
else
diff --git a/storage/heap/hp_rprev.c b/storage/heap/hp_rprev.c
index bfdd2f9d47a..63bfffffba9 100644
--- a/storage/heap/hp_rprev.c
+++ b/storage/heap/hp_rprev.c
@@ -18,9 +18,9 @@
/* Read prev record for key */
-int heap_rprev(HP_INFO *info, byte *record)
+int heap_rprev(HP_INFO *info, uchar *record)
{
- byte *pos;
+ uchar *pos;
HP_SHARE *share=info->s;
HP_KEYDEF *keyinfo;
DBUG_ENTER("heap_rprev");
@@ -47,7 +47,7 @@ int heap_rprev(HP_INFO *info, byte *record)
if (pos)
{
memcpy(&pos, pos + (*keyinfo->get_key_length)(keyinfo, pos),
- sizeof(byte*));
+ sizeof(uchar*));
info->current_ptr = pos;
}
else
diff --git a/storage/heap/hp_rrnd.c b/storage/heap/hp_rrnd.c
index ad0190cc00c..3ac23d293f2 100644
--- a/storage/heap/hp_rrnd.c
+++ b/storage/heap/hp_rrnd.c
@@ -24,7 +24,7 @@
HA_ERR_END_OF_FILE = EOF.
*/
-int heap_rrnd(register HP_INFO *info, byte *record, byte *pos)
+int heap_rrnd(register HP_INFO *info, uchar *record, uchar *pos)
{
HP_SHARE *share=info->s;
DBUG_ENTER("heap_rrnd");
@@ -59,7 +59,7 @@ int heap_rrnd(register HP_INFO *info, byte *record, byte *pos)
HA_ERR_END_OF_FILE = EOF.
*/
-int heap_rrnd_old(register HP_INFO *info, byte *record, ulong pos)
+int heap_rrnd_old(register HP_INFO *info, uchar *record, ulong pos)
{
HP_SHARE *share=info->s;
DBUG_ENTER("heap_rrnd");
diff --git a/storage/heap/hp_rsame.c b/storage/heap/hp_rsame.c
index 10513f91726..1a3724672b6 100644
--- a/storage/heap/hp_rsame.c
+++ b/storage/heap/hp_rsame.c
@@ -25,7 +25,7 @@
HA_ERR_KEY_NOT_FOUND = Record not found with key
*/
-int heap_rsame(register HP_INFO *info, byte *record, int inx)
+int heap_rsame(register HP_INFO *info, uchar *record, int inx)
{
HP_SHARE *share=info->s;
DBUG_ENTER("heap_rsame");
diff --git a/storage/heap/hp_scan.c b/storage/heap/hp_scan.c
index 4249ac4148a..e8913e92c86 100644
--- a/storage/heap/hp_scan.c
+++ b/storage/heap/hp_scan.c
@@ -34,7 +34,7 @@ int heap_scan_init(register HP_INFO *info)
DBUG_RETURN(0);
}
-int heap_scan(register HP_INFO *info, byte *record)
+int heap_scan(register HP_INFO *info, uchar *record)
{
HP_SHARE *share=info->s;
ulong pos;
diff --git a/storage/heap/hp_test1.c b/storage/heap/hp_test1.c
index 31c9b8f2f30..b1b55098a78 100644
--- a/storage/heap/hp_test1.c
+++ b/storage/heap/hp_test1.c
@@ -32,11 +32,12 @@ int main(int argc, char **argv)
{
int i,j,error,deleted;
HP_INFO *file;
- char record[128],key[32];
+ uchar record[128],key[32];
const char *filename;
HP_KEYDEF keyinfo[10];
HA_KEYSEG keyseg[4];
HP_CREATE_INFO hp_create_info;
+ HP_SHARE *tmp_share;
MY_INIT(argv[0]);
filename= "test1";
@@ -52,23 +53,24 @@ int main(int argc, char **argv)
keyinfo[0].seg[0].start=1;
keyinfo[0].seg[0].length=6;
keyinfo[0].seg[0].charset= &my_charset_latin1;
+ keyinfo[0].seg[0].null_bit= 0;
keyinfo[0].flag = HA_NOSAME;
deleted=0;
- bzero((gptr) flags,sizeof(flags));
+ bzero((uchar*) flags,sizeof(flags));
printf("- Creating heap-file\n");
if (heap_create(filename,1,keyinfo,30,(ulong) flag*100000L,10L,
- &hp_create_info) ||
+ &hp_create_info, &tmp_share) ||
!(file= heap_open(filename, 2)))
goto err;
printf("- Writing records:s\n");
- strmov(record," ..... key ");
+ strmov((char*) record," ..... key ");
for (i=49 ; i>=1 ; i-=2 )
{
j=i%25 +1;
- sprintf(key,"%6d",j);
+ sprintf((char*) key,"%6d",j);
bmove(record+1,key,6);
error=heap_write(file,record);
if (heap_check_heap(file,0))
@@ -90,18 +92,18 @@ int main(int argc, char **argv)
for (i=1 ; i<=10 ; i++)
{
if (i == remove_ant) { VOID(heap_close(file)) ; return (0) ; }
- sprintf(key,"%6d",(j=(int) ((rand() & 32767)/32767.*25)));
+ sprintf((char*) key,"%6d",(j=(int) ((rand() & 32767)/32767.*25)));
if ((error = heap_rkey(file,record,0,key,6,HA_READ_KEY_EXACT)))
{
if (verbose || (flags[j] == 1 ||
(error && my_errno != HA_ERR_KEY_NOT_FOUND)))
- printf("key: %s rkey: %3d my_errno: %3d\n",key,error,my_errno);
+ printf("key: %s rkey: %3d my_errno: %3d\n",(char*) key,error,my_errno);
}
else
{
error=heap_delete(file,record);
if (error || verbose)
- printf("key: %s delete: %d my_errno: %d\n",key,error,my_errno);
+ printf("key: %s delete: %d my_errno: %d\n",(char*) key,error,my_errno);
flags[j]=0;
if (! error)
deleted++;
@@ -116,7 +118,7 @@ int main(int argc, char **argv)
printf("- Reading records with key\n");
for (i=1 ; i<=25 ; i++)
{
- sprintf(key,"%6d",i);
+ sprintf((char*) key,"%6d",i);
bmove(record+1,key,6);
my_errno=0;
error=heap_rkey(file,record,0,key,6,HA_READ_KEY_EXACT);
@@ -125,7 +127,7 @@ int main(int argc, char **argv)
(error && (flags[i] != 0 || my_errno != HA_ERR_KEY_NOT_FOUND)))
{
printf("key: %s rkey: %3d my_errno: %3d record: %s\n",
- key,error,my_errno,record+1);
+ (char*) key,error,my_errno,record+1);
}
}
@@ -148,7 +150,7 @@ int main(int argc, char **argv)
if (verbose || (error != 0 && error != HA_ERR_RECORD_DELETED))
{
printf("pos: %2d ni_rrnd: %3d my_errno: %3d record: %s\n",
- i-1,error,my_errno,record+1);
+ i-1,error,my_errno,(char*) record+1);
}
}
}
diff --git a/storage/heap/hp_test2.c b/storage/heap/hp_test2.c
index dcca5fb44b9..e57a554e5d9 100644
--- a/storage/heap/hp_test2.c
+++ b/storage/heap/hp_test2.c
@@ -42,8 +42,8 @@ static my_bool key3[MAX_RECORDS];
static int reclength=39;
-static int calc_check(byte *buf,uint length);
-static void make_record(char *record, uint n1, uint n2, uint n3,
+static int calc_check(uchar *buf,uint length);
+static void make_record(uchar *record, uint n1, uint n2, uint n3,
const char *mark, uint count);
/* Main program */
@@ -56,9 +56,10 @@ int main(int argc, char *argv[])
int error;
ulong pos;
unsigned long key_check;
- char record[128],record2[128],record3[128],key[10];
+ uchar record[128],record2[128],record3[128],key[10];
const char *filename,*filename2;
HP_INFO *file,*file2;
+ HP_SHARE *tmp_share;
HP_KEYDEF keyinfo[MAX_KEYS];
HA_KEYSEG keyseg[MAX_KEYS*5];
HEAP_PTR position;
@@ -126,13 +127,13 @@ int main(int argc, char *argv[])
printf("- Creating heap-file\n");
if (heap_create(filename,keys,keyinfo,reclength,(ulong) flag*100000L,
- (ulong) recant/2, &hp_create_info) ||
+ (ulong) recant/2, &hp_create_info, &tmp_share) ||
!(file= heap_open(filename, 2)))
goto err;
signal(SIGINT,endprog);
printf("- Writing records:s\n");
- strmov(record," ..... key");
+ strmov((char*) record," ..... key");
for (i=0 ; i < recant ; i++)
{
@@ -178,10 +179,10 @@ int main(int argc, char *argv[])
for (j=rnd(1000)+1 ; j>0 && key1[j] == 0 ; j--) ;
if (j != 0)
{
- sprintf(key,"%6d",j);
+ sprintf((char*) key,"%6d",j);
if (heap_rkey(file,record,0,key,6, HA_READ_KEY_EXACT))
{
- printf("can't find key1: \"%s\"\n",key);
+ printf("can't find key1: \"%s\"\n",(char*) key);
goto err;
}
#ifdef NOT_USED
@@ -191,13 +192,13 @@ int main(int argc, char *argv[])
#endif
if (heap_delete(file,record))
{
- printf("error: %d; can't delete record: \"%s\"\n", my_errno,record);
+ printf("error: %d; can't delete record: \"%s\"\n", my_errno,(char*) record);
goto err;
}
opt_delete++;
- key1[atoi(record+keyinfo[0].seg[0].start)]--;
- key3[atoi(record+keyinfo[2].seg[0].start)]=0;
- key_check-=atoi(record);
+ key1[atoi((char*) record+keyinfo[0].seg[0].start)]--;
+ key3[atoi((char*) record+keyinfo[2].seg[0].start)]=0;
+ key_check-=atoi((char*) record);
if (testflag == 2 && heap_check_heap(file,0))
{
puts("Heap keys crashed");
@@ -238,10 +239,10 @@ int main(int argc, char *argv[])
for (j=rnd(1000)+1 ; j>0 && key1[j] == 0 ; j--) ;
if (!key1[j])
continue;
- sprintf(key,"%6d",j);
+ sprintf((char*) key,"%6d",j);
if (heap_rkey(file,record,0,key,6, HA_READ_KEY_EXACT))
{
- printf("can't find key1: \"%s\"\n",key);
+ printf("can't find key1: \"%s\"\n",(char*) key);
goto err;
}
}
@@ -250,19 +251,20 @@ int main(int argc, char *argv[])
if (my_errno != HA_ERR_FOUND_DUPP_KEY || key3[n3] == 0)
{
printf("error: %d; can't update:\nFrom: \"%s\"\nTo: \"%s\"\n",
- my_errno,record,record2);
+ my_errno,(char*) record, (char*) record2);
goto err;
}
if (verbose)
- printf("Double key when tried to update:\nFrom: \"%s\"\nTo: \"%s\"\n",record,record2);
+ printf("Double key when tried to update:\nFrom: \"%s\"\nTo: \"%s\"\n",
+ (char*) record, (char*) record2);
}
else
{
- key1[atoi(record+keyinfo[0].seg[0].start)]--;
- key3[atoi(record+keyinfo[2].seg[0].start)]=0;
+ key1[atoi((char*) record+keyinfo[0].seg[0].start)]--;
+ key3[atoi((char*) record+keyinfo[2].seg[0].start)]=0;
key1[n1]++; key3[n3]=1;
update++;
- key_check=key_check-atoi(record)+n1;
+ key_check=key_check-atoi((char*) record)+n1;
}
if (testflag == 3 && heap_check_heap(file,0))
{
@@ -280,7 +282,7 @@ int main(int argc, char *argv[])
for (i=999, dupp_keys=found_key=0 ; i>0 ; i--)
{
if (key1[i] > dupp_keys) { dupp_keys=key1[i]; found_key=i; }
- sprintf(key,"%6d",found_key);
+ sprintf((char*) key,"%6d",found_key);
}
if (dupp_keys > 3)
@@ -293,9 +295,9 @@ int main(int argc, char *argv[])
goto err;
if (heap_rnext(file,record3)) goto err;
if (heap_delete(file,record3)) goto err;
- key_check-=atoi(record3);
- key1[atoi(record+keyinfo[0].seg[0].start)]--;
- key3[atoi(record+keyinfo[2].seg[0].start)]=0;
+ key_check-=atoi((char*) record3);
+ key1[atoi((char*) record+keyinfo[0].seg[0].start)]--;
+ key3[atoi((char*) record+keyinfo[2].seg[0].start)]=0;
opt_delete++;
ant=2;
while ((error=heap_rnext(file,record3)) == 0 ||
@@ -320,16 +322,16 @@ int main(int argc, char *argv[])
if (heap_rlast(file,record3,0)) goto err;
if (heap_delete(file,record3)) goto err;
- key_check-=atoi(record3);
- key1[atoi(record+keyinfo[0].seg[0].start)]--;
- key3[atoi(record+keyinfo[2].seg[0].start)]=0;
+ key_check-=atoi((char*) record3);
+ key1[atoi((char*) record+keyinfo[0].seg[0].start)]--;
+ key3[atoi((char*) record+keyinfo[2].seg[0].start)]=0;
opt_delete++;
if (heap_rprev(file,record3) || heap_rprev(file,record3))
goto err;
if (heap_delete(file,record3)) goto err;
- key_check-=atoi(record3);
- key1[atoi(record+keyinfo[0].seg[0].start)]--;
- key3[atoi(record+keyinfo[2].seg[0].start)]=0;
+ key_check-=atoi((char*) record3);
+ key1[atoi((char*) record+keyinfo[0].seg[0].start)]--;
+ key3[atoi((char*) record+keyinfo[2].seg[0].start)]=0;
opt_delete++;
ant=3;
while ((error=heap_rprev(file,record3)) == 0 ||
@@ -364,10 +366,10 @@ int main(int argc, char *argv[])
if (error)
goto err;
if (heap_delete(file,record3)) goto err;
- key_check-=atoi(record3);
+ key_check-=atoi((char*) record3);
opt_delete++;
- key1[atoi(record+keyinfo[0].seg[0].start)]--;
- key3[atoi(record+keyinfo[2].seg[0].start)]=0;
+ key1[atoi((char*) record+keyinfo[0].seg[0].start)]--;
+ key3[atoi((char*) record+keyinfo[2].seg[0].start)]=0;
ant=0;
while ((error=heap_scan(file,record3)) == 0 ||
error == HA_ERR_RECORD_DELETED)
@@ -509,7 +511,7 @@ int main(int argc, char *argv[])
for (i=999, dupp_keys=found_key=0 ; i>0 ; i--)
{
if (key1[i] > dupp_keys) { dupp_keys=key1[i]; found_key=i; }
- sprintf(key,"%6d",found_key);
+ sprintf((char*) key,"%6d",found_key);
}
printf("- Read through all keys with first-next-last-prev\n");
ant=0;
@@ -562,8 +564,9 @@ int main(int argc, char *argv[])
heap_close(file2);
printf("- Creating output heap-file 2\n");
- if (heap_create(filename2,1,keyinfo,reclength,0L,0L,&hp_create_info) ||
- !(file2= heap_open(filename2, 2)))
+ if (heap_create(filename2, 1, keyinfo, reclength, 0L, 0L, &hp_create_info,
+ &tmp_share) ||
+ !(file2= heap_open_from_share_and_register(tmp_share, 2)))
goto err;
printf("- Copying and removing records\n");
@@ -575,7 +578,7 @@ int main(int argc, char *argv[])
{
if (heap_write(file2,record))
goto err;
- key_check-=atoi(record);
+ key_check-=atoi((char*) record);
write_count++;
if (heap_delete(file,record))
goto err;
@@ -674,7 +677,7 @@ static sig_handler endprog(int sig_number __attribute__((unused)))
}
}
-static int calc_check(byte *buf, uint length)
+static int calc_check(uchar *buf, uint length)
{
int check=0;
while (length--)
@@ -682,11 +685,11 @@ static int calc_check(byte *buf, uint length)
return check;
}
-static void make_record(char *record, uint n1, uint n2, uint n3,
+static void make_record(uchar *record, uint n1, uint n2, uint n3,
const char *mark, uint count)
{
bfill(record,reclength,' ');
- sprintf(record,"%6d:%4d:%8d:%3.3s: %4d",
+ sprintf((char*) record,"%6d:%4d:%8d:%3.3s: %4d",
n1,n2,n3,mark,count);
record[37]='A'; /* Store A in null key */
record[38]=1; /* set as null */
diff --git a/storage/heap/hp_update.c b/storage/heap/hp_update.c
index e7314e3d38c..11dca974ad4 100644
--- a/storage/heap/hp_update.c
+++ b/storage/heap/hp_update.c
@@ -17,10 +17,10 @@
#include "heapdef.h"
-int heap_update(HP_INFO *info, const byte *old, const byte *heap_new)
+int heap_update(HP_INFO *info, const uchar *old, const uchar *heap_new)
{
HP_KEYDEF *keydef, *end, *p_lastinx;
- byte *pos;
+ uchar *pos;
bool auto_key_changed= 0;
HP_SHARE *share= info->s;
DBUG_ENTER("heap_update");
diff --git a/storage/heap/hp_write.c b/storage/heap/hp_write.c
index 19215fcf017..2abef2d9b43 100644
--- a/storage/heap/hp_write.c
+++ b/storage/heap/hp_write.c
@@ -25,14 +25,14 @@
#define HIGHFIND 4
#define HIGHUSED 8
-static byte *next_free_record_pos(HP_SHARE *info);
+static uchar *next_free_record_pos(HP_SHARE *info);
static HASH_INFO *hp_find_free_hash(HP_SHARE *info, HP_BLOCK *block,
ulong records);
-int heap_write(HP_INFO *info, const byte *record)
+int heap_write(HP_INFO *info, const uchar *record)
{
HP_KEYDEF *keydef, *end;
- byte *pos;
+ uchar *pos;
HP_SHARE *share=info->s;
DBUG_ENTER("heap_write");
#ifndef DBUG_OFF
@@ -88,7 +88,7 @@ err:
}
share->deleted++;
- *((byte**) pos)=share->del_link;
+ *((uchar**) pos)=share->del_link;
share->del_link=pos;
pos[share->reclength]=0; /* Record deleted */
@@ -99,8 +99,8 @@ err:
Write a key to rb_tree-index
*/
-int hp_rb_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, const byte *record,
- byte *recpos)
+int hp_rb_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, const uchar *record,
+ uchar *recpos)
{
heap_rb_param custom_arg;
uint old_allocated;
@@ -130,17 +130,17 @@ int hp_rb_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, const byte *record,
/* Find where to place new record */
-static byte *next_free_record_pos(HP_SHARE *info)
+static uchar *next_free_record_pos(HP_SHARE *info)
{
int block_pos;
- byte *pos;
- ulong length;
+ uchar *pos;
+ size_t length;
DBUG_ENTER("next_free_record_pos");
if (info->del_link)
{
pos=info->del_link;
- info->del_link= *((byte**) pos);
+ info->del_link= *((uchar**) pos);
info->deleted--;
DBUG_PRINT("exit",("Used old position: 0x%lx",(long) pos));
DBUG_RETURN(pos);
@@ -158,9 +158,9 @@ static byte *next_free_record_pos(HP_SHARE *info)
info->data_length+=length;
}
DBUG_PRINT("exit",("Used new position: 0x%lx",
- (long) ((byte*) info->block.level_info[0].last_blocks+
+ (long) ((uchar*) info->block.level_info[0].last_blocks+
block_pos * info->block.recbuffer)));
- DBUG_RETURN((byte*) info->block.level_info[0].last_blocks+
+ DBUG_RETURN((uchar*) info->block.level_info[0].last_blocks+
block_pos*info->block.recbuffer);
}
@@ -191,12 +191,12 @@ static byte *next_free_record_pos(HP_SHARE *info)
*/
int hp_write_key(HP_INFO *info, HP_KEYDEF *keyinfo,
- const byte *record, byte *recpos)
+ const uchar *record, uchar *recpos)
{
HP_SHARE *share = info->s;
int flag;
ulong halfbuff,hashnr,first_index;
- byte *ptr_to_rec,*ptr_to_rec2;
+ uchar *ptr_to_rec,*ptr_to_rec2;
HASH_INFO *empty,*gpos,*gpos2,*pos;
DBUG_ENTER("hp_write_key");
@@ -390,7 +390,7 @@ static HASH_INFO *hp_find_free_hash(HP_SHARE *info,
HP_BLOCK *block, ulong records)
{
uint block_pos;
- ulong length;
+ size_t length;
if (records < block->last_allocated)
return hp_find_hash(block,records);
@@ -401,6 +401,6 @@ static HASH_INFO *hp_find_free_hash(HP_SHARE *info,
info->index_length+=length;
}
block->last_allocated=records+1;
- return((HASH_INFO*) ((byte*) block->level_info[0].last_blocks+
+ return((HASH_INFO*) ((uchar*) block->level_info[0].last_blocks+
block_pos*block->recbuffer));
}
diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt
index 873a73be0ec..47b1a566cd8 100644..100755
--- a/storage/innobase/CMakeLists.txt
+++ b/storage/innobase/CMakeLists.txt
@@ -15,15 +15,16 @@
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 -D_WIN32 -DWIN32 -D_LIB)
+ADD_DEFINITIONS(-DMYSQL_SERVER -D_WIN32 -D_LIB)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib
- include
- handler
+ ${CMAKE_SOURCE_DIR}/storage/innobase/include
+ ${CMAKE_SOURCE_DIR}/storage/innobase/handler
${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/extra/yassl/include)
-ADD_LIBRARY(innobase btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c
+
+SET(INNOBASE_SOURCES btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c
buf/buf0buf.c buf/buf0flu.c buf/buf0lru.c buf/buf0rea.c
data/data0data.c data/data0type.c
dict/dict0boot.c dict/dict0crea.c dict/dict0dict.c dict/dict0load.c dict/dict0mem.c
@@ -54,3 +55,7 @@ ADD_LIBRARY(innobase btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c
trx/trx0purge.c trx/trx0rec.c trx/trx0roll.c trx/trx0rseg.c trx/trx0sys.c trx/trx0trx.c trx/trx0undo.c
usr/usr0sess.c
ut/ut0byte.c ut/ut0dbg.c ut/ut0mem.c ut/ut0rnd.c ut/ut0ut.c ut/ut0vec.c ut/ut0list.c ut/ut0wqueue.c)
+
+IF(NOT SOURCE_SUBLIBS)
+ ADD_LIBRARY(innobase ${INNOBASE_SOURCES})
+ENDIF(NOT SOURCE_SUBLIBS)
diff --git a/storage/innobase/Makefile.am b/storage/innobase/Makefile.am
index 62c0f8e817c..30e056d68fb 100644
--- a/storage/innobase/Makefile.am
+++ b/storage/innobase/Makefile.am
@@ -25,102 +25,149 @@ INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
-I$(top_srcdir)/sql \
-I$(srcdir)
-AUTOMAKE_OPTIONS = foreign
-TAR = gtar
+DEFS = @DEFS@
-noinst_HEADERS =
-SUBDIRS = os ut btr buf data dict dyn eval fil fsp fut \
- ha ibuf lock log mach mem mtr page \
- handler \
- pars que read rem row srv sync thr trx usr
+noinst_HEADERS = include/btr0btr.h include/btr0btr.ic \
+ include/btr0cur.h include/btr0cur.ic \
+ include/btr0pcur.h include/btr0pcur.ic \
+ include/btr0sea.h include/btr0sea.ic \
+ include/btr0types.h include/buf0buf.h \
+ include/buf0buf.ic include/buf0flu.h \
+ include/buf0flu.ic include/buf0lru.h \
+ include/buf0lru.ic include/buf0rea.h \
+ include/buf0types.h include/data0data.h \
+ include/data0data.ic include/data0type.h \
+ include/data0type.ic include/data0types.h \
+ include/db0err.h include/dict0boot.h \
+ include/dict0boot.ic include/dict0crea.h \
+ include/dict0crea.ic include/dict0dict.h \
+ include/dict0dict.ic include/dict0load.h \
+ include/dict0load.ic include/dict0mem.h \
+ include/dict0mem.ic include/dict0types.h \
+ include/dyn0dyn.h include/dyn0dyn.ic \
+ include/eval0eval.h include/eval0eval.ic \
+ include/eval0proc.h include/eval0proc.ic \
+ include/fil0fil.h include/fsp0fsp.h \
+ include/fsp0fsp.ic include/fut0fut.h \
+ include/fut0fut.ic include/fut0lst.h \
+ include/fut0lst.ic include/ha0ha.h \
+ include/ha0ha.ic include/hash0hash.h \
+ include/hash0hash.ic include/ibuf0ibuf.h \
+ include/ibuf0ibuf.ic include/ibuf0types.h \
+ include/lock0iter.h \
+ include/lock0lock.h include/lock0lock.ic \
+ include/lock0priv.h include/lock0priv.ic \
+ include/lock0types.h include/log0log.h \
+ include/log0log.ic include/log0recv.h \
+ include/log0recv.ic include/mach0data.h \
+ include/mach0data.ic include/mem0dbg.h \
+ include/mem0dbg.ic mem/mem0dbg.c \
+ include/mem0mem.h include/mem0mem.ic \
+ include/mem0pool.h include/mem0pool.ic \
+ include/mtr0log.h include/mtr0log.ic \
+ include/mtr0mtr.h include/mtr0mtr.ic \
+ include/mtr0types.h include/os0file.h \
+ include/os0proc.h include/os0proc.ic \
+ include/os0sync.h include/os0sync.ic \
+ include/os0thread.h include/os0thread.ic \
+ include/page0cur.h include/page0cur.ic \
+ include/page0page.h include/page0page.ic \
+ include/page0types.h include/pars0grm.h \
+ include/pars0opt.h include/pars0opt.ic \
+ include/pars0pars.h include/pars0pars.ic \
+ include/pars0sym.h include/pars0sym.ic \
+ include/pars0types.h include/que0que.h \
+ include/que0que.ic include/que0types.h \
+ include/read0read.h include/read0read.ic \
+ include/read0types.h include/rem0cmp.h \
+ include/rem0cmp.ic include/rem0rec.h \
+ include/rem0rec.ic include/rem0types.h \
+ include/row0ins.h include/row0ins.ic \
+ include/row0mysql.h include/row0mysql.ic \
+ include/row0purge.h include/row0purge.ic \
+ include/row0row.h include/row0row.ic \
+ include/row0sel.h include/row0sel.ic \
+ include/row0types.h include/row0uins.h \
+ include/row0uins.ic include/row0umod.h \
+ include/row0umod.ic include/row0undo.h \
+ include/row0undo.ic include/row0upd.h \
+ include/row0upd.ic include/row0vers.h \
+ include/row0vers.ic include/srv0que.h \
+ include/srv0srv.h include/srv0srv.ic \
+ include/srv0start.h include/sync0arr.h \
+ include/sync0arr.ic include/sync0rw.h \
+ include/sync0rw.ic include/sync0sync.h \
+ include/sync0sync.ic include/sync0types.h \
+ include/thr0loc.h include/thr0loc.ic \
+ include/trx0purge.h include/trx0purge.ic \
+ include/trx0rec.h include/trx0rec.ic \
+ include/trx0roll.h include/trx0roll.ic \
+ include/trx0rseg.h include/trx0rseg.ic \
+ include/trx0sys.h include/trx0sys.ic \
+ include/trx0trx.h include/trx0trx.ic \
+ include/trx0types.h include/trx0undo.h \
+ include/trx0undo.ic include/trx0xa.h \
+ include/univ.i include/usr0sess.h \
+ include/usr0sess.ic include/usr0types.h \
+ include/ut0byte.h include/ut0byte.ic \
+ include/ut0dbg.h include/ut0lst.h \
+ include/ut0mem.h include/ut0mem.ic \
+ include/ut0rnd.h include/ut0rnd.ic \
+ include/ut0sort.h include/ut0ut.h \
+ include/ut0ut.ic include/ut0vec.h \
+ include/ut0vec.ic include/ut0list.h \
+ include/ut0list.ic include/ut0wqueue.h \
+ include/ha_prototypes.h handler/ha_innodb.h
-EXTRA_DIST = include/btr0btr.h include/btr0btr.ic include/btr0cur.h include/btr0cur.ic \
- include/btr0pcur.h include/btr0pcur.ic include/btr0sea.h include/btr0sea.ic \
- include/btr0types.h \
- include/buf0buf.h include/buf0buf.ic include/buf0flu.h include/buf0flu.ic \
- include/buf0lru.h include/buf0lru.ic include/buf0rea.h include/buf0types.h \
- include/data0data.h include/data0data.ic include/data0type.h include/data0type.ic \
- include/data0types.h include/db0err.h \
- include/dict0boot.h include/dict0boot.ic include/dict0crea.h include/dict0crea.ic \
- include/dict0dict.h include/dict0dict.ic include/dict0load.h include/dict0load.ic \
- include/dict0mem.h include/dict0mem.ic include/dict0types.h \
- include/dyn0dyn.h include/dyn0dyn.ic \
- include/eval0eval.h include/eval0eval.ic include/eval0proc.h include/eval0proc.ic \
- include/fil0fil.h include/fsp0fsp.h include/fsp0fsp.ic \
- include/fut0fut.h include/fut0fut.ic include/fut0lst.h include/fut0lst.ic \
- include/ha0ha.h include/ha0ha.ic include/hash0hash.h include/hash0hash.ic \
- include/ibuf0ibuf.h include/ibuf0ibuf.ic include/ibuf0types.h \
- include/lock0lock.h include/lock0lock.ic include/lock0types.h \
- include/log0log.h include/log0log.ic include/log0recv.h include/log0recv.ic \
- include/mach0data.h include/mach0data.ic include/mem0dbg.h include/mem0dbg.ic \
- include/mem0mem.h include/mem0mem.ic include/mem0pool.h include/mem0pool.ic \
- include/mtr0log.h include/mtr0log.ic include/mtr0mtr.h include/mtr0mtr.ic \
- include/mtr0types.h include/os0file.h \
- include/os0proc.h include/os0proc.ic include/os0sync.h include/os0sync.ic \
- include/os0thread.h include/os0thread.ic \
- include/page0cur.h include/page0cur.ic include/page0page.h include/page0page.ic \
- include/page0types.h \
- include/pars0grm.h include/pars0opt.h include/pars0opt.ic \
- include/pars0pars.h include/pars0pars.ic include/pars0sym.h include/pars0sym.ic \
- include/pars0types.h \
- include/que0que.h include/que0que.ic include/que0types.h \
- include/read0read.h include/read0read.ic include/read0types.h \
- include/rem0cmp.h include/rem0cmp.ic include/rem0rec.h include/rem0rec.ic \
- include/rem0types.h \
- include/row0ins.h include/row0ins.ic include/row0mysql.h include/row0mysql.ic \
- include/row0purge.h include/row0purge.ic include/row0row.h include/row0row.ic \
- include/row0sel.h include/row0sel.ic include/row0types.h \
- include/row0uins.h include/row0uins.ic include/row0umod.h include/row0umod.ic \
- include/row0undo.h include/row0undo.ic include/row0upd.h include/row0upd.ic \
- include/row0vers.h include/row0vers.ic \
- include/srv0que.h include/srv0srv.h include/srv0srv.ic include/srv0start.h \
- include/sync0arr.h include/sync0arr.ic include/sync0rw.h include/sync0rw.ic \
- include/sync0sync.h include/sync0sync.ic include/sync0types.h \
- include/thr0loc.h include/thr0loc.ic \
- include/trx0purge.h include/trx0purge.ic include/trx0rec.h include/trx0rec.ic \
- include/trx0roll.h include/trx0roll.ic include/trx0rseg.h include/trx0rseg.ic \
- include/trx0sys.h include/trx0sys.ic include/trx0trx.h include/trx0trx.ic \
- include/trx0types.h include/trx0undo.h include/trx0undo.ic include/trx0xa.h \
- include/univ.i include/usr0sess.h include/usr0sess.ic include/usr0types.h \
- include/ut0byte.h include/ut0byte.ic include/ut0dbg.h include/ut0lst.h \
- include/ut0mem.h include/ut0mem.ic include/ut0rnd.h include/ut0rnd.ic \
- handler/ha_innodb.h \
- include/ut0sort.h include/ut0ut.h include/ut0ut.ic include/ut0vec.h include/ut0vec.ic include/ha_prototypes.h \
- include/ut0list.h include/ut0list.ic \
- include/ut0wqueue.h \
- pars/make_bison.sh pars/make_flex.sh \
- pars/pars0grm.y pars/pars0lex.l \
- CMakeLists.txt plug.in
+EXTRA_LIBRARIES = libinnobase.a
+noinst_LIBRARIES = @plugin_innobase_static_target@
+libinnobase_a_SOURCES = btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c \
+ btr/btr0sea.c buf/buf0buf.c buf/buf0flu.c \
+ buf/buf0lru.c buf/buf0rea.c data/data0data.c \
+ data/data0type.c dict/dict0boot.c \
+ dict/dict0crea.c dict/dict0dict.c \
+ dict/dict0load.c dict/dict0mem.c dyn/dyn0dyn.c \
+ eval/eval0eval.c eval/eval0proc.c \
+ fil/fil0fil.c fsp/fsp0fsp.c fut/fut0fut.c \
+ fut/fut0lst.c ha/ha0ha.c ha/hash0hash.c \
+ ibuf/ibuf0ibuf.c lock/lock0iter.c \
+ lock/lock0lock.c \
+ log/log0log.c log/log0recv.c mach/mach0data.c \
+ mem/mem0mem.c mem/mem0pool.c mtr/mtr0log.c \
+ mtr/mtr0mtr.c os/os0file.c os/os0proc.c \
+ os/os0sync.c os/os0thread.c page/page0cur.c \
+ page/page0page.c pars/lexyy.c pars/pars0grm.c \
+ pars/pars0opt.c pars/pars0pars.c \
+ pars/pars0sym.c que/que0que.c read/read0read.c \
+ rem/rem0cmp.c rem/rem0rec.c row/row0ins.c \
+ row/row0mysql.c row/row0purge.c row/row0row.c \
+ row/row0sel.c row/row0uins.c row/row0umod.c \
+ row/row0undo.c row/row0upd.c row/row0vers.c \
+ srv/srv0que.c srv/srv0srv.c srv/srv0start.c \
+ sync/sync0arr.c sync/sync0rw.c \
+ sync/sync0sync.c thr/thr0loc.c trx/trx0purge.c \
+ trx/trx0rec.c trx/trx0roll.c trx/trx0rseg.c \
+ trx/trx0sys.c trx/trx0trx.c trx/trx0undo.c \
+ usr/usr0sess.c ut/ut0byte.c ut/ut0dbg.c \
+ ut/ut0list.c ut/ut0mem.c ut/ut0rnd.c \
+ ut/ut0ut.c ut/ut0vec.c ut/ut0wqueue.c \
+ handler/ha_innodb.cc
-noinst_LIBRARIES = libinnobase.a
-libinnobase_a_LIBADD = usr/libusr.a srv/libsrv.a dict/libdict.a \
- que/libque.a srv/libsrv.a ibuf/libibuf.a \
- row/librow.a pars/libpars.a btr/libbtr.a \
- trx/libtrx.a read/libread.a usr/libusr.a \
- buf/libbuf.a ibuf/libibuf.a eval/libeval.a \
- log/liblog.a fsp/libfsp.a fut/libfut.a \
- fil/libfil.a lock/liblock.a mtr/libmtr.a \
- page/libpage.a rem/librem.a thr/libthr.a \
- sync/libsync.a data/libdata.a mach/libmach.a \
- ha/libha.a dyn/libdyn.a mem/libmem.a \
- handler/libhandler.a \
- ut/libut.a os/libos.a ut/libut.a
-libinnobase_a_SOURCES =
+libinnobase_a_CXXFLAGS= $(AM_CFLAGS)
+libinnobase_a_CFLAGS = $(AM_CFLAGS)
+EXTRA_LTLIBRARIES = ha_innodb.la
+pkglib_LTLIBRARIES = @plugin_innobase_shared_target@
-libinnobase.a: $(libinnobase_a_LIBADD)
- -rm -f $@
- if test "$(host_os)" = "netware" ; \
- then \
- $(libinnobase_a_AR) $@ $(libinnobase_a_LIBADD) ; \
- else \
- for arc in $(libinnobase_a_LIBADD); do \
- arpath=`echo $$arc|sed 's|[^/]*$$||'`; \
- $(AR) t $$arc|sed "s|^|$$arpath|"; \
- done | sort -u | xargs $(AR) cq $@ ; \
- $(RANLIB) $@ ; \
- fi
+ha_innodb_la_LDFLAGS = -module -rpath $(MYSQLLIBdir)
+ha_innodb_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
+ha_innodb_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
+ha_innodb_la_SOURCES = $(libinnobase_a_SOURCES)
+
+EXTRA_DIST = CMakeLists.txt plug.in \
+ pars/make_bison.sh pars/make_flex.sh \
+ pars/pars0grm.y pars/pars0lex.l
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/storage/innobase/btr/Makefile.am b/storage/innobase/btr/Makefile.am
deleted file mode 100644
index 6b09b289cdc..00000000000
--- a/storage/innobase/btr/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = libbtr.a
-
-libbtr_a_SOURCES = btr0btr.c btr0cur.c btr0pcur.c btr0sea.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/btr/btr0btr.c b/storage/innobase/btr/btr0btr.c
index 50a349e78d6..6e8b43aeb8d 100644
--- a/storage/innobase/btr/btr0btr.c
+++ b/storage/innobase/btr/btr0btr.c
@@ -2606,8 +2606,11 @@ btr_index_rec_validate(
rec_get_nth_field(rec, offsets, i, &len);
- /* Note that prefix indexes are not fixed size even when
- their type is CHAR. */
+ /* Note that if fixed_size != 0, it equals the
+ length of a fixed-size column in the clustered index.
+ A prefix index of the column is of fixed, but different
+ length. When fixed_size == 0, prefix_len is the maximum
+ length of the prefix index column. */
if ((dict_index_get_nth_field(index, i)->prefix_len == 0
&& len != UNIV_SQL_NULL && fixed_size
diff --git a/storage/innobase/buf/Makefile.am b/storage/innobase/buf/Makefile.am
deleted file mode 100644
index 946d5a2e5c2..00000000000
--- a/storage/innobase/buf/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = libbuf.a
-
-libbuf_a_SOURCES = buf0buf.c buf0flu.c buf0lru.c buf0rea.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c
index c847b8db9e2..469d3ac05d7 100644
--- a/storage/innobase/buf/buf0buf.c
+++ b/storage/innobase/buf/buf0buf.c
@@ -903,8 +903,7 @@ buf_block_make_young(
/* Note that we read freed_page_clock's without holding any mutex:
this is allowed since the result is used only in heuristics */
- if (buf_pool->freed_page_clock >= block->freed_page_clock
- + 1 + (buf_pool->curr_size / 4)) {
+ if (buf_block_peek_if_too_old(block)) {
mutex_enter(&buf_pool->mutex);
/* There has been freeing activity in the LRU list:
@@ -1648,6 +1647,15 @@ buf_page_init(
block->lock_hash_val = lock_rec_hash(space, offset);
+#ifdef UNIV_DEBUG_VALGRIND
+ if (!space) {
+ /* Silence valid Valgrind warnings about uninitialized
+ data being written to data files. There are some unused
+ bytes on some pages that InnoDB does not initialize. */
+ UNIV_MEM_VALID(block->frame, UNIV_PAGE_SIZE);
+ }
+#endif /* UNIV_DEBUG_VALGRIND */
+
/* Insert into the hash table of file pages */
if (buf_page_hash_get(space, offset)) {
diff --git a/storage/innobase/buf/buf0lru.c b/storage/innobase/buf/buf0lru.c
index 1e27144bdbf..7b49a7641af 100644
--- a/storage/innobase/buf/buf0lru.c
+++ b/storage/innobase/buf/buf0lru.c
@@ -244,7 +244,15 @@ buf_LRU_search_and_free_block(
frame at all */
if (block->frame) {
+ /* The page was declared uninitialized
+ by buf_LRU_block_remove_hashed_page().
+ We need to flag the contents of the
+ page valid (which it still is) in
+ order to avoid bogus Valgrind
+ warnings. */
+ UNIV_MEM_VALID(block->frame, UNIV_PAGE_SIZE);
btr_search_drop_page_hash_index(block->frame);
+ UNIV_MEM_INVALID(block->frame, UNIV_PAGE_SIZE);
}
ut_a(block->buf_fix_count == 0);
@@ -449,6 +457,7 @@ loop:
mutex_enter(&block->mutex);
block->state = BUF_BLOCK_READY_FOR_USE;
+ UNIV_MEM_ALLOC(block->frame, UNIV_PAGE_SIZE);
mutex_exit(&block->mutex);
@@ -864,6 +873,7 @@ buf_LRU_block_free_non_file_page(
block->state = BUF_BLOCK_NOT_USED;
+ UNIV_MEM_ALLOC(block->frame, UNIV_PAGE_SIZE);
#ifdef UNIV_DEBUG
/* Wipe contents of page to reveal possible stale pointers to it */
memset(block->frame, '\0', UNIV_PAGE_SIZE);
@@ -871,6 +881,8 @@ buf_LRU_block_free_non_file_page(
UT_LIST_ADD_FIRST(free, buf_pool->free, block);
block->in_free_list = TRUE;
+ UNIV_MEM_FREE(block->frame, UNIV_PAGE_SIZE);
+
if (srv_use_awe && block->frame) {
/* Add to the list of mapped pages */
@@ -939,6 +951,7 @@ buf_LRU_block_remove_hashed_page(
buf_page_address_fold(block->space, block->offset),
block);
+ UNIV_MEM_INVALID(block->frame, UNIV_PAGE_SIZE);
block->state = BUF_BLOCK_REMOVE_HASH;
}
diff --git a/storage/innobase/data/Makefile.am b/storage/innobase/data/Makefile.am
deleted file mode 100644
index 6f9407d40e5..00000000000
--- a/storage/innobase/data/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = libdata.a
-
-libdata_a_SOURCES = data0data.c data0type.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/data/data0data.c b/storage/innobase/data/data0data.c
index fc4494d991a..0f03de4ca9d 100644
--- a/storage/innobase/data/data0data.c
+++ b/storage/innobase/data/data0data.c
@@ -18,6 +18,8 @@ Created 5/30/1994 Heikki Tuuri
#include "dict0dict.h"
#include "btr0cur.h"
+#include <ctype.h>
+
#ifdef UNIV_DEBUG
byte data_error; /* data pointers of tuple fields are initialized
to point here for error checking */
diff --git a/storage/innobase/data/data0type.c b/storage/innobase/data/data0type.c
index 77779d185cf..305000d7c0a 100644
--- a/storage/innobase/data/data0type.c
+++ b/storage/innobase/data/data0type.c
@@ -190,7 +190,8 @@ dtype_validate(
dtype_t* type) /* in: type struct to validate */
{
ut_a(type);
- ut_a((type->mtype >= DATA_VARCHAR) && (type->mtype <= DATA_MYSQL));
+ ut_a(type->mtype >= DATA_VARCHAR);
+ ut_a(type->mtype <= DATA_MYSQL);
if (type->mtype == DATA_SYS) {
ut_a((type->prtype & DATA_MYSQL_TYPE_MASK) < DATA_N_SYS_COLS);
diff --git a/storage/innobase/dict/Makefile.am b/storage/innobase/dict/Makefile.am
deleted file mode 100644
index 15cacca6f58..00000000000
--- a/storage/innobase/dict/Makefile.am
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = libdict.a
-
-libdict_a_SOURCES = dict0boot.c dict0crea.c dict0dict.c dict0load.c\
- dict0mem.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/dict/dict0boot.c b/storage/innobase/dict/dict0boot.c
index f8849008854..5f9aaf71e18 100644
--- a/storage/innobase/dict/dict0boot.c
+++ b/storage/innobase/dict/dict0boot.c
@@ -211,6 +211,7 @@ dict_boot(void)
dict_table_t* table;
dict_index_t* index;
dict_hdr_t* dict_hdr;
+ mem_heap_t* heap;
mtr_t mtr;
mtr_start(&mtr);
@@ -218,6 +219,8 @@ dict_boot(void)
/* Create the hash tables etc. */
dict_init();
+ heap = mem_heap_create(450);
+
mutex_enter(&(dict_sys->mutex));
/* Get the dictionary header */
@@ -244,19 +247,20 @@ dict_boot(void)
/*-------------------------*/
table = dict_mem_table_create("SYS_TABLES", DICT_HDR_SPACE, 8, 0);
- dict_mem_table_add_col(table, "NAME", DATA_BINARY, 0, 0);
- dict_mem_table_add_col(table, "ID", DATA_BINARY, 0, 0);
- dict_mem_table_add_col(table, "N_COLS", DATA_INT, 0, 4);
- dict_mem_table_add_col(table, "TYPE", DATA_INT, 0, 4);
- dict_mem_table_add_col(table, "MIX_ID", DATA_BINARY, 0, 0);
- dict_mem_table_add_col(table, "MIX_LEN", DATA_INT, 0, 4);
- dict_mem_table_add_col(table, "CLUSTER_NAME", DATA_BINARY, 0, 0);
- dict_mem_table_add_col(table, "SPACE", DATA_INT, 0, 4);
+ dict_mem_table_add_col(table, heap, "NAME", DATA_BINARY, 0, 0);
+ dict_mem_table_add_col(table, heap, "ID", DATA_BINARY, 0, 0);
+ dict_mem_table_add_col(table, heap, "N_COLS", DATA_INT, 0, 4);
+ dict_mem_table_add_col(table, heap, "TYPE", DATA_INT, 0, 4);
+ dict_mem_table_add_col(table, heap, "MIX_ID", DATA_BINARY, 0, 0);
+ dict_mem_table_add_col(table, heap, "MIX_LEN", DATA_INT, 0, 4);
+ dict_mem_table_add_col(table, heap, "CLUSTER_NAME", DATA_BINARY, 0, 0);
+ dict_mem_table_add_col(table, heap, "SPACE", DATA_INT, 0, 4);
table->id = DICT_TABLES_ID;
- dict_table_add_to_cache(table);
+ dict_table_add_to_cache(table, heap);
dict_sys->sys_tables = table;
+ mem_heap_empty(heap);
index = dict_mem_index_create("SYS_TABLES", "CLUST_IND",
DICT_HDR_SPACE,
@@ -283,18 +287,19 @@ dict_boot(void)
/*-------------------------*/
table = dict_mem_table_create("SYS_COLUMNS", DICT_HDR_SPACE, 7, 0);
- dict_mem_table_add_col(table, "TABLE_ID", DATA_BINARY, 0, 0);
- dict_mem_table_add_col(table, "POS", DATA_INT, 0, 4);
- dict_mem_table_add_col(table, "NAME", DATA_BINARY, 0, 0);
- dict_mem_table_add_col(table, "MTYPE", DATA_INT, 0, 4);
- dict_mem_table_add_col(table, "PRTYPE", DATA_INT, 0, 4);
- dict_mem_table_add_col(table, "LEN", DATA_INT, 0, 4);
- dict_mem_table_add_col(table, "PREC", DATA_INT, 0, 4);
+ dict_mem_table_add_col(table, heap, "TABLE_ID", DATA_BINARY, 0, 0);
+ dict_mem_table_add_col(table, heap, "POS", DATA_INT, 0, 4);
+ dict_mem_table_add_col(table, heap, "NAME", DATA_BINARY, 0, 0);
+ dict_mem_table_add_col(table, heap, "MTYPE", DATA_INT, 0, 4);
+ dict_mem_table_add_col(table, heap, "PRTYPE", DATA_INT, 0, 4);
+ dict_mem_table_add_col(table, heap, "LEN", DATA_INT, 0, 4);
+ dict_mem_table_add_col(table, heap, "PREC", DATA_INT, 0, 4);
table->id = DICT_COLUMNS_ID;
- dict_table_add_to_cache(table);
+ dict_table_add_to_cache(table, heap);
dict_sys->sys_columns = table;
+ mem_heap_empty(heap);
index = dict_mem_index_create("SYS_COLUMNS", "CLUST_IND",
DICT_HDR_SPACE,
@@ -311,13 +316,13 @@ dict_boot(void)
/*-------------------------*/
table = dict_mem_table_create("SYS_INDEXES", DICT_HDR_SPACE, 7, 0);
- dict_mem_table_add_col(table, "TABLE_ID", DATA_BINARY, 0, 0);
- dict_mem_table_add_col(table, "ID", DATA_BINARY, 0, 0);
- dict_mem_table_add_col(table, "NAME", DATA_BINARY, 0, 0);
- dict_mem_table_add_col(table, "N_FIELDS", DATA_INT, 0, 4);
- dict_mem_table_add_col(table, "TYPE", DATA_INT, 0, 4);
- dict_mem_table_add_col(table, "SPACE", DATA_INT, 0, 4);
- dict_mem_table_add_col(table, "PAGE_NO", DATA_INT, 0, 4);
+ dict_mem_table_add_col(table, heap, "TABLE_ID", DATA_BINARY, 0, 0);
+ dict_mem_table_add_col(table, heap, "ID", DATA_BINARY, 0, 0);
+ dict_mem_table_add_col(table, heap, "NAME", DATA_BINARY, 0, 0);
+ dict_mem_table_add_col(table, heap, "N_FIELDS", DATA_INT, 0, 4);
+ dict_mem_table_add_col(table, heap, "TYPE", DATA_INT, 0, 4);
+ dict_mem_table_add_col(table, heap, "SPACE", DATA_INT, 0, 4);
+ dict_mem_table_add_col(table, heap, "PAGE_NO", DATA_INT, 0, 4);
/* The '+ 2' below comes from the 2 system fields */
#if DICT_SYS_INDEXES_PAGE_NO_FIELD != 6 + 2
@@ -331,8 +336,9 @@ dict_boot(void)
#endif
table->id = DICT_INDEXES_ID;
- dict_table_add_to_cache(table);
+ dict_table_add_to_cache(table, heap);
dict_sys->sys_indexes = table;
+ mem_heap_empty(heap);
index = dict_mem_index_create("SYS_INDEXES", "CLUST_IND",
DICT_HDR_SPACE,
@@ -349,13 +355,14 @@ dict_boot(void)
/*-------------------------*/
table = dict_mem_table_create("SYS_FIELDS", DICT_HDR_SPACE, 3, 0);
- dict_mem_table_add_col(table, "INDEX_ID", DATA_BINARY, 0, 0);
- dict_mem_table_add_col(table, "POS", DATA_INT, 0, 4);
- dict_mem_table_add_col(table, "COL_NAME", DATA_BINARY, 0, 0);
+ dict_mem_table_add_col(table, heap, "INDEX_ID", DATA_BINARY, 0, 0);
+ dict_mem_table_add_col(table, heap, "POS", DATA_INT, 0, 4);
+ dict_mem_table_add_col(table, heap, "COL_NAME", DATA_BINARY, 0, 0);
table->id = DICT_FIELDS_ID;
- dict_table_add_to_cache(table);
+ dict_table_add_to_cache(table, heap);
dict_sys->sys_fields = table;
+ mem_heap_free(heap);
index = dict_mem_index_create("SYS_FIELDS", "CLUST_IND",
DICT_HDR_SPACE,
diff --git a/storage/innobase/dict/dict0crea.c b/storage/innobase/dict/dict0crea.c
index e060d45768e..4116230347d 100644
--- a/storage/innobase/dict/dict0crea.c
+++ b/storage/innobase/dict/dict0crea.c
@@ -960,7 +960,7 @@ dict_create_table_step(
if (node->state == TABLE_ADD_TO_CACHE) {
- dict_table_add_to_cache(node->table);
+ dict_table_add_to_cache(node->table, node->heap);
err = DB_SUCCESS;
}
@@ -1195,7 +1195,8 @@ dict_create_or_check_foreign_constraint_tables(void)
fprintf(stderr, "InnoDB: error %lu in creation\n",
(ulong) error);
- ut_a(error == DB_OUT_OF_FILE_SPACE);
+ ut_a(error == DB_OUT_OF_FILE_SPACE
+ || error == DB_TOO_MANY_CONCURRENT_TRXS);
fprintf(stderr,
"InnoDB: creation failed\n"
diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c
index f450d3553eb..595dfb06ee5 100644
--- a/storage/innobase/dict/dict0dict.c
+++ b/storage/innobase/dict/dict0dict.c
@@ -30,6 +30,8 @@ Created 1/8/1996 Heikki Tuuri
# include "m_ctype.h" /* my_isspace() */
#endif /* !UNIV_HOTBACKUP */
+#include <ctype.h>
+
dict_sys_t* dict_sys = NULL; /* the dictionary system */
rw_lock_t dict_operation_lock; /* table create, drop, etc. reserve
@@ -408,14 +410,27 @@ dict_table_get_col_name(
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
s = table->col_names;
-
- for (i = 0; i < col_nr; i++) {
- s += strlen(s) + 1;
+ if (s) {
+ for (i = 0; i < col_nr; i++) {
+ s += strlen(s) + 1;
+ }
}
return(s);
}
+
+/************************************************************************
+Acquire the autoinc lock.*/
+
+void
+dict_table_autoinc_lock(
+/*====================*/
+ dict_table_t* table)
+{
+ mutex_enter(&table->autoinc_mutex);
+}
+
/************************************************************************
Initializes the autoinc counter. It is not an error to initialize an already
initialized counter. */
@@ -426,54 +441,8 @@ dict_table_autoinc_initialize(
dict_table_t* table, /* in: table */
ib_longlong value) /* in: next value to assign to a row */
{
- mutex_enter(&(table->autoinc_mutex));
-
table->autoinc_inited = TRUE;
table->autoinc = value;
-
- mutex_exit(&(table->autoinc_mutex));
-}
-
-/************************************************************************
-Gets the next autoinc value (== autoinc counter value), 0 if not yet
-initialized. If initialized, increments the counter by 1. */
-
-ib_longlong
-dict_table_autoinc_get(
-/*===================*/
- /* out: value for a new row, or 0 */
- dict_table_t* table) /* in: table */
-{
- ib_longlong value;
-
- mutex_enter(&(table->autoinc_mutex));
-
- if (!table->autoinc_inited) {
-
- value = 0;
- } else {
- value = table->autoinc;
- table->autoinc = table->autoinc + 1;
- }
-
- mutex_exit(&(table->autoinc_mutex));
-
- return(value);
-}
-
-/************************************************************************
-Decrements the autoinc counter value by 1. */
-
-void
-dict_table_autoinc_decrement(
-/*=========================*/
- dict_table_t* table) /* in: table */
-{
- mutex_enter(&(table->autoinc_mutex));
-
- table->autoinc = table->autoinc - 1;
-
- mutex_exit(&(table->autoinc_mutex));
}
/************************************************************************
@@ -488,8 +457,6 @@ dict_table_autoinc_read(
{
ib_longlong value;
- mutex_enter(&(table->autoinc_mutex));
-
if (!table->autoinc_inited) {
value = 0;
@@ -497,35 +464,11 @@ dict_table_autoinc_read(
value = table->autoinc;
}
- mutex_exit(&(table->autoinc_mutex));
-
return(value);
}
/************************************************************************
-Peeks the autoinc counter value, 0 if not yet initialized. Does not
-increment the counter. The read not protected by any mutex! */
-
-ib_longlong
-dict_table_autoinc_peek(
-/*====================*/
- /* out: value of the counter */
- dict_table_t* table) /* in: table */
-{
- ib_longlong value;
-
- if (!table->autoinc_inited) {
-
- value = 0;
- } else {
- value = table->autoinc;
- }
-
- return(value);
-}
-
-/************************************************************************
-Updates the autoinc counter if the value supplied is equal or bigger than the
+Updates the autoinc counter if the value supplied is greater than the
current value. If not inited, does nothing. */
void
@@ -535,15 +478,21 @@ dict_table_autoinc_update(
dict_table_t* table, /* in: table */
ib_longlong value) /* in: value which was assigned to a row */
{
- mutex_enter(&(table->autoinc_mutex));
+ if (table->autoinc_inited && value > table->autoinc) {
- if (table->autoinc_inited) {
- if (value >= table->autoinc) {
- table->autoinc = value + 1;
- }
+ table->autoinc = value;
}
+}
- mutex_exit(&(table->autoinc_mutex));
+/************************************************************************
+Release the autoinc lock.*/
+
+void
+dict_table_autoinc_unlock(
+/*======================*/
+ dict_table_t* table) /* in: release autoinc lock for this table */
+{
+ mutex_exit(&table->autoinc_mutex);
}
/************************************************************************
@@ -840,28 +789,18 @@ dict_table_get(
}
/**************************************************************************
-Adds a table object to the dictionary cache. */
+Adds system columns to a table object. */
void
-dict_table_add_to_cache(
-/*====================*/
- dict_table_t* table) /* in: table */
+dict_table_add_system_columns(
+/*==========================*/
+ dict_table_t* table, /* in/out: table */
+ mem_heap_t* heap) /* in: temporary heap */
{
- ulint fold;
- ulint id_fold;
- ulint i;
- ulint row_len;
-
ut_ad(table);
- ut_ad(mutex_own(&(dict_sys->mutex)));
ut_ad(table->n_def == table->n_cols - DATA_N_SYS_COLS);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
- ut_ad(table->cached == FALSE);
-
- fold = ut_fold_string(table->name);
- id_fold = ut_fold_dulint(table->id);
-
- table->cached = TRUE;
+ ut_ad(!table->cached);
/* NOTE: the system columns MUST be added in the following order
(so that they can be indexed by the numerical value of DATA_ROW_ID,
@@ -869,19 +808,19 @@ dict_table_add_to_cache(
The clustered index will not always physically contain all
system columns. */
- dict_mem_table_add_col(table, "DB_ROW_ID", DATA_SYS,
+ dict_mem_table_add_col(table, heap, "DB_ROW_ID", DATA_SYS,
DATA_ROW_ID | DATA_NOT_NULL,
DATA_ROW_ID_LEN);
#if DATA_ROW_ID != 0
#error "DATA_ROW_ID != 0"
#endif
- dict_mem_table_add_col(table, "DB_TRX_ID", DATA_SYS,
+ dict_mem_table_add_col(table, heap, "DB_TRX_ID", DATA_SYS,
DATA_TRX_ID | DATA_NOT_NULL,
DATA_TRX_ID_LEN);
#if DATA_TRX_ID != 1
#error "DATA_TRX_ID != 1"
#endif
- dict_mem_table_add_col(table, "DB_ROLL_PTR", DATA_SYS,
+ dict_mem_table_add_col(table, heap, "DB_ROLL_PTR", DATA_SYS,
DATA_ROLL_PTR | DATA_NOT_NULL,
DATA_ROLL_PTR_LEN);
#if DATA_ROLL_PTR != 2
@@ -893,10 +832,34 @@ dict_table_add_to_cache(
#if DATA_N_SYS_COLS != 3
#error "DATA_N_SYS_COLS != 3"
#endif
+}
+
+/**************************************************************************
+Adds a table object to the dictionary cache. */
+
+void
+dict_table_add_to_cache(
+/*====================*/
+ dict_table_t* table, /* in: table */
+ mem_heap_t* heap) /* in: temporary heap */
+{
+ ulint fold;
+ ulint id_fold;
+ ulint i;
+ ulint row_len;
/* The lower limit for what we consider a "big" row */
#define BIG_ROW_SIZE 1024
+ ut_ad(mutex_own(&(dict_sys->mutex)));
+
+ dict_table_add_system_columns(table, heap);
+
+ table->cached = TRUE;
+
+ fold = ut_fold_string(table->name);
+ id_fold = ut_fold_dulint(table->id);
+
row_len = 0;
for (i = 0; i < table->n_def; i++) {
ulint col_len = dict_col_get_max_size(
@@ -1529,6 +1492,12 @@ dict_index_add_col(
if (field->fixed_len > DICT_MAX_INDEX_COL_LEN) {
field->fixed_len = 0;
}
+#if DICT_MAX_INDEX_COL_LEN != 768
+ /* The comparison limit above must be constant. If it were
+ changed, the disk format of some fixed-length columns would
+ change, which would be a disaster. */
+# error "DICT_MAX_INDEX_COL_LEN != 768"
+#endif
if (!(col->prtype & DATA_NOT_NULL)) {
index->n_nullable++;
@@ -1585,9 +1554,6 @@ dict_index_copy_types(
ifield = dict_index_get_nth_field(index, i);
dfield_type = dfield_get_type(dtuple_get_nth_field(tuple, i));
dict_col_copy_type(dict_field_get_col(ifield), dfield_type);
- if (UNIV_UNLIKELY(ifield->prefix_len)) {
- dfield_type->len = ifield->prefix_len;
- }
}
}
@@ -3361,7 +3327,8 @@ dict_create_foreign_constraints(
ulint err;
mem_heap_t* heap;
- ut_a(trx && trx->mysql_thd);
+ ut_a(trx);
+ ut_a(trx->mysql_thd);
str = dict_strip_comments(sql_string);
heap = mem_heap_create(10000);
@@ -3403,7 +3370,8 @@ dict_foreign_parse_drop_constraints(
FILE* ef = dict_foreign_err_file;
struct charset_info_st* cs;
- ut_a(trx && trx->mysql_thd);
+ ut_a(trx);
+ ut_a(trx->mysql_thd);
cs = innobase_get_charset(trx->mysql_thd);
@@ -3712,7 +3680,7 @@ dict_index_calc_min_rec_len(
}
/* round the NULL flags up to full bytes */
- sum += (nullable + 7) / 8;
+ sum += UT_BITS_IN_BYTES(nullable);
return(sum);
}
diff --git a/storage/innobase/dict/dict0load.c b/storage/innobase/dict/dict0load.c
index ba2e25cf031..1ff1fd54cec 100644
--- a/storage/innobase/dict/dict0load.c
+++ b/storage/innobase/dict/dict0load.c
@@ -423,7 +423,8 @@ dict_load_columns(
ut_a(name_of_col_is(sys_columns, sys_index, 8, "PREC"));
- dict_mem_table_add_col(table, name, mtype, prtype, col_len);
+ dict_mem_table_add_col(table, heap, name,
+ mtype, prtype, col_len);
btr_pcur_move_to_next_user_rec(&pcur, &mtr);
}
@@ -746,7 +747,7 @@ dict_load_table(
ut_ad(mutex_own(&(dict_sys->mutex)));
- heap = mem_heap_create(1000);
+ heap = mem_heap_create(32000);
mtr_start(&mtr);
@@ -852,7 +853,9 @@ err_exit:
dict_load_columns(table, heap);
- dict_table_add_to_cache(table);
+ dict_table_add_to_cache(table, heap);
+
+ mem_heap_empty(heap);
dict_load_indexes(table, heap);
diff --git a/storage/innobase/dict/dict0mem.c b/storage/innobase/dict/dict0mem.c
index 9aa49dee745..47cf7a0bc9c 100644
--- a/storage/innobase/dict/dict0mem.c
+++ b/storage/innobase/dict/dict0mem.c
@@ -90,6 +90,15 @@ dict_mem_table_create(
mutex_create(&table->autoinc_mutex, SYNC_DICT_AUTOINC_MUTEX);
table->autoinc_inited = FALSE;
+
+ /* The actual increment value will be set by MySQL, we simply
+ default to 1 here.*/
+ table->autoinc_increment = 1;
+
+ /* The number of transactions that are either waiting on the
+ AUTOINC lock or have been granted the lock. */
+ table->n_waiting_or_granted_auto_inc_locks = 0;
+
#ifdef UNIV_DEBUG
table->magic_n = DICT_TABLE_MAGIC_N;
#endif /* UNIV_DEBUG */
@@ -108,18 +117,11 @@ dict_mem_table_free(
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
mutex_free(&(table->autoinc_mutex));
-
- if (table->col_names && (table->n_def < table->n_cols)) {
- ut_free((void*)table->col_names);
- }
-
mem_heap_free(table->heap);
}
/********************************************************************
-Add 'name' to end of the col_names array (see dict_table_t::col_names). Call
-ut_free on col_names (if not NULL), allocate new array (if heap, from it,
-otherwise with ut_malloc), and copy col_names + name to it. */
+Append 'name' to 'col_names' (@see dict_table_t::col_names). */
static
const char*
dict_add_col_name(
@@ -129,21 +131,19 @@ dict_add_col_name(
NULL */
ulint cols, /* in: number of existing columns */
const char* name, /* in: new column name */
- mem_heap_t* heap) /* in: heap, or NULL */
+ mem_heap_t* heap) /* in: heap */
{
- ulint i;
- ulint old_len;
- ulint new_len;
- ulint total_len;
- const char* s;
- char* res;
+ ulint old_len;
+ ulint new_len;
+ ulint total_len;
+ char* res;
- ut_a(((cols == 0) && !col_names) || ((cols > 0) && col_names));
- ut_a(*name);
+ ut_ad(!cols == !col_names);
/* Find out length of existing array. */
if (col_names) {
- s = col_names;
+ const char* s = col_names;
+ ulint i;
for (i = 0; i < cols; i++) {
s += strlen(s) + 1;
@@ -157,11 +157,7 @@ dict_add_col_name(
new_len = strlen(name) + 1;
total_len = old_len + new_len;
- if (heap) {
- res = mem_heap_alloc(heap, total_len);
- } else {
- res = ut_malloc(total_len);
- }
+ res = mem_heap_alloc(heap, total_len);
if (old_len > 0) {
memcpy(res, col_names, old_len);
@@ -169,10 +165,6 @@ dict_add_col_name(
memcpy(res + old_len, name, new_len);
- if (col_names) {
- ut_free((char*)col_names);
- }
-
return(res);
}
@@ -183,7 +175,8 @@ void
dict_mem_table_add_col(
/*===================*/
dict_table_t* table, /* in: table */
- const char* name, /* in: column name */
+ mem_heap_t* heap, /* in: temporary memory heap, or NULL */
+ const char* name, /* in: column name, or NULL */
ulint mtype, /* in: main datatype */
ulint prtype, /* in: precise type */
ulint len) /* in: precision */
@@ -191,21 +184,32 @@ dict_mem_table_add_col(
dict_col_t* col;
ulint mbminlen;
ulint mbmaxlen;
- mem_heap_t* heap;
+ ulint i;
- ut_ad(table && name);
+ ut_ad(table);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
+ ut_ad(!heap == !name);
- table->n_def++;
+ i = table->n_def++;
- heap = table->n_def < table->n_cols ? NULL : table->heap;
- table->col_names = dict_add_col_name(table->col_names,
- table->n_def - 1,
- name, heap);
+ if (name) {
+ if (UNIV_UNLIKELY(table->n_def == table->n_cols)) {
+ heap = table->heap;
+ }
+ if (UNIV_LIKELY(i) && UNIV_UNLIKELY(!table->col_names)) {
+ /* All preceding column names are empty. */
+ char* s = mem_heap_alloc(heap, table->n_def);
+ memset(s, 0, table->n_def);
+ table->col_names = s;
+ }
- col = (dict_col_t*) dict_table_get_nth_col(table, table->n_def - 1);
+ table->col_names = dict_add_col_name(table->col_names,
+ i, name, heap);
+ }
- col->ind = table->n_def - 1;
+ col = (dict_col_t*) dict_table_get_nth_col(table, i);
+
+ col->ind = (unsigned int) i;
col->ord_part = 0;
col->mtype = (unsigned int) mtype;
@@ -318,7 +322,7 @@ dict_mem_index_add_field(
{
dict_field_t* field;
- ut_ad(index && name);
+ ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
index->n_def++;
diff --git a/storage/innobase/dyn/Makefile.am b/storage/innobase/dyn/Makefile.am
deleted file mode 100644
index 57d9a25e481..00000000000
--- a/storage/innobase/dyn/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = libdyn.a
-
-libdyn_a_SOURCES = dyn0dyn.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/eval/Makefile.am b/storage/innobase/eval/Makefile.am
deleted file mode 100644
index 6c2b05d8b7a..00000000000
--- a/storage/innobase/eval/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = libeval.a
-
-libeval_a_SOURCES = eval0eval.c eval0proc.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/fil/Makefile.am b/storage/innobase/fil/Makefile.am
deleted file mode 100644
index 0a85ceb5b86..00000000000
--- a/storage/innobase/fil/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = libfil.a
-
-libfil_a_SOURCES = fil0fil.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/fsp/Makefile.am b/storage/innobase/fsp/Makefile.am
deleted file mode 100644
index 7818cdafc1b..00000000000
--- a/storage/innobase/fsp/Makefile.am
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = libfsp.a
-
-libfsp_a_SOURCES = fsp0fsp.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/fsp/fsp0fsp.c b/storage/innobase/fsp/fsp0fsp.c
index b5662fd24a4..e1074933fe8 100644
--- a/storage/innobase/fsp/fsp0fsp.c
+++ b/storage/innobase/fsp/fsp0fsp.c
@@ -205,10 +205,9 @@ the extent are free and which contain old tuple version to clean. */
space */
#define XDES_FSEG 4 /* extent belongs to a segment */
-/* File extent data structure size in bytes. The "+ 7 ) / 8" part in the
-definition rounds the number of bytes upward. */
+/* File extent data structure size in bytes. */
#define XDES_SIZE \
- (XDES_BITMAP + (FSP_EXTENT_SIZE * XDES_BITS_PER_PAGE + 7) / 8)
+ (XDES_BITMAP + UT_BITS_IN_BYTES(FSP_EXTENT_SIZE * XDES_BITS_PER_PAGE))
/* Offset of the descriptor array on a descriptor page */
#define XDES_ARR_OFFSET (FSP_HEADER_OFFSET + FSP_HEADER_SIZE)
@@ -2830,7 +2829,7 @@ will be able to insert new data to the database without running out the
tablespace. Only free extents are taken into account and we also subtract
the safety margin required by the above function fsp_reserve_free_extents. */
-ulint
+ullint
fsp_get_available_space_in_free_extents(
/*====================================*/
/* out: available space in kB */
@@ -2896,7 +2895,8 @@ fsp_get_available_space_in_free_extents(
return(0);
}
- return(((n_free - reserve) * FSP_EXTENT_SIZE)
+ return((ullint)(n_free - reserve)
+ * FSP_EXTENT_SIZE
* (UNIV_PAGE_SIZE / 1024));
}
@@ -3649,7 +3649,11 @@ fsp_validate(
n_full_frag_pages = FSP_EXTENT_SIZE
* flst_get_len(header + FSP_FULL_FRAG, &mtr);
- ut_a(free_limit <= size || (space != 0 && size < FSP_EXTENT_SIZE));
+ if (UNIV_UNLIKELY(free_limit > size)) {
+
+ ut_a(space != 0);
+ ut_a(size < FSP_EXTENT_SIZE);
+ }
flst_validate(header + FSP_FREE, &mtr);
flst_validate(header + FSP_FREE_FRAG, &mtr);
diff --git a/storage/innobase/fut/Makefile.am b/storage/innobase/fut/Makefile.am
deleted file mode 100644
index ffe9835a023..00000000000
--- a/storage/innobase/fut/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = libfut.a
-
-libfut_a_SOURCES = fut0fut.c fut0lst.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/ha/Makefile.am b/storage/innobase/ha/Makefile.am
deleted file mode 100644
index 696cad0b203..00000000000
--- a/storage/innobase/ha/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = libha.a
-
-libha_a_SOURCES = ha0ha.c hash0hash.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/handler/Makefile.am b/storage/innobase/handler/Makefile.am
deleted file mode 100644
index 0d34212bdd4..00000000000
--- a/storage/innobase/handler/Makefile.am
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-DEFS = -DMYSQL_SERVER @DEFS@
-
-noinst_LIBRARIES = libhandler.a
-
-libhandler_a_SOURCES = ha_innodb.cc
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index de9cf06fe3a..783553f5d87 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -15,11 +15,10 @@
/* This file defines the InnoDB handler: the interface between MySQL and InnoDB
NOTE: You can only use noninlined InnoDB functions in this file, because we
-have disables the InnoDB inlining in this file. */
+have disabled the InnoDB inlining in this file. */
/* TODO list for the InnoDB handler in 5.0:
- - Remove the flag trx->active_trans and look at the InnoDB
- trx struct state field
+ - Remove the flag trx->active_trans and look at trx->conc_state
- fix savepoint functions to use savepoint storage area
- Find out what kind of problems the OS X case-insensitivity causes to
table and database names; should we 'normalize' the names like we do
@@ -31,8 +30,7 @@ have disables the InnoDB inlining in this file. */
#endif
#include <mysql_priv.h>
-
-#ifdef WITH_INNOBASE_STORAGE_ENGINE
+#include <mysqld_error.h>
#include <m_ctype.h>
#include <hash.h>
@@ -40,27 +38,29 @@ have disables the InnoDB inlining in this file. */
#include <mysys_err.h>
#include <my_sys.h>
#include "ha_innodb.h"
-
-pthread_mutex_t innobase_share_mutex, /* to protect innobase_open_files */
- prepare_commit_mutex; /* to force correct commit order in
- binlog */
-ulong commit_threads= 0;
-pthread_mutex_t commit_threads_m;
-pthread_cond_t commit_cond;
-pthread_mutex_t commit_cond_m;
-bool innodb_inited= 0;
+#include <mysql/plugin.h>
+
+#ifndef MYSQL_SERVER
+/* This is needed because of Bug #3596. Let us hope that pthread_mutex_t
+is defined the same in both builds: the MySQL server and the InnoDB plugin. */
+extern pthread_mutex_t LOCK_thread_count;
+#endif /* MYSQL_SERVER */
+
+/** to protect innobase_open_files */
+static pthread_mutex_t innobase_share_mutex;
+/** to force correct commit order in binlog */
+static pthread_mutex_t prepare_commit_mutex;
+static ulong commit_threads = 0;
+static pthread_mutex_t commit_threads_m;
+static pthread_cond_t commit_cond;
+static pthread_mutex_t commit_cond_m;
+static bool innodb_inited = 0;
/*
This needs to exist until the query cache callback is removed
or learns to pass hton.
*/
-static handlerton *legacy_innodb_hton;
-
-/* Store MySQL definition of 'byte': in Linux it is char while InnoDB
-uses unsigned char; the header univ.i which we include next defines
-'byte' as a macro which expands to 'unsigned char' */
-
-typedef byte mysql_byte;
+static handlerton *innodb_hton_ptr;
#define INSIDE_HA_INNOBASE_CC
@@ -92,46 +92,45 @@ extern "C" {
#include "../storage/innobase/include/ha_prototypes.h"
}
-ulong innobase_large_page_size = 0;
+static const long AUTOINC_OLD_STYLE_LOCKING = 0;
+static const long AUTOINC_NEW_STYLE_LOCKING = 1;
+static const long AUTOINC_NO_LOCKING = 2;
-/* The default values for the following, type long or longlong, start-up
-parameters are declared in mysqld.cc: */
-
-long innobase_mirrored_log_groups, innobase_log_files_in_group,
+static long innobase_mirrored_log_groups, innobase_log_files_in_group,
innobase_log_buffer_size, innobase_buffer_pool_awe_mem_mb,
innobase_additional_mem_pool_size, innobase_file_io_threads,
innobase_lock_wait_timeout, innobase_force_recovery,
- innobase_open_files;
+ innobase_open_files, innobase_autoinc_lock_mode;
-longlong innobase_buffer_pool_size, innobase_log_file_size;
+static long long innobase_buffer_pool_size, innobase_log_file_size;
/* The default values for the following char* start-up parameters
are determined in innobase_init below: */
-char* innobase_data_home_dir = NULL;
-char* innobase_data_file_path = NULL;
-char* innobase_log_group_home_dir = NULL;
-char* innobase_log_arch_dir = NULL;/* unused */
+static char* innobase_data_home_dir = NULL;
+static char* innobase_data_file_path = NULL;
+static char* innobase_log_group_home_dir = NULL;
/* The following has a misleading name: starting from 4.0.5, this also
affects Windows: */
-char* innobase_unix_file_flush_method = NULL;
+static char* innobase_unix_file_flush_method = NULL;
/* Below we have boolean-valued start-up parameters, and their default
values */
-ulong innobase_fast_shutdown = 1;
-my_bool innobase_log_archive = FALSE;/* unused */
-my_bool innobase_use_doublewrite = TRUE;
-my_bool innobase_use_checksums = TRUE;
-my_bool innobase_use_large_pages = FALSE;
-my_bool innobase_use_native_aio = FALSE;
-my_bool innobase_file_per_table = FALSE;
-my_bool innobase_locks_unsafe_for_binlog = FALSE;
-my_bool innobase_rollback_on_timeout = FALSE;
-my_bool innobase_create_status_file = FALSE;
-my_bool innobase_stats_on_metadata = TRUE;
+static ulong innobase_fast_shutdown = 1;
+#ifdef UNIV_LOG_ARCHIVE
+static my_bool innobase_log_archive = FALSE;
+static char* innobase_log_arch_dir = NULL;
+#endif /* UNIV_LOG_ARCHIVE */
+static my_bool innobase_use_doublewrite = TRUE;
+static my_bool innobase_use_checksums = TRUE;
+static my_bool innobase_file_per_table = FALSE;
+static my_bool innobase_locks_unsafe_for_binlog = FALSE;
+static my_bool innobase_rollback_on_timeout = FALSE;
+static my_bool innobase_create_status_file = FALSE;
+static my_bool innobase_stats_on_metadata = TRUE;
-static char *internal_innobase_data_file_path = NULL;
+static char* internal_innobase_data_file_path = NULL;
/* The following counter is used to convey information to InnoDB
about server activity: in selects it is not sensible to call
@@ -147,7 +146,7 @@ static HASH innobase_open_tables;
bool nw_panic = FALSE;
#endif
-static mysql_byte* innobase_get_key(INNOBASE_SHARE *share,uint *length,
+static uchar* innobase_get_key(INNOBASE_SHARE *share, size_t *length,
my_bool not_used __attribute__((unused)));
static INNOBASE_SHARE *get_share(const char *table_name);
static void free_share(INNOBASE_SHARE *share);
@@ -165,6 +164,17 @@ static handler *innobase_create_handler(handlerton *hton,
static const char innobase_hton_name[]= "InnoDB";
+
+static MYSQL_THDVAR_BOOL(support_xa, PLUGIN_VAR_OPCMDARG,
+ "Enable InnoDB support for the XA two-phase commit",
+ /* check_func */ NULL, /* update_func */ NULL,
+ /* default */ TRUE);
+
+static MYSQL_THDVAR_BOOL(table_locks, PLUGIN_VAR_OPCMDARG,
+ "Enable InnoDB locking in LOCK TABLES",
+ /* check_func */ NULL, /* update_func */ NULL,
+ /* default */ TRUE);
+
static handler *innobase_create_handler(handlerton *hton,
TABLE_SHARE *table,
MEM_ROOT *mem_root)
@@ -407,6 +417,22 @@ static SHOW_VAR innodb_status_variables[]= {
/* General functions */
/**********************************************************************
+Returns true if the thread is the replication thread on the slave
+server. Used in srv_conc_enter_innodb() to determine if the thread
+should be allowed to enter InnoDB - the replication thread is treated
+differently than other threads. Also used in
+srv_conc_force_exit_innodb(). */
+extern "C"
+ibool
+thd_is_replication_slave_thread(
+/*============================*/
+ /* out: true if thd is the replication thread */
+ void* thd) /* in: thread handle (THD*) */
+{
+ return((ibool) thd_slave_thread((THD*) thd));
+}
+
+/**********************************************************************
Save some CPU by testing the value of srv_thread_concurrency in inline
functions. */
inline
@@ -462,17 +488,32 @@ innobase_release_stat_resources(
}
}
+/**********************************************************************
+Returns true if the transaction this thread is processing has edited
+non-transactional tables. Used by the deadlock detector when deciding
+which transaction to rollback in case of a deadlock - we try to avoid
+rolling back transactions that have edited non-transactional tables. */
+extern "C"
+ibool
+thd_has_edited_nontrans_tables(
+/*===========================*/
+ /* out: true if non-transactional tables have
+ been edited */
+ void* thd) /* in: thread handle (THD*) */
+{
+ return((ibool) thd_non_transactional_update((THD*) thd));
+}
+
/************************************************************************
Obtain the InnoDB transaction of a MySQL thread. */
inline
trx_t*&
thd_to_trx(
/*=======*/
- /* out: reference to transaction pointer */
- THD* thd, /* in: MySQL thread */
- handlerton* hton) /* in: InnoDB handlerton */
+ /* out: reference to transaction pointer */
+ THD* thd) /* in: MySQL thread */
{
- return(*(trx_t**) thd_ha_data(thd, hton));
+ return(*(trx_t**) thd_ha_data(thd, innodb_hton_ptr));
}
/************************************************************************
@@ -483,17 +524,20 @@ static
int
innobase_release_temporary_latches(
/*===============================*/
- handlerton *hton,
- THD *thd)
+ /* out: 0 */
+ handlerton* hton, /* in: handlerton */
+ THD* thd) /* in: MySQL thread */
{
trx_t* trx;
+ DBUG_ASSERT(hton == innodb_hton_ptr);
+
if (!innodb_inited) {
return 0;
}
- trx = thd_to_trx(thd, hton);
+ trx = thd_to_trx(thd);
if (trx) {
innobase_release_stat_resources(trx);
@@ -555,21 +599,17 @@ convert_error_code_to_mysql(
tell it also to MySQL so that MySQL knows to empty the
cached binlog for this transaction */
- if (thd) {
- ha_rollback(thd);
- }
+ thd_mark_transaction_to_rollback(thd, TRUE);
return(HA_ERR_LOCK_DEADLOCK);
-
} else if (error == (int) DB_LOCK_WAIT_TIMEOUT) {
/* Starting from 5.0.13, we let MySQL just roll back the
latest SQL statement in a lock wait timeout. Previously, we
rolled back the whole transaction. */
- if (thd && row_rollback_on_timeout) {
- ha_rollback(thd);
- }
+ thd_mark_transaction_to_rollback(thd,
+ (bool)row_rollback_on_timeout);
return(HA_ERR_LOCK_WAIT_TIMEOUT);
@@ -604,7 +644,7 @@ convert_error_code_to_mysql(
} else if (error == (int) DB_TABLE_NOT_FOUND) {
- return(HA_ERR_KEY_NOT_FOUND);
+ return(HA_ERR_NO_SUCH_TABLE);
} else if (error == (int) DB_TOO_BIG_RECORD) {
@@ -621,11 +661,23 @@ convert_error_code_to_mysql(
tell it also to MySQL so that MySQL knows to empty the
cached binlog for this transaction */
- if (thd) {
- ha_rollback(thd);
- }
+ thd_mark_transaction_to_rollback(thd, TRUE);
return(HA_ERR_LOCK_TABLE_FULL);
+ } else if (error == DB_TOO_MANY_CONCURRENT_TRXS) {
+
+ /* Once MySQL add the appropriate code to errmsg.txt then
+ we can get rid of this #ifdef. NOTE: The code checked by
+ the #ifdef is the suggested name for the error condition
+ and the actual error code name could very well be different.
+ This will require some monitoring, ie. the status
+ of this request on our part.*/
+#ifdef ER_TOO_MANY_CONCURRENT_TRXS
+ return(ER_TOO_MANY_CONCURRENT_TRXS);
+#else
+ return(HA_ERR_RECORD_FILE_FULL);
+#endif
+
} else {
return(-1); // Unknown error
}
@@ -673,78 +725,12 @@ innobase_mysql_print_thd(
uint max_query_len) /* in: max query length to print, or 0 to
use the default max length */
{
- const THD* thd;
- const Security_context *sctx;
- const char* s;
-
- thd = (const THD*) input_thd;
- /* We probably want to have original user as part of debug output. */
- sctx = &thd->main_security_ctx;
-
-
- fprintf(f, "MySQL thread id %lu, query id %lu",
- thd->thread_id, (ulong) thd->query_id);
- if (sctx->host) {
- putc(' ', f);
- fputs(sctx->host, f);
- }
-
- if (sctx->ip) {
- putc(' ', f);
- fputs(sctx->ip, f);
- }
-
- if (sctx->user) {
- putc(' ', f);
- fputs(sctx->user, f);
- }
-
- if ((s = thd->proc_info)) {
- putc(' ', f);
- fputs(s, f);
- }
-
- if ((s = thd->query)) {
- /* 3100 is chosen because currently 3000 is the maximum
- max_query_len we ever give this. */
- char buf[3100];
- uint len;
-
- /* If buf is too small, we dynamically allocate storage
- in this. */
- char* dyn_str = NULL;
-
- /* Points to buf or dyn_str. */
- char* str = buf;
-
- if (max_query_len == 0) {
- /* ADDITIONAL SAFETY: the default is to print at
- most 300 chars to reduce the probability of a
- seg fault if there is a race in
- thd->query_length in MySQL; after May 14, 2004
- probably no race any more, but better be
- safe */
- max_query_len = 300;
- }
-
- len = min(thd->query_length, max_query_len);
-
- if (len > (sizeof(buf) - 1)) {
- dyn_str = my_malloc(len + 1, MYF(0));
- str = dyn_str;
- }
-
- /* Use strmake to reduce the timeframe for a race,
- compared to fwrite() */
- len = (uint) (strmake(str, s, len) - str);
- putc('\n', f);
- fwrite(str, 1, len, f);
-
- if (dyn_str) {
- my_free(dyn_str, MYF(0));
- }
- }
+ THD* thd;
+ char buffer[1024];
+ thd = (THD*) input_thd;
+ fputs(thd_security_context(thd, buffer, sizeof(buffer),
+ max_query_len), f);
putc('\n', f);
}
@@ -752,7 +738,7 @@ innobase_mysql_print_thd(
Get the variable length bounds of the given character set.
NOTE that the exact prototype of this function has to be in
-/innobase/data/data0type.ic! */
+/innobase/include/data0type.ic! */
extern "C"
void
innobase_get_cset_width(
@@ -791,7 +777,7 @@ innobase_convert_from_table_id(
{
uint errors;
- strconvert(current_thd->charset(), from,
+ strconvert(thd_charset(current_thd), from,
&my_charset_filename, to, (uint) len, &errors);
}
@@ -810,7 +796,7 @@ innobase_convert_from_id(
{
uint errors;
- strconvert(current_thd->charset(), from,
+ strconvert(thd_charset(current_thd), from,
system_charset_info, to, (uint) len, &errors);
}
@@ -873,7 +859,7 @@ innobase_get_charset(
/* out: connection character set */
void* mysql_thd) /* in: MySQL thread handle */
{
- return(((THD*) mysql_thd)->charset());
+ return(thd_charset((THD*) mysql_thd));
}
/*************************************************************************
@@ -884,22 +870,9 @@ innobase_mysql_tmpfile(void)
/*========================*/
/* out: temporary file descriptor, or < 0 on error */
{
- char filename[FN_REFLEN];
int fd2 = -1;
- File fd = create_temp_file(filename, mysql_tmpdir, "ib",
-#ifdef __WIN__
- O_BINARY | O_TRUNC | O_SEQUENTIAL |
- O_TEMPORARY | O_SHORT_LIVED |
-#endif /* __WIN__ */
- O_CREAT | O_EXCL | O_RDWR,
- MYF(MY_WME));
+ File fd = mysql_tmpfile("ib");
if (fd >= 0) {
-#ifndef __WIN__
- /* On Windows, open files cannot be removed, but files can be
- created with the O_TEMPORARY flag to the same effect
- ("delete on close"). */
- unlink(filename);
-#endif /* !__WIN__ */
/* Copy the file descriptor, so that the additional resources
allocated by create_temp_file() can be freed by invoking
my_close().
@@ -914,7 +887,7 @@ innobase_mysql_tmpfile(void)
my_errno=errno;
my_error(EE_OUT_OF_FILERESOURCES,
MYF(ME_BELL+ME_WAITTANG),
- filename, my_errno);
+ "ib*", my_errno);
}
my_close(fd, MYF(MY_WME));
}
@@ -950,10 +923,9 @@ trx_t*
check_trx_exists(
/*=============*/
/* out: InnoDB transaction handle */
- handlerton* hton, /* in: handlerton for innodb */
THD* thd) /* in: user thread handle */
{
- trx_t*& trx = thd_to_trx(thd, hton);
+ trx_t*& trx = thd_to_trx(thd);
ut_ad(thd == current_thd);
@@ -962,27 +934,26 @@ check_trx_exists(
trx = trx_allocate_for_mysql();
trx->mysql_thd = thd;
- trx->mysql_query_str = &(thd->query);
- trx->active_trans = 0;
+ trx->mysql_query_str = thd_query(thd);
/* Update the info whether we should skip XA steps that eat
CPU time */
- trx->support_xa = (ibool)(thd->variables.innodb_support_xa);
+ trx->support_xa = THDVAR(thd, support_xa);
} else {
if (trx->magic_n != TRX_MAGIC_N) {
mem_analyze_corruption(trx);
- ut_a(0);
+ ut_error;
}
}
- if (thd->options & OPTION_NO_FOREIGN_KEY_CHECKS) {
+ if (thd_test_options(thd, OPTION_NO_FOREIGN_KEY_CHECKS)) {
trx->check_foreigns = FALSE;
} else {
trx->check_foreigns = TRUE;
}
- if (thd->options & OPTION_RELAXED_UNIQUE_CHECKS) {
+ if (thd_test_options(thd, OPTION_RELAXED_UNIQUE_CHECKS)) {
trx->check_unique_secondary = FALSE;
} else {
trx->check_unique_secondary = TRUE;
@@ -1003,6 +974,7 @@ ha_innobase::ha_innobase(handlerton *hton, TABLE_SHARE *table_arg)
HA_CAN_SQL_HANDLER |
HA_PRIMARY_KEY_REQUIRED_FOR_POSITION |
HA_PRIMARY_KEY_IN_READ_INDEX |
+ HA_BINLOG_ROW_CAPABLE |
HA_CAN_GEOMETRY | HA_PARTIAL_COLUMN_READ |
HA_TABLE_SCAN_ON_INDEX),
start_of_scan(0),
@@ -1022,7 +994,7 @@ ha_innobase::update_thd(
{
trx_t* trx;
- trx = check_trx_exists(ht, thd);
+ trx = check_trx_exists(thd);
if (prebuilt->trx != trx) {
@@ -1069,7 +1041,7 @@ innobase_register_trx_and_stmt(
innobase_register_stmt(hton, thd);
- if (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) {
+ if (thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) {
/* No autocommit mode, register for a transaction */
trans_register_ha(thd, TRUE, hton);
@@ -1161,14 +1133,15 @@ innobase_query_caching_of_table_permitted(
ut_a(full_name_len < 999);
- if (thd->variables.tx_isolation == ISO_SERIALIZABLE) {
+ trx = check_trx_exists(thd);
+
+ if (trx->isolation_level == TRX_ISO_SERIALIZABLE) {
/* In the SERIALIZABLE mode we add LOCK IN SHARE MODE to every
plain SELECT if AUTOCOMMIT is not on. */
return((my_bool)FALSE);
}
- trx = check_trx_exists(legacy_innodb_hton, thd);
if (trx->has_search_latch) {
ut_print_timestamp(stderr);
sql_print_error("The calling thread is holding the adaptive "
@@ -1182,7 +1155,7 @@ innobase_query_caching_of_table_permitted(
innobase_release_stat_resources(trx);
- if (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) {
+ if (!thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) {
is_autocommit = TRUE;
} else {
@@ -1227,7 +1200,7 @@ innobase_query_caching_of_table_permitted(
if (trx->active_trans == 0) {
- innobase_register_trx_and_stmt(legacy_innodb_hton, thd);
+ innobase_register_trx_and_stmt(innodb_hton_ptr, thd);
trx->active_trans = 1;
}
@@ -1265,10 +1238,10 @@ innobase_invalidate_query_cache(
/* Argument TRUE below means we are using transactions */
#ifdef HAVE_QUERY_CACHE
- query_cache.invalidate((THD*)(trx->mysql_thd),
- (const char*)full_name,
- (uint32)full_name_len,
- TRUE);
+ mysql_query_cache_invalidate4((THD*) trx->mysql_thd,
+ (const char*) full_name,
+ (uint32) full_name_len,
+ TRUE);
#endif
}
@@ -1296,12 +1269,12 @@ innobase_print_identifier(
output strings buffers must not be shared. The function
only produces more output when the name contains other
characters than [0-9A-Z_a-z]. */
- char* temp_name = my_malloc((uint) namelen + 1, MYF(MY_WME));
+ char* temp_name = (char*) my_malloc((uint) namelen + 1, MYF(MY_WME));
uint qnamelen = (uint) (namelen
+ (1 + sizeof srv_mysql50_table_name_prefix));
if (temp_name) {
- qname = my_malloc(qnamelen, MYF(MY_WME));
+ qname = (char*) my_malloc(qnamelen, MYF(MY_WME));
if (qname) {
memcpy(temp_name, name, namelen);
temp_name[namelen] = 0;
@@ -1348,7 +1321,20 @@ trx_is_interrupted(
/* out: TRUE if interrupted */
trx_t* trx) /* in: transaction */
{
- return(trx && trx->mysql_thd && ((THD*) trx->mysql_thd)->killed);
+ return(trx && trx->mysql_thd && thd_killed((THD*) trx->mysql_thd));
+}
+
+/******************************************************************
+Resets some fields of a prebuilt struct. The template is used in fast
+retrieval of just those column values MySQL needs in its processing. */
+static
+void
+reset_template(
+/*===========*/
+ row_prebuilt_t* prebuilt) /* in/out: prebuilt struct */
+{
+ prebuilt->keep_other_fields_on_keyread = 0;
+ prebuilt->read_just_key = 0;
}
/*********************************************************************
@@ -1367,7 +1353,7 @@ ha_innobase::init_table_handle_for_HANDLER(void)
one. Update the trx pointers in the prebuilt struct. Normally
this operation is done in external_lock. */
- update_thd(current_thd);
+ update_thd(ha_thd());
/* Initialize the prebuilt struct much like it would be inited in
external_lock */
@@ -1386,7 +1372,7 @@ ha_innobase::init_table_handle_for_HANDLER(void)
if (prebuilt->trx->active_trans == 0) {
- innobase_register_trx_and_stmt(ht, current_thd);
+ innobase_register_trx_and_stmt(ht, user_thd);
prebuilt->trx->active_trans = 1;
}
@@ -1409,19 +1395,18 @@ ha_innobase::init_table_handle_for_HANDLER(void)
/* We want always to fetch all columns in the whole row? Or do
we???? */
- prebuilt->read_just_key = FALSE;
-
prebuilt->used_in_HANDLER = TRUE;
-
- prebuilt->keep_other_fields_on_keyread = FALSE;
+ reset_template(prebuilt);
}
/*************************************************************************
Opens an InnoDB database. */
static
int
-innobase_init(void *p)
-/*===============*/
+innobase_init(
+/*==========*/
+ /* out: 0 on success, error code on failure */
+ void *p) /* in: InnoDB handlerton */
{
static char current_dir[3]; /* Set if using current lib */
int err;
@@ -1430,9 +1415,9 @@ innobase_init(void *p)
DBUG_ENTER("innobase_init");
handlerton *innobase_hton= (handlerton *)p;
- legacy_innodb_hton= innobase_hton;
+ innodb_hton_ptr = innobase_hton;
- innobase_hton->state=have_innodb;
+ innobase_hton->state = SHOW_OPTION_YES;
innobase_hton->db_type= DB_TYPE_INNODB;
innobase_hton->savepoint_offset=sizeof(trx_named_savept_t);
innobase_hton->close_connection=innobase_close_connection;
@@ -1457,9 +1442,6 @@ innobase_init(void *p)
innobase_hton->flags=HTON_NO_FLAGS;
innobase_hton->release_temporary_latches=innobase_release_temporary_latches;
- if (have_innodb != SHOW_OPTION_YES)
- DBUG_RETURN(0); // nothing else to do
-
ut_a(DATA_MYSQL_TRUE_VARCHAR == (ulint)MYSQL_TYPE_VARCHAR);
#ifdef UNIV_DEBUG
@@ -1615,10 +1597,7 @@ innobase_init(void *p)
changes the value so that it becomes the number of database pages. */
if (innobase_buffer_pool_awe_mem_mb == 0) {
- /* Careful here: we first convert the signed long int to ulint
- and only after that divide */
-
- srv_pool_size = ((ulint) innobase_buffer_pool_size) / 1024;
+ srv_pool_size = (ulint)(innobase_buffer_pool_size / 1024);
} else {
srv_use_awe = TRUE;
srv_pool_size = (ulint)
@@ -1641,8 +1620,10 @@ innobase_init(void *p)
srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
srv_use_checksums = (ibool) innobase_use_checksums;
- os_use_large_pages = (ibool) innobase_use_large_pages;
- os_large_page_size = (ulint) innobase_large_page_size;
+#ifdef HAVE_LARGE_PAGES
+ if ((os_use_large_pages = (ibool) my_use_large_pages))
+ os_large_page_size = (ulint) opt_large_page_size;
+#endif
row_rollback_on_timeout = (ibool) innobase_rollback_on_timeout;
@@ -1701,7 +1682,6 @@ innobase_init(void *p)
DBUG_RETURN(FALSE);
error:
- have_innodb= SHOW_OPTION_DISABLED; // If we couldn't use handler
DBUG_RETURN(TRUE);
}
@@ -1796,7 +1776,7 @@ innobase_start_trx_and_assign_read_view(
/* Create a new trx struct for thd, if it does not yet have one */
- trx = check_trx_exists(hton, thd);
+ trx = check_trx_exists(thd);
/* This is just to play safe: release a possible FIFO ticket and
search latch. Since we will reserve the kernel mutex, we have to
@@ -1841,10 +1821,10 @@ innobase_commit(
DBUG_ENTER("innobase_commit");
DBUG_PRINT("trans", ("ending transaction"));
- trx = check_trx_exists(hton, thd);
+ trx = check_trx_exists(thd);
/* Update the info whether we should skip XA steps that eat CPU time */
- trx->support_xa = (ibool)(thd->variables.innodb_support_xa);
+ trx->support_xa = THDVAR(thd, support_xa);
/* Since we will reserve the kernel mutex, we have to release
the search system latch first to obey the latching order. */
@@ -1875,7 +1855,7 @@ innobase_commit(
" trx->conc_state != TRX_NOT_STARTED");
}
if (all
- || (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))) {
+ || (!thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) {
/* We were instructed to commit the whole transaction, or
this is an SQL statement end and autocommit is on */
@@ -1900,9 +1880,8 @@ retry:
}
}
- trx->mysql_log_file_name = mysql_bin_log.get_log_fname();
- trx->mysql_log_offset =
- (ib_longlong)mysql_bin_log.get_log_file()->pos_in_file;
+ trx->mysql_log_file_name = mysql_bin_log_file_name();
+ trx->mysql_log_offset = (ib_longlong) mysql_bin_log_file_pos();
innobase_commit_low(trx);
@@ -1924,12 +1903,11 @@ retry:
/* We just mark the SQL statement ended and do not do a
transaction commit */
- if (trx->auto_inc_lock) {
- /* If we had reserved the auto-inc lock for some
- table in this SQL statement we release it now */
+ /* If we had reserved the auto-inc lock for some
+ table in this SQL statement we release it now */
+
+ row_unlock_table_autoinc_for_mysql(trx);
- row_unlock_table_autoinc_for_mysql(trx);
- }
/* Store the current undo_no of the transaction so that we
know where to roll back if we have to roll back the next
SQL statement */
@@ -1937,6 +1915,8 @@ retry:
trx_mark_sql_stat_end(trx);
}
+ trx->n_autoinc_rows = 0; /* Reset the number AUTO-INC rows required */
+
if (trx->declared_to_be_inside_innodb) {
/* Release our possible ticket in the FIFO */
@@ -1950,115 +1930,10 @@ retry:
DBUG_RETURN(0);
}
-#if 0
-/* TODO: put the
-MySQL-4.1 functionality back to 5.0. This is needed to get InnoDB Hot Backup
-to work. */
-
-/*********************************************************************
-This is called when MySQL writes the binlog entry for the current
-transaction. Writes to the InnoDB tablespace info which tells where the
-MySQL binlog entry for the current transaction ended. Also commits the
-transaction inside InnoDB but does NOT flush InnoDB log files to disk.
-To flush you have to call innobase_commit_complete(). We have separated
-flushing to eliminate the bottleneck of LOCK_log in log.cc which disabled
-InnoDB's group commit capability. */
-static
-int
-innobase_report_binlog_offset_and_commit(
-/*=====================================*/
- /* out: 0 */
- handlerton *hton, /* in: Innodb handlerton */
- THD* thd, /* in: user thread */
- void* trx_handle, /* in: InnoDB trx handle */
- char* log_file_name, /* in: latest binlog file name */
- my_off_t end_offset) /* in: the offset in the binlog file
- up to which we wrote */
-{
- trx_t* trx;
-
- trx = (trx_t*)trx_handle;
-
- ut_a(trx != NULL);
-
- trx->mysql_log_file_name = log_file_name;
- trx->mysql_log_offset = (ib_longlong)end_offset;
-
- trx->flush_log_later = TRUE;
-
- innobase_commit(hton, thd, TRUE);
-
- trx->flush_log_later = FALSE;
-
- return(0);
-}
-
-/***********************************************************************
-This function stores the binlog offset and flushes logs. */
-static
-void
-innobase_store_binlog_offset_and_flush_log(
-/*=======================================*/
- char* binlog_name, /* in: binlog name */
- longlong offset) /* in: binlog offset */
-{
- mtr_t mtr;
-
- assert(binlog_name != NULL);
-
- /* Start a mini-transaction */
- mtr_start_noninline(&mtr);
-
- /* Update the latest MySQL binlog name and offset info
- in trx sys header */
-
- trx_sys_update_mysql_binlog_offset(
- binlog_name,
- offset,
- TRX_SYS_MYSQL_LOG_INFO, &mtr);
-
- /* Commits the mini-transaction */
- mtr_commit(&mtr);
-
- /* Synchronous flush of the log buffer to disk */
- log_buffer_flush_to_disk();
-}
-
/*********************************************************************
-This is called after MySQL has written the binlog entry for the current
-transaction. Flushes the InnoDB log files to disk if required. */
+Rolls back a transaction or the latest SQL statement. */
static
int
-innobase_commit_complete(
-/*=====================*/
- /* out: 0 */
- handlerton *hton, /* in: Innodb handlerton */
- THD* thd) /* in: user thread */
-{
- trx_t* trx;
-
- trx = thd_to_trx(thd, hton);
-
- if (trx && trx->active_trans) {
-
- trx->active_trans = 0;
-
- if (UNIV_UNLIKELY(srv_flush_log_at_trx_commit == 0)) {
-
- return(0);
- }
-
- trx_commit_complete_for_mysql(trx);
- }
-
- return(0);
-}
-#endif
-
-/*********************************************************************
-Rolls back a transaction or the latest SQL statement. */
-
-static int
innobase_rollback(
/*==============*/
/* out: 0 or error number */
@@ -2074,10 +1949,10 @@ innobase_rollback(
DBUG_ENTER("innobase_rollback");
DBUG_PRINT("trans", ("aborting transaction"));
- trx = check_trx_exists(hton, thd);
+ trx = check_trx_exists(thd);
/* Update the info whether we should skip XA steps that eat CPU time */
- trx->support_xa = (ibool)(thd->variables.innodb_support_xa);
+ trx->support_xa = THDVAR(thd, support_xa);
/* Release a possible FIFO ticket and search latch. Since we will
reserve the kernel mutex, we have to release the search system latch
@@ -2085,16 +1960,14 @@ innobase_rollback(
innobase_release_stat_resources(trx);
- if (trx->auto_inc_lock) {
- /* If we had reserved the auto-inc lock for some table (if
- we come here to roll back the latest SQL statement) we
- release it now before a possibly lengthy rollback */
+ /* If we had reserved the auto-inc lock for some table (if
+ we come here to roll back the latest SQL statement) we
+ release it now before a possibly lengthy rollback */
- row_unlock_table_autoinc_for_mysql(trx);
- }
+ row_unlock_table_autoinc_for_mysql(trx);
if (all
- || (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))) {
+ || !thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) {
error = trx_rollback_for_mysql(trx);
trx->active_trans = 0;
@@ -2125,13 +1998,11 @@ innobase_rollback_trx(
innobase_release_stat_resources(trx);
- if (trx->auto_inc_lock) {
- /* If we had reserved the auto-inc lock for some table (if
- we come here to roll back the latest SQL statement) we
- release it now before a possibly lengthy rollback */
+ /* If we had reserved the auto-inc lock for some table (if
+ we come here to roll back the latest SQL statement) we
+ release it now before a possibly lengthy rollback */
- row_unlock_table_autoinc_for_mysql(trx);
- }
+ row_unlock_table_autoinc_for_mysql(trx);
error = trx_rollback_for_mysql(trx);
@@ -2140,8 +2011,8 @@ innobase_rollback_trx(
/*********************************************************************
Rolls back a transaction to a savepoint. */
-
-static int
+static
+int
innobase_rollback_to_savepoint(
/*===========================*/
/* out: 0 if success, HA_ERR_NO_SAVEPOINT if
@@ -2158,7 +2029,7 @@ innobase_rollback_to_savepoint(
DBUG_ENTER("innobase_rollback_to_savepoint");
- trx = check_trx_exists(hton, thd);
+ trx = check_trx_exists(thd);
/* Release a possible FIFO ticket and search latch. Since we will
reserve the kernel mutex, we have to release the search system latch
@@ -2194,7 +2065,7 @@ innobase_release_savepoint(
DBUG_ENTER("innobase_release_savepoint");
- trx = check_trx_exists(hton, thd);
+ trx = check_trx_exists(thd);
/* TODO: use provided savepoint data area to store savepoint data */
@@ -2226,10 +2097,12 @@ innobase_savepoint(
(unless we are in sub-statement), so SQL layer ensures that
this method is never called in such situation.
*/
- DBUG_ASSERT(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN) ||
+#ifdef MYSQL_SERVER /* plugins cannot access thd->in_sub_stmt */
+ DBUG_ASSERT(thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN) ||
thd->in_sub_stmt);
+#endif /* MYSQL_SERVER */
- trx = check_trx_exists(hton, thd);
+ trx = check_trx_exists(thd);
/* Release a possible FIFO ticket and search latch. Since we will
reserve the kernel mutex, we have to release the search system latch
@@ -2262,7 +2135,9 @@ innobase_close_connection(
{
trx_t* trx;
- trx = thd_to_trx(thd, hton);
+ DBUG_ENTER("innobase_close_connection");
+ DBUG_ASSERT(hton == innodb_hton_ptr);
+ trx = thd_to_trx(thd);
ut_a(trx);
@@ -2288,7 +2163,7 @@ innobase_close_connection(
thr_local_free(trx->mysql_thread_id);
trx_free_for_mysql(trx);
- return(0);
+ DBUG_RETURN(0);
}
@@ -2314,6 +2189,21 @@ ha_innobase::get_row_type() const
return(ROW_TYPE_NOT_USED);
}
+
+
+/********************************************************************
+Get the table flags to use for the statement. */
+handler::Table_flags
+ha_innobase::table_flags() const
+{
+ /* Need to use tx_isolation here since table flags is (also)
+ called before prebuilt is inited. */
+ ulong const tx_isolation = thd_tx_isolation(current_thd);
+ if (tx_isolation <= ISO_READ_COMMITTED)
+ return int_table_flags;
+ return int_table_flags | HA_BINLOG_STMT_CAPABLE;
+}
+
/********************************************************************
Gives the file extension of an InnoDB single-table tablespace. */
static const char* ha_innobase_exts[] = {
@@ -2397,7 +2287,7 @@ ha_innobase::open(
UT_NOT_USED(mode);
UT_NOT_USED(test_if_locked);
- thd = current_thd;
+ thd = ha_thd();
normalize_table_name(norm_name, name);
user_thd = NULL;
@@ -2415,7 +2305,7 @@ ha_innobase::open(
upd_and_key_val_buff_len =
table->s->reclength + table->s->max_key_length
+ MAX_REF_PARTS * 3;
- if (!(mysql_byte*) my_multi_malloc(MYF(MY_WME),
+ if (!(uchar*) my_multi_malloc(MYF(MY_WME),
&upd_buff, upd_and_key_val_buff_len,
&key_val_buff, upd_and_key_val_buff_len,
NullS)) {
@@ -2441,7 +2331,7 @@ ha_innobase::open(
"how you can resolve the problem.\n",
norm_name);
free_share(share);
- my_free((gptr) upd_buff, MYF(0));
+ my_free(upd_buff, MYF(0));
my_errno = ENOENT;
DBUG_RETURN(HA_ERR_NO_SUCH_TABLE);
@@ -2458,7 +2348,7 @@ ha_innobase::open(
"how you can resolve the problem.\n",
norm_name);
free_share(share);
- my_free((gptr) upd_buff, MYF(0));
+ my_free(upd_buff, MYF(0));
my_errno = ENOENT;
dict_table_decrement_handle_count(ib_table);
@@ -2553,11 +2443,18 @@ ha_innobase::close(void)
/*====================*/
/* out: 0 */
{
+ THD* thd;
+
DBUG_ENTER("ha_innobase::close");
+ thd = current_thd; // avoid calling current_thd twice, it may be slow
+ if (thd != NULL) {
+ innobase_release_temporary_latches(ht, thd);
+ }
+
row_prebuilt_free(prebuilt);
- my_free((gptr) upd_buff, MYF(0));
+ my_free(upd_buff, MYF(0));
free_share(share);
/* Tell InnoDB server that there might be work for
@@ -2580,7 +2477,7 @@ get_field_offset(
TABLE* table, /* in: MySQL table object */
Field* field) /* in: MySQL field object */
{
- return((uint) (field->ptr - (char*) table->record[0]));
+ return((uint) (field->ptr - table->record[0]));
}
/******************************************************************
@@ -2842,8 +2739,8 @@ inline
uint
innobase_read_from_2_little_endian(
/*===============================*/
- /* out: value */
- const mysql_byte* buf) /* in: from where to read */
+ /* out: value */
+ const uchar* buf) /* in: from where to read */
{
return (uint) ((ulint)(buf[0]) + 256 * ((ulint)(buf[1])));
}
@@ -2859,7 +2756,7 @@ ha_innobase::store_key_val_for_row(
char* buff, /* in/out: buffer for the key value (in MySQL
format) */
uint buff_len,/* in: buffer length */
- const mysql_byte* record)/* in: row in MySQL format */
+ const uchar* record)/* in: row in MySQL format */
{
KEY* key_info = table->key_info + keynr;
KEY_PART_INFO* key_part = key_info->key_part;
@@ -3056,7 +2953,7 @@ ha_innobase::store_key_val_for_row(
CHARSET_INFO* cs;
ulint true_len;
ulint key_len;
- const mysql_byte* src_start;
+ const uchar* src_start;
int error=0;
enum_field_types real_type;
@@ -3129,7 +3026,7 @@ static
void
build_template(
/*===========*/
- row_prebuilt_t* prebuilt, /* in: prebuilt struct */
+ row_prebuilt_t* prebuilt, /* in/out: prebuilt struct */
THD* thd, /* in: current user thread, used
only if templ_type is
ROW_MYSQL_REC_FIELDS */
@@ -3336,21 +3233,128 @@ skip_field:
}
/************************************************************************
+This special handling is really to overcome the limitations of MySQL's
+binlogging. We need to eliminate the non-determinism that will arise in
+INSERT ... SELECT type of statements, since MySQL binlog only stores the
+min value of the autoinc interval. Once that is fixed we can get rid of
+the special lock handling.*/
+
+ulong
+ha_innobase::innobase_autoinc_lock(void)
+/*====================================*/
+ /* out: DB_SUCCESS if all OK else
+ error code */
+{
+ ulint error = DB_SUCCESS;
+
+ switch (innobase_autoinc_lock_mode) {
+ case AUTOINC_NO_LOCKING:
+ /* Acquire only the AUTOINC mutex. */
+ dict_table_autoinc_lock(prebuilt->table);
+ break;
+
+ case AUTOINC_NEW_STYLE_LOCKING:
+ /* For simple (single/multi) row INSERTs, we fallback to the
+ old style only if another transaction has already acquired
+ the AUTOINC lock on behalf of a LOAD FILE or INSERT ... SELECT
+ etc. type of statement. */
+ if (thd_sql_command(user_thd) == SQLCOM_INSERT) {
+ dict_table_t* table = prebuilt->table;
+
+ /* Acquire the AUTOINC mutex. */
+ dict_table_autoinc_lock(table);
+
+ /* We need to check that another transaction isn't
+ already holding the AUTOINC lock on the table. */
+ if (table->n_waiting_or_granted_auto_inc_locks) {
+ /* Release the mutex to avoid deadlocks. */
+ dict_table_autoinc_unlock(table);
+ } else {
+ break;
+ }
+ }
+ /* Fall through to old style locking. */
+
+ case AUTOINC_OLD_STYLE_LOCKING:
+ error = row_lock_table_autoinc_for_mysql(prebuilt);
+
+ if (error == DB_SUCCESS) {
+
+ /* Acquire the AUTOINC mutex. */
+ dict_table_autoinc_lock(prebuilt->table);
+ }
+ break;
+
+ default:
+ ut_error;
+ }
+
+ return(ulong(error));
+}
+
+/************************************************************************
+Reset the autoinc value in the table.*/
+
+ulong
+ha_innobase::innobase_reset_autoinc(
+/*================================*/
+ /* out: DB_SUCCESS if all went well
+ else error code */
+ ulonglong autoinc) /* in: value to store */
+{
+ ulint error;
+
+ error = innobase_autoinc_lock();
+
+ if (error == DB_SUCCESS) {
+
+ dict_table_autoinc_initialize(prebuilt->table, autoinc);
+
+ dict_table_autoinc_unlock(prebuilt->table);
+ }
+
+ return(ulong(error));
+}
+
+/************************************************************************
+Store the autoinc value in the table. The autoinc value is only set if
+it's greater than the existing autoinc value in the table.*/
+
+ulong
+ha_innobase::innobase_set_max_autoinc(
+/*==================================*/
+ /* out: DB_SUCCES if all went well
+ else error code */
+ ulonglong auto_inc) /* in: value to store */
+{
+ ulint error;
+
+ error = innobase_autoinc_lock();
+
+ if (error == DB_SUCCESS) {
+
+ dict_table_autoinc_update(prebuilt->table, auto_inc);
+
+ dict_table_autoinc_unlock(prebuilt->table);
+ }
+
+ return(ulong(error));
+}
+
+/************************************************************************
Stores a row in an InnoDB database, to the table specified in this
handle. */
int
ha_innobase::write_row(
/*===================*/
- /* out: error code */
- mysql_byte* record) /* in: a row in MySQL format */
+ /* out: error code */
+ uchar* record) /* in: a row in MySQL format */
{
- int error;
- longlong auto_inc;
- longlong dummy;
+ int error = 0;
ibool auto_inc_used= FALSE;
- THD* thd = current_thd;
- trx_t* trx = thd_to_trx(thd, ht);
+ ulint sql_command;
+ trx_t* trx = thd_to_trx(user_thd);
DBUG_ENTER("ha_innobase::write_row");
@@ -3374,11 +3378,13 @@ ha_innobase::write_row(
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
table->timestamp_field->set_time();
- if ((user_thd->lex->sql_command == SQLCOM_ALTER_TABLE
- || user_thd->lex->sql_command == SQLCOM_OPTIMIZE
- || user_thd->lex->sql_command == SQLCOM_CREATE_INDEX
- || user_thd->lex->sql_command == SQLCOM_DROP_INDEX)
- && num_write_row >= 10000) {
+ sql_command = thd_sql_command(user_thd);
+
+ if ((sql_command == SQLCOM_ALTER_TABLE
+ || sql_command == SQLCOM_OPTIMIZE
+ || sql_command == SQLCOM_CREATE_INDEX
+ || sql_command == SQLCOM_DROP_INDEX)
+ && num_write_row >= 10000) {
/* ALTER TABLE is COMMITted at every 10000 copied rows.
The IX table lock for the original table has to be re-issued.
As this method will be called on a temporary table where the
@@ -3444,62 +3450,20 @@ no_commit:
num_write_row++;
+ /* This is the case where the table has an auto-increment column */
if (table->next_number_field && record == table->record[0]) {
- /* This is the case where the table has an
- auto-increment column */
-
- /* Initialize the auto-inc counter if it has not been
- initialized yet */
-
- if (0 == dict_table_autoinc_peek(prebuilt->table)) {
-
- /* This call initializes the counter */
- error = innobase_read_and_init_auto_inc(&dummy);
-
- if (error) {
- /* Deadlock or lock wait timeout */
-
- goto func_exit;
- }
-
- /* We have to set sql_stat_start to TRUE because
- the above call probably has called a select, and
- has reset that flag; row_insert_for_mysql has to
- know to set the IX intention lock on the table,
- something it only does at the start of each
- statement */
- prebuilt->sql_stat_start = TRUE;
- }
-
- /* We have to use the transactional lock mechanism on the
- auto-inc counter of the table to ensure that replication and
- roll-forward of the binlog exactly imitates also the given
- auto-inc values. The lock is released at each SQL statement's
- end. This lock also prevents a race where two threads would
- call ::get_auto_increment() simultaneously. */
-
- error = row_lock_table_autoinc_for_mysql(prebuilt);
-
- if (error != DB_SUCCESS) {
- /* Deadlock or lock wait timeout */
-
- error = convert_error_code_to_mysql(error, user_thd);
+ if ((error = update_auto_increment())) {
goto func_exit;
}
- /* We must use the handler code to update the auto-increment
- value to be sure that we increment it correctly. */
-
- if ((error= update_auto_increment()))
- goto func_exit;
- auto_inc_used = 1;
-
+ auto_inc_used = TRUE;
}
if (prebuilt->mysql_template == NULL
- || prebuilt->template_type != ROW_MYSQL_WHOLE_ROW) {
+ || prebuilt->template_type != ROW_MYSQL_WHOLE_ROW) {
+
/* Build the template used in converting quickly between
the two database formats */
@@ -3510,45 +3474,71 @@ no_commit:
error = row_insert_for_mysql((byte*) record, prebuilt);
- if (error == DB_SUCCESS && auto_inc_used) {
+ /* Handle duplicate key errors */
+ if (auto_inc_used) {
+ ulonglong auto_inc;
- /* Fetch the value that was set in the autoincrement field */
+ /* Note the number of rows processed for this statement, used
+ by get_auto_increment() to determine the number of AUTO-INC
+ values to reserve. This is only useful for a mult-value INSERT
+ and is a statement level counter.*/
+ if (trx->n_autoinc_rows > 0) {
+ --trx->n_autoinc_rows;
+ }
+ /* Get the value that MySQL attempted to store in the table.*/
auto_inc = table->next_number_field->val_int();
- if (auto_inc != 0) {
- /* This call will update the counter according to the
- value that was inserted in the table */
+ switch (error) {
+ case DB_DUPLICATE_KEY:
+
+ /* A REPLACE command and LOAD DATA INFILE REPLACE
+ handle a duplicate key error themselves, but we
+ must update the autoinc counter if we are performing
+ those statements. */
+
+ switch (sql_command) {
+ case SQLCOM_LOAD:
+ if ((trx->duplicates
+ & (TRX_DUP_IGNORE | TRX_DUP_REPLACE))) {
+
+ goto set_max_autoinc;
+ }
+ break;
+
+ case SQLCOM_REPLACE:
+ case SQLCOM_INSERT_SELECT:
+ case SQLCOM_REPLACE_SELECT:
+ goto set_max_autoinc;
+ break;
- dict_table_autoinc_update(prebuilt->table, auto_inc);
- }
- }
+ default:
+ break;
+ }
- /* A REPLACE command and LOAD DATA INFILE REPLACE handle a duplicate
- key error themselves, and we must update the autoinc counter if we are
- performing those statements. */
+ break;
- if (error == DB_DUPLICATE_KEY && auto_inc_used
- && (user_thd->lex->sql_command == SQLCOM_REPLACE
- || user_thd->lex->sql_command == SQLCOM_REPLACE_SELECT
- || (user_thd->lex->sql_command == SQLCOM_INSERT
- && user_thd->lex->duplicates == DUP_UPDATE)
- || (user_thd->lex->sql_command == SQLCOM_LOAD
- && user_thd->lex->duplicates == DUP_REPLACE))) {
+ case DB_SUCCESS:
+ /* If the actual value inserted is greater than
+ the upper limit of the interval, then we try and
+ update the table upper limit. Note: last_value
+ will be 0 if get_auto_increment() was not called.*/
- auto_inc = table->next_number_field->val_int();
+ if (auto_inc > prebuilt->last_value) {
+set_max_autoinc:
+ ut_a(prebuilt->table->autoinc_increment > 0);
+ auto_inc += prebuilt->table->autoinc_increment;
- if (auto_inc != 0) {
- dict_table_autoinc_update(prebuilt->table, auto_inc);
- }
- }
+ innobase_set_max_autoinc(auto_inc);
+ }
+ break;
+ }
+ }
innodb_srv_conc_exit_innodb(prebuilt->trx);
error = convert_error_code_to_mysql(error, user_thd);
- /* Tell InnoDB server that there might be work for
- utility threads: */
func_exit:
innobase_active_small();
@@ -3564,16 +3554,16 @@ calc_row_difference(
/*================*/
/* out: error number or 0 */
upd_t* uvect, /* in/out: update vector */
- mysql_byte* old_row, /* in: old row in MySQL format */
- mysql_byte* new_row, /* in: new row in MySQL format */
+ 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
dictionary */
- mysql_byte* upd_buff, /* in: buffer to use */
+ uchar* upd_buff, /* in: buffer to use */
ulint buff_len, /* in: buffer length */
row_prebuilt_t* prebuilt, /* in: InnoDB prebuilt struct */
THD* thd) /* in: user thread */
{
- mysql_byte* original_upd_buff = upd_buff;
+ uchar* original_upd_buff = upd_buff;
Field* field;
enum_field_types field_mysql_type;
uint n_fields;
@@ -3717,12 +3707,12 @@ int
ha_innobase::update_row(
/*====================*/
/* out: error number or 0 */
- const mysql_byte* old_row,/* in: old row in MySQL format */
- mysql_byte* new_row)/* in: new row in MySQL format */
+ const uchar* old_row, /* in: old row in MySQL format */
+ uchar* new_row) /* in: new row in MySQL format */
{
upd_t* uvect;
int error = 0;
- trx_t* trx = thd_to_trx(current_thd, ht);
+ trx_t* trx = thd_to_trx(user_thd);
DBUG_ENTER("ha_innobase::update_row");
@@ -3740,7 +3730,7 @@ ha_innobase::update_row(
/* Build an update vector from the modified fields in the rows
(uses upd_buff of the handle) */
- calc_row_difference(uvect, (mysql_byte*) old_row, new_row, table,
+ calc_row_difference(uvect, (uchar*) old_row, new_row, table,
upd_buff, (ulint)upd_and_key_val_buff_len,
prebuilt, user_thd);
@@ -3753,6 +3743,32 @@ ha_innobase::update_row(
error = row_update_for_mysql((byte*) old_row, prebuilt);
+ /* We need to do some special AUTOINC handling for the following case:
+
+ INSERT INTO t (c1,c2) VALUES(x,y) ON DUPLICATE KEY UPDATE ...
+
+ We need to use the AUTOINC counter that was actually used by
+ MySQL in the UPDATE statement, which can be different from the
+ value used in the INSERT statement.*/
+
+ if (error == DB_SUCCESS
+ && table->next_number_field
+ && new_row == table->record[0]
+ && thd_sql_command(user_thd) == SQLCOM_INSERT
+ && (trx->duplicates & (TRX_DUP_IGNORE | TRX_DUP_REPLACE))
+ == TRX_DUP_IGNORE) {
+
+ longlong auto_inc;
+
+ auto_inc = table->next_number_field->val_int();
+
+ if (auto_inc != 0) {
+ auto_inc += prebuilt->table->autoinc_increment;
+
+ innobase_set_max_autoinc(auto_inc);
+ }
+ }
+
innodb_srv_conc_exit_innodb(trx);
error = convert_error_code_to_mysql(error, user_thd);
@@ -3771,16 +3787,40 @@ Deletes a row given as the parameter. */
int
ha_innobase::delete_row(
/*====================*/
- /* out: error number or 0 */
- const mysql_byte* record) /* in: a row in MySQL format */
+ /* out: error number or 0 */
+ const uchar* record) /* in: a row in MySQL format */
{
int error = 0;
- trx_t* trx = thd_to_trx(current_thd, ht);
+ trx_t* trx = thd_to_trx(user_thd);
DBUG_ENTER("ha_innobase::delete_row");
ut_a(prebuilt->trx == trx);
+ /* Only if the table has an AUTOINC column */
+ if (table->found_next_number_field && record == table->record[0]) {
+ ulonglong dummy = 0;
+
+ /* First check whether the AUTOINC sub-system has been
+ initialized using the AUTOINC mutex. If not then we
+ do it the "proper" way, by acquiring the heavier locks. */
+ dict_table_autoinc_lock(prebuilt->table);
+
+ if (!prebuilt->table->autoinc_inited) {
+ dict_table_autoinc_unlock(prebuilt->table);
+
+ error = innobase_get_auto_increment(&dummy);
+
+ if (error == DB_SUCCESS) {
+ dict_table_autoinc_unlock(prebuilt->table);
+ } else {
+ goto error_exit;
+ }
+ } else {
+ dict_table_autoinc_unlock(prebuilt->table);
+ }
+ }
+
if (!prebuilt->upd_node) {
row_get_prebuilt_update_vector(prebuilt);
}
@@ -3795,6 +3835,7 @@ ha_innobase::delete_row(
innodb_srv_conc_exit_innodb(trx);
+error_exit:
error = convert_error_code_to_mysql(error, user_thd);
/* Tell the InnoDB server that there might be work for
@@ -3854,14 +3895,15 @@ void
ha_innobase::try_semi_consistent_read(bool yes)
/*===========================================*/
{
- ut_a(prebuilt->trx == thd_to_trx(current_thd, ht));
+ ut_a(prebuilt->trx == thd_to_trx(ha_thd()));
/* Row read type is set to semi consistent read if this was
requested by the MySQL and either innodb_locks_unsafe_for_binlog
option is used or this session is using READ COMMITTED isolation
level. */
- if (yes && (srv_locks_unsafe_for_binlog
+ if (yes
+ && (srv_locks_unsafe_for_binlog
|| prebuilt->trx->isolation_level == TRX_ISO_READ_COMMITTED)) {
prebuilt->row_read_type = ROW_READ_TRY_SEMI_CONSISTENT;
} else {
@@ -3997,9 +4039,9 @@ ha_innobase::index_read(
/*====================*/
/* out: 0, HA_ERR_KEY_NOT_FOUND,
or error number */
- mysql_byte* buf, /* in/out: buffer for the returned
+ uchar* buf, /* in/out: buffer for the returned
row */
- const mysql_byte* key_ptr,/* in: key value; if this is NULL
+ const uchar* key_ptr, /* in: key value; if this is NULL
we position the cursor at the
start or end of index; this can
also contain an InnoDB row id, in
@@ -4019,7 +4061,7 @@ ha_innobase::index_read(
DBUG_ENTER("index_read");
- ut_a(prebuilt->trx == thd_to_trx(current_thd, ht));
+ ut_a(prebuilt->trx == thd_to_trx(user_thd));
ha_statistic_increment(&SSV::ha_read_key_count);
@@ -4096,54 +4138,78 @@ row with the current key value or prefix. */
int
ha_innobase::index_read_last(
/*=========================*/
- /* out: 0, HA_ERR_KEY_NOT_FOUND, or an
- error code */
- mysql_byte* buf, /* out: fetched row */
- const mysql_byte* key_ptr, /* in: key value, or a prefix of a full
- key value */
- uint key_len) /* in: length of the key val or prefix
- in bytes */
+ /* out: 0, HA_ERR_KEY_NOT_FOUND, or an
+ error code */
+ uchar* buf, /* out: fetched row */
+ const uchar* key_ptr,/* in: key value, or a prefix of a full
+ key value */
+ uint key_len)/* in: length of the key val or prefix
+ in bytes */
{
return(index_read(buf, key_ptr, key_len, HA_READ_PREFIX_LAST));
}
/************************************************************************
-Changes the active index of a handle. */
+Get the index for a handle. Does not change active index.*/
-int
-ha_innobase::change_active_index(
-/*=============================*/
- /* out: 0 or error code */
- uint keynr) /* in: use this index; MAX_KEY means always clustered
- index, even if it was internally generated by
- InnoDB */
+dict_index_t*
+ha_innobase::innobase_get_index(
+/*============================*/
+ /* out: NULL or index instance. */
+ uint keynr) /* in: use this index; MAX_KEY means always
+ clustered index, even if it was internally
+ generated by InnoDB */
{
- KEY* key=0;
+ KEY* key = 0;
+ dict_index_t* index = 0;
+
+ DBUG_ENTER("innobase_get_index");
ha_statistic_increment(&SSV::ha_read_key_count);
- DBUG_ENTER("change_active_index");
- ut_ad(user_thd == current_thd);
- ut_a(prebuilt->trx == thd_to_trx(user_thd, ht));
-
- active_index = keynr;
+ ut_ad(user_thd == ha_thd());
+ ut_a(prebuilt->trx == thd_to_trx(user_thd));
if (keynr != MAX_KEY && table->s->keys > 0) {
- key = table->key_info + active_index;
+ key = table->key_info + keynr;
- prebuilt->index = dict_table_get_index_noninline(
+ index = dict_table_get_index_noninline(
prebuilt->table, key->name);
} else {
- prebuilt->index = dict_table_get_first_index_noninline(
- prebuilt->table);
+ index = dict_table_get_first_index_noninline(prebuilt->table);
}
- if (!prebuilt->index) {
+ if (!index) {
sql_print_error(
"Innodb could not find key n:o %u with name %s "
"from dict cache for table %s",
keynr, key ? key->name : "NULL",
prebuilt->table->name);
+ }
+
+ DBUG_RETURN(index);
+}
+
+/************************************************************************
+Changes the active index of a handle. */
+
+int
+ha_innobase::change_active_index(
+/*=============================*/
+ /* out: 0 or error code */
+ uint keynr) /* in: use this index; MAX_KEY means always clustered
+ index, even if it was internally generated by
+ InnoDB */
+{
+ DBUG_ENTER("change_active_index");
+
+ ut_ad(user_thd == ha_thd());
+ ut_a(prebuilt->trx == thd_to_trx(user_thd));
+
+ active_index = keynr;
+
+ prebuilt->index = innobase_get_index(keynr);
+ if (!prebuilt->index) {
DBUG_RETURN(1);
}
@@ -4174,10 +4240,10 @@ int
ha_innobase::index_read_idx(
/*========================*/
/* out: error number or 0 */
- mysql_byte* buf, /* in/out: buffer for the returned
+ uchar* buf, /* in/out: buffer for the returned
row */
uint keynr, /* in: use this index */
- const mysql_byte* key, /* in: key value; if this is NULL
+ const uchar* key, /* in: key value; if this is NULL
we position the cursor at the
start or end of index */
uint key_len, /* in: key value length */
@@ -4200,7 +4266,7 @@ ha_innobase::general_fetch(
/*=======================*/
/* out: 0, HA_ERR_END_OF_FILE, or error
number */
- mysql_byte* buf, /* in/out: buffer for next row in MySQL
+ uchar* buf, /* in/out: buffer for next row in MySQL
format */
uint direction, /* in: ROW_SEL_NEXT or ROW_SEL_PREV */
uint match_mode) /* in: 0, ROW_SEL_EXACT, or
@@ -4211,7 +4277,7 @@ ha_innobase::general_fetch(
DBUG_ENTER("general_fetch");
- ut_a(prebuilt->trx == thd_to_trx(current_thd, ht));
+ ut_a(prebuilt->trx == thd_to_trx(user_thd));
innodb_srv_conc_enter_innodb(prebuilt->trx);
@@ -4247,7 +4313,7 @@ ha_innobase::index_next(
/*====================*/
/* out: 0, HA_ERR_END_OF_FILE, or error
number */
- mysql_byte* buf) /* in/out: buffer for next row in MySQL
+ uchar* buf) /* in/out: buffer for next row in MySQL
format */
{
ha_statistic_increment(&SSV::ha_read_next_count);
@@ -4263,8 +4329,8 @@ ha_innobase::index_next_same(
/*=========================*/
/* out: 0, HA_ERR_END_OF_FILE, or error
number */
- mysql_byte* buf, /* in/out: buffer for the row */
- const mysql_byte* key, /* in: key value */
+ uchar* buf, /* in/out: buffer for the row */
+ const uchar* key, /* in: key value */
uint keylen) /* in: key value length */
{
ha_statistic_increment(&SSV::ha_read_next_count);
@@ -4279,10 +4345,8 @@ positioned using index_read. */
int
ha_innobase::index_prev(
/*====================*/
- /* out: 0, HA_ERR_END_OF_FILE, or error
- number */
- mysql_byte* buf) /* in/out: buffer for previous row in MySQL
- format */
+ /* out: 0, HA_ERR_END_OF_FILE, or error number */
+ uchar* buf) /* in/out: buffer for previous row in MySQL format */
{
ha_statistic_increment(&SSV::ha_read_prev_count);
@@ -4296,9 +4360,8 @@ corresponding row to buf. */
int
ha_innobase::index_first(
/*=====================*/
- /* out: 0, HA_ERR_END_OF_FILE,
- or error code */
- mysql_byte* buf) /* in/out: buffer for the row */
+ /* out: 0, HA_ERR_END_OF_FILE, or error code */
+ uchar* buf) /* in/out: buffer for the row */
{
int error;
@@ -4323,8 +4386,8 @@ corresponding row to buf. */
int
ha_innobase::index_last(
/*====================*/
- /* out: 0, HA_ERR_END_OF_FILE, or error code */
- mysql_byte* buf) /* in/out: buffer for the row */
+ /* out: 0, HA_ERR_END_OF_FILE, or error code */
+ uchar* buf) /* in/out: buffer for the row */
{
int error;
@@ -4393,7 +4456,7 @@ int
ha_innobase::rnd_next(
/*==================*/
/* out: 0, HA_ERR_END_OF_FILE, or error number */
- mysql_byte* buf)/* in/out: returns the row in this buffer,
+ uchar* buf) /* in/out: returns the row in this buffer,
in MySQL format */
{
int error;
@@ -4420,23 +4483,21 @@ Fetches a row from the table based on a row reference. */
int
ha_innobase::rnd_pos(
/*=================*/
- /* out: 0, HA_ERR_KEY_NOT_FOUND,
- or error code */
- mysql_byte* buf, /* in/out: buffer for the row */
- mysql_byte* pos) /* in: primary key value of the row in the
- MySQL format, or the row id if the clustered
- index was internally generated by InnoDB;
- the length of data in pos has to be
- ref_length */
+ /* out: 0, HA_ERR_KEY_NOT_FOUND, or error code */
+ uchar* buf, /* in/out: buffer for the row */
+ uchar* pos) /* in: primary key value of the row in the
+ MySQL format, or the row id if the clustered
+ index was internally generated by InnoDB; the
+ length of data in pos has to be ref_length */
{
int error;
uint keynr = active_index;
DBUG_ENTER("rnd_pos");
- DBUG_DUMP("key", (char*) pos, ref_length);
+ DBUG_DUMP("key", pos, ref_length);
ha_statistic_increment(&SSV::ha_read_rnd_count);
- ut_a(prebuilt->trx == thd_to_trx(current_thd, ht));
+ ut_a(prebuilt->trx == thd_to_trx(ha_thd()));
if (prebuilt->clust_index_was_generated) {
/* No primary key was defined for the table and we
@@ -4480,11 +4541,11 @@ was positioned the last time. */
void
ha_innobase::position(
/*==================*/
- const mysql_byte* record) /* in: row in MySQL format */
+ const uchar* record) /* in: row in MySQL format */
{
uint len;
- ut_a(prebuilt->trx == thd_to_trx(current_thd, ht));
+ ut_a(prebuilt->trx == thd_to_trx(ha_thd()));
if (prebuilt->clust_index_was_generated) {
/* No primary key was defined for the table and we
@@ -4510,6 +4571,24 @@ ha_innobase::position(
}
/*********************************************************************
+If it's a DB_TOO_BIG_RECORD error then set a suitable message to
+return to the client.*/
+inline
+void
+innodb_check_for_record_too_big_error(
+/*==================================*/
+ ulint comp, /* in: ROW_FORMAT: nonzero=COMPACT, 0=REDUNDANT */
+ int error) /* in: error code to check */
+{
+ if (error == (int)DB_TOO_BIG_RECORD) {
+ ulint max_row_size
+ = page_get_free_space_of_empty_noninline(comp) / 2;
+
+ my_error(ER_TOO_BIG_ROWSIZE, MYF(0), max_row_size);
+ }
+}
+
+/*********************************************************************
Creates a table definition to an InnoDB database. */
static
int
@@ -4604,7 +4683,7 @@ create_table_def(
}
}
- dict_mem_table_add_col(table,
+ dict_mem_table_add_col(table, table->heap,
(char*) field->field_name,
col_type,
dtype_form_prtype(
@@ -4617,6 +4696,8 @@ create_table_def(
error = row_create_table_for_mysql(table, trx);
+ innodb_check_for_record_too_big_error(flags & DICT_TF_COMPACT, error);
+
error = convert_error_code_to_mysql(error, NULL);
DBUG_RETURN(error);
@@ -4739,9 +4820,12 @@ create_index(
sure we don't create too long indexes. */
error = row_create_index_for_mysql(index, trx, field_lengths);
+ innodb_check_for_record_too_big_error(form->s->row_type
+ != ROW_TYPE_REDUNDANT, error);
+
error = convert_error_code_to_mysql(error, NULL);
- my_free((gptr) field_lengths, MYF(0));
+ my_free(field_lengths, MYF(0));
DBUG_RETURN(error);
}
@@ -4754,6 +4838,8 @@ int
create_clustered_index_when_no_primary(
/*===================================*/
trx_t* trx, /* in: InnoDB transaction handle */
+ ulint comp, /* in: ROW_FORMAT:
+ nonzero=COMPACT, 0=REDUNDANT */
const char* table_name) /* in: table name */
{
dict_index_t* index;
@@ -4762,10 +4848,12 @@ create_clustered_index_when_no_primary(
/* We pass 0 as the space id, and determine at a lower level the space
id where to store the table */
- index = dict_mem_index_create((char*) table_name,
- (char*) "GEN_CLUST_INDEX", 0, DICT_CLUSTERED, 0);
+ index = dict_mem_index_create(table_name, "GEN_CLUST_INDEX",
+ 0, DICT_CLUSTERED, 0);
error = row_create_index_for_mysql(index, trx, NULL);
+ innodb_check_for_record_too_big_error(comp, error);
+
error = convert_error_code_to_mysql(error, NULL);
return(error);
@@ -4807,7 +4895,7 @@ ha_innobase::create(
uint i;
char name2[FN_REFLEN];
char norm_name[FN_REFLEN];
- THD *thd= current_thd;
+ THD* thd = ha_thd();
ib_longlong auto_inc_value;
ulint flags;
@@ -4825,7 +4913,7 @@ ha_innobase::create(
/* Get the transaction associated with the current thd, or create one
if not yet created */
- parent_trx = check_trx_exists(ht, thd);
+ parent_trx = check_trx_exists(thd);
/* In case MySQL calls this in the middle of a SELECT query, release
possible adaptive hash latch to avoid deadlocks of threads */
@@ -4835,13 +4923,13 @@ ha_innobase::create(
trx = trx_allocate_for_mysql();
trx->mysql_thd = thd;
- trx->mysql_query_str = &((*thd).query);
+ trx->mysql_query_str = thd_query(thd);
- if (thd->options & OPTION_NO_FOREIGN_KEY_CHECKS) {
+ if (thd_test_options(thd, OPTION_NO_FOREIGN_KEY_CHECKS)) {
trx->check_foreigns = FALSE;
}
- if (thd->options & OPTION_RELAXED_UNIQUE_CHECKS) {
+ if (thd_test_options(thd, OPTION_RELAXED_UNIQUE_CHECKS)) {
trx->check_unique_secondary = FALSE;
}
@@ -4895,8 +4983,9 @@ ha_innobase::create(
order the rows by their row id which is internally generated
by InnoDB */
- error = create_clustered_index_when_no_primary(trx,
- norm_name);
+ error = create_clustered_index_when_no_primary(
+ trx, form->s->row_type != ROW_TYPE_REDUNDANT,
+ norm_name);
if (error) {
goto cleanup;
}
@@ -4921,9 +5010,9 @@ ha_innobase::create(
}
}
- if (thd->query != NULL) {
+ if (*trx->mysql_query_str) {
error = row_table_add_foreign_constraints(trx,
- thd->query, norm_name,
+ *trx->mysql_query_str, norm_name,
create_info->options & HA_LEX_CREATE_TMP_TABLE);
error = convert_error_code_to_mysql(error, NULL);
@@ -4958,7 +5047,10 @@ ha_innobase::create(
maximum value in the column. */
auto_inc_value = create_info->auto_increment_value;
+
+ dict_table_autoinc_lock(innobase_table);
dict_table_autoinc_initialize(innobase_table, auto_inc_value);
+ dict_table_autoinc_unlock(innobase_table);
}
/* Tell the InnoDB server that there might be work for
@@ -4997,7 +5089,7 @@ ha_innobase::discard_or_import_tablespace(
ut_a(prebuilt->trx);
ut_a(prebuilt->trx->magic_n == TRX_MAGIC_N);
- ut_a(prebuilt->trx == thd_to_trx(current_thd, ht));
+ ut_a(prebuilt->trx == thd_to_trx(ha_thd()));
dict_table = prebuilt->table;
trx = prebuilt->trx;
@@ -5022,22 +5114,21 @@ ha_innobase::delete_all_rows(void)
/* out: error number */
{
int error;
- THD* thd = current_thd;
DBUG_ENTER("ha_innobase::delete_all_rows");
- if (thd->lex->sql_command != SQLCOM_TRUNCATE) {
+ /* Get the transaction associated with the current thd, or create one
+ if not yet created, and update prebuilt->trx */
+
+ update_thd(ha_thd());
+
+ if (thd_sql_command(user_thd) != SQLCOM_TRUNCATE) {
fallback:
/* We only handle TRUNCATE TABLE t as a special case.
DELETE FROM t will have to use ha_innobase::delete_row(). */
DBUG_RETURN(my_errno=HA_ERR_WRONG_COMMAND);
}
- /* Get the transaction associated with the current thd, or create one
- if not yet created, and update prebuilt->trx */
-
- update_thd(thd);
-
/* Truncate the table in InnoDB */
error = row_truncate_table_for_mysql(prebuilt->table, prebuilt->trx);
@@ -5068,7 +5159,7 @@ ha_innobase::delete_table(
int error;
trx_t* parent_trx;
trx_t* trx;
- THD *thd= current_thd;
+ THD *thd = ha_thd();
char norm_name[1000];
DBUG_ENTER("ha_innobase::delete_table");
@@ -5076,7 +5167,7 @@ ha_innobase::delete_table(
/* Get the transaction associated with the current thd, or create one
if not yet created */
- parent_trx = check_trx_exists(ht, thd);
+ parent_trx = check_trx_exists(thd);
/* In case MySQL calls this in the middle of a SELECT query, release
possible adaptive hash latch to avoid deadlocks of threads */
@@ -5091,14 +5182,14 @@ ha_innobase::delete_table(
trx = trx_allocate_for_mysql();
- trx->mysql_thd = current_thd;
- trx->mysql_query_str = &((*current_thd).query);
+ trx->mysql_thd = thd;
+ trx->mysql_query_str = thd_query(thd);
- if (thd->options & OPTION_NO_FOREIGN_KEY_CHECKS) {
+ if (thd_test_options(thd, OPTION_NO_FOREIGN_KEY_CHECKS)) {
trx->check_foreigns = FALSE;
}
- if (thd->options & OPTION_RELAXED_UNIQUE_CHECKS) {
+ if (thd_test_options(thd, OPTION_RELAXED_UNIQUE_CHECKS)) {
trx->check_unique_secondary = FALSE;
}
@@ -5114,7 +5205,8 @@ ha_innobase::delete_table(
/* Drop the table in InnoDB */
error = row_drop_table_for_mysql(norm_name, trx,
- thd->lex->sql_command == SQLCOM_DROP_DB);
+ thd_sql_command(thd)
+ == SQLCOM_DROP_DB);
/* Flush the log to reduce probability that the .frm files and
the InnoDB data dictionary get out-of-sync if the user runs
@@ -5155,11 +5247,12 @@ innobase_drop_database(
char* ptr;
int error;
char* namebuf;
+ THD* thd = current_thd;
/* Get the transaction associated with the current thd, or create one
if not yet created */
- parent_trx = check_trx_exists(hton, current_thd);
+ parent_trx = check_trx_exists(thd);
/* In case MySQL calls this in the middle of a SELECT query, release
possible adaptive hash latch to avoid deadlocks of threads */
@@ -5174,7 +5267,7 @@ innobase_drop_database(
}
ptr++;
- namebuf = my_malloc((uint) len + 2, MYF(0));
+ namebuf = (char*) my_malloc((uint) len + 2, MYF(0));
memcpy(namebuf, ptr, len);
namebuf[len] = '/';
@@ -5183,10 +5276,10 @@ innobase_drop_database(
innobase_casedn_str(namebuf);
#endif
trx = trx_allocate_for_mysql();
- trx->mysql_thd = current_thd;
- trx->mysql_query_str = &((*current_thd).query);
+ trx->mysql_thd = thd;
+ trx->mysql_query_str = thd_query(thd);
- if (current_thd->options & OPTION_NO_FOREIGN_KEY_CHECKS) {
+ if (thd_test_options(thd, OPTION_NO_FOREIGN_KEY_CHECKS)) {
trx->check_foreigns = FALSE;
}
@@ -5232,13 +5325,14 @@ ha_innobase::rename_table(
trx_t* trx;
char norm_from[1000];
char norm_to[1000];
+ THD* thd = ha_thd();
DBUG_ENTER("ha_innobase::rename_table");
/* Get the transaction associated with the current thd, or create one
if not yet created */
- parent_trx = check_trx_exists(ht, current_thd);
+ parent_trx = check_trx_exists(thd);
/* In case MySQL calls this in the middle of a SELECT query, release
possible adaptive hash latch to avoid deadlocks of threads */
@@ -5252,10 +5346,10 @@ ha_innobase::rename_table(
}
trx = trx_allocate_for_mysql();
- trx->mysql_thd = current_thd;
- trx->mysql_query_str = &((*current_thd).query);
+ trx->mysql_thd = thd;
+ trx->mysql_query_str = thd_query(thd);
- if (current_thd->options & OPTION_NO_FOREIGN_KEY_CHECKS) {
+ if (thd_test_options(thd, OPTION_NO_FOREIGN_KEY_CHECKS)) {
trx->check_foreigns = FALSE;
}
@@ -5307,7 +5401,7 @@ ha_innobase::records_in_range(
{
KEY* key;
dict_index_t* index;
- mysql_byte* key_val_buff2 = (mysql_byte*) my_malloc(
+ uchar* key_val_buff2 = (uchar*) my_malloc(
table->s->reclength
+ table->s->max_key_length + 100,
MYF(MY_FAE));
@@ -5323,7 +5417,7 @@ ha_innobase::records_in_range(
DBUG_ENTER("records_in_range");
- ut_a(prebuilt->trx == thd_to_trx(current_thd, ht));
+ ut_a(prebuilt->trx == thd_to_trx(ha_thd()));
prebuilt->trx->op_info = (char*)"estimating records in index range";
@@ -5349,7 +5443,7 @@ ha_innobase::records_in_range(
(ulint)upd_and_key_val_buff_len,
index,
(byte*) (min_key ? min_key->key :
- (const mysql_byte*) 0),
+ (const uchar*) 0),
(ulint) (min_key ? min_key->length : 0),
prebuilt->trx);
@@ -5357,7 +5451,7 @@ ha_innobase::records_in_range(
range_end, (byte*) key_val_buff2,
buff2_len, index,
(byte*) (max_key ? max_key->key :
- (const mysql_byte*) 0),
+ (const uchar*) 0),
(ulint) (max_key ? max_key->length : 0),
prebuilt->trx);
@@ -5371,7 +5465,7 @@ ha_innobase::records_in_range(
dtuple_free_for_mysql(heap1);
dtuple_free_for_mysql(heap2);
- my_free((gptr) key_val_buff2, MYF(0));
+ my_free(key_val_buff2, MYF(0));
prebuilt->trx->op_info = (char*)"";
@@ -5407,7 +5501,7 @@ ha_innobase::estimate_rows_upper_bound(void)
external_lock(). To be safe, update the thd of the current table
handle. */
- update_thd(current_thd);
+ update_thd(ha_thd());
prebuilt->trx->op_info = (char*)
"calculating upper bound for table rows";
@@ -5517,14 +5611,19 @@ ha_innobase::info(
if (srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE) {
- DBUG_RETURN(HA_ERR_CRASHED);
+ /* We return success (0) instead of HA_ERR_CRASHED,
+ because we want MySQL to process this query and not
+ stop, like it would do if it received the error code
+ HA_ERR_CRASHED. */
+
+ DBUG_RETURN(0);
}
/* We do not know if MySQL can call this function before calling
external_lock(). To be safe, update the thd of the current table
handle. */
- update_thd(current_thd);
+ update_thd(ha_thd());
/* In case MySQL calls this in the middle of a SELECT query, release
possible adaptive hash latch to avoid deadlocks of threads */
@@ -5537,15 +5636,14 @@ ha_innobase::info(
if (flag & HA_STATUS_TIME) {
if (srv_stats_on_metadata) {
- /* In sql_show we call with this flag: update then statistics
- so that they are up-to-date */
+ /* In sql_show we call with this flag: update
+ then statistics so that they are up-to-date */
- prebuilt->trx->op_info = (char*)"updating table statistics";
+ prebuilt->trx->op_info = "updating table statistics";
dict_update_statistics(ib_table);
- prebuilt->trx->op_info = (char*)
- "returning various info to MySQL";
+ prebuilt->trx->op_info = "returning various info to MySQL";
}
my_snprintf(path, sizeof(path), "%s/%s%s",
@@ -5662,7 +5760,7 @@ ha_innobase::info(
table->key_info[i].rec_per_key[j]=
rec_per_key >= ~(ulong) 0 ? ~(ulong) 0 :
- rec_per_key;
+ (ulong) rec_per_key;
}
index = dict_table_get_next_index_noninline(index);
@@ -5670,7 +5768,8 @@ ha_innobase::info(
}
if (flag & HA_STATUS_ERRKEY) {
- ut_a(prebuilt->trx && prebuilt->trx->magic_n == TRX_MAGIC_N);
+ ut_a(prebuilt->trx);
+ ut_a(prebuilt->trx->magic_n == TRX_MAGIC_N);
errkey = (unsigned int) row_get_mysql_key_number_for_index(
(dict_index_t*) trx_get_error_info(prebuilt->trx));
@@ -5754,8 +5853,10 @@ ha_innobase::check(
{
ulint ret;
- ut_a(prebuilt->trx && prebuilt->trx->magic_n == TRX_MAGIC_N);
- ut_a(prebuilt->trx == thd_to_trx(current_thd, ht));
+ DBUG_ASSERT(thd == ha_thd());
+ ut_a(prebuilt->trx);
+ ut_a(prebuilt->trx->magic_n == TRX_MAGIC_N);
+ ut_a(prebuilt->trx == thd_to_trx(thd));
if (prebuilt->mysql_template == NULL) {
/* Build the template; we will use a dummy template
@@ -5797,7 +5898,7 @@ ha_innobase::update_table_comment(
return((char*)comment); /* string too long */
}
- update_thd(current_thd);
+ update_thd(ha_thd());
prebuilt->trx->op_info = (char*)"returning table comment";
@@ -5812,9 +5913,9 @@ ha_innobase::update_table_comment(
mutex_enter_noninline(&srv_dict_tmpfile_mutex);
rewind(srv_dict_tmpfile);
- fprintf(srv_dict_tmpfile, "InnoDB free: %lu kB",
- (ulong) fsp_get_available_space_in_free_extents(
- prebuilt->table->space));
+ fprintf(srv_dict_tmpfile, "InnoDB free: %llu kB",
+ fsp_get_available_space_in_free_extents(
+ prebuilt->table->space));
dict_print_info_on_foreign_keys(FALSE, srv_dict_tmpfile,
prebuilt->trx, prebuilt->table);
@@ -5828,7 +5929,7 @@ ha_innobase::update_table_comment(
/* allocate buffer for the full string, and
read the contents of the temporary file */
- str = my_malloc(length + flen + 3, MYF(0));
+ str = (char*) my_malloc(length + flen + 3, MYF(0));
if (str) {
char* pos = str + length;
@@ -5868,7 +5969,7 @@ ha_innobase::get_foreign_key_create_info(void)
external_lock(). To be safe, update the thd of the current table
handle. */
- update_thd(current_thd);
+ update_thd(ha_thd());
prebuilt->trx->op_info = (char*)"getting info on foreign keys";
@@ -5896,7 +5997,7 @@ ha_innobase::get_foreign_key_create_info(void)
/* allocate buffer for the string, and
read the contents of the temporary file */
- str = my_malloc(flen + 1, MYF(0));
+ str = (char*) my_malloc(flen + 1, MYF(0));
if (str) {
rewind(srv_dict_tmpfile);
@@ -5917,7 +6018,7 @@ ha_innobase::get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list)
DBUG_ENTER("get_foreign_key_list");
ut_a(prebuilt != NULL);
- update_thd(current_thd);
+ update_thd(ha_thd());
prebuilt->trx->op_info = (char*)"getting list of foreign keys";
trx_search_latch_release_if_reserved(prebuilt->trx);
mutex_enter_noninline(&(dict_sys->mutex));
@@ -5937,8 +6038,8 @@ ha_innobase::get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list)
while (tmp_buff[i] != '/')
i++;
tmp_buff+= i + 1;
- f_key_info.forein_id= make_lex_string(thd, 0, tmp_buff,
- (uint) strlen(tmp_buff), 1);
+ f_key_info.forein_id = thd_make_lex_string(thd, 0,
+ tmp_buff, (uint) strlen(tmp_buff), 1);
tmp_buff= foreign->referenced_table_name;
/* Database name */
@@ -5950,22 +6051,23 @@ ha_innobase::get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list)
}
db_name[i]= 0;
ulen= filename_to_tablename(db_name, uname, sizeof(uname));
- f_key_info.referenced_db= make_lex_string(thd, 0, uname, ulen, 1);
+ f_key_info.referenced_db = thd_make_lex_string(thd, 0,
+ uname, ulen, 1);
/* Table name */
tmp_buff+= i + 1;
ulen= filename_to_tablename(tmp_buff, uname, sizeof(uname));
- f_key_info.referenced_table= make_lex_string(thd, 0, uname,
- ulen, 1);
+ f_key_info.referenced_table = thd_make_lex_string(thd, 0,
+ uname, ulen, 1);
for (i= 0;;) {
tmp_buff= foreign->foreign_col_names[i];
- name= make_lex_string(thd, name, tmp_buff,
- (uint) strlen(tmp_buff), 1);
+ name = thd_make_lex_string(thd, name,
+ tmp_buff, (uint) strlen(tmp_buff), 1);
f_key_info.foreign_fields.push_back(name);
tmp_buff= foreign->referenced_col_names[i];
- name= make_lex_string(thd, name, tmp_buff,
- (uint) strlen(tmp_buff), 1);
+ name = thd_make_lex_string(thd, name,
+ tmp_buff, (uint) strlen(tmp_buff), 1);
f_key_info.referenced_fields.push_back(name);
if (++i >= foreign->n_fields)
break;
@@ -5992,8 +6094,8 @@ ha_innobase::get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list)
length=8;
tmp_buff= "RESTRICT";
}
- f_key_info.delete_method= make_lex_string(thd, f_key_info.delete_method,
- tmp_buff, length, 1);
+ f_key_info.delete_method = thd_make_lex_string(
+ thd, f_key_info.delete_method, tmp_buff, length, 1);
if (foreign->type & DICT_FOREIGN_ON_UPDATE_CASCADE)
@@ -6016,20 +6118,19 @@ ha_innobase::get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list)
length=8;
tmp_buff= "RESTRICT";
}
- f_key_info.update_method= make_lex_string(thd, f_key_info.update_method,
- tmp_buff, length, 1);
+ f_key_info.update_method = thd_make_lex_string(
+ thd, f_key_info.update_method, tmp_buff, length, 1);
if (foreign->referenced_index &&
foreign->referenced_index->name)
{
- f_key_info.referenced_key_name=
- make_lex_string(thd, f_key_info.referenced_key_name,
- foreign->referenced_index->name,
- strlen(foreign->referenced_index->name), 1);
+ f_key_info.referenced_key_name = thd_make_lex_string(
+ thd, f_key_info.referenced_key_name,
+ foreign->referenced_index->name,
+ strlen(foreign->referenced_index->name), 1);
}
- FOREIGN_KEY_INFO *pf_key_info= ((FOREIGN_KEY_INFO *)
- thd->memdup((gptr) &f_key_info,
- sizeof(FOREIGN_KEY_INFO)));
+ FOREIGN_KEY_INFO *pf_key_info = (FOREIGN_KEY_INFO *)
+ thd_memdup(thd, &f_key_info, sizeof(FOREIGN_KEY_INFO));
f_key_list->push_back(pf_key_info);
foreign = UT_LIST_GET_NEXT(foreign_list, foreign);
}
@@ -6052,7 +6153,7 @@ ha_innobase::can_switch_engines(void)
DBUG_ENTER("ha_innobase::can_switch_engines");
- ut_a(prebuilt->trx == thd_to_trx(current_thd, ht));
+ ut_a(prebuilt->trx == thd_to_trx(ha_thd()));
prebuilt->trx->op_info =
"determining if there are foreign key constraints";
@@ -6121,8 +6222,7 @@ ha_innobase::extra(
}
break;
case HA_EXTRA_RESET_STATE:
- prebuilt->keep_other_fields_on_keyread = 0;
- prebuilt->read_just_key = 0;
+ reset_template(prebuilt);
break;
case HA_EXTRA_NO_KEYREAD:
prebuilt->read_just_key = 0;
@@ -6133,6 +6233,26 @@ ha_innobase::extra(
case HA_EXTRA_KEYREAD_PRESERVE_FIELDS:
prebuilt->keep_other_fields_on_keyread = 1;
break;
+
+ /* IMPORTANT: prebuilt->trx can be obsolete in
+ this method, because it is not sure that MySQL
+ calls external_lock before this method with the
+ parameters below. We must not invoke update_thd()
+ either, because the calling threads may change.
+ CAREFUL HERE, OR MEMORY CORRUPTION MAY OCCUR! */
+ case HA_EXTRA_IGNORE_DUP_KEY:
+ thd_to_trx(ha_thd())->duplicates |= TRX_DUP_IGNORE;
+ break;
+ case HA_EXTRA_WRITE_CAN_REPLACE:
+ thd_to_trx(ha_thd())->duplicates |= TRX_DUP_REPLACE;
+ break;
+ case HA_EXTRA_WRITE_CANNOT_REPLACE:
+ thd_to_trx(ha_thd())->duplicates &= ~TRX_DUP_REPLACE;
+ break;
+ case HA_EXTRA_NO_IGNORE_DUP_KEY:
+ thd_to_trx(ha_thd())->duplicates &=
+ ~(TRX_DUP_IGNORE | TRX_DUP_REPLACE);
+ break;
default:/* Do nothing */
;
}
@@ -6145,8 +6265,7 @@ int ha_innobase::reset()
if (prebuilt->blob_heap) {
row_mysql_prebuilt_free_blob_heap(prebuilt);
}
- prebuilt->keep_other_fields_on_keyread = 0;
- prebuilt->read_just_key = 0;
+ reset_template(prebuilt);
return 0;
}
@@ -6187,8 +6306,7 @@ ha_innobase::start_stmt(
prebuilt->sql_stat_start = TRUE;
prebuilt->hint_need_to_fetch_extra_cols = 0;
- prebuilt->read_just_key = 0;
- prebuilt->keep_other_fields_on_keyread = FALSE;
+ reset_template(prebuilt);
if (!prebuilt->mysql_has_locked) {
/* This handle is for a temporary table created inside
@@ -6199,7 +6317,7 @@ ha_innobase::start_stmt(
prebuilt->select_lock_type = LOCK_X;
} else {
if (trx->isolation_level != TRX_ISO_SERIALIZABLE
- && thd->lex->sql_command == SQLCOM_SELECT
+ && thd_sql_command(thd) == SQLCOM_SELECT
&& lock_type == TL_READ) {
/* For other than temporary tables, we obtain
@@ -6275,13 +6393,35 @@ ha_innobase::external_lock(
update_thd(thd);
+ /* Statement based binlogging does not work in isolation level
+ READ UNCOMMITTED and READ COMMITTED since the necessary
+ locks cannot be taken. In this case, we print an
+ informative error message and return with an error. */
+ if (lock_type == F_WRLCK)
+ {
+ ulong const binlog_format= thd_binlog_format(thd);
+ ulong const tx_isolation = thd_tx_isolation(current_thd);
+ if (tx_isolation <= ISO_READ_COMMITTED &&
+ binlog_format == BINLOG_FORMAT_STMT)
+ {
+ char buf[256];
+ my_snprintf(buf, sizeof(buf),
+ "Transaction level '%s' in"
+ " InnoDB is not safe for binlog mode '%s'",
+ tx_isolation_names[tx_isolation],
+ binlog_format_names[binlog_format]);
+ my_error(ER_BINLOG_LOGGING_IMPOSSIBLE, MYF(0), buf);
+ DBUG_RETURN(HA_ERR_LOGGING_IMPOSSIBLE);
+ }
+ }
+
+
trx = prebuilt->trx;
prebuilt->sql_stat_start = TRUE;
prebuilt->hint_need_to_fetch_extra_cols = 0;
- prebuilt->read_just_key = 0;
- prebuilt->keep_other_fields_on_keyread = FALSE;
+ reset_template(prebuilt);
if (lock_type == F_WRLCK) {
@@ -6311,8 +6451,8 @@ ha_innobase::external_lock(
if (trx->isolation_level == TRX_ISO_SERIALIZABLE
&& prebuilt->select_lock_type == LOCK_NONE
- && (thd->options
- & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) {
+ && thd_test_options(thd,
+ OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) {
/* To get serializable execution, we let InnoDB
conceptually add 'LOCK IN SHARE MODE' to all SELECTs
@@ -6339,9 +6479,9 @@ ha_innobase::external_lock(
if (prebuilt->select_lock_type != LOCK_NONE) {
- if (thd->lex->sql_command == SQLCOM_LOCK_TABLES
- && thd->variables.innodb_table_locks
- && (thd->options & OPTION_NOT_AUTOCOMMIT)
+ if (thd_sql_command(thd) == SQLCOM_LOCK_TABLES
+ && THDVAR(thd, table_locks)
+ && thd_test_options(thd, OPTION_NOT_AUTOCOMMIT)
&& thd_in_lock_tables(thd)) {
ulint error = row_lock_table_for_mysql(
@@ -6349,7 +6489,7 @@ ha_innobase::external_lock(
if (error != DB_SUCCESS) {
error = convert_error_code_to_mysql(
- (int) error, user_thd);
+ (int) error, thd);
DBUG_RETURN((int) error);
}
}
@@ -6365,6 +6505,12 @@ ha_innobase::external_lock(
trx->n_mysql_tables_in_use--;
prebuilt->mysql_has_locked = FALSE;
+ /* Release a possible FIFO ticket and search latch. Since we
+ may reserve the kernel mutex, we have to release the search
+ system latch first to obey the latching order. */
+
+ innobase_release_stat_resources(trx);
+
/* If the MySQL lock count drops to zero we know that the current SQL
statement has ended */
@@ -6373,13 +6519,7 @@ ha_innobase::external_lock(
trx->mysql_n_tables_locked = 0;
prebuilt->used_in_HANDLER = FALSE;
- /* Release a possible FIFO ticket and search latch. Since we
- may reserve the kernel mutex, we have to release the search
- system latch first to obey the latching order. */
-
- innobase_release_stat_resources(trx);
-
- if (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) {
+ if (!thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) {
if (trx->active_trans != 0) {
innobase_commit(ht, thd, TRUE);
}
@@ -6420,8 +6560,7 @@ ha_innobase::transactional_table_lock(
update_thd(thd);
- if (prebuilt->table->ibd_file_missing
- && !thd_tablespace_op(current_thd)) {
+ if (prebuilt->table->ibd_file_missing && !thd_tablespace_op(thd)) {
ut_print_timestamp(stderr);
fprintf(stderr, " InnoDB error:\n"
"MySQL is trying to use a table handle but the .ibd file for\n"
@@ -6439,8 +6578,7 @@ ha_innobase::transactional_table_lock(
prebuilt->sql_stat_start = TRUE;
prebuilt->hint_need_to_fetch_extra_cols = 0;
- prebuilt->read_just_key = 0;
- prebuilt->keep_other_fields_on_keyread = FALSE;
+ reset_template(prebuilt);
if (lock_type == F_WRLCK) {
prebuilt->select_lock_type = LOCK_X;
@@ -6466,17 +6604,17 @@ ha_innobase::transactional_table_lock(
trx->active_trans = 1;
}
- if (thd->variables.innodb_table_locks && thd_in_lock_tables(thd)) {
+ if (THDVAR(thd, table_locks) && thd_in_lock_tables(thd)) {
ulint error = DB_SUCCESS;
error = row_lock_table_for_mysql(prebuilt, NULL, 0);
if (error != DB_SUCCESS) {
- error = convert_error_code_to_mysql((int) error, user_thd);
+ error = convert_error_code_to_mysql((int) error, thd);
DBUG_RETURN((int) error);
}
- if (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) {
+ if (thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) {
/* Store the current undo_no of the transaction
so that we know where to roll back if we have
@@ -6522,11 +6660,7 @@ innodb_show_status(
DBUG_ENTER("innodb_show_status");
- if (have_innodb != SHOW_OPTION_YES) {
- DBUG_RETURN(FALSE);
- }
-
- trx = check_trx_exists(hton, thd);
+ trx = check_trx_exists(thd);
innobase_release_stat_resources(trx);
@@ -6556,7 +6690,7 @@ innodb_show_status(
/* allocate buffer for the string, and
read the contents of the temporary file */
- if (!(str = my_malloc(usable_len + 1, MYF(0)))) {
+ if (!(str = (char*) my_malloc(usable_len + 1, MYF(0)))) {
mutex_exit_noninline(&srv_monitor_file_mutex);
DBUG_RETURN(TRUE);
}
@@ -6717,12 +6851,12 @@ bool innobase_show_status(handlerton *hton, THD* thd,
locking.
****************************************************************************/
-static mysql_byte* innobase_get_key(INNOBASE_SHARE* share, uint* length,
+static uchar* innobase_get_key(INNOBASE_SHARE* share, size_t *length,
my_bool not_used __attribute__((unused)))
{
*length=share->table_name_length;
- return (mysql_byte*) share->table_name;
+ return (uchar*) share->table_name;
}
static INNOBASE_SHARE* get_share(const char* table_name)
@@ -6732,7 +6866,7 @@ static INNOBASE_SHARE* get_share(const char* table_name)
uint length=(uint) strlen(table_name);
if (!(share=(INNOBASE_SHARE*) hash_search(&innobase_open_tables,
- (mysql_byte*) table_name,
+ (uchar*) table_name,
length))) {
share = (INNOBASE_SHARE *) my_malloc(sizeof(*share)+length+1,
@@ -6743,9 +6877,9 @@ static INNOBASE_SHARE* get_share(const char* table_name)
strmov(share->table_name,table_name);
if (my_hash_insert(&innobase_open_tables,
- (mysql_byte*) share)) {
+ (uchar*) share)) {
pthread_mutex_unlock(&innobase_share_mutex);
- my_free((gptr) share,0);
+ my_free(share,0);
return 0;
}
@@ -6765,10 +6899,10 @@ static void free_share(INNOBASE_SHARE* share)
pthread_mutex_lock(&innobase_share_mutex);
if (!--share->use_count) {
- hash_delete(&innobase_open_tables, (mysql_byte*) share);
+ hash_delete(&innobase_open_tables, (uchar*) share);
thr_lock_delete(&share->lock);
pthread_mutex_destroy(&share->mutex);
- my_free((gptr) share, MYF(0));
+ my_free(share, MYF(0));
}
pthread_mutex_unlock(&innobase_share_mutex);
@@ -6804,7 +6938,7 @@ ha_innobase::store_lock(
because we call update_thd() later, in ::external_lock()! Failure to
understand this caused a serious memory corruption bug in 5.1.11. */
- trx = check_trx_exists(ht, thd);
+ trx = check_trx_exists(thd);
/* NOTE: MySQL can call this function with lock 'type' TL_IGNORE!
Be careful to ignore TL_IGNORE if we are going to do something with
@@ -6814,10 +6948,9 @@ ha_innobase::store_lock(
of the transaction. */
if (lock_type != TL_IGNORE
- && trx->n_mysql_tables_in_use == 0) {
+ && trx->n_mysql_tables_in_use == 0) {
trx->isolation_level = innobase_map_isolation_level(
- (enum_tx_isolation)
- thd->variables.tx_isolation);
+ (enum_tx_isolation) thd_tx_isolation(thd));
if (trx->isolation_level <= TRX_ISO_READ_COMMITTED
&& trx->global_read_view) {
@@ -6827,23 +6960,24 @@ ha_innobase::store_lock(
read_view_close_for_mysql(trx);
}
-
}
+ DBUG_ASSERT(thd == current_thd);
const bool in_lock_tables = thd_in_lock_tables(thd);
+ const uint sql_command = thd_sql_command(thd);
- if (thd->lex->sql_command == SQLCOM_DROP_TABLE) {
+ if (sql_command == SQLCOM_DROP_TABLE) {
/* MySQL calls this function in DROP TABLE though this table
handle may belong to another thd that is running a query. Let
us in that case skip any changes to the prebuilt struct. */
- } else if ((lock_type == TL_READ && in_lock_tables) ||
- (lock_type == TL_READ_HIGH_PRIORITY && in_lock_tables) ||
- lock_type == TL_READ_WITH_SHARED_LOCKS ||
- lock_type == TL_READ_NO_INSERT ||
- (thd->lex->sql_command != SQLCOM_SELECT
- && lock_type != TL_IGNORE)) {
+ } else if ((lock_type == TL_READ && in_lock_tables)
+ || (lock_type == TL_READ_HIGH_PRIORITY && in_lock_tables)
+ || lock_type == TL_READ_WITH_SHARED_LOCKS
+ || lock_type == TL_READ_NO_INSERT
+ || (lock_type != TL_IGNORE
+ && sql_command != SQLCOM_SELECT)) {
/* The OR cases above are in this order:
1) MySQL is doing LOCK TABLES ... READ LOCAL, or we
@@ -6868,12 +7002,12 @@ ha_innobase::store_lock(
isolation_level = trx->isolation_level;
if ((srv_locks_unsafe_for_binlog
- || isolation_level == TRX_ISO_READ_COMMITTED)
- && isolation_level != TRX_ISO_SERIALIZABLE
- && (lock_type == TL_READ || lock_type == TL_READ_NO_INSERT)
- && (thd->lex->sql_command == SQLCOM_INSERT_SELECT
- || thd->lex->sql_command == SQLCOM_UPDATE
- || thd->lex->sql_command == SQLCOM_CREATE_TABLE)) {
+ || isolation_level == TRX_ISO_READ_COMMITTED)
+ && isolation_level != TRX_ISO_SERIALIZABLE
+ && (lock_type == TL_READ || lock_type == TL_READ_NO_INSERT)
+ && (sql_command == SQLCOM_INSERT_SELECT
+ || sql_command == SQLCOM_UPDATE
+ || sql_command == SQLCOM_CREATE_TABLE)) {
/* If we either have innobase_locks_unsafe_for_binlog
option set or this session is using READ COMMITTED
@@ -6886,7 +7020,7 @@ ha_innobase::store_lock(
prebuilt->select_lock_type = LOCK_NONE;
prebuilt->stored_select_lock_type = LOCK_NONE;
- } else if (thd->lex->sql_command == SQLCOM_CHECKSUM) {
+ } else if (sql_command == SQLCOM_CHECKSUM) {
/* Use consistent read for checksum table */
prebuilt->select_lock_type = LOCK_NONE;
@@ -6916,7 +7050,7 @@ ha_innobase::store_lock(
(if it does not use a consistent read). */
if (lock_type == TL_READ
- && thd->lex->sql_command == SQLCOM_LOCK_TABLES) {
+ && sql_command == SQLCOM_LOCK_TABLES) {
/* We come here if MySQL is processing LOCK TABLES
... READ LOCAL. MyISAM under that table lock type
reads the table as it was at the time the lock was
@@ -6942,24 +7076,13 @@ ha_innobase::store_lock(
TRUE there). */
if ((lock_type >= TL_WRITE_CONCURRENT_INSERT
- && lock_type <= TL_WRITE)
- && !(in_lock_tables
- && thd->lex->sql_command == SQLCOM_LOCK_TABLES)
- && !thd_tablespace_op(thd)
- && thd->lex->sql_command != SQLCOM_TRUNCATE
- && thd->lex->sql_command != SQLCOM_OPTIMIZE
-
-#ifdef __WIN__
- /* For alter table on win32 for succesful operation
- completion it is used TL_WRITE(=10) lock instead of
- TL_WRITE_ALLOW_READ(=6), however here in innodb handler
- TL_WRITE is lifted to TL_WRITE_ALLOW_WRITE, which causes
- race condition when several clients do alter table
- simultaneously (bug #17264). This fix avoids the problem. */
- && thd->lex->sql_command != SQLCOM_ALTER_TABLE
-#endif
-
- && thd->lex->sql_command != SQLCOM_CREATE_TABLE) {
+ && lock_type <= TL_WRITE)
+ && !(in_lock_tables
+ && sql_command == SQLCOM_LOCK_TABLES)
+ && !thd_tablespace_op(thd)
+ && sql_command != SQLCOM_TRUNCATE
+ && sql_command != SQLCOM_OPTIMIZE
+ && sql_command != SQLCOM_CREATE_TABLE) {
lock_type = TL_WRITE_ALLOW_WRITE;
}
@@ -6972,10 +7095,10 @@ ha_innobase::store_lock(
We especially allow concurrent inserts if MySQL is at the
start of a stored procedure call (SQLCOM_CALL)
- (MySQL does have in_lock_tables TRUE there). */
+ (MySQL does have thd_in_lock_tables() TRUE there). */
if (lock_type == TL_READ_NO_INSERT
- && thd->lex->sql_command != SQLCOM_LOCK_TABLES) {
+ && sql_command != SQLCOM_LOCK_TABLES) {
lock_type = TL_READ;
}
@@ -6997,20 +7120,25 @@ the value of the auto-inc counter. */
int
ha_innobase::innobase_read_and_init_auto_inc(
/*=========================================*/
- /* out: 0 or error code: deadlock or lock wait
- timeout */
- longlong* ret) /* out: auto-inc value */
+ /* out: 0 or error code:
+ deadlock or lock wait timeout */
+ longlong* value) /* out: the autoinc value */
{
longlong auto_inc;
- ulint old_select_lock_type;
+ ibool stmt_start;
+ int mysql_error = 0;
+ dict_table_t* innodb_table = prebuilt->table;
ibool trx_was_not_started = FALSE;
- int error;
ut_a(prebuilt);
ut_a(prebuilt->table);
+ /* Remember if we are in the beginning of an SQL statement.
+ This function must not change that flag. */
+ stmt_start = prebuilt->sql_stat_start;
+
/* Prepare prebuilt->trx in the table handle */
- update_thd(current_thd);
+ update_thd(ha_thd());
if (prebuilt->trx->conc_state == TRX_NOT_STARTED) {
trx_was_not_started = TRUE;
@@ -7021,114 +7149,115 @@ ha_innobase::innobase_read_and_init_auto_inc(
trx_search_latch_release_if_reserved(prebuilt->trx);
- auto_inc = dict_table_autoinc_read(prebuilt->table);
-
- if (auto_inc != 0) {
- /* Already initialized */
- *ret = auto_inc;
+ dict_table_autoinc_lock(prebuilt->table);
- error = 0;
+ auto_inc = dict_table_autoinc_read(prebuilt->table);
- goto func_exit_early;
+ /* Was the AUTOINC counter reset during normal processing, if
+ so then we simply start count from 1. No need to go to the index.*/
+ if (auto_inc == 0 && innodb_table->autoinc_inited) {
+ ++auto_inc;
+ dict_table_autoinc_initialize(innodb_table, auto_inc);
}
- error = row_lock_table_autoinc_for_mysql(prebuilt);
+ if (auto_inc == 0) {
+ dict_index_t* index;
+ ulint error;
+ const char* autoinc_col_name;
- if (error != DB_SUCCESS) {
- error = convert_error_code_to_mysql(error, user_thd);
+ ut_a(!innodb_table->autoinc_inited);
- goto func_exit_early;
- }
+ index = innobase_get_index(table->s->next_number_index);
- /* Check again if someone has initialized the counter meanwhile */
- auto_inc = dict_table_autoinc_read(prebuilt->table);
+ autoinc_col_name = table->found_next_number_field->field_name;
- if (auto_inc != 0) {
- *ret = auto_inc;
+ error = row_search_max_autoinc(
+ index, autoinc_col_name, &auto_inc);
- error = 0;
+ if (error == DB_SUCCESS) {
+ ++auto_inc;
+ dict_table_autoinc_initialize(innodb_table, auto_inc);
+ } else {
+ fprintf(stderr, " InnoDB error: Couldn't read the "
+ "max AUTOINC value from index (%s).\n",
+ index->name);
- goto func_exit_early;
+ mysql_error = 1;
+ }
}
- (void) extra(HA_EXTRA_KEYREAD);
- index_init(table->s->next_number_index, 1);
+ *value = auto_inc;
- /* Starting from 5.0.9, we use a consistent read to read the auto-inc
- column maximum value. This eliminates the spurious deadlocks caused
- by the row X-lock that we previously used. Note the following flaw
- in our algorithm: if some other user meanwhile UPDATEs the auto-inc
- column, our consistent read will not return the largest value. We
- accept this flaw, since the deadlocks were a bigger trouble. */
+ dict_table_autoinc_unlock(prebuilt->table);
- /* Fetch all the columns in the key */
+ /* Since MySQL does not seem to call autocommit after SHOW TABLE
+ STATUS (even if we would register the trx here), we commit our
+ transaction here if it was started here. This is to eliminate a
+ dangling transaction. If the user had AUTOCOMMIT=0, then SHOW
+ TABLE STATUS does leave a dangling transaction if the user does not
+ himself call COMMIT. */
- prebuilt->hint_need_to_fetch_extra_cols = ROW_RETRIEVE_ALL_COLS;
+ if (trx_was_not_started) {
- old_select_lock_type = prebuilt->select_lock_type;
- prebuilt->select_lock_type = LOCK_NONE;
+ innobase_commit_low(prebuilt->trx);
+ }
- /* Eliminate an InnoDB error print that happens when we try to SELECT
- from a table when no table has been locked in ::external_lock(). */
- prebuilt->trx->n_mysql_tables_in_use++;
+ prebuilt->sql_stat_start = stmt_start;
- error = index_last(table->record[1]);
+ return(mysql_error);
+}
- prebuilt->trx->n_mysql_tables_in_use--;
- prebuilt->select_lock_type = old_select_lock_type;
+/*******************************************************************************
+Read the next autoinc value, initialize the table if it's not initialized.
+On return if there is no error then the tables AUTOINC lock is locked.*/
- if (error) {
- if (error == HA_ERR_END_OF_FILE) {
- /* The table was empty, initialize to 1 */
- auto_inc = 1;
+ulong
+ha_innobase::innobase_get_auto_increment(
+ ulonglong* value) /* out: autoinc value */
+{
+ ulong error;
- error = 0;
- } else {
- /* This should not happen in a consistent read */
- sql_print_error("Consistent read of auto-inc column "
- "returned %lu", (ulong) error);
- auto_inc = -1;
+ do {
+ error = innobase_autoinc_lock();
- goto func_exit;
- }
- } else {
- /* Initialize to max(col) + 1; we use
- 'found_next_number_field' below because MySQL in SHOW TABLE
- STATUS does not seem to set 'next_number_field'. The comment
- in table.h says that 'next_number_field' is set when it is
- 'active'.
- Since 5.1 MySQL enforces that we announce fields which we will
- read; as we only do a val_*() call, dbug_tmp_use_all_columns()
- with read_set is sufficient. */
+ if (error == DB_SUCCESS) {
+ ib_longlong autoinc;
- my_bitmap_map *old_map;
- old_map= dbug_tmp_use_all_columns(table, table->read_set);
- auto_inc = (longlong) table->found_next_number_field->
- val_int_offset(table->s->rec_buff_length) + 1;
- dbug_tmp_restore_column_map(table->read_set, old_map);
- }
+ /* Determine the first value of the interval */
+ autoinc = dict_table_autoinc_read(prebuilt->table);
- dict_table_autoinc_initialize(prebuilt->table, auto_inc);
+ /* We need to initialize the AUTO-INC value, for
+ that we release all locks.*/
+ if (autoinc <= 0) {
+ trx_t* trx;
-func_exit:
- (void) extra(HA_EXTRA_NO_KEYREAD);
+ trx = prebuilt->trx;
+ dict_table_autoinc_unlock(prebuilt->table);
- index_end();
+ /* If we had reserved the AUTO-INC
+ lock in this SQL statement we release
+ it before retrying.*/
+ row_unlock_table_autoinc_for_mysql(trx);
- *ret = auto_inc;
+ /* Just to make sure */
+ ut_a(!trx->auto_inc_lock);
-func_exit_early:
- /* Since MySQL does not seem to call autocommit after SHOW TABLE
- STATUS (even if we would register the trx here), we commit our
- transaction here if it was started here. This is to eliminate a
- dangling transaction. If the user had AUTOCOMMIT=0, then SHOW
- TABLE STATUS does leave a dangling transaction if the user does not
- himself call COMMIT. */
+ int mysql_error;
- if (trx_was_not_started) {
+ mysql_error = innobase_read_and_init_auto_inc(
+ &autoinc);
- innobase_commit_low(prebuilt->trx);
- }
+ if (!mysql_error) {
+ /* Should have read the proper value */
+ ut_a(autoinc > 0);
+ } else {
+ error = DB_ERROR;
+ }
+ } else {
+ *value = (ulonglong) autoinc;
+ }
+ }
+ } while (*value == 0 && error == DB_SUCCESS);
return(error);
}
@@ -7141,37 +7270,91 @@ auto-inc counter in *first_value, and ULONGLONG_MAX in *nb_reserved_values (as
we have a table-level lock). offset, increment, nb_desired_values are ignored.
*first_value is set to -1 if error (deadlock or lock wait timeout) */
-void ha_innobase::get_auto_increment(
+void
+ha_innobase::get_auto_increment(
/*=================================*/
- ulonglong offset, /* in */
- ulonglong increment, /* in */
- ulonglong nb_desired_values, /* in */
- ulonglong *first_value, /* out */
- ulonglong *nb_reserved_values) /* out */
+ ulonglong offset, /* in: */
+ ulonglong increment, /* in: table autoinc increment */
+ ulonglong nb_desired_values, /* in: number of values reqd */
+ ulonglong *first_value, /* out: the autoinc value */
+ ulonglong *nb_reserved_values) /* out: count of reserved values */
{
- longlong nr;
- int error;
+ trx_t* trx;
+ ulint error;
+ ulonglong autoinc = 0;
/* Prepare prebuilt->trx in the table handle */
- update_thd(current_thd);
+ update_thd(ha_thd());
- error = innobase_read_and_init_auto_inc(&nr);
+ error = innobase_get_auto_increment(&autoinc);
- if (error) {
- /* This should never happen in the current (5.0.6) code, since
- we call this function only after the counter has been
- initialized. */
+ if (error != DB_SUCCESS) {
+ /* This should never happen in the code > ver 5.0.6,
+ since we call this function only after the counter
+ has been initialized. */
ut_print_timestamp(stderr);
- sql_print_error("Error %lu in ::get_auto_increment()",
- (ulong) error);
- *first_value= (~(ulonglong) 0);
+ sql_print_error("Error %lu in ::get_auto_increment()", error);
+
+ *first_value = (~(ulonglong) 0);
return;
}
- *first_value= (ulonglong) nr;
- /* table-level autoinc lock reserves up to +inf */
- *nb_reserved_values= ULONGLONG_MAX;
+ /* This is a hack, since nb_desired_values seems to be accurate only
+ for the first call to get_auto_increment() for multi-row INSERT and
+ meaningless for other statements e.g, LOAD etc. Subsequent calls to
+ this method for the same statement results in different values which
+ don't make sense. Therefore we store the value the first time we are
+ called and count down from that as rows are written (see write_row()).
+ */
+
+ trx = prebuilt->trx;
+
+ /* Called for the first time ? */
+ if (trx->n_autoinc_rows == 0) {
+
+ trx->n_autoinc_rows = (ulint) nb_desired_values;
+
+ /* It's possible for nb_desired_values to be 0:
+ e.g., INSERT INTO T1(C) SELECT C FROM T2; */
+ if (nb_desired_values == 0) {
+
+ trx->n_autoinc_rows = 1;
+ }
+
+ set_if_bigger(*first_value, autoinc);
+ /* Not in the middle of a mult-row INSERT. */
+ } else if (prebuilt->last_value == 0) {
+ set_if_bigger(*first_value, autoinc);
+ }
+
+ *nb_reserved_values = trx->n_autoinc_rows;
+
+ /* With old style AUTOINC locking we only update the table's
+ AUTOINC counter after attempting to insert the row. */
+ if (innobase_autoinc_lock_mode != AUTOINC_OLD_STYLE_LOCKING) {
+
+ /* Compute the last value in the interval */
+ prebuilt->last_value = *first_value +
+ (*nb_reserved_values * increment);
+
+ ut_a(prebuilt->last_value >= *first_value);
+
+ /* Update the table autoinc variable */
+ dict_table_autoinc_update(
+ prebuilt->table, prebuilt->last_value);
+ } else {
+ /* This will force write_row() into attempting an update
+ of the table's AUTOINC counter. */
+ prebuilt->last_value = 0;
+ }
+
+ /* The increment to be used to increase the AUTOINC value, we use
+ this in write_row() and update_row() to increase the autoinc counter
+ for columns that are filled by the user.*/
+ prebuilt->table->autoinc_increment = increment;
+
+ dict_table_autoinc_unlock(prebuilt->table);
}
/* See comment in handler.h */
@@ -7182,7 +7365,7 @@ ha_innobase::reset_auto_increment(ulonglong value)
int error;
- update_thd(current_thd);
+ update_thd(ha_thd());
error = row_lock_table_autoinc_for_mysql(prebuilt);
@@ -7192,7 +7375,7 @@ ha_innobase::reset_auto_increment(ulonglong value)
DBUG_RETURN(error);
}
- dict_table_autoinc_initialize(prebuilt->table, value);
+ innobase_reset_autoinc(value);
DBUG_RETURN(0);
}
@@ -7201,7 +7384,7 @@ ha_innobase::reset_auto_increment(ulonglong value)
bool
ha_innobase::get_error_message(int error, String *buf)
{
- trx_t* trx = check_trx_exists(ht, current_thd);
+ trx_t* trx = check_trx_exists(ha_thd());
buf->copy(trx->detailed_error, strlen(trx->detailed_error),
system_charset_info);
@@ -7219,9 +7402,9 @@ ha_innobase::cmp_ref(
/*=================*/
/* out: < 0 if ref1 < ref2, 0 if equal, else
> 0 */
- const mysql_byte* ref1, /* in: an (internal) primary key value in the
+ const uchar* ref1, /* in: an (internal) primary key value in the
MySQL key value format */
- const mysql_byte* ref2) /* in: an (internal) primary key value in the
+ const uchar* ref2) /* in: an (internal) primary key value in the
MySQL key value format */
{
enum_field_types mysql_type;
@@ -7263,9 +7446,8 @@ ha_innobase::cmp_ref(
ref1 += 2;
ref2 += 2;
- result = ((Field_blob*)field)->cmp(
- (const char*)ref1, len1,
- (const char*)ref2, len2);
+ result = ((Field_blob*)field)->cmp( ref1, len1,
+ ref2, len2);
} else {
result = field->key_cmp(ref1, ref2);
}
@@ -7324,7 +7506,6 @@ ha_innobase::get_mysql_bin_log_pos()
return(trx_sys_mysql_bin_log_pos);
}
-extern "C" {
/**********************************************************************
This function is used to find the storage length in bytes of the first n
characters for prefix indexes using a multibyte character set. The function
@@ -7333,7 +7514,7 @@ index field in bytes.
NOTE: the prototype of this function is copied to data0type.c! If you change
this function, you MUST change also data0type.c! */
-
+extern "C"
ulint
innobase_get_at_most_n_mbchars(
/*===========================*/
@@ -7398,46 +7579,6 @@ innobase_get_at_most_n_mbchars(
return(char_length);
}
-}
-
-/**********************************************************************
-This function returns true if
-
-1) SQL-query in the current thread
-is either REPLACE or LOAD DATA INFILE REPLACE.
-
-2) SQL-query in the current thread
-is INSERT ON DUPLICATE KEY UPDATE.
-
-NOTE that storage/innobase/row/row0ins.c must contain the
-prototype for this function ! */
-extern "C"
-ibool
-innobase_query_is_update(void)
-/*==========================*/
-{
- THD* thd = current_thd;
-
- if (!thd) {
- /* InnoDB's internal threads may run InnoDB stored procedures
- that call this function. Then current_thd is not defined
- (it is probably NULL). */
-
- return(FALSE);
- }
-
- switch (thd->lex->sql_command) {
- case SQLCOM_REPLACE:
- case SQLCOM_REPLACE_SELECT:
- return(TRUE);
- case SQLCOM_LOAD:
- return(thd->lex->duplicates == DUP_REPLACE);
- case SQLCOM_INSERT:
- return(thd->lex->duplicates == DUP_UPDATE);
- default:
- return(FALSE);
- }
-}
/***********************************************************************
This function is used to prepare X/Open XA distributed transaction */
@@ -7453,10 +7594,10 @@ innobase_xa_prepare(
FALSE - the current SQL statement ended */
{
int error = 0;
- trx_t* trx = check_trx_exists(hton, thd);
+ trx_t* trx = check_trx_exists(thd);
- if (thd->lex->sql_command != SQLCOM_XA_PREPARE &&
- (all || !(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))))
+ if (thd_sql_command(thd) != SQLCOM_XA_PREPARE &&
+ (all || !thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
{
/* For ibbackup to work the order of transactions in binlog
@@ -7482,12 +7623,12 @@ innobase_xa_prepare(
trx->active_trans = 2;
}
- if (!thd->variables.innodb_support_xa) {
+ if (!THDVAR(thd, support_xa)) {
return(0);
}
- trx->xid=thd->transaction.xid_state.xid;
+ thd_get_xid(thd, (MYSQL_XID*) &trx->xid);
/* Release a possible FIFO ticket and search latch. Since we will
reserve the kernel mutex, we have to release the search system latch
@@ -7502,7 +7643,7 @@ innobase_xa_prepare(
}
if (all
- || (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))) {
+ || (!thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) {
/* We were instructed to prepare the whole transaction, or
this is an SQL statement end and autocommit is on */
@@ -7514,12 +7655,11 @@ innobase_xa_prepare(
/* We just mark the SQL statement ended and do not do a
transaction prepare */
- if (trx->auto_inc_lock) {
- /* If we had reserved the auto-inc lock for some
- table in this SQL statement we release it now */
+ /* If we had reserved the auto-inc lock for some
+ table in this SQL statement we release it now */
+
+ row_unlock_table_autoinc_for_mysql(trx);
- row_unlock_table_autoinc_for_mysql(trx);
- }
/* Store the current undo_no of the transaction so that we
know where to roll back if we have to roll back the next
SQL statement */
@@ -7614,8 +7754,7 @@ innobase_create_cursor_view(
handlerton *hton, /* in: innobase hton */
THD* thd) /* in: user thread handle */
{
- return(read_cursor_view_create_for_mysql(
- check_trx_exists(hton, thd)));
+ return(read_cursor_view_create_for_mysql(check_trx_exists(thd)));
}
/***********************************************************************
@@ -7630,8 +7769,8 @@ innobase_close_cursor_view(
THD* thd, /* in: user thread handle */
void* curview)/* in: Consistent read view to be closed */
{
- read_cursor_view_close_for_mysql(check_trx_exists(hton, current_thd),
- (cursor_view_t*) curview);
+ read_cursor_view_close_for_mysql(check_trx_exists(thd),
+ (cursor_view_t*) curview);
}
/***********************************************************************
@@ -7647,8 +7786,8 @@ innobase_set_cursor_view(
THD* thd, /* in: user thread handle */
void* curview)/* in: Consistent cursor view to be set */
{
- read_cursor_set_for_mysql(check_trx_exists(hton, current_thd),
- (cursor_view_t*) curview);
+ read_cursor_set_for_mysql(check_trx_exists(thd),
+ (cursor_view_t*) curview);
}
@@ -7694,6 +7833,234 @@ static SHOW_VAR innodb_status_variables_export[]= {
static struct st_mysql_storage_engine innobase_storage_engine=
{ MYSQL_HANDLERTON_INTERFACE_VERSION };
+/* plugin options */
+static MYSQL_SYSVAR_BOOL(checksums, innobase_use_checksums,
+ PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
+ "Enable InnoDB checksums validation (enabled by default). "
+ "Disable with --skip-innodb-checksums.",
+ NULL, NULL, TRUE);
+
+static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir,
+ PLUGIN_VAR_READONLY,
+ "The common part for InnoDB table spaces.",
+ NULL, NULL, NULL);
+
+static MYSQL_SYSVAR_BOOL(doublewrite, innobase_use_doublewrite,
+ PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
+ "Enable InnoDB doublewrite buffer (enabled by default). "
+ "Disable with --skip-innodb-doublewrite.",
+ NULL, NULL, TRUE);
+
+static MYSQL_SYSVAR_ULONG(fast_shutdown, innobase_fast_shutdown,
+ PLUGIN_VAR_OPCMDARG,
+ "Speeds up the shutdown process of the InnoDB storage engine. Possible "
+ "values are 0, 1 (faster)"
+ /*
+ NetWare can't close unclosed files, can't automatically kill remaining
+ threads, etc, so on this OS we disable the crash-like InnoDB shutdown.
+ */
+ IF_NETWARE("", " or 2 (fastest - crash-like)")
+ ".",
+ NULL, NULL, 1, 0, IF_NETWARE(1,2), 0);
+
+static MYSQL_SYSVAR_BOOL(file_per_table, innobase_file_per_table,
+ PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
+ "Stores each InnoDB table to an .ibd file in the database dir.",
+ NULL, NULL, FALSE);
+
+static MYSQL_SYSVAR_ULONG(flush_log_at_trx_commit, srv_flush_log_at_trx_commit,
+ PLUGIN_VAR_OPCMDARG,
+ "Set to 0 (write and flush once per second),"
+ " 1 (write and flush at each commit)"
+ " or 2 (write at commit, flush once per second).",
+ NULL, NULL, 1, 0, 2, 0);
+
+static MYSQL_SYSVAR_STR(flush_method, innobase_unix_file_flush_method,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+ "With which method to flush data.", NULL, NULL, NULL);
+
+static MYSQL_SYSVAR_BOOL(locks_unsafe_for_binlog, innobase_locks_unsafe_for_binlog,
+ PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
+ "Force InnoDB to not use next-key locking, to use only row-level locking.",
+ NULL, NULL, FALSE);
+
+#ifdef UNIV_LOG_ARCHIVE
+static MYSQL_SYSVAR_STR(log_arch_dir, innobase_log_arch_dir,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+ "Where full logs should be archived.", NULL, NULL, NULL);
+
+static MYSQL_SYSVAR_BOOL(log_archive, innobase_log_archive,
+ PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY,
+ "Set to 1 if you want to have logs archived.", NULL, NULL, FALSE);
+#endif /* UNIV_LOG_ARCHIVE */
+
+static MYSQL_SYSVAR_STR(log_group_home_dir, innobase_log_group_home_dir,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+ "Path to InnoDB log files.", NULL, NULL, NULL);
+
+static MYSQL_SYSVAR_ULONG(max_dirty_pages_pct, srv_max_buf_pool_modified_pct,
+ PLUGIN_VAR_RQCMDARG,
+ "Percentage of dirty pages allowed in bufferpool.",
+ NULL, NULL, 90, 0, 100, 0);
+
+static MYSQL_SYSVAR_ULONG(max_purge_lag, srv_max_purge_lag,
+ PLUGIN_VAR_RQCMDARG,
+ "Desired maximum length of the purge queue (0 = no limit)",
+ NULL, NULL, 0, 0, ~0L, 0);
+
+static MYSQL_SYSVAR_BOOL(rollback_on_timeout, innobase_rollback_on_timeout,
+ PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY,
+ "Roll back the complete transaction on lock wait timeout, for 4.x compatibility (disabled by default)",
+ NULL, NULL, FALSE);
+
+static MYSQL_SYSVAR_BOOL(status_file, innobase_create_status_file,
+ PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_NOSYSVAR,
+ "Enable SHOW INNODB STATUS output in the innodb_status.<pid> file",
+ NULL, NULL, FALSE);
+
+static MYSQL_SYSVAR_BOOL(stats_on_metadata, innobase_stats_on_metadata,
+ PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_NOSYSVAR,
+ "Enable statistics gathering for metadata commands such as SHOW TABLE STATUS (on by default)",
+ NULL, NULL, TRUE);
+
+static MYSQL_SYSVAR_LONG(additional_mem_pool_size, innobase_additional_mem_pool_size,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+ "Size of a memory pool InnoDB uses to store data dictionary information and other internal data structures.",
+ NULL, NULL, 1*1024*1024L, 512*1024L, ~0L, 1024);
+
+static MYSQL_SYSVAR_ULONG(autoextend_increment, srv_auto_extend_increment,
+ PLUGIN_VAR_RQCMDARG,
+ "Data file autoextend increment in megabytes",
+ NULL, NULL, 8L, 1L, 1000L, 0);
+
+static MYSQL_SYSVAR_LONGLONG(buffer_pool_size, innobase_buffer_pool_size,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+ "The size of the memory buffer InnoDB uses to cache data and indexes of its tables.",
+ NULL, NULL, 8*1024*1024L, 1024*1024L, LONGLONG_MAX, 1024*1024L);
+
+static MYSQL_SYSVAR_ULONG(commit_concurrency, srv_commit_concurrency,
+ PLUGIN_VAR_RQCMDARG,
+ "Helps in performance tuning in heavily concurrent environments.",
+ NULL, NULL, 0, 0, 1000, 0);
+
+static MYSQL_SYSVAR_ULONG(concurrency_tickets, srv_n_free_tickets_to_enter,
+ PLUGIN_VAR_RQCMDARG,
+ "Number of times a thread is allowed to enter InnoDB within the same SQL query after it has once got the ticket",
+ NULL, NULL, 500L, 1L, ~0L, 0);
+
+static MYSQL_SYSVAR_LONG(file_io_threads, innobase_file_io_threads,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+ "Number of file I/O threads in InnoDB.",
+ NULL, NULL, 4, 4, 64, 0);
+
+static MYSQL_SYSVAR_LONG(force_recovery, innobase_force_recovery,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+ "Helps to save your data in case the disk image of the database becomes corrupt.",
+ NULL, NULL, 0, 0, 6, 0);
+
+static MYSQL_SYSVAR_LONG(lock_wait_timeout, innobase_lock_wait_timeout,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+ "Timeout in seconds an InnoDB transaction may wait for a lock before being rolled back.",
+ NULL, NULL, 50, 1, 1024 * 1024 * 1024, 0);
+
+static MYSQL_SYSVAR_LONG(log_buffer_size, innobase_log_buffer_size,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+ "The size of the buffer which InnoDB uses to write log to the log files on disk.",
+ NULL, NULL, 1024*1024L, 256*1024L, ~0L, 1024);
+
+static MYSQL_SYSVAR_LONGLONG(log_file_size, innobase_log_file_size,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+ "Size of each log file in a log group.",
+ NULL, NULL, 5*1024*1024L, 1*1024*1024L, LONGLONG_MAX, 1024*1024L);
+
+static MYSQL_SYSVAR_LONG(log_files_in_group, innobase_log_files_in_group,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+ "Number of log files in the log group. InnoDB writes to the files in a circular fashion. Value 3 is recommended here.",
+ NULL, NULL, 2, 2, 100, 0);
+
+static MYSQL_SYSVAR_LONG(mirrored_log_groups, innobase_mirrored_log_groups,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+ "Number of identical copies of log groups we keep for the database. Currently this should be set to 1.",
+ NULL, NULL, 1, 1, 10, 0);
+
+static MYSQL_SYSVAR_LONG(open_files, innobase_open_files,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+ "How many files at the maximum InnoDB keeps open at the same time.",
+ NULL, NULL, 300L, 10L, ~0L, 0);
+
+static MYSQL_SYSVAR_ULONG(sync_spin_loops, srv_n_spin_wait_rounds,
+ PLUGIN_VAR_RQCMDARG,
+ "Count of spin-loop rounds in InnoDB mutexes",
+ NULL, NULL, 20L, 0L, ~0L, 0);
+
+static MYSQL_SYSVAR_ULONG(thread_concurrency, srv_thread_concurrency,
+ PLUGIN_VAR_RQCMDARG,
+ "Helps in performance tuning in heavily concurrent environments. Sets the maximum number of threads allowed inside InnoDB. Value 0 will disable the thread throttling.",
+ NULL, NULL, 8, 0, 1000, 0);
+
+static MYSQL_SYSVAR_ULONG(thread_sleep_delay, srv_thread_sleep_delay,
+ PLUGIN_VAR_RQCMDARG,
+ "Time of innodb thread sleeping before joining InnoDB queue (usec). Value 0 disable a sleep",
+ NULL, NULL, 10000L, 0L, ~0L, 0);
+
+static MYSQL_SYSVAR_STR(data_file_path, innobase_data_file_path,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+ "Path to individual files and their sizes.",
+ NULL, NULL, NULL);
+
+static MYSQL_SYSVAR_LONG(autoinc_lock_mode, innobase_autoinc_lock_mode,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+ "The AUTOINC lock modes supported by InnoDB:\n"
+ " 0 => Old style AUTOINC locking (for backward compatibility)\n"
+ " 1 => New style AUTOINC locking\n"
+ " 2 => No AUTOINC locking (unsafe for SBR)",
+ NULL, NULL,
+ AUTOINC_NEW_STYLE_LOCKING, /* Default setting */
+ AUTOINC_OLD_STYLE_LOCKING, /* Minimum value */
+ AUTOINC_NO_LOCKING, 0); /* Maximum value */
+
+static struct st_mysql_sys_var* innobase_system_variables[]= {
+ MYSQL_SYSVAR(additional_mem_pool_size),
+ MYSQL_SYSVAR(autoextend_increment),
+ MYSQL_SYSVAR(buffer_pool_size),
+ MYSQL_SYSVAR(checksums),
+ MYSQL_SYSVAR(commit_concurrency),
+ MYSQL_SYSVAR(concurrency_tickets),
+ MYSQL_SYSVAR(data_file_path),
+ MYSQL_SYSVAR(data_home_dir),
+ MYSQL_SYSVAR(doublewrite),
+ MYSQL_SYSVAR(fast_shutdown),
+ MYSQL_SYSVAR(file_io_threads),
+ MYSQL_SYSVAR(file_per_table),
+ MYSQL_SYSVAR(flush_log_at_trx_commit),
+ MYSQL_SYSVAR(flush_method),
+ MYSQL_SYSVAR(force_recovery),
+ MYSQL_SYSVAR(locks_unsafe_for_binlog),
+ MYSQL_SYSVAR(lock_wait_timeout),
+#ifdef UNIV_LOG_ARCHIVE
+ MYSQL_SYSVAR(log_arch_dir),
+ MYSQL_SYSVAR(log_archive),
+#endif /* UNIV_LOG_ARCHIVE */
+ MYSQL_SYSVAR(log_buffer_size),
+ MYSQL_SYSVAR(log_file_size),
+ MYSQL_SYSVAR(log_files_in_group),
+ MYSQL_SYSVAR(log_group_home_dir),
+ MYSQL_SYSVAR(max_dirty_pages_pct),
+ MYSQL_SYSVAR(max_purge_lag),
+ MYSQL_SYSVAR(mirrored_log_groups),
+ MYSQL_SYSVAR(open_files),
+ MYSQL_SYSVAR(rollback_on_timeout),
+ MYSQL_SYSVAR(stats_on_metadata),
+ MYSQL_SYSVAR(status_file),
+ MYSQL_SYSVAR(support_xa),
+ MYSQL_SYSVAR(sync_spin_loops),
+ MYSQL_SYSVAR(table_locks),
+ MYSQL_SYSVAR(thread_concurrency),
+ MYSQL_SYSVAR(thread_sleep_delay),
+ MYSQL_SYSVAR(autoinc_lock_mode),
+ NULL
+};
+
mysql_declare_plugin(innobase)
{
MYSQL_STORAGE_ENGINE_PLUGIN,
@@ -7706,9 +8073,7 @@ mysql_declare_plugin(innobase)
NULL, /* Plugin Deinit */
0x0100 /* 1.0 */,
innodb_status_variables_export,/* status variables */
- NULL, /* system variables */
- NULL /* config options */
+ innobase_system_variables, /* system variables */
+ NULL /* reserved */
}
mysql_declare_plugin_end;
-
-#endif
diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h
index 8b6c4d5a3d8..fe5ebd57990 100644
--- a/storage/innobase/handler/ha_innodb.h
+++ b/storage/innobase/handler/ha_innodb.h
@@ -32,7 +32,10 @@ typedef struct st_innobase_share {
} INNOBASE_SHARE;
+struct dict_index_struct;
struct row_prebuilt_struct;
+
+typedef struct dict_index_struct dict_index_t;
typedef struct row_prebuilt_struct row_prebuilt_t;
/* The class defining a handle to an Innodb table */
@@ -47,14 +50,14 @@ class ha_innobase: public handler
THR_LOCK_DATA lock;
INNOBASE_SHARE *share;
- byte* upd_buff; /* buffer used in updates */
- byte* key_val_buff; /* buffer used in converting
+ uchar* upd_buff; /* buffer used in updates */
+ uchar* key_val_buff; /* buffer used in converting
search key values from MySQL format
to Innodb format */
ulong upd_and_key_val_buff_len;
/* the length of each of the previous
two buffers */
- ulong int_table_flags;
+ Table_flags int_table_flags;
uint primary_key;
ulong start_of_scan; /* this is set to 1 when we are
starting a table scan but have not
@@ -65,11 +68,16 @@ class ha_innobase: public handler
uint num_write_row; /* number of write_row() calls */
uint store_key_val_for_row(uint keynr, char* buff, uint buff_len,
- const byte* record);
+ const uchar* record);
int update_thd(THD* thd);
int change_active_index(uint keynr);
- int general_fetch(byte* buf, uint direction, uint match_mode);
+ int general_fetch(uchar* buf, uint direction, uint match_mode);
int innobase_read_and_init_auto_inc(longlong* ret);
+ ulong innobase_autoinc_lock();
+ ulong innobase_set_max_autoinc(ulonglong auto_inc);
+ ulong innobase_reset_autoinc(ulonglong auto_inc);
+ ulong innobase_get_auto_increment(ulonglong* value);
+ dict_index_t* innobase_get_index(uint keynr);
/* Init values for the class: */
public:
@@ -84,7 +92,7 @@ class ha_innobase: public handler
const char* table_type() const { return("InnoDB");}
const char *index_type(uint key_number) { return "BTREE"; }
const char** bas_ext() const;
- ulonglong table_flags() const { return int_table_flags; }
+ Table_flags table_flags() const;
ulong index_flags(uint idx, uint part, bool all_parts) const
{
return (HA_READ_NEXT |
@@ -110,32 +118,32 @@ class ha_innobase: public handler
double scan_time();
double read_time(uint index, uint ranges, ha_rows rows);
- int write_row(byte * buf);
- int update_row(const byte * old_data, byte * new_data);
- int delete_row(const byte * buf);
+ int write_row(uchar * buf);
+ int update_row(const uchar * old_data, uchar * new_data);
+ int delete_row(const uchar * buf);
bool was_semi_consistent_read();
void try_semi_consistent_read(bool yes);
void unlock_row();
int index_init(uint index, bool sorted);
int index_end();
- int index_read(byte * buf, const byte * key,
+ int index_read(uchar * buf, const uchar * key,
uint key_len, enum ha_rkey_function find_flag);
- int index_read_idx(byte * buf, uint index, const byte * key,
+ int index_read_idx(uchar * buf, uint index, const uchar * key,
uint key_len, enum ha_rkey_function find_flag);
- int index_read_last(byte * buf, const byte * key, uint key_len);
- int index_next(byte * buf);
- int index_next_same(byte * buf, const byte *key, uint keylen);
- int index_prev(byte * buf);
- int index_first(byte * buf);
- int index_last(byte * buf);
+ int index_read_last(uchar * buf, const uchar * key, uint key_len);
+ int index_next(uchar * buf);
+ int index_next_same(uchar * buf, const uchar *key, uint keylen);
+ int index_prev(uchar * buf);
+ int index_first(uchar * buf);
+ int index_last(uchar * buf);
int rnd_init(bool scan);
int rnd_end();
- int rnd_next(byte *buf);
- int rnd_pos(byte * buf, byte *pos);
+ int rnd_next(uchar *buf);
+ int rnd_pos(uchar * buf, uchar *pos);
- void position(const byte *record);
+ void position(const uchar *record);
int info(uint);
int analyze(THD* thd,HA_CHECK_OPT* check_opt);
int optimize(THD* thd,HA_CHECK_OPT* check_opt);
@@ -145,7 +153,7 @@ class ha_innobase: public handler
int external_lock(THD *thd, int lock_type);
int transactional_table_lock(THD *thd, int lock_type);
int start_stmt(THD *thd, thr_lock_type lock_type);
- void position(byte *record);
+ void position(uchar *record);
ha_rows records_in_range(uint inx, key_range *min_key, key_range
*max_key);
ha_rows estimate_rows_upper_bound();
@@ -185,44 +193,62 @@ class ha_innobase: public handler
static char *get_mysql_bin_log_name();
static ulonglong get_mysql_bin_log_pos();
bool primary_key_is_clustered() { return true; }
- int cmp_ref(const byte *ref1, const byte *ref2);
+ int cmp_ref(const uchar *ref1, const uchar *ref2);
bool check_if_incompatible_data(HA_CREATE_INFO *info,
uint table_changes);
};
-extern ulong innobase_fast_shutdown;
-extern ulong innobase_large_page_size;
-extern long innobase_mirrored_log_groups, innobase_log_files_in_group;
-extern longlong innobase_buffer_pool_size, innobase_log_file_size;
-extern long innobase_log_buffer_size;
-extern long innobase_additional_mem_pool_size;
-extern long innobase_buffer_pool_awe_mem_mb;
-extern long innobase_file_io_threads, innobase_lock_wait_timeout;
-extern long innobase_force_recovery;
-extern long innobase_open_files;
-extern char *innobase_data_home_dir, *innobase_data_file_path;
-extern char *innobase_log_group_home_dir, *innobase_log_arch_dir;
-extern char *innobase_unix_file_flush_method;
-/* The following variables have to be my_bool for SHOW VARIABLES to work */
-extern my_bool innobase_log_archive,
- innobase_use_doublewrite,
- innobase_use_checksums,
- innobase_use_large_pages,
- innobase_use_native_aio,
- innobase_file_per_table, innobase_locks_unsafe_for_binlog,
- innobase_rollback_on_timeout,
- innobase_create_status_file,
- innobase_stats_on_metadata;
+/* Some accessor functions which the InnoDB plugin needs, but which
+can not be added to mysql/plugin.h as part of the public interface;
+the definitions are bracketed with #ifdef INNODB_COMPATIBILITY_HOOKS */
+
+#ifndef INNODB_COMPATIBILITY_HOOKS
+#error InnoDB needs MySQL to be built with #define INNODB_COMPATIBILITY_HOOKS
+#endif
+
extern "C" {
-extern ulong srv_max_buf_pool_modified_pct;
-extern ulong srv_max_purge_lag;
-extern ulong srv_auto_extend_increment;
-extern ulong srv_n_spin_wait_rounds;
-extern ulong srv_n_free_tickets_to_enter;
-extern ulong srv_thread_sleep_delay;
-extern ulong srv_thread_concurrency;
-extern ulong srv_commit_concurrency;
-extern ulong srv_flush_log_at_trx_commit;
+struct charset_info_st *thd_charset(MYSQL_THD thd);
+char **thd_query(MYSQL_THD thd);
+
+/** Get the file name of the MySQL binlog.
+ * @return the name of the binlog file
+ */
+const char* mysql_bin_log_file_name(void);
+
+/** Get the current position of the MySQL binlog.
+ * @return byte offset from the beginning of the binlog
+ */
+ulonglong mysql_bin_log_file_pos(void);
+
+/**
+ Check if a user thread is a replication slave thread
+ @param thd user thread
+ @retval 0 the user thread is not a replication slave thread
+ @retval 1 the user thread is a replication slave thread
+*/
+int thd_slave_thread(const MYSQL_THD thd);
+
+/**
+ Check if a user thread is running a non-transactional update
+ @param thd user thread
+ @retval 0 the user thread is not running a non-transactional update
+ @retval 1 the user thread is running a non-transactional update
+*/
+int thd_non_transactional_update(const MYSQL_THD thd);
+
+/**
+ Get the user thread's binary logging format
+ @param thd user thread
+ @return Value to be used as index into the binlog_format_names array
+*/
+int thd_binlog_format(const MYSQL_THD thd);
+
+/**
+ Mark transaction to rollback and mark error as fatal to a sub-statement.
+ @param thd Thread handle
+ @param all TRUE <=> rollback main transaction.
+*/
+void thd_mark_transaction_to_rollback(MYSQL_THD thd, bool all);
}
/*
diff --git a/storage/innobase/ibuf/Makefile.am b/storage/innobase/ibuf/Makefile.am
deleted file mode 100644
index 42adda9a4ef..00000000000
--- a/storage/innobase/ibuf/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = libibuf.a
-
-libibuf_a_SOURCES = ibuf0ibuf.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/ibuf/ibuf0ibuf.c b/storage/innobase/ibuf/ibuf0ibuf.c
index 1cbb6003cfc..44972356304 100644
--- a/storage/innobase/ibuf/ibuf0ibuf.c
+++ b/storage/innobase/ibuf/ibuf0ibuf.c
@@ -150,9 +150,30 @@ ulint ibuf_flush_count = 0;
#define IBUF_COUNT_N_PAGES 2000
/* Buffered entry counts for file pages, used in debugging */
-static ulint* ibuf_counts[IBUF_COUNT_N_SPACES];
+static ulint ibuf_counts[IBUF_COUNT_N_SPACES][IBUF_COUNT_N_PAGES];
-static ibool ibuf_counts_inited = FALSE;
+/**********************************************************************
+Checks that the indexes to ibuf_counts[][] are within limits. */
+UNIV_INLINE
+void
+ibuf_count_check(
+/*=============*/
+ ulint space_id, /* in: space identifier */
+ ulint page_no) /* in: page number */
+{
+ if (space_id < IBUF_COUNT_N_SPACES && page_no < IBUF_COUNT_N_PAGES) {
+ return;
+ }
+
+ fprintf(stderr,
+ "InnoDB: UNIV_IBUF_DEBUG limits space_id and page_no\n"
+ "InnoDB: and breaks crash recovery.\n"
+ "InnoDB: space_id=%lu, should be 0<=space_id<%lu\n"
+ "InnoDB: page_no=%lu, should be 0<=page_no<%lu\n",
+ (ulint) space_id, (ulint) IBUF_COUNT_N_SPACES,
+ (ulint) page_no, (ulint) IBUF_COUNT_N_PAGES);
+ ut_error;
+}
#endif
/* The start address for an insert buffer bitmap page bitmap */
@@ -328,15 +349,9 @@ ibuf_count_get(
ulint space, /* in: space id */
ulint page_no)/* in: page number */
{
- ut_ad(space < IBUF_COUNT_N_SPACES);
- ut_ad(page_no < IBUF_COUNT_N_PAGES);
-
- if (!ibuf_counts_inited) {
-
- return(0);
- }
+ ibuf_count_check(space, page_no);
- return(*(ibuf_counts[space] + page_no));
+ return(ibuf_counts[space][page_no]);
}
/**********************************************************************
@@ -349,11 +364,10 @@ ibuf_count_set(
ulint page_no,/* in: page number */
ulint val) /* in: value to set */
{
- ut_a(space < IBUF_COUNT_N_SPACES);
- ut_a(page_no < IBUF_COUNT_N_PAGES);
+ ibuf_count_check(space, page_no);
ut_a(val < UNIV_PAGE_SIZE);
- *(ibuf_counts[space] + page_no) = val;
+ ibuf_counts[space][page_no] = val;
}
#endif
@@ -378,22 +392,6 @@ ibuf_init_at_db_start(void)
ibuf->size = 0;
-#ifdef UNIV_IBUF_DEBUG
- {
- ulint i, j;
-
- for (i = 0; i < IBUF_COUNT_N_SPACES; i++) {
-
- ibuf_counts[i] = mem_alloc(sizeof(ulint)
- * IBUF_COUNT_N_PAGES);
- for (j = 0; j < IBUF_COUNT_N_PAGES; j++) {
- ibuf_count_set(i, j, 0);
- }
- }
-
- ibuf_counts_inited = TRUE;
- }
-#endif
mutex_create(&ibuf_pessimistic_insert_mutex,
SYNC_IBUF_PESS_INSERT_MUTEX);
@@ -464,7 +462,8 @@ ibuf_data_init_for_space(
page_t* root;
page_t* header_page;
mtr_t mtr;
- char buf[50];
+ char* buf;
+ mem_heap_t* heap;
dict_table_t* table;
dict_index_t* index;
ulint n_used;
@@ -518,16 +517,20 @@ ibuf_data_init_for_space(
ibuf_exit();
+ heap = mem_heap_create(450);
+ buf = mem_heap_alloc(heap, 50);
+
sprintf(buf, "SYS_IBUF_TABLE_%lu", (ulong) space);
/* use old-style record format for the insert buffer */
table = dict_mem_table_create(buf, space, 2, 0);
- dict_mem_table_add_col(table, "PAGE_NO", DATA_BINARY, 0, 0);
- dict_mem_table_add_col(table, "TYPES", DATA_BINARY, 0, 0);
+ dict_mem_table_add_col(table, heap, "PAGE_NO", DATA_BINARY, 0, 0);
+ dict_mem_table_add_col(table, heap, "TYPES", DATA_BINARY, 0, 0);
table->id = ut_dulint_add(DICT_IBUF_ID_MIN, space);
- dict_table_add_to_cache(table);
+ dict_table_add_to_cache(table, heap);
+ mem_heap_free(heap);
index = dict_mem_index_create(
buf, "CLUST_IND", space,
@@ -567,7 +570,8 @@ ibuf_bitmap_page_init(
bit_offset = XDES_DESCRIBED_PER_PAGE * IBUF_BITS_PER_PAGE;
- byte_offset = bit_offset / 8 + 1; /* better: (bit_offset + 7) / 8 */
+ byte_offset = bit_offset / 8 + 1;
+ /* better: byte_offset = UT_BITS_IN_BYTES(bit_offset); */
fil_page_set_type(page, FIL_PAGE_IBUF_BITMAP);
@@ -1140,7 +1144,7 @@ ibuf_dummy_index_add_col(
ulint len) /* in: length of the column */
{
ulint i = index->table->n_def;
- dict_mem_table_add_col(index->table, "DUMMY",
+ dict_mem_table_add_col(index->table, NULL, NULL,
dtype_get_mtype(type),
dtype_get_prtype(type),
dtype_get_len(type));
@@ -1162,11 +1166,6 @@ ibuf_dummy_index_free(
dict_mem_table_free(table);
}
-void
-dict_index_print_low(
-/*=================*/
- dict_index_t* index); /* in: index */
-
/*************************************************************************
Builds the entry to insert into a non-clustered index when we have the
corresponding record in an ibuf index. */
@@ -1441,6 +1440,9 @@ ibuf_entry_build(
*buf2++ = 0; /* write the compact format indicator */
}
for (i = 0; i < n_fields; i++) {
+ ulint fixed_len;
+ const dict_field_t* ifield;
+
/* We add 4 below because we have the 4 extra fields at the
start of an ibuf record */
@@ -1448,10 +1450,30 @@ ibuf_entry_build(
entry_field = dtuple_get_nth_field(entry, i);
dfield_copy(field, entry_field);
+ ifield = dict_index_get_nth_field(index, i);
+ /* Prefix index columns of fixed-length columns are of
+ fixed length. However, in the function call below,
+ dfield_get_type(entry_field) contains the fixed length
+ of the column in the clustered index. Replace it with
+ the fixed length of the secondary index column. */
+ fixed_len = ifield->fixed_len;
+
+#ifdef UNIV_DEBUG
+ if (fixed_len) {
+ /* dict_index_add_col() should guarantee these */
+ ut_ad(fixed_len <= (ulint) entry_field->type.len);
+ if (ifield->prefix_len) {
+ ut_ad(ifield->prefix_len == fixed_len);
+ } else {
+ ut_ad(fixed_len
+ == (ulint) entry_field->type.len);
+ }
+ }
+#endif /* UNIV_DEBUG */
+
dtype_new_store_for_order_and_null_size(
buf2 + i * DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE,
- dfield_get_type(entry_field),
- dict_index_get_nth_field(index, i)->prefix_len);
+ dfield_get_type(entry_field), fixed_len);
}
/* Store the type info in buf2 to field 3 of tuple */
diff --git a/storage/innobase/include/Makefile.i b/storage/innobase/include/Makefile.i
deleted file mode 100644
index db436c702ff..00000000000
--- a/storage/innobase/include/Makefile.i
+++ /dev/null
@@ -1,10 +0,0 @@
-# Makefile included in Makefile.am in every subdirectory
-
-INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
- -I$(top_srcdir)/regex \
- -I$(top_srcdir)/storage/innobase/include \
- -I$(top_srcdir)/sql \
- -I$(srcdir)
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/include/buf0buf.ic b/storage/innobase/include/buf0buf.ic
index 031bf6c51b4..b077ff0c181 100644
--- a/storage/innobase/include/buf0buf.ic
+++ b/storage/innobase/include/buf0buf.ic
@@ -28,7 +28,7 @@ buf_block_peek_if_too_old(
buf_block_t* block) /* in: block to make younger */
{
return(buf_pool->freed_page_clock >= block->freed_page_clock
- + 1 + (buf_pool->curr_size / 1024));
+ + 1 + (buf_pool->curr_size / 4));
}
/*************************************************************************
diff --git a/storage/innobase/include/db0err.h b/storage/innobase/include/db0err.h
index 843c70af577..0aa1b87e470 100644
--- a/storage/innobase/include/db0err.h
+++ b/storage/innobase/include/db0err.h
@@ -62,6 +62,11 @@ Created 5/24/1996 Heikki Tuuri
lead to a duplicate key in some
table */
+#define DB_TOO_MANY_CONCURRENT_TRXS 47 /* when InnoDB runs out of the
+ preconfigured undo slots, this can
+ only happen when there are too many
+ concurrent transactions */
+
/* The following are partial failure codes */
#define DB_FAIL 1000
#define DB_OVERFLOW 1001
diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h
index 836a6290498..2f038b21e8e 100644
--- a/storage/innobase/include/dict0dict.h
+++ b/storage/innobase/include/dict0dict.h
@@ -92,6 +92,17 @@ dict_col_copy_type_noninline(
/*=========================*/
const dict_col_t* col, /* in: column */
dtype_t* type); /* out: data type */
+#ifdef UNIV_DEBUG
+/*************************************************************************
+Assert that a column and a data type match. */
+UNIV_INLINE
+ibool
+dict_col_type_assert_equal(
+/*=======================*/
+ /* out: TRUE */
+ const dict_col_t* col, /* in: column */
+ const dtype_t* type); /* in: data type */
+#endif /* UNIV_DEBUG */
/***************************************************************************
Returns the minimum size of the column. */
UNIV_INLINE
@@ -160,6 +171,13 @@ dict_col_name_is_reserved(
/* out: TRUE if name is reserved */
const char* name); /* in: column name */
/************************************************************************
+Acquire the autoinc lock.*/
+
+void
+dict_table_autoinc_lock(
+/*====================*/
+ dict_table_t* table); /* in: table */
+/************************************************************************
Initializes the autoinc counter. It is not an error to initialize an already
initialized counter. */
@@ -169,22 +187,6 @@ dict_table_autoinc_initialize(
dict_table_t* table, /* in: table */
ib_longlong value); /* in: next value to assign to a row */
/************************************************************************
-Gets the next autoinc value (== autoinc counter value), 0 if not yet
-initialized. If initialized, increments the counter by 1. */
-
-ib_longlong
-dict_table_autoinc_get(
-/*===================*/
- /* out: value for a new row, or 0 */
- dict_table_t* table); /* in: table */
-/************************************************************************
-Decrements the autoinc counter value by 1. */
-
-void
-dict_table_autoinc_decrement(
-/*=========================*/
- dict_table_t* table); /* in: table */
-/************************************************************************
Reads the next autoinc value (== autoinc counter value), 0 if not yet
initialized. */
@@ -194,15 +196,6 @@ dict_table_autoinc_read(
/* out: value for a new row, or 0 */
dict_table_t* table); /* in: table */
/************************************************************************
-Peeks the autoinc counter value, 0 if not yet initialized. Does not
-increment the counter. The read not protected by any mutex! */
-
-ib_longlong
-dict_table_autoinc_peek(
-/*====================*/
- /* out: value of the counter */
- dict_table_t* table); /* in: table */
-/************************************************************************
Updates the autoinc counter if the value supplied is equal or bigger than the
current value. If not inited, does nothing. */
@@ -212,13 +205,29 @@ dict_table_autoinc_update(
dict_table_t* table, /* in: table */
ib_longlong value); /* in: value which was assigned to a row */
+/************************************************************************
+Release the autoinc lock.*/
+
+void
+dict_table_autoinc_unlock(
+/*======================*/
+ dict_table_t* table); /* in: table */
+/**************************************************************************
+Adds system columns to a table object. */
+
+void
+dict_table_add_system_columns(
+/*==========================*/
+ dict_table_t* table, /* in/out: table */
+ mem_heap_t* heap); /* in: temporary heap */
/**************************************************************************
Adds a table object to the dictionary cache. */
void
dict_table_add_to_cache(
/*====================*/
- dict_table_t* table); /* in: table */
+ dict_table_t* table, /* in: table */
+ mem_heap_t* heap); /* in: temporary heap */
/**************************************************************************
Removes a table object from the dictionary cache. */
diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic
index 4a9afd2f3f5..7d38cbcd1fa 100644
--- a/storage/innobase/include/dict0dict.ic
+++ b/storage/innobase/include/dict0dict.ic
@@ -30,6 +30,30 @@ dict_col_copy_type(
type->mbmaxlen = col->mbmaxlen;
}
+#ifdef UNIV_DEBUG
+/*************************************************************************
+Assert that a column and a data type match. */
+UNIV_INLINE
+ibool
+dict_col_type_assert_equal(
+/*=======================*/
+ /* out: TRUE */
+ const dict_col_t* col, /* in: column */
+ const dtype_t* type) /* in: data type */
+{
+ ut_ad(col);
+ ut_ad(type);
+
+ ut_ad(col->mtype == type->mtype);
+ ut_ad(col->prtype == type->prtype);
+ ut_ad(col->len == type->len);
+ ut_ad(col->mbminlen == type->mbminlen);
+ ut_ad(col->mbmaxlen == type->mbmaxlen);
+
+ return(TRUE);
+}
+#endif /* UNIV_DEBUG */
+
/***************************************************************************
Returns the minimum size of the column. */
UNIV_INLINE
diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h
index a23f89954a4..a05bc513efd 100644
--- a/storage/innobase/include/dict0mem.h
+++ b/storage/innobase/include/dict0mem.h
@@ -72,7 +72,8 @@ void
dict_mem_table_add_col(
/*===================*/
dict_table_t* table, /* in: table */
- const char* name, /* in: column name */
+ mem_heap_t* heap, /* in: temporary memory heap, or NULL */
+ const char* name, /* in: column name, or NULL */
ulint mtype, /* in: main datatype */
ulint prtype, /* in: precise type */
ulint len); /* in: precision */
@@ -158,10 +159,13 @@ struct dict_col_struct{
of an index */
};
-/* DICT_MAX_INDEX_COL_LEN is measured in bytes and is the max index column
-length + 1. Starting from 4.1.6, we set it to < 3 * 256, so that one can
-create a column prefix index on 255 characters of a TEXT field also in the
-UTF-8 charset. In that charset, a character may take at most 3 bytes. */
+/* DICT_MAX_INDEX_COL_LEN is measured in bytes and is the maximum
+indexed column length (or indexed prefix length). It is set to 3*256,
+so that one can create a column prefix index on 256 characters of a
+TEXT or VARCHAR column also in the UTF-8 charset. In that charset,
+a character may take at most 3 bytes.
+This constant MUST NOT BE CHANGED, or the compatibility of InnoDB data
+files would be at risk! */
#define DICT_MAX_INDEX_COL_LEN 768
@@ -311,11 +315,11 @@ struct dict_table_struct{
unsigned n_cols:10;/* number of columns */
dict_col_t* cols; /* array of column descriptions */
const char* col_names;
- /* n_def column names packed in an
- "name1\0name2\0...nameN\0" array. until
- n_def reaches n_cols, this is allocated with
- ut_malloc, and the final size array is
- allocated through the table's heap. */
+ /* Column names packed in a character string
+ "name1\0name2\0...nameN\0". Until
+ the string contains n_cols, it will be
+ allocated from a temporary heap. The final
+ string will be allocated from table->heap. */
hash_node_t name_hash; /* hash chain node */
hash_node_t id_hash; /* hash chain node */
UT_LIST_BASE_NODE_T(dict_index_t)
@@ -407,6 +411,21 @@ struct dict_table_struct{
SELECT MAX(auto inc column) */
ib_longlong autoinc;/* autoinc counter value to give to the
next inserted row */
+
+ ib_longlong autoinc_increment;
+ /* The increment step of the auto increment
+ column. Value must be greater than or equal
+ to 1 */
+ ulong n_waiting_or_granted_auto_inc_locks;
+ /* This counter is used to track the number
+ of granted and pending autoinc locks on this
+ table. This value is set after acquiring the
+ kernel mutex but we peek the contents to
+ determine whether other transactions have
+ acquired the AUTOINC lock or not. Of course
+ only one transaction can be granted the
+ lock but there can be multiple waiters. */
+
#ifdef UNIV_DEBUG
ulint magic_n;/* magic number */
# define DICT_TABLE_MAGIC_N 76333786
diff --git a/storage/innobase/include/fsp0fsp.h b/storage/innobase/include/fsp0fsp.h
index d04269fc157..82e95a2e920 100644
--- a/storage/innobase/include/fsp0fsp.h
+++ b/storage/innobase/include/fsp0fsp.h
@@ -245,7 +245,7 @@ will be able to insert new data to the database without running out the
tablespace. Only free extents are taken into account and we also subtract
the safety margin required by the above function fsp_reserve_free_extents. */
-ulint
+ullint
fsp_get_available_space_in_free_extents(
/*====================================*/
/* out: available space in kB */
diff --git a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h
index 2d27034fdfe..7fb50988941 100644
--- a/storage/innobase/include/ha_prototypes.h
+++ b/storage/innobase/include/ha_prototypes.h
@@ -1,6 +1,9 @@
#ifndef HA_INNODB_PROTOTYPES_H
#define HA_INNODB_PROTOTYPES_H
+#include "univ.i" /* ulint, uint */
+#include "m_ctype.h" /* CHARSET_INFO */
+
/* Prototypes for global functions in ha_innodb.cc that are called by
InnoDB's C-code. */
@@ -19,4 +22,30 @@ innobase_convert_string(
CHARSET_INFO* from_cs,
uint* errors);
+/**********************************************************************
+Returns true if the thread is the replication thread on the slave
+server. Used in srv_conc_enter_innodb() to determine if the thread
+should be allowed to enter InnoDB - the replication thread is treated
+differently than other threads. Also used in
+srv_conc_force_exit_innodb(). */
+
+ibool
+thd_is_replication_slave_thread(
+/*============================*/
+ /* out: true if thd is the replication thread */
+ void* thd); /* in: thread handle (THD*) */
+
+/**********************************************************************
+Returns true if the transaction this thread is processing has edited
+non-transactional tables. Used by the deadlock detector when deciding
+which transaction to rollback in case of a deadlock - we try to avoid
+rolling back transactions that have edited non-transactional tables. */
+
+ibool
+thd_has_edited_nontrans_tables(
+/*===========================*/
+ /* out: true if non-transactional tables have
+ been edited */
+ void* thd); /* in: thread handle (THD*) */
+
#endif
diff --git a/storage/innobase/include/lock0iter.h b/storage/innobase/include/lock0iter.h
new file mode 100644
index 00000000000..d063a360c1f
--- /dev/null
+++ b/storage/innobase/include/lock0iter.h
@@ -0,0 +1,52 @@
+/******************************************************
+Lock queue iterator type and function prototypes.
+
+(c) 2007 Innobase Oy
+
+Created July 16, 2007 Vasil Dimov
+*******************************************************/
+
+#ifndef lock0iter_h
+#define lock0iter_h
+
+#include "univ.i"
+#include "lock0types.h"
+
+typedef struct lock_queue_iterator_struct {
+ lock_t* current_lock;
+ /* In case this is a record lock queue (not table lock queue)
+ then bit_no is the record number within the heap in which the
+ record is stored. */
+ ulint bit_no;
+} lock_queue_iterator_t;
+
+/***********************************************************************
+Initialize lock queue iterator so that it starts to iterate from
+"lock". bit_no specifies the record number within the heap where the
+record is stored. It can be undefined (ULINT_UNDEFINED) in two cases:
+1. If the lock is a table lock, thus we have a table lock queue;
+2. If the lock is a record lock and it is a wait lock. In this case
+ bit_no is calculated in this function by using
+ lock_rec_find_set_bit(). There is exactly one bit set in the bitmap
+ of a wait lock. */
+
+void
+lock_queue_iterator_reset(
+/*======================*/
+ lock_queue_iterator_t* iter, /* out: iterator */
+ lock_t* lock, /* in: lock to start from */
+ ulint bit_no);/* in: record number in the
+ heap */
+
+/***********************************************************************
+Gets the previous lock in the lock queue, returns NULL if there are no
+more locks (i.e. the current lock is the first one). The iterator is
+receded (if not-NULL is returned). */
+
+lock_t*
+lock_queue_iterator_get_prev(
+/*=========================*/
+ /* out: previous lock or NULL */
+ lock_queue_iterator_t* iter); /* in/out: iterator */
+
+#endif /* lock0iter_h */
diff --git a/storage/innobase/include/lock0lock.h b/storage/innobase/include/lock0lock.h
index 6b863e32183..8b08b6284f6 100644
--- a/storage/innobase/include/lock0lock.h
+++ b/storage/innobase/include/lock0lock.h
@@ -519,6 +519,18 @@ lock_is_table_exclusive(
dict_table_t* table, /* in: table */
trx_t* trx); /* in: transaction */
/*************************************************************************
+Checks if a lock request lock1 has to wait for request lock2. */
+
+ibool
+lock_has_to_wait(
+/*=============*/
+ /* out: TRUE if lock1 has to wait for lock2 to be
+ removed */
+ lock_t* lock1, /* in: waiting lock */
+ lock_t* lock2); /* in: another lock; NOTE that it is assumed that this
+ has a lock bit set on the same record as in lock1 if
+ the locks are record locks */
+/*************************************************************************
Checks that a transaction id is sensible, i.e., not in the future. */
ibool
@@ -597,7 +609,7 @@ lock_validate(void);
/* out: TRUE if ok */
/*************************************************************************
Return approximate number or record locks (bits set in the bitmap) for
-this transaction. Since delete-marked records ma ybe removed, the
+this transaction. Since delete-marked records may be removed, the
record count will not be precise. */
ulint
diff --git a/storage/innobase/include/lock0priv.h b/storage/innobase/include/lock0priv.h
new file mode 100644
index 00000000000..7703a2b7def
--- /dev/null
+++ b/storage/innobase/include/lock0priv.h
@@ -0,0 +1,101 @@
+/******************************************************
+Lock module internal structures and methods.
+
+(c) 2007 Innobase Oy
+
+Created July 12, 2007 Vasil Dimov
+*******************************************************/
+
+#ifndef lock0priv_h
+#define lock0priv_h
+
+#ifndef LOCK_MODULE_IMPLEMENTATION
+/* If you need to access members of the structures defined in this
+file, please write appropriate functions that retrieve them and put
+those functions in lock/ */
+#error Do not include lock0priv.h outside of the lock/ module
+#endif
+
+#include "univ.i"
+#include "dict0types.h"
+#include "hash0hash.h"
+#include "trx0types.h"
+#include "ut0lst.h"
+
+/* A table lock */
+typedef struct lock_table_struct lock_table_t;
+struct lock_table_struct {
+ dict_table_t* table; /* database table in dictionary
+ cache */
+ UT_LIST_NODE_T(lock_t)
+ locks; /* list of locks on the same
+ table */
+};
+
+/* Record lock for a page */
+typedef struct lock_rec_struct lock_rec_t;
+struct lock_rec_struct {
+ ulint space; /* space id */
+ ulint page_no; /* page number */
+ ulint n_bits; /* number of bits in the lock
+ bitmap; NOTE: the lock bitmap is
+ placed immediately after the
+ lock struct */
+};
+
+/* Lock struct */
+struct lock_struct {
+ trx_t* trx; /* transaction owning the
+ lock */
+ UT_LIST_NODE_T(lock_t)
+ trx_locks; /* list of the locks of the
+ transaction */
+ ulint type_mode; /* lock type, mode, LOCK_GAP or
+ LOCK_REC_NOT_GAP,
+ LOCK_INSERT_INTENTION,
+ wait flag, ORed */
+ hash_node_t hash; /* hash chain node for a record
+ lock */
+ dict_index_t* index; /* index for a record lock */
+ union {
+ lock_table_t tab_lock;/* table lock */
+ lock_rec_t rec_lock;/* record lock */
+ } un_member;
+};
+
+/*************************************************************************
+Gets the type of a lock. */
+UNIV_INLINE
+ulint
+lock_get_type(
+/*==========*/
+ /* out: LOCK_TABLE or LOCK_REC */
+ const lock_t* lock); /* in: lock */
+
+/**************************************************************************
+Looks for a set bit in a record lock bitmap. Returns ULINT_UNDEFINED,
+if none found. */
+
+ulint
+lock_rec_find_set_bit(
+/*==================*/
+ /* out: bit index == heap number of the record, or
+ ULINT_UNDEFINED if none found */
+ lock_t* lock); /* in: record lock with at least one bit set */
+
+/*************************************************************************
+Gets the previous record lock set on a record. */
+
+lock_t*
+lock_rec_get_prev(
+/*==============*/
+ /* out: previous lock on the same record, NULL if
+ none exists */
+ lock_t* in_lock,/* in: record lock */
+ ulint heap_no);/* in: heap number of the record */
+
+#ifndef UNIV_NONINL
+#include "lock0priv.ic"
+#endif
+
+#endif /* lock0priv_h */
diff --git a/storage/innobase/include/lock0priv.ic b/storage/innobase/include/lock0priv.ic
new file mode 100644
index 00000000000..4bc8397509d
--- /dev/null
+++ b/storage/innobase/include/lock0priv.ic
@@ -0,0 +1,32 @@
+/******************************************************
+Lock module internal inline methods.
+
+(c) 2007 Innobase Oy
+
+Created July 16, 2007 Vasil Dimov
+*******************************************************/
+
+/* This file contains only methods which are used in
+lock/lock0* files, other than lock/lock0lock.c.
+I.e. lock/lock0lock.c contains more internal inline
+methods but they are used only in that file. */
+
+#ifndef LOCK_MODULE_IMPLEMENTATION
+#error Do not include lock0priv.ic outside of the lock/ module
+#endif
+
+/*************************************************************************
+Gets the type of a lock. */
+UNIV_INLINE
+ulint
+lock_get_type(
+/*==========*/
+ /* out: LOCK_TABLE or LOCK_REC */
+ const lock_t* lock) /* in: lock */
+{
+ ut_ad(lock);
+
+ return(lock->type_mode & LOCK_TYPE_MASK);
+}
+
+/* vim: set filetype=c: */
diff --git a/storage/innobase/include/mem0mem.ic b/storage/innobase/include/mem0mem.ic
index cb8fbe92cf0..adae9ad8a33 100644
--- a/storage/innobase/include/mem0mem.ic
+++ b/storage/innobase/include/mem0mem.ic
@@ -167,6 +167,8 @@ mem_heap_alloc(
mem_block_set_free(block, free + MEM_SPACE_NEEDED(n));
#ifdef UNIV_MEM_DEBUG
+ UNIV_MEM_ALLOC(buf,
+ n + MEM_FIELD_HEADER_SIZE + MEM_FIELD_TRAILER_SIZE);
/* In the debug version write debugging info to the field */
mem_field_init((byte*)buf, n);
@@ -177,8 +179,10 @@ mem_heap_alloc(
#endif
#ifdef UNIV_SET_MEM_TO_ZERO
+ UNIV_MEM_ALLOC(buf, n);
memset(buf, '\0', n);
#endif
+ UNIV_MEM_ALLOC(buf, n);
return(buf);
}
@@ -267,15 +271,19 @@ mem_heap_free_heap_top(
ut_ad(mem_block_get_start(block) <= mem_block_get_free(block));
/* In the debug version erase block from top up */
-
- mem_erase_buf(old_top, (byte*)block + block->len - old_top);
+ {
+ ulint len = (byte*)block + block->len - old_top;
+ mem_erase_buf(old_top, len);
+ UNIV_MEM_FREE(old_top, len);
+ }
/* Update allocated memory count */
mutex_enter(&mem_hash_mutex);
mem_current_allocated_memory -= (total_size - size);
mutex_exit(&mem_hash_mutex);
-
-#endif
+#else /* UNIV_MEM_DEBUG */
+ UNIV_MEM_FREE(old_top, (byte*)block + block->len - old_top);
+#endif /* UNIV_MEM_DEBUG */
/* If free == start, we may free the block if it is not the first
one */
@@ -369,6 +377,8 @@ mem_heap_free_top(
if ((heap != block) && (mem_block_get_free(block)
== mem_block_get_start(block))) {
mem_heap_block_free(heap, block);
+ } else {
+ UNIV_MEM_FREE((byte*) block + mem_block_get_free(block), n);
}
}
diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h
index 5ffcdf7e58c..9eb44d3f4a8 100644
--- a/storage/innobase/include/os0file.h
+++ b/storage/innobase/include/os0file.h
@@ -94,7 +94,8 @@ log. */
#define OS_FILE_PATH_ERROR 74
#define OS_FILE_AIO_RESOURCES_RESERVED 75 /* wait for OS aio resources
to become available again */
-#define OS_FILE_ERROR_NOT_SPECIFIED 76
+#define OS_FILE_SHARING_VIOLATION 76
+#define OS_FILE_ERROR_NOT_SPECIFIED 77
/* Types for aio operations */
#define OS_FILE_READ 10
diff --git a/storage/innobase/include/page0page.h b/storage/innobase/include/page0page.h
index 833d268c9de..273007c2778 100644
--- a/storage/innobase/include/page0page.h
+++ b/storage/innobase/include/page0page.h
@@ -531,6 +531,15 @@ page_get_free_space_of_empty(
/* out: free space */
ulint comp) /* in: nonzero=compact page format */
__attribute__((const));
+/*****************************************************************
+Calculates free space if a page is emptied. */
+
+ulint
+page_get_free_space_of_empty_noninline(
+/*===================================*/
+ /* out: free space */
+ ulint comp) /* in: nonzero=compact page format */
+ __attribute__((const));
/****************************************************************
Returns the sum of the sizes of the records in the record list
excluding the infimum and supremum records. */
diff --git a/storage/innobase/include/rem0rec.ic b/storage/innobase/include/rem0rec.ic
index 90a35af74dc..95aa65fabba 100644
--- a/storage/innobase/include/rem0rec.ic
+++ b/storage/innobase/include/rem0rec.ic
@@ -795,7 +795,8 @@ UNIV_INLINE
void
rec_offs_set_n_alloc(
/*=================*/
- ulint* offsets, /* in: array for rec_get_offsets() */
+ ulint* offsets, /* out: array for rec_get_offsets(),
+ must be allocated */
ulint n_alloc) /* in: number of elements */
{
ut_ad(offsets);
@@ -1282,7 +1283,8 @@ UNIV_INLINE
void
rec_offs_set_n_fields(
/*==================*/
- ulint* offsets, /* in: array returned by rec_get_offsets() */
+ ulint* offsets, /* in/out: array returned by
+ rec_get_offsets() */
ulint n_fields) /* in: number of fields */
{
ut_ad(offsets);
diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h
index 1448efe94fe..aabb7f5f047 100644
--- a/storage/innobase/include/row0mysql.h
+++ b/storage/innobase/include/row0mysql.h
@@ -670,6 +670,7 @@ struct row_prebuilt_struct {
to this heap */
mem_heap_t* old_vers_heap; /* memory heap where a previous
version is built in consistent read */
+ ulonglong last_value; /* last value of AUTO-INC interval */
ulint magic_n2; /* this should be the same as
magic_n */
};
diff --git a/storage/innobase/include/row0sel.h b/storage/innobase/include/row0sel.h
index 96273a18cd5..4bde648f18e 100644
--- a/storage/innobase/include/row0sel.h
+++ b/storage/innobase/include/row0sel.h
@@ -171,7 +171,17 @@ row_search_check_if_query_cache_permitted(
trx_t* trx, /* in: transaction object */
const char* norm_name); /* in: concatenation of database name,
'/' char, table name */
+/***********************************************************************
+Read the max AUTOINC value from an index. */
+ulint
+row_search_max_autoinc(
+/*===================*/
+ /* out: DB_SUCCESS if all OK else
+ error code */
+ dict_index_t* index, /* in: index to search */
+ const char* col_name, /* in: autoinc column name */
+ ib_longlong* value); /* out: AUTOINC value read */
/* A structure for caching column values for prefetched rows */
struct sel_buf_struct{
diff --git a/storage/innobase/include/sync0rw.ic b/storage/innobase/include/sync0rw.ic
index f8b5367739a..b41593d0a96 100644
--- a/storage/innobase/include/sync0rw.ic
+++ b/storage/innobase/include/sync0rw.ic
@@ -231,7 +231,7 @@ rw_lock_s_lock_func(
owns an s-lock here, it may end up in a deadlock with another thread
which requests an x-lock here. Therefore, we will forbid recursive
s-locking of a latch: the following assert will warn the programmer
- of the possibility of a tjis kind of deadlock. If we want to implement
+ of the possibility of this kind of a deadlock. If we want to implement
safe recursive s-locking, we should keep in a list the thread ids of
the threads which have s-locked a latch. This would use some CPU
time. */
diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h
index fe36b0d1a01..5017c15aaf0 100644
--- a/storage/innobase/include/trx0trx.h
+++ b/storage/innobase/include/trx0trx.h
@@ -371,6 +371,18 @@ trx_is_interrupted(
#define trx_is_interrupted(trx) FALSE
#endif /* !UNIV_HOTBACKUP */
+/***********************************************************************
+Compares the "weight" (or size) of two transactions. The weight of one
+transaction is estimated as the number of altered rows + the number of
+locked rows. Transactions that have edited non-transactional tables are
+considered heavier than ones that have not. */
+
+int
+trx_weight_cmp(
+/*===========*/
+ /* out: <0, 0 or >0; similar to strcmp(3) */
+ trx_t* a, /* in: the first transaction to be compared */
+ trx_t* b); /* in: the second transaction to be compared */
/* Signal to a transaction */
struct trx_sig_struct{
@@ -453,7 +465,8 @@ struct trx_struct{
dulint table_id; /* table id if the preceding field is
TRUE */
/*------------------------------*/
- int active_trans; /* 1 - if a transaction in MySQL
+ unsigned duplicates:2; /* TRX_DUP_IGNORE | TRX_DUP_REPLACE */
+ unsigned active_trans:2; /* 1 - if a transaction in MySQL
is active. 2 - if prepare_commit_mutex
was taken */
void* mysql_thd; /* MySQL thread handle corresponding
@@ -469,31 +482,6 @@ struct trx_struct{
ib_longlong mysql_log_offset;/* if MySQL binlog is used, this field
contains the end offset of the binlog
entry */
- const char* mysql_master_log_file_name;
- /* if the database server is a MySQL
- replication slave, we have here the
- master binlog name up to which
- replication has processed; otherwise
- this is a pointer to a null
- character */
- ib_longlong mysql_master_log_pos;
- /* if the database server is a MySQL
- replication slave, this is the
- position in the log file up to which
- replication has processed */
- /* A MySQL variable mysql_thd->synchronous_repl tells if we have
- to use synchronous replication. See ha_innodb.cc. */
- char* repl_wait_binlog_name;/* NULL, or if synchronous MySQL
- replication is used, the binlog name
- up to which we must communicate the
- binlog to the slave, before returning
- from a commit; this is the same as
- mysql_log_file_name, but we allocate
- and copy the name to a separate buffer
- here */
- ib_longlong repl_wait_binlog_pos;/* see above at
- repl_wait_binlog_name */
-
os_thread_id_t mysql_thread_id;/* id of the MySQL thread associated
with this transaction object */
ulint mysql_process_no;/* since in Linux, 'top' reports
@@ -602,7 +590,7 @@ struct trx_struct{
NULL */
ibool was_chosen_as_deadlock_victim;
/* when the transaction decides to wait
- for a lock, this it sets this to FALSE;
+ for a lock, it sets this to FALSE;
if another transaction chooses this
transaction as a victim in deadlock
resolution, it sets this to TRUE */
@@ -643,7 +631,12 @@ struct trx_struct{
cannot be any activity in the undo
logs! */
dulint undo_no; /* next undo log record number to
- assign */
+ assign; since the undo log is
+ private for a transaction, this
+ is a simple ascending sequence
+ with no gaps; thus it represents
+ the number of modified/inserted
+ rows in a transaction */
trx_savept_t last_sql_stat_start;
/* undo_no when the last sql statement
was started: in case of an error, trx
@@ -663,6 +656,9 @@ struct trx_struct{
trx_undo_arr_t* undo_no_arr; /* array of undo numbers of undo log
records which are currently processed
by a rollback operation */
+ ulint n_autoinc_rows; /* no. of AUTO-INC rows required for
+ an SQL statement. This is useful for
+ multi-row INSERTs */
/*------------------------------*/
char detailed_error[256]; /* detailed error message for last
error, or empty. */
@@ -673,19 +669,19 @@ struct trx_struct{
single operation of a
transaction, e.g., a parallel
query */
-/* Transaction concurrency states */
+/* Transaction concurrency states (trx->conc_state) */
#define TRX_NOT_STARTED 1
#define TRX_ACTIVE 2
#define TRX_COMMITTED_IN_MEMORY 3
#define TRX_PREPARED 4 /* Support for 2PC/XA */
-/* Transaction execution states when trx state is TRX_ACTIVE */
+/* Transaction execution states when trx->conc_state == TRX_ACTIVE */
#define TRX_QUE_RUNNING 1 /* transaction is running */
#define TRX_QUE_LOCK_WAIT 2 /* transaction is waiting for a lock */
#define TRX_QUE_ROLLING_BACK 3 /* transaction is rolling back */
#define TRX_QUE_COMMITTING 4 /* transaction is committing */
-/* Transaction isolation levels */
+/* Transaction isolation levels (trx->isolation_level) */
#define TRX_ISO_READ_UNCOMMITTED 1 /* dirty read: non-locking
SELECTs are performed so that
we do not look at a possible
@@ -720,6 +716,12 @@ struct trx_struct{
converted to LOCK IN SHARE
MODE reads */
+/* Treatment of duplicate values (trx->duplicates; for example, in inserts).
+Multiple flags can be combined with bitwise OR. */
+#define TRX_DUP_IGNORE 1 /* duplicate rows are to be updated */
+#define TRX_DUP_REPLACE 2 /* duplicate rows are to be replaced */
+
+
/* Types of a trx signal */
#define TRX_SIG_NO_SIGNAL 100
#define TRX_SIG_TOTAL_ROLLBACK 1
diff --git a/storage/innobase/include/trx0undo.h b/storage/innobase/include/trx0undo.h
index 87849ab42c3..f53c6b01be4 100644
--- a/storage/innobase/include/trx0undo.h
+++ b/storage/innobase/include/trx0undo.h
@@ -222,13 +222,16 @@ trx_undo_lists_init(
Assigns an undo log for a transaction. A new undo log is created or a cached
undo log reused. */
-trx_undo_t*
+ulint
trx_undo_assign_undo(
/*=================*/
- /* out: the undo log, NULL if did not succeed: out of
- space */
- trx_t* trx, /* in: transaction */
- ulint type); /* in: TRX_UNDO_INSERT or TRX_UNDO_UPDATE */
+ /* out: DB_SUCCESS if undo log assign
+ * successful, possible error codes are:
+ * ER_TOO_MANY_CONCURRENT_TRXS
+ * DB_OUT_OF_FILE_SPAC
+ * DB_OUT_OF_MEMORY */
+ trx_t* trx, /* in: transaction */
+ ulint type); /* in: TRX_UNDO_INSERT or TRX_UNDO_UPDATE */
/**********************************************************************
Sets the state of the undo log segment at a transaction finish. */
diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i
index 957baa0391f..ba8e6e56219 100644
--- a/storage/innobase/include/univ.i
+++ b/storage/innobase/include/univ.i
@@ -83,6 +83,8 @@ memory is read outside the allocated blocks. */
/* Make a non-inline debug version */
#if 0
+#define UNIV_DEBUG_VALGRIND /* Enable extra
+ Valgrind instrumentation */
#define UNIV_DEBUG /* Enable ut_ad() assertions */
#define UNIV_LIST_DEBUG /* debug UT_LIST_ macros */
#define UNIV_MEM_DEBUG /* detect memory leaks etc */
@@ -214,6 +216,8 @@ typedef __int64 ib_longlong;
typedef longlong ib_longlong;
#endif
+typedef unsigned long long int ullint;
+
#ifndef __WIN__
#if SIZEOF_LONG != SIZEOF_VOIDP
#error "Error: InnoDB's ulint must be of the same size as void*"
@@ -298,5 +302,17 @@ typedef void* os_thread_ret_t;
#include "ut0dbg.h"
#include "ut0ut.h"
#include "db0err.h"
+#ifdef UNIV_DEBUG_VALGRIND
+# include <valgrind/memcheck.h>
+# define UNIV_MEM_VALID(addr, size) VALGRIND_MAKE_MEM_DEFINED(addr, size)
+# define UNIV_MEM_INVALID(addr, size) VALGRIND_MAKE_MEM_UNDEFINED(addr, size)
+# define UNIV_MEM_FREE(addr, size) VALGRIND_MAKE_MEM_NOACCESS(addr, size)
+# define UNIV_MEM_ALLOC(addr, size) VALGRIND_MAKE_MEM_UNDEFINED(addr, size)
+#else
+# define UNIV_MEM_VALID(addr, size) do {} while(0)
+# define UNIV_MEM_INVALID(addr, size) do {} while(0)
+# define UNIV_MEM_FREE(addr, size) do {} while(0)
+# define UNIV_MEM_ALLOC(addr, size) do {} while(0)
+#endif
#endif
diff --git a/storage/innobase/include/ut0mem.h b/storage/innobase/include/ut0mem.h
index 90c16f4fad5..e56895bc142 100644
--- a/storage/innobase/include/ut0mem.h
+++ b/storage/innobase/include/ut0mem.h
@@ -63,7 +63,7 @@ ut_test_malloc(
/* out: TRUE if succeeded */
ulint n); /* in: try to allocate this many bytes */
/**************************************************************************
-Frees a memory bloock allocated with ut_malloc. */
+Frees a memory block allocated with ut_malloc. */
void
ut_free(
diff --git a/storage/innobase/include/ut0ut.h b/storage/innobase/include/ut0ut.h
index 8bfc1edd323..825c10d5f11 100644
--- a/storage/innobase/include/ut0ut.h
+++ b/storage/innobase/include/ut0ut.h
@@ -121,6 +121,11 @@ ut_2_power_up(
/* out: first power of 2 which is >= n */
ulint n) /* in: number != 0 */
__attribute__((const));
+
+/* Determine how many bytes (groups of 8 bits) are needed to
+store the given number of bits. */
+#define UT_BITS_IN_BYTES(b) (((b) + 7) / 8)
+
/****************************************************************
Sort function for ulint arrays. */
diff --git a/storage/innobase/lock/Makefile.am b/storage/innobase/lock/Makefile.am
deleted file mode 100644
index 4c6caa49853..00000000000
--- a/storage/innobase/lock/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = liblock.a
-
-liblock_a_SOURCES = lock0lock.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/lock/lock0iter.c b/storage/innobase/lock/lock0iter.c
new file mode 100644
index 00000000000..0afa7019c86
--- /dev/null
+++ b/storage/innobase/lock/lock0iter.c
@@ -0,0 +1,90 @@
+/******************************************************
+Lock queue iterator. Can iterate over table and record
+lock queues.
+
+(c) 2007 Innobase Oy
+
+Created July 16, 2007 Vasil Dimov
+*******************************************************/
+
+#define LOCK_MODULE_IMPLEMENTATION
+
+#include "univ.i"
+#include "lock0iter.h"
+#include "lock0lock.h"
+#include "lock0priv.h"
+#include "ut0dbg.h"
+#include "ut0lst.h"
+
+/***********************************************************************
+Initialize lock queue iterator so that it starts to iterate from
+"lock". bit_no specifies the record number within the heap where the
+record is stored. It can be undefined (ULINT_UNDEFINED) in two cases:
+1. If the lock is a table lock, thus we have a table lock queue;
+2. If the lock is a record lock and it is a wait lock. In this case
+ bit_no is calculated in this function by using
+ lock_rec_find_set_bit(). There is exactly one bit set in the bitmap
+ of a wait lock. */
+
+void
+lock_queue_iterator_reset(
+/*======================*/
+ lock_queue_iterator_t* iter, /* out: iterator */
+ lock_t* lock, /* in: lock to start from */
+ ulint bit_no) /* in: record number in the
+ heap */
+{
+ iter->current_lock = lock;
+
+ if (bit_no != ULINT_UNDEFINED) {
+
+ iter->bit_no = bit_no;
+ } else {
+
+ switch (lock_get_type(lock)) {
+ case LOCK_TABLE:
+ iter->bit_no = ULINT_UNDEFINED;
+ break;
+ case LOCK_REC:
+ iter->bit_no = lock_rec_find_set_bit(lock);
+ ut_a(iter->bit_no != ULINT_UNDEFINED);
+ break;
+ default:
+ ut_error;
+ }
+ }
+}
+
+/***********************************************************************
+Gets the previous lock in the lock queue, returns NULL if there are no
+more locks (i.e. the current lock is the first one). The iterator is
+receded (if not-NULL is returned). */
+
+lock_t*
+lock_queue_iterator_get_prev(
+/*=========================*/
+ /* out: previous lock or NULL */
+ lock_queue_iterator_t* iter) /* in/out: iterator */
+{
+ lock_t* prev_lock;
+
+ switch (lock_get_type(iter->current_lock)) {
+ case LOCK_REC:
+ prev_lock = lock_rec_get_prev(
+ iter->current_lock, iter->bit_no);
+ break;
+ case LOCK_TABLE:
+ prev_lock = UT_LIST_GET_PREV(
+ un_member.tab_lock.locks, iter->current_lock);
+ break;
+ default:
+ ut_error;
+ }
+
+ if (prev_lock != NULL) {
+
+ iter->current_lock = prev_lock;
+ }
+
+ return(prev_lock);
+}
diff --git a/storage/innobase/lock/lock0lock.c b/storage/innobase/lock/lock0lock.c
index 93a43d9a30f..39cbf83e58e 100644
--- a/storage/innobase/lock/lock0lock.c
+++ b/storage/innobase/lock/lock0lock.c
@@ -6,10 +6,14 @@ The transaction lock system
Created 5/7/1996 Heikki Tuuri
*******************************************************/
+#define LOCK_MODULE_IMPLEMENTATION
+
#include "lock0lock.h"
+#include "lock0priv.h"
#ifdef UNIV_NONINL
#include "lock0lock.ic"
+#include "lock0priv.ic"
#endif
#include "usr0sess.h"
@@ -319,42 +323,6 @@ ibool lock_print_waits = FALSE;
/* The lock system */
lock_sys_t* lock_sys = NULL;
-/* A table lock */
-typedef struct lock_table_struct lock_table_t;
-struct lock_table_struct{
- dict_table_t* table; /* database table in dictionary cache */
- UT_LIST_NODE_T(lock_t)
- locks; /* list of locks on the same table */
-};
-
-/* Record lock for a page */
-typedef struct lock_rec_struct lock_rec_t;
-struct lock_rec_struct{
- ulint space; /* space id */
- ulint page_no; /* page number */
- ulint n_bits; /* number of bits in the lock bitmap */
- /* NOTE: the lock bitmap is placed immediately
- after the lock struct */
-};
-
-/* Lock struct */
-struct lock_struct{
- trx_t* trx; /* transaction owning the lock */
- UT_LIST_NODE_T(lock_t)
- trx_locks; /* list of the locks of the
- transaction */
- ulint type_mode; /* lock type, mode, LOCK_GAP or
- LOCK_REC_NOT_GAP,
- LOCK_INSERT_INTENTION,
- wait flag, ORed */
- hash_node_t hash; /* hash chain node for a record lock */
- dict_index_t* index; /* index for a record lock */
- union {
- lock_table_t tab_lock;/* table lock */
- lock_rec_t rec_lock;/* record lock */
- } un_member;
-};
-
/* We store info on the latest deadlock error to this buffer. InnoDB
Monitor will then fetch it and print */
ibool lock_deadlock_found = FALSE;
@@ -401,20 +369,6 @@ lock_deadlock_recursive(
return LOCK_VICTIM_IS_START */
/*************************************************************************
-Gets the type of a lock. */
-UNIV_INLINE
-ulint
-lock_get_type(
-/*==========*/
- /* out: LOCK_TABLE or LOCK_REC */
- lock_t* lock) /* in: lock */
-{
- ut_ad(lock);
-
- return(lock->type_mode & LOCK_TYPE_MASK);
-}
-
-/*************************************************************************
Gets the nth bit of a record lock. */
UNIV_INLINE
ibool
@@ -611,8 +565,8 @@ UNIV_INLINE
ulint
lock_get_mode(
/*==========*/
- /* out: mode */
- lock_t* lock) /* in: lock */
+ /* out: mode */
+ const lock_t* lock) /* in: lock */
{
ut_ad(lock);
@@ -1017,7 +971,7 @@ lock_rec_has_to_wait(
/*************************************************************************
Checks if a lock request lock1 has to wait for request lock2. */
-static
+
ibool
lock_has_to_wait(
/*=============*/
@@ -1098,7 +1052,7 @@ lock_rec_set_nth_bit(
/**************************************************************************
Looks for a set bit in a record lock bitmap. Returns ULINT_UNDEFINED,
if none found. */
-static
+
ulint
lock_rec_find_set_bit(
/*==================*/
@@ -1390,7 +1344,7 @@ lock_rec_copy(
/*************************************************************************
Gets the previous record lock set on a record. */
-static
+
lock_t*
lock_rec_get_prev(
/*==============*/
@@ -3174,7 +3128,8 @@ lock_deadlock_occurs(
ulint ret;
ulint cost = 0;
- ut_ad(trx && lock);
+ ut_ad(trx);
+ ut_ad(lock);
ut_ad(mutex_own(&kernel_mutex));
retry:
/* We check that adding this trx to the waits-for graph
@@ -3246,7 +3201,9 @@ lock_deadlock_recursive(
trx_t* lock_trx;
ulint ret;
- ut_a(trx && start && wait_lock);
+ ut_a(trx);
+ ut_a(start);
+ ut_a(wait_lock);
ut_ad(mutex_own(&kernel_mutex));
if (trx->deadlock_mark == 1) {
@@ -3357,8 +3314,8 @@ lock_deadlock_recursive(
return(LOCK_VICTIM_IS_START);
}
- if (ut_dulint_cmp(wait_lock->trx->undo_no,
- start->undo_no) >= 0) {
+ if (trx_weight_cmp(wait_lock->trx,
+ start) >= 0) {
/* Our recursion starting point
transaction is 'smaller', let us
choose 'start' as the victim and roll
@@ -3429,6 +3386,10 @@ lock_table_create(
ut_ad(table && trx);
ut_ad(mutex_own(&kernel_mutex));
+ if ((type_mode & LOCK_MODE_MASK) == LOCK_AUTO_INC) {
+ ++table->n_waiting_or_granted_auto_inc_locks;
+ }
+
if (type_mode == LOCK_AUTO_INC) {
/* Only one trx can have the lock on the table
at a time: we may use the memory preallocated
@@ -3479,6 +3440,9 @@ lock_table_remove_low(
if (lock == trx->auto_inc_lock) {
trx->auto_inc_lock = NULL;
+
+ ut_a(table->n_waiting_or_granted_auto_inc_locks > 0);
+ --table->n_waiting_or_granted_auto_inc_locks;
}
UT_LIST_REMOVE(trx_locks, trx->trx_locks, lock);
@@ -4423,12 +4387,9 @@ lock_table_queue_validate(
dict_table_t* table) /* in: table */
{
lock_t* lock;
- ibool is_waiting;
ut_ad(mutex_own(&kernel_mutex));
- is_waiting = FALSE;
-
lock = UT_LIST_GET_FIRST(table->locks);
while (lock) {
@@ -4438,13 +4399,10 @@ lock_table_queue_validate(
if (!lock_get_wait(lock)) {
- ut_a(!is_waiting);
-
ut_a(!lock_table_other_has_incompatible(
lock->trx, 0, table,
lock_get_mode(lock)));
} else {
- is_waiting = TRUE;
ut_a(lock_table_has_to_wait_in_queue(lock));
}
diff --git a/storage/innobase/log/Makefile.am b/storage/innobase/log/Makefile.am
deleted file mode 100644
index a40572a64da..00000000000
--- a/storage/innobase/log/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = liblog.a
-
-liblog_a_SOURCES = log0log.c log0recv.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/log/log0log.c b/storage/innobase/log/log0log.c
index e9dedf6aac4..b10c348b24d 100644
--- a/storage/innobase/log/log0log.c
+++ b/storage/innobase/log/log0log.c
@@ -3039,10 +3039,22 @@ loop:
mutex_enter(&kernel_mutex);
- /* Check that there are no longer transactions. We need this wait
- even for the 'very fast' shutdown, because the InnoDB layer may have
- committed or prepared transactions and we don't want to lose
- them. */
+ /* We need the monitor threads to stop before we proceed with a
+ normal shutdown. In case of very fast shutdown, however, we can
+ proceed without waiting for monitor threads. */
+
+ if (srv_fast_shutdown < 2
+ && (srv_error_monitor_active
+ || srv_lock_timeout_and_monitor_active)) {
+
+ mutex_exit(&kernel_mutex);
+
+ goto loop;
+ }
+
+ /* Check that there are no longer transactions. We need this wait even
+ for the 'very fast' shutdown, because the InnoDB layer may have
+ committed or prepared transactions and we don't want to lose them. */
if (trx_n_mysql_transactions > 0
|| UT_LIST_GET_LEN(trx_sys->trx_list) > 0) {
@@ -3163,22 +3175,8 @@ loop:
goto loop;
}
- /* The lock timeout thread should now have exited */
-
- if (srv_lock_timeout_and_monitor_active) {
-
- goto loop;
- }
-
- /* We now let also the InnoDB error monitor thread to exit */
-
srv_shutdown_state = SRV_SHUTDOWN_LAST_PHASE;
- if (srv_error_monitor_active) {
-
- goto loop;
- }
-
/* Make some checks that the server really is quiet */
ut_a(srv_n_threads_active[SRV_MASTER] == 0);
ut_a(buf_all_freed());
diff --git a/storage/innobase/log/log0recv.c b/storage/innobase/log/log0recv.c
index ab5f42e3a13..aef58b7b576 100644
--- a/storage/innobase/log/log0recv.c
+++ b/storage/innobase/log/log0recv.c
@@ -57,6 +57,16 @@ ibool recv_needed_recovery = FALSE;
ibool recv_lsn_checks_on = FALSE;
+/* There are two conditions under which we scan the logs, the first
+is normal startup and the second is when we do a recovery from an
+archive.
+This flag is set if we are doing a scan from the last checkpoint during
+startup. If we find log entries that were written after the last checkpoint
+we know that the server was not cleanly shutdown. We must then initialize
+the crash recovery environment before attempting to store these entries in
+the log hash table. */
+ibool recv_log_scan_is_startup_type = FALSE;
+
/* If the following is TRUE, the buffer pool file pages must be invalidated
after recovery and no ibuf operations are allowed; this becomes TRUE if
the log record hash table becomes too full, and log records must be merged
@@ -99,6 +109,16 @@ the recovery failed and the database may be corrupt. */
dulint recv_max_page_lsn;
+/* prototypes */
+
+/***********************************************************
+Initialize crash recovery environment. Can be called iff
+recv_needed_recovery == FALSE. */
+static
+void
+recv_init_crash_recovery(void);
+/*===========================*/
+
/************************************************************
Creates the recovery system. */
@@ -2284,6 +2304,23 @@ recv_scan_log_recs(
if (ut_dulint_cmp(scanned_lsn, recv_sys->scanned_lsn) > 0) {
+ /* We have found more entries. If this scan is
+ of startup type, we must initiate crash recovery
+ environment before parsing these log records. */
+
+ if (recv_log_scan_is_startup_type
+ && !recv_needed_recovery) {
+
+ fprintf(stderr,
+ "InnoDB: Log scan progressed"
+ " past the checkpoint lsn %lu %lu\n",
+ (ulong) ut_dulint_get_high(
+ recv_sys->scanned_lsn),
+ (ulong) ut_dulint_get_low(
+ recv_sys->scanned_lsn));
+ recv_init_crash_recovery();
+ }
+
/* We were able to find more log data: add it to the
parsing buffer if parse_start_lsn is already
non-zero */
@@ -2405,6 +2442,47 @@ recv_group_scan_log_recs(
#endif /* UNIV_DEBUG */
}
+/***********************************************************
+Initialize crash recovery environment. Can be called iff
+recv_needed_recovery == FALSE. */
+static
+void
+recv_init_crash_recovery(void)
+/*==========================*/
+{
+ ut_a(!recv_needed_recovery);
+
+ recv_needed_recovery = TRUE;
+
+ ut_print_timestamp(stderr);
+
+ fprintf(stderr,
+ " InnoDB: Database was not"
+ " shut down normally!\n"
+ "InnoDB: Starting crash recovery.\n");
+
+ fprintf(stderr,
+ "InnoDB: Reading tablespace information"
+ " from the .ibd files...\n");
+
+ fil_load_single_table_tablespaces();
+
+ /* If we are using the doublewrite method, we will
+ check if there are half-written pages in data files,
+ and restore them from the doublewrite buffer if
+ possible */
+
+ if (srv_force_recovery < SRV_FORCE_NO_LOG_REDO) {
+
+ fprintf(stderr,
+ "InnoDB: Restoring possible"
+ " half-written data pages from"
+ " the doublewrite\n"
+ "InnoDB: buffer...\n");
+ trx_sys_doublewrite_init_or_restore_pages(TRUE);
+ }
+}
+
/************************************************************
Recovers from a checkpoint. When this function returns, the database is able
to start processing of new user transactions, but the function
@@ -2532,92 +2610,6 @@ recv_recovery_from_checkpoint_start(
recv_sys->recovered_lsn = checkpoint_lsn;
srv_start_lsn = checkpoint_lsn;
-
- /* NOTE: we always do a 'recovery' at startup, but only if
- there is something wrong we will print a message to the
- user about recovery: */
-
- if (ut_dulint_cmp(checkpoint_lsn, max_flushed_lsn) != 0
- || ut_dulint_cmp(checkpoint_lsn, min_flushed_lsn) != 0) {
-
- if (ut_dulint_cmp(checkpoint_lsn, max_flushed_lsn)
- < 0) {
- fprintf(stderr,
- "InnoDB: #########################"
- "#################################\n"
- "InnoDB: "
- "WARNING!\n"
- "InnoDB: The log sequence number"
- " in ibdata files is higher\n"
- "InnoDB: than the log sequence number"
- " in the ib_logfiles! Are you sure\n"
- "InnoDB: you are using the right"
- " ib_logfiles to start up"
- " the database?\n"
- "InnoDB: Log sequence number in"
- " ib_logfiles is %lu %lu, log\n"
- "InnoDB: sequence numbers stamped"
- " to ibdata file headers are between\n"
- "InnoDB: %lu %lu and %lu %lu.\n"
- "InnoDB: #########################"
- "#################################\n",
- (ulong) ut_dulint_get_high(
- checkpoint_lsn),
- (ulong) ut_dulint_get_low(
- checkpoint_lsn),
- (ulong) ut_dulint_get_high(
- min_flushed_lsn),
- (ulong) ut_dulint_get_low(
- min_flushed_lsn),
- (ulong) ut_dulint_get_high(
- max_flushed_lsn),
- (ulong) ut_dulint_get_low(
- max_flushed_lsn));
- }
-
- recv_needed_recovery = TRUE;
-
- ut_print_timestamp(stderr);
-
- fprintf(stderr,
- " InnoDB: Database was not"
- " shut down normally!\n"
- "InnoDB: Starting crash recovery.\n");
-
- fprintf(stderr,
- "InnoDB: Reading tablespace information"
- " from the .ibd files...\n");
-
- fil_load_single_table_tablespaces();
-
- /* If we are using the doublewrite method, we will
- check if there are half-written pages in data files,
- and restore them from the doublewrite buffer if
- possible */
-
- if (srv_force_recovery < SRV_FORCE_NO_LOG_REDO) {
-
- fprintf(stderr,
- "InnoDB: Restoring possible"
- " half-written data pages from"
- " the doublewrite\n"
- "InnoDB: buffer...\n");
- trx_sys_doublewrite_init_or_restore_pages(
- TRUE);
- }
-
- ut_print_timestamp(stderr);
-
- fprintf(stderr,
- " InnoDB: Starting log scan"
- " based on checkpoint at\n"
- "InnoDB: log sequence number %lu %lu.\n",
- (ulong) ut_dulint_get_high(checkpoint_lsn),
- (ulong) ut_dulint_get_low(checkpoint_lsn));
- } else {
- /* Init the doublewrite buffer memory structure */
- trx_sys_doublewrite_init_or_restore_pages(FALSE);
- }
}
contiguous_lsn = ut_dulint_align_down(recv_sys->scanned_lsn,
@@ -2670,6 +2662,8 @@ recv_recovery_from_checkpoint_start(
group = UT_LIST_GET_NEXT(log_groups, group);
}
+ /* Set the flag to publish that we are doing startup scan. */
+ recv_log_scan_is_startup_type = (type == LOG_CHECKPOINT);
while (group) {
old_scanned_lsn = recv_sys->scanned_lsn;
@@ -2691,6 +2685,69 @@ recv_recovery_from_checkpoint_start(
group = UT_LIST_GET_NEXT(log_groups, group);
}
+ /* Done with startup scan. Clear the flag. */
+ recv_log_scan_is_startup_type = FALSE;
+ if (type == LOG_CHECKPOINT) {
+ /* NOTE: we always do a 'recovery' at startup, but only if
+ there is something wrong we will print a message to the
+ user about recovery: */
+
+ if (ut_dulint_cmp(checkpoint_lsn, max_flushed_lsn) != 0
+ || ut_dulint_cmp(checkpoint_lsn, min_flushed_lsn) != 0) {
+
+ if (ut_dulint_cmp(checkpoint_lsn, max_flushed_lsn)
+ < 0) {
+ fprintf(stderr,
+ "InnoDB: #########################"
+ "#################################\n"
+ "InnoDB: "
+ "WARNING!\n"
+ "InnoDB: The log sequence number"
+ " in ibdata files is higher\n"
+ "InnoDB: than the log sequence number"
+ " in the ib_logfiles! Are you sure\n"
+ "InnoDB: you are using the right"
+ " ib_logfiles to start up"
+ " the database?\n"
+ "InnoDB: Log sequence number in"
+ " ib_logfiles is %lu %lu, log\n"
+ "InnoDB: sequence numbers stamped"
+ " to ibdata file headers are between\n"
+ "InnoDB: %lu %lu and %lu %lu.\n"
+ "InnoDB: #########################"
+ "#################################\n",
+ (ulong) ut_dulint_get_high(
+ checkpoint_lsn),
+ (ulong) ut_dulint_get_low(
+ checkpoint_lsn),
+ (ulong) ut_dulint_get_high(
+ min_flushed_lsn),
+ (ulong) ut_dulint_get_low(
+ min_flushed_lsn),
+ (ulong) ut_dulint_get_high(
+ max_flushed_lsn),
+ (ulong) ut_dulint_get_low(
+ max_flushed_lsn));
+
+
+ }
+
+ if (!recv_needed_recovery) {
+ fprintf(stderr,
+ "InnoDB: The log sequence number"
+ " in ibdata files does not match\n"
+ "InnoDB: the log sequence number"
+ " in the ib_logfiles!\n");
+ recv_init_crash_recovery();
+ }
+
+ }
+ if (!recv_needed_recovery) {
+ /* Init the doublewrite buffer memory structure */
+ trx_sys_doublewrite_init_or_restore_pages(FALSE);
+ }
+ }
+
/* We currently have only one log group */
if (ut_dulint_cmp(group_scanned_lsn, checkpoint_lsn) < 0) {
ut_print_timestamp(stderr);
@@ -2747,20 +2804,9 @@ recv_recovery_from_checkpoint_start(
recv_synchronize_groups(up_to_date_group);
if (!recv_needed_recovery) {
- if (ut_dulint_cmp(checkpoint_lsn, recv_sys->recovered_lsn)
- != 0) {
- fprintf(stderr,
- "InnoDB: Warning: we did not need to do"
- " crash recovery, but log scan\n"
- "InnoDB: progressed past the checkpoint"
- " lsn %lu %lu up to lsn %lu %lu\n",
- (ulong) ut_dulint_get_high(checkpoint_lsn),
- (ulong) ut_dulint_get_low(checkpoint_lsn),
- (ulong) ut_dulint_get_high(
- recv_sys->recovered_lsn),
- (ulong) ut_dulint_get_low(
- recv_sys->recovered_lsn));
- }
+ ut_a(ut_dulint_cmp(checkpoint_lsn,
+ recv_sys->recovered_lsn) == 0);
+
} else {
srv_start_lsn = recv_sys->recovered_lsn;
}
diff --git a/storage/innobase/mach/Makefile.am b/storage/innobase/mach/Makefile.am
deleted file mode 100644
index 1a59cb3e4d7..00000000000
--- a/storage/innobase/mach/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = libmach.a
-
-libmach_a_SOURCES = mach0data.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/mem/Makefile.am b/storage/innobase/mem/Makefile.am
deleted file mode 100644
index 598dbb96124..00000000000
--- a/storage/innobase/mem/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = libmem.a
-
-libmem_a_SOURCES = mem0mem.c mem0pool.c
-
-EXTRA_DIST = mem0dbg.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/mem/mem0mem.c b/storage/innobase/mem/mem0mem.c
index 10b359e8e67..d89a3a55d88 100644
--- a/storage/innobase/mem/mem0mem.c
+++ b/storage/innobase/mem/mem0mem.c
@@ -514,6 +514,7 @@ mem_heap_block_free(
mem_erase_buf((byte*)block, len);
#endif
+ UNIV_MEM_FREE(block, len);
if (init_block) {
/* Do not have to free: do nothing */
diff --git a/storage/innobase/mem/mem0pool.c b/storage/innobase/mem/mem0pool.c
index c010ae61160..27da86a0309 100644
--- a/storage/innobase/mem/mem0pool.c
+++ b/storage/innobase/mem/mem0pool.c
@@ -229,6 +229,8 @@ mem_pool_create(
mem_area_set_size(area, ut_2_exp(i));
mem_area_set_free(area, TRUE);
+ UNIV_MEM_FREE(MEM_AREA_EXTRA_SIZE + (byte*) area,
+ ut_2_exp(i) - MEM_AREA_EXTRA_SIZE);
UT_LIST_ADD_FIRST(free_list, pool->free_list[i], area);
@@ -300,6 +302,7 @@ mem_pool_fill_free_list(
UT_LIST_REMOVE(free_list, pool->free_list[i + 1], area);
area2 = (mem_area_t*)(((byte*)area) + ut_2_exp(i));
+ UNIV_MEM_ALLOC(area2, MEM_AREA_EXTRA_SIZE);
mem_area_set_size(area2, ut_2_exp(i));
mem_area_set_free(area2, TRUE);
@@ -400,6 +403,8 @@ mem_area_alloc(
mutex_exit(&(pool->mutex));
ut_ad(mem_pool_validate(pool));
+ UNIV_MEM_ALLOC(MEM_AREA_EXTRA_SIZE + (byte*)area,
+ ut_2_exp(n) - MEM_AREA_EXTRA_SIZE);
return((void*)(MEM_AREA_EXTRA_SIZE + ((byte*)area)));
}
@@ -482,6 +487,7 @@ mem_area_free(
}
size = mem_area_get_size(area);
+ UNIV_MEM_FREE(ptr, size - MEM_AREA_EXTRA_SIZE);
if (size == 0) {
fprintf(stderr,
diff --git a/storage/innobase/mtr/Makefile.am b/storage/innobase/mtr/Makefile.am
deleted file mode 100644
index 80eb7c907be..00000000000
--- a/storage/innobase/mtr/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = libmtr.a
-
-libmtr_a_SOURCES = mtr0mtr.c mtr0log.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/mtr/mtr0log.c b/storage/innobase/mtr/mtr0log.c
index f9704dc2d20..e5d572bbfa7 100644
--- a/storage/innobase/mtr/mtr0log.c
+++ b/storage/innobase/mtr/mtr0log.c
@@ -517,8 +517,9 @@ mlog_parse_index(
n = mach_read_from_2(ptr);
ptr += 2;
n_uniq = mach_read_from_2(ptr);
+ ptr += 2;
ut_ad(n_uniq <= n);
- if (end_ptr < ptr + (n + 1) * 2) {
+ if (end_ptr < ptr + n * 2) {
return(NULL);
}
} else {
@@ -531,18 +532,18 @@ mlog_parse_index(
ind->table = table;
ind->n_uniq = (unsigned int) n_uniq;
if (n_uniq != n) {
+ ut_a(n_uniq + DATA_ROLL_PTR <= n);
ind->type = DICT_CLUSTERED;
}
- /* avoid ut_ad(index->cached) in dict_index_get_n_unique_in_tree */
- ind->cached = TRUE;
if (comp) {
for (i = 0; i < n; i++) {
- ulint len = mach_read_from_2(ptr += 2);
+ ulint len = mach_read_from_2(ptr);
+ ptr += 2;
/* The high-order bit of len is the NOT NULL flag;
the rest is 0 or 0x7fff for variable-length fields,
and 1..0x7ffe for fixed-length fields. */
dict_mem_table_add_col(
- table, "DUMMY",
+ table, NULL, NULL,
((len + 1) & 0x7fff) <= 1
? DATA_BINARY : DATA_FIXBINARY,
len & 0x8000 ? DATA_NOT_NULL : 0,
@@ -552,8 +553,23 @@ mlog_parse_index(
dict_table_get_nth_col(table, i),
0);
}
- ptr += 2;
+ dict_table_add_system_columns(table, table->heap);
+ if (n_uniq != n) {
+ /* Identify DB_TRX_ID and DB_ROLL_PTR in the index. */
+ ut_a(DATA_TRX_ID_LEN
+ == dict_index_get_nth_col(ind, DATA_TRX_ID - 1
+ + n_uniq)->len);
+ ut_a(DATA_ROLL_PTR_LEN
+ == dict_index_get_nth_col(ind, DATA_ROLL_PTR - 1
+ + n_uniq)->len);
+ ind->fields[DATA_TRX_ID - 1 + n_uniq].col
+ = &table->cols[n + DATA_TRX_ID];
+ ind->fields[DATA_ROLL_PTR - 1 + n_uniq].col
+ = &table->cols[n + DATA_ROLL_PTR];
+ }
}
+ /* avoid ut_ad(index->cached) in dict_index_get_n_unique_in_tree */
+ ind->cached = TRUE;
*index = ind;
return(ptr);
}
diff --git a/storage/innobase/os/Makefile.am b/storage/innobase/os/Makefile.am
deleted file mode 100644
index d5c45eba54e..00000000000
--- a/storage/innobase/os/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003-2004 MySQL AB & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = libos.a
-
-libos_a_SOURCES = os0proc.c os0sync.c os0thread.c os0file.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c
index c18ba047d4e..78140cc5ecf 100644
--- a/storage/innobase/os/os0file.c
+++ b/storage/innobase/os/os0file.c
@@ -250,6 +250,15 @@ os_file_get_last_error(
"InnoDB: the directory. It may also be"
" you have created a subdirectory\n"
"InnoDB: of the same name as a data file.\n");
+ } else if (err == ERROR_SHARING_VIOLATION
+ || err == ERROR_LOCK_VIOLATION) {
+ fprintf(stderr,
+ "InnoDB: The error means that another program"
+ " is using InnoDB's files.\n"
+ "InnoDB: This might be a backup or antivirus"
+ " software or another instance\n"
+ "InnoDB: of MySQL."
+ " Please close it to get rid of this error.\n");
} else {
fprintf(stderr,
"InnoDB: Some operating system error numbers"
@@ -268,6 +277,9 @@ os_file_get_last_error(
return(OS_FILE_DISK_FULL);
} else if (err == ERROR_FILE_EXISTS) {
return(OS_FILE_ALREADY_EXISTS);
+ } else if (err == ERROR_SHARING_VIOLATION
+ || err == ERROR_LOCK_VIOLATION) {
+ return(OS_FILE_SHARING_VIOLATION);
} else {
return(100 + err);
}
@@ -388,6 +400,10 @@ os_file_handle_error_cond_exit(
|| err == OS_FILE_PATH_ERROR) {
return(FALSE);
+ } else if (err == OS_FILE_SHARING_VIOLATION) {
+
+ os_thread_sleep(10000000); /* 10 sec */
+ return(TRUE);
} else {
if (name) {
fprintf(stderr, "InnoDB: File name %s\n", name);
@@ -440,10 +456,9 @@ os_file_handle_error_no_exit(
#undef USE_FILE_LOCK
#define USE_FILE_LOCK
-#if defined(UNIV_HOTBACKUP) || defined(__WIN__) || defined(__FreeBSD__) || defined(__NETWARE__)
+#if defined(UNIV_HOTBACKUP) || defined(__WIN__) || defined(__NETWARE__)
/* InnoDB Hot Backup does not lock the data files.
* On Windows, mandatory locking is used.
- * On FreeBSD with LinuxThreads, advisory locking does not work properly.
*/
# undef USE_FILE_LOCK
#endif
diff --git a/storage/innobase/page/Makefile.am b/storage/innobase/page/Makefile.am
deleted file mode 100644
index 1a5b202a2c9..00000000000
--- a/storage/innobase/page/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = libpage.a
-
-libpage_a_SOURCES = page0page.c page0cur.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/page/page0page.c b/storage/innobase/page/page0page.c
index 4212df7a631..543cf9e34eb 100644
--- a/storage/innobase/page/page0page.c
+++ b/storage/innobase/page/page0page.c
@@ -209,6 +209,18 @@ page_set_max_trx_id(
}
}
+/*****************************************************************
+Calculates free space if a page is emptied. */
+
+ulint
+page_get_free_space_of_empty_noninline(
+/*===================================*/
+ /* out: free space */
+ ulint comp) /* in: nonzero=compact page format */
+{
+ return(page_get_free_space_of_empty(comp));
+}
+
/****************************************************************
Allocates a block of memory from an index page. */
diff --git a/storage/innobase/pars/Makefile.am b/storage/innobase/pars/Makefile.am
deleted file mode 100644
index b10796c3d5e..00000000000
--- a/storage/innobase/pars/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = libpars.a
-
-noinst_HEADERS = pars0grm.h
-
-libpars_a_SOURCES = pars0grm.c lexyy.c pars0opt.c pars0pars.c pars0sym.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/pars/pars0pars.c b/storage/innobase/pars/pars0pars.c
index 16530494a96..89f6f862995 100644
--- a/storage/innobase/pars/pars0pars.c
+++ b/storage/innobase/pars/pars0pars.c
@@ -1640,7 +1640,8 @@ pars_create_table(
while (column) {
dtype = dfield_get_type(que_node_get_val(column));
- dict_mem_table_add_col(table, column->name, dtype->mtype,
+ dict_mem_table_add_col(table, table->heap,
+ column->name, dtype->mtype,
dtype->prtype, dtype->len);
column->resolved = TRUE;
column->token_type = SYM_COLUMN;
diff --git a/storage/innobase/plug.in b/storage/innobase/plug.in
index 59634523399..b252d471fba 100644
--- a/storage/innobase/plug.in
+++ b/storage/innobase/plug.in
@@ -2,13 +2,10 @@ MYSQL_STORAGE_ENGINE(innobase, innodb, [InnoDB Storage Engine],
[Transactional Tables using InnoDB], [max,max-no-ndb])
MYSQL_PLUGIN_DIRECTORY(innobase, [storage/innobase])
MYSQL_PLUGIN_STATIC(innobase, [libinnobase.a])
+MYSQL_PLUGIN_DYNAMIC(innobase, [ha_innodb.la])
MYSQL_PLUGIN_ACTIONS(innobase, [
AC_CHECK_LIB(rt, aio_read, [innodb_system_libs="-lrt"])
AC_SUBST(innodb_system_libs)
- AC_PROG_CC
- AC_PROG_RANLIB
- AC_PROG_INSTALL
- AC_PROG_LIBTOOL
AC_CHECK_HEADERS(aio.h sched.h)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)
@@ -38,37 +35,5 @@ MYSQL_PLUGIN_ACTIONS(innobase, [
openbsd*)
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
esac
- AC_CONFIG_FILES(
- storage/innobase/ut/Makefile
- storage/innobase/btr/Makefile
- storage/innobase/buf/Makefile
- storage/innobase/data/Makefile
- storage/innobase/dict/Makefile
- storage/innobase/dyn/Makefile
- storage/innobase/eval/Makefile
- storage/innobase/fil/Makefile
- storage/innobase/fsp/Makefile
- storage/innobase/fut/Makefile
- storage/innobase/ha/Makefile
- storage/innobase/ibuf/Makefile
- storage/innobase/lock/Makefile
- storage/innobase/log/Makefile
- storage/innobase/mach/Makefile
- storage/innobase/mem/Makefile
- storage/innobase/mtr/Makefile
- storage/innobase/os/Makefile
- storage/innobase/page/Makefile
- storage/innobase/pars/Makefile
- storage/innobase/que/Makefile
- storage/innobase/read/Makefile
- storage/innobase/rem/Makefile
- storage/innobase/row/Makefile
- storage/innobase/srv/Makefile
- storage/innobase/sync/Makefile
- storage/innobase/thr/Makefile
- storage/innobase/trx/Makefile
- storage/innobase/handler/Makefile
- storage/innobase/usr/Makefile)
])
-MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(innobase, [handler/ha_innodb.cc])
diff --git a/storage/innobase/que/Makefile.am b/storage/innobase/que/Makefile.am
deleted file mode 100644
index 73f3fb07af4..00000000000
--- a/storage/innobase/que/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = libque.a
-
-libque_a_SOURCES = que0que.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/read/Makefile.am b/storage/innobase/read/Makefile.am
deleted file mode 100644
index 1e56a9716c3..00000000000
--- a/storage/innobase/read/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = libread.a
-
-libread_a_SOURCES = read0read.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/rem/Makefile.am b/storage/innobase/rem/Makefile.am
deleted file mode 100644
index 1026172b815..00000000000
--- a/storage/innobase/rem/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = librem.a
-
-librem_a_SOURCES = rem0rec.c rem0cmp.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/rem/rem0rec.c b/storage/innobase/rem/rem0rec.c
index 549b5ee8b28..64f8e2d319c 100644
--- a/storage/innobase/rem/rem0rec.c
+++ b/storage/innobase/rem/rem0rec.c
@@ -153,7 +153,6 @@ static
void
rec_init_offsets(
/*=============*/
- /* out: the offsets */
rec_t* rec, /* in: physical record */
dict_index_t* index, /* in: record descriptor */
ulint* offsets)/* in/out: array of offsets;
@@ -189,7 +188,7 @@ rec_init_offsets(
}
nulls = rec - (REC_N_NEW_EXTRA_BYTES + 1);
- lens = nulls - (index->n_nullable + 7) / 8;
+ lens = nulls - UT_BITS_IN_BYTES(index->n_nullable);
offs = 0;
null_mask = 1;
@@ -304,7 +303,7 @@ rec_get_offsets_func(
/* out: the new offsets */
rec_t* rec, /* in: physical record */
dict_index_t* index, /* in: record descriptor */
- ulint* offsets,/* in: array consisting of offsets[0]
+ ulint* offsets,/* in/out: array consisting of offsets[0]
allocated elements, or an array from
rec_get_offsets(), or NULL */
ulint n_fields,/* in: maximum number of initialized fields
@@ -440,7 +439,7 @@ rec_get_converted_size_new(
dtuple_t* dtuple) /* in: data tuple */
{
ulint size = REC_N_NEW_EXTRA_BYTES
- + (index->n_nullable + 7) / 8;
+ + UT_BITS_IN_BYTES(index->n_nullable);
ulint i;
ulint n_fields;
ut_ad(index && dtuple);
@@ -459,10 +458,10 @@ rec_get_converted_size_new(
break;
case REC_STATUS_INFIMUM:
case REC_STATUS_SUPREMUM:
- /* infimum or supremum record, 8 bytes */
- return(size + 8); /* no extra data needed */
+ /* infimum or supremum record, 8 data bytes */
+ return(REC_N_NEW_EXTRA_BYTES + 8);
default:
- ut_a(0);
+ ut_error;
return(ULINT_UNDEFINED);
}
@@ -476,21 +475,31 @@ rec_get_converted_size_new(
len = dtuple_get_nth_field(dtuple, i)->len;
col = dict_field_get_col(field);
- ut_ad(len != UNIV_SQL_NULL || !(col->prtype & DATA_NOT_NULL));
+ ut_ad(dict_col_type_assert_equal(
+ col, dfield_get_type(dtuple_get_nth_field(
+ dtuple, i))));
if (len == UNIV_SQL_NULL) {
/* No length is stored for NULL fields. */
+ ut_ad(!(col->prtype & DATA_NOT_NULL));
continue;
}
ut_ad(len <= col->len || col->mtype == DATA_BLOB);
- ut_ad(!field->fixed_len || len == field->fixed_len);
if (field->fixed_len) {
+ ut_ad(len == field->fixed_len);
+ /* dict_index_add_col() should guarantee this */
+ ut_ad(!field->prefix_len
+ || field->fixed_len == field->prefix_len);
} else if (len < 128
|| (col->len < 256 && col->mtype != DATA_BLOB)) {
size++;
} else {
+ /* For variable-length columns, we look up the
+ maximum length from the column itself. If this
+ is a prefix index column shorter than 256 bytes,
+ this will waste one byte. */
size += 2;
}
size += len;
@@ -586,7 +595,7 @@ rec_set_nth_field_extern_bit_new(
we do not write to log about the change */
{
byte* nulls = rec - (REC_N_NEW_EXTRA_BYTES + 1);
- byte* lens = nulls - (index->n_nullable + 7) / 8;
+ byte* lens = nulls - UT_BITS_IN_BYTES(index->n_nullable);
ulint i;
ulint n_fields;
ulint null_mask = 1;
@@ -744,7 +753,11 @@ rec_convert_dtuple_to_rec_old(
/* Calculate the offset of the origin in the physical record */
rec = buf + rec_get_converted_extra_size(data_size, n_fields);
-
+#ifdef UNIV_DEBUG
+ /* Suppress Valgrind warnings of ut_ad()
+ in mach_write_to_1(), mach_write_to_2() et al. */
+ memset(buf, 0xff, rec - buf + data_size);
+#endif /* UNIV_DEBUG */
/* Store the number of fields */
rec_set_n_fields_old(rec, n_fields);
@@ -875,7 +888,7 @@ rec_convert_dtuple_to_rec_new(
/* Calculate the offset of the origin in the physical record.
We must loop over all fields to do this. */
- rec += (index->n_nullable + 7) / 8;
+ rec += UT_BITS_IN_BYTES(index->n_nullable);
for (i = 0; i < n_fields; i++) {
if (UNIV_UNLIKELY(i == n_node_ptr_field)) {
@@ -892,6 +905,11 @@ rec_convert_dtuple_to_rec_new(
len = dfield_get_len(field);
fixed_len = dict_index_get_nth_field(index, i)->fixed_len;
+ ut_ad(dict_col_type_assert_equal(
+ dict_field_get_col(dict_index_get_nth_field(
+ index, i)),
+ dfield_get_type(field)));
+
if (!(dtype_get_prtype(type) & DATA_NOT_NULL)) {
if (len == UNIV_SQL_NULL)
continue;
@@ -915,7 +933,7 @@ rec_convert_dtuple_to_rec_new(
init:
end = rec;
nulls = rec - (REC_N_NEW_EXTRA_BYTES + 1);
- lens = nulls - (index->n_nullable + 7) / 8;
+ lens = nulls - UT_BITS_IN_BYTES(index->n_nullable);
/* clear the SQL-null flags */
memset (lens + 1, 0, nulls - lens);
@@ -1172,7 +1190,7 @@ rec_copy_prefix_to_buf(
}
nulls = rec - (REC_N_NEW_EXTRA_BYTES + 1);
- lens = nulls - (index->n_nullable + 7) / 8;
+ lens = nulls - UT_BITS_IN_BYTES(index->n_nullable);
UNIV_PREFETCH_R(lens);
prefix_len = 0;
null_mask = 1;
diff --git a/storage/innobase/row/Makefile.am b/storage/innobase/row/Makefile.am
deleted file mode 100644
index 6c1f960055d..00000000000
--- a/storage/innobase/row/Makefile.am
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = librow.a
-
-librow_a_SOURCES = row0ins.c row0mysql.c row0purge.c row0row.c row0sel.c\
- row0uins.c row0umod.c row0undo.c row0upd.c row0vers.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/row/row0ins.c b/storage/innobase/row/row0ins.c
index 1fba0abcdaf..ad14b927170 100644
--- a/storage/innobase/row/row0ins.c
+++ b/storage/innobase/row/row0ins.c
@@ -51,21 +51,6 @@ innobase_invalidate_query_cache(
ulint full_name_len); /* in: full name length where also the null
chars count */
-/**********************************************************************
-This function returns true if
-
-1) SQL-query in the current thread
-is either REPLACE or LOAD DATA INFILE REPLACE.
-
-2) SQL-query in the current thread
-is INSERT ON DUPLICATE KEY UPDATE.
-
-NOTE that /mysql/innobase/row/row0ins.c must contain the
-prototype for this function ! */
-
-ibool
-innobase_query_is_update(void);
-
/*************************************************************************
Creates an insert node struct. */
@@ -448,7 +433,11 @@ row_ins_cascade_calc_update_vec(
ulint i;
ulint j;
- ut_a(node && foreign && cascade && table && index);
+ ut_a(node);
+ ut_a(foreign);
+ ut_a(cascade);
+ ut_a(table);
+ ut_a(index);
/* Calculate the appropriate update vector which will set the fields
in the child index record to the same value (possibly padded with
@@ -791,7 +780,10 @@ row_ins_foreign_check_on_constraint(
trx_t* trx;
mem_heap_t* tmp_heap = NULL;
- ut_a(thr && foreign && pcur && mtr);
+ ut_a(thr);
+ ut_a(foreign);
+ ut_a(pcur);
+ ut_a(mtr);
trx = thr_get_trx(thr);
@@ -1308,7 +1300,8 @@ run_again:
goto exit_func;
}
- ut_a(check_table && check_index);
+ ut_a(check_table);
+ ut_a(check_index);
if (check_table != table) {
/* We already have a LOCK_IX on table, but not necessarily
@@ -1336,11 +1329,9 @@ run_again:
/* Scan index records and check if there is a matching record */
for (;;) {
- page_t* page;
rec = btr_pcur_get_rec(&pcur);
- page = buf_frame_align(rec);
- if (rec == page_get_infimum_rec(page)) {
+ if (page_rec_is_infimum(rec)) {
goto next_rec;
}
@@ -1348,7 +1339,7 @@ run_again:
offsets = rec_get_offsets(rec, check_index,
offsets, ULINT_UNDEFINED, &heap);
- if (rec == page_get_supremum_rec(page)) {
+ if (page_rec_is_supremum(rec)) {
err = row_ins_set_shared_rec_lock(
LOCK_ORDINARY, rec, check_index, offsets, thr);
@@ -1654,6 +1645,7 @@ row_ins_scan_sec_index_for_duplicate(
btr_pcur_t pcur;
ulint err = DB_SUCCESS;
ibool moved;
+ unsigned allow_duplicates;
mtr_t mtr;
mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE];
@@ -1684,12 +1676,14 @@ row_ins_scan_sec_index_for_duplicate(
btr_pcur_open(index, entry, PAGE_CUR_GE, BTR_SEARCH_LEAF, &pcur, &mtr);
+ allow_duplicates = thr_get_trx(thr)->duplicates & TRX_DUP_IGNORE;
+
/* Scan index records and check if there is a duplicate */
for (;;) {
rec = btr_pcur_get_rec(&pcur);
- if (rec == page_get_infimum_rec(buf_frame_align(rec))) {
+ if (page_rec_is_infimum(rec)) {
goto next_rec;
}
@@ -1697,7 +1691,7 @@ row_ins_scan_sec_index_for_duplicate(
offsets = rec_get_offsets(rec, index, offsets,
ULINT_UNDEFINED, &heap);
- if (innobase_query_is_update()) {
+ if (allow_duplicates) {
/* If the SQL-query will update or replace
duplicate key we will take X-lock for
@@ -1826,7 +1820,7 @@ row_ins_duplicate_error_in_clust(
sure that in roll-forward we get the same duplicate
errors as in original execution */
- if (innobase_query_is_update()) {
+ if (trx->duplicates & TRX_DUP_IGNORE) {
/* If the SQL-query will update or replace
duplicate key we will take X-lock for
@@ -1864,7 +1858,7 @@ row_ins_duplicate_error_in_clust(
offsets = rec_get_offsets(rec, cursor->index, offsets,
ULINT_UNDEFINED, &heap);
- if (innobase_query_is_update()) {
+ if (trx->duplicates & TRX_DUP_IGNORE) {
/* If the SQL-query will update or replace
duplicate key we will take X-lock for
diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c
index 7c9427db0d2..b8d201e3da2 100644
--- a/storage/innobase/row/row0mysql.c
+++ b/storage/innobase/row/row0mysql.c
@@ -476,7 +476,8 @@ handle_new_error:
/* MySQL will roll back the latest SQL statement */
} else if (err == DB_ROW_IS_REFERENCED
|| err == DB_NO_REFERENCED_ROW
- || err == DB_CANNOT_ADD_CONSTRAINT) {
+ || err == DB_CANNOT_ADD_CONSTRAINT
+ || err == DB_TOO_MANY_CONCURRENT_TRXS) {
if (savept) {
/* Roll back the latest, possibly incomplete
insertion or update */
@@ -654,6 +655,8 @@ row_create_prebuilt(
prebuilt->old_vers_heap = NULL;
+ prebuilt->last_value = 0;
+
return(prebuilt);
}
@@ -2893,6 +2896,8 @@ next_rec:
dict_table_change_id_in_cache(table, new_id);
}
+ /* MySQL calls ha_innobase::reset_auto_increment() which does
+ the same thing. */
dict_table_autoinc_initialize(table, 0);
dict_update_statistics(table);
diff --git a/storage/innobase/row/row0row.c b/storage/innobase/row/row0row.c
index efa129d6211..08e50817db9 100644
--- a/storage/innobase/row/row0row.c
+++ b/storage/innobase/row/row0row.c
@@ -142,20 +142,15 @@ row_build_index_entry(
dfield_copy(dfield, dfield2);
/* If a column prefix index, take only the prefix */
- if (ind_field->prefix_len) {
- if (dfield_get_len(dfield2) != UNIV_SQL_NULL) {
+ if (ind_field->prefix_len > 0
+ && dfield_get_len(dfield2) != UNIV_SQL_NULL) {
- storage_len = dtype_get_at_most_n_mbchars(
- col->prtype,
- col->mbminlen, col->mbmaxlen,
- ind_field->prefix_len,
- dfield_get_len(dfield2),
- dfield2->data);
-
- dfield_set_len(dfield, storage_len);
- }
+ storage_len = dtype_get_at_most_n_mbchars(
+ col->prtype, col->mbminlen, col->mbmaxlen,
+ ind_field->prefix_len,
+ dfield_get_len(dfield2), dfield2->data);
- dfield_get_type(dfield)->len = ind_field->prefix_len;
+ dfield_set_len(dfield, storage_len);
}
}
@@ -478,7 +473,9 @@ row_build_row_ref_in_tuple(
ulint* offsets = offsets_;
*offsets_ = (sizeof offsets_) / sizeof *offsets_;
- ut_a(ref && index && rec);
+ ut_a(ref);
+ ut_a(index);
+ ut_a(rec);
if (UNIV_UNLIKELY(!index->table)) {
fputs("InnoDB: table ", stderr);
diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c
index a3199055b54..fdf6aa46351 100644
--- a/storage/innobase/row/row0sel.c
+++ b/storage/innobase/row/row0sel.c
@@ -3619,6 +3619,32 @@ shortcut_fails_too_big_rec:
pcur, 0, &mtr);
pcur->trx_if_known = trx;
+
+ rec = btr_pcur_get_rec(pcur);
+
+ if (!moves_up
+ && !page_rec_is_supremum(rec)
+ && set_also_gap_locks
+ && !(srv_locks_unsafe_for_binlog
+ || trx->isolation_level == TRX_ISO_READ_COMMITTED)
+ && prebuilt->select_lock_type != LOCK_NONE) {
+
+ /* Try to place a gap lock on the next index record
+ to prevent phantoms in ORDER BY ... DESC queries */
+
+ offsets = rec_get_offsets(page_rec_get_next(rec),
+ index, offsets,
+ ULINT_UNDEFINED, &heap);
+ err = sel_set_rec_lock(page_rec_get_next(rec),
+ index, offsets,
+ prebuilt->select_lock_type,
+ LOCK_GAP, thr);
+
+ if (err != DB_SUCCESS) {
+
+ goto lock_wait_or_error;
+ }
+ }
} else {
if (mode == PAGE_CUR_G) {
btr_pcur_open_at_index_side(
@@ -4493,3 +4519,149 @@ row_search_check_if_query_cache_permitted(
return(ret);
}
+
+/***********************************************************************
+Read the AUTOINC column from the current row. */
+static
+ib_longlong
+row_search_autoinc_read_column(
+/*===========================*/
+ /* out: value read from the column */
+ dict_index_t* index, /* in: index to read from */
+ const rec_t* rec, /* in: current rec */
+ ulint col_no, /* in: column number */
+ ibool unsigned_type) /* in: signed or unsigned flag */
+{
+ ulint len;
+ const byte* data;
+ ib_longlong value;
+ mem_heap_t* heap = NULL;
+ byte dest[sizeof(value)];
+ ulint offsets_[REC_OFFS_NORMAL_SIZE];
+ ulint* offsets = offsets_;
+
+ *offsets_ = sizeof offsets_ / sizeof *offsets_;
+
+ /* TODO: We have to cast away the const of rec for now. This needs
+ to be fixed later.*/
+ offsets = rec_get_offsets(
+ (rec_t*) rec, index, offsets, ULINT_UNDEFINED, &heap);
+
+ /* TODO: We have to cast away the const of rec for now. This needs
+ to be fixed later.*/
+ data = rec_get_nth_field((rec_t*)rec, offsets, col_no, &len);
+
+ ut_a(len != UNIV_SQL_NULL);
+ ut_a(len <= sizeof value);
+
+ /* Copy integer data and restore sign bit */
+ if (unsigned_type || (data[0] & 128))
+ memset(dest, 0x00, sizeof(dest));
+ else
+ memset(dest, 0xff, sizeof(dest));
+
+ memcpy(dest + (sizeof(value) - len), data, len);
+
+ if (!unsigned_type)
+ dest[sizeof(value) - len] ^= 128;
+
+ /* The assumption here is that the AUTOINC value can't be negative.*/
+ value = (((ib_longlong) mach_read_from_4(dest)) << 32) |
+ ((ib_longlong) mach_read_from_4(dest + 4));
+
+ if (UNIV_LIKELY_NULL(heap)) {
+ mem_heap_free(heap);
+ }
+
+ ut_a(value >= 0);
+
+ return(value);
+}
+
+/***********************************************************************
+Get the last row. */
+static
+const rec_t*
+row_search_autoinc_get_rec(
+/*=======================*/
+ /* out: current rec or NULL */
+ btr_pcur_t* pcur, /* in: the current cursor */
+ mtr_t* mtr) /* in: mini transaction */
+{
+ do {
+ const rec_t* rec = btr_pcur_get_rec(pcur);
+
+ if (page_rec_is_user_rec(rec)) {
+ return(rec);
+ }
+ } while (btr_pcur_move_to_prev(pcur, mtr));
+
+ return(NULL);
+}
+
+/***********************************************************************
+Read the max AUTOINC value from an index. */
+
+ulint
+row_search_max_autoinc(
+/*===================*/
+ /* out: DB_SUCCESS if all OK else
+ error code, DB_RECORD_NOT_FOUND if
+ column name can't be found in index */
+ dict_index_t* index, /* in: index to search */
+ const char* col_name, /* in: name of autoinc column */
+ ib_longlong* value) /* out: AUTOINC value read */
+{
+ ulint i;
+ ulint n_cols;
+ dict_field_t* dfield = NULL;
+ ulint error = DB_SUCCESS;
+
+ n_cols = dict_index_get_n_ordering_defined_by_user(index);
+
+ /* Search the index for the AUTOINC column name */
+ for (i = 0; i < n_cols; ++i) {
+ dfield = dict_index_get_nth_field(index, i);
+
+ if (strcmp(col_name, dfield->name) == 0) {
+ break;
+ }
+ }
+
+ *value = 0;
+
+ /* Must find the AUTOINC column name */
+ if (i < n_cols && dfield) {
+ mtr_t mtr;
+ btr_pcur_t pcur;
+
+ mtr_start(&mtr);
+
+ /* Open at the high/right end (FALSE), and INIT
+ cursor (TRUE) */
+ btr_pcur_open_at_index_side(
+ FALSE, index, BTR_SEARCH_LEAF, &pcur, TRUE, &mtr);
+
+ if (page_get_n_recs(btr_pcur_get_page(&pcur)) > 0) {
+ const rec_t* rec;
+
+ rec = row_search_autoinc_get_rec(&pcur, &mtr);
+
+ if (rec != NULL) {
+ ibool unsigned_type = (
+ dfield->col->prtype & DATA_UNSIGNED);
+
+ *value = row_search_autoinc_read_column(
+ index, rec, i, unsigned_type);
+ }
+ }
+
+ btr_pcur_close(&pcur);
+
+ mtr_commit(&mtr);
+ } else {
+ error = DB_RECORD_NOT_FOUND;
+ }
+
+ return(error);
+}
diff --git a/storage/innobase/srv/Makefile.am b/storage/innobase/srv/Makefile.am
deleted file mode 100644
index e0b5b911b04..00000000000
--- a/storage/innobase/srv/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003-2004 MySQL AB & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = libsrv.a
-
-libsrv_a_SOURCES = srv0srv.c srv0que.c srv0start.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
index 72e8fe751d0..82b55789be2 100644
--- a/storage/innobase/srv/srv0srv.c
+++ b/storage/innobase/srv/srv0srv.c
@@ -47,6 +47,7 @@ Created 10/8/1995 Heikki Tuuri
#include "dict0boot.h"
#include "srv0start.h"
#include "row0mysql.h"
+#include "ha_prototypes.h"
/* This is set to TRUE if the MySQL user has set it in MySQL; currently
affects only FOREIGN KEY definition parsing */
@@ -180,6 +181,16 @@ dulint srv_archive_recovery_limit_lsn;
ulint srv_lock_wait_timeout = 1024 * 1024 * 1024;
+/* This parameter is used to throttle the number of insert buffers that are
+merged in a batch. By increasing this parameter on a faster disk you can
+possibly reduce the number of I/O operations performed to complete the
+merge operation. The value of this parameter is used as is by the
+background loop when the system is idle (low load), on a busy system
+the parameter is scaled down by a factor of 4, this is to avoid putting
+a heavier load on the I/O sub system. */
+
+ulong srv_insert_buffer_batch_size = 20;
+
char* srv_file_flush_method_str = NULL;
ulint srv_unix_file_flush_method = SRV_UNIX_FDATASYNC;
ulint srv_win_file_flush_method = SRV_WIN_IO_UNBUFFERED;
@@ -896,7 +907,7 @@ srv_init(void)
/* create dummy table and index for old-style infimum and supremum */
table = dict_mem_table_create("SYS_DUMMY1",
DICT_HDR_SPACE, 1, 0);
- dict_mem_table_add_col(table, "DUMMY", DATA_CHAR,
+ dict_mem_table_add_col(table, NULL, NULL, DATA_CHAR,
DATA_ENGLISH | DATA_NOT_NULL, 8);
srv_sys->dummy_ind1 = dict_mem_index_create(
@@ -907,7 +918,7 @@ srv_init(void)
/* create dummy table and index for new-style infimum and supremum */
table = dict_mem_table_create("SYS_DUMMY2",
DICT_HDR_SPACE, 1, DICT_TF_COMPACT);
- dict_mem_table_add_col(table, "DUMMY", DATA_CHAR,
+ dict_mem_table_add_col(table, NULL, NULL, DATA_CHAR,
DATA_ENGLISH | DATA_NOT_NULL, 8);
srv_sys->dummy_ind2 = dict_mem_index_create(
"SYS_DUMMY2", "SYS_DUMMY2", DICT_HDR_SPACE, 0, 1);
@@ -977,6 +988,17 @@ srv_conc_enter_innodb(
srv_conc_slot_t* slot = NULL;
ulint i;
+ if (trx->mysql_thd != NULL
+ && thd_is_replication_slave_thread(trx->mysql_thd)) {
+
+ /* TODO Do something more interesting (based on a config
+ parameter). Some users what to give the replication
+ thread very low priority, see http://bugs.mysql.com/25078
+ This can be done by introducing
+ innodb_replication_delay(ms) config parameter */
+ return;
+ }
+
/* If trx has 'free tickets' to enter the engine left, then use one
such ticket */
@@ -1017,7 +1039,7 @@ retry:
if (!has_slept && !trx->has_search_latch
&& NULL == UT_LIST_GET_FIRST(trx->trx_locks)) {
- has_slept = TRUE; /* We let is sleep only once to avoid
+ has_slept = TRUE; /* We let it sleep only once to avoid
starvation */
srv_conc_n_waiting_threads++;
@@ -1130,7 +1152,7 @@ srv_conc_force_enter_innodb(
srv_conc_n_threads++;
trx->declared_to_be_inside_innodb = TRUE;
- trx->n_tickets_to_enter_innodb = 0;
+ trx->n_tickets_to_enter_innodb = 1;
os_fast_mutex_unlock(&srv_conc_mutex);
}
@@ -1152,6 +1174,12 @@ srv_conc_force_exit_innodb(
return;
}
+ if (trx->mysql_thd != NULL
+ && thd_is_replication_slave_thread(trx->mysql_thd)) {
+
+ return;
+ }
+
if (trx->declared_to_be_inside_innodb == FALSE) {
return;
@@ -1853,6 +1881,7 @@ srv_lock_timeout_and_monitor_thread(
double time_elapsed;
time_t current_time;
time_t last_table_monitor_time;
+ time_t last_tablespace_monitor_time;
time_t last_monitor_time;
ibool some_waits;
double wait_time;
@@ -1865,6 +1894,7 @@ srv_lock_timeout_and_monitor_thread(
UT_NOT_USED(arg);
srv_last_monitor_time = time(NULL);
last_table_monitor_time = time(NULL);
+ last_tablespace_monitor_time = time(NULL);
last_monitor_time = time(NULL);
loop:
srv_lock_timeout_and_monitor_active = TRUE;
@@ -1901,9 +1931,9 @@ loop:
}
if (srv_print_innodb_tablespace_monitor
- && difftime(current_time, last_table_monitor_time) > 60) {
-
- last_table_monitor_time = time(NULL);
+ && difftime(current_time,
+ last_tablespace_monitor_time) > 60) {
+ last_tablespace_monitor_time = time(NULL);
fputs("========================"
"========================\n",
@@ -2100,7 +2130,7 @@ loop:
os_thread_sleep(2000000);
- if (srv_shutdown_state < SRV_SHUTDOWN_LAST_PHASE) {
+ if (srv_shutdown_state < SRV_SHUTDOWN_CLEANUP) {
goto loop;
}
@@ -2270,7 +2300,8 @@ loop:
+ buf_pool->n_pages_written;
if (n_pend_ios < 3 && (n_ios - n_ios_old < 5)) {
srv_main_thread_op_info = "doing insert buffer merge";
- ibuf_contract_for_n_pages(TRUE, 5);
+ ibuf_contract_for_n_pages(
+ TRUE, srv_insert_buffer_batch_size / 4);
srv_main_thread_op_info = "flushing log";
@@ -2331,7 +2362,7 @@ loop:
even if the server were active */
srv_main_thread_op_info = "doing insert buffer merge";
- ibuf_contract_for_n_pages(TRUE, 5);
+ ibuf_contract_for_n_pages(TRUE, srv_insert_buffer_batch_size / 4);
srv_main_thread_op_info = "flushing log";
log_buffer_flush_to_disk();
@@ -2469,7 +2500,8 @@ background_loop:
if (srv_fast_shutdown && srv_shutdown_state > 0) {
n_bytes_merged = 0;
} else {
- n_bytes_merged = ibuf_contract_for_n_pages(TRUE, 20);
+ n_bytes_merged = ibuf_contract_for_n_pages(
+ TRUE, srv_insert_buffer_batch_size);
}
srv_main_thread_op_info = "reserving kernel mutex";
diff --git a/storage/innobase/srv/srv0start.c b/storage/innobase/srv/srv0start.c
index 25f6f05e878..dac84e1410d 100644
--- a/storage/innobase/srv/srv0start.c
+++ b/storage/innobase/srv/srv0start.c
@@ -1025,6 +1025,12 @@ innobase_start_or_create_for_mysql(void)
"InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!\n");
#endif
+#ifdef UNIV_IBUF_DEBUG
+ fprintf(stderr,
+ "InnoDB: !!!!!!!! UNIV_IBUF_DEBUG switched on !!!!!!!!!\n"
+ "InnoDB: Crash recovery will fail with UNIV_IBUF_DEBUG\n");
+#endif
+
#ifdef UNIV_SYNC_DEBUG
fprintf(stderr,
"InnoDB: !!!!!!!! UNIV_SYNC_DEBUG switched on !!!!!!!!!\n");
diff --git a/storage/innobase/sync/Makefile.am b/storage/innobase/sync/Makefile.am
deleted file mode 100644
index 7cf274b64e8..00000000000
--- a/storage/innobase/sync/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003-2004 MySQL AB & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = libsync.a
-
-libsync_a_SOURCES = sync0arr.c sync0rw.c sync0sync.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/sync/sync0arr.c b/storage/innobase/sync/sync0arr.c
index e45cd48a6b4..82b08a890e0 100644
--- a/storage/innobase/sync/sync0arr.c
+++ b/storage/innobase/sync/sync0arr.c
@@ -670,7 +670,9 @@ sync_array_detect_deadlock(
ibool ret;
rw_lock_debug_t*debug;
- ut_a(arr && start && cell);
+ ut_a(arr);
+ ut_a(start);
+ ut_a(cell);
ut_ad(cell->wait_object);
ut_ad(os_thread_get_curr_id() == start->thread);
ut_ad(depth < 100);
diff --git a/storage/innobase/sync/sync0rw.c b/storage/innobase/sync/sync0rw.c
index 34b45e2c1c3..4db780c8b3f 100644
--- a/storage/innobase/sync/sync0rw.c
+++ b/storage/innobase/sync/sync0rw.c
@@ -15,16 +15,34 @@ Created 9/11/1995 Heikki Tuuri
#include "mem0mem.h"
#include "srv0srv.h"
+/* number of system calls made during shared latching */
ulint rw_s_system_call_count = 0;
+
+/* number of spin waits on rw-latches,
+resulted during shared (read) locks */
ulint rw_s_spin_wait_count = 0;
+
+/* number of OS waits on rw-latches,
+resulted during shared (read) locks */
ulint rw_s_os_wait_count = 0;
+/* number of unlocks (that unlock shared locks),
+set only when UNIV_SYNC_PERF_STAT is defined */
ulint rw_s_exit_count = 0;
+/* number of system calls made during exclusive latching */
ulint rw_x_system_call_count = 0;
+
+/* number of spin waits on rw-latches,
+resulted during exclusive (write) locks */
ulint rw_x_spin_wait_count = 0;
+
+/* number of OS waits on rw-latches,
+resulted during exclusive (write) locks */
ulint rw_x_os_wait_count = 0;
+/* number of unlocks (that unlock exclusive locks),
+set only when UNIV_SYNC_PERF_STAT is defined */
ulint rw_x_exit_count = 0;
/* The global list of rw-locks */
diff --git a/storage/innobase/sync/sync0sync.c b/storage/innobase/sync/sync0sync.c
index 672e1f93aad..bf3f4d1ff20 100644
--- a/storage/innobase/sync/sync0sync.c
+++ b/storage/innobase/sync/sync0sync.c
@@ -115,6 +115,7 @@ ulint mutex_system_call_count = 0;
/* Number of spin waits on mutexes: for performance monitoring */
+/* round=one iteration of a spin loop */
ulint mutex_spin_round_count = 0;
ulint mutex_spin_wait_count = 0;
ulint mutex_os_wait_count = 0;
diff --git a/storage/innobase/thr/Makefile.am b/storage/innobase/thr/Makefile.am
deleted file mode 100644
index febcdf3e1a3..00000000000
--- a/storage/innobase/thr/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = libthr.a
-
-libthr_a_SOURCES = thr0loc.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/trx/Makefile.am b/storage/innobase/trx/Makefile.am
deleted file mode 100644
index f9722454ef5..00000000000
--- a/storage/innobase/trx/Makefile.am
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = libtrx.a
-
-libtrx_a_SOURCES = trx0purge.c trx0rec.c trx0roll.c trx0rseg.c\
- trx0sys.c trx0trx.c trx0undo.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/trx/trx0rec.c b/storage/innobase/trx/trx0rec.c
index 69e858fe71d..50f8b011463 100644
--- a/storage/innobase/trx/trx0rec.c
+++ b/storage/innobase/trx/trx0rec.c
@@ -1024,6 +1024,7 @@ trx_undo_report_row_operation(
ibool is_insert;
trx_rseg_t* rseg;
mtr_t mtr;
+ ulint err = DB_SUCCESS;
mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_;
@@ -1035,7 +1036,7 @@ trx_undo_report_row_operation(
*roll_ptr = ut_dulint_zero;
- return(DB_SUCCESS);
+ return(err);
}
ut_ad(thr);
@@ -1053,7 +1054,7 @@ trx_undo_report_row_operation(
if (trx->insert_undo == NULL) {
- trx_undo_assign_undo(trx, TRX_UNDO_INSERT);
+ err = trx_undo_assign_undo(trx, TRX_UNDO_INSERT);
}
undo = trx->insert_undo;
@@ -1063,7 +1064,7 @@ trx_undo_report_row_operation(
if (trx->update_undo == NULL) {
- trx_undo_assign_undo(trx, TRX_UNDO_UPDATE);
+ err = trx_undo_assign_undo(trx, TRX_UNDO_UPDATE);
}
@@ -1071,11 +1072,11 @@ trx_undo_report_row_operation(
is_insert = FALSE;
}
- if (undo == NULL) {
- /* Did not succeed: out of space */
+ if (err != DB_SUCCESS) {
+ /* Did not succeed: return the error encountered */
mutex_exit(&(trx->undo_mutex));
- return(DB_OUT_OF_FILE_SPACE);
+ return(err);
}
page_no = undo->last_page_no;
@@ -1107,7 +1108,9 @@ trx_undo_report_row_operation(
if (offset == 0) {
/* The record did not fit on the page. We erase the
end segment of the undo log page and write a log
- record of it to to ensure deterministic contents. */
+ record of it: this is to ensure that in the debug
+ version the replicate page constructed using the log
+ records stays identical to the original page */
trx_undo_erase_page_end(undo_page, &mtr);
}
@@ -1163,7 +1166,7 @@ trx_undo_report_row_operation(
if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
- return(DB_SUCCESS);
+ return(err);
}
/*============== BUILDING PREVIOUS VERSION OF A RECORD ===============*/
diff --git a/storage/innobase/trx/trx0sys.c b/storage/innobase/trx/trx0sys.c
index 307a03bfbc3..40348dd4199 100644
--- a/storage/innobase/trx/trx0sys.c
+++ b/storage/innobase/trx/trx0sys.c
@@ -646,6 +646,7 @@ trx_sys_update_mysql_binlog_offset(
MLOG_4BYTES, mtr);
}
+#ifdef UNIV_HOTBACKUP
/*********************************************************************
Prints to stderr the MySQL binlog info in the system header if the
magic number shows it valid. */
@@ -677,6 +678,7 @@ trx_sys_print_mysql_binlog_offset_from_page(
+ TRX_SYS_MYSQL_LOG_NAME);
}
}
+#endif /* UNIV_HOTBACKUP */
/*********************************************************************
Stores the MySQL binlog offset info in the trx system header if
@@ -868,7 +870,16 @@ trx_sysf_create(
trx_sysf_rseg_set_page_no(sys_header, i, FIL_NULL, mtr);
}
- /* The remaining area (up to the page trailer) is uninitialized. */
+ /* The remaining area (up to the page trailer) is uninitialized.
+ Silence Valgrind warnings about it. */
+ UNIV_MEM_VALID(sys_header + (TRX_SYS_RSEGS
+ + TRX_SYS_N_RSEGS * TRX_SYS_RSEG_SLOT_SIZE
+ + TRX_SYS_RSEG_SPACE),
+ (UNIV_PAGE_SIZE - FIL_PAGE_DATA_END
+ - (TRX_SYS_RSEGS
+ + TRX_SYS_N_RSEGS * TRX_SYS_RSEG_SLOT_SIZE
+ + TRX_SYS_RSEG_SPACE))
+ + page - sys_header);
/* Create the first rollback segment in the SYSTEM tablespace */
page_no = trx_rseg_header_create(TRX_SYS_SPACE, ULINT_MAX, &slot_no,
diff --git a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c
index cdea3e9c477..a278ad51984 100644
--- a/storage/innobase/trx/trx0trx.c
+++ b/storage/innobase/trx/trx0trx.c
@@ -25,6 +25,7 @@ Created 3/26/1996 Heikki Tuuri
#include "btr0sea.h"
#include "os0proc.h"
#include "trx0xa.h"
+#include "ha_prototypes.h"
/* Copy of the prototype for innobase_mysql_print_thd: this
copy MUST be equal to the one in mysql/sql/ha_innodb.cc ! */
@@ -130,17 +131,14 @@ trx_create(
trx->mysql_thd = NULL;
trx->mysql_query_str = NULL;
+ trx->active_trans = 0;
+ trx->duplicates = 0;
trx->n_mysql_tables_in_use = 0;
trx->mysql_n_tables_locked = 0;
trx->mysql_log_file_name = NULL;
trx->mysql_log_offset = 0;
- trx->mysql_master_log_file_name = "";
- trx->mysql_master_log_pos = 0;
-
- trx->repl_wait_binlog_name = NULL;
- trx->repl_wait_binlog_pos = 0;
mutex_create(&trx->undo_mutex, SYNC_TRX_UNDO);
@@ -192,6 +190,8 @@ trx_create(
memset(&trx->xid, 0, sizeof(trx->xid));
trx->xid.formatID = -1;
+ trx->n_autoinc_rows = 0;
+
trx_reset_new_rec_lock_info(trx);
return(trx);
@@ -320,11 +320,6 @@ trx_free(
trx_undo_arr_free(trx->undo_no_arr);
}
- if (trx->repl_wait_binlog_name != NULL) {
-
- mem_free(trx->repl_wait_binlog_name);
- }
-
ut_a(UT_LIST_GET_LEN(trx->signals) == 0);
ut_a(UT_LIST_GET_LEN(trx->reply_signals) == 0);
@@ -804,14 +799,6 @@ trx_commit_off_kernel(
trx->mysql_log_file_name = NULL;
}
- if (trx->mysql_master_log_file_name[0] != '\0') {
- /* This database server is a MySQL replication slave */
- trx_sys_update_mysql_binlog_offset(
- trx->mysql_master_log_file_name,
- trx->mysql_master_log_pos,
- TRX_SYS_MYSQL_MASTER_LOG_INFO, &mtr);
- }
-
/* The following call commits the mini-transaction, making the
whole transaction committed in the file-based world, at this
log sequence number. The transaction becomes 'durable' when
@@ -1567,19 +1554,21 @@ trx_commit_for_mysql(
the transaction object does not have an InnoDB session object, and we
set the dummy session that we use for all MySQL transactions. */
- mutex_enter(&kernel_mutex);
-
if (trx->sess == NULL) {
/* Open a dummy session */
if (!trx_dummy_sess) {
- trx_dummy_sess = sess_open();
+ mutex_enter(&kernel_mutex);
+
+ if (!trx_dummy_sess) {
+ trx_dummy_sess = sess_open();
+ }
+
+ mutex_exit(&kernel_mutex);
}
trx->sess = trx_dummy_sess;
}
-
- mutex_exit(&kernel_mutex);
trx_start_if_not_started(trx);
@@ -1771,6 +1760,61 @@ trx_print(
}
}
+/***********************************************************************
+Compares the "weight" (or size) of two transactions. The weight of one
+transaction is estimated as the number of altered rows + the number of
+locked rows. Transactions that have edited non-transactional tables are
+considered heavier than ones that have not. */
+
+int
+trx_weight_cmp(
+/*===========*/
+ /* out: <0, 0 or >0; similar to strcmp(3) */
+ trx_t* a, /* in: the first transaction to be compared */
+ trx_t* b) /* in: the second transaction to be compared */
+{
+ ibool a_notrans_edit;
+ ibool b_notrans_edit;
+
+ /* If mysql_thd is NULL for a transaction we assume that it has
+ not edited non-transactional tables. */
+
+ a_notrans_edit = a->mysql_thd != NULL
+ && thd_has_edited_nontrans_tables(a->mysql_thd);
+
+ b_notrans_edit = b->mysql_thd != NULL
+ && thd_has_edited_nontrans_tables(b->mysql_thd);
+
+ if (a_notrans_edit && !b_notrans_edit) {
+
+ return(1);
+ }
+
+ if (!a_notrans_edit && b_notrans_edit) {
+
+ return(-1);
+ }
+
+ /* Either both had edited non-transactional tables or both had
+ not, we fall back to comparing the number of altered/locked
+ rows. */
+
+#if 0
+ fprintf(stderr,
+ "%s TRX_WEIGHT(a): %lld+%lu, TRX_WEIGHT(b): %lld+%lu\n",
+ __func__,
+ ut_conv_dulint_to_longlong(a->undo_no),
+ UT_LIST_GET_LEN(a->trx_locks),
+ ut_conv_dulint_to_longlong(b->undo_no),
+ UT_LIST_GET_LEN(b->trx_locks));
+#endif
+
+#define TRX_WEIGHT(t) \
+ ut_dulint_add((t)->undo_no, UT_LIST_GET_LEN((t)->trx_locks))
+
+ return(ut_dulint_cmp(TRX_WEIGHT(a), TRX_WEIGHT(b)));
+}
+
/********************************************************************
Prepares a transaction. */
@@ -1889,7 +1933,7 @@ Does the transaction prepare for MySQL. */
ulint
trx_prepare_for_mysql(
-/*====-=============*/
+/*==================*/
/* out: 0 or error number */
trx_t* trx) /* in: trx handle */
{
diff --git a/storage/innobase/trx/trx0undo.c b/storage/innobase/trx/trx0undo.c
index 831e337f513..64e5ad3c9a8 100644
--- a/storage/innobase/trx/trx0undo.c
+++ b/storage/innobase/trx/trx0undo.c
@@ -373,26 +373,31 @@ trx_undo_page_init(
/*******************************************************************
Creates a new undo log segment in file. */
static
-page_t*
+ulint
trx_undo_seg_create(
/*================*/
- /* out: segment header page x-latched, NULL
- if no space left */
+ /* out: DB_SUCCESS if page creation OK
+ possible error codes are:
+ DB_TOO_MANY_CONCURRENT_TRXS
+ DB_OUT_OF_FILE_SPACE */
trx_rseg_t* rseg __attribute__((unused)),/* in: rollback segment */
trx_rsegf_t* rseg_hdr,/* in: rollback segment header, page
x-latched */
ulint type, /* in: type of the segment: TRX_UNDO_INSERT or
TRX_UNDO_UPDATE */
ulint* id, /* out: slot index within rseg header */
+ page_t** undo_page,
+ /* out: segment header page x-latched, NULL
+ if there was an error */
mtr_t* mtr) /* in: mtr */
{
ulint slot_no;
ulint space;
- page_t* undo_page;
trx_upagef_t* page_hdr;
trx_usegf_t* seg_hdr;
ulint n_reserved;
ibool success;
+ ulint err = DB_SUCCESS;
ut_ad(mtr && id && rseg_hdr);
ut_ad(mutex_own(&(rseg->mutex)));
@@ -410,7 +415,7 @@ trx_undo_seg_create(
"InnoDB: many active transactions"
" running concurrently?\n");
- return(NULL);
+ return(DB_TOO_MANY_CONCURRENT_TRXS);
}
space = buf_frame_get_space_id(rseg_hdr);
@@ -419,30 +424,30 @@ trx_undo_seg_create(
mtr);
if (!success) {
- return(NULL);
+ return(DB_OUT_OF_FILE_SPACE);
}
/* Allocate a new file segment for the undo log */
- undo_page = fseg_create_general(space, 0,
+ *undo_page = fseg_create_general(space, 0,
TRX_UNDO_SEG_HDR
+ TRX_UNDO_FSEG_HEADER, TRUE, mtr);
fil_space_release_free_extents(space, n_reserved);
- if (undo_page == NULL) {
+ if (*undo_page == NULL) {
/* No space left */
- return(NULL);
+ return(DB_OUT_OF_FILE_SPACE);
}
#ifdef UNIV_SYNC_DEBUG
- buf_page_dbg_add_level(undo_page, SYNC_TRX_UNDO_PAGE);
+ buf_page_dbg_add_level(*undo_page, SYNC_TRX_UNDO_PAGE);
#endif /* UNIV_SYNC_DEBUG */
- page_hdr = undo_page + TRX_UNDO_PAGE_HDR;
- seg_hdr = undo_page + TRX_UNDO_SEG_HDR;
+ page_hdr = *undo_page + TRX_UNDO_PAGE_HDR;
+ seg_hdr = *undo_page + TRX_UNDO_SEG_HDR;
- trx_undo_page_init(undo_page, type, mtr);
+ trx_undo_page_init(*undo_page, type, mtr);
mlog_write_ulint(page_hdr + TRX_UNDO_PAGE_FREE,
TRX_UNDO_SEG_HDR + TRX_UNDO_SEG_HDR_SIZE,
@@ -456,10 +461,11 @@ trx_undo_seg_create(
page_hdr + TRX_UNDO_PAGE_NODE, mtr);
trx_rsegf_set_nth_undo(rseg_hdr, slot_no,
- buf_frame_get_page_no(undo_page), mtr);
+ buf_frame_get_page_no(*undo_page), mtr);
+
*id = slot_no;
- return(undo_page);
+ return(err);
}
/**************************************************************************
@@ -1387,6 +1393,11 @@ trx_undo_mem_create(
undo = mem_alloc(sizeof(trx_undo_t));
+ if (undo == NULL) {
+
+ return NULL;
+ }
+
undo->id = id;
undo->type = type;
undo->state = TRX_UNDO_ACTIVE;
@@ -1464,11 +1475,15 @@ trx_undo_mem_free(
/**************************************************************************
Creates a new undo log. */
static
-trx_undo_t*
+ulint
trx_undo_create(
/*============*/
- /* out: undo log object, NULL if did not
- succeed: out of space */
+ /* out: DB_SUCCESS if successful in creating
+ the new undo lob object, possible error
+ codes are:
+ DB_TOO_MANY_CONCURRENT_TRXS
+ DB_OUT_OF_FILE_SPACE
+ DB_OUT_OF_MEMORY*/
trx_t* trx, /* in: transaction */
trx_rseg_t* rseg, /* in: rollback segment memory copy */
ulint type, /* in: type of the log: TRX_UNDO_INSERT or
@@ -1476,34 +1491,37 @@ trx_undo_create(
dulint trx_id, /* in: id of the trx for which the undo log
is created */
XID* xid, /* in: X/Open transaction identification*/
+ trx_undo_t** undo, /* out: the new undo log object, undefined
+ * if did not succeed */
mtr_t* mtr) /* in: mtr */
{
trx_rsegf_t* rseg_header;
ulint page_no;
ulint offset;
ulint id;
- trx_undo_t* undo;
page_t* undo_page;
+ ulint err;
ut_ad(mutex_own(&(rseg->mutex)));
if (rseg->curr_size == rseg->max_size) {
- return(NULL);
+ return(DB_OUT_OF_FILE_SPACE);
}
rseg->curr_size++;
rseg_header = trx_rsegf_get(rseg->space, rseg->page_no, mtr);
- undo_page = trx_undo_seg_create(rseg, rseg_header, type, &id, mtr);
+ err = trx_undo_seg_create(rseg, rseg_header, type, &id,
+ &undo_page, mtr);
- if (undo_page == NULL) {
+ if (err != DB_SUCCESS) {
/* Did not succeed */
rseg->curr_size--;
- return(NULL);
+ return(err);
}
page_no = buf_frame_get_page_no(undo_page);
@@ -1515,9 +1533,14 @@ trx_undo_create(
undo_page + offset, mtr);
}
- undo = trx_undo_mem_create(rseg, id, type, trx_id, xid,
+ *undo = trx_undo_mem_create(rseg, id, type, trx_id, xid,
page_no, offset);
- return(undo);
+ if (*undo == NULL) {
+
+ err = DB_OUT_OF_MEMORY;
+ }
+
+ return(err);
}
/*================ UNDO LOG ASSIGNMENT AND CLEANUP =====================*/
@@ -1634,17 +1657,20 @@ trx_undo_mark_as_dict_operation(
Assigns an undo log for a transaction. A new undo log is created or a cached
undo log reused. */
-trx_undo_t*
+ulint
trx_undo_assign_undo(
/*=================*/
- /* out: the undo log, NULL if did not succeed: out of
- space */
- trx_t* trx, /* in: transaction */
- ulint type) /* in: TRX_UNDO_INSERT or TRX_UNDO_UPDATE */
+ /* out: DB_SUCCESS if undo log assign
+ successful, possible error codes are:
+ DD_TOO_MANY_CONCURRENT_TRXS
+ DB_OUT_OF_FILE_SPACE DB_OUT_OF_MEMORY*/
+ trx_t* trx, /* in: transaction */
+ ulint type) /* in: TRX_UNDO_INSERT or TRX_UNDO_UPDATE */
{
trx_rseg_t* rseg;
trx_undo_t* undo;
mtr_t mtr;
+ ulint err = DB_SUCCESS;
ut_ad(trx);
ut_ad(trx->rseg);
@@ -1662,15 +1688,11 @@ trx_undo_assign_undo(
undo = trx_undo_reuse_cached(trx, rseg, type, trx->id, &trx->xid,
&mtr);
if (undo == NULL) {
- undo = trx_undo_create(trx, rseg, type, trx->id, &trx->xid,
- &mtr);
- if (undo == NULL) {
- /* Did not succeed */
+ err = trx_undo_create(trx, rseg, type, trx->id, &trx->xid,
+ &undo, &mtr);
+ if (err != DB_SUCCESS) {
- mutex_exit(&(rseg->mutex));
- mtr_commit(&mtr);
-
- return(NULL);
+ goto func_exit;
}
}
@@ -1688,10 +1710,11 @@ trx_undo_assign_undo(
trx_undo_mark_as_dict_operation(trx, undo, &mtr);
}
+func_exit:
mutex_exit(&(rseg->mutex));
mtr_commit(&mtr);
- return(undo);
+ return err;
}
/**********************************************************************
diff --git a/storage/innobase/usr/Makefile.am b/storage/innobase/usr/Makefile.am
deleted file mode 100644
index ea485022f71..00000000000
--- a/storage/innobase/usr/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = libusr.a
-
-libusr_a_SOURCES = usr0sess.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/ut/Makefile.am b/storage/innobase/ut/Makefile.am
deleted file mode 100644
index d79184759c1..00000000000
--- a/storage/innobase/ut/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = libut.a
-
-libut_a_SOURCES = ut0byte.c ut0dbg.c ut0mem.c ut0rnd.c ut0ut.c ut0vec.c ut0list.c ut0wqueue.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/ut/ut0mem.c b/storage/innobase/ut/ut0mem.c
index 4fd515c35e6..b466a5f6872 100644
--- a/storage/innobase/ut/ut0mem.c
+++ b/storage/innobase/ut/ut0mem.c
@@ -162,6 +162,8 @@ retry:
#endif
}
+ UNIV_MEM_ALLOC(ret, n + sizeof(ut_mem_block_t));
+
((ut_mem_block_t*)ret)->size = n + sizeof(ut_mem_block_t);
((ut_mem_block_t*)ret)->magic_n = UT_MEM_MAGIC_N;
diff --git a/storage/innobase/ut/ut0ut.c b/storage/innobase/ut/ut0ut.c
index bc6778f4c2f..389063ad821 100644
--- a/storage/innobase/ut/ut0ut.c
+++ b/storage/innobase/ut/ut0ut.c
@@ -14,6 +14,7 @@ Created 5/11/1994 Heikki Tuuri
#include <stdarg.h>
#include <string.h>
+#include <ctype.h>
#include "ut0sort.h"
#include "trx0trx.h"
diff --git a/storage/myisam/CMakeLists.txt b/storage/myisam/CMakeLists.txt
index ad0efe4a4e4..9d91bf0560a 100644..100755
--- a/storage/myisam/CMakeLists.txt
+++ b/storage/myisam/CMakeLists.txt
@@ -21,7 +21,8 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib
${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/extra/yassl/include)
-ADD_LIBRARY(myisam ft_boolean_search.c ft_nlq_search.c ft_parser.c ft_static.c ft_stem.c
+
+SET(MYISAM_SOURCES ft_boolean_search.c ft_nlq_search.c ft_parser.c ft_static.c ft_stem.c
ha_myisam.cc
ft_stopwords.c ft_update.c mi_cache.c mi_changed.c mi_check.c
mi_checksum.c mi_close.c mi_create.c mi_dbug.c mi_delete.c
@@ -33,21 +34,27 @@ ADD_LIBRARY(myisam ft_boolean_search.c ft_nlq_search.c ft_parser.c ft_static.c f
mi_unique.c mi_update.c mi_write.c rt_index.c rt_key.c rt_mbr.c
rt_split.c sort.c sp_key.c ft_eval.h myisamdef.h rt_index.h mi_rkey.c)
-ADD_EXECUTABLE(myisam_ftdump myisam_ftdump.c)
-TARGET_LINK_LIBRARIES(myisam_ftdump myisam mysys dbug strings zlib wsock32)
+IF(NOT SOURCE_SUBLIBS)
+
+ ADD_LIBRARY(myisam ${MYISAM_SOURCES})
+
+ ADD_EXECUTABLE(myisam_ftdump myisam_ftdump.c)
+ TARGET_LINK_LIBRARIES(myisam_ftdump myisam mysys debug dbug strings zlib wsock32)
+
+ ADD_EXECUTABLE(myisamchk myisamchk.c)
+ TARGET_LINK_LIBRARIES(myisamchk myisam mysys debug dbug strings zlib wsock32)
-ADD_EXECUTABLE(myisamchk myisamchk.c)
-TARGET_LINK_LIBRARIES(myisamchk myisam mysys dbug strings zlib wsock32)
+ ADD_EXECUTABLE(myisamlog myisamlog.c)
+ TARGET_LINK_LIBRARIES(myisamlog myisam mysys debug dbug strings zlib wsock32)
-ADD_EXECUTABLE(myisamlog myisamlog.c)
-TARGET_LINK_LIBRARIES(myisamlog myisam mysys dbug strings zlib wsock32)
+ ADD_EXECUTABLE(myisampack myisampack.c)
+ TARGET_LINK_LIBRARIES(myisampack myisam mysys debug dbug strings zlib wsock32)
-ADD_EXECUTABLE(myisampack myisampack.c)
-TARGET_LINK_LIBRARIES(myisampack myisam mysys dbug strings zlib wsock32)
+ IF(EMBED_MANIFESTS)
+ MYSQL_EMBED_MANIFEST("myisam_ftdump" "asInvoker")
+ MYSQL_EMBED_MANIFEST("myisamchk" "asInvoker")
+ MYSQL_EMBED_MANIFEST("myisamlog" "asInvoker")
+ MYSQL_EMBED_MANIFEST("myisampack" "asInvoker")
+ ENDIF(EMBED_MANIFESTS)
-IF(EMBED_MANIFESTS)
- MYSQL_EMBED_MANIFEST("myisam_ftdump" "asInvoker")
- MYSQL_EMBED_MANIFEST("myisamchk" "asInvoker")
- MYSQL_EMBED_MANIFEST("myisamlog" "asInvoker")
- MYSQL_EMBED_MANIFEST("myisampack" "asInvoker")
-ENDIF(EMBED_MANIFESTS)
+ENDIF(NOT SOURCE_SUBLIBS)
diff --git a/storage/myisam/ft_boolean_search.c b/storage/myisam/ft_boolean_search.c
index 68076d7e401..15f4e1e1d34 100644
--- a/storage/myisam/ft_boolean_search.c
+++ b/storage/myisam/ft_boolean_search.c
@@ -23,8 +23,14 @@
inside plus subtree. max_docid could be used by any word in plus
subtree, but it could be updated by plus-word only.
+ Fulltext "smarter index merge" optimization assumes that rows
+ it gets are ordered by doc_id. That is not the case when we
+ search for a word with truncation operator. It may return
+ rows in random order. Thus we may not use "smarter index merge"
+ optimization with "trunc-words".
+
The idea is: there is no need to search for docid smaller than
- biggest docid inside current plus subtree.
+ biggest docid inside current plus subtree or any upper plus subtree.
Examples:
+word1 word2
@@ -36,6 +42,13 @@
+(word1 -word2) +(+word3 word4)
share same max_docid
max_docid updated by word3
+ +word1 word2 (+word3 word4 (+word5 word6))
+ three subexpressions (including the top-level one),
+ every one has its own max_docid, updated by its plus word.
+ but for the search word6 uses
+ max(word1.max_docid, word3.max_docid, word5.max_docid),
+ while word4 uses, accordingly,
+ max(word1.max_docid, word3.max_docid).
*/
#define FT_CORE
@@ -104,14 +117,14 @@ typedef struct st_ftb_word
/* ^^^^^^^^^^^^^^^^^^ FTB_{EXPR,WORD} common section */
my_off_t docid[2]; /* for index search and for scan */
my_off_t key_root;
- my_off_t *max_docid;
+ FTB_EXPR *max_docid_expr;
MI_KEYDEF *keyinfo;
struct st_ftb_word *prev;
float weight;
uint ndepth;
uint len;
uchar off;
- byte word[1];
+ uchar word[1];
} FTB_WORD;
typedef struct st_ft_info
@@ -161,7 +174,7 @@ typedef struct st_my_ftb_param
{
FTB *ftb;
FTB_EXPR *ftbe;
- byte *up_quot;
+ uchar *up_quot;
uint depth;
} MY_FTB_PARAM;
@@ -208,13 +221,13 @@ static int ftb_query_add_word(MYSQL_FTPARSER_PARAM *param,
for (tmp_expr= ftb_param->ftbe; tmp_expr->up; tmp_expr= tmp_expr->up)
if (! (tmp_expr->flags & FTB_FLAG_YES))
break;
- ftbw->max_docid= &tmp_expr->max_docid;
+ ftbw->max_docid_expr= tmp_expr;
/* fall through */
case FT_TOKEN_STOPWORD:
if (! ftb_param->up_quot) break;
phrase_word= (FT_WORD *)alloc_root(&ftb_param->ftb->mem_root, sizeof(FT_WORD));
tmp_element= (LIST *)alloc_root(&ftb_param->ftb->mem_root, sizeof(LIST));
- phrase_word->pos= word;
+ phrase_word->pos= (uchar*) word;
phrase_word->len= word_len;
tmp_element->data= (void *)phrase_word;
ftb_param->ftbe->phrase= list_add(ftb_param->ftbe->phrase, tmp_element);
@@ -240,7 +253,7 @@ static int ftb_query_add_word(MYSQL_FTPARSER_PARAM *param,
if (info->yesno > 0) ftbe->up->ythresh++;
ftb_param->ftbe= ftbe;
ftb_param->depth++;
- ftb_param->up_quot= info->quot;
+ ftb_param->up_quot= (uchar*) info->quot;
break;
case FT_TOKEN_RIGHT_PAREN:
if (ftb_param->ftbe->document)
@@ -274,20 +287,20 @@ static int ftb_parse_query_internal(MYSQL_FTPARSER_PARAM *param,
MY_FTB_PARAM *ftb_param= param->mysql_ftparam;
MYSQL_FTPARSER_BOOLEAN_INFO info;
CHARSET_INFO *cs= ftb_param->ftb->charset;
- char **start= &query;
- char *end= query + len;
+ uchar **start= (uchar**) &query;
+ uchar *end= (uchar*) query + len;
FT_WORD w;
info.prev= ' ';
info.quot= 0;
while (ft_get_word(cs, start, end, &w, &info))
- param->mysql_add_word(param, w.pos, w.len, &info);
+ param->mysql_add_word(param, (char*) w.pos, w.len, &info);
return(0);
}
-static void _ftb_parse_query(FTB *ftb, byte *query, uint len,
- struct st_mysql_ftparser *parser)
+static int _ftb_parse_query(FTB *ftb, uchar *query, uint len,
+ struct st_mysql_ftparser *parser)
{
MYSQL_FTPARSER_PARAM *param;
MY_FTB_PARAM ftb_param;
@@ -295,9 +308,9 @@ static void _ftb_parse_query(FTB *ftb, byte *query, uint len,
DBUG_ASSERT(parser);
if (ftb->state != UNINITIALIZED)
- DBUG_VOID_RETURN;
+ DBUG_RETURN(0);
if (! (param= ftparser_call_initializer(ftb->info, ftb->keynr, 0)))
- DBUG_VOID_RETURN;
+ DBUG_RETURN(1);
ftb_param.ftb= ftb;
ftb_param.depth= 0;
@@ -308,12 +321,11 @@ static void _ftb_parse_query(FTB *ftb, byte *query, uint len,
param->mysql_add_word= ftb_query_add_word;
param->mysql_ftparam= (void *)&ftb_param;
param->cs= ftb->charset;
- param->doc= query;
+ param->doc= (char*) query;
param->length= len;
param->flags= 0;
param->mode= MYSQL_FTPARSER_FULL_BOOLEAN_INFO;
- parser->parse(param);
- DBUG_VOID_RETURN;
+ DBUG_RETURN(parser->parse(param));
}
@@ -331,7 +343,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
my_bool can_go_down;
MI_INFO *info=ftb->info;
uint off, extra=HA_FT_WLEN+info->s->base.rec_reflength;
- byte *lastkey_buf=ftbw->word+ftbw->off;
+ uchar *lastkey_buf=ftbw->word+ftbw->off;
LINT_INIT(off);
if (ftbw->flags & FTB_FLAG_TRUNC)
@@ -348,11 +360,17 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
else
{
uint sflag= SEARCH_BIGGER;
- if (ftbw->docid[0] < *ftbw->max_docid)
+ my_off_t max_docid=0;
+ FTB_EXPR *tmp;
+
+ for (tmp= ftbw->max_docid_expr; tmp; tmp= tmp->up)
+ set_if_bigger(max_docid, tmp->max_docid);
+
+ if (ftbw->docid[0] < max_docid)
{
sflag|= SEARCH_SAME;
_mi_dpointer(info, (uchar *)(ftbw->word + ftbw->len + HA_FT_WLEN),
- *ftbw->max_docid);
+ max_docid);
}
r=_mi_search(info, ftbw->keyinfo, (uchar*) lastkey_buf,
USE_WHOLE_KEY, sflag, ftbw->key_root);
@@ -431,8 +449,8 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
memcpy(lastkey_buf+off, info->lastkey, info->lastkey_length);
}
ftbw->docid[0]=info->lastpos;
- if (ftbw->flags & FTB_FLAG_YES)
- *ftbw->max_docid= info->lastpos;
+ if (ftbw->flags & FTB_FLAG_YES && !(ftbw->flags & FTB_FLAG_TRUNC))
+ ftbw->max_docid_expr->max_docid= info->lastpos;
return 0;
}
@@ -475,7 +493,8 @@ static void _ftb_init_index_search(FT_INFO *ftb)
ftbe->up->flags|= FTB_FLAG_TRUNC, ftbe=ftbe->up)
{
if (ftbe->flags & FTB_FLAG_NO || /* 2 */
- ftbe->up->ythresh - ftbe->up->yweaks >1) /* 1 */
+ ftbe->up->ythresh - ftbe->up->yweaks >
+ (uint) test(ftbe->flags & FTB_FLAG_YES)) /* 1 */
{
FTB_EXPR *top_ftbe=ftbe->up;
ftbw->docid[0]=HA_OFFSET_ERROR;
@@ -505,7 +524,7 @@ static void _ftb_init_index_search(FT_INFO *ftb)
}
-FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
+FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, uchar *query,
uint query_len, CHARSET_INFO *cs)
{
FTB *ftb;
@@ -538,21 +557,22 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
ftbe->phrase= NULL;
ftbe->document= 0;
ftb->root=ftbe;
- _ftb_parse_query(ftb, query, query_len, keynr == NO_SUCH_KEY ?
- &ft_default_parser :
- info->s->keyinfo[keynr].parser);
+ if (unlikely(_ftb_parse_query(ftb, query, query_len,
+ keynr == NO_SUCH_KEY ? &ft_default_parser :
+ info->s->keyinfo[keynr].parser)))
+ goto err;
/*
Hack: instead of init_queue, we'll use reinit queue to be able
to alloc queue with alloc_root()
*/
- if (! (ftb->queue.root= (byte **)alloc_root(&ftb->mem_root,
+ if (! (ftb->queue.root= (uchar **)alloc_root(&ftb->mem_root,
(ftb->queue.max_elements + 1) *
sizeof(void *))))
goto err;
reinit_queue(&ftb->queue, ftb->queue.max_elements, 0, 0,
- (int (*)(void*, byte*, byte*))FTB_WORD_cmp, 0);
+ (int (*)(void*, uchar*, uchar*))FTB_WORD_cmp, 0);
for (ftbw= ftb->last_word; ftbw; ftbw= ftbw->prev)
- queue_insert(&ftb->queue, (byte *)ftbw);
+ queue_insert(&ftb->queue, (uchar *)ftbw);
ftb->list=(FTB_WORD **)alloc_root(&ftb->mem_root,
sizeof(FTB_WORD *)*ftb->queue.elements);
memcpy(ftb->list, ftb->queue.root+1, sizeof(FTB_WORD *)*ftb->queue.elements);
@@ -563,7 +583,7 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
return ftb;
err:
free_root(& ftb->mem_root, MYF(0));
- my_free((gptr)ftb,MYF(0));
+ my_free((uchar*)ftb,MYF(0));
return 0;
}
@@ -586,7 +606,7 @@ static int ftb_phrase_add_word(MYSQL_FTPARSER_PARAM *param,
MY_FTB_PHRASE_PARAM *phrase_param= param->mysql_ftparam;
FT_WORD *w= (FT_WORD *)phrase_param->document->data;
LIST *phrase, *document;
- w->pos= word;
+ w->pos= (uchar*) word;
w->len= word_len;
phrase_param->document= phrase_param->document->prev;
if (phrase_param->phrase_length > phrase_param->document_length)
@@ -616,12 +636,13 @@ static int ftb_check_phrase_internal(MYSQL_FTPARSER_PARAM *param,
{
FT_WORD word;
MY_FTB_PHRASE_PARAM *phrase_param= param->mysql_ftparam;
- const char *docend= document + len;
- while (ft_simple_get_word(phrase_param->cs, &document, docend, &word, FALSE))
+ const uchar *docend= (uchar*) document + len;
+ while (ft_simple_get_word(phrase_param->cs, (uchar**) &document, docend,
+ &word, FALSE))
{
- param->mysql_add_word(param, word.pos, word.len, 0);
+ param->mysql_add_word(param, (char*) word.pos, word.len, 0);
if (phrase_param->match)
- return 1;
+ break;
}
return 0;
}
@@ -639,9 +660,10 @@ static int ftb_check_phrase_internal(MYSQL_FTPARSER_PARAM *param,
RETURN VALUE
1 is returned if phrase found, 0 else.
+ -1 is returned if error occurs.
*/
-static int _ftb_check_phrase(FTB *ftb, const byte *document, uint len,
+static int _ftb_check_phrase(FTB *ftb, const uchar *document, uint len,
FTB_EXPR *ftbe, struct st_mysql_ftparser *parser)
{
MY_FTB_PHRASE_PARAM ftb_param;
@@ -663,16 +685,17 @@ static int _ftb_check_phrase(FTB *ftb, const byte *document, uint len,
param->mysql_add_word= ftb_phrase_add_word;
param->mysql_ftparam= (void *)&ftb_param;
param->cs= ftb->charset;
- param->doc= (byte *)document;
+ param->doc= (char *) document;
param->length= len;
param->flags= 0;
param->mode= MYSQL_FTPARSER_WITH_STOPWORDS;
- parser->parse(param);
+ if (unlikely(parser->parse(param)))
+ return -1;
DBUG_RETURN(ftb_param.match ? 1 : 0);
}
-static void _ftb_climb_the_tree(FTB *ftb, FTB_WORD *ftbw, FT_SEG_ITERATOR *ftsi_orig)
+static int _ftb_climb_the_tree(FTB *ftb, FTB_WORD *ftbw, FT_SEG_ITERATOR *ftsi_orig)
{
FT_SEG_ITERATOR ftsi;
FTB_EXPR *ftbe;
@@ -704,17 +727,19 @@ static void _ftb_climb_the_tree(FTB *ftb, FTB_WORD *ftbw, FT_SEG_ITERATOR *ftsi_
weight=ftbe->cur_weight*ftbe->weight;
if (mode && ftbe->phrase)
{
- int not_found=1;
+ int found= 0;
memcpy(&ftsi, ftsi_orig, sizeof(ftsi));
- while (_mi_ft_segiterator(&ftsi) && not_found)
+ while (_mi_ft_segiterator(&ftsi) && !found)
{
if (!ftsi.pos)
continue;
- not_found = ! _ftb_check_phrase(ftb, ftsi.pos, ftsi.len,
- ftbe, parser);
+ found= _ftb_check_phrase(ftb, ftsi.pos, ftsi.len, ftbe, parser);
+ if (unlikely(found < 0))
+ return 1;
}
- if (not_found) break;
+ if (!found)
+ break;
} /* ftbe->quot */
}
else
@@ -746,6 +771,7 @@ static void _ftb_climb_the_tree(FTB *ftb, FTB_WORD *ftbw, FT_SEG_ITERATOR *ftsi_
weight*= ftbe->weight;
}
}
+ return 0;
}
@@ -778,7 +804,11 @@ int ft_boolean_read_next(FT_INFO *ftb, char *record)
{
while (curdoc == (ftbw=(FTB_WORD *)queue_top(& ftb->queue))->docid[0])
{
- _ftb_climb_the_tree(ftb, ftbw, 0);
+ if (unlikely(_ftb_climb_the_tree(ftb, ftbw, 0)))
+ {
+ my_errno= HA_ERR_OUT_OF_MEM;
+ goto err;
+ }
/* update queue */
_ft2_search(ftb, ftbw, 0);
@@ -800,10 +830,11 @@ int ft_boolean_read_next(FT_INFO *ftb, char *record)
/* Clear all states, except that the table was updated */
info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
- if (!(*info->read_record)(info,curdoc,record))
+ if (!(*info->read_record)(info,curdoc, (uchar*) record))
{
info->update|= HA_STATE_AKTIV; /* Record is read */
- if (ftb->with_scan && ft_boolean_find_relevance(ftb,record,0)==0)
+ if (ftb->with_scan &&
+ ft_boolean_find_relevance(ftb,(uchar*) record,0)==0)
continue; /* no match */
my_errno=0;
goto err;
@@ -854,7 +885,8 @@ static int ftb_find_relevance_add_word(MYSQL_FTPARSER_PARAM *param,
if (ftbw->docid[1] == ftb->info->lastpos)
continue;
ftbw->docid[1]= ftb->info->lastpos;
- _ftb_climb_the_tree(ftb, ftbw, ftb_param->ftsi);
+ if (unlikely(_ftb_climb_the_tree(ftb, ftbw, ftb_param->ftsi)))
+ return 1;
}
return(0);
}
@@ -865,15 +897,15 @@ static int ftb_find_relevance_parse(MYSQL_FTPARSER_PARAM *param,
{
MY_FTB_FIND_PARAM *ftb_param= param->mysql_ftparam;
FT_INFO *ftb= ftb_param->ftb;
- char *end= doc + len;
+ uchar *end= (uchar*) doc + len;
FT_WORD w;
- while (ft_simple_get_word(ftb->charset, &doc, end, &w, TRUE))
- param->mysql_add_word(param, w.pos, w.len, 0);
+ while (ft_simple_get_word(ftb->charset, (uchar**) &doc, end, &w, TRUE))
+ param->mysql_add_word(param, (char*) w.pos, w.len, 0);
return(0);
}
-float ft_boolean_find_relevance(FT_INFO *ftb, byte *record, uint length)
+float ft_boolean_find_relevance(FT_INFO *ftb, uchar *record, uint length)
{
FTB_EXPR *ftbe;
FT_SEG_ITERATOR ftsi, ftsi2;
@@ -924,9 +956,10 @@ float ft_boolean_find_relevance(FT_INFO *ftb, byte *record, uint length)
{
if (!ftsi.pos)
continue;
- param->doc= (byte *)ftsi.pos;
+ param->doc= (char *)ftsi.pos;
param->length= ftsi.len;
- parser->parse(param);
+ if (unlikely(parser->parse(param)))
+ return 0;
}
ftbe=ftb->root;
if (ftbe->docid[1]==docid && ftbe->cur_weight>0 &&
@@ -948,7 +981,7 @@ void ft_boolean_close_search(FT_INFO *ftb)
delete_tree(& ftb->no_dupes);
}
free_root(& ftb->mem_root, MYF(0));
- my_free((gptr)ftb,MYF(0));
+ my_free((uchar*)ftb,MYF(0));
}
diff --git a/storage/myisam/ft_nlq_search.c b/storage/myisam/ft_nlq_search.c
index 5c6f66897ee..282fa6751d8 100644
--- a/storage/myisam/ft_nlq_search.c
+++ b/storage/myisam/ft_nlq_search.c
@@ -83,7 +83,7 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
word->weight=LWS_FOR_QUERY;
- keylen=_ft_make_key(info,aio->keynr,(char*) keybuff,word,0);
+ keylen=_ft_make_key(info,aio->keynr,keybuff,word,0);
keylen-=HA_FT_WLEN;
doc_cnt=0;
@@ -189,7 +189,7 @@ static int walk_and_push(FT_SUPERDOC *from,
DBUG_ENTER("walk_and_copy");
from->doc.weight+=from->tmp_weight*from->word_ptr->weight;
set_if_smaller(best->elements, ft_query_expansion_limit-1);
- queue_insert(best, (byte *)& from->doc);
+ queue_insert(best, (uchar *)& from->doc);
DBUG_RETURN(0);
}
@@ -201,8 +201,8 @@ static int FT_DOC_cmp(void *unused __attribute__((unused)),
}
-FT_INFO *ft_init_nlq_search(MI_INFO *info, uint keynr, byte *query,
- uint query_len, uint flags, byte *record)
+FT_INFO *ft_init_nlq_search(MI_INFO *info, uint keynr, uchar *query,
+ uint query_len, uint flags, uchar *record)
{
TREE wtree;
ALL_IN_ONE aio;
@@ -257,8 +257,12 @@ FT_INFO *ft_init_nlq_search(MI_INFO *info, uint keynr, byte *query,
{
info->update|= HA_STATE_AKTIV;
ftparser_param->flags= MYSQL_FTFLAGS_NEED_COPY;
- _mi_ft_parse(&wtree, info, keynr, record, ftparser_param,
- &wtree.mem_root);
+ if (unlikely(_mi_ft_parse(&wtree, info, keynr, record, ftparser_param,
+ &wtree.mem_root)))
+ {
+ delete_queue(&best);
+ goto err;
+ }
}
}
delete_queue(&best);
@@ -313,7 +317,7 @@ int ft_nlq_read_next(FT_INFO *handler, char *record)
info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
info->lastpos=handler->doc[handler->curdoc].dpos;
- if (!(*info->read_record)(info,info->lastpos,record))
+ if (!(*info->read_record)(info,info->lastpos,(uchar*) record))
{
info->update|= HA_STATE_AKTIV; /* Record is read */
return 0;
@@ -323,7 +327,7 @@ int ft_nlq_read_next(FT_INFO *handler, char *record)
float ft_nlq_find_relevance(FT_INFO *handler,
- byte *record __attribute__((unused)),
+ uchar *record __attribute__((unused)),
uint length __attribute__((unused)))
{
int a,b,c;
@@ -352,7 +356,7 @@ float ft_nlq_find_relevance(FT_INFO *handler,
void ft_nlq_close_search(FT_INFO *handler)
{
- my_free((gptr)handler,MYF(0));
+ my_free((uchar*)handler,MYF(0));
}
diff --git a/storage/myisam/ft_parser.c b/storage/myisam/ft_parser.c
index 5992d9c118e..df2423aa50f 100644
--- a/storage/myisam/ft_parser.c
+++ b/storage/myisam/ft_parser.c
@@ -78,12 +78,12 @@ FT_WORD * ft_linearize(TREE *wtree, MEM_ROOT *mem_root)
DBUG_RETURN(wlist);
}
-my_bool ft_boolean_check_syntax_string(const byte *str)
+my_bool ft_boolean_check_syntax_string(const uchar *str)
{
uint i, j;
if (!str ||
- (strlen(str)+1 != sizeof(ft_boolean_syntax)) ||
+ (strlen((char*) str)+1 != sizeof(ft_boolean_syntax)) ||
(str[0] != ' ' && str[1] != ' '))
return 1;
for (i=0; i<sizeof(ft_boolean_syntax); i++)
@@ -106,12 +106,13 @@ my_bool ft_boolean_check_syntax_string(const byte *str)
3 - right bracket
4 - stopword found
*/
-byte ft_get_word(CHARSET_INFO *cs, byte **start, byte *end,
- FT_WORD *word, MYSQL_FTPARSER_BOOLEAN_INFO *param)
+uchar ft_get_word(CHARSET_INFO *cs, uchar **start, uchar *end,
+ FT_WORD *word, MYSQL_FTPARSER_BOOLEAN_INFO *param)
{
- byte *doc=*start;
+ uchar *doc=*start;
int ctype;
- uint mwc, length, mbl;
+ uint mwc, length;
+ int mbl;
param->yesno=(FTB_YES==' ') ? 1 : (param->quot != 0);
param->weight_adjust= param->wasign= 0;
@@ -119,14 +120,14 @@ byte ft_get_word(CHARSET_INFO *cs, byte **start, byte *end,
while (doc<end)
{
- for (; doc < end; doc+= (mbl > 0 ? mbl : 1))
+ for (; doc < end; doc+= (mbl > 0 ? mbl : (mbl < 0 ? -mbl : 1)))
{
mbl= cs->cset->ctype(cs, &ctype, (uchar*)doc, (uchar*)end);
if (true_word_char(ctype, *doc))
break;
if (*doc == FTB_RQUOT && param->quot)
{
- param->quot=doc;
+ param->quot= (char*) doc;
*start=doc+1;
param->type= FT_TOKEN_RIGHT_PAREN;
goto ret;
@@ -137,7 +138,8 @@ byte ft_get_word(CHARSET_INFO *cs, byte **start, byte *end,
{
/* param->prev=' '; */
*start=doc+1;
- if (*doc == FTB_LQUOT) param->quot=*start;
+ if (*doc == FTB_LQUOT)
+ param->quot= (char*) *start;
param->type= (*doc == FTB_RBR ? FT_TOKEN_RIGHT_PAREN : FT_TOKEN_LEFT_PAREN);
goto ret;
}
@@ -157,7 +159,8 @@ byte ft_get_word(CHARSET_INFO *cs, byte **start, byte *end,
}
mwc=length=0;
- for (word->pos= doc; doc < end; length++, doc+= (mbl > 0 ? mbl : 1))
+ for (word->pos= doc; doc < end; length++,
+ doc+= (mbl > 0 ? mbl : (mbl < 0 ? -mbl : 1)))
{
mbl= cs->cset->ctype(cs, &ctype, (uchar*)doc, (uchar*)end);
if (true_word_char(ctype, *doc))
@@ -172,7 +175,8 @@ byte ft_get_word(CHARSET_INFO *cs, byte **start, byte *end,
if ((param->trunc=(doc<end && *doc == FTB_TRUNC)))
doc++;
- if (((length >= ft_min_word_len && !is_stopword(word->pos, word->len))
+ if (((length >= ft_min_word_len && !is_stopword((char*) word->pos,
+ word->len))
|| param->trunc) && length < ft_max_word_len)
{
*start=doc;
@@ -188,7 +192,8 @@ byte ft_get_word(CHARSET_INFO *cs, byte **start, byte *end,
}
if (param->quot)
{
- param->quot=*start=doc;
+ *start= doc;
+ param->quot= (char*) doc;
param->type= 3; /* FT_RBR */
goto ret;
}
@@ -196,17 +201,18 @@ ret:
return param->type;
}
-byte ft_simple_get_word(CHARSET_INFO *cs, byte **start, const byte *end,
- FT_WORD *word, my_bool skip_stopwords)
+uchar ft_simple_get_word(CHARSET_INFO *cs, uchar **start, const uchar *end,
+ FT_WORD *word, my_bool skip_stopwords)
{
- byte *doc= *start;
- uint mwc, length, mbl;
+ uchar *doc= *start;
+ uint mwc, length;
+ int mbl;
int ctype;
DBUG_ENTER("ft_simple_get_word");
do
{
- for (;; doc+= (mbl > 0 ? mbl : 1))
+ for (;; doc+= (mbl > 0 ? mbl : (mbl < 0 ? -mbl : 1)))
{
if (doc >= end)
DBUG_RETURN(0);
@@ -216,7 +222,8 @@ byte ft_simple_get_word(CHARSET_INFO *cs, byte **start, const byte *end,
}
mwc= length= 0;
- for (word->pos= doc; doc < end; length++, doc+= (mbl > 0 ? mbl : 1))
+ for (word->pos= doc; doc < end; length++,
+ doc+= (mbl > 0 ? mbl : (mbl < 0 ? -mbl : 1)))
{
mbl= cs->cset->ctype(cs, &ctype, (uchar*)doc, (uchar*)end);
if (true_word_char(ctype, *doc))
@@ -231,7 +238,7 @@ byte ft_simple_get_word(CHARSET_INFO *cs, byte **start, const byte *end,
if (skip_stopwords == FALSE ||
(length >= ft_min_word_len && length < ft_max_word_len &&
- !is_stopword(word->pos, word->len)))
+ !is_stopword((char*) word->pos, word->len)))
{
*start= doc;
DBUG_RETURN(1);
@@ -260,14 +267,14 @@ static int ft_add_word(MYSQL_FTPARSER_PARAM *param,
wtree= ft_param->wtree;
if (param->flags & MYSQL_FTFLAGS_NEED_COPY)
{
- byte *ptr;
+ uchar *ptr;
DBUG_ASSERT(wtree->with_delete == 0);
- ptr= (byte *)alloc_root(ft_param->mem_root, word_len);
+ ptr= (uchar *)alloc_root(ft_param->mem_root, word_len);
memcpy(ptr, word, word_len);
w.pos= ptr;
}
else
- w.pos= word;
+ w.pos= (uchar*) word;
w.len= word_len;
if (!tree_insert(wtree, &w, 0, wtree->custom_arg))
{
@@ -279,24 +286,25 @@ static int ft_add_word(MYSQL_FTPARSER_PARAM *param,
static int ft_parse_internal(MYSQL_FTPARSER_PARAM *param,
- char *doc, int doc_len)
+ char *doc_arg, int doc_len)
{
- byte *end=doc+doc_len;
+ uchar *doc= (uchar*) doc_arg;
+ uchar *end= doc + doc_len;
MY_FT_PARSER_PARAM *ft_param=param->mysql_ftparam;
TREE *wtree= ft_param->wtree;
FT_WORD w;
DBUG_ENTER("ft_parse_internal");
while (ft_simple_get_word(wtree->custom_arg, &doc, end, &w, TRUE))
- if (param->mysql_add_word(param, w.pos, w.len, 0))
+ if (param->mysql_add_word(param, (char*) w.pos, w.len, 0))
DBUG_RETURN(1);
DBUG_RETURN(0);
}
-int ft_parse(TREE *wtree, byte *doc, int doclen,
- struct st_mysql_ftparser *parser,
- MYSQL_FTPARSER_PARAM *param, MEM_ROOT *mem_root)
+int ft_parse(TREE *wtree, uchar *doc, int doclen,
+ struct st_mysql_ftparser *parser,
+ MYSQL_FTPARSER_PARAM *param, MEM_ROOT *mem_root)
{
MY_FT_PARSER_PARAM my_param;
DBUG_ENTER("ft_parse");
@@ -309,7 +317,7 @@ int ft_parse(TREE *wtree, byte *doc, int doclen,
param->mysql_add_word= ft_add_word;
param->mysql_ftparam= &my_param;
param->cs= wtree->custom_arg;
- param->doc= doc;
+ param->doc= (char*) doc;
param->length= doclen;
param->mode= MYSQL_FTPARSER_SIMPLE_MODE;
DBUG_RETURN(parser->parse(param));
@@ -387,7 +395,9 @@ MYSQL_FTPARSER_PARAM *ftparser_call_initializer(MI_INFO *info,
mysql_add_word == 0 - parser is not initialized
mysql_add_word != 0 - parser is initialized, or no
initialization needed. */
- info->ftparser_param[ftparser_nr].mysql_add_word= (void *)1;
+ info->ftparser_param[ftparser_nr].mysql_add_word=
+ (int (*)(struct st_mysql_ftparser_param *, char *, int,
+ MYSQL_FTPARSER_BOOLEAN_INFO *)) 1;
if (parser->init && parser->init(&info->ftparser_param[ftparser_nr]))
return 0;
}
diff --git a/storage/myisam/ft_static.c b/storage/myisam/ft_static.c
index 34608be1721..610c20eede6 100644
--- a/storage/myisam/ft_static.c
+++ b/storage/myisam/ft_static.c
@@ -56,8 +56,8 @@ const struct _ft_vft _ft_vft_boolean = {
FT_INFO *ft_init_search(uint flags, void *info, uint keynr,
- byte *query, uint query_len, CHARSET_INFO *cs,
- byte *record)
+ uchar *query, uint query_len, CHARSET_INFO *cs,
+ uchar *record)
{
FT_INFO *res;
if (flags & FT_BOOL)
diff --git a/storage/myisam/ft_stopwords.c b/storage/myisam/ft_stopwords.c
index 63732ebadc9..59866d9a351 100644
--- a/storage/myisam/ft_stopwords.c
+++ b/storage/myisam/ft_stopwords.c
@@ -38,7 +38,7 @@ static void FT_STOPWORD_free(FT_STOPWORD *w, TREE_FREE action,
void *arg __attribute__((unused)))
{
if (action == free_free)
- my_free((gptr) w->pos, MYF(0));
+ my_free((uchar*) w->pos, MYF(0));
}
static int ft_add_stopword(const char *w)
@@ -65,7 +65,7 @@ int ft_init_stopwords()
{
File fd;
uint len;
- byte *buffer, *start, *end;
+ uchar *buffer, *start, *end;
FT_WORD w;
int error=-1;
@@ -82,7 +82,7 @@ int ft_init_stopwords()
end=start+len;
while (ft_simple_get_word(default_charset_info, &start, end, &w, TRUE))
{
- if (ft_add_stopword(my_strndup(w.pos, w.len, MYF(0))))
+ if (ft_add_stopword(my_strndup((char*) w.pos, w.len, MYF(0))))
goto err1;
}
error=0;
diff --git a/storage/myisam/ft_update.c b/storage/myisam/ft_update.c
index e176d550b1d..e3e4c62158f 100644
--- a/storage/myisam/ft_update.c
+++ b/storage/myisam/ft_update.c
@@ -20,7 +20,7 @@
#include "ftdefs.h"
#include <math.h>
-void _mi_ft_segiterator_init(MI_INFO *info, uint keynr, const byte *record,
+void _mi_ft_segiterator_init(MI_INFO *info, uint keynr, const uchar *record,
FT_SEG_ITERATOR *ftsi)
{
DBUG_ENTER("_mi_ft_segiterator_init");
@@ -31,7 +31,7 @@ void _mi_ft_segiterator_init(MI_INFO *info, uint keynr, const byte *record,
DBUG_VOID_RETURN;
}
-void _mi_ft_segiterator_dummy_init(const byte *record, uint len,
+void _mi_ft_segiterator_dummy_init(const uchar *record, uint len,
FT_SEG_ITERATOR *ftsi)
{
DBUG_ENTER("_mi_ft_segiterator_dummy_init");
@@ -94,7 +94,7 @@ uint _mi_ft_segiterator(register FT_SEG_ITERATOR *ftsi)
/* parses a document i.e. calls ft_parse for every keyseg */
-uint _mi_ft_parse(TREE *parsed, MI_INFO *info, uint keynr, const byte *record,
+uint _mi_ft_parse(TREE *parsed, MI_INFO *info, uint keynr, const uchar *record,
MYSQL_FTPARSER_PARAM *param, MEM_ROOT *mem_root)
{
FT_SEG_ITERATOR ftsi;
@@ -108,13 +108,13 @@ uint _mi_ft_parse(TREE *parsed, MI_INFO *info, uint keynr, const byte *record,
while (_mi_ft_segiterator(&ftsi))
{
if (ftsi.pos)
- if (ft_parse(parsed, (byte *)ftsi.pos, ftsi.len, parser, param, mem_root))
+ if (ft_parse(parsed, (uchar *)ftsi.pos, ftsi.len, parser, param, mem_root))
DBUG_RETURN(1);
}
DBUG_RETURN(0);
}
-FT_WORD *_mi_ft_parserecord(MI_INFO *info, uint keynr, const byte *record,
+FT_WORD *_mi_ft_parserecord(MI_INFO *info, uint keynr, const uchar *record,
MEM_ROOT *mem_root)
{
TREE ptree;
@@ -130,7 +130,7 @@ FT_WORD *_mi_ft_parserecord(MI_INFO *info, uint keynr, const byte *record,
DBUG_RETURN(ft_linearize(&ptree, mem_root));
}
-static int _mi_ft_store(MI_INFO *info, uint keynr, byte *keybuf,
+static int _mi_ft_store(MI_INFO *info, uint keynr, uchar *keybuf,
FT_WORD *wlist, my_off_t filepos)
{
uint key_length;
@@ -145,7 +145,7 @@ static int _mi_ft_store(MI_INFO *info, uint keynr, byte *keybuf,
DBUG_RETURN(0);
}
-static int _mi_ft_erase(MI_INFO *info, uint keynr, byte *keybuf,
+static int _mi_ft_erase(MI_INFO *info, uint keynr, uchar *keybuf,
FT_WORD *wlist, my_off_t filepos)
{
uint key_length, err=0;
@@ -168,7 +168,7 @@ static int _mi_ft_erase(MI_INFO *info, uint keynr, byte *keybuf,
#define THOSE_TWO_DAMN_KEYS_ARE_REALLY_DIFFERENT 1
#define GEE_THEY_ARE_ABSOLUTELY_IDENTICAL 0
-int _mi_ft_cmp(MI_INFO *info, uint keynr, const byte *rec1, const byte *rec2)
+int _mi_ft_cmp(MI_INFO *info, uint keynr, const uchar *rec1, const uchar *rec2)
{
FT_SEG_ITERATOR ftsi1, ftsi2;
CHARSET_INFO *cs=info->s->keyinfo[keynr].seg->charset;
@@ -190,8 +190,8 @@ int _mi_ft_cmp(MI_INFO *info, uint keynr, const byte *rec1, const byte *rec2)
/* update a document entry */
-int _mi_ft_update(MI_INFO *info, uint keynr, byte *keybuf,
- const byte *oldrec, const byte *newrec, my_off_t pos)
+int _mi_ft_update(MI_INFO *info, uint keynr, uchar *keybuf,
+ const uchar *oldrec, const uchar *newrec, my_off_t pos)
{
int error= -1;
FT_WORD *oldlist,*newlist, *old_word, *new_word;
@@ -241,7 +241,7 @@ err:
/* adds a document to the collection */
-int _mi_ft_add(MI_INFO *info, uint keynr, byte *keybuf, const byte *record,
+int _mi_ft_add(MI_INFO *info, uint keynr, uchar *keybuf, const uchar *record,
my_off_t pos)
{
int error= -1;
@@ -260,7 +260,7 @@ int _mi_ft_add(MI_INFO *info, uint keynr, byte *keybuf, const byte *record,
/* removes a document from the collection */
-int _mi_ft_del(MI_INFO *info, uint keynr, byte *keybuf, const byte *record,
+int _mi_ft_del(MI_INFO *info, uint keynr, uchar *keybuf, const uchar *record,
my_off_t pos)
{
int error= -1;
@@ -276,10 +276,10 @@ int _mi_ft_del(MI_INFO *info, uint keynr, byte *keybuf, const byte *record,
DBUG_RETURN(error);
}
-uint _ft_make_key(MI_INFO *info, uint keynr, byte *keybuf, FT_WORD *wptr,
+uint _ft_make_key(MI_INFO *info, uint keynr, uchar *keybuf, FT_WORD *wptr,
my_off_t filepos)
{
- byte buf[HA_FT_MAXBYTELEN+16];
+ uchar buf[HA_FT_MAXBYTELEN+16];
DBUG_ENTER("_ft_make_key");
#if HA_FT_WTYPE == HA_KEYTYPE_FLOAT
diff --git a/storage/myisam/ftdefs.h b/storage/myisam/ftdefs.h
index 26f5e4f266e..22443807b87 100644
--- a/storage/myisam/ftdefs.h
+++ b/storage/myisam/ftdefs.h
@@ -96,44 +96,44 @@
#define FTB_RQUOT (ft_boolean_syntax[11])
typedef struct st_ft_word {
- byte * pos;
+ uchar * pos;
uint len;
double weight;
} FT_WORD;
int is_stopword(char *word, uint len);
-uint _ft_make_key(MI_INFO *, uint , byte *, FT_WORD *, my_off_t);
+uint _ft_make_key(MI_INFO *, uint , uchar *, FT_WORD *, my_off_t);
-byte ft_get_word(CHARSET_INFO *, byte **, byte *, FT_WORD *,
- MYSQL_FTPARSER_BOOLEAN_INFO *);
-byte ft_simple_get_word(CHARSET_INFO *, byte **, const byte *,
- FT_WORD *, my_bool);
+uchar ft_get_word(CHARSET_INFO *, uchar **, uchar *, FT_WORD *,
+ MYSQL_FTPARSER_BOOLEAN_INFO *);
+uchar ft_simple_get_word(CHARSET_INFO *, uchar **, const uchar *,
+ FT_WORD *, my_bool);
typedef struct _st_ft_seg_iterator {
uint num, len;
HA_KEYSEG *seg;
- const byte *rec, *pos;
+ const uchar *rec, *pos;
} FT_SEG_ITERATOR;
-void _mi_ft_segiterator_init(MI_INFO *, uint, const byte *, FT_SEG_ITERATOR *);
-void _mi_ft_segiterator_dummy_init(const byte *, uint, FT_SEG_ITERATOR *);
+void _mi_ft_segiterator_init(MI_INFO *, uint, const uchar *, FT_SEG_ITERATOR *);
+void _mi_ft_segiterator_dummy_init(const uchar *, uint, FT_SEG_ITERATOR *);
uint _mi_ft_segiterator(FT_SEG_ITERATOR *);
void ft_parse_init(TREE *, CHARSET_INFO *);
-int ft_parse(TREE *, byte *, int, struct st_mysql_ftparser *parser,
+int ft_parse(TREE *, uchar *, int, struct st_mysql_ftparser *parser,
MYSQL_FTPARSER_PARAM *, MEM_ROOT *);
FT_WORD * ft_linearize(TREE *, MEM_ROOT *);
-FT_WORD * _mi_ft_parserecord(MI_INFO *, uint, const byte *, MEM_ROOT *);
-uint _mi_ft_parse(TREE *, MI_INFO *, uint, const byte *,
+FT_WORD * _mi_ft_parserecord(MI_INFO *, uint, const uchar *, MEM_ROOT *);
+uint _mi_ft_parse(TREE *, MI_INFO *, uint, const uchar *,
MYSQL_FTPARSER_PARAM *, MEM_ROOT *);
-FT_INFO *ft_init_nlq_search(MI_INFO *, uint, byte *, uint, uint, byte *);
-FT_INFO *ft_init_boolean_search(MI_INFO *, uint, byte *, uint, CHARSET_INFO *);
+FT_INFO *ft_init_nlq_search(MI_INFO *, uint, uchar *, uint, uint, uchar *);
+FT_INFO *ft_init_boolean_search(MI_INFO *, uint, uchar *, uint, CHARSET_INFO *);
extern const struct _ft_vft _ft_vft_nlq;
int ft_nlq_read_next(FT_INFO *, char *);
-float ft_nlq_find_relevance(FT_INFO *, byte *, uint);
+float ft_nlq_find_relevance(FT_INFO *, uchar *, uint);
void ft_nlq_close_search(FT_INFO *);
float ft_nlq_get_relevance(FT_INFO *);
my_off_t ft_nlq_get_docid(FT_INFO *);
@@ -141,7 +141,7 @@ void ft_nlq_reinit_search(FT_INFO *);
extern const struct _ft_vft _ft_vft_boolean;
int ft_boolean_read_next(FT_INFO *, char *);
-float ft_boolean_find_relevance(FT_INFO *, byte *, uint);
+float ft_boolean_find_relevance(FT_INFO *, uchar *, uint);
void ft_boolean_close_search(FT_INFO *);
float ft_boolean_get_relevance(FT_INFO *);
my_off_t ft_boolean_get_docid(FT_INFO *);
diff --git a/storage/myisam/fulltext.h b/storage/myisam/fulltext.h
index bea2fa96969..856e93e034d 100644
--- a/storage/myisam/fulltext.h
+++ b/storage/myisam/fulltext.h
@@ -29,9 +29,9 @@
extern const HA_KEYSEG ft_keysegs[FT_SEGS];
-int _mi_ft_cmp(MI_INFO *, uint, const byte *, const byte *);
-int _mi_ft_add(MI_INFO *, uint, byte *, const byte *, my_off_t);
-int _mi_ft_del(MI_INFO *, uint, byte *, const byte *, my_off_t);
+int _mi_ft_cmp(MI_INFO *, uint, const uchar *, const uchar *);
+int _mi_ft_add(MI_INFO *, uint, uchar *, const uchar *, my_off_t);
+int _mi_ft_del(MI_INFO *, uint, uchar *, const uchar *, my_off_t);
uint _mi_ft_convert_to_ft2(MI_INFO *, uint, uchar *);
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index f5086e05487..81690d8feee 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -84,6 +84,14 @@ static void mi_check_print_msg(MI_CHECK *param, const char* msg_type,
}
length=(uint) (strxmov(name, param->db_name,".",param->table_name,NullS) -
name);
+ /*
+ TODO: switch from protocol to push_warning here. The main reason we didn't
+ it yet is parallel repair. Due to following trace:
+ mi_check_print_msg/push_warning/sql_alloc/my_pthread_getspecific_ptr.
+
+ Also we likely need to lock mutex here (in both cases with protocol and
+ push_warning).
+ */
protocol->prepare_for_resend();
protocol->store(name, length, system_charset_info);
protocol->store(param->op_name, system_charset_info);
@@ -121,7 +129,7 @@ int table2myisam(TABLE *table_arg, MI_KEYDEF **keydef_out,
{
uint i, j, recpos, minpos, fieldpos, temp_length, length;
enum ha_base_keytype type= HA_KEYTYPE_BINARY;
- byte *record;
+ uchar *record;
KEY *pos;
MI_KEYDEF *keydef;
MI_COLUMNDEF *recinfo, *recinfo_pos;
@@ -474,6 +482,7 @@ void mi_check_print_warning(MI_CHECK *param, const char *fmt,...)
ha_myisam::ha_myisam(handlerton *hton, TABLE_SHARE *table_arg)
:handler(hton, table_arg), file(0),
int_table_flags(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER |
+ HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE |
HA_DUPLICATE_POS | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY |
HA_FILE_BASED | HA_CAN_GEOMETRY | HA_NO_TRANSACTIONS |
HA_CAN_INSERT_DELAYED | HA_CAN_BIT_FIELD | HA_CAN_RTREEKEYS |
@@ -531,7 +540,7 @@ int ha_myisam::net_read_dump(NET* net)
error= -1;
goto err;
}
- if (my_write(data_fd, (byte*)net->read_pos, (uint) packet_len,
+ if (my_write(data_fd, (uchar*)net->read_pos, (uint) packet_len,
MYF(MY_WME|MY_FNABP)))
{
error = errno;
@@ -550,7 +559,7 @@ int ha_myisam::dump(THD* thd, int fd)
uint blocksize = share->blocksize;
my_off_t bytes_to_read = share->state.state.data_file_length;
int data_fd = file->dfile;
- byte * buf = (byte*) my_malloc(blocksize, MYF(MY_WME));
+ uchar *buf = (uchar*) my_malloc(blocksize, MYF(MY_WME));
if (!buf)
return ENOMEM;
@@ -558,7 +567,7 @@ int ha_myisam::dump(THD* thd, int fd)
my_seek(data_fd, 0L, MY_SEEK_SET, MYF(MY_WME));
for (; bytes_to_read > 0;)
{
- uint bytes = my_read(data_fd, buf, blocksize, MYF(MY_WME));
+ size_t bytes = my_read(data_fd, buf, blocksize, MYF(MY_WME));
if (bytes == MY_FILE_ERROR)
{
error = errno;
@@ -575,7 +584,7 @@ int ha_myisam::dump(THD* thd, int fd)
}
else
{
- if (my_net_write(net, (char*) buf, bytes))
+ if (my_net_write(net, buf, bytes))
{
error = errno ? errno : EPIPE;
goto err;
@@ -586,53 +595,19 @@ int ha_myisam::dump(THD* thd, int fd)
if (fd < 0)
{
- if (my_net_write(net, "", 0))
+ if (my_net_write(net, (uchar*) "", 0))
error = errno ? errno : EPIPE;
net_flush(net);
}
err:
- my_free((gptr) buf, MYF(0));
+ my_free((uchar*) buf, MYF(0));
return error;
}
#endif /* HAVE_REPLICATION */
-bool ha_myisam::check_if_locking_is_allowed(uint sql_command,
- ulong type, TABLE *table,
- uint count, uint current,
- uint *system_count,
- bool called_by_privileged_thread)
-{
- /*
- To be able to open and lock for reading system tables like 'mysql.proc',
- when we already have some tables opened and locked, and avoid deadlocks
- we have to disallow write-locking of these tables with any other tables.
- */
- if (table->s->system_table &&
- table->reginfo.lock_type >= TL_WRITE_ALLOW_WRITE)
- (*system_count)++;
-
- /* 'current' is an index, that's why '<=' below. */
- if (*system_count > 0 && *system_count <= current)
- {
- my_error(ER_WRONG_LOCK_OF_SYSTEM_TABLE, MYF(0));
- return FALSE;
- }
-
- /*
- Deny locking of the log tables, which is incompatible with
- concurrent insert. Unless called from a logger THD (general_log_thd
- or slow_log_thd) or by a privileged thread.
- */
- if (!called_by_privileged_thread)
- return check_if_log_table_locking_is_allowed(sql_command, type, table);
-
- return TRUE;
-}
-
- /* Name is here without an extension */
-
+/* Name is here without an extension */
int ha_myisam::open(const char *name, int mode, uint test_if_locked)
{
MI_KEYDEF *keyinfo;
@@ -694,10 +669,10 @@ int ha_myisam::open(const char *name, int mode, uint test_if_locked)
for (i= 0; i < table->s->keys; i++)
{
- struct st_plugin_int *parser= table->key_info[i].parser;
+ plugin_ref parser= table->key_info[i].parser;
if (table->key_info[i].flags & HA_USES_PARSER)
file->s->keyinfo[i].parser=
- (struct st_mysql_ftparser *)parser->plugin->info;
+ (struct st_mysql_ftparser *)plugin_decl(parser)->info;
table->key_info[i].block_size= file->s->keyinfo[i].block_length;
}
my_errno= 0;
@@ -710,7 +685,7 @@ int ha_myisam::open(const char *name, int mode, uint test_if_locked)
recinfo must be freed.
*/
if (recinfo)
- my_free((gptr) recinfo, MYF(0));
+ my_free((uchar*) recinfo, MYF(0));
return my_errno;
}
@@ -721,9 +696,9 @@ int ha_myisam::close(void)
return mi_close(tmp);
}
-int ha_myisam::write_row(byte * buf)
+int ha_myisam::write_row(uchar *buf)
{
- statistic_increment(table->in_use->status_var.ha_write_count,&LOCK_status);
+ ha_statistic_increment(&SSV::ha_write_count);
/* If we have a timestamp column, update it to the current time */
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
@@ -1037,8 +1012,8 @@ int ha_myisam::optimize(THD* thd, HA_CHECK_OPT *check_opt)
param.sort_buffer_length= check_opt->sort_buffer_size;
if ((error= repair(thd,param,1)) && param.retry_repair)
{
- sql_print_warning("Warning: Optimize table got errno %d, retrying",
- my_errno);
+ sql_print_warning("Warning: Optimize table got errno %d on %s.%s, retrying",
+ my_errno, param.db_name, param.table_name);
param.testflag&= ~T_REP_BY_SORT;
error= repair(thd,param,1);
}
@@ -1216,11 +1191,7 @@ int ha_myisam::assign_to_keycache(THD* thd, HA_CHECK_OPT *check_opt)
table->keys_in_use_for_query.clear_all();
if (table_list->process_index_hints(table))
- {
- errmsg= thd->net.last_error;
- error= HA_ADMIN_FAILED;
- goto err;
- }
+ DBUG_RETURN(HA_ADMIN_FAILED);
map= ~(ulonglong) 0;
if (!table->keys_in_use_for_query.is_clear_all())
/* use all keys if there's no list specified by the user through hints */
@@ -1235,7 +1206,6 @@ int ha_myisam::assign_to_keycache(THD* thd, HA_CHECK_OPT *check_opt)
error= HA_ADMIN_CORRUPT;
}
- err:
if (error != HA_ADMIN_OK)
{
/* Send error to user */
@@ -1263,17 +1233,14 @@ int ha_myisam::preload_keys(THD* thd, HA_CHECK_OPT *check_opt)
ulonglong map;
TABLE_LIST *table_list= table->pos_in_table_list;
my_bool ignore_leaves= table_list->ignore_leaves;
+ char buf[ERRMSGSIZE+20];
DBUG_ENTER("ha_myisam::preload_keys");
table->keys_in_use_for_query.clear_all();
if (table_list->process_index_hints(table))
- {
- errmsg= thd->net.last_error;
- error= HA_ADMIN_FAILED;
- goto err;
- }
+ DBUG_RETURN(HA_ADMIN_FAILED);
map= ~(ulonglong) 0;
/* Check validity of the index references */
@@ -1294,7 +1261,6 @@ int ha_myisam::preload_keys(THD* thd, HA_CHECK_OPT *check_opt)
errmsg= "Failed to allocate buffer";
break;
default:
- char buf[ERRMSGSIZE+20];
my_snprintf(buf, ERRMSGSIZE,
"Failed to read from index file (errno: %d)", my_errno);
errmsg= buf;
@@ -1427,8 +1393,8 @@ int ha_myisam::enable_indexes(uint mode)
param.tmpdir=&mysql_tmpdir_list;
if ((error= (repair(thd,param,0) != HA_ADMIN_OK)) && param.retry_repair)
{
- sql_print_warning("Warning: Enabling keys got errno %d, retrying",
- my_errno);
+ sql_print_warning("Warning: Enabling keys got errno %d on %s.%s, retrying",
+ my_errno, param.db_name, param.table_name);
/* Repairing by sort failed. Now try standard repair method. */
param.testflag&= ~(T_REP_BY_SORT | T_QUICK);
error= (repair(thd,param,0) != HA_ADMIN_OK);
@@ -1437,8 +1403,10 @@ int ha_myisam::enable_indexes(uint mode)
might have been set by the first repair. They can still be seen
with SHOW WARNINGS then.
*/
+#ifndef EMBEDDED_LIBRARY
if (! error)
thd->clear_error();
+#endif /* EMBEDDED_LIBRARY */
}
info(HA_STATUS_CONST);
thd_proc_info(thd, save_proc_info);
@@ -1493,7 +1461,7 @@ void ha_myisam::start_bulk_insert(ha_rows rows)
DBUG_ENTER("ha_myisam::start_bulk_insert");
THD *thd= current_thd;
ulong size= min(thd->variables.read_buff_size,
- table->s->avg_row_length*rows);
+ (ulong) (table->s->avg_row_length*rows));
DBUG_PRINT("info",("start_bulk_insert: rows %lu size %lu",
(ulong) rows, size));
@@ -1594,102 +1562,95 @@ bool ha_myisam::is_crashed() const
(my_disable_locking && file->s->state.open_count));
}
-int ha_myisam::update_row(const byte * old_data, byte * new_data)
+int ha_myisam::update_row(const uchar *old_data, uchar *new_data)
{
- statistic_increment(table->in_use->status_var.ha_update_count,&LOCK_status);
+ ha_statistic_increment(&SSV::ha_update_count);
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
table->timestamp_field->set_time();
return mi_update(file,old_data,new_data);
}
-int ha_myisam::delete_row(const byte * buf)
+int ha_myisam::delete_row(const uchar *buf)
{
- statistic_increment(table->in_use->status_var.ha_delete_count,&LOCK_status);
+ ha_statistic_increment(&SSV::ha_delete_count);
return mi_delete(file,buf);
}
-int ha_myisam::index_read(byte *buf, const byte *key, key_part_map keypart_map,
- enum ha_rkey_function find_flag)
+int ha_myisam::index_read_map(uchar *buf, const uchar *key,
+ key_part_map keypart_map,
+ enum ha_rkey_function find_flag)
{
DBUG_ASSERT(inited==INDEX);
- statistic_increment(table->in_use->status_var.ha_read_key_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_key_count);
int error=mi_rkey(file, buf, active_index, key, keypart_map, find_flag);
table->status=error ? STATUS_NOT_FOUND: 0;
return error;
}
-int ha_myisam::index_read_idx(byte *buf, uint index, const byte *key,
- key_part_map keypart_map,
- enum ha_rkey_function find_flag)
+int ha_myisam::index_read_idx_map(uchar *buf, uint index, const uchar *key,
+ key_part_map keypart_map,
+ enum ha_rkey_function find_flag)
{
- statistic_increment(table->in_use->status_var.ha_read_key_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_key_count);
int error=mi_rkey(file, buf, index, key, keypart_map, find_flag);
table->status=error ? STATUS_NOT_FOUND: 0;
return error;
}
-int ha_myisam::index_read_last(byte *buf, const byte *key,
- key_part_map keypart_map)
+int ha_myisam::index_read_last_map(uchar *buf, const uchar *key,
+ key_part_map keypart_map)
{
DBUG_ENTER("ha_myisam::index_read_last");
DBUG_ASSERT(inited==INDEX);
- statistic_increment(table->in_use->status_var.ha_read_key_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_key_count);
int error=mi_rkey(file, buf, active_index, key, keypart_map,
HA_READ_PREFIX_LAST);
table->status=error ? STATUS_NOT_FOUND: 0;
DBUG_RETURN(error);
}
-int ha_myisam::index_next(byte * buf)
+int ha_myisam::index_next(uchar *buf)
{
DBUG_ASSERT(inited==INDEX);
- statistic_increment(table->in_use->status_var.ha_read_next_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_next_count);
int error=mi_rnext(file,buf,active_index);
table->status=error ? STATUS_NOT_FOUND: 0;
return error;
}
-int ha_myisam::index_prev(byte * buf)
+int ha_myisam::index_prev(uchar *buf)
{
DBUG_ASSERT(inited==INDEX);
- statistic_increment(table->in_use->status_var.ha_read_prev_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_prev_count);
int error=mi_rprev(file,buf, active_index);
table->status=error ? STATUS_NOT_FOUND: 0;
return error;
}
-int ha_myisam::index_first(byte * buf)
+int ha_myisam::index_first(uchar *buf)
{
DBUG_ASSERT(inited==INDEX);
- statistic_increment(table->in_use->status_var.ha_read_first_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_first_count);
int error=mi_rfirst(file, buf, active_index);
table->status=error ? STATUS_NOT_FOUND: 0;
return error;
}
-int ha_myisam::index_last(byte * buf)
+int ha_myisam::index_last(uchar *buf)
{
DBUG_ASSERT(inited==INDEX);
- statistic_increment(table->in_use->status_var.ha_read_last_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_last_count);
int error=mi_rlast(file, buf, active_index);
table->status=error ? STATUS_NOT_FOUND: 0;
return error;
}
-int ha_myisam::index_next_same(byte * buf,
- const byte *key __attribute__((unused)),
+int ha_myisam::index_next_same(uchar *buf,
+ const uchar *key __attribute__((unused)),
uint length __attribute__((unused)))
{
DBUG_ASSERT(inited==INDEX);
- statistic_increment(table->in_use->status_var.ha_read_next_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_next_count);
int error=mi_rnext_same(file,buf);
table->status=error ? STATUS_NOT_FOUND: 0;
return error;
@@ -1703,30 +1664,28 @@ int ha_myisam::rnd_init(bool scan)
return mi_reset(file); // Free buffers
}
-int ha_myisam::rnd_next(byte *buf)
+int ha_myisam::rnd_next(uchar *buf)
{
- statistic_increment(table->in_use->status_var.ha_read_rnd_next_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_rnd_next_count);
int error=mi_scan(file, buf);
table->status=error ? STATUS_NOT_FOUND: 0;
return error;
}
-int ha_myisam::restart_rnd_next(byte *buf, byte *pos)
+int ha_myisam::restart_rnd_next(uchar *buf, uchar *pos)
{
return rnd_pos(buf,pos);
}
-int ha_myisam::rnd_pos(byte * buf, byte *pos)
+int ha_myisam::rnd_pos(uchar *buf, uchar *pos)
{
- statistic_increment(table->in_use->status_var.ha_read_rnd_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_rnd_count);
int error=mi_rrnd(file, buf, my_get_ptr(pos,ref_length));
table->status=error ? STATUS_NOT_FOUND: 0;
return error;
}
-void ha_myisam::position(const byte* record)
+void ha_myisam::position(const uchar *record)
{
my_off_t row_position= mi_position(file);
my_store_ptr(ref, ref_length, row_position);
@@ -1897,6 +1856,8 @@ int ha_myisam::create(const char *name, register TABLE *table_arg,
if (ha_create_info->options & HA_LEX_CREATE_TMP_TABLE)
create_flags|= HA_CREATE_TMP_TABLE;
+ if (ha_create_info->options & HA_CREATE_KEEP_FILES)
+ create_flags|= HA_CREATE_KEEP_FILES;
if (options & HA_OPTION_PACK_RECORD)
create_flags|= HA_PACK_RECORD;
if (options & HA_OPTION_CHECKSUM)
@@ -1911,7 +1872,7 @@ int ha_myisam::create(const char *name, register TABLE *table_arg,
records, recinfo,
0, (MI_UNIQUEDEF*) 0,
&create_info, create_flags);
- my_free((gptr) recinfo, MYF(0));
+ my_free((uchar*) recinfo, MYF(0));
DBUG_RETURN(error);
}
@@ -1929,7 +1890,7 @@ void ha_myisam::get_auto_increment(ulonglong offset, ulonglong increment,
{
ulonglong nr;
int error;
- byte key[MI_MAX_KEY_LENGTH];
+ uchar key[MI_MAX_KEY_LENGTH];
if (!table->s->next_number_key_offset)
{ // Autoincrement at key-start
@@ -2002,7 +1963,7 @@ ha_rows ha_myisam::records_in_range(uint inx, key_range *min_key,
}
-int ha_myisam::ft_read(byte * buf)
+int ha_myisam::ft_read(uchar *buf)
{
int error;
@@ -2083,3 +2044,78 @@ mysql_declare_plugin(myisam)
}
mysql_declare_plugin_end;
+
+#ifdef HAVE_QUERY_CACHE
+/**
+ @brief Register a named table with a call back function to the query cache.
+
+ @param thd The thread handle
+ @param table_key A pointer to the table name in the table cache
+ @param key_length The length of the table name
+ @param[out] engine_callback The pointer to the storage engine call back
+ function, currently 0
+ @param[out] engine_data Engine data will be set to 0.
+
+ @note Despite the name of this function, it is used to check each statement
+ before it is cached and not to register a table or callback function.
+
+ @see handler::register_query_cache_table
+
+ @return The error code. The engine_data and engine_callback will be set to 0.
+ @retval TRUE Success
+ @retval FALSE An error occured
+*/
+
+my_bool ha_myisam::register_query_cache_table(THD *thd, char *table_name,
+ uint table_name_len,
+ qc_engine_callback
+ *engine_callback,
+ ulonglong *engine_data)
+{
+ /*
+ No call back function is needed to determine if a cached statement
+ is valid or not.
+ */
+ *engine_callback= 0;
+
+ /*
+ No engine data is needed.
+ */
+ *engine_data= 0;
+
+ /*
+ If a concurrent INSERT has happened just before the currently processed
+ SELECT statement, the total size of the table is unknown.
+
+ To determine if the table size is known, the current thread's snap shot of
+ the table size with the actual table size are compared.
+
+ If the table size is unknown the SELECT statement can't be cached.
+ */
+ ulonglong actual_data_file_length;
+ ulonglong current_data_file_length;
+
+ /*
+ POSIX visibility rules specify that "2. Whatever memory values a
+ thread can see when it unlocks a mutex <...> can also be seen by any
+ thread that later locks the same mutex". In this particular case,
+ concurrent insert thread had modified the data_file_length in
+ MYISAM_SHARE before it has unlocked (or even locked)
+ structure_guard_mutex. So, here we're guaranteed to see at least that
+ value after we've locked the same mutex. We can see a later value
+ (modified by some other thread) though, but it's ok, as we only want
+ to know if the variable was changed, the actual new value doesn't matter
+ */
+ actual_data_file_length= file->s->state.state.data_file_length;
+ current_data_file_length= file->save_state.data_file_length;
+
+ if (current_data_file_length != actual_data_file_length)
+ {
+ /* Don't cache current statement. */
+ return FALSE;
+ }
+
+ /* It is ok to try to cache current statement. */
+ return TRUE;
+}
+#endif
diff --git a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h
index bb439e9914d..e8594fc9039 100644
--- a/storage/myisam/ha_myisam.h
+++ b/storage/myisam/ha_myisam.h
@@ -60,26 +60,22 @@ class ha_myisam: public handler
uint max_supported_key_part_length() const { return MI_MAX_KEY_LENGTH; }
uint checksum() const;
- virtual bool check_if_locking_is_allowed(uint sql_command,
- ulong type, TABLE *table,
- uint count, uint current,
- uint *system_count,
- bool called_by_logger_thread);
int open(const char *name, int mode, uint test_if_locked);
int close(void);
- int write_row(byte * buf);
- int update_row(const byte * old_data, byte * new_data);
- int delete_row(const byte * buf);
- int index_read(byte *buf, const byte *key, key_part_map keypart_map,
- enum ha_rkey_function find_flag);
- int index_read_idx(byte *buf, uint index, const byte *key,
- key_part_map keypart_map, enum ha_rkey_function find_flag);
- int index_read_last(byte *buf, const byte *key, key_part_map keypart_map);
- int index_next(byte * buf);
- int index_prev(byte * buf);
- int index_first(byte * buf);
- int index_last(byte * buf);
- int index_next_same(byte *buf, const byte *key, uint keylen);
+ int write_row(uchar * buf);
+ int update_row(const uchar * old_data, uchar * new_data);
+ int delete_row(const uchar * buf);
+ int index_read_map(uchar *buf, const uchar *key, key_part_map keypart_map,
+ enum ha_rkey_function find_flag);
+ int index_read_idx_map(uchar *buf, uint index, const uchar *key,
+ key_part_map keypart_map,
+ enum ha_rkey_function find_flag);
+ int index_read_last_map(uchar *buf, const uchar *key, key_part_map keypart_map);
+ int index_next(uchar * buf);
+ int index_prev(uchar * buf);
+ int index_first(uchar * buf);
+ int index_last(uchar * buf);
+ int index_next_same(uchar *buf, const uchar *key, uint keylen);
int ft_init()
{
if (!ft_handler)
@@ -90,15 +86,15 @@ class ha_myisam: public handler
FT_INFO *ft_init_ext(uint flags, uint inx,String *key)
{
return ft_init_search(flags,file,inx,
- (byte *)key->ptr(), key->length(), key->charset(),
+ (uchar *)key->ptr(), key->length(), key->charset(),
table->record[0]);
}
- int ft_read(byte *buf);
+ int ft_read(uchar *buf);
int rnd_init(bool scan);
- int rnd_next(byte *buf);
- int rnd_pos(byte * buf, byte *pos);
- int restart_rnd_next(byte *buf, byte *pos);
- void position(const byte *record);
+ int rnd_next(uchar *buf);
+ int rnd_pos(uchar * buf, uchar *pos);
+ int restart_rnd_next(uchar *buf, uchar *pos);
+ void position(const uchar *record);
int info(uint);
int extra(enum ha_extra_function operation);
int extra_opt(enum ha_extra_function operation, ulong cache_size);
@@ -137,4 +133,11 @@ class ha_myisam: public handler
int dump(THD* thd, int fd);
int net_read_dump(NET* net);
#endif
+#ifdef HAVE_QUERY_CACHE
+ my_bool register_query_cache_table(THD *thd, char *table_key,
+ uint key_length,
+ qc_engine_callback
+ *engine_callback,
+ ulonglong *engine_data);
+#endif
};
diff --git a/storage/myisam/mi_cache.c b/storage/myisam/mi_cache.c
index 59c9b2c8812..d6dcc431a8d 100644
--- a/storage/myisam/mi_cache.c
+++ b/storage/myisam/mi_cache.c
@@ -35,12 +35,12 @@
#include "myisamdef.h"
-int _mi_read_cache(IO_CACHE *info, byte *buff, my_off_t pos, uint length,
+int _mi_read_cache(IO_CACHE *info, uchar *buff, my_off_t pos, uint length,
int flag)
{
uint read_length,in_buff_length;
my_off_t offset;
- char *in_buff_pos;
+ uchar *in_buff_pos;
DBUG_ENTER("_mi_read_cache");
if (pos < info->pos_in_file)
@@ -61,7 +61,7 @@ int _mi_read_cache(IO_CACHE *info, byte *buff, my_off_t pos, uint length,
(my_off_t) (info->read_end - info->request_pos))
{
in_buff_pos=info->request_pos+(uint) offset;
- in_buff_length= min(length,(uint) (info->read_end-in_buff_pos));
+ in_buff_length= min(length, (size_t) (info->read_end-in_buff_pos));
memcpy(buff,info->request_pos+(uint) offset,(size_t) in_buff_length);
if (!(length-=in_buff_length))
DBUG_RETURN(0);
diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c
index 7a4d47954a5..fe6b716877c 100644
--- a/storage/myisam/mi_check.c
+++ b/storage/myisam/mi_check.c
@@ -83,12 +83,12 @@ static int sort_delete_record(MI_SORT_PARAM *sort_param);
/*static int flush_pending_blocks(MI_CHECK *param);*/
static SORT_KEY_BLOCKS *alloc_key_blocks(MI_CHECK *param, uint blocks,
uint buffer_length);
-static ha_checksum mi_byte_checksum(const byte *buf, uint length);
+static ha_checksum mi_byte_checksum(const uchar *buf, uint length);
static void set_data_file_type(SORT_INFO *sort_info, MYISAM_SHARE *share);
void myisamchk_init(MI_CHECK *param)
{
- bzero((gptr) param,sizeof(*param));
+ bzero((uchar*) param,sizeof(*param));
param->opt_follow_links=1;
param->keys_in_use= ~(ulonglong) 0;
param->search_after_block=HA_OFFSET_ERROR;
@@ -173,7 +173,7 @@ int chk_del(MI_CHECK *param, register MI_INFO *info, uint test_flag)
printf(" %9s",llstr(next_link,buff));
if (next_link >= info->state->data_file_length)
goto wrong;
- if (my_pread(info->dfile,(char*) buff,delete_link_length,
+ if (my_pread(info->dfile, (uchar*) buff,delete_link_length,
next_link,MYF(MY_NABP)))
{
if (test_flag & T_VERBOSE) puts("");
@@ -250,7 +250,8 @@ static int check_k_link(MI_CHECK *param, register MI_INFO *info, uint nr)
my_off_t next_link;
uint block_size=(nr+1)*MI_MIN_KEY_BLOCK_LENGTH;
ha_rows records;
- char llbuff[21], llbuff2[21], *buff;
+ char llbuff[21], llbuff2[21];
+ uchar *buff;
DBUG_ENTER("check_k_link");
DBUG_PRINT("enter", ("block_size: %u", block_size));
@@ -296,7 +297,7 @@ static int check_k_link(MI_CHECK *param, register MI_INFO *info, uint nr)
*/
if (!(buff=key_cache_read(info->s->key_cache,
info->s->kfile, next_link, DFLT_INIT_HITS,
- (byte*) info->buff, MI_MIN_KEY_BLOCK_LENGTH,
+ (uchar*) info->buff, MI_MIN_KEY_BLOCK_LENGTH,
MI_MIN_KEY_BLOCK_LENGTH, 1)))
{
/* purecov: begin tested */
@@ -335,7 +336,7 @@ int chk_size(MI_CHECK *param, register MI_INFO *info)
flush_key_blocks(info->s->key_cache,
info->s->kfile, FLUSH_FORCE_WRITE);
- size=my_seek(info->s->kfile,0L,MY_SEEK_END,MYF(0));
+ size= my_seek(info->s->kfile, 0L, MY_SEEK_END, MYF(MY_THREADSAFE));
if ((skr=(my_off_t) info->state->key_file_length) != size)
{
/* Don't give error if file generated by myisampack */
@@ -531,7 +532,7 @@ int chk_key(MI_CHECK *param, register MI_INFO *info)
/* Check that there isn't a row with auto_increment = 0 in the table */
mi_extra(info,HA_EXTRA_KEYREAD,0);
bzero(info->lastkey,keyinfo->seg->length);
- if (!mi_rkey(info, info->rec_buff, key, (const byte*) info->lastkey,
+ if (!mi_rkey(info, info->rec_buff, key, (const uchar*) info->lastkey,
(key_part_map)1, HA_READ_KEY_EXACT))
{
/* Don't count this as a real warning, as myisamchk can't correct it */
@@ -595,7 +596,8 @@ static int chk_index_down(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
{
/* purecov: begin tested */
/* Give it a chance to fit in the real file size. */
- my_off_t max_length= my_seek(info->s->kfile, 0L, MY_SEEK_END, MYF(0));
+ my_off_t max_length= my_seek(info->s->kfile, 0L, MY_SEEK_END,
+ MYF(MY_THREADSAFE));
mi_check_print_error(param, "Invalid key block position: %s "
"key block size: %u file_length: %s",
llstr(page, llbuff), keyinfo->block_length,
@@ -740,7 +742,7 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
char llbuff[22];
uint diff_pos[2];
DBUG_ENTER("chk_index");
- DBUG_DUMP("buff",(byte*) buff,mi_getint(buff));
+ DBUG_DUMP("buff",(uchar*) buff,mi_getint(buff));
/* TODO: implement appropriate check for RTree keys */
if (keyinfo->flag & HA_SPATIAL)
@@ -798,8 +800,8 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
(flag=ha_key_cmp(keyinfo->seg,info->lastkey,key,key_length,
comp_flag, diff_pos)) >=0)
{
- DBUG_DUMP("old",(byte*) info->lastkey, info->lastkey_length);
- DBUG_DUMP("new",(byte*) key, key_length);
+ DBUG_DUMP("old",(uchar*) info->lastkey, info->lastkey_length);
+ DBUG_DUMP("new",(uchar*) key, key_length);
DBUG_DUMP("new_in_page",(char*) old_keypos,(uint) (keypos-old_keypos));
if (comp_flag & SEARCH_FIND && flag == 0)
@@ -831,7 +833,7 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
key);
}
}
- (*key_checksum)+= mi_byte_checksum((byte*) key,
+ (*key_checksum)+= mi_byte_checksum((uchar*) key,
key_length- info->s->rec_reflength);
record= _mi_dpos(info,0,key+key_length);
if (keyinfo->flag & HA_FULLTEXT) /* special handling for ft2 */
@@ -869,7 +871,7 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
DBUG_PRINT("test",("page: %s record: %s filelength: %s",
llstr(page,llbuff),llstr(record,llbuff2),
llstr(info->state->data_file_length,llbuff3)));
- DBUG_DUMP("key",(byte*) key,key_length);
+ DBUG_DUMP("key",(uchar*) key,key_length);
DBUG_DUMP("new_in_page",(char*) old_keypos,(uint) (keypos-old_keypos));
goto err;
}
@@ -881,10 +883,10 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
llstr(page,llbuff), used_length, (keypos - buff));
goto err;
}
- my_afree((byte*) temp_buff);
+ my_afree((uchar*) temp_buff);
DBUG_RETURN(0);
err:
- my_afree((byte*) temp_buff);
+ my_afree((uchar*) temp_buff);
DBUG_RETURN(1);
} /* chk_index */
@@ -939,7 +941,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
ha_rows records,del_blocks;
my_off_t used,empty,pos,splits,start_recpos,
del_length,link_used,start_block;
- byte *record,*to;
+ uchar *record,*to;
char llbuff[22],llbuff2[22],llbuff3[22];
ha_checksum intern_record_checksum;
ha_checksum key_checksum[MI_MAX_POSSIBLE_KEY];
@@ -956,7 +958,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
puts("- check record links");
}
- if (!(record= (byte*) my_malloc(info->s->base.pack_reclength,MYF(0))))
+ if (!(record= (uchar*) my_malloc(info->s->base.pack_reclength,MYF(0))))
{
mi_check_print_error(param,"Not enough memory for record");
DBUG_RETURN(-1);
@@ -991,7 +993,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
goto err2;
switch (info->s->data_file_type) {
case STATIC_RECORD:
- if (my_b_read(&param->read_cache,(byte*) record,
+ if (my_b_read(&param->read_cache,(uchar*) record,
info->s->base.pack_reclength))
goto err;
start_recpos=pos;
@@ -1011,7 +1013,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
block_info.next_filepos=pos;
do
{
- if (_mi_read_cache(&param->read_cache,(byte*) block_info.header,
+ if (_mi_read_cache(&param->read_cache,(uchar*) block_info.header,
(start_block=block_info.next_filepos),
sizeof(block_info.header),
(flag ? 0 : READING_NEXT) | READING_HEADER))
@@ -1115,7 +1117,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
got_error=1;
break;
}
- if (_mi_read_cache(&param->read_cache,(byte*) to,block_info.filepos,
+ if (_mi_read_cache(&param->read_cache,(uchar*) to,block_info.filepos,
(uint) block_info.data_len,
flag == 1 ? READING_NEXT : 0))
goto err;
@@ -1176,7 +1178,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
pos=block_info.filepos+block_info.block_len;
break;
case COMPRESSED_RECORD:
- if (_mi_read_cache(&param->read_cache,(byte*) block_info.header, pos,
+ if (_mi_read_cache(&param->read_cache,(uchar*) block_info.header, pos,
info->s->pack.ref_length, READING_NEXT))
goto err;
start_recpos=pos;
@@ -1193,7 +1195,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
got_error=1;
break;
}
- if (_mi_read_cache(&param->read_cache,(byte*) info->rec_buff,
+ if (_mi_read_cache(&param->read_cache,(uchar*) info->rec_buff,
block_info.filepos, block_info.rec_len, READING_NEXT))
goto err;
if (_mi_pack_rec_unpack(info, &info->bit_buff, record,
@@ -1253,7 +1255,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
}
}
else
- key_checksum[key]+=mi_byte_checksum((byte*) info->lastkey,
+ key_checksum[key]+=mi_byte_checksum((uchar*) info->lastkey,
key_length);
}
}
@@ -1363,12 +1365,12 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
printf("Lost space: %12s Linkdata: %10s\n",
llstr(empty,llbuff),llstr(link_used,llbuff2));
}
- my_free((gptr) record,MYF(0));
+ my_free((uchar*) record,MYF(0));
DBUG_RETURN (error);
err:
mi_check_print_error(param,"got error: %d when reading datafile at record: %s",my_errno, llstr(records,llbuff));
err2:
- my_free((gptr) record,MYF(0));
+ my_free((uchar*) record,MYF(0));
param->testflag|=T_RETRY_WITHOUT_QUICK;
DBUG_RETURN(1);
} /* chk_data_link */
@@ -1378,7 +1380,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
/* Save new datafile-name in temp_filename */
int mi_repair(MI_CHECK *param, register MI_INFO *info,
- my_string name, int rep_quick)
+ char * name, int rep_quick)
{
int error,got_error;
uint i;
@@ -1427,7 +1429,7 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
MYF(MY_WME | MY_WAIT_IF_FULL)))
goto err;
info->opt_flag|=WRITE_CACHE_USED;
- if (!(sort_param.record=(byte*) my_malloc((uint) share->base.pack_reclength,
+ if (!(sort_param.record=(uchar*) my_malloc((uint) share->base.pack_reclength,
MYF(0))) ||
!mi_alloc_rec_buff(info, -1, &sort_param.rec_buff))
{
@@ -1514,7 +1516,7 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
{
if (my_errno != HA_ERR_FOUND_DUPP_KEY)
goto err;
- DBUG_DUMP("record",(byte*) sort_param.record,share->base.pack_reclength);
+ DBUG_DUMP("record",(uchar*) sort_param.record,share->base.pack_reclength);
mi_check_print_info(param,"Duplicate key %2d for record at %10s against new record at %10s",
info->errkey+1,
llstr(sort_param.start_recpos,llbuff),
@@ -1660,7 +1662,7 @@ static int writekeys(MI_SORT_PARAM *sort_param)
register uint i;
uchar *key;
MI_INFO *info= sort_param->sort_info->info;
- byte *buff= sort_param->record;
+ uchar *buff= sort_param->record;
my_off_t filepos= sort_param->filepos;
DBUG_ENTER("writekeys");
@@ -1671,7 +1673,7 @@ static int writekeys(MI_SORT_PARAM *sort_param)
{
if (info->s->keyinfo[i].flag & HA_FULLTEXT )
{
- if (_mi_ft_add(info,i,(char*) key,buff,filepos))
+ if (_mi_ft_add(info, i, key, buff, filepos))
goto err;
}
#ifdef HAVE_SPATIAL
@@ -1702,7 +1704,7 @@ static int writekeys(MI_SORT_PARAM *sort_param)
{
if (info->s->keyinfo[i].flag & HA_FULLTEXT)
{
- if (_mi_ft_del(info,i,(char*) key,buff,filepos))
+ if (_mi_ft_del(info,i, key,buff,filepos))
break;
}
else
@@ -1724,7 +1726,7 @@ static int writekeys(MI_SORT_PARAM *sort_param)
/* Change all key-pointers that points to a records */
-int movepoint(register MI_INFO *info, byte *record, my_off_t oldpos,
+int movepoint(register MI_INFO *info, uchar *record, my_off_t oldpos,
my_off_t newpos, uint prot_key)
{
register uint i;
@@ -1801,7 +1803,7 @@ int flush_blocks(MI_CHECK *param, KEY_CACHE *key_cache, File file)
/* Sort index for more efficent reads */
-int mi_sort_index(MI_CHECK *param, register MI_INFO *info, my_string name)
+int mi_sort_index(MI_CHECK *param, register MI_INFO *info, char * name)
{
reg2 uint key;
reg1 MI_KEYDEF *keyinfo;
@@ -1944,7 +1946,7 @@ static int sort_one_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
("From page: %ld, keyoffset: %lu used_length: %d",
(ulong) pagepos, (ulong) (keypos - buff),
(int) used_length));
- DBUG_DUMP("buff",(byte*) buff,used_length);
+ DBUG_DUMP("buff",(uchar*) buff,used_length);
goto err;
}
}
@@ -1973,17 +1975,17 @@ static int sort_one_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
/* Fill block with zero and write it to the new index file */
length=mi_getint(buff);
- bzero((byte*) buff+length,keyinfo->block_length-length);
- if (my_pwrite(new_file,(byte*) buff,(uint) keyinfo->block_length,
+ bzero((uchar*) buff+length,keyinfo->block_length-length);
+ if (my_pwrite(new_file,(uchar*) buff,(uint) keyinfo->block_length,
new_page_pos,MYF(MY_NABP | MY_WAIT_IF_FULL)))
{
mi_check_print_error(param,"Can't write indexblock, error: %d",my_errno);
goto err;
}
- my_afree((gptr) buff);
+ my_afree((uchar*) buff);
DBUG_RETURN(0);
err:
- my_afree((gptr) buff);
+ my_afree((uchar*) buff);
DBUG_RETURN(1);
} /* sort_one_index */
@@ -2054,13 +2056,13 @@ int filecopy(MI_CHECK *param, File to,File from,my_off_t start,
VOID(my_seek(from,start,MY_SEEK_SET,MYF(0)));
while (length > buff_length)
{
- if (my_read(from,(byte*) buff,buff_length,MYF(MY_NABP)) ||
- my_write(to,(byte*) buff,buff_length,param->myf_rw))
+ if (my_read(from,(uchar*) buff,buff_length,MYF(MY_NABP)) ||
+ my_write(to,(uchar*) buff,buff_length,param->myf_rw))
goto err;
length-= buff_length;
}
- if (my_read(from,(byte*) buff,(uint) length,MYF(MY_NABP)) ||
- my_write(to,(byte*) buff,(uint) length,param->myf_rw))
+ if (my_read(from,(uchar*) buff,(uint) length,MYF(MY_NABP)) ||
+ my_write(to,(uchar*) buff,(uint) length,param->myf_rw))
goto err;
if (buff != tmp_buff)
my_free(buff,MYF(0));
@@ -2141,7 +2143,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
info->opt_flag|=WRITE_CACHE_USED;
info->rec_cache.file=info->dfile; /* for sort_delete_record */
- if (!(sort_param.record=(byte*) my_malloc((uint) share->base.pack_reclength,
+ if (!(sort_param.record=(uchar*) my_malloc((uint) share->base.pack_reclength,
MYF(0))) ||
!mi_alloc_rec_buff(info, -1, &sort_param.rec_buff))
{
@@ -2454,8 +2456,8 @@ err:
my_free(mi_get_rec_buff_ptr(info, sort_param.rec_buff),
MYF(MY_ALLOW_ZERO_PTR));
my_free(sort_param.record,MYF(MY_ALLOW_ZERO_PTR));
- my_free((gptr) sort_info.key_block,MYF(MY_ALLOW_ZERO_PTR));
- my_free((gptr) sort_info.ft_buf, MYF(MY_ALLOW_ZERO_PTR));
+ my_free((uchar*) sort_info.key_block,MYF(MY_ALLOW_ZERO_PTR));
+ my_free((uchar*) sort_info.ft_buf, MYF(MY_ALLOW_ZERO_PTR));
my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR));
VOID(end_io_cache(&param->read_cache));
info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
@@ -2741,7 +2743,7 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
sort_param[i].filepos=new_header_length;
sort_param[i].max_pos=sort_param[i].pos=share->pack.header_length;
- sort_param[i].record= (((char *)(sort_param+share->base.keys))+
+ sort_param[i].record= (((uchar *)(sort_param+share->base.keys))+
(share->base.pack_reclength * i));
if (!mi_alloc_rec_buff(info, -1, &sort_param[i].rec_buff))
{
@@ -2987,9 +2989,9 @@ err:
pthread_cond_destroy (&sort_info.cond);
pthread_mutex_destroy(&sort_info.mutex);
- my_free((gptr) sort_info.ft_buf, MYF(MY_ALLOW_ZERO_PTR));
- my_free((gptr) sort_info.key_block,MYF(MY_ALLOW_ZERO_PTR));
- my_free((gptr) sort_param,MYF(MY_ALLOW_ZERO_PTR));
+ my_free((uchar*) sort_info.ft_buf, MYF(MY_ALLOW_ZERO_PTR));
+ my_free((uchar*) sort_info.key_block,MYF(MY_ALLOW_ZERO_PTR));
+ my_free((uchar*) sort_param,MYF(MY_ALLOW_ZERO_PTR));
my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR));
VOID(end_io_cache(&param->read_cache));
info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
@@ -3119,7 +3121,7 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param)
int parallel_flag;
uint found_record,b_type,left_length;
my_off_t pos;
- byte *to;
+ uchar *to;
MI_BLOCK_INFO block_info;
SORT_INFO *sort_info=sort_param->sort_info;
MI_CHECK *param=sort_info->param;
@@ -3197,7 +3199,7 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param)
llstr(param->search_after_block,llbuff),
llstr(sort_param->start_recpos,llbuff2));
if (_mi_read_cache(&sort_param->read_cache,
- (byte*) block_info.header,pos,
+ (uchar*) block_info.header,pos,
MI_BLOCK_INFO_HEADER_LENGTH,
(! found_record ? READING_NEXT : 0) |
parallel_flag | READING_HEADER))
@@ -3461,7 +3463,7 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param)
case COMPRESSED_RECORD:
for (searching=0 ;; searching=1, sort_param->pos++)
{
- if (_mi_read_cache(&sort_param->read_cache,(byte*) block_info.header,
+ if (_mi_read_cache(&sort_param->read_cache,(uchar*) block_info.header,
sort_param->pos,
share->pack.ref_length,READING_NEXT))
DBUG_RETURN(-1);
@@ -3489,7 +3491,7 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param)
llstr(sort_param->pos,llbuff));
continue;
}
- if (_mi_read_cache(&sort_param->read_cache,(byte*) sort_param->rec_buff,
+ if (_mi_read_cache(&sort_param->read_cache,(uchar*) sort_param->rec_buff,
block_info.filepos, block_info.rec_len,
READING_NEXT))
{
@@ -3545,8 +3547,8 @@ int sort_write_record(MI_SORT_PARAM *sort_param)
int flag;
uint length;
ulong block_length,reclength;
- byte *from;
- byte block_buff[8];
+ uchar *from;
+ uchar block_buff[8];
SORT_INFO *sort_info=sort_param->sort_info;
MI_CHECK *param=sort_info->param;
MI_INFO *info=sort_info->info;
@@ -3585,7 +3587,7 @@ int sort_write_record(MI_SORT_PARAM *sort_param)
DBUG_RETURN(1);
sort_info->buff_length=reclength;
}
- from=sort_info->buff+ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER);
+ from= sort_info->buff+ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER);
}
/* We can use info->checksum here as only one thread calls this. */
info->checksum=mi_checksum(info,sort_param->record);
@@ -3622,7 +3624,7 @@ int sort_write_record(MI_SORT_PARAM *sort_param)
length+= save_pack_length((uint) share->pack.version,
block_buff + length, info->blob_length);
if (my_b_write(&info->rec_cache,block_buff,length) ||
- my_b_write(&info->rec_cache,(byte*) sort_param->rec_buff,reclength))
+ my_b_write(&info->rec_cache,(uchar*) sort_param->rec_buff,reclength))
{
mi_check_print_error(param,"%d when writing to datafile",my_errno);
DBUG_RETURN(1);
@@ -3922,7 +3924,7 @@ static int sort_insert_key(MI_SORT_PARAM *sort_param,
/* Fill block with end-zero and write filled block */
mi_putint(anc_buff,key_block->last_length,nod_flag);
- bzero((byte*) anc_buff+key_block->last_length,
+ bzero((uchar*) anc_buff+key_block->last_length,
keyinfo->block_length- key_block->last_length);
key_file_length=info->state->key_file_length;
if ((filepos=_mi_new(info,keyinfo,DFLT_INIT_HITS)) == HA_OFFSET_ERROR)
@@ -3934,10 +3936,10 @@ static int sort_insert_key(MI_SORT_PARAM *sort_param,
if (_mi_write_keypage(info, keyinfo, filepos, DFLT_INIT_HITS, anc_buff))
DBUG_RETURN(1);
}
- else if (my_pwrite(info->s->kfile,(byte*) anc_buff,
+ else if (my_pwrite(info->s->kfile,(uchar*) anc_buff,
(uint) keyinfo->block_length,filepos, param->myf_rw))
DBUG_RETURN(1);
- DBUG_DUMP("buff",(byte*) anc_buff,mi_getint(anc_buff));
+ DBUG_DUMP("buff",(uchar*) anc_buff,mi_getint(anc_buff));
/* Write separator-key to block in next level */
if (sort_insert_key(sort_param,key_block+1,key_block->lastkey,filepos))
@@ -4028,7 +4030,7 @@ int flush_pending_blocks(MI_SORT_PARAM *sort_param)
if (nod_flag)
_mi_kpointer(info,key_block->end_pos,filepos);
key_file_length=info->state->key_file_length;
- bzero((byte*) key_block->buff+length, keyinfo->block_length-length);
+ bzero((uchar*) key_block->buff+length, keyinfo->block_length-length);
if ((filepos=_mi_new(info,keyinfo,DFLT_INIT_HITS)) == HA_OFFSET_ERROR)
DBUG_RETURN(1);
@@ -4039,10 +4041,10 @@ int flush_pending_blocks(MI_SORT_PARAM *sort_param)
DFLT_INIT_HITS, key_block->buff))
DBUG_RETURN(1);
}
- else if (my_pwrite(info->s->kfile,(byte*) key_block->buff,
+ else if (my_pwrite(info->s->kfile,(uchar*) key_block->buff,
(uint) keyinfo->block_length,filepos, myf_rw))
DBUG_RETURN(1);
- DBUG_DUMP("buff",(byte*) key_block->buff,length);
+ DBUG_DUMP("buff",(uchar*) key_block->buff,length);
nod_flag=1;
}
info->s->state.key_root[sort_param->key]=filepos; /* Last is root for tree */
@@ -4080,10 +4082,10 @@ int test_if_almost_full(MI_INFO *info)
{
if (info->s->options & HA_OPTION_COMPRESS_RECORD)
return 0;
- return (my_seek(info->s->kfile,0L,MY_SEEK_END,MYF(0))/10*9 >
- (my_off_t) (info->s->base.max_key_file_length) ||
- my_seek(info->dfile,0L,MY_SEEK_END,MYF(0))/10*9 >
- (my_off_t) info->s->base.max_data_file_length);
+ return my_seek(info->s->kfile, 0L, MY_SEEK_END, MYF(MY_THREADSAFE)) / 10 * 9 >
+ (my_off_t) info->s->base.max_key_file_length ||
+ my_seek(info->dfile, 0L, MY_SEEK_END, MYF(0)) / 10 * 9 >
+ (my_off_t) info->s->base.max_data_file_length;
}
/* Recreate table with bigger more alloced record-data */
@@ -4113,34 +4115,34 @@ int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename)
(param->testflag & T_UNPACK);
if (!(keyinfo=(MI_KEYDEF*) my_alloca(sizeof(MI_KEYDEF)*share.base.keys)))
DBUG_RETURN(0);
- memcpy((byte*) keyinfo,(byte*) share.keyinfo,
+ memcpy((uchar*) keyinfo,(uchar*) share.keyinfo,
(size_t) (sizeof(MI_KEYDEF)*share.base.keys));
key_parts= share.base.all_key_parts;
if (!(keysegs=(HA_KEYSEG*) my_alloca(sizeof(HA_KEYSEG)*
(key_parts+share.base.keys))))
{
- my_afree((gptr) keyinfo);
+ my_afree((uchar*) keyinfo);
DBUG_RETURN(1);
}
if (!(recdef=(MI_COLUMNDEF*)
my_alloca(sizeof(MI_COLUMNDEF)*(share.base.fields+1))))
{
- my_afree((gptr) keyinfo);
- my_afree((gptr) keysegs);
+ my_afree((uchar*) keyinfo);
+ my_afree((uchar*) keysegs);
DBUG_RETURN(1);
}
if (!(uniquedef=(MI_UNIQUEDEF*)
my_alloca(sizeof(MI_UNIQUEDEF)*(share.state.header.uniques+1))))
{
- my_afree((gptr) recdef);
- my_afree((gptr) keyinfo);
- my_afree((gptr) keysegs);
+ my_afree((uchar*) recdef);
+ my_afree((uchar*) keyinfo);
+ my_afree((uchar*) keysegs);
DBUG_RETURN(1);
}
/* Copy the column definitions */
- memcpy((byte*) recdef,(byte*) share.rec,
+ memcpy((uchar*) recdef,(uchar*) share.rec,
(size_t) (sizeof(MI_COLUMNDEF)*(share.base.fields+1)));
for (rec=recdef,end=recdef+share.base.fields; rec != end ; rec++)
{
@@ -4152,7 +4154,7 @@ int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename)
}
/* Change the new key to point at the saved key segments */
- memcpy((byte*) keysegs,(byte*) share.keyparts,
+ memcpy((uchar*) keysegs,(uchar*) share.keyparts,
(size_t) (sizeof(HA_KEYSEG)*(key_parts+share.base.keys+
share.state.header.uniques)));
keyseg=keysegs;
@@ -4169,7 +4171,7 @@ int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename)
/* Copy the unique definitions and change them to point at the new key
segments*/
- memcpy((byte*) uniquedef,(byte*) share.uniqueinfo,
+ memcpy((uchar*) uniquedef,(uchar*) share.uniqueinfo,
(size_t) (sizeof(MI_UNIQUEDEF)*(share.state.header.uniques)));
for (u_ptr=uniquedef,u_end=uniquedef+share.state.header.uniques;
u_ptr != u_end ; u_ptr++)
@@ -4251,10 +4253,10 @@ int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename)
goto end;
error=0;
end:
- my_afree((gptr) uniquedef);
- my_afree((gptr) keyinfo);
- my_afree((gptr) recdef);
- my_afree((gptr) keysegs);
+ my_afree((uchar*) uniquedef);
+ my_afree((uchar*) keyinfo);
+ my_afree((uchar*) recdef);
+ my_afree((uchar*) keysegs);
DBUG_RETURN(error);
}
@@ -4267,7 +4269,7 @@ int write_data_suffix(SORT_INFO *sort_info, my_bool fix_datafile)
if (info->s->options & HA_OPTION_COMPRESS_RECORD && fix_datafile)
{
- char buff[MEMMAP_EXTRA_MARGIN];
+ uchar buff[MEMMAP_EXTRA_MARGIN];
bzero(buff,sizeof(buff));
if (my_b_write(&info->rec_cache,buff,sizeof(buff)))
{
@@ -4357,7 +4359,7 @@ err:
void update_auto_increment_key(MI_CHECK *param, MI_INFO *info,
my_bool repair_only)
{
- byte *record;
+ uchar *record;
DBUG_ENTER("update_auto_increment_key");
if (!info->s->base.auto_key ||
@@ -4376,7 +4378,7 @@ void update_auto_increment_key(MI_CHECK *param, MI_INFO *info,
We have to use an allocated buffer instead of info->rec_buff as
_mi_put_key_in_record() may use info->rec_buff
*/
- if (!(record= (byte*) my_malloc((uint) info->s->base.pack_reclength,
+ if (!(record= (uchar*) my_malloc((uint) info->s->base.pack_reclength,
MYF(0))))
{
mi_check_print_error(param,"Not enough memory for extra record");
@@ -4504,10 +4506,10 @@ void update_key_parts(MI_KEYDEF *keyinfo, ulong *rec_per_key_part,
}
-static ha_checksum mi_byte_checksum(const byte *buf, uint length)
+static ha_checksum mi_byte_checksum(const uchar *buf, uint length)
{
ha_checksum crc;
- const byte *end=buf+length;
+ const uchar *end=buf+length;
for (crc=0; buf != end; buf++)
crc=((crc << 1) + *((uchar*) buf)) +
test(crc & (((ha_checksum) 1) << (8*sizeof(ha_checksum)-1)));
diff --git a/storage/myisam/mi_checksum.c b/storage/myisam/mi_checksum.c
index 711e87c1547..4e87de373bd 100644
--- a/storage/myisam/mi_checksum.c
+++ b/storage/myisam/mi_checksum.c
@@ -17,7 +17,7 @@
#include "myisamdef.h"
-ha_checksum mi_checksum(MI_INFO *info, const byte *buf)
+ha_checksum mi_checksum(MI_INFO *info, const uchar *buf)
{
uint i;
ha_checksum crc=0;
@@ -25,7 +25,7 @@ ha_checksum mi_checksum(MI_INFO *info, const byte *buf)
for (i=info->s->base.fields ; i-- ; buf+=(rec++)->length)
{
- const byte *pos;
+ const uchar *pos;
ulong length;
switch (rec->type) {
case FIELD_BLOB:
@@ -52,13 +52,13 @@ ha_checksum mi_checksum(MI_INFO *info, const byte *buf)
pos=buf;
break;
}
- crc=my_checksum(crc, pos ? pos : "", length);
+ crc=my_checksum(crc, pos ? pos : (uchar*) "", length);
}
return crc;
}
-ha_checksum mi_static_checksum(MI_INFO *info, const byte *pos)
+ha_checksum mi_static_checksum(MI_INFO *info, const uchar *pos)
{
return my_checksum(0, pos, info->s->base.reclength);
}
diff --git a/storage/myisam/mi_close.c b/storage/myisam/mi_close.c
index 47b7ba855c0..07105aea88d 100644
--- a/storage/myisam/mi_close.c
+++ b/storage/myisam/mi_close.c
@@ -87,8 +87,8 @@ int mi_close(register MI_INFO *info)
#endif
if (share->decode_trees)
{
- my_free((gptr) share->decode_trees,MYF(0));
- my_free((gptr) share->decode_tables,MYF(0));
+ my_free((uchar*) share->decode_trees,MYF(0));
+ my_free((uchar*) share->decode_tables,MYF(0));
}
#ifdef THREAD
thr_lock_delete(&share->lock);
@@ -102,19 +102,19 @@ int mi_close(register MI_INFO *info)
}
}
#endif
- my_free((gptr) info->s,MYF(0));
+ my_free((uchar*) info->s,MYF(0));
}
pthread_mutex_unlock(&THR_LOCK_myisam);
if (info->ftparser_param)
{
- my_free((gptr)info->ftparser_param, MYF(0));
+ my_free((uchar*)info->ftparser_param, MYF(0));
info->ftparser_param= 0;
}
if (info->dfile >= 0 && my_close(info->dfile,MYF(0)))
error = my_errno;
myisam_log_command(MI_LOG_CLOSE,info,NULL,0,error);
- my_free((gptr) info,MYF(0));
+ my_free((uchar*) info,MYF(0));
if (error)
{
diff --git a/storage/myisam/mi_create.c b/storage/myisam/mi_create.c
index 71d377c8b6b..0cac5f08b3b 100644
--- a/storage/myisam/mi_create.c
+++ b/storage/myisam/mi_create.c
@@ -76,7 +76,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
LINT_INIT(file);
errpos=0;
options=0;
- bzero((byte*) &share,sizeof(share));
+ bzero((uchar*) &share,sizeof(share));
if (flags & HA_DONT_TOUCH_DATA)
{
@@ -498,7 +498,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
goto err;
}
- bmove(share.state.header.file_version,(byte*) myisam_file_magic,4);
+ bmove(share.state.header.file_version,(uchar*) myisam_file_magic,4);
ci->old_options=options| (ci->old_options & HA_OPTION_TEMP_COMPRESS_RECORD ?
HA_OPTION_COMPRESS_RECORD |
HA_OPTION_TEMP_COMPRESS_RECORD: 0);
@@ -615,7 +615,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
(have_iext ? MY_REPLACE_EXT : MY_APPEND_EXT));
linkname_ptr=0;
/* Replace the current file */
- create_flag=MY_DELETE_OLD;
+ create_flag=(flags & HA_CREATE_KEEP_FILES) ? 0 : MY_DELETE_OLD;
}
/*
@@ -689,7 +689,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
fn_format(filename,name,"", MI_NAME_DEXT,
MY_UNPACK_FILENAME | MY_APPEND_EXT);
linkname_ptr=0;
- create_flag=MY_DELETE_OLD;
+ create_flag=(flags & HA_CREATE_KEEP_FILES) ? 0 : MY_DELETE_OLD;
}
if ((dfile=
my_create_with_symlink(linkname_ptr, filename, 0, create_mode,
diff --git a/storage/myisam/mi_delete.c b/storage/myisam/mi_delete.c
index 409930ff7fb..6fe31f30c19 100644
--- a/storage/myisam/mi_delete.c
+++ b/storage/myisam/mi_delete.c
@@ -32,7 +32,7 @@ static int _mi_ck_real_delete(register MI_INFO *info,MI_KEYDEF *keyinfo,
uchar *key, uint key_length, my_off_t *root);
-int mi_delete(MI_INFO *info,const byte *record)
+int mi_delete(MI_INFO *info,const uchar *record)
{
uint i;
uchar *old_key;
@@ -78,7 +78,7 @@ int mi_delete(MI_INFO *info,const byte *record)
info->s->keyinfo[i].version++;
if (info->s->keyinfo[i].flag & HA_FULLTEXT )
{
- if (_mi_ft_del(info,i,(char*) old_key,record,info->lastpos))
+ if (_mi_ft_del(info,i, old_key,record,info->lastpos))
goto err;
}
else
@@ -100,7 +100,7 @@ int mi_delete(MI_INFO *info,const byte *record)
info->state->records--;
mi_sizestore(lastpos,info->lastpos);
- myisam_log_command(MI_LOG_DELETE,info,(byte*) lastpos,sizeof(lastpos),0);
+ myisam_log_command(MI_LOG_DELETE,info,(uchar*) lastpos,sizeof(lastpos),0);
VOID(_mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE));
allow_break(); /* Allow SIGHUP & SIGINT */
if (info->invalidator != 0)
@@ -114,7 +114,7 @@ int mi_delete(MI_INFO *info,const byte *record)
err:
save_errno=my_errno;
mi_sizestore(lastpos,info->lastpos);
- myisam_log_command(MI_LOG_DELETE,info,(byte*) lastpos, sizeof(lastpos),0);
+ myisam_log_command(MI_LOG_DELETE,info,(uchar*) lastpos, sizeof(lastpos),0);
if (save_errno != HA_ERR_RECORD_CHANGED)
{
mi_print_error(info->s, HA_ERR_CRASHED);
@@ -198,7 +198,7 @@ static int _mi_ck_real_delete(register MI_INFO *info, MI_KEYDEF *keyinfo,
}
}
err:
- my_afree((gptr) root_buff);
+ my_afree((uchar*) root_buff);
DBUG_PRINT("exit",("Return: %d",error));
DBUG_RETURN(error);
} /* _mi_ck_real_delete */
@@ -223,7 +223,7 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
my_off_t leaf_page,next_block;
uchar lastkey[MI_MAX_KEY_BUFF];
DBUG_ENTER("d_search");
- DBUG_DUMP("page",(byte*) anc_buff,mi_getint(anc_buff));
+ DBUG_DUMP("page",(uchar*) anc_buff,mi_getint(anc_buff));
search_key_length= (comp_flag & SEARCH_FIND) ? key_length : USE_WHOLE_KEY;
flag=(*keyinfo->bin_search)(info,keyinfo,anc_buff,key, search_key_length,
@@ -250,7 +250,7 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
if (info->ft1_to_ft2)
{
/* we're in ft1->ft2 conversion mode. Saving key data */
- insert_dynamic(info->ft1_to_ft2, (char*) (lastkey+off));
+ insert_dynamic(info->ft1_to_ft2, (lastkey+off));
}
else
{
@@ -381,14 +381,14 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
ret_value|=_mi_write_keypage(info,keyinfo,page,DFLT_INIT_HITS,anc_buff);
else
{
- DBUG_DUMP("page",(byte*) anc_buff,mi_getint(anc_buff));
+ DBUG_DUMP("page",(uchar*) anc_buff,mi_getint(anc_buff));
}
- my_afree((byte*) leaf_buff);
+ my_afree((uchar*) leaf_buff);
DBUG_PRINT("exit",("Return: %d",ret_value));
DBUG_RETURN(ret_value);
err:
- my_afree((byte*) leaf_buff);
+ my_afree((uchar*) leaf_buff);
DBUG_PRINT("exit",("Error: %d",my_errno));
DBUG_RETURN (-1);
} /* d_search */
@@ -411,7 +411,7 @@ static int del(register MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *key,
DBUG_ENTER("del");
DBUG_PRINT("enter",("leaf_page: %ld keypos: 0x%lx", (long) leaf_page,
(ulong) keypos));
- DBUG_DUMP("leaf_buff",(byte*) leaf_buff,mi_getint(leaf_buff));
+ DBUG_DUMP("leaf_buff",(uchar*) leaf_buff,mi_getint(leaf_buff));
endpos=leaf_buff+mi_getint(leaf_buff);
if (!(key_start=_mi_get_last_key(info,keyinfo,leaf_buff,keybuff,endpos,
@@ -428,7 +428,7 @@ static int del(register MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *key,
ret_value= -1;
else
{
- DBUG_DUMP("next_page",(byte*) next_buff,mi_getint(next_buff));
+ DBUG_DUMP("next_page",(uchar*) next_buff,mi_getint(next_buff));
if ((ret_value=del(info,keyinfo,key,anc_buff,next_page,next_buff,
keypos,next_block,ret_key)) >0)
{
@@ -455,7 +455,7 @@ static int del(register MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *key,
if (_mi_write_keypage(info,keyinfo,leaf_page,DFLT_INIT_HITS,leaf_buff))
goto err;
}
- my_afree((byte*) next_buff);
+ my_afree((uchar*) next_buff);
DBUG_RETURN(ret_value);
}
@@ -479,7 +479,7 @@ static int del(register MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *key,
prev_key, prev_key,
keybuff,&s_temp);
if (length > 0)
- bmove_upp((byte*) endpos+length,(byte*) endpos,(uint) (endpos-keypos));
+ bmove_upp((uchar*) endpos+length,(uchar*) endpos,(uint) (endpos-keypos));
else
bmove(keypos,keypos-length, (int) (endpos-keypos)+length);
(*keyinfo->store_key)(keyinfo,keypos,&s_temp);
@@ -517,8 +517,8 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo,
DBUG_ENTER("underflow");
DBUG_PRINT("enter",("leaf_page: %ld keypos: 0x%lx",(long) leaf_page,
(ulong) keypos));
- DBUG_DUMP("anc_buff",(byte*) anc_buff,mi_getint(anc_buff));
- DBUG_DUMP("leaf_buff",(byte*) leaf_buff,mi_getint(leaf_buff));
+ DBUG_DUMP("anc_buff",(uchar*) anc_buff,mi_getint(anc_buff));
+ DBUG_DUMP("leaf_buff",(uchar*) leaf_buff,mi_getint(leaf_buff));
buff=info->buff;
info->buff_used=1;
@@ -554,10 +554,10 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo,
if (!_mi_fetch_keypage(info,keyinfo,next_page,DFLT_INIT_HITS,buff,0))
goto err;
buff_length=mi_getint(buff);
- DBUG_DUMP("next",(byte*) buff,buff_length);
+ DBUG_DUMP("next",(uchar*) buff,buff_length);
/* find keys to make a big key-page */
- bmove((byte*) next_keypos-key_reflength,(byte*) buff+2,
+ bmove((uchar*) next_keypos-key_reflength,(uchar*) buff+2,
key_reflength);
if (!_mi_get_last_key(info,keyinfo,anc_buff,anc_key,next_keypos,&length)
|| !_mi_get_last_key(info,keyinfo,leaf_buff,leaf_key,
@@ -572,8 +572,8 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo,
length=buff_length-p_length;
endpos=buff+length+leaf_length+t_length;
/* buff will always be larger than before !*/
- bmove_upp((byte*) endpos, (byte*) buff+buff_length,length);
- memcpy((byte*) buff, (byte*) leaf_buff,(size_t) leaf_length);
+ bmove_upp((uchar*) endpos, (uchar*) buff+buff_length,length);
+ memcpy((uchar*) buff, (uchar*) leaf_buff,(size_t) leaf_length);
(*keyinfo->store_key)(keyinfo,buff+leaf_length,&s_temp);
buff_length=(uint) (endpos-buff);
mi_putint(buff,buff_length,nod_flag);
@@ -589,7 +589,7 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo,
if (buff_length <= keyinfo->block_length)
{ /* Keys in one page */
- memcpy((byte*) leaf_buff,(byte*) buff,(size_t) buff_length);
+ memcpy((uchar*) leaf_buff,(uchar*) buff,(size_t) buff_length);
if (_mi_dispose(info,keyinfo,next_page,DFLT_INIT_HITS))
goto err;
}
@@ -605,7 +605,7 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo,
&key_length, &after_key)))
goto err;
length=(uint) (half_pos-buff);
- memcpy((byte*) leaf_buff,(byte*) buff,(size_t) length);
+ memcpy((uchar*) leaf_buff,(uchar*) buff,(size_t) length);
mi_putint(leaf_buff,length,nod_flag);
/* Correct new keypointer to leaf_page */
@@ -619,7 +619,7 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo,
prev_key, prev_key,
leaf_key, &s_temp);
if (t_length >= 0)
- bmove_upp((byte*) endpos+t_length,(byte*) endpos,
+ bmove_upp((uchar*) endpos+t_length,(uchar*) endpos,
(uint) (endpos-keypos));
else
bmove(keypos,keypos-t_length,(uint) (endpos-keypos)+t_length);
@@ -628,7 +628,7 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo,
/* Store key first in new page */
if (nod_flag)
- bmove((byte*) buff+2,(byte*) half_pos-nod_flag,(size_t) nod_flag);
+ bmove((uchar*) buff+2,(uchar*) half_pos-nod_flag,(size_t) nod_flag);
if (!(*keyinfo->get_key)(keyinfo,nod_flag,&half_pos,leaf_key))
goto err;
t_length=(int) (*keyinfo->pack_key)(keyinfo, nod_flag, (uchar*) 0,
@@ -636,7 +636,7 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo,
leaf_key, &s_temp);
/* t_length will always be > 0 for a new page !*/
length=(uint) ((buff+mi_getint(buff))-half_pos);
- bmove((byte*) buff+p_length+t_length,(byte*) half_pos,(size_t) length);
+ bmove((uchar*) buff+p_length+t_length,(uchar*) half_pos,(size_t) length);
(*keyinfo->store_key)(keyinfo,buff+p_length,&s_temp);
mi_putint(buff,length+t_length+p_length,nod_flag);
@@ -659,10 +659,10 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo,
goto err;
buff_length=mi_getint(buff);
endpos=buff+buff_length;
- DBUG_DUMP("prev",(byte*) buff,buff_length);
+ DBUG_DUMP("prev",(uchar*) buff,buff_length);
/* find keys to make a big key-page */
- bmove((byte*) next_keypos - key_reflength,(byte*) leaf_buff+2,
+ bmove((uchar*) next_keypos - key_reflength,(uchar*) leaf_buff+2,
key_reflength);
next_keypos=keypos;
if (!(*keyinfo->get_key)(keyinfo,key_reflength,&next_keypos,
@@ -679,10 +679,10 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo,
prev_key, prev_key,
anc_key, &s_temp);
if (t_length >= 0)
- bmove((byte*) endpos+t_length,(byte*) leaf_buff+p_length,
+ bmove((uchar*) endpos+t_length,(uchar*) leaf_buff+p_length,
(size_t) (leaf_length-p_length));
else /* We gained space */
- bmove((byte*) endpos,(byte*) leaf_buff+((int) p_length-t_length),
+ bmove((uchar*) endpos,(uchar*) leaf_buff+((int) p_length-t_length),
(size_t) (leaf_length-p_length+t_length));
(*keyinfo->store_key)(keyinfo,endpos,&s_temp);
@@ -715,8 +715,8 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo,
goto err;
_mi_kpointer(info,leaf_key+key_length,leaf_page);
/* Save key in anc_buff */
- DBUG_DUMP("anc_buff",(byte*) anc_buff,anc_length);
- DBUG_DUMP("key_to_anc",(byte*) leaf_key,key_length);
+ DBUG_DUMP("anc_buff",(uchar*) anc_buff,anc_length);
+ DBUG_DUMP("key_to_anc",(uchar*) leaf_key,key_length);
temp_pos=anc_buff+anc_length;
t_length=(*keyinfo->pack_key)(keyinfo,key_reflength,
@@ -725,7 +725,7 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo,
anc_pos, anc_pos,
leaf_key,&s_temp);
if (t_length > 0)
- bmove_upp((byte*) temp_pos+t_length,(byte*) temp_pos,
+ bmove_upp((uchar*) temp_pos+t_length,(uchar*) temp_pos,
(uint) (temp_pos-keypos));
else
bmove(keypos,keypos-t_length,(uint) (temp_pos-keypos)+t_length);
@@ -734,15 +734,15 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo,
/* Store first key on new page */
if (nod_flag)
- bmove((byte*) leaf_buff+2,(byte*) half_pos-nod_flag,(size_t) nod_flag);
+ bmove((uchar*) leaf_buff+2,(uchar*) half_pos-nod_flag,(size_t) nod_flag);
if (!(length=(*keyinfo->get_key)(keyinfo,nod_flag,&half_pos,leaf_key)))
goto err;
- DBUG_DUMP("key_to_leaf",(byte*) leaf_key,length);
+ DBUG_DUMP("key_to_leaf",(uchar*) leaf_key,length);
t_length=(*keyinfo->pack_key)(keyinfo,nod_flag, (uchar*) 0,
(uchar*) 0, (uchar*) 0, leaf_key, &s_temp);
length=(uint) ((buff+buff_length)-half_pos);
DBUG_PRINT("info",("t_length: %d length: %d",t_length,(int) length));
- bmove((byte*) leaf_buff+p_length+t_length,(byte*) half_pos,
+ bmove((uchar*) leaf_buff+p_length+t_length,(uchar*) half_pos,
(size_t) length);
(*keyinfo->store_key)(keyinfo,leaf_buff+p_length,&s_temp);
mi_putint(leaf_buff,length+t_length+p_length,nod_flag);
@@ -806,7 +806,7 @@ static uint remove_key(MI_KEYDEF *keyinfo, uint nod_flag,
if (next_length > prev_length)
{
/* We have to copy data from the current key to the next key */
- bmove_upp((char*) keypos,(char*) (lastkey+next_length),
+ bmove_upp(keypos, (lastkey+next_length),
(next_length-prev_length));
keypos-=(next_length-prev_length)+prev_pack_length;
store_key_length(keypos,prev_length);
@@ -853,7 +853,7 @@ static uint remove_key(MI_KEYDEF *keyinfo, uint nod_flag,
if (next_length >= prev_length)
{ /* Key after is based on deleted key */
uint pack_length,tmp;
- bmove_upp((char*) keypos,(char*) (lastkey+next_length),
+ bmove_upp(keypos, (lastkey+next_length),
tmp=(next_length-prev_length));
rest_length+=tmp;
pack_length= prev_length ? get_pack_length(rest_length): 0;
@@ -886,7 +886,7 @@ static uint remove_key(MI_KEYDEF *keyinfo, uint nod_flag,
}
}
end:
- bmove((byte*) start,(byte*) start+s_length,
+ bmove((uchar*) start,(uchar*) start+s_length,
(uint) (page_end-start-s_length));
DBUG_RETURN((uint) s_length);
} /* remove_key */
diff --git a/storage/myisam/mi_delete_all.c b/storage/myisam/mi_delete_all.c
index a17514486d5..dea0385cbca 100644
--- a/storage/myisam/mi_delete_all.c
+++ b/storage/myisam/mi_delete_all.c
@@ -47,7 +47,7 @@ int mi_delete_all_rows(MI_INFO *info)
for (i=0 ; i < share->base.keys ; i++)
state->key_root[i]= HA_OFFSET_ERROR;
- myisam_log_command(MI_LOG_DELETE_ALL,info,(byte*) 0,0,0);
+ myisam_log_command(MI_LOG_DELETE_ALL,info,(uchar*) 0,0,0);
/*
If we are using delayed keys or if the user has done changes to the tables
since it was locked then there may be key blocks in the key cache
diff --git a/storage/myisam/mi_dynrec.c b/storage/myisam/mi_dynrec.c
index 5342619c79b..cdd70abe9ad 100644
--- a/storage/myisam/mi_dynrec.c
+++ b/storage/myisam/mi_dynrec.c
@@ -28,15 +28,15 @@
/* Enough for comparing if number is zero */
static char zero_string[]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-static int write_dynamic_record(MI_INFO *info,const byte *record,
+static int write_dynamic_record(MI_INFO *info,const uchar *record,
ulong reclength);
static int _mi_find_writepos(MI_INFO *info,ulong reclength,my_off_t *filepos,
ulong *length);
-static int update_dynamic_record(MI_INFO *info,my_off_t filepos,byte *record,
+static int update_dynamic_record(MI_INFO *info,my_off_t filepos,uchar *record,
ulong reclength);
static int delete_dynamic_record(MI_INFO *info,my_off_t filepos,
uint second_read);
-static int _mi_cmp_buffer(File file, const byte *buff, my_off_t filepos,
+static int _mi_cmp_buffer(File file, const uchar *buff, my_off_t filepos,
uint length);
#ifdef THREAD
@@ -79,19 +79,19 @@ my_bool mi_dynmap_file(MI_INFO *info, my_off_t size)
mapping. When swap space is not reserved one might get SIGSEGV
upon a write if no physical memory is available.
*/
- info->s->file_map= (byte*)
+ info->s->file_map= (uchar*)
my_mmap(0, (size_t)(size + MEMMAP_EXTRA_MARGIN),
info->s->mode==O_RDONLY ? PROT_READ :
PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_NORESERVE,
info->dfile, 0L);
- if (info->s->file_map == (byte*) MAP_FAILED)
+ if (info->s->file_map == (uchar*) MAP_FAILED)
{
info->s->file_map= NULL;
DBUG_RETURN(1);
}
#if defined(HAVE_MADVISE)
- madvise(info->s->file_map, size, MADV_RANDOM);
+ madvise((char*) info->s->file_map, size, MADV_RANDOM);
#endif
info->s->mmaped_length= size;
DBUG_RETURN(0);
@@ -112,7 +112,7 @@ void mi_remap_file(MI_INFO *info, my_off_t size)
{
if (info->s->file_map)
{
- VOID(my_munmap(info->s->file_map,
+ VOID(my_munmap((char*) info->s->file_map,
(size_t) info->s->mmaped_length + MEMMAP_EXTRA_MARGIN));
mi_dynmap_file(info, size);
}
@@ -135,8 +135,8 @@ void mi_remap_file(MI_INFO *info, my_off_t size)
0 ok
*/
-uint mi_mmap_pread(MI_INFO *info, byte *Buffer,
- uint Count, my_off_t offset, myf MyFlags)
+size_t mi_mmap_pread(MI_INFO *info, uchar *Buffer,
+ size_t Count, my_off_t offset, myf MyFlags)
{
DBUG_PRINT("info", ("mi_read with mmap %d\n", info->dfile));
if (info->s->concurrent_insert)
@@ -167,8 +167,8 @@ uint mi_mmap_pread(MI_INFO *info, byte *Buffer,
/* wrapper for my_pread in case if mmap isn't used */
-uint mi_nommap_pread(MI_INFO *info, byte *Buffer,
- uint Count, my_off_t offset, myf MyFlags)
+size_t mi_nommap_pread(MI_INFO *info, uchar *Buffer,
+ size_t Count, my_off_t offset, myf MyFlags)
{
return my_pread(info->dfile, Buffer, Count, offset, MyFlags);
}
@@ -190,8 +190,8 @@ uint mi_nommap_pread(MI_INFO *info, byte *Buffer,
!=0 error. In this case return error from pwrite
*/
-uint mi_mmap_pwrite(MI_INFO *info, byte *Buffer,
- uint Count, my_off_t offset, myf MyFlags)
+size_t mi_mmap_pwrite(MI_INFO *info, const uchar *Buffer,
+ size_t Count, my_off_t offset, myf MyFlags)
{
DBUG_PRINT("info", ("mi_write with mmap %d\n", info->dfile));
if (info->s->concurrent_insert)
@@ -224,28 +224,28 @@ uint mi_mmap_pwrite(MI_INFO *info, byte *Buffer,
/* wrapper for my_pwrite in case if mmap isn't used */
-uint mi_nommap_pwrite(MI_INFO *info, byte *Buffer,
- uint Count, my_off_t offset, myf MyFlags)
+size_t mi_nommap_pwrite(MI_INFO *info, const uchar *Buffer,
+ size_t Count, my_off_t offset, myf MyFlags)
{
return my_pwrite(info->dfile, Buffer, Count, offset, MyFlags);
}
-int _mi_write_dynamic_record(MI_INFO *info, const byte *record)
+int _mi_write_dynamic_record(MI_INFO *info, const uchar *record)
{
ulong reclength=_mi_rec_pack(info,info->rec_buff,record);
return (write_dynamic_record(info,info->rec_buff,reclength));
}
-int _mi_update_dynamic_record(MI_INFO *info, my_off_t pos, const byte *record)
+int _mi_update_dynamic_record(MI_INFO *info, my_off_t pos, const uchar *record)
{
uint length=_mi_rec_pack(info,info->rec_buff,record);
return (update_dynamic_record(info,pos,info->rec_buff,length));
}
-int _mi_write_blob_record(MI_INFO *info, const byte *record)
+int _mi_write_blob_record(MI_INFO *info, const uchar *record)
{
- byte *rec_buff;
+ uchar *rec_buff;
int error;
ulong reclength,reclength2,extra;
@@ -260,7 +260,7 @@ int _mi_write_blob_record(MI_INFO *info, const byte *record)
return -1;
}
#endif
- if (!(rec_buff=(byte*) my_alloca(reclength)))
+ if (!(rec_buff=(uchar*) my_alloca(reclength)))
{
my_errno= HA_ERR_OUT_OF_MEM; /* purecov: inspected */
return(-1);
@@ -277,9 +277,9 @@ int _mi_write_blob_record(MI_INFO *info, const byte *record)
}
-int _mi_update_blob_record(MI_INFO *info, my_off_t pos, const byte *record)
+int _mi_update_blob_record(MI_INFO *info, my_off_t pos, const uchar *record)
{
- byte *rec_buff;
+ uchar *rec_buff;
int error;
ulong reclength,extra;
@@ -294,7 +294,7 @@ int _mi_update_blob_record(MI_INFO *info, my_off_t pos, const byte *record)
return -1;
}
#endif
- if (!(rec_buff=(byte*) my_alloca(reclength)))
+ if (!(rec_buff=(uchar*) my_alloca(reclength)))
{
my_errno= HA_ERR_OUT_OF_MEM; /* purecov: inspected */
return(-1);
@@ -317,7 +317,7 @@ int _mi_delete_dynamic_record(MI_INFO *info)
/* Write record to data-file */
-static int write_dynamic_record(MI_INFO *info, const byte *record,
+static int write_dynamic_record(MI_INFO *info, const uchar *record,
ulong reclength)
{
int flag;
@@ -333,7 +333,7 @@ static int write_dynamic_record(MI_INFO *info, const byte *record,
if (_mi_write_part_record(info,filepos,length,
(info->append_insert_at_end ?
HA_OFFSET_ERROR : info->s->state.dellink),
- (byte**) &record,&reclength,&flag))
+ (uchar**) &record,&reclength,&flag))
goto err;
} while (reclength);
@@ -424,7 +424,7 @@ static bool unlink_deleted_block(MI_INFO *info, MI_BLOCK_INFO *block_info)
& BLOCK_DELETED))
DBUG_RETURN(1); /* Something is wrong */
mi_sizestore(tmp.header+4,block_info->next_filepos);
- if (info->s->file_write(info,(char*) tmp.header+4,8,
+ if (info->s->file_write(info, tmp.header+4,8,
block_info->prev_filepos+4, MYF(MY_NABP)))
DBUG_RETURN(1);
/* Unlink block from next block */
@@ -434,7 +434,7 @@ static bool unlink_deleted_block(MI_INFO *info, MI_BLOCK_INFO *block_info)
& BLOCK_DELETED))
DBUG_RETURN(1); /* Something is wrong */
mi_sizestore(tmp.header+12,block_info->prev_filepos);
- if (info->s->file_write(info,(char*) tmp.header+12,8,
+ if (info->s->file_write(info, tmp.header+12,8,
block_info->next_filepos+12,
MYF(MY_NABP)))
DBUG_RETURN(1);
@@ -483,7 +483,7 @@ static int update_backward_delete_link(MI_INFO *info, my_off_t delete_block,
if (_mi_get_block_info(&block_info,info->dfile,delete_block)
& BLOCK_DELETED)
{
- char buff[8];
+ uchar buff[8];
mi_sizestore(buff,filepos);
if (info->s->file_write(info,buff, 8, delete_block+12, MYF(MY_NABP)))
DBUG_RETURN(1); /* Error on write */
@@ -543,7 +543,7 @@ static int delete_dynamic_record(MI_INFO *info, my_off_t filepos,
bfill(block_info.header+12,8,255);
else
mi_sizestore(block_info.header+12,block_info.next_filepos);
- if (info->s->file_write(info,(byte*) block_info.header,20,filepos,
+ if (info->s->file_write(info,(uchar*) block_info.header,20,filepos,
MYF(MY_NABP)))
DBUG_RETURN(1);
info->s->state.dellink = filepos;
@@ -566,12 +566,12 @@ int _mi_write_part_record(MI_INFO *info,
my_off_t filepos, /* points at empty block */
ulong length, /* length of block */
my_off_t next_filepos,/* Next empty block */
- byte **record, /* pointer to record ptr */
+ uchar **record, /* pointer to record ptr */
ulong *reclength, /* length of *record */
int *flag) /* *flag == 0 if header */
{
ulong head_length,res_length,extra_length,long_block,del_length;
- byte *pos,*record_end;
+ uchar *pos,*record_end;
my_off_t next_delete_block;
uchar temp[MI_SPLIT_LENGTH+MI_DYN_DELETE_BLOCK_HEADER];
DBUG_ENTER("_mi_write_part_record");
@@ -615,7 +615,7 @@ int _mi_write_part_record(MI_INFO *info,
temp[0]=13;
mi_int4store(temp+1,*reclength);
mi_int3store(temp+5,length-head_length);
- mi_sizestore((byte*) temp+8,next_filepos);
+ mi_sizestore((uchar*) temp+8,next_filepos);
}
else
{
@@ -625,13 +625,13 @@ int _mi_write_part_record(MI_INFO *info,
{
mi_int3store(temp+1,*reclength);
mi_int3store(temp+4,length-head_length);
- mi_sizestore((byte*) temp+7,next_filepos);
+ mi_sizestore((uchar*) temp+7,next_filepos);
}
else
{
mi_int2store(temp+1,*reclength);
mi_int2store(temp+3,length-head_length);
- mi_sizestore((byte*) temp+5,next_filepos);
+ mi_sizestore((uchar*) temp+5,next_filepos);
}
}
}
@@ -642,12 +642,12 @@ int _mi_write_part_record(MI_INFO *info,
if (long_block)
{
mi_int3store(temp+1,length-head_length);
- mi_sizestore((byte*) temp+4,next_filepos);
+ mi_sizestore((uchar*) temp+4,next_filepos);
}
else
{
mi_int2store(temp+1,length-head_length);
- mi_sizestore((byte*) temp+3,next_filepos);
+ mi_sizestore((uchar*) temp+3,next_filepos);
}
}
}
@@ -668,14 +668,14 @@ int _mi_write_part_record(MI_INFO *info,
}
length= *reclength+head_length; /* Write only what is needed */
}
- DBUG_DUMP("header",(byte*) temp,head_length);
+ DBUG_DUMP("header",(uchar*) temp,head_length);
/* Make a long block for one write */
record_end= *record+length-head_length;
del_length=(res_length ? MI_DYN_DELETE_BLOCK_HEADER : 0);
- bmove((byte*) (*record-head_length),(byte*) temp,head_length);
+ bmove((uchar*) (*record-head_length),(uchar*) temp,head_length);
memcpy(temp,record_end,(size_t) (extra_length+del_length));
- bzero((byte*) record_end,extra_length);
+ bzero((uchar*) record_end,extra_length);
if (res_length)
{
@@ -715,18 +715,18 @@ int _mi_write_part_record(MI_INFO *info,
if (info->update & HA_STATE_EXTEND_BLOCK)
{
info->update&= ~HA_STATE_EXTEND_BLOCK;
- if (my_block_write(&info->rec_cache,(byte*) *record-head_length,
+ if (my_block_write(&info->rec_cache,(uchar*) *record-head_length,
length+extra_length+del_length,filepos))
goto err;
}
- else if (my_b_write(&info->rec_cache,(byte*) *record-head_length,
+ else if (my_b_write(&info->rec_cache,(uchar*) *record-head_length,
length+extra_length+del_length))
goto err;
}
else
{
info->rec_cache.seek_not_done=1;
- if (info->s->file_write(info,(byte*) *record-head_length,length+extra_length+
+ if (info->s->file_write(info,(uchar*) *record-head_length,length+extra_length+
del_length,filepos,info->s->write_flag))
goto err;
}
@@ -752,7 +752,7 @@ err:
/* update record from datafile */
-static int update_dynamic_record(MI_INFO *info, my_off_t filepos, byte *record,
+static int update_dynamic_record(MI_INFO *info, my_off_t filepos, uchar *record,
ulong reclength)
{
int flag;
@@ -836,7 +836,7 @@ static int update_dynamic_record(MI_INFO *info, my_off_t filepos, byte *record,
mi_int3store(del_block.header+1, rest_length);
mi_sizestore(del_block.header+4,info->s->state.dellink);
bfill(del_block.header+12,8,255);
- if (info->s->file_write(info,(byte*) del_block.header,20, next_pos,
+ if (info->s->file_write(info,(uchar*) del_block.header,20, next_pos,
MYF(MY_NABP)))
DBUG_RETURN(1);
info->s->state.dellink= next_pos;
@@ -875,10 +875,11 @@ err:
/* Pack a record. Return new reclength */
-uint _mi_rec_pack(MI_INFO *info, register byte *to, register const byte *from)
+uint _mi_rec_pack(MI_INFO *info, register uchar *to,
+ register const uchar *from)
{
uint length,new_length,flag,bit,i;
- char *pos,*end,*startpos,*packpos;
+ uchar *pos,*end,*startpos,*packpos;
enum en_fieldtype type;
reg3 MI_COLUMNDEF *rec;
MI_BLOB *blob;
@@ -901,7 +902,7 @@ uint _mi_rec_pack(MI_INFO *info, register byte *to, register const byte *from)
{
char *temp_pos;
size_t tmp_length=length-mi_portable_sizeof_char_ptr;
- memcpy((byte*) to,from,tmp_length);
+ memcpy((uchar*) to,from,tmp_length);
memcpy_fixed(&temp_pos,from+tmp_length,sizeof(char*));
memcpy(to+tmp_length,temp_pos,(size_t) blob->length);
to+=tmp_length+blob->length;
@@ -910,17 +911,17 @@ uint _mi_rec_pack(MI_INFO *info, register byte *to, register const byte *from)
}
else if (type == FIELD_SKIP_ZERO)
{
- if (memcmp((byte*) from,zero_string,length) == 0)
+ if (memcmp((uchar*) from,zero_string,length) == 0)
flag|=bit;
else
{
- memcpy((byte*) to,from,(size_t) length); to+=length;
+ memcpy((uchar*) to,from,(size_t) length); to+=length;
}
}
else if (type == FIELD_SKIP_ENDSPACE ||
type == FIELD_SKIP_PRESPACE)
{
- pos= (byte*) from; end= (byte*) from + length;
+ pos= (uchar*) from; end= (uchar*) from + length;
if (type == FIELD_SKIP_ENDSPACE)
{ /* Pack trailing spaces */
while (end > from && *(end-1) == ' ')
@@ -943,7 +944,7 @@ uint _mi_rec_pack(MI_INFO *info, register byte *to, register const byte *from)
}
else
*to++= (char) new_length;
- memcpy((byte*) to,pos,(size_t) new_length); to+=new_length;
+ memcpy((uchar*) to,pos,(size_t) new_length); to+=new_length;
flag|=bit;
}
else
@@ -1000,11 +1001,11 @@ uint _mi_rec_pack(MI_INFO *info, register byte *to, register const byte *from)
Returns 0 if record is ok.
*/
-my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *rec_buff,
+my_bool _mi_rec_check(MI_INFO *info,const uchar *record, uchar *rec_buff,
ulong packed_length, my_bool with_checksum)
{
uint length,new_length,flag,bit,i;
- char *pos,*end,*packpos,*to;
+ uchar *pos,*end,*packpos,*to;
enum en_fieldtype type;
reg3 MI_COLUMNDEF *rec;
DBUG_ENTER("_mi_rec_check");
@@ -1029,7 +1030,7 @@ my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *rec_buff,
}
else if (type == FIELD_SKIP_ZERO)
{
- if (memcmp((byte*) record,zero_string,length) == 0)
+ if (memcmp((uchar*) record,zero_string,length) == 0)
{
if (!(flag & bit))
goto err;
@@ -1040,7 +1041,7 @@ my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *rec_buff,
else if (type == FIELD_SKIP_ENDSPACE ||
type == FIELD_SKIP_PRESPACE)
{
- pos= (byte*) record; end= (byte*) record + length;
+ pos= (uchar*) record; end= (uchar*) record + length;
if (type == FIELD_SKIP_ENDSPACE)
{ /* Pack trailing spaces */
while (end > record && *(end-1) == ' ')
@@ -1122,12 +1123,12 @@ err:
/* Returns -1 and my_errno =HA_ERR_RECORD_DELETED if reclength isn't */
/* right. Returns reclength (>0) if ok */
-ulong _mi_rec_unpack(register MI_INFO *info, register byte *to, byte *from,
+ulong _mi_rec_unpack(register MI_INFO *info, register uchar *to, uchar *from,
ulong found_length)
{
uint flag,bit,length,rec_length,min_pack_length;
enum en_fieldtype type;
- byte *from_end,*to_end,*packpos;
+ uchar *from_end,*to_end,*packpos;
reg3 MI_COLUMNDEF *rec,*end_field;
DBUG_ENTER("_mi_rec_unpack");
@@ -1173,7 +1174,7 @@ ulong _mi_rec_unpack(register MI_INFO *info, register byte *to, byte *from,
if (flag & bit)
{
if (type == FIELD_BLOB || type == FIELD_SKIP_ZERO)
- bzero((byte*) to,rec_length);
+ bzero((uchar*) to,rec_length);
else if (type == FIELD_SKIP_ENDSPACE ||
type == FIELD_SKIP_PRESPACE)
{
@@ -1195,13 +1196,13 @@ ulong _mi_rec_unpack(register MI_INFO *info, register byte *to, byte *from,
goto err;
if (type == FIELD_SKIP_ENDSPACE)
{
- memcpy(to,(byte*) from,(size_t) length);
- bfill((byte*) to+length,rec_length-length,' ');
+ memcpy(to,(uchar*) from,(size_t) length);
+ bfill((uchar*) to+length,rec_length-length,' ');
}
else
{
- bfill((byte*) to,rec_length-length,' ');
- memcpy(to+rec_length-length,(byte*) from,(size_t) length);
+ bfill((uchar*) to,rec_length-length,' ');
+ memcpy(to+rec_length-length,(uchar*) from,(size_t) length);
}
from+=length;
}
@@ -1215,9 +1216,9 @@ ulong _mi_rec_unpack(register MI_INFO *info, register byte *to, byte *from,
from_left - size_length < blob_length ||
from_left - size_length - blob_length < min_pack_length)
goto err;
- memcpy((byte*) to,(byte*) from,(size_t) size_length);
+ memcpy((uchar*) to,(uchar*) from,(size_t) size_length);
from+=size_length;
- memcpy_fixed((byte*) to+size_length,(byte*) &from,sizeof(char*));
+ memcpy_fixed((uchar*) to+size_length,(uchar*) &from,sizeof(char*));
from+=blob_length;
}
else
@@ -1226,7 +1227,7 @@ ulong _mi_rec_unpack(register MI_INFO *info, register byte *to, byte *from,
min_pack_length--;
if (min_pack_length + rec_length > (uint) (from_end - from))
goto err;
- memcpy(to,(byte*) from,(size_t) rec_length); from+=rec_length;
+ memcpy(to,(uchar*) from,(size_t) rec_length); from+=rec_length;
}
if ((bit= bit << 1) >= 256)
{
@@ -1238,7 +1239,7 @@ ulong _mi_rec_unpack(register MI_INFO *info, register byte *to, byte *from,
if (min_pack_length > (uint) (from_end - from))
goto err;
min_pack_length-=rec_length;
- memcpy(to, (byte*) from, (size_t) rec_length);
+ memcpy(to, (uchar*) from, (size_t) rec_length);
from+=rec_length;
}
}
@@ -1251,14 +1252,14 @@ err:
my_errno= HA_ERR_WRONG_IN_RECORD;
DBUG_PRINT("error",("to_end: 0x%lx -> 0x%lx from_end: 0x%lx -> 0x%lx",
(long) to, (long) to_end, (long) from, (long) from_end));
- DBUG_DUMP("from",(byte*) info->rec_buff,info->s->base.min_pack_length);
+ DBUG_DUMP("from",(uchar*) info->rec_buff,info->s->base.min_pack_length);
DBUG_RETURN(MY_FILE_ERROR);
} /* _mi_rec_unpack */
/* Calc length of blob. Update info in blobs->length */
-ulong _my_calc_total_blob_length(MI_INFO *info, const byte *record)
+ulong _my_calc_total_blob_length(MI_INFO *info, const uchar *record)
{
ulong length;
MI_BLOB *blob,*end;
@@ -1274,7 +1275,7 @@ ulong _my_calc_total_blob_length(MI_INFO *info, const byte *record)
}
-ulong _mi_calc_blob_length(uint length, const byte *pos)
+ulong _mi_calc_blob_length(uint length, const uchar *pos)
{
switch (length) {
case 1:
@@ -1292,7 +1293,7 @@ ulong _mi_calc_blob_length(uint length, const byte *pos)
}
-void _my_store_blob_length(byte *pos,uint pack_length,uint length)
+void _my_store_blob_length(uchar *pos,uint pack_length,uint length)
{
switch (pack_length) {
case 1:
@@ -1345,11 +1346,11 @@ void _my_store_blob_length(byte *pos,uint pack_length,uint length)
-1 Error
*/
-int _mi_read_dynamic_record(MI_INFO *info, my_off_t filepos, byte *buf)
+int _mi_read_dynamic_record(MI_INFO *info, my_off_t filepos, uchar *buf)
{
int block_of_record;
uint b_type,left_length;
- byte *to;
+ uchar *to;
MI_BLOCK_INFO block_info;
File file;
DBUG_ENTER("mi_read_dynamic_record");
@@ -1405,7 +1406,7 @@ int _mi_read_dynamic_record(MI_INFO *info, my_off_t filepos, byte *buf)
prefetch_len= block_info.data_len;
if (prefetch_len)
{
- memcpy((byte*) to, block_info.header + offset, prefetch_len);
+ memcpy((uchar*) to, block_info.header + offset, prefetch_len);
block_info.data_len-= prefetch_len;
left_length-= prefetch_len;
to+= prefetch_len;
@@ -1423,7 +1424,7 @@ int _mi_read_dynamic_record(MI_INFO *info, my_off_t filepos, byte *buf)
there is no equivalent without seeking. We are at the right
position already. :(
*/
- if (info->s->file_read(info, (byte*) to, block_info.data_len,
+ if (info->s->file_read(info, (uchar*) to, block_info.data_len,
filepos, MYF(MY_NABP)))
goto panic;
left_length-=block_info.data_len;
@@ -1450,9 +1451,9 @@ err:
/* compare unique constraint between stored rows */
int _mi_cmp_dynamic_unique(MI_INFO *info, MI_UNIQUEDEF *def,
- const byte *record, my_off_t pos)
+ const uchar *record, my_off_t pos)
{
- byte *rec_buff,*old_record;
+ uchar *rec_buff,*old_record;
int error;
DBUG_ENTER("_mi_cmp_dynamic_unique");
@@ -1478,11 +1479,11 @@ int _mi_cmp_dynamic_unique(MI_INFO *info, MI_UNIQUEDEF *def,
/* Compare of record one disk with packed record in memory */
-int _mi_cmp_dynamic_record(register MI_INFO *info, register const byte *record)
+int _mi_cmp_dynamic_record(register MI_INFO *info, register const uchar *record)
{
uint flag,reclength,b_type;
my_off_t filepos;
- byte *buffer;
+ uchar *buffer;
MI_BLOCK_INFO block_info;
DBUG_ENTER("_mi_cmp_dynamic_record");
@@ -1504,7 +1505,7 @@ int _mi_cmp_dynamic_record(register MI_INFO *info, register const byte *record)
{ /* If check isn't disabled */
if (info->s->base.blobs)
{
- if (!(buffer=(byte*) my_alloca(info->s->base.pack_reclength+
+ if (!(buffer=(uchar*) my_alloca(info->s->base.pack_reclength+
_my_calc_total_blob_length(info,record))))
DBUG_RETURN(-1);
}
@@ -1552,18 +1553,18 @@ int _mi_cmp_dynamic_record(register MI_INFO *info, register const byte *record)
my_errno=0;
err:
if (buffer != info->rec_buff)
- my_afree((gptr) buffer);
+ my_afree((uchar*) buffer);
DBUG_RETURN(my_errno);
}
/* Compare file to buffert */
-static int _mi_cmp_buffer(File file, const byte *buff, my_off_t filepos,
+static int _mi_cmp_buffer(File file, const uchar *buff, my_off_t filepos,
uint length)
{
uint next_length;
- char temp_buff[IO_SIZE*2];
+ uchar temp_buff[IO_SIZE*2];
DBUG_ENTER("_mi_cmp_buffer");
next_length= IO_SIZE*2 - (uint) (filepos & (IO_SIZE-1));
@@ -1571,7 +1572,7 @@ static int _mi_cmp_buffer(File file, const byte *buff, my_off_t filepos,
while (length > IO_SIZE*2)
{
if (my_pread(file,temp_buff,next_length,filepos, MYF(MY_NABP)) ||
- memcmp((byte*) buff,temp_buff,next_length))
+ memcmp(buff, temp_buff, next_length))
goto err;
filepos+=next_length;
buff+=next_length;
@@ -1580,7 +1581,7 @@ static int _mi_cmp_buffer(File file, const byte *buff, my_off_t filepos,
}
if (my_pread(file,temp_buff,length,filepos,MYF(MY_NABP)))
goto err;
- DBUG_RETURN(memcmp((byte*) buff,temp_buff,length));
+ DBUG_RETURN(memcmp(buff,temp_buff,length));
err:
DBUG_RETURN(1);
}
@@ -1620,13 +1621,13 @@ err:
!= 0 Error
*/
-int _mi_read_rnd_dynamic_record(MI_INFO *info, byte *buf,
+int _mi_read_rnd_dynamic_record(MI_INFO *info, uchar *buf,
register my_off_t filepos,
my_bool skip_deleted_blocks)
{
int block_of_record, info_read, save_errno;
uint left_len,b_type;
- byte *to;
+ uchar *to;
MI_BLOCK_INFO block_info;
MYISAM_SHARE *share=info->s;
DBUG_ENTER("_mi_read_rnd_dynamic_record");
@@ -1672,7 +1673,7 @@ int _mi_read_rnd_dynamic_record(MI_INFO *info, byte *buf,
}
if (info->opt_flag & READ_CACHE_USED)
{
- if (_mi_read_cache(&info->rec_cache,(byte*) block_info.header,filepos,
+ if (_mi_read_cache(&info->rec_cache,(uchar*) block_info.header,filepos,
sizeof(block_info.header),
(!block_of_record && skip_deleted_blocks ?
READING_NEXT : 0) | READING_HEADER))
@@ -1735,7 +1736,7 @@ int _mi_read_rnd_dynamic_record(MI_INFO *info, byte *buf,
tmp_length= block_info.data_len;
if (tmp_length)
{
- memcpy((byte*) to, block_info.header+offset,tmp_length);
+ memcpy((uchar*) to, block_info.header+offset,tmp_length);
block_info.data_len-=tmp_length;
left_len-=tmp_length;
to+=tmp_length;
@@ -1747,7 +1748,7 @@ int _mi_read_rnd_dynamic_record(MI_INFO *info, byte *buf,
{
if (info->opt_flag & READ_CACHE_USED)
{
- if (_mi_read_cache(&info->rec_cache,(byte*) to,filepos,
+ if (_mi_read_cache(&info->rec_cache,(uchar*) to,filepos,
block_info.data_len,
(!block_of_record && skip_deleted_blocks) ?
READING_NEXT : 0))
@@ -1761,7 +1762,7 @@ int _mi_read_rnd_dynamic_record(MI_INFO *info, byte *buf,
flush_io_cache(&info->rec_cache))
goto err;
/* VOID(my_seek(info->dfile,filepos,MY_SEEK_SET,MYF(0))); */
- if (my_read(info->dfile,(byte*) to,block_info.data_len,MYF(MY_NABP)))
+ if (my_read(info->dfile,(uchar*) to,block_info.data_len,MYF(MY_NABP)))
{
if (my_errno == -1)
my_errno= HA_ERR_WRONG_IN_RECORD; /* Unexpected end of file */
@@ -1814,11 +1815,11 @@ uint _mi_get_block_info(MI_BLOCK_INFO *info, File file, my_off_t filepos)
my_pread() may leave the file pointer untouched.
*/
VOID(my_seek(file,filepos,MY_SEEK_SET,MYF(0)));
- if (my_read(file,(char*) header,sizeof(info->header),MYF(0)) !=
+ if (my_read(file, header, sizeof(info->header),MYF(0)) !=
sizeof(info->header))
goto err;
}
- DBUG_DUMP("header",(byte*) header,MI_BLOCK_INFO_HEADER_LENGTH);
+ DBUG_DUMP("header",header,MI_BLOCK_INFO_HEADER_LENGTH);
if (info->second_read)
{
if (info->header[0] <= 6 || info->header[0] == 13)
diff --git a/storage/myisam/mi_extra.c b/storage/myisam/mi_extra.c
index 729174b6f88..1b4c79d13de 100644
--- a/storage/myisam/mi_extra.c
+++ b/storage/myisam/mi_extra.c
@@ -78,7 +78,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
if (_mi_memmap_file(info))
{
/* We don't nead MADV_SEQUENTIAL if small file */
- madvise(share->file_map,share->state.state.data_file_length,
+ madvise((char*) share->file_map, share->state.state.data_file_length,
share->state.state.data_file_length <= RECORD_CACHE_SIZE*16 ?
MADV_RANDOM : MADV_SEQUENTIAL);
pthread_mutex_unlock(&share->intern_lock);
@@ -158,7 +158,8 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
}
#if defined(HAVE_MMAP) && defined(HAVE_MADVISE)
if (info->opt_flag & MEMMAP_USED)
- madvise(share->file_map,share->state.state.data_file_length,MADV_RANDOM);
+ madvise((char*) share->file_map, share->state.state.data_file_length,
+ MADV_RANDOM);
#endif
break;
case HA_EXTRA_FLUSH_CACHE:
@@ -180,8 +181,8 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
case HA_EXTRA_KEYREAD: /* Read only keys to record */
case HA_EXTRA_REMEMBER_POS:
info->opt_flag |= REMEMBER_OLD_POS;
- bmove((byte*) info->lastkey+share->base.max_key_length*2,
- (byte*) info->lastkey,info->lastkey_length);
+ bmove((uchar*) info->lastkey+share->base.max_key_length*2,
+ (uchar*) info->lastkey,info->lastkey_length);
info->save_update= info->update;
info->save_lastinx= info->lastinx;
info->save_lastpos= info->lastpos;
@@ -197,8 +198,8 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
case HA_EXTRA_RESTORE_POS:
if (info->opt_flag & REMEMBER_OLD_POS)
{
- bmove((byte*) info->lastkey,
- (byte*) info->lastkey+share->base.max_key_length*2,
+ bmove((uchar*) info->lastkey,
+ (uchar*) info->lastkey+share->base.max_key_length*2,
info->save_lastkey_length);
info->update= info->save_update | HA_STATE_WRITTEN;
info->lastinx= info->save_lastinx;
@@ -258,7 +259,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
case HA_EXTRA_PREPARE_FOR_DELETE:
pthread_mutex_lock(&THR_LOCK_myisam);
share->last_version= 0L; /* Impossible version */
-#ifdef __WIN__
+#ifdef __WIN__REMOVE_OBSOLETE_WORKAROUND
/* Close the isam and data files as Win32 can't drop an open table */
pthread_mutex_lock(&share->intern_lock);
if (flush_key_blocks(share->key_cache, share->kfile,
@@ -385,7 +386,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
{
char tmp[1];
tmp[0]=function;
- myisam_log_command(MI_LOG_EXTRA,info,(byte*) tmp,1,error);
+ myisam_log_command(MI_LOG_EXTRA,info,(uchar*) tmp,1,error);
}
DBUG_RETURN(error);
} /* mi_extra */
@@ -435,7 +436,8 @@ int mi_reset(MI_INFO *info)
mi_alloc_rec_buff(info, -1, &info->rec_buff);
#if defined(HAVE_MMAP) && defined(HAVE_MADVISE)
if (info->opt_flag & MEMMAP_USED)
- madvise(share->file_map,share->state.state.data_file_length,MADV_RANDOM);
+ madvise((char*) share->file_map, share->state.state.data_file_length,
+ MADV_RANDOM);
#endif
info->opt_flag&= ~(KEY_READ_USED | REMEMBER_OLD_POS);
info->quick_mode=0;
diff --git a/storage/myisam/mi_key.c b/storage/myisam/mi_key.c
index 2f4915dec39..3f445ebf44d 100644
--- a/storage/myisam/mi_key.c
+++ b/storage/myisam/mi_key.c
@@ -31,7 +31,7 @@
set_if_smaller(char_length,length); \
} while(0)
-static int _mi_put_key_in_record(MI_INFO *info,uint keynr,byte *record);
+static int _mi_put_key_in_record(MI_INFO *info,uint keynr,uchar *record);
/*
Make a intern key from a record
@@ -49,9 +49,9 @@ static int _mi_put_key_in_record(MI_INFO *info,uint keynr,byte *record);
*/
uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
- const byte *record, my_off_t filepos)
+ const uchar *record, my_off_t filepos)
{
- byte *pos;
+ uchar *pos;
uchar *start;
reg1 HA_KEYSEG *keyseg;
my_bool is_ft= info->s->keyinfo[keynr].flag & HA_FULLTEXT;
@@ -90,7 +90,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
char_length= ((!is_ft && cs && cs->mbmaxlen > 1) ? length/cs->mbmaxlen :
length);
- pos= (byte*) record+keyseg->start;
+ pos= (uchar*) record+keyseg->start;
if (type == HA_KEYTYPE_BIT)
{
if (keyseg->bit_length)
@@ -100,7 +100,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
*key++= bits;
length--;
}
- memcpy((byte*) key, pos, length);
+ memcpy((uchar*) key, pos, length);
key+= length;
continue;
}
@@ -108,18 +108,18 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
{
if (type != HA_KEYTYPE_NUM)
{
- length= cs->cset->lengthsp(cs, pos, length);
+ length= cs->cset->lengthsp(cs, (char*) pos, length);
}
else
{
- byte *end= pos + length;
+ uchar *end= pos + length;
while (pos < end && pos[0] == ' ')
pos++;
length=(uint) (end-pos);
}
FIX_LENGTH(cs, pos, length, char_length);
store_key_length_inc(key,char_length);
- memcpy((byte*) key,(byte*) pos,(size_t) char_length);
+ memcpy((uchar*) key,(uchar*) pos,(size_t) char_length);
key+=char_length;
continue;
}
@@ -132,18 +132,18 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
set_if_smaller(length,tmp_length);
FIX_LENGTH(cs, pos, length, char_length);
store_key_length_inc(key,char_length);
- memcpy((byte*) key,(byte*) pos,(size_t) char_length);
+ memcpy((uchar*) key,(uchar*) pos,(size_t) char_length);
key+= char_length;
continue;
}
else if (keyseg->flag & HA_BLOB_PART)
{
uint tmp_length=_mi_calc_blob_length(keyseg->bit_start,pos);
- memcpy_fixed((byte*) &pos,pos+keyseg->bit_start,sizeof(char*));
+ memcpy_fixed((uchar*) &pos,pos+keyseg->bit_start,sizeof(char*));
set_if_smaller(length,tmp_length);
FIX_LENGTH(cs, pos, length, char_length);
store_key_length_inc(key,char_length);
- memcpy((byte*) key,(byte*) pos,(size_t) char_length);
+ memcpy((uchar*) key,(uchar*) pos,(size_t) char_length);
key+= char_length;
continue;
}
@@ -182,14 +182,14 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
continue;
}
FIX_LENGTH(cs, pos, length, char_length);
- memcpy((byte*) key, pos, char_length);
+ memcpy((uchar*) key, pos, char_length);
if (length > char_length)
cs->cset->fill(cs, (char*) key+char_length, length-char_length, ' ');
key+= length;
}
_mi_dpointer(info,key,filepos);
DBUG_PRINT("exit",("keynr: %d",keynr));
- DBUG_DUMP("key",(byte*) start,(uint) (key-start)+keyseg->length);
+ DBUG_DUMP("key",(uchar*) start,(uint) (key-start)+keyseg->length);
DBUG_EXECUTE("key",
_mi_print_key(DBUG_FILE,info->s->keyinfo[keynr].seg,start,
(uint) (key-start)););
@@ -254,20 +254,20 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old,
if (keyseg->flag & HA_SPACE_PACK)
{
uchar *end=pos+length;
- if (type != HA_KEYTYPE_NUM)
- {
- while (end > pos && end[-1] == ' ')
- end--;
- }
- else
+ if (type == HA_KEYTYPE_NUM)
{
while (pos < end && pos[0] == ' ')
pos++;
}
+ else if (type != HA_KEYTYPE_BINARY)
+ {
+ while (end > pos && end[-1] == ' ')
+ end--;
+ }
length=(uint) (end-pos);
FIX_LENGTH(cs, pos, length, char_length);
store_key_length_inc(key,char_length);
- memcpy((byte*) key,pos,(size_t) char_length);
+ memcpy((uchar*) key,pos,(size_t) char_length);
key+= char_length;
continue;
}
@@ -280,7 +280,7 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old,
FIX_LENGTH(cs, pos, length, char_length);
store_key_length_inc(key,char_length);
old+=2; /* Skip length */
- memcpy((byte*) key, pos,(size_t) char_length);
+ memcpy((uchar*) key, pos,(size_t) char_length);
key+= char_length;
continue;
}
@@ -292,7 +292,7 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old,
continue;
}
FIX_LENGTH(cs, pos, length, char_length);
- memcpy((byte*) key, pos, char_length);
+ memcpy((uchar*) key, pos, char_length);
if (length > char_length)
cs->cset->fill(cs, (char*) key+char_length, length-char_length, ' ');
key+= length;
@@ -325,16 +325,16 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old,
*/
static int _mi_put_key_in_record(register MI_INFO *info, uint keynr,
- byte *record)
+ uchar *record)
{
- reg2 byte *key;
- byte *pos,*key_end;
+ reg2 uchar *key;
+ uchar *pos,*key_end;
reg1 HA_KEYSEG *keyseg;
- byte *blob_ptr;
+ uchar *blob_ptr;
DBUG_ENTER("_mi_put_key_in_record");
- blob_ptr= (byte*) info->lastkey2; /* Place to put blob parts */
- key=(byte*) info->lastkey; /* KEy that was read */
+ blob_ptr= (uchar*) info->lastkey2; /* Place to put blob parts */
+ key=(uchar*) info->lastkey; /* KEy that was read */
key_end=key+info->lastkey_length;
for (keyseg=info->s->keyinfo[keynr].seg ; keyseg->type ;keyseg++)
{
@@ -363,7 +363,7 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr,
clr_rec_bits(record + keyseg->bit_pos, keyseg->bit_start,
keyseg->bit_length);
}
- memcpy(record + keyseg->start, (byte*) key, length);
+ memcpy(record + keyseg->start, (uchar*) key, length);
key+= length;
continue;
}
@@ -380,7 +380,8 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr,
{
memcpy(pos,key,(size_t) length);
keyseg->charset->cset->fill(keyseg->charset,
- pos + length, keyseg->length - length,
+ (char*) pos + length,
+ keyseg->length - length,
' ');
}
else
@@ -406,7 +407,7 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr,
else
int2store(record+keyseg->start, length);
/* And key data */
- memcpy(record+keyseg->start + keyseg->bit_start, (byte*) key, length);
+ memcpy(record+keyseg->start + keyseg->bit_start, (uchar*) key, length);
key+= length;
}
else if (keyseg->flag & HA_BLOB_PART)
@@ -431,8 +432,8 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr,
}
else if (keyseg->flag & HA_SWAP_KEY)
{
- byte *to= record+keyseg->start+keyseg->length;
- byte *end= key+keyseg->length;
+ uchar *to= record+keyseg->start+keyseg->length;
+ uchar *end= key+keyseg->length;
#ifdef CHECK_KEYS
if (end > key_end)
goto err;
@@ -449,7 +450,7 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr,
if (key+keyseg->length > key_end)
goto err;
#endif
- memcpy(record+keyseg->start,(byte*) key,
+ memcpy(record+keyseg->start,(uchar*) key,
(size_t) keyseg->length);
key+= keyseg->length;
}
@@ -463,7 +464,7 @@ err:
/* Here when key reads are used */
-int _mi_read_key_record(MI_INFO *info, my_off_t filepos, byte *buf)
+int _mi_read_key_record(MI_INFO *info, my_off_t filepos, uchar *buf)
{
fast_mi_writeinfo(info);
if (filepos != HA_OFFSET_ERROR)
@@ -498,7 +499,7 @@ int _mi_read_key_record(MI_INFO *info, my_off_t filepos, byte *buf)
less than zero.
*/
-ulonglong retrieve_auto_increment(MI_INFO *info,const byte *record)
+ulonglong retrieve_auto_increment(MI_INFO *info,const uchar *record)
{
ulonglong value= 0; /* Store unsigned values here */
longlong s_value= 0; /* Store signed values here */
diff --git a/storage/myisam/mi_keycache.c b/storage/myisam/mi_keycache.c
index 6694893e9c3..5cf3fede1ae 100644
--- a/storage/myisam/mi_keycache.c
+++ b/storage/myisam/mi_keycache.c
@@ -104,7 +104,8 @@ int mi_assign_to_key_cache(MI_INFO *info,
share->key_cache= key_cache;
/* store the key cache in the global hash structure for future opens */
- if (multi_key_cache_set(share->unique_file_name, share->unique_name_length,
+ if (multi_key_cache_set((uchar*) share->unique_file_name,
+ share->unique_name_length,
share->key_cache))
error= my_errno;
pthread_mutex_unlock(&share->intern_lock);
diff --git a/storage/myisam/mi_locking.c b/storage/myisam/mi_locking.c
index e822ea9e6da..ec359d13a14 100644
--- a/storage/myisam/mi_locking.c
+++ b/storage/myisam/mi_locking.c
@@ -254,7 +254,7 @@ int mi_lock_database(MI_INFO *info, int lock_type)
pthread_mutex_unlock(&share->intern_lock);
#if defined(FULL_LOG) || defined(_lint)
lock_type|=(int) (flag << 8); /* Set bit to set if real lock */
- myisam_log_command(MI_LOG_LOCK,info,(byte*) &lock_type,sizeof(lock_type),
+ myisam_log_command(MI_LOG_LOCK,info,(uchar*) &lock_type,sizeof(lock_type),
error);
#endif
DBUG_RETURN(error);
@@ -520,7 +520,7 @@ int _mi_test_if_changed(register MI_INFO *info)
int _mi_mark_file_changed(MI_INFO *info)
{
- char buff[3];
+ uchar buff[3];
register MYISAM_SHARE *share=info->s;
DBUG_ENTER("_mi_mark_file_changed");
@@ -553,7 +553,7 @@ int _mi_mark_file_changed(MI_INFO *info)
int _mi_decrement_open_count(MI_INFO *info)
{
- char buff[2];
+ uchar buff[2];
register MYISAM_SHARE *share=info->s;
int lock_error=0,write_error=0;
if (share->global_changed)
diff --git a/storage/myisam/mi_log.c b/storage/myisam/mi_log.c
index f720f752a06..8b9ca038fec 100644
--- a/storage/myisam/mi_log.c
+++ b/storage/myisam/mi_log.c
@@ -74,9 +74,9 @@ int mi_log(int activate_log)
/* All logs starts with command(1) dfile(2) process(4) result(2) */
void _myisam_log(enum myisam_log_commands command, MI_INFO *info,
- const byte *buffert, uint length)
+ const uchar *buffert, uint length)
{
- char buff[11];
+ uchar buff[11];
int error,old_errno;
ulong pid=(ulong) GETPID();
old_errno=my_errno;
@@ -98,9 +98,9 @@ void _myisam_log(enum myisam_log_commands command, MI_INFO *info,
void _myisam_log_command(enum myisam_log_commands command, MI_INFO *info,
- const byte *buffert, uint length, int result)
+ const uchar *buffert, uint length, int result)
{
- char buff[9];
+ uchar buff[9];
int error,old_errno;
ulong pid=(ulong) GETPID();
@@ -122,9 +122,9 @@ void _myisam_log_command(enum myisam_log_commands command, MI_INFO *info,
void _myisam_log_record(enum myisam_log_commands command, MI_INFO *info,
- const byte *record, my_off_t filepos, int result)
+ const uchar *record, my_off_t filepos, int result)
{
- char buff[21],*pos;
+ uchar buff[21],*pos;
int error,old_errno;
uint length;
ulong pid=(ulong) GETPID();
@@ -134,7 +134,7 @@ void _myisam_log_record(enum myisam_log_commands command, MI_INFO *info,
length=info->s->base.reclength;
else
length=info->s->base.reclength+ _my_calc_total_blob_length(info,record);
- buff[0]=(char) command;
+ buff[0]=(uchar) command;
mi_int2store(buff+1,info->dfile);
mi_int4store(buff+3,pid);
mi_int2store(buff+7,result);
@@ -142,8 +142,8 @@ void _myisam_log_record(enum myisam_log_commands command, MI_INFO *info,
mi_int4store(buff+17,length);
pthread_mutex_lock(&THR_LOCK_myisam);
error=my_lock(myisam_log_file,F_WRLCK,0L,F_TO_EOF,MYF(MY_SEEK_NOT_DONE));
- VOID(my_write(myisam_log_file,buff,sizeof(buff),MYF(0)));
- VOID(my_write(myisam_log_file,(byte*) record,info->s->base.reclength,MYF(0)));
+ VOID(my_write(myisam_log_file, buff,sizeof(buff),MYF(0)));
+ VOID(my_write(myisam_log_file, record,info->s->base.reclength,MYF(0)));
if (info->s->base.blobs)
{
MI_BLOB *blob,*end;
@@ -152,7 +152,8 @@ void _myisam_log_record(enum myisam_log_commands command, MI_INFO *info,
blob != end ;
blob++)
{
- memcpy_fixed(&pos,record+blob->offset+blob->pack_length,sizeof(char*));
+ memcpy_fixed((uchar*) &pos, record+blob->offset+blob->pack_length,
+ sizeof(char*));
VOID(my_write(myisam_log_file,pos,blob->length,MYF(0)));
}
}
diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c
index f4e089b6313..b848c822f75 100644
--- a/storage/myisam/mi_open.c
+++ b/storage/myisam/mi_open.c
@@ -79,7 +79,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
key_parts,unique_key_parts,fulltext_keys,uniques;
char name_buff[FN_REFLEN], org_name[FN_REFLEN], index_name[FN_REFLEN],
data_name[FN_REFLEN];
- char *disk_cache, *disk_pos, *end_pos;
+ uchar *disk_cache, *disk_pos, *end_pos;
MI_INFO info,*m_info,*old_info;
MYISAM_SHARE share_buff,*share;
ulong rec_per_key_part[MI_MAX_POSSIBLE_KEY*MI_MAX_KEY_SEG];
@@ -92,7 +92,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
lock_error=1;
errpos=0;
head_length=sizeof(share_buff.state.header);
- bzero((byte*) &info,sizeof(info));
+ bzero((uchar*) &info,sizeof(info));
my_realpath(name_buff, fn_format(org_name,name,"",MI_NAME_IEXT,
MY_UNPACK_FILENAME),MYF(0));
@@ -100,11 +100,12 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
if (!(old_info=test_if_reopen(name_buff)))
{
share= &share_buff;
- bzero((gptr) &share_buff,sizeof(share_buff));
+ bzero((uchar*) &share_buff,sizeof(share_buff));
share_buff.state.rec_per_key_part=rec_per_key_part;
share_buff.state.key_root=key_root;
share_buff.state.key_del=key_del;
- share_buff.key_cache= multi_key_cache_search(name_buff, strlen(name_buff));
+ share_buff.key_cache= multi_key_cache_search((uchar*) name_buff,
+ strlen(name_buff));
DBUG_EXECUTE_IF("myisam_pretend_crashed_table_on_open",
if (strstr(name, "/t1"))
@@ -121,14 +122,14 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
}
share->mode=open_mode;
errpos=1;
- if (my_read(kfile,(char*) share->state.header.file_version,head_length,
+ if (my_read(kfile, share->state.header.file_version, head_length,
MYF(MY_NABP)))
{
my_errno= HA_ERR_NOT_A_TABLE;
goto err;
}
- if (memcmp((byte*) share->state.header.file_version,
- (byte*) myisam_file_magic, 4))
+ if (memcmp((uchar*) share->state.header.file_version,
+ (uchar*) myisam_file_magic, 4))
{
DBUG_PRINT("error",("Wrong header in %s",name_buff));
DBUG_DUMP("error_dump",(char*) share->state.header.file_version,
@@ -165,7 +166,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
info_length=mi_uint2korr(share->state.header.header_length);
base_pos=mi_uint2korr(share->state.header.base_pos);
- if (!(disk_cache=(char*) my_alloca(info_length+128)))
+ if (!(disk_cache= (uchar*) my_alloca(info_length+128)))
{
my_errno=ENOMEM;
goto err;
@@ -202,15 +203,14 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
}
share->state_diff_length=len-MI_STATE_INFO_SIZE;
- mi_state_info_read((uchar*) disk_cache, &share->state);
+ mi_state_info_read(disk_cache, &share->state);
len= mi_uint2korr(share->state.header.base_info_length);
if (len != MI_BASE_INFO_SIZE)
{
DBUG_PRINT("warning",("saved_base_info_length: %d base_info_length: %d",
len,MI_BASE_INFO_SIZE));
}
- disk_pos= (char*)
- my_n_base_info_read((uchar*) disk_cache + base_pos, &share->base);
+ disk_pos= my_n_base_info_read(disk_cache + base_pos, &share->base);
share->state.state_length=base_pos;
if (!(open_flags & HA_OPEN_FOR_REPAIR) &&
@@ -236,7 +236,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
key_parts+=fulltext_keys*FT_SEGS;
if (share->base.max_key_length > MI_MAX_KEY_BUFF || keys > MI_MAX_KEY ||
- key_parts >= MI_MAX_KEY * MI_MAX_KEY_SEG)
+ key_parts > MI_MAX_KEY * MI_MAX_KEY_SEG)
{
DBUG_PRINT("error",("Wrong key info: Max_key_length: %d keys: %d key_parts: %d", share->base.max_key_length, keys, key_parts));
my_errno=HA_ERR_UNSUPPORTED;
@@ -504,7 +504,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
}
else if (share->options & HA_OPTION_PACK_RECORD)
share->data_file_type = DYNAMIC_RECORD;
- my_afree((gptr) disk_cache);
+ my_afree(disk_cache);
mi_setup_functions(share);
share->is_log_table= FALSE;
#ifdef THREAD
@@ -642,7 +642,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
if (myisam_log_file >= 0)
{
intern_filename(name_buff,share->index_file_name);
- _myisam_log(MI_LOG_OPEN,m_info,name_buff,(uint) strlen(name_buff));
+ _myisam_log(MI_LOG_OPEN, m_info, (uchar*) name_buff, strlen(name_buff));
}
DBUG_RETURN(m_info);
@@ -654,7 +654,7 @@ err:
mi_report_error(save_errno, name);
switch (errpos) {
case 6:
- my_free((gptr) m_info,MYF(0));
+ my_free((uchar*) m_info,MYF(0));
/* fall through */
case 5:
VOID(my_close(info.dfile,MYF(0)));
@@ -662,14 +662,14 @@ err:
break; /* Don't remove open table */
/* fall through */
case 4:
- my_free((gptr) share,MYF(0));
+ my_free((uchar*) share,MYF(0));
/* fall through */
case 3:
if (! lock_error)
VOID(my_lock(kfile, F_UNLCK, 0L, F_TO_EOF, MYF(MY_SEEK_NOT_DONE)));
/* fall through */
case 2:
- my_afree((gptr) disk_cache);
+ my_afree(disk_cache);
/* fall through */
case 1:
VOID(my_close(kfile,MYF(0)));
@@ -684,7 +684,7 @@ err:
} /* mi_open */
-byte *mi_alloc_rec_buff(MI_INFO *info, ulong length, byte **buf)
+uchar *mi_alloc_rec_buff(MI_INFO *info, ulong length, uchar **buf)
{
uint extra;
uint32 old_length;
@@ -692,7 +692,7 @@ byte *mi_alloc_rec_buff(MI_INFO *info, ulong length, byte **buf)
if (! *buf || length > (old_length=mi_get_rec_buff_len(info, *buf)))
{
- byte *newptr = *buf;
+ uchar *newptr = *buf;
/* to simplify initial init of info->rec_buf in mi_open and mi_extra */
if (length == (ulong) -1)
@@ -709,7 +709,7 @@ byte *mi_alloc_rec_buff(MI_INFO *info, ulong length, byte **buf)
MI_REC_BUFF_OFFSET : 0);
if (extra && newptr)
newptr-= MI_REC_BUFF_OFFSET;
- if (!(newptr=(byte*) my_realloc((gptr)newptr, length+extra+8,
+ if (!(newptr=(uchar*) my_realloc((uchar*)newptr, length+extra+8,
MYF(MY_ALLOW_ZERO_PTR))))
return newptr;
*((uint32 *) newptr)= (uint32) length;
@@ -899,10 +899,10 @@ uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite)
}
if (pWrite & 1)
- DBUG_RETURN(my_pwrite(file,(char*) buff, (uint) (ptr-buff), 0L,
- MYF(MY_NABP | MY_THREADSAFE)));
- DBUG_RETURN(my_write(file, (char*) buff, (uint) (ptr-buff),
- MYF(MY_NABP)));
+ DBUG_RETURN(my_pwrite(file, buff, (size_t) (ptr-buff), 0L,
+ MYF(MY_NABP | MY_THREADSAFE)) != 0);
+ DBUG_RETURN(my_write(file, buff, (size_t) (ptr-buff),
+ MYF(MY_NABP)) != 0);
}
@@ -961,18 +961,18 @@ uchar *mi_state_info_read(uchar *ptr, MI_STATE_INFO *state)
uint mi_state_info_read_dsk(File file, MI_STATE_INFO *state, my_bool pRead)
{
- char buff[MI_STATE_INFO_SIZE + MI_STATE_EXTRA_SIZE];
+ uchar buff[MI_STATE_INFO_SIZE + MI_STATE_EXTRA_SIZE];
if (!myisam_single_user)
{
if (pRead)
{
if (my_pread(file, buff, state->state_length,0L, MYF(MY_NABP)))
- return (MY_FILE_ERROR);
+ return 1;
}
else if (my_read(file, buff, state->state_length,MYF(MY_NABP)))
- return (MY_FILE_ERROR);
- mi_state_info_read((uchar*) buff, state);
+ return 1;
+ mi_state_info_read(buff, state);
}
return 0;
}
@@ -1013,7 +1013,7 @@ uint mi_base_info_write(File file, MI_BASE_INFO *base)
mi_int2store(ptr,base->raid_chunks); ptr +=2;
mi_int4store(ptr,base->raid_chunksize); ptr +=4;
bzero(ptr,6); ptr +=6; /* extra */
- return my_write(file,(char*) buff, (uint) (ptr-buff), MYF(MY_NABP));
+ return my_write(file, buff, (size_t) (ptr-buff), MYF(MY_NABP)) != 0;
}
@@ -1073,10 +1073,10 @@ uint mi_keydef_write(File file, MI_KEYDEF *keydef)
mi_int2store(ptr,keydef->keylength); ptr +=2;
mi_int2store(ptr,keydef->minlength); ptr +=2;
mi_int2store(ptr,keydef->maxlength); ptr +=2;
- return my_write(file,(char*) buff, (uint) (ptr-buff), MYF(MY_NABP));
+ return my_write(file, buff, (size_t) (ptr-buff), MYF(MY_NABP)) != 0;
}
-char *mi_keydef_read(char *ptr, MI_KEYDEF *keydef)
+uchar *mi_keydef_read(uchar *ptr, MI_KEYDEF *keydef)
{
keydef->keysegs = (uint) *ptr++;
keydef->key_alg = *ptr++; /* Rtree or Btree */
@@ -1117,11 +1117,11 @@ int mi_keyseg_write(File file, const HA_KEYSEG *keyseg)
mi_int4store(ptr, pos);
ptr+=4;
- return my_write(file,(char*) buff, (uint) (ptr-buff), MYF(MY_NABP));
+ return my_write(file, buff, (size_t) (ptr-buff), MYF(MY_NABP)) != 0;
}
-char *mi_keyseg_read(char *ptr, HA_KEYSEG *keyseg)
+uchar *mi_keyseg_read(uchar *ptr, HA_KEYSEG *keyseg)
{
keyseg->type = *ptr++;
keyseg->language = *ptr++;
@@ -1157,10 +1157,10 @@ uint mi_uniquedef_write(File file, MI_UNIQUEDEF *def)
*ptr++= (uchar) def->key;
*ptr++ = (uchar) def->null_are_equal;
- return my_write(file,(char*) buff, (uint) (ptr-buff), MYF(MY_NABP));
+ return my_write(file, buff, (size_t) (ptr-buff), MYF(MY_NABP)) != 0;
}
-char *mi_uniquedef_read(char *ptr, MI_UNIQUEDEF *def)
+uchar *mi_uniquedef_read(uchar *ptr, MI_UNIQUEDEF *def)
{
def->keysegs = mi_uint2korr(ptr);
def->key = ptr[2];
@@ -1181,10 +1181,10 @@ uint mi_recinfo_write(File file, MI_COLUMNDEF *recinfo)
mi_int2store(ptr,recinfo->length); ptr +=2;
*ptr++ = recinfo->null_bit;
mi_int2store(ptr,recinfo->null_pos); ptr+= 2;
- return my_write(file,(char*) buff, (uint) (ptr-buff), MYF(MY_NABP));
+ return my_write(file, buff, (size_t) (ptr-buff), MYF(MY_NABP)) != 0;
}
-char *mi_recinfo_read(char *ptr, MI_COLUMNDEF *recinfo)
+uchar *mi_recinfo_read(uchar *ptr, MI_COLUMNDEF *recinfo)
{
recinfo->type= mi_sint2korr(ptr); ptr +=2;
recinfo->length=mi_uint2korr(ptr); ptr +=2;
@@ -1202,7 +1202,8 @@ The argument file_to_dup is here for the future if there would on some OS
exist a dup()-like call that would give us two different file descriptors.
*************************************************************************/
-int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, File file_to_dup __attribute__((unused)))
+int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share,
+ File file_to_dup __attribute__((unused)))
{
#ifdef USE_RAID
if (share->base.raid_type)
diff --git a/storage/myisam/mi_packrec.c b/storage/myisam/mi_packrec.c
index a5a9aaededd..305b7e5532c 100644
--- a/storage/myisam/mi_packrec.c
+++ b/storage/myisam/mi_packrec.c
@@ -48,7 +48,7 @@
#define OFFSET_TABLE_SIZE 512
static uint read_huff_table(MI_BIT_BUFF *bit_buff,MI_DECODE_TREE *decode_tree,
- uint16 **decode_table,byte **intervall_buff,
+ uint16 **decode_table,uchar **intervall_buff,
uint16 *tmp_buff);
static void make_quick_table(uint16 *to_table,uint16 *decode_table,
uint *next_free,uint value,uint bits,
@@ -107,7 +107,7 @@ static void fill_buffer(MI_BIT_BUFF *bit_buff);
static uint max_bit(uint value);
#ifdef HAVE_MMAP
static uchar *_mi_mempack_get_block_info(MI_INFO *myisam, MI_BIT_BUFF *bit_buff,
- MI_BLOCK_INFO *info, byte **rec_buff_p,
+ MI_BLOCK_INFO *info, uchar **rec_buff_p,
uchar *header);
#endif
@@ -136,7 +136,8 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys)
uint i,trees,huff_tree_bits,rec_reflength,length;
uint16 *decode_table,*tmp_buff;
ulong elements,intervall_length;
- char *disk_cache,*intervall_buff;
+ uchar *disk_cache;
+ uchar *intervall_buff;
uchar header[HEAD_LENGTH];
MYISAM_SHARE *share=info->s;
MI_BIT_BUFF bit_buff;
@@ -149,14 +150,14 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys)
file=info->dfile;
my_errno=0;
- if (my_read(file,(byte*) header,sizeof(header),MYF(MY_NABP)))
+ if (my_read(file,(uchar*) header,sizeof(header),MYF(MY_NABP)))
{
if (!my_errno)
my_errno=HA_ERR_END_OF_FILE;
goto err0;
}
/* Only the first three bytes of magic number are independent of version. */
- if (memcmp((byte*) header, (byte*) myisam_pack_file_magic, 3))
+ if (memcmp((uchar*) header, (uchar*) myisam_pack_file_magic, 3))
{
my_errno=HA_ERR_WRONG_IN_RECORD;
goto err0;
@@ -195,10 +196,10 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys)
*/
if (!(share->decode_trees=(MI_DECODE_TREE*)
my_malloc((uint) (trees*sizeof(MI_DECODE_TREE)+
- intervall_length*sizeof(byte)),
+ intervall_length*sizeof(uchar)),
MYF(MY_WME))))
goto err0;
- intervall_buff=(byte*) (share->decode_trees+trees);
+ intervall_buff=(uchar*) (share->decode_trees+trees);
/*
Memory segment #2:
@@ -215,7 +216,7 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys)
MYF(MY_WME | MY_ZEROFILL))))
goto err1;
tmp_buff=share->decode_tables+length;
- disk_cache=(byte*) (tmp_buff+OFFSET_TABLE_SIZE);
+ disk_cache= (uchar*) (tmp_buff+OFFSET_TABLE_SIZE);
if (my_read(file,disk_cache,
(uint) (share->pack.header_length-sizeof(header)),
@@ -223,7 +224,7 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys)
goto err2;
huff_tree_bits=max_bit(trees ? trees-1 : 0);
- init_bit_buffer(&bit_buff, (uchar*) disk_cache,
+ init_bit_buffer(&bit_buff, disk_cache,
(uint) (share->pack.header_length-sizeof(header)));
/* Read new info for each field */
for (i=0 ; i < share->base.fields ; i++)
@@ -250,8 +251,8 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys)
goto err3;
/* Reallocate the decoding tables to the used size. */
decode_table=(uint16*)
- my_realloc((gptr) share->decode_tables,
- (uint) ((byte*) decode_table - (byte*) share->decode_tables),
+ my_realloc((uchar*) share->decode_tables,
+ (uint) ((uchar*) decode_table - (uchar*) share->decode_tables),
MYF(MY_HOLD_ON_ERROR));
/* Fix the table addresses in the tree heads. */
{
@@ -291,9 +292,9 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys)
err3:
my_errno=HA_ERR_WRONG_IN_RECORD;
err2:
- my_free((gptr) share->decode_tables,MYF(0));
+ my_free((uchar*) share->decode_tables,MYF(0));
err1:
- my_free((gptr) share->decode_trees,MYF(0));
+ my_free((uchar*) share->decode_trees,MYF(0));
err0:
DBUG_RETURN(1);
}
@@ -318,7 +319,7 @@ err0:
*/
static uint read_huff_table(MI_BIT_BUFF *bit_buff, MI_DECODE_TREE *decode_tree,
- uint16 **decode_table, byte **intervall_buff,
+ uint16 **decode_table, uchar **intervall_buff,
uint16 *tmp_buff)
{
uint min_chr,elements,char_bits,offset_bits,size,intervall_length,table_bits,
@@ -697,7 +698,7 @@ static uint find_longest_bitstream(uint16 *table, uint16 *end)
HA_ERR_WRONG_IN_RECORD or -1 on error
*/
-int _mi_read_pack_record(MI_INFO *info, my_off_t filepos, byte *buf)
+int _mi_read_pack_record(MI_INFO *info, my_off_t filepos, uchar *buf)
{
MI_BLOCK_INFO block_info;
File file;
@@ -710,7 +711,7 @@ int _mi_read_pack_record(MI_INFO *info, my_off_t filepos, byte *buf)
if (_mi_pack_get_block_info(info, &info->bit_buff, &block_info,
&info->rec_buff, file, filepos))
goto err;
- if (my_read(file,(byte*) info->rec_buff + block_info.offset ,
+ if (my_read(file,(uchar*) info->rec_buff + block_info.offset ,
block_info.rec_len - block_info.offset, MYF(MY_NABP)))
goto panic;
info->update|= HA_STATE_AKTIV;
@@ -725,9 +726,9 @@ err:
int _mi_pack_rec_unpack(register MI_INFO *info, MI_BIT_BUFF *bit_buff,
- register byte *to, byte *from, ulong reclength)
+ register uchar *to, uchar *from, ulong reclength)
{
- byte *end_field;
+ uchar *end_field;
reg3 MI_COLUMNDEF *end;
MI_COLUMNDEF *current_field;
MYISAM_SHARE *share=info->s;
@@ -834,7 +835,7 @@ static void uf_space_normal(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, uchar *to,
uchar *end)
{
if (get_bit(bit_buff))
- bfill((byte*) to,(end-to),' ');
+ bfill((uchar*) to,(end-to),' ');
else
decode_bytes(rec,bit_buff,to,end);
}
@@ -844,7 +845,7 @@ static void uf_space_endspace_selected(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff,
{
uint spaces;
if (get_bit(bit_buff))
- bfill((byte*) to,(end-to),' ');
+ bfill((uchar*) to,(end-to),' ');
else
{
if (get_bit(bit_buff))
@@ -856,7 +857,7 @@ static void uf_space_endspace_selected(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff,
}
if (to+spaces != end)
decode_bytes(rec,bit_buff,to,end-spaces);
- bfill((byte*) end-spaces,spaces,' ');
+ bfill((uchar*) end-spaces,spaces,' ');
}
else
decode_bytes(rec,bit_buff,to,end);
@@ -876,7 +877,7 @@ static void uf_endspace_selected(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff,
}
if (to+spaces != end)
decode_bytes(rec,bit_buff,to,end-spaces);
- bfill((byte*) end-spaces,spaces,' ');
+ bfill((uchar*) end-spaces,spaces,' ');
}
else
decode_bytes(rec,bit_buff,to,end);
@@ -887,7 +888,7 @@ static void uf_space_endspace(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, uchar *t
{
uint spaces;
if (get_bit(bit_buff))
- bfill((byte*) to,(end-to),' ');
+ bfill((uchar*) to,(end-to),' ');
else
{
if ((spaces=get_bits(bit_buff,rec->space_length_bits))+to > end)
@@ -897,7 +898,7 @@ static void uf_space_endspace(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, uchar *t
}
if (to+spaces != end)
decode_bytes(rec,bit_buff,to,end-spaces);
- bfill((byte*) end-spaces,spaces,' ');
+ bfill((uchar*) end-spaces,spaces,' ');
}
}
@@ -912,7 +913,7 @@ static void uf_endspace(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, uchar *to,
}
if (to+spaces != end)
decode_bytes(rec,bit_buff,to,end-spaces);
- bfill((byte*) end-spaces,spaces,' ');
+ bfill((uchar*) end-spaces,spaces,' ');
}
static void uf_space_prespace_selected(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff,
@@ -920,7 +921,7 @@ static void uf_space_prespace_selected(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff,
{
uint spaces;
if (get_bit(bit_buff))
- bfill((byte*) to,(end-to),' ');
+ bfill((uchar*) to,(end-to),' ');
else
{
if (get_bit(bit_buff))
@@ -930,7 +931,7 @@ static void uf_space_prespace_selected(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff,
bit_buff->error=1;
return;
}
- bfill((byte*) to,spaces,' ');
+ bfill((uchar*) to,spaces,' ');
if (to+spaces != end)
decode_bytes(rec,bit_buff,to+spaces,end);
}
@@ -951,7 +952,7 @@ static void uf_prespace_selected(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff,
bit_buff->error=1;
return;
}
- bfill((byte*) to,spaces,' ');
+ bfill((uchar*) to,spaces,' ');
if (to+spaces != end)
decode_bytes(rec,bit_buff,to+spaces,end);
}
@@ -965,7 +966,7 @@ static void uf_space_prespace(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, uchar *t
{
uint spaces;
if (get_bit(bit_buff))
- bfill((byte*) to,(end-to),' ');
+ bfill((uchar*) to,(end-to),' ');
else
{
if ((spaces=get_bits(bit_buff,rec->space_length_bits))+to > end)
@@ -973,7 +974,7 @@ static void uf_space_prespace(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, uchar *t
bit_buff->error=1;
return;
}
- bfill((byte*) to,spaces,' ');
+ bfill((uchar*) to,spaces,' ');
if (to+spaces != end)
decode_bytes(rec,bit_buff,to+spaces,end);
}
@@ -988,7 +989,7 @@ static void uf_prespace(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, uchar *to,
bit_buff->error=1;
return;
}
- bfill((byte*) to,spaces,' ');
+ bfill((uchar*) to,spaces,' ');
if (to+spaces != end)
decode_bytes(rec,bit_buff,to+spaces,end);
}
@@ -1031,7 +1032,7 @@ static void uf_blob(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff,
uchar *to, uchar *end)
{
if (get_bit(bit_buff))
- bzero((byte*) to,(end-to));
+ bzero((uchar*) to,(end-to));
else
{
ulong length=get_bits(bit_buff,rec->space_length_bits);
@@ -1039,11 +1040,11 @@ static void uf_blob(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff,
if (bit_buff->blob_pos+length > bit_buff->blob_end)
{
bit_buff->error=1;
- bzero((byte*) to,(end-to));
+ bzero((uchar*) to,(end-to));
return;
}
decode_bytes(rec,bit_buff,bit_buff->blob_pos,bit_buff->blob_pos+length);
- _my_store_blob_length((byte*) to,pack_length,length);
+ _my_store_blob_length((uchar*) to,pack_length,length);
memcpy_fixed((char*) to+pack_length,(char*) &bit_buff->blob_pos,
sizeof(char*));
bit_buff->blob_pos+=length;
@@ -1286,7 +1287,7 @@ static uint decode_pos(MI_BIT_BUFF *bit_buff, MI_DECODE_TREE *decode_tree)
}
-int _mi_read_rnd_pack_record(MI_INFO *info, byte *buf,
+int _mi_read_rnd_pack_record(MI_INFO *info, uchar *buf,
register my_off_t filepos,
my_bool skip_deleted_blocks)
{
@@ -1303,7 +1304,7 @@ int _mi_read_rnd_pack_record(MI_INFO *info, byte *buf,
if (info->opt_flag & READ_CACHE_USED)
{
- if (_mi_read_cache(&info->rec_cache, (byte*) block_info.header,
+ if (_mi_read_cache(&info->rec_cache, (uchar*) block_info.header,
filepos, share->pack.ref_length,
skip_deleted_blocks ? READING_NEXT : 0))
goto err;
@@ -1325,14 +1326,14 @@ int _mi_read_rnd_pack_record(MI_INFO *info, byte *buf,
if (info->opt_flag & READ_CACHE_USED)
{
- if (_mi_read_cache(&info->rec_cache, (byte*) info->rec_buff,
+ if (_mi_read_cache(&info->rec_cache, (uchar*) info->rec_buff,
block_info.filepos, block_info.rec_len,
skip_deleted_blocks ? READING_NEXT : 0))
goto err;
}
else
{
- if (my_read(info->dfile,(byte*) info->rec_buff + block_info.offset,
+ if (my_read(info->dfile,(uchar*) info->rec_buff + block_info.offset,
block_info.rec_len-block_info.offset,
MYF(MY_NABP)))
goto err;
@@ -1352,7 +1353,7 @@ int _mi_read_rnd_pack_record(MI_INFO *info, byte *buf,
/* Read and process header from a huff-record-file */
uint _mi_pack_get_block_info(MI_INFO *myisam, MI_BIT_BUFF *bit_buff,
- MI_BLOCK_INFO *info, byte **rec_buff_p,
+ MI_BLOCK_INFO *info, uchar **rec_buff_p,
File file, my_off_t filepos)
{
uchar *header=info->header;
@@ -1367,9 +1368,9 @@ uint _mi_pack_get_block_info(MI_INFO *myisam, MI_BIT_BUFF *bit_buff,
position is ok
*/
VOID(my_seek(file,filepos,MY_SEEK_SET,MYF(0)));
- if (my_read(file,(char*) header,ref_length,MYF(MY_NABP)))
+ if (my_read(file, header,ref_length,MYF(MY_NABP)))
return BLOCK_FATAL_ERROR;
- DBUG_DUMP("header",(byte*) header,ref_length);
+ DBUG_DUMP("header",(uchar*) header,ref_length);
}
head_length= read_pack_length((uint) myisam->s->pack.version, header,
&info->rec_len);
@@ -1478,8 +1479,8 @@ static uint max_bit(register uint value)
#ifdef HAVE_MMAP
-static int _mi_read_mempack_record(MI_INFO *info,my_off_t filepos,byte *buf);
-static int _mi_read_rnd_mempack_record(MI_INFO*, byte *,my_off_t, my_bool);
+static int _mi_read_mempack_record(MI_INFO *info,my_off_t filepos,uchar *buf);
+static int _mi_read_rnd_mempack_record(MI_INFO*, uchar *,my_off_t, my_bool);
my_bool _mi_memmap_file(MI_INFO *info)
{
@@ -1506,13 +1507,13 @@ my_bool _mi_memmap_file(MI_INFO *info)
void _mi_unmap_file(MI_INFO *info)
{
- VOID(my_munmap(info->s->file_map,
+ VOID(my_munmap((char*) info->s->file_map,
(size_t) info->s->mmaped_length + MEMMAP_EXTRA_MARGIN));
}
static uchar *_mi_mempack_get_block_info(MI_INFO *myisam, MI_BIT_BUFF *bit_buff,
- MI_BLOCK_INFO *info, byte **rec_buff_p,
+ MI_BLOCK_INFO *info, uchar **rec_buff_p,
uchar *header)
{
header+= read_pack_length((uint) myisam->s->pack.version, header,
@@ -1532,17 +1533,17 @@ static uchar *_mi_mempack_get_block_info(MI_INFO *myisam, MI_BIT_BUFF *bit_buff,
}
-static int _mi_read_mempack_record(MI_INFO *info, my_off_t filepos, byte *buf)
+static int _mi_read_mempack_record(MI_INFO *info, my_off_t filepos, uchar *buf)
{
MI_BLOCK_INFO block_info;
MYISAM_SHARE *share=info->s;
- byte *pos;
+ uchar *pos;
DBUG_ENTER("mi_read_mempack_record");
if (filepos == HA_OFFSET_ERROR)
DBUG_RETURN(-1); /* _search() didn't find record */
- if (!(pos= (byte*) _mi_mempack_get_block_info(info, &info->bit_buff,
+ if (!(pos= (uchar*) _mi_mempack_get_block_info(info, &info->bit_buff,
&block_info, &info->rec_buff,
(uchar*) share->file_map+
filepos)))
@@ -1553,14 +1554,14 @@ static int _mi_read_mempack_record(MI_INFO *info, my_off_t filepos, byte *buf)
/*ARGSUSED*/
-static int _mi_read_rnd_mempack_record(MI_INFO *info, byte *buf,
+static int _mi_read_rnd_mempack_record(MI_INFO *info, uchar *buf,
register my_off_t filepos,
my_bool skip_deleted_blocks
__attribute__((unused)))
{
MI_BLOCK_INFO block_info;
MYISAM_SHARE *share=info->s;
- byte *pos,*start;
+ uchar *pos,*start;
DBUG_ENTER("_mi_read_rnd_mempack_record");
if (filepos >= share->state.state.data_file_length)
@@ -1568,7 +1569,7 @@ static int _mi_read_rnd_mempack_record(MI_INFO *info, byte *buf,
my_errno=HA_ERR_END_OF_FILE;
goto err;
}
- if (!(pos= (byte*) _mi_mempack_get_block_info(info, &info->bit_buff,
+ if (!(pos= (uchar*) _mi_mempack_get_block_info(info, &info->bit_buff,
&block_info, &info->rec_buff,
(uchar*)
(start=share->file_map+
@@ -1596,7 +1597,7 @@ static int _mi_read_rnd_mempack_record(MI_INFO *info, byte *buf,
/* Save length of row */
-uint save_pack_length(uint version, byte *block_buff, ulong length)
+uint save_pack_length(uint version, uchar *block_buff, ulong length)
{
if (length < 254)
{
diff --git a/storage/myisam/mi_page.c b/storage/myisam/mi_page.c
index da9e19275c9..23a2526f756 100644
--- a/storage/myisam/mi_page.c
+++ b/storage/myisam/mi_page.c
@@ -29,7 +29,7 @@ uchar *_mi_fetch_keypage(register MI_INFO *info, MI_KEYDEF *keyinfo,
DBUG_PRINT("enter",("page: %ld", (long) page));
tmp=(uchar*) key_cache_read(info->s->key_cache,
- info->s->kfile, page, level, (byte*) buff,
+ info->s->kfile, page, level, (uchar*) buff,
(uint) keyinfo->block_length,
(uint) keyinfo->block_length,
return_buffer);
@@ -80,7 +80,7 @@ int _mi_write_keypage(register MI_INFO *info, register MI_KEYDEF *keyinfo,
DBUG_RETURN((-1));
}
DBUG_PRINT("page",("write page at: %lu",(long) page));
- DBUG_DUMP("buff",(byte*) buff,mi_getint(buff));
+ DBUG_DUMP("buff",(uchar*) buff,mi_getint(buff));
#endif
if ((length=keyinfo->block_length) > IO_SIZE*2 &&
@@ -89,12 +89,12 @@ int _mi_write_keypage(register MI_INFO *info, register MI_KEYDEF *keyinfo,
#ifdef HAVE_purify
{
length=mi_getint(buff);
- bzero((byte*) buff+length,keyinfo->block_length-length);
+ bzero((uchar*) buff+length,keyinfo->block_length-length);
length=keyinfo->block_length;
}
#endif
DBUG_RETURN((key_cache_write(info->s->key_cache,
- info->s->kfile,page, level, (byte*) buff,length,
+ info->s->kfile,page, level, (uchar*) buff,length,
(uint) keyinfo->block_length,
(int) ((info->lock_type != F_UNLCK) ||
info->s->delay_key_write))));
@@ -107,7 +107,7 @@ int _mi_dispose(register MI_INFO *info, MI_KEYDEF *keyinfo, my_off_t pos,
int level)
{
my_off_t old_link;
- char buff[8];
+ uchar buff[8];
DBUG_ENTER("_mi_dispose");
DBUG_PRINT("enter",("pos: %ld", (long) pos));
@@ -128,7 +128,7 @@ int _mi_dispose(register MI_INFO *info, MI_KEYDEF *keyinfo, my_off_t pos,
my_off_t _mi_new(register MI_INFO *info, MI_KEYDEF *keyinfo, int level)
{
my_off_t pos;
- char buff[8];
+ uchar buff[8];
DBUG_ENTER("_mi_new");
if ((pos= info->s->state.key_del[keyinfo->block_size_index]) ==
diff --git a/storage/myisam/mi_preload.c b/storage/myisam/mi_preload.c
index 78729f18424..60ab55106cb 100644
--- a/storage/myisam/mi_preload.c
+++ b/storage/myisam/mi_preload.c
@@ -55,12 +55,17 @@ int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves)
block_length= keyinfo[0].block_length;
- /* Check whether all indexes use the same block size */
- for (i= 1 ; i < keys ; i++)
+ if (ignore_leaves)
{
- if (keyinfo[i].block_length != block_length)
- DBUG_RETURN(my_errno= HA_ERR_NON_UNIQUE_BLOCK_SIZE);
+ /* Check whether all indexes use the same block size */
+ for (i= 1 ; i < keys ; i++)
+ {
+ if (keyinfo[i].block_length != block_length)
+ DBUG_RETURN(my_errno= HA_ERR_NON_UNIQUE_BLOCK_SIZE);
+ }
}
+ else
+ block_length= share->key_cache->key_cache_block_size;
length= info->preload_buff_size/block_length * block_length;
set_if_bigger(length, block_length);
@@ -76,7 +81,7 @@ int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves)
/* Read the next block of index file into the preload buffer */
if ((my_off_t) length > (key_file_length-pos))
length= (ulong) (key_file_length-pos);
- if (my_pread(share->kfile, (byte*) buff, length, pos, MYF(MY_FAE|MY_FNABP)))
+ if (my_pread(share->kfile, (uchar*) buff, length, pos, MYF(MY_FAE|MY_FNABP)))
goto err;
if (ignore_leaves)
@@ -88,7 +93,7 @@ int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves)
{
if (key_cache_insert(share->key_cache,
share->kfile, pos, DFLT_INIT_HITS,
- (byte*) buff, block_length))
+ (uchar*) buff, block_length))
goto err;
}
pos+= block_length;
@@ -100,7 +105,7 @@ int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves)
{
if (key_cache_insert(share->key_cache,
share->kfile, pos, DFLT_INIT_HITS,
- (byte*) buff, length))
+ (uchar*) buff, length))
goto err;
pos+= length;
}
diff --git a/storage/myisam/mi_range.c b/storage/myisam/mi_range.c
index c7ab6731a2c..932a4abd1b3 100644
--- a/storage/myisam/mi_range.c
+++ b/storage/myisam/mi_range.c
@@ -21,7 +21,7 @@
#include "myisamdef.h"
#include "rt_index.h"
-static ha_rows _mi_record_pos(MI_INFO *, const byte *, key_part_map,
+static ha_rows _mi_record_pos(MI_INFO *, const uchar *, key_part_map,
enum ha_rkey_function);
static double _mi_search_pos(MI_INFO *,MI_KEYDEF *,uchar *, uint,uint,my_off_t);
static uint _mi_keynr(MI_INFO *info,MI_KEYDEF *,uchar *, uchar *,uint *);
@@ -116,7 +116,7 @@ ha_rows mi_records_in_range(MI_INFO *info, int inx,
/* Find relative position (in records) for key in index-tree */
-static ha_rows _mi_record_pos(MI_INFO *info, const byte *key,
+static ha_rows _mi_record_pos(MI_INFO *info, const uchar *key,
key_part_map keypart_map,
enum ha_rkey_function search_flag)
{
diff --git a/storage/myisam/mi_rfirst.c b/storage/myisam/mi_rfirst.c
index d23bda46b1a..5a8b27b3e85 100644
--- a/storage/myisam/mi_rfirst.c
+++ b/storage/myisam/mi_rfirst.c
@@ -17,7 +17,7 @@
/* Read first row through a specfic key */
-int mi_rfirst(MI_INFO *info, byte *buf, int inx)
+int mi_rfirst(MI_INFO *info, uchar *buf, int inx)
{
DBUG_ENTER("mi_rfirst");
info->lastpos= HA_OFFSET_ERROR;
diff --git a/storage/myisam/mi_rkey.c b/storage/myisam/mi_rkey.c
index a69e276a6d8..f1d35810d36 100644
--- a/storage/myisam/mi_rkey.c
+++ b/storage/myisam/mi_rkey.c
@@ -21,7 +21,7 @@
/* Read a record using key */
/* Ordinary search_flag is 0 ; Give error if no record with key */
-int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key,
+int mi_rkey(MI_INFO *info, uchar *buf, int inx, const uchar *key,
key_part_map keypart_map, enum ha_rkey_function search_flag)
{
uchar *key_buff;
@@ -45,6 +45,7 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key,
info->once_flags&= ~USE_PACKED_KEYS; /* Reset flag */
/*
key is already packed!; This happens when we are using a MERGE TABLE
+ In this key 'key_part_map' is the length of the key !
*/
key_buff=info->lastkey+info->s->base.max_key_length;
pack_key_length= keypart_map;
@@ -94,42 +95,63 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key,
myisam_read_vec[search_flag], info->s->state.key_root[inx]))
{
/*
- If we searching for a partial key (or using >, >=, < or <=) and
- the data is outside of the data file, we need to continue searching
- for the first key inside the data file
+ Found a key, but it might not be usable. We cannot use rows that
+ are inserted by other threads after we got our table lock
+ ("concurrent inserts"). The record may not even be present yet.
+ Keys are inserted into the index(es) before the record is
+ inserted into the data file. When we got our table lock, we
+ saved the current data_file_length. Concurrent inserts always go
+ to the end of the file. So we can test if the found key
+ references a new record.
*/
- if (info->lastpos >= info->state->data_file_length &&
- (search_flag != HA_READ_KEY_EXACT ||
- last_used_keyseg != keyinfo->seg + keyinfo->keysegs))
+ if (info->lastpos >= info->state->data_file_length)
{
- do
+ /* The key references a concurrently inserted record. */
+ if (search_flag == HA_READ_KEY_EXACT &&
+ last_used_keyseg == keyinfo->seg + keyinfo->keysegs)
+ {
+ /* Simply ignore the key if it matches exactly. (Bug #29838) */
+ my_errno= HA_ERR_KEY_NOT_FOUND;
+ info->lastpos= HA_OFFSET_ERROR;
+ }
+ else
{
- uint not_used[2];
- /*
- Skip rows that are inserted by other threads since we got a lock
- Note that this can only happen if we are not searching after an
- full length exact key, because the keys are sorted
- according to position
- */
- if (_mi_search_next(info, keyinfo, info->lastkey,
- info->lastkey_length,
- myisam_readnext_vec[search_flag],
- info->s->state.key_root[inx]))
- break;
/*
- Check that the found key does still match the search.
- _mi_search_next() delivers the next key regardless of its
- value.
+ If searching for a partial key (or using >, >=, < or <=) and
+ the data is outside of the data file, we need to continue
+ searching for the first key inside the data file.
*/
- if (search_flag == HA_READ_KEY_EXACT &&
- ha_key_cmp(keyinfo->seg, key_buff, info->lastkey, use_key_length,
- SEARCH_FIND, not_used))
+ do
{
- my_errno= HA_ERR_KEY_NOT_FOUND;
- info->lastpos= HA_OFFSET_ERROR;
- break;
- }
- } while (info->lastpos >= info->state->data_file_length);
+ uint not_used[2];
+ /*
+ Skip rows that are inserted by other threads since we got
+ a lock. Note that this can only happen if we are not
+ searching after a full length exact key, because the keys
+ are sorted according to position.
+ */
+ if (_mi_search_next(info, keyinfo, info->lastkey,
+ info->lastkey_length,
+ myisam_readnext_vec[search_flag],
+ info->s->state.key_root[inx]))
+ break; /* purecov: inspected */
+ /*
+ Check that the found key does still match the search.
+ _mi_search_next() delivers the next key regardless of its
+ value.
+ */
+ if (search_flag == HA_READ_KEY_EXACT &&
+ ha_key_cmp(keyinfo->seg, key_buff, info->lastkey,
+ use_key_length, SEARCH_FIND, not_used))
+ {
+ /* purecov: begin inspected */
+ my_errno= HA_ERR_KEY_NOT_FOUND;
+ info->lastpos= HA_OFFSET_ERROR;
+ break;
+ /* purecov: end */
+ }
+ } while (info->lastpos >= info->state->data_file_length);
+ }
}
}
}
diff --git a/storage/myisam/mi_rlast.c b/storage/myisam/mi_rlast.c
index 7805755ab70..07be619617f 100644
--- a/storage/myisam/mi_rlast.c
+++ b/storage/myisam/mi_rlast.c
@@ -17,7 +17,7 @@
/* Read last row with the same key as the previous read. */
-int mi_rlast(MI_INFO *info, byte *buf, int inx)
+int mi_rlast(MI_INFO *info, uchar *buf, int inx)
{
DBUG_ENTER("mi_rlast");
info->lastpos= HA_OFFSET_ERROR;
diff --git a/storage/myisam/mi_rnext.c b/storage/myisam/mi_rnext.c
index f6a0a47413e..7ce66d41e0f 100644
--- a/storage/myisam/mi_rnext.c
+++ b/storage/myisam/mi_rnext.c
@@ -24,7 +24,7 @@
based on the position of the last used key!
*/
-int mi_rnext(MI_INFO *info, byte *buf, int inx)
+int mi_rnext(MI_INFO *info, uchar *buf, int inx)
{
int error,changed;
uint flag;
diff --git a/storage/myisam/mi_rnext_same.c b/storage/myisam/mi_rnext_same.c
index 3a7004bf47c..1892fe3e1e0 100644
--- a/storage/myisam/mi_rnext_same.c
+++ b/storage/myisam/mi_rnext_same.c
@@ -24,7 +24,7 @@
based on the position of the last used key!
*/
-int mi_rnext_same(MI_INFO *info, byte *buf)
+int mi_rnext_same(MI_INFO *info, uchar *buf)
{
int error;
uint inx,not_used[2];
diff --git a/storage/myisam/mi_rprev.c b/storage/myisam/mi_rprev.c
index 09802627185..d1407012590 100644
--- a/storage/myisam/mi_rprev.c
+++ b/storage/myisam/mi_rprev.c
@@ -22,7 +22,7 @@
based on the position of the last used key!
*/
-int mi_rprev(MI_INFO *info, byte *buf, int inx)
+int mi_rprev(MI_INFO *info, uchar *buf, int inx)
{
int error,changed;
register uint flag;
diff --git a/storage/myisam/mi_rrnd.c b/storage/myisam/mi_rrnd.c
index d31e6c24a37..211e5fa51cc 100644
--- a/storage/myisam/mi_rrnd.c
+++ b/storage/myisam/mi_rrnd.c
@@ -29,7 +29,7 @@
HA_ERR_END_OF_FILE = EOF.
*/
-int mi_rrnd(MI_INFO *info, byte *buf, register my_off_t filepos)
+int mi_rrnd(MI_INFO *info, uchar *buf, register my_off_t filepos)
{
my_bool skip_deleted_blocks;
DBUG_ENTER("mi_rrnd");
diff --git a/storage/myisam/mi_rsame.c b/storage/myisam/mi_rsame.c
index 4831ebb3d7c..8093498483f 100644
--- a/storage/myisam/mi_rsame.c
+++ b/storage/myisam/mi_rsame.c
@@ -25,7 +25,7 @@
*/
-int mi_rsame(MI_INFO *info, byte *record, int inx)
+int mi_rsame(MI_INFO *info, uchar *record, int inx)
{
DBUG_ENTER("mi_rsame");
diff --git a/storage/myisam/mi_rsamepos.c b/storage/myisam/mi_rsamepos.c
index 717b9ab52d5..6a1e462b686 100644
--- a/storage/myisam/mi_rsamepos.c
+++ b/storage/myisam/mi_rsamepos.c
@@ -27,7 +27,7 @@
** HA_ERR_END_OF_FILE = End of file
*/
-int mi_rsame_with_pos(MI_INFO *info, byte *record, int inx, my_off_t filepos)
+int mi_rsame_with_pos(MI_INFO *info, uchar *record, int inx, my_off_t filepos)
{
DBUG_ENTER("mi_rsame_with_pos");
DBUG_PRINT("enter",("index: %d filepos: %ld", inx, (long) filepos));
diff --git a/storage/myisam/mi_scan.c b/storage/myisam/mi_scan.c
index 87debb67b37..a225b399660 100644
--- a/storage/myisam/mi_scan.c
+++ b/storage/myisam/mi_scan.c
@@ -36,7 +36,7 @@ int mi_scan_init(register MI_INFO *info)
HA_ERR_END_OF_FILE = EOF.
*/
-int mi_scan(MI_INFO *info, byte *buf)
+int mi_scan(MI_INFO *info, uchar *buf)
{
DBUG_ENTER("mi_scan");
/* Init all but update-flag */
diff --git a/storage/myisam/mi_search.c b/storage/myisam/mi_search.c
index d313619e007..2195ac178dd 100644
--- a/storage/myisam/mi_search.c
+++ b/storage/myisam/mi_search.c
@@ -78,7 +78,7 @@ int _mi_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
if (!(buff=_mi_fetch_keypage(info,keyinfo,pos,DFLT_INIT_HITS,info->buff,
test(!(nextflag & SEARCH_SAVE_BUFF)))))
goto err;
- DBUG_DUMP("page",(byte*) buff,mi_getint(buff));
+ DBUG_DUMP("page",(uchar*) buff,mi_getint(buff));
flag=(*keyinfo->bin_search)(info,keyinfo,buff,key,key_len,nextflag,
&keypos,lastkey, &last_key);
@@ -753,7 +753,7 @@ void _mi_dpointer(MI_INFO *info, uchar *buff, my_off_t pos)
uint _mi_get_static_key(register MI_KEYDEF *keyinfo, uint nod_flag,
register uchar **page, register uchar *key)
{
- memcpy((byte*) key,(byte*) *page,
+ memcpy((uchar*) key,(uchar*) *page,
(size_t) (keyinfo->keylength+nod_flag));
*page+=keyinfo->keylength+nod_flag;
return(keyinfo->keylength);
@@ -836,7 +836,7 @@ uint _mi_get_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag,
if (tot_length >= 255 && *start != 255)
{
/* length prefix changed from a length of one to a length of 3 */
- bmove_upp((char*) key+length+3,(char*) key+length+1,length);
+ bmove_upp(key+length+3, key+length+1, length);
*key=255;
mi_int2store(key+1,tot_length);
key+=3+length;
@@ -897,12 +897,12 @@ uint _mi_get_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag,
else
length=keyseg->length;
}
- memcpy((byte*) key,(byte*) page,(size_t) length);
+ memcpy((uchar*) key,(uchar*) page,(size_t) length);
key+=length;
page+=length;
}
length=keyseg->length+nod_flag;
- bmove((byte*) key,(byte*) page,length);
+ bmove((uchar*) key,(uchar*) page,length);
*page_pos= page+length;
return ((uint) (key-start_key)+keyseg->length);
} /* _mi_get_pack_key */
@@ -1003,7 +1003,7 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag,
}
DBUG_PRINT("info",("key: 0x%lx from: 0x%lx length: %u",
(long) key, (long) from, length));
- memmove((byte*) key, (byte*) from, (size_t) length);
+ memmove((uchar*) key, (uchar*) from, (size_t) length);
key+=length;
from+=length;
}
@@ -1035,7 +1035,7 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag,
DBUG_RETURN(0); /* Error */
}
/* Copy data pointer and, if appropriate, key block pointer. */
- memcpy((byte*) key,(byte*) from,(size_t) length);
+ memcpy((uchar*) key,(uchar*) from,(size_t) length);
*page_pos= from+length;
}
DBUG_RETURN((uint) (key-start_key)+keyseg->length);
@@ -1054,7 +1054,7 @@ uchar *_mi_get_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page,
nod_flag=mi_test_if_nod(page);
if (! (keyinfo->flag & (HA_VAR_LENGTH_KEY | HA_BINARY_PACK_KEY)))
{
- bmove((byte*) key,(byte*) keypos,keyinfo->keylength+nod_flag);
+ bmove((uchar*) key,(uchar*) keypos,keyinfo->keylength+nod_flag);
DBUG_RETURN(keypos+keyinfo->keylength+nod_flag);
}
else
@@ -1092,7 +1092,7 @@ static my_bool _mi_get_prev_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page,
if (! (keyinfo->flag & (HA_VAR_LENGTH_KEY | HA_BINARY_PACK_KEY)))
{
*return_key_length=keyinfo->keylength;
- bmove((byte*) key,(byte*) keypos- *return_key_length-nod_flag,
+ bmove((uchar*) key,(uchar*) keypos- *return_key_length-nod_flag,
*return_key_length);
DBUG_RETURN(0);
}
@@ -1134,7 +1134,7 @@ uchar *_mi_get_last_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page,
lastpos=endpos-keyinfo->keylength-nod_flag;
*return_key_length=keyinfo->keylength;
if (lastpos > page)
- bmove((byte*) lastkey,(byte*) lastpos,keyinfo->keylength+nod_flag);
+ bmove((uchar*) lastkey,(uchar*) lastpos,keyinfo->keylength+nod_flag);
}
else
{
@@ -1225,7 +1225,7 @@ uint _mi_keylength_part(MI_KEYDEF *keyinfo, register uchar *key,
uchar *_mi_move_key(MI_KEYDEF *keyinfo, uchar *to, uchar *from)
{
reg1 uint length;
- memcpy((byte*) to, (byte*) from,
+ memcpy((uchar*) to, (uchar*) from,
(size_t) (length=_mi_keylength(keyinfo,from)));
return to+length;
}
@@ -1827,7 +1827,7 @@ void _mi_store_static_key(MI_KEYDEF *keyinfo __attribute__((unused)),
register uchar *key_pos,
register MI_KEY_PARAM *s_temp)
{
- memcpy((byte*) key_pos,(byte*) s_temp->key,(size_t) s_temp->totlength);
+ memcpy((uchar*) key_pos,(uchar*) s_temp->key,(size_t) s_temp->totlength);
}
@@ -1860,7 +1860,7 @@ void _mi_store_var_pack_key(MI_KEYDEF *keyinfo __attribute__((unused)),
/* Not packed against previous key */
store_pack_length(s_temp->pack_marker == 128,key_pos,s_temp->key_length);
}
- bmove((byte*) key_pos,(byte*) s_temp->key,
+ bmove((uchar*) key_pos,(uchar*) s_temp->key,
(length=s_temp->totlength-(uint) (key_pos-start)));
if (!s_temp->next_key_pos) /* No following key */
diff --git a/storage/myisam/mi_static.c b/storage/myisam/mi_static.c
index 21a25f66b7c..c92d577b621 100644
--- a/storage/myisam/mi_static.c
+++ b/storage/myisam/mi_static.c
@@ -27,7 +27,7 @@ uchar NEAR myisam_file_magic[]=
{ (uchar) 254, (uchar) 254,'\007', '\001', };
uchar NEAR myisam_pack_file_magic[]=
{ (uchar) 254, (uchar) 254,'\010', '\002', };
-my_string myisam_log_filename=(char*) "myisam.log";
+char * myisam_log_filename=(char*) "myisam.log";
File myisam_log_file= -1;
uint myisam_quick_table_bits=9;
ulong myisam_block_size= MI_KEY_BLOCK_LENGTH; /* Best by test */
diff --git a/storage/myisam/mi_statrec.c b/storage/myisam/mi_statrec.c
index 3f92ec31d4c..e3771560c01 100644
--- a/storage/myisam/mi_statrec.c
+++ b/storage/myisam/mi_statrec.c
@@ -18,7 +18,7 @@
#include "myisamdef.h"
-int _mi_write_static_record(MI_INFO *info, const byte *record)
+int _mi_write_static_record(MI_INFO *info, const uchar *record)
{
uchar temp[8]; /* max pointer length */
if (info->s->state.dellink != HA_OFFSET_ERROR &&
@@ -26,14 +26,14 @@ int _mi_write_static_record(MI_INFO *info, const byte *record)
{
my_off_t filepos=info->s->state.dellink;
info->rec_cache.seek_not_done=1; /* We have done a seek */
- if (info->s->file_read(info,(char*) &temp[0],info->s->base.rec_reflength,
+ if (info->s->file_read(info, &temp[0],info->s->base.rec_reflength,
info->s->state.dellink+1,
MYF(MY_NABP)))
goto err;
info->s->state.dellink= _mi_rec_pos(info->s,temp);
info->state->del--;
info->state->empty-=info->s->base.pack_reclength;
- if (info->s->file_write(info, (char*) record, info->s->base.reclength,
+ if (info->s->file_write(info, record, info->s->base.reclength,
filepos,
MYF(MY_NABP)))
goto err;
@@ -48,29 +48,29 @@ int _mi_write_static_record(MI_INFO *info, const byte *record)
}
if (info->opt_flag & WRITE_CACHE_USED)
{ /* Cash in use */
- if (my_b_write(&info->rec_cache, (byte*) record,
+ if (my_b_write(&info->rec_cache, record,
info->s->base.reclength))
goto err;
if (info->s->base.pack_reclength != info->s->base.reclength)
{
uint length=info->s->base.pack_reclength - info->s->base.reclength;
- bzero((char*) temp,length);
- if (my_b_write(&info->rec_cache, (byte*) temp,length))
+ bzero(temp,length);
+ if (my_b_write(&info->rec_cache, temp,length))
goto err;
}
}
else
{
info->rec_cache.seek_not_done=1; /* We have done a seek */
- if (info->s->file_write(info,(char*) record,info->s->base.reclength,
+ if (info->s->file_write(info, record, info->s->base.reclength,
info->state->data_file_length,
info->s->write_flag))
goto err;
if (info->s->base.pack_reclength != info->s->base.reclength)
{
uint length=info->s->base.pack_reclength - info->s->base.reclength;
- bzero((char*) temp,length);
- if (info->s->file_write(info, (byte*) temp,length,
+ bzero(temp,length);
+ if (info->s->file_write(info, temp,length,
info->state->data_file_length+
info->s->base.reclength,
info->s->write_flag))
@@ -85,13 +85,13 @@ int _mi_write_static_record(MI_INFO *info, const byte *record)
return 1;
}
-int _mi_update_static_record(MI_INFO *info, my_off_t pos, const byte *record)
+int _mi_update_static_record(MI_INFO *info, my_off_t pos, const uchar *record)
{
info->rec_cache.seek_not_done=1; /* We have done a seek */
return (info->s->file_write(info,
- (char*) record,info->s->base.reclength,
- pos,
- MYF(MY_NABP)) != 0);
+ record, info->s->base.reclength,
+ pos,
+ MYF(MY_NABP)) != 0);
}
@@ -105,12 +105,12 @@ int _mi_delete_static_record(MI_INFO *info)
_mi_dpointer(info,temp+1,info->s->state.dellink);
info->s->state.dellink = info->lastpos;
info->rec_cache.seek_not_done=1;
- return (info->s->file_write(info,(byte*) temp, 1+info->s->rec_reflength,
+ return (info->s->file_write(info,(uchar*) temp, 1+info->s->rec_reflength,
info->lastpos, MYF(MY_NABP)) != 0);
}
-int _mi_cmp_static_record(register MI_INFO *info, register const byte *old)
+int _mi_cmp_static_record(register MI_INFO *info, register const uchar *old)
{
DBUG_ENTER("_mi_cmp_static_record");
@@ -129,11 +129,11 @@ int _mi_cmp_static_record(register MI_INFO *info, register const byte *old)
if ((info->opt_flag & READ_CHECK_USED))
{ /* If check isn't disabled */
info->rec_cache.seek_not_done=1; /* We have done a seek */
- if (info->s->file_read(info, (char*) info->rec_buff, info->s->base.reclength,
+ if (info->s->file_read(info, info->rec_buff, info->s->base.reclength,
info->lastpos,
MYF(MY_NABP)))
DBUG_RETURN(-1);
- if (memcmp((byte*) info->rec_buff, (byte*) old,
+ if (memcmp(info->rec_buff, old,
(uint) info->s->base.reclength))
{
DBUG_DUMP("read",old,info->s->base.reclength);
@@ -147,12 +147,12 @@ int _mi_cmp_static_record(register MI_INFO *info, register const byte *old)
int _mi_cmp_static_unique(MI_INFO *info, MI_UNIQUEDEF *def,
- const byte *record, my_off_t pos)
+ const uchar *record, my_off_t pos)
{
DBUG_ENTER("_mi_cmp_static_unique");
info->rec_cache.seek_not_done=1; /* We have done a seek */
- if (info->s->file_read(info, (char*) info->rec_buff, info->s->base.reclength,
+ if (info->s->file_read(info, info->rec_buff, info->s->base.reclength,
pos, MYF(MY_NABP)))
DBUG_RETURN(-1);
DBUG_RETURN(mi_unique_comp(def, record, info->rec_buff,
@@ -166,7 +166,7 @@ int _mi_cmp_static_unique(MI_INFO *info, MI_UNIQUEDEF *def,
/* MY_FILE_ERROR on read-error or locking-error */
int _mi_read_static_record(register MI_INFO *info, register my_off_t pos,
- register byte *record)
+ register uchar *record)
{
int error;
@@ -178,7 +178,7 @@ int _mi_read_static_record(register MI_INFO *info, register my_off_t pos,
return(-1);
info->rec_cache.seek_not_done=1; /* We have done a seek */
- error=info->s->file_read(info,(char*) record,info->s->base.reclength,
+ error=info->s->file_read(info, record, info->s->base.reclength,
pos,MYF(MY_NABP)) != 0;
fast_mi_writeinfo(info);
if (! error)
@@ -199,7 +199,7 @@ int _mi_read_static_record(register MI_INFO *info, register my_off_t pos,
-int _mi_read_rnd_static_record(MI_INFO *info, byte *buf,
+int _mi_read_rnd_static_record(MI_INFO *info, uchar *buf,
register my_off_t filepos,
my_bool skip_deleted_blocks)
{
@@ -274,11 +274,11 @@ int _mi_read_rnd_static_record(MI_INFO *info, byte *buf,
}
/* Read record with cacheing */
- error=my_b_read(&info->rec_cache,(byte*) buf,share->base.reclength);
+ error=my_b_read(&info->rec_cache,(uchar*) buf,share->base.reclength);
if (info->s->base.pack_reclength != info->s->base.reclength && !error)
{
char tmp[8]; /* Skill fill bytes */
- error=my_b_read(&info->rec_cache,(byte*) tmp,
+ error=my_b_read(&info->rec_cache,(uchar*) tmp,
info->s->base.pack_reclength - info->s->base.reclength);
}
if (locked)
diff --git a/storage/myisam/mi_test1.c b/storage/myisam/mi_test1.c
index ebb9cdcb2f7..a68bcbed56c 100644
--- a/storage/myisam/mi_test1.c
+++ b/storage/myisam/mi_test1.c
@@ -40,9 +40,9 @@ static HA_KEYSEG uniqueseg[10];
static int run_test(const char *filename);
static void get_options(int argc, char *argv[]);
-static void create_key(char *key,uint rownr);
-static void create_record(char *record,uint rownr);
-static void update_record(char *record);
+static void create_key(uchar *key,uint rownr);
+static void create_record(uchar *record,uint rownr);
+static void update_record(uchar *record);
int main(int argc,char *argv[])
{
@@ -62,7 +62,7 @@ static int run_test(const char *filename)
int i,j,error,deleted,rec_length,uniques=0;
ha_rows found,row_count;
my_off_t pos;
- char record[MAX_REC_LENGTH],key[MAX_REC_LENGTH],read_record[MAX_REC_LENGTH];
+ uchar record[MAX_REC_LENGTH],key[MAX_REC_LENGTH],read_record[MAX_REC_LENGTH];
MI_UNIQUEDEF uniquedef;
MI_CREATE_INFO create_info;
@@ -109,7 +109,7 @@ static int run_test(const char *filename)
}
keyinfo[0].flag = (uint8) (pack_keys | unique_key);
- bzero((byte*) flags,sizeof(flags));
+ bzero((uchar*) flags,sizeof(flags));
if (opt_unique)
{
uint start;
@@ -258,7 +258,8 @@ static int run_test(const char *filename)
continue;
create_key(key,j);
my_errno=0;
- if ((error = mi_rkey(file,read_record,0,key,0,HA_READ_KEY_EXACT)))
+ if ((error = mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,
+ HA_READ_KEY_EXACT)))
{
if (verbose || (flags[j] >= 1 ||
(error && my_errno != HA_ERR_KEY_NOT_FOUND)))
@@ -285,7 +286,7 @@ static int run_test(const char *filename)
{
create_key(key,i);
my_errno=0;
- error=mi_rkey(file,read_record,0,key,0,HA_READ_KEY_EXACT);
+ error=mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT);
if (verbose ||
(error == 0 && flags[i] == 0 && unique_key) ||
(error && (flags[i] != 0 || my_errno != HA_ERR_KEY_NOT_FOUND)))
@@ -326,20 +327,20 @@ err:
}
-static void create_key_part(char *key,uint rownr)
+static void create_key_part(uchar *key,uint rownr)
{
if (!unique_key)
rownr&=7; /* Some identical keys */
if (keyinfo[0].seg[0].type == HA_KEYTYPE_NUM)
{
- sprintf(key,"%*d",keyinfo[0].seg[0].length,rownr);
+ sprintf((char*) key,"%*d",keyinfo[0].seg[0].length,rownr);
}
else if (keyinfo[0].seg[0].type == HA_KEYTYPE_VARTEXT1 ||
keyinfo[0].seg[0].type == HA_KEYTYPE_VARTEXT2)
{ /* Alpha record */
/* Create a key that may be easily packed */
bfill(key,keyinfo[0].seg[0].length,rownr < 10 ? 'A' : 'B');
- sprintf(key+keyinfo[0].seg[0].length-2,"%-2d",rownr);
+ sprintf((char*) key+keyinfo[0].seg[0].length-2,"%-2d",rownr);
if ((rownr & 7) == 0)
{
/* Change the key to force a unpack of the next key */
@@ -349,12 +350,12 @@ static void create_key_part(char *key,uint rownr)
else
{ /* Alpha record */
if (keyinfo[0].seg[0].flag & HA_SPACE_PACK)
- sprintf(key,"%-*d",keyinfo[0].seg[0].length,rownr);
+ sprintf((char*) key,"%-*d",keyinfo[0].seg[0].length,rownr);
else
{
/* Create a key that may be easily packed */
bfill(key,keyinfo[0].seg[0].length,rownr < 10 ? 'A' : 'B');
- sprintf(key+keyinfo[0].seg[0].length-2,"%-2d",rownr);
+ sprintf((char*) key+keyinfo[0].seg[0].length-2,"%-2d",rownr);
if ((rownr & 7) == 0)
{
/* Change the key to force a unpack of the next key */
@@ -365,7 +366,7 @@ static void create_key_part(char *key,uint rownr)
}
-static void create_key(char *key,uint rownr)
+static void create_key(uchar *key,uint rownr)
{
if (keyinfo[0].seg[0].null_bit)
{
@@ -381,7 +382,7 @@ static void create_key(char *key,uint rownr)
{
uint tmp;
create_key_part(key+2,rownr);
- tmp=strlen(key+2);
+ tmp=strlen((char*) key+2);
int2store(key,tmp);
}
else
@@ -389,13 +390,13 @@ static void create_key(char *key,uint rownr)
}
-static char blob_key[MAX_REC_LENGTH];
-static char blob_record[MAX_REC_LENGTH+20*20];
+static uchar blob_key[MAX_REC_LENGTH];
+static uchar blob_record[MAX_REC_LENGTH+20*20];
-static void create_record(char *record,uint rownr)
+static void create_record(uchar *record,uint rownr)
{
- char *pos;
+ uchar *pos;
bzero((char*) record,MAX_REC_LENGTH);
record[0]=1; /* delete marker */
if (rownr == 0 && keyinfo[0].seg[0].null_bit)
@@ -405,9 +406,9 @@ static void create_record(char *record,uint rownr)
if (recinfo[1].type == FIELD_BLOB)
{
uint tmp;
- char *ptr;
+ uchar *ptr;
create_key_part(blob_key,rownr);
- tmp=strlen(blob_key);
+ tmp=strlen((char*) blob_key);
int4store(pos,tmp);
ptr=blob_key;
memcpy_fixed(pos+4,&ptr,sizeof(char*));
@@ -417,7 +418,7 @@ static void create_record(char *record,uint rownr)
{
uint tmp, pack_length= HA_VARCHAR_PACKLENGTH(recinfo[1].length-1);
create_key_part(pos+pack_length,rownr);
- tmp= strlen(pos+pack_length);
+ tmp= strlen((char*) pos+pack_length);
if (pack_length == 1)
*(uchar*) pos= (uchar) tmp;
else
@@ -432,10 +433,10 @@ static void create_record(char *record,uint rownr)
if (recinfo[2].type == FIELD_BLOB)
{
uint tmp;
- char *ptr;;
- sprintf(blob_record,"... row: %d", rownr);
- strappend(blob_record,max(MAX_REC_LENGTH-rownr,10),' ');
- tmp=strlen(blob_record);
+ uchar *ptr;;
+ sprintf((char*) blob_record,"... row: %d", rownr);
+ strappend((char*) blob_record,max(MAX_REC_LENGTH-rownr,10),' ');
+ tmp=strlen((char*) blob_record);
int4store(pos,tmp);
ptr=blob_record;
memcpy_fixed(pos+4,&ptr,sizeof(char*));
@@ -443,28 +444,28 @@ static void create_record(char *record,uint rownr)
else if (recinfo[2].type == FIELD_VARCHAR)
{
uint tmp, pack_length= HA_VARCHAR_PACKLENGTH(recinfo[1].length-1);
- sprintf(pos+pack_length, "... row: %d", rownr);
- tmp= strlen(pos+pack_length);
+ sprintf((char*) pos+pack_length, "... row: %d", rownr);
+ tmp= strlen((char*) pos+pack_length);
if (pack_length == 1)
- *(uchar*) pos= (uchar) tmp;
+ *pos= (uchar) tmp;
else
int2store(pos,tmp);
}
else
{
- sprintf(pos,"... row: %d", rownr);
- strappend(pos,recinfo[2].length,' ');
+ sprintf((char*) pos,"... row: %d", rownr);
+ strappend((char*) pos,recinfo[2].length,' ');
}
}
/* change row to test re-packing of rows and reallocation of keys */
-static void update_record(char *record)
+static void update_record(uchar *record)
{
- char *pos=record+1;
+ uchar *pos=record+1;
if (recinfo[1].type == FIELD_BLOB)
{
- char *column,*ptr;
+ uchar *column,*ptr;
int length;
length=uint4korr(pos); /* Long blob */
memcpy_fixed(&column,pos+4,sizeof(char*));
@@ -473,7 +474,8 @@ static void update_record(char *record)
memcpy_fixed(pos+4,&ptr,sizeof(char*)); /* Store pointer to new key */
if (keyinfo[0].seg[0].type != HA_KEYTYPE_NUM)
default_charset_info->cset->casedn(default_charset_info,
- blob_key, length, blob_key, length);
+ (char*) blob_key, length,
+ (char*) blob_key, length);
pos+=recinfo[1].length;
}
else if (recinfo[1].type == FIELD_VARCHAR)
@@ -481,22 +483,22 @@ static void update_record(char *record)
uint pack_length= HA_VARCHAR_PACKLENGTH(recinfo[1].length-1);
uint length= pack_length == 1 ? (uint) *(uchar*) pos : uint2korr(pos);
default_charset_info->cset->casedn(default_charset_info,
- pos + pack_length, length,
- pos + pack_length, length);
+ (char*) pos + pack_length, length,
+ (char*) pos + pack_length, length);
pos+=recinfo[1].length;
}
else
{
if (keyinfo[0].seg[0].type != HA_KEYTYPE_NUM)
default_charset_info->cset->casedn(default_charset_info,
- pos, keyinfo[0].seg[0].length,
- pos, keyinfo[0].seg[0].length);
+ (char*) pos, keyinfo[0].seg[0].length,
+ (char*) pos, keyinfo[0].seg[0].length);
pos+=recinfo[1].length;
}
if (recinfo[2].type == FIELD_BLOB)
{
- char *column;
+ uchar *column;
int length;
length=uint4korr(pos);
memcpy_fixed(&column,pos+4,sizeof(char*));
@@ -504,7 +506,7 @@ static void update_record(char *record)
bfill(blob_record+length,20,'.'); /* Make it larger */
length+=20;
int4store(pos,length);
- column=blob_record;
+ column= blob_record;
memcpy_fixed(pos+4,&column,sizeof(char*));
}
else if (recinfo[2].type == FIELD_VARCHAR)
@@ -534,21 +536,21 @@ static struct my_option my_long_options[] =
{"debug", '#', "Undocumented",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"delete_rows", 'd', "Undocumented", (gptr*) &remove_count,
- (gptr*) &remove_count, 0, GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0},
+ {"delete_rows", 'd', "Undocumented", (uchar**) &remove_count,
+ (uchar**) &remove_count, 0, GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0},
{"help", '?', "Display help and exit",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"insert_rows", 'i', "Undocumented", (gptr*) &insert_count,
- (gptr*) &insert_count, 0, GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0},
+ {"insert_rows", 'i', "Undocumented", (uchar**) &insert_count,
+ (uchar**) &insert_count, 0, GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0},
{"key_alpha", 'a', "Use a key of type HA_KEYTYPE_TEXT",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"key_binary_pack", 'B', "Undocumented",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"key_blob", 'b', "Undocumented",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"key_cache", 'K', "Undocumented", (gptr*) &key_cacheing,
- (gptr*) &key_cacheing, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"key_length", 'k', "Undocumented", (gptr*) &key_length, (gptr*) &key_length,
+ {"key_cache", 'K', "Undocumented", (uchar**) &key_cacheing,
+ (uchar**) &key_cacheing, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"key_length", 'k', "Undocumented", (uchar**) &key_length, (uchar**) &key_length,
0, GET_UINT, REQUIRED_ARG, 6, 0, 0, 0, 0, 0},
{"key_multiple", 'm', "Undocumented",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -559,21 +561,21 @@ static struct my_option my_long_options[] =
{"key_varchar", 'w', "Test VARCHAR keys",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"null_fields", 'N', "Define fields with NULL",
- (gptr*) &null_fields, (gptr*) &null_fields, 0, GET_BOOL, NO_ARG,
+ (uchar**) &null_fields, (uchar**) &null_fields, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
{"row_fixed_size", 'S', "Undocumented",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"row_pointer_size", 'R', "Undocumented", (gptr*) &rec_pointer_size,
- (gptr*) &rec_pointer_size, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"row_pointer_size", 'R', "Undocumented", (uchar**) &rec_pointer_size,
+ (uchar**) &rec_pointer_size, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"silent", 's', "Undocumented",
- (gptr*) &silent, (gptr*) &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"skip_update", 'U', "Undocumented", (gptr*) &skip_update,
- (gptr*) &skip_update, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"unique", 'C', "Undocumented", (gptr*) &opt_unique, (gptr*) &opt_unique, 0,
+ (uchar**) &silent, (uchar**) &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"skip_update", 'U', "Undocumented", (uchar**) &skip_update,
+ (uchar**) &skip_update, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"unique", 'C', "Undocumented", (uchar**) &opt_unique, (uchar**) &opt_unique, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"update_rows", 'u', "Undocumented", (gptr*) &update_count,
- (gptr*) &update_count, 0, GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0},
- {"verbose", 'v', "Be more verbose", (gptr*) &verbose, (gptr*) &verbose, 0,
+ {"update_rows", 'u', "Undocumented", (uchar**) &update_count,
+ (uchar**) &update_count, 0, GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0},
+ {"verbose", 'v', "Be more verbose", (uchar**) &verbose, (uchar**) &verbose, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Print version number and exit",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
diff --git a/storage/myisam/mi_test2.c b/storage/myisam/mi_test2.c
index 878bba31ea8..902801b5e6e 100644
--- a/storage/myisam/mi_test2.c
+++ b/storage/myisam/mi_test2.c
@@ -36,8 +36,8 @@
static void get_options(int argc, char *argv[]);
static uint rnd(uint max_value);
-static void fix_length(byte *record,uint length);
-static void put_blob_in_record(char *blob_pos,char **blob_buffer);
+static void fix_length(uchar *record,uint length);
+static void put_blob_in_record(uchar *blob_pos,char **blob_buffer);
static void copy_key(struct st_myisam_info *info,uint inx,
uchar *record,uchar *key);
@@ -53,8 +53,8 @@ static uint key_cache_block_size= KEY_CACHE_BLOCK_SIZE;
static uint keys=MYISAM_KEYS,recant=1000;
static uint use_blob=0;
static uint16 key1[1001],key3[5000];
-static char record[300],record2[300],key[100],key2[100],
- read_record[300],read_record2[300],read_record3[300];
+static uchar record[300],record2[300],key[100],key2[100];
+static uchar read_record[300],read_record2[300],read_record3[300];
static HA_KEYSEG glob_keyseg[MYISAM_KEYS][MAX_PARTS];
/* Test program */
@@ -231,7 +231,7 @@ int main(int argc, char *argv[])
for (i=0 ; i < recant ; i++)
{
n1=rnd(1000); n2=rnd(100); n3=rnd(5000);
- sprintf(record,"%6d:%4d:%8d:Pos: %4d ",n1,n2,n3,write_count);
+ sprintf((char*) record,"%6d:%4d:%8d:Pos: %4d ",n1,n2,n3,write_count);
int4store(record+STANDARD_LENGTH-4,(long) i);
fix_length(record,(uint) STANDARD_LENGTH+rnd(60));
put_blob_in_record(record+blob_pos,&blob_buffer);
@@ -262,8 +262,8 @@ int main(int argc, char *argv[])
for (j=rnd(1000)+1 ; j>0 && key1[j] == 0 ; j--) ;
if (!j)
for (j=999 ; j>0 && key1[j] == 0 ; j--) ;
- sprintf(key,"%6d",j);
- if (mi_rkey(file,read_record,0,key,0,HA_READ_KEY_EXACT))
+ sprintf((char*) key,"%6d",j);
+ if (mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT))
{
printf("Test in loop: Can't find key: \"%s\"\n",key);
goto err;
@@ -290,8 +290,8 @@ int main(int argc, char *argv[])
for (j=rnd(1000)+1 ; j>0 && key1[j] == 0 ; j--) ;
if (j != 0)
{
- sprintf(key,"%6d",j);
- if (mi_rkey(file,read_record,0,key,0,HA_READ_KEY_EXACT))
+ sprintf((char*) key,"%6d",j);
+ if (mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT))
{
printf("can't find key1: \"%s\"\n",key);
goto err;
@@ -304,8 +304,8 @@ int main(int argc, char *argv[])
goto err;
}
opt_delete++;
- key1[atoi(read_record+keyinfo[0].seg[0].start)]--;
- key3[atoi(read_record+keyinfo[2].seg[0].start)]=0;
+ key1[atoi((char*) read_record+keyinfo[0].seg[0].start)]--;
+ key3[atoi((char*) read_record+keyinfo[2].seg[0].start)]=0;
}
else
puts("Warning: Skipping delete test because no dupplicate keys");
@@ -317,17 +317,17 @@ int main(int argc, char *argv[])
for (i=0 ; i<recant/10 ; i++)
{
n1=rnd(1000); n2=rnd(100); n3=rnd(5000);
- sprintf(record2,"%6d:%4d:%8d:XXX: %4d ",n1,n2,n3,update);
+ sprintf((char*) record2,"%6d:%4d:%8d:XXX: %4d ",n1,n2,n3,update);
int4store(record2+STANDARD_LENGTH-4,(long) i);
fix_length(record2,(uint) STANDARD_LENGTH+rnd(60));
for (j=rnd(1000)+1 ; j>0 && key1[j] == 0 ; j--) ;
if (j != 0)
{
- sprintf(key,"%6d",j);
- if (mi_rkey(file,read_record,0,key,0,HA_READ_KEY_EXACT))
+ sprintf((char*) key,"%6d",j);
+ if (mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT))
{
- printf("can't find key1: \"%s\"\n",key);
+ printf("can't find key1: \"%s\"\n",(char*) key);
goto err;
}
if (use_blob)
@@ -350,8 +350,8 @@ int main(int argc, char *argv[])
}
else
{
- key1[atoi(read_record+keyinfo[0].seg[0].start)]--;
- key3[atoi(read_record+keyinfo[2].seg[0].start)]=0;
+ key1[atoi((char*) read_record+keyinfo[0].seg[0].start)]--;
+ key3[atoi((char*) read_record+keyinfo[2].seg[0].start)]=0;
key1[n1]++; key3[n3]=1;
update++;
}
@@ -367,7 +367,7 @@ int main(int argc, char *argv[])
dupp_keys=key1[i]; j=i;
}
}
- sprintf(key,"%6d",j);
+ sprintf((char*) key,"%6d",j);
start=keyinfo[0].seg[0].start;
length=keyinfo[0].seg[0].length;
if (dupp_keys)
@@ -377,7 +377,7 @@ int main(int argc, char *argv[])
DBUG_PRINT("progpos",("first - next -> last - prev -> first"));
if (verbose) printf(" Using key: \"%s\" Keys: %d\n",key,dupp_keys);
- if (mi_rkey(file,read_record,0,key,0,HA_READ_KEY_EXACT))
+ if (mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT))
goto err;
if (mi_rsame(file,read_record2,-1))
goto err;
@@ -422,7 +422,7 @@ int main(int argc, char *argv[])
}
/* Check of mi_rnext_same */
- if (mi_rkey(file,read_record,0,key,0,HA_READ_KEY_EXACT))
+ if (mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT))
goto err;
ant=1;
while (!mi_rnext_same(file,read_record3) && ant < dupp_keys+10)
@@ -455,8 +455,8 @@ int main(int argc, char *argv[])
bcmp(read_record2,read_record3,reclength))
{
printf("Can't find last record\n");
- DBUG_DUMP("record2",(byte*) read_record2,reclength);
- DBUG_DUMP("record3",(byte*) read_record3,reclength);
+ DBUG_DUMP("record2",(uchar*) read_record2,reclength);
+ DBUG_DUMP("record3",(uchar*) read_record3,reclength);
goto end;
}
ant=1;
@@ -496,7 +496,7 @@ int main(int argc, char *argv[])
goto err;
if (bcmp(read_record2,read_record3,reclength))
printf("Can't find last record\n");
-
+#ifdef NOT_ANYMORE
if (!silent)
puts("- Test read key-part");
strmov(key2,key);
@@ -514,12 +514,14 @@ int main(int argc, char *argv[])
goto end;
}
}
+#endif
if (dupp_keys > 2)
{
if (!silent)
printf("- Read key (first) - next - delete - next -> last\n");
DBUG_PRINT("progpos",("first - next - delete - next -> last"));
- if (mi_rkey(file,read_record,0,key,0,HA_READ_KEY_EXACT)) goto err;
+ if (mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT))
+ goto err;
if (mi_rnext(file,read_record3,0)) goto err;
if (mi_delete(file,read_record3)) goto err;
opt_delete++;
@@ -555,7 +557,8 @@ int main(int argc, char *argv[])
if (!silent)
printf("- Read first - delete - next -> last\n");
DBUG_PRINT("progpos",("first - delete - next -> last"));
- if (mi_rkey(file,read_record3,0,key,0,HA_READ_KEY_EXACT)) goto err;
+ if (mi_rkey(file,read_record3,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT))
+ goto err;
if (mi_delete(file,read_record3)) goto err;
opt_delete++;
ant=1;
@@ -618,10 +621,10 @@ int main(int argc, char *argv[])
copy_key(file,(uint) i,(uchar*) read_record,(uchar*) key);
copy_key(file,(uint) i,(uchar*) read_record2,(uchar*) key2);
min_key.key= key;
- min_key.length= USE_WHOLE_KEY;
+ min_key.keypart_map= HA_WHOLE_KEY;
min_key.flag= HA_READ_KEY_EXACT;
max_key.key= key2;
- max_key.length= USE_WHOLE_KEY;
+ max_key.keypart_map= HA_WHOLE_KEY;
max_key.flag= HA_READ_AFTER_KEY;
range_records= mi_records_in_range(file,(int) i, &min_key, &max_key);
@@ -649,8 +652,8 @@ int main(int argc, char *argv[])
key_range min_key, max_key;
if (j > k)
swap_variables(int, j, k);
- sprintf(key,"%6d",j);
- sprintf(key2,"%6d",k);
+ sprintf((char*) key,"%6d",j);
+ sprintf((char*) key2,"%6d",k);
min_key.key= key;
min_key.length= USE_WHOLE_KEY;
@@ -1001,18 +1004,18 @@ static uint rnd(uint max_value)
/* Create a variable length record */
-static void fix_length(byte *rec, uint length)
+static void fix_length(uchar *rec, uint length)
{
bmove(rec+STANDARD_LENGTH,
"0123456789012345678901234567890123456789012345678901234567890",
length-STANDARD_LENGTH);
- strfill(rec+length,STANDARD_LENGTH+60-length,' ');
+ strfill((char*) rec+length,STANDARD_LENGTH+60-length,' ');
} /* fix_length */
/* Put maybe a blob in record */
-static void put_blob_in_record(char *blob_pos, char **blob_buffer)
+static void put_blob_in_record(uchar *blob_pos, char **blob_buffer)
{
ulong i,length;
if (use_blob)
diff --git a/storage/myisam/mi_test3.c b/storage/myisam/mi_test3.c
index 3987c20ab69..5bdc33b8518 100644
--- a/storage/myisam/mi_test3.c
+++ b/storage/myisam/mi_test3.c
@@ -48,9 +48,9 @@ int test_read(MI_INFO *,int),test_write(MI_INFO *,int,int),
test_update(MI_INFO *,int,int),test_rrnd(MI_INFO *,int);
struct record {
- char id[8];
- char nr[4];
- char text[10];
+ uchar id[8];
+ uchar nr[4];
+ uchar text[10];
} record;
@@ -243,8 +243,8 @@ int test_read(MI_INFO *file,int id)
for (i=0 ; i < 100 ; i++)
{
find=rnd(100000);
- if (!mi_rkey(file,record.id,1,(byte*) &find,
- sizeof(find),HA_READ_KEY_EXACT))
+ if (!mi_rkey(file,record.id,1,(uchar*) &find, HA_WHOLE_KEY,
+ HA_READ_KEY_EXACT))
found++;
else
{
@@ -362,8 +362,8 @@ int test_write(MI_INFO *file,int id,int lock_type)
mi_extra(file,HA_EXTRA_WRITE_CACHE,0);
}
- sprintf(record.id,"%7d",getpid());
- strnmov(record.text,"Testing...", sizeof(record.text));
+ sprintf((char*) record.id,"%7d",getpid());
+ strnmov((char*) record.text,"Testing...", sizeof(record.text));
tries=(uint) rnd(100)+10;
for (i=count=0 ; i < tries ; i++)
@@ -419,15 +419,15 @@ int test_update(MI_INFO *file,int id,int lock_type)
}
}
bzero((char*) &new_record,sizeof(new_record));
- strmov(new_record.text,"Updated");
+ strmov((char*) new_record.text,"Updated");
found=next=prev=update=0;
for (i=0 ; i < 100 ; i++)
{
tmp=rnd(100000);
int4store(find,tmp);
- if (!mi_rkey(file,record.id,1,(byte*) find,
- sizeof(find),HA_READ_KEY_EXACT))
+ if (!mi_rkey(file,record.id,1,(uchar*) find, HA_WHOLE_KEY,
+ HA_READ_KEY_EXACT))
found++;
else
{
diff --git a/storage/myisam/mi_unique.c b/storage/myisam/mi_unique.c
index 635f6c18247..e490fb683e4 100644
--- a/storage/myisam/mi_unique.c
+++ b/storage/myisam/mi_unique.c
@@ -18,7 +18,7 @@
#include "myisamdef.h"
#include <m_ctype.h>
-my_bool mi_check_unique(MI_INFO *info, MI_UNIQUEDEF *def, byte *record,
+my_bool mi_check_unique(MI_INFO *info, MI_UNIQUEDEF *def, uchar *record,
ha_checksum unique_hash, my_off_t disk_pos)
{
my_off_t lastpos=info->lastpos;
@@ -73,9 +73,9 @@ my_bool mi_check_unique(MI_INFO *info, MI_UNIQUEDEF *def, byte *record,
Add support for bit fields
*/
-ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const byte *record)
+ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const uchar *record)
{
- const byte *pos, *end;
+ const uchar *pos, *end;
ha_checksum crc= 0;
ulong seed1=0, seed2= 4;
HA_KEYSEG *keyseg;
@@ -111,7 +111,7 @@ ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const byte *record)
else if (keyseg->flag & HA_BLOB_PART)
{
uint tmp_length=_mi_calc_blob_length(keyseg->bit_start,pos);
- memcpy_fixed((byte*) &pos,pos+keyseg->bit_start,sizeof(char*));
+ memcpy_fixed((uchar*) &pos,pos+keyseg->bit_start,sizeof(char*));
if (!length || length > tmp_length)
length=tmp_length; /* The whole blob */
}
@@ -145,10 +145,10 @@ ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const byte *record)
# Rows are different
*/
-int mi_unique_comp(MI_UNIQUEDEF *def, const byte *a, const byte *b,
+int mi_unique_comp(MI_UNIQUEDEF *def, const uchar *a, const uchar *b,
my_bool null_are_equal)
{
- const byte *pos_a, *pos_b, *end;
+ const uchar *pos_a, *pos_b, *end;
HA_KEYSEG *keyseg;
for (keyseg=def->seg ; keyseg < def->end ; keyseg++)
@@ -206,8 +206,8 @@ int mi_unique_comp(MI_UNIQUEDEF *def, const byte *a, const byte *b,
set_if_smaller(a_length, keyseg->length);
set_if_smaller(b_length, keyseg->length);
}
- memcpy_fixed((byte*) &pos_a,pos_a+keyseg->bit_start,sizeof(char*));
- memcpy_fixed((byte*) &pos_b,pos_b+keyseg->bit_start,sizeof(char*));
+ memcpy_fixed((uchar*) &pos_a,pos_a+keyseg->bit_start,sizeof(char*));
+ memcpy_fixed((uchar*) &pos_b,pos_b+keyseg->bit_start,sizeof(char*));
}
if (type == HA_KEYTYPE_TEXT || type == HA_KEYTYPE_VARTEXT1 ||
type == HA_KEYTYPE_VARTEXT2)
diff --git a/storage/myisam/mi_update.c b/storage/myisam/mi_update.c
index bea457d2e9a..956334b7806 100644
--- a/storage/myisam/mi_update.c
+++ b/storage/myisam/mi_update.c
@@ -18,7 +18,7 @@
#include "fulltext.h"
#include "rt_index.h"
-int mi_update(register MI_INFO *info, const byte *oldrec, byte *newrec)
+int mi_update(register MI_INFO *info, const uchar *oldrec, uchar *newrec)
{
int flag,key_changed,save_errno;
reg3 my_off_t pos;
@@ -102,7 +102,7 @@ int mi_update(register MI_INFO *info, const byte *oldrec, byte *newrec)
key_changed|=HA_STATE_WRITTEN;
}
changed|=((ulonglong) 1 << i);
- if (_mi_ft_update(info,i,(char*) old_key,oldrec,newrec,pos))
+ if (_mi_ft_update(info,i, old_key,oldrec,newrec,pos))
goto err;
}
}
@@ -115,7 +115,7 @@ int mi_update(register MI_INFO *info, const byte *oldrec, byte *newrec)
info->update&= ~HA_STATE_RNEXT_SAME;
if (new_length != old_length ||
- memcmp((byte*) old_key,(byte*) new_key,new_length))
+ memcmp((uchar*) old_key,(uchar*) new_key,new_length))
{
if ((int) i == info->lastinx)
key_changed|=HA_STATE_WRITTEN; /* Mark that keyfile changed */
@@ -207,8 +207,8 @@ err:
{
if (share->keyinfo[i].flag & HA_FULLTEXT)
{
- if ((flag++ && _mi_ft_del(info,i,(char*) new_key,newrec,pos)) ||
- _mi_ft_add(info,i,(char*) old_key,oldrec,pos))
+ if ((flag++ && _mi_ft_del(info,i, new_key,newrec,pos)) ||
+ _mi_ft_add(info,i, old_key,oldrec,pos))
break;
}
else
diff --git a/storage/myisam/mi_write.c b/storage/myisam/mi_write.c
index 57c054f2de8..70ba7a4588a 100644
--- a/storage/myisam/mi_write.c
+++ b/storage/myisam/mi_write.c
@@ -40,7 +40,7 @@ int _mi_ck_write_btree(register MI_INFO *info, uint keynr,uchar *key,
/* Write new record to database */
-int mi_write(MI_INFO *info, byte *record)
+int mi_write(MI_INFO *info, uchar *record)
{
MYISAM_SHARE *share=info->s;
uint i;
@@ -112,7 +112,7 @@ int mi_write(MI_INFO *info, byte *record)
}
if (share->keyinfo[i].flag & HA_FULLTEXT )
{
- if (_mi_ft_add(info,i,(char*) buff,record,filepos))
+ if (_mi_ft_add(info,i, buff, record, filepos))
{
if (local_lock_tree)
rw_unlock(&share->key_root_lock[i]);
@@ -200,7 +200,7 @@ err:
rw_wrlock(&share->key_root_lock[i]);
if (share->keyinfo[i].flag & HA_FULLTEXT)
{
- if (_mi_ft_del(info,i,(char*) buff,record,filepos))
+ if (_mi_ft_del(info,i, buff,record,filepos))
{
if (local_lock_tree)
rw_unlock(&share->key_root_lock[i]);
@@ -286,7 +286,7 @@ int _mi_ck_write_btree(register MI_INFO *info, uint keynr, uchar *key,
if (!error)
error= _mi_ft_convert_to_ft2(info, keynr, key);
delete_dynamic(info->ft1_to_ft2);
- my_free((gptr)info->ft1_to_ft2, MYF(0));
+ my_free((uchar*)info->ft1_to_ft2, MYF(0));
info->ft1_to_ft2=0;
}
DBUG_RETURN(error);
@@ -403,14 +403,14 @@ static int w_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
ft_intXstore(keypos, subkeys);
if (!error)
error=_mi_write_keypage(info,keyinfo,page,DFLT_INIT_HITS,temp_buff);
- my_afree((byte*) temp_buff);
+ my_afree((uchar*) temp_buff);
DBUG_RETURN(error);
}
}
else /* not HA_FULLTEXT, normal HA_NOSAME key */
{
info->dupp_key_pos= dupp_key_pos;
- my_afree((byte*) temp_buff);
+ my_afree((uchar*) temp_buff);
my_errno=HA_ERR_FOUND_DUPP_KEY;
DBUG_RETURN(-1);
}
@@ -429,10 +429,10 @@ static int w_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
if (_mi_write_keypage(info,keyinfo,page,DFLT_INIT_HITS,temp_buff))
goto err;
}
- my_afree((byte*) temp_buff);
+ my_afree((uchar*) temp_buff);
DBUG_RETURN(error);
err:
- my_afree((byte*) temp_buff);
+ my_afree((uchar*) temp_buff);
DBUG_PRINT("exit",("Error: %d",my_errno));
DBUG_RETURN (-1);
} /* w_search */
@@ -488,7 +488,7 @@ int _mi_insert(register MI_INFO *info, register MI_KEYDEF *keyinfo,
if (key_pos != anc_buff+2+nod_flag && (keyinfo->flag &
(HA_BINARY_PACK_KEY | HA_PACK_KEY)))
{
- DBUG_DUMP("prev_key",(byte*) key_buff,_mi_keylength(keyinfo,key_buff));
+ DBUG_DUMP("prev_key",(uchar*) key_buff,_mi_keylength(keyinfo,key_buff));
}
if (keyinfo->flag & HA_PACK_KEY)
{
@@ -506,7 +506,7 @@ int _mi_insert(register MI_INFO *info, register MI_KEYDEF *keyinfo,
my_errno=HA_ERR_CRASHED;
DBUG_RETURN(-1);
}
- bmove_upp((byte*) endpos+t_length,(byte*) endpos,(uint) (endpos-key_pos));
+ bmove_upp((uchar*) endpos+t_length,(uchar*) endpos,(uint) (endpos-key_pos));
}
else
{
@@ -562,7 +562,7 @@ int _mi_insert(register MI_INFO *info, register MI_KEYDEF *keyinfo,
we cannot easily dispatch an empty page here */
b+=blen+ft2len+2;
for (a=anc_buff+a_length ; b < a ; b+=ft2len+2)
- insert_dynamic(info->ft1_to_ft2, (char*) b);
+ insert_dynamic(info->ft1_to_ft2, b);
/* fixing the page's length - it contains only one key now */
mi_putint(anc_buff,2+blen+ft2len+2,0);
@@ -595,7 +595,7 @@ int _mi_split_page(register MI_INFO *info, register MI_KEYDEF *keyinfo,
MI_KEY_PARAM s_temp;
DBUG_ENTER("mi_split_page");
LINT_INIT(after_key);
- DBUG_DUMP("buff",(byte*) buff,mi_getint(buff));
+ DBUG_DUMP("buff",(uchar*) buff,mi_getint(buff));
if (info->s->keyinfo+info->lastinx == keyinfo)
info->page_changed=1; /* Info->buff is used */
@@ -619,7 +619,7 @@ int _mi_split_page(register MI_INFO *info, register MI_KEYDEF *keyinfo,
{
DBUG_PRINT("test",("Splitting nod"));
pos=key_pos-nod_flag;
- memcpy((byte*) info->buff+2,(byte*) pos,(size_t) nod_flag);
+ memcpy((uchar*) info->buff+2,(uchar*) pos,(size_t) nod_flag);
}
/* Move middle item to key and pointer to new page */
@@ -635,14 +635,14 @@ int _mi_split_page(register MI_INFO *info, register MI_KEYDEF *keyinfo,
(uchar*) 0, (uchar*) 0,
key_buff, &s_temp);
length=(uint) ((buff+a_length)-key_pos);
- memcpy((byte*) info->buff+key_ref_length+t_length,(byte*) key_pos,
+ memcpy((uchar*) info->buff+key_ref_length+t_length,(uchar*) key_pos,
(size_t) length);
(*keyinfo->store_key)(keyinfo,info->buff+key_ref_length,&s_temp);
mi_putint(info->buff,length+t_length+key_ref_length,nod_flag);
if (_mi_write_keypage(info,keyinfo,new_pos,DFLT_INIT_HITS,info->buff))
DBUG_RETURN(-1);
- DBUG_DUMP("key",(byte*) key,_mi_keylength(keyinfo,key));
+ DBUG_DUMP("key",(uchar*) key,_mi_keylength(keyinfo,key));
DBUG_RETURN(2); /* Middle key up */
} /* _mi_split_page */
@@ -764,7 +764,7 @@ static int _mi_balance_page(register MI_INFO *info, MI_KEYDEF *keyinfo,
length,keys;
uchar *pos,*buff,*extra_buff;
my_off_t next_page,new_pos;
- byte tmp_part_key[MI_MAX_KEY_BUFF];
+ uchar tmp_part_key[MI_MAX_KEY_BUFF];
DBUG_ENTER("_mi_balance_page");
k_length=keyinfo->keylength;
@@ -796,7 +796,7 @@ static int _mi_balance_page(register MI_INFO *info, MI_KEYDEF *keyinfo,
if (!_mi_fetch_keypage(info,keyinfo,next_page,DFLT_INIT_HITS,info->buff,0))
goto err;
- DBUG_DUMP("next",(byte*) info->buff,mi_getint(info->buff));
+ DBUG_DUMP("next",(uchar*) info->buff,mi_getint(info->buff));
/* Test if there is room to share keys */
@@ -815,23 +815,23 @@ static int _mi_balance_page(register MI_INFO *info, MI_KEYDEF *keyinfo,
if (left_length < new_left_length)
{ /* Move keys buff -> leaf */
pos=curr_buff+left_length;
- memcpy((byte*) pos,(byte*) father_key_pos, (size_t) k_length);
- memcpy((byte*) pos+k_length, (byte*) buff+2,
+ memcpy((uchar*) pos,(uchar*) father_key_pos, (size_t) k_length);
+ memcpy((uchar*) pos+k_length, (uchar*) buff+2,
(size_t) (length=new_left_length - left_length - k_length));
pos=buff+2+length;
- memcpy((byte*) father_key_pos,(byte*) pos,(size_t) k_length);
- bmove((byte*) buff+2,(byte*) pos+k_length,new_right_length);
+ memcpy((uchar*) father_key_pos,(uchar*) pos,(size_t) k_length);
+ bmove((uchar*) buff+2,(uchar*) pos+k_length,new_right_length);
}
else
{ /* Move keys -> buff */
- bmove_upp((byte*) buff+new_right_length,(byte*) buff+right_length,
+ bmove_upp((uchar*) buff+new_right_length,(uchar*) buff+right_length,
right_length-2);
length=new_right_length-right_length-k_length;
- memcpy((byte*) buff+2+length,father_key_pos,(size_t) k_length);
+ memcpy((uchar*) buff+2+length,father_key_pos,(size_t) k_length);
pos=curr_buff+new_left_length;
- memcpy((byte*) father_key_pos,(byte*) pos,(size_t) k_length);
- memcpy((byte*) buff+2,(byte*) pos+k_length,(size_t) length);
+ memcpy((uchar*) father_key_pos,(uchar*) pos,(size_t) k_length);
+ memcpy((uchar*) buff+2,(uchar*) pos+k_length,(size_t) length);
}
if (_mi_write_keypage(info,keyinfo,next_page,DFLT_INIT_HITS,info->buff) ||
@@ -858,22 +858,22 @@ static int _mi_balance_page(register MI_INFO *info, MI_KEYDEF *keyinfo,
/* move first largest keys to new page */
pos=buff+right_length-extra_length;
- memcpy((byte*) extra_buff+2,pos,(size_t) extra_length);
+ memcpy((uchar*) extra_buff+2,pos,(size_t) extra_length);
/* Save new parting key */
memcpy(tmp_part_key, pos-k_length,k_length);
/* Make place for new keys */
- bmove_upp((byte*) buff+new_right_length,(byte*) pos-k_length,
+ bmove_upp((uchar*) buff+new_right_length,(uchar*) pos-k_length,
right_length-extra_length-k_length-2);
/* Copy keys from left page */
pos= curr_buff+new_left_length;
- memcpy((byte*) buff+2,(byte*) pos+k_length,
+ memcpy((uchar*) buff+2,(uchar*) pos+k_length,
(size_t) (length=left_length-new_left_length-k_length));
/* Copy old parting key */
- memcpy((byte*) buff+2+length,father_key_pos,(size_t) k_length);
+ memcpy((uchar*) buff+2+length,father_key_pos,(size_t) k_length);
/* Move new parting keys up to caller */
- memcpy((byte*) (right ? key : father_key_pos),pos,(size_t) k_length);
- memcpy((byte*) (right ? father_key_pos : key),tmp_part_key, k_length);
+ memcpy((uchar*) (right ? key : father_key_pos),pos,(size_t) k_length);
+ memcpy((uchar*) (right ? father_key_pos : key),tmp_part_key, k_length);
if ((new_pos=_mi_new(info,keyinfo,DFLT_INIT_HITS)) == HA_OFFSET_ERROR)
goto err;
@@ -987,7 +987,7 @@ int mi_init_bulk_insert(MI_INFO *info, ulong cache_size, ha_rows rows)
DBUG_RETURN(0);
if (rows && rows*total_keylength < cache_size)
- cache_size=rows;
+ cache_size= (ulong)rows;
else
cache_size/=total_keylength*16;
diff --git a/storage/myisam/myisam_ftdump.c b/storage/myisam/myisam_ftdump.c
index 4bc1833cca6..63d954242a0 100644
--- a/storage/myisam/myisam_ftdump.c
+++ b/storage/myisam/myisam_ftdump.c
@@ -46,7 +46,7 @@ static struct my_option my_long_options[] =
{"stats", 's', "Report global stats.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"verbose", 'v', "Be verbose.",
- (gptr*) &verbose, (gptr*) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ (uchar**) &verbose, (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c
index 066e6cdb81b..567e1057e5d 100644
--- a/storage/myisam/myisamchk.c
+++ b/storage/myisam/myisamchk.c
@@ -68,9 +68,9 @@ static void get_options(int *argc,char * * *argv);
static void print_version(void);
static void usage(void);
static int myisamchk(MI_CHECK *param, char *filename);
-static void descript(MI_CHECK *param, register MI_INFO *info, my_string name);
+static void descript(MI_CHECK *param, register MI_INFO *info, char * name);
static int mi_sort_records(MI_CHECK *param, register MI_INFO *info,
- my_string name, uint sort_key,
+ char * name, uint sort_key,
my_bool write_info, my_bool update_index);
static int sort_record_index(MI_SORT_PARAM *sort_param, MI_INFO *info,
MI_KEYDEF *keyinfo,
@@ -167,7 +167,7 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
"Directory where character sets are.",
- (gptr*) &charsets_dir, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ (uchar**) &charsets_dir, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"check", 'c',
"Check table for errors.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -187,8 +187,8 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"data-file-length", 'D',
"Max length of data file (when recreating data-file when it's full).",
- (gptr*) &check_param.max_data_file_length,
- (gptr*) &check_param.max_data_file_length,
+ (uchar**) &check_param.max_data_file_length,
+ (uchar**) &check_param.max_data_file_length,
0, GET_LL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"extend-check", 'e',
"If used when checking a table, ensure that the table is 100 percent consistent, which will take a long time. If used when repairing a table, try to recover every possible row from the data file. Normally this will also find a lot of garbage rows; Don't use this option with repair if you are not totally desperate.",
@@ -210,13 +210,13 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"keys-used", 'k',
"Tell MyISAM to update only some specific keys. # is a bit mask of which keys to use. This can be used to get faster inserts.",
- (gptr*) &check_param.keys_in_use,
- (gptr*) &check_param.keys_in_use,
+ (uchar**) &check_param.keys_in_use,
+ (uchar**) &check_param.keys_in_use,
0, GET_ULL, REQUIRED_ARG, -1, 0, 0, 0, 0, 0},
{"max-record-length", OPT_MAX_RECORD_LENGTH,
"Skip rows bigger than this if myisamchk can't allocate memory to hold it",
- (gptr*) &check_param.max_record_length,
- (gptr*) &check_param.max_record_length,
+ (uchar**) &check_param.max_record_length,
+ (uchar**) &check_param.max_record_length,
0, GET_ULL, REQUIRED_ARG, LONGLONG_MAX, 0, LONGLONG_MAX, 0, 0, 0},
{"medium-check", 'm',
"Faster than extend-check, but only finds 99.99% of all errors. Should be good enough for most cases.",
@@ -245,12 +245,12 @@ static struct my_option my_long_options[] =
#endif
{"set-auto-increment", 'A',
"Force auto_increment to start at this or higher value. If no value is given, then sets the next auto_increment value to the highest used value for the auto key + 1.",
- (gptr*) &check_param.auto_increment_value,
- (gptr*) &check_param.auto_increment_value,
+ (uchar**) &check_param.auto_increment_value,
+ (uchar**) &check_param.auto_increment_value,
0, GET_ULL, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"set-collation", OPT_SET_COLLATION,
"Change the collation used by the index",
- (gptr*) &set_collation_name, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ (uchar**) &set_collation_name, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"set-variable", 'O',
"Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -262,12 +262,12 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"sort-records", 'R',
"Sort records according to an index. This makes your data much more localized and may speed up things. (It may be VERY slow to do a sort the first time!)",
- (gptr*) &check_param.opt_sort_key,
- (gptr*) &check_param.opt_sort_key,
+ (uchar**) &check_param.opt_sort_key,
+ (uchar**) &check_param.opt_sort_key,
0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"tmpdir", 't',
"Path for temporary files.",
- (gptr*) &opt_tmpdir,
+ (uchar**) &opt_tmpdir,
0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"update-state", 'U',
"Mark tables as crashed if any errors were found.",
@@ -285,54 +285,54 @@ static struct my_option my_long_options[] =
"Wait if table is locked.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{ "key_buffer_size", OPT_KEY_BUFFER_SIZE, "",
- (gptr*) &check_param.use_buffers, (gptr*) &check_param.use_buffers, 0,
+ (uchar**) &check_param.use_buffers, (uchar**) &check_param.use_buffers, 0,
GET_ULONG, REQUIRED_ARG, (long) USE_BUFFER_INIT, (long) MALLOC_OVERHEAD,
(long) ~0L, (long) MALLOC_OVERHEAD, (long) IO_SIZE, 0},
{ "key_cache_block_size", OPT_KEY_CACHE_BLOCK_SIZE, "",
- (gptr*) &opt_key_cache_block_size,
- (gptr*) &opt_key_cache_block_size, 0,
+ (uchar**) &opt_key_cache_block_size,
+ (uchar**) &opt_key_cache_block_size, 0,
GET_LONG, REQUIRED_ARG, MI_KEY_BLOCK_LENGTH, MI_MIN_KEY_BLOCK_LENGTH,
MI_MAX_KEY_BLOCK_LENGTH, 0, MI_MIN_KEY_BLOCK_LENGTH, 0},
{ "myisam_block_size", OPT_MYISAM_BLOCK_SIZE, "",
- (gptr*) &opt_myisam_block_size, (gptr*) &opt_myisam_block_size, 0,
+ (uchar**) &opt_myisam_block_size, (uchar**) &opt_myisam_block_size, 0,
GET_LONG, REQUIRED_ARG, MI_KEY_BLOCK_LENGTH, MI_MIN_KEY_BLOCK_LENGTH,
MI_MAX_KEY_BLOCK_LENGTH, 0, MI_MIN_KEY_BLOCK_LENGTH, 0},
{ "read_buffer_size", OPT_READ_BUFFER_SIZE, "",
- (gptr*) &check_param.read_buffer_length,
- (gptr*) &check_param.read_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
+ (uchar**) &check_param.read_buffer_length,
+ (uchar**) &check_param.read_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
(long) READ_BUFFER_INIT, (long) MALLOC_OVERHEAD,
(long) ~0L, (long) MALLOC_OVERHEAD, (long) 1L, 0},
{ "write_buffer_size", OPT_WRITE_BUFFER_SIZE, "",
- (gptr*) &check_param.write_buffer_length,
- (gptr*) &check_param.write_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
+ (uchar**) &check_param.write_buffer_length,
+ (uchar**) &check_param.write_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
(long) READ_BUFFER_INIT, (long) MALLOC_OVERHEAD,
(long) ~0L, (long) MALLOC_OVERHEAD, (long) 1L, 0},
{ "sort_buffer_size", OPT_SORT_BUFFER_SIZE, "",
- (gptr*) &check_param.sort_buffer_length,
- (gptr*) &check_param.sort_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
+ (uchar**) &check_param.sort_buffer_length,
+ (uchar**) &check_param.sort_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
(long) SORT_BUFFER_INIT, (long) (MIN_SORT_BUFFER + MALLOC_OVERHEAD),
(long) ~0L, (long) MALLOC_OVERHEAD, (long) 1L, 0},
{ "sort_key_blocks", OPT_SORT_KEY_BLOCKS, "",
- (gptr*) &check_param.sort_key_blocks,
- (gptr*) &check_param.sort_key_blocks, 0, GET_ULONG, REQUIRED_ARG,
+ (uchar**) &check_param.sort_key_blocks,
+ (uchar**) &check_param.sort_key_blocks, 0, GET_ULONG, REQUIRED_ARG,
BUFFERS_WHEN_SORTING, 4L, 100L, 0L, 1L, 0},
- { "decode_bits", OPT_DECODE_BITS, "", (gptr*) &decode_bits,
- (gptr*) &decode_bits, 0, GET_UINT, REQUIRED_ARG, 9L, 4L, 17L, 0L, 1L, 0},
- { "ft_min_word_len", OPT_FT_MIN_WORD_LEN, "", (gptr*) &ft_min_word_len,
- (gptr*) &ft_min_word_len, 0, GET_ULONG, REQUIRED_ARG, 4, 1, HA_FT_MAXCHARLEN,
+ { "decode_bits", OPT_DECODE_BITS, "", (uchar**) &decode_bits,
+ (uchar**) &decode_bits, 0, GET_UINT, REQUIRED_ARG, 9L, 4L, 17L, 0L, 1L, 0},
+ { "ft_min_word_len", OPT_FT_MIN_WORD_LEN, "", (uchar**) &ft_min_word_len,
+ (uchar**) &ft_min_word_len, 0, GET_ULONG, REQUIRED_ARG, 4, 1, HA_FT_MAXCHARLEN,
0, 1, 0},
- { "ft_max_word_len", OPT_FT_MAX_WORD_LEN, "", (gptr*) &ft_max_word_len,
- (gptr*) &ft_max_word_len, 0, GET_ULONG, REQUIRED_ARG, HA_FT_MAXCHARLEN, 10,
+ { "ft_max_word_len", OPT_FT_MAX_WORD_LEN, "", (uchar**) &ft_max_word_len,
+ (uchar**) &ft_max_word_len, 0, GET_ULONG, REQUIRED_ARG, HA_FT_MAXCHARLEN, 10,
HA_FT_MAXCHARLEN, 0, 1, 0},
{ "ft_stopword_file", OPT_FT_STOPWORD_FILE,
"Use stopwords from this file instead of built-in list.",
- (gptr*) &ft_stopword_file, (gptr*) &ft_stopword_file, 0, GET_STR,
+ (uchar**) &ft_stopword_file, (uchar**) &ft_stopword_file, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"stats_method", OPT_STATS_METHOD,
- "Specifies how index statistics collection code should threat NULLs. "
+ "Specifies how index statistics collection code should treat NULLs. "
"Possible values of name are \"nulls_unequal\" (default behavior for 4.1/5.0), "
"\"nulls_equal\" (emulate 4.0 behavior), and \"nulls_ignored\".",
- (gptr*) &myisam_stats_method_str, (gptr*) &myisam_stats_method_str, 0,
+ (uchar**) &myisam_stats_method_str, (uchar**) &myisam_stats_method_str, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -444,7 +444,7 @@ static void usage(void)
MySQL faster. You can check the calculated distribution\n\
by using '--description --verbose table_name'.\n\
--stats_method=name Specifies how index statistics collection code should\n\
- threat NULLs. Possible values of name are \"nulls_unequal\"\n\
+ treat NULLs. Possible values of name are \"nulls_unequal\"\n\
(default for 4.1/5.0), \"nulls_equal\" (emulate 4.0), and \n\
\"nulls_ignored\".\n\
-d, --description Prints some information about table.\n\
@@ -794,7 +794,7 @@ static void get_options(register int *argc,register char ***argv)
/* Check table */
-static int myisamchk(MI_CHECK *param, my_string filename)
+static int myisamchk(MI_CHECK *param, char * filename)
{
int error,lock_type,recreate;
int rep_quick= param->testflag & (T_QUICK | T_FORCE_UNIQUENESS);
@@ -1199,7 +1199,7 @@ end2:
/* Write info about table */
-static void descript(MI_CHECK *param, register MI_INFO *info, my_string name)
+static void descript(MI_CHECK *param, register MI_INFO *info, char * name)
{
uint key,keyseg_nr,field,start;
reg3 MI_KEYDEF *keyinfo;
@@ -1465,7 +1465,7 @@ static void descript(MI_CHECK *param, register MI_INFO *info, my_string name)
/* Sort records according to one key */
static int mi_sort_records(MI_CHECK *param,
- register MI_INFO *info, my_string name,
+ register MI_INFO *info, char * name,
uint sort_key,
my_bool write_info,
my_bool update_index)
@@ -1536,7 +1536,7 @@ static int mi_sort_records(MI_CHECK *param,
mi_check_print_error(param,"Not enough memory for key block");
goto err;
}
- if (!(sort_param.record=(byte*) my_malloc((uint) share->base.pack_reclength,
+ if (!(sort_param.record=(uchar*) my_malloc((uint) share->base.pack_reclength,
MYF(0))))
{
mi_check_print_error(param,"Not enough memory for record");
@@ -1567,7 +1567,7 @@ static int mi_sort_records(MI_CHECK *param,
for (key=0 ; key < share->base.keys ; key++)
share->keyinfo[key].flag|= HA_SORT_ALLOWS_SAME;
- if (my_pread(share->kfile,(byte*) temp_buff,
+ if (my_pread(share->kfile,(uchar*) temp_buff,
(uint) keyinfo->block_length,
share->state.key_root[sort_key],
MYF(MY_NABP+MY_WME)))
@@ -1630,7 +1630,7 @@ err:
}
if (temp_buff)
{
- my_afree((gptr) temp_buff);
+ my_afree((uchar*) temp_buff);
}
my_free(sort_param.record,MYF(MY_ALLOW_ZERO_PTR));
info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
@@ -1679,7 +1679,7 @@ static int sort_record_index(MI_SORT_PARAM *sort_param,MI_INFO *info,
if (nod_flag)
{
next_page=_mi_kpos(nod_flag,keypos);
- if (my_pread(info->s->kfile,(byte*) temp_buff,
+ if (my_pread(info->s->kfile,(uchar*) temp_buff,
(uint) keyinfo->block_length, next_page,
MYF(MY_NABP+MY_WME)))
{
@@ -1718,19 +1718,19 @@ static int sort_record_index(MI_SORT_PARAM *sort_param,MI_INFO *info,
goto err;
}
/* Clear end of block to get better compression if the table is backuped */
- bzero((byte*) buff+used_length,keyinfo->block_length-used_length);
- if (my_pwrite(info->s->kfile,(byte*) buff,(uint) keyinfo->block_length,
+ bzero((uchar*) buff+used_length,keyinfo->block_length-used_length);
+ if (my_pwrite(info->s->kfile,(uchar*) buff,(uint) keyinfo->block_length,
page,param->myf_rw))
{
mi_check_print_error(param,"%d when updating keyblock",my_errno);
goto err;
}
if (temp_buff)
- my_afree((gptr) temp_buff);
+ my_afree((uchar*) temp_buff);
DBUG_RETURN(0);
err:
if (temp_buff)
- my_afree((gptr) temp_buff);
+ my_afree((uchar*) temp_buff);
DBUG_RETURN(1);
} /* sort_record_index */
diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h
index a491e6d210c..721d6b9f271 100644
--- a/storage/myisam/myisamdef.h
+++ b/storage/myisam/myisamdef.h
@@ -167,22 +167,22 @@ typedef struct st_mi_isam_share { /* Shared between opens */
char *unique_file_name; /* realpath() of index file */
char *data_file_name, /* Resolved path names from symlinks */
*index_file_name;
- byte *file_map; /* mem-map of file if possible */
+ uchar *file_map; /* mem-map of file if possible */
KEY_CACHE *key_cache; /* ref to the current key cache */
MI_DECODE_TREE *decode_trees;
uint16 *decode_tables;
- int (*read_record)(struct st_myisam_info*, my_off_t, byte*);
- int (*write_record)(struct st_myisam_info*, const byte*);
- int (*update_record)(struct st_myisam_info*, my_off_t, const byte*);
+ int (*read_record)(struct st_myisam_info*, my_off_t, uchar*);
+ int (*write_record)(struct st_myisam_info*, const uchar*);
+ int (*update_record)(struct st_myisam_info*, my_off_t, const uchar*);
int (*delete_record)(struct st_myisam_info*);
- int (*read_rnd)(struct st_myisam_info*, byte*, my_off_t, my_bool);
- int (*compare_record)(struct st_myisam_info*, const byte *);
+ int (*read_rnd)(struct st_myisam_info*, uchar*, my_off_t, my_bool);
+ int (*compare_record)(struct st_myisam_info*, const uchar *);
/* Function to use for a row checksum. */
- ha_checksum (*calc_checksum)(struct st_myisam_info*, const byte *);
+ ha_checksum (*calc_checksum)(struct st_myisam_info*, const uchar *);
int (*compare_unique)(struct st_myisam_info*, MI_UNIQUEDEF *,
- const byte *record, my_off_t pos);
- uint (*file_read)(MI_INFO *, byte *, uint, my_off_t, myf);
- uint (*file_write)(MI_INFO *, byte *, uint, my_off_t, myf);
+ const uchar *record, my_off_t pos);
+ size_t (*file_read)(MI_INFO *, uchar *, size_t, my_off_t, myf);
+ size_t (*file_write)(MI_INFO *, const uchar *, size_t, my_off_t, myf);
invalidator_by_filename invalidator; /* query cache invalidator */
ulong this_process; /* processid */
ulong last_process; /* For table-change-check */
@@ -245,12 +245,12 @@ struct st_myisam_info {
uchar *buff, /* Temp area for key */
*lastkey,*lastkey2; /* Last used search key */
uchar *first_mbr_key; /* Searhed spatial key */
- byte *rec_buff; /* Tempbuff for recordpack */
+ uchar *rec_buff; /* Tempbuff for recordpack */
uchar *int_keypos, /* Save position for next/previous */
*int_maxpos; /* -""- */
uint int_nod_flag; /* -""- */
uint32 int_keytree_version; /* -""- */
- int (*read_record)(struct st_myisam_info*, my_off_t, byte*);
+ int (*read_record)(struct st_myisam_info*, my_off_t, uchar*);
invalidator_by_filename invalidator; /* query cache invalidator */
ulong this_unique; /* uniq filenumber or thread */
ulong last_unique; /* last unique number */
@@ -334,10 +334,10 @@ typedef struct st_mi_sort_param
HA_KEYSEG *seg;
SORT_INFO *sort_info;
uchar **sort_keys;
- byte *rec_buff;
+ uchar *rec_buff;
void *wordlist, *wordptr;
MEM_ROOT wordroot;
- char *record;
+ uchar *record;
MY_TMPDIR *tmpdir;
int (*key_cmp)(struct st_mi_sort_param *, const void *, const void *);
int (*key_read)(struct st_mi_sort_param *,void *);
@@ -346,9 +346,10 @@ typedef struct st_mi_sort_param
NEAR int (*write_keys)(struct st_mi_sort_param *, register uchar **,
uint , struct st_buffpek *, IO_CACHE *);
NEAR uint (*read_to_buffer)(IO_CACHE *,struct st_buffpek *, uint);
- NEAR int (*write_key)(struct st_mi_sort_param *, IO_CACHE *,char *,
+ NEAR int (*write_key)(struct st_mi_sort_param *, IO_CACHE *,uchar *,
uint, uint);
} MI_SORT_PARAM;
+
/* Some defines used by isam-funktions */
#define USE_WHOLE_KEY MI_MAX_KEY_BUFF*2 /* Use whole key in _mi_search() */
@@ -497,20 +498,20 @@ typedef struct st_mi_s_param
/* Prototypes for intern functions */
-extern int _mi_read_dynamic_record(MI_INFO *info,my_off_t filepos,byte *buf);
-extern int _mi_write_dynamic_record(MI_INFO*, const byte*);
-extern int _mi_update_dynamic_record(MI_INFO*, my_off_t, const byte*);
+extern int _mi_read_dynamic_record(MI_INFO *info,my_off_t filepos,uchar *buf);
+extern int _mi_write_dynamic_record(MI_INFO*, const uchar*);
+extern int _mi_update_dynamic_record(MI_INFO*, my_off_t, const uchar*);
extern int _mi_delete_dynamic_record(MI_INFO *info);
-extern int _mi_cmp_dynamic_record(MI_INFO *info,const byte *record);
-extern int _mi_read_rnd_dynamic_record(MI_INFO *, byte *,my_off_t, my_bool);
-extern int _mi_write_blob_record(MI_INFO*, const byte*);
-extern int _mi_update_blob_record(MI_INFO*, my_off_t, const byte*);
-extern int _mi_read_static_record(MI_INFO *info, my_off_t filepos,byte *buf);
-extern int _mi_write_static_record(MI_INFO*, const byte*);
-extern int _mi_update_static_record(MI_INFO*, my_off_t, const byte*);
+extern int _mi_cmp_dynamic_record(MI_INFO *info,const uchar *record);
+extern int _mi_read_rnd_dynamic_record(MI_INFO *, uchar *,my_off_t, my_bool);
+extern int _mi_write_blob_record(MI_INFO*, const uchar*);
+extern int _mi_update_blob_record(MI_INFO*, my_off_t, const uchar*);
+extern int _mi_read_static_record(MI_INFO *info, my_off_t filepos,uchar *buf);
+extern int _mi_write_static_record(MI_INFO*, const uchar*);
+extern int _mi_update_static_record(MI_INFO*, my_off_t, const uchar*);
extern int _mi_delete_static_record(MI_INFO *info);
-extern int _mi_cmp_static_record(MI_INFO *info,const byte *record);
-extern int _mi_read_rnd_static_record(MI_INFO*, byte *,my_off_t, my_bool);
+extern int _mi_cmp_static_record(MI_INFO *info,const uchar *record);
+extern int _mi_read_rnd_static_record(MI_INFO*, uchar *,my_off_t, my_bool);
extern int _mi_ck_write(MI_INFO *info,uint keynr,uchar *key,uint length);
extern int _mi_ck_real_write_btree(MI_INFO *info, MI_KEYDEF *keyinfo,
uchar *key, uint key_length,
@@ -604,39 +605,39 @@ extern int _mi_dispose(MI_INFO *info,MI_KEYDEF *keyinfo,my_off_t pos,
int level);
extern my_off_t _mi_new(MI_INFO *info,MI_KEYDEF *keyinfo,int level);
extern uint _mi_make_key(MI_INFO *info,uint keynr,uchar *key,
- const byte *record,my_off_t filepos);
+ const uchar *record,my_off_t filepos);
extern uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key,
uchar *old, key_part_map keypart_map,
HA_KEYSEG **last_used_keyseg);
-extern int _mi_read_key_record(MI_INFO *info,my_off_t filepos,byte *buf);
-extern int _mi_read_cache(IO_CACHE *info,byte *buff,my_off_t pos,
+extern int _mi_read_key_record(MI_INFO *info,my_off_t filepos,uchar *buf);
+extern int _mi_read_cache(IO_CACHE *info,uchar *buff,my_off_t pos,
uint length,int re_read_if_possibly);
-extern ulonglong retrieve_auto_increment(MI_INFO *info,const byte *record);
+extern ulonglong retrieve_auto_increment(MI_INFO *info,const uchar *record);
-extern byte *mi_alloc_rec_buff(MI_INFO *,ulong, byte**);
+extern uchar *mi_alloc_rec_buff(MI_INFO *,ulong, uchar**);
#define mi_get_rec_buff_ptr(info,buf) \
((((info)->s->options & HA_OPTION_PACK_RECORD) && (buf)) ? \
(buf) - MI_REC_BUFF_OFFSET : (buf))
#define mi_get_rec_buff_len(info,buf) \
(*((uint32 *)(mi_get_rec_buff_ptr(info,buf))))
-extern ulong _mi_rec_unpack(MI_INFO *info,byte *to,byte *from,
+extern ulong _mi_rec_unpack(MI_INFO *info,uchar *to,uchar *from,
ulong reclength);
-extern my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *packpos,
+extern my_bool _mi_rec_check(MI_INFO *info,const uchar *record, uchar *packpos,
ulong packed_length, my_bool with_checkum);
extern int _mi_write_part_record(MI_INFO *info,my_off_t filepos,ulong length,
- my_off_t next_filepos,byte **record,
+ my_off_t next_filepos,uchar **record,
ulong *reclength,int *flag);
extern void _mi_print_key(FILE *stream,HA_KEYSEG *keyseg,const uchar *key,
uint length);
extern my_bool _mi_read_pack_info(MI_INFO *info,pbool fix_keys);
-extern int _mi_read_pack_record(MI_INFO *info,my_off_t filepos,byte *buf);
-extern int _mi_read_rnd_pack_record(MI_INFO*, byte *,my_off_t, my_bool);
+extern int _mi_read_pack_record(MI_INFO *info,my_off_t filepos,uchar *buf);
+extern int _mi_read_rnd_pack_record(MI_INFO*, uchar *,my_off_t, my_bool);
extern int _mi_pack_rec_unpack(MI_INFO *info, MI_BIT_BUFF *bit_buff,
- byte *to, byte *from, ulong reclength);
+ uchar *to, uchar *from, ulong reclength);
extern ulonglong mi_safe_mul(ulonglong a,ulonglong b);
-extern int _mi_ft_update(MI_INFO *info, uint keynr, byte *keybuf,
- const byte *oldrec, const byte *newrec, my_off_t pos);
+extern int _mi_ft_update(MI_INFO *info, uint keynr, uchar *keybuf,
+ const uchar *oldrec, const uchar *newrec, my_off_t pos);
struct st_sort_info;
@@ -697,33 +698,33 @@ extern "C" {
#endif
extern uint _mi_get_block_info(MI_BLOCK_INFO *,File, my_off_t);
-extern uint _mi_rec_pack(MI_INFO *info,byte *to,const byte *from);
+extern uint _mi_rec_pack(MI_INFO *info,uchar *to,const uchar *from);
extern uint _mi_pack_get_block_info(MI_INFO *myisam, MI_BIT_BUFF *bit_buff,
- MI_BLOCK_INFO *info, byte **rec_buff_p,
+ MI_BLOCK_INFO *info, uchar **rec_buff_p,
File file, my_off_t filepos);
-extern void _my_store_blob_length(byte *pos,uint pack_length,uint length);
+extern void _my_store_blob_length(uchar *pos,uint pack_length,uint length);
extern void _myisam_log(enum myisam_log_commands command,MI_INFO *info,
- const byte *buffert,uint length);
+ const uchar *buffert,uint length);
extern void _myisam_log_command(enum myisam_log_commands command,
- MI_INFO *info, const byte *buffert,
+ MI_INFO *info, const uchar *buffert,
uint length, int result);
extern void _myisam_log_record(enum myisam_log_commands command,MI_INFO *info,
- const byte *record,my_off_t filepos,
+ const uchar *record,my_off_t filepos,
int result);
extern void mi_report_error(int errcode, const char *file_name);
extern my_bool _mi_memmap_file(MI_INFO *info);
extern void _mi_unmap_file(MI_INFO *info);
-extern uint save_pack_length(uint version, byte *block_buff, ulong length);
+extern uint save_pack_length(uint version, uchar *block_buff, ulong length);
extern uint read_pack_length(uint version, const uchar *buf, ulong *length);
extern uint calc_pack_length(uint version, ulong length);
-extern uint mi_mmap_pread(MI_INFO *info, byte *Buffer,
- uint Count, my_off_t offset, myf MyFlags);
-extern uint mi_mmap_pwrite(MI_INFO *info, byte *Buffer,
- uint Count, my_off_t offset, myf MyFlags);
-extern uint mi_nommap_pread(MI_INFO *info, byte *Buffer,
- uint Count, my_off_t offset, myf MyFlags);
-extern uint mi_nommap_pwrite(MI_INFO *info, byte *Buffer,
- uint Count, my_off_t offset, myf MyFlags);
+extern size_t mi_mmap_pread(MI_INFO *info, uchar *Buffer,
+ size_t Count, my_off_t offset, myf MyFlags);
+extern size_t mi_mmap_pwrite(MI_INFO *info, const uchar *Buffer,
+ size_t Count, my_off_t offset, myf MyFlags);
+extern size_t mi_nommap_pread(MI_INFO *info, uchar *Buffer,
+ size_t Count, my_off_t offset, myf MyFlags);
+extern size_t mi_nommap_pwrite(MI_INFO *info, const uchar *Buffer,
+ size_t Count, my_off_t offset, myf MyFlags);
uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite);
uchar *mi_state_info_read(uchar *ptr, MI_STATE_INFO *state);
@@ -731,27 +732,27 @@ uint mi_state_info_read_dsk(File file, MI_STATE_INFO *state, my_bool pRead);
uint mi_base_info_write(File file, MI_BASE_INFO *base);
uchar *my_n_base_info_read(uchar *ptr, MI_BASE_INFO *base);
int mi_keyseg_write(File file, const HA_KEYSEG *keyseg);
-char *mi_keyseg_read(char *ptr, HA_KEYSEG *keyseg);
+uchar *mi_keyseg_read(uchar *ptr, HA_KEYSEG *keyseg);
uint mi_keydef_write(File file, MI_KEYDEF *keydef);
-char *mi_keydef_read(char *ptr, MI_KEYDEF *keydef);
+uchar *mi_keydef_read(uchar *ptr, MI_KEYDEF *keydef);
uint mi_uniquedef_write(File file, MI_UNIQUEDEF *keydef);
-char *mi_uniquedef_read(char *ptr, MI_UNIQUEDEF *keydef);
+uchar *mi_uniquedef_read(uchar *ptr, MI_UNIQUEDEF *keydef);
uint mi_recinfo_write(File file, MI_COLUMNDEF *recinfo);
-char *mi_recinfo_read(char *ptr, MI_COLUMNDEF *recinfo);
+uchar *mi_recinfo_read(uchar *ptr, MI_COLUMNDEF *recinfo);
extern int mi_disable_indexes(MI_INFO *info);
extern int mi_enable_indexes(MI_INFO *info);
extern int mi_indexes_are_disabled(MI_INFO *info);
-ulong _my_calc_total_blob_length(MI_INFO *info, const byte *record);
-ha_checksum mi_checksum(MI_INFO *info, const byte *buf);
-ha_checksum mi_static_checksum(MI_INFO *info, const byte *buf);
-my_bool mi_check_unique(MI_INFO *info, MI_UNIQUEDEF *def, byte *record,
+ulong _my_calc_total_blob_length(MI_INFO *info, const uchar *record);
+ha_checksum mi_checksum(MI_INFO *info, const uchar *buf);
+ha_checksum mi_static_checksum(MI_INFO *info, const uchar *buf);
+my_bool mi_check_unique(MI_INFO *info, MI_UNIQUEDEF *def, uchar *record,
ha_checksum unique_hash, my_off_t pos);
-ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const byte *buf);
+ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const uchar *buf);
int _mi_cmp_static_unique(MI_INFO *info, MI_UNIQUEDEF *def,
- const byte *record, my_off_t pos);
+ const uchar *record, my_off_t pos);
int _mi_cmp_dynamic_unique(MI_INFO *info, MI_UNIQUEDEF *def,
- const byte *record, my_off_t pos);
-int mi_unique_comp(MI_UNIQUEDEF *def, const byte *a, const byte *b,
+ const uchar *record, my_off_t pos);
+int mi_unique_comp(MI_UNIQUEDEF *def, const uchar *a, const uchar *b,
my_bool null_are_equal);
void mi_get_status(void* param, int concurrent_insert);
void mi_update_status(void* param);
diff --git a/storage/myisam/myisamlog.c b/storage/myisam/myisamlog.c
index 0bcf74d87a4..6566a7a7a02 100644
--- a/storage/myisam/myisamlog.c
+++ b/storage/myisam/myisamlog.c
@@ -32,14 +32,15 @@ struct file_info {
long process;
int filenr,id;
uint rnd;
- my_string name,show_name,record;
+ char *name, *show_name;
+ uchar *record;
MI_INFO *isam;
bool closed,used;
ulong accessed;
};
struct test_if_open_param {
- my_string name;
+ char * name;
int max_id;
};
@@ -53,24 +54,25 @@ struct st_access_param
extern int main(int argc,char * *argv);
static void get_options(int *argc,char ***argv);
-static int examine_log(my_string file_name,char **table_names);
-static int read_string(IO_CACHE *file,gptr *to,uint length);
+static int examine_log(char * file_name,char **table_names);
+static int read_string(IO_CACHE *file,uchar* *to,uint length);
static int file_info_compare(void *cmp_arg, void *a,void *b);
static int test_if_open(struct file_info *key,element_count count,
struct test_if_open_param *param);
-static void fix_blob_pointers(MI_INFO *isam,byte *record);
+static void fix_blob_pointers(MI_INFO *isam,uchar *record);
static int test_when_accessed(struct file_info *key,element_count count,
struct st_access_param *access_param);
static void file_info_free(struct file_info *info);
static int close_some_file(TREE *tree);
static int reopen_closed_file(TREE *tree,struct file_info *file_info);
-static int find_record_with_key(struct file_info *file_info,byte *record);
+static int find_record_with_key(struct file_info *file_info,uchar *record);
static void printf_log(const char *str,...);
-static bool cmp_filename(struct file_info *file_info,my_string name);
+static bool cmp_filename(struct file_info *file_info,char * name);
static uint verbose=0,update=0,test_info=0,max_files=0,re_open_count=0,
recover=0,prefix_remove=0,opt_processes=0;
-static my_string log_filename=0,filepath=0,write_filename=0,record_pos_file=0;
+static char *log_filename=0, *filepath=0, *write_filename=0;
+static char *record_pos_file= 0;
static ulong com_count[10][3],number_of_commands=(ulong) ~0L,
isamlog_process;
static my_off_t isamlog_filepos,start_offset=0,record_pos= HA_OFFSET_ERROR;
@@ -296,7 +298,7 @@ static void get_options(register int *argc, register char ***argv)
}
-static int examine_log(my_string file_name, char **table_names)
+static int examine_log(char * file_name, char **table_names)
{
uint command,result,files_open;
ulong access_time,length;
@@ -304,7 +306,7 @@ static int examine_log(my_string file_name, char **table_names)
int lock_command,mi_result;
char isam_file_name[FN_REFLEN],llbuff[21],llbuff2[21];
uchar head[20];
- gptr buff;
+ uchar* buff;
struct test_if_open_param open_param;
IO_CACHE cache;
File file;
@@ -327,7 +329,7 @@ static int examine_log(my_string file_name, char **table_names)
}
init_io_cache(&cache,file,0,READ_CACHE,start_offset,0,MYF(0));
- bzero((gptr) com_count,sizeof(com_count));
+ bzero((uchar*) com_count,sizeof(com_count));
init_tree(&tree,0,0,sizeof(file_info),(qsort_cmp2) file_info_compare,1,
(tree_element_free) file_info_free, NULL);
VOID(init_key_cache(dflt_key_cache,KEY_CACHE_BLOCK_SIZE,KEY_CACHE_SIZE,
@@ -335,7 +337,7 @@ static int examine_log(my_string file_name, char **table_names)
files_open=0; access_time=0;
while (access_time++ != number_of_commands &&
- !my_b_read(&cache,(byte*) head,9))
+ !my_b_read(&cache,(uchar*) head,9))
{
isamlog_filepos=my_b_tell(&cache)-9L;
file_info.filenr= mi_uint2korr(head+1);
@@ -375,14 +377,15 @@ static int examine_log(my_string file_name, char **table_names)
}
if (curr_file_info)
- printf("\nWarning: %s is opened with same process and filenumber\nMaybe you should use the -P option ?\n",
+ printf("\nWarning: %s is opened with same process and filenumber\n"
+ "Maybe you should use the -P option ?\n",
curr_file_info->show_name);
- if (my_b_read(&cache,(byte*) head,2))
+ if (my_b_read(&cache,(uchar*) head,2))
goto err;
file_info.name=0;
file_info.show_name=0;
file_info.record=0;
- if (read_string(&cache,(gptr*) &file_info.name,
+ if (read_string(&cache,(uchar**) &file_info.name,
(uint) mi_uint2korr(head)))
goto err;
{
@@ -455,7 +458,7 @@ static int examine_log(my_string file_name, char **table_names)
files_open++;
file_info.closed=0;
}
- VOID(tree_insert(&tree, (gptr) &file_info, 0, tree.custom_arg));
+ VOID(tree_insert(&tree, (uchar*) &file_info, 0, tree.custom_arg));
if (file_info.used)
{
if (verbose && !record_pos_file)
@@ -474,11 +477,11 @@ static int examine_log(my_string file_name, char **table_names)
{
if (!curr_file_info->closed)
files_open--;
- VOID(tree_delete(&tree, (gptr) curr_file_info, 0, tree.custom_arg));
+ VOID(tree_delete(&tree, (uchar*) curr_file_info, 0, tree.custom_arg));
}
break;
case MI_LOG_EXTRA:
- if (my_b_read(&cache,(byte*) head,1))
+ if (my_b_read(&cache,(uchar*) head,1))
goto err;
extra_command=(enum ha_extra_function) head[0];
if (verbose && !record_pos_file &&
@@ -499,7 +502,7 @@ static int examine_log(my_string file_name, char **table_names)
}
break;
case MI_LOG_DELETE:
- if (my_b_read(&cache,(byte*) head,8))
+ if (my_b_read(&cache,(uchar*) head,8))
goto err;
filepos=mi_sizekorr(head);
if (verbose && (!record_pos_file ||
@@ -534,7 +537,7 @@ static int examine_log(my_string file_name, char **table_names)
break;
case MI_LOG_WRITE:
case MI_LOG_UPDATE:
- if (my_b_read(&cache,(byte*) head,12))
+ if (my_b_read(&cache,(uchar*) head,12))
goto err;
filepos=mi_sizekorr(head);
length=mi_uint4korr(head+8);
@@ -616,7 +619,7 @@ static int examine_log(my_string file_name, char **table_names)
my_free(buff,MYF(0));
break;
case MI_LOG_LOCK:
- if (my_b_read(&cache,(byte*) head,sizeof(lock_command)))
+ if (my_b_read(&cache,(uchar*) head,sizeof(lock_command)))
goto err;
memcpy_fixed(&lock_command,head,sizeof(lock_command));
if (verbose && !record_pos_file &&
@@ -675,14 +678,14 @@ static int examine_log(my_string file_name, char **table_names)
}
-static int read_string(IO_CACHE *file, register gptr *to, register uint length)
+static int read_string(IO_CACHE *file, register uchar* *to, register uint length)
{
DBUG_ENTER("read_string");
if (*to)
- my_free((gptr) *to,MYF(0));
- if (!(*to= (gptr) my_malloc(length+1,MYF(MY_WME))) ||
- my_b_read(file,(byte*) *to,length))
+ my_free((uchar*) *to,MYF(0));
+ if (!(*to= (uchar*) my_malloc(length+1,MYF(MY_WME))) ||
+ my_b_read(file,(uchar*) *to,length))
{
if (*to)
my_free(*to,MYF(0));
@@ -717,9 +720,9 @@ static int test_if_open (struct file_info *key,
}
-static void fix_blob_pointers(MI_INFO *info, byte *record)
+static void fix_blob_pointers(MI_INFO *info, uchar *record)
{
- byte *pos;
+ uchar *pos;
MI_BLOB *blob,*end;
pos=record+info->s->base.reclength;
@@ -801,7 +804,7 @@ static int reopen_closed_file(TREE *tree, struct file_info *fileinfo)
/* Try to find record with uniq key */
-static int find_record_with_key(struct file_info *file_info, byte *record)
+static int find_record_with_key(struct file_info *file_info, uchar *record)
{
uint key;
MI_INFO *info=file_info->isam;
@@ -813,7 +816,7 @@ static int find_record_with_key(struct file_info *file_info, byte *record)
info->s->keyinfo[key].flag & HA_NOSAME)
{
VOID(_mi_make_key(info,key,tmp_key,record,0L));
- return mi_rkey(info,file_info->record,(int) key,(char*) tmp_key,0,
+ return mi_rkey(info,file_info->record,(int) key,tmp_key,0,
HA_READ_KEY_EXACT);
}
}
@@ -836,7 +839,7 @@ static void printf_log(const char *format,...)
}
-static bool cmp_filename(struct file_info *file_info, my_string name)
+static bool cmp_filename(struct file_info *file_info, char * name)
{
if (!file_info)
return 1;
diff --git a/storage/myisam/myisampack.c b/storage/myisam/myisampack.c
index fb631b5e63e..37428ddd279 100644
--- a/storage/myisam/myisampack.c
+++ b/storage/myisam/myisampack.c
@@ -69,8 +69,8 @@ typedef struct st_huff_counts {
my_off_t pre_space[8];
my_off_t tot_end_space,tot_pre_space,zero_fields,empty_fields,bytes_packed;
TREE int_tree; /* Tree for detecting distinct column values. */
- byte *tree_buff; /* Column values, 'field_length' each. */
- byte *tree_pos; /* Points to end of column values in 'tree_buff'. */
+ uchar *tree_buff; /* Column values, 'field_length' each. */
+ uchar *tree_pos; /* Points to end of column values in 'tree_buff'. */
} HUFF_COUNTS;
typedef struct st_huff_element HUFF_ELEMENT;
@@ -141,8 +141,8 @@ static int test_space_compress(HUFF_COUNTS *huff_counts,my_off_t records,
enum en_fieldtype field_type);
static HUFF_TREE* make_huff_trees(HUFF_COUNTS *huff_counts,uint trees);
static int make_huff_tree(HUFF_TREE *tree,HUFF_COUNTS *huff_counts);
-static int compare_huff_elements(void *not_used, byte *a,byte *b);
-static int save_counts_in_queue(byte *key,element_count count,
+static int compare_huff_elements(void *not_used, uchar *a,uchar *b);
+static int save_counts_in_queue(uchar *key,element_count count,
HUFF_TREE *tree);
static my_off_t calc_packed_length(HUFF_COUNTS *huff_counts,uint flag);
static uint join_same_trees(HUFF_COUNTS *huff_counts,uint trees);
@@ -171,7 +171,7 @@ static int save_state(MI_INFO *isam_file,PACK_MRG_INFO *mrg,my_off_t new_length,
static int save_state_mrg(File file,PACK_MRG_INFO *isam_file,my_off_t new_length,
ha_checksum crc);
static int mrg_close(PACK_MRG_INFO *mrg);
-static int mrg_rrnd(PACK_MRG_INFO *info,byte *buf);
+static int mrg_rrnd(PACK_MRG_INFO *info,uchar *buf);
static void mrg_reset(PACK_MRG_INFO *mrg);
#if !defined(DBUG_OFF)
static void fakebigcodes(HUFF_COUNTS *huff_counts, HUFF_COUNTS *end_count);
@@ -257,10 +257,10 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"backup", 'b', "Make a backup of the table as table_name.OLD.",
- (gptr*) &backup, (gptr*) &backup, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ (uchar**) &backup, (uchar**) &backup, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR_MP,
- "Directory where character sets are.", (gptr*) &charsets_dir,
- (gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Directory where character sets are.", (uchar**) &charsets_dir,
+ (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"force", 'f',
@@ -268,7 +268,7 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"join", 'j',
"Join all given tables into 'new_table_name'. All tables MUST have identical layouts.",
- (gptr*) &join_table, (gptr*) &join_table, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
+ (uchar**) &join_table, (uchar**) &join_table, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
0, 0, 0},
{"help", '?', "Display this help and exit.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -282,8 +282,8 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_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", 'w', "Wait and retry if table is in use.", (gptr*) &opt_wait,
- (gptr*) &opt_wait, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"wait", 'w', "Wait and retry if table is in use.", (uchar**) &opt_wait,
+ (uchar**) &opt_wait, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -478,7 +478,7 @@ static bool open_isam_files(PACK_MRG_INFO *mrg,char **names,uint count)
error:
while (i--)
mi_close(mrg->file[i]);
- my_free((gptr) mrg->file,MYF(0));
+ my_free((uchar*) mrg->file,MYF(0));
return 1;
}
@@ -513,14 +513,14 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table)
{
/* Make a new indexfile based on first file in list */
uint length;
- char *buff;
+ uchar *buff;
strmov(org_name,result_table); /* Fix error messages */
VOID(fn_format(new_name,result_table,"",MI_NAME_IEXT,2));
if ((join_isam_file=my_create(new_name,0,tmpfile_createflag,MYF(MY_WME)))
< 0)
goto err;
length=(uint) share->base.keystart;
- if (!(buff=my_malloc(length,MYF(MY_WME))))
+ if (!(buff= (uchar*) my_malloc(length,MYF(MY_WME))))
goto err;
if (my_pread(share->kfile,buff,length,0L,MYF(MY_WME | MY_NABP)) ||
my_write(join_isam_file,buff,length,
@@ -644,7 +644,7 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table)
new_length=file_buffer.pos_in_file;
if (!error && !test_only)
{
- char buff[MEMMAP_EXTRA_MARGIN]; /* End marginal for memmap */
+ uchar buff[MEMMAP_EXTRA_MARGIN]; /* End marginal for memmap */
bzero(buff,sizeof(buff));
error=my_write(file_buffer.file,buff,sizeof(buff),
MYF(MY_WME | MY_NABP | MY_WAIT_IF_FULL)) != 0;
@@ -811,11 +811,11 @@ static void free_counts_and_tree_and_queue(HUFF_TREE *huff_trees, uint trees,
for (i=0 ; i < trees ; i++)
{
if (huff_trees[i].element_buffer)
- my_free((gptr) huff_trees[i].element_buffer,MYF(0));
+ my_free((uchar*) huff_trees[i].element_buffer,MYF(0));
if (huff_trees[i].code)
- my_free((gptr) huff_trees[i].code,MYF(0));
+ my_free((uchar*) huff_trees[i].code,MYF(0));
}
- my_free((gptr) huff_trees,MYF(0));
+ my_free((uchar*) huff_trees,MYF(0));
}
if (huff_counts)
{
@@ -823,11 +823,11 @@ static void free_counts_and_tree_and_queue(HUFF_TREE *huff_trees, uint trees,
{
if (huff_counts[i].tree_buff)
{
- my_free((gptr) huff_counts[i].tree_buff,MYF(0));
+ my_free((uchar*) huff_counts[i].tree_buff,MYF(0));
delete_tree(&huff_counts[i].int_tree);
}
}
- my_free((gptr) huff_counts,MYF(0));
+ my_free((uchar*) huff_counts,MYF(0));
}
delete_queue(&queue); /* This is safe to free */
return;
@@ -840,7 +840,7 @@ static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts)
int error;
uint length;
ulong reclength,max_blob_length;
- byte *record,*pos,*next_pos,*end_pos,*start_pos;
+ uchar *record,*pos,*next_pos,*end_pos,*start_pos;
ha_rows record_count;
my_bool static_row_size;
HUFF_COUNTS *count,*end_count;
@@ -848,7 +848,7 @@ static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts)
DBUG_ENTER("get_statistic");
reclength=mrg->file[0]->s->base.reclength;
- record=(byte*) my_alloca(reclength);
+ record=(uchar*) my_alloca(reclength);
end_count=huff_counts+mrg->file[0]->s->base.fields;
record_count=0; glob_crc=0;
max_blob_length=0;
@@ -1032,7 +1032,7 @@ static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts)
{
uint i;
/* Zero fields are just counted. Go to the next record. */
- if (!memcmp((byte*) start_pos,zero_string,count->field_length))
+ if (!memcmp((uchar*) start_pos,zero_string,count->field_length))
{
count->zero_fields++;
continue;
@@ -1141,12 +1141,12 @@ static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts)
mrg->records=record_count;
mrg->max_blob_length=max_blob_length;
- my_afree((gptr) record);
+ my_afree((uchar*) record);
DBUG_RETURN(error != HA_ERR_END_OF_FILE);
}
static int compare_huff_elements(void *not_used __attribute__((unused)),
- byte *a, byte *b)
+ uchar *a, uchar *b)
{
return *((my_off_t*) a) < *((my_off_t*) b) ? -1 :
(*((my_off_t*) a) == *((my_off_t*) b) ? 0 : 1);
@@ -1162,7 +1162,7 @@ static void check_counts(HUFF_COUNTS *huff_counts, uint trees,
my_off_t old_length,new_length,length;
DBUG_ENTER("check_counts");
- bzero((gptr) field_count,sizeof(field_count));
+ bzero((uchar*) field_count,sizeof(field_count));
space_fields=fill_zero_fields=0;
for (; trees-- ; huff_counts++)
@@ -1328,12 +1328,12 @@ static void check_counts(HUFF_COUNTS *huff_counts, uint trees,
}
else
{
- my_free((gptr) huff_counts->tree_buff,MYF(0));
+ my_free((uchar*) huff_counts->tree_buff,MYF(0));
delete_tree(&huff_counts->int_tree);
huff_counts->tree_buff=0;
}
if (tree.element_buffer)
- my_free((gptr) tree.element_buffer,MYF(0));
+ my_free((uchar*) tree.element_buffer,MYF(0));
}
if (huff_counts->pack_type & PACK_TYPE_SPACE_FIELDS)
space_fields++;
@@ -1450,8 +1450,8 @@ static HUFF_TREE* make_huff_trees(HUFF_COUNTS *huff_counts, uint trees)
if (make_huff_tree(huff_tree+tree,huff_counts+tree))
{
while (tree--)
- my_free((gptr) huff_tree[tree].element_buffer,MYF(0));
- my_free((gptr) huff_tree,MYF(0));
+ my_free((uchar*) huff_tree[tree].element_buffer,MYF(0));
+ my_free((uchar*) huff_tree,MYF(0));
DBUG_RETURN(0);
}
}
@@ -1526,7 +1526,7 @@ static int make_huff_tree(HUFF_TREE *huff_tree, HUFF_COUNTS *huff_counts)
{
HUFF_ELEMENT *temp;
if (!(temp=
- (HUFF_ELEMENT*) my_realloc((gptr) huff_tree->element_buffer,
+ (HUFF_ELEMENT*) my_realloc((uchar*) huff_tree->element_buffer,
found*2*sizeof(HUFF_ELEMENT),
MYF(MY_WME))))
return 1;
@@ -1561,7 +1561,7 @@ static int make_huff_tree(HUFF_TREE *huff_tree, HUFF_COUNTS *huff_counts)
*/
tree_walk(&huff_counts->int_tree,
(int (*)(void*, element_count,void*)) save_counts_in_queue,
- (gptr) huff_tree, left_root_right);
+ (uchar*) huff_tree, left_root_right);
}
else
{
@@ -1587,7 +1587,7 @@ static int make_huff_tree(HUFF_TREE *huff_tree, HUFF_COUNTS *huff_counts)
new_huff_el->count=huff_counts->counts[i];
new_huff_el->a.leaf.null=0;
new_huff_el->a.leaf.element_nr=i;
- queue.root[found]=(byte*) new_huff_el;
+ queue.root[found]=(uchar*) new_huff_el;
}
}
/*
@@ -1604,7 +1604,7 @@ static int make_huff_tree(HUFF_TREE *huff_tree, HUFF_COUNTS *huff_counts)
new_huff_el->a.leaf.element_nr=huff_tree->min_chr=last-1;
else
new_huff_el->a.leaf.element_nr=huff_tree->max_chr=last+1;
- queue.root[found]=(byte*) new_huff_el;
+ queue.root[found]=(uchar*) new_huff_el;
}
}
@@ -1654,7 +1654,7 @@ static int make_huff_tree(HUFF_TREE *huff_tree, HUFF_COUNTS *huff_counts)
Replace the copied top element by the new element and re-order the
queue.
*/
- queue.root[1]=(byte*) new_huff_el;
+ queue.root[1]=(uchar*) new_huff_el;
queue_replaced(&queue);
}
huff_tree->root=(HUFF_ELEMENT*) queue.root[1];
@@ -1693,7 +1693,7 @@ static int compare_tree(void* cmp_arg __attribute__((unused)),
0
*/
-static int save_counts_in_queue(byte *key, element_count count,
+static int save_counts_in_queue(uchar *key, element_count count,
HUFF_TREE *tree)
{
HUFF_ELEMENT *new_huff_el;
@@ -1703,7 +1703,7 @@ static int save_counts_in_queue(byte *key, element_count count,
new_huff_el->a.leaf.null=0;
new_huff_el->a.leaf.element_nr= (uint) (key- tree->counts->tree_buff) /
tree->counts->field_length;
- queue.root[tree->elements]=(byte*) new_huff_el;
+ queue.root[tree->elements]=(uchar*) new_huff_el;
return 0;
}
@@ -1760,7 +1760,7 @@ static my_off_t calc_packed_length(HUFF_COUNTS *huff_counts,
first=i;
last=i;
/* We start with root[1], which is the queues top element. */
- queue.root[found]=(byte*) &huff_counts->counts[i];
+ queue.root[found]=(uchar*) &huff_counts->counts[i];
}
}
if (!found)
@@ -1771,7 +1771,7 @@ static my_off_t calc_packed_length(HUFF_COUNTS *huff_counts,
the loop, which follows the Huffman algorithm.
*/
if (found < 2)
- queue.root[++found]=(byte*) &huff_counts->counts[last ? 0 : 1];
+ queue.root[++found]=(uchar*) &huff_counts->counts[last ? 0 : 1];
/* Make a queue from the queue buffer. */
queue.elements=found;
@@ -1826,7 +1826,7 @@ static my_off_t calc_packed_length(HUFF_COUNTS *huff_counts,
queue. This successively replaces the references to counts by
references to HUFF_ELEMENTs.
*/
- queue.root[1]=(byte*) new_huff_el;
+ queue.root[1]=(uchar*) new_huff_el;
queue_replaced(&queue);
}
DBUG_RETURN(bytes_packed+(bits_packed+7)/8);
@@ -1859,12 +1859,12 @@ static uint join_same_trees(HUFF_COUNTS *huff_counts, uint trees)
i->tree->tree_pack_length+j->tree->tree_pack_length+
ALLOWED_JOIN_DIFF)
{
- memcpy_fixed((byte*) i->counts,(byte*) count.counts,
+ memcpy_fixed((uchar*) i->counts,(uchar*) count.counts,
sizeof(count.counts[0])*256);
- my_free((gptr) j->tree->element_buffer,MYF(0));
+ my_free((uchar*) j->tree->element_buffer,MYF(0));
j->tree->element_buffer=0;
j->tree=i->tree;
- bmove((byte*) i->counts,(byte*) count.counts,
+ bmove((uchar*) i->counts,(uchar*) count.counts,
sizeof(count.counts[0])*256);
if (make_huff_tree(i->tree,i))
return (uint) -1;
@@ -2007,7 +2007,7 @@ static char *hexdigits(ulonglong value)
static int write_header(PACK_MRG_INFO *mrg,uint head_length,uint trees,
my_off_t tot_elements,my_off_t filelength)
{
- byte *buff= (byte*) file_buffer.pos;
+ uchar *buff= (uchar*) file_buffer.pos;
bzero(buff,HEAD_LENGTH);
memcpy_fixed(buff,myisam_pack_file_magic,4);
@@ -2023,7 +2023,7 @@ static int write_header(PACK_MRG_INFO *mrg,uint head_length,uint trees,
if (test_only)
return 0;
VOID(my_seek(file_buffer.file,0L,MY_SEEK_SET,MYF(0)));
- return my_write(file_buffer.file,(const byte *) file_buffer.pos,HEAD_LENGTH,
+ return my_write(file_buffer.file,(const uchar *) file_buffer.pos,HEAD_LENGTH,
MYF(MY_WME | MY_NABP | MY_WAIT_IF_FULL)) != 0;
}
@@ -2159,7 +2159,7 @@ static my_off_t write_huff_tree(HUFF_TREE *huff_tree, uint trees)
{ /* This should be impossible */
VOID(fprintf(stderr, "Tree offset got too big: %d, aborted\n",
huff_tree->max_offset));
- my_afree((gptr) packed_tree);
+ my_afree((uchar*) packed_tree);
return 0;
}
@@ -2331,7 +2331,7 @@ static my_off_t write_huff_tree(HUFF_TREE *huff_tree, uint trees)
DBUG_PRINT("info", (" "));
if (verbose >= 2)
VOID(printf("\n"));
- my_afree((gptr) packed_tree);
+ my_afree((uchar*) packed_tree);
if (errors)
{
VOID(fprintf(stderr, "Error: Generated decode trees are corrupt. Stop.\n"));
@@ -2412,7 +2412,7 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
my_off_t record_count;
char llbuf[32];
ulong length,pack_length;
- byte *record,*pos,*end_pos,*record_pos,*start_pos;
+ uchar *record,*pos,*end_pos,*record_pos,*start_pos;
HUFF_COUNTS *count,*end_count;
HUFF_TREE *tree;
MI_INFO *isam_file=mrg->file[0];
@@ -2420,7 +2420,7 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
DBUG_ENTER("compress_isam_file");
/* Allocate a buffer for the records (excluding blobs). */
- if (!(record=(byte*) my_alloca(isam_file->s->base.reclength)))
+ if (!(record=(uchar*) my_alloca(isam_file->s->base.reclength)))
return -1;
end_count=huff_counts+isam_file->s->base.fields;
@@ -2471,7 +2471,7 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
{
if (flush_buffer((ulong) max_calc_length + (ulong) max_pack_length))
break;
- record_pos= (byte*) file_buffer.pos;
+ record_pos= (uchar*) file_buffer.pos;
file_buffer.pos+=max_pack_length;
for (start_pos=record, count= huff_counts; count < end_count ; count++)
{
@@ -2508,7 +2508,7 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
switch (count->field_type) {
case FIELD_SKIP_ZERO:
- if (!memcmp((byte*) start_pos,zero_string,field_length))
+ if (!memcmp((uchar*) start_pos,zero_string,field_length))
{
DBUG_PRINT("fields", ("FIELD_SKIP_ZERO zeroes only, bits: 1"));
write_bits(1,1);
@@ -2637,7 +2637,7 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
break;
case FIELD_INTERVALL:
global_count=count;
- pos=(byte*) tree_search(&count->int_tree, start_pos,
+ pos=(uchar*) tree_search(&count->int_tree, start_pos,
count->int_tree.custom_arg);
intervall=(uint) (pos - count->tree_buff)/field_length;
DBUG_PRINT("fields", ("FIELD_INTERVALL"));
@@ -2660,7 +2660,7 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
}
else
{
- byte *blob,*blob_end;
+ uchar *blob,*blob_end;
DBUG_PRINT("fields", ("FIELD_BLOB not empty, bits: 1"));
write_bits(0,1);
/* Write the blob length. */
@@ -2701,7 +2701,7 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
}
else
{
- byte *end= start_pos + var_pack_length + col_length;
+ uchar *end= start_pos + var_pack_length + col_length;
DBUG_PRINT("fields", ("FIELD_VARCHAR not empty, bits: 1"));
write_bits(0,1);
/* Write the varchar length. */
@@ -2733,7 +2733,7 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
DBUG_PRINT("fields", ("---"));
}
flush_bits();
- length=(ulong) ((byte*) file_buffer.pos - record_pos) - max_pack_length;
+ length=(ulong) ((uchar*) file_buffer.pos - record_pos) - max_pack_length;
pack_length= save_pack_length(pack_version, record_pos, length);
if (pack_blob_length)
pack_length+= save_pack_length(pack_version, record_pos + pack_length,
@@ -2773,7 +2773,7 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
if (verbose >= 2)
VOID(printf("wrote %s records.\n", llstr((longlong) record_count, llbuf)));
- my_afree((gptr) record);
+ my_afree((uchar*) record);
mrg->ref_length=max_pack_length;
mrg->min_pack_length=max_record_length ? min_record_length : 0;
mrg->max_pack_length=max_record_length;
@@ -2840,7 +2840,7 @@ static int flush_buffer(ulong neaded_length)
if (test_only)
return 0;
if (error_on_write|| my_write(file_buffer.file,
- (const byte*) file_buffer.buffer,
+ (const uchar*) file_buffer.buffer,
length,
MYF(MY_WME | MY_NABP | MY_WAIT_IF_FULL)))
{
@@ -2867,7 +2867,7 @@ static int flush_buffer(ulong neaded_length)
static void end_file_buffer(void)
{
- my_free((gptr) file_buffer.buffer,MYF(0));
+ my_free((uchar*) file_buffer.buffer,MYF(0));
}
/* output `bits` low bits of `value' */
@@ -3025,7 +3025,7 @@ static void mrg_reset(PACK_MRG_INFO *mrg)
}
}
-static int mrg_rrnd(PACK_MRG_INFO *info,byte *buf)
+static int mrg_rrnd(PACK_MRG_INFO *info,uchar *buf)
{
int error;
MI_INFO *isam_info;
@@ -3048,7 +3048,7 @@ static int mrg_rrnd(PACK_MRG_INFO *info,byte *buf)
for (;;)
{
isam_info->update&= HA_STATE_CHANGED;
- if (!(error=(*isam_info->s->read_rnd)(isam_info,(byte*) buf,
+ if (!(error=(*isam_info->s->read_rnd)(isam_info,(uchar*) buf,
filepos, 1)) ||
error != HA_ERR_END_OF_FILE)
return (error);
@@ -3071,7 +3071,7 @@ static int mrg_close(PACK_MRG_INFO *mrg)
for (i=0 ; i < mrg->count ; i++)
error|=mi_close(mrg->file[i]);
if (mrg->free_file)
- my_free((gptr) mrg->file,MYF(0));
+ my_free((uchar*) mrg->file,MYF(0));
return error;
}
@@ -3134,7 +3134,7 @@ static void fakebigcodes(HUFF_COUNTS *huff_counts, HUFF_COUNTS *end_count)
*/
if (huff_counts->tree_buff)
{
- my_free((gptr) huff_counts->tree_buff, MYF(0));
+ my_free((uchar*) huff_counts->tree_buff, MYF(0));
delete_tree(&huff_counts->int_tree);
huff_counts->tree_buff= NULL;
DBUG_PRINT("fakebigcodes", ("freed distinct column values"));
diff --git a/storage/myisam/rt_index.c b/storage/myisam/rt_index.c
index cf144839dd1..63ed60586d6 100644
--- a/storage/myisam/rt_index.c
+++ b/storage/myisam/rt_index.c
@@ -141,11 +141,11 @@ static int rtree_find_req(MI_INFO *info, MI_KEYDEF *keyinfo, uint search_flag,
res = 1;
ok:
- my_afree((byte*)page_buf);
+ my_afree((uchar*)page_buf);
return res;
err1:
- my_afree((byte*)page_buf);
+ my_afree((uchar*)page_buf);
info->lastpos = HA_OFFSET_ERROR;
return -1;
}
@@ -356,11 +356,11 @@ static int rtree_get_req(MI_INFO *info, MI_KEYDEF *keyinfo, uint key_length,
res = 1;
ok:
- my_afree((byte*)page_buf);
+ my_afree((uchar*)page_buf);
return res;
err1:
- my_afree((byte*)page_buf);
+ my_afree((uchar*)page_buf);
info->lastpos = HA_OFFSET_ERROR;
return -1;
}
@@ -602,11 +602,11 @@ static int rtree_insert_req(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key,
}
ok:
- my_afree((byte*)page_buf);
+ my_afree((uchar*)page_buf);
DBUG_RETURN(res);
err1:
- my_afree((byte*)page_buf);
+ my_afree((uchar*)page_buf);
DBUG_RETURN(-1); /* purecov: inspected */
}
@@ -690,10 +690,10 @@ static int rtree_insert_level(MI_INFO *info, uint keynr, uchar *key,
DBUG_PRINT("rtree", ("new root page: %lu level: %d nod_flag: %u",
(ulong) new_root, 0, mi_test_if_nod(new_root_buf)));
- my_afree((byte*)new_root_buf);
+ my_afree((uchar*)new_root_buf);
break;
err1:
- my_afree((byte*)new_root_buf);
+ my_afree((uchar*)new_root_buf);
DBUG_RETURN(-1); /* purecov: inspected */
}
default:
@@ -739,7 +739,7 @@ static int rtree_fill_reinsert_list(stPageList *ReinsertList, my_off_t page,
if (ReinsertList->n_pages == ReinsertList->m_pages)
{
ReinsertList->m_pages += REINSERT_BUFFER_INC;
- if (!(ReinsertList->pages = (stPageLevel*)my_realloc((gptr)ReinsertList->pages,
+ if (!(ReinsertList->pages = (stPageLevel*)my_realloc((uchar*)ReinsertList->pages,
ReinsertList->m_pages * sizeof(stPageLevel), MYF(MY_ALLOW_ZERO_PTR))))
goto err1;
}
@@ -891,11 +891,11 @@ static int rtree_delete_req(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key,
res = 1;
ok:
- my_afree((byte*)page_buf);
+ my_afree((uchar*)page_buf);
DBUG_RETURN(res);
err1:
- my_afree((byte*)page_buf);
+ my_afree((uchar*)page_buf);
DBUG_RETURN(-1); /* purecov: inspected */
}
@@ -968,7 +968,7 @@ int rtree_delete(MI_INFO *info, uint keynr, uchar *key, uint key_length)
if ((res= rtree_insert_level(info, keynr, k, key_length,
ReinsertList.pages[i].level)) == -1)
{
- my_afree((byte*)page_buf);
+ my_afree((uchar*)page_buf);
goto err1;
}
if (res)
@@ -984,13 +984,13 @@ int rtree_delete(MI_INFO *info, uint keynr, uchar *key, uint key_length)
}
}
}
- my_afree((byte*)page_buf);
+ my_afree((uchar*)page_buf);
if (_mi_dispose(info, keyinfo, ReinsertList.pages[i].offs,
DFLT_INIT_HITS))
goto err1;
}
if (ReinsertList.pages)
- my_free((byte*) ReinsertList.pages, MYF(0));
+ my_free((uchar*) ReinsertList.pages, MYF(0));
/* check for redundant root (not leaf, 1 child) and eliminate */
if ((old_root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR)
@@ -1117,11 +1117,11 @@ ha_rows rtree_estimate(MI_INFO *info, uint keynr, uchar *key,
res = HA_POS_ERROR;
}
- my_afree((byte*)page_buf);
+ my_afree((uchar*)page_buf);
return res;
err1:
- my_afree((byte*)page_buf);
+ my_afree((uchar*)page_buf);
return HA_POS_ERROR;
}
diff --git a/storage/myisam/rt_split.c b/storage/myisam/rt_split.c
index 0f6dc872958..ef988dbd048 100644
--- a/storage/myisam/rt_split.c
+++ b/storage/myisam/rt_split.c
@@ -345,10 +345,10 @@ int rtree_split_page(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key,
DFLT_INIT_HITS, new_page);
DBUG_PRINT("rtree", ("split new block: %lu", (ulong) *new_page_offs));
- my_afree((byte*)new_page);
+ my_afree((uchar*)new_page);
split_err:
- my_afree((byte*) coord_buf);
+ my_afree((uchar*) coord_buf);
DBUG_RETURN(err_code);
}
diff --git a/storage/myisam/rt_test.c b/storage/myisam/rt_test.c
index 55b52c0c3bf..7d15afd12ef 100644
--- a/storage/myisam/rt_test.c
+++ b/storage/myisam/rt_test.c
@@ -28,9 +28,9 @@
#define KEYALG HA_KEY_ALG_RTREE
static int read_with_pos(MI_INFO * file, int silent);
-static void create_record(char *record,uint rownr);
-static void create_record1(char *record,uint rownr);
-static void print_record(char * record,my_off_t offs,const char * tail);
+static void create_record(uchar *record,uint rownr);
+static void create_record1(uchar *record,uint rownr);
+static void print_record(uchar * record,my_off_t offs,const char * tail);
static int run_test(const char *filename);
static double rt_data[]=
@@ -108,8 +108,8 @@ static int run_test(const char *filename)
int i;
int error;
int row_count=0;
- char record[MAX_REC_LENGTH];
- char read_record[MAX_REC_LENGTH];
+ uchar record[MAX_REC_LENGTH];
+ uchar read_record[MAX_REC_LENGTH];
int upd= 10;
ha_rows hrows;
@@ -342,7 +342,7 @@ static int read_with_pos (MI_INFO * file,int silent)
{
int error;
int i;
- char read_record[MAX_REC_LENGTH];
+ uchar read_record[MAX_REC_LENGTH];
if (!silent)
printf("- Reading rows with position\n");
@@ -385,12 +385,12 @@ static void bprint_record(char * record,
#endif
-static void print_record(char * record,
+static void print_record(uchar * record,
my_off_t offs __attribute__((unused)),
const char * tail)
{
int i;
- char * pos;
+ uchar * pos;
double c;
printf(" rec=(%d)",(unsigned char)record[0]);
@@ -407,16 +407,16 @@ static void print_record(char * record,
-static void create_record1(char *record,uint rownr)
+static void create_record1(uchar *record,uint rownr)
{
int i;
- char * pos;
+ uchar * pos;
double c=rownr+10;
bzero((char*) record,MAX_REC_LENGTH);
record[0]=0x01; /* DEL marker */
- for ( pos=record+1, i=0; i<2*ndims; i++)
+ for (pos=record+1, i=0; i<2*ndims; i++)
{
memcpy(pos,&c,sizeof(c));
float8store(pos,c);
@@ -426,7 +426,7 @@ static void create_record1(char *record,uint rownr)
#ifdef NOT_USED
-static void create_record0(char *record,uint rownr)
+static void create_record0(uchar *record,uint rownr)
{
int i;
char * pos;
@@ -449,16 +449,16 @@ static void create_record0(char *record,uint rownr)
#endif
-static void create_record(char *record,uint rownr)
+static void create_record(uchar *record,uint rownr)
{
int i;
- char *pos;
+ uchar *pos;
double *data= rt_data+rownr*4;
record[0]=0x01; /* DEL marker */
- for ( pos=record+1, i=0; i<ndims*2; i++)
+ for (pos=record+1, i=0; i<ndims*2; i++)
{
- float8store(pos,data[i]);
- pos+=8;
+ float8store(pos,data[i]);
+ pos+=8;
}
}
diff --git a/storage/myisam/sort.c b/storage/myisam/sort.c
index 53eb6b2e310..2146a8d16cb 100644
--- a/storage/myisam/sort.c
+++ b/storage/myisam/sort.c
@@ -78,13 +78,13 @@ static int NEAR_F write_keys_varlen(MI_SORT_PARAM *info,uchar **sort_keys,
static uint NEAR_F read_to_buffer_varlen(IO_CACHE *fromfile,BUFFPEK *buffpek,
uint sort_length);
static int NEAR_F write_merge_key(MI_SORT_PARAM *info, IO_CACHE *to_file,
- char *key, uint sort_length, uint count);
+ uchar *key, uint sort_length, uint count);
static int NEAR_F write_merge_key_varlen(MI_SORT_PARAM *info,
IO_CACHE *to_file,
- char* key, uint sort_length,
+ uchar* key, uint sort_length,
uint count);
static inline int
-my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, byte *bufs);
+my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, uchar *bufs);
/*
Creates a index of sorted keys
@@ -116,7 +116,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
{
info->write_keys=write_keys_varlen;
info->read_to_buffer=read_to_buffer_varlen;
- info->write_key=write_merge_key_varlen;
+ info->write_key= write_merge_key_varlen;
}
else
{
@@ -138,9 +138,10 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
while (memavl >= MIN_SORT_MEMORY)
{
- if ((my_off_t) (records+1)*(sort_length+sizeof(char*)) <=
- (my_off_t) memavl)
- keys= records+1;
+ if ((records < UINT_MAX32) &&
+ ((my_off_t) (records + 1) *
+ (sort_length + sizeof(char*)) <= (my_off_t) memavl))
+ keys= (uint)records+1;
else
do
{
@@ -151,7 +152,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
keys < (uint) maxbuffer)
{
mi_check_print_error(info->sort_info->param,
- "sort_buffer_size is to small");
+ "myisam_sort_buffer_size is too small");
goto err;
}
}
@@ -163,7 +164,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
if (my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer,
maxbuffer/2))
{
- my_free((gptr) sort_keys,MYF(0));
+ my_free((uchar*) sort_keys,MYF(0));
sort_keys= 0;
}
else
@@ -175,7 +176,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
}
if (memavl < MIN_SORT_MEMORY)
{
- mi_check_print_error(info->sort_info->param,"Sort buffer to small"); /* purecov: tested */
+ mi_check_print_error(info->sort_info->param,"MyISAM sort buffer too small"); /* purecov: tested */
goto err; /* purecov: tested */
}
(*info->lock_in_memory)(info->sort_info->param);/* Everything is allocated */
@@ -230,9 +231,9 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
reinit_io_cache(&tempfile_for_exceptions,READ_CACHE,0L,0,0))
goto err;
- while (!my_b_read(&tempfile_for_exceptions,(byte*)&key_length,
+ while (!my_b_read(&tempfile_for_exceptions,(uchar*)&key_length,
sizeof(key_length))
- && !my_b_read(&tempfile_for_exceptions,(byte*)sort_keys,
+ && !my_b_read(&tempfile_for_exceptions,(uchar*)sort_keys,
(uint) key_length))
{
if (_mi_ck_write(idx,keyno,(uchar*) sort_keys,key_length-ref_length))
@@ -244,7 +245,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
err:
if (sort_keys)
- my_free((gptr) sort_keys,MYF(0));
+ my_free((uchar*) sort_keys,MYF(0));
delete_dynamic(&buffpek);
close_cached_file(&tempfile);
close_cached_file(&tempfile_for_exceptions);
@@ -348,7 +349,7 @@ pthread_handler_t thr_find_all_keys(void *arg)
sort_keys= (uchar **) NULL;
memavl= max(sort_param->sortbuff_size, MIN_SORT_MEMORY);
- idx= sort_param->sort_info->max_records;
+ idx= (uint)sort_param->sort_info->max_records;
sort_length= sort_param->key_length;
maxbuffer= 1;
@@ -369,7 +370,7 @@ pthread_handler_t thr_find_all_keys(void *arg)
keys < (uint) maxbuffer)
{
mi_check_print_error(sort_param->sort_info->param,
- "sort_buffer_size is to small");
+ "myisam_sort_buffer_size is too small");
goto err;
}
}
@@ -383,7 +384,7 @@ pthread_handler_t thr_find_all_keys(void *arg)
if (my_init_dynamic_array(&sort_param->buffpek, sizeof(BUFFPEK),
maxbuffer, maxbuffer/2))
{
- my_free((gptr) sort_keys,MYF(0));
+ my_free((uchar*) sort_keys,MYF(0));
sort_keys= (uchar **) NULL; /* for err: label */
}
else
@@ -397,7 +398,7 @@ pthread_handler_t thr_find_all_keys(void *arg)
if (memavl < MIN_SORT_MEMORY)
{
mi_check_print_error(sort_param->sort_info->param,
- "Sort buffer too small");
+ "MyISAM sort buffer too small");
goto err; /* purecov: tested */
}
@@ -453,7 +454,7 @@ err:
DBUG_PRINT("error", ("got some error"));
sort_param->sort_info->got_error= 1; /* no need to protect with a mutex */
if (sort_keys)
- my_free((gptr) sort_keys,MYF(0));
+ my_free((uchar*) sort_keys,MYF(0));
sort_param->sort_keys= 0;
delete_dynamic(& sort_param->buffpek);
close_cached_file(&sort_param->tempfile);
@@ -495,7 +496,7 @@ int thr_write_keys(MI_SORT_PARAM *sort_param)
MI_INFO *info=sort_info->info;
MYISAM_SHARE *share=info->s;
MI_SORT_PARAM *sinfo;
- byte *mergebuf=0;
+ uchar *mergebuf=0;
DBUG_ENTER("thr_write_keys");
LINT_INIT(length);
@@ -530,7 +531,7 @@ int thr_write_keys(MI_SORT_PARAM *sort_param)
sinfo->notnull: NULL,
(ulonglong) info->state->records);
}
- my_free((gptr) sinfo->sort_keys,MYF(0));
+ my_free((uchar*) sinfo->sort_keys,MYF(0));
my_free(mi_get_rec_buff_ptr(info, sinfo->rec_buff),
MYF(MY_ALLOW_ZERO_PTR));
sinfo->sort_keys=0;
@@ -621,12 +622,12 @@ int thr_write_keys(MI_SORT_PARAM *sort_param)
}
while (!got_error &&
- !my_b_read(&sinfo->tempfile_for_exceptions,(byte*)&key_length,
+ !my_b_read(&sinfo->tempfile_for_exceptions,(uchar*)&key_length,
sizeof(key_length)))
{
- byte ft_buf[HA_FT_MAXBYTELEN + HA_FT_WLEN + 10];
+ uchar ft_buf[HA_FT_MAXBYTELEN + HA_FT_WLEN + 10];
if (key_length > sizeof(ft_buf) ||
- my_b_read(&sinfo->tempfile_for_exceptions, (byte*)ft_buf,
+ my_b_read(&sinfo->tempfile_for_exceptions, (uchar*)ft_buf,
(uint)key_length) ||
_mi_ck_write(info, sinfo->key, (uchar*)ft_buf,
key_length - info->s->rec_reflength))
@@ -634,7 +635,7 @@ int thr_write_keys(MI_SORT_PARAM *sort_param)
}
}
}
- my_free((gptr) mergebuf,MYF(MY_ALLOW_ZERO_PTR));
+ my_free((uchar*) mergebuf,MYF(MY_ALLOW_ZERO_PTR));
DBUG_RETURN(got_error);
}
#endif /* THREAD */
@@ -648,7 +649,7 @@ static int NEAR_F write_keys(MI_SORT_PARAM *info, register uchar **sort_keys,
uint sort_length=info->key_length;
DBUG_ENTER("write_keys");
- qsort2((byte*) sort_keys,count,sizeof(byte*),(qsort2_cmp) info->key_cmp,
+ qsort2((uchar*) sort_keys,count,sizeof(uchar*),(qsort2_cmp) info->key_cmp,
info);
if (!my_b_inited(tempfile) &&
open_cached_file(tempfile, my_tmpdir(info->tmpdir), "ST",
@@ -660,7 +661,7 @@ static int NEAR_F write_keys(MI_SORT_PARAM *info, register uchar **sort_keys,
for (end=sort_keys+count ; sort_keys != end ; sort_keys++)
{
- if (my_b_write(tempfile,(byte*) *sort_keys,(uint) sort_length))
+ if (my_b_write(tempfile,(uchar*) *sort_keys,(uint) sort_length))
DBUG_RETURN(1); /* purecov: inspected */
}
DBUG_RETURN(0);
@@ -668,13 +669,13 @@ static int NEAR_F write_keys(MI_SORT_PARAM *info, register uchar **sort_keys,
static inline int
-my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, byte *bufs)
+my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, uchar *bufs)
{
int err;
uint16 len = _mi_keylength(info->keyinfo, (uchar*) bufs);
/* The following is safe as this is a local file */
- if ((err= my_b_write(to_file, (byte*)&len, sizeof(len))))
+ if ((err= my_b_write(to_file, (uchar*)&len, sizeof(len))))
return (err);
if ((err= my_b_write(to_file,bufs, (uint) len)))
return (err);
@@ -691,7 +692,7 @@ static int NEAR_F write_keys_varlen(MI_SORT_PARAM *info,
int err;
DBUG_ENTER("write_keys_varlen");
- qsort2((byte*) sort_keys,count,sizeof(byte*),(qsort2_cmp) info->key_cmp,
+ qsort2((uchar*) sort_keys,count,sizeof(uchar*),(qsort2_cmp) info->key_cmp,
info);
if (!my_b_inited(tempfile) &&
open_cached_file(tempfile, my_tmpdir(info->tmpdir), "ST",
@@ -702,7 +703,7 @@ static int NEAR_F write_keys_varlen(MI_SORT_PARAM *info,
buffpek->count=count;
for (end=sort_keys+count ; sort_keys != end ; sort_keys++)
{
- if ((err= my_var_write(info,tempfile, (byte*) *sort_keys)))
+ if ((err= my_var_write(info,tempfile, (uchar*) *sort_keys)))
DBUG_RETURN(err);
}
DBUG_RETURN(0);
@@ -720,8 +721,8 @@ static int NEAR_F write_key(MI_SORT_PARAM *info, uchar *key,
DISK_BUFFER_SIZE, info->sort_info->param->myf_rw))
DBUG_RETURN(1);
- if (my_b_write(tempfile,(byte*)&key_length,sizeof(key_length)) ||
- my_b_write(tempfile,(byte*)key,(uint) key_length))
+ if (my_b_write(tempfile,(uchar*)&key_length,sizeof(key_length)) ||
+ my_b_write(tempfile,(uchar*)key,(uint) key_length))
DBUG_RETURN(1);
DBUG_RETURN(0);
} /* write_key */
@@ -734,7 +735,7 @@ static int NEAR_F write_index(MI_SORT_PARAM *info, register uchar **sort_keys,
{
DBUG_ENTER("write_index");
- qsort2((gptr) sort_keys,(size_t) count,sizeof(byte*),
+ qsort2((uchar*) sort_keys,(size_t) count,sizeof(uchar*),
(qsort2_cmp) info->key_cmp,info);
while (count--)
{
@@ -773,7 +774,7 @@ static int NEAR_F merge_many_buff(MI_SORT_PARAM *info, uint keys,
{
if (merge_buffers(info,keys,from_file,to_file,sort_keys,lastbuff++,
buffpek+i,buffpek+i+MERGEBUFF-1))
- break; /* purecov: inspected */
+ goto cleanup;
}
if (merge_buffers(info,keys,from_file,to_file,sort_keys,lastbuff++,
buffpek+i,buffpek+ *maxbuffer))
@@ -783,6 +784,7 @@ static int NEAR_F merge_many_buff(MI_SORT_PARAM *info, uint keys,
temp=from_file; from_file=to_file; to_file=temp;
*maxbuffer= (int) (lastbuff-buffpek)-1;
}
+cleanup:
close_cached_file(to_file); /* This holds old result */
if (to_file == t_file)
*t_file=t_file2; /* Copy result file */
@@ -812,7 +814,7 @@ static uint NEAR_F read_to_buffer(IO_CACHE *fromfile, BUFFPEK *buffpek,
if ((count=(uint) min((ha_rows) buffpek->max_keys,buffpek->count)))
{
- if (my_pread(fromfile->file,(byte*) buffpek->base,
+ if (my_pread(fromfile->file,(uchar*) buffpek->base,
(length= sort_length*count),buffpek->file_pos,MYF_RW))
return((uint) -1); /* purecov: inspected */
buffpek->key=buffpek->base;
@@ -837,11 +839,11 @@ static uint NEAR_F read_to_buffer_varlen(IO_CACHE *fromfile, BUFFPEK *buffpek,
for (idx=1;idx<=count;idx++)
{
- if (my_pread(fromfile->file,(byte*)&length_of_key,sizeof(length_of_key),
+ if (my_pread(fromfile->file,(uchar*)&length_of_key,sizeof(length_of_key),
buffpek->file_pos,MYF_RW))
return((uint) -1);
buffpek->file_pos+=sizeof(length_of_key);
- if (my_pread(fromfile->file,(byte*) buffp,length_of_key,
+ if (my_pread(fromfile->file,(uchar*) buffp,length_of_key,
buffpek->file_pos,MYF_RW))
return((uint) -1);
buffpek->file_pos+=length_of_key;
@@ -856,16 +858,16 @@ static uint NEAR_F read_to_buffer_varlen(IO_CACHE *fromfile, BUFFPEK *buffpek,
static int NEAR_F write_merge_key_varlen(MI_SORT_PARAM *info,
- IO_CACHE *to_file,char* key,
+ IO_CACHE *to_file, uchar* key,
uint sort_length, uint count)
{
uint idx;
+ uchar *bufs = key;
- char *bufs = key;
for (idx=1;idx<=count;idx++)
{
int err;
- if ((err= my_var_write(info,to_file, (byte*) bufs)))
+ if ((err= my_var_write(info, to_file, bufs)))
return (err);
bufs=bufs+sort_length;
}
@@ -874,10 +876,10 @@ static int NEAR_F write_merge_key_varlen(MI_SORT_PARAM *info,
static int NEAR_F write_merge_key(MI_SORT_PARAM *info __attribute__((unused)),
- IO_CACHE *to_file, char* key,
+ IO_CACHE *to_file, uchar *key,
uint sort_length, uint count)
{
- return my_b_write(to_file,(byte*) key,(uint) sort_length*count);
+ return my_b_write(to_file, key, (size_t) sort_length*count);
}
/*
@@ -909,7 +911,7 @@ merge_buffers(MI_SORT_PARAM *info, uint keys, IO_CACHE *from_file,
sort_length=info->key_length;
if (init_queue(&queue,(uint) (Tb-Fb)+1,offsetof(BUFFPEK,key),0,
- (int (*)(void*, byte *,byte*)) info->key_cmp,
+ (int (*)(void*, uchar *,uchar*)) info->key_cmp,
(void*) info))
DBUG_RETURN(1); /* purecov: inspected */
@@ -922,7 +924,7 @@ merge_buffers(MI_SORT_PARAM *info, uint keys, IO_CACHE *from_file,
sort_length));
if (error == -1)
goto err; /* purecov: inspected */
- queue_insert(&queue,(char*) buffpek);
+ queue_insert(&queue,(uchar*) buffpek);
}
while (queue.elements > 1)
@@ -936,7 +938,7 @@ merge_buffers(MI_SORT_PARAM *info, uint keys, IO_CACHE *from_file,
buffpek=(BUFFPEK*) queue_top(&queue);
if (to_file)
{
- if (info->write_key(info,to_file,(byte*) buffpek->key,
+ if (info->write_key(info,to_file,(uchar*) buffpek->key,
(uint) sort_length,1))
{
error=1; goto err; /* purecov: inspected */
@@ -992,7 +994,7 @@ merge_buffers(MI_SORT_PARAM *info, uint keys, IO_CACHE *from_file,
{
if (to_file)
{
- if (info->write_key(info,to_file,(byte*) buffpek->key,
+ if (info->write_key(info,to_file,(uchar*) buffpek->key,
sort_length,buffpek->mem_count))
{
error=1; goto err; /* purecov: inspected */
@@ -1045,7 +1047,7 @@ flush_ft_buf(MI_SORT_PARAM *info)
if (info->sort_info->ft_buf)
{
err=sort_ft_buf_flush(info);
- my_free((gptr)info->sort_info->ft_buf, MYF(0));
+ my_free((uchar*)info->sort_info->ft_buf, MYF(0));
info->sort_info->ft_buf=0;
}
return err;
diff --git a/storage/myisam/sp_defs.h b/storage/myisam/sp_defs.h
index 11254d16c97..187ec62b2a3 100644
--- a/storage/myisam/sp_defs.h
+++ b/storage/myisam/sp_defs.h
@@ -40,7 +40,7 @@ enum wkbByteOrder
};
uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key,
- const byte *record, my_off_t filepos);
+ const uchar *record, my_off_t filepos);
#endif /*HAVE_SPATIAL*/
#endif /* _SP_DEFS_H */
diff --git a/storage/myisam/sp_key.c b/storage/myisam/sp_key.c
index 34c96a219c7..3748a38ff81 100644
--- a/storage/myisam/sp_key.c
+++ b/storage/myisam/sp_key.c
@@ -31,25 +31,20 @@ static int sp_get_geometry_mbr(uchar *(*wkb), uchar *end, uint n_dims,
double *mbr, int top);
static int sp_mbr_from_wkb(uchar (*wkb), uint size, uint n_dims, double *mbr);
-static void get_double(double *d, const byte *pos)
-{
- float8get(*d, pos);
-}
-
uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key,
- const byte *record, my_off_t filepos)
+ const uchar *record, my_off_t filepos)
{
HA_KEYSEG *keyseg;
MI_KEYDEF *keyinfo = &info->s->keyinfo[keynr];
uint len = 0;
- byte *pos;
+ uchar *pos;
uint dlen;
uchar *dptr;
double mbr[SPDIMS * 2];
uint i;
keyseg = &keyinfo->seg[-1];
- pos = (byte*)record + keyseg->start;
+ pos = (uchar*)record + keyseg->start;
dlen = _mi_calc_blob_length(keyseg->bit_start, pos);
memcpy_fixed(&dptr, pos + keyseg->bit_start, sizeof(char*));
@@ -62,48 +57,40 @@ uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key,
for (i = 0, keyseg = keyinfo->seg; keyseg->type; keyseg++, i++)
{
- uint length = keyseg->length;
+ uint length = keyseg->length, start= keyseg->start;
+ double val;
+
+ DBUG_ASSERT(length == sizeof(double));
+ DBUG_ASSERT(!(start % sizeof(double)));
+ DBUG_ASSERT(start < sizeof(mbr));
+ DBUG_ASSERT(keyseg->type == HA_KEYTYPE_DOUBLE);
- pos = ((byte*)mbr) + keyseg->start;
- if (keyseg->flag & HA_SWAP_KEY)
- {
+ val= mbr[start / sizeof (double)];
#ifdef HAVE_ISNAN
- if (keyseg->type == HA_KEYTYPE_FLOAT)
- {
- float nr;
- float4get(nr, pos);
- if (isnan(nr))
- {
- /* Replace NAN with zero */
- bzero(key, length);
- key+= length;
- continue;
- }
- }
- else if (keyseg->type == HA_KEYTYPE_DOUBLE)
- {
- double nr;
- get_double(&nr, pos);
- if (isnan(nr))
- {
- bzero(key, length);
- key+= length;
- continue;
- }
- }
+ if (isnan(val))
+ {
+ bzero(key, length);
+ key+= length;
+ len+= length;
+ continue;
+ }
#endif
- pos += length;
- while (length--)
- {
+
+ if (keyseg->flag & HA_SWAP_KEY)
+ {
+ uchar buf[sizeof(double)];
+
+ float8store(buf, val);
+ pos= &buf[length];
+ while (pos > buf)
*key++ = *--pos;
- }
}
else
{
- memcpy((byte*)key, pos, length);
- key += keyseg->length;
+ float8store((uchar *)key, val);
+ key += length;
}
- len += keyseg->length;
+ len+= length;
}
_mi_dpointer(info, key, filepos);
return len;
@@ -141,13 +128,13 @@ static int sp_add_point_to_mbr(uchar *(*wkb), uchar *end, uint n_dims,
{
if ((*wkb) > end - 8)
return -1;
- get_double(&ord, (const byte*) *wkb);
+ float8get(ord, (const uchar*) *wkb);
(*wkb)+= 8;
if (ord < *mbr)
- float8store((char*) mbr, ord);
+ *mbr= ord;
mbr++;
if (ord > *mbr)
- float8store((char*) mbr, ord);
+ *mbr= ord;
mbr++;
}
return 0;
diff --git a/storage/myisam/sp_test.c b/storage/myisam/sp_test.c
index 96ba05e8a74..dee32ba423e 100644
--- a/storage/myisam/sp_test.c
+++ b/storage/myisam/sp_test.c
@@ -24,11 +24,11 @@
#define MAX_REC_LENGTH 1024
#define KEYALG HA_KEY_ALG_RTREE
-static void create_linestring(char *record,uint rownr);
-static void print_record(char * record,my_off_t offs,const char * tail);
+static void create_linestring(uchar *record,uint rownr);
+static void print_record(uchar * record,my_off_t offs,const char * tail);
-static void create_key(char *key,uint rownr);
-static void print_key(const char *key,const char * tail);
+static void create_key(uchar *key,uint rownr);
+static void print_key(const uchar *key,const char * tail);
static int run_test(const char *filename);
static int read_with_pos(MI_INFO * file, int silent);
@@ -64,9 +64,9 @@ int run_test(const char *filename)
int i;
int error;
int row_count=0;
- char record[MAX_REC_LENGTH];
- char key[MAX_REC_LENGTH];
- char read_record[MAX_REC_LENGTH];
+ uchar record[MAX_REC_LENGTH];
+ uchar key[MAX_REC_LENGTH];
+ uchar read_record[MAX_REC_LENGTH];
int upd=10;
ha_rows hrows;
@@ -272,7 +272,7 @@ static int read_with_pos (MI_INFO * file,int silent)
{
int error;
int i;
- char read_record[MAX_REC_LENGTH];
+ uchar read_record[MAX_REC_LENGTH];
int rows=0;
if (!silent)
@@ -300,7 +300,7 @@ static int read_with_pos (MI_INFO * file,int silent)
#ifdef NOT_USED
-static void bprint_record(char * record,
+static void bprint_record(uchar * record,
my_off_t offs __attribute__((unused)),
const char * tail)
{
@@ -319,9 +319,9 @@ static void bprint_record(char * record,
#endif
-static void print_record(char * record, my_off_t offs,const char * tail)
+static void print_record(uchar * record, my_off_t offs,const char * tail)
{
- char *pos;
+ uchar *pos;
char *ptr;
uint len;
@@ -341,7 +341,7 @@ static void print_record(char * record, my_off_t offs,const char * tail)
#ifdef NOT_USED
-static void create_point(char *record,uint rownr)
+static void create_point(uchar *record,uint rownr)
{
uint tmp;
char *ptr;
@@ -368,11 +368,11 @@ static void create_point(char *record,uint rownr)
#endif
-static void create_linestring(char *record,uint rownr)
+static void create_linestring(uchar *record,uint rownr)
{
uint tmp;
char *ptr;
- char *pos=record;
+ uchar *pos= record;
double x[200];
int i,j;
int npoints=2;
@@ -396,21 +396,21 @@ static void create_linestring(char *record,uint rownr)
}
-static void create_key(char *key,uint rownr)
+static void create_key(uchar *key,uint rownr)
{
double c=rownr;
- char *pos;
+ uchar *pos;
uint i;
bzero(key,MAX_REC_LENGTH);
- for ( pos=key, i=0; i<2*SPDIMS; i++)
+ for (pos=key, i=0; i<2*SPDIMS; i++)
{
float8store(pos,c);
pos+=sizeof(c);
}
}
-static void print_key(const char *key,const char * tail)
+static void print_key(const uchar *key,const char * tail)
{
double c;
uint i;
diff --git a/storage/myisammrg/CMakeLists.txt b/storage/myisammrg/CMakeLists.txt
index 8c8c8bcf9fb..848f2dfea43 100644..100755
--- a/storage/myisammrg/CMakeLists.txt
+++ b/storage/myisammrg/CMakeLists.txt
@@ -20,9 +20,14 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib
${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/extra/yassl/include)
-ADD_LIBRARY(myisammrg myrg_close.c myrg_create.c myrg_delete.c myrg_extra.c myrg_info.c
+
+SET(MYISAMMRG_SOURCES myrg_close.c myrg_create.c myrg_delete.c myrg_extra.c myrg_info.c
ha_myisammrg.cc
myrg_locking.c myrg_open.c myrg_panic.c myrg_queue.c myrg_range.c
myrg_rfirst.c myrg_rkey.c myrg_rlast.c myrg_rnext.c myrg_rnext_same.c
myrg_rprev.c myrg_rrnd.c myrg_rsame.c myrg_static.c myrg_update.c
myrg_write.c)
+
+IF(NOT SOURCE_SUBLIBS)
+ ADD_LIBRARY(myisammrg ${MYISAMMRG_SOURCES})
+ENDIF(NOT SOURCE_SUBLIBS)
diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc
index 96f7db6e633..8a914e8a2de 100644
--- a/storage/myisammrg/ha_myisammrg.cc
+++ b/storage/myisammrg/ha_myisammrg.cc
@@ -52,6 +52,24 @@ extern int check_definition(MI_KEYDEF *t1_keyinfo, MI_COLUMNDEF *t1_recinfo,
uint t1_keys, uint t1_recs,
MI_KEYDEF *t2_keyinfo, MI_COLUMNDEF *t2_recinfo,
uint t2_keys, uint t2_recs, bool strict);
+static void split_file_name(const char *file_name,
+ LEX_STRING *db, LEX_STRING *name);
+
+
+extern "C" void myrg_print_wrong_table(const char *table_name)
+{
+ LEX_STRING db, name;
+ char buf[FN_REFLEN];
+ split_file_name(table_name, &db, &name);
+ memcpy(buf, db.str, db.length);
+ 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,
+ ER_ADMIN_WRONG_MRG_TABLE, ER(ER_ADMIN_WRONG_MRG_TABLE),
+ buf);
+}
+
const char **ha_myisammrg::bas_ext() const
{
@@ -102,6 +120,8 @@ int ha_myisammrg::open(const char *name, int mode, uint test_if_locked)
{
DBUG_PRINT("error",("reclength: %lu mean_rec_length: %lu",
table->s->reclength, stats.mean_rec_length));
+ if (test_if_locked & HA_OPEN_FOR_REPAIR)
+ myrg_print_wrong_table(file->open_tables->table->filename);
error= HA_ERR_WRONG_MRG_TABLE_DEF;
goto err;
}
@@ -120,12 +140,19 @@ int ha_myisammrg::open(const char *name, int mode, uint test_if_locked)
u_table->table->s->base.keys,
u_table->table->s->base.fields, false))
{
- my_free((gptr) recinfo, MYF(0));
error= HA_ERR_WRONG_MRG_TABLE_DEF;
- goto err;
+ if (test_if_locked & HA_OPEN_FOR_REPAIR)
+ myrg_print_wrong_table(u_table->table->filename);
+ else
+ {
+ my_free((uchar*) recinfo, MYF(0));
+ goto err;
+ }
}
}
- my_free((gptr) recinfo, MYF(0));
+ my_free((uchar*) recinfo, MYF(0));
+ if (error == HA_ERR_WRONG_MRG_TABLE_DEF)
+ goto err;
#if !defined(BIG_TABLES) || SIZEOF_OFF_T == 4
/* Merge table has more than 2G rows */
if (table->s->crashed)
@@ -146,9 +173,9 @@ int ha_myisammrg::close(void)
return myrg_close(file);
}
-int ha_myisammrg::write_row(byte * buf)
+int ha_myisammrg::write_row(uchar * buf)
{
- statistic_increment(table->in_use->status_var.ha_write_count,&LOCK_status);
+ ha_statistic_increment(&SSV::ha_write_count);
if (file->merge_insert_method == MERGE_INSERT_DISABLED || !file->tables)
return (HA_ERR_TABLE_READONLY);
@@ -164,95 +191,87 @@ int ha_myisammrg::write_row(byte * buf)
return myrg_write(file,buf);
}
-int ha_myisammrg::update_row(const byte * old_data, byte * new_data)
+int ha_myisammrg::update_row(const uchar * old_data, uchar * new_data)
{
- statistic_increment(table->in_use->status_var.ha_update_count,&LOCK_status);
+ ha_statistic_increment(&SSV::ha_update_count);
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
table->timestamp_field->set_time();
return myrg_update(file,old_data,new_data);
}
-int ha_myisammrg::delete_row(const byte * buf)
+int ha_myisammrg::delete_row(const uchar * buf)
{
- statistic_increment(table->in_use->status_var.ha_delete_count,&LOCK_status);
+ ha_statistic_increment(&SSV::ha_delete_count);
return myrg_delete(file,buf);
}
-int ha_myisammrg::index_read(byte * buf, const byte * key,
- key_part_map keypart_map,
- enum ha_rkey_function find_flag)
+int ha_myisammrg::index_read_map(uchar * buf, const uchar * key,
+ key_part_map keypart_map,
+ enum ha_rkey_function find_flag)
{
- statistic_increment(table->in_use->status_var.ha_read_key_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_key_count);
int error=myrg_rkey(file,buf,active_index, key, keypart_map, find_flag);
table->status=error ? STATUS_NOT_FOUND: 0;
return error;
}
-int ha_myisammrg::index_read_idx(byte * buf, uint index, const byte * key,
- key_part_map keypart_map,
- enum ha_rkey_function find_flag)
+int ha_myisammrg::index_read_idx_map(uchar * buf, uint index, const uchar * key,
+ key_part_map keypart_map,
+ enum ha_rkey_function find_flag)
{
- statistic_increment(table->in_use->status_var.ha_read_key_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_key_count);
int error=myrg_rkey(file,buf,index, key, keypart_map, find_flag);
table->status=error ? STATUS_NOT_FOUND: 0;
return error;
}
-int ha_myisammrg::index_read_last(byte * buf, const byte * key,
- key_part_map keypart_map)
+int ha_myisammrg::index_read_last_map(uchar *buf, const uchar *key,
+ key_part_map keypart_map)
{
- statistic_increment(table->in_use->status_var.ha_read_key_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_key_count);
int error=myrg_rkey(file,buf,active_index, key, keypart_map,
HA_READ_PREFIX_LAST);
table->status=error ? STATUS_NOT_FOUND: 0;
return error;
}
-int ha_myisammrg::index_next(byte * buf)
+int ha_myisammrg::index_next(uchar * buf)
{
- statistic_increment(table->in_use->status_var.ha_read_next_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_next_count);
int error=myrg_rnext(file,buf,active_index);
table->status=error ? STATUS_NOT_FOUND: 0;
return error;
}
-int ha_myisammrg::index_prev(byte * buf)
+int ha_myisammrg::index_prev(uchar * buf)
{
- statistic_increment(table->in_use->status_var.ha_read_prev_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_prev_count);
int error=myrg_rprev(file,buf, active_index);
table->status=error ? STATUS_NOT_FOUND: 0;
return error;
}
-int ha_myisammrg::index_first(byte * buf)
+int ha_myisammrg::index_first(uchar * buf)
{
- statistic_increment(table->in_use->status_var.ha_read_first_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_first_count);
int error=myrg_rfirst(file, buf, active_index);
table->status=error ? STATUS_NOT_FOUND: 0;
return error;
}
-int ha_myisammrg::index_last(byte * buf)
+int ha_myisammrg::index_last(uchar * buf)
{
- statistic_increment(table->in_use->status_var.ha_read_last_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_last_count);
int error=myrg_rlast(file, buf, active_index);
table->status=error ? STATUS_NOT_FOUND: 0;
return error;
}
-int ha_myisammrg::index_next_same(byte * buf,
- const byte *key __attribute__((unused)),
+int ha_myisammrg::index_next_same(uchar * buf,
+ const uchar *key __attribute__((unused)),
uint length __attribute__((unused)))
{
- statistic_increment(table->in_use->status_var.ha_read_next_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_next_count);
int error=myrg_rnext_same(file,buf);
table->status=error ? STATUS_NOT_FOUND: 0;
return error;
@@ -265,26 +284,24 @@ int ha_myisammrg::rnd_init(bool scan)
}
-int ha_myisammrg::rnd_next(byte *buf)
+int ha_myisammrg::rnd_next(uchar *buf)
{
- statistic_increment(table->in_use->status_var.ha_read_rnd_next_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_rnd_next_count);
int error=myrg_rrnd(file, buf, HA_OFFSET_ERROR);
table->status=error ? STATUS_NOT_FOUND: 0;
return error;
}
-int ha_myisammrg::rnd_pos(byte * buf, byte *pos)
+int ha_myisammrg::rnd_pos(uchar * buf, uchar *pos)
{
- statistic_increment(table->in_use->status_var.ha_read_rnd_count,
- &LOCK_status);
+ ha_statistic_increment(&SSV::ha_read_rnd_count);
int error=myrg_rrnd(file, buf, my_get_ptr(pos,ref_length));
table->status=error ? STATUS_NOT_FOUND: 0;
return error;
}
-void ha_myisammrg::position(const byte *record)
+void ha_myisammrg::position(const uchar *record)
{
ulonglong row_position= myrg_position(file);
my_store_ptr(ref, ref_length, (my_off_t) row_position);
@@ -474,8 +491,8 @@ void ha_myisammrg::update_create_info(HA_CREATE_INFO *create_info)
goto err;
create_info->merge_list.elements++;
- (*create_info->merge_list.next) = (byte*) ptr;
- create_info->merge_list.next= (byte**) &ptr->next_local;
+ (*create_info->merge_list.next) = (uchar*) ptr;
+ create_info->merge_list.next= (uchar**) &ptr->next_local;
}
*create_info->merge_list.next=0;
}
@@ -603,6 +620,13 @@ bool ha_myisammrg::check_if_incompatible_data(HA_CREATE_INFO *info,
return COMPATIBLE_DATA_NO;
}
+
+int ha_myisammrg::check(THD* thd, HA_CHECK_OPT* check_opt)
+{
+ return HA_ADMIN_OK;
+}
+
+
extern int myrg_panic(enum ha_panic_function flag);
int myisammrg_panic(handlerton *hton, ha_panic_function flag)
{
@@ -615,7 +639,6 @@ static int myisammrg_init(void *p)
myisammrg_hton= (handlerton *)p;
- myisammrg_hton->state= SHOW_OPTION_YES;
myisammrg_hton->db_type= DB_TYPE_MRG_MYISAM;
myisammrg_hton->create= myisammrg_create_handler;
myisammrg_hton->panic= myisammrg_panic;
diff --git a/storage/myisammrg/ha_myisammrg.h b/storage/myisammrg/ha_myisammrg.h
index 7bbe659d4b7..91aabe277f7 100644
--- a/storage/myisammrg/ha_myisammrg.h
+++ b/storage/myisammrg/ha_myisammrg.h
@@ -35,6 +35,7 @@ class ha_myisammrg: public handler
ulonglong table_flags() const
{
return (HA_REC_NOT_IN_SEQ | HA_AUTO_PART_KEY | HA_NO_TRANSACTIONS |
+ HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE |
HA_NULL_IN_KEY | HA_CAN_INDEX_BLOBS | HA_FILE_BASED |
HA_ANY_INDEX_MAY_BE_UNIQUE | HA_CAN_BIT_FIELD |
HA_NO_COPY_ON_ALTER);
@@ -53,23 +54,24 @@ class ha_myisammrg: public handler
int open(const char *name, int mode, uint test_if_locked);
int close(void);
- int write_row(byte * buf);
- int update_row(const byte * old_data, byte * new_data);
- int delete_row(const byte * buf);
- int index_read(byte * buf, const byte * key, key_part_map keypart_map,
- enum ha_rkey_function find_flag);
- int index_read_idx(byte * buf, uint index, const byte * key,
- key_part_map keypart_map, enum ha_rkey_function find_flag);
- int index_read_last(byte * buf, const byte * key, key_part_map keypart_map);
- int index_next(byte * buf);
- int index_prev(byte * buf);
- int index_first(byte * buf);
- int index_last(byte * buf);
- int index_next_same(byte *buf, const byte *key, uint keylen);
+ int write_row(uchar * buf);
+ int update_row(const uchar * old_data, uchar * new_data);
+ int delete_row(const uchar * buf);
+ int index_read_map(uchar *buf, const uchar *key, key_part_map keypart_map,
+ enum ha_rkey_function find_flag);
+ int index_read_idx_map(uchar *buf, uint index, const uchar *key,
+ key_part_map keypart_map,
+ enum ha_rkey_function find_flag);
+ int index_read_last_map(uchar *buf, const uchar *key, key_part_map keypart_map);
+ int index_next(uchar * buf);
+ int index_prev(uchar * buf);
+ int index_first(uchar * buf);
+ int index_last(uchar * buf);
+ int index_next_same(uchar *buf, const uchar *key, uint keylen);
int rnd_init(bool scan);
- int rnd_next(byte *buf);
- int rnd_pos(byte * buf, byte *pos);
- void position(const byte *record);
+ int rnd_next(uchar *buf);
+ int rnd_pos(uchar * buf, uchar *pos);
+ void position(const uchar *record);
ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key);
int info(uint);
int reset(void);
@@ -84,4 +86,5 @@ class ha_myisammrg: public handler
void append_create_info(String *packet);
MYRG_INFO *myrg_info() { return file; }
bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes);
+ int check(THD* thd, HA_CHECK_OPT* check_opt);
};
diff --git a/storage/myisammrg/myrg_close.c b/storage/myisammrg/myrg_close.c
index 971a83928b1..baae24634b3 100644
--- a/storage/myisammrg/myrg_close.c
+++ b/storage/myisammrg/myrg_close.c
@@ -30,7 +30,7 @@ int myrg_close(MYRG_INFO *info)
pthread_mutex_lock(&THR_LOCK_open);
myrg_open_list=list_delete(myrg_open_list,&info->open_list);
pthread_mutex_unlock(&THR_LOCK_open);
- my_free((gptr) info,MYF(0));
+ my_free((uchar*) info,MYF(0));
if (error)
{
DBUG_RETURN(my_errno=error);
diff --git a/storage/myisammrg/myrg_create.c b/storage/myisammrg/myrg_create.c
index c4e91e7b29b..df81b730bfd 100644
--- a/storage/myisammrg/myrg_create.c
+++ b/storage/myisammrg/myrg_create.c
@@ -46,7 +46,7 @@ int myrg_create(const char *name, const char **table_names,
fn_same(buff,name,4);
*(end=strend(buff))='\n';
end[1]=0;
- if (my_write(file,buff,(uint) (end-buff+1),
+ if (my_write(file,(char*) buff,(uint) (end-buff+1),
MYF(MY_WME | MY_NABP)))
goto err;
}
@@ -55,7 +55,7 @@ int myrg_create(const char *name, const char **table_names,
{
end=strxmov(buff,"#INSERT_METHOD=",
get_type(&merge_insert_method,insert_method-1),"\n",NullS);
- if (my_write(file,buff,(uint) (end-buff),MYF(MY_WME | MY_NABP)))
+ if (my_write(file, (uchar*) buff,(uint) (end-buff),MYF(MY_WME | MY_NABP)))
goto err;
}
if (my_close(file,MYF(0)))
diff --git a/storage/myisammrg/myrg_def.h b/storage/myisammrg/myrg_def.h
index 344bd4edd3c..9c69da1424d 100644
--- a/storage/myisammrg/myrg_def.h
+++ b/storage/myisammrg/myrg_def.h
@@ -28,5 +28,8 @@ extern pthread_mutex_t THR_LOCK_open;
#endif
int _myrg_init_queue(MYRG_INFO *info,int inx,enum ha_rkey_function search_flag);
-int _myrg_mi_read_record(MI_INFO *info, byte *buf);
-
+int _myrg_mi_read_record(MI_INFO *info, uchar *buf);
+#ifdef __cplusplus
+extern "C"
+#endif
+void myrg_print_wrong_table(const char *table_name);
diff --git a/storage/myisammrg/myrg_delete.c b/storage/myisammrg/myrg_delete.c
index f9604f66885..93d45198b36 100644
--- a/storage/myisammrg/myrg_delete.c
+++ b/storage/myisammrg/myrg_delete.c
@@ -17,7 +17,7 @@
#include "myrg_def.h"
-int myrg_delete(MYRG_INFO *info, const byte *record)
+int myrg_delete(MYRG_INFO *info, const uchar *record)
{
if (!info->current_table)
return (my_errno= HA_ERR_NO_ACTIVE_RECORD);
diff --git a/storage/myisammrg/myrg_locking.c b/storage/myisammrg/myrg_locking.c
index a07833bc829..4f1e3f844a1 100644
--- a/storage/myisammrg/myrg_locking.c
+++ b/storage/myisammrg/myrg_locking.c
@@ -37,7 +37,15 @@ int myrg_lock_database(MYRG_INFO *info, int lock_type)
(file->table)->owned_by_merge = TRUE;
#endif
if ((new_error=mi_lock_database(file->table,lock_type)))
+ {
error=new_error;
+ if (lock_type != F_UNLCK)
+ {
+ while (--file >= info->open_tables)
+ mi_lock_database(file->table, F_UNLCK);
+ break;
+ }
+ }
}
return(error);
}
diff --git a/storage/myisammrg/myrg_open.c b/storage/myisammrg/myrg_open.c
index 3dbb605463e..500d3a29327 100644
--- a/storage/myisammrg/myrg_open.c
+++ b/storage/myisammrg/myrg_open.c
@@ -40,6 +40,7 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
IO_CACHE file;
MI_INFO *isam=0;
uint found_merge_insert_method= 0;
+ size_t name_buff_length;
DBUG_ENTER("myrg_open");
LINT_INIT(key_parts);
@@ -48,13 +49,13 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
if ((fd=my_open(fn_format(name_buff,name,"",MYRG_NAME_EXT,
MY_UNPACK_FILENAME|MY_APPEND_EXT),
O_RDONLY | O_SHARE,MYF(0))) < 0)
- goto err;
- errpos=1;
- if (init_io_cache(&file, fd, 4*IO_SIZE, READ_CACHE, 0, 0,
+ goto err;
+ errpos=1;
+ if (init_io_cache(&file, fd, 4*IO_SIZE, READ_CACHE, 0, 0,
MYF(MY_WME | MY_NABP)))
- goto err;
- errpos=2;
- dir_length=dirname_part(name_buff,name);
+ goto err;
+ errpos=2;
+ dir_length=dirname_part(name_buff, name, &name_buff_length);
while ((length=my_b_gets(&file,buff,FN_REFLEN-1)))
{
if ((end=buff+length)[-1] == '\n')
@@ -91,6 +92,11 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
if (!(isam=mi_open(buff,mode,(handle_locking?HA_OPEN_WAIT_IF_LOCKED:0))))
{
my_errno= HA_ERR_WRONG_MRG_TABLE_DEF;
+ if (handle_locking & HA_OPEN_FOR_REPAIR)
+ {
+ myrg_print_wrong_table(buff);
+ continue;
+ }
goto err;
}
if (!m_info) /* First file */
@@ -119,6 +125,11 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
if (m_info->reclength != isam->s->base.reclength)
{
my_errno=HA_ERR_WRONG_MRG_TABLE_DEF;
+ if (handle_locking & HA_OPEN_FOR_REPAIR)
+ {
+ myrg_print_wrong_table(buff);
+ continue;
+ }
goto err;
}
m_info->options|= isam->s->options;
@@ -132,6 +143,8 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
m_info->tables);
}
+ if (my_errno == HA_ERR_WRONG_MRG_TABLE_DEF)
+ goto err;
if (!m_info && !(m_info= (MYRG_INFO*) my_malloc(sizeof(MYRG_INFO),
MYF(MY_WME | MY_ZEROFILL))))
goto err;
diff --git a/storage/myisammrg/myrg_queue.c b/storage/myisammrg/myrg_queue.c
index 1d252207db1..d2579053784 100644
--- a/storage/myisammrg/myrg_queue.c
+++ b/storage/myisammrg/myrg_queue.c
@@ -15,7 +15,7 @@
#include "myrg_def.h"
-static int queue_key_cmp(void *keyseg, byte *a, byte *b)
+static int queue_key_cmp(void *keyseg, uchar *a, uchar *b)
{
MYRG_TABLE *ma= (MYRG_TABLE *)a;
MYRG_TABLE *mb= (MYRG_TABLE *)b;
@@ -69,7 +69,7 @@ int _myrg_init_queue(MYRG_INFO *info,int inx,enum ha_rkey_function search_flag)
return error;
}
-int _myrg_mi_read_record(MI_INFO *info, byte *buf)
+int _myrg_mi_read_record(MI_INFO *info, uchar *buf)
{
if (!(*info->read_record)(info,info->lastpos,buf))
{
diff --git a/storage/myisammrg/myrg_rfirst.c b/storage/myisammrg/myrg_rfirst.c
index 80736537d02..9d7b0f9e83f 100644
--- a/storage/myisammrg/myrg_rfirst.c
+++ b/storage/myisammrg/myrg_rfirst.c
@@ -17,7 +17,7 @@
/* Read first row according to specific key */
-int myrg_rfirst(MYRG_INFO *info, byte *buf, int inx)
+int myrg_rfirst(MYRG_INFO *info, uchar *buf, int inx)
{
MYRG_TABLE *table;
MI_INFO *mi;
@@ -35,7 +35,7 @@ int myrg_rfirst(MYRG_INFO *info, byte *buf, int inx)
return err;
}
/* adding to queue */
- queue_insert(&(info->by_key),(byte *)table);
+ queue_insert(&(info->by_key),(uchar *)table);
}
/* We have done a read in all tables */
info->last_used_table=table;
diff --git a/storage/myisammrg/myrg_rkey.c b/storage/myisammrg/myrg_rkey.c
index 2d744ae31ec..8e7886f5a43 100644
--- a/storage/myisammrg/myrg_rkey.c
+++ b/storage/myisammrg/myrg_rkey.c
@@ -35,10 +35,10 @@
SerG
*/
-int myrg_rkey(MYRG_INFO *info,byte *buf,int inx, const byte *key,
+int myrg_rkey(MYRG_INFO *info,uchar *buf,int inx, const uchar *key,
key_part_map keypart_map, enum ha_rkey_function search_flag)
{
- byte *key_buff;
+ uchar *key_buff;
uint pack_key_length;
uint16 last_used_keyseg;
MYRG_TABLE *table;
@@ -60,7 +60,7 @@ int myrg_rkey(MYRG_INFO *info,byte *buf,int inx, const byte *key,
{
err=mi_rkey(mi, 0, inx, key, keypart_map, search_flag);
/* Get the saved packed key and packed key length. */
- key_buff=(byte*) mi->lastkey+mi->s->base.max_key_length;
+ key_buff=(uchar*) mi->lastkey+mi->s->base.max_key_length;
pack_key_length=mi->pack_key_length;
last_used_keyseg= mi->last_used_keyseg;
}
@@ -80,7 +80,7 @@ int myrg_rkey(MYRG_INFO *info,byte *buf,int inx, const byte *key,
DBUG_RETURN(err);
}
/* adding to queue */
- queue_insert(&(info->by_key),(byte *)table);
+ queue_insert(&(info->by_key),(uchar *)table);
}
@@ -92,6 +92,6 @@ int myrg_rkey(MYRG_INFO *info,byte *buf,int inx, const byte *key,
mi->once_flags|= RRND_PRESERVE_LASTINX;
DBUG_PRINT("info", ("using table no: %d",
(int) (info->current_table - info->open_tables + 1)));
- DBUG_DUMP("result key", (byte*) mi->lastkey, mi->lastkey_length);
+ DBUG_DUMP("result key", (uchar*) mi->lastkey, mi->lastkey_length);
DBUG_RETURN(_myrg_mi_read_record(mi,buf));
}
diff --git a/storage/myisammrg/myrg_rlast.c b/storage/myisammrg/myrg_rlast.c
index f364bf9b32f..8086a2f8104 100644
--- a/storage/myisammrg/myrg_rlast.c
+++ b/storage/myisammrg/myrg_rlast.c
@@ -17,7 +17,7 @@
/* Read last row with the same key as the previous read. */
-int myrg_rlast(MYRG_INFO *info, byte *buf, int inx)
+int myrg_rlast(MYRG_INFO *info, uchar *buf, int inx)
{
MYRG_TABLE *table;
MI_INFO *mi;
@@ -35,7 +35,7 @@ int myrg_rlast(MYRG_INFO *info, byte *buf, int inx)
return err;
}
/* adding to queue */
- queue_insert(&(info->by_key),(byte *)table);
+ queue_insert(&(info->by_key),(uchar *)table);
}
/* We have done a read in all tables */
info->last_used_table=table;
diff --git a/storage/myisammrg/myrg_rnext.c b/storage/myisammrg/myrg_rnext.c
index de1aa4df4b6..82d5cbf38b1 100644
--- a/storage/myisammrg/myrg_rnext.c
+++ b/storage/myisammrg/myrg_rnext.c
@@ -19,7 +19,7 @@
Read next row with the same key as previous read
*/
-int myrg_rnext(MYRG_INFO *info, byte *buf, int inx)
+int myrg_rnext(MYRG_INFO *info, uchar *buf, int inx)
{
int err;
MI_INFO *mi;
@@ -42,7 +42,7 @@ int myrg_rnext(MYRG_INFO *info, byte *buf, int inx)
else
{
/* Found here, adding to queue */
- queue_top(&(info->by_key))=(byte *)(info->current_table);
+ queue_top(&(info->by_key))=(uchar *)(info->current_table);
queue_replaced(&(info->by_key));
}
diff --git a/storage/myisammrg/myrg_rnext_same.c b/storage/myisammrg/myrg_rnext_same.c
index 9c6b522ee8a..ad7bbfb0f6e 100644
--- a/storage/myisammrg/myrg_rnext_same.c
+++ b/storage/myisammrg/myrg_rnext_same.c
@@ -16,7 +16,7 @@
#include "myrg_def.h"
-int myrg_rnext_same(MYRG_INFO *info, byte *buf)
+int myrg_rnext_same(MYRG_INFO *info, uchar *buf)
{
int err;
MI_INFO *mi;
@@ -39,7 +39,7 @@ int myrg_rnext_same(MYRG_INFO *info, byte *buf)
else
{
/* Found here, adding to queue */
- queue_top(&(info->by_key))=(byte *)(info->current_table);
+ queue_top(&(info->by_key))=(uchar *)(info->current_table);
queue_replaced(&(info->by_key));
}
diff --git a/storage/myisammrg/myrg_rprev.c b/storage/myisammrg/myrg_rprev.c
index b1b86a93fad..66c94974940 100644
--- a/storage/myisammrg/myrg_rprev.c
+++ b/storage/myisammrg/myrg_rprev.c
@@ -19,7 +19,7 @@
Read previous row with the same key as previous read
*/
-int myrg_rprev(MYRG_INFO *info, byte *buf, int inx)
+int myrg_rprev(MYRG_INFO *info, uchar *buf, int inx)
{
int err;
MI_INFO *mi;
@@ -42,7 +42,7 @@ int myrg_rprev(MYRG_INFO *info, byte *buf, int inx)
else
{
/* Found here, adding to queue */
- queue_top(&(info->by_key))=(byte *)(info->current_table);
+ queue_top(&(info->by_key))=(uchar *)(info->current_table);
queue_replaced(&(info->by_key));
}
diff --git a/storage/myisammrg/myrg_rrnd.c b/storage/myisammrg/myrg_rrnd.c
index 55e72b2170d..b598563680c 100644
--- a/storage/myisammrg/myrg_rrnd.c
+++ b/storage/myisammrg/myrg_rrnd.c
@@ -30,7 +30,7 @@ static MYRG_TABLE *find_table(MYRG_TABLE *start,MYRG_TABLE *end,ulonglong pos);
HA_ERR_END_OF_FILE = EOF.
*/
-int myrg_rrnd(MYRG_INFO *info,byte *buf,ulonglong filepos)
+int myrg_rrnd(MYRG_INFO *info,uchar *buf,ulonglong filepos)
{
int error;
MI_INFO *isam_info;
@@ -47,7 +47,7 @@ int myrg_rrnd(MYRG_INFO *info,byte *buf,ulonglong filepos)
}
isam_info=(info->current_table=info->open_tables)->table;
if (info->cache_in_use)
- mi_extra(isam_info,HA_EXTRA_CACHE,(byte*) &info->cache_size);
+ mi_extra(isam_info,HA_EXTRA_CACHE,(uchar*) &info->cache_size);
filepos=isam_info->s->pack.header_length;
isam_info->lastinx= (uint) -1; /* Can't forward or backward */
}
@@ -60,20 +60,20 @@ int myrg_rrnd(MYRG_INFO *info,byte *buf,ulonglong filepos)
for (;;)
{
isam_info->update&= HA_STATE_CHANGED;
- if ((error=(*isam_info->s->read_rnd)(isam_info,(byte*) buf,
+ if ((error=(*isam_info->s->read_rnd)(isam_info,(uchar*) buf,
(my_off_t) filepos,1)) !=
HA_ERR_END_OF_FILE)
DBUG_RETURN(error);
if (info->cache_in_use)
mi_extra(info->current_table->table, HA_EXTRA_NO_CACHE,
- (byte*) &info->cache_size);
+ (uchar*) &info->cache_size);
if (info->current_table+1 == info->end_table)
DBUG_RETURN(HA_ERR_END_OF_FILE);
info->current_table++;
info->last_used_table=info->current_table;
if (info->cache_in_use)
mi_extra(info->current_table->table, HA_EXTRA_CACHE,
- (byte*) &info->cache_size);
+ (uchar*) &info->cache_size);
info->current_table->file_offset=
info->current_table[-1].file_offset+
info->current_table[-1].table->state->data_file_length;
@@ -88,7 +88,7 @@ int myrg_rrnd(MYRG_INFO *info,byte *buf,ulonglong filepos)
isam_info=info->current_table->table;
isam_info->update&= HA_STATE_CHANGED;
DBUG_RETURN((*isam_info->s->read_rnd)
- (isam_info, (byte*) buf,
+ (isam_info, (uchar*) buf,
(my_off_t) (filepos - info->current_table->file_offset),
0));
}
diff --git a/storage/myisammrg/myrg_rsame.c b/storage/myisammrg/myrg_rsame.c
index 56b16c0aa3c..2f7523759dc 100644
--- a/storage/myisammrg/myrg_rsame.c
+++ b/storage/myisammrg/myrg_rsame.c
@@ -15,7 +15,7 @@
#include "myrg_def.h"
-int myrg_rsame(MYRG_INFO *info,byte *record,int inx)
+int myrg_rsame(MYRG_INFO *info,uchar *record,int inx)
{
if (inx) /* not yet used, should be 0 */
return (my_errno=HA_ERR_WRONG_INDEX);
diff --git a/storage/myisammrg/myrg_update.c b/storage/myisammrg/myrg_update.c
index ba667d69f12..5d883be8484 100644
--- a/storage/myisammrg/myrg_update.c
+++ b/storage/myisammrg/myrg_update.c
@@ -17,7 +17,7 @@
#include "myrg_def.h"
-int myrg_update(register MYRG_INFO *info,const byte *oldrec, byte *newrec)
+int myrg_update(register MYRG_INFO *info,const uchar *oldrec, uchar *newrec)
{
if (!info->current_table)
return (my_errno=HA_ERR_NO_ACTIVE_RECORD);
diff --git a/storage/myisammrg/myrg_write.c b/storage/myisammrg/myrg_write.c
index ed0a4a7996a..27534df2821 100644
--- a/storage/myisammrg/myrg_write.c
+++ b/storage/myisammrg/myrg_write.c
@@ -17,7 +17,7 @@
#include "myrg_def.h"
-int myrg_write(register MYRG_INFO *info, byte *rec)
+int myrg_write(register MYRG_INFO *info, uchar *rec)
{
/* [phi] MERGE_WRITE_DISABLED is handled by the else case */
if (info->merge_insert_method == MERGE_INSERT_TO_FIRST)
diff --git a/storage/ndb/MAINTAINERS b/storage/ndb/MAINTAINERS
new file mode 100644
index 00000000000..d1547d48234
--- /dev/null
+++ b/storage/ndb/MAINTAINERS
@@ -0,0 +1,163 @@
+MySQL Cluster MAINTAINERS
+-------------------------
+
+This is a list of knowledgable people in parts of the NDB code.
+
+In changing that area of code, you probably want to talk to the
+people who know a lot about it to look over the patch.
+
+When sending patches and queries, always CC the mailing list.
+
+If no list specified, assume internals@lists.mysql.com
+
+P: Person
+M: Mail
+L: Mailing list
+W: Web page with status/info
+C: Comment
+SRC: Source directory (relative to this directory)
+T: SCM tree type and location
+S: Status, one of:
+
+ Supported: Somebody is paid to maintain this.
+ Maintained: Not their primary job, but maintained.
+ Orphan: No current obvious maintainer.
+ Obsolete: Replaced by something else.
+
+-------------------------------------------------------------
+
+Binlog Injector
+SRC: ha_ndbcluster_binlog.cc
+C: see also row based replication
+P: Stewart Smith
+M: stewart@mysql.com
+C: Original author
+P: Tomas Ulin
+M: tomas@mysql.com
+C: Lots of updates
+P: Martin Skold
+M: martin@mysql.com
+C: Metadata ops
+S: Supported
+
+BLOBs
+SRC: ha_ndbcluster.cc
+SRC: src/ndbapi/NdbBlob*
+P: Pekka
+M: pekka@mysql.com
+S: Supported
+
+cpcd/cpcc
+SRC: src/cw/cpcd
+SRC: src/cw/cpcc
+C: Maintained only as part of autotest
+P: Jonas Orland
+M: jonas@mysql.com
+S: Maintained
+
+cpcc-win32
+SRC: src/cw/cpcc-win32
+S: Obsolete
+
+Handler
+SRC: ha_ndbcluster.cc
+P: Martin Skold
+M: martin@mysql.com
+S: Supported
+
+Management Server
+SRC: src/mgmsrv/
+P: Stewart Smith
+M: stewart@mysql.com
+S: Supported
+
+Management Client
+SRC: src/mgmclient/
+P: Stewart Smith
+M: stewart@mysql.com
+S: Supported
+
+Management API
+SRC: src/mgmapi/
+P: Stewart Smith
+M: stewart@mysql.com
+S: Supported
+
+NDB API Examples
+SRC: ndbapi-examples/
+P: Tomas Ulin
+M: tomas@mysql.com
+C: Originally by Lars
+P: Lars Thalmann
+M: lars@mysql.com
+S: Maintained
+
+NDB API NdbRecord Examples
+SRC: ndbapi-examples/
+P: Kristian Nielsen
+M: knielsen@mysql.com
+S: Maintained
+
+tsman
+C: Disk Data (Table Space MANager)
+SRC: src/kernel/blocks/tsman.cpp
+SRC: src/kernel/blocks/tsman.hpp
+P: Jonas Oreland
+M: jonas@mysql.com
+S: Supported
+
+lgman
+C: Disk Data (LoG MANager)
+SRC: src/kernel/blocks/lgman.cpp
+SRC: src/kernel/blocks/lgman.hpp
+P: Jonas Oreland
+M: jonas@mysql.com
+S: Supported
+
+pgman
+C: Disk Data (PaGe MANager)
+SRC: src/kernel/blocks/lgman.cpp
+SRC: src/kernel/blocks/lgman.hpp
+P: Jonas Oreland
+M: jonas@mysql.com
+S: Supported
+
+SUMA
+C: SUbscription MAnager
+C: Used for replication
+SRC: src/kernel/blocks/suma/
+P: Tomas Ulin
+P: tomas@mysql.com
+P: Jonas Oreland
+P: jonas@mysql.com
+S: Supported
+
+TRIX
+C: TRiggers and IndeXs (but only online Index build)
+SRC: src/kernel/blocks/trix
+P: Martin Skold
+P: mskold@mysql.com
+S: Supported
+
+QMGR
+C: Cluster (with a Q) ManaGeR
+C: Heartbeats etc
+SRC: src/kernel/blocks/qmgr
+S: Supported
+
+NDBFS
+C: NDB FileSystem
+C: File System abstraction
+SRC: src/kernel/blocks/ndbfs
+S: Supported
+
+TRIX
+C: TRiggers and IndeXs (but only online Index build)
+SRC: src/kernel/blocks/trix
+S: Supported
+
+TRIX
+C: TRiggers and IndeXs (but only online Index build)
+SRC: src/kernel/blocks/trix
+S: Supported
+
diff --git a/storage/ndb/config/common.mk.am b/storage/ndb/config/common.mk.am
index 5ed3855f31e..9633a52e91f 100644
--- a/storage/ndb/config/common.mk.am
+++ b/storage/ndb/config/common.mk.am
@@ -25,3 +25,5 @@ INCLUDES = $(INCLUDES_LOC)
LDADD = $(LDADD_LOC)
DEFS = @DEFS@ @NDB_DEFS@ $(DEFS_LOC) $(NDB_EXTRA_FLAGS)
NDB_CXXFLAGS=@ndb_cxxflags_fix@ $(NDB_CXXFLAGS_LOC)
+NDB_AM_CXXFLAGS:= $(AM_CXXFLAGS)
+AM_CXXFLAGS=$(NDB_AM_CXXFLAGS) $(NDB_CXXFLAGS)
diff --git a/storage/ndb/include/Makefile.am b/storage/ndb/include/Makefile.am
index bf8fe392072..9e6ad016d75 100644
--- a/storage/ndb/include/Makefile.am
+++ b/storage/ndb/include/Makefile.am
@@ -45,6 +45,7 @@ ndbapi/ndberror.h
mgmapiinclude_HEADERS = \
mgmapi/mgmapi.h \
+mgmapi/mgmapi_error.h \
mgmapi/mgmapi_debug.h \
mgmapi/mgmapi_config_parameters.h \
mgmapi/mgmapi_config_parameters_debug.h \
diff --git a/storage/ndb/include/debugger/EventLogger.hpp b/storage/ndb/include/debugger/EventLogger.hpp
index 7e47dbf59db..8ae96162a48 100644
--- a/storage/ndb/include/debugger/EventLogger.hpp
+++ b/storage/ndb/include/debugger/EventLogger.hpp
@@ -173,5 +173,5 @@ private:
STATIC_CONST(MAX_TEXT_LENGTH = 256);
};
-
+extern void getRestartAction(Uint32 action, BaseString &str);
#endif
diff --git a/storage/ndb/include/kernel/signaldata/FsOpenReq.hpp b/storage/ndb/include/kernel/signaldata/FsOpenReq.hpp
index 8d438f79259..8126267f946 100644
--- a/storage/ndb/include/kernel/signaldata/FsOpenReq.hpp
+++ b/storage/ndb/include/kernel/signaldata/FsOpenReq.hpp
@@ -44,6 +44,8 @@ class FsOpenReq {
friend class Restore;
friend class Dblqh;
+ friend class Dbtup;
+
/**
* For printing
*/
diff --git a/storage/ndb/include/mgmapi/mgmapi.h b/storage/ndb/include/mgmapi/mgmapi.h
index 2bedba963e2..0853f5a4422 100644
--- a/storage/ndb/include/mgmapi/mgmapi.h
+++ b/storage/ndb/include/mgmapi/mgmapi.h
@@ -18,12 +18,13 @@
#include "mgmapi_config_parameters.h"
#include "ndb_logevent.h"
+#include "mgmapi_error.h"
#define MGM_LOGLEVELS CFG_MAX_LOGLEVEL - CFG_MIN_LOGLEVEL + 1
#define NDB_MGM_MAX_LOGLEVEL 15
/**
- * @mainpage MySQL Cluster Management API
+ * @section MySQL Cluster Management API
*
* The MySQL Cluster Management API (MGM API) is a C language API
* that is used for:
@@ -212,105 +213,6 @@ extern "C" {
};
/**
- * Error codes
- */
- enum ndb_mgm_error {
- /** Not an error */
- NDB_MGM_NO_ERROR = 0,
-
- /* Request for service errors */
- /** Supplied connectstring is illegal */
- NDB_MGM_ILLEGAL_CONNECT_STRING = 1001,
- /** Supplied NdbMgmHandle is illegal */
- NDB_MGM_ILLEGAL_SERVER_HANDLE = 1005,
- /** Illegal reply from server */
- NDB_MGM_ILLEGAL_SERVER_REPLY = 1006,
- /** Illegal number of nodes */
- NDB_MGM_ILLEGAL_NUMBER_OF_NODES = 1007,
- /** Illegal node status */
- NDB_MGM_ILLEGAL_NODE_STATUS = 1008,
- /** Memory allocation error */
- NDB_MGM_OUT_OF_MEMORY = 1009,
- /** Management server not connected */
- NDB_MGM_SERVER_NOT_CONNECTED = 1010,
- /** Could not connect to socker */
- NDB_MGM_COULD_NOT_CONNECT_TO_SOCKET = 1011,
- /** Could not bind local address */
- NDB_MGM_BIND_ADDRESS = 1012,
-
- /* Alloc node id failures */
- /** Generic error, retry may succeed */
- NDB_MGM_ALLOCID_ERROR = 1101,
- /** Non retriable error */
- NDB_MGM_ALLOCID_CONFIG_MISMATCH = 1102,
-
- /* Service errors - Start/Stop Node or System */
- /** Start failed */
- NDB_MGM_START_FAILED = 2001,
- /** Stop failed */
- NDB_MGM_STOP_FAILED = 2002,
- /** Restart failed */
- NDB_MGM_RESTART_FAILED = 2003,
-
- /* Service errors - Backup */
- /** Unable to start backup */
- NDB_MGM_COULD_NOT_START_BACKUP = 3001,
- /** Unable to abort backup */
- NDB_MGM_COULD_NOT_ABORT_BACKUP = 3002,
-
- /* Service errors - Single User Mode */
- /** Unable to enter single user mode */
- NDB_MGM_COULD_NOT_ENTER_SINGLE_USER_MODE = 4001,
- /** Unable to exit single user mode */
- NDB_MGM_COULD_NOT_EXIT_SINGLE_USER_MODE = 4002,
-
- /* Usage errors */
- /** Usage error */
- NDB_MGM_USAGE_ERROR = 5001
- };
-
-#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
- struct Ndb_Mgm_Error_Msg {
- enum ndb_mgm_error code;
- const char * msg;
- };
- const struct Ndb_Mgm_Error_Msg ndb_mgm_error_msgs[] = {
- { NDB_MGM_NO_ERROR, "No error" },
-
- /* Request for service errors */
- { NDB_MGM_ILLEGAL_CONNECT_STRING, "Illegal connect string" },
- { NDB_MGM_ILLEGAL_SERVER_HANDLE, "Illegal server handle" },
- { NDB_MGM_ILLEGAL_SERVER_REPLY, "Illegal reply from server" },
- { NDB_MGM_ILLEGAL_NUMBER_OF_NODES, "Illegal number of nodes" },
- { NDB_MGM_ILLEGAL_NODE_STATUS, "Illegal node status" },
- { NDB_MGM_OUT_OF_MEMORY, "Out of memory" },
- { NDB_MGM_SERVER_NOT_CONNECTED, "Management server not connected" },
- { NDB_MGM_COULD_NOT_CONNECT_TO_SOCKET, "Could not connect to socket" },
-
- /* Service errors - Start/Stop Node or System */
- { NDB_MGM_START_FAILED, "Start failed" },
- { NDB_MGM_STOP_FAILED, "Stop failed" },
- { NDB_MGM_RESTART_FAILED, "Restart failed" },
-
- /* Service errors - Backup */
- { NDB_MGM_COULD_NOT_START_BACKUP, "Could not start backup" },
- { NDB_MGM_COULD_NOT_ABORT_BACKUP, "Could not abort backup" },
-
- /* Service errors - Single User Mode */
- { NDB_MGM_COULD_NOT_ENTER_SINGLE_USER_MODE,
- "Could not enter single user mode" },
- { NDB_MGM_COULD_NOT_EXIT_SINGLE_USER_MODE,
- "Could not exit single user mode" },
-
- /* Usage errors */
- { NDB_MGM_USAGE_ERROR,
- "Usage error" }
- };
- const int ndb_mgm_noOfErrorMsgs =
- sizeof(ndb_mgm_error_msgs)/sizeof(struct Ndb_Mgm_Error_Msg);
-#endif
-
- /**
* Status of a node in the cluster.
*
* Sub-structure in enum ndb_mgm_cluster_state
diff --git a/storage/ndb/include/mgmapi/mgmapi_config_parameters.h b/storage/ndb/include/mgmapi/mgmapi_config_parameters.h
index 119958d0ce0..ac2cbf060fd 100644
--- a/storage/ndb/include/mgmapi/mgmapi_config_parameters.h
+++ b/storage/ndb/include/mgmapi/mgmapi_config_parameters.h
@@ -64,6 +64,7 @@
#define CFG_DB_FILESYSTEM_PATH 125
#define CFG_DB_NO_REDOLOG_FILES 126
+#define CFG_DB_REDOLOG_FILE_SIZE 140
#define CFG_DB_LCP_DISC_PAGES_TUP 127
#define CFG_DB_LCP_DISC_PAGES_TUP_SR 128
@@ -81,6 +82,8 @@
#define CFG_DB_BACKUP_WRITE_SIZE 136
#define CFG_DB_BACKUP_MAX_WRITE_SIZE 139
+#define CFG_DB_WATCHDOG_INTERVAL_INITIAL 141
+
#define CFG_LOG_DESTINATION 147
#define CFG_DB_DISCLESS 148
@@ -113,6 +116,10 @@
#define CFG_DB_MEMREPORT_FREQUENCY 166
+#define CFG_DB_O_DIRECT 168
+
+#define CFG_DB_MAX_ALLOCATE 169
+
#define CFG_DB_SGA 198 /* super pool mem */
#define CFG_DB_DATA_MEM_2 199 /* used in special build in 5.1 */
diff --git a/storage/ndb/include/mgmapi/mgmapi_error.h b/storage/ndb/include/mgmapi/mgmapi_error.h
new file mode 100644
index 00000000000..2d0aa1ded0f
--- /dev/null
+++ b/storage/ndb/include/mgmapi/mgmapi_error.h
@@ -0,0 +1,121 @@
+/* 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 */
+
+#ifndef MGMAPI_ERROR_H
+#define MGMAPI_ERROR_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ /**
+ * Error codes
+ */
+ enum ndb_mgm_error {
+ /** Not an error */
+ NDB_MGM_NO_ERROR = 0,
+
+ /* Request for service errors */
+ /** Supplied connectstring is illegal */
+ NDB_MGM_ILLEGAL_CONNECT_STRING = 1001,
+ /** Supplied NdbMgmHandle is illegal */
+ NDB_MGM_ILLEGAL_SERVER_HANDLE = 1005,
+ /** Illegal reply from server */
+ NDB_MGM_ILLEGAL_SERVER_REPLY = 1006,
+ /** Illegal number of nodes */
+ NDB_MGM_ILLEGAL_NUMBER_OF_NODES = 1007,
+ /** Illegal node status */
+ NDB_MGM_ILLEGAL_NODE_STATUS = 1008,
+ /** Memory allocation error */
+ NDB_MGM_OUT_OF_MEMORY = 1009,
+ /** Management server not connected */
+ NDB_MGM_SERVER_NOT_CONNECTED = 1010,
+ /** Could not connect to socker */
+ NDB_MGM_COULD_NOT_CONNECT_TO_SOCKET = 1011,
+ /** Could not bind local address */
+ NDB_MGM_BIND_ADDRESS = 1012,
+
+ /* Alloc node id failures */
+ /** Generic error, retry may succeed */
+ NDB_MGM_ALLOCID_ERROR = 1101,
+ /** Non retriable error */
+ NDB_MGM_ALLOCID_CONFIG_MISMATCH = 1102,
+
+ /* Service errors - Start/Stop Node or System */
+ /** Start failed */
+ NDB_MGM_START_FAILED = 2001,
+ /** Stop failed */
+ NDB_MGM_STOP_FAILED = 2002,
+ /** Restart failed */
+ NDB_MGM_RESTART_FAILED = 2003,
+
+ /* Service errors - Backup */
+ /** Unable to start backup */
+ NDB_MGM_COULD_NOT_START_BACKUP = 3001,
+ /** Unable to abort backup */
+ NDB_MGM_COULD_NOT_ABORT_BACKUP = 3002,
+
+ /* Service errors - Single User Mode */
+ /** Unable to enter single user mode */
+ NDB_MGM_COULD_NOT_ENTER_SINGLE_USER_MODE = 4001,
+ /** Unable to exit single user mode */
+ NDB_MGM_COULD_NOT_EXIT_SINGLE_USER_MODE = 4002,
+
+ /* Usage errors */
+ /** Usage error */
+ NDB_MGM_USAGE_ERROR = 5001
+ };
+ struct Ndb_Mgm_Error_Msg {
+ enum ndb_mgm_error code;
+ const char * msg;
+ };
+ const struct Ndb_Mgm_Error_Msg ndb_mgm_error_msgs[] = {
+ { NDB_MGM_NO_ERROR, "No error" },
+
+ /* Request for service errors */
+ { NDB_MGM_ILLEGAL_CONNECT_STRING, "Illegal connect string" },
+ { NDB_MGM_ILLEGAL_SERVER_HANDLE, "Illegal server handle" },
+ { NDB_MGM_ILLEGAL_SERVER_REPLY, "Illegal reply from server" },
+ { NDB_MGM_ILLEGAL_NUMBER_OF_NODES, "Illegal number of nodes" },
+ { NDB_MGM_ILLEGAL_NODE_STATUS, "Illegal node status" },
+ { NDB_MGM_OUT_OF_MEMORY, "Out of memory" },
+ { NDB_MGM_SERVER_NOT_CONNECTED, "Management server not connected" },
+ { NDB_MGM_COULD_NOT_CONNECT_TO_SOCKET, "Could not connect to socket" },
+
+ /* Service errors - Start/Stop Node or System */
+ { NDB_MGM_START_FAILED, "Start failed" },
+ { NDB_MGM_STOP_FAILED, "Stop failed" },
+ { NDB_MGM_RESTART_FAILED, "Restart failed" },
+
+ /* Service errors - Backup */
+ { NDB_MGM_COULD_NOT_START_BACKUP, "Could not start backup" },
+ { NDB_MGM_COULD_NOT_ABORT_BACKUP, "Could not abort backup" },
+
+ /* Service errors - Single User Mode */
+ { NDB_MGM_COULD_NOT_ENTER_SINGLE_USER_MODE,
+ "Could not enter single user mode" },
+ { NDB_MGM_COULD_NOT_EXIT_SINGLE_USER_MODE,
+ "Could not exit single user mode" },
+
+ /* Usage errors */
+ { NDB_MGM_USAGE_ERROR,
+ "Usage error" }
+ };
+ const int ndb_mgm_noOfErrorMsgs =
+ sizeof(ndb_mgm_error_msgs)/sizeof(struct Ndb_Mgm_Error_Msg);
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/storage/ndb/include/mgmapi/ndbd_exit_codes.h b/storage/ndb/include/mgmapi/ndbd_exit_codes.h
index 71802fd8fcc..30578bdf722 100644
--- a/storage/ndb/include/mgmapi/ndbd_exit_codes.h
+++ b/storage/ndb/include/mgmapi/ndbd_exit_codes.h
@@ -78,8 +78,9 @@ typedef ndbd_exit_classification_enum ndbd_exit_classification;
#define NDBD_EXIT_SR_RESTARTCONFLICT 2311
#define NDBD_EXIT_NO_MORE_UNDOLOG 2312
#define NDBD_EXIT_SR_UNDOLOG 2313
-#define NDBD_EXIT_SR_SCHEMAFILE 2310
#define NDBD_EXIT_SINGLE_USER_MODE 2314
+#define NDBD_EXIT_NODE_DECLARED_DEAD 2315
+#define NDBD_EXIT_SR_SCHEMAFILE 2316
#define NDBD_EXIT_MEMALLOC 2327
#define NDBD_EXIT_BLOCK_JBUFCONGESTION 2334
#define NDBD_EXIT_TIME_QUEUE_SHORT 2335
diff --git a/storage/ndb/include/ndb_global.h.in b/storage/ndb/include/ndb_global.h.in
index dd4303f949c..2fc594b3f5a 100644
--- a/storage/ndb/include/ndb_global.h.in
+++ b/storage/ndb/include/ndb_global.h.in
@@ -144,4 +144,6 @@ extern "C" {
#define MAX(x,y) (((x)>(y))?(x):(y))
#endif
+#define NDB_O_DIRECT_WRITE_ALIGNMENT 512
+
#endif
diff --git a/storage/ndb/include/ndb_version.h.in b/storage/ndb/include/ndb_version.h.in
index 9e1edeecd1e..5405ad4d7aa 100644
--- a/storage/ndb/include/ndb_version.h.in
+++ b/storage/ndb/include/ndb_version.h.in
@@ -16,8 +16,7 @@
#ifndef NDB_VERSION_H
#define NDB_VERSION_H
-#include <ndb_global.h>
-#include <version.h>
+#include <ndb_types.h>
/* NDB build version */
#define NDB_VERSION_BUILD @NDB_VERSION_BUILD@
@@ -32,19 +31,35 @@
#define NDB_VERSION_STATUS "@NDB_VERSION_STATUS@"
-#define MAKE_VERSION(A,B,C) (((A) << 16) | ((B) << 8) | ((C) << 0))
+#define NDB_MAKE_VERSION(A,B,C) (((A) << 16) | ((B) << 8) | ((C) << 0))
-#define NDB_VERSION_D MAKE_VERSION(NDB_VERSION_MAJOR, NDB_VERSION_MINOR, NDB_VERSION_BUILD)
+#define NDB_VERSION_D NDB_MAKE_VERSION(NDB_VERSION_MAJOR, NDB_VERSION_MINOR, NDB_VERSION_BUILD)
#define NDB_VERSION_STRING_BUF_SZ 100
#ifdef __cplusplus
-extern "C"
-#else
-extern
+extern "C" {
#endif
-char ndb_version_string_buf[NDB_VERSION_STRING_BUF_SZ];
-#define NDB_VERSION_STRING (getVersionString(NDB_VERSION, NDB_VERSION_STATUS, \
- ndb_version_string_buf, \
- sizeof(ndb_version_string_buf)))
+
+void ndbPrintVersion();
+
+Uint32 ndbMakeVersion(Uint32 major, Uint32 minor, Uint32 build);
+
+Uint32 ndbGetMajor(Uint32 version);
+
+Uint32 ndbGetMinor(Uint32 version);
+
+Uint32 ndbGetBuild(Uint32 version);
+
+const char* ndbGetVersionString(Uint32 version, const char * status,
+ char *buf, unsigned sz);
+const char* ndbGetOwnVersionString();
+
+Uint32 ndbGetOwnVersion();
+
+#ifdef __cplusplus
+}
+#endif
+
+#define NDB_VERSION_STRING ndbGetOwnVersionString()
#define NDB_VERSION ndbGetOwnVersion()
@@ -59,19 +74,19 @@ char ndb_version_string_buf[NDB_VERSION_STRING_BUF_SZ];
/**
* From which version do we support rowid
*/
-#define NDBD_ROWID_VERSION (MAKE_VERSION(5,1,6))
-#define NDBD_INCL_NODECONF_VERSION_4 MAKE_VERSION(4,1,17)
-#define NDBD_INCL_NODECONF_VERSION_5 MAKE_VERSION(5,0,18)
-#define NDBD_FRAGID_VERSION (MAKE_VERSION(5,1,6))
-#define NDBD_DICT_LOCK_VERSION_5 MAKE_VERSION(5,0,23)
-#define NDBD_DICT_LOCK_VERSION_5_1 MAKE_VERSION(5,1,12)
+#define NDBD_ROWID_VERSION (NDB_MAKE_VERSION(5,1,6))
+#define NDBD_INCL_NODECONF_VERSION_4 NDB_MAKE_VERSION(4,1,17)
+#define NDBD_INCL_NODECONF_VERSION_5 NDB_MAKE_VERSION(5,0,18)
+#define NDBD_FRAGID_VERSION (NDB_MAKE_VERSION(5,1,6))
+#define NDBD_DICT_LOCK_VERSION_5 NDB_MAKE_VERSION(5,0,23)
+#define NDBD_DICT_LOCK_VERSION_5_1 NDB_MAKE_VERSION(5,1,12)
-#define NDBD_UPDATE_FRAG_DIST_KEY_50 MAKE_VERSION(5,0,26)
-#define NDBD_UPDATE_FRAG_DIST_KEY_51 MAKE_VERSION(5,1,12)
+#define NDBD_UPDATE_FRAG_DIST_KEY_50 NDB_MAKE_VERSION(5,0,26)
+#define NDBD_UPDATE_FRAG_DIST_KEY_51 NDB_MAKE_VERSION(5,1,12)
-#define NDBD_QMGR_SINGLEUSER_VERSION_5 MAKE_VERSION(5,0,25)
+#define NDBD_QMGR_SINGLEUSER_VERSION_5 NDB_MAKE_VERSION(5,0,25)
-#define NDBD_NODE_VERSION_REP MAKE_VERSION(6,1,1)
+#define NDBD_NODE_VERSION_REP NDB_MAKE_VERSION(6,1,1)
#endif
diff --git a/storage/ndb/include/ndbapi/Ndb.hpp b/storage/ndb/include/ndbapi/Ndb.hpp
index 5f96408ea30..4d0219d1a3c 100644
--- a/storage/ndb/include/ndbapi/Ndb.hpp
+++ b/storage/ndb/include/ndbapi/Ndb.hpp
@@ -1055,6 +1055,7 @@ class Ndb
friend class NdbDictInterface;
friend class NdbBlob;
friend class NdbImpl;
+ friend class Ndb_internal;
#endif
public:
@@ -1280,6 +1281,16 @@ public:
*/
/**
+ * Structure for passing in pointers to startTransaction
+ *
+ */
+ struct Key_part_ptr
+ {
+ const void * ptr;
+ unsigned len;
+ };
+
+ /**
* Start a transaction
*
* @note When the transaction is completed it must be closed using
@@ -1300,6 +1311,30 @@ public:
Uint32 keyLen = 0);
/**
+ * Compute hash value given table/keys
+ *
+ * @param hashvalueptr - OUT, is set to hashvalue if return value is 0
+ * @param table Pointer to table object
+ * @param keyData Null-terminated array of pointers to keyParts that is
+ * part of distribution key.
+ * Length of resp. keyPart will be read from
+ * metadata and checked against passed value
+ * @param xfrmbuf Pointer to temporary buffer that will be used
+ * to calculate hashvalue
+ * @param xfrmbuflen Lengh of buffer
+ *
+ * @note if xfrmbuf is null (default) malloc/free will be made
+ * if xfrmbuf is not null but length is too short, method will fail
+ *
+ * @return 0 - ok - hashvalueptr is set
+ * else - fail, return error code
+ */
+ static int computeHash(Uint32* hashvalueptr,
+ const NdbDictionary::Table*,
+ const struct Key_part_ptr * keyData,
+ void* xfrmbuf = 0, Uint32 xfrmbuflen = 0);
+
+ /**
* Close a transaction.
*
* @note should be called after the transaction has completed, irrespective
@@ -1488,12 +1523,15 @@ public:
int initAutoIncrement();
int getAutoIncrementValue(const char* aTableName,
- Uint64 & tupleId, Uint32 cacheSize);
+ Uint64 & tupleId, Uint32 cacheSize,
+ Uint64 step = 1, Uint64 start = 1);
int getAutoIncrementValue(const NdbDictionary::Table * aTable,
- Uint64 & tupleId, Uint32 cacheSize);
+ Uint64 & tupleId, Uint32 cacheSize,
+ Uint64 step = 1, Uint64 start = 1);
int getAutoIncrementValue(const NdbDictionary::Table * aTable,
TupleIdRange & range, Uint64 & tupleId,
- Uint32 cacheSize);
+ Uint32 cacheSize,
+ Uint64 step = 1, Uint64 start = 1);
int readAutoIncrementValue(const char* aTableName,
Uint64 & tupleId);
int readAutoIncrementValue(const NdbDictionary::Table * aTable,
@@ -1510,7 +1548,7 @@ public:
private:
int getTupleIdFromNdb(const NdbTableImpl* table,
TupleIdRange & range, Uint64 & tupleId,
- Uint32 cacheSize);
+ Uint32 cacheSize, Uint64 step = 1, Uint64 start = 1);
int readTupleIdFromNdb(const NdbTableImpl* table,
TupleIdRange & range, Uint64 & tupleId);
int setTupleIdInNdb(const NdbTableImpl* table,
diff --git a/storage/ndb/include/ndbapi/NdbOperation.hpp b/storage/ndb/include/ndbapi/NdbOperation.hpp
index 0fa2cac0a32..06111941df4 100644
--- a/storage/ndb/include/ndbapi/NdbOperation.hpp
+++ b/storage/ndb/include/ndbapi/NdbOperation.hpp
@@ -1042,6 +1042,13 @@ protected:
*/
Int8 m_abortOption;
+ /*
+ * For blob impl, option to not propagate error to trans level.
+ * Could be AO_IgnoreError variant if we want it public.
+ * Ignored unless AO_IgnoreError is also set.
+ */
+ Int8 m_noErrorPropagation;
+
friend struct Ndb_free_list_t<NdbOperation>;
};
diff --git a/storage/ndb/include/ndbapi/NdbRecAttr.hpp b/storage/ndb/include/ndbapi/NdbRecAttr.hpp
index ac098831180..121339e470b 100644
--- a/storage/ndb/include/ndbapi/NdbRecAttr.hpp
+++ b/storage/ndb/include/ndbapi/NdbRecAttr.hpp
@@ -153,6 +153,13 @@ public:
/**
* Get value stored in NdbRecAttr object.
*
+ * @return Int8 value.
+ */
+ Int8 int8_value() const;
+
+ /**
+ * Get value stored in NdbRecAttr object.
+ *
* @return 64 bit unsigned value.
*/
Uint64 u_64_value() const;
@@ -188,6 +195,13 @@ public:
/**
* Get value stored in NdbRecAttr object.
*
+ * @return Uint8 value.
+ */
+ Uint8 u_8_value() const;
+
+ /**
+ * Get value stored in NdbRecAttr object.
+ *
* @return Float value.
*/
float float_value() const;
@@ -316,6 +330,13 @@ NdbRecAttr::char_value() const
}
inline
+Int8
+NdbRecAttr::int8_value() const
+{
+ return *(Int8*)theRef;
+}
+
+inline
Uint32
NdbRecAttr::u_32_value() const
{
@@ -337,6 +358,13 @@ NdbRecAttr::u_char_value() const
}
inline
+Uint8
+NdbRecAttr::u_8_value() const
+{
+ return *(Uint8*)theRef;
+}
+
+inline
void
NdbRecAttr::release()
{
diff --git a/storage/ndb/include/portlib/NdbThread.h b/storage/ndb/include/portlib/NdbThread.h
index 569048cf6c8..373e2218c6c 100644
--- a/storage/ndb/include/portlib/NdbThread.h
+++ b/storage/ndb/include/portlib/NdbThread.h
@@ -41,7 +41,7 @@ struct NdbThread;
signum set in g_ndb_shm_signum in a portable manner.
*/
#ifdef NDB_SHM_TRANSPORTER
-void NdbThread_set_shm_sigmask(bool block);
+void NdbThread_set_shm_sigmask(my_bool block);
#endif
/**
diff --git a/storage/ndb/include/portlib/NdbTick.h b/storage/ndb/include/portlib/NdbTick.h
index 59f580de38e..70c36fdfd1e 100644
--- a/storage/ndb/include/portlib/NdbTick.h
+++ b/storage/ndb/include/portlib/NdbTick.h
@@ -37,9 +37,6 @@ NDB_TICKS NdbTick_CurrentMillisecond(void);
*/
int NdbTick_CurrentMicrosecond(NDB_TICKS * secs, Uint32 * micros);
- /*#define TIME_MEASUREMENT*/
-#ifdef TIME_MEASUREMENT
-
struct MicroSecondTimer {
NDB_TICKS seconds;
NDB_TICKS micro_seconds;
@@ -54,7 +51,6 @@ struct MicroSecondTimer {
NDB_TICKS NdbTick_getMicrosPassed(struct MicroSecondTimer start,
struct MicroSecondTimer stop);
int NdbTick_getMicroTimer(struct MicroSecondTimer* time_now);
-#endif
#ifdef __cplusplus
}
diff --git a/storage/ndb/include/util/ndb_opts.h b/storage/ndb/include/util/ndb_opts.h
index 9cb65d4bc2e..f18bb9646cc 100644
--- a/storage/ndb/include/util/ndb_opts.h
+++ b/storage/ndb/include/util/ndb_opts.h
@@ -58,40 +58,40 @@ const char *opt_debug= 0;
"Set connect string for connecting to ndb_mgmd. " \
"Syntax: \"[nodeid=<id>;][host=]<hostname>[:<port>]\". " \
"Overrides specifying entries in NDB_CONNECTSTRING and my.cnf", \
- (gptr*) &opt_ndb_connectstring, (gptr*) &opt_ndb_connectstring, \
+ (uchar**) &opt_ndb_connectstring, (uchar**) &opt_ndb_connectstring, \
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },\
{ "ndb-mgmd-host", OPT_NDB_MGMD, \
"Set host and port for connecting to ndb_mgmd. " \
"Syntax: <hostname>[:<port>].", \
- (gptr*) &opt_ndb_mgmd, (gptr*) &opt_ndb_mgmd, 0, \
+ (uchar**) &opt_ndb_mgmd, (uchar**) &opt_ndb_mgmd, 0, \
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },\
{ "ndb-nodeid", OPT_NDB_NODEID, \
"Set node id for this node.", \
- (gptr*) &opt_ndb_nodeid, (gptr*) &opt_ndb_nodeid, 0, \
+ (uchar**) &opt_ndb_nodeid, (uchar**) &opt_ndb_nodeid, 0, \
GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },\
{ "ndb-shm", OPT_NDB_SHM,\
"Allow optimizing using shared memory connections when available",\
- (gptr*) &opt_ndb_shm, (gptr*) &opt_ndb_shm, 0,\
+ (uchar**) &opt_ndb_shm, (uchar**) &opt_ndb_shm, 0,\
GET_BOOL, NO_ARG, OPT_NDB_SHM_DEFAULT, 0, 0, 0, 0, 0 },\
{"ndb-optimized-node-selection", OPT_NDB_OPTIMIZED_NODE_SELECTION,\
"Select nodes for transactions in a more optimal way",\
- (gptr*) &opt_ndb_optimized_node_selection,\
- (gptr*) &opt_ndb_optimized_node_selection, 0,\
+ (uchar**) &opt_ndb_optimized_node_selection,\
+ (uchar**) &opt_ndb_optimized_node_selection, 0,\
GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},\
{ "connect-string", OPT_NDB_CONNECTSTRING, "same as --ndb-connectstring",\
- (gptr*) &opt_ndb_connectstring, (gptr*) &opt_ndb_connectstring, \
+ (uchar**) &opt_ndb_connectstring, (uchar**) &opt_ndb_connectstring, \
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },\
{ "core-file", OPT_WANT_CORE, "Write core on errors.",\
- (gptr*) &opt_core, (gptr*) &opt_core, 0,\
+ (uchar**) &opt_core, (uchar**) &opt_core, 0,\
GET_BOOL, NO_ARG, OPT_WANT_CORE_DEFAULT, 0, 0, 0, 0, 0},\
{"character-sets-dir", OPT_CHARSETS_DIR,\
- "Directory where character sets are.", (gptr*) &charsets_dir,\
- (gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}\
+ "Directory where character sets are.", (uchar**) &charsets_dir,\
+ (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}\
#ifndef DBUG_OFF
#define NDB_STD_OPTS(prog_name) \
{ "debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", \
- (gptr*) &opt_debug, (gptr*) &opt_debug, \
+ (uchar**) &opt_debug, (uchar**) &opt_debug, \
0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0 }, \
NDB_STD_OPTS_COMMON
#else
diff --git a/storage/ndb/include/util/version.h b/storage/ndb/include/util/version.h
index 42513d00442..9ea18ecd9d9 100644
--- a/storage/ndb/include/util/version.h
+++ b/storage/ndb/include/util/version.h
@@ -16,25 +16,18 @@
#ifndef VERSION_H
#define VERSION_H
-#include <ndb_types.h>
+#include <ndb_version.h>
+
+/* some backwards compatible macros */
+#define MAKE_VERSION(A,B,C) NDB_MAKE_VERSION(A,B,C)
+#define getMajor(a) ndbGetMajor(a)
+#define getMinor(a) ndbGetMinor(a)
+#define getBuild(a) ndbGetBuild(a)
+
#ifdef __cplusplus
extern "C" {
#endif
- Uint32 getMajor(Uint32 version);
-
- Uint32 getMinor(Uint32 version);
-
- Uint32 getBuild(Uint32 version);
-
- Uint32 makeVersion(Uint32 major, Uint32 minor, Uint32 build);
-
- const char* getVersionString(Uint32 version, const char * status,
- char *buf, unsigned sz);
-
- void ndbPrintVersion();
- Uint32 ndbGetOwnVersion();
-
int ndbCompatible_mgmt_ndb(Uint32 ownVersion, Uint32 otherVersion);
int ndbCompatible_ndb_mgmt(Uint32 ownVersion, Uint32 otherVersion);
int ndbCompatible_mgmt_api(Uint32 ownVersion, Uint32 otherVersion);
diff --git a/storage/ndb/ndbapi-examples/mgmapi_logevent/Makefile b/storage/ndb/ndbapi-examples/mgmapi_logevent/Makefile
index c9b4507c4a7..b67150b71fa 100644
--- a/storage/ndb/ndbapi-examples/mgmapi_logevent/Makefile
+++ b/storage/ndb/ndbapi-examples/mgmapi_logevent/Makefile
@@ -1,6 +1,6 @@
TARGET = mgmapi_logevent
-SRCS = $(TARGET).cpp
-OBJS = $(TARGET).o
+SRCS = main.cpp
+OBJS = main.o
CXX = g++
CFLAGS = -c -Wall -fno-rtti -fno-exceptions
CXXFLAGS =
@@ -17,7 +17,7 @@ SYS_LIB =
$(TARGET): $(OBJS)
$(CXX) $(CXXFLAGS) $(LFLAGS) $(LIB_DIR) $(OBJS) -lndbclient -lmysqlclient_r -lmysys -lmystrings -lz $(SYS_LIB) -o $(TARGET)
-$(TARGET).o: $(SRCS)
+$(OBJS): $(SRCS)
$(CXX) $(CFLAGS) -I$(TOP_SRCDIR)/include -I$(INCLUDE_DIR) -I$(INCLUDE_DIR)/mgmapi -I$(INCLUDE_DIR)/ndbapi $(SRCS)
clean:
diff --git a/storage/ndb/ndbapi-examples/mgmapi_logevent/mgmapi_logevent.cpp b/storage/ndb/ndbapi-examples/mgmapi_logevent/main.cpp
index fbe5397c5cf..fbe5397c5cf 100644
--- a/storage/ndb/ndbapi-examples/mgmapi_logevent/mgmapi_logevent.cpp
+++ b/storage/ndb/ndbapi-examples/mgmapi_logevent/main.cpp
diff --git a/storage/ndb/ndbapi-examples/mgmapi_logevent2/Makefile b/storage/ndb/ndbapi-examples/mgmapi_logevent2/Makefile
index 95b43b11f6b..fd9499c7a68 100644
--- a/storage/ndb/ndbapi-examples/mgmapi_logevent2/Makefile
+++ b/storage/ndb/ndbapi-examples/mgmapi_logevent2/Makefile
@@ -1,6 +1,6 @@
TARGET = mgmapi_logevent2
-SRCS = $(TARGET).cpp
-OBJS = $(TARGET).o
+SRCS = main.cpp
+OBJS = main.o
CXX = g++
CFLAGS = -c -Wall -fno-rtti -fno-exceptions
CXXFLAGS =
@@ -17,7 +17,7 @@ SYS_LIB =
$(TARGET): $(OBJS)
$(CXX) $(CXXFLAGS) $(LFLAGS) $(LIB_DIR) $(OBJS) -lndbclient -lmysqlclient_r -lmysys -lmystrings -lz $(SYS_LIB) -o $(TARGET)
-$(TARGET).o: $(SRCS)
+$(OBJS): $(SRCS)
$(CXX) $(CFLAGS) -I$(TOP_SRCDIR)/include -I$(INCLUDE_DIR) -I$(INCLUDE_DIR)/mgmapi -I$(INCLUDE_DIR)/ndbapi $(SRCS)
clean:
diff --git a/storage/ndb/ndbapi-examples/mgmapi_logevent2/mgmapi_logevent2.cpp b/storage/ndb/ndbapi-examples/mgmapi_logevent2/main.cpp
index 5a2241fc05f..5a2241fc05f 100644
--- a/storage/ndb/ndbapi-examples/mgmapi_logevent2/mgmapi_logevent2.cpp
+++ b/storage/ndb/ndbapi-examples/mgmapi_logevent2/main.cpp
diff --git a/storage/ndb/ndbapi-examples/ndbapi_async1/ndbapi_async1.cpp b/storage/ndb/ndbapi-examples/ndbapi_async1/ndbapi_async1.cpp
index a195a419aaf..1f19f36d674 100644
--- a/storage/ndb/ndbapi-examples/ndbapi_async1/ndbapi_async1.cpp
+++ b/storage/ndb/ndbapi-examples/ndbapi_async1/ndbapi_async1.cpp
@@ -75,7 +75,7 @@ int main(int argc, char** argv)
exit(-1);
}
- if (cluster_connection->wait_until_ready(30,0))
+ if (cluster_connection->wait_until_ready(30,0) < 0)
{
std::cout << "Cluster was not ready within 30 secs." << std::endl;
exit(-1);
diff --git a/storage/ndb/ndbapi-examples/ndbapi_simple/ndbapi_simple.cpp b/storage/ndb/ndbapi-examples/ndbapi_simple/ndbapi_simple.cpp
index 0a4f6d92f2c..4e82fc3e42b 100644
--- a/storage/ndb/ndbapi-examples/ndbapi_simple/ndbapi_simple.cpp
+++ b/storage/ndb/ndbapi-examples/ndbapi_simple/ndbapi_simple.cpp
@@ -281,12 +281,14 @@ static void do_read(Ndb &myNdb)
if (myRecAttr == NULL) APIERROR(myTransaction->getNdbError());
if(myTransaction->execute( NdbTransaction::Commit ) == -1)
- if (i == 3) {
- std::cout << "Detected that deleted tuple doesn't exist!" << std::endl;
- } else {
- APIERROR(myTransaction->getNdbError());
- }
+ APIERROR(myTransaction->getNdbError());
+ if (myTransaction->getNdbError().classification == NdbError::NoDataFound)
+ if (i == 3)
+ std::cout << "Detected that deleted tuple doesn't exist!" << std::endl;
+ else
+ APIERROR(myTransaction->getNdbError());
+
if (i != 3) {
printf(" %2d %2d\n", i, myRecAttr->u_32_value());
}
diff --git a/storage/ndb/ndbapi-examples/ndbapi_simple_dual/Makefile b/storage/ndb/ndbapi-examples/ndbapi_simple_dual/Makefile
index 7f0ca52fcc3..9757df3ceab 100644
--- a/storage/ndb/ndbapi-examples/ndbapi_simple_dual/Makefile
+++ b/storage/ndb/ndbapi-examples/ndbapi_simple_dual/Makefile
@@ -1,6 +1,6 @@
TARGET = ndbapi_simple_dual
-SRCS = $(TARGET).cpp
-OBJS = $(TARGET).o
+SRCS = main.cpp
+OBJS = main.o
CXX = g++
CFLAGS = -c -Wall -fno-rtti -fno-exceptions
CXXFLAGS =
@@ -17,7 +17,7 @@ SYS_LIB =
$(TARGET): $(OBJS)
$(CXX) $(CXXFLAGS) $(LFLAGS) $(LIB_DIR) $(OBJS) -lndbclient -lmysqlclient_r -lmysys -lmystrings -lz $(SYS_LIB) -o $(TARGET)
-$(TARGET).o: $(SRCS)
+$(OBJS): $(SRCS)
$(CXX) $(CFLAGS) -I$(TOP_SRCDIR)/include -I$(INCLUDE_DIR) -I$(INCLUDE_DIR)/ndbapi $(SRCS)
clean:
diff --git a/storage/ndb/ndbapi-examples/ndbapi_simple_dual/ndbapi_simple_dual.cpp b/storage/ndb/ndbapi-examples/ndbapi_simple_dual/main.cpp
index 5943894a3ee..5943894a3ee 100644
--- a/storage/ndb/ndbapi-examples/ndbapi_simple_dual/ndbapi_simple_dual.cpp
+++ b/storage/ndb/ndbapi-examples/ndbapi_simple_dual/main.cpp
diff --git a/storage/ndb/ndbapi-examples/ndbapi_simple_index/Makefile b/storage/ndb/ndbapi-examples/ndbapi_simple_index/Makefile
index c38975381f5..975563b9508 100644
--- a/storage/ndb/ndbapi-examples/ndbapi_simple_index/Makefile
+++ b/storage/ndb/ndbapi-examples/ndbapi_simple_index/Makefile
@@ -1,6 +1,6 @@
TARGET = ndbapi_simple_index
-SRCS = $(TARGET).cpp
-OBJS = $(TARGET).o
+SRCS = main.cpp
+OBJS = main.o
CXX = g++
CFLAGS = -c -Wall -fno-rtti -fno-exceptions
CXXFLAGS =
@@ -17,7 +17,7 @@ SYS_LIB =
$(TARGET): $(OBJS)
$(CXX) $(CXXFLAGS) $(LFLAGS) $(LIB_DIR) $(OBJS) -lndbclient -lmysqlclient_r -lmysys -lmystrings -lz $(SYS_LIB) -o $(TARGET)
-$(TARGET).o: $(SRCS)
+$(OBJS): $(SRCS)
$(CXX) $(CFLAGS) -I$(INCLUDE_DIR)/include -I$(INCLUDE_DIR)/storage/ndb/include -I$(INCLUDE_DIR)/storage/ndb/include/ndbapi $(SRCS)
clean:
diff --git a/storage/ndb/ndbapi-examples/ndbapi_simple_index/ndbapi_simple_index.cpp b/storage/ndb/ndbapi-examples/ndbapi_simple_index/main.cpp
index 440face79ae..440face79ae 100644
--- a/storage/ndb/ndbapi-examples/ndbapi_simple_index/ndbapi_simple_index.cpp
+++ b/storage/ndb/ndbapi-examples/ndbapi_simple_index/main.cpp
diff --git a/storage/ndb/src/common/debugger/signaldata/SignalNames.cpp b/storage/ndb/src/common/debugger/signaldata/SignalNames.cpp
index 884a49b3a94..0d31cd5de7f 100644
--- a/storage/ndb/src/common/debugger/signaldata/SignalNames.cpp
+++ b/storage/ndb/src/common/debugger/signaldata/SignalNames.cpp
@@ -621,6 +621,14 @@ const GsnName SignalNames [] = {
,{ GSN_LCP_PREPARE_REF, "LCP_PREPARE_REF" }
,{ GSN_LCP_PREPARE_CONF, "LCP_PREPARE_CONF" }
+ ,{ GSN_DICT_ABORT_REQ, "DICT_ABORT_REQ" }
+ ,{ GSN_DICT_ABORT_REF, "DICT_ABORT_REF" }
+ ,{ GSN_DICT_ABORT_CONF, "DICT_ABORT_CONF" }
+
+ ,{ GSN_DICT_COMMIT_REQ, "DICT_COMMIT_REQ" }
+ ,{ GSN_DICT_COMMIT_REF, "DICT_COMMIT_REF" }
+ ,{ GSN_DICT_COMMIT_CONF, "DICT_COMMIT_CONF" }
+
/* DICT LOCK */
,{ GSN_DICT_LOCK_REQ, "DICT_LOCK_REQ" }
,{ GSN_DICT_LOCK_CONF, "DICT_LOCK_CONF" }
diff --git a/storage/ndb/src/common/portlib/NdbTick.c b/storage/ndb/src/common/portlib/NdbTick.c
index 238e9b1956d..7e54984794f 100644
--- a/storage/ndb/src/common/portlib/NdbTick.c
+++ b/storage/ndb/src/common/portlib/NdbTick.c
@@ -15,7 +15,7 @@
#include <ndb_global.h>
-#include "NdbTick.h"
+#include <NdbTick.h>
#define NANOSEC_PER_SEC 1000000000
#define MICROSEC_PER_SEC 1000000
@@ -71,7 +71,6 @@ NdbTick_CurrentMicrosecond(NDB_TICKS * secs, Uint32 * micros){
}
#endif
-#ifdef TIME_MEASUREMENT
int
NdbTick_getMicroTimer(struct MicroSecondTimer* input_timer)
{
@@ -102,4 +101,3 @@ NdbTick_getMicrosPassed(struct MicroSecondTimer start,
}
return ret_value;
}
-#endif
diff --git a/storage/ndb/src/common/transporter/Packer.cpp b/storage/ndb/src/common/transporter/Packer.cpp
index 1045c8ac283..df7ff078e63 100644
--- a/storage/ndb/src/common/transporter/Packer.cpp
+++ b/storage/ndb/src/common/transporter/Packer.cpp
@@ -20,7 +20,12 @@
#include <TransporterCallback.hpp>
#include <RefConvert.hpp>
+#ifdef ERROR_INSERT
+Uint32 MAX_RECEIVED_SIGNALS = 1024;
+#else
#define MAX_RECEIVED_SIGNALS 1024
+#endif
+
Uint32
TransporterRegistry::unpack(Uint32 * readPtr,
Uint32 sizeOfData,
diff --git a/storage/ndb/src/common/transporter/SCI_Transporter.cpp b/storage/ndb/src/common/transporter/SCI_Transporter.cpp
index 138b79acb51..0720fe84973 100644
--- a/storage/ndb/src/common/transporter/SCI_Transporter.cpp
+++ b/storage/ndb/src/common/transporter/SCI_Transporter.cpp
@@ -65,13 +65,10 @@ SCI_Transporter::SCI_Transporter(TransporterRegistry &t_reg,
m_initLocal=false;
- m_swapCounter=0;
m_failCounter=0;
m_remoteNodes[0]=remoteSciNodeId0;
m_remoteNodes[1]=remoteSciNodeId1;
m_adapters = nAdapters;
- // The maximum number of times to try and create,
- // start and destroy a sequence
m_ActiveAdapterId=0;
m_StandbyAdapterId=1;
@@ -102,8 +99,6 @@ SCI_Transporter::SCI_Transporter(TransporterRegistry &t_reg,
DBUG_VOID_RETURN;
}
-
-
void SCI_Transporter::disconnectImpl()
{
DBUG_ENTER("SCI_Transporter::disconnectImpl");
@@ -129,7 +124,8 @@ void SCI_Transporter::disconnectImpl()
if(err != SCI_ERR_OK) {
report_error(TE_SCI_UNABLE_TO_CLOSE_CHANNEL);
- DBUG_PRINT("error", ("Cannot close channel to the driver. Error code 0x%x",
+ DBUG_PRINT("error",
+ ("Cannot close channel to the driver. Error code 0x%x",
err));
}
}
@@ -164,19 +160,18 @@ bool SCI_Transporter::initTransporter() {
m_sendBuffer.m_buffer = new Uint32[m_sendBuffer.m_sendBufferSize / 4];
m_sendBuffer.m_dataSize = 0;
- DBUG_PRINT("info", ("Created SCI Send Buffer with buffer size %d and packet size %d",
+ DBUG_PRINT("info",
+ ("Created SCI Send Buffer with buffer size %d and packet size %d",
m_sendBuffer.m_sendBufferSize, m_PacketSize * 4));
if(!getLinkStatus(m_ActiveAdapterId) ||
(m_adapters > 1 &&
!getLinkStatus(m_StandbyAdapterId))) {
- DBUG_PRINT("error", ("The link is not fully operational. Check the cables and the switches"));
- //reportDisconnect(remoteNodeId, 0);
- //doDisconnect();
+ DBUG_PRINT("error",
+ ("The link is not fully operational. Check the cables and the switches"));
//NDB should terminate
report_error(TE_SCI_LINK_ERROR);
DBUG_RETURN(false);
}
-
DBUG_RETURN(true);
} // initTransporter()
@@ -235,7 +230,8 @@ sci_error_t SCI_Transporter::initLocalSegment() {
DBUG_PRINT("info", ("SCInode iD %d adapter %d\n",
sciAdapters[i].localSciNodeId, i));
if(err != SCI_ERR_OK) {
- DBUG_PRINT("error", ("Cannot open an SCI virtual device. Error code 0x%x",
+ DBUG_PRINT("error",
+ ("Cannot open an SCI virtual device. Error code 0x%x",
err));
DBUG_RETURN(err);
}
@@ -269,7 +265,8 @@ sci_error_t SCI_Transporter::initLocalSegment() {
&err);
if(err != SCI_ERR_OK) {
- DBUG_PRINT("error", ("Local Segment is not accessible by an SCI adapter. Error code 0x%x\n",
+ DBUG_PRINT("error",
+ ("Local Segment is not accessible by an SCI adapter. Error code 0x%x\n",
err));
DBUG_RETURN(err);
}
@@ -303,15 +300,13 @@ sci_error_t SCI_Transporter::initLocalSegment() {
&err);
if(err != SCI_ERR_OK) {
- DBUG_PRINT("error", ("Local Segment is not available for remote connections. Error code 0x%x\n",
+ DBUG_PRINT("error",
+ ("Local Segment is not available for remote connections. Error code 0x%x\n",
err));
DBUG_RETURN(err);
}
}
-
-
setupLocalSegment();
-
DBUG_RETURN(err);
} // initLocalSegment()
@@ -343,12 +338,6 @@ bool SCI_Transporter::doSend() {
if(sizeToSend==4097)
i4097++;
#endif
- if(startSequence(m_ActiveAdapterId)!=SCI_ERR_OK) {
- DBUG_PRINT("error", ("Start sequence failed"));
- report_error(TE_SCI_UNABLE_TO_START_SEQUENCE);
- return false;
- }
-
tryagain:
retry++;
@@ -374,119 +363,36 @@ bool SCI_Transporter::doSend() {
SCI_FLAG_ERROR_CHECK,
&err);
-
if (err != SCI_ERR_OK) {
- if(err == SCI_ERR_OUT_OF_RANGE) {
- DBUG_PRINT("error", ("Data transfer : out of range error"));
- goto tryagain;
- }
- if(err == SCI_ERR_SIZE_ALIGNMENT) {
- DBUG_PRINT("error", ("Data transfer : alignment error"));
- DBUG_PRINT("info", ("sendPtr 0x%x, sizeToSend = %d", sendPtr, sizeToSend));
- goto tryagain;
- }
- if(err == SCI_ERR_OFFSET_ALIGNMENT) {
- DBUG_PRINT("error", ("Data transfer : offset alignment"));
- goto tryagain;
- }
- if(err == SCI_ERR_TRANSFER_FAILED) {
- //(m_TargetSegm[m_StandbyAdapterId].writer)->heavyLock();
- if(getLinkStatus(m_ActiveAdapterId)) {
- goto tryagain;
- }
- if (m_adapters == 1) {
- DBUG_PRINT("error", ("SCI Transfer failed"));
+ if (err == SCI_ERR_OUT_OF_RANGE ||
+ err == SCI_ERR_SIZE_ALIGNMENT ||
+ err == SCI_ERR_OFFSET_ALIGNMENT) {
+ DBUG_PRINT("error", ("Data transfer error = %d", err));
report_error(TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR);
return false;
- }
- m_failCounter++;
- Uint32 temp=m_ActiveAdapterId;
- switch(m_swapCounter) {
- case 0:
- /**swap from active (0) to standby (1)*/
- if(getLinkStatus(m_StandbyAdapterId)) {
- DBUG_PRINT("error", ("Swapping from adapter 0 to 1"));
+ }
+ if(err == SCI_ERR_TRANSFER_FAILED) {
+ if(getLinkStatus(m_ActiveAdapterId))
+ goto tryagain;
+ if (m_adapters == 1) {
+ DBUG_PRINT("error", ("SCI Transfer failed"));
+ report_error(TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR);
+ return false;
+ }
+ m_failCounter++;
+ Uint32 temp=m_ActiveAdapterId;
+ if (getLinkStatus(m_StandbyAdapterId)) {
failoverShmWriter();
SCIStoreBarrier(m_TargetSegm[m_StandbyAdapterId].sequence,0);
m_ActiveAdapterId=m_StandbyAdapterId;
m_StandbyAdapterId=temp;
- SCIRemoveSequence((m_TargetSegm[m_StandbyAdapterId].sequence),
- FLAGS,
- &err);
- if(err!=SCI_ERR_OK) {
- report_error(TE_SCI_UNABLE_TO_REMOVE_SEQUENCE);
- DBUG_PRINT("error", ("Unable to remove sequence"));
- return false;
- }
- if(startSequence(m_ActiveAdapterId)!=SCI_ERR_OK) {
- DBUG_PRINT("error", ("Start sequence failed"));
- report_error(TE_SCI_UNABLE_TO_START_SEQUENCE);
- return false;
- }
- m_swapCounter++;
- DBUG_PRINT("info", ("failover complete"));
- goto tryagain;
- } else {
- report_error(TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR);
- DBUG_PRINT("error", ("SCI Transfer failed"));
- return false;
- }
- return false;
- break;
- case 1:
- /** swap back from 1 to 0
- must check that the link is up */
-
- if(getLinkStatus(m_StandbyAdapterId)) {
- failoverShmWriter();
- m_ActiveAdapterId=m_StandbyAdapterId;
- m_StandbyAdapterId=temp;
- DBUG_PRINT("info", ("Swapping from 1 to 0"));
- if(createSequence(m_ActiveAdapterId)!=SCI_ERR_OK) {
- DBUG_PRINT("error", ("Unable to create sequence"));
- report_error(TE_SCI_UNABLE_TO_CREATE_SEQUENCE);
- return false;
- }
- if(startSequence(m_ActiveAdapterId)!=SCI_ERR_OK) {
- DBUG_PRINT("error", ("startSequence failed... disconnecting"));
- report_error(TE_SCI_UNABLE_TO_START_SEQUENCE);
- return false;
- }
-
- SCIRemoveSequence((m_TargetSegm[m_StandbyAdapterId].sequence)
- , FLAGS,
- &err);
- if(err!=SCI_ERR_OK) {
- DBUG_PRINT("error", ("Unable to remove sequence"));
- report_error(TE_SCI_UNABLE_TO_REMOVE_SEQUENCE);
- return false;
- }
-
- if(createSequence(m_StandbyAdapterId)!=SCI_ERR_OK) {
- DBUG_PRINT("error", ("Unable to create sequence on standby"));
- report_error(TE_SCI_UNABLE_TO_CREATE_SEQUENCE);
- return false;
- }
-
- m_swapCounter=0;
-
- DBUG_PRINT("info", ("failover complete.."));
- goto tryagain;
-
+ DBUG_PRINT("error", ("Swapping from adapter %u to %u",
+ m_StandbyAdapterId, m_ActiveAdapterId));
} else {
- DBUG_PRINT("error", ("Unrecoverable data transfer error"));
report_error(TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR);
- return false;
+ DBUG_PRINT("error", ("SCI Transfer failed"));
}
-
- break;
- default:
- DBUG_PRINT("error", ("Unrecoverable data transfer error"));
- report_error(TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR);
- return false;
- break;
- }
- }
+ }
} else {
SHM_Writer * writer = (m_TargetSegm[m_ActiveAdapterId].writer);
writer->updateWritePtr(sizeToSend);
@@ -497,7 +403,6 @@ bool SCI_Transporter::doSend() {
m_sendBuffer.m_dataSize = 0;
m_sendBuffer.m_forceSendLimit = sendLimit;
}
-
} else {
/**
* If we end up here, the SCI segment is full.
@@ -552,15 +457,12 @@ void SCI_Transporter::setupLocalSegment()
DBUG_VOID_RETURN;
} //setupLocalSegment
-
-
void SCI_Transporter::setupRemoteSegment()
{
DBUG_ENTER("SCI_Transporter::setupRemoteSegment");
Uint32 sharedSize = 0;
sharedSize =4096; //start of the buffer is page aligned
-
Uint32 sizeOfBuffer = m_BufferSize;
const Uint32 slack = MAX_MESSAGE_SIZE;
sizeOfBuffer -= sharedSize;
@@ -666,7 +568,6 @@ SCI_Transporter::init_remote()
DBUG_PRINT("error", ("Error connecting segment, err 0x%x", err));
DBUG_RETURN(false);
}
-
}
// Map the remote memory segment into program space
for(Uint32 i=0; i < m_adapters ; i++) {
@@ -679,13 +580,14 @@ SCI_Transporter::init_remote()
FLAGS,
&err);
-
- if(err!= SCI_ERR_OK) {
- DBUG_PRINT("error", ("Cannot map a segment to the remote node %d. Error code 0x%x",m_RemoteSciNodeId, err));
- //NDB SHOULD TERMINATE AND COMPUTER REBOOTED!
- report_error(TE_SCI_CANNOT_MAP_REMOTESEGMENT);
- DBUG_RETURN(false);
- }
+ if(err!= SCI_ERR_OK) {
+ DBUG_PRINT("error",
+ ("Cannot map a segment to the remote node %d. Error code 0x%x",
+ m_RemoteSciNodeId, err));
+ //NDB SHOULD TERMINATE AND COMPUTER REBOOTED!
+ report_error(TE_SCI_CANNOT_MAP_REMOTESEGMENT);
+ DBUG_RETURN(false);
+ }
}
m_mapped=true;
setupRemoteSegment();
@@ -713,7 +615,6 @@ SCI_Transporter::connect_client_impl(NDB_SOCKET_TYPE sockfd)
NDB_CLOSE_SOCKET(sockfd);
DBUG_RETURN(false);
}
-
if (!init_local()) {
NDB_CLOSE_SOCKET(sockfd);
DBUG_RETURN(false);
@@ -788,29 +689,9 @@ sci_error_t SCI_Transporter::createSequence(Uint32 adapterid) {
&(m_TargetSegm[adapterid].sequence),
SCI_FLAG_FAST_BARRIER,
&err);
-
-
return err;
} // createSequence()
-
-sci_error_t SCI_Transporter::startSequence(Uint32 adapterid) {
-
- sci_error_t err;
- /** Perform preliminary error check on an SCI adapter before starting a
- * sequence of read and write operations on the mapped segment.
- */
- m_SequenceStatus = SCIStartSequence(
- (m_TargetSegm[adapterid].sequence),
- FLAGS, &err);
-
-
- // If there still is an error then data cannot be safely send
- return err;
-} // startSequence()
-
-
-
bool SCI_Transporter::disconnectLocal()
{
DBUG_ENTER("SCI_Transporter::disconnectLocal");
@@ -878,9 +759,6 @@ SCI_Transporter::~SCI_Transporter() {
DBUG_VOID_RETURN;
} // ~SCI_Transporter()
-
-
-
void SCI_Transporter::closeSCI() {
// Termination of SCI
sci_error_t err;
@@ -897,8 +775,9 @@ void SCI_Transporter::closeSCI() {
SCIClose(activeSCIDescriptor, FLAGS, &err);
if(err != SCI_ERR_OK) {
- DBUG_PRINT("error", ("Cannot close SCI channel to the driver. Error code 0x%x",
- err));
+ DBUG_PRINT("error",
+ ("Cannot close SCI channel to the driver. Error code 0x%x",
+ err));
}
SCITerminate();
DBUG_VOID_RETURN;
@@ -973,7 +852,6 @@ SCI_Transporter::getConnectionStatus() {
return false;
}
-
void
SCI_Transporter::setConnected() {
*m_remoteStatusFlag = SCICONNECTED;
@@ -983,7 +861,6 @@ SCI_Transporter::setConnected() {
*m_localStatusFlag = SCICONNECTED;
}
-
void
SCI_Transporter::setDisconnect() {
if(getLinkStatus(m_ActiveAdapterId))
@@ -994,7 +871,6 @@ SCI_Transporter::setDisconnect() {
}
}
-
bool
SCI_Transporter::checkConnected() {
if (*m_localStatusFlag == SCIDISCONNECT) {
@@ -1015,8 +891,9 @@ SCI_Transporter::initSCI() {
SCIInitialize(0, &error);
if(error != SCI_ERR_OK) {
DBUG_PRINT("error", ("Cannot initialize SISCI library."));
- DBUG_PRINT("error", ("Inconsistency between SISCI library and SISCI driver. Error code 0x%x",
- error));
+ DBUG_PRINT("error",
+ ("Inconsistency between SISCI library and SISCI driver. Error code 0x%x",
+ error));
DBUG_RETURN(false);
}
init = true;
@@ -1029,3 +906,4 @@ SCI_Transporter::get_free_buffer() const
{
return (m_TargetSegm[m_ActiveAdapterId].writer)->get_free_buffer();
}
+
diff --git a/storage/ndb/src/common/transporter/SCI_Transporter.hpp b/storage/ndb/src/common/transporter/SCI_Transporter.hpp
index fbba2ac4516..f774186f238 100644
--- a/storage/ndb/src/common/transporter/SCI_Transporter.hpp
+++ b/storage/ndb/src/common/transporter/SCI_Transporter.hpp
@@ -54,12 +54,12 @@
* local segment, the SCI transporter connects to a segment created by another
* transporter at a remote node, and the maps the remote segment into its
* virtual address space. However, since NDB Cluster relies on redundancy
- * at the network level, by using dual SCI adapters communica
- *
+ * at the network level, by using dual SCI adapters communication can be
+ * maintained even if one of the adapter cards fails (or anything on the
+ * network this adapter card exists in e.g. an SCI switch failure).
*
*/
-
/**
* class SCITransporter
* @brief - main class for the SCI transporter.
@@ -84,16 +84,6 @@ public:
sci_error_t createSequence(Uint32 adapterid);
- /**
- * starts a sequence for error checking.
- * The actual checking that a sequence is correct is done implicitly
- * in SCIMemCpy (in doSend).
- * @param adapterid the adapter on which to start the sequence.
- * @return SCI_ERR_OK if ok, otherwize something else.
- */
- sci_error_t startSequence(Uint32 adapterid);
-
-
/** Initiate Local Segment: create a memory segment,
* prepare a memory segment, map the local segment
* into memory space and make segment available.
@@ -159,7 +149,6 @@ private:
bool m_mapped;
bool m_initLocal;
bool m_sciinit;
- Uint32 m_swapCounter;
Uint32 m_failCounter;
/**
* For statistics on transfered packets
@@ -195,7 +184,6 @@ private:
*/
Uint32 m_reportFreq;
-
Uint32 m_adapters;
Uint32 m_numberOfRemoteNodes;
diff --git a/storage/ndb/src/common/transporter/TCP_Transporter.hpp b/storage/ndb/src/common/transporter/TCP_Transporter.hpp
index 211ace8f03d..ed1a154c944 100644
--- a/storage/ndb/src/common/transporter/TCP_Transporter.hpp
+++ b/storage/ndb/src/common/transporter/TCP_Transporter.hpp
@@ -102,6 +102,10 @@ private:
virtual void updateReceiveDataPtr(Uint32 bytesRead);
virtual Uint32 get_free_buffer() const;
+
+ inline bool hasReceiveData () const {
+ return receiveBuffer.sizeOfData > 0;
+ }
protected:
/**
* Setup client/server and perform connect/accept
diff --git a/storage/ndb/src/common/transporter/TransporterRegistry.cpp b/storage/ndb/src/common/transporter/TransporterRegistry.cpp
index f35217a9726..5f5f3c17b2d 100644
--- a/storage/ndb/src/common/transporter/TransporterRegistry.cpp
+++ b/storage/ndb/src/common/transporter/TransporterRegistry.cpp
@@ -739,16 +739,13 @@ TransporterRegistry::poll_SHM(Uint32 timeOutMillis)
Uint32
TransporterRegistry::poll_TCP(Uint32 timeOutMillis)
{
+ bool hasdata = false;
if (false && nTCPTransporters == 0)
{
tcpReadSelectReply = 0;
return 0;
}
- struct timeval timeout;
- timeout.tv_sec = timeOutMillis / 1000;
- timeout.tv_usec = (timeOutMillis % 1000) * 1000;
-
NDB_SOCKET_TYPE maxSocketValue = -1;
// Needed for TCP/IP connections
@@ -771,8 +768,15 @@ TransporterRegistry::poll_TCP(Uint32 timeOutMillis)
// Put the connected transporters in the socket read-set
FD_SET(socket, &tcpReadset);
}
+ hasdata |= t->hasReceiveData();
}
+ timeOutMillis = hasdata ? 0 : timeOutMillis;
+
+ struct timeval timeout;
+ timeout.tv_sec = timeOutMillis / 1000;
+ timeout.tv_usec = (timeOutMillis % 1000) * 1000;
+
// The highest socket value plus one
maxSocketValue++;
@@ -787,7 +791,7 @@ TransporterRegistry::poll_TCP(Uint32 timeOutMillis)
}
#endif
- return tcpReadSelectReply;
+ return tcpReadSelectReply || hasdata;
}
#endif
@@ -796,26 +800,27 @@ void
TransporterRegistry::performReceive()
{
#ifdef NDB_TCP_TRANSPORTER
- if(tcpReadSelectReply > 0)
+ for (int i=0; i<nTCPTransporters; i++)
{
- for (int i=0; i<nTCPTransporters; i++)
- {
- checkJobBuffer();
- TCP_Transporter *t = theTCPTransporters[i];
- const NodeId nodeId = t->getRemoteNodeId();
- const NDB_SOCKET_TYPE socket = t->getSocket();
- if(is_connected(nodeId)){
- if(t->isConnected() && FD_ISSET(socket, &tcpReadset))
+ checkJobBuffer();
+ TCP_Transporter *t = theTCPTransporters[i];
+ const NodeId nodeId = t->getRemoteNodeId();
+ const NDB_SOCKET_TYPE socket = t->getSocket();
+ if(is_connected(nodeId)){
+ if(t->isConnected())
+ {
+ if (FD_ISSET(socket, &tcpReadset))
{
- const int receiveSize = t->doReceive();
- if(receiveSize > 0)
- {
- Uint32 * ptr;
- Uint32 sz = t->getReceiveData(&ptr);
- transporter_recv_from(callbackObj, nodeId);
- Uint32 szUsed = unpack(ptr, sz, nodeId, ioStates[nodeId]);
- t->updateReceiveDataPtr(szUsed);
- }
+ t->doReceive();
+ }
+
+ if (t->hasReceiveData())
+ {
+ Uint32 * ptr;
+ Uint32 sz = t->getReceiveData(&ptr);
+ transporter_recv_from(callbackObj, nodeId);
+ Uint32 szUsed = unpack(ptr, sz, nodeId, ioStates[nodeId]);
+ t->updateReceiveDataPtr(szUsed);
}
}
}
diff --git a/storage/ndb/src/common/util/version.c b/storage/ndb/src/common/util/version.c
index f309a3d4ad5..56a92489131 100644
--- a/storage/ndb/src/common/util/version.c
+++ b/storage/ndb/src/common/util/version.c
@@ -20,26 +20,33 @@
#include <NdbEnv.h>
#include <NdbOut.hpp>
-Uint32 getMajor(Uint32 version) {
+Uint32 ndbGetMajor(Uint32 version) {
return (version >> 16) & 0xFF;
}
-Uint32 getMinor(Uint32 version) {
+Uint32 ndbGetMinor(Uint32 version) {
return (version >> 8) & 0xFF;
}
-Uint32 getBuild(Uint32 version) {
+Uint32 ndbGetBuild(Uint32 version) {
return (version >> 0) & 0xFF;
}
-Uint32 makeVersion(Uint32 major, Uint32 minor, Uint32 build) {
- return MAKE_VERSION(major, minor, build);
+Uint32 ndbMakeVersion(Uint32 major, Uint32 minor, Uint32 build) {
+ return NDB_MAKE_VERSION(major, minor, build);
}
-char ndb_version_string_buf[NDB_VERSION_STRING_BUF_SZ];
-const char * getVersionString(Uint32 version, const char * status,
- char *buf, unsigned sz)
+const char * ndbGetOwnVersionString()
+{
+ static char ndb_version_string_buf[NDB_VERSION_STRING_BUF_SZ];
+ return ndbGetVersionString(NDB_VERSION, NDB_VERSION_STATUS,
+ ndb_version_string_buf,
+ sizeof(ndb_version_string_buf));
+}
+
+const char * ndbGetVersionString(Uint32 version, const char * status,
+ char *buf, unsigned sz)
{
if (status && status[0] != 0)
basestring_snprintf(buf, sz,
diff --git a/storage/ndb/src/cw/cpcd/main.cpp b/storage/ndb/src/cw/cpcd/main.cpp
index f23a92b8010..d5c31d610cb 100644
--- a/storage/ndb/src/cw/cpcd/main.cpp
+++ b/storage/ndb/src/cw/cpcd/main.cpp
@@ -39,22 +39,22 @@ static const char *user = 0;
static struct my_option my_long_options[] =
{
{ "work-dir", 'w', "Work directory",
- (gptr*) &work_dir, (gptr*) &work_dir, 0,
+ (uchar**) &work_dir, (uchar**) &work_dir, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "port", 'p', "TCP port to listen on",
- (gptr*) &port, (gptr*) &port, 0,
+ (uchar**) &port, (uchar**) &port, 0,
GET_INT, REQUIRED_ARG, CPCD_DEFAULT_TCP_PORT, 0, 0, 0, 0, 0 },
{ "syslog", 'S', "Log events to syslog",
- (gptr*) &use_syslog, (gptr*) &use_syslog, 0,
+ (uchar**) &use_syslog, (uchar**) &use_syslog, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "logfile", 'L', "File to log events to",
- (gptr*) &logfile, (gptr*) &logfile, 0,
+ (uchar**) &logfile, (uchar**) &logfile, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "debug", 'D', "Enable debug mode",
- (gptr*) &debug, (gptr*) &debug, 0,
+ (uchar**) &debug, (uchar**) &debug, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "user", 'u', "Run as user",
- (gptr*) &user, (gptr*) &user, 0,
+ (uchar**) &user, (uchar**) &user, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff --git a/storage/ndb/src/kernel/blocks/ERROR_codes.txt b/storage/ndb/src/kernel/blocks/ERROR_codes.txt
index b3405679978..acfbf649522 100644
--- a/storage/ndb/src/kernel/blocks/ERROR_codes.txt
+++ b/storage/ndb/src/kernel/blocks/ERROR_codes.txt
@@ -1,12 +1,12 @@
Next QMGR 1
-Next NDBCNTR 1001
+Next NDBCNTR 1002
Next NDBFS 2000
Next DBACC 3002
Next DBTUP 4029
Next DBLQH 5045
-Next DBDICT 6007
-Next DBDIH 7183
-Next DBTC 8040
+Next DBDICT 6008
+Next DBDIH 7186
+Next DBTC 8053
Next CMVMI 9000
Next BACKUP 10038
Next DBUTIL 11002
@@ -75,6 +75,12 @@ Delay GCP_SAVEREQ by 10 secs
7180: Crash master during master-take-over in execMASTER_LCPCONF
+7183: Crash when receiving COPY_GCIREQ
+
+7184: Crash before starting next GCP after a node failure
+
+7185: Dont reply to COPY_GCI_REQ where reason == GCP
+
ERROR CODES FOR TESTING NODE FAILURE, LOCAL CHECKPOINT HANDLING:
-----------------------------------------------------------------
@@ -298,6 +304,10 @@ ABORT OF TCKEYREQ
8038 : Simulate API disconnect just after SCAN_TAB_REQ
+8052 : Simulate failure of TransactionBufferMemory allocation for OI lookup
+
+8051 : Simulate failure of allocation for saveINDXKEYINFO
+
CMVMI
-----
@@ -501,6 +511,7 @@ Dbdict:
6003 Crash in participant @ CreateTabReq::Prepare
6004 Crash in participant @ CreateTabReq::Commit
6005 Crash in participant @ CreateTabReq::CreateDrop
+6007 Fail on readTableFile for READ_TAB_FILE1 (28770)
Dbtup:
4014 - handleInsert - Out of undo buffer
@@ -523,3 +534,4 @@ Dbtup:
NDBCNTR:
1000: Crash insertion on SystemError::CopyFragRef
+1001: Delay sending NODE_FAILREP (to own node), until error is cleared
diff --git a/storage/ndb/src/kernel/blocks/backup/Backup.cpp b/storage/ndb/src/kernel/blocks/backup/Backup.cpp
index fc698d161e0..64e2c41aa69 100644
--- a/storage/ndb/src/kernel/blocks/backup/Backup.cpp
+++ b/storage/ndb/src/kernel/blocks/backup/Backup.cpp
@@ -448,6 +448,41 @@ Backup::execDUMP_STATE_ORD(Signal* signal)
filePtr.p->m_flags);
}
}
+
+ ndbout_c("m_curr_disk_write_speed: %u m_words_written_this_period: %u m_overflow_disk_write: %u",
+ m_curr_disk_write_speed, m_words_written_this_period, m_overflow_disk_write);
+ ndbout_c("m_reset_delay_used: %u m_reset_disk_speed_time: %llu",
+ m_reset_delay_used, (Uint64)m_reset_disk_speed_time);
+ for(c_backups.first(ptr); ptr.i != RNIL; c_backups.next(ptr))
+ {
+ ndbout_c("BackupRecord %u: BackupId: %u MasterRef: %x ClientRef: %x",
+ ptr.i, ptr.p->backupId, ptr.p->masterRef, ptr.p->clientRef);
+ ndbout_c(" State: %u", ptr.p->slaveState.getState());
+ ndbout_c(" noOfByte: %llu noOfRecords: %llu",
+ ptr.p->noOfBytes, ptr.p->noOfRecords);
+ ndbout_c(" noOfLogBytes: %llu noOfLogRecords: %llu",
+ ptr.p->noOfLogBytes, ptr.p->noOfLogRecords);
+ ndbout_c(" errorCode: %u", ptr.p->errorCode);
+ BackupFilePtr filePtr;
+ for(ptr.p->files.first(filePtr); filePtr.i != RNIL;
+ ptr.p->files.next(filePtr))
+ {
+ ndbout_c(" file %u: type: %u flags: H'%x tableId: %u fragmentId: %u",
+ filePtr.i, filePtr.p->fileType, filePtr.p->m_flags,
+ filePtr.p->tableId, filePtr.p->fragmentNo);
+ }
+ if (ptr.p->slaveState.getState() == SCANNING && ptr.p->dataFilePtr != RNIL)
+ {
+ c_backupFilePool.getPtr(filePtr, ptr.p->dataFilePtr);
+ OperationRecord & op = filePtr.p->operation;
+ Uint32 *tmp = NULL;
+ Uint32 sz = 0;
+ bool eof = FALSE;
+ bool ready = op.dataBuffer.getReadPtr(&tmp, &sz, &eof);
+ ndbout_c("ready: %s eof: %s", ready ? "TRUE" : "FALSE", eof ? "TRUE" : "FALSE");
+ }
+ }
+ return;
}
if(signal->theData[0] == 24){
/**
@@ -2771,6 +2806,8 @@ Backup::openFiles(Signal* signal, BackupRecordPtr ptr)
c_backupFilePool.getPtr(filePtr, ptr.p->dataFilePtr);
filePtr.p->m_flags |= BackupFile::BF_OPENING;
+ if (c_defaults.m_o_direct)
+ req->fileFlags |= FsOpenReq::OM_DIRECT;
req->userPointer = filePtr.i;
FsOpenReq::setVersion(req->fileNumber, 2);
FsOpenReq::setSuffix(req->fileNumber, FsOpenReq::S_DATA);
@@ -3553,10 +3590,10 @@ Backup::execBACKUP_FRAGMENT_REQ(Signal* signal)
ScanFragReq::setHoldLockFlag(req->requestInfo, 0);
ScanFragReq::setKeyinfoFlag(req->requestInfo, 0);
ScanFragReq::setAttrLen(req->requestInfo,attrLen);
+ ScanFragReq::setTupScanFlag(req->requestInfo, 1);
if (ptr.p->is_lcp())
{
ScanFragReq::setScanPrio(req->requestInfo, 1);
- ScanFragReq::setTupScanFlag(req->requestInfo, 1);
ScanFragReq::setNoDiskFlag(req->requestInfo, 1);
ScanFragReq::setLcpScanFlag(req->requestInfo, 1);
}
@@ -3745,12 +3782,31 @@ Backup::OperationRecord::newFragment(Uint32 tableId, Uint32 fragNo)
}
bool
-Backup::OperationRecord::fragComplete(Uint32 tableId, Uint32 fragNo)
+Backup::OperationRecord::fragComplete(Uint32 tableId, Uint32 fragNo, bool fill_record)
{
Uint32 * tmp;
const Uint32 footSz = sizeof(BackupFormat::DataFile::FragmentFooter) >> 2;
+ Uint32 sz = footSz + 1;
- if(dataBuffer.getWritePtr(&tmp, footSz + 1)) {
+ if (fill_record)
+ {
+ Uint32 * new_tmp;
+ if (!dataBuffer.getWritePtr(&tmp, sz))
+ return false;
+ new_tmp = tmp + sz;
+
+ if ((UintPtr)new_tmp & (sizeof(Page32)-1))
+ {
+ /* padding is needed to get full write */
+ new_tmp += 2 /* to fit empty header minimum 2 words*/;
+ new_tmp = (Uint32 *)(((UintPtr)new_tmp + sizeof(Page32)-1) &
+ ~(UintPtr)(sizeof(Page32)-1));
+ /* new write sz */
+ sz = new_tmp - tmp;
+ }
+ }
+
+ if(dataBuffer.getWritePtr(&tmp, sz)) {
jam();
* tmp = 0; // Finish record stream
tmp++;
@@ -3762,7 +3818,17 @@ Backup::OperationRecord::fragComplete(Uint32 tableId, Uint32 fragNo)
foot->FragmentNo = htonl(fragNo);
foot->NoOfRecords = htonl(noOfRecords);
foot->Checksum = htonl(0);
- dataBuffer.updateWritePtr(footSz + 1);
+
+ if (sz != footSz + 1)
+ {
+ tmp += footSz;
+ memset(tmp, 0, (sz - footSz - 1) * 4);
+ *tmp = htonl(BackupFormat::EMPTY_ENTRY);
+ tmp++;
+ *tmp = htonl(sz - footSz - 1);
+ }
+
+ dataBuffer.updateWritePtr(sz);
return true;
}//if
return false;
@@ -3864,8 +3930,13 @@ Backup::fragmentCompleted(Signal* signal, BackupFilePtr filePtr)
return;
}//if
+ BackupRecordPtr ptr LINT_SET_PTR;
+ c_backupPool.getPtr(ptr, filePtr.p->backupPtr);
+
OperationRecord & op = filePtr.p->operation;
- if(!op.fragComplete(filePtr.p->tableId, filePtr.p->fragmentNo)) {
+ if(!op.fragComplete(filePtr.p->tableId, filePtr.p->fragmentNo,
+ c_defaults.m_o_direct))
+ {
jam();
signal->theData[0] = BackupContinueB::BUFFER_FULL_FRAG_COMPLETE;
signal->theData[1] = filePtr.i;
@@ -3875,9 +3946,6 @@ Backup::fragmentCompleted(Signal* signal, BackupFilePtr filePtr)
filePtr.p->m_flags &= ~(Uint32)BackupFile::BF_SCAN_THREAD;
- BackupRecordPtr ptr LINT_SET_PTR;
- c_backupPool.getPtr(ptr, filePtr.p->backupPtr);
-
if (ptr.p->is_lcp())
{
ptr.p->slaveState.setState(STOPPING);
@@ -4914,6 +4982,8 @@ Backup::lcp_open_file(Signal* signal, BackupRecordPtr ptr)
FsOpenReq::OM_CREATE |
FsOpenReq::OM_APPEND |
FsOpenReq::OM_AUTOSYNC;
+ if (c_defaults.m_o_direct)
+ req->fileFlags |= FsOpenReq::OM_DIRECT;
FsOpenReq::v2_setCount(req->fileNumber, 0xFFFFFFFF);
req->auto_sync_size = c_defaults.m_disk_synch_size;
diff --git a/storage/ndb/src/kernel/blocks/backup/Backup.hpp b/storage/ndb/src/kernel/blocks/backup/Backup.hpp
index 32f2e14ac92..3fd9b2967fd 100644
--- a/storage/ndb/src/kernel/blocks/backup/Backup.hpp
+++ b/storage/ndb/src/kernel/blocks/backup/Backup.hpp
@@ -240,7 +240,7 @@ public:
* Once per fragment
*/
bool newFragment(Uint32 tableId, Uint32 fragNo);
- bool fragComplete(Uint32 tableId, Uint32 fragNo);
+ bool fragComplete(Uint32 tableId, Uint32 fragNo, bool fill_record);
/**
* Once per scan frag (next) req/conf
@@ -534,6 +534,7 @@ public:
Uint32 m_disk_write_speed;
Uint32 m_disk_synch_size;
Uint32 m_diskless;
+ Uint32 m_o_direct;
};
/**
diff --git a/storage/ndb/src/kernel/blocks/backup/BackupFormat.hpp b/storage/ndb/src/kernel/blocks/backup/BackupFormat.hpp
index ace9dfe5c79..20f8f6650be 100644
--- a/storage/ndb/src/kernel/blocks/backup/BackupFormat.hpp
+++ b/storage/ndb/src/kernel/blocks/backup/BackupFormat.hpp
@@ -32,7 +32,8 @@ struct BackupFormat {
TABLE_LIST = 4,
TABLE_DESCRIPTION = 5,
GCP_ENTRY = 6,
- FRAGMENT_INFO = 7
+ FRAGMENT_INFO = 7,
+ EMPTY_ENTRY = 8
};
struct FileHeader {
@@ -93,6 +94,13 @@ struct BackupFormat {
Uint32 NoOfRecords;
Uint32 Checksum;
};
+
+ /* optional padding for O_DIRECT */
+ struct EmptyEntry {
+ Uint32 SectionType;
+ Uint32 SectionLength;
+ /* not used data */
+ };
};
/**
diff --git a/storage/ndb/src/kernel/blocks/backup/BackupInit.cpp b/storage/ndb/src/kernel/blocks/backup/BackupInit.cpp
index 4faa02e494f..2cd2a8a2bee 100644
--- a/storage/ndb/src/kernel/blocks/backup/BackupInit.cpp
+++ b/storage/ndb/src/kernel/blocks/backup/BackupInit.cpp
@@ -148,10 +148,13 @@ Backup::execREAD_CONFIG_REQ(Signal* signal)
c_defaults.m_disk_write_speed = 10 * (1024 * 1024);
c_defaults.m_disk_write_speed_sr = 100 * (1024 * 1024);
c_defaults.m_disk_synch_size = 4 * (1024 * 1024);
-
+ c_defaults.m_o_direct = true;
+
Uint32 noBackups = 0, noTables = 0, noAttribs = 0, noFrags = 0;
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_DISCLESS,
&c_defaults.m_diskless));
+ ndb_mgm_get_int_parameter(p, CFG_DB_O_DIRECT,
+ &c_defaults.m_o_direct);
ndb_mgm_get_int_parameter(p, CFG_DB_CHECKPOINT_SPEED_SR,
&c_defaults.m_disk_write_speed_sr);
ndb_mgm_get_int_parameter(p, CFG_DB_CHECKPOINT_SPEED,
@@ -204,7 +207,7 @@ Backup::execREAD_CONFIG_REQ(Signal* signal)
/ sizeof(Page32);
// We need to allocate an additional of 2 pages. 1 page because of a bug in
// ArrayPool and another one for DICTTAINFO.
- c_pagePool.setSize(noPages + NO_OF_PAGES_META_FILE + 2);
+ c_pagePool.setSize(noPages + NO_OF_PAGES_META_FILE + 2, true);
{ // Init all tables
SLList<Table> tables(c_tablePool);
diff --git a/storage/ndb/src/kernel/blocks/backup/FsBuffer.hpp b/storage/ndb/src/kernel/blocks/backup/FsBuffer.hpp
index d26f36ccf40..bb0bbd6d770 100644
--- a/storage/ndb/src/kernel/blocks/backup/FsBuffer.hpp
+++ b/storage/ndb/src/kernel/blocks/backup/FsBuffer.hpp
@@ -270,8 +270,8 @@ FsBuffer::getReadPtr(Uint32 ** ptr, Uint32 * sz, bool * _eof){
* ptr = &Tp[Tr];
- DEBUG(ndbout_c("getReadPtr() Tr: %d Tw: %d Ts: %d Tm: %d sz1: %d -> %d",
- Tr, Tw, Ts, Tm, sz1, * sz));
+ DEBUG(ndbout_c("getReadPtr() Tr: %d Tmw: %d Ts: %d Tm: %d sz1: %d -> %d",
+ Tr, Tmw, Ts, Tm, sz1, * sz));
return true;
}
@@ -279,8 +279,8 @@ FsBuffer::getReadPtr(Uint32 ** ptr, Uint32 * sz, bool * _eof){
if(!m_eof){
* _eof = false;
- DEBUG(ndbout_c("getReadPtr() Tr: %d Tw: %d Ts: %d Tm: %d sz1: %d -> false",
- Tr, Tw, Ts, Tm, sz1));
+ DEBUG(ndbout_c("getReadPtr() Tr: %d Tmw: %d Ts: %d Tm: %d sz1: %d -> false",
+ Tr, Tmw, Ts, Tm, sz1));
return false;
}
@@ -289,8 +289,8 @@ FsBuffer::getReadPtr(Uint32 ** ptr, Uint32 * sz, bool * _eof){
* _eof = true;
* ptr = &Tp[Tr];
- DEBUG(ndbout_c("getReadPtr() Tr: %d Tw: %d Ts: %d Tm: %d sz1: %d -> %d eof",
- Tr, Tw, Ts, Tm, sz1, * sz));
+ DEBUG(ndbout_c("getReadPtr() Tr: %d Tmw: %d Ts: %d Tm: %d sz1: %d -> %d eof",
+ Tr, Tmw, Ts, Tm, sz1, * sz));
return false;
}
@@ -316,13 +316,13 @@ FsBuffer::getWritePtr(Uint32 ** ptr, Uint32 sz){
if(sz1 > sz){ // Note at least 1 word of slack
* ptr = &Tp[Tw];
- DEBUG(ndbout_c("getWritePtr(%d) Tr: %d Tw: %d Ts: %d sz1: %d -> true",
- sz, Tr, Tw, Ts, sz1));
+ DEBUG(ndbout_c("getWritePtr(%d) Tw: %d sz1: %d -> true",
+ sz, Tw, sz1));
return true;
}
- DEBUG(ndbout_c("getWritePtr(%d) Tr: %d Tw: %d Ts: %d sz1: %d -> false",
- sz, Tr, Tw, Ts, sz1));
+ DEBUG(ndbout_c("getWritePtr(%d) Tw: %d sz1: %d -> false",
+ sz, Tw, sz1));
return false;
}
@@ -339,11 +339,15 @@ FsBuffer::updateWritePtr(Uint32 sz){
m_free -= sz;
if(Tnew < Ts){
m_writeIndex = Tnew;
+ DEBUG(ndbout_c("updateWritePtr(%d) m_writeIndex: %d",
+ sz, m_writeIndex));
return;
}
memcpy(Tp, &Tp[Ts], (Tnew - Ts) << 2);
m_writeIndex = Tnew - Ts;
+ DEBUG(ndbout_c("updateWritePtr(%d) m_writeIndex: %d",
+ sz, m_writeIndex));
}
inline
diff --git a/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
index 3fe85de73e6..7a992587010 100644
--- a/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
+++ b/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
@@ -133,6 +133,7 @@ Cmvmi::~Cmvmi()
#ifdef ERROR_INSERT
NodeBitmask c_error_9000_nodes_mask;
+extern Uint32 MAX_RECEIVED_SIGNALS;
#endif
void Cmvmi::execNDB_TAMPER(Signal* signal)
@@ -162,6 +163,22 @@ void Cmvmi::execNDB_TAMPER(Signal* signal)
kill(getpid(), SIGABRT);
}
#endif
+
+#ifdef ERROR_INSERT
+ if (signal->theData[0] == 9003)
+ {
+ if (MAX_RECEIVED_SIGNALS < 1024)
+ {
+ MAX_RECEIVED_SIGNALS = 1024;
+ }
+ else
+ {
+ MAX_RECEIVED_SIGNALS = 1 + (rand() % 128);
+ }
+ ndbout_c("MAX_RECEIVED_SIGNALS: %d", MAX_RECEIVED_SIGNALS);
+ CLEAR_ERROR_INSERT_VALUE;
+ }
+#endif
}//execNDB_TAMPER()
void Cmvmi::execSET_LOGLEVELORD(Signal* signal)
diff --git a/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp b/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
index 4b2926d4981..63d22bd0a37 100644
--- a/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
+++ b/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
@@ -2137,6 +2137,7 @@ Dbacc::placeReadInLockQueue(OperationrecPtr lockOwnerPtr)
if (same && (lastbits & Operationrec::OP_ACC_LOCK_MODE))
{
jam();
+ opbits |= Operationrec::OP_LOCK_MODE; // Upgrade to X-lock
goto checkop;
}
@@ -5200,9 +5201,9 @@ void Dbacc::execEXPANDCHECK2(Signal* signal)
{
jamEntry();
- if(refToBlock(signal->getSendersBlockRef()) == DBLQH){
+ if(refToBlock(signal->getSendersBlockRef()) == DBLQH)
+ {
jam();
- reenable_expand_after_redo_log_exection_complete(signal);
return;
}
diff --git a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
index 66cd523f333..569958a6aa9 100644
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
@@ -86,6 +86,9 @@
#include <signaldata/CreateObj.hpp>
#include <SLList.hpp>
+#include <EventLogger.hpp>
+extern EventLogger g_eventLogger;
+
#define ZNOT_FOUND 626
#define ZALREADYEXIST 630
@@ -188,7 +191,7 @@ struct {
0, 0, 0, 0,
&Dbdict::drop_undofile_prepare_start, 0,
0,
- 0, 0,
+ 0, &Dbdict::drop_undofile_commit_complete,
0, 0, 0
}
};
@@ -695,6 +698,9 @@ void Dbdict::execFSCLOSECONF(Signal* signal)
case FsConnectRecord::OPEN_READ_SCHEMA2:
openSchemaFile(signal, 1, fsPtr.i, false, false);
break;
+ case FsConnectRecord::OPEN_READ_TAB_FILE2:
+ openTableFile(signal, 1, fsPtr.i, c_readTableRecord.tableId, false);
+ break;
default:
jamLine((fsPtr.p->fsState & 0xFFF));
ndbrequire(false);
@@ -796,6 +802,15 @@ void Dbdict::execFSREADCONF(Signal* signal)
readSchemaConf(signal ,fsPtr);
break;
case FsConnectRecord::READ_TAB_FILE1:
+ if(ERROR_INSERTED(6007)){
+ jam();
+ FsRef * const fsRef = (FsRef *)&signal->theData[0];
+ fsRef->userPointer = fsConf->userPointer;
+ fsRef->setErrorCode(fsRef->errorCode, NDBD_EXIT_AFS_UNKNOWN);
+ fsRef->osErrorCode = ~0; // Indicate local error
+ execFSREADREF(signal);
+ return;
+ }//Testing how DICT behave if read of file 1 fails (Bug#28770)
case FsConnectRecord::READ_TAB_FILE2:
jam();
readTableConf(signal ,fsPtr);
@@ -1070,8 +1085,11 @@ void Dbdict::readTableConf(Signal* signal,
void Dbdict::readTableRef(Signal* signal,
FsConnectRecordPtr fsPtr)
{
+ /**
+ * First close corrupt file
+ */
fsPtr.p->fsState = FsConnectRecord::OPEN_READ_TAB_FILE2;
- openTableFile(signal, 1, fsPtr.i, c_readTableRecord.tableId, false);
+ closeFile(signal, fsPtr.p->filePtr, fsPtr.i);
return;
}//Dbdict::readTableRef()
@@ -1371,18 +1389,36 @@ void Dbdict::readSchemaConf(Signal* signal,
for (Uint32 n = 0; n < xsf->noOfPages; n++) {
SchemaFile * sf = &xsf->schemaPage[n];
- bool ok =
- memcmp(sf->Magic, NDB_SF_MAGIC, sizeof(sf->Magic)) == 0 &&
- sf->FileSize != 0 &&
- sf->FileSize % NDB_SF_PAGE_SIZE == 0 &&
- sf->FileSize == sf0->FileSize &&
- sf->PageNumber == n &&
- computeChecksum((Uint32*)sf, NDB_SF_PAGE_SIZE_IN_WORDS) == 0;
- ndbrequireErr(ok || !crashInd, NDBD_EXIT_SR_SCHEMAFILE);
- if (! ok) {
- jam();
+ bool ok = false;
+ const char *reason;
+ if (memcmp(sf->Magic, NDB_SF_MAGIC, sizeof(sf->Magic)) != 0)
+ { jam(); reason = "magic code"; }
+ else if (sf->FileSize == 0)
+ { jam(); reason = "file size == 0"; }
+ else if (sf->FileSize % NDB_SF_PAGE_SIZE != 0)
+ { jam(); reason = "invalid size multiple"; }
+ else if (sf->FileSize != sf0->FileSize)
+ { jam(); reason = "invalid size"; }
+ else if (sf->PageNumber != n)
+ { jam(); reason = "invalid page number"; }
+ else if (computeChecksum((Uint32*)sf, NDB_SF_PAGE_SIZE_IN_WORDS) != 0)
+ { jam(); reason = "invalid checksum"; }
+ else
+ ok = true;
+
+ if (!ok)
+ {
+ char reason_msg[128];
+ snprintf(reason_msg, sizeof(reason_msg),
+ "schema file corrupt, page %u (%s, "
+ "sz=%u sz0=%u pn=%u)",
+ n, reason, sf->FileSize, sf0->FileSize, sf->PageNumber);
+ if (crashInd)
+ progError(__LINE__, NDBD_EXIT_SR_SCHEMAFILE, reason_msg);
ndbrequireErr(fsPtr.p->fsState == FsConnectRecord::READ_SCHEMA1,
NDBD_EXIT_SR_SCHEMAFILE);
+ jam();
+ infoEvent("primary %s, trying backup", reason_msg);
readSchemaRef(signal, fsPtr);
return;
}
@@ -3209,9 +3245,7 @@ Dbdict::restartDropTab(Signal* signal, Uint32 tableId,
case DictTabInfo::LogfileGroup:
case DictTabInfo::Datafile:
case DictTabInfo::Undofile:
- warningEvent("Dont drop object: %d", tableId);
- c_restartRecord.activeTable++;
- checkSchemaStatus(signal);
+ restartDropObj(signal, tableId, old_entry);
return;
}
@@ -3254,6 +3288,9 @@ Dbdict::restartDropTab_complete(Signal* signal,
checkSchemaStatus(signal);
}
+/**
+ * Create Obj during NR/SR
+ */
void
Dbdict::restartCreateObj(Signal* signal,
Uint32 tableId,
@@ -3482,6 +3519,170 @@ Dbdict::restartCreateObj_commit_complete_done(Signal* signal,
checkSchemaStatus(signal);
}
+/**
+ * Drop object during NR/SR
+ */
+void
+Dbdict::restartDropObj(Signal* signal,
+ Uint32 tableId,
+ const SchemaFile::TableEntry * entry)
+{
+ jam();
+
+ DropObjRecordPtr dropObjPtr;
+ ndbrequire(c_opDropObj.seize(dropObjPtr));
+
+ const Uint32 key = ++c_opRecordSequence;
+ dropObjPtr.p->key = key;
+ c_opDropObj.add(dropObjPtr);
+ dropObjPtr.p->m_errorCode = 0;
+ dropObjPtr.p->m_senderRef = reference();
+ dropObjPtr.p->m_senderData = tableId;
+ dropObjPtr.p->m_clientRef = reference();
+ dropObjPtr.p->m_clientData = tableId;
+
+ dropObjPtr.p->m_obj_id = tableId;
+ dropObjPtr.p->m_obj_type = entry->m_tableType;
+ dropObjPtr.p->m_obj_version = entry->m_tableVersion;
+
+ dropObjPtr.p->m_callback.m_callbackData = key;
+ dropObjPtr.p->m_callback.m_callbackFunction=
+ safe_cast(&Dbdict::restartDropObj_prepare_start_done);
+
+ ndbout_c("Dropping %d %d", tableId, entry->m_tableType);
+ switch(entry->m_tableType){
+ case DictTabInfo::Tablespace:
+ case DictTabInfo::LogfileGroup:{
+ jam();
+ Ptr<Filegroup> fg_ptr;
+ ndbrequire(c_filegroup_hash.find(fg_ptr, tableId));
+ dropObjPtr.p->m_obj_ptr_i = fg_ptr.i;
+ dropObjPtr.p->m_vt_index = 3;
+ break;
+ }
+ case DictTabInfo::Datafile:{
+ jam();
+ Ptr<File> file_ptr;
+ dropObjPtr.p->m_vt_index = 2;
+ ndbrequire(c_file_hash.find(file_ptr, tableId));
+ dropObjPtr.p->m_obj_ptr_i = file_ptr.i;
+ break;
+ }
+ case DictTabInfo::Undofile:{
+ jam();
+ Ptr<File> file_ptr;
+ dropObjPtr.p->m_vt_index = 4;
+ ndbrequire(c_file_hash.find(file_ptr, tableId));
+ dropObjPtr.p->m_obj_ptr_i = file_ptr.i;
+
+ /**
+ * Undofiles are only removed from logfile groups file list
+ * as drop undofile is currently not supported...
+ * file will be dropped by lgman when dropping filegroup
+ */
+ dropObjPtr.p->m_callback.m_callbackFunction=
+ safe_cast(&Dbdict::restartDropObj_commit_complete_done);
+
+ if (f_dict_op[dropObjPtr.p->m_vt_index].m_commit_complete)
+ (this->*f_dict_op[dropObjPtr.p->m_vt_index].m_commit_complete)
+ (signal, dropObjPtr.p);
+ else
+ execute(signal, dropObjPtr.p->m_callback, 0);
+ return;
+ }
+ default:
+ jamLine(entry->m_tableType);
+ ndbrequire(false);
+ }
+
+ if (f_dict_op[dropObjPtr.p->m_vt_index].m_prepare_start)
+ (this->*f_dict_op[dropObjPtr.p->m_vt_index].m_prepare_start)
+ (signal, dropObjPtr.p);
+ else
+ execute(signal, dropObjPtr.p->m_callback, 0);
+}
+
+void
+Dbdict::restartDropObj_prepare_start_done(Signal* signal,
+ Uint32 callbackData,
+ Uint32 returnCode)
+{
+ jam();
+ ndbrequire(returnCode == 0);
+ DropObjRecordPtr dropObjPtr;
+ ndbrequire(c_opDropObj.find(dropObjPtr, callbackData));
+ ndbrequire(dropObjPtr.p->m_errorCode == 0);
+
+ dropObjPtr.p->m_callback.m_callbackFunction =
+ safe_cast(&Dbdict::restartDropObj_prepare_complete_done);
+
+ if (f_dict_op[dropObjPtr.p->m_vt_index].m_prepare_complete)
+ (this->*f_dict_op[dropObjPtr.p->m_vt_index].m_prepare_complete)
+ (signal, dropObjPtr.p);
+ else
+ execute(signal, dropObjPtr.p->m_callback, 0);
+}
+
+void
+Dbdict::restartDropObj_prepare_complete_done(Signal* signal,
+ Uint32 callbackData,
+ Uint32 returnCode)
+{
+ jam();
+ ndbrequire(returnCode == 0);
+ DropObjRecordPtr dropObjPtr;
+ ndbrequire(c_opDropObj.find(dropObjPtr, callbackData));
+ ndbrequire(dropObjPtr.p->m_errorCode == 0);
+
+ dropObjPtr.p->m_callback.m_callbackFunction =
+ safe_cast(&Dbdict::restartDropObj_commit_start_done);
+
+ if (f_dict_op[dropObjPtr.p->m_vt_index].m_commit_start)
+ (this->*f_dict_op[dropObjPtr.p->m_vt_index].m_commit_start)
+ (signal, dropObjPtr.p);
+ else
+ execute(signal, dropObjPtr.p->m_callback, 0);
+}
+
+void
+Dbdict::restartDropObj_commit_start_done(Signal* signal,
+ Uint32 callbackData,
+ Uint32 returnCode)
+{
+ jam();
+ ndbrequire(returnCode == 0);
+ DropObjRecordPtr dropObjPtr;
+ ndbrequire(c_opDropObj.find(dropObjPtr, callbackData));
+ ndbrequire(dropObjPtr.p->m_errorCode == 0);
+
+ dropObjPtr.p->m_callback.m_callbackFunction =
+ safe_cast(&Dbdict::restartDropObj_commit_complete_done);
+
+ if (f_dict_op[dropObjPtr.p->m_vt_index].m_commit_complete)
+ (this->*f_dict_op[dropObjPtr.p->m_vt_index].m_commit_complete)
+ (signal, dropObjPtr.p);
+ else
+ execute(signal, dropObjPtr.p->m_callback, 0);
+}
+
+
+void
+Dbdict::restartDropObj_commit_complete_done(Signal* signal,
+ Uint32 callbackData,
+ Uint32 returnCode)
+{
+ jam();
+ ndbrequire(returnCode == 0);
+ DropObjRecordPtr dropObjPtr;
+ ndbrequire(c_opDropObj.find(dropObjPtr, callbackData));
+ ndbrequire(dropObjPtr.p->m_errorCode == 0);
+
+ c_opDropObj.release(dropObjPtr);
+
+ c_restartRecord.activeTable++;
+ checkSchemaStatus(signal);
+}
+
/* **************************************************************** */
/* ---------------------------------------------------------------- */
/* MODULE: NODE FAILURE HANDLING ------------------------- */
@@ -13968,7 +14169,8 @@ Dbdict::getTableEntry(XSchemaFile * xsf, Uint32 tableId)
//******************************************
void
-Dbdict::execCREATE_FILE_REQ(Signal* signal){
+Dbdict::execCREATE_FILE_REQ(Signal* signal)
+{
jamEntry();
if(!assembleFragments(signal)){
@@ -14013,13 +14215,14 @@ Dbdict::execCREATE_FILE_REQ(Signal* signal){
Ptr<SchemaTransaction> trans_ptr;
if (! c_Trans.seize(trans_ptr)){
+ jam();
ref->errorCode = CreateFileRef::Busy;
ref->status = 0;
ref->errorKey = 0;
ref->errorLine = __LINE__;
break;
}
-
+ jam();
const Uint32 trans_key = ++c_opRecordSequence;
trans_ptr.p->key = trans_key;
trans_ptr.p->m_senderRef = senderRef;
@@ -14048,6 +14251,7 @@ Dbdict::execCREATE_FILE_REQ(Signal* signal){
{
Uint32 objId = getFreeObjId(0);
if (objId == RNIL) {
+ jam();
ref->errorCode = CreateFileRef::NoMoreObjectRecords;
ref->status = 0;
ref->errorKey = 0;
@@ -14072,7 +14276,6 @@ Dbdict::execCREATE_FILE_REQ(Signal* signal){
CreateObjReq::SignalLength, JBB);
c_blockState = BS_CREATE_TAB;
-
return;
} while(0);
@@ -14083,7 +14286,8 @@ Dbdict::execCREATE_FILE_REQ(Signal* signal){
}
void
-Dbdict::execCREATE_FILEGROUP_REQ(Signal* signal){
+Dbdict::execCREATE_FILEGROUP_REQ(Signal* signal)
+{
jamEntry();
if(!assembleFragments(signal)){
@@ -14127,13 +14331,14 @@ Dbdict::execCREATE_FILEGROUP_REQ(Signal* signal){
Ptr<SchemaTransaction> trans_ptr;
if (! c_Trans.seize(trans_ptr)){
+ jam();
ref->errorCode = CreateFilegroupRef::Busy;
ref->status = 0;
ref->errorKey = 0;
ref->errorLine = __LINE__;
break;
}
-
+ jam();
const Uint32 trans_key = ++c_opRecordSequence;
trans_ptr.p->key = trans_key;
trans_ptr.p->m_senderRef = senderRef;
@@ -14159,6 +14364,7 @@ Dbdict::execCREATE_FILEGROUP_REQ(Signal* signal){
{
Uint32 objId = getFreeObjId(0);
if (objId == RNIL) {
+ jam();
ref->errorCode = CreateFilegroupRef::NoMoreObjectRecords;
ref->status = 0;
ref->errorKey = 0;
@@ -14183,7 +14389,6 @@ Dbdict::execCREATE_FILEGROUP_REQ(Signal* signal){
CreateObjReq::SignalLength, JBB);
c_blockState = BS_CREATE_TAB;
-
return;
} while(0);
@@ -14219,7 +14424,8 @@ Dbdict::execDROP_FILE_REQ(Signal* signal)
break;
}
- if (c_blockState != BS_IDLE){
+ if (c_blockState != BS_IDLE)
+ {
jam();
ref->errorCode = DropFileRef::Busy;
ref->errorKey = 0;
@@ -14229,6 +14435,7 @@ Dbdict::execDROP_FILE_REQ(Signal* signal)
if (checkSingleUserMode(senderRef))
{
+ jam();
ref->errorCode = DropFileRef::SingleUser;
ref->errorKey = 0;
ref->errorLine = __LINE__;
@@ -14238,6 +14445,7 @@ Dbdict::execDROP_FILE_REQ(Signal* signal)
Ptr<File> file_ptr;
if (!c_file_hash.find(file_ptr, objId))
{
+ jam();
ref->errorCode = DropFileRef::NoSuchFile;
ref->errorLine = __LINE__;
break;
@@ -14245,6 +14453,7 @@ Dbdict::execDROP_FILE_REQ(Signal* signal)
if (file_ptr.p->m_version != version)
{
+ jam();
ref->errorCode = DropFileRef::InvalidSchemaObjectVersion;
ref->errorLine = __LINE__;
break;
@@ -14253,10 +14462,12 @@ Dbdict::execDROP_FILE_REQ(Signal* signal)
Ptr<SchemaTransaction> trans_ptr;
if (! c_Trans.seize(trans_ptr))
{
+ jam();
ref->errorCode = DropFileRef::Busy;
ref->errorLine = __LINE__;
break;
}
+ jam();
const Uint32 trans_key = ++c_opRecordSequence;
trans_ptr.p->key = trans_key;
@@ -14292,7 +14503,6 @@ Dbdict::execDROP_FILE_REQ(Signal* signal)
DropObjReq::SignalLength, JBB);
c_blockState = BS_CREATE_TAB;
-
return;
} while(0);
@@ -14320,7 +14530,8 @@ Dbdict::execDROP_FILEGROUP_REQ(Signal* signal)
Uint32 version = req->filegroup_version;
do {
- if(getOwnNodeId() != c_masterNodeId){
+ if(getOwnNodeId() != c_masterNodeId)
+ {
jam();
ref->errorCode = DropFilegroupRef::NotMaster;
ref->errorKey = 0;
@@ -14328,7 +14539,8 @@ Dbdict::execDROP_FILEGROUP_REQ(Signal* signal)
break;
}
- if (c_blockState != BS_IDLE){
+ if (c_blockState != BS_IDLE)
+ {
jam();
ref->errorCode = DropFilegroupRef::Busy;
ref->errorKey = 0;
@@ -14338,6 +14550,7 @@ Dbdict::execDROP_FILEGROUP_REQ(Signal* signal)
if (checkSingleUserMode(senderRef))
{
+ jam();
ref->errorCode = DropFilegroupRef::SingleUser;
ref->errorKey = 0;
ref->errorLine = __LINE__;
@@ -14347,6 +14560,7 @@ Dbdict::execDROP_FILEGROUP_REQ(Signal* signal)
Ptr<Filegroup> filegroup_ptr;
if (!c_filegroup_hash.find(filegroup_ptr, objId))
{
+ jam();
ref->errorCode = DropFilegroupRef::NoSuchFilegroup;
ref->errorLine = __LINE__;
break;
@@ -14354,6 +14568,7 @@ Dbdict::execDROP_FILEGROUP_REQ(Signal* signal)
if (filegroup_ptr.p->m_version != version)
{
+ jam();
ref->errorCode = DropFilegroupRef::InvalidSchemaObjectVersion;
ref->errorLine = __LINE__;
break;
@@ -14362,10 +14577,12 @@ Dbdict::execDROP_FILEGROUP_REQ(Signal* signal)
Ptr<SchemaTransaction> trans_ptr;
if (! c_Trans.seize(trans_ptr))
{
+ jam();
ref->errorCode = DropFilegroupRef::Busy;
ref->errorLine = __LINE__;
break;
}
+ jam();
const Uint32 trans_key = ++c_opRecordSequence;
trans_ptr.p->key = trans_key;
@@ -14401,7 +14618,6 @@ Dbdict::execDROP_FILEGROUP_REQ(Signal* signal)
DropObjReq::SignalLength, JBB);
c_blockState = BS_CREATE_TAB;
-
return;
} while(0);
@@ -14412,15 +14628,15 @@ Dbdict::execDROP_FILEGROUP_REQ(Signal* signal)
}
void
-Dbdict::execCREATE_OBJ_REF(Signal* signal){
- jamEntry();
-
+Dbdict::execCREATE_OBJ_REF(Signal* signal)
+{
CreateObjRef * const ref = (CreateObjRef*)signal->getDataPtr();
-
Ptr<SchemaTransaction> trans_ptr;
+
+ jamEntry();
ndbrequire(c_Trans.find(trans_ptr, ref->senderData));
-
if(ref->errorCode != CreateObjRef::NF_FakeErrorREF){
+ jam();
trans_ptr.p->setErrorCode(ref->errorCode);
}
Uint32 node = refToNode(ref->senderRef);
@@ -14428,12 +14644,12 @@ Dbdict::execCREATE_OBJ_REF(Signal* signal){
}
void
-Dbdict::execCREATE_OBJ_CONF(Signal* signal){
- jamEntry();
-
- CreateObjConf * const conf = (CreateObjConf*)signal->getDataPtr();
-
+Dbdict::execCREATE_OBJ_CONF(Signal* signal)
+{
Ptr<SchemaTransaction> trans_ptr;
+ CreateObjConf * const conf = (CreateObjConf*)signal->getDataPtr();
+
+ jamEntry();
ndbrequire(c_Trans.find(trans_ptr, conf->senderData));
schemaOp_reply(signal, trans_ptr.p, refToNode(conf->senderRef));
}
@@ -14443,6 +14659,7 @@ Dbdict::schemaOp_reply(Signal* signal,
SchemaTransaction * trans_ptr_p,
Uint32 nodeId)
{
+ jam();
{
SafeCounter tmp(c_counterMgr, trans_ptr_p->m_counter);
if(!tmp.clearWaitingFor(nodeId)){
@@ -14453,10 +14670,8 @@ Dbdict::schemaOp_reply(Signal* signal,
switch(trans_ptr_p->m_op.m_state){
case DictObjOp::Preparing:{
-
if(trans_ptr_p->m_errorCode != 0)
{
- jam();
/**
* Failed to prepare on atleast one node -> abort on all
*/
@@ -14466,10 +14681,16 @@ Dbdict::schemaOp_reply(Signal* signal,
safe_cast(&Dbdict::trans_abort_start_done);
if(f_dict_op[trans_ptr_p->m_op.m_vt_index].m_trans_abort_start)
+ {
+ jam();
(this->*f_dict_op[trans_ptr_p->m_op.m_vt_index].m_trans_abort_start)
(signal, trans_ptr_p);
+ }
else
+ {
+ jam();
execute(signal, trans_ptr_p->m_callback, 0);
+ }
return;
}
@@ -14479,14 +14700,19 @@ Dbdict::schemaOp_reply(Signal* signal,
safe_cast(&Dbdict::trans_commit_start_done);
if(f_dict_op[trans_ptr_p->m_op.m_vt_index].m_trans_commit_start)
+ {
+ jam();
(this->*f_dict_op[trans_ptr_p->m_op.m_vt_index].m_trans_commit_start)
(signal, trans_ptr_p);
+ }
else
+ {
+ jam();
execute(signal, trans_ptr_p->m_callback, 0);
+ }
return;
}
case DictObjOp::Committing: {
- jam();
ndbrequire(trans_ptr_p->m_errorCode == 0);
trans_ptr_p->m_op.m_state = DictObjOp::Committed;
@@ -14495,31 +14721,42 @@ Dbdict::schemaOp_reply(Signal* signal,
safe_cast(&Dbdict::trans_commit_complete_done);
if(f_dict_op[trans_ptr_p->m_op.m_vt_index].m_trans_commit_complete)
+ {
+ jam();
(this->*f_dict_op[trans_ptr_p->m_op.m_vt_index].m_trans_commit_complete)
(signal, trans_ptr_p);
+ }
else
- execute(signal, trans_ptr_p->m_callback, 0);
+ {
+ jam();
+ execute(signal, trans_ptr_p->m_callback, 0);
+ }
return;
}
case DictObjOp::Aborting:{
- jam();
-
trans_ptr_p->m_op.m_state = DictObjOp::Committed;
trans_ptr_p->m_callback.m_callbackData = trans_ptr_p->key;
trans_ptr_p->m_callback.m_callbackFunction=
safe_cast(&Dbdict::trans_abort_complete_done);
if(f_dict_op[trans_ptr_p->m_op.m_vt_index].m_trans_abort_complete)
+ {
+ jam();
(this->*f_dict_op[trans_ptr_p->m_op.m_vt_index].m_trans_abort_complete)
(signal, trans_ptr_p);
+ }
else
- execute(signal, trans_ptr_p->m_callback, 0);
+ {
+ jam();
+ execute(signal, trans_ptr_p->m_callback, 0);
+ }
return;
}
case DictObjOp::Defined:
case DictObjOp::Prepared:
case DictObjOp::Committed:
case DictObjOp::Aborted:
+ jam();
break;
}
ndbrequire(false);
@@ -14528,14 +14765,13 @@ Dbdict::schemaOp_reply(Signal* signal,
void
Dbdict::trans_commit_start_done(Signal* signal,
Uint32 callbackData,
- Uint32 retValue){
- jamEntry();
-
- ndbrequire(retValue == 0);
-
+ Uint32 retValue)
+{
Ptr<SchemaTransaction> trans_ptr;
+
+ jam();
+ ndbrequire(retValue == 0);
ndbrequire(c_Trans.find(trans_ptr, callbackData));
-
NodeReceiverGroup rg(DBDICT, trans_ptr.p->m_nodes);
SafeCounter tmp(c_counterMgr, trans_ptr.p->m_counter);
tmp.init<DictCommitRef>(rg, GSN_DICT_COMMIT_REF, trans_ptr.p->key);
@@ -14546,27 +14782,26 @@ Dbdict::trans_commit_start_done(Signal* signal,
req->op_key = trans_ptr.p->m_op.m_key;
sendSignal(rg, GSN_DICT_COMMIT_REQ, signal, DictCommitReq::SignalLength,
JBB);
-
trans_ptr.p->m_op.m_state = DictObjOp::Committing;
}
void
Dbdict::trans_commit_complete_done(Signal* signal,
Uint32 callbackData,
- Uint32 retValue){
- jamEntry();
-
- ndbrequire(retValue == 0);
-
+ Uint32 retValue)
+{
Ptr<SchemaTransaction> trans_ptr;
+
+ jam();
+ ndbrequire(retValue == 0);
ndbrequire(c_Trans.find(trans_ptr, callbackData));
switch(f_dict_op[trans_ptr.p->m_op.m_vt_index].m_gsn_user_req){
case GSN_CREATE_FILEGROUP_REQ:{
FilegroupPtr fg_ptr;
+ jam();
ndbrequire(c_filegroup_hash.find(fg_ptr, trans_ptr.p->m_op.m_obj_id));
- //
CreateFilegroupConf * conf = (CreateFilegroupConf*)signal->getDataPtr();
conf->senderRef = reference();
conf->senderData = trans_ptr.p->m_senderData;
@@ -14576,11 +14811,11 @@ Dbdict::trans_commit_complete_done(Signal* signal,
//@todo check api failed
sendSignal(trans_ptr.p->m_senderRef, GSN_CREATE_FILEGROUP_CONF, signal,
CreateFilegroupConf::SignalLength, JBB);
-
break;
}
case GSN_CREATE_FILE_REQ:{
FilePtr f_ptr;
+ jam();
ndbrequire(c_file_hash.find(f_ptr, trans_ptr.p->m_op.m_obj_id));
CreateFileConf * conf = (CreateFileConf*)signal->getDataPtr();
conf->senderRef = reference();
@@ -14591,11 +14826,11 @@ Dbdict::trans_commit_complete_done(Signal* signal,
//@todo check api failed
sendSignal(trans_ptr.p->m_senderRef, GSN_CREATE_FILE_CONF, signal,
CreateFileConf::SignalLength, JBB);
-
break;
}
case GSN_DROP_FILE_REQ:{
DropFileConf * conf = (DropFileConf*)signal->getDataPtr();
+ jam();
conf->senderRef = reference();
conf->senderData = trans_ptr.p->m_senderData;
conf->fileId = trans_ptr.p->m_op.m_obj_id;
@@ -14607,6 +14842,7 @@ Dbdict::trans_commit_complete_done(Signal* signal,
}
case GSN_DROP_FILEGROUP_REQ:{
DropFilegroupConf * conf = (DropFilegroupConf*)signal->getDataPtr();
+ jam();
conf->senderRef = reference();
conf->senderData = trans_ptr.p->m_senderData;
conf->filegroupId = trans_ptr.p->m_op.m_obj_id;
@@ -14629,12 +14865,12 @@ Dbdict::trans_commit_complete_done(Signal* signal,
void
Dbdict::trans_abort_start_done(Signal* signal,
Uint32 callbackData,
- Uint32 retValue){
- jamEntry();
-
- ndbrequire(retValue == 0);
-
+ Uint32 retValue)
+{
Ptr<SchemaTransaction> trans_ptr;
+
+ jam();
+ ndbrequire(retValue == 0);
ndbrequire(c_Trans.find(trans_ptr, callbackData));
NodeReceiverGroup rg(DBDICT, trans_ptr.p->m_nodes);
@@ -14652,12 +14888,12 @@ Dbdict::trans_abort_start_done(Signal* signal,
void
Dbdict::trans_abort_complete_done(Signal* signal,
Uint32 callbackData,
- Uint32 retValue){
- jamEntry();
-
- ndbrequire(retValue == 0);
-
+ Uint32 retValue)
+{
Ptr<SchemaTransaction> trans_ptr;
+
+ jam();
+ ndbrequire(retValue == 0);
ndbrequire(c_Trans.find(trans_ptr, callbackData));
switch(f_dict_op[trans_ptr.p->m_op.m_vt_index].m_gsn_user_req){
@@ -14665,6 +14901,7 @@ Dbdict::trans_abort_complete_done(Signal* signal,
{
//
CreateFilegroupRef * ref = (CreateFilegroupRef*)signal->getDataPtr();
+ jam();
ref->senderRef = reference();
ref->senderData = trans_ptr.p->m_senderData;
ref->masterNodeId = c_masterNodeId;
@@ -14676,12 +14913,12 @@ Dbdict::trans_abort_complete_done(Signal* signal,
//@todo check api failed
sendSignal(trans_ptr.p->m_senderRef, GSN_CREATE_FILEGROUP_REF, signal,
CreateFilegroupRef::SignalLength, JBB);
-
break;
}
case GSN_CREATE_FILE_REQ:
{
CreateFileRef * ref = (CreateFileRef*)signal->getDataPtr();
+ jam();
ref->senderRef = reference();
ref->senderData = trans_ptr.p->m_senderData;
ref->masterNodeId = c_masterNodeId;
@@ -14693,12 +14930,12 @@ Dbdict::trans_abort_complete_done(Signal* signal,
//@todo check api failed
sendSignal(trans_ptr.p->m_senderRef, GSN_CREATE_FILE_REF, signal,
CreateFileRef::SignalLength, JBB);
-
break;
}
case GSN_DROP_FILE_REQ:
{
DropFileRef * ref = (DropFileRef*)signal->getDataPtr();
+ jam();
ref->senderRef = reference();
ref->senderData = trans_ptr.p->m_senderData;
ref->masterNodeId = c_masterNodeId;
@@ -14709,13 +14946,13 @@ Dbdict::trans_abort_complete_done(Signal* signal,
//@todo check api failed
sendSignal(trans_ptr.p->m_senderRef, GSN_DROP_FILE_REF, signal,
DropFileRef::SignalLength, JBB);
-
break;
}
case GSN_DROP_FILEGROUP_REQ:
{
//
DropFilegroupRef * ref = (DropFilegroupRef*)signal->getDataPtr();
+ jam();
ref->senderRef = reference();
ref->senderData = trans_ptr.p->m_senderData;
ref->masterNodeId = c_masterNodeId;
@@ -14726,7 +14963,6 @@ Dbdict::trans_abort_complete_done(Signal* signal,
//@todo check api failed
sendSignal(trans_ptr.p->m_senderRef, GSN_DROP_FILEGROUP_REF, signal,
DropFilegroupRef::SignalLength, JBB);
-
break;
}
default:
@@ -14740,7 +14976,8 @@ Dbdict::trans_abort_complete_done(Signal* signal,
}
void
-Dbdict::execCREATE_OBJ_REQ(Signal* signal){
+Dbdict::execCREATE_OBJ_REQ(Signal* signal)
+{
jamEntry();
if(!assembleFragments(signal)){
@@ -14785,6 +15022,7 @@ Dbdict::execCREATE_OBJ_REQ(Signal* signal){
switch(objType){
case DictTabInfo::Tablespace:
case DictTabInfo::LogfileGroup:
+ jam();
createObjPtr.p->m_vt_index = 0;
break;
case DictTabInfo::Datafile:
@@ -14793,7 +15031,11 @@ Dbdict::execCREATE_OBJ_REQ(Signal* signal){
* Use restart code to impl. ForceCreateFile
*/
if (requestInfo & CreateFileReq::ForceCreateFile)
- createObjPtr.p->m_restart= 2;
+ {
+ jam();
+ createObjPtr.p->m_restart= 2;
+ }
+ jam();
createObjPtr.p->m_vt_index = 1;
break;
default:
@@ -14809,10 +15051,10 @@ void
Dbdict::execDICT_COMMIT_REQ(Signal* signal)
{
DictCommitReq* req = (DictCommitReq*)signal->getDataPtr();
-
Ptr<SchemaOp> op;
- ndbrequire(c_schemaOp.find(op, req->op_key));
+ jamEntry();
+ ndbrequire(c_schemaOp.find(op, req->op_key));
(this->*f_dict_op[op.p->m_vt_index].m_commit)(signal, op.p);
}
@@ -14820,23 +15062,23 @@ void
Dbdict::execDICT_ABORT_REQ(Signal* signal)
{
DictAbortReq* req = (DictAbortReq*)signal->getDataPtr();
-
Ptr<SchemaOp> op;
- ndbrequire(c_schemaOp.find(op, req->op_key));
+ jamEntry();
+ ndbrequire(c_schemaOp.find(op, req->op_key));
(this->*f_dict_op[op.p->m_vt_index].m_abort)(signal, op.p);
}
void
-Dbdict::execDICT_COMMIT_REF(Signal* signal){
- jamEntry();
-
+Dbdict::execDICT_COMMIT_REF(Signal* signal)
+{
DictCommitRef * const ref = (DictCommitRef*)signal->getDataPtr();
-
Ptr<SchemaTransaction> trans_ptr;
+
+ jamEntry();
ndbrequire(c_Trans.find(trans_ptr, ref->senderData));
-
if(ref->errorCode != DictCommitRef::NF_FakeErrorREF){
+ jam();
trans_ptr.p->setErrorCode(ref->errorCode);
}
Uint32 node = refToNode(ref->senderRef);
@@ -14844,26 +15086,26 @@ Dbdict::execDICT_COMMIT_REF(Signal* signal){
}
void
-Dbdict::execDICT_COMMIT_CONF(Signal* signal){
- jamEntry();
-
- DictCommitConf * const conf = (DictCommitConf*)signal->getDataPtr();
-
+Dbdict::execDICT_COMMIT_CONF(Signal* signal)
+{
Ptr<SchemaTransaction> trans_ptr;
+ DictCommitConf * const conf = (DictCommitConf*)signal->getDataPtr();
+
+ jamEntry();
ndbrequire(c_Trans.find(trans_ptr, conf->senderData));
schemaOp_reply(signal, trans_ptr.p, refToNode(conf->senderRef));
}
void
-Dbdict::execDICT_ABORT_REF(Signal* signal){
- jamEntry();
-
+Dbdict::execDICT_ABORT_REF(Signal* signal)
+{
DictAbortRef * const ref = (DictAbortRef*)signal->getDataPtr();
-
Ptr<SchemaTransaction> trans_ptr;
+
+ jamEntry();
ndbrequire(c_Trans.find(trans_ptr, ref->senderData));
-
if(ref->errorCode != DictAbortRef::NF_FakeErrorREF){
+ jam();
trans_ptr.p->setErrorCode(ref->errorCode);
}
Uint32 node = refToNode(ref->senderRef);
@@ -14871,31 +15113,28 @@ Dbdict::execDICT_ABORT_REF(Signal* signal){
}
void
-Dbdict::execDICT_ABORT_CONF(Signal* signal){
- jamEntry();
-
+Dbdict::execDICT_ABORT_CONF(Signal* signal)
+{
DictAbortConf * const conf = (DictAbortConf*)signal->getDataPtr();
-
Ptr<SchemaTransaction> trans_ptr;
+
+ jamEntry();
ndbrequire(c_Trans.find(trans_ptr, conf->senderData));
schemaOp_reply(signal, trans_ptr.p, refToNode(conf->senderRef));
}
-
-
void
Dbdict::createObj_prepare_start_done(Signal* signal,
Uint32 callbackData,
- Uint32 returnCode){
+ Uint32 returnCode)
+{
+ CreateObjRecordPtr createObjPtr;
+ SegmentedSectionPtr objInfoPtr;
ndbrequire(returnCode == 0);
-
- CreateObjRecordPtr createObjPtr;
ndbrequire(c_opCreateObj.find(createObjPtr, callbackData));
-
- SegmentedSectionPtr objInfoPtr;
+ jam();
getSection(objInfoPtr, createObjPtr.p->m_obj_info_ptr_i);
-
if(createObjPtr.p->m_errorCode != 0){
jam();
createObjPtr.p->m_obj_info_ptr_i= RNIL;
@@ -14923,19 +15162,19 @@ Dbdict::createObj_prepare_start_done(Signal* signal,
void
Dbdict::createObj_writeSchemaConf1(Signal* signal,
Uint32 callbackData,
- Uint32 returnCode){
- jam();
+ Uint32 returnCode)
+{
+ CreateObjRecordPtr createObjPtr;
+ Callback callback;
+ SegmentedSectionPtr objInfoPtr;
+ jam();
ndbrequire(returnCode == 0);
-
- CreateObjRecordPtr createObjPtr;
ndbrequire(c_opCreateObj.find(createObjPtr, callbackData));
- Callback callback;
callback.m_callbackData = createObjPtr.p->key;
callback.m_callbackFunction = safe_cast(&Dbdict::createObj_writeObjConf);
- SegmentedSectionPtr objInfoPtr;
getSection(objInfoPtr, createObjPtr.p->m_obj_info_ptr_i);
writeTableFile(signal, createObjPtr.p->m_obj_id, objInfoPtr, &callback);
@@ -14947,14 +15186,13 @@ Dbdict::createObj_writeSchemaConf1(Signal* signal,
void
Dbdict::createObj_writeObjConf(Signal* signal,
Uint32 callbackData,
- Uint32 returnCode){
- jam();
+ Uint32 returnCode)
+{
+ CreateObjRecordPtr createObjPtr;
+ jam();
ndbrequire(returnCode == 0);
-
- CreateObjRecordPtr createObjPtr;
ndbrequire(c_opCreateObj.find(createObjPtr, callbackData));
-
createObjPtr.p->m_callback.m_callbackFunction =
safe_cast(&Dbdict::createObj_prepare_complete_done);
(this->*f_dict_op[createObjPtr.p->m_vt_index].m_prepare_complete)
@@ -14964,12 +15202,12 @@ Dbdict::createObj_writeObjConf(Signal* signal,
void
Dbdict::createObj_prepare_complete_done(Signal* signal,
Uint32 callbackData,
- Uint32 returnCode){
+ Uint32 returnCode)
+{
+ CreateObjRecordPtr createObjPtr;
+
jam();
-
ndbrequire(returnCode == 0);
-
- CreateObjRecordPtr createObjPtr;
ndbrequire(c_opCreateObj.find(createObjPtr, callbackData));
//@todo check for master failed
@@ -14998,28 +15236,33 @@ Dbdict::createObj_prepare_complete_done(Signal* signal,
}
void
-Dbdict::createObj_commit(Signal * signal, SchemaOp * op){
- jam();
-
+Dbdict::createObj_commit(Signal * signal, SchemaOp * op)
+{
OpCreateObj * createObj = (OpCreateObj*)op;
+
createObj->m_callback.m_callbackFunction =
safe_cast(&Dbdict::createObj_commit_start_done);
if (f_dict_op[createObj->m_vt_index].m_commit_start)
+ {
+ jam();
(this->*f_dict_op[createObj->m_vt_index].m_commit_start)(signal, createObj);
+ }
else
+ {
+ jam();
execute(signal, createObj->m_callback, 0);
+ }
}
void
Dbdict::createObj_commit_start_done(Signal* signal,
Uint32 callbackData,
- Uint32 returnCode){
+ Uint32 returnCode)
+{
+ CreateObjRecordPtr createObjPtr;
jam();
-
ndbrequire(returnCode == 0);
-
- CreateObjRecordPtr createObjPtr;
ndbrequire(c_opCreateObj.find(createObjPtr, callbackData));
Uint32 objId = createObjPtr.p->m_obj_id;
@@ -15039,29 +15282,35 @@ Dbdict::createObj_commit_start_done(Signal* signal,
void
Dbdict::createObj_writeSchemaConf2(Signal* signal,
Uint32 callbackData,
- Uint32 returnCode){
- jam();
-
- CreateObjRecordPtr createObjPtr;
- ndbrequire(c_opCreateObj.find(createObjPtr, callbackData));
+ Uint32 returnCode)
+{
+ CreateObjRecordPtr createObjPtr;
+ ndbrequire(c_opCreateObj.find(createObjPtr, callbackData));
createObjPtr.p->m_callback.m_callbackFunction =
safe_cast(&Dbdict::createObj_commit_complete_done);
if (f_dict_op[createObjPtr.p->m_vt_index].m_commit_complete)
+ {
+ jam();
(this->*f_dict_op[createObjPtr.p->m_vt_index].m_commit_complete)
(signal, createObjPtr.p);
+ }
else
+ {
+ jam();
execute(signal, createObjPtr.p->m_callback, 0);
+ }
}
void
Dbdict::createObj_commit_complete_done(Signal* signal,
Uint32 callbackData,
- Uint32 returnCode){
+ Uint32 returnCode)
+{
+ CreateObjRecordPtr createObjPtr;
+
jam();
-
- CreateObjRecordPtr createObjPtr;
ndbrequire(c_opCreateObj.find(createObjPtr, callbackData));
//@todo check error
@@ -15079,27 +15328,31 @@ Dbdict::createObj_commit_complete_done(Signal* signal,
void
Dbdict::createObj_abort(Signal* signal, SchemaOp* op)
{
- jam();
-
OpCreateObj * createObj = (OpCreateObj*)op;
createObj->m_callback.m_callbackFunction =
safe_cast(&Dbdict::createObj_abort_start_done);
if (f_dict_op[createObj->m_vt_index].m_abort_start)
+ {
+ jam();
(this->*f_dict_op[createObj->m_vt_index].m_abort_start)(signal, createObj);
+ }
else
+ {
+ jam();
execute(signal, createObj->m_callback, 0);
+ }
}
void
Dbdict::createObj_abort_start_done(Signal* signal,
Uint32 callbackData,
- Uint32 returnCode){
+ Uint32 returnCode)
+{
+ CreateObjRecordPtr createObjPtr;
+
jam();
-
- CreateObjRecordPtr createObjPtr;
ndbrequire(c_opCreateObj.find(createObjPtr, callbackData));
-
XSchemaFile * xsf = &c_schemaFile[c_schemaRecord.schemaPage != 0];
SchemaFile::TableEntry objEntry = * getTableEntry(xsf,
createObjPtr.p->m_obj_id);
@@ -15118,19 +15371,23 @@ Dbdict::createObj_abort_writeSchemaConf(Signal* signal,
Uint32 callbackData,
Uint32 returnCode)
{
- jam();
+ CreateObjRecordPtr createObjPtr;
- CreateObjRecordPtr createObjPtr;
ndbrequire(c_opCreateObj.find(createObjPtr, callbackData));
-
createObjPtr.p->m_callback.m_callbackFunction =
safe_cast(&Dbdict::createObj_abort_complete_done);
if (f_dict_op[createObjPtr.p->m_vt_index].m_abort_complete)
+ {
+ jam();
(this->*f_dict_op[createObjPtr.p->m_vt_index].m_abort_complete)
(signal, createObjPtr.p);
+ }
else
+ {
+ jam();
execute(signal, createObjPtr.p->m_callback, 0);
+ }
}
void
@@ -15138,9 +15395,9 @@ Dbdict::createObj_abort_complete_done(Signal* signal,
Uint32 callbackData,
Uint32 returnCode)
{
- jam();
+ CreateObjRecordPtr createObjPtr;
- CreateObjRecordPtr createObjPtr;
+ jam();
ndbrequire(c_opCreateObj.find(createObjPtr, callbackData));
DictAbortConf * const conf = (DictAbortConf*)signal->getDataPtr();
@@ -15153,7 +15410,8 @@ Dbdict::createObj_abort_complete_done(Signal* signal,
}
void
-Dbdict::execDROP_OBJ_REQ(Signal* signal){
+Dbdict::execDROP_OBJ_REQ(Signal* signal)
+{
jamEntry();
if(!assembleFragments(signal)){
@@ -15191,8 +15449,9 @@ Dbdict::execDROP_OBJ_REQ(Signal* signal){
case DictTabInfo::Tablespace:
case DictTabInfo::LogfileGroup:
{
- dropObjPtr.p->m_vt_index = 3;
Ptr<Filegroup> fg_ptr;
+ jam();
+ dropObjPtr.p->m_vt_index = 3;
ndbrequire(c_filegroup_hash.find(fg_ptr, objId));
dropObjPtr.p->m_obj_ptr_i = fg_ptr.i;
break;
@@ -15200,15 +15459,19 @@ Dbdict::execDROP_OBJ_REQ(Signal* signal){
}
case DictTabInfo::Datafile:
{
- dropObjPtr.p->m_vt_index = 2;
Ptr<File> file_ptr;
+ jam();
+ dropObjPtr.p->m_vt_index = 2;
ndbrequire(c_file_hash.find(file_ptr, objId));
dropObjPtr.p->m_obj_ptr_i = file_ptr.i;
break;
}
case DictTabInfo::Undofile:
+ {
+ jam();
dropObjPtr.p->m_vt_index = 4;
return;
+ }
default:
ndbrequire(false);
}
@@ -15223,12 +15486,12 @@ Dbdict::dropObj_prepare_start_done(Signal* signal,
Uint32 callbackData,
Uint32 returnCode)
{
- ndbrequire(returnCode == 0);
+ DropObjRecordPtr dropObjPtr;
+ Callback cb;
- DropObjRecordPtr dropObjPtr;
+ ndbrequire(returnCode == 0);
ndbrequire(c_opDropObj.find(dropObjPtr, callbackData));
- Callback cb;
cb.m_callbackData = callbackData;
cb.m_callbackFunction =
safe_cast(&Dbdict::dropObj_prepare_writeSchemaConf);
@@ -15239,7 +15502,7 @@ Dbdict::dropObj_prepare_start_done(Signal* signal,
dropObj_prepare_complete_done(signal, callbackData, 0);
return;
}
-
+ jam();
Uint32 objId = dropObjPtr.p->m_obj_id;
XSchemaFile * xsf = &c_schemaFile[c_schemaRecord.schemaPage != 0];
SchemaFile::TableEntry objEntry = *getTableEntry(xsf, objId);
@@ -15252,19 +15515,23 @@ Dbdict::dropObj_prepare_writeSchemaConf(Signal* signal,
Uint32 callbackData,
Uint32 returnCode)
{
- ndbrequire(returnCode == 0);
+ DropObjRecordPtr dropObjPtr;
- DropObjRecordPtr dropObjPtr;
+ ndbrequire(returnCode == 0);
ndbrequire(c_opDropObj.find(dropObjPtr, callbackData));
-
dropObjPtr.p->m_callback.m_callbackFunction =
safe_cast(&Dbdict::dropObj_prepare_complete_done);
-
if(f_dict_op[dropObjPtr.p->m_vt_index].m_prepare_complete)
+ {
+ jam();
(this->*f_dict_op[dropObjPtr.p->m_vt_index].m_prepare_complete)
(signal, dropObjPtr.p);
+ }
else
+ {
+ jam();
execute(signal, dropObjPtr.p->m_callback, 0);
+ }
}
void
@@ -15272,10 +15539,11 @@ Dbdict::dropObj_prepare_complete_done(Signal* signal,
Uint32 callbackData,
Uint32 returnCode)
{
+ DropObjRecordPtr dropObjPtr;
+
ndbrequire(returnCode == 0);
-
- DropObjRecordPtr dropObjPtr;
ndbrequire(c_opDropObj.find(dropObjPtr, callbackData));
+ jam();
//@todo check for master failed
@@ -15301,16 +15569,22 @@ Dbdict::dropObj_prepare_complete_done(Signal* signal,
}
void
-Dbdict::dropObj_commit(Signal * signal, SchemaOp * op){
- jam();
-
+Dbdict::dropObj_commit(Signal * signal, SchemaOp * op)
+{
OpDropObj * dropObj = (OpDropObj*)op;
+
dropObj->m_callback.m_callbackFunction =
safe_cast(&Dbdict::dropObj_commit_start_done);
if (f_dict_op[dropObj->m_vt_index].m_commit_start)
+ {
+ jam();
(this->*f_dict_op[dropObj->m_vt_index].m_commit_start)(signal, dropObj);
+ }
else
+ {
+ jam();
execute(signal, dropObj->m_callback, 0);
+ }
}
void
@@ -15318,10 +15592,10 @@ Dbdict::dropObj_commit_start_done(Signal* signal,
Uint32 callbackData,
Uint32 returnCode)
{
+ DropObjRecordPtr dropObjPtr;
+
jam();
ndbrequire(returnCode == 0);
-
- DropObjRecordPtr dropObjPtr;
ndbrequire(c_opDropObj.find(dropObjPtr, callbackData));
Uint32 objId = dropObjPtr.p->m_obj_id;
@@ -15342,20 +15616,25 @@ Dbdict::dropObj_commit_writeSchemaConf(Signal* signal,
Uint32 callbackData,
Uint32 returnCode)
{
+ DropObjRecordPtr dropObjPtr;
+
jam();
ndbrequire(returnCode == 0);
-
- DropObjRecordPtr dropObjPtr;
ndbrequire(c_opDropObj.find(dropObjPtr, callbackData));
-
dropObjPtr.p->m_callback.m_callbackFunction =
safe_cast(&Dbdict::dropObj_commit_complete_done);
if(f_dict_op[dropObjPtr.p->m_vt_index].m_commit_complete)
+ {
+ jam();
(this->*f_dict_op[dropObjPtr.p->m_vt_index].m_commit_complete)
(signal, dropObjPtr.p);
+ }
else
+ {
+ jam();
execute(signal, dropObjPtr.p->m_callback, 0);
+ }
}
void
@@ -15363,7 +15642,9 @@ Dbdict::dropObj_commit_complete_done(Signal* signal,
Uint32 callbackData,
Uint32 returnCode)
{
- DropObjRecordPtr dropObjPtr;
+ DropObjRecordPtr dropObjPtr;
+
+ jam();
ndbrequire(c_opDropObj.find(dropObjPtr, callbackData));
//@todo check error
@@ -15374,22 +15655,26 @@ Dbdict::dropObj_commit_complete_done(Signal* signal,
conf->senderData = dropObjPtr.p->m_senderData;
sendSignal(dropObjPtr.p->m_senderRef, GSN_DICT_COMMIT_CONF,
signal, DictCommitConf::SignalLength, JBB);
-
c_opDropObj.release(dropObjPtr);
}
void
-Dbdict::dropObj_abort(Signal * signal, SchemaOp * op){
- jam();
-
+Dbdict::dropObj_abort(Signal * signal, SchemaOp * op)
+{
OpDropObj * dropObj = (OpDropObj*)op;
+
dropObj->m_callback.m_callbackFunction =
safe_cast(&Dbdict::dropObj_abort_start_done);
-
if (f_dict_op[dropObj->m_vt_index].m_abort_start)
+ {
+ jam();
(this->*f_dict_op[dropObj->m_vt_index].m_abort_start)(signal, dropObj);
+ }
else
+ {
+ jam();
execute(signal, dropObj->m_callback, 0);
+ }
}
void
@@ -15397,10 +15682,10 @@ Dbdict::dropObj_abort_start_done(Signal* signal,
Uint32 callbackData,
Uint32 returnCode)
{
+ DropObjRecordPtr dropObjPtr;
+
jam();
ndbrequire(returnCode == 0);
-
- DropObjRecordPtr dropObjPtr;
ndbrequire(c_opDropObj.find(dropObjPtr, callbackData));
XSchemaFile * xsf = &c_schemaFile[c_schemaRecord.schemaPage != 0];
@@ -15421,6 +15706,7 @@ Dbdict::dropObj_abort_start_done(Signal* signal,
}
else
{
+ jam();
execute(signal, callback, 0);
}
}
@@ -15430,20 +15716,24 @@ Dbdict::dropObj_abort_writeSchemaConf(Signal* signal,
Uint32 callbackData,
Uint32 returnCode)
{
- jam();
+ DropObjRecordPtr dropObjPtr;
+
ndbrequire(returnCode == 0);
-
- DropObjRecordPtr dropObjPtr;
ndbrequire(c_opDropObj.find(dropObjPtr, callbackData));
-
dropObjPtr.p->m_callback.m_callbackFunction =
safe_cast(&Dbdict::dropObj_abort_complete_done);
if(f_dict_op[dropObjPtr.p->m_vt_index].m_abort_complete)
+ {
+ jam();
(this->*f_dict_op[dropObjPtr.p->m_vt_index].m_abort_complete)
(signal, dropObjPtr.p);
+ }
else
+ {
+ jam();
execute(signal, dropObjPtr.p->m_callback, 0);
+ }
}
void
@@ -15451,24 +15741,26 @@ Dbdict::dropObj_abort_complete_done(Signal* signal,
Uint32 callbackData,
Uint32 returnCode)
{
- DropObjRecordPtr dropObjPtr;
- ndbrequire(c_opDropObj.find(dropObjPtr, callbackData));
-
+ DropObjRecordPtr dropObjPtr;
DictAbortConf * const conf = (DictAbortConf*)signal->getDataPtr();
+
+ ndbrequire(c_opDropObj.find(dropObjPtr, callbackData));
+ jam();
conf->senderRef = reference();
conf->senderData = dropObjPtr.p->m_senderData;
sendSignal(dropObjPtr.p->m_senderRef, GSN_DICT_ABORT_CONF,
signal, DictAbortConf::SignalLength, JBB);
-
c_opDropObj.release(dropObjPtr);
}
void
-Dbdict::create_fg_prepare_start(Signal* signal, SchemaOp* op){
+Dbdict::create_fg_prepare_start(Signal* signal, SchemaOp* op)
+{
/**
* Put data into table record
*/
SegmentedSectionPtr objInfoPtr;
+ jam();
getSection(objInfoPtr, ((OpCreateObj*)op)->m_obj_info_ptr_i);
SimplePropertiesSectionReader it(objInfoPtr, getSectionSegmentPool());
@@ -15485,6 +15777,7 @@ Dbdict::create_fg_prepare_start(Signal* signal, SchemaOp* op){
if(status != SimpleProperties::Eof)
{
+ jam();
op->m_errorCode = CreateTableRef::InvalidFormat;
break;
}
@@ -15493,6 +15786,7 @@ Dbdict::create_fg_prepare_start(Signal* signal, SchemaOp* op){
{
if(!fg.TS_ExtentSize)
{
+ jam();
op->m_errorCode = CreateFilegroupRef::InvalidExtentSize;
break;
}
@@ -15504,6 +15798,7 @@ Dbdict::create_fg_prepare_start(Signal* signal, SchemaOp* op){
*/
if(fg.LF_UndoBufferSize < 3 * File_formats::NDB_PAGE_SIZE)
{
+ jam();
op->m_errorCode = CreateFilegroupRef::InvalidUndoBufferSize;
break;
}
@@ -15512,16 +15807,19 @@ Dbdict::create_fg_prepare_start(Signal* signal, SchemaOp* op){
Uint32 len = strlen(fg.FilegroupName) + 1;
Uint32 hash = Rope::hash(fg.FilegroupName, len);
if(get_object(fg.FilegroupName, len, hash) != 0){
+ jam();
op->m_errorCode = CreateTableRef::TableAlreadyExist;
break;
}
if(!c_obj_pool.seize(obj_ptr)){
+ jam();
op->m_errorCode = CreateTableRef::NoMoreTableRecords;
break;
}
if(!c_filegroup_pool.seize(fg_ptr)){
+ jam();
op->m_errorCode = CreateTableRef::NoMoreTableRecords;
break;
}
@@ -15531,6 +15829,7 @@ Dbdict::create_fg_prepare_start(Signal* signal, SchemaOp* op){
{
Rope name(c_rope_pool, obj_ptr.p->m_name);
if(!name.assign(fg.FilegroupName, len, hash)){
+ jam();
op->m_errorCode = CreateTableRef::OutOfStringBuffer;
break;
}
@@ -15544,6 +15843,7 @@ Dbdict::create_fg_prepare_start(Signal* signal, SchemaOp* op){
switch(fg.FilegroupType){
case DictTabInfo::Tablespace:
+ {
//fg.TS_DataGrow = group.m_grow_spec;
fg_ptr.p->m_tablespace.m_extent_size = fg.TS_ExtentSize;
fg_ptr.p->m_tablespace.m_default_logfile_group_id = fg.TS_LogfileGroupId;
@@ -15551,22 +15851,28 @@ Dbdict::create_fg_prepare_start(Signal* signal, SchemaOp* op){
Ptr<Filegroup> lg_ptr;
if (!c_filegroup_hash.find(lg_ptr, fg.TS_LogfileGroupId))
{
+ jam();
op->m_errorCode = CreateFilegroupRef::NoSuchLogfileGroup;
goto error;
}
if (lg_ptr.p->m_version != fg.TS_LogfileGroupVersion)
{
+ jam();
op->m_errorCode = CreateFilegroupRef::InvalidFilegroupVersion;
goto error;
}
increase_ref_count(lg_ptr.p->m_obj_ptr_i);
break;
+ }
case DictTabInfo::LogfileGroup:
+ {
+ jam();
fg_ptr.p->m_logfilegroup.m_undo_buffer_size = fg.LF_UndoBufferSize;
fg_ptr.p->m_logfilegroup.m_files.init();
//fg.LF_UndoGrow = ;
break;
+ }
default:
ndbrequire(false);
}
@@ -15601,13 +15907,14 @@ error:
}
void
-Dbdict::create_fg_prepare_complete(Signal* signal, SchemaOp* op){
+Dbdict::create_fg_prepare_complete(Signal* signal, SchemaOp* op)
+{
/**
* CONTACT TSMAN LGMAN PGMAN
*/
CreateFilegroupImplReq* req =
(CreateFilegroupImplReq*)signal->getDataPtrSend();
-
+ jam();
req->senderData = op->key;
req->senderRef = reference();
req->filegroup_id = op->m_obj_id;
@@ -15620,18 +15927,24 @@ Dbdict::create_fg_prepare_complete(Signal* signal, SchemaOp* op){
Uint32 len= 0;
switch(op->m_obj_type){
case DictTabInfo::Tablespace:
+ {
+ jam();
ref = TSMAN_REF;
len = CreateFilegroupImplReq::TablespaceLength;
req->tablespace.extent_size = fg_ptr.p->m_tablespace.m_extent_size;
req->tablespace.logfile_group_id =
fg_ptr.p->m_tablespace.m_default_logfile_group_id;
break;
+ }
case DictTabInfo::LogfileGroup:
+ {
+ jam();
ref = LGMAN_REF;
len = CreateFilegroupImplReq::LogfileGroupLength;
req->logfile_group.buffer_size =
fg_ptr.p->m_logfilegroup.m_undo_buffer_size;
break;
+ }
default:
ndbrequire(false);
}
@@ -15640,12 +15953,11 @@ Dbdict::create_fg_prepare_complete(Signal* signal, SchemaOp* op){
}
void
-Dbdict::execCREATE_FILEGROUP_REF(Signal* signal){
- jamEntry();
-
+Dbdict::execCREATE_FILEGROUP_REF(Signal* signal)
+{
CreateFilegroupImplRef * ref = (CreateFilegroupImplRef*)signal->getDataPtr();
-
CreateObjRecordPtr op_ptr;
+ jamEntry();
ndbrequire(c_opCreateObj.find(op_ptr, ref->senderData));
op_ptr.p->m_errorCode = ref->errorCode;
@@ -15653,13 +15965,12 @@ Dbdict::execCREATE_FILEGROUP_REF(Signal* signal){
}
void
-Dbdict::execCREATE_FILEGROUP_CONF(Signal* signal){
- jamEntry();
-
+Dbdict::execCREATE_FILEGROUP_CONF(Signal* signal)
+{
CreateFilegroupImplConf * rep =
(CreateFilegroupImplConf*)signal->getDataPtr();
-
CreateObjRecordPtr op_ptr;
+ jamEntry();
ndbrequire(c_opCreateObj.find(op_ptr, rep->senderData));
execute(signal, op_ptr.p->m_callback, 0);
@@ -15675,13 +15986,13 @@ Dbdict::create_fg_abort_start(Signal* signal, SchemaOp* op){
send_drop_fg(signal, op, DropFilegroupImplReq::Commit);
return;
}
-
+ jam();
execute(signal, op->m_callback, 0);
}
void
-Dbdict::create_fg_abort_complete(Signal* signal, SchemaOp* op){
-
+Dbdict::create_fg_abort_complete(Signal* signal, SchemaOp* op)
+{
if (op->m_obj_ptr_i != RNIL)
{
jam();
@@ -15691,12 +16002,13 @@ Dbdict::create_fg_abort_complete(Signal* signal, SchemaOp* op){
release_object(fg_ptr.p->m_obj_ptr_i);
c_filegroup_hash.release(fg_ptr);
}
-
+ jam();
execute(signal, op->m_callback, 0);
}
void
-Dbdict::create_file_prepare_start(Signal* signal, SchemaOp* op){
+Dbdict::create_file_prepare_start(Signal* signal, SchemaOp* op)
+{
/**
* Put data into table record
*/
@@ -15716,6 +16028,7 @@ Dbdict::create_file_prepare_start(Signal* signal, SchemaOp* op){
do {
if(status != SimpleProperties::Eof){
+ jam();
op->m_errorCode = CreateFileRef::InvalidFormat;
break;
}
@@ -15723,34 +16036,53 @@ Dbdict::create_file_prepare_start(Signal* signal, SchemaOp* op){
// Get Filegroup
FilegroupPtr fg_ptr;
if(!c_filegroup_hash.find(fg_ptr, f.FilegroupId)){
+ jam();
op->m_errorCode = CreateFileRef::NoSuchFilegroup;
break;
}
if(fg_ptr.p->m_version != f.FilegroupVersion){
+ jam();
op->m_errorCode = CreateFileRef::InvalidFilegroupVersion;
break;
}
switch(f.FileType){
case DictTabInfo::Datafile:
+ {
if(fg_ptr.p->m_type != DictTabInfo::Tablespace)
+ {
+ jam();
op->m_errorCode = CreateFileRef::InvalidFileType;
+ }
+ jam();
break;
+ }
case DictTabInfo::Undofile:
+ {
if(fg_ptr.p->m_type != DictTabInfo::LogfileGroup)
+ {
+ jam();
op->m_errorCode = CreateFileRef::InvalidFileType;
+ }
+ jam();
break;
+ }
default:
+ jam();
op->m_errorCode = CreateFileRef::InvalidFileType;
}
if(op->m_errorCode)
+ {
+ jam();
break;
+ }
Uint32 len = strlen(f.FileName) + 1;
Uint32 hash = Rope::hash(f.FileName, len);
if(get_object(f.FileName, len, hash) != 0){
+ jam();
op->m_errorCode = CreateFileRef::FilenameAlreadyExists;
break;
}
@@ -15761,6 +16093,7 @@ Dbdict::create_file_prepare_start(Signal* signal, SchemaOp* op){
m_ctx.m_config.getOwnConfigIterator();
if(!ndb_mgm_get_int_parameter(p, CFG_DB_DISCLESS, &dl) && dl)
{
+ jam();
op->m_errorCode = CreateFileRef::NotSupportedWhenDiskless;
break;
}
@@ -15768,11 +16101,13 @@ Dbdict::create_file_prepare_start(Signal* signal, SchemaOp* op){
// Loop through all filenames...
if(!c_obj_pool.seize(obj_ptr)){
+ jam();
op->m_errorCode = CreateTableRef::NoMoreTableRecords;
break;
}
if (! c_file_pool.seize(filePtr)){
+ jam();
op->m_errorCode = CreateFileRef::OutOfFileRecords;
break;
}
@@ -15782,6 +16117,7 @@ Dbdict::create_file_prepare_start(Signal* signal, SchemaOp* op){
{
Rope name(c_rope_pool, obj_ptr.p->m_name);
if(!name.assign(f.FileName, len, hash)){
+ jam();
op->m_errorCode = CreateTableRef::OutOfStringBuffer;
break;
}
@@ -15789,10 +16125,14 @@ Dbdict::create_file_prepare_start(Signal* signal, SchemaOp* op){
switch(fg_ptr.p->m_type){
case DictTabInfo::Tablespace:
+ {
+ jam();
increase_ref_count(fg_ptr.p->m_obj_ptr_i);
break;
+ }
case DictTabInfo::LogfileGroup:
{
+ jam();
Local_file_list list(c_file_pool, fg_ptr.p->m_logfilegroup.m_files);
list.add(filePtr);
break;
@@ -15836,37 +16176,46 @@ Dbdict::create_file_prepare_start(Signal* signal, SchemaOp* op){
c_obj_pool.release(obj_ptr);
}
}
-
execute(signal, op->m_callback, 0);
}
void
-Dbdict::create_file_prepare_complete(Signal* signal, SchemaOp* op){
+Dbdict::create_file_prepare_complete(Signal* signal, SchemaOp* op)
+{
/**
* CONTACT TSMAN LGMAN PGMAN
*/
CreateFileImplReq* req = (CreateFileImplReq*)signal->getDataPtrSend();
-
FilePtr f_ptr;
- c_file_pool.getPtr(f_ptr, op->m_obj_ptr_i);
-
FilegroupPtr fg_ptr;
+
+ jam();
+ c_file_pool.getPtr(f_ptr, op->m_obj_ptr_i);
ndbrequire(c_filegroup_hash.find(fg_ptr, f_ptr.p->m_filegroup_id));
req->senderData = op->key;
req->senderRef = reference();
switch(((OpCreateObj*)op)->m_restart){
case 0:
+ {
+ jam();
req->requestInfo = CreateFileImplReq::Create;
break;
+ }
case 1:
+ {
+ jam();
req->requestInfo = CreateFileImplReq::Open;
break;
+ }
case 2:
+ {
+ jam();
req->requestInfo = CreateFileImplReq::CreateForce;
break;
}
+ }
req->file_id = f_ptr.p->key;
req->filegroup_id = f_ptr.p->m_filegroup_id;
@@ -15878,14 +16227,20 @@ Dbdict::create_file_prepare_complete(Signal* signal, SchemaOp* op){
Uint32 len= 0;
switch(op->m_obj_type){
case DictTabInfo::Datafile:
+ {
+ jam();
ref = TSMAN_REF;
len = CreateFileImplReq::DatafileLength;
req->tablespace.extent_size = fg_ptr.p->m_tablespace.m_extent_size;
break;
+ }
case DictTabInfo::Undofile:
+ {
+ jam();
ref = LGMAN_REF;
len = CreateFileImplReq::UndofileLength;
break;
+ }
default:
ndbrequire(false);
}
@@ -15900,42 +16255,41 @@ Dbdict::create_file_prepare_complete(Signal* signal, SchemaOp* op){
}
void
-Dbdict::execCREATE_FILE_REF(Signal* signal){
- jamEntry();
-
+Dbdict::execCREATE_FILE_REF(Signal* signal)
+{
CreateFileImplRef * ref = (CreateFileImplRef*)signal->getDataPtr();
-
CreateObjRecordPtr op_ptr;
+
+ jamEntry();
ndbrequire(c_opCreateObj.find(op_ptr, ref->senderData));
op_ptr.p->m_errorCode = ref->errorCode;
-
execute(signal, op_ptr.p->m_callback, 0);
}
void
-Dbdict::execCREATE_FILE_CONF(Signal* signal){
- jamEntry();
-
+Dbdict::execCREATE_FILE_CONF(Signal* signal)
+{
CreateFileImplConf * rep =
(CreateFileImplConf*)signal->getDataPtr();
-
CreateObjRecordPtr op_ptr;
+
+ jamEntry();
ndbrequire(c_opCreateObj.find(op_ptr, rep->senderData));
-
execute(signal, op_ptr.p->m_callback, 0);
}
void
-Dbdict::create_file_commit_start(Signal* signal, SchemaOp* op){
+Dbdict::create_file_commit_start(Signal* signal, SchemaOp* op)
+{
/**
* CONTACT TSMAN LGMAN PGMAN
*/
CreateFileImplReq* req = (CreateFileImplReq*)signal->getDataPtrSend();
-
FilePtr f_ptr;
- c_file_pool.getPtr(f_ptr, op->m_obj_ptr_i);
-
FilegroupPtr fg_ptr;
+
+ jam();
+ c_file_pool.getPtr(f_ptr, op->m_obj_ptr_i);
ndbrequire(c_filegroup_hash.find(fg_ptr, f_ptr.p->m_filegroup_id));
req->senderData = op->key;
@@ -15949,15 +16303,20 @@ Dbdict::create_file_commit_start(Signal* signal, SchemaOp* op){
Uint32 ref= 0;
switch(op->m_obj_type){
case DictTabInfo::Datafile:
+ {
+ jam();
ref = TSMAN_REF;
break;
+ }
case DictTabInfo::Undofile:
+ {
+ jam();
ref = LGMAN_REF;
break;
+ }
default:
ndbrequire(false);
}
-
sendSignal(ref, GSN_CREATE_FILE_REQ, signal,
CreateFileImplReq::CommitLength, JBB);
}
@@ -15970,9 +16329,11 @@ Dbdict::create_file_abort_start(Signal* signal, SchemaOp* op)
if (op->m_obj_ptr_i != RNIL)
{
FilePtr f_ptr;
+ FilegroupPtr fg_ptr;
+
+ jam();
c_file_pool.getPtr(f_ptr, op->m_obj_ptr_i);
- FilegroupPtr fg_ptr;
ndbrequire(c_filegroup_hash.find(fg_ptr, f_ptr.p->m_filegroup_id));
req->senderData = op->key;
@@ -15986,20 +16347,24 @@ Dbdict::create_file_abort_start(Signal* signal, SchemaOp* op)
Uint32 ref= 0;
switch(op->m_obj_type){
case DictTabInfo::Datafile:
+ {
+ jam();
ref = TSMAN_REF;
break;
+ }
case DictTabInfo::Undofile:
+ {
+ jam();
ref = LGMAN_REF;
break;
+ }
default:
ndbrequire(false);
}
-
sendSignal(ref, GSN_CREATE_FILE_REQ, signal,
CreateFileImplReq::AbortLength, JBB);
return;
}
-
execute(signal, op->m_callback, 0);
}
@@ -16009,17 +16374,21 @@ Dbdict::create_file_abort_complete(Signal* signal, SchemaOp* op)
if (op->m_obj_ptr_i != RNIL)
{
FilePtr f_ptr;
- c_file_pool.getPtr(f_ptr, op->m_obj_ptr_i);
-
FilegroupPtr fg_ptr;
+
+ jam();
+ c_file_pool.getPtr(f_ptr, op->m_obj_ptr_i);
ndbrequire(c_filegroup_hash.find(fg_ptr, f_ptr.p->m_filegroup_id));
-
switch(fg_ptr.p->m_type){
case DictTabInfo::Tablespace:
+ {
+ jam();
decrease_ref_count(fg_ptr.p->m_obj_ptr_i);
break;
+ }
case DictTabInfo::LogfileGroup:
{
+ jam();
Local_file_list list(c_file_pool, fg_ptr.p->m_logfilegroup.m_files);
list.remove(f_ptr);
break;
@@ -16031,19 +16400,20 @@ Dbdict::create_file_abort_complete(Signal* signal, SchemaOp* op)
release_object(f_ptr.p->m_obj_ptr_i);
c_file_hash.release(f_ptr);
}
-
execute(signal, op->m_callback, 0);
}
void
Dbdict::drop_file_prepare_start(Signal* signal, SchemaOp* op)
{
+ jam();
send_drop_file(signal, op, DropFileImplReq::Prepare);
}
void
Dbdict::drop_undofile_prepare_start(Signal* signal, SchemaOp* op)
{
+ jam();
op->m_errorCode = DropFileRef::DropUndoFileNotSupported;
execute(signal, op->m_callback, 0);
}
@@ -16051,6 +16421,7 @@ Dbdict::drop_undofile_prepare_start(Signal* signal, SchemaOp* op)
void
Dbdict::drop_file_commit_start(Signal* signal, SchemaOp* op)
{
+ jam();
send_drop_file(signal, op, DropFileImplReq::Commit);
}
@@ -16058,21 +16429,37 @@ void
Dbdict::drop_file_commit_complete(Signal* signal, SchemaOp* op)
{
FilePtr f_ptr;
- c_file_pool.getPtr(f_ptr, op->m_obj_ptr_i);
-
FilegroupPtr fg_ptr;
- ndbrequire(c_filegroup_hash.find(fg_ptr, f_ptr.p->m_filegroup_id));
+ jam();
+ c_file_pool.getPtr(f_ptr, op->m_obj_ptr_i);
+ ndbrequire(c_filegroup_hash.find(fg_ptr, f_ptr.p->m_filegroup_id));
decrease_ref_count(fg_ptr.p->m_obj_ptr_i);
release_object(f_ptr.p->m_obj_ptr_i);
c_file_hash.release(f_ptr);
+ execute(signal, op->m_callback, 0);
+}
+void
+Dbdict::drop_undofile_commit_complete(Signal* signal, SchemaOp* op)
+{
+ FilePtr f_ptr;
+ FilegroupPtr fg_ptr;
+
+ jam();
+ c_file_pool.getPtr(f_ptr, op->m_obj_ptr_i);
+ ndbrequire(c_filegroup_hash.find(fg_ptr, f_ptr.p->m_filegroup_id));
+ Local_file_list list(c_file_pool, fg_ptr.p->m_logfilegroup.m_files);
+ list.remove(f_ptr);
+ release_object(f_ptr.p->m_obj_ptr_i);
+ c_file_hash.release(f_ptr);
execute(signal, op->m_callback, 0);
}
void
Dbdict::drop_file_abort_start(Signal* signal, SchemaOp* op)
{
+ jam();
send_drop_file(signal, op, DropFileImplReq::Abort);
}
@@ -16081,11 +16468,11 @@ Dbdict::send_drop_file(Signal* signal, SchemaOp* op,
DropFileImplReq::RequestInfo type)
{
DropFileImplReq* req = (DropFileImplReq*)signal->getDataPtrSend();
-
FilePtr f_ptr;
- c_file_pool.getPtr(f_ptr, op->m_obj_ptr_i);
-
FilegroupPtr fg_ptr;
+
+ jam();
+ c_file_pool.getPtr(f_ptr, op->m_obj_ptr_i);
ndbrequire(c_filegroup_hash.find(fg_ptr, f_ptr.p->m_filegroup_id));
req->senderData = op->key;
@@ -16099,29 +16486,34 @@ Dbdict::send_drop_file(Signal* signal, SchemaOp* op,
Uint32 ref= 0;
switch(op->m_obj_type){
case DictTabInfo::Datafile:
+ {
+ jam();
ref = TSMAN_REF;
break;
+ }
case DictTabInfo::Undofile:
+ {
+ jam();
ref = LGMAN_REF;
break;
+ }
default:
ndbrequire(false);
}
-
sendSignal(ref, GSN_DROP_FILE_REQ, signal,
DropFileImplReq::SignalLength, JBB);
}
void
-Dbdict::execDROP_OBJ_REF(Signal* signal){
- jamEntry();
-
+Dbdict::execDROP_OBJ_REF(Signal* signal)
+{
DropObjRef * const ref = (DropObjRef*)signal->getDataPtr();
-
Ptr<SchemaTransaction> trans_ptr;
+
+ jamEntry();
ndbrequire(c_Trans.find(trans_ptr, ref->senderData));
-
if(ref->errorCode != DropObjRef::NF_FakeErrorREF){
+ jam();
trans_ptr.p->setErrorCode(ref->errorCode);
}
Uint32 node = refToNode(ref->senderRef);
@@ -16129,65 +16521,61 @@ Dbdict::execDROP_OBJ_REF(Signal* signal){
}
void
-Dbdict::execDROP_OBJ_CONF(Signal* signal){
- jamEntry();
-
+Dbdict::execDROP_OBJ_CONF(Signal* signal)
+{
DropObjConf * const conf = (DropObjConf*)signal->getDataPtr();
-
Ptr<SchemaTransaction> trans_ptr;
+
+ jamEntry();
ndbrequire(c_Trans.find(trans_ptr, conf->senderData));
schemaOp_reply(signal, trans_ptr.p, refToNode(conf->senderRef));
}
void
-Dbdict::execDROP_FILE_REF(Signal* signal){
- jamEntry();
-
+Dbdict::execDROP_FILE_REF(Signal* signal)
+{
DropFileImplRef * ref = (DropFileImplRef*)signal->getDataPtr();
-
DropObjRecordPtr op_ptr;
+
+ jamEntry();
ndbrequire(c_opDropObj.find(op_ptr, ref->senderData));
op_ptr.p->m_errorCode = ref->errorCode;
-
execute(signal, op_ptr.p->m_callback, 0);
}
void
-Dbdict::execDROP_FILE_CONF(Signal* signal){
- jamEntry();
-
+Dbdict::execDROP_FILE_CONF(Signal* signal)
+{
DropFileImplConf * rep =
(DropFileImplConf*)signal->getDataPtr();
-
DropObjRecordPtr op_ptr;
+
+ jamEntry();
ndbrequire(c_opDropObj.find(op_ptr, rep->senderData));
-
execute(signal, op_ptr.p->m_callback, 0);
}
void
-Dbdict::execDROP_FILEGROUP_REF(Signal* signal){
- jamEntry();
-
+Dbdict::execDROP_FILEGROUP_REF(Signal* signal)
+{
DropFilegroupImplRef * ref = (DropFilegroupImplRef*)signal->getDataPtr();
-
DropObjRecordPtr op_ptr;
+
+ jamEntry();
ndbrequire(c_opDropObj.find(op_ptr, ref->senderData));
op_ptr.p->m_errorCode = ref->errorCode;
-
execute(signal, op_ptr.p->m_callback, 0);
}
void
-Dbdict::execDROP_FILEGROUP_CONF(Signal* signal){
- jamEntry();
-
+Dbdict::execDROP_FILEGROUP_CONF(Signal* signal)
+{
DropFilegroupImplConf * rep =
(DropFilegroupImplConf*)signal->getDataPtr();
-
DropObjRecordPtr op_ptr;
+
+ jamEntry();
ndbrequire(c_opDropObj.find(op_ptr, rep->senderData));
-
execute(signal, op_ptr.p->m_callback, 0);
}
@@ -16200,11 +16588,13 @@ Dbdict::drop_fg_prepare_start(Signal* signal, SchemaOp* op)
DictObject * obj = c_obj_pool.getPtr(fg_ptr.p->m_obj_ptr_i);
if (obj->m_ref_count)
{
+ jam();
op->m_errorCode = DropFilegroupRef::FilegroupInUse;
execute(signal, op->m_callback, 0);
}
else
{
+ jam();
send_drop_fg(signal, op, DropFilegroupImplReq::Prepare);
}
}
@@ -16216,7 +16606,7 @@ Dbdict::drop_fg_commit_start(Signal* signal, SchemaOp* op)
c_filegroup_pool.getPtr(fg_ptr, op->m_obj_ptr_i);
if (op->m_obj_type == DictTabInfo::LogfileGroup)
{
-
+ jam();
/**
* Mark all undofiles as dropped
*/
@@ -16225,6 +16615,7 @@ Dbdict::drop_fg_commit_start(Signal* signal, SchemaOp* op)
XSchemaFile * xsf = &c_schemaFile[c_schemaRecord.schemaPage != 0];
for(list.first(filePtr); !filePtr.isNull(); list.next(filePtr))
{
+ jam();
Uint32 objId = filePtr.p->key;
SchemaFile::TableEntry * tableEntry = getTableEntry(xsf, objId);
tableEntry->m_tableState = SchemaFile::DROP_TABLE_COMMITTED;
@@ -16237,13 +16628,14 @@ Dbdict::drop_fg_commit_start(Signal* signal, SchemaOp* op)
else if(op->m_obj_type == DictTabInfo::Tablespace)
{
FilegroupPtr lg_ptr;
+ jam();
ndbrequire(c_filegroup_hash.
find(lg_ptr,
fg_ptr.p->m_tablespace.m_default_logfile_group_id));
decrease_ref_count(lg_ptr.p->m_obj_ptr_i);
}
-
+ jam();
send_drop_fg(signal, op, DropFilegroupImplReq::Commit);
}
@@ -16252,16 +16644,17 @@ Dbdict::drop_fg_commit_complete(Signal* signal, SchemaOp* op)
{
FilegroupPtr fg_ptr;
c_filegroup_pool.getPtr(fg_ptr, op->m_obj_ptr_i);
-
+
+ jam();
release_object(fg_ptr.p->m_obj_ptr_i);
c_filegroup_hash.release(fg_ptr);
-
execute(signal, op->m_callback, 0);
}
void
Dbdict::drop_fg_abort_start(Signal* signal, SchemaOp* op)
{
+ jam();
send_drop_fg(signal, op, DropFilegroupImplReq::Abort);
}
diff --git a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp
index e5b918ca270..3fff330d699 100644
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp
@@ -2565,6 +2565,12 @@ private:
const SchemaFile::TableEntry *,
const SchemaFile::TableEntry *);
void restartDropTab_complete(Signal*, Uint32 callback, Uint32);
+
+ void restartDropObj(Signal*, Uint32, const SchemaFile::TableEntry *);
+ void restartDropObj_prepare_start_done(Signal*, Uint32, Uint32);
+ void restartDropObj_prepare_complete_done(Signal*, Uint32, Uint32);
+ void restartDropObj_commit_start_done(Signal*, Uint32, Uint32);
+ void restartDropObj_commit_complete_done(Signal*, Uint32, Uint32);
void restart_checkSchemaStatusComplete(Signal*, Uint32 callback, Uint32);
void restart_writeSchemaConf(Signal*, Uint32 callbackData, Uint32);
@@ -2657,7 +2663,8 @@ public:
void send_drop_fg(Signal*, SchemaOp*, DropFilegroupImplReq::RequestInfo);
void drop_undofile_prepare_start(Signal* signal, SchemaOp*);
-
+ void drop_undofile_commit_complete(Signal* signal, SchemaOp*);
+
int checkSingleUserMode(Uint32 senderRef);
};
diff --git a/storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp b/storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp
index 602881095c3..44326e213d0 100644
--- a/storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp
+++ b/storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp
@@ -15,7 +15,7 @@
#include <ndb_global.h>
-#include <ndb_version.h>
+#include <util/version.h>
#include <NdbMain.h>
#include <NdbOut.hpp>
diff --git a/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp b/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp
index b4dc445e94d..5bef13cd0b9 100644
--- a/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp
+++ b/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp
@@ -898,7 +898,7 @@ private:
void ndbsttorry10Lab(Signal *, Uint32 _line);
void createMutexes(Signal* signal, Uint32 no);
void createMutex_done(Signal* signal, Uint32 no, Uint32 retVal);
- void crashSystemAtGcpStop(Signal *);
+ void crashSystemAtGcpStop(Signal *, bool);
void sendFirstDictfragsreq(Signal *, TabRecordPtr regTabPtr);
void addtabrefuseLab(Signal *, ConnectRecordPtr regConnectPtr, Uint32 errorCode);
void GCP_SAVEhandling(Signal *, Uint32 nodeId);
diff --git a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
index 1fe932aaae8..762d4ea5141 100644
--- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
+++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
@@ -747,6 +747,14 @@ done:
}
ndbrequire(ok);
+ CRASH_INSERTION(7183);
+
+ if (ERROR_INSERTED(7185) && reason==CopyGCIReq::GLOBAL_CHECKPOINT)
+ {
+ jam();
+ return;
+ }
+
/* ----------------------------------------------------------------------- */
/* WE START BY TRYING TO OPEN THE FIRST RESTORABLE GCI FILE. */
/* ----------------------------------------------------------------------- */
@@ -1230,6 +1238,17 @@ void Dbdih::execDIH_RESTARTREQ(Signal* signal)
Uint32 ng = Sysfile::getNodeGroup(i, SYSFILE->nodeGroups);
ndbrequire(ng < MAX_NDB_NODES);
Uint32 gci = node_gcis[i];
+ if (gci < SYSFILE->lastCompletedGCI[i])
+ {
+ jam();
+ /**
+ * Handle case, where *I* know that node complete GCI
+ * but node does not...bug#29167
+ * i.e node died before it wrote own sysfile
+ */
+ gci = SYSFILE->lastCompletedGCI[i];
+ }
+
if (gci > node_group_gcis[ng])
{
jam();
@@ -4139,6 +4158,11 @@ void Dbdih::execNODE_FAILREP(Signal* signal)
CLEAR_ERROR_INSERT_VALUE;
}
+ if (ERROR_INSERTED(7184))
+ {
+ SET_ERROR_INSERT_VALUE(7000);
+ }
+
/*-------------------------------------------------------------------------*/
// The first step is to convert from a bit mask to an array of failed nodes.
/*-------------------------------------------------------------------------*/
@@ -4741,12 +4765,18 @@ void Dbdih::failedNodeLcpHandling(Signal* signal, NodeRecordPtr failedNodePtr)
jam();
const Uint32 nodeId = failedNodePtr.i;
- if (c_lcpState.m_participatingLQH.get(failedNodePtr.i)){
+ if (isMaster() && c_lcpState.m_participatingLQH.get(failedNodePtr.i))
+ {
/*----------------------------------------------------*/
/* THE NODE WAS INVOLVED IN A LOCAL CHECKPOINT. WE */
/* MUST UPDATE THE ACTIVE STATUS TO INDICATE THAT */
/* THE NODE HAVE MISSED A LOCAL CHECKPOINT. */
/*----------------------------------------------------*/
+
+ /**
+ * Bug#28717, Only master should do this, as this status is copied
+ * to other nodes
+ */
switch (failedNodePtr.p->activeStatus) {
case Sysfile::NS_Active:
jam();
@@ -7807,7 +7837,7 @@ void Dbdih::checkGcpStopLab(Signal* signal)
g_eventLogger.error("System crash due to GCP Stop in state = %u",
(Uint32) cgcpStatus);
#endif
- crashSystemAtGcpStop(signal);
+ crashSystemAtGcpStop(signal, false);
return;
}//if
} else {
@@ -7821,7 +7851,7 @@ void Dbdih::checkGcpStopLab(Signal* signal)
g_eventLogger.error("System crash due to GCP Stop in state = %u",
(Uint32) cgcpStatus);
#endif
- crashSystemAtGcpStop(signal);
+ crashSystemAtGcpStop(signal, false);
return;
}//if
} else {
@@ -11177,41 +11207,132 @@ void Dbdih::tableCloseLab(Signal* signal, FileRecordPtr filePtr)
* GCP stop detected,
* send SYSTEM_ERROR to all other alive nodes
*/
-void Dbdih::crashSystemAtGcpStop(Signal* signal)
+void Dbdih::crashSystemAtGcpStop(Signal* signal, bool local)
{
+ if (local)
+ goto dolocal;
+
switch(cgcpStatus){
+ case GCP_PREPARE_SENT:
+ {
+ jam();
+ /**
+ * We're waiting for a GCP PREPARE CONF
+ */
+ infoEvent("Detected GCP stop(%d)...sending kill to %s",
+ cgcpStatus, c_GCP_PREPARE_Counter.getText());
+ ndbout_c("Detected GCP stop(%d)...sending kill to %s",
+ cgcpStatus, c_GCP_PREPARE_Counter.getText());
+
+ {
+ NodeReceiverGroup rg(DBDIH, c_GCP_PREPARE_Counter);
+ signal->theData[0] = 7022;
+ sendSignal(rg, GSN_DUMP_STATE_ORD, signal, 1, JBA);
+ }
+
+ {
+ NodeReceiverGroup rg(NDBCNTR, c_GCP_PREPARE_Counter);
+ SystemError * const sysErr = (SystemError*)&signal->theData[0];
+ sysErr->errorCode = SystemError::GCPStopDetected;
+ sysErr->errorRef = reference();
+ sysErr->data1 = cgcpStatus;
+ sysErr->data2 = cgcpOrderBlocked;
+ sendSignal(rg, GSN_SYSTEM_ERROR, signal,
+ SystemError::SignalLength, JBA);
+ }
+ ndbrequire(!c_GCP_PREPARE_Counter.done());
+ return;
+ }
+ case GCP_COMMIT_SENT:
+ {
+ jam();
+ /**
+ * We're waiting for a GCP_NODEFINISH
+ */
+ infoEvent("Detected GCP stop(%d)...sending kill to %s",
+ cgcpStatus, c_GCP_COMMIT_Counter.getText());
+ ndbout_c("Detected GCP stop(%d)...sending kill to %s",
+ cgcpStatus, c_GCP_COMMIT_Counter.getText());
+
+ {
+ NodeReceiverGroup rg(DBDIH, c_GCP_COMMIT_Counter);
+ signal->theData[0] = 7022;
+ sendSignal(rg, GSN_DUMP_STATE_ORD, signal, 1, JBA);
+ }
+
+ {
+ NodeReceiverGroup rg(NDBCNTR, c_GCP_COMMIT_Counter);
+ SystemError * const sysErr = (SystemError*)&signal->theData[0];
+ sysErr->errorCode = SystemError::GCPStopDetected;
+ sysErr->errorRef = reference();
+ sysErr->data1 = cgcpStatus;
+ sysErr->data2 = cgcpOrderBlocked;
+ sendSignal(rg, GSN_SYSTEM_ERROR, signal,
+ SystemError::SignalLength, JBA);
+ }
+ ndbrequire(!c_GCP_COMMIT_Counter.done());
+ return;
+ }
case GCP_NODE_FINISHED:
{
+ jam();
/**
* We're waiting for a GCP save conf
*/
- ndbrequire(!c_GCP_SAVEREQ_Counter.done());
NodeReceiverGroup rg(DBLQH, c_GCP_SAVEREQ_Counter);
signal->theData[0] = 2305;
sendSignal(rg, GSN_DUMP_STATE_ORD, signal, 1, JBB);
- infoEvent("Detected GCP stop...sending kill to %s",
- c_GCP_SAVEREQ_Counter.getText());
- g_eventLogger.error("Detected GCP stop...sending kill to %s",
- c_GCP_SAVEREQ_Counter.getText());
+ infoEvent("Detected GCP stop(%d)...sending kill to %s",
+ cgcpStatus, c_GCP_SAVEREQ_Counter.getText());
+ ndbout_c("Detected GCP stop(%d)...sending kill to %s",
+ cgcpStatus, c_GCP_SAVEREQ_Counter.getText());
+ ndbrequire(!c_GCP_SAVEREQ_Counter.done());
return;
}
case GCP_SAVE_LQH_FINISHED:
- g_eventLogger.error("m_copyReason: %d m_waiting: %d",
- c_copyGCIMaster.m_copyReason,
- c_copyGCIMaster.m_waiting);
- break;
- case GCP_READY: // shut up lint
- case GCP_PREPARE_SENT:
- case GCP_COMMIT_SENT:
- break;
+ {
+ jam();
+ /**
+ * We're waiting for a COPY_GCICONF
+ */
+ infoEvent("Detected GCP stop(%d)...sending kill to %s",
+ cgcpStatus, c_COPY_GCIREQ_Counter.getText());
+ ndbout_c("Detected GCP stop(%d)...sending kill to %s",
+ cgcpStatus, c_COPY_GCIREQ_Counter.getText());
+
+ {
+ NodeReceiverGroup rg(DBDIH, c_COPY_GCIREQ_Counter);
+ signal->theData[0] = 7022;
+ sendSignal(rg, GSN_DUMP_STATE_ORD, signal, 1, JBA);
+ }
+
+ {
+ NodeReceiverGroup rg(NDBCNTR, c_COPY_GCIREQ_Counter);
+ SystemError * const sysErr = (SystemError*)&signal->theData[0];
+ sysErr->errorCode = SystemError::GCPStopDetected;
+ sysErr->errorRef = reference();
+ sysErr->data1 = cgcpStatus;
+ sysErr->data2 = cgcpOrderBlocked;
+ sendSignal(rg, GSN_SYSTEM_ERROR, signal,
+ SystemError::SignalLength, JBA);
+ }
+ ndbrequire(!c_COPY_GCIREQ_Counter.done());
+ return;
+ }
+ case GCP_READY: (void)1;
}
+
+dolocal:
+ ndbout_c("m_copyReason: %d m_waiting: %d",
+ c_copyGCIMaster.m_copyReason,
+ c_copyGCIMaster.m_waiting);
- g_eventLogger.error("c_copyGCISlave: sender{Data, Ref} %d %x reason: %d nextWord: %d",
- c_copyGCISlave.m_senderData,
- c_copyGCISlave.m_senderRef,
- c_copyGCISlave.m_copyReason,
- c_copyGCISlave.m_expectedNextWord);
+ ndbout_c("c_copyGCISlave: sender{Data, Ref} %d %x reason: %d nextWord: %d",
+ c_copyGCISlave.m_senderData,
+ c_copyGCISlave.m_senderRef,
+ c_copyGCISlave.m_copyReason,
+ c_copyGCISlave.m_expectedNextWord);
FileRecordPtr file0Ptr;
file0Ptr.i = crestartInfoFile[0];
@@ -11262,23 +11383,39 @@ void Dbdih::crashSystemAtGcpStop(Signal* signal)
c_TCGETOPSIZEREQ_Counter.getText());
ndbout_c("c_UPDATE_TOREQ_Counter = %s", c_UPDATE_TOREQ_Counter.getText());
- NodeRecordPtr nodePtr;
- for (nodePtr.i = 1; nodePtr.i < MAX_NDB_NODES; nodePtr.i++) {
+ if (local == false)
+ {
jam();
- ptrAss(nodePtr, nodeRecord);
- if (nodePtr.p->nodeStatus == NodeRecord::ALIVE) {
+ NodeRecordPtr nodePtr;
+ for (nodePtr.i = 1; nodePtr.i < MAX_NDB_NODES; nodePtr.i++) {
jam();
- const BlockReference ref =
- numberToRef(refToBlock(cntrlblockref), nodePtr.i);
- SystemError * const sysErr = (SystemError*)&signal->theData[0];
- sysErr->errorCode = SystemError::GCPStopDetected;
- sysErr->errorRef = reference();
- sysErr->data1 = cgcpStatus;
- sysErr->data2 = cgcpOrderBlocked;
- sendSignal(ref, GSN_SYSTEM_ERROR, signal,
- SystemError::SignalLength, JBA);
- }//if
- }//for
+ ptrAss(nodePtr, nodeRecord);
+ if (nodePtr.p->nodeStatus == NodeRecord::ALIVE) {
+ jam();
+ const BlockReference ref =
+ numberToRef(refToBlock(cntrlblockref), nodePtr.i);
+ SystemError * const sysErr = (SystemError*)&signal->theData[0];
+ sysErr->errorCode = SystemError::GCPStopDetected;
+ sysErr->errorRef = reference();
+ sysErr->data1 = cgcpStatus;
+ sysErr->data2 = cgcpOrderBlocked;
+ sendSignal(ref, GSN_SYSTEM_ERROR, signal,
+ SystemError::SignalLength, JBA);
+ }//if
+ }//for
+ }
+ else
+ {
+ jam();
+ SystemError * const sysErr = (SystemError*)&signal->theData[0];
+ sysErr->errorCode = SystemError::GCPStopDetected;
+ sysErr->errorRef = reference();
+ sysErr->data1 = cgcpStatus;
+ sysErr->data2 = cgcpOrderBlocked;
+ EXECUTE_DIRECT(NDBCNTR, GSN_SYSTEM_ERROR,
+ signal, SystemError::SignalLength);
+ ndbrequire(false);
+ }
return;
}//Dbdih::crashSystemAtGcpStop()
@@ -14373,6 +14510,12 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
infoEvent(buf);
}
}
+
+ if (arg == 7022)
+ {
+ jam();
+ crashSystemAtGcpStop(signal, true);
+ }
}//Dbdih::execDUMP_STATE_ORD()
void
diff --git a/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp b/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
index ba146fce005..6f8e5569831 100644
--- a/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
+++ b/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
@@ -71,7 +71,6 @@ class Dbtup;
/* CONSTANTS OF THE LOG PAGES */
/* ------------------------------------------------------------------------- */
#define ZPAGE_HEADER_SIZE 32
-#define ZNO_MBYTES_IN_FILE 16
#define ZPAGE_SIZE 8192
#define ZPAGES_IN_MBYTE 32
#define ZTWOLOG_NO_PAGES_IN_MBYTE 5
@@ -115,9 +114,6 @@ class Dbtup;
/* ------------------------------------------------------------------------- */
/* VARIOUS CONSTANTS USED AS FLAGS TO THE FILE MANAGER. */
/* ------------------------------------------------------------------------- */
-#define ZOPEN_READ 0
-#define ZOPEN_WRITE 1
-#define ZOPEN_READ_WRITE 2
#define ZVAR_NO_LOG_PAGE_WORD 1
#define ZLIST_OF_PAIRS 0
#define ZLIST_OF_PAIRS_SYNCH 16
@@ -142,7 +138,7 @@ class Dbtup;
/* IN THE MBYTE. */
/* ------------------------------------------------------------------------- */
#define ZFD_HEADER_SIZE 3
-#define ZFD_PART_SIZE 48
+#define ZFD_MBYTE_SIZE 3
#define ZLOG_HEAD_SIZE 8
#define ZNEXT_LOG_SIZE 2
#define ZABORT_LOG_SIZE 3
@@ -169,7 +165,6 @@ class Dbtup;
#define ZPOS_LOG_TYPE 0
#define ZPOS_NO_FD 1
#define ZPOS_FILE_NO 2
-#define ZMAX_LOG_FILES_IN_PAGE_ZERO 40
/* ------------------------------------------------------------------------- */
/* THE POSITIONS WITHIN A PREPARE LOG RECORD AND A NEW PREPARE */
/* LOG RECORD. */
@@ -1437,17 +1432,17 @@ public:
* header of each log file. That information is used during
* system restart to find the tail of the log.
*/
- UintR logLastPrepRef[16];
+ UintR *logLastPrepRef;
/**
* The max global checkpoint completed before the mbyte in the
* log file was started. One variable per mbyte.
*/
- UintR logMaxGciCompleted[16];
+ UintR *logMaxGciCompleted;
/**
* The max global checkpoint started before the mbyte in the log
* file was started. One variable per mbyte.
*/
- UintR logMaxGciStarted[16];
+ UintR *logMaxGciStarted;
/**
* This variable contains the file name as needed by the file
* system when opening the file.
@@ -1591,7 +1586,8 @@ public:
ACTIVE_WRITE_LOG = 17, ///< A write operation during
///< writing of log
READ_SR_INVALIDATE_PAGES = 18,
- WRITE_SR_INVALIDATE_PAGES = 19
+ WRITE_SR_INVALIDATE_PAGES = 19,
+ WRITE_SR_INVALIDATE_PAGES_UPDATE_PAGE0 = 20
};
/**
* We have to remember the log pages read.
@@ -2163,6 +2159,7 @@ private:
void execSTART_RECREF(Signal* signal);
void execGCP_SAVEREQ(Signal* signal);
+ void execFSOPENREF(Signal* signal);
void execFSOPENCONF(Signal* signal);
void execFSCLOSECONF(Signal* signal);
void execFSWRITECONF(Signal* signal);
@@ -2385,7 +2382,7 @@ private:
void errorReport(Signal* signal, int place);
void warningReport(Signal* signal, int place);
void invalidateLogAfterLastGCI(Signal *signal);
- void readFileInInvalidate(Signal *signal);
+ void readFileInInvalidate(Signal *signal, bool stepNext);
void exitFromInvalidate(Signal* signal);
Uint32 calcPageCheckSum(LogPageRecordPtr logP);
Uint32 handleLongTupKey(Signal* signal, Uint32* dataPtr, Uint32 len);
@@ -2671,6 +2668,8 @@ private:
LogPartRecord *logPartRecord;
LogPartRecordPtr logPartPtr;
UintR clogPartFileSize;
+ Uint32 clogFileSize; // In MBYTE
+ Uint32 cmaxLogFilesInPageZero; //
// Configurable
LogFileRecord *logFileRecord;
@@ -2678,13 +2677,15 @@ private:
UintR cfirstfreeLogFile;
UintR clogFileFileSize;
-#define ZLFO_FILE_SIZE 256 /* MAX 256 OUTSTANDING FILE OPERATIONS */
+#define ZLFO_MIN_FILE_SIZE 256
+// RedoBuffer/32K minimum ZLFO_MIN_FILE_SIZE
LogFileOperationRecord *logFileOperationRecord;
LogFileOperationRecordPtr lfoPtr;
UintR cfirstfreeLfo;
UintR clfoFileSize;
LogPageRecord *logPageRecord;
+ void *logPageRecordUnaligned;
LogPageRecordPtr logPagePtr;
UintR cfirstfreeLogPage;
UintR clogPageFileSize;
@@ -2695,7 +2696,7 @@ private:
UintR cfirstfreePageRef;
UintR cpageRefFileSize;
-#define ZSCANREC_FILE_SIZE 100
+// Configurable
ArrayPool<ScanRecord> c_scanRecordPool;
ScanRecordPtr scanptr;
UintR cscanNoFreeRec;
@@ -2888,6 +2889,7 @@ private:
UintR ctransidHash[1024];
Uint32 c_diskless;
+ Uint32 c_o_direct;
Uint32 c_error_insert_table_id;
public:
diff --git a/storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp b/storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp
index c054c227c8e..d6411ee1cb9 100644
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp
@@ -30,11 +30,11 @@ void Dblqh::initData()
cgcprecFileSize = ZGCPREC_FILE_SIZE;
chostFileSize = MAX_NDB_NODES;
clcpFileSize = ZNO_CONCURRENT_LCP;
- clfoFileSize = ZLFO_FILE_SIZE;
+ clfoFileSize = 0;
clogFileFileSize = 0;
clogPartFileSize = ZLOG_PART_FILE_SIZE;
cpageRefFileSize = ZPAGE_REF_FILE_SIZE;
- cscanrecFileSize = ZSCANREC_FILE_SIZE;
+ cscanrecFileSize = 0;
ctabrecFileSize = 0;
ctcConnectrecFileSize = 0;
ctcNodeFailrecFileSize = MAX_NDB_NODES;
@@ -49,6 +49,7 @@ void Dblqh::initData()
logFileRecord = 0;
logFileOperationRecord = 0;
logPageRecord = 0;
+ logPageRecordUnaligned= 0;
pageRefRecord = 0;
tablerec = 0;
tcConnectionrec = 0;
@@ -60,6 +61,8 @@ void Dblqh::initData()
cLqhTimeOutCheckCount = 0;
cbookedAccOps = 0;
m_backup_ptr = RNIL;
+ clogFileSize = 16;
+ cmaxLogFilesInPageZero = 40;
}//Dblqh::initData()
void Dblqh::initRecords()
@@ -105,10 +108,13 @@ void Dblqh::initRecords()
sizeof(LogFileOperationRecord),
clfoFileSize);
- logPageRecord = (LogPageRecord*)allocRecord("LogPageRecord",
- sizeof(LogPageRecord),
- clogPageFileSize,
- false);
+ logPageRecord =
+ (LogPageRecord*)allocRecordAligned("LogPageRecord",
+ sizeof(LogPageRecord),
+ clogPageFileSize,
+ &logPageRecordUnaligned,
+ NDB_O_DIRECT_WRITE_ALIGNMENT,
+ false);
pageRefRecord = (PageRefRecord*)allocRecord("PageRefRecord",
sizeof(PageRefRecord),
@@ -260,6 +266,7 @@ Dblqh::Dblqh(Block_context& ctx):
addRecSignal(GSN_START_FRAGREQ, &Dblqh::execSTART_FRAGREQ);
addRecSignal(GSN_START_RECREF, &Dblqh::execSTART_RECREF);
addRecSignal(GSN_GCP_SAVEREQ, &Dblqh::execGCP_SAVEREQ);
+ addRecSignal(GSN_FSOPENREF, &Dblqh::execFSOPENREF, true);
addRecSignal(GSN_FSOPENCONF, &Dblqh::execFSOPENCONF);
addRecSignal(GSN_FSCLOSECONF, &Dblqh::execFSCLOSECONF);
addRecSignal(GSN_FSWRITECONF, &Dblqh::execFSWRITECONF);
@@ -377,7 +384,7 @@ Dblqh::~Dblqh()
sizeof(LogFileOperationRecord),
clfoFileSize);
- deallocRecord((void**)&logPageRecord,
+ deallocRecord((void**)&logPageRecordUnaligned,
"LogPageRecord",
sizeof(LogPageRecord),
clogPageFileSize);
diff --git a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
index ff4c5b2648b..efb88bfccd2 100644
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
@@ -139,6 +139,10 @@ operator<<(NdbOut& out, Operation_t op)
//#define MARKER_TRACE 1
//#define TRACE_SCAN_TAKEOVER 1
+#ifndef DEBUG_REDO
+#define DEBUG_REDO 0
+#endif
+
const Uint32 NR_ScanNo = 0;
#if defined VM_TRACE || defined ERROR_INSERT || defined NDBD_TRACENR
@@ -1023,6 +1027,11 @@ void Dblqh::execREAD_CONFIG_REQ(Signal* signal)
clogPageFileSize+= (16 - mega_byte_part);
}
+ /* maximum number of log file operations */
+ clfoFileSize = clogPageFileSize;
+ if (clfoFileSize < ZLFO_MIN_FILE_SIZE)
+ clfoFileSize = ZLFO_MIN_FILE_SIZE;
+
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_LQH_TABLE, &ctabrecFileSize));
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_LQH_TC_CONNECT,
&ctcConnectrecFileSize));
@@ -1031,14 +1040,44 @@ void Dblqh::execREAD_CONFIG_REQ(Signal* signal)
cmaxAccOps = cscanrecFileSize * MAX_PARALLEL_OP_PER_SCAN;
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_DISCLESS, &c_diskless));
+ c_o_direct = true;
+ ndb_mgm_get_int_parameter(p, CFG_DB_O_DIRECT, &c_o_direct);
Uint32 tmp= 0;
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_LQH_FRAG, &tmp));
c_fragment_pool.setSize(tmp);
+ if (!ndb_mgm_get_int_parameter(p, CFG_DB_REDOLOG_FILE_SIZE,
+ &clogFileSize))
+ {
+ // convert to mbyte
+ clogFileSize = (clogFileSize + 1024*1024 - 1) / (1024 * 1024);
+ ndbrequire(clogFileSize >= 4 && clogFileSize <= 1024);
+ }
+
+ cmaxLogFilesInPageZero = (ZPAGE_SIZE - ZPAGE_HEADER_SIZE - 128) /
+ (ZFD_MBYTE_SIZE * clogFileSize);
+
+ /**
+ * "Old" cmaxLogFilesInPageZero was 40
+ * Each FD need 3 words per mb, require that they can fit into 1 page
+ * (atleast 1 FD)
+ * Is also checked in ConfigInfo.cpp (max FragmentLogFileSize = 1Gb)
+ * 1Gb = 1024Mb => 3(ZFD_MBYTE_SIZE) * 1024 < 8192 (ZPAGE_SIZE)
+ */
+ if (cmaxLogFilesInPageZero > 40)
+ {
+ jam();
+ cmaxLogFilesInPageZero = 40;
+ }
+ else
+ {
+ ndbrequire(cmaxLogFilesInPageZero);
+ }
+
initRecords();
initialiseRecordsLab(signal, 0, ref, senderData);
-
+
return;
}//Dblqh::execSIZEALT_REP()
@@ -8507,9 +8546,32 @@ void Dblqh::continueAfterReceivingAllAiLab(Signal* signal)
AccScanReq::setLockMode(req->requestInfo, scanptr.p->scanLockMode);
AccScanReq::setReadCommittedFlag(req->requestInfo, scanptr.p->readCommitted);
AccScanReq::setDescendingFlag(req->requestInfo, scanptr.p->descending);
- AccScanReq::setNoDiskScanFlag(req->requestInfo,
- !tcConnectptr.p->m_disk_table);
- AccScanReq::setLcpScanFlag(req->requestInfo, scanptr.p->lcpScan);
+
+ if (refToBlock(tcConnectptr.p->clientBlockref) == BACKUP)
+ {
+ if (scanptr.p->lcpScan)
+ {
+ AccScanReq::setNoDiskScanFlag(req->requestInfo, 1);
+ AccScanReq::setLcpScanFlag(req->requestInfo, 1);
+ }
+ else
+ {
+ /* If backup scan disktables in disk order */
+ AccScanReq::setNoDiskScanFlag(req->requestInfo,
+ !tcConnectptr.p->m_disk_table);
+ AccScanReq::setLcpScanFlag(req->requestInfo, 0);
+ }
+ }
+ else
+ {
+#if BUG_27776_FIXED
+ AccScanReq::setNoDiskScanFlag(req->requestInfo,
+ !tcConnectptr.p->m_disk_table);
+#else
+ AccScanReq::setNoDiskScanFlag(req->requestInfo, 1);
+#endif
+ AccScanReq::setLcpScanFlag(req->requestInfo, 0);
+ }
req->transId1 = tcConnectptr.p->transid[0];
req->transId2 = tcConnectptr.p->transid[1];
@@ -11732,6 +11794,13 @@ void Dblqh::sendLCP_COMPLETE_REP(Signal* signal, Uint32 lcpId)
jam();
sendEMPTY_LCP_CONF(signal, true);
}
+
+ if (getNodeState().getNodeRestartInProgress() && cstartRecReq != 3)
+ {
+ jam();
+ ndbrequire(cstartRecReq == 2);
+ cstartRecReq = 3;
+ }
return;
}//Dblqh::sendCOMP_LCP_ROUND()
@@ -11765,9 +11834,9 @@ void Dblqh::sendStartLcp(Signal* signal)
Uint32 Dblqh::remainingLogSize(const LogFileRecordPtr &sltCurrLogFilePtr,
const LogPartRecordPtr &sltLogPartPtr)
{
- Uint32 hf = sltCurrLogFilePtr.p->fileNo*ZNO_MBYTES_IN_FILE+sltCurrLogFilePtr.p->currentMbyte;
- Uint32 tf = sltLogPartPtr.p->logTailFileNo*ZNO_MBYTES_IN_FILE+sltLogPartPtr.p->logTailMbyte;
- Uint32 sz = sltLogPartPtr.p->noLogFiles*ZNO_MBYTES_IN_FILE;
+ Uint32 hf = sltCurrLogFilePtr.p->fileNo*clogFileSize+sltCurrLogFilePtr.p->currentMbyte;
+ Uint32 tf = sltLogPartPtr.p->logTailFileNo*clogFileSize+sltLogPartPtr.p->logTailMbyte;
+ Uint32 sz = sltLogPartPtr.p->noLogFiles*clogFileSize;
if (tf > hf) hf += sz;
return sz-(hf-tf);
}
@@ -11825,7 +11894,7 @@ void Dblqh::setLogTail(Signal* signal, Uint32 keepGci)
/* ------------------------------------------------------------------------- */
SLT_LOOP:
for (tsltIndex = tsltStartMbyte;
- tsltIndex <= ZNO_MBYTES_IN_FILE - 1;
+ tsltIndex <= clogFileSize - 1;
tsltIndex++) {
if (sltLogFilePtr.p->logMaxGciStarted[tsltIndex] >= keepGci) {
/* ------------------------------------------------------------------------- */
@@ -11841,7 +11910,7 @@ void Dblqh::setLogTail(Signal* signal, Uint32 keepGci)
/* ------------------------------------------------------------------------- */
/*STEPPING BACK INCLUDES ALSO STEPPING BACK TO THE PREVIOUS LOG FILE. */
/* ------------------------------------------------------------------------- */
- tsltMbyte = ZNO_MBYTES_IN_FILE - 1;
+ tsltMbyte = clogFileSize - 1;
sltLogFilePtr.i = sltLogFilePtr.p->prevLogFile;
ptrCheckGuard(sltLogFilePtr, clogFileFileSize, logFileRecord);
}//if
@@ -11879,7 +11948,7 @@ void Dblqh::setLogTail(Signal* signal, Uint32 keepGci)
UintR ToldTailFileNo = sltLogPartPtr.p->logTailFileNo;
UintR ToldTailMByte = sltLogPartPtr.p->logTailMbyte;
- arrGuard(tsltMbyte, 16);
+ arrGuard(tsltMbyte, clogFileSize);
sltLogPartPtr.p->logTailFileNo =
sltLogFilePtr.p->logLastPrepRef[tsltMbyte] >> 16;
/* ------------------------------------------------------------------------- */
@@ -12002,15 +12071,27 @@ void Dblqh::execGCP_SAVEREQ(Signal* signal)
}//if
ndbrequire(ccurrentGcprec == RNIL);
- ccurrentGcprec = 0;
- gcpPtr.i = ccurrentGcprec;
- ptrCheckGuard(gcpPtr, cgcprecFileSize, gcpRecord);
-
cnewestCompletedGci = gci;
if (gci > cnewestGci) {
jam();
cnewestGci = gci;
}//if
+
+ if(getNodeState().getNodeRestartInProgress() && cstartRecReq < 3)
+ {
+ GCPSaveRef * const saveRef = (GCPSaveRef*)&signal->theData[0];
+ saveRef->dihPtr = dihPtr;
+ saveRef->nodeId = getOwnNodeId();
+ saveRef->gci = gci;
+ saveRef->errorCode = GCPSaveRef::NodeRestartInProgress;
+ sendSignal(dihBlockRef, GSN_GCP_SAVEREF, signal,
+ GCPSaveRef::SignalLength, JBB);
+ return;
+ }
+
+ ccurrentGcprec = 0;
+ gcpPtr.i = ccurrentGcprec;
+ ptrCheckGuard(gcpPtr, cgcprecFileSize, gcpRecord);
gcpPtr.p->gcpBlockref = dihBlockRef;
gcpPtr.p->gcpUserptr = dihPtr;
@@ -12264,9 +12345,6 @@ void Dblqh::execFSCLOSECONF(Signal* signal)
case LogFileRecord::CLOSE_SR_INVALIDATE_PAGES:
jam();
logFilePtr.p->logFileStatus = LogFileRecord::CLOSED;
- // Set the prev file to check if we shall close it.
- logFilePtr.i = logFilePtr.p->prevLogFile;
- ptrCheckGuard(logFilePtr, clogFileFileSize, logFileRecord);
logPartPtr.i = logFilePtr.p->logPartRec;
ptrCheckGuard(logPartPtr, clogPartFileSize, logPartRecord);
@@ -12316,7 +12394,7 @@ void Dblqh::execFSOPENCONF(Signal* signal)
case LogFileRecord::OPEN_SR_INVALIDATE_PAGES:
jam();
logFilePtr.p->logFileStatus = LogFileRecord::OPEN;
- readFileInInvalidate(signal);
+ readFileInInvalidate(signal, false);
return;
case LogFileRecord::OPENING_INIT:
jam();
@@ -12379,6 +12457,26 @@ void Dblqh::execFSOPENCONF(Signal* signal)
}//switch
}//Dblqh::execFSOPENCONF()
+void
+Dblqh::execFSOPENREF(Signal* signal)
+{
+ jamEntry();
+ FsRef* ref = (FsRef*)signal->getDataPtr();
+ Uint32 err = ref->errorCode;
+ if (err == FsRef::fsErrInvalidFileSize)
+ {
+ char buf[256];
+ BaseString::snprintf(buf, sizeof(buf),
+ "Invalid file size for redo logfile, "
+ " size only changable with --initial");
+ progError(__LINE__,
+ NDBD_EXIT_INVALID_CONFIG,
+ buf);
+ return;
+ }
+
+ SimulatedBlock::execFSOPENREF(signal);
+}
/* ************>> */
/* FSREADCONF > */
@@ -12496,6 +12594,7 @@ void Dblqh::execFSWRITECONF(Signal* signal)
case LogFileOperationRecord::WRITE_SR_INVALIDATE_PAGES:
jam();
invalidateLogAfterLastGCI(signal);
+ CRASH_INSERTION(5047);
return;
case LogFileOperationRecord::WRITE_PAGE_ZERO:
jam();
@@ -12533,6 +12632,14 @@ void Dblqh::execFSWRITECONF(Signal* signal)
jam();
firstPageWriteLab(signal);
return;
+ case LogFileOperationRecord::WRITE_SR_INVALIDATE_PAGES_UPDATE_PAGE0:
+ jam();
+ // We are done...send completed signal and exit this phase.
+ releaseLfo(signal);
+ signal->theData[0] = ZSR_FOURTH_COMP;
+ signal->theData[1] = logPartPtr.i;
+ sendSignal(cownref, GSN_CONTINUEB, signal, 2, JBB);
+ return;
default:
jam();
systemErrorLab(signal, __LINE__);
@@ -13024,7 +13131,7 @@ void Dblqh::openFileInitLab(Signal* signal)
{
logFilePtr.p->logFileStatus = LogFileRecord::OPEN_INIT;
seizeLogpage(signal);
- writeSinglePage(signal, (ZNO_MBYTES_IN_FILE * ZPAGES_IN_MBYTE) - 1,
+ writeSinglePage(signal, (clogFileSize * ZPAGES_IN_MBYTE) - 1,
ZPAGE_SIZE - 1, __LINE__);
lfoPtr.p->lfoState = LogFileOperationRecord::INIT_WRITE_AT_END;
return;
@@ -13087,7 +13194,7 @@ void Dblqh::writeInitMbyteLab(Signal* signal)
{
releaseLfo(signal);
logFilePtr.p->currentMbyte = logFilePtr.p->currentMbyte + 1;
- if (logFilePtr.p->currentMbyte == ZNO_MBYTES_IN_FILE) {
+ if (logFilePtr.p->currentMbyte == clogFileSize) {
jam();
releaseLogpage(signal);
logFilePtr.p->logFileStatus = LogFileRecord::CLOSING_INIT;
@@ -13207,7 +13314,7 @@ void Dblqh::initLogfile(Signal* signal, Uint32 fileNo)
logFilePtr.p->lastPageWritten = 0;
logFilePtr.p->logPageZero = RNIL;
logFilePtr.p->currentMbyte = 0;
- for (tilIndex = 0; tilIndex <= 15; tilIndex++) {
+ for (tilIndex = 0; tilIndex < clogFileSize; tilIndex++) {
logFilePtr.p->logMaxGciCompleted[tilIndex] = (UintR)-1;
logFilePtr.p->logMaxGciStarted[tilIndex] = (UintR)-1;
logFilePtr.p->logLastPrepRef[tilIndex] = 0;
@@ -13258,8 +13365,14 @@ void Dblqh::openFileRw(Signal* signal, LogFileRecordPtr olfLogFilePtr)
signal->theData[3] = olfLogFilePtr.p->fileName[1];
signal->theData[4] = olfLogFilePtr.p->fileName[2];
signal->theData[5] = olfLogFilePtr.p->fileName[3];
- signal->theData[6] = ZOPEN_READ_WRITE | FsOpenReq::OM_AUTOSYNC;
+ signal->theData[6] = FsOpenReq::OM_READWRITE | FsOpenReq::OM_AUTOSYNC | FsOpenReq::OM_CHECK_SIZE;
+ if (c_o_direct)
+ signal->theData[6] |= FsOpenReq::OM_DIRECT;
req->auto_sync_size = MAX_REDO_PAGES_WITHOUT_SYNCH * sizeof(LogPageRecord);
+ Uint64 sz = clogFileSize;
+ sz *= 1024; sz *= 1024;
+ req->file_size_hi = sz >> 32;
+ req->file_size_lo = sz & 0xFFFFFFFF;
sendSignal(NDBFS_REF, GSN_FSOPENREQ, signal, FsOpenReq::SignalLength, JBA);
}//Dblqh::openFileRw()
@@ -13278,7 +13391,9 @@ void Dblqh::openLogfileInit(Signal* signal)
signal->theData[3] = logFilePtr.p->fileName[1];
signal->theData[4] = logFilePtr.p->fileName[2];
signal->theData[5] = logFilePtr.p->fileName[3];
- signal->theData[6] = 0x302 | FsOpenReq::OM_AUTOSYNC;
+ signal->theData[6] = FsOpenReq::OM_READWRITE | FsOpenReq::OM_TRUNCATE | FsOpenReq::OM_CREATE | FsOpenReq::OM_AUTOSYNC;
+ if (c_o_direct)
+ signal->theData[6] |= FsOpenReq::OM_DIRECT;
req->auto_sync_size = MAX_REDO_PAGES_WITHOUT_SYNCH * sizeof(LogPageRecord);
sendSignal(NDBFS_REF, GSN_FSOPENREQ, signal, FsOpenReq::SignalLength, JBA);
}//Dblqh::openLogfileInit()
@@ -13314,8 +13429,14 @@ void Dblqh::openNextLogfile(Signal* signal)
signal->theData[3] = onlLogFilePtr.p->fileName[1];
signal->theData[4] = onlLogFilePtr.p->fileName[2];
signal->theData[5] = onlLogFilePtr.p->fileName[3];
- signal->theData[6] = 2 | FsOpenReq::OM_AUTOSYNC;
+ signal->theData[6] = FsOpenReq::OM_READWRITE | FsOpenReq::OM_AUTOSYNC | FsOpenReq::OM_CHECK_SIZE;
+ if (c_o_direct)
+ signal->theData[6] |= FsOpenReq::OM_DIRECT;
req->auto_sync_size = MAX_REDO_PAGES_WITHOUT_SYNCH * sizeof(LogPageRecord);
+ Uint64 sz = clogFileSize;
+ sz *= 1024; sz *= 1024;
+ req->file_size_hi = sz >> 32;
+ req->file_size_lo = sz & 0xFFFFFFFF;
sendSignal(NDBFS_REF, GSN_FSOPENREQ, signal, FsOpenReq::SignalLength, JBA);
}//if
}//Dblqh::openNextLogfile()
@@ -13446,7 +13567,7 @@ void Dblqh::writeFileDescriptor(Signal* signal)
/* -------------------------------------------------- */
/* START BY WRITING TO LOG FILE RECORD */
/* -------------------------------------------------- */
- arrGuard(logFilePtr.p->currentMbyte, 16);
+ arrGuard(logFilePtr.p->currentMbyte, clogFileSize);
logFilePtr.p->logMaxGciCompleted[logFilePtr.p->currentMbyte] =
logPartPtr.p->logPartNewestCompletedGCI;
logFilePtr.p->logMaxGciStarted[logFilePtr.p->currentMbyte] = cnewestGci;
@@ -13472,10 +13593,7 @@ void Dblqh::writeFileDescriptor(Signal* signal)
/* ------------------------------------------------------------------------- */
void Dblqh::writeFileHeaderOpen(Signal* signal, Uint32 wmoType)
{
- LogFileRecordPtr wmoLogFilePtr;
UintR twmoNoLogDescriptors;
- UintR twmoLoop;
- UintR twmoIndex;
/* -------------------------------------------------- */
/* WRITE HEADER INFORMATION IN THE NEW FILE. */
@@ -13483,52 +13601,44 @@ void Dblqh::writeFileHeaderOpen(Signal* signal, Uint32 wmoType)
logPagePtr.p->logPageWord[ZPAGE_HEADER_SIZE + ZPOS_LOG_TYPE] = ZFD_TYPE;
logPagePtr.p->logPageWord[ZPAGE_HEADER_SIZE + ZPOS_FILE_NO] =
logFilePtr.p->fileNo;
- if (logPartPtr.p->noLogFiles > ZMAX_LOG_FILES_IN_PAGE_ZERO) {
+ if (logPartPtr.p->noLogFiles > cmaxLogFilesInPageZero) {
jam();
- twmoNoLogDescriptors = ZMAX_LOG_FILES_IN_PAGE_ZERO;
+ twmoNoLogDescriptors = cmaxLogFilesInPageZero;
} else {
jam();
twmoNoLogDescriptors = logPartPtr.p->noLogFiles;
}//if
logPagePtr.p->logPageWord[ZPAGE_HEADER_SIZE + ZPOS_NO_FD] =
twmoNoLogDescriptors;
- wmoLogFilePtr.i = logFilePtr.i;
- twmoLoop = 0;
-WMO_LOOP:
- jam();
- if (twmoLoop < twmoNoLogDescriptors) {
- jam();
- ptrCheckGuard(wmoLogFilePtr, clogFileFileSize, logFileRecord);
- for (twmoIndex = 0; twmoIndex <= ZNO_MBYTES_IN_FILE - 1; twmoIndex++) {
- jam();
- arrGuard(((ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE) +
- (twmoLoop * ZFD_PART_SIZE)) + twmoIndex, ZPAGE_SIZE);
- logPagePtr.p->logPageWord[((ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE) +
- (twmoLoop * ZFD_PART_SIZE)) + twmoIndex] =
- wmoLogFilePtr.p->logMaxGciCompleted[twmoIndex];
- arrGuard((((ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE) +
- (twmoLoop * ZFD_PART_SIZE)) + ZNO_MBYTES_IN_FILE) +
- twmoIndex, ZPAGE_SIZE);
- logPagePtr.p->logPageWord[(((ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE) +
- (twmoLoop * ZFD_PART_SIZE)) + ZNO_MBYTES_IN_FILE) + twmoIndex] =
- wmoLogFilePtr.p->logMaxGciStarted[twmoIndex];
- arrGuard((((ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE) +
- (twmoLoop * ZFD_PART_SIZE)) + (2 * ZNO_MBYTES_IN_FILE)) +
- twmoIndex, ZPAGE_SIZE);
- logPagePtr.p->logPageWord[(((ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE) +
- (twmoLoop * ZFD_PART_SIZE)) + (2 * ZNO_MBYTES_IN_FILE)) + twmoIndex] =
- wmoLogFilePtr.p->logLastPrepRef[twmoIndex];
- }//for
- wmoLogFilePtr.i = wmoLogFilePtr.p->prevLogFile;
- twmoLoop = twmoLoop + 1;
- goto WMO_LOOP;
- }//if
- logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX] =
- (ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE) +
- (ZFD_PART_SIZE * twmoNoLogDescriptors);
- arrGuard(logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX], ZPAGE_SIZE);
- logPagePtr.p->logPageWord[logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX]] =
- ZNEXT_LOG_RECORD_TYPE;
+
+ {
+ Uint32 pos = ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE;
+ LogFileRecordPtr filePtr = logFilePtr;
+ for (Uint32 fd = 0; fd < twmoNoLogDescriptors; fd++)
+ {
+ jam();
+ ptrCheckGuard(filePtr, clogFileFileSize, logFileRecord);
+ for (Uint32 mb = 0; mb < clogFileSize; mb ++)
+ {
+ jam();
+ Uint32 pos0 = pos + fd * (ZFD_MBYTE_SIZE * clogFileSize) + mb;
+ Uint32 pos1 = pos0 + clogFileSize;
+ Uint32 pos2 = pos1 + clogFileSize;
+ arrGuard(pos0, ZPAGE_SIZE);
+ arrGuard(pos1, ZPAGE_SIZE);
+ arrGuard(pos2, ZPAGE_SIZE);
+ logPagePtr.p->logPageWord[pos0] = filePtr.p->logMaxGciCompleted[mb];
+ logPagePtr.p->logPageWord[pos1] = filePtr.p->logMaxGciStarted[mb];
+ logPagePtr.p->logPageWord[pos2] = filePtr.p->logLastPrepRef[mb];
+ }
+ filePtr.i = filePtr.p->prevLogFile;
+ }
+ pos += (twmoNoLogDescriptors * ZFD_MBYTE_SIZE * clogFileSize);
+ arrGuard(pos, ZPAGE_SIZE);
+ logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX] = pos;
+ logPagePtr.p->logPageWord[pos] = ZNEXT_LOG_RECORD_TYPE;
+ }
+
/* ------------------------------------------------------- */
/* THIS IS A SPECIAL WRITE OF THE FIRST PAGE IN THE */
/* LOG FILE. THIS HAS SPECIAL SIGNIFANCE TO FIND */
@@ -13608,6 +13718,12 @@ void Dblqh::writeSinglePage(Signal* signal, Uint32 pageNo,
signal->theData[6] = logPagePtr.i;
signal->theData[7] = pageNo;
sendSignal(NDBFS_REF, GSN_FSWRITEREQ, signal, 8, JBA);
+
+ if (DEBUG_REDO)
+ ndbout_c("writeSingle 1 page at part: %u file: %u pos: %u",
+ logPartPtr.i,
+ logFilePtr.p->fileNo,
+ pageNo);
}//Dblqh::writeSinglePage()
/* ##########################################################################
@@ -13673,9 +13789,15 @@ void Dblqh::openSrLastFileLab(Signal* signal)
void Dblqh::readSrLastFileLab(Signal* signal)
{
logPartPtr.p->logLap = logPagePtr.p->logPageWord[ZPOS_LOG_LAP];
- if (logPartPtr.p->noLogFiles > ZMAX_LOG_FILES_IN_PAGE_ZERO) {
- jam();
- initGciInLogFileRec(signal, ZMAX_LOG_FILES_IN_PAGE_ZERO);
+ if (DEBUG_REDO)
+ ndbout_c("readSrLastFileLab part: %u logExecState: %u logPartState: %u logLap: %u",
+ logPartPtr.i,
+ logPartPtr.p->logExecState,
+ logPartPtr.p->logPartState,
+ logPartPtr.p->logLap);
+ if (logPartPtr.p->noLogFiles > cmaxLogFilesInPageZero) {
+ jam();
+ initGciInLogFileRec(signal, cmaxLogFilesInPageZero);
} else {
jam();
initGciInLogFileRec(signal, logPartPtr.p->noLogFiles);
@@ -13700,7 +13822,7 @@ void Dblqh::readSrLastMbyteLab(Signal* signal)
logPartPtr.p->lastMbyte = logFilePtr.p->currentMbyte - 1;
}//if
}//if
- arrGuard(logFilePtr.p->currentMbyte, 16);
+ arrGuard(logFilePtr.p->currentMbyte, clogFileSize);
logFilePtr.p->logMaxGciCompleted[logFilePtr.p->currentMbyte] =
logPagePtr.p->logPageWord[ZPOS_MAX_GCI_COMPLETED];
logFilePtr.p->logMaxGciStarted[logFilePtr.p->currentMbyte] =
@@ -13708,7 +13830,7 @@ void Dblqh::readSrLastMbyteLab(Signal* signal)
logFilePtr.p->logLastPrepRef[logFilePtr.p->currentMbyte] =
logPagePtr.p->logPageWord[ZLAST_LOG_PREP_REF];
releaseLogpage(signal);
- if (logFilePtr.p->currentMbyte < (ZNO_MBYTES_IN_FILE - 1)) {
+ if (logFilePtr.p->currentMbyte < (clogFileSize - 1)) {
jam();
logFilePtr.p->currentMbyte++;
readSinglePage(signal, ZPAGES_IN_MBYTE * logFilePtr.p->currentMbyte);
@@ -13722,21 +13844,21 @@ void Dblqh::readSrLastMbyteLab(Signal* signal)
* ---------------------------------------------------------------------- */
if (logPartPtr.p->lastMbyte == ZNIL) {
jam();
- logPartPtr.p->lastMbyte = ZNO_MBYTES_IN_FILE - 1;
+ logPartPtr.p->lastMbyte = clogFileSize - 1;
}//if
}//if
logFilePtr.p->logFileStatus = LogFileRecord::CLOSING_SR;
closeFile(signal, logFilePtr, __LINE__);
- if (logPartPtr.p->noLogFiles > ZMAX_LOG_FILES_IN_PAGE_ZERO) {
+ if (logPartPtr.p->noLogFiles > cmaxLogFilesInPageZero) {
Uint32 fileNo;
- if (logFilePtr.p->fileNo >= ZMAX_LOG_FILES_IN_PAGE_ZERO) {
+ if (logFilePtr.p->fileNo >= cmaxLogFilesInPageZero) {
jam();
- fileNo = logFilePtr.p->fileNo - ZMAX_LOG_FILES_IN_PAGE_ZERO;
+ fileNo = logFilePtr.p->fileNo - cmaxLogFilesInPageZero;
} else {
jam();
fileNo =
(logPartPtr.p->noLogFiles + logFilePtr.p->fileNo) -
- ZMAX_LOG_FILES_IN_PAGE_ZERO;
+ cmaxLogFilesInPageZero;
}//if
if (fileNo == 0) {
jam();
@@ -13746,11 +13868,11 @@ void Dblqh::readSrLastMbyteLab(Signal* signal)
* -------------------------------------------------------------------- */
fileNo = 1;
logPartPtr.p->srRemainingFiles =
- logPartPtr.p->noLogFiles - (ZMAX_LOG_FILES_IN_PAGE_ZERO - 1);
+ logPartPtr.p->noLogFiles - (cmaxLogFilesInPageZero - 1);
} else {
jam();
logPartPtr.p->srRemainingFiles =
- logPartPtr.p->noLogFiles - ZMAX_LOG_FILES_IN_PAGE_ZERO;
+ logPartPtr.p->noLogFiles - cmaxLogFilesInPageZero;
}//if
LogFileRecordPtr locLogFilePtr;
findLogfile(signal, fileNo, logPartPtr, &locLogFilePtr);
@@ -13775,9 +13897,9 @@ void Dblqh::openSrNextFileLab(Signal* signal)
void Dblqh::readSrNextFileLab(Signal* signal)
{
- if (logPartPtr.p->srRemainingFiles > ZMAX_LOG_FILES_IN_PAGE_ZERO) {
+ if (logPartPtr.p->srRemainingFiles > cmaxLogFilesInPageZero) {
jam();
- initGciInLogFileRec(signal, ZMAX_LOG_FILES_IN_PAGE_ZERO);
+ initGciInLogFileRec(signal, cmaxLogFilesInPageZero);
} else {
jam();
initGciInLogFileRec(signal, logPartPtr.p->srRemainingFiles);
@@ -13785,16 +13907,16 @@ void Dblqh::readSrNextFileLab(Signal* signal)
releaseLogpage(signal);
logFilePtr.p->logFileStatus = LogFileRecord::CLOSING_SR;
closeFile(signal, logFilePtr, __LINE__);
- if (logPartPtr.p->srRemainingFiles > ZMAX_LOG_FILES_IN_PAGE_ZERO) {
+ if (logPartPtr.p->srRemainingFiles > cmaxLogFilesInPageZero) {
Uint32 fileNo;
- if (logFilePtr.p->fileNo >= ZMAX_LOG_FILES_IN_PAGE_ZERO) {
+ if (logFilePtr.p->fileNo >= cmaxLogFilesInPageZero) {
jam();
- fileNo = logFilePtr.p->fileNo - ZMAX_LOG_FILES_IN_PAGE_ZERO;
+ fileNo = logFilePtr.p->fileNo - cmaxLogFilesInPageZero;
} else {
jam();
fileNo =
(logPartPtr.p->noLogFiles + logFilePtr.p->fileNo) -
- ZMAX_LOG_FILES_IN_PAGE_ZERO;
+ cmaxLogFilesInPageZero;
}//if
if (fileNo == 0) {
jam();
@@ -13803,11 +13925,11 @@ void Dblqh::readSrNextFileLab(Signal* signal)
* -------------------------------------------------------------------- */
fileNo = 1;
logPartPtr.p->srRemainingFiles =
- logPartPtr.p->srRemainingFiles - (ZMAX_LOG_FILES_IN_PAGE_ZERO - 1);
+ logPartPtr.p->srRemainingFiles - (cmaxLogFilesInPageZero - 1);
} else {
jam();
logPartPtr.p->srRemainingFiles =
- logPartPtr.p->srRemainingFiles - ZMAX_LOG_FILES_IN_PAGE_ZERO;
+ logPartPtr.p->srRemainingFiles - cmaxLogFilesInPageZero;
}//if
LogFileRecordPtr locLogFilePtr;
findLogfile(signal, fileNo, logPartPtr, &locLogFilePtr);
@@ -14093,15 +14215,6 @@ void Dblqh::execSTART_RECREQ(Signal* signal)
* WE ALSO NEED TO SET CNEWEST_GCI TO ENSURE THAT LOG RECORDS ARE EXECUTED
* WITH A PROPER GCI.
*------------------------------------------------------------------------ */
- if(cstartType == NodeState::ST_INITIAL_NODE_RESTART){
- jam();
- cstartRecReq = 2;
- StartRecConf * conf = (StartRecConf*)signal->getDataPtrSend();
- conf->startingNodeId = getOwnNodeId();
- sendSignal(cmasterDihBlockref, GSN_START_RECCONF, signal,
- StartRecConf::SignalLength, JBB);
- return;
- }//if
if (c_lcp_restoring_fragments.isEmpty())
{
@@ -14154,6 +14267,19 @@ void Dblqh::execSTART_RECCONF(Signal* signal)
jam();
csrExecUndoLogState = EULS_COMPLETED;
+
+ if(cstartType == NodeState::ST_INITIAL_NODE_RESTART)
+ {
+ jam();
+ cstartRecReq = 2;
+
+ StartRecConf * conf = (StartRecConf*)signal->getDataPtrSend();
+ conf->startingNodeId = getOwnNodeId();
+ sendSignal(cmasterDihBlockref, GSN_START_RECCONF, signal,
+ StartRecConf::SignalLength, JBB);
+ return;
+ }
+
c_lcp_complete_fragments.first(fragptr);
build_acc(signal, fragptr.i);
return;
@@ -14678,7 +14804,7 @@ void Dblqh::srLogLimits(Signal* signal)
* EXECUTED.
* ----------------------------------------------------------------------- */
while(true) {
- ndbrequire(tmbyte < 16);
+ ndbrequire(tmbyte < clogFileSize);
if (logPartPtr.p->logExecState == LogPartRecord::LES_SEARCH_STOP) {
if (logFilePtr.p->logMaxGciCompleted[tmbyte] < logPartPtr.p->logLastGci) {
jam();
@@ -14719,7 +14845,7 @@ void Dblqh::srLogLimits(Signal* signal)
if (logPartPtr.p->logExecState != LogPartRecord::LES_EXEC_LOG) {
if (tmbyte == 0) {
jam();
- tmbyte = ZNO_MBYTES_IN_FILE - 1;
+ tmbyte = clogFileSize - 1;
logFilePtr.i = logFilePtr.p->prevLogFile;
ptrCheckGuard(logFilePtr, clogFileFileSize, logFileRecord);
} else {
@@ -14744,6 +14870,20 @@ void Dblqh::srLogLimits(Signal* signal)
break;
}//if
}//while
+
+ if (DEBUG_REDO)
+ {
+ LogFileRecordPtr tmp;
+ tmp.i = logPartPtr.p->stopLogfile;
+ ptrCheckGuard(tmp, clogFileFileSize, logFileRecord);
+ ndbout_c("srLogLimits part: %u start file: %u mb: %u stop file: %u mb: %u",
+ logPartPtr.i,
+ tlastPrepRef >> 16,
+ tlastPrepRef & 65535,
+ tmp.p->fileNo,
+ logPartPtr.p->stopMbyte);
+ }
+
/* ------------------------------------------------------------------------
* WE HAVE NOW FOUND BOTH THE START AND THE STOP OF THE LOG. NOW START
* EXECUTING THE LOG. THE FIRST ACTION IS TO OPEN THE LOG FILE WHERE TO
@@ -15113,7 +15253,7 @@ void Dblqh::execSr(Signal* signal)
logPagePtr.p->logPageWord[ZPAGE_HEADER_SIZE + ZPOS_NO_FD];
logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX] =
(ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE) +
- (noFdDescriptors * ZFD_PART_SIZE);
+ (noFdDescriptors * ZFD_MBYTE_SIZE * clogFileSize);
}
break;
/* ========================================================================= */
@@ -15153,11 +15293,11 @@ void Dblqh::execSr(Signal* signal)
/*---------------------------------------------------------------------------*/
/* START EXECUTION OF A NEW MBYTE IN THE LOG. */
/*---------------------------------------------------------------------------*/
- if (logFilePtr.p->currentMbyte < (ZNO_MBYTES_IN_FILE - 1)) {
+ if (logFilePtr.p->currentMbyte < (clogFileSize - 1)) {
jam();
logPartPtr.p->logExecState = LogPartRecord::LES_EXEC_LOG_NEW_MBYTE;
} else {
- ndbrequire(logFilePtr.p->currentMbyte == (ZNO_MBYTES_IN_FILE - 1));
+ ndbrequire(logFilePtr.p->currentMbyte == (clogFileSize - 1));
jam();
/*---------------------------------------------------------------------------*/
/* WE HAVE TO CHANGE FILE. CLOSE THIS ONE AND THEN OPEN THE NEXT. */
@@ -15170,6 +15310,12 @@ void Dblqh::execSr(Signal* signal)
case ZCOMPLETED_GCI_TYPE:
jam();
logWord = readLogword(signal);
+ if (DEBUG_REDO)
+ ndbout_c("found gci: %u part: %u file: %u page: %u",
+ logWord,
+ logPartPtr.i,
+ logFilePtr.p->fileNo,
+ logFilePtr.p->currentFilepage);
if (logWord == logPartPtr.p->logLastGci) {
jam();
/*---------------------------------------------------------------------------*/
@@ -15186,6 +15332,10 @@ void Dblqh::execSr(Signal* signal)
logPartPtr.p->headPageNo = logFilePtr.p->currentFilepage;
logPartPtr.p->headPageIndex =
logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX];
+ logPartPtr.p->logLap = logPagePtr.p->logPageWord[ZPOS_LOG_LAP];
+ if (DEBUG_REDO)
+ ndbout_c("execSr part: %u logLap: %u",
+ logPartPtr.i, logPartPtr.p->logLap);
}//if
/*---------------------------------------------------------------------------*/
/* THERE IS NO NEED OF EXECUTING PAST THIS LINE SINCE THERE WILL ONLY BE LOG */
@@ -15348,67 +15498,140 @@ void Dblqh::invalidateLogAfterLastGCI(Signal* signal) {
}
switch (lfoPtr.p->lfoState) {
- case LogFileOperationRecord::WRITE_SR_INVALIDATE_PAGES:
- jam();
- releaseLfo(signal);
- releaseLogpage(signal);
- if (logPartPtr.p->invalidatePageNo < (ZNO_MBYTES_IN_FILE * ZPAGES_IN_MBYTE - 1)) {
- // We continue in this file.
- logPartPtr.p->invalidatePageNo++;
- } else {
- // We continue in the next file.
- logFilePtr.i = logFilePtr.p->nextLogFile;
- ptrCheckGuard(logFilePtr, clogFileFileSize, logFileRecord);
- logPartPtr.p->invalidateFileNo = logFilePtr.p->fileNo;
- // Page 0 is used for file descriptors.
- logPartPtr.p->invalidatePageNo = 1;
- if (logFilePtr.p->logFileStatus != LogFileRecord::OPEN) {
- jam();
- logFilePtr.p->logFileStatus = LogFileRecord::OPEN_SR_INVALIDATE_PAGES;
- openFileRw(signal, logFilePtr);
- return;
- break;
- }
- }
- // Read a page from the log file.
- readFileInInvalidate(signal);
- return;
- break;
-
case LogFileOperationRecord::READ_SR_INVALIDATE_PAGES:
jam();
- releaseLfo(signal);
// Check if this page must be invalidated.
// If the log lap number on a page after the head of the tail is the same
// as the actual log lap number we must invalidate this page. Otherwise it
// could be impossible to find the end of the log in a later system/node
// restart.
- if (logPagePtr.p->logPageWord[ZPOS_LOG_LAP] == logPartPtr.p->logLap) {
+ if (logPagePtr.p->logPageWord[ZPOS_LOG_LAP] == logPartPtr.p->logLap)
+ {
// This page must be invalidated.
- logPagePtr.p->logPageWord[ZPOS_LOG_LAP] = 0;
- // Contact NDBFS. Real time break.
- writeSinglePage(signal, logPartPtr.p->invalidatePageNo,
- ZPAGE_SIZE - 1, __LINE__);
- lfoPtr.p->lfoState = LogFileOperationRecord::WRITE_SR_INVALIDATE_PAGES;
- } else {
- // We are done with invalidating. Finish start phase 3.4.
+ // We search for end
+ // read next
+ releaseLfo(signal);
+ releaseLogpage(signal);
+ readFileInInvalidate(signal, true);
+ lfoPtr.p->lfoState = LogFileOperationRecord::READ_SR_INVALIDATE_PAGES;
+ return;
+ }
+
+ /**
+ * We found the "last" page to invalidate...
+ * Invalidate backwards until head...
+ */
+
+ // Fall through...
+ case LogFileOperationRecord::WRITE_SR_INVALIDATE_PAGES:
+ jam();
+
+ releaseLfo(signal);
+ releaseLogpage(signal);
+
+ // Step backwards...
+ logPartPtr.p->invalidatePageNo--;
+
+ if (logPartPtr.p->invalidatePageNo == 0)
+ {
+ jam();
+
+ if (logFilePtr.p->fileNo == 0)
+ {
+ /**
+ * We're wrapping in the log...
+ * update logLap
+ */
+ logPartPtr.p->logLap--;
+ ndbrequire(logPartPtr.p->logLap); // Should always be > 0
+ if (DEBUG_REDO)
+ ndbout_c("invalidateLogAfterLastGCI part: %u wrap from file 0 -> logLap: %u",
+ logPartPtr.i, logPartPtr.p->logLap);
+ }
+
+ /**
+ * Move to prev file
+ */
+ logFilePtr.i = logFilePtr.p->prevLogFile;
+ ptrCheckGuard(logFilePtr, clogFileFileSize, logFileRecord);
+ logPartPtr.p->invalidateFileNo = logFilePtr.p->fileNo;
+ logPartPtr.p->invalidatePageNo = clogFileSize * ZPAGES_IN_MBYTE - 1;
+ }
+
+ if (logPartPtr.p->invalidateFileNo == logPartPtr.p->headFileNo &&
+ logPartPtr.p->invalidatePageNo == logPartPtr.p->headPageNo)
+ {
+ /**
+ * Done...
+ */
+ logFilePtr.i = logPartPtr.p->currentLogfile;
+ ptrCheckGuard(logFilePtr, clogFileFileSize, logFileRecord);
+
+ logFilePtr.i = logFilePtr.p->nextLogFile;
+ ptrCheckGuard(logFilePtr, clogFileFileSize, logFileRecord);
+
+ // Close files if necessary. Current file and the next file should be
+ // left open.
exitFromInvalidate(signal);
+ return;
}
- return;
- break;
+ seizeLogpage(signal);
+
+ /**
+ * Make page really empty
+ */
+ bzero(logPagePtr.p, sizeof(LogPageRecord));
+ writeSinglePage(signal, logPartPtr.p->invalidatePageNo,
+ ZPAGE_SIZE - 1, __LINE__);
+
+ lfoPtr.p->lfoState = LogFileOperationRecord::WRITE_SR_INVALIDATE_PAGES;
+ return;
default:
jam();
systemError(signal, __LINE__);
return;
break;
}
-
- return;
}//Dblqh::invalidateLogAfterLastGCI
-void Dblqh::readFileInInvalidate(Signal* signal) {
+void Dblqh::readFileInInvalidate(Signal* signal, bool stepNext)
+{
jam();
+
+ if (stepNext)
+ {
+ logPartPtr.p->invalidatePageNo++;
+ if (logPartPtr.p->invalidatePageNo == (clogFileSize * ZPAGES_IN_MBYTE))
+ {
+ // We continue in the next file.
+ logFilePtr.i = logFilePtr.p->nextLogFile;
+ ptrCheckGuard(logFilePtr, clogFileFileSize, logFileRecord);
+ logPartPtr.p->invalidateFileNo = logFilePtr.p->fileNo;
+ // Page 0 is used for file descriptors.
+ logPartPtr.p->invalidatePageNo = 1;
+
+ if (logFilePtr.p->fileNo == 0)
+ {
+ /**
+ * We're wrapping in the log...
+ * update logLap
+ */
+ logPartPtr.p->logLap++;
+ if (DEBUG_REDO)
+ ndbout_c("readFileInInvalidate part: %u wrap to file 0 -> logLap: %u",
+ logPartPtr.i, logPartPtr.p->logLap);
+ }
+ if (logFilePtr.p->logFileStatus != LogFileRecord::OPEN)
+ {
+ jam();
+ logFilePtr.p->logFileStatus = LogFileRecord::OPEN_SR_INVALIDATE_PAGES;
+ openFileRw(signal, logFilePtr);
+ return;
+ }
+ }
+ }
+
// Contact NDBFS. Real time break.
readSinglePage(signal, logPartPtr.p->invalidatePageNo);
lfoPtr.p->lfoState = LogFileOperationRecord::READ_SR_INVALIDATE_PAGES;
@@ -15416,34 +15639,57 @@ void Dblqh::readFileInInvalidate(Signal* signal) {
void Dblqh::exitFromInvalidate(Signal* signal) {
jam();
- // Close files if necessary. Current file and the next file should be
- // left open.
- if (logFilePtr.i != logPartPtr.p->currentLogfile) {
- LogFileRecordPtr currentLogFilePtr;
- LogFileRecordPtr nextAfterCurrentLogFilePtr;
-
- currentLogFilePtr.i = logPartPtr.p->currentLogfile;
- ptrCheckGuard(currentLogFilePtr, clogFileFileSize, logFileRecord);
-
- nextAfterCurrentLogFilePtr.i = currentLogFilePtr.p->nextLogFile;
-
- if (logFilePtr.i != nextAfterCurrentLogFilePtr.i) {
- // This file should be closed.
- logFilePtr.p->logFileStatus = LogFileRecord::CLOSE_SR_INVALIDATE_PAGES;
- closeFile(signal, logFilePtr, __LINE__);
- // Return from this function and wait for close confirm. Then come back
- // and test the previous file for closing.
- return;
- }
- }
- // We are done with closing files, send completed signal and exit this phase.
- signal->theData[0] = ZSR_FOURTH_COMP;
- signal->theData[1] = logPartPtr.i;
- sendSignal(cownref, GSN_CONTINUEB, signal, 2, JBB);
+loop:
+ logFilePtr.i = logFilePtr.p->nextLogFile;
+ ptrCheckGuard(logFilePtr, clogFileFileSize, logFileRecord);
+
+ if (logFilePtr.i == logPartPtr.p->currentLogfile)
+ {
+ jam();
+ goto done;
+ }
+
+ if (logFilePtr.p->fileNo == 0)
+ {
+ jam();
+ /**
+ * Logfile 0 shoult *not* be closed
+ */
+ goto loop;
+ }
+
+ if (logFilePtr.p->logFileStatus == LogFileRecord::CLOSED)
+ {
+ jam();
+ goto done;
+ }
+
+ jam();
+ ndbrequire(logFilePtr.p->logFileStatus == LogFileRecord::OPEN);
+ logFilePtr.p->logFileStatus = LogFileRecord::CLOSE_SR_INVALIDATE_PAGES;
+ closeFile(signal, logFilePtr, __LINE__);
return;
-}
+done:
+ if (DEBUG_REDO)
+ ndbout_c("exitFromInvalidate part: %u head file: %u page: %u",
+ logPartPtr.i,
+ logPartPtr.p->headFileNo,
+ logPartPtr.p->headPageNo);
+
+ logFilePtr.i = logPartPtr.p->firstLogfile;
+ ptrCheckGuard(logFilePtr, clogFileFileSize, logFileRecord);
+ logPagePtr.i = logFilePtr.p->logPageZero;
+ ptrCheckGuard(logPagePtr, clogPageFileSize, logPageRecord);
+ logPagePtr.p->logPageWord[ZPAGE_HEADER_SIZE + ZPOS_FILE_NO] =
+ logPartPtr.p->headFileNo;
+ writeSinglePage(signal, 0, ZPAGE_SIZE - 1, __LINE__);
+
+ lfoPtr.p->logFileRec = logFilePtr.i;
+ lfoPtr.p->lfoState = LogFileOperationRecord::WRITE_SR_INVALIDATE_PAGES_UPDATE_PAGE0;
+ return;
+}
/*---------------------------------------------------------------------------*/
/* THE EXECUTION OF A LOG RECORD IS COMPLETED. RELEASE PAGES IF THEY WERE */
@@ -15835,20 +16081,10 @@ void Dblqh::readSrFourthZeroLab(Signal* signal)
ptrCheckGuard(logFilePtr, clogFileFileSize, logFileRecord);
logPartPtr.p->invalidateFileNo = logPartPtr.p->headFileNo;
logPartPtr.p->invalidatePageNo = logPartPtr.p->headPageNo;
-
logPartPtr.p->logExecState = LogPartRecord::LES_EXEC_LOG_INVALIDATE;
- seizeLfo(signal);
- initLfo(signal);
- // The state here is a little confusing, but simulates that we return
- // to invalidateLogAfterLastGCI() from an invalidate write and are ready
- // to read a page from file.
- lfoPtr.p->lfoState = LogFileOperationRecord::WRITE_SR_INVALIDATE_PAGES;
-
- /**
- * Make sure we dont release zero page
- */
- seizeLogpage(signal);
- invalidateLogAfterLastGCI(signal);
+
+ readFileInInvalidate(signal, true);
+ lfoPtr.p->lfoState = LogFileOperationRecord::READ_SR_INVALIDATE_PAGES;
return;
}//Dblqh::readSrFourthZeroLab()
@@ -16361,6 +16597,14 @@ void Dblqh::completedLogPage(Signal* signal, Uint32 clpType, Uint32 place)
signal->theData[4] = ZVAR_NO_LOG_PAGE_WORD;
signal->theData[5] = twlpNoPages;
sendSignal(NDBFS_REF, GSN_FSWRITEREQ, signal, 15, JBA);
+
+ if (DEBUG_REDO)
+ ndbout_c("writing %d pages at part: %u file: %u pos: %u",
+ twlpNoPages,
+ logPartPtr.i,
+ logFilePtr.p->fileNo,
+ logFilePtr.p->filePosition);
+
if (twlpType == ZNORMAL) {
jam();
lfoPtr.p->lfoState = LogFileOperationRecord::ACTIVE_WRITE_LOG;
@@ -16693,6 +16937,22 @@ void Dblqh::initialiseLogFile(Signal* signal)
ptrAss(logFilePtr, logFileRecord);
logFilePtr.p->nextLogFile = logFilePtr.i + 1;
logFilePtr.p->logFileStatus = LogFileRecord::LFS_IDLE;
+
+ logFilePtr.p->logLastPrepRef = new Uint32[clogFileSize];
+ logFilePtr.p->logMaxGciCompleted = new Uint32[clogFileSize];
+ logFilePtr.p->logMaxGciStarted = new Uint32[clogFileSize];
+
+ if (logFilePtr.p->logLastPrepRef == 0 ||
+ logFilePtr.p->logMaxGciCompleted == 0 ||
+ logFilePtr.p->logMaxGciStarted == 0)
+ {
+ char buf[256];
+ BaseString::snprintf(buf, sizeof(buf),
+ "Failed to alloc mbyte(%u) arrays for logfile %u",
+ clogFileSize, logFilePtr.i);
+ progError(__LINE__, NDBD_EXIT_MEMALLOC, buf);
+ }
+
}//for
logFilePtr.i = clogFileFileSize - 1;
ptrAss(logFilePtr, logFileRecord);
@@ -17021,41 +17281,31 @@ void Dblqh::initFragrec(Signal* signal,
* ========================================================================= */
void Dblqh::initGciInLogFileRec(Signal* signal, Uint32 noFdDescriptors)
{
- LogFileRecordPtr iglLogFilePtr;
- UintR tiglLoop;
- UintR tiglIndex;
-
- tiglLoop = 0;
- iglLogFilePtr.i = logFilePtr.i;
- iglLogFilePtr.p = logFilePtr.p;
-IGL_LOOP:
- for (tiglIndex = 0; tiglIndex <= ZNO_MBYTES_IN_FILE - 1; tiglIndex++) {
- arrGuard(((ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE) +
- (tiglLoop * ZFD_PART_SIZE)) + tiglIndex, ZPAGE_SIZE);
- iglLogFilePtr.p->logMaxGciCompleted[tiglIndex] =
- logPagePtr.p->logPageWord[((ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE) +
- (tiglLoop * ZFD_PART_SIZE)) + tiglIndex];
- arrGuard((((ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE) + ZNO_MBYTES_IN_FILE) +
- (tiglLoop * ZFD_PART_SIZE)) + tiglIndex, ZPAGE_SIZE);
- iglLogFilePtr.p->logMaxGciStarted[tiglIndex] =
- logPagePtr.p->logPageWord[(((ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE) +
- ZNO_MBYTES_IN_FILE) +
- (tiglLoop * ZFD_PART_SIZE)) + tiglIndex];
- arrGuard((((ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE) +
- (2 * ZNO_MBYTES_IN_FILE)) + (tiglLoop * ZFD_PART_SIZE)) +
- tiglIndex, ZPAGE_SIZE);
- iglLogFilePtr.p->logLastPrepRef[tiglIndex] =
- logPagePtr.p->logPageWord[(((ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE) +
- (2 * ZNO_MBYTES_IN_FILE)) +
- (tiglLoop * ZFD_PART_SIZE)) + tiglIndex];
- }//for
- tiglLoop = tiglLoop + 1;
- if (tiglLoop < noFdDescriptors) {
+ LogFileRecordPtr filePtr = logFilePtr;
+ Uint32 pos = ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE;
+ for (Uint32 fd = 0; fd < noFdDescriptors; fd++)
+ {
jam();
- iglLogFilePtr.i = iglLogFilePtr.p->prevLogFile;
- ptrCheckGuard(iglLogFilePtr, clogFileFileSize, logFileRecord);
- goto IGL_LOOP;
- }//if
+ for (Uint32 mb = 0; mb < clogFileSize; mb++)
+ {
+ jam();
+ Uint32 pos0 = pos + fd * (ZFD_MBYTE_SIZE * clogFileSize) + mb;
+ Uint32 pos1 = pos0 + clogFileSize;
+ Uint32 pos2 = pos1 + clogFileSize;
+ arrGuard(pos0, ZPAGE_SIZE);
+ arrGuard(pos1, ZPAGE_SIZE);
+ arrGuard(pos2, ZPAGE_SIZE);
+ filePtr.p->logMaxGciCompleted[mb] = logPagePtr.p->logPageWord[pos0];
+ filePtr.p->logMaxGciStarted[mb] = logPagePtr.p->logPageWord[pos1];
+ filePtr.p->logLastPrepRef[mb] = logPagePtr.p->logPageWord[pos2];
+ }
+ if (fd + 1 < noFdDescriptors)
+ {
+ jam();
+ filePtr.i = filePtr.p->prevLogFile;
+ ptrCheckGuard(filePtr, clogFileFileSize, logFileRecord);
+ }
+ }
}//Dblqh::initGciInLogFileRec()
/* ==========================================================================
@@ -17514,6 +17764,14 @@ void Dblqh::readExecLog(Signal* signal)
signal->theData[14] = lfoPtr.p->logPageArray[8];
signal->theData[15] = lfoPtr.p->logPageArray[9];
sendSignal(NDBFS_REF, GSN_FSREADREQ, signal, 16, JBA);
+
+ if (DEBUG_REDO)
+ ndbout_c("readExecLog %u page at part: %u file: %u pos: %u",
+ lfoPtr.p->noPagesRw,
+ logPartPtr.i,
+ logFilePtr.p->fileNo,
+ logPartPtr.p->execSrStartPageNo);
+
}//Dblqh::readExecLog()
/* ------------------------------------------------------------------------- */
@@ -17576,6 +17834,14 @@ void Dblqh::readExecSr(Signal* signal)
signal->theData[13] = lfoPtr.p->logPageArray[7];
signal->theData[14] = tresPageid;
sendSignal(NDBFS_REF, GSN_FSREADREQ, signal, 15, JBA);
+
+ if (DEBUG_REDO)
+ ndbout_c("readExecSr %u page at part: %u file: %u pos: %u",
+ 8,
+ logPartPtr.i,
+ logFilePtr.p->fileNo,
+ tresPageid);
+
}//Dblqh::readExecSr()
/* ------------------------------------------------------------------------- */
@@ -17731,6 +17997,13 @@ void Dblqh::readSinglePage(Signal* signal, Uint32 pageNo)
signal->theData[6] = logPagePtr.i;
signal->theData[7] = pageNo;
sendSignal(NDBFS_REF, GSN_FSREADREQ, signal, 8, JBA);
+
+ if (DEBUG_REDO)
+ ndbout_c("readSinglePage 1 page at part: %u file: %u pos: %u",
+ logPartPtr.i,
+ logFilePtr.p->fileNo,
+ pageNo);
+
}//Dblqh::readSinglePage()
/* --------------------------------------------------------------------------
@@ -18214,8 +18487,17 @@ void Dblqh::writeCompletedGciLog(Signal* signal)
jam();
changeMbyte(signal);
}//if
+
logFilePtr.p->remainingWordsInMbyte =
logFilePtr.p->remainingWordsInMbyte - ZCOMPLETED_GCI_LOG_SIZE;
+
+ if (DEBUG_REDO)
+ ndbout_c("writeCompletedGciLog gci: %u part: %u file: %u page: %u",
+ cnewestCompletedGci,
+ logPartPtr.i,
+ logFilePtr.p->fileNo,
+ logFilePtr.p->currentFilepage);
+
writeLogWord(signal, ZCOMPLETED_GCI_TYPE);
writeLogWord(signal, cnewestCompletedGci);
logPartPtr.p->logPartNewestCompletedGCI = cnewestCompletedGci;
@@ -18252,6 +18534,13 @@ void Dblqh::writeDirty(Signal* signal, Uint32 place)
signal->theData[6] = logPagePtr.i;
signal->theData[7] = logPartPtr.p->prevFilepage;
sendSignal(NDBFS_REF, GSN_FSWRITEREQ, signal, 8, JBA);
+
+ if (DEBUG_REDO)
+ ndbout_c("writeDirty 1 page at part: %u file: %u pos: %u",
+ logPartPtr.i,
+ logFilePtr.p->fileNo,
+ logPartPtr.p->prevFilepage);
+
}//Dblqh::writeDirty()
/* --------------------------------------------------------------------------
@@ -18308,7 +18597,7 @@ void Dblqh::writeNextLog(Signal* signal)
ndbrequire(logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX] < ZPAGE_SIZE);
logPagePtr.p->logPageWord[logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX]] =
ZNEXT_MBYTE_TYPE;
- if (logFilePtr.p->currentMbyte == (ZNO_MBYTES_IN_FILE - 1)) {
+ if (logFilePtr.p->currentMbyte == (clogFileSize - 1)) {
jam();
/* -------------------------------------------------- */
/* CALCULATE THE NEW REMAINING WORDS WHEN */
@@ -18397,7 +18686,7 @@ void Dblqh::writeNextLog(Signal* signal)
systemError(signal, __LINE__);
}//if
}//if
- if (logFilePtr.p->currentMbyte == (ZNO_MBYTES_IN_FILE - 1)) {
+ if (logFilePtr.p->currentMbyte == (clogFileSize - 1)) {
jam();
twnlNextMbyte = 0;
if (logFilePtr.p->fileChangeState != LogFileRecord::NOT_ONGOING) {
diff --git a/storage/ndb/src/kernel/blocks/dblqh/Makefile.am b/storage/ndb/src/kernel/blocks/dblqh/Makefile.am
index c7c477a512c..b545096dc83 100644
--- a/storage/ndb/src/kernel/blocks/dblqh/Makefile.am
+++ b/storage/ndb/src/kernel/blocks/dblqh/Makefile.am
@@ -16,7 +16,7 @@
EXTRA_PROGRAMS = ndbd_redo_log_reader
ndbd_redo_log_reader_SOURCES = redoLogReader/records.cpp \
- redoLogReader/redoLogFileReader.cpp
+ redoLogReader/reader.cpp
include $(top_srcdir)/storage/ndb/config/common.mk.am
include $(top_srcdir)/storage/ndb/config/type_kernel.mk.am
diff --git a/storage/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp b/storage/ndb/src/kernel/blocks/dblqh/redoLogReader/reader.cpp
index e5df14aea9a..e5df14aea9a 100644
--- a/storage/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp
+++ b/storage/ndb/src/kernel/blocks/dblqh/redoLogReader/reader.cpp
diff --git a/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp b/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
index 42f4033dd4a..75d79ba737f 100644
--- a/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
+++ b/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
@@ -1499,12 +1499,12 @@ private:
void clearCommitAckMarker(ApiConnectRecord * const regApiPtr,
TcConnectRecord * const regTcPtr);
// Trigger and index handling
- bool saveINDXKEYINFO(Signal* signal,
- TcIndexOperation* indexOp,
- const Uint32 *src,
- Uint32 len);
+ int saveINDXKEYINFO(Signal* signal,
+ TcIndexOperation* indexOp,
+ const Uint32 *src,
+ Uint32 len);
bool receivedAllINDXKEYINFO(TcIndexOperation* indexOp);
- bool saveINDXATTRINFO(Signal* signal,
+ int saveINDXATTRINFO(Signal* signal,
TcIndexOperation* indexOp,
const Uint32 *src,
Uint32 len);
diff --git a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
index 024d7bdb00c..887e6f848b1 100644
--- a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
+++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
@@ -1800,9 +1800,18 @@ start_failure:
}//switch
}
+static
+inline
+bool
+compare_transid(Uint32* val0, Uint32* val1)
+{
+ Uint32 tmp0 = val0[0] ^ val1[0];
+ Uint32 tmp1 = val0[1] ^ val1[1];
+ return (tmp0 | tmp1) == 0;
+}
+
void Dbtc::execKEYINFO(Signal* signal)
{
- UintR compare_transid1, compare_transid2;
jamEntry();
apiConnectptr.i = signal->theData[0];
tmaxData = 20;
@@ -1812,10 +1821,8 @@ void Dbtc::execKEYINFO(Signal* signal)
}//if
ptrAss(apiConnectptr, apiConnectRecord);
ttransid_ptr = 1;
- compare_transid1 = apiConnectptr.p->transid[0] ^ signal->theData[1];
- compare_transid2 = apiConnectptr.p->transid[1] ^ signal->theData[2];
- compare_transid1 = compare_transid1 | compare_transid2;
- if (compare_transid1 != 0) {
+ if (compare_transid(apiConnectptr.p->transid, signal->theData+1) == false)
+ {
TCKEY_abort(signal, 19);
return;
}//if
@@ -2116,7 +2123,6 @@ void Dbtc::saveAttrbuf(Signal* signal)
void Dbtc::execATTRINFO(Signal* signal)
{
- UintR compare_transid1, compare_transid2;
UintR Tdata1 = signal->theData[0];
UintR Tlength = signal->length();
UintR TapiConnectFilesize = capiConnectFilesize;
@@ -2131,17 +2137,13 @@ void Dbtc::execATTRINFO(Signal* signal)
return;
}//if
- UintR Tdata2 = signal->theData[1];
- UintR Tdata3 = signal->theData[2];
ApiConnectRecord * const regApiPtr = &localApiConnectRecord[Tdata1];
- compare_transid1 = regApiPtr->transid[0] ^ Tdata2;
- compare_transid2 = regApiPtr->transid[1] ^ Tdata3;
apiConnectptr.p = regApiPtr;
- compare_transid1 = compare_transid1 | compare_transid2;
- if (compare_transid1 != 0) {
+ if (compare_transid(regApiPtr->transid, signal->theData+1) == false)
+ {
DEBUG("Drop ATTRINFO, wrong transid, lenght="<<Tlength
- << " transid("<<hex<<Tdata2<<", "<<Tdata3);
+ << " transid("<<hex<<signal->theData[1]<<", "<<signal->theData[2]);
TCKEY_abort(signal, 19);
return;
}//if
@@ -5456,11 +5458,32 @@ void Dbtc::execTC_COMMITREQ(Signal* signal)
}
}//Dbtc::execTC_COMMITREQ()
+/**
+ * TCROLLBACKREQ
+ *
+ * Format is:
+ *
+ * thedata[0] = apiconnectptr
+ * thedata[1] = transid[0]
+ * thedata[2] = transid[1]
+ * OPTIONAL thedata[3] = flags
+ *
+ * Flags:
+ * 0x1 = potentiallyBad data from API (try not to assert)
+ */
void Dbtc::execTCROLLBACKREQ(Signal* signal)
{
+ bool potentiallyBad= false;
UintR compare_transid1, compare_transid2;
jamEntry();
+
+ if(unlikely((signal->getLength() >= 4) && (signal->theData[3] & 0x1)))
+ {
+ ndbout_c("Trying to roll back potentially bad txn\n");
+ potentiallyBad= true;
+ }
+
apiConnectptr.i = signal->theData[0];
if (apiConnectptr.i >= capiConnectFilesize) {
goto TC_ROLL_warning;
@@ -5547,12 +5570,14 @@ void Dbtc::execTCROLLBACKREQ(Signal* signal)
TC_ROLL_warning:
jam();
- warningHandlerLab(signal, __LINE__);
+ if(likely(potentiallyBad==false))
+ warningHandlerLab(signal, __LINE__);
return;
TC_ROLL_system_error:
jam();
- systemErrorLab(signal, __LINE__);
+ if(likely(potentiallyBad==false))
+ systemErrorLab(signal, __LINE__);
return;
}//Dbtc::execTCROLLBACKREQ()
@@ -10235,6 +10260,7 @@ void Dbtc::inithost(Signal* signal)
hostptr.p->noOfWordsTCINDXCONF = 0;
hostptr.p->noOfPackedWordsLqh = 0;
hostptr.p->hostLqhBlockRef = calcLqhBlockRef(hostptr.i);
+ hostptr.p->m_nf_bits = 0;
}//for
c_alive_nodes.clear();
}//Dbtc::inithost()
@@ -11565,6 +11591,7 @@ void Dbtc::execTCINDXREQ(Signal* signal)
// This is a newly started transaction, clean-up
releaseAllSeizedIndexOperations(regApiPtr);
+ regApiPtr->apiConnectstate = CS_STARTED;
regApiPtr->transid[0] = tcIndxReq->transId1;
regApiPtr->transid[1] = tcIndxReq->transId2;
}//if
@@ -11605,20 +11632,29 @@ void Dbtc::execTCINDXREQ(Signal* signal)
Uint32 includedIndexLength = MIN(indexLength, indexBufSize);
indexOp->expectedAttrInfo = attrLength;
Uint32 includedAttrLength = MIN(attrLength, attrBufSize);
- if (saveINDXKEYINFO(signal,
- indexOp,
- dataPtr,
- includedIndexLength)) {
+
+ int ret;
+ if ((ret = saveINDXKEYINFO(signal,
+ indexOp,
+ dataPtr,
+ includedIndexLength)) == 0)
+ {
jam();
// We have received all we need
readIndexTable(signal, regApiPtr, indexOp);
return;
}
+ else if (ret == -1)
+ {
+ jam();
+ return;
+ }
+
dataPtr += includedIndexLength;
if (saveINDXATTRINFO(signal,
indexOp,
dataPtr,
- includedAttrLength)) {
+ includedAttrLength) == 0) {
jam();
// We have received all we need
readIndexTable(signal, regApiPtr, indexOp);
@@ -11721,13 +11757,25 @@ void Dbtc::execINDXKEYINFO(Signal* signal)
TcIndexOperationPtr indexOpPtr;
TcIndexOperation* indexOp;
+ if (compare_transid(regApiPtr->transid, indxKeyInfo->transId) == false)
+ {
+ TCKEY_abort(signal, 19);
+ return;
+ }
+
+ if (regApiPtr->apiConnectstate == CS_ABORTING)
+ {
+ jam();
+ return;
+ }
+
if((indexOpPtr.i = regApiPtr->accumulatingIndexOp) != RNIL)
{
indexOp = c_theIndexOperationPool.getPtr(indexOpPtr.i);
if (saveINDXKEYINFO(signal,
indexOp,
src,
- keyInfoLength)) {
+ keyInfoLength) == 0) {
jam();
// We have received all we need
readIndexTable(signal, regApiPtr, indexOp);
@@ -11754,17 +11802,31 @@ void Dbtc::execINDXATTRINFO(Signal* signal)
TcIndexOperationPtr indexOpPtr;
TcIndexOperation* indexOp;
+ if (compare_transid(regApiPtr->transid, indxAttrInfo->transId) == false)
+ {
+ TCKEY_abort(signal, 19);
+ return;
+ }
+
+ if (regApiPtr->apiConnectstate == CS_ABORTING)
+ {
+ jam();
+ return;
+ }
+
if((indexOpPtr.i = regApiPtr->accumulatingIndexOp) != RNIL)
{
indexOp = c_theIndexOperationPool.getPtr(indexOpPtr.i);
if (saveINDXATTRINFO(signal,
indexOp,
src,
- attrInfoLength)) {
+ attrInfoLength) == 0) {
jam();
// We have received all we need
readIndexTable(signal, regApiPtr, indexOp);
+ return;
}
+ return;
}
}
@@ -11772,12 +11834,13 @@ void Dbtc::execINDXATTRINFO(Signal* signal)
* Save signal INDXKEYINFO
* Return true if we have received all needed data
*/
-bool Dbtc::saveINDXKEYINFO(Signal* signal,
- TcIndexOperation* indexOp,
- const Uint32 *src,
- Uint32 len)
+int
+Dbtc::saveINDXKEYINFO(Signal* signal,
+ TcIndexOperation* indexOp,
+ const Uint32 *src,
+ Uint32 len)
{
- if (!indexOp->keyInfo.append(src, len)) {
+ if (ERROR_INSERTED(8052) || !indexOp->keyInfo.append(src, len)) {
jam();
// Failed to seize keyInfo, abort transaction
#ifdef VM_TRACE
@@ -11787,15 +11850,17 @@ bool Dbtc::saveINDXKEYINFO(Signal* signal,
apiConnectptr.i = indexOp->connectionIndex;
ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord);
releaseIndexOperation(apiConnectptr.p, indexOp);
- terrorCode = 4000;
+ terrorCode = 289;
+ if(TcKeyReq::getExecuteFlag(indexOp->tcIndxReq.requestInfo))
+ apiConnectptr.p->m_exec_flag= 1;
abortErrorLab(signal);
- return false;
+ return -1;
}
if (receivedAllINDXKEYINFO(indexOp) && receivedAllINDXATTRINFO(indexOp)) {
jam();
- return true;
+ return 0;
}
- return false;
+ return 1;
}
bool Dbtc::receivedAllINDXKEYINFO(TcIndexOperation* indexOp)
@@ -11807,12 +11872,13 @@ bool Dbtc::receivedAllINDXKEYINFO(TcIndexOperation* indexOp)
* Save signal INDXATTRINFO
* Return true if we have received all needed data
*/
-bool Dbtc::saveINDXATTRINFO(Signal* signal,
- TcIndexOperation* indexOp,
- const Uint32 *src,
- Uint32 len)
+int
+Dbtc::saveINDXATTRINFO(Signal* signal,
+ TcIndexOperation* indexOp,
+ const Uint32 *src,
+ Uint32 len)
{
- if (!indexOp->attrInfo.append(src, len)) {
+ if (ERROR_INSERTED(8051) || !indexOp->attrInfo.append(src, len)) {
jam();
#ifdef VM_TRACE
ndbout_c("Dbtc::saveINDXATTRINFO: Failed to seize attrInfo\n");
@@ -11820,15 +11886,17 @@ bool Dbtc::saveINDXATTRINFO(Signal* signal,
apiConnectptr.i = indexOp->connectionIndex;
ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord);
releaseIndexOperation(apiConnectptr.p, indexOp);
- terrorCode = 4000;
+ terrorCode = 289;
+ if(TcKeyReq::getExecuteFlag(indexOp->tcIndxReq.requestInfo))
+ apiConnectptr.p->m_exec_flag= 1;
abortErrorLab(signal);
- return false;
+ return -1;
}
if (receivedAllINDXKEYINFO(indexOp) && receivedAllINDXATTRINFO(indexOp)) {
jam();
- return true;
+ return 0;
}
- return false;
+ return 1;
}
bool Dbtc::receivedAllINDXATTRINFO(TcIndexOperation* indexOp)
@@ -12012,6 +12080,9 @@ void Dbtc::execTCKEYREF(Signal* signal)
tcIndxRef->transId[0] = tcKeyRef->transId[0];
tcIndxRef->transId[1] = tcKeyRef->transId[1];
tcIndxRef->errorCode = tcKeyRef->errorCode;
+
+ releaseIndexOperation(regApiPtr, indexOp);
+
sendSignal(regApiPtr->ndbapiBlockref,
GSN_TCINDXREF, signal, TcKeyRef::SignalLength, JBB);
return;
@@ -12556,7 +12627,18 @@ void Dbtc::executeIndexOperation(Signal* signal,
bool Dbtc::seizeIndexOperation(ApiConnectRecord* regApiPtr,
TcIndexOperationPtr& indexOpPtr)
{
- return regApiPtr->theSeizedIndexOperations.seize(indexOpPtr);
+ if (regApiPtr->theSeizedIndexOperations.seize(indexOpPtr))
+ {
+ ndbassert(indexOpPtr.p->expectedKeyInfo == 0);
+ ndbassert(indexOpPtr.p->keyInfo.getSize() == 0);
+ ndbassert(indexOpPtr.p->expectedAttrInfo == 0);
+ ndbassert(indexOpPtr.p->attrInfo.getSize() == 0);
+ ndbassert(indexOpPtr.p->expectedTransIdAI == 0);
+ ndbassert(indexOpPtr.p->transIdAI.getSize() == 0);
+ return true;
+ }
+
+ return false;
}
void Dbtc::releaseIndexOperation(ApiConnectRecord* regApiPtr,
diff --git a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
index 4577671202c..f28687dca0d 100644
--- a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
+++ b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
@@ -1053,6 +1053,8 @@ ArrayPool<TupTriggerData> c_triggerPool;
struct {
Uint32 tabUserPtr;
Uint32 tabUserRef;
+ Uint32 m_lcpno;
+ Uint32 m_fragPtrI;
} m_dropTable;
State tableStatus;
};
@@ -1614,6 +1616,11 @@ private:
void execACCKEYREF(Signal* signal);
void execACC_ABORTCONF(Signal* signal);
+
+ // Drop table
+ void execFSREMOVEREF(Signal*);
+ void execFSREMOVECONF(Signal*);
+
//------------------------------------------------------------------
//------------------------------------------------------------------
// Methods to handle execution of TUPKEYREQ + ATTRINFO.
@@ -2505,7 +2512,9 @@ private:
void drop_fragment_free_extent_log_buffer_callback(Signal*, Uint32, Uint32);
void drop_fragment_unmap_pages(Signal*, TablerecPtr, FragrecordPtr, Uint32);
void drop_fragment_unmap_page_callback(Signal* signal, Uint32, Uint32);
-
+ void drop_fragment_fsremove(Signal*, TablerecPtr, FragrecordPtr);
+ void drop_fragment_fsremove_done(Signal*, TablerecPtr, FragrecordPtr);
+
// Initialisation
void initData();
void initRecords();
@@ -2691,6 +2700,10 @@ private:
ArrayPool<Page> c_page_pool;
Uint32 cnoOfAllocatedPages;
+ Uint32 m_max_allocate_pages;
+
+ /* read ahead in pages during disk order scan */
+ Uint32 m_max_page_read_ahead;
Tablerec *tablerec;
Uint32 cnoOfTablerec;
diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp
index ee0f194211b..812f071e037 100644
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp
@@ -179,7 +179,8 @@ Dbtup::dealloc_tuple(Signal* signal,
&disk, tmpptr, gci);
}
- if (! (bits & Tuple_header::LCP_SKIP) && lcpScan_ptr_i != RNIL)
+ if (! (bits & (Tuple_header::LCP_SKIP | Tuple_header::ALLOC)) &&
+ lcpScan_ptr_i != RNIL)
{
ScanOpPtr scanOp;
c_scanOpPool.getPtr(scanOp, lcpScan_ptr_i);
diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp
index 1182ac4ee7d..8e532ae97b5 100644
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp
@@ -74,6 +74,10 @@ Dbtup::reportMemoryUsage(Signal* signal, int incDec){
sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 6, JBB);
}
+#ifdef VM_TRACE
+extern Uint32 fc_left, fc_right, fc_remove;
+#endif
+
void
Dbtup::execDUMP_STATE_ORD(Signal* signal)
{
@@ -155,12 +159,20 @@ Dbtup::execDUMP_STATE_ORD(Signal* signal)
return;
}//if
#endif
-#if defined VM_TRACE && 0
- if (type == 1211){
- ndbout_c("Startar modul test av Page Manager");
+#if defined VM_TRACE
+ if (type == 1211 || type == 1212 || type == 1213){
+ Uint32 seed = time(0);
+ if (signal->getLength() > 1)
+ seed = signal->theData[1];
+ ndbout_c("Startar modul test av Page Manager (seed: 0x%x)", seed);
+ srand(seed);
Vector<Chunk> chunks;
const Uint32 LOOPS = 1000;
+ Uint32 sum_req = 0;
+ Uint32 sum_conf = 0;
+ Uint32 sum_loop = 0;
+ Uint32 max_loop = 0;
for(Uint32 i = 0; i<LOOPS; i++){
// Case
@@ -177,8 +189,15 @@ Dbtup::execDUMP_STATE_ORD(Signal* signal)
if(chunks.size() == 0 && c == 0){
c = 1 + rand() % 2;
}
+
+ if (type == 1211)
+ ndbout_c("loop=%d case=%d free=%d alloc=%d", i, c, free, alloc);
- ndbout_c("loop=%d case=%d free=%d alloc=%d", i, c, free, alloc);
+ if (type == 1213)
+ {
+ c = 1;
+ alloc = 2 + (sum_conf >> 3) + (sum_conf >> 4);
+ }
switch(c){
case 0:{ // Release
const int ch = rand() % chunks.size();
@@ -190,23 +209,33 @@ Dbtup::execDUMP_STATE_ORD(Signal* signal)
case 2: { // Seize(n) - fail
alloc += free;
// Fall through
+ sum_req += free;
+ goto doalloc;
}
case 1: { // Seize(n) (success)
-
+ sum_req += alloc;
+ doalloc:
Chunk chunk;
allocConsPages(alloc, chunk.pageCount, chunk.pageId);
ndbrequire(chunk.pageCount <= alloc);
if(chunk.pageCount != 0){
chunks.push_back(chunk);
if(chunk.pageCount != alloc) {
- ndbout_c(" Tried to allocate %d - only allocated %d - free: %d",
- alloc, chunk.pageCount, free);
+ if (type == 1211)
+ ndbout_c(" Tried to allocate %d - only allocated %d - free: %d",
+ alloc, chunk.pageCount, free);
}
} else {
ndbout_c(" Failed to alloc %d pages with %d pages free",
alloc, free);
}
+ sum_conf += chunk.pageCount;
+ Uint32 tot = fc_left + fc_right + fc_remove;
+ sum_loop += tot;
+ if (tot > max_loop)
+ max_loop = tot;
+
for(Uint32 i = 0; i<chunk.pageCount; i++){
PagePtr pagePtr;
pagePtr.i = chunk.pageId + i;
@@ -225,6 +254,10 @@ Dbtup::execDUMP_STATE_ORD(Signal* signal)
returnCommonArea(chunk.pageId, chunk.pageCount);
chunks.erase(chunks.size() - 1);
}
+
+ ndbout_c("Got %u%% of requested allocs, loops : %u 100*avg: %u max: %u",
+ (100 * sum_conf) / sum_req, sum_loop, 100*sum_loop / LOOPS,
+ max_loop);
}
#endif
}//Dbtup::execDUMP_STATE_ORD()
diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp
index 1c3986afbbd..87705232de2 100644
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp
@@ -317,6 +317,7 @@ Dbtup::restart_setup_page(Disk_alloc_info& alloc, PagePtr pagePtr)
unsigned uncommitted, committed;
uncommitted = committed = ~(unsigned)0;
(void) tsman.get_page_free_bits(&page, &uncommitted, &committed);
+ jamEntry();
idx = alloc.calc_page_free_bits(real_free);
ddassert(idx == committed);
@@ -427,12 +428,12 @@ Dbtup::disk_page_prealloc(Signal* signal,
c_extent_pool.getPtr(ext);
if ((pageBits= tsman.alloc_page_from_extent(&ext.p->m_key, bits)) >= 0)
{
- jam();
+ jamEntry();
found= true;
}
else
{
- jam();
+ jamEntry();
/**
* The current extent is not in a free list
* and since it couldn't accomadate the request
@@ -489,7 +490,7 @@ Dbtup::disk_page_prealloc(Signal* signal,
if ((err= tsman.alloc_extent(&ext.p->m_key)) < 0)
{
- jam();
+ jamEntry();
#if NOT_YET_UNDO_ALLOC_EXTENT
c_lgman->free_log_space(logfile_group_id,
sizeof(Disk_undo::AllocExtent)>>2);
@@ -541,6 +542,7 @@ Dbtup::disk_page_prealloc(Signal* signal,
alloc.m_curr_extent_info_ptr_i= ext.i;
ext.p->m_free_matrix_pos= RNIL;
pageBits= tsman.alloc_page_from_extent(&ext.p->m_key, bits);
+ jamEntry();
ddassert(pageBits >= 0);
}
@@ -600,6 +602,7 @@ Dbtup::disk_page_prealloc(Signal* signal,
}
int res= m_pgman.get_page(signal, preq, flags);
+ jamEntry();
switch(res)
{
case 0:
@@ -896,6 +899,7 @@ Dbtup::disk_page_set_dirty(PagePtr pagePtr)
// Make sure no one will allocate it...
tsman.unmap_page(&key, MAX_FREE_LIST - 1);
+ jamEntry();
}
void
@@ -947,6 +951,7 @@ Dbtup::disk_page_unmap_callback(Uint32 page_id, Uint32 dirty_count)
fragPtr.p->m_tablespace_id);
tsman.unmap_page(&key, idx);
+ jamEntry();
pagePtr.p->list_index = idx | 0x8000;
}
@@ -995,6 +1000,7 @@ Dbtup::disk_page_alloc(Signal* signal,
fragPtrP->m_tablespace_id);
tsman.update_page_free_bits(key, new_bits, lsn);
+ jamEntry();
}
}
@@ -1047,6 +1053,7 @@ Dbtup::disk_page_free(Signal *signal,
fragPtrP->m_tablespace_id);
tsman.update_page_free_bits(key, new_bits, lsn);
+ jamEntry();
}
Uint32 ext = pagePtr.p->m_extent_info_ptr;
@@ -1100,6 +1107,7 @@ Dbtup::disk_page_abort_prealloc(Signal *signal, Fragrecord* fragPtrP,
memcpy(&req.m_page, key, sizeof(Local_key));
int res= m_pgman.get_page(signal, req, flags);
+ jamEntry();
switch(res)
{
case 0:
@@ -1228,6 +1236,7 @@ Dbtup::disk_page_alloc_extent_log_buffer_callback(Signal* signal,
Uint64 lsn= lgman.add_entry(c, 1);
tsman.update_lsn(&key, lsn);
+ jamEntry();
}
#endif
@@ -1246,6 +1255,7 @@ Dbtup::disk_page_undo_alloc(Page* page, const Local_key* key,
Uint64 lsn= lgman.add_entry(c, 1);
m_pgman.update_lsn(* key, lsn);
+ jamEntry();
return lsn;
}
@@ -1275,6 +1285,7 @@ Dbtup::disk_page_undo_update(Page* page, const Local_key* key,
Uint64 lsn= lgman.add_entry(c, 3);
m_pgman.update_lsn(* key, lsn);
+ jamEntry();
return lsn;
}
@@ -1304,6 +1315,7 @@ Dbtup::disk_page_undo_free(Page* page, const Local_key* key,
Uint64 lsn= lgman.add_entry(c, 3);
m_pgman.update_lsn(* key, lsn);
+ jamEntry();
return lsn;
}
@@ -1398,6 +1410,7 @@ Dbtup::disk_restart_undo(Signal* signal, Uint64 lsn,
int flags = 0;
int res= m_pgman.get_page(signal, preq, flags);
+ jamEntry();
switch(res)
{
case 0:
@@ -1541,6 +1554,7 @@ Dbtup::disk_restart_undo_callback(Signal* signal,
lsn = undo->m_lsn - 1; // make sure undo isn't run again...
m_pgman.update_lsn(undo->m_key, lsn);
+ jamEntry();
}
else if (DBG_UNDO)
{
@@ -1633,6 +1647,7 @@ Dbtup::disk_restart_undo_page_bits(Signal* signal, Apply_undo* undo)
fragPtrP->m_tablespace_id);
tsman.restart_undo_page_free_bits(&undo->m_key, new_bits, undo->m_lsn, lsn);
+ jamEntry();
}
int
diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
index 69b2d6d116e..45766e5e9c4 100644
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
@@ -1201,9 +1201,19 @@ int Dbtup::handleInsertReq(Signal* signal,
if(!prevOp->is_first_operation())
org= (Tuple_header*)c_undo_buffer.get_ptr(&prevOp->m_copy_tuple_location);
if (regTabPtr->need_expand())
+ {
expand_tuple(req_struct, sizes, org, regTabPtr, !disk_insert);
+ memset(req_struct->m_disk_ptr->m_null_bits+
+ regTabPtr->m_offsets[DD].m_null_offset, 0xFF,
+ 4*regTabPtr->m_offsets[DD].m_null_words);
+ }
else
+ {
memcpy(dst, org, 4*regTabPtr->m_offsets[MM].m_fix_header_size);
+ }
+ memset(tuple_ptr->m_null_bits+
+ regTabPtr->m_offsets[MM].m_null_offset, 0xFF,
+ 4*regTabPtr->m_offsets[MM].m_null_words);
}
if (disk_insert)
@@ -1491,6 +1501,7 @@ int Dbtup::handleDeleteReq(Signal* signal,
goto error;
}
memcpy(dst, org, regTabPtr->total_rec_size << 2);
+ req_struct->m_tuple_ptr = (Tuple_header*)dst;
}
else
{
@@ -1528,7 +1539,9 @@ int Dbtup::handleDeleteReq(Signal* signal,
return 0;
}
- if (setup_read(req_struct, regOperPtr, regFragPtr, regTabPtr, disk))
+ if (regTabPtr->need_expand(disk))
+ prepare_read(req_struct, regTabPtr, disk);
+
{
Uint32 RlogSize;
int ret= handleReadReq(signal, regOperPtr, regTabPtr, req_struct);
@@ -1842,7 +1855,7 @@ int Dbtup::interpreterNextLab(Signal* signal,
Uint32 RstackPtr= 0;
union {
Uint32 TregMemBuffer[32];
- Uint64 Tdummy[16];
+ Uint64 align[16];
};
Uint32 TstackMemBuffer[32];
diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
index ef242da2a43..74c7d38bd64 100644
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
@@ -99,6 +99,10 @@ Dbtup::Dbtup(Block_context& ctx, Pgman* pgman)
addRecSignal(GSN_ACCKEYREF, &Dbtup::execACCKEYREF);
addRecSignal(GSN_ACC_ABORTCONF, &Dbtup::execACC_ABORTCONF);
+ // Drop table
+ addRecSignal(GSN_FSREMOVEREF, &Dbtup::execFSREMOVEREF, true);
+ addRecSignal(GSN_FSREMOVECONF, &Dbtup::execFSREMOVECONF, true);
+
attrbufrec = 0;
fragoperrec = 0;
fragrecord = 0;
@@ -301,6 +305,12 @@ void Dbtup::execREAD_CONFIG_REQ(Signal* signal)
Uint32 noOfTriggers= 0;
Uint32 tmp= 0;
+
+ if (ndb_mgm_get_int_parameter(p, CFG_DB_MAX_ALLOCATE, &tmp))
+ tmp = 32 * 1024 * 1024;
+ m_max_allocate_pages = (tmp + GLOBAL_PAGE_SIZE - 1) / GLOBAL_PAGE_SIZE;
+
+ tmp = 0;
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_PAGE_RANGE, &tmp));
initPageRangeSize(tmp);
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_TABLE, &cnoOfTablerec));
@@ -334,6 +344,18 @@ void Dbtup::execREAD_CONFIG_REQ(Signal* signal)
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_BATCH_SIZE, &nScanBatch));
c_scanLockPool.setSize(nScanOp * nScanBatch);
+
+ /* read ahead for disk scan can not be more that disk page buffer */
+ {
+ Uint64 tmp = 64*1024*1024;
+ ndb_mgm_get_int64_parameter(p, CFG_DB_DISK_PAGE_BUFFER_MEMORY, &tmp);
+ m_max_page_read_ahead = (tmp + GLOBAL_PAGE_SIZE - 1) / GLOBAL_PAGE_SIZE; // in pages
+ // never read ahead more than 32 pages
+ if (m_max_page_read_ahead > 32)
+ m_max_page_read_ahead = 32;
+ }
+
+
ScanOpPtr lcp;
ndbrequire(c_scanOpPool.seize(lcp));
new (lcp.p) ScanOp();
diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp
index 81e678d0f6f..6866236f15e 100644
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp
@@ -21,6 +21,7 @@
#include <ndb_limits.h>
#include <pc.hpp>
#include <signaldata/TupFrag.hpp>
+#include <signaldata/FsRef.hpp>
#include <signaldata/FsConf.hpp>
#include <signaldata/FsRemoveReq.hpp>
#include <signaldata/DropTab.hpp>
@@ -1283,6 +1284,24 @@ Dbtup::drop_fragment_free_var_pages(Signal* signal)
sendSignal(cownref, GSN_CONTINUEB, signal, 3, JBB);
return;
}
+
+ /**
+ * Remove LCP's for fragment
+ */
+ tabPtr.p->m_dropTable.m_lcpno = 0;
+ tabPtr.p->m_dropTable.m_fragPtrI = fragPtr.i;
+ drop_fragment_fsremove(signal, tabPtr, fragPtr);
+}
+
+void
+Dbtup::drop_fragment_fsremove_done(Signal* signal,
+ TablerecPtr tabPtr,
+ FragrecordPtr fragPtr)
+{
+ /**
+ * LCP's removed...
+ * now continue with "next"
+ */
Uint32 logfile_group_id = fragPtr.p->m_logfile_group_id ;
releaseFragPages(fragPtr.p);
Uint32 i;
@@ -1302,6 +1321,74 @@ Dbtup::drop_fragment_free_var_pages(Signal* signal)
return;
}
+// Remove LCP
+
+void
+Dbtup::drop_fragment_fsremove(Signal* signal,
+ TablerecPtr tabPtr,
+ FragrecordPtr fragPtr)
+{
+ FsRemoveReq* req = (FsRemoveReq*)signal->getDataPtrSend();
+ req->userReference = reference();
+ req->userPointer = tabPtr.i;
+ req->directory = 0;
+ req->ownDirectory = 0;
+
+ Uint32 lcpno = tabPtr.p->m_dropTable.m_lcpno;
+ Uint32 fragId = fragPtr.p->fragmentId;
+ Uint32 tableId = fragPtr.p->fragTableId;
+
+ FsOpenReq::setVersion(req->fileNumber, 5);
+ FsOpenReq::setSuffix(req->fileNumber, FsOpenReq::S_DATA);
+ FsOpenReq::v5_setLcpNo(req->fileNumber, lcpno);
+ FsOpenReq::v5_setTableId(req->fileNumber, tableId);
+ FsOpenReq::v5_setFragmentId(req->fileNumber, fragId);
+ sendSignal(NDBFS_REF, GSN_FSREMOVEREQ, signal,
+ FsRemoveReq::SignalLength, JBB);
+}
+
+void
+Dbtup::execFSREMOVEREF(Signal* signal)
+{
+ jamEntry();
+ FsRef* ref = (FsRef*)signal->getDataPtr();
+ Uint32 userPointer = ref->userPointer;
+ FsConf* conf = (FsConf*)signal->getDataPtrSend();
+ conf->userPointer = userPointer;
+ execFSREMOVECONF(signal);
+}
+
+void
+Dbtup::execFSREMOVECONF(Signal* signal)
+{
+ jamEntry();
+ FsConf* conf = (FsConf*)signal->getDataPtrSend();
+
+ TablerecPtr tabPtr;
+ FragrecordPtr fragPtr;
+
+ tabPtr.i = conf->userPointer;
+ ptrCheckGuard(tabPtr, cnoOfTablerec, tablerec);
+
+ ndbrequire(tabPtr.p->tableStatus == DROPPING);
+
+ fragPtr.i = tabPtr.p->m_dropTable.m_fragPtrI;
+ ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord);
+
+ tabPtr.p->m_dropTable.m_lcpno++;
+ if (tabPtr.p->m_dropTable.m_lcpno < 3)
+ {
+ jam();
+ drop_fragment_fsremove(signal, tabPtr, fragPtr);
+ }
+ else
+ {
+ jam();
+ drop_fragment_fsremove_done(signal, tabPtr, fragPtr);
+ }
+}
+// End remove LCP
+
void
Dbtup::start_restore_lcp(Uint32 tableId, Uint32 fragId)
{
diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupPagMan.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupPagMan.cpp
index d10fabf42da..24806062fcf 100644
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupPagMan.cpp
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupPagMan.cpp
@@ -146,10 +146,17 @@ void Dbtup::initializePage()
cnoOfAllocatedPages = tmp; // Is updated by returnCommonArea
}//Dbtup::initializePage()
+#ifdef VM_TRACE
+Uint32 fc_left, fc_right, fc_remove;
+#endif
+
void Dbtup::allocConsPages(Uint32 noOfPagesToAllocate,
Uint32& noOfPagesAllocated,
Uint32& allocPageRef)
{
+#ifdef VM_TRACE
+ fc_left = fc_right = fc_remove = 0;
+#endif
if (noOfPagesToAllocate == 0){
jam();
noOfPagesAllocated = 0;
@@ -228,7 +235,10 @@ void Dbtup::findFreeLeftNeighbours(Uint32& allocPageRef,
{
PagePtr pageFirstPtr, pageLastPtr;
Uint32 remainAllocate = noOfPagesToAllocate - noPagesAllocated;
- while (allocPageRef > 0) {
+ Uint32 loop = 0;
+ while (allocPageRef > 0 &&
+ ++loop < 16)
+ {
jam();
pageLastPtr.i = allocPageRef - 1;
c_page_pool.getPtr(pageLastPtr);
@@ -256,6 +266,9 @@ void Dbtup::findFreeLeftNeighbours(Uint32& allocPageRef,
remainAllocate -= listSize;
}//if
}//if
+#ifdef VM_TRACE
+ fc_left++;
+#endif
}//while
}//Dbtup::findFreeLeftNeighbours()
@@ -269,7 +282,10 @@ void Dbtup::findFreeRightNeighbours(Uint32& allocPageRef,
jam();
return;
}//if
- while ((allocPageRef + noPagesAllocated) < c_page_pool.getSize()) {
+ Uint32 loop = 0;
+ while ((allocPageRef + noPagesAllocated) < c_page_pool.getSize() &&
+ ++loop < 16)
+ {
jam();
pageFirstPtr.i = allocPageRef + noPagesAllocated;
c_page_pool.getPtr(pageFirstPtr);
@@ -296,24 +312,37 @@ void Dbtup::findFreeRightNeighbours(Uint32& allocPageRef,
remainAllocate -= listSize;
}//if
}//if
+#ifdef VM_TRACE
+ fc_right++;
+#endif
}//while
}//Dbtup::findFreeRightNeighbours()
void Dbtup::insertCommonArea(Uint32 insPageRef, Uint32 insList)
{
cnoOfAllocatedPages -= (1 << insList);
- PagePtr pageLastPtr, pageInsPtr;
+ PagePtr pageLastPtr, pageInsPtr, pageHeadPtr;
+ pageHeadPtr.i = cfreepageList[insList];
c_page_pool.getPtr(pageInsPtr, insPageRef);
ndbrequire(insList < 16);
pageLastPtr.i = (pageInsPtr.i + (1 << insList)) - 1;
- pageInsPtr.p->next_cluster_page = cfreepageList[insList];
+ pageInsPtr.p->page_state = ZFREE_COMMON;
+ pageInsPtr.p->next_cluster_page = pageHeadPtr.i;
pageInsPtr.p->prev_cluster_page = RNIL;
pageInsPtr.p->last_cluster_page = pageLastPtr.i;
cfreepageList[insList] = pageInsPtr.i;
+ if (pageHeadPtr.i != RNIL)
+ {
+ jam();
+ c_page_pool.getPtr(pageHeadPtr);
+ pageHeadPtr.p->prev_cluster_page = pageInsPtr.i;
+ }
+
c_page_pool.getPtr(pageLastPtr);
+ pageLastPtr.p->page_state = ZFREE_COMMON;
pageLastPtr.p->first_cluster_page = pageInsPtr.i;
pageLastPtr.p->next_page = RNIL;
}//Dbtup::insertCommonArea()
@@ -321,12 +350,13 @@ void Dbtup::insertCommonArea(Uint32 insPageRef, Uint32 insList)
void Dbtup::removeCommonArea(Uint32 remPageRef, Uint32 list)
{
cnoOfAllocatedPages += (1 << list);
- PagePtr pagePrevPtr, pageNextPtr, pageLastPtr, pageSearchPtr, remPagePtr;
+ PagePtr pagePrevPtr, pageNextPtr, pageLastPtr, remPagePtr;
c_page_pool.getPtr(remPagePtr, remPageRef);
ndbrequire(list < 16);
if (cfreepageList[list] == remPagePtr.i) {
jam();
+ ndbassert(remPagePtr.p->prev_cluster_page == RNIL);
cfreepageList[list] = remPagePtr.p->next_cluster_page;
pageNextPtr.i = cfreepageList[list];
if (pageNextPtr.i != RNIL) {
@@ -335,30 +365,25 @@ void Dbtup::removeCommonArea(Uint32 remPageRef, Uint32 list)
pageNextPtr.p->prev_cluster_page = RNIL;
}//if
} else {
- pageSearchPtr.i = cfreepageList[list];
- while (true) {
- jam();
- c_page_pool.getPtr(pageSearchPtr);
- pagePrevPtr = pageSearchPtr;
- pageSearchPtr.i = pageSearchPtr.p->next_cluster_page;
- if (pageSearchPtr.i == remPagePtr.i) {
- jam();
- break;
- }//if
- }//while
+ pagePrevPtr.i = remPagePtr.p->prev_cluster_page;
pageNextPtr.i = remPagePtr.p->next_cluster_page;
+ c_page_pool.getPtr(pagePrevPtr);
pagePrevPtr.p->next_cluster_page = pageNextPtr.i;
- if (pageNextPtr.i != RNIL) {
+ if (pageNextPtr.i != RNIL)
+ {
jam();
c_page_pool.getPtr(pageNextPtr);
pageNextPtr.p->prev_cluster_page = pagePrevPtr.i;
- }//if
+ }
}//if
remPagePtr.p->next_cluster_page= RNIL;
remPagePtr.p->last_cluster_page= RNIL;
remPagePtr.p->prev_cluster_page= RNIL;
+ remPagePtr.p->page_state = ~ZFREE_COMMON;
pageLastPtr.i = (remPagePtr.i + (1 << list)) - 1;
c_page_pool.getPtr(pageLastPtr);
pageLastPtr.p->first_cluster_page= RNIL;
+ pageLastPtr.p->page_state = ~ZFREE_COMMON;
+
}//Dbtup::removeCommonArea()
diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp
index 6ef8d3585e9..cde63091cfb 100644
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp
@@ -432,6 +432,11 @@ void Dbtup::allocMoreFragPages(Fragrecord* const regFragPtr)
// We will grow by 18.75% plus two more additional pages to grow
// a little bit quicker in the beginning.
/* -----------------------------------------------------------------*/
+
+ if (noAllocPages > m_max_allocate_pages)
+ {
+ noAllocPages = m_max_allocate_pages;
+ }
Uint32 allocated = allocFragPages(regFragPtr, noAllocPages);
regFragPtr->noOfPagesToGrow += allocated;
}//Dbtup::allocMoreFragPages()
diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp
index 56bac8868b8..6e53531e118 100644
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp
@@ -63,13 +63,11 @@ Dbtup::execACC_SCANREQ(Signal* signal)
break;
}
-#if BUG_27776_FIXED
if (!AccScanReq::getNoDiskScanFlag(req->requestInfo)
&& tablePtr.p->m_no_of_disk_attributes)
{
bits |= ScanOp::SCAN_DD;
}
-#endif
bool mm = (bits & ScanOp::SCAN_DD);
if (tablePtr.p->m_attributes[mm].m_no_of_varsize > 0) {
@@ -689,13 +687,74 @@ Dbtup::scanNext(Signal* signal, ScanOpPtr scanPtr)
// move to next extent
jam();
pos.m_extent_info_ptr_i = ext_ptr.i;
- Extent_info* ext = c_extent_pool.getPtr(pos.m_extent_info_ptr_i);
+ ext = c_extent_pool.getPtr(pos.m_extent_info_ptr_i);
key.m_file_no = ext->m_key.m_file_no;
key.m_page_no = ext->m_first_page_no;
}
}
key.m_page_idx = 0;
pos.m_get = ScanPos::Get_page_dd;
+ /*
+ read ahead for scan in disk order
+ do read ahead every 8:th page
+ */
+ if ((bits & ScanOp::SCAN_DD) &&
+ (((key.m_page_no - ext->m_first_page_no) & 7) == 0))
+ {
+ jam();
+ // initialize PGMAN request
+ Page_cache_client::Request preq;
+ preq.m_page = pos.m_key;
+ preq.m_callback = TheNULLCallback;
+
+ // set maximum read ahead
+ Uint32 read_ahead = m_max_page_read_ahead;
+
+ while (true)
+ {
+ // prepare page read ahead in current extent
+ Uint32 page_no = preq.m_page.m_page_no;
+ Uint32 page_no_limit = page_no + read_ahead;
+ Uint32 limit = ext->m_first_page_no + alloc.m_extent_size;
+ if (page_no_limit > limit)
+ {
+ jam();
+ // read ahead crosses extent, set limit for this extent
+ read_ahead = page_no_limit - limit;
+ page_no_limit = limit;
+ // and make sure we only read one extra extent next time around
+ if (read_ahead > alloc.m_extent_size)
+ read_ahead = alloc.m_extent_size;
+ }
+ else
+ {
+ jam();
+ read_ahead = 0; // no more to read ahead after this
+ }
+ // do read ahead pages for this extent
+ while (page_no < page_no_limit)
+ {
+ // page request to PGMAN
+ jam();
+ preq.m_page.m_page_no = page_no;
+ int flags = 0;
+ // ignore result
+ m_pgman.get_page(signal, preq, flags);
+ jamEntry();
+ page_no++;
+ }
+ if (!read_ahead || !list.next(ext_ptr))
+ {
+ // no more extents after this or read ahead done
+ jam();
+ break;
+ }
+ // move to next extent and initialize PGMAN request accordingly
+ Extent_info* ext = c_extent_pool.getPtr(ext_ptr.i);
+ preq.m_page.m_file_no = ext->m_key.m_file_no;
+ preq.m_page.m_page_no = ext->m_first_page_no;
+ }
+ } // if ScanOp::SCAN_DD read ahead
}
/*FALLTHRU*/
case ScanPos::Get_page_dd:
@@ -728,6 +787,7 @@ Dbtup::scanNext(Signal* signal, ScanOpPtr scanPtr)
safe_cast(&Dbtup::disk_page_tup_scan_callback);
int flags = 0;
int res = m_pgman.get_page(signal, preq, flags);
+ jamEntry();
if (res == 0) {
jam();
// request queued
diff --git a/storage/ndb/src/kernel/blocks/diskpage.cpp b/storage/ndb/src/kernel/blocks/diskpage.cpp
index 3f98e078746..50e9b6e53cb 100644
--- a/storage/ndb/src/kernel/blocks/diskpage.cpp
+++ b/storage/ndb/src/kernel/blocks/diskpage.cpp
@@ -49,7 +49,7 @@ operator<<(NdbOut& out, const File_formats::Zero_page_header& obj)
char buf[256];
out << "page size: " << obj.m_page_size << endl;
out << "ndb version: " << obj.m_ndb_version << ", " <<
- getVersionString(obj.m_ndb_version, 0, buf, sizeof(buf)) << endl;
+ ndbGetVersionString(obj.m_ndb_version, 0, buf, sizeof(buf)) << endl;
out << "ndb node id: " << obj.m_node_id << endl;
out << "file type: " << obj.m_file_type << endl;
out << "time: " << obj.m_time << ", "
diff --git a/storage/ndb/src/kernel/blocks/lgman.cpp b/storage/ndb/src/kernel/blocks/lgman.cpp
index 82fed94f62e..23738717580 100644
--- a/storage/ndb/src/kernel/blocks/lgman.cpp
+++ b/storage/ndb/src/kernel/blocks/lgman.cpp
@@ -346,6 +346,12 @@ Lgman::execCREATE_FILEGROUP_REQ(Signal* signal){
m_logfile_group_hash.add(ptr);
m_logfile_group_list.add(ptr);
+
+ if (getNodeState().getNodeRestartInProgress() ||
+ getNodeState().getSystemRestartInProgress())
+ {
+ ptr.p->m_state = Logfile_group::LG_STARTING;
+ }
CreateFilegroupImplConf* conf=
(CreateFilegroupImplConf*)signal->getDataPtr();
@@ -370,8 +376,6 @@ Lgman::execDROP_FILEGROUP_REQ(Signal* signal)
{
jamEntry();
- jamEntry();
-
Uint32 errorCode = 0;
DropFilegroupImplReq req = *(DropFilegroupImplReq*)signal->getDataPtr();
do
@@ -436,7 +440,6 @@ Lgman::drop_filegroup_drop_files(Signal* signal,
{
jam();
ndbrequire(! (ptr.p->m_state & Logfile_group::LG_THREAD_MASK));
- ndbrequire(ptr.p->m_meta_files.isEmpty());
ndbrequire(ptr.p->m_outstanding_fs == 0);
Local_undofile_list list(m_file_pool, ptr.p->m_files);
@@ -452,6 +455,18 @@ Lgman::drop_filegroup_drop_files(Signal* signal,
return;
}
+ Local_undofile_list metalist(m_file_pool, ptr.p->m_meta_files);
+ if (metalist.first(file_ptr))
+ {
+ jam();
+ metalist.remove(file_ptr);
+ list.add(file_ptr);
+ file_ptr.p->m_create.m_senderRef = ref;
+ file_ptr.p->m_create.m_senderData = data;
+ create_file_abort(signal, ptr, file_ptr);
+ return;
+ }
+
free_logbuffer_memory(ptr);
m_logfile_group_hash.release(ptr);
DropFilegroupImplConf *conf = (DropFilegroupImplConf*)signal->getDataPtr();
@@ -462,7 +477,8 @@ Lgman::drop_filegroup_drop_files(Signal* signal,
}
void
-Lgman::execCREATE_FILE_REQ(Signal* signal){
+Lgman::execCREATE_FILE_REQ(Signal* signal)
+{
jamEntry();
CreateFileImplReq* req= (CreateFileImplReq*)signal->getDataPtr();
@@ -491,6 +507,7 @@ Lgman::execCREATE_FILE_REQ(Signal* signal){
switch(requestInfo){
case CreateFileImplReq::Commit:
{
+ jam();
ndbrequire(find_file_by_id(file_ptr, ptr.p->m_meta_files, req->file_id));
file_ptr.p->m_create.m_senderRef = req->senderRef;
file_ptr.p->m_create.m_senderData = req->senderData;
@@ -503,6 +520,7 @@ Lgman::execCREATE_FILE_REQ(Signal* signal){
Uint32 senderData = req->senderData;
if (find_file_by_id(file_ptr, ptr.p->m_meta_files, req->file_id))
{
+ jam();
file_ptr.p->m_create.m_senderRef = senderRef;
file_ptr.p->m_create.m_senderData = senderData;
create_file_abort(signal, ptr, file_ptr);
@@ -510,11 +528,11 @@ Lgman::execCREATE_FILE_REQ(Signal* signal){
else
{
CreateFileImplConf* conf= (CreateFileImplConf*)signal->getDataPtr();
+ jam();
conf->senderData = senderData;
conf->senderRef = reference();
sendSignal(senderRef, GSN_CREATE_FILE_CONF, signal,
CreateFileImplConf::SignalLength, JBB);
- return;
}
return;
}
@@ -703,7 +721,8 @@ Lgman::create_file_commit(Signal* signal,
Uint32 senderData = ptr.p->m_create.m_senderData;
bool first= false;
- if(ptr.p->m_state == Undofile::FS_CREATING)
+ if(ptr.p->m_state == Undofile::FS_CREATING &&
+ (lg_ptr.p->m_state & Logfile_group::LG_ONLINE))
{
jam();
Local_undofile_list free(m_file_pool, lg_ptr.p->m_files);
@@ -2068,13 +2087,17 @@ Lgman::execSTART_RECREQ(Signal* signal)
void
Lgman::find_log_head(Signal* signal, Ptr<Logfile_group> ptr)
{
+ ndbrequire(ptr.p->m_state &
+ (Logfile_group::LG_STARTING | Logfile_group::LG_SORTING));
+
if(ptr.p->m_meta_files.isEmpty() && ptr.p->m_files.isEmpty())
{
jam();
/**
* Logfile_group wo/ any files
*/
-
+ ptr.p->m_state &= ~(Uint32)Logfile_group::LG_STARTING;
+ ptr.p->m_state |= Logfile_group::LG_ONLINE;
m_logfile_group_list.next(ptr);
signal->theData[0] = LgmanContinueB::FIND_LOG_HEAD;
signal->theData[1] = ptr.i;
diff --git a/storage/ndb/src/kernel/blocks/lgman.hpp b/storage/ndb/src/kernel/blocks/lgman.hpp
index b26c3219088..d2706818144 100644
--- a/storage/ndb/src/kernel/blocks/lgman.hpp
+++ b/storage/ndb/src/kernel/blocks/lgman.hpp
@@ -175,13 +175,14 @@ public:
,LG_SORTING = 0x002 // Sorting files
,LG_SEARCHING = 0x004 // Searching in last file
,LG_EXEC_THREAD = 0x008 // Execute thread is running
- ,LG_READ_THREAD = 0x010 // Read thread is running
+ ,LG_READ_THREAD = 0x010 // Read thread is running
,LG_FORCE_SYNC_THREAD = 0x020
,LG_SYNC_WAITERS_THREAD = 0x040
,LG_CUT_LOG_THREAD = 0x080
,LG_WAITERS_THREAD = 0x100
,LG_FLUSH_THREAD = 0x200
,LG_DROPPING = 0x400
+ ,LG_STARTING = 0x800
};
static const Uint32 LG_THREAD_MASK = Logfile_group::LG_FORCE_SYNC_THREAD |
diff --git a/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp b/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp
index adc6d1e3ed4..56ecc8ddc39 100644
--- a/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp
+++ b/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp
@@ -277,6 +277,14 @@ void Ndbcntr::execSTTOR(Signal* signal)
break;
case ZSTART_PHASE_1:
jam();
+ {
+ Uint32 db_watchdog_interval = 0;
+ const ndb_mgm_configuration_iterator * p =
+ m_ctx.m_config.getOwnConfigIterator();
+ ndb_mgm_get_int_parameter(p, CFG_DB_WATCHDOG_INTERVAL, &db_watchdog_interval);
+ ndbrequire(db_watchdog_interval);
+ update_watch_dog_timer(db_watchdog_interval);
+ }
startPhase1Lab(signal);
break;
case ZSTART_PHASE_2:
@@ -1410,6 +1418,13 @@ void Ndbcntr::execNODE_FAILREP(Signal* signal)
{
jamEntry();
+ if (ERROR_INSERTED(1001))
+ {
+ sendSignalWithDelay(reference(), GSN_NODE_FAILREP, signal, 100,
+ signal->getLength());
+ return;
+ }
+
const NodeFailRep * nodeFail = (NodeFailRep *)&signal->theData[0];
NdbNodeBitmask allFailed;
allFailed.assign(NdbNodeBitmask::Size, nodeFail->theNodes);
@@ -2734,16 +2749,34 @@ void Ndbcntr::execSTART_ORD(Signal* signal){
c_missra.execSTART_ORD(signal);
}
+#define CLEAR_DX 13
+#define CLEAR_LCP 3
+
void
-Ndbcntr::clearFilesystem(Signal* signal){
+Ndbcntr::clearFilesystem(Signal* signal)
+{
+ const Uint32 lcp = c_fsRemoveCount >= CLEAR_DX;
+
FsRemoveReq * req = (FsRemoveReq *)signal->getDataPtrSend();
req->userReference = reference();
req->userPointer = 0;
req->directory = 1;
req->ownDirectory = 1;
- FsOpenReq::setVersion(req->fileNumber, 3);
- FsOpenReq::setSuffix(req->fileNumber, FsOpenReq::S_CTL); // Can by any...
- FsOpenReq::v1_setDisk(req->fileNumber, c_fsRemoveCount);
+
+ if (lcp == 0)
+ {
+ FsOpenReq::setVersion(req->fileNumber, 3);
+ FsOpenReq::setSuffix(req->fileNumber, FsOpenReq::S_CTL); // Can by any...
+ FsOpenReq::v1_setDisk(req->fileNumber, c_fsRemoveCount);
+ }
+ else
+ {
+ FsOpenReq::setVersion(req->fileNumber, 5);
+ FsOpenReq::setSuffix(req->fileNumber, FsOpenReq::S_DATA);
+ FsOpenReq::v5_setLcpNo(req->fileNumber, c_fsRemoveCount - CLEAR_DX);
+ FsOpenReq::v5_setTableId(req->fileNumber, 0);
+ FsOpenReq::v5_setFragmentId(req->fileNumber, 0);
+ }
sendSignal(NDBFS_REF, GSN_FSREMOVEREQ, signal,
FsRemoveReq::SignalLength, JBA);
c_fsRemoveCount++;
@@ -2752,12 +2785,12 @@ Ndbcntr::clearFilesystem(Signal* signal){
void
Ndbcntr::execFSREMOVECONF(Signal* signal){
jamEntry();
- if(c_fsRemoveCount == 13){
+ if(c_fsRemoveCount == CLEAR_DX + CLEAR_LCP){
jam();
sendSttorry(signal);
} else {
jam();
- ndbrequire(c_fsRemoveCount < 13);
+ ndbrequire(c_fsRemoveCount < CLEAR_DX + CLEAR_LCP);
clearFilesystem(signal);
}//if
}
diff --git a/storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp b/storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
index 5f93ee31bc7..5300d5bbfd9 100644
--- a/storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
+++ b/storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
@@ -99,6 +99,7 @@ AsyncFile::AsyncFile(SimulatedBlock& fs) :
{
m_page_ptr.setNull();
m_current_request= m_last_request= 0;
+ m_open_flags = 0;
}
void
@@ -163,7 +164,12 @@ AsyncFile::run()
theStartFlag = true;
// Create write buffer for bigger writes
theWriteBufferSize = WRITEBUFFERSIZE;
- theWriteBuffer = (char *) ndbd_malloc(theWriteBufferSize);
+ theWriteBufferUnaligned = (char *) ndbd_malloc(theWriteBufferSize +
+ NDB_O_DIRECT_WRITE_ALIGNMENT-1);
+ theWriteBuffer = (char *)
+ (((UintPtr)theWriteBufferUnaligned + NDB_O_DIRECT_WRITE_ALIGNMENT - 1) &
+ ~(UintPtr)(NDB_O_DIRECT_WRITE_ALIGNMENT - 1));
+
NdbMutex_Unlock(theStartMutexPtr);
NdbCondition_Signal(theStartConditionPtr);
@@ -247,10 +253,83 @@ AsyncFile::run()
static char g_odirect_readbuf[2*GLOBAL_PAGE_SIZE -1];
#endif
+int
+AsyncFile::check_odirect_write(Uint32 flags, int& new_flags, int mode)
+{
+ assert(new_flags & (O_CREAT | O_TRUNC));
+#ifdef O_DIRECT
+ int ret;
+ char * bufptr = (char*)((UintPtr(g_odirect_readbuf)+(GLOBAL_PAGE_SIZE - 1)) & ~(GLOBAL_PAGE_SIZE - 1));
+ while (((ret = ::write(theFd, bufptr, GLOBAL_PAGE_SIZE)) == -1) &&
+ (errno == EINTR));
+ if (ret == -1)
+ {
+ new_flags &= ~O_DIRECT;
+ ndbout_c("%s Failed to write using O_DIRECT, disabling",
+ theFileName.c_str());
+ }
+
+ close(theFd);
+ theFd = ::open(theFileName.c_str(), new_flags, mode);
+ if (theFd == -1)
+ return errno;
+#endif
+
+ return 0;
+}
+
+int
+AsyncFile::check_odirect_read(Uint32 flags, int &new_flags, int mode)
+{
+#ifdef O_DIRECT
+ int ret;
+ char * bufptr = (char*)((UintPtr(g_odirect_readbuf)+(GLOBAL_PAGE_SIZE - 1)) & ~(GLOBAL_PAGE_SIZE - 1));
+ while (((ret = ::read(theFd, bufptr, GLOBAL_PAGE_SIZE)) == -1) &&
+ (errno == EINTR));
+ if (ret == -1)
+ {
+ ndbout_c("%s Failed to read using O_DIRECT, disabling",
+ theFileName.c_str());
+ goto reopen;
+ }
+
+ if(lseek(theFd, 0, SEEK_SET) != 0)
+ {
+ return errno;
+ }
+
+ if ((flags & FsOpenReq::OM_CHECK_SIZE) == 0)
+ {
+ struct stat buf;
+ if ((fstat(theFd, &buf) == -1))
+ {
+ return errno;
+ }
+ else if ((buf.st_size % GLOBAL_PAGE_SIZE) != 0)
+ {
+ ndbout_c("%s filesize not a multiple of %d, disabling O_DIRECT",
+ theFileName.c_str(), GLOBAL_PAGE_SIZE);
+ goto reopen;
+ }
+ }
+
+ return 0;
+
+reopen:
+ close(theFd);
+ new_flags &= ~O_DIRECT;
+ theFd = ::open(theFileName.c_str(), new_flags, mode);
+ if (theFd == -1)
+ return errno;
+#endif
+ return 0;
+}
+
void AsyncFile::openReq(Request* request)
{
m_auto_sync_freq = 0;
m_write_wo_sync = 0;
+ m_open_flags = request->par.open.flags;
// for open.flags, see signal FSOPENREQ
#ifdef NDB_WIN32
@@ -312,7 +391,7 @@ void AsyncFile::openReq(Request* request)
}
#else
Uint32 flags = request->par.open.flags;
- Uint32 new_flags = 0;
+ int new_flags = 0;
// Convert file open flags from Solaris to Liux
if (flags & FsOpenReq::OM_CREATE)
@@ -343,10 +422,6 @@ void AsyncFile::openReq(Request* request)
{
new_flags |= O_DIRECT;
}
-#elif defined O_SYNC
- {
- flags |= FsOpenReq::OM_SYNC;
- }
#endif
if ((flags & FsOpenReq::OM_SYNC) && ! (flags & FsOpenReq::OM_INIT))
@@ -355,15 +430,19 @@ void AsyncFile::openReq(Request* request)
new_flags |= O_SYNC;
#endif
}
-
+
+ const char * rw = "";
switch(flags & 0x3){
case FsOpenReq::OM_READONLY:
+ rw = "r";
new_flags |= O_RDONLY;
break;
case FsOpenReq::OM_WRITEONLY:
+ rw = "w";
new_flags |= O_WRONLY;
break;
case FsOpenReq::OM_READWRITE:
+ rw = "rw";
new_flags |= O_RDWR;
break;
default:
@@ -404,11 +483,6 @@ no_odirect:
if (new_flags & O_DIRECT)
{
new_flags &= ~O_DIRECT;
- flags |= FsOpenReq::OM_SYNC;
-#ifdef O_SYNC
- if (! (flags & FsOpenReq::OM_INIT))
- new_flags |= O_SYNC;
-#endif
goto no_odirect;
}
#endif
@@ -421,11 +495,6 @@ no_odirect:
else if (new_flags & O_DIRECT)
{
new_flags &= ~O_DIRECT;
- flags |= FsOpenReq::OM_SYNC;
-#ifdef O_SYNC
- if (! (flags & FsOpenReq::OM_INIT))
- new_flags |= O_SYNC;
-#endif
goto no_odirect;
}
#endif
@@ -512,7 +581,6 @@ no_odirect:
{
ndbout_c("error on first write(%d), disable O_DIRECT", err);
new_flags &= ~O_DIRECT;
- flags |= FsOpenReq::OM_SYNC;
close(theFd);
theFd = ::open(theFileName.c_str(), new_flags, mode);
if (theFd != -1)
@@ -532,26 +600,32 @@ no_odirect:
else if (flags & FsOpenReq::OM_DIRECT)
{
#ifdef O_DIRECT
- do {
- int ret;
- char * bufptr = (char*)((UintPtr(g_odirect_readbuf)+(GLOBAL_PAGE_SIZE - 1)) & ~(GLOBAL_PAGE_SIZE - 1));
- while (((ret = ::read(theFd, bufptr, GLOBAL_PAGE_SIZE)) == -1) && (errno == EINTR));
- if (ret == -1)
- {
- ndbout_c("%s Failed to read using O_DIRECT, disabling", theFileName.c_str());
- flags |= FsOpenReq::OM_SYNC;
- flags |= FsOpenReq::OM_INIT;
- break;
- }
- if(lseek(theFd, 0, SEEK_SET) != 0)
- {
- request->error = errno;
- return;
- }
- } while (0);
+ if (flags & (FsOpenReq::OM_TRUNCATE | FsOpenReq::OM_CREATE))
+ {
+ request->error = check_odirect_write(flags, new_flags, mode);
+ }
+ else
+ {
+ request->error = check_odirect_read(flags, new_flags, mode);
+ }
+
+ if (request->error)
+ return;
#endif
}
-
+#ifdef VM_TRACE
+ if (flags & FsOpenReq::OM_DIRECT)
+ {
+#ifdef O_DIRECT
+ ndbout_c("%s %s O_DIRECT: %d",
+ theFileName.c_str(), rw,
+ !!(new_flags & O_DIRECT));
+#else
+ ndbout_c("%s %s O_DIRECT: 0",
+ theFileName.c_str(), rw);
+#endif
+ }
+#endif
if ((flags & FsOpenReq::OM_SYNC) && (flags & FsOpenReq::OM_INIT))
{
#ifdef O_SYNC
@@ -562,6 +636,10 @@ no_odirect:
new_flags &= ~(O_CREAT | O_TRUNC);
new_flags |= O_SYNC;
theFd = ::open(theFileName.c_str(), new_flags, mode);
+ if (theFd == -1)
+ {
+ request->error = errno;
+ }
#endif
}
#endif
@@ -878,7 +956,12 @@ AsyncFile::writevReq( Request * request)
void
AsyncFile::closeReq(Request * request)
{
- syncReq(request);
+ if (m_open_flags & (
+ FsOpenReq::OM_WRITEONLY |
+ FsOpenReq::OM_READWRITE |
+ FsOpenReq::OM_APPEND )) {
+ syncReq(request);
+ }
#ifdef NDB_WIN32
if(!CloseHandle(hFile)) {
request->error = GetLastError();
@@ -1079,7 +1162,8 @@ AsyncFile::rmrfReq(Request * request, char * path, bool removePath){
void AsyncFile::endReq()
{
// Thread is ended with return
- if (theWriteBuffer) ndbd_free(theWriteBuffer, theWriteBufferSize);
+ if (theWriteBufferUnaligned)
+ ndbd_free(theWriteBufferUnaligned, theWriteBufferSize);
}
diff --git a/storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp b/storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp
index cc667225ce2..e4a01753acd 100644
--- a/storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp
+++ b/storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp
@@ -224,6 +224,8 @@ private:
#else
int theFd;
#endif
+
+ Uint32 m_open_flags; // OM_ flags from request to open file
MemoryChannel<Request> *theReportTo;
MemoryChannel<Request>* theMemoryChannelPtr;
@@ -234,9 +236,13 @@ private:
bool theStartFlag;
int theWriteBufferSize;
char* theWriteBuffer;
+ void* theWriteBufferUnaligned;
size_t m_write_wo_sync; // Writes wo/ sync
size_t m_auto_sync_freq; // Auto sync freq in bytes
+
+ int check_odirect_read(Uint32 flags, int&new_flags, int mode);
+ int check_odirect_write(Uint32 flags, int&new_flags, int mode);
public:
SimulatedBlock& m_fs;
Ptr<GlobalPage> m_page_ptr;
diff --git a/storage/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp b/storage/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp
index 966f82cc9c2..411e7064efa 100644
--- a/storage/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp
+++ b/storage/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp
@@ -75,7 +75,7 @@ template <class T>
class MemoryChannel
{
public:
- MemoryChannel( int size= 256);
+ MemoryChannel( int size= 512);
virtual ~MemoryChannel( );
void writeChannel( T *t);
diff --git a/storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp b/storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
index 44f8a8ab05b..26bf8878852 100644
--- a/storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
+++ b/storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
@@ -652,7 +652,7 @@ AsyncFile*
Ndbfs::createAsyncFile(){
// Check limit of open files
- if (m_maxFiles !=0 && theFiles.size()+1 == m_maxFiles) {
+ if (m_maxFiles !=0 && theFiles.size() == m_maxFiles) {
// Print info about all open files
for (unsigned i = 0; i < theFiles.size(); i++){
AsyncFile* file = theFiles[i];
diff --git a/storage/ndb/src/kernel/blocks/pgman.cpp b/storage/ndb/src/kernel/blocks/pgman.cpp
index 4e1d1c29ab8..d8e0c053984 100644
--- a/storage/ndb/src/kernel/blocks/pgman.cpp
+++ b/storage/ndb/src/kernel/blocks/pgman.cpp
@@ -122,9 +122,9 @@ Pgman::execREAD_CONFIG_REQ(Signal* signal)
if (page_buffer > 0)
{
- page_buffer /= GLOBAL_PAGE_SIZE; // in pages
- m_page_entry_pool.setSize(100*page_buffer);
+ page_buffer = (page_buffer + GLOBAL_PAGE_SIZE - 1) / GLOBAL_PAGE_SIZE; // in pages
m_param.m_max_pages = page_buffer;
+ m_page_entry_pool.setSize(m_param.m_lirs_stack_mult * page_buffer);
m_param.m_max_hot_pages = (page_buffer * 9) / 10;
}
@@ -141,9 +141,10 @@ Pgman::execREAD_CONFIG_REQ(Signal* signal)
Pgman::Param::Param() :
m_max_pages(64), // smallish for testing
+ m_lirs_stack_mult(10),
m_max_hot_pages(56),
m_max_loop_count(256),
- m_max_io_waits(64),
+ m_max_io_waits(256),
m_stats_loop_delay(1000),
m_cleanup_loop_delay(200),
m_lcp_loop_delay(0)
@@ -301,6 +302,9 @@ Pgman::get_sublist_no(Page_state state)
{
return Page_entry::SL_LOCKED;
}
+ if (state == Page_entry::ONSTACK) {
+ return Page_entry::SL_IDLE;
+ }
return Page_entry::SL_OTHER;
}
@@ -415,15 +419,55 @@ Pgman::get_page_entry(Ptr<Page_entry>& ptr, Uint32 file_no, Uint32 page_no)
{
if (find_page_entry(ptr, file_no, page_no))
{
+ jam();
ndbrequire(ptr.p->m_state != 0);
m_stats.m_page_hits++;
+
+#ifdef VM_TRACE
+ debugOut << "PGMAN: get_page_entry: found" << endl;
+ debugOut << "PGMAN: " << ptr << endl;
+#endif
return true;
}
+ if (m_page_entry_pool.getNoOfFree() == 0)
+ {
+ jam();
+ Page_sublist& pl_idle = *m_page_sublist[Page_entry::SL_IDLE];
+ Ptr<Page_entry> idle_ptr;
+ if (pl_idle.first(idle_ptr))
+ {
+ jam();
+
+#ifdef VM_TRACE
+ debugOut << "PGMAN: get_page_entry: re-use idle entry" << endl;
+ debugOut << "PGMAN: " << idle_ptr << endl;
+#endif
+
+ Page_state state = idle_ptr.p->m_state;
+ ndbrequire(state == Page_entry::ONSTACK);
+
+ Page_stack& pl_stack = m_page_stack;
+ ndbrequire(pl_stack.hasPrev(idle_ptr));
+ pl_stack.remove(idle_ptr);
+ state &= ~ Page_entry::ONSTACK;
+ set_page_state(idle_ptr, state);
+ ndbrequire(idle_ptr.p->m_state == 0);
+
+ release_page_entry(idle_ptr);
+ }
+ }
+
if (seize_page_entry(ptr, file_no, page_no))
{
+ jam();
ndbrequire(ptr.p->m_state == 0);
m_stats.m_page_faults++;
+
+#ifdef VM_TRACE
+ debugOut << "PGMAN: get_page_entry: seize" << endl;
+ debugOut << "PGMAN: " << ptr << endl;
+#endif
return true;
}
@@ -624,6 +668,7 @@ Pgman::lirs_reference(Ptr<Page_entry> ptr)
jam();
move_cleanup_ptr(ptr);
pl_queue.remove(ptr);
+ state &= ~ Page_entry::ONQUEUE;
}
if (state & Page_entry::BOUND)
{
@@ -649,11 +694,24 @@ Pgman::lirs_reference(Ptr<Page_entry> ptr)
if (state & Page_entry::ONSTACK)
{
jam();
+ bool at_bottom = ! pl_stack.hasPrev(ptr);
pl_stack.remove(ptr);
+ if (at_bottom)
+ {
+ jam();
+ ndbassert(state & Page_entry::HOT);
+ lirs_stack_prune();
+ }
}
pl_stack.add(ptr);
state |= Page_entry::ONSTACK;
state |= Page_entry::HOT;
+ // it could be on queue already
+ if (state & Page_entry::ONQUEUE) {
+ jam();
+ pl_queue.remove(ptr);
+ state &= ~Page_entry::ONQUEUE;
+ }
}
set_page_state(ptr, state);
@@ -902,9 +960,11 @@ Pgman::process_map(Signal* signal)
#ifdef VM_TRACE
debugOut << "PGMAN: >process_map" << endl;
#endif
- int max_count = m_param.m_max_io_waits - m_stats.m_current_io_waits;
- if (max_count > 0)
+ int max_count = 0;
+ if (m_param.m_max_io_waits > m_stats.m_current_io_waits) {
+ max_count = m_param.m_max_io_waits - m_stats.m_current_io_waits;
max_count = max_count / 2 + 1;
+ }
Page_sublist& pl_map = *m_page_sublist[Page_entry::SL_MAP];
while (! pl_map.isEmpty() && --max_count >= 0)
@@ -1056,15 +1116,10 @@ Pgman::process_cleanup(Signal* signal)
}
int max_loop_count = m_param.m_max_loop_count;
- int max_count = m_param.m_max_io_waits - m_stats.m_current_io_waits;
-
- if (max_count > 0)
- {
+ int max_count = 0;
+ if (m_param.m_max_io_waits > m_stats.m_current_io_waits) {
+ max_count = m_param.m_max_io_waits - m_stats.m_current_io_waits;
max_count = max_count / 2 + 1;
- /*
- * Possibly add code here to avoid writing too rapidly. May be
- * unnecessary since only cold pages are cleaned.
- */
}
Ptr<Page_entry> ptr = m_cleanup_ptr;
@@ -1166,9 +1221,12 @@ bool
Pgman::process_lcp(Signal* signal)
{
Page_hashlist& pl_hash = m_page_hashlist;
- int max_count = m_param.m_max_io_waits - m_stats.m_current_io_waits;
- if (max_count > 0)
+
+ int max_count = 0;
+ if (m_param.m_max_io_waits > m_stats.m_current_io_waits) {
+ max_count = m_param.m_max_io_waits - m_stats.m_current_io_waits;
max_count = max_count / 2 + 1;
+ }
#ifdef VM_TRACE
debugOut
@@ -1559,6 +1617,7 @@ Pgman::execFSWRITEREF(Signal* signal)
int
Pgman::get_page(Signal* signal, Ptr<Page_entry> ptr, Page_request page_req)
{
+ jamEntry();
#ifdef VM_TRACE
Ptr<Page_request> tmp = { &page_req, RNIL};
debugOut << "PGMAN: >get_page" << endl;
@@ -1706,6 +1765,7 @@ Pgman::get_page(Signal* signal, Ptr<Page_entry> ptr, Page_request page_req)
void
Pgman::update_lsn(Ptr<Page_entry> ptr, Uint32 block, Uint64 lsn)
{
+ jamEntry();
#ifdef VM_TRACE
const char* bname = getBlockName(block, "?");
debugOut << "PGMAN: >update_lsn: block=" << bname << " lsn=" << lsn << endl;
@@ -1816,6 +1876,11 @@ Pgman::free_data_file(Uint32 file_no, Uint32 fd)
int
Pgman::drop_page(Ptr<Page_entry> ptr)
{
+#ifdef VM_TRACE
+ debugOut << "PGMAN: drop_page" << endl;
+ debugOut << "PGMAN: " << ptr << endl;
+#endif
+
Page_stack& pl_stack = m_page_stack;
Page_queue& pl_queue = m_page_queue;
@@ -1828,8 +1893,15 @@ Pgman::drop_page(Ptr<Page_entry> ptr)
if (state & Page_entry::ONSTACK)
{
jam();
+ bool at_bottom = ! pl_stack.hasPrev(ptr);
pl_stack.remove(ptr);
state &= ~ Page_entry::ONSTACK;
+ if (at_bottom)
+ {
+ jam();
+ ndbassert(state & Page_entry::HOT);
+ lirs_stack_prune();
+ }
}
if (state & Page_entry::ONQUEUE)
@@ -1839,6 +1911,7 @@ Pgman::drop_page(Ptr<Page_entry> ptr)
state &= ~ Page_entry::ONQUEUE;
}
+ ndbassert(ptr.p->m_real_page_i != RNIL);
if (ptr.p->m_real_page_i != RNIL)
{
jam();
@@ -1925,6 +1998,8 @@ Pgman::verify_page_entry(Ptr<Page_entry> ptr)
break;
case Page_entry::SL_LOCKED:
break;
+ case Page_entry::SL_IDLE:
+ break;
case Page_entry::SL_OTHER:
break;
default:
@@ -1971,8 +2046,11 @@ Pgman::verify_page_lists()
ndbrequire(stack_count == pl_stack.count() || dump_page_lists());
ndbrequire(queue_count == pl_queue.count() || dump_page_lists());
+ Uint32 hot_count = 0;
Uint32 hot_bound_count = 0;
Uint32 cold_bound_count = 0;
+ Uint32 stack_request_count = 0;
+ Uint32 queue_request_count = 0;
Uint32 i1 = RNIL;
for (pl_stack.first(ptr); ptr.i != RNIL; pl_stack.next(ptr))
@@ -1983,9 +2061,13 @@ Pgman::verify_page_lists()
ndbrequire(state & Page_entry::ONSTACK || dump_page_lists());
if (! pl_stack.hasPrev(ptr))
ndbrequire(state & Page_entry::HOT || dump_page_lists());
- if (state & Page_entry::HOT &&
- state & Page_entry::BOUND)
- hot_bound_count++;
+ if (state & Page_entry::HOT) {
+ hot_count++;
+ if (state & Page_entry::BOUND)
+ hot_bound_count++;
+ }
+ if (state & Page_entry::REQUEST)
+ stack_request_count++;
}
Uint32 i2 = RNIL;
@@ -1997,6 +2079,8 @@ Pgman::verify_page_lists()
ndbrequire(state & Page_entry::ONQUEUE || dump_page_lists());
ndbrequire(state & Page_entry::BOUND || dump_page_lists());
cold_bound_count++;
+ if (state & Page_entry::REQUEST)
+ queue_request_count++;
}
Uint32 tot_bound_count =
@@ -2029,7 +2113,11 @@ Pgman::verify_page_lists()
<< " cache:" << m_stats.m_num_pages
<< "(" << locked_bound_count << "L)"
<< " stack:" << pl_stack.count()
+ << " hot:" << hot_count
+ << " hot_bound:" << hot_bound_count
+ << " stack_request:" << stack_request_count
<< " queue:" << pl_queue.count()
+ << " queue_request:" << queue_request_count
<< " queuewait:" << queuewait_count << endl;
debugOut << "PGMAN:";
@@ -2137,6 +2225,8 @@ Pgman::get_sublist_name(Uint32 list_no)
return "busy";
case Page_entry::SL_LOCKED:
return "locked";
+ case Page_entry::SL_IDLE:
+ return "idle";
case Page_entry::SL_OTHER:
return "other";
}
@@ -2227,6 +2317,13 @@ operator<<(NdbOut& out, Ptr<Pgman::Page_entry> ptr)
out << " busy_count=" << dec << pe.m_busy_count;
#ifdef VM_TRACE
{
+ Pgman::Page_stack& pl_stack = pe.m_this->m_page_stack;
+ if (! pl_stack.hasNext(ptr))
+ out << " top";
+ if (! pl_stack.hasPrev(ptr))
+ out << " bottom";
+ }
+ {
Pgman::Local_page_request_list
req_list(ptr.p->m_this->m_page_request_pool, ptr.p->m_requests);
if (! req_list.isEmpty())
diff --git a/storage/ndb/src/kernel/blocks/pgman.hpp b/storage/ndb/src/kernel/blocks/pgman.hpp
index 07029d1c3e5..e3bf0fa5780 100644
--- a/storage/ndb/src/kernel/blocks/pgman.hpp
+++ b/storage/ndb/src/kernel/blocks/pgman.hpp
@@ -325,8 +325,9 @@ private:
,SL_CALLBACK_IO = 4
,SL_BUSY = 5
,SL_LOCKED = 6
- ,SL_OTHER = 7
- ,SUBLIST_COUNT = 8
+ ,SL_IDLE = 7
+ ,SL_OTHER = 8
+ ,SUBLIST_COUNT = 9
};
Uint16 m_file_no; // disk page address set at seize
@@ -401,6 +402,7 @@ private:
struct Param {
Param();
Uint32 m_max_pages; // max number of cache pages
+ Uint32 m_lirs_stack_mult; // in m_max_pages (around 3-10)
Uint32 m_max_hot_pages; // max hot cache pages (up to 99%)
Uint32 m_max_loop_count; // limit purely local loops
Uint32 m_max_io_waits;
diff --git a/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp b/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
index 4b4fba01889..1fba4d62e17 100644
--- a/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
+++ b/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
@@ -2793,7 +2793,7 @@ void Qmgr::execAPI_REGREQ(Signal* signal)
"incompatible with %s",
type == NodeInfo::API ? "api or mysqld" : "management server",
apiNodePtr.i,
- getVersionString(version,"",buf,sizeof(buf)),
+ ndbGetVersionString(version,"",buf,sizeof(buf)),
NDB_VERSION_STRING);
apiNodePtr.p->phase = ZAPI_INACTIVE;
sendApiRegRef(signal, ref, ApiRegRef::UnsupportedVersion);
@@ -3052,7 +3052,7 @@ void Qmgr::failReportLab(Signal* signal, Uint16 aFailedNode,
if (failedNodePtr.i == getOwnNodeId()) {
jam();
- Uint32 code = 0;
+ Uint32 code = NDBD_EXIT_NODE_DECLARED_DEAD;
const char * msg = 0;
char extra[100];
switch(aFailCause){
diff --git a/storage/ndb/src/kernel/blocks/restore.cpp b/storage/ndb/src/kernel/blocks/restore.cpp
index d4a2414ef2f..efc4bc1948a 100644
--- a/storage/ndb/src/kernel/blocks/restore.cpp
+++ b/storage/ndb/src/kernel/blocks/restore.cpp
@@ -557,6 +557,9 @@ Restore::restore_next(Signal* signal, FilePtr file_ptr)
case BackupFormat::GCP_ENTRY:
parse_gcp_entry(signal, file_ptr, data, len);
break;
+ case BackupFormat::EMPTY_ENTRY:
+ // skip
+ break;
case 0x4e444242: // 'NDBB'
if (check_file_version(signal, ntohl(* (data+2))) == 0)
{
@@ -1268,7 +1271,7 @@ Restore::check_file_version(Signal* signal, Uint32 file_version)
{
char buf[255];
char verbuf[255];
- getVersionString(file_version, 0, verbuf, sizeof(verbuf));
+ ndbGetVersionString(file_version, 0, verbuf, sizeof(verbuf));
BaseString::snprintf(buf, sizeof(buf),
"Unsupported version of LCP files found on disk, "
" found: %s", verbuf);
diff --git a/storage/ndb/src/kernel/blocks/tsman.cpp b/storage/ndb/src/kernel/blocks/tsman.cpp
index 62aa80a67fe..8f61ec0cf7b 100644
--- a/storage/ndb/src/kernel/blocks/tsman.cpp
+++ b/storage/ndb/src/kernel/blocks/tsman.cpp
@@ -1309,6 +1309,12 @@ Tsman::execDROP_FILE_REQ(Signal* signal)
Local_datafile_list free(m_file_pool, fg_ptr.p->m_free_files);
free.remove(file_ptr);
}
+ else if(find_file_by_id(file_ptr, fg_ptr.p->m_meta_files, req.file_id))
+ {
+ jam();
+ Local_datafile_list meta(m_file_pool, fg_ptr.p->m_meta_files);
+ meta.remove(file_ptr);
+ }
else
{
errorCode = DropFileImplRef::NoSuchFile;
diff --git a/storage/ndb/src/kernel/error/ndbd_exit_codes.c b/storage/ndb/src/kernel/error/ndbd_exit_codes.c
index 9987f9e0ecb..b36ea3af8ee 100644
--- a/storage/ndb/src/kernel/error/ndbd_exit_codes.c
+++ b/storage/ndb/src/kernel/error/ndbd_exit_codes.c
@@ -57,6 +57,8 @@ static const ErrStruct errArray[] =
"error(s) on other node(s)"},
{NDBD_EXIT_PARTITIONED_SHUTDOWN, XAE, "Partitioned cluster detected. "
"Please check if cluster is already running"},
+ {NDBD_EXIT_NODE_DECLARED_DEAD, XAE,
+ "Node declared dead. See error log for details"},
{NDBD_EXIT_POINTER_NOTINRANGE, XIE, "Pointer too large"},
{NDBD_EXIT_SR_OTHERNODEFAILED, XRE, "Another node failed during system "
"restart, please investigate error(s) on other node(s)"},
diff --git a/storage/ndb/src/kernel/vm/Configuration.cpp b/storage/ndb/src/kernel/vm/Configuration.cpp
index e0b485eda59..72770d35cde 100644
--- a/storage/ndb/src/kernel/vm/Configuration.cpp
+++ b/storage/ndb/src/kernel/vm/Configuration.cpp
@@ -74,35 +74,35 @@ static struct my_option my_long_options[] =
{ "initial", OPT_INITIAL,
"Perform initial start of ndbd, including cleaning the file system. "
"Consult documentation before using this",
- (gptr*) &_initial, (gptr*) &_initial, 0,
+ (uchar**) &_initial, (uchar**) &_initial, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "nostart", 'n',
"Don't start ndbd immediately. Ndbd will await command from ndb_mgmd",
- (gptr*) &_no_start, (gptr*) &_no_start, 0,
+ (uchar**) &_no_start, (uchar**) &_no_start, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "daemon", 'd', "Start ndbd as daemon (default)",
- (gptr*) &_daemon, (gptr*) &_daemon, 0,
+ (uchar**) &_daemon, (uchar**) &_daemon, 0,
GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0 },
{ "nodaemon", OPT_NODAEMON,
"Do not start ndbd as daemon, provided for testing purposes",
- (gptr*) &_no_daemon, (gptr*) &_no_daemon, 0,
+ (uchar**) &_no_daemon, (uchar**) &_no_daemon, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "foreground", OPT_FOREGROUND,
"Run real ndbd in foreground, provided for debugging purposes"
" (implies --nodaemon)",
- (gptr*) &_foreground, (gptr*) &_foreground, 0,
+ (uchar**) &_foreground, (uchar**) &_foreground, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "nowait-nodes", OPT_NOWAIT_NODES,
"Nodes that will not be waited for during start",
- (gptr*) &_nowait_nodes, (gptr*) &_nowait_nodes, 0,
+ (uchar**) &_nowait_nodes, (uchar**) &_nowait_nodes, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "initial-start", OPT_INITIAL_START,
"Perform initial start",
- (gptr*) &_initialstart, (gptr*) &_initialstart, 0,
+ (uchar**) &_initialstart, (uchar**) &_initialstart, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "bind-address", OPT_NOWAIT_NODES,
"Local bind address",
- (gptr*) &_bind_address, (gptr*) &_bind_address, 0,
+ (uchar**) &_bind_address, (uchar**) &_bind_address, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -443,6 +443,11 @@ Configuration::setupConfiguration(){
"TimeBetweenWatchDogCheck missing");
}
+ if(iter.get(CFG_DB_WATCHDOG_INTERVAL_INITIAL, &_timeBetweenWatchDogCheckInitial)){
+ ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, "Invalid configuration fetched",
+ "TimeBetweenWatchDogCheckInitial missing");
+ }
+
/**
* Get paths
*/
@@ -462,9 +467,12 @@ Configuration::setupConfiguration(){
* Create the watch dog thread
*/
{
- Uint32 t = _timeBetweenWatchDogCheck;
+ if (_timeBetweenWatchDogCheckInitial < _timeBetweenWatchDogCheck)
+ _timeBetweenWatchDogCheckInitial = _timeBetweenWatchDogCheck;
+
+ Uint32 t = _timeBetweenWatchDogCheckInitial;
t = globalEmulatorData.theWatchDog ->setCheckInterval(t);
- _timeBetweenWatchDogCheck = t;
+ _timeBetweenWatchDogCheckInitial = t;
}
ConfigValues* cf = ConfigValuesFactory::extractCurrentSection(iter.m_config);
diff --git a/storage/ndb/src/kernel/vm/Configuration.hpp b/storage/ndb/src/kernel/vm/Configuration.hpp
index 934261e40af..918a889a171 100644
--- a/storage/ndb/src/kernel/vm/Configuration.hpp
+++ b/storage/ndb/src/kernel/vm/Configuration.hpp
@@ -84,6 +84,7 @@ private:
Uint32 _maxErrorLogs;
Uint32 _lockPagesInMainMemory;
Uint32 _timeBetweenWatchDogCheck;
+ Uint32 _timeBetweenWatchDogCheckInitial;
ndb_mgm_configuration * m_ownConfig;
ndb_mgm_configuration * m_clusterConfig;
diff --git a/storage/ndb/src/kernel/vm/DynArr256.cpp b/storage/ndb/src/kernel/vm/DynArr256.cpp
index ff3e7578c6c..4e73bb8830b 100644
--- a/storage/ndb/src/kernel/vm/DynArr256.cpp
+++ b/storage/ndb/src/kernel/vm/DynArr256.cpp
@@ -344,18 +344,27 @@ err:
void
DynArr256::init(ReleaseIterator &iter)
{
- iter.m_sz = 0;
+ iter.m_sz = 1;
iter.m_pos = 0;
- iter.m_ptr_i[0] = m_head.m_ptr_i;
- iter.m_ptr_i[1] = RNIL;
+ iter.m_ptr_i[0] = RNIL;
+ iter.m_ptr_i[1] = m_head.m_ptr_i;
iter.m_ptr_i[2] = RNIL;
iter.m_ptr_i[3] = RNIL;
+ iter.m_ptr_i[4] = RNIL;
}
-bool
-DynArr256::release(ReleaseIterator &iter)
+/**
+ * Iter is in next pos
+ *
+ * 0 - done
+ * 1 - data
+ * 2 - no data
+ */
+Uint32
+DynArr256::release(ReleaseIterator &iter, Uint32 * retptr)
{
- Uint32 ptrI = iter.m_ptr_i[iter.m_sz];
+ Uint32 sz = iter.m_sz;
+ Uint32 ptrI = iter.m_ptr_i[sz];
Uint32 page_no = ptrI >> DA256_BITS;
Uint32 page_idx = ptrI & DA256_MASK;
Uint32 type_id = (~m_pool.m_type_id) & 0xFFFF;
@@ -364,9 +373,8 @@ DynArr256::release(ReleaseIterator &iter)
if (ptrI != RNIL)
{
- Uint32 tmp = iter.m_pos & 255;
- Uint32 p0 = tmp;
- for (; p0<256 && p0 < tmp + 16; p0++)
+ Uint32 p0 = iter.m_pos & 255;
+ for (; p0<256; p0++)
{
Uint32 *retVal, *magic_ptr, p;
if (p0 != 255)
@@ -389,55 +397,52 @@ DynArr256::release(ReleaseIterator &iter)
}
Uint32 magic = *magic_ptr;
+ Uint32 val = *retVal;
if (unlikely(! ((magic & (1 << p)) && (magic >> 16) == type_id)))
goto err;
- Uint32 val = * retVal;
- if (val != RNIL)
+ if (sz == m_head.m_sz)
{
- if (iter.m_sz + 2 == m_head.m_sz)
+ * retptr = val;
+ p0++;
+ if (p0 != 256)
{
- * retVal = RNIL;
- m_pool.release(val);
- iter.m_pos = (iter.m_pos & ~255) + p0;
- return false;
+ /**
+ * Move next
+ */
+ iter.m_pos &= ~(Uint32)255;
+ iter.m_pos |= p0;
}
else
{
- * retVal = RNIL;
- iter.m_sz++;
- iter.m_ptr_i[iter.m_sz] = val;
- iter.m_pos = (p0 << 8);
- return false;
+ /**
+ * Move up
+ */
+ m_pool.release(ptrI);
+ iter.m_sz --;
+ iter.m_pos >>= 8;
}
+ return 1;
+ }
+ else if (val != RNIL)
+ {
+ iter.m_sz++;
+ iter.m_ptr_i[iter.m_sz] = val;
+ iter.m_pos = (p0 << 8);
+ * retVal = RNIL;
+ return 2;
}
}
- if (p0 == 256)
- {
- if (iter.m_sz == 0)
- goto done;
- iter.m_sz--;
- iter.m_pos >>= 8;
-
- m_pool.release(ptrI);
- return false;
- }
- else
- {
- iter.m_pos = (iter.m_pos & ~255) + p0;
- return false;
- }
- }
-
-done:
- if (m_head.m_ptr_i != RNIL)
- {
- m_pool.release(m_head.m_ptr_i);
+ assert(p0 == 256);
+ m_pool.release(ptrI);
+ iter.m_sz --;
+ iter.m_pos >>= 8;
+ return 2;
}
new (&m_head) Head();
- return true;
+ return 0;
err:
require(false);
@@ -638,6 +643,7 @@ static
void
simple(DynArr256 & arr, int argc, char* argv[])
{
+ ndbout_c("argc: %d", argc);
for (Uint32 i = 1; i<(Uint32)argc; i++)
{
Uint32 * s = arr.set(atoi(argv[i]));
@@ -865,7 +871,8 @@ write(DynArr256& arr, int argc, char ** argv)
ndbout_c("Elapsed %lldus -> %f us/set", start, uspg);
DynArr256::ReleaseIterator iter;
arr.init(iter);
- while(!arr.release(iter));
+ Uint32 val;
+ while(arr.release(iter, &val));
}
}
@@ -902,7 +909,7 @@ main(int argc, char** argv)
DynArr256::Head head;
DynArr256 arr(pool, head);
- if (strcmp(argv[1], "--args") == 0)
+ if (strcmp(argv[1], "--simple") == 0)
simple(arr, argc, argv);
else if (strcmp(argv[1], "--basic") == 0)
basic(arr, argc, argv);
@@ -913,8 +920,8 @@ main(int argc, char** argv)
DynArr256::ReleaseIterator iter;
arr.init(iter);
- Uint32 cnt = 0;
- while (!arr.release(iter)) cnt++;
+ Uint32 cnt = 0, val;
+ while (arr.release(iter, &val)) cnt++;
ndbout_c("allocatedpages: %d allocatednodes: %d releasednodes: %d"
" releasecnt: %d",
diff --git a/storage/ndb/src/kernel/vm/DynArr256.hpp b/storage/ndb/src/kernel/vm/DynArr256.hpp
index 31329add1a2..780dee7e4bf 100644
--- a/storage/ndb/src/kernel/vm/DynArr256.hpp
+++ b/storage/ndb/src/kernel/vm/DynArr256.hpp
@@ -49,6 +49,8 @@ public:
Uint32 m_ptr_i;
Uint32 m_sz;
+
+ bool isEmpty() const { return m_sz == 0;}
};
DynArr256(DynArr256Pool & pool, Head& head) :
@@ -61,12 +63,16 @@ public:
{
Uint32 m_sz;
Uint32 m_pos;
- Uint32 m_ptr_i[4];
+ Uint32 m_ptr_i[5];
};
void init(ReleaseIterator&);
- bool release(ReleaseIterator&);
-
+ /**
+ * return 0 - done
+ * 1 - data (in retptr)
+ * 2 - nodata
+ */
+ Uint32 release(ReleaseIterator&, Uint32* retptr);
protected:
Head & m_head;
DynArr256Pool & m_pool;
diff --git a/storage/ndb/src/kernel/vm/RWPool.cpp b/storage/ndb/src/kernel/vm/RWPool.cpp
index 192a8f87402..056b2149e2a 100644
--- a/storage/ndb/src/kernel/vm/RWPool.cpp
+++ b/storage/ndb/src/kernel/vm/RWPool.cpp
@@ -140,7 +140,7 @@ RWPool::release(Ptr<void> ptr)
Uint32 ff = page->m_first_free;
* (record_ptr + m_record_info.m_offset_next_pool) = ff;
- page->m_first_free = ptr.i;
+ page->m_first_free = ptr.i & POOL_RECORD_MASK;
page->m_ref_count = ref_cnt - 1;
if (ff == REC_NIL)
diff --git a/storage/ndb/src/kernel/vm/SimulatedBlock.cpp b/storage/ndb/src/kernel/vm/SimulatedBlock.cpp
index 3125fc33258..bc16b9f364e 100644
--- a/storage/ndb/src/kernel/vm/SimulatedBlock.cpp
+++ b/storage/ndb/src/kernel/vm/SimulatedBlock.cpp
@@ -19,6 +19,7 @@
#include <NdbOut.hpp>
#include <GlobalData.hpp>
#include <Emulator.hpp>
+#include <WatchDog.hpp>
#include <ErrorHandlingMacros.hpp>
#include <TimeQueue.hpp>
#include <TransporterRegistry.hpp>
@@ -38,6 +39,9 @@
#include <AttributeDescriptor.hpp>
#include <NdbSqlUtil.hpp>
+#include <EventLogger.hpp>
+extern EventLogger g_eventLogger;
+
#define ljamEntry() jamEntryLine(30000 + __LINE__)
#define ljam() jamLine(30000 + __LINE__)
@@ -655,14 +659,20 @@ SimulatedBlock::getBatSize(Uint16 blockNo){
return sb->theBATSize;
}
+void* SimulatedBlock::allocRecord(const char * type, size_t s, size_t n, bool clear, Uint32 paramId)
+{
+ return allocRecordAligned(type, s, n, 0, 0, clear, paramId);
+}
+
void*
-SimulatedBlock::allocRecord(const char * type, size_t s, size_t n, bool clear, Uint32 paramId)
+SimulatedBlock::allocRecordAligned(const char * type, size_t s, size_t n, void **unaligned_buffer, Uint32 align, bool clear, Uint32 paramId)
{
void * p = NULL;
- size_t size = n*s;
- Uint64 real_size = (Uint64)((Uint64)n)*((Uint64)s);
- refresh_watch_dog();
+ Uint32 over_alloc = unaligned_buffer ? (align - 1) : 0;
+ size_t size = n*s + over_alloc;
+ Uint64 real_size = (Uint64)((Uint64)n)*((Uint64)s) + over_alloc;
+ refresh_watch_dog(9);
if (real_size > 0){
#ifdef VM_TRACE_MEM
ndbout_c("%s::allocRecord(%s, %u, %u) = %llu bytes",
@@ -696,14 +706,24 @@ SimulatedBlock::allocRecord(const char * type, size_t s, size_t n, bool clear, U
char * ptr = (char*)p;
const Uint32 chunk = 128 * 1024;
while(size > chunk){
- refresh_watch_dog();
+ refresh_watch_dog(9);
memset(ptr, 0, chunk);
ptr += chunk;
size -= chunk;
}
- refresh_watch_dog();
+ refresh_watch_dog(9);
memset(ptr, 0, size);
}
+ if (unaligned_buffer)
+ {
+ *unaligned_buffer = p;
+ p = (void *)(((UintPtr)p + over_alloc) & ~(UintPtr)(over_alloc));
+#ifdef VM_TRACE
+ g_eventLogger.info("'%s' (%u) %llu %llu, alignment correction %u bytes",
+ type, align, (Uint64)p, (Uint64)p+n*s,
+ (Uint32)((UintPtr)p - (UintPtr)*unaligned_buffer));
+#endif
+ }
}
return p;
}
@@ -720,9 +740,16 @@ SimulatedBlock::deallocRecord(void ** ptr,
}
void
-SimulatedBlock::refresh_watch_dog()
+SimulatedBlock::refresh_watch_dog(Uint32 place)
+{
+ globalData.incrementWatchDogCounter(place);
+}
+
+void
+SimulatedBlock::update_watch_dog_timer(Uint32 interval)
{
- globalData.incrementWatchDogCounter(1);
+ extern EmulatorData globalEmulatorData;
+ globalEmulatorData.theWatchDog->setCheckInterval(interval);
}
void
@@ -1631,6 +1658,11 @@ SimulatedBlock::sendFragmentedSignal(NodeReceiverGroup rg,
}
SimulatedBlock::Callback SimulatedBlock::TheEmptyCallback = {0, 0};
+void
+SimulatedBlock::TheNULLCallbackFunction(class Signal*, Uint32, Uint32)
+{ abort(); /* should never be called */ }
+SimulatedBlock::Callback SimulatedBlock::TheNULLCallback =
+{ &SimulatedBlock::TheNULLCallbackFunction, 0 };
void
SimulatedBlock::sendFragmentedSignal(BlockReference ref,
diff --git a/storage/ndb/src/kernel/vm/SimulatedBlock.hpp b/storage/ndb/src/kernel/vm/SimulatedBlock.hpp
index 37a8dde5956..31f219718e5 100644
--- a/storage/ndb/src/kernel/vm/SimulatedBlock.hpp
+++ b/storage/ndb/src/kernel/vm/SimulatedBlock.hpp
@@ -18,7 +18,7 @@
#include <NdbTick.h>
#include <kernel_types.h>
-#include <ndb_version.h>
+#include <util/version.h>
#include <ndb_limits.h>
#include "VMSignal.hpp"
@@ -131,6 +131,8 @@ public:
virtual const char* get_filename(Uint32 fd) const { return "";}
protected:
static Callback TheEmptyCallback;
+ void TheNULLCallbackFunction(class Signal*, Uint32, Uint32);
+ static Callback TheNULLCallback;
void execute(Signal* signal, Callback & c, Uint32 returnCode);
@@ -334,7 +336,8 @@ protected:
* Refresh Watch Dog in initialising code
*
*/
- void refresh_watch_dog();
+ void refresh_watch_dog(Uint32 place = 1);
+ void update_watch_dog_timer(Uint32 interval);
/**
* Prog error
@@ -377,6 +380,7 @@ protected:
*
*/
void* allocRecord(const char * type, size_t s, size_t n, bool clear = true, Uint32 paramId = 0);
+ void* allocRecordAligned(const char * type, size_t s, size_t n, void **unaligned_buffer, Uint32 align = NDB_O_DIRECT_WRITE_ALIGNMENT, bool clear = true, Uint32 paramId = 0);
/**
* Deallocate record
@@ -597,6 +601,8 @@ inline
void
SimulatedBlock::execute(Signal* signal, Callback & c, Uint32 returnCode){
CallbackFunction fun = c.m_callbackFunction;
+ if (fun == TheNULLCallback.m_callbackFunction)
+ return;
ndbrequire(fun != 0);
c.m_callbackFunction = NULL;
(this->*fun)(signal, c.m_callbackData, returnCode);
diff --git a/storage/ndb/src/kernel/vm/WatchDog.cpp b/storage/ndb/src/kernel/vm/WatchDog.cpp
index d1abb709b1e..a7f5e8f5c2b 100644
--- a/storage/ndb/src/kernel/vm/WatchDog.cpp
+++ b/storage/ndb/src/kernel/vm/WatchDog.cpp
@@ -16,6 +16,7 @@
#include <ndb_global.h>
#include <my_pthread.h>
+#include <sys/times.h>
#include "WatchDog.hpp"
#include "GlobalData.hpp"
@@ -24,6 +25,8 @@
#include <ErrorHandlingMacros.hpp>
#include <EventLogger.hpp>
+#include <NdbTick.h>
+
extern EventLogger g_eventLogger;
extern "C"
@@ -71,66 +74,115 @@ WatchDog::doStop(){
}
}
+const char *get_action(Uint32 IPValue)
+{
+ const char *action;
+ switch (IPValue) {
+ case 1:
+ action = "Job Handling";
+ break;
+ case 2:
+ action = "Scanning Timers";
+ break;
+ case 3:
+ action = "External I/O";
+ break;
+ case 4:
+ action = "Print Job Buffers at crash";
+ break;
+ case 5:
+ action = "Checking connections";
+ break;
+ case 6:
+ action = "Performing Send";
+ break;
+ case 7:
+ action = "Polling for Receive";
+ break;
+ case 8:
+ action = "Performing Receive";
+ break;
+ case 9:
+ action = "Allocating memory";
+ break;
+ default:
+ action = "Unknown place";
+ break;
+ }//switch
+ return action;
+}
+
void
-WatchDog::run(){
- unsigned int anIPValue;
- unsigned int alerts = 0;
+WatchDog::run()
+{
+ unsigned int anIPValue, sleep_time;
unsigned int oldIPValue = 0;
-
+ unsigned int theIntervalCheck = theInterval;
+ struct MicroSecondTimer start_time, last_time, now;
+ NdbTick_getMicroTimer(&start_time);
+ last_time = start_time;
+
// WatchDog for the single threaded NDB
- while(!theStop){
- Uint32 tmp = theInterval / 500;
- tmp= (tmp ? tmp : 1);
-
- while(!theStop && tmp > 0){
- NdbSleep_MilliSleep(500);
- tmp--;
- }
-
+ while (!theStop)
+ {
+ sleep_time= 100;
+
+ NdbSleep_MilliSleep(sleep_time);
if(theStop)
break;
+ NdbTick_getMicroTimer(&now);
+ if (NdbTick_getMicrosPassed(last_time, now)/1000 > sleep_time*2)
+ {
+ struct tms my_tms;
+ times(&my_tms);
+ g_eventLogger.info("Watchdog: User time: %llu System time: %llu",
+ (Uint64)my_tms.tms_utime,
+ (Uint64)my_tms.tms_stime);
+ g_eventLogger.warning("Watchdog: Warning overslept %u ms, expected %u ms.",
+ NdbTick_getMicrosPassed(last_time, now)/1000,
+ sleep_time);
+ }
+ last_time = now;
+
// Verify that the IP thread is not stuck in a loop
anIPValue = *theIPValue;
- if(anIPValue != 0) {
+ if (anIPValue != 0)
+ {
oldIPValue = anIPValue;
globalData.incrementWatchDogCounter(0);
- alerts = 0;
- } else {
- const char *last_stuck_action;
- alerts++;
- switch (oldIPValue) {
- case 1:
- last_stuck_action = "Job Handling";
- break;
- case 2:
- last_stuck_action = "Scanning Timers";
- break;
- case 3:
- last_stuck_action = "External I/O";
- break;
- case 4:
- last_stuck_action = "Print Job Buffers at crash";
- break;
- case 5:
- last_stuck_action = "Checking connections";
- break;
- case 6:
- last_stuck_action = "Performing Send";
- break;
- case 7:
- last_stuck_action = "Polling for Receive";
- break;
- case 8:
- last_stuck_action = "Performing Receive";
- break;
- default:
- last_stuck_action = "Unknown place";
- break;
- }//switch
- g_eventLogger.warning("Ndb kernel is stuck in: %s", last_stuck_action);
- if(alerts == 3){
- shutdownSystem(last_stuck_action);
+ NdbTick_getMicroTimer(&start_time);
+ theIntervalCheck = theInterval;
+ }
+ else
+ {
+ int warn = 1;
+ Uint32 elapsed = NdbTick_getMicrosPassed(start_time, now)/1000;
+ /*
+ oldIPValue == 9 indicates malloc going on, this can take some time
+ so only warn if we pass the watchdog interval
+ */
+ if (oldIPValue == 9)
+ if (elapsed < theIntervalCheck)
+ warn = 0;
+ else
+ theIntervalCheck += theInterval;
+
+ if (warn)
+ {
+ const char *last_stuck_action = get_action(oldIPValue);
+ g_eventLogger.warning("Ndb kernel is stuck in: %s", last_stuck_action);
+ {
+ struct tms my_tms;
+ times(&my_tms);
+ g_eventLogger.info("Watchdog: User time: %llu System time: %llu",
+ (Uint64)my_tms.tms_utime,
+ (Uint64)my_tms.tms_stime);
+ }
+ if (elapsed > 3 * theInterval)
+ {
+ shutdownSystem(last_stuck_action);
+ }
}
}
}
diff --git a/storage/ndb/src/mgmapi/mgmapi.cpp b/storage/ndb/src/mgmapi/mgmapi.cpp
index e7dc1d1d503..662e5c22f48 100644
--- a/storage/ndb/src/mgmapi/mgmapi.cpp
+++ b/storage/ndb/src/mgmapi/mgmapi.cpp
@@ -408,7 +408,7 @@ ndb_mgm_call(NdbMgmHandle handle, const ParserRow<ParserDummy> *command_reply,
}
else
{
- CHECK_TIMEDOUT_RET(handle, in, out, NULL);
+ DBUG_CHECK_TIMEDOUT_RET(handle, in, out, NULL);
if(ctx.m_status==Parser_t::Eof
|| ctx.m_status==Parser_t::NoLine)
{
@@ -524,7 +524,7 @@ ndb_mgm_connect(NdbMgmHandle handle, int no_retries,
NDB_SOCKET_TYPE sockfd= NDB_INVALID_SOCKET;
Uint32 i;
SocketClient s(0, 0);
- s.set_connect_timeout(handle->timeout);
+ s.set_connect_timeout((handle->timeout+999)/1000);
if (!s.init())
{
fprintf(handle->errstream,
diff --git a/storage/ndb/src/mgmclient/CommandInterpreter.cpp b/storage/ndb/src/mgmclient/CommandInterpreter.cpp
index 93fc3d46e43..875cc2771ae 100644
--- a/storage/ndb/src/mgmclient/CommandInterpreter.cpp
+++ b/storage/ndb/src/mgmclient/CommandInterpreter.cpp
@@ -18,6 +18,7 @@
#include <Vector.hpp>
#include <mgmapi.h>
#include <util/BaseString.hpp>
+#include <ndbd_exit_codes.h>
class MgmtSrvr;
@@ -704,6 +705,133 @@ CommandInterpreter::printError()
}
}
+/*
+ * print log event from mgmsrv to console screen
+ */
+#define make_uint64(a,b) (((Uint64)(a)) + (((Uint64)(b)) << 32))
+#define Q64(a) make_uint64(event->EVENT.a ## _lo, event->EVENT.a ## _hi)
+#define R event->source_nodeid
+#define Q(a) event->EVENT.a
+#define QVERSION getMajor(Q(version)), getMinor(Q(version)), getBuild(Q(version))
+#define NDB_LE_(a) NDB_LE_ ## a
+static void
+printLogEvent(struct ndb_logevent* event)
+{
+ switch (event->type) {
+ /**
+ * NDB_MGM_EVENT_CATEGORY_BACKUP
+ */
+#undef EVENT
+#define EVENT BackupStarted
+ case NDB_LE_BackupStarted:
+ ndbout_c("Node %u: Backup %d started from node %d",
+ R, Q(backup_id), Q(starting_node));
+ break;
+#undef EVENT
+#define EVENT BackupFailedToStart
+ case NDB_LE_BackupFailedToStart:
+ ndbout_c("Node %u: Backup request from %d failed to start. Error: %d",
+ R, Q(starting_node), Q(error));
+ break;
+#undef EVENT
+#define EVENT BackupCompleted
+ case NDB_LE_BackupCompleted:
+ ndbout_c("Node %u: Backup %u started from node %u completed\n"
+ " StartGCP: %u StopGCP: %u\n"
+ " #Records: %u #LogRecords: %u\n"
+ " Data: %u bytes Log: %u bytes", R,
+ Q(backup_id), Q(starting_node),
+ Q(start_gci), Q(stop_gci),
+ Q(n_records), Q(n_log_records),
+ Q(n_bytes), Q(n_log_bytes));
+ break;
+#undef EVENT
+#define EVENT BackupAborted
+ case NDB_LE_BackupAborted:
+ ndbout_c("Node %u: Backup %d started from %d has been aborted. Error: %d",
+ R, Q(backup_id), Q(starting_node), Q(error));
+ break;
+ /**
+ * NDB_MGM_EVENT_CATEGORY_STARTUP
+ */
+#undef EVENT
+#define EVENT NDBStartStarted
+ case NDB_LE_NDBStartStarted:
+ ndbout_c("Node %u: Start initiated (version %d.%d.%d)",
+ R, QVERSION);
+ break;
+#undef EVENT
+#define EVENT NDBStartCompleted
+ case NDB_LE_NDBStartCompleted:
+ ndbout_c("Node %u: Started (version %d.%d.%d)",
+ R, QVERSION);
+ break;
+#undef EVENT
+#define EVENT NDBStopStarted
+ case NDB_LE_NDBStopStarted:
+ ndbout_c("Node %u: %s shutdown initiated", R,
+ (Q(stoptype) == 1 ? "Cluster" : "Node"));
+ break;
+#undef EVENT
+#define EVENT NDBStopCompleted
+ case NDB_LE_NDBStopCompleted:
+ {
+ BaseString action_str("");
+ BaseString signum_str("");
+ getRestartAction(Q(action), action_str);
+ if (Q(signum))
+ signum_str.appfmt(" Initiated by signal %d.",
+ Q(signum));
+ ndbout_c("Node %u: Node shutdown completed%s.%s",
+ R, action_str.c_str(), signum_str.c_str());
+ }
+ break;
+#undef EVENT
+#define EVENT NDBStopForced
+ case NDB_LE_NDBStopForced:
+ {
+ BaseString action_str("");
+ BaseString reason_str("");
+ BaseString sphase_str("");
+ int signum = Q(signum);
+ int error = Q(error);
+ int sphase = Q(sphase);
+ int extra = Q(extra);
+ getRestartAction(Q(action), action_str);
+ if (signum)
+ reason_str.appfmt(" Initiated by signal %d.", signum);
+ if (error)
+ {
+ ndbd_exit_classification cl;
+ ndbd_exit_status st;
+ const char *msg = ndbd_exit_message(error, &cl);
+ const char *cl_msg = ndbd_exit_classification_message(cl, &st);
+ const char *st_msg = ndbd_exit_status_message(st);
+ reason_str.appfmt(" Caused by error %d: \'%s(%s). %s\'.",
+ error, msg, cl_msg, st_msg);
+ if (extra != 0)
+ reason_str.appfmt(" (extra info %d)", extra);
+ }
+ if (sphase < 255)
+ sphase_str.appfmt(" Occured during startphase %u.", sphase);
+ ndbout_c("Node %u: Forced node shutdown completed%s.%s%s",
+ R, action_str.c_str(), sphase_str.c_str(),
+ reason_str.c_str());
+ }
+ break;
+#undef EVENT
+#define EVENT StopAborted
+ case NDB_LE_NDBStopAborted:
+ ndbout_c("Node %u: Node shutdown aborted", R);
+ break;
+ /**
+ * default nothing to print
+ */
+ default:
+ break;
+ }
+}
+
//*****************************************************************************
//*****************************************************************************
@@ -720,30 +848,21 @@ event_thread_run(void* p)
int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_BACKUP,
1, NDB_MGM_EVENT_CATEGORY_STARTUP,
0 };
- int fd = ndb_mgm_listen_event(handle, filter);
- if (fd != NDB_INVALID_SOCKET)
+
+ NdbLogEventHandle log_handle= NULL;
+ struct ndb_logevent log_event;
+
+ log_handle= ndb_mgm_create_logevent_handle(handle, filter);
+ if (log_handle)
{
do_event_thread= 1;
- char *tmp= 0;
- char buf[1024];
do {
- SocketInputStream in(fd,2000);
- if((tmp = in.gets(buf, sizeof(buf))))
- {
- const char ping_token[]= "<PING>";
- if (memcmp(ping_token,tmp,sizeof(ping_token)-1))
- if(tmp && strlen(tmp))
- {
- Guard g(printmutex);
- ndbout << tmp;
- }
- }
- else if(in.timedout() && ndb_mgm_check_connection(handle)<0)
- {
- break;
- }
+ if (ndb_logevent_get_next(log_handle, &log_event, 2000) <= 0)
+ continue;
+ Guard g(printmutex);
+ printLogEvent(&log_event);
} while(do_event_thread);
- NDB_CLOSE_SOCKET(fd);
+ ndb_mgm_destroy_logevent_handle(&log_handle);
}
else
{
@@ -1008,6 +1127,7 @@ CommandInterpreter::execute_impl(const char *_line, bool interactive)
}
else if(strcasecmp(firstToken, "ENTER") == 0 &&
allAfterFirstToken != NULL &&
+ allAfterFirstToken != NULL &&
strncasecmp(allAfterFirstToken, "SINGLE USER MODE ",
sizeof("SINGLE USER MODE") - 1) == 0){
m_error = executeEnterSingleUser(allAfterFirstToken);
@@ -1966,7 +2086,7 @@ CommandInterpreter::executeRestart(Vector<BaseString> &command_list,
return -1;
}
- if (!nostart)
+ if (nostart)
ndbout_c("Shutting down nodes with \"-n, no start\" option, to subsequently start the nodes.");
result= ndb_mgm_restart3(m_mgmsrv, no_of_nodes, node_ids,
@@ -2476,8 +2596,7 @@ CommandInterpreter::executeStartBackup(char* parameters, bool interactive)
{
struct ndb_mgm_reply reply;
unsigned int backupId;
- int fd = -1;
-
+
Vector<BaseString> args;
{
BaseString(parameters).split(args);
@@ -2494,8 +2613,6 @@ CommandInterpreter::executeStartBackup(char* parameters, bool interactive)
if (sz == 2 && args[1] == "NOWAIT")
{
flags = 0;
- result = ndb_mgm_start_backup(m_mgmsrv, 0, &backupId, &reply);
- goto END_BACKUP;
}
else if (sz == 1 || (sz == 3 && args[1] == "WAIT" && args[2] == "COMPLETED"))
{
@@ -2513,62 +2630,74 @@ CommandInterpreter::executeStartBackup(char* parameters, bool interactive)
return -1;
}
- /**
- * If interactive...event listner is already running
- */
+ NdbLogEventHandle log_handle= NULL;
+ struct ndb_logevent log_event;
if (flags == 2 && !interactive)
{
int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_BACKUP, 0, 0 };
- fd = ndb_mgm_listen_event(m_mgmsrv, filter);
- if (fd < 0)
+ log_handle = ndb_mgm_create_logevent_handle(m_mgmsrv, filter);
+ if (!log_handle)
{
ndbout << "Initializing start of backup failed" << endl;
printError();
- return fd;
+ return -1;
}
}
result = ndb_mgm_start_backup(m_mgmsrv, flags, &backupId, &reply);
-END_BACKUP:
if (result != 0) {
ndbout << "Backup failed" << endl;
printError();
- if (fd >= 0)
- close(fd);
+ if (log_handle)
+ ndb_mgm_destroy_logevent_handle(&log_handle);
return result;
}
- if (fd >= 0)
+ /**
+ * If interactive, event listner thread is already running
+ */
+ if (log_handle && !interactive)
{
- char *tmp;
- char buf[1024];
- {
- SocketInputStream in(fd);
- int count = 0;
- do {
- tmp = in.gets(buf, 1024);
- if(tmp)
- {
- ndbout << tmp;
- unsigned int id;
- if(sscanf(tmp, "%*[^:]: Backup %d ", &id) == 1 && id == backupId){
- count++;
- }
- }
- } while(count < 2);
- }
-
- SocketInputStream in(fd, 10);
+ int count = 0;
+ int retry = 0;
do {
- tmp = in.gets(buf, 1024);
- if(tmp && tmp[0] != 0)
+ if (ndb_logevent_get_next(log_handle, &log_event, 60000) > 0)
+ {
+ int print = 0;
+ switch (log_event.type) {
+ case NDB_LE_BackupStarted:
+ if (log_event.BackupStarted.backup_id == backupId)
+ print = 1;
+ break;
+ case NDB_LE_BackupCompleted:
+ if (log_event.BackupCompleted.backup_id == backupId)
+ print = 1;
+ break;
+ case NDB_LE_BackupAborted:
+ if (log_event.BackupAborted.backup_id == backupId)
+ print = 1;
+ break;
+ default:
+ break;
+ }
+ if (print)
+ {
+ Guard g(m_print_mutex);
+ printLogEvent(&log_event);
+ count++;
+ }
+ }
+ else
{
- ndbout << tmp;
+ retry++;
}
- } while(tmp && tmp[0] != 0);
-
- close(fd);
+ } while(count < 2 && retry < 3);
+
+ if (retry >= 3)
+ ndbout << "get backup event failed for " << retry << " times" << endl;
+
+ ndb_mgm_destroy_logevent_handle(&log_handle);
}
return 0;
diff --git a/storage/ndb/src/mgmclient/Makefile.am b/storage/ndb/src/mgmclient/Makefile.am
index 5b2009240c3..41f659cf68d 100644
--- a/storage/ndb/src/mgmclient/Makefile.am
+++ b/storage/ndb/src/mgmclient/Makefile.am
@@ -21,7 +21,8 @@ libndbmgmclient_la_LIBADD = ../mgmapi/libmgmapi.la \
../common/logger/liblogger.la \
../common/portlib/libportlib.la \
../common/util/libgeneral.la \
- ../common/portlib/libportlib.la
+ ../common/portlib/libportlib.la \
+ ../common/debugger/libtrace.la
ndb_mgm_SOURCES = main.cpp
@@ -35,6 +36,7 @@ INCLUDES += -I$(top_srcdir)/storage/ndb/include/mgmapi \
LDADD_LOC = $(noinst_LTLIBRARIES) \
../common/portlib/libportlib.la \
@readline_link@ \
+ $(top_builddir)/storage/ndb/src/libndbclient.la \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/strings/libmystrings.a \
diff --git a/storage/ndb/src/mgmclient/main.cpp b/storage/ndb/src/mgmclient/main.cpp
index 44408362f09..fbd81c71700 100644
--- a/storage/ndb/src/mgmclient/main.cpp
+++ b/storage/ndb/src/mgmclient/main.cpp
@@ -23,6 +23,8 @@ extern "C" {
#elif !defined(__NETWARE__)
#include <readline/readline.h>
extern "C" int add_history(const char *command); /* From readline directory */
+extern "C" int read_history(const char *command);
+extern "C" int write_history(const char *command);
#define HAVE_READLINE
#endif
}
@@ -71,11 +73,11 @@ static struct my_option my_long_options[] =
NDB_STD_OPTS("ndb_mgm"),
{ "execute", 'e',
"execute command and exit",
- (gptr*) &opt_execute_str, (gptr*) &opt_execute_str, 0,
+ (uchar**) &opt_execute_str, (uchar**) &opt_execute_str, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "try-reconnect", 't',
"Specify number of tries for connecting to ndb_mgmd (0 = infinite)",
- (gptr*) &_try_reconnect, (gptr*) &_try_reconnect, 0,
+ (uchar**) &_try_reconnect, (uchar**) &_try_reconnect, 0,
GET_UINT, REQUIRED_ARG, 3, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -155,10 +157,35 @@ int main(int argc, char** argv){
signal(SIGPIPE, handler);
com = new Ndb_mgmclient(opt_connect_str,1);
int ret= 0;
+ BaseString histfile;
if (!opt_execute_str)
{
+#ifdef HAVE_READLINE
+ char *histfile_env= getenv("NDB_MGM_HISTFILE");
+ if (histfile_env)
+ histfile.assign(histfile_env,strlen(histfile_env));
+ else if(getenv("HOME"))
+ {
+ histfile.assign(getenv("HOME"),strlen(getenv("HOME")));
+ histfile.append("/.ndb_mgm_history");
+ }
+ if (histfile.length())
+ read_history(histfile.c_str());
+#endif
+
ndbout << "-- NDB Cluster -- Management Client --" << endl;
while(read_and_execute(_try_reconnect));
+
+#ifdef HAVE_READLINE
+ if (histfile.length())
+ {
+ BaseString histfile_tmp;
+ histfile_tmp.assign(histfile);
+ histfile_tmp.append(".TMP");
+ if(!write_history(histfile_tmp.c_str()))
+ my_rename(histfile_tmp.c_str(), histfile.c_str(), MYF(MY_WME));
+ }
+#endif
}
else
{
diff --git a/storage/ndb/src/mgmsrv/ConfigInfo.cpp b/storage/ndb/src/mgmsrv/ConfigInfo.cpp
index 26e50cb8a68..9cbb7d93ceb 100644
--- a/storage/ndb/src/mgmsrv/ConfigInfo.cpp
+++ b/storage/ndb/src/mgmsrv/ConfigInfo.cpp
@@ -580,6 +580,18 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
STR_VALUE(MAX_INT_RNIL) },
{
+ CFG_DB_WATCHDOG_INTERVAL_INITIAL,
+ "TimeBetweenWatchDogCheckInitial",
+ DB_TOKEN,
+ "Time between execution checks inside a database node in the early start phases when memory is allocated",
+ ConfigInfo::CI_USED,
+ true,
+ ConfigInfo::CI_INT,
+ "6000",
+ "70",
+ STR_VALUE(MAX_INT_RNIL) },
+
+ {
CFG_DB_STOP_ON_ERROR,
"StopOnError",
DB_TOKEN,
@@ -880,6 +892,18 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
STR_VALUE(MAX_INT_RNIL) },
{
+ CFG_DB_REDOLOG_FILE_SIZE,
+ "FragmentLogFileSize",
+ DB_TOKEN,
+ "Size of each Redo log file",
+ ConfigInfo::CI_USED,
+ false,
+ ConfigInfo::CI_INT,
+ "16M",
+ "4M",
+ "1G" },
+
+ {
CFG_DB_MAX_OPEN_FILES,
"MaxNoOfOpenFiles",
DB_TOKEN,
@@ -1298,6 +1322,18 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
STR_VALUE(MAX_INT_RNIL) },
{
+ CFG_DB_MAX_ALLOCATE,
+ "MaxAllocate",
+ DB_TOKEN,
+ "Maximum size of allocation to use when allocating memory for tables",
+ ConfigInfo::CI_USED,
+ false,
+ ConfigInfo::CI_INT,
+ "32M",
+ "1M",
+ "1G" },
+
+ {
CFG_DB_MEMREPORT_FREQUENCY,
"MemReportFrequency",
DB_TOKEN,
@@ -1309,6 +1345,18 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"0",
STR_VALUE(MAX_INT_RNIL) },
+ {
+ CFG_DB_O_DIRECT,
+ "ODirect",
+ DB_TOKEN,
+ "Use O_DIRECT file write/read when possible",
+ ConfigInfo::CI_USED,
+ true,
+ ConfigInfo::CI_BOOL,
+ "false",
+ "false",
+ "true"},
+
/***************************************************************************
* API
***************************************************************************/
@@ -2897,25 +2945,50 @@ static bool fixNodeId(InitConfigFileParser::Context & ctx, const char * data)
char buf[] = "NodeIdX"; buf[6] = data[sizeof("NodeI")];
char sysbuf[] = "SystemX"; sysbuf[6] = data[sizeof("NodeI")];
const char* nodeId;
- require(ctx.m_currentSection->get(buf, &nodeId));
+ if(!ctx.m_currentSection->get(buf, &nodeId))
+ {
+ ctx.reportError("Mandatory parameter %s missing from section"
+ "[%s] starting at line: %d",
+ buf, ctx.fname, ctx.m_sectionLineno);
+ return false;
+ }
char tmpLine[MAX_LINE_LENGTH];
strncpy(tmpLine, nodeId, MAX_LINE_LENGTH);
char* token1 = strtok(tmpLine, ".");
char* token2 = strtok(NULL, ".");
Uint32 id;
-
+
+ if(!token1)
+ {
+ ctx.reportError("Value for mandatory parameter %s missing from section "
+ "[%s] starting at line: %d",
+ buf, ctx.fname, ctx.m_sectionLineno);
+ return false;
+ }
if (token2 == NULL) { // Only a number given
errno = 0;
char* p;
id = strtol(token1, &p, 10);
- if (errno != 0) warning("STRTOK1", nodeId);
+ if (errno != 0 || id <= 0x0 || id > MAX_NODES)
+ {
+ ctx.reportError("Illegal value for mandatory parameter %s from section "
+ "[%s] starting at line: %d",
+ buf, ctx.fname, ctx.m_sectionLineno);
+ return false;
+ }
require(ctx.m_currentSection->put(buf, id, true));
} else { // A pair given (e.g. "uppsala.32")
errno = 0;
char* p;
id = strtol(token2, &p, 10);
- if (errno != 0) warning("STRTOK2", nodeId);
+ if (errno != 0 || id <= 0x0 || id > MAX_NODES)
+ {
+ ctx.reportError("Illegal value for mandatory parameter %s from section "
+ "[%s] starting at line: %d",
+ buf, ctx.fname, ctx.m_sectionLineno);
+ return false;
+ }
require(ctx.m_currentSection->put(buf, id, true));
require(ctx.m_currentSection->put(sysbuf, token1));
}
@@ -3733,16 +3806,16 @@ check_node_vs_replicas(Vector<ConfigInfo::ConfigRuleSection>&sections,
}
}
if (db_host_count > 1 && node_group_warning.length() > 0)
- ndbout_c("Cluster configuration warning:\n%s",node_group_warning.c_str());
+ ctx.reportWarning("Cluster configuration warning:\n%s",node_group_warning.c_str());
if (!with_arbitration_rank)
{
- ndbout_c("Cluster configuration warning:"
+ ctx.reportWarning("Cluster configuration warning:"
"\n Neither %s nor %s nodes are configured with arbitrator,"
"\n may cause complete cluster shutdown in case of host failure.",
MGM_TOKEN, API_TOKEN);
}
if (db_host_count > 1 && arbitration_warning.length() > 0)
- ndbout_c("Cluster configuration warning:%s%s",arbitration_warning.c_str(),
+ ctx.reportWarning("Cluster configuration warning:%s%s",arbitration_warning.c_str(),
"\n Running arbitrator on the same host as a database node may"
"\n cause complete cluster shutdown in case of host failure.");
}
diff --git a/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp b/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp
index 94768e6ae52..569cb1eb654 100644
--- a/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp
+++ b/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp
@@ -612,10 +612,11 @@ static
my_bool
parse_mycnf_opt(int, const struct my_option * opt, char * value)
{
+ long *app_type= (long*) &opt->app_type;
if(opt->comment)
- ((struct my_option *)opt)->app_type++;
+ (*app_type)++;
else
- ((struct my_option *)opt)->app_type = order++;
+ *app_type = order++;
return 0;
}
@@ -780,19 +781,19 @@ InitConfigFileParser::parse_mycnf()
const ConfigInfo::ParamInfo& param = ConfigInfo::m_ParamInfo[i];
switch(param._type){
case ConfigInfo::CI_BOOL:
- opt.value = (gptr*)malloc(sizeof(int));
+ opt.value = (uchar **)malloc(sizeof(int));
opt.var_type = GET_INT;
break;
case ConfigInfo::CI_INT:
- opt.value = (gptr*)malloc(sizeof(int));
+ opt.value = (uchar**)malloc(sizeof(int));
opt.var_type = GET_INT;
break;
case ConfigInfo::CI_INT64:
- opt.value = (gptr*)malloc(sizeof(Int64));
+ opt.value = (uchar**)malloc(sizeof(Int64));
opt.var_type = GET_LL;
break;
case ConfigInfo::CI_STRING:
- opt.value = (gptr*)malloc(sizeof(char *));
+ opt.value = (uchar**)malloc(sizeof(char *));
opt.var_type = GET_STR;
break;
default:
@@ -818,28 +819,28 @@ InitConfigFileParser::parse_mycnf()
bzero(&opt, sizeof(opt));
opt.name = "ndbd";
opt.id = 256;
- opt.value = (gptr*)malloc(sizeof(char*));
+ opt.value = (uchar**)malloc(sizeof(char*));
opt.var_type = GET_STR;
opt.arg_type = REQUIRED_ARG;
options.push_back(opt);
opt.name = "ndb_mgmd";
opt.id = 256;
- opt.value = (gptr*)malloc(sizeof(char*));
+ opt.value = (uchar**)malloc(sizeof(char*));
opt.var_type = GET_STR;
opt.arg_type = REQUIRED_ARG;
options.push_back(opt);
opt.name = "mysqld";
opt.id = 256;
- opt.value = (gptr*)malloc(sizeof(char*));
+ opt.value = (uchar**)malloc(sizeof(char*));
opt.var_type = GET_STR;
opt.arg_type = REQUIRED_ARG;
options.push_back(opt);
opt.name = "ndbapi";
opt.id = 256;
- opt.value = (gptr*)malloc(sizeof(char*));
+ opt.value = (uchar**)malloc(sizeof(char*));
opt.var_type = GET_STR;
opt.arg_type = REQUIRED_ARG;
options.push_back(opt);
@@ -948,22 +949,6 @@ end:
template class Vector<struct my_option>;
-#if 0
-struct my_option
-{
- const char *name; /* Name of the option */
- int id; /* unique id or short option */
- const char *comment; /* option comment, for autom. --help */
- gptr *value; /* The variable value */
- gptr *u_max_value; /* The user def. max variable value */
- const char **str_values; /* Pointer to possible values */
- ulong var_type;
- enum get_opt_arg_type arg_type;
- longlong def_value; /* Default value */
- longlong min_value; /* Min allowed value */
- longlong max_value; /* Max allowed value */
- longlong sub_size; /* Subtract this from given value */
- long block_size; /* Value should be a mult. of this */
- int app_type; /* To be used by an application */
-};
-#endif
+/*
+ See include/my_getopt.h for the declaration of struct my_option
+*/
diff --git a/storage/ndb/src/mgmsrv/Makefile.am b/storage/ndb/src/mgmsrv/Makefile.am
index adde2ad5d34..c19f885ae8d 100644
--- a/storage/ndb/src/mgmsrv/Makefile.am
+++ b/storage/ndb/src/mgmsrv/Makefile.am
@@ -38,7 +38,7 @@ INCLUDES_LOC = -I$(top_srcdir)/storage/ndb/src/ndbapi \
-I$(top_srcdir)/storage/ndb/src/common/mgmcommon \
-I$(top_srcdir)/storage/ndb/src/mgmclient
-LDADD_LOC = $(top_builddir)/storage/ndb/src/mgmclient/CommandInterpreter.o \
+LDADD_LOC = $(top_builddir)/storage/ndb/src/mgmclient/CommandInterpreter.lo \
$(top_builddir)/storage/ndb/src/libndbclient.la \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/mysys/libmysys.a \
diff --git a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp
index dde6829c82c..af708664a69 100644
--- a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp
+++ b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp
@@ -18,6 +18,7 @@
#include "MgmtSrvr.hpp"
#include "MgmtErrorReporter.hpp"
+#include "ndb_mgmd_error.h"
#include <ConfigRetriever.hpp>
#include <NdbOut.hpp>
@@ -239,13 +240,6 @@ MgmtSrvr::stopEventLog()
// Nothing yet
}
-class ErrorItem
-{
-public:
- int _errorCode;
- const char * _errorText;
-};
-
bool
MgmtSrvr::setEventLogFilter(int severity, int enable)
{
@@ -268,62 +262,6 @@ MgmtSrvr::isEventLogFilterEnabled(int severity)
return g_eventLogger.isEnable((Logger::LoggerLevel)severity);
}
-static ErrorItem errorTable[] =
-{
- {MgmtSrvr::NO_CONTACT_WITH_PROCESS, "No contact with the process (dead ?)."},
- {MgmtSrvr::PROCESS_NOT_CONFIGURED, "The process is not configured."},
- {MgmtSrvr::WRONG_PROCESS_TYPE,
- "The process has wrong type. Expected a DB process."},
- {MgmtSrvr::COULD_NOT_ALLOCATE_MEMORY, "Could not allocate memory."},
- {MgmtSrvr::SEND_OR_RECEIVE_FAILED, "Send to process or receive failed."},
- {MgmtSrvr::INVALID_LEVEL, "Invalid level. Should be between 1 and 30."},
- {MgmtSrvr::INVALID_ERROR_NUMBER, "Invalid error number. Should be >= 0."},
- {MgmtSrvr::INVALID_TRACE_NUMBER, "Invalid trace number."},
- {MgmtSrvr::NOT_IMPLEMENTED, "Not implemented."},
- {MgmtSrvr::INVALID_BLOCK_NAME, "Invalid block name"},
-
- {MgmtSrvr::CONFIG_PARAM_NOT_EXIST,
- "The configuration parameter does not exist for the process type."},
- {MgmtSrvr::CONFIG_PARAM_NOT_UPDATEABLE,
- "The configuration parameter is not possible to update."},
- {MgmtSrvr::VALUE_WRONG_FORMAT_INT_EXPECTED,
- "Incorrect value. Expected integer."},
- {MgmtSrvr::VALUE_TOO_LOW, "Value is too low."},
- {MgmtSrvr::VALUE_TOO_HIGH, "Value is too high."},
- {MgmtSrvr::VALUE_WRONG_FORMAT_BOOL_EXPECTED,
- "Incorrect value. Expected TRUE or FALSE."},
-
- {MgmtSrvr::CONFIG_FILE_OPEN_WRITE_ERROR,
- "Could not open configuration file for writing."},
- {MgmtSrvr::CONFIG_FILE_OPEN_READ_ERROR,
- "Could not open configuration file for reading."},
- {MgmtSrvr::CONFIG_FILE_WRITE_ERROR,
- "Write error when writing configuration file."},
- {MgmtSrvr::CONFIG_FILE_READ_ERROR,
- "Read error when reading configuration file."},
- {MgmtSrvr::CONFIG_FILE_CLOSE_ERROR, "Could not close configuration file."},
-
- {MgmtSrvr::CONFIG_CHANGE_REFUSED_BY_RECEIVER,
- "The change was refused by the receiving process."},
- {MgmtSrvr::COULD_NOT_SYNC_CONFIG_CHANGE_AGAINST_PHYSICAL_MEDIUM,
- "The change could not be synced against physical medium."},
- {MgmtSrvr::CONFIG_FILE_CHECKSUM_ERROR,
- "The config file is corrupt. Checksum error."},
- {MgmtSrvr::NOT_POSSIBLE_TO_SEND_CONFIG_UPDATE_TO_PROCESS_TYPE,
- "It is not possible to send an update of a configuration variable "
- "to this kind of process."},
- {MgmtSrvr::NODE_SHUTDOWN_IN_PROGESS, "Node shutdown in progress" },
- {MgmtSrvr::SYSTEM_SHUTDOWN_IN_PROGRESS, "System shutdown in progress" },
- {MgmtSrvr::NODE_SHUTDOWN_WOULD_CAUSE_SYSTEM_CRASH,
- "Node shutdown would cause system crash" },
- {MgmtSrvr::UNSUPPORTED_NODE_SHUTDOWN,
- "Unsupported multi node shutdown. Abort option required." },
- {MgmtSrvr::NODE_NOT_API_NODE, "The specified node is not an API node." },
- {MgmtSrvr::OPERATION_NOT_ALLOWED_START_STOP,
- "Operation not allowed while nodes are starting or stopping."},
- {MgmtSrvr::NO_CONTACT_WITH_DB_NODES, "No contact with database nodes" }
-};
-
int MgmtSrvr::translateStopRef(Uint32 errCode)
{
switch(errCode){
@@ -343,8 +281,6 @@ int MgmtSrvr::translateStopRef(Uint32 errCode)
return 4999;
}
-static int noOfErrorCodes = sizeof(errorTable) / sizeof(ErrorItem);
-
int
MgmtSrvr::getNodeCount(enum ndb_mgm_node_type type) const
{
@@ -628,6 +564,16 @@ MgmtSrvr::start(BaseString &error_string)
ndbout_c("This is probably a bug.");
}
+ /*
+ set api reg req frequency quite high:
+
+ 100 ms interval to make sure we have fairly up-to-date
+ info from the nodes. This to make sure that this info
+ is not dependent on heart beat settings in the
+ configuration
+ */
+ theFacade->theClusterMgr->set_max_api_reg_req_interval(100);
+
TransporterRegistry *reg = theFacade->get_registry();
for(unsigned int i=0;i<reg->m_transporter_interface.size();i++) {
BaseString msg;
@@ -1959,18 +1905,8 @@ MgmtSrvr::dumpState(int nodeId, const Uint32 args[], Uint32 no)
const char* MgmtSrvr::getErrorText(int errorCode, char *buf, int buf_sz)
{
-
- for (int i = 0; i < noOfErrorCodes; ++i) {
- if (errorCode == errorTable[i]._errorCode) {
- BaseString::snprintf(buf, buf_sz, errorTable[i]._errorText);
- buf[buf_sz-1]= 0;
- return buf;
- }
- }
-
ndb_error_string(errorCode, buf, buf_sz);
buf[buf_sz-1]= 0;
-
return buf;
}
diff --git a/storage/ndb/src/mgmsrv/MgmtSrvr.hpp b/storage/ndb/src/mgmsrv/MgmtSrvr.hpp
index a54b7866091..90287554ef8 100644
--- a/storage/ndb/src/mgmsrv/MgmtSrvr.hpp
+++ b/storage/ndb/src/mgmsrv/MgmtSrvr.hpp
@@ -148,45 +148,6 @@ public:
*/
bool isEventLogFilterEnabled(int severity);
- STATIC_CONST( NO_CONTACT_WITH_PROCESS = 5000 );
- STATIC_CONST( PROCESS_NOT_CONFIGURED = 5001 );
- STATIC_CONST( WRONG_PROCESS_TYPE = 5002 );
- STATIC_CONST( COULD_NOT_ALLOCATE_MEMORY = 5003 );
- STATIC_CONST( SEND_OR_RECEIVE_FAILED = 5005 );
- STATIC_CONST( INVALID_LEVEL = 5006 );
- STATIC_CONST( INVALID_ERROR_NUMBER = 5007 );
- STATIC_CONST( INVALID_TRACE_NUMBER = 5008 );
- STATIC_CONST( NOT_IMPLEMENTED = 5009 );
- STATIC_CONST( INVALID_BLOCK_NAME = 5010 );
-
- STATIC_CONST( CONFIG_PARAM_NOT_EXIST = 5011 );
- STATIC_CONST( CONFIG_PARAM_NOT_UPDATEABLE = 5012 );
- STATIC_CONST( VALUE_WRONG_FORMAT_INT_EXPECTED = 5013 );
- STATIC_CONST( VALUE_TOO_LOW = 5014 );
- STATIC_CONST( VALUE_TOO_HIGH = 5015 );
- STATIC_CONST( VALUE_WRONG_FORMAT_BOOL_EXPECTED = 5016 );
-
- STATIC_CONST( CONFIG_FILE_OPEN_WRITE_ERROR = 5017 );
- STATIC_CONST( CONFIG_FILE_OPEN_READ_ERROR = 5018 );
- STATIC_CONST( CONFIG_FILE_WRITE_ERROR = 5019 );
- STATIC_CONST( CONFIG_FILE_READ_ERROR = 5020 );
- STATIC_CONST( CONFIG_FILE_CLOSE_ERROR = 5021 );
-
- STATIC_CONST( CONFIG_CHANGE_REFUSED_BY_RECEIVER = 5022 );
- STATIC_CONST( COULD_NOT_SYNC_CONFIG_CHANGE_AGAINST_PHYSICAL_MEDIUM = 5023 );
- STATIC_CONST( CONFIG_FILE_CHECKSUM_ERROR = 5024 );
- STATIC_CONST( NOT_POSSIBLE_TO_SEND_CONFIG_UPDATE_TO_PROCESS_TYPE = 5025 );
-
- STATIC_CONST( NODE_SHUTDOWN_IN_PROGESS = 5026 );
- STATIC_CONST( SYSTEM_SHUTDOWN_IN_PROGRESS = 5027 );
- STATIC_CONST( NODE_SHUTDOWN_WOULD_CAUSE_SYSTEM_CRASH = 5028 );
-
- STATIC_CONST( NO_CONTACT_WITH_DB_NODES = 5030 );
- STATIC_CONST( UNSUPPORTED_NODE_SHUTDOWN = 5031 );
-
- STATIC_CONST( NODE_NOT_API_NODE = 5062 );
- STATIC_CONST( OPERATION_NOT_ALLOWED_START_STOP = 5063 );
-
/**
* This enum specifies the different signal loggig modes possible to set
* with the setSignalLoggingMode method.
diff --git a/storage/ndb/src/mgmsrv/Services.cpp b/storage/ndb/src/mgmsrv/Services.cpp
index f260ff7e3ec..9272b5ab532 100644
--- a/storage/ndb/src/mgmsrv/Services.cpp
+++ b/storage/ndb/src/mgmsrv/Services.cpp
@@ -18,7 +18,7 @@
#include <uucode.h>
#include <socket_io.h>
-#include <ndb_version.h>
+#include <util/version.h>
#include <mgmapi.h>
#include <EventLogger.hpp>
#include <signaldata/SetLogLevelOrd.hpp>
diff --git a/storage/ndb/src/mgmsrv/main.cpp b/storage/ndb/src/mgmsrv/main.cpp
index b880657d89b..16c560868ef 100644
--- a/storage/ndb/src/mgmsrv/main.cpp
+++ b/storage/ndb/src/mgmsrv/main.cpp
@@ -142,29 +142,29 @@ static struct my_option my_long_options[] =
{
NDB_STD_OPTS("ndb_mgmd"),
{ "config-file", 'f', "Specify cluster configuration file",
- (gptr*) &opt_config_filename, (gptr*) &opt_config_filename, 0,
+ (uchar**) &opt_config_filename, (uchar**) &opt_config_filename, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "print-full-config", 'P', "Print full config and exit",
- (gptr*) &g_print_full_config, (gptr*) &g_print_full_config, 0,
+ (uchar**) &g_print_full_config, (uchar**) &g_print_full_config, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "daemon", 'd', "Run ndb_mgmd in daemon mode (default)",
- (gptr*) &opt_daemon, (gptr*) &opt_daemon, 0,
+ (uchar**) &opt_daemon, (uchar**) &opt_daemon, 0,
GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0 },
{ "interactive", OPT_INTERACTIVE,
"Run interactive. Not supported but provided for testing purposes",
- (gptr*) &opt_interactive, (gptr*) &opt_interactive, 0,
+ (uchar**) &opt_interactive, (uchar**) &opt_interactive, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "no-nodeid-checks", OPT_NO_NODEID_CHECKS,
"Do not provide any node id checks",
- (gptr*) &g_no_nodeid_checks, (gptr*) &g_no_nodeid_checks, 0,
+ (uchar**) &g_no_nodeid_checks, (uchar**) &g_no_nodeid_checks, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "nodaemon", OPT_NO_DAEMON,
"Don't run as daemon, but don't read from stdin",
- (gptr*) &opt_non_interactive, (gptr*) &opt_non_interactive, 0,
+ (uchar**) &opt_non_interactive, (uchar**) &opt_non_interactive, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "mycnf", 256,
"Read cluster config from my.cnf",
- (gptr*) &opt_mycnf, (gptr*) &opt_mycnf, 0,
+ (uchar**) &opt_mycnf, (uchar**) &opt_mycnf, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff --git a/storage/ndb/src/mgmsrv/ndb_mgmd_error.h b/storage/ndb/src/mgmsrv/ndb_mgmd_error.h
new file mode 100644
index 00000000000..2438f15c808
--- /dev/null
+++ b/storage/ndb/src/mgmsrv/ndb_mgmd_error.h
@@ -0,0 +1,33 @@
+/* Copyright (C) 2007 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 NDB_MGMD_ERROR_H
+#define NDB_MGMD_ERROR_H
+
+#define NO_CONTACT_WITH_PROCESS 5000
+#define WRONG_PROCESS_TYPE 5002
+#define SEND_OR_RECEIVE_FAILED 5005
+#define INVALID_ERROR_NUMBER 5007
+#define INVALID_TRACE_NUMBER 5008
+#define INVALID_BLOCK_NAME 5010
+#define NODE_SHUTDOWN_IN_PROGESS 5026
+#define SYSTEM_SHUTDOWN_IN_PROGRESS 5027
+#define NODE_SHUTDOWN_WOULD_CAUSE_SYSTEM_CRASH 5028
+#define NO_CONTACT_WITH_DB_NODES 5030
+#define UNSUPPORTED_NODE_SHUTDOWN 5031
+#define NODE_NOT_API_NODE 5062
+#define OPERATION_NOT_ALLOWED_START_STOP 5063
+
+#endif
diff --git a/storage/ndb/src/ndbapi/ClusterMgr.cpp b/storage/ndb/src/ndbapi/ClusterMgr.cpp
index 52c95df6d15..448bc1025e8 100644
--- a/storage/ndb/src/ndbapi/ClusterMgr.cpp
+++ b/storage/ndb/src/ndbapi/ClusterMgr.cpp
@@ -16,7 +16,7 @@
#include <ndb_global.h>
#include <my_pthread.h>
#include <ndb_limits.h>
-#include <ndb_version.h>
+#include <util/version.h>
#include "TransporterFacade.hpp"
#include "ClusterMgr.hpp"
@@ -61,6 +61,7 @@ ClusterMgr::ClusterMgr(TransporterFacade & _facade):
clusterMgrThreadMutex = NdbMutex_Create();
waitForHBCond= NdbCondition_Create();
waitingForHB= false;
+ m_max_api_reg_req_interval= 0xFFFFFFFF; // MAX_INT
noOfAliveNodes= 0;
noOfConnectedNodes= 0;
theClusterMgrThread= 0;
@@ -243,7 +244,7 @@ ClusterMgr::threadMain( ){
}
theFacade.lock_mutex();
- for (int i = 1; i < MAX_NODES; i++){
+ for (int i = 1; i < MAX_NDB_NODES; i++){
/**
* Send register request (heartbeat) to all available nodes
* at specified timing intervals
@@ -264,7 +265,8 @@ ClusterMgr::threadMain( ){
}
theNode.hbCounter += timeSlept;
- if (theNode.hbCounter >= theNode.hbFrequency) {
+ if (theNode.hbCounter >= m_max_api_reg_req_interval ||
+ theNode.hbCounter >= theNode.hbFrequency) {
/**
* It is now time to send a new Heartbeat
*/
diff --git a/storage/ndb/src/ndbapi/ClusterMgr.hpp b/storage/ndb/src/ndbapi/ClusterMgr.hpp
index 6e74620dd4f..0a261eb202f 100644
--- a/storage/ndb/src/ndbapi/ClusterMgr.hpp
+++ b/storage/ndb/src/ndbapi/ClusterMgr.hpp
@@ -50,6 +50,7 @@ public:
void startThread();
void forceHB();
+ void set_max_api_reg_req_interval(unsigned int millisec) { m_max_api_reg_req_interval = millisec; }
private:
void threadMain();
@@ -89,6 +90,7 @@ public:
Uint32 m_connect_count;
private:
+ Uint32 m_max_api_reg_req_interval;
Uint32 noOfAliveNodes;
Uint32 noOfConnectedNodes;
Node theNodes[MAX_NODES];
diff --git a/storage/ndb/src/ndbapi/Ndb.cpp b/storage/ndb/src/ndbapi/Ndb.cpp
index 78b7af5522b..15647861eef 100644
--- a/storage/ndb/src/ndbapi/Ndb.cpp
+++ b/storage/ndb/src/ndbapi/Ndb.cpp
@@ -37,6 +37,7 @@ Name: Ndb.cpp
#include "API.hpp"
#include <NdbEnv.h>
#include <BaseString.hpp>
+#include <NdbSqlUtil.hpp>
/****************************************************************************
void connect();
@@ -201,9 +202,10 @@ Ndb::NDB_connect(Uint32 tNode)
DBUG_PRINT("info",
("unsuccessful connect tReturnCode %d, tNdbCon->Status() %d",
tReturnCode, tNdbCon->Status()));
- if (theError.code == 299)
+ if (theError.code == 299 || // single user mode
+ theError.code == 281 ) // cluster shutdown in progress
{
- // single user mode so no need to retry with other node
+ // no need to retry with other node
DBUG_RETURN(-1);
}
DBUG_RETURN(3);
@@ -304,6 +306,180 @@ Return Value: Returns a pointer to a connection object.
Return NULL otherwise.
Remark: Start transaction. Synchronous.
*****************************************************************************/
+int
+Ndb::computeHash(Uint32 *retval,
+ const NdbDictionary::Table *table,
+ const struct Key_part_ptr * keyData,
+ void* buf, Uint32 bufLen)
+{
+ Uint32 j = 0;
+ Uint32 sumlen = 0; // Needed len
+ const NdbTableImpl* impl = &NdbTableImpl::getImpl(*table);
+ const NdbColumnImpl* const * cols = impl->m_columns.getBase();
+ Uint32 len;
+ char* pos;
+
+ Uint32 colcnt = impl->m_columns.size();
+ Uint32 parts = impl->m_noOfDistributionKeys;
+ if (parts == 0)
+ {
+ parts = impl->m_noOfKeys;
+ }
+
+ for (Uint32 i = 0; i<parts; i++)
+ {
+ if (unlikely(keyData[i].ptr == 0))
+ goto enullptr;
+ }
+
+ if (unlikely(keyData[parts].ptr != 0))
+ goto emissingnullptr;
+
+ const NdbColumnImpl* partcols[NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY];
+ for (Uint32 i = 0; i<colcnt && j < parts; i++)
+ {
+ if (cols[i]->m_distributionKey)
+ {
+ // wl3717_todo
+ // char allowed now as dist key so this case should be tested
+ partcols[j++] = cols[i];
+ }
+ }
+
+ for (Uint32 i = 0; i<parts; i++)
+ {
+ Uint32 lb, len;
+ if (unlikely(!NdbSqlUtil::get_var_length(partcols[i]->m_type,
+ keyData[i].ptr,
+ keyData[i].len,
+ lb, len)))
+ goto emalformedkey;
+
+ if (unlikely(keyData[i].len < (lb + len)))
+ goto elentosmall;
+
+ Uint32 maxlen = (partcols[i]->m_attrSize * partcols[i]->m_arraySize);
+
+ if (unlikely(lb == 0 && keyData[i].len != maxlen))
+ goto emalformedkey;
+
+ if (partcols[i]->m_cs)
+ {
+ Uint32 xmul = partcols[i]->m_cs->strxfrm_multiply;
+ xmul = xmul ? xmul : 1;
+ len = xmul * (maxlen - lb);
+ }
+
+ len = (lb + len + 3) & ~(Uint32)3;
+ sumlen += len;
+
+ }
+
+ if (buf)
+ {
+ UintPtr org = UintPtr(buf);
+ UintPtr use = (org + 7) & ~(UintPtr)7;
+
+ buf = (void*)use;
+ bufLen -= (use - org);
+
+ if (unlikely(sumlen > bufLen))
+ goto ebuftosmall;
+ }
+ else
+ {
+ buf = malloc(sumlen);
+ if (unlikely(buf == 0))
+ goto enomem;
+ bufLen = 0;
+ assert((UintPtr(buf) & 7) == 0);
+ }
+
+ pos = (char*)buf;
+ for (Uint32 i = 0; i<parts; i++)
+ {
+ Uint32 lb, len;
+ NdbSqlUtil::get_var_length(partcols[i]->m_type,
+ keyData[i].ptr, keyData[i].len, lb, len);
+ CHARSET_INFO* cs;
+ if ((cs = partcols[i]->m_cs))
+ {
+ Uint32 xmul = cs->strxfrm_multiply;
+ if (xmul == 0)
+ xmul = 1;
+ /*
+ * Varchar end-spaces are ignored in comparisons. To get same hash
+ * we blank-pad to maximum length via strnxfrm.
+ */
+ Uint32 maxlen = (partcols[i]->m_attrSize * partcols[i]->m_arraySize);
+ Uint32 dstLen = xmul * (maxlen - lb);
+ int n = NdbSqlUtil::strnxfrm_bug7284(cs,
+ (unsigned char*)pos,
+ dstLen,
+ ((unsigned char*)keyData[i].ptr)+lb,
+ len);
+
+ if (unlikely(n == -1))
+ goto emalformedstring;
+
+ while ((n & 3) != 0)
+ {
+ pos[n++] = 0;
+ }
+ pos += n;
+ }
+ else
+ {
+ len += lb;
+ memcpy(pos, keyData[i].ptr, len);
+ while (len & 3)
+ {
+ * (pos + len++) = 0;
+ }
+ pos += len;
+ }
+ }
+ len = UintPtr(pos) - UintPtr(buf);
+ assert((len & 3) == 0);
+
+ Uint32 values[4];
+ md5_hash(values, (const Uint64*)buf, len >> 2);
+
+ if (retval)
+ {
+ * retval = values[1];
+ }
+
+ if (bufLen == 0)
+ free(buf);
+
+ return 0;
+
+enullptr:
+ return 4316;
+
+emissingnullptr:
+ return 4276;
+
+elentosmall:
+ return 4277;
+
+ebuftosmall:
+ return 4278;
+
+emalformedstring:
+ if (bufLen == 0)
+ free(buf);
+
+ return 4279;
+
+emalformedkey:
+ return 4280;
+
+enomem:
+ return 4000;
+}
+
NdbTransaction*
Ndb::startTransaction(const NdbDictionary::Table *table,
const char * keyData, Uint32 keyLen)
@@ -754,17 +930,27 @@ Ndb::getNodeId()
}
/****************************************************************************
-Uint64 getTupleIdFromNdb( Uint32 aTableId, Uint32 cacheSize );
-
-Parameters: aTableId : The TableId.
- cacheSize: Prefetch this many values
-Remark: Returns a new TupleId to the application.
- The TupleId comes from SYSTAB_0 where SYSKEY_0 = TableId.
- It is initialized to (TableId << 48) + 1 in NdbcntrMain.cpp.
+Uint64 getAutoIncrementValue( const char* aTableName,
+ Uint64 & autoValue,
+ Uint32 cacheSize,
+ Uint64 step,
+ Uint64 start);
+
+Parameters: aTableName (IN) : The table name.
+ autoValue (OUT) : Returns new autoincrement value
+ cacheSize (IN) : Prefetch this many values
+ step (IN) : Specifies the step between the
+ autoincrement values.
+ start (IN) : Start value for first value
+Remark: Returns a new autoincrement value to the application.
+ The autoincrement values can be increased by steps
+ (default 1) and a number of values can be prefetched
+ by specifying cacheSize (default 10).
****************************************************************************/
int
Ndb::getAutoIncrementValue(const char* aTableName,
- Uint64 & tupleId, Uint32 cacheSize)
+ Uint64 & autoValue, Uint32 cacheSize,
+ Uint64 step, Uint64 start)
{
DBUG_ENTER("Ndb::getAutoIncrementValue");
ASSERT_NOT_MYSQLD;
@@ -778,15 +964,16 @@ Ndb::getAutoIncrementValue(const char* aTableName,
}
const NdbTableImpl* table = info->m_table_impl;
TupleIdRange & range = info->m_tuple_id_range;
- if (getTupleIdFromNdb(table, range, tupleId, cacheSize) == -1)
+ if (getTupleIdFromNdb(table, range, autoValue, cacheSize, step, start) == -1)
DBUG_RETURN(-1);
- DBUG_PRINT("info", ("value %lu", (ulong) tupleId));
+ DBUG_PRINT("info", ("value %lu", (ulong) autoValue));
DBUG_RETURN(0);
}
int
Ndb::getAutoIncrementValue(const NdbDictionary::Table * aTable,
- Uint64 & tupleId, Uint32 cacheSize)
+ Uint64 & autoValue, Uint32 cacheSize,
+ Uint64 step, Uint64 start)
{
DBUG_ENTER("Ndb::getAutoIncrementValue");
ASSERT_NOT_MYSQLD;
@@ -801,51 +988,86 @@ Ndb::getAutoIncrementValue(const NdbDictionary::Table * aTable,
DBUG_RETURN(-1);
}
TupleIdRange & range = info->m_tuple_id_range;
- if (getTupleIdFromNdb(table, range, tupleId, cacheSize) == -1)
+ if (getTupleIdFromNdb(table, range, autoValue, cacheSize, step, start) == -1)
DBUG_RETURN(-1);
- DBUG_PRINT("info", ("value %lu", (ulong)tupleId));
+ DBUG_PRINT("info", ("value %lu", (ulong)autoValue));
DBUG_RETURN(0);
}
int
Ndb::getAutoIncrementValue(const NdbDictionary::Table * aTable,
- TupleIdRange & range, Uint64 & tupleId,
- Uint32 cacheSize)
+ TupleIdRange & range, Uint64 & autoValue,
+ Uint32 cacheSize, Uint64 step, Uint64 start)
{
DBUG_ENTER("Ndb::getAutoIncrementValue");
assert(aTable != 0);
const NdbTableImpl* table = & NdbTableImpl::getImpl(*aTable);
- if (getTupleIdFromNdb(table, range, tupleId, cacheSize) == -1)
+ if (getTupleIdFromNdb(table, range, autoValue, cacheSize, step, start) == -1)
DBUG_RETURN(-1);
- DBUG_PRINT("info", ("value %lu", (ulong)tupleId));
+ DBUG_PRINT("info", ("value %lu", (ulong)autoValue));
DBUG_RETURN(0);
}
int
Ndb::getTupleIdFromNdb(const NdbTableImpl* table,
- TupleIdRange & range, Uint64 & tupleId, Uint32 cacheSize)
+ TupleIdRange & range, Uint64 & tupleId,
+ Uint32 cacheSize, Uint64 step, Uint64 start)
{
+/*
+ Returns a new TupleId to the application.
+ The TupleId comes from SYSTAB_0 where SYSKEY_0 = TableId.
+ It is initialized to (TableId << 48) + 1 in NdbcntrMain.cpp.
+ In most cases step= start= 1, in which case we get:
+ 1,2,3,4,5,...
+ If step=10 and start=5 and first number is 1, we get:
+ 5,15,25,35,...
+*/
DBUG_ENTER("Ndb::getTupleIdFromNdb");
- if (range.m_first_tuple_id != range.m_last_tuple_id)
+ /*
+ Check if the next value can be taken from the pre-fetched
+ sequence.
+ */
+ if (range.m_first_tuple_id != range.m_last_tuple_id &&
+ range.m_first_tuple_id + step <= range.m_last_tuple_id)
{
assert(range.m_first_tuple_id < range.m_last_tuple_id);
- tupleId = ++range.m_first_tuple_id;
- DBUG_PRINT("info", ("next cached value %lu", (ulong)tupleId));
+ range.m_first_tuple_id += step;
+ tupleId = range.m_first_tuple_id;
+ DBUG_PRINT("info", ("Next cached value %lu", (ulong) tupleId));
}
else
{
+ /*
+ If start value is greater than step it is ignored
+ */
+ Uint64 offset = (start > step) ? 1 : start;
+
+ /*
+ Pre-fetch a number of values depending on cacheSize
+ */
if (cacheSize == 0)
cacheSize = 1;
+
DBUG_PRINT("info", ("reading %u values from database", (uint)cacheSize));
/*
* reserve next cacheSize entries in db. adds cacheSize to NEXTID
- * and returns first tupleId in the new range.
+ * and returns first tupleId in the new range. If tupleId's are
+ * incremented in steps then multiply the cacheSize with step size.
*/
- Uint64 opValue = cacheSize;
+ Uint64 opValue = cacheSize * step;
+
if (opTupleIdOnNdb(table, range, opValue, 0) == -1)
DBUG_RETURN(-1);
- tupleId = opValue;
+ DBUG_PRINT("info", ("Next value fetched from database %lu", (ulong) opValue));
+ DBUG_PRINT("info", ("Increasing %lu by offset %lu, increment is %lu", (ulong) (ulong) opValue, (ulong) offset, (ulong) step));
+ Uint64 current, next;
+ Uint64 div = ((Uint64) (opValue + step - offset)) / step;
+ next = div * step + offset;
+ current = (next < step) ? next : next - step;
+ tupleId = (opValue <= current) ? current : next;
+ DBUG_PRINT("info", ("Returning %lu", (ulong) tupleId));
+ range.m_first_tuple_id = tupleId;
}
DBUG_RETURN(0);
}
diff --git a/storage/ndb/src/ndbapi/NdbBlob.cpp b/storage/ndb/src/ndbapi/NdbBlob.cpp
index 25dcafdef53..0fc96add084 100644
--- a/storage/ndb/src/ndbapi/NdbBlob.cpp
+++ b/storage/ndb/src/ndbapi/NdbBlob.cpp
@@ -536,7 +536,7 @@ int
NdbBlob::setTableKeyValue(NdbOperation* anOp)
{
DBUG_ENTER("NdbBlob::setTableKeyValue");
- DBUG_DUMP("info", theKeyBuf.data, 4 * theTable->m_keyLenInWords);
+ DBUG_DUMP("info", (uchar*) theKeyBuf.data, 4 * theTable->m_keyLenInWords);
const Uint32* data = (const Uint32*)theKeyBuf.data;
const unsigned columns = theTable->m_columns.size();
unsigned pos = 0;
@@ -562,7 +562,8 @@ int
NdbBlob::setAccessKeyValue(NdbOperation* anOp)
{
DBUG_ENTER("NdbBlob::setAccessKeyValue");
- DBUG_DUMP("info", theAccessKeyBuf.data, 4 * theAccessTable->m_keyLenInWords);
+ DBUG_DUMP("info", (uchar*) theAccessKeyBuf.data,
+ 4 * theAccessTable->m_keyLenInWords);
const Uint32* data = (const Uint32*)theAccessKeyBuf.data;
const unsigned columns = theAccessTable->m_columns.size();
unsigned pos = 0;
@@ -587,7 +588,7 @@ NdbBlob::setPartKeyValue(NdbOperation* anOp, Uint32 part)
{
DBUG_ENTER("NdbBlob::setPartKeyValue");
DBUG_PRINT("info", ("dist=%u part=%u packkey=", getDistKey(part), part));
- DBUG_DUMP("info", thePackKeyBuf.data, 4 * thePackKeyBuf.size);
+ DBUG_DUMP("info", (uchar*) thePackKeyBuf.data, 4 * thePackKeyBuf.size);
// TODO use attr ids after compatibility with 4.1.7 not needed
if (anOp->equal("PK", thePackKeyBuf.data) == -1 ||
anOp->equal("DIST", getDistKey(part)) == -1 ||
@@ -1135,7 +1136,12 @@ NdbBlob::readTableParts(char* buf, Uint32 part, Uint32 count)
while (n < count) {
NdbOperation* tOp = theNdbCon->getNdbOperation(theBlobTable);
if (tOp == NULL ||
- tOp->committedRead() == -1 ||
+ /*
+ * This was committedRead() before. However lock on main
+ * table tuple does not fully protect blob parts since DBTUP
+ * commits each tuple separately.
+ */
+ tOp->readTuple() == -1 ||
setPartKeyValue(tOp, part + n) == -1 ||
tOp->getValue((Uint32)3, buf) == NULL) {
setErrorCode(tOp);
@@ -1261,6 +1267,7 @@ NdbBlob::deletePartsUnknown(Uint32 part)
DBUG_RETURN(-1);
}
tOp->m_abortOption= NdbOperation::AO_IgnoreError;
+ tOp->m_noErrorPropagation = true;
n++;
}
DBUG_PRINT("info", ("bat=%u", bat));
@@ -1597,6 +1604,7 @@ NdbBlob::preExecute(NdbTransaction::ExecType anExecType, bool& batch)
}
if (isWriteOp()) {
tOp->m_abortOption = NdbOperation::AO_IgnoreError;
+ tOp->m_noErrorPropagation = true;
}
theHeadInlineReadOp = tOp;
// execute immediately
@@ -1643,6 +1651,7 @@ NdbBlob::preExecute(NdbTransaction::ExecType anExecType, bool& batch)
}
if (isWriteOp()) {
tOp->m_abortOption = NdbOperation::AO_IgnoreError;
+ tOp->m_noErrorPropagation = true;
}
theHeadInlineReadOp = tOp;
// execute immediately
diff --git a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
index 63d36bf012f..ab6d90ad59e 100644
--- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
+++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
@@ -42,7 +42,7 @@
#include <my_sys.h>
#include <NdbEnv.h>
#include <NdbMem.h>
-#include <ndb_version.h>
+#include <util/version.h>
#define DEBUG_PRINT 0
#define INCOMPATIBLE_VERSION -2
diff --git a/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp b/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp
index 673587b1ed7..aa9bd174471 100644
--- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp
+++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp
@@ -391,7 +391,7 @@ struct NdbFileImpl : public NdbDictObjectImpl {
NdbFileImpl(NdbDictionary::Object::Type t);
Uint64 m_size;
- Uint32 m_free;
+ Uint64 m_free;
BaseString m_path;
BaseString m_filegroup_name;
Uint32 m_filegroup_id;
diff --git a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
index 00acfe62ad9..a82983fca8c 100644
--- a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
+++ b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
@@ -41,6 +41,7 @@
#include <NdbEventOperation.hpp>
#include "NdbEventOperationImpl.hpp"
#include <signaldata/AlterTable.hpp>
+#include "ndb_internal.hpp"
#include <EventLogger.hpp>
extern EventLogger g_eventLogger;
@@ -2838,7 +2839,7 @@ send_report:
data[5]= apply_gci >> 32;
data[6]= latest_gci & ~(Uint32)0;
data[7]= latest_gci >> 32;
- m_ndb->theImpl->send_event_report(data,8);
+ Ndb_internal::send_event_report(m_ndb, data,8);
#ifdef VM_TRACE
assert(m_total_alloc >= m_free_data_sz);
#endif
diff --git a/storage/ndb/src/ndbapi/NdbOperation.cpp b/storage/ndb/src/ndbapi/NdbOperation.cpp
index 903372ddb9d..50531292e40 100644
--- a/storage/ndb/src/ndbapi/NdbOperation.cpp
+++ b/storage/ndb/src/ndbapi/NdbOperation.cpp
@@ -76,7 +76,8 @@ NdbOperation::NdbOperation(Ndb* aNdb, NdbOperation::Type aType) :
m_keyInfoGSN(GSN_KEYINFO),
m_attrInfoGSN(GSN_ATTRINFO),
theBlobList(NULL),
- m_abortOption(-1)
+ m_abortOption(-1),
+ m_noErrorPropagation(false)
{
theReceiver.init(NdbReceiver::NDB_OPERATION, this);
theError.code = 0;
@@ -101,7 +102,8 @@ NdbOperation::setErrorCode(int anErrorCode)
theError.code = anErrorCode;
theNdbCon->theErrorLine = theErrorLine;
theNdbCon->theErrorOperation = this;
- theNdbCon->setOperationErrorCode(anErrorCode);
+ if (!(m_abortOption == AO_IgnoreError && m_noErrorPropagation))
+ theNdbCon->setOperationErrorCode(anErrorCode);
}
/******************************************************************************
@@ -116,6 +118,7 @@ NdbOperation::setErrorCodeAbort(int anErrorCode)
theError.code = anErrorCode;
theNdbCon->theErrorLine = theErrorLine;
theNdbCon->theErrorOperation = this;
+ // ignore m_noErrorPropagation
theNdbCon->setOperationErrorCodeAbort(anErrorCode);
}
@@ -161,6 +164,7 @@ NdbOperation::init(const NdbTableImpl* tab, NdbTransaction* myConnection){
theMagicNumber = 0xABCDEF01;
theBlobList = NULL;
m_abortOption = -1;
+ m_noErrorPropagation = false;
m_no_disk_flag = 1;
tSignal = theNdb->getSignal();
diff --git a/storage/ndb/src/ndbapi/NdbOperationDefine.cpp b/storage/ndb/src/ndbapi/NdbOperationDefine.cpp
index ced9b18bd55..c9459ff911c 100644
--- a/storage/ndb/src/ndbapi/NdbOperationDefine.cpp
+++ b/storage/ndb/src/ndbapi/NdbOperationDefine.cpp
@@ -608,7 +608,6 @@ NdbOperation::setAnyValue(Uint32 any_value)
const NdbColumnImpl* impl =
&NdbColumnImpl::getImpl(* NdbDictionary::Column::ANY_VALUE);
OperationType tOpType = theOperationType;
- OperationStatus tStatus = theStatus;
switch(tOpType){
case DeleteRequest:{
diff --git a/storage/ndb/src/ndbapi/NdbOperationInt.cpp b/storage/ndb/src/ndbapi/NdbOperationInt.cpp
index 0df1dbfe2c8..f69211cb78b 100644
--- a/storage/ndb/src/ndbapi/NdbOperationInt.cpp
+++ b/storage/ndb/src/ndbapi/NdbOperationInt.cpp
@@ -1023,7 +1023,7 @@ NdbOperation::branch_col(Uint32 type,
DBUG_PRINT("enter", ("type: %u col:%u val: 0x%lx len: %u label: %u",
type, ColId, (long) val, len, Label));
if (val != NULL)
- DBUG_DUMP("value", (char*)val, len);
+ DBUG_DUMP("value", (uchar*)val, len);
if (initial_interpreterCheck() == -1)
DBUG_RETURN(-1);
diff --git a/storage/ndb/src/ndbapi/NdbRecAttr.cpp b/storage/ndb/src/ndbapi/NdbRecAttr.cpp
index 7615ee71c65..38ca14085f0 100644
--- a/storage/ndb/src/ndbapi/NdbRecAttr.cpp
+++ b/storage/ndb/src/ndbapi/NdbRecAttr.cpp
@@ -270,7 +270,7 @@ ndbrecattr_print_formatted(NdbOut& out, const NdbRecAttr &r,
out << r.u_short_value();
break;
case NdbDictionary::Column::Tinyunsigned:
- out << (unsigned) r.u_char_value();
+ out << (unsigned) r.u_8_value();
break;
case NdbDictionary::Column::Bigint:
out << r.int64_value();
@@ -285,7 +285,7 @@ ndbrecattr_print_formatted(NdbOut& out, const NdbRecAttr &r,
out << r.short_value();
break;
case NdbDictionary::Column::Tinyint:
- out << (int) r.char_value();
+ out << (int) r.int8_value();
break;
case NdbDictionary::Column::Binary:
if (!f.hex_format)
@@ -411,7 +411,7 @@ ndbrecattr_print_formatted(NdbOut& out, const NdbRecAttr &r,
break;
case NdbDictionary::Column::Year:
{
- uint year = 1900 + r.u_char_value();
+ uint year = 1900 + r.u_8_value();
char buf[40];
sprintf(buf, "%04d", year);
out << buf;
diff --git a/storage/ndb/src/ndbapi/NdbScanOperation.cpp b/storage/ndb/src/ndbapi/NdbScanOperation.cpp
index dc9a74ae11c..89782453a72 100644
--- a/storage/ndb/src/ndbapi/NdbScanOperation.cpp
+++ b/storage/ndb/src/ndbapi/NdbScanOperation.cpp
@@ -1202,7 +1202,7 @@ NdbIndexScanOperation::setBound(const NdbColumnImpl* tAttrInfo,
Uint32 tupKeyLen = theTupKeyLen;
union {
Uint32 tempData[2000];
- Uint64 __align;
+ Uint64 __my_align;
};
Uint64 *valPtr;
if(remaining > totalLen && aligned && nobytes){
@@ -1311,7 +1311,7 @@ NdbIndexScanOperation::getKeyFromSCANTABREQ(Uint32* data, Uint32 size)
}
pos += rem;
}
- DBUG_DUMP("key", (char*)data, size << 2);
+ DBUG_DUMP("key", (uchar*) data, size << 2);
DBUG_RETURN(size);
}
diff --git a/storage/ndb/src/ndbapi/NdbTransaction.cpp b/storage/ndb/src/ndbapi/NdbTransaction.cpp
index ada0372a184..55c6f0f4b99 100644
--- a/storage/ndb/src/ndbapi/NdbTransaction.cpp
+++ b/storage/ndb/src/ndbapi/NdbTransaction.cpp
@@ -453,12 +453,27 @@ NdbTransaction::executeNoBlobs(NdbTransaction::ExecType aTypeOfExec,
while (1) {
int noOfComp = tNdb->sendPollNdb(3 * timeout, 1, forceSend);
if (noOfComp == 0) {
- /**
- * This timeout situation can occur if NDB crashes.
+ /*
+ * Just for fun, this is only one of two places where
+ * we could hit this error... It's quite possible we
+ * hit it in Ndbif.cpp in Ndb::check_send_timeout()
+ *
+ * We behave rather similarly in both places.
+ * Hitting this is certainly a bug though...
*/
- ndbout << "This timeout should never occur, execute(..)" << endl;
- theError.code = 4012;
- setOperationErrorCodeAbort(4012); // Error code for "Cluster Failure"
+ g_eventLogger.error("WARNING: Timeout in executeNoBlobs() waiting for "
+ "response from NDB data nodes. This should NEVER "
+ "occur. You have likely hit a NDB Bug. Please "
+ "file a bug.");
+ DBUG_PRINT("error",("This timeout should never occure, execute()"));
+ g_eventLogger.error("Forcibly trying to rollback txn (%p"
+ ") to try to clean up data node resources.",
+ this);
+ executeNoBlobs(NdbTransaction::Rollback);
+ theError.code = 4012;
+ theError.status= NdbError::PermanentError;
+ theError.classification= NdbError::TimeoutExpired;
+ setOperationErrorCodeAbort(4012); // ndbd timeout
DBUG_RETURN(-1);
}//if
@@ -522,7 +537,12 @@ NdbTransaction::executeAsynchPrepare(NdbTransaction::ExecType aTypeOfExec,
*/
if (theError.code != 0)
DBUG_PRINT("enter", ("Resetting error %d on execute", theError.code));
- theError.code = 0;
+ /**
+ * for timeout (4012) we want sendROLLBACK to behave differently.
+ * Else, normal behaviour of reset errcode
+ */
+ if (theError.code != 4012)
+ theError.code = 0;
NdbScanOperation* tcOp = m_theFirstScanOperation;
if (tcOp != 0){
// Execute any cursor operations
@@ -843,6 +863,12 @@ NdbTransaction::sendROLLBACK() // Send a TCROLLBACKREQ signal;
tSignal.setData(theTCConPtr, 1);
tSignal.setData(tTransId1, 2);
tSignal.setData(tTransId2, 3);
+ if(theError.code == 4012)
+ {
+ g_eventLogger.error("Sending TCROLLBACKREQ with Bad flag");
+ tSignal.setLength(tSignal.getLength() + 1); // + flags
+ tSignal.setData(0x1, 4); // potentially bad data
+ }
tReturnCode = tp->sendSignal(&tSignal,theDBnode);
if (tReturnCode != -1) {
theSendStatus = sendTC_ROLLBACK;
diff --git a/storage/ndb/src/ndbapi/ndb_internal.hpp b/storage/ndb/src/ndbapi/ndb_internal.hpp
new file mode 100644
index 00000000000..f5f37f95a04
--- /dev/null
+++ b/storage/ndb/src/ndbapi/ndb_internal.hpp
@@ -0,0 +1,26 @@
+/* Copyright (C) 2007 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 "NdbImpl.hpp"
+
+class Ndb_internal
+{
+private:
+ friend class NdbEventBuffer;
+ Ndb_internal() {}
+ virtual ~Ndb_internal() {}
+ static int send_event_report(Ndb *ndb, Uint32 *data, Uint32 length)
+ { return ndb->theImpl->send_event_report(data, length); }
+};
diff --git a/storage/ndb/src/ndbapi/ndberror.c b/storage/ndb/src/ndbapi/ndberror.c
index 3cecd15684d..a0417e5b118 100644
--- a/storage/ndb/src/ndbapi/ndberror.c
+++ b/storage/ndb/src/ndbapi/ndberror.c
@@ -19,6 +19,9 @@
#include <ndberror.h>
#include <m_string.h>
+#include "../mgmsrv/ndb_mgmd_error.h"
+
+
typedef struct ErrorBundle {
int code;
int mysql_code;
@@ -151,7 +154,7 @@ ErrorBundle ErrorCodes[] = {
*/
{ 4007, DMEC, UR, "Send to ndbd node failed" },
{ 4008, DMEC, UR, "Receive from NDB failed" },
- { 4009, DMEC, UR, "Cluster Failure" },
+ { 4009, HA_ERR_NO_CONNECTION, UR, "Cluster Failure" },
{ 4012, DMEC, UR,
"Request ndbd time-out, maybe due to high load or communication problems"},
{ 4013, DMEC, UR, "Request timed out in waiting for node failure"},
@@ -179,13 +182,14 @@ ErrorBundle ErrorCodes[] = {
{ 873, DMEC, TR, "Out of attrinfo records for scan in tuple manager" },
{ 899, DMEC, TR, "Rowid already allocated" },
{ 1217, DMEC, TR, "Out of operation records in local data manager (increase MaxNoOfLocalOperations)" },
- { 1220, DMEC, TR, "REDO log files overloaded, consult online manual (decrease TimeBetweenLocalCheckpoints, and|or increase NoOfFragmentLogFiles)" },
+ { 1220, DMEC, TR, "REDO log files overloaded, consult online manual (increase FragmentLogFileSize)" },
{ 1222, DMEC, TR, "Out of transaction markers in LQH" },
{ 4021, DMEC, TR, "Out of Send Buffer space in NDB API" },
{ 4022, DMEC, TR, "Out of Send Buffer space in NDB API" },
{ 4032, DMEC, TR, "Out of Send Buffer space in NDB API" },
{ 1501, DMEC, TR, "Out of undo space" },
{ 288, DMEC, TR, "Out of index operations in transaction coordinator (increase MaxNoOfConcurrentIndexOperations)" },
+ { 289, DMEC, TR, "Out of transaction buffer memory in TC (increase TransactionBufferMemory)" },
/**
* InsufficientSpace
@@ -286,6 +290,7 @@ ErrorBundle ErrorCodes[] = {
/**
* Application error
*/
+ { 281, HA_ERR_NO_CONNECTION, AE, "Operation not allowed due to cluster shutdown in progress" },
{ 299, DMEC, AE, "Operation not allowed or aborted due to single user mode" },
{ 763, DMEC, AE, "Alter table requires cluster nodes to have exact same version" },
{ 823, DMEC, AE, "Too much attrinfo from application in tuple manager" },
@@ -619,6 +624,33 @@ ErrorBundle ErrorCodes[] = {
{ 4273, DMEC, IE, "No blob table in dict cache" },
{ 4274, DMEC, IE, "Corrupted main table PK in blob operation" },
{ 4275, DMEC, AE, "The blob method is incompatible with operation type or lock mode" },
+
+ { NO_CONTACT_WITH_PROCESS, DMEC, AE,
+ "No contact with the process (dead ?)."},
+ { WRONG_PROCESS_TYPE, DMEC, AE,
+ "The process has wrong type. Expected a DB process."},
+ { SEND_OR_RECEIVE_FAILED, DMEC, AE,
+ "Send to process or receive failed."},
+ { INVALID_ERROR_NUMBER, DMEC, AE,
+ "Invalid error number. Should be >= 0."},
+ { INVALID_TRACE_NUMBER, DMEC, AE,
+ "Invalid trace number."},
+ { INVALID_BLOCK_NAME, DMEC, AE,
+ "Invalid block name"},
+ { NODE_SHUTDOWN_IN_PROGESS, DMEC, AE,
+ "Node shutdown in progress" },
+ { SYSTEM_SHUTDOWN_IN_PROGRESS, DMEC, AE,
+ "System shutdown in progress" },
+ { NODE_SHUTDOWN_WOULD_CAUSE_SYSTEM_CRASH, DMEC, AE,
+ "Node shutdown would cause system crash" },
+ { UNSUPPORTED_NODE_SHUTDOWN, DMEC, AE,
+ "Unsupported multi node shutdown. Abort option required." },
+ { NODE_NOT_API_NODE, DMEC, AE,
+ "The specified node is not an API node." },
+ { OPERATION_NOT_ALLOWED_START_STOP, DMEC, AE,
+ "Operation not allowed while nodes are starting or stopping."},
+ { NO_CONTACT_WITH_DB_NODES, DMEC, AE,
+ "No contact with database nodes" }
};
static
diff --git a/storage/ndb/test/include/HugoTransactions.hpp b/storage/ndb/test/include/HugoTransactions.hpp
index caed577f8c9..e2b12f261a8 100644
--- a/storage/ndb/test/include/HugoTransactions.hpp
+++ b/storage/ndb/test/include/HugoTransactions.hpp
@@ -20,7 +20,7 @@
#include <NDBT.hpp>
#include <HugoCalculator.hpp>
#include <HugoOperations.hpp>
-
+class NDBT_Stats;
class HugoTransactions : public HugoOperations {
public:
@@ -109,10 +109,24 @@ public:
void setRetryMax(int retryMax = 100) { m_retryMax = retryMax; }
Uint32 m_latest_gci;
+
+ void setStatsLatency(NDBT_Stats* stats) { m_stats_latency = stats; }
+
+ // allows multiple threads to update separate batches
+ void setThrInfo(int thr_count, int thr_no) {
+ m_thr_count = thr_count;
+ m_thr_no = thr_no;
+ }
+
protected:
NDBT_ResultRow row;
int m_defaultScanUpdateMethod;
int m_retryMax;
+
+ NDBT_Stats* m_stats_latency;
+
+ int m_thr_count; // 0 if no separation between threads
+ int m_thr_no;
};
diff --git a/storage/ndb/test/include/NDBT_Thread.hpp b/storage/ndb/test/include/NDBT_Thread.hpp
new file mode 100644
index 00000000000..5b724991b29
--- /dev/null
+++ b/storage/ndb/test/include/NDBT_Thread.hpp
@@ -0,0 +1,226 @@
+/* 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 */
+
+#ifndef NDB_THREAD_HPP
+#define NDB_THREAD_HPP
+
+#include <NdbMutex.h>
+#include <NdbCondition.h>
+#include <NdbThread.h>
+
+// NDBT_Thread ctor -> NDBT_Thread_run -> thr.run()
+extern "C" {
+static void* NDBT_Thread_run(void* arg);
+}
+
+// Function to run in a thread.
+
+typedef void NDBT_ThreadFunc(class NDBT_Thread&);
+
+/*
+ * NDBT_Thread
+ *
+ * Represents a thread. The thread pauses at startup.
+ * Main process sets a function to run. When the function
+ * returns, the thread pauses again to wait for a command.
+ * This allows main process to sync with the thread and
+ * exchange data with it.
+ *
+ * Input to thread is typically options. The input area
+ * is read-only in the thread. Output from thread is
+ * results such as statistics. Error code is handled
+ * separately.
+ *
+ * Pointer to Ndb object and method to create it are
+ * provided for convenience.
+ */
+
+class NDBT_ThreadSet;
+
+class NDBT_Thread {
+public:
+ NDBT_Thread();
+ NDBT_Thread(NDBT_ThreadSet* thread_set, int thread_no);
+ void create(NDBT_ThreadSet* thread_set, int thread_no);
+ ~NDBT_Thread();
+
+ // if part of a set
+ inline NDBT_ThreadSet& get_thread_set() const {
+ assert(m_thread_set != 0);
+ return *m_thread_set;
+ }
+ inline int get_thread_no() const {
+ return m_thread_no;
+ }
+
+ // { Wait -> Start -> Stop }+ -> Exit
+ enum State {
+ Wait = 1, // wait for command
+ Start, // run current function
+ Stop, // stopped (paused) when current function done
+ Exit // exit thread
+ };
+
+ // tell thread to start running current function
+ void start();
+ // wait for thread to stop when function is done
+ void stop();
+ // tell thread to exit
+ void exit();
+ // collect thread after exit
+ void join();
+
+ // set function to run
+ inline void set_func(NDBT_ThreadFunc* func) {
+ m_func = func;
+ }
+
+ // input area
+ inline void set_input(const void* input) {
+ m_input = input;
+ }
+ inline const void* get_input() const {
+ return m_input;
+ }
+
+ // output area
+ inline void set_output(void* output) {
+ m_output = output;
+ }
+ inline void* get_output() const {
+ return m_output;
+ }
+ template <class T> inline void set_output() {
+ set_output(new T);
+ }
+ inline void delete_output() {
+ delete m_output;
+ m_output = 0;
+ }
+
+ // thread-specific Ndb object
+ inline class Ndb* get_ndb() const {
+ return m_ndb;
+ }
+ int connect(class Ndb_cluster_connection*, const char* db = "TEST_DB");
+ void disconnect();
+
+ // error code (OS, Ndb, other)
+ void clear_err() {
+ m_err = 0;
+ }
+ void set_err(int err) {
+ m_err = err;
+ }
+ int get_err() const {
+ return m_err;
+ }
+
+private:
+ friend class NDBT_ThreadSet;
+ friend void* NDBT_Thread_run(void* arg);
+
+ enum { Magic = 0xabacadae };
+ Uint32 m_magic;
+
+ State m_state;
+ NDBT_ThreadSet* m_thread_set;
+ int m_thread_no;
+
+ NDBT_ThreadFunc* m_func;
+ const void* m_input;
+ void* m_output;
+ class Ndb* m_ndb;
+ int m_err;
+
+ // run the thread
+ void run();
+
+ void lock() {
+ NdbMutex_Lock(m_mutex);
+ }
+ void unlock() {
+ NdbMutex_Unlock(m_mutex);
+ }
+
+ void wait() {
+ NdbCondition_Wait(m_cond, m_mutex);
+ }
+ void signal() {
+ NdbCondition_Signal(m_cond);
+ }
+
+ NdbMutex* m_mutex;
+ NdbCondition* m_cond;
+ NdbThread* m_thread;
+ void* m_status;
+};
+
+/*
+ * A set of threads, indexed from 0 to count-1. Methods
+ * are applied to each thread (serially). Input area is
+ * common to all threads. Output areas are allocated
+ * separately according to a template class.
+ */
+
+class NDBT_ThreadSet {
+public:
+ NDBT_ThreadSet(int count);
+ ~NDBT_ThreadSet();
+
+ inline int get_count() const {
+ return m_count;
+ }
+ inline NDBT_Thread& get_thread(int n) {
+ assert(n < m_count && m_thread[n] != 0);
+ return *m_thread[n];
+ }
+
+ // tell each thread to start running
+ void start();
+ // wait for each thread to stop
+ void stop();
+ // tell each thread to exit
+ void exit();
+ // collect each thread after exit
+ void join();
+
+ // set function to run in each thread
+ void set_func(NDBT_ThreadFunc* func);
+
+ // set input area (same instance in each thread)
+ void set_input(const void* input);
+
+ // set output areas
+ template <class T> inline void set_output() {
+ for (int n = 0; n < m_count; n++) {
+ NDBT_Thread& thr = *m_thread[n];
+ thr.set_output<T>();
+ }
+ }
+ void delete_output();
+
+ // thread-specific Ndb objects
+ int connect(class Ndb_cluster_connection*, const char* db = "TEST_DB");
+ void disconnect();
+
+ int get_err() const;
+
+private:
+ int m_count;
+ NDBT_Thread** m_thread;
+};
+
+#endif
diff --git a/storage/ndb/test/ndbapi/benchronja.cpp b/storage/ndb/test/ndbapi/benchronja.cpp
index 4973e6e2487..73ee324a888 100644
--- a/storage/ndb/test/ndbapi/benchronja.cpp
+++ b/storage/ndb/test/ndbapi/benchronja.cpp
@@ -41,7 +41,14 @@
#define MAXSTRLEN 16
#define MAXATTR 64
#define MAXTABLES 64
-#define MAXTHREADS 256
+#define NDB_MAXTHREADS 256
+/*
+ NDB_MAXTHREADS used to be just MAXTHREADS, which collides with a
+ #define from <sys/thread.h> on AIX (IBM compiler). We explicitly
+ #undef it here lest someone use it by habit and get really funny
+ results. K&R says we may #undef non-existent symbols, so let's go.
+*/
+#undef MAXTHREADS
#define MAXATTRSIZE 8000
#define START_TIMER NdbTimer timer; timer.doStart();
#define STOP_TIMER timer.doStop();
@@ -56,18 +63,18 @@ struct ThreadNdb
Ndb* NdbRef;
};
-static NdbThread* threadLife[MAXTHREADS];
+static NdbThread* threadLife[NDB_MAXTHREADS];
static unsigned int tNoOfThreads;
static unsigned int tNoOfOpsPerExecute;
static unsigned int tNoOfRecords;
static unsigned int tNoOfOperations;
-static int ThreadReady[MAXTHREADS];
-static int ThreadStart[MAXTHREADS];
+static int ThreadReady[NDB_MAXTHREADS];
+static int ThreadStart[NDB_MAXTHREADS];
NDB_COMMAND(benchronja, "benchronja", "benchronja", "benchronja", 65535){
ndb_init();
- ThreadNdb tabThread[MAXTHREADS];
+ ThreadNdb tabThread[NDB_MAXTHREADS];
int i = 0 ;
int cont = 0 ;
Ndb* pMyNdb = NULL ; //( "TEST_DB" );
@@ -84,7 +91,7 @@ NDB_COMMAND(benchronja, "benchronja", "benchronja", "benchronja", 65535){
{
if (strcmp(argv[i], "-t") == 0){
tNoOfThreads = atoi(argv[i+1]);
- if ((tNoOfThreads < 1) || (tNoOfThreads > MAXTHREADS)) goto error_input;
+ if ((tNoOfThreads < 1) || (tNoOfThreads > NDB_MAXTHREADS)) goto error_input;
}else if (strcmp(argv[i], "-o") == 0){
tNoOfOperations = atoi(argv[i+1]);
if (tNoOfOperations < 1) goto error_input;
diff --git a/storage/ndb/test/ndbapi/flexAsynch.cpp b/storage/ndb/test/ndbapi/flexAsynch.cpp
index 20a157fc2f3..1f52315482f 100644
--- a/storage/ndb/test/ndbapi/flexAsynch.cpp
+++ b/storage/ndb/test/ndbapi/flexAsynch.cpp
@@ -35,7 +35,14 @@
#define MAXSTRLEN 16
#define MAXATTR 64
#define MAXTABLES 64
-#define MAXTHREADS 128
+#define NDB_MAXTHREADS 128
+/*
+ NDB_MAXTHREADS used to be just MAXTHREADS, which collides with a
+ #define from <sys/thread.h> on AIX (IBM compiler). We explicitly
+ #undef it here lest someone use it by habit and get really funny
+ results. K&R says we may #undef non-existent symbols, so let's go.
+*/
+#undef MAXTHREADS
#define MAXPAR 1024
#define MAXATTRSIZE 1000
#define PKSIZE 2
@@ -76,10 +83,10 @@ struct ThreadNdb
int ThreadNo;
};
-static NdbThread* threadLife[MAXTHREADS];
+static NdbThread* threadLife[NDB_MAXTHREADS];
static int tNodeId;
-static int ThreadReady[MAXTHREADS];
-static StartType ThreadStart[MAXTHREADS];
+static int ThreadReady[NDB_MAXTHREADS];
+static StartType ThreadStart[NDB_MAXTHREADS];
static char tableName[MAXTABLES][MAXSTRLEN+1];
static char attrName[MAXATTR][MAXSTRLEN+1];
@@ -160,7 +167,7 @@ NDB_COMMAND(flexAsynch, "flexAsynch", "flexAsynch", "flexAsynch", 65535)
return NDBT_ProgramExit(NDBT_WRONGARGS);
}
- pThreadData = new ThreadNdb[MAXTHREADS];
+ pThreadData = new ThreadNdb[NDB_MAXTHREADS];
ndbout << endl << "FLEXASYNCH - Starting normal mode" << endl;
ndbout << "Perform benchmark of insert, update and delete transactions";
@@ -844,7 +851,7 @@ readArguments(int argc, const char** argv){
while (argc > 1){
if (strcmp(argv[i], "-t") == 0){
tNoOfThreads = atoi(argv[i+1]);
- if ((tNoOfThreads < 1) || (tNoOfThreads > MAXTHREADS)){
+ if ((tNoOfThreads < 1) || (tNoOfThreads > NDB_MAXTHREADS)){
ndbout_c("Invalid no of threads");
return -1;
}
diff --git a/storage/ndb/test/ndbapi/flexHammer.cpp b/storage/ndb/test/ndbapi/flexHammer.cpp
index 9b9fd7a4a92..1b0097cf84b 100644
--- a/storage/ndb/test/ndbapi/flexHammer.cpp
+++ b/storage/ndb/test/ndbapi/flexHammer.cpp
@@ -66,7 +66,14 @@ ErrorData * flexHammerErrorData;
#define MAXSTRLEN 16
#define MAXATTR 64
#define MAXTABLES 64
-#define MAXTHREADS 256
+#define NDB_MAXTHREADS 256
+/*
+ NDB_MAXTHREADS used to be just MAXTHREADS, which collides with a
+ #define from <sys/thread.h> on AIX (IBM compiler). We explicitly
+ #undef it here lest someone use it by habit and get really funny
+ results. K&R says we may #undef non-existent symbols, so let's go.
+*/
+#undef MAXTHREADS
#define MAXATTRSIZE 100
// Max number of retries if something fails
#define MaxNoOfAttemptsC 10
@@ -119,8 +126,8 @@ static int tAttributeSize;
static int tNoOfOperations;
static int tNoOfRecords;
static int tNoOfLoops;
-static ReadyType ThreadReady[MAXTHREADS];
-static StartType ThreadStart[MAXTHREADS];
+static ReadyType ThreadReady[NDB_MAXTHREADS];
+static StartType ThreadStart[NDB_MAXTHREADS];
static char tableName[MAXTABLES][MAXSTRLEN];
static char attrName[MAXATTR][MAXSTRLEN];
static int theSimpleFlag = 0;
@@ -640,7 +647,7 @@ readArguments (int argc, const char** argv)
while (argc > 1) {
if (strcmp(argv[i], "-t") == 0) {
tNoOfThreads = atoi(argv[i+1]);
- if ((tNoOfThreads < 1) || (tNoOfThreads > MAXTHREADS))
+ if ((tNoOfThreads < 1) || (tNoOfThreads > NDB_MAXTHREADS))
return(1);
}
else if (strcmp(argv[i], "-o") == 0) {
diff --git a/storage/ndb/test/ndbapi/flexScan.cpp b/storage/ndb/test/ndbapi/flexScan.cpp
index e0b07250762..105dfeedfff 100644
--- a/storage/ndb/test/ndbapi/flexScan.cpp
+++ b/storage/ndb/test/ndbapi/flexScan.cpp
@@ -68,7 +68,14 @@
#define MAXSTRLEN 16
#define MAXATTR 64
#define MAXTABLES 64
-#define MAXTHREADS 256
+#define NDB_MAXTHREADS 256
+/*
+ NDB_MAXTHREADS used to be just MAXTHREADS, which collides with a
+ #define from <sys/thread.h> on AIX (IBM compiler). We explicitly
+ #undef it here lest someone use it by habit and get really funny
+ results. K&R says we may #undef non-existent symbols, so let's go.
+*/
+#undef MAXTHREADS
#define MAXATTRSIZE 64
enum StartType {
@@ -848,7 +855,7 @@ static int readArguments(int argc, const char** argv)
if (strcmp(argv[i], "-t") == 0) {
if (argv[i + 1] != NULL) {
tNoOfThreads = atoi(argv[i + 1]);
- if ((tNoOfThreads < 1) || (tNoOfThreads > MAXTHREADS)) {
+ if ((tNoOfThreads < 1) || (tNoOfThreads > NDB_MAXTHREADS)) {
retValue = -1;
} // if
} // if
diff --git a/storage/ndb/test/ndbapi/flexTT.cpp b/storage/ndb/test/ndbapi/flexTT.cpp
index 71d5b6c096e..4373102f77e 100644
--- a/storage/ndb/test/ndbapi/flexTT.cpp
+++ b/storage/ndb/test/ndbapi/flexTT.cpp
@@ -35,7 +35,14 @@
#define MAXSTRLEN 16
#define MAXATTR 64
#define MAXTABLES 64
-#define MAXTHREADS 128
+#define NDB_MAXTHREADS 128
+/*
+ NDB_MAXTHREADS used to be just MAXTHREADS, which collides with a
+ #define from <sys/thread.h> on AIX (IBM compiler). We explicitly
+ #undef it here lest someone use it by habit and get really funny
+ results. K&R says we may #undef non-existent symbols, so let's go.
+*/
+#undef MAXTHREADS
#define MAXPAR 1024
#define MAXATTRSIZE 1000
#define PKSIZE 1
@@ -101,10 +108,10 @@ static void input_error();
ErrorData * flexTTErrorData;
-static NdbThread* threadLife[MAXTHREADS];
+static NdbThread* threadLife[NDB_MAXTHREADS];
static int tNodeId;
-static int ThreadReady[MAXTHREADS];
-static StartType ThreadStart[MAXTHREADS];
+static int ThreadReady[NDB_MAXTHREADS];
+static StartType ThreadStart[NDB_MAXTHREADS];
static char tableName[1][MAXSTRLEN+1];
static char attrName[5][MAXSTRLEN+1];
@@ -184,7 +191,7 @@ NDB_COMMAND(flexTT, "flexTT", "flexTT", "flexTT", 65535)
return NDBT_ProgramExit(NDBT_WRONGARGS);
}
- pThreadData = new ThreadNdb[MAXTHREADS];
+ pThreadData = new ThreadNdb[NDB_MAXTHREADS];
ndbout << endl << "FLEXTT - Starting normal mode" << endl;
ndbout << "Perform TimesTen benchmark" << endl;
@@ -798,7 +805,7 @@ readArguments(int argc, const char** argv){
while (argc > 1){
if (strcmp(argv[i], "-t") == 0){
tNoOfThreads = atoi(argv[i+1]);
- if ((tNoOfThreads < 1) || (tNoOfThreads > MAXTHREADS)){
+ if ((tNoOfThreads < 1) || (tNoOfThreads > NDB_MAXTHREADS)){
ndbout_c("Invalid no of threads");
return -1;
}
diff --git a/storage/ndb/test/ndbapi/flexTimedAsynch.cpp b/storage/ndb/test/ndbapi/flexTimedAsynch.cpp
index cc44ab8b237..b6301e59df2 100644
--- a/storage/ndb/test/ndbapi/flexTimedAsynch.cpp
+++ b/storage/ndb/test/ndbapi/flexTimedAsynch.cpp
@@ -57,7 +57,14 @@
#define MAXSTRLEN 16
#define MAXATTR 64
#define MAXTABLES 64
-#define MAXTHREADS 256
+#define NDB_MAXTHREADS 256
+/*
+ NDB_MAXTHREADS used to be just MAXTHREADS, which collides with a
+ #define from <sys/thread.h> on AIX (IBM compiler). We explicitly
+ #undef it here lest someone use it by habit and get really funny
+ results. K&R says we may #undef non-existent symbols, so let's go.
+*/
+#undef MAXTHREADS
#define MAXATTRSIZE 1000
#define PKSIZE 1
@@ -95,10 +102,10 @@ static int failed = 0 ; // lame global variable that keeps track of failed trans
// incremented in executeCallback() and reset in main()
/************************************************************* < epaulsa */
-static NdbThread* threadLife[MAXTHREADS];
+static NdbThread* threadLife[NDB_MAXTHREADS];
static int tNodeId;
-static int ThreadReady[MAXTHREADS];
-static StartType ThreadStart[MAXTHREADS];
+static int ThreadReady[NDB_MAXTHREADS];
+static StartType ThreadStart[NDB_MAXTHREADS];
static char tableName[MAXTABLES][MAXSTRLEN+1];
static char attrName[MAXATTR][MAXSTRLEN+1];
static int *getAttrValueTable;
@@ -174,7 +181,7 @@ void deleteAttributeSpace(){
NDB_COMMAND(flexTimedAsynch, "flexTimedAsynch", "flexTimedAsynch [-tpoilcas]", "flexTimedAsynch", 65535)
{
ndb_init();
- ThreadNdb tabThread[MAXTHREADS];
+ ThreadNdb tabThread[NDB_MAXTHREADS];
int tLoops=0;
int returnValue;
//NdbOut flexTimedAsynchNdbOut;
@@ -615,8 +622,8 @@ void readArguments(int argc, const char** argv)
if (strcmp(argv[i], "-t") == 0)
{
tNoOfThreads = atoi(argv[i+1]);
- // if ((tNoOfThreads < 1) || (tNoOfThreads > MAXTHREADS))
- if ((tNoOfThreads < 1) || (tNoOfThreads > MAXTHREADS))
+ // if ((tNoOfThreads < 1) || (tNoOfThreads > NDB_MAXTHREADS))
+ if ((tNoOfThreads < 1) || (tNoOfThreads > NDB_MAXTHREADS))
exit(-1);
}
else if (strcmp(argv[i], "-i") == 0)
@@ -628,7 +635,7 @@ void readArguments(int argc, const char** argv)
else if (strcmp(argv[i], "-p") == 0)
{
tNoOfTransInBatch = atoi(argv[i+1]);
- //if ((tNoOfTransInBatch < 1) || (tNoOfTransInBatch > MAXTHREADS))
+ //if ((tNoOfTransInBatch < 1) || (tNoOfTransInBatch > NDB_MAXTHREADS))
if ((tNoOfTransInBatch < 1) || (tNoOfTransInBatch > 10000))
exit(-1);
}
diff --git a/storage/ndb/test/ndbapi/initronja.cpp b/storage/ndb/test/ndbapi/initronja.cpp
index 170c3dd5cfb..28ffa9f211d 100644
--- a/storage/ndb/test/ndbapi/initronja.cpp
+++ b/storage/ndb/test/ndbapi/initronja.cpp
@@ -29,7 +29,14 @@
#define MAXSTRLEN 16
#define MAXATTR 64
#define MAXTABLES 64
-#define MAXTHREADS 256
+#define NDB_MAXTHREADS 256
+/*
+ NDB_MAXTHREADS used to be just MAXTHREADS, which collides with a
+ #define from <sys/thread.h> on AIX (IBM compiler). We explicitly
+ #undef it here lest someone use it by habit and get really funny
+ results. K&R says we may #undef non-existent symbols, so let's go.
+*/
+#undef MAXTHREADS
#define MAXATTRSIZE 8000
static unsigned int tNoOfRecords;
diff --git a/storage/ndb/test/ndbapi/testBasic.cpp b/storage/ndb/test/ndbapi/testBasic.cpp
index 44c3d023169..952b5a50dc5 100644
--- a/storage/ndb/test/ndbapi/testBasic.cpp
+++ b/storage/ndb/test/ndbapi/testBasic.cpp
@@ -1290,17 +1290,7 @@ runDeleteRead(NDBT_Context* ctx, NDBT_Step* step){
NdbTransaction* pTrans = pNdb->startTransaction();
NdbOperation* pOp = pTrans->getNdbOperation(tab->getName());
pOp->deleteTuple();
- for(a = 0; a<tab->getNoOfColumns(); a++)
- {
- if (tab->getColumn(a)->getPrimaryKey() == true)
- {
- if(tmp.equalForAttr(pOp, a, 0) != 0)
- {
- ERR(pTrans->getNdbError());
- return NDBT_FAILED;
- }
- }
- }
+ tmp.equalForRow(pOp, loops);
// Define attributes to read
for(a = 0; a<tab->getNoOfColumns(); a++)
@@ -1313,6 +1303,30 @@ runDeleteRead(NDBT_Context* ctx, NDBT_Step* step){
pTrans->execute(Commit);
pTrans->close();
+
+ pTrans = pNdb->startTransaction();
+ pOp = pTrans->getNdbOperation(tab->getName());
+ pOp->insertTuple();
+ tmp.setValues(pOp, loops, 0);
+
+ pOp = pTrans->getNdbOperation(tab->getName());
+ pOp->deleteTuple();
+ tmp.equalForRow(pOp, loops);
+ for(a = 0; a<tab->getNoOfColumns(); a++)
+ {
+ if((row.attributeStore(a) = pOp->getValue(tab->getColumn(a)->getName())) == 0)
+ {
+ ERR(pTrans->getNdbError());
+ return NDBT_FAILED;
+ }
+ }
+ if (pTrans->execute(Commit) != 0)
+ {
+ ERR(pTrans->getNdbError());
+ return NDBT_FAILED;
+ }
+
+ pTrans->close();
}
return NDBT_OK;
@@ -1444,6 +1458,91 @@ runBug28073(NDBT_Context *ctx, NDBT_Step* step)
template class Vector<Uint64>;
+int
+runBug20535(NDBT_Context* ctx, NDBT_Step* step)
+{
+ Uint32 i;
+ Ndb* pNdb = GETNDB(step);
+ const NdbDictionary::Table * tab = ctx->getTab();
+ NdbDictionary::Dictionary * dict = pNdb->getDictionary();
+
+ bool null = false;
+ for (i = 0; i<tab->getNoOfColumns(); i++)
+ {
+ if (tab->getColumn(i)->getNullable())
+ {
+ null = true;
+ break;
+ }
+ }
+
+ if (!null)
+ return NDBT_OK;
+
+ HugoTransactions hugoTrans(* tab);
+ hugoTrans.loadTable(pNdb, 1);
+
+ NdbTransaction* pTrans = pNdb->startTransaction();
+ NdbOperation* pOp = pTrans->getNdbOperation(tab->getName());
+ pOp->deleteTuple();
+ hugoTrans.equalForRow(pOp, 0);
+ if (pTrans->execute(NoCommit) != 0)
+ return NDBT_FAILED;
+
+ pOp = pTrans->getNdbOperation(tab->getName());
+ pOp->insertTuple();
+ hugoTrans.equalForRow(pOp, 0);
+ for (i = 0; i<tab->getNoOfColumns(); i++)
+ {
+ if (!tab->getColumn(i)->getPrimaryKey() &&
+ !tab->getColumn(i)->getNullable())
+ {
+ hugoTrans.setValueForAttr(pOp, i, 0, 1);
+ }
+ }
+
+ if (pTrans->execute(Commit) != 0)
+ return NDBT_FAILED;
+
+ pTrans->close();
+
+ pTrans = pNdb->startTransaction();
+ pOp = pTrans->getNdbOperation(tab->getName());
+ pOp->readTuple();
+ hugoTrans.equalForRow(pOp, 0);
+ Vector<NdbRecAttr*> values;
+ for (i = 0; i<tab->getNoOfColumns(); i++)
+ {
+ if (!tab->getColumn(i)->getPrimaryKey() &&
+ tab->getColumn(i)->getNullable())
+ {
+ values.push_back(pOp->getValue(i));
+ }
+ }
+
+ if (pTrans->execute(Commit) != 0)
+ return NDBT_FAILED;
+
+ null = true;
+ for (i = 0; i<values.size(); i++)
+ {
+ if (!values[i]->isNULL())
+ {
+ null = false;
+ ndbout_c("column %s is not NULL", values[i]->getColumn()->getName());
+ }
+ }
+
+ pTrans->close();
+
+ if (null)
+ return NDBT_OK;
+ else
+ return NDBT_FAILED;
+}
+
+template class Vector<NdbRecAttr*>;
+
NDBT_TESTSUITE(testBasic);
TESTCASE("PkInsert",
"Verify that we can insert and delete from this table using PK"
@@ -1728,6 +1827,10 @@ TESTCASE("Bug28073",
"Infinite loop in lock queue" ){
STEP(runBug28073);
}
+TESTCASE("Bug20535",
+ "Verify what happens when we fill the db" ){
+ STEP(runBug20535);
+}
NDBT_TESTSUITE_END(testBasic);
#if 0
diff --git a/storage/ndb/test/ndbapi/testDict.cpp b/storage/ndb/test/ndbapi/testDict.cpp
index 9828cb768df..13c071f968e 100644
--- a/storage/ndb/test/ndbapi/testDict.cpp
+++ b/storage/ndb/test/ndbapi/testDict.cpp
@@ -2204,6 +2204,159 @@ runBug21755(NDBT_Context* ctx, NDBT_Step* step)
return NDBT_OK;
}
+static
+int
+create_tablespace(NdbDictionary::Dictionary* pDict,
+ const char * lgname,
+ const char * tsname,
+ const char * dfname)
+{
+ NdbDictionary::Tablespace ts;
+ ts.setName(tsname);
+ ts.setExtentSize(1024*1024);
+ ts.setDefaultLogfileGroup(lgname);
+
+ if(pDict->createTablespace(ts) != 0)
+ {
+ g_err << "Failed to create tablespace:"
+ << endl << pDict->getNdbError() << endl;
+ return NDBT_FAILED;
+ }
+
+ NdbDictionary::Datafile df;
+ df.setPath(dfname);
+ df.setSize(1*1024*1024);
+ df.setTablespace(tsname);
+
+ if(pDict->createDatafile(df) != 0)
+ {
+ g_err << "Failed to create datafile:"
+ << endl << pDict->getNdbError() << endl;
+ return NDBT_FAILED;
+ }
+ return 0;
+}
+
+int
+runBug24631(NDBT_Context* ctx, NDBT_Step* step)
+{
+ char tsname[256];
+ char dfname[256];
+ char lgname[256];
+ char ufname[256];
+ NdbRestarter res;
+
+ if (res.getNumDbNodes() < 2)
+ return NDBT_OK;
+
+ Ndb* pNdb = GETNDB(step);
+ NdbDictionary::Dictionary* pDict = pNdb->getDictionary();
+
+ NdbDictionary::Dictionary::List list;
+ if (pDict->listObjects(list) == -1)
+ return NDBT_FAILED;
+
+ const char * lgfound = 0;
+
+ for (Uint32 i = 0; i<list.count; i++)
+ {
+ switch(list.elements[i].type){
+ case NdbDictionary::Object::LogfileGroup:
+ lgfound = list.elements[i].name;
+ break;
+ default:
+ break;
+ }
+ if (lgfound)
+ break;
+ }
+
+ if (lgfound == 0)
+ {
+ BaseString::snprintf(lgname, sizeof(lgname), "LG-%u", rand());
+ NdbDictionary::LogfileGroup lg;
+
+ lg.setName(lgname);
+ lg.setUndoBufferSize(8*1024*1024);
+ if(pDict->createLogfileGroup(lg) != 0)
+ {
+ g_err << "Failed to create logfilegroup:"
+ << endl << pDict->getNdbError() << endl;
+ return NDBT_FAILED;
+ }
+
+ NdbDictionary::Undofile uf;
+ BaseString::snprintf(ufname, sizeof(ufname), "%s-%u", lgname, rand());
+ uf.setPath(ufname);
+ uf.setSize(2*1024*1024);
+ uf.setLogfileGroup(lgname);
+
+ if(pDict->createUndofile(uf) != 0)
+ {
+ g_err << "Failed to create undofile:"
+ << endl << pDict->getNdbError() << endl;
+ return NDBT_FAILED;
+ }
+ }
+ else
+ {
+ BaseString::snprintf(lgname, sizeof(lgname), "%s", lgfound);
+ }
+
+ BaseString::snprintf(tsname, sizeof(tsname), "TS-%u", rand());
+ BaseString::snprintf(dfname, sizeof(dfname), "%s-%u.dat", tsname, rand());
+
+ if (create_tablespace(pDict, lgname, tsname, dfname))
+ return NDBT_FAILED;
+
+
+ int node = res.getRandomNotMasterNodeId(rand());
+ res.restartOneDbNode(node, false, true, true);
+ NdbSleep_SecSleep(3);
+
+ if (pDict->dropDatafile(pDict->getDatafile(0, dfname)) != 0)
+ {
+ g_err << "Failed to drop datafile: " << pDict->getNdbError() << endl;
+ return NDBT_FAILED;
+ }
+
+ if (pDict->dropTablespace(pDict->getTablespace(tsname)) != 0)
+ {
+ g_err << "Failed to drop tablespace: " << pDict->getNdbError() << endl;
+ return NDBT_FAILED;
+ }
+
+ if (res.waitNodesNoStart(&node, 1))
+ return NDBT_FAILED;
+
+ res.startNodes(&node, 1);
+ if (res.waitClusterStarted())
+ return NDBT_FAILED;
+
+ if (create_tablespace(pDict, lgname, tsname, dfname))
+ return NDBT_FAILED;
+
+ if (pDict->dropDatafile(pDict->getDatafile(0, dfname)) != 0)
+ {
+ g_err << "Failed to drop datafile: " << pDict->getNdbError() << endl;
+ return NDBT_FAILED;
+ }
+
+ if (pDict->dropTablespace(pDict->getTablespace(tsname)) != 0)
+ {
+ g_err << "Failed to drop tablespace: " << pDict->getNdbError() << endl;
+ return NDBT_FAILED;
+ }
+
+ if (lgfound == 0)
+ {
+ if (pDict->dropLogfileGroup(pDict->getLogfileGroup(lgname)) != 0)
+ return NDBT_FAILED;
+ }
+
+ return NDBT_OK;
+}
+
struct RandSchemaOp
{
struct Obj
@@ -2707,6 +2860,10 @@ TESTCASE("DictRestart",
""){
INITIALIZER(runDictRestart);
}
+TESTCASE("Bug24631",
+ ""){
+ INITIALIZER(runBug24631);
+}
NDBT_TESTSUITE_END(testDict);
int main(int argc, const char** argv){
diff --git a/storage/ndb/test/ndbapi/testIndex.cpp b/storage/ndb/test/ndbapi/testIndex.cpp
index 7691f036a46..00e559c7a0f 100644
--- a/storage/ndb/test/ndbapi/testIndex.cpp
+++ b/storage/ndb/test/ndbapi/testIndex.cpp
@@ -1298,6 +1298,103 @@ runBug25059(NDBT_Context* ctx, NDBT_Step* step)
return res;
}
+int tcSaveINDX_test(NDBT_Context* ctx, NDBT_Step* step, int inject_err)
+{
+ int result= NDBT_OK;
+ Ndb* pNdb = GETNDB(step);
+ NdbDictionary::Dictionary * dict = pNdb->getDictionary();
+ const NdbDictionary::Index * idx = dict->getIndex(pkIdxName,
+ ctx->getTab()->getName());
+
+ HugoOperations ops(*ctx->getTab(), idx);
+
+ g_err << "Using INDEX: " << pkIdxName << endl;
+
+ NdbRestarter restarter;
+
+ int loops = ctx->getNumLoops();
+ const int rows = ctx->getNumRecords();
+ const int batchsize = ctx->getProperty("BatchSize", 1);
+
+ for(int bs=1; bs < loops; bs++)
+ {
+ int c= 0;
+ while (c++ < loops)
+ {
+ g_err << "BS " << bs << " LOOP #" << c << endl;
+
+ g_err << "inserting error on op#" << c << endl;
+
+ CHECK(ops.startTransaction(pNdb) == 0);
+ for(int i=1;i<=c;i++)
+ {
+ if(i==c)
+ {
+ if(restarter.insertErrorInAllNodes(inject_err)!=0)
+ {
+ g_err << "**** FAILED to insert error" << endl;
+ result= NDBT_FAILED;
+ break;
+ }
+ }
+ CHECK(ops.indexReadRecords(pNdb, pkIdxName, i,false,1) == 0);
+ if(i%bs==0 || i==c)
+ {
+ if(i<c)
+ {
+ if(ops.execute_NoCommit(pNdb, AO_IgnoreError)!=NDBT_OK)
+ {
+ g_err << "**** executeNoCommit should have succeeded" << endl;
+ result= NDBT_FAILED;
+ }
+ }
+ else
+ {
+ if(ops.execute_NoCommit(pNdb, AO_IgnoreError)!=289)
+ {
+ g_err << "**** executeNoCommit should have failed with 289"
+ << endl;
+ result= NDBT_FAILED;
+ }
+ g_err << "NdbError.code= " <<
+ ops.getTransaction()->getNdbError().code << endl;
+ break;
+ }
+ }
+ }
+
+ CHECK(ops.closeTransaction(pNdb) == 0);
+
+ if(restarter.insertErrorInAllNodes(0) != 0)
+ {
+ g_err << "**** Failed to error insert(0)" << endl;
+ return NDBT_FAILED;
+ }
+
+ CHECK(ops.startTransaction(pNdb) == 0);
+ if (ops.indexReadRecords(pNdb, pkIdxName,0,0,rows) != 0){
+ g_err << "**** Index read failed" << endl;
+ return NDBT_FAILED;
+ }
+ CHECK(ops.closeTransaction(pNdb) == 0);
+ }
+ }
+
+ return result;
+}
+
+int
+runBug28804(NDBT_Context* ctx, NDBT_Step* step)
+{
+ return tcSaveINDX_test(ctx, step, 8052);
+}
+
+int
+runBug28804_ATTRINFO(NDBT_Context* ctx, NDBT_Step* step)
+{
+ return tcSaveINDX_test(ctx, step, 8051);
+}
+
NDBT_TESTSUITE(testIndex);
TESTCASE("CreateAll",
"Test that we can create all various indexes on each table\n"
@@ -1629,6 +1726,27 @@ TESTCASE("Bug25059",
STEP(runBug25059);
FINALIZER(createPkIndex_Drop);
}
+TESTCASE("Bug28804",
+ "Test behaviour on out of TransactionBufferMemory for index lookup"){
+ TC_PROPERTY("LoggedIndexes", (unsigned)0);
+ INITIALIZER(runClearTable);
+ INITIALIZER(createPkIndex);
+ INITIALIZER(runLoadTable);
+ STEP(runBug28804);
+ FINALIZER(createPkIndex_Drop);
+ FINALIZER(runClearTable);
+}
+TESTCASE("Bug28804_ATTRINFO",
+ "Test behaviour on out of TransactionBufferMemory for index lookup"
+ " in saveINDXATTRINFO"){
+ TC_PROPERTY("LoggedIndexes", (unsigned)0);
+ INITIALIZER(runClearTable);
+ INITIALIZER(createPkIndex);
+ INITIALIZER(runLoadTable);
+ STEP(runBug28804_ATTRINFO);
+ FINALIZER(createPkIndex_Drop);
+ FINALIZER(runClearTable);
+}
NDBT_TESTSUITE_END(testIndex);
int main(int argc, const char** argv){
diff --git a/storage/ndb/test/ndbapi/testIndexStat.cpp b/storage/ndb/test/ndbapi/testIndexStat.cpp
index 7c69361a732..0e15cdd80d1 100644
--- a/storage/ndb/test/ndbapi/testIndexStat.cpp
+++ b/storage/ndb/test/ndbapi/testIndexStat.cpp
@@ -1210,8 +1210,8 @@ struct V_rir {
static double data(const Range& range) { return (double)range.errpct; }
};
-template static void computestat<Key, V_rpk>(Stat& stat);
-template static void computestat<Range, V_rir>(Stat& stat);
+template void computestat<Key, V_rpk>(Stat& stat);
+template void computestat<Range, V_rir>(Stat& stat);
static Stat g_stat_rpk; // summaries over loops
static Stat g_stat_rir;
@@ -1297,43 +1297,43 @@ my_long_options[] =
{
NDB_STD_OPTS("testIndexStat"),
{ "loglevel", 1001, "Logging level in this program 0-3 (default 0)",
- (gptr*)&g_opts.loglevel, (gptr*)&g_opts.loglevel, 0,
+ (uchar **)&g_opts.loglevel, (uchar **)&g_opts.loglevel, 0,
GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "seed", 1002, "Random seed (0=loop number, default -1=random)",
- (gptr*)&g_opts.seed, (gptr*)&g_opts.seed, 0,
+ (uchar **)&g_opts.seed, (uchar **)&g_opts.seed, 0,
GET_INT, REQUIRED_ARG, -1, 0, 0, 0, 0, 0 },
{ "loop", 1003, "Number of test loops (default 1, 0=forever)",
- (gptr*)&g_opts.loop, (gptr*)&g_opts.loop, 0,
+ (uchar **)&g_opts.loop, (uchar **)&g_opts.loop, 0,
GET_INT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0 },
{ "rows", 1004, "Number of rows (default 100000)",
- (gptr*)&g_opts.rows, (gptr*)&g_opts.rows, 0,
+ (uchar **)&g_opts.rows, (uchar **)&g_opts.rows, 0,
GET_UINT, REQUIRED_ARG, 100000, 0, 0, 0, 0, 0 },
{ "ops", 1005, "Number of index scans per loop (default 1000)",
- (gptr*)&g_opts.ops, (gptr*)&g_opts.ops, 0,
+ (uchar **)&g_opts.ops, (uchar **)&g_opts.ops, 0,
GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0 },
{ "dupkeys", 1006, "Pct records per key (min 100, default 1000)",
- (gptr*)&g_opts.dupkeys, (gptr*)&g_opts.dupkeys, 0,
+ (uchar **)&g_opts.dupkeys, (uchar **)&g_opts.dupkeys, 0,
GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0 },
{ "scanpct", 1007, "Preferred max pct of total rows per scan (default 5)",
- (gptr*)&g_opts.scanpct, (gptr*)&g_opts.scanpct, 0,
+ (uchar **)&g_opts.scanpct, (uchar **)&g_opts.scanpct, 0,
GET_UINT, REQUIRED_ARG, 5, 0, 0, 0, 0, 0 },
{ "nullkeys", 1008, "Pct nulls in each key attribute (default 10)",
- (gptr*)&g_opts.nullkeys, (gptr*)&g_opts.nullkeys, 0,
+ (uchar **)&g_opts.nullkeys, (uchar **)&g_opts.nullkeys, 0,
GET_UINT, REQUIRED_ARG, 10, 0, 0, 0, 0, 0 },
{ "eqscans", 1009, "Pct scans for partial/full equality (default 50)",
- (gptr*)&g_opts.eqscans, (gptr*)&g_opts.eqscans, 0,
+ (uchar **)&g_opts.eqscans, (uchar **)&g_opts.eqscans, 0,
GET_UINT, REQUIRED_ARG, 50, 0, 0, 0, 0, 0 },
{ "dupscans", 1010, "Pct scans using same bounds (default 10)",
- (gptr*)&g_opts.dupscans, (gptr*)&g_opts.dupscans, 0,
+ (uchar **)&g_opts.dupscans, (uchar **)&g_opts.dupscans, 0,
GET_UINT, REQUIRED_ARG, 10, 0, 0, 0, 0, 0 },
{ "keeptable", 1011, "Use existing table and data if any and do not drop",
- (gptr*)&g_opts.keeptable, (gptr*)&g_opts.keeptable, 0,
+ (uchar **)&g_opts.keeptable, (uchar **)&g_opts.keeptable, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "no-extra-checks", 1012, "Omit expensive consistency checks",
- (gptr*)&g_opts.nochecks, (gptr*)&g_opts.nochecks, 0,
+ (uchar **)&g_opts.nochecks, (uchar **)&g_opts.nochecks, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "abort-on-error", 1013, "Dump core on any error",
- (gptr*)&g_opts.abort, (gptr*)&g_opts.abort, 0,
+ (uchar **)&g_opts.abort, (uchar **)&g_opts.abort, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0,
0, 0, 0,
diff --git a/storage/ndb/test/ndbapi/testMgm.cpp b/storage/ndb/test/ndbapi/testMgm.cpp
index cc074087bdb..e43972c8c29 100644
--- a/storage/ndb/test/ndbapi/testMgm.cpp
+++ b/storage/ndb/test/ndbapi/testMgm.cpp
@@ -212,6 +212,76 @@ int runTestApiSession(NDBT_Context* ctx, NDBT_Step* step)
}
}
+int runTestApiConnectTimeout(NDBT_Context* ctx, NDBT_Step* step)
+{
+ char *mgm= ctx->getRemoteMgm();
+ int result= NDBT_FAILED;
+ int cc= 0;
+ int mgmd_nodeid= 0;
+ ndb_mgm_reply reply;
+
+ NdbMgmHandle h;
+ h= ndb_mgm_create_handle();
+ ndb_mgm_set_connectstring(h, mgm);
+
+ ndbout << "TEST connect timeout" << endl;
+
+ ndb_mgm_set_timeout(h, 3000);
+
+ struct timeval tstart, tend;
+ int secs;
+ timerclear(&tstart);
+ timerclear(&tend);
+ gettimeofday(&tstart,NULL);
+
+ ndb_mgm_connect(h,0,0,0);
+
+ gettimeofday(&tend,NULL);
+
+ secs= tend.tv_sec - tstart.tv_sec;
+ ndbout << "Took about: " << secs <<" seconds"<<endl;
+
+ if(secs < 4)
+ result= NDBT_OK;
+ else
+ goto done;
+
+ ndb_mgm_set_connectstring(h, mgm);
+
+ ndbout << "TEST connect timeout" << endl;
+
+ ndb_mgm_destroy_handle(&h);
+
+ h= ndb_mgm_create_handle();
+ ndb_mgm_set_connectstring(h, "1.1.1.1");
+
+ ndbout << "TEST connect timeout (invalid host)" << endl;
+
+ ndb_mgm_set_timeout(h, 3000);
+
+ timerclear(&tstart);
+ timerclear(&tend);
+ gettimeofday(&tstart,NULL);
+
+ ndb_mgm_connect(h,0,0,0);
+
+ gettimeofday(&tend,NULL);
+
+ secs= tend.tv_sec - tstart.tv_sec;
+ ndbout << "Took about: " << secs <<" seconds"<<endl;
+
+ if(secs < 4)
+ result= NDBT_OK;
+ else
+ result= NDBT_FAILED;
+
+done:
+ ndb_mgm_disconnect(h);
+ ndb_mgm_destroy_handle(&h);
+
+ return result;
+}
+
int runTestApiTimeoutBasic(NDBT_Context* ctx, NDBT_Step* step)
{
char *mgm= ctx->getRemoteMgm();
@@ -728,6 +798,11 @@ TESTCASE("ApiSessionFailure",
INITIALIZER(runTestApiSession);
}
+TESTCASE("ApiConnectTimeout",
+ "Connect timeout tests for MGMAPI"){
+ INITIALIZER(runTestApiConnectTimeout);
+
+}
TESTCASE("ApiTimeoutBasic",
"Basic timeout tests for MGMAPI"){
INITIALIZER(runTestApiTimeoutBasic);
diff --git a/storage/ndb/test/ndbapi/testNdbApi.cpp b/storage/ndb/test/ndbapi/testNdbApi.cpp
index f731dc3601f..c05a2417bca 100644
--- a/storage/ndb/test/ndbapi/testNdbApi.cpp
+++ b/storage/ndb/test/ndbapi/testNdbApi.cpp
@@ -1588,6 +1588,36 @@ int runTestExecuteAsynch(NDBT_Context* ctx, NDBT_Step* step){
template class Vector<NdbScanOperation*>;
+int
+runBug28443(NDBT_Context* ctx, NDBT_Step* step)
+{
+ int result = NDBT_OK;
+ int records = ctx->getNumRecords();
+
+ NdbRestarter restarter;
+
+ restarter.insertErrorInAllNodes(9003);
+
+ for (Uint32 i = 0; i<ctx->getNumLoops(); i++)
+ {
+ HugoTransactions hugoTrans(*ctx->getTab());
+ if (hugoTrans.loadTable(GETNDB(step), records, 2048) != 0)
+ {
+ result = NDBT_FAILED;
+ goto done;
+ }
+ if (runClearTable(ctx, step) != 0)
+ {
+ result = NDBT_FAILED;
+ goto done;
+ }
+ }
+
+done:
+ restarter.insertErrorInAllNodes(9003);
+
+ return result;
+}
NDBT_TESTSUITE(testNdbApi);
TESTCASE("MaxNdb",
@@ -1689,6 +1719,10 @@ TESTCASE("ExecuteAsynch",
"Check that executeAsync() works (BUG#27495)\n"){
INITIALIZER(runTestExecuteAsynch);
}
+TESTCASE("Bug28443",
+ ""){
+ INITIALIZER(runBug28443);
+}
NDBT_TESTSUITE_END(testNdbApi);
int main(int argc, const char** argv){
diff --git a/storage/ndb/test/ndbapi/testNodeRestart.cpp b/storage/ndb/test/ndbapi/testNodeRestart.cpp
index 85dbc2aab2a..99b72699762 100644
--- a/storage/ndb/test/ndbapi/testNodeRestart.cpp
+++ b/storage/ndb/test/ndbapi/testNodeRestart.cpp
@@ -963,12 +963,62 @@ int runBug24717(NDBT_Context* ctx, NDBT_Step* step){
restarter.startNodes(&nodeId, 1);
- for (Uint32 i = 0; i < 100; i++)
- {
- hugoTrans.pkReadRecords(pNdb, 100, 1, NdbOperation::LM_CommittedRead);
- }
-
+ do {
+ for (Uint32 i = 0; i < 100; i++)
+ {
+ hugoTrans.pkReadRecords(pNdb, 100, 1, NdbOperation::LM_CommittedRead);
+ }
+ } while (restarter.waitClusterStarted(5) != 0);
+ }
+
+ return NDBT_OK;
+}
+
+int
+runBug29364(NDBT_Context* ctx, NDBT_Step* step){
+ int result = NDBT_OK;
+ int loops = ctx->getNumLoops();
+ int records = ctx->getNumRecords();
+ NdbRestarter restarter;
+ Ndb* pNdb = GETNDB(step);
+
+ HugoTransactions hugoTrans(*ctx->getTab());
+
+ if (restarter.getNumDbNodes() < 4)
+ return NDBT_OK;
+
+ int dump0[] = { 9000, 0 } ;
+ int dump1[] = { 9001, 0 } ;
+ Uint32 ownNode = refToNode(pNdb->getReference());
+ dump0[1] = ownNode;
+
+ for (; loops; loops --)
+ {
+ int node0 = restarter.getDbNodeId(rand() % restarter.getNumDbNodes());
+ int node1 = restarter.getRandomNodeOtherNodeGroup(node0, rand());
+
+ restarter.restartOneDbNode(node0, false, true, true);
+ restarter.waitNodesNoStart(&node0, 1);
+ restarter.startNodes(&node0, 1);
restarter.waitClusterStarted();
+
+ restarter.restartOneDbNode(node1, false, true, true);
+ restarter.waitNodesNoStart(&node1, 1);
+ if (restarter.dumpStateOneNode(node1, dump0, 2))
+ return NDBT_FAILED;
+
+ restarter.startNodes(&node1, 1);
+
+ do {
+
+ for (Uint32 i = 0; i < 100; i++)
+ {
+ hugoTrans.pkReadRecords(pNdb, 100, 1, NdbOperation::LM_CommittedRead);
+ }
+ } while (restarter.waitClusterStarted(5) != 0);
+
+ if (restarter.dumpStateOneNode(node1, dump1, 1))
+ return NDBT_FAILED;
}
return NDBT_OK;
@@ -1629,6 +1679,85 @@ runBug28023(NDBT_Context* ctx, NDBT_Step* step)
return NDBT_FAILED;
}
}
+
+ return NDBT_OK;
+}
+
+
+int
+runBug28717(NDBT_Context* ctx, NDBT_Step* step)
+{
+ int result = NDBT_OK;
+ int loops = ctx->getNumLoops();
+ int records = ctx->getNumRecords();
+ Ndb* pNdb = GETNDB(step);
+ NdbRestarter res;
+
+ if (res.getNumDbNodes() < 4)
+ {
+ return NDBT_OK;
+ }
+
+ int master = res.getMasterNodeId();
+ int node0 = res.getRandomNodeOtherNodeGroup(master, rand());
+ int node1 = res.getRandomNodeSameNodeGroup(node0, rand());
+
+ ndbout_c("master: %d node0: %d node1: %d", master, node0, node1);
+
+ if (res.restartOneDbNode(node0, false, true, true))
+ {
+ return NDBT_FAILED;
+ }
+
+ {
+ int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_CHECKPOINT, 0 };
+ NdbLogEventHandle handle =
+ ndb_mgm_create_logevent_handle(res.handle, filter);
+
+
+ int dump[] = { DumpStateOrd::DihStartLcpImmediately };
+ struct ndb_logevent event;
+
+ for (Uint32 i = 0; i<3; i++)
+ {
+ res.dumpStateOneNode(master, dump, 1);
+ while(ndb_logevent_get_next(handle, &event, 0) >= 0 &&
+ event.type != NDB_LE_LocalCheckpointStarted);
+ while(ndb_logevent_get_next(handle, &event, 0) >= 0 &&
+ event.type != NDB_LE_LocalCheckpointCompleted);
+ }
+ }
+
+ if (res.waitNodesNoStart(&node0, 1))
+ return NDBT_FAILED;
+
+ int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 };
+
+ if (res.dumpStateOneNode(node0, val2, 2))
+ return NDBT_FAILED;
+
+ if (res.insertErrorInNode(node0, 5010))
+ return NDBT_FAILED;
+
+ if (res.insertErrorInNode(node1, 1001))
+ return NDBT_FAILED;
+
+ if (res.startNodes(&node0, 1))
+ return NDBT_FAILED;
+
+ NdbSleep_SecSleep(3);
+
+ if (res.insertErrorInNode(node1, 0))
+ return NDBT_FAILED;
+
+ if (res.waitNodesNoStart(&node0, 1))
+ return NDBT_FAILED;
+
+ if (res.startNodes(&node0, 1))
+ return NDBT_FAILED;
+
+ if (res.waitClusterStarted())
+ return NDBT_FAILED;
return NDBT_OK;
}
@@ -1993,6 +2122,12 @@ TESTCASE("Bug27466", ""){
TESTCASE("Bug28023", ""){
INITIALIZER(runBug28023);
}
+TESTCASE("Bug28717", ""){
+ INITIALIZER(runBug28717);
+}
+TESTCASE("Bug29364", ""){
+ INITIALIZER(runBug29364);
+}
NDBT_TESTSUITE_END(testNodeRestart);
int main(int argc, const char** argv){
diff --git a/storage/ndb/test/ndbapi/testOperations.cpp b/storage/ndb/test/ndbapi/testOperations.cpp
index 38d6e817637..95be2b988e1 100644
--- a/storage/ndb/test/ndbapi/testOperations.cpp
+++ b/storage/ndb/test/ndbapi/testOperations.cpp
@@ -99,11 +99,6 @@ OperationTestCase matrix[] = {
break; }
#define C3(b) if (!(b)) { \
- g_err << "ERR: "<< step->getName() \
- << " failed on line " << __LINE__ << endl; \
- abort(); return NDBT_FAILED; }
-
-#define C3(b) if (!(b)) { \
g_err << "ERR: failed on line " << __LINE__ << endl; \
return NDBT_FAILED; }
diff --git a/storage/ndb/test/ndbapi/testScanFilter.cpp b/storage/ndb/test/ndbapi/testScanFilter.cpp
index ac0b0ed2c4d..dfe1097bd25 100644
--- a/storage/ndb/test/ndbapi/testScanFilter.cpp
+++ b/storage/ndb/test/ndbapi/testScanFilter.cpp
@@ -49,7 +49,15 @@ const char COL_LEN = 7;
* there are six columns, 'i', 'j', 'k', 'l', 'm', 'n', and each on is equal to 1 or 1,
* Since each tuple should be unique in this case, then TUPLE_NUM = 2 power 6 = 64
*/
-const int TUPLE_NUM = (int)pow(2, COL_LEN-1);
+#ifdef _AIX
+/*
+ IBM xlC_r breaks on the initialization with pow():
+ "The expression must be an integral constant expression."
+*/
+const int TUPLE_NUM = 64;
+#else
+const int TUPLE_NUM = (int)pow(2, COL_LEN-1);
+#endif
/*
* the recursive level of random scan filter, can
@@ -479,7 +487,7 @@ int get_column_id(char ch)
*/
bool check_col_equal_one(int tuple_no, int col_id)
{
- int i = (int)pow(2, 6 - col_id);
+ int i = (int)pow((double)2, (double)(6 - col_id));
int j = tuple_no / i;
if(j % 2)
return true;
diff --git a/storage/ndb/test/ndbapi/testSystemRestart.cpp b/storage/ndb/test/ndbapi/testSystemRestart.cpp
index bd5cd3dd3c8..901c0e35568 100644
--- a/storage/ndb/test/ndbapi/testSystemRestart.cpp
+++ b/storage/ndb/test/ndbapi/testSystemRestart.cpp
@@ -1219,6 +1219,81 @@ runBug24664(NDBT_Context* ctx, NDBT_Step* step)
return result;
}
+int
+runBug29167(NDBT_Context* ctx, NDBT_Step* step)
+{
+ int result = NDBT_OK;
+ NdbRestarter restarter;
+ Ndb* pNdb = GETNDB(step);
+ const Uint32 nodeCount = restarter.getNumDbNodes();
+
+ if (nodeCount < 2)
+ return NDBT_OK;
+
+ int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_CHECKPOINT, 0 };
+ NdbLogEventHandle handle =
+ ndb_mgm_create_logevent_handle(restarter.handle, filter);
+
+ struct ndb_logevent event;
+ int master = restarter.getMasterNodeId();
+ do {
+ int node1 = restarter.getRandomNodeOtherNodeGroup(master, rand());
+ int node2 = restarter.getRandomNodeSameNodeGroup(node1, rand());
+
+ int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 };
+ restarter.dumpStateAllNodes(val2, 2);
+ int dump[] = { DumpStateOrd::DihSetTimeBetweenGcp, 30000 };
+ restarter.dumpStateAllNodes(dump, 2);
+
+ while(ndb_logevent_get_next(handle, &event, 0) >= 0 &&
+ event.type != NDB_LE_GlobalCheckpointCompleted);
+
+ CHECK(restarter.insertErrorInAllNodes(932) == 0);
+
+ CHECK(restarter.insertErrorInNode(node1, 7183) == 0);
+ CHECK(restarter.insertErrorInNode(node2, 7183) == 0);
+
+ CHECK(restarter.waitClusterNoStart() == 0);
+ restarter.startAll();
+ CHECK(restarter.waitClusterStarted() == 0);
+ } while(false);
+
+ return result;
+}
+
+int
+runBug28770(NDBT_Context* ctx, NDBT_Step* step) {
+ Ndb* pNdb = GETNDB(step);
+ NdbRestarter restarter;
+ int result = NDBT_OK;
+ int count = 0;
+ Uint32 i = 0;
+ Uint32 loops = ctx->getNumLoops();
+ int records = ctx->getNumRecords();
+ UtilTransactions utilTrans(*ctx->getTab());
+ HugoTransactions hugoTrans(*ctx->getTab());
+
+ g_info << "Loading records..." << endl; hugoTrans.loadTable(pNdb,
+ records);
+
+
+ while(i<=loops && result != NDBT_FAILED){
+ g_info << "Loop " << i << "/"<< loops <<" started" << endl;
+ CHECK(restarter.restartAll(false, true, false) == 0);
+ NdbSleep_SecSleep(3);
+ CHECK(restarter.waitClusterNoStart() == 0);
+ restarter.insertErrorInAllNodes(6007);
+ CHECK(restarter.startAll()== 0);
+ CHECK(restarter.waitClusterStarted() == 0);
+ CHECK(utilTrans.selectCount(pNdb, 64, &count) == 0);
+ CHECK(count == records);
+ i++;
+ }
+ ndbout << " runBug28770 finished" << endl;
+ return result;
+}
+
+
NDBT_TESTSUITE(testSystemRestart);
TESTCASE("SR1",
"Basic system restart test. Focus on testing restart from REDO log.\n"
@@ -1399,6 +1474,26 @@ TESTCASE("Bug24664",
STEP(runBug24664);
FINALIZER(runClearTable);
}
+TESTCASE("Bug29167", "")
+{
+ INITIALIZER(runWaitStarted);
+ STEP(runBug29167);
+}
+TESTCASE("Bug28770",
+ "Check readTableFile1 fails, readTableFile2 succeeds\n"
+ "1. Restart all node -nostart\n"
+ "2. Insert error 6100 into all nodes\n"
+ "3. Start all nodes\n"
+ "4. Ensure cluster start\n"
+ "5. Read and verify reocrds\n"
+ "6. Repeat until looping is completed\n"){
+ INITIALIZER(runWaitStarted);
+ INITIALIZER(runClearTable);
+ STEP(runBug28770);
+ FINALIZER(runClearTable);
+}
+
+
NDBT_TESTSUITE_END(testSystemRestart);
int main(int argc, const char** argv){
diff --git a/storage/ndb/test/ndbapi/test_event_merge.cpp b/storage/ndb/test/ndbapi/test_event_merge.cpp
index 662b1eb6f4c..d40b985adc2 100644
--- a/storage/ndb/test/ndbapi/test_event_merge.cpp
+++ b/storage/ndb/test/ndbapi/test_event_merge.cpp
@@ -2184,57 +2184,57 @@ my_long_options[] =
{
NDB_STD_OPTS("test_event_merge"),
{ "abort-on-error", 1001, "Do abort() on any error",
- (gptr*)&g_opts.abort_on_error, (gptr*)&g_opts.abort_on_error, 0,
+ (uchar **)&g_opts.abort_on_error, (uchar **)&g_opts.abort_on_error, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "loglevel", 1002, "Logging level in this program 0-3 (default 0)",
- (gptr*)&g_opts.loglevel, (gptr*)&g_opts.loglevel, 0,
+ (uchar **)&g_opts.loglevel, (uchar **)&g_opts.loglevel, 0,
GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "loop", 1003, "Number of test loops (default 5, 0=forever)",
- (gptr*)&g_opts.loop, (gptr*)&g_opts.loop, 0,
+ (uchar **)&g_opts.loop, (uchar **)&g_opts.loop, 0,
GET_INT, REQUIRED_ARG, 5, 0, 0, 0, 0, 0 },
{ "maxops", 1004, "Approx number of PK operations per table (default 1000)",
- (gptr*)&g_opts.maxops, (gptr*)&g_opts.maxops, 0,
+ (uchar **)&g_opts.maxops, (uchar **)&g_opts.maxops, 0,
GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0 },
{ "maxpk", 1005, "Number of different PK values (default 10, max 1000)",
- (gptr*)&g_opts.maxpk, (gptr*)&g_opts.maxpk, 0,
+ (uchar **)&g_opts.maxpk, (uchar **)&g_opts.maxpk, 0,
GET_UINT, REQUIRED_ARG, 10, 0, 0, 0, 0, 0 },
{ "maxtab", 1006, "Number of tables (default 10, max 100)",
- (gptr*)&g_opts.maxtab, (gptr*)&g_opts.maxtab, 0,
+ (uchar **)&g_opts.maxtab, (uchar **)&g_opts.maxtab, 0,
GET_INT, REQUIRED_ARG, 10, 0, 0, 0, 0, 0 },
{ "no-blobs", 1007, "Omit blob attributes (5.0: true)",
- (gptr*)&g_opts.no_blobs, (gptr*)&g_opts.no_blobs, 0,
+ (uchar **)&g_opts.no_blobs, (uchar **)&g_opts.no_blobs, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "no-implicit-nulls", 1008, "Insert must include all attrs"
" i.e. no implicit NULLs",
- (gptr*)&g_opts.no_implicit_nulls, (gptr*)&g_opts.no_implicit_nulls, 0,
+ (uchar **)&g_opts.no_implicit_nulls, (uchar **)&g_opts.no_implicit_nulls, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "no-missing-update", 1009, "Update must include all non-PK attrs",
- (gptr*)&g_opts.no_missing_update, (gptr*)&g_opts.no_missing_update, 0,
+ (uchar **)&g_opts.no_missing_update, (uchar **)&g_opts.no_missing_update, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "no-multiops", 1010, "Allow only 1 operation per commit",
- (gptr*)&g_opts.no_multiops, (gptr*)&g_opts.no_multiops, 0,
+ (uchar **)&g_opts.no_multiops, (uchar **)&g_opts.no_multiops, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "no-nulls", 1011, "Create no NULL values",
- (gptr*)&g_opts.no_nulls, (gptr*)&g_opts.no_nulls, 0,
+ (uchar **)&g_opts.no_nulls, (uchar **)&g_opts.no_nulls, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "one-blob", 1012, "Only one blob attribute (default 2)",
- (gptr*)&g_opts.one_blob, (gptr*)&g_opts.one_blob, 0,
+ (uchar **)&g_opts.one_blob, (uchar **)&g_opts.one_blob, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "opstring", 1013, "Operations to run e.g. idiucdc (c is commit) or"
" iuuc:uudc (the : separates loops)",
- (gptr*)&g_opts.opstring, (gptr*)&g_opts.opstring, 0,
+ (uchar **)&g_opts.opstring, (uchar **)&g_opts.opstring, 0,
GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "seed", 1014, "Random seed (0=loop number, default -1=random)",
- (gptr*)&g_opts.seed, (gptr*)&g_opts.seed, 0,
+ (uchar **)&g_opts.seed, (uchar **)&g_opts.seed, 0,
GET_INT, REQUIRED_ARG, -1, 0, 0, 0, 0, 0 },
{ "separate-events", 1015, "Do not combine events per GCI (5.0: true)",
- (gptr*)&g_opts.separate_events, (gptr*)&g_opts.separate_events, 0,
+ (uchar **)&g_opts.separate_events, (uchar **)&g_opts.separate_events, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "tweak", 1016, "Whatever the source says",
- (gptr*)&g_opts.tweak, (gptr*)&g_opts.tweak, 0,
+ (uchar **)&g_opts.tweak, (uchar **)&g_opts.tweak, 0,
GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "use-table", 1017, "Use existing tables",
- (gptr*)&g_opts.use_table, (gptr*)&g_opts.use_table, 0,
+ (uchar **)&g_opts.use_table, (uchar **)&g_opts.use_table, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0,
0, 0, 0,
diff --git a/storage/ndb/test/odbc/SQL99_test/SQL99_test.cpp b/storage/ndb/test/odbc/SQL99_test/SQL99_test.cpp
index 039a77f4d53..fb77220773d 100644
--- a/storage/ndb/test/odbc/SQL99_test/SQL99_test.cpp
+++ b/storage/ndb/test/odbc/SQL99_test/SQL99_test.cpp
@@ -27,7 +27,14 @@ using namespace std; //
#define MAXROW 64
#define DEFROW 8
-#define MAXTHREADS 24
+/*
+ NDB_MAXTHREADS used to be just MAXTHREADS, which collides with a
+ #define from <sys/thread.h> on AIX (IBM compiler). We explicitly
+ #undef it here lest someone use it by habit and get really funny
+ results. K&R says we may #undef non-existent symbols, so let's go.
+*/
+#undef MAXTHREADS
+#define NDB_MAXTHREADS 24
#define DEFTHREADS 2
#define MAXTABLES 16
@@ -83,7 +90,7 @@ int main(int argc, char* argv[]){
char* szTableNames = (char*)malloc(sizeof(char)*nNoOfTables*MAX_TABLE_NAME) ;
memset(szTableNames, 0, sizeof(char)*nNoOfTables*MAX_TABLE_NAME) ;
- UintPtr pThreadHandles[MAXTHREADS] = { NULL } ;
+ UintPtr pThreadHandles[NDB_MAXTHREADS] = { NULL } ;
AssignTableNames(szTableNames, nNoOfTables) ;
@@ -313,7 +320,7 @@ void ParseArguments(int argc, const char** argv){
if (strcmp(argv[i], "-t") == 0)
{
nNoOfThreads = atoi(argv[i+1]);
- if ((nNoOfThreads < 1) || (nNoOfThreads > MAXTHREADS))
+ if ((nNoOfThreads < 1) || (nNoOfThreads > NDB_MAXTHREADS))
nNoOfThreads = DEFTHREADS ;
}
else if (strcmp(argv[i], "-c") == 0)
diff --git a/storage/ndb/test/run-test/Makefile.am b/storage/ndb/test/run-test/Makefile.am
index d6c6536cfc8..65aa62d11f0 100644
--- a/storage/ndb/test/run-test/Makefile.am
+++ b/storage/ndb/test/run-test/Makefile.am
@@ -23,7 +23,7 @@ include $(top_srcdir)/storage/ndb/config/type_ndbapitools.mk.am
test_PROGRAMS = atrt
test_DATA=daily-basic-tests.txt daily-devel-tests.txt 16node-tests.txt \
conf-ndbmaster.cnf \
- conf-dl145a.cnf test-tests.txt
+ conf-dl145a.cnf test-tests.txt conf-test.cnf
test_SCRIPTS=atrt-analyze-result.sh atrt-gather-result.sh atrt-setup.sh \
atrt-clear-result.sh autotest-run.sh
@@ -48,7 +48,7 @@ atrt_LDFLAGS = -static @ndb_bin_am_ldflags@
wrappersdir=$(prefix)/bin
wrappers_SCRIPTS=atrt-testBackup atrt-mysql-test-run
-EXTRA_DIST = $(test_DATA) $(test_SCRIPTS) $(wrappers_SCRIPTS) README.ATRT
+EXTRA_DIST = $(test_DATA) $(test_SCRIPTS) $(wrappers_SCRIPTS) README.ATRT atrt.hpp
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/storage/ndb/test/run-test/autotest-boot.sh b/storage/ndb/test/run-test/autotest-boot.sh
index 31f611460ec..1df3a26cc8a 100644
--- a/storage/ndb/test/run-test/autotest-boot.sh
+++ b/storage/ndb/test/run-test/autotest-boot.sh
@@ -24,7 +24,10 @@ verbose=0
do_clone=yes
build=yes
+tag=
conf=
+extra_args=
+extra_clone=
LOCK=$HOME/.autotest-lock
############################
@@ -40,6 +43,8 @@ do
--clone=*) clone=`echo $1 | sed s/--clone=//`;;
--version) echo $VERSION; exit;;
--conf=*) conf=`echo $1 | sed s/--conf=//`;;
+ --tag=*) tag=`echo $1 | sed s/--tag=//`;;
+ --*) echo "Unknown arg: $1";;
*) RUN=$*;;
esac
shift
@@ -52,14 +57,20 @@ done
#################################
if [ -z "$conf" ]
then
- conf=`pwd`/autotest.conf
+ if [ -f "`pwd`/autotest.conf" ]
+ then
+ conf="`pwd`/autotest.conf"
+ elif [ -f "$HOME/autotest.conf" ]
+ then
+ conf="$HOME/autotest.conf"
+ fi
fi
if [ -f $conf ]
then
. $conf
else
- echo "Can't find config file: $conf"
+ echo "Can't find config file: >$conf<"
exit
fi
@@ -92,7 +103,7 @@ fi
# Setup the clone source location #
####################################
-src_clone=$src_clone_base-$clone
+src_clone=${src_clone_base}${clone}
#######################################
# Check to see if the lock file exists#
@@ -125,7 +136,14 @@ fi
# You can add more to this path#
################################
-dst_place=${build_dir}/clone-mysql-$clone-$DATE.$$
+if [ -z "$tag" ]
+then
+ dst_place=${build_dir}/clone-$clone-$DATE.$$
+else
+ dst_place=${build_dir}/clone-$tag-$DATE.$$
+ extra_args="$extra_args --clone=$tag"
+ extra_clone="-r$tag"
+fi
#########################################
# Delete source and pull down the latest#
@@ -134,7 +152,12 @@ dst_place=${build_dir}/clone-mysql-$clone-$DATE.$$
if [ "$do_clone" ]
then
rm -rf $dst_place
- bk clone $src_clone $dst_place
+ if [ `echo $src_clone | grep -c 'file:\/\/'` = 1 ]
+ then
+ bk clone -l $extra_clone $src_clone $dst_place
+ else
+ bk clone $extra_clone $src_clone $dst_place
+ fi
fi
##########################################
@@ -156,7 +179,7 @@ fi
################################
script=$install_dir/mysql-test/ndb/autotest-run.sh
-$script $save_args --conf=$conf --install-dir=$install_dir --suite=$RUN --nolock
+sh -x $script $save_args --conf=$conf --install-dir=$install_dir --suite=$RUN --nolock $extra_args
if [ "$build" ]
then
diff --git a/storage/ndb/test/run-test/autotest-run.sh b/storage/ndb/test/run-test/autotest-run.sh
index 34c3fe53949..b543cd1efb9 100644
--- a/storage/ndb/test/run-test/autotest-run.sh
+++ b/storage/ndb/test/run-test/autotest-run.sh
@@ -216,8 +216,8 @@ fi
# Make directories needed
p=`pwd`
-run_dir=$install_dir/run-$RUN-mysql-$clone-$target
-res_dir=$base_dir/result-$RUN-mysql-$clone-$target/$DATE
+run_dir=$install_dir/run-$RUN-$clone-$target
+res_dir=$base_dir/result-$RUN-$clone-$target/$DATE
tar_dir=$base_dir/saved-results
mkdir -p $run_dir $res_dir $tar_dir
@@ -246,7 +246,7 @@ cd $res_dir
echo "date=$DATE" > info.txt
echo "suite=$RUN" >> info.txt
-echo "clone=mysql-$clone" >> info.txt
+echo "clone=$clone" >> info.txt
echo "arch=$target" >> info.txt
find . | xargs chmod ugo+r
diff --git a/storage/ndb/test/run-test/conf-dl145a.cnf b/storage/ndb/test/run-test/conf-dl145a.cnf
index ea344f1a62a..5f61bee755d 100644
--- a/storage/ndb/test/run-test/conf-dl145a.cnf
+++ b/storage/ndb/test/run-test/conf-dl145a.cnf
@@ -21,3 +21,6 @@ BackupMemory = 64M
MaxNoOfConcurrentScans = 100
MaxNoOfSavedMessages= 1000
SendBufferMemory = 2M
+NoOfFragmentLogFiles = 4
+FragmentLogFileSize = 64M
+
diff --git a/storage/ndb/test/run-test/conf-test.cnf b/storage/ndb/test/run-test/conf-test.cnf
new file mode 100644
index 00000000000..e528eeb1d8b
--- /dev/null
+++ b/storage/ndb/test/run-test/conf-test.cnf
@@ -0,0 +1,26 @@
+[atrt]
+basedir = CHOOSE_dir
+baseport = 14000
+clusters = .2node
+
+[ndb_mgmd]
+
+[mysqld]
+skip-innodb
+skip-bdb
+
+[cluster_config.2node]
+ndb_mgmd = CHOOSE_host1
+ndbd = CHOOSE_host2,CHOOSE_host3
+ndbapi= CHOOSE_host1,CHOOSE_host1,CHOOSE_host1
+
+NoOfReplicas = 2
+IndexMemory = 25M
+DataMemory = 100M
+BackupMemory = 64M
+MaxNoOfConcurrentScans = 100
+MaxNoOfSavedMessages= 1000
+SendBufferMemory = 2M
+NoOfFragmentLogFiles = 4
+FragmentLogFileSize = 64M
+
diff --git a/storage/ndb/test/run-test/daily-basic-tests.txt b/storage/ndb/test/run-test/daily-basic-tests.txt
index 96473c28199..b7a3a15dae7 100644
--- a/storage/ndb/test/run-test/daily-basic-tests.txt
+++ b/storage/ndb/test/run-test/daily-basic-tests.txt
@@ -248,6 +248,10 @@ cmd: testBasic
args: -n Bug28073
max-time: 500
+cmd: testBasic
+args: -n Bug20535
+
+max-time: 500
cmd: testIndex
args: -n Bug25059 -r 3000 T1
@@ -481,6 +485,14 @@ max-time: 1000
cmd: testNodeRestart
args: -n Bug27003 T1
+max-time: 300
+cmd: testSystemRestart
+args: -n Bug29167 T1
+
+max-time: 300
+cmd: testSystemRestart
+args: -l 2 -n Bug28770 T1
+
max-time: 1000
cmd: testNodeRestart
args: -n Bug27283 T1
@@ -557,12 +569,20 @@ max-time: 1000
cmd: testNodeRestart
args: -n Bug28023 T7 D2
+max-time: 1000
+cmd: testNodeRestart
+args: -n Bug29364 T1
+
#
# DICT TESTS
max-time: 1500
cmd: testDict
args: -n CreateAndDrop
+max-time: 1000
+cmd: testNodeRestart
+args: -n Bug28717 T1
+
max-time: 1500
cmd: testDict
args: -n CreateAndDropAtRandom -l 200 T1
@@ -615,6 +635,10 @@ max-time: 1500
cmd: testDict
args: -l 25 -n DictRestart T1
+max-time: 500
+cmd: testDict
+args: -n Bug24631 T1
+
#
# TEST NDBAPI
#
@@ -696,6 +720,10 @@ max-time: 500
cmd: testNdbApi
args: -n ExecuteAsynch T1
+max-time: 1000
+cmd: testNdbApi
+args: -n Bug28443
+
#max-time: 500
#cmd: testInterpreter
#args: T1
@@ -882,6 +910,10 @@ max-time: 120
cmd: testMgm
args: -n ApiSessionFailure T1
+max-time: 15
+cmd: testMgm
+args: -n ApiConnectTimeout T1
+
max-time: 120
cmd: testMgm
args: -n ApiTimeoutBasic T1
@@ -906,3 +938,10 @@ max-time: 120
cmd: testMgm
args: -n ApiMgmStructEventTimeout T1
+max-time: 180
+cmd: testIndex
+args: -n Bug28804 T1 T3
+
+max-time: 180
+cmd: testIndex
+args: -n Bug28804_ATTRINFO T1 T3
diff --git a/storage/ndb/test/run-test/main.cpp b/storage/ndb/test/run-test/main.cpp
index 2e8d6bfde6d..b5c4385f5d3 100644
--- a/storage/ndb/test/run-test/main.cpp
+++ b/storage/ndb/test/run-test/main.cpp
@@ -77,60 +77,60 @@ my_bool opt_core;
static struct my_option g_options[] =
{
{ "help", '?', "Display this help and exit.",
- (gptr*) &g_help, (gptr*) &g_help,
+ (uchar **) &g_help, (uchar **) &g_help,
0, GET_BOOL, NO_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 },
{ "clusters", 256, "Cluster",
- (gptr*) &g_clusters, (gptr*) &g_clusters,
+ (uchar **) &g_clusters, (uchar **) &g_clusters,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "replicate", 1024, "replicate",
- (gptr*) &g_dummy, (gptr*) &g_dummy,
+ (uchar **) &g_dummy, (uchar **) &g_dummy,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "log-file", 256, "log-file",
- (gptr*) &g_log_filename, (gptr*) &g_log_filename,
+ (uchar **) &g_log_filename, (uchar **) &g_log_filename,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "testcase-file", 'f', "testcase-file",
- (gptr*) &g_test_case_filename, (gptr*) &g_test_case_filename,
+ (uchar **) &g_test_case_filename, (uchar **) &g_test_case_filename,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "report-file", 'r', "report-file",
- (gptr*) &g_report_filename, (gptr*) &g_report_filename,
+ (uchar **) &g_report_filename, (uchar **) &g_report_filename,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "basedir", 256, "Base path",
- (gptr*) &g_basedir, (gptr*) &g_basedir,
+ (uchar **) &g_basedir, (uchar **) &g_basedir,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "baseport", 256, "Base port",
- (gptr*) &g_baseport, (gptr*) &g_baseport,
+ (uchar **) &g_baseport, (uchar **) &g_baseport,
0, GET_INT, REQUIRED_ARG, g_baseport, 0, 0, 0, 0, 0},
{ "prefix", 256, "mysql install dir",
- (gptr*) &g_prefix, (gptr*) &g_prefix,
+ (uchar **) &g_prefix, (uchar **) &g_prefix,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "verbose", 'v', "Verbosity",
- (gptr*) &g_verbosity, (gptr*) &g_verbosity,
+ (uchar **) &g_verbosity, (uchar **) &g_verbosity,
0, GET_INT, REQUIRED_ARG, g_verbosity, 0, 0, 0, 0, 0},
{ "configure", 256, "configure",
- (gptr*) &g_do_setup, (gptr*) &g_do_setup,
+ (uchar **) &g_do_setup, (uchar **) &g_do_setup,
0, GET_INT, REQUIRED_ARG, g_do_setup, 0, 0, 0, 0, 0 },
{ "deploy", 256, "deploy",
- (gptr*) &g_do_deploy, (gptr*) &g_do_deploy,
+ (uchar **) &g_do_deploy, (uchar **) &g_do_deploy,
0, GET_INT, REQUIRED_ARG, g_do_deploy, 0, 0, 0, 0, 0 },
{ "sshx", 256, "sshx",
- (gptr*) &g_do_sshx, (gptr*) &g_do_sshx,
+ (uchar **) &g_do_sshx, (uchar **) &g_do_sshx,
0, GET_INT, REQUIRED_ARG, g_do_sshx, 0, 0, 0, 0, 0 },
{ "start", 256, "start",
- (gptr*) &g_do_start, (gptr*) &g_do_start,
+ (uchar **) &g_do_start, (uchar **) &g_do_start,
0, GET_INT, REQUIRED_ARG, g_do_start, 0, 0, 0, 0, 0 },
{ "fqpn", 256, "Fully qualified path-names ",
- (gptr*) &g_fqpn, (gptr*) &g_fqpn,
+ (uchar **) &g_fqpn, (uchar **) &g_fqpn,
0, GET_INT, REQUIRED_ARG, g_fqpn, 0, 0, 0, 0, 0 },
{ "default-ports", 256, "Use default ports when possible",
- (gptr*) &g_default_ports, (gptr*) &g_default_ports,
+ (uchar **) &g_default_ports, (uchar **) &g_default_ports,
0, GET_INT, REQUIRED_ARG, g_default_ports, 0, 0, 0, 0, 0 },
{ "mode", 256, "Mode 0=interactive 1=regression 2=bench",
- (gptr*) &g_mode, (gptr*) &g_mode,
+ (uchar **) &g_mode, (uchar **) &g_mode,
0, GET_INT, REQUIRED_ARG, g_mode, 0, 0, 0, 0, 0 },
{ "quit", 256, "Quit before starting tests",
- (gptr*) &g_mode, (gptr*) &g_do_quit,
+ (uchar **) &g_mode, (uchar **) &g_do_quit,
0, GET_BOOL, NO_ARG, g_do_quit, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff --git a/storage/ndb/test/run-test/upgrade-boot.sh b/storage/ndb/test/run-test/upgrade-boot.sh
new file mode 100644
index 00000000000..d3542166551
--- /dev/null
+++ b/storage/ndb/test/run-test/upgrade-boot.sh
@@ -0,0 +1,218 @@
+#!/bin/sh
+#############################################################
+# This script created by Jonas does the following #
+# Cleans up clones and pevious builds, pulls new clones, #
+# builds, deploys, configures the tests and launches ATRT #
+#############################################################
+
+###############
+#Script setup #
+##############
+
+save_args=$*
+VERSION="upgrade-boot.sh version 1.00"
+
+DATE=`date '+%Y-%m-%d'`
+HOST=`hostname -s`
+export DATE HOST
+
+set -e
+
+echo "`date` starting: $*"
+
+verbose=0
+do_clone=yes
+build=yes
+
+tag0=
+tag1=
+conf=
+extra_args=
+extra_clone=
+LOCK=$HOME/.autotest-lock
+
+############################
+# Read command line entries#
+############################
+
+while [ "$1" ]
+do
+ case "$1" in
+ --no-clone) do_clone="";;
+ --no-build) build="";;
+ --verbose) verbose=`expr $verbose + 1`;;
+ --clone=*) clone0=`echo $1 | sed s/--clone=//`;;
+ --clone0=*) clone0=`echo $1 | sed s/--clone0=//`;;
+ --clone1=*) clone1=`echo $1 | sed s/--clone1=//`;;
+ --version) echo $VERSION; exit;;
+ --conf=*) conf=`echo $1 | sed s/--conf=//`;;
+ --tag=*) tag0=`echo $1 | sed s/--tag=//`;;
+ --tag0=*) tag0=`echo $1 | sed s/--tag0=//`;;
+ --tag1=*) tag1=`echo $1 | sed s/--tag1=//`;;
+ --*) echo "Unknown arg: $1";;
+ *) RUN=$*;;
+ esac
+ shift
+done
+
+if [ -z "$clone1" ]
+then
+ clone1=$clone0
+fi
+
+if [ -z "$tag0" ]
+then
+ echo "No tag0 specified"
+ exit
+fi
+
+if [ -z "$tag1" ]
+then
+ echo "No tag1 specified"
+ exit
+fi
+
+#################################
+#Make sure the configfile exists#
+#if it does not exit. if it does#
+# (.) load it #
+#################################
+if [ -z "$conf" ]
+then
+ if [ -f "`pwd`/autotest.conf" ]
+ then
+ conf="`pwd`/autotest.conf"
+ elif [ -f "$HOME/autotest.conf" ]
+ then
+ conf="$HOME/autotest.conf"
+ fi
+fi
+
+if [ -f $conf ]
+then
+ . $conf
+else
+ echo "Can't find config file: >$conf<"
+ exit
+fi
+
+###############################
+# Validate that all interesting
+# variables where set in conf
+###############################
+vars="src_clone_base install_dir build_dir"
+for i in $vars
+do
+ t=`echo echo \\$$i`
+ if [ -z "`eval $t`" ]
+ then
+ echo "Invalid config: $conf, variable $i is not set"
+ exit
+ fi
+done
+
+###############################
+#Print out the enviroment vars#
+###############################
+
+if [ $verbose -gt 0 ]
+then
+ env
+fi
+
+####################################
+# Setup the lock file name and path#
+# Setup the clone source location #
+####################################
+
+src_clone0=${src_clone_base}${clone0}
+src_clone1=${src_clone_base}${clone1}
+
+#######################################
+# Check to see if the lock file exists#
+# If it does exit. #
+#######################################
+
+if [ -f $LOCK ]
+then
+ echo "Lock file exists: $LOCK"
+ exit 1
+fi
+
+#######################################
+# If the lock file does not exist then#
+# create it with date and run info #
+#######################################
+
+echo "$DATE $RUN" > $LOCK
+
+#############################
+#If any errors here down, we#
+# trap them, and remove the #
+# Lock file before exit #
+#############################
+if [ `uname -s` != "SunOS" ]
+then
+ trap "rm -f $LOCK" ERR
+fi
+
+# You can add more to this path#
+################################
+
+dst_place0=${build_dir}/clone-$tag0-$DATE.$$
+dst_place1=${build_dir}/clone-$tag1-$DATE.$$
+
+#########################################
+# Delete source and pull down the latest#
+#########################################
+
+if [ "$do_clone" ]
+then
+ rm -rf $dst_place0 $dst_place1
+ if [ `echo $src_clone0 | grep -c 'file:\/\/'` = 1 ]
+ then
+ bk clone -l -r$tag0 $src_clone0 $dst_place0
+ else
+ bk clone -r$tag0 $src_clone0 $dst_place0
+ fi
+
+ if [ `echo $src_clone1 | grep -c 'file:\/\/'` = 1 ]
+ then
+ bk clone -l -r$tag1 $src_clone1 $dst_place1
+ else
+ bk clone -r$tag1 $src_clone1 $dst_place1
+ fi
+fi
+
+##########################################
+# Build the source, make installs, and #
+# create the database to be rsynced #
+##########################################
+install_dir0=$install_dir/$tag0
+install_dir1=$install_dir/$tag1
+if [ "$build" ]
+then
+ cd $dst_place0
+ rm -rf $install_dir0
+ BUILD/compile-ndb-autotest --prefix=$install_dir0
+ make install
+
+ cd $dst_place1
+ rm -rf $install_dir1
+ BUILD/compile-ndb-autotest --prefix=$install_dir1
+ make install
+fi
+
+
+################################
+# Start run script #
+################################
+
+script=$install_dir1/mysql-test/ndb/upgrade-run.sh
+$script $save_args --conf=$conf --install-dir=$install_dir --suite=$RUN --nolock $extra_args
+
+if [ "$build" ]
+then
+ rm -rf $dst_place0 $dst_place1
+fi
+rm -f $LOCK
diff --git a/storage/ndb/test/src/HugoTransactions.cpp b/storage/ndb/test/src/HugoTransactions.cpp
index 456782f4726..3a1600815e0 100644
--- a/storage/ndb/test/src/HugoTransactions.cpp
+++ b/storage/ndb/test/src/HugoTransactions.cpp
@@ -14,8 +14,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "HugoTransactions.hpp"
+#include <NDBT_Stats.hpp>
#include <NdbSleep.h>
-
+#include <NdbTick.h>
HugoTransactions::HugoTransactions(const NdbDictionary::Table& _tab,
const NdbDictionary::Index* idx):
@@ -24,6 +25,10 @@ HugoTransactions::HugoTransactions(const NdbDictionary::Table& _tab,
m_defaultScanUpdateMethod = 3;
setRetryMax();
+ m_stats_latency = 0;
+
+ m_thr_count = 0;
+ m_thr_no = -1;
}
HugoTransactions::~HugoTransactions(){
@@ -820,6 +825,16 @@ HugoTransactions::pkReadRecords(Ndb* pNdb,
return NDBT_FAILED;
}
+ MicroSecondTimer timer_start;
+ MicroSecondTimer timer_stop;
+ bool timer_active =
+ m_stats_latency != 0 &&
+ r >= batch && // first batch is "warmup"
+ r + batch != records; // last batch is usually partial
+
+ if (timer_active)
+ NdbTick_getMicroTimer(&timer_start);
+
if(pkReadRecord(pNdb, r, batch, lm) != NDBT_OK)
{
ERR(pTrans->getNdbError());
@@ -892,6 +907,12 @@ HugoTransactions::pkReadRecords(Ndb* pNdb,
}
closeTransaction(pNdb);
+
+ if (timer_active) {
+ NdbTick_getMicroTimer(&timer_stop);
+ NDB_TICKS ticks = NdbTick_getMicrosPassed(timer_start, timer_stop);
+ m_stats_latency->addObservation((double)ticks);
+ }
}
deallocRows();
g_info << reads << " records read" << endl;
@@ -913,9 +934,17 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb,
allocRows(batch);
g_info << "|- Updating records (batch=" << batch << ")..." << endl;
+ int batch_no = 0;
while (r < records){
if(r + batch > records)
batch = records - r;
+
+ if (m_thr_count != 0 && m_thr_no != batch_no % m_thr_count)
+ {
+ r += batch;
+ batch_no++;
+ continue;
+ }
if (retryAttempt >= m_retryMax){
g_info << "ERROR: has retried this operation " << retryAttempt
@@ -963,6 +992,16 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb,
return NDBT_FAILED;
}
+ MicroSecondTimer timer_start;
+ MicroSecondTimer timer_stop;
+ bool timer_active =
+ m_stats_latency != 0 &&
+ r >= batch && // first batch is "warmup"
+ r + batch != records; // last batch is usually partial
+
+ if (timer_active)
+ NdbTick_getMicroTimer(&timer_start);
+
if(pIndexScanOp)
{
int rows_found = 0;
@@ -1039,8 +1078,15 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb,
}
closeTransaction(pNdb);
-
+
+ if (timer_active) {
+ NdbTick_getMicroTimer(&timer_stop);
+ NDB_TICKS ticks = NdbTick_getMicrosPassed(timer_start, timer_stop);
+ m_stats_latency->addObservation((double)ticks);
+ }
+
r += batch; // Read next record
+ batch_no++;
}
deallocRows();
@@ -1228,10 +1274,18 @@ HugoTransactions::pkDelRecords(Ndb* pNdb,
int check;
g_info << "|- Deleting records..." << endl;
+ int batch_no = 0;
while (r < records){
if(r + batch > records)
batch = records - r;
+ if (m_thr_count != 0 && m_thr_no != batch_no % m_thr_count)
+ {
+ r += batch;
+ batch_no++;
+ continue;
+ }
+
if (retryAttempt >= m_retryMax){
g_info << "ERROR: has retried this operation " << retryAttempt
<< " times, failing!" << endl;
@@ -1255,6 +1309,16 @@ HugoTransactions::pkDelRecords(Ndb* pNdb,
return NDBT_FAILED;
}
+ MicroSecondTimer timer_start;
+ MicroSecondTimer timer_stop;
+ bool timer_active =
+ m_stats_latency != 0 &&
+ r >= batch && // first batch is "warmup"
+ r + batch != records; // last batch is usually partial
+
+ if (timer_active)
+ NdbTick_getMicroTimer(&timer_start);
+
if(pkDeleteRecord(pNdb, r, batch) != NDBT_OK)
{
ERR(pTrans->getNdbError());
@@ -1303,9 +1367,15 @@ HugoTransactions::pkDelRecords(Ndb* pNdb,
m_latest_gci = pTrans->getGCI();
}
closeTransaction(pNdb);
-
- r += batch; // Read next record
+ if (timer_active) {
+ NdbTick_getMicroTimer(&timer_stop);
+ NDB_TICKS ticks = NdbTick_getMicrosPassed(timer_start, timer_stop);
+ m_stats_latency->addObservation((double)ticks);
+ }
+
+ r += batch; // Read next record
+ batch_no++;
}
g_info << "|- " << deleted << " records deleted" << endl;
diff --git a/storage/ndb/test/src/Makefile.am b/storage/ndb/test/src/Makefile.am
index 37f6497e508..a025579cb72 100644
--- a/storage/ndb/test/src/Makefile.am
+++ b/storage/ndb/test/src/Makefile.am
@@ -24,7 +24,7 @@ libNDBT_a_SOURCES = \
NdbRestarter.cpp NdbRestarts.cpp NDBT_Output.cpp \
NdbBackup.cpp NdbConfig.cpp NdbGrep.cpp NDBT_Table.cpp \
NdbSchemaCon.cpp NdbSchemaOp.cpp getarg.c \
- CpcClient.cpp NdbMixRestarter.cpp
+ CpcClient.cpp NdbMixRestarter.cpp NDBT_Thread.cpp
INCLUDES_LOC = -I$(top_srcdir)/storage/ndb/src/common/mgmcommon -I$(top_srcdir)/storage/ndb/include/mgmcommon -I$(top_srcdir)/storage/ndb/include/kernel -I$(top_srcdir)/storage/ndb/src/mgmapi
diff --git a/storage/ndb/test/src/NDBT_Test.cpp b/storage/ndb/test/src/NDBT_Test.cpp
index b30430c73c1..69f3723ca75 100644
--- a/storage/ndb/test/src/NDBT_Test.cpp
+++ b/storage/ndb/test/src/NDBT_Test.cpp
@@ -1195,35 +1195,35 @@ static struct my_option my_long_options[] =
{
NDB_STD_OPTS(""),
{ "print", OPT_PRINT, "Print execution tree",
- (gptr*) &opt_print, (gptr*) &opt_print, 0,
+ (uchar **) &opt_print, (uchar **) &opt_print, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "print_html", OPT_PRINT_HTML, "Print execution tree in html table format",
- (gptr*) &opt_print_html, (gptr*) &opt_print_html, 0,
+ (uchar **) &opt_print_html, (uchar **) &opt_print_html, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "print_cases", OPT_PRINT_CASES, "Print list of test cases",
- (gptr*) &opt_print_cases, (gptr*) &opt_print_cases, 0,
+ (uchar **) &opt_print_cases, (uchar **) &opt_print_cases, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "records", 'r', "Number of records",
- (gptr*) &opt_records, (gptr*) &opt_records, 0,
+ (uchar **) &opt_records, (uchar **) &opt_records, 0,
GET_INT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0 },
{ "loops", 'l', "Number of loops",
- (gptr*) &opt_loops, (gptr*) &opt_loops, 0,
+ (uchar **) &opt_loops, (uchar **) &opt_loops, 0,
GET_INT, REQUIRED_ARG, 5, 0, 0, 0, 0, 0 },
{ "seed", 1024, "Random seed",
- (gptr*) &opt_seed, (gptr*) &opt_seed, 0,
+ (uchar **) &opt_seed, (uchar **) &opt_seed, 0,
GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "testname", 'n', "Name of test to run",
- (gptr*) &opt_testname, (gptr*) &opt_testname, 0,
+ (uchar **) &opt_testname, (uchar **) &opt_testname, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "remote_mgm", 'm',
"host:port to mgmsrv of remote cluster",
- (gptr*) &opt_remote_mgm, (gptr*) &opt_remote_mgm, 0,
+ (uchar **) &opt_remote_mgm, (uchar **) &opt_remote_mgm, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "timer", 't', "Print execution time",
- (gptr*) &opt_timer, (gptr*) &opt_timer, 0,
+ (uchar **) &opt_timer, (uchar **) &opt_timer, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "verbose", 'v', "Print verbose status",
- (gptr*) &opt_verbose, (gptr*) &opt_verbose, 0,
+ (uchar **) &opt_verbose, (uchar **) &opt_verbose, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff --git a/storage/ndb/test/src/NDBT_Thread.cpp b/storage/ndb/test/src/NDBT_Thread.cpp
new file mode 100644
index 00000000000..56cf2f6815b
--- /dev/null
+++ b/storage/ndb/test/src/NDBT_Thread.cpp
@@ -0,0 +1,283 @@
+/* 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 <ndb_global.h>
+#include <NDBT_Thread.hpp>
+#include <NdbApi.hpp>
+
+NDBT_Thread::NDBT_Thread()
+{
+ create(0, -1);
+}
+
+NDBT_Thread::NDBT_Thread(NDBT_ThreadSet* thread_set, int thread_no)
+{
+ create(thread_set, thread_no);
+}
+
+void
+NDBT_Thread::create(NDBT_ThreadSet* thread_set, int thread_no)
+{
+ m_magic = NDBT_Thread::Magic;
+
+ m_state = Wait;
+ m_thread_set = thread_set;
+ m_thread_no = thread_no;
+ m_func = 0;
+ m_input = 0;
+ m_output = 0;
+ m_ndb = 0;
+ m_err = 0;
+
+ m_mutex = NdbMutex_Create();
+ assert(m_mutex != 0);
+ m_cond = NdbCondition_Create();
+ assert(m_cond != 0);
+
+ char buf[20];
+ sprintf(buf, "NDBT_%04u");
+ const char* name = strdup(buf);
+ assert(name != 0);
+
+ unsigned stacksize = 512 * 1024;
+ NDB_THREAD_PRIO prio = NDB_THREAD_PRIO_LOW;
+ m_thread = NdbThread_Create(NDBT_Thread_run,
+ (void**)this, stacksize, name, prio);
+ assert(m_thread != 0);
+}
+
+NDBT_Thread::~NDBT_Thread()
+{
+ if (m_thread != 0) {
+ NdbThread_Destroy(&m_thread);
+ m_thread = 0;
+ }
+ if (m_cond != 0) {
+ NdbCondition_Destroy(m_cond);
+ m_cond = 0;
+ }
+ if (m_mutex != 0) {
+ NdbMutex_Destroy(m_mutex);
+ m_mutex = 0;
+ }
+}
+
+static void*
+NDBT_Thread_run(void* arg)
+{
+ assert(arg != 0);
+ NDBT_Thread& thr = *(NDBT_Thread*)arg;
+ assert(thr.m_magic == NDBT_Thread::Magic);
+ thr.run();
+ return 0;
+}
+
+void
+NDBT_Thread::run()
+{
+ while (1) {
+ lock();
+ while (m_state != Start && m_state != Exit) {
+ wait();
+ }
+ if (m_state == Exit) {
+ unlock();
+ break;
+ }
+ (*m_func)(*this);
+ m_state = Stop;
+ signal();
+ unlock();
+ }
+}
+
+// methods for main process
+
+void
+NDBT_Thread::start()
+{
+ lock();
+ m_state = Start;
+ signal();
+ unlock();
+}
+
+void
+NDBT_Thread::stop()
+{
+ lock();
+ while (m_state != Stop)
+ wait();
+ m_state = Wait;
+ unlock();
+}
+
+void
+NDBT_Thread::exit()
+{
+ lock();
+ m_state = Exit;
+ signal();
+ unlock();
+};
+
+void
+NDBT_Thread::join()
+{
+ NdbThread_WaitFor(m_thread, &m_status);
+ m_thread = 0;
+}
+
+int
+NDBT_Thread::connect(class Ndb_cluster_connection* ncc, const char* db)
+{
+ m_ndb = new Ndb(ncc, db);
+ if (m_ndb->init() == -1 ||
+ m_ndb->waitUntilReady() == -1) {
+ m_err = m_ndb->getNdbError().code;
+ return -1;
+ }
+ return 0;
+}
+
+void
+NDBT_Thread::disconnect()
+{
+ delete m_ndb;
+ m_ndb = 0;
+}
+
+// set of threads
+
+NDBT_ThreadSet::NDBT_ThreadSet(int count)
+{
+ m_count = count;
+ m_thread = new NDBT_Thread* [count];
+ for (int n = 0; n < count; n++) {
+ m_thread[n] = new NDBT_Thread(this, n);
+ }
+}
+
+NDBT_ThreadSet::~NDBT_ThreadSet()
+{
+ delete_output();
+ for (int n = 0; n < m_count; n++) {
+ delete m_thread[n];
+ m_thread[n] = 0;
+ }
+ delete [] m_thread;
+}
+
+void
+NDBT_ThreadSet::start()
+{
+ for (int n = 0; n < m_count; n++) {
+ NDBT_Thread& thr = *m_thread[n];
+ thr.start();
+ }
+}
+
+void
+NDBT_ThreadSet::stop()
+{
+ for (int n = 0; n < m_count; n++) {
+ NDBT_Thread& thr = *m_thread[n];
+ thr.stop();
+ }
+}
+
+void
+NDBT_ThreadSet::exit()
+{
+ for (int n = 0; n < m_count; n++) {
+ NDBT_Thread& thr = *m_thread[n];
+ thr.exit();
+ }
+}
+
+void
+NDBT_ThreadSet::join()
+{
+ for (int n = 0; n < m_count; n++) {
+ NDBT_Thread& thr = *m_thread[n];
+ thr.join();
+ }
+}
+
+void
+NDBT_ThreadSet::set_func(NDBT_ThreadFunc* func)
+{
+ for (int n = 0; n < m_count; n++) {
+ NDBT_Thread& thr = *m_thread[n];
+ thr.set_func(func);
+ }
+}
+
+void
+NDBT_ThreadSet::set_input(const void* input)
+{
+ for (int n = 0; n < m_count; n++) {
+ NDBT_Thread& thr = *m_thread[n];
+ thr.set_input(input);
+ }
+}
+
+void
+NDBT_ThreadSet::delete_output()
+{
+ for (int n = 0; n < m_count; n++) {
+ if (m_thread[n] != 0) {
+ NDBT_Thread& thr = *m_thread[n];
+ thr.delete_output();
+ }
+ }
+}
+
+int
+NDBT_ThreadSet::connect(class Ndb_cluster_connection* ncc, const char* db)
+{
+ for (int n = 0; n < m_count; n++) {
+ assert(m_thread[n] != 0);
+ NDBT_Thread& thr = *m_thread[n];
+ if (thr.connect(ncc, db) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+void
+NDBT_ThreadSet::disconnect()
+{
+ for (int n = 0; n < m_count; n++) {
+ if (m_thread[n] != 0) {
+ NDBT_Thread& thr = *m_thread[n];
+ thr.disconnect();
+ }
+ }
+}
+
+int
+NDBT_ThreadSet::get_err() const
+{
+ for (int n = 0; n < m_count; n++) {
+ if (m_thread[n] != 0) {
+ NDBT_Thread& thr = *m_thread[n];
+ int err = thr.get_err();
+ if (err != 0)
+ return err;
+ }
+ }
+ return 0;
+}
diff --git a/storage/ndb/test/tools/hugoFill.cpp b/storage/ndb/test/tools/hugoFill.cpp
index 713c2ca5152..20ceb61b066 100644
--- a/storage/ndb/test/tools/hugoFill.cpp
+++ b/storage/ndb/test/tools/hugoFill.cpp
@@ -30,9 +30,11 @@ int main(int argc, const char** argv){
const char* _tabname = NULL;
int _help = 0;
int _batch = 512;
+ const char* db = "TEST_DB";
struct getargs args[] = {
{ "batch", 'b', arg_integer, &_batch, "Number of operations in each transaction", "batch" },
+ { "database", 'd', arg_string, &db, "Database", "" },
{ "usage", '?', arg_flag, &_help, "Print help", "" }
};
int num_args = sizeof(args) / sizeof(args[0]);
@@ -55,7 +57,7 @@ int main(int argc, const char** argv){
{
return NDBT_ProgramExit(NDBT_FAILED);
}
- Ndb MyNdb(&con, "TEST_DB" );
+ Ndb MyNdb(&con, db);
if(MyNdb.init() != 0){
ERR(MyNdb.getNdbError());
diff --git a/storage/ndb/test/tools/hugoPkDelete.cpp b/storage/ndb/test/tools/hugoPkDelete.cpp
index b185eacdddf..aa8e6c654a7 100644
--- a/storage/ndb/test/tools/hugoPkDelete.cpp
+++ b/storage/ndb/test/tools/hugoPkDelete.cpp
@@ -20,22 +20,41 @@
#include <NdbApi.hpp>
#include <NdbMain.h>
#include <NDBT.hpp>
+#include <NDBT_Thread.hpp>
+#include <NDBT_Stats.hpp>
#include <NdbSleep.h>
#include <getarg.h>
#include <HugoTransactions.hpp>
+static NDBT_ThreadFunc hugoPkDelete;
+
+struct ThrInput {
+ const NdbDictionary::Table* pTab;
+ int records;
+ int batch;
+ int stats;
+};
+
+struct ThrOutput {
+ NDBT_Stats latency;
+};
+
int main(int argc, const char** argv){
ndb_init();
int _records = 0;
int _loops = 1;
- int _batch = 0;
+ int _threads = 1;
+ int _stats = 0;
+ int _batch = 1;
const char* _tabname = NULL;
int _help = 0;
struct getargs args[] = {
{ "loops", 'l', arg_integer, &_loops, "number of times to run this program(0=infinite loop)", "loops" },
+ { "threads", 't', arg_integer, &_threads, "number of threads (default 1)", "threads" },
+ { "stats", 's', arg_flag, &_stats, "report latency per batch", "stats" },
// { "batch", 'b', arg_integer, &_batch, "batch value", "batch" },
{ "records", 'r', arg_integer, &_records, "Number of records", "records" },
{ "usage", '?', arg_flag, &_help, "Print help", "" }
@@ -81,12 +100,57 @@ int main(int argc, const char** argv){
return NDBT_ProgramExit(NDBT_WRONGARGS);
}
- HugoTransactions hugoTrans(*pTab);
+ // threads
+ NDBT_ThreadSet ths(_threads);
+
+ // create Ndb object for each thread
+ if (ths.connect(&con, "TEST_DB") == -1) {
+ ndbout << "connect failed: err=" << ths.get_err() << endl;
+ return NDBT_ProgramExit(NDBT_FAILED);
+ }
+
+ // input is options
+ ThrInput input;
+ ths.set_input(&input);
+ input.pTab = pTab;
+ input.records = _records;
+ input.batch = _batch;
+ input.stats = _stats;
+
+ // output is stats
+ ThrOutput output;
+ ths.set_output<ThrOutput>();
+
int i = 0;
- while (i<_loops || _loops==0) {
+ while (i < _loops || _loops == 0) {
ndbout << i << ": ";
- if (hugoTrans.pkDelRecords(&MyNdb, _records) != 0){
- return NDBT_ProgramExit(NDBT_FAILED);
+
+ ths.set_func(hugoPkDelete);
+ ths.start();
+ ths.stop();
+
+ if (ths.get_err())
+ NDBT_ProgramExit(NDBT_FAILED);
+
+ if (_stats) {
+ NDBT_Stats latency;
+
+ // add stats from each thread
+ int n;
+ for (n = 0; n < ths.get_count(); n++) {
+ NDBT_Thread& thr = ths.get_thread(n);
+ ThrOutput* output = (ThrOutput*)thr.get_output();
+ latency += output->latency;
+ }
+
+ ndbout
+ << "latency per batch (us): "
+ << " samples=" << latency.getCount()
+ << " min=" << (int)latency.getMin()
+ << " max=" << (int)latency.getMax()
+ << " mean=" << (int)latency.getMean()
+ << " stddev=" << (int)latency.getStddev()
+ << endl;
}
i++;
}
@@ -94,3 +158,23 @@ int main(int argc, const char** argv){
return NDBT_ProgramExit(NDBT_OK);
}
+static void hugoPkDelete(NDBT_Thread& thr)
+{
+ const ThrInput* input = (const ThrInput*)thr.get_input();
+ ThrOutput* output = (ThrOutput*)thr.get_output();
+
+ HugoTransactions hugoTrans(*input->pTab);
+ output->latency.reset();
+ if (input->stats)
+ hugoTrans.setStatsLatency(&output->latency);
+
+ NDBT_ThreadSet& ths = thr.get_thread_set();
+ hugoTrans.setThrInfo(ths.get_count(), thr.get_thread_no());
+
+ int ret;
+ ret = hugoTrans.pkDelRecords(thr.get_ndb(),
+ input->records,
+ input->batch);
+ if (ret != 0)
+ thr.set_err(ret);
+}
diff --git a/storage/ndb/test/tools/hugoPkRead.cpp b/storage/ndb/test/tools/hugoPkRead.cpp
index dd14203c16e..232f55b35b8 100644
--- a/storage/ndb/test/tools/hugoPkRead.cpp
+++ b/storage/ndb/test/tools/hugoPkRead.cpp
@@ -20,17 +20,33 @@
#include <NdbApi.hpp>
#include <NdbMain.h>
#include <NDBT.hpp>
+#include <NDBT_Thread.hpp>
+#include <NDBT_Stats.hpp>
#include <NdbSleep.h>
#include <getarg.h>
#include <HugoTransactions.hpp>
+static NDBT_ThreadFunc hugoPkRead;
+
+struct ThrInput {
+ const NdbDictionary::Table* pTab;
+ int records;
+ int batch;
+ int stats;
+};
+
+struct ThrOutput {
+ NDBT_Stats latency;
+};
int main(int argc, const char** argv){
ndb_init();
int _records = 0;
int _loops = 1;
+ int _threads = 1;
+ int _stats = 0;
int _abort = 0;
int _batch = 1;
const char* _tabname = NULL;
@@ -39,6 +55,8 @@ int main(int argc, const char** argv){
struct getargs args[] = {
{ "aborts", 'a', arg_integer, &_abort, "percent of transactions that are aborted", "abort%" },
{ "loops", 'l', arg_integer, &_loops, "number of times to run this program(0=infinite loop)", "loops" },
+ { "threads", 't', arg_integer, &_threads, "number of threads (default 1)", "threads" },
+ { "stats", 's', arg_flag, &_stats, "report latency per batch", "stats" },
{ "batch", 'b', arg_integer, &_batch, "batch value(not 0)", "batch" },
{ "records", 'r', arg_integer, &_records, "Number of records", "records" },
{ "usage", '?', arg_flag, &_help, "Print help", "" }
@@ -64,6 +82,7 @@ int main(int argc, const char** argv){
{
return NDBT_ProgramExit(NDBT_FAILED);
}
+
Ndb MyNdb(&con, "TEST_DB" );
if(MyNdb.init() != 0){
@@ -81,12 +100,57 @@ int main(int argc, const char** argv){
return NDBT_ProgramExit(NDBT_WRONGARGS);
}
- HugoTransactions hugoTrans(*pTab);
+ // threads
+ NDBT_ThreadSet ths(_threads);
+
+ // create Ndb object for each thread
+ if (ths.connect(&con, "TEST_DB") == -1) {
+ ndbout << "connect failed: err=" << ths.get_err() << endl;
+ return NDBT_ProgramExit(NDBT_FAILED);
+ }
+
+ // input is options
+ ThrInput input;
+ ths.set_input(&input);
+ input.pTab = pTab;
+ input.records = _records;
+ input.batch = _batch;
+ input.stats = _stats;
+
+ // output is stats
+ ThrOutput output;
+ ths.set_output<ThrOutput>();
+
int i = 0;
- while (i<_loops || _loops==0) {
+ while (i < _loops || _loops == 0) {
ndbout << i << ": ";
- if (hugoTrans.pkReadRecords(&MyNdb, _records, _batch) != 0){
- return NDBT_ProgramExit(NDBT_FAILED);
+
+ ths.set_func(hugoPkRead);
+ ths.start();
+ ths.stop();
+
+ if (ths.get_err())
+ NDBT_ProgramExit(NDBT_FAILED);
+
+ if (_stats) {
+ NDBT_Stats latency;
+
+ // add stats from each thread
+ int n;
+ for (n = 0; n < ths.get_count(); n++) {
+ NDBT_Thread& thr = ths.get_thread(n);
+ ThrOutput* output = (ThrOutput*)thr.get_output();
+ latency += output->latency;
+ }
+
+ ndbout
+ << "latency per batch (us): "
+ << " samples=" << latency.getCount()
+ << " min=" << (int)latency.getMin()
+ << " max=" << (int)latency.getMax()
+ << " mean=" << (int)latency.getMean()
+ << " stddev=" << (int)latency.getStddev()
+ << endl;
}
i++;
}
@@ -94,3 +158,20 @@ int main(int argc, const char** argv){
return NDBT_ProgramExit(NDBT_OK);
}
+static void hugoPkRead(NDBT_Thread& thr)
+{
+ const ThrInput* input = (const ThrInput*)thr.get_input();
+ ThrOutput* output = (ThrOutput*)thr.get_output();
+
+ HugoTransactions hugoTrans(*input->pTab);
+ output->latency.reset();
+ if (input->stats)
+ hugoTrans.setStatsLatency(&output->latency);
+
+ int ret;
+ ret = hugoTrans.pkReadRecords(thr.get_ndb(),
+ input->records,
+ input->batch);
+ if (ret != 0)
+ thr.set_err(ret);
+}
diff --git a/storage/ndb/test/tools/hugoPkUpdate.cpp b/storage/ndb/test/tools/hugoPkUpdate.cpp
index 3e950bc96cd..b920a4f396a 100644
--- a/storage/ndb/test/tools/hugoPkUpdate.cpp
+++ b/storage/ndb/test/tools/hugoPkUpdate.cpp
@@ -20,24 +20,43 @@
#include <NdbApi.hpp>
#include <NdbMain.h>
#include <NDBT.hpp>
+#include <NDBT_Thread.hpp>
+#include <NDBT_Stats.hpp>
#include <NdbSleep.h>
#include <getarg.h>
#include <HugoTransactions.hpp>
+static NDBT_ThreadFunc hugoPkUpdate;
+
+struct ThrInput {
+ const NdbDictionary::Table* pTab;
+ int records;
+ int batch;
+ int stats;
+};
+
+struct ThrOutput {
+ NDBT_Stats latency;
+};
+
int main(int argc, const char** argv){
ndb_init();
int _records = 0;
int _loops = 1;
+ int _threads = 1;
+ int _stats = 0;
int _abort = 0;
- int _batch = 0;
+ int _batch = 1;
const char* _tabname = NULL, *db = 0;
int _help = 0;
struct getargs args[] = {
{ "aborts", 'a', arg_integer, &_abort, "percent of transactions that are aborted", "abort%" },
{ "loops", 'l', arg_integer, &_loops, "number of times to run this program(0=infinite loop)", "loops" },
+ { "threads", 't', arg_integer, &_threads, "number of threads (default 1)", "threads" },
+ { "stats", 's', arg_flag, &_stats, "report latency per batch", "stats" },
// { "batch", 'b', arg_integer, &_batch, "batch value", "batch" },
{ "records", 'r', arg_integer, &_records, "Number of records", "records" },
{ "usage", '?', arg_flag, &_help, "Print help", "" },
@@ -83,16 +102,81 @@ int main(int argc, const char** argv){
return NDBT_ProgramExit(NDBT_WRONGARGS);
}
- HugoTransactions hugoTrans(*pTab);
+ // threads
+ NDBT_ThreadSet ths(_threads);
+
+ // create Ndb object for each thread
+ if (ths.connect(&con, "TEST_DB") == -1) {
+ ndbout << "connect failed: err=" << ths.get_err() << endl;
+ return NDBT_ProgramExit(NDBT_FAILED);
+ }
+
+ // input is options
+ ThrInput input;
+ ths.set_input(&input);
+ input.pTab = pTab;
+ input.records = _records;
+ input.batch = _batch;
+ input.stats = _stats;
+
+ // output is stats
+ ThrOutput output;
+ ths.set_output<ThrOutput>();
+
int i = 0;
- while (i<_loops || _loops==0) {
- ndbout << "loop " << i << ": ";
- if (hugoTrans.pkUpdateRecords(&MyNdb,
- _records) != 0){
- return NDBT_ProgramExit(NDBT_FAILED);
+ while (i < _loops || _loops == 0) {
+ ndbout << i << ": ";
+
+ ths.set_func(hugoPkUpdate);
+ ths.start();
+ ths.stop();
+
+ if (ths.get_err())
+ NDBT_ProgramExit(NDBT_FAILED);
+
+ if (_stats) {
+ NDBT_Stats latency;
+
+ // add stats from each thread
+ int n;
+ for (n = 0; n < ths.get_count(); n++) {
+ NDBT_Thread& thr = ths.get_thread(n);
+ ThrOutput* output = (ThrOutput*)thr.get_output();
+ latency += output->latency;
+ }
+
+ ndbout
+ << "latency per batch (us): "
+ << " samples=" << latency.getCount()
+ << " min=" << (int)latency.getMin()
+ << " max=" << (int)latency.getMax()
+ << " mean=" << (int)latency.getMean()
+ << " stddev=" << (int)latency.getStddev()
+ << endl;
}
i++;
}
return NDBT_ProgramExit(NDBT_OK);
}
+
+static void hugoPkUpdate(NDBT_Thread& thr)
+{
+ const ThrInput* input = (const ThrInput*)thr.get_input();
+ ThrOutput* output = (ThrOutput*)thr.get_output();
+
+ HugoTransactions hugoTrans(*input->pTab);
+ output->latency.reset();
+ if (input->stats)
+ hugoTrans.setStatsLatency(&output->latency);
+
+ NDBT_ThreadSet& ths = thr.get_thread_set();
+ hugoTrans.setThrInfo(ths.get_count(), thr.get_thread_no());
+
+ int ret;
+ ret = hugoTrans.pkUpdateRecords(thr.get_ndb(),
+ input->records,
+ input->batch);
+ if (ret != 0)
+ thr.set_err(ret);
+}
diff --git a/storage/ndb/tools/delete_all.cpp b/storage/ndb/tools/delete_all.cpp
index 4e3037f1941..1bf89f5a32f 100644
--- a/storage/ndb/tools/delete_all.cpp
+++ b/storage/ndb/tools/delete_all.cpp
@@ -36,16 +36,16 @@ static struct my_option my_long_options[] =
{
NDB_STD_OPTS("ndb_desc"),
{ "database", 'd', "Name of database table is in",
- (gptr*) &_dbname, (gptr*) &_dbname, 0,
+ (uchar**) &_dbname, (uchar**) &_dbname, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "transactional", 't', "Single transaction (may run out of operations)",
- (gptr*) &_transactional, (gptr*) &_transactional, 0,
+ (uchar**) &_transactional, (uchar**) &_transactional, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "tupscan", 999, "Run tupscan",
- (gptr*) &_tupscan, (gptr*) &_tupscan, 0,
+ (uchar**) &_tupscan, (uchar**) &_tupscan, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "diskscan", 999, "Run diskcan",
- (gptr*) &_diskscan, (gptr*) &_diskscan, 0,
+ (uchar**) &_diskscan, (uchar**) &_diskscan, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff --git a/storage/ndb/tools/desc.cpp b/storage/ndb/tools/desc.cpp
index 9eb0cf67ceb..831005139de 100644
--- a/storage/ndb/tools/desc.cpp
+++ b/storage/ndb/tools/desc.cpp
@@ -39,16 +39,16 @@ static struct my_option my_long_options[] =
{
NDB_STD_OPTS("ndb_desc"),
{ "database", 'd', "Name of database table is in",
- (gptr*) &_dbname, (gptr*) &_dbname, 0,
+ (uchar**) &_dbname, (uchar**) &_dbname, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "unqualified", 'u', "Use unqualified table names",
- (gptr*) &_unqualified, (gptr*) &_unqualified, 0,
+ (uchar**) &_unqualified, (uchar**) &_unqualified, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "extra-partition-info", 'p', "Print more info per partition",
- (gptr*) &_partinfo, (gptr*) &_partinfo, 0,
+ (uchar**) &_partinfo, (uchar**) &_partinfo, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "retries", 'r', "Retry every second for # retries",
- (gptr*) &_retries, (gptr*) &_retries, 0,
+ (uchar**) &_retries, (uchar**) &_retries, 0,
GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff --git a/storage/ndb/tools/drop_index.cpp b/storage/ndb/tools/drop_index.cpp
index 256c40e1924..ec88f331a80 100644
--- a/storage/ndb/tools/drop_index.cpp
+++ b/storage/ndb/tools/drop_index.cpp
@@ -30,7 +30,7 @@ static struct my_option my_long_options[] =
{
NDB_STD_OPTS("ndb_desc"),
{ "database", 'd', "Name of database table is in",
- (gptr*) &_dbname, (gptr*) &_dbname, 0,
+ (uchar**) &_dbname, (uchar**) &_dbname, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff --git a/storage/ndb/tools/drop_tab.cpp b/storage/ndb/tools/drop_tab.cpp
index a7accb904a4..8d07afbbf50 100644
--- a/storage/ndb/tools/drop_tab.cpp
+++ b/storage/ndb/tools/drop_tab.cpp
@@ -30,7 +30,7 @@ static struct my_option my_long_options[] =
{
NDB_STD_OPTS("ndb_desc"),
{ "database", 'd', "Name of database table is in",
- (gptr*) &_dbname, (gptr*) &_dbname, 0,
+ (uchar**) &_dbname, (uchar**) &_dbname, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff --git a/storage/ndb/tools/listTables.cpp b/storage/ndb/tools/listTables.cpp
index 6a73bcc54f5..45129cb34af 100644
--- a/storage/ndb/tools/listTables.cpp
+++ b/storage/ndb/tools/listTables.cpp
@@ -256,22 +256,22 @@ static struct my_option my_long_options[] =
{
NDB_STD_OPTS("ndb_show_tables"),
{ "database", 'd', "Name of database table is in",
- (gptr*) &_dbname, (gptr*) &_dbname, 0,
+ (uchar**) &_dbname, (uchar**) &_dbname, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "loops", 'l', "loops",
- (gptr*) &_loops, (gptr*) &_loops, 0,
+ (uchar**) &_loops, (uchar**) &_loops, 0,
GET_INT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0 },
{ "type", 't', "type",
- (gptr*) &_type, (gptr*) &_type, 0,
+ (uchar**) &_type, (uchar**) &_type, 0,
GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "unqualified", 'u', "Use unqualified table names",
- (gptr*) &_unqualified, (gptr*) &_unqualified, 0,
+ (uchar**) &_unqualified, (uchar**) &_unqualified, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "parsable", 'p', "Return output suitable for mysql LOAD DATA INFILE",
- (gptr*) &_parsable, (gptr*) &_parsable, 0,
+ (uchar**) &_parsable, (uchar**) &_parsable, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "show-temp-status", OPT_SHOW_TMP_STATUS, "Show table temporary flag",
- (gptr*) &show_temp_status, (gptr*) &show_temp_status, 0,
+ (uchar**) &show_temp_status, (uchar**) &show_temp_status, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff --git a/storage/ndb/tools/ndb_config.cpp b/storage/ndb/tools/ndb_config.cpp
index 31fc59a8b83..af36103f947 100644
--- a/storage/ndb/tools/ndb_config.cpp
+++ b/storage/ndb/tools/ndb_config.cpp
@@ -58,37 +58,37 @@ static struct my_option my_long_options[] =
{
NDB_STD_OPTS("ndb_config"),
{ "nodes", 256, "Print nodes",
- (gptr*) &g_nodes, (gptr*) &g_nodes,
+ (uchar**) &g_nodes, (uchar**) &g_nodes,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{ "connections", 256, "Print connections",
- (gptr*) &g_connections, (gptr*) &g_connections,
+ (uchar**) &g_connections, (uchar**) &g_connections,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{ "query", 'q', "Query option(s)",
- (gptr*) &g_query, (gptr*) &g_query,
+ (uchar**) &g_query, (uchar**) &g_query,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "host", 256, "Host",
- (gptr*) &g_host, (gptr*) &g_host,
+ (uchar**) &g_host, (uchar**) &g_host,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "type", 258, "Type of node/connection",
- (gptr*) &g_type, (gptr*) &g_type,
+ (uchar**) &g_type, (uchar**) &g_type,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "id", 258, "Nodeid",
- (gptr*) &g_nodeid, (gptr*) &g_nodeid,
+ (uchar**) &g_nodeid, (uchar**) &g_nodeid,
0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "nodeid", 258, "Nodeid",
- (gptr*) &g_nodeid, (gptr*) &g_nodeid,
+ (uchar**) &g_nodeid, (uchar**) &g_nodeid,
0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "fields", 'f', "Field separator",
- (gptr*) &g_field_delimiter, (gptr*) &g_field_delimiter,
+ (uchar**) &g_field_delimiter, (uchar**) &g_field_delimiter,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "rows", 'r', "Row separator",
- (gptr*) &g_row_delimiter, (gptr*) &g_row_delimiter,
+ (uchar**) &g_row_delimiter, (uchar**) &g_row_delimiter,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "config-file", 256, "Path to config.ini",
- (gptr*) &g_config_file, (gptr*) &g_config_file,
+ (uchar**) &g_config_file, (uchar**) &g_config_file,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "mycnf", 256, "Read config from my.cnf",
- (gptr*) &g_mycnf, (gptr*) &g_mycnf,
+ (uchar**) &g_mycnf, (uchar**) &g_mycnf,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff --git a/storage/ndb/tools/ndb_error_reporter b/storage/ndb/tools/ndb_error_reporter
index 2b5aadb6171..7ad7a2f478a 100644
--- a/storage/ndb/tools/ndb_error_reporter
+++ b/storage/ndb/tools/ndb_error_reporter
@@ -62,13 +62,13 @@ foreach my $node (@nodes)
(($config_get_fs)?" with filesystem":"").
"\n\n";
my $recurse= ($config_get_fs)?'-r ':'';
- system 'scp '.$recurse.$config_username.config($node,'host').
+ system 'scp -p '.$recurse.$config_username.config($node,'host').
':'.config($node,'datadir')."/ndb_".$node."* ".
"$reportdir/\n";
}
print "\n\n Copying configuration file...\n\n\t$config_file\n\n";
-system "cp $config_file $reportdir/";
+system "cp -p $config_file $reportdir/";
my $r = system 'bzip2 2>&1 > /dev/null < /dev/null';
my $outfile;
diff --git a/storage/ndb/tools/ndb_size.pl b/storage/ndb/tools/ndb_size.pl
index 4ecdc297cd3..3537a9e8490 100644
--- a/storage/ndb/tools/ndb_size.pl
+++ b/storage/ndb/tools/ndb_size.pl
@@ -169,7 +169,9 @@ use Class::MethodMaker [
vdm_versions
ddm_versions ) ],
scalar => [ qw( name
- rows ) ],
+ rows
+ schema
+ real_table_name) ],
hash => [ qw( columns
indexes
indexed_columns
@@ -198,6 +200,16 @@ use Class::MethodMaker [
scalar => [ { -default=> 4 },'align'],
];
+sub table_name
+{
+ my ($self) = @_;
+ if ($self->real_table_name) {
+ return $self->real_table_name;
+ }else {
+ return $self->name;
+ }
+}
+
sub compute_row_size
{
my ($self, $releases) = @_;
@@ -391,14 +403,30 @@ sub compute_estimate
package main;
-my ($dbh,$database,$hostname,$user,$password,$help,$savequeries,$loadqueries,$debug,$format);
+my ($dbh,
+ $database,
+ $socket,
+ $hostname,
+ $user,
+ $password);
+
+my ($help,
+ $savequeries,
+ $loadqueries,
+ $debug,
+ $format,
+ $excludetables,
+ $excludedbs);
GetOptions('database|d=s'=>\$database,
'hostname=s'=>\$hostname,
+ 'socket=s'=>\$socket,
'user|u=s'=>\$user,
'password|p=s'=>\$password,
'savequeries|s=s'=>\$savequeries,
'loadqueries|l=s'=>\$loadqueries,
+ 'excludetables=s'=>\$excludetables,
+ 'excludedbs=s'=>\$excludedbs,
'help|usage|h!'=>\$help,
'debug'=>\$debug,
'format|f=s'=>\$format,
@@ -406,32 +434,75 @@ GetOptions('database|d=s'=>\$database,
my $report= new MySQL::NDB::Size::Report;
-if($help || !$database)
+if($help)
{
print STDERR "Usage:\n";
- print STDERR "\tndb_size.pl --database=<db name> [--hostname=<host>]"
+ print STDERR "\tndb_size.pl --database=<db name>|ALL [--hostname=<host>] "
+ ."[--socket=<socket>] "
."[--user=<user>] [--password=<password>] [--help|-h] [--format=(html|text)] [--loadqueries=<file>] [--savequeries=<file>]\n\n";
+ print STDERR "\t--database=<db name> ALL may be specified to examine all "
+ ."databases\n";
print STDERR "\t--hostname=<host>:<port> can be used to designate a "
."specific port\n";
print STDERR "\t--hostname defaults to localhost\n";
print STDERR "\t--user and --password default to empty string\n";
print STDERR "\t--format=(html|text) Output format\n";
+ print STDERR "\t--excludetables Comma separated list of table names to skip\n";
+ print STDERR "\t--excludedbs Comma separated list of database names to skip\n";
print STDERR "\t--savequeries=<file> saves all queries to the DB into <file>\n";
print STDERR "\t--loadqueries=<file> loads query results from <file>. Doesn't connect to DB.\n";
exit(1);
}
+
$hostname= 'localhost' unless $hostname;
my %queries; # used for loadqueries/savequeries
if(!$loadqueries)
{
- my $dsn = "DBI:mysql:database=$database;host=$hostname";
+ my $dsn = "DBI:mysql:host=$hostname";
+ $dsn.= ";mysql_socket=$socket" if ($socket);
$dbh= DBI->connect($dsn, $user, $password) or exit(1);
- $report->database($database);
$report->dsn($dsn);
}
+
+my @dbs;
+if ($database && !($database =~ /^ALL$/i))
+{
+ @dbs = split(',', $database);
+}
+else
+{
+ # Do all databases
+ @dbs = map { $_->[0] } @{ $dbh->selectall_arrayref("show databases") };
+}
+
+my %withdb = map {$_ => 1} @dbs;
+foreach (split ",", $excludedbs || '')
+{
+ delete $withdb{$_};
+}
+delete $withdb{'mysql'};
+delete $withdb{'INFORMATION_SCHEMA'};
+delete $withdb{'information_schema'};
+
+my $dblist = join (',', map { $dbh->quote($_) } keys %withdb );
+
+$excludetables = join (',', map { $dbh->quote($_) } split ',', $excludetables )
+ if $excludetables;
+
+if(!$loadqueries)
+{
+ if (scalar(keys %withdb)>1)
+ {
+ $report->database("databases: $dblist");
+ }
+ else
+ {
+ $report->database("database: $dblist");
+ }
+}
else
{
open Q,"< $loadqueries";
@@ -441,7 +512,6 @@ else
%queries= %$e;
close Q;
$report->database("file:$loadqueries");
- $report->dsn("file:$loadqueries");
}
$report->versions('4.1','5.0','5.1');
@@ -454,7 +524,25 @@ if($loadqueries)
}
else
{
- $tables= $dbh->selectall_arrayref("show tables");
+ my $sql= "select t.TABLE_NAME,t.TABLE_SCHEMA " .
+ " from information_schema.TABLES t " .
+ " where t.TABLE_SCHEMA in ( $dblist ) ";
+
+ $sql.=" and t.TABLE_NAME not in " .
+ " ( $excludetables )"
+ if ($excludetables);
+
+ $tables= $dbh->selectall_arrayref($sql);
+
+ if (!$tables) {
+ print "WARNING: problem selecing from INFORMATION SCHEMA ($sql)\n";
+ if ($#dbs>0) {
+ print "\t attempting to fallback to show tables from $database";
+ $tables= $dbh->selectall_arrayref("show tables from $database\n");
+ } else {
+ print "All Databases not supported in 4.1. Please specify --database=\n";
+ }
+ }
$queries{"show tables"}= $tables;
}
@@ -510,6 +598,8 @@ sub do_table {
{$col->dm(4)}
elsif($type =~ /float/)
{
+ my @sz= split ',', $size;
+ $size= $sz[0]+$sz[1];
if(!defined($size) || $size<=24)
{$col->dm(4)}
else
@@ -543,9 +633,10 @@ sub do_table {
$col->dm($fixed);
if(!$col->Key()) # currently keys must be non varsized
{
- my $sql= "select avg(length(`"
- .$colname
- ."`)) from `".$t->name().'`';
+ my $sql= sprintf("select avg(length(`%s`)) " .
+ " from `%s`.`%s` " ,
+ $colname, $t->schema(), $t->table_name());
+
my @dynamic;
if($loadqueries)
{
@@ -573,9 +664,11 @@ sub do_table {
$blobhunk= 8000 if $type=~ /longblob/;
$blobhunk= 4000 if $type=~ /mediumblob/;
- my $sql= "select SUM(CEILING(".
- "length(`$colname`)/$blobhunk))"
- ."from `".$t->name."`";
+ my $sql= sprintf("select SUM(CEILING(length(`%s`)/%s)) " .
+ " from `%s`.`%s`" ,
+ $colname, $blobhunk,
+ $t->schema(), $t->table_name() );
+
my @blobsize;
if($loadqueries)
{
@@ -589,11 +682,12 @@ sub do_table {
$blobsize[0]=0 if !defined($blobsize[0]);
# Is a supporting table, add it to the lists:
- $report->supporting_tables_set($t->name()."\$BLOB_$colname" => 1);
- $t->supporting_tables_push($t->name()."\$BLOB_$colname");
+ $report->supporting_tables_set($t->schema().".".$t->name()."\$BLOB_$colname" => 1);
+ $t->supporting_tables_push($t->schema().".".$t->name()."\$BLOB_$colname");
my $st= new MySQL::NDB::Size::Table(name =>
$t->name()."\$BLOB_$colname",
+ schema => $t->schema(),
rows => $blobsize[0],
row_dm_overhead =>
{ '4.1' => 12,
@@ -632,7 +726,9 @@ sub do_table {
$col->size($size);
$t->columns_set( $colname => $col );
}
- $report->tables_set( $t->name => $t );
+ #print "setting tables: ",$t->schema(), $t->table_name(), $t->name, $t->real_table_name || "" , "\n";
+ # Use $t->name here instead of $t->table_name() to avoid namespace conflicts
+ $report->tables_set( $t->schema().".".$t->name() => $t );
# And now... the IndexMemory usage.
#
@@ -727,14 +823,16 @@ sub do_table {
# Is a supporting table, add it to the lists:
my $idxname= $t->name().'_'.join('_',@{$indexes{$index}{columns}}).
"\$unique";
- $report->supporting_tables_set($idxname => 1);
- $t->supporting_tables_push($idxname);
+ $report->supporting_tables_set($t->schema().".".$idxname => 1);
+ $t->supporting_tables_push($t->schema().".".$idxname);
$t->indexed_columns_set($_ => 1)
foreach @{$indexes{$index}{columns}};
my $st= new MySQL::NDB::Size::Table(name => $idxname,
+ real_table_name => $t->table_name(),
rows => $count[0],
+ schema => $t->schema(),
row_dm_overhead =>
{ '4.1' => 12,
'5.0' => 12,
@@ -745,7 +843,6 @@ sub do_table {
row_ddm_overhead =>
{ '5.1' => 8 },
);
-
do_table($st,
\%idxcols,
{
@@ -766,9 +863,10 @@ sub do_table {
foreach(@{$tables})
{
my $table= @{$_}[0];
+ my $schema = @{$_}[1] || $database;
my $info;
{
- my $sql= 'describe `'.$table.'`';
+ my $sql= 'describe `'.$schema.'`.`'.$table.'`';
if($loadqueries)
{
$info= $queries{$sql};
@@ -781,7 +879,7 @@ foreach(@{$tables})
}
my @count;
{
- my $sql= 'select count(*) from `'.$table.'`';
+ my $sql= 'select count(*) from `'.$schema.'`.`'.$table.'`';
if($loadqueries)
{
@count= @{$queries{$sql}};
@@ -797,7 +895,7 @@ foreach(@{$tables})
{
my @show_indexes;
{
- my $sql= "show index from `".$table.'`';
+ my $sql= "show index from `".$schema.'`.`'.$table.'`';
if($loadqueries)
{
@show_indexes= @{$queries{$sql}};
@@ -826,6 +924,7 @@ foreach(@{$tables})
}
}
my $t= new MySQL::NDB::Size::Table(name => $table,
+ schema => $schema,
rows => $count[0],
row_dm_overhead =>
{ '4.1' => 12,
@@ -974,6 +1073,8 @@ if($debug)
eval 'print STDERR Dumper($report)';
}
+$format= "text" unless $format;
+
if($format eq 'text')
{
my $text_out= new MySQL::NDB::Size::Output::Text($report);
@@ -984,12 +1085,6 @@ elsif($format eq 'html')
my $html_out= new MySQL::NDB::Size::Output::HTML($report);
$html_out->output();
}
-else
-{
- # default to text output
- my $text_out= new MySQL::NDB::Size::Output::Text($report);
- $text_out->output();
-}
package MySQL::NDB::Size::Output::Text;
use Data::Dumper;
@@ -1008,7 +1103,7 @@ sub output
my $self= shift;
my $r= $self->{report};
- print $self->ul("ndb_size.pl report for database ". $r->database().
+ print $self->ul("ndb_size.pl report for ". $r->database().
" (".(($r->tables_count()||0)-($r->supporting_tables_count()||0)).
" tables)");
@@ -1188,8 +1283,8 @@ sub output
my $st= $r->tables->{$_};
foreach(@{$st->indexes_keys()})
{
- printf $f, $st->name() if $_ eq 'PRIMARY';
- printf $f, $st->name().$_ if $_ ne 'PRIMARY';
+ printf $f, $st->schema().".".$st->name() if $_ eq 'PRIMARY';
+ printf $f, $st->schema().".".$st->name().$_ if $_ ne 'PRIMARY';
my $sti= $st->indexes->{$_};
printf $v, ($sti->ver_im_exists($_))
?$sti->ver_im->{$_}
@@ -1367,7 +1462,7 @@ print <<ENDHTML;
<body>
ENDHTML
- print $self->h1("ndb_size.pl report for database ". $r->database().
+ print $self->h1("ndb_size.pl report for ". $r->database().
" (".(($r->tables_count()||0)-($r->supporting_tables_count()||0)).
" tables)");
@@ -1579,8 +1674,8 @@ ENDHTML
foreach(@{$st->indexes_keys()})
{
my @r;
- push @r, $st->name() if $_ eq 'PRIMARY';
- push @r, $st->name().$_ if $_ ne 'PRIMARY';
+ push @r, $st->schema().".".$st->name() if $_ eq 'PRIMARY';
+ push @r, $st->schema().".".$st->name().$_ if $_ ne 'PRIMARY';
my $sti= $st->indexes->{$_};
push @r, ($sti->ver_im_exists($_))
?$sti->ver_im->{$_}
diff --git a/storage/ndb/tools/restore/Restore.cpp b/storage/ndb/tools/restore/Restore.cpp
index f99cacfc613..a7d8a9d10d9 100644
--- a/storage/ndb/tools/restore/Restore.cpp
+++ b/storage/ndb/tools/restore/Restore.cpp
@@ -607,7 +607,10 @@ RestoreDataIterator::getNextTuple(int & res)
attr_data->size = 4*sz;
//if (m_currentTable->getTableId() >= 2) { ndbout << "fix i=" << i << " off=" << ptr-buf_ptr << " attrId=" << attrId << endl; }
-
+ if(!m_hostByteOrder
+ && attr_desc->m_column->getType() == NdbDictionary::Column::Timestamp)
+ attr_data->u_int32_value[0] = Twiddle32(attr_data->u_int32_value[0]);
+
if(!Twiddle(attr_desc, attr_data))
{
res = -1;
@@ -664,6 +667,31 @@ RestoreDataIterator::getNextTuple(int & res)
*/
const Uint32 arraySize = sz / (attr_desc->size / 8);
assert(arraySize <= attr_desc->arraySize);
+
+ //convert the length of blob(v1) and text(v1)
+ if(!m_hostByteOrder
+ && (attr_desc->m_column->getType() == NdbDictionary::Column::Blob
+ || attr_desc->m_column->getType() == NdbDictionary::Column::Text)
+ && attr_desc->m_column->getArrayType() == NdbDictionary::Column::ArrayTypeFixed)
+ {
+ char* p = (char*)&attr_data->u_int64_value[0];
+ Uint64 x;
+ memcpy(&x, p, sizeof(Uint64));
+ x = Twiddle64(x);
+ memcpy(p, &x, sizeof(Uint64));
+ }
+
+ //convert datetime type
+ if(!m_hostByteOrder
+ && attr_desc->m_column->getType() == NdbDictionary::Column::Datetime)
+ {
+ char* p = (char*)&attr_data->u_int64_value[0];
+ Uint64 x;
+ memcpy(&x, p, sizeof(Uint64));
+ x = Twiddle64(x);
+ memcpy(p, &x, sizeof(Uint64));
+ }
+
if(!Twiddle(attr_desc, attr_data, attr_desc->arraySize))
{
res = -1;
@@ -873,13 +901,32 @@ bool RestoreDataIterator::readFragmentHeader(int & ret, Uint32 *fragmentId)
debug << "RestoreDataIterator::getNextFragment" << endl;
- if (buffer_read(&Header, sizeof(Header), 1) != 1){
+ while (1)
+ {
+ /* read first part of header */
+ if (buffer_read(&Header, 8, 1) != 1)
+ {
+ ret = 0;
+ return false;
+ } // if
+
+ /* skip if EMPTY_ENTRY */
+ Header.SectionType = ntohl(Header.SectionType);
+ Header.SectionLength = ntohl(Header.SectionLength);
+ if (Header.SectionType == BackupFormat::EMPTY_ENTRY)
+ {
+ void *tmp;
+ buffer_get_ptr(&tmp, Header.SectionLength*4-8, 1);
+ continue;
+ }
+ break;
+ }
+ /* read rest of header */
+ if (buffer_read(((char*)&Header)+8, sizeof(Header)-8, 1) != 1)
+ {
ret = 0;
return false;
- } // if
-
- Header.SectionType = ntohl(Header.SectionType);
- Header.SectionLength = ntohl(Header.SectionLength);
+ }
Header.TableId = ntohl(Header.TableId);
Header.FragmentNo = ntohl(Header.FragmentNo);
Header.ChecksumType = ntohl(Header.ChecksumType);
diff --git a/storage/ndb/tools/restore/consumer_restore.cpp b/storage/ndb/tools/restore/consumer_restore.cpp
index 3dd4b072671..89f680a80e4 100644
--- a/storage/ndb/tools/restore/consumer_restore.cpp
+++ b/storage/ndb/tools/restore/consumer_restore.cpp
@@ -424,13 +424,14 @@ error:
bool BackupRestore::translate_frm(NdbDictionary::Table *table)
{
- const void *pack_data, *data, *new_pack_data;
+ uchar *pack_data, *data, *new_pack_data;
char *new_data;
- uint data_len, new_data_len, new_pack_len;
+ uint new_data_len;
+ size_t data_len, new_pack_len;
uint no_parts, extra_growth;
DBUG_ENTER("translate_frm");
- pack_data = table->getFrmData();
+ pack_data = (uchar*) table->getFrmData();
no_parts = table->getFragmentCount();
/*
Add max 4 characters per partition to handle worst case
@@ -442,7 +443,7 @@ bool BackupRestore::translate_frm(NdbDictionary::Table *table)
{
DBUG_RETURN(TRUE);
}
- if ((new_data = my_malloc(data_len + extra_growth, MYF(0))))
+ if ((new_data = (char*) my_malloc(data_len + extra_growth, MYF(0))))
{
DBUG_RETURN(TRUE);
}
@@ -451,7 +452,7 @@ bool BackupRestore::translate_frm(NdbDictionary::Table *table)
my_free(new_data, MYF(0));
DBUG_RETURN(TRUE);
}
- if (packfrm((const void*)new_data, new_data_len,
+ if (packfrm((uchar*) new_data, new_data_len,
&new_pack_data, &new_pack_len))
{
my_free(new_data, MYF(0));
@@ -894,6 +895,21 @@ BackupRestore::table(const TableS & table){
{
copy.setMaxRows(table.getNoOfRecords());
}
+
+ NdbTableImpl &tableImpl = NdbTableImpl::getImpl(copy);
+ if (table.getBackupVersion() < MAKE_VERSION(5,1,0) && !m_no_upgrade){
+ for(int i= 0; i < copy.getNoOfColumns(); i++)
+ {
+ NdbDictionary::Column::Type t = copy.getColumn(i)->getType();
+
+ if (t == NdbDictionary::Column::Varchar ||
+ t == NdbDictionary::Column::Varbinary)
+ tableImpl.getColumn(i)->setArrayType(NdbDictionary::Column::ArrayTypeShortVar);
+ if (t == NdbDictionary::Column::Longvarchar ||
+ t == NdbDictionary::Column::Longvarbinary)
+ tableImpl.getColumn(i)->setArrayType(NdbDictionary::Column::ArrayTypeMediumVar);
+ }
+ }
if (dict->createTable(copy) == -1)
{
@@ -1141,8 +1157,25 @@ void BackupRestore::tuple_a(restore_callback_t *cb)
int size = attr_desc->size;
int arraySize = attr_desc->arraySize;
char * dataPtr = attr_data->string_value;
- Uint32 length = attr_data->size;
-
+ Uint32 length = 0;
+
+ if (!attr_data->null)
+ {
+ const unsigned char * src = (const unsigned char *)dataPtr;
+ switch(attr_desc->m_column->getType()){
+ case NdbDictionary::Column::Varchar:
+ case NdbDictionary::Column::Varbinary:
+ length = src[0] + 1;
+ break;
+ case NdbDictionary::Column::Longvarchar:
+ case NdbDictionary::Column::Longvarbinary:
+ length = src[0] + (src[1] << 8) + 2;
+ break;
+ default:
+ length = attr_data->size;
+ break;
+ }
+ }
if (j == 0 && tup.getTable()->have_auto_inc(i))
tup.getTable()->update_max_auto_val(dataPtr,size*arraySize);
@@ -1162,7 +1195,7 @@ void BackupRestore::tuple_a(restore_callback_t *cb)
if (ret < 0) {
ndbout_c("Column: %d type %d %d %d %d",i,
attr_desc->m_column->getType(),
- size, arraySize, attr_data->size);
+ size, arraySize, length);
break;
}
}
diff --git a/storage/ndb/tools/restore/consumer_restore.hpp b/storage/ndb/tools/restore/consumer_restore.hpp
index 0bc9d8e8d20..8694cbffb0c 100644
--- a/storage/ndb/tools/restore/consumer_restore.hpp
+++ b/storage/ndb/tools/restore/consumer_restore.hpp
@@ -51,6 +51,7 @@ public:
m_callback = 0;
m_free_callback = 0;
m_temp_error = false;
+ m_no_upgrade = false;
m_transactions = 0;
m_cache.m_old_table = 0;
}
@@ -91,6 +92,7 @@ public:
bool m_restore_meta;
bool m_no_restore_disk;
bool m_restore_epoch;
+ bool m_no_upgrade; // for upgrade ArrayType from 5.0 backup file.
Uint32 m_logCount;
Uint32 m_dataCount;
diff --git a/storage/ndb/tools/restore/restore_main.cpp b/storage/ndb/tools/restore/restore_main.cpp
index adccd024d88..7db77524ad8 100644
--- a/storage/ndb/tools/restore/restore_main.cpp
+++ b/storage/ndb/tools/restore/restore_main.cpp
@@ -34,6 +34,7 @@ static int ga_nodeId = 0;
static int ga_nParallelism = 128;
static int ga_backupId = 0;
static bool ga_dont_ignore_systab_0 = false;
+static bool ga_no_upgrade = false;
static Vector<class BackupConsumer *> g_consumers;
static BackupPrinter* g_printer = NULL;
@@ -99,95 +100,99 @@ static struct my_option my_long_options[] =
{
NDB_STD_OPTS("ndb_restore"),
{ "connect", 'c', "same as --connect-string",
- (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0,
+ (uchar**) &opt_connect_str, (uchar**) &opt_connect_str, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "nodeid", 'n', "Backup files from node with id",
- (gptr*) &ga_nodeId, (gptr*) &ga_nodeId, 0,
+ (uchar**) &ga_nodeId, (uchar**) &ga_nodeId, 0,
GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "backupid", 'b', "Backup id",
- (gptr*) &ga_backupId, (gptr*) &ga_backupId, 0,
+ (uchar**) &ga_backupId, (uchar**) &ga_backupId, 0,
GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "restore_data", 'r',
"Restore table data/logs into NDB Cluster using NDBAPI",
- (gptr*) &_restore_data, (gptr*) &_restore_data, 0,
+ (uchar**) &_restore_data, (uchar**) &_restore_data, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "restore_meta", 'm',
"Restore meta data into NDB Cluster using NDBAPI",
- (gptr*) &_restore_meta, (gptr*) &_restore_meta, 0,
+ (uchar**) &_restore_meta, (uchar**) &_restore_meta, 0,
+ GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
+ { "no-upgrade", 'u',
+ "Don't upgrade array type for var attributes, which don't resize VAR data and don't change column attributes",
+ (uchar**) &ga_no_upgrade, (uchar**) &ga_no_upgrade, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "no-restore-disk-objects", 'd',
"Dont restore disk objects (tablespace/logfilegroups etc)",
- (gptr*) &_no_restore_disk, (gptr*) &_no_restore_disk, 0,
+ (uchar**) &_no_restore_disk, (uchar**) &_no_restore_disk, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "restore_epoch", 'e',
"Restore epoch info into the status table. Convenient on a MySQL Cluster "
"replication slave, for starting replication. The row in "
NDB_REP_DB "." NDB_APPLY_TABLE " with id 0 will be updated/inserted.",
- (gptr*) &ga_restore_epoch, (gptr*) &ga_restore_epoch, 0,
+ (uchar**) &ga_restore_epoch, (uchar**) &ga_restore_epoch, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "skip-table-check", 's', "Skip table structure check during restore of data",
- (gptr*) &ga_skip_table_check, (gptr*) &ga_skip_table_check, 0,
+ (uchar**) &ga_skip_table_check, (uchar**) &ga_skip_table_check, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "parallelism", 'p',
"No of parallel transactions during restore of data."
"(parallelism can be 1 to 1024)",
- (gptr*) &ga_nParallelism, (gptr*) &ga_nParallelism, 0,
+ (uchar**) &ga_nParallelism, (uchar**) &ga_nParallelism, 0,
GET_INT, REQUIRED_ARG, 128, 1, 1024, 0, 1, 0 },
- { "print", OPT_PRINT, "Print data and log to stdout",
- (gptr*) &_print, (gptr*) &_print, 0,
+ { "print", OPT_PRINT, "Print metadata, data and log to stdout",
+ (uchar**) &_print, (uchar**) &_print, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "print_data", OPT_PRINT_DATA, "Print data to stdout",
- (gptr*) &_print_data, (gptr*) &_print_data, 0,
+ (uchar**) &_print_data, (uchar**) &_print_data, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "print_meta", OPT_PRINT_META, "Print meta data to stdout",
- (gptr*) &_print_meta, (gptr*) &_print_meta, 0,
+ (uchar**) &_print_meta, (uchar**) &_print_meta, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "print_log", OPT_PRINT_LOG, "Print log to stdout",
- (gptr*) &_print_log, (gptr*) &_print_log, 0,
+ (uchar**) &_print_log, (uchar**) &_print_log, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "backup_path", OPT_BACKUP_PATH, "Path to backup files",
- (gptr*) &ga_backupPath, (gptr*) &ga_backupPath, 0,
+ (uchar**) &ga_backupPath, (uchar**) &ga_backupPath, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "dont_ignore_systab_0", 'f',
"Experimental. Do not ignore system table during restore.",
- (gptr*) &ga_dont_ignore_systab_0, (gptr*) &ga_dont_ignore_systab_0, 0,
+ (uchar**) &ga_dont_ignore_systab_0, (uchar**) &ga_dont_ignore_systab_0, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "ndb-nodegroup-map", OPT_NDB_NODEGROUP_MAP,
"Nodegroup map for ndbcluster. Syntax: list of (source_ng, dest_ng)",
- (gptr*) &opt_nodegroup_map_str,
- (gptr*) &opt_nodegroup_map_str,
+ (uchar**) &opt_nodegroup_map_str,
+ (uchar**) &opt_nodegroup_map_str,
0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "fields-enclosed-by", OPT_FIELDS_ENCLOSED_BY,
"Fields are enclosed by ...",
- (gptr*) &opt_fields_enclosed_by, (gptr*) &opt_fields_enclosed_by, 0,
+ (uchar**) &opt_fields_enclosed_by, (uchar**) &opt_fields_enclosed_by, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "fields-terminated-by", OPT_FIELDS_TERMINATED_BY,
"Fields are terminated by ...",
- (gptr*) &opt_fields_terminated_by,
- (gptr*) &opt_fields_terminated_by, 0,
+ (uchar**) &opt_fields_terminated_by,
+ (uchar**) &opt_fields_terminated_by, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "fields-optionally-enclosed-by", OPT_FIELDS_OPTIONALLY_ENCLOSED_BY,
"Fields are optionally enclosed by ...",
- (gptr*) &opt_fields_optionally_enclosed_by,
- (gptr*) &opt_fields_optionally_enclosed_by, 0,
+ (uchar**) &opt_fields_optionally_enclosed_by,
+ (uchar**) &opt_fields_optionally_enclosed_by, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "hex", OPT_HEX_FORMAT, "print binary types in hex format",
- (gptr*) &opt_hex_format, (gptr*) &opt_hex_format, 0,
+ (uchar**) &opt_hex_format, (uchar**) &opt_hex_format, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "tab", 'T', "Creates tab separated textfile for each table to "
"given path. (creates .txt files)",
- (gptr*) &tab_path, (gptr*) &tab_path, 0,
+ (uchar**) &tab_path, (uchar**) &tab_path, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "append", OPT_APPEND, "for --tab append data to file",
- (gptr*) &opt_append, (gptr*) &opt_append, 0,
+ (uchar**) &opt_append, (uchar**) &opt_append, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "lines-terminated-by", OPT_LINES_TERMINATED_BY, "",
- (gptr*) &opt_lines_terminated_by, (gptr*) &opt_lines_terminated_by, 0,
+ (uchar**) &opt_lines_terminated_by, (uchar**) &opt_lines_terminated_by, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "verbose", OPT_VERBOSE,
"verbosity",
- (gptr*) &opt_verbose, (gptr*) &opt_verbose, 0,
+ (uchar**) &opt_verbose, (uchar**) &opt_verbose, 0,
GET_INT, REQUIRED_ARG, 1, 0, 255, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -460,6 +465,11 @@ o verify nodegroup mapping
restore->m_no_restore_disk = true;
}
+ if (ga_no_upgrade)
+ {
+ restore->m_no_upgrade = true;
+ }
+
if (ga_restore_epoch)
{
restore->m_restore_epoch = true;
@@ -644,6 +654,8 @@ main(int argc, char** argv)
g_options.appfmt(" -n %d", ga_nodeId);
if (_restore_meta)
g_options.appfmt(" -m");
+ if (ga_no_upgrade)
+ g_options.appfmt(" -u");
if (ga_skip_table_check)
g_options.appfmt(" -s");
if (_restore_data)
@@ -655,7 +667,6 @@ main(int argc, char** argv)
g_options.appfmt(" -p %d", ga_nParallelism);
g_connect_string = opt_connect_str;
-
/**
* we must always load meta data, even if we will only print it to stdout
*/
@@ -673,7 +684,7 @@ main(int argc, char** argv)
char buf[NDB_VERSION_STRING_BUF_SZ];
info.setLevel(254);
info << "Ndb version in backup files: "
- << getVersionString(version, 0, buf, sizeof(buf)) << endl;
+ << ndbGetVersionString(version, 0, buf, sizeof(buf)) << endl;
/**
* check wheater we can restore the backup (right version).
@@ -683,9 +694,9 @@ main(int argc, char** argv)
if (version >= MAKE_VERSION(5,1,3) && version <= MAKE_VERSION(5,1,9))
{
err << "Restore program incompatible with backup versions between "
- << getVersionString(MAKE_VERSION(5,1,3), 0, buf, sizeof(buf))
+ << ndbGetVersionString(MAKE_VERSION(5,1,3), 0, buf, sizeof(buf))
<< " and "
- << getVersionString(MAKE_VERSION(5,1,9), 0, buf, sizeof(buf))
+ << ndbGetVersionString(MAKE_VERSION(5,1,9), 0, buf, sizeof(buf))
<< endl;
exitHandler(NDBT_FAILED);
}
diff --git a/storage/ndb/tools/select_all.cpp b/storage/ndb/tools/select_all.cpp
index e2072f30edf..23d5f95f3f7 100644
--- a/storage/ndb/tools/select_all.cpp
+++ b/storage/ndb/tools/select_all.cpp
@@ -54,43 +54,43 @@ static struct my_option my_long_options[] =
{
NDB_STD_OPTS("ndb_desc"),
{ "database", 'd', "Name of database table is in",
- (gptr*) &_dbname, (gptr*) &_dbname, 0,
+ (uchar**) &_dbname, (uchar**) &_dbname, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "parallelism", 'p', "parallelism",
- (gptr*) &_parallelism, (gptr*) &_parallelism, 0,
+ (uchar**) &_parallelism, (uchar**) &_parallelism, 0,
GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "lock", 'l', "Read(0), Read-hold(1), Exclusive(2)",
- (gptr*) &_lock, (gptr*) &_lock, 0,
+ (uchar**) &_lock, (uchar**) &_lock, 0,
GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "order", 'o', "Sort resultset according to index",
- (gptr*) &_order, (gptr*) &_order, 0,
+ (uchar**) &_order, (uchar**) &_order, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "descending", 'z', "Sort descending (requires order flag)",
- (gptr*) &_descending, (gptr*) &_descending, 0,
+ (uchar**) &_descending, (uchar**) &_descending, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "header", 'h', "Print header",
- (gptr*) &_header, (gptr*) &_header, 0,
+ (uchar**) &_header, (uchar**) &_header, 0,
GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0 },
{ "useHexFormat", 'x', "Output numbers in hexadecimal format",
- (gptr*) &_useHexFormat, (gptr*) &_useHexFormat, 0,
+ (uchar**) &_useHexFormat, (uchar**) &_useHexFormat, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "delimiter", 'D', "Column delimiter",
- (gptr*) &_delimiter, (gptr*) &_delimiter, 0,
+ (uchar**) &_delimiter, (uchar**) &_delimiter, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "disk", 256, "Dump disk ref",
- (gptr*) &_dumpDisk, (gptr*) &_dumpDisk, 0,
+ (uchar**) &_dumpDisk, (uchar**) &_dumpDisk, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "rowid", 256, "Dump rowid",
- (gptr*) &use_rowid, (gptr*) &use_rowid, 0,
+ (uchar**) &use_rowid, (uchar**) &use_rowid, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "gci", 256, "Dump gci",
- (gptr*) &use_gci, (gptr*) &use_gci, 0,
+ (uchar**) &use_gci, (uchar**) &use_gci, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "tupscan", 't', "Scan in tup order",
- (gptr*) &_tup, (gptr*) &_tup, 0,
+ (uchar**) &_tup, (uchar**) &_tup, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "nodata", 256, "Dont print data",
- (gptr*) &nodata, (gptr*) &nodata, 0,
+ (uchar**) &nodata, (uchar**) &nodata, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff --git a/storage/ndb/tools/select_count.cpp b/storage/ndb/tools/select_count.cpp
index 552d156b665..73982e886b5 100644
--- a/storage/ndb/tools/select_count.cpp
+++ b/storage/ndb/tools/select_count.cpp
@@ -43,13 +43,13 @@ static struct my_option my_long_options[] =
{
NDB_STD_OPTS("ndb_desc"),
{ "database", 'd', "Name of database table is in",
- (gptr*) &_dbname, (gptr*) &_dbname, 0,
+ (uchar**) &_dbname, (uchar**) &_dbname, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "parallelism", 'p', "parallelism",
- (gptr*) &_parallelism, (gptr*) &_parallelism, 0,
+ (uchar**) &_parallelism, (uchar**) &_parallelism, 0,
GET_INT, REQUIRED_ARG, 240, 0, 0, 0, 0, 0 },
{ "lock", 'l', "Read(0), Read-hold(1), Exclusive(2)",
- (gptr*) &_lock, (gptr*) &_lock, 0,
+ (uchar**) &_lock, (uchar**) &_lock, 0,
GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff --git a/storage/ndb/tools/waiter.cpp b/storage/ndb/tools/waiter.cpp
index de8d15ac17a..a292ab9140a 100644
--- a/storage/ndb/tools/waiter.cpp
+++ b/storage/ndb/tools/waiter.cpp
@@ -46,17 +46,17 @@ static struct my_option my_long_options[] =
{
NDB_STD_OPTS("ndb_desc"),
{ "no-contact", 'n', "Wait for cluster no contact",
- (gptr*) &_no_contact, (gptr*) &_no_contact, 0,
+ (uchar**) &_no_contact, (uchar**) &_no_contact, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "not-started", OPT_WAIT_STATUS_NOT_STARTED, "Wait for cluster not started",
- (gptr*) &_not_started, (gptr*) &_not_started, 0,
+ (uchar**) &_not_started, (uchar**) &_not_started, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "single-user", OPT_WAIT_STATUS_SINGLE_USER,
"Wait for cluster to enter single user mode",
- (gptr*) &_single_user, (gptr*) &_single_user, 0,
+ (uchar**) &_single_user, (uchar**) &_single_user, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "timeout", 't', "Timeout to wait",
- (gptr*) &_timeout, (gptr*) &_timeout, 0,
+ (uchar**) &_timeout, (uchar**) &_timeout, 0,
GET_INT, REQUIRED_ARG, 120, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff --git a/strings/CMakeLists.txt b/strings/CMakeLists.txt
index dd9b500841f..3d9de566670 100644..100755
--- a/strings/CMakeLists.txt
+++ b/strings/CMakeLists.txt
@@ -17,11 +17,16 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
-ADD_LIBRARY(strings bchange.c bcmp.c bfill.c bmove512.c bmove_upp.c ctype-big5.c ctype-bin.c ctype-cp932.c
+
+SET(STRINGS_SOURCES bchange.c bcmp.c bfill.c bmove512.c bmove_upp.c ctype-big5.c ctype-bin.c ctype-cp932.c
ctype-czech.c ctype-euc_kr.c ctype-eucjpms.c ctype-extra.c ctype-gb2312.c ctype-gbk.c
ctype-latin1.c ctype-mb.c ctype-simple.c ctype-sjis.c ctype-tis620.c ctype-uca.c
ctype-ucs2.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c ctype.c decimal.c int2str.c
is_prefix.c llstr.c longlong2str.c my_strtoll10.c my_vsnprintf.c r_strinstr.c
str2int.c str_alloc.c strcend.c strend.c strfill.c strmake.c strmov.c strnmov.c
strtod.c strtol.c strtoll.c strtoul.c strtoull.c strxmov.c strxnmov.c xml.c
- my_strchr.c strcont.c strinstr.c)
+ my_strchr.c strcont.c strinstr.c strnlen.c)
+
+IF(NOT SOURCE_SUBLIBS)
+ ADD_LIBRARY(strings ${STRINGS_SOURCES})
+ENDIF(NOT SOURCE_SUBLIBS)
diff --git a/strings/bchange.c b/strings/bchange.c
index f17fb9bea27..0b2c62019b5 100644
--- a/strings/bchange.c
+++ b/strings/bchange.c
@@ -26,10 +26,10 @@
#include <my_global.h>
#include "m_string.h"
-void bchange(register char *dst, uint old_length, register const char *src,
- uint new_length, uint tot_length)
+void bchange(register uchar *dst, size_t old_length, register const uchar *src,
+ size_t new_length, size_t tot_length)
{
- uint rest=tot_length-old_length;
+ size_t rest=tot_length-old_length;
if (old_length < new_length)
bmove_upp(dst+rest+new_length,dst+tot_length,rest);
else
diff --git a/strings/bcmp.c b/strings/bcmp.c
index fd9ee5c1b96..1b6ed22fc22 100644
--- a/strings/bcmp.c
+++ b/strings/bcmp.c
@@ -51,9 +51,11 @@ uint len; /* 0 <= len <= 65535 */
#else
#ifndef HAVE_purify
-int bcmp(register const char *s1,register const char *s2, register uint len)
+size_t bcmp(register const uchar *s1,register const uchar *s2,
+ register size_t len)
#else
-int my_bcmp(register const char *s1,register const char *s2, register uint len)
+size_t my_bcmp(register const uchar *s1,register const uchar *s2,
+ register size_t len)
#endif
{
while (len-- != 0 && *s1++ == *s2++) ;
diff --git a/strings/bmove512.c b/strings/bmove512.c
index c3a4b7dfe4e..c3f0446ead6 100644
--- a/strings/bmove512.c
+++ b/strings/bmove512.c
@@ -36,7 +36,7 @@
#define LONG ulonglong
#endif
-void bmove512(gptr to, const gptr from, register uint length)
+void bmove512(uchar *to, const uchar *from, register size_t length)
{
reg1 LONG *f,*t,*end= (LONG*) ((char*) from+length);
diff --git a/strings/bmove_upp.c b/strings/bmove_upp.c
index 02b59bdb703..fb47bda2d1d 100644
--- a/strings/bmove_upp.c
+++ b/strings/bmove_upp.c
@@ -41,7 +41,8 @@ asm(".L5: ");
}
#else
-void bmove_upp(register char *dst, register const char *src, register uint len)
+void bmove_upp(register uchar *dst, register const uchar *src,
+ register size_t len)
{
while (len-- != 0) *--dst = *--src;
}
diff --git a/strings/conf_to_src.c b/strings/conf_to_src.c
index e2ac9846c85..dc2a300a2ec 100644
--- a/strings/conf_to_src.c
+++ b/strings/conf_to_src.c
@@ -179,14 +179,16 @@ is_case_sensitive(CHARSET_INFO *cs)
cs->sort_order['a'] < cs->sort_order['B']) ? 1 : 0;
}
+
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,\n",
- cs->state & MY_CS_BINSORT ? "|MY_CS_BINSORT" : "",
- cs->state & MY_CS_PRIMARY ? "|MY_CS_PRIMARY" : "",
- is_case_sensitive(cs) ? "|MY_CS_CSSORT" : "");
+ fprintf(f," MY_CS_COMPILED%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" : "");
if (cs->name)
{
@@ -243,6 +245,28 @@ void dispcset(FILE *f,CHARSET_INFO *cs)
}
+static void
+fprint_copyright(FILE *file)
+{
+ fprintf(file,
+"/* Copyright (C) 2000-2007 MySQL AB\n"
+"\n"
+" This program is free software; you can redistribute it and/or modify\n"
+" it under the terms of the GNU General Public License as published by\n"
+" the Free Software Foundation; version 2 of the License.\n"
+"\n"
+" This program is distributed in the hope that it will be useful,\n"
+" but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
+" GNU General Public License for more details.\n"
+"\n"
+" You should have received a copy of the GNU General Public License\n"
+" along with this program; if not, write to the Free Software\n"
+" Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */\n"
+"\n");
+}
+
+
int
main(int argc, char **argv __attribute__((unused)))
{
@@ -283,6 +307,7 @@ main(int argc, char **argv __attribute__((unused)))
"directory:\n");
fprintf(f, " ./conf_to_src ../sql/share/charsets/ > FILE\n");
fprintf(f, "*/\n\n");
+ fprint_copyright(f);
fprintf(f,"#include <my_global.h>\n");
fprintf(f,"#include <m_ctype.h>\n\n");
diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c
index dba5064ba0c..7bb811a3064 100644
--- a/strings/ctype-big5.c
+++ b/strings/ctype-big5.c
@@ -220,7 +220,7 @@ static uint16 big5strokexfrm(uint16 i)
static int my_strnncoll_big5_internal(const uchar **a_res,
- const uchar **b_res, uint length)
+ const uchar **b_res, size_t length)
{
const uchar *a= *a_res, *b= *b_res;
@@ -249,11 +249,11 @@ static int my_strnncoll_big5_internal(const uchar **a_res,
/* Compare strings */
static int my_strnncoll_big5(CHARSET_INFO *cs __attribute__((unused)),
- const uchar *a, uint a_length,
- const uchar *b, uint b_length,
+ const uchar *a, size_t a_length,
+ const uchar *b, size_t b_length,
my_bool b_is_prefix)
{
- uint length= min(a_length, b_length);
+ size_t length= min(a_length, b_length);
int res= my_strnncoll_big5_internal(&a, &b, length);
return res ? res : (int)((b_is_prefix ? length : a_length) - b_length);
}
@@ -262,11 +262,11 @@ static int my_strnncoll_big5(CHARSET_INFO *cs __attribute__((unused)),
/* compare strings, ignore end space */
static int my_strnncollsp_big5(CHARSET_INFO * cs __attribute__((unused)),
- const uchar *a, uint a_length,
- const uchar *b, uint b_length,
+ const uchar *a, size_t a_length,
+ const uchar *b, size_t b_length,
my_bool diff_if_only_endspace_difference)
{
- uint length= min(a_length, b_length);
+ size_t length= min(a_length, b_length);
int res= my_strnncoll_big5_internal(&a, &b, length);
#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE
@@ -301,12 +301,12 @@ static int my_strnncollsp_big5(CHARSET_INFO * cs __attribute__((unused)),
}
-static int my_strnxfrm_big5(CHARSET_INFO *cs __attribute__((unused)),
- uchar * dest, uint len,
- const uchar * src, uint srclen)
+static size_t my_strnxfrm_big5(CHARSET_INFO *cs __attribute__((unused)),
+ uchar *dest, size_t len,
+ const uchar *src, size_t srclen)
{
uint16 e;
- uint dstlen= len;
+ size_t dstlen= len;
len = srclen;
while (len--)
@@ -327,7 +327,7 @@ static int my_strnxfrm_big5(CHARSET_INFO *cs __attribute__((unused)),
}
#if 0
-static int my_strcoll_big5(const uchar * s1, const uchar * s2)
+static int my_strcoll_big5(const uchar *s1, const uchar *s2)
{
while (*s1 && *s2)
@@ -346,7 +346,7 @@ static int my_strcoll_big5(const uchar * s1, const uchar * s2)
return 0;
}
-static int my_strxfrm_big5(uchar * dest, const uchar * src, int len)
+static int my_strxfrm_big5(uchar *dest, const uchar *src, int len)
{
uint16 e;
uchar *d = dest;
@@ -395,15 +395,16 @@ static int my_strxfrm_big5(uchar * dest, const uchar * src, int len)
#define max_sort_char ((char) 255)
static my_bool my_like_range_big5(CHARSET_INFO *cs __attribute__((unused)),
- const char *ptr,uint ptr_length,
+ const char *ptr,size_t ptr_length,
pbool escape, pbool w_one, pbool w_many,
- uint res_length, char *min_str,char *max_str,
- uint *min_length,uint *max_length)
+ size_t res_length,
+ char *min_str, char *max_str,
+ size_t *min_length, size_t *max_length)
{
const char *end= ptr + ptr_length;
char *min_org=min_str;
char *min_end=min_str+res_length;
- uint charlen= res_length / cs->mbmaxlen;
+ size_t charlen= res_length / cs->mbmaxlen;
for (; ptr != end && min_str != min_end && charlen > 0; ptr++, charlen--)
{
@@ -435,7 +436,7 @@ static my_bool my_like_range_big5(CHARSET_INFO *cs __attribute__((unused)),
'a\0\0... is the smallest possible string when we have space expand
a\ff\ff... is the biggest possible string
*/
- *min_length= ((cs->state & MY_CS_BINSORT) ? (uint) (min_str - min_org) :
+ *min_length= ((cs->state & MY_CS_BINSORT) ? (size_t) (min_str - min_org) :
res_length);
*max_length= res_length;
do {
@@ -447,21 +448,21 @@ static my_bool my_like_range_big5(CHARSET_INFO *cs __attribute__((unused)),
*min_str++= *max_str++ = *ptr;
}
- *min_length= *max_length= (uint) (min_str-min_org);
+ *min_length= *max_length= (size_t) (min_str-min_org);
while (min_str != min_end)
*min_str++= *max_str++= ' ';
return 0;
}
-static int ismbchar_big5(CHARSET_INFO *cs __attribute__((unused)),
- const char* p, const char *e)
+static uint ismbchar_big5(CHARSET_INFO *cs __attribute__((unused)),
+ const char* p, const char *e)
{
return (isbig5head(*(p)) && (e)-(p)>1 && isbig5tail(*((p)+1))? 2: 0);
}
-static int mbcharlen_big5(CHARSET_INFO *cs __attribute__((unused)), uint c)
+static uint mbcharlen_big5(CHARSET_INFO *cs __attribute__((unused)), uint c)
{
return (isbig5head(c)? 2 : 1);
}
@@ -6239,7 +6240,7 @@ static int func_uni_big5_onechar(int code){
static int
my_wc_mb_big5(CHARSET_INFO *cs __attribute__((unused)),
- my_wc_t wc, unsigned char *s, unsigned char *e)
+ my_wc_t wc, uchar *s, uchar *e)
{
int code;
@@ -6297,9 +6298,9 @@ my_mb_wc_big5(CHARSET_INFO *cs __attribute__((unused)),
CP950 and HKSCS additional characters are also accepted.
*/
static
-uint my_well_formed_len_big5(CHARSET_INFO *cs __attribute__((unused)),
- const char *b, const char *e,
- uint pos, int *error)
+size_t my_well_formed_len_big5(CHARSET_INFO *cs __attribute__((unused)),
+ const char *b, const char *e,
+ size_t pos, int *error)
{
const char *b0= b;
const char *emb= e - 1; /* Last possible end of an MB character */
@@ -6324,7 +6325,7 @@ uint my_well_formed_len_big5(CHARSET_INFO *cs __attribute__((unused)),
break;
}
}
- return (uint) (b - b0);
+ return (size_t) (b - b0);
}
@@ -6401,7 +6402,7 @@ CHARSET_INFO my_charset_big5_chinese_ci=
0, /* min_sort_char */
255, /* max_sort_char */
' ', /* pad char */
- 0, /* escape_with_backslash_is_dangerous */
+ 1, /* escape_with_backslash_is_dangerous */
&my_charset_big5_handler,
&my_collation_big5_chinese_ci_handler
};
@@ -6434,7 +6435,7 @@ CHARSET_INFO my_charset_big5_bin=
0, /* min_sort_char */
255, /* max_sort_char */
' ', /* pad char */
- 0, /* escape_with_backslash_is_dangerous */
+ 1, /* escape_with_backslash_is_dangerous */
&my_charset_big5_handler,
&my_collation_mb_bin_handler
};
diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c
index 69f712c5c44..95d97af2bfb 100644
--- a/strings/ctype-bin.c
+++ b/strings/ctype-bin.c
@@ -69,26 +69,26 @@ static uchar bin_char_array[] =
static my_bool
my_coll_init_8bit_bin(CHARSET_INFO *cs,
- void *(*alloc)(uint) __attribute__((unused)))
+ void *(*alloc)(size_t) __attribute__((unused)))
{
cs->max_sort_char=255;
return FALSE;
}
static int my_strnncoll_binary(CHARSET_INFO * cs __attribute__((unused)),
- const uchar *s, uint slen,
- const uchar *t, uint tlen,
+ const uchar *s, size_t slen,
+ const uchar *t, size_t tlen,
my_bool t_is_prefix)
{
- uint len=min(slen,tlen);
+ size_t len=min(slen,tlen);
int cmp= memcmp(s,t,len);
return cmp ? cmp : (int)((t_is_prefix ? len : slen) - tlen);
}
-uint my_lengthsp_binary(CHARSET_INFO *cs __attribute__((unused)),
- const char *ptr __attribute__((unused)),
- uint length)
+size_t my_lengthsp_binary(CHARSET_INFO *cs __attribute__((unused)),
+ const char *ptr __attribute__((unused)),
+ size_t length)
{
return length;
}
@@ -117,8 +117,8 @@ uint my_lengthsp_binary(CHARSET_INFO *cs __attribute__((unused)),
*/
static int my_strnncollsp_binary(CHARSET_INFO * cs __attribute__((unused)),
- const uchar *s, uint slen,
- const uchar *t, uint tlen,
+ const uchar *s, size_t slen,
+ const uchar *t, size_t tlen,
my_bool diff_if_only_endspace_difference
__attribute__((unused)))
{
@@ -127,11 +127,11 @@ static int my_strnncollsp_binary(CHARSET_INFO * cs __attribute__((unused)),
static int my_strnncoll_8bit_bin(CHARSET_INFO * cs __attribute__((unused)),
- const uchar *s, uint slen,
- const uchar *t, uint tlen,
+ const uchar *s, size_t slen,
+ const uchar *t, size_t tlen,
my_bool t_is_prefix)
{
- uint len=min(slen,tlen);
+ size_t len=min(slen,tlen);
int cmp= memcmp(s,t,len);
return cmp ? cmp : (int)((t_is_prefix ? len : slen) - tlen);
}
@@ -163,12 +163,12 @@ static int my_strnncoll_8bit_bin(CHARSET_INFO * cs __attribute__((unused)),
*/
static int my_strnncollsp_8bit_bin(CHARSET_INFO * cs __attribute__((unused)),
- const uchar *a, uint a_length,
- const uchar *b, uint b_length,
+ const uchar *a, size_t a_length,
+ const uchar *b, size_t b_length,
my_bool diff_if_only_endspace_difference)
{
const uchar *end;
- uint length;
+ size_t length;
int res;
#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE
@@ -211,17 +211,18 @@ static int my_strnncollsp_8bit_bin(CHARSET_INFO * cs __attribute__((unused)),
/* This function is used for all conversion functions */
-static uint my_case_str_bin(CHARSET_INFO *cs __attribute__((unused)),
- char *str __attribute__((unused)))
+static size_t my_case_str_bin(CHARSET_INFO *cs __attribute__((unused)),
+ char *str __attribute__((unused)))
{
return 0;
}
-static uint my_case_bin(CHARSET_INFO *cs __attribute__((unused)),
- char *src __attribute__((unused)),
- uint srclen,
- char *dst __attribute__((unused)),
- uint dstlen __attribute__((unused)))
+
+static size_t my_case_bin(CHARSET_INFO *cs __attribute__((unused)),
+ char *src __attribute__((unused)),
+ size_t srclen,
+ char *dst __attribute__((unused)),
+ size_t dstlen __attribute__((unused)))
{
return srclen;
}
@@ -234,8 +235,8 @@ static int my_strcasecmp_bin(CHARSET_INFO * cs __attribute__((unused)),
}
-int my_mbcharlen_8bit(CHARSET_INFO *cs __attribute__((unused)),
- uint c __attribute__((unused)))
+uint my_mbcharlen_8bit(CHARSET_INFO *cs __attribute__((unused)),
+ uint c __attribute__((unused)))
{
return 1;
}
@@ -243,8 +244,8 @@ int my_mbcharlen_8bit(CHARSET_INFO *cs __attribute__((unused)),
static int my_mb_wc_bin(CHARSET_INFO *cs __attribute__((unused)),
my_wc_t *wc,
- const unsigned char *str,
- const unsigned char *end __attribute__((unused)))
+ const uchar *str,
+ const uchar *end __attribute__((unused)))
{
if (str >= end)
return MY_CS_TOOSMALL;
@@ -256,8 +257,8 @@ static int my_mb_wc_bin(CHARSET_INFO *cs __attribute__((unused)),
static int my_wc_mb_bin(CHARSET_INFO *cs __attribute__((unused)),
my_wc_t wc,
- unsigned char *s,
- unsigned char *e __attribute__((unused)))
+ uchar *s,
+ uchar *e __attribute__((unused)))
{
if (s >= e)
return MY_CS_TOOSMALL;
@@ -271,8 +272,32 @@ static int my_wc_mb_bin(CHARSET_INFO *cs __attribute__((unused)),
}
+void my_hash_sort_8bit_bin(CHARSET_INFO *cs __attribute__((unused)),
+ const uchar *key, size_t len,
+ ulong *nr1, ulong *nr2)
+{
+ const uchar *pos = key;
+
+ key+= len;
+
+ /*
+ Remove trailing spaces. We have to do this to be able to compare
+ 'A ' and 'A' as identical
+ */
+ while (key > pos && key[-1] == ' ')
+ key--;
+
+ for (; pos < (uchar*) key ; pos++)
+ {
+ nr1[0]^=(ulong) ((((uint) nr1[0] & 63)+nr2[0]) *
+ ((uint)*pos)) + (nr1[0] << 8);
+ nr2[0]+=3;
+ }
+}
+
+
void my_hash_sort_bin(CHARSET_INFO *cs __attribute__((unused)),
- const uchar *key, uint len,ulong *nr1, ulong *nr2)
+ const uchar *key, size_t len,ulong *nr1, ulong *nr2)
{
const uchar *pos = key;
@@ -374,9 +399,9 @@ int my_wildcmp_bin(CHARSET_INFO *cs,
}
-static int my_strnxfrm_bin(CHARSET_INFO *cs __attribute__((unused)),
- uchar * dest, uint dstlen,
- const uchar *src, uint srclen)
+static size_t my_strnxfrm_bin(CHARSET_INFO *cs __attribute__((unused)),
+ uchar *dest, size_t dstlen,
+ const uchar *src, size_t srclen)
{
if (dest != src)
memcpy(dest, src, min(dstlen,srclen));
@@ -387,9 +412,9 @@ static int my_strnxfrm_bin(CHARSET_INFO *cs __attribute__((unused)),
static
-int my_strnxfrm_8bit_bin(CHARSET_INFO *cs __attribute__((unused)),
- uchar * dest, uint dstlen,
- const uchar *src, uint srclen)
+size_t my_strnxfrm_8bit_bin(CHARSET_INFO *cs __attribute__((unused)),
+ uchar *dest, size_t dstlen,
+ const uchar *src, size_t srclen)
{
if (dest != src)
memcpy(dest, src, min(dstlen,srclen));
@@ -401,8 +426,8 @@ int my_strnxfrm_8bit_bin(CHARSET_INFO *cs __attribute__((unused)),
static
uint my_instr_bin(CHARSET_INFO *cs __attribute__((unused)),
- const char *b, uint b_length,
- const char *s, uint s_length,
+ const char *b, size_t b_length,
+ const char *s, size_t s_length,
my_match_t *match, uint nmatch)
{
register const uchar *str, *search, *end, *search_end;
@@ -442,7 +467,7 @@ skip:
if (nmatch > 0)
{
match[0].beg= 0;
- match[0].end= (uint) (str- (const uchar*)b-1);
+ match[0].end= (size_t) (str- (const uchar*)b-1);
match[0].mb_len= match[0].end;
if (nmatch > 1)
@@ -462,65 +487,65 @@ skip:
MY_COLLATION_HANDLER my_collation_8bit_bin_handler =
{
- my_coll_init_8bit_bin,
- my_strnncoll_8bit_bin,
- my_strnncollsp_8bit_bin,
- my_strnxfrm_8bit_bin,
- my_strnxfrmlen_simple,
- my_like_range_simple,
- my_wildcmp_bin,
- my_strcasecmp_bin,
- my_instr_bin,
- my_hash_sort_bin,
- my_propagate_simple
+ my_coll_init_8bit_bin,
+ my_strnncoll_8bit_bin,
+ my_strnncollsp_8bit_bin,
+ my_strnxfrm_8bit_bin,
+ my_strnxfrmlen_simple,
+ my_like_range_simple,
+ my_wildcmp_bin,
+ my_strcasecmp_bin,
+ my_instr_bin,
+ my_hash_sort_8bit_bin,
+ my_propagate_simple
};
static MY_COLLATION_HANDLER my_collation_binary_handler =
{
- NULL, /* init */
- my_strnncoll_binary,
- my_strnncollsp_binary,
- my_strnxfrm_bin,
- my_strnxfrmlen_simple,
- my_like_range_simple,
- my_wildcmp_bin,
- my_strcasecmp_bin,
- my_instr_bin,
- my_hash_sort_bin,
- my_propagate_simple
+ NULL, /* init */
+ my_strnncoll_binary,
+ my_strnncollsp_binary,
+ my_strnxfrm_bin,
+ my_strnxfrmlen_simple,
+ my_like_range_simple,
+ my_wildcmp_bin,
+ my_strcasecmp_bin,
+ my_instr_bin,
+ my_hash_sort_bin,
+ my_propagate_simple
};
static MY_CHARSET_HANDLER my_charset_handler=
{
- NULL, /* init */
- NULL, /* ismbchar */
- my_mbcharlen_8bit, /* mbcharlen */
- my_numchars_8bit,
- my_charpos_8bit,
- my_well_formed_len_8bit,
- my_lengthsp_binary,
- my_numcells_8bit,
- my_mb_wc_bin,
- my_wc_mb_bin,
- my_mb_ctype_8bit,
- my_case_str_bin,
- my_case_str_bin,
- my_case_bin,
- my_case_bin,
- my_snprintf_8bit,
- my_long10_to_str_8bit,
- my_longlong10_to_str_8bit,
- my_fill_8bit,
- my_strntol_8bit,
- my_strntoul_8bit,
- my_strntoll_8bit,
- my_strntoull_8bit,
- my_strntod_8bit,
- my_strtoll10_8bit,
- my_strntoull10rnd_8bit,
- my_scan_8bit
+ NULL, /* init */
+ NULL, /* ismbchar */
+ my_mbcharlen_8bit, /* mbcharlen */
+ my_numchars_8bit,
+ my_charpos_8bit,
+ my_well_formed_len_8bit,
+ my_lengthsp_binary,
+ my_numcells_8bit,
+ my_mb_wc_bin,
+ my_wc_mb_bin,
+ my_mb_ctype_8bit,
+ my_case_str_bin,
+ my_case_str_bin,
+ my_case_bin,
+ my_case_bin,
+ my_snprintf_8bit,
+ my_long10_to_str_8bit,
+ my_longlong10_to_str_8bit,
+ my_fill_8bit,
+ my_strntol_8bit,
+ my_strntoul_8bit,
+ my_strntoll_8bit,
+ my_strntoull_8bit,
+ my_strntod_8bit,
+ my_strtoll10_8bit,
+ my_strntoull10rnd_8bit,
+ my_scan_8bit
};
diff --git a/strings/ctype-cp932.c b/strings/ctype-cp932.c
index dc8d1d7cb22..a0ff0314246 100644
--- a/strings/ctype-cp932.c
+++ b/strings/ctype-cp932.c
@@ -182,13 +182,13 @@ static uchar NEAR sort_order_cp932[]=
(0x80<=(c) && (c)<=0xfc))
-static int ismbchar_cp932(CHARSET_INFO *cs __attribute__((unused)),
+static uint ismbchar_cp932(CHARSET_INFO *cs __attribute__((unused)),
const char* p, const char *e)
{
return (iscp932head((uchar) *p) && (e-p)>1 && iscp932tail((uchar)p[1]) ? 2: 0);
}
-static int mbcharlen_cp932(CHARSET_INFO *cs __attribute__((unused)),uint c)
+static uint mbcharlen_cp932(CHARSET_INFO *cs __attribute__((unused)),uint c)
{
return (iscp932head((uchar) c) ? 2 : 1);
}
@@ -198,8 +198,8 @@ static int mbcharlen_cp932(CHARSET_INFO *cs __attribute__((unused)),uint c)
static int my_strnncoll_cp932_internal(CHARSET_INFO *cs,
- const uchar **a_res, uint a_length,
- const uchar **b_res, uint b_length)
+ const uchar **a_res, size_t a_length,
+ const uchar **b_res, size_t b_length)
{
const uchar *a= *a_res, *b= *b_res;
const uchar *a_end= a + a_length;
@@ -230,8 +230,8 @@ static int my_strnncoll_cp932_internal(CHARSET_INFO *cs,
static int my_strnncoll_cp932(CHARSET_INFO *cs __attribute__((unused)),
- const uchar *a, uint a_length,
- const uchar *b, uint b_length,
+ const uchar *a, size_t a_length,
+ const uchar *b, size_t b_length,
my_bool b_is_prefix)
{
int res= my_strnncoll_cp932_internal(cs, &a, a_length, &b, b_length);
@@ -242,17 +242,24 @@ static int my_strnncoll_cp932(CHARSET_INFO *cs __attribute__((unused)),
static int my_strnncollsp_cp932(CHARSET_INFO *cs __attribute__((unused)),
- const uchar *a, uint a_length,
- const uchar *b, uint b_length,
+ const uchar *a, size_t a_length,
+ const uchar *b, size_t b_length,
my_bool diff_if_only_endspace_difference
__attribute__((unused)))
{
const uchar *a_end= a + a_length;
const uchar *b_end= b + b_length;
int res= my_strnncoll_cp932_internal(cs, &a, a_length, &b, b_length);
+
+#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE
+ diff_if_only_endspace_difference= 0;
+#endif
+
if (!res && (a != a_end || b != b_end))
{
- int swap= 0;
+ int swap= 1;
+ if (diff_if_only_endspace_difference)
+ res= 1; /* Assume 'a' is bigger */
/*
Check the next not space character of the longer key. If it's < ' ',
then it's smaller than the other key.
@@ -263,11 +270,12 @@ static int my_strnncollsp_cp932(CHARSET_INFO *cs __attribute__((unused)),
a_end= b_end;
a= b;
swap= -1; /* swap sign of result */
+ res= -res;
}
for (; a < a_end ; a++)
{
- if (*a != ' ')
- return ((int) *a - (int) ' ') ^ swap;
+ if (*a != (uchar) ' ')
+ return (*a < (uchar) ' ') ? -swap : swap;
}
}
return res;
@@ -275,9 +283,9 @@ static int my_strnncollsp_cp932(CHARSET_INFO *cs __attribute__((unused)),
-static int my_strnxfrm_cp932(CHARSET_INFO *cs __attribute__((unused)),
- uchar *dest, uint len,
- const uchar *src, uint srclen)
+static size_t my_strnxfrm_cp932(CHARSET_INFO *cs __attribute__((unused)),
+ uchar *dest, size_t len,
+ const uchar *src, size_t srclen)
{
uchar *d_end = dest + len;
uchar *s_end = (uchar*) src + srclen;
@@ -318,10 +326,11 @@ static int my_strnxfrm_cp932(CHARSET_INFO *cs __attribute__((unused)),
#define max_sort_char ((char) 255)
static my_bool my_like_range_cp932(CHARSET_INFO *cs __attribute__((unused)),
- const char *ptr,uint ptr_length,
- pbool escape, pbool w_one, pbool w_many,
- uint res_length, char *min_str,char *max_str,
- uint *min_length,uint *max_length)
+ const char *ptr,size_t ptr_length,
+ pbool escape, pbool w_one, pbool w_many,
+ size_t res_length,
+ char *min_str,char *max_str,
+ size_t *min_length, size_t *max_length)
{
const char *end=ptr+ptr_length;
char *min_org=min_str;
@@ -350,7 +359,7 @@ static my_bool my_like_range_cp932(CHARSET_INFO *cs __attribute__((unused)),
}
if (*ptr == w_many)
{ /* '%' in SQL */
- *min_length = (uint)(min_str - min_org);
+ *min_length = (size_t)(min_str - min_org);
*max_length = res_length;
do
{
@@ -361,7 +370,7 @@ static my_bool my_like_range_cp932(CHARSET_INFO *cs __attribute__((unused)),
}
*min_str++ = *max_str++ = *ptr++;
}
- *min_length = *max_length = (uint)(min_str - min_org);
+ *min_length = *max_length = (size_t) (min_str - min_org);
while (min_str < min_end)
*min_str++ = *max_str++ = ' '; /* Because if key compression */
return 0;
@@ -5378,12 +5387,12 @@ my_mb_wc_cp932(CHARSET_INFO *cs __attribute__((unused)),
}
static
-uint my_numcells_cp932(CHARSET_INFO *cs __attribute__((unused)),
+size_t my_numcells_cp932(CHARSET_INFO *cs __attribute__((unused)),
const char *str, const char *str_end)
{
- uint clen= 0;
- const unsigned char *b= (const unsigned char *) str;
- const unsigned char *e= (const unsigned char *) str_end;
+ size_t clen= 0;
+ const uchar *b= (const uchar *) str;
+ const uchar *e= (const uchar *) str_end;
for (clen= 0; b < e; )
{
@@ -5410,9 +5419,11 @@ uint my_numcells_cp932(CHARSET_INFO *cs __attribute__((unused)),
Returns a well formed length of a cp932 string.
cp932 additional characters are also accepted.
*/
+
static
-uint my_well_formed_len_cp932(CHARSET_INFO *cs __attribute__((unused)),
- const char *b, const char *e, uint pos, int *error)
+size_t my_well_formed_len_cp932(CHARSET_INFO *cs __attribute__((unused)),
+ const char *b, const char *e,
+ size_t pos, int *error)
{
const char *b0= b;
*error= 0;
@@ -5445,7 +5456,7 @@ uint my_well_formed_len_cp932(CHARSET_INFO *cs __attribute__((unused)),
break;
}
}
- return (uint) (b - b0);
+ return (size_t) (b - b0);
}
diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c
index d0104a50f4a..a5df86cc6b3 100644
--- a/strings/ctype-czech.c
+++ b/strings/ctype-czech.c
@@ -83,7 +83,7 @@
below for what are the "special values"
*/
-static uchar * CZ_SORT_TABLE[] = {
+static uchar *CZ_SORT_TABLE[] = {
(uchar*) "\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\043\044\045\046\047\050\051\052\053\054\000\000\000\000\000\000\000\003\004\377\007\010\011\012\013\015\016\017\020\022\023\024\025\026\027\031\033\034\035\036\037\040\041\000\000\000\000\000\000\003\004\377\007\010\011\012\013\015\016\017\020\022\023\024\025\026\027\031\033\034\035\036\037\040\041\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\000\021\000\020\032\000\000\032\032\033\042\000\042\042\000\003\000\021\000\020\032\000\000\032\032\033\042\000\042\042\027\003\003\003\003\020\006\006\006\010\010\010\010\015\015\007\007\023\023\024\024\024\024\000\030\034\034\034\034\040\033\000\027\003\003\003\003\020\006\006\006\010\010\010\010\015\015\007\007\023\023\024\024\024\024\000\030\034\034\034\034\040\033\000",
(uchar*) "\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\106\107\110\111\112\113\114\115\116\117\000\000\000\000\000\000\000\003\011\377\016\021\026\027\030\032\035\036\037\043\044\047\054\055\056\061\065\070\075\076\077\100\102\000\000\000\000\000\000\003\011\377\016\021\026\027\030\032\035\036\037\043\044\047\054\055\056\061\065\070\075\076\077\100\102\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\010\000\042\000\041\063\000\000\062\064\066\104\000\103\105\000\010\000\042\000\041\063\000\000\062\064\066\104\000\103\105\057\004\005\007\006\040\014\015\013\022\025\024\023\033\034\017\020\046\045\050\051\053\052\000\060\072\071\074\073\101\067\000\057\004\005\007\006\040\014\015\013\022\025\024\023\033\034\017\020\046\045\050\051\053\052\000\060\072\071\074\073\101\067\000",
(uchar*) "\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\212\213\214\215\216\217\220\221\222\223\000\000\000\000\000\000\000\004\020\377\032\040\052\054\056\063\071\073\075\105\107\115\127\131\133\141\151\157\171\173\175\177\203\000\000\000\000\000\000\003\017\377\031\037\051\053\055\062\070\072\074\104\106\114\126\130\132\140\150\156\170\172\174\176\202\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\103\000\101\145\000\000\143\147\153\207\000\205\211\000\015\000\102\000\100\144\000\000\142\146\152\206\000\204\210\135\006\010\014\012\077\026\030\024\042\050\046\044\065\067\034\036\113\111\117\121\125\123\000\137\163\161\167\165\201\155\000\134\005\007\013\011\076\025\027\023\041\047\045\043\064\066\033\035\112\110\116\120\124\122\000\136\162\160\166\164\200\154\000",
@@ -99,7 +99,7 @@ static uchar * CZ_SORT_TABLE[] = {
struct wordvalue
{
const char * word;
- uchar * outvalue;
+ uchar *outvalue;
};
static struct wordvalue doubles[] = {
{ "ch", (uchar*) "\014\031\057\057" },
@@ -190,8 +190,8 @@ while (1) \
{ p++; continue; } /* ignore value */ \
if (value == 2) /* space */ \
{ \
- const uchar * tmp; \
- const uchar * runner = ++p; \
+ const uchar *tmp; \
+ const uchar *runner = ++p; \
while (!(IS_END(runner, src, len)) && (CZ_SORT_TABLE[pass][*runner] == 2)) \
runner++; /* skip all spaces */ \
if (IS_END(runner, src, len) && SKIP_TRAILING_SPACES) \
@@ -240,12 +240,12 @@ while (1) \
*/
static int my_strnncoll_czech(CHARSET_INFO *cs __attribute__((unused)),
- const uchar * s1, uint len1,
- const uchar * s2, uint len2,
+ const uchar *s1, size_t len1,
+ const uchar *s2, size_t len2,
my_bool s2_is_prefix)
{
int v1, v2;
- const uchar * p1, * p2, * store1, * store2;
+ const uchar *p1, * p2, * store1, * store2;
int pass1 = 0, pass2 = 0;
if (s2_is_prefix && len1 > len2)
@@ -274,8 +274,8 @@ static int my_strnncoll_czech(CHARSET_INFO *cs __attribute__((unused)),
static
int my_strnncollsp_czech(CHARSET_INFO * cs,
- const uchar *s, uint slen,
- const uchar *t, uint tlen,
+ const uchar *s, size_t slen,
+ const uchar *t, size_t tlen,
my_bool diff_if_only_endspace_difference
__attribute__((unused)))
{
@@ -290,14 +290,14 @@ int my_strnncollsp_czech(CHARSET_INFO * cs,
the length of the strings being specified
*/
-static int my_strnxfrm_czech(CHARSET_INFO *cs __attribute__((unused)),
- uchar * dest, uint len,
- const uchar * src, uint srclen)
+static size_t my_strnxfrm_czech(CHARSET_INFO *cs __attribute__((unused)),
+ uchar *dest, size_t len,
+ const uchar *src, size_t srclen)
{
int value;
- const uchar * p, * store;
+ const uchar *p, * store;
int pass = 0;
- uint totlen = 0;
+ size_t totlen = 0;
p = src; store = src;
do
@@ -361,11 +361,11 @@ static int my_strnxfrm_czech(CHARSET_INFO *cs __attribute__((unused)),
#define EXAMPLE
static my_bool my_like_range_czech(CHARSET_INFO *cs __attribute__((unused)),
- const char *ptr,uint ptr_length,
+ const char *ptr,size_t ptr_length,
pbool escape, pbool w_one, pbool w_many,
- uint res_length, char *min_str,
+ size_t res_length, char *min_str,
char *max_str,
- uint *min_length,uint *max_length)
+ size_t *min_length,size_t *max_length)
{
#ifdef EXAMPLE
uchar value;
@@ -396,7 +396,7 @@ static my_bool my_like_range_czech(CHARSET_INFO *cs __attribute__((unused)),
}
if (cs->state & MY_CS_BINSORT)
- *min_length= (uint) (min_str - min_org);
+ *min_length= (size_t) (min_str - min_org);
else
{
/* 'a\0\0... is the smallest possible string */
diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c
index a90489cf7c6..844d8cc3ff5 100644
--- a/strings/ctype-euc_kr.c
+++ b/strings/ctype-euc_kr.c
@@ -182,15 +182,15 @@ static uchar NEAR sort_order_euc_kr[]=
#define iseuc_kr(c) ((0xa1<=(uchar)(c) && (uchar)(c)<=0xfe))
-static int ismbchar_euc_kr(CHARSET_INFO *cs __attribute__((unused)),
- const char* p, const char *e)
+static uint ismbchar_euc_kr(CHARSET_INFO *cs __attribute__((unused)),
+ const char* p, const char *e)
{
return ((*(uchar*)(p)<0x80)? 0:\
iseuc_kr(*(p)) && (e)-(p)>1 && iseuc_kr(*((p)+1))? 2:\
0);
}
-static int mbcharlen_euc_kr(CHARSET_INFO *cs __attribute__((unused)),uint c)
+static uint mbcharlen_euc_kr(CHARSET_INFO *cs __attribute__((unused)),uint c)
{
return (iseuc_kr(c) ? 2 : 1);
}
@@ -8608,6 +8608,7 @@ my_wc_mb_euc_kr(CHARSET_INFO *cs __attribute__((unused)),
return 2;
}
+
static int
my_mb_wc_euc_kr(CHARSET_INFO *cs __attribute__((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e)
@@ -8637,10 +8638,10 @@ my_mb_wc_euc_kr(CHARSET_INFO *cs __attribute__((unused)),
/*
Returns well formed length of a EUC-KR string.
*/
-static uint
+static size_t
my_well_formed_len_euckr(CHARSET_INFO *cs __attribute__((unused)),
const char *b, const char *e,
- uint pos, int *error)
+ size_t pos, int *error)
{
const char *b0= b;
const char *emb= e - 1; /* Last possible end of an MB character */
@@ -8665,7 +8666,7 @@ my_well_formed_len_euckr(CHARSET_INFO *cs __attribute__((unused)),
break;
}
}
- return (uint) (b - b0);
+ return (size_t) (b - b0);
}
diff --git a/strings/ctype-eucjpms.c b/strings/ctype-eucjpms.c
index eb1811b19bf..14be5e84d21 100644
--- a/strings/ctype-eucjpms.c
+++ b/strings/ctype-eucjpms.c
@@ -185,7 +185,7 @@ static uchar NEAR sort_order_eucjpms[]=
#define iseucjpms_ss3(c) (((c)&0xff) == 0x8f)
-static int ismbchar_eucjpms(CHARSET_INFO *cs __attribute__((unused)),
+static uint ismbchar_eucjpms(CHARSET_INFO *cs __attribute__((unused)),
const char* p, const char *e)
{
return ((*(uchar*)(p)<0x80)? 0:\
@@ -195,7 +195,7 @@ static int ismbchar_eucjpms(CHARSET_INFO *cs __attribute__((unused)),
0);
}
-static int mbcharlen_eucjpms(CHARSET_INFO *cs __attribute__((unused)),uint c)
+static uint mbcharlen_eucjpms(CHARSET_INFO *cs __attribute__((unused)),uint c)
{
return (iseucjpms(c)? 2: iseucjpms_ss2(c)? 2: iseucjpms_ss3(c)? 3: 1);
}
@@ -8387,8 +8387,9 @@ my_jisx0212_uni_onechar(int code){
*/
static
-uint my_well_formed_len_eucjpms(CHARSET_INFO *cs __attribute__((unused)),
- const char *beg, const char *end, uint pos, int *error)
+size_t my_well_formed_len_eucjpms(CHARSET_INFO *cs __attribute__((unused)),
+ const char *beg, const char *end, size_t pos,
+ int *error)
{
const uchar *b= (uchar *) beg;
*error=0;
@@ -8427,19 +8428,19 @@ uint my_well_formed_len_eucjpms(CHARSET_INFO *cs __attribute__((unused)),
*b >= 0xA1 && *b <= 0xFE) /* [xA1-xFE][xA1-xFE] */
continue;
*error=1;
- return (uint) (chbeg - beg); /* invalid sequence */
+ return (size_t) (chbeg - beg); /* invalid sequence */
}
- return (uint) (b - (uchar *) beg);
+ return (size_t) (b - (uchar *) beg);
}
static
-uint my_numcells_eucjp(CHARSET_INFO *cs __attribute__((unused)),
- const char *str, const char *str_end)
+size_t my_numcells_eucjp(CHARSET_INFO *cs __attribute__((unused)),
+ const char *str, const char *str_end)
{
- uint clen= 0;
- const unsigned char *b= (const unsigned char *) str;
- const unsigned char *e= (const unsigned char *) str_end;
+ size_t clen;
+ const uchar *b= (const uchar *) str;
+ const uchar *e= (const uchar *) str_end;
for (clen= 0; b < e; )
{
@@ -8555,9 +8556,9 @@ my_mb_wc_euc_jp(CHARSET_INFO *cs,my_wc_t *pwc, const uchar *s, const uchar *e)
}
static int
-my_wc_mb_euc_jp(CHARSET_INFO *c,my_wc_t wc, unsigned char *s, unsigned char *e)
+my_wc_mb_euc_jp(CHARSET_INFO *c,my_wc_t wc, uchar *s, uchar *e)
{
- unsigned char c1;
+ uchar c1;
int jp;
if (s >= e)
diff --git a/strings/ctype-extra.c b/strings/ctype-extra.c
index 2b66989ed3e..75244e40435 100644
--- a/strings/ctype-extra.c
+++ b/strings/ctype-extra.c
@@ -6,6 +6,21 @@
./conf_to_src ../sql/share/charsets/ > FILE
*/
+/* Copyright (C) 2000-2007 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 <m_ctype.h>
@@ -879,9 +894,9 @@ uchar sort_order_ascii_general_ci[] = {
0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
-0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5C,0x5D,0x5B,0x5E,0x5F,
-0x45,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
-0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x59,0x7F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
@@ -908,7 +923,7 @@ uint16 to_uni_ascii_general_ci[] = {
0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
-0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x0000,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
@@ -4589,7 +4604,7 @@ uint16 to_uni_ascii_bin[] = {
0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
-0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x0000,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
@@ -6822,7 +6837,7 @@ CHARSET_INFO compiled_charsets[] = {
#ifdef HAVE_CHARSET_ascii
{
11,0,0,
- MY_CS_COMPILED|MY_CS_PRIMARY,
+ MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_PUREASCII,
"ascii", /* cset name */
"ascii_general_ci", /* coll name */
"", /* comment */
@@ -7911,7 +7926,7 @@ CHARSET_INFO compiled_charsets[] = {
#ifdef HAVE_CHARSET_ascii
{
65,0,0,
- MY_CS_COMPILED|MY_CS_BINSORT,
+ MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_PUREASCII,
"ascii", /* cset name */
"ascii_bin", /* coll name */
"", /* comment */
diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c
index 6b4238859d5..21aeb8b7990 100644
--- a/strings/ctype-gb2312.c
+++ b/strings/ctype-gb2312.c
@@ -165,13 +165,13 @@ static uchar NEAR sort_order_gb2312[]=
#define isgb2312tail(c) (0xa1<=(uchar)(c) && (uchar)(c)<=0xfe)
-static int ismbchar_gb2312(CHARSET_INFO *cs __attribute__((unused)),
+static uint ismbchar_gb2312(CHARSET_INFO *cs __attribute__((unused)),
const char* p, const char *e)
{
return (isgb2312head(*(p)) && (e)-(p)>1 && isgb2312tail(*((p)+1))? 2: 0);
}
-static int mbcharlen_gb2312(CHARSET_INFO *cs __attribute__((unused)),uint c)
+static uint mbcharlen_gb2312(CHARSET_INFO *cs __attribute__((unused)),uint c)
{
return (isgb2312head(c)? 2 : 1);
}
@@ -5688,10 +5688,10 @@ my_mb_wc_gb2312(CHARSET_INFO *cs __attribute__((unused)),
/*
Returns well formed length of a EUC-KR string.
*/
-static uint
+static size_t
my_well_formed_len_gb2312(CHARSET_INFO *cs __attribute__((unused)),
const char *b, const char *e,
- uint pos, int *error)
+ size_t pos, int *error)
{
const char *b0= b;
const char *emb= e - 1; /* Last possible end of an MB character */
@@ -5716,7 +5716,7 @@ my_well_formed_len_gb2312(CHARSET_INFO *cs __attribute__((unused)),
break;
}
}
- return (uint) (b - b0);
+ return (size_t) (b - b0);
}
diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c
index d88f4786017..c7a2558eb37 100644
--- a/strings/ctype-gbk.c
+++ b/strings/ctype-gbk.c
@@ -2582,7 +2582,7 @@ static uint16 gbksortorder(uint16 i)
int my_strnncoll_gbk_internal(const uchar **a_res, const uchar **b_res,
- uint length)
+ size_t length)
{
const uchar *a= *a_res, *b= *b_res;
uint a_char,b_char;
@@ -2612,22 +2612,22 @@ int my_strnncoll_gbk_internal(const uchar **a_res, const uchar **b_res,
int my_strnncoll_gbk(CHARSET_INFO *cs __attribute__((unused)),
- const uchar *a, uint a_length,
- const uchar *b, uint b_length,
+ const uchar *a, size_t a_length,
+ const uchar *b, size_t b_length,
my_bool b_is_prefix)
{
- uint length= min(a_length, b_length);
+ size_t length= min(a_length, b_length);
int res= my_strnncoll_gbk_internal(&a, &b, length);
return res ? res : (int) ((b_is_prefix ? length : a_length) - b_length);
}
static int my_strnncollsp_gbk(CHARSET_INFO * cs __attribute__((unused)),
- const uchar *a, uint a_length,
- const uchar *b, uint b_length,
+ const uchar *a, size_t a_length,
+ const uchar *b, size_t b_length,
my_bool diff_if_only_endspace_difference)
{
- uint length= min(a_length, b_length);
+ size_t length= min(a_length, b_length);
int res= my_strnncoll_gbk_internal(&a, &b, length);
#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE
@@ -2662,12 +2662,12 @@ static int my_strnncollsp_gbk(CHARSET_INFO * cs __attribute__((unused)),
}
-static int my_strnxfrm_gbk(CHARSET_INFO *cs __attribute__((unused)),
- uchar * dest, uint len,
- const uchar * src, uint srclen)
+static size_t my_strnxfrm_gbk(CHARSET_INFO *cs __attribute__((unused)),
+ uchar *dest, size_t len,
+ const uchar *src, size_t srclen)
{
uint16 e;
- uint dstlen= len;
+ size_t dstlen= len;
len = srclen;
while (len--)
@@ -2708,15 +2708,16 @@ static int my_strnxfrm_gbk(CHARSET_INFO *cs __attribute__((unused)),
#define max_sort_char ((uchar) 255)
static my_bool my_like_range_gbk(CHARSET_INFO *cs __attribute__((unused)),
- const char *ptr,uint ptr_length,
+ const char *ptr,size_t ptr_length,
pbool escape, pbool w_one, pbool w_many,
- uint res_length, char *min_str,char *max_str,
- uint *min_length,uint *max_length)
+ size_t res_length,
+ char *min_str,char *max_str,
+ size_t *min_length,size_t *max_length)
{
const char *end= ptr + ptr_length;
char *min_org=min_str;
char *min_end=min_str+res_length;
- uint charlen= res_length / cs->mbmaxlen;
+ size_t charlen= res_length / cs->mbmaxlen;
for (; ptr != end && min_str != min_end && charlen > 0; ptr++, charlen--)
{
@@ -2748,7 +2749,7 @@ static my_bool my_like_range_gbk(CHARSET_INFO *cs __attribute__((unused)),
'a\0\0... is the smallest possible string when we have space expand
a\ff\ff... is the biggest possible string
*/
- *min_length= ((cs->state & MY_CS_BINSORT) ? (uint) (min_str - min_org) :
+ *min_length= ((cs->state & MY_CS_BINSORT) ? (size_t) (min_str - min_org) :
res_length);
*max_length= res_length;
do {
@@ -2760,20 +2761,20 @@ static my_bool my_like_range_gbk(CHARSET_INFO *cs __attribute__((unused)),
*min_str++= *max_str++ = *ptr;
}
- *min_length= *max_length = (uint) (min_str - min_org);
+ *min_length= *max_length = (size_t) (min_str - min_org);
while (min_str != min_end)
*min_str++= *max_str++= ' '; /* Because if key compression */
return 0;
}
-static int ismbchar_gbk(CHARSET_INFO *cs __attribute__((unused)),
+static uint ismbchar_gbk(CHARSET_INFO *cs __attribute__((unused)),
const char* p, const char *e)
{
return (isgbkhead(*(p)) && (e)-(p)>1 && isgbktail(*((p)+1))? 2: 0);
}
-static int mbcharlen_gbk(CHARSET_INFO *cs __attribute__((unused)),uint c)
+static uint mbcharlen_gbk(CHARSET_INFO *cs __attribute__((unused)),uint c)
{
return (isgbkhead(c)? 2 : 1);
}
@@ -9940,9 +9941,9 @@ my_mb_wc_gbk(CHARSET_INFO *cs __attribute__((unused)),
Returns well formed length of a GBK string.
*/
static
-uint my_well_formed_len_gbk(CHARSET_INFO *cs __attribute__((unused)),
- const char *b, const char *e,
- uint pos, int *error)
+size_t my_well_formed_len_gbk(CHARSET_INFO *cs __attribute__((unused)),
+ const char *b, const char *e,
+ size_t pos, int *error)
{
const char *b0= b;
const char *emb= e - 1; /* Last possible end of an MB character */
@@ -9967,7 +9968,7 @@ uint my_well_formed_len_gbk(CHARSET_INFO *cs __attribute__((unused)),
break;
}
}
- return (uint) (b - b0);
+ return (size_t) (b - b0);
}
@@ -10047,7 +10048,7 @@ CHARSET_INFO my_charset_gbk_chinese_ci=
0, /* min_sort_char */
255, /* max_sort_char */
' ', /* pad char */
- 0, /* escape_with_backslash_is_dangerous */
+ 1, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
&my_collation_ci_handler
};
@@ -10079,7 +10080,7 @@ CHARSET_INFO my_charset_gbk_bin=
0, /* min_sort_char */
255, /* max_sort_char */
' ', /* pad char */
- 0, /* escape_with_backslash_is_dangerous */
+ 1, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
&my_collation_mb_bin_handler
};
diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c
index 30e0abb35d5..e5333c4101b 100644
--- a/strings/ctype-latin1.c
+++ b/strings/ctype-latin1.c
@@ -150,7 +150,7 @@ unsigned short cs_to_uni[256]={
0x00F0,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7,
0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FD,0x00FE,0x00FF
};
-unsigned char pl00[256]={
+uchar pl00[256]={
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
@@ -184,7 +184,7 @@ unsigned char pl00[256]={
0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,
0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
};
-unsigned char pl01[256]={
+uchar pl01[256]={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
@@ -218,7 +218,7 @@ unsigned char pl01[256]={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
-unsigned char pl02[256]={
+uchar pl02[256]={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
@@ -252,7 +252,7 @@ unsigned char pl02[256]={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
-unsigned char pl20[256]={
+uchar pl20[256]={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x96,0x97,0x00,0x00,0x00,
@@ -286,7 +286,7 @@ unsigned char pl20[256]={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
-unsigned char pl21[256]={
+uchar pl21[256]={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
@@ -320,7 +320,7 @@ unsigned char pl21[256]={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
-unsigned char *uni_to_cs[256]={
+uchar *uni_to_cs[256]={
pl00,pl01,pl02,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
@@ -358,8 +358,8 @@ NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL
static
int my_mb_wc_latin1(CHARSET_INFO *cs __attribute__((unused)),
my_wc_t *wc,
- const unsigned char *str,
- const unsigned char *end __attribute__((unused)))
+ const uchar *str,
+ const uchar *end __attribute__((unused)))
{
if (str >= end)
return MY_CS_TOOSMALL;
@@ -371,10 +371,10 @@ int my_mb_wc_latin1(CHARSET_INFO *cs __attribute__((unused)),
static
int my_wc_mb_latin1(CHARSET_INFO *cs __attribute__((unused)),
my_wc_t wc,
- unsigned char *str,
- unsigned char *end __attribute__((unused)))
+ uchar *str,
+ uchar *end __attribute__((unused)))
{
- unsigned char *pl;
+ uchar *pl;
if (str >= end)
return MY_CS_TOOSMALL;
@@ -543,8 +543,8 @@ uchar combo2map[]={
static int my_strnncoll_latin1_de(CHARSET_INFO *cs __attribute__((unused)),
- const uchar *a, uint a_length,
- const uchar *b, uint b_length,
+ const uchar *a, size_t a_length,
+ const uchar *b, size_t b_length,
my_bool b_is_prefix)
{
const uchar *a_end= a + a_length;
@@ -584,8 +584,8 @@ static int my_strnncoll_latin1_de(CHARSET_INFO *cs __attribute__((unused)),
static int my_strnncollsp_latin1_de(CHARSET_INFO *cs __attribute__((unused)),
- const uchar *a, uint a_length,
- const uchar *b, uint b_length,
+ const uchar *a, size_t a_length,
+ const uchar *b, size_t b_length,
my_bool diff_if_only_endspace_difference)
{
const uchar *a_end= a + a_length, *b_end= b + b_length;
@@ -655,9 +655,9 @@ static int my_strnncollsp_latin1_de(CHARSET_INFO *cs __attribute__((unused)),
}
-static int my_strnxfrm_latin1_de(CHARSET_INFO *cs __attribute__((unused)),
- uchar * dest, uint len,
- const uchar * src, uint srclen)
+static size_t my_strnxfrm_latin1_de(CHARSET_INFO *cs __attribute__((unused)),
+ uchar *dest, size_t len,
+ const uchar *src, size_t srclen)
{
const uchar *de = dest + len;
const uchar *se = src + srclen;
@@ -675,7 +675,7 @@ static int my_strnxfrm_latin1_de(CHARSET_INFO *cs __attribute__((unused)),
void my_hash_sort_latin1_de(CHARSET_INFO *cs __attribute__((unused)),
- const uchar *key, uint len,
+ const uchar *key, size_t len,
ulong *nr1, ulong *nr2)
{
const uchar *end= key+len;
diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c
index 4234ac091cd..903811e2ab9 100644
--- a/strings/ctype-mb.c
+++ b/strings/ctype-mb.c
@@ -20,7 +20,7 @@
#ifdef USE_MB
-uint my_caseup_str_mb(CHARSET_INFO * cs, char *str)
+size_t my_caseup_str_mb(CHARSET_INFO * cs, char *str)
{
register uint32 l;
register uchar *map= cs->to_upper;
@@ -37,10 +37,11 @@ uint my_caseup_str_mb(CHARSET_INFO * cs, char *str)
str++;
}
}
- return str - str_orig;
+ return (size_t) (str - str_orig);
}
-uint my_casedn_str_mb(CHARSET_INFO * cs, char *str)
+
+size_t my_casedn_str_mb(CHARSET_INFO * cs, char *str)
{
register uint32 l;
register uchar *map= cs->to_lower;
@@ -57,12 +58,13 @@ uint my_casedn_str_mb(CHARSET_INFO * cs, char *str)
str++;
}
}
- return str - str_orig;
+ return (size_t) (str - str_orig);
}
-uint my_caseup_mb(CHARSET_INFO * cs, char *src, uint srclen,
- char *dst __attribute__((unused)),
- uint dstlen __attribute__((unused)))
+
+size_t my_caseup_mb(CHARSET_INFO * cs, char *src, size_t srclen,
+ char *dst __attribute__((unused)),
+ size_t dstlen __attribute__((unused)))
{
register uint32 l;
register char *srcend= src + srclen;
@@ -82,9 +84,10 @@ uint my_caseup_mb(CHARSET_INFO * cs, char *src, uint srclen,
return srclen;
}
-uint my_casedn_mb(CHARSET_INFO * cs, char *src, uint srclen,
- char *dst __attribute__((unused)),
- uint dstlen __attribute__((unused)))
+
+size_t my_casedn_mb(CHARSET_INFO * cs, char *src, size_t srclen,
+ char *dst __attribute__((unused)),
+ size_t dstlen __attribute__((unused)))
{
register uint32 l;
register char *srcend= src + srclen;
@@ -104,9 +107,11 @@ uint my_casedn_mb(CHARSET_INFO * cs, char *src, uint srclen,
return srclen;
}
+
/*
my_strcasecmp_mb() returns 0 if strings are equal, non-zero otherwise.
*/
+
int my_strcasecmp_mb(CHARSET_INFO * cs,const char *s, const char *t)
{
register uint32 l;
@@ -250,10 +255,10 @@ int my_wildcmp_mb(CHARSET_INFO *cs,
}
-uint my_numchars_mb(CHARSET_INFO *cs __attribute__((unused)),
+size_t my_numchars_mb(CHARSET_INFO *cs __attribute__((unused)),
const char *pos, const char *end)
{
- register uint32 count=0;
+ register size_t count= 0;
while (pos < end)
{
uint mb_len;
@@ -264,8 +269,8 @@ uint my_numchars_mb(CHARSET_INFO *cs __attribute__((unused)),
}
-uint my_charpos_mb(CHARSET_INFO *cs __attribute__((unused)),
- const char *pos, const char *end, uint length)
+size_t my_charpos_mb(CHARSET_INFO *cs __attribute__((unused)),
+ const char *pos, const char *end, size_t length)
{
const char *start= pos;
@@ -275,12 +280,12 @@ uint my_charpos_mb(CHARSET_INFO *cs __attribute__((unused)),
pos+= (mb_len= my_ismbchar(cs, pos, end)) ? mb_len : 1;
length--;
}
- return (uint) (length ? end+2-start : pos-start);
+ return (size_t) (length ? end+2-start : pos-start);
}
-uint my_well_formed_len_mb(CHARSET_INFO *cs, const char *b, const char *e,
- uint pos, int *error)
+size_t my_well_formed_len_mb(CHARSET_INFO *cs, const char *b, const char *e,
+ size_t pos, int *error)
{
const char *b_start= b;
*error= 0;
@@ -297,14 +302,13 @@ uint my_well_formed_len_mb(CHARSET_INFO *cs, const char *b, const char *e,
b+= mb_len;
pos--;
}
- return (uint) (b - b_start);
+ return (size_t) (b - b_start);
}
-
uint my_instr_mb(CHARSET_INFO *cs,
- const char *b, uint b_length,
- const char *s, uint s_length,
+ const char *b, size_t b_length,
+ const char *s, size_t s_length,
my_match_t *match, uint nmatch)
{
register const char *end, *b0;
@@ -330,13 +334,13 @@ uint my_instr_mb(CHARSET_INFO *cs,
{
int mb_len;
- if (!cs->coll->strnncoll(cs, (unsigned char*) b, s_length,
- (unsigned char*) s, s_length, 0))
+ if (!cs->coll->strnncoll(cs, (uchar*) b, s_length,
+ (uchar*) s, s_length, 0))
{
if (nmatch)
{
match[0].beg= 0;
- match[0].end= (uint) (b-b0);
+ match[0].end= (size_t) (b-b0);
match[0].mb_len= res;
if (nmatch > 1)
{
@@ -360,11 +364,11 @@ uint my_instr_mb(CHARSET_INFO *cs,
/* BINARY collations handlers for MB charsets */
static int my_strnncoll_mb_bin(CHARSET_INFO * cs __attribute__((unused)),
- const uchar *s, uint slen,
- const uchar *t, uint tlen,
+ const uchar *s, size_t slen,
+ const uchar *t, size_t tlen,
my_bool t_is_prefix)
{
- uint len=min(slen,tlen);
+ size_t len=min(slen,tlen);
int cmp= memcmp(s,t,len);
return cmp ? cmp : (int) ((t_is_prefix ? len : slen) - tlen);
}
@@ -396,12 +400,12 @@ static int my_strnncoll_mb_bin(CHARSET_INFO * cs __attribute__((unused)),
*/
static int my_strnncollsp_mb_bin(CHARSET_INFO * cs __attribute__((unused)),
- const uchar *a, uint a_length,
- const uchar *b, uint b_length,
+ const uchar *a, size_t a_length,
+ const uchar *b, size_t b_length,
my_bool diff_if_only_endspace_difference)
{
const uchar *end;
- uint length;
+ size_t length;
int res;
#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE
@@ -442,9 +446,9 @@ static int my_strnncollsp_mb_bin(CHARSET_INFO * cs __attribute__((unused)),
}
-static int my_strnxfrm_mb_bin(CHARSET_INFO *cs __attribute__((unused)),
- uchar * dest, uint dstlen,
- const uchar *src, uint srclen)
+static size_t my_strnxfrm_mb_bin(CHARSET_INFO *cs __attribute__((unused)),
+ uchar *dest, size_t dstlen,
+ const uchar *src, size_t srclen)
{
if (dest != src)
memcpy(dest, src, min(dstlen, srclen));
@@ -461,12 +465,19 @@ static int my_strcasecmp_mb_bin(CHARSET_INFO * cs __attribute__((unused)),
}
static void my_hash_sort_mb_bin(CHARSET_INFO *cs __attribute__((unused)),
- const uchar *key, uint len,ulong *nr1, ulong *nr2)
+ const uchar *key, size_t len,ulong *nr1, ulong *nr2)
{
const uchar *pos = key;
key+= len;
+ /*
+ Remove trailing spaces. We have to do this to be able to compare
+ 'A ' and 'A' as identical
+ */
+ while (key > pos && key[-1] == ' ')
+ key--;
+
for (; pos < (uchar*) key ; pos++)
{
nr1[0]^=(ulong) ((((uint) nr1[0] & 63)+nr2[0]) *
@@ -544,18 +555,20 @@ static void pad_max_char(CHARSET_INFO *cs, char *str, char *end)
*/
my_bool my_like_range_mb(CHARSET_INFO *cs,
- const char *ptr,uint ptr_length,
+ const char *ptr,size_t ptr_length,
pbool escape, pbool w_one, pbool w_many,
- uint res_length,
+ size_t res_length,
char *min_str,char *max_str,
- uint *min_length,uint *max_length)
+ size_t *min_length,size_t *max_length)
{
uint mb_len;
const char *end= ptr + ptr_length;
char *min_org= min_str;
char *min_end= min_str + res_length;
char *max_end= max_str + res_length;
- uint maxcharlen= res_length / cs->mbmaxlen;
+ size_t maxcharlen= res_length / cs->mbmaxlen;
+ const char *contraction_flags= cs->contractions ?
+ ((const char*) cs->contractions) + 0x40*0x40 : NULL;
for (; ptr != end && min_str != min_end && maxcharlen ; maxcharlen--)
{
@@ -564,12 +577,13 @@ my_bool my_like_range_mb(CHARSET_INFO *cs,
ptr++; /* Skip escape */
else if (*ptr == w_one || *ptr == w_many) /* '_' and '%' in SQL */
{
+fill_max_and_min:
/*
Calculate length of keys:
'a\0\0... is the smallest possible string when we have space expand
a\ff\ff... is the biggest possible string
*/
- *min_length= ((cs->state & MY_CS_BINSORT) ? (uint) (min_str - min_org) :
+ *min_length= ((cs->state & MY_CS_BINSORT) ? (size_t) (min_str - min_org) :
res_length);
*max_length= res_length;
/* Create min key */
@@ -595,11 +609,77 @@ my_bool my_like_range_mb(CHARSET_INFO *cs,
*min_str++= *max_str++= *ptr++;
}
else
- *min_str++= *max_str++= *ptr++;
+ {
+ /*
+ Special case for collations with contractions.
+ For example, in Chezh, 'ch' is a separate letter
+ which is sorted between 'h' and 'i'.
+ If the pattern 'abc%', 'c' at the end can mean:
+ - letter 'c' itself,
+ - beginning of the contraction 'ch'.
+
+ If we simply return this LIKE range:
+
+ 'abc\min\min\min' and 'abc\max\max\max'
+
+ then this query: SELECT * FROM t1 WHERE a LIKE 'abc%'
+ will only find values starting from 'abc[^h]',
+ but won't find values starting from 'abch'.
+
+ We must ignore contraction heads followed by w_one or w_many.
+ ('Contraction head' means any letter which can be the first
+ letter in a contraction)
+
+ For example, for Czech 'abc%', we will return LIKE range,
+ which is equal to LIKE range for 'ab%':
+ 'ab\min\min\min\min' and 'ab\max\max\max\max'.
+
+ */
+ if (contraction_flags && ptr + 1 < end &&
+ contraction_flags[(uchar) *ptr])
+ {
+ /* Ptr[0] is a contraction head. */
+
+ if (ptr[1] == w_one || ptr[1] == w_many)
+ {
+ /* Contraction head followed by a wildcard, quit. */
+ goto fill_max_and_min;
+ }
+
+ /*
+ Some letters can be both contraction heads and contraction tails.
+ For example, in Danish 'aa' is a separate single letter which
+ is sorted after 'z'. So 'a' can be both head and tail.
+
+ If ptr[0]+ptr[1] is a contraction,
+ then put both letters together.
+
+ If ptr[1] can be a contraction part, but ptr[0]+ptr[1]
+ is not a contraction, then we put only ptr[0],
+ and continue with ptr[1] on the next loop.
+ */
+ if (contraction_flags[(uchar) ptr[1]] &&
+ cs->contractions[(*ptr-0x40)*0x40 + ptr[1] - 0x40])
+ {
+ /* Contraction found */
+ if (maxcharlen == 1 || min_str + 1 >= min_end)
+ {
+ /* Both contraction parts don't fit, quit */
+ goto fill_max_and_min;
+ }
+
+ /* Put contraction head */
+ *min_str++= *max_str++= *ptr++;
+ maxcharlen--;
+ }
+ }
+ /* Put contraction tail, or a single character */
+ *min_str++= *max_str++= *ptr++;
+ }
}
- *min_length= *max_length = (uint) (min_str - min_org);
+ *min_length= *max_length = (size_t) (min_str - min_org);
while (min_str != min_end)
*min_str++= *max_str++= ' '; /* Because if key compression */
return 0;
@@ -919,10 +999,11 @@ static struct {int page; char *p;} utr11_data[256]=
{0,NULL},{1,NULL},{0,pgFA},{0,NULL},{0,NULL},{0,NULL},{0,pgFE},{0,pgFF}
};
-uint my_numcells_mb(CHARSET_INFO *cs, const char *b, const char *e)
+
+size_t my_numcells_mb(CHARSET_INFO *cs, const char *b, const char *e)
{
my_wc_t wc;
- int clen= 0;
+ size_t clen= 0;
while (b < e)
{
@@ -944,7 +1025,7 @@ uint my_numcells_mb(CHARSET_INFO *cs, const char *b, const char *e)
int my_mb_ctype_mb(CHARSET_INFO *cs, int *ctype,
- const unsigned char *s, const unsigned char *e)
+ const uchar *s, const uchar *e)
{
my_wc_t wc;
int res= cs->cset->mb_wc(cs, &wc, s, e);
@@ -958,7 +1039,6 @@ int my_mb_ctype_mb(CHARSET_INFO *cs, int *ctype,
}
-
MY_COLLATION_HANDLER my_collation_mb_bin_handler =
{
NULL, /* init */
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index c129f117744..6b71f29f0d2 100644
--- a/strings/ctype-simple.c
+++ b/strings/ctype-simple.c
@@ -24,7 +24,8 @@
/*
Returns the number of bytes required for strnxfrm().
*/
-uint my_strnxfrmlen_simple(CHARSET_INFO *cs, uint len)
+
+size_t my_strnxfrmlen_simple(CHARSET_INFO *cs, size_t len)
{
return len * (cs->strxfrm_multiply ? cs->strxfrm_multiply : 1);
}
@@ -70,12 +71,12 @@ uint my_strnxfrmlen_simple(CHARSET_INFO *cs, uint len)
*/
-int my_strnxfrm_simple(CHARSET_INFO * cs,
- uchar *dest, uint len,
- const uchar *src, uint srclen)
+size_t my_strnxfrm_simple(CHARSET_INFO * cs,
+ uchar *dest, size_t len,
+ const uchar *src, size_t srclen)
{
uchar *map= cs->sort_order;
- uint dstlen= len;
+ size_t dstlen= len;
set_if_smaller(len, srclen);
if (dest != src)
{
@@ -94,11 +95,12 @@ int my_strnxfrm_simple(CHARSET_INFO * cs,
return dstlen;
}
-int my_strnncoll_simple(CHARSET_INFO * cs, const uchar *s, uint slen,
- const uchar *t, uint tlen,
+
+int my_strnncoll_simple(CHARSET_INFO * cs, const uchar *s, size_t slen,
+ const uchar *t, size_t tlen,
my_bool t_is_prefix)
{
- int len = ( slen > tlen ) ? tlen : slen;
+ size_t len = ( slen > tlen ) ? tlen : slen;
uchar *map= cs->sort_order;
if (t_is_prefix && slen > tlen)
slen=tlen;
@@ -107,7 +109,11 @@ int my_strnncoll_simple(CHARSET_INFO * cs, const uchar *s, uint slen,
if (map[*s++] != map[*t++])
return ((int) map[s[-1]] - (int) map[t[-1]]);
}
- return (int) (slen - tlen);
+ /*
+ We can't use (slen - tlen) here as the result may be outside of the
+ precision of a signed int
+ */
+ return slen > tlen ? 1 : slen < tlen ? -1 : 0 ;
}
@@ -141,12 +147,12 @@ int my_strnncoll_simple(CHARSET_INFO * cs, const uchar *s, uint slen,
> 0 a > b
*/
-int my_strnncollsp_simple(CHARSET_INFO * cs, const uchar *a, uint a_length,
- const uchar *b, uint b_length,
+int my_strnncollsp_simple(CHARSET_INFO * cs, const uchar *a, size_t a_length,
+ const uchar *b, size_t b_length,
my_bool diff_if_only_endspace_difference)
{
const uchar *map= cs->sort_order, *end;
- uint length;
+ size_t length;
int res;
#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE
@@ -179,56 +185,57 @@ int my_strnncollsp_simple(CHARSET_INFO * cs, const uchar *a, uint a_length,
}
for (end= a + a_length-length; a < end ; a++)
{
- if (*a != ' ')
- return (*a < ' ') ? -swap : swap;
+ if (map[*a] != ' ')
+ return (map[*a] < ' ') ? -swap : swap;
}
}
return res;
}
-uint my_caseup_str_8bit(CHARSET_INFO * cs,char *str)
+size_t my_caseup_str_8bit(CHARSET_INFO * cs,char *str)
{
register uchar *map= cs->to_upper;
char *str_orig= str;
while ((*str= (char) map[(uchar) *str]) != 0)
str++;
- return str - str_orig;
+ return (size_t) (str - str_orig);
}
-uint my_casedn_str_8bit(CHARSET_INFO * cs,char *str)
+size_t my_casedn_str_8bit(CHARSET_INFO * cs,char *str)
{
register uchar *map= cs->to_lower;
char *str_orig= str;
while ((*str= (char) map[(uchar) *str]) != 0)
str++;
- return str - str_orig;
+ return (size_t) (str - str_orig);
}
-uint my_caseup_8bit(CHARSET_INFO * cs, char *src, uint srclen,
- char *dst __attribute__((unused)),
- uint dstlen __attribute__((unused)))
+size_t my_caseup_8bit(CHARSET_INFO * cs, char *src, size_t srclen,
+ char *dst __attribute__((unused)),
+ size_t dstlen __attribute__((unused)))
{
- uint srclen0= srclen;
+ char *end= src + srclen;
register uchar *map= cs->to_upper;
DBUG_ASSERT(src == dst && srclen == dstlen);
- for ( ; srclen > 0 ; srclen--, src++)
+ for ( ; src != end ; src++)
*src= (char) map[(uchar) *src];
- return srclen0;
+ return srclen;
}
-uint my_casedn_8bit(CHARSET_INFO * cs, char *src, uint srclen,
- char *dst __attribute__((unused)),
- uint dstlen __attribute__((unused)))
+
+size_t my_casedn_8bit(CHARSET_INFO * cs, char *src, size_t srclen,
+ char *dst __attribute__((unused)),
+ size_t dstlen __attribute__((unused)))
{
- uint srclen0= srclen;
+ char *end= src + srclen;
register uchar *map=cs->to_lower;
DBUG_ASSERT(src == dst && srclen == dstlen);
- for ( ; srclen > 0 ; srclen--, src++)
+ for ( ; src != end ; src++)
*src= (char) map[(uchar) *src];
- return srclen0;
+ return srclen;
}
int my_strcasecmp_8bit(CHARSET_INFO * cs,const char *s, const char *t)
@@ -241,8 +248,8 @@ int my_strcasecmp_8bit(CHARSET_INFO * cs,const char *s, const char *t)
int my_mb_wc_8bit(CHARSET_INFO *cs,my_wc_t *wc,
- const unsigned char *str,
- const unsigned char *end __attribute__((unused)))
+ const uchar *str,
+ const uchar *end __attribute__((unused)))
{
if (str >= end)
return MY_CS_TOOSMALL;
@@ -252,8 +259,8 @@ int my_mb_wc_8bit(CHARSET_INFO *cs,my_wc_t *wc,
}
int my_wc_mb_8bit(CHARSET_INFO *cs,my_wc_t wc,
- unsigned char *str,
- unsigned char *end __attribute__((unused)))
+ uchar *str,
+ uchar *end)
{
MY_UNI_IDX *idx;
@@ -279,8 +286,8 @@ int my_wc_mb_8bit(CHARSET_INFO *cs,my_wc_t wc,
end buffer must be checked.
*/
-int my_snprintf_8bit(CHARSET_INFO *cs __attribute__((unused)),
- char* to, uint n __attribute__((unused)),
+size_t my_snprintf_8bit(CHARSET_INFO *cs __attribute__((unused)),
+ char* to, size_t n __attribute__((unused)),
const char* fmt, ...)
{
va_list args;
@@ -293,7 +300,7 @@ int my_snprintf_8bit(CHARSET_INFO *cs __attribute__((unused)),
void my_hash_sort_simple(CHARSET_INFO *cs,
- const uchar *key, uint len,
+ const uchar *key, size_t len,
ulong *nr1, ulong *nr2)
{
register uchar *sort_order=cs->sort_order;
@@ -316,15 +323,15 @@ void my_hash_sort_simple(CHARSET_INFO *cs,
long my_strntol_8bit(CHARSET_INFO *cs,
- const char *nptr, uint l, int base,
+ const char *nptr, size_t l, int base,
char **endptr, int *err)
{
int negative;
register uint32 cutoff;
- register unsigned int cutlim;
+ register uint cutlim;
register uint32 i;
register const char *s;
- register unsigned char c;
+ register uchar c;
const char *save, *e;
int overflow;
@@ -439,15 +446,15 @@ noconv:
ulong my_strntoul_8bit(CHARSET_INFO *cs,
- const char *nptr, uint l, int base,
+ const char *nptr, size_t l, int base,
char **endptr, int *err)
{
int negative;
register uint32 cutoff;
- register unsigned int cutlim;
+ register uint cutlim;
register uint32 i;
register const char *s;
- register unsigned char c;
+ register uchar c;
const char *save, *e;
int overflow;
@@ -553,12 +560,12 @@ noconv:
longlong my_strntoll_8bit(CHARSET_INFO *cs __attribute__((unused)),
- const char *nptr, uint l, int base,
+ const char *nptr, size_t l, int base,
char **endptr,int *err)
{
int negative;
register ulonglong cutoff;
- register unsigned int cutlim;
+ register uint cutlim;
register ulonglong i;
register const char *s, *e;
const char *save;
@@ -625,7 +632,7 @@ longlong my_strntoll_8bit(CHARSET_INFO *cs __attribute__((unused)),
i = 0;
for ( ; s != e; s++)
{
- register unsigned char c= *s;
+ register uchar c= *s;
if (c>='0' && c<='9')
c -= '0';
else if (c>='A' && c<='Z')
@@ -676,12 +683,12 @@ noconv:
ulonglong my_strntoull_8bit(CHARSET_INFO *cs,
- const char *nptr, uint l, int base,
+ const char *nptr, size_t l, int base,
char **endptr, int *err)
{
int negative;
register ulonglong cutoff;
- register unsigned int cutlim;
+ register uint cutlim;
register ulonglong i;
register const char *s, *e;
const char *save;
@@ -748,7 +755,7 @@ ulonglong my_strntoull_8bit(CHARSET_INFO *cs,
i = 0;
for ( ; s != e; s++)
{
- register unsigned char c= *s;
+ register uchar c= *s;
if (c>='0' && c<='9')
c -= '0';
@@ -790,6 +797,7 @@ noconv:
return 0L;
}
+
/*
Read double from string
@@ -814,7 +822,7 @@ noconv:
double my_strntod_8bit(CHARSET_INFO *cs __attribute__((unused)),
- char *str, uint length,
+ char *str, size_t length,
char **end, int *err)
{
if (length == INT_MAX32)
@@ -830,8 +838,8 @@ double my_strntod_8bit(CHARSET_INFO *cs __attribute__((unused)),
Assume len >= 1
*/
-int my_long10_to_str_8bit(CHARSET_INFO *cs __attribute__((unused)),
- char *dst, uint len, int radix, long int val)
+size_t my_long10_to_str_8bit(CHARSET_INFO *cs __attribute__((unused)),
+ char *dst, size_t len, int radix, long int val)
{
char buffer[66];
register char *p, *e;
@@ -863,14 +871,15 @@ int my_long10_to_str_8bit(CHARSET_INFO *cs __attribute__((unused)),
val= new_val;
}
- len= min(len, (uint) (e-p));
+ len= min(len, (size_t) (e-p));
memcpy(dst, p, len);
- return (int) len+sign;
+ return len+sign;
}
-int my_longlong10_to_str_8bit(CHARSET_INFO *cs __attribute__((unused)),
- char *dst, uint len, int radix, longlong val)
+size_t my_longlong10_to_str_8bit(CHARSET_INFO *cs __attribute__((unused)),
+ char *dst, size_t len, int radix,
+ longlong val)
{
char buffer[65];
register char *p, *e;
@@ -914,7 +923,7 @@ int my_longlong10_to_str_8bit(CHARSET_INFO *cs __attribute__((unused)),
long_val= quo;
}
- len= min(len, (uint) (e-p));
+ len= min(len, (size_t) (e-p));
cnv:
memcpy(dst, p, len);
return len+sign;
@@ -1034,16 +1043,16 @@ int my_wildcmp_8bit(CHARSET_INFO *cs,
*/
my_bool my_like_range_simple(CHARSET_INFO *cs,
- const char *ptr,uint ptr_length,
+ const char *ptr, size_t ptr_length,
pbool escape, pbool w_one, pbool w_many,
- uint res_length,
+ size_t res_length,
char *min_str,char *max_str,
- uint *min_length,uint *max_length)
+ size_t *min_length, size_t *max_length)
{
const char *end= ptr + ptr_length;
char *min_org=min_str;
char *min_end=min_str+res_length;
- uint charlen= res_length / cs->mbmaxlen;
+ size_t charlen= res_length / cs->mbmaxlen;
for (; ptr != end && min_str != min_end && charlen > 0 ; ptr++, charlen--)
{
@@ -1062,7 +1071,8 @@ my_bool my_like_range_simple(CHARSET_INFO *cs,
if (*ptr == w_many) /* '%' in SQL */
{
/* Calculate length of keys */
- *min_length= ((cs->state & MY_CS_BINSORT) ? (uint) (min_str - min_org) :
+ *min_length= ((cs->state & MY_CS_BINSORT) ?
+ (size_t) (min_str - min_org) :
res_length);
*max_length= res_length;
do
@@ -1075,14 +1085,14 @@ my_bool my_like_range_simple(CHARSET_INFO *cs,
*min_str++= *max_str++ = *ptr;
}
- *min_length= *max_length = (uint) (min_str - min_org);
+ *min_length= *max_length = (size_t) (min_str - min_org);
while (min_str != min_end)
*min_str++= *max_str++ = ' '; /* Because if key compression */
return 0;
}
-ulong my_scan_8bit(CHARSET_INFO *cs, const char *str, const char *end, int sq)
+size_t my_scan_8bit(CHARSET_INFO *cs, const char *str, const char *end, int sq)
{
const char *str0= str;
switch (sq)
@@ -1091,7 +1101,7 @@ ulong my_scan_8bit(CHARSET_INFO *cs, const char *str, const char *end, int sq)
if (*str == '.')
{
for(str++ ; str != end && *str == '0' ; str++);
- return (ulong) (str - str0);
+ return (size_t) (str - str0);
}
return 0;
@@ -1101,7 +1111,7 @@ ulong my_scan_8bit(CHARSET_INFO *cs, const char *str, const char *end, int sq)
if (!my_isspace(cs,*str))
break;
}
- return (ulong) (str - str0);
+ return (size_t) (str - str0);
default:
return 0;
}
@@ -1109,59 +1119,59 @@ ulong my_scan_8bit(CHARSET_INFO *cs, const char *str, const char *end, int sq)
void my_fill_8bit(CHARSET_INFO *cs __attribute__((unused)),
- char *s, uint l, int fill)
+ char *s, size_t l, int fill)
{
- bfill(s,l,fill);
+ bfill((uchar*) s,l,fill);
}
-uint my_numchars_8bit(CHARSET_INFO *cs __attribute__((unused)),
+size_t my_numchars_8bit(CHARSET_INFO *cs __attribute__((unused)),
const char *b, const char *e)
{
- return (uint) (e - b);
+ return (size_t) (e - b);
}
-uint my_numcells_8bit(CHARSET_INFO *cs __attribute__((unused)),
- const char *b, const char *e)
+size_t my_numcells_8bit(CHARSET_INFO *cs __attribute__((unused)),
+ const char *b, const char *e)
{
- return (uint) (e - b);
+ return (size_t) (e - b);
}
-uint my_charpos_8bit(CHARSET_INFO *cs __attribute__((unused)),
- const char *b __attribute__((unused)),
- const char *e __attribute__((unused)),
- uint pos)
+size_t my_charpos_8bit(CHARSET_INFO *cs __attribute__((unused)),
+ const char *b __attribute__((unused)),
+ const char *e __attribute__((unused)),
+ size_t pos)
{
return pos;
}
-uint my_well_formed_len_8bit(CHARSET_INFO *cs __attribute__((unused)),
- const char *start, const char *end,
- uint nchars, int *error)
+size_t my_well_formed_len_8bit(CHARSET_INFO *cs __attribute__((unused)),
+ const char *start, const char *end,
+ size_t nchars, int *error)
{
- uint nbytes= (uint) (end-start);
+ size_t nbytes= (size_t) (end-start);
*error= 0;
return min(nbytes, nchars);
}
-uint my_lengthsp_8bit(CHARSET_INFO *cs __attribute__((unused)),
- const char *ptr, uint length)
+size_t my_lengthsp_8bit(CHARSET_INFO *cs __attribute__((unused)),
+ const char *ptr, size_t length)
{
const char *end= ptr+length;
while (end > ptr && end[-1] == ' ')
end--;
- return (uint) (end-ptr);
+ return (size_t) (end-ptr);
}
uint my_instr_simple(CHARSET_INFO *cs,
- const char *b, uint b_length,
- const char *s, uint s_length,
- my_match_t *match, uint nmatch)
+ const char *b, size_t b_length,
+ const char *s, size_t s_length,
+ my_match_t *match, uint nmatch)
{
register const uchar *str, *search, *end, *search_end;
@@ -1200,7 +1210,7 @@ skip:
if (nmatch > 0)
{
match[0].beg= 0;
- match[0].end= (uint) (str- (const uchar*)b-1);
+ match[0].end= (size_t) (str- (const uchar*)b-1);
match[0].mb_len= match[0].end;
if (nmatch > 1)
@@ -1239,7 +1249,7 @@ static int pcmp(const void * f, const void * s)
return res;
}
-static my_bool create_fromuni(CHARSET_INFO *cs, void *(*alloc)(uint))
+static my_bool create_fromuni(CHARSET_INFO *cs, void *(*alloc)(size_t))
{
uni_idx idx[PLANE_NUM];
int i,n;
@@ -1318,7 +1328,7 @@ static my_bool create_fromuni(CHARSET_INFO *cs, void *(*alloc)(uint))
return FALSE;
}
-static my_bool my_cset_init_8bit(CHARSET_INFO *cs, void *(*alloc)(uint))
+static my_bool my_cset_init_8bit(CHARSET_INFO *cs, void *(*alloc)(size_t))
{
cs->caseup_multiply= 1;
cs->casedn_multiply= 1;
@@ -1346,7 +1356,7 @@ static void set_max_sort_char(CHARSET_INFO *cs)
}
static my_bool my_coll_init_simple(CHARSET_INFO *cs,
- void *(*alloc)(uint) __attribute__((unused)))
+ void *(*alloc)(size_t) __attribute__((unused)))
{
set_max_sort_char(cs);
return FALSE;
@@ -1361,7 +1371,7 @@ longlong my_strtoll10_8bit(CHARSET_INFO *cs __attribute__((unused)),
int my_mb_ctype_8bit(CHARSET_INFO *cs, int *ctype,
- const unsigned char *s, const unsigned char *e)
+ const uchar *s, const uchar *e)
{
if (s >= e)
{
@@ -1473,13 +1483,13 @@ static ulonglong d10[DIGITS_IN_ULONGLONG]=
ulonglong
my_strntoull10rnd_8bit(CHARSET_INFO *cs __attribute__((unused)),
- const char *str, uint length, int unsigned_flag,
+ const char *str, size_t length, int unsigned_flag,
char **endptr, int *error)
{
const char *dot, *end9, *beg, *end= str + length;
ulonglong ull;
ulong ul;
- unsigned char ch;
+ uchar ch;
int shift= 0, digits= 0, negative, addon;
/* Skip leading spaces and tabs */
@@ -1497,7 +1507,7 @@ my_strntoull10rnd_8bit(CHARSET_INFO *cs __attribute__((unused)),
beg= str;
end9= (str + 9) > end ? end : (str + 9);
/* Accumulate small number into ulong, for performance purposes */
- for (ul= 0 ; str < end9 && (ch= (unsigned char) (*str - '0')) < 10; str++)
+ for (ul= 0 ; str < end9 && (ch= (uchar) (*str - '0')) < 10; str++)
{
ul= ul * 10 + ch;
}
@@ -1530,7 +1540,7 @@ my_strntoull10rnd_8bit(CHARSET_INFO *cs __attribute__((unused)),
/* Continue to accumulate into ulonglong */
for (dot= NULL, ull= ul; str < end; str++)
{
- if ((ch= (unsigned char) (*str - '0')) < 10)
+ if ((ch= (uchar) (*str - '0')) < 10)
{
if (ull < CUTOFF || (ull == CUTOFF && ch <= CUTLIM))
{
@@ -1551,7 +1561,7 @@ my_strntoull10rnd_8bit(CHARSET_INFO *cs __attribute__((unused)),
}
else
addon= (*str >= '5');
- for ( ; str < end && (ch= (unsigned char) (*str - '0')) < 10; str++)
+ for ( ; str < end && (ch= (uchar) (*str - '0')) < 10; str++)
{
if (!dot)
shift++;
@@ -1559,7 +1569,7 @@ my_strntoull10rnd_8bit(CHARSET_INFO *cs __attribute__((unused)),
if (str < end && *str == '.' && !dot)
{
str++;
- for ( ; str < end && (ch= (unsigned char) (*str - '0')) < 10; str++);
+ for ( ; str < end && (ch= (uchar) (*str - '0')) < 10; str++);
}
goto exp;
}
@@ -1605,7 +1615,7 @@ exp: /* [ E [ <sign> ] <unsigned integer> ] */
goto ret_sign;
}
for (exponent= 0 ;
- str < end && (ch= (unsigned char) (*str - '0')) < 10;
+ str < end && (ch= (uchar) (*str - '0')) < 10;
str++)
{
exponent= exponent * 10 + ch;
@@ -1748,7 +1758,7 @@ ret_too_big:
my_bool my_propagate_simple(CHARSET_INFO *cs __attribute__((unused)),
const uchar *str __attribute__((unused)),
- uint length __attribute__((unused)))
+ size_t length __attribute__((unused)))
{
return 1;
}
@@ -1756,7 +1766,7 @@ my_bool my_propagate_simple(CHARSET_INFO *cs __attribute__((unused)),
my_bool my_propagate_complex(CHARSET_INFO *cs __attribute__((unused)),
const uchar *str __attribute__((unused)),
- uint length __attribute__((unused)))
+ size_t length __attribute__((unused)))
{
return 0;
}
diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c
index 8f7158cc9c9..ace457af63c 100644
--- a/strings/ctype-sjis.c
+++ b/strings/ctype-sjis.c
@@ -182,13 +182,13 @@ static uchar NEAR sort_order_sjis[]=
(0x80<=(c) && (c)<=0xfc))
-static int ismbchar_sjis(CHARSET_INFO *cs __attribute__((unused)),
+static uint ismbchar_sjis(CHARSET_INFO *cs __attribute__((unused)),
const char* p, const char *e)
{
return (issjishead((uchar) *p) && (e-p)>1 && issjistail((uchar)p[1]) ? 2: 0);
}
-static int mbcharlen_sjis(CHARSET_INFO *cs __attribute__((unused)),uint c)
+static uint mbcharlen_sjis(CHARSET_INFO *cs __attribute__((unused)),uint c)
{
return (issjishead((uchar) c) ? 2 : 1);
}
@@ -198,8 +198,8 @@ static int mbcharlen_sjis(CHARSET_INFO *cs __attribute__((unused)),uint c)
static int my_strnncoll_sjis_internal(CHARSET_INFO *cs,
- const uchar **a_res, uint a_length,
- const uchar **b_res, uint b_length)
+ const uchar **a_res, size_t a_length,
+ const uchar **b_res, size_t b_length)
{
const uchar *a= *a_res, *b= *b_res;
const uchar *a_end= a + a_length;
@@ -230,9 +230,9 @@ static int my_strnncoll_sjis_internal(CHARSET_INFO *cs,
static int my_strnncoll_sjis(CHARSET_INFO *cs __attribute__((unused)),
- const uchar *a, uint a_length,
- const uchar *b, uint b_length,
- my_bool b_is_prefix)
+ const uchar *a, size_t a_length,
+ const uchar *b, size_t b_length,
+ my_bool b_is_prefix)
{
int res= my_strnncoll_sjis_internal(cs, &a, a_length, &b, b_length);
if (b_is_prefix && a_length > b_length)
@@ -242,8 +242,8 @@ static int my_strnncoll_sjis(CHARSET_INFO *cs __attribute__((unused)),
static int my_strnncollsp_sjis(CHARSET_INFO *cs __attribute__((unused)),
- const uchar *a, uint a_length,
- const uchar *b, uint b_length,
+ const uchar *a, size_t a_length,
+ const uchar *b, size_t b_length,
my_bool diff_if_only_endspace_difference)
{
const uchar *a_end= a + a_length, *b_end= b + b_length;
@@ -281,9 +281,9 @@ static int my_strnncollsp_sjis(CHARSET_INFO *cs __attribute__((unused)),
-static int my_strnxfrm_sjis(CHARSET_INFO *cs __attribute__((unused)),
- uchar *dest, uint len,
- const uchar *src, uint srclen)
+static size_t my_strnxfrm_sjis(CHARSET_INFO *cs __attribute__((unused)),
+ uchar *dest, size_t len,
+ const uchar *src, size_t srclen)
{
uchar *d_end = dest + len;
uchar *s_end = (uchar*) src + srclen;
@@ -324,15 +324,16 @@ static int my_strnxfrm_sjis(CHARSET_INFO *cs __attribute__((unused)),
#define max_sort_char ((char) 255)
static my_bool my_like_range_sjis(CHARSET_INFO *cs __attribute__((unused)),
- const char *ptr,uint ptr_length,
+ const char *ptr,size_t ptr_length,
pbool escape, pbool w_one, pbool w_many,
- uint res_length, char *min_str,char *max_str,
- uint *min_length,uint *max_length)
+ size_t res_length,
+ char *min_str,char *max_str,
+ size_t *min_length,size_t *max_length)
{
const char *end= ptr + ptr_length;
char *min_org=min_str;
char *min_end=min_str+res_length;
- uint charlen= res_length / cs->mbmaxlen;
+ size_t charlen= res_length / cs->mbmaxlen;
for ( ; ptr < end && min_str < min_end && charlen > 0 ; charlen--)
{
@@ -363,7 +364,7 @@ static my_bool my_like_range_sjis(CHARSET_INFO *cs __attribute__((unused)),
'a\0\0... is the smallest possible string when we have space expand
a\ff\ff... is the biggest possible string
*/
- *min_length= ((cs->state & MY_CS_BINSORT) ? (uint) (min_str - min_org) :
+ *min_length= ((cs->state & MY_CS_BINSORT) ? (size_t) (min_str - min_org) :
res_length);
*max_length= res_length;
do
@@ -376,7 +377,7 @@ static my_bool my_like_range_sjis(CHARSET_INFO *cs __attribute__((unused)),
*min_str++ = *max_str++ = *ptr++;
}
- *min_length= *max_length= (uint) (min_str - min_org);
+ *min_length= *max_length= (size_t) (min_str - min_org);
while (min_str != min_end)
*min_str++= *max_str++= ' '; /* Because if key compression */
return 0;
@@ -4553,12 +4554,12 @@ my_mb_wc_sjis(CHARSET_INFO *cs __attribute__((unused)),
}
static
-uint my_numcells_sjis(CHARSET_INFO *cs __attribute__((unused)),
+size_t my_numcells_sjis(CHARSET_INFO *cs __attribute__((unused)),
const char *str, const char *str_end)
{
- uint clen= 0;
- const unsigned char *b= (const unsigned char *) str;
- const unsigned char *e= (const unsigned char *) str_end;
+ size_t clen;
+ const uchar *b= (const uchar *) str;
+ const uchar *e= (const uchar *) str_end;
for (clen= 0; b < e; )
{
@@ -4586,9 +4587,9 @@ uint my_numcells_sjis(CHARSET_INFO *cs __attribute__((unused)),
CP932 additional characters are also accepted.
*/
static
-uint my_well_formed_len_sjis(CHARSET_INFO *cs __attribute__((unused)),
- const char *b, const char *e,
- uint pos, int *error)
+size_t my_well_formed_len_sjis(CHARSET_INFO *cs __attribute__((unused)),
+ const char *b, const char *e,
+ size_t pos, int *error)
{
const char *b0= b;
*error= 0;
@@ -4616,7 +4617,7 @@ uint my_well_formed_len_sjis(CHARSET_INFO *cs __attribute__((unused)),
break;
}
}
- return (uint) (b - b0);
+ return (size_t) (b - b0);
}
@@ -4695,7 +4696,7 @@ CHARSET_INFO my_charset_sjis_japanese_ci=
0, /* min_sort_char */
255, /* max_sort_char */
' ', /* pad char */
- 0, /* escape_with_backslash_is_dangerous */
+ 1, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
&my_collation_ci_handler
};
@@ -4727,7 +4728,7 @@ CHARSET_INFO my_charset_sjis_bin=
0, /* min_sort_char */
255, /* max_sort_char */
' ', /* pad char */
- 0, /* escape_with_backslash_is_dangerous */
+ 1, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
&my_collation_mb_bin_handler
};
diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c
index 4babe9917dc..a8c05dc4fd0 100644
--- a/strings/ctype-tis620.c
+++ b/strings/ctype-tis620.c
@@ -462,7 +462,7 @@ static uchar NEAR sort_order_tis620[]=
len Length of tstr
*/
-static uint thai2sortable(uchar *tstr, uint len)
+static size_t thai2sortable(uchar *tstr, size_t len)
{
uchar *p;
int tlen;
@@ -527,8 +527,8 @@ static uint thai2sortable(uchar *tstr, uint len)
static
int my_strnncoll_tis620(CHARSET_INFO *cs __attribute__((unused)),
- const uchar * s1, uint len1,
- const uchar * s2, uint len2,
+ const uchar *s1, size_t len1,
+ const uchar *s2, size_t len2,
my_bool s2_is_prefix)
{
uchar buf[80] ;
@@ -557,12 +557,12 @@ int my_strnncoll_tis620(CHARSET_INFO *cs __attribute__((unused)),
static
int my_strnncollsp_tis620(CHARSET_INFO * cs __attribute__((unused)),
- const uchar *a0, uint a_length,
- const uchar *b0, uint b_length,
+ const uchar *a0, size_t a_length,
+ const uchar *b0, size_t b_length,
my_bool diff_if_only_endspace_difference)
{
uchar buf[80], *end, *a, *b, *alloced= NULL;
- uint length;
+ size_t length;
int res= 0;
#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE
@@ -633,13 +633,13 @@ ret:
*/
static
-int my_strnxfrm_tis620(CHARSET_INFO *cs __attribute__((unused)),
- uchar * dest, uint len,
- const uchar * src, uint srclen)
+size_t my_strnxfrm_tis620(CHARSET_INFO *cs __attribute__((unused)),
+ uchar *dest, size_t len,
+ const uchar *src, size_t srclen)
{
- uint dstlen= len;
- len= (uint) (strmake((char*) dest, (char*) src, min(len, srclen)) -
- (char*) dest);
+ size_t dstlen= len;
+ len= (size_t) (strmake((char*) dest, (char*) src, min(len, srclen)) -
+ (char*) dest);
len= thai2sortable(dest, len);
if (dstlen > len)
bfill(dest + len, dstlen - len, ' ');
@@ -681,7 +681,7 @@ static unsigned short cs_to_uni[256]={
0x0E50,0x0E51,0x0E52,0x0E53,0x0E54,0x0E55,0x0E56,0x0E57,
0x0E58,0x0E59,0x0E5A,0x0E5B,0xFFFD,0xFFFD,0xFFFD,0xFFFD
};
-static unsigned char pl00[256]={
+static uchar pl00[256]={
0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
@@ -715,7 +715,7 @@ static unsigned char pl00[256]={
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
};
-static unsigned char pl0E[256]={
+static uchar pl0E[256]={
0x0000,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7,
0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF,
0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
@@ -749,7 +749,7 @@ static unsigned char pl0E[256]={
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
};
-static unsigned char plFF[256]={
+static uchar plFF[256]={
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
@@ -783,7 +783,7 @@ static unsigned char plFF[256]={
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x00FF,0x0000,0x0000
};
-static unsigned char *uni_to_cs[256]={
+static uchar *uni_to_cs[256]={
pl00,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,pl0E,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
@@ -822,8 +822,8 @@ NULL,NULL,NULL,NULL,NULL,NULL,NULL,plFF
static
int my_mb_wc_tis620(CHARSET_INFO *cs __attribute__((unused)),
my_wc_t *wc,
- const unsigned char *str,
- const unsigned char *end __attribute__((unused)))
+ const uchar *str,
+ const uchar *end __attribute__((unused)))
{
if (str >= end)
return MY_CS_TOOSMALL;
@@ -835,10 +835,10 @@ int my_mb_wc_tis620(CHARSET_INFO *cs __attribute__((unused)),
static
int my_wc_mb_tis620(CHARSET_INFO *cs __attribute__((unused)),
my_wc_t wc,
- unsigned char *str,
- unsigned char *end __attribute__((unused)))
+ uchar *str,
+ uchar *end __attribute__((unused)))
{
- unsigned char *pl;
+ uchar *pl;
if (str >= end)
return MY_CS_TOOSMALL;
diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c
index 1263882846d..1ed758bc105 100644
--- a/strings/ctype-uca.c
+++ b/strings/ctype-uca.c
@@ -6740,7 +6740,7 @@ typedef struct my_uca_scanner_st
typedef struct my_uca_scanner_handler_st
{
void (*init)(my_uca_scanner *scanner, CHARSET_INFO *cs,
- const uchar *str, uint length);
+ const uchar *str, size_t length);
int (*next)(my_uca_scanner *scanner);
} my_uca_scanner_handler;
@@ -6767,7 +6767,7 @@ static uint16 nochar[]= {0,0};
static void my_uca_scanner_init_ucs2(my_uca_scanner *scanner,
CHARSET_INFO *cs __attribute__((unused)),
- const uchar *str, uint length)
+ const uchar *str, size_t length)
{
scanner->wbeg= nochar;
if (length)
@@ -6859,8 +6859,8 @@ static int my_uca_scanner_next_ucs2(my_uca_scanner *scanner)
if (scanner->sbeg > scanner->send)
return -1;
- scanner->page= (unsigned char)scanner->sbeg[0];
- scanner->code= (unsigned char)scanner->sbeg[1];
+ scanner->page= (uchar)scanner->sbeg[0];
+ scanner->code= (uchar)scanner->sbeg[1];
scanner->sbeg+= 2;
if (scanner->contractions && (scanner->sbeg <= scanner->send))
@@ -6919,7 +6919,7 @@ static my_uca_scanner_handler my_ucs2_uca_scanner_handler=
*/
static void my_uca_scanner_init_any(my_uca_scanner *scanner,
CHARSET_INFO *cs __attribute__((unused)),
- const uchar *str, uint length)
+ const uchar *str, size_t length)
{
/* Note, no needs to initialize scanner->wbeg */
scanner->sbeg= str;
@@ -7055,8 +7055,8 @@ static my_uca_scanner_handler my_any_uca_scanner_handler=
static int my_strnncoll_uca(CHARSET_INFO *cs,
my_uca_scanner_handler *scanner_handler,
- const uchar *s, uint slen,
- const uchar *t, uint tlen,
+ const uchar *s, size_t slen,
+ const uchar *t, size_t tlen,
my_bool t_is_prefix)
{
my_uca_scanner sscanner;
@@ -7126,8 +7126,8 @@ static int my_strnncoll_uca(CHARSET_INFO *cs,
static int my_strnncollsp_uca(CHARSET_INFO *cs,
my_uca_scanner_handler *scanner_handler,
- const uchar *s, uint slen,
- const uchar *t, uint tlen,
+ const uchar *s, size_t slen,
+ const uchar *t, size_t tlen,
my_bool diff_if_only_endspace_difference)
{
my_uca_scanner sscanner, tscanner;
@@ -7204,7 +7204,7 @@ static int my_strnncollsp_uca(CHARSET_INFO *cs,
static void my_hash_sort_uca(CHARSET_INFO *cs,
my_uca_scanner_handler *scanner_handler,
- const uchar *s, uint slen,
+ const uchar *s, size_t slen,
ulong *n1, ulong *n2)
{
int s_res;
@@ -7254,12 +7254,12 @@ static void my_hash_sort_uca(CHARSET_INFO *cs,
Number of bytes that have been written into the binary image.
*/
-static int my_strnxfrm_uca(CHARSET_INFO *cs,
- my_uca_scanner_handler *scanner_handler,
- uchar *dst, uint dstlen,
- const uchar *src, uint srclen)
+static size_t my_strnxfrm_uca(CHARSET_INFO *cs,
+ my_uca_scanner_handler *scanner_handler,
+ uchar *dst, size_t dstlen,
+ const uchar *src, size_t srclen)
{
- uchar *de = dst + (dstlen & (uint) ~1); /* add even length for easier code */
+ uchar *de= dst + (dstlen & (size_t) ~1); /* add even length for easier code */
int s_res;
my_uca_scanner scanner;
scanner_handler->init(&scanner, cs, src, srclen);
@@ -7292,6 +7292,7 @@ static int my_strnxfrm_uca(CHARSET_INFO *cs,
This fact allows us to use memcmp() safely, on both
little-endian and big-endian machines.
*/
+
static int my_uca_charcmp(CHARSET_INFO *cs, my_wc_t wc1, my_wc_t wc2)
{
size_t page1= wc1 >> MY_UCA_PSHIFT;
@@ -7334,7 +7335,7 @@ int my_wildcmp_uca(CHARSET_INFO *cs,
my_wc_t s_wc, w_wc;
int scan;
int (*mb_wc)(struct charset_info_st *, my_wc_t *,
- const unsigned char *, const unsigned char *);
+ const uchar *, const uchar *);
mb_wc= cs->cset->mb_wc;
while (wildstr != wildend)
@@ -7566,7 +7567,7 @@ static void my_coll_lexem_print_error(MY_COLL_LEXEM *lexem,
{
char tail[30];
size_t len= lexem->end - lexem->prev;
- strmake (tail, lexem->prev, (uint) min(len, sizeof(tail)-1));
+ strmake (tail, lexem->prev, (size_t) min(len, sizeof(tail)-1));
errstr[errsize-1]= '\0';
my_snprintf(errstr,errsize-1,"%s at '%s'", txt, tail);
}
@@ -7830,7 +7831,7 @@ static int my_coll_rule_parse(MY_COLL_RULE *rule, size_t mitems,
default weights.
*/
-static my_bool create_tailoring(CHARSET_INFO *cs, void *(*alloc)(uint))
+static my_bool create_tailoring(CHARSET_INFO *cs, void *(*alloc)(size_t))
{
MY_COLL_RULE rule[MY_MAX_COLL_RULE];
char errstr[128];
@@ -7937,10 +7938,16 @@ static my_bool create_tailoring(CHARSET_INFO *cs, void *(*alloc)(uint))
/* Now process contractions */
if (ncontractions)
{
- uint size= 0x40*0x40*sizeof(uint16); /* 8K, for basic latin letter only */
+ /*
+ 8K for weights for basic latin letter pairs,
+ plus 256 bytes for "is contraction part" flags.
+ */
+ uint size= 0x40*0x40*sizeof(uint16) + 256;
+ char *contraction_flags;
if (!(cs->contractions= (uint16*) (*alloc)(size)))
return 1;
bzero((void*)cs->contractions, size);
+ contraction_flags= ((char*) cs->contractions) + 0x40*0x40;
for (i=0; i < rc; i++)
{
if (rule[i].curr[1])
@@ -7966,6 +7973,9 @@ static my_bool create_tailoring(CHARSET_INFO *cs, void *(*alloc)(uint))
/* Copy base weight applying primary difference */
cs->contractions[offsc]= offsb[0] + rule[i].diff[0];
+ /* Mark both letters as "is contraction part */
+ contraction_flags[rule[i].curr[0]]= 1;
+ contraction_flags[rule[i].curr[1]]= 1;
}
}
}
@@ -7979,15 +7989,15 @@ static my_bool create_tailoring(CHARSET_INFO *cs, void *(*alloc)(uint))
Should work for any character set.
*/
-static my_bool my_coll_init_uca(CHARSET_INFO *cs, void *(*alloc)(uint))
+static my_bool my_coll_init_uca(CHARSET_INFO *cs, void *(*alloc)(size_t))
{
cs->pad_char= ' ';
return create_tailoring(cs, alloc);
}
static int my_strnncoll_any_uca(CHARSET_INFO *cs,
- const uchar *s, uint slen,
- const uchar *t, uint tlen,
+ const uchar *s, size_t slen,
+ const uchar *t, size_t tlen,
my_bool t_is_prefix)
{
return my_strnncoll_uca(cs, &my_any_uca_scanner_handler,
@@ -7995,8 +8005,8 @@ static int my_strnncoll_any_uca(CHARSET_INFO *cs,
}
static int my_strnncollsp_any_uca(CHARSET_INFO *cs,
- const uchar *s, uint slen,
- const uchar *t, uint tlen,
+ const uchar *s, size_t slen,
+ const uchar *t, size_t tlen,
my_bool diff_if_only_endspace_difference)
{
return my_strnncollsp_uca(cs, &my_any_uca_scanner_handler,
@@ -8005,15 +8015,15 @@ static int my_strnncollsp_any_uca(CHARSET_INFO *cs,
}
static void my_hash_sort_any_uca(CHARSET_INFO *cs,
- const uchar *s, uint slen,
+ const uchar *s, size_t slen,
ulong *n1, ulong *n2)
{
my_hash_sort_uca(cs, &my_any_uca_scanner_handler, s, slen, n1, n2);
}
-static int my_strnxfrm_any_uca(CHARSET_INFO *cs,
- uchar *dst, uint dstlen,
- const uchar *src, uint srclen)
+static size_t my_strnxfrm_any_uca(CHARSET_INFO *cs,
+ uchar *dst, size_t dstlen,
+ const uchar *src, size_t srclen)
{
return my_strnxfrm_uca(cs, &my_any_uca_scanner_handler,
dst, dstlen, src, srclen);
@@ -8025,8 +8035,8 @@ static int my_strnxfrm_any_uca(CHARSET_INFO *cs,
UCS2 optimized CHARSET_INFO compatible wrappers.
*/
static int my_strnncoll_ucs2_uca(CHARSET_INFO *cs,
- const uchar *s, uint slen,
- const uchar *t, uint tlen,
+ const uchar *s, size_t slen,
+ const uchar *t, size_t tlen,
my_bool t_is_prefix)
{
return my_strnncoll_uca(cs, &my_ucs2_uca_scanner_handler,
@@ -8034,8 +8044,8 @@ static int my_strnncoll_ucs2_uca(CHARSET_INFO *cs,
}
static int my_strnncollsp_ucs2_uca(CHARSET_INFO *cs,
- const uchar *s, uint slen,
- const uchar *t, uint tlen,
+ const uchar *s, size_t slen,
+ const uchar *t, size_t tlen,
my_bool diff_if_only_endspace_difference)
{
return my_strnncollsp_uca(cs, &my_ucs2_uca_scanner_handler,
@@ -8044,15 +8054,15 @@ static int my_strnncollsp_ucs2_uca(CHARSET_INFO *cs,
}
static void my_hash_sort_ucs2_uca(CHARSET_INFO *cs,
- const uchar *s, uint slen,
+ const uchar *s, size_t slen,
ulong *n1, ulong *n2)
{
my_hash_sort_uca(cs, &my_ucs2_uca_scanner_handler, s, slen, n1, n2);
}
-static int my_strnxfrm_ucs2_uca(CHARSET_INFO *cs,
- uchar *dst, uint dstlen,
- const uchar *src, uint srclen)
+static size_t my_strnxfrm_ucs2_uca(CHARSET_INFO *cs,
+ uchar *dst, size_t dstlen,
+ const uchar *src, size_t srclen)
{
return my_strnxfrm_uca(cs, &my_ucs2_uca_scanner_handler,
dst, dstlen, src, srclen);
@@ -8060,20 +8070,20 @@ static int my_strnxfrm_ucs2_uca(CHARSET_INFO *cs,
MY_COLLATION_HANDLER my_collation_ucs2_uca_handler =
{
- my_coll_init_uca, /* init */
- my_strnncoll_ucs2_uca,
- my_strnncollsp_ucs2_uca,
- my_strnxfrm_ucs2_uca,
- my_strnxfrmlen_simple,
- my_like_range_ucs2,
- my_wildcmp_uca,
- NULL,
- my_instr_mb,
- my_hash_sort_ucs2_uca,
- my_propagate_complex
+ my_coll_init_uca, /* init */
+ my_strnncoll_ucs2_uca,
+ my_strnncollsp_ucs2_uca,
+ my_strnxfrm_ucs2_uca,
+ my_strnxfrmlen_simple,
+ my_like_range_ucs2,
+ my_wildcmp_uca,
+ NULL,
+ my_instr_mb,
+ my_hash_sort_ucs2_uca,
+ my_propagate_complex
};
-CHARSET_INFO my_charset_ucs2_general_uca=
+CHARSET_INFO my_charset_ucs2_unicode_ci=
{
128,0,0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
@@ -8734,7 +8744,7 @@ static uchar ctype_utf8[] = {
extern MY_CHARSET_HANDLER my_charset_utf8_handler;
-CHARSET_INFO my_charset_utf8_general_uca_ci=
+CHARSET_INFO my_charset_utf8_unicode_ci=
{
192,0,0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c
index d3b65aa1643..1df8221072e 100644
--- a/strings/ctype-ucs2.c
+++ b/strings/ctype-ucs2.c
@@ -22,6 +22,7 @@
#include "m_string.h"
#include "m_ctype.h"
#include <errno.h>
+#include <stdarg.h>
#ifdef HAVE_CHARSET_ucs2
@@ -96,7 +97,7 @@ static int my_ucs2_uni(CHARSET_INFO *cs __attribute__((unused)),
if (s+2 > e) /* Need 2 characters */
return MY_CS_TOOSMALL2;
- *pwc= ((unsigned char)s[0]) * 256 + ((unsigned char)s[1]);
+ *pwc= ((uchar)s[0]) * 256 + ((uchar)s[1]);
return 2;
}
@@ -112,9 +113,9 @@ static int my_uni_ucs2(CHARSET_INFO *cs __attribute__((unused)) ,
}
-static uint my_caseup_ucs2(CHARSET_INFO *cs, char *src, uint srclen,
+static size_t my_caseup_ucs2(CHARSET_INFO *cs, char *src, size_t srclen,
char *dst __attribute__((unused)),
- uint dstlen __attribute__((unused)))
+ size_t dstlen __attribute__((unused)))
{
my_wc_t wc;
int res;
@@ -135,7 +136,7 @@ static uint my_caseup_ucs2(CHARSET_INFO *cs, char *src, uint srclen,
}
-static void my_hash_sort_ucs2(CHARSET_INFO *cs, const uchar *s, uint slen,
+static void my_hash_sort_ucs2(CHARSET_INFO *cs, const uchar *s, size_t slen,
ulong *n1, ulong *n2)
{
my_wc_t wc;
@@ -159,16 +160,16 @@ static void my_hash_sort_ucs2(CHARSET_INFO *cs, const uchar *s, uint slen,
}
-static uint my_caseup_str_ucs2(CHARSET_INFO * cs __attribute__((unused)),
+static size_t my_caseup_str_ucs2(CHARSET_INFO * cs __attribute__((unused)),
char * s __attribute__((unused)))
{
return 0;
}
-static uint my_casedn_ucs2(CHARSET_INFO *cs, char *src, uint srclen,
+static size_t my_casedn_ucs2(CHARSET_INFO *cs, char *src, size_t srclen,
char *dst __attribute__((unused)),
- uint dstlen __attribute__((unused)))
+ size_t dstlen __attribute__((unused)))
{
my_wc_t wc;
int res;
@@ -189,7 +190,7 @@ static uint my_casedn_ucs2(CHARSET_INFO *cs, char *src, uint srclen,
}
-static uint my_casedn_str_ucs2(CHARSET_INFO *cs __attribute__((unused)),
+static size_t my_casedn_str_ucs2(CHARSET_INFO *cs __attribute__((unused)),
char * s __attribute__((unused)))
{
return 0;
@@ -197,8 +198,8 @@ static uint my_casedn_str_ucs2(CHARSET_INFO *cs __attribute__((unused)),
static int my_strnncoll_ucs2(CHARSET_INFO *cs,
- const uchar *s, uint slen,
- const uchar *t, uint tlen,
+ const uchar *s, size_t slen,
+ const uchar *t, size_t tlen,
my_bool t_is_prefix)
{
int s_res,t_res;
@@ -263,13 +264,13 @@ static int my_strnncoll_ucs2(CHARSET_INFO *cs,
*/
static int my_strnncollsp_ucs2(CHARSET_INFO *cs __attribute__((unused)),
- const uchar *s, uint slen,
- const uchar *t, uint tlen,
+ const uchar *s, size_t slen,
+ const uchar *t, size_t tlen,
my_bool diff_if_only_endspace_difference
__attribute__((unused)))
{
const uchar *se, *te;
- uint minlen;
+ size_t minlen;
MY_UNICASE_INFO **uni_plane= cs->caseinfo;
/* extra safety to make sure the lengths are even numbers */
@@ -314,7 +315,7 @@ static int my_strnncollsp_ucs2(CHARSET_INFO *cs __attribute__((unused)),
static int my_strncasecmp_ucs2(CHARSET_INFO *cs,
- const char *s, const char *t, uint len)
+ const char *s, const char *t, size_t len)
{
int s_res,t_res;
my_wc_t s_wc,t_wc;
@@ -355,15 +356,16 @@ static int my_strncasecmp_ucs2(CHARSET_INFO *cs,
static int my_strcasecmp_ucs2(CHARSET_INFO *cs, const char *s, const char *t)
{
- uint s_len= (uint) strlen(s);
- uint t_len= (uint) strlen(t);
- uint len = (s_len > t_len) ? s_len : t_len;
- return my_strncasecmp_ucs2(cs, s, t, len);
+ size_t s_len= strlen(s);
+ size_t t_len= strlen(t);
+ size_t len = (s_len > t_len) ? s_len : t_len;
+ return my_strncasecmp_ucs2(cs, s, t, len);
}
-static int my_strnxfrm_ucs2(CHARSET_INFO *cs,
- uchar *dst, uint dstlen, const uchar *src, uint srclen)
+static size_t my_strnxfrm_ucs2(CHARSET_INFO *cs,
+ uchar *dst, size_t dstlen, const uchar *src,
+ size_t srclen)
{
my_wc_t wc;
int res;
@@ -391,30 +393,27 @@ static int my_strnxfrm_ucs2(CHARSET_INFO *cs,
dst+=res;
}
if (dst < de)
- cs->cset->fill(cs, (char*) dst, (uint) (de - dst), ' ');
+ cs->cset->fill(cs, (char*) dst, (size_t) (de - dst), ' ');
return dstlen;
}
-static int my_ismbchar_ucs2(CHARSET_INFO *cs __attribute__((unused)),
- const char *b __attribute__((unused)),
- const char *e __attribute__((unused)))
+static uint my_ismbchar_ucs2(CHARSET_INFO *cs __attribute__((unused)),
+ const char *b __attribute__((unused)),
+ const char *e __attribute__((unused)))
{
return 2;
}
-static int my_mbcharlen_ucs2(CHARSET_INFO *cs __attribute__((unused)) ,
- uint c __attribute__((unused)))
+static uint my_mbcharlen_ucs2(CHARSET_INFO *cs __attribute__((unused)) ,
+ uint c __attribute__((unused)))
{
return 2;
}
-#include <m_string.h>
-#include <stdarg.h>
-
-static int my_vsnprintf_ucs2(char *dst, uint n, const char* fmt, va_list ap)
+static int my_vsnprintf_ucs2(char *dst, size_t n, const char* fmt, va_list ap)
{
char *start=dst, *end=dst+n-1;
for (; *fmt ; fmt++)
@@ -440,10 +439,10 @@ static int my_vsnprintf_ucs2(char *dst, uint n, const char* fmt, va_list ap)
if (*fmt == 's') /* String parameter */
{
reg2 char *par = va_arg(ap, char *);
- uint plen;
- uint left_len = (uint)(end-dst);
+ size_t plen;
+ size_t left_len = (size_t)(end-dst);
if (!par) par = (char*)"(null)";
- plen = (uint) strlen(par);
+ plen= strlen(par);
if (left_len <= plen*2)
plen = left_len/2 - 1;
@@ -460,7 +459,7 @@ static int my_vsnprintf_ucs2(char *dst, uint n, const char* fmt, va_list ap)
char nbuf[16];
char *pbuf=nbuf;
- if ((uint) (end-dst) < 32)
+ if ((size_t) (end-dst) < 32)
break;
iarg = va_arg(ap, int);
if (*fmt == 'd')
@@ -485,11 +484,11 @@ static int my_vsnprintf_ucs2(char *dst, uint n, const char* fmt, va_list ap)
DBUG_ASSERT(dst <= end);
*dst='\0'; /* End of errmessage */
- return (uint) (dst - start);
+ return (size_t) (dst - start);
}
-static int my_snprintf_ucs2(CHARSET_INFO *cs __attribute__((unused)),
- char* to, uint n, const char* fmt, ...)
+static size_t my_snprintf_ucs2(CHARSET_INFO *cs __attribute__((unused)),
+ char* to, size_t n, const char* fmt, ...)
{
va_list args;
va_start(args,fmt);
@@ -498,7 +497,7 @@ static int my_snprintf_ucs2(CHARSET_INFO *cs __attribute__((unused)),
long my_strntol_ucs2(CHARSET_INFO *cs,
- const char *nptr, uint l, int base,
+ const char *nptr, size_t l, int base,
char **endptr, int *err)
{
int negative=0;
@@ -613,7 +612,7 @@ bs:
ulong my_strntoul_ucs2(CHARSET_INFO *cs,
- const char *nptr, uint l, int base,
+ const char *nptr, size_t l, int base,
char **endptr, int *err)
{
int negative=0;
@@ -722,7 +721,7 @@ bs:
longlong my_strntoll_ucs2(CHARSET_INFO *cs,
- const char *nptr, uint l, int base,
+ const char *nptr, size_t l, int base,
char **endptr, int *err)
{
int negative=0;
@@ -839,7 +838,7 @@ bs:
ulonglong my_strntoull_ucs2(CHARSET_INFO *cs,
- const char *nptr, uint l, int base,
+ const char *nptr, size_t l, int base,
char **endptr, int *err)
{
int negative=0;
@@ -947,7 +946,7 @@ bs:
double my_strntod_ucs2(CHARSET_INFO *cs __attribute__((unused)),
- char *nptr, uint length,
+ char *nptr, size_t length,
char **endptr, int *err)
{
char buf[256];
@@ -974,13 +973,14 @@ double my_strntod_ucs2(CHARSET_INFO *cs __attribute__((unused)),
*endptr= b;
res= my_strtod(buf, endptr, err);
- *endptr= nptr + (uint) (*endptr- buf);
+ *endptr= nptr + (size_t) (*endptr- buf);
return res;
}
ulonglong my_strntoull10rnd_ucs2(CHARSET_INFO *cs __attribute__((unused)),
- const char *nptr, uint length, int unsign_fl,
+ const char *nptr, size_t length,
+ int unsign_fl,
char **endptr, int *err)
{
char buf[256], *b= buf;
@@ -1003,7 +1003,7 @@ ulonglong my_strntoull10rnd_ucs2(CHARSET_INFO *cs __attribute__((unused)),
}
res= my_strntoull10rnd_8bit(cs, buf, b - buf, unsign_fl, endptr, err);
- *endptr= (char*) nptr + 2 * (uint) (*endptr- buf);
+ *endptr= (char*) nptr + 2 * (size_t) (*endptr- buf);
return res;
}
@@ -1012,8 +1012,8 @@ ulonglong my_strntoull10rnd_ucs2(CHARSET_INFO *cs __attribute__((unused)),
This is a fast version optimized for the case of radix 10 / -10
*/
-int my_l10tostr_ucs2(CHARSET_INFO *cs,
- char *dst, uint len, int radix, long int val)
+size_t my_l10tostr_ucs2(CHARSET_INFO *cs,
+ char *dst, size_t len, int radix, long int val)
{
char buffer[66];
register char *p, *db, *de;
@@ -1059,8 +1059,9 @@ int my_l10tostr_ucs2(CHARSET_INFO *cs,
return (int) (dst-db);
}
-int my_ll10tostr_ucs2(CHARSET_INFO *cs __attribute__((unused)),
- char *dst, uint len, int radix, longlong val)
+
+size_t my_ll10tostr_ucs2(CHARSET_INFO *cs __attribute__((unused)),
+ char *dst, size_t len, int radix, longlong val)
{
char buffer[65];
register char *p, *db, *de;
@@ -1087,7 +1088,7 @@ int my_ll10tostr_ucs2(CHARSET_INFO *cs __attribute__((unused)),
while ((ulonglong) val > (ulonglong) LONG_MAX)
{
- ulonglong quo=(ulonglong) val/(uint) 10;
+ ulonglong quo=(ulonglong) val/(size_t) 10;
uint rem= (uint) (val- quo* (uint) 10);
*--p = '0' + rem;
val= quo;
@@ -1137,7 +1138,7 @@ longlong my_strtoll10_ucs2(CHARSET_INFO *cs __attribute__((unused)),
const char *nptr, char **endptr, int *error)
{
const char *s, *end, *start, *n_end, *true_end;
- unsigned char c;
+ uchar c;
unsigned long i, j, k;
ulonglong li;
int negative;
@@ -1273,7 +1274,7 @@ end_i:
return (negative ? ((longlong) -(long) i) : (longlong) i);
end_i_and_j:
- li= (ulonglong) i * lfactor[(uint) (s-start) / 2] + j;
+ li= (ulonglong) i * lfactor[(size_t) (s-start) / 2] + j;
*endptr= (char*) s;
return (negative ? -((longlong) li) : (longlong) li);
@@ -1302,31 +1303,31 @@ no_conv:
static
-uint my_numchars_ucs2(CHARSET_INFO *cs __attribute__((unused)),
- const char *b, const char *e)
+size_t my_numchars_ucs2(CHARSET_INFO *cs __attribute__((unused)),
+ const char *b, const char *e)
{
- return (uint) (e-b)/2;
+ return (size_t) (e-b)/2;
}
static
-uint my_charpos_ucs2(CHARSET_INFO *cs __attribute__((unused)),
- const char *b __attribute__((unused)),
- const char *e __attribute__((unused)),
- uint pos)
+size_t my_charpos_ucs2(CHARSET_INFO *cs __attribute__((unused)),
+ const char *b __attribute__((unused)),
+ const char *e __attribute__((unused)),
+ size_t pos)
{
- uint string_length= (uint) (e - b);
+ size_t string_length= (size_t) (e - b);
return pos > string_length ? string_length + 2 : pos * 2;
}
static
-uint my_well_formed_len_ucs2(CHARSET_INFO *cs __attribute__((unused)),
- const char *b, const char *e,
- uint nchars, int *error)
+size_t my_well_formed_len_ucs2(CHARSET_INFO *cs __attribute__((unused)),
+ const char *b, const char *e,
+ size_t nchars, int *error)
{
/* Ensure string length is dividable with 2 */
- uint nbytes= ((uint) (e-b)) & ~(uint) 1;
+ size_t nbytes= ((size_t) (e-b)) & ~(size_t) 1;
*error= 0;
nchars*= 2;
return min(nbytes, nchars);
@@ -1335,20 +1336,20 @@ uint my_well_formed_len_ucs2(CHARSET_INFO *cs __attribute__((unused)),
static
void my_fill_ucs2(CHARSET_INFO *cs __attribute__((unused)),
- char *s, uint l, int fill)
+ char *s, size_t l, int fill)
{
for ( ; l >= 2; s[0]= 0, s[1]= fill, s+=2, l-=2);
}
static
-uint my_lengthsp_ucs2(CHARSET_INFO *cs __attribute__((unused)),
- const char *ptr, uint length)
+size_t my_lengthsp_ucs2(CHARSET_INFO *cs __attribute__((unused)),
+ const char *ptr, size_t length)
{
const char *end= ptr+length;
while (end > ptr+1 && end[-1] == ' ' && end[-2] == '\0')
end-=2;
- return (uint) (end-ptr);
+ return (size_t) (end-ptr);
}
@@ -1377,8 +1378,8 @@ int my_wildcmp_ucs2_bin(CHARSET_INFO *cs,
static
int my_strnncoll_ucs2_bin(CHARSET_INFO *cs,
- const uchar *s, uint slen,
- const uchar *t, uint tlen,
+ const uchar *s, size_t slen,
+ const uchar *t, size_t tlen,
my_bool t_is_prefix)
{
int s_res,t_res;
@@ -1410,13 +1411,13 @@ int my_strnncoll_ucs2_bin(CHARSET_INFO *cs,
}
static int my_strnncollsp_ucs2_bin(CHARSET_INFO *cs __attribute__((unused)),
- const uchar *s, uint slen,
- const uchar *t, uint tlen,
+ const uchar *s, size_t slen,
+ const uchar *t, size_t tlen,
my_bool diff_if_only_endspace_difference
__attribute__((unused)))
{
const uchar *se, *te;
- uint minlen;
+ size_t minlen;
/* extra safety to make sure the lengths are even numbers */
slen= (slen >> 1) << 1;
@@ -1459,17 +1460,17 @@ static int my_strnncollsp_ucs2_bin(CHARSET_INFO *cs __attribute__((unused)),
static
int my_strcasecmp_ucs2_bin(CHARSET_INFO *cs, const char *s, const char *t)
{
- uint s_len= (uint) strlen(s);
- uint t_len= (uint) strlen(t);
- uint len = (s_len > t_len) ? s_len : t_len;
+ size_t s_len= strlen(s);
+ size_t t_len= strlen(t);
+ size_t len = (s_len > t_len) ? s_len : t_len;
return my_strncasecmp_ucs2(cs, s, t, len);
}
static
-int my_strnxfrm_ucs2_bin(CHARSET_INFO *cs __attribute__((unused)),
- uchar *dst, uint dstlen,
- const uchar *src, uint srclen)
+size_t my_strnxfrm_ucs2_bin(CHARSET_INFO *cs __attribute__((unused)),
+ uchar *dst, size_t dstlen,
+ const uchar *src, size_t srclen)
{
if (dst != src)
memcpy(dst,src,srclen= min(dstlen,srclen));
@@ -1481,12 +1482,15 @@ int my_strnxfrm_ucs2_bin(CHARSET_INFO *cs __attribute__((unused)),
static
void my_hash_sort_ucs2_bin(CHARSET_INFO *cs __attribute__((unused)),
- const uchar *key, uint len,ulong *nr1, ulong *nr2)
+ const uchar *key, size_t len,ulong *nr1, ulong *nr2)
{
const uchar *pos = key;
key+= len;
-
+
+ while (key > pos+1 && key[-1] == ' ' && key[-2] == '\0')
+ key-= 2;
+
for (; pos < (uchar*) key ; pos++)
{
nr1[0]^=(ulong) ((((uint) nr1[0] & 63)+nr2[0]) *
@@ -1513,16 +1517,18 @@ void my_hash_sort_ucs2_bin(CHARSET_INFO *cs __attribute__((unused)),
*/
my_bool my_like_range_ucs2(CHARSET_INFO *cs,
- const char *ptr,uint ptr_length,
+ const char *ptr, size_t ptr_length,
pbool escape, pbool w_one, pbool w_many,
- uint res_length,
+ size_t res_length,
char *min_str,char *max_str,
- uint *min_length,uint *max_length)
+ size_t *min_length,size_t *max_length)
{
const char *end=ptr+ptr_length;
char *min_org=min_str;
char *min_end=min_str+res_length;
- uint charlen= res_length / cs->mbmaxlen;
+ size_t charlen= res_length / cs->mbmaxlen;
+ const char *contraction_flags= cs->contractions ?
+ ((const char*) cs->contractions) + 0x40*0x40 : NULL;
for ( ; ptr + 1 < end && min_str + 1 < min_end && charlen > 0
; ptr+=2, charlen--)
@@ -1544,12 +1550,13 @@ my_bool my_like_range_ucs2(CHARSET_INFO *cs,
}
if (ptr[0] == '\0' && ptr[1] == w_many) /* '%' in SQL */
{
+fill_max_and_min:
/*
Calculate length of keys:
'a\0\0... is the smallest possible string when we have space expand
a\ff\ff... is the biggest possible string
*/
- *min_length= ((cs->state & MY_CS_BINSORT) ? (uint) (min_str - min_org) :
+ *min_length= ((cs->state & MY_CS_BINSORT) ? (size_t) (min_str - min_org) :
res_length);
*max_length= res_length;
do {
@@ -1560,6 +1567,38 @@ my_bool my_like_range_ucs2(CHARSET_INFO *cs,
} while (min_str + 1 < min_end);
return 0;
}
+
+ if (contraction_flags && ptr + 3 < end &&
+ ptr[0] == '\0' && contraction_flags[(uchar) ptr[1]])
+ {
+ /* Contraction head found */
+ if (ptr[2] == '\0' && (ptr[3] == w_one || ptr[3] == w_many))
+ {
+ /* Contraction head followed by a wildcard, quit */
+ goto fill_max_and_min;
+ }
+
+ /*
+ Check if the second letter can be contraction part,
+ and if two letters really produce a contraction.
+ */
+ if (ptr[2] == '\0' && contraction_flags[(uchar) ptr[3]] &&
+ cs->contractions[(ptr[1]-0x40)*0x40 + ptr[3] - 0x40])
+ {
+ /* Contraction found */
+ if (charlen == 1 || min_str + 2 >= min_end)
+ {
+ /* Full contraction doesn't fit, quit */
+ goto fill_max_and_min;
+ }
+
+ /* Put contraction head */
+ *min_str++= *max_str++= *ptr++;
+ *min_str++= *max_str++= *ptr++;
+ charlen--;
+ }
+ }
+ /* Put contraction tail, or a single character */
*min_str++= *max_str++ = ptr[0];
*min_str++= *max_str++ = ptr[1];
}
@@ -1574,7 +1613,7 @@ my_bool my_like_range_ucs2(CHARSET_INFO *cs,
}
}
- *min_length= *max_length = (uint) (min_str - min_org);
+ *min_length= *max_length = (size_t) (min_str - min_org);
while (min_str + 1 < min_end)
{
*min_str++ = *max_str++ = '\0';
@@ -1585,8 +1624,8 @@ my_bool my_like_range_ucs2(CHARSET_INFO *cs,
-ulong my_scan_ucs2(CHARSET_INFO *cs __attribute__((unused)),
- const char *str, const char *end, int sequence_type)
+size_t my_scan_ucs2(CHARSET_INFO *cs __attribute__((unused)),
+ const char *str, const char *end, int sequence_type)
{
const char *str0= str;
end--; /* for easier loop condition, because of two bytes per character */
@@ -1599,7 +1638,7 @@ ulong my_scan_ucs2(CHARSET_INFO *cs __attribute__((unused)),
if (str[0] != '\0' || str[1] != ' ')
break;
}
- return (ulong) (str - str0);
+ return (size_t) (str - str0);
default:
return 0;
}
diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c
index d1e11071886..97cbfcefde9 100644
--- a/strings/ctype-ujis.c
+++ b/strings/ctype-ujis.c
@@ -184,7 +184,7 @@ static uchar NEAR sort_order_ujis[]=
#define isujis_ss3(c) (((c)&0xff) == 0x8f)
-static int ismbchar_ujis(CHARSET_INFO *cs __attribute__((unused)),
+static uint ismbchar_ujis(CHARSET_INFO *cs __attribute__((unused)),
const char* p, const char *e)
{
return ((*(uchar*)(p)<0x80)? 0:\
@@ -194,7 +194,7 @@ static int ismbchar_ujis(CHARSET_INFO *cs __attribute__((unused)),
0);
}
-static int mbcharlen_ujis(CHARSET_INFO *cs __attribute__((unused)),uint c)
+static uint mbcharlen_ujis(CHARSET_INFO *cs __attribute__((unused)),uint c)
{
return (isujis(c)? 2: isujis_ss2(c)? 2: isujis_ss3(c)? 3: 1);
}
@@ -264,18 +264,6 @@ my_wc_mb_jisx0201(CHARSET_INFO *cs __attribute__((unused)),
return 1;
}
- if (wc == 0x00A5)
- {
- *s = 0x5C;
- return 1;
- }
-
- if (wc == 0x203E)
- {
- *s = 0x7E;
- return 1;
- }
-
return MY_CS_ILUNI;
}
@@ -8252,9 +8240,9 @@ my_jisx0212_uni_onechar(int code){
*/
static
-uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)),
- const char *beg, const char *end,
- uint pos, int *error)
+size_t my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)),
+ const char *beg, const char *end,
+ size_t pos, int *error)
{
const uchar *b= (uchar *) beg;
@@ -8270,7 +8258,7 @@ uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)),
if (b >= (uchar *) end) /* need more bytes */
{
*error= 1;
- return (uint) (chbeg - beg); /* unexpected EOL */
+ return (size_t) (chbeg - beg); /* unexpected EOL */
}
if (ch == 0x8E) /* [x8E][xA0-xDF] */
@@ -8278,7 +8266,7 @@ uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)),
if (*b >= 0xA0 && *b <= 0xDF)
continue;
*error= 1;
- return (uint) (chbeg - beg); /* invalid sequence */
+ return (size_t) (chbeg - beg); /* invalid sequence */
}
if (ch == 0x8F) /* [x8F][xA1-xFE][xA1-xFE] */
@@ -8287,7 +8275,7 @@ uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)),
if (b >= (uchar*) end)
{
*error= 1;
- return (uint) (chbeg - beg); /* unexpected EOL */
+ return (size_t) (chbeg - beg); /* unexpected EOL */
}
}
@@ -8295,19 +8283,19 @@ uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)),
*b >= 0xA1 && *b <= 0xFE) /* [xA1-xFE][xA1-xFE] */
continue;
*error= 1;
- return (uint) (chbeg - beg); /* invalid sequence */
+ return (size_t) (chbeg - beg); /* invalid sequence */
}
- return (uint) (b - (uchar *) beg);
+ return (size_t) (b - (uchar *) beg);
}
static
-uint my_numcells_eucjp(CHARSET_INFO *cs __attribute__((unused)),
+size_t my_numcells_eucjp(CHARSET_INFO *cs __attribute__((unused)),
const char *str, const char *str_end)
{
- uint clen= 0;
- const unsigned char *b= (const unsigned char *) str;
- const unsigned char *e= (const unsigned char *) str_end;
+ size_t clen;
+ const uchar *b= (const uchar *) str;
+ const uchar *e= (const uchar *) str_end;
for (clen= 0; b < e; )
{
@@ -8335,6 +8323,7 @@ uint my_numcells_eucjp(CHARSET_INFO *cs __attribute__((unused)),
return clen;
}
+
static int
my_mb_wc_euc_jp(CHARSET_INFO *cs,my_wc_t *pwc, const uchar *s, const uchar *e)
{
@@ -8422,10 +8411,11 @@ my_mb_wc_euc_jp(CHARSET_INFO *cs,my_wc_t *pwc, const uchar *s, const uchar *e)
return MY_CS_ILSEQ;
}
+
static int
-my_wc_mb_euc_jp(CHARSET_INFO *c,my_wc_t wc, unsigned char *s, unsigned char *e)
+my_wc_mb_euc_jp(CHARSET_INFO *c,my_wc_t wc, uchar *s, uchar *e)
{
- unsigned char c1;
+ uchar c1;
int jp;
if (s >= e)
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c
index 16882e9b25d..2b248f1eed5 100644
--- a/strings/ctype-utf8.c
+++ b/strings/ctype-utf8.c
@@ -1722,7 +1722,7 @@ int my_wildcmp_unicode(CHARSET_INFO *cs,
my_wc_t s_wc, w_wc;
int scan, plane;
int (*mb_wc)(struct charset_info_st *, my_wc_t *,
- const unsigned char *, const unsigned char *);
+ const uchar *, const uchar *);
mb_wc= cs->cset->mb_wc;
while (wildstr != wildend)
@@ -1946,7 +1946,7 @@ static inline int bincmp(const uchar *s, const uchar *se,
static int my_utf8_uni(CHARSET_INFO *cs __attribute__((unused)),
my_wc_t * pwc, const uchar *s, const uchar *e)
{
- unsigned char c;
+ uchar c;
if (s >= e)
return MY_CS_TOOSMALL;
@@ -1975,7 +1975,8 @@ static int my_utf8_uni(CHARSET_INFO *cs __attribute__((unused)),
if (s+3 > e) /* We need 3 characters */
return MY_CS_TOOSMALL3;
- if (!((s[1] ^ 0x80) < 0x40 && (s[2] ^ 0x80) < 0x40 && (c >= 0xe1 || s[1] >= 0xa0)))
+ if (!((s[1] ^ 0x80) < 0x40 && (s[2] ^ 0x80) < 0x40 &&
+ (c >= 0xe1 || s[1] >= 0xa0)))
return MY_CS_ILSEQ;
*pwc = ((my_wc_t) (c & 0x0f) << 12) |
@@ -2055,7 +2056,7 @@ static int my_utf8_uni(CHARSET_INFO *cs __attribute__((unused)),
static int my_utf8_uni_no_range(CHARSET_INFO *cs __attribute__((unused)),
my_wc_t * pwc, const uchar *s)
{
- unsigned char c;
+ uchar c;
c= s[0];
if (c < 0x80)
@@ -2093,8 +2094,8 @@ static int my_utf8_uni_no_range(CHARSET_INFO *cs __attribute__((unused)),
}
-static int my_uni_utf8 (CHARSET_INFO *cs __attribute__((unused)) ,
- my_wc_t wc, uchar *r, uchar *e)
+static int my_uni_utf8 (CHARSET_INFO *cs __attribute__((unused)),
+ my_wc_t wc, uchar *r, uchar *e)
{
int count;
@@ -2167,8 +2168,8 @@ static int my_uni_utf8_no_range(CHARSET_INFO *cs __attribute__((unused)),
}
-static uint my_caseup_utf8(CHARSET_INFO *cs, char *src, uint srclen,
- char *dst, uint dstlen)
+static size_t my_caseup_utf8(CHARSET_INFO *cs, char *src, size_t srclen,
+ char *dst, size_t dstlen)
{
my_wc_t wc;
int srcres, dstres;
@@ -2186,10 +2187,11 @@ static uint my_caseup_utf8(CHARSET_INFO *cs, char *src, uint srclen,
src+= srcres;
dst+= dstres;
}
- return (uint) (dst - dst0);
+ return (size_t) (dst - dst0);
}
-static void my_hash_sort_utf8(CHARSET_INFO *cs, const uchar *s, uint slen,
+
+static void my_hash_sort_utf8(CHARSET_INFO *cs, const uchar *s, size_t slen,
ulong *n1, ulong *n2)
{
my_wc_t wc;
@@ -2217,7 +2219,7 @@ static void my_hash_sort_utf8(CHARSET_INFO *cs, const uchar *s, uint slen,
}
-static uint my_caseup_str_utf8(CHARSET_INFO *cs, char *src)
+static size_t my_caseup_str_utf8(CHARSET_INFO *cs, char *src)
{
my_wc_t wc;
int srcres, dstres;
@@ -2236,12 +2238,12 @@ static uint my_caseup_str_utf8(CHARSET_INFO *cs, char *src)
dst+= dstres;
}
*dst= '\0';
- return (uint) (dst - dst0);
+ return (size_t) (dst - dst0);
}
-static uint my_casedn_utf8(CHARSET_INFO *cs, char *src, uint srclen,
- char *dst, uint dstlen)
+static size_t my_casedn_utf8(CHARSET_INFO *cs, char *src, size_t srclen,
+ char *dst, size_t dstlen)
{
my_wc_t wc;
int srcres, dstres;
@@ -2259,11 +2261,11 @@ static uint my_casedn_utf8(CHARSET_INFO *cs, char *src, uint srclen,
src+= srcres;
dst+= dstres;
}
- return (uint) (dst - dst0);
+ return (size_t) (dst - dst0);
}
-static uint my_casedn_str_utf8(CHARSET_INFO *cs, char *src)
+static size_t my_casedn_str_utf8(CHARSET_INFO *cs, char *src)
{
my_wc_t wc;
int srcres, dstres;
@@ -2298,13 +2300,13 @@ static uint my_casedn_str_utf8(CHARSET_INFO *cs, char *src)
*/
*dst= '\0';
- return (uint) (dst - dst0);
+ return (size_t) (dst - dst0);
}
static int my_strnncoll_utf8(CHARSET_INFO *cs,
- const uchar *s, uint slen,
- const uchar *t, uint tlen,
+ const uchar *s, size_t slen,
+ const uchar *t, size_t tlen,
my_bool t_is_prefix)
{
int s_res,t_res;
@@ -2375,8 +2377,8 @@ static int my_strnncoll_utf8(CHARSET_INFO *cs,
*/
static int my_strnncollsp_utf8(CHARSET_INFO *cs,
- const uchar *s, uint slen,
- const uchar *t, uint tlen,
+ const uchar *s, size_t slen,
+ const uchar *t, size_t tlen,
my_bool diff_if_only_endspace_difference)
{
int s_res, t_res, res;
@@ -2415,8 +2417,8 @@ static int my_strnncollsp_utf8(CHARSET_INFO *cs,
t+=t_res;
}
- slen= (uint) (se-s);
- tlen= (uint) (te-t);
+ slen= (size_t) (se-s);
+ tlen= (size_t) (te-t);
res= 0;
if (slen != tlen)
@@ -2564,14 +2566,16 @@ int my_wildcmp_utf8(CHARSET_INFO *cs,
static
-uint my_strnxfrmlen_utf8(CHARSET_INFO *cs __attribute__((unused)), uint len)
+size_t my_strnxfrmlen_utf8(CHARSET_INFO *cs __attribute__((unused)),
+ size_t len)
{
return (len * 2 + 2) / 3;
}
-static int my_strnxfrm_utf8(CHARSET_INFO *cs,
- uchar *dst, uint dstlen,
- const uchar *src, uint srclen)
+
+static size_t my_strnxfrm_utf8(CHARSET_INFO *cs,
+ uchar *dst, size_t dstlen,
+ const uchar *src, size_t srclen)
{
my_wc_t wc;
int res;
@@ -2607,14 +2611,15 @@ static int my_strnxfrm_utf8(CHARSET_INFO *cs,
return dstlen;
}
-static int my_ismbchar_utf8(CHARSET_INFO *cs,const char *b, const char *e)
+static uint my_ismbchar_utf8(CHARSET_INFO *cs,const char *b, const char *e)
{
my_wc_t wc;
- int res=my_utf8_uni(cs,&wc, (const uchar*)b, (const uchar*)e);
+ int res= my_utf8_uni(cs,&wc, (const uchar*)b, (const uchar*)e);
return (res>1) ? res : 0;
}
-static int my_mbcharlen_utf8(CHARSET_INFO *cs __attribute__((unused)) , uint c)
+static uint my_mbcharlen_utf8(CHARSET_INFO *cs __attribute__((unused)),
+ uint c)
{
if (c < 0x80)
return 1;
@@ -2759,8 +2764,8 @@ CHARSET_INFO my_charset_utf8_bin=
*/
static int my_strnncoll_utf8_cs(CHARSET_INFO *cs,
- const uchar *s, uint slen,
- const uchar *t, uint tlen,
+ const uchar *s, size_t slen,
+ const uchar *t, size_t tlen,
my_bool t_is_prefix)
{
int s_res,t_res;
@@ -2805,18 +2810,21 @@ static int my_strnncoll_utf8_cs(CHARSET_INFO *cs,
}
static int my_strnncollsp_utf8_cs(CHARSET_INFO *cs,
- const uchar *s, uint slen,
- const uchar *t, uint tlen,
- my_bool diff_if_only_endspace_difference
- __attribute__((unused)))
+ const uchar *s, size_t slen,
+ const uchar *t, size_t tlen,
+ my_bool diff_if_only_endspace_difference)
{
- int s_res,t_res;
- my_wc_t s_wc,t_wc;
- const uchar *se= s+slen;
- const uchar *te= t+tlen;
- int save_diff = 0;
+ int s_res, t_res, res;
+ my_wc_t s_wc, t_wc;
+ const uchar *se= s + slen;
+ const uchar *te= t + tlen;
+ int save_diff= 0;
MY_UNICASE_INFO **uni_plane= cs->caseinfo;
-
+
+#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE
+ diff_if_only_endspace_difference= 0;
+#endif
+
while ( s < se && t < te )
{
int plane;
@@ -2848,16 +2856,20 @@ static int my_strnncollsp_utf8_cs(CHARSET_INFO *cs,
slen= se-s;
tlen= te-t;
+ res= 0;
if (slen != tlen)
{
- int swap= 0;
+ int swap= 1;
+ if (diff_if_only_endspace_difference)
+ res= 1; /* Assume 'a' is bigger */
if (slen < tlen)
{
slen= tlen;
s= t;
se= te;
swap= -1;
+ res= -res;
}
/*
This following loop uses the fact that in UTF-8
@@ -2871,8 +2883,8 @@ static int my_strnncollsp_utf8_cs(CHARSET_INFO *cs,
*/
for ( ; s < se; s++)
{
- if (*s != ' ')
- return ((int)*s - (int) ' ') ^ swap;
+ if (*s != (uchar) ' ')
+ return (*s < (uchar) ' ') ? -swap : swap;
}
}
return save_diff;
@@ -4104,7 +4116,7 @@ my_mb_wc_filename(CHARSET_INFO *cs __attribute__((unused)),
static int
my_wc_mb_filename(CHARSET_INFO *cs __attribute__((unused)),
- my_wc_t wc, unsigned char *s, unsigned char *e)
+ my_wc_t wc, uchar *s, uchar *e)
{
int code;
char hex[]= "0123456789abcdef";
@@ -4230,7 +4242,7 @@ static void test_mb(CHARSET_INFO *cs, uchar *s)
{
if (my_ismbhead_utf8(cs,*s))
{
- int len=my_mbcharlen_utf8(cs,*s);
+ uint len=my_mbcharlen_utf8(cs,*s);
while(len--)
{
printf("%c",*s);
diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c
index d5be20f7b1b..b22b4364e8a 100644
--- a/strings/ctype-win1250ch.c
+++ b/strings/ctype-win1250ch.c
@@ -400,7 +400,7 @@ static uchar NEAR _sort_order_win1250ch2[] = {
};
struct wordvalue {
- const uchar * word;
+ const uchar *word;
uchar pass1;
uchar pass2;
};
@@ -423,8 +423,8 @@ static struct wordvalue doubles[] = {
if (value == 0xff) { \
int i; \
for (i = 0; i < (int) sizeof(doubles); i++) { \
- const uchar * patt = doubles[i].word; \
- const uchar * q = (const uchar *) p; \
+ const uchar *patt = doubles[i].word; \
+ const uchar *q = (const uchar *) p; \
while (*patt \
&& !(IS_END(q, src, len)) \
&& (*patt == *q)) { \
@@ -446,12 +446,12 @@ static struct wordvalue doubles[] = {
#define IS_END(p, src, len) (((char *)p - (char *)src) >= (len))
static int my_strnncoll_win1250ch(CHARSET_INFO *cs __attribute__((unused)),
- const uchar * s1, uint len1,
- const uchar * s2, uint len2,
+ const uchar *s1, size_t len1,
+ const uchar *s2, size_t len2,
my_bool s2_is_prefix)
{
int v1, v2;
- const uchar * p1, * p2;
+ const uchar *p1, * p2;
int pass1 = 0, pass2 = 0;
int diff;
@@ -477,8 +477,8 @@ static int my_strnncoll_win1250ch(CHARSET_INFO *cs __attribute__((unused)),
static
int my_strnncollsp_win1250ch(CHARSET_INFO * cs,
- const uchar *s, uint slen,
- const uchar *t, uint tlen,
+ const uchar *s, size_t slen,
+ const uchar *t, size_t tlen,
my_bool diff_if_only_endspace_difference
__attribute__((unused)))
{
@@ -488,14 +488,14 @@ int my_strnncollsp_win1250ch(CHARSET_INFO * cs,
}
-static int my_strnxfrm_win1250ch(CHARSET_INFO * cs __attribute__((unused)),
- uchar * dest, uint len,
- const uchar * src, uint srclen)
+static size_t my_strnxfrm_win1250ch(CHARSET_INFO * cs __attribute__((unused)),
+ uchar *dest, size_t len,
+ const uchar *src, size_t srclen)
{
int value;
- const uchar * p;
+ const uchar *p;
int pass = 0;
- uint totlen = 0;
+ size_t totlen = 0;
p = src;
do {
@@ -615,11 +615,11 @@ static uchar NEAR like_range_prefix_max_win1250ch[]=
static my_bool
my_like_range_win1250ch(CHARSET_INFO *cs __attribute__((unused)),
- const char *ptr, uint ptr_length,
+ const char *ptr, size_t ptr_length,
pbool escape, pbool w_one, pbool w_many,
- uint res_length,
+ size_t res_length,
char *min_str, char *max_str,
- uint *min_length, uint *max_length)
+ size_t *min_length, size_t *max_length)
{
int only_min_found= 1;
@@ -643,7 +643,7 @@ my_like_range_win1250ch(CHARSET_INFO *cs __attribute__((unused)),
}
if (cs->state & MY_CS_BINSORT)
- *min_length= (uint) (min_str - min_org);
+ *min_length= (size_t) (min_str - min_org);
else
{
/* 'a\0\0... is the smallest possible string */
diff --git a/strings/ctype.c b/strings/ctype.c
index 8cb6b23c58e..c313708f3f6 100644
--- a/strings/ctype.c
+++ b/strings/ctype.c
@@ -111,7 +111,7 @@ static struct my_cs_file_section_st sec[] =
{0, NULL}
};
-static struct my_cs_file_section_st * cs_file_sec(const char *attr, uint len)
+static struct my_cs_file_section_st * cs_file_sec(const char *attr, size_t len)
{
struct my_cs_file_section_st *s;
for (s=sec; s->str; s++)
@@ -123,7 +123,7 @@ static struct my_cs_file_section_st * cs_file_sec(const char *attr, uint len)
}
#define MY_CS_CSDESCR_SIZE 64
-#define MY_CS_TAILORING_SIZE 128
+#define MY_CS_TAILORING_SIZE 1024
typedef struct my_cs_file_info
{
@@ -160,7 +160,7 @@ static int fill_uchar(uchar *a,uint size,const char *str, uint len)
return 0;
}
-static int fill_uint16(uint16 *a,uint size,const char *str, uint len)
+static int fill_uint16(uint16 *a,uint size,const char *str, size_t len)
{
uint i= 0;
@@ -178,7 +178,7 @@ static int fill_uint16(uint16 *a,uint size,const char *str, uint len)
}
-static int cs_enter(MY_XML_PARSER *st,const char *attr, uint len)
+static int cs_enter(MY_XML_PARSER *st,const char *attr, size_t len)
{
struct my_cs_file_info *i= (struct my_cs_file_info *)st->user_data;
struct my_cs_file_section_st *s= cs_file_sec(attr,len);
@@ -193,7 +193,7 @@ static int cs_enter(MY_XML_PARSER *st,const char *attr, uint len)
}
-static int cs_leave(MY_XML_PARSER *st,const char *attr, uint len)
+static int cs_leave(MY_XML_PARSER *st,const char *attr, size_t len)
{
struct my_cs_file_info *i= (struct my_cs_file_info *)st->user_data;
struct my_cs_file_section_st *s= cs_file_sec(attr,len);
@@ -211,11 +211,12 @@ static int cs_leave(MY_XML_PARSER *st,const char *attr, uint len)
}
-static int cs_value(MY_XML_PARSER *st,const char *attr, uint len)
+static int cs_value(MY_XML_PARSER *st,const char *attr, size_t len)
{
struct my_cs_file_info *i= (struct my_cs_file_info *)st->user_data;
struct my_cs_file_section_st *s;
- int state= (int)((s=cs_file_sec(st->attr, (int) strlen(st->attr))) ? s->state : 0);
+ int state= (int)((s=cs_file_sec(st->attr, strlen(st->attr))) ? s->state :
+ 0);
switch (state) {
case _CS_ID:
@@ -289,8 +290,8 @@ static int cs_value(MY_XML_PARSER *st,const char *attr, uint len)
}
-my_bool my_parse_charset_xml(const char *buf, uint len,
- int (*add_collation)(CHARSET_INFO *cs))
+my_bool my_parse_charset_xml(const char *buf, size_t len,
+ int (*add_collation)(CHARSET_INFO *cs))
{
MY_XML_PARSER p;
struct my_cs_file_info i;
@@ -306,3 +307,89 @@ my_bool my_parse_charset_xml(const char *buf, uint len,
my_xml_parser_free(&p);
return rc;
}
+
+
+/*
+ Check repertoire: detect pure ascii strings
+*/
+uint
+my_string_repertoire(CHARSET_INFO *cs, const char *str, ulong length)
+{
+ const char *strend= str + length;
+ if (cs->mbminlen == 1)
+ {
+ for ( ; str < strend; str++)
+ {
+ if (((uchar) *str) > 0x7F)
+ return MY_REPERTOIRE_UNICODE30;
+ }
+ }
+ else
+ {
+ my_wc_t wc;
+ int chlen;
+ for (; (chlen= cs->cset->mb_wc(cs, &wc, str, strend)) > 0; str+= chlen)
+ {
+ if (wc > 0x7F)
+ return MY_REPERTOIRE_UNICODE30;
+ }
+ }
+ return MY_REPERTOIRE_ASCII;
+}
+
+
+/*
+ Detect whether a character set is ASCII compatible.
+
+ Returns TRUE for:
+
+ - all 8bit character sets whose Unicode mapping of 0x7B is '{'
+ (ignores swe7 which maps 0x7B to "LATIN LETTER A WITH DIAERESIS")
+
+ - all multi-byte character sets having mbminlen == 1
+ (ignores ucs2 whose mbminlen is 2)
+
+ TODO:
+
+ When merging to 5.2, this function should be changed
+ to check a new flag MY_CS_NONASCII,
+
+ return (cs->flag & MY_CS_NONASCII) ? 0 : 1;
+
+ This flag was previously added into 5.2 under terms
+ of WL#3759 "Optimize identifier conversion in client-server protocol"
+ especially to mark character sets not compatible with ASCII.
+
+ We won't backport this flag to 5.0 or 5.1.
+ This function is Ok for 5.0 and 5.1, because we're not going
+ to introduce new tricky character sets between 5.0 and 5.2.
+*/
+my_bool
+my_charset_is_ascii_based(CHARSET_INFO *cs)
+{
+ return
+ (cs->mbmaxlen == 1 && cs->tab_to_uni && cs->tab_to_uni['{'] == '{') ||
+ (cs->mbminlen == 1 && cs->mbmaxlen > 1);
+}
+
+
+/*
+ Detect if a character set is 8bit,
+ and it is pure ascii, i.e. doesn't have
+ characters outside U+0000..U+007F
+ This functions is shared between "conf_to_src"
+ and dynamic charsets loader in "mysqld".
+*/
+my_bool
+my_charset_is_8bit_pure_ascii(CHARSET_INFO *cs)
+{
+ size_t code;
+ if (!cs->tab_to_uni)
+ return 0;
+ for (code= 0; code < 256; code++)
+ {
+ if (cs->tab_to_uni[code] > 0x7F)
+ return 0;
+ }
+ return 1;
+}
diff --git a/strings/decimal.c b/strings/decimal.c
index b29017aa6cb..f1753c619d1 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -1089,7 +1089,11 @@ int decimal2longlong(decimal_t *from, longlong *to)
x=x*DIG_BASE - *buf++;
if (unlikely(y < (LONGLONG_MIN/DIG_BASE) || x > y))
{
- *to= from->sign ? y : -y;
+ /*
+ the decimal is bigger than any possible integer
+ return border integer depending on the sign
+ */
+ *to= from->sign ? LONGLONG_MIN : LONGLONG_MAX;
return E_DEC_OVERFLOW;
}
}
@@ -1186,7 +1190,7 @@ int decimal2longlong(decimal_t *from, longlong *to)
7E F2 04 37 2D FB 2D
*/
-int decimal2bin(decimal_t *from, char *to, int precision, int frac)
+int decimal2bin(decimal_t *from, uchar *to, int precision, int frac)
{
dec1 mask=from->sign ? -1 : 0, *buf1=from->buf, *stop1;
int error=E_DEC_OK, intg=precision-frac,
@@ -1202,7 +1206,7 @@ int decimal2bin(decimal_t *from, char *to, int precision, int frac)
fsize1=frac1*sizeof(dec1)+dig2bytes[frac1x];
const int orig_isize0= isize0;
const int orig_fsize0= fsize0;
- char *orig_to= to;
+ uchar *orig_to= to;
buf1= remove_leading_zeroes(from, &from_intg);
@@ -1292,10 +1296,10 @@ int decimal2bin(decimal_t *from, char *to, int precision, int frac)
}
if (fsize0 > fsize1)
{
- char *to_end= orig_to + orig_fsize0 + orig_isize0;
+ uchar *to_end= orig_to + orig_fsize0 + orig_isize0;
while (fsize0-- > fsize1 && to < to_end)
- *to++=(uchar)mask;
+ *to++= (uchar)mask;
}
orig_to[0]^= 0x80;
@@ -1321,19 +1325,19 @@ int decimal2bin(decimal_t *from, char *to, int precision, int frac)
E_DEC_OK/E_DEC_TRUNCATED/E_DEC_OVERFLOW
*/
-int bin2decimal(char *from, decimal_t *to, int precision, int scale)
+int bin2decimal(const uchar *from, decimal_t *to, int precision, int scale)
{
int error=E_DEC_OK, intg=precision-scale,
intg0=intg/DIG_PER_DEC1, frac0=scale/DIG_PER_DEC1,
intg0x=intg-intg0*DIG_PER_DEC1, frac0x=scale-frac0*DIG_PER_DEC1,
intg1=intg0+(intg0x>0), frac1=frac0+(frac0x>0);
dec1 *buf=to->buf, mask=(*from & 0x80) ? 0 : -1;
- char *stop;
- char *d_copy;
+ const uchar *stop;
+ uchar *d_copy;
int bin_size= decimal_bin_size(precision, scale);
sanity(to);
- d_copy= (char *)my_alloca(bin_size);
+ d_copy= (uchar*) my_alloca(bin_size);
memcpy(d_copy, from, bin_size);
d_copy[0]^= 0x80;
from= d_copy;
@@ -1519,9 +1523,10 @@ decimal_round(decimal_t *from, decimal_t *to, int scale,
dec1 *p0= buf0+intg0+max(frac1, frac0);
dec1 *p1= buf1+intg1+max(frac1, frac0);
- to->buf[0]= 0;
while (buf0 < p0)
*(--p1) = *(--p0);
+ if (unlikely(intg1 > intg0))
+ to->buf[0]= 0;
intg0= intg1;
buf0=to->buf;
diff --git a/strings/do_ctype.c b/strings/do_ctype.c
index b8eca68debf..f33ddc5eb81 100644
--- a/strings/do_ctype.c
+++ b/strings/do_ctype.c
@@ -141,22 +141,22 @@ void init_case_convert()
#endif
#ifdef MSDOS
- higher_pos= (uchar * ) "\217\216\231\232\220"; /* Extra chars to konv. */
- lower_pos= (uchar * ) "\206\204\224\201\202";
+ higher_pos= (uchar *) "\217\216\231\232\220"; /* Extra chars to konv. */
+ lower_pos= (uchar *) "\206\204\224\201\202";
#else
#if defined(HPUX10) && ASCII_BITS_USED == 8
- higher_pos= (uchar * ) "\xd0\xd8\xda\xdb\xdc\xd3";
- lower_pos= (uchar * ) "\xd4\xcc\xce\xdf\xc9\xd7";
+ higher_pos= (uchar *) "\xd0\xd8\xda\xdb\xdc\xd3";
+ lower_pos= (uchar *) "\xd4\xcc\xce\xdf\xc9\xd7";
#else
#ifdef USE_INTERNAL_CTYPE
higher_pos=lower_pos= (uchar* ) ""; /* System converts chars */
#else
#if defined(DEC_MULTINATIONAL_CHAR) || defined(HP_MULTINATIONAL_CHAR)
- higher_pos= (uchar * ) "\305\304\326\311\334";
- lower_pos= (uchar * ) "\345\344\366\351\374";
+ higher_pos= (uchar *) "\305\304\326\311\334";
+ lower_pos= (uchar *) "\345\344\366\351\374";
#else
- higher_pos= (uchar * ) "[]\\@^";
- lower_pos= (uchar * ) "{}|`~";
+ higher_pos= (uchar *) "[]\\@^";
+ lower_pos= (uchar *) "{}|`~";
#endif
#endif /* USE_INTERNAL_CTYPE */
#endif /* HPUX10 */
diff --git a/strings/my_strtoll10.c b/strings/my_strtoll10.c
index 165d3e38095..4f73b1f8e71 100644
--- a/strings/my_strtoll10.c
+++ b/strings/my_strtoll10.c
@@ -86,7 +86,7 @@ longlong my_strtoll10(const char *nptr, char **endptr, int *error)
{
const char *s, *end, *start, *n_end, *true_end;
char *dummy;
- unsigned char c;
+ uchar c;
unsigned long i, j, k;
ulonglong li;
int negative;
diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c
index 93d228a1954..a57cc5b5ebe 100644
--- a/strings/my_vsnprintf.c
+++ b/strings/my_vsnprintf.c
@@ -40,10 +40,11 @@
length of result string
*/
-int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
+size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
{
char *start=to, *end=to+n-1;
- uint length, width, pre_zero, have_long;
+ size_t length, width;
+ uint pre_zero, have_long;
for (; *fmt ; fmt++)
{
@@ -58,7 +59,8 @@ int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
/* Read max fill size (only used with %d and %u) */
if (*fmt == '-')
fmt++;
- length= width= pre_zero= have_long= 0;
+ length= width= 0;
+ pre_zero= have_long= 0;
if (*fmt == '*')
{
fmt++;
@@ -93,10 +95,9 @@ int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
if (*fmt == 's') /* String parameter */
{
reg2 char *par = va_arg(ap, char *);
- uint plen,left_len = (uint)(end-to)+1;
+ size_t plen,left_len = (size_t) (end - to) + 1;
if (!par) par = (char*)"(null)";
- plen = (uint) strlen(par);
- set_if_smaller(plen,width);
+ plen= (uint) strnlen(par, width);
if (left_len <= plen)
plen = left_len - 1;
to=strnmov(to,par,plen);
@@ -115,11 +116,11 @@ int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
else if (*fmt == 'd' || *fmt == 'u'|| *fmt== 'x') /* Integer parameter */
{
register long larg;
- uint res_length, to_length;
+ size_t res_length, to_length;
char *store_start= to, *store_end;
char buff[32];
- if ((to_length= (uint) (end-to)) < 16 || length)
+ if ((to_length= (size_t) (end-to)) < 16 || length)
store_start= buff;
if (have_long)
larg = va_arg(ap, long);
@@ -135,7 +136,7 @@ int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
store_end= int10_to_str(larg, store_start, 10);
else
store_end= int2str(larg, store_start, 16, 0);
- if ((res_length= (uint) (store_end - store_start)) > to_length)
+ 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)
@@ -143,7 +144,7 @@ int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
length= min(length, to_length);
if (res_length < length)
{
- uint diff= (length- res_length);
+ size_t diff= (length- res_length);
bfill(to, diff, pre_zero ? '0' : ' ');
to+= diff;
}
@@ -169,10 +170,11 @@ int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
}
DBUG_ASSERT(to <= end);
*to='\0'; /* End of errmessage */
- return (uint) (to - start);
+ return (size_t) (to - start);
}
-int my_snprintf(char* to, size_t n, const char* fmt, ...)
+
+size_t my_snprintf(char* to, size_t n, const char* fmt, ...)
{
int result;
va_list args;
diff --git a/strings/r_strinstr.c b/strings/r_strinstr.c
index 98118015456..fb1e0c5a090 100644
--- a/strings/r_strinstr.c
+++ b/strings/r_strinstr.c
@@ -25,14 +25,14 @@
#include <my_global.h>
#include "m_string.h"
-uint r_strinstr(reg1 my_string str,int from, reg4 my_string search)
+size_t r_strinstr(reg1 const char * str, size_t from, reg4 const char * search)
{
- reg2 my_string i, j;
- uint len = (uint) strlen(search);
+ reg2 const char *i, *j;
+ size_t len = strlen(search);
/* pointer to the last char of buff */
- my_string start = str + from - 1;
+ const char * start = str + from - 1;
/* pointer to the last char of search */
- my_string search_end = search + len - 1;
+ const char * search_end = search + len - 1;
skip:
while (start >= str) /* Cant be != because the first char */
@@ -43,7 +43,7 @@ uint r_strinstr(reg1 my_string str,int from, reg4 my_string search)
while (j >= search && start > str)
if (*i-- != *j--)
goto skip;
- return (uint) ((start - len) - str + 3);
+ return (size_t) ((start - len) - str + 3);
}
}
return (0);
diff --git a/strings/str_test.c b/strings/str_test.c
index 7863dce8688..3ddfca39419 100644
--- a/strings/str_test.c
+++ b/strings/str_test.c
@@ -29,12 +29,12 @@
#define T_PREFILL '1'
static char from_buff[100],to_buff[100];
-static my_string from,to;
+static char * from, *to;
static int errors,tests;
static int test_strarg(const char *name,...);
static void init_strings (void); /* Init from and to */
void test_arg (const char *message,long func_value,long value);
-int compare_buff(const char *message,my_string b1,my_string b2,int length,
+int compare_buff(const char *message,char * b1,char * b2,int length,
pchar fill, pchar prefill);
static int my_test(int a)
@@ -228,7 +228,7 @@ static int test_strarg(const char *message,...)
/* test if function made right value */
-int compare_buff(const char *message, my_string b1, my_string b2, int length,
+int compare_buff(const char *message, char * b1, char * b2, int length,
pchar fill, pchar prefill)
{
int i,error=0;
diff --git a/strings/strappend.c b/strings/strappend.c
index 3a5da658709..bb926f74665 100644
--- a/strings/strappend.c
+++ b/strings/strappend.c
@@ -27,7 +27,7 @@
#include "m_string.h"
-void strappend(register char *s, uint len, pchar fill)
+void strappend(register char *s, size_t len, pchar fill)
{
register char *endpos;
diff --git a/strings/strcont.c b/strings/strcont.c
index d57af77804d..5a518a3550f 100644
--- a/strings/strcont.c
+++ b/strings/strcont.c
@@ -27,9 +27,9 @@
#include <my_global.h>
#include "m_string.h"
-my_string strcont(reg1 const char *str,reg2 const char *set)
+char * strcont(reg1 const char *str,reg2 const char *set)
{
- reg3 my_string start = (my_string) set;
+ reg3 char * start = (char *) set;
while (*str)
{
diff --git a/strings/strfill.c b/strings/strfill.c
index 7d3f25e3ff4..4b1fe67b206 100644
--- a/strings/strfill.c
+++ b/strings/strfill.c
@@ -26,7 +26,7 @@
#include <my_global.h>
#include "m_string.h"
-my_string strfill(my_string s,uint len,pchar fill)
+char * strfill(char *s, size_t len, pchar fill)
{
while (len--) *s++ = fill;
*(s) = '\0';
diff --git a/strings/strinstr.c b/strings/strinstr.c
index 10f83a54c29..dce498d61e8 100644
--- a/strings/strinstr.c
+++ b/strings/strinstr.c
@@ -28,20 +28,20 @@
#include <my_global.h>
#include "m_string.h"
-uint strinstr(reg1 const char *str,reg4 const char *search)
+size_t strinstr(reg1 const char *str,reg4 const char *search)
{
- reg2 my_string i,j;
- my_string start = (my_string) str;
+ reg2 const char *i, *j;
+ const char *start= str;
skip:
while (*str != '\0')
{
if (*str++ == *search)
{
- i=(my_string) str; j= (my_string) search+1;
+ i= str; j= search+1;
while (*j)
if (*i++ != *j++) goto skip;
- return ((uint) (str - start));
+ return ((size_t) (str - start));
}
}
return (0);
diff --git a/strings/strlen.c b/strings/strlen.c
index b3c901739b1..1469dd096ee 100644
--- a/strings/strlen.c
+++ b/strings/strlen.c
@@ -31,7 +31,7 @@
#if VaxAsm
-size_s strlen(char *s)
+size_t strlen(char *s)
{
asm("locc $0,$65535,*4(ap)");
asm("subl3 r0,$65535,r0");
@@ -40,7 +40,7 @@ size_s strlen(char *s)
#else
#if defined(MC68000) && defined(DS90)
-size_s strlen(char *s)
+size_t strlen(char *s)
{
asm(" movl 4(a7),a0 ");
asm(" movl a0,a1 ");
@@ -52,13 +52,13 @@ asm(" subql #1,d0 ");
}
#else
-size_s strlen(register char *s)
+size_t strlen(register char *s)
{
register char *startpos;
startpos = s;
while (*s++);
- return ((size_s) (s-startpos-1));
+ return ((size_t) (s-startpos-1));
}
#endif
diff --git a/strings/strmake.c b/strings/strmake.c
index 5ca4688de46..0d26e1b61a9 100644
--- a/strings/strmake.c
+++ b/strings/strmake.c
@@ -42,7 +42,7 @@ char *strmake(char *dst,const char *src,uint length)
#define strmake strmake_overlapp /* Use orginal for overlapping str */
#endif
-char *strmake(register char *dst, register const char *src, uint length)
+char *strmake(register char *dst, register const char *src, size_t length)
{
while (length--)
if (! (*dst++ = *src++))
diff --git a/strings/strnlen.c b/strings/strnlen.c
index 11ecf718746..826cd5ae5dd 100644
--- a/strings/strnlen.c
+++ b/strings/strnlen.c
@@ -25,10 +25,10 @@
#ifndef HAVE_STRNLEN
-uint strnlen(register const char *s, register uint maxlen)
+size_t strnlen(register const char *s, register size_t maxlen)
{
const char *end= (const char *)memchr(s, '\0', maxlen);
- return end ? (uint) (end - s) : maxlen;
+ return end ? (size_t) (end - s) : maxlen;
}
#endif
diff --git a/strings/strnmov.c b/strings/strnmov.c
index b2099452d98..7e26877637b 100644
--- a/strings/strnmov.c
+++ b/strings/strnmov.c
@@ -23,7 +23,7 @@
#include <my_global.h>
#include "m_string.h"
-char *strnmov(register char *dst, register const char *src, uint n)
+char *strnmov(register char *dst, register const char *src, size_t n)
{
while (n-- != 0) {
if (!(*dst++ = *src++)) {
diff --git a/strings/strto.c b/strings/strto.c
index 934b5d88e90..fcb0d800b81 100644
--- a/strings/strto.c
+++ b/strings/strto.c
@@ -88,7 +88,7 @@ function (const char *nptr,char **endptr,int base)
register unsigned int cutlim;
register ulongtype i;
register const char *s;
- register unsigned char c;
+ register uchar c;
const char *save;
int overflow;
diff --git a/strings/strtod.c b/strings/strtod.c
index 15707a9b944..4c9cf931cb3 100644
--- a/strings/strtod.c
+++ b/strings/strtod.c
@@ -28,16 +28,46 @@
#include "my_base.h" /* Includes errno.h + EOVERFLOW */
#include "m_ctype.h"
+#ifdef HAVE_IEEEFP_H
+#include <ieeefp.h>
+#endif
#define MAX_DBL_EXP 308
#define MAX_RESULT_FOR_MAX_EXP 1.7976931348623157
-static double scaler10[] = {
- 1.0, 1e10, 1e20, 1e30, 1e40, 1e50, 1e60, 1e70, 1e80, 1e90
-};
-static double scaler1[] = {
- 1.0, 10.0, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9
-};
+const double log_10[] = {
+ 1e000, 1e001, 1e002, 1e003, 1e004, 1e005, 1e006, 1e007, 1e008, 1e009,
+ 1e010, 1e011, 1e012, 1e013, 1e014, 1e015, 1e016, 1e017, 1e018, 1e019,
+ 1e020, 1e021, 1e022, 1e023, 1e024, 1e025, 1e026, 1e027, 1e028, 1e029,
+ 1e030, 1e031, 1e032, 1e033, 1e034, 1e035, 1e036, 1e037, 1e038, 1e039,
+ 1e040, 1e041, 1e042, 1e043, 1e044, 1e045, 1e046, 1e047, 1e048, 1e049,
+ 1e050, 1e051, 1e052, 1e053, 1e054, 1e055, 1e056, 1e057, 1e058, 1e059,
+ 1e060, 1e061, 1e062, 1e063, 1e064, 1e065, 1e066, 1e067, 1e068, 1e069,
+ 1e070, 1e071, 1e072, 1e073, 1e074, 1e075, 1e076, 1e077, 1e078, 1e079,
+ 1e080, 1e081, 1e082, 1e083, 1e084, 1e085, 1e086, 1e087, 1e088, 1e089,
+ 1e090, 1e091, 1e092, 1e093, 1e094, 1e095, 1e096, 1e097, 1e098, 1e099,
+ 1e100, 1e101, 1e102, 1e103, 1e104, 1e105, 1e106, 1e107, 1e108, 1e109,
+ 1e110, 1e111, 1e112, 1e113, 1e114, 1e115, 1e116, 1e117, 1e118, 1e119,
+ 1e120, 1e121, 1e122, 1e123, 1e124, 1e125, 1e126, 1e127, 1e128, 1e129,
+ 1e130, 1e131, 1e132, 1e133, 1e134, 1e135, 1e136, 1e137, 1e138, 1e139,
+ 1e140, 1e141, 1e142, 1e143, 1e144, 1e145, 1e146, 1e147, 1e148, 1e149,
+ 1e150, 1e151, 1e152, 1e153, 1e154, 1e155, 1e156, 1e157, 1e158, 1e159,
+ 1e160, 1e161, 1e162, 1e163, 1e164, 1e165, 1e166, 1e167, 1e168, 1e169,
+ 1e170, 1e171, 1e172, 1e173, 1e174, 1e175, 1e176, 1e177, 1e178, 1e179,
+ 1e180, 1e181, 1e182, 1e183, 1e184, 1e185, 1e186, 1e187, 1e188, 1e189,
+ 1e190, 1e191, 1e192, 1e193, 1e194, 1e195, 1e196, 1e197, 1e198, 1e199,
+ 1e200, 1e201, 1e202, 1e203, 1e204, 1e205, 1e206, 1e207, 1e208, 1e209,
+ 1e210, 1e211, 1e212, 1e213, 1e214, 1e215, 1e216, 1e217, 1e218, 1e219,
+ 1e220, 1e221, 1e222, 1e223, 1e224, 1e225, 1e226, 1e227, 1e228, 1e229,
+ 1e230, 1e231, 1e232, 1e233, 1e234, 1e235, 1e236, 1e237, 1e238, 1e239,
+ 1e240, 1e241, 1e242, 1e243, 1e244, 1e245, 1e246, 1e247, 1e248, 1e249,
+ 1e250, 1e251, 1e252, 1e253, 1e254, 1e255, 1e256, 1e257, 1e258, 1e259,
+ 1e260, 1e261, 1e262, 1e263, 1e264, 1e265, 1e266, 1e267, 1e268, 1e269,
+ 1e270, 1e271, 1e272, 1e273, 1e274, 1e275, 1e276, 1e277, 1e278, 1e279,
+ 1e280, 1e281, 1e282, 1e283, 1e284, 1e285, 1e286, 1e287, 1e288, 1e289,
+ 1e290, 1e291, 1e292, 1e293, 1e294, 1e295, 1e296, 1e297, 1e298, 1e299,
+ 1e300, 1e301, 1e302, 1e303, 1e304, 1e305, 1e306, 1e307, 1e308
+};
/*
Convert string to double (string doesn't have to be null terminated)
@@ -56,8 +86,9 @@ static double scaler1[] = {
double my_strtod(const char *str, char **end_ptr, int *error)
{
double result= 0.0;
- uint negative= 0, ndigits, dec_digits= 0, neg_exp= 0;
- int exponent= 0, digits_after_dec_point= 0, tmp_exp;
+ uint negative= 0, neg_exp= 0;
+ size_t ndigits, dec_digits= 0;
+ int exponent= 0, digits_after_dec_point= 0, tmp_exp, step;
const char *old_str, *end= *end_ptr, *start_of_number;
char next_char;
my_bool overflow=0;
@@ -100,7 +131,7 @@ double my_strtod(const char *str, char **end_ptr, int *error)
}
start_of_number= 0; /* Found digit */
}
- ndigits= (uint) (str-old_str);
+ ndigits= (size_t) (str-old_str);
if (next_char == '.' && str < end-1)
{
@@ -124,7 +155,7 @@ double my_strtod(const char *str, char **end_ptr, int *error)
}
}
/* If we found just '+.' or '.' then point at first character */
- if (!(dec_digits= (uint) (str-old_str)) && start_of_number)
+ if (!(dec_digits= (size_t) (str-old_str)) && start_of_number)
str= start_of_number; /* Point at '+' or '.' */
}
if ((next_char == 'e' || next_char == 'E') &&
@@ -179,22 +210,16 @@ double my_strtod(const char *str, char **end_ptr, int *error)
exponent= -exponent;
neg_exp= 1; /* neg_exp was 0 before */
}
- while (exponent >= 100)
- {
- result= neg_exp ? result/1.0e100 : result*1.0e100;
- exponent-= 100;
- }
- scaler= scaler10[exponent/10]*scaler1[exponent%10];
- if (neg_exp)
- result/= scaler;
- else
- result*= scaler;
+ step= array_elements(log_10) - 1;
+ for (; exponent > step; exponent-= step)
+ result= neg_exp ? result / log_10[step] : result * log_10[step];
+ result= neg_exp ? result / log_10[exponent] : result * log_10[exponent];
}
done:
*end_ptr= (char*) str; /* end of number */
- if (overflow || isinf(result))
+ if (overflow || my_isinf(result))
{
result= DBL_MAX;
*error= EOVERFLOW;
diff --git a/strings/strxnmov.c b/strings/strxnmov.c
index 377133de69e..16469be6e45 100644
--- a/strings/strxnmov.c
+++ b/strings/strxnmov.c
@@ -39,7 +39,7 @@
#include "m_string.h"
#include <stdarg.h>
-char *strxnmov(char *dst,uint len, const char *src, ...)
+char *strxnmov(char *dst, size_t len, const char *src, ...)
{
va_list pvar;
char *end_of_dst=dst+len;
diff --git a/strings/xml.c b/strings/xml.c
index fc6c61c8a3c..5c62a8e8603 100644
--- a/strings/xml.c
+++ b/strings/xml.c
@@ -110,7 +110,7 @@ static int my_xml_scan(MY_XML_PARSER *p,MY_XML_ATTR *a)
{
int lex;
- for( ; ( p->cur < p->end) && my_xml_is_space(p->cur[0]) ; p->cur++);
+ for (; ( p->cur < p->end) && my_xml_is_space(p->cur[0]) ; p->cur++);
if (p->cur >= p->end)
{
@@ -125,7 +125,7 @@ static int my_xml_scan(MY_XML_PARSER *p,MY_XML_ATTR *a)
if ((p->end - p->cur > 3) && !bcmp(p->cur,"<!--",4))
{
- for( ; (p->cur < p->end) && bcmp(p->cur, "-->", 3); p->cur++)
+ for (; (p->cur < p->end) && bcmp(p->cur, "-->", 3); p->cur++)
{}
if (!bcmp(p->cur, "-->", 3))
p->cur+=3;
@@ -155,7 +155,7 @@ static int my_xml_scan(MY_XML_PARSER *p,MY_XML_ATTR *a)
else if ( (p->cur[0] == '"') || (p->cur[0] == '\'') )
{
p->cur++;
- for( ; ( p->cur < p->end ) && (p->cur[0] != a->beg[0]); p->cur++)
+ for (; ( p->cur < p->end ) && (p->cur[0] != a->beg[0]); p->cur++)
{}
a->end=p->cur;
if (a->beg[0] == p->cur[0])p->cur++;
@@ -185,15 +185,15 @@ ret:
}
-static int my_xml_value(MY_XML_PARSER *st, const char *str, uint len)
+static int my_xml_value(MY_XML_PARSER *st, const char *str, size_t len)
{
return (st->value) ? (st->value)(st,str,len) : MY_XML_OK;
}
-static int my_xml_enter(MY_XML_PARSER *st, const char *str, uint len)
+static int my_xml_enter(MY_XML_PARSER *st, const char *str, size_t len)
{
- if ((uint) (st->attrend-st->attr+len+1) > sizeof(st->attr))
+ if ((size_t) (st->attrend-st->attr+len+1) > sizeof(st->attr))
{
sprintf(st->errstr,"To deep XML");
return MY_XML_ERROR;
@@ -213,7 +213,7 @@ static int my_xml_enter(MY_XML_PARSER *st, const char *str, uint len)
}
-static void mstr(char *s,const char *src,uint l1, uint l2)
+static void mstr(char *s,const char *src,size_t l1, size_t l2)
{
l1 = l1<l2 ? l1 : l2;
memcpy(s,src,l1);
@@ -221,17 +221,17 @@ static void mstr(char *s,const char *src,uint l1, uint l2)
}
-static int my_xml_leave(MY_XML_PARSER *p, const char *str, uint slen)
+static int my_xml_leave(MY_XML_PARSER *p, const char *str, size_t slen)
{
char *e;
- uint glen;
+ size_t glen;
char s[32];
char g[32];
int rc;
/* Find previous '/' or beginning */
- for( e=p->attrend; (e>p->attr) && (e[0] != '/') ; e--);
- glen = (uint) ((e[0] == '/') ? (p->attrend-e-1) : p->attrend-e);
+ for (e=p->attrend; (e>p->attr) && (e[0] != '/') ; e--);
+ glen = (size_t) ((e[0] == '/') ? (p->attrend-e-1) : p->attrend-e);
if (str && (slen != glen))
{
@@ -249,7 +249,8 @@ static int my_xml_leave(MY_XML_PARSER *p, const char *str, uint slen)
if (p->flags & MY_XML_FLAG_RELATIVE_NAMES)
rc= p->leave_xml ? p->leave_xml(p, str, slen) : MY_XML_OK;
else
- rc = p->leave_xml ? p->leave_xml(p,p->attr,p->attrend-p->attr) : MY_XML_OK;
+ rc= (p->leave_xml ? p->leave_xml(p,p->attr,p->attrend-p->attr) :
+ MY_XML_OK);
*e='\0';
p->attrend=e;
@@ -258,7 +259,7 @@ static int my_xml_leave(MY_XML_PARSER *p, const char *str, uint slen)
}
-int my_xml_parse(MY_XML_PARSER *p,const char *str, uint len)
+int my_xml_parse(MY_XML_PARSER *p,const char *str, size_t len)
{
p->attrend=p->attr;
p->beg=str;
@@ -283,7 +284,7 @@ int my_xml_parse(MY_XML_PARSER *p,const char *str, uint len)
{
a.beg+= 9;
a.end-= 3;
- my_xml_value(p, a.beg, (uint) (a.end-a.beg));
+ my_xml_value(p, a.beg, (size_t) (a.end-a.beg));
continue;
}
@@ -296,7 +297,7 @@ int my_xml_parse(MY_XML_PARSER *p,const char *str, uint len)
sprintf(p->errstr,"%s unexpected (ident wanted)",lex2str(lex));
return MY_XML_ERROR;
}
- if (MY_XML_OK != my_xml_leave(p,a.beg,(uint) (a.end-a.beg)))
+ if (MY_XML_OK != my_xml_leave(p,a.beg,(size_t) (a.end-a.beg)))
return MY_XML_ERROR;
lex=my_xml_scan(p,&a);
goto gt;
@@ -316,7 +317,7 @@ int my_xml_parse(MY_XML_PARSER *p,const char *str, uint len)
if (MY_XML_IDENT == lex)
{
p->current_node_type= MY_XML_NODE_TAG;
- if (MY_XML_OK != my_xml_enter(p,a.beg,(uint) (a.end-a.beg)))
+ if (MY_XML_OK != my_xml_enter(p,a.beg,(size_t) (a.end-a.beg)))
return MY_XML_ERROR;
}
else
@@ -336,9 +337,9 @@ int my_xml_parse(MY_XML_PARSER *p,const char *str, uint len)
if ( (lex == MY_XML_IDENT) || (lex == MY_XML_STRING) )
{
p->current_node_type= MY_XML_NODE_ATTR;
- if ((MY_XML_OK != my_xml_enter(p,a.beg,(uint) (a.end-a.beg))) ||
- (MY_XML_OK != my_xml_value(p,b.beg,(uint) (b.end-b.beg))) ||
- (MY_XML_OK != my_xml_leave(p,a.beg,(uint) (a.end-a.beg))))
+ if ((MY_XML_OK != my_xml_enter(p,a.beg,(size_t) (a.end-a.beg))) ||
+ (MY_XML_OK != my_xml_value(p,b.beg,(size_t) (b.end-b.beg))) ||
+ (MY_XML_OK != my_xml_leave(p,a.beg,(size_t) (a.end-a.beg))))
return MY_XML_ERROR;
}
else
@@ -351,8 +352,8 @@ int my_xml_parse(MY_XML_PARSER *p,const char *str, uint len)
else if ((MY_XML_STRING == lex) || (MY_XML_IDENT == lex))
{
p->current_node_type= MY_XML_NODE_ATTR;
- if ((MY_XML_OK != my_xml_enter(p,a.beg,(uint) (a.end-a.beg))) ||
- (MY_XML_OK != my_xml_leave(p,a.beg,(uint) (a.end-a.beg))))
+ if ((MY_XML_OK != my_xml_enter(p,a.beg,(size_t) (a.end-a.beg))) ||
+ (MY_XML_OK != my_xml_leave(p,a.beg,(size_t) (a.end-a.beg))))
return MY_XML_ERROR;
}
else
@@ -401,7 +402,7 @@ gt:
my_xml_norm_text(&a);
if (a.beg != a.end)
{
- my_xml_value(p,a.beg,(uint) (a.end-a.beg));
+ my_xml_value(p,a.beg,(size_t) (a.end-a.beg));
}
}
}
@@ -428,14 +429,14 @@ void my_xml_parser_free(MY_XML_PARSER *p __attribute__((unused)))
void my_xml_set_value_handler(MY_XML_PARSER *p,
int (*action)(MY_XML_PARSER *p, const char *s,
- uint l))
+ size_t l))
{
p->value=action;
}
void my_xml_set_enter_handler(MY_XML_PARSER *p,
int (*action)(MY_XML_PARSER *p, const char *s,
- uint l))
+ size_t l))
{
p->enter=action;
}
@@ -443,7 +444,7 @@ void my_xml_set_enter_handler(MY_XML_PARSER *p,
void my_xml_set_leave_handler(MY_XML_PARSER *p,
int (*action)(MY_XML_PARSER *p, const char *s,
- uint l))
+ size_t l))
{
p->leave_xml=action;
}
@@ -461,7 +462,7 @@ const char *my_xml_error_string(MY_XML_PARSER *p)
}
-uint my_xml_error_pos(MY_XML_PARSER *p)
+size_t my_xml_error_pos(MY_XML_PARSER *p)
{
const char *beg=p->beg;
const char *s;
@@ -470,7 +471,7 @@ uint my_xml_error_pos(MY_XML_PARSER *p)
if (s[0] == '\n')
beg=s;
}
- return (uint) (p->cur-beg);
+ return (size_t) (p->cur-beg);
}
uint my_xml_error_lineno(MY_XML_PARSER *p)
diff --git a/support-files/Makefile.am b/support-files/Makefile.am
index b3581d65eb0..056a61f2e2a 100644
--- a/support-files/Makefile.am
+++ b/support-files/Makefile.am
@@ -25,6 +25,7 @@ EXTRA_DIST = mysql.spec.sh \
my-innodb-heavy-4G.cnf.sh \
mysql-log-rotate.sh \
mysql.server.sh \
+ mysqld_multi.server.sh \
binary-configure.sh \
magic mysql.m4 \
MySQL-shared-compat.spec.sh \
@@ -33,7 +34,10 @@ EXTRA_DIST = mysql.spec.sh \
SUBDIRS = MacOSX RHEL4-SElinux
-pkgdata_DATA = my-small.cnf \
+# Default same as 'pkgdatadir', but we can override it
+pkgsuppdir = $(datadir)/@PACKAGE@
+
+pkgsupp_DATA = my-small.cnf \
my-medium.cnf \
my-large.cnf \
my-huge.cnf \
@@ -42,7 +46,8 @@ pkgdata_DATA = my-small.cnf \
binary-configure \
ndb-config-2-node.ini
-pkgdata_SCRIPTS = mysql.server
+pkgsupp_SCRIPTS = mysql.server \
+ mysqld_multi.server
aclocaldir = $(datadir)/aclocal
aclocal_DATA = mysql.m4
@@ -59,6 +64,7 @@ CLEANFILES = my-small.cnf \
mysql-@VERSION@.spec \
mysql-log-rotate \
mysql.server \
+ mysqld_multi.server \
binary-configure \
MySQL-shared-compat.spec \
ndb-config-2-node.ini
diff --git a/support-files/compiler_warnings.supp b/support-files/compiler_warnings.supp
index 04f5a30bafa..0a2c720b81b 100644
--- a/support-files/compiler_warnings.supp
+++ b/support-files/compiler_warnings.supp
@@ -51,6 +51,11 @@ db_vrfy.c : .*comparison is always false due to limited range of data type.*
.* : conversion from '.*size_t' to 'uint32'.*
.* : conversion from '.*size_t' to 'off_t'.*
.* : conversion from '.*size_t' to 'size_s'.*
+.* : conversion from '.*size_t' to 'DWORD'.*
+.* : conversion from '.*size_t' to 'uLongf'.*
+.* : conversion from '.*size_t' to 'UINT'.*
+.* : conversion from '.*size_t' to 'uInt'.*
+.* : conversion from '.*size_t' to 'uint16'.*
#
# The following should be fixed by the ndb team
@@ -64,7 +69,9 @@ db_vrfy.c : .*comparison is always false due to limited range of data type.*
#
listener.cc : .*conversion from 'SOCKET' to 'int'.*
net_serv.cc : .*conversion from 'SOCKET' to 'int'.*
-mi_packrec.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 567
+
+# allow a little moving space for the warning below
+mi_packrec.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 560-600
#
# Wrong compiler warnings
diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh
index 92d9731e72d..e0933aff8a4 100644
--- a/support-files/mysql.server.sh
+++ b/support-files/mysql.server.sh
@@ -385,7 +385,7 @@ case "$mode" in
fi
else
# Try to find appropriate mysqld process
- mysqld_pid=`pidof $sbindir/mysqld`
+ mysqld_pid=`pidof $libexecdir/mysqld`
if test -z $mysqld_pid ; then
if test "$use_mysqld_safe" = "0" ; then
lockfile=/var/lock/subsys/mysqlmanager
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 5eade93621b..2093fc0da36 100644..100755
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -13,12 +13,15 @@
# 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")
+# 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)
-TARGET_LINK_LIBRARIES(mysql_client_test dbug mysys mysqlclient yassl taocrypt zlib wsock32)
+ADD_EXECUTABLE(mysql_client_test mysql_client_test.c ../mysys/my_memmem.c)
+TARGET_LINK_LIBRARIES(mysql_client_test mysqlclient_notls wsock32)
+
+ADD_EXECUTABLE(bug25714 bug25714.c)
+TARGET_LINK_LIBRARIES(bug25714 mysqlclient_notls wsock32)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 5f34def19bd..fbd58b88b9c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -35,7 +35,7 @@ EXTRA_DIST = auto_increment.res auto_increment.tst \
CMakeLists.txt
bin_PROGRAMS = mysql_client_test
-noinst_PROGRAMS = insert_test select_test thread_test
+noinst_PROGRAMS = insert_test select_test thread_test bug25714
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
$(openssl_includes)
@@ -52,6 +52,9 @@ select_test_SOURCES= select_test.c
insert_test_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
select_test_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
+bug25714_SOURCES= bug25714.c
+bug25714_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
+
# Fix for mit-threads
DEFS = -DUNDEF_THREADS_HACK
diff --git a/tests/bug25714.c b/tests/bug25714.c
new file mode 100644
index 00000000000..4782178e2f2
--- /dev/null
+++ b/tests/bug25714.c
@@ -0,0 +1,72 @@
+/* Copyright (C) 2007 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 <mysql.h>
+#include <m_string.h>
+#include <assert.h>
+
+int main (int argc, char **argv)
+{
+ MYSQL conn;
+ int OK;
+
+ const char* query4= "INSERT INTO federated.t1 SET Value=54";
+ const char* query5= "INSERT INTO federated.t1 SET Value=55";
+
+ MY_INIT(argv[0]);
+
+ if (argc != 2)
+ return -1;
+
+ mysql_init(&conn);
+ if (!mysql_real_connect(
+ &conn,
+ "127.0.0.1",
+ "root",
+ "",
+ "test",
+ atoi(argv[1]),
+ NULL,
+ CLIENT_FOUND_ROWS))
+ {
+ fprintf(stderr, "Failed to connect to database: Error: %s\n",
+ mysql_error(&conn));
+ return 1;
+ } else {
+ printf("%s\n", mysql_error(&conn));
+ }
+
+ OK = mysql_real_query (&conn, query4, strlen(query4));
+
+ assert(0 == OK);
+
+ printf("%ld inserted\n",
+ (long) mysql_insert_id(&conn));
+
+ OK = mysql_real_query (&conn, query5, strlen(query5));
+
+ assert(0 == OK);
+
+ printf("%ld inserted\n",
+ (long) mysql_insert_id(&conn));
+
+ mysql_close(&conn);
+ my_end(0);
+
+ return 0;
+}
+
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 0b3007dba06..7f0289d93db 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -2419,7 +2419,7 @@ static uint query_cache_hits(MYSQL *conn)
*/
static void test_ps_query_cache()
{
- MYSQL *org_mysql= mysql, *lmysql;
+ MYSQL *lmysql;
MYSQL_STMT *stmt;
int rc;
MYSQL_BIND p_bind[2],r_bind[2]; /* p: param bind; r: result bind */
@@ -2471,7 +2471,7 @@ static void test_ps_query_cache()
"(2, 'hh', 'hh'), (1, 'ii', 'ii'), (2, 'ii', 'ii')");
myquery(rc);
- for (iteration= TEST_QCACHE_ON; iteration < TEST_QCACHE_ON_OFF; iteration++)
+ for (iteration= TEST_QCACHE_ON; iteration <= TEST_QCACHE_ON_OFF; iteration++)
{
switch (iteration)
@@ -2563,8 +2563,7 @@ static void test_ps_query_cache()
check_execute(stmt, rc);
test_ps_query_cache_result(1, "hh", 2, 2, "hh", 2, 1, "ii", 2);
hits2= query_cache_hits(mysql);
- switch(iteration)
- {
+ switch(iteration) {
case TEST_QCACHE_ON_WITH_OTHER_CONN:
case TEST_QCACHE_ON: /* should have hit */
DIE_UNLESS(hits2-hits1 == 1);
@@ -2572,6 +2571,7 @@ static void test_ps_query_cache()
case TEST_QCACHE_OFF_ON:
case TEST_QCACHE_ON_OFF: /* should not have hit */
DIE_UNLESS(hits2-hits1 == 0);
+ break;
}
/* now modify parameter values and see qcache hits */
@@ -2582,8 +2582,7 @@ static void test_ps_query_cache()
test_ps_query_cache_result(1, "hh", 2, 1, "ii", 2, 2, "ii", 2);
hits1= query_cache_hits(mysql);
- switch(iteration)
- {
+ switch(iteration) {
case TEST_QCACHE_ON:
case TEST_QCACHE_OFF_ON:
case TEST_QCACHE_ON_OFF: /* should not have hit */
@@ -2591,6 +2590,7 @@ static void test_ps_query_cache()
break;
case TEST_QCACHE_ON_WITH_OTHER_CONN: /* should have hit */
DIE_UNLESS(hits1-hits2 == 1);
+ break;
}
rc= mysql_stmt_execute(stmt);
@@ -2601,8 +2601,7 @@ static void test_ps_query_cache()
mysql_stmt_close(stmt);
- switch(iteration)
- {
+ switch(iteration) {
case TEST_QCACHE_ON: /* should have hit */
DIE_UNLESS(hits2-hits1 == 1);
break;
@@ -2610,9 +2609,9 @@ static void test_ps_query_cache()
case TEST_QCACHE_ON_OFF: /* should not have hit */
DIE_UNLESS(hits2-hits1 == 0);
break;
- case TEST_QCACHE_ON_WITH_OTHER_CONN:
- mysql_close(lmysql);
- mysql= org_mysql;
+ case TEST_QCACHE_ON_WITH_OTHER_CONN: /* should have hit */
+ DIE_UNLESS(hits2-hits1 == 1);
+ break;
}
} /* for(iteration=...) */
@@ -7834,7 +7833,7 @@ static void test_explain_bug()
else
{
verify_prepare_field(result, 6, "key_len", "", MYSQL_TYPE_VAR_STRING, "",
- "", "", NAME_CHAR_LEN*MAX_KEY, 0);
+ "", "", NAME_CHAR_LEN*MAX_KEY/ my_charset_utf8_general_ci.mbmaxlen, 0);
}
verify_prepare_field(result, 7, "ref", "", MYSQL_TYPE_VAR_STRING,
@@ -12294,24 +12293,24 @@ static void test_bug6081()
int rc;
myheader("test_bug6081");
- rc= simple_command(mysql, COM_DROP_DB, current_db,
+ rc= simple_command(mysql, COM_DROP_DB, (uchar*) current_db,
(ulong)strlen(current_db), 0);
if (rc == 0 && mysql_errno(mysql) != ER_UNKNOWN_COM_ERROR)
{
myerror(NULL); /* purecov: inspected */
die(__FILE__, __LINE__, "COM_DROP_DB failed"); /* purecov: inspected */
}
- rc= simple_command(mysql, COM_DROP_DB, current_db,
+ rc= simple_command(mysql, COM_DROP_DB, (uchar*) current_db,
(ulong)strlen(current_db), 0);
myquery_r(rc);
- rc= simple_command(mysql, COM_CREATE_DB, current_db,
+ rc= simple_command(mysql, COM_CREATE_DB, (uchar*) current_db,
(ulong)strlen(current_db), 0);
if (rc == 0 && mysql_errno(mysql) != ER_UNKNOWN_COM_ERROR)
{
myerror(NULL); /* purecov: inspected */
die(__FILE__, __LINE__, "COM_CREATE_DB failed"); /* purecov: inspected */
}
- rc= simple_command(mysql, COM_CREATE_DB, current_db,
+ rc= simple_command(mysql, COM_CREATE_DB, (uchar*) current_db,
(ulong)strlen(current_db), 0);
myquery_r(rc);
rc= mysql_select_db(mysql, current_db);
@@ -13538,7 +13537,8 @@ static void test_bug9478()
/* Fill in the fethc packet */
int4store(buff, stmt->stmt_id);
buff[4]= 1; /* prefetch rows */
- rc= ((*mysql->methods->advanced_command)(mysql, COM_STMT_FETCH, buff,
+ rc= ((*mysql->methods->advanced_command)(mysql, COM_STMT_FETCH,
+ (uchar*) buff,
sizeof(buff), 0,0,1,NULL) ||
(*mysql->methods->read_query_result)(mysql));
DIE_UNLESS(rc);
@@ -13715,7 +13715,7 @@ static void test_bug11111()
for (i=0; i < 2; i++)
{
my_bind[i].buffer_type= MYSQL_TYPE_STRING;
- my_bind[i].buffer= (gptr *)&buf[i];
+ my_bind[i].buffer= (uchar* *)&buf[i];
my_bind[i].buffer_length= 20;
my_bind[i].length= &len[i];
}
@@ -14100,7 +14100,7 @@ static void test_bug11656()
for (i=0; i < 2; i++)
{
my_bind[i].buffer_type= MYSQL_TYPE_STRING;
- my_bind[i].buffer= (gptr *)&buf[i];
+ my_bind[i].buffer= (uchar* *)&buf[i];
my_bind[i].buffer_length= strlen(buf[i]);
}
mysql_stmt_bind_param(stmt, my_bind);
@@ -16074,6 +16074,384 @@ static void test_bug24179()
/*
+ Bug#28075 "COM_DEBUG crashes mysqld"
+*/
+
+static void test_bug28075()
+{
+ int rc;
+
+ DBUG_ENTER("test_bug28075");
+ myheader("test_bug28075");
+
+ rc= mysql_dump_debug_info(mysql);
+ DIE_UNLESS(rc == 0);
+
+ rc= mysql_ping(mysql);
+ DIE_UNLESS(rc == 0);
+
+ DBUG_VOID_RETURN;
+}
+
+
+/*
+ Bug#27876 (SF with cyrillic variable name fails during execution (regression))
+*/
+
+static void test_bug27876()
+{
+ int rc;
+ MYSQL_RES *result;
+
+ uchar utf8_func[] =
+ {
+ 0xd1, 0x84, 0xd1, 0x83, 0xd0, 0xbd, 0xd0, 0xba,
+ 0xd1, 0x86, 0xd0, 0xb8, 0xd0, 0xb9, 0xd0, 0xba,
+ 0xd0, 0xb0,
+ 0x00
+ };
+
+ uchar utf8_param[] =
+ {
+ 0xd0, 0xbf, 0xd0, 0xb0, 0xd1, 0x80, 0xd0, 0xb0,
+ 0xd0, 0xbc, 0xd0, 0xb5, 0xd1, 0x82, 0xd1, 0x8a,
+ 0xd1, 0x80, 0x5f, 0xd0, 0xb2, 0xd0, 0xb5, 0xd1,
+ 0x80, 0xd1, 0x81, 0xd0, 0xb8, 0xd1, 0x8f,
+ 0x00
+ };
+
+ char query[500];
+
+ DBUG_ENTER("test_bug27876");
+ myheader("test_bug27876");
+
+ rc= mysql_query(mysql, "set names utf8");
+ myquery(rc);
+
+ rc= mysql_query(mysql, "select version()");
+ myquery(rc);
+ result= mysql_store_result(mysql);
+ mytest(result);
+
+ sprintf(query, "DROP FUNCTION IF EXISTS %s", (char*) utf8_func);
+ rc= mysql_query(mysql, query);
+ myquery(rc);
+
+ sprintf(query,
+ "CREATE FUNCTION %s( %s VARCHAR(25))"
+ " RETURNS VARCHAR(25) DETERMINISTIC RETURN %s",
+ (char*) utf8_func, (char*) utf8_param, (char*) utf8_param);
+ rc= mysql_query(mysql, query);
+ myquery(rc);
+ sprintf(query, "SELECT %s(VERSION())", (char*) utf8_func);
+ rc= mysql_query(mysql, query);
+ myquery(rc);
+ result= mysql_store_result(mysql);
+ mytest(result);
+
+ sprintf(query, "DROP FUNCTION %s", (char*) utf8_func);
+ rc= mysql_query(mysql, query);
+ myquery(rc);
+
+ rc= mysql_query(mysql, "set names default");
+ myquery(rc);
+}
+
+
+/*
+ Bug#28505: mysql_affected_rows() returns wrong value if CLIENT_FOUND_ROWS
+ flag is set.
+*/
+
+static void test_bug28505()
+{
+ my_ulonglong res;
+
+ myquery(mysql_query(mysql, "drop table if exists t1"));
+ myquery(mysql_query(mysql, "create table t1(f1 int primary key)"));
+ myquery(mysql_query(mysql, "insert into t1 values(1)"));
+ myquery(mysql_query(mysql,
+ "insert into t1 values(1) on duplicate key update f1=1"));
+ res= mysql_affected_rows(mysql);
+ DIE_UNLESS(!res);
+ myquery(mysql_query(mysql, "drop table t1"));
+}
+
+
+/*
+ Bug#28934: server crash when receiving malformed com_execute packets
+*/
+
+static void test_bug28934()
+{
+ my_bool error= 0;
+ MYSQL_BIND bind[5];
+ MYSQL_STMT *stmt;
+ int cnt;
+
+ myquery(mysql_query(mysql, "drop table if exists t1"));
+ myquery(mysql_query(mysql, "create table t1(id int)"));
+
+ myquery(mysql_query(mysql, "insert into t1 values(1),(2),(3),(4),(5)"));
+ stmt= mysql_simple_prepare(mysql,"select * from t1 where id in(?,?,?,?,?)");
+ check_stmt(stmt);
+
+ memset (&bind, 0, sizeof (bind));
+ for (cnt= 0; cnt < 5; cnt++)
+ {
+ bind[cnt].buffer_type= MYSQL_TYPE_LONG;
+ bind[cnt].buffer= (char*)&cnt;
+ bind[cnt].buffer_length= 0;
+ }
+ myquery(mysql_stmt_bind_param(stmt, bind));
+
+ stmt->param_count=2;
+ error= mysql_stmt_execute(stmt);
+ DIE_UNLESS(error != 0);
+ myerror(NULL);
+ mysql_stmt_close(stmt);
+
+ myquery(mysql_query(mysql, "drop table t1"));
+}
+
+
+/*
+ Bug#27592 (stack overrun when storing datetime value using prepared statements)
+*/
+
+static void test_bug27592()
+{
+ const int NUM_ITERATIONS= 40;
+ int i;
+ int rc;
+ MYSQL_STMT *stmt= NULL;
+ MYSQL_BIND bind[1];
+ MYSQL_TIME time_val;
+
+ DBUG_ENTER("test_bug27592");
+ myheader("test_bug27592");
+
+ mysql_query(mysql, "DROP TABLE IF EXISTS t1");
+ mysql_query(mysql, "CREATE TABLE t1(c2 DATETIME)");
+
+ stmt= mysql_simple_prepare(mysql, "INSERT INTO t1 VALUES (?)");
+ DIE_UNLESS(stmt);
+
+ memset(bind, 0, sizeof(bind));
+
+ bind[0].buffer_type= MYSQL_TYPE_DATETIME;
+ bind[0].buffer= (char *) &time_val;
+ bind[0].length= NULL;
+
+ for (i= 0; i < NUM_ITERATIONS; i++)
+ {
+ time_val.year= 2007;
+ time_val.month= 6;
+ time_val.day= 7;
+ time_val.hour= 18;
+ time_val.minute= 41;
+ time_val.second= 3;
+
+ time_val.second_part=0;
+ time_val.neg=0;
+
+ rc= mysql_stmt_bind_param(stmt, bind);
+ check_execute(stmt, rc);
+
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+ }
+
+ mysql_stmt_close(stmt);
+
+ DBUG_VOID_RETURN;
+}
+
+static void test_bug29948()
+{
+ MYSQL *dbc=NULL;
+ MYSQL_STMT *stmt=NULL;
+ MYSQL_BIND bind;
+
+ int res=0;
+ my_bool auto_reconnect=1, error=0, is_null=0;
+ char kill_buf[20];
+ const char *query;
+ int buf;
+ unsigned long length, cursor_type;
+
+ dbc = mysql_init(NULL);
+ DIE_UNLESS(dbc);
+
+ mysql_options(dbc, MYSQL_OPT_RECONNECT, (char*)&auto_reconnect);
+ if (!mysql_real_connect(dbc, opt_host, opt_user,
+ opt_password, current_db, opt_port,
+ opt_unix_socket,
+ (CLIENT_FOUND_ROWS | CLIENT_MULTI_STATEMENTS |
+ CLIENT_MULTI_RESULTS)))
+ {
+ printf("connection failed: %s (%d)", mysql_error(dbc),
+ mysql_errno(dbc));
+ exit(1);
+ }
+
+ bind.buffer_type= MYSQL_TYPE_LONG;
+ bind.buffer= (char *)&buf;
+ bind.is_null= &is_null;
+ bind.error= &error;
+ bind.length= &length;
+
+ res= mysql_query(dbc, "DROP TABLE IF EXISTS t1");
+ myquery(res);
+ res= mysql_query(dbc, "CREATE TABLE t1 (a INT)");
+ myquery(res);
+ res= mysql_query(dbc, "INSERT INTO t1 VALUES(1)");
+ myquery(res);
+
+ stmt= mysql_stmt_init(dbc);
+ check_stmt(stmt);
+
+ cursor_type= CURSOR_TYPE_READ_ONLY;
+ res= mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void *)&cursor_type);
+ myquery(res);
+
+ query= "SELECT * from t1 where a=?";
+ res= mysql_stmt_prepare(stmt, query, strlen(query));
+ myquery(res);
+
+ res= mysql_stmt_bind_param(stmt, &bind);
+ myquery(res);
+
+ res= mysql_stmt_execute(stmt);
+ check_execute(stmt, res);
+
+ res= mysql_stmt_bind_result(stmt,&bind);
+ check_execute(stmt, res);
+
+ sprintf(kill_buf, "kill %ld", dbc->thread_id);
+ mysql_query(dbc, kill_buf);
+
+ res= mysql_stmt_store_result(stmt);
+ DIE_UNLESS(res);
+
+ mysql_stmt_free_result(stmt);
+ mysql_stmt_close(stmt);
+ mysql_query(dbc, "DROP TABLE t1");
+ mysql_close(dbc);
+}
+
+
+/*
+ Bug#29687 mysql_stmt_store_result memory leak in libmysqld
+*/
+
+static void test_bug29687()
+{
+ const int NUM_ITERATIONS= 40;
+ int i;
+ int rc;
+ MYSQL_STMT *stmt= NULL;
+
+ DBUG_ENTER("test_bug29687");
+ myheader("test_bug29687");
+
+ stmt= mysql_simple_prepare(mysql, "SELECT 1 FROM dual WHERE 0=2");
+ DIE_UNLESS(stmt);
+
+ for (i= 0; i < NUM_ITERATIONS; i++)
+ {
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+ mysql_stmt_store_result(stmt);
+ while (mysql_stmt_fetch(stmt)==0);
+ mysql_stmt_free_result(stmt);
+ }
+
+ mysql_stmt_close(stmt);
+ DBUG_VOID_RETURN;
+}
+
+
+/*
+ Bug #29692 Single row inserts can incorrectly report a huge number of
+ row insertions
+*/
+
+static void test_bug29692()
+{
+ MYSQL* conn;
+
+ if (!(conn= mysql_init(NULL)))
+ {
+ myerror("test_bug29692 init failed");
+ exit(1);
+ }
+
+ if (!(mysql_real_connect(conn, opt_host, opt_user,
+ opt_password, opt_db ? opt_db:"test", opt_port,
+ opt_unix_socket, CLIENT_FOUND_ROWS)))
+ {
+ myerror("test_bug29692 connection failed");
+ mysql_close(mysql);
+ exit(1);
+ }
+ myquery(mysql_query(conn, "drop table if exists t1"));
+ myquery(mysql_query(conn, "create table t1(f1 int)"));
+ myquery(mysql_query(conn, "insert into t1 values(1)"));
+ DIE_UNLESS(1 == mysql_affected_rows(conn));
+ myquery(mysql_query(conn, "drop table t1"));
+ mysql_close(conn);
+}
+
+/**
+ Bug#29306 Truncated data in MS Access with decimal (3,1) columns in a VIEW
+*/
+
+static void test_bug29306()
+{
+ MYSQL_FIELD *field;
+ int rc;
+ MYSQL_RES *res;
+
+ DBUG_ENTER("test_bug29306");
+ myheader("test_bug29306");
+
+ rc= mysql_query(mysql, "DROP TABLE IF EXISTS tab17557");
+ myquery(rc);
+ rc= mysql_query(mysql, "DROP VIEW IF EXISTS view17557");
+ myquery(rc);
+ rc= mysql_query(mysql, "CREATE TABLE tab17557 (dd decimal (3,1))");
+ myquery(rc);
+ rc= mysql_query(mysql, "CREATE VIEW view17557 as SELECT dd FROM tab17557");
+ myquery(rc);
+ rc= mysql_query(mysql, "INSERT INTO tab17557 VALUES (7.6)");
+ myquery(rc);
+
+ /* Checking the view */
+ res= mysql_list_fields(mysql, "view17557", NULL);
+ while ((field= mysql_fetch_field(res)))
+ {
+ if (! opt_silent)
+ {
+ printf("field name %s\n", field->name);
+ printf("field table %s\n", field->table);
+ printf("field decimals %d\n", field->decimals);
+ if (field->decimals < 1)
+ printf("Error! No decimals! \n");
+ printf("\n\n");
+ }
+ DIE_UNLESS(field->decimals == 1);
+ }
+ mysql_free_result(res);
+
+ rc= mysql_query(mysql, "DROP TABLE tab17557");
+ myquery(rc);
+ rc= mysql_query(mysql, "DROP VIEW view17557");
+ myquery(rc);
+
+ DBUG_VOID_RETURN;
+}
+/*
Read and parse arguments and MySQL options from my.cnf
*/
@@ -16082,23 +16460,23 @@ static char **defaults_argv;
static struct my_option client_test_long_options[] =
{
- {"basedir", 'b', "Basedir for tests.", (gptr*) &opt_basedir,
- (gptr*) &opt_basedir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"count", 't', "Number of times test to be executed", (char **) &opt_count,
- (char **) &opt_count, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0},
- {"database", 'D', "Database to use", (char **) &opt_db, (char **) &opt_db,
+ {"basedir", 'b', "Basedir for tests.", (uchar**) &opt_basedir,
+ (uchar**) &opt_basedir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"count", 't', "Number of times test to be executed", (uchar **) &opt_count,
+ (uchar **) &opt_count, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0},
+ {"database", 'D', "Database to use", (uchar **) &opt_db, (uchar **) &opt_db,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"debug", '#', "Output debug log", (gptr*) &default_dbug_option,
- (gptr*) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug", '#', "Output debug log", (uchar**) &default_dbug_option,
+ (uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"help", '?', "Display this help and exit", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
0, 0, 0, 0, 0},
- {"host", 'h', "Connect to host", (char **) &opt_host, (char **) &opt_host,
+ {"host", 'h', "Connect to host", (uchar **) &opt_host, (uchar **) &opt_host,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"password", 'p',
"Password to use when connecting to server. If password is not given it's asked from the tty.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
- {"port", 'P', "Port number to use for connection", (char **) &opt_port,
- (char **) &opt_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"port", 'P', "Port number to use for connection", (uchar **) &opt_port,
+ (uchar **) &opt_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"server-arg", 'A', "Send embedded server this as a parameter.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"show-tests", 'T', "Show all tests' names", 0, 0, 0, GET_NO_ARG, NO_ARG,
@@ -16106,19 +16484,19 @@ static struct my_option client_test_long_options[] =
{"silent", 's', "Be more silent", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0,
0},
{"socket", 'S', "Socket file to use for connection",
- (char **) &opt_unix_socket, (char **) &opt_unix_socket, 0, GET_STR,
+ (uchar **) &opt_unix_socket, (uchar **) &opt_unix_socket, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"testcase", 'c',
"May disable some code when runs as mysql-test-run testcase.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifndef DONT_ALLOW_USER_CHANGE
- {"user", 'u', "User for login if not current user", (char **) &opt_user,
- (char **) &opt_user, 0, GET_STR, REQUIRED_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},
#endif
- {"vardir", 'v', "Data dir for tests.", (gptr*) &opt_vardir,
- (gptr*) &opt_vardir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"vardir", 'v', "Data dir for tests.", (uchar**) &opt_vardir,
+ (uchar**) &opt_vardir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"getopt-ll-test", 'g', "Option for testing bug in getopt library",
- (char **) &opt_getopt_ll_test, (char **) &opt_getopt_ll_test, 0,
+ (uchar **) &opt_getopt_ll_test, (uchar **) &opt_getopt_ll_test, 0,
GET_LL, REQUIRED_ARG, 0, 0, LONGLONG_MAX, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -16357,6 +16735,15 @@ static struct my_tests_st my_tests[]= {
{ "test_status", test_status },
{ "test_bug24179", test_bug24179 },
{ "test_ps_query_cache", test_ps_query_cache },
+ { "test_bug28075", test_bug28075 },
+ { "test_bug27876", test_bug27876 },
+ { "test_bug28505", test_bug28505 },
+ { "test_bug28934", test_bug28934 },
+ { "test_bug27592", test_bug27592 },
+ { "test_bug29948", test_bug29948 },
+ { "test_bug29687", test_bug29687 },
+ { "test_bug29692", test_bug29692 },
+ { "test_bug29306", test_bug29306 },
{ 0, 0 }
};
diff --git a/tests/thread_test.c b/tests/thread_test.c
index 0ad446282c2..b3a34447271 100644
--- a/tests/thread_test.c
+++ b/tests/thread_test.c
@@ -88,30 +88,30 @@ 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},
- {"database", 'D', "Database to use", (gptr*) &database, (gptr*) &database,
+ {"database", 'D', "Database to use", (uchar**) &database, (uchar**) &database,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"host", 'h', "Connect to host", (gptr*) &host, (gptr*) &host, 0, GET_STR,
+ {"host", 'h', "Connect to host", (uchar**) &host, (uchar**) &host, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"password", 'p',
"Password to use when connecting to server. If password is not given it's asked from the tty.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
- {"user", 'u', "User for login if not current user", (gptr*) &user,
- (gptr*) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"user", 'u', "User for login if not current user", (uchar**) &user,
+ (uchar**) &user, 0, GET_STR_ALLOC, 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},
- {"verbose", 'v', "Write some progress indicators", (gptr*) &verbose,
- (gptr*) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"query", 'Q', "Query to execute in each threads", (gptr*) &query,
- (gptr*) &query, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"port", 'P', "Port number to use for connection", (gptr*) &tcp_port,
- (gptr*) &tcp_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0, 0},
- {"socket", 'S', "Socket file to use for connection", (gptr*) &unix_socket,
- (gptr*) &unix_socket, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"verbose", 'v', "Write some progress indicators", (uchar**) &verbose,
+ (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"query", 'Q', "Query to execute in each threads", (uchar**) &query,
+ (uchar**) &query, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"port", 'P', "Port number to use for connection", (uchar**) &tcp_port,
+ (uchar**) &tcp_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0, 0},
+ {"socket", 'S', "Socket file to use for connection", (uchar**) &unix_socket,
+ (uchar**) &unix_socket, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"test-count", 'c', "Run test count times (default %d)",
- (gptr*) &number_of_tests, (gptr*) &number_of_tests, 0, GET_UINT,
+ (uchar**) &number_of_tests, (uchar**) &number_of_tests, 0, GET_UINT,
REQUIRED_ARG, 1000, 0, 0, 0, 0, 0},
{"thread-count", 't', "Number of threads to start",
- (gptr*) &number_of_threads, (gptr*) &number_of_threads, 0, GET_UINT,
+ (uchar**) &number_of_threads, (uchar**) &number_of_threads, 0, GET_UINT,
REQUIRED_ARG, 2, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
diff --git a/unittest/Makefile.am b/unittest/Makefile.am
index 6197586b008..65fa615fb98 100644
--- a/unittest/Makefile.am
+++ b/unittest/Makefile.am
@@ -25,3 +25,6 @@ test:
test-verbose:
HARNESS_VERBOSE=1 perl unit.pl run $(unittests)
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/unittest/examples/Makefile.am b/unittest/examples/Makefile.am
index f3183225888..94032c00928 100644
--- a/unittest/examples/Makefile.am
+++ b/unittest/examples/Makefile.am
@@ -22,3 +22,5 @@ LDADD = -lmytap
noinst_PROGRAMS = simple-t skip-t todo-t skip_all-t no_plan-t core-t
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/unittest/mysys/Makefile.am b/unittest/mysys/Makefile.am
index 54b3d203e10..be91ef31c9d 100644
--- a/unittest/mysys/Makefile.am
+++ b/unittest/mysys/Makefile.am
@@ -23,3 +23,5 @@ LDADD = $(top_builddir)/unittest/mytap/libmytap.a \
noinst_PROGRAMS = bitmap-t base64-t my_atomic-t
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/unittest/mysys/base64-t.c b/unittest/mysys/base64-t.c
index 7e4afbb3128..1622fe22b4d 100644
--- a/unittest/mysys/base64-t.c
+++ b/unittest/mysys/base64-t.c
@@ -14,6 +14,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <my_global.h>
+#include <my_sys.h>
#include <base64.h>
#include <tap.h>
#include <string.h>
@@ -26,6 +27,7 @@ main(void)
{
int i, cmp;
size_t j, k, l, dst_len, needed_length;
+ MY_INIT("base64-t");
plan(BASE64_LOOP_COUNT * BASE64_ROWS);
diff --git a/unittest/mysys/bitmap-t.c b/unittest/mysys/bitmap-t.c
index 779508ee228..069a14ff553 100644
--- a/unittest/mysys/bitmap-t.c
+++ b/unittest/mysys/bitmap-t.c
@@ -18,12 +18,11 @@
library.
*/
-#include <tap.h>
-
#include <my_global.h>
+#include <my_sys.h>
#include <my_bitmap.h>
-
-#include <string.h>
+#include <tap.h>
+#include <m_string.h>
uint get_rand_bit(uint bitsize)
{
@@ -379,6 +378,8 @@ int main()
int i;
int const min_size = 1;
int const max_size = 1024;
+ MY_INIT("bitmap-t");
+
plan(max_size - min_size);
for (i= min_size; i < max_size; i++)
ok(do_test(i) == 0, "bitmap size %d", i);
diff --git a/unittest/mysys/my_atomic-t.c b/unittest/mysys/my_atomic-t.c
index 8280aff5422..a9e98a95cdb 100644
--- a/unittest/mysys/my_atomic-t.c
+++ b/unittest/mysys/my_atomic-t.c
@@ -14,9 +14,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <my_global.h>
-#include <tap.h>
#include <my_sys.h>
#include <my_atomic.h>
+#include <tap.h>
int32 a32,b32,c32;
my_atomic_rwlock_t rwl;
@@ -160,6 +160,7 @@ err:
int main()
{
int err;
+ MY_INIT("my_atomic-t.c");
diag("N CPUs: %d", my_getncpus());
err= my_atomic_initialize();
diff --git a/unittest/mytap/Makefile.am b/unittest/mytap/Makefile.am
index 2f77c4e3e0d..c02bcd3b49d 100644
--- a/unittest/mytap/Makefile.am
+++ b/unittest/mytap/Makefile.am
@@ -21,3 +21,6 @@ noinst_HEADERS = tap.h
libmytap_a_SOURCES = tap.c
SUBDIRS = . t
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/unittest/mytap/t/Makefile.am b/unittest/mytap/t/Makefile.am
index 576bbafa299..e89a088bb3a 100644
--- a/unittest/mytap/t/Makefile.am
+++ b/unittest/mytap/t/Makefile.am
@@ -21,3 +21,5 @@ LDADD = -lmytap
noinst_PROGRAMS = basic-t
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/vio/CMakeLists.txt b/vio/CMakeLists.txt
index e4940d54da8..83cd6f65e6d 100644..100755
--- a/vio/CMakeLists.txt
+++ b/vio/CMakeLists.txt
@@ -18,4 +18,10 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE_MUT
ADD_DEFINITIONS(-DUSE_SYMDIR)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/extra/yassl/include)
-ADD_LIBRARY(vio vio.c viosocket.c viossl.c viosslfactories.c)
+
+SET(VIO_SOURCES vio.c viosocket.c viossl.c viosslfactories.c)
+
+IF(NOT SOURCE_SUBLIBS)
+ ADD_LIBRARY(vio ${VIO_SOURCES})
+ENDIF(NOT SOURCE_SUBLIBS)
+
diff --git a/vio/test-ssl.c b/vio/test-ssl.c
index 76833e25949..855dc5fbb3e 100644
--- a/vio/test-ssl.c
+++ b/vio/test-ssl.c
@@ -106,8 +106,8 @@ main(int argc, char** argv)
child_pid = fork();
if (child_pid==-1) {
- my_free((gptr)ssl_acceptor,MYF(0));
- my_free((gptr)ssl_connector,MYF(0));
+ my_free((uchar*)ssl_acceptor,MYF(0));
+ my_free((uchar*)ssl_connector,MYF(0));
fatal_error("fork");
}
if (child_pid==0)
@@ -116,28 +116,28 @@ main(int argc, char** argv)
char xbuf[100];
int r = vio_read(client_vio,xbuf, sizeof(xbuf));
if (r<=0) {
- my_free((gptr)ssl_acceptor,MYF(0));
- my_free((gptr)ssl_connector,MYF(0));
+ my_free((uchar*)ssl_acceptor,MYF(0));
+ my_free((uchar*)ssl_connector,MYF(0));
fatal_error("client:SSL_read");
}
xbuf[r] = 0;
printf("client:got %s\n", xbuf);
- my_free((gptr)client_vio,MYF(0));
- my_free((gptr)ssl_acceptor,MYF(0));
- my_free((gptr)ssl_connector,MYF(0));
+ my_free((uchar*)client_vio,MYF(0));
+ my_free((uchar*)ssl_acceptor,MYF(0));
+ my_free((uchar*)ssl_connector,MYF(0));
}
else
{
const char* s = "Huhuhuh";
- int r = vio_write(server_vio,(gptr)s, strlen(s));
+ int r = vio_write(server_vio,(uchar*)s, strlen(s));
if (r<=0) {
- my_free((gptr)ssl_acceptor,MYF(0));
- my_free((gptr)ssl_connector,MYF(0));
+ my_free((uchar*)ssl_acceptor,MYF(0));
+ my_free((uchar*)ssl_connector,MYF(0));
fatal_error("server:SSL_write");
}
- my_free((gptr)server_vio,MYF(0));
- my_free((gptr)ssl_acceptor,MYF(0));
- my_free((gptr)ssl_connector,MYF(0));
+ my_free((uchar*)server_vio,MYF(0));
+ my_free((uchar*)ssl_acceptor,MYF(0));
+ my_free((uchar*)ssl_connector,MYF(0));
}
return 0;
}
diff --git a/vio/test-sslclient.c b/vio/test-sslclient.c
index c8e14721375..e1b8461397b 100644
--- a/vio/test-sslclient.c
+++ b/vio/test-sslclient.c
@@ -84,13 +84,13 @@ main( int argc __attribute__((unused)),
sslconnect(ssl_connector,client_vio,60L);
err = vio_read(client_vio,xbuf, sizeof(xbuf));
if (err<=0) {
- my_free((gptr)ssl_connector,MYF(0));
+ my_free((uchar*)ssl_connector,MYF(0));
fatal_error("client:SSL_read");
}
xbuf[err] = 0;
printf("client:got %s\n", xbuf);
- my_free((gptr)client_vio,MYF(0));
- my_free((gptr)ssl_connector,MYF(0));
+ my_free((uchar*)client_vio,MYF(0));
+ my_free((uchar*)ssl_connector,MYF(0));
return 0;
}
#else /* HAVE_OPENSSL */
diff --git a/vio/test-sslserver.c b/vio/test-sslserver.c
index 59456db1fd4..f55b5bae53a 100644
--- a/vio/test-sslserver.c
+++ b/vio/test-sslserver.c
@@ -59,9 +59,9 @@ do_ssl_stuff( TH_ARGS* args)
/* ----------------------------------------------- */
/* TCP connection is ready. Do server side SSL. */
- err = write(server_vio->sd,(gptr)s, strlen(s));
+ err = write(server_vio->sd,(uchar*)s, strlen(s));
sslaccept(args->ssl_acceptor,server_vio,60L);
- err = server_vio->write(server_vio,(gptr)s, strlen(s));
+ err = server_vio->write(server_vio,(uchar*)s, strlen(s));
DBUG_VOID_RETURN;
}
@@ -139,12 +139,12 @@ main(int argc __attribute__((unused)), char** argv)
#if 0
if (err<=0) {
- my_free((gptr)ssl_acceptor,MYF(0));
+ my_free((uchar*)ssl_acceptor,MYF(0));
fatal_error("server:SSL_write");
}
#endif /* 0 */
- my_free((gptr)ssl_acceptor,MYF(0));
+ my_free((uchar*)ssl_acceptor,MYF(0));
return 0;
}
#else /* HAVE_OPENSSL */
diff --git a/vio/vio.c b/vio/vio.c
index 5db54d58a79..e088687098b 100644
--- a/vio/vio.c
+++ b/vio/vio.c
@@ -228,8 +228,8 @@ void vio_delete(Vio* vio)
if (vio->type != VIO_CLOSED)
vio->vioclose(vio);
- my_free((gptr) vio->read_buffer, MYF(MY_ALLOW_ZERO_PTR));
- my_free((gptr) vio,MYF(0));
+ my_free((uchar*) vio->read_buffer, MYF(MY_ALLOW_ZERO_PTR));
+ my_free((uchar*) vio,MYF(0));
}
diff --git a/vio/vio_priv.h b/vio/vio_priv.h
index 4a272e519a3..b9f5dd0c9c4 100644
--- a/vio/vio_priv.h
+++ b/vio/vio_priv.h
@@ -23,12 +23,13 @@
#include <violite.h>
void vio_ignore_timeout(Vio *vio, uint which, uint timeout);
+void vio_timeout(Vio *vio,uint which, uint timeout);
#ifdef HAVE_OPENSSL
#include "my_net.h" /* needed because of struct in_addr */
-int vio_ssl_read(Vio *vio,gptr buf, int size);
-int vio_ssl_write(Vio *vio,const gptr buf,int size);
+size_t vio_ssl_read(Vio *vio,uchar* buf, size_t size);
+size_t vio_ssl_write(Vio *vio,const uchar* buf, size_t size);
/* When the workday is over... */
int vio_ssl_close(Vio *vio);
diff --git a/vio/viosocket.c b/vio/viosocket.c
index d3a479edac3..942f0330c57 100644
--- a/vio/viosocket.c
+++ b/vio/viosocket.c
@@ -28,12 +28,12 @@ int vio_errno(Vio *vio __attribute__((unused)))
}
-int vio_read(Vio * vio, gptr buf, int size)
+size_t vio_read(Vio * vio, uchar* buf, size_t size)
{
- int r;
+ size_t r;
DBUG_ENTER("vio_read");
- DBUG_PRINT("enter", ("sd: %d buf: 0x%lx size: %d", vio->sd, (long) buf,
- size));
+ DBUG_PRINT("enter", ("sd: %d buf: 0x%lx size: %u", vio->sd, (long) buf,
+ (uint) size));
/* Ensure nobody uses vio_read_buff and vio_read simultaneously */
DBUG_ASSERT(vio->read_end == vio->read_pos);
@@ -44,12 +44,12 @@ int vio_read(Vio * vio, gptr buf, int size)
r = read(vio->sd, buf, size);
#endif /* __WIN__ */
#ifndef DBUG_OFF
- if (r < 0)
+ if (r == (size_t) -1)
{
DBUG_PRINT("vio_error", ("Got error %d during read",errno));
}
#endif /* DBUG_OFF */
- DBUG_PRINT("exit", ("%d", r));
+ DBUG_PRINT("exit", ("%ld", (long) r));
DBUG_RETURN(r);
}
@@ -59,17 +59,17 @@ int vio_read(Vio * vio, gptr buf, int size)
reduce number of syscalls.
*/
-int vio_read_buff(Vio *vio, gptr buf, int size)
+size_t vio_read_buff(Vio *vio, uchar* buf, size_t size)
{
- int rc;
+ size_t rc;
#define VIO_UNBUFFERED_READ_MIN_SIZE 2048
DBUG_ENTER("vio_read_buff");
- DBUG_PRINT("enter", ("sd: %d buf: 0x%lx size: %d", vio->sd, (long) buf,
- size));
+ DBUG_PRINT("enter", ("sd: %d buf: 0x%lx size: %u", vio->sd, (long) buf,
+ (uint) size));
if (vio->read_pos < vio->read_end)
{
- rc= min(vio->read_end - vio->read_pos, size);
+ rc= min((size_t) (vio->read_end - vio->read_pos), size);
memcpy(buf, vio->read_pos, rc);
vio->read_pos+= rc;
/*
@@ -80,8 +80,8 @@ int vio_read_buff(Vio *vio, gptr buf, int size)
}
else if (size < VIO_UNBUFFERED_READ_MIN_SIZE)
{
- rc= vio_read(vio, vio->read_buffer, VIO_READ_BUFFER_SIZE);
- if (rc > 0)
+ rc= vio_read(vio, (uchar*) vio->read_buffer, VIO_READ_BUFFER_SIZE);
+ if (rc != 0 && rc != (size_t) -1)
{
if (rc > size)
{
@@ -99,24 +99,24 @@ int vio_read_buff(Vio *vio, gptr buf, int size)
}
-int vio_write(Vio * vio, const gptr buf, int size)
+size_t vio_write(Vio * vio, const uchar* buf, size_t size)
{
- int r;
+ size_t r;
DBUG_ENTER("vio_write");
- DBUG_PRINT("enter", ("sd: %d buf: 0x%lx size: %d", vio->sd, (long) buf,
- size));
+ DBUG_PRINT("enter", ("sd: %d buf: 0x%lx size: %u", vio->sd, (long) buf,
+ (uint) size));
#ifdef __WIN__
r = send(vio->sd, buf, size,0);
#else
r = write(vio->sd, buf, size);
#endif /* __WIN__ */
#ifndef DBUG_OFF
- if (r < 0)
+ if (r == (size_t) -1)
{
DBUG_PRINT("vio_error", ("Got error on write: %d",socket_errno));
}
#endif /* DBUG_OFF */
- DBUG_PRINT("exit", ("%d", r));
+ DBUG_PRINT("exit", ("%u", (uint) r));
DBUG_RETURN(r);
}
@@ -203,13 +203,14 @@ int vio_fastsend(Vio * vio __attribute__((unused)))
{
#ifdef __WIN__
BOOL nodelay= 1;
- r= setsockopt(vio->sd, IPPROTO_TCP, TCP_NODELAY, (const char*) &nodelay,
- sizeof(nodelay));
#else
int nodelay = 1;
- r= setsockopt(vio->sd, IPPROTO_TCP, TCP_NODELAY, (void*) &nodelay,
+#endif
+
+ r= setsockopt(vio->sd, IPPROTO_TCP, TCP_NODELAY,
+ IF_WIN(const char*, void*) &nodelay,
sizeof(nodelay));
-#endif /* __WIN__ */
+
}
if (r)
{
@@ -379,59 +380,70 @@ my_bool vio_poll_read(Vio *vio,uint timeout)
void vio_timeout(Vio *vio, uint which, uint timeout)
{
-/* TODO: some action should be taken if socket timeouts are not supported. */
#if defined(SO_SNDTIMEO) && defined(SO_RCVTIMEO)
+ int r;
+ DBUG_ENTER("vio_timeout");
+ {
#ifdef __WIN__
-
- /* Windows expects time in milliseconds as int. */
+ /* Windows expects time in milliseconds as int */
int wait_timeout= (int) timeout * 1000;
-
-#else /* ! __WIN__ */
-
+#else
/* POSIX specifies time as struct timeval. */
struct timeval wait_timeout;
wait_timeout.tv_sec= timeout;
wait_timeout.tv_usec= 0;
+#endif
-#endif /* ! __WIN__ */
+ r= setsockopt(vio->sd, SOL_SOCKET, which ? SO_SNDTIMEO : SO_RCVTIMEO,
+ IF_WIN(const char*, const void*)&wait_timeout,
+ sizeof(wait_timeout));
- /* TODO: return value should be checked. */
- (void) setsockopt(vio->sd, SOL_SOCKET, which ? SO_SNDTIMEO : SO_RCVTIMEO,
- (char*) &wait_timeout, sizeof(wait_timeout));
+ }
-#endif /* defined(SO_SNDTIMEO) && defined(SO_RCVTIMEO) */
+#ifndef DBUG_OFF
+ if (r != 0)
+ DBUG_PRINT("error", ("setsockopt failed: %d, errno: %d", r, socket_errno));
+#endif
+
+ DBUG_VOID_RETURN;
+#else
+/*
+ Platforms not suporting setting of socket timeout should either use
+ thr_alarm or just run without read/write timeout(s)
+*/
+#endif
}
#ifdef __WIN__
-int vio_read_pipe(Vio * vio, gptr buf, int size)
+size_t vio_read_pipe(Vio * vio, uchar* buf, size_t size)
{
DWORD length;
DBUG_ENTER("vio_read_pipe");
- DBUG_PRINT("enter", ("sd: %d buf: 0x%lx size: %d", vio->sd, (long) buf,
- size));
+ DBUG_PRINT("enter", ("sd: %d buf: 0x%lx size: %u", vio->sd, (long) buf,
+ (uint) size));
if (!ReadFile(vio->hPipe, buf, size, &length, NULL))
DBUG_RETURN(-1);
DBUG_PRINT("exit", ("%d", length));
- DBUG_RETURN(length);
+ DBUG_RETURN((size_t) length);
}
-int vio_write_pipe(Vio * vio, const gptr buf, int size)
+size_t vio_write_pipe(Vio * vio, const uchar* buf, size_t size)
{
DWORD length;
DBUG_ENTER("vio_write_pipe");
- DBUG_PRINT("enter", ("sd: %d buf: 0x%lx size: %d", vio->sd, (long) buf,
- size));
+ DBUG_PRINT("enter", ("sd: %d buf: 0x%lx size: %u", vio->sd, (long) buf,
+ (uint) size));
if (!WriteFile(vio->hPipe, (char*) buf, size, &length, NULL))
DBUG_RETURN(-1);
DBUG_PRINT("exit", ("%d", length));
- DBUG_RETURN(length);
+ DBUG_RETURN((size_t) length);
}
int vio_close_pipe(Vio * vio)
@@ -463,12 +475,11 @@ void vio_ignore_timeout(Vio *vio __attribute__((unused)),
#ifdef HAVE_SMEM
-int vio_read_shared_memory(Vio * vio, gptr buf, int size)
+size_t vio_read_shared_memory(Vio * vio, uchar* buf, size_t size)
{
- int length;
- int remain_local;
+ size_t length;
+ size_t remain_local;
char *current_postion;
-
DBUG_ENTER("vio_read_shared_memory");
DBUG_PRINT("enter", ("sd: %d buf: 0x%lx size: %d", vio->sd, (long) buf,
size));
@@ -485,7 +496,8 @@ int vio_read_shared_memory(Vio * vio, gptr buf, int size)
/*
WaitForMultipleObjects can return next values:
WAIT_OBJECT_0+0 - event from vio->event_server_wrote
- WAIT_OBJECT_0+1 - event from vio->event_conn_closed. We can't read anything
+ WAIT_OBJECT_0+1 - event from vio->event_conn_closed. We can't read
+ anything
WAIT_ABANDONED_0 and WAIT_TIMEOUT - fail. We can't read anything
*/
if (WaitForMultipleObjects(2, (HANDLE*)&events,FALSE,
@@ -514,23 +526,23 @@ int vio_read_shared_memory(Vio * vio, gptr buf, int size)
remain_local-=length;
if (!vio->shared_memory_remain)
- if (!SetEvent(vio->event_client_read)) DBUG_RETURN(-1);
+ {
+ if (!SetEvent(vio->event_client_read))
+ DBUG_RETURN(-1);
+ }
} while (remain_local);
length = size;
- DBUG_PRINT("exit", ("%d", length));
+ DBUG_PRINT("exit", ("%lu", (ulong) length));
DBUG_RETURN(length);
}
-int vio_write_shared_memory(Vio * vio, const gptr buf, int size)
+size_t vio_write_shared_memory(Vio * vio, const uchar* buf, size_t size)
{
- int length;
- uint remain;
+ size_t length, remain, sz;
HANDLE pos;
- int sz;
- char *current_postion;
-
+ const uchar *current_postion;
DBUG_ENTER("vio_write_shared_memory");
DBUG_PRINT("enter", ("sd: %d buf: 0x%lx size: %d", vio->sd, (long) buf,
size));
@@ -539,24 +551,27 @@ int vio_write_shared_memory(Vio * vio, const gptr buf, int size)
current_postion = buf;
while (remain != 0)
{
- if (WaitForSingleObject(vio->event_server_read, vio->net->write_timeout*1000)
- != WAIT_OBJECT_0)
+ if (WaitForSingleObject(vio->event_server_read,
+ vio->net->write_timeout*1000) !=
+ WAIT_OBJECT_0)
{
- DBUG_RETURN(-1);
- };
+ DBUG_RETURN((size_t) -1);
+ }
- sz = remain > shared_memory_buffer_length ? shared_memory_buffer_length: remain;
+ sz= (remain > shared_memory_buffer_length ? shared_memory_buffer_length :
+ remain);
int4store(vio->handle_map,sz);
pos = vio->handle_map + 4;
memcpy(pos,current_postion,sz);
remain-=sz;
current_postion+=sz;
- if (!SetEvent(vio->event_client_wrote)) DBUG_RETURN(-1);
+ if (!SetEvent(vio->event_client_wrote))
+ DBUG_RETURN((size_t) -1);
}
length = size;
- DBUG_PRINT("exit", ("%d", length));
+ DBUG_PRINT("exit", ("%lu", (ulong) length));
DBUG_RETURN(length);
}
diff --git a/vio/viossl.c b/vio/viossl.c
index 5e4203a3fb5..24bb18b9c68 100644
--- a/vio/viossl.c
+++ b/vio/viossl.c
@@ -82,35 +82,36 @@ report_errors(SSL* ssl)
}
-int vio_ssl_read(Vio *vio, gptr buf, int size)
+size_t vio_ssl_read(Vio *vio, uchar* buf, size_t size)
{
- int r;
+ size_t r;
DBUG_ENTER("vio_ssl_read");
- DBUG_PRINT("enter", ("sd: %d buf: 0x%lx size: %d ssl: 0x%lx",
- vio->sd, (long) buf, size, (long) vio->ssl_arg));
+ DBUG_PRINT("enter", ("sd: %d buf: 0x%lx size: %u ssl: 0x%lx",
+ vio->sd, (long) buf, (uint) size, (long) vio->ssl_arg));
r= SSL_read((SSL*) vio->ssl_arg, buf, size);
#ifndef DBUG_OFF
- if (r < 0)
+ if (r == (size_t) -1)
report_errors((SSL*) vio->ssl_arg);
#endif
- DBUG_PRINT("exit", ("%d", r));
+ DBUG_PRINT("exit", ("%u", (uint) r));
DBUG_RETURN(r);
}
-int vio_ssl_write(Vio *vio, const gptr buf, int size)
+size_t vio_ssl_write(Vio *vio, const uchar* buf, size_t size)
{
- int r;
+ size_t r;
DBUG_ENTER("vio_ssl_write");
- DBUG_PRINT("enter", ("sd: %d buf: 0x%lx size: %d", vio->sd, (long) buf, size));
+ DBUG_PRINT("enter", ("sd: %d buf: 0x%lx size: %u", vio->sd,
+ (long) buf, (uint) size));
r= SSL_write((SSL*) vio->ssl_arg, buf, size);
#ifndef DBUG_OFF
- if (r < 0)
+ if (r == (size_t) -1)
report_errors((SSL*) vio->ssl_arg);
#endif
- DBUG_PRINT("exit", ("%d", r));
+ DBUG_PRINT("exit", ("%u", (uint) r));
DBUG_RETURN(r);
}
@@ -123,8 +124,17 @@ int vio_ssl_close(Vio *vio)
if (ssl)
{
- switch ((r= SSL_shutdown(ssl)))
- {
+ /*
+ THE SSL standard says that SSL sockets must send and receive a close_notify
+ alert on socket shutdown to avoid truncation attacks. However, this can
+ cause problems since we often hold a lock during shutdown and this IO can
+ take an unbounded amount of time to complete. Since our packets are self
+ describing with length, we aren't vunerable to these attacks. Therefore,
+ we just shutdown by closing the socket (quiet shutdown).
+ */
+ SSL_set_quiet_shutdown(ssl, 1);
+
+ switch ((r= SSL_shutdown(ssl))) {
case 1:
/* Shutdown successful */
break;
@@ -162,78 +172,10 @@ void vio_ssl_delete(Vio *vio)
vio_delete(vio);
}
-
int sslaccept(struct st_VioSSLFd *ptr, Vio *vio, long timeout)
{
- SSL *ssl;
- my_bool unused;
- my_bool net_blocking;
- enum enum_vio_type old_type;
DBUG_ENTER("sslaccept");
- DBUG_PRINT("enter", ("sd: %d ptr: 0x%lx, timeout: %ld",
- vio->sd, (long) ptr, timeout));
-
- old_type= vio->type;
- net_blocking= vio_is_blocking(vio);
- vio_blocking(vio, 1, &unused); /* Must be called before reset */
- vio_reset(vio, VIO_TYPE_SSL, vio->sd, 0, FALSE);
-
- if (!(ssl= SSL_new(ptr->ssl_context)))
- {
- DBUG_PRINT("error", ("SSL_new failure"));
- report_errors(ssl);
- vio_reset(vio, old_type,vio->sd,0,FALSE);
- vio_blocking(vio, net_blocking, &unused);
- DBUG_RETURN(1);
- }
- vio->ssl_arg= (void*)ssl;
- DBUG_PRINT("info", ("ssl: 0x%lx timeout: %ld", (long) ssl, timeout));
- SSL_clear(ssl);
- SSL_SESSION_set_timeout(SSL_get_session(ssl), timeout);
- SSL_set_fd(ssl, vio->sd);
- if (SSL_accept(ssl) < 1)
- {
- DBUG_PRINT("error", ("SSL_accept failure"));
- report_errors(ssl);
- SSL_free(ssl);
- vio->ssl_arg= 0;
- vio_reset(vio, old_type,vio->sd,0,FALSE);
- vio_blocking(vio, net_blocking, &unused);
- DBUG_RETURN(1);
- }
-
-#ifndef DBUG_OFF
- {
- char buf[1024];
- X509 *client_cert;
- DBUG_PRINT("info",("cipher_name= '%s'", SSL_get_cipher_name(ssl)));
-
- if ((client_cert= SSL_get_peer_certificate (ssl)))
- {
- DBUG_PRINT("info",("Client certificate:"));
- X509_NAME_oneline (X509_get_subject_name (client_cert),
- buf, sizeof(buf));
- DBUG_PRINT("info",("\t subject: %s", buf));
-
- X509_NAME_oneline (X509_get_issuer_name (client_cert),
- buf, sizeof(buf));
- DBUG_PRINT("info",("\t issuer: %s", buf));
-
- X509_free (client_cert);
- }
- else
- DBUG_PRINT("info",("Client does not have certificate."));
-
- if (SSL_get_shared_ciphers(ssl, buf, sizeof(buf)))
- {
- DBUG_PRINT("info",("shared_ciphers: '%s'", buf));
- }
- else
- DBUG_PRINT("info",("no shared ciphers!"));
- }
-#endif
-
- DBUG_RETURN(0);
+ DBUG_RETURN(sslconnect(ptr, vio, timeout));
}
@@ -241,57 +183,75 @@ int sslconnect(struct st_VioSSLFd *ptr, Vio *vio, long timeout)
{
SSL *ssl;
my_bool unused;
- my_bool net_blocking;
- enum enum_vio_type old_type;
+ my_bool was_blocking;
DBUG_ENTER("sslconnect");
- DBUG_PRINT("enter", ("sd: %d ptr: 0x%lx ctx: 0x%lx",
- vio->sd, (long) ptr, (long) ptr->ssl_context));
+ DBUG_PRINT("enter", ("ptr: 0x%lx, sd: %d ctx: 0x%lx",
+ (long) ptr, vio->sd, (long) ptr->ssl_context));
+
+ /* Set socket to blocking if not already set */
+ vio_blocking(vio, 1, &was_blocking);
- old_type= vio->type;
- net_blocking= vio_is_blocking(vio);
- vio_blocking(vio, 1, &unused); /* Must be called before reset */
- vio_reset(vio, VIO_TYPE_SSL, vio->sd, 0, FALSE);
if (!(ssl= SSL_new(ptr->ssl_context)))
{
DBUG_PRINT("error", ("SSL_new failure"));
report_errors(ssl);
- vio_reset(vio, old_type, vio->sd, 0, FALSE);
- vio_blocking(vio, net_blocking, &unused);
+ vio_blocking(vio, was_blocking, &unused);
DBUG_RETURN(1);
}
- vio->ssl_arg= (void*)ssl;
DBUG_PRINT("info", ("ssl: 0x%lx timeout: %ld", (long) ssl, timeout));
SSL_clear(ssl);
SSL_SESSION_set_timeout(SSL_get_session(ssl), timeout);
SSL_set_fd(ssl, vio->sd);
- if (SSL_connect(ssl) < 1)
+
+ /*
+ SSL_do_handshake will select between SSL_connect
+ or SSL_accept depending on server or client side
+ */
+ if (SSL_do_handshake(ssl) < 1)
{
- DBUG_PRINT("error", ("SSL_connect failure"));
+ DBUG_PRINT("error", ("SSL_do_handshake failure"));
report_errors(ssl);
SSL_free(ssl);
- vio->ssl_arg= 0;
- vio_reset(vio, old_type, vio->sd, 0, FALSE);
- vio_blocking(vio, net_blocking, &unused);
+ vio_blocking(vio, was_blocking, &unused);
DBUG_RETURN(1);
}
+
+ /*
+ Connection succeeded. Install new function handlers,
+ change type, set sd to the fd used when connecting
+ and set pointer to the SSL structure
+ */
+ vio_reset(vio, VIO_TYPE_SSL, SSL_get_fd(ssl), 0, 0);
+ vio->ssl_arg= (void*)ssl;
+
#ifndef DBUG_OFF
{
- X509 *server_cert;
- DBUG_PRINT("info",("cipher_name: '%s'" , SSL_get_cipher_name(ssl)));
+ /* Print some info about the peer */
+ X509 *cert;
+ char buf[512];
+
+ DBUG_PRINT("info",("SSL connection succeeded"));
+ DBUG_PRINT("info",("Using cipher: '%s'" , SSL_get_cipher_name(ssl)));
- if ((server_cert= SSL_get_peer_certificate (ssl)))
+ if ((cert= SSL_get_peer_certificate (ssl)))
{
- char buf[256];
- DBUG_PRINT("info",("Server certificate:"));
- X509_NAME_oneline(X509_get_subject_name(server_cert), buf, sizeof(buf));
- DBUG_PRINT("info",("\t subject: %s", buf));
- X509_NAME_oneline (X509_get_issuer_name(server_cert), buf, sizeof(buf));
- DBUG_PRINT("info",("\t issuer: %s", buf));
- X509_free (server_cert);
+ DBUG_PRINT("info",("Peer certificate:"));
+ X509_NAME_oneline(X509_get_subject_name(cert), buf, sizeof(buf));
+ DBUG_PRINT("info",("\t subject: '%s'", buf));
+ X509_NAME_oneline(X509_get_issuer_name(cert), buf, sizeof(buf));
+ DBUG_PRINT("info",("\t issuer: '%s'", buf));
+ X509_free(cert);
}
else
- DBUG_PRINT("info",("Server does not have certificate."));
+ DBUG_PRINT("info",("Peer does not have certificate."));
+
+ if (SSL_get_shared_ciphers(ssl, buf, sizeof(buf)))
+ {
+ DBUG_PRINT("info",("shared_ciphers: '%s'", buf));
+ }
+ else
+ DBUG_PRINT("info",("no shared ciphers!"));
}
#endif
diff --git a/vio/viosslfactories.c b/vio/viosslfactories.c
index d26d4147c9f..d7e4f380bc1 100644
--- a/vio/viosslfactories.c
+++ b/vio/viosslfactories.c
@@ -378,6 +378,6 @@ new_VioSSLAcceptorFd(const char *key_file, const char *cert_file,
void free_vio_ssl_acceptor_fd(struct st_VioSSLFd *fd)
{
SSL_CTX_free(fd->ssl_context);
- my_free((gptr) fd, MYF(0));
+ my_free((uchar*) fd, MYF(0));
}
#endif /* HAVE_OPENSSL */
diff --git a/vio/viotest-ssl.c b/vio/viotest-ssl.c
index 81d119ff207..b8abbac4ed6 100644
--- a/vio/viotest-ssl.c
+++ b/vio/viotest-ssl.c
@@ -106,8 +106,8 @@ int main(int argc, char **argv)
child_pid = fork();
if (child_pid==-1)
{
- my_free((gptr)ssl_acceptor,MYF(0));
- my_free((gptr)ssl_connector,MYF(0));
+ my_free((uchar*)ssl_acceptor,MYF(0));
+ my_free((uchar*)ssl_connector,MYF(0));
fatal_error("fork");
}
if (child_pid==0)
@@ -116,29 +116,29 @@ int main(int argc, char **argv)
char xbuf[100];
int r = vio_ssl_read(client_vio,xbuf, sizeof(xbuf));
if (r<=0) {
- my_free((gptr)ssl_acceptor,MYF(0));
- my_free((gptr)ssl_connector,MYF(0));
+ my_free((uchar*)ssl_acceptor,MYF(0));
+ my_free((uchar*)ssl_connector,MYF(0));
fatal_error("client:SSL_read");
}
xbuf[r] = 0;
printf("client:got %s\n", xbuf);
- my_free((gptr)client_vio,MYF(0));
- my_free((gptr)ssl_acceptor,MYF(0));
- my_free((gptr)ssl_connector,MYF(0));
+ my_free((uchar*)client_vio,MYF(0));
+ my_free((uchar*)ssl_acceptor,MYF(0));
+ my_free((uchar*)ssl_connector,MYF(0));
sleep(1);
}
else
{
const char* s = "Huhuhuh";
- int r = vio_ssl_write(server_vio,(gptr)s, strlen(s));
+ int r = vio_ssl_write(server_vio,(uchar*)s, strlen(s));
if (r<=0) {
- my_free((gptr)ssl_acceptor,MYF(0));
- my_free((gptr)ssl_connector,MYF(0));
+ my_free((uchar*)ssl_acceptor,MYF(0));
+ my_free((uchar*)ssl_connector,MYF(0));
fatal_error("server:SSL_write");
}
- my_free((gptr)server_vio,MYF(0));
- my_free((gptr)ssl_acceptor,MYF(0));
- my_free((gptr)ssl_connector,MYF(0));
+ my_free((uchar*)server_vio,MYF(0));
+ my_free((uchar*)ssl_acceptor,MYF(0));
+ my_free((uchar*)ssl_connector,MYF(0));
sleep(1);
}
return 0;
diff --git a/win/Makefile.am b/win/Makefile.am
index 1bf7cce8396..279183480d8 100644
--- a/win/Makefile.am
+++ b/win/Makefile.am
@@ -14,7 +14,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
## Process this file with automake to create Makefile.in
-EXTRA_DIST = build-vs71.bat build-vs8.bat build-vs8_x64.bat configure.js README \
+EXTRA_DIST = build-vs71.bat build-vs8.bat build-vs8_x64.bat configure.js README \
mysql_manifest.cmake create_manifest.js
# Don't update the files from bitkeeper
diff --git a/win/README b/win/README
index 1e45b92abb2..916f64913ac 100644
--- a/win/README
+++ b/win/README
@@ -35,7 +35,7 @@ the link named "Complete package, excluding sources". This includes an
installer that will install bison. After the installer finishes, modify
your path so that you can execute bison.
-(Alternative you, can take the sql_yacc.yy and sql_yacc.h files from a
+(As an alternative you can take the sql_yacc.yy and sql_yacc.h files from a
matching mysql tar distribution and drop them into the sql directory just
before you start the build)
@@ -45,8 +45,11 @@ Clone your bk tree to any location you like.
Step 5
------
-From the root of your bk clone, execute the command: win\configure <options>.
-The options right now are
+From the root of your installation directory, execute the command:
+
+win\configure <options>
+
+The options right now are:
WITH_INNOBASE_STORAGE_ENGINE Enable particular storage engines
WITH_PARTITION_STORAGE_ENGINE
@@ -60,16 +63,20 @@ The options right now are
MYSQL_TCP_PORT=<port> Server port, default 3306
CYBOZU Default character set is UTF8
EMBED_MANIFESTS Embed custom manifests into final exes, otherwise VS
- default will be used.
-
+ default will be used. (Note - This option should only be
+ used by MySQL AB.)
+ WITH_EMBEDDED_SERVER Configure solution to produce libmysqld.dll
+ and the static mysqlserver.lib
+
So the command line could look like:
win\configure WITH_INNOBASE_STORAGE_ENGINE WITH_PARTITION_STORAGE_ENGINE MYSQL_SERVER_SUFFIX=-pro
Step 6
------
-From the root of your bk clone, execute one of the batch files to generate the type
-of project files you desire.
+
+From the root of your installation directory/bk clone, execute one of
+the batch files to generate the type of project files you desire.
For Visual Studio 8 (or Visual C++ 2005 express edition), do win\build-vs8.
For Visual Studio 7.1, do win\build-vs71.
@@ -80,8 +87,8 @@ Step 7
------
From the root of your bk clone, start your build.
-For Visual Studio, simply execute mysql.sln. This will start the IDE and you can
-click the build solution menu option.
+For Visual Studio, execute mysql.sln. This will start the IDE
+and you can click the build solution menu option.
Current issues
--------------
diff --git a/win/build-nmake-x64.bat b/win/build-nmake-x64.bat
new file mode 100644
index 00000000000..f73574ac8de
--- /dev/null
+++ b/win/build-nmake-x64.bat
@@ -0,0 +1,21 @@
+@echo off
+
+REM Copyright (C) 2006 MySQL AB
+REM
+REM This program is free software; you can redistribute it and/or modify
+REM it under the terms of the GNU General Public License as published by
+REM the Free Software Foundation; version 2 of the License.
+REM
+REM This program is distributed in the hope that it will be useful,
+REM but WITHOUT ANY WARRANTY; without even the implied warranty of
+REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+REM GNU General Public License for more details.
+REM
+REM You should have received a copy of the GNU General Public License
+REM along with this program; if not, write to the Free Software
+REM Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+if exist cmakecache.txt del cmakecache.txt
+copy win\nmake_x64_cache.txt cmakecache.txt
+cmake -G "NMake Makefiles"
+copy cmakecache.txt win\nmake_x64_cache.txt
diff --git a/win/build-nmake.bat b/win/build-nmake.bat
new file mode 100644
index 00000000000..89505c08313
--- /dev/null
+++ b/win/build-nmake.bat
@@ -0,0 +1,21 @@
+@echo off
+
+REM Copyright (C) 2006 MySQL AB
+REM
+REM This program is free software; you can redistribute it and/or modify
+REM it under the terms of the GNU General Public License as published by
+REM the Free Software Foundation; version 2 of the License.
+REM
+REM This program is distributed in the hope that it will be useful,
+REM but WITHOUT ANY WARRANTY; without even the implied warranty of
+REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+REM GNU General Public License for more details.
+REM
+REM You should have received a copy of the GNU General Public License
+REM along with this program; if not, write to the Free Software
+REM Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+if exist cmakecache.txt del cmakecache.txt
+copy win\nmake_cache.txt cmakecache.txt
+cmake -G "NMake Makefiles"
+copy cmakecache.txt win\nmake_cache.txt
diff --git a/win/configure.js b/win/configure.js
index 7225fff119b..7e10ac34697 100644
--- a/win/configure.js
+++ b/win/configure.js
@@ -47,9 +47,11 @@ try
case "__NT__":
case "CYBOZU":
case "EMBED_MANIFESTS":
+ case "WITH_EMBEDDED_SERVER":
configfile.WriteLine("SET (" + args.Item(i) + " TRUE)");
break;
case "MYSQL_SERVER_SUFFIX":
+ case "MYSQLD_EXE_SUFFIX":
configfile.WriteLine("SET (" + parts[0] + " \""
+ parts[1] + "\")");
break;
diff --git a/win/create_manifest.js b/win/create_manifest.js
index 5605f57ef74..dec8f6e62e2 100755
--- a/win/create_manifest.js
+++ b/win/create_manifest.js
@@ -1,11 +1,10 @@
/*
manifest.js - Writes a custom XML manifest for each executable/library
- 6 command line options must be supplied:
+ 5 command line options must be supplied:
name - Name of the executable/library into which the mainfest will be
embedded.
version - Version of the executable
arch - Architecture intended.
- type - Application type.
exe_level - Application execution level.
[asInvoker|highestAvailable|requireAdministrator]
outfile - Final destination where mainfest will be written.
@@ -27,14 +26,16 @@ try
var app_name= parts[1];
break;
case "version":
- var app_version= parts[1];
+ var supp_version= parts[1];
+ // Clean up the supplied version string.
+ var end= supp_version.indexOf("-");
+ if (end == -1) end= supp_version.length;
+ var app_version= supp_version.substring(0, end);
+ app_version+= ".0";
break;
case "arch":
var app_arch= parts[1];
break;
- case "type":
- var app_type= parts[1];
- break;
case "exe_level":
var app_exe_level= parts[1];
break;
@@ -45,7 +46,7 @@ try
WScript.echo("Invalid argument supplied.");
}
}
- if (i != 6)
+ if (i != 5)
throw new Error(1, "Incorrect number of arguments.");
var manifest_xml= "<?xml version=\'1.0\' encoding=\'UTF-8\' standalone=\'yes\'?>\r\n";
@@ -55,8 +56,8 @@ try
manifest_xml+= "\t<assemblyIdentity name=\'" + app_name + "\'";
manifest_xml+= " version=\'" + app_version + "\'";
manifest_xml+= " processorArchitecture=\'" + app_arch + "\'";
- // TOADD - Add publicKeyToken attribute once we have Authenticode key.
- manifest_xml+= " type=\'" + app_type + "\' />\r\n";
+ manifest_xml+= " publicKeyToken=\'02ad33b422233ae3\'";
+ manifest_xml+= " type=\'win32\' />\r\n";
// Identify the application security requirements.
manifest_xml+= "\t<trustInfo xmlns=\'urn:schemas-microsoft-com:asm.v2\'>\r\n";
manifest_xml+= "\t\t<security>\r\n\t\t\t<requestedPrivileges>\r\n\t\t\t\t";
diff --git a/win/mysql_manifest.cmake b/win/mysql_manifest.cmake
index b5bb6fda8fb..611553d68ac 100755
--- a/win/mysql_manifest.cmake
+++ b/win/mysql_manifest.cmake
@@ -9,12 +9,13 @@ MACRO(MYSQL_EMBED_MANIFEST _target_name _required_privs)
TARGET ${_target_name}
PRE_LINK
COMMAND cscript.exe
- ARGS "${PROJECT_SOURCE_DIR}/win/create_manifest.js" name=$(ProjectName) version=${VERSION} arch=${PROCESSOR_ARCH} type=$(PlatformName) exe_level=${_required_privs} outfile=$(IntDir)\\$(TargetFileName).intermediate.manifest
+ ARGS "${PROJECT_SOURCE_DIR}/win/create_manifest.js" name=$(TargetName) version=${VERSION} arch=${PROCESSOR_ARCH} exe_level=${_required_privs} outfile=$(IntDir)\\$(TargetFileName).intermediate.manifest
COMMENT "Generates the contents of the manifest contents.")
ADD_CUSTOM_COMMAND(
TARGET ${_target_name}
POST_BUILD
- COMMAND mt.exe
- ARGS -nologo -manifest $(IntDir)\\$(TargetFileName).intermediate.manifest -outputresource:$(TargetPath)
- COMMENT "Embeds the manifest contents.")
+ COMMAND mt.exe ARGS -nologo -hashupdate -makecdfs -manifest $(IntDir)\\$(TargetFileName).intermediate.manifest -outputresource:$(TargetPath)
+ COMMAND makecat.exe ARGS $(IntDir)\\$(TargetFileName).intermediate.manifest.cdf
+ COMMAND signtool.exe ARGS sign /a /t http://timestamp.verisign.com/scripts/timstamp.dll $(TargetPath)
+ COMMENT "Embeds the manifest contents, creates a cryptographic catalog, signs the target with Authenticode certificate.")
ENDMACRO(MYSQL_EMBED_MANIFEST)
diff --git a/zlib/CMakeLists.txt b/zlib/CMakeLists.txt
index ac315b0dd85..43235b631f6 100644..100755
--- a/zlib/CMakeLists.txt
+++ b/zlib/CMakeLists.txt
@@ -13,11 +13,18 @@
# 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")
+# Note that this library is not using any "Thread Local Storage" (TLS),
+# i.e. no data declared "__declspec(thread)" or allocated with TlsAlloc().
+# Not directly and indirectly using any of the macros for creating and
+# using the storage, pthread_key*(), {,my_}{set,get}_specific*() ....
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/zlib)
+
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG")
-ADD_DEFINITIONS(-DUSE_TLS -DMYSQL_CLIENT -D__WIN32__)
-ADD_LIBRARY(zlib adler32.c compress.c crc32.c crc32.h deflate.c deflate.h gzio.c infback.c inffast.c inffast.h
+SET(ZLIB_SOURCES adler32.c compress.c crc32.c crc32.h deflate.c deflate.h gzio.c infback.c inffast.c inffast.h
inffixed.h inflate.c inflate.h inftrees.c inftrees.h trees.c trees.h uncompr.c zconf.h zlib.h
zutil.c zutil.h)
- \ No newline at end of file
+IF(NOT SOURCE_SUBLIBS)
+ ADD_LIBRARY(zlib ${ZLIB_SOURCES})
+ENDIF(NOT SOURCE_SUBLIBS)